ep-craft 0.1.26 → 0.1.28

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.
Files changed (87) hide show
  1. package/dist/components/date-picker/src/date-picker.js +38 -34
  2. package/dist/components/date-picker/src/props.js +19 -7
  3. package/dist/components/form/EpForm.vue.d.ts +61 -0
  4. package/dist/components/form/EpForm.vue.js +199 -0
  5. package/dist/components/form/EpForm2.vue.js +4 -0
  6. package/dist/components/form/index.d.ts +12 -2
  7. package/dist/components/form/index.js +9 -3
  8. package/dist/components/form/instance.d.ts +2 -0
  9. package/dist/components/form/src/form-item.d.ts +103 -0
  10. package/dist/components/form/src/form-item.js +91 -0
  11. package/dist/components/form/src/form-label-wrap.d.ts +11 -0
  12. package/dist/components/form/src/form-label-wrap.js +74 -0
  13. package/dist/components/form/src/form.d.ts +127 -0
  14. package/dist/components/form/src/form.js +112 -0
  15. package/dist/components/form/src/types.d.ts +48 -19
  16. package/dist/components/form/src/utils.d.ts +9 -0
  17. package/dist/components/form/src/utils.js +45 -0
  18. package/dist/components/form-item/EpFormItem.vue.d.ts +55 -0
  19. package/dist/components/form-item/EpFormItem.vue.js +257 -0
  20. package/dist/components/form-item/EpFormItem2.vue.js +4 -0
  21. package/dist/components/form-item/index.d.ts +5 -2
  22. package/dist/components/form-item/index.js +5 -3
  23. package/dist/components/form-item/instance.d.ts +2 -0
  24. package/dist/components/scrollbar/index.d.ts +1 -0
  25. package/dist/components/scrollbar/src/util.d.ts +40 -0
  26. package/dist/components/scrollbar/src/util.js +25 -0
  27. package/dist/components/select/select.vue.d.ts +9 -9
  28. package/dist/components/select/src/useSelect.d.ts +3 -3
  29. package/dist/components/select-v2/index.d.ts +6 -2
  30. package/dist/components/select-v2/index.js +7 -4
  31. package/dist/components/select-v2/src/defaults.d.ts +258 -0
  32. package/dist/components/select-v2/src/defaults.js +359 -0
  33. package/dist/components/select-v2/src/group-item.vue.d.ts +40 -0
  34. package/dist/components/select-v2/src/group-item.vue.js +13 -0
  35. package/dist/components/select-v2/src/group-item2.vue.js +33 -0
  36. package/dist/components/select-v2/src/option-item.vue.d.ts +66 -0
  37. package/dist/components/select-v2/src/option-item.vue.js +37 -0
  38. package/dist/components/select-v2/src/option-item2.vue.js +46 -0
  39. package/dist/components/select-v2/src/select-dropdown.d.ts +53 -0
  40. package/dist/components/select-v2/src/select-dropdown.js +209 -0
  41. package/dist/components/select-v2/src/select.types.d.ts +2 -1
  42. package/dist/components/select-v2/src/select.vue.d.ts +918 -0
  43. package/dist/components/select-v2/src/select.vue.js +388 -0
  44. package/dist/components/select-v2/src/select2.vue.js +86 -0
  45. package/dist/components/select-v2/src/token.d.ts +16 -0
  46. package/dist/components/select-v2/src/token.js +6 -0
  47. package/dist/components/select-v2/src/useAllowCreate.d.ts +8 -0
  48. package/dist/components/select-v2/src/useAllowCreate.js +64 -0
  49. package/dist/components/select-v2/src/useOption.d.ts +7 -0
  50. package/dist/components/select-v2/src/useOption.js +13 -0
  51. package/dist/components/select-v2/src/useProps.d.ts +2 -3
  52. package/dist/components/select-v2/src/useSelect.d.ts +129 -0
  53. package/dist/components/select-v2/src/useSelect.js +501 -0
  54. package/dist/components/time-picker/index.js +10 -11
  55. package/dist/components/time-picker/src/common/picker.vue.d.ts +131 -125
  56. package/dist/components/time-picker/src/common/picker.vue.js +163 -160
  57. package/dist/components/time-picker/src/common/props.d.ts +0 -1
  58. package/dist/components/time-picker/src/common/props.js +13 -14
  59. package/dist/components/time-picker/src/time-picker.d.ts +0 -3
  60. package/dist/components/virtual-list/index.d.ts +8 -0
  61. package/dist/components/virtual-list/src/builders/build-list.d.ts +187 -0
  62. package/dist/components/virtual-list/src/builders/build-list.js +363 -0
  63. package/dist/components/virtual-list/src/components/dynamic-size-list.d.ts +186 -0
  64. package/dist/components/virtual-list/src/components/dynamic-size-list.js +112 -0
  65. package/dist/components/virtual-list/src/components/fixed-size-list.d.ts +185 -0
  66. package/dist/components/virtual-list/src/components/fixed-size-list.js +68 -0
  67. package/dist/components/virtual-list/src/components/scrollbar.d.ts +79 -0
  68. package/dist/components/virtual-list/src/components/scrollbar.js +134 -0
  69. package/dist/components/virtual-list/src/defaults.d.ts +27 -0
  70. package/dist/components/virtual-list/src/defaults.js +26 -0
  71. package/dist/components/virtual-list/src/hooks/use-cache.d.ts +1 -0
  72. package/dist/components/virtual-list/src/hooks/use-cache.js +13 -0
  73. package/dist/components/virtual-list/src/hooks/use-wheel.d.ts +13 -0
  74. package/dist/components/virtual-list/src/hooks/use-wheel.js +26 -0
  75. package/dist/components/virtual-list/src/props.d.ts +211 -0
  76. package/dist/components/virtual-list/src/props.js +151 -0
  77. package/dist/components/virtual-list/src/types.d.ts +152 -0
  78. package/dist/components/virtual-list/src/utils.d.ts +16 -0
  79. package/dist/components/virtual-list/src/utils.js +22 -0
  80. package/dist/hooks/use-float-label/index.d.ts +6 -2
  81. package/dist/hooks/use-float-label/index.js +11 -7
  82. package/dist/index.css +1 -1
  83. package/dist/utils/objects.js +11 -3
  84. package/dist/vendored-components.d.ts +1 -1
  85. package/dist/vendored-components.js +1 -0
  86. package/package.json +3 -1
  87. package/theme-chalk/src/float-label.scss +57 -0
