vant 4.0.0-beta.1 → 4.0.0-rc.0
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/changelog.generated.md +46 -42
- package/es/action-bar/ActionBar.d.ts +1 -1
- package/es/action-bar/index.d.ts +1 -1
- package/es/action-bar-button/ActionBarButton.d.ts +1 -1
- package/es/action-bar-button/index.d.ts +1 -1
- package/es/action-bar-icon/ActionBarIcon.d.ts +1 -1
- package/es/action-bar-icon/index.d.ts +1 -1
- package/es/address-edit/style/index.mjs +7 -1
- package/es/area/Area.d.ts +6 -3
- package/es/area/index.d.ts +4 -2
- package/es/area/style/index.mjs +7 -0
- package/es/area/utils.mjs +9 -2
- package/es/badge/Badge.d.ts +1 -1
- package/es/badge/index.d.ts +1 -1
- package/es/calendar/Calendar.mjs +4 -3
- package/es/calendar/style/index.mjs +7 -1
- package/es/cell/Cell.d.ts +1 -1
- package/es/cell/index.d.ts +1 -1
- package/es/cell-group/CellGroup.d.ts +1 -1
- package/es/cell-group/index.d.ts +1 -1
- package/es/col/Col.d.ts +1 -1
- package/es/col/index.d.ts +1 -1
- package/es/collapse-item/CollapseItem.d.ts +1 -1
- package/es/collapse-item/index.d.ts +1 -1
- package/es/composables/use-lazy-render.mjs +9 -5
- package/es/composables/use-lock-scroll.mjs +4 -1
- package/es/composables/use-visibility-change.mjs +6 -3
- package/es/config-provider/ConfigProvider.d.ts +1 -1
- package/es/config-provider/index.d.ts +1 -1
- package/es/coupon/Coupon.d.ts +1 -1
- package/es/coupon/index.d.ts +1 -1
- package/es/coupon/utils.mjs +3 -1
- package/es/coupon-cell/CouponCell.d.ts +1 -1
- package/es/coupon-cell/index.d.ts +1 -1
- package/es/coupon-list/style/index.mjs +3 -3
- package/es/date-picker/DatePicker.d.ts +6 -3
- package/es/date-picker/DatePicker.mjs +10 -10
- package/es/date-picker/index.d.ts +4 -2
- package/es/date-picker/style/index.mjs +7 -0
- package/es/date-picker/utils.d.ts +2 -1
- package/es/divider/Divider.d.ts +1 -1
- package/es/divider/index.d.ts +1 -1
- package/es/dropdown-item/DropdownItem.d.ts +2 -2
- package/es/dropdown-item/index.d.ts +2 -2
- package/es/dropdown-menu/DropdownMenu.d.ts +1 -1
- package/es/dropdown-menu/index.d.ts +1 -1
- package/es/empty/Empty.d.ts +1 -1
- package/es/empty/index.d.ts +1 -1
- package/es/field/Field.mjs +10 -3
- package/es/grid/Grid.d.ts +1 -1
- package/es/grid/index.d.ts +1 -1
- package/es/grid-item/GridItem.d.ts +1 -1
- package/es/grid-item/index.d.ts +1 -1
- package/es/icon/Icon.d.ts +1 -1
- package/es/icon/index.d.ts +1 -1
- package/es/image-preview/ImagePreviewItem.mjs +10 -2
- package/es/index-anchor/IndexAnchor.d.ts +1 -1
- package/es/index-anchor/index.d.ts +1 -1
- package/es/index-bar/IndexBar.mjs +7 -3
- package/es/index.d.ts +2 -1
- package/es/index.mjs +4 -1
- package/es/lazyload/vue-lazyload/lazy-component.mjs +4 -1
- package/es/lazyload/vue-lazyload/lazy-container.mjs +11 -7
- package/es/lazyload/vue-lazyload/lazy-image.mjs +24 -14
- package/es/lazyload/vue-lazyload/lazy.mjs +11 -3
- package/es/lazyload/vue-lazyload/listener.mjs +45 -33
- package/es/lazyload/vue-lazyload/util.mjs +4 -1
- package/es/loading/Loading.d.ts +1 -1
- package/es/loading/index.d.ts +1 -1
- package/es/number-keyboard/NumberKeyboard.d.ts +1 -1
- package/es/number-keyboard/index.d.ts +1 -1
- package/es/overlay/Overlay.d.ts +1 -1
- package/es/overlay/Overlay.mjs +13 -6
- package/es/overlay/index.d.ts +1 -1
- package/es/picker/Picker.d.ts +8 -4
- package/es/picker/Picker.mjs +43 -67
- package/es/picker/PickerColumn.mjs +6 -2
- package/es/picker/PickerToolbar.d.ts +21 -0
- package/es/picker/PickerToolbar.mjs +59 -0
- package/es/picker/index.d.ts +4 -2
- package/es/picker/style/index.mjs +7 -0
- package/es/picker/utils.d.ts +2 -0
- package/es/picker/utils.mjs +14 -7
- package/es/picker-group/PickerGroup.d.ts +39 -0
- package/es/picker-group/PickerGroup.mjs +57 -0
- package/es/picker-group/index.css +1 -0
- package/es/picker-group/index.d.ts +32 -0
- package/es/picker-group/index.mjs +8 -0
- package/es/picker-group/style/index.d.ts +1 -0
- package/es/picker-group/style/index.mjs +9 -0
- package/es/popup/Popup.d.ts +2 -2
- package/es/popup/index.d.ts +2 -2
- package/es/popup/shared.mjs +3 -1
- package/es/progress/Progress.d.ts +1 -1
- package/es/progress/index.d.ts +1 -1
- package/es/rate/Rate.mjs +5 -3
- package/es/row/Row.d.ts +1 -1
- package/es/row/index.d.ts +1 -1
- package/es/skeleton/Skeleton.d.ts +1 -1
- package/es/skeleton/index.d.ts +1 -1
- package/es/slider/Slider.mjs +6 -2
- package/es/space/Space.d.ts +1 -1
- package/es/space/index.d.ts +1 -1
- package/es/step/Step.d.ts +1 -1
- package/es/step/index.d.ts +1 -1
- package/es/swipe/Swipe.mjs +13 -6
- package/es/swipe-cell/SwipeCell.d.ts +2 -2
- package/es/swipe-cell/SwipeCell.mjs +4 -2
- package/es/swipe-cell/index.d.ts +2 -2
- package/es/swipe-item/SwipeItem.d.ts +1 -1
- package/es/swipe-item/index.d.ts +1 -1
- package/es/tab/Tab.d.ts +1 -1
- package/es/tab/index.d.ts +1 -1
- package/es/tabs/TabsTitle.d.ts +1 -1
- package/es/time-picker/TimePicker.d.ts +6 -3
- package/es/time-picker/index.d.ts +4 -2
- package/es/time-picker/style/index.mjs +7 -0
- package/es/utils/create.mjs +8 -2
- package/es/utils/with-install.d.ts +2 -2
- package/es/utils/with-install.mjs +4 -2
- package/lib/action-bar/ActionBar.d.ts +1 -1
- package/lib/action-bar/index.d.ts +1 -1
- package/lib/action-bar/index.js +4 -1
- package/lib/action-bar-button/ActionBarButton.d.ts +1 -1
- package/lib/action-bar-button/index.d.ts +1 -1
- package/lib/action-bar-button/index.js +4 -1
- package/lib/action-bar-icon/ActionBarIcon.d.ts +1 -1
- package/lib/action-bar-icon/index.d.ts +1 -1
- package/lib/action-bar-icon/index.js +4 -1
- package/lib/action-sheet/index.js +4 -1
- package/lib/address-edit/AddressEdit.js +4 -1
- package/lib/address-edit/index.js +4 -1
- package/lib/address-edit/style/index.js +7 -1
- package/lib/address-list/AddressList.js +4 -1
- package/lib/address-list/index.js +4 -1
- package/lib/area/Area.d.ts +6 -3
- package/lib/area/index.d.ts +4 -2
- package/lib/area/index.js +4 -1
- package/lib/area/style/index.js +7 -0
- package/lib/area/utils.js +9 -2
- package/lib/badge/Badge.d.ts +1 -1
- package/lib/badge/index.d.ts +1 -1
- package/lib/badge/index.js +4 -1
- package/lib/button/index.js +4 -1
- package/lib/calendar/Calendar.js +8 -4
- package/lib/calendar/CalendarMonth.js +4 -1
- package/lib/calendar/index.js +4 -1
- package/lib/calendar/style/index.js +7 -1
- package/lib/card/index.js +4 -1
- package/lib/cascader/index.js +4 -1
- package/lib/cell/Cell.d.ts +1 -1
- package/lib/cell/index.d.ts +1 -1
- package/lib/cell/index.js +4 -1
- package/lib/cell-group/CellGroup.d.ts +1 -1
- package/lib/cell-group/index.d.ts +1 -1
- package/lib/cell-group/index.js +4 -1
- package/lib/checkbox/Checkbox.js +4 -1
- package/lib/checkbox/index.js +4 -1
- package/lib/checkbox-group/index.js +4 -1
- package/lib/circle/index.js +4 -1
- package/lib/col/Col.d.ts +1 -1
- package/lib/col/index.d.ts +1 -1
- package/lib/col/index.js +4 -1
- package/lib/collapse/index.js +4 -1
- package/lib/collapse-item/CollapseItem.d.ts +1 -1
- package/lib/collapse-item/index.d.ts +1 -1
- package/lib/collapse-item/index.js +4 -1
- package/lib/composables/use-lazy-render.js +9 -5
- package/lib/composables/use-lock-scroll.js +4 -1
- package/lib/composables/use-visibility-change.js +6 -3
- package/lib/config-provider/ConfigProvider.d.ts +1 -1
- package/lib/config-provider/index.d.ts +1 -1
- package/lib/config-provider/index.js +4 -1
- package/lib/contact-card/index.js +4 -1
- package/lib/contact-edit/index.js +4 -1
- package/lib/contact-list/index.js +4 -1
- package/lib/count-down/index.js +4 -1
- package/lib/coupon/Coupon.d.ts +1 -1
- package/lib/coupon/index.d.ts +1 -1
- package/lib/coupon/index.js +4 -1
- package/lib/coupon/utils.js +3 -1
- package/lib/coupon-cell/CouponCell.d.ts +1 -1
- package/lib/coupon-cell/index.d.ts +1 -1
- package/lib/coupon-cell/index.js +4 -1
- package/lib/coupon-list/index.js +4 -1
- package/lib/coupon-list/style/index.js +3 -3
- package/lib/date-picker/DatePicker.d.ts +6 -3
- package/lib/date-picker/DatePicker.js +10 -10
- package/lib/date-picker/index.d.ts +4 -2
- package/lib/date-picker/index.js +4 -1
- package/lib/date-picker/style/index.js +7 -0
- package/lib/date-picker/utils.d.ts +2 -1
- package/lib/dialog/function-call.js +4 -1
- package/lib/dialog/index.js +4 -1
- package/lib/divider/Divider.d.ts +1 -1
- package/lib/divider/index.d.ts +1 -1
- package/lib/divider/index.js +4 -1
- package/lib/dropdown-item/DropdownItem.d.ts +2 -2
- package/lib/dropdown-item/index.d.ts +2 -2
- package/lib/dropdown-item/index.js +4 -1
- package/lib/dropdown-menu/DropdownMenu.d.ts +1 -1
- package/lib/dropdown-menu/index.d.ts +1 -1
- package/lib/dropdown-menu/index.js +4 -1
- package/lib/empty/Empty.d.ts +1 -1
- package/lib/empty/index.d.ts +1 -1
- package/lib/empty/index.js +4 -1
- package/lib/field/Field.js +9 -2
- package/lib/field/index.js +4 -1
- package/lib/form/index.js +4 -1
- package/lib/grid/Grid.d.ts +1 -1
- package/lib/grid/index.d.ts +1 -1
- package/lib/grid/index.js +4 -1
- package/lib/grid-item/GridItem.d.ts +1 -1
- package/lib/grid-item/index.d.ts +1 -1
- package/lib/grid-item/index.js +4 -1
- package/lib/icon/Icon.d.ts +1 -1
- package/lib/icon/index.d.ts +1 -1
- package/lib/icon/index.js +4 -1
- package/lib/image/index.js +4 -1
- package/lib/image-preview/ImagePreview.js +4 -1
- package/lib/image-preview/ImagePreviewItem.js +9 -1
- package/lib/image-preview/function-call.js +4 -1
- package/lib/image-preview/index.js +4 -1
- package/lib/index-anchor/IndexAnchor.d.ts +1 -1
- package/lib/index-anchor/index.d.ts +1 -1
- package/lib/index-anchor/index.js +4 -1
- package/lib/index-bar/IndexBar.js +7 -3
- package/lib/index-bar/index.js +4 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/lazyload/vue-lazyload/index.js +4 -1
- package/lib/lazyload/vue-lazyload/lazy-component.js +4 -1
- package/lib/lazyload/vue-lazyload/lazy-container.js +11 -7
- package/lib/lazyload/vue-lazyload/lazy-image.js +24 -14
- package/lib/lazyload/vue-lazyload/lazy.js +15 -4
- package/lib/lazyload/vue-lazyload/listener.js +45 -33
- package/lib/lazyload/vue-lazyload/util.js +4 -1
- package/lib/list/index.js +4 -1
- package/lib/loading/Loading.d.ts +1 -1
- package/lib/loading/index.d.ts +1 -1
- package/lib/loading/index.js +4 -1
- package/lib/locale/index.js +4 -1
- package/lib/nav-bar/index.js +4 -1
- package/lib/notice-bar/index.js +4 -1
- package/lib/notify/function-call.js +4 -1
- package/lib/notify/index.js +4 -1
- package/lib/number-keyboard/NumberKeyboard.d.ts +1 -1
- package/lib/number-keyboard/NumberKeyboard.js +4 -1
- package/lib/number-keyboard/index.d.ts +1 -1
- package/lib/number-keyboard/index.js +4 -1
- package/lib/overlay/Overlay.d.ts +1 -1
- package/lib/overlay/Overlay.js +11 -4
- package/lib/overlay/index.d.ts +1 -1
- package/lib/overlay/index.js +4 -1
- package/lib/pagination/index.js +4 -1
- package/lib/password-input/index.js +4 -1
- package/lib/picker/Picker.d.ts +8 -4
- package/lib/picker/Picker.js +49 -70
- package/lib/picker/PickerColumn.js +5 -1
- package/lib/picker/PickerToolbar.d.ts +21 -0
- package/lib/picker/PickerToolbar.js +78 -0
- package/lib/picker/index.d.ts +4 -2
- package/lib/picker/index.js +4 -1
- package/lib/picker/style/index.js +7 -0
- package/lib/picker/utils.d.ts +2 -0
- package/lib/picker/utils.js +15 -8
- package/lib/picker-group/PickerGroup.d.ts +39 -0
- package/lib/picker-group/PickerGroup.js +82 -0
- package/lib/picker-group/index.css +1 -0
- package/lib/picker-group/index.d.ts +32 -0
- package/lib/picker-group/index.js +33 -0
- package/lib/picker-group/style/index.d.ts +1 -0
- package/lib/picker-group/style/index.js +9 -0
- package/lib/popover/index.js +4 -1
- package/lib/popup/Popup.d.ts +2 -2
- package/lib/popup/index.d.ts +2 -2
- package/lib/popup/index.js +4 -1
- package/lib/popup/shared.js +3 -1
- package/lib/progress/Progress.d.ts +1 -1
- package/lib/progress/index.d.ts +1 -1
- package/lib/progress/index.js +4 -1
- package/lib/pull-refresh/index.js +4 -1
- package/lib/radio/Radio.js +4 -1
- package/lib/radio/index.js +4 -1
- package/lib/radio-group/index.js +4 -1
- package/lib/rate/Rate.js +4 -2
- package/lib/rate/index.js +4 -1
- package/lib/row/Row.d.ts +1 -1
- package/lib/row/index.d.ts +1 -1
- package/lib/row/index.js +4 -1
- package/lib/search/index.js +4 -1
- package/lib/share-sheet/index.js +4 -1
- package/lib/sidebar/index.js +4 -1
- package/lib/sidebar-item/index.js +4 -1
- package/lib/skeleton/Skeleton.d.ts +1 -1
- package/lib/skeleton/index.d.ts +1 -1
- package/lib/skeleton/index.js +4 -1
- package/lib/slider/Slider.js +5 -1
- package/lib/slider/index.js +4 -1
- package/lib/space/Space.d.ts +1 -1
- package/lib/space/index.d.ts +1 -1
- package/lib/space/index.js +4 -1
- package/lib/step/Step.d.ts +1 -1
- package/lib/step/index.d.ts +1 -1
- package/lib/step/index.js +4 -1
- package/lib/stepper/index.js +4 -1
- package/lib/steps/index.js +4 -1
- package/lib/sticky/index.js +4 -1
- package/lib/submit-bar/index.js +4 -1
- package/lib/swipe/Swipe.js +12 -5
- package/lib/swipe/index.js +4 -1
- package/lib/swipe-cell/SwipeCell.d.ts +2 -2
- package/lib/swipe-cell/SwipeCell.js +3 -1
- package/lib/swipe-cell/index.d.ts +2 -2
- package/lib/swipe-cell/index.js +4 -1
- package/lib/swipe-item/SwipeItem.d.ts +1 -1
- package/lib/swipe-item/index.d.ts +1 -1
- package/lib/swipe-item/index.js +4 -1
- package/lib/switch/index.js +4 -1
- package/lib/tab/Tab.d.ts +1 -1
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/index.js +4 -1
- package/lib/tabbar/index.js +4 -1
- package/lib/tabbar-item/index.js +4 -1
- package/lib/tabs/Tabs.js +4 -1
- package/lib/tabs/TabsTitle.d.ts +1 -1
- package/lib/tabs/index.js +4 -1
- package/lib/tag/index.js +4 -1
- package/lib/time-picker/TimePicker.d.ts +6 -3
- package/lib/time-picker/index.d.ts +4 -2
- package/lib/time-picker/index.js +4 -1
- package/lib/time-picker/style/index.js +7 -0
- package/lib/toast/function-call.js +4 -1
- package/lib/toast/index.js +4 -1
- package/lib/tree-select/index.js +4 -1
- package/lib/uploader/Uploader.js +4 -1
- package/lib/uploader/index.js +4 -1
- package/lib/utils/create.js +12 -3
- package/lib/utils/with-install.d.ts +2 -2
- package/lib/utils/with-install.js +4 -2
- package/lib/vant.cjs.js +4345 -4157
- package/lib/vant.es.js +4347 -4159
- package/lib/vant.js +4402 -4197
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +2088 -2034
- package/package.json +7 -7
package/lib/picker/Picker.d.ts
CHANGED
@@ -2,7 +2,6 @@ import { type PropType, type ExtractPropTypes } from 'vue';
|
|
2
2
|
import { type Numeric } from '../utils';
|
3
3
|
import type { PickerColumn, PickerOption, PickerFieldNames, PickerToolbarPosition } from './types';
|
4
4
|
export declare const pickerSharedProps: {
|
5
|
-
title: StringConstructor;
|
6
5
|
loading: BooleanConstructor;
|
7
6
|
readonly: BooleanConstructor;
|
8
7
|
allowHtml: BooleanConstructor;
|
@@ -22,11 +21,12 @@ export declare const pickerSharedProps: {
|
|
22
21
|
type: (NumberConstructor | StringConstructor)[];
|
23
22
|
default: number;
|
24
23
|
};
|
24
|
+
} & {
|
25
|
+
title: StringConstructor;
|
25
26
|
cancelButtonText: StringConstructor;
|
26
27
|
confirmButtonText: StringConstructor;
|
27
28
|
};
|
28
29
|
declare const pickerProps: {
|
29
|
-
title: StringConstructor;
|
30
30
|
loading: BooleanConstructor;
|
31
31
|
readonly: BooleanConstructor;
|
32
32
|
allowHtml: BooleanConstructor;
|
@@ -46,6 +46,8 @@ declare const pickerProps: {
|
|
46
46
|
type: (NumberConstructor | StringConstructor)[];
|
47
47
|
default: number;
|
48
48
|
};
|
49
|
+
} & {
|
50
|
+
title: StringConstructor;
|
49
51
|
cancelButtonText: StringConstructor;
|
50
52
|
confirmButtonText: StringConstructor;
|
51
53
|
} & {
|
@@ -65,7 +67,6 @@ declare const pickerProps: {
|
|
65
67
|
};
|
66
68
|
export declare type PickerProps = ExtractPropTypes<typeof pickerProps>;
|
67
69
|
declare const _default: import("vue").DefineComponent<{
|
68
|
-
title: StringConstructor;
|
69
70
|
loading: BooleanConstructor;
|
70
71
|
readonly: BooleanConstructor;
|
71
72
|
allowHtml: BooleanConstructor;
|
@@ -85,6 +86,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
85
86
|
type: (NumberConstructor | StringConstructor)[];
|
86
87
|
default: number;
|
87
88
|
};
|
89
|
+
} & {
|
90
|
+
title: StringConstructor;
|
88
91
|
cancelButtonText: StringConstructor;
|
89
92
|
confirmButtonText: StringConstructor;
|
90
93
|
} & {
|
@@ -102,7 +105,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
102
105
|
};
|
103
106
|
columnsFieldNames: PropType<PickerFieldNames>;
|
104
107
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "cancel" | "clickOption" | "confirm")[], "update:modelValue" | "change" | "cancel" | "clickOption" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
105
|
-
title: StringConstructor;
|
106
108
|
loading: BooleanConstructor;
|
107
109
|
readonly: BooleanConstructor;
|
108
110
|
allowHtml: BooleanConstructor;
|
@@ -122,6 +124,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
122
124
|
type: (NumberConstructor | StringConstructor)[];
|
123
125
|
default: number;
|
124
126
|
};
|
127
|
+
} & {
|
128
|
+
title: StringConstructor;
|
125
129
|
cancelButtonText: StringConstructor;
|
126
130
|
confirmButtonText: StringConstructor;
|
127
131
|
} & {
|
package/lib/picker/Picker.js
CHANGED
@@ -16,7 +16,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
}
|
17
17
|
return to;
|
18
18
|
};
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
|
+
mod
|
22
|
+
));
|
20
23
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
21
24
|
var stdin_exports = {};
|
22
25
|
__export(stdin_exports, {
|
@@ -32,19 +35,17 @@ var import_use = require("@vant/use");
|
|
32
35
|
var import_use_expose = require("../composables/use-expose");
|
33
36
|
var import_loading = require("../loading");
|
34
37
|
var import_PickerColumn = __toESM(require("./PickerColumn"));
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
+
var import_PickerToolbar = __toESM(require("./PickerToolbar"));
|
39
|
+
var import_PickerGroup = require("../picker-group/PickerGroup");
|
40
|
+
const pickerSharedProps = (0, import_utils.extend)({
|
38
41
|
loading: Boolean,
|
39
42
|
readonly: Boolean,
|
40
43
|
allowHtml: Boolean,
|
41
44
|
optionHeight: (0, import_utils.makeNumericProp)(44),
|
42
45
|
showToolbar: import_utils.truthProp,
|
43
46
|
swipeDuration: (0, import_utils.makeNumericProp)(1e3),
|
44
|
-
visibleOptionNum: (0, import_utils.makeNumericProp)(6)
|
45
|
-
|
46
|
-
confirmButtonText: String
|
47
|
-
};
|
47
|
+
visibleOptionNum: (0, import_utils.makeNumericProp)(6)
|
48
|
+
}, import_PickerToolbar.pickerToolbarProps);
|
48
49
|
const pickerProps = (0, import_utils.extend)({}, pickerSharedProps, {
|
49
50
|
columns: (0, import_utils.makeArrayProp)(),
|
50
51
|
modelValue: (0, import_utils.makeArrayProp)(),
|
@@ -52,14 +53,18 @@ const pickerProps = (0, import_utils.extend)({}, pickerSharedProps, {
|
|
52
53
|
columnsFieldNames: Object
|
53
54
|
});
|
54
55
|
var stdin_default = (0, import_vue2.defineComponent)({
|
55
|
-
name,
|
56
|
+
name: import_utils2.name,
|
56
57
|
props: pickerProps,
|
57
58
|
emits: ["confirm", "cancel", "change", "clickOption", "update:modelValue"],
|
58
59
|
setup(props, {
|
59
60
|
emit,
|
60
61
|
slots
|
61
62
|
}) {
|
62
|
-
const
|
63
|
+
const columnsRef = (0, import_vue2.ref)();
|
64
|
+
const selectedValues = (0, import_vue2.ref)(props.modelValue.slice(0));
|
65
|
+
const {
|
66
|
+
parent
|
67
|
+
} = (0, import_use.useParent)(import_PickerGroup.PICKER_GROUP_KEY);
|
63
68
|
const {
|
64
69
|
children,
|
65
70
|
linkChildren
|
@@ -90,6 +95,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
90
95
|
selectedValues.value = newValues;
|
91
96
|
}
|
92
97
|
};
|
98
|
+
const getEventParams = () => ({
|
99
|
+
selectedValues: selectedValues.value.slice(0),
|
100
|
+
selectedOptions: selectedOptions.value
|
101
|
+
});
|
93
102
|
const onChange = (value, columnIndex) => {
|
94
103
|
setValue(columnIndex, value);
|
95
104
|
if (columnsType.value === "cascade") {
|
@@ -100,62 +109,21 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
100
109
|
}
|
101
110
|
});
|
102
111
|
}
|
103
|
-
emit("change", {
|
104
|
-
columnIndex
|
105
|
-
|
106
|
-
selectedOptions: selectedOptions.value
|
107
|
-
});
|
112
|
+
emit("change", (0, import_utils.extend)({
|
113
|
+
columnIndex
|
114
|
+
}, getEventParams()));
|
108
115
|
};
|
109
|
-
const onClickOption = (currentOption, columnIndex) => emit("clickOption", {
|
116
|
+
const onClickOption = (currentOption, columnIndex) => emit("clickOption", (0, import_utils.extend)({
|
110
117
|
columnIndex,
|
111
|
-
currentOption
|
112
|
-
|
113
|
-
selectedOptions: selectedOptions.value
|
114
|
-
});
|
118
|
+
currentOption
|
119
|
+
}, getEventParams()));
|
115
120
|
const confirm = () => {
|
116
121
|
children.forEach((child) => child.stopMomentum());
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
});
|
121
|
-
};
|
122
|
-
const cancel = () => emit("cancel", {
|
123
|
-
selectedValues: selectedValues.value,
|
124
|
-
selectedOptions: selectedOptions.value
|
125
|
-
});
|
126
|
-
const renderTitle = () => {
|
127
|
-
if (slots.title) {
|
128
|
-
return slots.title();
|
129
|
-
}
|
130
|
-
if (props.title) {
|
131
|
-
return (0, import_vue.createVNode)("div", {
|
132
|
-
"class": [bem("title"), "van-ellipsis"]
|
133
|
-
}, [props.title]);
|
134
|
-
}
|
135
|
-
};
|
136
|
-
const renderCancel = () => {
|
137
|
-
const text = props.cancelButtonText || t("cancel");
|
138
|
-
return (0, import_vue.createVNode)("button", {
|
139
|
-
"type": "button",
|
140
|
-
"class": [bem("cancel"), import_utils.HAPTICS_FEEDBACK],
|
141
|
-
"onClick": cancel
|
142
|
-
}, [slots.cancel ? slots.cancel() : text]);
|
143
|
-
};
|
144
|
-
const renderConfirm = () => {
|
145
|
-
const text = props.confirmButtonText || t("confirm");
|
146
|
-
return (0, import_vue.createVNode)("button", {
|
147
|
-
"type": "button",
|
148
|
-
"class": [bem("confirm"), import_utils.HAPTICS_FEEDBACK],
|
149
|
-
"onClick": confirm
|
150
|
-
}, [slots.confirm ? slots.confirm() : text]);
|
151
|
-
};
|
152
|
-
const renderToolbar = () => {
|
153
|
-
if (props.showToolbar) {
|
154
|
-
return (0, import_vue.createVNode)("div", {
|
155
|
-
"class": bem("toolbar")
|
156
|
-
}, [slots.toolbar ? slots.toolbar() : [renderCancel(), renderTitle(), renderConfirm()]]);
|
157
|
-
}
|
122
|
+
const params = getEventParams();
|
123
|
+
emit("confirm", params);
|
124
|
+
return params;
|
158
125
|
};
|
126
|
+
const cancel = () => emit("cancel", getEventParams());
|
159
127
|
const renderColumnItems = () => currentColumns.value.map((options, columnIndex) => (0, import_vue.createVNode)(import_PickerColumn.default, {
|
160
128
|
"value": selectedValues.value[columnIndex],
|
161
129
|
"fields": fields.value,
|
@@ -179,10 +147,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
179
147
|
backgroundSize: `100% ${(wrapHeight - optionHeight.value) / 2}px`
|
180
148
|
};
|
181
149
|
return [(0, import_vue.createVNode)("div", {
|
182
|
-
"class": bem("mask"),
|
150
|
+
"class": (0, import_utils2.bem)("mask"),
|
183
151
|
"style": maskStyle
|
184
152
|
}, null), (0, import_vue.createVNode)("div", {
|
185
|
-
"class": [import_utils.BORDER_UNSET_TOP_BOTTOM, bem("frame")],
|
153
|
+
"class": [import_utils.BORDER_UNSET_TOP_BOTTOM, (0, import_utils2.bem)("frame")],
|
186
154
|
"style": frameStyle
|
187
155
|
}, null)];
|
188
156
|
}
|
@@ -193,11 +161,19 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
193
161
|
height: `${wrapHeight}px`
|
194
162
|
};
|
195
163
|
return (0, import_vue.createVNode)("div", {
|
196
|
-
"
|
197
|
-
"
|
198
|
-
"
|
164
|
+
"ref": columnsRef,
|
165
|
+
"class": (0, import_utils2.bem)("columns"),
|
166
|
+
"style": columnsStyle
|
199
167
|
}, [renderColumnItems(), renderMask(wrapHeight)]);
|
200
168
|
};
|
169
|
+
const renderToolbar = () => {
|
170
|
+
if (props.showToolbar && !parent) {
|
171
|
+
return (0, import_vue.createVNode)(import_PickerToolbar.default, (0, import_vue.mergeProps)((0, import_utils.pick)(props, import_PickerToolbar.pickerToolbarPropKeys), {
|
172
|
+
"onConfirm": confirm,
|
173
|
+
"onCancel": cancel
|
174
|
+
}), (0, import_utils.pick)(slots, import_PickerToolbar.pickerToolbarSlots));
|
175
|
+
}
|
176
|
+
};
|
201
177
|
(0, import_vue2.watch)(currentColumns, (columns) => {
|
202
178
|
columns.forEach((options, index) => {
|
203
179
|
if (options.length && !(0, import_utils2.isOptionExist)(options, selectedValues.value[index], fields.value)) {
|
@@ -209,18 +185,21 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
209
185
|
});
|
210
186
|
(0, import_vue2.watch)(() => props.modelValue, (newValues) => {
|
211
187
|
if (!(0, import_utils.isSameValue)(newValues, selectedValues.value)) {
|
212
|
-
selectedValues.value = newValues;
|
188
|
+
selectedValues.value = newValues.slice(0);
|
213
189
|
}
|
214
190
|
}, {
|
215
191
|
deep: true
|
216
192
|
});
|
217
193
|
(0, import_vue2.watch)(selectedValues, (newValues) => {
|
218
194
|
if (!(0, import_utils.isSameValue)(newValues, props.modelValue)) {
|
219
|
-
emit("update:modelValue", newValues);
|
195
|
+
emit("update:modelValue", newValues.slice(0));
|
220
196
|
}
|
221
197
|
}, {
|
222
198
|
immediate: true
|
223
199
|
});
|
200
|
+
(0, import_use.useEventListener)("touchmove", import_utils.preventDefault, {
|
201
|
+
target: columnsRef
|
202
|
+
});
|
224
203
|
const getSelectedOptions = () => selectedOptions.value;
|
225
204
|
(0, import_use_expose.useExpose)({
|
226
205
|
confirm,
|
@@ -229,9 +208,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
229
208
|
return () => {
|
230
209
|
var _a, _b;
|
231
210
|
return (0, import_vue.createVNode)("div", {
|
232
|
-
"class": bem()
|
211
|
+
"class": (0, import_utils2.bem)()
|
233
212
|
}, [props.toolbarPosition === "top" ? renderToolbar() : null, props.loading ? (0, import_vue.createVNode)(import_loading.Loading, {
|
234
|
-
"class": bem("loading")
|
213
|
+
"class": (0, import_utils2.bem)("loading")
|
235
214
|
}, null) : null, (_a = slots["columns-top"]) == null ? void 0 : _a.call(slots), renderColumns(), (_b = slots["columns-bottom"]) == null ? void 0 : _b.call(slots), props.toolbarPosition === "bottom" ? renderToolbar() : null]);
|
236
215
|
};
|
237
216
|
}
|
@@ -55,6 +55,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
55
55
|
let touchStartTime;
|
56
56
|
let momentumOffset;
|
57
57
|
let transitionEndTrigger;
|
58
|
+
const root = (0, import_vue2.ref)();
|
58
59
|
const wrapper = (0, import_vue2.ref)();
|
59
60
|
const currentOffset = (0, import_vue2.ref)(0);
|
60
61
|
const currentDuration = (0, import_vue2.ref)(0);
|
@@ -188,10 +189,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
188
189
|
const offset = -enabledIndex * props.optionHeight;
|
189
190
|
currentOffset.value = offset;
|
190
191
|
});
|
192
|
+
(0, import_use.useEventListener)("touchmove", onTouchMove, {
|
193
|
+
target: root
|
194
|
+
});
|
191
195
|
return () => (0, import_vue.createVNode)("div", {
|
196
|
+
"ref": root,
|
192
197
|
"class": bem(),
|
193
198
|
"onTouchstartPassive": onTouchStart,
|
194
|
-
"onTouchmove": onTouchMove,
|
195
199
|
"onTouchend": onTouchEnd,
|
196
200
|
"onTouchcancel": onTouchEnd
|
197
201
|
}, [(0, import_vue.createVNode)("ul", {
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export declare const pickerToolbarProps: {
|
2
|
+
title: StringConstructor;
|
3
|
+
cancelButtonText: StringConstructor;
|
4
|
+
confirmButtonText: StringConstructor;
|
5
|
+
};
|
6
|
+
export declare const pickerToolbarSlots: string[];
|
7
|
+
export declare type PickerToolbarPropKeys = Array<keyof typeof pickerToolbarProps>;
|
8
|
+
export declare const pickerToolbarPropKeys: PickerToolbarPropKeys;
|
9
|
+
declare const _default: import("vue").DefineComponent<{
|
10
|
+
title: StringConstructor;
|
11
|
+
cancelButtonText: StringConstructor;
|
12
|
+
confirmButtonText: StringConstructor;
|
13
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "confirm")[], "cancel" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
14
|
+
title: StringConstructor;
|
15
|
+
cancelButtonText: StringConstructor;
|
16
|
+
confirmButtonText: StringConstructor;
|
17
|
+
}>> & {
|
18
|
+
onCancel?: ((...args: any[]) => any) | undefined;
|
19
|
+
onConfirm?: ((...args: any[]) => any) | undefined;
|
20
|
+
}, {}>;
|
21
|
+
export default _default;
|
@@ -0,0 +1,78 @@
|
|
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
|
+
pickerToolbarPropKeys: () => pickerToolbarPropKeys,
|
22
|
+
pickerToolbarProps: () => pickerToolbarProps,
|
23
|
+
pickerToolbarSlots: () => pickerToolbarSlots
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(stdin_exports);
|
26
|
+
var import_vue = require("vue");
|
27
|
+
var import_vue2 = require("vue");
|
28
|
+
var import_utils = require("./utils");
|
29
|
+
var import_utils2 = require("../utils");
|
30
|
+
const [name] = (0, import_utils2.createNamespace)("picker-toolbar");
|
31
|
+
const pickerToolbarProps = {
|
32
|
+
title: String,
|
33
|
+
cancelButtonText: String,
|
34
|
+
confirmButtonText: String
|
35
|
+
};
|
36
|
+
const pickerToolbarSlots = ["cancel", "confirm", "title", "toolbar"];
|
37
|
+
const pickerToolbarPropKeys = Object.keys(pickerToolbarProps);
|
38
|
+
var stdin_default = (0, import_vue2.defineComponent)({
|
39
|
+
name,
|
40
|
+
props: pickerToolbarProps,
|
41
|
+
emits: ["confirm", "cancel"],
|
42
|
+
setup(props, {
|
43
|
+
emit,
|
44
|
+
slots
|
45
|
+
}) {
|
46
|
+
const renderTitle = () => {
|
47
|
+
if (slots.title) {
|
48
|
+
return slots.title();
|
49
|
+
}
|
50
|
+
if (props.title) {
|
51
|
+
return (0, import_vue.createVNode)("div", {
|
52
|
+
"class": [(0, import_utils.bem)("title"), "van-ellipsis"]
|
53
|
+
}, [props.title]);
|
54
|
+
}
|
55
|
+
};
|
56
|
+
const onCancel = () => emit("cancel");
|
57
|
+
const onConfirm = () => emit("confirm");
|
58
|
+
const renderCancel = () => {
|
59
|
+
const text = props.cancelButtonText || (0, import_utils.t)("cancel");
|
60
|
+
return (0, import_vue.createVNode)("button", {
|
61
|
+
"type": "button",
|
62
|
+
"class": [(0, import_utils.bem)("cancel"), import_utils2.HAPTICS_FEEDBACK],
|
63
|
+
"onClick": onCancel
|
64
|
+
}, [slots.cancel ? slots.cancel() : text]);
|
65
|
+
};
|
66
|
+
const renderConfirm = () => {
|
67
|
+
const text = props.confirmButtonText || (0, import_utils.t)("confirm");
|
68
|
+
return (0, import_vue.createVNode)("button", {
|
69
|
+
"type": "button",
|
70
|
+
"class": [(0, import_utils.bem)("confirm"), import_utils2.HAPTICS_FEEDBACK],
|
71
|
+
"onClick": onConfirm
|
72
|
+
}, [slots.confirm ? slots.confirm() : text]);
|
73
|
+
};
|
74
|
+
return () => (0, import_vue.createVNode)("div", {
|
75
|
+
"class": (0, import_utils.bem)("toolbar")
|
76
|
+
}, [slots.toolbar ? slots.toolbar() : [renderCancel(), renderTitle(), renderConfirm()]]);
|
77
|
+
}
|
78
|
+
});
|
package/lib/picker/index.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import { PickerProps } from './Picker';
|
2
2
|
export declare const Picker: import("../utils").WithInstall<import("vue").DefineComponent<{
|
3
|
-
title: StringConstructor;
|
4
3
|
loading: BooleanConstructor;
|
5
4
|
readonly: BooleanConstructor;
|
6
5
|
allowHtml: BooleanConstructor;
|
@@ -20,6 +19,8 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
|
|
20
19
|
type: (NumberConstructor | StringConstructor)[];
|
21
20
|
default: number;
|
22
21
|
};
|
22
|
+
} & {
|
23
|
+
title: StringConstructor;
|
23
24
|
cancelButtonText: StringConstructor;
|
24
25
|
confirmButtonText: StringConstructor;
|
25
26
|
} & {
|
@@ -37,7 +38,6 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
|
|
37
38
|
};
|
38
39
|
columnsFieldNames: import("vue").PropType<import("./types").PickerFieldNames>;
|
39
40
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "cancel" | "clickOption" | "confirm")[], "update:modelValue" | "change" | "cancel" | "clickOption" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
40
|
-
title: StringConstructor;
|
41
41
|
loading: BooleanConstructor;
|
42
42
|
readonly: BooleanConstructor;
|
43
43
|
allowHtml: BooleanConstructor;
|
@@ -57,6 +57,8 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
|
|
57
57
|
type: (NumberConstructor | StringConstructor)[];
|
58
58
|
default: number;
|
59
59
|
};
|
60
|
+
} & {
|
61
|
+
title: StringConstructor;
|
60
62
|
cancelButtonText: StringConstructor;
|
61
63
|
confirmButtonText: StringConstructor;
|
62
64
|
} & {
|
package/lib/picker/index.js
CHANGED
@@ -16,7 +16,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
}
|
17
17
|
return to;
|
18
18
|
};
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
|
+
mod
|
22
|
+
));
|
20
23
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
21
24
|
var stdin_exports = {};
|
22
25
|
__export(stdin_exports, {
|
@@ -1,3 +1,10 @@
|
|
1
1
|
require("../../style/base.css");
|
2
|
+
require("../../badge/index.css");
|
2
3
|
require("../../loading/index.css");
|
4
|
+
require("../../sticky/index.css");
|
5
|
+
require("../../swipe/index.css");
|
6
|
+
require("../../swipe-item/index.css");
|
7
|
+
require("../../tabs/index.css");
|
8
|
+
require("../../tab/index.css");
|
9
|
+
require("../../picker-group/index.css");
|
3
10
|
require("../index.css");
|
package/lib/picker/utils.d.ts
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import { type Numeric } from '../utils';
|
2
2
|
import type { Ref } from 'vue';
|
3
3
|
import type { PickerOption, PickerColumn, PickerFieldNames } from './types';
|
4
|
+
declare const name: string, bem: (el?: import("../utils").Mods | undefined, mods?: import("../utils").Mods | undefined) => import("../utils").Mods, t: (path: string, ...args: unknown[]) => any;
|
5
|
+
export { name, bem, t };
|
4
6
|
export declare const getFirstEnabledOption: (options: PickerOption[]) => PickerOption | undefined;
|
5
7
|
export declare function getColumnsType(columns: PickerColumn | PickerColumn[], fields: Required<PickerFieldNames>): "default" | "multiple" | "cascade";
|
6
8
|
export declare function findIndexOfEnabledOption(options: PickerOption[], index: number): number;
|
package/lib/picker/utils.js
CHANGED
@@ -3,8 +3,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
5
|
var __export = (target, all) => {
|
6
|
-
for (var
|
7
|
-
__defProp(target,
|
6
|
+
for (var name2 in all)
|
7
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
8
8
|
};
|
9
9
|
var __copyProps = (to, from, except, desc) => {
|
10
10
|
if (from && typeof from === "object" || typeof from === "function") {
|
@@ -18,16 +18,20 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
18
18
|
var stdin_exports = {};
|
19
19
|
__export(stdin_exports, {
|
20
20
|
assignDefaultFields: () => assignDefaultFields,
|
21
|
+
bem: () => bem,
|
21
22
|
findIndexOfEnabledOption: () => findIndexOfEnabledOption,
|
22
23
|
findOptionByValue: () => findOptionByValue,
|
23
24
|
formatCascadeColumns: () => formatCascadeColumns,
|
24
25
|
getColumnsType: () => getColumnsType,
|
25
26
|
getElementTranslateY: () => getElementTranslateY,
|
26
27
|
getFirstEnabledOption: () => getFirstEnabledOption,
|
27
|
-
isOptionExist: () => isOptionExist
|
28
|
+
isOptionExist: () => isOptionExist,
|
29
|
+
name: () => name,
|
30
|
+
t: () => t
|
28
31
|
});
|
29
32
|
module.exports = __toCommonJS(stdin_exports);
|
30
33
|
var import_utils = require("../utils");
|
34
|
+
const [name, bem, t] = (0, import_utils.createNamespace)("picker");
|
31
35
|
const getFirstEnabledOption = (options) => options.find((option) => !option.disabled) || options[0];
|
32
36
|
function getColumnsType(columns, fields) {
|
33
37
|
const firstColumn = columns[0];
|
@@ -84,9 +88,12 @@ function getElementTranslateY(element) {
|
|
84
88
|
return Number(translateY);
|
85
89
|
}
|
86
90
|
function assignDefaultFields(fields) {
|
87
|
-
return (0, import_utils.extend)(
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
91
|
+
return (0, import_utils.extend)(
|
92
|
+
{
|
93
|
+
text: "text",
|
94
|
+
value: "value",
|
95
|
+
children: "children"
|
96
|
+
},
|
97
|
+
fields
|
98
|
+
);
|
92
99
|
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { type InjectionKey, type ExtractPropTypes } from 'vue';
|
2
|
+
export declare type PickerGroupProvide = Record<string, string>;
|
3
|
+
export declare const PICKER_GROUP_KEY: InjectionKey<PickerGroupProvide>;
|
4
|
+
export declare const pickerGroupProps: {
|
5
|
+
tabs: {
|
6
|
+
type: import("vue").PropType<string[]>;
|
7
|
+
default: () => never[];
|
8
|
+
};
|
9
|
+
} & {
|
10
|
+
title: StringConstructor;
|
11
|
+
cancelButtonText: StringConstructor;
|
12
|
+
confirmButtonText: StringConstructor;
|
13
|
+
};
|
14
|
+
export declare type PickerGroupProps = ExtractPropTypes<typeof pickerGroupProps>;
|
15
|
+
declare const _default: import("vue").DefineComponent<{
|
16
|
+
tabs: {
|
17
|
+
type: import("vue").PropType<string[]>;
|
18
|
+
default: () => never[];
|
19
|
+
};
|
20
|
+
} & {
|
21
|
+
title: StringConstructor;
|
22
|
+
cancelButtonText: StringConstructor;
|
23
|
+
confirmButtonText: StringConstructor;
|
24
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "confirm")[], "cancel" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
25
|
+
tabs: {
|
26
|
+
type: import("vue").PropType<string[]>;
|
27
|
+
default: () => never[];
|
28
|
+
};
|
29
|
+
} & {
|
30
|
+
title: StringConstructor;
|
31
|
+
cancelButtonText: StringConstructor;
|
32
|
+
confirmButtonText: StringConstructor;
|
33
|
+
}>> & {
|
34
|
+
onCancel?: ((...args: any[]) => any) | undefined;
|
35
|
+
onConfirm?: ((...args: any[]) => any) | undefined;
|
36
|
+
}, {
|
37
|
+
tabs: string[];
|
38
|
+
}>;
|
39
|
+
export default _default;
|
@@ -0,0 +1,82 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name2 in all)
|
9
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
21
|
+
mod
|
22
|
+
));
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
24
|
+
var stdin_exports = {};
|
25
|
+
__export(stdin_exports, {
|
26
|
+
PICKER_GROUP_KEY: () => PICKER_GROUP_KEY,
|
27
|
+
default: () => stdin_default,
|
28
|
+
pickerGroupProps: () => pickerGroupProps
|
29
|
+
});
|
30
|
+
module.exports = __toCommonJS(stdin_exports);
|
31
|
+
var import_vue = require("vue");
|
32
|
+
var import_vue2 = require("vue");
|
33
|
+
var import_utils = require("../utils");
|
34
|
+
var import_use = require("@vant/use");
|
35
|
+
var import_tab = require("../tab");
|
36
|
+
var import_tabs = require("../tabs");
|
37
|
+
var import_PickerToolbar = __toESM(require("../picker/PickerToolbar"));
|
38
|
+
const [name, bem] = (0, import_utils.createNamespace)("picker-group");
|
39
|
+
const PICKER_GROUP_KEY = Symbol(name);
|
40
|
+
const pickerGroupProps = (0, import_utils.extend)({
|
41
|
+
tabs: (0, import_utils.makeArrayProp)()
|
42
|
+
}, import_PickerToolbar.pickerToolbarProps);
|
43
|
+
var stdin_default = (0, import_vue2.defineComponent)({
|
44
|
+
name,
|
45
|
+
props: pickerGroupProps,
|
46
|
+
emits: ["confirm", "cancel"],
|
47
|
+
setup(props, {
|
48
|
+
emit,
|
49
|
+
slots
|
50
|
+
}) {
|
51
|
+
const {
|
52
|
+
children,
|
53
|
+
linkChildren
|
54
|
+
} = (0, import_use.useChildren)(PICKER_GROUP_KEY);
|
55
|
+
linkChildren();
|
56
|
+
const onConfirm = () => {
|
57
|
+
emit("confirm", children.map((item) => item.confirm()));
|
58
|
+
};
|
59
|
+
const onCancel = () => emit("cancel");
|
60
|
+
return () => {
|
61
|
+
var _a;
|
62
|
+
const childNodes = (_a = slots.default) == null ? void 0 : _a.call(slots);
|
63
|
+
return (0, import_vue.createVNode)("div", {
|
64
|
+
"class": bem()
|
65
|
+
}, [(0, import_vue.createVNode)(import_PickerToolbar.default, (0, import_vue.mergeProps)(props, {
|
66
|
+
"onConfirm": onConfirm,
|
67
|
+
"onCancel": onCancel
|
68
|
+
}), null), (0, import_vue.createVNode)(import_tabs.Tabs, {
|
69
|
+
"shrink": true,
|
70
|
+
"class": bem("tabs"),
|
71
|
+
"animated": true
|
72
|
+
}, {
|
73
|
+
default: () => [props.tabs.map((title, index) => (0, import_vue.createVNode)(import_tab.Tab, {
|
74
|
+
"title": title,
|
75
|
+
"titleClass": bem("tab-title")
|
76
|
+
}, {
|
77
|
+
default: () => [childNodes == null ? void 0 : childNodes[index]]
|
78
|
+
}))]
|
79
|
+
})]);
|
80
|
+
};
|
81
|
+
}
|
82
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
body{--van-picker-group-background: var(--van-background-2)}.van-picker-group{background:var(--van-picker-group-background)}.van-picker-group__tabs{margin-top:var(--van-padding-base)}.van-picker-group__tab-title{margin-right:16px}
|