@delon/abc 17.0.5 → 17.1.0

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 (240) hide show
  1. package/auto-focus/auto-focus.directive.d.ts +7 -12
  2. package/avatar-list/avatar-list-item.component.d.ts +1 -1
  3. package/avatar-list/avatar-list.component.d.ts +10 -12
  4. package/avatar-list/avatar-list.module.d.ts +6 -6
  5. package/cell/cell-host.directive.d.ts +3 -5
  6. package/cell/cell.component.d.ts +10 -15
  7. package/cell/cell.service.d.ts +4 -7
  8. package/count-down/count-down.component.d.ts +1 -1
  9. package/count-down/count-down.module.d.ts +4 -4
  10. package/date-picker/date-picker.module.d.ts +6 -6
  11. package/date-picker/range-shortcut.component.d.ts +2 -2
  12. package/date-picker/range.directive.d.ts +7 -9
  13. package/down-file/down-file.directive.d.ts +6 -7
  14. package/down-file/down-file.module.d.ts +4 -4
  15. package/ellipsis/ellipsis.component.d.ts +12 -15
  16. package/ellipsis/ellipsis.module.d.ts +5 -5
  17. package/error-collect/error-collect.component.d.ts +14 -14
  18. package/error-collect/error-collect.module.d.ts +4 -4
  19. package/esm2022/auto-focus/auto-focus.directive.mjs +21 -32
  20. package/esm2022/auto-focus/auto-focus.module.mjs +4 -4
  21. package/esm2022/avatar-list/avatar-list-item.component.mjs +6 -5
  22. package/esm2022/avatar-list/avatar-list.component.mjs +28 -34
  23. package/esm2022/avatar-list/avatar-list.module.mjs +6 -7
  24. package/esm2022/cell/cell-host.directive.mjs +10 -10
  25. package/esm2022/cell/cell.component.mjs +43 -59
  26. package/esm2022/cell/cell.module.mjs +4 -4
  27. package/esm2022/cell/cell.service.mjs +13 -14
  28. package/esm2022/count-down/count-down.component.mjs +9 -7
  29. package/esm2022/count-down/count-down.module.mjs +6 -7
  30. package/esm2022/date-picker/date-picker.module.mjs +6 -7
  31. package/esm2022/date-picker/range-shortcut.component.mjs +9 -9
  32. package/esm2022/date-picker/range.directive.mjs +16 -19
  33. package/esm2022/down-file/down-file.directive.mjs +17 -18
  34. package/esm2022/down-file/down-file.module.mjs +7 -8
  35. package/esm2022/ellipsis/ellipsis.component.mjs +36 -49
  36. package/esm2022/ellipsis/ellipsis.module.mjs +6 -7
  37. package/esm2022/error-collect/error-collect.component.mjs +27 -36
  38. package/esm2022/error-collect/error-collect.module.mjs +6 -7
  39. package/esm2022/exception/exception.component.mjs +21 -25
  40. package/esm2022/exception/exception.module.mjs +6 -7
  41. package/esm2022/footer-toolbar/footer-toolbar.component.mjs +18 -28
  42. package/esm2022/footer-toolbar/footer-toolbar.module.mjs +6 -7
  43. package/esm2022/full-content/full-content-toggle.directive.mjs +11 -10
  44. package/esm2022/full-content/full-content.component.mjs +26 -38
  45. package/esm2022/full-content/full-content.module.mjs +6 -7
  46. package/esm2022/full-content/full-content.service.mjs +3 -3
  47. package/esm2022/global-footer/global-footer-item.component.mjs +9 -12
  48. package/esm2022/global-footer/global-footer.component.mjs +23 -28
  49. package/esm2022/global-footer/global-footer.module.mjs +6 -7
  50. package/esm2022/hotkey/hotkey.directive.mjs +14 -14
  51. package/esm2022/hotkey/hotkey.module.mjs +4 -4
  52. package/esm2022/let/let.directive.mjs +3 -3
  53. package/esm2022/let/let.module.mjs +4 -4
  54. package/esm2022/loading/loading.component.mjs +8 -8
  55. package/esm2022/loading/loading.module.mjs +6 -7
  56. package/esm2022/loading/loading.service.mjs +15 -17
  57. package/esm2022/lodop/lodop.module.mjs +4 -4
  58. package/esm2022/lodop/lodop.service.mjs +10 -10
  59. package/esm2022/media/media.component.mjs +24 -25
  60. package/esm2022/media/media.module.mjs +6 -7
  61. package/esm2022/media/media.service.mjs +15 -15
  62. package/esm2022/notice-icon/notice-icon-tab.component.mjs +16 -9
  63. package/esm2022/notice-icon/notice-icon.component.mjs +40 -39
  64. package/esm2022/notice-icon/notice-icon.module.mjs +10 -9
  65. package/esm2022/observers/observer-size.mjs +18 -18
  66. package/esm2022/onboarding/onboarding.component.mjs +24 -30
  67. package/esm2022/onboarding/onboarding.module.mjs +25 -9
  68. package/esm2022/onboarding/onboarding.service.mjs +26 -33
  69. package/esm2022/page-header/page-header.component.mjs +61 -84
  70. package/esm2022/page-header/page-header.module.mjs +9 -9
  71. package/esm2022/pdf/pdf.component.mjs +46 -71
  72. package/esm2022/pdf/pdf.module.mjs +6 -7
  73. package/esm2022/qr/qr.component.mjs +11 -19
  74. package/esm2022/qr/qr.module.mjs +4 -4
  75. package/esm2022/quick-menu/quick-menu.component.mjs +21 -29
  76. package/esm2022/quick-menu/quick-menu.module.mjs +6 -7
  77. package/esm2022/result/result.component.mjs +20 -22
  78. package/esm2022/result/result.module.mjs +6 -7
  79. package/esm2022/reuse-tab/provide.mjs +2 -1
  80. package/esm2022/reuse-tab/reuse-tab-context-menu.component.mjs +13 -14
  81. package/esm2022/reuse-tab/reuse-tab-context.component.mjs +12 -16
  82. package/esm2022/reuse-tab/reuse-tab-context.directive.mjs +9 -9
  83. package/esm2022/reuse-tab/reuse-tab-context.service.mjs +9 -10
  84. package/esm2022/reuse-tab/reuse-tab.component.mjs +58 -93
  85. package/esm2022/reuse-tab/reuse-tab.module.mjs +4 -4
  86. package/esm2022/reuse-tab/reuse-tab.service.mjs +71 -60
  87. package/esm2022/reuse-tab/reuse-tab.strategy.mjs +5 -3
  88. package/esm2022/se/se-container.component.mjs +62 -79
  89. package/esm2022/se/se.component.mjs +42 -59
  90. package/esm2022/se/se.module.mjs +6 -7
  91. package/esm2022/sg/sg-container.component.mjs +12 -20
  92. package/esm2022/sg/sg.component.mjs +21 -27
  93. package/esm2022/sg/sg.module.mjs +6 -7
  94. package/esm2022/st/st-column-source.mjs +4 -4
  95. package/esm2022/st/st-data-source.mjs +4 -4
  96. package/esm2022/st/st-export.mjs +16 -12
  97. package/esm2022/st/st-filter.component.mjs +11 -11
  98. package/esm2022/st/st-row.directive.mjs +12 -14
  99. package/esm2022/st/st-widget-host.directive.mjs +10 -10
  100. package/esm2022/st/st-widget.mjs +3 -3
  101. package/esm2022/st/st.component.mjs +82 -124
  102. package/esm2022/st/st.module.mjs +4 -4
  103. package/esm2022/sv/sv-container.component.mjs +60 -78
  104. package/esm2022/sv/sv-value.component.mjs +9 -7
  105. package/esm2022/sv/sv.component.mjs +35 -48
  106. package/esm2022/sv/sv.module.mjs +6 -7
  107. package/esm2022/tag-select/tag-select.component.mjs +19 -24
  108. package/esm2022/tag-select/tag-select.module.mjs +6 -7
  109. package/esm2022/xlsx/xlsx.directive.mjs +9 -9
  110. package/esm2022/xlsx/xlsx.module.mjs +4 -4
  111. package/esm2022/xlsx/xlsx.service.mjs +13 -13
  112. package/esm2022/zip/zip.service.mjs +13 -13
  113. package/exception/exception.component.d.ts +13 -13
  114. package/exception/exception.module.d.ts +7 -7
  115. package/fesm2022/auto-focus.mjs +24 -35
  116. package/fesm2022/auto-focus.mjs.map +1 -1
  117. package/fesm2022/avatar-list.mjs +37 -46
  118. package/fesm2022/avatar-list.mjs.map +1 -1
  119. package/fesm2022/cell.mjs +67 -84
  120. package/fesm2022/cell.mjs.map +1 -1
  121. package/fesm2022/chart-observer-size.mjs +17 -17
  122. package/fesm2022/chart-observer-size.mjs.map +1 -1
  123. package/fesm2022/count-down.mjs +13 -13
  124. package/fesm2022/count-down.mjs.map +1 -1
  125. package/fesm2022/date-picker.mjs +28 -33
  126. package/fesm2022/date-picker.mjs.map +1 -1
  127. package/fesm2022/down-file.mjs +22 -25
  128. package/fesm2022/down-file.mjs.map +1 -1
  129. package/fesm2022/ellipsis.mjs +40 -56
  130. package/fesm2022/ellipsis.mjs.map +1 -1
  131. package/fesm2022/error-collect.mjs +31 -42
  132. package/fesm2022/error-collect.mjs.map +1 -1
  133. package/fesm2022/exception.mjs +25 -34
  134. package/fesm2022/exception.mjs.map +1 -1
  135. package/fesm2022/footer-toolbar.mjs +22 -35
  136. package/fesm2022/footer-toolbar.mjs.map +1 -1
  137. package/fesm2022/full-content.mjs +40 -52
  138. package/fesm2022/full-content.mjs.map +1 -1
  139. package/fesm2022/global-footer.mjs +34 -45
  140. package/fesm2022/global-footer.mjs.map +1 -1
  141. package/fesm2022/hotkey.mjs +17 -17
  142. package/fesm2022/hotkey.mjs.map +1 -1
  143. package/fesm2022/let.mjs +7 -7
  144. package/fesm2022/loading.mjs +26 -33
  145. package/fesm2022/loading.mjs.map +1 -1
  146. package/fesm2022/lodop.mjs +13 -13
  147. package/fesm2022/lodop.mjs.map +1 -1
  148. package/fesm2022/media.mjs +40 -42
  149. package/fesm2022/media.mjs.map +1 -1
  150. package/fesm2022/notice-icon.mjs +61 -62
  151. package/fesm2022/notice-icon.mjs.map +1 -1
  152. package/fesm2022/onboarding.mjs +71 -72
  153. package/fesm2022/onboarding.mjs.map +1 -1
  154. package/fesm2022/page-header.mjs +68 -97
  155. package/fesm2022/page-header.mjs.map +1 -1
  156. package/fesm2022/pdf.mjs +50 -77
  157. package/fesm2022/pdf.mjs.map +1 -1
  158. package/fesm2022/qr.mjs +14 -22
  159. package/fesm2022/qr.mjs.map +1 -1
  160. package/fesm2022/quick-menu.mjs +25 -37
  161. package/fesm2022/quick-menu.mjs.map +1 -1
  162. package/fesm2022/result.mjs +24 -29
  163. package/fesm2022/result.mjs.map +1 -1
  164. package/fesm2022/reuse-tab.mjs +175 -206
  165. package/fesm2022/reuse-tab.mjs.map +1 -1
  166. package/fesm2022/se.mjs +104 -141
  167. package/fesm2022/se.mjs.map +1 -1
  168. package/fesm2022/sg.mjs +34 -47
  169. package/fesm2022/sg.mjs.map +1 -1
  170. package/fesm2022/st.mjs +134 -171
  171. package/fesm2022/st.mjs.map +1 -1
  172. package/fesm2022/sv.mjs +102 -135
  173. package/fesm2022/sv.mjs.map +1 -1
  174. package/fesm2022/tag-select.mjs +23 -31
  175. package/fesm2022/tag-select.mjs.map +1 -1
  176. package/fesm2022/xlsx.mjs +22 -22
  177. package/fesm2022/xlsx.mjs.map +1 -1
  178. package/fesm2022/zip.mjs +12 -12
  179. package/fesm2022/zip.mjs.map +1 -1
  180. package/footer-toolbar/footer-toolbar.component.d.ts +6 -10
  181. package/footer-toolbar/footer-toolbar.module.d.ts +5 -5
  182. package/full-content/full-content-toggle.directive.d.ts +2 -4
  183. package/full-content/full-content.component.d.ts +11 -16
  184. package/full-content/full-content.module.d.ts +4 -4
  185. package/global-footer/global-footer-item.component.d.ts +2 -3
  186. package/global-footer/global-footer.component.d.ts +12 -16
  187. package/global-footer/global-footer.module.d.ts +5 -5
  188. package/hotkey/hotkey.directive.d.ts +4 -6
  189. package/loading/loading.component.d.ts +2 -2
  190. package/loading/loading.module.d.ts +7 -7
  191. package/loading/loading.service.d.ts +5 -8
  192. package/lodop/lodop.service.d.ts +2 -3
  193. package/media/media.component.d.ts +9 -13
  194. package/media/media.module.d.ts +3 -3
  195. package/media/media.service.d.ts +3 -5
  196. package/notice-icon/notice-icon-tab.component.d.ts +1 -1
  197. package/notice-icon/notice-icon.component.d.ts +9 -11
  198. package/notice-icon/notice-icon.module.d.ts +13 -13
  199. package/observers/observer-size.d.ts +4 -5
  200. package/onboarding/onboarding.component.d.ts +7 -10
  201. package/onboarding/onboarding.module.d.ts +8 -8
  202. package/onboarding/onboarding.service.d.ts +9 -16
  203. package/package.json +5 -5
  204. package/page-header/page-header.component.d.ts +24 -27
  205. package/page-header/page-header.module.d.ts +9 -9
  206. package/pdf/pdf.component.d.ts +22 -22
  207. package/pdf/pdf.module.d.ts +4 -4
  208. package/pdf/pdf.types.d.ts +1 -1
  209. package/qr/qr.component.d.ts +3 -4
  210. package/quick-menu/quick-menu.component.d.ts +8 -10
  211. package/quick-menu/quick-menu.module.d.ts +5 -5
  212. package/result/result.component.d.ts +8 -9
  213. package/result/result.module.d.ts +5 -5
  214. package/reuse-tab/reuse-tab-context-menu.component.d.ts +1 -3
  215. package/reuse-tab/reuse-tab-context.component.d.ts +4 -7
  216. package/reuse-tab/reuse-tab-context.directive.d.ts +1 -3
  217. package/reuse-tab/reuse-tab-context.service.d.ts +1 -3
  218. package/reuse-tab/reuse-tab.component.d.ts +21 -28
  219. package/reuse-tab/reuse-tab.service.d.ts +10 -12
  220. package/reuse-tab/reuse-tab.strategy.d.ts +1 -3
  221. package/se/se-container.component.d.ts +20 -21
  222. package/se/se.component.d.ts +17 -21
  223. package/se/se.module.d.ts +7 -7
  224. package/sg/sg-container.component.d.ts +4 -5
  225. package/sg/sg.component.d.ts +9 -12
  226. package/sg/sg.module.d.ts +4 -4
  227. package/st/st-export.d.ts +3 -4
  228. package/st/st-filter.component.d.ts +2 -3
  229. package/st/st-row.directive.d.ts +3 -4
  230. package/st/st-widget-host.directive.d.ts +3 -5
  231. package/st/st.component.d.ts +36 -40
  232. package/sv/sv-container.component.d.ts +19 -20
  233. package/sv/sv-value.component.d.ts +1 -1
  234. package/sv/sv.component.d.ts +13 -16
  235. package/sv/sv.module.d.ts +9 -9
  236. package/tag-select/tag-select.component.d.ts +11 -13
  237. package/tag-select/tag-select.module.d.ts +5 -5
  238. package/xlsx/xlsx.directive.d.ts +1 -3
  239. package/xlsx/xlsx.service.d.ts +4 -7
  240. package/zip/zip.service.d.ts +4 -7