@@ -0,0 +1,388 @@
1
+ import W from "./select2.vue.js";
2
+ import { resolveComponent as S, resolveDirective as Z, withDirectives as P, openBlock as a, createElementBlock as r, normalizeClass as o, createVNode as m, withCtx as i, createSlots as j, renderSlot as d, normalizeProps as q, guardReactiveProps as G, createElementVNode as n, withModifiers as p, toDisplayString as u, createCommentVNode as f, Fragment as H, renderList as N, normalizeStyle as h, createTextVNode as A, createBlock as b, withKeys as v, resolveDynamicComponent as w, vShow as J } from "vue";
3
+ import Q from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const X = ["id", "value", "autocomplete", "tabindex", "aria-expanded", "aria-label", "disabled", "aria-controls", "aria-activedescendant", "readonly", "name"], Y = ["textContent"], c = { key: 1 };
5
+ function x(e, l, _, ee, le, oe) {
6
+ const y = S("el-tag"), k = S("el-tooltip"), C = S("el-icon"), F = S("el-select-menu"), U = Z("click-outside");
7
+ return P((a(), r("div", {
8
+ ref: "selectRef",
9
+ class: o([e.nsSelect.b(), e.nsSelect.m(e.selectSize)]),
10
+ onMouseenter: l[15] || (l[15] = (g) => e.states.inputHovering = !0),
11
+ onMouseleave: l[16] || (l[16] = (g) => e.states.inputHovering = !1)
12
+ }, [
13
+ m(k, {
14
+ ref: "tooltipRef",
15
+ visible: e.dropdownMenuVisible,
16
+ teleported: e.teleported,
17
+ "popper-class": [e.nsSelect.e("popper"), e.popperClass],
18
+ "popper-style": e.popperStyle,
19
+ "gpu-acceleration": !1,
20
+ "stop-popper-mouse-event": !1,
21
+ "popper-options": e.popperOptions,
22
+ "fallback-placements": e.fallbackPlacements,
23
+ effect: e.effect,
24
+ placement: e.placement,
25
+ pure: "",
26
+ transition: `${e.nsSelect.namespace.value}-zoom-in-top`,
27
+ trigger: "click",
28
+ persistent: e.persistent,
29
+ "append-to": e.appendTo,
30
+ "show-arrow": e.showArrow,
31
+ offset: e.offset,
32
+ onBeforeShow: e.handleMenuEnter,
33
+ onHide: l[14] || (l[14] = (g) => e.states.isBeforeHide = !1)
34
+ }, {
35
+ default: i(() => {
36
+ var g;
37
+ return [
38
+ n("div", {
39
+ ref: "wrapperRef",
40
+ class: o([
41
+ e.nsSelect.e("wrapper"),
42
+ e.nsSelect.is("float-label", e.floatLabel),
43
+ e.nsSelect.is("focused", e.isFocused),
44
+ e.nsSelect.is("hovering", e.states.inputHovering),
45
+ e.nsSelect.is("filterable", e.filterable),
46
+ e.nsSelect.is("disabled", e.selectDisabled)
47
+ ]),
48
+ onClick: l[11] || (l[11] = p((...s) => e.toggleMenu && e.toggleMenu(...s), ["prevent"]))
49
+ }, [
50
+ e.floatLabel ? (a(), r("span", {
51
+ key: 0,
52
+ class: o(["el-float-label", e.floatLabelClass])
53
+ }, u(e.floatLabelText), 3)) : f("", !0),
54
+ e.$slots.prefix ? (a(), r("div", {
55
+ key: 1,
56
+ ref: "prefixRef",
57
+ class: o(e.nsSelect.e("prefix"))
58
+ }, [
59
+ d(e.$slots, "prefix")
60
+ ], 2)) : f("", !0),
61
+ n("div", {
62
+ ref: "selectionRef",
63
+ class: o([
64
+ e.nsSelect.e("selection"),
65
+ e.nsSelect.is(
66
+ "near",
67
+ e.multiple && !e.$slots.prefix && !!e.modelValue.length
68
+ )
69
+ ])
70
+ }, [
71
+ e.multiple ? d(e.$slots, "tag", {
72
+ data: e.states.cachedOptions,
73
+ deleteTag: e.deleteTag,
74
+ selectDisabled: e.selectDisabled
75
+ }, () => {
76
+ var s, $, I, V, R, z, D, E, L, M, O, B, K;
77
+ return [
78
+ (a(!0), r(H, null, N(e.showTagList, (t) => (a(), r("div", {
79
+ key: e.getValueKey(e.getValue(t)),
80
+ class: o(e.nsSelect.e("selected-item"))
81
+ }, [
82
+ m(y, {
83
+ closable: !e.selectDisabled && !e.getDisabled(t),
84
+ size: e.collapseTagSize,
85
+ type: e.tagType,
86
+ effect: e.tagEffect,
87
+ "disable-transitions": "",
88
+ style: h(e.tagStyle),
89
+ onClose: (T) => e.deleteTag(T, t)
90
+ }, {
91
+ default: i(() => [
92
+ n("span", {
93
+ class: o(e.nsSelect.e("tags-text"))
94
+ }, [
95
+ d(e.$slots, "label", {
96
+ index: e.getIndex(t),
97
+ label: e.getLabel(t),
98
+ value: e.getValue(t)
99
+ }, () => [
100
+ A(u(e.getLabel(t)), 1)
101
+ ])
102
+ ], 2)
103
+ ]),
104
+ _: 2
105
+ }, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
106
+ ], 2))), 128)),
107
+ e.collapseTags && e.states.cachedOptions.length > e.maxCollapseTags ? (a(), b(k, {
108
+ key: 0,
109
+ ref: "tagTooltipRef",
110
+ disabled: e.dropdownMenuVisible || !e.collapseTagsTooltip,
111
+ "fallback-placements": ((s = e.tagTooltip) == null ? void 0 : s.fallbackPlacements) ?? [
112
+ "bottom",
113
+ "top",
114
+ "right",
115
+ "left"
116
+ ],
117
+ effect: (($ = e.tagTooltip) == null ? void 0 : $.effect) ?? e.effect,
118
+ placement: ((I = e.tagTooltip) == null ? void 0 : I.placement) ?? "bottom",
119
+ "popper-class": ((V = e.tagTooltip) == null ? void 0 : V.popperClass) ?? e.popperClass,
120
+ "popper-style": ((R = e.tagTooltip) == null ? void 0 : R.popperStyle) ?? e.popperStyle,
121
+ teleported: ((z = e.tagTooltip) == null ? void 0 : z.teleported) ?? e.teleported,
122
+ "append-to": ((D = e.tagTooltip) == null ? void 0 : D.appendTo) ?? e.appendTo,
123
+ "popper-options": ((E = e.tagTooltip) == null ? void 0 : E.popperOptions) ?? e.popperOptions,
124
+ transition: (L = e.tagTooltip) == null ? void 0 : L.transition,
125
+ "show-after": (M = e.tagTooltip) == null ? void 0 : M.showAfter,
126
+ "hide-after": (O = e.tagTooltip) == null ? void 0 : O.hideAfter,
127
+ "auto-close": (B = e.tagTooltip) == null ? void 0 : B.autoClose,
128
+ offset: (K = e.tagTooltip) == null ? void 0 : K.offset
129
+ }, {
130
+ default: i(() => [
131
+ n("div", {
132
+ ref: "collapseItemRef",
133
+ class: o(e.nsSelect.e("selected-item"))
134
+ }, [
135
+ m(y, {
136
+ closable: !1,
137
+ size: e.collapseTagSize,
138
+ type: e.tagType,
139
+ effect: e.tagEffect,
140
+ style: h(e.collapseTagStyle),
141
+ "disable-transitions": ""
142
+ }, {
143
+ default: i(() => [
144
+ n("span", {
145
+ class: o(e.nsSelect.e("tags-text"))
146
+ }, " + " + u(e.states.cachedOptions.length - e.maxCollapseTags), 3)
147
+ ]),
148
+ _: 1
149
+ }, 8, ["size", "type", "effect", "style"])
150
+ ], 2)
151
+ ]),
152
+ content: i(() => [
153
+ n("div", {
154
+ ref: "tagMenuRef",
155
+ class: o(e.nsSelect.e("selection"))
156
+ }, [
157
+ (a(!0), r(H, null, N(e.collapseTagList, (t) => (a(), r("div", {
158
+ key: e.getValueKey(e.getValue(t)),
159
+ class: o(e.nsSelect.e("selected-item"))
160
+ }, [
161
+ m(y, {
162
+ class: "in-tooltip",
163
+ closable: !e.selectDisabled && !e.getDisabled(t),
164
+ size: e.collapseTagSize,
165
+ type: e.tagType,
166
+ effect: e.tagEffect,
167
+ "disable-transitions": "",
168
+ onClose: (T) => e.deleteTag(T, t)
169
+ }, {
170
+ default: i(() => [
171
+ n("span", {
172
+ class: o(e.nsSelect.e("tags-text"))
173
+ }, [
174
+ d(e.$slots, "label", {
175
+ index: e.getIndex(t),
176
+ label: e.getLabel(t),
177
+ value: e.getValue(t)
178
+ }, () => [
179
+ A(u(e.getLabel(t)), 1)
180
+ ])
181
+ ], 2)
182
+ ]),
183
+ _: 2
184
+ }, 1032, ["closable", "size", "type", "effect", "onClose"])
185
+ ], 2))), 128))
186
+ ], 2)
187
+ ]),
188
+ _: 3
189
+ }, 8, ["disabled", "fallback-placements", "effect", "placement", "popper-class", "popper-style", "teleported", "append-to", "popper-options", "transition", "show-after", "hide-after", "auto-close", "offset"])) : f("", !0)
190
+ ];
191
+ }, void 0, 0) : f("", !0),
192
+ n("div", {
193
+ class: o([
194
+ e.nsSelect.e("selected-item"),
195
+ e.nsSelect.e("input-wrapper"),
196
+ e.nsSelect.is(
197
+ "hidden",
198
+ !e.filterable || e.selectDisabled || e.multiple && !e.states.inputValue && !e.isFocused
199
+ )
200
+ ])
201
+ }, [
202
+ n("input", {
203
+ id: e.inputId,
204
+ ref: "inputRef",
205
+ value: e.states.inputValue,
206
+ style: h(e.inputStyle),
207
+ autocomplete: e.autocomplete,
208
+ tabindex: e.tabindex,
209
+ "aria-autocomplete": "none",
210
+ "aria-haspopup": "listbox",
211
+ autocapitalize: "off",
212
+ "aria-expanded": e.expanded,
213
+ "aria-label": e.ariaLabel,
214
+ class: o([e.nsSelect.e("input"), e.nsSelect.is(e.selectSize)]),
215
+ disabled: e.selectDisabled,
216
+ role: "combobox",
217
+ "aria-controls": e.contentId,
218
+ "aria-activedescendant": e.states.hoveringIndex >= 0 ? `${e.contentId}-${e.states.hoveringIndex}` : "",
219
+ readonly: !e.filterable,
220
+ spellcheck: "false",
221
+ type: "text",
222
+ name: e.name,
223
+ onInput: l[0] || (l[0] = (...s) => e.onInput && e.onInput(...s)),
224
+ onChange: l[1] || (l[1] = p(() => {
225
+ }, ["stop"])),
226
+ onCompositionstart: l[2] || (l[2] = (...s) => e.handleCompositionStart && e.handleCompositionStart(...s)),
227
+ onCompositionupdate: l[3] || (l[3] = (...s) => e.handleCompositionUpdate && e.handleCompositionUpdate(...s)),
228
+ onCompositionend: l[4] || (l[4] = (...s) => e.handleCompositionEnd && e.handleCompositionEnd(...s)),
229
+ onKeydown: [
230
+ l[5] || (l[5] = v(p((s) => e.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"])),
231
+ l[6] || (l[6] = v(p((s) => e.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"])),
232
+ l[7] || (l[7] = v(p((...s) => e.onKeyboardSelect && e.onKeyboardSelect(...s), ["stop", "prevent"]), ["enter"])),
233
+ l[8] || (l[8] = v(p((...s) => e.handleEsc && e.handleEsc(...s), ["stop", "prevent"]), ["esc"])),
234
+ l[9] || (l[9] = v(p((...s) => e.handleDel && e.handleDel(...s), ["stop"]), ["delete"]))
235
+ ],
236
+ onClick: l[10] || (l[10] = p((...s) => e.toggleMenu && e.toggleMenu(...s), ["stop"]))
237
+ }, null, 46, X),
238
+ e.filterable ? (a(), r("span", {
239
+ key: 0,
240
+ ref: "calculatorRef",
241
+ "aria-hidden": "true",
242
+ class: o(e.nsSelect.e("input-calculator")),
243
+ textContent: u(e.states.inputValue)
244
+ }, null, 10, Y)) : f("", !0)
245
+ ], 2),
246
+ e.shouldShowPlaceholder ? (a(), r("div", {
247
+ key: 1,
248
+ class: o([
249
+ e.nsSelect.e("selected-item"),
250
+ e.nsSelect.e("placeholder"),
251
+ e.nsSelect.is(
252
+ "transparent",
253
+ !e.hasModelValue || e.expanded && !e.states.inputValue
254
+ )
255
+ ])
256
+ }, [
257
+ e.hasModelValue ? d(e.$slots, "label", {
258
+ index: ((g = e.allOptionsValueMap.get(e.modelValue)) == null ? void 0 : g.index) ?? -1,
259
+ label: e.currentPlaceholder,
260
+ value: e.modelValue
261
+ }, () => [
262
+ n("span", null, u(e.currentPlaceholder), 1)
263
+ ], void 0, 0) : e.floatLabel ? f("", !0) : (a(), r("span", c, u(e.currentPlaceholder), 1))
264
+ ], 2)) : f("", !0)
265
+ ], 2),
266
+ n("div", {
267
+ ref: "suffixRef",
268
+ class: o(e.nsSelect.e("suffix"))
269
+ }, [
270
+ e.iconComponent ? P((a(), b(C, {
271
+ key: 0,
272
+ class: o([e.nsSelect.e("caret"), e.nsInput.e("icon"), e.iconReverse])
273
+ }, {
274
+ default: i(() => [
275
+ (a(), b(w(e.iconComponent)))
276
+ ]),
277
+ _: 1
278
+ }, 8, ["class"])), [
279
+ [J, !e.showClearBtn]
280
+ ]) : f("", !0),
281
+ e.showClearBtn && e.clearIcon ? (a(), b(C, {
282
+ key: 1,
283
+ class: o([
284
+ e.nsSelect.e("caret"),
285
+ e.nsInput.e("icon"),
286
+ e.nsSelect.e("clear")
287
+ ]),
288
+ onClick: p(e.handleClear, ["prevent", "stop"])
289
+ }, {
290
+ default: i(() => [
291
+ (a(), b(w(e.clearIcon)))
292
+ ]),
293
+ _: 1
294
+ }, 8, ["class", "onClick"])) : f("", !0),
295
+ e.validateState && e.validateIcon && e.needStatusIcon ? (a(), b(C, {
296
+ key: 2,
297
+ class: o([
298
+ e.nsInput.e("icon"),
299
+ e.nsInput.e("validateIcon"),
300
+ e.nsInput.is("loading", e.validateState === "validating")
301
+ ])
302
+ }, {
303
+ default: i(() => [
304
+ (a(), b(w(e.validateIcon)))
305
+ ]),
306
+ _: 1
307
+ }, 8, ["class"])) : f("", !0)
308
+ ], 2)
309
+ ], 2)
310
+ ];
311
+ }),
312
+ content: i(() => [
313
+ m(F, {
314
+ id: e.contentId,
315
+ ref: "menuRef",
316
+ data: e.filteredOptions,
317
+ width: e.popperSize - e.BORDER_HORIZONTAL_WIDTH,
318
+ "hovering-index": e.states.hoveringIndex,
319
+ "scrollbar-always-on": e.scrollbarAlwaysOn,
320
+ "aria-label": e.ariaLabel,
321
+ onEndReached: e.onEndReached
322
+ }, j({
323
+ default: i((g) => [
324
+ d(e.$slots, "default", q(G(g)))
325
+ ]),
326
+ _: 2
327
+ }, [
328
+ e.$slots.header ? {
329
+ name: "header",
330
+ fn: i(() => [
331
+ n("div", {
332
+ class: o(e.nsSelect.be("dropdown", "header")),
333
+ onClick: l[12] || (l[12] = p(() => {
334
+ }, ["stop"]))
335
+ }, [
336
+ d(e.$slots, "header")
337
+ ], 2)
338
+ ]),
339
+ key: "0"
340
+ } : void 0,
341
+ e.$slots.loading && e.loading ? {
342
+ name: "loading",
343
+ fn: i(() => [
344
+ n("div", {
345
+ class: o(e.nsSelect.be("dropdown", "loading"))
346
+ }, [
347
+ d(e.$slots, "loading")
348
+ ], 2)
349
+ ]),
350
+ key: "1"
351
+ } : e.loading || e.filteredOptions.length === 0 ? {
352
+ name: "empty",
353
+ fn: i(() => [
354
+ n("div", {
355
+ class: o(e.nsSelect.be("dropdown", "empty"))
356
+ }, [
357
+ d(e.$slots, "empty", {}, () => [
358
+ n("span", null, u(e.emptyText), 1)
359
+ ])
360
+ ], 2)
361
+ ]),
362
+ key: "2"
363
+ } : void 0,
364
+ e.$slots.footer ? {
365
+ name: "footer",
366
+ fn: i(() => [
367
+ n("div", {
368
+ class: o(e.nsSelect.be("dropdown", "footer")),
369
+ onClick: l[13] || (l[13] = p(() => {
370
+ }, ["stop"]))
371
+ }, [
372
+ d(e.$slots, "footer")
373
+ ], 2)
374
+ ]),
375
+ key: "3"
376
+ } : void 0
377
+ ]), 1032, ["id", "data", "width", "hovering-index", "scrollbar-always-on", "aria-label", "onEndReached"])
378
+ ]),
379
+ _: 3
380
+ }, 8, ["visible", "teleported", "popper-class", "popper-style", "popper-options", "fallback-placements", "effect", "placement", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow"])
381
+ ], 34)), [
382
+ [U, e.handleClickOutside, e.popperRef]
383
+ ]);
384
+ }
385
+ const te = /* @__PURE__ */ Q(W, [["render", x]]);
386
+ export {
387
+ te as default
388
+ };
@@ -0,0 +1,86 @@
1
+ import { defineComponent as L, computed as i, reactive as p, toRefs as s, toRef as h, provide as I } from "vue";
2
+ import { isArray as V } from "@vue/shared";
3
+ import "lodash-unified";
4
+ import "@vueuse/core";
5
+ import { BORDER_HORIZONTAL_WIDTH as v } from "../../../constants/form.js";
6
+ import "@element-plus/icons-vue";
7
+ import R from "../../../directives/click-outside/index.js";
8
+ import "normalize-wheel-es";
9
+ import { EpTooltip as S } from "../../tooltip/index.js";
10
+ import { EpTag as g } from "../../tag/index.js";
11
+ import { EpIcon as y } from "../../icon/index.js";
12
+ import { useLocale as T } from "../../../hooks/use-locale/index.js";
13
+ import { useId as H } from "../../../hooks/use-id/index.js";
14
+ import "../../../hooks/use-size/index.js";
15
+ import "@popperjs/core";
16
+ import "../../../hooks/use-z-index/index.js";
17
+ import "../../../hooks/use-delayed-toggle/index.js";
18
+ import "../../../hooks/use-aria/index.js";
19
+ import "../../../hooks/use-model-toggle/index.js";
20
+ import "../../../hooks/use-empty-values/index.js";
21
+ import { useCalcInputWidth as K } from "../../../hooks/use-calc-input-width/index.js";
22
+ import { useFloatLabel as O } from "../../../hooks/use-float-label/index.js";
23
+ import x from "./select-dropdown.js";
24
+ import C from "./useSelect.js";
25
+ import { selectV2Emits as D, selectV2Props as _ } from "./defaults.js";
26
+ import { selectV2InjectionKey as A } from "./token.js";
27
+ const me = L({
28
+ name: "EpSelectV2",
29
+ components: {
30
+ ElSelectMenu: x,
31
+ ElTag: g,
32
+ ElTooltip: S,
33
+ ElIcon: y
34
+ },
35
+ directives: { ClickOutside: R },
36
+ props: _,
37
+ emits: D,
38
+ setup(o, { emit: c }) {
39
+ const l = i(() => {
40
+ const { modelValue: t, multiple: r } = o, m = r ? [] : void 0;
41
+ return V(t) ? r ? t : m : r ? m : t;
42
+ }), e = C(
43
+ p({
44
+ ...s(o),
45
+ modelValue: l
46
+ }),
47
+ c
48
+ ), { floatLabelClass: n } = O({
49
+ floatLabel: h(o, "floatLabel"),
50
+ isFocused: e.isFocused,
51
+ hasValue: e.hasModelValue,
52
+ isDisabled: e.selectDisabled
53
+ }), { t: d } = T(), f = i(
54
+ () => o.placeholder ?? d("el.select.placeholder")
55
+ ), { calculatorRef: u, inputStyle: b } = K(), a = H();
56
+ I(A, {
57
+ props: p({
58
+ ...s(o),
59
+ height: e.popupHeight,
60
+ modelValue: l
61
+ }),
62
+ expanded: e.expanded,
63
+ tooltipRef: e.tooltipRef,
64
+ contentId: a,
65
+ onSelect: e.onSelect,
66
+ onHover: e.onHover,
67
+ onKeyboardNavigate: e.onKeyboardNavigate,
68
+ onKeyboardSelect: e.onKeyboardSelect
69
+ });
70
+ const E = i(() => o.multiple ? e.states.cachedOptions.map((t) => e.getLabel(t)) : e.states.selectedLabel);
71
+ return {
72
+ ...e,
73
+ modelValue: l,
74
+ selectedLabel: E,
75
+ floatLabelClass: n,
76
+ floatLabelText: f,
77
+ calculatorRef: u,
78
+ inputStyle: b,
79
+ contentId: a,
80
+ BORDER_HORIZONTAL_WIDTH: v
81
+ };
82
+ }
83
+ });
84
+ export {
85
+ me as default
86
+ };
@@ -0,0 +1,16 @@
1
+ import type { OptionV2Props, SelectV2Instance, SelectV2Props } from './defaults';
2
+ import type { InjectionKey, Ref } from 'vue';
3
+ import type { Option } from './select.types';
4
+ import type { TooltipInstance } from '@element-plus/components/tooltip';
5
+ export interface SelectV2Context {
6
+ props: SelectV2Props;
7
+ expanded: Ref<boolean>;
8
+ tooltipRef: Ref<TooltipInstance | undefined>;
9
+ contentId: Ref<string>;
10
+ onSelect: (option: Option) => void;
11
+ onHover: (idx?: number) => void;
12
+ onKeyboardNavigate: (direction: 'forward' | 'backward') => void;
13
+ onKeyboardSelect: () => void;
14
+ }
15
+ export declare const selectV2InjectionKey: InjectionKey<SelectV2Context>;
16
+ export type { SelectV2Instance, OptionV2Props, SelectV2Props };
@@ -0,0 +1,6 @@
1
+ const e = Symbol(
2
+ "ElSelectV2Injection"
3
+ );
4
+ export {
5
+ e as selectV2InjectionKey
6
+ };
@@ -0,0 +1,8 @@
1
+ import type { SelectV2Props } from './token';
2
+ import type { Option, SelectStates } from './select.types';
3
+ export declare function useAllowCreate(props: SelectV2Props, states: SelectStates): {
4
+ createNewOption: (query: string) => void;
5
+ removeNewOption: (option: Option) => void;
6
+ selectNewOption: (option: Option) => void;
7
+ clearAllNewOption: () => void;
8
+ };
@@ -0,0 +1,64 @@
1
+ import { ref as f, computed as m, watch as w } from "vue";
2
+ import { useProps as g } from "./useProps.js";
3
+ function C(i, t) {
4
+ const { aliasProps: r, getLabel: c, getValue: u } = g(i), o = f(0), d = f(), a = m(() => i.allowCreate && i.filterable);
5
+ w(
6
+ () => i.options,
7
+ (e) => {
8
+ const n = new Set(e.map((l) => c(l)));
9
+ t.createdOptions = t.createdOptions.filter(
10
+ (l) => !n.has(c(l))
11
+ );
12
+ }
13
+ );
14
+ function O(e) {
15
+ const n = (l) => c(l) === e;
16
+ return i.options && i.options.some(n) || t.createdOptions.some(n);
17
+ }
18
+ function p(e) {
19
+ a.value && (i.multiple && e.created ? o.value++ : d.value = e);
20
+ }
21
+ function v(e) {
22
+ if (a.value)
23
+ if (e && e.length > 0) {
24
+ if (O(e)) {
25
+ t.createdOptions = t.createdOptions.filter(
26
+ (l) => c(l) !== t.previousQuery
27
+ );
28
+ return;
29
+ }
30
+ const n = {
31
+ [r.value.value]: e,
32
+ [r.value.label]: e,
33
+ created: !0,
34
+ [r.value.disabled]: !1
35
+ };
36
+ t.createdOptions.length >= o.value ? t.createdOptions[o.value] = n : t.createdOptions.push(n);
37
+ } else if (i.multiple)
38
+ t.createdOptions.length = o.value;
39
+ else {
40
+ const n = d.value;
41
+ t.createdOptions.length = 0, n && n.created && t.createdOptions.push(n);
42
+ }
43
+ }
44
+ function s(e) {
45
+ if (!a.value || !e || !e.created || e.created && i.reserveKeyword && t.inputValue === c(e))
46
+ return;
47
+ const n = t.createdOptions.findIndex(
48
+ (l) => u(l) === u(e)
49
+ );
50
+ ~n && (t.createdOptions.splice(n, 1), o.value--);
51
+ }
52
+ function h() {
53
+ a.value && (t.createdOptions.length = 0, o.value = 0);
54
+ }
55
+ return {
56
+ createNewOption: v,
57
+ removeNewOption: s,
58
+ selectNewOption: p,
59
+ clearAllNewOption: h
60
+ };
61
+ }
62
+ export {
63
+ C as useAllowCreate
64
+ };
@@ -0,0 +1,7 @@
1
+ import type { OptionV2EmitFn, OptionV2Props } from './defaults';
2
+ export declare function useOption(props: OptionV2Props, { emit }: {
3
+ emit: OptionV2EmitFn;
4
+ }): {
5
+ hoverItem: () => void;
6
+ selectOptionClick: () => void;
7
+ };
@@ -0,0 +1,13 @@
1
+ function t(e, { emit: i }) {
2
+ return {
3
+ hoverItem: () => {
4
+ e.disabled || i("hover", e.index);
5
+ },
6
+ selectOptionClick: () => {
7
+ e.disabled || i("select", e.item, e.index);
8
+ }
9
+ };
10
+ }
11
+ export {
12
+ t as useOption
13
+ };
@@ -1,3 +1,4 @@
1
+ import type { SelectV2Props } from './token';
1
2
  import type { Option } from './select.types';
2
3
  export interface Props {
3
4
  label?: string;
@@ -6,9 +7,7 @@ export interface Props {
6
7
  options?: string;
7
8
  }
8
9
  export declare const defaultProps: Required<Props>;
9
- export declare function useProps(props: {
10
- props?: Props;
11
- }): {
10
+ export declare function useProps(props: Pick<SelectV2Props, 'props'>): {
12
11
  aliasProps: import("vue").Ref<{
13
12
  label: string;
14
13
  value: string;