@delon/abc 19.1.0 → 20.0.0-beta.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 (246) hide show
  1. package/auto-focus/index.d.ts +19 -2
  2. package/cell/index.d.ts +316 -6
  3. package/cell/style/index.less +1 -1
  4. package/count-down/index.d.ts +26 -5
  5. package/date-picker/index.d.ts +51 -5
  6. package/down-file/index.d.ts +34 -5
  7. package/ellipsis/index.d.ts +55 -5
  8. package/error-collect/index.d.ts +35 -5
  9. package/exception/index.d.ts +45 -5
  10. package/fesm2022/auto-focus.mjs +7 -7
  11. package/fesm2022/cell.mjs +14 -15
  12. package/fesm2022/cell.mjs.map +1 -1
  13. package/fesm2022/chart-observer-size.mjs +11 -11
  14. package/fesm2022/count-down.mjs +8 -9
  15. package/fesm2022/count-down.mjs.map +1 -1
  16. package/fesm2022/date-picker.mjs +16 -15
  17. package/fesm2022/date-picker.mjs.map +1 -1
  18. package/fesm2022/down-file.mjs +8 -8
  19. package/fesm2022/ellipsis.mjs +9 -9
  20. package/fesm2022/ellipsis.mjs.map +1 -1
  21. package/fesm2022/error-collect.mjs +15 -15
  22. package/fesm2022/error-collect.mjs.map +1 -1
  23. package/fesm2022/exception.mjs +94 -78
  24. package/fesm2022/exception.mjs.map +1 -1
  25. package/fesm2022/footer-toolbar.mjs +44 -22
  26. package/fesm2022/footer-toolbar.mjs.map +1 -1
  27. package/fesm2022/full-content.mjs +25 -38
  28. package/fesm2022/full-content.mjs.map +1 -1
  29. package/fesm2022/global-footer.mjs +79 -60
  30. package/fesm2022/global-footer.mjs.map +1 -1
  31. package/fesm2022/hotkey.mjs +8 -8
  32. package/fesm2022/loading.mjs +12 -12
  33. package/fesm2022/loading.mjs.map +1 -1
  34. package/fesm2022/lodop.mjs +12 -11
  35. package/fesm2022/lodop.mjs.map +1 -1
  36. package/fesm2022/media.mjs +12 -13
  37. package/fesm2022/media.mjs.map +1 -1
  38. package/fesm2022/notice-icon.mjs +19 -29
  39. package/fesm2022/notice-icon.mjs.map +1 -1
  40. package/fesm2022/onboarding.mjs +14 -14
  41. package/fesm2022/onboarding.mjs.map +1 -1
  42. package/fesm2022/page-header.mjs +22 -27
  43. package/fesm2022/page-header.mjs.map +1 -1
  44. package/fesm2022/pdf.mjs +13 -13
  45. package/fesm2022/pdf.mjs.map +1 -1
  46. package/fesm2022/quick-menu.mjs +9 -9
  47. package/fesm2022/quick-menu.mjs.map +1 -1
  48. package/fesm2022/reuse-tab.mjs +32 -38
  49. package/fesm2022/reuse-tab.mjs.map +1 -1
  50. package/fesm2022/se.mjs +20 -21
  51. package/fesm2022/se.mjs.map +1 -1
  52. package/fesm2022/sg.mjs +17 -18
  53. package/fesm2022/sg.mjs.map +1 -1
  54. package/fesm2022/st.mjs +84 -87
  55. package/fesm2022/st.mjs.map +1 -1
  56. package/fesm2022/sv.mjs +23 -25
  57. package/fesm2022/sv.mjs.map +1 -1
  58. package/fesm2022/tag-select.mjs +13 -29
  59. package/fesm2022/tag-select.mjs.map +1 -1
  60. package/fesm2022/xlsx.mjs +16 -15
  61. package/fesm2022/xlsx.mjs.map +1 -1
  62. package/fesm2022/zip.mjs +8 -7
  63. package/fesm2022/zip.mjs.map +1 -1
  64. package/footer-toolbar/index.d.ts +23 -5
  65. package/footer-toolbar/style/index.less +1 -1
  66. package/full-content/index.d.ts +55 -5
  67. package/global-footer/index.d.ts +44 -5
  68. package/hotkey/index.d.ts +25 -5
  69. package/index.d.ts +2 -5
  70. package/index.less +0 -2
  71. package/loading/index.d.ts +93 -5
  72. package/lodop/index.d.ts +277 -5
  73. package/media/index.d.ts +61 -5
  74. package/notice-icon/index.d.ts +90 -5
  75. package/notice-icon/style/index.less +2 -2
  76. package/observers/index.d.ts +34 -5
  77. package/onboarding/index.d.ts +212 -5
  78. package/package.json +5 -13
  79. package/page-header/index.d.ts +83 -5
  80. package/page-header/style/index.less +1 -1
  81. package/pdf/index.d.ts +142 -5
  82. package/quick-menu/index.d.ts +38 -5
  83. package/quick-menu/style/index.less +2 -2
  84. package/reuse-tab/index.d.ts +512 -3
  85. package/se/index.d.ts +129 -5
  86. package/sg/index.d.ts +44 -5
  87. package/st/index.d.ts +1708 -3
  88. package/st/style/index.less +1 -1
  89. package/sv/index.d.ts +96 -5
  90. package/sv/style/index.less +1 -1
  91. package/tag-select/index.d.ts +27 -5
  92. package/theme-dark.less +0 -4
  93. package/theme-default.less +0 -8
  94. package/xlsx/index.d.ts +71 -5
  95. package/zip/index.d.ts +65 -5
  96. package/auto-focus/auto-focus.directive.d.ts +0 -10
  97. package/auto-focus/auto-focus.module.d.ts +0 -7
  98. package/avatar-list/avatar-list-item.component.d.ts +0 -9
  99. package/avatar-list/avatar-list.component.d.ts +0 -29
  100. package/avatar-list/avatar-list.module.d.ts +0 -14
  101. package/avatar-list/index.d.ts +0 -5
  102. package/avatar-list/public_api.d.ts +0 -3
  103. package/avatar-list/style/index.less +0 -53
  104. package/avatar-list/style/rtl.less +0 -3
  105. package/cell/cell-host.directive.d.ts +0 -10
  106. package/cell/cell.component.d.ts +0 -30
  107. package/cell/cell.module.d.ts +0 -17
  108. package/cell/cell.service.d.ts +0 -19
  109. package/cell/cell.types.d.ts +0 -234
  110. package/cell/provide.d.ts +0 -10
  111. package/count-down/count-down.component.d.ts +0 -15
  112. package/count-down/count-down.module.d.ts +0 -9
  113. package/count-down/public_api.d.ts +0 -2
  114. package/date-picker/date-picker.module.d.ts +0 -11
  115. package/date-picker/public_api.d.ts +0 -3
  116. package/date-picker/range-shortcut.component.d.ts +0 -10
  117. package/date-picker/range.directive.d.ts +0 -30
  118. package/down-file/down-file.directive.d.ts +0 -23
  119. package/down-file/down-file.module.d.ts +0 -9
  120. package/down-file/public_api.d.ts +0 -2
  121. package/ellipsis/ellipsis.component.d.ts +0 -43
  122. package/ellipsis/ellipsis.module.d.ts +0 -10
  123. package/ellipsis/public_api.d.ts +0 -2
  124. package/error-collect/error-collect.component.d.ts +0 -23
  125. package/error-collect/error-collect.module.d.ts +0 -9
  126. package/error-collect/public_api.d.ts +0 -2
  127. package/exception/exception.component.d.ts +0 -36
  128. package/exception/exception.module.d.ts +0 -12
  129. package/exception/public_api.d.ts +0 -2
  130. package/fesm2022/avatar-list.mjs +0 -132
  131. package/fesm2022/avatar-list.mjs.map +0 -1
  132. package/fesm2022/result.mjs +0 -84
  133. package/fesm2022/result.mjs.map +0 -1
  134. package/footer-toolbar/footer-toolbar.component.d.ts +0 -14
  135. package/footer-toolbar/footer-toolbar.module.d.ts +0 -10
  136. package/footer-toolbar/public_api.d.ts +0 -2
  137. package/full-content/full-content-toggle.directive.d.ts +0 -7
  138. package/full-content/full-content.component.d.ts +0 -32
  139. package/full-content/full-content.module.d.ts +0 -9
  140. package/full-content/full-content.service.d.ts +0 -10
  141. package/full-content/public_api.d.ts +0 -4
  142. package/global-footer/global-footer-item.component.d.ts +0 -10
  143. package/global-footer/global-footer.component.d.ts +0 -22
  144. package/global-footer/global-footer.module.d.ts +0 -10
  145. package/global-footer/global-footer.types.d.ts +0 -7
  146. package/global-footer/public_api.d.ts +0 -4
  147. package/hotkey/hotkey.directive.d.ts +0 -16
  148. package/hotkey/hotkey.module.d.ts +0 -7
  149. package/hotkey/public_api.d.ts +0 -2
  150. package/loading/loading.component.d.ts +0 -11
  151. package/loading/loading.module.d.ts +0 -12
  152. package/loading/loading.service.d.ts +0 -34
  153. package/loading/loading.types.d.ts +0 -35
  154. package/loading/public_api.d.ts +0 -4
  155. package/lodop/lodop.module.d.ts +0 -6
  156. package/lodop/lodop.service.d.ts +0 -74
  157. package/lodop/lodop.types.d.ts +0 -193
  158. package/lodop/public_api.d.ts +0 -3
  159. package/media/media.component.d.ts +0 -33
  160. package/media/media.module.d.ts +0 -8
  161. package/media/media.service.d.ts +0 -17
  162. package/media/public_api.d.ts +0 -3
  163. package/notice-icon/notice-icon-tab.component.d.ts +0 -13
  164. package/notice-icon/notice-icon.component.d.ts +0 -25
  165. package/notice-icon/notice-icon.module.d.ts +0 -18
  166. package/notice-icon/notice-icon.types.d.ts +0 -36
  167. package/notice-icon/public_api.d.ts +0 -4
  168. package/observers/observer-size.d.ts +0 -31
  169. package/observers/public-api.d.ts +0 -1
  170. package/onboarding/onboarding.component.d.ts +0 -35
  171. package/onboarding/onboarding.module.d.ts +0 -13
  172. package/onboarding/onboarding.service.d.ts +0 -58
  173. package/onboarding/onboarding.storage.d.ts +0 -11
  174. package/onboarding/onboarding.types.d.ts +0 -95
  175. package/onboarding/public_api.d.ts +0 -5
  176. package/page-header/page-header.component.d.ts +0 -70
  177. package/page-header/page-header.module.d.ts +0 -14
  178. package/page-header/public_api.d.ts +0 -2
  179. package/pdf/pdf.component.d.ts +0 -101
  180. package/pdf/pdf.config.d.ts +0 -2
  181. package/pdf/pdf.module.d.ts +0 -9
  182. package/pdf/pdf.types.d.ts +0 -29
  183. package/pdf/public_api.d.ts +0 -4
  184. package/public_api.d.ts +0 -2
  185. package/quick-menu/public_api.d.ts +0 -2
  186. package/quick-menu/quick-menu.component.d.ts +0 -26
  187. package/quick-menu/quick-menu.module.d.ts +0 -10
  188. package/result/index.d.ts +0 -5
  189. package/result/public_api.d.ts +0 -2
  190. package/result/result.component.d.ts +0 -21
  191. package/result/result.module.d.ts +0 -13
  192. package/result/style/index.less +0 -66
  193. package/result/style/rtl.less +0 -3
  194. package/reuse-tab/lifecycle_hooks.d.ts +0 -16
  195. package/reuse-tab/provide.d.ts +0 -28
  196. package/reuse-tab/public_api.d.ts +0 -14
  197. package/reuse-tab/reuse-tab-context-menu.component.d.ts +0 -21
  198. package/reuse-tab/reuse-tab-context.component.d.ts +0 -11
  199. package/reuse-tab/reuse-tab-context.directive.d.ts +0 -10
  200. package/reuse-tab/reuse-tab-context.service.d.ts +0 -14
  201. package/reuse-tab/reuse-tab.cache.d.ts +0 -16
  202. package/reuse-tab/reuse-tab.component.d.ts +0 -79
  203. package/reuse-tab/reuse-tab.interfaces.d.ts +0 -110
  204. package/reuse-tab/reuse-tab.module.d.ts +0 -17
  205. package/reuse-tab/reuse-tab.service.d.ts +0 -192
  206. package/reuse-tab/reuse-tab.state.d.ts +0 -14
  207. package/reuse-tab/reuse-tab.strategy.d.ts +0 -10
  208. package/se/public_api.d.ts +0 -4
  209. package/se/se-container.component.d.ts +0 -49
  210. package/se/se.component.d.ts +0 -60
  211. package/se/se.module.d.ts +0 -12
  212. package/se/se.types.d.ts +0 -9
  213. package/sg/public_api.d.ts +0 -3
  214. package/sg/sg-container.component.d.ts +0 -15
  215. package/sg/sg.component.d.ts +0 -19
  216. package/sg/sg.module.d.ts +0 -9
  217. package/st/provide.d.ts +0 -10
  218. package/st/public_api.d.ts +0 -12
  219. package/st/st-column-source.d.ts +0 -47
  220. package/st/st-data-source.d.ts +0 -77
  221. package/st/st-export.d.ts +0 -11
  222. package/st/st-filter.component.d.ts +0 -23
  223. package/st/st-row.directive.d.ts +0 -20
  224. package/st/st-widget-host.directive.d.ts +0 -12
  225. package/st/st-widget.d.ts +0 -11
  226. package/st/st.component.d.ts +0 -295
  227. package/st/st.config.d.ts +0 -2
  228. package/st/st.interfaces.d.ts +0 -1193
  229. package/st/st.module.d.ts +0 -9
  230. package/st/st.types.d.ts +0 -77
  231. package/sv/public_api.d.ts +0 -4
  232. package/sv/sv-container.component.d.ts +0 -39
  233. package/sv/sv-value.component.d.ts +0 -10
  234. package/sv/sv.component.d.ts +0 -34
  235. package/sv/sv.module.d.ts +0 -14
  236. package/tag-select/public_api.d.ts +0 -2
  237. package/tag-select/tag-select.component.d.ts +0 -21
  238. package/tag-select/tag-select.module.d.ts +0 -10
  239. package/xlsx/public_api.d.ts +0 -4
  240. package/xlsx/xlsx.directive.d.ts +0 -9
  241. package/xlsx/xlsx.module.d.ts +0 -7
  242. package/xlsx/xlsx.service.d.ts +0 -27
  243. package/xlsx/xlsx.types.d.ts +0 -27
  244. package/zip/public_api.d.ts +0 -2
  245. package/zip/zip.service.d.ts +0 -34
  246. package/zip/zip.types.d.ts +0 -28
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, EventEmitter, Directive, Input, Output, NgModule } from '@angular/core';
2
+ import { inject, ElementRef, EventEmitter, Output, Input, Directive, NgModule } from '@angular/core';
3
3
  import { finalize } from 'rxjs';
