@solar-angular/ui-zorro 19.0.7 → 19.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/crud/editor.d.ts CHANGED
@@ -2,13 +2,12 @@ import { FormGroup } from '@angular/forms';
2
2
  import { Observable } from 'rxjs';
3
3
  export declare class Editor<T> {
4
4
  readonly visible: import("@angular/core").WritableSignal<boolean>;
5
- /** 模型初始值 */
6
- originalModel: T;
7
- model: T;
8
5
  readonly loading: import("@angular/core").WritableSignal<boolean>;
9
- schema: import("@angular/core").Signal<import("@fluent-form/ui-zorro").FormGroupSchema<import("@fluent-form/core").SingleSchemaKey>>;
10
- /** 是否在保存完之后固定抽屉 */
11
6
  readonly pin: import("@angular/core").WritableSignal<boolean>;
7
+ readonly _model: import("@angular/core").WritableSignal<T>;
8
+ get model(): T;
9
+ set model(value: T);
10
+ schema: import("@angular/core").Signal<import("@fluent-form/ui-zorro").FormGroupSchema<import("@fluent-form/core").SingleSchemaKey>>;
12
11
  form?: FormGroup;
13
12
  /**
14
13
  * 自动控制 loading 状态
@@ -15,14 +15,17 @@ import { MessageService } from '@solar-angular/ui-zorro/message';
15
15
  class Editor {
16
16
  constructor() {
17
17
  this.visible = signal(false);
18
- /** 模型初始值 */
19
- this.originalModel = {};
20
- this.model = {};
21
18
  this.loading = signal(false);
19
+ this.pin = signal(false);
20
+ this._model = signal({});
22
21
  // eslint-disable-next-line @typescript-eslint/no-empty-function
23
22
  this.schema = form(() => { });
24
- /** 是否在保存完之后固定抽屉 */
25
- this.pin = signal(false);
23
+ }
24
+ get model() {
25
+ return this._model();
26
+ }
27
+ set model(value) {
28
+ this._model.set(value);
26
29
  }
