@solar-angular/ui-zorro 19.0.1 → 19.0.3
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-drawer/editor-drawer.component.d.ts +5 -6
- package/fan-popover/fan-popover.component.d.ts +7 -8
- package/fesm2022/solar-angular-ui-zorro-crud.mjs +8 -15
- package/fesm2022/solar-angular-ui-zorro-crud.mjs.map +1 -1
- package/fesm2022/solar-angular-ui-zorro-fan-popover.mjs +10 -20
- package/fesm2022/solar-angular-ui-zorro-fan-popover.mjs.map +1 -1
- package/fesm2022/solar-angular-ui-zorro-media-uploader.mjs +28 -61
- package/fesm2022/solar-angular-ui-zorro-media-uploader.mjs.map +1 -1
- package/fesm2022/solar-angular-ui-zorro-page-forbidden.mjs +3 -3
- package/fesm2022/solar-angular-ui-zorro-page-forbidden.mjs.map +1 -1
- package/fesm2022/solar-angular-ui-zorro-page-logout.mjs +3 -3
- package/fesm2022/solar-angular-ui-zorro-page-logout.mjs.map +1 -1
- package/fesm2022/solar-angular-ui-zorro-page-not-found.mjs +3 -3
- package/fesm2022/solar-angular-ui-zorro-page-not-found.mjs.map +1 -1
- package/fesm2022/solar-angular-ui-zorro-updater.mjs +12 -16
- package/fesm2022/solar-angular-ui-zorro-updater.mjs.map +1 -1
- package/media-uploader/media-uploader.component.d.ts +14 -22
- package/package.json +20 -20
- package/updater/updater.component.d.ts +1 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
1
|
import { Editor } from '../editor';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
3
|
export declare class SunEditorDrawer<T extends Record<string, any>> {
|
|
5
|
-
editor: Editor<T
|
|
6
|
-
width: string | number
|
|
7
|
-
primaryKey: string
|
|
8
|
-
visibleChange:
|
|
4
|
+
readonly editor: import("@angular/core").InputSignal<Editor<T>>;
|
|
5
|
+
readonly width: import("@angular/core").InputSignal<string | number>;
|
|
6
|
+
readonly primaryKey: import("@angular/core").InputSignal<string>;
|
|
7
|
+
readonly visibleChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
9
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<SunEditorDrawer<any>, never>;
|
|
10
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SunEditorDrawer<any>, "sun-editor-drawer", never, { "editor": { "alias": "editor"; "required":
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SunEditorDrawer<any>, "sun-editor-drawer", never, { "editor": { "alias": "editor"; "required": true; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "primaryKey": { "alias": "primaryKey"; "required": false; "isSignal": true; }; }, { "visibleChange": "visibleChange"; }, never, ["*"], true, never>;
|
|
11
10
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
1
|
import { Fan } from '@solar-kit/planets/earth';
|
|
3
2
|
import { NzTooltipTrigger } from 'ng-zorro-antd/tooltip';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
export declare class SunFanPopover {
|
|
6
|
-
fan
|
|
7
|
-
disabled
|
|
8
|
-
trigger: NzTooltipTrigger
|
|
9
|
-
placement: string | string[]
|
|
10
|
-
visibleChange:
|
|
11
|
-
unbind:
|
|
5
|
+
readonly fan: import("@angular/core").InputSignal<Fan | null | undefined>;
|
|
6
|
+
readonly disabled: import("@angular/core").InputSignal<boolean | undefined>;
|
|
7
|
+
readonly trigger: import("@angular/core").InputSignal<NzTooltipTrigger>;
|
|
8
|
+
readonly placement: import("@angular/core").InputSignal<string | string[]>;
|
|
9
|
+
readonly visibleChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
10
|
+
readonly unbind: import("@angular/core").OutputEmitterRef<void>;
|
|
12
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<SunFanPopover, never>;
|
|
13
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SunFanPopover, "sun-fan-popover", never, { "fan": { "alias": "fan"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "trigger": { "alias": "trigger"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; }, { "visibleChange": "visibleChange"; "unbind": "unbind"; }, never, ["*"], true, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SunFanPopover, "sun-fan-popover", never, { "fan": { "alias": "fan"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "placement": { "alias": "placement"; "required": false; "isSignal": true; }; }, { "visibleChange": "visibleChange"; "unbind": "unbind"; }, never, ["*"], true, never>;
|
|
14
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { form } from '@fluent-form/ui-zorro';
|
|
2
2
|
import { finalize, tap } from 'rxjs';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { input, output, ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
5
5
|
import * as i1 from 'ng-zorro-antd/drawer';
|
|
6
6
|
import { NzDrawerModule } from 'ng-zorro-antd/drawer';
|
|
7
7
|
import * as i3 from 'ng-zorro-antd/icon';
|
|
@@ -77,14 +77,15 @@ class Editor {
|
|
|
77
77
|
|
|
78
78
|
class SunEditorDrawer {
|
|
79
79
|
constructor() {
|
|
80
|
-
this.
|
|
80
|
+
this.editor = input.required();
|
|
81
|
+
this.width = input(600);
|
|
81
82
|
// TODO: 有些 model 不一定有 primaryKey,可能是两个 foreignKeys,所以要考虑将 operation 变为一个函数
|
|
82
83
|
// 考虑直接做到 signal 版本里,这里就变成一个 computed fn
|
|
83
|
-
this.primaryKey = 'id';
|
|
84
|
-
this.visibleChange =
|
|
84
|
+
this.primaryKey = input('id');
|
|
85
|
+
this.visibleChange = output();
|
|
85
86
|
}
|
|
86
87
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunEditorDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
87
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
88
|
+
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)\"\n (nzOnClose)=\"editor().visible = false\"\n>\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\n nzType=\"pushpin\"\n [nzTheme]=\"editor().pin ? 'twotone' : 'outline'\"\n (click)=\"editor().togglePin()\"\n ></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\"\n >*</span\n >\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 }); }
|
|
88
89
|
}
|
|
89
90
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunEditorDrawer, decorators: [{
|
|
90
91
|
type: Component,
|
|
@@ -93,16 +94,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
93
94
|
NzSpinModule,
|
|
94
95
|
NzIconModule,
|
|
95
96
|
NzTypographyModule
|
|
96
|
-
], 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)\"\n (nzOnClose)=\"editor.visible = false\"\n>\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 <
|
|
97
|
-
}]
|
|
98
|
-
type: Input
|
|
99
|
-
}], width: [{
|
|
100
|
-
type: Input
|
|
101
|
-
}], primaryKey: [{
|
|
102
|
-
type: Input
|
|
103
|
-
}], visibleChange: [{
|
|
104
|
-
type: Output
|
|
105
|
-
}] } });
|
|
97
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, 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)\"\n (nzOnClose)=\"editor().visible = false\"\n>\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\n nzType=\"pushpin\"\n [nzTheme]=\"editor().pin ? 'twotone' : 'outline'\"\n (click)=\"editor().togglePin()\"\n ></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\"\n >*</span\n >\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"] }]
|
|
98
|
+
}] });
|
|
106
99
|
|
|
107
100
|
class Searcher {
|
|
108
101
|
constructor() {
|
|
@@ -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 { FormGroup } from '@angular/forms';\nimport { form } from '@fluent-form/ui-zorro';\nimport { Observable, finalize, tap } from 'rxjs';\n\nexport class Editor<T> {\n private _visible = false;\n /** 模型初始值 */\n originalModel: T = {} as T;\n model: T = {} as T;\n loading = false;\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n schema = form(() => { });\n /** 是否在保存完之后固定抽屉 */\n pin = false;\n form?: FormGroup;\n\n get visible(): boolean {\n return this._visible;\n }\n\n set visible(value: boolean) {\n // 手动判断一下,因为双向绑定的原因,这里会被设置两次\n if (this._visible !== value) {\n if (!value) {\n this.reset(); // 关闭的时候自动重置\n }\n }\n this._visible = value;\n }\n\n /**\n * 自动控制 loading 状态\n */\n withLoading<X>() {\n this.loading = true;\n return (observable: Observable<X>) => {\n return observable.pipe(\n finalize(() => this.loading = 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 = true;\n }\n\n /**\n * 关闭编辑器\n */\n dismiss() {\n this.visible = false;\n }\n\n togglePin() {\n this.pin = !this.pin;\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 { Component, EventEmitter, 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})\nexport class SunEditorDrawer<T extends Record<string, any>> {\n @Input() editor!: Editor<T>;\n @Input() width: string | number = 600;\n // TODO: 有些 model 不一定有 primaryKey,可能是两个 foreignKeys,所以要考虑将 operation 变为一个函数\n // 考虑直接做到 signal 版本里,这里就变成一个 computed fn\n @Input() primaryKey = 'id';\n\n @Output() visibleChange = new EventEmitter<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)\"\n (nzOnClose)=\"editor.visible = false\"\n>\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 <span\n nz-icon\n nzType=\"pushpin\"\n [nzTheme]=\"editor.pin ? 'twotone' : 'outline'\"\n (click)=\"editor.togglePin()\"\n ></span>\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\"\n >*</span\n >\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":";;;;;;;;;;;;;;MAIa,MAAM,CAAA;AAAnB,IAAA,WAAA,GAAA;QACU,IAAQ,CAAA,QAAA,GAAG,KAAK;;QAExB,IAAa,CAAA,aAAA,GAAM,EAAO;QAC1B,IAAK,CAAA,KAAA,GAAM,EAAO;QAClB,IAAO,CAAA,OAAA,GAAG,KAAK;;QAEf,IAAM,CAAA,MAAA,GAAG,IAAI,CAAC,MAAQ,GAAC,CAAC;;QAExB,IAAG,CAAA,GAAA,GAAG,KAAK;;AAGX,IAAA,IAAI,OAAO,GAAA;QACT,OAAO,IAAI,CAAC,QAAQ;;IAGtB,IAAI,OAAO,CAAC,KAAc,EAAA;;AAExB,QAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE;YAC3B,IAAI,CAAC,KAAK,EAAE;AACV,gBAAA,IAAI,CAAC,KAAK,EAAE,CAAC;;;AAGjB,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;;AAGvB;;AAEG;IACH,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,OAAO,G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QAAQ,GAAG,KAAK;;AAEhC;;AAEG;AACH,IAAA,IAAc,MAAM,GAAA;AAClB,QAAA,OAAO,IAAI,CAAC,QAAQ,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 { FormGroup } from '@angular/forms';\nimport { form } from '@fluent-form/ui-zorro';\nimport { Observable, finalize, tap } from 'rxjs';\n\nexport class Editor<T> {\n private _visible = false;\n /** 模型初始值 */\n originalModel: T = {} as T;\n model: T = {} as T;\n loading = false;\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n schema = form(() => { });\n /** 是否在保存完之后固定抽屉 */\n pin = false;\n form?: FormGroup;\n\n get visible(): boolean {\n return this._visible;\n }\n\n set visible(value: boolean) {\n // 手动判断一下,因为双向绑定的原因,这里会被设置两次\n if (this._visible !== value) {\n if (!value) {\n this.reset(); // 关闭的时候自动重置\n }\n }\n this._visible = value;\n }\n\n /**\n * 自动控制 loading 状态\n */\n withLoading<X>() {\n this.loading = true;\n return (observable: Observable<X>) => {\n return observable.pipe(\n finalize(() => this.loading = 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 = true;\n }\n\n /**\n * 关闭编辑器\n */\n dismiss() {\n this.visible = false;\n }\n\n togglePin() {\n this.pin = !this.pin;\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)\"\n (nzOnClose)=\"editor().visible = false\"\n>\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\n nzType=\"pushpin\"\n [nzTheme]=\"editor().pin ? 'twotone' : 'outline'\"\n (click)=\"editor().togglePin()\"\n ></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\"\n >*</span\n >\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":";;;;;;;;;;;;;;MAIa,MAAM,CAAA;AAAnB,IAAA,WAAA,GAAA;QACU,IAAQ,CAAA,QAAA,GAAG,KAAK;;QAExB,IAAa,CAAA,aA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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,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i5 from 'ng-zorro-antd/avatar';
|
|
4
4
|
import { NzAvatarModule } from 'ng-zorro-antd/avatar';
|
|
5
5
|
import * as i6 from 'ng-zorro-antd/button';
|
|
@@ -17,13 +17,15 @@ import * as i8 from 'ng-zorro-antd/core/wave';
|
|
|
17
17
|
|
|
18
18
|
class SunFanPopover {
|
|
19
19
|
constructor() {
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
20
|
+
this.fan = input();
|
|
21
|
+
this.disabled = input();
|
|
22
|
+
this.trigger = input('click');
|
|
23
|
+
this.placement = input('top');
|
|
24
|
+
this.visibleChange = output();
|
|
25
|
+
this.unbind = output();
|
|
24
26
|
}
|
|
25
27
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunFanPopover, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
26
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
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
29
|
}
|
|
28
30
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunFanPopover, decorators: [{
|
|
29
31
|
type: Component,
|
|
@@ -34,20 +36,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
34
36
|
NzSpaceModule,
|
|
35
37
|
NzAvatarModule,
|
|
36
38
|
NzButtonModule
|
|
37
|
-
], 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)\"
|
|
38
|
-
}]
|
|
39
|
-
type: Input
|
|
40
|
-
}], disabled: [{
|
|
41
|
-
type: Input
|
|
42
|
-
}], trigger: [{
|
|
43
|
-
type: Input
|
|
44
|
-
}], placement: [{
|
|
45
|
-
type: Input
|
|
46
|
-
}], visibleChange: [{
|
|
47
|
-
type: Output
|
|
48
|
-
}], unbind: [{
|
|
49
|
-
type: Output
|
|
50
|
-
}] } });
|
|
39
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, 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" }]
|
|
40
|
+
}] });
|
|
51
41
|
|
|
52
42
|
/**
|
|
53
43
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solar-angular-ui-zorro-fan-popover.mjs","sources":["../../../packages/ui-zorro/fan-popover/fan-popover.component.ts","../../../packages/ui-zorro/fan-popover/fan-popover.component.html","../../../packages/ui-zorro/fan-popover/solar-angular-ui-zorro-fan-popover.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"solar-angular-ui-zorro-fan-popover.mjs","sources":["../../../packages/ui-zorro/fan-popover/fan-popover.component.ts","../../../packages/ui-zorro/fan-popover/fan-popover.component.html","../../../packages/ui-zorro/fan-popover/solar-angular-ui-zorro-fan-popover.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { Fan } from '@solar-kit/planets/earth';\nimport { NzAvatarModule } from 'ng-zorro-antd/avatar';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzPopoverModule } from 'ng-zorro-antd/popover';\nimport { NzSpaceModule } from 'ng-zorro-antd/space';\nimport { NzTooltipTrigger } from 'ng-zorro-antd/tooltip';\nimport { NzTypographyModule } from 'ng-zorro-antd/typography';\n\n@Component({\n selector: 'sun-fan-popover',\n imports: [\n NzPopoverModule,\n NzIconModule,\n NzTypographyModule,\n NzSpaceModule,\n NzAvatarModule,\n NzButtonModule\n ],\n templateUrl: './fan-popover.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SunFanPopover {\n readonly fan = input<Fan | null>();\n readonly disabled = input<boolean>();\n readonly trigger = input<NzTooltipTrigger>('click');\n readonly placement = input<string | string[]>('top');\n\n readonly visibleChange = output<boolean>();\n readonly unbind = output();\n}\n","<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 || '微信用户' }}</div>\n <button *nzSpaceItem nz-button nzSize=\"small\" nzDanger nzBlock nzType=\"primary\" (click)=\"unbind.emit()\">\n 解绑\n </button>\n </nz-space>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAuBa,aAAa,CAAA;AAb1B,IAAA,WAAA,GAAA;QAcW,IAAG,CAAA,GAAA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A,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAClB,OAAA,EAAA;wBACP,eAAe;wBACf,YAAY;wBACZ,kBAAkB;wBAClB,aAAa;wBACb,cAAc;wBACd;qBACD,EAEgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,g4BAAA,EAAA;;;AErBjD;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpEventType } from '@angular/common/http';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject,
|
|
3
|
+
import { inject, model, input, numberAttribute, booleanAttribute, output, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { EarthService, ObjectStorageService } from '@solar-angular/planets/earth';
|
|
5
5
|
import { ImageCompressor, FileManager } from '@solar-angular/platform-browser';
|
|
6
6
|
import { MessageService } from '@solar-angular/ui-zorro/message';
|
|
@@ -23,7 +23,7 @@ class SunMediaUploader {
|
|
|
23
23
|
this.imageCompressor = inject(ImageCompressor);
|
|
24
24
|
this.message = inject(MessageService);
|
|
25
25
|
this.fileManager = inject(FileManager);
|
|
26
|
-
this.data = [
|
|
26
|
+
this.data = model([
|
|
27
27
|
// {
|
|
28
28
|
// uid: '1',
|
|
29
29
|
// type: 'image',
|
|
@@ -35,31 +35,30 @@ class SunMediaUploader {
|
|
|
35
35
|
// type: 'image',
|
|
36
36
|
// url: '',
|
|
37
37
|
// }
|
|
38
|
-
];
|
|
39
|
-
this.limit = 9;
|
|
40
|
-
this.deletable = true;
|
|
41
|
-
this.uploadable = true;
|
|
42
|
-
this.previewable = true;
|
|
43
|
-
this.downloadable = false;
|
|
44
|
-
this.shape = 'square';
|
|
45
|
-
this.uploadKeys = this.earthService.mediaUploadKeys().pipe(filterResult(), unpackResult());
|
|
38
|
+
]);
|
|
39
|
+
this.limit = input(9, { transform: numberAttribute });
|
|
40
|
+
this.deletable = input(true, { transform: booleanAttribute });
|
|
41
|
+
this.uploadable = input(true, { transform: booleanAttribute });
|
|
42
|
+
this.previewable = input(true, { transform: booleanAttribute });
|
|
43
|
+
this.downloadable = input(false, { transform: booleanAttribute });
|
|
44
|
+
this.shape = input('square');
|
|
45
|
+
this.uploadKeys = input(this.earthService.mediaUploadKeys().pipe(filterResult(), unpackResult()));
|
|
46
46
|
/** 启用图片压缩 */
|
|
47
|
-
this.compress = false;
|
|
48
|
-
this.uploaded =
|
|
49
|
-
this.delete =
|
|
50
|
-
this.error =
|
|
51
|
-
this.dataChange = new EventEmitter();
|
|
47
|
+
this.compress = input(false, { transform: booleanAttribute });
|
|
48
|
+
this.uploaded = output();
|
|
49
|
+
this.delete = output();
|
|
50
|
+
this.error = output();
|
|
52
51
|
this.upload = (args) => {
|
|
53
52
|
const file = args.postFile;
|
|
54
53
|
const ext = fileExtensionOf(args.file.name);
|
|
55
|
-
return this.uploadKeys.pipe(switchMap(uploadKey => this.oss.uploadWithEvents(file, `${uploadKey.keys[0]}.${ext}`, uploadKey))).subscribe({
|
|
54
|
+
return this.uploadKeys().pipe(switchMap(uploadKey => this.oss.uploadWithEvents(file, `${uploadKey.keys[0]}.${ext}`, uploadKey))).subscribe({
|
|
56
55
|
next: event => {
|
|
57
56
|
switch (event.type) {
|
|
58
57
|
case HttpEventType.UploadProgress:
|
|
59
58
|
args.onProgress({ percent: (event.loaded / event.total) * 100 }, args.file);
|
|
60
59
|
break;
|
|
61
60
|
case HttpEventType.Response:
|
|
62
|
-
this.uploaded.
|
|
61
|
+
this.uploaded.emit({
|
|
63
62
|
url: URL.createObjectURL(file),
|
|
64
63
|
...event.body
|
|
65
64
|
});
|
|
@@ -86,38 +85,38 @@ class SunMediaUploader {
|
|
|
86
85
|
};
|
|
87
86
|
}
|
|
88
87
|
onChange({ type, file, event }) {
|
|
89
|
-
const media = this.data.find(o => o.uid === file.uid);
|
|
88
|
+
const media = this.data().find(o => o.uid === file.uid);
|
|
90
89
|
switch (type) {
|
|
91
90
|
case 'start': {
|
|
92
91
|
const url = URL.createObjectURL(file.originFileObj);
|
|
93
|
-
this.data
|
|
92
|
+
this.data.update(value => value.concat({
|
|
94
93
|
uid: file.uid,
|
|
95
94
|
url: url,
|
|
96
95
|
thumbnailUrl: url,
|
|
97
96
|
progress: 0.01,
|
|
98
97
|
type: 'image',
|
|
99
98
|
file: file.originFileObj
|
|
100
|
-
});
|
|
101
|
-
this.dataChange.emit(this.data);
|
|
99
|
+
}));
|
|
102
100
|
break;
|
|
103
101
|
}
|
|
104
102
|
case 'progress':
|
|
105
103
|
media.progress = +event.percent.toFixed(2);
|
|
104
|
+
this.data.update(value => [...value]);
|
|
106
105
|
break;
|
|
107
106
|
case 'success':
|
|
108
107
|
delete media.progress;
|
|
108
|
+
this.data.update(value => [...value]);
|
|
109
109
|
break;
|
|
110
110
|
case 'error':
|
|
111
|
-
this.data
|
|
112
|
-
this.dataChange.emit(this.data);
|
|
111
|
+
this.data.update(value => value.filter(o => o.uid !== file.uid));
|
|
113
112
|
this.error.emit(media);
|
|
114
113
|
break;
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
onPreview(media) {
|
|
118
|
-
const images = this.data.map(o => ({ src: o.url || o.thumbnailUrl }));
|
|
117
|
+
const images = this.data().map(o => ({ src: o.url || o.thumbnailUrl }));
|
|
119
118
|
const ref = this.imageService.preview(images);
|
|
120
|
-
ref.switchTo(this.data.findIndex(o => o === media));
|
|
119
|
+
ref.switchTo(this.data().findIndex(o => o === media));
|
|
121
120
|
}
|
|
122
121
|
onDownload(media) {
|
|
123
122
|
from(this.fileManager.download(media.url)).pipe(this.message.withLoading('正在下载')).subscribe({
|
|
@@ -127,7 +126,7 @@ class SunMediaUploader {
|
|
|
127
126
|
});
|
|
128
127
|
}
|
|
129
128
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunMediaUploader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
130
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: SunMediaUploader, isStandalone: true, selector: "sun-media-uploader", inputs: { data: "data", limit:
|
|
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 }); }
|
|
131
130
|
}
|
|
132
131
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunMediaUploader, decorators: [{
|
|
133
132
|
type: Component,
|
|
@@ -138,41 +137,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
138
137
|
NzPopconfirmModule
|
|
139
138
|
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
140
139
|
class: 'sun-media-uploader',
|
|
141
|
-
'[class.sun-media-uploader-circle]': `shape === 'circle'`,
|
|
142
|
-
}, template: "@for (item of data; track item) {\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 <
|
|
143
|
-
}]
|
|
144
|
-
type: Input
|
|
145
|
-
}], limit: [{
|
|
146
|
-
type: Input,
|
|
147
|
-
args: [{ transform: numberAttribute }]
|
|
148
|
-
}], deletable: [{
|
|
149
|
-
type: Input,
|
|
150
|
-
args: [{ transform: booleanAttribute }]
|
|
151
|
-
}], uploadable: [{
|
|
152
|
-
type: Input,
|
|
153
|
-
args: [{ transform: booleanAttribute }]
|
|
154
|
-
}], previewable: [{
|
|
155
|
-
type: Input,
|
|
156
|
-
args: [{ transform: booleanAttribute }]
|
|
157
|
-
}], downloadable: [{
|
|
158
|
-
type: Input,
|
|
159
|
-
args: [{ transform: booleanAttribute }]
|
|
160
|
-
}], shape: [{
|
|
161
|
-
type: Input
|
|
162
|
-
}], uploadKeys: [{
|
|
163
|
-
type: Input
|
|
164
|
-
}], compress: [{
|
|
165
|
-
type: Input,
|
|
166
|
-
args: [{ transform: booleanAttribute }]
|
|
167
|
-
}], uploaded: [{
|
|
168
|
-
type: Output
|
|
169
|
-
}], delete: [{
|
|
170
|
-
type: Output
|
|
171
|
-
}], error: [{
|
|
172
|
-
type: Output
|
|
173
|
-
}], dataChange: [{
|
|
174
|
-
type: Output
|
|
175
|
-
}] } });
|
|
140
|
+
'[class.sun-media-uploader-circle]': `shape() === 'circle'`,
|
|
141
|
+
}, 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"] }]
|
|
142
|
+
}] });
|
|
176
143
|
|
|
177
144
|
/**
|
|
178
145
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solar-angular-ui-zorro-media-uploader.mjs","sources":["../../../packages/ui-zorro/media-uploader/media-uploader.component.ts","../../../packages/ui-zorro/media-uploader/media-uploader.component.html","../../../packages/ui-zorro/media-uploader/solar-angular-ui-zorro-media-uploader.ts"],"sourcesContent":["import { HttpEventType } from '@angular/common/http';\nimport { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation, booleanAttribute, inject, numberAttribute } from '@angular/core';\nimport { EarthService, ObjectStorageService } from '@solar-angular/planets/earth';\nimport { FileManager, ImageCompressor } from '@solar-angular/platform-browser';\nimport { MessageService } from '@solar-angular/ui-zorro/message';\nimport { fileExtensionOf } from '@solar-kit/core';\nimport { filterResult, unpackResult } from '@solar-kit/planets/sun';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzImageModule, NzImageService } from 'ng-zorro-antd/image';\nimport { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm';\nimport { NzUploadChangeParam, NzUploadFile, NzUploadModule, NzUploadXHRArgs } from 'ng-zorro-antd/upload';\nimport { Observable, from, fromEvent, of, switchMap, take, tap } from 'rxjs';\n\nexport interface SunMedia {\n uid: string;\n type: 'image' | 'video';\n progress?: number;\n active?: boolean;\n file?: Blob;\n url: string\n thumbnailUrl?: string;\n [key: string]: any;\n}\n\n@Component({\n selector: 'sun-media-uploader',\n imports: [\n NzIconModule,\n NzUploadModule,\n NzImageModule,\n NzPopconfirmModule\n ],\n templateUrl: './media-uploader.component.html',\n styleUrl: './media-uploader.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'sun-media-uploader',\n '[class.sun-media-uploader-circle]': `shape === 'circle'`,\n }\n})\nexport class SunMediaUploader {\n private readonly imageService = inject(NzImageService);\n private readonly earthService = inject(EarthService);\n private readonly oss = inject(ObjectStorageService);\n private readonly imageCompressor = inject(ImageCompressor);\n private readonly message = inject(MessageService);\n private readonly fileManager = inject(FileManager);\n\n @Input() data: SunMedia[] = [\n // {\n // uid: '1',\n // type: 'image',\n // url: '',\n // progress: 50\n // },\n // {\n // uid: '2',\n // type: 'image',\n // url: '',\n // }\n ];\n @Input({ transform: numberAttribute }) limit = 9;\n @Input({ transform: booleanAttribute }) deletable = true;\n @Input({ transform: booleanAttribute }) uploadable = true;\n @Input({ transform: booleanAttribute }) previewable = true;\n @Input({ transform: booleanAttribute }) downloadable = false;\n @Input() shape: 'circle' | 'square' = 'square';\n @Input() uploadKeys = this.earthService.mediaUploadKeys().pipe(\n filterResult(),\n unpackResult(),\n );\n /** 启用图片压缩 */\n @Input({ transform: booleanAttribute }) compress = false;\n\n @Output() uploaded = new EventEmitter<{ key: string, hash: string, url: string }>();\n @Output() delete = new EventEmitter<SunMedia>();\n @Output() error = new EventEmitter<SunMedia>();\n @Output() dataChange = new EventEmitter<SunMedia[]>();\n\n get transform() {\n return (file: NzUploadFile): Observable<Blob> => {\n if (!file.type?.startsWith('image/')) {\n return of(file as any);\n }\n\n const { messageId } = this.message.loading('正在压缩图像');\n const reader = new FileReader();\n\n const source = fromEvent(reader, 'load').pipe(\n take(1),\n switchMap(() => this.imageCompressor.compress(reader.result as string)),\n tap(() => this.message.remove(messageId))\n );\n reader.readAsDataURL(file as any);\n\n return source;\n };\n }\n\n upload = (args: NzUploadXHRArgs) => {\n const file = args.postFile as File;\n const ext = fileExtensionOf(args.file.name);\n\n return this.uploadKeys.pipe(\n switchMap(uploadKey => this.oss.uploadWithEvents(file, `${uploadKey.keys[0]}.${ext}`, uploadKey)),\n ).subscribe({\n next: event => {\n switch (event.type) {\n case HttpEventType.UploadProgress:\n args.onProgress!({ percent: (event.loaded / event.total!) * 100 }, args.file);\n break;\n\n case HttpEventType.Response:\n this.uploaded.next({\n url: URL.createObjectURL(file),\n ...event.body!\n });\n args.onSuccess!(event.body, args.file, event);\n break;\n }\n },\n error: error => {\n args.onError!(error, args.file);\n }\n });\n };\n\n onChange({ type, file, event }: NzUploadChangeParam): void {\n const media = this.data.find(o => o.uid === file.uid)!;\n\n switch (type) {\n case 'start': {\n const url = URL.createObjectURL(file.originFileObj!);\n this.data = this.data.concat({\n uid: file.uid,\n url: url,\n thumbnailUrl: url,\n progress: 0.01,\n type: 'image',\n file: file.originFileObj\n });\n this.dataChange.emit(this.data);\n break;\n }\n\n case 'progress':\n media.progress = +event!.percent.toFixed(2);\n break;\n\n case 'success':\n delete media.progress;\n break;\n\n case 'error':\n this.data = this.data.filter(o => o.uid !== file.uid);\n this.dataChange.emit(this.data);\n this.error.emit(media);\n break;\n }\n }\n\n onPreview(media: SunMedia) {\n const images = this.data.map(o => ({ src: o.url || o.thumbnailUrl! }));\n const ref = this.imageService.preview(images);\n ref.switchTo(this.data.findIndex(o => o === media));\n }\n\n onDownload(media: SunMedia) {\n from(this.fileManager.download(media.url)).pipe(\n this.message.withLoading('正在下载')\n ).subscribe({\n error: () => {\n this.message.error('下载失败');\n }\n });\n }\n}\n","@for (item of data; track item) {\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>上传中...</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 <span nz-icon nzType=\"eye\" nzTheme=\"outline\"></span>预览\n </div>\n }\n @if (downloadable) {\n <div class=\"sun-media-uploader-action\" (click)=\"onDownload(item)\">\n <span nz-icon nzType=\"download\" nzTheme=\"outline\"></span>下载\n </div>\n }\n @if (deletable) {\n <div\n class=\"sun-media-uploader-action\"\n nz-popconfirm\n nzType=\"danger\"\n nzPopconfirmTitle=\"您确定要删除该项目吗?\"\n nzOkDanger\n (nzOnConfirm)=\"delete.next(item)\">\n <span nz-icon nzType=\"delete\" nzTheme=\"outline\"></span>删除\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 <span nz-icon nzType=\"plus\"></span>\n <div class=\"sun-media-uploader-btn-text\">点击上传</div>\n </div>\n</nz-upload>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAyCa,gBAAgB,CAAA;AAjB7B,IAAA,WAAA,GAAA;AAkBmB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AACnC,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAClC,QAAA,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AAE,SAAS,EAAE,gBAAgB,EAAE;gBACE,WAAW,EAAA,CAAA;sBAAlD,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBACE,YAAY,EAAA,CAAA;sBAAnD,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBAC7B,KAAK,EAAA,CAAA;sBAAb;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBAKuC,QAAQ,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBAE5B,QAAQ,EAAA,CAAA;sBAAjB;gBACS,MAAM,EAAA,CAAA;sBAAf;gBACS,KAAK,EAAA,CAAA;sBAAd;gBACS,UAAU,EAAA,CAAA;sBAAnB;;;AE9EH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"solar-angular-ui-zorro-media-uploader.mjs","sources":["../../../packages/ui-zorro/media-uploader/media-uploader.component.ts","../../../packages/ui-zorro/media-uploader/media-uploader.component.html","../../../packages/ui-zorro/media-uploader/solar-angular-ui-zorro-media-uploader.ts"],"sourcesContent":["import { HttpEventType } from '@angular/common/http';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, booleanAttribute, inject, input, model, numberAttribute, output } from '@angular/core';\nimport { EarthService, ObjectStorageService } from '@solar-angular/planets/earth';\nimport { FileManager, ImageCompressor } from '@solar-angular/platform-browser';\nimport { MessageService } from '@solar-angular/ui-zorro/message';\nimport { fileExtensionOf } from '@solar-kit/core';\nimport { filterResult, unpackResult } from '@solar-kit/planets/sun';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzImageModule, NzImageService } from 'ng-zorro-antd/image';\nimport { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm';\nimport { NzUploadChangeParam, NzUploadFile, NzUploadModule, NzUploadXHRArgs } from 'ng-zorro-antd/upload';\nimport { Observable, from, fromEvent, of, switchMap, take, tap } from 'rxjs';\n\nexport interface SunMedia {\n uid: string;\n type: 'image' | 'video';\n progress?: number;\n active?: boolean;\n file?: Blob;\n url: string\n thumbnailUrl?: string;\n [key: string]: any;\n}\n\n@Component({\n selector: 'sun-media-uploader',\n imports: [\n NzIconModule,\n NzUploadModule,\n NzImageModule,\n NzPopconfirmModule\n ],\n templateUrl: './media-uploader.component.html',\n styleUrl: './media-uploader.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'sun-media-uploader',\n '[class.sun-media-uploader-circle]': `shape() === 'circle'`,\n }\n})\nexport class SunMediaUploader {\n private readonly imageService = inject(NzImageService);\n private readonly earthService = inject(EarthService);\n private readonly oss = inject(ObjectStorageService);\n private readonly imageCompressor = inject(ImageCompressor);\n private readonly message = inject(MessageService);\n private readonly fileManager = inject(FileManager);\n\n readonly data = model<SunMedia[]>([\n // {\n // uid: '1',\n // type: 'image',\n // url: '',\n // progress: 50\n // },\n // {\n // uid: '2',\n // type: 'image',\n // url: '',\n // }\n ]);\n readonly limit = input(9, { transform: numberAttribute });\n readonly deletable = input(true, { transform: booleanAttribute });\n readonly uploadable = input(true, { transform: booleanAttribute });\n readonly previewable = input(true, { transform: booleanAttribute });\n readonly downloadable = input(false, { transform: booleanAttribute });\n readonly shape = input<'circle' | 'square'>('square');\n readonly uploadKeys = input(this.earthService.mediaUploadKeys().pipe(filterResult(), unpackResult()));\n /** 启用图片压缩 */\n readonly compress = input(false, { transform: booleanAttribute });\n\n readonly uploaded = output<{\n key: string;\n hash: string;\n url: string;\n }>();\n readonly delete = output<SunMedia>();\n readonly error = output<SunMedia>();\n\n get transform() {\n return (file: NzUploadFile): Observable<Blob> => {\n if (!file.type?.startsWith('image/')) {\n return of(file as any);\n }\n\n const { messageId } = this.message.loading('正在压缩图像');\n const reader = new FileReader();\n\n const source = fromEvent(reader, 'load').pipe(\n take(1),\n switchMap(() => this.imageCompressor.compress(reader.result as string)),\n tap(() => this.message.remove(messageId))\n );\n reader.readAsDataURL(file as any);\n\n return source;\n };\n }\n\n readonly upload = (args: NzUploadXHRArgs) => {\n const file = args.postFile as File;\n const ext = fileExtensionOf(args.file.name);\n\n return this.uploadKeys().pipe(\n switchMap(uploadKey => this.oss.uploadWithEvents(file, `${uploadKey.keys[0]}.${ext}`, uploadKey)),\n ).subscribe({\n next: event => {\n switch (event.type) {\n case HttpEventType.UploadProgress:\n args.onProgress!({ percent: (event.loaded / event.total!) * 100 }, args.file);\n break;\n\n case HttpEventType.Response:\n this.uploaded.emit({\n url: URL.createObjectURL(file),\n ...event.body!\n });\n args.onSuccess!(event.body, args.file, event);\n break;\n }\n },\n error: error => {\n args.onError!(error, args.file);\n }\n });\n };\n\n onChange({ type, file, event }: NzUploadChangeParam): void {\n const media = this.data().find(o => o.uid === file.uid)!;\n\n switch (type) {\n case 'start': {\n const url = URL.createObjectURL(file.originFileObj!);\n this.data.update(value =>\n value.concat({\n uid: file.uid,\n url: url,\n thumbnailUrl: url,\n progress: 0.01,\n type: 'image',\n file: file.originFileObj\n })\n )\n break;\n }\n\n case 'progress':\n media.progress = +event!.percent.toFixed(2);\n this.data.update(value => [...value])\n break;\n\n case 'success':\n delete media.progress;\n this.data.update(value => [...value])\n break;\n\n case 'error':\n this.data.update(value => value.filter(o => o.uid !== file.uid))\n this.error.emit(media);\n break;\n }\n }\n\n onPreview(media: SunMedia) {\n const images = this.data().map(o => ({ src: o.url || o.thumbnailUrl! }));\n const ref = this.imageService.preview(images);\n ref.switchTo(this.data().findIndex(o => o === media));\n }\n\n onDownload(media: SunMedia) {\n from(this.fileManager.download(media.url)).pipe(\n this.message.withLoading('正在下载')\n ).subscribe({\n error: () => {\n this.message.error('下载失败');\n }\n });\n }\n}\n","@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>上传中...</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 预览\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 下载\n </div>\n }\n @if (deletable()) {\n <div\n class=\"sun-media-uploader-action\"\n nz-popconfirm\n nzType=\"danger\"\n nzPopconfirmTitle=\"您确定要删除该项目吗?\"\n nzOkDanger\n (nzOnConfirm)=\"delete.emit(item)\">\n <nz-icon nzType=\"delete\" nzTheme=\"outline\"></nz-icon>\n 删除\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\">点击上传</div>\n </div>\n</nz-upload>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAyCa,gBAAgB,CAAA;AAjB7B,IAAA,WAAA,GAAA;AAkBmB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AACnC,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAClC,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,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from '@angular/core';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { RouterLink } from '@angular/router';
|
|
4
4
|
import * as i3 from 'ng-zorro-antd/button';
|
|
5
5
|
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
@@ -12,7 +12,7 @@ import * as i5 from 'ng-zorro-antd/core/wave';
|
|
|
12
12
|
|
|
13
13
|
class SunForbiddenPage {
|
|
14
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 <
|
|
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 }); }
|
|
16
16
|
}
|
|
17
17
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunForbiddenPage, decorators: [{
|
|
18
18
|
type: Component,
|
|
@@ -21,7 +21,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
21
21
|
NzResultModule,
|
|
22
22
|
NzIconModule,
|
|
23
23
|
NzButtonModule
|
|
24
|
-
], 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 <
|
|
24
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
25
25
|
}] });
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solar-angular-ui-zorro-page-forbidden.mjs","sources":["../../../packages/ui-zorro/page-forbidden/forbidden.page.ts","../../../packages/ui-zorro/page-forbidden/forbidden.page.html","../../../packages/ui-zorro/page-forbidden/solar-angular-ui-zorro-page-forbidden.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzResultModule } from 'ng-zorro-antd/result';\n\n@Component({\n selector: 'sun-forbidden',\n imports: [\n RouterLink,\n NzResultModule,\n NzIconModule,\n NzButtonModule\n ],\n templateUrl: './forbidden.page.html',\n styleUrl: './forbidden.page.scss'
|
|
1
|
+
{"version":3,"file":"solar-angular-ui-zorro-page-forbidden.mjs","sources":["../../../packages/ui-zorro/page-forbidden/forbidden.page.ts","../../../packages/ui-zorro/page-forbidden/forbidden.page.html","../../../packages/ui-zorro/page-forbidden/solar-angular-ui-zorro-page-forbidden.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzResultModule } from 'ng-zorro-antd/result';\n\n@Component({\n selector: 'sun-forbidden',\n imports: [\n RouterLink,\n NzResultModule,\n NzIconModule,\n NzButtonModule\n ],\n templateUrl: './forbidden.page.html',\n styleUrl: './forbidden.page.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SunForbiddenPage { }\n","<nz-result nzStatus=\"403\" nzTitle=\"403\" nzSubTitle=\"抱歉,您没有权限访问该页面\">\n <div nz-result-extra>\n <button nz-button nzType=\"primary\" routerLink=\"/\">\n <nz-icon nzType=\"arrow-left\" nzTheme=\"outline\"></nz-icon>\n 返回主页\n </button>\n </div>\n</nz-result>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAkBa,gBAAgB,CAAA;+GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClB7B,+WAQA,EDCI,MAAA,EAAA,CAAA,4IAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,UAAU,mOACV,cAAc,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,iBAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,SAAA,EAAA,UAAA,EAAA,YAAA,EAAA,SAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,E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EAAA,QAAA,EAAA,eAAe,EAChB,OAAA,EAAA;wBACP,UAAU;wBACV,cAAc;wBACd,YAAY;wBACZ;qBACD,EAGgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,+WAAA,EAAA,MAAA,EAAA,CAAA,4IAAA,CAAA,EAAA;;;AEhBjD;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AsyncPipe } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Component } from '@angular/core';
|
|
3
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import * as i4 from 'ng-zorro-antd/button';
|
|
6
6
|
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
@@ -23,7 +23,7 @@ class SunLogoutPage {
|
|
|
23
23
|
this.router.navigateByUrl('/login');
|
|
24
24
|
}
|
|
25
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 <
|
|
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 }); }
|
|
27
27
|
}
|
|
28
28
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunLogoutPage, decorators: [{
|
|
29
29
|
type: Component,
|
|
@@ -32,7 +32,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
32
32
|
NzResultModule,
|
|
33
33
|
NzIconModule,
|
|
34
34
|
NzButtonModule
|
|
35
|
-
], 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 <
|
|
35
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
36
36
|
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solar-angular-ui-zorro-page-logout.mjs","sources":["../../../packages/ui-zorro/page-logout/logout.page.ts","../../../packages/ui-zorro/page-logout/logout.page.html","../../../packages/ui-zorro/page-logout/solar-angular-ui-zorro-page-logout.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Router } from '@angular/router';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzResultModule } from 'ng-zorro-antd/result';\nimport { last, shareReplay, take, timer } from 'rxjs';\n\n@Component({\n selector: 'sun-logout',\n imports: [\n AsyncPipe,\n NzResultModule,\n NzIconModule,\n NzButtonModule\n ],\n templateUrl: './logout.page.html',\n styleUrl: './logout.page.scss'
|
|
1
|
+
{"version":3,"file":"solar-angular-ui-zorro-page-logout.mjs","sources":["../../../packages/ui-zorro/page-logout/logout.page.ts","../../../packages/ui-zorro/page-logout/logout.page.html","../../../packages/ui-zorro/page-logout/solar-angular-ui-zorro-page-logout.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Router } from '@angular/router';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzResultModule } from 'ng-zorro-antd/result';\nimport { last, shareReplay, take, timer } from 'rxjs';\n\n@Component({\n selector: 'sun-logout',\n imports: [\n AsyncPipe,\n NzResultModule,\n NzIconModule,\n NzButtonModule\n ],\n templateUrl: './logout.page.html',\n styleUrl: './logout.page.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SunLogoutPage {\n protected readonly interval$ = timer(0, 1000).pipe(\n take(6),\n shareReplay(1)\n );\n\n constructor(private router: Router) {\n this.interval$.pipe(\n last(),\n takeUntilDestroyed()\n ).subscribe(() => this.login());\n }\n\n login() {\n this.router.navigateByUrl('/login');\n }\n\n}\n","<nz-result\n nzStatus=\"success\"\n nzTitle=\"您已成功退出登录!\"\n [nzSubTitle]=\"'系统将在 ' + (5 - (interval$ | async)!) + ' 秒后自动重定向...'\"\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 立即登录\n </button>\n </div>\n</nz-result>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAqBa,aAAa,CAAA;AAMxB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;QALP,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAChD,IAAI,CAAC,CAAC,CAAC,EACP,WAAW,CAAC,CAAC,CAAC,CACf;QAGC,IAAI,CAAC,SAAS,CAAC,IAAI,CACjB,IAAI,EAAE,EACN,kBAAkB,EAAE,CACrB,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;;IAGjC,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC;;+GAd1B,aAAa,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECrB1B,+cAYA,EDAI,MAAA,EAAA,CAAA,4IAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,SAAS,6CACT,cAAc,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,iBAAA,EAA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A,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAML,aAAa,EAAA,UAAA,EAAA,CAAA;kBAZzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EACb,OAAA,EAAA;wBACP,SAAS;wBACT,cAAc;wBACd,YAAY;wBACZ;qBACD,EAGgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,+cAAA,EAAA,MAAA,EAAA,CAAA,4IAAA,CAAA,EAAA;;;AEnBjD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { RouterLink } from '@angular/router';
|
|
4
4
|
import * as i3 from 'ng-zorro-antd/button';
|
|
5
5
|
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
@@ -12,7 +12,7 @@ import * as i5 from 'ng-zorro-antd/core/wave';
|
|
|
12
12
|
|
|
13
13
|
class SunNotFoundPage {
|
|
14
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 <
|
|
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 }); }
|
|
16
16
|
}
|
|
17
17
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunNotFoundPage, decorators: [{
|
|
18
18
|
type: Component,
|
|
@@ -21,7 +21,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
21
21
|
NzResultModule,
|
|
22
22
|
NzIconModule,
|
|
23
23
|
NzButtonModule
|
|
24
|
-
], 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 <
|
|
24
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
25
25
|
}] });
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solar-angular-ui-zorro-page-not-found.mjs","sources":["../../../packages/ui-zorro/page-not-found/not-found.page.ts","../../../packages/ui-zorro/page-not-found/not-found.page.html","../../../packages/ui-zorro/page-not-found/solar-angular-ui-zorro-page-not-found.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzResultModule } from 'ng-zorro-antd/result';\n\n@Component({\n selector: 'sun-not-found',\n imports: [\n RouterLink,\n NzResultModule,\n NzIconModule,\n NzButtonModule\n ],\n templateUrl: './not-found.page.html',\n styleUrl: './not-found.page.scss'
|
|
1
|
+
{"version":3,"file":"solar-angular-ui-zorro-page-not-found.mjs","sources":["../../../packages/ui-zorro/page-not-found/not-found.page.ts","../../../packages/ui-zorro/page-not-found/not-found.page.html","../../../packages/ui-zorro/page-not-found/solar-angular-ui-zorro-page-not-found.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzResultModule } from 'ng-zorro-antd/result';\n\n@Component({\n selector: 'sun-not-found',\n imports: [\n RouterLink,\n NzResultModule,\n NzIconModule,\n NzButtonModule\n ],\n templateUrl: './not-found.page.html',\n styleUrl: './not-found.page.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SunNotFoundPage { }\n","<nz-result nzStatus=\"404\" nzTitle=\"404\" nzSubTitle=\"抱歉,您访问的页面不存在\">\n <div nz-result-extra>\n <button nz-button nzType=\"primary\" routerLink=\"/\">\n <nz-icon nzType=\"arrow-left\" nzTheme=\"outline\"></nz-icon>\n 返回主页\n </button>\n </div>\n</nz-result>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAkBa,eAAe,CAAA;+GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClB5B,y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QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2EAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAML,eAAe,EAAA,UAAA,EAAA,CAAA;kBAZ3B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAChB,OAAA,EAAA;wBACP,UAAU;wBACV,cAAc;wBACd,YAAY;wBACZ;qBACD,EAGgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,yWAAA,EAAA,MAAA,EAAA,CAAA,4IAAA,CAAA,EAAA;;;AEhBjD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable,
|
|
2
|
+
import { inject, Injectable, viewChild, TemplateRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { SwUpdate } from '@angular/service-worker';
|
|
4
4
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
5
5
|
import { DOCUMENT } from '@angular/common';
|
|
@@ -7,10 +7,10 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
|
7
7
|
import * as i1 from 'ng-zorro-antd/button';
|
|
8
8
|
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
9
9
|
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
10
|
-
import { NzNotificationService
|
|
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,
|
|
13
|
+
import { filter, exhaustMap } 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
|
|
|
@@ -20,12 +20,10 @@ class AppUpdater {
|
|
|
20
20
|
this.message = inject(NzMessageService);
|
|
21
21
|
}
|
|
22
22
|
checkForUpdate() {
|
|
23
|
-
const loading = this.message.loading('正在检查更新...', { nzDuration: 0 });
|
|
24
23
|
this.update.checkForUpdate()
|
|
25
24
|
// 这里我们只处理 bool 为 false 的情况;如果为 true,意味着有新版本,应该由 sun-updates 组件处理
|
|
26
25
|
.then(bool => bool || this.message.info('当前已是最新版本'))
|
|
27
|
-
.catch(() => this.message.error('检查更新失败'))
|
|
28
|
-
.finally(() => this.message.remove(loading.messageId));
|
|
26
|
+
.catch(() => this.message.error('检查更新失败'));
|
|
29
27
|
}
|
|
30
28
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppUpdater, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
31
29
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppUpdater, providedIn: 'root' }); }
|
|
@@ -41,11 +39,13 @@ class SunUpdater {
|
|
|
41
39
|
constructor() {
|
|
42
40
|
this.location = inject(DOCUMENT).defaultView.location;
|
|
43
41
|
this.notification = inject(NzNotificationService);
|
|
42
|
+
this.templateRef = viewChild.required(TemplateRef);
|
|
44
43
|
const updater = inject(SwUpdate);
|
|
45
44
|
let loadingRef;
|
|
46
|
-
updater.versionUpdates.pipe(filter(event => event.type === 'VERSION_DETECTED'),
|
|
45
|
+
updater.versionUpdates.pipe(filter(event => event.type === 'VERSION_DETECTED'), exhaustMap(() => {
|
|
47
46
|
loadingRef = this.notification.info('温馨提示', '发现新版本,正在下载更新...', { nzCloseIcon: 'loading', nzDuration: 0 });
|
|
48
|
-
|
|
47
|
+
return updater.versionUpdates.pipe(filter(event => event.type === 'VERSION_READY'));
|
|
48
|
+
}), takeUntilDestroyed()).subscribe(() => {
|
|
49
49
|
this.notification.remove(loadingRef.messageId);
|
|
50
50
|
this.present();
|
|
51
51
|
});
|
|
@@ -59,7 +59,7 @@ class SunUpdater {
|
|
|
59
59
|
}
|
|
60
60
|
present() {
|
|
61
61
|
this.notification.info('新版本已就绪', '为了让您获得更好的使用体验,我们建议您立即进行更新。', {
|
|
62
|
-
nzButton: this.templateRef,
|
|
62
|
+
nzButton: this.templateRef(),
|
|
63
63
|
nzDuration: 0
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -73,20 +73,16 @@ class SunUpdater {
|
|
|
73
73
|
}, 1000 * 60 * 5); // 5min
|
|
74
74
|
}
|
|
75
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: "
|
|
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 }); }
|
|
77
77
|
}
|
|
78
78
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SunUpdater, decorators: [{
|
|
79
79
|
type: Component,
|
|
80
80
|
args: [{ selector: 'sun-updater', imports: [
|
|
81
81
|
NzIconModule,
|
|
82
82
|
NzButtonModule,
|
|
83
|
-
NzSpaceModule
|
|
84
|
-
NzNotificationModule
|
|
83
|
+
NzSpaceModule
|
|
85
84
|
], changeDetection: ChangeDetectionStrategy.OnPush, 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" }]
|
|
86
|
-
}], ctorParameters: () => []
|
|
87
|
-
type: ViewChild,
|
|
88
|
-
args: [TemplateRef, { static: true }]
|
|
89
|
-
}] } });
|
|
85
|
+
}], ctorParameters: () => [] });
|
|
90
86
|
|
|
91
87
|
/**
|
|
92
88
|
* Generated bundle index. Do not edit.
|
|
@@ -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
|
|
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\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AAA,MAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2EAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACd,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,SAAA,EAAA,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;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
1
|
import { NzUploadChangeParam, NzUploadFile, NzUploadXHRArgs } from 'ng-zorro-antd/upload';
|
|
3
2
|
import { Observable } from 'rxjs';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
@@ -19,35 +18,28 @@ export declare class SunMediaUploader {
|
|
|
19
18
|
private readonly imageCompressor;
|
|
20
19
|
private readonly message;
|
|
21
20
|
private readonly fileManager;
|
|
22
|
-
data: SunMedia[]
|
|
23
|
-
limit: number
|
|
24
|
-
deletable: boolean
|
|
25
|
-
uploadable: boolean
|
|
26
|
-
previewable: boolean
|
|
27
|
-
downloadable: boolean
|
|
28
|
-
shape:
|
|
29
|
-
uploadKeys: Observable<import("@solar-kit/planets/earth").UploadKeys
|
|
21
|
+
readonly data: import("@angular/core").ModelSignal<SunMedia[]>;
|
|
22
|
+
readonly limit: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
23
|
+
readonly deletable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
24
|
+
readonly uploadable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
25
|
+
readonly previewable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
26
|
+
readonly downloadable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
27
|
+
readonly shape: import("@angular/core").InputSignal<"circle" | "square">;
|
|
28
|
+
readonly uploadKeys: import("@angular/core").InputSignal<Observable<import("@solar-kit/planets/earth").UploadKeys>>;
|
|
30
29
|
/** 启用图片压缩 */
|
|
31
|
-
compress: boolean
|
|
32
|
-
uploaded:
|
|
30
|
+
readonly compress: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
31
|
+
readonly uploaded: import("@angular/core").OutputEmitterRef<{
|
|
33
32
|
key: string;
|
|
34
33
|
hash: string;
|
|
35
34
|
url: string;
|
|
36
35
|
}>;
|
|
37
|
-
delete:
|
|
38
|
-
error:
|
|
39
|
-
dataChange: EventEmitter<SunMedia[]>;
|
|
36
|
+
readonly delete: import("@angular/core").OutputEmitterRef<SunMedia>;
|
|
37
|
+
readonly error: import("@angular/core").OutputEmitterRef<SunMedia>;
|
|
40
38
|
get transform(): (file: NzUploadFile) => Observable<Blob>;
|
|
41
|
-
upload: (args: NzUploadXHRArgs) => import("rxjs").Subscription;
|
|
39
|
+
readonly upload: (args: NzUploadXHRArgs) => import("rxjs").Subscription;
|
|
42
40
|
onChange({ type, file, event }: NzUploadChangeParam): void;
|
|
43
41
|
onPreview(media: SunMedia): void;
|
|
44
42
|
onDownload(media: SunMedia): void;
|
|
45
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<SunMediaUploader, never>;
|
|
46
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SunMediaUploader, "sun-media-uploader", never, { "data": { "alias": "data"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "deletable": { "alias": "deletable"; "required": false; }; "uploadable": { "alias": "uploadable"; "required": false; }; "previewable": { "alias": "previewable"; "required": false; }; "downloadable": { "alias": "downloadable"; "required": false; }; "shape": { "alias": "shape"; "required": false; }; "uploadKeys": { "alias": "uploadKeys"; "required": false; }; "compress": { "alias": "compress"; "required": false; }; }, { "
|
|
47
|
-
static ngAcceptInputType_limit: unknown;
|
|
48
|
-
static ngAcceptInputType_deletable: unknown;
|
|
49
|
-
static ngAcceptInputType_uploadable: unknown;
|
|
50
|
-
static ngAcceptInputType_previewable: unknown;
|
|
51
|
-
static ngAcceptInputType_downloadable: unknown;
|
|
52
|
-
static ngAcceptInputType_compress: unknown;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SunMediaUploader, "sun-media-uploader", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "limit": { "alias": "limit"; "required": false; "isSignal": true; }; "deletable": { "alias": "deletable"; "required": false; "isSignal": true; }; "uploadable": { "alias": "uploadable"; "required": false; "isSignal": true; }; "previewable": { "alias": "previewable"; "required": false; "isSignal": true; }; "downloadable": { "alias": "downloadable"; "required": false; "isSignal": true; }; "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "uploadKeys": { "alias": "uploadKeys"; "required": false; "isSignal": true; }; "compress": { "alias": "compress"; "required": false; "isSignal": true; }; }, { "data": "dataChange"; "uploaded": "uploaded"; "delete": "delete"; "error": "error"; }, never, never, true, never>;
|
|
53
45
|
}
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solar-angular/ui-zorro",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.3",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@solar-angular/core": "19.0.
|
|
10
|
-
"@solar-angular/planets": "19.0.
|
|
11
|
-
"@solar-angular/platform-browser": "19.0.
|
|
9
|
+
"@solar-angular/core": "19.0.3",
|
|
10
|
+
"@solar-angular/planets": "19.0.3",
|
|
11
|
+
"@solar-angular/platform-browser": "19.0.3",
|
|
12
12
|
"tslib": "^2.3.0"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@angular/cdk": "
|
|
16
|
-
"@angular/common": "
|
|
17
|
-
"@angular/core": "
|
|
18
|
-
"@angular/forms": "
|
|
19
|
-
"@angular/service-worker": "
|
|
15
|
+
"@angular/cdk": ">=19.0.0",
|
|
16
|
+
"@angular/common": ">=19.0.0",
|
|
17
|
+
"@angular/core": ">=19.0.0",
|
|
18
|
+
"@angular/forms": ">=19.0.0",
|
|
19
|
+
"@angular/service-worker": ">=19.0.0",
|
|
20
20
|
"@solar-kit/core": "^1.0.6",
|
|
21
21
|
"@fluent-form/core": ">=0.29.0",
|
|
22
22
|
"@fluent-form/ui-zorro": ">=0.29.0",
|
|
23
|
-
"ng-zorro-antd": "
|
|
23
|
+
"ng-zorro-antd": ">=19.0.0"
|
|
24
24
|
},
|
|
25
25
|
"module": "fesm2022/solar-angular-ui-zorro.mjs",
|
|
26
26
|
"typings": "index.d.ts",
|
|
@@ -40,22 +40,26 @@
|
|
|
40
40
|
"types": "./fan-popover/index.d.ts",
|
|
41
41
|
"default": "./fesm2022/solar-angular-ui-zorro-fan-popover.mjs"
|
|
42
42
|
},
|
|
43
|
-
"./
|
|
44
|
-
"types": "./
|
|
45
|
-
"default": "./fesm2022/solar-angular-ui-zorro-
|
|
43
|
+
"./media-uploader": {
|
|
44
|
+
"types": "./media-uploader/index.d.ts",
|
|
45
|
+
"default": "./fesm2022/solar-angular-ui-zorro-media-uploader.mjs"
|
|
46
46
|
},
|
|
47
47
|
"./message": {
|
|
48
48
|
"types": "./message/index.d.ts",
|
|
49
49
|
"default": "./fesm2022/solar-angular-ui-zorro-message.mjs"
|
|
50
50
|
},
|
|
51
|
-
"./
|
|
52
|
-
"types": "./
|
|
53
|
-
"default": "./fesm2022/solar-angular-ui-zorro-
|
|
51
|
+
"./fluent-form": {
|
|
52
|
+
"types": "./fluent-form/index.d.ts",
|
|
53
|
+
"default": "./fesm2022/solar-angular-ui-zorro-fluent-form.mjs"
|
|
54
54
|
},
|
|
55
55
|
"./page-forbidden": {
|
|
56
56
|
"types": "./page-forbidden/index.d.ts",
|
|
57
57
|
"default": "./fesm2022/solar-angular-ui-zorro-page-forbidden.mjs"
|
|
58
58
|
},
|
|
59
|
+
"./page-logout": {
|
|
60
|
+
"types": "./page-logout/index.d.ts",
|
|
61
|
+
"default": "./fesm2022/solar-angular-ui-zorro-page-logout.mjs"
|
|
62
|
+
},
|
|
59
63
|
"./page-not-found": {
|
|
60
64
|
"types": "./page-not-found/index.d.ts",
|
|
61
65
|
"default": "./fesm2022/solar-angular-ui-zorro-page-not-found.mjs"
|
|
@@ -63,10 +67,6 @@
|
|
|
63
67
|
"./updater": {
|
|
64
68
|
"types": "./updater/index.d.ts",
|
|
65
69
|
"default": "./fesm2022/solar-angular-ui-zorro-updater.mjs"
|
|
66
|
-
},
|
|
67
|
-
"./page-logout": {
|
|
68
|
-
"types": "./page-logout/index.d.ts",
|
|
69
|
-
"default": "./fesm2022/solar-angular-ui-zorro-page-logout.mjs"
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class SunUpdater {
|
|
5
5
|
private readonly location;
|
|
6
6
|
private readonly notification;
|
|
7
|
-
templateRef: TemplateRef<any
|
|
7
|
+
readonly templateRef: import("@angular/core").Signal<TemplateRef<any>>;
|
|
8
8
|
constructor();
|
|
9
9
|
private present;
|
|
10
10
|
update(): void;
|