4
4
  import { saveAs } from 'file-saver';
5
5
  import { _HttpClient, AlainThemeModule } from '@delon/theme';
@@ -82,10 +82,10 @@ class DownFileDirective {
82
82
  error: err => this.error.emit(err)
83
83
  });
84
84
  }
85
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: DownFileDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
86
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.1", type: DownFileDirective, isStandalone: true, selector: "[down-file]", inputs: { httpData: ["http-data", "httpData"], httpBody: ["http-body", "httpBody"], httpMethod: ["http-method", "httpMethod"], httpUrl: ["http-url", "httpUrl"], fileName: ["file-name", "fileName"], pre: "pre" }, outputs: { success: "success", error: "error" }, host: { listeners: { "click": "_click($event)" } }, exportAs: ["downFile"], ngImport: i0 });
85
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: DownFileDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
86
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: DownFileDirective, isStandalone: true, selector: "[down-file]", inputs: { httpData: ["http-data", "httpData"], httpBody: ["http-body", "httpBody"], httpMethod: ["http-method", "httpMethod"], httpUrl: ["http-url", "httpUrl"], fileName: ["file-name", "fileName"], pre: "pre" }, outputs: { success: "success", error: "error" }, host: { listeners: { "click": "_click($event)" } }, exportAs: ["downFile"], ngImport: i0 });
87
87
  }