27
30
  /**
28
31
  * 自动控制 loading 状态
@@ -55,10 +58,9 @@ class Editor {
55
58
  this.pin.update(value => !value);
56
59
  }
57
60
  reset() {
58
- this.fill({});
61
+ this.form?.reset();
59
62
  }
60
63
  fill(model) {
61
- this.originalModel = model;
62
64
  this.model = model;
63
65
  }
64
66
  }
@@ -72,10 +74,10 @@ class SunEditorDrawer {
72
74
  this.primaryKey = input('id');
73
75
  this.visibleChange = output();
74
76
  }
75
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunEditorDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
76
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.14", type: SunEditorDrawer, isStandalone: true, selector: "sun-editor-drawer", inputs: { editor: { classPropertyName: "editor", publicName: "editor", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, primaryKey: { classPropertyName: "primaryKey", publicName: "primaryKey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<nz-drawer\n nzWrapClassName=\"sun-editor-drawer-wrapper\"\n [nzWidth]=\"width()\"\n [nzClosable]=\"false\"\n [nzTitle]=\"editorTitle\"\n [nzFooter]=\"editorFooter\"\n [nzVisible]=\"editor().visible()\"\n (nzVisibleChange)=\"visibleChange.emit($event); $event || editor().reset()\"\n (nzOnClose)=\"editor().dismiss()\">\n <nz-spin *nzDrawerContent [nzSpinning]=\"editor().loading()\">\n <ng-content />\n </nz-spin>\n</nz-drawer>\n\n<ng-template #editorTitle>\n <div>{{ editor().model[primaryKey()] ? '\u7F16\u8F91\u6761\u76EE' : '\u65B0\u589E\u6761\u76EE' }}</div>\n\n <nz-icon nzType=\"pushpin\" [nzTheme]=\"editor().pin() ? 'twotone' : 'outline'\" (click)=\"editor().togglePin()\"></nz-icon>\n</ng-template>\n\n<ng-template #editorFooter>\n <small nz-typography nzType=\"secondary\">\n \u6CE8\u610F\uFF1A\u6807\u7B7E\u4E0A\u5E26\u6709\n <span nz-typography nzType=\"danger\" style=\"font-family: SimSun, sans-serif\">*</span>\n \u7B26\u53F7\u7684\u9879\u76EE\u4E3A\u5FC5\u586B\u9879\n </small>\n</ng-template>\n", styles: ["::ng-deep .sun-editor-drawer-wrapper .ant-drawer-title{display:flex;justify-content:space-between;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: NzDrawerModule }, { kind: "component", type: i1.NzDrawerComponent, selector: "nz-drawer", inputs: ["nzContent", "nzCloseIcon", "nzClosable", "nzMaskClosable", "nzMask", "nzCloseOnNavigation", "nzNoAnimation", "nzKeyboard", "nzTitle", "nzExtra", "nzFooter", "nzPlacement", "nzSize", "nzMaskStyle", "nzBodyStyle", "nzWrapClassName", "nzWidth", "nzHeight", "nzZIndex", "nzOffsetX", "nzOffsetY", "nzVisible"], outputs: ["nzOnViewInit", "nzOnClose", "nzVisibleChange"], exportAs: ["nzDrawer"] }, { kind: "directive", type: i1.NzDrawerContentDirective, selector: "[nzDrawerContent]", exportAs: ["nzDrawerContent"] }, { kind: "ngmodule", type: NzSpinModule }, { kind: "component", type: i2.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzTypographyModule }, { kind: "component", type: i4.NzTypographyComponent, selector: " nz-typography, [nz-typography], p[nz-paragraph], span[nz-text], h1[nz-title], h2[nz-title], h3[nz-title], h4[nz-title] ", inputs: ["nzCopyable", "nzEditable", "nzDisabled", "nzExpandable", "nzEllipsis", "nzCopyTooltips", "nzCopyIcons", "nzEditTooltip", "nzEditIcon", "nzContent", "nzEllipsisRows", "nzType", "nzCopyText", "nzSuffix"], outputs: ["nzContentChange", "nzCopy", "nzExpandChange", "nzOnEllipsis"], exportAs: ["nzTypography"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
77
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunEditorDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
78
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.15", type: SunEditorDrawer, isStandalone: true, selector: "sun-editor-drawer", inputs: { editor: { classPropertyName: "editor", publicName: "editor", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, primaryKey: { classPropertyName: "primaryKey", publicName: "primaryKey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<nz-drawer\n nzWrapClassName=\"sun-editor-drawer-wrapper\"\n [nzWidth]=\"width()\"\n [nzClosable]=\"false\"\n [nzTitle]=\"editorTitle\"\n [nzFooter]=\"editorFooter\"\n [nzVisible]=\"editor().visible()\"\n (nzVisibleChange)=\"visibleChange.emit($event); $event || editor().reset()\"\n (nzOnClose)=\"editor().dismiss()\">\n <nz-spin *nzDrawerContent [nzSpinning]=\"editor().loading()\">\n <ng-content />\n </nz-spin>\n</nz-drawer>\n\n<ng-template #editorTitle>\n <div>{{ editor().model[primaryKey()] ? '\u7F16\u8F91\u6761\u76EE' : '\u65B0\u589E\u6761\u76EE' }}</div>\n\n <nz-icon nzType=\"pushpin\" [nzTheme]=\"editor().pin() ? 'twotone' : 'outline'\" (click)=\"editor().togglePin()\"></nz-icon>\n</ng-template>\n\n<ng-template #editorFooter>\n <small nz-typography nzType=\"secondary\">\n \u6CE8\u610F\uFF1A\u6807\u7B7E\u4E0A\u5E26\u6709\n <span nz-typography nzType=\"danger\" style=\"font-family: SimSun, sans-serif\">*</span>\n \u7B26\u53F7\u7684\u9879\u76EE\u4E3A\u5FC5\u586B\u9879\n </small>\n</ng-template>\n", styles: ["::ng-deep .sun-editor-drawer-wrapper .ant-drawer-title{display:flex;justify-content:space-between;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: NzDrawerModule }, { kind: "component", type: i1.NzDrawerComponent, selector: "nz-drawer", inputs: ["nzContent", "nzCloseIcon", "nzClosable", "nzMaskClosable", "nzMask", "nzCloseOnNavigation", "nzNoAnimation", "nzKeyboard", "nzTitle", "nzExtra", "nzFooter", "nzPlacement", "nzSize", "nzMaskStyle", "nzBodyStyle", "nzWrapClassName", "nzWidth", "nzHeight", "nzZIndex", "nzOffsetX", "nzOffsetY", "nzVisible"], outputs: ["nzOnViewInit", "nzOnClose", "nzVisibleChange"], exportAs: ["nzDrawer"] }, { kind: "directive", type: i1.NzDrawerContentDirective, selector: "[nzDrawerContent]", exportAs: ["nzDrawerContent"] }, { kind: "ngmodule", type: NzSpinModule }, { kind: "component", type: i2.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzTypographyModule }, { kind: "component", type: i4.NzTypographyComponent, selector: " nz-typography, [nz-typography], p[nz-paragraph], span[nz-text], h1[nz-title], h2[nz-title], h3[nz-title], h4[nz-title] ", inputs: ["nzCopyable", "nzEditable", "nzDisabled", "nzExpandable", "nzEllipsis", "nzCopyTooltips", "nzCopyIcons", "nzEditTooltip", "nzEditIcon", "nzContent", "nzEllipsisRows", "nzType", "nzCopyText", "nzSuffix"], outputs: ["nzContentChange", "nzCopy", "nzExpandChange", "nzOnEllipsis"], exportAs: ["nzTypography"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
77
79
  }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunEditorDrawer, decorators: [{
80
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunEditorDrawer, decorators: [{
79
81
  type: Component,
80
82
  args: [{ selector: 'sun-editor-drawer', imports: [
81
83
  NzDrawerModule,
@@ -1 +1 @@
1
- {"version":3,"file":"solar-angular-ui-zorro-crud.mjs","sources":["../../../packages/ui-zorro/crud/editor.ts","../../../packages/ui-zorro/crud/editor-drawer/editor-drawer.component.ts","../../../packages/ui-zorro/crud/editor-drawer/editor-drawer.component.html","../../../packages/ui-zorro/crud/searcher.ts","../../../packages/ui-zorro/crud/page.ts","../../../packages/ui-zorro/crud/solar-angular-ui-zorro-crud.ts"],"sourcesContent":["import { signal } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { form } from '@fluent-form/ui-zorro';\nimport { Observable, finalize, tap } from 'rxjs';\n\nexport class Editor<T> {\n readonly visible = signal(false);\n /** 模型初始值 */\n originalModel: T = {} as T;\n model: T = {} as T;\n readonly loading = signal(false);\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n schema = form(() => { });\n /** 是否在保存完之后固定抽屉 */\n readonly pin = signal(false);\n form?: FormGroup;\n\n /**\n * 自动控制 loading 状态\n */\n withLoading<X>() {\n this.loading.set(true);\n return (observable: Observable<X>) => {\n return observable.pipe(\n finalize(() => this.loading.set(false))\n );\n };\n }\n\n /**\n * next 时自动重置表单 或 收起编辑器\n */\n withAttach<X>() {\n return (observable: Observable<X>) => observable.pipe(\n tap(() => this.pin() ? this.reset() : this.dismiss())\n );\n }\n\n /**\n * 呈现编辑器\n */\n present() {\n this.visible.set(true);\n }\n\n /**\n * 关闭编辑器\n */\n dismiss() {\n this.visible.set(false);\n }\n\n togglePin() {\n this.pin.update(value => !value);\n }\n\n reset() {\n this.fill({} as T);\n }\n\n fill(model: T) {\n this.originalModel = model;\n this.model = model;\n }\n}\n","import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { NzDrawerModule } from 'ng-zorro-antd/drawer';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzSpinModule } from 'ng-zorro-antd/spin';\nimport { NzTypographyModule } from 'ng-zorro-antd/typography';\nimport { Editor } from '../editor';\n\n@Component({\n selector: 'sun-editor-drawer',\n imports: [\n NzDrawerModule,\n NzSpinModule,\n NzIconModule,\n NzTypographyModule\n ],\n templateUrl: './editor-drawer.component.html',\n styleUrl: './editor-drawer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SunEditorDrawer<T extends Record<string, any>> {\n readonly editor = input.required<Editor<T>>();\n readonly width = input<string | number>(600);\n // TODO: 有些 model 不一定有 primaryKey,可能是两个 foreignKeys,所以要考虑将 operation 变为一个函数\n // 考虑直接做到 signal 版本里,这里就变成一个 computed fn\n readonly primaryKey = input('id');\n\n readonly visibleChange = output<boolean>();\n}\n","<nz-drawer\n nzWrapClassName=\"sun-editor-drawer-wrapper\"\n [nzWidth]=\"width()\"\n [nzClosable]=\"false\"\n [nzTitle]=\"editorTitle\"\n [nzFooter]=\"editorFooter\"\n [nzVisible]=\"editor().visible()\"\n (nzVisibleChange)=\"visibleChange.emit($event); $event || editor().reset()\"\n (nzOnClose)=\"editor().dismiss()\">\n <nz-spin *nzDrawerContent [nzSpinning]=\"editor().loading()\">\n <ng-content />\n </nz-spin>\n</nz-drawer>\n\n<ng-template #editorTitle>\n <div>{{ editor().model[primaryKey()] ? '编辑条目' : '新增条目' }}</div>\n\n <nz-icon nzType=\"pushpin\" [nzTheme]=\"editor().pin() ? 'twotone' : 'outline'\" (click)=\"editor().togglePin()\"></nz-icon>\n</ng-template>\n\n<ng-template #editorFooter>\n <small nz-typography nzType=\"secondary\">\n 注意:标签上带有\n <span nz-typography nzType=\"danger\" style=\"font-family: SimSun, sans-serif\">*</span>\n 符号的项目为必填项\n </small>\n</ng-template>\n","import { FormGroup } from '@angular/forms';\nimport { form } from '@fluent-form/ui-zorro';\n\nexport class Searcher<T> {\n form?: FormGroup;\n model: Partial<T> = {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n schema = form(() => { });\n\n pageSize = 10;\n pageNo = 1;\n\n reset() {\n this.pageNo = 1;\n this.form?.reset({});\n }\n}\n","import { inject } from '@angular/core';\nimport { MessageService } from '@solar-angular/ui-zorro/message';\nimport { finalize, Observable } from 'rxjs';\nimport { Editor } from './editor';\nimport { Searcher } from './searcher';\n\n/**\n * 增删改查页面\n * @template T Searcher 的模型类型\n * @template U Editor 的模型类型,默认为 T\n * @template V Data 的模型类型,默认为 U\n */\nexport abstract class CrudPage<T, U = T, V = U> {\n protected data: V[] = [];\n\n protected loading = false;\n\n protected searcher = new Searcher<T>();\n protected editor = new Editor<U>();\n\n /**\n * @deprecated 请使用 {@link Searcher.pageSize}\n */\n protected get pageSize() {\n return this.searcher.pageSize;\n }\n /**\n * @deprecated 请使用 {@link Searcher.pageSize}\n */\n protected set pageSize(value) {\n this.searcher.pageSize = value;\n }\n /**\n * @deprecated 请使用 {@link Searcher.pageNo}\n */\n protected get pageNo() {\n return this.searcher.pageNo;\n }\n /**\n * @deprecated 请使用 {@link Searcher.pageNo}\n */\n protected set pageNo(value) {\n this.searcher.pageNo = value;\n }\n\n readonly message = inject(MessageService);\n\n protected withTableLoading<X>() {\n return (observable: Observable<X>) => {\n this.loading = true;\n return observable.pipe(\n finalize(() => this.loading = false)\n );\n };\n }\n\n /**\n * {@link MessageService.withLoading()} 的快捷方式\n * @param content\n */\n protected withLoading<X>(content?: string) {\n return this.message.withLoading<X>(content);\n }\n\n /**\n * {@link MessageService.withDeleteLoading()} 的快捷方式\n * @param content\n */\n protected withDeleteLoading<X>() {\n return this.message.withDeleteLoading<X>();\n }\n\n /**\n * {@link MessageService.withSaveLoading()} 的快捷方式\n * @param content\n */\n protected withSaveLoading<X>() {\n return this.message.withSaveLoading<X>();\n }\n\n /**\n * 编辑\n * @param entity\n */\n protected edit(entity: U) {\n this.editor.fill(entity);\n this.editor.present();\n }\n}\n\n/**\n * 带分页的增删改查页面\n * @template T Searcher 的模型类型\n * @template U Editor 的模型类型,默认为 T\n * @template V Data 的模型类型,默认为 U\n */\nexport abstract class PagingCrudPage<T, U = T, V = U> extends CrudPage<T, U, V> {\n protected totalSize!: number;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAKa,MAAM,CAAA;AAAnB,IAAA,WAAA,GAAA;AACW,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;;QAEhC,IAAa,CAAA,aAAA,GAAM,EAAO;QAC1B,IAAK,CAAA,KAAA,GAAM,EAAO;AACT,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;;QAEhC,IAAM,CAAA,MAAA,GAAG,IAAI,CAAC,MAAQ,GAAC,CAAC;;AAEf,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;;AAG5B;;AAEG;IACH,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QACtB,OAAO,CAAC,UAAyB,KAAI;AACnC,YAAA,OAAO,UAAU,CAAC,IAAI,CACpB,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CACxC;AACH,SAAC;;AAGH;;AAEG;IACH,UAAU,GAAA;AACR,QAAA,OAAO,CAAC,UAAyB,KAAK,UAAU,CAAC,IAAI,CACnD,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CACtD;;AAGH;;AAEG;IACH,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;;AAGxB;;AAEG;IACH,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;;IAGzB,SAAS,GAAA;AACP,QAAA,I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Q,CAAC,MAAM;;AAE7B;;AAEG;IACH,IAAc,MAAM,CAAC,KAAK,EAAA;AACxB,QAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,KAAK;;IAKpB,gBAAgB,GAAA;QACxB,OAAO,CAAC,UAAyB,KAAI;AACnC,YAAA,IAAI,CAAC,OAAO,GAAG,IAAI;AACnB,YAAA,OAAO,UAAU,CAAC,IAAI,CACpB,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,CACrC;AACH,SAAC;;AAGH;;;AAGG;AACO,IAAA,WAAW,CAAI,OAAgB,EAAA;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAI,OAAO,CAAC;;AAG7C;;;AAGG;IACO,iBAAiB,GAAA;AACzB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAK;;AAG5C;;;AAGG;IACO,eAAe,GAAA;AACvB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAK;;AAG1C;;;AAGG;AACO,IAAA,IAAI,CAAC,MAAS,EAAA;AACtB,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;AACxB,QAAA,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;;AAExB;AAED;;;;;AAKG;AACG,MAAgB,cAAgC,SAAQ,QAAiB,CAAA;AAE9E;;AClGD;;AAEG;;;;"}
1
+ {"version":3,"file":"solar-angular-ui-zorro-crud.mjs","sources":["../../../packages/ui-zorro/crud/editor.ts","../../../packages/ui-zorro/crud/editor-drawer/editor-drawer.component.ts","../../../packages/ui-zorro/crud/editor-drawer/editor-drawer.component.html","../../../packages/ui-zorro/crud/searcher.ts","../../../packages/ui-zorro/crud/page.ts","../../../packages/ui-zorro/crud/solar-angular-ui-zorro-crud.ts"],"sourcesContent":["import { signal } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { form } from '@fluent-form/ui-zorro';\nimport { Observable, finalize, tap } from 'rxjs';\n\nexport class Editor<T> {\n readonly visible = signal(false);\n readonly loading = signal(false);\n readonly pin = signal(false);\n readonly _model = signal<T>({} as T);\n\n get model() {\n return this._model();\n }\n set model(value: T) {\n this._model.set(value);\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n schema = form(() => { });\n form?: FormGroup;\n\n /**\n * 自动控制 loading 状态\n */\n withLoading<X>() {\n this.loading.set(true);\n return (observable: Observable<X>) => {\n return observable.pipe(\n finalize(() => this.loading.set(false))\n );\n };\n }\n\n /**\n * next 时自动重置表单 或 收起编辑器\n */\n withAttach<X>() {\n return (observable: Observable<X>) => observable.pipe(\n tap(() => this.pin() ? this.reset() : this.dismiss())\n );\n }\n\n /**\n * 呈现编辑器\n */\n present() {\n this.visible.set(true);\n }\n\n /**\n * 关闭编辑器\n */\n dismiss() {\n this.visible.set(false);\n }\n\n togglePin() {\n this.pin.update(value => !value);\n }\n\n reset() {\n this.form?.reset();\n }\n\n fill(model: T) {\n this.model = model;\n }\n}\n","import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { NzDrawerModule } from 'ng-zorro-antd/drawer';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzSpinModule } from 'ng-zorro-antd/spin';\nimport { NzTypographyModule } from 'ng-zorro-antd/typography';\nimport { Editor } from '../editor';\n\n@Component({\n selector: 'sun-editor-drawer',\n imports: [\n NzDrawerModule,\n NzSpinModule,\n NzIconModule,\n NzTypographyModule\n ],\n templateUrl: './editor-drawer.component.html',\n styleUrl: './editor-drawer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SunEditorDrawer<T extends Record<string, any>> {\n readonly editor = input.required<Editor<T>>();\n readonly width = input<string | number>(600);\n // TODO: 有些 model 不一定有 primaryKey,可能是两个 foreignKeys,所以要考虑将 operation 变为一个函数\n // 考虑直接做到 signal 版本里,这里就变成一个 computed fn\n readonly primaryKey = input('id');\n\n readonly visibleChange = output<boolean>();\n}\n","<nz-drawer\n nzWrapClassName=\"sun-editor-drawer-wrapper\"\n [nzWidth]=\"width()\"\n [nzClosable]=\"false\"\n [nzTitle]=\"editorTitle\"\n [nzFooter]=\"editorFooter\"\n [nzVisible]=\"editor().visible()\"\n (nzVisibleChange)=\"visibleChange.emit($event); $event || editor().reset()\"\n (nzOnClose)=\"editor().dismiss()\">\n <nz-spin *nzDrawerContent [nzSpinning]=\"editor().loading()\">\n <ng-content />\n </nz-spin>\n</nz-drawer>\n\n<ng-template #editorTitle>\n <div>{{ editor().model[primaryKey()] ? '编辑条目' : '新增条目' }}</div>\n\n <nz-icon nzType=\"pushpin\" [nzTheme]=\"editor().pin() ? 'twotone' : 'outline'\" (click)=\"editor().togglePin()\"></nz-icon>\n</ng-template>\n\n<ng-template #editorFooter>\n <small nz-typography nzType=\"secondary\">\n 注意:标签上带有\n <span nz-typography nzType=\"danger\" style=\"font-family: SimSun, sans-serif\">*</span>\n 符号的项目为必填项\n </small>\n</ng-template>\n","import { FormGroup } from '@angular/forms';\nimport { form } from '@fluent-form/ui-zorro';\n\nexport class Searcher<T> {\n form?: FormGroup;\n model: Partial<T> = {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n schema = form(() => { });\n\n pageSize = 10;\n pageNo = 1;\n\n reset() {\n this.pageNo = 1;\n this.form?.reset({});\n }\n}\n","import { inject } from '@angular/core';\nimport { MessageService } from '@solar-angular/ui-zorro/message';\nimport { finalize, Observable } from 'rxjs';\nimport { Editor } from './editor';\nimport { Searcher } from './searcher';\n\n/**\n * 增删改查页面\n * @template T Searcher 的模型类型\n * @template U Editor 的模型类型,默认为 T\n * @template V Data 的模型类型,默认为 U\n */\nexport abstract class CrudPage<T, U = T, V = U> {\n protected data: V[] = [];\n\n protected loading = false;\n\n protected searcher = new Searcher<T>();\n protected editor = new Editor<U>();\n\n /**\n * @deprecated 请使用 {@link Searcher.pageSize}\n */\n protected get pageSize() {\n return this.searcher.pageSize;\n }\n /**\n * @deprecated 请使用 {@link Searcher.pageSize}\n */\n protected set pageSize(value) {\n this.searcher.pageSize = value;\n }\n /**\n * @deprecated 请使用 {@link Searcher.pageNo}\n */\n protected get pageNo() {\n return this.searcher.pageNo;\n }\n /**\n * @deprecated 请使用 {@link Searcher.pageNo}\n */\n protected set pageNo(value) {\n this.searcher.pageNo = value;\n }\n\n readonly message = inject(MessageService);\n\n protected withTableLoading<X>() {\n return (observable: Observable<X>) => {\n this.loading = true;\n return observable.pipe(\n finalize(() => this.loading = false)\n );\n };\n }\n\n /**\n * {@link MessageService.withLoading()} 的快捷方式\n * @param content\n */\n protected withLoading<X>(content?: string) {\n return this.message.withLoading<X>(content);\n }\n\n /**\n * {@link MessageService.withDeleteLoading()} 的快捷方式\n * @param content\n */\n protected withDeleteLoading<X>() {\n return this.message.withDeleteLoading<X>();\n }\n\n /**\n * {@link MessageService.withSaveLoading()} 的快捷方式\n * @param content\n */\n protected withSaveLoading<X>() {\n return this.message.withSaveLoading<X>();\n }\n\n /**\n * 编辑\n * @param entity\n */\n protected edit(entity: U) {\n this.editor.fill(entity);\n this.editor.present();\n }\n}\n\n/**\n * 带分页的增删改查页面\n * @template T Searcher 的模型类型\n * @template U Editor 的模型类型,默认为 T\n * @template V Data 的模型类型,默认为 U\n */\nexport abstract class PagingCrudPage<T, U = T, V = U> extends CrudPage<T, U, V> {\n protected totalSize!: number;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAKa,MAAM,CAAA;AAAnB,IAAA,WAAA,GAAA;AACW,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;AACvB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;AACvB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;AACnB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAI,EAAO,CAAC;;QASpC,IAAM,CAAA,MAAA,GAAG,IAAI,CAAC,MAA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,CAAC,WAAW,CAAI,OAAO,CAAC;;AAG7C;;;AAGG;IACO,iBAAiB,GAAA;AACzB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAK;;AAG5C;;;AAGG;IACO,eAAe,GAAA;AACvB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAK;;AAG1C;;;AAGG;AACO,IAAA,IAAI,CAAC,MAAS,EAAA;AACtB,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;AACxB,QAAA,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;;AAExB;AAED;;;;;AAKG;AACG,MAAgB,cAAgC,SAAQ,QAAiB,CAAA;AAE9E;;AClGD;;AAEG;;;;"}
@@ -24,10 +24,10 @@ class SunFanPopover {
24
24
  this.visibleChange = output();
25
25
  this.unbind = output();
26
26
  }
27
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunFanPopover, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
28
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.14", type: SunFanPopover, isStandalone: true, selector: "sun-fan-popover", inputs: { fan: { classPropertyName: "fan", publicName: "fan", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange", unbind: "unbind" }, ngImport: i0, template: "<a\n nz-typography\n nz-popover\n [nzPopoverPlacement]=\"placement()\"\n [nzPopoverTrigger]=\"trigger()\"\n [nzDisabled]=\"disabled()\"\n [nzPopoverContent]=\"fanTemplate\"\n (nzPopoverVisibleChange)=\"visibleChange.emit($event)\">\n <ng-content>\n <nz-icon nzType=\"wechat\"></nz-icon>\n </ng-content>\n</a>\n\n<ng-template #fanTemplate>\n <nz-space nzAlign=\"center\" nzDirection=\"vertical\" [nzSize]=\"6\">\n <nz-avatar\n *nzSpaceItem\n nzIcon=\"user\"\n [nzSize]=\"48\"\n [nzSrc]=\"fan()?.avatar?.thumbnailUrl || fan()?.avatarUrl\"\n [style.margin-top.px]=\"2\" />\n <div *nzSpaceItem>{{ fan()?.fullName || fan()?.nickName || '\u5FAE\u4FE1\u7528\u6237' }}</div>\n <button *nzSpaceItem nz-button nzSize=\"small\" nzDanger nzBlock nzType=\"primary\" (click)=\"unbind.emit()\">\n \u89E3\u7ED1\n </button>\n </nz-space>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: NzPopoverModule }, { kind: "directive", type: i1.NzPopoverDirective, selector: "[nz-popover]", inputs: ["nzPopoverArrowPointAtCenter", "nzPopoverTitle", "nzPopoverContent", "nz-popover", "nzPopoverTrigger", "nzPopoverPlacement", "nzPopoverOrigin", "nzPopoverVisible", "nzPopoverMouseEnterDelay", "nzPopoverMouseLeaveDelay", "nzPopoverOverlayClassName", "nzPopoverOverlayStyle", "nzPopoverOverlayClickable", "nzPopoverBackdrop"], outputs: ["nzPopoverVisibleChange"], exportAs: ["nzPopover"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzTypographyModule }, { kind: "component", type: i3.NzTypographyComponent, selector: " nz-typography, [nz-typography], p[nz-paragraph], span[nz-text], h1[nz-title], h2[nz-title], h3[nz-title], h4[nz-title] ", inputs: ["nzCopyable", "nzEditable", "nzDisabled", "nzExpandable", "nzEllipsis", "nzCopyTooltips", "nzCopyIcons", "nzEditTooltip", "nzEditIcon", "nzContent", "nzEllipsisRows", "nzType", "nzCopyText", "nzSuffix"], outputs: ["nzContentChange", "nzCopy", "nzExpandChange", "nzOnEllipsis"], exportAs: ["nzTypography"] }, { kind: "ngmodule", type: NzSpaceModule }, { kind: "component", type: i4.NzSpaceComponent, selector: "nz-space, [nz-space]", inputs: ["nzDirection", "nzAlign", "nzSplit", "nzWrap", "nzSize"], exportAs: ["nzSpace"] }, { kind: "directive", type: i4.NzSpaceItemDirective, selector: "[nzSpaceItem]" }, { kind: "ngmodule", type: NzAvatarModule }, { kind: "component", type: i5.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i6.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i7.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
27
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunFanPopover, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
28
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.15", type: SunFanPopover, isStandalone: true, selector: "sun-fan-popover", inputs: { fan: { classPropertyName: "fan", publicName: "fan", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange", unbind: "unbind" }, ngImport: i0, template: "<a\n nz-typography\n nz-popover\n [nzPopoverPlacement]=\"placement()\"\n [nzPopoverTrigger]=\"trigger()\"\n [nzDisabled]=\"disabled()\"\n [nzPopoverContent]=\"fanTemplate\"\n (nzPopoverVisibleChange)=\"visibleChange.emit($event)\">\n <ng-content>\n <nz-icon nzType=\"wechat\"></nz-icon>\n </ng-content>\n</a>\n\n<ng-template #fanTemplate>\n <nz-space nzAlign=\"center\" nzDirection=\"vertical\" [nzSize]=\"6\">\n <nz-avatar\n *nzSpaceItem\n nzIcon=\"user\"\n [nzSize]=\"48\"\n [nzSrc]=\"fan()?.avatar?.thumbnailUrl || fan()?.avatarUrl\"\n [style.margin-top.px]=\"2\" />\n <div *nzSpaceItem>{{ fan()?.fullName || fan()?.nickName || '\u5FAE\u4FE1\u7528\u6237' }}</div>\n <button *nzSpaceItem nz-button nzSize=\"small\" nzDanger nzBlock nzType=\"primary\" (click)=\"unbind.emit()\">\n \u89E3\u7ED1\n </button>\n </nz-space>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: NzPopoverModule }, { kind: "directive", type: i1.NzPopoverDirective, selector: "[nz-popover]", inputs: ["nzPopoverArrowPointAtCenter", "nzPopoverTitle", "nzPopoverContent", "nz-popover", "nzPopoverTrigger", "nzPopoverPlacement", "nzPopoverOrigin", "nzPopoverVisible", "nzPopoverMouseEnterDelay", "nzPopoverMouseLeaveDelay", "nzPopoverOverlayClassName", "nzPopoverOverlayStyle", "nzPopoverOverlayClickable", "nzPopoverBackdrop"], outputs: ["nzPopoverVisibleChange"], exportAs: ["nzPopover"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzTypographyModule }, { kind: "component", type: i3.NzTypographyComponent, selector: " nz-typography, [nz-typography], p[nz-paragraph], span[nz-text], h1[nz-title], h2[nz-title], h3[nz-title], h4[nz-title] ", inputs: ["nzCopyable", "nzEditable", "nzDisabled", "nzExpandable", "nzEllipsis", "nzCopyTooltips", "nzCopyIcons", "nzEditTooltip", "nzEditIcon", "nzContent", "nzEllipsisRows", "nzType", "nzCopyText", "nzSuffix"], outputs: ["nzContentChange", "nzCopy", "nzExpandChange", "nzOnEllipsis"], exportAs: ["nzTypography"] }, { kind: "ngmodule", type: NzSpaceModule }, { kind: "component", type: i4.NzSpaceComponent, selector: "nz-space, [nz-space]", inputs: ["nzDirection", "nzAlign", "nzSplit", "nzWrap", "nzSize"], exportAs: ["nzSpace"] }, { kind: "directive", type: i4.NzSpaceItemDirective, selector: "[nzSpaceItem]" }, { kind: "ngmodule", type: NzAvatarModule }, { kind: "component", type: i5.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i6.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i7.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
29
29
  }
