vant 4.9.1 → 4.9.3
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/action-bar-button/ActionBarButton.d.ts +3 -3
- package/es/action-bar-button/index.d.ts +2 -2
- package/es/action-bar-icon/ActionBarIcon.d.ts +3 -3
- package/es/action-bar-icon/index.d.ts +2 -2
- package/es/button/Button.d.ts +3 -3
- package/es/button/index.d.ts +2 -2
- package/es/calendar/CalendarHeader.mjs +5 -17
- package/es/calendar/utils.mjs +6 -0
- package/es/card/Card.mjs +3 -3
- package/es/cell/Cell.d.ts +3 -3
- package/es/cell/index.d.ts +2 -2
- package/es/composables/use-route.d.ts +1 -2
- package/es/form/Form.d.ts +3 -0
- package/es/form/Form.mjs +9 -2
- package/es/form/index.d.ts +2 -0
- package/es/grid-item/GridItem.d.ts +3 -3
- package/es/grid-item/index.d.ts +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/notify/types.d.ts +3 -0
- package/es/sidebar-item/SidebarItem.d.ts +3 -3
- package/es/sidebar-item/index.d.ts +2 -2
- package/es/tab/Tab.d.ts +3 -3
- package/es/tab/index.d.ts +2 -2
- package/es/tabbar-item/TabbarItem.d.ts +3 -3
- package/es/tabbar-item/index.d.ts +2 -2
- package/es/tabs/utils.mjs +3 -1
- package/es/text-ellipsis/TextEllipsis.mjs +56 -46
- package/es/uploader/Uploader.mjs +6 -8
- package/es/uploader/index.d.ts +1 -1
- package/es/uploader/types.d.ts +1 -0
- package/lib/action-bar-button/ActionBarButton.d.ts +3 -3
- package/lib/action-bar-button/index.d.ts +2 -2
- package/lib/action-bar-icon/ActionBarIcon.d.ts +3 -3
- package/lib/action-bar-icon/index.d.ts +2 -2
- package/lib/button/Button.d.ts +3 -3
- package/lib/button/index.d.ts +2 -2
- package/lib/calendar/CalendarHeader.js +4 -16
- package/lib/calendar/utils.js +6 -0
- package/lib/card/Card.js +2 -2
- package/lib/cell/Cell.d.ts +3 -3
- package/lib/cell/index.d.ts +2 -2
- package/lib/composables/use-route.d.ts +1 -2
- package/lib/form/Form.d.ts +3 -0
- package/lib/form/Form.js +9 -2
- package/lib/form/index.d.ts +2 -0
- package/lib/grid-item/GridItem.d.ts +3 -3
- package/lib/grid-item/index.d.ts +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/notify/types.d.ts +3 -0
- package/lib/sidebar-item/SidebarItem.d.ts +3 -3
- package/lib/sidebar-item/index.d.ts +2 -2
- package/lib/tab/Tab.d.ts +3 -3
- package/lib/tab/index.d.ts +2 -2
- package/lib/tabbar-item/TabbarItem.d.ts +3 -3
- package/lib/tabbar-item/index.d.ts +2 -2
- package/lib/tabs/utils.js +3 -1
- package/lib/text-ellipsis/TextEllipsis.js +55 -45
- package/lib/uploader/Uploader.js +6 -8
- package/lib/uploader/index.d.ts +1 -1
- package/lib/uploader/types.d.ts +1 -0
- package/lib/vant.cjs.js +86 -75
- package/lib/vant.es.js +86 -75
- package/lib/vant.js +87 -76
- package/lib/vant.min.js +3 -3
- package/lib/web-types.json +1 -1
- package/package.json +15 -15
package/lib/vant.es.js
CHANGED
@@ -1983,11 +1983,13 @@ function scrollLeftTo(scroller, to, duration) {
|
|
1983
1983
|
let count = 0;
|
1984
1984
|
const from = scroller.scrollLeft;
|
1985
1985
|
const frames = duration === 0 ? 1 : Math.round(duration * 1e3 / 16);
|
1986
|
+
let scrollLeft = from;
|
1986
1987
|
function cancel() {
|
1987
1988
|
cancelRaf(rafId);
|
1988
1989
|
}
|
1989
1990
|
function animate() {
|
1990
|
-
|
1991
|
+
scrollLeft += (to - from) / frames;
|
1992
|
+
scroller.scrollLeft = scrollLeft;
|
1991
1993
|
if (++count < frames) {
|
1992
1994
|
rafId = raf(animate);
|
1993
1995
|
}
|
@@ -3819,6 +3821,7 @@ const formProps = {
|
|
3819
3821
|
labelAlign: String,
|
3820
3822
|
inputAlign: String,
|
3821
3823
|
scrollToError: Boolean,
|
3824
|
+
scrollToErrorPosition: String,
|
3822
3825
|
validateFirst: Boolean,
|
3823
3826
|
submitOnEnter: truthProp,
|
3824
3827
|
showErrorMessage: truthProp,
|
@@ -3932,8 +3935,14 @@ var stdin_default$1w = defineComponent({
|
|
3932
3935
|
values,
|
3933
3936
|
errors
|
3934
3937
|
});
|
3935
|
-
|
3936
|
-
|
3938
|
+
const {
|
3939
|
+
scrollToError,
|
3940
|
+
scrollToErrorPosition
|
3941
|
+
} = props2;
|
3942
|
+
if (scrollToError && errors[0].name) {
|
3943
|
+
scrollToField(errors[0].name, scrollToErrorPosition ? {
|
3944
|
+
block: scrollToErrorPosition
|
3945
|
+
} : void 0);
|
3937
3946
|
}
|
3938
3947
|
});
|
3939
3948
|
};
|
@@ -6328,11 +6337,17 @@ function getDayByOffset(date, offset) {
|
|
6328
6337
|
function getMonthByOffset(date, offset) {
|
6329
6338
|
const cloned = cloneDate(date);
|
6330
6339
|
cloned.setMonth(cloned.getMonth() + offset);
|
6340
|
+
if (cloned.getDate() !== date.getDate()) {
|
6341
|
+
cloned.setDate(0);
|
6342
|
+
}
|
6331
6343
|
return cloned;
|
6332
6344
|
}
|
6333
6345
|
function getYearByOffset(date, offset) {
|
6334
6346
|
const cloned = cloneDate(date);
|
6335
6347
|
cloned.setFullYear(cloned.getFullYear() + offset);
|
6348
|
+
if (cloned.getDate() !== date.getDate()) {
|
6349
|
+
cloned.setDate(0);
|
6350
|
+
}
|
6336
6351
|
return cloned;
|
6337
6352
|
}
|
6338
6353
|
const getPrevDay = (date) => getDayByOffset(date, -1);
|
@@ -6736,22 +6751,10 @@ var stdin_default$1e = defineComponent({
|
|
6736
6751
|
slots,
|
6737
6752
|
emit
|
6738
6753
|
}) {
|
6739
|
-
const prevMonthDisabled = computed(() =>
|
6740
|
-
|
6741
|
-
|
6742
|
-
|
6743
|
-
const prevYearDisabled = computed(() => {
|
6744
|
-
const prevYear = getPrevYear(props2.date);
|
6745
|
-
return props2.minDate && prevYear < props2.minDate;
|
6746
|
-
});
|
6747
|
-
const nextMonthDisabled = computed(() => {
|
6748
|
-
const nextMonth = getNextMonth(props2.date);
|
6749
|
-
return props2.maxDate && nextMonth > props2.maxDate;
|
6750
|
-
});
|
6751
|
-
const nextYearDisabled = computed(() => {
|
6752
|
-
const nextYear = getNextYear(props2.date);
|
6753
|
-
return props2.maxDate && nextYear > props2.maxDate;
|
6754
|
-
});
|
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);
|
6755
6758
|
const renderTitle = () => {
|
6756
6759
|
if (props2.showTitle) {
|
6757
6760
|
const text = props2.title || t$g("title");
|
@@ -7517,9 +7520,9 @@ var stdin_default$1b = defineComponent({
|
|
7517
7520
|
"class": bem$11("price-currency")
|
7518
7521
|
}, [props2.currency]), createVNode("span", {
|
7519
7522
|
"class": bem$11("price-integer")
|
7520
|
-
}, [priceArr[0]]), createTextVNode("."), createVNode("span", {
|
7523
|
+
}, [priceArr[0]]), priceArr.length > 1 && createVNode(Fragment, null, [createTextVNode("."), createVNode("span", {
|
7521
7524
|
"class": bem$11("price-decimal")
|
7522
|
-
}, [priceArr[1]])]);
|
7525
|
+
}, [priceArr[1]])])]);
|
7523
7526
|
};
|
7524
7527
|
return () => {
|
7525
7528
|
var _a, _b, _c;
|
@@ -15226,10 +15229,11 @@ var stdin_default$9 = defineComponent({
|
|
15226
15229
|
emit,
|
15227
15230
|
slots
|
15228
15231
|
}) {
|
15229
|
-
const text = ref(
|
15232
|
+
const text = ref(props2.content);
|
15230
15233
|
const expanded = ref(false);
|
15231
15234
|
const hasAction = ref(false);
|
15232
15235
|
const root = ref();
|
15236
|
+
const actionRef = ref();
|
15233
15237
|
let needRecalculate = false;
|
15234
15238
|
const actionText = computed(() => expanded.value ? props2.collapseText : props2.expandText);
|
15235
15239
|
const pxToNum = (value) => {
|
@@ -15257,57 +15261,60 @@ var stdin_default$9 = defineComponent({
|
|
15257
15261
|
document.body.appendChild(container);
|
15258
15262
|
return container;
|
15259
15263
|
};
|
15260
|
-
const
|
15261
|
-
|
15262
|
-
|
15263
|
-
|
15264
|
-
|
15265
|
-
|
15266
|
-
|
15267
|
-
|
15268
|
-
|
15269
|
-
|
15270
|
-
|
15271
|
-
|
15272
|
-
|
15273
|
-
}
|
15274
|
-
return dots + content.slice(right, end);
|
15275
|
-
}
|
15276
|
-
const middle2 = Math.round((left + right) / 2);
|
15264
|
+
const calcEllipsisText = (container, maxHeight) => {
|
15265
|
+
var _a, _b;
|
15266
|
+
const {
|
15267
|
+
content,
|
15268
|
+
position,
|
15269
|
+
dots
|
15270
|
+
} = props2;
|
15271
|
+
const end = content.length;
|
15272
|
+
const middle = 0 + end >> 1;
|
15273
|
+
const actionHTML = slots.action ? (_b = (_a = actionRef.value) == null ? void 0 : _a.outerHTML) != null ? _b : "" : props2.expandText;
|
15274
|
+
const calcEllipse = () => {
|
15275
|
+
const tail = (left, right) => {
|
15276
|
+
if (right - left <= 1) {
|
15277
15277
|
if (position === "end") {
|
15278
|
-
|
15279
|
-
} else {
|
15280
|
-
container2.innerText = dots + content.slice(middle2, end) + actionText.value;
|
15281
|
-
}
|
15282
|
-
if (container2.offsetHeight > maxHeight2) {
|
15283
|
-
if (position === "end") {
|
15284
|
-
return tail(left, middle2);
|
15285
|
-
}
|
15286
|
-
return tail(middle2, right);
|
15278
|
+
return content.slice(0, left) + dots;
|
15287
15279
|
}
|
15280
|
+
return dots + content.slice(right, end);
|
15281
|
+
}
|
15282
|
+
const middle2 = Math.round((left + right) / 2);
|
15283
|
+
if (position === "end") {
|
15284
|
+
container.innerText = content.slice(0, middle2) + dots;
|
15285
|
+
} else {
|
15286
|
+
container.innerText = dots + content.slice(middle2, end);
|
15287
|
+
}
|
15288
|
+
container.innerHTML += actionHTML;
|
15289
|
+
if (container.offsetHeight > maxHeight) {
|
15288
15290
|
if (position === "end") {
|
15289
|
-
return tail(
|
15291
|
+
return tail(left, middle2);
|
15290
15292
|
}
|
15291
|
-
return tail(
|
15292
|
-
};
|
15293
|
-
container2.innerText = tail(0, end);
|
15294
|
-
};
|
15295
|
-
const middleTail = (leftPart, rightPart) => {
|
15296
|
-
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
15297
|
-
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
|
15293
|
+
return tail(middle2, right);
|
15298
15294
|
}
|
15299
|
-
|
15300
|
-
|
15301
|
-
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end) + props2.expandText;
|
15302
|
-
if (container2.offsetHeight >= maxHeight2) {
|
15303
|
-
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
15295
|
+
if (position === "end") {
|
15296
|
+
return tail(middle2, right);
|
15304
15297
|
}
|
15305
|
-
return
|
15298
|
+
return tail(left, middle2);
|
15306
15299
|
};
|
15307
|
-
|
15308
|
-
|
15309
|
-
|
15300
|
+
return tail(0, end);
|
15301
|
+
};
|
15302
|
+
const middleTail = (leftPart, rightPart) => {
|
15303
|
+
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
15304
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end);
|
15305
|
+
}
|
15306
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
15307
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
15308
|
+
container.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end);
|
15309
|
+
container.innerHTML += actionHTML;
|
15310
|
+
if (container.offsetHeight >= maxHeight) {
|
15311
|
+
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
15312
|
+
}
|
15313
|
+
return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
|
15310
15314
|
};
|
15315
|
+
return props2.position === "middle" ? middleTail([0, middle], [middle, end]) : calcEllipse();
|
15316
|
+
};
|
15317
|
+
const calcEllipsised = () => {
|
15311
15318
|
const container = cloneContainer();
|
15312
15319
|
if (!container) {
|
15313
15320
|
needRecalculate = true;
|
@@ -15340,11 +15347,17 @@ var stdin_default$9 = defineComponent({
|
|
15340
15347
|
expanded: expanded.value
|
15341
15348
|
}) : actionText.value;
|
15342
15349
|
return createVNode("span", {
|
15350
|
+
"ref": actionRef,
|
15343
15351
|
"class": bem$3("action"),
|
15344
15352
|
"onClick": onClickAction
|
15345
15353
|
}, [action]);
|
15346
15354
|
};
|
15347
|
-
onMounted(
|
15355
|
+
onMounted(() => {
|
15356
|
+
calcEllipsised();
|
15357
|
+
if (slots.action) {
|
15358
|
+
nextTick(calcEllipsised);
|
15359
|
+
}
|
15360
|
+
});
|
15348
15361
|
onActivated(() => {
|
15349
15362
|
if (needRecalculate) {
|
15350
15363
|
needRecalculate = false;
|
@@ -15943,7 +15956,7 @@ var stdin_default$5 = defineComponent({
|
|
15943
15956
|
emit("update:modelValue", fileList);
|
15944
15957
|
emit("delete", item, getDetail(index));
|
15945
15958
|
};
|
15946
|
-
const
|
15959
|
+
const reuploadFile = (index) => {
|
15947
15960
|
isReuploading.value = true;
|
15948
15961
|
reuploadIndex.value = index;
|
15949
15962
|
nextTick(() => chooseFile());
|
@@ -15963,7 +15976,7 @@ var stdin_default$5 = defineComponent({
|
|
15963
15976
|
"onClick": () => emit(props2.reupload ? "clickReupload" : "clickPreview", item, getDetail(index)),
|
15964
15977
|
"onDelete": () => deleteFile(item, index),
|
15965
15978
|
"onPreview": () => previewImage(item),
|
15966
|
-
"onReupload": () =>
|
15979
|
+
"onReupload": () => reuploadFile(index)
|
15967
15980
|
}, pick(props2, ["name", "lazyLoad"]), previewData), pick(slots, ["preview-cover", "preview-delete"]));
|
15968
15981
|
};
|
15969
15982
|
const renderPreviewList = () => {
|
@@ -15973,10 +15986,7 @@ var stdin_default$5 = defineComponent({
|
|
15973
15986
|
};
|
15974
15987
|
const onClickUpload = (event) => emit("clickUpload", event);
|
15975
15988
|
const renderUpload = () => {
|
15976
|
-
|
15977
|
-
return;
|
15978
|
-
}
|
15979
|
-
const hideUploader = props2.modelValue.length >= +props2.maxCount && props2.reupload;
|
15989
|
+
const lessThanMax = props2.modelValue.length < +props2.maxCount;
|
15980
15990
|
const Input = props2.readonly ? null : createVNode("input", {
|
15981
15991
|
"ref": inputRef,
|
15982
15992
|
"type": "file",
|
@@ -15992,7 +16002,7 @@ var stdin_default$5 = defineComponent({
|
|
15992
16002
|
return withDirectives(createVNode("div", {
|
15993
16003
|
"class": bem$1("input-wrapper"),
|
15994
16004
|
"onClick": onClickUpload
|
15995
|
-
}, [slots.default(), Input]), [[vShow,
|
16005
|
+
}, [slots.default(), Input]), [[vShow, lessThanMax]]);
|
15996
16006
|
}
|
15997
16007
|
return withDirectives(createVNode("div", {
|
15998
16008
|
"class": bem$1("upload", {
|
@@ -16005,7 +16015,7 @@ var stdin_default$5 = defineComponent({
|
|
16005
16015
|
"class": bem$1("upload-icon")
|
16006
16016
|
}, null), props2.uploadText && createVNode("span", {
|
16007
16017
|
"class": bem$1("upload-text")
|
16008
|
-
}, [props2.uploadText]), Input]), [[vShow, props2.showUpload &&
|
16018
|
+
}, [props2.uploadText]), Input]), [[vShow, props2.showUpload && lessThanMax]]);
|
16009
16019
|
};
|
16010
16020
|
const chooseFile = () => {
|
16011
16021
|
if (inputRef.value && !props2.disabled) {
|
@@ -16017,6 +16027,7 @@ var stdin_default$5 = defineComponent({
|
|
16017
16027
|
});
|
16018
16028
|
useExpose({
|
16019
16029
|
chooseFile,
|
16030
|
+
reuploadFile,
|
16020
16031
|
closeImagePreview
|
16021
16032
|
});
|
16022
16033
|
useCustomFieldValue(() => props2.modelValue);
|
@@ -17032,7 +17043,7 @@ const Lazyload = {
|
|
17032
17043
|
});
|
17033
17044
|
}
|
17034
17045
|
};
|
17035
|
-
const version = "4.9.
|
17046
|
+
const version = "4.9.3";
|
17036
17047
|
function install(app) {
|
17037
17048
|
const components = [
|
17038
17049
|
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
|
**/
|
@@ -2456,11 +2456,13 @@
|
|
2456
2456
|
let count = 0;
|
2457
2457
|
const from = scroller.scrollLeft;
|
2458
2458
|
const frames = duration === 0 ? 1 : Math.round(duration * 1e3 / 16);
|
2459
|
+
let scrollLeft = from;
|
2459
2460
|
function cancel() {
|
2460
2461
|
cancelRaf(rafId);
|
2461
2462
|
}
|
2462
2463
|
function animate() {
|
2463
|
-
|
2464
|
+
scrollLeft += (to - from) / frames;
|
2465
|
+
scroller.scrollLeft = scrollLeft;
|
2464
2466
|
if (++count < frames) {
|
2465
2467
|
rafId = raf(animate);
|
2466
2468
|
}
|
@@ -4283,6 +4285,7 @@
|
|
4283
4285
|
labelAlign: String,
|
4284
4286
|
inputAlign: String,
|
4285
4287
|
scrollToError: Boolean,
|
4288
|
+
scrollToErrorPosition: String,
|
4286
4289
|
validateFirst: Boolean,
|
4287
4290
|
submitOnEnter: truthProp,
|
4288
4291
|
showErrorMessage: truthProp,
|
@@ -4396,8 +4399,14 @@
|
|
4396
4399
|
values,
|
4397
4400
|
errors
|
4398
4401
|
});
|
4399
|
-
|
4400
|
-
|
4402
|
+
const {
|
4403
|
+
scrollToError,
|
4404
|
+
scrollToErrorPosition
|
4405
|
+
} = props2;
|
4406
|
+
if (scrollToError && errors[0].name) {
|
4407
|
+
scrollToField(errors[0].name, scrollToErrorPosition ? {
|
4408
|
+
block: scrollToErrorPosition
|
4409
|
+
} : void 0);
|
4401
4410
|
}
|
4402
4411
|
});
|
4403
4412
|
};
|
@@ -6789,11 +6798,17 @@
|
|
6789
6798
|
function getMonthByOffset(date, offset2) {
|
6790
6799
|
const cloned = cloneDate(date);
|
6791
6800
|
cloned.setMonth(cloned.getMonth() + offset2);
|
6801
|
+
if (cloned.getDate() !== date.getDate()) {
|
6802
|
+
cloned.setDate(0);
|
6803
|
+
}
|
6792
6804
|
return cloned;
|
6793
6805
|
}
|
6794
6806
|
function getYearByOffset(date, offset2) {
|
6795
6807
|
const cloned = cloneDate(date);
|
6796
6808
|
cloned.setFullYear(cloned.getFullYear() + offset2);
|
6809
|
+
if (cloned.getDate() !== date.getDate()) {
|
6810
|
+
cloned.setDate(0);
|
6811
|
+
}
|
6797
6812
|
return cloned;
|
6798
6813
|
}
|
6799
6814
|
const getPrevDay = (date) => getDayByOffset(date, -1);
|
@@ -7197,22 +7212,10 @@
|
|
7197
7212
|
slots,
|
7198
7213
|
emit
|
7199
7214
|
}) {
|
7200
|
-
const prevMonthDisabled = vue.computed(() =>
|
7201
|
-
|
7202
|
-
|
7203
|
-
|
7204
|
-
const prevYearDisabled = vue.computed(() => {
|
7205
|
-
const prevYear = getPrevYear(props2.date);
|
7206
|
-
return props2.minDate && prevYear < props2.minDate;
|
7207
|
-
});
|
7208
|
-
const nextMonthDisabled = vue.computed(() => {
|
7209
|
-
const nextMonth = getNextMonth(props2.date);
|
7210
|
-
return props2.maxDate && nextMonth > props2.maxDate;
|
7211
|
-
});
|
7212
|
-
const nextYearDisabled = vue.computed(() => {
|
7213
|
-
const nextYear = getNextYear(props2.date);
|
7214
|
-
return props2.maxDate && nextYear > props2.maxDate;
|
7215
|
-
});
|
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);
|
7216
7219
|
const renderTitle = () => {
|
7217
7220
|
if (props2.showTitle) {
|
7218
7221
|
const text = props2.title || t$g("title");
|
@@ -7978,9 +7981,9 @@
|
|
7978
7981
|
"class": bem$11("price-currency")
|
7979
7982
|
}, [props2.currency]), vue.createVNode("span", {
|
7980
7983
|
"class": bem$11("price-integer")
|
7981
|
-
}, [priceArr[0]]), vue.createTextVNode("."), vue.createVNode("span", {
|
7984
|
+
}, [priceArr[0]]), priceArr.length > 1 && vue.createVNode(vue.Fragment, null, [vue.createTextVNode("."), vue.createVNode("span", {
|
7982
7985
|
"class": bem$11("price-decimal")
|
7983
|
-
}, [priceArr[1]])]);
|
7986
|
+
}, [priceArr[1]])])]);
|
7984
7987
|
};
|
7985
7988
|
return () => {
|
7986
7989
|
var _a, _b, _c;
|
@@ -16461,10 +16464,11 @@
|
|
16461
16464
|
emit,
|
16462
16465
|
slots
|
16463
16466
|
}) {
|
16464
|
-
const text = vue.ref(
|
16467
|
+
const text = vue.ref(props2.content);
|
16465
16468
|
const expanded = vue.ref(false);
|
16466
16469
|
const hasAction = vue.ref(false);
|
16467
16470
|
const root = vue.ref();
|
16471
|
+
const actionRef = vue.ref();
|
16468
16472
|
let needRecalculate = false;
|
16469
16473
|
const actionText = vue.computed(() => expanded.value ? props2.collapseText : props2.expandText);
|
16470
16474
|
const pxToNum = (value) => {
|
@@ -16492,57 +16496,60 @@
|
|
16492
16496
|
document.body.appendChild(container);
|
16493
16497
|
return container;
|
16494
16498
|
};
|
16495
|
-
const
|
16496
|
-
|
16497
|
-
|
16498
|
-
|
16499
|
-
|
16500
|
-
|
16501
|
-
|
16502
|
-
|
16503
|
-
|
16504
|
-
|
16505
|
-
|
16506
|
-
|
16507
|
-
|
16508
|
-
}
|
16509
|
-
return dots + content.slice(right2, end2);
|
16510
|
-
}
|
16511
|
-
const middle2 = Math.round((left2 + right2) / 2);
|
16499
|
+
const calcEllipsisText = (container, maxHeight) => {
|
16500
|
+
var _a, _b;
|
16501
|
+
const {
|
16502
|
+
content,
|
16503
|
+
position,
|
16504
|
+
dots
|
16505
|
+
} = props2;
|
16506
|
+
const end2 = content.length;
|
16507
|
+
const middle = 0 + end2 >> 1;
|
16508
|
+
const actionHTML = slots.action ? (_b = (_a = actionRef.value) == null ? void 0 : _a.outerHTML) != null ? _b : "" : props2.expandText;
|
16509
|
+
const calcEllipse = () => {
|
16510
|
+
const tail = (left2, right2) => {
|
16511
|
+
if (right2 - left2 <= 1) {
|
16512
16512
|
if (position === "end") {
|
16513
|
-
|
16514
|
-
} else {
|
16515
|
-
container2.innerText = dots + content.slice(middle2, end2) + actionText.value;
|
16516
|
-
}
|
16517
|
-
if (container2.offsetHeight > maxHeight2) {
|
16518
|
-
if (position === "end") {
|
16519
|
-
return tail(left2, middle2);
|
16520
|
-
}
|
16521
|
-
return tail(middle2, right2);
|
16513
|
+
return content.slice(0, left2) + dots;
|
16522
16514
|
}
|
16515
|
+
return dots + content.slice(right2, end2);
|
16516
|
+
}
|
16517
|
+
const middle2 = Math.round((left2 + right2) / 2);
|
16518
|
+
if (position === "end") {
|
16519
|
+
container.innerText = content.slice(0, middle2) + dots;
|
16520
|
+
} else {
|
16521
|
+
container.innerText = dots + content.slice(middle2, end2);
|
16522
|
+
}
|
16523
|
+
container.innerHTML += actionHTML;
|
16524
|
+
if (container.offsetHeight > maxHeight) {
|
16523
16525
|
if (position === "end") {
|
16524
|
-
return tail(
|
16526
|
+
return tail(left2, middle2);
|
16525
16527
|
}
|
16526
|
-
return tail(
|
16527
|
-
};
|
16528
|
-
container2.innerText = tail(0, end2);
|
16529
|
-
};
|
16530
|
-
const middleTail = (leftPart, rightPart) => {
|
16531
|
-
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
16532
|
-
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end2);
|
16528
|
+
return tail(middle2, right2);
|
16533
16529
|
}
|
16534
|
-
|
16535
|
-
|
16536
|
-
container2.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end2) + props2.expandText;
|
16537
|
-
if (container2.offsetHeight >= maxHeight2) {
|
16538
|
-
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
16530
|
+
if (position === "end") {
|
16531
|
+
return tail(middle2, right2);
|
16539
16532
|
}
|
16540
|
-
return
|
16533
|
+
return tail(left2, middle2);
|
16541
16534
|
};
|
16542
|
-
|
16543
|
-
|
16544
|
-
|
16535
|
+
return tail(0, end2);
|
16536
|
+
};
|
16537
|
+
const middleTail = (leftPart, rightPart) => {
|
16538
|
+
if (leftPart[1] - leftPart[0] <= 1 && rightPart[1] - rightPart[0] <= 1) {
|
16539
|
+
return content.slice(0, leftPart[0]) + dots + content.slice(rightPart[1], end2);
|
16540
|
+
}
|
16541
|
+
const leftMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
16542
|
+
const rightMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
16543
|
+
container.innerText = props2.content.slice(0, leftMiddle) + props2.dots + props2.content.slice(rightMiddle, end2);
|
16544
|
+
container.innerHTML += actionHTML;
|
16545
|
+
if (container.offsetHeight >= maxHeight) {
|
16546
|
+
return middleTail([leftPart[0], leftMiddle], [rightMiddle, rightPart[1]]);
|
16547
|
+
}
|
16548
|
+
return middleTail([leftMiddle, leftPart[1]], [rightPart[0], rightMiddle]);
|
16545
16549
|
};
|
16550
|
+
return props2.position === "middle" ? middleTail([0, middle], [middle, end2]) : calcEllipse();
|
16551
|
+
};
|
16552
|
+
const calcEllipsised = () => {
|
16546
16553
|
const container = cloneContainer();
|
16547
16554
|
if (!container) {
|
16548
16555
|
needRecalculate = true;
|
@@ -16575,11 +16582,17 @@
|
|
16575
16582
|
expanded: expanded.value
|
16576
16583
|
}) : actionText.value;
|
16577
16584
|
return vue.createVNode("span", {
|
16585
|
+
"ref": actionRef,
|
16578
16586
|
"class": bem$3("action"),
|
16579
16587
|
"onClick": onClickAction
|
16580
16588
|
}, [action]);
|
16581
16589
|
};
|
16582
|
-
vue.onMounted(
|
16590
|
+
vue.onMounted(() => {
|
16591
|
+
calcEllipsised();
|
16592
|
+
if (slots.action) {
|
16593
|
+
vue.nextTick(calcEllipsised);
|
16594
|
+
}
|
16595
|
+
});
|
16583
16596
|
vue.onActivated(() => {
|
16584
16597
|
if (needRecalculate) {
|
16585
16598
|
needRecalculate = false;
|
@@ -17175,7 +17188,7 @@
|
|
17175
17188
|
emit("update:modelValue", fileList);
|
17176
17189
|
emit("delete", item, getDetail(index));
|
17177
17190
|
};
|
17178
|
-
const
|
17191
|
+
const reuploadFile = (index) => {
|
17179
17192
|
isReuploading.value = true;
|
17180
17193
|
reuploadIndex.value = index;
|
17181
17194
|
vue.nextTick(() => chooseFile());
|
@@ -17195,7 +17208,7 @@
|
|
17195
17208
|
"onClick": () => emit(props2.reupload ? "clickReupload" : "clickPreview", item, getDetail(index)),
|
17196
17209
|
"onDelete": () => deleteFile(item, index),
|
17197
17210
|
"onPreview": () => previewImage(item),
|
17198
|
-
"onReupload": () =>
|
17211
|
+
"onReupload": () => reuploadFile(index)
|
17199
17212
|
}, pick(props2, ["name", "lazyLoad"]), previewData), pick(slots, ["preview-cover", "preview-delete"]));
|
17200
17213
|
};
|
17201
17214
|
const renderPreviewList = () => {
|
@@ -17205,10 +17218,7 @@
|
|
17205
17218
|
};
|
17206
17219
|
const onClickUpload = (event) => emit("clickUpload", event);
|
17207
17220
|
const renderUpload = () => {
|
17208
|
-
|
17209
|
-
return;
|
17210
|
-
}
|
17211
|
-
const hideUploader = props2.modelValue.length >= +props2.maxCount && props2.reupload;
|
17221
|
+
const lessThanMax = props2.modelValue.length < +props2.maxCount;
|
17212
17222
|
const Input = props2.readonly ? null : vue.createVNode("input", {
|
17213
17223
|
"ref": inputRef,
|
17214
17224
|
"type": "file",
|
@@ -17224,7 +17234,7 @@
|
|
17224
17234
|
return vue.withDirectives(vue.createVNode("div", {
|
17225
17235
|
"class": bem$1("input-wrapper"),
|
17226
17236
|
"onClick": onClickUpload
|
17227
|
-
}, [slots.default(), Input]), [[vue.vShow,
|
17237
|
+
}, [slots.default(), Input]), [[vue.vShow, lessThanMax]]);
|
17228
17238
|
}
|
17229
17239
|
return vue.withDirectives(vue.createVNode("div", {
|
17230
17240
|
"class": bem$1("upload", {
|
@@ -17237,7 +17247,7 @@
|
|
17237
17247
|
"class": bem$1("upload-icon")
|
17238
17248
|
}, null), props2.uploadText && vue.createVNode("span", {
|
17239
17249
|
"class": bem$1("upload-text")
|
17240
|
-
}, [props2.uploadText]), Input]), [[vue.vShow, props2.showUpload &&
|
17250
|
+
}, [props2.uploadText]), Input]), [[vue.vShow, props2.showUpload && lessThanMax]]);
|
17241
17251
|
};
|
17242
17252
|
const chooseFile = () => {
|
17243
17253
|
if (inputRef.value && !props2.disabled) {
|
@@ -17249,6 +17259,7 @@
|
|
17249
17259
|
});
|
17250
17260
|
useExpose({
|
17251
17261
|
chooseFile,
|
17262
|
+
reuploadFile,
|
17252
17263
|
closeImagePreview
|
17253
17264
|
});
|
17254
17265
|
useCustomFieldValue(() => props2.modelValue);
|
@@ -18247,7 +18258,7 @@
|
|
18247
18258
|
});
|
18248
18259
|
}
|
18249
18260
|
};
|
18250
|
-
const version = "4.9.
|
18261
|
+
const version = "4.9.3";
|
18251
18262
|
function install(app) {
|
18252
18263
|
const components = [
|
18253
18264
|
ActionBar,
|