vxe-pc-ui 4.5.23 → 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.
- package/es/icon/style.css +1 -1
- package/es/select/src/select.js +5 -3
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +5 -3
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +45 -19
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +65 -26
- package/lib/index.umd.min.js +1 -1
- package/lib/select/src/select.js +5 -3
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +5 -3
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/upload/src/upload.js +54 -19
- package/lib/upload/src/upload.min.js +1 -1
- package/package.json +1 -1
- package/packages/select/src/select.ts +5 -3
- package/packages/ui/index.ts +4 -2
- package/packages/upload/src/upload.ts +44 -19
- package/types/components/upload.d.ts +16 -4
- /package/es/icon/{iconfont.1744712843204.ttf → iconfont.1744797753491.ttf} +0 -0
- /package/es/icon/{iconfont.1744712843204.woff → iconfont.1744797753491.woff} +0 -0
- /package/es/icon/{iconfont.1744712843204.woff2 → iconfont.1744797753491.woff2} +0 -0
- /package/es/{iconfont.1744712843204.ttf → iconfont.1744797753491.ttf} +0 -0
- /package/es/{iconfont.1744712843204.woff → iconfont.1744797753491.woff} +0 -0
- /package/es/{iconfont.1744712843204.woff2 → iconfont.1744797753491.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1744712843204.ttf → iconfont.1744797753491.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1744712843204.woff → iconfont.1744797753491.woff} +0 -0
- /package/lib/icon/style/{iconfont.1744712843204.woff2 → iconfont.1744797753491.woff2} +0 -0
- /package/lib/{iconfont.1744712843204.ttf → iconfont.1744797753491.ttf} +0 -0
- /package/lib/{iconfont.1744712843204.woff → iconfont.1744797753491.woff} +0 -0
- /package/lib/{iconfont.1744712843204.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.
|
|
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.
|
|
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
|
-
|
|
24933
|
-
|
|
24934
|
-
|
|
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);
|
|
@@ -34438,10 +34442,26 @@ const saveLocalFile = options => {
|
|
|
34438
34442
|
type: [String, Number],
|
|
34439
34443
|
default: () => getConfig().upload.limitSize
|
|
34440
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
|
+
},
|
|
34441
34453
|
limitCount: {
|
|
34442
34454
|
type: [String, Number],
|
|
34443
34455
|
default: () => getConfig().upload.limitCount
|
|
34444
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
|
+
},
|
|
34445
34465
|
nameField: {
|
|
34446
34466
|
type: String,
|
|
34447
34467
|
default: () => getConfig().upload.nameField
|
|
@@ -34467,7 +34487,7 @@ const saveLocalFile = options => {
|
|
|
34467
34487
|
default: () => getConfig().upload.showProgress
|
|
34468
34488
|
},
|
|
34469
34489
|
progressText: {
|
|
34470
|
-
type: String,
|
|
34490
|
+
type: [String, Number, Function],
|
|
34471
34491
|
default: () => getConfig().upload.progressText
|
|
34472
34492
|
},
|
|
34473
34493
|
autoHiddenButton: {
|
|
@@ -34479,7 +34499,7 @@ const saveLocalFile = options => {
|
|
|
34479
34499
|
default: () => getConfig().upload.showUploadButton
|
|
34480
34500
|
},
|
|
34481
34501
|
buttonText: {
|
|
34482
|
-
type: String,
|
|
34502
|
+
type: [String, Number, Function],
|
|
34483
34503
|
default: () => getConfig().upload.buttonText
|
|
34484
34504
|
},
|
|
34485
34505
|
buttonIcon: {
|
|
@@ -34510,7 +34530,7 @@ const saveLocalFile = options => {
|
|
|
34510
34530
|
type: Boolean,
|
|
34511
34531
|
default: () => null
|
|
34512
34532
|
},
|
|
34513
|
-
tipText: String,
|
|
34533
|
+
tipText: [String, Number, Function],
|
|
34514
34534
|
hintText: String,
|
|
34515
34535
|
previewMethod: Function,
|
|
34516
34536
|
uploadMethod: Function,
|
|
@@ -34602,7 +34622,7 @@ const saveLocalFile = options => {
|
|
|
34602
34622
|
const computeSizeProp = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
34603
34623
|
return props.sizeField || 'size';
|
|
34604
34624
|
});
|
|
34605
|
-
const
|
|
34625
|
+
const computeLimitMaxSize = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
34606
34626
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(props.limitSize) * 1024 * 1024;
|
|
34607
34627
|
});
|
|
34608
34628
|
const computeLimitMaxCount = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
@@ -34667,6 +34687,9 @@ const saveLocalFile = options => {
|
|
|
34667
34687
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(tipText)) {
|
|
34668
34688
|
return tipText;
|
|
34669
34689
|
}
|
|
34690
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(tipText)) {
|
|
34691
|
+
return `${tipText({})}`;
|
|
34692
|
+
}
|
|
34670
34693
|
const defTips = [];
|
|
34671
34694
|
if (isImage) {
|
|
34672
34695
|
if (multiple && limitCount) {
|
|
@@ -34979,7 +35002,11 @@ const saveLocalFile = options => {
|
|
|
34979
35002
|
const uploadFile = (files, evnt) => {
|
|
34980
35003
|
const {
|
|
34981
35004
|
multiple,
|
|
34982
|
-
urlMode
|
|
35005
|
+
urlMode,
|
|
35006
|
+
showLimitSize,
|
|
35007
|
+
limitSizeText,
|
|
35008
|
+
showLimitCount,
|
|
35009
|
+
limitCountText
|
|
34983
35010
|
} = props;
|
|
34984
35011
|
const {
|
|
34985
35012
|
fileList
|
|
@@ -34990,26 +35017,36 @@ const saveLocalFile = options => {
|
|
|
34990
35017
|
const typeProp = computeTypeProp.value;
|
|
34991
35018
|
const urlProp = computeUrlProp.value;
|
|
34992
35019
|
const sizeProp = computeSizeProp.value;
|
|
34993
|
-
const
|
|
35020
|
+
const limitMaxSize = computeLimitMaxSize.value;
|
|
34994
35021
|
const limitMaxCount = computeLimitMaxCount.value;
|
|
34995
35022
|
const limitSizeUnit = computeLimitSizeUnit.value;
|
|
34996
35023
|
let selectFiles = files;
|
|
34997
35024
|
if (multiple && limitMaxCount) {
|
|
34998
35025
|
// 校验文件数量
|
|
34999
|
-
if (fileList.length >= limitMaxCount) {
|
|
35026
|
+
if (showLimitCount && fileList.length >= limitMaxCount) {
|
|
35000
35027
|
if (index_esm_VxeUI.modal) {
|
|
35001
35028
|
index_esm_VxeUI.modal.notification({
|
|
35002
35029
|
title: i18n_getI18n('vxe.modal.errTitle'),
|
|
35003
35030
|
status: 'error',
|
|
35004
|
-
content:
|
|
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])
|
|
35005
35034
|
});
|
|
35006
35035
|
}
|
|
35007
35036
|
return;
|
|
35008
35037
|
}
|
|
35009
35038
|
const overNum = selectFiles.length - (limitMaxCount - fileList.length);
|
|
35010
|
-
if (overNum > 0) {
|
|
35039
|
+
if (showLimitCount && overNum > 0) {
|
|
35011
35040
|
const overExtraList = selectFiles.slice(limitMaxCount - fileList.length);
|
|
35012
|
-
if (
|
|
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) {
|
|
35013
35050
|
index_esm_VxeUI.modal.notification({
|
|
35014
35051
|
title: i18n_getI18n('vxe.modal.errTitle'),
|
|
35015
35052
|
status: 'error',
|
|
@@ -35034,15 +35071,17 @@ const saveLocalFile = options => {
|
|
|
35034
35071
|
selectFiles = selectFiles.slice(0, limitMaxCount - fileList.length);
|
|
35035
35072
|
}
|
|
35036
35073
|
// 校验文件大小
|
|
35037
|
-
if (
|
|
35074
|
+
if (showLimitSize && limitMaxSize) {
|
|
35038
35075
|
for (let i = 0; i < files.length; i++) {
|
|
35039
35076
|
const file = files[0];
|
|
35040
|
-
if (file.size >
|
|
35077
|
+
if (file.size > limitMaxSize) {
|
|
35041
35078
|
if (index_esm_VxeUI.modal) {
|
|
35042
35079
|
index_esm_VxeUI.modal.notification({
|
|
35043
35080
|
title: i18n_getI18n('vxe.modal.errTitle'),
|
|
35044
35081
|
status: 'error',
|
|
35045
|
-
content:
|
|
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])
|
|
35046
35085
|
});
|
|
35047
35086
|
}
|
|
35048
35087
|
return;
|
|
@@ -35576,7 +35615,7 @@ const saveLocalFile = options => {
|
|
|
35576
35615
|
class: getIcon().UPLOAD_LOADING
|
|
35577
35616
|
})]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), showProgress && isLoading && cacheItem ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
35578
35617
|
class: 'vxe-upload--file-item-loading-text'
|
|
35579
|
-
}, 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}`, {
|
|
35580
35619
|
percent: cacheItem.percent
|
|
35581
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', {
|
|
35582
35621
|
class: 'vxe-upload--image-item-error'
|
|
@@ -35641,14 +35680,14 @@ const saveLocalFile = options => {
|
|
|
35641
35680
|
$upload: $xeUpload
|
|
35642
35681
|
})) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
35643
35682
|
class: 'vxe-upload--file-action-button',
|
|
35644
|
-
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') : '',
|
|
35645
35684
|
icon: showButtonIcon ? buttonIcon || getIcon().UPLOAD_FILE_ADD : '',
|
|
35646
35685
|
disabled: isDisabled
|
|
35647
35686
|
})]), showTipText && (defTipText || tipSlot) ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
35648
35687
|
class: 'vxe-upload--file-action-tip'
|
|
35649
35688
|
}, tipSlot ? getSlotVNs(tipSlot({
|
|
35650
35689
|
$upload: $xeUpload
|
|
35651
|
-
})) : defTipText) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]);
|
|
35690
|
+
})) : `${defTipText}`) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]);
|
|
35652
35691
|
};
|
|
35653
35692
|
const renderAllMode = () => {
|
|
35654
35693
|
const {
|
|
@@ -35755,7 +35794,7 @@ const saveLocalFile = options => {
|
|
|
35755
35794
|
class: getIcon().UPLOAD_LOADING
|
|
35756
35795
|
})]), showProgress ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
35757
35796
|
class: 'vxe-upload--image-item-loading-text'
|
|
35758
|
-
}, 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}`, {
|
|
35759
35798
|
percent: cacheItem.percent
|
|
35760
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', {
|
|
35761
35800
|
class: 'vxe-upload--image-item-error'
|
|
@@ -35830,11 +35869,11 @@ const saveLocalFile = options => {
|
|
|
35830
35869
|
class: buttonIcon || getIcon().UPLOAD_IMAGE_ADD
|
|
35831
35870
|
})]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), isMoreView || showButtonText ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
35832
35871
|
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', {
|
|
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', {
|
|
35834
35873
|
class: 'vxe-upload--image-action-hint'
|
|
35835
35874
|
}, tipSlot ? getSlotVNs(tipSlot({
|
|
35836
35875
|
$upload: $xeUpload
|
|
35837
|
-
})) : defTipText) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])])]);
|
|
35876
|
+
})) : `${defTipText}`) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])])]);
|
|
35838
35877
|
};
|
|
35839
35878
|
const renderImageMode = () => {
|
|
35840
35879
|
const {
|