@delon/abc 19.0.0 → 19.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 (45) hide show
  1. package/auto-focus/auto-focus.directive.d.ts +6 -8
  2. package/cell/cell-host.directive.d.ts +4 -5
  3. package/cell/cell.component.d.ts +13 -22
  4. package/error-collect/error-collect.component.d.ts +6 -12
  5. package/fesm2022/auto-focus.mjs +16 -16
  6. package/fesm2022/auto-focus.mjs.map +1 -1
  7. package/fesm2022/cell.mjs +84 -99
  8. package/fesm2022/cell.mjs.map +1 -1
  9. package/fesm2022/date-picker.mjs +1 -0
  10. package/fesm2022/date-picker.mjs.map +1 -1
  11. package/fesm2022/error-collect.mjs +23 -40
  12. package/fesm2022/error-collect.mjs.map +1 -1
  13. package/fesm2022/exception.mjs.map +1 -1
  14. package/fesm2022/full-content.mjs +1 -1
  15. package/fesm2022/full-content.mjs.map +1 -1
  16. package/fesm2022/loading.mjs.map +1 -1
  17. package/fesm2022/lodop.mjs +1 -1
  18. package/fesm2022/lodop.mjs.map +1 -1
  19. package/fesm2022/notice-icon.mjs +6 -12
  20. package/fesm2022/notice-icon.mjs.map +1 -1
  21. package/fesm2022/onboarding.mjs +1 -1
  22. package/fesm2022/onboarding.mjs.map +1 -1
  23. package/fesm2022/quick-menu.mjs.map +1 -1
  24. package/fesm2022/reuse-tab.mjs.map +1 -1
  25. package/fesm2022/se.mjs +2 -2
  26. package/fesm2022/se.mjs.map +1 -1
  27. package/fesm2022/st.mjs +6 -5
  28. package/fesm2022/st.mjs.map +1 -1
  29. package/fesm2022/sv.mjs.map +1 -1
  30. package/fesm2022/xlsx.mjs.map +1 -1
  31. package/fesm2022/zip.mjs.map +1 -1
  32. package/loading/loading.types.d.ts +1 -3
  33. package/notice-icon/notice-icon.component.d.ts +6 -11
  34. package/notice-icon/style/index.less +4 -0
  35. package/package.json +4 -4
  36. package/quick-menu/quick-menu.component.d.ts +1 -3
  37. package/reuse-tab/reuse-tab.cache.d.ts +4 -12
  38. package/reuse-tab/reuse-tab.component.d.ts +1 -3
  39. package/se/se.types.d.ts +1 -3
  40. package/st/st.component.d.ts +1 -1
  41. package/st/st.interfaces.d.ts +5 -13
  42. package/st/st.types.d.ts +1 -3
  43. package/sv/sv-container.component.d.ts +1 -3
  44. package/xlsx/xlsx.service.d.ts +1 -3
  45. package/xlsx/xlsx.types.d.ts +1 -3
@@ -1,12 +1,10 @@
1
- import { AfterViewInit } from '@angular/core';
2
1
  import * as i0 from "@angular/core";
