@vunk/form 2.10.1 → 2.10.4

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 (205) hide show
  1. package/components/api-tables-select/index.cjs +37 -36
  2. package/components/api-tables-select/index.d.ts +4 -0
  3. package/components/api-tables-select/index.mjs +37 -36
  4. package/components/api-tables-select/src/ctx.d.ts +374 -0
  5. package/components/api-tables-select/src/index.vue.d.ts +1335 -0
  6. package/components/api-tables-select/src/types.d.ts +19 -0
  7. package/components/button/index.d.ts +4 -0
  8. package/components/button/src/ctx.d.ts +190 -0
  9. package/components/button/src/index.vue.d.ts +822 -0
  10. package/components/button/src/types.d.ts +13 -0
  11. package/components/card-input-collection/index.cjs +67 -70
  12. package/components/card-input-collection/index.d.ts +4 -0
  13. package/components/card-input-collection/index.mjs +68 -71
  14. package/components/card-input-collection/src/ctx.d.ts +119 -0
  15. package/components/card-input-collection/src/index.vue.d.ts +1043 -0
  16. package/components/card-input-collection/src/types.d.ts +10 -0
  17. package/components/cascader/index.d.ts +6 -0
  18. package/components/cascader/src/ctx.d.ts +297 -0
  19. package/components/cascader/src/index.vue.d.ts +650 -0
  20. package/components/cascader/src/types.d.ts +19 -0
  21. package/components/cascader/src/use.d.ts +5 -0
  22. package/components/checkbox/index.cjs +2 -3
  23. package/components/checkbox/index.d.ts +5 -0
  24. package/components/checkbox/index.mjs +2 -3
  25. package/components/checkbox/src/ctx.d.ts +151 -0
  26. package/components/checkbox/src/index.vue.d.ts +1362 -0
  27. package/components/checkbox/src/types.d.ts +8 -0
  28. package/components/color-picker/index.d.ts +4 -0
  29. package/components/color-picker/src/ctx.d.ts +153 -0
  30. package/components/color-picker/src/index.vue.d.ts +341 -0
  31. package/components/color-picker/src/types.d.ts +7 -0
  32. package/components/date-picker/index.d.ts +5 -0
  33. package/components/date-picker/src/ctx.d.ts +325 -0
  34. package/components/date-picker/src/index.vue.d.ts +1422 -0
  35. package/components/date-picker/src/types.d.ts +20 -0
  36. package/components/date-picker-range/index.d.ts +4 -0
  37. package/components/date-picker-range/src/ctx.d.ts +328 -0
  38. package/components/date-picker-range/src/index.vue.d.ts +717 -0
  39. package/components/date-picker-range/src/types.d.ts +12 -0
  40. package/components/download-plus/index.cjs +4 -4
  41. package/components/download-plus/index.d.ts +4 -0
  42. package/components/download-plus/index.mjs +4 -4
  43. package/components/download-plus/src/api.d.ts +13 -0
  44. package/components/download-plus/src/const.d.ts +9 -0
  45. package/components/download-plus/src/ctx.d.ts +129 -0
  46. package/components/download-plus/src/index.vue.d.ts +1432 -0
  47. package/components/download-plus/src/types.d.ts +17 -0
  48. package/components/editable-text/index.cjs +9 -0
  49. package/components/editable-text/index.d.ts +4 -0
  50. package/components/editable-text/index.mjs +9 -0
  51. package/components/editable-text/src/ctx.d.ts +132 -0
  52. package/components/editable-text/src/index.vue.d.ts +3399 -0
  53. package/components/editable-text/src/types.d.ts +1 -0
  54. package/components/esri-input-geojson/index.d.ts +6 -0
  55. package/components/esri-input-geojson/src/append.vue.d.ts +1179 -0
  56. package/components/esri-input-geojson/src/const.d.ts +12 -0
  57. package/components/esri-input-geojson/src/ctx.d.ts +340 -0
  58. package/components/esri-input-geojson/src/default-view.vue.d.ts +133 -0
  59. package/components/esri-input-geojson/src/index.vue.d.ts +1459 -0
  60. package/components/esri-input-geojson/src/types.d.ts +22 -0
  61. package/components/esri-input-geojson/src/viewer.vue.d.ts +427 -0
  62. package/components/fieldset/index.d.ts +4 -0
  63. package/components/fieldset/src/ctx.d.ts +12 -0
  64. package/components/fieldset/src/index.vue.d.ts +23 -0
  65. package/components/fieldset/src/types.d.ts +1 -0
  66. package/components/fieldset/src/use.d.ts +5 -0
  67. package/components/form/index.d.ts +5 -0
  68. package/components/form/src/ctx.d.ts +132 -0
  69. package/components/form/src/index.vue.d.ts +4007 -0
  70. package/components/form/src/types.d.ts +25 -0
  71. package/components/form/src/utils.d.ts +15 -0
  72. package/components/form-item/index.d.ts +5 -0
  73. package/components/form-item/src/ctx.d.ts +107 -0
  74. package/components/form-item/src/index.vue.d.ts +961 -0
  75. package/components/form-item/src/types.d.ts +9 -0
  76. package/components/form-item-renderer/index.d.ts +4 -0
  77. package/components/form-item-renderer/src/core.vue.d.ts +38 -0
  78. package/components/form-item-renderer/src/ctx.d.ts +16 -0
  79. package/components/form-item-renderer/src/index.vue.d.ts +93 -0
  80. package/components/form-item-renderer/src/types.d.ts +5 -0
  81. package/components/form-item-renderer/src/utils.d.ts +5 -0
  82. package/components/form-item-renderer-template/index.d.ts +4 -0
  83. package/components/form-item-renderer-template/src/ctx.d.ts +7 -0
  84. package/components/form-item-renderer-template/src/index.vue.d.ts +16 -0
  85. package/components/form-item-renderer-template/src/types.d.ts +55 -0
  86. package/components/information/index.d.ts +4 -0
  87. package/components/information/src/ctx.d.ts +13 -0
  88. package/components/information/src/index.vue.d.ts +23 -0
  89. package/components/information/src/types.d.ts +3 -0
  90. package/components/information-collection/index.d.ts +4 -0
  91. package/components/information-collection/src/ctx.d.ts +147 -0
  92. package/components/information-collection/src/index.vue.d.ts +302 -0
  93. package/components/information-collection/src/types.d.ts +6 -0
  94. package/components/information-tag/index.d.ts +4 -0
  95. package/components/information-tag/src/ctx.d.ts +64 -0
  96. package/components/information-tag/src/index.vue.d.ts +134 -0
  97. package/components/information-tag/src/types.d.ts +1 -0
  98. package/components/information-templates-default/index.d.ts +4 -0
  99. package/components/information-templates-default/src/ctx.d.ts +2 -0
  100. package/components/information-templates-default/src/index.vue.d.ts +2 -0
  101. package/components/information-templates-default/src/types.d.ts +1 -0
  102. package/components/input/index.d.ts +5 -0
  103. package/components/input/src/ctx.d.ts +269 -0
  104. package/components/input/src/index.vue.d.ts +1192 -0
  105. package/components/input/src/types.d.ts +13 -0
  106. package/components/input-collection/index.cjs +105 -74
  107. package/components/input-collection/index.d.ts +4 -0
  108. package/components/input-collection/index.mjs +107 -76
  109. package/components/input-collection/src/ctx.d.ts +137 -0
  110. package/components/input-collection/src/index.vue.d.ts +1141 -0
  111. package/components/input-collection/src/types.d.ts +29 -0
  112. package/components/input-link/index.d.ts +4 -0
  113. package/components/input-link/src/ctx.d.ts +273 -0
  114. package/components/input-link/src/index.vue.d.ts +577 -0
  115. package/components/input-link/src/types.d.ts +7 -0
  116. package/components/input-number/index.d.ts +4 -0
  117. package/components/input-number/src/ctx.d.ts +208 -0
  118. package/components/input-number/src/index.vue.d.ts +816 -0
  119. package/components/input-number/src/types.d.ts +12 -0
  120. package/components/input-tag/index.d.ts +5 -0
  121. package/components/input-tag/src/ctx.d.ts +239 -0
  122. package/components/input-tag/src/index.vue.d.ts +991 -0
  123. package/components/input-tag/src/types.d.ts +22 -0
  124. package/components/monaco-editor/index.d.ts +4 -0
  125. package/components/monaco-editor/src/ctx.d.ts +115 -0
  126. package/components/monaco-editor/src/index.vue.d.ts +303 -0
  127. package/components/monaco-editor/src/types.d.ts +7 -0
  128. package/components/radio/index.cjs +2 -3
  129. package/components/radio/index.d.ts +4 -0
  130. package/components/radio/index.mjs +2 -3
  131. package/components/radio/src/ctx.d.ts +162 -0
  132. package/components/radio/src/index.vue.d.ts +1311 -0
  133. package/components/radio/src/types.d.ts +8 -0
  134. package/components/renderer-data/index.d.ts +4 -0
  135. package/components/renderer-data/src/ctx.d.ts +12 -0
  136. package/components/renderer-data/src/index.vue.d.ts +20 -0
  137. package/components/renderer-data/src/types.d.ts +1 -0
  138. package/components/select/index.d.ts +5 -0
  139. package/components/select/src/ctx.d.ts +225 -0
  140. package/components/select/src/index.vue.d.ts +1043 -0
  141. package/components/select/src/types.d.ts +11 -0
  142. package/components/slider/index.d.ts +4 -0
  143. package/components/slider/src/ctx.d.ts +253 -0
  144. package/components/slider/src/index.vue.d.ts +588 -0
  145. package/components/slider/src/types.d.ts +7 -0
  146. package/components/switch/index.d.ts +4 -0
  147. package/components/switch/src/ctx.d.ts +208 -0
  148. package/components/switch/src/index.vue.d.ts +895 -0
  149. package/components/switch/src/types.d.ts +8 -0
  150. package/components/tables-select/index.d.ts +5 -0
  151. package/components/tables-select/src/ctx.d.ts +420 -0
  152. package/components/tables-select/src/index.vue.d.ts +5411 -0
  153. package/components/tables-select/src/types.d.ts +9 -0
  154. package/components/template-instances-provider/index.d.ts +3 -0
  155. package/components/template-instances-provider/src/index.vue.d.ts +6 -0
  156. package/components/templates-default/index.d.ts +4 -0
  157. package/components/templates-default/src/ctx.d.ts +19 -0
  158. package/components/templates-default/src/index.vue.d.ts +187 -0
  159. package/components/templates-default/src/types.d.ts +55 -0
  160. package/components/templates-element-plus/index.d.ts +4 -0
  161. package/components/templates-element-plus/src/ctx.d.ts +9 -0
  162. package/components/templates-element-plus/src/index.vue.d.ts +301 -0
  163. package/components/templates-element-plus/src/types.d.ts +13 -0
  164. package/components/templates-esri/index.d.ts +4 -0
  165. package/components/templates-esri/src/ctx.d.ts +11 -0
  166. package/components/templates-esri/src/index.vue.d.ts +43 -0
  167. package/components/templates-esri/src/types.d.ts +2 -0
  168. package/components/templates-layout/index.d.ts +4 -0
  169. package/components/templates-layout/src/ctx.d.ts +9 -0
  170. package/components/templates-layout/src/index.vue.d.ts +446 -0
  171. package/components/templates-layout/src/types.d.ts +32 -0
  172. package/components/templates-variant/index.d.ts +4 -0
  173. package/components/templates-variant/src/ctx.d.ts +11 -0
  174. package/components/templates-variant/src/index.vue.d.ts +43 -0
  175. package/components/templates-variant/src/types.d.ts +2 -0
  176. package/components/upload/index.cjs +2 -2
  177. package/components/upload/index.d.ts +5 -0
  178. package/components/upload/index.mjs +2 -2
  179. package/components/upload/src/ctx.d.ts +294 -0
  180. package/components/upload/src/file.vue.d.ts +492 -0
  181. package/components/upload/src/index.vue.d.ts +1935 -0
  182. package/components/upload/src/types.d.ts +13 -0
  183. package/components/upload-plus/index.cjs +79 -86
  184. package/components/upload-plus/index.d.ts +6 -0
  185. package/components/upload-plus/index.mjs +79 -86
  186. package/components/upload-plus/src/api.d.ts +38 -0
  187. package/components/upload-plus/src/const.d.ts +9 -0
  188. package/components/upload-plus/src/ctx.d.ts +148 -0
  189. package/components/upload-plus/src/index.vue.d.ts +1754 -0
  190. package/components/upload-plus/src/types.d.ts +32 -0
  191. package/components/van-cascader/index.d.ts +4 -0
  192. package/components/van-cascader/src/ctx.d.ts +284 -0
  193. package/components/van-cascader/src/index.vue.d.ts +2116 -0
  194. package/components/van-cascader/src/types.d.ts +1 -0
  195. package/components/var-datetime-picker/index.d.ts +4 -0
  196. package/components/var-datetime-picker/src/const.d.ts +10 -0
  197. package/components/var-datetime-picker/src/ctx.d.ts +112 -0
  198. package/components/var-datetime-picker/src/index.vue.d.ts +1482 -0
  199. package/components/var-datetime-picker/src/types.d.ts +22 -0
  200. package/components/vditor/index.d.ts +4 -0
  201. package/components/vditor/src/ctx.d.ts +122 -0
  202. package/components/vditor/src/index.vue.d.ts +418 -0
  203. package/components/vditor/src/types.d.ts +7 -0
  204. package/package.json +1 -1
  205. package/shared/element-plus/ctx.d.ts +111 -30
