vant 4.0.0-rc.4 → 4.0.0-rc.5
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/changelog.generated.md +39 -27
- 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.mjs +3 -3
- package/es/field/index.css +1 -1
- package/es/field/types.d.ts +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/tabs/Tabs.mjs +44 -41
- package/es/time-picker/TimePicker.mjs +4 -3
- 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.js +3 -3
- package/lib/field/index.css +1 -1
- package/lib/field/types.d.ts +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/tabs/Tabs.js +44 -41
- package/lib/time-picker/TimePicker.js +3 -2
- package/lib/vant.cjs.js +80 -57
- package/lib/vant.es.js +80 -57
- package/lib/vant.js +80 -57
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +336 -312
- package/package.json +2 -2
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
|
});
|
@@ -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();
|
@@ -4189,9 +4196,9 @@ var stdin_default$1e = defineComponent({
|
|
4189
4196
|
const labelAlign = getProp("labelAlign");
|
4190
4197
|
const Label = renderLabel();
|
4191
4198
|
const LeftIcon = renderLeftIcon();
|
4199
|
+
const renderTitle = () => labelAlign === "top" ? [LeftIcon, Label] : Label;
|
4192
4200
|
return createVNode(Cell, {
|
4193
4201
|
"size": props.size,
|
4194
|
-
"icon": props.leftIcon,
|
4195
4202
|
"class": bem$13({
|
4196
4203
|
error: showError.value,
|
4197
4204
|
disabled,
|
@@ -4208,8 +4215,8 @@ var stdin_default$1e = defineComponent({
|
|
4208
4215
|
}]), props.labelClass],
|
4209
4216
|
"arrowDirection": props.arrowDirection
|
4210
4217
|
}, {
|
4211
|
-
icon: LeftIcon ? () => LeftIcon : null,
|
4212
|
-
title: Label
|
4218
|
+
icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
|
4219
|
+
title: Label || labelAlign === "top" ? renderTitle : null,
|
4213
4220
|
value: renderFieldBody,
|
4214
4221
|
extra: slots.extra
|
4215
4222
|
});
|
@@ -5397,6 +5404,16 @@ const genOptions = (min, max, type, formatter, filter) => {
|
|
5397
5404
|
});
|
5398
5405
|
return filter ? filter(type, options) : options;
|
5399
5406
|
};
|
5407
|
+
const formatValueRange = (values, columns) => values.map((value, index) => {
|
5408
|
+
const column = columns[index];
|
5409
|
+
if (column.length) {
|
5410
|
+
const maxValue = +column[column.length - 1].value;
|
5411
|
+
if (+value > maxValue) {
|
5412
|
+
return String(maxValue);
|
5413
|
+
}
|
5414
|
+
}
|
5415
|
+
return value;
|
5416
|
+
});
|
5400
5417
|
const [name$Y] = createNamespace("calendar-day");
|
5401
5418
|
var stdin_default$13 = defineComponent({
|
5402
5419
|
name: name$Y,
|
@@ -8332,9 +8349,12 @@ var stdin_default$I = defineComponent({
|
|
8332
8349
|
}
|
8333
8350
|
});
|
8334
8351
|
watch(() => props.modelValue, (newValues) => {
|
8352
|
+
newValues = formatValueRange(newValues, columns.value);
|
8335
8353
|
if (!isSameValue(newValues, currentValues.value)) {
|
8336
8354
|
currentValues.value = newValues;
|
8337
8355
|
}
|
8356
|
+
}, {
|
8357
|
+
immediate: true
|
8338
8358
|
});
|
8339
8359
|
const onChange = (...args) => emit("change", ...args);
|
8340
8360
|
const onCancel = (...args) => emit("cancel", ...args);
|
@@ -10015,7 +10035,8 @@ const navBarProps = {
|
|
10015
10035
|
rightText: String,
|
10016
10036
|
leftArrow: Boolean,
|
10017
10037
|
placeholder: Boolean,
|
10018
|
-
safeAreaInsetTop: Boolean
|
10038
|
+
safeAreaInsetTop: Boolean,
|
10039
|
+
clickable: truthProp
|
10019
10040
|
};
|
10020
10041
|
var stdin_default$w = defineComponent({
|
10021
10042
|
name: name$r,
|
@@ -10070,12 +10091,12 @@ var stdin_default$w = defineComponent({
|
|
10070
10091
|
}, [createVNode("div", {
|
10071
10092
|
"class": bem$q("content")
|
10072
10093
|
}, [hasLeft && createVNode("div", {
|
10073
|
-
"class": [bem$q("left"), HAPTICS_FEEDBACK],
|
10094
|
+
"class": [bem$q("left"), props.clickable ? HAPTICS_FEEDBACK : ""],
|
10074
10095
|
"onClick": onClickLeft
|
10075
10096
|
}, [renderLeft()]), createVNode("div", {
|
10076
10097
|
"class": [bem$q("title"), "van-ellipsis"]
|
10077
10098
|
}, [slots.title ? slots.title() : title]), hasRight && createVNode("div", {
|
10078
|
-
"class": [bem$q("right"), HAPTICS_FEEDBACK],
|
10099
|
+
"class": [bem$q("right"), props.clickable ? HAPTICS_FEEDBACK : ""],
|
10079
10100
|
"onClick": onClickRight
|
10080
10101
|
}, [renderRight()])])]);
|
10081
10102
|
};
|
@@ -12408,6 +12429,7 @@ const stepperProps = {
|
|
12408
12429
|
showMinus: truthProp,
|
12409
12430
|
showInput: truthProp,
|
12410
12431
|
longPress: truthProp,
|
12432
|
+
autoFixed: truthProp,
|
12411
12433
|
allowEmpty: Boolean,
|
12412
12434
|
modelValue: numericProp,
|
12413
12435
|
inputWidth: numericProp,
|
@@ -12427,7 +12449,7 @@ var stdin_default$c = defineComponent({
|
|
12427
12449
|
setup(props, {
|
12428
12450
|
emit
|
12429
12451
|
}) {
|
12430
|
-
const format2 = (value) => {
|
12452
|
+
const format2 = (value, autoFixed = true) => {
|
12431
12453
|
const {
|
12432
12454
|
min,
|
12433
12455
|
max,
|
@@ -12440,7 +12462,7 @@ var stdin_default$c = defineComponent({
|
|
12440
12462
|
value = formatNumber(String(value), !props.integer);
|
12441
12463
|
value = value === "" ? 0 : +value;
|
12442
12464
|
value = Number.isNaN(value) ? +min : value;
|
12443
|
-
value = Math.max(Math.min(+max, value), +min);
|
12465
|
+
value = autoFixed ? Math.max(Math.min(+max, value), +min) : value;
|
12444
12466
|
if (isDef(decimalLength)) {
|
12445
12467
|
value = value.toFixed(+decimalLength);
|
12446
12468
|
}
|
@@ -12524,7 +12546,7 @@ var stdin_default$c = defineComponent({
|
|
12524
12546
|
};
|
12525
12547
|
const onBlur = (event) => {
|
12526
12548
|
const input = event.target;
|
12527
|
-
const value = format2(input.value);
|
12549
|
+
const value = format2(input.value, props.autoFixed);
|
12528
12550
|
input.value = String(value);
|
12529
12551
|
current2.value = value;
|
12530
12552
|
nextTick(() => {
|
@@ -13123,13 +13145,14 @@ var stdin_default$7 = defineComponent({
|
|
13123
13145
|
if (!isSameValue(newValues, props.modelValue)) {
|
13124
13146
|
emit("update:modelValue", newValues);
|
13125
13147
|
}
|
13126
|
-
}, {
|
13127
|
-
immediate: true
|
13128
13148
|
});
|
13129
13149
|
watch(() => props.modelValue, (newValues) => {
|
13150
|
+
newValues = formatValueRange(newValues, columns.value);
|
13130
13151
|
if (!isSameValue(newValues, currentValues.value)) {
|
13131
13152
|
currentValues.value = newValues;
|
13132
13153
|
}
|
13154
|
+
}, {
|
13155
|
+
immediate: true
|
13133
13156
|
});
|
13134
13157
|
const onChange = (...args) => emit("change", ...args);
|
13135
13158
|
const onCancel = (...args) => emit("cancel", ...args);
|
@@ -14550,7 +14573,7 @@ const Lazyload = {
|
|
14550
14573
|
});
|
14551
14574
|
}
|
14552
14575
|
};
|
14553
|
-
const version = "4.0.0-rc.
|
14576
|
+
const version = "4.0.0-rc.5";
|
14554
14577
|
function install(app) {
|
14555
14578
|
const components = [
|
14556
14579
|
ActionBar,
|
package/lib/vant.js
CHANGED
@@ -1106,6 +1106,13 @@
|
|
1106
1106
|
const spinnerStyle = vue.computed(() => extend({
|
1107
1107
|
color: props.color
|
1108
1108
|
}, getSizeStyle(props.size)));
|
1109
|
+
const renderIcon = () => {
|
1110
|
+
const DefaultIcon = props.type === "spinner" ? SpinIcon : CircularIcon;
|
1111
|
+
return vue.createVNode("span", {
|
1112
|
+
"class": bem$1n("spinner", props.type),
|
1113
|
+
"style": spinnerStyle.value
|
1114
|
+
}, [slots.icon ? slots.icon() : DefaultIcon]);
|
1115
|
+
};
|
1109
1116
|
const renderText = () => {
|
1110
1117
|
var _a;
|
1111
1118
|
if (slots.default) {
|
@@ -1129,10 +1136,7 @@
|
|
1129
1136
|
}]),
|
1130
1137
|
"aria-live": "polite",
|
1131
1138
|
"aria-busy": true
|
1132
|
-
}, [
|
1133
|
-
"class": bem$1n("spinner", type),
|
1134
|
-
"style": spinnerStyle.value
|
1135
|
-
}, [type === "spinner" ? SpinIcon : CircularIcon]), renderText()]);
|
1139
|
+
}, [renderIcon(), renderText()]);
|
1136
1140
|
};
|
1137
1141
|
}
|
1138
1142
|
});
|
@@ -3007,17 +3011,19 @@
|
|
3007
3011
|
const newTab = children[newIndex];
|
3008
3012
|
const newName = getTabName(newTab, newIndex);
|
3009
3013
|
const shouldEmitChange = state.currentIndex !== null;
|
3010
|
-
state.currentIndex
|
3014
|
+
if (state.currentIndex !== newIndex) {
|
3015
|
+
state.currentIndex = newIndex;
|
3016
|
+
if (!skipScrollIntoView) {
|
3017
|
+
scrollIntoView();
|
3018
|
+
}
|
3019
|
+
setLine();
|
3020
|
+
}
|
3011
3021
|
if (newName !== props.active) {
|
3012
3022
|
emit("update:active", newName);
|
3013
3023
|
if (shouldEmitChange) {
|
3014
3024
|
emit("change", newName, newTab.title);
|
3015
3025
|
}
|
3016
3026
|
}
|
3017
|
-
if (!skipScrollIntoView) {
|
3018
|
-
scrollIntoView();
|
3019
|
-
}
|
3020
|
-
setLine();
|
3021
3027
|
if (stickyFixed && !props.scrollspy) {
|
3022
3028
|
setRootScrollTop(Math.ceil(getElementTop(root.value) - offsetTopPx.value));
|
3023
3029
|
}
|
@@ -3116,13 +3122,14 @@
|
|
3116
3122
|
}
|
3117
3123
|
};
|
3118
3124
|
const renderHeader = () => {
|
3119
|
-
var _a, _b;
|
3125
|
+
var _a, _b, _c;
|
3120
3126
|
const {
|
3121
3127
|
type,
|
3122
|
-
border
|
3128
|
+
border,
|
3129
|
+
sticky
|
3123
3130
|
} = props;
|
3124
|
-
|
3125
|
-
"ref": wrapRef,
|
3131
|
+
const Header = [vue.createVNode("div", {
|
3132
|
+
"ref": sticky ? void 0 : wrapRef,
|
3126
3133
|
"class": [bem$1a("wrap"), {
|
3127
3134
|
[BORDER_TOP_BOTTOM]: type === "line" && border
|
3128
3135
|
}]
|
@@ -3135,7 +3142,13 @@
|
|
3135
3142
|
}]),
|
3136
3143
|
"style": navStyle.value,
|
3137
3144
|
"aria-orientation": "horizontal"
|
3138
|
-
}, [(_a = slots["nav-left"]) == null ? void 0 : _a.call(slots), renderNav(), renderLine(), (_b = slots["nav-right"]) == null ? void 0 : _b.call(slots)])]);
|
3145
|
+
}, [(_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)];
|
3146
|
+
if (sticky) {
|
3147
|
+
return vue.createVNode("div", {
|
3148
|
+
"ref": wrapRef
|
3149
|
+
}, [Header]);
|
3150
|
+
}
|
3151
|
+
return Header;
|
3139
3152
|
};
|
3140
3153
|
vue.watch([() => props.color, windowWidth], setLine);
|
3141
3154
|
vue.watch(() => props.active, (value) => {
|
@@ -3189,37 +3202,31 @@
|
|
3189
3202
|
currentName,
|
3190
3203
|
scrollIntoView
|
3191
3204
|
});
|
3192
|
-
return () => {
|
3193
|
-
|
3194
|
-
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
3198
|
-
|
3199
|
-
|
3200
|
-
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3204
|
-
|
3205
|
-
|
3206
|
-
|
3207
|
-
|
3208
|
-
|
3209
|
-
|
3210
|
-
|
3211
|
-
|
3212
|
-
|
3213
|
-
|
3214
|
-
|
3215
|
-
|
3216
|
-
|
3217
|
-
default: () => {
|
3218
|
-
var _a2;
|
3219
|
-
return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
|
3220
|
-
}
|
3221
|
-
})]);
|
3222
|
-
};
|
3205
|
+
return () => vue.createVNode("div", {
|
3206
|
+
"ref": root,
|
3207
|
+
"class": bem$1a([props.type])
|
3208
|
+
}, [props.sticky ? vue.createVNode(Sticky, {
|
3209
|
+
"container": root.value,
|
3210
|
+
"offsetTop": offsetTopPx.value,
|
3211
|
+
"onScroll": onStickyScroll
|
3212
|
+
}, {
|
3213
|
+
default: () => [renderHeader()]
|
3214
|
+
}) : renderHeader(), vue.createVNode(stdin_default$1n, {
|
3215
|
+
"ref": contentRef,
|
3216
|
+
"count": children.length,
|
3217
|
+
"inited": state.inited,
|
3218
|
+
"animated": props.animated,
|
3219
|
+
"duration": props.duration,
|
3220
|
+
"swipeable": props.swipeable,
|
3221
|
+
"lazyRender": props.lazyRender,
|
3222
|
+
"currentIndex": state.currentIndex,
|
3223
|
+
"onChange": setCurrentIndex
|
3224
|
+
}, {
|
3225
|
+
default: () => {
|
3226
|
+
var _a;
|
3227
|
+
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
3228
|
+
}
|
3229
|
+
})]);
|
3223
3230
|
}
|
3224
3231
|
});
|
3225
3232
|
const TAB_STATUS_KEY = Symbol();
|
@@ -4549,9 +4556,9 @@
|
|
4549
4556
|
const labelAlign = getProp("labelAlign");
|
4550
4557
|
const Label = renderLabel();
|
4551
4558
|
const LeftIcon = renderLeftIcon();
|
4559
|
+
const renderTitle = () => labelAlign === "top" ? [LeftIcon, Label] : Label;
|
4552
4560
|
return vue.createVNode(Cell, {
|
4553
4561
|
"size": props.size,
|
4554
|
-
"icon": props.leftIcon,
|
4555
4562
|
"class": bem$13({
|
4556
4563
|
error: showError.value,
|
4557
4564
|
disabled,
|
@@ -4568,8 +4575,8 @@
|
|
4568
4575
|
}]), props.labelClass],
|
4569
4576
|
"arrowDirection": props.arrowDirection
|
4570
4577
|
}, {
|
4571
|
-
icon: LeftIcon ? () => LeftIcon : null,
|
4572
|
-
title: Label
|
4578
|
+
icon: LeftIcon && labelAlign !== "top" ? () => LeftIcon : null,
|
4579
|
+
title: Label || labelAlign === "top" ? renderTitle : null,
|
4573
4580
|
value: renderFieldBody,
|
4574
4581
|
extra: slots.extra
|
4575
4582
|
});
|
@@ -5757,6 +5764,16 @@
|
|
5757
5764
|
});
|
5758
5765
|
return filter ? filter(type, options) : options;
|
5759
5766
|
};
|
5767
|
+
const formatValueRange = (values, columns) => values.map((value, index) => {
|
5768
|
+
const column = columns[index];
|
5769
|
+
if (column.length) {
|
5770
|
+
const maxValue = +column[column.length - 1].value;
|
5771
|
+
if (+value > maxValue) {
|
5772
|
+
return String(maxValue);
|
5773
|
+
}
|
5774
|
+
}
|
5775
|
+
return value;
|
5776
|
+
});
|
5760
5777
|
const [name$Y] = createNamespace("calendar-day");
|
5761
5778
|
var stdin_default$13 = vue.defineComponent({
|
5762
5779
|
name: name$Y,
|
@@ -8675,9 +8692,12 @@
|
|
8675
8692
|
}
|
8676
8693
|
});
|
8677
8694
|
vue.watch(() => props.modelValue, (newValues) => {
|
8695
|
+
newValues = formatValueRange(newValues, columns.value);
|
8678
8696
|
if (!isSameValue(newValues, currentValues.value)) {
|
8679
8697
|
currentValues.value = newValues;
|
8680
8698
|
}
|
8699
|
+
}, {
|
8700
|
+
immediate: true
|
8681
8701
|
});
|
8682
8702
|
const onChange = (...args) => emit("change", ...args);
|
8683
8703
|
const onCancel = (...args) => emit("cancel", ...args);
|
@@ -10349,7 +10369,8 @@
|
|
10349
10369
|
rightText: String,
|
10350
10370
|
leftArrow: Boolean,
|
10351
10371
|
placeholder: Boolean,
|
10352
|
-
safeAreaInsetTop: Boolean
|
10372
|
+
safeAreaInsetTop: Boolean,
|
10373
|
+
clickable: truthProp
|
10353
10374
|
};
|
10354
10375
|
var stdin_default$w = vue.defineComponent({
|
10355
10376
|
name: name$r,
|
@@ -10404,12 +10425,12 @@
|
|
10404
10425
|
}, [vue.createVNode("div", {
|
10405
10426
|
"class": bem$q("content")
|
10406
10427
|
}, [hasLeft && vue.createVNode("div", {
|
10407
|
-
"class": [bem$q("left"), HAPTICS_FEEDBACK],
|
10428
|
+
"class": [bem$q("left"), props.clickable ? HAPTICS_FEEDBACK : ""],
|
10408
10429
|
"onClick": onClickLeft
|
10409
10430
|
}, [renderLeft()]), vue.createVNode("div", {
|
10410
10431
|
"class": [bem$q("title"), "van-ellipsis"]
|
10411
10432
|
}, [slots.title ? slots.title() : title]), hasRight && vue.createVNode("div", {
|
10412
|
-
"class": [bem$q("right"), HAPTICS_FEEDBACK],
|
10433
|
+
"class": [bem$q("right"), props.clickable ? HAPTICS_FEEDBACK : ""],
|
10413
10434
|
"onClick": onClickRight
|
10414
10435
|
}, [renderRight()])])]);
|
10415
10436
|
};
|
@@ -13645,6 +13666,7 @@
|
|
13645
13666
|
showMinus: truthProp,
|
13646
13667
|
showInput: truthProp,
|
13647
13668
|
longPress: truthProp,
|
13669
|
+
autoFixed: truthProp,
|
13648
13670
|
allowEmpty: Boolean,
|
13649
13671
|
modelValue: numericProp,
|
13650
13672
|
inputWidth: numericProp,
|
@@ -13664,7 +13686,7 @@
|
|
13664
13686
|
setup(props, {
|
13665
13687
|
emit
|
13666
13688
|
}) {
|
13667
|
-
const format2 = (value) => {
|
13689
|
+
const format2 = (value, autoFixed = true) => {
|
13668
13690
|
const {
|
13669
13691
|
min,
|
13670
13692
|
max,
|
@@ -13677,7 +13699,7 @@
|
|
13677
13699
|
value = formatNumber(String(value), !props.integer);
|
13678
13700
|
value = value === "" ? 0 : +value;
|
13679
13701
|
value = Number.isNaN(value) ? +min : value;
|
13680
|
-
value = Math.max(Math.min(+max, value), +min);
|
13702
|
+
value = autoFixed ? Math.max(Math.min(+max, value), +min) : value;
|
13681
13703
|
if (isDef(decimalLength)) {
|
13682
13704
|
value = value.toFixed(+decimalLength);
|
13683
13705
|
}
|
@@ -13761,7 +13783,7 @@
|
|
13761
13783
|
};
|
13762
13784
|
const onBlur = (event) => {
|
13763
13785
|
const input = event.target;
|
13764
|
-
const value = format2(input.value);
|
13786
|
+
const value = format2(input.value, props.autoFixed);
|
13765
13787
|
input.value = String(value);
|
13766
13788
|
current2.value = value;
|
13767
13789
|
vue.nextTick(() => {
|
@@ -14357,13 +14379,14 @@
|
|
14357
14379
|
if (!isSameValue(newValues, props.modelValue)) {
|
14358
14380
|
emit("update:modelValue", newValues);
|
14359
14381
|
}
|
14360
|
-
}, {
|
14361
|
-
immediate: true
|
14362
14382
|
});
|
14363
14383
|
vue.watch(() => props.modelValue, (newValues) => {
|
14384
|
+
newValues = formatValueRange(newValues, columns.value);
|
14364
14385
|
if (!isSameValue(newValues, currentValues.value)) {
|
14365
14386
|
currentValues.value = newValues;
|
14366
14387
|
}
|
14388
|
+
}, {
|
14389
|
+
immediate: true
|
14367
14390
|
});
|
14368
14391
|
const onChange = (...args) => emit("change", ...args);
|
14369
14392
|
const onCancel = (...args) => emit("cancel", ...args);
|
@@ -15767,7 +15790,7 @@
|
|
15767
15790
|
});
|
15768
15791
|
}
|
15769
15792
|
};
|
15770
|
-
const version = "4.0.0-rc.
|
15793
|
+
const version = "4.0.0-rc.5";
|
15771
15794
|
function install(app) {
|
15772
15795
|
const components = [
|
15773
15796
|
ActionBar,
|