30
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunFanPopover, decorators: [{
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunFanPopover, decorators: [{
31
31
  type: Component,
32
32
  args: [{ selector: 'sun-fan-popover', imports: [
33
33
  NzPopoverModule,
@@ -1,6 +1,7 @@
1
+ import { FormGroup, FormArray } from '@angular/forms';
1
2
  import { button, textField, numberField, toggle, radioGroup, cascader, datePicker, dateRangePicker, form } from '@fluent-form/ui-zorro';
2
3
  import { levels2tree, tree2list } from '@solar-kit/core';
3
- import { headless } from '@fluent-form/core';
4
+ import { headless, SchemaType } from '@fluent-form/core';
4
5
 
5
6
  function searchButton() {
6
7
  return button().icon('search').content('查询').type('primary');
@@ -8,19 +9,37 @@ function searchButton() {
8
9
  function addButton() {
9
10
  return button().icon('plus').content('新增').type('primary').mode('button');
10
11
  }
11
- function saveButton() {
12
- return button()
13
- .content('保存')
14
- .type('primary')
15
- .variants({ block: true })
16
- .disabled(({ control }) => control.invalid);
17
- }
18
12
  function submitButton() {
19
13
  return button()
20
14
  .content('提交')
21
15
  .type('primary')
22
16
  .variants({ block: true })
23
- .disabled(({ control }) => control.invalid);
17
+ .listeners({
18
+ click: (event, context) => {
19
+ const rootForm = context.control;
20
+ updateValidityEach(rootForm);
21
+ if (rootForm.invalid) {
22
+ event.preventDefault();
23
+ }
24
+ }
25
+ });
26
+ }
27
+ /**
28
+ * Alias of {@link submitButton}
29
+ */
30
+ const saveButton = submitButton;
31
+ function updateValidityEach(form) {
32
+ for (const control of Object.values(form.controls)) {
33
+ if (control instanceof FormGroup || control instanceof FormArray) {
34
+ updateValidityEach(control);
35
+ }
36
+ else {
37
+ if (control.invalid) {
38
+ control.markAsDirty();
39
+ control.updateValueAndValidity({ onlySelf: true });
40
+ }
41
+ }
42
+ }
24
43
  }
25
44
 
26
45
  function entityToOption(entity) {
@@ -165,10 +184,30 @@ function useImprovedPickerPatchers() {
165
184
  }
166
185
  ];
167
186
  }
187
+ function useValidationTipsPatchers() {
188
+ return {
189
+ selector: SchemaType.Control,
190
+ patch: schema => {
191
+ schema['tips'] ??= {};
192
+ schema['tips'].auto = {
193
+ default: {
194
+ min: '输入数值过小',
195
+ max: '输入数值过大',
196
+ minlength: '输入内容过短',
197
+ maxlength: '输入内容过长',
198
+ email: '请输入正确的邮箱地址',
199
+ pattern: '输入内容格式不正确',
200
+ required: '请填写' + (schema['label'] ? parseLabel(schema['label']) : '')
201
+ }
202
+ };
203
+ return schema;
204
+ }
205
+ };
206
+ }
168
207
 
169
208
  /**
170
209
  * Generated bundle index. Do not edit.
171
210
  */
172
211
 
173
- export { addButton, categoryCascader, cellphoneField, datetimePicker, datetimeRangePicker, enabledToggle, entitiesToOptions, entityForm, entityToOption, finishedToggle, genderRadioGroup, integerField, leafCascader, saveButton, searchButton, submitButton, useAutoPlaceholderPatchers, useImprovedPickerPatchers };
212
+ export { addButton, categoryCascader, cellphoneField, datetimePicker, datetimeRangePicker, enabledToggle, entitiesToOptions, entityForm, entityToOption, finishedToggle, genderRadioGroup, integerField, leafCascader, saveButton, searchButton, submitButton, useAutoPlaceholderPatchers, useImprovedPickerPatchers, useValidationTipsPatchers };
174
213
  //# sourceMappingURL=solar-angular-ui-zorro-fluent-form.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"solar-angular-ui-zorro-fluent-form.mjs","sources":["../../../packages/ui-zorro/fluent-form/components.ts","../../../packages/ui-zorro/fluent-form/helper.ts","../../../packages/ui-zorro/fluent-form/controls.ts","../../../packages/ui-zorro/fluent-form/form.ts","../../../packages/ui-zorro/fluent-form/patchers.ts","../../../packages/ui-zorro/fluent-form/solar-angular-ui-zorro-fluent-form.ts"],"sourcesContent":["import { UnstableBuilder } from '@fluent-form/core';\nimport { button, ButtonComponentSchema } from '@fluent-form/ui-zorro';\nimport { KindOrKey } from './typing';\n\nexport function searchButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'icon' | 'content' | 'type'> {\n return button().icon('search').content('查询').type('primary');\n}\n\nexport function addButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'icon' | 'content' | 'type' | 'mode'> {\n return button().icon('plus').content('新增').type('primary').mode('button');\n}\n\nexport function saveButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'content' | 'type' | 'disabled'> {\n return button()\n .content('保存')\n .type('primary')\n .variants({ block: true })\n .disabled(({ control }) => control.invalid) as UnstableBuilder<ButtonComponentSchema, KindOrKey | 'content' | 'type' | 'disabled'>;\n}\n\nexport function submitButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'content' | 'type' | 'disabled'> {\n return button()\n .content('提交')\n .type('primary')\n .variants({ block: true })\n .disabled(({ control }) => control.invalid) as UnstableBuilder<ButtonComponentSchema, KindOrKey | 'content' | 'type' | 'disabled'>;\n}\n","\nexport function entityToOption<T extends { id: string | number, fullName: string }>(entity: T) {\n return { label: entity.fullName, value: entity.id, ...entity };\n}\n\nexport function entitiesToOptions<T extends { id: string | number, fullName: string }>(entities: T[]) {\n return entities.map(entity => entityToOption(entity));\n}\n","import { SchemaKey, SingleSchemaKey, UnstableBuilder } from '@fluent-form/core';\nimport { CascaderControlSchema, DatePickerControlSchema, DateRangePickerControlSchema, NumberFieldControlSchema, RadioGroupControlSchema, TextFieldControlSchema, ToggleControlSchema, cascader, datePicker, dateRangePicker, numberField, radioGroup, textField, toggle } from '@fluent-form/ui-zorro';\nimport { TreeNode, levels2tree, tree2list } from '@solar-kit/core';\nimport { Category, Channel } from '@solar-kit/planets/earth';\nimport { Gender } from '@solar-kit/planets/sun';\nimport { NzCascaderOption } from 'ng-zorro-antd/cascader';\nimport { entitiesToOptions } from './helper';\nimport { KindOrKey } from './typing';\n\nexport function cellphoneField(key = 'cellphone', length = 11): UnstableBuilder<TextFieldControlSchema, KindOrKey | 'type' | 'length'> {\n return textField(key).type('tel').length(length);\n}\n\nexport function integerField(key: SingleSchemaKey): UnstableBuilder<NumberFieldControlSchema, KindOrKey | 'precision'> {\n return numberField(key).precision(0);\n}\n\nexport function enabledToggle(key: SingleSchemaKey = 'enabled', defaultValue = true): UnstableBuilder<ToggleControlSchema, KindOrKey | 'placeholder' | 'defaultValue'> {\n return toggle(key).placeholder(['有效', '无效']).defaultValue(defaultValue);\n}\n\nexport function finishedToggle(key: SingleSchemaKey = 'finished', defaultValue = false): UnstableBuilder<ToggleControlSchema, KindOrKey | 'placeholder' | 'defaultValue'> {\n return toggle(key).placeholder(['已完成', '未完成']).defaultValue(defaultValue);\n}\n\nexport function genderRadioGroup(key = 'gender'): UnstableBuilder<RadioGroupControlSchema, KindOrKey | 'options'> {\n return radioGroup(key).options([\n { label: '女', value: Gender.Woman },\n { label: '男', value: Gender.Man }\n ]);\n}\n\nexport function categoryCascader(key: SingleSchemaKey, channels: Channel[], categories: Category[]): UnstableBuilder<CascaderControlSchema<SingleSchemaKey>, KindOrKey | 'options' | 'trigger' | 'mapper'> {\n return leafCascader(key).options(\n levels2tree(\n [\n entitiesToOptions(channels as { id: number, fullName: string, channel?: number }[]),\n entitiesToOptions(categories)\n ],\n { id: 'value', pid: 'channel' }\n )\n );\n}\n\n/**\n * 叶子节点级联选择器\n *\n * options 选项可以使用 `list2tree()` 或 `levels2tree()` 来构造\n *\n * @param key\n */\nexport function leafCascader(key: SingleSchemaKey): UnstableBuilder<CascaderControlSchema<SingleSchemaKey>, KindOrKey | 'trigger' | 'mapper'> {\n let list: TreeNode<NzCascaderOption>[];\n\n return cascader(key)\n .trigger('hover')\n .mapper({\n parser: (value: NzCascaderOption['value'] | null, schema) => {\n if (!value) return null;\n\n // 如果输入的是叶子节点,我们需要转为 [父节点, ..., 叶子节点]\n list ??= tree2list((schema as CascaderControlSchema).options as TreeNode<NzCascaderOption>[]);\n // 找到选中的叶子节点\n let node = list.find(node => node.value === value && (!node.children || node.children.length === 0));\n\n const levels = [];\n\n while (node) {\n levels.unshift(node.value);\n node = node.parent;\n }\n\n return levels;\n },\n formatter: value => {\n // 输出的是节点数组,我们只要叶子节点\n return value?.[value.length - 1];\n }\n })\n}\n\nexport function datetimePicker(key: string, format = 'yyyy-MM-dd HH:mm'): UnstableBuilder<DatePickerControlSchema, KindOrKey | 'time' | 'format'> {\n return datePicker(key)\n .time({ nzFormat: 'HH:mm' })\n .format(format);\n}\n\nexport function datetimeRangePicker(key: SchemaKey, format = 'yyyy-MM-dd HH:mm'): UnstableBuilder<DateRangePickerControlSchema, KindOrKey | 'time' | 'format'> {\n return dateRangePicker(key)\n .time({ nzFormat: 'HH:mm' })\n .format(format);\n}\n","import { Builder, headless, SingleSchemaKey } from '@fluent-form/core';\nimport { form, FormGroupSchema } from '@fluent-form/ui-zorro';\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\n/**\n * 实体表单\n *\n * 内置了一个 Headless ID 控件图示:`headless('id')`\n */\nexport function entityForm(composeFn: (it: Builder<FormGroupSchema<SingleSchemaKey>>) => NzSafeAny) {\n return form(it => {\n headless('id');\n composeFn(it);\n });\n}\n","import { SchemaPatcher } from '@fluent-form/core';\nimport { AbstractZorroControlSchema, Label } from '@fluent-form/ui-zorro';\n\nfunction parseLabel(label: string | Label): string {\n if (typeof label === 'string') {\n return label;\n }\n\n return label.content ?? '';\n}\n\nfunction autoPlaceholder(schema: AbstractZorroControlSchema, action: string) {\n const label = schema['label'];\n\n if (label && typeof label !== 'function') {\n (schema as any)['placeholder'] ??= action + parseLabel(label);\n }\n\n return schema;\n}\n\n/**\n * 为文本框字段自动添加 placeholder\n */\nexport function useAutoPlaceholderPatchers(): SchemaPatcher[] {\n return [\n {\n selector: ['text-field', 'number-field'],\n patch: schema => autoPlaceholder(schema, '请输入')\n },\n {\n selector: 'text-area',\n patch: schema => autoPlaceholder(schema, '请填写')\n },\n {\n selector: ['date-picker', 'time-picker', 'select', 'cascader', 'tree-select'],\n patch: schema => autoPlaceholder(schema, '请选择')\n }\n ];\n}\n\n/**\n * 1. 自动为非必填字段添加清除按钮\n * 2. 为选择器添加搜索功能\n */\nexport function useImprovedPickerPatchers(): SchemaPatcher[] {\n return [\n {\n selector: ['date-picker', 'date-range-picker', 'time-picker', 'select', 'cascader', 'tree-select'],\n patch: schema => {\n if (!schema['required']) {\n schema['clearable'] ??= true;\n }\n\n return schema;\n }\n },\n {\n selector: ['select', 'cascader', 'tree-select'],\n patch: schema => {\n schema['searchable'] ??= true;\n\n return schema;\n }\n }\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;SAIgB,YAAY,GAAA;AAC1B,IAAA,OAAO,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;AAC9D;SAEgB,SAAS,GAAA;IACvB,OAAO,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC3E;SAEgB,UAAU,GAAA;AACxB,IAAA,OAAO,MAAM;SACV,OAAO,CAAC,IAAI;SACZ,IAAI,CAAC,SAAS;AACd,SAAA,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AACxB,SAAA,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAwF;AACtI;SAEgB,YAAY,GAAA;AAC1B,IAAA,OAAO,MAAM;SACV,OAAO,CAAC,IAAI;SACZ,IAAI,CAAC,SAAS;AACd,SAAA,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AACxB,SAAA,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAwF;AACtI;;ACzBM,SAAU,cAAc,CAAsD,MAAS,EAAA;AAC3F,IAAA,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,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AC/C;KACF;AACH;AAEA;;;AAGG;SACa,yBAAyB,GAAA;IACvC,OAAO;AACL,QAAA;AACE,YAAA,QAAQ,EAAE,CAAC,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAC;YAClG,KAAK,EAAE,MAAM,IAAG;AACd,gBAAA,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;AACvB,oBAAA,MAAM,CAAC,WAAW,CAAC,KAAK,IAAI;;AAG9B,gBAAA,OAAO,MAAM;;AAEhB,SAAA;AACD,QAAA;AACE,YAAA,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAC;YAC/C,KAAK,EAAE,MAAM,IAAG;AACd,gBAAA,MAAM,CAAC,YAAY,CAAC,KAAK,IAAI;AAE7B,gBAAA,OAAO,MAAM;;AAEhB;KACF;AACH;;AClEA;;AAEG;;;;"}
1
+ {"version":3,"file":"solar-angular-ui-zorro-fluent-form.mjs","sources":["../../../packages/ui-zorro/fluent-form/components.ts","../../../packages/ui-zorro/fluent-form/helper.ts","../../../packages/ui-zorro/fluent-form/controls.ts","../../../packages/ui-zorro/fluent-form/form.ts","../../../packages/ui-zorro/fluent-form/patchers.ts","../../../packages/ui-zorro/fluent-form/solar-angular-ui-zorro-fluent-form.ts"],"sourcesContent":["import { FormArray, FormGroup } from '@angular/forms';\nimport { UnstableBuilder } from '@fluent-form/core';\nimport { button, ButtonComponentSchema } from '@fluent-form/ui-zorro';\nimport { KindOrKey } from './typing';\n\nexport function searchButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'icon' | 'content' | 'type'> {\n return button().icon('search').content('查询').type('primary');\n}\n\nexport function addButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'icon' | 'content' | 'type' | 'mode'> {\n return button().icon('plus').content('新增').type('primary').mode('button');\n}\n\nexport function submitButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'content' | 'type' | 'variants' | 'listeners'> {\n return button()\n .content('提交')\n .type('primary')\n .variants({ block: true })\n .listeners({\n click: (event, context) => {\n const rootForm = context.control as FormGroup\n updateValidityEach(rootForm)\n if (rootForm.invalid) {\n event.preventDefault()\n }\n }\n })\n}\n\n/**\n * Alias of {@link submitButton}\n */\nexport const saveButton = submitButton;\n\nfunction updateValidityEach(form: FormGroup | FormArray): void {\n for (const control of Object.values(form.controls)) {\n if (control instanceof FormGroup || control instanceof FormArray) {\n updateValidityEach(control);\n } else {\n if (control.invalid) {\n control.markAsDirty();\n control.updateValueAndValidity({ onlySelf: true });\n }\n }\n }\n}\n","\nexport function entityToOption<T extends { id: string | number, fullName: string }>(entity: T) {\n return { label: entity.fullName, value: entity.id, ...entity };\n}\n\nexport function entitiesToOptions<T extends { id: string | number, fullName: string }>(entities: T[]) {\n return entities.map(entity => entityToOption(entity));\n}\n","import { SchemaKey, SingleSchemaKey, UnstableBuilder } from '@fluent-form/core';\nimport { CascaderControlSchema, DatePickerControlSchema, DateRangePickerControlSchema, NumberFieldControlSchema, RadioGroupControlSchema, TextFieldControlSchema, ToggleControlSchema, cascader, datePicker, dateRangePicker, numberField, radioGroup, textField, toggle } from '@fluent-form/ui-zorro';\nimport { TreeNode, levels2tree, tree2list } from '@solar-kit/core';\nimport { Category, Channel } from '@solar-kit/planets/earth';\nimport { Gender } from '@solar-kit/planets/sun';\nimport { NzCascaderOption } from 'ng-zorro-antd/cascader';\nimport { entitiesToOptions } from './helper';\nimport { KindOrKey } from './typing';\n\nexport function cellphoneField(key = 'cellphone', length = 11): UnstableBuilder<TextFieldControlSchema, KindOrKey | 'type' | 'length'> {\n return textField(key).type('tel').length(length);\n}\n\nexport function integerField(key: SingleSchemaKey): UnstableBuilder<NumberFieldControlSchema, KindOrKey | 'precision'> {\n return numberField(key).precision(0);\n}\n\nexport function enabledToggle(key: SingleSchemaKey = 'enabled', defaultValue = true): UnstableBuilder<ToggleControlSchema, KindOrKey | 'placeholder' | 'defaultValue'> {\n return toggle(key).placeholder(['有效', '无效']).defaultValue(defaultValue);\n}\n\nexport function finishedToggle(key: SingleSchemaKey = 'finished', defaultValue = false): UnstableBuilder<ToggleControlSchema, KindOrKey | 'placeholder' | 'defaultValue'> {\n return toggle(key).placeholder(['已完成', '未完成']).defaultValue(defaultValue);\n}\n\nexport function genderRadioGroup(key = 'gender'): UnstableBuilder<RadioGroupControlSchema, KindOrKey | 'options'> {\n return radioGroup(key).options([\n { label: '女', value: Gender.Woman },\n { label: '男', value: Gender.Man }\n ]);\n}\n\nexport function categoryCascader(key: SingleSchemaKey, channels: Channel[], categories: Category[]): UnstableBuilder<CascaderControlSchema<SingleSchemaKey>, KindOrKey | 'options' | 'trigger' | 'mapper'> {\n return leafCascader(key).options(\n levels2tree(\n [\n entitiesToOptions(channels as { id: number, fullName: string, channel?: number }[]),\n entitiesToOptions(categories)\n ],\n { id: 'value', pid: 'channel' }\n )\n );\n}\n\n/**\n * 叶子节点级联选择器\n *\n * options 选项可以使用 `list2tree()` 或 `levels2tree()` 来构造\n *\n * @param key\n */\nexport function leafCascader(key: SingleSchemaKey): UnstableBuilder<CascaderControlSchema<SingleSchemaKey>, KindOrKey | 'trigger' | 'mapper'> {\n let list: TreeNode<NzCascaderOption>[];\n\n return cascader(key)\n .trigger('hover')\n .mapper({\n parser: (value: NzCascaderOption['value'] | null, schema) => {\n if (!value) return null;\n\n // 如果输入的是叶子节点,我们需要转为 [父节点, ..., 叶子节点]\n list ??= tree2list((schema as CascaderControlSchema).options as TreeNode<NzCascaderOption>[]);\n // 找到选中的叶子节点\n let node = list.find(node => node.value === value && (!node.children || node.children.length === 0));\n\n const levels = [];\n\n while (node) {\n levels.unshift(node.value);\n node = node.parent;\n }\n\n return levels;\n },\n formatter: value => {\n // 输出的是节点数组,我们只要叶子节点\n return value?.[value.length - 1];\n }\n })\n}\n\nexport function datetimePicker(key: string, format = 'yyyy-MM-dd HH:mm'): UnstableBuilder<DatePickerControlSchema, KindOrKey | 'time' | 'format'> {\n return datePicker(key)\n .time({ nzFormat: 'HH:mm' })\n .format(format);\n}\n\nexport function datetimeRangePicker(key: SchemaKey, format = 'yyyy-MM-dd HH:mm'): UnstableBuilder<DateRangePickerControlSchema, KindOrKey | 'time' | 'format'> {\n return dateRangePicker(key)\n .time({ nzFormat: 'HH:mm' })\n .format(format);\n}\n","import { Builder, headless, SingleSchemaKey } from '@fluent-form/core';\nimport { form, FormGroupSchema } from '@fluent-form/ui-zorro';\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\n/**\n * 实体表单\n *\n * 内置了一个 Headless ID 控件图示:`headless('id')`\n */\nexport function entityForm(composeFn: (it: Builder<FormGroupSchema<SingleSchemaKey>>) => NzSafeAny) {\n return form(it => {\n headless('id');\n composeFn(it);\n });\n}\n","import { SchemaPatcher, SchemaType } from '@fluent-form/core';\nimport { AbstractZorroControlSchema, Label } from '@fluent-form/ui-zorro';\n\nfunction parseLabel(label: string | Label): string {\n if (typeof label === 'string') {\n return label;\n }\n\n return label.content ?? '';\n}\n\nfunction autoPlaceholder(schema: AbstractZorroControlSchema, action: string) {\n const label = schema['label'];\n\n if (label && typeof label !== 'function') {\n (schema as any)['placeholder'] ??= action + parseLabel(label);\n }\n\n return schema;\n}\n\n/**\n * 为文本框字段自动添加 placeholder\n */\nexport function useAutoPlaceholderPatchers(): SchemaPatcher[] {\n return [\n {\n selector: ['text-field', 'number-field'],\n patch: schema => autoPlaceholder(schema, '请输入')\n },\n {\n selector: 'text-area',\n patch: schema => autoPlaceholder(schema, '请填写')\n },\n {\n selector: ['date-picker', 'time-picker', 'select', 'cascader', 'tree-select'],\n patch: schema => autoPlaceholder(schema, '请选择')\n }\n ];\n}\n\n/**\n * 1. 自动为非必填字段添加清除按钮\n * 2. 为选择器添加搜索功能\n */\nexport function useImprovedPickerPatchers(): SchemaPatcher[] {\n return [\n {\n selector: ['date-picker', 'date-range-picker', 'time-picker', 'select', 'cascader', 'tree-select'],\n patch: schema => {\n if (!schema['required']) {\n schema['clearable'] ??= true;\n }\n\n return schema;\n }\n },\n {\n selector: ['select', 'cascader', 'tree-select'],\n patch: schema => {\n schema['searchable'] ??= true;\n\n return schema;\n }\n }\n ];\n}\n\nexport function useValidationTipsPatchers(): SchemaPatcher {\n return {\n selector: SchemaType.Control,\n patch: schema => {\n schema['tips'] ??= {}\n schema['tips'].auto = {\n default: {\n min: '输入数值过小',\n max: '输入数值过大',\n minlength: '输入内容过短',\n maxlength: '输入内容过长',\n email: '请输入正确的邮箱地址',\n pattern: '输入内容格式不正确',\n required: '请填写' + (schema['label'] ? parseLabel(schema['label']) : '')\n }\n }\n return schema;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;SAKgB,YAAY,GAAA;AAC1B,IAAA,OAAO,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;AAC9D;SAEgB,SAAS,GAAA;IACvB,OAAO,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC3E;SAEgB,YAAY,GAAA;AAC1B,IAAA,OAAO,MAAM;SACV,OAAO,CAAC,IAAI;SACZ,IAAI,CAAC,SAAS;AACd,SAAA,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AACxB,SAAA,SAAS,CAAC;AACT,QAAA,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,KAAI;AACxB,YAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAoB;YAC7C,kBAAkB,CAAC,QAAQ,CAAC;AAC5B,YAAA,IAAI,QAAQ,CAAC,OAAO,EAAE;gBACpB,KAAK,CAAC,cAAc,EAAE;;;AAG3B,KAAA,CAAC;AACN;AAEA;;AAEG;AACI,MAAM,UAAU,GAAG;AAE1B,SAAS,k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OAAO,EAAE;AACP,oBAAA,GAAG,EAAE,QAAQ;AACb,oBAAA,GAAG,EAAE,QAAQ;AACb,oBAAA,SAAS,EAAE,QAAQ;AACnB,oBAAA,SAAS,EAAE,QAAQ;AACnB,oBAAA,KAAK,EAAE,YAAY;AACnB,oBAAA,OAAO,EAAE,WAAW;oBACpB,QAAQ,EAAE,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE;AACtE;aACF;AACD,YAAA,OAAO,MAAM;;KAEhB;AACH;;ACvFA;;AAEG;;;;"}
@@ -125,10 +125,10 @@ class SunMediaUploader {
125
125
  }
126
126
  });
127
127
  }
128
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunMediaUploader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
129
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: SunMediaUploader, isStandalone: true, selector: "sun-media-uploader", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, limit: { classPropertyName: "limit", publicName: "limit", isSignal: true, isRequired: false, transformFunction: null }, deletable: { classPropertyName: "deletable", publicName: "deletable", isSignal: true, isRequired: false, transformFunction: null }, uploadable: { classPropertyName: "uploadable", publicName: "uploadable", isSignal: true, isRequired: false, transformFunction: null }, previewable: { classPropertyName: "previewable", publicName: "previewable", isSignal: true, isRequired: false, transformFunction: null }, downloadable: { classPropertyName: "downloadable", publicName: "downloadable", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, uploadKeys: { classPropertyName: "uploadKeys", publicName: "uploadKeys", isSignal: true, isRequired: false, transformFunction: null }, compress: { classPropertyName: "compress", publicName: "compress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { data: "dataChange", uploaded: "uploaded", delete: "delete", error: "error" }, host: { properties: { "class.sun-media-uploader-circle": "shape() === 'circle'" }, classAttribute: "sun-media-uploader" }, ngImport: i0, template: "@for (item of data(); track item.uid) {\n <div class=\"sun-media-uploader-item\">\n <img class=\"sun-media-uploader-img\" [src]=\"item.thumbnailUrl || item.url\" />\n\n @if (item.progress) {\n <div class=\"sun-media-uploader-progress-bar\">\n <div\n class=\"sun-media-uploader-progress-inner\"\n [style]=\"{ transform: 'translateY(-' + item.progress + 'px)' }\"></div>\n <div class=\"sun-media-uploader-progress-text\">\n <div>{{ item.progress }}%</div>\n <div>\u4E0A\u4F20\u4E2D...</div>\n </div>\n </div>\n } @else {\n <div class=\"sun-media-uploader-mask\">\n @if (previewable()) {\n <div class=\"sun-media-uploader-action\" (click)=\"onPreview(item)\">\n <nz-icon nzType=\"eye\" nzTheme=\"outline\"></nz-icon>\n \u9884\u89C8\n </div>\n }\n @if (downloadable()) {\n <div class=\"sun-media-uploader-action\" (click)=\"onDownload(item)\">\n <nz-icon nzType=\"download\" nzTheme=\"outline\"></nz-icon>\n \u4E0B\u8F7D\n </div>\n }\n @if (deletable()) {\n <div\n class=\"sun-media-uploader-action\"\n nz-popconfirm\n nzType=\"danger\"\n nzPopconfirmTitle=\"\u60A8\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\u76EE\u5417\uFF1F\"\n nzOkDanger\n (nzOnConfirm)=\"delete.emit(item)\">\n <nz-icon nzType=\"delete\" nzTheme=\"outline\"></nz-icon>\n \u5220\u9664\n </div>\n }\n </div>\n }\n </div>\n}\n\n<nz-upload\n nzAccept=\"image/*\"\n nzListType=\"picture-card\"\n [hidden]=\"data().length! >= limit() || !uploadable()\"\n [nzShowUploadList]=\"false\"\n [nzCustomRequest]=\"upload\"\n [nzTransformFile]=\"compress() ? transform : undefined\"\n (nzChange)=\"onChange($event)\">\n <div class=\"sun-media-uploader-btn\">\n <nz-icon nzType=\"plus\"></nz-icon>\n <div class=\"sun-media-uploader-btn-text\">\u70B9\u51FB\u4E0A\u4F20</div>\n </div>\n</nz-upload>\n", styles: [".sun-media-uploader{--item-size: 100px;--item-width: var(--item-size);--item-height: var(--item-size);display:flex;flex-wrap:wrap;gap:6px}.sun-media-uploader .ant-upload-picture-card-wrapper{width:auto}.sun-media-uploader .ant-upload.ant-upload-select-picture-card{height:var(--item-height);width:var(--item-width)}.sun-media-uploader-item{position:relative;height:var(--item-height);width:var(--item-width);border:.5px solid #d9d9d9;border-radius:var(--border-radius-base);overflow:hidden}.sun-media-uploader-item:hover{border-color:var(--color-primary)}.sun-media-uploader-progress-bar,.sun-media-uploader-mask{position:absolute;top:0;left:0;height:100%;width:100%;color:#fff;filter:drop-shadow(0 0 1px rgba(0,0,0,.5))}.sun-media-uploader-progress-inner,.sun-media-uploader-mask{background-color:#0000004d}.sun-media-uploader-progress-bar{display:flex;justify-content:center;align-items:center;text-align:center}.sun-media-uploader-progress-inner{position:absolute;top:0;left:0;width:100%;height:100%;transition:transform ease-out .3s}.sun-media-uploader-progress-text{position:relative;z-index:1}.sun-media-uploader-mask{display:flex;flex-direction:column;justify-content:center;gap:2px;opacity:0;transition:all ease-out .3s}.sun-media-uploader-mask:hover{opacity:1}.sun-media-uploader-action{display:flex;justify-content:center;gap:6px;padding-right:4px;cursor:pointer}.sun-media-uploader-btn-text{margin-top:6px}.sun-media-uploader-img,.sun-media-uploader-video{width:100%;height:100%;object-fit:cover}.sun-media-uploader-circle .sun-media-uploader-item,.sun-media-uploader-circle .ant-upload.ant-upload-select-picture-card{border-radius:50%}\n"], dependencies: [{ kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzUploadModule }, { kind: "component", type: i2.NzUploadComponent, selector: "nz-upload", inputs: ["nzType", "nzLimit", "nzSize", "nzFileType", "nzAccept", "nzAction", "nzDirectory", "nzOpenFileDialogOnClick", "nzBeforeUpload", "nzCustomRequest", "nzData", "nzFilter", "nzFileList", "nzDisabled", "nzHeaders", "nzListType", "nzMultiple", "nzName", "nzShowUploadList", "nzShowButton", "nzWithCredentials", "nzRemove", "nzPreview", "nzPreviewFile", "nzPreviewIsImage", "nzTransformFile", "nzDownload", "nzIconRender", "nzFileListRender"], outputs: ["nzChange", "nzFileListChange"], exportAs: ["nzUpload"] }, { kind: "ngmodule", type: NzImageModule }, { kind: "ngmodule", type: NzPopconfirmModule }, { kind: "directive", type: i3.NzPopconfirmDirective, selector: "[nz-popconfirm]", inputs: ["nzPopconfirmArrowPointAtCenter", "nzPopconfirmTitle", "nzPopconfirmTitleContext", "nz-popconfirm", "nzPopconfirmTrigger", "nzPopconfirmPlacement", "nzPopconfirmOrigin", "nzPopconfirmMouseEnterDelay", "nzPopconfirmMouseLeaveDelay", "nzPopconfirmOverlayClassName", "nzPopconfirmOverlayStyle", "nzPopconfirmVisible", "nzOkText", "nzOkType", "nzOkDisabled", "nzOkDanger", "nzCancelText", "nzBeforeConfirm", "nzIcon", "nzCondition", "nzPopconfirmShowArrow", "nzPopconfirmBackdrop", "nzAutofocus"], outputs: ["nzPopconfirmVisibleChange", "nzOnCancel", "nzOnConfirm"], exportAs: ["nzPopconfirm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
128
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunMediaUploader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
129
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: SunMediaUploader, isStandalone: true, selector: "sun-media-uploader", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, limit: { classPropertyName: "limit", publicName: "limit", isSignal: true, isRequired: false, transformFunction: null }, deletable: { classPropertyName: "deletable", publicName: "deletable", isSignal: true, isRequired: false, transformFunction: null }, uploadable: { classPropertyName: "uploadable", publicName: "uploadable", isSignal: true, isRequired: false, transformFunction: null }, previewable: { classPropertyName: "previewable", publicName: "previewable", isSignal: true, isRequired: false, transformFunction: null }, downloadable: { classPropertyName: "downloadable", publicName: "downloadable", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, uploadKeys: { classPropertyName: "uploadKeys", publicName: "uploadKeys", isSignal: true, isRequired: false, transformFunction: null }, compress: { classPropertyName: "compress", publicName: "compress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { data: "dataChange", uploaded: "uploaded", delete: "delete", error: "error" }, host: { properties: { "class.sun-media-uploader-circle": "shape() === 'circle'" }, classAttribute: "sun-media-uploader" }, ngImport: i0, template: "@for (item of data(); track item.uid) {\n <div class=\"sun-media-uploader-item\">\n <img class=\"sun-media-uploader-img\" [src]=\"item.thumbnailUrl || item.url\" />\n\n @if (item.progress) {\n <div class=\"sun-media-uploader-progress-bar\">\n <div\n class=\"sun-media-uploader-progress-inner\"\n [style]=\"{ transform: 'translateY(-' + item.progress + 'px)' }\"></div>\n <div class=\"sun-media-uploader-progress-text\">\n <div>{{ item.progress }}%</div>\n <div>\u4E0A\u4F20\u4E2D...</div>\n </div>\n </div>\n } @else {\n <div class=\"sun-media-uploader-mask\">\n @if (previewable()) {\n <div class=\"sun-media-uploader-action\" (click)=\"onPreview(item)\">\n <nz-icon nzType=\"eye\" nzTheme=\"outline\"></nz-icon>\n \u9884\u89C8\n </div>\n }\n @if (downloadable()) {\n <div class=\"sun-media-uploader-action\" (click)=\"onDownload(item)\">\n <nz-icon nzType=\"download\" nzTheme=\"outline\"></nz-icon>\n \u4E0B\u8F7D\n </div>\n }\n @if (deletable()) {\n <div\n class=\"sun-media-uploader-action\"\n nz-popconfirm\n nzType=\"danger\"\n nzPopconfirmTitle=\"\u60A8\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\u76EE\u5417\uFF1F\"\n nzOkDanger\n (nzOnConfirm)=\"delete.emit(item)\">\n <nz-icon nzType=\"delete\" nzTheme=\"outline\"></nz-icon>\n \u5220\u9664\n </div>\n }\n </div>\n }\n </div>\n}\n\n<nz-upload\n nzAccept=\"image/*\"\n nzListType=\"picture-card\"\n [hidden]=\"data().length! >= limit() || !uploadable()\"\n [nzShowUploadList]=\"false\"\n [nzCustomRequest]=\"upload\"\n [nzTransformFile]=\"compress() ? transform : undefined\"\n (nzChange)=\"onChange($event)\">\n <div class=\"sun-media-uploader-btn\">\n <nz-icon nzType=\"plus\"></nz-icon>\n <div class=\"sun-media-uploader-btn-text\">\u70B9\u51FB\u4E0A\u4F20</div>\n </div>\n</nz-upload>\n", styles: [".sun-media-uploader{--item-size: 100px;--item-width: var(--item-size);--item-height: var(--item-size);display:flex;flex-wrap:wrap;gap:6px}.sun-media-uploader .ant-upload-picture-card-wrapper{width:auto}.sun-media-uploader .ant-upload.ant-upload-select-picture-card{height:var(--item-height);width:var(--item-width)}.sun-media-uploader-item{position:relative;height:var(--item-height);width:var(--item-width);border:.5px solid #d9d9d9;border-radius:var(--border-radius-base);overflow:hidden}.sun-media-uploader-item:hover{border-color:var(--color-primary)}.sun-media-uploader-progress-bar,.sun-media-uploader-mask{position:absolute;top:0;left:0;height:100%;width:100%;color:#fff;filter:drop-shadow(0 0 1px rgba(0,0,0,.5))}.sun-media-uploader-progress-inner,.sun-media-uploader-mask{background-color:#0000004d}.sun-media-uploader-progress-bar{display:flex;justify-content:center;align-items:center;text-align:center}.sun-media-uploader-progress-inner{position:absolute;top:0;left:0;width:100%;height:100%;transition:transform ease-out .3s}.sun-media-uploader-progress-text{position:relative;z-index:1}.sun-media-uploader-mask{display:flex;flex-direction:column;justify-content:center;gap:2px;opacity:0;transition:all ease-out .3s}.sun-media-uploader-mask:hover{opacity:1}.sun-media-uploader-action{display:flex;justify-content:center;gap:6px;padding-right:4px;cursor:pointer}.sun-media-uploader-btn-text{margin-top:6px}.sun-media-uploader-img,.sun-media-uploader-video{width:100%;height:100%;object-fit:cover}.sun-media-uploader-circle .sun-media-uploader-item,.sun-media-uploader-circle .ant-upload.ant-upload-select-picture-card{border-radius:50%}\n"], dependencies: [{ kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzUploadModule }, { kind: "component", type: i2.NzUploadComponent, selector: "nz-upload", inputs: ["nzType", "nzLimit", "nzSize", "nzFileType", "nzAccept", "nzAction", "nzDirectory", "nzOpenFileDialogOnClick", "nzBeforeUpload", "nzCustomRequest", "nzData", "nzFilter", "nzFileList", "nzDisabled", "nzHeaders", "nzListType", "nzMultiple", "nzName", "nzShowUploadList", "nzShowButton", "nzWithCredentials", "nzRemove", "nzPreview", "nzPreviewFile", "nzPreviewIsImage", "nzTransformFile", "nzDownload", "nzIconRender", "nzFileListRender"], outputs: ["nzChange", "nzFileListChange"], exportAs: ["nzUpload"] }, { kind: "ngmodule", type: NzImageModule }, { kind: "ngmodule", type: NzPopconfirmModule }, { kind: "directive", type: i3.NzPopconfirmDirective, selector: "[nz-popconfirm]", inputs: ["nzPopconfirmArrowPointAtCenter", "nzPopconfirmTitle", "nzPopconfirmTitleContext", "nz-popconfirm", "nzPopconfirmTrigger", "nzPopconfirmPlacement", "nzPopconfirmOrigin", "nzPopconfirmMouseEnterDelay", "nzPopconfirmMouseLeaveDelay", "nzPopconfirmOverlayClassName", "nzPopconfirmOverlayStyle", "nzPopconfirmVisible", "nzOkText", "nzOkType", "nzOkDisabled", "nzOkDanger", "nzCancelText", "nzBeforeConfirm", "nzIcon", "nzCondition", "nzPopconfirmShowArrow", "nzPopconfirmBackdrop", "nzAutofocus"], outputs: ["nzPopconfirmVisibleChange", "nzOnCancel", "nzOnConfirm"], exportAs: ["nzPopconfirm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
130
130
  }
131
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunMediaUploader, decorators: [{
131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunMediaUploader, decorators: [{
132
132
  type: Component,
133
133
  args: [{ selector: 'sun-media-uploader', imports: [
134
134
  NzIconModule,
@@ -25,10 +25,10 @@ class MessageService extends NzMessageService {
25
25
  withSaveLoading() {
26
26
  return this.withLoading('正在保存');
27
27
  }
28
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MessageService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
29
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MessageService, providedIn: 'root' }); }
28
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MessageService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
29
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MessageService, providedIn: 'root' }); }
30
30
  }
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MessageService, decorators: [{
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MessageService, decorators: [{
32
32
  type: Injectable,
33
33
  args: [{
34
34
  providedIn: 'root'
@@ -11,10 +11,10 @@ import * as i4 from 'ng-zorro-antd/core/transition-patch';
11
11
  import * as i5 from 'ng-zorro-antd/core/wave';
12
12
 
13
13
  class SunForbiddenPage {
14
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunForbiddenPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
15
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SunForbiddenPage, isStandalone: true, selector: "sun-forbidden", ngImport: i0, template: "<nz-result nzStatus=\"403\" nzTitle=\"403\" nzSubTitle=\"\u62B1\u6B49\uFF0C\u60A8\u6CA1\u6709\u6743\u9650\u8BBF\u95EE\u8BE5\u9875\u9762\">\n <div nz-result-extra>\n <button nz-button nzType=\"primary\" routerLink=\"/\">\n <nz-icon nzType=\"arrow-left\" nzTheme=\"outline\"></nz-icon>\n \u8FD4\u56DE\u4E3B\u9875\n </button>\n </div>\n</nz-result>\n", styles: [":host{height:100%;width:100%;display:flex;justify-content:center;align-items:center;background:var(--ant-primary-1);padding-bottom:10vh}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: NzResultModule }, { kind: "component", type: i1.NzResultComponent, selector: "nz-result", inputs: ["nzIcon", "nzTitle", "nzStatus", "nzSubTitle", "nzExtra"], exportAs: ["nzResult"] }, { kind: "directive", type: i1.NzResultExtraDirective, selector: "div[nz-result-extra]", exportAs: ["nzResultExtra"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i3.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i4.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i5.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunForbiddenPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
15
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: SunForbiddenPage, isStandalone: true, selector: "sun-forbidden", ngImport: i0, template: "<nz-result nzStatus=\"403\" nzTitle=\"403\" nzSubTitle=\"\u62B1\u6B49\uFF0C\u60A8\u6CA1\u6709\u6743\u9650\u8BBF\u95EE\u8BE5\u9875\u9762\">\n <div nz-result-extra>\n <button nz-button nzType=\"primary\" routerLink=\"/\">\n <nz-icon nzType=\"arrow-left\" nzTheme=\"outline\"></nz-icon>\n \u8FD4\u56DE\u4E3B\u9875\n </button>\n </div>\n</nz-result>\n", styles: [":host{height:100%;width:100%;display:flex;justify-content:center;align-items:center;background:var(--ant-primary-1);padding-bottom:10vh}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: NzResultModule }, { kind: "component", type: i1.NzResultComponent, selector: "nz-result", inputs: ["nzIcon", "nzTitle", "nzStatus", "nzSubTitle", "nzExtra"], exportAs: ["nzResult"] }, { kind: "directive", type: i1.NzResultExtraDirective, selector: "div[nz-result-extra]", exportAs: ["nzResultExtra"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i3.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i4.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i5.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
16
16
  }
17
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunForbiddenPage, decorators: [{
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunForbiddenPage, decorators: [{
18
18
  type: Component,
19
19
  args: [{ selector: 'sun-forbidden', imports: [
20
20
  RouterLink,
@@ -22,10 +22,10 @@ class SunLogoutPage {
22
22
  login() {
23
23
  this.router.navigateByUrl('/login');
24
24
  }
25
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunLogoutPage, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
26
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SunLogoutPage, isStandalone: true, selector: "sun-logout", ngImport: i0, template: "<nz-result\n nzStatus=\"success\"\n nzTitle=\"\u60A8\u5DF2\u6210\u529F\u9000\u51FA\u767B\u5F55!\"\n [nzSubTitle]=\"'\u7CFB\u7EDF\u5C06\u5728 ' + (5 - (interval$ | async)!) + ' \u79D2\u540E\u81EA\u52A8\u91CD\u5B9A\u5411...'\"\n>\n <div nz-result-extra>\n <button nz-button nzType=\"primary\" (click)=\"login()\">\n <nz-icon nzType=\"arrow-right\" nzTheme=\"outline\"></nz-icon>\n \u7ACB\u5373\u767B\u5F55\n </button>\n </div>\n</nz-result>\n", styles: [":host{height:100%;width:100%;display:flex;justify-content:center;align-items:center;background:var(--ant-primary-1);padding-bottom:10vh}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: NzResultModule }, { kind: "component", type: i2.NzResultComponent, selector: "nz-result", inputs: ["nzIcon", "nzTitle", "nzStatus", "nzSubTitle", "nzExtra"], exportAs: ["nzResult"] }, { kind: "directive", type: i2.NzResultExtraDirective, selector: "div[nz-result-extra]", exportAs: ["nzResultExtra"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i4.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i5.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
25
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunLogoutPage, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
26
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: SunLogoutPage, isStandalone: true, selector: "sun-logout", ngImport: i0, template: "<nz-result\n nzStatus=\"success\"\n nzTitle=\"\u60A8\u5DF2\u6210\u529F\u9000\u51FA\u767B\u5F55!\"\n [nzSubTitle]=\"'\u7CFB\u7EDF\u5C06\u5728 ' + (5 - (interval$ | async)!) + ' \u79D2\u540E\u81EA\u52A8\u91CD\u5B9A\u5411...'\"\n>\n <div nz-result-extra>\n <button nz-button nzType=\"primary\" (click)=\"login()\">\n <nz-icon nzType=\"arrow-right\" nzTheme=\"outline\"></nz-icon>\n \u7ACB\u5373\u767B\u5F55\n </button>\n </div>\n</nz-result>\n", styles: [":host{height:100%;width:100%;display:flex;justify-content:center;align-items:center;background:var(--ant-primary-1);padding-bottom:10vh}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: NzResultModule }, { kind: "component", type: i2.NzResultComponent, selector: "nz-result", inputs: ["nzIcon", "nzTitle", "nzStatus", "nzSubTitle", "nzExtra"], exportAs: ["nzResult"] }, { kind: "directive", type: i2.NzResultExtraDirective, selector: "div[nz-result-extra]", exportAs: ["nzResultExtra"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i4.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i5.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
27
27
  }
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunLogoutPage, decorators: [{
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunLogoutPage, decorators: [{
29
29
  type: Component,
30
30
  args: [{ selector: 'sun-logout', imports: [
31
31
  AsyncPipe,
@@ -11,10 +11,10 @@ import * as i4 from 'ng-zorro-antd/core/transition-patch';
11
11
  import * as i5 from 'ng-zorro-antd/core/wave';
12
12
 
13
13
  class SunNotFoundPage {
14
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunNotFoundPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
15
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: SunNotFoundPage, isStandalone: true, selector: "sun-not-found", ngImport: i0, template: "<nz-result nzStatus=\"404\" nzTitle=\"404\" nzSubTitle=\"\u62B1\u6B49\uFF0C\u60A8\u8BBF\u95EE\u7684\u9875\u9762\u4E0D\u5B58\u5728\">\n <div nz-result-extra>\n <button nz-button nzType=\"primary\" routerLink=\"/\">\n <nz-icon nzType=\"arrow-left\" nzTheme=\"outline\"></nz-icon>\n \u8FD4\u56DE\u4E3B\u9875\n </button>\n </div>\n</nz-result>\n", styles: [":host{height:100%;width:100%;display:flex;justify-content:center;align-items:center;background:var(--ant-primary-1);padding-bottom:10vh}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: NzResultModule }, { kind: "component", type: i1.NzResultComponent, selector: "nz-result", inputs: ["nzIcon", "nzTitle", "nzStatus", "nzSubTitle", "nzExtra"], exportAs: ["nzResult"] }, { kind: "directive", type: i1.NzResultExtraDirective, selector: "div[nz-result-extra]", exportAs: ["nzResultExtra"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i3.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i4.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i5.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunNotFoundPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
15
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: SunNotFoundPage, isStandalone: true, selector: "sun-not-found", ngImport: i0, template: "<nz-result nzStatus=\"404\" nzTitle=\"404\" nzSubTitle=\"\u62B1\u6B49\uFF0C\u60A8\u8BBF\u95EE\u7684\u9875\u9762\u4E0D\u5B58\u5728\">\n <div nz-result-extra>\n <button nz-button nzType=\"primary\" routerLink=\"/\">\n <nz-icon nzType=\"arrow-left\" nzTheme=\"outline\"></nz-icon>\n \u8FD4\u56DE\u4E3B\u9875\n </button>\n </div>\n</nz-result>\n", styles: [":host{height:100%;width:100%;display:flex;justify-content:center;align-items:center;background:var(--ant-primary-1);padding-bottom:10vh}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: NzResultModule }, { kind: "component", type: i1.NzResultComponent, selector: "nz-result", inputs: ["nzIcon", "nzTitle", "nzStatus", "nzSubTitle", "nzExtra"], exportAs: ["nzResult"] }, { kind: "directive", type: i1.NzResultExtraDirective, selector: "div[nz-result-extra]", exportAs: ["nzResultExtra"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i3.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i4.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i5.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
16
16
  }
17
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunNotFoundPage, decorators: [{
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunNotFoundPage, decorators: [{
18
18
  type: Component,
19
19
  args: [{ selector: 'sun-not-found', imports: [
20
20
  RouterLink,
@@ -10,7 +10,7 @@ import { NzIconModule } from 'ng-zorro-antd/icon';
10
10
  import { NzNotificationService } from 'ng-zorro-antd/notification';
11
11
  import * as i4 from 'ng-zorro-antd/space';
12
12
  import { NzSpaceModule } from 'ng-zorro-antd/space';
13
- import { filter, exhaustMap } from 'rxjs';
13
+ import { filter, exhaustMap, take } from 'rxjs';
14
14
  import * as i2 from 'ng-zorro-antd/core/transition-patch';
15
15
  import * as i3 from 'ng-zorro-antd/core/wave';
16
16
 
@@ -25,10 +25,10 @@ class AppUpdater {
25
25
  .then(bool => bool || this.message.info('当前已是最新版本'))
26
26
  .catch(() => this.message.error('检查更新失败'));
27
27
  }
28
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppUpdater, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
29
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppUpdater, providedIn: 'root' }); }
28
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AppUpdater, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
29
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AppUpdater, providedIn: 'root' }); }
30
30
  }
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppUpdater, decorators: [{
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AppUpdater, decorators: [{
32
32
  type: Injectable,
33
33
  args: [{
34
34
  providedIn: 'root'
@@ -44,7 +44,7 @@ class SunUpdater {
44
44
  let loadingRef;
45
45
  updater.versionUpdates.pipe(filter(event => event.type === 'VERSION_DETECTED'), exhaustMap(() => {
46
46
  loadingRef = this.notification.info('温馨提示', '发现新版本,正在下载更新...', { nzCloseIcon: 'loading', nzDuration: 0 });
47
- return updater.versionUpdates.pipe(filter(event => event.type === 'VERSION_READY'));
47
+ return updater.versionUpdates.pipe(filter(event => event.type === 'VERSION_READY'), take(1));
48
48
  }), takeUntilDestroyed()).subscribe(() => {
49
49
  this.notification.remove(loadingRef.messageId);
50
50
  this.present();
@@ -72,10 +72,10 @@ class SunUpdater {
72
72
  this.present();
73
73
  }, 1000 * 60 * 5); // 5min
74
74
  }
75
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunUpdater, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
76
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.14", type: SunUpdater, isStandalone: true, selector: "sun-updater", viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template let-notification>\n <nz-space>\n <button *nzSpaceItem nz-button nzType=\"link\" nzSize=\"small\" (click)=\"defer(notification)\">\u7A0D\u540E\u63D0\u9192</button>\n <button *nzSpaceItem nz-button nzType=\"primary\" nzSize=\"small\" (click)=\"update()\">\u7ACB\u5373\u66F4\u65B0</button>\n </nz-space>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: NzIconModule }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i1.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i2.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i3.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "ngmodule", type: NzSpaceModule }, { kind: "component", type: i4.NzSpaceComponent, selector: "nz-space, [nz-space]", inputs: ["nzDirection", "nzAlign", "nzSplit", "nzWrap", "nzSize"], exportAs: ["nzSpace"] }, { kind: "directive", type: i4.NzSpaceItemDirective, selector: "[nzSpaceItem]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
75
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunUpdater, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
76
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.15", type: SunUpdater, isStandalone: true, selector: "sun-updater", viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template let-notification>\n <nz-space>\n <button *nzSpaceItem nz-button nzType=\"link\" nzSize=\"small\" (click)=\"defer(notification)\">\u7A0D\u540E\u63D0\u9192</button>\n <button *nzSpaceItem nz-button nzType=\"primary\" nzSize=\"small\" (click)=\"update()\">\u7ACB\u5373\u66F4\u65B0</button>\n </nz-space>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: NzIconModule }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i1.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i2.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i3.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "ngmodule", type: NzSpaceModule }, { kind: "component", type: i4.NzSpaceComponent, selector: "nz-space, [nz-space]", inputs: ["nzDirection", "nzAlign", "nzSplit", "nzWrap", "nzSize"], exportAs: ["nzSpace"] }, { kind: "directive", type: i4.NzSpaceItemDirective, selector: "[nzSpaceItem]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
77
77
  }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunUpdater, decorators: [{
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SunUpdater, decorators: [{
79
79
  type: Component,
80
80
  args: [{ selector: 'sun-updater', imports: [
81
81
  NzIconModule,
@@ -1 +1 @@
1
- {"version":3,"file":"solar-angular-ui-zorro-updater.mjs","sources":["../../../packages/ui-zorro/updater/app-updater.ts","../../../packages/ui-zorro/updater/updater.component.ts","../../../packages/ui-zorro/updater/updater.component.html","../../../packages/ui-zorro/updater/solar-angular-ui-zorro-updater.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport { NzMessageService } from 'ng-zorro-antd/message';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AppUpdater {\n protected readonly update = inject(SwUpdate);\n protected readonly message = inject(NzMessageService);\n\n checkForUpdate() {\n this.update.checkForUpdate()\n // 这里我们只处理 bool 为 false 的情况;如果为 true,意味着有新版本,应该由 sun-updates 组件处理\n .then(bool => bool || this.message.info('当前已是最新版本'))\n .catch(() => this.message.error('检查更新失败'))\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, TemplateRef, viewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { SwUpdate } from '@angular/service-worker';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzNotificationComponent, NzNotificationRef, NzNotificationService } from 'ng-zorro-antd/notification';\nimport { NzSpaceModule } from 'ng-zorro-antd/space';\nimport { exhaustMap, filter } from 'rxjs';\n\n@Component({\n selector: 'sun-updater',\n imports: [\n NzIconModule,\n NzButtonModule,\n NzSpaceModule\n ],\n templateUrl: './updater.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SunUpdater {\n private readonly location = inject(DOCUMENT).defaultView!.location;\n private readonly notification = inject(NzNotificationService);\n\n readonly templateRef = viewChild.required(TemplateRef);\n\n constructor() {\n const updater = inject(SwUpdate);\n\n let loadingRef: NzNotificationRef;\n\n updater.versionUpdates.pipe(\n filter(event => event.type === 'VERSION_DETECTED'),\n exhaustMap(() => {\n loadingRef = this.notification.info(\n '温馨提示',\n '发现新版本,正在下载更新...',\n { nzCloseIcon: 'loading', nzDuration: 0 }\n );\n return updater.versionUpdates.pipe(\n filter(event => event.type === 'VERSION_READY')\n )\n }),\n takeUntilDestroyed()\n ).subscribe(() => {\n this.notification.remove(loadingRef.messageId);\n this.present();\n })\n\n updater.versionUpdates.pipe(\n filter(event => event.type === 'VERSION_INSTALLATION_FAILED'),\n takeUntilDestroyed()\n ).subscribe(event => {\n this.notification.remove(loadingRef.messageId);\n this.notification.error(\n '温馨提示',\n '新版本安装失败,原因:' + event.error,\n { nzDuration: 0 }\n );\n })\n\n updater.unrecoverable.pipe(\n takeUntilDestroyed()\n ).subscribe(event => {\n alert(`发生错误,我们无法从 ${event.reason} 恢复,请重新加载页面。`);\n });\n }\n\n private present() {\n this.notification.info(\n '新版本已就绪',\n '为了让您获得更好的使用体验,我们建议您立即进行更新。',\n {\n nzButton: this.templateRef(),\n nzDuration: 0\n }\n );\n }\n\n update() {\n this.location.reload();\n }\n\n defer(notification: NzNotificationComponent) {\n notification.close();\n\n setTimeout(() => {\n this.present();\n }, 1000 * 60 * 5); // 5min\n }\n}\n","<ng-template let-notification>\n <nz-space>\n <button *nzSpaceItem nz-button nzType=\"link\" nzSize=\"small\" (click)=\"defer(notification)\">稍后提醒</button>\n <button *nzSpaceItem nz-button nzType=\"primary\" nzSize=\"small\" (click)=\"update()\">立即更新</button>\n </nz-space>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAOa,UAAU,CAAA;AAHvB,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;AACzB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAQtD;IANC,cAAc,GAAA;AACZ,QAAA,IAAI,CAAC,MAAM,CAAC,cAAc;;AAEvB,aAAA,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;AAClD,aAAA,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;;+GARnC,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAV,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,cAFT,MAAM,EAAA,CAAA,CAAA;;4FAEP,UAAU,EAAA,UAAA,EAAA,CAAA;kBAHtB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBA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mjs","sources":["../../../packages/ui-zorro/updater/app-updater.ts","../../../packages/ui-zorro/updater/updater.component.ts","../../../packages/ui-zorro/updater/updater.component.html","../../../packages/ui-zorro/updater/solar-angular-ui-zorro-updater.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport { NzMessageService } from 'ng-zorro-antd/message';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AppUpdater {\n protected readonly update = inject(SwUpdate);\n protected readonly message = inject(NzMessageService);\n\n checkForUpdate() {\n this.update.checkForUpdate()\n // 这里我们只处理 bool 为 false 的情况;如果为 true,意味着有新版本,应该由 sun-updates 组件处理\n .then(bool => bool || this.message.info('当前已是最新版本'))\n .catch(() => this.message.error('检查更新失败'))\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, TemplateRef, viewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { SwUpdate } from '@angular/service-worker';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzNotificationComponent, NzNotificationRef, NzNotificationService } from 'ng-zorro-antd/notification';\nimport { NzSpaceModule } from 'ng-zorro-antd/space';\nimport { exhaustMap, filter, take } from 'rxjs';\n\n@Component({\n selector: 'sun-updater',\n imports: [\n NzIconModule,\n NzButtonModule,\n NzSpaceModule\n ],\n templateUrl: './updater.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SunUpdater {\n private readonly location = inject(DOCUMENT).defaultView!.location;\n private readonly notification = inject(NzNotificationService);\n\n readonly templateRef = viewChild.required(TemplateRef);\n\n constructor() {\n const updater = inject(SwUpdate);\n\n let loadingRef: NzNotificationRef;\n\n updater.versionUpdates.pipe(\n filter(event => event.type === 'VERSION_DETECTED'),\n exhaustMap(() => {\n loadingRef = this.notification.info(\n '温馨提示',\n '发现新版本,正在下载更新...',\n { nzCloseIcon: 'loading', nzDuration: 0 }\n );\n return updater.versionUpdates.pipe(\n filter(event => event.type === 'VERSION_READY'),\n take(1)\n )\n }),\n takeUntilDestroyed()\n ).subscribe(() => {\n this.notification.remove(loadingRef.messageId);\n this.present();\n })\n\n updater.versionUpdates.pipe(\n filter(event => event.type === 'VERSION_INSTALLATION_FAILED'),\n takeUntilDestroyed()\n ).subscribe(event => {\n this.notification.remove(loadingRef.messageId);\n this.notification.error(\n '温馨提示',\n '新版本安装失败,原因:' + event.error,\n { nzDuration: 0 }\n );\n })\n\n updater.unrecoverable.pipe(\n takeUntilDestroyed()\n ).subscribe(event => {\n alert(`发生错误,我们无法从 ${event.reason} 恢复,请重新加载页面。`);\n });\n }\n\n private present() {\n this.notification.info(\n '新版本已就绪',\n '为了让您获得更好的使用体验,我们建议您立即进行更新。',\n {\n nzButton: this.templateRef(),\n nzDuration: 0\n }\n );\n }\n\n update() {\n this.location.reload();\n }\n\n defer(notification: NzNotificationComponent) {\n notification.close();\n\n setTimeout(() => {\n this.present();\n }, 1000 * 60 * 5); // 5min\n }\n}\n","<ng-template let-notification>\n <nz-space>\n <button *nzSpaceItem nz-button nzType=\"link\" nzSize=\"small\" (click)=\"defer(notification)\">稍后提醒</button>\n <button *nzSpaceItem nz-button nzType=\"primary\" nzSize=\"small\" (click)=\"update()\">立即更新</button>\n </nz-space>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAOa,UAAU,CAAA;AAHvB,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;AACzB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAQtD;IANC,cAAc,GAAA;AACZ,QAAA,IAAI,CAAC,MAAM,CAAC,cAAc;;AAEvB,aAAA,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,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SAAA,EAAA,QAAA,EAAA,QAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAKJ,UAAU,EAAA,UAAA,EAAA,CAAA;kBAVtB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EACd,OAAA,EAAA;wBACP,YAAY;wBACZ,cAAc;wBACd;qBACD,EAEgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,qVAAA,EAAA;;;AElBjD;;AAEG;;;;"}
@@ -3,5 +3,8 @@ import { ButtonComponentSchema } from '@fluent-form/ui-zorro';
3
3
  import { KindOrKey } from './typing';
4
4
  export declare function searchButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'icon' | 'content' | 'type'>;
5
5
  export declare function addButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'icon' | 'content' | 'type' | 'mode'>;
6
- export declare function saveButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'content' | 'type' | 'disabled'>;
7
- export declare function submitButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'content' | 'type' | 'disabled'>;
6
+ export declare function submitButton(): UnstableBuilder<ButtonComponentSchema, KindOrKey | 'content' | 'type' | 'variants' | 'listeners'>;
7
+ /**
8
+ * Alias of {@link submitButton}
9
+ */
10
+ export declare const saveButton: typeof submitButton;
@@ -8,3 +8,4 @@ export declare function useAutoPlaceholderPatchers(): SchemaPatcher[];
8
8
  * 2. 为选择器添加搜索功能
9
9
  */
10
10
  export declare function useImprovedPickerPatchers(): SchemaPatcher[];
11
+ export declare function useValidationTipsPatchers(): SchemaPatcher;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@solar-angular/ui-zorro",
3
- "version": "19.0.7",
3
+ "version": "19.1.1",
4
4
  "sideEffects": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "dependencies": {
9
- "@solar-angular/core": "19.0.7",
10
- "@solar-angular/planets": "19.0.7",
11
- "@solar-angular/platform-browser": "19.0.7",
9
+ "@solar-angular/core": "19.1.1",
10
+ "@solar-angular/planets": "19.1.1",
11
+ "@solar-angular/platform-browser": "19.1.1",
12
12
  "tslib": "^2.3.0"
13
13
  },
14
14
  "peerDependencies": {
@@ -36,22 +36,18 @@
36
36
  "types": "./crud/index.d.ts",
37
37
  "default": "./fesm2022/solar-angular-ui-zorro-crud.mjs"
38
38
  },
39
- "./fan-popover": {
40
- "types": "./fan-popover/index.d.ts",
41
- "default": "./fesm2022/solar-angular-ui-zorro-fan-popover.mjs"
42
- },
43
39
  "./fluent-form": {
44
40
  "types": "./fluent-form/index.d.ts",
45
41
  "default": "./fesm2022/solar-angular-ui-zorro-fluent-form.mjs"
46
42
  },
47
- "./message": {
48
- "types": "./message/index.d.ts",
49
- "default": "./fesm2022/solar-angular-ui-zorro-message.mjs"
50
- },
51
43
  "./media-uploader": {
52
44
  "types": "./media-uploader/index.d.ts",
53
45
  "default": "./fesm2022/solar-angular-ui-zorro-media-uploader.mjs"
54
46
  },
47
+ "./message": {
48
+ "types": "./message/index.d.ts",
49
+ "default": "./fesm2022/solar-angular-ui-zorro-message.mjs"
50
+ },
55
51
  "./page-forbidden": {
56
52
  "types": "./page-forbidden/index.d.ts",
57
53
  "default": "./fesm2022/solar-angular-ui-zorro-page-forbidden.mjs"
@@ -67,6 +63,10 @@
67
63
  "./updater": {
68
64
  "types": "./updater/index.d.ts",
69
65
  "default": "./fesm2022/solar-angular-ui-zorro-updater.mjs"
66
+ },
67
+ "./fan-popover": {
68
+ "types": "./fan-popover/index.d.ts",
69
+ "default": "./fesm2022/solar-angular-ui-zorro-fan-popover.mjs"
70
70
  }
71
71
  }
72
72
  }