vant 4.9.7 → 4.9.9
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/README.md +1 -0
- package/es/calendar/Calendar.mjs +1 -1
- package/es/calendar/CalendarDay.mjs +5 -3
- package/es/calendar/CalendarHeader.mjs +1 -1
- package/es/calendar/CalendarMonth.mjs +1 -1
- package/es/calendar/index.css +1 -1
- package/es/date-picker/DatePicker.d.ts +3 -3
- package/es/date-picker/DatePicker.mjs +9 -8
- package/es/date-picker/index.d.ts +2 -2
- package/es/date-picker/utils.d.ts +2 -4
- package/es/date-picker/utils.mjs +1 -6
- package/es/dialog/Dialog.d.ts +13 -0
- package/es/dialog/Dialog.mjs +5 -1
- package/es/dialog/index.d.ts +9 -0
- package/es/field/Field.d.ts +5 -1
- package/es/field/Field.mjs +7 -4
- package/es/field/index.d.ts +2 -0
- package/es/field/utils.d.ts +1 -1
- package/es/field/utils.mjs +6 -10
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/search/Search.d.ts +3 -0
- package/es/search/index.d.ts +2 -0
- package/es/time-picker/TimePicker.d.ts +3 -7
- package/es/time-picker/TimePicker.mjs +1 -2
- package/es/time-picker/index.d.ts +2 -4
- package/lib/calendar/Calendar.js +1 -1
- package/lib/calendar/CalendarDay.js +5 -3
- package/lib/calendar/CalendarHeader.js +1 -1
- package/lib/calendar/CalendarMonth.js +1 -1
- package/lib/calendar/index.css +1 -1
- package/lib/date-picker/DatePicker.d.ts +3 -3
- package/lib/date-picker/DatePicker.js +9 -8
- package/lib/date-picker/index.d.ts +2 -2
- package/lib/date-picker/utils.d.ts +2 -4
- package/lib/dialog/Dialog.d.ts +13 -0
- package/lib/dialog/Dialog.js +5 -1
- package/lib/dialog/index.d.ts +9 -0
- package/lib/field/Field.d.ts +5 -1
- package/lib/field/Field.js +7 -4
- package/lib/field/index.d.ts +2 -0
- package/lib/field/utils.d.ts +1 -1
- package/lib/field/utils.js +6 -10
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/search/Search.d.ts +3 -0
- package/lib/search/index.d.ts +2 -0
- package/lib/time-picker/TimePicker.d.ts +3 -7
- package/lib/time-picker/TimePicker.js +1 -2
- package/lib/time-picker/index.d.ts +2 -4
- package/lib/vant.cjs.js +37 -32
- package/lib/vant.es.js +37 -32
- package/lib/vant.js +38 -33
- package/lib/vant.min.js +3 -3
- package/lib/web-types.json +1 -1
- package/package.json +17 -17
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.9";
|
230
230
|
function install(app) {
|
231
231
|
const components = [
|
232
232
|
import_action_bar.ActionBar,
|
package/lib/search/Search.d.ts
CHANGED
@@ -50,6 +50,7 @@ export declare const searchProps: {
|
|
50
50
|
type: BooleanConstructor;
|
51
51
|
default: null;
|
52
52
|
};
|
53
|
+
inputmode: import("vue").PropType<import("vue").HTMLAttributes["inputmode"]>;
|
53
54
|
} & {
|
54
55
|
label: StringConstructor;
|
55
56
|
shape: {
|
@@ -119,6 +120,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
119
120
|
type: BooleanConstructor;
|
120
121
|
default: null;
|
121
122
|
};
|
123
|
+
inputmode: import("vue").PropType<import("vue").HTMLAttributes["inputmode"]>;
|
122
124
|
} & {
|
123
125
|
label: StringConstructor;
|
124
126
|
shape: {
|
@@ -186,6 +188,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
186
188
|
type: BooleanConstructor;
|
187
189
|
default: null;
|
188
190
|
};
|
191
|
+
inputmode: import("vue").PropType<import("vue").HTMLAttributes["inputmode"]>;
|
189
192
|
} & {
|
190
193
|
label: StringConstructor;
|
191
194
|
shape: {
|
package/lib/search/index.d.ts
CHANGED
@@ -49,6 +49,7 @@ export declare const Search: import("../utils").WithInstall<import("vue").Define
|
|
49
49
|
type: BooleanConstructor;
|
50
50
|
default: null;
|
51
51
|
};
|
52
|
+
inputmode: import("vue").PropType<import("vue").HTMLAttributes["inputmode"]>;
|
52
53
|
} & {
|
53
54
|
label: StringConstructor;
|
54
55
|
shape: {
|
@@ -116,6 +117,7 @@ export declare const Search: import("../utils").WithInstall<import("vue").Define
|
|
116
117
|
type: BooleanConstructor;
|
117
118
|
default: null;
|
118
119
|
};
|
120
|
+
inputmode: import("vue").PropType<import("vue").HTMLAttributes["inputmode"]>;
|
119
121
|
} & {
|
120
122
|
label: StringConstructor;
|
121
123
|
shape: {
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { type ExtractPropTypes, type PropType, type ComponentPublicInstance } from 'vue';
|
2
|
-
import { type TimeFilter } from '../date-picker/utils';
|
3
2
|
export type TimePickerColumnType = 'hour' | 'minute' | 'second';
|
4
3
|
export declare const timePickerProps: {
|
5
4
|
loading: BooleanConstructor;
|
@@ -30,7 +29,7 @@ export declare const timePickerProps: {
|
|
30
29
|
type: PropType<string[]>;
|
31
30
|
default: () => never[];
|
32
31
|
};
|
33
|
-
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values
|
32
|
+
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values: string[]) => import("../picker").PickerOption[]>;
|
34
33
|
formatter: {
|
35
34
|
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
|
36
35
|
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
|
@@ -72,7 +71,6 @@ export declare const timePickerProps: {
|
|
72
71
|
type: PropType<TimePickerColumnType[]>;
|
73
72
|
default: () => string[];
|
74
73
|
};
|
75
|
-
filter: PropType<TimeFilter>;
|
76
74
|
};
|
77
75
|
export type TimePickerProps = ExtractPropTypes<typeof timePickerProps>;
|
78
76
|
export type TimePickerExpose = {
|
@@ -109,7 +107,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
109
107
|
type: PropType<string[]>;
|
110
108
|
default: () => never[];
|
111
109
|
};
|
112
|
-
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values
|
110
|
+
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values: string[]) => import("../picker").PickerOption[]>;
|
113
111
|
formatter: {
|
114
112
|
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
|
115
113
|
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
|
@@ -151,7 +149,6 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
151
149
|
type: PropType<TimePickerColumnType[]>;
|
152
150
|
default: () => string[];
|
153
151
|
};
|
154
|
-
filter: PropType<TimeFilter>;
|
155
152
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
156
153
|
loading: BooleanConstructor;
|
157
154
|
readonly: BooleanConstructor;
|
@@ -181,7 +178,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
181
178
|
type: PropType<string[]>;
|
182
179
|
default: () => never[];
|
183
180
|
};
|
184
|
-
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values
|
181
|
+
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values: string[]) => import("../picker").PickerOption[]>;
|
185
182
|
formatter: {
|
186
183
|
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
|
187
184
|
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
|
@@ -223,7 +220,6 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
223
220
|
type: PropType<TimePickerColumnType[]>;
|
224
221
|
default: () => string[];
|
225
222
|
};
|
226
|
-
filter: PropType<TimeFilter>;
|
227
223
|
}>> & Readonly<{
|
228
224
|
onChange?: ((...args: any[]) => any) | undefined;
|
229
225
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
@@ -28,7 +28,7 @@ export declare const TimePicker: import("../utils").WithInstall<import("vue").De
|
|
28
28
|
type: import("vue").PropType<string[]>;
|
29
29
|
default: () => never[];
|
30
30
|
};
|
31
|
-
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[], values
|
31
|
+
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[], values: string[]) => import("..").PickerOption[]>;
|
32
32
|
formatter: {
|
33
33
|
type: import("vue").PropType<(type: string, option: import("..").PickerOption) => import("..").PickerOption>;
|
34
34
|
default: (type: string, option: import("..").PickerOption) => import("..").PickerOption;
|
@@ -70,7 +70,6 @@ export declare const TimePicker: import("../utils").WithInstall<import("vue").De
|
|
70
70
|
type: import("vue").PropType<import("./TimePicker").TimePickerColumnType[]>;
|
71
71
|
default: () => string[];
|
72
72
|
};
|
73
|
-
filter: import("vue").PropType<import("../date-picker/utils").TimeFilter>;
|
74
73
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
75
74
|
loading: BooleanConstructor;
|
76
75
|
readonly: BooleanConstructor;
|
@@ -100,7 +99,7 @@ export declare const TimePicker: import("../utils").WithInstall<import("vue").De
|
|
100
99
|
type: import("vue").PropType<string[]>;
|
101
100
|
default: () => never[];
|
102
101
|
};
|
103
|
-
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[], values
|
102
|
+
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[], values: string[]) => import("..").PickerOption[]>;
|
104
103
|
formatter: {
|
105
104
|
type: import("vue").PropType<(type: string, option: import("..").PickerOption) => import("..").PickerOption>;
|
106
105
|
default: (type: string, option: import("..").PickerOption) => import("..").PickerOption;
|
@@ -142,7 +141,6 @@ export declare const TimePicker: import("../utils").WithInstall<import("vue").De
|
|
142
141
|
type: import("vue").PropType<import("./TimePicker").TimePickerColumnType[]>;
|
143
142
|
default: () => string[];
|
144
143
|
};
|
145
|
-
filter: import("vue").PropType<import("../date-picker/utils").TimeFilter>;
|
146
144
|
}>> & Readonly<{
|
147
145
|
onChange?: ((...args: any[]) => any) | undefined;
|
148
146
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
package/lib/vant.cjs.js
CHANGED
@@ -4047,20 +4047,16 @@ function resizeTextarea(input, autosize) {
|
|
4047
4047
|
setRootScrollTop(scrollTop);
|
4048
4048
|
}
|
4049
4049
|
}
|
4050
|
-
function mapInputType(type) {
|
4050
|
+
function mapInputType(type, inputmode) {
|
4051
4051
|
if (type === "number") {
|
4052
|
-
|
4053
|
-
|
4054
|
-
inputmode: "decimal"
|
4055
|
-
};
|
4052
|
+
type = "text";
|
4053
|
+
inputmode != null ? inputmode : inputmode = "decimal";
|
4056
4054
|
}
|
4057
4055
|
if (type === "digit") {
|
4058
|
-
|
4059
|
-
|
4060
|
-
inputmode: "numeric"
|
4061
|
-
};
|
4056
|
+
type = "tel";
|
4057
|
+
inputmode != null ? inputmode : inputmode = "numeric";
|
4062
4058
|
}
|
4063
|
-
return { type };
|
4059
|
+
return { type, inputmode };
|
4064
4060
|
}
|
4065
4061
|
function getStringLength(str) {
|
4066
4062
|
return [...str].length;
|
@@ -4106,7 +4102,8 @@ const fieldSharedProps = {
|
|
4106
4102
|
readonly: {
|
4107
4103
|
type: Boolean,
|
4108
4104
|
default: null
|
4109
|
-
}
|
4105
|
+
},
|
4106
|
+
inputmode: String
|
4110
4107
|
};
|
4111
4108
|
const fieldProps = extend({}, cellSharedProps, fieldSharedProps, {
|
4112
4109
|
rows: numericProp,
|
@@ -4283,7 +4280,7 @@ var stdin_default$1v = vue.defineComponent({
|
|
4283
4280
|
if (props2.type === "number" || props2.type === "digit") {
|
4284
4281
|
const isNumber = props2.type === "number";
|
4285
4282
|
value = formatNumber(value, isNumber, isNumber);
|
4286
|
-
if (trigger === "onBlur" && value !== "") {
|
4283
|
+
if (trigger === "onBlur" && value !== "" && (props2.min !== void 0 || props2.max !== void 0)) {
|
4287
4284
|
const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
|
4288
4285
|
value = adjustedValue.toString();
|
4289
4286
|
}
|
@@ -4449,9 +4446,11 @@ var stdin_default$1v = vue.defineComponent({
|
|
4449
4446
|
onCompositionstart: startComposing
|
4450
4447
|
};
|
4451
4448
|
if (props2.type === "textarea") {
|
4452
|
-
return vue.createVNode("textarea", inputAttrs,
|
4449
|
+
return vue.createVNode("textarea", vue.mergeProps(inputAttrs, {
|
4450
|
+
"inputmode": props2.inputmode
|
4451
|
+
}), null);
|
4453
4452
|
}
|
4454
|
-
return vue.createVNode("input", vue.mergeProps(mapInputType(props2.type), inputAttrs), null);
|
4453
|
+
return vue.createVNode("input", vue.mergeProps(mapInputType(props2.type, props2.inputmode), inputAttrs), null);
|
4455
4454
|
};
|
4456
4455
|
const renderLeftIcon = () => {
|
4457
4456
|
const leftIconSlot = slots["left-icon"];
|
@@ -6497,6 +6496,9 @@ var stdin_default$1g = vue.defineComponent({
|
|
6497
6496
|
}, [slots["bottom-info"] ? slots["bottom-info"](props2.item) : bottomInfo]);
|
6498
6497
|
}
|
6499
6498
|
};
|
6499
|
+
const renderText = () => {
|
6500
|
+
return slots.text ? slots.text(props2.item) : props2.item.text;
|
6501
|
+
};
|
6500
6502
|
const renderContent = () => {
|
6501
6503
|
const {
|
6502
6504
|
item,
|
@@ -6504,10 +6506,9 @@ var stdin_default$1g = vue.defineComponent({
|
|
6504
6506
|
rowHeight
|
6505
6507
|
} = props2;
|
6506
6508
|
const {
|
6507
|
-
type
|
6508
|
-
text
|
6509
|
+
type
|
6509
6510
|
} = item;
|
6510
|
-
const Nodes = [renderTopInfo(),
|
6511
|
+
const Nodes = [renderTopInfo(), renderText(), renderBottomInfo()];
|
6511
6512
|
if (type === "selected") {
|
6512
6513
|
return vue.createVNode("div", {
|
6513
6514
|
"class": bem$13("selected-day"),
|
@@ -6724,7 +6725,7 @@ var stdin_default$1f = vue.defineComponent({
|
|
6724
6725
|
"rowHeight": rowHeight.value,
|
6725
6726
|
"onClick": (item2) => emit("click", item2),
|
6726
6727
|
"onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
|
6727
|
-
}, pick(slots, ["top-info", "bottom-info"]));
|
6728
|
+
}, pick(slots, ["top-info", "bottom-info", "text"]));
|
6728
6729
|
const renderDays = () => vue.createVNode("div", {
|
6729
6730
|
"ref": daysRef,
|
6730
6731
|
"role": "grid",
|
@@ -6824,7 +6825,7 @@ var stdin_default$1e = vue.defineComponent({
|
|
6824
6825
|
const canSwitch = props2.switchMode !== "none";
|
6825
6826
|
return vue.createVNode("div", {
|
6826
6827
|
"class": bem$13("header-subtitle", {
|
6827
|
-
"with-
|
6828
|
+
"with-switch": canSwitch
|
6828
6829
|
}),
|
6829
6830
|
"onClick": onClickSubtitle
|
6830
6831
|
}, [canSwitch ? [renderAction(), vue.createVNode("div", {
|
@@ -7198,7 +7199,7 @@ var stdin_default$1d = vue.defineComponent({
|
|
7198
7199
|
}, pick(props2, ["type", "color", "showMark", "formatter", "rowHeight", "showSubtitle", "allowSameDay"]), {
|
7199
7200
|
"onClick": onClickDay,
|
7200
7201
|
"onClickDisabledDate": (item) => emit("clickDisabledDate", item)
|
7201
|
-
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
7202
|
+
}), pick(slots, ["top-info", "bottom-info", "month-title", "text"]));
|
7202
7203
|
};
|
7203
7204
|
const renderFooterButton = () => {
|
7204
7205
|
if (slots.footer) {
|
@@ -9386,11 +9387,7 @@ var stdin_default$X = vue.defineComponent({
|
|
9386
9387
|
const currentValues = vue.ref(props2.modelValue);
|
9387
9388
|
const updatedByExternalSources = vue.ref(false);
|
9388
9389
|
const pickerRef = vue.ref();
|
9389
|
-
const
|
9390
|
-
const minYear = props2.minDate.getFullYear();
|
9391
|
-
const maxYear = props2.maxDate.getFullYear();
|
9392
|
-
return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter);
|
9393
|
-
};
|
9390
|
+
const computedValues = vue.computed(() => updatedByExternalSources.value ? props2.modelValue : currentValues.value);
|
9394
9391
|
const isMinYear = (year) => year === props2.minDate.getFullYear();
|
9395
9392
|
const isMaxYear = (year) => year === props2.maxDate.getFullYear();
|
9396
9393
|
const isMinMonth = (month) => month === props2.minDate.getMonth() + 1;
|
@@ -9401,7 +9398,7 @@ var stdin_default$X = vue.defineComponent({
|
|
9401
9398
|
columnsType
|
9402
9399
|
} = props2;
|
9403
9400
|
const index = columnsType.indexOf(type);
|
9404
|
-
const value =
|
9401
|
+
const value = computedValues.value[index];
|
9405
9402
|
if (value) {
|
9406
9403
|
return +value;
|
9407
9404
|
}
|
@@ -9414,18 +9411,23 @@ var stdin_default$X = vue.defineComponent({
|
|
9414
9411
|
return minDate.getDate();
|
9415
9412
|
}
|
9416
9413
|
};
|
9414
|
+
const genYearOptions = () => {
|
9415
|
+
const minYear = props2.minDate.getFullYear();
|
9416
|
+
const maxYear = props2.maxDate.getFullYear();
|
9417
|
+
return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter, computedValues.value);
|
9418
|
+
};
|
9417
9419
|
const genMonthOptions = () => {
|
9418
9420
|
const year = getValue2("year");
|
9419
9421
|
const minMonth = isMinYear(year) ? props2.minDate.getMonth() + 1 : 1;
|
9420
9422
|
const maxMonth = isMaxYear(year) ? props2.maxDate.getMonth() + 1 : 12;
|
9421
|
-
return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter);
|
9423
|
+
return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter, computedValues.value);
|
9422
9424
|
};
|
9423
9425
|
const genDayOptions = () => {
|
9424
9426
|
const year = getValue2("year");
|
9425
9427
|
const month = getValue2("month");
|
9426
9428
|
const minDate = isMinYear(year) && isMinMonth(month) ? props2.minDate.getDate() : 1;
|
9427
9429
|
const maxDate = isMaxYear(year) && isMaxMonth(month) ? props2.maxDate.getDate() : getMonthEndDay(year, month);
|
9428
|
-
return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter);
|
9430
|
+
return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter, computedValues.value);
|
9429
9431
|
};
|
9430
9432
|
const confirm = () => {
|
9431
9433
|
var _a;
|
@@ -9501,7 +9503,8 @@ const dialogProps = extend({}, popupSharedProps, {
|
|
9501
9503
|
confirmButtonColor: String,
|
9502
9504
|
confirmButtonDisabled: Boolean,
|
9503
9505
|
showConfirmButton: truthProp,
|
9504
|
-
closeOnClickOverlay: Boolean
|
9506
|
+
closeOnClickOverlay: Boolean,
|
9507
|
+
keyboardEnabled: truthProp
|
9505
9508
|
});
|
9506
9509
|
const popupInheritKeys$1 = [...popupSharedPropKeys, "transition", "closeOnPopstate"];
|
9507
9510
|
var stdin_default$W = vue.defineComponent({
|
@@ -9548,6 +9551,9 @@ var stdin_default$W = vue.defineComponent({
|
|
9548
9551
|
const onConfirm = getActionHandler("confirm");
|
9549
9552
|
const onKeydown = vue.withKeys((event) => {
|
9550
9553
|
var _a, _b;
|
9554
|
+
if (!props2.keyboardEnabled) {
|
9555
|
+
return;
|
9556
|
+
}
|
9551
9557
|
if (event.target !== ((_b = (_a = root.value) == null ? void 0 : _a.popupRef) == null ? void 0 : _b.value)) {
|
9552
9558
|
return;
|
9553
9559
|
}
|
@@ -15420,8 +15426,7 @@ const timePickerProps = extend({}, sharedProps, {
|
|
15420
15426
|
columnsType: {
|
15421
15427
|
type: Array,
|
15422
15428
|
default: () => ["hour", "minute"]
|
15423
|
-
}
|
15424
|
-
filter: Function
|
15429
|
+
}
|
15425
15430
|
});
|
15426
15431
|
var stdin_default$8 = vue.defineComponent({
|
15427
15432
|
name: name$3,
|
@@ -17055,7 +17060,7 @@ const Lazyload = {
|
|
17055
17060
|
});
|
17056
17061
|
}
|
17057
17062
|
};
|
17058
|
-
const version = "4.9.
|
17063
|
+
const version = "4.9.9";
|
17059
17064
|
function install(app) {
|
17060
17065
|
const components = [
|
17061
17066
|
ActionBar,
|
package/lib/vant.es.js
CHANGED
@@ -4045,20 +4045,16 @@ function resizeTextarea(input, autosize) {
|
|
4045
4045
|
setRootScrollTop(scrollTop);
|
4046
4046
|
}
|
4047
4047
|
}
|
4048
|
-
function mapInputType(type) {
|
4048
|
+
function mapInputType(type, inputmode) {
|
4049
4049
|
if (type === "number") {
|
4050
|
-
|
4051
|
-
|
4052
|
-
inputmode: "decimal"
|
4053
|
-
};
|
4050
|
+
type = "text";
|
4051
|
+
inputmode != null ? inputmode : inputmode = "decimal";
|
4054
4052
|
}
|
4055
4053
|
if (type === "digit") {
|
4056
|
-
|
4057
|
-
|
4058
|
-
inputmode: "numeric"
|
4059
|
-
};
|
4054
|
+
type = "tel";
|
4055
|
+
inputmode != null ? inputmode : inputmode = "numeric";
|
4060
4056
|
}
|
4061
|
-
return { type };
|
4057
|
+
return { type, inputmode };
|
4062
4058
|
}
|
4063
4059
|
function getStringLength(str) {
|
4064
4060
|
return [...str].length;
|
@@ -4104,7 +4100,8 @@ const fieldSharedProps = {
|
|
4104
4100
|
readonly: {
|
4105
4101
|
type: Boolean,
|
4106
4102
|
default: null
|
4107
|
-
}
|
4103
|
+
},
|
4104
|
+
inputmode: String
|
4108
4105
|
};
|
4109
4106
|
const fieldProps = extend({}, cellSharedProps, fieldSharedProps, {
|
4110
4107
|
rows: numericProp,
|
@@ -4281,7 +4278,7 @@ var stdin_default$1v = defineComponent({
|
|
4281
4278
|
if (props2.type === "number" || props2.type === "digit") {
|
4282
4279
|
const isNumber = props2.type === "number";
|
4283
4280
|
value = formatNumber(value, isNumber, isNumber);
|
4284
|
-
if (trigger === "onBlur" && value !== "") {
|
4281
|
+
if (trigger === "onBlur" && value !== "" && (props2.min !== void 0 || props2.max !== void 0)) {
|
4285
4282
|
const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
|
4286
4283
|
value = adjustedValue.toString();
|
4287
4284
|
}
|
@@ -4447,9 +4444,11 @@ var stdin_default$1v = defineComponent({
|
|
4447
4444
|
onCompositionstart: startComposing
|
4448
4445
|
};
|
4449
4446
|
if (props2.type === "textarea") {
|
4450
|
-
return createVNode("textarea", inputAttrs,
|
4447
|
+
return createVNode("textarea", mergeProps(inputAttrs, {
|
4448
|
+
"inputmode": props2.inputmode
|
4449
|
+
}), null);
|
4451
4450
|
}
|
4452
|
-
return createVNode("input", mergeProps(mapInputType(props2.type), inputAttrs), null);
|
4451
|
+
return createVNode("input", mergeProps(mapInputType(props2.type, props2.inputmode), inputAttrs), null);
|
4453
4452
|
};
|
4454
4453
|
const renderLeftIcon = () => {
|
4455
4454
|
const leftIconSlot = slots["left-icon"];
|
@@ -6495,6 +6494,9 @@ var stdin_default$1g = defineComponent({
|
|
6495
6494
|
}, [slots["bottom-info"] ? slots["bottom-info"](props2.item) : bottomInfo]);
|
6496
6495
|
}
|
6497
6496
|
};
|
6497
|
+
const renderText = () => {
|
6498
|
+
return slots.text ? slots.text(props2.item) : props2.item.text;
|
6499
|
+
};
|
6498
6500
|
const renderContent = () => {
|
6499
6501
|
const {
|
6500
6502
|
item,
|
@@ -6502,10 +6504,9 @@ var stdin_default$1g = defineComponent({
|
|
6502
6504
|
rowHeight
|
6503
6505
|
} = props2;
|
6504
6506
|
const {
|
6505
|
-
type
|
6506
|
-
text
|
6507
|
+
type
|
6507
6508
|
} = item;
|
6508
|
-
const Nodes = [renderTopInfo(),
|
6509
|
+
const Nodes = [renderTopInfo(), renderText(), renderBottomInfo()];
|
6509
6510
|
if (type === "selected") {
|
6510
6511
|
return createVNode("div", {
|
6511
6512
|
"class": bem$13("selected-day"),
|
@@ -6722,7 +6723,7 @@ var stdin_default$1f = defineComponent({
|
|
6722
6723
|
"rowHeight": rowHeight.value,
|
6723
6724
|
"onClick": (item2) => emit("click", item2),
|
6724
6725
|
"onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
|
6725
|
-
}, pick(slots, ["top-info", "bottom-info"]));
|
6726
|
+
}, pick(slots, ["top-info", "bottom-info", "text"]));
|
6726
6727
|
const renderDays = () => createVNode("div", {
|
6727
6728
|
"ref": daysRef,
|
6728
6729
|
"role": "grid",
|
@@ -6822,7 +6823,7 @@ var stdin_default$1e = defineComponent({
|
|
6822
6823
|
const canSwitch = props2.switchMode !== "none";
|
6823
6824
|
return createVNode("div", {
|
6824
6825
|
"class": bem$13("header-subtitle", {
|
6825
|
-
"with-
|
6826
|
+
"with-switch": canSwitch
|
6826
6827
|
}),
|
6827
6828
|
"onClick": onClickSubtitle
|
6828
6829
|
}, [canSwitch ? [renderAction(), createVNode("div", {
|
@@ -7196,7 +7197,7 @@ var stdin_default$1d = defineComponent({
|
|
7196
7197
|
}, pick(props2, ["type", "color", "showMark", "formatter", "rowHeight", "showSubtitle", "allowSameDay"]), {
|
7197
7198
|
"onClick": onClickDay,
|
7198
7199
|
"onClickDisabledDate": (item) => emit("clickDisabledDate", item)
|
7199
|
-
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
7200
|
+
}), pick(slots, ["top-info", "bottom-info", "month-title", "text"]));
|
7200
7201
|
};
|
7201
7202
|
const renderFooterButton = () => {
|
7202
7203
|
if (slots.footer) {
|
@@ -9384,11 +9385,7 @@ var stdin_default$X = defineComponent({
|
|
9384
9385
|
const currentValues = ref(props2.modelValue);
|
9385
9386
|
const updatedByExternalSources = ref(false);
|
9386
9387
|
const pickerRef = ref();
|
9387
|
-
const
|
9388
|
-
const minYear = props2.minDate.getFullYear();
|
9389
|
-
const maxYear = props2.maxDate.getFullYear();
|
9390
|
-
return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter);
|
9391
|
-
};
|
9388
|
+
const computedValues = computed(() => updatedByExternalSources.value ? props2.modelValue : currentValues.value);
|
9392
9389
|
const isMinYear = (year) => year === props2.minDate.getFullYear();
|
9393
9390
|
const isMaxYear = (year) => year === props2.maxDate.getFullYear();
|
9394
9391
|
const isMinMonth = (month) => month === props2.minDate.getMonth() + 1;
|
@@ -9399,7 +9396,7 @@ var stdin_default$X = defineComponent({
|
|
9399
9396
|
columnsType
|
9400
9397
|
} = props2;
|
9401
9398
|
const index = columnsType.indexOf(type);
|
9402
|
-
const value =
|
9399
|
+
const value = computedValues.value[index];
|
9403
9400
|
if (value) {
|
9404
9401
|
return +value;
|
9405
9402
|
}
|
@@ -9412,18 +9409,23 @@ var stdin_default$X = defineComponent({
|
|
9412
9409
|
return minDate.getDate();
|
9413
9410
|
}
|
9414
9411
|
};
|
9412
|
+
const genYearOptions = () => {
|
9413
|
+
const minYear = props2.minDate.getFullYear();
|
9414
|
+
const maxYear = props2.maxDate.getFullYear();
|
9415
|
+
return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter, computedValues.value);
|
9416
|
+
};
|
9415
9417
|
const genMonthOptions = () => {
|
9416
9418
|
const year = getValue2("year");
|
9417
9419
|
const minMonth = isMinYear(year) ? props2.minDate.getMonth() + 1 : 1;
|
9418
9420
|
const maxMonth = isMaxYear(year) ? props2.maxDate.getMonth() + 1 : 12;
|
9419
|
-
return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter);
|
9421
|
+
return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter, computedValues.value);
|
9420
9422
|
};
|
9421
9423
|
const genDayOptions = () => {
|
9422
9424
|
const year = getValue2("year");
|
9423
9425
|
const month = getValue2("month");
|
9424
9426
|
const minDate = isMinYear(year) && isMinMonth(month) ? props2.minDate.getDate() : 1;
|
9425
9427
|
const maxDate = isMaxYear(year) && isMaxMonth(month) ? props2.maxDate.getDate() : getMonthEndDay(year, month);
|
9426
|
-
return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter);
|
9428
|
+
return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter, computedValues.value);
|
9427
9429
|
};
|
9428
9430
|
const confirm = () => {
|
9429
9431
|
var _a;
|
@@ -9499,7 +9501,8 @@ const dialogProps = extend({}, popupSharedProps, {
|
|
9499
9501
|
confirmButtonColor: String,
|
9500
9502
|
confirmButtonDisabled: Boolean,
|
9501
9503
|
showConfirmButton: truthProp,
|
9502
|
-
closeOnClickOverlay: Boolean
|
9504
|
+
closeOnClickOverlay: Boolean,
|
9505
|
+
keyboardEnabled: truthProp
|
9503
9506
|
});
|
9504
9507
|
const popupInheritKeys$1 = [...popupSharedPropKeys, "transition", "closeOnPopstate"];
|
9505
9508
|
var stdin_default$W = defineComponent({
|
@@ -9546,6 +9549,9 @@ var stdin_default$W = defineComponent({
|
|
9546
9549
|
const onConfirm = getActionHandler("confirm");
|
9547
9550
|
const onKeydown = withKeys((event) => {
|
9548
9551
|
var _a, _b;
|
9552
|
+
if (!props2.keyboardEnabled) {
|
9553
|
+
return;
|
9554
|
+
}
|
9549
9555
|
if (event.target !== ((_b = (_a = root.value) == null ? void 0 : _a.popupRef) == null ? void 0 : _b.value)) {
|
9550
9556
|
return;
|
9551
9557
|
}
|
@@ -15418,8 +15424,7 @@ const timePickerProps = extend({}, sharedProps, {
|
|
15418
15424
|
columnsType: {
|
15419
15425
|
type: Array,
|
15420
15426
|
default: () => ["hour", "minute"]
|
15421
|
-
}
|
15422
|
-
filter: Function
|
15427
|
+
}
|
15423
15428
|
});
|
15424
15429
|
var stdin_default$8 = defineComponent({
|
15425
15430
|
name: name$3,
|
@@ -17053,7 +17058,7 @@ const Lazyload = {
|
|
17053
17058
|
});
|
17054
17059
|
}
|
17055
17060
|
};
|
17056
|
-
const version = "4.9.
|
17061
|
+
const version = "4.9.9";
|
17057
17062
|
function install(app) {
|
17058
17063
|
const components = [
|
17059
17064
|
ActionBar,
|