@delon/abc 20.1.1 → 21.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/fesm2022/auto-focus.mjs +10 -10
  2. package/fesm2022/auto-focus.mjs.map +1 -1
  3. package/fesm2022/cell.mjs +23 -25
  4. package/fesm2022/cell.mjs.map +1 -1
  5. package/fesm2022/chart-observer-size.mjs +21 -34
  6. package/fesm2022/chart-observer-size.mjs.map +1 -1
  7. package/fesm2022/count-down.mjs +24 -31
  8. package/fesm2022/count-down.mjs.map +1 -1
  9. package/fesm2022/date-picker.mjs +89 -85
  10. package/fesm2022/date-picker.mjs.map +1 -1
  11. package/fesm2022/down-file.mjs +23 -43
  12. package/fesm2022/down-file.mjs.map +1 -1
  13. package/fesm2022/ellipsis.mjs +163 -104
  14. package/fesm2022/ellipsis.mjs.map +1 -1
  15. package/fesm2022/error-collect.mjs +11 -13
  16. package/fesm2022/error-collect.mjs.map +1 -1
  17. package/fesm2022/exception.mjs +9 -9
  18. package/fesm2022/exception.mjs.map +1 -1
  19. package/fesm2022/footer-toolbar.mjs +9 -9
  20. package/fesm2022/footer-toolbar.mjs.map +1 -1
  21. package/fesm2022/full-content.mjs +50 -58
  22. package/fesm2022/full-content.mjs.map +1 -1
  23. package/fesm2022/global-footer.mjs +14 -15
  24. package/fesm2022/global-footer.mjs.map +1 -1
  25. package/fesm2022/hotkey.mjs +7 -7
  26. package/fesm2022/hotkey.mjs.map +1 -1
  27. package/fesm2022/loading.mjs +61 -14
  28. package/fesm2022/loading.mjs.map +1 -1
  29. package/fesm2022/lodop.mjs +7 -7
  30. package/fesm2022/media.mjs +37 -61
  31. package/fesm2022/media.mjs.map +1 -1
  32. package/fesm2022/notice-icon.mjs +220 -25
  33. package/fesm2022/notice-icon.mjs.map +1 -1
  34. package/fesm2022/onboarding.mjs +160 -62
  35. package/fesm2022/onboarding.mjs.map +1 -1
  36. package/fesm2022/page-header.mjs +252 -155
  37. package/fesm2022/page-header.mjs.map +1 -1
  38. package/fesm2022/pdf.mjs +7 -7
  39. package/fesm2022/pdf.mjs.map +1 -1
  40. package/fesm2022/quick-menu.mjs +79 -71
  41. package/fesm2022/quick-menu.mjs.map +1 -1
  42. package/fesm2022/reuse-tab.mjs +257 -160
  43. package/fesm2022/reuse-tab.mjs.map +1 -1
  44. package/fesm2022/se.mjs +289 -309
  45. package/fesm2022/se.mjs.map +1 -1
  46. package/fesm2022/sg.mjs +32 -69
  47. package/fesm2022/sg.mjs.map +1 -1
  48. package/fesm2022/st.mjs +93 -84
  49. package/fesm2022/st.mjs.map +1 -1
  50. package/fesm2022/sv.mjs +185 -174
  51. package/fesm2022/sv.mjs.map +1 -1
  52. package/fesm2022/tag-select.mjs +44 -25
  53. package/fesm2022/tag-select.mjs.map +1 -1
  54. package/fesm2022/xlsx.mjs +14 -17
  55. package/fesm2022/xlsx.mjs.map +1 -1
  56. package/fesm2022/zip.mjs +4 -4
  57. package/fesm2022/zip.mjs.map +1 -1
  58. package/package.json +37 -37
  59. package/{auto-focus/index.d.ts → types/auto-focus.d.ts} +2 -2
  60. package/{cell/index.d.ts → types/cell.d.ts} +12 -13
  61. package/{observers/index.d.ts → types/chart-observer-size.d.ts} +5 -9
  62. package/{count-down/index.d.ts → types/count-down.d.ts} +6 -10
  63. package/{date-picker/index.d.ts → types/date-picker.d.ts} +6 -10
  64. package/types/down-file.d.ts +32 -0
  65. package/types/ellipsis.d.ts +46 -0
  66. package/types/error-collect.d.ts +34 -0
  67. package/{exception/index.d.ts → types/exception.d.ts} +13 -13
  68. package/{footer-toolbar/index.d.ts → types/footer-toolbar.d.ts} +2 -2
  69. package/{full-content/index.d.ts → types/full-content.d.ts} +8 -13
  70. package/{global-footer/index.d.ts → types/global-footer.d.ts} +7 -7
  71. package/{loading/index.d.ts → types/loading.d.ts} +1 -0
  72. package/{media/index.d.ts → types/media.d.ts} +10 -16
  73. package/{notice-icon/index.d.ts → types/notice-icon.d.ts} +15 -15
  74. package/{onboarding/index.d.ts → types/onboarding.d.ts} +12 -14
  75. package/types/page-header.d.ts +67 -0
  76. package/types/quick-menu.d.ts +31 -0
  77. package/{reuse-tab/index.d.ts → types/reuse-tab.d.ts} +46 -55
  78. package/types/se.d.ts +101 -0
  79. package/types/sg.d.ts +31 -0
  80. package/{st/index.d.ts → types/st.d.ts} +10 -2
  81. package/types/sv.d.ts +81 -0
  82. package/types/tag-select.d.ts +25 -0
  83. package/{xlsx/index.d.ts → types/xlsx.d.ts} +3 -3
  84. package/down-file/index.d.ts +0 -34
  85. package/ellipsis/index.d.ts +0 -55
  86. package/error-collect/index.d.ts +0 -35
  87. package/page-header/index.d.ts +0 -83
  88. package/quick-menu/index.d.ts +0 -38
  89. package/se/index.d.ts +0 -129
  90. package/sg/index.d.ts +0 -44
  91. package/sv/index.d.ts +0 -96
  92. package/tag-select/index.d.ts +0 -27
  93. /package/{index.d.ts → types/abc.d.ts} +0 -0
  94. /package/{hotkey/index.d.ts → types/hotkey.d.ts} +0 -0
  95. /package/{lodop/index.d.ts → types/lodop.d.ts} +0 -0
  96. /package/{pdf/index.d.ts → types/pdf.d.ts} +0 -0
  97. /package/{zip/index.d.ts → types/zip.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, EventEmitter, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, Directive, InjectionToken, Injector, ChangeDetectorRef, DestroyRef, booleanAttribute, numberAttribute, ViewChild, NgModule, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';
2
+ import { inject, EventEmitter, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, input, Directive, InjectionToken, Injector, viewChild, DestroyRef, signal, booleanAttribute, numberAttribute, output, NgModule, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';
3
3
  import { DelonLocaleService, MenuService, ALAIN_I18N_TOKEN, DelonLocaleModule } from '@delon/theme';
4
4
  import { NzMenuDirective, NzMenuItemComponent, NzMenuModule } from 'ng-zorro-antd/menu';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -66,15 +66,88 @@ class ReuseTabContextMenuComponent {
66
66
  return;
67
67
  this.notify(null);
68
68
  }
69
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: ReuseTabContextMenuComponent, isStandalone: true, selector: "reuse-tab-context-menu", inputs: { i18n: "i18n", item: "item", event: "event", customContextMenu: "customContextMenu" }, outputs: { close: "close" }, host: { listeners: { "document:click": "closeMenu($event)", "document:contextmenu": "closeMenu($event)" } }, ngImport: i0, template: "<ul nz-menu>\n @if (item.active) {\n <li nz-menu-item (click)=\"click($event, 'refresh')\" data-type=\"refresh\" [innerHTML]=\"i18n.refresh\"></li>\n }\n <li\n nz-menu-item\n (click)=\"click($event, 'close')\"\n data-type=\"close\"\n [nzDisabled]=\"!item.closable\"\n [innerHTML]=\"i18n.close\"\n ></li>\n <li nz-menu-item (click)=\"click($event, 'closeOther')\" data-type=\"closeOther\" [innerHTML]=\"i18n.closeOther\"></li>\n <li\n nz-menu-item\n (click)=\"click($event, 'closeRight')\"\n data-type=\"closeRight\"\n [nzDisabled]=\"item.last\"\n [innerHTML]=\"i18n.closeRight\"\n ></li>\n @if (customContextMenu!.length > 0) {\n <li nz-menu-divider></li>\n @for (i of customContextMenu; track $index) {\n <li\n nz-menu-item\n [attr.data-type]=\"i.id\"\n [nzDisabled]=\"isDisabled(i)\"\n (click)=\"click($event, 'custom', i)\"\n [innerHTML]=\"i.title\"\n ></li>\n }\n }\n</ul>\n", dependencies: [{ kind: "directive", type: NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
69
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ReuseTabContextMenuComponent, isStandalone: true, selector: "reuse-tab-context-menu", inputs: { i18n: "i18n", item: "item", event: "event", customContextMenu: "customContextMenu" }, outputs: { close: "close" }, host: { listeners: { "document:click": "closeMenu($event)", "document:contextmenu": "closeMenu($event)" } }, ngImport: i0, template: `
71
+ <ul nz-menu>
72
+ @if (item.active) {
73
+ <li nz-menu-item (click)="click($event, 'refresh')" data-type="refresh" [innerHTML]="i18n.refresh"></li>
74
+ }
75
+ <li
76
+ nz-menu-item
77
+ (click)="click($event, 'close')"
78
+ data-type="close"
79
+ [nzDisabled]="!item.closable"
80
+ [innerHTML]="i18n.close"
81
+ ></li>
82
+ <li nz-menu-item (click)="click($event, 'closeOther')" data-type="closeOther" [innerHTML]="i18n.closeOther"></li>
83
+ <li
84
+ nz-menu-item
85
+ (click)="click($event, 'closeRight')"
86
+ data-type="closeRight"
87
+ [nzDisabled]="item.last"
88
+ [innerHTML]="i18n.closeRight"
89
+ ></li>
90
+ @if (customContextMenu!.length > 0) {
91
+ <li nz-menu-divider></li>
92
+ @for (i of customContextMenu; track $index) {
93
+ <li
94
+ nz-menu-item
95
+ [attr.data-type]="i.id"
96
+ [nzDisabled]="isDisabled(i)"
97
+ (click)="click($event, 'custom', i)"
98
+ [innerHTML]="i.title"
99
+ ></li>
100
+ }
101
+ }
102
+ </ul>
103
+ `, isInline: true, dependencies: [{ kind: "directive", type: NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
71
104
  }
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabContextMenuComponent, decorators: [{
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabContextMenuComponent, decorators: [{
73
106
  type: Component,
74
- args: [{ selector: 'reuse-tab-context-menu', host: {
107
+ args: [{
108
+ selector: 'reuse-tab-context-menu',
109
+ template: `
110
+ <ul nz-menu>
111
+ @if (item.active) {
112
+ <li nz-menu-item (click)="click($event, 'refresh')" data-type="refresh" [innerHTML]="i18n.refresh"></li>
113
+ }
114
+ <li
115
+ nz-menu-item
116
+ (click)="click($event, 'close')"
117
+ data-type="close"
118
+ [nzDisabled]="!item.closable"
119
+ [innerHTML]="i18n.close"
120
+ ></li>
121
+ <li nz-menu-item (click)="click($event, 'closeOther')" data-type="closeOther" [innerHTML]="i18n.closeOther"></li>
122
+ <li
123
+ nz-menu-item
124
+ (click)="click($event, 'closeRight')"
125
+ data-type="closeRight"
126
+ [nzDisabled]="item.last"
127
+ [innerHTML]="i18n.closeRight"
128
+ ></li>
129
+ @if (customContextMenu!.length > 0) {
130
+ <li nz-menu-divider></li>
131
+ @for (i of customContextMenu; track $index) {
132
+ <li
133
+ nz-menu-item
134
+ [attr.data-type]="i.id"
135
+ [nzDisabled]="isDisabled(i)"
136
+ (click)="click($event, 'custom', i)"
137
+ [innerHTML]="i.title"
138
+ ></li>
139
+ }
140
+ }
141
+ </ul>
142
+ `,
143
+ host: {
75
144
  '(document:click)': 'closeMenu($event)',
76
145
  '(document:contextmenu)': 'closeMenu($event)'
77
- }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NzMenuDirective, NzMenuItemComponent], template: "<ul nz-menu>\n @if (item.active) {\n <li nz-menu-item (click)=\"click($event, 'refresh')\" data-type=\"refresh\" [innerHTML]=\"i18n.refresh\"></li>\n }\n <li\n nz-menu-item\n (click)=\"click($event, 'close')\"\n data-type=\"close\"\n [nzDisabled]=\"!item.closable\"\n [innerHTML]=\"i18n.close\"\n ></li>\n <li nz-menu-item (click)=\"click($event, 'closeOther')\" data-type=\"closeOther\" [innerHTML]=\"i18n.closeOther\"></li>\n <li\n nz-menu-item\n (click)=\"click($event, 'closeRight')\"\n data-type=\"closeRight\"\n [nzDisabled]=\"item.last\"\n [innerHTML]=\"i18n.closeRight\"\n ></li>\n @if (customContextMenu!.length > 0) {\n <li nz-menu-divider></li>\n @for (i of customContextMenu; track $index) {\n <li\n nz-menu-item\n [attr.data-type]=\"i.id\"\n [nzDisabled]=\"isDisabled(i)\"\n (click)=\"click($event, 'custom', i)\"\n [innerHTML]=\"i.title\"\n ></li>\n }\n }\n</ul>\n" }]
146
+ },
147
+ changeDetection: ChangeDetectionStrategy.OnPush,
148
+ encapsulation: ViewEncapsulation.None,
149
+ imports: [NzMenuDirective, NzMenuItemComponent]
150
+ }]
78
151
  }], propDecorators: { i18n: [{
79
152
  type: Input
80
153
  }], item: [{
@@ -127,10 +200,10 @@ class ReuseTabContextService {
127
200
  }));
128
201
  comp.onDestroy(() => sub$.unsubscribe());
129
202
  }
130
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
131
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabContextService });
203
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
204
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabContextService });
132
205
  }
133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabContextService, decorators: [{
206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabContextService, decorators: [{
134
207
  type: Injectable
135
208
  }] });
136
209
 
@@ -144,10 +217,10 @@ class ReuseTabContextComponent {
144
217
  this.srv.show.pipe(takeUntilDestroyed()).subscribe(context => this.srv.open(context));
145
218
  this.srv.close.pipe(takeUntilDestroyed()).subscribe(res => this.change.emit(res));
146
219
  }
147
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabContextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
148
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: ReuseTabContextComponent, isStandalone: true, selector: "reuse-tab-context", inputs: { i18n: "i18n" }, outputs: { change: "change" }, ngImport: i0, template: ``, isInline: true });
220
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabContextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
221
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: ReuseTabContextComponent, isStandalone: true, selector: "reuse-tab-context", inputs: { i18n: "i18n" }, outputs: { change: "change" }, ngImport: i0, template: ``, isInline: true });
149
222
  }
