Skip to content

Commit d5e5772

Browse files
authored
refactor(module:tabs): remove deprecated nz-tabset selector (#9613)
BREAKING CHANGE: remove deprecated `nz-tabset` selector
1 parent cd67a82 commit d5e5772

6 files changed

Lines changed: 3 additions & 109 deletions

File tree

components/tabs/tab-bar-extra-content.directive.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import { Directive, inject, input, TemplateRef } from '@angular/core';
77

88
@Directive({
9-
// TODO: Remove `nz-tabset` in 21.0.0
10-
selector: '[nzTabBarExtraContent]:not(nz-tabset):not(nz-tabs)'
9+
selector: '[nzTabBarExtraContent]:not(nz-tabs)'
1110
})
1211
export class NzTabBarExtraContentDirective {
1312
readonly position = input<'start' | 'end'>('end', { alias: 'nzTabBarExtraContent' });

components/tabs/tabs.component.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
44
*/
55

6-
/** get some code from https://github.com/angular/material2 */
7-
86
import { A11yModule } from '@angular/cdk/a11y';
97
import { Direction, Directionality } from '@angular/cdk/bidi';
108
import { coerceNumberProperty } from '@angular/cdk/coercion';
@@ -21,7 +19,6 @@ import {
2119
DestroyRef,
2220
EventEmitter,
2321
forwardRef,
24-
HOST_TAG_NAME,
2522
inject,
2623
Input,
2724
NgZone,
@@ -38,7 +35,7 @@ import { merge, Observable, of, Subscription } from 'rxjs';
3835
import { delay, filter, first, startWith } from 'rxjs/operators';
3936

4037
import { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';
41-
import { PREFIX, warn } from 'ng-zorro-antd/core/logger';
38+
import { PREFIX } from 'ng-zorro-antd/core/logger';
4239
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
4340
import { NzSafeAny, NzSizeLDSType } from 'ng-zorro-antd/core/types';
4441
import { wrapIntoObservable } from 'ng-zorro-antd/core/util';
@@ -65,7 +62,7 @@ const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'tabs';
6562
let nextId = 0;
6663

6764
@Component({
68-
selector: 'nz-tabs,nz-tabset',
65+
selector: 'nz-tabs',
6966
exportAs: 'nzTabs',
7067
encapsulation: ViewEncapsulation.None,
7168
changeDetection: ChangeDetectionStrategy.Default,
@@ -282,11 +279,6 @@ export class NzTabsComponent implements OnInit, AfterContentChecked, AfterConten
282279
constructor() {
283280
this.tabSetId = nextId++;
284281

285-
// TODO: Remove this warning in 21.0.0
286-
if (inject(HOST_TAG_NAME) === 'nz-tabset') {
287-
warn(`${PREFIX} <nz-tabset> is deprecated, please use <nz-tabs> instead.`);
288-
}
289-
290282
this.destroyRef.onDestroy(() => {
291283
this.tabs.destroy();
292284
this.tabLabelSubscription.unsubscribe();
@@ -526,8 +518,3 @@ export class NzTabsComponent implements OnInit, AfterContentChecked, AfterConten
526518
: false;
527519
}
528520
}
529-
530-
/**
531-
* @deprecated Use `NzTabsComponent` instead. This will be removed in 21.0.0.
532-
*/
533-
export const NzTabSetComponent = NzTabsComponent;

schematics/ng-update/upgrade-rules/checks/tabs-input-rule.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

schematics/ng-update/upgrade-rules/checks/tabs-output-rule.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

schematics/ng-update/upgrade-rules/checks/tabs-template-rule.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

schematics/ng-update/upgrade-rules/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ import { ModalTemplateRule } from './checks/modal-template-rule';
1717
import { SecondaryEntryPointsRule } from './checks/secondary-entry-points-rule';
1818
import { SpaceTemplateRule } from './checks/space-template-rule';
1919
import { TableTemplateRule } from './checks/table-template-rule';
20-
import { TabsInputRule } from './checks/tabs-input-rule';
21-
import { TabsOutputRule } from './checks/tabs-output-rule';
22-
import { TabsTemplateRule } from './checks/tabs-template-rule';
2320
import { TooltipLikeTemplateRule } from './checks/tooltip-like-template-rule';
2421

2522
export const nzUpgradeRules: NullableDevkitMigration[] = [
@@ -32,9 +29,6 @@ export const nzUpgradeRules: NullableDevkitMigration[] = [
3229
GlobalConfigRule,
3330
FormTemplateRule,
3431
GridTemplateRule,
35-
TabsInputRule,
36-
TabsOutputRule,
37-
TabsTemplateRule,
3832
TableTemplateRule,
3933
ModalTemplateRule,
4034
SecondaryEntryPointsRule,

0 commit comments

Comments
 (0)