@@ -0,0 +1,13 @@
1
+ import { VkfUpload } from '@vunk/form/components/upload';
2
+ import { VueComponentPropsType } from '@vunk/core';
3
+ import { BasicSource } from '@vunk/form/shared';
4
+ import { UploadRawFile as _UploadRawFile, UploadProps } from 'element-plus';
5
+ import { Setter } from '@vunk/form/shared/progress-it';
6
+ export type OnExceed = UploadProps['onExceed'];
7
+ export interface UploadRawFile extends _UploadRawFile {
8
+ progress: Setter;
9
+ }
10
+ export interface Source<P extends string = string> extends VueComponentPropsType<typeof VkfUpload>, BasicSource {
11
+ prop: P;
12
+ templateType: 'VkfUpload';
13
+ }
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var formItem = require('@vunk/form/components/form-item');
6
5
  var vue = require('vue');
6
+ var formItem = require('@vunk/form/components/form-item');
7
7
  var elementPlus = require('element-plus');
8
8
  var upload$1 = require('@vunk/form/shared/upload');
9
9
  var utilsFetch = require('@vunk/core/shared/utils-fetch');
@@ -13,7 +13,7 @@ var index = require('../index.cjs');
13
13
  var platform = require('@skzz/platform/shared/fetch/platform');
