vxe-pc-ui 4.10.23 → 4.10.24

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 (33) hide show
  1. package/es/icon/style.css +1 -1
  2. package/es/style.css +1 -1
  3. package/es/style.min.css +1 -1
  4. package/es/ui/index.js +1 -1
  5. package/es/ui/src/log.js +1 -1
  6. package/es/upload/src/upload.js +250 -203
  7. package/lib/icon/style/style.css +1 -1
  8. package/lib/icon/style/style.min.css +1 -1
  9. package/lib/index.umd.js +92 -12
  10. package/lib/index.umd.min.js +1 -1
  11. package/lib/style.css +1 -1
  12. package/lib/style.min.css +1 -1
  13. package/lib/ui/index.js +1 -1
  14. package/lib/ui/index.min.js +1 -1
  15. package/lib/ui/src/log.js +1 -1
  16. package/lib/ui/src/log.min.js +1 -1
  17. package/lib/upload/src/upload.js +90 -10
  18. package/lib/upload/src/upload.min.js +1 -1
  19. package/package.json +1 -1
  20. package/packages/upload/src/upload.ts +265 -219
  21. package/types/components/upload.d.ts +54 -4
  22. /package/es/icon/{iconfont.1762996548923.ttf → iconfont.1763014441538.ttf} +0 -0
  23. /package/es/icon/{iconfont.1762996548923.woff → iconfont.1763014441538.woff} +0 -0
  24. /package/es/icon/{iconfont.1762996548923.woff2 → iconfont.1763014441538.woff2} +0 -0
  25. /package/es/{iconfont.1762996548923.ttf → iconfont.1763014441538.ttf} +0 -0
  26. /package/es/{iconfont.1762996548923.woff → iconfont.1763014441538.woff} +0 -0
  27. /package/es/{iconfont.1762996548923.woff2 → iconfont.1763014441538.woff2} +0 -0
  28. /package/lib/icon/style/{iconfont.1762996548923.ttf → iconfont.1763014441538.ttf} +0 -0
  29. /package/lib/icon/style/{iconfont.1762996548923.woff → iconfont.1763014441538.woff} +0 -0
  30. /package/lib/icon/style/{iconfont.1762996548923.woff2 → iconfont.1763014441538.woff2} +0 -0
  31. /package/lib/{iconfont.1762996548923.ttf → iconfont.1763014441538.ttf} +0 -0
  32. /package/lib/{iconfont.1762996548923.woff → iconfont.1763014441538.woff} +0 -0
  33. /package/lib/{iconfont.1762996548923.woff2 → iconfont.1763014441538.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -3596,14 +3596,14 @@ function checkDynamic() {
3596
3596
  }
3597
3597
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
3598
3598
 
3599
- const log_version = `ui v${"4.10.23"}`;
3599
+ const log_version = `ui v${"4.10.24"}`;
3600
3600
  const warnLog = log.create('warn', log_version);
3601
3601
  const errLog = log.create('error', log_version);
3602
3602
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
3603
3603
 
3604
3604
 
3605
3605
 
3606
- const ui_version = "4.10.23";
3606
+ const ui_version = "4.10.24";
3607
3607
  index_esm_VxeUI.uiVersion = ui_version;
3608
3608
  index_esm_VxeUI.dynamicApp = dynamicApp;
3609
3609
  function config(options) {
@@ -42459,7 +42459,7 @@ const saveLocalFile = options => {
42459
42459
  default: () => getConfig().upload.size || getConfig().size
42460
42460
  }
42461
42461
  },
42462
- emits: ['update:modelValue', 'add', 'remove', 'remove-fail', 'download', 'download-fail', 'upload-success', 'upload-error', 'sort-dragend'],
42462
+ emits: ['update:modelValue', 'add', 'remove', 'remove-fail', 'download', 'download-fail', 'upload-success', 'upload-error', 'sort-dragend', 'more-visible'],
42463
42463
  setup(props, context) {
42464
42464
  const {
42465
42465
  emit,
@@ -42487,6 +42487,7 @@ const saveLocalFile = options => {
42487
42487
  dragTipText: ''
42488
42488
  });
42489
42489
  const internalData = {
42490
+ moreId: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('upload'),
42490
42491
  imagePreviewTypes: ['jpg', 'jpeg', 'png', 'gif'],
42491
42492
  prevDragIndex: -1
42492
42493
  // prevDragPos: ''
@@ -43257,11 +43258,13 @@ const saveLocalFile = options => {
43257
43258
  });
43258
43259
  return files;
43259
43260
  };
43260
- const handleMoreEvent = () => {
43261
+ const handleMoreEvent = evntParams => {
43261
43262
  const formReadonly = computeFormReadonly.value;
43262
43263
  const isImage = computeIsImage.value;
43264
+ const evnt = evntParams.$event;
43263
43265
  if (index_esm_VxeUI.modal) {
43264
43266
  index_esm_VxeUI.modal.open({
43267
+ id: internalData.moreId,
43265
43268
  title: formReadonly ? getI18n('vxe.upload.morePopup.readTitle') : getI18n(`vxe.upload.morePopup.${isImage ? 'imageTitle' : 'fileTitle'}`),
43266
43269
  width: 660,
43267
43270
  height: 500,
@@ -43286,6 +43289,7 @@ const saveLocalFile = options => {
43286
43289
  fileList
43287
43290
  } = reactData;
43288
43291
  const isDisabled = computeIsDisabled.value;
43292
+ const moreContSlot = slots.moreContent || slots['more-content'];
43289
43293
  const ons = {};
43290
43294
  if (dragToUpload && dragIndex === -1) {
43291
43295
  ons.onDragover = handleUploadDragoverEvent;
@@ -43302,7 +43306,9 @@ const saveLocalFile = options => {
43302
43306
  'is--drag': isDragUploadStatus
43303
43307
  }],
43304
43308
  ...ons
43305
- }, [isImage ? dragSort ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
43309
+ }, moreContSlot ? vn_getSlotVNs(moreContSlot({
43310
+ options: fileList
43311
+ })) : [isImage ? dragSort ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
43306
43312
  name: `vxe-upload--drag-list${isDragMove ? '' : '-disabled'}`,
43307
43313
  tag: 'div',
43308
43314
  class: 'vxe-upload--image-more-list'
@@ -43331,10 +43337,22 @@ const saveLocalFile = options => {
43331
43337
  onShow() {
43332
43338
  reactData.showMorePopup = true;
43333
43339
  },
43334
- onHide() {
43340
+ onHide({
43341
+ $event
43342
+ }) {
43335
43343
  reactData.showMorePopup = false;
43344
+ if ($event) {
43345
+ dispatchEvent('more-visible', {
43346
+ visible: false
43347
+ }, $event);
43348
+ }
43336
43349
  }
43337
43350
  });
43351
+ if (evnt) {
43352
+ dispatchEvent('more-visible', {
43353
+ visible: true
43354
+ }, evnt);
43355
+ }
43338
43356
  }
43339
43357
  };
43340
43358
  const showDropTip = (evnt, dragEl, dragPos) => {
@@ -43537,6 +43555,27 @@ const saveLocalFile = options => {
43537
43555
  return Promise.all(allPendingList.splice(0, msNum).map(handleSubmit)).then(() => {
43538
43556
  // 完成
43539
43557
  });
43558
+ },
43559
+ getMoreVisible() {
43560
+ return reactData.showMorePopup;
43561
+ },
43562
+ openMore() {
43563
+ handleMoreEvent({
43564
+ $event: new Event('click')
43565
+ });
43566
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
43567
+ },
43568
+ openMoreByEvent(evnt) {
43569
+ handleMoreEvent({
43570
+ $event: evnt
43571
+ });
43572
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
43573
+ },
43574
+ closeMore() {
43575
+ if (index_esm_VxeUI.modal) {
43576
+ index_esm_VxeUI.modal.close(internalData.moreId);
43577
+ }
43578
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
43540
43579
  }
43541
43580
  };
43542
43581
  const uploadPrivateMethods = {};
@@ -43554,13 +43593,16 @@ const saveLocalFile = options => {
43554
43593
  showSubmitButton
43555
43594
  } = props;
43556
43595
  const {
43596
+ fileList,
43557
43597
  fileCacheMaps
43558
43598
  } = reactData;
43559
43599
  const isDisabled = computeIsDisabled.value;
43560
43600
  const formReadonly = computeFormReadonly.value;
43561
43601
  const nameProp = computeNameProp.value;
43562
43602
  const typeProp = computeTypeProp.value;
43603
+ const optionSlot = slots.option;
43563
43604
  const cornerSlot = slots.corner;
43605
+ const nameSlot = slots.name;
43564
43606
  const ons = {};
43565
43607
  if (dragSort && currList.length > 1) {
43566
43608
  ons.onDragstart = handleDragSortDragstartEvent;
@@ -43590,7 +43632,11 @@ const saveLocalFile = options => {
43590
43632
  fileid: fileKey,
43591
43633
  draggable: dragSort ? true : null,
43592
43634
  ...ons
43593
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43635
+ }, optionSlot ? vn_getSlotVNs(optionSlot({
43636
+ option: item,
43637
+ isMoreView,
43638
+ options: fileList
43639
+ })) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43594
43640
  class: 'vxe-upload--file-item-icon'
43595
43641
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
43596
43642
  class: getIcon()[`UPLOAD_FILE_TYPE_${`${item[typeProp]}`.toLocaleUpperCase()}`] || getIcon().UPLOAD_FILE_TYPE_DEFAULT
@@ -43602,7 +43648,11 @@ const saveLocalFile = options => {
43602
43648
  handlePreviewFileEvent(evnt, item);
43603
43649
  }
43604
43650
  }
43605
- }, fileName), isLoading ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43651
+ }, nameSlot ? vn_getSlotVNs(nameSlot({
43652
+ option: item,
43653
+ isMoreView,
43654
+ options: fileList
43655
+ })) : fileName), isLoading ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43606
43656
  class: 'vxe-upload--file-item-loading-icon'
