z-vue-design 0.0.45 → 0.0.47

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.
@@ -0,0 +1,3586 @@
1
+ import { defineComponent as ue, computed as F, ref as ve, createVNode as C, cloneVNode as In, isVNode as xn, inject as Fe, provide as _e, onUnmounted as On, shallowRef as Y, watch as pe, watchEffect as Ce, onMounted as Ie, createTextVNode as Me, Fragment as xe, onBeforeUnmount as ke, isRef as $n, reactive as Qe, toRefs as Pn, toRaw as Bt, nextTick as wt, toRef as ge, mergeModels as En, useModel as Fn, resolveComponent as Ct, createBlock as It, openBlock as Ke, mergeProps as Dn, withCtx as xt, createElementBlock as Vn, renderList as Nn, toDisplayString as Rn } from "vue";
2
+ import { _ as b, p as Tn, P as $, J as Mn, b as L, a as ce, c as zt, R as Lt, M as et, K as z, O as tt, Q as nt, m as Ee, S as _n, o as Ae, U as An, V as Bn, X as me, Y as Ot, Z as $t, I as zn, C as Ln, L as Hn, y as ot, $ as Ze, D as he, z as Ht, v as Wn, x as Kn, u as jn, F as Gn, a0 as Un, d as Xn, g as Yn, h as Qn, a1 as Zn, a2 as qn, a3 as Jn, n as kn, s as Pe, q as eo, r as Pt, A as to } from "./index-BS6YL5ju.mjs";
3
+ import { B as no, i as oo, S as lo, D as ao } from "./SearchOutlined-B9T1uhhH.mjs";
4
+ import { u as io, a as Et, C as ro, i as Ft, b as Dt, s as uo, c as so, d as co, e as fo } from "./slide-x_3nore3.mjs";
5
+ import { g as po, a as mo } from "./statusUtils-dYWAju4G.mjs";
6
+ function Vt(e, n) {
7
+ const {
8
+ key: o
9
+ } = e;
10
+ let t;
11
+ return "value" in e && ({
12
+ value: t
13
+ } = e), o ?? (t !== void 0 ? t : `rc-index-key-${n}`);
14
+ }
15
+ function Wt(e, n) {
16
+ const {
17
+ label: o,
18
+ value: t,
19
+ options: l
20
+ } = e || {};
21
+ return {
22
+ label: o || (n ? "children" : "label"),
23
+ value: t || "value",
24
+ options: l || "options"
25
+ };
26
+ }
27
+ function vo(e) {
28
+ let {
29
+ fieldNames: n,
30
+ childrenAsData: o
31
+ } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
32
+ const t = [], {
33
+ label: l,
34
+ value: a,
35
+ options: c
36
+ } = Wt(n, !1);
37
+ function s(m, p) {
38
+ m.forEach((u) => {
39
+ const g = u[l];
40
+ if (p || !(c in u)) {
41
+ const N = u[a];
42
+ t.push({
43
+ key: Vt(u, t.length),
44
+ groupOption: p,
45
+ data: u,
46
+ label: g,
47
+ value: N
48
+ });
49
+ } else {
50
+ let N = g;
51
+ N === void 0 && o && (N = u.label), t.push({
52
+ key: Vt(u, t.length),
53
+ group: !0,
54
+ data: u,
55
+ label: N
56
+ }), s(u[c], !0);
57
+ }
58
+ });
59
+ }
60
+ return s(e, !1), t;
61
+ }
62
+ function qe(e) {
63
+ const n = b({}, e);
64
+ return "props" in n || Object.defineProperty(n, "props", {
65
+ get() {
66
+ return Tn(!1, "Return type is option instead of Option instance. Please read value directly instead of reading from `props`."), n;
67
+ }
68
+ }), n;
69
+ }
70
+ function go(e, n) {
71
+ if (!n || !n.length)
72
+ return null;
73
+ let o = !1;
74
+ function t(a, c) {
75
+ let [s, ...m] = c;
76
+ if (!s)
77
+ return [a];
78
+ const p = a.split(s);
79
+ return o = o || p.length > 1, p.reduce((u, g) => [...u, ...t(g, m)], []).filter((u) => u);
80
+ }
81
+ const l = t(e, n);
82
+ return o ? l : null;
83
+ }
84
+ var ho = function(e, n) {
85
+ var o = {};
86
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
87
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
88
+ n.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (o[t[l]] = e[t[l]]);
89
+ return o;
90
+ };
91
+ const bo = (e) => {
92
+ const n = e === !0 ? 0 : 1;
93
+ return {
94
+ bottomLeft: {
95
+ points: ["tl", "bl"],
96
+ offset: [0, 4],
97
+ overflow: {
98
+ adjustX: n,
99
+ adjustY: 1
100
+ }
101
+ },
102
+ bottomRight: {
103
+ points: ["tr", "br"],
104
+ offset: [0, 4],
105
+ overflow: {
106
+ adjustX: n,
107
+ adjustY: 1
108
+ }
109
+ },
110
+ topLeft: {
111
+ points: ["bl", "tl"],
112
+ offset: [0, -4],
113
+ overflow: {
114
+ adjustX: n,
115
+ adjustY: 1
116
+ }
117
+ },
118
+ topRight: {
119
+ points: ["br", "tr"],
120
+ offset: [0, -4],
121
+ overflow: {
122
+ adjustX: n,
123
+ adjustY: 1
124
+ }
125
+ }
126
+ };
127
+ }, yo = ue({
128
+ name: "SelectTrigger",
129
+ inheritAttrs: !1,
130
+ props: {
131
+ dropdownAlign: Object,
132
+ visible: {
133
+ type: Boolean,
134
+ default: void 0
135
+ },
136
+ disabled: {
137
+ type: Boolean,
138
+ default: void 0
139
+ },
140
+ dropdownClassName: String,
141
+ dropdownStyle: $.object,
142
+ placement: String,
143
+ empty: {
144
+ type: Boolean,
145
+ default: void 0
146
+ },
147
+ prefixCls: String,
148
+ popupClassName: String,
149
+ animation: String,
150
+ transitionName: String,
151
+ getPopupContainer: Function,
152
+ dropdownRender: Function,
153
+ containerWidth: Number,
154
+ dropdownMatchSelectWidth: $.oneOfType([Number, Boolean]).def(!0),
155
+ popupElement: $.any,
156
+ direction: String,
157
+ getTriggerDOMNode: Function,
158
+ onPopupVisibleChange: Function,
159
+ onPopupMouseEnter: Function,
160
+ onPopupFocusin: Function,
161
+ onPopupFocusout: Function
162
+ },
163
+ setup(e, n) {
164
+ let {
165
+ slots: o,
166
+ attrs: t,
167
+ expose: l
168
+ } = n;
169
+ const a = F(() => {
170
+ const {
171
+ dropdownMatchSelectWidth: s
172
+ } = e;
173
+ return bo(s);
174
+ }), c = ve();
175
+ return l({
176
+ getPopupElement: () => c.value
177
+ }), () => {
178
+ const s = b(b({}, e), t), {
179
+ empty: m = !1
180
+ } = s, p = ho(s, ["empty"]), {
181
+ visible: u,
182
+ dropdownAlign: g,
183
+ prefixCls: N,
184
+ popupElement: D,
185
+ dropdownClassName: v,
186
+ dropdownStyle: h,
187
+ direction: y = "ltr",
188
+ placement: S,
189
+ dropdownMatchSelectWidth: V,
190
+ containerWidth: M,
191
+ dropdownRender: O,
192
+ animation: d,
193
+ transitionName: P,
194
+ getPopupContainer: x,
195
+ getTriggerDOMNode: R,
196
+ onPopupVisibleChange: A,
197
+ onPopupMouseEnter: X,
198
+ onPopupFocusin: W,
199
+ onPopupFocusout: ee
200
+ } = p, Q = `${N}-dropdown`;
201
+ let U = D;
202
+ O && (U = O({
203
+ menuNode: D,
204
+ props: e
205
+ }));
206
+ const I = d ? `${Q}-${d}` : P, T = b({
207
+ minWidth: `${M}px`
208
+ }, h);
209
+ return typeof V == "number" ? T.width = `${V}px` : V && (T.width = `${M}px`), C(Mn, L(L({}, e), {}, {
210
+ showAction: A ? ["click"] : [],
211
+ hideAction: A ? ["click"] : [],
212
+ popupPlacement: S || (y === "rtl" ? "bottomRight" : "bottomLeft"),
213
+ builtinPlacements: a.value,
214
+ prefixCls: Q,
215
+ popupTransitionName: I,
216
+ popupAlign: g,
217
+ popupVisible: u,
218
+ getPopupContainer: x,
219
+ popupClassName: ce(v, {
220
+ [`${Q}-empty`]: m
221
+ }),
222
+ popupStyle: T,
223
+ getTriggerDOMNode: R,
224
+ onPopupVisibleChange: A
225
+ }), {
226
+ default: o.default,
227
+ popup: () => C("div", {
228
+ ref: c,
229
+ onMouseenter: X,
230
+ onFocusin: W,
231
+ onFocusout: ee
232
+ }, [U])
233
+ });
234
+ };
235
+ }
236
+ }), ye = (e, n) => {
237
+ let {
238
+ slots: o
239
+ } = n;
240
+ var t;
241
+ const {
242
+ class: l,
243
+ customizeIcon: a,
244
+ customizeIconProps: c,
245
+ onMousedown: s,
246
+ onClick: m
247
+ } = e;
248
+ let p;
249
+ return typeof a == "function" ? p = a(c) : p = xn(a) ? In(a) : a, C("span", {
250
+ class: l,
251
+ onMousedown: (u) => {
252
+ u.preventDefault(), s && s(u);
253
+ },
254
+ style: {
255
+ userSelect: "none",
256
+ WebkitUserSelect: "none"
257
+ },
258
+ unselectable: "on",
259
+ onClick: m,
260
+ "aria-hidden": !0
261
+ }, [p !== void 0 ? p : C("span", {
262
+ class: l.split(/\s+/).map((u) => `${u}-icon`)
263
+ }, [(t = o.default) === null || t === void 0 ? void 0 : t.call(o)])]);
264
+ };
265
+ ye.inheritAttrs = !1;
266
+ ye.displayName = "TransBtn";
267
+ ye.props = {
268
+ class: String,
269
+ customizeIcon: $.any,
270
+ customizeIconProps: $.any,
271
+ onMousedown: Function,
272
+ onClick: Function
273
+ };
274
+ const So = {
275
+ inputRef: $.any,
276
+ prefixCls: String,
277
+ id: String,
278
+ inputElement: $.VueNode,
279
+ disabled: {
280
+ type: Boolean,
281
+ default: void 0
282
+ },
283
+ autofocus: {
284
+ type: Boolean,
285
+ default: void 0
286
+ },
287
+ autocomplete: String,
288
+ editable: {
289
+ type: Boolean,
290
+ default: void 0
291
+ },
292
+ activeDescendantId: String,
293
+ value: String,
294
+ open: {
295
+ type: Boolean,
296
+ default: void 0
297
+ },
298
+ tabindex: $.oneOfType([$.number, $.string]),
299
+ /** Pass accessibility props to input */
300
+ attrs: $.object,
301
+ onKeydown: {
302
+ type: Function
303
+ },
304
+ onMousedown: {
305
+ type: Function
306
+ },
307
+ onChange: {
308
+ type: Function
309
+ },
310
+ onPaste: {
311
+ type: Function
312
+ },
313
+ onCompositionstart: {
314
+ type: Function
315
+ },
316
+ onCompositionend: {
317
+ type: Function
318
+ },
319
+ onFocus: {
320
+ type: Function
321
+ },
322
+ onBlur: {
323
+ type: Function
324
+ }
325
+ }, Kt = ue({
326
+ compatConfig: {
327
+ MODE: 3
328
+ },
329
+ name: "SelectInput",
330
+ inheritAttrs: !1,
331
+ props: So,
332
+ setup(e) {
333
+ let n = null;
334
+ const o = Fe("VCSelectContainerEvent");
335
+ return () => {
336
+ var t;
337
+ const {
338
+ prefixCls: l,
339
+ id: a,
340
+ inputElement: c,
341
+ disabled: s,
342
+ tabindex: m,
343
+ autofocus: p,
344
+ autocomplete: u,
345
+ editable: g,
346
+ activeDescendantId: N,
347
+ value: D,
348
+ onKeydown: v,
349
+ onMousedown: h,
350
+ onChange: y,
351
+ onPaste: S,
352
+ onCompositionstart: V,
353
+ onCompositionend: M,
354
+ onFocus: O,
355
+ onBlur: d,
356
+ open: P,
357
+ inputRef: x,
358
+ attrs: R
359
+ } = e;
360
+ let A = c || C(no, null, null);
361
+ const X = A.props || {}, {
362
+ onKeydown: W,
363
+ onInput: ee,
364
+ onFocus: Q,
365
+ onBlur: U,
366
+ onMousedown: I,
367
+ onCompositionstart: T,
368
+ onCompositionend: j,
369
+ style: Z
370
+ } = X;
371
+ return A = zt(A, b(b(b(b(b({
372
+ type: "search"
373
+ }, X), {
374
+ id: a,
375
+ ref: x,
376
+ disabled: s,
377
+ tabindex: m,
378
+ lazy: !1,
379
+ autocomplete: u || "off",
380
+ autofocus: p,
381
+ class: ce(`${l}-selection-search-input`, (t = A == null ? void 0 : A.props) === null || t === void 0 ? void 0 : t.class),
382
+ role: "combobox",
383
+ "aria-expanded": P,
384
+ "aria-haspopup": "listbox",
385
+ "aria-owns": `${a}_list`,
386
+ "aria-autocomplete": "list",
387
+ "aria-controls": `${a}_list`,
388
+ "aria-activedescendant": N
389
+ }), R), {
390
+ value: g ? D : "",
391
+ readonly: !g,
392
+ unselectable: g ? null : "on",
393
+ style: b(b({}, Z), {
394
+ opacity: g ? null : 0
395
+ }),
396
+ onKeydown: (K) => {
397
+ v(K), W && W(K);
398
+ },
399
+ onMousedown: (K) => {
400
+ h(K), I && I(K);
401
+ },
402
+ onInput: (K) => {
403
+ y(K), ee && ee(K);
404
+ },
405
+ onCompositionstart(K) {
406
+ V(K), T && T(K);
407
+ },
408
+ onCompositionend(K) {
409
+ M(K), j && j(K);
410
+ },
411
+ onPaste: S,
412
+ onFocus: function() {
413
+ clearTimeout(n), Q && Q(arguments.length <= 0 ? void 0 : arguments[0]), O && O(arguments.length <= 0 ? void 0 : arguments[0]), o == null || o.focus(arguments.length <= 0 ? void 0 : arguments[0]);
414
+ },
415
+ onBlur: function() {
416
+ for (var K = arguments.length, ne = new Array(K), _ = 0; _ < K; _++)
417
+ ne[_] = arguments[_];
418
+ n = setTimeout(() => {
419
+ U && U(ne[0]), d && d(ne[0]), o == null || o.blur(ne[0]);
420
+ }, 100);
421
+ }
422
+ }), A.type === "textarea" ? {} : {
423
+ type: "search"
424
+ }), !0, !0), A;
425
+ };
426
+ }
427
+ }), jt = Symbol("OverflowContextProviderKey"), Je = ue({
428
+ compatConfig: {
429
+ MODE: 3
430
+ },
431
+ name: "OverflowContextProvider",
432
+ inheritAttrs: !1,
433
+ props: {
434
+ value: {
435
+ type: Object
436
+ }
437
+ },
438
+ setup(e, n) {
439
+ let {
440
+ slots: o
441
+ } = n;
442
+ return _e(jt, F(() => e.value)), () => {
443
+ var t;
444
+ return (t = o.default) === null || t === void 0 ? void 0 : t.call(o);
445
+ };
446
+ }
447
+ }), wo = () => Fe(jt, F(() => null));
448
+ var Co = function(e, n) {
449
+ var o = {};
450
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
451
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
452
+ n.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (o[t[l]] = e[t[l]]);
453
+ return o;
454
+ };
455
+ const Se = void 0, Te = ue({
456
+ compatConfig: {
457
+ MODE: 3
458
+ },
459
+ name: "Item",
460
+ props: {
461
+ prefixCls: String,
462
+ item: $.any,
463
+ renderItem: Function,
464
+ responsive: Boolean,
465
+ itemKey: {
466
+ type: [String, Number]
467
+ },
468
+ registerSize: Function,
469
+ display: Boolean,
470
+ order: Number,
471
+ component: $.any,
472
+ invalidate: Boolean
473
+ },
474
+ setup(e, n) {
475
+ let {
476
+ slots: o,
477
+ expose: t
478
+ } = n;
479
+ const l = F(() => e.responsive && !e.display), a = ve();
480
+ t({
481
+ itemNodeRef: a
482
+ });
483
+ function c(s) {
484
+ e.registerSize(e.itemKey, s);
485
+ }
486
+ return On(() => {
487
+ c(null);
488
+ }), () => {
489
+ var s;
490
+ const {
491
+ prefixCls: m,
492
+ invalidate: p,
493
+ item: u,
494
+ renderItem: g,
495
+ responsive: N,
496
+ registerSize: D,
497
+ itemKey: v,
498
+ display: h,
499
+ order: y,
500
+ component: S = "div"
501
+ } = e, V = Co(e, ["prefixCls", "invalidate", "item", "renderItem", "responsive", "registerSize", "itemKey", "display", "order", "component"]), M = (s = o.default) === null || s === void 0 ? void 0 : s.call(o), O = g && u !== Se ? g(u) : M;
502
+ let d;
503
+ p || (d = {
504
+ opacity: l.value ? 0 : 1,
505
+ height: l.value ? 0 : Se,
506
+ overflowY: l.value ? "hidden" : Se,
507
+ order: N ? y : Se,
508
+ pointerEvents: l.value ? "none" : Se,
509
+ position: l.value ? "absolute" : Se
510
+ });
511
+ const P = {};
512
+ return l.value && (P["aria-hidden"] = !0), C(Lt, {
513
+ disabled: !N,
514
+ onResize: (x) => {
515
+ let {
516
+ offsetWidth: R
517
+ } = x;
518
+ c(R);
519
+ }
520
+ }, {
521
+ default: () => C(S, L(L(L({
522
+ class: ce(!p && m),
523
+ style: d
524
+ }, P), V), {}, {
525
+ ref: a
526
+ }), {
527
+ default: () => [O]
528
+ })
529
+ });
530
+ };
531
+ }
532
+ });
533
+ var je = function(e, n) {
534
+ var o = {};
535
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
536
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
537
+ n.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (o[t[l]] = e[t[l]]);
538
+ return o;
539
+ };
540
+ const Io = ue({
541
+ compatConfig: {
542
+ MODE: 3
543
+ },
544
+ name: "RawItem",
545
+ inheritAttrs: !1,
546
+ props: {
547
+ component: $.any,
548
+ title: $.any,
549
+ id: String,
550
+ onMouseenter: {
551
+ type: Function
552
+ },
553
+ onMouseleave: {
554
+ type: Function
555
+ },
556
+ onClick: {
557
+ type: Function
558
+ },
559
+ onKeydown: {
560
+ type: Function
561
+ },
562
+ onFocus: {
563
+ type: Function
564
+ },
565
+ role: String,
566
+ tabindex: Number
567
+ },
568
+ setup(e, n) {
569
+ let {
570
+ slots: o,
571
+ attrs: t
572
+ } = n;
573
+ const l = wo();
574
+ return () => {
575
+ var a;
576
+ if (!l.value) {
577
+ const {
578
+ component: g = "div"
579
+ } = e, N = je(e, ["component"]);
580
+ return C(g, L(L({}, N), t), {
581
+ default: () => [(a = o.default) === null || a === void 0 ? void 0 : a.call(o)]
582
+ });
583
+ }
584
+ const c = l.value, {
585
+ className: s
586
+ } = c, m = je(c, ["className"]), {
587
+ class: p
588
+ } = t, u = je(t, ["class"]);
589
+ return C(Je, {
590
+ value: null
591
+ }, {
592
+ default: () => [C(Te, L(L(L({
593
+ class: ce(s, p)
594
+ }, m), u), e), o)]
595
+ });
596
+ };
597
+ }
598
+ });
599
+ var xo = function(e, n) {
600
+ var o = {};
601
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
602
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
603
+ n.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (o[t[l]] = e[t[l]]);
604
+ return o;
605
+ };
606
+ const Gt = "responsive", Ut = "invalidate";
607
+ function Oo(e) {
608
+ return `+ ${e.length} ...`;
609
+ }
610
+ const $o = () => ({
611
+ id: String,
612
+ prefixCls: String,
613
+ data: Array,
614
+ itemKey: [String, Number, Function],
615
+ /** Used for `responsive`. It will limit render node to avoid perf issue */
616
+ itemWidth: {
617
+ type: Number,
618
+ default: 10
619
+ },
620
+ renderItem: Function,
621
+ /** @private Do not use in your production. Render raw node that need wrap Item by developer self */
622
+ renderRawItem: Function,
623
+ maxCount: [Number, String],
624
+ renderRest: Function,
625
+ /** @private Do not use in your production. Render raw node that need wrap Item by developer self */
626
+ renderRawRest: Function,
627
+ suffix: $.any,
628
+ component: String,
629
+ itemComponent: $.any,
630
+ /** @private This API may be refactor since not well design */
631
+ onVisibleChange: Function,
632
+ /** When set to `full`, ssr will render full items by default and remove at client side */
633
+ ssr: String,
634
+ onMousedown: Function,
635
+ role: String
636
+ }), Be = ue({
637
+ name: "Overflow",
638
+ inheritAttrs: !1,
639
+ props: $o(),
640
+ emits: ["visibleChange"],
641
+ setup(e, n) {
642
+ let {
643
+ attrs: o,
644
+ emit: t,
645
+ slots: l
646
+ } = n;
647
+ const a = F(() => e.ssr === "full"), c = Y(null), s = F(() => c.value || 0), m = Y(/* @__PURE__ */ new Map()), p = Y(0), u = Y(0), g = Y(0), N = Y(null), D = Y(null), v = F(() => D.value === null && a.value ? Number.MAX_SAFE_INTEGER : D.value || 0), h = Y(!1), y = F(() => `${e.prefixCls}-item`), S = F(() => Math.max(p.value, u.value)), V = F(() => !!(e.data.length && e.maxCount === Gt)), M = F(() => e.maxCount === Ut), O = F(() => V.value || typeof e.maxCount == "number" && e.data.length > e.maxCount), d = F(() => {
648
+ let I = e.data;
649
+ return V.value ? c.value === null && a.value ? I = e.data : I = e.data.slice(0, Math.min(e.data.length, s.value / e.itemWidth)) : typeof e.maxCount == "number" && (I = e.data.slice(0, e.maxCount)), I;
650
+ }), P = F(() => V.value ? e.data.slice(v.value + 1) : e.data.slice(d.value.length)), x = (I, T) => {
651
+ var j;
652
+ return typeof e.itemKey == "function" ? e.itemKey(I) : (j = e.itemKey && (I == null ? void 0 : I[e.itemKey])) !== null && j !== void 0 ? j : T;
653
+ }, R = F(() => e.renderItem || ((I) => I)), A = (I, T) => {
654
+ D.value = I, T || (h.value = I < e.data.length - 1, t("visibleChange", I));
655
+ }, X = (I, T) => {
656
+ c.value = T.clientWidth;
657
+ }, W = (I, T) => {
658
+ const j = new Map(m.value);
659
+ T === null ? j.delete(I) : j.set(I, T), m.value = j;
660
+ }, ee = (I, T) => {
661
+ p.value = u.value, u.value = T;
662
+ }, Q = (I, T) => {
663
+ g.value = T;
664
+ }, U = (I) => m.value.get(x(d.value[I], I));
665
+ return pe([s, m, u, g, () => e.itemKey, d], () => {
666
+ if (s.value && S.value && d.value) {
667
+ let I = g.value;
668
+ const T = d.value.length, j = T - 1;
669
+ if (!T) {
670
+ A(0), N.value = null;
671
+ return;
672
+ }
673
+ for (let Z = 0; Z < T; Z += 1) {
674
+ const K = U(Z);
675
+ if (K === void 0) {
676
+ A(Z - 1, !0);
677
+ break;
678
+ }
679
+ if (I += K, // Only one means `totalWidth` is the final width
680
+ j === 0 && I <= s.value || // Last two width will be the final width
681
+ Z === j - 1 && I + U(j) <= s.value) {
682
+ A(j), N.value = null;
683
+ break;
684
+ } else if (I + S.value > s.value) {
685
+ A(Z - 1), N.value = I - K - g.value + u.value;
686
+ break;
687
+ }
688
+ }
689
+ e.suffix && U(0) + g.value > s.value && (N.value = null);
690
+ }
691
+ }), () => {
692
+ const I = h.value && !!P.value.length, {
693
+ itemComponent: T,
694
+ renderRawItem: j,
695
+ renderRawRest: Z,
696
+ renderRest: K,
697
+ prefixCls: ne = "rc-overflow",
698
+ suffix: _,
699
+ component: q = "div",
700
+ id: oe,
701
+ onMousedown: ie
702
+ } = e, {
703
+ class: re,
704
+ style: te
705
+ } = o, de = xo(o, ["class", "style"]);
706
+ let se = {};
707
+ N.value !== null && V.value && (se = {
708
+ position: "absolute",
709
+ left: `${N.value}px`,
710
+ top: 0
711
+ });
712
+ const f = {
713
+ prefixCls: y.value,
714
+ responsive: V.value,
715
+ component: T,
716
+ invalidate: M.value
717
+ }, i = j ? (B, H) => {
718
+ const G = x(B, H);
719
+ return C(Je, {
720
+ key: G,
721
+ value: b(b({}, f), {
722
+ order: H,
723
+ item: B,
724
+ itemKey: G,
725
+ registerSize: W,
726
+ display: H <= v.value
727
+ })
728
+ }, {
729
+ default: () => [j(B, H)]
730
+ });
731
+ } : (B, H) => {
732
+ const G = x(B, H);
733
+ return C(Te, L(L({}, f), {}, {
734
+ order: H,
735
+ key: G,
736
+ item: B,
737
+ renderItem: R.value,
738
+ itemKey: G,
739
+ registerSize: W,
740
+ display: H <= v.value
741
+ }), null);
742
+ };
743
+ let r = () => null;
744
+ const E = {
745
+ order: I ? v.value : Number.MAX_SAFE_INTEGER,
746
+ className: `${y.value} ${y.value}-rest`,
747
+ registerSize: ee,
748
+ display: I
749
+ };
750
+ if (Z)
751
+ Z && (r = () => C(Je, {
752
+ value: b(b({}, f), E)
753
+ }, {
754
+ default: () => [Z(P.value)]
755
+ }));
756
+ else {
757
+ const B = K || Oo;
758
+ r = () => C(Te, L(L({}, f), E), {
759
+ default: () => typeof B == "function" ? B(P.value) : B
760
+ });
761
+ }
762
+ const w = () => {
763
+ var B;
764
+ return C(q, L({
765
+ id: oe,
766
+ class: ce(!M.value && ne, re),
767
+ style: te,
768
+ onMousedown: ie,
769
+ role: e.role
770
+ }, de), {
771
+ default: () => [d.value.map(i), O.value ? r() : null, _ && C(Te, L(L({}, f), {}, {
772
+ order: v.value,
773
+ class: `${y.value}-suffix`,
774
+ registerSize: Q,
775
+ display: !0,
776
+ style: se
777
+ }), {
778
+ default: () => _
779
+ }), (B = l.default) === null || B === void 0 ? void 0 : B.call(l)]
780
+ });
781
+ };
782
+ return C(Lt, {
783
+ disabled: !V.value,
784
+ onResize: X
785
+ }, {
786
+ default: w
787
+ });
788
+ };
789
+ }
790
+ });
791
+ Be.Item = Io;
792
+ Be.RESPONSIVE = Gt;
793
+ Be.INVALIDATE = Ut;
794
+ const Po = Symbol("TreeSelectLegacyContextPropsKey");
795
+ function lt() {
796
+ return Fe(Po, {});
797
+ }
798
+ const Eo = {
799
+ id: String,
800
+ prefixCls: String,
801
+ values: $.array,
802
+ open: {
803
+ type: Boolean,
804
+ default: void 0
805
+ },
806
+ searchValue: String,
807
+ inputRef: $.any,
808
+ placeholder: $.any,
809
+ disabled: {
810
+ type: Boolean,
811
+ default: void 0
812
+ },
813
+ mode: String,
814
+ showSearch: {
815
+ type: Boolean,
816
+ default: void 0
817
+ },
818
+ autofocus: {
819
+ type: Boolean,
820
+ default: void 0
821
+ },
822
+ autocomplete: String,
823
+ activeDescendantId: String,
824
+ tabindex: $.oneOfType([$.number, $.string]),
825
+ compositionStatus: Boolean,
826
+ removeIcon: $.any,
827
+ choiceTransitionName: String,
828
+ maxTagCount: $.oneOfType([$.number, $.string]),
829
+ maxTagTextLength: Number,
830
+ maxTagPlaceholder: $.any.def(() => (e) => `+ ${e.length} ...`),
831
+ tagRender: Function,
832
+ onToggleOpen: {
833
+ type: Function
834
+ },
835
+ onRemove: Function,
836
+ onInputChange: Function,
837
+ onInputPaste: Function,
838
+ onInputKeyDown: Function,
839
+ onInputMouseDown: Function,
840
+ onInputCompositionStart: Function,
841
+ onInputCompositionEnd: Function
842
+ }, Nt = (e) => {
843
+ e.preventDefault(), e.stopPropagation();
844
+ }, Fo = ue({
845
+ name: "MultipleSelectSelector",
846
+ inheritAttrs: !1,
847
+ props: Eo,
848
+ setup(e) {
849
+ const n = Y(), o = Y(0), t = Y(!1), l = lt(), a = F(() => `${e.prefixCls}-selection`), c = F(() => e.open || e.mode === "tags" ? e.searchValue : ""), s = F(() => e.mode === "tags" || e.showSearch && (e.open || t.value)), m = ve("");
850
+ Ce(() => {
851
+ m.value = c.value;
852
+ }), Ie(() => {
853
+ pe(m, () => {
854
+ o.value = n.value.scrollWidth;
855
+ }, {
856
+ flush: "post",
857
+ immediate: !0
858
+ });
859
+ });
860
+ function p(v, h, y, S, V) {
861
+ return C("span", {
862
+ class: ce(`${a.value}-item`, {
863
+ [`${a.value}-item-disabled`]: y
864
+ }),
865
+ title: typeof v == "string" || typeof v == "number" ? v.toString() : void 0
866
+ }, [C("span", {
867
+ class: `${a.value}-item-content`
868
+ }, [h]), S && C(ye, {
869
+ class: `${a.value}-item-remove`,
870
+ onMousedown: Nt,
871
+ onClick: V,
872
+ customizeIcon: e.removeIcon
873
+ }, {
874
+ default: () => [Me("×")]
875
+ })]);
876
+ }
877
+ function u(v, h, y, S, V, M) {
878
+ var O;
879
+ const d = (x) => {
880
+ Nt(x), e.onToggleOpen(!open);
881
+ };
882
+ let P = M;
883
+ return l.keyEntities && (P = ((O = l.keyEntities[v]) === null || O === void 0 ? void 0 : O.node) || {}), C("span", {
884
+ key: v,
885
+ onMousedown: d
886
+ }, [e.tagRender({
887
+ label: h,
888
+ value: v,
889
+ disabled: y,
890
+ closable: S,
891
+ onClose: V,
892
+ option: P
893
+ })]);
894
+ }
895
+ function g(v) {
896
+ const {
897
+ disabled: h,
898
+ label: y,
899
+ value: S,
900
+ option: V
901
+ } = v, M = !e.disabled && !h;
902
+ let O = y;
903
+ if (typeof e.maxTagTextLength == "number" && (typeof y == "string" || typeof y == "number")) {
904
+ const P = String(O);
905
+ P.length > e.maxTagTextLength && (O = `${P.slice(0, e.maxTagTextLength)}...`);
906
+ }
907
+ const d = (P) => {
908
+ var x;
909
+ P && P.stopPropagation(), (x = e.onRemove) === null || x === void 0 || x.call(e, v);
910
+ };
911
+ return typeof e.tagRender == "function" ? u(S, O, h, M, d, V) : p(y, O, h, M, d);
912
+ }
913
+ function N(v) {
914
+ const {
915
+ maxTagPlaceholder: h = (S) => `+ ${S.length} ...`
916
+ } = e, y = typeof h == "function" ? h(v) : h;
917
+ return p(y, y, !1);
918
+ }
919
+ const D = (v) => {
920
+ const h = v.target.composing;
921
+ m.value = v.target.value, h || e.onInputChange(v);
922
+ };
923
+ return () => {
924
+ const {
925
+ id: v,
926
+ prefixCls: h,
927
+ values: y,
928
+ open: S,
929
+ inputRef: V,
930
+ placeholder: M,
931
+ disabled: O,
932
+ autofocus: d,
933
+ autocomplete: P,
934
+ activeDescendantId: x,
935
+ tabindex: R,
936
+ compositionStatus: A,
937
+ onInputPaste: X,
938
+ onInputKeyDown: W,
939
+ onInputMouseDown: ee,
940
+ onInputCompositionStart: Q,
941
+ onInputCompositionEnd: U
942
+ } = e, I = C("div", {
943
+ class: `${a.value}-search`,
944
+ style: {
945
+ width: o.value + "px"
946
+ },
947
+ key: "input"
948
+ }, [C(Kt, {
949
+ inputRef: V,
950
+ open: S,
951
+ prefixCls: h,
952
+ id: v,
953
+ inputElement: null,
954
+ disabled: O,
955
+ autofocus: d,
956
+ autocomplete: P,
957
+ editable: s.value,
958
+ activeDescendantId: x,
959
+ value: m.value,
960
+ onKeydown: W,
961
+ onMousedown: ee,
962
+ onChange: D,
963
+ onPaste: X,
964
+ onCompositionstart: Q,
965
+ onCompositionend: U,
966
+ tabindex: R,
967
+ attrs: et(e, !0),
968
+ onFocus: () => t.value = !0,
969
+ onBlur: () => t.value = !1
970
+ }, null), C("span", {
971
+ ref: n,
972
+ class: `${a.value}-search-mirror`,
973
+ "aria-hidden": !0
974
+ }, [m.value, Me(" ")])]), T = C(Be, {
975
+ prefixCls: `${a.value}-overflow`,
976
+ data: y,
977
+ renderItem: g,
978
+ renderRest: N,
979
+ suffix: I,
980
+ itemKey: "key",
981
+ maxCount: e.maxTagCount,
982
+ key: "overflow"
983
+ }, null);
984
+ return C(xe, null, [T, !y.length && !c.value && !A && C("span", {
985
+ class: `${a.value}-placeholder`
986
+ }, [M])]);
987
+ };
988
+ }
989
+ }), Do = {
990
+ inputElement: $.any,
991
+ id: String,
992
+ prefixCls: String,
993
+ values: $.array,
994
+ open: {
995
+ type: Boolean,
996
+ default: void 0
997
+ },
998
+ searchValue: String,
999
+ inputRef: $.any,
1000
+ placeholder: $.any,
1001
+ compositionStatus: {
1002
+ type: Boolean,
1003
+ default: void 0
1004
+ },
1005
+ disabled: {
1006
+ type: Boolean,
1007
+ default: void 0
1008
+ },
1009
+ mode: String,
1010
+ showSearch: {
1011
+ type: Boolean,
1012
+ default: void 0
1013
+ },
1014
+ autofocus: {
1015
+ type: Boolean,
1016
+ default: void 0
1017
+ },
1018
+ autocomplete: String,
1019
+ activeDescendantId: String,
1020
+ tabindex: $.oneOfType([$.number, $.string]),
1021
+ activeValue: String,
1022
+ backfill: {
1023
+ type: Boolean,
1024
+ default: void 0
1025
+ },
1026
+ optionLabelRender: Function,
1027
+ onInputChange: Function,
1028
+ onInputPaste: Function,
1029
+ onInputKeyDown: Function,
1030
+ onInputMouseDown: Function,
1031
+ onInputCompositionStart: Function,
1032
+ onInputCompositionEnd: Function
1033
+ }, at = ue({
1034
+ name: "SingleSelector",
1035
+ setup(e) {
1036
+ const n = Y(!1), o = F(() => e.mode === "combobox"), t = F(() => o.value || e.showSearch), l = F(() => {
1037
+ let u = e.searchValue || "";
1038
+ return o.value && e.activeValue && !n.value && (u = e.activeValue), u;
1039
+ }), a = lt();
1040
+ pe([o, () => e.activeValue], () => {
1041
+ o.value && (n.value = !1);
1042
+ }, {
1043
+ immediate: !0
1044
+ });
1045
+ const c = F(() => e.mode !== "combobox" && !e.open && !e.showSearch ? !1 : !!l.value || e.compositionStatus), s = F(() => {
1046
+ const u = e.values[0];
1047
+ return u && (typeof u.label == "string" || typeof u.label == "number") ? u.label.toString() : void 0;
1048
+ }), m = () => {
1049
+ if (e.values[0])
1050
+ return null;
1051
+ const u = c.value ? {
1052
+ visibility: "hidden"
1053
+ } : void 0;
1054
+ return C("span", {
1055
+ class: `${e.prefixCls}-selection-placeholder`,
1056
+ style: u
1057
+ }, [e.placeholder]);
1058
+ }, p = (u) => {
1059
+ u.target.composing || (n.value = !0, e.onInputChange(u));
1060
+ };
1061
+ return () => {
1062
+ var u, g, N, D;
1063
+ const {
1064
+ inputElement: v,
1065
+ prefixCls: h,
1066
+ id: y,
1067
+ values: S,
1068
+ inputRef: V,
1069
+ disabled: M,
1070
+ autofocus: O,
1071
+ autocomplete: d,
1072
+ activeDescendantId: P,
1073
+ open: x,
1074
+ tabindex: R,
1075
+ optionLabelRender: A,
1076
+ onInputKeyDown: X,
1077
+ onInputMouseDown: W,
1078
+ onInputPaste: ee,
1079
+ onInputCompositionStart: Q,
1080
+ onInputCompositionEnd: U
1081
+ } = e, I = S[0];
1082
+ let T = null;
1083
+ if (I && a.customSlots) {
1084
+ const j = (u = I.key) !== null && u !== void 0 ? u : I.value, Z = ((g = a.keyEntities[j]) === null || g === void 0 ? void 0 : g.node) || {};
1085
+ T = a.customSlots[(N = Z.slots) === null || N === void 0 ? void 0 : N.title] || a.customSlots.title || I.label, typeof T == "function" && (T = T(Z));
1086
+ } else
1087
+ T = A && I ? A(I.option) : I == null ? void 0 : I.label;
1088
+ return C(xe, null, [C("span", {
1089
+ class: `${h}-selection-search`
1090
+ }, [C(Kt, {
1091
+ inputRef: V,
1092
+ prefixCls: h,
1093
+ id: y,
1094
+ open: x,
1095
+ inputElement: v,
1096
+ disabled: M,
1097
+ autofocus: O,
1098
+ autocomplete: d,
1099
+ editable: t.value,
1100
+ activeDescendantId: P,
1101
+ value: l.value,
1102
+ onKeydown: X,
1103
+ onMousedown: W,
1104
+ onChange: p,
1105
+ onPaste: ee,
1106
+ onCompositionstart: Q,
1107
+ onCompositionend: U,
1108
+ tabindex: R,
1109
+ attrs: et(e, !0)
1110
+ }, null)]), !o.value && I && !c.value && C("span", {
1111
+ class: `${h}-selection-item`,
1112
+ title: s.value
1113
+ }, [C(xe, {
1114
+ key: (D = I.key) !== null && D !== void 0 ? D : I.value
1115
+ }, [T])]), m()]);
1116
+ };
1117
+ }
1118
+ });
1119
+ at.props = Do;
1120
+ at.inheritAttrs = !1;
1121
+ function Vo(e) {
1122
+ return ![
1123
+ // System function button
1124
+ z.ESC,
1125
+ z.SHIFT,
1126
+ z.BACKSPACE,
1127
+ z.TAB,
1128
+ z.WIN_KEY,
1129
+ z.ALT,
1130
+ z.META,
1131
+ z.WIN_KEY_RIGHT,
1132
+ z.CTRL,
1133
+ z.SEMICOLON,
1134
+ z.EQUALS,
1135
+ z.CAPS_LOCK,
1136
+ z.CONTEXT_MENU,
1137
+ // F1-F12
1138
+ z.F1,
1139
+ z.F2,
1140
+ z.F3,
1141
+ z.F4,
1142
+ z.F5,
1143
+ z.F6,
1144
+ z.F7,
1145
+ z.F8,
1146
+ z.F9,
1147
+ z.F10,
1148
+ z.F11,
1149
+ z.F12
1150
+ ].includes(e);
1151
+ }
1152
+ function Xt() {
1153
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250, n = null, o;
1154
+ ke(() => {
1155
+ clearTimeout(o);
1156
+ });
1157
+ function t(l) {
1158
+ (l || n === null) && (n = l), clearTimeout(o), o = setTimeout(() => {
1159
+ n = null;
1160
+ }, e);
1161
+ }
1162
+ return [() => n, t];
1163
+ }
1164
+ const No = ue({
1165
+ name: "Selector",
1166
+ inheritAttrs: !1,
1167
+ props: {
1168
+ id: String,
1169
+ prefixCls: String,
1170
+ showSearch: {
1171
+ type: Boolean,
1172
+ default: void 0
1173
+ },
1174
+ open: {
1175
+ type: Boolean,
1176
+ default: void 0
1177
+ },
1178
+ /** Display in the Selector value, it's not same as `value` prop */
1179
+ values: $.array,
1180
+ multiple: {
1181
+ type: Boolean,
1182
+ default: void 0
1183
+ },
1184
+ mode: String,
1185
+ searchValue: String,
1186
+ activeValue: String,
1187
+ inputElement: $.any,
1188
+ autofocus: {
1189
+ type: Boolean,
1190
+ default: void 0
1191
+ },
1192
+ activeDescendantId: String,
1193
+ tabindex: $.oneOfType([$.number, $.string]),
1194
+ disabled: {
1195
+ type: Boolean,
1196
+ default: void 0
1197
+ },
1198
+ placeholder: $.any,
1199
+ removeIcon: $.any,
1200
+ // Tags
1201
+ maxTagCount: $.oneOfType([$.number, $.string]),
1202
+ maxTagTextLength: Number,
1203
+ maxTagPlaceholder: $.any,
1204
+ tagRender: Function,
1205
+ optionLabelRender: Function,
1206
+ /** Check if `tokenSeparators` contains `\n` or `\r\n` */
1207
+ tokenWithEnter: {
1208
+ type: Boolean,
1209
+ default: void 0
1210
+ },
1211
+ // Motion
1212
+ choiceTransitionName: String,
1213
+ onToggleOpen: {
1214
+ type: Function
1215
+ },
1216
+ /** `onSearch` returns go next step boolean to check if need do toggle open */
1217
+ onSearch: Function,
1218
+ onSearchSubmit: Function,
1219
+ onRemove: Function,
1220
+ onInputKeyDown: {
1221
+ type: Function
1222
+ },
1223
+ /**
1224
+ * @private get real dom for trigger align.
1225
+ * This may be removed after React provides replacement of `findDOMNode`
1226
+ */
1227
+ domRef: Function
1228
+ },
1229
+ setup(e, n) {
1230
+ let {
1231
+ expose: o
1232
+ } = n;
1233
+ const t = tt(), l = ve(!1), [a, c] = Xt(0), s = (S) => {
1234
+ const {
1235
+ which: V
1236
+ } = S;
1237
+ (V === z.UP || V === z.DOWN) && S.preventDefault(), e.onInputKeyDown && e.onInputKeyDown(S), V === z.ENTER && e.mode === "tags" && !l.value && !e.open && e.onSearchSubmit(S.target.value), Vo(V) && e.onToggleOpen(!0);
1238
+ }, m = () => {
1239
+ c(!0);
1240
+ };
1241
+ let p = null;
1242
+ const u = (S) => {
1243
+ e.onSearch(S, !0, l.value) !== !1 && e.onToggleOpen(!0);
1244
+ }, g = () => {
1245
+ l.value = !0;
1246
+ }, N = (S) => {
1247
+ l.value = !1, e.mode !== "combobox" && u(S.target.value);
1248
+ }, D = (S) => {
1249
+ let {
1250
+ target: {
1251
+ value: V
1252
+ }
1253
+ } = S;
1254
+ if (e.tokenWithEnter && p && /[\r\n]/.test(p)) {
1255
+ const M = p.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " ");
1256
+ V = V.replace(M, p);
1257
+ }
1258
+ p = null, u(V);
1259
+ }, v = (S) => {
1260
+ const {
1261
+ clipboardData: V
1262
+ } = S;
1263
+ p = V.getData("text");
1264
+ }, h = (S) => {
1265
+ let {
1266
+ target: V
1267
+ } = S;
1268
+ V !== t.current && (document.body.style.msTouchAction !== void 0 ? setTimeout(() => {
1269
+ t.current.focus();
1270
+ }) : t.current.focus());
1271
+ }, y = (S) => {
1272
+ const V = a();
1273
+ S.target !== t.current && !V && S.preventDefault(), (e.mode !== "combobox" && (!e.showSearch || !V) || !e.open) && (e.open && e.onSearch("", !0, !1), e.onToggleOpen());
1274
+ };
1275
+ return o({
1276
+ focus: () => {
1277
+ t.current.focus();
1278
+ },
1279
+ blur: () => {
1280
+ t.current.blur();
1281
+ }
1282
+ }), () => {
1283
+ const {
1284
+ prefixCls: S,
1285
+ domRef: V,
1286
+ mode: M
1287
+ } = e, O = {
1288
+ inputRef: t,
1289
+ onInputKeyDown: s,
1290
+ onInputMouseDown: m,
1291
+ onInputChange: D,
1292
+ onInputPaste: v,
1293
+ compositionStatus: l.value,
1294
+ onInputCompositionStart: g,
1295
+ onInputCompositionEnd: N
1296
+ }, d = M === "multiple" || M === "tags" ? C(Fo, L(L({}, e), O), null) : C(at, L(L({}, e), O), null);
1297
+ return C("div", {
1298
+ ref: V,
1299
+ class: `${S}-selector`,
1300
+ onClick: h,
1301
+ onMousedown: y
1302
+ }, [d]);
1303
+ };
1304
+ }
1305
+ });
1306
+ function Ro(e, n, o) {
1307
+ function t(l) {
1308
+ var a, c, s;
1309
+ let m = l.target;
1310
+ m.shadowRoot && l.composed && (m = l.composedPath()[0] || m);
1311
+ const p = [(a = e[0]) === null || a === void 0 ? void 0 : a.value, (s = (c = e[1]) === null || c === void 0 ? void 0 : c.value) === null || s === void 0 ? void 0 : s.getPopupElement()];
1312
+ n.value && p.every((u) => u && !u.contains(m) && u !== m) && o(!1);
1313
+ }
1314
+ Ie(() => {
1315
+ window.addEventListener("mousedown", t);
1316
+ }), ke(() => {
1317
+ window.removeEventListener("mousedown", t);
1318
+ });
1319
+ }
1320
+ function To() {
1321
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10;
1322
+ const n = Y(!1);
1323
+ let o;
1324
+ const t = () => {
1325
+ clearTimeout(o);
1326
+ };
1327
+ return Ie(() => {
1328
+ t();
1329
+ }), [n, (a, c) => {
1330
+ t(), o = setTimeout(() => {
1331
+ n.value = a, c && c();
1332
+ }, e);
1333
+ }, t];
1334
+ }
1335
+ const Yt = Symbol("BaseSelectContextKey");
1336
+ function Mo(e) {
1337
+ return _e(Yt, e);
1338
+ }
1339
+ function _o() {
1340
+ return Fe(Yt, {});
1341
+ }
1342
+ function Qt(e) {
1343
+ if (!$n(e)) return Qe(e);
1344
+ const n = new Proxy({}, {
1345
+ get(o, t, l) {
1346
+ return Reflect.get(e.value, t, l);
1347
+ },
1348
+ set(o, t, l) {
1349
+ return e.value[t] = l, !0;
1350
+ },
1351
+ deleteProperty(o, t) {
1352
+ return Reflect.deleteProperty(e.value, t);
1353
+ },
1354
+ has(o, t) {
1355
+ return Reflect.has(e.value, t);
1356
+ },
1357
+ ownKeys() {
1358
+ return Object.keys(e.value);
1359
+ },
1360
+ getOwnPropertyDescriptor() {
1361
+ return {
1362
+ enumerable: !0,
1363
+ configurable: !0
1364
+ };
1365
+ }
1366
+ });
1367
+ return Qe(n);
1368
+ }
1369
+ var Ao = function(e, n) {
1370
+ var o = {};
1371
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
1372
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
1373
+ n.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (o[t[l]] = e[t[l]]);
1374
+ return o;
1375
+ };
1376
+ const Bo = ["value", "onChange", "removeIcon", "placeholder", "autofocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabindex", "OptionList", "notFoundContent"], zo = () => ({
1377
+ prefixCls: String,
1378
+ id: String,
1379
+ omitDomProps: Array,
1380
+ // >>> Value
1381
+ displayValues: Array,
1382
+ onDisplayValuesChange: Function,
1383
+ // >>> Active
1384
+ /** Current dropdown list active item string value */
1385
+ activeValue: String,
1386
+ /** Link search input with target element */
1387
+ activeDescendantId: String,
1388
+ onActiveValueChange: Function,
1389
+ // >>> Search
1390
+ searchValue: String,
1391
+ /** Trigger onSearch, return false to prevent trigger open event */
1392
+ onSearch: Function,
1393
+ /** Trigger when search text match the `tokenSeparators`. Will provide split content */
1394
+ onSearchSplit: Function,
1395
+ maxLength: Number,
1396
+ OptionList: $.any,
1397
+ /** Tell if provided `options` is empty */
1398
+ emptyOptions: Boolean
1399
+ }), Zt = () => ({
1400
+ showSearch: {
1401
+ type: Boolean,
1402
+ default: void 0
1403
+ },
1404
+ tagRender: {
1405
+ type: Function
1406
+ },
1407
+ optionLabelRender: {
1408
+ type: Function
1409
+ },
1410
+ direction: {
1411
+ type: String
1412
+ },
1413
+ // MISC
1414
+ tabindex: Number,
1415
+ autofocus: Boolean,
1416
+ notFoundContent: $.any,
1417
+ placeholder: $.any,
1418
+ onClear: Function,
1419
+ choiceTransitionName: String,
1420
+ // >>> Mode
1421
+ mode: String,
1422
+ // >>> Status
1423
+ disabled: {
1424
+ type: Boolean,
1425
+ default: void 0
1426
+ },
1427
+ loading: {
1428
+ type: Boolean,
1429
+ default: void 0
1430
+ },
1431
+ // >>> Open
1432
+ open: {
1433
+ type: Boolean,
1434
+ default: void 0
1435
+ },
1436
+ defaultOpen: {
1437
+ type: Boolean,
1438
+ default: void 0
1439
+ },
1440
+ onDropdownVisibleChange: {
1441
+ type: Function
1442
+ },
1443
+ // >>> Customize Input
1444
+ /** @private Internal usage. Do not use in your production. */
1445
+ getInputElement: {
1446
+ type: Function
1447
+ },
1448
+ /** @private Internal usage. Do not use in your production. */
1449
+ getRawInputElement: {
1450
+ type: Function
1451
+ },
1452
+ // >>> Selector
1453
+ maxTagTextLength: Number,
1454
+ maxTagCount: {
1455
+ type: [String, Number]
1456
+ },
1457
+ maxTagPlaceholder: $.any,
1458
+ // >>> Search
1459
+ tokenSeparators: {
1460
+ type: Array
1461
+ },
1462
+ // >>> Icons
1463
+ allowClear: {
1464
+ type: Boolean,
1465
+ default: void 0
1466
+ },
1467
+ showArrow: {
1468
+ type: Boolean,
1469
+ default: void 0
1470
+ },
1471
+ inputIcon: $.any,
1472
+ /** Clear all icon */
1473
+ clearIcon: $.any,
1474
+ /** Selector remove icon */
1475
+ removeIcon: $.any,
1476
+ // >>> Dropdown
1477
+ animation: String,
1478
+ transitionName: String,
1479
+ dropdownStyle: {
1480
+ type: Object
1481
+ },
1482
+ dropdownClassName: String,
1483
+ dropdownMatchSelectWidth: {
1484
+ type: [Boolean, Number],
1485
+ default: void 0
1486
+ },
1487
+ dropdownRender: {
1488
+ type: Function
1489
+ },
1490
+ dropdownAlign: Object,
1491
+ placement: {
1492
+ type: String
1493
+ },
1494
+ getPopupContainer: {
1495
+ type: Function
1496
+ },
1497
+ // >>> Focus
1498
+ showAction: {
1499
+ type: Array
1500
+ },
1501
+ onBlur: {
1502
+ type: Function
1503
+ },
1504
+ onFocus: {
1505
+ type: Function
1506
+ },
1507
+ // >>> Rest Events
1508
+ onKeyup: Function,
1509
+ onKeydown: Function,
1510
+ onMousedown: Function,
1511
+ onPopupScroll: Function,
1512
+ onInputKeyDown: Function,
1513
+ onMouseenter: Function,
1514
+ onMouseleave: Function,
1515
+ onClick: Function
1516
+ }), Lo = () => b(b({}, zo()), Zt());
1517
+ function it(e) {
1518
+ return e === "tags" || e === "multiple";
1519
+ }
1520
+ const Ho = ue({
1521
+ compatConfig: {
1522
+ MODE: 3
1523
+ },
1524
+ name: "BaseSelect",
1525
+ inheritAttrs: !1,
1526
+ props: nt(Lo(), {
1527
+ showAction: [],
1528
+ notFoundContent: "Not Found"
1529
+ }),
1530
+ setup(e, n) {
1531
+ let {
1532
+ attrs: o,
1533
+ expose: t,
1534
+ slots: l
1535
+ } = n;
1536
+ const a = F(() => it(e.mode)), c = F(() => e.showSearch !== void 0 ? e.showSearch : a.value || e.mode === "combobox"), s = Y(!1);
1537
+ Ie(() => {
1538
+ s.value = oo();
1539
+ });
1540
+ const m = lt(), p = Y(null), u = tt(), g = Y(null), N = Y(null), D = Y(null), v = ve(!1), [h, y, S] = To();
1541
+ t({
1542
+ focus: () => {
1543
+ var i;
1544
+ (i = N.value) === null || i === void 0 || i.focus();
1545
+ },
1546
+ blur: () => {
1547
+ var i;
1548
+ (i = N.value) === null || i === void 0 || i.blur();
1549
+ },
1550
+ scrollTo: (i) => {
1551
+ var r;
1552
+ return (r = D.value) === null || r === void 0 ? void 0 : r.scrollTo(i);
1553
+ }
1554
+ });
1555
+ const O = F(() => {
1556
+ var i;
1557
+ if (e.mode !== "combobox")
1558
+ return e.searchValue;
1559
+ const r = (i = e.displayValues[0]) === null || i === void 0 ? void 0 : i.value;
1560
+ return typeof r == "string" || typeof r == "number" ? String(r) : "";
1561
+ }), d = e.open !== void 0 ? e.open : e.defaultOpen, P = Y(d), x = Y(d), R = (i) => {
1562
+ P.value = e.open !== void 0 ? e.open : i, x.value = P.value;
1563
+ };
1564
+ pe(() => e.open, () => {
1565
+ R(e.open);
1566
+ });
1567
+ const A = F(() => !e.notFoundContent && e.emptyOptions);
1568
+ Ce(() => {
1569
+ x.value = P.value, (e.disabled || A.value && x.value && e.mode === "combobox") && (x.value = !1);
1570
+ });
1571
+ const X = F(() => A.value ? !1 : x.value), W = (i) => {
1572
+ const r = i !== void 0 ? i : !x.value;
1573
+ x.value !== r && !e.disabled && (R(r), e.onDropdownVisibleChange && e.onDropdownVisibleChange(r), !r && q.value && (q.value = !1, y(!1, () => {
1574
+ ne.value = !1, v.value = !1;
1575
+ })));
1576
+ }, ee = F(() => (e.tokenSeparators || []).some((i) => [`
1577
+ `, `\r
1578
+ `].includes(i))), Q = (i, r, E) => {
1579
+ var w, B;
1580
+ let H = !0, G = i;
1581
+ (w = e.onActiveValueChange) === null || w === void 0 || w.call(e, null);
1582
+ const k = E ? null : go(i, e.tokenSeparators);
1583
+ return e.mode !== "combobox" && k && (G = "", (B = e.onSearchSplit) === null || B === void 0 || B.call(e, k), W(!1), H = !1), e.onSearch && O.value !== G && e.onSearch(G, {
1584
+ source: r ? "typing" : "effect"
1585
+ }), H;
1586
+ }, U = (i) => {
1587
+ var r;
1588
+ !i || !i.trim() || (r = e.onSearch) === null || r === void 0 || r.call(e, i, {
1589
+ source: "submit"
1590
+ });
1591
+ };
1592
+ pe(x, () => {
1593
+ !x.value && !a.value && e.mode !== "combobox" && Q("", !1, !1);
1594
+ }, {
1595
+ immediate: !0,
1596
+ flush: "post"
1597
+ }), pe(() => e.disabled, () => {
1598
+ P.value && e.disabled && R(!1), e.disabled && !v.value && y(!1);
1599
+ }, {
1600
+ immediate: !0
1601
+ });
1602
+ const [I, T] = Xt(), j = function(i) {
1603
+ var r;
1604
+ const E = I(), {
1605
+ which: w
1606
+ } = i;
1607
+ if (w === z.ENTER && (e.mode !== "combobox" && i.preventDefault(), x.value || W(!0)), T(!!O.value), w === z.BACKSPACE && !E && a.value && !O.value && e.displayValues.length) {
1608
+ const k = [...e.displayValues];
1609
+ let J = null;
1610
+ for (let le = k.length - 1; le >= 0; le -= 1) {
1611
+ const ae = k[le];
1612
+ if (!ae.disabled) {
1613
+ k.splice(le, 1), J = ae;
1614
+ break;
1615
+ }
1616
+ }
1617
+ J && e.onDisplayValuesChange(k, {
1618
+ type: "remove",
1619
+ values: [J]
1620
+ });
1621
+ }
1622
+ for (var B = arguments.length, H = new Array(B > 1 ? B - 1 : 0), G = 1; G < B; G++)
1623
+ H[G - 1] = arguments[G];
1624
+ x.value && D.value && D.value.onKeydown(i, ...H), (r = e.onKeydown) === null || r === void 0 || r.call(e, i, ...H);
1625
+ }, Z = function(i) {
1626
+ for (var r = arguments.length, E = new Array(r > 1 ? r - 1 : 0), w = 1; w < r; w++)
1627
+ E[w - 1] = arguments[w];
1628
+ x.value && D.value && D.value.onKeyup(i, ...E), e.onKeyup && e.onKeyup(i, ...E);
1629
+ }, K = (i) => {
1630
+ const r = e.displayValues.filter((E) => E !== i);
1631
+ e.onDisplayValuesChange(r, {
1632
+ type: "remove",
1633
+ values: [i]
1634
+ });
1635
+ }, ne = Y(!1), _ = function() {
1636
+ y(!0), e.disabled || (e.onFocus && !ne.value && e.onFocus(...arguments), e.showAction && e.showAction.includes("focus") && W(!0)), ne.value = !0;
1637
+ }, q = ve(!1), oe = function() {
1638
+ if (q.value || (v.value = !0, y(!1, () => {
1639
+ ne.value = !1, v.value = !1, W(!1);
1640
+ }), e.disabled))
1641
+ return;
1642
+ const i = O.value;
1643
+ i && (e.mode === "tags" ? e.onSearch(i, {
1644
+ source: "submit"
1645
+ }) : e.mode === "multiple" && e.onSearch("", {
1646
+ source: "blur"
1647
+ })), e.onBlur && e.onBlur(...arguments);
1648
+ }, ie = () => {
1649
+ q.value = !0;
1650
+ }, re = () => {
1651
+ q.value = !1;
1652
+ };
1653
+ _e("VCSelectContainerEvent", {
1654
+ focus: _,
1655
+ blur: oe
1656
+ });
1657
+ const te = [];
1658
+ Ie(() => {
1659
+ te.forEach((i) => clearTimeout(i)), te.splice(0, te.length);
1660
+ }), ke(() => {
1661
+ te.forEach((i) => clearTimeout(i)), te.splice(0, te.length);
1662
+ });
1663
+ const de = function(i) {
1664
+ var r, E;
1665
+ const {
1666
+ target: w
1667
+ } = i, B = (r = g.value) === null || r === void 0 ? void 0 : r.getPopupElement();
1668
+ if (B && B.contains(w)) {
1669
+ const J = setTimeout(() => {
1670
+ var le;
1671
+ const ae = te.indexOf(J);
1672
+ ae !== -1 && te.splice(ae, 1), S(), !s.value && !B.contains(document.activeElement) && ((le = N.value) === null || le === void 0 || le.focus());
1673
+ });
1674
+ te.push(J);
1675
+ }
1676
+ for (var H = arguments.length, G = new Array(H > 1 ? H - 1 : 0), k = 1; k < H; k++)
1677
+ G[k - 1] = arguments[k];
1678
+ (E = e.onMousedown) === null || E === void 0 || E.call(e, i, ...G);
1679
+ }, se = Y(null), f = () => {
1680
+ };
1681
+ return Ie(() => {
1682
+ pe(X, () => {
1683
+ var i;
1684
+ if (X.value) {
1685
+ const r = Math.ceil((i = p.value) === null || i === void 0 ? void 0 : i.offsetWidth);
1686
+ se.value !== r && !Number.isNaN(r) && (se.value = r);
1687
+ }
1688
+ }, {
1689
+ immediate: !0,
1690
+ flush: "post"
1691
+ });
1692
+ }), Ro([p, g], X, W), Mo(Qt(b(b({}, Pn(e)), {
1693
+ open: x,
1694
+ triggerOpen: X,
1695
+ showSearch: c,
1696
+ multiple: a,
1697
+ toggleOpen: W
1698
+ }))), () => {
1699
+ const i = b(b({}, e), o), {
1700
+ prefixCls: r,
1701
+ id: E,
1702
+ open: w,
1703
+ defaultOpen: B,
1704
+ mode: H,
1705
+ // Search related
1706
+ showSearch: G,
1707
+ searchValue: k,
1708
+ onSearch: J,
1709
+ // Icons
1710
+ allowClear: le,
1711
+ clearIcon: ae,
1712
+ showArrow: De,
1713
+ inputIcon: Ve,
1714
+ // Others
1715
+ disabled: Oe,
1716
+ loading: Ne,
1717
+ getInputElement: ft,
1718
+ getPopupContainer: en,
1719
+ placement: tn,
1720
+ // Dropdown
1721
+ animation: nn,
1722
+ transitionName: on,
1723
+ dropdownStyle: ln,
1724
+ dropdownClassName: an,
1725
+ dropdownMatchSelectWidth: rn,
1726
+ dropdownRender: un,
1727
+ dropdownAlign: sn,
1728
+ showAction: wl,
1729
+ direction: cn,
1730
+ // Tags
1731
+ tokenSeparators: Cl,
1732
+ tagRender: dn,
1733
+ optionLabelRender: fn,
1734
+ // Events
1735
+ onPopupScroll: Il,
1736
+ onDropdownVisibleChange: xl,
1737
+ onFocus: Ol,
1738
+ onBlur: $l,
1739
+ onKeyup: Pl,
1740
+ onKeydown: El,
1741
+ onMousedown: Fl,
1742
+ onClear: ze,
1743
+ omitDomProps: Le,
1744
+ getRawInputElement: pt,
1745
+ displayValues: Re,
1746
+ onDisplayValuesChange: pn,
1747
+ emptyOptions: mn,
1748
+ activeDescendantId: vn,
1749
+ activeValue: gn,
1750
+ OptionList: hn
1751
+ } = i, bn = Ao(i, ["prefixCls", "id", "open", "defaultOpen", "mode", "showSearch", "searchValue", "onSearch", "allowClear", "clearIcon", "showArrow", "inputIcon", "disabled", "loading", "getInputElement", "getPopupContainer", "placement", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "showAction", "direction", "tokenSeparators", "tagRender", "optionLabelRender", "onPopupScroll", "onDropdownVisibleChange", "onFocus", "onBlur", "onKeyup", "onKeydown", "onMousedown", "onClear", "omitDomProps", "getRawInputElement", "displayValues", "onDisplayValuesChange", "emptyOptions", "activeDescendantId", "activeValue", "OptionList"]), mt = H === "combobox" && ft && ft() || null, $e = typeof pt == "function" && pt(), He = b({}, bn);
1752
+ let vt;
1753
+ $e && (vt = (be) => {
1754
+ W(be);
1755
+ }), Bo.forEach((be) => {
1756
+ delete He[be];
1757
+ }), Le == null || Le.forEach((be) => {
1758
+ delete He[be];
1759
+ });
1760
+ const gt = De !== void 0 ? De : Ne || !a.value && H !== "combobox";
1761
+ let ht;
1762
+ gt && (ht = C(ye, {
1763
+ class: ce(`${r}-arrow`, {
1764
+ [`${r}-arrow-loading`]: Ne
1765
+ }),
1766
+ customizeIcon: Ve,
1767
+ customizeIconProps: {
1768
+ loading: Ne,
1769
+ searchValue: O.value,
1770
+ open: x.value,
1771
+ focused: h.value,
1772
+ showSearch: c.value
1773
+ }
1774
+ }, null));
1775
+ let bt;
1776
+ const yn = () => {
1777
+ ze == null || ze(), pn([], {
1778
+ type: "clear",
1779
+ values: Re
1780
+ }), Q("", !1, !1);
1781
+ };
1782
+ !Oe && le && (Re.length || O.value) && (bt = C(ye, {
1783
+ class: `${r}-clear`,
1784
+ onMousedown: yn,
1785
+ customizeIcon: ae
1786
+ }, {
1787
+ default: () => [Me("×")]
1788
+ }));
1789
+ const Sn = C(hn, {
1790
+ ref: D
1791
+ }, b(b({}, m.customSlots), {
1792
+ option: l.option
1793
+ })), wn = ce(r, o.class, {
1794
+ [`${r}-focused`]: h.value,
1795
+ [`${r}-multiple`]: a.value,
1796
+ [`${r}-single`]: !a.value,
1797
+ [`${r}-allow-clear`]: le,
1798
+ [`${r}-show-arrow`]: gt,
1799
+ [`${r}-disabled`]: Oe,
1800
+ [`${r}-loading`]: Ne,
1801
+ [`${r}-open`]: x.value,
1802
+ [`${r}-customize-input`]: mt,
1803
+ [`${r}-show-search`]: c.value
1804
+ }), yt = C(yo, {
1805
+ ref: g,
1806
+ disabled: Oe,
1807
+ prefixCls: r,
1808
+ visible: X.value,
1809
+ popupElement: Sn,
1810
+ containerWidth: se.value,
1811
+ animation: nn,
1812
+ transitionName: on,
1813
+ dropdownStyle: ln,
1814
+ dropdownClassName: an,
1815
+ direction: cn,
1816
+ dropdownMatchSelectWidth: rn,
1817
+ dropdownRender: un,
1818
+ dropdownAlign: sn,
1819
+ placement: tn,
1820
+ getPopupContainer: en,
1821
+ empty: mn,
1822
+ getTriggerDOMNode: () => u.current,
1823
+ onPopupVisibleChange: vt,
1824
+ onPopupMouseEnter: f,
1825
+ onPopupFocusin: ie,
1826
+ onPopupFocusout: re
1827
+ }, {
1828
+ default: () => $e ? Ee($e) && zt($e, {
1829
+ ref: u
1830
+ }, !1, !0) : C(No, L(L({}, e), {}, {
1831
+ domRef: u,
1832
+ prefixCls: r,
1833
+ inputElement: mt,
1834
+ ref: N,
1835
+ id: E,
1836
+ showSearch: c.value,
1837
+ mode: H,
1838
+ activeDescendantId: vn,
1839
+ tagRender: dn,
1840
+ optionLabelRender: fn,
1841
+ values: Re,
1842
+ open: x.value,
1843
+ onToggleOpen: W,
1844
+ activeValue: gn,
1845
+ searchValue: O.value,
1846
+ onSearch: Q,
1847
+ onSearchSubmit: U,
1848
+ onRemove: K,
1849
+ tokenWithEnter: ee.value
1850
+ }), null)
1851
+ });
1852
+ let We;
1853
+ return $e ? We = yt : We = C("div", L(L({}, He), {}, {
1854
+ class: wn,
1855
+ ref: p,
1856
+ onMousedown: de,
1857
+ onKeydown: j,
1858
+ onKeyup: Z
1859
+ }), [h.value && !x.value && C("span", {
1860
+ style: {
1861
+ width: 0,
1862
+ height: 0,
1863
+ position: "absolute",
1864
+ overflow: "hidden",
1865
+ opacity: 0
1866
+ },
1867
+ "aria-live": "polite"
1868
+ }, [`${Re.map((be) => {
1869
+ let {
1870
+ label: St,
1871
+ value: Cn
1872
+ } = be;
1873
+ return ["number", "string"].includes(typeof St) ? St : Cn;
1874
+ }).join(", ")}`]), yt, ht, bt]), We;
1875
+ };
1876
+ }
1877
+ });
1878
+ function Wo() {
1879
+ return /(mac\sos|macintosh)/i.test(navigator.appVersion);
1880
+ }
1881
+ const qt = Symbol("SelectContextKey");
1882
+ function Ko(e) {
1883
+ return _e(qt, e);
1884
+ }
1885
+ function jo() {
1886
+ return Fe(qt, {});
1887
+ }
1888
+ var Go = function(e, n) {
1889
+ var o = {};
1890
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
1891
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
1892
+ n.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (o[t[l]] = e[t[l]]);
1893
+ return o;
1894
+ };
1895
+ function Rt(e) {
1896
+ return typeof e == "string" || typeof e == "number";
1897
+ }
1898
+ const Uo = ue({
1899
+ compatConfig: {
1900
+ MODE: 3
1901
+ },
1902
+ name: "OptionList",
1903
+ inheritAttrs: !1,
1904
+ setup(e, n) {
1905
+ let {
1906
+ expose: o,
1907
+ slots: t
1908
+ } = n;
1909
+ const l = _o(), a = jo(), c = F(() => `${l.prefixCls}-item`), s = io(() => a.flattenOptions, [() => l.open, () => a.flattenOptions], (d) => d[0]), m = tt(), p = (d) => {
1910
+ d.preventDefault();
1911
+ }, u = (d) => {
1912
+ m.current && m.current.scrollTo(typeof d == "number" ? {
1913
+ index: d
1914
+ } : d);
1915
+ }, g = function(d) {
1916
+ let P = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
1917
+ const x = s.value.length;
1918
+ for (let R = 0; R < x; R += 1) {
1919
+ const A = (d + R * P + x) % x, {
1920
+ group: X,
1921
+ data: W
1922
+ } = s.value[A];
1923
+ if (!X && !W.disabled)
1924
+ return A;
1925
+ }
1926
+ return -1;
1927
+ }, N = Qe({
1928
+ activeIndex: g(0)
1929
+ }), D = function(d) {
1930
+ let P = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
1931
+ N.activeIndex = d;
1932
+ const x = {
1933
+ source: P ? "keyboard" : "mouse"
1934
+ }, R = s.value[d];
1935
+ if (!R) {
1936
+ a.onActiveValue(null, -1, x);
1937
+ return;
1938
+ }
1939
+ a.onActiveValue(R.value, d, x);
1940
+ };
1941
+ pe([() => s.value.length, () => l.searchValue], () => {
1942
+ D(a.defaultActiveFirstOption !== !1 ? g(0) : -1);
1943
+ }, {
1944
+ immediate: !0
1945
+ });
1946
+ const v = (d) => a.rawValues.has(d) && l.mode !== "combobox";
1947
+ pe([() => l.open, () => l.searchValue], () => {
1948
+ if (!l.multiple && l.open && a.rawValues.size === 1) {
1949
+ const d = Array.from(a.rawValues)[0], P = Bt(s.value).findIndex((x) => {
1950
+ let {
1951
+ data: R
1952
+ } = x;
1953
+ return R[a.fieldNames.value] === d;
1954
+ });
1955
+ P !== -1 && (D(P), wt(() => {
1956
+ u(P);
1957
+ }));
1958
+ }
1959
+ l.open && wt(() => {
1960
+ var d;
1961
+ (d = m.current) === null || d === void 0 || d.scrollTo(void 0);
1962
+ });
1963
+ }, {
1964
+ immediate: !0,
1965
+ flush: "post"
1966
+ });
1967
+ const h = (d) => {
1968
+ d !== void 0 && a.onSelect(d, {
1969
+ selected: !a.rawValues.has(d)
1970
+ }), l.multiple || l.toggleOpen(!1);
1971
+ }, y = (d) => typeof d.label == "function" ? d.label() : d.label;
1972
+ function S(d) {
1973
+ const P = s.value[d];
1974
+ if (!P) return null;
1975
+ const x = P.data || {}, {
1976
+ value: R
1977
+ } = x, {
1978
+ group: A
1979
+ } = P, X = et(x, !0), W = y(P);
1980
+ return P ? C("div", L(L({
1981
+ "aria-label": typeof W == "string" && !A ? W : null
1982
+ }, X), {}, {
1983
+ key: d,
1984
+ role: A ? "presentation" : "option",
1985
+ id: `${l.id}_list_${d}`,
1986
+ "aria-selected": v(R)
1987
+ }), [R]) : null;
1988
+ }
1989
+ return o({
1990
+ onKeydown: (d) => {
1991
+ const {
1992
+ which: P,
1993
+ ctrlKey: x
1994
+ } = d;
1995
+ switch (P) {
1996
+ // >>> Arrow keys & ctrl + n/p on Mac
1997
+ case z.N:
1998
+ case z.P:
1999
+ case z.UP:
2000
+ case z.DOWN: {
2001
+ let R = 0;
2002
+ if (P === z.UP ? R = -1 : P === z.DOWN ? R = 1 : Wo() && x && (P === z.N ? R = 1 : P === z.P && (R = -1)), R !== 0) {
2003
+ const A = g(N.activeIndex + R, R);
2004
+ u(A), D(A, !0);
2005
+ }
2006
+ break;
2007
+ }
2008
+ // >>> Select
2009
+ case z.ENTER: {
2010
+ const R = s.value[N.activeIndex];
2011
+ R && !R.data.disabled ? h(R.value) : h(void 0), l.open && d.preventDefault();
2012
+ break;
2013
+ }
2014
+ // >>> Close
2015
+ case z.ESC:
2016
+ l.toggleOpen(!1), l.open && d.stopPropagation();
2017
+ }
2018
+ },
2019
+ onKeyup: () => {
2020
+ },
2021
+ scrollTo: (d) => {
2022
+ u(d);
2023
+ }
2024
+ }), () => {
2025
+ const {
2026
+ id: d,
2027
+ notFoundContent: P,
2028
+ onPopupScroll: x
2029
+ } = l, {
2030
+ menuItemSelectedIcon: R,
2031
+ fieldNames: A,
2032
+ virtual: X,
2033
+ listHeight: W,
2034
+ listItemHeight: ee
2035
+ } = a, Q = t.option, {
2036
+ activeIndex: U
2037
+ } = N, I = Object.keys(A).map((T) => A[T]);
2038
+ return s.value.length === 0 ? C("div", {
2039
+ role: "listbox",
2040
+ id: `${d}_list`,
2041
+ class: `${c.value}-empty`,
2042
+ onMousedown: p
2043
+ }, [P]) : C(xe, null, [C("div", {
2044
+ role: "listbox",
2045
+ id: `${d}_list`,
2046
+ style: {
2047
+ height: 0,
2048
+ width: 0,
2049
+ overflow: "hidden"
2050
+ }
2051
+ }, [S(U - 1), S(U), S(U + 1)]), C(_n, {
2052
+ itemKey: "key",
2053
+ ref: m,
2054
+ data: s.value,
2055
+ height: W,
2056
+ itemHeight: ee,
2057
+ fullHeight: !1,
2058
+ onMousedown: p,
2059
+ onScroll: x,
2060
+ virtual: X
2061
+ }, {
2062
+ default: (T, j) => {
2063
+ var Z;
2064
+ const {
2065
+ group: K,
2066
+ groupOption: ne,
2067
+ data: _,
2068
+ value: q
2069
+ } = T, {
2070
+ key: oe
2071
+ } = _, ie = typeof T.label == "function" ? T.label() : T.label;
2072
+ if (K) {
2073
+ const ae = (Z = _.title) !== null && Z !== void 0 ? Z : Rt(ie) && ie;
2074
+ return C("div", {
2075
+ class: ce(c.value, `${c.value}-group`),
2076
+ title: ae
2077
+ }, [Q ? Q(_) : ie !== void 0 ? ie : oe]);
2078
+ }
2079
+ const {
2080
+ disabled: re,
2081
+ title: te,
2082
+ children: de,
2083
+ style: se,
2084
+ class: f,
2085
+ className: i
2086
+ } = _, r = Go(_, ["disabled", "title", "children", "style", "class", "className"]), E = Ae(r, I), w = v(q), B = `${c.value}-option`, H = ce(c.value, B, f, i, {
2087
+ [`${B}-grouped`]: ne,
2088
+ [`${B}-active`]: U === j && !re,
2089
+ [`${B}-disabled`]: re,
2090
+ [`${B}-selected`]: w
2091
+ }), G = y(T), k = !R || typeof R == "function" || w, J = typeof G == "number" ? G : G || q;
2092
+ let le = Rt(J) ? J.toString() : void 0;
2093
+ return te !== void 0 && (le = te), C("div", L(L({}, E), {}, {
2094
+ "aria-selected": w,
2095
+ class: H,
2096
+ title: le,
2097
+ onMousemove: (ae) => {
2098
+ r.onMousemove && r.onMousemove(ae), !(U === j || re) && D(j);
2099
+ },
2100
+ onClick: (ae) => {
2101
+ re || h(q), r.onClick && r.onClick(ae);
2102
+ },
2103
+ style: se
2104
+ }), [C("div", {
2105
+ class: `${B}-content`
2106
+ }, [Q ? Q(_) : J]), Ee(R) || w, k && C(ye, {
2107
+ class: `${c.value}-option-state`,
2108
+ customizeIcon: R,
2109
+ customizeIconProps: {
2110
+ isSelected: w
2111
+ }
2112
+ }, {
2113
+ default: () => [w ? "✓" : null]
2114
+ })]);
2115
+ }
2116
+ })]);
2117
+ };
2118
+ }
2119
+ });
2120
+ var Xo = function(e, n) {
2121
+ var o = {};
2122
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (o[t] = e[t]);
2123
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, t = Object.getOwnPropertySymbols(e); l < t.length; l++)
2124
+ n.indexOf(t[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[l]) && (o[t[l]] = e[t[l]]);
2125
+ return o;
2126
+ };
2127
+ function Yo(e) {
2128
+ const n = e, {
2129
+ key: o,
2130
+ children: t
2131
+ } = n, l = n.props, {
2132
+ value: a,
2133
+ disabled: c
2134
+ } = l, s = Xo(l, ["value", "disabled"]), m = t == null ? void 0 : t.default;
2135
+ return b({
2136
+ key: o,
2137
+ value: a !== void 0 ? a : o,
2138
+ children: m,
2139
+ disabled: c || c === ""
2140
+ }, s);
2141
+ }
2142
+ function rt(e) {
2143
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
2144
+ return An(e).map((t, l) => {
2145
+ var a;
2146
+ if (!Ee(t) || !t.type)
2147
+ return null;
2148
+ const {
2149
+ type: {
2150
+ isSelectOptGroup: c
2151
+ },
2152
+ key: s,
2153
+ children: m,
2154
+ props: p
2155
+ } = t;
2156
+ if (n || !c)
2157
+ return Yo(t);
2158
+ const u = m && m.default ? m.default() : void 0, g = (p == null ? void 0 : p.label) || ((a = m.label) === null || a === void 0 ? void 0 : a.call(m)) || s;
2159
+ return b(b({
2160
+ key: `__RC_SELECT_GRP__${s === null ? l : String(s)}__`
2161
+ }, p), {
2162
+ label: g,
2163
+ options: rt(u || [])
2164
+ });
2165
+ }).filter((t) => t);
2166
+ }
2167
+ function Qo(e, n, o) {
2168
+ const t = Y(), l = Y(), a = Y(), c = Y([]);
2169
+ return pe([e, n], () => {
2170
+ e.value ? c.value = Bt(e.value).slice() : c.value = rt(n.value);
2171
+ }, {
2172
+ immediate: !0,
2173
+ deep: !0
2174
+ }), Ce(() => {
2175
+ const s = c.value, m = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), u = o.value;
2176
+ function g(N) {
2177
+ let D = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
2178
+ for (let v = 0; v < N.length; v += 1) {
2179
+ const h = N[v];
2180
+ !h[u.options] || D ? (m.set(h[u.value], h), p.set(h[u.label], h)) : g(h[u.options], !0);
2181
+ }
2182
+ }
2183
+ g(s), t.value = s, l.value = m, a.value = p;
2184
+ }), {
2185
+ options: t,
2186
+ valueOptions: l,
2187
+ labelOptions: a
2188
+ };
2189
+ }
2190
+ let Tt = 0;
2191
+ const Zo = process.env.NODE_ENV !== "test" && Bn();
2192
+ function qo() {
2193
+ let e;
2194
+ return Zo ? (e = Tt, Tt += 1) : e = "TEST_OR_SSR", e;
2195
+ }
2196
+ function Jo() {
2197
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ve("");
2198
+ const n = `rc_select_${qo()}`;
2199
+ return e.value || n;
2200
+ }
2201
+ function ut(e) {
2202
+ return Array.isArray(e) ? e : e !== void 0 ? [e] : [];
2203
+ }
2204
+ const ko = typeof window < "u" && window.document && window.document.documentElement;
2205
+ process.env.NODE_ENV;
2206
+ function el(e) {
2207
+ const {
2208
+ mode: n,
2209
+ options: o,
2210
+ children: t,
2211
+ backfill: l,
2212
+ allowClear: a,
2213
+ placeholder: c,
2214
+ getInputElement: s,
2215
+ showSearch: m,
2216
+ onSearch: p,
2217
+ defaultOpen: u,
2218
+ autofocus: g,
2219
+ labelInValue: N,
2220
+ value: D,
2221
+ inputValue: v,
2222
+ optionLabelProp: h
2223
+ } = e, y = it(n), S = m !== void 0 ? m : y || n === "combobox", V = o || rt(t);
2224
+ if (me(n !== "tags" || V.every((M) => !M.disabled), "Please avoid setting option to disabled in tags mode since user can always type text as tag."), me(n !== "combobox" || !h, "`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."), me(n === "combobox" || !l, "`backfill` only works with `combobox` mode."), me(n === "combobox" || !s, "`getInputElement` only work with `combobox` mode."), Ot(n !== "combobox" || !s || !a || !c, "Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."), p && !S && n !== "combobox" && n !== "tags" && me(!1, "`onSearch` should work with `showSearch` instead of use alone."), Ot(!u || g, "`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autofocus` if needed."), D != null) {
2225
+ const M = ut(D);
2226
+ me(!N || M.every((O) => typeof O == "object" && ("key" in O || "value" in O)), "`value` should in shape of `{ value: string | number, label?: any }` when you set `labelInValue` to `true`"), me(!y || Array.isArray(D), "`value` should be array when `mode` is `multiple` or `tags`");
2227
+ }
2228
+ if (t) {
2229
+ let M = null;
2230
+ t.some((O) => {
2231
+ var d;
2232
+ if (!Ee(O) || !O.type)
2233
+ return !1;
2234
+ const {
2235
+ type: P
2236
+ } = O;
2237
+ return P.isSelectOption ? !1 : P.isSelectOptGroup ? !(((d = O.children) === null || d === void 0 ? void 0 : d.default()) || []).every((A) => !Ee(A) || !O.type || A.type.isSelectOption ? !0 : (M = A.type, !1)) : (M = P, !0);
2238
+ }), M && me(!1, `\`children\` should be \`Select.Option\` or \`Select.OptGroup\` instead of \`${M.displayName || M.name || M}\`.`), me(v === void 0, "`inputValue` is deprecated, please use `searchValue` instead.");
2239
+ }
2240
+ }
2241
+ function Ge(e, n) {
2242
+ return ut(e).join("").toUpperCase().includes(n);
2243
+ }
2244
+ const tl = (e, n, o, t, l) => F(() => {
2245
+ const a = o.value, c = l == null ? void 0 : l.value, s = t == null ? void 0 : t.value;
2246
+ if (!a || s === !1)
2247
+ return e.value;
2248
+ const {
2249
+ options: m,
2250
+ label: p,
2251
+ value: u
2252
+ } = n.value, g = [], N = typeof s == "function", D = a.toUpperCase(), v = N ? s : (y, S) => c ? Ge(S[c], D) : S[m] ? Ge(S[p !== "children" ? p : "label"], D) : Ge(S[u], D), h = N ? (y) => qe(y) : (y) => y;
2253
+ return e.value.forEach((y) => {
2254
+ if (y[m]) {
2255
+ if (v(a, h(y)))
2256
+ g.push(y);
2257
+ else {
2258
+ const V = y[m].filter((M) => v(a, h(M)));
2259
+ V.length && g.push(b(b({}, y), {
2260
+ [m]: V
2261
+ }));
2262
+ }
2263
+ return;
2264
+ }
2265
+ v(a, h(y)) && g.push(y);
2266
+ }), g;
2267
+ }), nl = (e, n) => {
2268
+ const o = Y({
2269
+ values: /* @__PURE__ */ new Map(),
2270
+ options: /* @__PURE__ */ new Map()
2271
+ });
2272
+ return [F(() => {
2273
+ const {
2274
+ values: a,
2275
+ options: c
2276
+ } = o.value, s = e.value.map((u) => {
2277
+ var g;
2278
+ return u.label === void 0 ? b(b({}, u), {
2279
+ label: (g = a.get(u.value)) === null || g === void 0 ? void 0 : g.label
2280
+ }) : u;
2281
+ }), m = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
2282
+ return s.forEach((u) => {
2283
+ m.set(u.value, u), p.set(u.value, n.value.get(u.value) || c.get(u.value));
2284
+ }), o.value.values = m, o.value.options = p, s;
2285
+ }), (a) => n.value.get(a) || o.value.options.get(a)];
2286
+ }, ol = ["inputValue"];
2287
+ function Jt() {
2288
+ return b(b({}, Zt()), {
2289
+ prefixCls: String,
2290
+ id: String,
2291
+ backfill: {
2292
+ type: Boolean,
2293
+ default: void 0
2294
+ },
2295
+ // >>> Field Names
2296
+ fieldNames: Object,
2297
+ // >>> Search
2298
+ /** @deprecated Use `searchValue` instead */
2299
+ inputValue: String,
2300
+ searchValue: String,
2301
+ onSearch: Function,
2302
+ autoClearSearchValue: {
2303
+ type: Boolean,
2304
+ default: void 0
2305
+ },
2306
+ // >>> Select
2307
+ onSelect: Function,
2308
+ onDeselect: Function,
2309
+ // >>> Options
2310
+ /**
2311
+ * In Select, `false` means do nothing.
2312
+ * In TreeSelect, `false` will highlight match item.
2313
+ * It's by design.
2314
+ */
2315
+ filterOption: {
2316
+ type: [Boolean, Function],
2317
+ default: void 0
2318
+ },
2319
+ filterSort: Function,
2320
+ optionFilterProp: String,
2321
+ optionLabelProp: String,
2322
+ options: Array,
2323
+ defaultActiveFirstOption: {
2324
+ type: Boolean,
2325
+ default: void 0
2326
+ },
2327
+ virtual: {
2328
+ type: Boolean,
2329
+ default: void 0
2330
+ },
2331
+ listHeight: Number,
2332
+ listItemHeight: Number,
2333
+ // >>> Icon
2334
+ menuItemSelectedIcon: $.any,
2335
+ mode: String,
2336
+ labelInValue: {
2337
+ type: Boolean,
2338
+ default: void 0
2339
+ },
2340
+ value: $.any,
2341
+ defaultValue: $.any,
2342
+ onChange: Function,
2343
+ children: Array
2344
+ });
2345
+ }
2346
+ function ll(e) {
2347
+ return !e || typeof e != "object";
2348
+ }
2349
+ const al = ue({
2350
+ compatConfig: {
2351
+ MODE: 3
2352
+ },
2353
+ name: "VcSelect",
2354
+ inheritAttrs: !1,
2355
+ props: nt(Jt(), {
2356
+ prefixCls: "vc-select",
2357
+ autoClearSearchValue: !0,
2358
+ listHeight: 200,
2359
+ listItemHeight: 20,
2360
+ dropdownMatchSelectWidth: !0
2361
+ }),
2362
+ setup(e, n) {
2363
+ let {
2364
+ expose: o,
2365
+ attrs: t,
2366
+ slots: l
2367
+ } = n;
2368
+ const a = Jo(ge(e, "id")), c = F(() => it(e.mode)), s = F(() => !!(!e.options && e.children)), m = F(() => e.filterOption === void 0 && e.mode === "combobox" ? !1 : e.filterOption), p = F(() => Wt(e.fieldNames, s.value)), [u, g] = Et("", {
2369
+ value: F(() => e.searchValue !== void 0 ? e.searchValue : e.inputValue),
2370
+ postState: (f) => f || ""
2371
+ }), N = Qo(ge(e, "options"), ge(e, "children"), p), {
2372
+ valueOptions: D,
2373
+ labelOptions: v,
2374
+ options: h
2375
+ } = N, y = (f) => ut(f).map((r) => {
2376
+ var E, w;
2377
+ let B, H, G, k;
2378
+ ll(r) ? B = r : (G = r.key, H = r.label, B = (E = r.value) !== null && E !== void 0 ? E : G);
2379
+ const J = D.value.get(B);
2380
+ return J && (H === void 0 && (H = J == null ? void 0 : J[e.optionLabelProp || p.value.label]), G === void 0 && (G = (w = J == null ? void 0 : J.key) !== null && w !== void 0 ? w : B), k = J == null ? void 0 : J.disabled), {
2381
+ label: H,
2382
+ value: B,
2383
+ key: G,
2384
+ disabled: k,
2385
+ option: J
2386
+ };
2387
+ }), [S, V] = Et(e.defaultValue, {
2388
+ value: ge(e, "value")
2389
+ }), M = F(() => {
2390
+ var f;
2391
+ const i = y(S.value);
2392
+ return e.mode === "combobox" && !(!((f = i[0]) === null || f === void 0) && f.value) ? [] : i;
2393
+ }), [O, d] = nl(M, D), P = F(() => {
2394
+ if (!e.mode && O.value.length === 1) {
2395
+ const f = O.value[0];
2396
+ if (f.value === null && (f.label === null || f.label === void 0))
2397
+ return [];
2398
+ }
2399
+ return O.value.map((f) => {
2400
+ var i;
2401
+ return b(b({}, f), {
2402
+ label: (i = typeof f.label == "function" ? f.label() : f.label) !== null && i !== void 0 ? i : f.value
2403
+ });
2404
+ });
2405
+ }), x = F(() => new Set(O.value.map((f) => f.value)));
2406
+ Ce(() => {
2407
+ var f;
2408
+ if (e.mode === "combobox") {
2409
+ const i = (f = O.value[0]) === null || f === void 0 ? void 0 : f.value;
2410
+ i != null && g(String(i));
2411
+ }
2412
+ }, {
2413
+ flush: "post"
2414
+ });
2415
+ const R = (f, i) => {
2416
+ const r = i ?? f;
2417
+ return {
2418
+ [p.value.value]: f,
2419
+ [p.value.label]: r
2420
+ };
2421
+ }, A = Y();
2422
+ Ce(() => {
2423
+ if (e.mode !== "tags") {
2424
+ A.value = h.value;
2425
+ return;
2426
+ }
2427
+ const f = h.value.slice(), i = (r) => D.value.has(r);
2428
+ [...O.value].sort((r, E) => r.value < E.value ? -1 : 1).forEach((r) => {
2429
+ const E = r.value;
2430
+ i(E) || f.push(R(E, r.label));
2431
+ }), A.value = f;
2432
+ });
2433
+ const X = tl(A, p, u, m, ge(e, "optionFilterProp")), W = F(() => e.mode !== "tags" || !u.value || X.value.some((f) => f[e.optionFilterProp || "value"] === u.value) ? X.value : [R(u.value), ...X.value]), ee = F(() => e.filterSort ? [...W.value].sort((f, i) => e.filterSort(f, i)) : W.value), Q = F(() => vo(ee.value, {
2434
+ fieldNames: p.value,
2435
+ childrenAsData: s.value
2436
+ })), U = (f) => {
2437
+ const i = y(f);
2438
+ if (V(i), e.onChange && // Trigger event only when value changed
2439
+ (i.length !== O.value.length || i.some((r, E) => {
2440
+ var w;
2441
+ return ((w = O.value[E]) === null || w === void 0 ? void 0 : w.value) !== (r == null ? void 0 : r.value);
2442
+ }))) {
2443
+ const r = e.labelInValue ? i.map((w) => b(b({}, w), {
2444
+ originLabel: w.label,
2445
+ label: typeof w.label == "function" ? w.label() : w.label
2446
+ })) : i.map((w) => w.value), E = i.map((w) => qe(d(w.value)));
2447
+ e.onChange(
2448
+ // Value
2449
+ c.value ? r : r[0],
2450
+ // Option
2451
+ c.value ? E : E[0]
2452
+ );
2453
+ }
2454
+ }, [I, T] = $t(null), [j, Z] = $t(0), K = F(() => e.defaultActiveFirstOption !== void 0 ? e.defaultActiveFirstOption : e.mode !== "combobox"), ne = function(f, i) {
2455
+ let {
2456
+ source: r = "keyboard"
2457
+ } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2458
+ Z(i), e.backfill && e.mode === "combobox" && f !== null && r === "keyboard" && T(String(f));
2459
+ }, _ = (f, i) => {
2460
+ const r = () => {
2461
+ var E;
2462
+ const w = d(f), B = w == null ? void 0 : w[p.value.label];
2463
+ return [e.labelInValue ? {
2464
+ label: typeof B == "function" ? B() : B,
2465
+ originLabel: B,
2466
+ value: f,
2467
+ key: (E = w == null ? void 0 : w.key) !== null && E !== void 0 ? E : f
2468
+ } : f, qe(w)];
2469
+ };
2470
+ if (i && e.onSelect) {
2471
+ const [E, w] = r();
2472
+ e.onSelect(E, w);
2473
+ } else if (!i && e.onDeselect) {
2474
+ const [E, w] = r();
2475
+ e.onDeselect(E, w);
2476
+ }
2477
+ }, q = (f, i) => {
2478
+ let r;
2479
+ const E = c.value ? i.selected : !0;
2480
+ E ? r = c.value ? [...O.value, f] : [f] : r = O.value.filter((w) => w.value !== f), U(r), _(f, E), e.mode === "combobox" ? T("") : (!c.value || e.autoClearSearchValue) && (g(""), T(""));
2481
+ }, oe = (f, i) => {
2482
+ U(f), (i.type === "remove" || i.type === "clear") && i.values.forEach((r) => {
2483
+ _(r.value, !1);
2484
+ });
2485
+ }, ie = (f, i) => {
2486
+ var r;
2487
+ if (g(f), T(null), i.source === "submit") {
2488
+ const E = (f || "").trim();
2489
+ if (E) {
2490
+ const w = Array.from(/* @__PURE__ */ new Set([...x.value, E]));
2491
+ U(w), _(E, !0), g("");
2492
+ }
2493
+ return;
2494
+ }
2495
+ i.source !== "blur" && (e.mode === "combobox" && U(f), (r = e.onSearch) === null || r === void 0 || r.call(e, f));
2496
+ }, re = (f) => {
2497
+ let i = f;
2498
+ e.mode !== "tags" && (i = f.map((E) => {
2499
+ const w = v.value.get(E);
2500
+ return w == null ? void 0 : w.value;
2501
+ }).filter((E) => E !== void 0));
2502
+ const r = Array.from(/* @__PURE__ */ new Set([...x.value, ...i]));
2503
+ U(r), r.forEach((E) => {
2504
+ _(E, !0);
2505
+ });
2506
+ }, te = F(() => e.virtual !== !1 && e.dropdownMatchSelectWidth !== !1);
2507
+ Ko(Qt(b(b({}, N), {
2508
+ flattenOptions: Q,
2509
+ onActiveValue: ne,
2510
+ defaultActiveFirstOption: K,
2511
+ onSelect: q,
2512
+ menuItemSelectedIcon: ge(e, "menuItemSelectedIcon"),
2513
+ rawValues: x,
2514
+ fieldNames: p,
2515
+ virtual: te,
2516
+ listHeight: ge(e, "listHeight"),
2517
+ listItemHeight: ge(e, "listItemHeight"),
2518
+ childrenAsData: s
2519
+ }))), process.env.NODE_ENV !== "production" && Ce(() => {
2520
+ el(e);
2521
+ }, {
2522
+ flush: "post"
2523
+ });
2524
+ const de = ve();
2525
+ o({
2526
+ focus() {
2527
+ var f;
2528
+ (f = de.value) === null || f === void 0 || f.focus();
2529
+ },
2530
+ blur() {
2531
+ var f;
2532
+ (f = de.value) === null || f === void 0 || f.blur();
2533
+ },
2534
+ scrollTo(f) {
2535
+ var i;
2536
+ (i = de.value) === null || i === void 0 || i.scrollTo(f);
2537
+ }
2538
+ });
2539
+ const se = F(() => Ae(e, [
2540
+ "id",
2541
+ "mode",
2542
+ "prefixCls",
2543
+ "backfill",
2544
+ "fieldNames",
2545
+ // Search
2546
+ "inputValue",
2547
+ "searchValue",
2548
+ "onSearch",
2549
+ "autoClearSearchValue",
2550
+ // Select
2551
+ "onSelect",
2552
+ "onDeselect",
2553
+ "dropdownMatchSelectWidth",
2554
+ // Options
2555
+ "filterOption",
2556
+ "filterSort",
2557
+ "optionFilterProp",
2558
+ "optionLabelProp",
2559
+ "options",
2560
+ "children",
2561
+ "defaultActiveFirstOption",
2562
+ "menuItemSelectedIcon",
2563
+ "virtual",
2564
+ "listHeight",
2565
+ "listItemHeight",
2566
+ // Value
2567
+ "value",
2568
+ "defaultValue",
2569
+ "labelInValue",
2570
+ "onChange"
2571
+ ]));
2572
+ return () => C(Ho, L(L(L({}, se.value), t), {}, {
2573
+ id: a,
2574
+ prefixCls: e.prefixCls,
2575
+ ref: de,
2576
+ omitDomProps: ol,
2577
+ mode: e.mode,
2578
+ displayValues: P.value,
2579
+ onDisplayValuesChange: oe,
2580
+ searchValue: u.value,
2581
+ onSearch: ie,
2582
+ onSearchSplit: re,
2583
+ dropdownMatchSelectWidth: e.dropdownMatchSelectWidth,
2584
+ OptionList: Uo,
2585
+ emptyOptions: !Q.value.length,
2586
+ activeValue: I.value,
2587
+ activeDescendantId: `${a}_list_${j.value}`
2588
+ }), l);
2589
+ }
2590
+ }), st = () => null;
2591
+ st.isSelectOption = !0;
2592
+ st.displayName = "ASelectOption";
2593
+ const ct = () => null;
2594
+ ct.isSelectOptGroup = !0;
2595
+ ct.displayName = "ASelectOptGroup";
2596
+ var il = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" } }] }, name: "check", theme: "outlined" };
2597
+ function Mt(e) {
2598
+ for (var n = 1; n < arguments.length; n++) {
2599
+ var o = arguments[n] != null ? Object(arguments[n]) : {}, t = Object.keys(o);
2600
+ typeof Object.getOwnPropertySymbols == "function" && (t = t.concat(Object.getOwnPropertySymbols(o).filter(function(l) {
2601
+ return Object.getOwnPropertyDescriptor(o, l).enumerable;
2602
+ }))), t.forEach(function(l) {
2603
+ rl(e, l, o[l]);
2604
+ });
2605
+ }
2606
+ return e;
2607
+ }
2608
+ function rl(e, n, o) {
2609
+ return n in e ? Object.defineProperty(e, n, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = o, e;
2610
+ }
2611
+ var dt = function(n, o) {
2612
+ var t = Mt({}, n, o.attrs);
2613
+ return C(zn, Mt({}, t, {
2614
+ icon: il
2615
+ }), null);
2616
+ };
2617
+ dt.displayName = "CheckOutlined";
2618
+ dt.inheritAttrs = !1;
2619
+ function ul(e) {
2620
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2621
+ const {
2622
+ loading: o,
2623
+ multiple: t,
2624
+ prefixCls: l,
2625
+ hasFeedback: a,
2626
+ feedbackIcon: c,
2627
+ showArrow: s
2628
+ } = e, m = e.suffixIcon || n.suffixIcon && n.suffixIcon(), p = e.clearIcon || n.clearIcon && n.clearIcon(), u = e.menuItemSelectedIcon || n.menuItemSelectedIcon && n.menuItemSelectedIcon(), g = e.removeIcon || n.removeIcon && n.removeIcon(), N = p ?? C(Ln, null, null), D = (S) => C(xe, null, [s !== !1 && S, a && c]);
2629
+ let v = null;
2630
+ if (m !== void 0)
2631
+ v = D(m);
2632
+ else if (o)
2633
+ v = D(C(Hn, {
2634
+ spin: !0
2635
+ }, null));
2636
+ else {
2637
+ const S = `${l}-suffix`;
2638
+ v = (V) => {
2639
+ let {
2640
+ open: M,
2641
+ showSearch: O
2642
+ } = V;
2643
+ return D(M && O ? C(lo, {
2644
+ class: S
2645
+ }, null) : C(ao, {
2646
+ class: S
2647
+ }, null));
2648
+ };
2649
+ }
2650
+ let h = null;
2651
+ u !== void 0 ? h = u : t ? h = C(dt, null, null) : h = null;
2652
+ let y = null;
2653
+ return g !== void 0 ? y = g : y = C(ro, null, null), {
2654
+ clearIcon: N,
2655
+ suffixIcon: v,
2656
+ itemIcon: h,
2657
+ removeIcon: y
2658
+ };
2659
+ }
2660
+ const _t = (e) => {
2661
+ const {
2662
+ controlPaddingHorizontal: n
2663
+ } = e;
2664
+ return {
2665
+ position: "relative",
2666
+ display: "block",
2667
+ minHeight: e.controlHeight,
2668
+ padding: `${(e.controlHeight - e.fontSize * e.lineHeight) / 2}px ${n}px`,
2669
+ color: e.colorText,
2670
+ fontWeight: "normal",
2671
+ fontSize: e.fontSize,
2672
+ lineHeight: e.lineHeight,
2673
+ boxSizing: "border-box"
2674
+ };
2675
+ }, sl = (e) => {
2676
+ const {
2677
+ antCls: n,
2678
+ componentCls: o
2679
+ } = e, t = `${o}-item`;
2680
+ return [
2681
+ {
2682
+ [`${o}-dropdown`]: b(b({}, ot(e)), {
2683
+ position: "absolute",
2684
+ top: -9999,
2685
+ zIndex: e.zIndexPopup,
2686
+ boxSizing: "border-box",
2687
+ padding: e.paddingXXS,
2688
+ overflow: "hidden",
2689
+ fontSize: e.fontSize,
2690
+ // Fix select render lag of long text in chrome
2691
+ // https://github.com/ant-design/ant-design/issues/11456
2692
+ // https://github.com/ant-design/ant-design/issues/11843
2693
+ fontVariant: "initial",
2694
+ backgroundColor: e.colorBgElevated,
2695
+ borderRadius: e.borderRadiusLG,
2696
+ outline: "none",
2697
+ boxShadow: e.boxShadowSecondary,
2698
+ [`
2699
+ &${n}-slide-up-enter${n}-slide-up-enter-active${o}-dropdown-placement-bottomLeft,
2700
+ &${n}-slide-up-appear${n}-slide-up-appear-active${o}-dropdown-placement-bottomLeft
2701
+ `]: {
2702
+ animationName: fo
2703
+ },
2704
+ [`
2705
+ &${n}-slide-up-enter${n}-slide-up-enter-active${o}-dropdown-placement-topLeft,
2706
+ &${n}-slide-up-appear${n}-slide-up-appear-active${o}-dropdown-placement-topLeft
2707
+ `]: {
2708
+ animationName: co
2709
+ },
2710
+ [`&${n}-slide-up-leave${n}-slide-up-leave-active${o}-dropdown-placement-bottomLeft`]: {
2711
+ animationName: so
2712
+ },
2713
+ [`&${n}-slide-up-leave${n}-slide-up-leave-active${o}-dropdown-placement-topLeft`]: {
2714
+ animationName: uo
2715
+ },
2716
+ "&-hidden": {
2717
+ display: "none"
2718
+ },
2719
+ "&-empty": {
2720
+ color: e.colorTextDisabled
2721
+ },
2722
+ // ========================= Options =========================
2723
+ [`${t}-empty`]: b(b({}, _t(e)), {
2724
+ color: e.colorTextDisabled
2725
+ }),
2726
+ [`${t}`]: b(b({}, _t(e)), {
2727
+ cursor: "pointer",
2728
+ transition: `background ${e.motionDurationSlow} ease`,
2729
+ borderRadius: e.borderRadiusSM,
2730
+ // =========== Group ============
2731
+ "&-group": {
2732
+ color: e.colorTextDescription,
2733
+ fontSize: e.fontSizeSM,
2734
+ cursor: "default"
2735
+ },
2736
+ // =========== Option ===========
2737
+ "&-option": {
2738
+ display: "flex",
2739
+ "&-content": b({
2740
+ flex: "auto"
2741
+ }, Ze),
2742
+ "&-state": {
2743
+ flex: "none"
2744
+ },
2745
+ [`&-active:not(${t}-option-disabled)`]: {
2746
+ backgroundColor: e.controlItemBgHover
2747
+ },
2748
+ [`&-selected:not(${t}-option-disabled)`]: {
2749
+ color: e.colorText,
2750
+ fontWeight: e.fontWeightStrong,
2751
+ backgroundColor: e.controlItemBgActive,
2752
+ [`${t}-option-state`]: {
2753
+ color: e.colorPrimary
2754
+ }
2755
+ },
2756
+ "&-disabled": {
2757
+ [`&${t}-option-selected`]: {
2758
+ backgroundColor: e.colorBgContainerDisabled
2759
+ },
2760
+ color: e.colorTextDisabled,
2761
+ cursor: "not-allowed"
2762
+ },
2763
+ "&-grouped": {
2764
+ paddingInlineStart: e.controlPaddingHorizontal * 2
2765
+ }
2766
+ }
2767
+ }),
2768
+ // =========================== RTL ===========================
2769
+ "&-rtl": {
2770
+ direction: "rtl"
2771
+ }
2772
+ })
2773
+ },
2774
+ // Follow code may reuse in other components
2775
+ Ft(e, "slide-up"),
2776
+ Ft(e, "slide-down"),
2777
+ Dt(e, "move-up"),
2778
+ Dt(e, "move-down")
2779
+ ];
2780
+ }, we = 2;
2781
+ function kt(e) {
2782
+ let {
2783
+ controlHeightSM: n,
2784
+ controlHeight: o,
2785
+ lineWidth: t
2786
+ } = e;
2787
+ const l = (o - n) / 2 - t, a = Math.ceil(l / 2);
2788
+ return [l, a];
2789
+ }
2790
+ function Ue(e, n) {
2791
+ const {
2792
+ componentCls: o,
2793
+ iconCls: t
2794
+ } = e, l = `${o}-selection-overflow`, a = e.controlHeightSM, [c] = kt(e), s = n ? `${o}-${n}` : "";
2795
+ return {
2796
+ [`${o}-multiple${s}`]: {
2797
+ fontSize: e.fontSize,
2798
+ /**
2799
+ * Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome
2800
+ * may update to redesign with its align logic.
2801
+ */
2802
+ // =========================== Overflow ===========================
2803
+ [l]: {
2804
+ position: "relative",
2805
+ display: "flex",
2806
+ flex: "auto",
2807
+ flexWrap: "wrap",
2808
+ maxWidth: "100%",
2809
+ "&-item": {
2810
+ flex: "none",
2811
+ alignSelf: "center",
2812
+ maxWidth: "100%",
2813
+ display: "inline-flex"
2814
+ }
2815
+ },
2816
+ // ========================= Selector =========================
2817
+ [`${o}-selector`]: {
2818
+ display: "flex",
2819
+ flexWrap: "wrap",
2820
+ alignItems: "center",
2821
+ // Multiple is little different that horizontal is follow the vertical
2822
+ padding: `${c - we}px ${we * 2}px`,
2823
+ borderRadius: e.borderRadius,
2824
+ [`${o}-show-search&`]: {
2825
+ cursor: "text"
2826
+ },
2827
+ [`${o}-disabled&`]: {
2828
+ background: e.colorBgContainerDisabled,
2829
+ cursor: "not-allowed"
2830
+ },
2831
+ "&:after": {
2832
+ display: "inline-block",
2833
+ width: 0,
2834
+ margin: `${we}px 0`,
2835
+ lineHeight: `${a}px`,
2836
+ content: '"\\a0"'
2837
+ }
2838
+ },
2839
+ [`
2840
+ &${o}-show-arrow ${o}-selector,
2841
+ &${o}-allow-clear ${o}-selector
2842
+ `]: {
2843
+ paddingInlineEnd: e.fontSizeIcon + e.controlPaddingHorizontal
2844
+ },
2845
+ // ======================== Selections ========================
2846
+ [`${o}-selection-item`]: {
2847
+ position: "relative",
2848
+ display: "flex",
2849
+ flex: "none",
2850
+ boxSizing: "border-box",
2851
+ maxWidth: "100%",
2852
+ height: a,
2853
+ marginTop: we,
2854
+ marginBottom: we,
2855
+ lineHeight: `${a - e.lineWidth * 2}px`,
2856
+ background: e.colorFillSecondary,
2857
+ border: `${e.lineWidth}px solid ${e.colorSplit}`,
2858
+ borderRadius: e.borderRadiusSM,
2859
+ cursor: "default",
2860
+ transition: `font-size ${e.motionDurationSlow}, line-height ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,
2861
+ userSelect: "none",
2862
+ marginInlineEnd: we * 2,
2863
+ paddingInlineStart: e.paddingXS,
2864
+ paddingInlineEnd: e.paddingXS / 2,
2865
+ [`${o}-disabled&`]: {
2866
+ color: e.colorTextDisabled,
2867
+ borderColor: e.colorBorder,
2868
+ cursor: "not-allowed"
2869
+ },
2870
+ // It's ok not to do this, but 24px makes bottom narrow in view should adjust
2871
+ "&-content": {
2872
+ display: "inline-block",
2873
+ marginInlineEnd: e.paddingXS / 2,
2874
+ overflow: "hidden",
2875
+ whiteSpace: "pre",
2876
+ textOverflow: "ellipsis"
2877
+ },
2878
+ "&-remove": b(b({}, Ht()), {
2879
+ display: "inline-block",
2880
+ color: e.colorIcon,
2881
+ fontWeight: "bold",
2882
+ fontSize: 10,
2883
+ lineHeight: "inherit",
2884
+ cursor: "pointer",
2885
+ [`> ${t}`]: {
2886
+ verticalAlign: "-0.2em"
2887
+ },
2888
+ "&:hover": {
2889
+ color: e.colorIconHover
2890
+ }
2891
+ })
2892
+ },
2893
+ // ========================== Input ==========================
2894
+ [`${l}-item + ${l}-item`]: {
2895
+ [`${o}-selection-search`]: {
2896
+ marginInlineStart: 0
2897
+ }
2898
+ },
2899
+ [`${o}-selection-search`]: {
2900
+ display: "inline-flex",
2901
+ position: "relative",
2902
+ maxWidth: "100%",
2903
+ marginInlineStart: e.inputPaddingHorizontalBase - c,
2904
+ "\n &-input,\n &-mirror\n ": {
2905
+ height: a,
2906
+ fontFamily: e.fontFamily,
2907
+ lineHeight: `${a}px`,
2908
+ transition: `all ${e.motionDurationSlow}`
2909
+ },
2910
+ "&-input": {
2911
+ width: "100%",
2912
+ minWidth: 4.1
2913
+ // fix search cursor missing
2914
+ },
2915
+ "&-mirror": {
2916
+ position: "absolute",
2917
+ top: 0,
2918
+ insetInlineStart: 0,
2919
+ insetInlineEnd: "auto",
2920
+ zIndex: 999,
2921
+ whiteSpace: "pre",
2922
+ visibility: "hidden"
2923
+ }
2924
+ },
2925
+ // ======================= Placeholder =======================
2926
+ [`${o}-selection-placeholder `]: {
2927
+ position: "absolute",
2928
+ top: "50%",
2929
+ insetInlineStart: e.inputPaddingHorizontalBase,
2930
+ insetInlineEnd: e.inputPaddingHorizontalBase,
2931
+ transform: "translateY(-50%)",
2932
+ transition: `all ${e.motionDurationSlow}`
2933
+ }
2934
+ }
2935
+ };
2936
+ }
2937
+ function cl(e) {
2938
+ const {
2939
+ componentCls: n
2940
+ } = e, o = he(e, {
2941
+ controlHeight: e.controlHeightSM,
2942
+ controlHeightSM: e.controlHeightXS,
2943
+ borderRadius: e.borderRadiusSM,
2944
+ borderRadiusSM: e.borderRadiusXS
2945
+ }), [, t] = kt(e);
2946
+ return [
2947
+ Ue(e),
2948
+ // ======================== Small ========================
2949
+ // Shared
2950
+ Ue(o, "sm"),
2951
+ // Padding
2952
+ {
2953
+ [`${n}-multiple${n}-sm`]: {
2954
+ [`${n}-selection-placeholder`]: {
2955
+ insetInlineStart: e.controlPaddingHorizontalSM - e.lineWidth,
2956
+ insetInlineEnd: "auto"
2957
+ },
2958
+ // https://github.com/ant-design/ant-design/issues/29559
2959
+ [`${n}-selection-search`]: {
2960
+ marginInlineStart: t
2961
+ }
2962
+ }
2963
+ },
2964
+ // ======================== Large ========================
2965
+ // Shared
2966
+ Ue(he(e, {
2967
+ fontSize: e.fontSizeLG,
2968
+ controlHeight: e.controlHeightLG,
2969
+ controlHeightSM: e.controlHeight,
2970
+ borderRadius: e.borderRadiusLG,
2971
+ borderRadiusSM: e.borderRadius
2972
+ }), "lg")
2973
+ ];
2974
+ }
2975
+ function Xe(e, n) {
2976
+ const {
2977
+ componentCls: o,
2978
+ inputPaddingHorizontalBase: t,
2979
+ borderRadius: l
2980
+ } = e, a = e.controlHeight - e.lineWidth * 2, c = Math.ceil(e.fontSize * 1.25), s = n ? `${o}-${n}` : "";
2981
+ return {
2982
+ [`${o}-single${s}`]: {
2983
+ fontSize: e.fontSize,
2984
+ // ========================= Selector =========================
2985
+ [`${o}-selector`]: b(b({}, ot(e)), {
2986
+ display: "flex",
2987
+ borderRadius: l,
2988
+ [`${o}-selection-search`]: {
2989
+ position: "absolute",
2990
+ top: 0,
2991
+ insetInlineStart: t,
2992
+ insetInlineEnd: t,
2993
+ bottom: 0,
2994
+ "&-input": {
2995
+ width: "100%"
2996
+ }
2997
+ },
2998
+ [`
2999
+ ${o}-selection-item,
3000
+ ${o}-selection-placeholder
3001
+ `]: {
3002
+ padding: 0,
3003
+ lineHeight: `${a}px`,
3004
+ transition: `all ${e.motionDurationSlow}`,
3005
+ // Firefox inline-block position calculation is not same as Chrome & Safari. Patch this:
3006
+ "@supports (-moz-appearance: meterbar)": {
3007
+ lineHeight: `${a}px`
3008
+ }
3009
+ },
3010
+ [`${o}-selection-item`]: {
3011
+ position: "relative",
3012
+ userSelect: "none"
3013
+ },
3014
+ [`${o}-selection-placeholder`]: {
3015
+ transition: "none",
3016
+ pointerEvents: "none"
3017
+ },
3018
+ // For common baseline align
3019
+ [[
3020
+ "&:after",
3021
+ /* For '' value baseline align */
3022
+ `${o}-selection-item:after`,
3023
+ /* For undefined value baseline align */
3024
+ `${o}-selection-placeholder:after`
3025
+ ].join(",")]: {
3026
+ display: "inline-block",
3027
+ width: 0,
3028
+ visibility: "hidden",
3029
+ content: '"\\a0"'
3030
+ }
3031
+ }),
3032
+ [`
3033
+ &${o}-show-arrow ${o}-selection-item,
3034
+ &${o}-show-arrow ${o}-selection-placeholder
3035
+ `]: {
3036
+ paddingInlineEnd: c
3037
+ },
3038
+ // Opacity selection if open
3039
+ [`&${o}-open ${o}-selection-item`]: {
3040
+ color: e.colorTextPlaceholder
3041
+ },
3042
+ // ========================== Input ==========================
3043
+ // We only change the style of non-customize input which is only support by `combobox` mode.
3044
+ // Not customize
3045
+ [`&:not(${o}-customize-input)`]: {
3046
+ [`${o}-selector`]: {
3047
+ width: "100%",
3048
+ height: e.controlHeight,
3049
+ padding: `0 ${t}px`,
3050
+ [`${o}-selection-search-input`]: {
3051
+ height: a
3052
+ },
3053
+ "&:after": {
3054
+ lineHeight: `${a}px`
3055
+ }
3056
+ }
3057
+ },
3058
+ [`&${o}-customize-input`]: {
3059
+ [`${o}-selector`]: {
3060
+ "&:after": {
3061
+ display: "none"
3062
+ },
3063
+ [`${o}-selection-search`]: {
3064
+ position: "static",
3065
+ width: "100%"
3066
+ },
3067
+ [`${o}-selection-placeholder`]: {
3068
+ position: "absolute",
3069
+ insetInlineStart: 0,
3070
+ insetInlineEnd: 0,
3071
+ padding: `0 ${t}px`,
3072
+ "&:after": {
3073
+ display: "none"
3074
+ }
3075
+ }
3076
+ }
3077
+ }
3078
+ }
3079
+ };
3080
+ }
3081
+ function dl(e) {
3082
+ const {
3083
+ componentCls: n
3084
+ } = e, o = e.controlPaddingHorizontalSM - e.lineWidth;
3085
+ return [
3086
+ Xe(e),
3087
+ // ======================== Small ========================
3088
+ // Shared
3089
+ Xe(he(e, {
3090
+ controlHeight: e.controlHeightSM,
3091
+ borderRadius: e.borderRadiusSM
3092
+ }), "sm"),
3093
+ // padding
3094
+ {
3095
+ [`${n}-single${n}-sm`]: {
3096
+ [`&:not(${n}-customize-input)`]: {
3097
+ [`${n}-selection-search`]: {
3098
+ insetInlineStart: o,
3099
+ insetInlineEnd: o
3100
+ },
3101
+ [`${n}-selector`]: {
3102
+ padding: `0 ${o}px`
3103
+ },
3104
+ // With arrow should provides `padding-right` to show the arrow
3105
+ [`&${n}-show-arrow ${n}-selection-search`]: {
3106
+ insetInlineEnd: o + e.fontSize * 1.5
3107
+ },
3108
+ [`
3109
+ &${n}-show-arrow ${n}-selection-item,
3110
+ &${n}-show-arrow ${n}-selection-placeholder
3111
+ `]: {
3112
+ paddingInlineEnd: e.fontSize * 1.5
3113
+ }
3114
+ }
3115
+ }
3116
+ },
3117
+ // ======================== Large ========================
3118
+ // Shared
3119
+ Xe(he(e, {
3120
+ controlHeight: e.controlHeightLG,
3121
+ fontSize: e.fontSizeLG,
3122
+ borderRadius: e.borderRadiusLG
3123
+ }), "lg")
3124
+ ];
3125
+ }
3126
+ const fl = (e) => {
3127
+ const {
3128
+ componentCls: n
3129
+ } = e;
3130
+ return {
3131
+ position: "relative",
3132
+ backgroundColor: e.colorBgContainer,
3133
+ border: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,
3134
+ transition: `all ${e.motionDurationMid} ${e.motionEaseInOut}`,
3135
+ input: {
3136
+ cursor: "pointer"
3137
+ },
3138
+ [`${n}-show-search&`]: {
3139
+ cursor: "text",
3140
+ input: {
3141
+ cursor: "auto",
3142
+ color: "inherit"
3143
+ }
3144
+ },
3145
+ [`${n}-disabled&`]: {
3146
+ color: e.colorTextDisabled,
3147
+ background: e.colorBgContainerDisabled,
3148
+ cursor: "not-allowed",
3149
+ [`${n}-multiple&`]: {
3150
+ background: e.colorBgContainerDisabled
3151
+ },
3152
+ input: {
3153
+ cursor: "not-allowed"
3154
+ }
3155
+ }
3156
+ };
3157
+ }, Ye = function(e, n) {
3158
+ let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
3159
+ const {
3160
+ componentCls: t,
3161
+ borderHoverColor: l,
3162
+ outlineColor: a,
3163
+ antCls: c
3164
+ } = n, s = o ? {
3165
+ [`${t}-selector`]: {
3166
+ borderColor: l
3167
+ }
3168
+ } : {};
3169
+ return {
3170
+ [e]: {
3171
+ [`&:not(${t}-disabled):not(${t}-customize-input):not(${c}-pagination-size-changer)`]: b(b({}, s), {
3172
+ [`${t}-focused& ${t}-selector`]: {
3173
+ borderColor: l,
3174
+ boxShadow: `0 0 0 ${n.controlOutlineWidth}px ${a}`,
3175
+ borderInlineEndWidth: `${n.controlLineWidth}px !important`,
3176
+ outline: 0
3177
+ },
3178
+ [`&:hover ${t}-selector`]: {
3179
+ borderColor: l,
3180
+ borderInlineEndWidth: `${n.controlLineWidth}px !important`
3181
+ }
3182
+ })
3183
+ }
3184
+ };
3185
+ }, pl = (e) => {
3186
+ const {
3187
+ componentCls: n
3188
+ } = e;
3189
+ return {
3190
+ [`${n}-selection-search-input`]: {
3191
+ margin: 0,
3192
+ padding: 0,
3193
+ background: "transparent",
3194
+ border: "none",
3195
+ outline: "none",
3196
+ appearance: "none",
3197
+ "&::-webkit-search-cancel-button": {
3198
+ display: "none",
3199
+ "-webkit-appearance": "none"
3200
+ }
3201
+ }
3202
+ };
3203
+ }, ml = (e) => {
3204
+ const {
3205
+ componentCls: n,
3206
+ inputPaddingHorizontalBase: o,
3207
+ iconCls: t
3208
+ } = e;
3209
+ return {
3210
+ [n]: b(b({}, ot(e)), {
3211
+ position: "relative",
3212
+ display: "inline-block",
3213
+ cursor: "pointer",
3214
+ [`&:not(${n}-customize-input) ${n}-selector`]: b(b({}, fl(e)), pl(e)),
3215
+ // [`&:not(&-disabled):hover ${selectCls}-selector`]: {
3216
+ // ...genHoverStyle(token),
3217
+ // },
3218
+ // ======================== Selection ========================
3219
+ [`${n}-selection-item`]: b({
3220
+ flex: 1,
3221
+ fontWeight: "normal"
3222
+ }, Ze),
3223
+ // ======================= Placeholder =======================
3224
+ [`${n}-selection-placeholder`]: b(b({}, Ze), {
3225
+ flex: 1,
3226
+ color: e.colorTextPlaceholder,
3227
+ pointerEvents: "none"
3228
+ }),
3229
+ // ========================== Arrow ==========================
3230
+ [`${n}-arrow`]: b(b({}, Ht()), {
3231
+ position: "absolute",
3232
+ top: "50%",
3233
+ insetInlineStart: "auto",
3234
+ insetInlineEnd: o,
3235
+ height: e.fontSizeIcon,
3236
+ marginTop: -e.fontSizeIcon / 2,
3237
+ color: e.colorTextQuaternary,
3238
+ fontSize: e.fontSizeIcon,
3239
+ lineHeight: 1,
3240
+ textAlign: "center",
3241
+ pointerEvents: "none",
3242
+ display: "flex",
3243
+ alignItems: "center",
3244
+ [t]: {
3245
+ verticalAlign: "top",
3246
+ transition: `transform ${e.motionDurationSlow}`,
3247
+ "> svg": {
3248
+ verticalAlign: "top"
3249
+ },
3250
+ [`&:not(${n}-suffix)`]: {
3251
+ pointerEvents: "auto"
3252
+ }
3253
+ },
3254
+ [`${n}-disabled &`]: {
3255
+ cursor: "not-allowed"
3256
+ },
3257
+ "> *:not(:last-child)": {
3258
+ marginInlineEnd: 8
3259
+ // FIXME: magic
3260
+ }
3261
+ }),
3262
+ // ========================== Clear ==========================
3263
+ [`${n}-clear`]: {
3264
+ position: "absolute",
3265
+ top: "50%",
3266
+ insetInlineStart: "auto",
3267
+ insetInlineEnd: o,
3268
+ zIndex: 1,
3269
+ display: "inline-block",
3270
+ width: e.fontSizeIcon,
3271
+ height: e.fontSizeIcon,
3272
+ marginTop: -e.fontSizeIcon / 2,
3273
+ color: e.colorTextQuaternary,
3274
+ fontSize: e.fontSizeIcon,
3275
+ fontStyle: "normal",
3276
+ lineHeight: 1,
3277
+ textAlign: "center",
3278
+ textTransform: "none",
3279
+ background: e.colorBgContainer,
3280
+ cursor: "pointer",
3281
+ opacity: 0,
3282
+ transition: `color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,
3283
+ textRendering: "auto",
3284
+ "&:before": {
3285
+ display: "block"
3286
+ },
3287
+ "&:hover": {
3288
+ color: e.colorTextTertiary
3289
+ }
3290
+ },
3291
+ "&:hover": {
3292
+ [`${n}-clear`]: {
3293
+ opacity: 1
3294
+ }
3295
+ }
3296
+ }),
3297
+ // ========================= Feedback ==========================
3298
+ [`${n}-has-feedback`]: {
3299
+ [`${n}-clear`]: {
3300
+ insetInlineEnd: o + e.fontSize + e.paddingXXS
3301
+ }
3302
+ }
3303
+ };
3304
+ }, vl = (e) => {
3305
+ const {
3306
+ componentCls: n
3307
+ } = e;
3308
+ return [
3309
+ {
3310
+ [n]: {
3311
+ // ==================== BorderLess ====================
3312
+ [`&-borderless ${n}-selector`]: {
3313
+ backgroundColor: "transparent !important",
3314
+ borderColor: "transparent !important",
3315
+ boxShadow: "none !important"
3316
+ },
3317
+ // ==================== In Form ====================
3318
+ [`&${n}-in-form-item`]: {
3319
+ width: "100%"
3320
+ }
3321
+ }
3322
+ },
3323
+ // =====================================================
3324
+ // == LTR ==
3325
+ // =====================================================
3326
+ // Base
3327
+ ml(e),
3328
+ // Single
3329
+ dl(e),
3330
+ // Multiple
3331
+ cl(e),
3332
+ // Dropdown
3333
+ sl(e),
3334
+ // =====================================================
3335
+ // == RTL ==
3336
+ // =====================================================
3337
+ {
3338
+ [`${n}-rtl`]: {
3339
+ direction: "rtl"
3340
+ }
3341
+ },
3342
+ // =====================================================
3343
+ // == Status ==
3344
+ // =====================================================
3345
+ Ye(n, he(e, {
3346
+ borderHoverColor: e.colorPrimaryHover,
3347
+ outlineColor: e.controlOutline
3348
+ })),
3349
+ Ye(`${n}-status-error`, he(e, {
3350
+ borderHoverColor: e.colorErrorHover,
3351
+ outlineColor: e.colorErrorOutline
3352
+ }), !0),
3353
+ Ye(`${n}-status-warning`, he(e, {
3354
+ borderHoverColor: e.colorWarningHover,
3355
+ outlineColor: e.colorWarningOutline
3356
+ }), !0),
3357
+ // =====================================================
3358
+ // == Space Compact ==
3359
+ // =====================================================
3360
+ Kn(e, {
3361
+ borderElCls: `${n}-selector`,
3362
+ focusElCls: `${n}-focused`
3363
+ })
3364
+ ];
3365
+ }, gl = Wn("Select", (e, n) => {
3366
+ let {
3367
+ rootPrefixCls: o
3368
+ } = n;
3369
+ const t = he(e, {
3370
+ rootPrefixCls: o,
3371
+ inputPaddingHorizontalBase: e.paddingSM - 1
3372
+ });
3373
+ return [vl(t)];
3374
+ }, (e) => ({
3375
+ zIndexPopup: e.zIndexPopupBase + 50
3376
+ })), hl = () => b(b({}, Ae(Jt(), ["inputIcon", "mode", "getInputElement", "getRawInputElement", "backfill"])), {
3377
+ value: Pt([Array, Object, String, Number]),
3378
+ defaultValue: Pt([Array, Object, String, Number]),
3379
+ notFoundContent: $.any,
3380
+ suffixIcon: $.any,
3381
+ itemIcon: $.any,
3382
+ size: Pe(),
3383
+ mode: Pe(),
3384
+ bordered: eo(!0),
3385
+ transitionName: String,
3386
+ choiceTransitionName: Pe(""),
3387
+ popupClassName: String,
3388
+ /** @deprecated Please use `popupClassName` instead */
3389
+ dropdownClassName: String,
3390
+ placement: Pe(),
3391
+ status: Pe(),
3392
+ "onUpdate:value": kn()
3393
+ }), At = "SECRET_COMBOBOX_MODE_DO_NOT_USE", fe = ue({
3394
+ compatConfig: {
3395
+ MODE: 3
3396
+ },
3397
+ name: "ASelect",
3398
+ Option: st,
3399
+ OptGroup: ct,
3400
+ inheritAttrs: !1,
3401
+ props: nt(hl(), {
3402
+ listHeight: 256,
3403
+ listItemHeight: 24
3404
+ }),
3405
+ SECRET_COMBOBOX_MODE_DO_NOT_USE: At,
3406
+ slots: Object,
3407
+ setup(e, n) {
3408
+ let {
3409
+ attrs: o,
3410
+ emit: t,
3411
+ slots: l,
3412
+ expose: a
3413
+ } = n;
3414
+ const c = ve(), s = jn(), m = Gn.useInject(), p = F(() => po(m.status, e.status)), u = () => {
3415
+ var _;
3416
+ (_ = c.value) === null || _ === void 0 || _.focus();
3417
+ }, g = () => {
3418
+ var _;
3419
+ (_ = c.value) === null || _ === void 0 || _.blur();
3420
+ }, N = (_) => {
3421
+ var q;
3422
+ (q = c.value) === null || q === void 0 || q.scrollTo(_);
3423
+ }, D = F(() => {
3424
+ const {
3425
+ mode: _
3426
+ } = e;
3427
+ if (_ !== "combobox")
3428
+ return _ === At ? "combobox" : _;
3429
+ });
3430
+ process.env.NODE_ENV !== "production" && Un(!e.dropdownClassName, "Select", "`dropdownClassName` is deprecated. Please use `popupClassName` instead.");
3431
+ const {
3432
+ prefixCls: v,
3433
+ direction: h,
3434
+ renderEmpty: y,
3435
+ size: S,
3436
+ getPrefixCls: V,
3437
+ getPopupContainer: M,
3438
+ disabled: O,
3439
+ select: d
3440
+ } = Xn("select", e), {
3441
+ compactSize: P,
3442
+ compactItemClassnames: x
3443
+ } = Yn(v, h), R = F(() => P.value || S.value), A = Qn(), X = F(() => {
3444
+ var _;
3445
+ return (_ = O.value) !== null && _ !== void 0 ? _ : A.value;
3446
+ }), [W, ee] = gl(v), Q = F(() => V()), U = F(() => e.placement !== void 0 ? e.placement : h.value === "rtl" ? "bottomRight" : "bottomLeft"), I = F(() => Zn(Q.value, qn(U.value), e.transitionName)), T = F(() => ce({
3447
+ [`${v.value}-lg`]: R.value === "large",
3448
+ [`${v.value}-sm`]: R.value === "small",
3449
+ [`${v.value}-rtl`]: h.value === "rtl",
3450
+ [`${v.value}-borderless`]: !e.bordered,
3451
+ [`${v.value}-in-form-item`]: m.isFormItemInput
3452
+ }, mo(v.value, p.value, m.hasFeedback), x.value, ee.value)), j = function() {
3453
+ for (var _ = arguments.length, q = new Array(_), oe = 0; oe < _; oe++)
3454
+ q[oe] = arguments[oe];
3455
+ t("update:value", q[0]), t("change", ...q), s.onFieldChange();
3456
+ }, Z = (_) => {
3457
+ t("blur", _), s.onFieldBlur();
3458
+ };
3459
+ a({
3460
+ blur: g,
3461
+ focus: u,
3462
+ scrollTo: N
3463
+ });
3464
+ const K = F(() => D.value === "multiple" || D.value === "tags"), ne = F(() => e.showArrow !== void 0 ? e.showArrow : e.loading || !(K.value || D.value === "combobox"));
3465
+ return () => {
3466
+ var _, q, oe, ie;
3467
+ const {
3468
+ notFoundContent: re,
3469
+ listHeight: te = 256,
3470
+ listItemHeight: de = 24,
3471
+ popupClassName: se,
3472
+ dropdownClassName: f,
3473
+ virtual: i,
3474
+ dropdownMatchSelectWidth: r,
3475
+ id: E = s.id.value,
3476
+ placeholder: w = (_ = l.placeholder) === null || _ === void 0 ? void 0 : _.call(l),
3477
+ showArrow: B
3478
+ } = e, {
3479
+ hasFeedback: H,
3480
+ feedbackIcon: G
3481
+ } = m;
3482
+ let k;
3483
+ re !== void 0 ? k = re : l.notFoundContent ? k = l.notFoundContent() : D.value === "combobox" ? k = null : k = (y == null ? void 0 : y("Select")) || C(Jn, {
3484
+ componentName: "Select"
3485
+ }, null);
3486
+ const {
3487
+ suffixIcon: J,
3488
+ itemIcon: le,
3489
+ removeIcon: ae,
3490
+ clearIcon: De
3491
+ } = ul(b(b({}, e), {
3492
+ multiple: K.value,
3493
+ prefixCls: v.value,
3494
+ hasFeedback: H,
3495
+ feedbackIcon: G,
3496
+ showArrow: ne.value
3497
+ }), l), Ve = Ae(e, ["prefixCls", "suffixIcon", "itemIcon", "removeIcon", "clearIcon", "size", "bordered", "status"]), Oe = ce(se || f, {
3498
+ [`${v.value}-dropdown-${h.value}`]: h.value === "rtl"
3499
+ }, ee.value);
3500
+ return W(C(al, L(L(L({
3501
+ ref: c,
3502
+ virtual: i,
3503
+ dropdownMatchSelectWidth: r
3504
+ }, Ve), o), {}, {
3505
+ showSearch: (q = e.showSearch) !== null && q !== void 0 ? q : (oe = d == null ? void 0 : d.value) === null || oe === void 0 ? void 0 : oe.showSearch,
3506
+ placeholder: w,
3507
+ listHeight: te,
3508
+ listItemHeight: de,
3509
+ mode: D.value,
3510
+ prefixCls: v.value,
3511
+ direction: h.value,
3512
+ inputIcon: J,
3513
+ menuItemSelectedIcon: le,
3514
+ removeIcon: ae,
3515
+ clearIcon: De,
3516
+ notFoundContent: k,
3517
+ class: [T.value, o.class],
3518
+ getPopupContainer: M == null ? void 0 : M.value,
3519
+ dropdownClassName: Oe,
3520
+ onChange: j,
3521
+ onBlur: Z,
3522
+ id: E,
3523
+ dropdownRender: Ve.dropdownRender || l.dropdownRender,
3524
+ transitionName: I.value,
3525
+ children: (ie = l.default) === null || ie === void 0 ? void 0 : ie.call(l),
3526
+ tagRender: e.tagRender || l.tagRender,
3527
+ optionLabelRender: l.optionLabel,
3528
+ maxTagPlaceholder: e.maxTagPlaceholder || l.maxTagPlaceholder,
3529
+ showArrow: H || B,
3530
+ disabled: X.value
3531
+ }), {
3532
+ option: l.option
3533
+ }));
3534
+ };
3535
+ }
3536
+ });
3537
+ fe.install = function(e) {
3538
+ return e.component(fe.name, fe), e.component(fe.Option.displayName, fe.Option), e.component(fe.OptGroup.displayName, fe.OptGroup), e;
3539
+ };
3540
+ const bl = fe.Option;
3541
+ fe.OptGroup;
3542
+ const yl = {
3543
+ name: "ZSelect",
3544
+ components: {
3545
+ ASelect: fe,
3546
+ ASelectOption: bl
3547
+ }
3548
+ }, Sl = /* @__PURE__ */ Object.assign(yl, {
3549
+ props: /* @__PURE__ */ En({
3550
+ data: {
3551
+ type: Array,
3552
+ default: () => []
3553
+ }
3554
+ }, {
3555
+ modelValue: {},
3556
+ modelModifiers: {}
3557
+ }),
3558
+ emits: ["update:modelValue"],
3559
+ setup(e) {
3560
+ const n = Fn(e, "modelValue"), o = e;
3561
+ return (t, l) => {
3562
+ const a = Ct("a-select-option"), c = Ct("a-select");
3563
+ return Ke(), It(c, Dn({
3564
+ value: n.value,
3565
+ "onUpdate:value": l[0] || (l[0] = (s) => n.value = s),
3566
+ class: "z-select"
3567
+ }, t.$attrs), {
3568
+ default: xt(() => [
3569
+ (Ke(!0), Vn(xe, null, Nn(o == null ? void 0 : o.data, (s) => (Ke(), It(a, {
3570
+ key: s == null ? void 0 : s.value,
3571
+ value: s.value
3572
+ }, {
3573
+ default: xt(() => [
3574
+ Me(Rn(s.label), 1)
3575
+ ]),
3576
+ _: 2
3577
+ }, 1032, ["value"]))), 128))
3578
+ ]),
3579
+ _: 1
3580
+ }, 16, ["value"]);
3581
+ };
3582
+ }
3583
+ }), Ml = /* @__PURE__ */ to(Sl, [["__scopeId", "data-v-562fa124"]]);
3584
+ export {
3585
+ Ml as default
3586
+ };