Skip to content

Commit

Permalink
Merge branch 'master' into fix/deferred-cd-prevent-updating-destroyed…
Browse files Browse the repository at this point in the history
…-components
  • Loading branch information
yggg authored Dec 17, 2020
2 parents 8737184 + 09c5e91 commit 3a5fbe8
Show file tree
Hide file tree
Showing 18 changed files with 16 additions and 141 deletions.
3 changes: 0 additions & 3 deletions src/framework/auth/styles/_all.scss

This file was deleted.

2 changes: 1 addition & 1 deletion src/framework/auth/styles/prebuilt/corporate.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../../../theme/styles/all';
@import '../all';
@import '../globals';

$nb-enabled-themes: (corporate);

Expand Down
2 changes: 1 addition & 1 deletion src/framework/auth/styles/prebuilt/cosmic.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../../../theme/styles/all';
@import '../all';
@import '../globals';

$nb-enabled-themes: (cosmic);

Expand Down
2 changes: 1 addition & 1 deletion src/framework/auth/styles/prebuilt/dark.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../../../theme/styles/all';
@import '../all';
@import '../globals';

$nb-enabled-themes: (dark);

Expand Down
2 changes: 1 addition & 1 deletion src/framework/auth/styles/prebuilt/default.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../../../theme/styles/all';
@import '../all';
@import '../globals';

$nb-enabled-themes: (default);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ export class NbAutocompleteDirective<T> implements OnDestroy, AfterViewInit, Con
protected triggerStrategyBuilder: NbTriggerStrategyBuilderService,
protected positionBuilder: NbPositionBuilderService,
protected activeDescendantKeyManagerFactory: NbActiveDescendantKeyManagerFactoryService<NbOptionComponent<T>>,
// @breaking-change @7.0.0 Make renderer required.
@Optional() protected renderer?: Renderer2,
protected renderer: Renderer2,
) {}

ngAfterViewInit() {
Expand Down Expand Up @@ -265,12 +264,7 @@ export class NbAutocompleteDirective<T> implements OnDestroy, AfterViewInit, Con
}

setDisabledState(disabled: boolean): void {
// @breaking-change @7.0.0 Keep only `this.renderer.setProperty` without `if/else`.
if (this.renderer) {
this.renderer.setProperty(this.hostRef.nativeElement, 'disabled', disabled);
} else if (this.hostRef.nativeElement) {
this.hostRef.nativeElement.disabled = disabled;
}
this.renderer.setProperty(this.hostRef.nativeElement, 'disabled', disabled);
}

