vxe-pc-ui 4.5.22 → 4.5.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 (42) hide show
  1. package/es/icon/style.css +1 -1
  2. package/es/select/src/select.js +5 -3
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/tree-select/src/tree-select.js +1 -0
  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 +66 -26
  12. package/lib/index.umd.min.js +1 -1
  13. package/lib/select/src/select.js +5 -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-select/src/tree-select.js +1 -0
  18. package/lib/tree-select/src/tree-select.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 +5 -3
  27. package/packages/tree-select/src/tree-select.ts +1 -0
  28. package/packages/ui/index.ts +4 -2
  29. package/packages/upload/src/upload.ts +44 -19
  30. package/types/components/upload.d.ts +16 -4
  31. /package/es/icon/{iconfont.1744427590259.ttf → iconfont.1744797753491.ttf} +0 -0
  32. /package/es/icon/{iconfont.1744427590259.woff → iconfont.1744797753491.woff} +0 -0
  33. /package/es/icon/{iconfont.1744427590259.woff2 → iconfont.1744797753491.woff2} +0 -0
  34. /package/es/{iconfont.1744427590259.ttf → iconfont.1744797753491.ttf} +0 -0
  35. /package/es/{iconfont.1744427590259.woff → iconfont.1744797753491.woff} +0 -0
  36. /package/es/{iconfont.1744427590259.woff2 → iconfont.1744797753491.woff2} +0 -0
  37. /package/lib/icon/style/{iconfont.1744427590259.ttf → iconfont.1744797753491.ttf} +0 -0
  38. /package/lib/icon/style/{iconfont.1744427590259.woff → iconfont.1744797753491.woff} +0 -0
  39. /package/lib/icon/style/{iconfont.1744427590259.woff2 → iconfont.1744797753491.woff2} +0 -0
  40. /package/lib/{iconfont.1744427590259.ttf → iconfont.1744797753491.ttf} +0 -0
  41. /package/lib/{iconfont.1744427590259.woff → iconfont.1744797753491.woff} +0 -0
  42. /package/lib/{iconfont.1744427590259.woff2 → iconfont.1744797753491.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.22"}`;
4189
+ const log_version = `ui v${"4.5.24"}`;
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.22";
4196
+ const ui_version = "4.5.24";
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,
@@ -24929,9 +24931,11 @@ function getOptUniqueId() {
24929
24931
  if (isEsc || isTab) {
24930
24932
  hideOptionPanel();
24931
24933
  } else if (isEnter) {
24932
- evnt.preventDefault();
24933
- evnt.stopPropagation();
24934
- changeOptionEvent(evnt, currentOption);
24934
+ if (currentOption) {
24935
+ evnt.preventDefault();
24936
+ evnt.stopPropagation();
24937
+ changeOptionEvent(evnt, currentOption);
24938
+ }
24935
24939
  } else if (isUpArrow || isDwArrow) {
24936
24940
  evnt.preventDefault();
24937
24941
  let offsetOption = findOffsetOption(currentOption, isDwArrow);
@@ -33646,6 +33650,7 @@ function tree_select_getOptUniqueId() {
33646
33650
  parentField: treeOpts.parentField || parentField,
33647
33651
  hasChildField: treeOpts.hasChildField || hasChildField,
33648
33652
  accordion: treeOpts.accordion,
33653
+ expandAll: treeOpts.expandAll,
33649
33654
  nodeConfig: treeNodeOpts,
33650
33655
  lazy: treeOpts.lazy,
33651
33656
  loadMethod: treeOpts.loadMethod,
@@ -34437,10 +34442,26 @@ const saveLocalFile = options => {
34437
34442
  type: [String, Number],
34438
34443
  default: () => getConfig().upload.limitSize
34439
34444
  },
34445
+ showLimitSize: {
34446
+ type: Boolean,
34447
+ default: () => getConfig().upload.showLimitSize
34448
+ },
34449
+ limitSizeText: {
34450
+ type: [String, Number, Function],
34451
+ default: () => getConfig().upload.limitSizeText
34452
+ },
34440
34453
  limitCount: {
34441
34454
  type: [String, Number],
34442
34455
  default: () => getConfig().upload.limitCount
34443
34456
  },
34457
+ showLimitCount: {
34458
+ type: Boolean,
34459
+ default: () => getConfig().upload.showLimitCount
34460
+ },
34461
+ limitCountText: {
34462
+ type: [String, Number, Function],
34463
+ default: () => getConfig().upload.limitCountText
34464
+ },
34444
34465
  nameField: {
34445
34466
  type: String,
34446
34467
  default: () => getConfig().upload.nameField
@@ -34466,7 +34487,7 @@ const saveLocalFile = options => {
34466
34487
  default: () => getConfig().upload.showProgress
34467
34488
  },
34468
34489
  progressText: {
34469
- type: String,
34490
+ type: [String, Number, Function],
34470
34491
  default: () => getConfig().upload.progressText
34471
34492
  },
34472
34493
  autoHiddenButton: {
@@ -34478,7 +34499,7 @@ const saveLocalFile = options => {
34478
34499
  default: () => getConfig().upload.showUploadButton
34479
34500
  },
34480
34501
  buttonText: {
34481
- type: String,
34502
+ type: [String, Number, Function],
34482
34503
  default: () => getConfig().upload.buttonText
34483
34504
  },
34484
34505
  buttonIcon: {
@@ -34509,7 +34530,7 @@ const saveLocalFile = options => {
34509
34530
  type: Boolean,
34510
34531
  default: () => null
34511
34532
  },
34512
- tipText: String,
34533
+ tipText: [String, Number, Function],
34513
34534
  hintText: String,
34514
34535
  previewMethod: Function,
34515
34536
  uploadMethod: Function,
@@ -34601,7 +34622,7 @@ const saveLocalFile = options => {
34601
34622
  const computeSizeProp = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
34602
34623
  return props.sizeField || 'size';
34603
34624
  });
34604
- const computeLimitMaxSizeB = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
34625
+ const computeLimitMaxSize = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
34605
34626
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(props.limitSize) * 1024 * 1024;
34606
34627
  });
34607
34628
  const computeLimitMaxCount = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
@@ -34666,6 +34687,9 @@ const saveLocalFile = options => {
34666
34687
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(tipText)) {
34667
34688
  return tipText;
34668
34689
  }
34690
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(tipText)) {
34691
+ return `${tipText({})}`;
34692
+ }
34669
34693
  const defTips = [];
34670
34694
  if (isImage) {
34671
34695
  if (multiple && limitCount) {
@@ -34978,7 +35002,11 @@ const saveLocalFile = options => {
34978
35002
  const uploadFile = (files, evnt) => {
34979
35003
  const {
34980
35004
  multiple,
34981
- urlMode
35005
+ urlMode,
35006
+ showLimitSize,
35007
+ limitSizeText,
35008
+ showLimitCount,
35009
+ limitCountText
34982
35010
  } = props;
34983
35011
  const {
34984
35012
  fileList
@@ -34989,26 +35017,36 @@ const saveLocalFile = options => {
34989
35017
  const typeProp = computeTypeProp.value;
34990
35018
  const urlProp = computeUrlProp.value;
34991
35019
  const sizeProp = computeSizeProp.value;
34992
- const limitMaxSizeB = computeLimitMaxSizeB.value;
35020
+ const limitMaxSize = computeLimitMaxSize.value;
34993
35021
  const limitMaxCount = computeLimitMaxCount.value;
34994
35022
  const limitSizeUnit = computeLimitSizeUnit.value;
34995
35023
  let selectFiles = files;
34996
35024
  if (multiple && limitMaxCount) {
34997
35025
  // 校验文件数量
34998
- if (fileList.length >= limitMaxCount) {
35026
+ if (showLimitCount && fileList.length >= limitMaxCount) {
34999
35027
  if (index_esm_VxeUI.modal) {
35000
35028
  index_esm_VxeUI.modal.notification({
35001
35029
  title: i18n_getI18n('vxe.modal.errTitle'),
35002
35030
  status: 'error',
35003
- content: i18n_getI18n('vxe.upload.overCountErr', [limitMaxCount])
35031
+ content: limitCountText ? `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(limitCountText) ? limitCountText({
35032
+ maxCount: limitMaxCount
35033
+ }) : limitCountText}` : i18n_getI18n('vxe.upload.overCountErr', [limitMaxCount])
35004
35034
  });
35005
35035
  }
35006
35036
  return;
35007
35037
  }
35008
35038
  const overNum = selectFiles.length - (limitMaxCount - fileList.length);
35009
- if (overNum > 0) {
35039
+ if (showLimitCount && overNum > 0) {
35010
35040
  const overExtraList = selectFiles.slice(limitMaxCount - fileList.length);
35011
- if (index_esm_VxeUI.modal) {
35041
+ if (limitCountText) {
35042
+ index_esm_VxeUI.modal.notification({
35043
+ title: i18n_getI18n('vxe.modal.errTitle'),
35044
+ status: 'error',
35045
+ content: `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(limitCountText) ? limitCountText({
35046
+ maxCount: limitMaxCount
35047
+ }) : limitCountText}`
35048
+ });
35049
+ } else if (index_esm_VxeUI.modal) {
35012
35050
  index_esm_VxeUI.modal.notification({
35013
35051
  title: i18n_getI18n('vxe.modal.errTitle'),
35014
35052
  status: 'error',
@@ -35033,15 +35071,17 @@ const saveLocalFile = options => {
35033
35071
  selectFiles = selectFiles.slice(0, limitMaxCount - fileList.length);
35034
35072
  }
35035
35073
  // 校验文件大小
35036
- if (limitMaxSizeB) {
35074
+ if (showLimitSize && limitMaxSize) {
35037
35075
  for (let i = 0; i < files.length; i++) {
35038
35076
  const file = files[0];
35039
- if (file.size > limitMaxSizeB) {
35077
+ if (file.size > limitMaxSize) {
35040
35078
  if (index_esm_VxeUI.modal) {
35041
35079
  index_esm_VxeUI.modal.notification({
35042
35080
  title: i18n_getI18n('vxe.modal.errTitle'),
35043
35081
  status: 'error',
35044
- content: i18n_getI18n('vxe.upload.overSizeErr', [limitSizeUnit])
35082
+ content: limitSizeText ? `${external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(limitSizeText) ? limitSizeText({
35083
+ maxSize: limitMaxSize
35084
+ }) : limitSizeText}` : i18n_getI18n('vxe.upload.overSizeErr', [limitSizeUnit])
35045
35085
  });
35046
35086
  }
35047
35087
  return;
@@ -35575,7 +35615,7 @@ const saveLocalFile = options => {
35575
35615
  class: getIcon().UPLOAD_LOADING
35576
35616
  })]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), showProgress && isLoading && cacheItem ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35577
35617
  class: 'vxe-upload--file-item-loading-text'
35578
- }, progressText ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFormatString(progressText, {
35618
+ }, 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}`, {
35579
35619
  percent: cacheItem.percent
35580
35620
  }) : 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', {
35581
35621
  class: 'vxe-upload--image-item-error'
@@ -35640,14 +35680,14 @@ const saveLocalFile = options => {
35640
35680
  $upload: $xeUpload
35641
35681
  })) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
35642
35682
  class: 'vxe-upload--file-action-button',
35643
- content: isMoreView || showButtonText ? buttonText ? `${buttonText}` : i18n_getI18n('vxe.upload.fileBtnText') : '',
35683
+ 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') : '',
35644
35684
  icon: showButtonIcon ? buttonIcon || getIcon().UPLOAD_FILE_ADD : '',
35645
35685
  disabled: isDisabled
35646
35686
  })]), showTipText && (defTipText || tipSlot) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35647
35687
  class: 'vxe-upload--file-action-tip'
35648
35688
  }, tipSlot ? getSlotVNs(tipSlot({
35649
35689
  $upload: $xeUpload
35650
- })) : defTipText) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]);
35690
+ })) : `${defTipText}`) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]);
35651
35691
  };
35652
35692
  const renderAllMode = () => {
35653
35693
  const {
@@ -35754,7 +35794,7 @@ const saveLocalFile = options => {
35754
35794
  class: getIcon().UPLOAD_LOADING
35755
35795
  })]), showProgress ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35756
35796
  class: 'vxe-upload--image-item-loading-text'
35757
- }, progressText ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFormatString(progressText, {
35797
+ }, 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}`, {
35758
35798
  percent: cacheItem.percent
35759
35799
  }) : 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', {
35760
35800
  class: 'vxe-upload--image-item-error'
@@ -35829,11 +35869,11 @@ const saveLocalFile = options => {
35829
35869
  class: buttonIcon || getIcon().UPLOAD_IMAGE_ADD
35830
35870
  })]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), isMoreView || showButtonText ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
35831
35871
  class: 'vxe-upload--image-action-content'
35832
- }, 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', {
35872
+ }, 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', {
35833
35873
  class: 'vxe-upload--image-action-hint'
35834
35874
  }, tipSlot ? getSlotVNs(tipSlot({
35835
35875
  $upload: $xeUpload
35836
- })) : defTipText) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])])]);
35876
+ })) : `${defTipText}`) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])])]);
35837
35877
  };
35838
35878
  const renderImageMode = () => {
35839
35879
  const {