@delon/abc 20.1.0 → 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.
- package/fesm2022/auto-focus.mjs +10 -10
- package/fesm2022/auto-focus.mjs.map +1 -1
- package/fesm2022/cell.mjs +23 -25
- package/fesm2022/cell.mjs.map +1 -1
- package/fesm2022/chart-observer-size.mjs +21 -34
- package/fesm2022/chart-observer-size.mjs.map +1 -1
- package/fesm2022/count-down.mjs +24 -31
- package/fesm2022/count-down.mjs.map +1 -1
- package/fesm2022/date-picker.mjs +89 -85
- package/fesm2022/date-picker.mjs.map +1 -1
- package/fesm2022/down-file.mjs +24 -44
- package/fesm2022/down-file.mjs.map +1 -1
- package/fesm2022/ellipsis.mjs +165 -106
- package/fesm2022/ellipsis.mjs.map +1 -1
- package/fesm2022/error-collect.mjs +12 -14
- package/fesm2022/error-collect.mjs.map +1 -1
- package/fesm2022/exception.mjs +9 -9
- package/fesm2022/exception.mjs.map +1 -1
- package/fesm2022/footer-toolbar.mjs +9 -9
- package/fesm2022/footer-toolbar.mjs.map +1 -1
- package/fesm2022/full-content.mjs +50 -58
- package/fesm2022/full-content.mjs.map +1 -1
- package/fesm2022/global-footer.mjs +14 -15
- package/fesm2022/global-footer.mjs.map +1 -1
- package/fesm2022/hotkey.mjs +7 -7
- package/fesm2022/hotkey.mjs.map +1 -1
- package/fesm2022/loading.mjs +62 -15
- package/fesm2022/loading.mjs.map +1 -1
- package/fesm2022/lodop.mjs +8 -8
- package/fesm2022/lodop.mjs.map +1 -1
- package/fesm2022/media.mjs +37 -61
- package/fesm2022/media.mjs.map +1 -1
- package/fesm2022/notice-icon.mjs +220 -25
- package/fesm2022/notice-icon.mjs.map +1 -1
- package/fesm2022/onboarding.mjs +163 -65
- package/fesm2022/onboarding.mjs.map +1 -1
- package/fesm2022/page-header.mjs +252 -155
- package/fesm2022/page-header.mjs.map +1 -1
- package/fesm2022/pdf.mjs +9 -9
- package/fesm2022/pdf.mjs.map +1 -1
- package/fesm2022/quick-menu.mjs +79 -71
- package/fesm2022/quick-menu.mjs.map +1 -1
- package/fesm2022/reuse-tab.mjs +262 -165
- package/fesm2022/reuse-tab.mjs.map +1 -1
- package/fesm2022/se.mjs +290 -310
- package/fesm2022/se.mjs.map +1 -1
- package/fesm2022/sg.mjs +32 -69
- package/fesm2022/sg.mjs.map +1 -1
- package/fesm2022/st.mjs +124 -115
- package/fesm2022/st.mjs.map +1 -1
- package/fesm2022/sv.mjs +185 -174
- package/fesm2022/sv.mjs.map +1 -1
- package/fesm2022/tag-select.mjs +44 -25
- package/fesm2022/tag-select.mjs.map +1 -1
- package/fesm2022/xlsx.mjs +16 -19
- package/fesm2022/xlsx.mjs.map +1 -1
- package/fesm2022/zip.mjs +4 -4
- package/fesm2022/zip.mjs.map +1 -1
- package/package.json +40 -40
- package/{auto-focus/index.d.ts → types/auto-focus.d.ts} +2 -2
- package/{cell/index.d.ts → types/cell.d.ts} +12 -13
- package/{observers/index.d.ts → types/chart-observer-size.d.ts} +5 -9
- package/{count-down/index.d.ts → types/count-down.d.ts} +6 -10
- package/{date-picker/index.d.ts → types/date-picker.d.ts} +6 -10
- package/types/down-file.d.ts +32 -0
- package/types/ellipsis.d.ts +46 -0
- package/types/error-collect.d.ts +34 -0
- package/{exception/index.d.ts → types/exception.d.ts} +13 -13
- package/{footer-toolbar/index.d.ts → types/footer-toolbar.d.ts} +2 -2
- package/{full-content/index.d.ts → types/full-content.d.ts} +8 -13
- package/{global-footer/index.d.ts → types/global-footer.d.ts} +7 -7
- package/{loading/index.d.ts → types/loading.d.ts} +1 -0
- package/{media/index.d.ts → types/media.d.ts} +10 -16
- package/{notice-icon/index.d.ts → types/notice-icon.d.ts} +15 -15
- package/{onboarding/index.d.ts → types/onboarding.d.ts} +12 -14
- package/types/page-header.d.ts +67 -0
- package/types/quick-menu.d.ts +31 -0
- package/{reuse-tab/index.d.ts → types/reuse-tab.d.ts} +46 -55
- package/types/se.d.ts +101 -0
- package/types/sg.d.ts +31 -0
- package/{st/index.d.ts → types/st.d.ts} +10 -2
- package/types/sv.d.ts +81 -0
- package/types/tag-select.d.ts +25 -0
- package/{xlsx/index.d.ts → types/xlsx.d.ts} +3 -3
- package/down-file/index.d.ts +0 -34
- package/ellipsis/index.d.ts +0 -55
- package/error-collect/index.d.ts +0 -35
- package/page-header/index.d.ts +0 -83
- package/quick-menu/index.d.ts +0 -38
- package/se/index.d.ts +0 -129
- package/sg/index.d.ts +0 -44
- package/sv/index.d.ts +0 -96
- package/tag-select/index.d.ts +0 -27
- /package/{index.d.ts → types/abc.d.ts} +0 -0
- /package/{hotkey/index.d.ts → types/hotkey.d.ts} +0 -0
- /package/{lodop/index.d.ts → types/lodop.d.ts} +0 -0
- /package/{pdf/index.d.ts → types/pdf.d.ts} +0 -0
- /package/{zip/index.d.ts → types/zip.d.ts} +0 -0
package/fesm2022/reuse-tab.mjs
CHANGED
|
@@ -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,
|
|
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: "
|
|
70
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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: "
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabContextMenuComponent, decorators: [{
|
|
73
106
|
type: Component,
|
|
74
|
-
args: [{
|
|
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
|
-
},
|
|
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: "
|
|
131
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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: "
|
|
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: "
|
|
148
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
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: "
|
|
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: "
|
|
176
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
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: "
|
|
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
|
* 复用匹配模式
|
|
@@ -238,7 +306,7 @@ const REUSE_TAB_STORAGE_KEY = new InjectionToken('REUSE_TAB_STORAGE_KEY');
|
|
|
238
306
|
const REUSE_TAB_STORAGE_STATE = new InjectionToken('REUSE_TAB_STORAGE_STATE');
|
|
239
307
|
class ReuseTabLocalStorageState {
|
|
240
308
|
get(key) {
|
|
241
|
-
return JSON.parse(localStorage.getItem(key)
|
|
309
|
+
return JSON.parse(localStorage.getItem(key) ?? '[]') ?? [];
|
|
242
310
|
}
|
|
243
311
|
update(key, value) {
|
|
244
312
|
localStorage.setItem(key, JSON.stringify(value));
|
|
@@ -342,7 +410,7 @@ class ReuseTabService {
|
|
|
342
410
|
}
|
|
343
411
|
/** 获取指定路径缓存 */
|
|
344
412
|
get(url) {
|
|
345
|
-
return url ? this.cached.list.find(w => w.url === url)
|
|
413
|
+
return url ? (this.cached.list.find(w => w.url === url) ?? null) : null;
|
|
346
414
|
}
|
|
347
415
|
remove(url, includeNonCloseable) {
|
|
348
416
|
const idx = typeof url === 'string' ? this.index(url) : url;
|
|
@@ -726,7 +794,7 @@ class ReuseTabService {
|
|
|
726
794
|
return null;
|
|
727
795
|
const url = this.getUrl(route);
|
|
728
796
|
const data = this.get(url);
|
|
729
|
-
const ret =
|
|
797
|
+
const ret = data && data._handle;
|
|
730
798
|
this.di('#retrieve', url, ret);
|
|
731
799
|
return ret;
|
|
732
800
|
}
|
|
@@ -737,13 +805,17 @@ class ReuseTabService {
|
|
|
737
805
|
let ret = future.routeConfig === curr.routeConfig;
|
|
738
806
|
if (!ret)
|
|
739
807
|
return false;
|
|
740
|
-
const path = ((future.routeConfig && future.routeConfig.path)
|
|
808
|
+
const path = ((future.routeConfig && future.routeConfig.path) ?? '');
|
|
741
809
|
if (path.length > 0 && ~path.indexOf(':')) {
|
|
742
|
-
|
|
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 {
|
|
746
|
-
ret = path === ((curr.routeConfig && curr.routeConfig.path)
|
|
818
|
+
ret = path === ((curr.routeConfig && curr.routeConfig.path) ?? '');
|
|
747
819
|
}
|
|
748
820
|
}
|
|
749
821
|
this.di('=====================');
|
|
@@ -811,16 +883,15 @@ class ReuseTabService {
|
|
|
811
883
|
_router$.unsubscribe();
|
|
812
884
|
}
|
|
813
885
|
}
|
|
814
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
815
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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: "
|
|
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
|
-
|
|
849
|
-
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
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
|
|
918
|
-
this.cdr.detectChanges();
|
|
985
|
+
this.list.set(ls);
|
|
919
986
|
this.updatePos();
|
|
920
987
|
}
|
|
921
988
|
updateTitle(res) {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
1067
|
-
this.
|
|
1068
|
-
}
|
|
1069
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1070
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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: "
|
|
1178
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ReuseTabComponent, decorators: [{
|
|
1073
1179
|
type: Component,
|
|
1074
|
-
args: [{
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
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
|
-
},
|
|
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
|
-
]
|
|
1088
|
-
|
|
1089
|
-
|
|
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: "
|
|
1165
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
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: "
|
|
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: "
|
|
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: [
|