vxe-pc-ui 4.5.23 → 4.5.25

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 (44) hide show
  1. package/es/icon/style.css +1 -1
  2. package/es/select/src/select.js +8 -3
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/tree/src/tree.js +11 -1
  6. package/es/ui/index.js +5 -3
  7. package/es/ui/src/log.js +1 -1
  8. package/es/upload/src/upload.js +45 -19
  9. package/lib/icon/style/style.css +1 -1
  10. package/lib/icon/style/style.min.css +1 -1
  11. package/lib/index.umd.js +82 -27
  12. package/lib/index.umd.min.js +1 -1
  13. package/lib/select/src/select.js +8 -3
  14. package/lib/select/src/select.min.js +1 -1
  15. package/lib/style.css +1 -1
  16. package/lib/style.min.css +1 -1
  17. package/lib/tree/src/tree.js +14 -1
  18. package/lib/tree/src/tree.min.js +1 -1
  19. package/lib/ui/index.js +5 -3
  20. package/lib/ui/index.min.js +1 -1
  21. package/lib/ui/src/log.js +1 -1
  22. package/lib/ui/src/log.min.js +1 -1
  23. package/lib/upload/src/upload.js +54 -19
  24. package/lib/upload/src/upload.min.js +1 -1
  25. package/package.json +1 -1
  26. package/packages/select/src/select.ts +8 -3
  27. package/packages/tree/src/tree.ts +11 -1
  28. package/packages/ui/index.ts +4 -2
  29. package/packages/upload/src/upload.ts +44 -19
  30. package/types/components/grid.d.ts +5 -5
  31. package/types/components/tree.d.ts +1 -0
  32. package/types/components/upload.d.ts +16 -4
  33. /package/es/icon/{iconfont.1744712843204.ttf → iconfont.1744861679657.ttf} +0 -0
  34. /package/es/icon/{iconfont.1744712843204.woff → iconfont.1744861679657.woff} +0 -0
  35. /package/es/icon/{iconfont.1744712843204.woff2 → iconfont.1744861679657.woff2} +0 -0
  36. /package/es/{iconfont.1744712843204.ttf → iconfont.1744861679657.ttf} +0 -0
  37. /package/es/{iconfont.1744712843204.woff → iconfont.1744861679657.woff} +0 -0
  38. /package/es/{iconfont.1744712843204.woff2 → iconfont.1744861679657.woff2} +0 -0
  39. /package/lib/icon/style/{iconfont.1744712843204.ttf → iconfont.1744861679657.ttf} +0 -0
  40. /package/lib/icon/style/{iconfont.1744712843204.woff → iconfont.1744861679657.woff} +0 -0
  41. /package/lib/icon/style/{iconfont.1744712843204.woff2 → iconfont.1744861679657.woff2} +0 -0
  42. /package/lib/{iconfont.1744712843204.ttf → iconfont.1744861679657.ttf} +0 -0
  43. /package/lib/{iconfont.1744712843204.woff → iconfont.1744861679657.woff} +0 -0
  44. /package/lib/{iconfont.1744712843204.woff2 → iconfont.1744861679657.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -4186,14 +4186,14 @@ function checkDynamic() {
4186
4186
  }
4187
4187
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
4188
4188
 
4189
- const log_version = `ui v${"4.5.23"}`;
4189
+ const log_version = `ui v${"4.5.25"}`;
4190
4190
  const warnLog = log.create('warn', log_version);
4191
4191
  const errLog = log.create('error', log_version);
4192
4192
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
4193
4193
 
4194
4194
 
4195
4195
 
4196
- const ui_version = "4.5.23";
4196
+ const ui_version = "4.5.25";
4197
4197
  index_esm_VxeUI.uiVersion = ui_version;
4198
4198
  index_esm_VxeUI.dynamicApp = dynamicApp;
4199
4199
  function config(options) {
@@ -4534,8 +4534,10 @@ setConfig({
4534
4534
  showRemoveButton: true,
4535
4535
  showButtonIcon: true,
4536
4536
  showPreview: true,
4537
- dragToUpload: true
4538
- // imageConfig: {}
4537
+ dragToUpload: true,
4538
+ // imageConfig: {},
4539
+ showLimitSize: true,
4540
+ showLimitCount: true
4539
4541
  },
4540
4542
  watermark: {
4541
4543
  rotate: -30,
@@ -24776,6 +24778,9 @@ function getOptUniqueId() {
24776
24778
  const valueField = computeValueField.value;
24777
24779
  const selectValue = option[valueField];
24778
24780
  const remoteItem = remoteValMaps[selectValue];
24781
+ if (!reactData.visiblePanel) {
24782
+ return;
24783
+ }
24779
24784
  if (remoteItem) {
24780
24785
  remoteItem.item = option;
24781
24786
  } else {
@@ -24929,9 +24934,11 @@ function getOptUniqueId() {
24929
24934
  if (isEsc || isTab) {
24930
24935
  hideOptionPanel();
24931
24936
  } else if (isEnter) {
24932
- evnt.preventDefault();
24933
- evnt.stopPropagation();
24934
- changeOptionEvent(evnt, currentOption);
24937
+ if (currentOption) {
24938
+ evnt.preventDefault();
24939
+ evnt.stopPropagation();
24940
+ changeOptionEvent(evnt, currentOption);
24941
+ }
24935
24942
  } else if (isUpArrow || isDwArrow) {
24936
24943
  evnt.preventDefault();
24937
24944
  let offsetOption = findOffsetOption(currentOption, isDwArrow);
@@ -32280,7 +32287,20 @@ function getNodeUniqueId() {
32280
32287
  isCheckedByRadioNode,
32281
32288
  isCheckedByCheckboxNodeId,
32282
32289
  isIndeterminateByCheckboxNode,
32283
- isCheckedByCheckboxNode
32290
+ isCheckedByCheckboxNode,
32291
+ getCheckboxIndeterminateNodes() {
32292
+ const {
32293
+ treeList,
32294
+ indeterminateCheckboxMaps
32295
+ } = reactData;
32296
+ const indeterminateNodes = [];
32297
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(treeList, node => {
32298
+ if (indeterminateCheckboxMaps[getNodeId(node)]) {
32299
+ indeterminateNodes.push(node);
32300
+ }
32301
+ });
32302
+ return indeterminateNodes;
32303
+ }
32284
32304
  };
32285
32305
  const cacheNodeMap = () => {
32286
32306
  const {
@@ -34438,10 +34458,26 @@ const saveLocalFile = options => {
34438
34458
  type: [String, Number],
34439
34459
  default: () => getConfig().upload.limitSize
34440
34460
  },
34461
+ showLimitSize: {
34462
+ type: Boolean,
34463
+ default: () => getConfig().upload.showLimitSize
34464
+ },
34465
+ limitSizeText: {
34466
+ type: [String, Number, Function],
34467
+ default: () => getConfig().upload.limitSizeText
34468
+ },
34441
34469
  limitCount: {
34442
34470
  type: [String, Number],
34443
34471
  default: () => getConfig().upload.limitCount
34444
34472
  },
34473
+ showLimitCount: {
34474
+ type: Boolean,
34475
+ default: () => getConfig().upload.showLimitCount
34476
+ },
34477
+ limitCountText: {
34478
+ type: [String, Number, Function],
34479
+ default: () => getConfig().upload.limitCountText
34480
+ },
34445
34481
  nameField: {
34446
34482
  type: String,
34447
34483
  default: () => getConfig().upload.nameField
@@ -34467,7 +34503,7 @@ const saveLocalFile = options => {
34467
34503
  default: () => getConfig().upload.showProgress
34468
34504
  },
34469
34505
  progressText: {
34470
- type: String,
34506
+ type: [String, Number, Function],
34471
34507
  default: () => getConfig().upload.progressText
34472
34508
  },
34473
34509
  autoHiddenButton: {
@@ -34479,7 +34515,7 @@ const saveLocalFile = options => {
34479
34515
  default: () => getConfig().upload.showUploadButton
34480
34516
  },
34481
34517
  buttonText: {
34482
- type: String,
34518
+ type: [String, Number, Function],
34483
34519
  default: () => getConfig().upload.buttonText
34484
34520
  },
34485
34521
  buttonIcon: {
@@ -34510,7 +34546,7 @@ const saveLocalFile = options => {
34510
34546
  type: Boolean,
34511
34547
  default: () => null
34512
34548
  },
34513
- tipText: String,
34549
+ tipText: [String, Number, Function],
34514
34550
  hintText: String,
34515
34551
  previewMethod: Function,
34516
34552
  uploadMethod: Function,
@@ -34602,7 +34638,7 @@ const saveLocalFile = options => {
34602
34638
  const computeSizeProp = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
34603
34639
  return props.sizeField || 'size';
34604
34640
  });
34605
- const computeLimitMaxSizeB = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
34641
+ const computeLimitMaxSize = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
34606
34642
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(props.limitSize) * 1024 * 1024;
34607
34643
  });
34608
34644
  const computeLimitMaxCount = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
@@ -34667,6 +34703,9 @@ const saveLocalFile = options => {
34667
34703
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(tipText)) {
34668
34704
  return tipText;
34669
34705
  }
34706
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(tipText)) {
34707
+ return `${tipText({})}`;
34708
+ }
34670
34709
  const defTips = [];
34671
34710
  if (isImage) {
34672
34711
  if (multiple && limitCount) {
@@ -34979,7 +35018,11 @@ const saveLocalFile = options => {
34979
35018
  const uploadFile = (files, evnt) => {
34980
35019
  const {
34981
35020
  multiple,
34982
- urlMode
35021
+ urlMode,
35022
+ showLimitSize,
35023
+ limitSizeText,
35024
+ showLimitCount,
35025
+ limitCountText
34983
35026
  } = props;
34984
35027
  const {
34985
35028
  fileList
@@ -34990,26 +35033,36 @@ const saveLocalFile = options => {
34990
35033
  const typeProp = computeTypeProp.value;
34991
35034
  const urlProp = computeUrlProp.value;
34992
35035
  const sizeProp = computeSizeProp.value;
34993
- const limitMaxSizeB = computeLimitMaxSizeB.value;
35036
+ const limitMaxSize = computeLimitMaxSize.value;
34994
35037
  const limitMaxCount = computeLimitMaxCount.value;
34995
35038
  const limitSizeUnit = computeLimitSizeUnit.value;
34996
35039
  let selectFiles = files;
34997
35040
  if (multiple && limitMaxCount) {
34998
35041
  // 校验文件数量
34999
- if (fileList.length >= limitMaxCount) {
35042
+ if (showLimitCount && fileList.length >= limitMaxCount) {
35000
35043
  if (index_esm_VxeUI.modal) {
35001
35044
  index_esm_VxeUI.modal.notification({
35002
35045
  title: i18n_getI18n('vxe.modal.errTitle'),
35003
35046
  status: 'error',
35004
- content: i18n_getI18n('vxe.upload.overCountErr', [limitMaxCount])
35047
+ content: limitCountText ? `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(limitCountText) ? limitCountText({
35048
+ maxCount: limitMaxCount
35049
+ }) : limitCountText}` : i18n_getI18n('vxe.upload.overCountErr', [limitMaxCount])
35005
35050
  });
35006
35051
  }
35007
35052
  return;
35008
35053
  }
35009
35054
  const overNum = selectFiles.length - (limitMaxCount - fileList.length);
35010
- if (overNum > 0) {
35055
+ if (showLimitCount && overNum > 0) {
35011
35056
  const overExtraList = selectFiles.slice(limitMaxCount - fileList.length);
35012
- if (index_esm_VxeUI.modal) {
35057
+ if (limitCountText) {
35058
+ index_esm_VxeUI.modal.notification({
35059
+ title: i18n_getI18n('vxe.modal.errTitle'),
35060
+ status: 'error',
35061
+ content: `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(limitCountText) ? limitCountText({
35062
+ maxCount: limitMaxCount
35063
+ }) : limitCountText}`
35064
+ });
35065
+ } else if (index_esm_VxeUI.modal) {
35013
35066
  index_esm_VxeUI.modal.notification({
35014
35067
  title: i18n_getI18n('vxe.modal.errTitle'),
35015
35068
  status: 'error',
@@ -35034,15 +35087,17 @@ const saveLocalFile = options => {
35034
35087
  selectFiles = selectFiles.slice(0, limitMaxCount - fileList.length);
35035
35088
  }
35036
35089
  // 校验文件大小
35037
- if (limitMaxSizeB) {
35090
+ if (showLimitSize && limitMaxSize) {
35038
35091
  for (let i = 0; i < files.length; i++) {
35039
35092
  const file = files[0];
35040
- if (file.size > limitMaxSizeB) {
35093
+ if (file.size > limitMaxSize) {
35041
35094
  if (index_esm_VxeUI.modal) {
35042
35095
  index_esm_VxeUI.modal.notification({
35043
35096
  title: i18n_getI18n('vxe.modal.errTitle'),
35044
35097
  status: 'error',
35045
- content: i18n_getI18n('vxe.upload.overSizeErr', [limitSizeUnit])
35098
+ content: limitSizeText ? `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(limitSizeText) ? limitSizeText({
35099
+ maxSize: limitMaxSize
35100
+ }) : limitSizeText}` : i18n_getI18n('vxe.upload.overSizeErr', [limitSizeUnit])
35046
35101
  });
35047
35102
  }
35048
35103
  return;
@@ -35576,7 +35631,7 @@ const saveLocalFile = options => {
35576
35631
  class: getIcon().UPLOAD_LOADING
35577
35632
  })]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), showProgress && isLoading && cacheItem ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35578
35633
  class: 'vxe-upload--file-item-loading-text'
35579
- }, progressText ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFormatString(progressText, {
35634
+ }, progressText ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFormatString(`${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(progressText) ? progressText({}) : progressText}`, {
35580
35635
  percent: cacheItem.percent
35581
35636
  }) : i18n_getI18n('vxe.upload.uploadProgress', [cacheItem.percent])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), showErrorStatus && isError ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35582
35637
  class: 'vxe-upload--image-item-error'
@@ -35641,14 +35696,14 @@ const saveLocalFile = options => {
35641
35696
  $upload: $xeUpload
35642
35697
  })) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
35643
35698
  class: 'vxe-upload--file-action-button',
35644
- content: isMoreView || showButtonText ? buttonText ? `${buttonText}` : i18n_getI18n('vxe.upload.fileBtnText') : '',
35699
+ content: isMoreView || showButtonText ? buttonText ? `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(buttonText) ? buttonText({}) : buttonText}` : i18n_getI18n('vxe.upload.fileBtnText') : '',
35645
35700
  icon: showButtonIcon ? buttonIcon || getIcon().UPLOAD_FILE_ADD : '',
35646
35701
  disabled: isDisabled
35647
35702
  })]), showTipText && (defTipText || tipSlot) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35648
35703
  class: 'vxe-upload--file-action-tip'
35649
35704
  }, tipSlot ? getSlotVNs(tipSlot({
35650
35705
  $upload: $xeUpload
35651
- })) : defTipText) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]);
35706
+ })) : `${defTipText}`) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]);
35652
35707
  };
35653
35708
  const renderAllMode = () => {
35654
35709
  const {
@@ -35755,7 +35810,7 @@ const saveLocalFile = options => {
35755
35810
  class: getIcon().UPLOAD_LOADING
35756
35811
  })]), showProgress ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35757
35812
  class: 'vxe-upload--image-item-loading-text'
35758
- }, progressText ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFormatString(progressText, {
35813
+ }, progressText ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFormatString(`${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(progressText) ? progressText({}) : progressText}`, {
35759
35814
  percent: cacheItem.percent
35760
35815
  }) : i18n_getI18n('vxe.upload.uploadProgress', [cacheItem.percent])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), !isLoading ? isError && showErrorStatus ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35761
35816
  class: 'vxe-upload--image-item-error'
@@ -35830,11 +35885,11 @@ const saveLocalFile = options => {
35830
35885
  class: buttonIcon || getIcon().UPLOAD_IMAGE_ADD
35831
35886
  })]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), isMoreView || showButtonText ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35832
35887
  class: 'vxe-upload--image-action-content'
35833
- }, buttonText ? `${buttonText}` : i18n_getI18n('vxe.upload.imgBtnText')) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), showTipText && (defTipText || tipSlot) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35888
+ }, buttonText ? `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(buttonText) ? buttonText({}) : buttonText}` : i18n_getI18n('vxe.upload.imgBtnText')) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), showTipText && (defTipText || tipSlot) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35834
35889
  class: 'vxe-upload--image-action-hint'
35835
35890
  }, tipSlot ? getSlotVNs(tipSlot({
35836
35891
  $upload: $xeUpload
35837
- })) : defTipText) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])])]);
35892
+ })) : `${defTipText}`) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])])]);
35838
35893
  };
35839
35894
  const renderImageMode = () => {
35840
35895
  const {