vant 4.9.3 → 4.9.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/es/calendar/Calendar.mjs +5 -3
- package/es/calendar/index.css +1 -1
- package/es/calendar/types.d.ts +2 -2
- package/es/field/Field.d.ts +8 -0
- package/es/field/Field.mjs +8 -1
- package/es/field/index.d.ts +4 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/lazyload/vue-lazyload/index.d.ts +1 -1
- package/es/locale/lang/kk-KZ.d.ts +63 -0
- package/es/locale/lang/kk-KZ.mjs +81 -0
- package/es/overlay/Overlay.d.ts +3 -0
- package/es/overlay/Overlay.mjs +19 -8
- package/es/overlay/index.d.ts +2 -0
- package/es/search/Search.d.ts +6 -0
- package/es/search/index.d.ts +4 -0
- package/es/slider/Slider.d.ts +1 -1
- package/es/slider/index.d.ts +1 -1
- package/es/swipe-cell/SwipeCell.mjs +7 -3
- package/lib/calendar/Calendar.js +5 -3
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/types.d.ts +2 -2
- package/lib/field/Field.d.ts +8 -0
- package/lib/field/Field.js +7 -0
- package/lib/field/index.d.ts +4 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/lazyload/vue-lazyload/index.d.ts +1 -1
- package/lib/locale/lang/kk-KZ.d.ts +63 -0
- package/lib/locale/lang/kk-KZ.js +100 -0
- package/lib/overlay/Overlay.d.ts +3 -0
- package/lib/overlay/Overlay.js +18 -7
- package/lib/overlay/index.d.ts +2 -0
- package/lib/search/Search.d.ts +6 -0
- package/lib/search/index.d.ts +4 -0
- package/lib/slider/Slider.d.ts +1 -1
- package/lib/slider/index.d.ts +1 -1
- package/lib/swipe-cell/SwipeCell.js +7 -3
- package/lib/vant.cjs.js +38 -14
- package/lib/vant.es.js +39 -15
- package/lib/vant.js +38 -14
- package/lib/vant.min.js +2 -2
- package/lib/web-types.json +1 -1
- package/package.json +8 -8
package/lib/field/Field.js
CHANGED
@@ -41,6 +41,8 @@ const fieldSharedProps = {
|
|
41
41
|
autofocus: Boolean,
|
42
42
|
clearable: Boolean,
|
43
43
|
maxlength: import_utils.numericProp,
|
44
|
+
max: Number,
|
45
|
+
min: Number,
|
44
46
|
formatter: Function,
|
45
47
|
clearIcon: (0, import_utils.makeStringProp)("clear"),
|
46
48
|
modelValue: (0, import_utils.makeNumericProp)(""),
|
@@ -238,12 +240,17 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
238
240
|
return value;
|
239
241
|
};
|
240
242
|
const updateValue = (value, trigger = "onChange") => {
|
243
|
+
var _a, _b;
|
241
244
|
const originalValue = value;
|
242
245
|
value = limitValueLength(value);
|
243
246
|
const limitDiffLen = (0, import_utils2.getStringLength)(originalValue) - (0, import_utils2.getStringLength)(value);
|
244
247
|
if (props.type === "number" || props.type === "digit") {
|
245
248
|
const isNumber = props.type === "number";
|
246
249
|
value = (0, import_utils.formatNumber)(value, isNumber, isNumber);
|
250
|
+
if (trigger === "onBlur" && value !== "") {
|
251
|
+
const adjustedValue = (0, import_utils.clamp)(+value, (_a = props.min) != null ? _a : -Infinity, (_b = props.max) != null ? _b : Infinity);
|
252
|
+
value = adjustedValue.toString();
|
253
|
+
}
|
247
254
|
}
|
248
255
|
let formatterDiffLen = 0;
|
249
256
|
if (props.formatter && trigger === props.formatTrigger) {
|
package/lib/field/index.d.ts
CHANGED
@@ -37,6 +37,8 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
37
37
|
autofocus: BooleanConstructor;
|
38
38
|
clearable: BooleanConstructor;
|
39
39
|
maxlength: (NumberConstructor | StringConstructor)[];
|
40
|
+
max: NumberConstructor;
|
41
|
+
min: NumberConstructor;
|
40
42
|
formatter: import("vue").PropType<(value: string) => string>;
|
41
43
|
clearIcon: {
|
42
44
|
type: import("vue").PropType<string>;
|
@@ -132,6 +134,8 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
132
134
|
autofocus: BooleanConstructor;
|
133
135
|
clearable: BooleanConstructor;
|
134
136
|
maxlength: (NumberConstructor | StringConstructor)[];
|
137
|
+
max: NumberConstructor;
|
138
|
+
min: NumberConstructor;
|
135
139
|
formatter: import("vue").PropType<(value: string) => string>;
|
136
140
|
clearIcon: {
|
137
141
|
type: import("vue").PropType<string>;
|