protected subscribeOnOptionClick() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ export interface NbRenderableContainer {
@Component({
template: '',
})
// @breaking-change @5.0.0 Rename to NbPositionedContainerComponent and enable ts lint
// tslint:disable-next-line
export class NbPositionedContainer {
export class NbPositionedContainerComponent {
@Input() position: NbPosition;

@HostBinding('class.nb-overlay-top')
Expand Down
4 changes: 2 additions & 2 deletions src/framework/theme/components/cdk/overlay/overlay.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NbSharedModule } from '../../shared/shared.module';
import { NbA11yModule } from '../a11y/a11y.module';
import { NbCdkMappingModule } from './mapping';
import { NbPositionBuilderService } from './overlay-position';
import { NbOverlayContainerComponent, NbPositionedContainer } from './overlay-container';
import { NbOverlayContainerComponent, NbPositionedContainerComponent } from './overlay-container';
import { NbOverlayService } from './overlay-service';
import { NbCdkAdapterModule } from '../adapter/adapter.module';
import { NbPositionHelper } from './position-helper';
Expand All @@ -17,7 +17,7 @@ import { NbTriggerStrategyBuilderService } from './overlay-trigger';
NbSharedModule,
],
declarations: [
NbPositionedContainer,
NbPositionedContainerComponent,
NbOverlayContainerComponent,
],
exports: [
Expand Down
34 changes: 0 additions & 34 deletions src/framework/theme/components/checkbox/checkbox.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,25 +283,6 @@ export class NbCheckboxComponent implements AfterViewInit, ControlValueAccessor
onChange: any = () => { };
onTouched: any = () => { };

/**
* Checkbox value
* @deprecated
* @breaking-change Remove @5.0.0
*/
@Input()
get value(): boolean {
return this.checked;
}

/**
* @deprecated
* @breaking-change Remove @5.0.0
*/
set value(value: boolean) {
console.warn('NbCheckbox: `value` is deprecated and will be removed in 5.0.0. Use `checked` instead.');
this.checked = value;
}

@Input()
get checked(): boolean {
return this._checked;
Expand Down Expand Up @@ -356,21 +337,6 @@ export class NbCheckboxComponent implements AfterViewInit, ControlValueAccessor
private _indeterminate: boolean = false;
static ngAcceptInputType_indeterminate: NbBooleanInput;

/**
* Output when checked state is changed by a user
* @deprecated
* @breaking-change Remove @5.0.0
* @type EventEmitter<boolean>
*/
@Output()
get valueChange(): EventEmitter<boolean> {
console.warn('NbCheckbox: `valueChange` is deprecated and will be removed in 5.0.0. Use `checkedChange` instead.');
return this.checkedChange;
}
set valueChange(valueChange: EventEmitter<boolean>) {
this.checkedChange = valueChange;
}

/**
* Output when checked state is changed by a user
* @type EventEmitter<boolean>
Expand Down
37 changes: 0 additions & 37 deletions src/framework/theme/components/checkbox/checkbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ describe('Component: NbCheckbox', () => {
expect(checkboxInput.nativeElement.disabled).toBeFalsy();
});

it('Setting deprecated value to true makes checkbox input checked', () => {
checkbox.value = true;
fixture.detectChanges();
expect(checkboxInput.nativeElement.checked).toBeTruthy();
});

it('Setting deprecated value to false makes checkbox input unchecked', () => {
checkbox.value = false;
fixture.detectChanges();
expect(checkboxInput.nativeElement.checked).toBeFalsy();
});

it('Setting checked to true makes checkbox input checked', () => {
checkbox.checked = true;
fixture.detectChanges();
Expand Down Expand Up @@ -94,31 +82,6 @@ describe('Component: NbCheckbox', () => {
expect(testContainerEl.classList.contains('status-info')).toBeTruthy();
});

it('deprecated should not emit change event when input changed', () => {

const spy = jasmine.createSpy('valueChange subscriber');

checkbox.valueChange
.subscribe(spy);

checkbox.checked = true;
fixture.detectChanges();
expect(spy).toHaveBeenCalledTimes(0);
});

it('deprecated should emit change event when clicked', () => {

const spy = jasmine.createSpy('valueChange subscriber');

checkbox.valueChange
.subscribe(spy);

label.nativeElement.click();

fixture.detectChanges();
expect(spy).toHaveBeenCalledTimes(1);
});

it('should not emit change event when input changed', () => {

const spy = jasmine.createSpy('checkedChange subscriber');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { Component, Input } from '@angular/core';

import { NbMenuItem } from '../../components/menu/menu.service';
import { NbPositionedContainer, NbRenderableContainer } from '../cdk/overlay/overlay-container';
import { NbPositionedContainerComponent, NbRenderableContainer } from '../cdk/overlay/overlay-container';

/**
* Context menu component used as content within NbContextMenuDirective.
Expand All @@ -30,7 +30,7 @@ import { NbPositionedContainer, NbRenderableContainer } from '../cdk/overlay/ove
<nb-menu class="context-menu" [items]="context.items" [tag]="context.tag"></nb-menu>
`,
})
export class NbContextMenuComponent extends NbPositionedContainer implements NbRenderableContainer {
export class NbContextMenuComponent extends NbPositionedContainerComponent implements NbRenderableContainer {

@Input() items: NbMenuItem[] = [];
@Input() tag: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { Component, ComponentRef, ViewChild } from '@angular/core';

import { NbComponentPortal } from '../cdk/overlay/mapping';
import { NbOverlayContainerComponent, NbPositionedContainer } from '../cdk/overlay/overlay-container';
import { NbOverlayContainerComponent, NbPositionedContainerComponent } from '../cdk/overlay/overlay-container';


@Component({
Expand All @@ -16,7 +16,7 @@ import { NbOverlayContainerComponent, NbPositionedContainer } from '../cdk/overl
<nb-overlay-container></nb-overlay-container>
`,
})
export class NbDatepickerContainerComponent extends NbPositionedContainer {
export class NbDatepickerContainerComponent extends NbPositionedContainerComponent {

// TODO static must be false as of Angular 9.0.0, issues/1514
@ViewChild(NbOverlayContainerComponent, { static: true }) overlayContainer: NbOverlayContainerComponent;
Expand Down
4 changes: 2 additions & 2 deletions src/framework/theme/components/popover/popover.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { NbComponentPortal, NbTemplatePortal } from '../cdk/overlay/mapping';
import {
NbOverlayContainerComponent,
NbPositionedContainer,
NbPositionedContainerComponent,
NbRenderableContainer,
} from '../cdk/overlay/overlay-container';

Expand Down Expand Up @@ -47,7 +47,7 @@ import {
<nb-overlay-container></nb-overlay-container>
`,
})
export class NbPopoverComponent extends NbPositionedContainer implements NbRenderableContainer {
export class NbPopoverComponent extends NbPositionedContainerComponent implements NbRenderableContainer {
@ViewChild(NbOverlayContainerComponent) overlayContainer: NbOverlayContainerComponent;

@Input() content: any;
Expand Down
6 changes: 0 additions & 6 deletions src/framework/theme/components/popover/popover.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ export class NbPopoverDirective implements NbDynamicOverlayController, OnChanges
return this._adjustment;
}
set adjustment(value: NbAdjustment) {
if (!value) {
// @breaking-change Remove @5.0.0
console.warn(`Falsy values for 'nbPopoverAdjustment' are deprecated and will be removed in Nebular 5.
Use 'noop' instead.`);
value = NbAdjustment.NOOP;
}
this._adjustment = value;
}
protected _adjustment: NbAdjustment = NbAdjustment.CLOCKWISE;
Expand Down
2 changes: 1 addition & 1 deletion src/framework/theme/components/toastr/toast.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="icon-container" *ngIf="hasIcon && icon">
<nb-icon [config]="iconConfig"></nb-icon>
<nb-icon [config]="icon"></nb-icon>
</div>
<div class="content-container">
<span class="title subtitle">{{ toast.title }}</span>
Expand Down
25 changes: 0 additions & 25 deletions src/framework/theme/components/toastr/toast.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,31 +157,6 @@ export class NbToastComponent implements OnInit {
return this.toast.config.icon;
}

/* @deprecated Use pack property of icon config */
get iconPack(): string {
return this.toast.config.iconPack;
}

/*
@breaking-change 5 remove
@deprecated
*/
get iconConfig(): NbIconConfig {
const toastConfig = this.toast.config;
const isIconName = typeof this.icon === 'string';

if (!isIconName) {
return toastConfig.icon as NbIconConfig;
}

const iconConfig: NbIconConfig = { icon: toastConfig.icon as string };
if (toastConfig.iconPack) {
iconConfig.pack = toastConfig.iconPack;
}

return iconConfig;
}

@HostListener('click')
onClick() {
this.destroy.emit();
Expand Down
6 changes: 0 additions & 6 deletions src/framework/theme/components/toastr/toastr-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ export class NbToastrConfig {
* Icon name or icon config object that can be provided to render custom icon.
* */
icon: string | NbIconConfig = 'email';
/**
* Icon pack to look for the icon in.
* @deprecated Set pack via icon config object passed to icon property
* @breaking-change 5.0.0
* */
iconPack: string;
/**
* Toast status icon-class mapping.
* */
Expand Down
6 changes: 0 additions & 6 deletions src/framework/theme/components/tooltip/tooltip.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ export class NbTooltipDirective implements OnInit, OnChanges, AfterViewInit, OnD
return this._adjustment;
}
set adjustment(value: NbAdjustment) {
if (!value) {
// @breaking-change Remove @5.0.0
console.warn(`Falsy values for 'nbPopoverAdjustment' are deprecated and will be removed in Nebular 5.
Use 'noop' instead.`);
value = NbAdjustment.NOOP;
}
this._adjustment = value;
}
protected _adjustment: NbAdjustment = NbAdjustment.CLOCKWISE;
Expand Down

0 comments on commit 3a5fbe8

Please sign in to comment.