ngx-axis-appforge 0.0.25 → 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.
@@ -7,8 +7,10 @@ declare class ImageOptions extends DataOptions {
7
7
  }
8
8
 
9
9
  declare class Image extends Base<ImageOptions> {
10
+ private readonly fileBaseUrl;
10
11
  options: ImageOptions;
11
12
  readonly imgList: _angular_core.Signal<any[]>;
13
+ getUrl(url: string): string;
12
14
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Image, never>;
13
15
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<Image, "axis-image", never, {}, {}, never, never, true, never>;
14
16
  }
@@ -1,35 +1,35 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { WritableSignal } from '@angular/core';
3
2
  import { ValueAccessOptions, ValueAccess } from 'ngx-axis-appforge/core';
4
3
  import { NzUploadFile, NzUploadXHRArgs, NzUploadChangeParam } from 'ng-zorro-antd/upload';
5
4
  import { Subscription } from 'rxjs';
6
5
 
7
6
  declare class UploadOptions extends ValueAccessOptions {
8
- readonly url: WritableSignal<string>;
9
- readonly formName: WritableSignal<string>;
10
- readonly fullValue: WritableSignal<boolean>;
11
- readonly urlField: WritableSignal<string>;
12
- readonly filenameField: WritableSignal<string>;
13
- readonly responseFn: WritableSignal<string>;
14
- readonly fileType: WritableSignal<string>;
15
- readonly multiple: WritableSignal<boolean>;
16
- readonly directory: WritableSignal<boolean>;
17
- readonly limitLength: WritableSignal<number | null>;
18
- readonly limitSize: WritableSignal<number | null>;
19
- readonly listType: WritableSignal<"text" | "picture" | "picture-card">;
20
- readonly buttonType: WritableSignal<"drag-file" | "custom">;
21
- readonly buttonTitle: WritableSignal<string>;
22
- readonly buttonIcon: WritableSignal<any>;
23
- readonly buttonStyle: WritableSignal<"text" | "default" | "primary" | "dashed" | "link">;
24
- readonly buttonSize: WritableSignal<"default" | "large" | "small">;
25
- readonly buttonBlock: WritableSignal<boolean>;
26
- readonly buttonShape: WritableSignal<"circle" | "round" | null>;
27
- readonly dropTitle: WritableSignal<string>;
28
- readonly dropTip: WritableSignal<string>;
7
+ readonly url: _angular_core.WritableSignal<string>;
8
+ readonly formName: _angular_core.WritableSignal<string>;
9
+ readonly fullValue: _angular_core.WritableSignal<boolean>;
10
+ readonly urlField: _angular_core.WritableSignal<string>;
11
+ readonly filenameField: _angular_core.WritableSignal<string>;
12
+ readonly responseFn: _angular_core.WritableSignal<string>;
13
+ readonly fileType: _angular_core.WritableSignal<string>;
14
+ readonly multiple: _angular_core.WritableSignal<boolean>;
15
+ readonly directory: _angular_core.WritableSignal<boolean>;
16
+ readonly limitLength: _angular_core.WritableSignal<number | null>;
17
+ readonly limitSize: _angular_core.WritableSignal<number | null>;
18
+ readonly listType: _angular_core.WritableSignal<"text" | "picture" | "picture-card">;
19
+ readonly buttonType: _angular_core.WritableSignal<"drag-file" | "custom">;
20
+ readonly buttonTitle: _angular_core.WritableSignal<string>;
21
+ readonly buttonIcon: _angular_core.WritableSignal<any>;
22
+ readonly buttonStyle: _angular_core.WritableSignal<"text" | "default" | "primary" | "dashed" | "link">;
23
+ readonly buttonSize: _angular_core.WritableSignal<"default" | "large" | "small">;
24
+ readonly buttonBlock: _angular_core.WritableSignal<boolean>;
25
+ readonly buttonShape: _angular_core.WritableSignal<"circle" | "round" | null>;
26
+ readonly dropTitle: _angular_core.WritableSignal<string>;
27
+ readonly dropTip: _angular_core.WritableSignal<string>;
29
28
  }
30
29
 
