@dazhicheng/ui 1.4.14 → 1.4.15

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 (71) hide show
  1. package/dist/components/tt-form-adapter/component/index.d.ts +1 -1
  2. package/dist/components/tt-form-adapter/component/index.d.ts.map +1 -1
  3. package/dist/components/tt-form-adapter/index.d.ts.map +1 -1
  4. package/dist/components/tt-icon/index.d.ts +6 -6
  5. package/dist/components/tt-icon/index.d.ts.map +1 -1
  6. package/dist/components/tt-icon/index.vue.d.ts +3 -3
  7. package/dist/components/tt-icon/index.vue.d.ts.map +1 -1
  8. package/dist/components/tt-image/src/components/ImageViewer.d.ts +1 -1
  9. package/dist/components/tt-modal/src/RenderModal.vue.d.ts.map +1 -1
  10. package/dist/components/tt-table/src/Table.vue.d.ts +7 -9
  11. package/dist/components/tt-table/src/Table.vue.d.ts.map +1 -1
  12. package/dist/components/tt-table/src/components/TableColumnModal.vue.d.ts +27 -0
  13. package/dist/components/tt-table/src/components/TableColumnModal.vue.d.ts.map +1 -0
  14. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +1552 -7
  15. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts.map +1 -1
  16. package/dist/components/tt-table/src/hooks/useColumns.d.ts +0 -4
  17. package/dist/components/tt-table/src/hooks/useColumns.d.ts.map +1 -1
  18. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +20 -0
  19. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts.map +1 -0
  20. package/dist/components/tt-table/src/hooks/useTable.d.ts.map +1 -1
  21. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +2 -3
  22. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts.map +1 -1
  23. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +10 -1
  24. package/dist/components/tt-table/src/hooks/useTableRender.d.ts.map +1 -1
  25. package/dist/components/tt-table/src/props.d.ts +1 -1
  26. package/dist/components/tt-table/src/toolProps.d.ts +0 -60
  27. package/dist/components/tt-table/src/toolProps.d.ts.map +1 -1
  28. package/dist/components/tt-table/src/types/table.d.ts +13 -8
  29. package/dist/components/tt-table/src/types/table.d.ts.map +1 -1
  30. package/dist/components/tt-table/src/types/tableTools.d.ts +1 -45
  31. package/dist/components/tt-table/src/types/tableTools.d.ts.map +1 -1
  32. package/dist/components/tt-table/src/utils/table-api.d.ts +1 -1
  33. package/dist/components/types.d.ts +9 -0
  34. package/dist/components/types.d.ts.map +1 -1
  35. package/dist/{css-CKklk3nV.js → css-BizbCFH3.js} +1 -0
  36. package/dist/css-DhJ-Bn4t.js +4 -0
  37. package/dist/{event-CRLYHSpv.js → event-DFRZD7LK.js} +1 -1
  38. package/dist/{icon-D7uEJbj1.js → icon-D7yoP9ir.js} +2 -2
  39. package/dist/{index-D0IHErAs.js → index-BKQp009w.js} +22 -16
  40. package/dist/{index-lcTqqAHV.js → index-BNG_AB7y.js} +8 -8
  41. package/dist/{index-LwQmtsvY.js → index-BhA_CsrH.js} +1 -1
  42. package/dist/index-BxInQxCV.js +2502 -0
  43. package/dist/{index-oWr7FvHH.js → index-By5cqZnL.js} +6 -6
  44. package/dist/{index-CPbbaIQc.js → index-ByEUv7a2.js} +20 -20
  45. package/dist/{index-BPAF_VnM.js → index-CGcdoMJn.js} +7 -7
  46. package/dist/{index-CluCT7Mm.js → index-CJS0mCv6.js} +1 -1
  47. package/dist/{index-BIBy0DdB.js → index-CrIIQxqW.js} +5 -5
  48. package/dist/{index-CBTogxcz.js → index-D3Ax_E0B.js} +1 -1
  49. package/dist/{index-BwUPEK34.js → index-D9W_gSi5.js} +2 -2
  50. package/dist/index-DEFw7uAt.js +3559 -0
  51. package/dist/{index-BD10znQT.js → index-Dfotp4tT.js} +5 -5
  52. package/dist/{index-BXG36tZ-.js → index-DpN6iVOJ.js} +6 -6
  53. package/dist/{index-Bod7doXW.js → index-V1pYlrHZ.js} +121 -121
  54. package/dist/{index-Ctbxly20.js → index-VEk4bikw.js} +5 -5
  55. package/dist/{index-YaBtguVL.js → index-WNukMwgV.js} +11761 -10474
  56. package/dist/index-YgAUM4hl.js +436 -0
  57. package/dist/{index-C-7vG864.js → index-jX-ESk9T.js} +2 -2
  58. package/dist/index.js +11 -11
  59. package/dist/panel-time-pick.vue2-CTavHx-6.js +1603 -0
  60. package/dist/style.css +1 -1
  61. package/dist/{use-form-common-props-D8bK4KUX.js → use-form-common-props-QWQdZzPI.js} +1 -1
  62. package/dist/{use-form-item-Bzpa4RlP.js → use-form-item-aIqGB1on.js} +2 -2
  63. package/dist/useProps-B1w2fNNy.js +215 -0
  64. package/dist/{util-DjnYC4OO.js → util-Boou02y4.js} +6 -6
  65. package/package.json +4 -3
  66. package/dist/components/tt-table/src/TableForm.vue.d.ts +0 -150
  67. package/dist/components/tt-table/src/TableForm.vue.d.ts.map +0 -1
  68. package/dist/components/tt-table/src/hooks/useFullscreen.d.ts +0 -12
  69. package/dist/components/tt-table/src/hooks/useFullscreen.d.ts.map +0 -1
  70. package/dist/index-Dz7KMhiX.js +0 -2700
  71. package/dist/panel-time-pick.vue2-D2Vh8Qtc.js +0 -2026
