zartui 3.1.12 → 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/es/action-sheet/index.css +1 -1
- package/es/avatar/index.css +1 -1
- package/es/badge/index.css +1 -1
- package/es/button/index.css +1 -1
- package/es/calendar/index.css +1 -1
- package/es/calendar/utils.d.ts +2 -2
- package/es/cascader/Cascader.d.ts +1 -1
- package/es/cascader/index.css +1 -1
- package/es/cascader/index.d.ts +1 -1
- package/es/cell/Cell.d.ts +34 -0
- package/es/cell/Cell.mjs +61 -8
- package/es/cell/index.css +1 -1
- package/es/cell/index.d.ts +17 -0
- package/es/cell/style/index.mjs +1 -0
- package/es/cell-group/index.css +1 -1
- package/es/checkbox/Checkbox.d.ts +1 -1
- package/es/checkbox/index.d.ts +1 -1
- package/es/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/es/checkbox-group/index.d.ts +1 -1
- package/es/collapse/Collapse.d.ts +1 -1
- package/es/collapse/index.d.ts +1 -1
- package/es/collapse-item/index.css +1 -1
- package/es/config-provider/types.d.ts +1 -1
- package/es/date-time-picker/DateTimePicker.d.ts +1 -1
- package/es/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
- package/es/date-time-picker/index.d.ts +1 -1
- package/es/dialog/index.css +1 -1
- package/es/divider/index.css +1 -1
- package/es/drawer-select/DrawerSelect.d.ts +68 -0
- package/es/drawer-select/DrawerSelect.mjs +360 -0
- package/es/drawer-select/index.css +1 -0
- package/es/drawer-select/index.d.ts +53 -0
- package/es/drawer-select/index.mjs +8 -0
- package/es/drawer-select/style/index.d.ts +1 -0
- package/es/drawer-select/style/index.mjs +15 -0
- package/es/drawer-select/types.d.ts +26 -0
- package/es/drawer-select/types.mjs +0 -0
- package/es/dropdown-item/DropdownItem.d.ts +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/index.css +1 -1
- 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 +2 -1
- package/es/index.mjs +4 -1
- 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/constant.d.ts +0 -1
- package/es/utils/constant.mjs +0 -2
- package/es/utils/validate.d.ts +2 -1
- package/es/utils/validate.mjs +9 -0
- package/lib/action-sheet/index.css +1 -1
- package/lib/avatar/index.css +1 -1
- package/lib/badge/index.css +1 -1
- package/lib/button/index.css +1 -1
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/utils.d.ts +2 -2
- package/lib/cascader/Cascader.d.ts +1 -1
- package/lib/cascader/index.css +1 -1
- package/lib/cascader/index.d.ts +1 -1
- package/lib/cell/Cell.d.ts +34 -0
- package/lib/cell/Cell.js +61 -8
- package/lib/cell/index.css +1 -1
- package/lib/cell/index.d.ts +17 -0
- package/lib/cell/style/index.js +1 -0
- package/lib/cell-group/index.css +1 -1
- package/lib/checkbox/Checkbox.d.ts +1 -1
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/lib/checkbox-group/index.d.ts +1 -1
- package/lib/collapse/Collapse.d.ts +1 -1
- package/lib/collapse/index.d.ts +1 -1
- package/lib/collapse-item/index.css +1 -1
- package/lib/config-provider/types.d.ts +1 -1
- package/lib/date-time-picker/DateTimePicker.d.ts +1 -1
- package/lib/date-time-picker/DateTimePickerWrapper.d.ts +1 -1
- package/lib/date-time-picker/index.d.ts +1 -1
- package/lib/dialog/index.css +1 -1
- package/lib/divider/index.css +1 -1
- package/lib/drawer-select/DrawerSelect.d.ts +68 -0
- package/lib/drawer-select/DrawerSelect.js +389 -0
- package/lib/drawer-select/index.css +1 -0
- package/lib/drawer-select/index.d.ts +53 -0
- package/lib/drawer-select/index.js +37 -0
- package/lib/drawer-select/style/index.d.ts +1 -0
- package/lib/drawer-select/style/index.js +15 -0
- package/lib/drawer-select/types.d.ts +26 -0
- package/lib/drawer-select/types.js +15 -0
- package/lib/dropdown-item/DropdownItem.d.ts +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/index.css +1 -1
- 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 +2 -1
- package/lib/index.js +4 -1
- 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/constant.d.ts +0 -1
- package/lib/utils/constant.js +0 -2
- package/lib/utils/validate.d.ts +2 -1
- package/lib/utils/validate.js +9 -0
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +3713 -3278
- package/lib/zartui.es.js +3714 -3279
- package/lib/zartui.js +3709 -3274
- package/lib/zartui.min.js +1 -1
- package/package.json +8 -7
|
@@ -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,360 @@
|
|
|
1
|
+
import { withDirectives as _withDirectives, vShow as _vShow, Fragment as _Fragment, createTextVNode as _createTextVNode, createVNode as _createVNode } from "vue";
|
|
2
|
+
import { computed, defineComponent, onMounted, ref } from "vue";
|
|
3
|
+
import { useEventListener, useRect } from "@zartui/use";
|
|
4
|
+
import { createNamespace, makeArrayProp, makeStringProp } from "../utils/index.mjs";
|
|
5
|
+
import ZtSearch from "../search/index.mjs";
|
|
6
|
+
import ZtIcon from "../icon/index.mjs";
|
|
7
|
+
import ZtPopup from "../popup/index.mjs";
|
|
8
|
+
import ZtTag from "../tag/index.mjs";
|
|
9
|
+
import { deepClone } from "../utils/deep-clone.mjs";
|
|
10
|
+
import { assignDefaultFields } from "../picker/utils.mjs";
|
|
11
|
+
import { showConfirmDialog } from "../dialog/index.mjs";
|
|
12
|
+
const [name, bem] = createNamespace("drawer-select");
|
|
13
|
+
const drawerSelectProps = {
|
|
14
|
+
treeData: makeArrayProp(),
|
|
15
|
+
treeFieldName: Object,
|
|
16
|
+
title: makeStringProp("\u9009\u62E9\u7C7B\u578B"),
|
|
17
|
+
placeholder: makeStringProp("\u8BF7\u641C\u7D22\u95EE\u9898\u7C7B\u578B"),
|
|
18
|
+
expandAll: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var stdin_default = defineComponent({
|
|
24
|
+
name,
|
|
25
|
+
props: drawerSelectProps,
|
|
26
|
+
emits: ["change", "select"],
|
|
27
|
+
setup(props, {
|
|
28
|
+
emit
|
|
29
|
+
}) {
|
|
30
|
+
const keyword = ref("");
|
|
31
|
+
const expandNode = ref();
|
|
32
|
+
const selectNode = ref();
|
|
33
|
+
const flatArray = ref([]);
|
|
34
|
+
const show = ref(false);
|
|
35
|
+
const searchRef = ref();
|
|
36
|
+
const offset = ref(0);
|
|
37
|
+
const historyList = ref([]);
|
|
38
|
+
const defaultTreeNode = ref(props.treeData);
|
|
39
|
+
const fields = computed(() => assignDefaultFields(props.treeFieldName));
|
|
40
|
+
const {
|
|
41
|
+
value,
|
|
42
|
+
children,
|
|
43
|
+
text: key
|
|
44
|
+
} = fields.value;
|
|
45
|
+
const allData = {
|
|
46
|
+
[value]: -1,
|
|
47
|
+
[key]: "\u5168\u90E8",
|
|
48
|
+
[children]: props.treeData
|
|
49
|
+
};
|
|
50
|
+
const clearSearch = () => {
|
|
51
|
+
keyword.value = "";
|
|
52
|
+
show.value = false;
|
|
53
|
+
};
|
|
54
|
+
const onScroll = () => {
|
|
55
|
+
if (show.value) {
|
|
56
|
+
updateOffset();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
useEventListener("scroll", onScroll, {
|
|
60
|
+
target: searchRef,
|
|
61
|
+
passive: true
|
|
62
|
+
});
|
|
63
|
+
const updateOffset = () => {
|
|
64
|
+
if (searchRef.value) {
|
|
65
|
+
const rect = useRect(searchRef);
|
|
66
|
+
offset.value = rect.bottom;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const flatData = (data) => {
|
|
70
|
+
const result = [];
|
|
71
|
+
const getNext = (list) => {
|
|
72
|
+
for (const v of list) {
|
|
73
|
+
const current = {
|
|
74
|
+
[key]: v[key],
|
|
75
|
+
[value]: v[value]
|
|
76
|
+
};
|
|
77
|
+
if (props.expandAll) {
|
|
78
|
+
v.checked = true;
|
|
79
|
+
v.expand = true;
|
|
80
|
+
}
|
|
81
|
+
if (v[children] && v[children].length > 0) {
|
|
82
|
+
if (v && v.parent) {
|
|
83
|
+
v[children].forEach((item) => {
|
|
84
|
+
var _a;
|
|
85
|
+
item.parent = deepClone(v.parent);
|
|
86
|
+
(_a = item.parent) == null ? void 0 : _a.push(current);
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
v[children].forEach((item) => {
|
|
90
|
+
item.parent = [current];
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
getNext(v[children]);
|
|
94
|
+
} else {
|
|
95
|
+
if (v && v.parent) {
|
|
96
|
+
v.parent.push(current);
|
|
97
|
+
} else {
|
|
98
|
+
v.parent = [current];
|
|
99
|
+
}
|
|
100
|
+
const fullName = v.parent.map((item) => item[key]).join(" \xB7 ");
|
|
101
|
+
result.push(Object.assign(v, {
|
|
102
|
+
fullName,
|
|
103
|
+
parent: v.parent
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
getNext(data);
|
|
109
|
+
flatArray.value = result;
|
|
110
|
+
};
|
|
111
|
+
onMounted(() => {
|
|
112
|
+
var _a;
|
|
113
|
+
historyList.value = JSON.parse((_a = localStorage.getItem("problemSearchHistory")) != null ? _a : "[]") || [];
|
|
114
|
+
expandNode.value = {
|
|
115
|
+
text: allData[key],
|
|
116
|
+
value: allData[value],
|
|
117
|
+
children: allData[children]
|
|
118
|
+
};
|
|
119
|
+
flatData(props.treeData);
|
|
120
|
+
updateOffset();
|
|
121
|
+
});
|
|
122
|
+
const isEmpty = (item) => !item[children] || item[children].length === 0;
|
|
123
|
+
const onLabelClick = (item, assign = true) => {
|
|
124
|
+
const {
|
|
125
|
+
text,
|
|
126
|
+
value: value2,
|
|
127
|
+
children: children2
|
|
128
|
+
} = fields.value;
|
|
129
|
+
if (item) {
|
|
130
|
+
if (assign) {
|
|
131
|
+
expandNode.value = {
|
|
132
|
+
text: item[text],
|
|
133
|
+
value: item[value2],
|
|
134
|
+
children: item[children2]
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (isEmpty(item)) {
|
|
138
|
+
selectNode.value = item;
|
|
139
|
+
emit("select", item);
|
|
140
|
+
}
|
|
141
|
+
item.checked = !item.checked;
|
|
142
|
+
emit("change", item);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const isStrValid = (text) => {
|
|
146
|
+
return text !== null && text !== "" && Object.prototype.toString.call(text) === "[object String]";
|
|
147
|
+
};
|
|
148
|
+
const onSearch = (value2) => {
|
|
149
|
+
if (isStrValid(value2)) {
|
|
150
|
+
show.value = true;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const onClickInput = (e) => {
|
|
154
|
+
const {
|
|
155
|
+
value: value2
|
|
156
|
+
} = e.target;
|
|
157
|
+
onSearch(value2);
|
|
158
|
+
};
|
|
159
|
+
const formatSearchKeyword = (keywords, text = "") => {
|
|
160
|
+
if (!keywords)
|
|
161
|
+
return text;
|
|
162
|
+
const replaceReg = new RegExp(keywords, "ig");
|
|
163
|
+
const replaceString = `<span style="color: #0091FA; background: rgba(0, 145, 250, 0.1); font-weight: bold;">${keywords}</span>`;
|
|
164
|
+
return text.replace(replaceReg, replaceString);
|
|
165
|
+
};
|
|
166
|
+
const filterTree = computed(() => {
|
|
167
|
+
if (keyword.value) {
|
|
168
|
+
return flatArray.value.filter((item) => {
|
|
169
|
+
return (item.fullName || "").indexOf(keyword.value) > -1;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
return [];
|
|
173
|
+
});
|
|
174
|
+
const onSearchClick = (item) => {
|
|
175
|
+
var _a;
|
|
176
|
+
if (item) {
|
|
177
|
+
const {
|
|
178
|
+
text
|
|
179
|
+
} = fields.value;
|
|
180
|
+
show.value = false;
|
|
181
|
+
keyword.value = item[text];
|
|
182
|
+
let history = JSON.parse((_a = localStorage.getItem("problemSearchHistory")) != null ? _a : "[]") || [];
|
|
183
|
+
if (history.includes(keyword.value)) {
|
|
184
|
+
history.map((v, i) => {
|
|
185
|
+
if (v === keyword.value) {
|
|
186
|
+
history.splice(i, 1);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
history.unshift(keyword.value);
|
|
191
|
+
if (history.length > 10) {
|
|
192
|
+
history = history.slice(0, 10);
|
|
193
|
+
}
|
|
194
|
+
historyList.value = history;
|
|
195
|
+
localStorage.setItem("problemSearchHistory", JSON.stringify(history));
|
|
196
|
+
emit("select", Object.assign(item, {
|
|
197
|
+
parent: item.parent
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
const renderSecondTree = (item) => {
|
|
202
|
+
var _a, _b;
|
|
203
|
+
const text = item[fields.value.text];
|
|
204
|
+
const children2 = (_a = item[fields.value.children]) != null ? _a : [];
|
|
205
|
+
return _createVNode("div", null, [_createVNode("div", {
|
|
206
|
+
"class": [bem("label")],
|
|
207
|
+
"onClick": () => item.expand = !item.expand
|
|
208
|
+
}, [_createVNode("span", {
|
|
209
|
+
"class": [bem("label--placeholder")]
|
|
210
|
+
}, [children2.length > 0 && _createVNode(ZtIcon, {
|
|
211
|
+
"name": "play-small",
|
|
212
|
+
"class": [bem("label--icon", {
|
|
213
|
+
active: item.expand
|
|
214
|
+
})],
|
|
215
|
+
"size": "20"
|
|
216
|
+
}, null)]), _createVNode("span", {
|
|
217
|
+
"class": [bem("label--text")]
|
|
218
|
+
}, [text])]), !isEmpty(item) && item.expand && ((_b = item.children) == null ? void 0 : _b.map((child) => {
|
|
219
|
+
var _a2;
|
|
220
|
+
return _createVNode("div", {
|
|
221
|
+
"class": [bem("label", "second"), bem("label", {
|
|
222
|
+
active: ((_a2 = expandNode.value) == null ? void 0 : _a2.value) === child[value]
|
|
223
|
+
})],
|
|
224
|
+
"onClick": () => onLabelClick(child)
|
|
225
|
+
}, [child[fields.value.text]]);
|
|
226
|
+
}))]);
|
|
227
|
+
};
|
|
228
|
+
const renderItem = (item) => {
|
|
229
|
+
var _a, _b;
|
|
230
|
+
const empty = isEmpty(item);
|
|
231
|
+
return _createVNode("div", {
|
|
232
|
+
"onClick": (e) => {
|
|
233
|
+
e.stopPropagation();
|
|
234
|
+
onLabelClick(item, false);
|
|
235
|
+
},
|
|
236
|
+
"class": [bem("item")]
|
|
237
|
+
}, [_createVNode("div", {
|
|
238
|
+
"class": [bem("item--header")]
|
|
239
|
+
}, [_createVNode("span", {
|
|
240
|
+
"class": [bem("item--placeholder")]
|
|
241
|
+
}, [!empty && _createVNode(ZtIcon, {
|
|
242
|
+
"name": "play-small",
|
|
243
|
+
"class": [bem("item--icon", {
|
|
244
|
+
active: item.checked
|
|
245
|
+
})],
|
|
246
|
+
"size": "20"
|
|
247
|
+
}, null)]), _createVNode("div", {
|
|
248
|
+
"class": [bem("item--label", {
|
|
249
|
+
active: empty && ((_a = selectNode.value) == null ? void 0 : _a.value) == item[fields.value.value]
|
|
250
|
+
}), "zt-hairline--top"]
|
|
251
|
+
}, [item[fields.value.text]])]), _createVNode("div", {
|
|
252
|
+
"class": [bem("item--child")]
|
|
253
|
+
}, [!empty && item.checked && ((_b = item[fields.value.children]) == null ? void 0 : _b.map(renderItem))])]);
|
|
254
|
+
};
|
|
255
|
+
const onClearHistory = () => {
|
|
256
|
+
showConfirmDialog({
|
|
257
|
+
title: "\u786E\u8BA4\u5220\u9664\u5168\u90E8\u641C\u7D22\u5386\u53F2",
|
|
258
|
+
message: "\u70B9\u51FB\u201C\u5220\u9664\u201D\u5C06\u6E05\u7A7A\u5168\u90E8\u7684\u641C\u7D22\u8BB0\u5F55",
|
|
259
|
+
confirmButtonText: "\u5220\u9664",
|
|
260
|
+
teleport: ".zt-drawer-select"
|
|
261
|
+
}).then(() => {
|
|
262
|
+
historyList.value = [];
|
|
263
|
+
show.value = false;
|
|
264
|
+
localStorage.removeItem("problemSearchHistory");
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
const onHistoryClick = (itme) => {
|
|
268
|
+
keyword.value = itme;
|
|
269
|
+
};
|
|
270
|
+
return () => {
|
|
271
|
+
var _a, _b, _c, _d, _e;
|
|
272
|
+
return _createVNode("div", {
|
|
273
|
+
"class": [bem()]
|
|
274
|
+
}, [_createVNode("div", {
|
|
275
|
+
"class": [bem("search")],
|
|
276
|
+
"ref": searchRef
|
|
277
|
+
}, [_createVNode(ZtSearch, {
|
|
278
|
+
"modelValue": keyword.value,
|
|
279
|
+
"onUpdate:modelValue": [($event) => keyword.value = $event, onSearch],
|
|
280
|
+
"placeholder": props.placeholder,
|
|
281
|
+
"onClickInput": onClickInput,
|
|
282
|
+
"onSearch": onSearch,
|
|
283
|
+
"onClear": clearSearch,
|
|
284
|
+
"onFocus": () => show.value = true,
|
|
285
|
+
"autocomplete": "off"
|
|
286
|
+
}, null), _withDirectives(_createVNode("div", {
|
|
287
|
+
"class": [bem("wrap")],
|
|
288
|
+
"style": {
|
|
289
|
+
top: `${offset.value}px`
|
|
290
|
+
}
|
|
291
|
+
}, [_createVNode(ZtPopup, {
|
|
292
|
+
"class": [bem("popup")],
|
|
293
|
+
"position": "top",
|
|
294
|
+
"show": show.value,
|
|
295
|
+
"onUpdate:show": ($event) => show.value = $event,
|
|
296
|
+
"overlayStyle": {
|
|
297
|
+
position: "absolute"
|
|
298
|
+
}
|
|
299
|
+
}, {
|
|
300
|
+
default: () => [keyword.value ? _createVNode(_Fragment, null, [filterTree.value.length > 0 ? filterTree.value.map((item) => _createVNode("div", {
|
|
301
|
+
"class": [bem("search--item"), "zt-hairline--bottom"],
|
|
302
|
+
"onClick": () => onSearchClick(item)
|
|
303
|
+
}, [_createVNode("div", {
|
|
304
|
+
"class": [bem("search--header")],
|
|
305
|
+
"innerHTML": formatSearchKeyword(keyword.value, item[key])
|
|
306
|
+
}, null), _createVNode("div", {
|
|
307
|
+
"class": [bem("search--name")],
|
|
308
|
+
"innerHTML": formatSearchKeyword(keyword.value, item == null ? void 0 : item.fullName)
|
|
309
|
+
}, null)])) : _createVNode("div", {
|
|
310
|
+
"class": [bem("empty")]
|
|
311
|
+
}, [_createTextVNode("\u6CA1\u6709\u76F8\u5173\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\u5173\u952E\u5B57")]), " "]) : _createVNode("section", {
|
|
312
|
+
"class": [bem("history")]
|
|
313
|
+
}, [historyList.value.length > 0 && _createVNode("div", null, [_createVNode("p", {
|
|
314
|
+
"class": [bem("history--title"), "zt-hairline--bottom"]
|
|
315
|
+
}, [_createTextVNode("\u641C\u7D22\u5386\u53F2")]), _createVNode("div", {
|
|
316
|
+
"class": [bem("history--content")]
|
|
317
|
+
}, [historyList.value.map((item) => _createVNode(ZtTag, {
|
|
318
|
+
"onClick": () => onHistoryClick(item),
|
|
319
|
+
"round": true,
|
|
320
|
+
"text-color": "var(--zt-gray-a8)",
|
|
321
|
+
"icon-color": "var(--zt-gray)"
|
|
322
|
+
}, {
|
|
323
|
+
default: () => [item]
|
|
324
|
+
}))]), _createVNode("div", {
|
|
325
|
+
"class": [bem("history--clear")],
|
|
326
|
+
"onClick": onClearHistory
|
|
327
|
+
}, [_createVNode(ZtIcon, {
|
|
328
|
+
"name": "delete",
|
|
329
|
+
"size": "20"
|
|
330
|
+
}, null), _createTextVNode("\u6E05\u7A7A\u641C\u7D22\u5386\u53F2")])]), historyList.value.length === 0 && _createVNode("div", {
|
|
331
|
+
"class": [bem("empty")]
|
|
332
|
+
}, [_createTextVNode("\u6682\u65E0\u641C\u7D22\u8BB0\u5F55")])])]
|
|
333
|
+
})]), [[_vShow, show.value]])]), _createVNode("div", {
|
|
334
|
+
"class": [bem("name"), "zt-hairline--bottom"]
|
|
335
|
+
}, [props.title]), _createVNode("main", {
|
|
336
|
+
"class": [bem("tree")]
|
|
337
|
+
}, [_createVNode("nav", {
|
|
338
|
+
"class": [bem("tree-left")]
|
|
339
|
+
}, [_createVNode("div", {
|
|
340
|
+
"class": [bem("label", {
|
|
341
|
+
active: ((_a = expandNode.value) == null ? void 0 : _a.value) === allData[value]
|
|
342
|
+
})],
|
|
343
|
+
"onClick": () => onLabelClick(allData)
|
|
344
|
+
}, [_createVNode("span", {
|
|
345
|
+
"class": [bem("label", "placeholder")]
|
|
346
|
+
}, null), _createVNode("span", {
|
|
347
|
+
"class": [bem("label--text")]
|
|
348
|
+
}, [_createTextVNode("\u5168\u90E8")])]), (_b = defaultTreeNode.value) == null ? void 0 : _b.map(renderSecondTree)]), _createVNode("section", {
|
|
349
|
+
"class": [bem("tree-right")]
|
|
350
|
+
}, [_createVNode("div", {
|
|
351
|
+
"class": [bem("title")]
|
|
352
|
+
}, [(_c = expandNode.value) == null ? void 0 : _c.text]), _createVNode("div", {
|
|
353
|
+
"class": [bem("content")]
|
|
354
|
+
}, [(_e = (_d = expandNode.value) == null ? void 0 : _d.children) == null ? void 0 : _e.map(renderItem)])])])]);
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
export {
|
|
359
|
+
stdin_default as default
|
|
360
|
+
};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "../../style/base.css";
|
|
2
|
+
import "../../badge/index.css";
|
|
3
|
+
import "../../icon/index.css";
|
|
4
|
+
import "../../image/index.css";
|
|
5
|
+
import "../../tag/index.css";
|
|
6
|
+
import "../../overlay/index.css";
|
|
7
|
+
import "../../popup/index.css";
|
|
8
|
+
import "../../loading/index.css";
|
|
9
|
+
import "../../button/index.css";
|
|
10
|
+
import "../../dialog/index.css";
|
|
11
|
+
import "../../picker/index.css";
|
|
12
|
+
import "../../cell/index.css";
|
|
13
|
+
import "../../field/index.css";
|
|
14
|
+
import "../../search/index.css";
|
|
15
|
+
import "../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
|
+
};
|
|
File without changes
|
|
@@ -40,7 +40,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
40
40
|
};
|
|
41
41
|
titleClass: PropType<unknown>;
|
|
42
42
|
multiSelect: BooleanConstructor;
|
|
43
|
-
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "open" | "
|
|
43
|
+
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm")[], "reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
44
44
|
title: StringConstructor;
|
|
45
45
|
options: {
|
|
46
46
|
type: PropType<DropdownItemOption[]>;
|
|
@@ -18,7 +18,7 @@ export declare const DropdownItem: import("../utils").WithInstall<import("vue").
|
|
|
18
18
|
};
|
|
19
19
|
titleClass: import("vue").PropType<unknown>;
|
|
20
20
|
multiSelect: BooleanConstructor;
|
|
21
|
-
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "open" | "
|
|
21
|
+
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm")[], "reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
22
|
title: StringConstructor;
|
|
23
23
|
options: {
|
|
24
24
|
type: import("vue").PropType<import("./types").DropdownItemOption[]>;
|
|
@@ -2,11 +2,12 @@ import "../../style/base.css";
|
|
|
2
2
|
import "../../badge/index.css";
|
|
3
3
|
import "../../icon/index.css";
|
|
4
4
|
import "../../dropdown-menu/index.css";
|
|
5
|
-
import "../../cell/index.css";
|
|
6
5
|
import "../../overlay/index.css";
|
|
7
6
|
import "../../popup/index.css";
|
|
8
7
|
import "../../loading/index.css";
|
|
9
8
|
import "../../button/index.css";
|
|
9
|
+
import "../../cell/index.css";
|
|
10
|
+
import "../../field/index.css";
|
|
10
11
|
import "../../checkbox-group/index.css";
|
|
11
12
|
import "../../checkbox/index.css";
|
|
12
13
|
import "../index.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-dropdown-menu-background: var(--zt-background-
|
|
1
|
+
:root{--zt-dropdown-menu-background: var(--zt-background-popup);--zt-dropdown-menu-bar-padding: 0 12px;--zt-dropdown-menu-item-margin: 12px 4px;--zt-dropdown-menu-item-height: 36px;--zt-dropdown-menu-item-padding: 0 12px;--zt-dropdown-menu-title-text-color: var(--zt-text-color);--zt-dropdown-menu-title-active-text-color: var(--zt-primary-color);--zt-dropdown-menu-title-disabled-text-color: var(--zt-text-color-2);--zt-dropdown-menu-option-active-color: var(--zt-primary-color);--zt-dropdown-menu-content-max-height: 80%}:root[zt-theme-size=large]{--zt-dropdown-menu-item-height: 48px}.zt-dropdown-menu{-webkit-user-select:none;user-select:none}.zt-dropdown-menu__bar{position:relative;display:flex;padding:var(--zt-dropdown-menu-bar-padding);align-items:center}.zt-dropdown-menu__bar--opened{z-index:calc(var(--zt-dropdown-item-z-index) + 1)}.zt-dropdown-menu__item{display:flex;flex:1;align-items:center;justify-content:center;background:var(--zt-dropdown-menu-background);min-width:0;margin:var(--zt-dropdown-menu-item-margin);height:var(--zt-dropdown-menu-item-height);border-radius:calc(var(--zt-dropdown-menu-item-height) / 2);padding:var(--zt-dropdown-menu-item-padding);font-size:var(--zt-font-size-md);line-height:var(--zt-line-height-md);cursor:pointer}.zt-dropdown-menu__item:last-child{margin-right:0}.zt-dropdown-menu__item:active{opacity:.7}.zt-dropdown-menu__item--disabled:active{opacity:1}.zt-dropdown-menu__item--disabled .zt-dropdown-menu__title{color:var(--zt-dropdown-menu-title-disabled-text-color)}.zt-dropdown-menu__title{position:relative;box-sizing:border-box;width:100%;color:var(--zt-dropdown-menu-title-text-color);font-size:var(--zt-font-size-md)}.zt-dropdown-menu__title .zt-icon{position:absolute;right:0;margin-top:1px;color:var(--zt-gray-4)}.zt-dropdown-menu__title--active{color:var(--zt-dropdown-menu-title-active-text-color)}.zt-dropdown-menu__title--active .zt-icon{color:currentColor}.zt-dropdown-menu__title--active .zt-dropdown-menu__icon{transform:rotate(180deg)}.zt-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|