150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabContextComponent, decorators: [{
223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabContextComponent, decorators: [{
151
224
  type: Component,
152
225
  args: [{
153
226
  selector: 'reuse-tab-context',
@@ -161,21 +234,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
161
234
 
162
235
  class ReuseTabContextDirective {
163
236
  srv = inject(ReuseTabContextService);
164
- item;
165
- customContextMenu;
237
+ item = input.required({ ...(ngDevMode ? { debugName: "item" } : {}), alias: 'reuse-tab-context-menu' });
238
+ customContextMenu = input.required(...(ngDevMode ? [{ debugName: "customContextMenu" }] : []));
166
239
  _onContextMenu(event) {
167
240
  this.srv.show.next({
168
241
  event,
169
- item: this.item,
170
- customContextMenu: this.customContextMenu
242
+ item: this.item(),
243
+ customContextMenu: this.customContextMenu()
171
244
  });
172
245
  event.preventDefault();
173
246
  event.stopPropagation();
174
247
  }
175
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabContextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
176
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: ReuseTabContextDirective, isStandalone: true, selector: "[reuse-tab-context-menu]", inputs: { item: ["reuse-tab-context-menu", "item"], customContextMenu: "customContextMenu" }, host: { listeners: { "contextmenu": "_onContextMenu($event)" } }, exportAs: ["reuseTabContextMenu"], ngImport: i0 });
248
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabContextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
249
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: ReuseTabContextDirective, isStandalone: true, selector: "[reuse-tab-context-menu]", inputs: { item: { classPropertyName: "item", publicName: "reuse-tab-context-menu", isSignal: true, isRequired: true, transformFunction: null }, customContextMenu: { classPropertyName: "customContextMenu", publicName: "customContextMenu", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "contextmenu": "_onContextMenu($event)" } }, exportAs: ["reuseTabContextMenu"], ngImport: i0 });
177
250
  }
178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabContextDirective, decorators: [{
251
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabContextDirective, decorators: [{
179
252
  type: Directive,
180
253
  args: [{
181
254
  selector: '[reuse-tab-context-menu]',
@@ -184,12 +257,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
184
257
  '(contextmenu)': '_onContextMenu($event)'
185
258
  }
186
259
  }]
187
- }], propDecorators: { item: [{
188
- type: Input,
189
- args: ['reuse-tab-context-menu']
190
- }], customContextMenu: [{
191
- type: Input
192
- }] } });
260
+ }], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "reuse-tab-context-menu", required: true }] }], customContextMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "customContextMenu", required: true }] }] } });
193
261
 