@@ -1,2700 +0,0 @@
1
- import { shallowRef as cn, ref as N, computed as g, defineComponent as Ve, createElementBlock as le, createBlock as ye, openBlock as D, normalizeStyle as Te, normalizeClass as R, createElementVNode as H, createCommentVNode as ve, unref as I, renderSlot as oe, withModifiers as te, createVNode as J, withCtx as q, Transition as dn, toDisplayString as he, watch as pe, inject as el, getCurrentInstance as tl, reactive as xe, onBeforeUnmount as fn, h as Oe, resolveDynamicComponent as Ae, Fragment as dt, mergeProps as ft, onMounted as ll, onUpdated as mn, onActivated as vn, nextTick as re, toRaw as pn, useSlots as hn, watchEffect as Kt, toRefs as Gt, provide as gn, resolveComponent as Ze, resolveDirective as bn, withDirectives as qt, createSlots as yn, normalizeProps as Sn, guardReactiveProps as wn, renderList as Ut, createTextVNode as jt, withKeys as Be, vShow as On } from "vue";
2
- import { _ as It, u as In, a as Ye, E as Tn, B as Vn, b as En, c as Cn } from "./util-DjnYC4OO.js";
3
- import { b as Ee, k as Mn, h as nl, w as ol, a as Z, u as Rn, l as zn, e as Ie, q as Ce, t as al, g as sl, j as Ln, d as ut, p as Nn } from "./use-form-common-props-D8bK4KUX.js";
4
- import { E as mt } from "./index-D0IHErAs.js";
5
- import { d as ge, s as Qt, C as il, U as rl, e as kn, c as $n, g as vt, q as Dn, o as Fe, a as Se, i as Xe, G as Bn } from "./index-YaBtguVL.js";
6
- import { u as ul } from "./index-BQfVaV7A.js";
7
- import { isEqual as Re, get as ue, memoize as An, findLastIndex as Fn } from "lodash-es";
8
- import { u as Pn } from "./index-CBTogxcz.js";
9
- import { i as Zt, V as Hn } from "./icon-D7uEJbj1.js";
10
- import { useResizeObserver as we, isClient as Tt, useEventListener as Wn, isIOS as Kn, useDebounceFn as Gn } from "@vueuse/core";
11
- import { a as qn, b as Un, u as jn } from "./index-C-7vG864.js";
12
- import { m as Qn } from "./typescript-BpuhIBuJ.js";
13
- import { g as cl, E as dl } from "./event-CRLYHSpv.js";
14
- import { u as Zn, a as Yn, b as Xn } from "./use-form-item-Bzpa4RlP.js";
15
- import { C as Jn } from "./index-BwUPEK34.js";
16
- const fl = 11, xn = 2;
17
- function _n() {
18
- const e = cn(), t = N(0), n = g(() => ({
19
- minWidth: `${Math.max(t.value, fl)}px`
20
- }));
21
- return we(e, () => {
22
- var r, f;
23
- t.value = (f = (r = e.value) == null ? void 0 : r.getBoundingClientRect().width) != null ? f : 0;
24
- }), {
25
- calculatorRef: e,
26
- calculatorWidth: t,
27
- inputStyle: n
28
- };
29
- }
30
- const ml = (e) => Tt ? window.requestAnimationFrame(e) : setTimeout(e, 16), vl = (e) => Tt ? window.cancelAnimationFrame(e) : clearTimeout(e), pt = Ee({
31
- /**
32
- * @description type of Tag
33
- */
34
- type: {
35
- type: String,
36
- values: ["primary", "success", "info", "warning", "danger"],
37
- default: "primary"
38
- },
39
- /**
40
- * @description whether Tag can be removed
41
- */
42
- closable: Boolean,
43
- /**
44
- * @description whether to disable animations
45
- */
46
- disableTransitions: Boolean,
47
- /**
48
- * @description whether Tag has a highlighted border
49
- */
50
- hit: Boolean,
51
- /**
52
- * @description background color of the Tag
53
- */
54
- color: String,
55
- /**
56
- * @description size of Tag
57
- */
58
- size: {
59
- type: String,
60
- values: Mn
61
- },
62
- /**
63
- * @description theme of Tag
64
- */
65
- effect: {
66
- type: String,
67
- values: ["dark", "light", "plain"],
68
- default: "light"
69
- },
70
- /**
71
- * @description whether Tag is rounded
72
- */
73
- round: Boolean
74
- }), eo = {
75
- close: (e) => e instanceof MouseEvent,
76
- click: (e) => e instanceof MouseEvent
77
- }, to = ["aria-label"], lo = ["aria-label"];
78
- var no = /* @__PURE__ */ Ve({
79
- name: "ElTag",
80
- __name: "tag",
81
- props: pt,
82
- emits: eo,
83
- setup(e, { emit: t }) {
84
- const n = e, o = t, r = nl(), { t: f } = ul(), u = ge("tag"), m = g(() => {
85
- const { type: c, hit: T, effect: d, closable: E, round: M } = n;
86
- return [
87
- u.b(),
88
- u.is("closable", E),
89
- u.m(c || "primary"),
90
- u.m(r.value),
91
- u.m(d),
92
- u.is("hit", T),
93
- u.is("round", M)
94
- ];
95
- }), b = (c) => {
96
- o("close", c);
97
- }, S = (c) => {
98
- o("click", c);
99
- }, i = (c) => {
100
- var T, d, E;
101
- (E = (d = (T = c == null ? void 0 : c.component) == null ? void 0 : T.subTree) == null ? void 0 : d.component) != null && E.bum && (c.component.subTree.component.bum = null);
102
- };
103
- return (c, T) => e.disableTransitions ? (D(), le(
104
- "span",
105
- {
106
- key: 0,
107
- class: R(m.value),
108
- style: Te({ backgroundColor: e.color }),
109
- onClick: S
110
- },
111
- [
112
- H(
113
- "span",
114
- {
115
- class: R(I(u).e("content"))
116
- },
117
- [
118
- oe(c.$slots, "default")
119
- ],
120
- 2
121
- /* CLASS */
122
- ),
123
- e.closable ? (D(), le("button", {
124
- key: 0,
125
- "aria-label": I(f)("el.tag.close"),
126
- class: R(I(u).e("close")),
127
- type: "button",
128
- onClick: te(b, ["stop"])
129
- }, [
130
- J(I(mt), null, {
131
- default: q(() => [
132
- J(I(Qt))
133
- ]),
134
- _: 1
135
- /* STABLE */
136
- })
137
- ], 10, to)) : ve("v-if", !0)
138
- ],
139
- 6
140
- /* CLASS, STYLE */
141
- )) : (D(), ye(dn, {
142
- key: 1,
143
- name: `${I(u).namespace.value}-zoom-in-center`,
144
- appear: "",
145
- onVnodeMounted: i
146
- }, {
147
- default: q(() => [
148
- H(
149
- "span",
150
- {
151
- class: R(m.value),
152
- style: Te({ backgroundColor: e.color }),
153
- onClick: S
154
- },
155
- [
156
- H(
157
- "span",
158
- {
159
- class: R(I(u).e("content"))
160
- },
161
- [
162
- oe(c.$slots, "default")
163
- ],
164
- 2
165
- /* CLASS */
166
- ),
167
- e.closable ? (D(), le("button", {
168
- key: 0,
169
- "aria-label": I(f)("el.tag.close"),
170
- class: R(I(u).e("close")),
171
- type: "button",
172
- onClick: te(b, ["stop"])
173
- }, [
174
- J(I(mt), null, {
175
- default: q(() => [
176
- J(I(Qt))
177
- ]),
178
- _: 1
179
- /* STABLE */
180
- })
181
- ], 10, lo)) : ve("v-if", !0)
182
- ],
183
- 6
184
- /* CLASS, STYLE */
185
- )
186
- ]),
187
- _: 3
188
- /* FORWARDED */
189
- }, 8, ["name"]));
190
- }
191
- });
192
- const oo = ol(no);
193
- var ao = Ve({
194
- props: {
195
- item: {
196
- type: Object,
197
- required: !0
198
- },
199
- style: {
200
- type: Object
201
- },
202
- height: Number
203
- },
204
- setup() {
205
- return {
206
- ns: ge("select")
207
- };
208
- }
209
- });
210
- function so(e, t, n, o, r, f) {
211
- return D(), le(
212
- "div",
213
- {
214
- class: R(e.ns.be("group", "title")),
215
- style: Te({ ...e.style, lineHeight: `${e.height}px` })
216
- },
217
- he(e.item.label),
218
- 7
219
- /* TEXT, CLASS, STYLE */
220
- );
221
- }
222
- var io = /* @__PURE__ */ It(ao, [["render", so]]);
223
- function ro(e, { emit: t }) {
224
- return {
225
- hoverItem: () => {
226
- e.disabled || t("hover", e.index);
227
- },
228
- selectOptionClick: () => {
229
- e.disabled || t("select", e.item, e.index);
230
- }
231
- };
232
- }
233
- const ht = {
234
- label: "label",
235
- value: "value",
236
- disabled: "disabled",
237
- options: "options"
238
- };
239
- function tt(e) {
240
- const t = N({ ...ht, ...e.props });
241
- let n = { ...e.props };
242
- return pe(
243
- () => e.props,
244
- (m) => {
245
- Re(m, n) || (t.value = { ...ht, ...m }, n = { ...m });
246
- },
247
- { deep: !0 }
248
- ), {
249
- aliasProps: t,
250
- getLabel: (m) => ue(m, t.value.label),
251
- getValue: (m) => ue(m, t.value.value),
252
- getDisabled: (m) => ue(m, t.value.disabled),
253
- getOptions: (m) => ue(m, t.value.options)
254
- };
255
- }
256
- const uo = Ee({
257
- /**
258
- * @description whether creating new items is allowed. To use this, `filterable` must be true
259
- */
260
- allowCreate: Boolean,
261
- /**
262
- * @description autocomplete of select input
263
- */
264
- autocomplete: {
265
- type: Z(String),
266
- default: "none"
267
- },
268
- /**
269
- * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused
270
- */
271
- automaticDropdown: Boolean,
272
- /**
273
- * @description whether select can be cleared
274
- */
275
- clearable: Boolean,
276
- /**
277
- * @description custom clear icon
278
- */
279
- clearIcon: {
280
- type: Zt,
281
- default: $n
282
- },
283
- /**
284
- * @description tooltip theme, built-in theme: `dark` / `light`
285
- */
286
- effect: {
287
- type: Z(String),
288
- default: "light"
289
- },
290
- /**
291
- * @description whether to collapse tags to a text when multiple selecting
292
- */
293
- collapseTags: Boolean,
294
- /**
295
- * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true
296
- */
297
- collapseTagsTooltip: Boolean,
298
- /**
299
- * @description The max tags number to be shown. To use this, `collapse-tags` must be true
300
- */
301
- maxCollapseTags: {
302
- type: Number,
303
- default: 1
304
- },
305
- /**
306
- * @description
307
- */
308
- defaultFirstOption: Boolean,
309
- /**
310
- * @description is disabled
311
- */
312
- disabled: {
313
- type: Boolean,
314
- default: void 0
315
- },
316
- /**
317
- * @description
318
- */
319
- estimatedOptionHeight: {
320
- type: Number,
321
- default: void 0
322
- },
323
- /**
324
- * @description whether Select is filterable
325
- */
326
- filterable: Boolean,
327
- /**
328
- * @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true
329
- */
330
- filterMethod: {
331
- type: Z(Function)
332
- },
333
- /**
334
- * @description The height of the dropdown panel, 34px for each item
335
- */
336
- height: {
337
- type: Number,
338
- default: 274
339
- // same as select dropdown menu
340
- },
341
- /**
342
- * @description The height of the dropdown item
343
- */
344
- itemHeight: {
345
- type: Number,
346
- default: 34
347
- },
348
- /**
349
- * @description native input id
350
- */
351
- id: String,
352
- /**
353
- * @description whether Select is loading data from server
354
- */
355
- loading: Boolean,
356
- /**
357
- * @description displayed text while loading data from server, default is 'Loading'
358
- */
359
- loadingText: String,
360
- /**
361
- * @description biding value
362
- */
363
- modelValue: {
364
- type: Z([Array, String, Number, Boolean, Object]),
365
- default: void 0
366
- },
367
- /**
368
- * @description is multiple
369
- */
370
- multiple: Boolean,
371
- /**
372
- * @description maximum number of options user can select when multiple is true. No limit when set to 0
373
- */
374
- multipleLimit: {
375
- type: Number,
376
- default: 0
377
- },
378
- /**
379
- * @description the name attribute of select input
380
- */
381
- name: String,
382
- /**
383
- * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'
384
- */
385
- noDataText: String,
386
- /**
387
- * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'
388
- */
389
- noMatchText: String,
390
- /**
391
- * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true
392
- */
393
- remoteMethod: {
394
- type: Z(Function)
395
- },
396
- /**
397
- * @description whether reserve the keyword after select filtered option.
398
- */
399
- reserveKeyword: {
400
- type: Boolean,
401
- default: !0
402
- },
403
- /**
404
- * @description data of the options, the key of `value` and `label` can be customize by `props`
405
- */
406
- options: {
407
- type: Z(Array),
408
- required: !0
409
- },
410
- /**
411
- * @description placeholder, the default is 'Please select'
412
- */
413
- placeholder: {
414
- type: String
415
- },
416
- /**
417
- * @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets
418
- */
419
- teleported: Ye.teleported,
420
- /**
421
- * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed
422
- */
423
- persistent: {
424
- type: Boolean,
425
- default: !0
426
- },
427
- /**
428
- * @description custom class name for Select's dropdown
429
- */
430
- popperClass: Ye.popperClass,
431
- /**
432
- * @description custom style for Select's dropdown
433
- */
434
- popperStyle: Ye.popperStyle,
435
- /**
436
- * @description [popper.js](https://popper.js.org/docs/v2/) parameters
437
- */
438
- popperOptions: {
439
- type: Z(Object),
440
- default: () => ({})
441
- },
442
- /**
443
- * @description whether search data from server
444
- */
445
- remote: Boolean,
446
- /**
447
- * @description debounce delay during remote search, in milliseconds
448
- */
449
- debounce: {
450
- type: Number,
451
- default: 300
452
- },
453
- /**
454
- * @description size of component
455
- */
456
- size: Rn,
457
- /**
458
- * @description configuration options, see the following table
459
- */
460
- props: {
461
- type: Z(Object),
462
- default: () => ht
463
- },
464
- /**
465
- * @description unique identity key name for value, required when value is an object
466
- */
467
- valueKey: {
468
- type: String,
469
- default: "value"
470
- },
471
- /**
472
- * @description Controls whether the scrollbar is always displayed
473
- */
474
- scrollbarAlwaysOn: Boolean,
475
- /**
476
- * @description whether to trigger form validation
477
- */
478
- validateEvent: {
479
- type: Boolean,
480
- default: !0
481
- },
482
- /**
483
- * @description offset of the dropdown
484
- */
485
- offset: {
486
- type: Number,
487
- default: 12
488
- },
489
- /**
490
- * @description in remote search method show suffix icon
491
- */
492
- remoteShowSuffix: Boolean,
493
- /**
494
- * @description Determines whether the arrow is displayed
495
- */
496
- showArrow: {
497
- type: Boolean,
498
- default: !0
499
- },
500
- /**
501
- * @description position of dropdown
502
- */
503
- placement: {
504
- type: Z(String),
505
- values: Tn,
506
- default: "bottom-start"
507
- },
508
- /**
509
- * @description list of possible positions for dropdown
510
- */
511
- fallbackPlacements: {
512
- type: Z(Array),
513
- default: ["bottom-start", "top-start", "right", "left"]
514
- },
515
- /**
516
- * @description tag type
517
- */
518
- tagType: { ...pt.type, default: "info" },
519
- /**
520
- * @description tag effect
521
- */
522
- tagEffect: { ...pt.effect, default: "light" },
523
- /**
524
- * @description tabindex for input
525
- */
526
- tabindex: {
527
- type: [String, Number],
528
- default: 0
529
- },
530
- /**
531
- * @description which element the select dropdown appends to
532
- */
533
- appendTo: Ye.appendTo,
534
- /**
535
- * @description if it is `true`, the width of the dropdown panel is the same as the input box.
536
- * if it is `false`, the width is automatically calculated based on the value of `label`,
537
- * or it can be set to a number to make it a fixed width
538
- */
539
- fitInputWidth: {
540
- type: [Boolean, Number],
541
- default: !0,
542
- validator(e) {
543
- return zn(e) || Ie(e);
544
- }
545
- },
546
- suffixIcon: {
547
- type: Zt,
548
- default: kn
549
- },
550
- ...In,
551
- ...Pn(["ariaLabel"])
552
- }), co = Ee({
553
- data: Array,
554
- disabled: Boolean,
555
- hovering: Boolean,
556
- item: {
557
- type: Z(Object),
558
- required: !0
559
- },
560
- index: Number,
561
- style: Object,
562
- selected: Boolean,
563
- created: Boolean
564
- }), fo = {
565
- [rl]: (e) => !0,
566
- [il]: (e) => !0,
567
- "remove-tag": (e) => !0,
568
- "visible-change": (e) => !0,
569
- focus: (e) => e instanceof FocusEvent,
570
- blur: (e) => e instanceof FocusEvent,
571
- clear: () => !0
572
- }, mo = {
573
- hover: (e) => Ie(e),
574
- select: (e, t) => !0
575
- }, Vt = /* @__PURE__ */ Symbol(
576
- "ElSelectV2Injection"
577
- );
578
- var vo = Ve({
579
- props: co,
580
- emits: mo,
581
- setup(e, { emit: t }) {
582
- const n = el(Vt), o = ge("select"), { hoverItem: r, selectOptionClick: f } = ro(e, { emit: t }), { getLabel: u } = tt(n.props), m = n.contentId;
583
- return {
584
- ns: o,
585
- contentId: m,
586
- hoverItem: r,
587
- selectOptionClick: f,
588
- getLabel: u
589
- };
590
- }
591
- });
592
- const po = ["id", "aria-selected", "aria-disabled"];
593
- function ho(e, t, n, o, r, f) {
594
- return D(), le("li", {
595
- id: `${e.contentId}-${e.index}`,
596
- role: "option",
597
- "aria-selected": e.selected,
598
- "aria-disabled": e.disabled || void 0,
599
- style: Te(e.style),
600
- class: R([
601
- e.ns.be("dropdown", "item"),
602
- e.ns.is("selected", e.selected),
603
- e.ns.is("disabled", e.disabled),
604
- e.ns.is("created", e.created),
605
- e.ns.is("hovering", e.hovering)
606
- ]),
607
- onMousemove: t[0] || (t[0] = (...u) => e.hoverItem && e.hoverItem(...u)),
608
- onClick: t[1] || (t[1] = te((...u) => e.selectOptionClick && e.selectOptionClick(...u), ["stop"]))
609
- }, [
610
- oe(e.$slots, "default", {
611
- item: e.item,
612
- index: e.index,
613
- disabled: e.disabled
614
- }, () => [
615
- H(
616
- "span",
617
- null,
618
- he(e.getLabel(e.item)),
619
- 1
620
- /* TEXT */
621
- )
622
- ])
623
- ], 46, po);
624
- }
625
- var go = /* @__PURE__ */ It(vo, [["render", ho]]), Yt = Number.isNaN || function(t) {
626
- return typeof t == "number" && t !== t;
627
- };
628
- function bo(e, t) {
629
- return !!(e === t || Yt(e) && Yt(t));
630
- }
631
- function yo(e, t) {
632
- if (e.length !== t.length)
633
- return !1;
634
- for (var n = 0; n < e.length; n++)
635
- if (!bo(e[n], t[n]))
636
- return !1;
637
- return !0;
638
- }
639
- function So(e, t) {
640
- t === void 0 && (t = yo);
641
- var n = null;
642
- function o() {
643
- for (var r = [], f = 0; f < arguments.length; f++)
644
- r[f] = arguments[f];
645
- if (n && n.lastThis === this && t(r, n.lastArgs))
646
- return n.lastResult;
647
- var u = e.apply(this, r);
648
- return n = {
649
- lastResult: u,
650
- lastArgs: r,
651
- lastThis: this
652
- }, u;
653
- }
654
- return o.clear = function() {
655
- n = null;
656
- }, o;
657
- }
658
- const wo = () => {
659
- const t = tl().proxy.$props;
660
- return g(() => {
661
- const n = (o, r, f) => ({});
662
- return t.perfMode ? An(n) : So(n);
663
- });
664
- }, Oo = 50, Xt = "itemRendered", Jt = "scroll", pl = "forward", hl = "backward", Pe = "auto", gl = "smart", bl = "start", _e = "center", yl = "end", Le = "horizontal", Sl = "vertical", Io = "ltr", Je = "rtl", gt = "negative", wl = "positive-ascending", Ol = "positive-descending", To = {
665
- [Le]: "left",
666
- [Sl]: "top"
667
- }, Vo = 20, Eo = ({ atEndEdge: e, atStartEdge: t, layout: n }, o) => {
668
- let r, f = 0;
669
- const u = (b) => b < 0 && t.value || b > 0 && e.value;
670
- return {
671
- hasReachedEdge: u,
672
- onWheel: (b) => {
673
- vl(r);
674
- let { deltaX: S, deltaY: i } = b;
675
- b.shiftKey && i !== 0 && (S = i, i = 0);
676
- const c = n.value === Le ? S : i;
677
- u(c) || (f += c, !qn() && c !== 0 && b.preventDefault(), r = ml(() => {
678
- o(f), f = 0;
679
- }));
680
- }
681
- };
682
- }, bt = Ce({
683
- type: Z([Number, Function]),
684
- required: !0
685
- }), yt = Ce({
686
- type: Number
687
- }), St = Ce({
688
- type: Number,
689
- default: 2
690
- }), Co = Ce({
691
- type: String,
692
- values: ["ltr", "rtl"],
693
- default: "ltr"
694
- }), wt = Ce({
695
- type: Number,
696
- default: 0
697
- }), et = Ce({
698
- type: Number,
699
- required: !0
700
- }), Il = Ce({
701
- type: String,
702
- values: ["horizontal", "vertical"],
703
- default: Sl
704
- }), Tl = Ee({
705
- className: {
706
- type: String,
707
- default: ""
708
- },
709
- containerElement: {
710
- type: Z([String, Object]),
711
- default: "div"
712
- },
713
- data: {
714
- type: Z(Array),
715
- default: () => Qn([])
716
- },
717
- /**
718
- * @description controls the horizontal direction.
719
- */
720
- direction: Co,
721
- height: {
722
- type: [String, Number],
723
- required: !0
724
- },
725
- innerElement: {
726
- type: [String, Object],
727
- default: "div"
728
- },
729
- innerProps: {
730
- type: Z(Object),
731
- default: () => ({})
732
- },
733
- style: {
734
- type: Z([Object, String, Array])
735
- },
736
- useIsScrolling: Boolean,
737
- width: {
738
- type: [Number, String],
739
- required: !1
740
- },
741
- perfMode: {
742
- type: Boolean,
743
- default: !0
744
- },
745
- scrollbarAlwaysOn: Boolean
746
- }), Mo = Ee({
747
- /**
748
- * @description describes how many items should be pre rendered to the head
749
- * and the tail of the window
750
- */
751
- cache: St,
752
- estimatedItemSize: yt,
753
- /**
754
- * @description controls the list's orientation
755
- */
756
- layout: Il,
757
- initScrollOffset: wt,
758
- /**
759
- * @description describes the total number of the list.
760
- */
761
- total: et,
762
- itemSize: bt,
763
- ...Tl
764
- }), Ot = {
765
- type: Number,
766
- default: 6
767
- }, Vl = { type: Number, default: 0 }, El = { type: Number, default: 2 };
768
- Ee({
769
- columnCache: St,
770
- columnWidth: bt,
771
- estimatedColumnWidth: yt,
772
- estimatedRowHeight: yt,
773
- initScrollLeft: wt,
774
- initScrollTop: wt,
775
- itemKey: {
776
- type: Z(Function),
777
- default: ({
778
- columnIndex: e,
779
- rowIndex: t
780
- }) => `${t}:${e}`
781
- },
782
- rowCache: St,
783
- rowHeight: bt,
784
- totalColumn: et,
785
- totalRow: et,
786
- hScrollbarSize: Ot,
787
- vScrollbarSize: Ot,
788
- scrollbarStartGap: Vl,
789
- scrollbarEndGap: El,
790
- role: String,
791
- ...Tl
792
- });
793
- const Ro = Ee({
794
- alwaysOn: Boolean,
795
- class: String,
796
- layout: Il,
797
- total: et,
798
- ratio: {
799
- type: Number,
800
- required: !0
801
- },
802
- clientSize: {
803
- type: Number,
804
- required: !0
805
- },
806
- scrollFrom: {
807
- type: Number,
808
- required: !0
809
- },
810
- scrollbarSize: Ot,
811
- startGap: Vl,
812
- endGap: El,
813
- visible: Boolean
814
- }), ct = (e, t) => e < t ? pl : hl, He = (e) => e === Io || e === Je || e === Le;
815
- let Me = null;
816
- function xt(e = !1) {
817
- if (Me === null || e) {
818
- const t = document.createElement("div"), n = t.style;
819
- n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
820
- const o = document.createElement("div"), r = o.style;
821
- return r.width = "100px", r.height = "100px", t.appendChild(o), document.body.appendChild(t), t.scrollLeft > 0 ? Me = Ol : (t.scrollLeft = 1, t.scrollLeft === 0 ? Me = gt : Me = wl), document.body.removeChild(t), Me;
822
- }
823
- return Me;
824
- }
825
- function zo({ move: e, size: t, bar: n }, o) {
826
- const r = {}, f = `translate${n.axis}(${e}px)`;
827
- return r[n.size] = t, r.transform = f, o === "horizontal" ? r.height = "100%" : r.width = "100%", r;
828
- }
829
- const Lo = Ve({
830
- name: "ElVirtualScrollBar",
831
- props: Ro,
832
- emits: ["scroll", "start-move", "stop-move"],
833
- setup(e, { emit: t }) {
834
- const n = g(() => e.startGap + e.endGap), o = ge("virtual-scrollbar"), r = ge("scrollbar"), f = N(), u = N();
835
- let m = null, b = null;
836
- const S = xe({
837
- isDragging: !1,
838
- traveled: 0
839
- }), i = g(() => Vn[e.layout]), c = g(() => e.clientSize - I(n)), T = g(() => ({
840
- position: "absolute",
841
- width: `${Le === e.layout ? c.value : e.scrollbarSize}px`,
842
- height: `${Le === e.layout ? e.scrollbarSize : c.value}px`,
843
- [To[e.layout]]: "2px",
844
- right: "2px",
845
- bottom: "2px",
846
- borderRadius: "4px"
847
- })), d = g(() => {
848
- const w = e.ratio;
849
- if (w >= 100)
850
- return Number.POSITIVE_INFINITY;
851
- if (w >= 50)
852
- return w * c.value / 100;
853
- const k = c.value / 3;
854
- return Math.floor(
855
- Math.min(
856
- Math.max(w * c.value / 100, Vo),
857
- k
858
- )
859
- );
860
- }), E = g(() => {
861
- if (!Number.isFinite(d.value))
862
- return {
863
- display: "none"
864
- };
865
- const w = `${d.value}px`;
866
- return zo(
867
- {
868
- bar: i.value,
869
- size: w,
870
- move: S.traveled
871
- },
872
- e.layout
873
- );
874
- }), M = g(
875
- () => Math.ceil(e.clientSize - d.value - I(n))
876
- ), a = () => {
877
- window.addEventListener("mousemove", C), window.addEventListener("mouseup", x);
878
- const w = I(u);
879
- w && (b = document.onselectstart, document.onselectstart = () => !1, w.addEventListener("touchmove", C, { passive: !0 }), w.addEventListener("touchend", x));
880
- }, F = () => {
881
- window.removeEventListener("mousemove", C), window.removeEventListener("mouseup", x), document.onselectstart = b, b = null;
882
- const w = I(u);
883
- w && (w.removeEventListener("touchmove", C), w.removeEventListener("touchend", x));
884
- }, ae = (w) => {
885
- w.stopImmediatePropagation(), !(w.ctrlKey || [1, 2].includes(w.button)) && (S.isDragging = !0, S[i.value.axis] = w.currentTarget[i.value.offset] - (w[i.value.client] - w.currentTarget.getBoundingClientRect()[i.value.direction]), t("start-move"), a());
886
- }, x = () => {
887
- S.isDragging = !1, S[i.value.axis] = 0, t("stop-move"), F();
888
- }, C = (w) => {
889
- const { isDragging: k } = S;
890
- if (!k || !u.value || !f.value) return;
891
- const se = S[i.value.axis];
892
- if (!se) return;
893
- vl(m);
894
- const Y = (f.value.getBoundingClientRect()[i.value.direction] - w[i.value.client]) * -1, U = u.value[i.value.offset] - se, O = Y - U;
895
- m = ml(() => {
896
- S.traveled = Math.max(0, Math.min(O, M.value)), t("scroll", O, M.value);
897
- });
898
- }, ne = (w) => {
899
- const k = Math.abs(
900
- w.target.getBoundingClientRect()[i.value.direction] - w[i.value.client]
901
- ), se = u.value[i.value.offset] / 2, Y = k - se;
902
- S.traveled = Math.max(0, Math.min(Y, M.value)), t("scroll", Y, M.value);
903
- };
904
- return pe(
905
- () => e.scrollFrom,
906
- (w) => {
907
- S.isDragging || (S.traveled = Math.ceil(w * M.value));
908
- }
909
- ), fn(() => {
910
- F();
911
- }), () => Oe(
912
- "div",
913
- {
914
- role: "presentation",
915
- ref: f,
916
- class: [
917
- o.b(),
918
- e.class,
919
- (e.alwaysOn || S.isDragging) && "always-on"
920
- ],
921
- style: T.value,
922
- onMousedown: te(ne, [
923
- "stop",
924
- "prevent"
925
- ]),
926
- onTouchstartPrevent: ae
927
- },
928
- Oe(
929
- "div",
930
- {
931
- ref: u,
932
- class: r.e("thumb"),
933
- style: E.value,
934
- onMousedown: ae
935
- },
936
- []
937
- )
938
- );
939
- }
940
- }), Cl = ({
941
- name: e,
942
- getOffset: t,
943
- getItemSize: n,
944
- getItemOffset: o,
945
- getEstimatedTotalSize: r,
946
- getStartIndexForOffset: f,
947
- getStopIndexForStartIndex: u,
948
- initCache: m,
949
- clearCache: b,
950
- validateProps: S
951
- }) => Ve({
952
- name: e ?? "ElVirtualList",
953
- props: Mo,
954
- emits: [Xt, Jt],
955
- setup(i, { emit: c, expose: T }) {
956
- S(i);
957
- const d = tl(), E = ge("vl"), M = N(m(i, d)), a = wo(), F = N(), ae = N(), x = N(), C = N({
958
- isScrolling: !1,
959
- scrollDir: "forward",
960
- scrollOffset: Ie(i.initScrollOffset) ? i.initScrollOffset : 0,
961
- updateRequested: !1,
962
- isScrollbarDragging: !1,
963
- scrollbarAlwaysOn: i.scrollbarAlwaysOn
964
- }), ne = g(() => {
965
- const { total: p, cache: y } = i, { isScrolling: z, scrollDir: W, scrollOffset: L } = I(C);
966
- if (p === 0)
967
- return [0, 0, 0, 0];
968
- const G = f(
969
- i,
970
- L,
971
- I(M)
972
- ), K = u(
973
- i,
974
- G,
975
- L,
976
- I(M)
977
- ), be = !z || W === hl ? Math.max(1, y) : 1, me = !z || W === pl ? Math.max(1, y) : 1;
978
- return [
979
- Math.max(0, G - be),
980
- Math.max(0, Math.min(p - 1, K + me)),
981
- G,
982
- K
983
- ];
984
- }), w = g(
985
- () => r(i, I(M))
986
- ), k = g(() => He(i.layout)), se = g(() => [
987
- {
988
- position: "relative",
989
- [`overflow-${k.value ? "x" : "y"}`]: "scroll",
990
- WebkitOverflowScrolling: "touch",
991
- willChange: "transform"
992
- },
993
- {
994
- direction: i.direction,
995
- height: Ie(i.height) ? `${i.height}px` : i.height,
996
- width: Ie(i.width) ? `${i.width}px` : i.width
997
- },
998
- i.style
999
- ]), Y = g(() => {
1000
- const p = I(w), y = I(k);
1001
- return {
1002
- height: y ? "100%" : `${p}px`,
1003
- pointerEvents: I(C).isScrolling ? "none" : void 0,
1004
- width: y ? `${p}px` : "100%",
1005
- // fix scrolling issues in Firefox.
1006
- margin: 0,
1007
- boxSizing: "border-box"
1008
- };
1009
- }), U = g(
1010
- () => k.value ? i.width : i.height
1011
- ), { onWheel: O } = Eo(
1012
- {
1013
- atStartEdge: g(() => C.value.scrollOffset <= 0),
1014
- atEndEdge: g(
1015
- () => C.value.scrollOffset >= w.value
1016
- ),
1017
- layout: g(() => i.layout)
1018
- },
1019
- (p) => {
1020
- var y, z;
1021
- (z = (y = x.value).onMouseUp) == null || z.call(y), $(
1022
- Math.min(
1023
- C.value.scrollOffset + p,
1024
- w.value - U.value
1025
- )
1026
- );
1027
- }
1028
- );
1029
- Wn(F, "wheel", O, {
1030
- passive: !1
1031
- });
1032
- const V = () => {
1033
- const { total: p } = i;
1034
- if (p > 0) {
1035
- const [L, G, K, be] = I(ne);
1036
- c(Xt, L, G, K, be);
1037
- }
1038
- const { scrollDir: y, scrollOffset: z, updateRequested: W } = I(C);
1039
- c(Jt, y, z, W);
1040
- }, B = (p) => {
1041
- const { clientHeight: y, scrollHeight: z, scrollTop: W } = p.currentTarget, L = I(C);
1042
- if (L.scrollOffset === W)
1043
- return;
1044
- const G = Math.max(
1045
- 0,
1046
- Math.min(W, z - y)
1047
- );
1048
- C.value = {
1049
- ...L,
1050
- isScrolling: !0,
1051
- scrollDir: ct(L.scrollOffset, G),
1052
- scrollOffset: G,
1053
- updateRequested: !1
1054
- }, re(de);
1055
- }, j = (p) => {
1056
- const { clientWidth: y, scrollLeft: z, scrollWidth: W } = p.currentTarget, L = I(C);
1057
- if (L.scrollOffset === z)
1058
- return;
1059
- const { direction: G } = i;
1060
- let K = z;
1061
- if (G === Je)
1062
- switch (xt()) {
1063
- case gt: {
1064
- K = -z;
1065
- break;
1066
- }
1067
- case Ol: {
1068
- K = W - y - z;
1069
- break;
1070
- }
1071
- }
1072
- K = Math.max(
1073
- 0,
1074
- Math.min(K, W - y)
1075
- ), C.value = {
1076
- ...L,
1077
- isScrolling: !0,
1078
- scrollDir: ct(L.scrollOffset, K),
1079
- scrollOffset: K,
1080
- updateRequested: !1
1081
- }, re(de);
1082
- }, Q = (p) => {
1083
- I(k) ? j(p) : B(p), V();
1084
- }, _ = (p, y) => {
1085
- const z = (w.value - U.value) / y * p;
1086
- $(
1087
- Math.min(
1088
- w.value - U.value,
1089
- z
1090
- )
1091
- );
1092
- }, $ = (p) => {
1093
- p = Math.max(p, 0), p !== I(C).scrollOffset && (C.value = {
1094
- ...I(C),
1095
- scrollOffset: p,
1096
- scrollDir: ct(I(C).scrollOffset, p),
1097
- updateRequested: !0
1098
- }, re(de));
1099
- }, X = (p, y = Pe) => {
1100
- const { scrollOffset: z } = I(C);
1101
- p = Math.max(0, Math.min(p, i.total - 1)), $(
1102
- t(
1103
- i,
1104
- p,
1105
- y,
1106
- z,
1107
- I(M)
1108
- )
1109
- );
1110
- }, ce = (p) => {
1111
- const { direction: y, itemSize: z, layout: W } = i, L = a.value(
1112
- b && z,
1113
- b && W,
1114
- b && y
1115
- );
1116
- let G;
1117
- if (Dn(L, String(p)))
1118
- G = L[p];
1119
- else {
1120
- const K = o(i, p, I(M)), be = n(i, p, I(M)), me = I(k), We = y === Je, Ne = me ? K : 0;
1121
- L[p] = G = {
1122
- position: "absolute",
1123
- left: We ? void 0 : `${Ne}px`,
1124
- right: We ? `${Ne}px` : void 0,
1125
- top: me ? 0 : `${K}px`,
1126
- height: me ? "100%" : `${be}px`,
1127
- width: me ? `${be}px` : "100%"
1128
- };
1129
- }
1130
- return G;
1131
- }, de = () => {
1132
- C.value.isScrolling = !1, re(() => {
1133
- a.value(-1, null, null);
1134
- });
1135
- }, A = () => {
1136
- const p = F.value;
1137
- p && (p.scrollTop = 0);
1138
- };
1139
- ll(() => {
1140
- if (!Tt) return;
1141
- const { initScrollOffset: p } = i, y = I(F);
1142
- Ie(p) && y && (I(k) ? y.scrollLeft = p : y.scrollTop = p), V();
1143
- }), mn(() => {
1144
- const { direction: p, layout: y } = i, { scrollOffset: z, updateRequested: W } = I(C), L = I(F);
1145
- if (W && L)
1146
- if (y === Le)
1147
- if (p === Je)
1148
- switch (xt()) {
1149
- case gt: {
1150
- L.scrollLeft = -z;
1151
- break;
1152
- }
1153
- case wl: {
1154
- L.scrollLeft = z;
1155
- break;
1156
- }
1157
- default: {
1158
- const { clientWidth: G, scrollWidth: K } = L;
1159
- L.scrollLeft = K - G - z;
1160
- break;
1161
- }
1162
- }
1163
- else
1164
- L.scrollLeft = z;
1165
- else
1166
- L.scrollTop = z;
1167
- }), vn(() => {
1168
- I(F).scrollTop = I(C).scrollOffset;
1169
- });
1170
- const fe = {
1171
- ns: E,
1172
- clientSize: U,
1173
- estimatedTotalSize: w,
1174
- windowStyle: se,
1175
- windowRef: F,
1176
- innerRef: ae,
1177
- innerStyle: Y,
1178
- itemsToRender: ne,
1179
- scrollbarRef: x,
1180
- states: C,
1181
- getItemStyle: ce,
1182
- onScroll: Q,
1183
- onScrollbarScroll: _,
1184
- onWheel: O,
1185
- scrollTo: $,
1186
- scrollToItem: X,
1187
- resetScrollTop: A
1188
- };
1189
- return T({
1190
- windowRef: F,
1191
- innerRef: ae,
1192
- getItemStyleCache: a,
1193
- scrollTo: $,
1194
- scrollToItem: X,
1195
- resetScrollTop: A,
1196
- states: C
1197
- }), fe;
1198
- },
1199
- render(i) {
1200
- var c;
1201
- const {
1202
- $slots: T,
1203
- className: d,
1204
- clientSize: E,
1205
- containerElement: M,
1206
- data: a,
1207
- getItemStyle: F,
1208
- innerElement: ae,
1209
- itemsToRender: x,
1210
- innerStyle: C,
1211
- layout: ne,
1212
- total: w,
1213
- onScroll: k,
1214
- onScrollbarScroll: se,
1215
- states: Y,
1216
- useIsScrolling: U,
1217
- windowStyle: O,
1218
- ns: V
1219
- } = i, [B, j] = x, Q = Ae(M), _ = Ae(ae), $ = [];
1220
- if (w > 0)
1221
- for (let A = B; A <= j; A++)
1222
- $.push(
1223
- Oe(
1224
- dt,
1225
- { key: A },
1226
- (c = T.default) == null ? void 0 : c.call(T, {
1227
- data: a,
1228
- index: A,
1229
- isScrolling: U ? Y.isScrolling : void 0,
1230
- style: F(A)
1231
- })
1232
- )
1233
- );
1234
- const X = [
1235
- Oe(
1236
- _,
1237
- ft(i.innerProps, {
1238
- style: C,
1239
- ref: "innerRef"
1240
- }),
1241
- vt(_) ? $ : {
1242
- default: () => $
1243
- }
1244
- )
1245
- ], ce = Oe(Lo, {
1246
- ref: "scrollbarRef",
1247
- clientSize: E,
1248
- layout: ne,
1249
- onScroll: se,
1250
- ratio: E * 100 / this.estimatedTotalSize,
1251
- scrollFrom: Y.scrollOffset / (this.estimatedTotalSize - E),
1252
- total: w,
1253
- alwaysOn: Y.scrollbarAlwaysOn
1254
- }), de = Oe(
1255
- Q,
1256
- {
1257
- class: [V.e("window"), d],
1258
- style: O,
1259
- onScroll: k,
1260
- ref: "windowRef",
1261
- key: 0
1262
- },
1263
- vt(Q) ? [X] : { default: () => [X] }
1264
- );
1265
- return Oe(
1266
- "div",
1267
- {
1268
- key: 0,
1269
- class: [V.e("wrapper"), Y.scrollbarAlwaysOn ? "always-on" : ""]
1270
- },
1271
- [de, ce]
1272
- );
1273
- }
1274
- }), No = Cl({
1275
- name: "ElFixedSizeList",
1276
- getItemOffset: ({ itemSize: e }, t) => t * e,
1277
- getItemSize: ({ itemSize: e }) => e,
1278
- getEstimatedTotalSize: ({ total: e, itemSize: t }) => t * e,
1279
- getOffset: ({ height: e, total: t, itemSize: n, layout: o, width: r }, f, u, m) => {
1280
- const b = He(o) ? r : e;
1281
- process.env.NODE_ENV !== "production" && vt(b) && al(
1282
- "[ElVirtualList]",
1283
- `
1284
- You should set
1285
- width/height
1286
- to number when your layout is
1287
- horizontal/vertical
1288
- `
1289
- );
1290
- const S = Math.max(0, t * n - b), i = Math.min(S, f * n), c = Math.max(0, (f + 1) * n - b);
1291
- switch (u === gl && (m >= c - b && m <= i + b ? u = Pe : u = _e), u) {
1292
- case bl:
1293
- return i;
1294
- case yl:
1295
- return c;
1296
- case _e: {
1297
- const T = Math.round(c + (i - c) / 2);
1298
- return T < Math.ceil(b / 2) ? 0 : T > S + Math.floor(b / 2) ? S : T;
1299
- }
1300
- case Pe:
1301
- default:
1302
- return m >= c && m <= i ? m : m < c ? c : i;
1303
- }
1304
- },
1305
- getStartIndexForOffset: ({ total: e, itemSize: t }, n) => Math.max(0, Math.min(e - 1, Math.floor(n / t))),
1306
- getStopIndexForStartIndex: ({ height: e, total: t, itemSize: n, layout: o, width: r }, f, u) => {
1307
- const m = f * n, b = He(o) ? r : e, S = Math.ceil(
1308
- (b + u - m) / n
1309
- );
1310
- return Math.max(
1311
- 0,
1312
- Math.min(
1313
- t - 1,
1314
- // because startIndex is inclusive, so in order to prevent array outbound indexing
1315
- // we need to - 1 to prevent outbound behavior
1316
- f + S - 1
1317
- )
1318
- );
1319
- },
1320
- /**
1321
- * Fixed size list does not need this cache
1322
- * Using any to bypass it, TODO: Using type inference to fix this.
1323
- */
1324
- initCache() {
1325
- },
1326
- clearCache: !0,
1327
- validateProps() {
1328
- }
1329
- }), ko = "ElDynamicSizeList", ze = (e, t, n) => {
1330
- const { itemSize: o } = e, { items: r, lastVisitedIndex: f } = n;
1331
- if (t > f) {
1332
- let u = 0;
1333
- if (f >= 0) {
1334
- const m = r[f];
1335
- u = m.offset + m.size;
1336
- }
1337
- for (let m = f + 1; m <= t; m++) {
1338
- const b = o(m);
1339
- r[m] = {
1340
- offset: u,
1341
- size: b
1342
- }, u += b;
1343
- }
1344
- n.lastVisitedIndex = t;
1345
- }
1346
- return r[t];
1347
- }, $o = (e, t, n) => {
1348
- const { items: o, lastVisitedIndex: r } = t;
1349
- return (r > 0 ? o[r].offset : 0) >= n ? Ml(e, t, 0, r, n) : Do(e, t, Math.max(0, r), n);
1350
- }, Ml = (e, t, n, o, r) => {
1351
- for (; n <= o; ) {
1352
- const f = n + Math.floor((o - n) / 2), u = ze(e, f, t).offset;
1353
- if (u === r)
1354
- return f;
1355
- u < r ? n = f + 1 : u > r && (o = f - 1);
1356
- }
1357
- return Math.max(0, n - 1);
1358
- }, Do = (e, t, n, o) => {
1359
- const { total: r } = e;
1360
- let f = 1;
1361
- for (; n < r && ze(e, n, t).offset < o; )
1362
- n += f, f *= 2;
1363
- return Ml(
1364
- e,
1365
- t,
1366
- Math.floor(n / 2),
1367
- Math.min(n, r - 1),
1368
- o
1369
- );
1370
- }, _t = ({ total: e }, { items: t, estimatedItemSize: n, lastVisitedIndex: o }) => {
1371
- let r = 0;
1372
- if (o >= e && (o = e - 1), o >= 0) {
1373
- const m = t[o];
1374
- r = m.offset + m.size;
1375
- }
1376
- const u = (e - o - 1) * n;
1377
- return r + u;
1378
- }, Bo = Cl({
1379
- name: "ElDynamicSizeList",
1380
- getItemOffset: (e, t, n) => ze(e, t, n).offset,
1381
- getItemSize: (e, t, { items: n }) => n[t].size,
1382
- getEstimatedTotalSize: _t,
1383
- getOffset: (e, t, n, o, r) => {
1384
- const { height: f, layout: u, width: m } = e, b = He(u) ? m : f, S = ze(e, t, r), i = _t(e, r), c = Math.max(
1385
- 0,
1386
- Math.min(i - b, S.offset)
1387
- ), T = Math.max(0, S.offset - b + S.size);
1388
- switch (n === gl && (o >= T - b && o <= c + b ? n = Pe : n = _e), n) {
1389
- case bl:
1390
- return c;
1391
- case yl:
1392
- return T;
1393
- case _e:
1394
- return Math.round(T + (c - T) / 2);
1395
- case Pe:
1396
- default:
1397
- return o >= T && o <= c ? o : o < T ? T : c;
1398
- }
1399
- },
1400
- getStartIndexForOffset: (e, t, n) => $o(e, n, t),
1401
- getStopIndexForStartIndex: (e, t, n, o) => {
1402
- const { height: r, total: f, layout: u, width: m } = e, b = He(u) ? m : r, S = ze(e, t, o), i = n + b;
1403
- let c = S.offset + S.size, T = t;
1404
- for (; T < f - 1 && c < i; )
1405
- T++, c += ze(e, T, o).size;
1406
- return T;
1407
- },
1408
- initCache({ estimatedItemSize: e = Oo }, t) {
1409
- const n = {
1410
- items: {},
1411
- estimatedItemSize: e,
1412
- lastVisitedIndex: -1
1413
- };
1414
- return n.clearCacheAfterIndex = (o, r = !0) => {
1415
- var f, u;
1416
- n.lastVisitedIndex = Math.min(n.lastVisitedIndex, o - 1), (f = t.exposed) == null || f.getItemStyleCache(-1), r && ((u = t.proxy) == null || u.$forceUpdate());
1417
- }, n;
1418
- },
1419
- clearCache: !1,
1420
- validateProps: ({ itemSize: e }) => {
1421
- process.env.NODE_ENV !== "production" && typeof e != "function" && al(
1422
- ko,
1423
- `
1424
- itemSize is required as function, but the given value was ${typeof e}
1425
- `
1426
- );
1427
- }
1428
- }), Ao = {
1429
- loading: Boolean,
1430
- data: {
1431
- type: Array,
1432
- required: !0
1433
- },
1434
- hoveringIndex: Number,
1435
- width: Number,
1436
- id: String,
1437
- ariaLabel: String
1438
- };
1439
- var Fo = /* @__PURE__ */ Ve({
1440
- name: "ElSelectDropdown",
1441
- props: Ao,
1442
- setup(e, {
1443
- slots: t,
1444
- expose: n
1445
- }) {
1446
- const o = el(Vt), r = ge("select"), {
1447
- getLabel: f,
1448
- getValue: u,
1449
- getDisabled: m
1450
- } = tt(o.props), b = N([]), S = N(), i = g(() => e.data.length);
1451
- pe(() => i.value, () => {
1452
- var O, V;
1453
- (V = (O = o.tooltipRef.value) == null ? void 0 : O.updatePopper) == null || V.call(O);
1454
- });
1455
- const c = g(() => sl(o.props.estimatedOptionHeight)), T = g(() => c.value ? {
1456
- itemSize: o.props.itemHeight
1457
- } : {
1458
- estimatedSize: o.props.estimatedOptionHeight,
1459
- itemSize: (O) => b.value[O]
1460
- }), d = (O = [], V) => {
1461
- const {
1462
- props: {
1463
- valueKey: B
1464
- }
1465
- } = o;
1466
- return Fe(V) ? O && O.some((j) => pn(ue(j, B)) === ue(V, B)) : O.includes(V);
1467
- }, E = (O, V) => {
1468
- if (Fe(V)) {
1469
- const {
1470
- valueKey: B
1471
- } = o.props;
1472
- return ue(O, B) === ue(V, B);
1473
- } else
1474
- return O === V;
1475
- }, M = (O, V) => o.props.multiple ? d(O, u(V)) : E(O, u(V)), a = (O, V) => {
1476
- const {
1477
- disabled: B,
1478
- multiple: j,
1479
- multipleLimit: Q
1480
- } = o.props;
1481
- return B || !V && (j ? Q > 0 && O.length >= Q : !1);
1482
- }, F = (O) => e.hoveringIndex === O;
1483
- n({
1484
- listRef: S,
1485
- isSized: c,
1486
- isItemDisabled: a,
1487
- isItemHovering: F,
1488
- isItemSelected: M,
1489
- scrollToItem: (O) => {
1490
- const V = S.value;
1491
- V && V.scrollToItem(O);
1492
- },
1493
- resetScrollTop: () => {
1494
- const O = S.value;
1495
- O && O.resetScrollTop();
1496
- }
1497
- });
1498
- const ne = (O) => {
1499
- const {
1500
- index: V,
1501
- data: B,
1502
- style: j
1503
- } = O, Q = I(c), {
1504
- itemSize: _,
1505
- estimatedSize: $
1506
- } = I(T), {
1507
- modelValue: X
1508
- } = o.props, {
1509
- onSelect: ce,
1510
- onHover: de
1511
- } = o, A = B[V];
1512
- if (A.type === "Group")
1513
- return J(io, {
1514
- item: A,
1515
- style: j,
1516
- height: Q ? _ : $
1517
- }, null);
1518
- const fe = M(X, A), p = a(X, fe), y = F(V);
1519
- return J(go, ft(O, {
1520
- selected: fe,
1521
- disabled: m(A) || p,
1522
- created: !!A.created,
1523
- hovering: y,
1524
- item: A,
1525
- onSelect: ce,
1526
- onHover: de
1527
- }), {
1528
- default: (z) => {
1529
- var W;
1530
- return ((W = t.default) == null ? void 0 : W.call(t, z)) || J("span", null, [f(A)]);
1531
- }
1532
- });
1533
- }, {
1534
- onKeyboardNavigate: w,
1535
- onKeyboardSelect: k
1536
- } = o, se = () => {
1537
- w("forward");
1538
- }, Y = () => {
1539
- w("backward");
1540
- }, U = (O) => {
1541
- const V = cl(O), {
1542
- tab: B,
1543
- esc: j,
1544
- down: Q,
1545
- up: _,
1546
- enter: $,
1547
- numpadEnter: X
1548
- } = dl;
1549
- switch ([j, Q, _, $, X].includes(V) && (O.preventDefault(), O.stopPropagation()), V) {
1550
- case B:
1551
- case j:
1552
- break;
1553
- case Q:
1554
- se();
1555
- break;
1556
- case _:
1557
- Y();
1558
- break;
1559
- case $:
1560
- case X:
1561
- k();
1562
- break;
1563
- }
1564
- };
1565
- return () => {
1566
- var O, V, B, j;
1567
- const {
1568
- data: Q,
1569
- width: _
1570
- } = e, {
1571
- height: $,
1572
- multiple: X,
1573
- scrollbarAlwaysOn: ce
1574
- } = o.props, de = g(() => Kn ? !0 : ce), A = I(c) ? No : Bo;
1575
- return J("div", {
1576
- class: [r.b("dropdown"), r.is("multiple", X)],
1577
- style: {
1578
- width: `${_}px`
1579
- }
1580
- }, [(O = t.header) == null ? void 0 : O.call(t), ((V = t.loading) == null ? void 0 : V.call(t)) || ((B = t.empty) == null ? void 0 : B.call(t)) || J(A, ft({
1581
- ref: S
1582
- }, I(T), {
1583
- className: r.be("dropdown", "list"),
1584
- scrollbarAlwaysOn: de.value,
1585
- data: Q,
1586
- height: $,
1587
- width: _,
1588
- total: Q.length,
1589
- innerElement: "ul",
1590
- innerProps: {
1591
- id: e.id,
1592
- role: "listbox",
1593
- "aria-label": e.ariaLabel,
1594
- "aria-orientation": "vertical"
1595
- },
1596
- onKeydown: U
1597
- }), {
1598
- default: (fe) => J(ne, fe, null)
1599
- }), (j = t.footer) == null ? void 0 : j.call(t)]);
1600
- };
1601
- }
1602
- });
1603
- function Po(e, t) {
1604
- const { aliasProps: n, getLabel: o, getValue: r } = tt(e), f = N(0), u = N(), m = g(() => e.allowCreate && e.filterable);
1605
- pe(
1606
- () => e.options,
1607
- (d) => {
1608
- const E = new Set(d.map((M) => o(M)));
1609
- t.createdOptions = t.createdOptions.filter(
1610
- (M) => !E.has(o(M))
1611
- );
1612
- }
1613
- );
1614
- function b(d) {
1615
- const E = (M) => o(M) === d;
1616
- return e.options && e.options.some(E) || t.createdOptions.some(E);
1617
- }
1618
- function S(d) {
1619
- m.value && (e.multiple && d.created ? f.value++ : u.value = d);
1620
- }
1621
- function i(d) {
1622
- if (m.value)
1623
- if (d && d.length > 0) {
1624
- if (b(d)) {
1625
- t.createdOptions = t.createdOptions.filter(
1626
- (M) => o(M) !== t.previousQuery
1627
- );
1628
- return;
1629
- }
1630
- const E = {
1631
- [n.value.value]: d,
1632
- [n.value.label]: d,
1633
- created: !0,
1634
- [n.value.disabled]: !1
1635
- };
1636
- t.createdOptions.length >= f.value ? t.createdOptions[f.value] = E : t.createdOptions.push(E);
1637
- } else if (e.multiple)
1638
- t.createdOptions.length = f.value;
1639
- else {
1640
- const E = u.value;
1641
- t.createdOptions.length = 0, E && E.created && t.createdOptions.push(E);
1642
- }
1643
- }
1644
- function c(d) {
1645
- if (!m.value || !d || !d.created || d.created && e.reserveKeyword && t.inputValue === o(d))
1646
- return;
1647
- const E = t.createdOptions.findIndex(
1648
- (M) => r(M) === r(d)
1649
- );
1650
- ~E && (t.createdOptions.splice(E, 1), f.value--);
1651
- }
1652
- function T() {
1653
- m.value && (t.createdOptions.length = 0, f.value = 0);
1654
- }
1655
- return {
1656
- createNewOption: i,
1657
- removeNewOption: c,
1658
- selectNewOption: S,
1659
- clearAllNewOption: T
1660
- };
1661
- }
1662
- const Ho = (e, t) => {
1663
- const { t: n } = ul(), o = hn(), r = ge("select"), f = ge("input"), { form: u, formItem: m } = Zn(), { inputId: b } = Yn(e, {
1664
- formItemContext: m
1665
- }), { aliasProps: S, getLabel: i, getValue: c, getDisabled: T, getOptions: d } = tt(e), { valueOnClear: E, isEmptyValue: M } = En(e), a = xe({
1666
- inputValue: "",
1667
- cachedOptions: [],
1668
- createdOptions: [],
1669
- hoveringIndex: -1,
1670
- inputHovering: !1,
1671
- selectionWidth: 0,
1672
- collapseItemWidth: 0,
1673
- previousQuery: null,
1674
- previousValue: void 0,
1675
- selectedLabel: "",
1676
- menuVisibleOnFocus: !1,
1677
- isBeforeHide: !1
1678
- }), F = N(-1), ae = N(!1), x = N(), C = N(), ne = N(), w = N(), k = N(), se = N(), Y = N(), U = N(), O = N(), V = N(), {
1679
- isComposing: B,
1680
- handleCompositionStart: j,
1681
- handleCompositionEnd: Q,
1682
- handleCompositionUpdate: _
1683
- } = Un({
1684
- afterComposition: (l) => Ht(l)
1685
- }), $ = Ln(), { wrapperRef: X, isFocused: ce, handleBlur: de } = jn(k, {
1686
- disabled: $,
1687
- afterFocus() {
1688
- e.automaticDropdown && !y.value && (y.value = !0, a.menuVisibleOnFocus = !0);
1689
- },
1690
- beforeBlur(l) {
1691
- var s, v;
1692
- return ((s = ne.value) == null ? void 0 : s.isFocusInsideContent(l)) || ((v = w.value) == null ? void 0 : v.isFocusInsideContent(l));
1693
- },
1694
- afterBlur() {
1695
- var l;
1696
- y.value = !1, a.menuVisibleOnFocus = !1, e.validateEvent && ((l = m == null ? void 0 : m.validate) == null || l.call(m, "blur").catch((s) => ut(s)));
1697
- }
1698
- }), A = g(() => Et("")), fe = g(() => e.loading ? !1 : e.options.length > 0 || a.createdOptions.length > 0), p = N([]), y = N(!1), z = g(() => {
1699
- var l;
1700
- return (l = u == null ? void 0 : u.statusIcon) != null ? l : !1;
1701
- }), W = g(() => {
1702
- const l = p.value.length * e.itemHeight;
1703
- return l > e.height ? e.height : l;
1704
- }), L = g(() => e.multiple ? Se(e.modelValue) && e.modelValue.length > 0 : !M(e.modelValue)), G = g(() => e.clearable && !$.value && L.value && (ce.value || a.inputHovering)), K = g(
1705
- () => e.remote && e.filterable && !e.remoteShowSuffix ? "" : e.suffixIcon
1706
- ), be = g(
1707
- () => K.value && r.is("reverse", y.value)
1708
- ), me = g(() => (m == null ? void 0 : m.validateState) || ""), We = g(() => {
1709
- if (me.value)
1710
- return Hn[me.value];
1711
- }), Ne = g(() => e.remote ? e.debounce : 0), Rl = g(
1712
- () => e.remote && !a.inputValue && !fe.value
1713
- ), zl = g(() => e.loading ? e.loadingText || n("el.select.loading") : e.filterable && a.inputValue && fe.value && p.value.length === 0 ? e.noMatchText || n("el.select.noMatch") : fe.value ? null : e.noDataText || n("el.select.noData")), Ll = g(
1714
- () => e.filterable && Xe(e.filterMethod)
1715
- ), Nl = g(
1716
- () => e.filterable && e.remote && Xe(e.remoteMethod)
1717
- ), Et = (l) => {
1718
- const s = new RegExp(Bn(l), "i"), v = (h) => Ll.value || Nl.value ? !0 : l ? s.test(i(h) || "") : !0;
1719
- return e.loading ? [] : [...a.createdOptions, ...e.options].reduce((h, P) => {
1720
- const ie = d(P);
1721
- if (Se(ie)) {
1722
- const De = ie.filter(v);
1723
- De.length > 0 && h.push(
1724
- {
1725
- label: i(P),
1726
- type: "Group"
1727
- },
1728
- ...De
1729
- );
1730
- } else (e.remote || v(P)) && h.push(P);
1731
- return h;
1732
- }, []);
1733
- }, Ct = () => {
1734
- p.value = Et(a.inputValue);
1735
- }, Ke = g(() => {
1736
- const l = /* @__PURE__ */ new Map();
1737
- return A.value.forEach((s, v) => {
1738
- l.set(ee(c(s)), { option: s, index: v });
1739
- }), l;
1740
- }), Ge = g(() => {
1741
- const l = /* @__PURE__ */ new Map();
1742
- return p.value.forEach((s, v) => {
1743
- l.set(ee(c(s)), { option: s, index: v });
1744
- }), l;
1745
- }), kl = g(
1746
- () => p.value.every((l) => T(l))
1747
- ), Mt = nl(), $l = g(
1748
- () => Mt.value === "small" ? "small" : "default"
1749
- ), ke = () => {
1750
- var l;
1751
- if (Ie(e.fitInputWidth)) {
1752
- F.value = e.fitInputWidth;
1753
- return;
1754
- }
1755
- const s = ((l = x.value) == null ? void 0 : l.offsetWidth) || 200;
1756
- !e.fitInputWidth && fe.value ? re(() => {
1757
- F.value = Math.max(s, Dl());
1758
- }) : F.value = s;
1759
- }, Dl = () => {
1760
- var l, s;
1761
- const h = document.createElement("canvas").getContext("2d"), P = r.be("dropdown", "item"), De = (((s = (l = U.value) == null ? void 0 : l.listRef) == null ? void 0 : s.innerRef) || document).querySelector(`.${P}`);
1762
- if (De === null || h === null) return 0;
1763
- const Qe = getComputedStyle(De), an = Number.parseFloat(Qe.paddingLeft) + Number.parseFloat(Qe.paddingRight);
1764
- return h.font = `bold ${Qe.font.replace(
1765
- new RegExp(`\\b${Qe.fontWeight}\\b`),
1766
- ""
1767
- )}`, p.value.reduce((sn, rn) => {
1768
- const un = h.measureText(i(rn));
1769
- return Math.max(un.width, sn);
1770
- }, 0) + an;
1771
- }, Bl = () => {
1772
- if (!C.value) return 0;
1773
- const l = window.getComputedStyle(C.value);
1774
- return Number.parseFloat(l.gap || "6px");
1775
- }, Al = g(() => {
1776
- const l = Bl(), s = e.filterable ? l + fl : 0;
1777
- return { maxWidth: `${V.value && e.maxCollapseTags === 1 ? a.selectionWidth - a.collapseItemWidth - l - s : a.selectionWidth - s}px` };
1778
- }), Fl = g(() => ({ maxWidth: `${a.selectionWidth}px` })), Pl = g(() => Se(e.modelValue) ? e.modelValue.length === 0 && !a.inputValue : e.filterable ? !a.inputValue : !0), Hl = g(() => {
1779
- var l;
1780
- const s = (l = e.placeholder) != null ? l : n("el.select.placeholder");
1781
- return e.multiple || !L.value ? s : a.selectedLabel;
1782
- }), Wl = g(() => {
1783
- var l, s;
1784
- return (s = (l = ne.value) == null ? void 0 : l.popperRef) == null ? void 0 : s.contentRef;
1785
- }), Rt = g(() => {
1786
- if (e.multiple) {
1787
- const l = e.modelValue.length;
1788
- if (l > 0 && Ge.value.has(e.modelValue[l - 1])) {
1789
- const { index: s } = Ge.value.get(
1790
- e.modelValue[l - 1]
1791
- );
1792
- return s;
1793
- }
1794
- } else if (!M(e.modelValue) && Ge.value.has(e.modelValue)) {
1795
- const { index: l } = Ge.value.get(e.modelValue);
1796
- return l;
1797
- }
1798
- return -1;
1799
- }), zt = g({
1800
- get() {
1801
- return y.value && (e.loading || !Rl.value || e.remote && !!o.empty) && (!ae.value || !Nn(a.previousQuery));
1802
- },
1803
- set(l) {
1804
- y.value = l;
1805
- }
1806
- }), Kl = g(() => e.multiple ? e.collapseTags ? a.cachedOptions.slice(0, e.maxCollapseTags) : a.cachedOptions : []), Gl = g(() => e.multiple ? e.collapseTags ? a.cachedOptions.slice(e.maxCollapseTags) : [] : []), {
1807
- createNewOption: Lt,
1808
- removeNewOption: lt,
1809
- selectNewOption: Nt,
1810
- clearAllNewOption: nt
1811
- } = Po(e, a), ot = (l) => {
1812
- var s;
1813
- $.value || e.filterable && y.value && l && !((s = Y.value) != null && s.contains(l.target)) || (a.menuVisibleOnFocus ? a.menuVisibleOnFocus = !1 : y.value = !y.value);
1814
- }, kt = () => {
1815
- a.inputValue.length > 0 && !y.value && (y.value = !0), Lt(a.inputValue), re(() => {
1816
- at(a.inputValue);
1817
- });
1818
- }, $t = Gn(() => {
1819
- kt(), ae.value = !1;
1820
- }, Ne), at = (l) => {
1821
- a.previousQuery === l || B.value || (a.previousQuery = l, e.filterable && Xe(e.filterMethod) ? e.filterMethod(l) : e.filterable && e.remote && Xe(e.remoteMethod) && e.remoteMethod(l), e.defaultFirstOption && (e.filterable || e.remote) && p.value.length ? re(ql) : re(tn));
1822
- }, ql = () => {
1823
- const l = p.value.filter(
1824
- (h) => !h.disabled && h.type !== "Group"
1825
- ), s = l.find((h) => h.created), v = l[0];
1826
- a.hoveringIndex = st(
1827
- p.value,
1828
- s || v
1829
- );
1830
- }, Ul = (l) => {
1831
- Re(e.modelValue, l) || t(il, l);
1832
- }, $e = (l) => {
1833
- t(rl, l), Ul(l), a.previousValue = e.multiple ? String(l) : l, re(() => {
1834
- if (e.multiple && Se(e.modelValue)) {
1835
- const s = a.cachedOptions.slice(), v = e.modelValue.map(
1836
- (h) => Wt(h, s)
1837
- );
1838
- Re(a.cachedOptions, v) || (a.cachedOptions = v);
1839
- } else
1840
- Ue(!0);
1841
- });
1842
- }, st = (l = [], s) => {
1843
- if (!Fe(s))
1844
- return l.indexOf(s);
1845
- const v = e.valueKey;
1846
- let h = -1;
1847
- return l.some((P, ie) => ue(P, v) === ue(s, v) ? (h = ie, !0) : !1), h;
1848
- }, ee = (l) => Fe(l) ? ue(l, e.valueKey) : l, Dt = () => {
1849
- ke();
1850
- }, Bt = () => {
1851
- a.selectionWidth = Number.parseFloat(
1852
- window.getComputedStyle(C.value).width
1853
- );
1854
- }, jl = () => {
1855
- a.collapseItemWidth = V.value.getBoundingClientRect().width;
1856
- }, it = () => {
1857
- var l, s;
1858
- (s = (l = ne.value) == null ? void 0 : l.updatePopper) == null || s.call(l);
1859
- }, At = () => {
1860
- var l, s;
1861
- (s = (l = w.value) == null ? void 0 : l.updatePopper) == null || s.call(l);
1862
- }, Ft = (l) => {
1863
- const s = c(l);
1864
- if (e.multiple) {
1865
- let v = e.modelValue.slice();
1866
- const h = st(v, s);
1867
- h > -1 ? (v = [
1868
- ...v.slice(0, h),
1869
- ...v.slice(h + 1)
1870
- ], a.cachedOptions.splice(h, 1), lt(l)) : (e.multipleLimit <= 0 || v.length < e.multipleLimit) && (v = [...v, s], a.cachedOptions.push(l), Nt(l)), $e(v), l.created && at(""), e.filterable && !e.reserveKeyword && (a.inputValue = "");
1871
- } else
1872
- a.selectedLabel = i(l), !Re(e.modelValue, s) && $e(s), y.value = !1, Nt(l), l.created || nt();
1873
- qe();
1874
- }, Ql = (l, s) => {
1875
- let v = e.modelValue.slice();
1876
- const h = st(v, c(s));
1877
- h > -1 && !$.value && (v = [
1878
- ...e.modelValue.slice(0, h),
1879
- ...e.modelValue.slice(h + 1)
1880
- ], a.cachedOptions.splice(h, 1), $e(v), t("remove-tag", c(s)), lt(s)), l.stopPropagation(), qe();
1881
- }, qe = () => {
1882
- var l;
1883
- (l = k.value) == null || l.focus();
1884
- }, Zl = () => {
1885
- var l;
1886
- if (y.value) {
1887
- y.value = !1, re(() => {
1888
- var s;
1889
- return (s = k.value) == null ? void 0 : s.blur();
1890
- });
1891
- return;
1892
- }
1893
- (l = k.value) == null || l.blur();
1894
- }, Yl = () => {
1895
- a.inputValue.length > 0 ? a.inputValue = "" : y.value = !1;
1896
- }, Xl = (l) => Fn(
1897
- l,
1898
- (s) => !a.cachedOptions.some(
1899
- (v) => c(v) === s && T(v)
1900
- )
1901
- ), Jl = (l) => {
1902
- const s = cl(l);
1903
- if (e.multiple && s !== dl.delete && a.inputValue.length === 0) {
1904
- l.preventDefault();
1905
- const v = e.modelValue.slice(), h = Xl(v);
1906
- if (h < 0) return;
1907
- const P = v[h];
1908
- v.splice(h, 1);
1909
- const ie = a.cachedOptions[h];
1910
- a.cachedOptions.splice(h, 1), lt(ie), $e(v), t("remove-tag", P);
1911
- }
1912
- }, xl = () => {
1913
- let l;
1914
- Se(e.modelValue) ? l = [] : l = E.value, a.selectedLabel = "", y.value = !1, $e(l), t("clear"), nt(), qe();
1915
- }, Pt = (l, s = void 0) => {
1916
- const v = p.value;
1917
- if (!["forward", "backward"].includes(l) || $.value || v.length <= 0 || kl.value || B.value)
1918
- return;
1919
- if (!y.value)
1920
- return ot();
1921
- sl(s) && (s = a.hoveringIndex);
1922
- let h = -1;
1923
- l === "forward" ? (h = s + 1, h >= v.length && (h = 0)) : l === "backward" && (h = s - 1, (h < 0 || h >= v.length) && (h = v.length - 1));
1924
- const P = v[h];
1925
- if (T(P) || P.type === "Group")
1926
- return Pt(l, h);
1927
- a.hoveringIndex = h, rt(h);
1928
- }, _l = () => {
1929
- if (y.value)
1930
- ~a.hoveringIndex && p.value[a.hoveringIndex] && Ft(p.value[a.hoveringIndex]);
1931
- else return ot();
1932
- }, en = (l) => {
1933
- a.hoveringIndex = l ?? -1;
1934
- }, tn = () => {
1935
- if (!e.multiple)
1936
- a.hoveringIndex = p.value.findIndex((l) => ee(c(l)) === ee(e.modelValue));
1937
- else {
1938
- const l = e.modelValue.length;
1939
- if (l > 0) {
1940
- const s = e.modelValue[l - 1];
1941
- a.hoveringIndex = p.value.findIndex(
1942
- (v) => ee(s) === ee(c(v))
1943
- );
1944
- } else
1945
- a.hoveringIndex = -1;
1946
- }
1947
- }, Ht = (l) => {
1948
- if (a.inputValue = l.target.value, e.remote)
1949
- ae.value = !0, $t();
1950
- else
1951
- return kt();
1952
- }, ln = (l) => {
1953
- if (y.value = !1, ce.value) {
1954
- const s = new FocusEvent("blur", l);
1955
- de(s);
1956
- }
1957
- }, nn = () => (a.isBeforeHide = !1, re(() => {
1958
- ~Rt.value && rt(Rt.value);
1959
- })), rt = (l) => {
1960
- U.value.scrollToItem(l);
1961
- }, Wt = (l, s) => {
1962
- const v = ee(l);
1963
- if (Ke.value.has(v)) {
1964
- const { option: h } = Ke.value.get(v);
1965
- return h;
1966
- }
1967
- if (s && s.length) {
1968
- const h = s.find(
1969
- (P) => ee(c(P)) === v
1970
- );
1971
- if (h)
1972
- return h;
1973
- }
1974
- return {
1975
- [S.value.value]: l,
1976
- [S.value.label]: l
1977
- };
1978
- }, on = (l) => {
1979
- var s, v;
1980
- return (v = (s = Ke.value.get(c(l))) == null ? void 0 : s.index) != null ? v : -1;
1981
- }, Ue = (l = !1) => {
1982
- if (e.multiple)
1983
- if (e.modelValue.length > 0) {
1984
- const s = a.cachedOptions.slice();
1985
- a.cachedOptions.length = 0, a.previousValue = e.modelValue.toString();
1986
- for (const v of e.modelValue) {
1987
- const h = Wt(v, s);
1988
- a.cachedOptions.push(h);
1989
- }
1990
- } else
1991
- a.cachedOptions = [], a.previousValue = void 0;
1992
- else if (L.value) {
1993
- a.previousValue = e.modelValue;
1994
- const s = p.value, v = s.findIndex(
1995
- (h) => ee(c(h)) === ee(e.modelValue)
1996
- );
1997
- ~v ? a.selectedLabel = i(s[v]) : (!a.selectedLabel || l) && (a.selectedLabel = ee(e.modelValue));
1998
- } else
1999
- a.selectedLabel = "", a.previousValue = void 0;
2000
- nt(), ke();
2001
- };
2002
- pe(
2003
- () => e.fitInputWidth,
2004
- () => {
2005
- ke();
2006
- }
2007
- ), pe(y, (l) => {
2008
- l ? (e.persistent || ke(), at("")) : (a.inputValue = "", a.previousQuery = null, a.isBeforeHide = !0, a.menuVisibleOnFocus = !1, Lt(""));
2009
- }), pe(
2010
- () => e.modelValue,
2011
- (l, s) => {
2012
- var v;
2013
- (!l || Se(l) && l.length === 0 || e.multiple && !Re(l.toString(), a.previousValue) || !e.multiple && ee(l) !== ee(a.previousValue)) && Ue(!0), !Re(l, s) && e.validateEvent && ((v = m == null ? void 0 : m.validate) == null || v.call(m, "change").catch((P) => ut(P)));
2014
- },
2015
- {
2016
- deep: !0
2017
- }
2018
- ), pe(
2019
- () => e.options,
2020
- () => {
2021
- const l = k.value;
2022
- (!l || l && document.activeElement !== l) && Ue();
2023
- },
2024
- {
2025
- deep: !0,
2026
- flush: "post"
2027
- }
2028
- ), pe(
2029
- () => p.value,
2030
- () => (ke(), U.value && re(U.value.resetScrollTop))
2031
- ), Kt(() => {
2032
- a.isBeforeHide || Ct();
2033
- }), Kt(() => {
2034
- const { valueKey: l, options: s } = e, v = /* @__PURE__ */ new Map();
2035
- for (const h of s) {
2036
- const P = c(h);
2037
- let ie = P;
2038
- if (Fe(ie) && (ie = ue(P, l)), v.get(ie)) {
2039
- ut(
2040
- "ElSelectV2",
2041
- "The option values you provided seem to be duplicated, which may cause some problems, please check."
2042
- );
2043
- break;
2044
- } else
2045
- v.set(ie, !0);
2046
- }
2047
- }), ll(() => {
2048
- Ue();
2049
- }), we(x, Dt), we(C, Bt), we(X, it), we(O, At), we(V, jl);
2050
- let je;
2051
- return pe(
2052
- () => zt.value,
2053
- (l) => {
2054
- l ? je = we(U, it).stop : (je == null || je(), je = void 0), t("visible-change", l);
2055
- }
2056
- ), {
2057
- // data exports
2058
- inputId: b,
2059
- collapseTagSize: $l,
2060
- currentPlaceholder: Hl,
2061
- expanded: y,
2062
- emptyText: zl,
2063
- popupHeight: W,
2064
- debounce: Ne,
2065
- allOptions: A,
2066
- allOptionsValueMap: Ke,
2067
- filteredOptions: p,
2068
- iconComponent: K,
2069
- iconReverse: be,
2070
- tagStyle: Al,
2071
- collapseTagStyle: Fl,
2072
- popperSize: F,
2073
- dropdownMenuVisible: zt,
2074
- hasModelValue: L,
2075
- shouldShowPlaceholder: Pl,
2076
- selectDisabled: $,
2077
- selectSize: Mt,
2078
- needStatusIcon: z,
2079
- showClearBtn: G,
2080
- states: a,
2081
- isFocused: ce,
2082
- nsSelect: r,
2083
- nsInput: f,
2084
- // refs items exports
2085
- inputRef: k,
2086
- menuRef: U,
2087
- tagMenuRef: O,
2088
- tooltipRef: ne,
2089
- tagTooltipRef: w,
2090
- selectRef: x,
2091
- wrapperRef: X,
2092
- selectionRef: C,
2093
- prefixRef: se,
2094
- suffixRef: Y,
2095
- collapseItemRef: V,
2096
- popperRef: Wl,
2097
- validateState: me,
2098
- validateIcon: We,
2099
- showTagList: Kl,
2100
- collapseTagList: Gl,
2101
- // methods exports
2102
- debouncedOnInputChange: $t,
2103
- deleteTag: Ql,
2104
- getLabel: i,
2105
- getValue: c,
2106
- getDisabled: T,
2107
- getValueKey: ee,
2108
- getIndex: on,
2109
- handleClear: xl,
2110
- handleClickOutside: ln,
2111
- handleDel: Jl,
2112
- handleEsc: Yl,
2113
- focus: qe,
2114
- blur: Zl,
2115
- handleMenuEnter: nn,
2116
- handleResize: Dt,
2117
- resetSelectionWidth: Bt,
2118
- updateTooltip: it,
2119
- updateTagTooltip: At,
2120
- updateOptions: Ct,
2121
- toggleMenu: ot,
2122
- scrollTo: rt,
2123
- onInput: Ht,
2124
- onKeyboardNavigate: Pt,
2125
- onKeyboardSelect: _l,
2126
- onSelect: Ft,
2127
- onHover: en,
2128
- handleCompositionStart: j,
2129
- handleCompositionEnd: Q,
2130
- handleCompositionUpdate: _
2131
- };
2132
- };
2133
- var Wo = Ve({
2134
- name: "ElSelectV2",
2135
- components: {
2136
- ElSelectMenu: Fo,
2137
- ElTag: oo,
2138
- ElTooltip: Cn,
2139
- ElIcon: mt
2140
- },
2141
- directives: { ClickOutside: Jn },
2142
- props: uo,
2143
- emits: fo,
2144
- setup(e, { emit: t }) {
2145
- const n = g(() => {
2146
- const { modelValue: b, multiple: S } = e, i = S ? [] : void 0;
2147
- return Se(b) ? S ? b : i : S ? i : b;
2148
- }), o = Ho(
2149
- xe({
2150
- ...Gt(e),
2151
- modelValue: n
2152
- }),
2153
- t
2154
- ), { calculatorRef: r, inputStyle: f } = _n(), u = Xn();
2155
- gn(Vt, {
2156
- props: xe({
2157
- ...Gt(e),
2158
- height: o.popupHeight,
2159
- modelValue: n
2160
- }),
2161
- expanded: o.expanded,
2162
- tooltipRef: o.tooltipRef,
2163
- contentId: u,
2164
- onSelect: o.onSelect,
2165
- onHover: o.onHover,
2166
- onKeyboardNavigate: o.onKeyboardNavigate,
2167
- onKeyboardSelect: o.onKeyboardSelect
2168
- });
2169
- const m = g(() => e.multiple ? o.states.cachedOptions.map((b) => o.getLabel(b)) : o.states.selectedLabel);
2170
- return {
2171
- ...o,
2172
- modelValue: n,
2173
- selectedLabel: m,
2174
- calculatorRef: r,
2175
- inputStyle: f,
2176
- contentId: u,
2177
- BORDER_HORIZONTAL_WIDTH: xn
2178
- };
2179
- }
2180
- });
2181
- const Ko = ["id", "value", "autocomplete", "tabindex", "aria-expanded", "aria-label", "disabled", "aria-controls", "aria-activedescendant", "readonly", "name"], Go = ["textContent"], qo = { key: 1 };
2182
- function Uo(e, t, n, o, r, f) {
2183
- const u = Ze("el-tag"), m = Ze("el-tooltip"), b = Ze("el-icon"), S = Ze("el-select-menu"), i = bn("click-outside");
2184
- return qt((D(), le(
2185
- "div",
2186
- {
2187
- ref: "selectRef",
2188
- class: R([e.nsSelect.b(), e.nsSelect.m(e.selectSize)]),
2189
- onMouseenter: t[14] || (t[14] = (c) => e.states.inputHovering = !0),
2190
- onMouseleave: t[15] || (t[15] = (c) => e.states.inputHovering = !1)
2191
- },
2192
- [
2193
- J(m, {
2194
- ref: "tooltipRef",
2195
- visible: e.dropdownMenuVisible,
2196
- teleported: e.teleported,
2197
- "popper-class": [e.nsSelect.e("popper"), e.popperClass],
2198
- "popper-style": e.popperStyle,
2199
- "gpu-acceleration": !1,
2200
- "stop-popper-mouse-event": !1,
2201
- "popper-options": e.popperOptions,
2202
- "fallback-placements": e.fallbackPlacements,
2203
- effect: e.effect,
2204
- placement: e.placement,
2205
- pure: "",
2206
- transition: `${e.nsSelect.namespace.value}-zoom-in-top`,
2207
- trigger: "click",
2208
- persistent: e.persistent,
2209
- "append-to": e.appendTo,
2210
- "show-arrow": e.showArrow,
2211
- offset: e.offset,
2212
- onBeforeShow: e.handleMenuEnter,
2213
- onHide: t[13] || (t[13] = (c) => e.states.isBeforeHide = !1)
2214
- }, {
2215
- default: q(() => {
2216
- var c, T;
2217
- return [
2218
- H(
2219
- "div",
2220
- {
2221
- ref: "wrapperRef",
2222
- class: R([
2223
- e.nsSelect.e("wrapper"),
2224
- e.nsSelect.is("focused", e.isFocused),
2225
- e.nsSelect.is("hovering", e.states.inputHovering),
2226
- e.nsSelect.is("filterable", e.filterable),
2227
- e.nsSelect.is("disabled", e.selectDisabled)
2228
- ]),
2229
- onClick: t[10] || (t[10] = te((...d) => e.toggleMenu && e.toggleMenu(...d), ["prevent"]))
2230
- },
2231
- [
2232
- e.$slots.prefix ? (D(), le(
2233
- "div",
2234
- {
2235
- key: 0,
2236
- ref: "prefixRef",
2237
- class: R(e.nsSelect.e("prefix"))
2238
- },
2239
- [
2240
- oe(e.$slots, "prefix")
2241
- ],
2242
- 2
2243
- /* CLASS */
2244
- )) : ve("v-if", !0),
2245
- H(
2246
- "div",
2247
- {
2248
- ref: "selectionRef",
2249
- class: R([
2250
- e.nsSelect.e("selection"),
2251
- e.nsSelect.is(
2252
- "near",
2253
- e.multiple && !e.$slots.prefix && !!e.modelValue.length
2254
- )
2255
- ])
2256
- },
2257
- [
2258
- e.multiple ? oe(e.$slots, "tag", {
2259
- key: 0,
2260
- data: e.states.cachedOptions,
2261
- deleteTag: e.deleteTag,
2262
- selectDisabled: e.selectDisabled
2263
- }, () => [
2264
- (D(!0), le(
2265
- dt,
2266
- null,
2267
- Ut(e.showTagList, (d) => (D(), le(
2268
- "div",
2269
- {
2270
- key: e.getValueKey(e.getValue(d)),
2271
- class: R(e.nsSelect.e("selected-item"))
2272
- },
2273
- [
2274
- J(u, {
2275
- closable: !e.selectDisabled && !e.getDisabled(d),
2276
- size: e.collapseTagSize,
2277
- type: e.tagType,
2278
- effect: e.tagEffect,
2279
- "disable-transitions": "",
2280
- style: Te(e.tagStyle),
2281
- onClose: (E) => e.deleteTag(E, d)
2282
- }, {
2283
- default: q(() => [
2284
- H(
2285
- "span",
2286
- {
2287
- class: R(e.nsSelect.e("tags-text"))
2288
- },
2289
- [
2290
- oe(e.$slots, "label", {
2291
- index: e.getIndex(d),
2292
- label: e.getLabel(d),
2293
- value: e.getValue(d)
2294
- }, () => [
2295
- jt(
2296
- he(e.getLabel(d)),
2297
- 1
2298
- /* TEXT */
2299
- )
2300
- ])
2301
- ],
2302
- 2
2303
- /* CLASS */
2304
- )
2305
- ]),
2306
- _: 2
2307
- /* DYNAMIC */
2308
- }, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
2309
- ],
2310
- 2
2311
- /* CLASS */
2312
- ))),
2313
- 128
2314
- /* KEYED_FRAGMENT */
2315
- )),
2316
- e.collapseTags && e.modelValue.length > e.maxCollapseTags ? (D(), ye(m, {
2317
- key: 0,
2318
- ref: "tagTooltipRef",
2319
- disabled: e.dropdownMenuVisible || !e.collapseTagsTooltip,
2320
- "fallback-placements": ["bottom", "top", "right", "left"],
2321
- effect: e.effect,
2322
- placement: "bottom",
2323
- "popper-class": e.popperClass,
2324
- "popper-style": e.popperStyle,
2325
- teleported: e.teleported,
2326
- "popper-options": e.popperOptions
2327
- }, {
2328
- default: q(() => [
2329
- H(
2330
- "div",
2331
- {
2332
- ref: "collapseItemRef",
2333
- class: R(e.nsSelect.e("selected-item"))
2334
- },
2335
- [
2336
- J(u, {
2337
- closable: !1,
2338
- size: e.collapseTagSize,
2339
- type: e.tagType,
2340
- effect: e.tagEffect,
2341
- style: Te(e.collapseTagStyle),
2342
- "disable-transitions": ""
2343
- }, {
2344
- default: q(() => [
2345
- H(
2346
- "span",
2347
- {
2348
- class: R(e.nsSelect.e("tags-text"))
2349
- },
2350
- " + " + he(e.modelValue.length - e.maxCollapseTags),
2351
- 3
2352
- /* TEXT, CLASS */
2353
- )
2354
- ]),
2355
- _: 1
2356
- /* STABLE */
2357
- }, 8, ["size", "type", "effect", "style"])
2358
- ],
2359
- 2
2360
- /* CLASS */
2361
- )
2362
- ]),
2363
- content: q(() => [
2364
- H(
2365
- "div",
2366
- {
2367
- ref: "tagMenuRef",
2368
- class: R(e.nsSelect.e("selection"))
2369
- },
2370
- [
2371
- (D(!0), le(
2372
- dt,
2373
- null,
2374
- Ut(e.collapseTagList, (d) => (D(), le(
2375
- "div",
2376
- {
2377
- key: e.getValueKey(e.getValue(d)),
2378
- class: R(e.nsSelect.e("selected-item"))
2379
- },
2380
- [
2381
- J(u, {
2382
- class: "in-tooltip",
2383
- closable: !e.selectDisabled && !e.getDisabled(d),
2384
- size: e.collapseTagSize,
2385
- type: e.tagType,
2386
- effect: e.tagEffect,
2387
- "disable-transitions": "",
2388
- onClose: (E) => e.deleteTag(E, d)
2389
- }, {
2390
- default: q(() => [
2391
- H(
2392
- "span",
2393
- {
2394
- class: R(e.nsSelect.e("tags-text"))
2395
- },
2396
- [
2397
- oe(e.$slots, "label", {
2398
- index: e.getIndex(d),
2399
- label: e.getLabel(d),
2400
- value: e.getValue(d)
2401
- }, () => [
2402
- jt(
2403
- he(e.getLabel(d)),
2404
- 1
2405
- /* TEXT */
2406
- )
2407
- ])
2408
- ],
2409
- 2
2410
- /* CLASS */
2411
- )
2412
- ]),
2413
- _: 2
2414
- /* DYNAMIC */
2415
- }, 1032, ["closable", "size", "type", "effect", "onClose"])
2416
- ],
2417
- 2
2418
- /* CLASS */
2419
- ))),
2420
- 128
2421
- /* KEYED_FRAGMENT */
2422
- ))
2423
- ],
2424
- 2
2425
- /* CLASS */
2426
- )
2427
- ]),
2428
- _: 3
2429
- /* FORWARDED */
2430
- }, 8, ["disabled", "effect", "popper-class", "popper-style", "teleported", "popper-options"])) : ve("v-if", !0)
2431
- ]) : ve("v-if", !0),
2432
- H(
2433
- "div",
2434
- {
2435
- class: R([
2436
- e.nsSelect.e("selected-item"),
2437
- e.nsSelect.e("input-wrapper"),
2438
- e.nsSelect.is("hidden", !e.filterable || e.selectDisabled)
2439
- ])
2440
- },
2441
- [
2442
- H("input", {
2443
- id: e.inputId,
2444
- ref: "inputRef",
2445
- value: e.states.inputValue,
2446
- style: Te(e.inputStyle),
2447
- autocomplete: e.autocomplete,
2448
- tabindex: e.tabindex,
2449
- "aria-autocomplete": "none",
2450
- "aria-haspopup": "listbox",
2451
- autocapitalize: "off",
2452
- "aria-expanded": e.expanded,
2453
- "aria-label": e.ariaLabel,
2454
- class: R([e.nsSelect.e("input"), e.nsSelect.is(e.selectSize)]),
2455
- disabled: e.selectDisabled,
2456
- role: "combobox",
2457
- "aria-controls": e.contentId,
2458
- "aria-activedescendant": e.states.hoveringIndex >= 0 ? `${e.contentId}-${e.states.hoveringIndex}` : "",
2459
- readonly: !e.filterable,
2460
- spellcheck: "false",
2461
- type: "text",
2462
- name: e.name,
2463
- onInput: t[0] || (t[0] = (...d) => e.onInput && e.onInput(...d)),
2464
- onCompositionstart: t[1] || (t[1] = (...d) => e.handleCompositionStart && e.handleCompositionStart(...d)),
2465
- onCompositionupdate: t[2] || (t[2] = (...d) => e.handleCompositionUpdate && e.handleCompositionUpdate(...d)),
2466
- onCompositionend: t[3] || (t[3] = (...d) => e.handleCompositionEnd && e.handleCompositionEnd(...d)),
2467
- onKeydown: [
2468
- t[4] || (t[4] = Be(te((d) => e.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"])),
2469
- t[5] || (t[5] = Be(te((d) => e.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"])),
2470
- t[6] || (t[6] = Be(te((...d) => e.onKeyboardSelect && e.onKeyboardSelect(...d), ["stop", "prevent"]), ["enter"])),
2471
- t[7] || (t[7] = Be(te((...d) => e.handleEsc && e.handleEsc(...d), ["stop", "prevent"]), ["esc"])),
2472
- t[8] || (t[8] = Be(te((...d) => e.handleDel && e.handleDel(...d), ["stop"]), ["delete"]))
2473
- ],
2474
- onClick: t[9] || (t[9] = te((...d) => e.toggleMenu && e.toggleMenu(...d), ["stop"]))
2475
- }, null, 46, Ko),
2476
- e.filterable ? (D(), le("span", {
2477
- key: 0,
2478
- ref: "calculatorRef",
2479
- "aria-hidden": "true",
2480
- class: R(e.nsSelect.e("input-calculator")),
2481
- textContent: he(e.states.inputValue)
2482
- }, null, 10, Go)) : ve("v-if", !0)
2483
- ],
2484
- 2
2485
- /* CLASS */
2486
- ),
2487
- e.shouldShowPlaceholder ? (D(), le(
2488
- "div",
2489
- {
2490
- key: 1,
2491
- class: R([
2492
- e.nsSelect.e("selected-item"),
2493
- e.nsSelect.e("placeholder"),
2494
- e.nsSelect.is(
2495
- "transparent",
2496
- !e.hasModelValue || e.expanded && !e.states.inputValue
2497
- )
2498
- ])
2499
- },
2500
- [
2501
- e.hasModelValue ? oe(e.$slots, "label", {
2502
- key: 0,
2503
- index: (T = (c = e.allOptionsValueMap.get(e.modelValue)) == null ? void 0 : c.index) != null ? T : -1,
2504
- label: e.currentPlaceholder,
2505
- value: e.modelValue
2506
- }, () => [
2507
- H(
2508
- "span",
2509
- null,
2510
- he(e.currentPlaceholder),
2511
- 1
2512
- /* TEXT */
2513
- )
2514
- ]) : (D(), le(
2515
- "span",
2516
- qo,
2517
- he(e.currentPlaceholder),
2518
- 1
2519
- /* TEXT */
2520
- ))
2521
- ],
2522
- 2
2523
- /* CLASS */
2524
- )) : ve("v-if", !0)
2525
- ],
2526
- 2
2527
- /* CLASS */
2528
- ),
2529
- H(
2530
- "div",
2531
- {
2532
- ref: "suffixRef",
2533
- class: R(e.nsSelect.e("suffix"))
2534
- },
2535
- [
2536
- e.iconComponent ? qt((D(), ye(b, {
2537
- key: 0,
2538
- class: R([e.nsSelect.e("caret"), e.nsInput.e("icon"), e.iconReverse])
2539
- }, {
2540
- default: q(() => [
2541
- (D(), ye(Ae(e.iconComponent)))
2542
- ]),
2543
- _: 1
2544
- /* STABLE */
2545
- }, 8, ["class"])), [
2546
- [On, !e.showClearBtn]
2547
- ]) : ve("v-if", !0),
2548
- e.showClearBtn && e.clearIcon ? (D(), ye(b, {
2549
- key: 1,
2550
- class: R([
2551
- e.nsSelect.e("caret"),
2552
- e.nsInput.e("icon"),
2553
- e.nsSelect.e("clear")
2554
- ]),
2555
- onClick: te(e.handleClear, ["prevent", "stop"])
2556
- }, {
2557
- default: q(() => [
2558
- (D(), ye(Ae(e.clearIcon)))
2559
- ]),
2560
- _: 1
2561
- /* STABLE */
2562
- }, 8, ["class", "onClick"])) : ve("v-if", !0),
2563
- e.validateState && e.validateIcon && e.needStatusIcon ? (D(), ye(b, {
2564
- key: 2,
2565
- class: R([
2566
- e.nsInput.e("icon"),
2567
- e.nsInput.e("validateIcon"),
2568
- e.nsInput.is("loading", e.validateState === "validating")
2569
- ])
2570
- }, {
2571
- default: q(() => [
2572
- (D(), ye(Ae(e.validateIcon)))
2573
- ]),
2574
- _: 1
2575
- /* STABLE */
2576
- }, 8, ["class"])) : ve("v-if", !0)
2577
- ],
2578
- 2
2579
- /* CLASS */
2580
- )
2581
- ],
2582
- 2
2583
- /* CLASS */
2584
- )
2585
- ];
2586
- }),
2587
- content: q(() => [
2588
- J(S, {
2589
- id: e.contentId,
2590
- ref: "menuRef",
2591
- data: e.filteredOptions,
2592
- width: e.popperSize - e.BORDER_HORIZONTAL_WIDTH,
2593
- "hovering-index": e.states.hoveringIndex,
2594
- "scrollbar-always-on": e.scrollbarAlwaysOn,
2595
- "aria-label": e.ariaLabel
2596
- }, yn({
2597
- default: q((c) => [
2598
- oe(e.$slots, "default", Sn(wn(c)))
2599
- ]),
2600
- _: 2
2601
- /* DYNAMIC */
2602
- }, [
2603
- e.$slots.header ? {
2604
- name: "header",
2605
- fn: q(() => [
2606
- H(
2607
- "div",
2608
- {
2609
- class: R(e.nsSelect.be("dropdown", "header")),
2610
- onClick: t[11] || (t[11] = te(() => {
2611
- }, ["stop"]))
2612
- },
2613
- [
2614
- oe(e.$slots, "header")
2615
- ],
2616
- 2
2617
- /* CLASS */
2618
- )
2619
- ]),
2620
- key: "0"
2621
- } : void 0,
2622
- e.$slots.loading && e.loading ? {
2623
- name: "loading",
2624
- fn: q(() => [
2625
- H(
2626
- "div",
2627
- {
2628
- class: R(e.nsSelect.be("dropdown", "loading"))
2629
- },
2630
- [
2631
- oe(e.$slots, "loading")
2632
- ],
2633
- 2
2634
- /* CLASS */
2635
- )
2636
- ]),
2637
- key: "1"
2638
- } : e.loading || e.filteredOptions.length === 0 ? {
2639
- name: "empty",
2640
- fn: q(() => [
2641
- H(
2642
- "div",
2643
- {
2644
- class: R(e.nsSelect.be("dropdown", "empty"))
2645
- },
2646
- [
2647
- oe(e.$slots, "empty", {}, () => [
2648
- H(
2649
- "span",
2650
- null,
2651
- he(e.emptyText),
2652
- 1
2653
- /* TEXT */
2654
- )
2655
- ])
2656
- ],
2657
- 2
2658
- /* CLASS */
2659
- )
2660
- ]),
2661
- key: "2"
2662
- } : void 0,
2663
- e.$slots.footer ? {
2664
- name: "footer",
2665
- fn: q(() => [
2666
- H(
2667
- "div",
2668
- {
2669
- class: R(e.nsSelect.be("dropdown", "footer")),
2670
- onClick: t[12] || (t[12] = te(() => {
2671
- }, ["stop"]))
2672
- },
2673
- [
2674
- oe(e.$slots, "footer")
2675
- ],
2676
- 2
2677
- /* CLASS */
2678
- )
2679
- ]),
2680
- key: "3"
2681
- } : void 0
2682
- ]), 1032, ["id", "data", "width", "hovering-index", "scrollbar-always-on", "aria-label"])
2683
- ]),
2684
- _: 3
2685
- /* FORWARDED */
2686
- }, 8, ["visible", "teleported", "popper-class", "popper-style", "popper-options", "fallback-placements", "effect", "placement", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow"])
2687
- ],
2688
- 34
2689
- /* CLASS, NEED_HYDRATION */
2690
- )), [
2691
- [i, e.handleClickOutside, e.popperRef]
2692
- ]);
2693
- }
2694
- var jo = /* @__PURE__ */ It(Wo, [["render", Uo]]);
2695
- const ua = ol(jo);
2696
- export {
2697
- ua as ElSelectV2,
2698
- ua as default,
2699
- Vt as selectV2InjectionKey
2700
- };