Skip to content

Commit 1efd29e

Browse files
feat(module:tag): export NzTagColor type (#9314)
1 parent 527ffb6 commit 1efd29e

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

components/tag/public-api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55

66
export * from './tag.component';
77
export * from './tag.module';
8+
export * from './typings';

components/tag/tag.component.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@ import {
2323
} from '@angular/core';
2424
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
2525

26-
import {
27-
isPresetColor,
28-
isStatusColor,
29-
NzPresetColor,
30-
NzStatusColor,
31-
presetColors,
32-
statusColors
33-
} from 'ng-zorro-antd/core/color';
26+
import { isPresetColor, isStatusColor, presetColors, statusColors } from 'ng-zorro-antd/core/color';
3427
import { NzIconModule } from 'ng-zorro-antd/icon';
3528

29+
import { NzTagColor } from './typings';
30+
3631
@Component({
3732
selector: 'nz-tag',
3833
exportAs: 'nzTag',
@@ -64,7 +59,7 @@ export class NzTagComponent implements OnChanges, OnInit {
6459
private destroyRef = inject(DestroyRef);
6560

6661
@Input() nzMode: 'default' | 'closeable' | 'checkable' = 'default';
67-
@Input() nzColor?: string | NzStatusColor | NzPresetColor;
62+
@Input() nzColor?: NzTagColor;
6863
@Input({ transform: booleanAttribute }) nzChecked = false;
6964
@Input({ transform: booleanAttribute }) nzBordered = true;
7065
@Output() readonly nzOnClose = new EventEmitter<MouseEvent>();

components/tag/typings.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Use of this source code is governed by an MIT-style license that can be
3+
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
4+
*/
5+
6+
import { NzPresetColor, NzStatusColor } from 'ng-zorro-antd/core/color';
7+
8+
export type NzTagColor = NzPresetColor | NzStatusColor | (string & {});

0 commit comments

Comments
 (0)