194
262
  /**
195
263
  * 复用匹配模式
@@ -739,7 +807,11 @@ class ReuseTabService {
739
807
  return false;
740
808
  const path = ((future.routeConfig && future.routeConfig.path) ?? '');
741
809
  if (path.length > 0 && ~path.indexOf(':')) {
742
- if (this.routeParamMatchMode === 'strict') {
810
+ const mode = this.routeParamMatchMode;
811
+ if (typeof mode === 'function') {
812
+ ret = mode(future, curr);
813
+ }
814
+ else if (mode === 'strict') {
743
815
  ret = this.getUrl(future) === this.getUrl(curr);
744
816
  }
745
817
  else {
@@ -811,16 +883,15 @@ class ReuseTabService {
811
883
  _router$.unsubscribe();
812
884
  }
813
885
  }
814
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
815
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabService });
886
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
887
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabService });
816
888
  }
817
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabService, decorators: [{
889
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabService, decorators: [{
818
890
  type: Injectable
819
891
  }], ctorParameters: () => [] });
820
892
 
821
893
  class ReuseTabComponent {
822
894
  srv = inject(ReuseTabService, { optional: true });
823
- cdr = inject(ChangeDetectorRef);
824
895
  router = inject(Router);
825
896
  route = inject(ActivatedRoute);
826
897
  i18nSrv = inject(ALAIN_I18N_TOKEN);
@@ -828,37 +899,34 @@ class ReuseTabComponent {
828
899
  platform = inject(Platform);
829
900
  stateKey = inject(REUSE_TAB_STORAGE_KEY);
830
901
  stateSrv = inject(REUSE_TAB_STORAGE_STATE);
831
- tabset;
902
+ tabset = viewChild.required(NzTabsComponent);
832
903
  destroy$ = inject(DestroyRef);
833
- _keepingScrollContainer;
834
- list = [];
835
- item;
836
- pos = 0;
837
904
  dir = inject(Directionality).valueSignal;
905
+ list = signal([], ...(ngDevMode ? [{ debugName: "list" }] : []));
906
+ item;
907
+ pos = signal(0, ...(ngDevMode ? [{ debugName: "pos" }] : []));
838
908
  // #region fields
839
- mode = ReuseTabMatchMode.Menu;
840
- i18n;
841
- debug = false;
842
- max;
843
- tabMaxWidth;
844
- excludes;
845
- allowClose = true;
846
- keepingScroll = false;
847
- storageState = false;
848
- set keepingScrollContainer(value) {
849
- this._keepingScrollContainer = typeof value === 'string' ? this.doc.querySelector(value) : value;
850
- }
851
- customContextMenu = [];
852
- tabBarExtraContent;
853
- tabBarGutter;
854
- tabBarStyle = null;
855
- tabType = 'line';
856
- routeParamMatchMode = 'strict';
857
- disabled = false;
858
- titleRender;
859
- canClose;
860
- change = new EventEmitter();
861
- close = new EventEmitter();
909
+ mode = input(ReuseTabMatchMode.Menu, ...(ngDevMode ? [{ debugName: "mode" }] : []));
910
+ i18n = input(...(ngDevMode ? [undefined, { debugName: "i18n" }] : []));
911
+ debug = input(false, { ...(ngDevMode ? { debugName: "debug" } : {}), transform: booleanAttribute });
912
+ max = input(undefined, { ...(ngDevMode ? { debugName: "max" } : {}), transform: numberAttribute });
913
+ tabMaxWidth = input(undefined, { ...(ngDevMode ? { debugName: "tabMaxWidth" } : {}), transform: numberAttribute });
914
+ excludes = input(...(ngDevMode ? [undefined, { debugName: "excludes" }] : []));
915
+ allowClose = input(true, { ...(ngDevMode ? { debugName: "allowClose" } : {}), transform: booleanAttribute });
916
+ keepingScroll = input(false, { ...(ngDevMode ? { debugName: "keepingScroll" } : {}), transform: booleanAttribute });
917
+ storageState = input(false, { ...(ngDevMode ? { debugName: "storageState" } : {}), transform: booleanAttribute });
918
+ keepingScrollContainer = input(...(ngDevMode ? [undefined, { debugName: "keepingScrollContainer" }] : []));
919
+ customContextMenu = input([], ...(ngDevMode ? [{ debugName: "customContextMenu" }] : []));
920
+ tabBarExtraContent = input(...(ngDevMode ? [undefined, { debugName: "tabBarExtraContent" }] : []));
921
+ tabBarGutter = input(...(ngDevMode ? [undefined, { debugName: "tabBarGutter" }] : []));
922
+ tabBarStyle = input(null, ...(ngDevMode ? [{ debugName: "tabBarStyle" }] : []));
923
+ tabType = input('line', ...(ngDevMode ? [{ debugName: "tabType" }] : []));
924
+ routeParamMatchMode = input('strict', ...(ngDevMode ? [{ debugName: "routeParamMatchMode" }] : []));
925
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
926
+ titleRender = input(...(ngDevMode ? [undefined, { debugName: "titleRender" }] : []));
927
+ canClose = input(...(ngDevMode ? [undefined, { debugName: "canClose" }] : []));
928
+ change = output();
929
+ close = output();
862
930
  // #endregion
863
931
  genTit(title) {
864
932
  return title.i18n ? this.i18nSrv.fanyi(title.i18n) : title.text;
@@ -872,7 +940,7 @@ class ReuseTabComponent {
872
940
  return {
873
941
  url,
874
942
  title: this.genTit(this.srv.getTitle(url, snapshotTrue)),
875
- closable: this.allowClose && this.srv.count > 0 && this.srv.getClosable(url, snapshotTrue),
943
+ closable: this.allowClose() && this.srv.count > 0 && this.srv.getClosable(url, snapshotTrue),
876
944
  active: false,
877
945
  last: false,
878
946
  index: 0
@@ -882,7 +950,7 @@ class ReuseTabComponent {
882
950
  const ls = this.srv.items.map((item, index) => ({
883
951
  url: item.url,
884
952
  title: this.genTit(item.title),
885
- closable: this.allowClose && this.srv.count > 0 && this.srv.getClosable(item.url, item._snapshot),
953
+ closable: this.allowClose() && this.srv.count > 0 && this.srv.getClosable(item.url, item._snapshot),
886
954
  position: item.position,
887
955
  index,
888
956
  active: false,
@@ -893,7 +961,7 @@ class ReuseTabComponent {
893
961
  if (notify && notify.active === 'close' && notify.url === url) {
894
962
  addCurrent = false;
895
963
  let toPos = 0;
896
- const curItem = this.list.find(w => w.url === url);
964
+ const curItem = this.list().find(w => w.url === url);
897
965
  if (curItem.index === ls.length) {
898
966
  // When closed is last
899
967
  toPos = ls.length - 1;
@@ -905,7 +973,7 @@ class ReuseTabComponent {
905
973
  this.router.navigateByUrl(ls[toPos].url);
906
974
  }
907
975
  if (addCurrent) {
908
- const addPos = this.pos + 1;
976
+ const addPos = this.pos() + 1;
909
977
  ls.splice(addPos, 0, this.genCurItem());
910
978
  // Attach to cache
911
979
  this.srv.saveCache(this.route.snapshot, null, addPos);
@@ -914,24 +982,25 @@ class ReuseTabComponent {
914
982
  if (ls.length === 1) {
915
983
  ls[0].closable = false;
916
984
  }
917
- this.list = ls;
918
- this.cdr.detectChanges();
985
+ this.list.set(ls);
919
986
  this.updatePos();
920
987
  }
921
988
  updateTitle(res) {
922
- const item = this.list.find(w => w.url === res.url);
923
- if (!item)
924
- return;
925
- item.title = this.genTit(res.title);
926
- this.cdr.detectChanges();
989
+ this.list.update(ls => {
990
+ const item = ls.find(w => w.url === res.url);
991
+ if (!item)
992
+ return ls;
993
+ item.title = this.genTit(res.title);
994
+ return [...ls];
995
+ });
927
996
  }
928
997
  refresh(item) {
929
- this.srv.runHook('_onReuseInit', this.pos === item.index ? this.srv.componentRef : item.index, 'refresh');
998
+ this.srv.runHook('_onReuseInit', this.pos() === item.index ? this.srv.componentRef : item.index, 'refresh');
930
999
  }
931
1000
  saveState() {
932
- if (!this.srv.inited || !this.storageState)
1001
+ if (!this.srv.inited || !this.storageState())
933
1002
  return;
934
- this.stateSrv?.update(this.stateKey, this.list);
1003
+ this.stateSrv?.update(this.stateKey, this.list());
935
1004
  }
936
1005
  // #region UI
937
1006
  contextMenuChange(res) {
@@ -959,7 +1028,7 @@ class ReuseTabComponent {
959
1028
  if (!fn) {
960
1029
  return;
961
1030
  }
962
- if (!res.item.active && res.item.index <= this.list.find(w => w.active).index) {
1031
+ if (!res.item.active && res.item.index <= this.list().find(w => w.active).index) {
963
1032
  this._to(res.item.index, fn);
964
1033
  }
965
1034
  else {
@@ -967,8 +1036,8 @@ class ReuseTabComponent {
967
1036
  }
968
1037
  }
969
1038
  _to(index, cb) {
970
- index = Math.max(0, Math.min(index, this.list.length - 1));
971
- const item = this.list[index];
1039
+ index = Math.max(0, Math.min(index, this.list().length - 1));
1040
+ const item = this.list()[index];
972
1041
  this.router.navigateByUrl(item.url).then(res => {
973
1042
  if (!res)
974
1043
  return;
@@ -982,11 +1051,11 @@ class ReuseTabComponent {
982
1051
  e.preventDefault();
983
1052
  e.stopPropagation();
984
1053
  }
985
- const item = this.list[idx];
986
- (this.canClose ? this.canClose({ item, includeNonCloseable }) : of(true)).pipe(filter(v => v)).subscribe(() => {
1054
+ const item = this.list()[idx];
1055
+ const canClose = this.canClose();
1056
+ (canClose ? canClose({ item, includeNonCloseable }) : of(true)).pipe(filter(v => v)).subscribe(() => {
987
1057
  this.srv.close(item.url, includeNonCloseable);
988
1058
  this.close.emit(item);
989
- this.cdr.detectChanges();
990
1059
  });
991
1060
  return false;
992
1061
  }
@@ -1004,7 +1073,7 @@ class ReuseTabComponent {
1004
1073
  }
1005
1074
  updatePos() {
1006
1075
  const url = this.srv.getUrl(this.route.snapshot);
1007
- const ls = this.list.filter(w => w.url === url || !this.srv.isExclude(w.url));
1076
+ const ls = this.list().filter(w => w.url === url || !this.srv.isExclude(w.url));
1008
1077
  if (ls.length === 0) {
1009
1078
  return;
1010
1079
  }
@@ -1013,12 +1082,11 @@ class ReuseTabComponent {
1013
1082
  last.last = true;
1014
1083
  const pos = item == null ? last.index : item.index;
1015
1084
  ls.forEach((i, idx) => (i.active = pos === idx));
1016
- this.pos = pos;
1085
+ this.pos.set(pos);
1017
1086
  // TODO: 目前无法知道为什么 `pos` 无法通过 `nzSelectedIndex` 生效,因此强制使用组件实例的方式来修改,这种方式是安全的
1018
1087
  // https://github.com/ng-alain/ng-alain/issues/1736
1019
- this.tabset.nzSelectedIndex = pos;
1020
- this.list = ls;
1021
- this.cdr.detectChanges();
1088
+ this.tabset().nzSelectedIndex = pos;
1089
+ this.list.set(ls);
1022
1090
  this.saveState();
1023
1091
  }
1024
1092
  // #endregion
@@ -1050,94 +1118,123 @@ class ReuseTabComponent {
1050
1118
  return;
1051
1119
  }
1052
1120
  if (changes.max)
1053
- this.srv.max = this.max;
1121
+ this.srv.max = this.max();
1054
1122
  if (changes.excludes)
1055
- this.srv.excludes = this.excludes;
1123
+ this.srv.excludes = this.excludes();
1056
1124
  if (changes.mode)
1057
- this.srv.mode = this.mode;
1125
+ this.srv.mode = this.mode();
1058
1126
  if (changes.routeParamMatchMode)
1059
- this.srv.routeParamMatchMode = this.routeParamMatchMode;
1127
+ this.srv.routeParamMatchMode = this.routeParamMatchMode();
1060
1128
  if (changes.keepingScroll) {
1061
- this.srv.keepingScroll = this.keepingScroll;
1062
- this.srv.keepingScrollContainer = this._keepingScrollContainer;
1129
+ this.srv.keepingScroll = this.keepingScroll();
1130
+ const keepingScrollContainer = this.keepingScrollContainer();
1131
+ this.srv.keepingScrollContainer =
1132
+ typeof keepingScrollContainer === 'string'
1133
+ ? this.doc.querySelector(keepingScrollContainer)
1134
+ : keepingScrollContainer;
1063
1135
  }
1064
1136
  if (changes.storageState)
1065
- this.srv.storageState = this.storageState;
1066
- this.srv.debug = this.debug;
1067
- this.cdr.detectChanges();
1068
- }
1069
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1070
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: ReuseTabComponent, isStandalone: true, selector: "reuse-tab, [reuse-tab]", inputs: { mode: "mode", i18n: "i18n", debug: ["debug", "debug", booleanAttribute], max: ["max", "max", numberAttribute], tabMaxWidth: ["tabMaxWidth", "tabMaxWidth", numberAttribute], excludes: "excludes", allowClose: ["allowClose", "allowClose", booleanAttribute], keepingScroll: ["keepingScroll", "keepingScroll", booleanAttribute], storageState: ["storageState", "storageState", booleanAttribute], keepingScrollContainer: "keepingScrollContainer", customContextMenu: "customContextMenu", tabBarExtraContent: "tabBarExtraContent", tabBarGutter: "tabBarGutter", tabBarStyle: "tabBarStyle", tabType: "tabType", routeParamMatchMode: "routeParamMatchMode", disabled: ["disabled", "disabled", booleanAttribute], titleRender: "titleRender", canClose: "canClose" }, outputs: { change: "change", close: "close" }, host: { properties: { "class.reuse-tab": "true", "class.reuse-tab__line": "tabType === 'line'", "class.reuse-tab__card": "tabType === 'card'", "class.reuse-tab__disabled": "disabled", "class.reuse-tab-rtl": "dir() === 'rtl'" } }, providers: [ReuseTabContextService], viewQueries: [{ propertyName: "tabset", first: true, predicate: ["tabset"], descendants: true }], exportAs: ["reuseTab"], usesOnChanges: true, ngImport: i0, template: "<nz-tabs\n #tabset\n [nzSelectedIndex]=\"pos\"\n [nzAnimated]=\"false\"\n [nzType]=\"tabType\"\n [nzTabBarExtraContent]=\"tabBarExtraContent\"\n [nzTabBarGutter]=\"tabBarGutter\"\n [nzTabBarStyle]=\"tabBarStyle\"\n>\n @for (i of list; track $index) {\n <nz-tab [nzTitle]=\"titleTemplate\" (nzClick)=\"_to($index)\">\n <ng-template #titleTemplate>\n <div\n [reuse-tab-context-menu]=\"i\"\n [customContextMenu]=\"customContextMenu\"\n class=\"reuse-tab__name\"\n [attr.title]=\"i.title\"\n >\n <span [class.reuse-tab__name-width]=\"tabMaxWidth\" [style.max-width.px]=\"tabMaxWidth\">\n @if (titleRender) {\n <ng-template [ngTemplateOutlet]=\"titleRender\" [ngTemplateOutletContext]=\"{ $implicit: i }\" />\n } @else {\n {{ i.title }}\n }\n </span>\n </div>\n @if (i.closable) {\n <nz-icon nzType=\"close\" class=\"reuse-tab__op\" (click)=\"_close($event, $index, false)\" />\n }\n </ng-template>\n </nz-tab>\n }\n</nz-tabs>\n<reuse-tab-context [i18n]=\"i18n\" (change)=\"contextMenuChange($event)\" />\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NzTabsComponent, selector: "nz-tabs,nz-tabset", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact", "nzDestroyInactiveTabPane"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabs"] }, { kind: "component", type: NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { kind: "directive", type: ReuseTabContextDirective, selector: "[reuse-tab-context-menu]", inputs: ["reuse-tab-context-menu", "customContextMenu"], exportAs: ["reuseTabContextMenu"] }, { kind: "component", type: ReuseTabContextComponent, selector: "reuse-tab-context", inputs: ["i18n"], outputs: ["change"] }, { kind: "directive", type: NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1137
+ this.srv.storageState = this.storageState();
1138
+ ``;
1139
+ this.srv.debug = this.debug();
1140
+ }
1141
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1142
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ReuseTabComponent, isStandalone: true, selector: "reuse-tab, [reuse-tab]", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, i18n: { classPropertyName: "i18n", publicName: "i18n", isSignal: true, isRequired: false, transformFunction: null }, debug: { classPropertyName: "debug", publicName: "debug", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, tabMaxWidth: { classPropertyName: "tabMaxWidth", publicName: "tabMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, excludes: { classPropertyName: "excludes", publicName: "excludes", isSignal: true, isRequired: false, transformFunction: null }, allowClose: { classPropertyName: "allowClose", publicName: "allowClose", isSignal: true, isRequired: false, transformFunction: null }, keepingScroll: { classPropertyName: "keepingScroll", publicName: "keepingScroll", isSignal: true, isRequired: false, transformFunction: null }, storageState: { classPropertyName: "storageState", publicName: "storageState", isSignal: true, isRequired: false, transformFunction: null }, keepingScrollContainer: { classPropertyName: "keepingScrollContainer", publicName: "keepingScrollContainer", isSignal: true, isRequired: false, transformFunction: null }, customContextMenu: { classPropertyName: "customContextMenu", publicName: "customContextMenu", isSignal: true, isRequired: false, transformFunction: null }, tabBarExtraContent: { classPropertyName: "tabBarExtraContent", publicName: "tabBarExtraContent", isSignal: true, isRequired: false, transformFunction: null }, tabBarGutter: { classPropertyName: "tabBarGutter", publicName: "tabBarGutter", isSignal: true, isRequired: false, transformFunction: null }, tabBarStyle: { classPropertyName: "tabBarStyle", publicName: "tabBarStyle", isSignal: true, isRequired: false, transformFunction: null }, tabType: { classPropertyName: "tabType", publicName: "tabType", isSignal: true, isRequired: false, transformFunction: null }, routeParamMatchMode: { classPropertyName: "routeParamMatchMode", publicName: "routeParamMatchMode", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, titleRender: { classPropertyName: "titleRender", publicName: "titleRender", isSignal: true, isRequired: false, transformFunction: null }, canClose: { classPropertyName: "canClose", publicName: "canClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change", close: "close" }, host: { properties: { "class.reuse-tab__line": "tabType() === 'line'", "class.reuse-tab__card": "tabType() === 'card'", "class.reuse-tab__disabled": "disabled()", "class.reuse-tab-rtl": "dir() === 'rtl'" }, classAttribute: "reuse-tab" }, providers: [ReuseTabContextService], viewQueries: [{ propertyName: "tabset", first: true, predicate: NzTabsComponent, descendants: true, isSignal: true }], exportAs: ["reuseTab"], usesOnChanges: true, ngImport: i0, template: `
1143
+ <nz-tabs
1144
+ [nzSelectedIndex]="pos()"
1145
+ [nzAnimated]="false"
1146
+ [nzType]="tabType()"
1147
+ [nzTabBarExtraContent]="tabBarExtraContent()"
1148
+ [nzTabBarGutter]="tabBarGutter()"
1149
+ [nzTabBarStyle]="tabBarStyle()"
1150
+ >
1151
+ @for (i of list(); track i) {
1152
+ <nz-tab [nzTitle]="titleTemplate" (nzClick)="_to($index)">
1153
+ <ng-template #titleTemplate>
1154
+ <div
1155
+ [reuse-tab-context-menu]="i"
1156
+ [customContextMenu]="customContextMenu()"
1157
+ class="reuse-tab__name"
1158
+ [attr.title]="i.title"
1159
+ >
1160
+ <span [class.reuse-tab__name-width]="tabMaxWidth()" [style.max-width.px]="tabMaxWidth()">
1161
+ @if (titleRender()) {
1162
+ <ng-template [ngTemplateOutlet]="titleRender()" [ngTemplateOutletContext]="{ $implicit: i }" />
1163
+ } @else {
1164
+ {{ i.title }}
1165
+ }
1166
+ </span>
1167
+ </div>
1168
+ @if (i.closable) {
1169
+ <nz-icon nzType="close" class="reuse-tab__op" (click)="_close($event, $index, false)" />
1170
+ }
1171
+ </ng-template>
1172
+ </nz-tab>
1173
+ }
1174
+ </nz-tabs>
1175
+ <reuse-tab-context [i18n]="i18n()" (change)="contextMenuChange($event)" />
1176
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NzTabsComponent, selector: "nz-tabs", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact", "nzDestroyInactiveTabPane"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabs"] }, { kind: "component", type: NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { kind: "directive", type: ReuseTabContextDirective, selector: "[reuse-tab-context-menu]", inputs: ["reuse-tab-context-menu", "customContextMenu"], exportAs: ["reuseTabContextMenu"] }, { kind: "component", type: ReuseTabContextComponent, selector: "reuse-tab-context", inputs: ["i18n"], outputs: ["change"] }, { kind: "directive", type: NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1071
1177
  }
1072
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabComponent, decorators: [{
1178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabComponent, decorators: [{
1073
1179
  type: Component,
1074
- args: [{ selector: 'reuse-tab, [reuse-tab]', exportAs: 'reuseTab', host: {
1075
- '[class.reuse-tab]': 'true',
1076
- '[class.reuse-tab__line]': `tabType === 'line'`,
1077
- '[class.reuse-tab__card]': `tabType === 'card'`,
1078
- '[class.reuse-tab__disabled]': `disabled`,
1180
+ args: [{
1181
+ selector: 'reuse-tab, [reuse-tab]',
1182
+ exportAs: 'reuseTab',
1183
+ template: `
1184
+ <nz-tabs
1185
+ [nzSelectedIndex]="pos()"
1186
+ [nzAnimated]="false"
1187
+ [nzType]="tabType()"
1188
+ [nzTabBarExtraContent]="tabBarExtraContent()"
1189
+ [nzTabBarGutter]="tabBarGutter()"
1190
+ [nzTabBarStyle]="tabBarStyle()"
1191
+ >
1192
+ @for (i of list(); track i) {
1193
+ <nz-tab [nzTitle]="titleTemplate" (nzClick)="_to($index)">
1194
+ <ng-template #titleTemplate>
1195
+ <div
1196
+ [reuse-tab-context-menu]="i"
1197
+ [customContextMenu]="customContextMenu()"
1198
+ class="reuse-tab__name"
1199
+ [attr.title]="i.title"
1200
+ >
1201
+ <span [class.reuse-tab__name-width]="tabMaxWidth()" [style.max-width.px]="tabMaxWidth()">
1202
+ @if (titleRender()) {
1203
+ <ng-template [ngTemplateOutlet]="titleRender()" [ngTemplateOutletContext]="{ $implicit: i }" />
1204
+ } @else {
1205
+ {{ i.title }}
1206
+ }
1207
+ </span>
1208
+ </div>
1209
+ @if (i.closable) {
1210
+ <nz-icon nzType="close" class="reuse-tab__op" (click)="_close($event, $index, false)" />
1211
+ }
1212
+ </ng-template>
1213
+ </nz-tab>
1214
+ }
1215
+ </nz-tabs>
1216
+ <reuse-tab-context [i18n]="i18n()" (change)="contextMenuChange($event)" />
1217
+ `,
1218
+ host: {
1219
+ class: 'reuse-tab',
1220
+ '[class.reuse-tab__line]': `tabType() === 'line'`,
1221
+ '[class.reuse-tab__card]': `tabType() === 'card'`,
1222
+ '[class.reuse-tab__disabled]': `disabled()`,
1079
1223
  '[class.reuse-tab-rtl]': `dir() === 'rtl'`
1080
- }, providers: [ReuseTabContextService], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1224
+ },
1225
+ providers: [ReuseTabContextService],
1226
+ changeDetection: ChangeDetectionStrategy.OnPush,
1227
+ encapsulation: ViewEncapsulation.None,
1228
+ imports: [
1081
1229
  NgTemplateOutlet,
1082
1230
  NzTabsComponent,
1083
1231
  NzTabComponent,
1084
1232
  ReuseTabContextDirective,
1085
1233
  ReuseTabContextComponent,
1086
1234
  NzIconDirective
1087
- ], template: "<nz-tabs\n #tabset\n [nzSelectedIndex]=\"pos\"\n [nzAnimated]=\"false\"\n [nzType]=\"tabType\"\n [nzTabBarExtraContent]=\"tabBarExtraContent\"\n [nzTabBarGutter]=\"tabBarGutter\"\n [nzTabBarStyle]=\"tabBarStyle\"\n>\n @for (i of list; track $index) {\n <nz-tab [nzTitle]=\"titleTemplate\" (nzClick)=\"_to($index)\">\n <ng-template #titleTemplate>\n <div\n [reuse-tab-context-menu]=\"i\"\n [customContextMenu]=\"customContextMenu\"\n class=\"reuse-tab__name\"\n [attr.title]=\"i.title\"\n >\n <span [class.reuse-tab__name-width]=\"tabMaxWidth\" [style.max-width.px]=\"tabMaxWidth\">\n @if (titleRender) {\n <ng-template [ngTemplateOutlet]=\"titleRender\" [ngTemplateOutletContext]=\"{ $implicit: i }\" />\n } @else {\n {{ i.title }}\n }\n </span>\n </div>\n @if (i.closable) {\n <nz-icon nzType=\"close\" class=\"reuse-tab__op\" (click)=\"_close($event, $index, false)\" />\n }\n </ng-template>\n </nz-tab>\n }\n</nz-tabs>\n<reuse-tab-context [i18n]=\"i18n\" (change)=\"contextMenuChange($event)\" />\n" }]
1088
- }], propDecorators: { tabset: [{
1089
- type: ViewChild,
1090
- args: ['tabset']
1091
- }], mode: [{
1092
- type: Input
1093
- }], i18n: [{
1094
- type: Input
1095
- }], debug: [{
1096
- type: Input,
1097
- args: [{ transform: booleanAttribute }]
1098
- }], max: [{
1099
- type: Input,
1100
- args: [{ transform: numberAttribute }]
1101
- }], tabMaxWidth: [{
1102
- type: Input,
1103
- args: [{ transform: numberAttribute }]
1104
- }], excludes: [{
1105
- type: Input
1106
- }], allowClose: [{
1107
- type: Input,
1108
- args: [{ transform: booleanAttribute }]
1109
- }], keepingScroll: [{
1110
- type: Input,
1111
- args: [{ transform: booleanAttribute }]
1112
- }], storageState: [{
1113
- type: Input,
1114
- args: [{ transform: booleanAttribute }]
1115
- }], keepingScrollContainer: [{
1116
- type: Input
1117
- }], customContextMenu: [{
1118
- type: Input
1119
- }], tabBarExtraContent: [{
1120
- type: Input
1121
- }], tabBarGutter: [{
1122
- type: Input
1123
- }], tabBarStyle: [{
1124
- type: Input
1125
- }], tabType: [{
1126
- type: Input
1127
- }], routeParamMatchMode: [{
1128
- type: Input
1129
- }], disabled: [{
1130
- type: Input,
1131
- args: [{ transform: booleanAttribute }]
1132
- }], titleRender: [{
1133
- type: Input
1134
- }], canClose: [{
1135
- type: Input
1136
- }], change: [{
1137
- type: Output
1138
- }], close: [{
1139
- type: Output
1140
- }] } });
1235
+ ]
1236
+ }]
1237
+ }], propDecorators: { tabset: [{ type: i0.ViewChild, args: [i0.forwardRef(() => NzTabsComponent), { isSignal: true }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], i18n: [{ type: i0.Input, args: [{ isSignal: true, alias: "i18n", required: false }] }], debug: [{ type: i0.Input, args: [{ isSignal: true, alias: "debug", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], tabMaxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabMaxWidth", required: false }] }], excludes: [{ type: i0.Input, args: [{ isSignal: true, alias: "excludes", required: false }] }], allowClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowClose", required: false }] }], keepingScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepingScroll", required: false }] }], storageState: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageState", required: false }] }], keepingScrollContainer: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepingScrollContainer", required: false }] }], customContextMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "customContextMenu", required: false }] }], tabBarExtraContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabBarExtraContent", required: false }] }], tabBarGutter: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabBarGutter", required: false }] }], tabBarStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabBarStyle", required: false }] }], tabType: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabType", required: false }] }], routeParamMatchMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "routeParamMatchMode", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], titleRender: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleRender", required: false }] }], canClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "canClose", required: false }] }], change: [{ type: i0.Output, args: ["change"] }], close: [{ type: i0.Output, args: ["close"] }] } });
1141
1238
 
1142
1239
  class ReuseTabStrategy {
1143
1240
  srv = inject(ReuseTabService);
@@ -1161,15 +1258,15 @@ class ReuseTabStrategy {
1161
1258
  const COMPONENTS = [ReuseTabComponent];
1162
1259
  const NOEXPORTS = [ReuseTabContextMenuComponent, ReuseTabContextComponent, ReuseTabContextDirective];
1163
1260
  class ReuseTabModule {
1164
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1165
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabModule, imports: [CommonModule,
1261
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1262
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabModule, imports: [CommonModule,
1166
1263
  RouterModule,
1167
1264
  DelonLocaleModule,
1168
1265
  NzMenuModule,
1169
1266
  NzTabsModule,
1170
1267
  NzIconModule,
1171
1268
  OverlayModule, ReuseTabComponent, ReuseTabContextMenuComponent, ReuseTabContextComponent, ReuseTabContextDirective], exports: [ReuseTabComponent] });
1172
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabModule, providers: [
1269
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabModule, providers: [
1173
1270
  {
1174
1271
  provide: REUSE_TAB_STORAGE_KEY,
1175
1272
  useValue: '_reuse-tab-state'
@@ -1190,7 +1287,7 @@ class ReuseTabModule {
1190
1287
  NzIconModule,
1191
1288
  OverlayModule, COMPONENTS, ReuseTabContextMenuComponent] });
1192
1289
  }
1193
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ReuseTabModule, decorators: [{
1290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabModule, decorators: [{
1194
1291
  type: NgModule,
1195
1292
  args: [{
1196
1293
  imports: [