zartui 3.1.11 → 3.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -23
- 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/composables/use-touch.d.ts +1 -0
- package/es/composables/use-touch.mjs +8 -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 +1 -1
- package/es/dropdown-item/index.d.ts +1 -1
- package/es/dropdown-item/style/index.mjs +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/FloatingBubble.d.ts +81 -0
- package/es/floating-bubble/FloatingBubble.mjs +181 -0
- package/es/floating-bubble/index.css +1 -0
- package/es/floating-bubble/index.d.ts +63 -0
- package/es/floating-bubble/index.mjs +10 -0
- package/es/floating-bubble/style/index.d.ts +1 -0
- package/es/floating-bubble/style/index.mjs +4 -0
- package/es/floating-bubble/types.d.ts +20 -0
- package/es/floating-bubble/types.mjs +0 -0
- package/es/hierarchy-select/index.css +1 -1
- package/es/image/index.css +1 -1
- package/es/image-preview/index.css +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/index.css +1 -1
- package/es/media-picker/watermark/image-processor.mjs +2 -2
- package/es/media-player/index.css +1 -1
- package/es/multiple-picker/index.css +1 -1
- 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 +1 -1
- package/es/picker/index.css +1 -1
- package/es/picker/index.d.ts +1 -1
- package/es/popover/index.css +1 -1
- 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 +1 -1
- package/es/radio-picker/index.css +1 -1
- package/es/radio-picker/index.d.ts +1 -1
- package/es/radio-picker/style/index.mjs +3 -3
- 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/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/closest.d.ts +1 -0
- package/es/utils/closest.mjs +8 -0
- package/es/utils/constant.d.ts +1 -1
- package/es/utils/constant.mjs +3 -3
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.mjs +1 -0
- 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/composables/use-touch.d.ts +1 -0
- package/lib/composables/use-touch.js +8 -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 +1 -1
- package/lib/dropdown-item/index.d.ts +1 -1
- package/lib/dropdown-item/style/index.js +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/FloatingBubble.d.ts +81 -0
- package/lib/floating-bubble/FloatingBubble.js +210 -0
- package/lib/floating-bubble/index.css +1 -0
- package/lib/floating-bubble/index.d.ts +63 -0
- package/lib/floating-bubble/index.js +39 -0
- package/lib/floating-bubble/style/index.d.ts +1 -0
- package/lib/floating-bubble/style/index.js +4 -0
- package/lib/floating-bubble/types.d.ts +20 -0
- package/lib/floating-bubble/types.js +15 -0
- package/lib/hierarchy-select/index.css +1 -1
- package/lib/image/index.css +1 -1
- package/lib/image-preview/index.css +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/index.css +1 -1
- package/lib/media-picker/watermark/image-processor.js +1 -1
- package/lib/media-player/index.css +1 -1
- package/lib/multiple-picker/index.css +1 -1
- 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 +1 -1
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.d.ts +1 -1
- package/lib/popover/index.css +1 -1
- 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 +1 -1
- package/lib/radio-picker/index.css +1 -1
- package/lib/radio-picker/index.d.ts +1 -1
- package/lib/radio-picker/style/index.js +3 -3
- 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/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/closest.d.ts +1 -0
- package/lib/utils/closest.js +27 -0
- package/lib/utils/constant.d.ts +1 -1
- package/lib/utils/constant.js +3 -3
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- 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 +3897 -3275
- package/lib/zartui.es.js +3898 -3276
- package/lib/zartui.js +3886 -3264
- package/lib/zartui.min.js +1 -1
- package/package.json +9 -8
|
@@ -99,7 +99,7 @@ export declare const DateTimePicker: import("../utils").WithInstall<import("vue"
|
|
|
99
99
|
type: import("vue").PropType<string[]>;
|
|
100
100
|
default: () => string[];
|
|
101
101
|
};
|
|
102
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
102
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "update:show" | "confirm" | "startChange" | "endChange" | "update:startValue" | "update:endValue")[], "update:modelValue" | "cancel" | "change" | "update:show" | "confirm" | "startChange" | "endChange" | "update:startValue" | "update:endValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
103
103
|
loading: BooleanConstructor;
|
|
104
104
|
readonly: BooleanConstructor;
|
|
105
105
|
allowHtml: BooleanConstructor;
|
package/lib/dialog/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-dialog-width: 350px;--zt-dialog-max-width: 90%;--zt-dialog-transition: var(--zt-duration-base);--zt-dialog-radius: 12px;--zt-dialog-background: var(--zt-background-
|
|
1
|
+
:root{--zt-dialog-width: 350px;--zt-dialog-max-width: 90%;--zt-dialog-transition: var(--zt-duration-base);--zt-dialog-radius: 12px;--zt-dialog-background: var(--zt-background-popup);--zt-dialog-header-font-weight: var(--zt-font-bold);--zt-dialog-header-padding-top: 24px;--zt-dialog-header-isolated-padding: var(--zt-padding-lg) 0;--zt-dialog-header-primary-padding: 10px;--zt-dialog-message-padding: var(--zt-padding-lg) var(--zt-padding-md);--zt-dialog-message-max-height: 60vh;--zt-dialog-has-title-message-text-color: var(--zt-gray-a6);--zt-dialog-has-title-message-padding-top: var(--zt-padding-xs);--zt-dialog-has-title-message-primary-header: var(--zt-padding-lg);--zt-dialog-confirm-button-text-color: var(--zt-white);--zt-dialog-cancel-button-background-color: var(--zt-white)}.zt-dialog{top:45%;width:var(--zt-dialog-width);max-width:var(--zt-dialog-max-width);overflow:hidden;font-size:var(--zt-font-size-lg);background:var(--zt-dialog-background);border-radius:var(--zt-dialog-radius);-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:var(--zt-dialog-transition);transition-property:transform,opacity}.zt-dialog__header{color:var(--zt-text-color);padding-top:var(--zt-dialog-header-padding-top);font-weight:var(--zt-dialog-header-font-weight);line-height:var(--zt-line-height-lg);text-align:center}.zt-dialog__header--isolated{padding:var(--zt-dialog-header-isolated-padding)}.zt-dialog__header--custom-title{padding-left:0;padding-right:0;padding-top:0}.zt-dialog__header--primary{padding:var(--zt-dialog-header-primary-padding);background:var(--zt-primary-color);color:var(--zt-white)}.zt-dialog__content{text-align:center;font-size:0}.zt-dialog__message{display:inline-block;color:var(--zt-gray-a8);max-height:var(--zt-dialog-message-max-height);padding:var(--zt-dialog-message-padding);overflow-y:auto;font-size:var(--zt-font-size-lg);line-height:var(--zt-line-height-md);white-space:pre-wrap;text-align:left;word-wrap:break-word;-webkit-overflow-scrolling:touch}.zt-dialog__message--has-title{padding-top:var(--zt-dialog-has-title-message-padding-top);color:var(--zt-dialog-has-title-message-text-color);font-size:var(--zt-font-size-md)}.zt-dialog__message--primary-header{padding-top:var(--zt-dialog-has-title-message-primary-header)}.zt-dialog__message--left{text-align:left}.zt-dialog__message--right{text-align:right}.zt-dialog__message--justify{text-align:justify}.zt-dialog__footer{display:flex;overflow:hidden;-webkit-user-select:none;user-select:none;margin:0 var(--zt-padding-xl) var(--zt-padding-lg)}.zt-dialog__confirm,.zt-dialog__cancel{flex:1;margin:0;background-color:var(--zt-dialog-cancel-button-background-color)}.zt-dialog__confirm,.zt-dialog__confirm:active{color:var(--zt-dialog-confirm-button-text-color)}.zt-dialog__confirm--with-cancel{margin-left:8px}.zt-dialog--round-button .zt-dialog__footer{position:relative;height:auto;padding:var(--zt-padding-xs) var(--zt-padding-lg) var(--zt-padding-md)}.zt-dialog--round-button .zt-dialog__message{padding-bottom:var(--zt-padding-md);color:var(--zt-text-color)}.zt-dialog--round-button .zt-dialog__confirm,.zt-dialog--round-button .zt-dialog__cancel{height:var(--zt-dialog-round-button-height)}.zt-dialog--round-button .zt-dialog__confirm{color:var(--zt-white)}.zt-dialog-bounce-enter-from{transform:translate3d(-50%,-50%,0) scale(.7);opacity:0}.zt-dialog-bounce-leave-active{transform:translate3d(-50%,-50%,0) scale(.9);opacity:0}.zt-theme-dark{--zt-dialog-cancel-button-background-color: rbga(255, 255, 255, .2)}
|
package/lib/divider/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-divider-margin: var(--zt-padding-md) 0;--zt-divider-text-color: var(--zt-gray-a4);--zt-divider-border-color: var(--zt-border-color);--zt-divider-content-padding: var(--zt-padding-md);--zt-divider-content-left-width: 10%;--zt-divider-content-right-width: 10%}.zt-divider{display:flex;align-items:center;margin:var(--zt-divider-margin);color:var(--zt-divider-text-color);font-size:var(--zt-font-size-md);line-height:var(--zt-line-height-
|
|
1
|
+
:root{--zt-divider-margin: var(--zt-padding-md) 0;--zt-divider-text-color: var(--zt-gray-a4);--zt-divider-border-color: var(--zt-border-color);--zt-divider-content-padding: var(--zt-padding-md);--zt-divider-content-left-width: 10%;--zt-divider-content-right-width: 10%}.zt-divider{display:flex;align-items:center;margin:var(--zt-divider-margin);color:var(--zt-divider-text-color);font-size:var(--zt-font-size-md);line-height:var(--zt-line-height-md);border-color:var(--zt-divider-border-color);border-style:solid;border-width:0}.zt-divider:before,.zt-divider:after{display:block;flex:1;box-sizing:border-box;height:1px;border-color:inherit;border-style:inherit;border-width:var(--zt-border-width) 0 0}.zt-divider:before{content:""}.zt-divider--hairline:before,.zt-divider--hairline:after{transform:scaleY(.5)}.zt-divider--dashed{border-style:dashed}.zt-divider--content-center:before,.zt-divider--content-left:before,.zt-divider--content-right:before{margin-right:var(--zt-divider-content-padding)}.zt-divider--content-center:after,.zt-divider--content-left:after,.zt-divider--content-right:after{margin-left:var(--zt-divider-content-padding);content:""}.zt-divider--content-left:before{max-width:var(--zt-divider-content-left-width)}.zt-divider--content-right:after{max-width:var(--zt-divider-content-right-width)}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { DrawerSelectFieldNames, DrawerSelectTreeNode } from './types';
|
|
3
|
+
declare const drawerSelectProps: {
|
|
4
|
+
treeData: {
|
|
5
|
+
type: PropType<DrawerSelectTreeNode[]>;
|
|
6
|
+
default: () => DrawerSelectTreeNode[];
|
|
7
|
+
};
|
|
8
|
+
treeFieldName: PropType<DrawerSelectFieldNames>;
|
|
9
|
+
title: {
|
|
10
|
+
type: PropType<string>;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
placeholder: {
|
|
14
|
+
type: PropType<string>;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
expandAll: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type DrawerSelectProps = ExtractPropTypes<typeof drawerSelectProps>;
|
|
23
|
+
declare const _default: import("vue").DefineComponent<{
|
|
24
|
+
treeData: {
|
|
25
|
+
type: PropType<DrawerSelectTreeNode[]>;
|
|
26
|
+
default: () => DrawerSelectTreeNode[];
|
|
27
|
+
};
|
|
28
|
+
treeFieldName: PropType<DrawerSelectFieldNames>;
|
|
29
|
+
title: {
|
|
30
|
+
type: PropType<string>;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
placeholder: {
|
|
34
|
+
type: PropType<string>;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
expandAll: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
41
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change")[], "select" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
42
|
+
treeData: {
|
|
43
|
+
type: PropType<DrawerSelectTreeNode[]>;
|
|
44
|
+
default: () => DrawerSelectTreeNode[];
|
|
45
|
+
};
|
|
46
|
+
treeFieldName: PropType<DrawerSelectFieldNames>;
|
|
47
|
+
title: {
|
|
48
|
+
type: PropType<string>;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
placeholder: {
|
|
52
|
+
type: PropType<string>;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
expandAll: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
default: boolean;
|
|
58
|
+
};
|
|
59
|
+
}>> & {
|
|
60
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
61
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
title: string;
|
|
64
|
+
placeholder: string;
|
|
65
|
+
treeData: DrawerSelectTreeNode[];
|
|
66
|
+
expandAll: boolean;
|
|
67
|
+
}, {}>;
|
|
68
|
+
export default _default;
|
|
@@ -0,0 +1,389 @@
|
|
|
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
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var stdin_exports = {};
|
|
29
|
+
__export(stdin_exports, {
|
|
30
|
+
default: () => stdin_default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
33
|
+
var import_vue = require("vue");
|
|
34
|
+
var import_vue2 = require("vue");
|
|
35
|
+
var import_use = require("@zartui/use");
|
|
36
|
+
var import_utils = require("../utils");
|
|
37
|
+
var import_search = __toESM(require("../search"));
|
|
38
|
+
var import_icon = __toESM(require("../icon"));
|
|
39
|
+
var import_popup = __toESM(require("../popup"));
|
|
40
|
+
var import_tag = __toESM(require("../tag"));
|
|
41
|
+
var import_deep_clone = require("../utils/deep-clone");
|
|
42
|
+
var import_utils2 = require("../picker/utils");
|
|
43
|
+
var import_dialog = require("../dialog");
|
|
44
|
+
const [name, bem] = (0, import_utils.createNamespace)("drawer-select");
|
|
45
|
+
const drawerSelectProps = {
|
|
46
|
+
treeData: (0, import_utils.makeArrayProp)(),
|
|
47
|
+
treeFieldName: Object,
|
|
48
|
+
title: (0, import_utils.makeStringProp)("\u9009\u62E9\u7C7B\u578B"),
|
|
49
|
+
placeholder: (0, import_utils.makeStringProp)("\u8BF7\u641C\u7D22\u95EE\u9898\u7C7B\u578B"),
|
|
50
|
+
expandAll: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var stdin_default = (0, import_vue2.defineComponent)({
|
|
56
|
+
name,
|
|
57
|
+
props: drawerSelectProps,
|
|
58
|
+
emits: ["change", "select"],
|
|
59
|
+
setup(props, {
|
|
60
|
+
emit
|
|
61
|
+
}) {
|
|
62
|
+
const keyword = (0, import_vue2.ref)("");
|
|
63
|
+
const expandNode = (0, import_vue2.ref)();
|
|
64
|
+
const selectNode = (0, import_vue2.ref)();
|
|
65
|
+
const flatArray = (0, import_vue2.ref)([]);
|
|
66
|
+
const show = (0, import_vue2.ref)(false);
|
|
67
|
+
const searchRef = (0, import_vue2.ref)();
|
|
68
|
+
const offset = (0, import_vue2.ref)(0);
|
|
69
|
+
const historyList = (0, import_vue2.ref)([]);
|
|
70
|
+
const defaultTreeNode = (0, import_vue2.ref)(props.treeData);
|
|
71
|
+
const fields = (0, import_vue2.computed)(() => (0, import_utils2.assignDefaultFields)(props.treeFieldName));
|
|
72
|
+
const {
|
|
73
|
+
value,
|
|
74
|
+
children,
|
|
75
|
+
text: key
|
|
76
|
+
} = fields.value;
|
|
77
|
+
const allData = {
|
|
78
|
+
[value]: -1,
|
|
79
|
+
[key]: "\u5168\u90E8",
|
|
80
|
+
[children]: props.treeData
|
|
81
|
+
};
|
|
82
|
+
const clearSearch = () => {
|
|
83
|
+
keyword.value = "";
|
|
84
|
+
show.value = false;
|
|
85
|
+
};
|
|
86
|
+
const onScroll = () => {
|
|
87
|
+
if (show.value) {
|
|
88
|
+
updateOffset();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
(0, import_use.useEventListener)("scroll", onScroll, {
|
|
92
|
+
target: searchRef,
|
|
93
|
+
passive: true
|
|
94
|
+
});
|
|
95
|
+
const updateOffset = () => {
|
|
96
|
+
if (searchRef.value) {
|
|
97
|
+
const rect = (0, import_use.useRect)(searchRef);
|
|
98
|
+
offset.value = rect.bottom;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const flatData = (data) => {
|
|
102
|
+
const result = [];
|
|
103
|
+
const getNext = (list) => {
|
|
104
|
+
for (const v of list) {
|
|
105
|
+
const current = {
|
|
106
|
+
[key]: v[key],
|
|
107
|
+
[value]: v[value]
|
|
108
|
+
};
|
|
109
|
+
if (props.expandAll) {
|
|
110
|
+
v.checked = true;
|
|
111
|
+
v.expand = true;
|
|
112
|
+
}
|
|
113
|
+
if (v[children] && v[children].length > 0) {
|
|
114
|
+
if (v && v.parent) {
|
|
115
|
+
v[children].forEach((item) => {
|
|
116
|
+
var _a;
|
|
117
|
+
item.parent = (0, import_deep_clone.deepClone)(v.parent);
|
|
118
|
+
(_a = item.parent) == null ? void 0 : _a.push(current);
|
|
119
|
+
});
|
|
120
|
+
} else {
|
|
121
|
+
v[children].forEach((item) => {
|
|
122
|
+
item.parent = [current];
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
getNext(v[children]);
|
|
126
|
+
} else {
|
|
127
|
+
if (v && v.parent) {
|
|
128
|
+
v.parent.push(current);
|
|
129
|
+
} else {
|
|
130
|
+
v.parent = [current];
|
|
131
|
+
}
|
|
132
|
+
const fullName = v.parent.map((item) => item[key]).join(" \xB7 ");
|
|
133
|
+
result.push(Object.assign(v, {
|
|
134
|
+
fullName,
|
|
135
|
+
parent: v.parent
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
getNext(data);
|
|
141
|
+
flatArray.value = result;
|
|
142
|
+
};
|
|
143
|
+
(0, import_vue2.onMounted)(() => {
|
|
144
|
+
var _a;
|
|
145
|
+
historyList.value = JSON.parse((_a = localStorage.getItem("problemSearchHistory")) != null ? _a : "[]") || [];
|
|
146
|
+
expandNode.value = {
|
|
147
|
+
text: allData[key],
|
|
148
|
+
value: allData[value],
|
|
149
|
+
children: allData[children]
|
|
150
|
+
};
|
|
151
|
+
flatData(props.treeData);
|
|
152
|
+
updateOffset();
|
|
153
|
+
});
|
|
154
|
+
const isEmpty = (item) => !item[children] || item[children].length === 0;
|
|
155
|
+
const onLabelClick = (item, assign = true) => {
|
|
156
|
+
const {
|
|
157
|
+
text,
|
|
158
|
+
value: value2,
|
|
159
|
+
children: children2
|
|
160
|
+
} = fields.value;
|
|
161
|
+
if (item) {
|
|
162
|
+
if (assign) {
|
|
163
|
+
expandNode.value = {
|
|
164
|
+
text: item[text],
|
|
165
|
+
value: item[value2],
|
|
166
|
+
children: item[children2]
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
if (isEmpty(item)) {
|
|
170
|
+
selectNode.value = item;
|
|
171
|
+
emit("select", item);
|
|
172
|
+
}
|
|
173
|
+
item.checked = !item.checked;
|
|
174
|
+
emit("change", item);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const isStrValid = (text) => {
|
|
178
|
+
return text !== null && text !== "" && Object.prototype.toString.call(text) === "[object String]";
|
|
179
|
+
};
|
|
180
|
+
const onSearch = (value2) => {
|
|
181
|
+
if (isStrValid(value2)) {
|
|
182
|
+
show.value = true;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
const onClickInput = (e) => {
|
|
186
|
+
const {
|
|
187
|
+
value: value2
|
|
188
|
+
} = e.target;
|
|
189
|
+
onSearch(value2);
|
|
190
|
+
};
|
|
191
|
+
const formatSearchKeyword = (keywords, text = "") => {
|
|
192
|
+
if (!keywords)
|
|
193
|
+
return text;
|
|
194
|
+
const replaceReg = new RegExp(keywords, "ig");
|
|
195
|
+
const replaceString = `<span style="color: #0091FA; background: rgba(0, 145, 250, 0.1); font-weight: bold;">${keywords}</span>`;
|
|
196
|
+
return text.replace(replaceReg, replaceString);
|
|
197
|
+
};
|
|
198
|
+
const filterTree = (0, import_vue2.computed)(() => {
|
|
199
|
+
if (keyword.value) {
|
|
200
|
+
return flatArray.value.filter((item) => {
|
|
201
|
+
return (item.fullName || "").indexOf(keyword.value) > -1;
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return [];
|
|
205
|
+
});
|
|
206
|
+
const onSearchClick = (item) => {
|
|
207
|
+
var _a;
|
|
208
|
+
if (item) {
|
|
209
|
+
const {
|
|
210
|
+
text
|
|
211
|
+
} = fields.value;
|
|
212
|
+
show.value = false;
|
|
213
|
+
keyword.value = item[text];
|
|
214
|
+
let history = JSON.parse((_a = localStorage.getItem("problemSearchHistory")) != null ? _a : "[]") || [];
|
|
215
|
+
if (history.includes(keyword.value)) {
|
|
216
|
+
history.map((v, i) => {
|
|
217
|
+
if (v === keyword.value) {
|
|
218
|
+
history.splice(i, 1);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
history.unshift(keyword.value);
|
|
223
|
+
if (history.length > 10) {
|
|
224
|
+
history = history.slice(0, 10);
|
|
225
|
+
}
|
|
226
|
+
historyList.value = history;
|
|
227
|
+
localStorage.setItem("problemSearchHistory", JSON.stringify(history));
|
|
228
|
+
emit("select", Object.assign(item, {
|
|
229
|
+
parent: item.parent
|
|
230
|
+
}));
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
const renderSecondTree = (item) => {
|
|
234
|
+
var _a, _b;
|
|
235
|
+
const text = item[fields.value.text];
|
|
236
|
+
const children2 = (_a = item[fields.value.children]) != null ? _a : [];
|
|
237
|
+
return (0, import_vue.createVNode)("div", null, [(0, import_vue.createVNode)("div", {
|
|
238
|
+
"class": [bem("label")],
|
|
239
|
+
"onClick": () => item.expand = !item.expand
|
|
240
|
+
}, [(0, import_vue.createVNode)("span", {
|
|
241
|
+
"class": [bem("label--placeholder")]
|
|
242
|
+
}, [children2.length > 0 && (0, import_vue.createVNode)(import_icon.default, {
|
|
243
|
+
"name": "play-small",
|
|
244
|
+
"class": [bem("label--icon", {
|
|
245
|
+
active: item.expand
|
|
246
|
+
})],
|
|
247
|
+
"size": "20"
|
|
248
|
+
}, null)]), (0, import_vue.createVNode)("span", {
|
|
249
|
+
"class": [bem("label--text")]
|
|
250
|
+
}, [text])]), !isEmpty(item) && item.expand && ((_b = item.children) == null ? void 0 : _b.map((child) => {
|
|
251
|
+
var _a2;
|
|
252
|
+
return (0, import_vue.createVNode)("div", {
|
|
253
|
+
"class": [bem("label", "second"), bem("label", {
|
|
254
|
+
active: ((_a2 = expandNode.value) == null ? void 0 : _a2.value) === child[value]
|
|
255
|
+
})],
|
|
256
|
+
"onClick": () => onLabelClick(child)
|
|
257
|
+
}, [child[fields.value.text]]);
|
|
258
|
+
}))]);
|
|
259
|
+
};
|
|
260
|
+
const renderItem = (item) => {
|
|
261
|
+
var _a, _b;
|
|
262
|
+
const empty = isEmpty(item);
|
|
263
|
+
return (0, import_vue.createVNode)("div", {
|
|
264
|
+
"onClick": (e) => {
|
|
265
|
+
e.stopPropagation();
|
|
266
|
+
onLabelClick(item, false);
|
|
267
|
+
},
|
|
268
|
+
"class": [bem("item")]
|
|
269
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
270
|
+
"class": [bem("item--header")]
|
|
271
|
+
}, [(0, import_vue.createVNode)("span", {
|
|
272
|
+
"class": [bem("item--placeholder")]
|
|
273
|
+
}, [!empty && (0, import_vue.createVNode)(import_icon.default, {
|
|
274
|
+
"name": "play-small",
|
|
275
|
+
"class": [bem("item--icon", {
|
|
276
|
+
active: item.checked
|
|
277
|
+
})],
|
|
278
|
+
"size": "20"
|
|
279
|
+
}, null)]), (0, import_vue.createVNode)("div", {
|
|
280
|
+
"class": [bem("item--label", {
|
|
281
|
+
active: empty && ((_a = selectNode.value) == null ? void 0 : _a.value) == item[fields.value.value]
|
|
282
|
+
}), "zt-hairline--top"]
|
|
283
|
+
}, [item[fields.value.text]])]), (0, import_vue.createVNode)("div", {
|
|
284
|
+
"class": [bem("item--child")]
|
|
285
|
+
}, [!empty && item.checked && ((_b = item[fields.value.children]) == null ? void 0 : _b.map(renderItem))])]);
|
|
286
|
+
};
|
|
287
|
+
const onClearHistory = () => {
|
|
288
|
+
(0, import_dialog.showConfirmDialog)({
|
|
289
|
+
title: "\u786E\u8BA4\u5220\u9664\u5168\u90E8\u641C\u7D22\u5386\u53F2",
|
|
290
|
+
message: "\u70B9\u51FB\u201C\u5220\u9664\u201D\u5C06\u6E05\u7A7A\u5168\u90E8\u7684\u641C\u7D22\u8BB0\u5F55",
|
|
291
|
+
confirmButtonText: "\u5220\u9664",
|
|
292
|
+
teleport: ".zt-drawer-select"
|
|
293
|
+
}).then(() => {
|
|
294
|
+
historyList.value = [];
|
|
295
|
+
show.value = false;
|
|
296
|
+
localStorage.removeItem("problemSearchHistory");
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
const onHistoryClick = (itme) => {
|
|
300
|
+
keyword.value = itme;
|
|
301
|
+
};
|
|
302
|
+
return () => {
|
|
303
|
+
var _a, _b, _c, _d, _e;
|
|
304
|
+
return (0, import_vue.createVNode)("div", {
|
|
305
|
+
"class": [bem()]
|
|
306
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
307
|
+
"class": [bem("search")],
|
|
308
|
+
"ref": searchRef
|
|
309
|
+
}, [(0, import_vue.createVNode)(import_search.default, {
|
|
310
|
+
"modelValue": keyword.value,
|
|
311
|
+
"onUpdate:modelValue": [($event) => keyword.value = $event, onSearch],
|
|
312
|
+
"placeholder": props.placeholder,
|
|
313
|
+
"onClickInput": onClickInput,
|
|
314
|
+
"onSearch": onSearch,
|
|
315
|
+
"onClear": clearSearch,
|
|
316
|
+
"onFocus": () => show.value = true,
|
|
317
|
+
"autocomplete": "off"
|
|
318
|
+
}, null), (0, import_vue.withDirectives)((0, import_vue.createVNode)("div", {
|
|
319
|
+
"class": [bem("wrap")],
|
|
320
|
+
"style": {
|
|
321
|
+
top: `${offset.value}px`
|
|
322
|
+
}
|
|
323
|
+
}, [(0, import_vue.createVNode)(import_popup.default, {
|
|
324
|
+
"class": [bem("popup")],
|
|
325
|
+
"position": "top",
|
|
326
|
+
"show": show.value,
|
|
327
|
+
"onUpdate:show": ($event) => show.value = $event,
|
|
328
|
+
"overlayStyle": {
|
|
329
|
+
position: "absolute"
|
|
330
|
+
}
|
|
331
|
+
}, {
|
|
332
|
+
default: () => [keyword.value ? (0, import_vue.createVNode)(import_vue.Fragment, null, [filterTree.value.length > 0 ? filterTree.value.map((item) => (0, import_vue.createVNode)("div", {
|
|
333
|
+
"class": [bem("search--item"), "zt-hairline--bottom"],
|
|
334
|
+
"onClick": () => onSearchClick(item)
|
|
335
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
336
|
+
"class": [bem("search--header")],
|
|
337
|
+
"innerHTML": formatSearchKeyword(keyword.value, item[key])
|
|
338
|
+
}, null), (0, import_vue.createVNode)("div", {
|
|
339
|
+
"class": [bem("search--name")],
|
|
340
|
+
"innerHTML": formatSearchKeyword(keyword.value, item == null ? void 0 : item.fullName)
|
|
341
|
+
}, null)])) : (0, import_vue.createVNode)("div", {
|
|
342
|
+
"class": [bem("empty")]
|
|
343
|
+
}, [(0, import_vue.createTextVNode)("\u6CA1\u6709\u76F8\u5173\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\u5173\u952E\u5B57")]), " "]) : (0, import_vue.createVNode)("section", {
|
|
344
|
+
"class": [bem("history")]
|
|
345
|
+
}, [historyList.value.length > 0 && (0, import_vue.createVNode)("div", null, [(0, import_vue.createVNode)("p", {
|
|
346
|
+
"class": [bem("history--title"), "zt-hairline--bottom"]
|
|
347
|
+
}, [(0, import_vue.createTextVNode)("\u641C\u7D22\u5386\u53F2")]), (0, import_vue.createVNode)("div", {
|
|
348
|
+
"class": [bem("history--content")]
|
|
349
|
+
}, [historyList.value.map((item) => (0, import_vue.createVNode)(import_tag.default, {
|
|
350
|
+
"onClick": () => onHistoryClick(item),
|
|
351
|
+
"round": true,
|
|
352
|
+
"text-color": "var(--zt-gray-a8)",
|
|
353
|
+
"icon-color": "var(--zt-gray)"
|
|
354
|
+
}, {
|
|
355
|
+
default: () => [item]
|
|
356
|
+
}))]), (0, import_vue.createVNode)("div", {
|
|
357
|
+
"class": [bem("history--clear")],
|
|
358
|
+
"onClick": onClearHistory
|
|
359
|
+
}, [(0, import_vue.createVNode)(import_icon.default, {
|
|
360
|
+
"name": "delete",
|
|
361
|
+
"size": "20"
|
|
362
|
+
}, null), (0, import_vue.createTextVNode)("\u6E05\u7A7A\u641C\u7D22\u5386\u53F2")])]), historyList.value.length === 0 && (0, import_vue.createVNode)("div", {
|
|
363
|
+
"class": [bem("empty")]
|
|
364
|
+
}, [(0, import_vue.createTextVNode)("\u6682\u65E0\u641C\u7D22\u8BB0\u5F55")])])]
|
|
365
|
+
})]), [[import_vue.vShow, show.value]])]), (0, import_vue.createVNode)("div", {
|
|
366
|
+
"class": [bem("name"), "zt-hairline--bottom"]
|
|
367
|
+
}, [props.title]), (0, import_vue.createVNode)("main", {
|
|
368
|
+
"class": [bem("tree")]
|
|
369
|
+
}, [(0, import_vue.createVNode)("nav", {
|
|
370
|
+
"class": [bem("tree-left")]
|
|
371
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
372
|
+
"class": [bem("label", {
|
|
373
|
+
active: ((_a = expandNode.value) == null ? void 0 : _a.value) === allData[value]
|
|
374
|
+
})],
|
|
375
|
+
"onClick": () => onLabelClick(allData)
|
|
376
|
+
}, [(0, import_vue.createVNode)("span", {
|
|
377
|
+
"class": [bem("label", "placeholder")]
|
|
378
|
+
}, null), (0, import_vue.createVNode)("span", {
|
|
379
|
+
"class": [bem("label--text")]
|
|
380
|
+
}, [(0, import_vue.createTextVNode)("\u5168\u90E8")])]), (_b = defaultTreeNode.value) == null ? void 0 : _b.map(renderSecondTree)]), (0, import_vue.createVNode)("section", {
|
|
381
|
+
"class": [bem("tree-right")]
|
|
382
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
383
|
+
"class": [bem("title")]
|
|
384
|
+
}, [(_c = expandNode.value) == null ? void 0 : _c.text]), (0, import_vue.createVNode)("div", {
|
|
385
|
+
"class": [bem("content")]
|
|
386
|
+
}, [(_e = (_d = expandNode.value) == null ? void 0 : _d.children) == null ? void 0 : _e.map(renderItem)])])])]);
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--zt-drawer-select-background: #ebf2f5}.zt-drawer-select{height:100%;width:100%;display:flex;flex-direction:column;background:var(--zt-background)}.zt-drawer-select__search{padding:var(--zt-padding-xs) 0}.zt-drawer-select__search--item{padding:var(--zt-padding-sm) 0 var(--zt-padding-sm) var(--zt-padding-md)}.zt-drawer-select__search--item:after{left:calc(-50% + 22px)}.zt-drawer-select__search--header{font-size:var(--zt-font-size-lg);font-weight:700;color:var(--zt-text-color);margin-bottom:4px}.zt-drawer-select__search--name{font-size:var(--zt-font-size-md);color:var(--zt-text-color-2)}.zt-drawer-select__wrap{position:fixed;right:0;left:0;bottom:0;z-index:999;overflow:hidden}.zt-drawer-select__popup{position:absolute;max-height:350px;border-radius:0 0 16px 16px}.zt-drawer-select__empty{font-size:var(--zt-font-size-md);color:var(--zt-gray-a4);text-align:center;padding:var(--zt-padding-lg) 0}.zt-drawer-select__history--title{height:44px;line-height:44px;font-weight:700;padding-left:var(--zt-padding-sm);color:var(--zt-text-color)}.zt-drawer-select__history--content{padding:var(--zt-padding-sm) var(--zt-padding-md) var(--zt-padding-xs)}.zt-drawer-select__history--content .zt-tag{line-height:28px;border-radius:14px;font-size:var(--zt-font-size-md);margin-right:4px;margin-bottom:8px}.zt-drawer-select__history--clear{display:flex;align-items:center;justify-content:center;height:44px;color:var(--zt-gray-a6);text-align:center;font-size:var(--zt-font-size-md)}.zt-drawer-select__name{position:relative;height:44px;line-height:44px;font-size:var(--zt-font-size-lg);color:var(--zt-text-color);font-weight:700;padding-left:var(--zt-padding-md)}.zt-drawer-select__name:before{content:"";position:absolute;width:4px;height:16px;top:14px;left:0;background:var(--zt-primary-color)}.zt-drawer-select__tree{display:flex;flex:1;height:calc(100% - 104px)}.zt-drawer-select__tree-left{width:120px}.zt-drawer-select__tree-right{flex:1;display:flex;flex-direction:column;background:var(--zt-white)}.zt-drawer-select__label{display:flex;align-items:center;line-height:28px;color:var(--zt-text-color);padding:var(--zt-padding-xs) 0 var(--zt-padding-xs) var(--zt-padding-base);font-size:var(--zt-font-size-md)}.zt-drawer-select__label--second{background:var(--zt-drawer-select-background);padding-left:var(--zt-padding-sm)}.zt-drawer-select__label--placeholder{display:flex;align-items:center;width:24px}.zt-drawer-select__label--text{display:flex;align-items:center;min-height:28px}.zt-drawer-select__label--icon--active{transform:rotate(90deg);color:var(--zt-primary-color)}.zt-drawer-select__label--active{color:var(--zt-primary-color);background:var(--zt-white)}.zt-drawer-select__title{display:flex;align-items:center;line-height:28px;font-size:var(--zt-font-size-md);color:var(--zt-text-color);font-weight:700;padding:var(--zt-padding-xs) var(--zt-padding-md)}.zt-drawer-select__content{flex:1;overflow-y:scroll}.zt-drawer-select__item--placeholder{width:30px}.zt-drawer-select__item--header{display:flex;min-height:44px;font-size:var(--zt-font-size-md);color:var(--zt-text-color);padding-left:4px}.zt-drawer-select__item--icon{display:flex;align-items:center;width:24px;margin-right:6px;height:100%}.zt-drawer-select__item--icon--active{transform:rotate(90deg);color:var(--zt-primary-color)}.zt-drawer-select__item--label{flex:1;display:flex;align-items:center;line-height:28px;padding:var(--zt-padding-xs) var(--zt-padding-md) var(--zt-padding-xs) 0}.zt-drawer-select__item--label--active{color:var(--zt-primary-color)}.zt-drawer-select__item--child{padding-left:var(--zt-padding-md)}.zt-drawer-select .zt-dialog__confirm{background:var(--zt-dialog-cancel-button-background-color);border:var(--zt-button-border-width) solid #ff5023;color:#ff5023}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare const DrawerSelect: import("../utils").WithInstall<import("vue").DefineComponent<{
|
|
2
|
+
treeData: {
|
|
3
|
+
type: import("vue").PropType<import("./types").DrawerSelectTreeNode[]>;
|
|
4
|
+
default: () => import("./types").DrawerSelectTreeNode[];
|
|
5
|
+
};
|
|
6
|
+
treeFieldName: import("vue").PropType<import("./types").DrawerSelectFieldNames>;
|
|
7
|
+
title: {
|
|
8
|
+
type: import("vue").PropType<string>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
placeholder: {
|
|
12
|
+
type: import("vue").PropType<string>;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
expandAll: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change")[], "select" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
treeData: {
|
|
21
|
+
type: import("vue").PropType<import("./types").DrawerSelectTreeNode[]>;
|
|
22
|
+
default: () => import("./types").DrawerSelectTreeNode[];
|
|
23
|
+
};
|
|
24
|
+
treeFieldName: import("vue").PropType<import("./types").DrawerSelectFieldNames>;
|
|
25
|
+
title: {
|
|
26
|
+
type: import("vue").PropType<string>;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
placeholder: {
|
|
30
|
+
type: import("vue").PropType<string>;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
expandAll: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
}>> & {
|
|
38
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
39
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
title: string;
|
|
42
|
+
placeholder: string;
|
|
43
|
+
treeData: import("./types").DrawerSelectTreeNode[];
|
|
44
|
+
expandAll: boolean;
|
|
45
|
+
}, {}>>;
|
|
46
|
+
export default DrawerSelect;
|
|
47
|
+
export type { DrawerSelectProps } from './DrawerSelect';
|
|
48
|
+
export type { DrawerSelectThemeVars, DrawerSelectTreeNode, FlatTreeNode, } from './types';
|
|
49
|
+
declare module 'vue' {
|
|
50
|
+
interface GlobalComponents {
|
|
51
|
+
ZtDrawerSelect: typeof DrawerSelect;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], 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
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var stdin_exports = {};
|
|
29
|
+
__export(stdin_exports, {
|
|
30
|
+
DrawerSelect: () => DrawerSelect,
|
|
31
|
+
default: () => stdin_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
34
|
+
var import_utils = require("../utils");
|
|
35
|
+
var import_DrawerSelect = __toESM(require("./DrawerSelect"));
|
|
36
|
+
const DrawerSelect = (0, import_utils.withInstall)(import_DrawerSelect.default);
|
|
37
|
+
var stdin_default = DrawerSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require("../../style/base.css");
|
|
2
|
+
require("../../badge/index.css");
|
|
3
|
+
require("../../icon/index.css");
|
|
4
|
+
require("../../image/index.css");
|
|
5
|
+
require("../../tag/index.css");
|
|
6
|
+
require("../../overlay/index.css");
|
|
7
|
+
require("../../popup/index.css");
|
|
8
|
+
require("../../loading/index.css");
|
|
9
|
+
require("../../button/index.css");
|
|
10
|
+
require("../../dialog/index.css");
|
|
11
|
+
require("../../picker/index.css");
|
|
12
|
+
require("../../cell/index.css");
|
|
13
|
+
require("../../field/index.css");
|
|
14
|
+
require("../../search/index.css");
|
|
15
|
+
require("../index.css");
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type DrawerSelectTreeNode = {
|
|
2
|
+
text?: string;
|
|
3
|
+
value?: string | number;
|
|
4
|
+
children?: DrawerSelectTreeNode[];
|
|
5
|
+
[key: PropertyKey]: any;
|
|
6
|
+
};
|
|
7
|
+
export type FlatTreeNode = {
|
|
8
|
+
text?: string;
|
|
9
|
+
value?: string | number;
|
|
10
|
+
children?: FlatTreeNode[];
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
expand?: boolean;
|
|
13
|
+
fullName?: string;
|
|
14
|
+
parent?: {
|
|
15
|
+
[key: PropertyKey]: any;
|
|
16
|
+
}[];
|
|
17
|
+
[key: PropertyKey]: any;
|
|
18
|
+
};
|
|
19
|
+
export type DrawerSelectFieldNames = {
|
|
20
|
+
text?: string;
|
|
21
|
+
value?: string;
|
|
22
|
+
children?: string;
|
|
23
|
+
};
|
|
24
|
+
export type DrawerSelectThemeVars = {
|
|
25
|
+
drawSelectBackground?: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var stdin_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(stdin_exports);
|