43607
43657
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
43608
43658
  class: getIcon().UPLOAD_LOADING
@@ -43627,6 +43677,7 @@ const saveLocalFile = options => {
43627
43677
  }, vn_getSlotVNs(cornerSlot({
43628
43678
  option: item,
43629
43679
  isMoreView,
43680
+ options: fileList,
43630
43681
  readonly: formReadonly
43631
43682
  }))) : renderEmptyElement($xeUpload), showDownloadButton && !(isLoading || isPending) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43632
43683
  class: 'vxe-upload--file-item-download-btn',
@@ -43654,6 +43705,9 @@ const saveLocalFile = options => {
43654
43705
  showButtonIcon,
43655
43706
  autoHiddenButton
43656
43707
  } = props;
43708
+ const {
43709
+ fileList
43710
+ } = reactData;
43657
43711
  const isDisabled = computeIsDisabled.value;
43658
43712
  const formReadonly = computeFormReadonly.value;
43659
43713
  const showTipText = computedShowTipText.value;
@@ -43670,6 +43724,8 @@ const saveLocalFile = options => {
43670
43724
  class: 'vxe-upload--file-action-btn',
43671
43725
  onClick: clickEvent
43672
43726
  }, defaultSlot ? vn_getSlotVNs(defaultSlot({
43727
+ isMoreView,
43728
+ options: fileList,
43673
43729
  $upload: $xeUpload
43674
43730
  })) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