14
14
  var index$1 = require('../index2.cjs');
15
15
  var composables = require('@vunk/core/composables');
16
- var utilsClass = require('@vunk/core/shared/utils-class');
16
+ var _class = require('@vunk/shared/class');
17
17
  var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
18
18
 
19
19
  const props = {
@@ -18227,34 +18227,31 @@ var api = /*#__PURE__*/Object.freeze({
18227
18227
  verify: verify
18228
18228
  });
18229
18229
 
18230
- var _sfc_main = vue.defineComponent({
18231
- name: "VkfUploadPlus",
18232
- components: {
18233
- VkfFormItem: formItem.VkfFormItem,
18234
- ElInput: elementPlus.ElInput,
18235
- ElButtonGroup: elementPlus.ElButtonGroup,
18236
- ElButton: elementPlus.ElButton,
18237
- ElIcon: elementPlus.ElIcon,
18238
- SuccessFilled: index$1.success_filled_default
18239
- },
18240
- directives: {
18241
- loading: elementPlus.vLoading
18230
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
18231
+ ...{
18232
+ name: "VkfUploadPlus"
18242
18233
  },
18243
- props,
18234
+ __name: "index",
18235
+ props: props,
18244
18236
  emits,
18245
- setup(props2, { emit }) {
18246
- const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props2);
18237
+ setup(__props, { expose: __expose, emit: __emit }) {
18238
+ __expose();
18239
+ const vLoading = elementPlus.vLoading;
18240
+ const ToggleHandler = _class.ToggleHandler;
18241
+ const props = __props;
18242
+ const emit = __emit;
18243
+ const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props);
18247
18244
  const uuid = Math.random().toString(36).slice(-8);
18248
18245
  const containerFile = composables.useModelComputed({
18249
18246
  default: null,
18250
18247
  key: "file"
18251
- }, props2, emit);
18248
+ }, props, emit);
18252
18249
  const fileStatus = composables.useModelComputed({
18253
18250
  default: Status.wait,
18254
18251
  key: "fileStatus"
18255
- }, props2, emit);
18252
+ }, props, emit);
18256
18253
  vue.watchEffect(() => {
18257
- restFetch.baseURL = props2.url || platform.restFetch.baseURL;
18254
+ restFetch.baseURL = props.url || platform.restFetch.baseURL;
18258
18255
  });
