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
@@ -105,7 +105,7 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
105
105
|
const canSwitch = props.switchMode !== "none";
|
106
106
|
return (0, import_vue.createVNode)("div", {
|
107
107
|
"class": (0, import_utils2.bem)("header-subtitle", {
|
108
|
-
"with-
|
108
|
+
"with-switch": canSwitch
|
109
109
|
}),
|
110
110
|
"onClick": onClickSubtitle
|
111
111
|
}, [canSwitch ? [renderAction(), (0, import_vue.createVNode)("div", {
|
@@ -221,7 +221,7 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
221
221
|
"rowHeight": rowHeight.value,
|
222
222
|
"onClick": (item2) => emit("click", item2),
|
223
223
|
"onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
|
224
|
-
}, (0, import_utils.pick)(slots, ["top-info", "bottom-info"]));
|
224
|
+
}, (0, import_utils.pick)(slots, ["top-info", "bottom-info", "text"]));
|
225
225
|
const renderDays = () => (0, import_vue.createVNode)("div", {
|
226
226
|
"ref": daysRef,
|
227
227
|
"role": "grid",
|
package/lib/calendar/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root,:host{--van-calendar-background: var(--van-background-2);--van-calendar-popup-height: 80%;--van-calendar-header-shadow: 0 2px 10px rgba(125, 126, 128, .16);--van-calendar-header-title-height: 44px;--van-calendar-header-title-font-size: var(--van-font-size-lg);--van-calendar-header-subtitle-font-size: var(--van-font-size-md);--van-calendar-header-action-width: 28px;--van-calendar-header-action-color: var(--van-text-color);--van-calendar-header-action-disabled-color: var(--van-text-color-3);--van-calendar-weekdays-height: 30px;--van-calendar-weekdays-font-size: var(--van-font-size-sm);--van-calendar-month-title-font-size: var(--van-font-size-md);--van-calendar-month-mark-color: rgba(242, 243, 245, .8);--van-calendar-month-mark-font-size: 160px;--van-calendar-day-height: 64px;--van-calendar-day-font-size: var(--van-font-size-lg);--van-calendar-day-margin-bottom: 4px;--van-calendar-day-disabled-color: var(--van-text-color-3);--van-calendar-range-edge-color: var(--van-white);--van-calendar-range-edge-background: var(--van-primary-color);--van-calendar-range-middle-color: var(--van-primary-color);--van-calendar-range-middle-background-opacity: .1;--van-calendar-selected-day-size: 54px;--van-calendar-selected-day-color: var(--van-white);--van-calendar-selected-day-background: var(--van-primary-color);--van-calendar-info-font-size: var(--van-font-size-xs);--van-calendar-info-line-height: var(--van-line-height-xs);--van-calendar-confirm-button-height: 36px;--van-calendar-confirm-button-margin: 7px 0}.van-theme-dark{--van-calendar-month-mark-color: rgba(100, 101, 102, .2);--van-calendar-day-disabled-color: var(--van-gray-7)}.van-calendar{display:flex;flex-direction:column;height:100%;background:var(--van-calendar-background)}.van-calendar__popup.van-popup--top,.van-calendar__popup.van-popup--bottom{height:var(--van-calendar-popup-height)}.van-calendar__popup.van-popup--left,.van-calendar__popup.van-popup--right{height:100%}.van-calendar__popup .van-popup__close-icon{top:11px}.van-calendar__header{flex-shrink:0;box-shadow:var(--van-calendar-header-shadow)}.van-calendar__month-title,.van-calendar__header-title,.van-calendar__header-subtitle{color:var(--van-text-color);height:var(--van-calendar-header-title-height);font-weight:var(--van-font-bold);line-height:var(--van-calendar-header-title-height);text-align:center}.van-calendar__header-title{font-size:var(--van-calendar-header-title-font-size)}.van-calendar__header-subtitle{font-size:var(--van-calendar-header-subtitle-font-size)}.van-calendar__header-subtitle--with-
|
1
|
+
:root,:host{--van-calendar-background: var(--van-background-2);--van-calendar-popup-height: 80%;--van-calendar-header-shadow: 0 2px 10px rgba(125, 126, 128, .16);--van-calendar-header-title-height: 44px;--van-calendar-header-title-font-size: var(--van-font-size-lg);--van-calendar-header-subtitle-font-size: var(--van-font-size-md);--van-calendar-header-action-width: 28px;--van-calendar-header-action-color: var(--van-text-color);--van-calendar-header-action-disabled-color: var(--van-text-color-3);--van-calendar-weekdays-height: 30px;--van-calendar-weekdays-font-size: var(--van-font-size-sm);--van-calendar-month-title-font-size: var(--van-font-size-md);--van-calendar-month-mark-color: rgba(242, 243, 245, .8);--van-calendar-month-mark-font-size: 160px;--van-calendar-day-height: 64px;--van-calendar-day-font-size: var(--van-font-size-lg);--van-calendar-day-margin-bottom: 4px;--van-calendar-day-disabled-color: var(--van-text-color-3);--van-calendar-range-edge-color: var(--van-white);--van-calendar-range-edge-background: var(--van-primary-color);--van-calendar-range-middle-color: var(--van-primary-color);--van-calendar-range-middle-background-opacity: .1;--van-calendar-selected-day-size: 54px;--van-calendar-selected-day-color: var(--van-white);--van-calendar-selected-day-background: var(--van-primary-color);--van-calendar-info-font-size: var(--van-font-size-xs);--van-calendar-info-line-height: var(--van-line-height-xs);--van-calendar-confirm-button-height: 36px;--van-calendar-confirm-button-margin: 7px 0}.van-theme-dark{--van-calendar-month-mark-color: rgba(100, 101, 102, .2);--van-calendar-day-disabled-color: var(--van-gray-7)}.van-calendar{display:flex;flex-direction:column;height:100%;background:var(--van-calendar-background)}.van-calendar__popup.van-popup--top,.van-calendar__popup.van-popup--bottom{height:var(--van-calendar-popup-height)}.van-calendar__popup.van-popup--left,.van-calendar__popup.van-popup--right{height:100%}.van-calendar__popup .van-popup__close-icon{top:11px}.van-calendar__header{flex-shrink:0;box-shadow:var(--van-calendar-header-shadow)}.van-calendar__month-title,.van-calendar__header-title,.van-calendar__header-subtitle{color:var(--van-text-color);height:var(--van-calendar-header-title-height);font-weight:var(--van-font-bold);line-height:var(--van-calendar-header-title-height);text-align:center}.van-calendar__header-title{font-size:var(--van-calendar-header-title-font-size)}.van-calendar__header-subtitle{font-size:var(--van-calendar-header-subtitle-font-size)}.van-calendar__header-subtitle--with-switch{display:flex;align-items:center;padding:0 var(--van-padding-base)}.van-calendar__header-subtitle-text{flex:1}.van-calendar__header-action{display:flex;align-items:center;justify-content:center;min-width:var(--van-calendar-header-action-width);height:100%;color:var(--van-calendar-header-action-color);cursor:pointer}.van-calendar__header-action--disabled{color:var(--van-calendar-header-action-disabled-color);cursor:not-allowed}.van-calendar__month-title{font-size:var(--van-calendar-month-title-font-size)}.van-calendar__weekdays{display:flex}.van-calendar__weekday{flex:1;font-size:var(--van-calendar-weekdays-font-size);line-height:var(--van-calendar-weekdays-height);text-align:center}.van-calendar__body{flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.van-calendar__days{position:relative;display:flex;flex-wrap:wrap;-webkit-user-select:none;user-select:none}.van-calendar__month-mark{position:absolute;top:50%;left:50%;z-index:0;color:var(--van-calendar-month-mark-color);font-size:var(--van-calendar-month-mark-font-size);transform:translate(-50%,-50%);pointer-events:none}.van-calendar__day,.van-calendar__selected-day{display:flex;align-items:center;justify-content:center;text-align:center}.van-calendar__day{position:relative;width:14.285%;height:var(--van-calendar-day-height);font-size:var(--van-calendar-day-font-size);margin-bottom:var(--van-calendar-day-margin-bottom);cursor:pointer}.van-calendar__day--end,.van-calendar__day--start,.van-calendar__day--start-end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected{color:var(--van-calendar-range-edge-color);background:var(--van-calendar-range-edge-background)}.van-calendar__day--start{border-radius:var(--van-radius-md) 0 0 var(--van-radius-md)}.van-calendar__day--end{border-radius:0 var(--van-radius-md) var(--van-radius-md) 0}.van-calendar__day--start-end,.van-calendar__day--multiple-selected{border-radius:var(--van-radius-md)}.van-calendar__day--middle{color:var(--van-calendar-range-middle-color)}.van-calendar__day--middle:after{position:absolute;top:0;right:0;bottom:0;left:0;background-color:currentColor;opacity:var(--van-calendar-range-middle-background-opacity);content:""}.van-calendar__day--disabled{color:var(--van-calendar-day-disabled-color);cursor:default}.van-calendar__top-info,.van-calendar__bottom-info{position:absolute;right:0;left:0;font-size:var(--van-calendar-info-font-size);line-height:var(--van-calendar-info-line-height)}@media (max-width: 350px){.van-calendar__top-info,.van-calendar__bottom-info{font-size:9px}}.van-calendar__top-info{top:6px}.van-calendar__bottom-info{bottom:6px}.van-calendar__selected-day{width:var(--van-calendar-selected-day-size);height:var(--van-calendar-selected-day-size);color:var(--van-calendar-selected-day-color);background:var(--van-calendar-selected-day-background);border-radius:var(--van-radius-md)}.van-calendar__footer{flex-shrink:0;padding-left:var(--van-padding-md);padding-right:var(--van-padding-md)}.van-calendar__confirm{height:var(--van-calendar-confirm-button-height);margin:var(--van-calendar-confirm-button-margin)}
|
@@ -29,7 +29,7 @@ export declare const datePickerProps: {
|
|
29
29
|
type: PropType<string[]>;
|
30
30
|
default: () => never[];
|
31
31
|
};
|
32
|
-
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values
|
32
|
+
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values: string[]) => import("../picker").PickerOption[]>;
|
33
33
|
formatter: {
|
34
34
|
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
|
35
35
|
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
|
@@ -85,7 +85,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
85
85
|
type: PropType<string[]>;
|
86
86
|
default: () => never[];
|
87
87
|
};
|
88
|
-
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values
|
88
|
+
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values: string[]) => import("../picker").PickerOption[]>;
|
89
89
|
formatter: {
|
90
90
|
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
|
91
91
|
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
|
@@ -134,7 +134,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
134
134
|
type: PropType<string[]>;
|
135
135
|
default: () => never[];
|
136
136
|
};
|
137
|
-
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values
|
137
|
+
filter: PropType<(columnType: string, options: import("../picker").PickerOption[], values: string[]) => import("../picker").PickerOption[]>;
|
138
138
|
formatter: {
|
139
139
|
type: PropType<(type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption>;
|
140
140
|
default: (type: string, option: import("../picker").PickerOption) => import("../picker").PickerOption;
|
@@ -55,11 +55,7 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
55
55
|
const currentValues = (0, import_vue.ref)(props.modelValue);
|
56
56
|
const updatedByExternalSources = (0, import_vue.ref)(false);
|
57
57
|
const pickerRef = (0, import_vue.ref)();
|
58
|
-
const
|
59
|
-
const minYear = props.minDate.getFullYear();
|
60
|
-
const maxYear = props.maxDate.getFullYear();
|
61
|
-
return (0, import_utils2.genOptions)(minYear, maxYear, "year", props.formatter, props.filter);
|
62
|
-
};
|
58
|
+
const computedValues = (0, import_vue.computed)(() => updatedByExternalSources.value ? props.modelValue : currentValues.value);
|
63
59
|
const isMinYear = (year) => year === props.minDate.getFullYear();
|
64
60
|
const isMaxYear = (year) => year === props.maxDate.getFullYear();
|
65
61
|
const isMinMonth = (month) => month === props.minDate.getMonth() + 1;
|
@@ -70,7 +66,7 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
70
66
|
columnsType
|
71
67
|
} = props;
|
72
68
|
const index = columnsType.indexOf(type);
|
73
|
-
const value =
|
69
|
+
const value = computedValues.value[index];
|
74
70
|
if (value) {
|
75
71
|
return +value;
|
76
72
|
}
|
@@ -83,18 +79,23 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
83
79
|
return minDate.getDate();
|
84
80
|
}
|
85
81
|
};
|
82
|
+
const genYearOptions = () => {
|
83
|
+
const minYear = props.minDate.getFullYear();
|
84
|
+
const maxYear = props.maxDate.getFullYear();
|
85
|
+
return (0, import_utils2.genOptions)(minYear, maxYear, "year", props.formatter, props.filter, computedValues.value);
|
86
|
+
};
|
86
87
|
const genMonthOptions = () => {
|
87
88
|
const year = getValue("year");
|
88
89
|
const minMonth = isMinYear(year) ? props.minDate.getMonth() + 1 : 1;
|
89
90
|
const maxMonth = isMaxYear(year) ? props.maxDate.getMonth() + 1 : 12;
|
90
|
-
return (0, import_utils2.genOptions)(minMonth, maxMonth, "month", props.formatter, props.filter);
|
91
|
+
return (0, import_utils2.genOptions)(minMonth, maxMonth, "month", props.formatter, props.filter, computedValues.value);
|
91
92
|
};
|
92
93
|
const genDayOptions = () => {
|
93
94
|
const year = getValue("year");
|
94
95
|
const month = getValue("month");
|
95
96
|
const minDate = isMinYear(year) && isMinMonth(month) ? props.minDate.getDate() : 1;
|
96
97
|
const maxDate = isMaxYear(year) && isMaxMonth(month) ? props.maxDate.getDate() : (0, import_utils2.getMonthEndDay)(year, month);
|
97
|
-
return (0, import_utils2.genOptions)(minDate, maxDate, "day", props.formatter, props.filter);
|
98
|
+
return (0, import_utils2.genOptions)(minDate, maxDate, "day", props.formatter, props.filter, computedValues.value);
|
98
99
|
};
|
99
100
|
const confirm = () => {
|
100
101
|
var _a;
|
@@ -28,7 +28,7 @@ export declare const DatePicker: 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;
|
@@ -77,7 +77,7 @@ export declare const DatePicker: import("../utils").WithInstall<import("vue").De
|
|
77
77
|
type: import("vue").PropType<string[]>;
|
78
78
|
default: () => never[];
|
79
79
|
};
|
80
|
-
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[], values
|
80
|
+
filter: import("vue").PropType<(columnType: string, options: import("..").PickerOption[], values: string[]) => import("..").PickerOption[]>;
|
81
81
|
formatter: {
|
82
82
|
type: import("vue").PropType<(type: string, option: import("..").PickerOption) => import("..").PickerOption>;
|
83
83
|
default: (type: string, option: import("..").PickerOption) => import("..").PickerOption;
|
@@ -1,9 +1,7 @@
|
|
1
|
-
import { type RequiredParams } from '../utils';
|
2
1
|
import { pickerSharedProps } from '../picker/Picker';
|
3
2
|
import type { PropType } from 'vue';
|
4
3
|
import type { PickerOption } from '../picker';
|
5
|
-
type Filter = (columnType: string, options: PickerOption[], values
|
6
|
-
export type TimeFilter = RequiredParams<Filter>;
|
4
|
+
type Filter = (columnType: string, options: PickerOption[], values: string[]) => PickerOption[];
|
7
5
|
type Formatter = (type: string, option: PickerOption) => PickerOption;
|
8
6
|
export declare const sharedProps: {
|
9
7
|
loading: BooleanConstructor;
|
@@ -43,6 +41,6 @@ export declare const sharedProps: {
|
|
43
41
|
export declare const pickerInheritKeys: Array<keyof typeof pickerSharedProps>;
|
44
42
|
export declare function times<T>(n: number, iteratee: (index: number) => T): T[];
|
45
43
|
export declare const getMonthEndDay: (year: number, month: number) => number;
|
46
|
-
export declare const genOptions: <T extends string>(min: number, max: number, type: T, formatter: Formatter, filter
|
44
|
+
export declare const genOptions: <T extends string>(min: number, max: number, type: T, formatter: Formatter, filter: Filter | undefined, values: string[]) => PickerOption[];
|
47
45
|
export declare const formatValueRange: (values: string[], columns: PickerOption[][]) => string[];
|
48
46
|
export {};
|
package/lib/dialog/Dialog.d.ts
CHANGED
@@ -54,6 +54,10 @@ export declare const dialogProps: {
|
|
54
54
|
default: true;
|
55
55
|
};
|
56
56
|
closeOnClickOverlay: BooleanConstructor;
|
57
|
+
keyboardEnabled: {
|
58
|
+
type: BooleanConstructor;
|
59
|
+
default: true;
|
60
|
+
};
|
57
61
|
};
|
58
62
|
export type DialogProps = ExtractPropTypes<typeof dialogProps>;
|
59
63
|
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
@@ -110,6 +114,10 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
110
114
|
default: true;
|
111
115
|
};
|
112
116
|
closeOnClickOverlay: BooleanConstructor;
|
117
|
+
keyboardEnabled: {
|
118
|
+
type: BooleanConstructor;
|
119
|
+
default: true;
|
120
|
+
};
|
113
121
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "keydown" | "update:show" | "confirm")[], "cancel" | "keydown" | "update:show" | "confirm", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
114
122
|
show: BooleanConstructor;
|
115
123
|
zIndex: (NumberConstructor | StringConstructor)[];
|
@@ -164,6 +172,10 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
164
172
|
default: true;
|
165
173
|
};
|
166
174
|
closeOnClickOverlay: BooleanConstructor;
|
175
|
+
keyboardEnabled: {
|
176
|
+
type: BooleanConstructor;
|
177
|
+
default: true;
|
178
|
+
};
|
167
179
|
}>> & Readonly<{
|
168
180
|
onKeydown?: ((...args: any[]) => any) | undefined;
|
169
181
|
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
@@ -183,5 +195,6 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
183
195
|
cancelButtonDisabled: boolean;
|
184
196
|
confirmButtonDisabled: boolean;
|
185
197
|
showConfirmButton: boolean;
|
198
|
+
keyboardEnabled: boolean;
|
186
199
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
187
200
|
export default _default;
|
package/lib/dialog/Dialog.js
CHANGED
@@ -48,7 +48,8 @@ const dialogProps = (0, import_utils.extend)({}, import_shared.popupSharedProps,
|
|
48
48
|
confirmButtonColor: String,
|
49
49
|
confirmButtonDisabled: Boolean,
|
50
50
|
showConfirmButton: import_utils.truthProp,
|
51
|
-
closeOnClickOverlay: Boolean
|
51
|
+
closeOnClickOverlay: Boolean,
|
52
|
+
keyboardEnabled: import_utils.truthProp
|
52
53
|
});
|
53
54
|
const popupInheritKeys = [...import_shared.popupSharedPropKeys, "transition", "closeOnPopstate"];
|
54
55
|
var stdin_default = (0, import_vue.defineComponent)({
|
@@ -95,6 +96,9 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
95
96
|
const onConfirm = getActionHandler("confirm");
|
96
97
|
const onKeydown = (0, import_vue.withKeys)((event) => {
|
97
98
|
var _a, _b;
|
99
|
+
if (!props.keyboardEnabled) {
|
100
|
+
return;
|
101
|
+
}
|
98
102
|
if (event.target !== ((_b = (_a = root.value) == null ? void 0 : _a.popupRef) == null ? void 0 : _b.value)) {
|
99
103
|
return;
|
100
104
|
}
|
package/lib/dialog/index.d.ts
CHANGED
@@ -52,6 +52,10 @@ export declare const Dialog: import("../utils").WithInstall<import("vue").Define
|
|
52
52
|
default: true;
|
53
53
|
};
|
54
54
|
closeOnClickOverlay: BooleanConstructor;
|
55
|
+
keyboardEnabled: {
|
56
|
+
type: BooleanConstructor;
|
57
|
+
default: true;
|
58
|
+
};
|
55
59
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "keydown" | "update:show" | "confirm")[], "cancel" | "keydown" | "update:show" | "confirm", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
56
60
|
show: BooleanConstructor;
|
57
61
|
zIndex: (NumberConstructor | StringConstructor)[];
|
@@ -106,6 +110,10 @@ export declare const Dialog: import("../utils").WithInstall<import("vue").Define
|
|
106
110
|
default: true;
|
107
111
|
};
|
108
112
|
closeOnClickOverlay: BooleanConstructor;
|
113
|
+
keyboardEnabled: {
|
114
|
+
type: BooleanConstructor;
|
115
|
+
default: true;
|
116
|
+
};
|
109
117
|
}>> & Readonly<{
|
110
118
|
onKeydown?: ((...args: any[]) => any) | undefined;
|
111
119
|
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
@@ -125,6 +133,7 @@ export declare const Dialog: import("../utils").WithInstall<import("vue").Define
|
|
125
133
|
cancelButtonDisabled: boolean;
|
126
134
|
confirmButtonDisabled: boolean;
|
127
135
|
showConfirmButton: boolean;
|
136
|
+
keyboardEnabled: boolean;
|
128
137
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
129
138
|
export default Dialog;
|
130
139
|
export { dialogProps } from './Dialog';
|
package/lib/field/Field.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { type PropType, type ExtractPropTypes } from 'vue';
|
1
|
+
import { type PropType, type ExtractPropTypes, type HTMLAttributes } from 'vue';
|
2
2
|
import type { FieldRule, FieldType, FieldTextAlign, FieldClearTrigger, FieldFormatTrigger, FieldAutosizeConfig } from './types';
|
3
3
|
export declare const fieldSharedProps: {
|
4
4
|
id: StringConstructor;
|
@@ -50,6 +50,7 @@ export declare const fieldSharedProps: {
|
|
50
50
|
type: BooleanConstructor;
|
51
51
|
default: null;
|
52
52
|
};
|
53
|
+
inputmode: PropType<HTMLAttributes["inputmode"]>;
|
53
54
|
};
|
54
55
|
export declare const fieldProps: {
|
55
56
|
tag: {
|
@@ -131,6 +132,7 @@ export declare const fieldProps: {
|
|
131
132
|
type: BooleanConstructor;
|
132
133
|
default: null;
|
133
134
|
};
|
135
|
+
inputmode: PropType<HTMLAttributes["inputmode"]>;
|
134
136
|
} & {
|
135
137
|
rows: (NumberConstructor | StringConstructor)[];
|
136
138
|
type: {
|
@@ -230,6 +232,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
230
232
|
type: BooleanConstructor;
|
231
233
|
default: null;
|
232
234
|
};
|
235
|
+
inputmode: PropType<HTMLAttributes["inputmode"]>;
|
233
236
|
} & {
|
234
237
|
rows: (NumberConstructor | StringConstructor)[];
|
235
238
|
type: {
|
@@ -327,6 +330,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
327
330
|
type: BooleanConstructor;
|
328
331
|
default: null;
|
329
332
|
};
|
333
|
+
inputmode: PropType<HTMLAttributes["inputmode"]>;
|
330
334
|
} & {
|
331
335
|
rows: (NumberConstructor | StringConstructor)[];
|
332
336
|
type: {
|
package/lib/field/Field.js
CHANGED
@@ -69,7 +69,8 @@ const fieldSharedProps = {
|
|
69
69
|
readonly: {
|
70
70
|
type: Boolean,
|
71
71
|
default: null
|
72
|
-
}
|
72
|
+
},
|
73
|
+
inputmode: String
|
73
74
|
};
|
74
75
|
const fieldProps = (0, import_utils.extend)({}, import_Cell.cellSharedProps, fieldSharedProps, {
|
75
76
|
rows: import_utils.numericProp,
|
@@ -246,7 +247,7 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
246
247
|
if (props.type === "number" || props.type === "digit") {
|
247
248
|
const isNumber = props.type === "number";
|
248
249
|
value = (0, import_utils.formatNumber)(value, isNumber, isNumber);
|
249
|
-
if (trigger === "onBlur" && value !== "") {
|
250
|
+
if (trigger === "onBlur" && value !== "" && (props.min !== void 0 || props.max !== void 0)) {
|
250
251
|
const adjustedValue = (0, import_utils.clamp)(+value, (_a = props.min) != null ? _a : -Infinity, (_b = props.max) != null ? _b : Infinity);
|
251
252
|
value = adjustedValue.toString();
|
252
253
|
}
|
@@ -412,9 +413,11 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
412
413
|
onCompositionstart: import_utils2.startComposing
|
413
414
|
};
|
414
415
|
if (props.type === "textarea") {
|
415
|
-
return (0, import_vue.createVNode)("textarea", inputAttrs,
|
416
|
+
return (0, import_vue.createVNode)("textarea", (0, import_vue.mergeProps)(inputAttrs, {
|
417
|
+
"inputmode": props.inputmode
|
418
|
+
}), null);
|
416
419
|
}
|
417
|
-
return (0, import_vue.createVNode)("input", (0, import_vue.mergeProps)((0, import_utils2.mapInputType)(props.type), inputAttrs), null);
|
420
|
+
return (0, import_vue.createVNode)("input", (0, import_vue.mergeProps)((0, import_utils2.mapInputType)(props.type, props.inputmode), inputAttrs), null);
|
418
421
|
};
|
419
422
|
const renderLeftIcon = () => {
|
420
423
|
const leftIconSlot = slots["left-icon"];
|
package/lib/field/index.d.ts
CHANGED
@@ -79,6 +79,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
79
79
|
type: BooleanConstructor;
|
80
80
|
default: null;
|
81
81
|
};
|
82
|
+
inputmode: import("vue").PropType<import("vue").HTMLAttributes["inputmode"]>;
|
82
83
|
} & {
|
83
84
|
rows: (NumberConstructor | StringConstructor)[];
|
84
85
|
type: {
|
@@ -176,6 +177,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
|
|
176
177
|
type: BooleanConstructor;
|
177
178
|
default: null;
|
178
179
|
};
|
180
|
+
inputmode: import("vue").PropType<import("vue").HTMLAttributes["inputmode"]>;
|
179
181
|
} & {
|
180
182
|
rows: (NumberConstructor | StringConstructor)[];
|
181
183
|
type: {
|
package/lib/field/utils.d.ts
CHANGED
@@ -7,7 +7,7 @@ export declare function getRuleMessage(value: unknown, rule: FieldRule): string;
|
|
7
7
|
export declare function startComposing({ target }: Event): void;
|
8
8
|
export declare function endComposing({ target }: Event): void;
|
9
9
|
export declare function resizeTextarea(input: HTMLInputElement, autosize: true | FieldAutosizeConfig): void;
|
10
|
-
export declare function mapInputType(type: FieldType): {
|
10
|
+
export declare function mapInputType(type: FieldType, inputmode?: HTMLAttributes['inputmode']): {
|
11
11
|
type: InputHTMLAttributes['type'];
|
12
12
|
inputmode?: HTMLAttributes['inputmode'];
|
13
13
|
};
|
package/lib/field/utils.js
CHANGED
@@ -97,20 +97,16 @@ function resizeTextarea(input, autosize) {
|
|
97
97
|
(0, import_utils.setRootScrollTop)(scrollTop);
|
98
98
|
}
|
99
99
|
}
|
100
|
-
function mapInputType(type) {
|
100
|
+
function mapInputType(type, inputmode) {
|
101
101
|
if (type === "number") {
|
102
|
-
|
103
|
-
|
104
|
-
inputmode: "decimal"
|
105
|
-
};
|
102
|
+
type = "text";
|
103
|
+
inputmode != null ? inputmode : inputmode = "decimal";
|
106
104
|
}
|
107
105
|
if (type === "digit") {
|
108
|
-
|
109
|
-
|
110
|
-
inputmode: "numeric"
|
111
|
-
};
|
106
|
+
type = "tel";
|
107
|
+
inputmode != null ? inputmode : inputmode = "numeric";
|
112
108
|
}
|
113
|
-
return { type };
|
109
|
+
return { type, inputmode };
|
114
110
|
}
|
115
111
|
function getStringLength(str) {
|
116
112
|
return [...str].length;
|