vant 4.9.4 → 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/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/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/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/vant.cjs.js +31 -11
- package/lib/vant.es.js +32 -12
- package/lib/vant.js +31 -11
- package/lib/vant.min.js +2 -2
- package/lib/web-types.json +1 -1
- package/package.json +5 -5
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
@@ -226,7 +226,7 @@ __reExport(stdin_exports, require("./toast"), module.exports);
|
|
226
226
|
__reExport(stdin_exports, require("./tree-select"), module.exports);
|
227
227
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
228
228
|
__reExport(stdin_exports, require("./watermark"), module.exports);
|
229
|
-
const version = "4.9.
|
229
|
+
const version = "4.9.5";
|
230
230
|
function install(app) {
|
231
231
|
const components = [
|
232
232
|
import_action_bar.ActionBar,
|
@@ -44,7 +44,7 @@ export declare const Lazyload: {
|
|
44
44
|
install(app: App, options?: LazyloadOptions): void;
|
45
45
|
};
|
46
46
|
|
47
|
-
declare module '
|
47
|
+
declare module 'vue' {
|
48
48
|
interface ComponentCustomProperties {
|
49
49
|
$Lazyload: {
|
50
50
|
$on: (event: string, handler: Callback) => void;
|
package/lib/overlay/Overlay.d.ts
CHANGED
@@ -13,6 +13,7 @@ export declare const overlayProps: {
|
|
13
13
|
default: true;
|
14
14
|
};
|
15
15
|
customStyle: PropType<CSSProperties>;
|
16
|
+
teleport: PropType<string | import("vue").RendererElement | null | undefined>;
|
16
17
|
};
|
17
18
|
export type OverlayProps = ExtractPropTypes<typeof overlayProps>;
|
18
19
|
declare const _default: import("vue").DefineComponent<{
|
@@ -29,6 +30,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
29
30
|
default: true;
|
30
31
|
};
|
31
32
|
customStyle: PropType<CSSProperties>;
|
33
|
+
teleport: PropType<string | import("vue").RendererElement | null | undefined>;
|
32
34
|
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
33
35
|
show: BooleanConstructor;
|
34
36
|
zIndex: (NumberConstructor | StringConstructor)[];
|
@@ -43,6 +45,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
43
45
|
default: true;
|
44
46
|
};
|
45
47
|
customStyle: PropType<CSSProperties>;
|
48
|
+
teleport: PropType<string | import("vue").RendererElement | null | undefined>;
|
46
49
|
}>>, {
|
47
50
|
show: boolean;
|
48
51
|
lockScroll: boolean;
|
package/lib/overlay/Overlay.js
CHANGED
@@ -34,7 +34,8 @@ const overlayProps = {
|
|
34
34
|
className: import_utils.unknownProp,
|
35
35
|
lockScroll: import_utils.truthProp,
|
36
36
|
lazyRender: import_utils.truthProp,
|
37
|
-
customStyle: Object
|
37
|
+
customStyle: Object,
|
38
|
+
teleport: [String, Object]
|
38
39
|
};
|
39
40
|
var stdin_default = (0, import_vue2.defineComponent)({
|
40
41
|
name,
|
@@ -64,11 +65,21 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
64
65
|
(0, import_use.useEventListener)("touchmove", onTouchMove, {
|
65
66
|
target: root
|
66
67
|
});
|
67
|
-
return () =>
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
68
|
+
return () => {
|
69
|
+
const Content = (0, import_vue.createVNode)(import_vue2.Transition, {
|
70
|
+
"name": "van-fade",
|
71
|
+
"appear": true
|
72
|
+
}, {
|
73
|
+
default: renderOverlay
|
74
|
+
});
|
75
|
+
if (props.teleport) {
|
76
|
+
return (0, import_vue.createVNode)(import_vue2.Teleport, {
|
77
|
+
"to": props.teleport
|
78
|
+
}, {
|
79
|
+
default: () => [Content]
|
80
|
+
});
|
81
|
+
}
|
82
|
+
return Content;
|
83
|
+
};
|
73
84
|
}
|
74
85
|
});
|
package/lib/overlay/index.d.ts
CHANGED
@@ -12,6 +12,7 @@ export declare const Overlay: import("../utils").WithInstall<import("vue").Defin
|
|
12
12
|
default: true;
|
13
13
|
};
|
14
14
|
customStyle: import("vue").PropType<import("vue").CSSProperties>;
|
15
|
+
teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
15
16
|
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
16
17
|
show: BooleanConstructor;
|
17
18
|
zIndex: (NumberConstructor | StringConstructor)[];
|
@@ -26,6 +27,7 @@ export declare const Overlay: import("../utils").WithInstall<import("vue").Defin
|
|
26
27
|
default: true;
|
27
28
|
};
|
28
29
|
customStyle: import("vue").PropType<import("vue").CSSProperties>;
|
30
|
+
teleport: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
|
29
31
|
}>>, {
|
30
32
|
show: boolean;
|
31
33
|
lockScroll: boolean;
|
package/lib/search/Search.d.ts
CHANGED
@@ -8,6 +8,8 @@ export declare const searchProps: {
|
|
8
8
|
autofocus: BooleanConstructor;
|
9
9
|
clearable: BooleanConstructor;
|
10
10
|
maxlength: (NumberConstructor | StringConstructor)[];
|
11
|
+
max: NumberConstructor;
|
12
|
+
min: NumberConstructor;
|
11
13
|
formatter: import("vue").PropType<(value: string) => string>;
|
12
14
|
clearIcon: {
|
13
15
|
type: import("vue").PropType<string>;
|
@@ -75,6 +77,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
75
77
|
autofocus: BooleanConstructor;
|
76
78
|
clearable: BooleanConstructor;
|
77
79
|
maxlength: (NumberConstructor | StringConstructor)[];
|
80
|
+
max: NumberConstructor;
|
81
|
+
min: NumberConstructor;
|
78
82
|
formatter: import("vue").PropType<(value: string) => string>;
|
79
83
|
clearIcon: {
|
80
84
|
type: import("vue").PropType<string>;
|
@@ -140,6 +144,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
140
144
|
autofocus: BooleanConstructor;
|
141
145
|
clearable: BooleanConstructor;
|
142
146
|
maxlength: (NumberConstructor | StringConstructor)[];
|
147
|
+
max: NumberConstructor;
|
148
|
+
min: NumberConstructor;
|
143
149
|
formatter: import("vue").PropType<(value: string) => string>;
|
144
150
|
clearIcon: {
|
145
151
|
type: import("vue").PropType<string>;
|
package/lib/search/index.d.ts
CHANGED
@@ -7,6 +7,8 @@ export declare const Search: import("../utils").WithInstall<import("vue").Define
|
|
7
7
|
autofocus: BooleanConstructor;
|
8
8
|
clearable: BooleanConstructor;
|
9
9
|
maxlength: (NumberConstructor | StringConstructor)[];
|
10
|
+
max: NumberConstructor;
|
11
|
+
min: NumberConstructor;
|
10
12
|
formatter: import("vue").PropType<(value: string) => string>;
|
11
13
|
clearIcon: {
|
12
14
|
type: import("vue").PropType<string>;
|
@@ -72,6 +74,8 @@ export declare const Search: import("../utils").WithInstall<import("vue").Define
|
|
72
74
|
autofocus: BooleanConstructor;
|
73
75
|
clearable: BooleanConstructor;
|
74
76
|
maxlength: (NumberConstructor | StringConstructor)[];
|
77
|
+
max: NumberConstructor;
|
78
|
+
min: NumberConstructor;
|
75
79
|
formatter: import("vue").PropType<(value: string) => string>;
|
76
80
|
clearIcon: {
|
77
81
|
type: import("vue").PropType<string>;
|
package/lib/slider/Slider.d.ts
CHANGED
@@ -92,9 +92,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
92
92
|
max: string | number;
|
93
93
|
disabled: boolean;
|
94
94
|
vertical: boolean;
|
95
|
+
min: string | number;
|
95
96
|
modelValue: SliderValue;
|
96
97
|
readonly: boolean;
|
97
|
-
min: string | number;
|
98
98
|
step: string | number;
|
99
99
|
}, {}>;
|
100
100
|
export default _default;
|
package/lib/slider/index.d.ts
CHANGED
@@ -61,9 +61,9 @@ export declare const Slider: import("../utils").WithInstall<import("vue").Define
|
|
61
61
|
max: string | number;
|
62
62
|
disabled: boolean;
|
63
63
|
vertical: boolean;
|
64
|
+
min: string | number;
|
64
65
|
modelValue: number | [number, number];
|
65
66
|
readonly: boolean;
|
66
|
-
min: string | number;
|
67
67
|
step: string | number;
|
68
68
|
}, {}>>;
|
69
69
|
export default Slider;
|
package/lib/vant.cjs.js
CHANGED
@@ -1280,7 +1280,8 @@ const overlayProps = {
|
|
1280
1280
|
className: unknownProp,
|
1281
1281
|
lockScroll: truthProp,
|
1282
1282
|
lazyRender: truthProp,
|
1283
|
-
customStyle: Object
|
1283
|
+
customStyle: Object,
|
1284
|
+
teleport: [String, Object]
|
1284
1285
|
};
|
1285
1286
|
var stdin_default$1L = vue.defineComponent({
|
1286
1287
|
name: name$1C,
|
@@ -1310,12 +1311,22 @@ var stdin_default$1L = vue.defineComponent({
|
|
1310
1311
|
use.useEventListener("touchmove", onTouchMove, {
|
1311
1312
|
target: root
|
1312
1313
|
});
|
1313
|
-
return () =>
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1314
|
+
return () => {
|
1315
|
+
const Content = vue.createVNode(vue.Transition, {
|
1316
|
+
"name": "van-fade",
|
1317
|
+
"appear": true
|
1318
|
+
}, {
|
1319
|
+
default: renderOverlay
|
1320
|
+
});
|
1321
|
+
if (props2.teleport) {
|
1322
|
+
return vue.createVNode(vue.Teleport, {
|
1323
|
+
"to": props2.teleport
|
1324
|
+
}, {
|
1325
|
+
default: () => [Content]
|
1326
|
+
});
|
1327
|
+
}
|
1328
|
+
return Content;
|
1329
|
+
};
|
1319
1330
|
}
|
1320
1331
|
});
|
1321
1332
|
const Overlay = withInstall(stdin_default$1L);
|
@@ -4070,6 +4081,8 @@ const fieldSharedProps = {
|
|
4070
4081
|
autofocus: Boolean,
|
4071
4082
|
clearable: Boolean,
|
4072
4083
|
maxlength: numericProp,
|
4084
|
+
max: Number,
|
4085
|
+
min: Number,
|
4073
4086
|
formatter: Function,
|
4074
4087
|
clearIcon: makeStringProp("clear"),
|
4075
4088
|
modelValue: makeNumericProp(""),
|
@@ -4267,12 +4280,17 @@ var stdin_default$1v = vue.defineComponent({
|
|
4267
4280
|
return value;
|
4268
4281
|
};
|
4269
4282
|
const updateValue = (value, trigger = "onChange") => {
|
4283
|
+
var _a, _b;
|
4270
4284
|
const originalValue = value;
|
4271
4285
|
value = limitValueLength(value);
|
4272
4286
|
const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
|
4273
4287
|
if (props2.type === "number" || props2.type === "digit") {
|
4274
4288
|
const isNumber = props2.type === "number";
|
4275
4289
|
value = formatNumber(value, isNumber, isNumber);
|
4290
|
+
if (trigger === "onBlur" && value !== "") {
|
4291
|
+
const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
|
4292
|
+
value = adjustedValue.toString();
|
4293
|
+
}
|
4276
4294
|
}
|
4277
4295
|
let formatterDiffLen = 0;
|
4278
4296
|
if (props2.formatter && trigger === props2.formatTrigger) {
|
@@ -6926,6 +6944,9 @@ var stdin_default$1d = vue.defineComponent({
|
|
6926
6944
|
if (!Array.isArray(defaultDate)) {
|
6927
6945
|
defaultDate = [];
|
6928
6946
|
}
|
6947
|
+
if (defaultDate.length === 1 && compareDay(defaultDate[0], now) === 1) {
|
6948
|
+
defaultDate = [];
|
6949
|
+
}
|
6929
6950
|
const min = minDate.value;
|
6930
6951
|
const max = maxDate.value;
|
6931
6952
|
const start = limitDateRange(defaultDate[0] || now, min, max ? allowSameDay ? max : getPrevDay(max) : void 0);
|
@@ -7241,9 +7262,8 @@ var stdin_default$1d = vue.defineComponent({
|
|
7241
7262
|
};
|
7242
7263
|
vue.watch(() => props2.show, init);
|
7243
7264
|
vue.watch(() => [props2.type, props2.minDate, props2.maxDate, props2.switchMode], () => reset(getInitialDate(currentDate.value)));
|
7244
|
-
vue.watch(() => props2.defaultDate, (value
|
7245
|
-
|
7246
|
-
scrollToCurrentDate();
|
7265
|
+
vue.watch(() => props2.defaultDate, (value) => {
|
7266
|
+
reset(value);
|
7247
7267
|
});
|
7248
7268
|
useExpose({
|
7249
7269
|
reset,
|
@@ -17049,7 +17069,7 @@ const Lazyload = {
|
|
17049
17069
|
});
|
17050
17070
|
}
|
17051
17071
|
};
|
17052
|
-
const version = "4.9.
|
17072
|
+
const version = "4.9.5";
|
17053
17073
|
function install(app) {
|
17054
17074
|
const components = [
|
17055
17075
|
ActionBar,
|
package/lib/vant.es.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { unref, ref, reactive, inject, watch, onMounted, nextTick, createVNode, defineComponent, getCurrentInstance, computed, onActivated, onDeactivated, onBeforeUnmount, provide, watchEffect, mergeProps, Transition, withDirectives, vShow,
|
1
|
+
import { unref, ref, reactive, inject, watch, onMounted, nextTick, createVNode, defineComponent, getCurrentInstance, computed, onActivated, onDeactivated, onBeforeUnmount, provide, watchEffect, mergeProps, Transition, Teleport, withDirectives, vShow, Fragment, onBeforeUpdate, Comment, createTextVNode, onUnmounted, createApp, resolveDirective, withKeys, onUpdated, Text, h } from "vue";
|
2
2
|
import { useWindowSize, useRect, useChildren, useParent, onMountedOrActivated, getScrollParent, useEventListener, cancelRaf, raf, useScrollParent, usePageVisibility, doubleRaf, CUSTOM_FIELD_INJECTION_KEY, useCustomFieldValue, inBrowser as inBrowser$1, useToggle, useCountDown, useClickAway } from "@vant/use";
|
3
3
|
import { normalizeClass, stringifyStyle, normalizeStyle } from "@vue/shared";
|
4
4
|
import { offsetModifier, createPopper } from "@vant/popperjs";
|
@@ -1278,7 +1278,8 @@ const overlayProps = {
|
|
1278
1278
|
className: unknownProp,
|
1279
1279
|
lockScroll: truthProp,
|
1280
1280
|
lazyRender: truthProp,
|
1281
|
-
customStyle: Object
|
1281
|
+
customStyle: Object,
|
1282
|
+
teleport: [String, Object]
|
1282
1283
|
};
|
1283
1284
|
var stdin_default$1L = defineComponent({
|
1284
1285
|
name: name$1C,
|
@@ -1308,12 +1309,22 @@ var stdin_default$1L = defineComponent({
|
|
1308
1309
|
useEventListener("touchmove", onTouchMove, {
|
1309
1310
|
target: root
|
1310
1311
|
});
|
1311
|
-
return () =>
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1312
|
+
return () => {
|
1313
|
+
const Content = createVNode(Transition, {
|
1314
|
+
"name": "van-fade",
|
1315
|
+
"appear": true
|
1316
|
+
}, {
|
1317
|
+
default: renderOverlay
|
1318
|
+
});
|
1319
|
+
if (props2.teleport) {
|
1320
|
+
return createVNode(Teleport, {
|
1321
|
+
"to": props2.teleport
|
1322
|
+
}, {
|
1323
|
+
default: () => [Content]
|
1324
|
+
});
|
1325
|
+
}
|
1326
|
+
return Content;
|
1327
|
+
};
|
1317
1328
|
}
|
1318
1329
|
});
|
1319
1330
|
const Overlay = withInstall(stdin_default$1L);
|
@@ -4068,6 +4079,8 @@ const fieldSharedProps = {
|
|
4068
4079
|
autofocus: Boolean,
|
4069
4080
|
clearable: Boolean,
|
4070
4081
|
maxlength: numericProp,
|
4082
|
+
max: Number,
|
4083
|
+
min: Number,
|
4071
4084
|
formatter: Function,
|
4072
4085
|
clearIcon: makeStringProp("clear"),
|
4073
4086
|
modelValue: makeNumericProp(""),
|
@@ -4265,12 +4278,17 @@ var stdin_default$1v = defineComponent({
|
|
4265
4278
|
return value;
|
4266
4279
|
};
|
4267
4280
|
const updateValue = (value, trigger = "onChange") => {
|
4281
|
+
var _a, _b;
|
4268
4282
|
const originalValue = value;
|
4269
4283
|
value = limitValueLength(value);
|
4270
4284
|
const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
|
4271
4285
|
if (props2.type === "number" || props2.type === "digit") {
|
4272
4286
|
const isNumber = props2.type === "number";
|
4273
4287
|
value = formatNumber(value, isNumber, isNumber);
|
4288
|
+
if (trigger === "onBlur" && value !== "") {
|
4289
|
+
const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
|
4290
|
+
value = adjustedValue.toString();
|
4291
|
+
}
|
4274
4292
|
}
|
4275
4293
|
let formatterDiffLen = 0;
|
4276
4294
|
if (props2.formatter && trigger === props2.formatTrigger) {
|
@@ -6924,6 +6942,9 @@ var stdin_default$1d = defineComponent({
|
|
6924
6942
|
if (!Array.isArray(defaultDate)) {
|
6925
6943
|
defaultDate = [];
|
6926
6944
|
}
|
6945
|
+
if (defaultDate.length === 1 && compareDay(defaultDate[0], now) === 1) {
|
6946
|
+
defaultDate = [];
|
6947
|
+
}
|
6927
6948
|
const min = minDate.value;
|
6928
6949
|
const max = maxDate.value;
|
6929
6950
|
const start = limitDateRange(defaultDate[0] || now, min, max ? allowSameDay ? max : getPrevDay(max) : void 0);
|
@@ -7239,9 +7260,8 @@ var stdin_default$1d = defineComponent({
|
|
7239
7260
|
};
|
7240
7261
|
watch(() => props2.show, init);
|
7241
7262
|
watch(() => [props2.type, props2.minDate, props2.maxDate, props2.switchMode], () => reset(getInitialDate(currentDate.value)));
|
7242
|
-
watch(() => props2.defaultDate, (value
|
7243
|
-
|
7244
|
-
scrollToCurrentDate();
|
7263
|
+
watch(() => props2.defaultDate, (value) => {
|
7264
|
+
reset(value);
|
7245
7265
|
});
|
7246
7266
|
useExpose({
|
7247
7267
|
reset,
|
@@ -17047,7 +17067,7 @@ const Lazyload = {
|
|
17047
17067
|
});
|
17048
17068
|
}
|
17049
17069
|
};
|
17050
|
-
const version = "4.9.
|
17070
|
+
const version = "4.9.5";
|
17051
17071
|
function install(app) {
|
17052
17072
|
const components = [
|
17053
17073
|
ActionBar,
|
package/lib/vant.js
CHANGED
@@ -1668,7 +1668,8 @@
|
|
1668
1668
|
className: unknownProp,
|
1669
1669
|
lockScroll: truthProp,
|
1670
1670
|
lazyRender: truthProp,
|
1671
|
-
customStyle: Object
|
1671
|
+
customStyle: Object,
|
1672
|
+
teleport: [String, Object]
|
1672
1673
|
};
|
1673
1674
|
var stdin_default$1L = vue.defineComponent({
|
1674
1675
|
name: name$1C,
|
@@ -1698,12 +1699,22 @@
|
|
1698
1699
|
useEventListener("touchmove", onTouchMove, {
|
1699
1700
|
target: root
|
1700
1701
|
});
|
1701
|
-
return () =>
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1702
|
+
return () => {
|
1703
|
+
const Content = vue.createVNode(vue.Transition, {
|
1704
|
+
"name": "van-fade",
|
1705
|
+
"appear": true
|
1706
|
+
}, {
|
1707
|
+
default: renderOverlay
|
1708
|
+
});
|
1709
|
+
if (props2.teleport) {
|
1710
|
+
return vue.createVNode(vue.Teleport, {
|
1711
|
+
"to": props2.teleport
|
1712
|
+
}, {
|
1713
|
+
default: () => [Content]
|
1714
|
+
});
|
1715
|
+
}
|
1716
|
+
return Content;
|
1717
|
+
};
|
1707
1718
|
}
|
1708
1719
|
});
|
1709
1720
|
const Overlay = withInstall(stdin_default$1L);
|
@@ -4532,6 +4543,8 @@
|
|
4532
4543
|
autofocus: Boolean,
|
4533
4544
|
clearable: Boolean,
|
4534
4545
|
maxlength: numericProp,
|
4546
|
+
max: Number,
|
4547
|
+
min: Number,
|
4535
4548
|
formatter: Function,
|
4536
4549
|
clearIcon: makeStringProp("clear"),
|
4537
4550
|
modelValue: makeNumericProp(""),
|
@@ -4729,12 +4742,17 @@
|
|
4729
4742
|
return value;
|
4730
4743
|
};
|
4731
4744
|
const updateValue = (value, trigger = "onChange") => {
|
4745
|
+
var _a, _b;
|
4732
4746
|
const originalValue = value;
|
4733
4747
|
value = limitValueLength(value);
|
4734
4748
|
const limitDiffLen = getStringLength(originalValue) - getStringLength(value);
|
4735
4749
|
if (props2.type === "number" || props2.type === "digit") {
|
4736
4750
|
const isNumber = props2.type === "number";
|
4737
4751
|
value = formatNumber(value, isNumber, isNumber);
|
4752
|
+
if (trigger === "onBlur" && value !== "") {
|
4753
|
+
const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
|
4754
|
+
value = adjustedValue.toString();
|
4755
|
+
}
|
4738
4756
|
}
|
4739
4757
|
let formatterDiffLen = 0;
|
4740
4758
|
if (props2.formatter && trigger === props2.formatTrigger) {
|
@@ -7385,6 +7403,9 @@
|
|
7385
7403
|
if (!Array.isArray(defaultDate)) {
|
7386
7404
|
defaultDate = [];
|
7387
7405
|
}
|
7406
|
+
if (defaultDate.length === 1 && compareDay(defaultDate[0], now) === 1) {
|
7407
|
+
defaultDate = [];
|
7408
|
+
}
|
7388
7409
|
const min = minDate.value;
|
7389
7410
|
const max = maxDate.value;
|
7390
7411
|
const start2 = limitDateRange(defaultDate[0] || now, min, max ? allowSameDay ? max : getPrevDay(max) : void 0);
|
@@ -7700,9 +7721,8 @@
|
|
7700
7721
|
};
|
7701
7722
|
vue.watch(() => props2.show, init);
|
7702
7723
|
vue.watch(() => [props2.type, props2.minDate, props2.maxDate, props2.switchMode], () => reset(getInitialDate(currentDate.value)));
|
7703
|
-
vue.watch(() => props2.defaultDate, (value
|
7704
|
-
|
7705
|
-
scrollToCurrentDate();
|
7724
|
+
vue.watch(() => props2.defaultDate, (value) => {
|
7725
|
+
reset(value);
|
7706
7726
|
});
|
7707
7727
|
useExpose({
|
7708
7728
|
reset,
|
@@ -18262,7 +18282,7 @@
|
|
18262
18282
|
});
|
18263
18283
|
}
|
18264
18284
|
};
|
18265
|
-
const version = "4.9.
|
18285
|
+
const version = "4.9.5";
|
18266
18286
|
function install(app) {
|
18267
18287
|
const components = [
|
18268
18288
|
ActionBar,
|