@@ -1,28 +1,24 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, Injectable, Directive, InjectionToken, Optional, Inject, DestroyRef, inject, ViewChild, NgModule, ENVIRONMENT_INITIALIZER, makeEnvironmentProviders } from '@angular/core';
3
- import * as i2 from 'ng-zorro-antd/menu';
4
- import { NzMenuModule } from 'ng-zorro-antd/menu';
5
- import * as i1 from '@delon/theme';
6
- import { ALAIN_I18N_TOKEN, DelonLocaleModule } from '@delon/theme';
7
- import { Subject, Subscription, BehaviorSubject, timer, filter, of, debounceTime } from 'rxjs';
8
- import * as i1$1 from '@angular/cdk/overlay';
9
- import { ConnectionPositionPair, OverlayModule } from '@angular/cdk/overlay';
2
+ import { inject, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, Injectable, Directive, InjectionToken, Injector, ChangeDetectorRef, DestroyRef, booleanAttribute, numberAttribute, ViewChild, NgModule, ENVIRONMENT_INITIALIZER, makeEnvironmentProviders } from '@angular/core';
3
+ import { DelonLocaleService, MenuService, ALAIN_I18N_TOKEN, DelonLocaleModule } from '@delon/theme';
4
+ import { NzMenuDirective, NzMenuItemComponent, NzMenuModule } from 'ng-zorro-antd/menu';
5
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
+ import { Overlay, ConnectionPositionPair, OverlayModule } from '@angular/cdk/overlay';
10
7
  import { ComponentPortal } from '@angular/cdk/portal';
