evui 3.5.0-rc.1 → 3.5.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/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/common/utils.bignumber.js +23 -0
- package/dist/common/utils.debounce.js +66 -0
- package/dist/common/utils.js +64 -0
- package/dist/common/utils.throttle.js +15 -0
- package/dist/components/button/Button.vue.js +65 -0
- package/dist/components/button/index.js +7 -0
- package/dist/components/buttonGroup/ButtonGroup.vue.js +14 -0
- package/dist/components/buttonGroup/index.js +7 -0
- package/dist/components/calendar/Calendar.vue.js +299 -0
- package/dist/components/calendar/index.js +7 -0
- package/dist/components/calendar/uses.js +579 -0
- package/dist/components/chart/Chart.vue.js +261 -0
- package/dist/components/chart/ChartToolbar.vue.js +32 -0
- package/dist/components/chart/chart.core.js +738 -0
- package/dist/components/chart/chartZoom.core.js +221 -0
- package/dist/components/chart/element/element.bar.js +358 -0
- package/dist/components/chart/element/element.bar.time.js +55 -0
- package/dist/components/chart/element/element.heatmap.js +403 -0
- package/dist/components/chart/element/element.line.js +292 -0
- package/dist/components/chart/element/element.pie.js +73 -0
- package/dist/components/chart/element/element.scatter.js +209 -0
- package/dist/components/chart/element/element.tip.js +312 -0
- package/dist/components/chart/helpers/helpers.canvas.js +141 -0
- package/dist/components/chart/helpers/helpers.constant.js +253 -0
- package/dist/components/chart/helpers/helpers.util.js +265 -0
- package/dist/components/chart/index.js +7 -0
- package/dist/components/chart/model/index.js +6 -0
- package/dist/components/chart/model/model.series.js +82 -0
- package/dist/components/chart/model/model.store.js +650 -0
- package/dist/components/chart/plugins/plugins.interaction.js +823 -0
- package/dist/components/chart/plugins/plugins.legend.gradient.js +281 -0
- package/dist/components/chart/plugins/plugins.legend.js +665 -0
- package/dist/components/chart/plugins/plugins.pie.js +86 -0
- package/dist/components/chart/plugins/plugins.scrollbar.js +345 -0
- package/dist/components/chart/plugins/plugins.title.js +43 -0
- package/dist/components/chart/plugins/plugins.tooltip.js +508 -0
- package/dist/components/chart/scale/scale.js +492 -0
- package/dist/components/chart/scale/scale.linear.js +248 -0
- package/dist/components/chart/scale/scale.logarithmic.js +82 -0
- package/dist/components/chart/scale/scale.step.js +227 -0
- package/dist/components/chart/scale/scale.time.category.js +148 -0
- package/dist/components/chart/scale/scale.time.js +95 -0
- package/dist/components/chart/uses.js +479 -0
- package/dist/components/chartBrush/ChartBrush.vue.js +198 -0
- package/dist/components/chartBrush/chartBrush.core.js +265 -0
- package/dist/components/chartBrush/index.js +7 -0
- package/dist/components/chartBrush/uses.js +18 -0
- package/dist/components/chartGroup/ChartGroup.vue.js +128 -0
- package/dist/components/chartGroup/index.js +7 -0
- package/dist/components/chartGroup/uses.js +47 -0
- package/dist/components/checkbox/Checkbox.vue.js +99 -0
- package/dist/components/checkbox/index.js +7 -0
- package/dist/components/checkboxGroup/CheckboxGroup.vue.js +40 -0
- package/dist/components/checkboxGroup/index.js +7 -0
- package/dist/components/contextMenu/ContextMenu.vue.js +70 -0
- package/dist/components/contextMenu/MenuList.vue.js +105 -0
- package/dist/components/contextMenu/index.js +7 -0
- package/dist/components/contextMenu/uses.js +79 -0
- package/dist/components/datePicker/DatePicker.vue.js +310 -0
- package/dist/components/datePicker/index.js +7 -0
- package/dist/components/datePicker/uses.js +190 -0
- package/dist/components/grid/Grid.vue.js +1261 -0
- package/dist/components/grid/GridColumnSetting.vue.js +212 -0
- package/dist/components/grid/GridFilterSetting.vue.js +222 -0
- package/dist/components/grid/GridPagination.vue.js +69 -0
- package/dist/components/grid/GridSummary.vue.js +186 -0
- package/dist/components/grid/GridToolbar.vue.js +15 -0
- package/dist/components/grid/icon/icon-option-button.vue.js +39 -0
- package/dist/components/grid/icon/icon-sort-button.vue.js +56 -0
- package/dist/components/grid/index.js +7 -0
- package/dist/components/grid/uses.js +697 -0
- package/dist/components/icon/Icon.vue.js +50 -0
- package/dist/components/icon/index.js +8 -0
- package/dist/components/inputNumber/InputNumber.vue.js +112 -0
- package/dist/components/inputNumber/index.js +7 -0
- package/dist/components/inputNumber/uses.js +76 -0
- package/dist/components/loading/Loading.vue.js +78 -0
- package/dist/components/loading/index.js +7 -0
- package/dist/components/menu/Menu.vue.js +66 -0
- package/dist/components/menu/MenuItem.vue.js +125 -0
- package/dist/components/menu/index.js +7 -0
- package/dist/components/message/Message.vue.js +122 -0
- package/dist/components/message/index.js +16 -0
- package/dist/components/messageBox/MessageBox.vue.js +216 -0
- package/dist/components/messageBox/index.js +13 -0
- package/dist/components/notification/Notification.vue.js +140 -0
- package/dist/components/notification/index.js +23 -0
- package/dist/components/pagination/Pagination.vue.js +215 -0
- package/dist/components/pagination/index.js +7 -0
- package/dist/components/pagination/pageButton.vue.js +35 -0
- package/dist/components/progress/Progress.vue.js +88 -0
- package/dist/components/progress/index.js +7 -0
- package/dist/components/radio/Radio.vue.js +75 -0
- package/dist/components/radio/index.js +7 -0
- package/dist/components/radioGroup/RadioGroup.vue.js +37 -0
- package/dist/components/radioGroup/index.js +7 -0
- package/dist/components/scheduler/Scheduler.vue.js +128 -0
- package/dist/components/scheduler/index.js +7 -0
- package/dist/components/scheduler/uses.js +73 -0
- package/dist/components/select/Select.vue.js +381 -0
- package/dist/components/select/index.js +7 -0
- package/dist/components/select/uses.js +147 -0
- package/dist/components/slider/Slider.vue.js +243 -0
- package/dist/components/slider/index.js +7 -0
- package/dist/components/slider/uses.js +188 -0
- package/dist/components/tabPanel/TabPanel.vue.js +39 -0
- package/dist/components/tabPanel/index.js +7 -0
- package/dist/components/tabs/Tabs.vue.js +220 -0
- package/dist/components/tabs/index.js +7 -0
- package/dist/components/textField/TextField.vue.js +209 -0
- package/dist/components/textField/index.js +7 -0
- package/dist/components/timePicker/TimePicker.vue.js +227 -0
- package/dist/components/timePicker/index.js +7 -0
- package/dist/components/toggle/Toggle.vue.js +66 -0
- package/dist/components/toggle/index.js +7 -0
- package/dist/components/tree/Tree.vue.js +220 -0
- package/dist/components/tree/TreeNode.vue.js +146 -0
- package/dist/components/tree/index.js +7 -0
- package/dist/components/treeGrid/TreeGrid.vue.js +898 -0
- package/dist/components/treeGrid/TreeGridNode.vue.js +274 -0
- package/dist/components/treeGrid/TreeGridToolbar.vue.js +15 -0
- package/dist/components/treeGrid/index.js +7 -0
- package/dist/components/treeGrid/uses.js +497 -0
- package/dist/components/window/Window.vue.js +211 -0
- package/dist/components/window/index.js +7 -0
- package/dist/components/window/uses.js +345 -0
- package/dist/directives/clickoutside.js +47 -0
- package/dist/main.js +142 -0
- package/dist/package.json.js +4 -0
- package/dist/resolver.js +17 -0
- package/dist/style.css +1 -1
- package/package.json +56 -23
- package/dist/index.js +0 -21754
- package/dist/index.umd.cjs +0 -28
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { selectClickoutside as O } from "../../directives/clickoutside.js";
|
|
2
|
+
import L from "../checkboxGroup/CheckboxGroup.vue.js";
|
|
3
|
+
import R from "../checkbox/Checkbox.vue.js";
|
|
4
|
+
import { useModel as U, useDropdown as q } from "./uses.js";
|
|
5
|
+
import { resolveComponent as S, resolveDirective as z, withDirectives as y, openBlock as t, createElementBlock as a, normalizeClass as n, createElementVNode as c, Fragment as r, createCommentVNode as i, vModelText as G, renderList as x, toDisplayString as v, withModifiers as u, vShow as j, normalizeStyle as H, renderSlot as J, createVNode as g, createBlock as K, withCtx as C, createTextVNode as _ } from "vue";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import Q from "../../_virtual/_plugin-vue_export-helper.js";
|
|
8
|
+
const X = {
|
|
9
|
+
name: "EvSelect",
|
|
10
|
+
components: {
|
|
11
|
+
EvCheckbox: R,
|
|
12
|
+
EvCheckboxGroup: L
|
|
13
|
+
},
|
|
14
|
+
directives: {
|
|
15
|
+
clickoutside: O
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
modelValue: {
|
|
19
|
+
type: [Boolean, String, Number, Array, Object],
|
|
20
|
+
default: null
|
|
21
|
+
},
|
|
22
|
+
placeholder: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
searchPlaceholder: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "Please Enter a Search Words."
|
|
29
|
+
},
|
|
30
|
+
noMatchingText: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "NO MATCHING DATA"
|
|
33
|
+
},
|
|
34
|
+
items: {
|
|
35
|
+
type: Array,
|
|
36
|
+
default: () => []
|
|
37
|
+
},
|
|
38
|
+
disabled: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
clearable: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
multiple: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
checkable: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
collapseTags: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !1
|
|
57
|
+
},
|
|
58
|
+
filterable: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !1
|
|
61
|
+
},
|
|
62
|
+
filterText: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: ""
|
|
65
|
+
},
|
|
66
|
+
allCheckLabel: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: "Select All"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
emits: {
|
|
72
|
+
"update:modelValue": null,
|
|
73
|
+
change: null
|
|
74
|
+
},
|
|
75
|
+
setup() {
|
|
76
|
+
const {
|
|
77
|
+
mv: k,
|
|
78
|
+
selectedModel: o,
|
|
79
|
+
computedPlaceholder: s,
|
|
80
|
+
isClearableIcon: e,
|
|
81
|
+
changeMv: h,
|
|
82
|
+
removeMv: I,
|
|
83
|
+
removeAllMv: b
|
|
84
|
+
} = U(), {
|
|
85
|
+
select: m,
|
|
86
|
+
selectWrapper: p,
|
|
87
|
+
dropbox: l,
|
|
88
|
+
itemWrapper: d,
|
|
89
|
+
isDropbox: f,
|
|
90
|
+
dropboxPosition: M,
|
|
91
|
+
filterTextRef: D,
|
|
92
|
+
filteredItems: P,
|
|
93
|
+
clickSelectInput: T,
|
|
94
|
+
clickOutsideDropbox: w,
|
|
95
|
+
changeFilterText: V,
|
|
96
|
+
changeDropboxPosition: A,
|
|
97
|
+
clickItem: B,
|
|
98
|
+
selectedItemClass: W,
|
|
99
|
+
allCheck: E,
|
|
100
|
+
changeAllCheck: N,
|
|
101
|
+
dropboxWidth: F
|
|
102
|
+
} = q({ mv: k, changeMv: h });
|
|
103
|
+
return {
|
|
104
|
+
mv: k,
|
|
105
|
+
selectedModel: o,
|
|
106
|
+
computedPlaceholder: s,
|
|
107
|
+
isClearableIcon: e,
|
|
108
|
+
changeMv: h,
|
|
109
|
+
removeMv: I,
|
|
110
|
+
removeAllMv: b,
|
|
111
|
+
select: m,
|
|
112
|
+
selectWrapper: p,
|
|
113
|
+
dropbox: l,
|
|
114
|
+
itemWrapper: d,
|
|
115
|
+
isDropbox: f,
|
|
116
|
+
dropboxPosition: M,
|
|
117
|
+
filterTextRef: D,
|
|
118
|
+
filteredItems: P,
|
|
119
|
+
clickSelectInput: T,
|
|
120
|
+
clickOutsideDropbox: w,
|
|
121
|
+
changeFilterText: V,
|
|
122
|
+
changeDropboxPosition: A,
|
|
123
|
+
clickItem: B,
|
|
124
|
+
selectedItemClass: W,
|
|
125
|
+
allCheck: E,
|
|
126
|
+
changeAllCheck: N,
|
|
127
|
+
dropboxWidth: F
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}, Y = {
|
|
131
|
+
ref: "selectWrapper",
|
|
132
|
+
class: "ev-select__wrapper"
|
|
133
|
+
}, Z = ["placeholder", "disabled"], $ = {
|
|
134
|
+
key: 1,
|
|
135
|
+
class: "ev-select-tag-wrapper"
|
|
136
|
+
}, ee = ["placeholder", "disabled"], le = { class: "ev-tag-name" }, oe = ["onClick"], te = {
|
|
137
|
+
key: 0,
|
|
138
|
+
class: "ev-select-tag"
|
|
139
|
+
}, ae = { class: "ev-tag-name" }, se = {
|
|
140
|
+
key: 1,
|
|
141
|
+
class: "ev-select-tag num"
|
|
142
|
+
}, ce = { class: "ev-tag-name" }, ie = { class: "ev-select-dropbox-wrapper" }, ne = ["placeholder", "value"], de = {
|
|
143
|
+
ref: "itemWrapper",
|
|
144
|
+
class: "ev-select-dropbox-list"
|
|
145
|
+
}, re = {
|
|
146
|
+
key: 0,
|
|
147
|
+
class: "ev-select-dropbox-ul"
|
|
148
|
+
}, ve = ["title", "onClick"], ue = { key: 1 }, be = { class: "ev-select-dropbox-item disabled" }, ke = {
|
|
149
|
+
key: 0,
|
|
150
|
+
class: "ev-select-dropbox-ul"
|
|
151
|
+
}, fe = ["title", "onClick"], xe = {
|
|
152
|
+
key: 2,
|
|
153
|
+
ref: "itemWrapper",
|
|
154
|
+
class: "ev-select-dropbox-list"
|
|
155
|
+
}, he = {
|
|
156
|
+
key: 0,
|
|
157
|
+
class: "ev-select-dropbox-ul"
|
|
158
|
+
}, me = ["title", "onClick"], pe = { key: 1 }, ye = { class: "ev-select-dropbox-item disabled" };
|
|
159
|
+
function ge(k, o, s, e, h, I) {
|
|
160
|
+
const b = S("ev-checkbox"), m = S("ev-checkbox-group"), p = z("clickoutside");
|
|
161
|
+
return y((t(), a("div", {
|
|
162
|
+
ref: "select",
|
|
163
|
+
class: n(["ev-select", {
|
|
164
|
+
selected: e.isDropbox,
|
|
165
|
+
disabled: s.disabled
|
|
166
|
+
}])
|
|
167
|
+
}, [
|
|
168
|
+
c("div", Y, [
|
|
169
|
+
s.multiple ? (t(), a("div", $, [
|
|
170
|
+
!s.clearable || !e.isClearableIcon ? (t(), a("span", {
|
|
171
|
+
key: 0,
|
|
172
|
+
class: "ev-input-suffix",
|
|
173
|
+
onClick: o[3] || (o[3] = (...l) => e.clickSelectInput && e.clickSelectInput(...l))
|
|
174
|
+
}, [
|
|
175
|
+
c("i", {
|
|
176
|
+
class: n(["ev-input-suffix-arrow ev-icon-s-arrow-down", {
|
|
177
|
+
selected: e.isDropbox
|
|
178
|
+
}])
|
|
179
|
+
}, null, 2)
|
|
180
|
+
])) : i("", !0),
|
|
181
|
+
c("input", {
|
|
182
|
+
type: "text",
|
|
183
|
+
class: "ev-input multiple",
|
|
184
|
+
readonly: "",
|
|
185
|
+
placeholder: e.computedPlaceholder,
|
|
186
|
+
disabled: s.disabled,
|
|
187
|
+
onClick: o[4] || (o[4] = (...l) => e.clickSelectInput && e.clickSelectInput(...l))
|
|
188
|
+
}, null, 8, ee),
|
|
189
|
+
s.collapseTags ? (t(), a(r, { key: 2 }, [
|
|
190
|
+
e.selectedModel.length ? (t(), a("div", te, [
|
|
191
|
+
c("span", ae, v(e.selectedModel[0].name), 1),
|
|
192
|
+
c("span", {
|
|
193
|
+
class: "ev-tag-suffix",
|
|
194
|
+
onClick: o[5] || (o[5] = u((l) => [e.removeMv(e.selectedModel[0].value), e.changeDropboxPosition()], ["stop"]))
|
|
195
|
+
}, [...o[13] || (o[13] = [
|
|
196
|
+
c("i", { class: "ev-tag-suffix-close ev-icon-error" }, null, -1)
|
|
197
|
+
])])
|
|
198
|
+
])) : i("", !0),
|
|
199
|
+
e.selectedModel.length > 1 ? (t(), a("div", se, [
|
|
200
|
+
c("span", ce, " + " + v(e.selectedModel.length - 1), 1)
|
|
201
|
+
])) : i("", !0)
|
|
202
|
+
], 64)) : (t(!0), a(r, { key: 1 }, x(e.selectedModel, (l) => (t(), a("div", {
|
|
203
|
+
key: l,
|
|
204
|
+
class: "ev-select-tag"
|
|
205
|
+
}, [
|
|
206
|
+
c("span", le, v(l.name), 1),
|
|
207
|
+
c("span", {
|
|
208
|
+
class: "ev-tag-suffix",
|
|
209
|
+
onClick: u((d) => [e.removeMv(l.value), e.changeDropboxPosition()], ["stop"])
|
|
210
|
+
}, [...o[12] || (o[12] = [
|
|
211
|
+
c("i", { class: "ev-tag-suffix-close ev-icon-error" }, null, -1)
|
|
212
|
+
])], 8, oe)
|
|
213
|
+
]))), 128))
|
|
214
|
+
])) : (t(), a(r, { key: 0 }, [
|
|
215
|
+
!s.clearable || !e.isClearableIcon ? (t(), a("span", {
|
|
216
|
+
key: 0,
|
|
217
|
+
class: "ev-input-suffix",
|
|
218
|
+
onClick: o[0] || (o[0] = (...l) => e.clickSelectInput && e.clickSelectInput(...l))
|
|
219
|
+
}, [
|
|
220
|
+
c("i", {
|
|
221
|
+
class: n(["ev-input-suffix-arrow ev-icon-s-arrow-down", {
|
|
222
|
+
selected: e.isDropbox
|
|
223
|
+
}])
|
|
224
|
+
}, null, 2)
|
|
225
|
+
])) : i("", !0),
|
|
226
|
+
y(c("input", {
|
|
227
|
+
"onUpdate:modelValue": o[1] || (o[1] = (l) => e.selectedModel = l),
|
|
228
|
+
type: "text",
|
|
229
|
+
class: "ev-input",
|
|
230
|
+
readonly: "",
|
|
231
|
+
placeholder: e.computedPlaceholder,
|
|
232
|
+
disabled: s.disabled,
|
|
233
|
+
onClick: o[2] || (o[2] = (...l) => e.clickSelectInput && e.clickSelectInput(...l))
|
|
234
|
+
}, null, 8, Z), [
|
|
235
|
+
[G, e.selectedModel]
|
|
236
|
+
])
|
|
237
|
+
], 64)),
|
|
238
|
+
s.clearable ? y((t(), a("span", {
|
|
239
|
+
key: 2,
|
|
240
|
+
class: "ev-input-suffix",
|
|
241
|
+
onClick: o[6] || (o[6] = u((l) => [e.removeAllMv(), e.clickOutsideDropbox()], ["stop"]))
|
|
242
|
+
}, [...o[14] || (o[14] = [
|
|
243
|
+
c("i", { class: "ev-icon-error" }, null, -1)
|
|
244
|
+
])], 512)), [
|
|
245
|
+
[j, e.isClearableIcon]
|
|
246
|
+
]) : i("", !0),
|
|
247
|
+
c("div", ie, [
|
|
248
|
+
e.isDropbox ? (t(), a("div", {
|
|
249
|
+
key: 0,
|
|
250
|
+
ref: "dropbox",
|
|
251
|
+
class: "ev-select-dropbox",
|
|
252
|
+
style: H([e.dropboxPosition, { width: e.dropboxWidth }])
|
|
253
|
+
}, [
|
|
254
|
+
s.filterable ? J(k.$slots, "search-filter", {
|
|
255
|
+
key: 0,
|
|
256
|
+
item: {
|
|
257
|
+
value: e.filterTextRef,
|
|
258
|
+
onInput: e.changeFilterText,
|
|
259
|
+
class: "ev-input-query",
|
|
260
|
+
placeholder: s.searchPlaceholder
|
|
261
|
+
}
|
|
262
|
+
}, () => [
|
|
263
|
+
c("input", {
|
|
264
|
+
type: "text",
|
|
265
|
+
class: "ev-input-query",
|
|
266
|
+
placeholder: s.searchPlaceholder,
|
|
267
|
+
value: e.filterTextRef,
|
|
268
|
+
onInput: o[7] || (o[7] = (...l) => e.changeFilterText && e.changeFilterText(...l))
|
|
269
|
+
}, null, 40, ne)
|
|
270
|
+
]) : i("", !0),
|
|
271
|
+
s.checkable ? (t(), a(r, { key: 1 }, [
|
|
272
|
+
s.multiple ? (t(), a("div", {
|
|
273
|
+
key: 0,
|
|
274
|
+
class: n(["ev-select-dropbox-item all-check", {
|
|
275
|
+
selected: e.allCheck
|
|
276
|
+
}]),
|
|
277
|
+
onClick: o[10] || (o[10] = u((l) => [e.changeAllCheck(!1), e.changeDropboxPosition()], ["self", "prevent"]))
|
|
278
|
+
}, [
|
|
279
|
+
g(b, {
|
|
280
|
+
modelValue: e.allCheck,
|
|
281
|
+
"onUpdate:modelValue": o[8] || (o[8] = (l) => e.allCheck = l),
|
|
282
|
+
label: s.allCheckLabel,
|
|
283
|
+
onChange: o[9] || (o[9] = (l) => [e.changeAllCheck(!0), e.changeDropboxPosition()])
|
|
284
|
+
}, null, 8, ["modelValue", "label"])
|
|
285
|
+
], 2)) : i("", !0),
|
|
286
|
+
c("div", de, [
|
|
287
|
+
s.multiple ? (t(), K(m, {
|
|
288
|
+
key: 0,
|
|
289
|
+
modelValue: e.mv,
|
|
290
|
+
"onUpdate:modelValue": o[11] || (o[11] = (l) => e.mv = l)
|
|
291
|
+
}, {
|
|
292
|
+
default: C(() => [
|
|
293
|
+
e.filteredItems.length ? (t(), a("ul", re, [
|
|
294
|
+
(t(!0), a(r, null, x(e.filteredItems, (l, d) => (t(), a("li", {
|
|
295
|
+
key: `${l.value}_${d}`,
|
|
296
|
+
class: n(["ev-select-dropbox-item", {
|
|
297
|
+
selected: e.selectedItemClass(l.value),
|
|
298
|
+
disabled: l.disabled
|
|
299
|
+
}]),
|
|
300
|
+
title: l.name,
|
|
301
|
+
onClick: u((f) => l.disabled ? [] : [e.clickItem(l.value), e.changeDropboxPosition()], ["self", "prevent"])
|
|
302
|
+
}, [
|
|
303
|
+
g(b, {
|
|
304
|
+
label: l.value,
|
|
305
|
+
disabled: l.disabled
|
|
306
|
+
}, {
|
|
307
|
+
default: C(() => [
|
|
308
|
+
l.iconClass ? (t(), a("i", {
|
|
309
|
+
key: 0,
|
|
310
|
+
class: n(l.iconClass)
|
|
311
|
+
}, null, 2)) : i("", !0),
|
|
312
|
+
_(" " + v(l.name), 1)
|
|
313
|
+
]),
|
|
314
|
+
_: 2
|
|
315
|
+
}, 1032, ["label", "disabled"])
|
|
316
|
+
], 10, ve))), 128))
|
|
317
|
+
])) : (t(), a("ul", ue, [
|
|
318
|
+
c("li", be, v(s.noMatchingText), 1)
|
|
319
|
+
]))
|
|
320
|
+
]),
|
|
321
|
+
_: 1
|
|
322
|
+
}, 8, ["modelValue"])) : (t(), a(r, { key: 1 }, [
|
|
323
|
+
e.filteredItems.length ? (t(), a("ul", ke, [
|
|
324
|
+
(t(!0), a(r, null, x(e.filteredItems, (l, d) => (t(), a("li", {
|
|
325
|
+
key: `${l.value}_${d}`,
|
|
326
|
+
class: n(["ev-select-dropbox-item", {
|
|
327
|
+
selected: e.selectedItemClass(l.value),
|
|
328
|
+
disabled: l.disabled
|
|
329
|
+
}]),
|
|
330
|
+
title: l.name,
|
|
331
|
+
onClick: u((f) => l.disabled ? [] : [e.clickItem(l.value), e.changeDropboxPosition()], ["stop", "prevent"])
|
|
332
|
+
}, [
|
|
333
|
+
g(b, {
|
|
334
|
+
"model-value": e.mv === l.value,
|
|
335
|
+
disabled: l.disabled
|
|
336
|
+
}, {
|
|
337
|
+
default: C(() => [
|
|
338
|
+
l.iconClass ? (t(), a("i", {
|
|
339
|
+
key: 0,
|
|
340
|
+
class: n(l.iconClass)
|
|
341
|
+
}, null, 2)) : i("", !0),
|
|
342
|
+
_(" " + v(l.name), 1)
|
|
343
|
+
]),
|
|
344
|
+
_: 2
|
|
345
|
+
}, 1032, ["model-value", "disabled"])
|
|
346
|
+
], 10, fe))), 128))
|
|
347
|
+
])) : i("", !0)
|
|
348
|
+
], 64))
|
|
349
|
+
], 512)
|
|
350
|
+
], 64)) : (t(), a("div", xe, [
|
|
351
|
+
e.filteredItems.length ? (t(), a("ul", he, [
|
|
352
|
+
(t(!0), a(r, null, x(e.filteredItems, (l, d) => (t(), a("li", {
|
|
353
|
+
key: `${l.value}_${d}`,
|
|
354
|
+
class: n(["ev-select-dropbox-item", {
|
|
355
|
+
selected: e.selectedItemClass(l.value),
|
|
356
|
+
disabled: l.disabled
|
|
357
|
+
}]),
|
|
358
|
+
title: l.name,
|
|
359
|
+
onClick: u((f) => l.disabled ? [] : [e.clickItem(l.value), e.changeDropboxPosition()], ["stop", "prevent"])
|
|
360
|
+
}, [
|
|
361
|
+
l.iconClass ? (t(), a("i", {
|
|
362
|
+
key: 0,
|
|
363
|
+
class: n(l.iconClass)
|
|
364
|
+
}, null, 2)) : i("", !0),
|
|
365
|
+
_(" " + v(l.name), 1)
|
|
366
|
+
], 10, me))), 128))
|
|
367
|
+
])) : (t(), a("ul", pe, [
|
|
368
|
+
c("li", ye, v(s.noMatchingText), 1)
|
|
369
|
+
]))
|
|
370
|
+
], 512))
|
|
371
|
+
], 4)) : i("", !0)
|
|
372
|
+
])
|
|
373
|
+
], 512)
|
|
374
|
+
], 2)), [
|
|
375
|
+
[p, e.clickOutsideDropbox]
|
|
376
|
+
]);
|
|
377
|
+
}
|
|
378
|
+
const Te = /* @__PURE__ */ Q(X, [["render", ge]]);
|
|
379
|
+
export {
|
|
380
|
+
Te as default
|
|
381
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { getCurrentInstance as A, computed as T, ref as v, reactive as j, watch as y, onMounted as G, onUnmounted as J, nextTick as R } from "vue";
|
|
2
|
+
import { engToKor as N, korToEng as Q, getRegExp as E } from "korean-regexp";
|
|
3
|
+
const le = () => {
|
|
4
|
+
const { props: i, emit: o } = A(), a = {
|
|
5
|
+
get: () => i.items.some((n) => n.value === i.modelValue) ? i.modelValue : null,
|
|
6
|
+
set: (n) => o("update:modelValue", n)
|
|
7
|
+
}, I = {
|
|
8
|
+
get: () => Array.isArray(i.modelValue) ? i.modelValue : [],
|
|
9
|
+
set: (n) => o("update:modelValue", n)
|
|
10
|
+
}, t = T(i.multiple ? I : a), r = () => {
|
|
11
|
+
var n;
|
|
12
|
+
return (n = i.items.find((C) => C.value === t.value)) == null ? void 0 : n.name;
|
|
13
|
+
}, M = () => i.items.filter((n) => i.modelValue.includes(n.value)), p = T(i.multiple ? M : r), h = T(() => i.multiple && t.value.length ? null : i.placeholder), s = () => t.value, w = () => t.value.length, x = T(i.multiple ? w : s), W = () => {
|
|
14
|
+
i.disabled || (i.multiple ? (t.value.splice(0), t.value = [...t.value]) : t.value = null);
|
|
15
|
+
}, d = async () => {
|
|
16
|
+
await R(), o("change", t.value);
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
mv: t,
|
|
20
|
+
selectedModel: p,
|
|
21
|
+
computedPlaceholder: h,
|
|
22
|
+
isClearableIcon: x,
|
|
23
|
+
removeAllMv: W,
|
|
24
|
+
removeMv: async (n) => {
|
|
25
|
+
if (!i.disabled) {
|
|
26
|
+
const C = t.value.indexOf(n);
|
|
27
|
+
t.value.splice(C, 1), t.value = [...t.value], await d();
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
changeMv: d
|
|
31
|
+
};
|
|
32
|
+
}, te = (i) => {
|
|
33
|
+
const { props: o } = A(), { mv: a, changeMv: I } = i, t = v(!1), r = v(o.filterText), M = v(null), p = v(null), h = v(null), s = v(null), w = v("100%"), x = v(null), W = j({
|
|
34
|
+
top: 0
|
|
35
|
+
}), d = T(() => {
|
|
36
|
+
var u;
|
|
37
|
+
if (!r.value || !o.filterable)
|
|
38
|
+
return o.items;
|
|
39
|
+
const e = (u = r.value) == null ? void 0 : u.trim(), l = N(e), f = Q(e);
|
|
40
|
+
return o.items.filter(
|
|
41
|
+
({ name: c }) => c.search(E(e)) > -1 || c.search(E(l)) > -1 || c.search(E(f)) > -1
|
|
42
|
+
);
|
|
43
|
+
}), S = (e) => {
|
|
44
|
+
var l;
|
|
45
|
+
r.value = (l = e == null ? void 0 : e.target) == null ? void 0 : l.value;
|
|
46
|
+
}, n = async () => {
|
|
47
|
+
var c, g, b;
|
|
48
|
+
await R();
|
|
49
|
+
const e = (c = p.value) == null ? void 0 : c.getBoundingClientRect().height, l = (g = p.value) == null ? void 0 : g.getBoundingClientRect().y, f = (b = h.value) == null ? void 0 : b.getBoundingClientRect().height;
|
|
50
|
+
document.documentElement.clientHeight < l + e + f ? W.top = `-${f}px` : W.top = `${e}px`;
|
|
51
|
+
}, C = () => {
|
|
52
|
+
var c, g, b;
|
|
53
|
+
if (!((b = (g = (c = s.value) == null ? void 0 : c.children[0]) == null ? void 0 : g.children) != null && b.length))
|
|
54
|
+
return;
|
|
55
|
+
const e = "selected", l = s.value.children[0].children, f = s.value.offsetTop;
|
|
56
|
+
let u = null;
|
|
57
|
+
for (let k = 0; k < l.length; k++)
|
|
58
|
+
if (u = l[k], u.classList.contains(e)) {
|
|
59
|
+
if (!u.offsetTop)
|
|
60
|
+
return;
|
|
61
|
+
s.value.scrollTop = u.offsetTop - f;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}, D = async () => {
|
|
65
|
+
if (s.value && h.value) {
|
|
66
|
+
await R(), (x.value === null || x.value !== p.value.offsetWidth) && (x.value = p.value.offsetWidth);
|
|
67
|
+
const e = s.value.querySelectorAll(".ev-select-dropbox-item");
|
|
68
|
+
let l = 0;
|
|
69
|
+
e.forEach((_) => {
|
|
70
|
+
const V = _.scrollWidth;
|
|
71
|
+
V > l && (l = V);
|
|
72
|
+
});
|
|
73
|
+
const { borderLeftWidth: f, borderRightWidth: u } = window.getComputedStyle(h.value), c = parseInt(f) + parseInt(u), g = s.value.offsetWidth - s.value.clientWidth;
|
|
74
|
+
l += g + c;
|
|
75
|
+
const b = window.innerWidth, U = h.value.getBoundingClientRect().left, X = b - U - 20, Y = Math.max(Math.min(l, X), x.value);
|
|
76
|
+
w.value = `${Y}px`;
|
|
77
|
+
} else
|
|
78
|
+
w.value = "100%";
|
|
79
|
+
};
|
|
80
|
+
y(
|
|
81
|
+
() => t.value,
|
|
82
|
+
async (e) => {
|
|
83
|
+
e && (await C(), await D());
|
|
84
|
+
}
|
|
85
|
+
), y(
|
|
86
|
+
() => d.value,
|
|
87
|
+
async () => {
|
|
88
|
+
await n();
|
|
89
|
+
}
|
|
90
|
+
), o.filterable && y(
|
|
91
|
+
() => d.value,
|
|
92
|
+
() => n()
|
|
93
|
+
);
|
|
94
|
+
const H = async () => {
|
|
95
|
+
o.items.length && !o.disabled && (t.value = !t.value, t.value && await n());
|
|
96
|
+
}, B = () => {
|
|
97
|
+
o.filterable && (r.value = ""), t.value = !1;
|
|
98
|
+
}, m = v(!1), O = (e) => {
|
|
99
|
+
e || (m.value = !m.value), m.value ? a.value = d.value.filter((l) => !l.disabled).map((l) => l.value) : a.value = [];
|
|
100
|
+
}, z = (e) => {
|
|
101
|
+
o.filterable && (r.value = ""), t.value = !1, a.value !== e && (a.value = e, I());
|
|
102
|
+
}, P = (e) => {
|
|
103
|
+
if (o.filterable && (r.value = ""), !a.value.includes(e))
|
|
104
|
+
a.value.push(e);
|
|
105
|
+
else {
|
|
106
|
+
const l = a.value.indexOf(e);
|
|
107
|
+
a.value.splice(l, 1);
|
|
108
|
+
}
|
|
109
|
+
m.value = a.value.length === d.value.filter((l) => !l.disabled).length, a.value = [...a.value], I();
|
|
110
|
+
}, $ = o.multiple ? P : z, q = (e) => e === a.value, F = (e) => a.value.includes(e), K = o.multiple ? F : q;
|
|
111
|
+
y(
|
|
112
|
+
() => a.value,
|
|
113
|
+
(e) => {
|
|
114
|
+
o.multiple && o.checkable && (e.length === 0 ? m.value = !1 : m.value = e.length === d.value.filter((l) => !l.disabled).length, n());
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
const L = () => {
|
|
118
|
+
t.value && (D(), n());
|
|
119
|
+
};
|
|
120
|
+
return G(() => {
|
|
121
|
+
window.addEventListener("resize", L);
|
|
122
|
+
}), J(() => {
|
|
123
|
+
window.removeEventListener("resize", L);
|
|
124
|
+
}), {
|
|
125
|
+
select: M,
|
|
126
|
+
selectWrapper: p,
|
|
127
|
+
dropbox: h,
|
|
128
|
+
itemWrapper: s,
|
|
129
|
+
isDropbox: t,
|
|
130
|
+
dropboxPosition: W,
|
|
131
|
+
filterTextRef: r,
|
|
132
|
+
filteredItems: d,
|
|
133
|
+
clickSelectInput: H,
|
|
134
|
+
clickOutsideDropbox: B,
|
|
135
|
+
changeFilterText: S,
|
|
136
|
+
changeDropboxPosition: n,
|
|
137
|
+
clickItem: $,
|
|
138
|
+
selectedItemClass: K,
|
|
139
|
+
allCheck: m,
|
|
140
|
+
changeAllCheck: O,
|
|
141
|
+
dropboxWidth: w
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
export {
|
|
145
|
+
te as useDropdown,
|
|
146
|
+
le as useModel
|
|
147
|
+
};
|