43675
43731
  class: 'vxe-upload--file-action-button',
@@ -43679,6 +43735,8 @@ const saveLocalFile = options => {
43679
43735
  })]), showTipText && (defTipText || tipSlot) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43680
43736
  class: 'vxe-upload--file-action-tip'
43681
43737
  }, tipSlot ? vn_getSlotVNs(tipSlot({
43738
+ isMoreView,
43739
+ options: fileList,
43682
43740
  $upload: $xeUpload
43683
43741
  })) : `${defTipText}`) : renderEmptyElement($xeUpload)]);
43684
43742
  };
@@ -43699,6 +43757,7 @@ const saveLocalFile = options => {
43699
43757
  layout
43700
43758
  } = moreOpts;
43701
43759
  const isHorizontal = layout === 'horizontal';
43760
+ const moreBtnSlot = slots.moreButton || slots['more-button'];
43702
43761
  let currList = fileList;
43703
43762
  let overMaxNum = 0;
43704
43763
  if (maxCount && fileList.length > maxCount) {
@@ -43722,7 +43781,9 @@ const saveLocalFile = options => {
43722
43781
  class: 'vxe-upload--file-list'
43723
43782
  }, renderFileItemList(currList, false)) : renderEmptyElement($xeUpload), showMoreButton && overMaxNum ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43724
43783
  class: 'vxe-upload--file-over-more'
43725
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
43784
+ }, moreBtnSlot ? vn_getSlotVNs(moreBtnSlot({
43785
+ options: fileList
43786
+ })) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
43726
43787
  mode: 'text',
43727
43788
  content: getI18n('vxe.upload.moreBtnText', [fileList.length]),
43728
43789
  status: 'primary',
@@ -43741,12 +43802,14 @@ const saveLocalFile = options => {
43741
43802
  showSubmitButton
43742
43803
  } = props;
43743
43804
  const {
43805
+ fileList,
43744
43806
  fileCacheMaps
43745
43807
  } = reactData;
43746
43808
  const isDisabled = computeIsDisabled.value;
43747
43809
  const formReadonly = computeFormReadonly.value;