11
- import { __decorate } from 'tslib';
8
+ import { Subject, Subscription, BehaviorSubject, take, timer, filter, of, debounceTime } from 'rxjs';
9
+ import { Directionality } from '@angular/cdk/bidi';
10
+ import { Platform } from '@angular/cdk/platform';
12
11
  import { DOCUMENT, NgTemplateOutlet, CommonModule } from '@angular/common';
13
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
14
- import { InputBoolean, InputNumber } from '@delon/util/decorator';
15
- import * as i6 from 'ng-zorro-antd/icon';
16
- import { NzIconModule } from 'ng-zorro-antd/icon';
17
- import * as i5 from 'ng-zorro-antd/tabs';
18
- import { NzTabsModule } from 'ng-zorro-antd/tabs';
19
- import * as i2$1 from '@angular/router';
20
12
  import { ActivatedRoute, Router, ROUTER_CONFIGURATION, NavigationStart, NavigationEnd, RouterModule, RouteReuseStrategy } from '@angular/router';
13
+ import { NzIconDirective, NzIconModule } from 'ng-zorro-antd/icon';
14
+ import { NzTabSetComponent, NzTabComponent, NzTabsModule } from 'ng-zorro-antd/tabs';
21
15
  import { ScrollService } from '@delon/util/browser';