3
- export declare class AutoFocusDirective implements AfterViewInit {
2
+ export declare class AutoFocusDirective {
4
3
  private readonly el;
5
- private readonly platform;
6
- private readonly destroy$;
7
- enabled: import("@angular/core").InputSignalWithTransform<boolean, string | boolean | null | undefined>;
8
- delay: import("@angular/core").InputSignalWithTransform<number, string | number | null | undefined>;
9
- ngAfterViewInit(): void;
4
+ enabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
5
+ delay: import("@angular/core").InputSignalWithTransform<number, unknown>;
6
+ readonly focus: import("@angular/core").OutputEmitterRef<void>;
7
+ constructor();
10
8
  static ɵfac: i0.ɵɵFactoryDeclaration<AutoFocusDirective, never>;
11
- static ɵdir: i0.ɵɵDirectiveDeclaration<AutoFocusDirective, "[auto-focus], input[autofocus=\"autofocus\"], textarea[autofocus=\"autofocus\"]", ["autoFocus"], { "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "delay": { "alias": "delay"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
9
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AutoFocusDirective, "[auto-focus], input[autofocus=\"autofocus\"], textarea[autofocus=\"autofocus\"]", ["autoFocus"], { "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "delay": { "alias": "delay"; "required": false; "isSignal": true; }; }, { "focus": "focus"; }, never, never, true, never>;
12
10
  }
@@ -1,11 +1,10 @@
1
- import { OnChanges } from '@angular/core';
2
1
  import { CellTextResult } from './cell.types';
3
2
  import * as i0 from "@angular/core";
4
- export declare class CellHostDirective implements OnChanges {
3
+ export declare class CellHostDirective {
5
4
  private readonly srv;
6
5
  private readonly vcr;
7
- data: CellTextResult;
8
- ngOnChanges(): void;
6
+ data: import("@angular/core").InputSignal<CellTextResult>;
7
+ constructor();
9
8
  static ɵfac: i0.ɵɵFactoryDeclaration<CellHostDirective, never>;
10
- static ɵdir: i0.ɵɵDirectiveDeclaration<CellHostDirective, "[cell-widget-host]", never, { "data": { "alias": "data"; "required": false; }; }, {}, never, never, true, never>;
9
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CellHostDirective, "[cell-widget-host]", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
11
10
  }
@@ -1,39 +1,30 @@
1
- import { EventEmitter, OnChanges, OnDestroy, SimpleChange } from '@angular/core';
1
+ import { OnDestroy } from '@angular/core';
2
2
  import type { SafeValue } from '@angular/platform-browser';
3
- import type { NzSafeAny } from 'ng-zorro-antd/core/types';
4
3
  import type { CellOptions, CellTextResult, CellValue } from './cell.types';
5
4
  import * as i0 from "@angular/core";
6
- export declare class CellComponent implements OnChanges, OnDestroy {
5
+ export declare class CellComponent implements OnDestroy {
7
6
  private readonly srv;
8
7
  private readonly router;
9
- private readonly cdr;
10
8
  private readonly renderer;
11
9
  private readonly imgSrv;
12
10
  private readonly win;
13
11
  private readonly el;
14
12
  private destroy$?;
15
- _text: string | SafeValue | string[] | number;
16
- _unit?: string;
17
- res?: CellTextResult;
18
- showDefault: boolean;
19
- value?: CellValue;
20
- readonly valueChange: EventEmitter<any>;
21
- options?: CellOptions;
22
- loading: boolean;
23
- disabled: boolean;
13
+ _text: import("@angular/core").WritableSignal<string | number | SafeValue | string[]>;
14
+ _unit: import("@angular/core").WritableSignal<string | undefined>;
15
+ _res: import("@angular/core").WritableSignal<CellTextResult | undefined>;
16
+ showDefault: import("@angular/core").Signal<boolean>;
17
+ value: import("@angular/core").ModelSignal<CellValue>;
18
+ options: import("@angular/core").InputSignal<CellOptions | undefined>;
19
+ loading: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
20
+ disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
24
21
  get safeOpt(): CellOptions;
25
- get isText(): boolean;
26
- private updateValue;
22
+ isText: import("@angular/core").Signal<boolean>;
23
+ constructor();
27
24
  private setClass;
28
- ngOnChanges(changes: {
29
- [p in keyof CellComponent]?: SimpleChange;
30
- }): void;
31
- change(value: NzSafeAny): void;
32
25
  _link(e: Event): void;
33
26
  _showImg(img: string): void;
34
27
  ngOnDestroy(): void;
35
28
  static ɵfac: i0.ɵɵFactoryDeclaration<CellComponent, never>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<CellComponent, "cell, [cell]", ["cell"], { "value": { "alias": "value"; "required": false; }; "options": { "alias": "options"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
37
- static ngAcceptInputType_loading: unknown;
38
- static ngAcceptInputType_disabled: unknown;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<CellComponent, "cell, [cell]", ["cell"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
39
30
  }
@@ -1,29 +1,23 @@
1
- import { Direction } from '@angular/cdk/bidi';
2
1
  import { OnInit } from '@angular/core';
3
2
  import { AlainConfigService } from '@delon/util/config';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class ErrorCollectComponent implements OnInit {
6
5
  private readonly el;
7
- private readonly cdr;
8
6
  private readonly doc;
9
- private readonly directionality;
10
7
  private readonly platform;
11
8
  private readonly destroy$;
12
9
  private formEl;
13
- _hiden: boolean;
14
- count: number;
15
- dir?: Direction;
16
- freq: number;
17
- offsetTop: number;
10
+ _hiden: import("@angular/core").WritableSignal<boolean>;
11
+ count: import("@angular/core").WritableSignal<number>;
12
+ dir: import("@angular/core").Signal<import("@angular/cdk/bidi").Direction | undefined>;
13
+ readonly freq: import("@angular/core").InputSignalWithTransform<number, unknown>;
14
+ readonly offsetTop: import("@angular/core").InputSignalWithTransform<number, unknown>;
18
15
  constructor(configSrv: AlainConfigService);
19
16
  private get errEls();
20
17
  private update;
21
18
  _click(): boolean;
22
- private install;
23
19
  private findParent;
24
20
  ngOnInit(): void;
25
21
  static ɵfac: i0.ɵɵFactoryDeclaration<ErrorCollectComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<ErrorCollectComponent, "error-collect, [error-collect]", ["errorCollect"], { "freq": { "alias": "freq"; "required": false; }; "offsetTop": { "alias": "offsetTop"; "required": false; }; }, {}, never, never, true, never>;
27
- static ngAcceptInputType_freq: unknown;
28
- static ngAcceptInputType_offsetTop: unknown;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<ErrorCollectComponent, "error-collect, [error-collect]", ["errorCollect"], { "freq": { "alias": "freq"; "required": false; "isSignal": true; }; "offsetTop": { "alias": "offsetTop"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
29
23
  }
@@ -1,26 +1,26 @@
1
- import { Platform } from '@angular/cdk/platform';
2
1
  import * as i0 from '@angular/core';
3
- import { inject, ElementRef, DestroyRef, input, booleanAttribute, numberAttribute, Directive, NgModule } from '@angular/core';
4
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
2
+ import { inject, ElementRef, input, booleanAttribute, numberAttribute, output, afterNextRender, Directive, NgModule } from '@angular/core';
5
3
  import { timer, take } from 'rxjs';
6
4
 
7
5
  class AutoFocusDirective {
8
6
  el = inject(ElementRef).nativeElement;
9
- platform = inject(Platform);
10
- destroy$ = inject(DestroyRef);
11
7
  enabled = input(true, { transform: booleanAttribute });
12
- delay = input(300, { transform: numberAttribute });
13
- ngAfterViewInit() {
14
- const el = this.el;
15
- if (!this.platform.isBrowser || !(el instanceof HTMLElement) || !this.enabled()) {
16
- return;
17
- }
18
- timer(this.delay())
19
- .pipe(takeUntilDestroyed(this.destroy$), take(1))
20
- .subscribe(() => el.focus({ preventScroll: false }));
8
+ delay = input(25, { transform: numberAttribute });
9
+ focus = output();
10
+ constructor() {
11
+ afterNextRender(() => {
12
+ if (this.enabled()) {
13
+ timer(this.delay())
14
+ .pipe(take(1))
15
+ .subscribe(() => {
16
+ this.el.focus({ preventScroll: false });
17
+ this.focus.emit();
18
+ });
19
+ }
20
+ });
21
21
  }
22
22
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: AutoFocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
23
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.1", type: AutoFocusDirective, isStandalone: true, selector: "[auto-focus], input[autofocus=\"autofocus\"], textarea[autofocus=\"autofocus\"]", inputs: { enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["autoFocus"], ngImport: i0 });
23
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.1", type: AutoFocusDirective, isStandalone: true, selector: "[auto-focus], input[autofocus=\"autofocus\"], textarea[autofocus=\"autofocus\"]", inputs: { enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { focus: "focus" }, exportAs: ["autoFocus"], ngImport: i0 });
24
24
  }
25
25
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: AutoFocusDirective, decorators: [{
26
26
  type: Directive,
@@ -28,7 +28,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImpor
28
28
  selector: '[auto-focus], input[autofocus="autofocus"], textarea[autofocus="autofocus"]',
29
29
  exportAs: 'autoFocus'
30
30
  }]
31
- }] });
31
+ }], ctorParameters: () => [] });
32
32
 
33
33
  const COMPONENTS = [AutoFocusDirective];
34
34
  class AutoFocusModule {
@@ -1 +1 @@
1
- {"version":3,"file":"auto-focus.mjs","sources":["../../../../packages/abc/auto-focus/auto-focus.directive.ts","../../../../packages/abc/auto-focus/auto-focus.module.ts","../../../../packages/abc/auto-focus/auto-focus.ts"],"sourcesContent":["import { Platform } from '@angular/cdk/platform';\nimport {\n AfterViewInit,\n DestroyRef,\n Directive,\n ElementRef,\n booleanAttribute,\n inject,\n input,\n numberAttribute\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { take, timer } from 'rxjs';\n\n@Directive({\n selector: '[auto-focus], input[autofocus=\"autofocus\"], textarea[autofocus=\"autofocus\"]',\n exportAs: 'autoFocus'\n})\nexport class AutoFocusDirective implements AfterViewInit {\n private readonly el: HTMLElement = inject(ElementRef).nativeElement;\n private readonly platform = inject(Platform);\n private readonly destroy$ = inject(DestroyRef);\n\n enabled = input<boolean, boolean | string | null | undefined>(true, { transform: booleanAttribute });\n delay = input<number, number | string | null | undefined>(300, { transform: numberAttribute });\n\n ngAfterViewInit(): void {\n const el = this.el;\n if (!this.platform.isBrowser || !(el instanceof HTMLElement) || !this.enabled()) {\n return;\n }\n timer(this.delay())\n .pipe(takeUntilDestroyed(this.destroy$), take(1))\n .subscribe(() => el.focus({ preventScroll: false }));\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { AutoFocusDirective } from './auto-focus.directive';\n\nconst COMPONENTS = [AutoFocusDirective];\n\n@NgModule({\n imports: COMPONENTS,\n exports: COMPONENTS\n})\nexport class AutoFocusModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAkBa,kBAAkB,CAAA;AACZ,IAAA,EAAE,GAAgB,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa;AAClD,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;IAE9C,OAAO,GAAG,KAAK,CAA+C,IAAI,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;IACpG,KAAK,GAAG,KAAK,CAA6C,GAAG,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;IAE9F,eAAe,GAAA;AACb,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE;QAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,IAAI,EAAE,EAAE,YAAY,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE;YAC/E;;AAEF,QAAA,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE;AACf,aAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/C,aAAA,SAAS,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;;uGAf7C,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iFAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,6EAA6E;AACvF,oBAAA,QAAQ,EAAE;AACX,iBAAA;;;ACbD,MAAM,UAAU,GAAG,CAAC,kBAAkB,CAAC;MAM1B,eAAe,CAAA;uGAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAf,eAAe,EAAA,OAAA,EAAA,CANR,kBAAkB,CAAA,EAAA,OAAA,EAAA,CAAlB,kBAAkB,CAAA,EAAA,CAAA;wGAMzB,eAAe,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,UAAU;AACnB,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"auto-focus.mjs","sources":["../../../../packages/abc/auto-focus/auto-focus.directive.ts","../../../../packages/abc/auto-focus/auto-focus.module.ts","../../../../packages/abc/auto-focus/auto-focus.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n afterNextRender,\n booleanAttribute,\n inject,\n input,\n numberAttribute,\n output\n} from '@angular/core';\nimport { take, timer } from 'rxjs';\n\n@Directive({\n selector: '[auto-focus], input[autofocus=\"autofocus\"], textarea[autofocus=\"autofocus\"]',\n exportAs: 'autoFocus'\n})\nexport class AutoFocusDirective {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n enabled = input(true, { transform: booleanAttribute });\n delay = input(25, { transform: numberAttribute });\n readonly focus = output();\n\n constructor() {\n afterNextRender(() => {\n if (this.enabled()) {\n timer(this.delay())\n .pipe(take(1))\n .subscribe(() => {\n this.el.focus({ preventScroll: false });\n this.focus.emit();\n });\n }\n });\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { AutoFocusDirective } from './auto-focus.directive';\n\nconst COMPONENTS = [AutoFocusDirective];\n\n@NgModule({\n imports: COMPONENTS,\n exports: COMPONENTS\n})\nexport class AutoFocusModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAgBa,kBAAkB,CAAA;AACZ,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC,aAAa;IAC/E,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;IACtD,KAAK,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;IACxC,KAAK,GAAG,MAAM,EAAE;AAEzB,IAAA,WAAA,GAAA;QACE,eAAe,CAAC,MAAK;AACnB,YAAA,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;AAClB,gBAAA,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE;AACf,qBAAA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;qBACZ,SAAS,CAAC,MAAK;oBACd,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AACvC,oBAAA,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;AACnB,iBAAC,CAAC;;AAER,SAAC,CAAC;;uGAhBO,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iFAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,KAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,6EAA6E;AACvF,oBAAA,QAAQ,EAAE;AACX,iBAAA;;;ACXD,MAAM,UAAU,GAAG,CAAC,kBAAkB,CAAC;MAM1B,eAAe,CAAA;uGAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAf,eAAe,EAAA,OAAA,EAAA,CANR,kBAAkB,CAAA,EAAA,OAAA,EAAA,CAAlB,kBAAkB,CAAA,EAAA,CAAA;wGAMzB,eAAe,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,UAAU;AACnB,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACTD;;AAEG;;;;"}
package/fesm2022/cell.mjs CHANGED
@@ -1,9 +1,11 @@
1
1
  import { NgTemplateOutlet, CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, Injectable, ViewContainerRef, Directive, Input, ChangeDetectorRef, Renderer2, ElementRef, EventEmitter, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Output, NgModule, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';
3
+ import { inject, Injectable, ViewContainerRef, input, effect, Directive, Renderer2, ElementRef, signal, computed, model, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';
4
+ import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
5
  import * as i1 from '@angular/forms';
5
6
  import { FormsModule } from '@angular/forms';
6
7
  import { Router } from '@angular/router';
8
+ import { of, map, combineLatest, take } from 'rxjs';
7
9
  import { updateHostClass } from '@delon/util/browser';
8
10
  import { WINDOW } from '@delon/util/token';
9
11
  import { NzBadgeComponent, NzBadgeModule } from 'ng-zorro-antd/badge';
@@ -15,7 +17,6 @@ import { NzTagComponent, NzTagModule } from 'ng-zorro-antd/tag';
15
17
  import { NzTooltipDirective, NzToolTipModule } from 'ng-zorro-antd/tooltip';
16
18
  import { deepMerge, warn } from '@delon/util/other';
17
19
  import { DomSanitizer } from '@angular/platform-browser';
18
- import { of, map } from 'rxjs';
19
20
  import { yn } from '@delon/theme';
20
21
  import { AlainConfigService } from '@delon/util/config';
21
22
  import { formatDate } from '@delon/util/date-time';
@@ -187,65 +188,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImpor
187
188
  class CellHostDirective {
188
189
  srv = inject(CellService);
189
190
  vcr = inject(ViewContainerRef);
190
- data;
191
- ngOnChanges() {
192
- const widget = this.data.options.widget;
193
- const componentType = this.srv.getWidget(widget.key)?.ref;
194
- if (componentType == null) {
195
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
196
- warn(`cell: No widget for type "${widget.key}"`);
191
+ data = input.required();
192
+ constructor() {
193
+ effect(() => {
194
+ const data = this.data();
195
+ const widget = data.options.widget;
196
+ const componentType = this.srv.getWidget(widget.key)?.ref;
197
+ if (componentType == null) {
198
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
199
+ warn(`cell: No widget for type "${widget.key}"`);
200
+ }
201
+ return;
197
202
  }
198
- return;
199
- }
200
- this.vcr.clear();
201
- const componentRef = this.vcr.createComponent(componentType);
202
- componentRef.instance.data = this.data;
203
+ this.vcr.clear();
204
+ const componentRef = this.vcr.createComponent(componentType);
205
+ componentRef.instance.data = data;
206
+ });
203
207
  }
204
208
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: CellHostDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
205
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.1", type: CellHostDirective, isStandalone: true, selector: "[cell-widget-host]", inputs: { data: "data" }, usesOnChanges: true, ngImport: i0 });
209
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.1", type: CellHostDirective, isStandalone: true, selector: "[cell-widget-host]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
206
210
  }
207
211
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: CellHostDirective, decorators: [{
208
212
  type: Directive,
209
213
  args: [{
210
214
  selector: '[cell-widget-host]'
211
215
  }]
212
- }], propDecorators: { data: [{
213
- type: Input
214
- }] } });
216
+ }], ctorParameters: () => [] });
215
217
 
216
218
  class CellComponent {
217
219
  srv = inject(CellService);
218
220
  router = inject(Router);
219
- cdr = inject(ChangeDetectorRef);
220
221
  renderer = inject(Renderer2);
221
222
  imgSrv = inject(NzImageService);
222
223
  win = inject(WINDOW);
223
224
  el = inject(ElementRef).nativeElement;
224
225
  destroy$;
225
- _text;
226
- _unit;
227
- res;
228
- showDefault = false;
229
- value;
230
- valueChange = new EventEmitter();
231
- options;
232
- loading = false;
233
- disabled = false;
226
+ _text = signal('');
227
+ _unit = signal(undefined);
228
+ _res = signal(undefined);
229
+ showDefault = computed(() => this.value() == this.safeOpt.default?.condition);
230
+ value = model();
231
+ options = input();
232
+ loading = input(false, { transform: booleanAttribute });
233
+ disabled = input(false, { transform: booleanAttribute });
234
234
  get safeOpt() {
235
- return this.res?.options ?? {};
235
+ return this._res()?.options ?? {};
236
236
  }
237
- get isText() {
238
- return this.res?.safeHtml === 'text';
239
- }
240
- updateValue() {
241
- this.destroy$?.unsubscribe();
242
- this.destroy$ = this.srv.get(this.value, this.options).subscribe(res => {
243
- this.res = res;
244
- this.showDefault = this.value == this.safeOpt.default.condition;
245
- this._text = res.result?.text ?? '';
246
- this._unit = res.result?.unit ?? this.safeOpt?.unit;
247
- this.cdr.detectChanges();
248
- this.setClass();
237
+ isText = computed(() => this._res()?.safeHtml === 'text');
238
+ constructor() {
239
+ combineLatest([toObservable(this.loading), toObservable(this.disabled)])
240
+ .pipe(takeUntilDestroyed())
241
+ .subscribe(() => this.setClass());
242
+ effect(() => {
243
+ const v = this.value();
244
+ const o = this.options();
245
+ this.destroy$?.unsubscribe();
246
+ this.destroy$ = this.srv
247
+ .get(v, o)
248
+ .pipe(take(1))
249
+ .subscribe(res => {
250
+ this._res.set(res);
251
+ this._text.set(res.result?.text ?? '');
252
+ this._unit.set(res.result?.unit ?? this.safeOpt?.unit);
253
+ this.setClass();
254
+ });
249
255
  });
250
256
  }
251
257
  setClass() {
@@ -255,29 +261,16 @@ class CellComponent {
255
261
  [`cell`]: true,
256
262
  [`cell__${renderType}`]: renderType != null,
257
263
  [`cell__${size}`]: size != null,
258
- [`cell__has-unit`]: this._unit,
259
- [`cell__has-default`]: this.showDefault,
260
- [`cell__disabled`]: this.disabled
264
+ [`cell__has-unit`]: this._unit(),
265
+ [`cell__has-default`]: this.showDefault(),
266
+ [`cell__disabled`]: this.disabled()
261
267
  });
262
268
  el.setAttribute('data-type', `${type}`);
263
269
  }
264
- ngOnChanges(changes) {
265
- // Do not call updateValue when only updating loading, disabled
266
- if (Object.keys(changes).every(k => ['loading', 'disabled'].includes(k))) {
267
- this.setClass();
268
- }
269
- else {
270
- this.updateValue();
271
- }
272
- }
273
- change(value) {
274
- this.value = value;
275
- this.valueChange.emit(value);
276
- }
277
270
  _link(e) {
278
271
  e.preventDefault();
279
272
  e.stopPropagation();
280
- if (this.disabled)
273
+ if (this.disabled())
281
274
  return;
282
275
  const link = this.safeOpt.link;
283
276
  const url = link?.url;
@@ -295,7 +288,7 @@ class CellComponent {
295
288
  if (config == null || config.big == null)
296
289
  return;
297
290
  let idx = -1;
298
- const list = this._text.map((p, index) => {
291
+ const list = this._text().map((p, index) => {
299
292
  if (idx === -1 && p === img)
300
293
  idx = index;
301
294
  return typeof config.big === 'function' ? config.big(p) : p;
@@ -308,29 +301,31 @@ class CellComponent {
308
301
  this.destroy$?.unsubscribe();
309
302
  }
310
303
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: CellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
311
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.1", type: CellComponent, isStandalone: true, selector: "cell, [cell]", inputs: { value: "value", options: "options", loading: ["loading", "loading", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { valueChange: "valueChange" }, exportAs: ["cell"], usesOnChanges: true, ngImport: i0, template: `
304
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.1", type: CellComponent, isStandalone: true, selector: "cell, [cell]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, exportAs: ["cell"], ngImport: i0, template: `
312
305
  <ng-template #text>
306
+ @let res = _res();
307
+ @let text = _text();
313
308
  @switch (safeOpt.type) {
314
309
  @case ('checkbox') {
315
- <label nz-checkbox [nzDisabled]="disabled" [ngModel]="value" (ngModelChange)="change($event)">
310
+ <label nz-checkbox [nzDisabled]="disabled()" [ngModel]="value()" (ngModelChange)="value.set($event)">
316
311
  {{ safeOpt.checkbox?.label }}
317
312
  </label>
318
313
  }
319
314
  @case ('radio') {
320
- <label nz-radio [nzDisabled]="disabled" [ngModel]="value" (ngModelChange)="change($event)">
315
+ <label nz-radio [nzDisabled]="disabled()" [ngModel]="value()" (ngModelChange)="value.set($event)">
321
316
  {{ safeOpt.radio?.label }}
322
317
  </label>
323
318
  }
324
319
  @case ('link') {
325
- <a (click)="_link($event)" [attr.target]="safeOpt.link?.target" [attr.title]="value" [innerHTML]="_text"></a>
320
+ <a (click)="_link($event)" [attr.target]="safeOpt.link?.target" [attr.title]="value()" [innerHTML]="text"></a>
326
321
  }
327
322
  @case ('tag') {
328
323
  <nz-tag [nzColor]="res?.result?.color">
329
- <span [innerHTML]="_text"></span>
324
+ <span [innerHTML]="text"></span>
330
325
  </nz-tag>
331
326
  }
332
327
  @case ('badge') {
333
- <nz-badge [nzStatus]="res?.result?.color" nzText="{{ _text }}" />
328
+ <nz-badge [nzStatus]="res?.result?.color" nzText="{{ text }}" />
334
329
  }
335
330
  @case ('widget') {
336
331
  @if (res) {
@@ -338,7 +333,7 @@ class CellComponent {
338
333
  }
339
334
  }
340
335
  @case ('img') {
341
- @for (i of $any(_text); track $index) {
336
+ @for (i of $any(text); track $index) {
342
337
  @let img = safeOpt.img;
343
338
  <img
344
339
  [attr.src]="i"
@@ -351,19 +346,19 @@ class CellComponent {
351
346
  }
352
347
  }
353
348
  @default {
354
- @if (isText) {
355
- <span [innerText]="_text" [attr.title]="value"></span>
349
+ @if (isText()) {
350
+ <span [innerText]="text" [attr.title]="value()"></span>
356
351
  } @else {
357
- <span [innerHTML]="_text" [attr.title]="value"></span>
352
+ <span [innerHTML]="text" [attr.title]="value()"></span>
358
353
  }
359
- @if (_unit) {
360
- <span class="unit">{{ _unit }}</span>
354
+ @if (_unit()) {
355
+ <span class="unit">{{ _unit() }}</span>
361
356
  }
362
357
  }
363
358
  }
364
359
  </ng-template>
365
360
  <ng-template #textWrap>
366
- @if (showDefault) {
361
+ @if (showDefault()) {
367
362
  {{ safeOpt.default?.text }}
368
363
  } @else {
369
364
  @if (safeOpt.tooltip) {
@@ -375,7 +370,7 @@ class CellComponent {
375
370
  }
376
371
  }
377
372
  </ng-template>
378
- @if (loading) {
373
+ @if (loading()) {
379
374
  <nz-icon nzType="loading" />
380
375
  } @else {
381
376
  <ng-template [ngTemplateOutlet]="textWrap" />
@@ -388,27 +383,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImpor
388
383
  selector: 'cell, [cell]',
389
384
  template: `
390
385
  <ng-template #text>
386
+ @let res = _res();
387
+ @let text = _text();
391
388
  @switch (safeOpt.type) {
392
389
  @case ('checkbox') {
393
- <label nz-checkbox [nzDisabled]="disabled" [ngModel]="value" (ngModelChange)="change($event)">
390
+ <label nz-checkbox [nzDisabled]="disabled()" [ngModel]="value()" (ngModelChange)="value.set($event)">
394
391
  {{ safeOpt.checkbox?.label }}
395
392
  </label>
396
393
  }
397
394
  @case ('radio') {
398
- <label nz-radio [nzDisabled]="disabled" [ngModel]="value" (ngModelChange)="change($event)">
395
+ <label nz-radio [nzDisabled]="disabled()" [ngModel]="value()" (ngModelChange)="value.set($event)">
399
396
  {{ safeOpt.radio?.label }}
400
397
  </label>
401
398
  }
402
399
  @case ('link') {
403
- <a (click)="_link($event)" [attr.target]="safeOpt.link?.target" [attr.title]="value" [innerHTML]="_text"></a>
400
+ <a (click)="_link($event)" [attr.target]="safeOpt.link?.target" [attr.title]="value()" [innerHTML]="text"></a>
404
401
  }
405
402
  @case ('tag') {
406
403
  <nz-tag [nzColor]="res?.result?.color">
407
- <span [innerHTML]="_text"></span>
404
+ <span [innerHTML]="text"></span>
408
405
  </nz-tag>
409
406
  }
410
407
  @case ('badge') {
411
- <nz-badge [nzStatus]="res?.result?.color" nzText="{{ _text }}" />
408
+ <nz-badge [nzStatus]="res?.result?.color" nzText="{{ text }}" />
412
409
  }
413
410
  @case ('widget') {
414
411
  @if (res) {
@@ -416,7 +413,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImpor
416
413
  }
417
414
  }
418
415
  @case ('img') {
419
- @for (i of $any(_text); track $index) {
416
+ @for (i of $any(text); track $index) {
420
417
  @let img = safeOpt.img;
421
418
  <img
422
419
  [attr.src]="i"
@@ -429,19 +426,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImpor
429
426
  }
430
427
  }
431
428
  @default {
432
- @if (isText) {
433
- <span [innerText]="_text" [attr.title]="value"></span>
429
+ @if (isText()) {
430
+ <span [innerText]="text" [attr.title]="value()"></span>
434
431
  } @else {
435
- <span [innerHTML]="_text" [attr.title]="value"></span>
432
+ <span [innerHTML]="text" [attr.title]="value()"></span>
436
433
  }
437
- @if (_unit) {
438
- <span class="unit">{{ _unit }}</span>
434
+ @if (_unit()) {
435
+ <span class="unit">{{ _unit() }}</span>
439
436
  }
440
437
  }
441
438
  }
442
439
  </ng-template>
443
440
  <ng-template #textWrap>
444
- @if (showDefault) {
441
+ @if (showDefault()) {
445
442
  {{ safeOpt.default?.text }}
446
443
  } @else {
447
444
  @if (safeOpt.tooltip) {
@@ -453,7 +450,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImpor
453
450
  }
454
451
  }
455
452
  </ng-template>
456
- @if (loading) {
453
+ @if (loading()) {
457
454
  <nz-icon nzType="loading" />
458
455
  } @else {
459
456
  <ng-template [ngTemplateOutlet]="textWrap" />
@@ -476,19 +473,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImpor
476
473
  CellHostDirective
477
474
  ]
478
475
  }]
479
- }], propDecorators: { value: [{
480
- type: Input
481
- }], valueChange: [{
482
- type: Output
483
- }], options: [{
484
- type: Input
485
- }], loading: [{
486
- type: Input,
487
- args: [{ transform: booleanAttribute }]
488
- }], disabled: [{
489
- type: Input,
490
- args: [{ transform: booleanAttribute }]
491
- }] } });
476
+ }], ctorParameters: () => [] });
492
477
 
493
478
  const COMPS = [CellComponent];
494
479
  class CellModule {