43748
43810
  const imageOpts = computeImageOpts.value;
43749
43811
  const imgStyle = computeImgStyle.value;
43812
+ const optionSlot = slots.option;
43750
43813
  const cornerSlot = slots.corner;
43751
43814
  const ons = {
43752
43815
  onMousedown: handleItemMousedownEvent
@@ -43779,7 +43842,11 @@ const saveLocalFile = options => {
43779
43842
  fileid: fileKey,
43780
43843
  draggable: dragSort ? true : null,
43781
43844
  ...ons
43782
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43845
+ }, optionSlot ? vn_getSlotVNs(optionSlot({
43846
+ option: item,
43847
+ isMoreView,
43848
+ options: fileList
43849
+ })) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43783
43850
  class: 'vxe-upload--image-item-box',
43784
43851
  style: isMoreView ? null : imgStyle,
43785
43852
  onClick(evnt) {
@@ -43823,6 +43890,7 @@ const saveLocalFile = options => {
43823
43890
  }, vn_getSlotVNs(cornerSlot({
43824
43891
  option: item,
43825
43892
  isMoreView,
43893
+ options: fileList,
43826
43894
  readonly: formReadonly
43827
43895
  }))) : renderEmptyElement($xeUpload), showRemoveButton && !formReadonly && !isDisabled && !isLoading ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43828
43896
  class: 'vxe-upload--image-item-remove-btn',
@@ -43844,6 +43912,9 @@ const saveLocalFile = options => {
43844
43912
  showButtonIcon,
43845
43913
  autoHiddenButton
43846
43914
  } = props;
43915
+ const {
43916
+ fileList
43917
+ } = reactData;
43847
43918
  const formReadonly = computeFormReadonly.value;
43848
43919
  const showTipText = computedShowTipText.value;
43849
43920
  const defTipText = computedDefTipText.value;
@@ -43861,6 +43932,8 @@ const saveLocalFile = options => {
43861
43932
  class: 'vxe-upload--image-action-btn',
43862
43933
  onClick: clickEvent
43863
43934
  }, defaultSlot ? defaultSlot({
43935
+ isMoreView,
43936
+ options: fileList,
43864
43937
  $upload: $xeUpload
43865
43938
  }) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43866
43939
  class: 'vxe-upload--image-action-box',
@@ -43874,6 +43947,8 @@ const saveLocalFile = options => {
43874
43947
  }, buttonText ? `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(buttonText) ? buttonText({}) : buttonText}` : getI18n('vxe.upload.imgBtnText')) : renderEmptyElement($xeUpload), showTipText && (defTipText || tipSlot) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43875
43948
  class: 'vxe-upload--image-action-hint'
43876
43949
  }, tipSlot ? vn_getSlotVNs(tipSlot({
43950
+ isMoreView,
43951
+ options: fileList,
43877
43952
  $upload: $xeUpload
43878
43953
  })) : `${defTipText}`) : renderEmptyElement($xeUpload)])])]);
43879
43954
  };
@@ -43887,6 +43962,7 @@ const saveLocalFile = options => {
43887
43962
  isDragMove
43888
43963
  } = reactData;
43889
43964
  const moreOpts = computeMoreOpts.value;
43965
+ const moreBtnSlot = slots.moreButton || slots['more-button'];
43890
43966
  const {
43891
43967
  maxCount,
43892
43968
  showMoreButton
@@ -43908,7 +43984,9 @@ const saveLocalFile = options => {
43908
43984
  default: () => renderImageItemList(currList, false).concat([showMoreButton && overMaxNum ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43909
43985
  key: 'om',
43910
43986
  class: 'vxe-upload--image-over-more'
43911
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
43987
+ }, moreBtnSlot ? vn_getSlotVNs(moreBtnSlot({
43988
+ options: fileList
43989
+ })) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
43912
43990
  mode: 'text',
43913
43991
  content: getI18n('vxe.upload.moreBtnText', [fileList.length]),
43914
43992
  status: 'primary',
@@ -43918,7 +43996,9 @@ const saveLocalFile = options => {
43918
43996
  class: 'vxe-upload--image-list'
43919
43997
  }, renderImageItemList(currList, false).concat([showMoreButton && overMaxNum ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
43920
43998
  class: 'vxe-upload--image-over-more'
43921
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
43999
+ }, moreBtnSlot ? vn_getSlotVNs(moreBtnSlot({
44000
+ options: fileList
44001
+ })) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
43922
44002
  mode: 'text',
43923
44003
  content: getI18n('vxe.upload.moreBtnText', [fileList.length]),
43924
44004
  status: 'primary',