88
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: DownFileDirective, decorators: [{
88
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: DownFileDirective, decorators: [{
89
89
  type: Directive,
90
90
  args: [{
91
91
  selector: '[down-file]',
@@ -119,11 +119,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImpor
119
119
 
120
120
  const DIRECTIVES = [DownFileDirective];
121
121
  class DownFileModule {
122
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: DownFileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
123
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: DownFileModule, imports: [CommonModule, AlainThemeModule, DownFileDirective], exports: [DownFileDirective] });
124
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: DownFileModule, imports: [CommonModule, AlainThemeModule] });
122
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: DownFileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
123
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: DownFileModule, imports: [CommonModule, AlainThemeModule, DownFileDirective], exports: [DownFileDirective] });
124
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: DownFileModule, imports: [CommonModule, AlainThemeModule] });
125
125
  }
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: DownFileModule, decorators: [{
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: DownFileModule, decorators: [{
127
127
  type: NgModule,
128
128
  args: [{
129
129
  imports: [CommonModule, AlainThemeModule, ...DIRECTIVES],
@@ -1,7 +1,7 @@
1
1
  import { CdkObserveContent, ObserversModule } from '@angular/cdk/observers';
2
2
  import { DOCUMENT, NgTemplateOutlet, CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, ElementRef, NgZone, ChangeDetectorRef, booleanAttribute, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, Input, NgModule } from '@angular/core';
4
+ import { inject, ElementRef, NgZone, ChangeDetectorRef, booleanAttribute, numberAttribute, Input, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
5
5
  import { DomSanitizer } from '@angular/platform-browser';
6
6
  import { take } from 'rxjs';
7
7
  import { NzTooltipDirective, NzToolTipModule } from 'ng-zorro-antd/tooltip';
@@ -191,12 +191,12 @@ class EllipsisComponent {
191
191
  this.refresh();
192
192
  }
193
193
  }
194
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: EllipsisComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
195
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.1", type: EllipsisComponent, isStandalone: true, selector: "ellipsis", inputs: { tooltip: ["tooltip", "tooltip", booleanAttribute], length: ["length", "length", (v) => (v == null ? null : numberAttribute(v))], lines: ["lines", "lines", (v) => (v == null ? null : numberAttribute(v))], fullWidthRecognition: ["fullWidthRecognition", "fullWidthRecognition", booleanAttribute], tail: "tail" }, viewQueries: [{ propertyName: "orgEl", first: true, predicate: ["orgEl"], descendants: true }, { propertyName: "shadowOrgEl", first: true, predicate: ["shadowOrgEl"], descendants: true }, { propertyName: "shadowTextEl", first: true, predicate: ["shadowTextEl"], descendants: true }], exportAs: ["ellipsis"], usesOnChanges: true, ngImport: i0, template: "<div (cdkObserveContent)=\"refresh()\" #orgEl style=\"display: none\"><ng-content /></div>\n<ng-template #tooltipTpl let-con>\n @if (tooltip) {\n <span\n nz-tooltip\n [nzTooltipTitle]=\"titleTpl\"\n [nzTooltipOverlayStyle]=\"{ 'overflow-wrap': 'break-word', 'word-wrap': 'break-word' }\"\n >\n <ng-container *ngTemplateOutlet=\"con\" />\n <ng-template #titleTpl><div [innerHTML]=\"orgHtml\"></div></ng-template>\n </span>\n } @else {\n <ng-container *ngTemplateOutlet=\"con\" />\n }\n</ng-template>\n@switch (type) {\n @case ('default') {\n <span [class]=\"cls\"></span>\n }\n @case ('length') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lengthTpl }\" />\n <ng-template #lengthTpl>{{ text }}</ng-template>\n }\n @case ('line-clamp') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineClampTpl }\" />\n <ng-template #lineClampTpl>\n <div [class]=\"cls\" [style]=\"{ '-webkit-line-clamp': lines, '-webkit-box-orient': 'vertical' }\"></div>\n </ng-template>\n }\n @case ('line') {\n <div [class]=\"cls\">\n <div class=\"ellipsis__handle\">\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineTpl }\" />\n <ng-template #lineTpl>{{ linsWord }}</ng-template>\n <div class=\"ellipsis__shadow\" #shadowOrgEl [innerHTML]=\"orgHtml\"></div>\n <div class=\"ellipsis__shadow\" #shadowTextEl>\n <span>{{ text }}</span>\n </div>\n </div>\n </div>\n }\n}\n", dependencies: [{ kind: "directive", type: CdkObserveContent, selector: "[cdkObserveContent]", inputs: ["cdkObserveContentDisabled", "debounce"], outputs: ["cdkObserveContent"], exportAs: ["cdkObserveContent"] }, { kind: "directive", type: NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
194
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: EllipsisComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
195
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: EllipsisComponent, isStandalone: true, selector: "ellipsis", inputs: { tooltip: ["tooltip", "tooltip", booleanAttribute], length: ["length", "length", (v) => (v == null ? null : numberAttribute(v))], lines: ["lines", "lines", (v) => (v == null ? null : numberAttribute(v))], fullWidthRecognition: ["fullWidthRecognition", "fullWidthRecognition", booleanAttribute], tail: "tail" }, viewQueries: [{ propertyName: "orgEl", first: true, predicate: ["orgEl"], descendants: true }, { propertyName: "shadowOrgEl", first: true, predicate: ["shadowOrgEl"], descendants: true }, { propertyName: "shadowTextEl", first: true, predicate: ["shadowTextEl"], descendants: true }], exportAs: ["ellipsis"], usesOnChanges: true, ngImport: i0, template: "<div (cdkObserveContent)=\"refresh()\" #orgEl style=\"display: none\"><ng-content /></div>\n<ng-template #tooltipTpl let-con>\n @if (tooltip) {\n <span\n nz-tooltip\n [nzTooltipTitle]=\"titleTpl\"\n [nzTooltipOverlayStyle]=\"{ 'overflow-wrap': 'break-word', 'word-wrap': 'break-word' }\"\n >\n <ng-container *ngTemplateOutlet=\"con\" />\n <ng-template #titleTpl><div [innerHTML]=\"orgHtml\"></div></ng-template>\n </span>\n } @else {\n <ng-container *ngTemplateOutlet=\"con\" />\n }\n</ng-template>\n@switch (type) {\n @case ('default') {\n <span [class]=\"cls\"></span>\n }\n @case ('length') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lengthTpl }\" />\n <ng-template #lengthTpl>{{ text }}</ng-template>\n }\n @case ('line-clamp') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineClampTpl }\" />\n <ng-template #lineClampTpl>\n <div [class]=\"cls\" [style]=\"{ '-webkit-line-clamp': lines, '-webkit-box-orient': 'vertical' }\"></div>\n </ng-template>\n }\n @case ('line') {\n <div [class]=\"cls\">\n <div class=\"ellipsis__handle\">\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineTpl }\" />\n <ng-template #lineTpl>{{ linsWord }}</ng-template>\n <div class=\"ellipsis__shadow\" #shadowOrgEl [innerHTML]=\"orgHtml\"></div>\n <div class=\"ellipsis__shadow\" #shadowTextEl>\n <span>{{ text }}</span>\n </div>\n </div>\n </div>\n }\n}\n", dependencies: [{ kind: "directive", type: CdkObserveContent, selector: "[cdkObserveContent]", inputs: ["cdkObserveContentDisabled", "debounce"], outputs: ["cdkObserveContent"], exportAs: ["cdkObserveContent"] }, { kind: "directive", type: NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
196
196
  }
197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: EllipsisComponent, decorators: [{
197
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: EllipsisComponent, decorators: [{
198
198
  type: Component,
199
- args: [{ selector: 'ellipsis', exportAs: 'ellipsis', preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CdkObserveContent, NzTooltipDirective, NgTemplateOutlet], template: "<div (cdkObserveContent)=\"refresh()\" #orgEl style=\"display: none\"><ng-content /></div>\n<ng-template #tooltipTpl let-con>\n @if (tooltip) {\n <span\n nz-tooltip\n [nzTooltipTitle]=\"titleTpl\"\n [nzTooltipOverlayStyle]=\"{ 'overflow-wrap': 'break-word', 'word-wrap': 'break-word' }\"\n >\n <ng-container *ngTemplateOutlet=\"con\" />\n <ng-template #titleTpl><div [innerHTML]=\"orgHtml\"></div></ng-template>\n </span>\n } @else {\n <ng-container *ngTemplateOutlet=\"con\" />\n }\n</ng-template>\n@switch (type) {\n @case ('default') {\n <span [class]=\"cls\"></span>\n }\n @case ('length') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lengthTpl }\" />\n <ng-template #lengthTpl>{{ text }}</ng-template>\n }\n @case ('line-clamp') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineClampTpl }\" />\n <ng-template #lineClampTpl>\n <div [class]=\"cls\" [style]=\"{ '-webkit-line-clamp': lines, '-webkit-box-orient': 'vertical' }\"></div>\n </ng-template>\n }\n @case ('line') {\n <div [class]=\"cls\">\n <div class=\"ellipsis__handle\">\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineTpl }\" />\n <ng-template #lineTpl>{{ linsWord }}</ng-template>\n <div class=\"ellipsis__shadow\" #shadowOrgEl [innerHTML]=\"orgHtml\"></div>\n <div class=\"ellipsis__shadow\" #shadowTextEl>\n <span>{{ text }}</span>\n </div>\n </div>\n </div>\n }\n}\n" }]
199
+ args: [{ selector: 'ellipsis', exportAs: 'ellipsis', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CdkObserveContent, NzTooltipDirective, NgTemplateOutlet], template: "<div (cdkObserveContent)=\"refresh()\" #orgEl style=\"display: none\"><ng-content /></div>\n<ng-template #tooltipTpl let-con>\n @if (tooltip) {\n <span\n nz-tooltip\n [nzTooltipTitle]=\"titleTpl\"\n [nzTooltipOverlayStyle]=\"{ 'overflow-wrap': 'break-word', 'word-wrap': 'break-word' }\"\n >\n <ng-container *ngTemplateOutlet=\"con\" />\n <ng-template #titleTpl><div [innerHTML]=\"orgHtml\"></div></ng-template>\n </span>\n } @else {\n <ng-container *ngTemplateOutlet=\"con\" />\n }\n</ng-template>\n@switch (type) {\n @case ('default') {\n <span [class]=\"cls\"></span>\n }\n @case ('length') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lengthTpl }\" />\n <ng-template #lengthTpl>{{ text }}</ng-template>\n }\n @case ('line-clamp') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineClampTpl }\" />\n <ng-template #lineClampTpl>\n <div [class]=\"cls\" [style]=\"{ '-webkit-line-clamp': lines, '-webkit-box-orient': 'vertical' }\"></div>\n </ng-template>\n }\n @case ('line') {\n <div [class]=\"cls\">\n <div class=\"ellipsis__handle\">\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineTpl }\" />\n <ng-template #lineTpl>{{ linsWord }}</ng-template>\n <div class=\"ellipsis__shadow\" #shadowOrgEl [innerHTML]=\"orgHtml\"></div>\n <div class=\"ellipsis__shadow\" #shadowTextEl>\n <span>{{ text }}</span>\n </div>\n </div>\n </div>\n }\n}\n" }]
200
200
  }], propDecorators: { orgEl: [{
201
201
  type: ViewChild,
202
202
  args: ['orgEl', { static: false }]
@@ -224,11 +224,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImpor
224
224
 
225
225
  const COMPONENTS = [EllipsisComponent];
226
226
  class EllipsisModule {
227
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: EllipsisModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
228
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: EllipsisModule, imports: [CommonModule, ObserversModule, NzToolTipModule, EllipsisComponent], exports: [EllipsisComponent] });
229
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: EllipsisModule, imports: [CommonModule, ObserversModule, NzToolTipModule] });
227
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: EllipsisModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
228
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: EllipsisModule, imports: [CommonModule, ObserversModule, NzToolTipModule, EllipsisComponent], exports: [EllipsisComponent] });
229
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: EllipsisModule, imports: [CommonModule, ObserversModule, NzToolTipModule] });
230
230
  }
231
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: EllipsisModule, decorators: [{
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: EllipsisModule, decorators: [{
232
232
  type: NgModule,
233
233
  args: [{
234
234
  imports: [CommonModule, ObserversModule, NzToolTipModule, ...COMPONENTS],
@@ -1 +1 @@
1
- {"version":3,"file":"ellipsis.mjs","sources":["../../../../packages/abc/ellipsis/ellipsis.component.ts","../../../../packages/abc/ellipsis/ellipsis.component.html","../../../../packages/abc/ellipsis/ellipsis.module.ts","../../../../packages/abc/ellipsis/ellipsis.ts"],"sourcesContent":["import { CdkObserveContent } from '@angular/cdk/observers';\nimport { DOCUMENT, NgTemplateOutlet } from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n NgZone,\n OnChanges,\n ViewChild,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n numberAttribute\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { take } from 'rxjs';\n\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { NzTooltipDirective } from 'ng-zorro-antd/tooltip';\n\n@Component({\n selector: 'ellipsis',\n exportAs: 'ellipsis',\n templateUrl: './ellipsis.component.html',\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CdkObserveContent, NzTooltipDirective, NgTemplateOutlet]\n})\nexport class EllipsisComponent implements AfterViewInit, OnChanges {\n private readonly el: HTMLElement = inject(ElementRef).nativeElement;\n private readonly ngZone = inject(NgZone);\n private readonly dom = inject(DomSanitizer);\n private readonly doc = inject(DOCUMENT);\n private readonly cdr = inject(ChangeDetectorRef);\n private isSupportLineClamp = this.doc.body.style['webkitLineClamp'] !== undefined;\n @ViewChild('orgEl', { static: false }) private orgEl!: ElementRef;\n @ViewChild('shadowOrgEl', { static: false }) private shadowOrgEl!: ElementRef;\n @ViewChild('shadowTextEl', { static: false }) private shadowTextEl!: ElementRef;\n private inited = false;\n orgHtml!: SafeHtml;\n type = 'default';\n cls = {};\n text = '';\n targetCount = 0;\n\n @Input({ transform: booleanAttribute }) tooltip = false;\n @Input({ transform: (v: unknown) => (v == null ? null : numberAttribute(v)) }) length?: number;\n @Input({ transform: (v: unknown) => (v == null ? null : numberAttribute(v)) }) lines?: number;\n @Input({ transform: booleanAttribute }) fullWidthRecognition = false;\n @Input() tail = '...';\n\n get linsWord(): string {\n const { targetCount, text, tail } = this;\n return (\n (targetCount > 0 ? text.substring(0, targetCount) : '') +\n (targetCount > 0 && targetCount < text.length ? tail : '')\n );\n }\n\n private get win(): NzSafeAny {\n return this.doc.defaultView || window;\n }\n\n private getStrFullLength(str: string): number {\n return str.split('').reduce((pre, cur) => {\n const charCode = cur.charCodeAt(0);\n if (charCode >= 0 && charCode <= 128) {\n return pre + 1;\n }\n return pre + 2;\n }, 0);\n }\n\n private cutStrByFullLength(str: string, maxLength: number): string {\n let showLength = 0;\n return str.split('').reduce((pre, cur) => {\n const charCode = cur.charCodeAt(0);\n if (charCode >= 0 && charCode <= 128) {\n showLength += 1;\n } else {\n showLength += 2;\n }\n if (showLength <= maxLength) {\n return pre + cur;\n }\n return pre;\n }, '');\n }\n\n private bisection(\n targetHeight: number,\n mid: number,\n begin: number,\n end: number,\n text: string,\n node: HTMLElement\n ): number {\n const suffix = this.tail;\n node.innerHTML = text.substring(0, mid) + suffix;\n let sh = node.offsetHeight;\n\n if (sh <= targetHeight) {\n node.innerHTML = text.substring(0, mid + 1) + suffix;\n sh = node.offsetHeight;\n if (sh > targetHeight || mid === begin) {\n return mid;\n }\n begin = mid;\n mid = end - begin === 1 ? begin + 1 : Math.floor((end - begin) / 2) + begin;\n return this.bisection(targetHeight, mid, begin, end, text, node);\n }\n if (mid - 1 < 0) {\n return mid;\n }\n node.innerHTML = text.substring(0, mid - 1) + suffix;\n sh = node.offsetHeight;\n if (sh <= targetHeight) {\n return mid - 1;\n }\n end = mid;\n mid = Math.floor((end - begin) / 2) + begin;\n return this.bisection(targetHeight, mid, begin, end, text, node);\n }\n\n private genType(): void {\n const { lines, length, isSupportLineClamp } = this;\n this.cls = {\n ellipsis: true,\n ellipsis__lines: lines && !isSupportLineClamp,\n 'ellipsis__line-clamp': lines && isSupportLineClamp\n };\n if (!lines && !length) {\n this.type = 'default';\n } else if (!lines) {\n this.type = 'length';\n } else if (isSupportLineClamp) {\n this.type = 'line-clamp';\n } else {\n this.type = 'line';\n }\n }\n\n private gen(): void {\n const { type, lines, length, fullWidthRecognition, tail, orgEl, cdr, ngZone } = this;\n if (type === 'length') {\n const el = orgEl.nativeElement as HTMLElement;\n if (el.children.length > 0) {\n throw new Error('Ellipsis content must be string.');\n }\n const lengthText = el.textContent!;\n const textLength = fullWidthRecognition ? this.getStrFullLength(lengthText) : lengthText.length;\n if (textLength <= length! || length! < 0) {\n this.text = lengthText;\n } else {\n let displayText: string;\n if (length! - tail.length <= 0) {\n displayText = '';\n } else {\n displayText = fullWidthRecognition\n ? this.cutStrByFullLength(lengthText, length!)\n : lengthText.slice(0, length);\n }\n this.text = displayText + tail;\n }\n ngZone.run(() => cdr.detectChanges());\n } else if (type === 'line') {\n const { shadowOrgEl, shadowTextEl } = this;\n const orgNode = shadowOrgEl.nativeElement as HTMLElement;\n const lineText = orgNode.innerText || orgNode.textContent!;\n const lineHeight = parseInt(this.win.getComputedStyle(this.getEl('.ellipsis')).lineHeight!, 10);\n const targetHeight = lines! * lineHeight;\n const handleEl = this.getEl('.ellipsis__handle');\n handleEl!.style.height = `${targetHeight}px`;\n\n if (orgNode.offsetHeight <= targetHeight) {\n this.text = lineText;\n this.targetCount = lineText.length;\n } else {\n // bisection\n const len = lineText.length;\n const mid = Math.ceil(len / 2);\n\n const count = this.bisection(targetHeight, mid, 0, len, lineText, shadowTextEl.nativeElement.firstChild);\n this.text = lineText;\n this.targetCount = count;\n }\n ngZone.run(() => cdr.detectChanges());\n }\n }\n\n private getEl(cls: string): HTMLElement | null {\n return this.el.querySelector<HTMLElement>(cls);\n }\n\n private executeOnStable(fn: () => void): void {\n if (this.ngZone.isStable) {\n fn();\n } else {\n this.ngZone.onStable.asObservable().pipe(take(1)).subscribe(fn);\n }\n }\n\n refresh(): void {\n this.genType();\n const { type, dom, orgEl, cdr } = this;\n const html = orgEl.nativeElement.innerHTML;\n this.orgHtml = dom.bypassSecurityTrustHtml(html);\n cdr.detectChanges();\n this.executeOnStable(() => {\n this.gen();\n if (type !== 'line') {\n const el = this.getEl('.ellipsis');\n if (el) {\n el.innerHTML = html;\n }\n }\n });\n }\n\n ngAfterViewInit(): void {\n this.inited = true;\n this.refresh();\n }\n\n ngOnChanges(): void {\n if (this.inited) {\n this.refresh();\n }\n }\n}\n","<div (cdkObserveContent)=\"refresh()\" #orgEl style=\"display: none\"><ng-content /></div>\n<ng-template #tooltipTpl let-con>\n @if (tooltip) {\n <span\n nz-tooltip\n [nzTooltipTitle]=\"titleTpl\"\n [nzTooltipOverlayStyle]=\"{ 'overflow-wrap': 'break-word', 'word-wrap': 'break-word' }\"\n >\n <ng-container *ngTemplateOutlet=\"con\" />\n <ng-template #titleTpl><div [innerHTML]=\"orgHtml\"></div></ng-template>\n </span>\n } @else {\n <ng-container *ngTemplateOutlet=\"con\" />\n }\n</ng-template>\n@switch (type) {\n @case ('default') {\n <span [class]=\"cls\"></span>\n }\n @case ('length') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lengthTpl }\" />\n <ng-template #lengthTpl>{{ text }}</ng-template>\n }\n @case ('line-clamp') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineClampTpl }\" />\n <ng-template #lineClampTpl>\n <div [class]=\"cls\" [style]=\"{ '-webkit-line-clamp': lines, '-webkit-box-orient': 'vertical' }\"></div>\n </ng-template>\n }\n @case ('line') {\n <div [class]=\"cls\">\n <div class=\"ellipsis__handle\">\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineTpl }\" />\n <ng-template #lineTpl>{{ linsWord }}</ng-template>\n <div class=\"ellipsis__shadow\" #shadowOrgEl [innerHTML]=\"orgHtml\"></div>\n <div class=\"ellipsis__shadow\" #shadowTextEl>\n <span>{{ text }}</span>\n </div>\n </div>\n </div>\n }\n}\n","import { ObserversModule } from '@angular/cdk/observers';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzToolTipModule } from 'ng-zorro-antd/tooltip';\n\nimport { EllipsisComponent } from './ellipsis.component';\n\nconst COMPONENTS = [EllipsisComponent];\n\n@NgModule({\n imports: [CommonModule, ObserversModule, NzToolTipModule, ...COMPONENTS],\n exports: COMPONENTS\n})\nexport class EllipsisModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAgCa,iBAAiB,CAAA;AACX,IAAA,EAAE,GAAgB,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa;AAClD,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC;AAC1B,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;AACtB,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACxC,IAAA,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,SAAS;AAClC,IAAA,KAAK;AACC,IAAA,WAAW;AACV,IAAA,YAAY;IAC1D,MAAM,GAAG,KAAK;AACtB,IAAA,OAAO;IACP,IAAI,GAAG,SAAS;IAChB,GAAG,GAAG,EAAE;IACR,IAAI,GAAG,EAAE;IACT,WAAW,GAAG,CAAC;IAEyB,OAAO,GAAG,KAAK;AACwB,IAAA,MAAM;AACN,IAAA,KAAK;IAC5C,oBAAoB,GAAG,KAAK;IAC3D,IAAI,GAAG,KAAK;AAErB,IAAA,IAAI,QAAQ,GAAA;QACV,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI;QACxC,QACE,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,EAAE;AACtD,aAAC,WAAW,GAAG,CAAC,IAAI,WAAW,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A,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC;AACxE,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"ellipsis.mjs","sources":["../../../../packages/abc/ellipsis/ellipsis.component.ts","../../../../packages/abc/ellipsis/ellipsis.component.html","../../../../packages/abc/ellipsis/ellipsis.module.ts","../../../../packages/abc/ellipsis/ellipsis.ts"],"sourcesContent":["import { CdkObserveContent } from '@angular/cdk/observers';\nimport { DOCUMENT, NgTemplateOutlet } from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n NgZone,\n OnChanges,\n ViewChild,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n numberAttribute\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { take } from 'rxjs';\n\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { NzTooltipDirective } from 'ng-zorro-antd/tooltip';\n\n@Component({\n selector: 'ellipsis',\n exportAs: 'ellipsis',\n templateUrl: './ellipsis.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CdkObserveContent, NzTooltipDirective, NgTemplateOutlet]\n})\nexport class EllipsisComponent implements AfterViewInit, OnChanges {\n private readonly el: HTMLElement = inject(ElementRef).nativeElement;\n private readonly ngZone = inject(NgZone);\n private readonly dom = inject(DomSanitizer);\n private readonly doc = inject(DOCUMENT);\n private readonly cdr = inject(ChangeDetectorRef);\n private isSupportLineClamp = this.doc.body.style['webkitLineClamp'] !== undefined;\n @ViewChild('orgEl', { static: false }) private orgEl!: ElementRef;\n @ViewChild('shadowOrgEl', { static: false }) private shadowOrgEl!: ElementRef;\n @ViewChild('shadowTextEl', { static: false }) private shadowTextEl!: ElementRef;\n private inited = false;\n orgHtml!: SafeHtml;\n type = 'default';\n cls = {};\n text = '';\n targetCount = 0;\n\n @Input({ transform: booleanAttribute }) tooltip = false;\n @Input({ transform: (v: unknown) => (v == null ? null : numberAttribute(v)) }) length?: number;\n @Input({ transform: (v: unknown) => (v == null ? null : numberAttribute(v)) }) lines?: number;\n @Input({ transform: booleanAttribute }) fullWidthRecognition = false;\n @Input() tail = '...';\n\n get linsWord(): string {\n const { targetCount, text, tail } = this;\n return (\n (targetCount > 0 ? text.substring(0, targetCount) : '') +\n (targetCount > 0 && targetCount < text.length ? tail : '')\n );\n }\n\n private get win(): NzSafeAny {\n return this.doc.defaultView || window;\n }\n\n private getStrFullLength(str: string): number {\n return str.split('').reduce((pre, cur) => {\n const charCode = cur.charCodeAt(0);\n if (charCode >= 0 && charCode <= 128) {\n return pre + 1;\n }\n return pre + 2;\n }, 0);\n }\n\n private cutStrByFullLength(str: string, maxLength: number): string {\n let showLength = 0;\n return str.split('').reduce((pre, cur) => {\n const charCode = cur.charCodeAt(0);\n if (charCode >= 0 && charCode <= 128) {\n showLength += 1;\n } else {\n showLength += 2;\n }\n if (showLength <= maxLength) {\n return pre + cur;\n }\n return pre;\n }, '');\n }\n\n private bisection(\n targetHeight: number,\n mid: number,\n begin: number,\n end: number,\n text: string,\n node: HTMLElement\n ): number {\n const suffix = this.tail;\n node.innerHTML = text.substring(0, mid) + suffix;\n let sh = node.offsetHeight;\n\n if (sh <= targetHeight) {\n node.innerHTML = text.substring(0, mid + 1) + suffix;\n sh = node.offsetHeight;\n if (sh > targetHeight || mid === begin) {\n return mid;\n }\n begin = mid;\n mid = end - begin === 1 ? begin + 1 : Math.floor((end - begin) / 2) + begin;\n return this.bisection(targetHeight, mid, begin, end, text, node);\n }\n if (mid - 1 < 0) {\n return mid;\n }\n node.innerHTML = text.substring(0, mid - 1) + suffix;\n sh = node.offsetHeight;\n if (sh <= targetHeight) {\n return mid - 1;\n }\n end = mid;\n mid = Math.floor((end - begin) / 2) + begin;\n return this.bisection(targetHeight, mid, begin, end, text, node);\n }\n\n private genType(): void {\n const { lines, length, isSupportLineClamp } = this;\n this.cls = {\n ellipsis: true,\n ellipsis__lines: lines && !isSupportLineClamp,\n 'ellipsis__line-clamp': lines && isSupportLineClamp\n };\n if (!lines && !length) {\n this.type = 'default';\n } else if (!lines) {\n this.type = 'length';\n } else if (isSupportLineClamp) {\n this.type = 'line-clamp';\n } else {\n this.type = 'line';\n }\n }\n\n private gen(): void {\n const { type, lines, length, fullWidthRecognition, tail, orgEl, cdr, ngZone } = this;\n if (type === 'length') {\n const el = orgEl.nativeElement as HTMLElement;\n if (el.children.length > 0) {\n throw new Error('Ellipsis content must be string.');\n }\n const lengthText = el.textContent!;\n const textLength = fullWidthRecognition ? this.getStrFullLength(lengthText) : lengthText.length;\n if (textLength <= length! || length! < 0) {\n this.text = lengthText;\n } else {\n let displayText: string;\n if (length! - tail.length <= 0) {\n displayText = '';\n } else {\n displayText = fullWidthRecognition\n ? this.cutStrByFullLength(lengthText, length!)\n : lengthText.slice(0, length);\n }\n this.text = displayText + tail;\n }\n ngZone.run(() => cdr.detectChanges());\n } else if (type === 'line') {\n const { shadowOrgEl, shadowTextEl } = this;\n const orgNode = shadowOrgEl.nativeElement as HTMLElement;\n const lineText = orgNode.innerText || orgNode.textContent!;\n const lineHeight = parseInt(this.win.getComputedStyle(this.getEl('.ellipsis')).lineHeight!, 10);\n const targetHeight = lines! * lineHeight;\n const handleEl = this.getEl('.ellipsis__handle');\n handleEl!.style.height = `${targetHeight}px`;\n\n if (orgNode.offsetHeight <= targetHeight) {\n this.text = lineText;\n this.targetCount = lineText.length;\n } else {\n // bisection\n const len = lineText.length;\n const mid = Math.ceil(len / 2);\n\n const count = this.bisection(targetHeight, mid, 0, len, lineText, shadowTextEl.nativeElement.firstChild);\n this.text = lineText;\n this.targetCount = count;\n }\n ngZone.run(() => cdr.detectChanges());\n }\n }\n\n private getEl(cls: string): HTMLElement | null {\n return this.el.querySelector<HTMLElement>(cls);\n }\n\n private executeOnStable(fn: () => void): void {\n if (this.ngZone.isStable) {\n fn();\n } else {\n this.ngZone.onStable.asObservable().pipe(take(1)).subscribe(fn);\n }\n }\n\n refresh(): void {\n this.genType();\n const { type, dom, orgEl, cdr } = this;\n const html = orgEl.nativeElement.innerHTML;\n this.orgHtml = dom.bypassSecurityTrustHtml(html);\n cdr.detectChanges();\n this.executeOnStable(() => {\n this.gen();\n if (type !== 'line') {\n const el = this.getEl('.ellipsis');\n if (el) {\n el.innerHTML = html;\n }\n }\n });\n }\n\n ngAfterViewInit(): void {\n this.inited = true;\n this.refresh();\n }\n\n ngOnChanges(): void {\n if (this.inited) {\n this.refresh();\n }\n }\n}\n","<div (cdkObserveContent)=\"refresh()\" #orgEl style=\"display: none\"><ng-content /></div>\n<ng-template #tooltipTpl let-con>\n @if (tooltip) {\n <span\n nz-tooltip\n [nzTooltipTitle]=\"titleTpl\"\n [nzTooltipOverlayStyle]=\"{ 'overflow-wrap': 'break-word', 'word-wrap': 'break-word' }\"\n >\n <ng-container *ngTemplateOutlet=\"con\" />\n <ng-template #titleTpl><div [innerHTML]=\"orgHtml\"></div></ng-template>\n </span>\n } @else {\n <ng-container *ngTemplateOutlet=\"con\" />\n }\n</ng-template>\n@switch (type) {\n @case ('default') {\n <span [class]=\"cls\"></span>\n }\n @case ('length') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lengthTpl }\" />\n <ng-template #lengthTpl>{{ text }}</ng-template>\n }\n @case ('line-clamp') {\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineClampTpl }\" />\n <ng-template #lineClampTpl>\n <div [class]=\"cls\" [style]=\"{ '-webkit-line-clamp': lines, '-webkit-box-orient': 'vertical' }\"></div>\n </ng-template>\n }\n @case ('line') {\n <div [class]=\"cls\">\n <div class=\"ellipsis__handle\">\n <ng-template [ngTemplateOutlet]=\"tooltipTpl\" [ngTemplateOutletContext]=\"{ $implicit: lineTpl }\" />\n <ng-template #lineTpl>{{ linsWord }}</ng-template>\n <div class=\"ellipsis__shadow\" #shadowOrgEl [innerHTML]=\"orgHtml\"></div>\n <div class=\"ellipsis__shadow\" #shadowTextEl>\n <span>{{ text }}</span>\n </div>\n </div>\n </div>\n }\n}\n","import { ObserversModule } from '@angular/cdk/observers';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzToolTipModule } from 'ng-zorro-antd/tooltip';\n\nimport { EllipsisComponent } from './ellipsis.component';\n\nconst COMPONENTS = [EllipsisComponent];\n\n@NgModule({\n imports: [CommonModule, ObserversModule, NzToolTipModule, ...COMPONENTS],\n exports: COMPONENTS\n})\nexport class EllipsisModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MA+Ba,iBAAiB,CAAA;AACX,IAAA,EAAE,GAAgB,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa;AAClD,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC;AAC1B,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;AACtB,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACxC,IAAA,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,SAAS;AAClC,IAAA,KAAK;AACC,IAAA,WAAW;AACV,IAAA,YAAY;IAC1D,MAAM,GAAG,KAAK;AACtB,IAAA,OAAO;IACP,IAAI,GAAG,SAAS;IAChB,GAAG,GAAG,EAAE;IACR,IAAI,GAAG,EAAE;IACT,WAAW,GAAG,CAAC;IAEyB,OAAO,GAAG,KAAK;AACwB,IAAA,MAAM;AACN,IAAA,KAAK;IAC5C,oBAAoB,GAAG,KAAK;IAC3D,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A,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,EAHf,OAAA,EAAA,CAAA,YAAY,EAAE,eAAe,EAAE,eAAe,CAAA,EAAA,CAAA;;2FAG7C,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC;AACxE,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACbD;;AAEG;;;;"}
@@ -2,25 +2,26 @@ import { Directionality } from '@angular/cdk/bidi';
2
2
  import { Platform } from '@angular/cdk/platform';
3
3
  import { DOCUMENT, CommonModule } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
5
- import { inject, ElementRef, DestroyRef, signal, input, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
6
- import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { inject, ElementRef, DestroyRef, signal, input, numberAttribute, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
6
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
7
  import { interval } from 'rxjs';
8
+ import { AlainConfigService } from '@delon/util/config';
8
9
  import { NzIconDirective, NzIconModule } from 'ng-zorro-antd/icon';
9
- import * as i1 from '@delon/util/config';
10
10
 
11
11
  class ErrorCollectComponent {
12
12
  el = inject(ElementRef).nativeElement;
13
13
  doc = inject(DOCUMENT);
14
14
  platform = inject(Platform);
15
15
  destroy$ = inject(DestroyRef);
16
+ cogSrv = inject(AlainConfigService);
16
17
  formEl = null;
17
18
  _hiden = signal(true);
18
19
  count = signal(0);
19
- dir = toSignal(inject(Directionality).change);
20
+ dir = inject(Directionality).valueSignal;
20
21
  freq = input(0, { transform: numberAttribute });
21
22
  offsetTop = input(0, { transform: numberAttribute });
22
- constructor(configSrv) {
23
- configSrv.attach(this, 'errorCollect', { freq: 250, offsetTop: 65 + 64 + 8 * 2 });
23
+ constructor() {
24
+ this.cogSrv.attach(this, 'errorCollect', { freq: 250, offsetTop: 65 + 64 + 8 * 2 });
24
25
  }
25
26
  get errEls() {
26
27
  return this.formEl.querySelectorAll('.ant-form-item-has-error');
@@ -65,13 +66,13 @@ class ErrorCollectComponent {
65
66
  .subscribe(() => this.update());
66
67
  this.update();
67
68
  }
68
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ErrorCollectComponent, deps: [{ token: i1.AlainConfigService }], target: i0.ɵɵFactoryTarget.Component });
69
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.1", type: ErrorCollectComponent, isStandalone: true, selector: "error-collect, [error-collect]", inputs: { freq: { classPropertyName: "freq", publicName: "freq", isSignal: true, isRequired: false, transformFunction: null }, offsetTop: { classPropertyName: "offsetTop", publicName: "offsetTop", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "_click()" }, properties: { "class.error-collect": "true", "class.error-collect-rtl": "dir() === 'rtl'", "class.d-none": "_hiden()" } }, exportAs: ["errorCollect"], ngImport: i0, template: `
69
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ErrorCollectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.4", type: ErrorCollectComponent, isStandalone: true, selector: "error-collect, [error-collect]", inputs: { freq: { classPropertyName: "freq", publicName: "freq", isSignal: true, isRequired: false, transformFunction: null }, offsetTop: { classPropertyName: "offsetTop", publicName: "offsetTop", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "_click()" }, properties: { "class.error-collect": "true", "class.error-collect-rtl": "dir() === 'rtl'", "class.d-none": "_hiden()" } }, exportAs: ["errorCollect"], ngImport: i0, template: `
70
71
  <nz-icon nzType="exclamation-circle" />
71
72
  <span class="error-collect__count">{{ count() }}</span>
72
73
  `, isInline: true, dependencies: [{ 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 });
73
74
  }
74
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ErrorCollectComponent, decorators: [{
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ErrorCollectComponent, decorators: [{
75
76
  type: Component,
76
77
  args: [{
77
78
  selector: 'error-collect, [error-collect]',
@@ -86,20 +87,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImpor
86
87
  '[class.d-none]': '_hiden()',
87
88
  '(click)': '_click()'
88
89
  },
89
- preserveWhitespaces: false,
90
90
  changeDetection: ChangeDetectionStrategy.OnPush,
91
91
  encapsulation: ViewEncapsulation.None,
92
92
  imports: [NzIconDirective]
93
93
  }]
94
- }], ctorParameters: () => [{ type: i1.AlainConfigService }] });
94
+ }], ctorParameters: () => [] });
95
95
 
96
96
  const COMPONENTS = [ErrorCollectComponent];
97
97
  class ErrorCollectModule {
98
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ErrorCollectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
99
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: ErrorCollectModule, imports: [CommonModule, NzIconModule, ErrorCollectComponent], exports: [ErrorCollectComponent] });
100
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ErrorCollectModule, imports: [CommonModule, NzIconModule] });
98
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ErrorCollectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
99
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: ErrorCollectModule, imports: [CommonModule, NzIconModule, ErrorCollectComponent], exports: [ErrorCollectComponent] });
100
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ErrorCollectModule, imports: [CommonModule, NzIconModule] });
101
101
  }
102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ErrorCollectModule, decorators: [{
102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ErrorCollectModule, decorators: [{
103
103
  type: NgModule,
104
104
  args: [{
105
105
  imports: [CommonModule, NzIconModule, ...COMPONENTS],
@@ -1 +1 @@
1
- {"version":3,"file":"error-collect.mjs","sources":["../../../../packages/abc/error-collect/error-collect.component.ts","../../../../packages/abc/error-collect/error-collect.module.ts","../../../../packages/abc/error-collect/error-collect.ts"],"sourcesContent":["import { Directionality } from '@angular/cdk/bidi';\nimport { Platform } from '@angular/cdk/platform';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n OnInit,\n ViewEncapsulation,\n inject,\n input,\n numberAttribute,\n signal\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { interval } from 'rxjs';\n\nimport { AlainConfigService } from '@delon/util/config';\nimport { NzIconDirective } from 'ng-zorro-antd/icon';\n\n@Component({\n selector: 'error-collect, [error-collect]',\n exportAs: 'errorCollect',\n template: `\n <nz-icon nzType=\"exclamation-circle\" />\n <span class=\"error-collect__count\">{{ count() }}</span>\n `,\n host: {\n '[class.error-collect]': 'true',\n '[class.error-collect-rtl]': `dir() === 'rtl'`,\n '[class.d-none]': '_hiden()',\n '(click)': '_click()'\n },\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NzIconDirective]\n})\nexport class ErrorCollectComponent implements OnInit {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly doc = inject(DOCUMENT);\n private readonly platform = inject(Platform);\n private readonly destroy$ = inject(DestroyRef);\n private formEl: HTMLFormElement | null = null;\n\n _hiden = signal(true);\n count = signal(0);\n dir = toSignal(inject(Directionality).change);\n\n readonly freq = input(0, { transform: numberAttribute });\n readonly offsetTop = input(0, { transform: numberAttribute });\n\n constructor(configSrv: AlainConfigService) {\n configSrv.attach(this, 'errorCollect', { freq: 250, offsetTop: 65 + 64 + 8 * 2 });\n }\n\n private get errEls(): NodeListOf<HTMLElement> {\n return this.formEl!.querySelectorAll('.ant-form-item-has-error');\n }\n\n private update(): void {\n const count = this.errEls.length;\n if (count === this.count()) return;\n this.count.set(count);\n this._hiden.set(count === 0);\n }\n\n _click(): boolean {\n if (this.count() === 0) return false;\n // nz-form-control\n const els = this.errEls;\n const formItemEl = this.findParent(els[0], '[nz-form-control]') || els[0];\n formItemEl.scrollIntoView(true);\n // fix header height\n this.doc.documentElement.scrollTop -= this.offsetTop();\n return true;\n }\n\n private findParent(el: HTMLElement, selector: string): HTMLFormElement | null {\n let retEl: HTMLFormElement | null = null;\n while (el) {\n if (el.querySelector(selector)) {\n retEl = el as HTMLFormElement;\n break;\n }\n el = el.parentElement as HTMLFormElement;\n }\n return retEl;\n }\n\n ngOnInit(): void {\n if (!this.platform.isBrowser) return;\n\n this.formEl = this.findParent(this.el, 'form');\n if (this.formEl === null) throw new Error('No found form element');\n\n interval(this.freq())\n .pipe(takeUntilDestroyed(this.destroy$))\n .subscribe(() => this.update());\n\n this.update();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\nimport { ErrorCollectComponent } from './error-collect.component';\n\nconst COMPONENTS = [ErrorCollectComponent];\n\n@NgModule({\n imports: [CommonModule, NzIconModule, ...COMPONENTS],\n exports: COMPONENTS\n})\nexport class ErrorCollectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MAuCa,qBAAqB,CAAA;AACf,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC,aAAa;AAC9D,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;AACtB,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;IACtC,MAAM,GAA2B,IAAI;AAE7C,IAAA,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;AACrB,IAAA,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;IACjB,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC;IAEpC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;IAC/C,SAAS,GAAG,KAAK,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAE7D,IAAA,WAAA,CAAY,SAA6B,EAAA;QACvC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;;AAGnF,IAAA,IAAY,MAAM,GAAA;QAChB,OAAO,IAAI,CAAC,MAAO,CAAC,gBAAgB,CAAC,0BAA0B,CAAC;;IAG1D,MAAM,GAAA;AACZ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nB,YAAY,EAAE,YAAY,CAAA,EAAA,CAAA;;2FAGzB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC;AACpD,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACZD;;AAEG;;;;"}
1
+ {"version":3,"file":"error-collect.mjs","sources":["../../../../packages/abc/error-collect/error-collect.component.ts","../../../../packages/abc/error-collect/error-collect.module.ts","../../../../packages/abc/error-collect/error-collect.ts"],"sourcesContent":["import { Directionality } from '@angular/cdk/bidi';\nimport { Platform } from '@angular/cdk/platform';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n OnInit,\n ViewEncapsulation,\n inject,\n input,\n numberAttribute,\n signal\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { interval } from 'rxjs';\n\nimport { AlainConfigService } from '@delon/util/config';\nimport { NzIconDirective } from 'ng-zorro-antd/icon';\n\n@Component({\n selector: 'error-collect, [error-collect]',\n exportAs: 'errorCollect',\n template: `\n <nz-icon nzType=\"exclamation-circle\" />\n <span class=\"error-collect__count\">{{ count() }}</span>\n `,\n host: {\n '[class.error-collect]': 'true',\n '[class.error-collect-rtl]': `dir() === 'rtl'`,\n '[class.d-none]': '_hiden()',\n '(click)': '_click()'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NzIconDirective]\n})\nexport class ErrorCollectComponent implements OnInit {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly doc = inject(DOCUMENT);\n private readonly platform = inject(Platform);\n private readonly destroy$ = inject(DestroyRef);\n private readonly cogSrv = inject(AlainConfigService);\n private formEl: HTMLFormElement | null = null;\n\n _hiden = signal(true);\n count = signal(0);\n dir = inject(Directionality).valueSignal;\n\n readonly freq = input(0, { transform: numberAttribute });\n readonly offsetTop = input(0, { transform: numberAttribute });\n\n constructor() {\n this.cogSrv.attach(this, 'errorCollect', { freq: 250, offsetTop: 65 + 64 + 8 * 2 });\n }\n\n private get errEls(): NodeListOf<HTMLElement> {\n return this.formEl!.querySelectorAll('.ant-form-item-has-error');\n }\n\n private update(): void {\n const count = this.errEls.length;\n if (count === this.count()) return;\n this.count.set(count);\n this._hiden.set(count === 0);\n }\n\n _click(): boolean {\n if (this.count() === 0) return false;\n // nz-form-control\n const els = this.errEls;\n const formItemEl = this.findParent(els[0], '[nz-form-control]') || els[0];\n formItemEl.scrollIntoView(true);\n // fix header height\n this.doc.documentElement.scrollTop -= this.offsetTop();\n return true;\n }\n\n private findParent(el: HTMLElement, selector: string): HTMLFormElement | null {\n let retEl: HTMLFormElement | null = null;\n while (el) {\n if (el.querySelector(selector)) {\n retEl = el as HTMLFormElement;\n break;\n }\n el = el.parentElement as HTMLFormElement;\n }\n return retEl;\n }\n\n ngOnInit(): void {\n if (!this.platform.isBrowser) return;\n\n this.formEl = this.findParent(this.el, 'form');\n if (this.formEl === null) throw new Error('No found form element');\n\n interval(this.freq())\n .pipe(takeUntilDestroyed(this.destroy$))\n .subscribe(() => this.update());\n\n this.update();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\nimport { ErrorCollectComponent } from './error-collect.component';\n\nconst COMPONENTS = [ErrorCollectComponent];\n\n@NgModule({\n imports: [CommonModule, NzIconModule, ...COMPONENTS],\n exports: COMPONENTS\n})\nexport class ErrorCollectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MAsCa,qBAAqB,CAAA;AACf,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC,aAAa;AAC9D,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CA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AE;AACJ,wBAAA,uBAAuB,EAAE,MAAM;AAC/B,wBAAA,2BAA2B,EAAE,CAAiB,eAAA,CAAA;AAC9C,wBAAA,gBAAgB,EAAE,UAAU;AAC5B,wBAAA,SAAS,EAAE;AACZ,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,OAAO,EAAE,CAAC,eAAe;AAC1B,iBAAA;;;AC9BD,MAAM,UAAU,GAAG,CAAC,qBAAqB,CAAC;MAM7B,kBAAkB,CAAA;uGAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAHnB,YAAY,EAAE,YAAY,EAHlB,qBAAqB,aAArB,qBAAqB,CAAA,EAAA,CAAA;wGAM5B,kBAAkB,EAAA,OAAA,EAAA,CAHnB,YAAY,EAAE,YAAY,CAAA,EAAA,CAAA;;2FAGzB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC;AACpD,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACZD;;AAEG;;;;"}
@@ -1,60 +1,43 @@
1
1
  import { Directionality } from '@angular/cdk/bidi';
2
2
  import { CdkObserveContent, ObserversModule } from '@angular/cdk/observers';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, ChangeDetectorRef, DestroyRef, Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, Input, NgModule } from '@angular/core';
5
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
+ import { inject, viewChild, signal, input, computed, effect, afterNextRender, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
6
5
  import { DomSanitizer } from '@angular/platform-browser';
7
6
  import { RouterLink, RouterModule } from '@angular/router';
8
7
  import { DelonLocaleService, DelonLocaleModule } from '@delon/theme';
9
8
  import { isEmpty } from '@delon/util/browser';
9
+ import { AlainConfigService } from '@delon/util/config';
10
10
  import { NzButtonComponent, NzButtonModule } from 'ng-zorro-antd/button';
11
- import * as i1 from '@delon/util/config';
12
11
  import { CommonModule } from '@angular/common';
13
12
 
14
13
  class ExceptionComponent {
15
- static ngAcceptInputType_type;
16
- i18n = inject(DelonLocaleService);
17
14
  dom = inject(DomSanitizer);
18
- directionality = inject(Directionality);
19
- cdr = inject(ChangeDetectorRef);
20
- destroy$ = inject(DestroyRef);
21
- conTpl;
22
- _type;
23
- locale = {};
24
- hasCon = false;
25
- dir = 'ltr';
26
- _img = '';
27
- _title = '';
28
- _desc = '';
15
+ cogSrv = inject(AlainConfigService);
16
+ conTpl = viewChild.required('conTpl');
17
+ locale = inject(DelonLocaleService).valueSignal('exception');
18
+ dir = inject(Directionality).valueSignal;
19
+ hasCon = signal(false);
29
20
  typeDict;
30
- set type(value) {
31
- const item = this.typeDict[value];
32
- if (!item)
33
- return;
34
- this.fixImg(item.img);
35
- this._type = value;
36
- this._title = item.title;
37
- this._desc = '';
38
- }
39
- fixImg(src) {
40
- this._img = this.dom.bypassSecurityTrustStyle(`url('${src}')`);
41
- }
42
- set img(value) {
43
- this.fixImg(value);
44
- }
45
- set title(value) {
46
- this._title = this.dom.bypassSecurityTrustHtml(value);
47
- }
48
- set desc(value) {
49
- this._desc = this.dom.bypassSecurityTrustHtml(value);
50
- }
51
- backRouterLink = '/';
52
- checkContent() {
53
- this.hasCon = !isEmpty(this.conTpl.nativeElement);
54
- this.cdr.detectChanges();
55
- }
56
- constructor(configSrv) {
57
- configSrv.attach(this, 'exception', {
21
+ typeItem = signal(null);
22
+ type = input(404);
23
+ img = input();
24
+ title = input();
25
+ desc = input();
26
+ backRouterLink = input('/');
27
+ _img = computed(() => {
28
+ const v = this.typeItem()?.img ?? this.img();
29
+ return v == null ? null : this.dom.bypassSecurityTrustStyle(`url('${v}')`);
30
+ });
31
+ _title = computed(() => {
32
+ const v = this.typeItem()?.title ?? this.title();
33
+ return v == null ? null : this.dom.bypassSecurityTrustHtml(v);
34
+ });
35
+ _desc = computed(() => {
36
+ const v = this.typeItem()?.desc ?? this.desc() ?? this.locale()[this.type()];
37
+ return v == null ? null : this.dom.bypassSecurityTrustHtml(v);
38
+ });
39
+ constructor() {
40
+ this.cogSrv.attach(this, 'exception', {
58
41
  typeDict: {
59
42
  403: {
60
43
  img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg',
@@ -70,50 +53,83 @@ class ExceptionComponent {
70
53
  }
71
54
  }
72
55
  });
73
- }
74
- ngOnInit() {
75
- this.dir = this.directionality.value;
76
- this.directionality.change.pipe(takeUntilDestroyed(this.destroy$)).subscribe(direction => {
77
- this.dir = direction;
78
- this.cdr.detectChanges();
56
+ effect(() => {
57
+ const type = this.type();
58
+ this.typeItem.set(this.typeDict?.[type]);
79
59
  });
80
- this.i18n.change.pipe(takeUntilDestroyed(this.destroy$)).subscribe(() => {
81
- this.locale = this.i18n.getData('exception');
82
- this.cdr.detectChanges();
60
+ afterNextRender(() => {
61
+ this.checkContent();
83
62
  });
84
- this.checkContent();
85
63
  }
86
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ExceptionComponent, deps: [{ token: i1.AlainConfigService }], target: i0.ɵɵFactoryTarget.Component });
87
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.1", type: ExceptionComponent, isStandalone: true, selector: "exception", inputs: { type: "type", img: "img", title: "title", desc: "desc", backRouterLink: "backRouterLink" }, host: { properties: { "class.exception": "true", "class.exception-rtl": "dir === 'rtl'" } }, viewQueries: [{ propertyName: "conTpl", first: true, predicate: ["conTpl"], descendants: true, static: true }], exportAs: ["exception"], ngImport: i0, template: "<div class=\"exception__img-block\">\n <div class=\"exception__img\" [style.backgroundImage]=\"_img\"></div>\n</div>\n<div class=\"exception__cont\">\n <h1 class=\"exception__cont-title\" [innerHTML]=\"_title\"></h1>\n <div class=\"exception__cont-desc\" [innerHTML]=\"_desc || locale[_type]\"></div>\n <div class=\"exception__cont-actions\">\n <div (cdkObserveContent)=\"checkContent()\" #conTpl>\n <ng-content />\n </div>\n @if (!hasCon) {\n <button nz-button [routerLink]=\"backRouterLink\" [nzType]=\"'primary'\">\n {{ locale.backToHome }}\n </button>\n }\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: CdkObserveContent, selector: "[cdkObserveContent]", inputs: ["cdkObserveContentDisabled", "debounce"], outputs: ["cdkObserveContent"], exportAs: ["cdkObserveContent"] }, { kind: "component", type: NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
64
+ checkContent() {
65
+ this.hasCon.set(!isEmpty(this.conTpl().nativeElement));
66
+ }
67
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ExceptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
68
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: ExceptionComponent, isStandalone: true, selector: "exception", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, img: { classPropertyName: "img", publicName: "img", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, desc: { classPropertyName: "desc", publicName: "desc", isSignal: true, isRequired: false, transformFunction: null }, backRouterLink: { classPropertyName: "backRouterLink", publicName: "backRouterLink", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.exception": "true", "class.exception-rtl": "dir() === 'rtl'" } }, viewQueries: [{ propertyName: "conTpl", first: true, predicate: ["conTpl"], descendants: true, isSignal: true }], exportAs: ["exception"], ngImport: i0, template: `
69
+ <div class="exception__img-block">
70
+ <div class="exception__img" [style.backgroundImage]="_img()"></div>
71
+ </div>
72
+ <div class="exception__cont">
73
+ @if (_title()) {
74
+ <h1 class="exception__cont-title" [innerHTML]="_title()"></h1>
75
+ }
76
+ <div class="exception__cont-desc" [innerHTML]="_desc()"></div>
77
+ <div class="exception__cont-actions">
78
+ <div (cdkObserveContent)="checkContent()" #conTpl>
79
+ <ng-content />
80
+ </div>
81
+ @if (!hasCon()) {
82
+ <button nz-button [routerLink]="backRouterLink()" [nzType]="'primary'">
83
+ {{ locale().backToHome }}
84
+ </button>
85
+ }
86
+ </div>
87
+ </div>
88
+ `, isInline: true, dependencies: [{ kind: "directive", type: CdkObserveContent, selector: "[cdkObserveContent]", inputs: ["cdkObserveContentDisabled", "debounce"], outputs: ["cdkObserveContent"], exportAs: ["cdkObserveContent"] }, { kind: "component", type: NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
88
89
  }
89
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ExceptionComponent, decorators: [{
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ExceptionComponent, decorators: [{
90
91
  type: Component,
91
- args: [{ selector: 'exception', exportAs: 'exception', host: {
92
+ args: [{
93
+ selector: 'exception',
94
+ exportAs: 'exception',
95
+ template: `
96
+ <div class="exception__img-block">
97
+ <div class="exception__img" [style.backgroundImage]="_img()"></div>
98
+ </div>
99
+ <div class="exception__cont">
100
+ @if (_title()) {
101
+ <h1 class="exception__cont-title" [innerHTML]="_title()"></h1>
102
+ }
103
+ <div class="exception__cont-desc" [innerHTML]="_desc()"></div>
104
+ <div class="exception__cont-actions">
105
+ <div (cdkObserveContent)="checkContent()" #conTpl>
106
+ <ng-content />
107
+ </div>
108
+ @if (!hasCon()) {
109
+ <button nz-button [routerLink]="backRouterLink()" [nzType]="'primary'">
110
+ {{ locale().backToHome }}
111
+ </button>
112
+ }
113
+ </div>
114
+ </div>
115
+ `,
116
+ host: {
92
117
  '[class.exception]': 'true',
93
- '[class.exception-rtl]': `dir === 'rtl'`
94
- }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CdkObserveContent, NzButtonComponent, RouterLink], template: "<div class=\"exception__img-block\">\n <div class=\"exception__img\" [style.backgroundImage]=\"_img\"></div>\n</div>\n<div class=\"exception__cont\">\n <h1 class=\"exception__cont-title\" [innerHTML]=\"_title\"></h1>\n <div class=\"exception__cont-desc\" [innerHTML]=\"_desc || locale[_type]\"></div>\n <div class=\"exception__cont-actions\">\n <div (cdkObserveContent)=\"checkContent()\" #conTpl>\n <ng-content />\n </div>\n @if (!hasCon) {\n <button nz-button [routerLink]=\"backRouterLink\" [nzType]=\"'primary'\">\n {{ locale.backToHome }}\n </button>\n }\n </div>\n</div>\n" }]
95
- }], ctorParameters: () => [{ type: i1.AlainConfigService }], propDecorators: { conTpl: [{
96
- type: ViewChild,
97
- args: ['conTpl', { static: true }]
98
- }], type: [{
99
- type: Input
100
- }], img: [{
101
- type: Input
102
- }], title: [{
103
- type: Input
104
- }], desc: [{
105
- type: Input
106
- }], backRouterLink: [{
107
- type: Input
108
- }] } });
118
+ '[class.exception-rtl]': `dir() === 'rtl'`
119
+ },
120
+ changeDetection: ChangeDetectionStrategy.OnPush,
121
+ encapsulation: ViewEncapsulation.None,
122
+ imports: [CdkObserveContent, NzButtonComponent, RouterLink]
123
+ }]
124
+ }], ctorParameters: () => [] });
109
125
 
110
126
  const COMPONENTS = [ExceptionComponent];
111
127
  class ExceptionModule {
112
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ExceptionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
113
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: ExceptionModule, imports: [CommonModule, ObserversModule, RouterModule, DelonLocaleModule, NzButtonModule, ExceptionComponent], exports: [ExceptionComponent] });
114
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ExceptionModule, imports: [CommonModule, ObserversModule, RouterModule, DelonLocaleModule, NzButtonModule, COMPONENTS] });
128
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ExceptionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
129
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: ExceptionModule, imports: [CommonModule, ObserversModule, RouterModule, DelonLocaleModule, NzButtonModule, ExceptionComponent], exports: [ExceptionComponent] });
130
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ExceptionModule, imports: [CommonModule, ObserversModule, RouterModule, DelonLocaleModule, NzButtonModule, COMPONENTS] });
115
131
  }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ExceptionModule, decorators: [{
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ExceptionModule, decorators: [{
117
133
  type: NgModule,
118
134
  args: [{
119
135
  imports: [CommonModule, ObserversModule, RouterModule, DelonLocaleModule, NzButtonModule, ...COMPONENTS],