ngx-axis-appforge 0.0.48 → 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/fesm2022/ngx-axis-appforge-axis-components-badge-design.mjs +3 -3
  2. package/fesm2022/ngx-axis-appforge-axis-components-badge-design.mjs.map +1 -1
  3. package/fesm2022/ngx-axis-appforge-axis-components-badge.mjs +3 -3
  4. package/fesm2022/ngx-axis-appforge-axis-components-button-design.mjs +3 -3
  5. package/fesm2022/ngx-axis-appforge-axis-components-button-design.mjs.map +1 -1
  6. package/fesm2022/ngx-axis-appforge-axis-components-button.mjs +3 -3
  7. package/fesm2022/ngx-axis-appforge-axis-components-button.mjs.map +1 -1
  8. package/fesm2022/ngx-axis-appforge-axis-components-checkbox-design.mjs +3 -3
  9. package/fesm2022/ngx-axis-appforge-axis-components-checkbox-design.mjs.map +1 -1
  10. package/fesm2022/ngx-axis-appforge-axis-components-checkbox.mjs +3 -3
  11. package/fesm2022/ngx-axis-appforge-axis-components-checkbox.mjs.map +1 -1
  12. package/fesm2022/ngx-axis-appforge-axis-components-color-picker-design.mjs +3 -3
  13. package/fesm2022/ngx-axis-appforge-axis-components-color-picker-design.mjs.map +1 -1
  14. package/fesm2022/ngx-axis-appforge-axis-components-color-picker.mjs +3 -3
  15. package/fesm2022/ngx-axis-appforge-axis-components-cytoscape-design.mjs +3 -3
  16. package/fesm2022/ngx-axis-appforge-axis-components-cytoscape-design.mjs.map +1 -1
  17. package/fesm2022/ngx-axis-appforge-axis-components-cytoscape.mjs +3 -3
  18. package/fesm2022/ngx-axis-appforge-axis-components-cytoscape.mjs.map +1 -1
  19. package/fesm2022/ngx-axis-appforge-axis-components-date-picker-design.mjs +3 -3
  20. package/fesm2022/ngx-axis-appforge-axis-components-date-picker-design.mjs.map +1 -1
  21. package/fesm2022/ngx-axis-appforge-axis-components-date-picker.mjs +3 -3
  22. package/fesm2022/ngx-axis-appforge-axis-components-date-picker.mjs.map +1 -1
  23. package/fesm2022/ngx-axis-appforge-axis-components-desc-design.mjs +9 -9
  24. package/fesm2022/ngx-axis-appforge-axis-components-desc-design.mjs.map +1 -1
  25. package/fesm2022/ngx-axis-appforge-axis-components-desc.mjs +3 -3
  26. package/fesm2022/ngx-axis-appforge-axis-components-desc.mjs.map +1 -1
  27. package/fesm2022/ngx-axis-appforge-axis-components-design-design.mjs +3 -3
  28. package/fesm2022/ngx-axis-appforge-axis-components-design-design.mjs.map +1 -1
  29. package/fesm2022/ngx-axis-appforge-axis-components-design.mjs +15 -15
  30. package/fesm2022/ngx-axis-appforge-axis-components-design.mjs.map +1 -1
  31. package/fesm2022/ngx-axis-appforge-axis-components-dropdown-design.mjs +3 -3
  32. package/fesm2022/ngx-axis-appforge-axis-components-dropdown-design.mjs.map +1 -1
  33. package/fesm2022/ngx-axis-appforge-axis-components-dropdown.mjs +3 -3
  34. package/fesm2022/ngx-axis-appforge-axis-components-dropdown.mjs.map +1 -1
  35. package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container-design.mjs +3 -3
  36. package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container-design.mjs.map +1 -1
  37. package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container.mjs +3 -3
  38. package/fesm2022/ngx-axis-appforge-axis-components-dynamic-value-design.mjs +3 -3
  39. package/fesm2022/ngx-axis-appforge-axis-components-dynamic-value-design.mjs.map +1 -1
  40. package/fesm2022/ngx-axis-appforge-axis-components-dynamic-value.mjs +3 -3
  41. package/fesm2022/ngx-axis-appforge-axis-components-edit-table-design.mjs +9 -9
  42. package/fesm2022/ngx-axis-appforge-axis-components-edit-table-design.mjs.map +1 -1
  43. package/fesm2022/ngx-axis-appforge-axis-components-edit-table.mjs +3 -3
  44. package/fesm2022/ngx-axis-appforge-axis-components-edit-table.mjs.map +1 -1
  45. package/fesm2022/ngx-axis-appforge-axis-components-editor-design.mjs +3 -3
  46. package/fesm2022/ngx-axis-appforge-axis-components-editor-design.mjs.map +1 -1
  47. package/fesm2022/ngx-axis-appforge-axis-components-editor.mjs +3 -3
  48. package/fesm2022/ngx-axis-appforge-axis-components-editor.mjs.map +1 -1
  49. package/fesm2022/ngx-axis-appforge-axis-components-flex-design.mjs +3 -3
  50. package/fesm2022/ngx-axis-appforge-axis-components-flex-design.mjs.map +1 -1
  51. package/fesm2022/ngx-axis-appforge-axis-components-flex.mjs +3 -3
  52. package/fesm2022/ngx-axis-appforge-axis-components-form-design.mjs +3 -3
  53. package/fesm2022/ngx-axis-appforge-axis-components-form-design.mjs.map +1 -1
  54. package/fesm2022/ngx-axis-appforge-axis-components-form-item-design.mjs +3 -3
  55. package/fesm2022/ngx-axis-appforge-axis-components-form-item-design.mjs.map +1 -1
  56. package/fesm2022/ngx-axis-appforge-axis-components-form-item.mjs +3 -3
  57. package/fesm2022/ngx-axis-appforge-axis-components-form-item.mjs.map +1 -1
  58. package/fesm2022/ngx-axis-appforge-axis-components-form.mjs +3 -3
  59. package/fesm2022/ngx-axis-appforge-axis-components-form.mjs.map +1 -1
  60. package/fesm2022/ngx-axis-appforge-axis-components-icon-design.mjs +3 -3
  61. package/fesm2022/ngx-axis-appforge-axis-components-icon-design.mjs.map +1 -1
  62. package/fesm2022/ngx-axis-appforge-axis-components-icon.mjs +3 -3
  63. package/fesm2022/ngx-axis-appforge-axis-components-image-design.mjs +3 -3
  64. package/fesm2022/ngx-axis-appforge-axis-components-image-design.mjs.map +1 -1
  65. package/fesm2022/ngx-axis-appforge-axis-components-image.mjs +3 -3
  66. package/fesm2022/ngx-axis-appforge-axis-components-image.mjs.map +1 -1
  67. package/fesm2022/ngx-axis-appforge-axis-components-input-component-design.mjs +3 -3
  68. package/fesm2022/ngx-axis-appforge-axis-components-input-component-design.mjs.map +1 -1
  69. package/fesm2022/ngx-axis-appforge-axis-components-input-component.mjs +3 -3
  70. package/fesm2022/ngx-axis-appforge-axis-components-input-component.mjs.map +1 -1
  71. package/fesm2022/ngx-axis-appforge-axis-components-input-design.mjs +3 -3
  72. package/fesm2022/ngx-axis-appforge-axis-components-input-design.mjs.map +1 -1
  73. package/fesm2022/ngx-axis-appforge-axis-components-input-icon-design.mjs +3 -3
  74. package/fesm2022/ngx-axis-appforge-axis-components-input-icon-design.mjs.map +1 -1
  75. package/fesm2022/ngx-axis-appforge-axis-components-input-icon.mjs +3 -3
  76. package/fesm2022/ngx-axis-appforge-axis-components-input-icon.mjs.map +1 -1
  77. package/fesm2022/ngx-axis-appforge-axis-components-input-json-design.mjs +3 -3
  78. package/fesm2022/ngx-axis-appforge-axis-components-input-json-design.mjs.map +1 -1
  79. package/fesm2022/ngx-axis-appforge-axis-components-input-json.mjs +3 -3
  80. package/fesm2022/ngx-axis-appforge-axis-components-input-json.mjs.map +1 -1
  81. package/fesm2022/ngx-axis-appforge-axis-components-input-number-design.mjs +3 -3
  82. package/fesm2022/ngx-axis-appforge-axis-components-input-number-design.mjs.map +1 -1
  83. package/fesm2022/ngx-axis-appforge-axis-components-input-number.mjs +3 -3
  84. package/fesm2022/ngx-axis-appforge-axis-components-input-number.mjs.map +1 -1
  85. package/fesm2022/ngx-axis-appforge-axis-components-input.mjs +3 -3
  86. package/fesm2022/ngx-axis-appforge-axis-components-input.mjs.map +1 -1
  87. package/fesm2022/ngx-axis-appforge-axis-components-menu-design.mjs +12 -12
  88. package/fesm2022/ngx-axis-appforge-axis-components-menu-design.mjs.map +1 -1
  89. package/fesm2022/ngx-axis-appforge-axis-components-menu.mjs +3 -3
  90. package/fesm2022/ngx-axis-appforge-axis-components-menu.mjs.map +1 -1
  91. package/fesm2022/ngx-axis-appforge-axis-components-modal-design.mjs +6 -6
  92. package/fesm2022/ngx-axis-appforge-axis-components-modal-design.mjs.map +1 -1
  93. package/fesm2022/ngx-axis-appforge-axis-components-modal.mjs +3 -3
  94. package/fesm2022/ngx-axis-appforge-axis-components-modal.mjs.map +1 -1
  95. package/fesm2022/ngx-axis-appforge-axis-components-radio-design.mjs +3 -3
  96. package/fesm2022/ngx-axis-appforge-axis-components-radio-design.mjs.map +1 -1
  97. package/fesm2022/ngx-axis-appforge-axis-components-radio.mjs +3 -3
  98. package/fesm2022/ngx-axis-appforge-axis-components-radio.mjs.map +1 -1
  99. package/fesm2022/ngx-axis-appforge-axis-components-rate-design.mjs +3 -3
  100. package/fesm2022/ngx-axis-appforge-axis-components-rate-design.mjs.map +1 -1
  101. package/fesm2022/ngx-axis-appforge-axis-components-rate.mjs +3 -3
  102. package/fesm2022/ngx-axis-appforge-axis-components-scope-design.mjs +6 -6
  103. package/fesm2022/ngx-axis-appforge-axis-components-scope-design.mjs.map +1 -1
  104. package/fesm2022/ngx-axis-appforge-axis-components-scope.mjs +3 -3
  105. package/fesm2022/ngx-axis-appforge-axis-components-scope.mjs.map +1 -1
  106. package/fesm2022/ngx-axis-appforge-axis-components-select-design.mjs +3 -3
  107. package/fesm2022/ngx-axis-appforge-axis-components-select-design.mjs.map +1 -1
  108. package/fesm2022/ngx-axis-appforge-axis-components-select.mjs +3 -4
  109. package/fesm2022/ngx-axis-appforge-axis-components-select.mjs.map +1 -1
  110. package/fesm2022/ngx-axis-appforge-axis-components-single-selector-design.mjs +3 -3
  111. package/fesm2022/ngx-axis-appforge-axis-components-single-selector-design.mjs.map +1 -1
  112. package/fesm2022/ngx-axis-appforge-axis-components-single-selector.mjs +3 -3
  113. package/fesm2022/ngx-axis-appforge-axis-components-single-selector.mjs.map +1 -1
  114. package/fesm2022/ngx-axis-appforge-axis-components-splitter-design.mjs +9 -9
  115. package/fesm2022/ngx-axis-appforge-axis-components-splitter-design.mjs.map +1 -1
  116. package/fesm2022/ngx-axis-appforge-axis-components-splitter.mjs +3 -3
  117. package/fesm2022/ngx-axis-appforge-axis-components-splitter.mjs.map +1 -1
  118. package/fesm2022/ngx-axis-appforge-axis-components-steps-design.mjs +9 -9
  119. package/fesm2022/ngx-axis-appforge-axis-components-steps-design.mjs.map +1 -1
  120. package/fesm2022/ngx-axis-appforge-axis-components-steps.mjs +3 -3
  121. package/fesm2022/ngx-axis-appforge-axis-components-steps.mjs.map +1 -1
  122. package/fesm2022/ngx-axis-appforge-axis-components-switch-design.mjs +3 -3
  123. package/fesm2022/ngx-axis-appforge-axis-components-switch-design.mjs.map +1 -1
  124. package/fesm2022/ngx-axis-appforge-axis-components-switch.mjs +3 -3
  125. package/fesm2022/ngx-axis-appforge-axis-components-switch.mjs.map +1 -1
  126. package/fesm2022/ngx-axis-appforge-axis-components-table-design.mjs +9 -9
  127. package/fesm2022/ngx-axis-appforge-axis-components-table-design.mjs.map +1 -1
  128. package/fesm2022/ngx-axis-appforge-axis-components-table-helper.mjs +15 -15
  129. package/fesm2022/ngx-axis-appforge-axis-components-table-helper.mjs.map +1 -1
  130. package/fesm2022/ngx-axis-appforge-axis-components-table.mjs +6 -6
  131. package/fesm2022/ngx-axis-appforge-axis-components-table.mjs.map +1 -1
  132. package/fesm2022/ngx-axis-appforge-axis-components-tabs-design.mjs +9 -9
  133. package/fesm2022/ngx-axis-appforge-axis-components-tabs-design.mjs.map +1 -1
  134. package/fesm2022/ngx-axis-appforge-axis-components-tabs.mjs +3 -3
  135. package/fesm2022/ngx-axis-appforge-axis-components-tabs.mjs.map +1 -1
  136. package/fesm2022/ngx-axis-appforge-axis-components-text-design.mjs +3 -3
  137. package/fesm2022/ngx-axis-appforge-axis-components-text-design.mjs.map +1 -1
  138. package/fesm2022/ngx-axis-appforge-axis-components-text.mjs +3 -3
  139. package/fesm2022/ngx-axis-appforge-axis-components-text.mjs.map +1 -1
  140. package/fesm2022/ngx-axis-appforge-axis-components-textarea-design.mjs +3 -3
  141. package/fesm2022/ngx-axis-appforge-axis-components-textarea-design.mjs.map +1 -1
  142. package/fesm2022/ngx-axis-appforge-axis-components-textarea.mjs +3 -3
  143. package/fesm2022/ngx-axis-appforge-axis-components-textarea.mjs.map +1 -1
  144. package/fesm2022/ngx-axis-appforge-axis-components-timer-design.mjs +3 -3
  145. package/fesm2022/ngx-axis-appforge-axis-components-timer-design.mjs.map +1 -1
  146. package/fesm2022/ngx-axis-appforge-axis-components-timer.mjs +3 -3
  147. package/fesm2022/ngx-axis-appforge-axis-components-timer.mjs.map +1 -1
  148. package/fesm2022/ngx-axis-appforge-axis-components-transfer-design.mjs +9 -9
  149. package/fesm2022/ngx-axis-appforge-axis-components-transfer-design.mjs.map +1 -1
  150. package/fesm2022/ngx-axis-appforge-axis-components-transfer.mjs +3 -3
  151. package/fesm2022/ngx-axis-appforge-axis-components-transfer.mjs.map +1 -1
  152. package/fesm2022/ngx-axis-appforge-axis-components-tree-selector-design.mjs +9 -9
  153. package/fesm2022/ngx-axis-appforge-axis-components-tree-selector-design.mjs.map +1 -1
  154. package/fesm2022/ngx-axis-appforge-axis-components-tree-selector.mjs +3 -3
  155. package/fesm2022/ngx-axis-appforge-axis-components-tree-selector.mjs.map +1 -1
  156. package/fesm2022/ngx-axis-appforge-axis-components-upload-design.mjs +3 -3
  157. package/fesm2022/ngx-axis-appforge-axis-components-upload-design.mjs.map +1 -1
  158. package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs +3 -3
  159. package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs.map +1 -1
  160. package/fesm2022/ngx-axis-appforge-core.mjs +78 -78
  161. package/fesm2022/ngx-axis-appforge-core.mjs.map +1 -1
  162. package/fesm2022/ngx-axis-appforge-providers.mjs.map +1 -1
  163. package/package.json +98 -98
@@ -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 } 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 { BehaviorSubject, 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 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 getUrl(url: string): string {\n if (url.startsWith(\"http\")) {\n return url;\n } else if (this.fileBaseUrl instanceof BehaviorSubject) {\n return this.fileBaseUrl.value + 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 = this.runFn(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,GA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,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,EAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,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;;;;"}
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 { BehaviorSubject, 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 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 getUrl(url: string): string {\n if (url.startsWith(\"http\")) {\n return url;\n } else if (this.fileBaseUrl instanceof BehaviorSubject) {\n return this.fileBaseUrl.value + 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 = this.runFn(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,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