vant 4.0.0-rc.4 → 4.0.0-rc.6
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/Calendar.mjs +10 -3
- package/es/calendar/CalendarHeader.d.ts +2 -0
- package/es/calendar/CalendarHeader.mjs +5 -1
- package/es/cell/Cell.d.ts +17 -0
- package/es/cell/Cell.mjs +11 -4
- package/es/cell/index.d.ts +9 -0
- package/es/collapse-item/CollapseItem.d.ts +13 -0
- package/es/collapse-item/index.d.ts +9 -0
- package/es/coupon/index.css +1 -1
- package/es/coupon-list/index.css +1 -1
- package/es/date-picker/DatePicker.mjs +4 -1
- package/es/date-picker/utils.d.ts +1 -0
- package/es/date-picker/utils.mjs +11 -0
- package/es/field/Field.d.ts +13 -0
- package/es/field/Field.mjs +3 -3
- package/es/field/index.css +1 -1
- package/es/field/index.d.ts +9 -0
- package/es/field/types.d.ts +1 -1
- package/es/image-preview/ImagePreview.mjs +3 -1
- package/es/image-preview/ImagePreviewItem.mjs +7 -2
- package/es/image-preview/index.css +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/loading/Loading.mjs +8 -4
- package/es/nav-bar/NavBar.d.ts +13 -0
- package/es/nav-bar/NavBar.mjs +4 -3
- package/es/nav-bar/index.d.ts +9 -0
- package/es/stepper/Stepper.d.ts +13 -0
- package/es/stepper/Stepper.mjs +4 -3
- package/es/stepper/index.d.ts +9 -0
- package/es/swipe/Swipe.mjs +1 -1
- package/es/tabs/Tabs.mjs +44 -41
- package/es/time-picker/TimePicker.mjs +4 -3
- package/es/toast/Toast.d.ts +4 -1
- package/es/toast/Toast.mjs +2 -1
- package/es/toast/index.css +1 -1
- package/es/toast/index.d.ts +3 -1
- package/es/toast/types.d.ts +2 -0
- package/lib/calendar/Calendar.js +10 -3
- package/lib/calendar/CalendarHeader.d.ts +2 -0
- package/lib/calendar/CalendarHeader.js +5 -1
- package/lib/cell/Cell.d.ts +17 -0
- package/lib/cell/Cell.js +10 -3
- package/lib/cell/index.d.ts +9 -0
- package/lib/collapse-item/CollapseItem.d.ts +13 -0
- package/lib/collapse-item/index.d.ts +9 -0
- package/lib/coupon/index.css +1 -1
- package/lib/coupon-list/index.css +1 -1
- package/lib/date-picker/DatePicker.js +3 -0
- package/lib/date-picker/utils.d.ts +1 -0
- package/lib/date-picker/utils.js +11 -0
- package/lib/field/Field.d.ts +13 -0
- package/lib/field/Field.js +3 -3
- package/lib/field/index.css +1 -1
- package/lib/field/index.d.ts +9 -0
- package/lib/field/types.d.ts +1 -1
- package/lib/image-preview/ImagePreview.js +3 -1
- package/lib/image-preview/ImagePreviewItem.js +7 -2
- package/lib/image-preview/index.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/loading/Loading.js +8 -4
- package/lib/nav-bar/NavBar.d.ts +13 -0
- package/lib/nav-bar/NavBar.js +4 -3
- package/lib/nav-bar/index.d.ts +9 -0
- package/lib/stepper/Stepper.d.ts +13 -0
- package/lib/stepper/Stepper.js +4 -3
- package/lib/stepper/index.d.ts +9 -0
- package/lib/swipe/Swipe.js +1 -1
- package/lib/tabs/Tabs.js +44 -41
- package/lib/time-picker/TimePicker.js +3 -2
- package/lib/toast/Toast.d.ts +4 -1
- package/lib/toast/Toast.js +2 -1
- package/lib/toast/index.css +1 -1
- package/lib/toast/index.d.ts +3 -1
- package/lib/toast/types.d.ts +2 -0
- package/lib/vant.cjs.js +118 -69
- package/lib/vant.es.js +118 -69
- package/lib/vant.js +118 -69
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +671 -633
- package/package.json +2 -2
- package/changelog.generated.md +0 -59
package/lib/vant.es.js
CHANGED
@@ -737,6 +737,13 @@ var stdin_default$1z = defineComponent({
|
|
737
737
|
const spinnerStyle = computed(() => extend({
|
738
738
|
color: props.color
|
739
739
|
}, getSizeStyle(props.size)));
|
740
|
+
const renderIcon = () => {
|
741
|
+
const DefaultIcon = props.type === "spinner" ? SpinIcon : CircularIcon;
|
742
|
+
return createVNode("span", {
|
743
|
+
"class": bem$1n("spinner", props.type),
|
744
|
+
"style": spinnerStyle.value
|
745
|
+
}, [slots.icon ? slots.icon() : DefaultIcon]);
|
746
|
+
};
|
740
747
|
const renderText = () => {
|
741
748
|
var _a;
|
742
749
|
if (slots.default) {
|
@@ -760,10 +767,7 @@ var stdin_default$1z = defineComponent({
|
|
760
767
|
}]),
|
761
768
|
"aria-live": "polite",
|
762
769
|
"aria-busy": true
|
763
|
-
}, [
|
764
|
-
"class": bem$1n("spinner", type),
|
765
|
-
"style": spinnerStyle.value
|
766
|
-
}, [type === "spinner" ? SpinIcon : CircularIcon]), renderText()]);
|
770
|
+
}, [renderIcon(), renderText()]);
|
767
771
|
};
|
768
772
|
}
|
769
773
|
});
|
@@ -2150,7 +2154,7 @@ var stdin_default$1o = defineComponent({
|
|
2150
2154
|
}
|
2151
2155
|
return 0;
|
2152
2156
|
});
|
2153
|
-
const maxCount = computed(() => Math.ceil(Math.abs(minOffset.value) / size.value));
|
2157
|
+
const maxCount = computed(() => size.value ? Math.ceil(Math.abs(minOffset.value) / size.value) : count.value);
|
2154
2158
|
const trackSize = computed(() => count.value * size.value);
|
2155
2159
|
const activeIndicator = computed(() => (state.active + count.value) % count.value);
|
2156
2160
|
const isCorrectDirection = computed(() => {
|
@@ -2641,17 +2645,19 @@ var stdin_default$1m = defineComponent({
|
|
2641
2645
|
const newTab = children[newIndex];
|
2642
2646
|
const newName = getTabName(newTab, newIndex);
|
2643
2647
|
const shouldEmitChange = state.currentIndex !== null;
|
2644
|
-
state.currentIndex
|
2648
|
+
if (state.currentIndex !== newIndex) {
|
2649
|
+
state.currentIndex = newIndex;
|
2650
|
+
if (!skipScrollIntoView) {
|
2651
|
+
scrollIntoView();
|
2652
|
+
}
|
2653
|
+
setLine();
|
2654
|
+
}
|
2645
2655
|
if (newName !== props.active) {
|
2646
2656
|
emit("update:active", newName);
|
2647
2657
|
if (shouldEmitChange) {
|
2648
2658
|
emit("change", newName, newTab.title);
|
2649
2659
|
}
|
2650
2660
|
}
|
2651
|
-
if (!skipScrollIntoView) {
|
2652
|
-
scrollIntoView();
|
2653
|
-
}
|
2654
|
-
setLine();
|
2655
2661
|
if (stickyFixed && !props.scrollspy) {
|
2656
2662
|
setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
|
2657
2663
|
}
|
@@ -2750,13 +2756,14 @@ var stdin_default$1m = defineComponent({
|
|
2750
2756
|
}
|
2751
2757
|
};
|
2752
2758
|
const renderHeader = () => {
|
2753
|
-
var _a, _b;
|
2759
|
+
var _a, _b, _c;
|
2754
2760
|
const {
|
2755
2761
|
type,
|
2756
|
-
border
|
2762
|
+
border,
|
2763
|
+
sticky
|
2757
2764
|
} = props;
|
2758
|
-
|
2759
|
-
"ref": wrapRef,
|
2765
|
+
const Header = [createVNode("div", {
|
2766
|
+
"ref": sticky ? void 0 : wrapRef,
|
2760
2767
|
"class": [bem$1a("wrap"), {
|
2761
2768
|
[BORDER_TOP_BOTTOM]: type === "line" && border
|
2762
2769
|
}]
|
@@ -2769,7 +2776,13 @@ var stdin_default$1m = defineComponent({
|
|
2769
2776
|
}]),
|
2770
2777
|
"style": navStyle.value,
|
2771
2778
|
"aria-orientation": "horizontal"
|
2772
|
-
}, [(_a = slots["nav-left"]) == null ? void 0 : _a.call(slots), renderNav(), renderLine(), (_b = slots["nav-right"]) == null ? void 0 : _b.call(slots)])]);
|
2779
|
+
}, [(_a = slots["nav-left"]) == null ? void 0 : _a.call(slots), renderNav(), renderLine(), (_b = slots["nav-right"]) == null ? void 0 : _b.call(slots)])]), (_c = slots["nav-bottom"]) == null ? void 0 : _c.call(slots)];
|
2780
|
+
if (sticky) {
|
2781
|
+
return createVNode("div", {
|
2782
|
+
"ref": wrapRef
|
2783
|
+
}, [Header]);
|
2784
|
+
}
|
2785
|
+
return Header;
|
2773
2786
|
};
|
2774
2787
|
watch([() => props.color, windowWidth], setLine);
|
2775
2788
|
watch(() => props.active, (value) => {
|
@@ -2823,37 +2836,31 @@ var stdin_default$1m = defineComponent({
|
|
2823
2836
|
currentName,
|
2824
2837
|
scrollIntoView
|
2825
2838
|
});
|
2826
|
-
return () => {
|
2827
|
-
|
2828
|
-
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
2832
|
-
|
2833
|
-
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
2837
|
-
|
2838
|
-
|
2839
|
-
|
2840
|
-
|
2841
|
-
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
|
2846
|
-
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2850
|
-
|
2851
|
-
default: () => {
|
2852
|
-
var _a2;
|
2853
|
-
return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
|
2854
|
-
}
|
2855
|
-
})]);
|
2856
|
-
};
|
2839
|
+
return () => createVNode("div", {
|
2840
|
+
"ref": root,
|
2841
|
+
"class": bem$1a([props.type])
|
2842
|
+
}, [props.sticky ? createVNode(Sticky, {
|
2843
|
+
"container": root.value,
|
2844
|
+
"offsetTop": offsetTopPx.value,
|
2845
|
+
"onScroll": onStickyScroll
|
2846
|
+
}, {
|
2847
|
+
default: () => [renderHeader()]
|
2848
|
+
}) : renderHeader(), createVNode(stdin_default$1n, {
|
2849
|
+
"ref": contentRef,
|
2850
|
+
"count": children.length,
|
2851
|
+
"inited": state.inited,
|
2852
|
+
"animated": props.animated,
|
2853
|
+
"duration": props.duration,
|
2854
|
+
"swipeable": props.swipeable,
|
2855
|
+
"lazyRender": props.lazyRender,
|
2856
|
+
"currentIndex": state.currentIndex,
|
2857
|
+
"onChange": setCurrentIndex
|
2858
|
+
}, {
|
2859
|
+
default: () => {
|
2860
|
+
var _a;
|
2861
|
+
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
2862
|
+
}
|
2863
|
+
})]);
|
2857
2864
|
}
|
2858
2865
|
});
|
2859
2866
|
const TAB_STATUS_KEY = Symbol();
|
@@ -3425,6 +3432,7 @@ var stdin_default$1h = defineComponent({
|
|
3425
3432
|
const Area = withInstall(stdin_default$1h);
|
3426
3433
|
const [name$19, bem$15] = createNamespace("cell");
|
3427
3434
|
const cellSharedProps = {
|
3435
|
+
tag: makeStringProp("div"),
|
3428
3436
|
icon: String,
|
3429
3437
|
size: String,
|
3430
3438
|
title: numericProp,
|
@@ -3503,8 +3511,9 @@ var stdin_default$1g = defineComponent({
|
|
3503
3511
|
}
|
3504
3512
|
};
|
3505
3513
|
return () => {
|
3506
|
-
var _a
|
3514
|
+
var _a;
|
3507
3515
|
const {
|
3516
|
+
tag,
|
3508
3517
|
size,
|
3509
3518
|
center,
|
3510
3519
|
border,
|
@@ -3521,12 +3530,17 @@ var stdin_default$1g = defineComponent({
|
|
3521
3530
|
if (size) {
|
3522
3531
|
classes[size] = !!size;
|
3523
3532
|
}
|
3524
|
-
return createVNode(
|
3533
|
+
return createVNode(tag, {
|
3525
3534
|
"class": bem$15(classes),
|
3526
3535
|
"role": clickable ? "button" : void 0,
|
3527
3536
|
"tabindex": clickable ? 0 : void 0,
|
3528
3537
|
"onClick": route2
|
3529
|
-
},
|
3538
|
+
}, {
|
3539
|
+
default: () => {
|
3540
|
+
var _a2;
|
3541
|
+
return [renderLeftIcon(), renderTitle(), renderValue(), renderRightIcon(), (_a2 = slots.extra) == null ? void 0 : _a2.call(slots)];
|
3542
|
+
}
|
3543
|
+
});
|
3530
3544
|
};
|
3531
3545
|
}
|
3532
3546
|
});
|
@@ -4189,9 +4203,9 @@ var stdin_default$1e = defineComponent({
|
|
4189
4203
|
const labelAlign = getProp("labelAlign");
|
4190
4204
|
const Label = renderLabel();
|
4191
4205
|
const LeftIcon = renderLeftIcon();
|
4206
|
+
const renderTitle = () => labelAlign === "top" ? [LeftIcon, Label] : Label;
|
4192
4207
|
return createVNode(Cell, {
|
4193
4208
|
"size": props.size,
|
4194
|
-
"icon": props.leftIcon,
|
4195
4209
|
"class": bem$13({
|
4196
4210
|
error: showError.value,
|
4197
4211
|
disabled,
|
@@ -4208,8 +4222,8 @@ var stdin_default$1e = defineComponent({
|
|
4208
4222
|
}]), props.labelClass],
|
4209
4223
|
"arrowDirection": props.arrowDirection
|
4210
4224
|
}, {
|
4211
|
-
icon: LeftIcon ? () => LeftIcon : null,
|
4212
|
-
title: Label
|
4225
|
+
icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
|
4226
|
+
title: Label || labelAlign === "top" ? renderTitle : null,
|
4213
4227
|
value: renderFieldBody,
|
4214
4228
|
extra: slots.extra
|
4215
4229
|
});
|
@@ -4243,6 +4257,7 @@ const toastProps = {
|
|
4243
4257
|
duration: makeNumberProp(2e3),
|
4244
4258
|
position: makeStringProp("middle"),
|
4245
4259
|
teleport: [String, Object],
|
4260
|
+
wordBreak: String,
|
4246
4261
|
className: unknownProp,
|
4247
4262
|
iconPrefix: String,
|
4248
4263
|
transition: makeStringProp("van-fade"),
|
@@ -4334,7 +4349,7 @@ var stdin_default$1d = defineComponent({
|
|
4334
4349
|
onMounted(toggleClickable);
|
4335
4350
|
onUnmounted(toggleClickable);
|
4336
4351
|
return () => createVNode(Popup, mergeProps({
|
4337
|
-
"class": [bem$12([props.position, {
|
4352
|
+
"class": [bem$12([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
|
4338
4353
|
[props.type]: !props.icon
|
4339
4354
|
}]), props.className],
|
4340
4355
|
"lockScroll": false,
|
@@ -5397,6 +5412,16 @@ const genOptions = (min, max, type, formatter, filter) => {
|
|
5397
5412
|
});
|
5398
5413
|
return filter ? filter(type, options) : options;
|
5399
5414
|
};
|
5415
|
+
const formatValueRange = (values, columns) => values.map((value, index) => {
|
5416
|
+
const column = columns[index];
|
5417
|
+
if (column.length) {
|
5418
|
+
const maxValue = +column[column.length - 1].value;
|
5419
|
+
if (+value > maxValue) {
|
5420
|
+
return String(maxValue);
|
5421
|
+
}
|
5422
|
+
}
|
5423
|
+
return value;
|
5424
|
+
});
|
5400
5425
|
const [name$Y] = createNamespace("calendar-day");
|
5401
5426
|
var stdin_default$13 = defineComponent({
|
5402
5427
|
name: name$Y,
|
@@ -5719,6 +5744,7 @@ const [name$W] = createNamespace("calendar-header");
|
|
5719
5744
|
var stdin_default$11 = defineComponent({
|
5720
5745
|
name: name$W,
|
5721
5746
|
props: {
|
5747
|
+
date: Date,
|
5722
5748
|
title: String,
|
5723
5749
|
subtitle: String,
|
5724
5750
|
showTitle: Boolean,
|
@@ -5742,7 +5768,10 @@ var stdin_default$11 = defineComponent({
|
|
5742
5768
|
const onClickSubtitle = (event) => emit("clickSubtitle", event);
|
5743
5769
|
const renderSubtitle = () => {
|
5744
5770
|
if (props.showSubtitle) {
|
5745
|
-
const title = slots.subtitle ? slots.subtitle(
|
5771
|
+
const title = slots.subtitle ? slots.subtitle({
|
5772
|
+
date: props.date,
|
5773
|
+
text: props.subtitle
|
5774
|
+
}) : props.subtitle;
|
5746
5775
|
return createVNode("div", {
|
5747
5776
|
"class": bem$V("header-subtitle"),
|
5748
5777
|
"onClick": onClickSubtitle
|
@@ -5862,7 +5891,10 @@ var stdin_default$10 = defineComponent({
|
|
5862
5891
|
};
|
5863
5892
|
let bodyHeight;
|
5864
5893
|
const bodyRef = ref();
|
5865
|
-
const subtitle = ref(
|
5894
|
+
const subtitle = ref({
|
5895
|
+
text: "",
|
5896
|
+
date: void 0
|
5897
|
+
});
|
5866
5898
|
const currentDate = ref(getInitialDate());
|
5867
5899
|
const [monthRefs, setMonthRefs] = useRefs();
|
5868
5900
|
const dayOffset = computed(() => props.firstDayOfWeek ? +props.firstDayOfWeek % 7 : 0);
|
@@ -5923,7 +5955,10 @@ var stdin_default$10 = defineComponent({
|
|
5923
5955
|
monthRefs.value[index].setVisible(visible);
|
5924
5956
|
});
|
5925
5957
|
if (currentMonth) {
|
5926
|
-
subtitle.value =
|
5958
|
+
subtitle.value = {
|
5959
|
+
text: currentMonth.getTitle(),
|
5960
|
+
date: currentMonth.date
|
5961
|
+
};
|
5927
5962
|
}
|
5928
5963
|
};
|
5929
5964
|
const scrollToDate = (targetDate) => {
|
@@ -6113,8 +6148,9 @@ var stdin_default$10 = defineComponent({
|
|
6113
6148
|
const renderCalendar = () => createVNode("div", {
|
6114
6149
|
"class": bem$V()
|
6115
6150
|
}, [createVNode(stdin_default$11, {
|
6151
|
+
"date": subtitle.value.date,
|
6116
6152
|
"title": props.title,
|
6117
|
-
"subtitle": subtitle.value,
|
6153
|
+
"subtitle": subtitle.value.text,
|
6118
6154
|
"showTitle": props.showTitle,
|
6119
6155
|
"showSubtitle": props.showSubtitle,
|
6120
6156
|
"firstDayOfWeek": dayOffset.value,
|
@@ -8332,9 +8368,12 @@ var stdin_default$I = defineComponent({
|
|
8332
8368
|
}
|
8333
8369
|
});
|
8334
8370
|
watch(() => props.modelValue, (newValues) => {
|
8371
|
+
newValues = formatValueRange(newValues, columns.value);
|
8335
8372
|
if (!isSameValue(newValues, currentValues.value)) {
|
8336
8373
|
currentValues.value = newValues;
|
8337
8374
|
}
|
8375
|
+
}, {
|
8376
|
+
immediate: true
|
8338
8377
|
});
|
8339
8378
|
const onChange = (...args) => emit("change", ...args);
|
8340
8379
|
const onCancel = (...args) => emit("cancel", ...args);
|
@@ -9142,7 +9181,8 @@ var stdin_default$B = defineComponent({
|
|
9142
9181
|
},
|
9143
9182
|
emits: ["scale", "close"],
|
9144
9183
|
setup(props, {
|
9145
|
-
emit
|
9184
|
+
emit,
|
9185
|
+
slots
|
9146
9186
|
}) {
|
9147
9187
|
const state = reactive({
|
9148
9188
|
scale: 1,
|
@@ -9360,7 +9400,11 @@ var stdin_default$B = defineComponent({
|
|
9360
9400
|
"onTouchend": onTouchEnd,
|
9361
9401
|
"onTouchcancel": onTouchEnd
|
9362
9402
|
}, {
|
9363
|
-
default: () => [createVNode(
|
9403
|
+
default: () => [slots.image ? createVNode("div", {
|
9404
|
+
"class": bem$v("image-wrap")
|
9405
|
+
}, [slots.image({
|
9406
|
+
src: props.src
|
9407
|
+
})]) : createVNode(Image$1, {
|
9364
9408
|
"src": props.src,
|
9365
9409
|
"fit": "contain",
|
9366
9410
|
"class": bem$v("image", {
|
@@ -9469,7 +9513,9 @@ var stdin_default$A = defineComponent({
|
|
9469
9513
|
"rootHeight": state.rootHeight,
|
9470
9514
|
"onScale": emitScale,
|
9471
9515
|
"onClose": emitClose
|
9472
|
-
},
|
9516
|
+
}, {
|
9517
|
+
image: slots.image
|
9518
|
+
}))]
|
9473
9519
|
});
|
9474
9520
|
const renderClose = () => {
|
9475
9521
|
if (props.closeable) {
|
@@ -10015,7 +10061,8 @@ const navBarProps = {
|
|
10015
10061
|
rightText: String,
|
10016
10062
|
leftArrow: Boolean,
|
10017
10063
|
placeholder: Boolean,
|
10018
|
-
safeAreaInsetTop: Boolean
|
10064
|
+
safeAreaInsetTop: Boolean,
|
10065
|
+
clickable: truthProp
|
10019
10066
|
};
|
10020
10067
|
var stdin_default$w = defineComponent({
|
10021
10068
|
name: name$r,
|
@@ -10070,12 +10117,12 @@ var stdin_default$w = defineComponent({
|
|
10070
10117
|
}, [createVNode("div", {
|
10071
10118
|
"class": bem$q("content")
|
10072
10119
|
}, [hasLeft && createVNode("div", {
|
10073
|
-
"class": [bem$q("left"), HAPTICS_FEEDBACK],
|
10120
|
+
"class": [bem$q("left"), props.clickable ? HAPTICS_FEEDBACK : ""],
|
10074
10121
|
"onClick": onClickLeft
|
10075
10122
|
}, [renderLeft()]), createVNode("div", {
|
10076
10123
|
"class": [bem$q("title"), "van-ellipsis"]
|
10077
10124
|
}, [slots.title ? slots.title() : title]), hasRight && createVNode("div", {
|
10078
|
-
"class": [bem$q("right"), HAPTICS_FEEDBACK],
|
10125
|
+
"class": [bem$q("right"), props.clickable ? HAPTICS_FEEDBACK : ""],
|
10079
10126
|
"onClick": onClickRight
|
10080
10127
|
}, [renderRight()])])]);
|
10081
10128
|
};
|
@@ -12408,6 +12455,7 @@ const stepperProps = {
|
|
12408
12455
|
showMinus: truthProp,
|
12409
12456
|
showInput: truthProp,
|
12410
12457
|
longPress: truthProp,
|
12458
|
+
autoFixed: truthProp,
|
12411
12459
|
allowEmpty: Boolean,
|
12412
12460
|
modelValue: numericProp,
|
12413
12461
|
inputWidth: numericProp,
|
@@ -12427,7 +12475,7 @@ var stdin_default$c = defineComponent({
|
|
12427
12475
|
setup(props, {
|
12428
12476
|
emit
|
12429
12477
|
}) {
|
12430
|
-
const format2 = (value) => {
|
12478
|
+
const format2 = (value, autoFixed = true) => {
|
12431
12479
|
const {
|
12432
12480
|
min,
|
12433
12481
|
max,
|
@@ -12440,7 +12488,7 @@ var stdin_default$c = defineComponent({
|
|
12440
12488
|
value = formatNumber(String(value), !props.integer);
|
12441
12489
|
value = value === "" ? 0 : +value;
|
12442
12490
|
value = Number.isNaN(value) ? +min : value;
|
12443
|
-
value = Math.max(Math.min(+max, value), +min);
|
12491
|
+
value = autoFixed ? Math.max(Math.min(+max, value), +min) : value;
|
12444
12492
|
if (isDef(decimalLength)) {
|
12445
12493
|
value = value.toFixed(+decimalLength);
|
12446
12494
|
}
|
@@ -12524,7 +12572,7 @@ var stdin_default$c = defineComponent({
|
|
12524
12572
|
};
|
12525
12573
|
const onBlur = (event) => {
|
12526
12574
|
const input = event.target;
|
12527
|
-
const value = format2(input.value);
|
12575
|
+
const value = format2(input.value, props.autoFixed);
|
12528
12576
|
input.value = String(value);
|
12529
12577
|
current2.value = value;
|
12530
12578
|
nextTick(() => {
|
@@ -13123,13 +13171,14 @@ var stdin_default$7 = defineComponent({
|
|
13123
13171
|
if (!isSameValue(newValues, props.modelValue)) {
|
13124
13172
|
emit("update:modelValue", newValues);
|
13125
13173
|
}
|
13126
|
-
}, {
|
13127
|
-
immediate: true
|
13128
13174
|
});
|
13129
13175
|
watch(() => props.modelValue, (newValues) => {
|
13176
|
+
newValues = formatValueRange(newValues, columns.value);
|
13130
13177
|
if (!isSameValue(newValues, currentValues.value)) {
|
13131
13178
|
currentValues.value = newValues;
|
13132
13179
|
}
|
13180
|
+
}, {
|
13181
|
+
immediate: true
|
13133
13182
|
});
|
13134
13183
|
const onChange = (...args) => emit("change", ...args);
|
13135
13184
|
const onCancel = (...args) => emit("cancel", ...args);
|
@@ -14550,7 +14599,7 @@ const Lazyload = {
|
|
14550
14599
|
});
|
14551
14600
|
}
|
14552
14601
|
};
|
14553
|
-
const version = "4.0.0-rc.
|
14602
|
+
const version = "4.0.0-rc.6";
|
14554
14603
|
function install(app) {
|
14555
14604
|
const components = [
|
14556
14605
|
ActionBar,
|