zartui 3.1.12 → 3.1.14
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/action-sheet/index.css +1 -1
- package/es/avatar/index.css +1 -1
- package/es/badge/index.css +1 -1
- package/es/button/index.css +1 -1
- package/es/calendar/index.css +1 -1
- package/es/calendar/utils.d.ts +2 -2
- package/es/cascader/Cascader.d.ts +1 -1
- package/es/cascader/index.css +1 -1
- package/es/cascader/index.d.ts +1 -1
- package/es/cell/Cell.d.ts +34 -0
- package/es/cell/Cell.mjs +61 -8
- package/es/cell/index.css +1 -1
- package/es/cell/index.d.ts +17 -0
- package/es/cell/style/index.mjs +1 -0
- package/es/cell-group/index.css +1 -1
- package/es/checkbox/Checkbox.d.ts +1 -1
- package/es/checkbox/index.d.ts +1 -1
- package/es/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/es/checkbox-group/index.d.ts +1 -1
- package/es/collapse/Collapse.d.ts +1 -1
- package/es/collapse/index.d.ts +1 -1
- package/es/collapse-item/index.css +1 -1
- package/es/config-provider/types.d.ts +1 -1
- package/es/date-time-picker/DateTimePicker.d.ts +1 -1
- package/es/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
- package/es/date-time-picker/index.d.ts +1 -1
- package/es/dialog/index.css +1 -1
- package/es/divider/index.css +1 -1
- package/es/drawer-select/DrawerSelect.d.ts +68 -0
- package/es/drawer-select/DrawerSelect.mjs +360 -0
- package/es/drawer-select/index.css +1 -0
- package/es/drawer-select/index.d.ts +53 -0
- package/es/drawer-select/index.mjs +8 -0
- package/es/drawer-select/style/index.d.ts +1 -0
- package/es/drawer-select/style/index.mjs +15 -0
- package/es/drawer-select/types.d.ts +26 -0
- package/es/drawer-select/types.mjs +0 -0
- package/es/dropdown-item/DropdownItem.d.ts +8 -1
- package/es/dropdown-item/DropdownItem.mjs +39 -25
- package/es/dropdown-item/index.css +1 -1
- package/es/dropdown-item/index.d.ts +5 -1
- package/es/dropdown-item/style/index.mjs +3 -1
- package/es/dropdown-item/types.d.ts +2 -1
- package/es/dropdown-menu/DropdownMenu.mjs +3 -0
- package/es/dropdown-menu/index.css +1 -1
- package/es/field/Field.d.ts +27 -3
- package/es/field/Field.mjs +11 -3
- package/es/field/index.css +1 -1
- package/es/field/index.d.ts +19 -3
- package/es/floating-bubble/index.css +1 -1
- package/es/form/index.css +1 -0
- package/es/form/style/index.mjs +1 -0
- package/es/hierarchy-select/index.css +1 -1
- package/es/icon/config.mjs +3 -1
- package/es/icon/index.css +1 -1
- package/es/image/index.css +1 -1
- package/es/image-preview/ImagePreview.d.ts +1 -1
- package/es/image-preview/index.css +1 -1
- package/es/image-preview/index.d.ts +1 -1
- package/es/index.d.ts +3 -1
- package/es/index.mjs +7 -1
- package/es/lazyload/vue-lazyload/index.d.ts +55 -55
- package/es/media-picker/MediaPicker.mjs +12 -2
- package/es/media-picker/index.css +1 -1
- package/es/media-picker/type.d.ts +3 -0
- package/es/media-picker/watermark/image-processor.mjs +2 -2
- package/es/media-player/index.css +1 -1
- package/es/multiple-picker/MultiplePicker.d.ts +28 -2
- package/es/multiple-picker/MultiplePicker.mjs +26 -16
- package/es/multiple-picker/MultiplePickerOptions.mjs +2 -1
- package/es/multiple-picker/index.css +1 -1
- package/es/multiple-picker/index.d.ts +20 -2
- package/es/nav-bar/NavBar.d.ts +1 -1
- package/es/nav-bar/index.d.ts +1 -1
- package/es/notice-bar/index.css +1 -1
- package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
- package/es/number-keyboard/index.css +1 -1
- package/es/number-keyboard/index.d.ts +1 -1
- package/es/password-input/index.css +1 -1
- package/es/picker/Picker.d.ts +30 -4
- package/es/picker/Picker.mjs +69 -16
- package/es/picker/PickerOptions.d.ts +75 -0
- package/es/picker/PickerOptions.mjs +93 -0
- package/es/picker/index.css +1 -1
- package/es/picker/index.d.ts +21 -3
- package/es/picker/types.d.ts +5 -1
- package/es/popover/index.css +1 -1
- package/es/popup/Popup.mjs +3 -3
- package/es/popup/index.css +1 -1
- package/es/pull-refresh/PullRefresh.d.ts +1 -1
- package/es/pull-refresh/index.d.ts +1 -1
- package/es/radio-group/RadioGroup.d.ts +1 -1
- package/es/radio-group/index.d.ts +1 -1
- package/es/radio-picker/RadioPicker.d.ts +11 -11
- package/es/radio-picker/index.css +1 -1
- package/es/radio-picker/index.d.ts +9 -9
- package/es/radio-picker/style/index.mjs +4 -4
- package/es/rate/Rate.d.ts +1 -1
- package/es/rate/index.d.ts +1 -1
- package/es/search/Search.d.ts +2 -2
- package/es/search/index.css +1 -1
- package/es/search/index.d.ts +2 -2
- package/es/skeleton/index.css +1 -1
- package/es/slider/Slider.d.ts +139 -0
- package/es/slider/Slider.mjs +335 -0
- package/es/slider/index.css +1 -0
- package/es/slider/index.d.ts +103 -0
- package/es/slider/index.mjs +10 -0
- package/es/slider/style/index.d.ts +1 -0
- package/es/slider/style/index.mjs +2 -0
- package/es/slider/types.d.ts +11 -0
- package/es/slider/types.mjs +0 -0
- package/es/step/index.css +1 -1
- package/es/stepper/Stepper.d.ts +1 -1
- package/es/stepper/index.css +1 -1
- package/es/stepper/index.d.ts +1 -1
- package/es/steps/index.css +1 -1
- package/es/style/base.css +1 -1
- package/es/style/css-variables.css +1 -1
- package/es/switch/Switch.d.ts +1 -1
- package/es/switch/index.d.ts +1 -1
- package/es/tabbar/Tabbar.d.ts +2 -2
- package/es/tabbar/index.css +1 -1
- package/es/tabbar/index.d.ts +2 -2
- package/es/tabbar-item/index.css +1 -1
- package/es/tabs/Tabs.mjs +4 -2
- package/es/tabs/TabsTitle.mjs +16 -6
- package/es/tabs/index.css +1 -1
- package/es/tag/index.css +1 -1
- package/es/text-ellipsis/TextEllipsis.mjs +2 -0
- package/es/time-picker/TimePicker.d.ts +1 -1
- package/es/time-picker/index.css +1 -1
- package/es/time-picker/index.d.ts +1 -1
- package/es/timeline/index.css +1 -1
- package/es/uploader/index.css +1 -1
- package/es/utils/constant.d.ts +0 -1
- package/es/utils/constant.mjs +0 -2
- package/es/utils/mount-component.mjs +1 -1
- package/es/utils/validate.d.ts +2 -1
- package/es/utils/validate.mjs +9 -0
- package/es/vue-sfc-shim.d.ts +6 -6
- package/es/vue-tsx-shim.d.ts +23 -23
- package/lib/action-sheet/index.css +1 -1
- package/lib/avatar/index.css +1 -1
- package/lib/badge/index.css +1 -1
- package/lib/button/index.css +1 -1
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/utils.d.ts +2 -2
- package/lib/cascader/Cascader.d.ts +1 -1
- package/lib/cascader/index.css +1 -1
- package/lib/cascader/index.d.ts +1 -1
- package/lib/cell/Cell.d.ts +34 -0
- package/lib/cell/Cell.js +61 -8
- package/lib/cell/index.css +1 -1
- package/lib/cell/index.d.ts +17 -0
- package/lib/cell/style/index.js +1 -0
- package/lib/cell-group/index.css +1 -1
- package/lib/checkbox/Checkbox.d.ts +1 -1
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/lib/checkbox-group/index.d.ts +1 -1
- package/lib/collapse/Collapse.d.ts +1 -1
- package/lib/collapse/index.d.ts +1 -1
- package/lib/collapse-item/index.css +1 -1
- package/lib/config-provider/types.d.ts +1 -1
- package/lib/date-time-picker/DateTimePicker.d.ts +1 -1
- package/lib/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
- package/lib/date-time-picker/index.d.ts +1 -1
- package/lib/dialog/index.css +1 -1
- package/lib/divider/index.css +1 -1
- package/lib/drawer-select/DrawerSelect.d.ts +68 -0
- package/lib/drawer-select/DrawerSelect.js +389 -0
- package/lib/drawer-select/index.css +1 -0
- package/lib/drawer-select/index.d.ts +53 -0
- package/lib/drawer-select/index.js +37 -0
- package/lib/drawer-select/style/index.d.ts +1 -0
- package/lib/drawer-select/style/index.js +15 -0
- package/lib/drawer-select/types.d.ts +26 -0
- package/lib/drawer-select/types.js +15 -0
- package/lib/dropdown-item/DropdownItem.d.ts +8 -1
- package/lib/dropdown-item/DropdownItem.js +37 -23
- package/lib/dropdown-item/index.css +1 -1
- package/lib/dropdown-item/index.d.ts +5 -1
- package/lib/dropdown-item/style/index.js +3 -1
- package/lib/dropdown-item/types.d.ts +2 -1
- package/lib/dropdown-menu/DropdownMenu.js +3 -0
- package/lib/dropdown-menu/index.css +1 -1
- package/lib/field/Field.d.ts +27 -3
- package/lib/field/Field.js +11 -3
- package/lib/field/index.css +1 -1
- package/lib/field/index.d.ts +19 -3
- package/lib/floating-bubble/index.css +1 -1
- package/lib/form/index.css +1 -0
- package/lib/form/style/index.js +1 -0
- package/lib/hierarchy-select/index.css +1 -1
- package/lib/icon/config.js +3 -1
- package/lib/icon/index.css +1 -1
- package/lib/image/index.css +1 -1
- package/lib/image-preview/ImagePreview.d.ts +1 -1
- package/lib/image-preview/index.css +1 -1
- package/lib/image-preview/index.d.ts +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +7 -1
- package/lib/lazyload/vue-lazyload/index.d.ts +55 -55
- package/lib/media-picker/MediaPicker.js +12 -2
- package/lib/media-picker/index.css +1 -1
- package/lib/media-picker/type.d.ts +3 -0
- package/lib/media-picker/watermark/image-processor.js +1 -1
- package/lib/media-player/index.css +1 -1
- package/lib/multiple-picker/MultiplePicker.d.ts +28 -2
- package/lib/multiple-picker/MultiplePicker.js +26 -16
- package/lib/multiple-picker/MultiplePickerOptions.js +2 -1
- package/lib/multiple-picker/index.css +1 -1
- package/lib/multiple-picker/index.d.ts +20 -2
- package/lib/nav-bar/NavBar.d.ts +1 -1
- package/lib/nav-bar/index.d.ts +1 -1
- package/lib/notice-bar/index.css +1 -1
- package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
- package/lib/number-keyboard/index.css +1 -1
- package/lib/number-keyboard/index.d.ts +1 -1
- package/lib/password-input/index.css +1 -1
- package/lib/picker/Picker.d.ts +30 -4
- package/lib/picker/Picker.js +68 -15
- package/lib/picker/PickerOptions.d.ts +75 -0
- package/lib/picker/PickerOptions.js +112 -0
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.d.ts +21 -3
- package/lib/picker/types.d.ts +5 -1
- package/lib/popover/index.css +1 -1
- package/lib/popup/Popup.js +3 -3
- package/lib/popup/index.css +1 -1
- package/lib/pull-refresh/PullRefresh.d.ts +1 -1
- package/lib/pull-refresh/index.d.ts +1 -1
- package/lib/radio-group/RadioGroup.d.ts +1 -1
- package/lib/radio-group/index.d.ts +1 -1
- package/lib/radio-picker/RadioPicker.d.ts +11 -11
- package/lib/radio-picker/index.css +1 -1
- package/lib/radio-picker/index.d.ts +9 -9
- package/lib/radio-picker/style/index.js +4 -4
- package/lib/rate/Rate.d.ts +1 -1
- package/lib/rate/index.d.ts +1 -1
- package/lib/search/Search.d.ts +2 -2
- package/lib/search/index.css +1 -1
- package/lib/search/index.d.ts +2 -2
- package/lib/skeleton/index.css +1 -1
- package/lib/slider/Slider.d.ts +139 -0
- package/lib/slider/Slider.js +354 -0
- package/lib/slider/index.css +1 -0
- package/lib/slider/index.d.ts +103 -0
- package/lib/slider/index.js +39 -0
- package/lib/slider/style/index.d.ts +1 -0
- package/lib/slider/style/index.js +2 -0
- package/lib/slider/types.d.ts +11 -0
- package/lib/slider/types.js +15 -0
- package/lib/step/index.css +1 -1
- package/lib/stepper/Stepper.d.ts +1 -1
- package/lib/stepper/index.css +1 -1
- package/lib/stepper/index.d.ts +1 -1
- package/lib/steps/index.css +1 -1
- package/lib/style/base.css +1 -1
- package/lib/style/css-variables.css +1 -1
- package/lib/switch/Switch.d.ts +1 -1
- package/lib/switch/index.d.ts +1 -1
- package/lib/tabbar/Tabbar.d.ts +2 -2
- package/lib/tabbar/index.css +1 -1
- package/lib/tabbar/index.d.ts +2 -2
- package/lib/tabbar-item/index.css +1 -1
- package/lib/tabs/Tabs.js +4 -2
- package/lib/tabs/TabsTitle.js +16 -6
- package/lib/tabs/index.css +1 -1
- package/lib/tag/index.css +1 -1
- package/lib/text-ellipsis/TextEllipsis.js +2 -0
- package/lib/time-picker/TimePicker.d.ts +1 -1
- package/lib/time-picker/index.css +1 -1
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/timeline/index.css +1 -1
- package/lib/uploader/index.css +1 -1
- package/lib/utils/constant.d.ts +0 -1
- package/lib/utils/constant.js +0 -2
- package/lib/utils/mount-component.js +1 -1
- package/lib/utils/validate.d.ts +2 -1
- package/lib/utils/validate.js +9 -0
- package/lib/vue-sfc-shim.d.ts +6 -6
- package/lib/vue-tsx-shim.d.ts +23 -23
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +4303 -3364
- package/lib/zartui.es.js +4304 -3365
- package/lib/zartui.js +4301 -3362
- package/lib/zartui.min.js +1 -1
- package/package.json +79 -78
- package/README.md +0 -23
package/lib/picker/Picker.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
2
|
import { Numeric } from '../utils';
|
|
3
|
-
import type { PickerColumn, PickerOption, PickerFieldNames, PickerToolbarPosition } from './types';
|
|
3
|
+
import type { PickerColumn, PickerOption, PickerFieldNames, PickerShowType, PickerToolbarPosition } from './types';
|
|
4
4
|
export declare const pickerSharedProps: {
|
|
5
5
|
loading: BooleanConstructor;
|
|
6
6
|
readonly: BooleanConstructor;
|
|
@@ -87,6 +87,14 @@ export declare const pickerProps: {
|
|
|
87
87
|
type: BooleanConstructor;
|
|
88
88
|
default: true;
|
|
89
89
|
};
|
|
90
|
+
showType: {
|
|
91
|
+
type: PropType<PickerShowType>;
|
|
92
|
+
default: PickerShowType;
|
|
93
|
+
};
|
|
94
|
+
columnCounts: {
|
|
95
|
+
type: NumberConstructor;
|
|
96
|
+
default: number;
|
|
97
|
+
};
|
|
90
98
|
};
|
|
91
99
|
export type PickerProps = ExtractPropTypes<typeof pickerProps>;
|
|
92
100
|
declare const _default: import("vue").DefineComponent<{
|
|
@@ -143,7 +151,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
143
151
|
type: BooleanConstructor;
|
|
144
152
|
default: true;
|
|
145
153
|
};
|
|
146
|
-
|
|
154
|
+
showType: {
|
|
155
|
+
type: PropType<PickerShowType>;
|
|
156
|
+
default: PickerShowType;
|
|
157
|
+
};
|
|
158
|
+
columnCounts: {
|
|
159
|
+
type: NumberConstructor;
|
|
160
|
+
default: number;
|
|
161
|
+
};
|
|
162
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm" | "clickOption" | "update:showPicker")[], "update:modelValue" | "cancel" | "change" | "confirm" | "clickOption" | "update:showPicker", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
147
163
|
loading: BooleanConstructor;
|
|
148
164
|
readonly: BooleanConstructor;
|
|
149
165
|
allowHtml: BooleanConstructor;
|
|
@@ -197,25 +213,35 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
197
213
|
type: BooleanConstructor;
|
|
198
214
|
default: true;
|
|
199
215
|
};
|
|
216
|
+
showType: {
|
|
217
|
+
type: PropType<PickerShowType>;
|
|
218
|
+
default: PickerShowType;
|
|
219
|
+
};
|
|
220
|
+
columnCounts: {
|
|
221
|
+
type: NumberConstructor;
|
|
222
|
+
default: number;
|
|
223
|
+
};
|
|
200
224
|
}>> & {
|
|
201
225
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
202
226
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
203
227
|
onCancel?: ((...args: any[]) => any) | undefined;
|
|
204
228
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
205
|
-
"onUpdate:showPicker"?: ((...args: any[]) => any) | undefined;
|
|
206
229
|
onClickOption?: ((...args: any[]) => any) | undefined;
|
|
230
|
+
"onUpdate:showPicker"?: ((...args: any[]) => any) | undefined;
|
|
207
231
|
}, {
|
|
208
232
|
title: string;
|
|
209
233
|
modelValue: Numeric[];
|
|
210
234
|
readonly: boolean;
|
|
211
235
|
popup: boolean;
|
|
212
236
|
loading: boolean;
|
|
237
|
+
showType: PickerShowType;
|
|
213
238
|
showTitle: boolean;
|
|
214
239
|
columns: (PickerColumn | PickerOption)[];
|
|
215
240
|
allowHtml: boolean;
|
|
216
241
|
swipeDuration: string | number;
|
|
217
|
-
showPicker: boolean;
|
|
218
242
|
showToolbar: boolean;
|
|
243
|
+
showPicker: boolean;
|
|
244
|
+
columnCounts: number;
|
|
219
245
|
toolbarPosition: PickerToolbarPosition;
|
|
220
246
|
optionHeight: string | number;
|
|
221
247
|
visibleOptionNum: string | number;
|
package/lib/picker/Picker.js
CHANGED
|
@@ -43,6 +43,7 @@ var import_PickerColumn = __toESM(require("./PickerColumn"));
|
|
|
43
43
|
var import_divider = require("../divider");
|
|
44
44
|
var import_PickerToolbar = __toESM(require("./PickerToolbar"));
|
|
45
45
|
var import_popup = __toESM(require("../popup"));
|
|
46
|
+
var import_PickerOptions = __toESM(require("./PickerOptions"));
|
|
46
47
|
const pickerSharedProps = (0, import_utils.extend)({
|
|
47
48
|
loading: Boolean,
|
|
48
49
|
readonly: Boolean,
|
|
@@ -61,7 +62,9 @@ const pickerProps = (0, import_utils.extend)({}, pickerSharedProps, {
|
|
|
61
62
|
toolbarPosition: (0, import_utils.makeStringProp)("top"),
|
|
62
63
|
columnsFieldNames: Object,
|
|
63
64
|
showPicker: Boolean,
|
|
64
|
-
popup: import_utils.truthProp
|
|
65
|
+
popup: import_utils.truthProp,
|
|
66
|
+
showType: (0, import_utils.makeStringProp)("default"),
|
|
67
|
+
columnCounts: (0, import_utils.makeNumberProp)(3)
|
|
65
68
|
});
|
|
66
69
|
var stdin_default = (0, import_vue2.defineComponent)({
|
|
67
70
|
name: import_utils2.name,
|
|
@@ -71,6 +74,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
71
74
|
emit,
|
|
72
75
|
slots
|
|
73
76
|
}) {
|
|
77
|
+
const pickerOptions = (0, import_vue2.ref)();
|
|
74
78
|
const columnsRef = (0, import_vue2.ref)();
|
|
75
79
|
const selectedValues = (0, import_vue2.ref)(props.modelValue.slice(0));
|
|
76
80
|
const showPicker = (0, import_vue2.ref)(props.showPicker);
|
|
@@ -97,6 +101,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
97
101
|
});
|
|
98
102
|
const hasOptions = (0, import_vue2.computed)(() => currentColumns.value.some((options) => options.length));
|
|
99
103
|
const selectedOptions = (0, import_vue2.computed)(() => currentColumns.value.map((options, index) => (0, import_utils2.findOptionByValue)(options, selectedValues.value[index], fields.value)));
|
|
104
|
+
const isButtonPicker = (0, import_vue2.computed)(() => {
|
|
105
|
+
return props.showType === "button" && columnsType.value === "default";
|
|
106
|
+
});
|
|
100
107
|
(0, import_vue2.watch)(showPicker, (newValue) => {
|
|
101
108
|
if (newValue !== props.showPicker) {
|
|
102
109
|
emit("update:showPicker", newValue);
|
|
@@ -134,10 +141,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
134
141
|
}, getEventParams()));
|
|
135
142
|
});
|
|
136
143
|
};
|
|
137
|
-
const onClickOption = (currentOption, columnIndex) =>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
144
|
+
const onClickOption = (currentOption, columnIndex) => {
|
|
145
|
+
emit("clickOption", (0, import_utils.extend)({
|
|
146
|
+
columnIndex,
|
|
147
|
+
currentOption
|
|
148
|
+
}, getEventParams()));
|
|
149
|
+
};
|
|
141
150
|
const confirm = () => {
|
|
142
151
|
children.forEach((child) => child.stopMomentum());
|
|
143
152
|
const params = getEventParams();
|
|
@@ -219,7 +228,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
219
228
|
}, null) : null;
|
|
220
229
|
(0, import_vue2.watch)(currentColumns, (columns) => {
|
|
221
230
|
columns.forEach((options, index) => {
|
|
222
|
-
|
|
231
|
+
const judgeSelectedValue = isButtonPicker.value ? selectedValues.value[index] : true;
|
|
232
|
+
if (options.length && judgeSelectedValue && !(0, import_utils2.isOptionExist)(options, selectedValues.value[index], fields.value)) {
|
|
223
233
|
setValue(index, (0, import_utils2.getFirstEnabledOption)(options)[fields.value.value]);
|
|
224
234
|
}
|
|
225
235
|
});
|
|
@@ -259,18 +269,61 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
259
269
|
"class": (0, import_utils2.bem)("loading")
|
|
260
270
|
}, null) : null, topDivider(), (_a = slots["columns-top"]) == null ? void 0 : _a.call(slots), renderColumns(), (_b = slots["columns-bottom"]) == null ? void 0 : _b.call(slots), buttomDivider(), renderToolbar()]);
|
|
261
271
|
};
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return (0, import_vue.createVNode)(
|
|
265
|
-
"
|
|
266
|
-
"
|
|
267
|
-
"
|
|
268
|
-
"
|
|
272
|
+
const renderOptionItems = () => {
|
|
273
|
+
return currentColumns.value.map((options, columnIndex) => {
|
|
274
|
+
return (0, import_vue.createVNode)(import_PickerOptions.default, {
|
|
275
|
+
"ref": pickerOptions,
|
|
276
|
+
"value": selectedValues.value[columnIndex],
|
|
277
|
+
"columnCounts": props.columnCounts,
|
|
278
|
+
"fields": fields.value,
|
|
279
|
+
"options": options,
|
|
280
|
+
"allowHtml": props.allowHtml,
|
|
281
|
+
"readonly": props.readonly,
|
|
282
|
+
"itemHeight": optionHeight.value,
|
|
283
|
+
"onChange": (value) => onChange(value, columnIndex),
|
|
284
|
+
"onClickOption": (option) => onClickOption(option, columnIndex)
|
|
269
285
|
}, {
|
|
270
|
-
|
|
286
|
+
option: slots.option
|
|
271
287
|
});
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
const renderOptions = () => (0, import_vue.createVNode)("div", {
|
|
291
|
+
"class": (0, import_utils2.bem)("options")
|
|
292
|
+
}, [renderOptionItems()]);
|
|
293
|
+
const renderTiledPicker = () => {
|
|
294
|
+
var _a, _b;
|
|
295
|
+
return (0, import_vue.createVNode)("div", {
|
|
296
|
+
"class": (0, import_utils2.bem)()
|
|
297
|
+
}, [renderTitleBar(), props.loading ? (0, import_vue.createVNode)(import_loading.Loading, {
|
|
298
|
+
"class": (0, import_utils2.bem)("loading")
|
|
299
|
+
}, null) : null, topDivider(), (_a = slots["columns-top"]) == null ? void 0 : _a.call(slots), renderOptions(), (_b = slots["columns-bottom"]) == null ? void 0 : _b.call(slots), buttomDivider(), renderToolbar()]);
|
|
300
|
+
};
|
|
301
|
+
return () => {
|
|
302
|
+
if (isButtonPicker.value) {
|
|
303
|
+
if (props.popup) {
|
|
304
|
+
return (0, import_vue.createVNode)(import_popup.default, {
|
|
305
|
+
"show": showPicker.value,
|
|
306
|
+
"onUpdate:show": [($event) => showPicker.value = $event, updateShow],
|
|
307
|
+
"round": true,
|
|
308
|
+
"position": "bottom"
|
|
309
|
+
}, {
|
|
310
|
+
default: renderTiledPicker
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
return renderTiledPicker();
|
|
314
|
+
} else {
|
|
315
|
+
if (props.popup) {
|
|
316
|
+
return (0, import_vue.createVNode)(import_popup.default, {
|
|
317
|
+
"show": showPicker.value,
|
|
318
|
+
"onUpdate:show": [($event) => showPicker.value = $event, updateShow],
|
|
319
|
+
"round": true,
|
|
320
|
+
"position": "bottom"
|
|
321
|
+
}, {
|
|
322
|
+
default: renderPicker
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
return renderPicker();
|
|
272
326
|
}
|
|
273
|
-
return renderPicker();
|
|
274
327
|
};
|
|
275
328
|
}
|
|
276
329
|
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { PickerOption, PickerFieldNames } from './types';
|
|
3
|
+
declare const pickerOptionsProps: {
|
|
4
|
+
value: (NumberConstructor | StringConstructor)[];
|
|
5
|
+
fields: {
|
|
6
|
+
type: PropType<Required<PickerFieldNames>>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
readonly: BooleanConstructor;
|
|
10
|
+
allowHtml: BooleanConstructor;
|
|
11
|
+
itemHeight: {
|
|
12
|
+
type: NumberConstructor;
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
columnCounts: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
options: {
|
|
20
|
+
type: PropType<PickerOption[]>;
|
|
21
|
+
default: () => PickerOption[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type PickerOptionsProps = ExtractPropTypes<typeof pickerOptionsProps>;
|
|
25
|
+
declare const _default: import("vue").DefineComponent<{
|
|
26
|
+
value: (NumberConstructor | StringConstructor)[];
|
|
27
|
+
fields: {
|
|
28
|
+
type: PropType<Required<PickerFieldNames>>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
readonly: BooleanConstructor;
|
|
32
|
+
allowHtml: BooleanConstructor;
|
|
33
|
+
itemHeight: {
|
|
34
|
+
type: NumberConstructor;
|
|
35
|
+
default: number;
|
|
36
|
+
};
|
|
37
|
+
columnCounts: {
|
|
38
|
+
type: NumberConstructor;
|
|
39
|
+
default: number;
|
|
40
|
+
};
|
|
41
|
+
options: {
|
|
42
|
+
type: PropType<PickerOption[]>;
|
|
43
|
+
default: () => PickerOption[];
|
|
44
|
+
};
|
|
45
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "clickOption")[], "change" | "clickOption", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
46
|
+
value: (NumberConstructor | StringConstructor)[];
|
|
47
|
+
fields: {
|
|
48
|
+
type: PropType<Required<PickerFieldNames>>;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
readonly: BooleanConstructor;
|
|
52
|
+
allowHtml: BooleanConstructor;
|
|
53
|
+
itemHeight: {
|
|
54
|
+
type: NumberConstructor;
|
|
55
|
+
default: number;
|
|
56
|
+
};
|
|
57
|
+
columnCounts: {
|
|
58
|
+
type: NumberConstructor;
|
|
59
|
+
default: number;
|
|
60
|
+
};
|
|
61
|
+
options: {
|
|
62
|
+
type: PropType<PickerOption[]>;
|
|
63
|
+
default: () => PickerOption[];
|
|
64
|
+
};
|
|
65
|
+
}>> & {
|
|
66
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
67
|
+
onClickOption?: ((...args: any[]) => any) | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
readonly: boolean;
|
|
70
|
+
options: PickerOption[];
|
|
71
|
+
allowHtml: boolean;
|
|
72
|
+
itemHeight: number;
|
|
73
|
+
columnCounts: number;
|
|
74
|
+
}, {}>;
|
|
75
|
+
export default _default;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name2 in all)
|
|
7
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
default: () => stdin_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_vue = require("vue");
|
|
24
|
+
var import_vue2 = require("vue");
|
|
25
|
+
var import_utils = require("../utils");
|
|
26
|
+
const [name, bem] = (0, import_utils.createNamespace)("picker-options");
|
|
27
|
+
const pickerOptionsProps = {
|
|
28
|
+
value: import_utils.numericProp,
|
|
29
|
+
fields: (0, import_utils.makeRequiredProp)(Object),
|
|
30
|
+
readonly: Boolean,
|
|
31
|
+
allowHtml: Boolean,
|
|
32
|
+
itemHeight: (0, import_utils.makeNumberProp)(0),
|
|
33
|
+
columnCounts: (0, import_utils.makeNumberProp)(3),
|
|
34
|
+
options: (0, import_utils.makeArrayProp)()
|
|
35
|
+
};
|
|
36
|
+
var stdin_default = (0, import_vue2.defineComponent)({
|
|
37
|
+
name,
|
|
38
|
+
props: pickerOptionsProps,
|
|
39
|
+
emits: ["change", "clickOption"],
|
|
40
|
+
setup(props, {
|
|
41
|
+
emit,
|
|
42
|
+
slots
|
|
43
|
+
}) {
|
|
44
|
+
const currentIndex = (0, import_vue2.ref)(-1);
|
|
45
|
+
const state = (0, import_vue2.reactive)({
|
|
46
|
+
options: props.options,
|
|
47
|
+
confirmed: false
|
|
48
|
+
});
|
|
49
|
+
const columnCounts = (0, import_vue2.ref)(props.columnCounts);
|
|
50
|
+
const onClickItem = (index) => {
|
|
51
|
+
if (props.readonly) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (currentIndex.value !== index) {
|
|
55
|
+
currentIndex.value = index;
|
|
56
|
+
const value = props.options[index][props.fields.value];
|
|
57
|
+
emit("change", value);
|
|
58
|
+
}
|
|
59
|
+
emit("clickOption", props.options[index]);
|
|
60
|
+
};
|
|
61
|
+
const getOptionText = (option) => {
|
|
62
|
+
if ((0, import_utils.isObject)(option) && option[props.fields.text]) {
|
|
63
|
+
return option[props.fields.text];
|
|
64
|
+
}
|
|
65
|
+
return option;
|
|
66
|
+
};
|
|
67
|
+
const isOptionDisabled = (option) => props.readonly || (0, import_utils.isObject)(option) && option.disabled;
|
|
68
|
+
const genOptions = () => {
|
|
69
|
+
columnCounts.value = Number(props.columnCounts);
|
|
70
|
+
if (columnCounts.value && columnCounts.value > 3) {
|
|
71
|
+
columnCounts.value = 3;
|
|
72
|
+
}
|
|
73
|
+
if (columnCounts.value && columnCounts.value < 1) {
|
|
74
|
+
columnCounts.value = 1;
|
|
75
|
+
}
|
|
76
|
+
const optionStyle = {
|
|
77
|
+
height: `${props.itemHeight + 8}px`,
|
|
78
|
+
width: `${1 / columnCounts.value * 100}%`
|
|
79
|
+
};
|
|
80
|
+
return state.options.map((option, index) => {
|
|
81
|
+
const text = getOptionText(option);
|
|
82
|
+
const value = option[props.fields.value];
|
|
83
|
+
const disabled = isOptionDisabled(option);
|
|
84
|
+
const childData = {
|
|
85
|
+
class: "zt-ellipsis",
|
|
86
|
+
[props.allowHtml ? "innerHTML" : "textContent"]: text
|
|
87
|
+
};
|
|
88
|
+
return (0, import_vue.createVNode)("div", {
|
|
89
|
+
"role": "button",
|
|
90
|
+
"style": optionStyle,
|
|
91
|
+
"tabindex": disabled ? -1 : 0,
|
|
92
|
+
"onClick": () => onClickItem(index),
|
|
93
|
+
"class": [bem("item", {
|
|
94
|
+
disabled,
|
|
95
|
+
selected: value === props.value,
|
|
96
|
+
"disabled-selected": disabled && value === props.value,
|
|
97
|
+
last: (index + 1) % columnCounts.value === 0
|
|
98
|
+
})]
|
|
99
|
+
}, [slots.options ? slots.options(option) : (0, import_vue.createVNode)("div", childData, null)]);
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
(0, import_vue2.watchEffect)(() => {
|
|
103
|
+
currentIndex.value = props.options.findIndex((option) => option[props.fields.value] === props.value);
|
|
104
|
+
});
|
|
105
|
+
return () => (0, import_vue.createVNode)("div", {
|
|
106
|
+
"class": bem()
|
|
107
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
108
|
+
"ref": "wrapper",
|
|
109
|
+
"class": bem("wrapper")
|
|
110
|
+
}, [genOptions()])]);
|
|
111
|
+
}
|
|
112
|
+
});
|
package/lib/picker/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-picker-cancel-margin: 8px 4px 8px 16px;--zt-picker-confirm-margin: 8px 16px 8px 4px;--zt-picker-title-height: 44px;--zt-picker-title-border-radius: 16px 16px 0 0;--zt-picker-frame-background-color: var(--zt-gray-a06);--zt-picker-title-text-color: var(--zt-gray-a4);--zt-picker-background: var(--zt-background-
|
|
1
|
+
:root{--zt-picker-cancel-margin: 8px 4px 8px 16px;--zt-picker-confirm-margin: 8px 16px 8px 4px;--zt-picker-title-height: 44px;--zt-picker-title-border-radius: 16px 16px 0 0;--zt-picker-frame-background-color: var(--zt-gray-a06);--zt-picker-title-text-color: var(--zt-gray-a4);--zt-picker-background: var(--zt-background-popup);--zt-picker-toolbar-height: 60px;--zt-picker-title-background: var(--zt-background-popup);--zt-picker-option-padding: 0 var(--zt-padding-base);--zt-picker-option-text-color: var(--zt-text-color);--zt-picker-option-disabled-opacity: var(--zt-disabled-opacity);--zt-picker-option-disabled-background: var(--zt-gray-a04);--zt-picker-loading-icon-color: var(--zt-primary-color);--zt-picker-loading-mask-color: rgba(255, 255, 255, .9);--zt-picker-mask-color: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4)), linear-gradient(0deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4));--zt-picker-warpper-padding: 12px 16px 4px 16px;--zt-picker-option-item-text-color: var(--zt-gray-a6);--zt-picker-option-item-padding: 0 4px 8px 0;--zt-picker-options-ellipsis-height: 36px;--zt-picker-options-ellipsis-border: 1px solid var(--zt-gray-a2);--zt-picker-option-item-disabled-opacity: var(--zt-disabled-opacity)}:root[zt-theme-size=large]{--zt-picker-options-ellipsis-height: 50px}.zt-theme-dark{--zt-picker-loading-mask-color: rgba(0, 0, 0, .6);--zt-picker-mask-color: linear-gradient(180deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .1)), linear-gradient(0deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .1))}.zt-picker{position:relative;background:var(--zt-picker-background);-webkit-user-select:none;user-select:none}.zt-picker__toolbar{display:flex;align-items:center;justify-content:space-between;height:var(--zt-picker-toolbar-height)}.zt-picker__cancel,.zt-picker__confirm{width:50%}.zt-picker__cancel{background:var(--zt-button-default-background);margin:var(--zt-picker-cancel-margin)}.zt-picker__confirm{margin:var(--zt-picker-confirm-margin)}.zt-picker__title{display:flex;justify-content:center;align-items:center;width:100%;height:var(--zt-picker-title-height);border-radius:var(--zt-picker-title-border-radius);font-size:var(--zt-font-size-md);background:var(--zt-picker-title-background);color:var(--zt-picker-title-text-color)}.zt-picker__columns{position:relative;display:flex;cursor:-webkit-grab;cursor:grab}.zt-picker__options{position:relative;display:flex;cursor:-webkit-grab;cursor:grab;overflow-y:scroll}.zt-picker__options:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:0;bottom:0;left:0;border-bottom:1px solid var(--zt-border-color);transform:scaleY(.5)}.zt-picker__options:before{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:0;right:0;left:0;border-top:1px solid var(--zt-border-color);transform:scaleY(.5)}.zt-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:flex;align-items:center;justify-content:center;color:var(--zt-picker-loading-icon-color);background:var(--zt-picker-loading-mask-color)}.zt-picker__frame{position:absolute;top:50%;z-index:2;transform:translateY(-50%);pointer-events:none;width:100%;background:var(--zt-picker-frame-background-color)}.zt-picker__mask{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;background-image:var(--zt-picker-mask-color);background-repeat:no-repeat;background-position:top,bottom;transform:translateZ(0);pointer-events:none}.zt-picker-column{position:relative;flex:1;overflow:hidden;font-size:var(--zt-font-size-lg);background:var(--zt-picker-background)}.zt-picker-column__wrapper{transition-timing-function:cubic-bezier(.23,1,.68,1)}.zt-picker-column__item{display:flex;align-items:center;justify-content:center;padding:var(--zt-picker-option-padding);color:var(--zt-picker-option-text-color)}.zt-picker-column__item--disabled{cursor:not-allowed;opacity:var(--zt-picker-option-disabled-opacity)}.zt-picker-column__item--selected{font-weight:700}.zt-picker-column__unit{background:var(--zt-picker-title-background);position:absolute;display:flex;align-items:center;justify-content:center;font-weight:700;color:var(--zt-picker-option-text-color);font-size:var(--zt-font-size-lg);width:100%;height:100%}.zt-picker-column__unit-text{margin:0 4px;font-size:var(--zt-font-size-md)}.zt-picker-options{flex:1;overflow-y:scroll;font-size:var(--zt-font-size-md);margin:0;outline:0 none;padding:0}.zt-picker-options__wrapper{display:flex;flex-wrap:wrap;background-color:var(--zt-picker-background);padding:var(--zt-picker-warpper-padding)}.zt-picker-options__item{color:var(--zt-picker-option-item-text-color);padding:var(--zt-picker-option-item-padding);box-sizing:border-box;text-align:center;font-size:var(--zt-font-size-md)}.zt-picker-options__item .zt-ellipsis{height:var(--zt-picker-options-ellipsis-height);line-height:var(--zt-picker-options-ellipsis-height);border-radius:calc(var(--zt-picker-options-ellipsis-height) / 2);background:var(--zt-gray-a04);padding:0 var(--zt-padding-md)}.zt-picker-options__item:active{opacity:var(--zt-active-opacity)}.zt-picker-options__item--disabled{cursor:not-allowed;color:var(--zt-gray-a2)}.zt-picker-options__item--disabled .zt-ellipsis{background:var(--zt-picker-option-disabled-background)!important}.zt-picker-options__item--last{padding-right:0}.zt-picker-options__item--selected{color:var(--zt-white)}.zt-picker-options__item--selected .zt-ellipsis{background:var(--zt-primary-color)}.zt-picker-options__item--disabled-selected{cursor:not-allowed;color:var(--zt-gray)!important}.zt-picker-options__item--disabled-selected .zt-ellipsis{background:var(--zt-picker-option-disabled-background)!important}
|
package/lib/picker/index.d.ts
CHANGED
|
@@ -53,7 +53,15 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
|
|
|
53
53
|
type: BooleanConstructor;
|
|
54
54
|
default: true;
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
showType: {
|
|
57
|
+
type: import("vue").PropType<import("./types").PickerShowType>;
|
|
58
|
+
default: import("./types").PickerShowType;
|
|
59
|
+
};
|
|
60
|
+
columnCounts: {
|
|
61
|
+
type: NumberConstructor;
|
|
62
|
+
default: number;
|
|
63
|
+
};
|
|
64
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm" | "clickOption" | "update:showPicker")[], "update:modelValue" | "cancel" | "change" | "confirm" | "clickOption" | "update:showPicker", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
65
|
loading: BooleanConstructor;
|
|
58
66
|
readonly: BooleanConstructor;
|
|
59
67
|
allowHtml: BooleanConstructor;
|
|
@@ -107,25 +115,35 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
|
|
|
107
115
|
type: BooleanConstructor;
|
|
108
116
|
default: true;
|
|
109
117
|
};
|
|
118
|
+
showType: {
|
|
119
|
+
type: import("vue").PropType<import("./types").PickerShowType>;
|
|
120
|
+
default: import("./types").PickerShowType;
|
|
121
|
+
};
|
|
122
|
+
columnCounts: {
|
|
123
|
+
type: NumberConstructor;
|
|
124
|
+
default: number;
|
|
125
|
+
};
|
|
110
126
|
}>> & {
|
|
111
127
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
112
128
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
113
129
|
onCancel?: ((...args: any[]) => any) | undefined;
|
|
114
130
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
115
|
-
"onUpdate:showPicker"?: ((...args: any[]) => any) | undefined;
|
|
116
131
|
onClickOption?: ((...args: any[]) => any) | undefined;
|
|
132
|
+
"onUpdate:showPicker"?: ((...args: any[]) => any) | undefined;
|
|
117
133
|
}, {
|
|
118
134
|
title: string;
|
|
119
135
|
modelValue: import("../utils").Numeric[];
|
|
120
136
|
readonly: boolean;
|
|
121
137
|
popup: boolean;
|
|
122
138
|
loading: boolean;
|
|
139
|
+
showType: import("./types").PickerShowType;
|
|
123
140
|
showTitle: boolean;
|
|
124
141
|
columns: (import("./types").PickerColumn | import("./types").PickerOption)[];
|
|
125
142
|
allowHtml: boolean;
|
|
126
143
|
swipeDuration: string | number;
|
|
127
|
-
showPicker: boolean;
|
|
128
144
|
showToolbar: boolean;
|
|
145
|
+
showPicker: boolean;
|
|
146
|
+
columnCounts: number;
|
|
129
147
|
toolbarPosition: import("./types").PickerToolbarPosition;
|
|
130
148
|
optionHeight: string | number;
|
|
131
149
|
visibleOptionNum: string | number;
|
package/lib/picker/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ComponentPublicInstance } from 'vue';
|
|
2
2
|
import type { Numeric } from '../utils';
|
|
3
3
|
import type { PickerProps } from './Picker';
|
|
4
|
+
export type PickerShowType = 'default' | 'button';
|
|
4
5
|
export type PickerToolbarPosition = 'top' | 'bottom';
|
|
5
6
|
export type PickerFieldNames = {
|
|
6
7
|
text?: string;
|
|
@@ -15,6 +16,9 @@ export type PickerOption = {
|
|
|
15
16
|
className?: unknown;
|
|
16
17
|
[key: PropertyKey]: any;
|
|
17
18
|
};
|
|
19
|
+
export type PickerOptionsExpose = {
|
|
20
|
+
setConfirmIndex: (indexes: PickerOption) => void;
|
|
21
|
+
};
|
|
18
22
|
export type PickerColumn = PickerOption[];
|
|
19
23
|
export type PickerExpose = {
|
|
20
24
|
confirm: () => void;
|
|
@@ -33,7 +37,7 @@ export type PickerColumnProvide = {
|
|
|
33
37
|
setOptions: (options: PickerOption[]) => void;
|
|
34
38
|
stopMomentum: () => void;
|
|
35
39
|
};
|
|
36
|
-
export type PickerInstance = ComponentPublicInstance<PickerProps, PickerExpose>;
|
|
40
|
+
export type PickerInstance = ComponentPublicInstance<PickerProps, PickerExpose, PickerOptionsExpose>;
|
|
37
41
|
export type PickerConfirmEventParams = {
|
|
38
42
|
selectedValues: Numeric[];
|
|
39
43
|
selectedOptions: Array<PickerOption | undefined>;
|
package/lib/popover/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-popover-arrow-size: 6px;--zt-popover-radius: var(--zt-radius-lg);--zt-popover-action-width: 120px;--zt-popover-action-height: 40px;--zt-popover-light-text-color: var(--zt-text-color);--zt-popover-light-background: var(--zt-background-
|
|
1
|
+
:root{--zt-popover-arrow-size: 6px;--zt-popover-radius: var(--zt-radius-lg);--zt-popover-action-width: 120px;--zt-popover-action-height: 40px;--zt-popover-light-text-color: var(--zt-text-color);--zt-popover-light-background: var(--zt-background-popup);--zt-popover-light-action-disabled-text-color: var(--zt-text-color-3);--zt-popover-dark-text-color: var(--zt-white);--zt-popover-dark-background: #4a4a4a;--zt-popover-dark-action-disabled-text-color: var(--zt-text-color-2)}.zt-popover{position:absolute;overflow:visible;background-color:transparent;transition:opacity .15s,transform .15s}.zt-popover__wrapper{display:inline-block}.zt-popover__arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid;border-width:var(--zt-popover-arrow-size)}.zt-popover__content{overflow:hidden;border-radius:var(--zt-popover-radius)}.zt-popover__action{position:relative;display:flex;align-items:center;box-sizing:border-box;width:var(--zt-popover-action-width);height:var(--zt-popover-action-height);padding:0 var(--zt-padding-md);font-size:var(--zt-font-size-md);line-height:var(--zt-line-height-md);cursor:pointer}.zt-popover__action:last-child .zt-popover__action-text:after{display:none}.zt-popover__action-text{width:100%;height:100%;line-height:var(--zt-popover-action-height);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zt-popover__action-icon{margin-right:var(--zt-padding-xs);font-size:var(--zt-font-size-xxl)}.zt-popover__action--with-icon .zt-popover__action-text{text-align:start}.zt-popover[data-popper-placement^=top] .zt-popover__arrow{bottom:0;border-top-color:currentColor;border-bottom-width:0;margin-bottom:calc(var(--zt-popover-arrow-size) * -1)}.zt-popover[data-popper-placement=top]{transform-origin:50% 100%}.zt-popover[data-popper-placement=top] .zt-popover__arrow{left:50%;transform:translate(-50%)}.zt-popover[data-popper-placement=top-start]{transform-origin:0 100%}.zt-popover[data-popper-placement=top-start] .zt-popover__arrow{left:var(--zt-padding-md)}.zt-popover[data-popper-placement=top-end]{transform-origin:100% 100%}.zt-popover[data-popper-placement=top-end] .zt-popover__arrow{right:var(--zt-padding-md)}.zt-popover[data-popper-placement^=left] .zt-popover__arrow{right:0;border-right-width:0;border-left-color:currentColor;transform:translateY(-50%);margin-right:calc(var(--zt-popover-arrow-size) * -1)}.zt-popover[data-popper-placement=left]{transform-origin:100% 50%}.zt-popover[data-popper-placement=left] .zt-popover__arrow{top:50%}.zt-popover[data-popper-placement=left-start]{transform-origin:100% 0}.zt-popover[data-popper-placement=left-start] .zt-popover__arrow{top:var(--zt-padding-md)}.zt-popover[data-popper-placement=left-end]{transform-origin:100% 100%}.zt-popover[data-popper-placement=left-end] .zt-popover__arrow{bottom:var(--zt-padding-md)}.zt-popover[data-popper-placement^=right] .zt-popover__arrow{left:0;border-right-color:currentColor;border-left-width:0;transform:translateY(-50%);margin-left:calc(var(--zt-popover-arrow-size) * -1)}.zt-popover[data-popper-placement=right]{transform-origin:0 50%}.zt-popover[data-popper-placement=right] .zt-popover__arrow{top:50%}.zt-popover[data-popper-placement=right-start]{transform-origin:0 0}.zt-popover[data-popper-placement=right-start] .zt-popover__arrow{top:var(--zt-padding-md)}.zt-popover[data-popper-placement=right-end]{transform-origin:0 100%}.zt-popover[data-popper-placement=right-end] .zt-popover__arrow{bottom:var(--zt-padding-md)}.zt-popover[data-popper-placement^=bottom] .zt-popover__arrow{top:0;border-top-width:0;border-bottom-color:currentColor;transform:translate(-50%);margin-top:calc(var(--zt-popover-arrow-size) * -1)}.zt-popover[data-popper-placement=bottom]{transform-origin:50% 0}.zt-popover[data-popper-placement=bottom] .zt-popover__arrow{left:50%}.zt-popover[data-popper-placement=bottom-start]{transform-origin:0 0}.zt-popover[data-popper-placement=bottom-start] .zt-popover__arrow{left:var(--zt-padding-md)}.zt-popover[data-popper-placement=bottom-end]{transform-origin:100% 0}.zt-popover[data-popper-placement=bottom-end] .zt-popover__arrow{right:var(--zt-padding-md)}.zt-popover--light{display:none;color:var(--zt-popover-light-text-color)}.zt-popover--light .zt-popover__content{background:var(--zt-popover-light-background);box-shadow:0 2px 12px rgba(50,50,51,.12)}.zt-popover--light .zt-popover__arrow{color:var(--zt-popover-light-background)}.zt-popover--light .zt-popover__action:active{background-color:var(--zt-active-color)}.zt-popover--light .zt-popover__action--selected{color:var(--zt-primary-color);cursor:not-allowed}.zt-popover--light .zt-popover__action--selected:active{background-color:transparent}.zt-popover--light .zt-popover__action--disabled{color:var(--zt-popover-light-action-disabled-text-color);cursor:not-allowed}.zt-popover--light .zt-popover__action--disabled:active{background-color:transparent}.zt-popover--dark{display:none;color:var(--zt-popover-dark-text-color)}.zt-popover--dark .zt-popover__content{background:var(--zt-popover-dark-background)}.zt-popover--dark .zt-popover__arrow{color:var(--zt-popover-dark-background)}.zt-popover--dark .zt-popover__action:active{background-color:rgba(0,0,0,.2)}.zt-popover--dark .zt-popover__action--disabled{color:var(--zt-popover-dark-action-disabled-text-color)}.zt-popover--dark .zt-popover__action--disabled:active{background-color:transparent}.zt-popover--dark .zt-popover__action-text:after{border-color:var(--zt-gray-7)}.zt-popover--show{display:block}.zt-popover--hidden{display:none}.zt-popover-zoom-enter-from,.zt-popover-zoom-leave-active{transform:scale(.8);opacity:0}.zt-popover-zoom-enter-active{transition-timing-function:var(--zt-ease-out)}.zt-popover-zoom-leave-active{transition-timing-function:var(--zt-ease-in)}
|
package/lib/popup/Popup.js
CHANGED
|
@@ -199,13 +199,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
199
199
|
}, attrs, (0, import_use_scope_id.useScopeId)()), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[import_vue.vShow, props.show]]);
|
|
200
200
|
});
|
|
201
201
|
const sliderRenderPopup = lazyRender(() => {
|
|
202
|
-
var _a
|
|
202
|
+
var _a;
|
|
203
203
|
return (0, import_vue.withDirectives)((0, import_vue.createVNode)("div", (0, import_vue.mergeProps)({
|
|
204
204
|
"class": bem("slider"),
|
|
205
205
|
"ref": popupRef,
|
|
206
206
|
"style": style.value,
|
|
207
207
|
"onKeydown": onKeydown
|
|
208
|
-
}, attrs), [
|
|
208
|
+
}, attrs), [renderCloseIcon(), (0, import_vue.createVNode)("div", {
|
|
209
209
|
"class": bem("slider-title"),
|
|
210
210
|
"style": `height:${touchAreaHeight}px;`,
|
|
211
211
|
"ref": root
|
|
@@ -214,7 +214,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
214
214
|
}, null)]), (0, import_vue.createVNode)("div", {
|
|
215
215
|
"class": bem("slider-content"),
|
|
216
216
|
"style": contentStyle.value
|
|
217
|
-
}, [(
|
|
217
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]), [[import_vue.vShow, props.show]]);
|
|
218
218
|
});
|
|
219
219
|
const renderTransition = () => {
|
|
220
220
|
const {
|
package/lib/popup/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-popup-background: var(--zt-background-
|
|
1
|
+
:root{--zt-popup-background: var(--zt-background-popup);--zt-popup-transition: transform var(--zt-duration-base);--zt-popup-round-radius: 16px;--zt-popup-close-icon-color: var(--zt-gray-a6);--zt-popup-close-icon-margin: 16px;--zt-popup-close-icon-z-index: 1}.zt-overflow-hidden{overflow:hidden!important}.zt-popup{position:fixed;max-height:100%;overflow-y:auto;background:var(--zt-popup-background);transition:var(--zt-popup-transition);-webkit-overflow-scrolling:touch}.zt-popup__slider{position:fixed;width:100%;bottom:0;left:0;border-radius:16px 16px 0 0;background-color:var(--zt-popup-background)}.zt-popup__slider-title{height:40px;text-align:center}.zt-popup__slider-bar{display:inline-block;width:32px;height:4px;transform:scaleY(-1);background:rgba(45,75,115,.2);border-radius:3px}.zt-popup__slider-content{overflow-y:auto}.zt-popup--center{top:50%;left:50%;transform:translate3d(-50%,-50%,0)}.zt-popup--center.zt-popup--round{border-radius:var(--zt-popup-round-radius)}.zt-popup--top{top:0;left:0;width:100%}.zt-popup--top.zt-popup--round{border-radius:0 0 var(--zt-popup-round-radius) var(--zt-popup-round-radius)}.zt-popup--right{top:50%;right:0;transform:translate3d(0,-50%,0)}.zt-popup--right.zt-popup--round{border-radius:var(--zt-popup-round-radius) 0 0 var(--zt-popup-round-radius)}.zt-popup--bottom{bottom:0;left:0;width:100%}.zt-popup--bottom.zt-popup--round{border-radius:var(--zt-popup-round-radius) var(--zt-popup-round-radius) 0 0}.zt-popup--left{top:50%;left:0;transform:translate3d(0,-50%,0)}.zt-popup--left.zt-popup--round{border-radius:0 var(--zt-popup-round-radius) var(--zt-popup-round-radius) 0}.zt-popup-slide-top-enter-active,.zt-popup-slide-left-enter-active,.zt-popup-slide-right-enter-active,.zt-popup-slide-bottom-enter-active{transition-timing-function:var(--zt-ease-out)}.zt-popup-slide-top-leave-active,.zt-popup-slide-left-leave-active,.zt-popup-slide-right-leave-active,.zt-popup-slide-bottom-leave-active{transition-timing-function:var(--zt-ease-in)}.zt-popup-slide-top-enter-from,.zt-popup-slide-top-leave-active{transform:translate3d(0,-100%,0)}.zt-popup-slide-right-enter-from,.zt-popup-slide-right-leave-active{transform:translate3d(100%,-50%,0)}.zt-popup-slide-bottom-enter-from,.zt-popup-slide-bottom-leave-active{transform:translate3d(0,100%,0)}.zt-popup-slide-left-enter-from,.zt-popup-slide-left-leave-active{transform:translate3d(-100%,-50%,0)}.zt-popup__slider-icon{z-index:var(--zt-popup-close-icon-z-index);color:var(--zt-popup-close-icon-color);font-size:var(--zt-font-size-xxxl);cursor:pointer}.zt-popup__close-icon{position:absolute;z-index:var(--zt-popup-close-icon-z-index);color:var(--zt-popup-close-icon-color);font-size:var(--zt-font-size-xxxl)}.zt-popup__close-icon--top-left{top:var(--zt-popup-close-icon-margin);left:var(--zt-popup-close-icon-margin)}.zt-popup__close-icon--top-right{top:var(--zt-popup-close-icon-margin);right:var(--zt-popup-close-icon-margin)}.zt-popup__close-icon--bottom-left{bottom:var(--zt-popup-close-icon-margin);left:var(--zt-popup-close-icon-margin)}.zt-popup__close-icon--bottom-right{right:var(--zt-popup-close-icon-margin);bottom:var(--zt-popup-close-icon-margin)}
|
|
@@ -41,7 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
41
|
type: (NumberConstructor | StringConstructor)[];
|
|
42
42
|
default: number;
|
|
43
43
|
};
|
|
44
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
44
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
45
45
|
disabled: BooleanConstructor;
|
|
46
46
|
modelValue: BooleanConstructor;
|
|
47
47
|
headHeight: {
|
|
@@ -18,7 +18,7 @@ export declare const PullRefresh: import("../utils").WithInstall<import("vue").D
|
|
|
18
18
|
type: (NumberConstructor | StringConstructor)[];
|
|
19
19
|
default: number;
|
|
20
20
|
};
|
|
21
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
21
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
22
|
disabled: BooleanConstructor;
|
|
23
23
|
modelValue: BooleanConstructor;
|
|
24
24
|
headHeight: {
|
|
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
26
26
|
};
|
|
27
27
|
modelValue: import("vue").PropType<unknown>;
|
|
28
28
|
checkedColor: StringConstructor;
|
|
29
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
29
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
30
30
|
disabled: BooleanConstructor;
|
|
31
31
|
iconSize: (NumberConstructor | StringConstructor)[];
|
|
32
32
|
direction: {
|
|
@@ -7,7 +7,7 @@ export declare const RadioGroup: import("../utils").WithInstall<import("vue").De
|
|
|
7
7
|
};
|
|
8
8
|
modelValue: import("vue").PropType<unknown>;
|
|
9
9
|
checkedColor: StringConstructor;
|
|
10
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
10
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
11
|
disabled: BooleanConstructor;
|
|
12
12
|
iconSize: (NumberConstructor | StringConstructor)[];
|
|
13
13
|
direction: {
|