22
- import * as i3 from '@angular/cdk/platform';
23
- import * as i4 from '@angular/cdk/bidi';
24
16
 
25
17
  class ReuseTabContextMenuComponent {
18
+ constructor() {
19
+ this.i18nSrv = inject(DelonLocaleService);
20
+ this.close = new EventEmitter();
21
+ }
26
22
  set i18n(value) {
27
23
  this._i18n = {
28
24
  ...this.i18nSrv.getData('reuseTab'),
@@ -35,10 +31,6 @@ class ReuseTabContextMenuComponent {
35
31
  get includeNonCloseable() {
36
32
  return this.event.ctrlKey;
37
33
  }
38
- constructor(i18nSrv) {
39
- this.i18nSrv = i18nSrv;
40
- this.close = new EventEmitter();
41
- }
42
34
  notify(type) {
43
35
  this.close.next({
44
36
  type,
@@ -72,16 +64,16 @@ class ReuseTabContextMenuComponent {
72
64
  return;
73
65
  this.notify(null);
74
66
  }
75
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabContextMenuComponent, deps: [{ token: i1.DelonLocaleService }], target: i0.ɵɵFactoryTarget.Component }); }
76
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.2", 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: "ngmodule", type: NzMenuModule }, { kind: "directive", type: i2.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i2.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i2.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
67
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
68
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.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 }); }
77
69
  }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabContextMenuComponent, decorators: [{
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabContextMenuComponent, decorators: [{
79
71
  type: Component,
80
72
  args: [{ selector: 'reuse-tab-context-menu', host: {
81
73
  '(document:click)': 'closeMenu($event)',
82
74
  '(document:contextmenu)': 'closeMenu($event)'
83
- }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [NzMenuModule], 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" }]
84
- }], ctorParameters: () => [{ type: i1.DelonLocaleService }], propDecorators: { i18n: [{
75
+ }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, 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" }]
76
+ }], propDecorators: { i18n: [{
85
77
  type: Input
86
78
  }], item: [{
87
79
  type: Input
@@ -94,8 +86,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
94
86
  }] } });
95
87
 
96
88
  class ReuseTabContextService {
97
- constructor(overlay) {
98
- this.overlay = overlay;
89
+ constructor() {
90
+ this.overlay = inject(Overlay);
99
91
  this.ref = null;
100
92
  this.show = new Subject();
101
93
  this.close = new Subject();
@@ -134,46 +126,42 @@ class ReuseTabContextService {
134
126
  }));
135
127
  comp.onDestroy(() => sub$.unsubscribe());
136
128
  }
137
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabContextService, deps: [{ token: i1$1.Overlay }], target: i0.ɵɵFactoryTarget.Injectable }); }
138
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabContextService }); }
129
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
130
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabContextService }); }
139
131
  }
140
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabContextService, decorators: [{
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabContextService, decorators: [{
141
133
  type: Injectable
142
- }], ctorParameters: () => [{ type: i1$1.Overlay }] });
134
+ }] });
143
135
 
144
136
  class ReuseTabContextComponent {
145
137
  set i18n(value) {
146
138
  this.srv.i18n = value;
147
139
  }
148
- constructor(srv) {
149
- this.srv = srv;
150
- this.sub$ = new Subscription();
140
+ constructor() {
141
+ this.srv = inject(ReuseTabContextService);
151
142
  this.change = new EventEmitter();
152
- this.sub$.add(srv.show.subscribe(context => this.srv.open(context)));
153
- this.sub$.add(srv.close.subscribe(res => this.change.emit(res)));
154
- }
155
- ngOnDestroy() {
156
- this.sub$.unsubscribe();
143
+ this.srv.show.pipe(takeUntilDestroyed()).subscribe(context => this.srv.open(context));
144
+ this.srv.close.pipe(takeUntilDestroyed()).subscribe(res => this.change.emit(res));
157
145
  }
158
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabContextComponent, deps: [{ token: ReuseTabContextService }], target: i0.ɵɵFactoryTarget.Component }); }
159
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: ReuseTabContextComponent, isStandalone: true, selector: "reuse-tab-context", inputs: { i18n: "i18n" }, outputs: { change: "change" }, ngImport: i0, template: ``, isInline: true }); }
146
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabContextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
147
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0", type: ReuseTabContextComponent, isStandalone: true, selector: "reuse-tab-context", inputs: { i18n: "i18n" }, outputs: { change: "change" }, ngImport: i0, template: ``, isInline: true }); }
160
148
  }
161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabContextComponent, decorators: [{
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabContextComponent, decorators: [{
162
150
  type: Component,
163
151
  args: [{
164
152
  selector: 'reuse-tab-context',
165
153
  template: ``,
166
154
  standalone: true
167
155
  }]
168
- }], ctorParameters: () => [{ type: ReuseTabContextService }], propDecorators: { i18n: [{
156
+ }], ctorParameters: () => [], propDecorators: { i18n: [{
169
157
  type: Input
170
158
  }], change: [{
171
159
  type: Output
172
160
  }] } });
173
161
 
174
162
  class ReuseTabContextDirective {
175
- constructor(srv) {
176
- this.srv = srv;
163
+ constructor() {
164
+ this.srv = inject(ReuseTabContextService);
177
165
  }
178
166
  _onContextMenu(event) {
179
167
  this.srv.show.next({
@@ -184,10 +172,10 @@ class ReuseTabContextDirective {
184
172
  event.preventDefault();
185
173
  event.stopPropagation();
186
174
  }
187
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabContextDirective, deps: [{ token: ReuseTabContextService }], target: i0.ɵɵFactoryTarget.Directive }); }
188
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.2", 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 }); }
175
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabContextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
176
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.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 }); }
189
177
  }