18259
18256
  vue.watch(() => fileStatus.value, (v, ov) => {
18260
18257
  if (v === Status.doUpload) {
@@ -18292,7 +18289,7 @@ var _sfc_main = vue.defineComponent({
18292
18289
  const handleUpload = async () => {
18293
18290
  if (!containerFile.value) return;
18294
18291
  fileStatus.value = Status.uploading;
18295
- const chunkFiles = upload$1.createFileChunk(containerFile.value, props2.chunkSize);
18292
+ const chunkFiles = upload$1.createFileChunk(containerFile.value, props.chunkSize);
18296
18293
  const hash = await upload$1.calculateFileHashSample(containerFile.value);
18297
18294
  containerHash.value = hash;
18298
18295
  let uploadedList = [];
@@ -18373,7 +18370,7 @@ var _sfc_main = vue.defineComponent({
18373
18370
  const currentChunk = urls[i];
18374
18371
  if (currentChunk) {
18375
18372
  currentChunk.status = Status.uploading;
18376
- upload(currentChunk, props2.fileServiceType, {
18373
+ upload(currentChunk, props.fileServiceType, {
18377
18374
  onprogress(ev) {
18378
18375
  chunks.value[currentChunk.index].progress = parseInt(ev.loaded / ev.total * 100 + "");
18379
18376
  },
@@ -18422,8 +18419,8 @@ var _sfc_main = vue.defineComponent({
18422
18419
  return merge({
18423
18420
  filename: containerFile.value.name,
18424
18421
  identifier: containerHash.value,
18425
- fileServiceType: props2.fileServiceType,
18426
- dictId: props2.dictId,
18422
+ fileServiceType: props.fileServiceType,
18423
+ dictId: props.dictId,
18427
18424
  totalChunk: chunks.value.length
18428
18425
  }).then((res) => {
18429
18426
  emit("success", res);
@@ -18441,7 +18438,7 @@ var _sfc_main = vue.defineComponent({
18441
18438
  vue.onBeforeUnmount(() => {
18442
18439
  handlePause();
18443
18440
  });
18444
- class OnlineToggle extends utilsClass.ToggleHandler {
18441
+ class OnlineToggle extends ToggleHandler {
18445
18442
  constructor(listener) {
18446
18443
  super();
18447
18444
  this.listener = listener;
@@ -18462,19 +18459,23 @@ var _sfc_main = vue.defineComponent({
18462
18459
  vue.onBeforeUnmount(() => {
18463
18460
  offlineToggle.remove();
18464
18461
  });
18465
- return {
18466
- formItemBindProps,
18467
- handleFileChange,
18468
- uuid,
18469
- containerFile,
18470
- handleUpload,
18471
- fileStatus,
18472
- chunks,
18473
- Status,
18474
- filePrefixIcon,
18475
- handlePause,
18476
- merging
18477
- };
18462
+ const __returned__ = { vLoading, ToggleHandler, props, emit, formItemBindProps, uuid, containerFile, fileStatus, containerHash, chunks, uploadingXhrs, filePrefixIcon, handleFileChange, handleUpload, handlePause, cUploadedChunks, merging, cFile, OnlineToggle, offlineToggle, get VkfFormItem() {
18463
+ return formItem.VkfFormItem;
18464
+ }, get ElInput() {
18465
+ return elementPlus.ElInput;
18466
+ }, get ElButtonGroup() {
18467
+ return elementPlus.ElButtonGroup;
18468
+ }, get ElButton() {
18469
+ return elementPlus.ElButton;
18470
+ }, get ElIcon() {
18471
+ return elementPlus.ElIcon;
18472
+ }, get Status() {
18473
+ return Status;
18474
+ }, get SuccessFilled() {
18475
+ return index$1.success_filled_default;
18476
+ } };
18477
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
18478
+ return __returned__;
18478
18479
  }
18479
18480
  });
18480
18481
 
@@ -18490,60 +18491,52 @@ const _hoisted_4 = {
18490
18491
  };
18491
18492
  const _hoisted_5 = ["id", "accept"];
18492
18493
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18493
- const _component_ElInput = vue.resolveComponent("ElInput");
18494
- const _component_SuccessFilled = vue.resolveComponent("SuccessFilled");
18495
- const _component_ElIcon = vue.resolveComponent("ElIcon");
18496
- const _component_ElButton = vue.resolveComponent("ElButton");
18497
- const _component_el_button = vue.resolveComponent("el-button");
18498
- const _component_el_button_group = vue.resolveComponent("el-button-group");
18499
- const _component_VkfFormItem = vue.resolveComponent("VkfFormItem");
18500
- const _directive_loading = vue.resolveDirective("loading");
18501
18494
  return vue.openBlock(), vue.createBlock(
18502
- _component_VkfFormItem,
18503
- vue.mergeProps(_ctx.formItemBindProps, { class: "vkf-upload-plus" }),
18495
+ $setup["VkfFormItem"],
18496
+ vue.mergeProps($setup.formItemBindProps, { class: "vkf-upload-plus" }),
18504
18497
  {
18505
18498
  default: vue.withCtx(() => [
18506
18499
  vue.createElementVNode("div", _hoisted_1, [
18507
18500
  vue.createElementVNode("label", {
18508
- for: _ctx.uuid,
18501
+ for: $setup.uuid,
18509
18502
  class: "vkf-upload-plus-label"
18510
18503
  }, [
18511
- vue.createVNode(_component_ElInput, {
18504
+ vue.createVNode($setup["ElInput"], {
18512
18505
  class: vue.normalizeClass({
18513
- "is-success": _ctx.fileStatus === _ctx.Status.done,
18514
- "is-error": _ctx.fileStatus === _ctx.Status.error
18506
+ "is-success": $setup.fileStatus === $setup.Status.done,
18507
+ "is-error": $setup.fileStatus === $setup.Status.error
18515
18508
  }),
18516
- "model-value": _ctx.containerFile?.name,
18517
- "prefix-icon": _ctx.filePrefixIcon,
18509
+ "model-value": $setup.containerFile?.name,
18510
+ "prefix-icon": $setup.filePrefixIcon,
18518
18511
  placeholder: "\u8BF7\u9009\u62E9\u6587\u4EF6"
18519
18512
  }, null, 8, ["class", "model-value", "prefix-icon"]),
18520
- _ctx.fileStatus === _ctx.Status.done ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
18521
- vue.createVNode(_component_ElIcon, null, {
18513
+ $setup.fileStatus === $setup.Status.done ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
18514
+ vue.createVNode($setup["ElIcon"], null, {
18522
18515
  default: vue.withCtx(() => [
18523
- vue.createVNode(_component_SuccessFilled)
18516
+ vue.createVNode($setup["SuccessFilled"])
18524
18517
  ]),
18525
18518
  _: 1
18526
18519
  /* STABLE */
18527
18520
  }),
18528
- _cache[1] || (_cache[1] = vue.createElementVNode(
18521
+ _cache[0] || (_cache[0] = vue.createElementVNode(
18529
18522
  "span",
18530
18523
  { class: "vkf-upload-plus-msg" },
18531
18524
  " \u4E0A\u4F20\u6210\u529F ",
18532
18525
  -1
18533
- /* HOISTED */
18526
+ /* CACHED */
18534
18527
  ))
18535
18528
  ])) : vue.createCommentVNode("v-if", true),
18536
- _ctx.fileStatus === _ctx.Status.uploading || _ctx.fileStatus === _ctx.Status.pause ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
18529
+ $setup.fileStatus === $setup.Status.uploading || $setup.fileStatus === $setup.Status.pause ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
18537
18530
  (vue.openBlock(true), vue.createElementBlock(
18538
18531
  vue.Fragment,
18539
18532
  null,
18540
- vue.renderList(_ctx.chunks, (chunk) => {
18533
+ vue.renderList($setup.chunks, (chunk) => {
18541
18534
  return vue.openBlock(), vue.createElementBlock(
18542
18535
  "div",
18543
18536
  {
18544
18537
  key: chunk.hash,
18545
18538
  class: vue.normalizeClass(["vkf-upload-plus-cube", {
18546
- "error": chunk.status == _ctx.Status.error
18539
+ "error": chunk.status == $setup.Status.error
18547
18540
  }]),
18548
18541
  style: vue.normalizeStyle({
18549
18542
  width: 100 / chunk.chunksLength + "%"
@@ -18576,57 +18569,57 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18576
18569
  ])) : vue.createCommentVNode("v-if", true)
18577
18570
  ], 8, _hoisted_2),
18578
18571
  vue.createElementVNode("input", {
18579
- id: _ctx.uuid,
18572
+ id: $setup.uuid,
18580
18573
  type: "file",
18581
18574
  class: "vkf-upload-plus-input",
18582
18575
  accept: _ctx.accept,
18583
- onChange: _cache[0] || (_cache[0] = (...args) => _ctx.handleFileChange && _ctx.handleFileChange(...args))
18576
+ onChange: $setup.handleFileChange
18584
18577
  }, null, 40, _hoisted_5),
18585
- vue.createVNode(_component_el_button_group, { class: "vkf-upload-plus-btng" }, {
18578
+ vue.createVNode($setup["ElButtonGroup"], { class: "vkf-upload-plus-btng" }, {
18586
18579
  default: vue.withCtx(() => [
18587
- _ctx.merging ? vue.withDirectives((vue.openBlock(), vue.createBlock(_component_ElButton, {
18580
+ $setup.merging ? vue.withDirectives((vue.openBlock(), vue.createBlock($setup["ElButton"], {
18588
18581
  key: 0,
18589
18582
  type: "success"
18590
18583
  }, {
18591
- default: vue.withCtx(() => _cache[2] || (_cache[2] = [
18584
+ default: vue.withCtx(() => _cache[1] || (_cache[1] = [
18592
18585
  vue.createTextVNode(" \u5408\u5E76 ")
18593
18586
  ])),
18594
- _: 1
18595
- /* STABLE */
18587
+ _: 1,
18588
+ __: [1]
18596
18589
  })), [
18597
- [_directive_loading, _ctx.merging]
18598
- ]) : _ctx.fileStatus === _ctx.Status.uploading ? (vue.openBlock(), vue.createBlock(_component_ElButton, {
18590
+ [$setup["vLoading"], $setup.merging]
18591
+ ]) : $setup.fileStatus === $setup.Status.uploading ? (vue.openBlock(), vue.createBlock($setup["ElButton"], {
18599
18592
  key: 1,
18600
18593
  type: "danger",
18601
- onClick: _ctx.handlePause
18594
+ onClick: $setup.handlePause
18602
18595
  }, {
18603
- default: vue.withCtx(() => _cache[3] || (_cache[3] = [
18596
+ default: vue.withCtx(() => _cache[2] || (_cache[2] = [
18604
18597
  vue.createTextVNode(" \u6682\u505C ")
18605
18598
  ])),
18606
- _: 1
18607
- /* STABLE */
18608
- }, 8, ["onClick"])) : _ctx.fileStatus === _ctx.Status.done ? (vue.openBlock(), vue.createBlock(_component_ElButton, {
18599
+ _: 1,
18600
+ __: [2]
18601
+ })) : $setup.fileStatus === $setup.Status.done ? (vue.openBlock(), vue.createBlock($setup["ElButton"], {
18609
18602
  key: 2,
18610
18603
  type: "success",
18611
18604
  disabled: ""
18612
18605
  }, {
18613
- default: vue.withCtx(() => _cache[4] || (_cache[4] = [
18606
+ default: vue.withCtx(() => _cache[3] || (_cache[3] = [
18614
18607
  vue.createTextVNode(" \u5DF2\u4F20 ")
18615
18608
  ])),
18616
- _: 1
18617
- /* STABLE */
18618
- })) : (vue.openBlock(), vue.createBlock(_component_el_button, {
18609
+ _: 1,
18610
+ __: [3]
18611
+ })) : (vue.openBlock(), vue.createBlock($setup["ElButton"], {
18619
18612
  key: 3,
18620
18613
  type: "primary",
18621
- disabled: !_ctx.containerFile,
18622
- onClick: _ctx.handleUpload
18614
+ disabled: !$setup.containerFile,
18615
+ onClick: $setup.handleUpload
18623
18616
  }, {
18624
- default: vue.withCtx(() => _cache[5] || (_cache[5] = [
18617
+ default: vue.withCtx(() => _cache[4] || (_cache[4] = [
18625
18618
  vue.createTextVNode(" \u4E0A\u4F20 ")
18626
18619
  ])),
18627
- _: 1
18628
- /* STABLE */
18629
- }, 8, ["disabled", "onClick"]))
18620
+ _: 1,
18621
+ __: [4]
18622
+ }, 8, ["disabled"]))
18630
18623
  ]),
18631
18624
  _: 1
18632
18625
  /* STABLE */
@@ -0,0 +1,6 @@
1
+ import VkfUploadPlus from './src/index.vue';
2
+ export * as __VkfUploadPlus from './src/types';
3
+ export * as _VkfUploadPlusConst from './src/const';
4
+ export * as _VkfUploadPlusApi from './src/api';
5
+ export { VkfUploadPlus, };
6
+ export default VkfUploadPlus;
@@ -1,5 +1,5 @@
1
+ import { defineComponent, watchEffect, watch, ref, computed, onBeforeUnmount, openBlock, createBlock, mergeProps, withCtx, createElementVNode, createVNode, normalizeClass, createElementBlock, createCommentVNode, Fragment, renderList, normalizeStyle, withDirectives, createTextVNode } from 'vue';
1
2
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
- import { defineComponent, watchEffect, watch, ref, computed, onBeforeUnmount, resolveComponent, resolveDirective, openBlock, createBlock, mergeProps, withCtx, createElementVNode, createVNode, normalizeClass, createElementBlock, createCommentVNode, Fragment, renderList, normalizeStyle, withDirectives, createTextVNode } from 'vue';
3
3
  import { ElMessage, ElInput, ElButtonGroup, ElButton, ElIcon, vLoading } from 'element-plus';
4
4
  import { createFileChunk, calculateFileHashSample } from '@vunk/form/shared/upload';
5
5
  import { RestFetch } from '@vunk/core/shared/utils-fetch';
@@ -9,7 +9,7 @@ import { g as getToken } from '../index.mjs';
9
9
  import { restFetch as restFetch$1 } from '@skzz/platform/shared/fetch/platform';
10
10
  import { l as success_filled_default, c as circle_close_filled_default, n as upload_filled_default } from '../index2.mjs';
11
11
  import { useModelComputed } from '@vunk/core/composables';
12
- import { ToggleHandler } from '@vunk/core/shared/utils-class';
12
+ import { ToggleHandler } from '@vunk/shared/class';
13
13
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
14
14
 
15
15
  const props = {
@@ -18223,34 +18223,31 @@ var api = /*#__PURE__*/Object.freeze({
18223
18223
  verify: verify
18224
18224
  });
18225
18225
 
18226
- var _sfc_main = defineComponent({
18227
- name: "VkfUploadPlus",
18228
- components: {
18229
- VkfFormItem,
18230
- ElInput,
18231
- ElButtonGroup,
18232
- ElButton,
18233
- ElIcon,
18234
- SuccessFilled: success_filled_default
18226
+ var _sfc_main = /* @__PURE__ */ defineComponent({
18227
+ ...{
18228
+ name: "VkfUploadPlus"
18235
18229
  },
18236
- directives: {
18237
- loading: vLoading
18238
- },
18239
- props,
18230
+ __name: "index",
18231
+ props: props,
18240
18232
  emits,
18241
- setup(props2, { emit }) {
18242
- const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
18233
+ setup(__props, { expose: __expose, emit: __emit }) {
18234
+ __expose();
18235
+ const vLoading$1 = vLoading;
18236
+ const ToggleHandler$1 = ToggleHandler;
18237
+ const props = __props;
18238
+ const emit = __emit;
18239
+ const formItemBindProps = _VkfFormItemCtx.createBindProps(props);
18243
18240
  const uuid = Math.random().toString(36).slice(-8);
18244
18241
  const containerFile = useModelComputed({
18245
18242
  default: null,
18246
18243
  key: "file"
18247
- }, props2, emit);
18244
+ }, props, emit);
18248
18245
  const fileStatus = useModelComputed({
18249
18246
  default: Status.wait,
18250
18247
  key: "fileStatus"
18251
- }, props2, emit);
18248
+ }, props, emit);
18252
18249
  watchEffect(() => {
18253
- restFetch.baseURL = props2.url || restFetch$1.baseURL;
18250
+ restFetch.baseURL = props.url || restFetch$1.baseURL;
18254
18251
  });
18255
18252
  watch(() => fileStatus.value, (v, ov) => {
18256
18253
  if (v === Status.doUpload) {
@@ -18288,7 +18285,7 @@ var _sfc_main = defineComponent({
18288
18285
  const handleUpload = async () => {
18289
18286
  if (!containerFile.value) return;
18290
18287
  fileStatus.value = Status.uploading;
18291
- const chunkFiles = createFileChunk(containerFile.value, props2.chunkSize);
18288
+ const chunkFiles = createFileChunk(containerFile.value, props.chunkSize);
18292
18289
  const hash = await calculateFileHashSample(containerFile.value);
18293
18290
  containerHash.value = hash;
18294
18291
  let uploadedList = [];
@@ -18369,7 +18366,7 @@ var _sfc_main = defineComponent({
18369
18366
  const currentChunk = urls[i];
18370
18367
  if (currentChunk) {
18371
18368
  currentChunk.status = Status.uploading;
18372
- upload(currentChunk, props2.fileServiceType, {
18369
+ upload(currentChunk, props.fileServiceType, {
18373
18370
  onprogress(ev) {
18374
18371
  chunks.value[currentChunk.index].progress = parseInt(ev.loaded / ev.total * 100 + "");
18375
18372
  },
@@ -18418,8 +18415,8 @@ var _sfc_main = defineComponent({
18418
18415
  return merge({
18419
18416
  filename: containerFile.value.name,
18420
18417
  identifier: containerHash.value,
18421
- fileServiceType: props2.fileServiceType,
18422
- dictId: props2.dictId,
18418
+ fileServiceType: props.fileServiceType,
18419
+ dictId: props.dictId,
18423
18420
  totalChunk: chunks.value.length
18424
18421
  }).then((res) => {
18425
18422
  emit("success", res);
@@ -18437,7 +18434,7 @@ var _sfc_main = defineComponent({
18437
18434
  onBeforeUnmount(() => {
18438
18435
  handlePause();
18439
18436
  });
18440
- class OnlineToggle extends ToggleHandler {
18437
+ class OnlineToggle extends ToggleHandler$1 {
18441
18438
  constructor(listener) {
18442
18439
  super();
18443
18440
  this.listener = listener;
@@ -18458,19 +18455,23 @@ var _sfc_main = defineComponent({
18458
18455
  onBeforeUnmount(() => {
18459
18456
  offlineToggle.remove();
18460
18457
  });
18461
- return {
18462
- formItemBindProps,
18463
- handleFileChange,
18464
- uuid,
18465
- containerFile,
18466
- handleUpload,
18467
- fileStatus,
18468
- chunks,
18469
- Status,
18470
- filePrefixIcon,
18471
- handlePause,
18472
- merging
18473
- };
18458
+ const __returned__ = { vLoading: vLoading$1, ToggleHandler: ToggleHandler$1, props, emit, formItemBindProps, uuid, containerFile, fileStatus, containerHash, chunks, uploadingXhrs, filePrefixIcon, handleFileChange, handleUpload, handlePause, cUploadedChunks, merging, cFile, OnlineToggle, offlineToggle, get VkfFormItem() {
18459
+ return VkfFormItem;
18460
+ }, get ElInput() {
18461
+ return ElInput;
18462
+ }, get ElButtonGroup() {
18463
+ return ElButtonGroup;
18464
+ }, get ElButton() {
18465
+ return ElButton;
18466
+ }, get ElIcon() {
18467
+ return ElIcon;
18468
+ }, get Status() {
18469
+ return Status;
18470
+ }, get SuccessFilled() {
18471
+ return success_filled_default;
18472
+ } };
18473
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
18474
+ return __returned__;
18474
18475
  }
18475
18476
  });
18476
18477
 
@@ -18486,60 +18487,52 @@ const _hoisted_4 = {
18486
18487
  };
18487
18488
  const _hoisted_5 = ["id", "accept"];
18488
18489
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18489
- const _component_ElInput = resolveComponent("ElInput");
18490
- const _component_SuccessFilled = resolveComponent("SuccessFilled");
18491
- const _component_ElIcon = resolveComponent("ElIcon");
18492
- const _component_ElButton = resolveComponent("ElButton");
18493
- const _component_el_button = resolveComponent("el-button");
18494
- const _component_el_button_group = resolveComponent("el-button-group");
18495
- const _component_VkfFormItem = resolveComponent("VkfFormItem");
18496
- const _directive_loading = resolveDirective("loading");
18497
18490
  return openBlock(), createBlock(
18498
- _component_VkfFormItem,
18499
- mergeProps(_ctx.formItemBindProps, { class: "vkf-upload-plus" }),
18491
+ $setup["VkfFormItem"],
18492
+ mergeProps($setup.formItemBindProps, { class: "vkf-upload-plus" }),
18500
18493
  {
18501
18494
  default: withCtx(() => [
18502
18495
  createElementVNode("div", _hoisted_1, [
18503
18496
  createElementVNode("label", {
18504
- for: _ctx.uuid,
18497
+ for: $setup.uuid,
18505
18498
  class: "vkf-upload-plus-label"
18506
18499
  }, [
18507
- createVNode(_component_ElInput, {
18500
+ createVNode($setup["ElInput"], {
18508
18501
  class: normalizeClass({
18509
- "is-success": _ctx.fileStatus === _ctx.Status.done,
18510
- "is-error": _ctx.fileStatus === _ctx.Status.error
18502
+ "is-success": $setup.fileStatus === $setup.Status.done,
18503
+ "is-error": $setup.fileStatus === $setup.Status.error
18511
18504
  }),
18512
- "model-value": _ctx.containerFile?.name,
18513
- "prefix-icon": _ctx.filePrefixIcon,
18505
+ "model-value": $setup.containerFile?.name,
18506
+ "prefix-icon": $setup.filePrefixIcon,
18514
18507
  placeholder: "\u8BF7\u9009\u62E9\u6587\u4EF6"
18515
18508
  }, null, 8, ["class", "model-value", "prefix-icon"]),
18516
- _ctx.fileStatus === _ctx.Status.done ? (openBlock(), createElementBlock("div", _hoisted_3, [
18517
- createVNode(_component_ElIcon, null, {
18509
+ $setup.fileStatus === $setup.Status.done ? (openBlock(), createElementBlock("div", _hoisted_3, [
18510
+ createVNode($setup["ElIcon"], null, {
18518
18511
  default: withCtx(() => [
18519
- createVNode(_component_SuccessFilled)
18512
+ createVNode($setup["SuccessFilled"])
18520
18513
  ]),
18521
18514
  _: 1
18522
18515
  /* STABLE */
18523
18516
  }),
18524
- _cache[1] || (_cache[1] = createElementVNode(
18517
+ _cache[0] || (_cache[0] = createElementVNode(
18525
18518
  "span",
18526
18519
  { class: "vkf-upload-plus-msg" },
18527
18520
  " \u4E0A\u4F20\u6210\u529F ",
18528
18521
  -1
18529
- /* HOISTED */
18522
+ /* CACHED */
18530
18523
  ))
18531
18524
  ])) : createCommentVNode("v-if", true),
18532
- _ctx.fileStatus === _ctx.Status.uploading || _ctx.fileStatus === _ctx.Status.pause ? (openBlock(), createElementBlock("div", _hoisted_4, [
18525
+ $setup.fileStatus === $setup.Status.uploading || $setup.fileStatus === $setup.Status.pause ? (openBlock(), createElementBlock("div", _hoisted_4, [
18533
18526
  (openBlock(true), createElementBlock(
18534
18527
  Fragment,
18535
18528
  null,
18536
- renderList(_ctx.chunks, (chunk) => {
18529
+ renderList($setup.chunks, (chunk) => {
18537
18530
  return openBlock(), createElementBlock(
18538
18531
  "div",
18539
18532
  {
18540
18533
  key: chunk.hash,
18541
18534
  class: normalizeClass(["vkf-upload-plus-cube", {
18542
- "error": chunk.status == _ctx.Status.error
18535
+ "error": chunk.status == $setup.Status.error
18543
18536
  }]),
18544
18537
  style: normalizeStyle({
18545
18538
  width: 100 / chunk.chunksLength + "%"
@@ -18572,57 +18565,57 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18572
18565
  ])) : createCommentVNode("v-if", true)
18573
18566
  ], 8, _hoisted_2),
18574
18567
  createElementVNode("input", {
18575
- id: _ctx.uuid,
18568
+ id: $setup.uuid,
18576
18569
  type: "file",
18577
18570
  class: "vkf-upload-plus-input",
18578
18571
  accept: _ctx.accept,
18579
- onChange: _cache[0] || (_cache[0] = (...args) => _ctx.handleFileChange && _ctx.handleFileChange(...args))
18572
+ onChange: $setup.handleFileChange
18580
18573
  }, null, 40, _hoisted_5),
18581
- createVNode(_component_el_button_group, { class: "vkf-upload-plus-btng" }, {
18574
+ createVNode($setup["ElButtonGroup"], { class: "vkf-upload-plus-btng" }, {
18582
18575
  default: withCtx(() => [
18583
- _ctx.merging ? withDirectives((openBlock(), createBlock(_component_ElButton, {
18576
+ $setup.merging ? withDirectives((openBlock(), createBlock($setup["ElButton"], {
18584
18577
  key: 0,
18585
18578
  type: "success"
18586
18579
  }, {
18587
- default: withCtx(() => _cache[2] || (_cache[2] = [
18580
+ default: withCtx(() => _cache[1] || (_cache[1] = [
18588
18581
  createTextVNode(" \u5408\u5E76 ")
18589
18582
  ])),
18590
- _: 1
18591
- /* STABLE */
18583
+ _: 1,
18584
+ __: [1]
18592
18585
  })), [
18593
- [_directive_loading, _ctx.merging]
18594
- ]) : _ctx.fileStatus === _ctx.Status.uploading ? (openBlock(), createBlock(_component_ElButton, {
18586
+ [$setup["vLoading"], $setup.merging]
18587
+ ]) : $setup.fileStatus === $setup.Status.uploading ? (openBlock(), createBlock($setup["ElButton"], {
18595
18588
  key: 1,
18596
18589
  type: "danger",
18597
- onClick: _ctx.handlePause
18590
+ onClick: $setup.handlePause
18598
18591
  }, {
18599
- default: withCtx(() => _cache[3] || (_cache[3] = [
18592
+ default: withCtx(() => _cache[2] || (_cache[2] = [
18600
18593
  createTextVNode(" \u6682\u505C ")
18601
18594
  ])),
18602
- _: 1
18603
- /* STABLE */
18604
- }, 8, ["onClick"])) : _ctx.fileStatus === _ctx.Status.done ? (openBlock(), createBlock(_component_ElButton, {
18595
+ _: 1,
18596
+ __: [2]
18597
+ })) : $setup.fileStatus === $setup.Status.done ? (openBlock(), createBlock($setup["ElButton"], {
18605
18598
  key: 2,
18606
18599
  type: "success",
18607
18600
  disabled: ""
18608
18601
  }, {
18609
- default: withCtx(() => _cache[4] || (_cache[4] = [
18602
+ default: withCtx(() => _cache[3] || (_cache[3] = [
18610
18603
  createTextVNode(" \u5DF2\u4F20 ")
18611
18604
  ])),
18612
- _: 1
18613
- /* STABLE */
18614
- })) : (openBlock(), createBlock(_component_el_button, {
18605
+ _: 1,
18606
+ __: [3]
18607
+ })) : (openBlock(), createBlock($setup["ElButton"], {
18615
18608
  key: 3,
18616
18609
  type: "primary",
18617
- disabled: !_ctx.containerFile,
18618
- onClick: _ctx.handleUpload
18610
+ disabled: !$setup.containerFile,
18611
+ onClick: $setup.handleUpload
18619
18612
  }, {
18620
- default: withCtx(() => _cache[5] || (_cache[5] = [
18613
+ default: withCtx(() => _cache[4] || (_cache[4] = [
18621
18614
  createTextVNode(" \u4E0A\u4F20 ")
18622
18615
  ])),
18623
- _: 1
18624
- /* STABLE */
18625
- }, 8, ["disabled", "onClick"]))
18616
+ _: 1,
18617
+ __: [4]
18618
+ }, 8, ["disabled"]))
18626
18619
  ]),
18627
18620
  _: 1
18628
18621
  /* STABLE */