31
30
  declare class Upload extends ValueAccess<UploadOptions> {
32
31
  protected options: UploadOptions;
32
+ private readonly fileBaseUrl;
33
33
  private readonly http;
34
34
  private readonly imageService;
35
35
  readonly fileList: _angular_core.ModelSignal<NzUploadFile[]>;
@@ -40,6 +40,7 @@ declare class Upload extends ValueAccess<UploadOptions> {
40
40
  private updateFileList;
41
41
  private getFileNameByUrl;
42
42
  private updateValue;
43
+ private getUrl;
43
44
  upload: (item: NzUploadXHRArgs) => Subscription;
44
45
  fileChange(e: NzUploadChangeParam): void;
45
46
  handlePreview: (file: NzUploadFile) => Promise<void>;
package/core/index.d.ts CHANGED
@@ -516,6 +516,7 @@ declare const AXIS_HTTP_CONTEXT_DATA_TOKEN: InjectionToken<{
516
516
  [key: string]: any;
517
517
  }>;
518
518
  declare const AXIS_FORM_REGISTE_CONTROL_TOKEN: InjectionToken<(opt: RegisteFormControlOptions) => void>;
519
+ declare const AXIS_FILE_BASE_URL_TOKEN: InjectionToken<string>;
519
520
  declare const AXIS_HTTP_CONTEXT_TOKEN: HttpContextToken<{
520
521
  [key: string]: any;
521
522
  }>;
@@ -822,5 +823,5 @@ interface DynamicFnOptions {
822
823
  }
823
824
  declare function fn(fnBody: string, argsObj: any, ignoreUndefined?: boolean, printError?: boolean): any;
824
825
 
825
- export { AXIS_COMPONENTS_LOADER_TOKEN, AXIS_COMPONENTS_TOKEN, AXIS_CURRENT_USER_PERMISSIONS_TOKEN, AXIS_DESIGN_ALL_PERMISSIONS_TOKEN, AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN, AXIS_DESIGN_CMPLIBS_TOKEN, AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN, AXIS_DESIGN_OPTIONS_NODE_FOR_MENU, AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, AXIS_EVENT_HANDLERS_TOKEN, AXIS_EVENT_HANDLER_DESCS_TOKEN, AXIS_FORM_REGISTE_CONTROL_TOKEN, AXIS_HTTP_CONTEXT_DATA_TOKEN, AXIS_HTTP_CONTEXT_TOKEN, AXIS_INJECT_DATA_TOKEN, AXIS_INJECT_FUNC_TOKEN, AXIS_SCRIPTS_TOKEN, Base, BaseDesignSetting, BaseMenu, BaseOptions, CommonMenu, ComponentsLoader, DataHandler, DataOptions, DesignBuilder, DynamicDirective, ElementNode, FilteredTreeResult, FormValidators, FunField, FunFieldBase, FunFieldValueBase, HowLongPipe, InputTrigger, InputValidator, OptionsNode, ScopeDirective, SimpleMenu, ValueAccess, ValueAccessOptions, ValueDesignSetting, assignDefaultField, baseFbConfig, baseFunField, buildValidators, codeName, copy, deepMerge, fn, isEquals, listSort, nameCode, obj2Arr, objDiff, rebuildObject, recursionArray, recursionObject, trackByFn, updateAndValidAll, valueFbConfig, valueFunField };
826
+ export { AXIS_COMPONENTS_LOADER_TOKEN, AXIS_COMPONENTS_TOKEN, AXIS_CURRENT_USER_PERMISSIONS_TOKEN, AXIS_DESIGN_ALL_PERMISSIONS_TOKEN, AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN, AXIS_DESIGN_CMPLIBS_TOKEN, AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN, AXIS_DESIGN_OPTIONS_NODE_FOR_MENU, AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, AXIS_EVENT_HANDLERS_TOKEN, AXIS_EVENT_HANDLER_DESCS_TOKEN, AXIS_FILE_BASE_URL_TOKEN, AXIS_FORM_REGISTE_CONTROL_TOKEN, AXIS_HTTP_CONTEXT_DATA_TOKEN, AXIS_HTTP_CONTEXT_TOKEN, AXIS_INJECT_DATA_TOKEN, AXIS_INJECT_FUNC_TOKEN, AXIS_SCRIPTS_TOKEN, Base, BaseDesignSetting, BaseMenu, BaseOptions, CommonMenu, ComponentsLoader, DataHandler, DataOptions, DesignBuilder, DynamicDirective, ElementNode, FilteredTreeResult, FormValidators, FunField, FunFieldBase, FunFieldValueBase, HowLongPipe, InputTrigger, InputValidator, OptionsNode, ScopeDirective, SimpleMenu, ValueAccess, ValueAccessOptions, ValueDesignSetting, assignDefaultField, baseFbConfig, baseFunField, buildValidators, codeName, copy, deepMerge, fn, isEquals, listSort, nameCode, obj2Arr, objDiff, rebuildObject, recursionArray, recursionObject, trackByFn, updateAndValidAll, valueFbConfig, valueFunField };
826
827
  export type { Cmplib, DataSourceOptions, DesignBindElementsResult, DesignBuildResult, DesignConfig, DynamicFnOptions, EventDesc, EventHandlerDesc, EventHandlerDescGroup, EventHandlerOptions, EventsHandler, Example, ExampleBuilder, ExampleDesc, ExampleGroup, FlatNode, FunFieldOptions, FunFieldValue, MyErrorsOptions, MyValidationErrors, NextInfo, OptionsChangeEvent, RegisteFormControlOptions, RegisteValueAccessOptions, ScopeInfo, TriggeEventsOptions };
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { DataOptions, Base } from 'ngx-axis-appforge/core';
2
+ import { signal, inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { DataOptions, Base, AXIS_FILE_BASE_URL_TOKEN } from 'ngx-axis-appforge/core';
4
4
  import * as i1 from 'ng-zorro-antd/image';
5
5
  import { NzImageModule } from 'ng-zorro-antd/image';
6
6
  import * as i2 from 'ng-zorro-antd/icon';
@@ -14,6 +14,7 @@ class ImageOptions extends DataOptions {
14
14
  }
15
15
 
16
16
  class Image extends Base {
17
+ fileBaseUrl = inject(AXIS_FILE_BASE_URL_TOKEN, { optional: true }) ?? "";
17
18
  options = new ImageOptions();
18
19
  imgList = computed(() => {
19
20
  const data = this.options.data();
@@ -27,12 +28,20 @@ class Image extends Base {
27
28
  return [];
28
29
  }
29
30
  }, ...(ngDevMode ? [{ debugName: "imgList" }] : []));
31
+ getUrl(url) {
32
+ if (url.startsWith("http")) {
33
+ return url;
34
+ }
35
+ else {
36
+ return this.fileBaseUrl + url;
37
+ }
38
+ }
30
39
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Image, deps: null, target: i0.ɵɵFactoryTarget.Component });
31
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Image, isStandalone: true, selector: "axis-image", usesInheritance: true, ngImport: i0, template: "<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"i\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>", styles: [":host{display:block;overflow:hidden;position:relative}.img-box{position:relative;overflow:hidden;border-radius:4px;border:1px solid #00000017;pointer-events:none;width:100%;height:100%}.img-box.preview{pointer-events:all;cursor:pointer}.img-box img{width:100%;height:100%}.img-box img.aspectFill{object-fit:cover}.img-box img.scaleToFill{object-fit:fill}.img-box img.aspectFit{object-fit:contain}.pre{pointer-events:none;transition:all .3s;position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1;display:flex;justify-content:center;align-items:center;color:#fff;opacity:0}.img-box:hover .pre{opacity:1}\n"], dependencies: [{ kind: "ngmodule", type: NzImageModule }, { kind: "directive", type: i1.NzImageDirective, selector: "img[nz-image]", inputs: ["nzSrc", "nzSrcset", "nzDisablePreview", "nzFallback", "nzPlaceholder", "nzScaleStep"], exportAs: ["nzImage"] }, { kind: "component", type: i1.NzImageGroupComponent, selector: "nz-image-group", inputs: ["nzScaleStep"], exportAs: ["nzImageGroup"] }, { 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: NzFlexModule }, { kind: "directive", type: i3.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
40
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Image, isStandalone: true, selector: "axis-image", usesInheritance: true, ngImport: i0, template: "<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"getUrl(i)\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>", styles: [":host{display:block;overflow:hidden;position:relative}.img-box{position:relative;overflow:hidden;border-radius:4px;border:1px solid #00000017;pointer-events:none;width:100%;height:100%}.img-box.preview{pointer-events:all;cursor:pointer}.img-box img{width:100%;height:100%}.img-box img.aspectFill{object-fit:cover}.img-box img.scaleToFill{object-fit:fill}.img-box img.aspectFit{object-fit:contain}.pre{pointer-events:none;transition:all .3s;position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1;display:flex;justify-content:center;align-items:center;color:#fff;opacity:0}.img-box:hover .pre{opacity:1}\n"], dependencies: [{ kind: "ngmodule", type: NzImageModule }, { kind: "directive", type: i1.NzImageDirective, selector: "img[nz-image]", inputs: ["nzSrc", "nzSrcset", "nzDisablePreview", "nzFallback", "nzPlaceholder", "nzScaleStep"], exportAs: ["nzImage"] }, { kind: "component", type: i1.NzImageGroupComponent, selector: "nz-image-group", inputs: ["nzScaleStep"], exportAs: ["nzImageGroup"] }, { 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: NzFlexModule }, { kind: "directive", type: i3.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
32
41
  }
33
42
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Image, decorators: [{
34
43
  type: Component,
35
- args: [{ selector: 'axis-image', imports: [NzImageModule, NzIconModule, NzFlexModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"i\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>", styles: [":host{display:block;overflow:hidden;position:relative}.img-box{position:relative;overflow:hidden;border-radius:4px;border:1px solid #00000017;pointer-events:none;width:100%;height:100%}.img-box.preview{pointer-events:all;cursor:pointer}.img-box img{width:100%;height:100%}.img-box img.aspectFill{object-fit:cover}.img-box img.scaleToFill{object-fit:fill}.img-box img.aspectFit{object-fit:contain}.pre{pointer-events:none;transition:all .3s;position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1;display:flex;justify-content:center;align-items:center;color:#fff;opacity:0}.img-box:hover .pre{opacity:1}\n"] }]
44
+ args: [{ selector: 'axis-image', imports: [NzImageModule, NzIconModule, NzFlexModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"getUrl(i)\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>", styles: [":host{display:block;overflow:hidden;position:relative}.img-box{position:relative;overflow:hidden;border-radius:4px;border:1px solid #00000017;pointer-events:none;width:100%;height:100%}.img-box.preview{pointer-events:all;cursor:pointer}.img-box img{width:100%;height:100%}.img-box img.aspectFill{object-fit:cover}.img-box img.scaleToFill{object-fit:fill}.img-box img.aspectFit{object-fit:contain}.pre{pointer-events:none;transition:all .3s;position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1;display:flex;justify-content:center;align-items:center;color:#fff;opacity:0}.img-box:hover .pre{opacity:1}\n"] }]
36
45
  }] });
37
46
 
38
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-axis-appforge-axis-components-image.mjs","sources":["../../../axis-components/image/image.options.ts","../../../axis-components/image/image.ts","../../../axis-components/image/image.html","../../../axis-components/image/ngx-axis-appforge-axis-components-image.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { DataOptions } from \"ngx-axis-appforge/core\";\n\nexport class ImageOptions extends DataOptions {\n\n mode = signal<\"aspectFit\" | \"aspectFill\" | \"scaleToFill\">(\"aspectFit\");\n preview = signal(true);\n}","import { ChangeDetectionStrategy, Component, computed } from '@angular/core';\nimport { Base } from 'ngx-axis-appforge/core';\nimport { ImageOptions } from './image.options';\nimport { NzImageModule } from 'ng-zorro-antd/image';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzFlexModule } from 'ng-zorro-antd/flex';\n\n@Component({\n selector: 'axis-image',\n imports: [NzImageModule, NzIconModule, NzFlexModule],\n templateUrl: './image.html',\n styleUrl: './image.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Image extends Base<ImageOptions> {\n\n override options: ImageOptions = new ImageOptions();\n\n readonly imgList = computed(() => {\n const data = this.options.data();\n if (Array.isArray(data)) {\n return data;\n } else if (data) {\n return [data];\n } else {\n return [];\n }\n });\n}\n","<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"i\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './image';\n"],"names":[],"mappings":";;;;;;;;;;AAGM,MAAO,YAAa,SAAQ,WAAW,CAAA;AAEzC,IAAA,IAAI,GAAG,MAAM,CAA6C,WAAW,gDAAC;AACtE,IAAA,OAAO,GAAG,MAAM,CAAC,IAAI,mDAAC;AACzB;;ACOK,MAAO,KAAM,SAAQ,IAAkB,CAAA;AAElC,IAAA,OAAO,GAAiB,IAAI,YAAY,EAAE;AAE1C,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;AAChC,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AACvB,YAAA,OAAO,IAAI;;aACN,IAAI,IAAI,EAAE;YACf,OAAO,CAAC,IAAI,CAAC;;aACR;AACL,YAAA,OAAO,EAAE;;AAEb,KAAC,mDAAC;uGAbS,KAAK,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAL,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAK,6FCdlB,6gBAaiB,EAAA,MAAA,EAAA,CAAA,ioBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDJL,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,YAAA,EAAA,eAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,qBAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,YAAY,yNAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,WAAA,EAAA,SAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAKxC,KAAK,EAAA,UAAA,EAAA,CAAA;kBAPjB,SAAS;+BACE,YAAY,EAAA,OAAA,EACb,CAAC,aAAa,EAAE,YAAY,EAAE,YAAY,CAAC,EAAA,eAAA,EAGnC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,6gBAAA,EAAA,MAAA,EAAA,CAAA,ioBAAA,CAAA,EAAA;;;AEZjD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-axis-appforge-axis-components-image.mjs","sources":["../../../axis-components/image/image.options.ts","../../../axis-components/image/image.ts","../../../axis-components/image/image.html","../../../axis-components/image/ngx-axis-appforge-axis-components-image.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { DataOptions } from \"ngx-axis-appforge/core\";\n\nexport class ImageOptions extends DataOptions {\n\n mode = signal<\"aspectFit\" | \"aspectFill\" | \"scaleToFill\">(\"aspectFit\");\n preview = signal(true);\n}","import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { AXIS_FILE_BASE_URL_TOKEN, Base } from 'ngx-axis-appforge/core';\nimport { ImageOptions } from './image.options';\nimport { NzImageModule } from 'ng-zorro-antd/image';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzFlexModule } from 'ng-zorro-antd/flex';\n\n@Component({\n selector: 'axis-image',\n imports: [NzImageModule, NzIconModule, NzFlexModule],\n templateUrl: './image.html',\n styleUrl: './image.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Image extends Base<ImageOptions> {\n\n private readonly fileBaseUrl = inject(AXIS_FILE_BASE_URL_TOKEN, { optional: true }) ?? \"\";\n override options: ImageOptions = new ImageOptions();\n\n readonly imgList = computed(() => {\n const data = this.options.data();\n if (Array.isArray(data)) {\n return data;\n } else if (data) {\n return [data];\n } else {\n return [];\n }\n });\n\n getUrl(url: string): string {\n if (url.startsWith(\"http\")) {\n return url;\n } else {\n return this.fileBaseUrl + url;\n }\n }\n}\n","<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"getUrl(i)\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './image';\n"],"names":[],"mappings":";;;;;;;;;;AAGM,MAAO,YAAa,SAAQ,WAAW,CAAA;AAEzC,IAAA,IAAI,GAAG,MAAM,CAA6C,WAAW,gDAAC;AACtE,IAAA,OAAO,GAAG,MAAM,CAAC,IAAI,mDAAC;AACzB;;ACOK,MAAO,KAAM,SAAQ,IAAkB,CAAA;AAE1B,IAAA,WAAW,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE;AAChF,IAAA,OAAO,GAAiB,IA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AA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,YAAY,yNAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,WAAA,EAAA,SAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAKxC,KAAK,EAAA,UAAA,EAAA,CAAA;kBAPjB,SAAS;+BACE,YAAY,EAAA,OAAA,EACb,CAAC,aAAa,EAAE,YAAY,EAAE,YAAY,CAAC,EAAA,eAAA,EAGnC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,qhBAAA,EAAA,MAAA,EAAA,CAAA,ioBAAA,CAAA,EAAA;;;AEZjD;;AAEG;;;;"}
@@ -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() && ( 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 });
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() && ( 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"] }]
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,oDAA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AAY,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,QA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AAA,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;;;;"}
@@ -76,6 +76,7 @@ const AXIS_INJECT_FUNC_TOKEN = new InjectionToken('axis.injectFunc');
76
76
  const AXIS_CURRENT_USER_PERMISSIONS_TOKEN = new InjectionToken('axis.currentUserPermissions');
77
77
  const AXIS_HTTP_CONTEXT_DATA_TOKEN = new InjectionToken('axis.httpContextData');
78
78
  const AXIS_FORM_REGISTE_CONTROL_TOKEN = new InjectionToken('axis.form.registeControl');
79
+ const AXIS_FILE_BASE_URL_TOKEN = new InjectionToken('axis.fileBaseUrl');
79
80
  const AXIS_HTTP_CONTEXT_TOKEN = new HttpContextToken(() => ({}));
80
81
 
81
82
  const notDefinedRegDefault = /^(.*) is not defined$/;
@@ -3401,5 +3402,5 @@ function nameCode(name, code) {
3401
3402
  * Generated bundle index. Do not edit.
3402
3403
  */
3403
3404
 
3404
- export { AXIS_COMPONENTS_LOADER_TOKEN, AXIS_COMPONENTS_TOKEN, AXIS_CURRENT_USER_PERMISSIONS_TOKEN, AXIS_DESIGN_ALL_PERMISSIONS_TOKEN, AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN, AXIS_DESIGN_CMPLIBS_TOKEN, AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN, AXIS_DESIGN_OPTIONS_NODE_FOR_MENU, AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, AXIS_EVENT_HANDLERS_TOKEN, AXIS_EVENT_HANDLER_DESCS_TOKEN, AXIS_FORM_REGISTE_CONTROL_TOKEN, AXIS_HTTP_CONTEXT_DATA_TOKEN, AXIS_HTTP_CONTEXT_TOKEN, AXIS_INJECT_DATA_TOKEN, AXIS_INJECT_FUNC_TOKEN, AXIS_SCRIPTS_TOKEN, Base, BaseDesignSetting, BaseMenu, BaseOptions, CommonMenu, ComponentsLoader, DataHandler, DataOptions, DesignBuilder, DynamicDirective, ElementNode, FilteredTreeResult, FormValidators, FunField, FunFieldBase, FunFieldValueBase, HowLongPipe, InputTrigger, InputValidator, OptionsNode, ScopeDirective, SimpleMenu, ValueAccess, ValueAccessOptions, ValueDesignSetting, assignDefaultField, baseFbConfig, baseFunField, buildValidators, codeName, copy, deepMerge, fn, isEquals, listSort, nameCode, obj2Arr, objDiff, rebuildObject, recursionArray, recursionObject, trackByFn, updateAndValidAll, valueFbConfig, valueFunField };
3405
+ export { AXIS_COMPONENTS_LOADER_TOKEN, AXIS_COMPONENTS_TOKEN, AXIS_CURRENT_USER_PERMISSIONS_TOKEN, AXIS_DESIGN_ALL_PERMISSIONS_TOKEN, AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN, AXIS_DESIGN_CMPLIBS_TOKEN, AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN, AXIS_DESIGN_OPTIONS_NODE_FOR_MENU, AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, AXIS_EVENT_HANDLERS_TOKEN, AXIS_EVENT_HANDLER_DESCS_TOKEN, AXIS_FILE_BASE_URL_TOKEN, AXIS_FORM_REGISTE_CONTROL_TOKEN, AXIS_HTTP_CONTEXT_DATA_TOKEN, AXIS_HTTP_CONTEXT_TOKEN, AXIS_INJECT_DATA_TOKEN, AXIS_INJECT_FUNC_TOKEN, AXIS_SCRIPTS_TOKEN, Base, BaseDesignSetting, BaseMenu, BaseOptions, CommonMenu, ComponentsLoader, DataHandler, DataOptions, DesignBuilder, DynamicDirective, ElementNode, FilteredTreeResult, FormValidators, FunField, FunFieldBase, FunFieldValueBase, HowLongPipe, InputTrigger, InputValidator, OptionsNode, ScopeDirective, SimpleMenu, ValueAccess, ValueAccessOptions, ValueDesignSetting, assignDefaultField, baseFbConfig, baseFunField, buildValidators, codeName, copy, deepMerge, fn, isEquals, listSort, nameCode, obj2Arr, objDiff, rebuildObject, recursionArray, recursionObject, trackByFn, updateAndValidAll, valueFbConfig, valueFunField };
3405
3406
  //# sourceMappingURL=ngx-axis-appforge-core.mjs.map