vant 4.9.2 → 4.9.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.
- package/es/calendar/CalendarHeader.mjs +5 -17
- package/es/calendar/utils.mjs +6 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/lang/kk-KZ.d.ts +63 -0
- package/es/locale/lang/kk-KZ.mjs +81 -0
- package/es/swipe-cell/SwipeCell.mjs +7 -3
- package/es/text-ellipsis/TextEllipsis.mjs +56 -46
- package/es/uploader/Uploader.mjs +6 -8
- package/es/uploader/types.d.ts +1 -0
- package/lib/calendar/CalendarHeader.js +4 -16
- package/lib/calendar/utils.js +6 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/lang/kk-KZ.d.ts +63 -0
- package/lib/locale/lang/kk-KZ.js +100 -0
- package/lib/swipe-cell/SwipeCell.js +7 -3
- package/lib/text-ellipsis/TextEllipsis.js +55 -45
- package/lib/uploader/Uploader.js +6 -8
- package/lib/uploader/types.d.ts +1 -0
- package/lib/vant.cjs.js +79 -73
- package/lib/vant.es.js +79 -73
- package/lib/vant.js +80 -74
- package/lib/vant.min.js +3 -3
- package/lib/web-types.json +1 -1
- package/package.json +11 -11
package/lib/vant.es.js
CHANGED
@@ -6337,11 +6337,17 @@ function getDayByOffset(date, offset) {
|
|
6337
6337
|
function getMonthByOffset(date, offset) {
|
6338
6338
|
const cloned = cloneDate(date);
|
6339
6339
|
cloned.setMonth(cloned.getMonth() + offset);
|
6340
|
+
if (cloned.getDate() !== date.getDate()) {
|
6341
|
+
cloned.setDate(0);
|
6342
|
+
}
|
6340
6343
|
return cloned;
|
6341
6344
|
}
|
6342
6345
|
function getYearByOffset(date, offset) {
|
6343
6346
|
const cloned = cloneDate(date);
|
6344
6347
|
cloned.setFullYear(cloned.getFullYear() + offset);
|
6348
|
+
if (cloned.getDate() !== date.getDate()) {
|
6349
|
+
cloned.setDate(0);
|
6350
|
+
}
|
6345
6351
|
return cloned;
|
6346
6352
|
}
|
6347
6353
|
const getPrevDay = (date) => getDayByOffset(date, -1);
|
@@ -6745,22 +6751,10 @@ var stdin_default$1e = defineComponent({
|
|
6745
6751
|
slots,
|
6746
6752
|
emit
|
6747
6753
|
}) {
|
6748
|
-
const prevMonthDisabled = computed(() =>
|
6749
|
-
|
6750
|
-
|
6751
|
-
|
6752
|
-
const prevYearDisabled = computed(() => {
|
6753
|
-
const prevYear = getPrevYear(props2.date);
|
6754
|
-
return props2.minDate && prevYear < props2.minDate;
|
6755
|
-
});
|
6756
|
-
const nextMonthDisabled = computed(() => {
|
6757
|
-
const nextMonth = getNextMonth(props2.date);
|
6758
|
-
return props2.maxDate && nextMonth > props2.maxDate;
|
6759
|
-
});
|
6760
|
-
const nextYearDisabled = computed(() => {
|
6761
|
-
const nextYear = getNextYear(props2.date);
|
6762
|
-
return props2.maxDate && nextYear > props2.maxDate;
|
6763
|
-
});
|
6754
|
+
const prevMonthDisabled = computed(() => props2.date && props2.minDate && compareMonth(getPrevMonth(props2.date), props2.minDate) < 0);
|
6755
|
+
const prevYearDisabled = computed(() => props2.date && props2.minDate && compareMonth(getPrevYear(props2.date), props2.minDate) < 0);
|
6756
|
+
const nextMonthDisabled = computed(() => props2.date && props2.maxDate && compareMonth(getNextMonth(props2.date), props2.maxDate) > 0);
|
6757
|
+
const nextYearDisabled = computed(() => props2.date && props2.maxDate && compareMonth(getNextYear(props2.date), props2.maxDate) > 0);
|
6764
6758
|
const renderTitle = () => {
|
6765
6759
|
if (props2.showTitle) {
|
6766
6760
|
const text = props2.title || t$g("title");
|
@@ -14965,7 +14959,7 @@ var stdin_default$c = defineComponent({
|
|
14965
14959
|
}, 0);
|
14966
14960
|
}
|
14967
14961
|
};
|
14968
|
-
const onClick = (position = "outside") => {
|
14962
|
+
const onClick = (position = "outside", event) => {
|
14969
14963
|
if (isInBeforeClosing)
|
14970
14964
|
return;
|
14971
14965
|
emit("click", position);
|
@@ -14973,6 +14967,7 @@ var stdin_default$c = defineComponent({
|
|
14973
14967
|
isInBeforeClosing = true;
|
14974
14968
|
callInterceptor(props2.beforeClose, {
|
14975
14969
|
args: [{
|
14970
|
+
event,
|
14976
14971
|
name: props2.name,
|
14977
14972
|
position
|
14978
14973
|
}],
|
@@ -14989,7 +14984,10 @@ var stdin_default$c = defineComponent({
|
|
14989
14984
|
if (stop) {
|
14990
14985
|
event.stopPropagation();
|
14991
14986
|
}
|
14992
|
-
|
14987
|
+
if (lockClick2) {
|
14988
|
+
return;
|
14989
|
+
}
|
14990
|
+
onClick(position, event);
|
14993
14991
|
};
|
14994
14992
|
const renderSideContent = (side, ref2) => {
|
14995
14993
|
const contentSlot = slots[side];
|
@@ -15005,7 +15003,7 @@ var stdin_default$c = defineComponent({
|
|
15005
15003
|
open,
|
15006
15004
|
close
|
15007
15005
|
});
|
15008
|
-
useClickAway(root, () => onClick("outside"), {
|
15006
|
+
useClickAway(root, (event) => onClick("outside", event), {
|
15009
15007
|
eventName: "touchstart"
|
15010
15008
|
});
|
15011
15009
|
useEventListener("touchmove", onTouchMove, {
|
@@ -15235,10 +15233,11 @@ var stdin_default$9 = defineComponent({
|
|
15235
15233
|
emit,
|
15236
15234
|
slots
|
15237
15235
|
}) {
|
15238
|
-
const text = ref(
|
15236
|
+
const text = ref(props2.content);
|
15239
15237
|
const expanded = ref(false);
|
15240
15238
|
const hasAction = ref(false);
|
15241
15239
|
const root = ref();
|
15240
|
+
const actionRef = ref();
|
15242
15241
|
let needRecalculate = false;
|
15243
15242
|
const actionText = computed(() => expanded.value ? props2.collapseText : props2.expandText);
|
15244
15243
|
const pxToNum = (value) => {
|
@@ -15266,57 +15265,60 @@ var stdin_default$9 = defineComponent({
|
|
15266
15265
|
document.body.appendChild(container);
|
15267
15266
|
return container;
|
15268
15267
|
};
|
15269
|
-
const
|
15270
|
-
|
15271
|
-
|
15272
|
-
|
15273
|
-
|
15274
|
-
|
15275
|
-
|
15276
|
-
|
15277
|
-
|
15278
|
-
|
15279
|
-
|
15280
|
-
|
15281
|
-
|
15282
|
-
}
|
15283
|
-
return dots + content.slice(right, end);
|
15284
|
-
}
|
15285
|
-
const middle2 = Math.round((left + right) / 2);
|
15268
|
+
const calcEllipsisText = (container, maxHeight) => {
|
15269
|
+
var _a, _b;
|
15270
|
+
const {
|
15271
|
+
content,
|
15272
|
+
position,
|
15273
|
+
dots
|
15274
|
+
} = props2;
|
15275
|
+
const end = content.length;
|
15276
|
+
const middle = 0 + end >> 1;
|
15277
|
+
const actionHTML = slots.action ? (_b = (_a = actionRef.value) == null ? void 0 : _a.outerHTML) != null ? _b : "" : props2.expandText;
|
15278
|
+
const calcEllipse = () => {
|
15279
|
+
const tail = (left, right) => {
|
15280
|
+
if (right - left <= 1) {
|
15286
15281
|
if (position === "end") {
|
15287
|
-
|
15288
|
-
} else {
|
15289
|
-
container2.innerText = dots + content.slice(middle2, end) + actionText.value;
|
15290
|
-
}
|
15291
|
-
if (container2.offsetHeight > maxHeight2) {
|
15292
|
-
if (position === "end") {
|
15293
|
-
return tail(left, middle2);
|
15294
|
-
}
|
15295
|
-
return tail(middle2, right);
|
15282
|
+
return content.slice(0, left) + dots;
|
15296
15283
|
}
|
15284
|
+
return dots + content.slice(right, end);
|
15285
|
+
}
|
15286
|
+
const middle2 = Math.round((left + right) / 2);
|
15287
|
+
if (position === "end") {
|
15288
|
+
container.innerText = content.slice(0, middle2) + dots;
|
15289
|
+
} else {
|
15290
|
+
container.innerText = dots + content.slice(middle2, end);
|
15291
|
+
}
|
15292
|
+
container.innerHTML += actionHTML;
|
15293
|
+
if (container.offsetHeight > maxHeight) {
|
15297
15294
|
if (position === "end") {
|
15298
|
-
return tail(
|
15295
|
+
return tail(left, middle2);
|
15299
15296
|
}
|
15300
|
-
return tail(
|
15301
|
-
};
|
15302
|
-
container2.innerText = tail(0, end);
|
15303
|
-
};
|
15304
|
-
const middleTail = (leftPart, rightPart) => {
|
15305
|
-
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
15306
|
-
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
|
15297
|
+
return tail(middle2, right);
|
15307
15298
|
}
|
15308
|
-
|
15309
|
-
|
15310
|
-
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end) + props2.expandText;
|
15311
|
-
if (container2.offsetHeight >= maxHeight2) {
|
15312
|
-
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
15299
|
+
if (position === "end") {
|
15300
|
+
return tail(middle2, right);
|
15313
15301
|
}
|
15314
|
-
return
|
15302
|
+
return tail(left, middle2);
|
15315
15303
|
};
|
15316
|
-
|
15317
|
-
|
15318
|
-
|
15304
|
+
return tail(0, end);
|
15305
|
+
};
|
15306
|
+
const middleTail = (leftPart, rightPart) => {
|
15307
|
+
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
15308
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
|
15309
|
+
}
|
15310
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
15311
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
15312
|
+
container.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end);
|
15313
|
+
container.innerHTML += actionHTML;
|
15314
|
+
if (container.offsetHeight >= maxHeight) {
|
15315
|
+
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
15316
|
+
}
|
15317
|
+
return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
|
15319
15318
|
};
|
15319
|
+
return props2.position === "middle" ? middleTail([0, middle], [middle, end]) : calcEllipse();
|
15320
|
+
};
|
15321
|
+
const calcEllipsised = () => {
|
15320
15322
|
const container = cloneContainer();
|
15321
15323
|
if (!container) {
|
15322
15324
|
needRecalculate = true;
|
@@ -15349,11 +15351,17 @@ var stdin_default$9 = defineComponent({
|
|
15349
15351
|
expanded: expanded.value
|
15350
15352
|
}) : actionText.value;
|
15351
15353
|
return createVNode("span", {
|
15354
|
+
"ref": actionRef,
|
15352
15355
|
"class": bem$3("action"),
|
15353
15356
|
"onClick": onClickAction
|
15354
15357
|
}, [action]);
|
15355
15358
|
};
|
15356
|
-
onMounted(
|
15359
|
+
onMounted(() => {
|
15360
|
+
calcEllipsised();
|
15361
|
+
if (slots.action) {
|
15362
|
+
nextTick(calcEllipsised);
|
15363
|
+
}
|
15364
|
+
});
|
15357
15365
|
onActivated(() => {
|
15358
15366
|
if (needRecalculate) {
|
15359
15367
|
needRecalculate = false;
|
@@ -15952,7 +15960,7 @@ var stdin_default$5 = defineComponent({
|
|
15952
15960
|
emit("update:modelValue", fileList);
|
15953
15961
|
emit("delete", item, getDetail(index));
|
15954
15962
|
};
|
15955
|
-
const
|
15963
|
+
const reuploadFile = (index) => {
|
15956
15964
|
isReuploading.value = true;
|
15957
15965
|
reuploadIndex.value = index;
|
15958
15966
|
nextTick(() => chooseFile());
|
@@ -15972,7 +15980,7 @@ var stdin_default$5 = defineComponent({
|
|
15972
15980
|
"onClick": () => emit(props2.reupload ? "clickReupload" : "clickPreview", item, getDetail(index)),
|
15973
15981
|
"onDelete": () => deleteFile(item, index),
|
15974
15982
|
"onPreview": () => previewImage(item),
|
15975
|
-
"onReupload": () =>
|
15983
|
+
"onReupload": () => reuploadFile(index)
|
15976
15984
|
}, pick(props2, ["name", "lazyLoad"]), previewData), pick(slots, ["preview-cover", "preview-delete"]));
|
15977
15985
|
};
|
15978
15986
|
const renderPreviewList = () => {
|
@@ -15982,10 +15990,7 @@ var stdin_default$5 = defineComponent({
|
|
15982
15990
|
};
|
15983
15991
|
const onClickUpload = (event) => emit("clickUpload", event);
|
15984
15992
|
const renderUpload = () => {
|
15985
|
-
|
15986
|
-
return;
|
15987
|
-
}
|
15988
|
-
const hideUploader = props2.modelValue.length >= +props2.maxCount && props2.reupload;
|
15993
|
+
const lessThanMax = props2.modelValue.length < +props2.maxCount;
|
15989
15994
|
const Input = props2.readonly ? null : createVNode("input", {
|
15990
15995
|
"ref": inputRef,
|
15991
15996
|
"type": "file",
|
@@ -16001,7 +16006,7 @@ var stdin_default$5 = defineComponent({
|
|
16001
16006
|
return withDirectives(createVNode("div", {
|
16002
16007
|
"class": bem$1("input-wrapper"),
|
16003
16008
|
"onClick": onClickUpload
|
16004
|
-
}, [slots.default(), Input]), [[vShow,
|
16009
|
+
}, [slots.default(), Input]), [[vShow, lessThanMax]]);
|
16005
16010
|
}
|
16006
16011
|
return withDirectives(createVNode("div", {
|
16007
16012
|
"class": bem$1("upload", {
|
@@ -16014,7 +16019,7 @@ var stdin_default$5 = defineComponent({
|
|
16014
16019
|
"class": bem$1("upload-icon")
|
16015
16020
|
}, null), props2.uploadText && createVNode("span", {
|
16016
16021
|
"class": bem$1("upload-text")
|
16017
|
-
}, [props2.uploadText]), Input]), [[vShow, props2.showUpload &&
|
16022
|
+
}, [props2.uploadText]), Input]), [[vShow, props2.showUpload && lessThanMax]]);
|
16018
16023
|
};
|
16019
16024
|
const chooseFile = () => {
|
16020
16025
|
if (inputRef.value && !props2.disabled) {
|
@@ -16026,6 +16031,7 @@ var stdin_default$5 = defineComponent({
|
|
16026
16031
|
});
|
16027
16032
|
useExpose({
|
16028
16033
|
chooseFile,
|
16034
|
+
reuploadFile,
|
16029
16035
|
closeImagePreview
|
16030
16036
|
});
|
16031
16037
|
useCustomFieldValue(() => props2.modelValue);
|
@@ -17041,7 +17047,7 @@ const Lazyload = {
|
|
17041
17047
|
});
|
17042
17048
|
}
|
17043
17049
|
};
|
17044
|
-
const version = "4.9.
|
17050
|
+
const version = "4.9.4";
|
17045
17051
|
function install(app) {
|
17046
17052
|
const components = [
|
17047
17053
|
ActionBar,
|
package/lib/vant.js
CHANGED
@@ -2369,7 +2369,7 @@
|
|
2369
2369
|
return propRef;
|
2370
2370
|
};
|
2371
2371
|
/**
|
2372
|
-
* @vue/shared v3.4.
|
2372
|
+
* @vue/shared v3.4.33
|
2373
2373
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
2374
2374
|
* @license MIT
|
2375
2375
|
**/
|
@@ -6798,11 +6798,17 @@
|
|
6798
6798
|
function getMonthByOffset(date, offset2) {
|
6799
6799
|
const cloned = cloneDate(date);
|
6800
6800
|
cloned.setMonth(cloned.getMonth() + offset2);
|
6801
|
+
if (cloned.getDate() !== date.getDate()) {
|
6802
|
+
cloned.setDate(0);
|
6803
|
+
}
|
6801
6804
|
return cloned;
|
6802
6805
|
}
|
6803
6806
|
function getYearByOffset(date, offset2) {
|
6804
6807
|
const cloned = cloneDate(date);
|
6805
6808
|
cloned.setFullYear(cloned.getFullYear() + offset2);
|
6809
|
+
if (cloned.getDate() !== date.getDate()) {
|
6810
|
+
cloned.setDate(0);
|
6811
|
+
}
|
6806
6812
|
return cloned;
|
6807
6813
|
}
|
6808
6814
|
const getPrevDay = (date) => getDayByOffset(date, -1);
|
@@ -7206,22 +7212,10 @@
|
|
7206
7212
|
slots,
|
7207
7213
|
emit
|
7208
7214
|
}) {
|
7209
|
-
const prevMonthDisabled = vue.computed(() =>
|
7210
|
-
|
7211
|
-
|
7212
|
-
|
7213
|
-
const prevYearDisabled = vue.computed(() => {
|
7214
|
-
const prevYear = getPrevYear(props2.date);
|
7215
|
-
return props2.minDate && prevYear < props2.minDate;
|
7216
|
-
});
|
7217
|
-
const nextMonthDisabled = vue.computed(() => {
|
7218
|
-
const nextMonth = getNextMonth(props2.date);
|
7219
|
-
return props2.maxDate && nextMonth > props2.maxDate;
|
7220
|
-
});
|
7221
|
-
const nextYearDisabled = vue.computed(() => {
|
7222
|
-
const nextYear = getNextYear(props2.date);
|
7223
|
-
return props2.maxDate && nextYear > props2.maxDate;
|
7224
|
-
});
|
7215
|
+
const prevMonthDisabled = vue.computed(() => props2.date && props2.minDate && compareMonth(getPrevMonth(props2.date), props2.minDate) < 0);
|
7216
|
+
const prevYearDisabled = vue.computed(() => props2.date && props2.minDate && compareMonth(getPrevYear(props2.date), props2.minDate) < 0);
|
7217
|
+
const nextMonthDisabled = vue.computed(() => props2.date && props2.maxDate && compareMonth(getNextMonth(props2.date), props2.maxDate) > 0);
|
7218
|
+
const nextYearDisabled = vue.computed(() => props2.date && props2.maxDate && compareMonth(getNextYear(props2.date), props2.maxDate) > 0);
|
7225
7219
|
const renderTitle = () => {
|
7226
7220
|
if (props2.showTitle) {
|
7227
7221
|
const text = props2.title || t$g("title");
|
@@ -16203,7 +16197,7 @@
|
|
16203
16197
|
}, 0);
|
16204
16198
|
}
|
16205
16199
|
};
|
16206
|
-
const onClick = (position = "outside") => {
|
16200
|
+
const onClick = (position = "outside", event) => {
|
16207
16201
|
if (isInBeforeClosing)
|
16208
16202
|
return;
|
16209
16203
|
emit("click", position);
|
@@ -16211,6 +16205,7 @@
|
|
16211
16205
|
isInBeforeClosing = true;
|
16212
16206
|
callInterceptor(props2.beforeClose, {
|
16213
16207
|
args: [{
|
16208
|
+
event,
|
16214
16209
|
name: props2.name,
|
16215
16210
|
position
|
16216
16211
|
}],
|
@@ -16227,7 +16222,10 @@
|
|
16227
16222
|
if (stop) {
|
16228
16223
|
event.stopPropagation();
|
16229
16224
|
}
|
16230
|
-
|
16225
|
+
if (lockClick2) {
|
16226
|
+
return;
|
16227
|
+
}
|
16228
|
+
onClick(position, event);
|
16231
16229
|
};
|
16232
16230
|
const renderSideContent = (side, ref2) => {
|
16233
16231
|
const contentSlot = slots[side];
|
@@ -16243,7 +16241,7 @@
|
|
16243
16241
|
open,
|
16244
16242
|
close
|
16245
16243
|
});
|
16246
|
-
useClickAway(root, () => onClick("outside"), {
|
16244
|
+
useClickAway(root, (event) => onClick("outside", event), {
|
16247
16245
|
eventName: "touchstart"
|
16248
16246
|
});
|
16249
16247
|
useEventListener("touchmove", onTouchMove, {
|
@@ -16470,10 +16468,11 @@
|
|
16470
16468
|
emit,
|
16471
16469
|
slots
|
16472
16470
|
}) {
|
16473
|
-
const text = vue.ref(
|
16471
|
+
const text = vue.ref(props2.content);
|
16474
16472
|
const expanded = vue.ref(false);
|
16475
16473
|
const hasAction = vue.ref(false);
|
16476
16474
|
const root = vue.ref();
|
16475
|
+
const actionRef = vue.ref();
|
16477
16476
|
let needRecalculate = false;
|
16478
16477
|
const actionText = vue.computed(() => expanded.value ? props2.collapseText : props2.expandText);
|
16479
16478
|
const pxToNum = (value) => {
|
@@ -16501,57 +16500,60 @@
|
|
16501
16500
|
document.body.appendChild(container);
|
16502
16501
|
return container;
|
16503
16502
|
};
|
16504
|
-
const
|
16505
|
-
|
16506
|
-
|
16507
|
-
|
16508
|
-
|
16509
|
-
|
16510
|
-
|
16511
|
-
|
16512
|
-
|
16513
|
-
|
16514
|
-
|
16515
|
-
|
16516
|
-
|
16517
|
-
}
|
16518
|
-
return dots + content.slice(right2, end2);
|
16519
|
-
}
|
16520
|
-
const middle2 = Math.round((left2 + right2) / 2);
|
16503
|
+
const calcEllipsisText = (container, maxHeight) => {
|
16504
|
+
var _a, _b;
|
16505
|
+
const {
|
16506
|
+
content,
|
16507
|
+
position,
|
16508
|
+
dots
|
16509
|
+
} = props2;
|
16510
|
+
const end2 = content.length;
|
16511
|
+
const middle = 0 + end2 >> 1;
|
16512
|
+
const actionHTML = slots.action ? (_b = (_a = actionRef.value) == null ? void 0 : _a.outerHTML) != null ? _b : "" : props2.expandText;
|
16513
|
+
const calcEllipse = () => {
|
16514
|
+
const tail = (left2, right2) => {
|
16515
|
+
if (right2 - left2 <= 1) {
|
16521
16516
|
if (position === "end") {
|
16522
|
-
|
16523
|
-
} else {
|
16524
|
-
container2.innerText = dots + content.slice(middle2, end2) + actionText.value;
|
16525
|
-
}
|
16526
|
-
if (container2.offsetHeight > maxHeight2) {
|
16527
|
-
if (position === "end") {
|
16528
|
-
return tail(left2, middle2);
|
16529
|
-
}
|
16530
|
-
return tail(middle2, right2);
|
16517
|
+
return content.slice(0, left2) + dots;
|
16531
16518
|
}
|
16519
|
+
return dots + content.slice(right2, end2);
|
16520
|
+
}
|
16521
|
+
const middle2 = Math.round((left2 + right2) / 2);
|
16522
|
+
if (position === "end") {
|
16523
|
+
container.innerText = content.slice(0, middle2) + dots;
|
16524
|
+
} else {
|
16525
|
+
container.innerText = dots + content.slice(middle2, end2);
|
16526
|
+
}
|
16527
|
+
container.innerHTML += actionHTML;
|
16528
|
+
if (container.offsetHeight > maxHeight) {
|
16532
16529
|
if (position === "end") {
|
16533
|
-
return tail(
|
16530
|
+
return tail(left2, middle2);
|
16534
16531
|
}
|
16535
|
-
return tail(
|
16536
|
-
};
|
16537
|
-
container2.innerText = tail(0, end2);
|
16538
|
-
};
|
16539
|
-
const middleTail = (leftPart, rightPart) => {
|
16540
|
-
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
16541
|
-
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end2);
|
16532
|
+
return tail(middle2, right2);
|
16542
16533
|
}
|
16543
|
-
|
16544
|
-
|
16545
|
-
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end2) + props2.expandText;
|
16546
|
-
if (container2.offsetHeight >= maxHeight2) {
|
16547
|
-
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
16534
|
+
if (position === "end") {
|
16535
|
+
return tail(middle2, right2);
|
16548
16536
|
}
|
16549
|
-
return
|
16537
|
+
return tail(left2, middle2);
|
16550
16538
|
};
|
16551
|
-
|
16552
|
-
|
16553
|
-
|
16539
|
+
return tail(0, end2);
|
16540
|
+
};
|
16541
|
+
const middleTail = (leftPart, rightPart) => {
|
16542
|
+
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
16543
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end2);
|
16544
|
+
}
|
16545
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
16546
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
16547
|
+
container.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end2);
|
16548
|
+
container.innerHTML += actionHTML;
|
16549
|
+
if (container.offsetHeight >= maxHeight) {
|
16550
|
+
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
16551
|
+
}
|
16552
|
+
return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
|
16554
16553
|
};
|
16554
|
+
return props2.position === "middle" ? middleTail([0, middle], [middle, end2]) : calcEllipse();
|
16555
|
+
};
|
16556
|
+
const calcEllipsised = () => {
|
16555
16557
|
const container = cloneContainer();
|
16556
16558
|
if (!container) {
|
16557
16559
|
needRecalculate = true;
|
@@ -16584,11 +16586,17 @@
|
|
16584
16586
|
expanded: expanded.value
|
16585
16587
|
}) : actionText.value;
|
16586
16588
|
return vue.createVNode("span", {
|
16589
|
+
"ref": actionRef,
|
16587
16590
|
"class": bem$3("action"),
|
16588
16591
|
"onClick": onClickAction
|
16589
16592
|
}, [action]);
|
16590
16593
|
};
|
16591
|
-
vue.onMounted(
|
16594
|
+
vue.onMounted(() => {
|
16595
|
+
calcEllipsised();
|
16596
|
+
if (slots.action) {
|
16597
|
+
vue.nextTick(calcEllipsised);
|
16598
|
+
}
|
16599
|
+
});
|
16592
16600
|
vue.onActivated(() => {
|
16593
16601
|
if (needRecalculate) {
|
16594
16602
|
needRecalculate = false;
|
@@ -17184,7 +17192,7 @@
|
|
17184
17192
|
emit("update:modelValue", fileList);
|
17185
17193
|
emit("delete", item, getDetail(index));
|
17186
17194
|
};
|
17187
|
-
const
|
17195
|
+
const reuploadFile = (index) => {
|
17188
17196
|
isReuploading.value = true;
|
17189
17197
|
reuploadIndex.value = index;
|
17190
17198
|
vue.nextTick(() => chooseFile());
|
@@ -17204,7 +17212,7 @@
|
|
17204
17212
|
"onClick": () => emit(props2.reupload ? "clickReupload" : "clickPreview", item, getDetail(index)),
|
17205
17213
|
"onDelete": () => deleteFile(item, index),
|
17206
17214
|
"onPreview": () => previewImage(item),
|
17207
|
-
"onReupload": () =>
|
17215
|
+
"onReupload": () => reuploadFile(index)
|
17208
17216
|
}, pick(props2, ["name", "lazyLoad"]), previewData), pick(slots, ["preview-cover", "preview-delete"]));
|
17209
17217
|
};
|
17210
17218
|
const renderPreviewList = () => {
|
@@ -17214,10 +17222,7 @@
|
|
17214
17222
|
};
|
17215
17223
|
const onClickUpload = (event) => emit("clickUpload", event);
|
17216
17224
|
const renderUpload = () => {
|
17217
|
-
|
17218
|
-
return;
|
17219
|
-
}
|
17220
|
-
const hideUploader = props2.modelValue.length >= +props2.maxCount && props2.reupload;
|
17225
|
+
const lessThanMax = props2.modelValue.length < +props2.maxCount;
|
17221
17226
|
const Input = props2.readonly ? null : vue.createVNode("input", {
|
17222
17227
|
"ref": inputRef,
|
17223
17228
|
"type": "file",
|
@@ -17233,7 +17238,7 @@
|
|
17233
17238
|
return vue.withDirectives(vue.createVNode("div", {
|
17234
17239
|
"class": bem$1("input-wrapper"),
|
17235
17240
|
"onClick": onClickUpload
|
17236
|
-
}, [slots.default(), Input]), [[vue.vShow,
|
17241
|
+
}, [slots.default(), Input]), [[vue.vShow, lessThanMax]]);
|
17237
17242
|
}
|
17238
17243
|
return vue.withDirectives(vue.createVNode("div", {
|
17239
17244
|
"class": bem$1("upload", {
|
@@ -17246,7 +17251,7 @@
|
|
17246
17251
|
"class": bem$1("upload-icon")
|
17247
17252
|
}, null), props2.uploadText && vue.createVNode("span", {
|
17248
17253
|
"class": bem$1("upload-text")
|
17249
|
-
}, [props2.uploadText]), Input]), [[vue.vShow, props2.showUpload &&
|
17254
|
+
}, [props2.uploadText]), Input]), [[vue.vShow, props2.showUpload && lessThanMax]]);
|
17250
17255
|
};
|
17251
17256
|
const chooseFile = () => {
|
17252
17257
|
if (inputRef.value && !props2.disabled) {
|
@@ -17258,6 +17263,7 @@
|
|
17258
17263
|
});
|
17259
17264
|
useExpose({
|
17260
17265
|
chooseFile,
|
17266
|
+
reuploadFile,
|
17261
17267
|
closeImagePreview
|
17262
17268
|
});
|
17263
17269
|
useCustomFieldValue(() => props2.modelValue);
|
@@ -18256,7 +18262,7 @@
|
|
18256
18262
|
});
|
18257
18263
|
}
|
18258
18264
|
};
|
18259
|
-
const version = "4.9.
|
18265
|
+
const version = "4.9.4";
|
18260
18266
|
function install(app) {
|
18261
18267
|
const components = [
|
18262
18268
|
ActionBar,
|