ngx-axis-appforge 0.0.24 → 0.0.26
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/axis-components/image/index.d.ts +2 -0
- package/axis-components/radio/index.d.ts +2 -2
- package/axis-components/switch/design/index.d.ts +5 -0
- package/axis-components/switch/index.d.ts +23 -0
- package/axis-components/upload/index.d.ts +23 -22
- package/axis-components-covers/switch.svg +14 -0
- package/core/index.d.ts +2 -1
- package/fesm2022/ngx-axis-appforge-axis-components-image.mjs +13 -4
- package/fesm2022/ngx-axis-appforge-axis-components-image.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-radio.mjs +6 -6
- package/fesm2022/ngx-axis-appforge-axis-components-radio.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-switch-design.mjs +79 -0
- package/fesm2022/ngx-axis-appforge-axis-components-switch-design.mjs.map +1 -0
- package/fesm2022/ngx-axis-appforge-axis-components-switch.mjs +48 -0
- package/fesm2022/ngx-axis-appforge-axis-components-switch.mjs.map +1 -0
- package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs +14 -5
- package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components.mjs +18 -0
- package/fesm2022/ngx-axis-appforge-axis-components.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-core.mjs +2 -1
- package/fesm2022/ngx-axis-appforge-core.mjs.map +1 -1
- package/package.json +89 -81
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, inject, model, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { ValueAccessOptions, ValueAccess, fn, DynamicDirective } from 'ngx-axis-appforge/core';
|
|
3
|
+
import { ValueAccessOptions, ValueAccess, AXIS_FILE_BASE_URL_TOKEN, fn, DynamicDirective } from 'ngx-axis-appforge/core';
|
|
4
4
|
import * as i1 from 'ng-zorro-antd/upload';
|
|
5
5
|
import { NzUploadModule } from 'ng-zorro-antd/upload';
|
|
6
6
|
import * as i2 from 'ng-zorro-antd/button';
|
|
@@ -39,6 +39,7 @@ class UploadOptions extends ValueAccessOptions {
|
|
|
39
39
|
|
|
40
40
|
class Upload extends ValueAccess {
|
|
41
41
|
options = new UploadOptions();
|
|
42
|
+
fileBaseUrl = inject(AXIS_FILE_BASE_URL_TOKEN, { optional: true }) ?? "";
|
|
42
43
|
http = inject(HttpClient);
|
|
43
44
|
imageService = inject(NzImageService);
|
|
44
45
|
fileList = model([], ...(ngDevMode ? [{ debugName: "fileList" }] : []));
|
|
@@ -64,7 +65,7 @@ class Upload extends ValueAccess {
|
|
|
64
65
|
[this.options.filenameField()]: this.getFileNameByUrl(r),
|
|
65
66
|
}).map((resp, i) => ({
|
|
66
67
|
uid: i.toString(),
|
|
67
|
-
url: resp[this.options.urlField()],
|
|
68
|
+
url: this.getUrl(resp[this.options.urlField()]),
|
|
68
69
|
name: resp[this.options.filenameField()],
|
|
69
70
|
status: 'done',
|
|
70
71
|
response: resp
|
|
@@ -92,6 +93,14 @@ class Upload extends ValueAccess {
|
|
|
92
93
|
this.value.set(value);
|
|
93
94
|
this.onChange?.(this.value());
|
|
94
95
|
}
|
|
96
|
+
getUrl(url) {
|
|
97
|
+
if (url.startsWith("http")) {
|
|
98
|
+
return url;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
return this.fileBaseUrl + url;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
95
104
|
upload = (item) => {
|
|
96
105
|
const formData = new FormData();
|
|
97
106
|
formData.append(this.options.formName(), item.file);
|
|
@@ -137,15 +146,15 @@ class Upload extends ValueAccess {
|
|
|
137
146
|
};
|
|
138
147
|
refreshFileListUrl() {
|
|
139
148
|
this.fileList().forEach(f => {
|
|
140
|
-
f.url = f.response?.[this.options.urlField()];
|
|
149
|
+
f.url = this.getUrl(f.response?.[this.options.urlField()]);
|
|
141
150
|
});
|
|
142
151
|
}
|
|
143
152
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Upload, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
144
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Upload, isStandalone: true, selector: "axis-upload", inputs: { fileList: { classPropertyName: "fileList", publicName: "fileList", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileList: "fileListChange" }, usesInheritance: true, ngImport: i0, template: "<nz-upload [(nzFileList)]=\"fileList\"\n [nzType]=\"options.listType()!='picture-card'&& options.buttonType()=='drag-file'?'drag':'select'\"\n [nzDirectory]=\"directory()\" [nzAccept]=\"options.fileType()\" [nzMultiple]=\"options.multiple()\"\n [nzLimit]=\"limitLength()\" [nzSize]=\"options.limitSize()\" [nzListType]=\"options.listType()\"\n [nzDisabled]=\"options.disabled()\" [nzCustomRequest]=\"upload\" (nzChange)=\"fileChange($event)\"\n [nzShowButton]=\"!options.readonly() && (
|
|
153
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Upload, isStandalone: true, selector: "axis-upload", inputs: { fileList: { classPropertyName: "fileList", publicName: "fileList", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileList: "fileListChange" }, usesInheritance: true, ngImport: i0, template: "<nz-upload [(nzFileList)]=\"fileList\"\n [nzType]=\"options.listType()!='picture-card'&& options.buttonType()=='drag-file'?'drag':'select'\"\n [nzDirectory]=\"directory()\" [nzAccept]=\"options.fileType()\" [nzMultiple]=\"options.multiple()\"\n [nzLimit]=\"limitLength()\" [nzSize]=\"options.limitSize()\" [nzListType]=\"options.listType()\"\n [nzDisabled]=\"options.disabled()\" [nzCustomRequest]=\"upload\" (nzChange)=\"fileChange($event)\"\n [nzShowButton]=\"!options.readonly() && (limitLength() == null || fileList().length<limitLength()!)\"\n [nzPreview]=\"handlePreview\"\n [nzShowUploadList]=\"{showRemoveIcon:!this.options.readonly() && !this.options.disabled(),showPreviewIcon:true,showDownloadIcon:true}\">\n @if (options.listType() == \"picture-card\") {\n <div>\n <nz-icon nzType=\"plus\" />\n <div style=\"margin-top: 8px\">{{options.buttonTitle()}}</div>\n </div>\n }@else if (options.buttonType() == \"drag-file\") {\n <p class=\"ant-upload-drag-icon\">\n <nz-icon nzType=\"inbox\" />\n </p>\n <p class=\"ant-upload-text\">{{options.dropTitle()}}</p>\n @if (options.dropTip()) {\n <p class=\"ant-upload-hint\">\n {{options.dropTip()}}\n </p>\n }\n }@else {\n <button nz-button [nzSize]=\"options.buttonSize()\" [nzType]=\"options.buttonStyle()\" [nzBlock]=\"options.buttonBlock()\"\n [nzShape]=\"options.buttonShape()\">\n @if (options.buttonIcon()) {\n <ng-container [axisDynamic]=\"options.buttonIcon()\" [standalone]=\"true\"></ng-container>\n @if (options.buttonTitle()) {\n <span style=\"margin-right: 10px;\"></span>\n }\n }\n {{options.buttonTitle()}}\n </button>\n }\n</nz-upload>", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: NzUploadModule }, { kind: "component", type: i1.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: NzButtonModule }, { kind: "component", type: i2.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i4.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i5.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "ngmodule", type: NzImageModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
145
154
|
}
|
|
146
155
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Upload, decorators: [{
|
|
147
156
|
type: Component,
|
|
148
|
-
args: [{ selector: 'axis-upload', imports: [NzUploadModule, NzButtonModule, NzIconModule, DynamicDirective, NzFlexModule, NzImageModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nz-upload [(nzFileList)]=\"fileList\"\n [nzType]=\"options.listType()!='picture-card'&& options.buttonType()=='drag-file'?'drag':'select'\"\n [nzDirectory]=\"directory()\" [nzAccept]=\"options.fileType()\" [nzMultiple]=\"options.multiple()\"\n [nzLimit]=\"limitLength()\" [nzSize]=\"options.limitSize()\" [nzListType]=\"options.listType()\"\n [nzDisabled]=\"options.disabled()\" [nzCustomRequest]=\"upload\" (nzChange)=\"fileChange($event)\"\n [nzShowButton]=\"!options.readonly() && (
|
|
157
|
+
args: [{ selector: 'axis-upload', imports: [NzUploadModule, NzButtonModule, NzIconModule, DynamicDirective, NzFlexModule, NzImageModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nz-upload [(nzFileList)]=\"fileList\"\n [nzType]=\"options.listType()!='picture-card'&& options.buttonType()=='drag-file'?'drag':'select'\"\n [nzDirectory]=\"directory()\" [nzAccept]=\"options.fileType()\" [nzMultiple]=\"options.multiple()\"\n [nzLimit]=\"limitLength()\" [nzSize]=\"options.limitSize()\" [nzListType]=\"options.listType()\"\n [nzDisabled]=\"options.disabled()\" [nzCustomRequest]=\"upload\" (nzChange)=\"fileChange($event)\"\n [nzShowButton]=\"!options.readonly() && (limitLength() == null || fileList().length<limitLength()!)\"\n [nzPreview]=\"handlePreview\"\n [nzShowUploadList]=\"{showRemoveIcon:!this.options.readonly() && !this.options.disabled(),showPreviewIcon:true,showDownloadIcon:true}\">\n @if (options.listType() == \"picture-card\") {\n <div>\n <nz-icon nzType=\"plus\" />\n <div style=\"margin-top: 8px\">{{options.buttonTitle()}}</div>\n </div>\n }@else if (options.buttonType() == \"drag-file\") {\n <p class=\"ant-upload-drag-icon\">\n <nz-icon nzType=\"inbox\" />\n </p>\n <p class=\"ant-upload-text\">{{options.dropTitle()}}</p>\n @if (options.dropTip()) {\n <p class=\"ant-upload-hint\">\n {{options.dropTip()}}\n </p>\n }\n }@else {\n <button nz-button [nzSize]=\"options.buttonSize()\" [nzType]=\"options.buttonStyle()\" [nzBlock]=\"options.buttonBlock()\"\n [nzShape]=\"options.buttonShape()\">\n @if (options.buttonIcon()) {\n <ng-container [axisDynamic]=\"options.buttonIcon()\" [standalone]=\"true\"></ng-container>\n @if (options.buttonTitle()) {\n <span style=\"margin-right: 10px;\"></span>\n }\n }\n {{options.buttonTitle()}}\n </button>\n }\n</nz-upload>", styles: [":host{display:block}\n"] }]
|
|
149
158
|
}] });
|
|
150
159
|
|
|
151
160
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-axis-appforge-axis-components-upload.mjs","sources":["../../../axis-components/upload/upload.options.ts","../../../axis-components/upload/upload.ts","../../../axis-components/upload/upload.html","../../../axis-components/upload/ngx-axis-appforge-axis-components-upload.ts"],"sourcesContent":["import { signal, WritableSignal } from \"@angular/core\";\nimport { ValueAccessOptions } from \"ngx-axis-appforge/core\";\n\nexport class UploadOptions extends ValueAccessOptions {\n\n readonly url = signal(\"\");\n readonly formName = signal(\"file\");\n readonly fullValue = signal(false);\n readonly urlField = signal(\"url\");\n readonly filenameField = signal(\"filename\");\n readonly responseFn = signal(\"\");\n\n readonly fileType = signal(\"*/*\");\n readonly multiple = signal(true);\n readonly directory = signal(false);\n readonly limitLength = signal<number | null>(null);\n readonly limitSize = signal<number | null>(null);\n\n readonly listType = signal<\"text\" | \"picture\" | \"picture-card\">(\"text\");\n readonly buttonType = signal<\"drag-file\" | \"custom\">(\"custom\");\n readonly buttonTitle = signal<string>(\"上传\");\n readonly buttonIcon = signal<any>({ component: 'axis-components/icon', inuse: true, icon: 'upload' });\n readonly buttonStyle = signal<\"default\" | \"primary\" | \"dashed\" | \"link\" | \"text\">(\"default\");\n readonly buttonSize = signal<\"large\" | \"small\" | \"default\">(\"default\");\n readonly buttonBlock = signal<boolean>(false);\n readonly buttonShape = signal<null | \"circle\" | \"round\">(null);\n readonly dropTitle = signal<string>(\"点击或拖拽上传\");\n readonly dropTip = signal<string>(\"\");\n}","import { ChangeDetectionStrategy, Component, computed, effect, inject, model, untracked } from '@angular/core';\nimport { UploadOptions } from './upload.options';\nimport { DynamicDirective, fn, ValueAccess } from 'ngx-axis-appforge/core';\nimport { NzUploadChangeParam, NzUploadFile, NzUploadModule, NzUploadXHRArgs } from 'ng-zorro-antd/upload';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzFlexModule } from 'ng-zorro-antd/flex';\nimport { Subscription } from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\nimport { NzImageModule, NzImageService } from 'ng-zorro-antd/image';\n\n@Component({\n selector: 'axis-upload',\n imports: [NzUploadModule, NzButtonModule, NzIconModule, DynamicDirective, NzFlexModule, NzImageModule],\n templateUrl: './upload.html',\n styleUrl: './upload.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Upload extends ValueAccess<UploadOptions> {\n\n protected override options: UploadOptions = new UploadOptions();\n private readonly http = inject(HttpClient);\n private readonly imageService = inject(NzImageService);\n readonly fileList = model<NzUploadFile[]>([]);\n readonly limitLength = computed(() => this.options.multiple() ? this.options.limitLength() : 1);\n readonly directory = computed(() => this.options.multiple() && this.options.directory());\n\n override setInitValue(value: any): void {\n super.setInitValue(value);\n if (value !== undefined) {\n this.updateFileList(value);\n }\n }\n\n override writeValue(value: any): void {\n super.writeValue(value);\n this.updateFileList(value);\n }\n\n private updateFileList(value: any) {\n if (value) {\n if (!this.options.multiple()) {\n value = [value];\n }\n this.fileList.set((value as any[]).map(r => this.options.fullValue() ? r : {\n [this.options.urlField()]: r,\n [this.options.filenameField()]: this.getFileNameByUrl(r),\n }).map((resp, i) => ({\n uid: i.toString(),\n url: resp[this.options.urlField()],\n name: resp[this.options.filenameField()],\n status: 'done',\n response: resp\n })));\n } else {\n this.fileList.set([]);\n }\n }\n\n private getFileNameByUrl(url: string | undefined): string {\n if (!url) {\n return \"\";\n }\n const i = url.lastIndexOf(\"/\");\n if (i > -1) {\n return url.substring(i + 1);\n }\n return url;\n }\n\n private updateValue(fileList: NzUploadFile[]) {\n let value: any = fileList.map(f => this.options.fullValue() ? f.response : f.response[this.options.urlField()]);\n if (!this.options.multiple()) {\n value = value[0] ?? null;\n }\n this.value.set(value);\n this.onChange?.(this.value());\n }\n\n upload = (item: NzUploadXHRArgs): Subscription => {\n const formData = new FormData();\n formData.append(this.options.formName(), item.file as any);\n return this.http.post(this.options.url(), formData).subscribe((res: any) => {\n if (this.options.responseFn()) {\n res = fn(this.options.responseFn(), { apiResponse: res })\n }\n const { success, errmsg } = res;\n if (success) {\n item.file.url = res[this.options.urlField()];\n res[this.options.filenameField()] ??= this.getFileNameByUrl(item.file.url!);\n item.file.filename = res[this.options.filenameField()];\n item.onSuccess?.(res, item.file, null);\n } else {\n item.onError?.(errmsg || \"上传失败\", item.file);\n }\n });\n }\n\n fileChange(e: NzUploadChangeParam) {\n switch (e.type) {\n case \"success\":\n this.refreshFileListUrl();\n this.updateValue(e.fileList);\n break;\n case \"removed\":\n this.updateValue(e.fileList);\n break;\n }\n }\n\n handlePreview = async (file: NzUploadFile) => {\n const fileUrl = file.response[this.options.urlField()];\n if (fileUrl) {\n if (file['isImageUrl']) {\n const imgList = this.fileList().map(e => ({ src: e.response[this.options.urlField()] }));\n const index = imgList.findIndex(e => e.src == fileUrl);\n this.imageService.preview(imgList).switchTo(index);\n } else {\n open(fileUrl);\n }\n }\n }\n\n refreshFileListUrl() {\n this.fileList().forEach(f => {\n f.url = f.response?.[this.options.urlField()];\n });\n }\n\n}\n","<nz-upload [(nzFileList)]=\"fileList\"\n [nzType]=\"options.listType()!='picture-card'&& options.buttonType()=='drag-file'?'drag':'select'\"\n [nzDirectory]=\"directory()\" [nzAccept]=\"options.fileType()\" [nzMultiple]=\"options.multiple()\"\n [nzLimit]=\"limitLength()\" [nzSize]=\"options.limitSize()\" [nzListType]=\"options.listType()\"\n [nzDisabled]=\"options.disabled()\" [nzCustomRequest]=\"upload\" (nzChange)=\"fileChange($event)\"\n [nzShowButton]=\"!options.readonly() && ( limitLength() == null || fileList().length<limitLength()!)\"\n [nzPreview]=\"handlePreview\"\n [nzShowUploadList]=\"{showRemoveIcon:!this.options.readonly() && !this.options.disabled(),showPreviewIcon:true,showDownloadIcon:true}\">\n @if (options.listType() == \"picture-card\") {\n <div>\n <nz-icon nzType=\"plus\" />\n <div style=\"margin-top: 8px\">{{options.buttonTitle()}}</div>\n </div>\n }@else if (options.buttonType() == \"drag-file\") {\n <p class=\"ant-upload-drag-icon\">\n <nz-icon nzType=\"inbox\" />\n </p>\n <p class=\"ant-upload-text\">{{options.dropTitle()}}</p>\n @if (options.dropTip()) {\n <p class=\"ant-upload-hint\">\n {{options.dropTip()}}\n </p>\n }\n }@else {\n <button nz-button [nzSize]=\"options.buttonSize()\" [nzType]=\"options.buttonStyle()\" [nzBlock]=\"options.buttonBlock()\"\n [nzShape]=\"options.buttonShape()\">\n @if (options.buttonIcon()) {\n <ng-container [axisDynamic]=\"options.buttonIcon()\" [standalone]=\"true\"></ng-container>\n @if (options.buttonTitle()) {\n <span style=\"margin-right: 10px;\"></span>\n }\n }\n {{options.buttonTitle()}}\n </button>\n }\n</nz-upload>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './upload';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGM,MAAO,aAAc,SAAQ,kBAAkB,CAAA;AAExC,IAAA,GAAG,GAAG,MAAM,CAAC,EAAE,+CAAC;AAChB,IAAA,QAAQ,GAAG,MAAM,CAAC,MAAM,oDAAC;AACzB,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,qDAAC;AACzB,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,oDAAC;AACxB,IAAA,aAAa,GAAG,MAAM,CAAC,UAAU,yDAAC;AAClC,IAAA,UAAU,GAAG,MAAM,CAAC,EAAE,sDAAC;AAEvB,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,oDAAC;AACxB,IAAA,QAAQ,GAAG,MAAM,CAAC,IAAI,oDAAC;AACvB,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,qDAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAgB,IAAI,uDAAC;AACzC,IAAA,SAAS,GAAG,MAAM,CAAgB,IAAI,qDAAC;AAEvC,IAAA,QAAQ,GAAG,MAAM,CAAsC,MAAM,oDAAC;AAC9D,IAAA,UAAU,GAAG,MAAM,CAAyB,QAAQ,sDAAC;AACrD,IAAA,WAAW,GAAG,MAAM,CAAS,IAAI,uDAAC;AAClC,IAAA,UAAU,GAAG,MAAM,CAAM,EAAE,SAAS,EAAE,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAA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AAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,YAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,sBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,YAAY,8BAAE,aAAa,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAK1F,MAAM,EAAA,UAAA,EAAA,CAAA;kBAPlB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,WACd,CAAC,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,CAAC,EAAA,eAAA,EAGrF,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,6tDAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AEhBjD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-upload.mjs","sources":["../../../axis-components/upload/upload.options.ts","../../../axis-components/upload/upload.ts","../../../axis-components/upload/upload.html","../../../axis-components/upload/ngx-axis-appforge-axis-components-upload.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { ValueAccessOptions } from \"ngx-axis-appforge/core\";\n\nexport class UploadOptions extends ValueAccessOptions {\n\n readonly url = signal(\"\");\n readonly formName = signal(\"file\");\n readonly fullValue = signal(false);\n readonly urlField = signal(\"url\");\n readonly filenameField = signal(\"filename\");\n readonly responseFn = signal(\"\");\n\n readonly fileType = signal(\"*/*\");\n readonly multiple = signal(true);\n readonly directory = signal(false);\n readonly limitLength = signal<number | null>(null);\n readonly limitSize = signal<number | null>(null);\n\n readonly listType = signal<\"text\" | \"picture\" | \"picture-card\">(\"text\");\n readonly buttonType = signal<\"drag-file\" | \"custom\">(\"custom\");\n readonly buttonTitle = signal<string>(\"上传\");\n readonly buttonIcon = signal<any>({ component: 'axis-components/icon', inuse: true, icon: 'upload' });\n readonly buttonStyle = signal<\"default\" | \"primary\" | \"dashed\" | \"link\" | \"text\">(\"default\");\n readonly buttonSize = signal<\"large\" | \"small\" | \"default\">(\"default\");\n readonly buttonBlock = signal<boolean>(false);\n readonly buttonShape = signal<null | \"circle\" | \"round\">(null);\n readonly dropTitle = signal<string>(\"点击或拖拽上传\");\n readonly dropTip = signal<string>(\"\");\n}","import { ChangeDetectionStrategy, Component, computed, inject, model } from '@angular/core';\nimport { UploadOptions } from './upload.options';\nimport { AXIS_FILE_BASE_URL_TOKEN, DynamicDirective, fn, ValueAccess } from 'ngx-axis-appforge/core';\nimport { NzUploadChangeParam, NzUploadFile, NzUploadModule, NzUploadXHRArgs } from 'ng-zorro-antd/upload';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzFlexModule } from 'ng-zorro-antd/flex';\nimport { Subscription } from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\nimport { NzImageModule, NzImageService } from 'ng-zorro-antd/image';\n\n@Component({\n selector: 'axis-upload',\n imports: [NzUploadModule, NzButtonModule, NzIconModule, DynamicDirective, NzFlexModule, NzImageModule],\n templateUrl: './upload.html',\n styleUrl: './upload.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Upload extends ValueAccess<UploadOptions> {\n\n protected override options: UploadOptions = new UploadOptions();\n private readonly fileBaseUrl = inject(AXIS_FILE_BASE_URL_TOKEN, { optional: true }) ?? \"\";\n private readonly http = inject(HttpClient);\n private readonly imageService = inject(NzImageService);\n readonly fileList = model<NzUploadFile[]>([]);\n readonly limitLength = computed(() => this.options.multiple() ? this.options.limitLength() : 1);\n readonly directory = computed(() => this.options.multiple() && this.options.directory());\n\n override setInitValue(value: any): void {\n super.setInitValue(value);\n if (value !== undefined) {\n this.updateFileList(value);\n }\n }\n\n override writeValue(value: any): void {\n super.writeValue(value);\n this.updateFileList(value);\n }\n\n private updateFileList(value: any) {\n if (value) {\n if (!this.options.multiple()) {\n value = [value];\n }\n this.fileList.set((value as any[]).map(r => this.options.fullValue() ? r : {\n [this.options.urlField()]: r,\n [this.options.filenameField()]: this.getFileNameByUrl(r),\n }).map((resp, i) => ({\n uid: i.toString(),\n url: this.getUrl(resp[this.options.urlField()]),\n name: resp[this.options.filenameField()],\n status: 'done',\n response: resp\n })));\n } else {\n this.fileList.set([]);\n }\n }\n\n private getFileNameByUrl(url: string | undefined): string {\n if (!url) {\n return \"\";\n }\n const i = url.lastIndexOf(\"/\");\n if (i > -1) {\n return url.substring(i + 1);\n }\n return url;\n }\n\n private updateValue(fileList: NzUploadFile[]) {\n let value: any = fileList.map(f => this.options.fullValue() ? f.response : f.response[this.options.urlField()]);\n if (!this.options.multiple()) {\n value = value[0] ?? null;\n }\n this.value.set(value);\n this.onChange?.(this.value());\n }\n\n private getUrl(url: string): string {\n if (url.startsWith(\"http\")) {\n return url;\n } else {\n return this.fileBaseUrl + url;\n }\n }\n\n upload = (item: NzUploadXHRArgs): Subscription => {\n const formData = new FormData();\n formData.append(this.options.formName(), item.file as any);\n return this.http.post(this.options.url(), formData).subscribe((res: any) => {\n if (this.options.responseFn()) {\n res = fn(this.options.responseFn(), { apiResponse: res })\n }\n const { success, errmsg } = res;\n if (success) {\n item.file.url = res[this.options.urlField()];\n res[this.options.filenameField()] ??= this.getFileNameByUrl(item.file.url!);\n item.file.filename = res[this.options.filenameField()];\n item.onSuccess?.(res, item.file, null);\n } else {\n item.onError?.(errmsg || \"上传失败\", item.file);\n }\n });\n }\n\n fileChange(e: NzUploadChangeParam) {\n switch (e.type) {\n case \"success\":\n this.refreshFileListUrl();\n this.updateValue(e.fileList);\n break;\n case \"removed\":\n this.updateValue(e.fileList);\n break;\n }\n }\n\n handlePreview = async (file: NzUploadFile) => {\n const fileUrl = file.response[this.options.urlField()];\n if (fileUrl) {\n if (file['isImageUrl']) {\n const imgList = this.fileList().map(e => ({ src: e.response[this.options.urlField()] }));\n const index = imgList.findIndex(e => e.src == fileUrl);\n this.imageService.preview(imgList).switchTo(index);\n } else {\n open(fileUrl);\n }\n }\n }\n\n refreshFileListUrl() {\n this.fileList().forEach(f => {\n f.url = this.getUrl(f.response?.[this.options.urlField()]);\n });\n }\n\n}\n","<nz-upload [(nzFileList)]=\"fileList\"\n [nzType]=\"options.listType()!='picture-card'&& options.buttonType()=='drag-file'?'drag':'select'\"\n [nzDirectory]=\"directory()\" [nzAccept]=\"options.fileType()\" [nzMultiple]=\"options.multiple()\"\n [nzLimit]=\"limitLength()\" [nzSize]=\"options.limitSize()\" [nzListType]=\"options.listType()\"\n [nzDisabled]=\"options.disabled()\" [nzCustomRequest]=\"upload\" (nzChange)=\"fileChange($event)\"\n [nzShowButton]=\"!options.readonly() && (limitLength() == null || fileList().length<limitLength()!)\"\n [nzPreview]=\"handlePreview\"\n [nzShowUploadList]=\"{showRemoveIcon:!this.options.readonly() && !this.options.disabled(),showPreviewIcon:true,showDownloadIcon:true}\">\n @if (options.listType() == \"picture-card\") {\n <div>\n <nz-icon nzType=\"plus\" />\n <div style=\"margin-top: 8px\">{{options.buttonTitle()}}</div>\n </div>\n }@else if (options.buttonType() == \"drag-file\") {\n <p class=\"ant-upload-drag-icon\">\n <nz-icon nzType=\"inbox\" />\n </p>\n <p class=\"ant-upload-text\">{{options.dropTitle()}}</p>\n @if (options.dropTip()) {\n <p class=\"ant-upload-hint\">\n {{options.dropTip()}}\n </p>\n }\n }@else {\n <button nz-button [nzSize]=\"options.buttonSize()\" [nzType]=\"options.buttonStyle()\" [nzBlock]=\"options.buttonBlock()\"\n [nzShape]=\"options.buttonShape()\">\n @if (options.buttonIcon()) {\n <ng-container [axisDynamic]=\"options.buttonIcon()\" [standalone]=\"true\"></ng-container>\n @if (options.buttonTitle()) {\n <span style=\"margin-right: 10px;\"></span>\n }\n }\n {{options.buttonTitle()}}\n </button>\n }\n</nz-upload>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './upload';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGM,MAAO,aAAc,SAAQ,kBAAkB,CAAA;AAExC,IAAA,GAAG,GAAG,MAAM,CAAC,EAAE,+CAAC;AAChB,IAAA,QAAQ,GAAG,MAAM,CAAC,MAAM,oDAAC;AACzB,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,qDAAC;AACzB,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,oDAAC;AACxB,IAAA,aAAa,GAAG,MAAM,CAAC,UAAU,yDAAC;AAClC,IAAA,UAAU,GAAG,MAAM,CAAC,EAAE,sDAAC;AAEvB,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,oDAAC;AACxB,IAAA,QAAQ,GAAG,MAAM,CAAC,IAAI,oDAAC;AACvB,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,qDAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAgB,IAAI,uDAAC;AACzC,IAAA,SAAS,GAAG,MAAM,CAAgB,IAAI,qDAAC;AAEvC,IAAA,QAAQ,GAAG,MAAM,CAAsC,MAAM,oDAAC;AAC9D,IAAA,UAAU,GAAG,MAAM,CAAyB,QAAQ,sDAAC;AACrD,IAAA,WAAW,GAAG,MAAM,CAAS,IAAI,uDAAC;AAClC,IAAA,UAAU,GAAG,MAAM,CAAM,EAAE,SAAS,EAAE,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,sDAAC;AAC5F,IAAA,WAAW,GAAG,MAAM,CAAqD,SAAS,uDAAC;AACnF,IAAA,UAAU,GAAG,MAAM,CAAgC,SAAS,sDAAC;AAC7D,IAAA,WAAW,GAAG,MAAM,CAAU,KAAK,uDAAC;AACpC,IAAA,WAAW,GAAG,MAAM,CAA4B,IAAI,uDAAC;AACrD,IAAA,SAAS,GAA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AA,UAAA,EAAA,QAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,YAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,YAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,sBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,YAAY,8BAAE,aAAa,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAK1F,MAAM,EAAA,UAAA,EAAA,CAAA;kBAPlB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,WACd,CAAC,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,CAAC,EAAA,eAAA,EAGrF,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,4tDAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AEhBjD;;AAEG;;;;"}
|
|
@@ -65,6 +65,8 @@ const cmpMap = {
|
|
|
65
65
|
"axis-components/color-picker/design": () => import('ngx-axis-appforge/axis-components/color-picker/design'),
|
|
66
66
|
"axis-components/radio": () => import('ngx-axis-appforge/axis-components/radio'),
|
|
67
67
|
"axis-components/radio/design": () => import('ngx-axis-appforge/axis-components/radio/design'),
|
|
68
|
+
"axis-components/switch": () => import('ngx-axis-appforge/axis-components/switch'),
|
|
69
|
+
"axis-components/switch/design": () => import('ngx-axis-appforge/axis-components/switch/design'),
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
const buttonExampleDesc = {
|
|
@@ -1161,6 +1163,21 @@ const radioExampleDesc = {
|
|
|
1161
1163
|
}
|
|
1162
1164
|
};
|
|
1163
1165
|
|
|
1166
|
+
const switchExampleDesc = {
|
|
1167
|
+
component: "开关",
|
|
1168
|
+
coverImg: "assets/axis-components-covers/switch.svg",
|
|
1169
|
+
span: 12,
|
|
1170
|
+
height: 60,
|
|
1171
|
+
example: {
|
|
1172
|
+
builder: (componentIdBuilder) => ({
|
|
1173
|
+
component: "axis-components/switch",
|
|
1174
|
+
id: componentIdBuilder?.("axis-components/switch"),
|
|
1175
|
+
inuse: true,
|
|
1176
|
+
initValue: false
|
|
1177
|
+
}),
|
|
1178
|
+
}
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1164
1181
|
const examples = [
|
|
1165
1182
|
{
|
|
1166
1183
|
groupName: "通用",
|
|
@@ -1188,6 +1205,7 @@ const examples = [
|
|
|
1188
1205
|
selectExampleDesc,
|
|
1189
1206
|
treeSelectorExampleDesc,
|
|
1190
1207
|
radioExampleDesc,
|
|
1208
|
+
switchExampleDesc,
|
|
1191
1209
|
inputIconExampleDesc,
|
|
1192
1210
|
textareaExampleDesc,
|
|
1193
1211
|
uploadExampleDesc,
|