190
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabContextDirective, decorators: [{
178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabContextDirective, decorators: [{
191
179
  type: Directive,
192
180
  args: [{
193
181
  selector: '[reuse-tab-context-menu]',
@@ -197,7 +185,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
197
185
  },
198
186
  standalone: true
199
187
  }]
200
- }], ctorParameters: () => [{ type: ReuseTabContextService }], propDecorators: { item: [{
188
+ }], propDecorators: { item: [{
201
189
  type: Input,
202
190
  args: ['reuse-tab-context-menu']
203
191
  }], customContextMenu: [{
@@ -237,6 +225,18 @@ var ReuseTabMatchMode;
237
225
  ReuseTabMatchMode[ReuseTabMatchMode["URL"] = 2] = "URL";
238
226
  })(ReuseTabMatchMode || (ReuseTabMatchMode = {}));
239
227
 
228
+ /**
229
+ * Storage manager that can change rules by implementing `get`, `set` accessors
230
+ */
231
+ const REUSE_TAB_CACHED_MANAGER = new InjectionToken('REUSE_TAB_CACHED_MANAGER');
232
+ class ReuseTabCachedManagerFactory {
233
+ constructor() {
234
+ this.list = [];
235
+ this.title = {};
236
+ this.closable = {};
237
+ }
238
+ }
239
+
240
240
  const REUSE_TAB_STORAGE_KEY = new InjectionToken('REUSE_TAB_STORAGE_KEY');
241
241
  const REUSE_TAB_STORAGE_STATE = new InjectionToken('REUSE_TAB_STORAGE_STATE');
242
242
  class ReuseTabLocalStorageState {
@@ -252,18 +252,6 @@ class ReuseTabLocalStorageState {
252
252
  }
253
253
  }
254
254
 
255
- /**
256
- * Storage manager that can change rules by implementing `get`, `set` accessors
257
- */
258
- const REUSE_TAB_CACHED_MANAGER = new InjectionToken('REUSE_TAB_CACHED_MANAGER');
259
- class ReuseTabCachedManagerFactory {
260
- constructor() {
261
- this.list = [];
262
- this.title = {};
263
- this.closable = {};
264
- }
265
- }
266
-
267
255
  class ReuseTabService {
268
256
  get snapshot() {
269
257
  return this.injector.get(ActivatedRoute).snapshot;
@@ -428,13 +416,17 @@ class ReuseTabService {
428
416
  */
429
417
  replace(newUrl) {
430
418
  const url = this.curUrl;
431
- if (this.exists(url)) {
432
- this.close(url, true);
433
- }
434
- else {
435
- this.removeUrlBuffer = url;
436
- }
437
- this.injector.get(Router).navigateByUrl(newUrl);
419
+ this.injector
420
+ .get(Router)
421
+ .navigateByUrl(newUrl)
422
+ .then(() => {
423
+ if (this.exists(url)) {
424
+ this.close(url, true);
425
+ }
426
+ else {
427
+ this.removeUrlBuffer = url;
428
+ }
429
+ });
438
430
  }
439
431
  /**
440
432
  * 获取标题,顺序如下:
@@ -572,12 +564,12 @@ class ReuseTabService {
572
564
  }
573
565
  }
574
566
  // #endregion
575
- constructor(injector, menuService, cached, stateKey, stateSrv) {
576
- this.injector = injector;
577
- this.menuService = menuService;
578
- this.cached = cached;
579
- this.stateKey = stateKey;
580
- this.stateSrv = stateSrv;
567
+ constructor() {
568
+ this.injector = inject(Injector);
569
+ this.menuService = inject(MenuService);
570
+ this.cached = inject(REUSE_TAB_CACHED_MANAGER);
571
+ this.stateKey = inject(REUSE_TAB_STORAGE_KEY);
572
+ this.stateSrv = inject(REUSE_TAB_STORAGE_STATE);
581
573
  this._inited = false;
582
574
  this._max = 10;
583
575
  this._keepingScroll = false;
@@ -647,13 +639,47 @@ class ReuseTabService {
647
639
  this.di('#shouldDetach', this.can(route), this.getUrl(route));
648
640
  return this.can(route);
649
641
  }
642
+ saveCache(snapshot, _handle, pos) {
643
+ const snapshotTrue = this.getTruthRoute(snapshot);
644
+ const url = this.getUrl(snapshot);
645
+ const idx = this.index(url);
646
+ const item = {
647
+ title: this.getTitle(url, snapshotTrue),
648
+ url,
649
+ closable: this.getClosable(url, snapshot),
650
+ _snapshot: snapshot,
651
+ _handle
652
+ };
653
+ if (idx < 0) {
654
+ this.items.splice(pos ?? this.items.length, 0, item);
655
+ if (this.count > this._max) {
656
+ // Get the oldest closable location
657
+ const closeIdx = this.items.findIndex(w => w.url !== url && w.closable);
658
+ if (closeIdx !== -1) {
659
+ const closeItem = this.items[closeIdx];
660
+ this.remove(closeIdx, false);
661
+ timer(1)
662
+ .pipe(take(1))
663
+ .subscribe(() => this._cachedChange.next({ active: 'close', url: closeItem.url, list: this.cached.list }));
664
+ }
665
+ }
666
+ }
667
+ else {
668
+ this.items[idx] = item;
669
+ }
670
+ }
650
671
  /**
651
672
  * 存储
652
673
  */
653
674
  store(_snapshot, _handle) {
654
675
  const url = this.getUrl(_snapshot);
655
676
  const idx = this.index(url);
656
- const isAdd = idx === -1;
677
+ if (idx === -1)
678
+ return;
679
+ if (_handle != null) {
680
+ this.saveCache(_snapshot, _handle);
681
+ }
682
+ const list = this.cached.list;
657
683
  const item = {
658
684
  title: this.getTitle(url, _snapshot),
659
685
  closable: this.getClosable(url, _snapshot),
@@ -662,32 +688,21 @@ class ReuseTabService {
662
688
  _snapshot,
663
689
  _handle
664
690
  };
665
- if (isAdd) {
666
- if (this.count >= this._max) {
667
- // Get the oldest closable location
668
- const closeIdx = this.cached.list.findIndex(w => w.closable);
669
- if (closeIdx !== -1)
670
- this.remove(closeIdx, false);
671
- }
672
- this.cached.list.push(item);
673
- }
674
- else {
675
- // Current handler is null when activate routes
676
- // For better reliability, we need to wait for the component to be attached before call _onReuseInit
677
- const cahcedComponentRef = this.cached.list[idx]._handle?.componentRef;
678
- if (_handle == null && cahcedComponentRef != null) {
679
- timer(100).subscribe(() => this.runHook('_onReuseInit', cahcedComponentRef));
680
- }
681
- this.cached.list[idx] = item;
691
+ // Current handler is null when activate routes
692
+ // For better reliability, we need to wait for the component to be attached before call _onReuseInit
693
+ const cahcedComponentRef = list[idx]._handle?.componentRef;
694
+ if (_handle == null && cahcedComponentRef != null) {
695
+ timer(100)
696
+ .pipe(take(1))
697
+ .subscribe(() => this.runHook('_onReuseInit', cahcedComponentRef));
682
698
  }
699
+ list[idx] = item;
683
700
  this.removeUrlBuffer = null;
684
- this.di('#store', isAdd ? '[new]' : '[override]', url);
701
+ this.di('#store', '[override]', url);
685
702
  if (_handle && _handle.componentRef) {
686
703
  this.runHook('_onReuseDestroy', _handle.componentRef);
687
704
  }
688
- if (!isAdd) {
689
- this._cachedChange.next({ active: 'override', item, list: this.cached.list });
690
- }
705
+ this._cachedChange.next({ active: 'override', item, list });
691
706
  }
692
707
  /**
693
708
  * 决定是否允许应用缓存数据
@@ -797,45 +812,25 @@ class ReuseTabService {
797
812
  _router$.unsubscribe();
798
813
  }
799
814
  }
800
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabService, deps: [{ token: i0.Injector }, { token: i1.MenuService }, { token: REUSE_TAB_CACHED_MANAGER, optional: true }, { token: REUSE_TAB_STORAGE_KEY, optional: true }, { token: REUSE_TAB_STORAGE_STATE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
801
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabService, providedIn: 'root' }); }
815
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
816
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabService }); }
802
817
  }
803
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabService, decorators: [{
804
- type: Injectable,
805
- args: [{ providedIn: 'root' }]
806
- }], ctorParameters: () => [{ type: i0.Injector }, { type: i1.MenuService }, { type: undefined, decorators: [{
807
- type: Optional
808
- }, {
809
- type: Inject,
810
- args: [REUSE_TAB_CACHED_MANAGER]
811
- }] }, { type: undefined, decorators: [{
812
- type: Optional
813
- }, {
814
- type: Inject,
815
- args: [REUSE_TAB_STORAGE_KEY]
816
- }] }, { type: undefined, decorators: [{
817
- type: Optional
818
- }, {
819
- type: Inject,
820
- args: [REUSE_TAB_STORAGE_STATE]
821
- }] }] });
818
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabService, decorators: [{
819
+ type: Injectable
820
+ }], ctorParameters: () => [] });
822
821
 
823
822
  class ReuseTabComponent {
824
- set keepingScrollContainer(value) {
825
- this._keepingScrollContainer = typeof value === 'string' ? this.doc.querySelector(value) : value;
826
- }
827
- // #endregion
828
- constructor(srv, cdr, router, route, i18nSrv, doc, platform, directionality, stateKey, stateSrv) {
829
- this.srv = srv;
830
- this.cdr = cdr;
831
- this.router = router;
832
- this.route = route;
833
- this.i18nSrv = i18nSrv;
834
- this.doc = doc;
835
- this.platform = platform;
836
- this.directionality = directionality;
837
- this.stateKey = stateKey;
838
- this.stateSrv = stateSrv;
823
+ constructor() {
824
+ this.srv = inject(ReuseTabService, { optional: true });
825
+ this.cdr = inject(ChangeDetectorRef);
826
+ this.router = inject(Router);
827
+ this.route = inject(ActivatedRoute);
828
+ this.i18nSrv = inject(ALAIN_I18N_TOKEN, { optional: true });
829
+ this.doc = inject(DOCUMENT);
830
+ this.platform = inject(Platform);
831
+ this.directionality = inject(Directionality, { optional: true });
832
+ this.stateKey = inject(REUSE_TAB_STORAGE_KEY);
833
+ this.stateSrv = inject(REUSE_TAB_STORAGE_STATE);
839
834
  this.destroy$ = inject(DestroyRef);
840
835
  this.list = [];
841
836
  this.pos = 0;
@@ -854,6 +849,10 @@ class ReuseTabComponent {
854
849
  this.change = new EventEmitter();
855
850
  this.close = new EventEmitter();
856
851
  }
852
+ set keepingScrollContainer(value) {
853
+ this._keepingScrollContainer = typeof value === 'string' ? this.doc.querySelector(value) : value;
854
+ }
855
+ // #endregion
857
856
  genTit(title) {
858
857
  return title.i18n && this.i18nSrv ? this.i18nSrv.fanyi(title.i18n) : title.text;
859
858
  }
@@ -876,13 +875,12 @@ class ReuseTabComponent {
876
875
  const ls = this.srv.items.map((item, index) => ({
877
876
  url: item.url,
878
877
  title: this.genTit(item.title),
879
- closable: this.allowClose && item.closable && this.srv.count > 0,
878
+ closable: this.allowClose && this.srv.count > 0 && this.srv.getClosable(item.url, item._snapshot),
880
879
  position: item.position,
881
880
  index,
882
881
  active: false,
883
882
  last: false
884
883
  }));
885
- // debugger;
886
884
  const url = this.curUrl;
887
885
  let addCurrent = ls.findIndex(w => w.url === url) === -1;
888
886
  if (notify && notify.active === 'close' && notify.url === url) {
@@ -900,7 +898,10 @@ class ReuseTabComponent {
900
898
  this.router.navigateByUrl(ls[toPos].url);
901
899
  }
902
900
  if (addCurrent) {
903
- ls.splice(this.pos + 1, 0, this.genCurItem());
901
+ const addPos = this.pos + 1;
902
+ ls.splice(addPos, 0, this.genCurItem());
903
+ // Attach to cache
904
+ this.srv.saveCache(this.route.snapshot, null, addPos);
904
905
  }
905
906
  ls.forEach((item, index) => (item.index = index));
906
907
  if (ls.length === 1) {
@@ -923,7 +924,7 @@ class ReuseTabComponent {
923
924
  saveState() {
924
925
  if (!this.srv.inited || !this.storageState)
925
926
  return;
926
- this.stateSrv.update(this.stateKey, this.list);
927
+ this.stateSrv?.update(this.stateKey, this.list);
927
928
  }
928
929
  // #region UI
929
930
  contextMenuChange(res) {
@@ -966,9 +967,7 @@ class ReuseTabComponent {
966
967
  return;
967
968
  this.item = item;
968
969
  this.change.emit(item);
969
- if (cb) {
970
- cb();
971
- }
970
+ cb?.();
972
971
  });
973
972
  }
974
973
  _close(e, idx, includeNonCloseable) {
@@ -992,6 +991,8 @@ class ReuseTabComponent {
992
991
  * <router-outlet (activate)="reuseTab.activate($event)" (attach)="reuseTab.activate($event)"></router-outlet>
993
992
  */
994
993
  activate(instance) {
994
+ if (this.srv == null)
995
+ return;
995
996
  this.srv.componentRef = { instance };
996
997
  }
997
998
  updatePos() {
@@ -1015,12 +1016,12 @@ class ReuseTabComponent {
1015
1016
  }
1016
1017
  // #endregion
1017
1018
  ngOnInit() {
1018
- this.dir = this.directionality.value;
1019
- this.directionality.change?.pipe(takeUntilDestroyed(this.destroy$)).subscribe((direction) => {
1019
+ this.dir = this.directionality?.value;
1020
+ this.directionality?.change.pipe(takeUntilDestroyed(this.destroy$)).subscribe(direction => {
1020
1021
  this.dir = direction;
1021
1022
  this.cdr.detectChanges();
1022
1023
  });
1023
- if (!this.platform.isBrowser) {
1024
+ if (!this.platform.isBrowser || this.srv == null) {
1024
1025
  return;
1025
1026
  }
1026
1027
  this.srv.change.pipe(takeUntilDestroyed(this.destroy$)).subscribe(res => {
@@ -1037,13 +1038,13 @@ class ReuseTabComponent {
1037
1038
  }
1038
1039
  this.genList(res);
1039
1040
  });
1040
- this.i18nSrv.change
1041
+ this.i18nSrv?.change
1041
1042
  .pipe(filter(() => this.srv.inited), takeUntilDestroyed(this.destroy$), debounceTime(100))
1042
1043
  .subscribe(() => this.genList({ active: 'title' }));
1043
1044
  this.srv.init();
1044
1045
  }
1045
1046
  ngOnChanges(changes) {
1046
- if (!this.platform.isBrowser) {
1047
+ if (!this.platform.isBrowser || this.srv == null) {
1047
1048
  return;
1048
1049
  }
1049
1050
  if (changes.max)
@@ -1063,31 +1064,10 @@ class ReuseTabComponent {
1063
1064
  this.srv.debug = this.debug;
1064
1065
  this.cdr.detectChanges();
1065
1066
  }
1066
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabComponent, deps: [{ token: ReuseTabService }, { token: i0.ChangeDetectorRef }, { token: i2$1.Router }, { token: i2$1.ActivatedRoute }, { token: ALAIN_I18N_TOKEN, optional: true }, { token: DOCUMENT }, { token: i3.Platform }, { token: i4.Directionality, optional: true }, { token: REUSE_TAB_STORAGE_KEY, optional: true }, { token: REUSE_TAB_STORAGE_STATE, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1067
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.2", type: ReuseTabComponent, isStandalone: true, selector: "reuse-tab, [reuse-tab]", inputs: { mode: "mode", i18n: "i18n", debug: "debug", max: "max", tabMaxWidth: "tabMaxWidth", excludes: "excludes", allowClose: "allowClose", keepingScroll: "keepingScroll", storageState: "storageState", keepingScrollContainer: "keepingScrollContainer", customContextMenu: "customContextMenu", tabBarExtraContent: "tabBarExtraContent", tabBarGutter: "tabBarGutter", tabBarStyle: "tabBarStyle", tabType: "tabType", routeParamMatchMode: "routeParamMatchMode", disabled: "disabled", 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-tabset\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 <i nz-icon nzType=\"close\" class=\"reuse-tab__op\" (click)=\"_close($event, $index, false)\"></i>\n }\n </ng-template>\n </nz-tab>\n }\n</nz-tabset>\n<reuse-tab-context [i18n]=\"i18n\" (change)=\"contextMenuChange($event)\" />\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: NzTabsModule }, { kind: "component", type: i5.NzTabSetComponent, selector: "nz-tabset", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabset"] }, { kind: "component", type: i5.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: "ngmodule", type: NzIconModule }, { kind: "directive", type: i6.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1067
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1068
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.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-tabset\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 <i nz-icon nzType=\"close\" class=\"reuse-tab__op\" (click)=\"_close($event, $index, false)\"></i>\n }\n </ng-template>\n </nz-tab>\n }\n</nz-tabset>\n<reuse-tab-context [i18n]=\"i18n\" (change)=\"contextMenuChange($event)\" />\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NzTabSetComponent, selector: "nz-tabset", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabset"] }, { 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]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1068
1069
  }
1069
- __decorate([
1070
- InputBoolean()
1071
- ], ReuseTabComponent.prototype, "debug", void 0);
1072
- __decorate([
1073
- InputNumber()
1074
- ], ReuseTabComponent.prototype, "max", void 0);
1075
- __decorate([
1076
- InputNumber()
1077
- ], ReuseTabComponent.prototype, "tabMaxWidth", void 0);
1078
- __decorate([
1079
- InputBoolean()
1080
- ], ReuseTabComponent.prototype, "allowClose", void 0);
1081
- __decorate([
1082
- InputBoolean()
1083
- ], ReuseTabComponent.prototype, "keepingScroll", void 0);
1084
- __decorate([
1085
- InputBoolean()
1086
- ], ReuseTabComponent.prototype, "storageState", void 0);
1087
- __decorate([
1088
- InputBoolean()
1089
- ], ReuseTabComponent.prototype, "disabled", void 0);
1090
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabComponent, decorators: [{
1070
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabComponent, decorators: [{
1091
1071
  type: Component,
1092
1072
  args: [{ selector: 'reuse-tab, [reuse-tab]', exportAs: 'reuseTab', host: {
1093
1073
  '[class.reuse-tab]': 'true',
@@ -1097,33 +1077,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
1097
1077
  '[class.reuse-tab-rtl]': `dir === 'rtl'`
1098
1078
  }, providers: [ReuseTabContextService], preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
1099
1079
  NgTemplateOutlet,
1100
- NzTabsModule,
1080
+ NzTabSetComponent,
1081
+ NzTabComponent,
1101
1082
  ReuseTabContextMenuComponent,
1102
1083
  ReuseTabContextDirective,
1103
1084
  ReuseTabContextComponent,
1104
- NzIconModule
1085
+ NzIconDirective
1105
1086
  ], template: "<nz-tabset\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 <i nz-icon nzType=\"close\" class=\"reuse-tab__op\" (click)=\"_close($event, $index, false)\"></i>\n }\n </ng-template>\n </nz-tab>\n }\n</nz-tabset>\n<reuse-tab-context [i18n]=\"i18n\" (change)=\"contextMenuChange($event)\" />\n" }]
1106
- }], ctorParameters: () => [{ type: ReuseTabService }, { type: i0.ChangeDetectorRef }, { type: i2$1.Router }, { type: i2$1.ActivatedRoute }, { type: undefined, decorators: [{
1107
- type: Optional
1108
- }, {
1109
- type: Inject,
1110
- args: [ALAIN_I18N_TOKEN]
1111
- }] }, { type: undefined, decorators: [{
1112
- type: Inject,
1113
- args: [DOCUMENT]
1114
- }] }, { type: i3.Platform }, { type: i4.Directionality, decorators: [{
1115
- type: Optional
1116
- }] }, { type: undefined, decorators: [{
1117
- type: Optional
1118
- }, {
1119
- type: Inject,
1120
- args: [REUSE_TAB_STORAGE_KEY]
1121
- }] }, { type: undefined, decorators: [{
1122
- type: Optional
1123
- }, {
1124
- type: Inject,
1125
- args: [REUSE_TAB_STORAGE_STATE]
1126
- }] }], propDecorators: { tabset: [{
1087
+ }], propDecorators: { tabset: [{
1127
1088
  type: ViewChild,
1128
1089
  args: ['tabset']
1129
1090
  }], mode: [{
@@ -1131,19 +1092,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
1131
1092
  }], i18n: [{
1132
1093
  type: Input
1133
1094
  }], debug: [{
1134
- type: Input
1095
+ type: Input,
1096
+ args: [{ transform: booleanAttribute }]
1135
1097
  }], max: [{
1136
- type: Input
1098
+ type: Input,
1099
+ args: [{ transform: numberAttribute }]
1137
1100
  }], tabMaxWidth: [{
1138
- type: Input
1101
+ type: Input,
1102
+ args: [{ transform: numberAttribute }]
1139
1103
  }], excludes: [{
1140
1104
  type: Input
1141
1105
  }], allowClose: [{
1142
- type: Input
1106
+ type: Input,
1107
+ args: [{ transform: booleanAttribute }]
1143
1108
  }], keepingScroll: [{
1144
- type: Input
1109
+ type: Input,
1110
+ args: [{ transform: booleanAttribute }]
1145
1111
  }], storageState: [{
1146
- type: Input
1112
+ type: Input,
1113
+ args: [{ transform: booleanAttribute }]
1147
1114
  }], keepingScrollContainer: [{
1148
1115
  type: Input
1149
1116
  }], customContextMenu: [{
@@ -1159,7 +1126,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
1159
1126
  }], routeParamMatchMode: [{
1160
1127
  type: Input
1161
1128
  }], disabled: [{
1162
- type: Input
1129
+ type: Input,
1130
+ args: [{ transform: booleanAttribute }]
1163
1131
  }], titleRender: [{
1164
1132
  type: Input
1165
1133
  }], canClose: [{
@@ -1171,8 +1139,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
1171
1139
  }] } });
1172
1140
 
1173
1141
  class ReuseTabStrategy {
1174
- constructor(srv) {
1175
- this.srv = srv;
1142
+ constructor() {
1143
+ this.srv = inject(ReuseTabService);
1176
1144
  }
1177
1145
  shouldDetach(route) {
1178
1146
  return this.srv.shouldDetach(route);
@@ -1194,15 +1162,15 @@ class ReuseTabStrategy {
1194
1162
  const COMPONENTS = [ReuseTabComponent];
1195
1163
  const NOEXPORTS = [ReuseTabContextMenuComponent, ReuseTabContextComponent, ReuseTabContextDirective];
1196
1164
  class ReuseTabModule {
1197
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1198
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabModule, imports: [CommonModule,
1165
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1166
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabModule, imports: [CommonModule,
1199
1167
  RouterModule,
1200
1168
  DelonLocaleModule,
1201
1169
  NzMenuModule,
1202
1170
  NzTabsModule,
1203
1171
  NzIconModule,
1204
1172
  OverlayModule, ReuseTabComponent, ReuseTabContextMenuComponent, ReuseTabContextComponent, ReuseTabContextDirective], exports: [ReuseTabComponent] }); }
1205
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabModule, providers: [
1173
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabModule, providers: [
1206
1174
  {
1207
1175
  provide: REUSE_TAB_STORAGE_KEY,
1208
1176
  useValue: '_reuse-tab-state'
@@ -1223,7 +1191,7 @@ class ReuseTabModule {
1223
1191
  NzIconModule,
1224
1192
  OverlayModule, COMPONENTS, ReuseTabContextMenuComponent] }); }
1225
1193
  }
1226
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: ReuseTabModule, decorators: [{
1194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: ReuseTabModule, decorators: [{
1227
1195
  type: NgModule,
1228
1196
  args: [{
1229
1197
  imports: [
@@ -1274,6 +1242,7 @@ function makeFeature(kind, providers) {
1274
1242
  */
1275
1243
  function provideReuseTabConfig(options) {
1276
1244
  const providers = [
1245
+ ReuseTabService,
1277
1246
  {
1278
1247
  provide: REUSE_TAB_STORAGE_KEY,
1279
1248
  useValue: options?.storeKey ?? '_reuse-tab-state'