gasp-components 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/UploadOutlined-9WKjHsqa.js +878 -0
  2. package/dist/components/ag-grid-table/index.js +57877 -38314
  3. package/dist/components/button/index.js +18 -18
  4. package/dist/components/checklist/checklist-item.js +3 -3
  5. package/dist/components/checklist/index.js +5 -5
  6. package/dist/components/date-picker/index.js +9 -5022
  7. package/dist/components/dragger/index.js +28 -28
  8. package/dist/components/dropdown/index.js +10 -11
  9. package/dist/components/form/index.js +8 -9
  10. package/dist/components/form-item/index.js +10 -10
  11. package/dist/components/input/index.js +8 -8
  12. package/dist/components/modal/index.js +18 -20
  13. package/dist/components/password-input/index.js +2 -2
  14. package/dist/components/progress/index.js +16 -18
  15. package/dist/components/progress-circle/index.js +3 -3
  16. package/dist/components/radio-button/index.js +8 -8
  17. package/dist/components/result-popup/index.js +13 -14
  18. package/dist/components/select/index.js +1 -1
  19. package/dist/components/side-menu/index.js +2 -2
  20. package/dist/components/side-menu/menu-item.js +4 -6
  21. package/dist/components/steps/index.js +9 -9
  22. package/dist/components/table/index.js +16 -9298
  23. package/dist/components/tabs/index.js +10 -10
  24. package/dist/components/tabs/tab.js +7 -8
  25. package/dist/components/tag/index.js +9 -258
  26. package/dist/components/timeline-horizontal/index.js +7 -7
  27. package/dist/components/upload/index.js +62 -77
  28. package/dist/index-WlPrqxgY.js +87 -0
  29. package/dist/main.js +69 -457
  30. package/package.json +1 -1
  31. package/dist/CheckCircleFilled-xt-0R96Z.js +0 -16
  32. package/dist/CheckOutlined-EgxCAgj_.js +0 -16
  33. package/dist/CloseCircleFilled-bIgIULWb.js +0 -16
  34. package/dist/CloseOutlined-Q3kC3EZS.js +0 -16
  35. package/dist/Compact-fdEKV_mF.js +0 -180
  36. package/dist/ExclamationCircleFilled-XzDBEGmA.js +0 -16
  37. package/dist/KeyCode-qFRXB1-n.js +0 -517
  38. package/dist/LoadingOutlined-6Ipqn0og.js +0 -16
  39. package/dist/Overflow-JFdXKgCr.js +0 -231
  40. package/dist/PurePanel-hLGnXbul.js +0 -60
  41. package/dist/SearchOutlined-rJTFGXUi.js +0 -16
  42. package/dist/TextArea-n3dknzTq.js +0 -716
  43. package/dist/UploadOutlined-D8jfLEgv.js +0 -27
  44. package/dist/asyncToGenerator-t4sKr8R4.js +0 -340
  45. package/dist/button-LN5ZDad8.js +0 -819
  46. package/dist/collapse-ilv4Tji1.js +0 -20
  47. package/dist/colors-opGg9oSz.js +0 -25
  48. package/dist/compact-item-jjuVmDBH.js +0 -61
  49. package/dist/context-h3WSVDPz.js +0 -2087
  50. package/dist/createFormattedComponent-FcpICAm8.js +0 -3260
  51. package/dist/index--6VfGMUo.js +0 -402
  52. package/dist/index-0mpuHoS5.js +0 -996
  53. package/dist/index-1KQbTQJ2.js +0 -4405
  54. package/dist/index-5Uo03BMk.js +0 -681
  55. package/dist/index-BFgxz47K.js +0 -89
  56. package/dist/index-D3LMPWyJ.js +0 -1437
  57. package/dist/index-DVS_nWxv.js +0 -3026
  58. package/dist/index-ELHBhuK9.js +0 -100
  59. package/dist/index-Fn8q8B3V.js +0 -107
  60. package/dist/index-GgkQrebz.js +0 -950
  61. package/dist/index-L-MzVDcK.js +0 -616
  62. package/dist/index-M3WnMjiA.js +0 -230
  63. package/dist/index-NQd_zMf0.js +0 -69
  64. package/dist/index-ZT64Ec6u.js +0 -267
  65. package/dist/index-aawDqn9q.js +0 -3337
  66. package/dist/index-k04G4nlS.js +0 -1416
  67. package/dist/index-s3u4YBl4.js +0 -8
  68. package/dist/index-vtDVJV8q.js +0 -19571
  69. package/dist/isVisible-Qi9l15Ty.js +0 -232
  70. package/dist/motion-0ToOu81j.js +0 -226
  71. package/dist/motion-NQme0FJ_.js +0 -32
  72. package/dist/omit-ylWA0ZLZ.js +0 -10
  73. package/dist/pickAttrs-zaQzRTqh.js +0 -42
  74. package/dist/progress-a1_pwKVT.js +0 -722
  75. package/dist/reactNode-R20zZQk1.js +0 -18
  76. package/dist/responsiveObserver-V1_1G14X.js +0 -71
  77. package/dist/roundedArrow-p1Pmd9av.js +0 -64
  78. package/dist/row-sPFiFm0C.js +0 -230
  79. package/dist/slide-mFXPRHku.js +0 -265
  80. package/dist/styleChecker-pZ3k2IiY.js +0 -37
  81. package/dist/useCSSVarCls-GwZT_WiF.js +0 -9
  82. package/dist/useClosable-4G12n4Bp.js +0 -15
  83. package/dist/useLocale-eThlLZJw.js +0 -16
  84. package/dist/useMergedState-qUafLuUa.js +0 -23
  85. package/dist/useVariants-s0IcneBD.js +0 -25
  86. package/dist/zoom-Ps8y0jNW.js +0 -174
@@ -1,3337 +0,0 @@
1
- import * as r from "react";
2
- import Et, { useState as Mt, useRef as ve, useEffect as jt, useMemo as uo, useContext as co } from "react";
3
- import { c as je } from "./index-NQd_zMf0.js";
4
- import { g as ft, b as k, w as so, _ as oe, G as fo, N as ie, e as Je, x as ht, H as Xe, ap as mo, i as Ze, t as vo, z as It, y as ot, q as go, p as po, v as ho, ak as So, f as bo, aq as dn, u as qt, T as Pt, h as $n, m as xt, C as Qt, r as Zt, an as Kt, d as We, ao as Mn, D as Dn, a1 as Co } from "./index-1KQbTQJ2.js";
5
- import { u as Ut } from "./useMergedState-qUafLuUa.js";
6
- import { T as wo, i as yo } from "./index-L-MzVDcK.js";
7
- import { K as X } from "./KeyCode-qFRXB1-n.js";
8
- import { p as _t } from "./pickAttrs-zaQzRTqh.js";
9
- import { F as Eo } from "./Overflow-JFdXKgCr.js";
10
- import { o as Nn } from "./omit-ylWA0ZLZ.js";
11
- import { r as fn } from "./index-vtDVJV8q.js";
12
- import { R as Pn } from "./index--6VfGMUo.js";
13
- import { u as mn, A as Io } from "./isVisible-Qi9l15Ty.js";
14
- import { t as Xt, a as xo, b as Oo } from "./Compact-fdEKV_mF.js";
15
- import { u as Ro } from "./motion-0ToOu81j.js";
16
- import { g as $o } from "./motion-NQme0FJ_.js";
17
- import { g as Mo } from "./PurePanel-hLGnXbul.js";
18
- import { u as Do, g as No, a as Po } from "./useVariants-s0IcneBD.js";
19
- import { u as _o } from "./useLocale-eThlLZJw.js";
20
- import { u as To } from "./useCSSVarCls-GwZT_WiF.js";
21
- import { F as zo } from "./context-h3WSVDPz.js";
22
- import { g as Vo } from "./compact-item-jjuVmDBH.js";
23
- import { s as Ho, a as Lo, b as Fo, c as Bo, i as vn, d as gn } from "./slide-mFXPRHku.js";
24
- import { C as Ao } from "./CheckOutlined-EgxCAgj_.js";
25
- import { C as Wo } from "./CloseCircleFilled-bIgIULWb.js";
26
- import { C as jo } from "./CloseOutlined-Q3kC3EZS.js";
27
- import { L as Ko } from "./LoadingOutlined-6Ipqn0og.js";
28
- import { S as Uo } from "./SearchOutlined-rJTFGXUi.js";
29
- var zt = function(t) {
30
- var n = t.className, o = t.customizeIcon, a = t.customizeIconProps, i = t.children, l = t.onMouseDown, c = t.onClick, f = typeof o == "function" ? o(a) : o;
31
- return /* @__PURE__ */ r.createElement("span", {
32
- className: n,
33
- onMouseDown: function(m) {
34
- m.preventDefault(), l == null || l(m);
35
- },
36
- style: {
37
- userSelect: "none",
38
- WebkitUserSelect: "none"
39
- },
40
- unselectable: "on",
41
- onClick: c,
42
- "aria-hidden": !0
43
- }, f !== void 0 ? f : /* @__PURE__ */ r.createElement("span", {
44
- className: je(n.split(/\s+/).map(function(h) {
45
- return "".concat(h, "-icon");
46
- }))
47
- }, i));
48
- }, Xo = function(t, n, o, a, i) {
49
- var l = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1, c = arguments.length > 6 ? arguments[6] : void 0, f = arguments.length > 7 ? arguments[7] : void 0, h = Et.useMemo(function() {
50
- if (ft(a) === "object")
51
- return a.clearIcon;
52
- if (i)
53
- return i;
54
- }, [a, i]), m = Et.useMemo(function() {
55
- return !!(!l && a && (o.length || c) && !(f === "combobox" && c === ""));
56
- }, [a, l, o.length, c, f]);
57
- return {
58
- allowClear: m,
59
- clearIcon: /* @__PURE__ */ Et.createElement(zt, {
60
- className: "".concat(t, "-clear"),
61
- onMouseDown: n,
62
- customizeIcon: h
63
- }, "×")
64
- };
65
- }, _n = /* @__PURE__ */ r.createContext(null);
66
- function Go() {
67
- return r.useContext(_n);
68
- }
69
- function Yo() {
70
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10, t = r.useState(!1), n = k(t, 2), o = n[0], a = n[1], i = r.useRef(null), l = function() {
71
- window.clearTimeout(i.current);
72
- };
73
- r.useEffect(function() {
74
- return l;
75
- }, []);
76
- var c = function(h, m) {
77
- l(), i.current = window.setTimeout(function() {
78
- a(h), m && m();
79
- }, e);
80
- };
81
- return [o, c, l];
82
- }
83
- function Tn() {
84
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250, t = r.useRef(null), n = r.useRef(null);
85
- r.useEffect(function() {
86
- return function() {
87
- window.clearTimeout(n.current);
88
- };
89
- }, []);
90
- function o(a) {
91
- (a || t.current === null) && (t.current = a), window.clearTimeout(n.current), n.current = window.setTimeout(function() {
92
- t.current = null;
93
- }, e);
94
- }
95
- return [function() {
96
- return t.current;
97
- }, o];
98
- }
99
- function qo(e, t, n, o) {
100
- var a = r.useRef(null);
101
- a.current = {
102
- open: t,
103
- triggerOpen: n,
104
- customizedTrigger: o
105
- }, r.useEffect(function() {
106
- function i(l) {
107
- var c;
108
- if (!((c = a.current) !== null && c !== void 0 && c.customizedTrigger)) {
109
- var f = l.target;
110
- f.shadowRoot && l.composed && (f = l.composedPath()[0] || f), a.current.open && e().filter(function(h) {
111
- return h;
112
- }).every(function(h) {
113
- return !h.contains(f) && h !== f;
114
- }) && a.current.triggerOpen(!1);
115
- }
116
- }
117
- return window.addEventListener("mousedown", i), function() {
118
- return window.removeEventListener("mousedown", i);
119
- };
120
- }, []);
121
- }
122
- var Qo = function(t, n) {
123
- var o, a = t.prefixCls, i = t.id, l = t.inputElement, c = t.disabled, f = t.tabIndex, h = t.autoFocus, m = t.autoComplete, s = t.editable, d = t.activeDescendantId, u = t.value, g = t.maxLength, v = t.onKeyDown, p = t.onMouseDown, S = t.onChange, b = t.onPaste, M = t.onCompositionStart, I = t.onCompositionEnd, H = t.open, O = t.attrs, $ = l || /* @__PURE__ */ r.createElement("input", null), j = $, q = j.ref, B = j.props, A = B.onKeyDown, G = B.onChange, F = B.onMouseDown, L = B.onCompositionStart, te = B.onCompositionEnd, K = B.style;
124
- return so(!("maxLength" in $.props), "Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."), $ = /* @__PURE__ */ r.cloneElement($, oe(oe(oe({
125
- type: "search"
126
- }, B), {}, {
127
- // Override over origin props
128
- id: i,
129
- ref: fo(n, q),
130
- disabled: c,
131
- tabIndex: f,
132
- autoComplete: m || "off",
133
- autoFocus: h,
134
- className: je("".concat(a, "-selection-search-input"), (o = $) === null || o === void 0 || (o = o.props) === null || o === void 0 ? void 0 : o.className),
135
- role: "combobox",
136
- "aria-expanded": H || !1,
137
- "aria-haspopup": "listbox",
138
- "aria-owns": "".concat(i, "_list"),
139
- "aria-autocomplete": "list",
140
- "aria-controls": "".concat(i, "_list"),
141
- "aria-activedescendant": H ? d : void 0
142
- }, O), {}, {
143
- value: s ? u : "",
144
- maxLength: g,
145
- readOnly: !s,
146
- unselectable: s ? null : "on",
147
- style: oe(oe({}, K), {}, {
148
- opacity: s ? null : 0
149
- }),
150
- onKeyDown: function(w) {
151
- v(w), A && A(w);
152
- },
153
- onMouseDown: function(w) {
154
- p(w), F && F(w);
155
- },
156
- onChange: function(w) {
157
- S(w), G && G(w);
158
- },
159
- onCompositionStart: function(w) {
160
- M(w), L && L(w);
161
- },
162
- onCompositionEnd: function(w) {
163
- I(w), te && te(w);
164
- },
165
- onPaste: b
166
- })), $;
167
- }, Jt = /* @__PURE__ */ r.forwardRef(Qo);
168
- process.env.NODE_ENV !== "production" && (Jt.displayName = "Input");
169
- function kt(e) {
170
- return Array.isArray(e) ? e : e !== void 0 ? [e] : [];
171
- }
172
- var Zo = typeof window < "u" && window.document && window.document.documentElement, Jo = process.env.NODE_ENV !== "test" && Zo;
173
- function ko(e) {
174
- return e != null;
175
- }
176
- function er(e) {
177
- return !e && e !== 0;
178
- }
179
- function pn(e) {
180
- return ["string", "number"].includes(ft(e));
181
- }
182
- function zn(e) {
183
- var t = void 0;
184
- return e && (pn(e.title) ? t = e.title.toString() : pn(e.label) && (t = e.label.toString())), t;
185
- }
186
- function tr(e, t) {
187
- Jo ? r.useLayoutEffect(e, t) : r.useEffect(e, t);
188
- }
189
- function nr(e) {
190
- var t;
191
- return (t = e.key) !== null && t !== void 0 ? t : e.value;
192
- }
193
- var hn = function(t) {
194
- t.preventDefault(), t.stopPropagation();
195
- }, or = function(t) {
196
- var n = t.id, o = t.prefixCls, a = t.values, i = t.open, l = t.searchValue, c = t.autoClearSearchValue, f = t.inputRef, h = t.placeholder, m = t.disabled, s = t.mode, d = t.showSearch, u = t.autoFocus, g = t.autoComplete, v = t.activeDescendantId, p = t.tabIndex, S = t.removeIcon, b = t.maxTagCount, M = t.maxTagTextLength, I = t.maxTagPlaceholder, H = I === void 0 ? function(D) {
197
- return "+ ".concat(D.length, " ...");
198
- } : I, O = t.tagRender, $ = t.onToggleOpen, j = t.onRemove, q = t.onInputChange, B = t.onInputPaste, A = t.onInputKeyDown, G = t.onInputMouseDown, F = t.onInputCompositionStart, L = t.onInputCompositionEnd, te = r.useRef(null), K = Mt(0), N = k(K, 2), w = N[0], se = N[1], ne = Mt(!1), xe = k(ne, 2), be = xe[0], Y = xe[1], de = "".concat(o, "-selection"), pe = i || s === "multiple" && c === !1 || s === "tags" ? l : "", le = s === "tags" || s === "multiple" && c === !1 || d && (i || be);
199
- tr(function() {
200
- se(te.current.scrollWidth);
201
- }, [pe]);
202
- var Ne = function(R, V, ee, Z, he) {
203
- return /* @__PURE__ */ r.createElement("span", {
204
- title: zn(R),
205
- className: je("".concat(de, "-item"), ie({}, "".concat(de, "-item-disabled"), ee))
206
- }, /* @__PURE__ */ r.createElement("span", {
207
- className: "".concat(de, "-item-content")
208
- }, V), Z && /* @__PURE__ */ r.createElement(zt, {
209
- className: "".concat(de, "-item-remove"),
210
- onMouseDown: hn,
211
- onClick: he,
212
- customizeIcon: S
213
- }, "×"));
214
- }, Me = function(R, V, ee, Z, he) {
215
- var ue = function(Oe) {
216
- hn(Oe), $(!i);
217
- };
218
- return /* @__PURE__ */ r.createElement("span", {
219
- onMouseDown: ue
220
- }, O({
221
- label: V,
222
- value: R,
223
- disabled: ee,
224
- closable: Z,
225
- onClose: he
226
- }));
227
- }, ge = function(R) {
228
- var V = R.disabled, ee = R.label, Z = R.value, he = !m && !V, ue = ee;
229
- if (typeof M == "number" && (typeof ee == "string" || typeof ee == "number")) {
230
- var $e = String(ue);
231
- $e.length > M && (ue = "".concat($e.slice(0, M), "..."));
232
- }
233
- var Oe = function(re) {
234
- re && re.stopPropagation(), j(R);
235
- };
236
- return typeof O == "function" ? Me(Z, ue, V, he, Oe) : Ne(R, ue, V, he, Oe);
237
- }, x = function(R) {
238
- var V = typeof H == "function" ? H(R) : H;
239
- return Ne({
240
- title: V
241
- }, V, !1);
242
- }, C = /* @__PURE__ */ r.createElement("div", {
243
- className: "".concat(de, "-search"),
244
- style: {
245
- width: w
246
- },
247
- onFocus: function() {
248
- Y(!0);
249
- },
250
- onBlur: function() {
251
- Y(!1);
252
- }
253
- }, /* @__PURE__ */ r.createElement(Jt, {
254
- ref: f,
255
- open: i,
256
- prefixCls: o,
257
- id: n,
258
- inputElement: null,
259
- disabled: m,
260
- autoFocus: u,
261
- autoComplete: g,
262
- editable: le,
263
- activeDescendantId: v,
264
- value: pe,
265
- onKeyDown: A,
266
- onMouseDown: G,
267
- onChange: q,
268
- onPaste: B,
269
- onCompositionStart: F,
270
- onCompositionEnd: L,
271
- tabIndex: p,
272
- attrs: _t(t, !0)
273
- }), /* @__PURE__ */ r.createElement("span", {
274
- ref: te,
275
- className: "".concat(de, "-search-mirror"),
276
- "aria-hidden": !0
277
- }, pe, " ")), y = /* @__PURE__ */ r.createElement(Eo, {
278
- prefixCls: "".concat(de, "-overflow"),
279
- data: a,
280
- renderItem: ge,
281
- renderRest: x,
282
- suffix: C,
283
- itemKey: nr,
284
- maxCount: b
285
- });
286
- return /* @__PURE__ */ r.createElement(r.Fragment, null, y, !a.length && !pe && /* @__PURE__ */ r.createElement("span", {
287
- className: "".concat(de, "-placeholder")
288
- }, h));
289
- }, rr = function(t) {
290
- var n = t.inputElement, o = t.prefixCls, a = t.id, i = t.inputRef, l = t.disabled, c = t.autoFocus, f = t.autoComplete, h = t.activeDescendantId, m = t.mode, s = t.open, d = t.values, u = t.placeholder, g = t.tabIndex, v = t.showSearch, p = t.searchValue, S = t.activeValue, b = t.maxLength, M = t.onInputKeyDown, I = t.onInputMouseDown, H = t.onInputChange, O = t.onInputPaste, $ = t.onInputCompositionStart, j = t.onInputCompositionEnd, q = t.title, B = r.useState(!1), A = k(B, 2), G = A[0], F = A[1], L = m === "combobox", te = L || v, K = d[0], N = p || "";
291
- L && S && !G && (N = S), r.useEffect(function() {
292
- L && F(!1);
293
- }, [L, S]);
294
- var w = m !== "combobox" && !s && !v ? !1 : !!N, se = q === void 0 ? zn(K) : q, ne = r.useMemo(function() {
295
- return K ? null : /* @__PURE__ */ r.createElement("span", {
296
- className: "".concat(o, "-selection-placeholder"),
297
- style: w ? {
298
- visibility: "hidden"
299
- } : void 0
300
- }, u);
301
- }, [K, w, u, o]);
302
- return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("span", {
303
- className: "".concat(o, "-selection-search")
304
- }, /* @__PURE__ */ r.createElement(Jt, {
305
- ref: i,
306
- prefixCls: o,
307
- id: a,
308
- open: s,
309
- inputElement: n,
310
- disabled: l,
311
- autoFocus: c,
312
- autoComplete: f,
313
- editable: te,
314
- activeDescendantId: h,
315
- value: N,
316
- onKeyDown: M,
317
- onMouseDown: I,
318
- onChange: function(be) {
319
- F(!0), H(be);
320
- },
321
- onPaste: O,
322
- onCompositionStart: $,
323
- onCompositionEnd: j,
324
- tabIndex: g,
325
- attrs: _t(t, !0),
326
- maxLength: L ? b : void 0
327
- })), !L && K ? /* @__PURE__ */ r.createElement("span", {
328
- className: "".concat(o, "-selection-item"),
329
- title: se,
330
- style: w ? {
331
- visibility: "hidden"
332
- } : void 0
333
- }, K.label) : null, ne);
334
- };
335
- function ar(e) {
336
- return ![
337
- // System function button
338
- X.ESC,
339
- X.SHIFT,
340
- X.BACKSPACE,
341
- X.TAB,
342
- X.WIN_KEY,
343
- X.ALT,
344
- X.META,
345
- X.WIN_KEY_RIGHT,
346
- X.CTRL,
347
- X.SEMICOLON,
348
- X.EQUALS,
349
- X.CAPS_LOCK,
350
- X.CONTEXT_MENU,
351
- // F1-F12
352
- X.F1,
353
- X.F2,
354
- X.F3,
355
- X.F4,
356
- X.F5,
357
- X.F6,
358
- X.F7,
359
- X.F8,
360
- X.F9,
361
- X.F10,
362
- X.F11,
363
- X.F12
364
- ].includes(e);
365
- }
366
- var ir = function(t, n) {
367
- var o = ve(null), a = ve(!1), i = t.prefixCls, l = t.open, c = t.mode, f = t.showSearch, h = t.tokenWithEnter, m = t.autoClearSearchValue, s = t.onSearch, d = t.onSearchSubmit, u = t.onToggleOpen, g = t.onInputKeyDown, v = t.domRef;
368
- r.useImperativeHandle(n, function() {
369
- return {
370
- focus: function() {
371
- o.current.focus();
372
- },
373
- blur: function() {
374
- o.current.blur();
375
- }
376
- };
377
- });
378
- var p = Tn(0), S = k(p, 2), b = S[0], M = S[1], I = function(N) {
379
- var w = N.which;
380
- (w === X.UP || w === X.DOWN) && N.preventDefault(), g && g(N), w === X.ENTER && c === "tags" && !a.current && !l && (d == null || d(N.target.value)), ar(w) && u(!0);
381
- }, H = function() {
382
- M(!0);
383
- }, O = ve(null), $ = function(N) {
384
- s(N, !0, a.current) !== !1 && u(!0);
385
- }, j = function() {
386
- a.current = !0;
387
- }, q = function(N) {
388
- a.current = !1, c !== "combobox" && $(N.target.value);
389
- }, B = function(N) {
390
- var w = N.target.value;
391
- if (h && O.current && /[\r\n]/.test(O.current)) {
392
- var se = O.current.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " ");
393
- w = w.replace(se, O.current);
394
- }
395
- O.current = null, $(w);
396
- }, A = function(N) {
397
- var w = N.clipboardData, se = w == null ? void 0 : w.getData("text");
398
- O.current = se || "";
399
- }, G = function(N) {
400
- var w = N.target;
401
- if (w !== o.current) {
402
- var se = document.body.style.msTouchAction !== void 0;
403
- se ? setTimeout(function() {
404
- o.current.focus();
405
- }) : o.current.focus();
406
- }
407
- }, F = function(N) {
408
- var w = b();
409
- N.target !== o.current && !w && c !== "combobox" && N.preventDefault(), (c !== "combobox" && (!f || !w) || !l) && (l && m !== !1 && s("", !0, !1), u());
410
- }, L = {
411
- inputRef: o,
412
- onInputKeyDown: I,
413
- onInputMouseDown: H,
414
- onInputChange: B,
415
- onInputPaste: A,
416
- onInputCompositionStart: j,
417
- onInputCompositionEnd: q
418
- }, te = c === "multiple" || c === "tags" ? /* @__PURE__ */ r.createElement(or, Je({}, t, L)) : /* @__PURE__ */ r.createElement(rr, Je({}, t, L));
419
- return /* @__PURE__ */ r.createElement("div", {
420
- ref: v,
421
- className: "".concat(i, "-selector"),
422
- onClick: G,
423
- onMouseDown: F
424
- }, te);
425
- }, Vn = /* @__PURE__ */ r.forwardRef(ir);
426
- process.env.NODE_ENV !== "production" && (Vn.displayName = "Selector");
427
- var lr = ["prefixCls", "disabled", "visible", "children", "popupElement", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "direction", "placement", "builtinPlacements", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "getPopupContainer", "empty", "getTriggerDOMNode", "onPopupVisibleChange", "onPopupMouseEnter"], ur = function(t) {
428
- var n = t === !0 ? 0 : 1;
429
- return {
430
- bottomLeft: {
431
- points: ["tl", "bl"],
432
- offset: [0, 4],
433
- overflow: {
434
- adjustX: n,
435
- adjustY: 1
436
- },
437
- htmlRegion: "scroll"
438
- },
439
- bottomRight: {
440
- points: ["tr", "br"],
441
- offset: [0, 4],
442
- overflow: {
443
- adjustX: n,
444
- adjustY: 1
445
- },
446
- htmlRegion: "scroll"
447
- },
448
- topLeft: {
449
- points: ["bl", "tl"],
450
- offset: [0, -4],
451
- overflow: {
452
- adjustX: n,
453
- adjustY: 1
454
- },
455
- htmlRegion: "scroll"
456
- },
457
- topRight: {
458
- points: ["br", "tr"],
459
- offset: [0, -4],
460
- overflow: {
461
- adjustX: n,
462
- adjustY: 1
463
- },
464
- htmlRegion: "scroll"
465
- }
466
- };
467
- }, cr = function(t, n) {
468
- var o = t.prefixCls;
469
- t.disabled;
470
- var a = t.visible, i = t.children, l = t.popupElement, c = t.animation, f = t.transitionName, h = t.dropdownStyle, m = t.dropdownClassName, s = t.direction, d = s === void 0 ? "ltr" : s, u = t.placement, g = t.builtinPlacements, v = t.dropdownMatchSelectWidth, p = t.dropdownRender, S = t.dropdownAlign, b = t.getPopupContainer, M = t.empty, I = t.getTriggerDOMNode, H = t.onPopupVisibleChange, O = t.onPopupMouseEnter, $ = ht(t, lr), j = "".concat(o, "-dropdown"), q = l;
471
- p && (q = p(l));
472
- var B = r.useMemo(function() {
473
- return g || ur(v);
474
- }, [g, v]), A = c ? "".concat(j, "-").concat(c) : f, G = typeof v == "number", F = r.useMemo(function() {
475
- return G ? null : v === !1 ? "minWidth" : "width";
476
- }, [v, G]), L = h;
477
- G && (L = oe(oe({}, L), {}, {
478
- width: v
479
- }));
480
- var te = r.useRef(null);
481
- return r.useImperativeHandle(n, function() {
482
- return {
483
- getPopupElement: function() {
484
- return te.current;
485
- }
486
- };
487
- }), /* @__PURE__ */ r.createElement(wo, Je({}, $, {
488
- showAction: H ? ["click"] : [],
489
- hideAction: H ? ["click"] : [],
490
- popupPlacement: u || (d === "rtl" ? "bottomRight" : "bottomLeft"),
491
- builtinPlacements: B,
492
- prefixCls: j,
493
- popupTransitionName: A,
494
- popup: /* @__PURE__ */ r.createElement("div", {
495
- ref: te,
496
- onMouseEnter: O
497
- }, q),
498
- stretch: F,
499
- popupAlign: S,
500
- popupVisible: a,
501
- getPopupContainer: b,
502
- popupClassName: je(m, ie({}, "".concat(j, "-empty"), M)),
503
- popupStyle: L,
504
- getTriggerDOMNode: I,
505
- onPopupVisibleChange: H
506
- }), i);
507
- }, Hn = /* @__PURE__ */ r.forwardRef(cr);
508
- process.env.NODE_ENV !== "production" && (Hn.displayName = "SelectTrigger");
509
- function Sn(e, t) {
510
- var n = e.key, o;
511
- return "value" in e && (o = e.value), n ?? (o !== void 0 ? o : "rc-index-key-".concat(t));
512
- }
513
- function Ln(e, t) {
514
- var n = e || {}, o = n.label, a = n.value, i = n.options, l = n.groupLabel, c = o || (t ? "children" : "label");
515
- return {
516
- label: c,
517
- value: a || "value",
518
- options: i || "options",
519
- groupLabel: l || c
520
- };
521
- }
522
- function sr(e) {
523
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.fieldNames, o = t.childrenAsData, a = [], i = Ln(n, !1), l = i.label, c = i.value, f = i.options, h = i.groupLabel;
524
- function m(s, d) {
525
- Array.isArray(s) && s.forEach(function(u) {
526
- if (d || !(f in u)) {
527
- var g = u[c];
528
- a.push({
529
- key: Sn(u, a.length),
530
- groupOption: d,
531
- data: u,
532
- label: u[l],
533
- value: g
534
- });
535
- } else {
536
- var v = u[h];
537
- v === void 0 && o && (v = u.label), a.push({
538
- key: Sn(u, a.length),
539
- group: !0,
540
- data: u,
541
- label: v
542
- }), m(u[f], !0);
543
- }
544
- });
545
- }
546
- return m(e, !1), a;
547
- }
548
- function Gt(e) {
549
- var t = oe({}, e);
550
- return "props" in t || Object.defineProperty(t, "props", {
551
- get: function() {
552
- return Xe(!1, "Return type is option instead of Option instance. Please read value directly instead of reading from `props`."), t;
553
- }
554
- }), t;
555
- }
556
- var dr = function(t, n, o) {
557
- if (!n || !n.length)
558
- return null;
559
- var a = !1, i = function c(f, h) {
560
- var m = mo(h), s = m[0], d = m.slice(1);
561
- if (!s)
562
- return [f];
563
- var u = f.split(s);
564
- return a = a || u.length > 1, u.reduce(function(g, v) {
565
- return [].concat(Ze(g), Ze(c(v, d)));
566
- }, []).filter(Boolean);
567
- }, l = i(t, n);
568
- return a ? typeof o < "u" ? l.slice(0, o) : l : null;
569
- }, en = /* @__PURE__ */ r.createContext(null), fr = ["id", "prefixCls", "className", "showSearch", "tagRender", "direction", "omitDomProps", "displayValues", "onDisplayValuesChange", "emptyOptions", "notFoundContent", "onClear", "mode", "disabled", "loading", "getInputElement", "getRawInputElement", "open", "defaultOpen", "onDropdownVisibleChange", "activeValue", "onActiveValueChange", "activeDescendantId", "searchValue", "autoClearSearchValue", "onSearch", "onSearchSplit", "tokenSeparators", "allowClear", "suffixIcon", "clearIcon", "OptionList", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "placement", "builtinPlacements", "getPopupContainer", "showAction", "onFocus", "onBlur", "onKeyUp", "onKeyDown", "onMouseDown"], mr = ["value", "onChange", "removeIcon", "placeholder", "autoFocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabIndex"], Tt = function(t) {
570
- return t === "tags" || t === "multiple";
571
- }, Fn = /* @__PURE__ */ r.forwardRef(function(e, t) {
572
- var n, o, a = e.id, i = e.prefixCls, l = e.className, c = e.showSearch, f = e.tagRender, h = e.direction, m = e.omitDomProps, s = e.displayValues, d = e.onDisplayValuesChange, u = e.emptyOptions, g = e.notFoundContent, v = g === void 0 ? "Not Found" : g, p = e.onClear, S = e.mode, b = e.disabled, M = e.loading, I = e.getInputElement, H = e.getRawInputElement, O = e.open, $ = e.defaultOpen, j = e.onDropdownVisibleChange, q = e.activeValue, B = e.onActiveValueChange, A = e.activeDescendantId, G = e.searchValue, F = e.autoClearSearchValue, L = e.onSearch, te = e.onSearchSplit, K = e.tokenSeparators, N = e.allowClear, w = e.suffixIcon, se = e.clearIcon, ne = e.OptionList, xe = e.animation, be = e.transitionName, Y = e.dropdownStyle, de = e.dropdownClassName, pe = e.dropdownMatchSelectWidth, le = e.dropdownRender, Ne = e.dropdownAlign, Me = e.placement, ge = e.builtinPlacements, x = e.getPopupContainer, C = e.showAction, y = C === void 0 ? [] : C, D = e.onFocus, R = e.onBlur, V = e.onKeyUp, ee = e.onKeyDown, Z = e.onMouseDown, he = ht(e, fr), ue = Tt(S), $e = (c !== void 0 ? c : ue) || S === "combobox", Oe = oe({}, he);
573
- mr.forEach(function(J) {
574
- delete Oe[J];
575
- }), m == null || m.forEach(function(J) {
576
- delete Oe[J];
577
- });
578
- var De = r.useState(!1), re = k(De, 2), _e = re[0], Te = re[1];
579
- r.useEffect(function() {
580
- Te(yo());
581
- }, []);
582
- var Ce = r.useRef(null), Se = r.useRef(null), ze = r.useRef(null), we = r.useRef(null), He = r.useRef(null), Ee = r.useRef(!1), ke = Yo(), Pe = k(ke, 3), Ge = Pe[0], Ye = Pe[1], mt = Pe[2];
583
- r.useImperativeHandle(t, function() {
584
- var J, U;
585
- return {
586
- focus: (J = we.current) === null || J === void 0 ? void 0 : J.focus,
587
- blur: (U = we.current) === null || U === void 0 ? void 0 : U.blur,
588
- scrollTo: function(Ue) {
589
- var Re;
590
- return (Re = He.current) === null || Re === void 0 ? void 0 : Re.scrollTo(Ue);
591
- }
592
- };
593
- });
594
- var fe = r.useMemo(function() {
595
- var J;
596
- if (S !== "combobox")
597
- return G;
598
- var U = (J = s[0]) === null || J === void 0 ? void 0 : J.value;
599
- return typeof U == "string" || typeof U == "number" ? String(U) : "";
600
- }, [G, S, s]), qe = S === "combobox" && typeof I == "function" && I() || null, Le = typeof H == "function" && H(), Ot = vo(Se, Le == null || (n = Le.props) === null || n === void 0 ? void 0 : n.ref), bt = r.useState(!1), at = k(bt, 2), Ct = at[0], et = at[1];
601
- It(function() {
602
- et(!0);
603
- }, []);
604
- var it = Ut(!1, {
605
- defaultValue: $,
606
- value: O
607
- }), lt = k(it, 2), vt = lt[0], gt = lt[1], ye = Ct ? vt : !1, _ = !v && u;
608
- (b || _ && ye && S === "combobox") && (ye = !1);
609
- var T = _ ? !1 : ye, E = r.useCallback(function(J) {
610
- var U = J !== void 0 ? J : !ye;
611
- b || (gt(U), ye !== U && (j == null || j(U)));
612
- }, [b, ye, gt, j]), W = r.useMemo(function() {
613
- return (K || []).some(function(J) {
614
- return [`
615
- `, `\r
616
- `].includes(J);
617
- });
618
- }, [K]), ae = r.useContext(en) || {}, ce = ae.maxCount, Fe = ae.rawValues, Ke = function(U, Ve, Ue) {
619
- if (!((Fe == null ? void 0 : Fe.size) >= ce)) {
620
- var Re = !0, Ae = U;
621
- B == null || B(null);
622
- var nt = dr(U, K, ce && ce - Fe.size), ct = Ue ? null : nt;
623
- return S !== "combobox" && ct && (Ae = "", te == null || te(ct), E(!1), Re = !1), L && fe !== Ae && L(Ae, {
624
- source: Ve ? "typing" : "effect"
625
- }), Re;
626
- }
627
- }, rt = function(U) {
628
- !U || !U.trim() || L(U, {
629
- source: "submit"
630
- });
631
- };
632
- r.useEffect(function() {
633
- !ye && !ue && S !== "combobox" && Ke("", !1, !1);
634
- }, [ye]), r.useEffect(function() {
635
- vt && b && gt(!1), b && !Ee.current && Ye(!1);
636
- }, [b]);
637
- var Ie = Tn(), Be = k(Ie, 2), tt = Be[0], P = Be[1], z = function(U) {
638
- var Ve = tt(), Ue = U.which;
639
- if (Ue === X.ENTER && (S !== "combobox" && U.preventDefault(), ye || E(!0)), P(!!fe), Ue === X.BACKSPACE && !Ve && ue && !fe && s.length) {
640
- for (var Re = Ze(s), Ae = null, nt = Re.length - 1; nt >= 0; nt -= 1) {
641
- var ct = Re[nt];
642
- if (!ct.disabled) {
643
- Re.splice(nt, 1), Ae = ct;
644
- break;
645
- }
646
- }
647
- Ae && d(Re, {
648
- type: "remove",
649
- values: [Ae]
650
- });
651
- }
652
- for (var st = arguments.length, wt = new Array(st > 1 ? st - 1 : 0), dt = 1; dt < st; dt++)
653
- wt[dt - 1] = arguments[dt];
654
- if (ye) {
655
- var Nt;
656
- (Nt = He.current) === null || Nt === void 0 || Nt.onKeyDown.apply(Nt, [U].concat(wt));
657
- }
658
- ee == null || ee.apply(void 0, [U].concat(wt));
659
- }, Q = function(U) {
660
- for (var Ve = arguments.length, Ue = new Array(Ve > 1 ? Ve - 1 : 0), Re = 1; Re < Ve; Re++)
661
- Ue[Re - 1] = arguments[Re];
662
- if (ye) {
663
- var Ae;
664
- (Ae = He.current) === null || Ae === void 0 || Ae.onKeyUp.apply(Ae, [U].concat(Ue));
665
- }
666
- V == null || V.apply(void 0, [U].concat(Ue));
667
- }, me = function(U) {
668
- var Ve = s.filter(function(Ue) {
669
- return Ue !== U;
670
- });
671
- d(Ve, {
672
- type: "remove",
673
- values: [U]
674
- });
675
- }, Qe = r.useRef(!1), Ht = function() {
676
- Ye(!0), b || (D && !Qe.current && D.apply(void 0, arguments), y.includes("focus") && E(!0)), Qe.current = !0;
677
- }, pt = function() {
678
- Ee.current = !0, Ye(!1, function() {
679
- Qe.current = !1, Ee.current = !1, E(!1);
680
- }), !b && (fe && (S === "tags" ? L(fe, {
681
- source: "submit"
682
- }) : S === "multiple" && L("", {
683
- source: "blur"
684
- })), R && R.apply(void 0, arguments));
685
- }, ut = [];
686
- r.useEffect(function() {
687
- return function() {
688
- ut.forEach(function(J) {
689
- return clearTimeout(J);
690
- }), ut.splice(0, ut.length);
691
- };
692
- }, []);
693
- var Lt = function(U) {
694
- var Ve, Ue = U.target, Re = (Ve = ze.current) === null || Ve === void 0 ? void 0 : Ve.getPopupElement();
695
- if (Re && Re.contains(Ue)) {
696
- var Ae = setTimeout(function() {
697
- var wt = ut.indexOf(Ae);
698
- if (wt !== -1 && ut.splice(wt, 1), mt(), !_e && !Re.contains(document.activeElement)) {
699
- var dt;
700
- (dt = we.current) === null || dt === void 0 || dt.focus();
701
- }
702
- });
703
- ut.push(Ae);
704
- }
705
- for (var nt = arguments.length, ct = new Array(nt > 1 ? nt - 1 : 0), st = 1; st < nt; st++)
706
- ct[st - 1] = arguments[st];
707
- Z == null || Z.apply(void 0, [U].concat(ct));
708
- }, Dt = r.useState({}), Rt = k(Dt, 2), eo = Rt[1];
709
- function to() {
710
- eo({});
711
- }
712
- var an;
713
- Le && (an = function(U) {
714
- E(U);
715
- }), qo(function() {
716
- var J;
717
- return [Ce.current, (J = ze.current) === null || J === void 0 ? void 0 : J.getPopupElement()];
718
- }, T, E, !!Le);
719
- var no = r.useMemo(function() {
720
- return oe(oe({}, e), {}, {
721
- notFoundContent: v,
722
- open: ye,
723
- triggerOpen: T,
724
- id: a,
725
- showSearch: $e,
726
- multiple: ue,
727
- toggleOpen: E
728
- });
729
- }, [e, v, T, ye, a, $e, ue, E]), ln = !!w || M, un;
730
- ln && (un = /* @__PURE__ */ r.createElement(zt, {
731
- className: je("".concat(i, "-arrow"), ie({}, "".concat(i, "-arrow-loading"), M)),
732
- customizeIcon: w,
733
- customizeIconProps: {
734
- loading: M,
735
- searchValue: fe,
736
- open: ye,
737
- focused: Ge,
738
- showSearch: $e
739
- }
740
- }));
741
- var oo = function() {
742
- var U;
743
- p == null || p(), (U = we.current) === null || U === void 0 || U.focus(), d([], {
744
- type: "clear",
745
- values: s
746
- }), Ke("", !1, !1);
747
- }, cn = Xo(i, oo, s, N, se, b, fe, S), ro = cn.allowClear, ao = cn.clearIcon, io = /* @__PURE__ */ r.createElement(ne, {
748
- ref: He
749
- }), lo = je(i, l, (o = {}, ie(o, "".concat(i, "-focused"), Ge), ie(o, "".concat(i, "-multiple"), ue), ie(o, "".concat(i, "-single"), !ue), ie(o, "".concat(i, "-allow-clear"), N), ie(o, "".concat(i, "-show-arrow"), ln), ie(o, "".concat(i, "-disabled"), b), ie(o, "".concat(i, "-loading"), M), ie(o, "".concat(i, "-open"), ye), ie(o, "".concat(i, "-customize-input"), qe), ie(o, "".concat(i, "-show-search"), $e), o)), sn = /* @__PURE__ */ r.createElement(Hn, {
750
- ref: ze,
751
- disabled: b,
752
- prefixCls: i,
753
- visible: T,
754
- popupElement: io,
755
- animation: xe,
756
- transitionName: be,
757
- dropdownStyle: Y,
758
- dropdownClassName: de,
759
- direction: h,
760
- dropdownMatchSelectWidth: pe,
761
- dropdownRender: le,
762
- dropdownAlign: Ne,
763
- placement: Me,
764
- builtinPlacements: ge,
765
- getPopupContainer: x,
766
- empty: u,
767
- getTriggerDOMNode: function() {
768
- return Se.current;
769
- },
770
- onPopupVisibleChange: an,
771
- onPopupMouseEnter: to
772
- }, Le ? /* @__PURE__ */ r.cloneElement(Le, {
773
- ref: Ot
774
- }) : /* @__PURE__ */ r.createElement(Vn, Je({}, e, {
775
- domRef: Se,
776
- prefixCls: i,
777
- inputElement: qe,
778
- ref: we,
779
- id: a,
780
- showSearch: $e,
781
- autoClearSearchValue: F,
782
- mode: S,
783
- activeDescendantId: A,
784
- tagRender: f,
785
- values: s,
786
- open: ye,
787
- onToggleOpen: E,
788
- activeValue: q,
789
- searchValue: fe,
790
- onSearch: Ke,
791
- onSearchSubmit: rt,
792
- onRemove: me,
793
- tokenWithEnter: W
794
- }))), Ft;
795
- return Le ? Ft = sn : Ft = /* @__PURE__ */ r.createElement("div", Je({
796
- className: lo
797
- }, Oe, {
798
- ref: Ce,
799
- onMouseDown: Lt,
800
- onKeyDown: z,
801
- onKeyUp: Q,
802
- onFocus: Ht,
803
- onBlur: pt
804
- }), Ge && !ye && /* @__PURE__ */ r.createElement("span", {
805
- "aria-live": "polite",
806
- style: {
807
- width: 0,
808
- height: 0,
809
- position: "absolute",
810
- overflow: "hidden",
811
- opacity: 0
812
- }
813
- }, "".concat(s.map(function(J) {
814
- var U = J.label, Ve = J.value;
815
- return ["number", "string"].includes(ft(U)) ? U : Ve;
816
- }).join(", "))), sn, un, ro && ao), /* @__PURE__ */ r.createElement(_n.Provider, {
817
- value: no
818
- }, Ft);
819
- });
820
- process.env.NODE_ENV !== "production" && (Fn.displayName = "BaseSelect");
821
- var tn = function() {
822
- return null;
823
- };
824
- tn.isSelectOptGroup = !0;
825
- var nn = function() {
826
- return null;
827
- };
828
- nn.isSelectOption = !0;
829
- var Bn = /* @__PURE__ */ r.forwardRef(function(e, t) {
830
- var n = e.height, o = e.offsetY, a = e.offsetX, i = e.children, l = e.prefixCls, c = e.onInnerResize, f = e.innerProps, h = e.rtl, m = e.extra, s = {}, d = {
831
- display: "flex",
832
- flexDirection: "column"
833
- };
834
- if (o !== void 0) {
835
- var u;
836
- s = {
837
- height: n,
838
- position: "relative",
839
- overflow: "hidden"
840
- }, d = oe(oe({}, d), {}, (u = {
841
- transform: "translateY(".concat(o, "px)")
842
- }, ie(u, h ? "marginRight" : "marginLeft", -a), ie(u, "position", "absolute"), ie(u, "left", 0), ie(u, "right", 0), ie(u, "top", 0), u));
843
- }
844
- return /* @__PURE__ */ r.createElement("div", {
845
- style: s
846
- }, /* @__PURE__ */ r.createElement(Pn, {
847
- onResize: function(v) {
848
- var p = v.offsetHeight;
849
- p && c && c();
850
- }
851
- }, /* @__PURE__ */ r.createElement("div", Je({
852
- style: d,
853
- className: je(ie({}, "".concat(l, "-holder-inner"), l)),
854
- ref: t
855
- }, f), i, m)));
856
- });
857
- Bn.displayName = "Filler";
858
- function bn(e, t) {
859
- var n = "touches" in e ? e.touches[0] : e;
860
- return n[t ? "pageX" : "pageY"];
861
- }
862
- var Yt = /* @__PURE__ */ r.forwardRef(function(e, t) {
863
- var n, o = e.prefixCls, a = e.rtl, i = e.scrollOffset, l = e.scrollRange, c = e.onStartMove, f = e.onStopMove, h = e.onScroll, m = e.horizontal, s = e.spinSize, d = e.containerSize, u = e.style, g = e.thumbStyle, v = r.useState(!1), p = k(v, 2), S = p[0], b = p[1], M = r.useState(null), I = k(M, 2), H = I[0], O = I[1], $ = r.useState(null), j = k($, 2), q = j[0], B = j[1], A = !a, G = r.useRef(), F = r.useRef(), L = r.useState(!1), te = k(L, 2), K = te[0], N = te[1], w = r.useRef(), se = function() {
864
- clearTimeout(w.current), N(!0), w.current = setTimeout(function() {
865
- N(!1);
866
- }, 3e3);
867
- }, ne = l - d || 0, xe = d - s || 0, be = ne > 0, Y = r.useMemo(function() {
868
- if (i === 0 || ne === 0)
869
- return 0;
870
- var y = i / ne;
871
- return y * xe;
872
- }, [i, ne, xe]), de = function(D) {
873
- D.stopPropagation(), D.preventDefault();
874
- }, pe = r.useRef({
875
- top: Y,
876
- dragging: S,
877
- pageY: H,
878
- startTop: q
879
- });
880
- pe.current = {
881
- top: Y,
882
- dragging: S,
883
- pageY: H,
884
- startTop: q
885
- };
886
- var le = function(D) {
887
- b(!0), O(bn(D, m)), B(pe.current.top), c(), D.stopPropagation(), D.preventDefault();
888
- };
889
- r.useEffect(function() {
890
- var y = function(ee) {
891
- ee.preventDefault();
892
- }, D = G.current, R = F.current;
893
- return D.addEventListener("touchstart", y), R.addEventListener("touchstart", le), function() {
894
- D.removeEventListener("touchstart", y), R.removeEventListener("touchstart", le);
895
- };
896
- }, []);
897
- var Ne = r.useRef();
898
- Ne.current = ne;
899
- var Me = r.useRef();
900
- Me.current = xe, r.useEffect(function() {
901
- if (S) {
902
- var y, D = function(ee) {
903
- var Z = pe.current, he = Z.dragging, ue = Z.pageY, $e = Z.startTop;
904
- if (ot.cancel(y), he) {
905
- var Oe = bn(ee, m) - ue, De = $e;
906
- !A && m ? De -= Oe : De += Oe;
907
- var re = Ne.current, _e = Me.current, Te = _e ? De / _e : 0, Ce = Math.ceil(Te * re);
908
- Ce = Math.max(Ce, 0), Ce = Math.min(Ce, re), y = ot(function() {
909
- h(Ce, m);
910
- });
911
- }
912
- }, R = function() {
913
- b(!1), f();
914
- };
915
- return window.addEventListener("mousemove", D), window.addEventListener("touchmove", D), window.addEventListener("mouseup", R), window.addEventListener("touchend", R), function() {
916
- window.removeEventListener("mousemove", D), window.removeEventListener("touchmove", D), window.removeEventListener("mouseup", R), window.removeEventListener("touchend", R), ot.cancel(y);
917
- };
918
- }
919
- }, [S]), r.useEffect(function() {
920
- se();
921
- }, [i]), r.useImperativeHandle(t, function() {
922
- return {
923
- delayHidden: se
924
- };
925
- });
926
- var ge = "".concat(o, "-scrollbar"), x = {
927
- position: "absolute",
928
- visibility: K && be ? null : "hidden"
929
- }, C = {
930
- position: "absolute",
931
- background: "rgba(0, 0, 0, 0.5)",
932
- borderRadius: 99,
933
- cursor: "pointer",
934
- userSelect: "none"
935
- };
936
- return m ? (x.height = 8, x.left = 0, x.right = 0, x.bottom = 0, C.height = "100%", C.width = s, A ? C.left = Y : C.right = Y) : (x.width = 8, x.top = 0, x.bottom = 0, A ? x.right = 0 : x.left = 0, C.width = "100%", C.height = s, C.top = Y), /* @__PURE__ */ r.createElement("div", {
937
- ref: G,
938
- className: je(ge, (n = {}, ie(n, "".concat(ge, "-horizontal"), m), ie(n, "".concat(ge, "-vertical"), !m), ie(n, "".concat(ge, "-visible"), K), n)),
939
- style: oe(oe({}, x), u),
940
- onMouseDown: de,
941
- onMouseMove: se
942
- }, /* @__PURE__ */ r.createElement("div", {
943
- ref: F,
944
- className: je("".concat(ge, "-thumb"), ie({}, "".concat(ge, "-thumb-moving"), S)),
945
- style: oe(oe({}, C), g),
946
- onMouseDown: le
947
- }));
948
- });
949
- process.env.NODE_ENV !== "production" && (Yt.displayName = "ScrollBar");
950
- function vr(e) {
951
- var t = e.children, n = e.setRef, o = r.useCallback(function(a) {
952
- n(a);
953
- }, []);
954
- return /* @__PURE__ */ r.cloneElement(t, {
955
- ref: o
956
- });
957
- }
958
- function gr(e, t, n, o, a, i, l) {
959
- var c = l.getKey;
960
- return e.slice(t, n + 1).map(function(f, h) {
961
- var m = t + h, s = i(f, m, {
962
- style: {
963
- width: o
964
- }
965
- }), d = c(f);
966
- return /* @__PURE__ */ r.createElement(vr, {
967
- key: d,
968
- setRef: function(g) {
969
- return a(f, g);
970
- }
971
- }, s);
972
- });
973
- }
974
- var pr = /* @__PURE__ */ function() {
975
- function e() {
976
- po(this, e), this.maps = void 0, this.id = 0, this.maps = /* @__PURE__ */ Object.create(null);
977
- }
978
- return go(e, [{
979
- key: "set",
980
- value: function(n, o) {
981
- this.maps[n] = o, this.id += 1;
982
- }
983
- }, {
984
- key: "get",
985
- value: function(n) {
986
- return this.maps[n];
987
- }
988
- }]), e;
989
- }();
990
- function hr(e, t, n) {
991
- var o = r.useState(0), a = k(o, 2), i = a[0], l = a[1], c = ve(/* @__PURE__ */ new Map()), f = ve(new pr()), h = ve();
992
- function m() {
993
- ot.cancel(h.current);
994
- }
995
- function s() {
996
- var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
997
- m();
998
- var g = function() {
999
- c.current.forEach(function(p, S) {
1000
- if (p && p.offsetParent) {
1001
- var b = ho(p), M = b.offsetHeight;
1002
- f.current.get(S) !== M && f.current.set(S, b.offsetHeight);
1003
- }
1004
- }), l(function(p) {
1005
- return p + 1;
1006
- });
1007
- };
1008
- u ? g() : h.current = ot(g);
1009
- }
1010
- function d(u, g) {
1011
- var v = e(u), p = c.current.get(v);
1012
- g ? (c.current.set(v, g), s()) : c.current.delete(v), !p != !g && (g ? t == null || t(u) : n == null || n(u));
1013
- }
1014
- return jt(function() {
1015
- return m;
1016
- }, []), [d, s, f.current, i];
1017
- }
1018
- var Cn = 10;
1019
- function Sr(e, t, n, o, a, i, l, c) {
1020
- var f = r.useRef(), h = r.useState(null), m = k(h, 2), s = m[0], d = m[1];
1021
- return It(function() {
1022
- if (s && s.times < Cn) {
1023
- if (!e.current) {
1024
- d(function(se) {
1025
- return oe({}, se);
1026
- });
1027
- return;
1028
- }
1029
- i();
1030
- var u = s.targetAlign, g = s.originAlign, v = s.index, p = s.offset, S = e.current.clientHeight, b = !1, M = u, I = null;
1031
- if (S) {
1032
- for (var H = u || g, O = 0, $ = 0, j = 0, q = Math.min(t.length - 1, v), B = 0; B <= q; B += 1) {
1033
- var A = a(t[B]);
1034
- $ = O;
1035
- var G = n.get(A);
1036
- j = $ + (G === void 0 ? o : G), O = j;
1037
- }
1038
- for (var F = H === "top" ? p : S - p, L = q; L >= 0; L -= 1) {
1039
- var te = a(t[L]), K = n.get(te);
1040
- if (K === void 0) {
1041
- b = !0;
1042
- break;
1043
- }
1044
- if (F -= K, F <= 0)
1045
- break;
1046
- }
1047
- switch (H) {
1048
- case "top":
1049
- I = $ - p;
1050
- break;
1051
- case "bottom":
1052
- I = j - S + p;
1053
- break;
1054
- default: {
1055
- var N = e.current.scrollTop, w = N + S;
1056
- $ < N ? M = "top" : j > w && (M = "bottom");
1057
- }
1058
- }
1059
- I !== null && l(I), I !== s.lastTop && (b = !0);
1060
- }
1061
- b && d(oe(oe({}, s), {}, {
1062
- times: s.times + 1,
1063
- targetAlign: M,
1064
- lastTop: I
1065
- }));
1066
- } else
1067
- process.env.NODE_ENV !== "production" && (s == null ? void 0 : s.times) === Cn && Xe(!1, "Seems `scrollTo` with `rc-virtual-list` reach the max limitation. Please fire issue for us. Thanks.");
1068
- }, [s, e.current]), function(u) {
1069
- if (u == null) {
1070
- c();
1071
- return;
1072
- }
1073
- if (ot.cancel(f.current), typeof u == "number")
1074
- l(u);
1075
- else if (u && ft(u) === "object") {
1076
- var g, v = u.align;
1077
- "index" in u ? g = u.index : g = t.findIndex(function(b) {
1078
- return a(b) === u.key;
1079
- });
1080
- var p = u.offset, S = p === void 0 ? 0 : p;
1081
- d({
1082
- times: 0,
1083
- index: g,
1084
- offset: S,
1085
- originAlign: v
1086
- });
1087
- }
1088
- };
1089
- }
1090
- function br(e, t, n) {
1091
- var o = e.length, a = t.length, i, l;
1092
- if (o === 0 && a === 0)
1093
- return null;
1094
- o < a ? (i = e, l = t) : (i = t, l = e);
1095
- var c = {
1096
- __EMPTY_ITEM__: !0
1097
- };
1098
- function f(g) {
1099
- return g !== void 0 ? n(g) : c;
1100
- }
1101
- for (var h = null, m = Math.abs(o - a) !== 1, s = 0; s < l.length; s += 1) {
1102
- var d = f(i[s]), u = f(l[s]);
1103
- if (d !== u) {
1104
- h = s, m = m || d !== f(l[s + 1]);
1105
- break;
1106
- }
1107
- }
1108
- return h === null ? null : {
1109
- index: h,
1110
- multiple: m
1111
- };
1112
- }
1113
- function Cr(e, t, n) {
1114
- var o = r.useState(e), a = k(o, 2), i = a[0], l = a[1], c = r.useState(null), f = k(c, 2), h = f[0], m = f[1];
1115
- return r.useEffect(function() {
1116
- var s = br(i || [], e || [], t);
1117
- (s == null ? void 0 : s.index) !== void 0 && (n == null || n(s.index), m(e[s.index])), l(e);
1118
- }, [e]), [h];
1119
- }
1120
- var wn = (typeof navigator > "u" ? "undefined" : ft(navigator)) === "object" && /Firefox/i.test(navigator.userAgent);
1121
- const An = function(e, t) {
1122
- var n = ve(!1), o = ve(null);
1123
- function a() {
1124
- clearTimeout(o.current), n.current = !0, o.current = setTimeout(function() {
1125
- n.current = !1;
1126
- }, 50);
1127
- }
1128
- var i = ve({
1129
- top: e,
1130
- bottom: t
1131
- });
1132
- return i.current.top = e, i.current.bottom = t, function(l) {
1133
- var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, f = (
1134
- // Pass origin wheel when on the top
1135
- l < 0 && i.current.top || // Pass origin wheel when on the bottom
1136
- l > 0 && i.current.bottom
1137
- );
1138
- return c && f ? (clearTimeout(o.current), n.current = !1) : (!f || n.current) && a(), !n.current && f;
1139
- };
1140
- };
1141
- function wr(e, t, n, o, a) {
1142
- var i = ve(0), l = ve(null), c = ve(null), f = ve(!1), h = An(t, n);
1143
- function m(p, S) {
1144
- ot.cancel(l.current), i.current += S, c.current = S, !h(S) && (wn || p.preventDefault(), l.current = ot(function() {
1145
- var b = f.current ? 10 : 1;
1146
- a(i.current * b), i.current = 0;
1147
- }));
1148
- }
1149
- function s(p, S) {
1150
- a(S, !0), wn || p.preventDefault();
1151
- }
1152
- var d = ve(null), u = ve(null);
1153
- function g(p) {
1154
- if (e) {
1155
- ot.cancel(u.current), u.current = ot(function() {
1156
- d.current = null;
1157
- }, 2);
1158
- var S = p.deltaX, b = p.deltaY, M = p.shiftKey, I = S, H = b;
1159
- (d.current === "sx" || !d.current && M && b && !S) && (I = b, H = 0, d.current = "sx");
1160
- var O = Math.abs(I), $ = Math.abs(H);
1161
- d.current === null && (d.current = o && O > $ ? "x" : "y"), d.current === "y" ? m(p, H) : s(p, I);
1162
- }
1163
- }
1164
- function v(p) {
1165
- e && (f.current = p.detail === c.current);
1166
- }
1167
- return [g, v];
1168
- }
1169
- var yr = 14 / 15;
1170
- function Er(e, t, n) {
1171
- var o = ve(!1), a = ve(0), i = ve(null), l = ve(null), c, f = function(d) {
1172
- if (o.current) {
1173
- var u = Math.ceil(d.touches[0].pageY), g = a.current - u;
1174
- a.current = u, n(g) && d.preventDefault(), clearInterval(l.current), l.current = setInterval(function() {
1175
- g *= yr, (!n(g, !0) || Math.abs(g) <= 0.1) && clearInterval(l.current);
1176
- }, 16);
1177
- }
1178
- }, h = function() {
1179
- o.current = !1, c();
1180
- }, m = function(d) {
1181
- c(), d.touches.length === 1 && !o.current && (o.current = !0, a.current = Math.ceil(d.touches[0].pageY), i.current = d.target, i.current.addEventListener("touchmove", f), i.current.addEventListener("touchend", h));
1182
- };
1183
- c = function() {
1184
- i.current && (i.current.removeEventListener("touchmove", f), i.current.removeEventListener("touchend", h));
1185
- }, It(function() {
1186
- return e && t.current.addEventListener("touchstart", m), function() {
1187
- var s;
1188
- (s = t.current) === null || s === void 0 || s.removeEventListener("touchstart", m), c(), clearInterval(l.current);
1189
- };
1190
- }, [e]);
1191
- }
1192
- var Ir = 20;
1193
- function yn() {
1194
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = e / t * 100;
1195
- return isNaN(n) && (n = 0), n = Math.max(n, Ir), n = Math.min(n, e / 2), Math.floor(n);
1196
- }
1197
- function xr(e, t, n, o) {
1198
- var a = r.useMemo(function() {
1199
- return [/* @__PURE__ */ new Map(), []];
1200
- }, [e, n.id, o]), i = k(a, 2), l = i[0], c = i[1], f = function(m) {
1201
- var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : m, d = l.get(m), u = l.get(s);
1202
- if (d === void 0 || u === void 0)
1203
- for (var g = e.length, v = c.length; v < g; v += 1) {
1204
- var p, S = e[v], b = t(S);
1205
- l.set(b, v);
1206
- var M = (p = n.get(b)) !== null && p !== void 0 ? p : o;
1207
- if (c[v] = (c[v - 1] || 0) + M, b === m && (d = v), b === s && (u = v), d !== void 0 && u !== void 0)
1208
- break;
1209
- }
1210
- return {
1211
- top: c[d - 1] || 0,
1212
- bottom: c[u]
1213
- };
1214
- };
1215
- return f;
1216
- }
1217
- var Or = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "direction", "scrollWidth", "component", "onScroll", "onVirtualScroll", "onVisibleChange", "innerProps", "extraRender", "styles"], Rr = [], $r = {
1218
- overflowY: "auto",
1219
- overflowAnchor: "none"
1220
- };
1221
- function Mr(e, t) {
1222
- var n = e.prefixCls, o = n === void 0 ? "rc-virtual-list" : n, a = e.className, i = e.height, l = e.itemHeight, c = e.fullHeight, f = c === void 0 ? !0 : c, h = e.style, m = e.data, s = e.children, d = e.itemKey, u = e.virtual, g = e.direction, v = e.scrollWidth, p = e.component, S = p === void 0 ? "div" : p, b = e.onScroll, M = e.onVirtualScroll, I = e.onVisibleChange, H = e.innerProps, O = e.extraRender, $ = e.styles, j = ht(e, Or), q = !!(u !== !1 && i && l), B = q && m && (l * m.length > i || !!v), A = g === "rtl", G = je(o, ie({}, "".concat(o, "-rtl"), A), a), F = m || Rr, L = ve(), te = ve(), K = Mt(0), N = k(K, 2), w = N[0], se = N[1], ne = Mt(0), xe = k(ne, 2), be = xe[0], Y = xe[1], de = Mt(!1), pe = k(de, 2), le = pe[0], Ne = pe[1], Me = function() {
1223
- Ne(!0);
1224
- }, ge = function() {
1225
- Ne(!1);
1226
- }, x = r.useCallback(function(P) {
1227
- return typeof d == "function" ? d(P) : P == null ? void 0 : P[d];
1228
- }, [d]), C = {
1229
- getKey: x
1230
- };
1231
- function y(P) {
1232
- se(function(z) {
1233
- var Q;
1234
- typeof P == "function" ? Q = P(z) : Q = P;
1235
- var me = Ot(Q);
1236
- return L.current.scrollTop = me, me;
1237
- });
1238
- }
1239
- var D = ve({
1240
- start: 0,
1241
- end: F.length
1242
- }), R = ve(), V = Cr(F, x), ee = k(V, 1), Z = ee[0];
1243
- R.current = Z;
1244
- var he = hr(x, null, null), ue = k(he, 4), $e = ue[0], Oe = ue[1], De = ue[2], re = ue[3], _e = r.useMemo(function() {
1245
- if (!q)
1246
- return {
1247
- scrollHeight: void 0,
1248
- start: 0,
1249
- end: F.length - 1,
1250
- offset: void 0
1251
- };
1252
- if (!B) {
1253
- var P;
1254
- return {
1255
- scrollHeight: ((P = te.current) === null || P === void 0 ? void 0 : P.offsetHeight) || 0,
1256
- start: 0,
1257
- end: F.length - 1,
1258
- offset: void 0
1259
- };
1260
- }
1261
- for (var z = 0, Q, me, Qe, Ht = F.length, pt = 0; pt < Ht; pt += 1) {
1262
- var ut = F[pt], Lt = x(ut), Dt = De.get(Lt), Rt = z + (Dt === void 0 ? l : Dt);
1263
- Rt >= w && Q === void 0 && (Q = pt, me = z), Rt > w + i && Qe === void 0 && (Qe = pt), z = Rt;
1264
- }
1265
- return Q === void 0 && (Q = 0, me = 0, Qe = Math.ceil(i / l)), Qe === void 0 && (Qe = F.length - 1), Qe = Math.min(Qe + 1, F.length - 1), {
1266
- scrollHeight: z,
1267
- start: Q,
1268
- end: Qe,
1269
- offset: me
1270
- };
1271
- }, [B, q, w, F, re, i]), Te = _e.scrollHeight, Ce = _e.start, Se = _e.end, ze = _e.offset;
1272
- D.current.start = Ce, D.current.end = Se;
1273
- var we = r.useState({
1274
- width: 0,
1275
- height: i
1276
- }), He = k(we, 2), Ee = He[0], ke = He[1], Pe = function(z) {
1277
- ke({
1278
- width: z.width || z.offsetWidth,
1279
- height: z.height || z.offsetHeight
1280
- });
1281
- }, Ge = ve(), Ye = ve(), mt = r.useMemo(function() {
1282
- return yn(Ee.width, v);
1283
- }, [Ee.width, v]), fe = r.useMemo(function() {
1284
- return yn(Ee.height, Te);
1285
- }, [Ee.height, Te]), qe = Te - i, Le = ve(qe);
1286
- Le.current = qe;
1287
- function Ot(P) {
1288
- var z = P;
1289
- return Number.isNaN(Le.current) || (z = Math.min(z, Le.current)), z = Math.max(z, 0), z;
1290
- }
1291
- var bt = w <= 0, at = w >= qe, Ct = An(bt, at), et = function() {
1292
- return {
1293
- x: A ? -be : be,
1294
- y: w
1295
- };
1296
- }, it = ve(et()), lt = mn(function() {
1297
- if (M) {
1298
- var P = et();
1299
- (it.current.x !== P.x || it.current.y !== P.y) && (M(P), it.current = P);
1300
- }
1301
- });
1302
- function vt(P, z) {
1303
- var Q = P;
1304
- z ? (fn.flushSync(function() {
1305
- Y(Q);
1306
- }), lt()) : y(Q);
1307
- }
1308
- function gt(P) {
1309
- var z = P.currentTarget.scrollTop;
1310
- z !== w && y(z), b == null || b(P), lt();
1311
- }
1312
- var ye = function(z) {
1313
- var Q = z, me = v - Ee.width;
1314
- return Q = Math.max(Q, 0), Q = Math.min(Q, me), Q;
1315
- }, _ = mn(function(P, z) {
1316
- z ? (fn.flushSync(function() {
1317
- Y(function(Q) {
1318
- var me = Q + (A ? -P : P);
1319
- return ye(me);
1320
- });
1321
- }), lt()) : y(function(Q) {
1322
- var me = Q + P;
1323
- return me;
1324
- });
1325
- }), T = wr(q, bt, at, !!v, _), E = k(T, 2), W = E[0], ae = E[1];
1326
- Er(q, L, function(P, z) {
1327
- return Ct(P, z) ? !1 : (W({
1328
- preventDefault: function() {
1329
- },
1330
- deltaY: P
1331
- }), !0);
1332
- }), It(function() {
1333
- function P(Q) {
1334
- q && Q.preventDefault();
1335
- }
1336
- var z = L.current;
1337
- return z.addEventListener("wheel", W), z.addEventListener("DOMMouseScroll", ae), z.addEventListener("MozMousePixelScroll", P), function() {
1338
- z.removeEventListener("wheel", W), z.removeEventListener("DOMMouseScroll", ae), z.removeEventListener("MozMousePixelScroll", P);
1339
- };
1340
- }, [q]), It(function() {
1341
- v && Y(function(P) {
1342
- return ye(P);
1343
- });
1344
- }, [Ee.width, v]);
1345
- var ce = function() {
1346
- var z, Q;
1347
- (z = Ge.current) === null || z === void 0 || z.delayHidden(), (Q = Ye.current) === null || Q === void 0 || Q.delayHidden();
1348
- }, Fe = Sr(L, F, De, l, x, function() {
1349
- return Oe(!0);
1350
- }, y, ce);
1351
- r.useImperativeHandle(t, function() {
1352
- return {
1353
- getScrollInfo: et,
1354
- scrollTo: function(z) {
1355
- function Q(me) {
1356
- return me && ft(me) === "object" && ("left" in me || "top" in me);
1357
- }
1358
- Q(z) ? (z.left !== void 0 && Y(ye(z.left)), Fe(z.top)) : Fe(z);
1359
- }
1360
- };
1361
- }), It(function() {
1362
- if (I) {
1363
- var P = F.slice(Ce, Se + 1);
1364
- I(P, F);
1365
- }
1366
- }, [Ce, Se, F]);
1367
- var Ke = xr(F, x, De, l), rt = O == null ? void 0 : O({
1368
- start: Ce,
1369
- end: Se,
1370
- virtual: B,
1371
- offsetX: be,
1372
- offsetY: ze,
1373
- rtl: A,
1374
- getSize: Ke
1375
- }), Ie = gr(F, Ce, Se, v, $e, s, C), Be = null;
1376
- i && (Be = oe(ie({}, f ? "height" : "maxHeight", i), $r), q && (Be.overflowY = "hidden", v && (Be.overflowX = "hidden"), le && (Be.pointerEvents = "none")));
1377
- var tt = {};
1378
- return A && (tt.dir = "rtl"), /* @__PURE__ */ r.createElement("div", Je({
1379
- style: oe(oe({}, h), {}, {
1380
- position: "relative"
1381
- }),
1382
- className: G
1383
- }, tt, j), /* @__PURE__ */ r.createElement(Pn, {
1384
- onResize: Pe
1385
- }, /* @__PURE__ */ r.createElement(S, {
1386
- className: "".concat(o, "-holder"),
1387
- style: Be,
1388
- ref: L,
1389
- onScroll: gt,
1390
- onMouseEnter: ce
1391
- }, /* @__PURE__ */ r.createElement(Bn, {
1392
- prefixCls: o,
1393
- height: Te,
1394
- offsetX: be,
1395
- offsetY: ze,
1396
- scrollWidth: v,
1397
- onInnerResize: Oe,
1398
- ref: te,
1399
- innerProps: H,
1400
- rtl: A,
1401
- extra: rt
1402
- }, Ie))), B && Te > i && /* @__PURE__ */ r.createElement(Yt, {
1403
- ref: Ge,
1404
- prefixCls: o,
1405
- scrollOffset: w,
1406
- scrollRange: Te,
1407
- rtl: A,
1408
- onScroll: vt,
1409
- onStartMove: Me,
1410
- onStopMove: ge,
1411
- spinSize: fe,
1412
- containerSize: Ee.height,
1413
- style: $ == null ? void 0 : $.verticalScrollBar,
1414
- thumbStyle: $ == null ? void 0 : $.verticalScrollBarThumb
1415
- }), B && v && /* @__PURE__ */ r.createElement(Yt, {
1416
- ref: Ye,
1417
- prefixCls: o,
1418
- scrollOffset: be,
1419
- scrollRange: v,
1420
- rtl: A,
1421
- onScroll: vt,
1422
- onStartMove: Me,
1423
- onStopMove: ge,
1424
- spinSize: mt,
1425
- containerSize: Ee.width,
1426
- horizontal: !0,
1427
- style: $ == null ? void 0 : $.horizontalScrollBar,
1428
- thumbStyle: $ == null ? void 0 : $.horizontalScrollBarThumb
1429
- }));
1430
- }
1431
- var Wn = /* @__PURE__ */ r.forwardRef(Mr);
1432
- Wn.displayName = "List";
1433
- function Dr() {
1434
- return /(mac\sos|macintosh)/i.test(navigator.appVersion);
1435
- }
1436
- var Nr = ["disabled", "title", "children", "style", "className"];
1437
- function En(e) {
1438
- return typeof e == "string" || typeof e == "number";
1439
- }
1440
- var Pr = function(t, n) {
1441
- var o = Go(), a = o.prefixCls, i = o.id, l = o.open, c = o.multiple, f = o.mode, h = o.searchValue, m = o.toggleOpen, s = o.notFoundContent, d = o.onPopupScroll, u = r.useContext(en), g = u.maxCount, v = u.flattenOptions, p = u.onActiveValue, S = u.defaultActiveFirstOption, b = u.onSelect, M = u.menuItemSelectedIcon, I = u.rawValues, H = u.fieldNames, O = u.virtual, $ = u.direction, j = u.listHeight, q = u.listItemHeight, B = u.optionRender, A = "".concat(a, "-item"), G = So(function() {
1442
- return v;
1443
- }, [l, v], function(x, C) {
1444
- return C[0] && x[1] !== C[1];
1445
- }), F = r.useRef(null), L = r.useMemo(function() {
1446
- return c && typeof g < "u" && (I == null ? void 0 : I.size) >= g;
1447
- }, [c, g, I == null ? void 0 : I.size]), te = function(C) {
1448
- C.preventDefault();
1449
- }, K = function(C) {
1450
- var y;
1451
- (y = F.current) === null || y === void 0 || y.scrollTo(typeof C == "number" ? {
1452
- index: C
1453
- } : C);
1454
- }, N = function(C) {
1455
- for (var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, D = G.length, R = 0; R < D; R += 1) {
1456
- var V = (C + R * y + D) % D, ee = G[V] || {}, Z = ee.group, he = ee.data;
1457
- if (!Z && !(he != null && he.disabled) && !L)
1458
- return V;
1459
- }
1460
- return -1;
1461
- }, w = r.useState(function() {
1462
- return N(0);
1463
- }), se = k(w, 2), ne = se[0], xe = se[1], be = function(C) {
1464
- var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
1465
- xe(C);
1466
- var D = {
1467
- source: y ? "keyboard" : "mouse"
1468
- }, R = G[C];
1469
- if (!R) {
1470
- p(null, -1, D);
1471
- return;
1472
- }
1473
- p(R.value, C, D);
1474
- };
1475
- jt(function() {
1476
- be(S !== !1 ? N(0) : -1);
1477
- }, [G.length, h]);
1478
- var Y = r.useCallback(function(x) {
1479
- return I.has(x) && f !== "combobox";
1480
- }, [f, Ze(I).toString(), I.size]);
1481
- jt(function() {
1482
- var x = setTimeout(function() {
1483
- if (!c && l && I.size === 1) {
1484
- var y = Array.from(I)[0], D = G.findIndex(function(R) {
1485
- var V = R.data;
1486
- return V.value === y;
1487
- });
1488
- D !== -1 && (be(D), K(D));
1489
- }
1490
- });
1491
- if (l) {
1492
- var C;
1493
- (C = F.current) === null || C === void 0 || C.scrollTo(void 0);
1494
- }
1495
- return function() {
1496
- return clearTimeout(x);
1497
- };
1498
- }, [l, h]);
1499
- var de = function(C) {
1500
- C !== void 0 && b(C, {
1501
- selected: !I.has(C)
1502
- }), c || m(!1);
1503
- };
1504
- if (r.useImperativeHandle(n, function() {
1505
- return {
1506
- onKeyDown: function(C) {
1507
- var y = C.which, D = C.ctrlKey;
1508
- switch (y) {
1509
- case X.N:
1510
- case X.P:
1511
- case X.UP:
1512
- case X.DOWN: {
1513
- var R = 0;
1514
- if (y === X.UP ? R = -1 : y === X.DOWN ? R = 1 : Dr() && D && (y === X.N ? R = 1 : y === X.P && (R = -1)), R !== 0) {
1515
- var V = N(ne + R, R);
1516
- K(V), be(V, !0);
1517
- }
1518
- break;
1519
- }
1520
- case X.ENTER: {
1521
- var ee, Z = G[ne];
1522
- Z && !(Z != null && (ee = Z.data) !== null && ee !== void 0 && ee.disabled) && !L ? de(Z.value) : de(void 0), l && C.preventDefault();
1523
- break;
1524
- }
1525
- case X.ESC:
1526
- m(!1), l && C.stopPropagation();
1527
- }
1528
- },
1529
- onKeyUp: function() {
1530
- },
1531
- scrollTo: function(C) {
1532
- K(C);
1533
- }
1534
- };
1535
- }), G.length === 0)
1536
- return /* @__PURE__ */ r.createElement("div", {
1537
- role: "listbox",
1538
- id: "".concat(i, "_list"),
1539
- className: "".concat(A, "-empty"),
1540
- onMouseDown: te
1541
- }, s);
1542
- var pe = Object.keys(H).map(function(x) {
1543
- return H[x];
1544
- }), le = function(C) {
1545
- return C.label;
1546
- };
1547
- function Ne(x, C) {
1548
- var y = x.group;
1549
- return {
1550
- role: y ? "presentation" : "option",
1551
- id: "".concat(i, "_list_").concat(C)
1552
- };
1553
- }
1554
- var Me = function(C) {
1555
- var y = G[C];
1556
- if (!y)
1557
- return null;
1558
- var D = y.data || {}, R = D.value, V = y.group, ee = _t(D, !0), Z = le(y);
1559
- return y ? /* @__PURE__ */ r.createElement("div", Je({
1560
- "aria-label": typeof Z == "string" && !V ? Z : null
1561
- }, ee, {
1562
- key: C
1563
- }, Ne(y, C), {
1564
- "aria-selected": Y(R)
1565
- }), R) : null;
1566
- }, ge = {
1567
- role: "listbox",
1568
- id: "".concat(i, "_list")
1569
- };
1570
- return /* @__PURE__ */ r.createElement(r.Fragment, null, O && /* @__PURE__ */ r.createElement("div", Je({}, ge, {
1571
- style: {
1572
- height: 0,
1573
- width: 0,
1574
- overflow: "hidden"
1575
- }
1576
- }), Me(ne - 1), Me(ne), Me(ne + 1)), /* @__PURE__ */ r.createElement(Wn, {
1577
- itemKey: "key",
1578
- ref: F,
1579
- data: G,
1580
- height: j,
1581
- itemHeight: q,
1582
- fullHeight: !1,
1583
- onMouseDown: te,
1584
- onScroll: d,
1585
- virtual: O,
1586
- direction: $,
1587
- innerProps: O ? null : ge
1588
- }, function(x, C) {
1589
- var y, D = x.group, R = x.groupOption, V = x.data, ee = x.label, Z = x.value, he = V.key;
1590
- if (D) {
1591
- var ue, $e = (ue = V.title) !== null && ue !== void 0 ? ue : En(ee) ? ee.toString() : void 0;
1592
- return /* @__PURE__ */ r.createElement("div", {
1593
- className: je(A, "".concat(A, "-group")),
1594
- title: $e
1595
- }, ee !== void 0 ? ee : he);
1596
- }
1597
- var Oe = V.disabled, De = V.title;
1598
- V.children;
1599
- var re = V.style, _e = V.className, Te = ht(V, Nr), Ce = Nn(Te, pe), Se = Y(Z), ze = Oe || !Se && L, we = "".concat(A, "-option"), He = je(A, we, _e, (y = {}, ie(y, "".concat(we, "-grouped"), R), ie(y, "".concat(we, "-active"), ne === C && !ze), ie(y, "".concat(we, "-disabled"), ze), ie(y, "".concat(we, "-selected"), Se), y)), Ee = le(x), ke = !M || typeof M == "function" || Se, Pe = typeof Ee == "number" ? Ee : Ee || Z, Ge = En(Pe) ? Pe.toString() : void 0;
1600
- return De !== void 0 && (Ge = De), /* @__PURE__ */ r.createElement("div", Je({}, _t(Ce), O ? {} : Ne(x, C), {
1601
- "aria-selected": Se,
1602
- className: He,
1603
- title: Ge,
1604
- onMouseMove: function() {
1605
- ne === C || ze || be(C);
1606
- },
1607
- onClick: function() {
1608
- ze || de(Z);
1609
- },
1610
- style: re
1611
- }), /* @__PURE__ */ r.createElement("div", {
1612
- className: "".concat(we, "-content")
1613
- }, typeof B == "function" ? B(x, {
1614
- index: C
1615
- }) : Pe), /* @__PURE__ */ r.isValidElement(M) || Se, ke && /* @__PURE__ */ r.createElement(zt, {
1616
- className: "".concat(A, "-option-state"),
1617
- customizeIcon: M,
1618
- customizeIconProps: {
1619
- value: Z,
1620
- disabled: ze,
1621
- isSelected: Se
1622
- }
1623
- }, Se ? "✓" : null));
1624
- }));
1625
- }, jn = /* @__PURE__ */ r.forwardRef(Pr);
1626
- process.env.NODE_ENV !== "production" && (jn.displayName = "OptionList");
1627
- const _r = function(e, t) {
1628
- var n = r.useRef({
1629
- values: /* @__PURE__ */ new Map(),
1630
- options: /* @__PURE__ */ new Map()
1631
- }), o = r.useMemo(function() {
1632
- var i = n.current, l = i.values, c = i.options, f = e.map(function(s) {
1633
- if (s.label === void 0) {
1634
- var d;
1635
- return oe(oe({}, s), {}, {
1636
- label: (d = l.get(s.value)) === null || d === void 0 ? void 0 : d.label
1637
- });
1638
- }
1639
- return s;
1640
- }), h = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
1641
- return f.forEach(function(s) {
1642
- h.set(s.value, s), m.set(s.value, t.get(s.value) || c.get(s.value));
1643
- }), n.current.values = h, n.current.options = m, f;
1644
- }, [e, t]), a = r.useCallback(function(i) {
1645
- return t.get(i) || n.current.options.get(i);
1646
- }, [t]);
1647
- return [o, a];
1648
- };
1649
- function Bt(e, t) {
1650
- return kt(e).join("").toUpperCase().includes(t);
1651
- }
1652
- const Tr = function(e, t, n, o, a) {
1653
- return r.useMemo(function() {
1654
- if (!n || o === !1)
1655
- return e;
1656
- var i = t.options, l = t.label, c = t.value, f = [], h = typeof o == "function", m = n.toUpperCase(), s = h ? o : function(u, g) {
1657
- return a ? Bt(g[a], m) : g[i] ? Bt(g[l !== "children" ? l : "label"], m) : Bt(g[c], m);
1658
- }, d = h ? function(u) {
1659
- return Gt(u);
1660
- } : function(u) {
1661
- return u;
1662
- };
1663
- return e.forEach(function(u) {
1664
- if (u[i]) {
1665
- var g = s(n, d(u));
1666
- if (g)
1667
- f.push(u);
1668
- else {
1669
- var v = u[i].filter(function(p) {
1670
- return s(n, d(p));
1671
- });
1672
- v.length && f.push(oe(oe({}, u), {}, ie({}, i, v)));
1673
- }
1674
- return;
1675
- }
1676
- s(n, d(u)) && f.push(u);
1677
- }), f;
1678
- }, [e, o, a, n, t]);
1679
- };
1680
- var In = 0, zr = process.env.NODE_ENV !== "test" && bo();
1681
- function Vr() {
1682
- var e;
1683
- return zr ? (e = In, In += 1) : e = "TEST_OR_SSR", e;
1684
- }
1685
- function Hr(e) {
1686
- var t = r.useState(), n = k(t, 2), o = n[0], a = n[1];
1687
- return r.useEffect(function() {
1688
- a("rc_select_".concat(Vr()));
1689
- }, []), e || o;
1690
- }
1691
- var Lr = ["children", "value"], Fr = ["children"];
1692
- function Br(e) {
1693
- var t = e, n = t.key, o = t.props, a = o.children, i = o.value, l = ht(o, Lr);
1694
- return oe({
1695
- key: n,
1696
- value: i !== void 0 ? i : n,
1697
- children: a
1698
- }, l);
1699
- }
1700
- function on(e) {
1701
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
1702
- return Xt(e).map(function(n, o) {
1703
- if (!/* @__PURE__ */ r.isValidElement(n) || !n.type)
1704
- return null;
1705
- var a = n, i = a.type.isSelectOptGroup, l = a.key, c = a.props, f = c.children, h = ht(c, Fr);
1706
- return t || !i ? Br(n) : oe(oe({
1707
- key: "__RC_SELECT_GRP__".concat(l === null ? o : l, "__"),
1708
- label: l
1709
- }, h), {}, {
1710
- options: on(f)
1711
- });
1712
- }).filter(function(n) {
1713
- return n;
1714
- });
1715
- }
1716
- var Ar = function(t, n, o, a, i) {
1717
- return r.useMemo(function() {
1718
- var l = t, c = !t;
1719
- c && (l = on(n));
1720
- var f = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), m = function(u, g, v) {
1721
- v && typeof v == "string" && u.set(g[v], g);
1722
- }, s = function d(u) {
1723
- for (var g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, v = 0; v < u.length; v += 1) {
1724
- var p = u[v];
1725
- !p[o.options] || g ? (f.set(p[o.value], p), m(h, p, o.label), m(h, p, a), m(h, p, i)) : d(p[o.options], !0);
1726
- }
1727
- };
1728
- return s(l), {
1729
- options: l,
1730
- valueOptions: f,
1731
- labelOptions: h
1732
- };
1733
- }, [t, n, o, a, i]);
1734
- };
1735
- function xn(e) {
1736
- var t = r.useRef();
1737
- t.current = e;
1738
- var n = r.useCallback(function() {
1739
- return t.current.apply(t, arguments);
1740
- }, []);
1741
- return n;
1742
- }
1743
- function Wr(e) {
1744
- var t = e.mode, n = e.options, o = e.children, a = e.backfill, i = e.allowClear, l = e.placeholder, c = e.getInputElement, f = e.showSearch, h = e.onSearch, m = e.defaultOpen, s = e.autoFocus, d = e.labelInValue, u = e.value, g = e.inputValue, v = e.optionLabelProp, p = Tt(t), S = f !== void 0 ? f : p || t === "combobox", b = n || on(o);
1745
- if (Xe(t !== "tags" || b.every(function(O) {
1746
- return !O.disabled;
1747
- }), "Please avoid setting option to disabled in tags mode since user can always type text as tag."), t === "tags" || t === "combobox") {
1748
- var M = b.some(function(O) {
1749
- return O.options ? O.options.some(function($) {
1750
- return typeof ("value" in $ ? $.value : $.key) == "number";
1751
- }) : typeof ("value" in O ? O.value : O.key) == "number";
1752
- });
1753
- Xe(!M, "`value` of Option should not use number type when `mode` is `tags` or `combobox`.");
1754
- }
1755
- if (Xe(t !== "combobox" || !v, "`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."), Xe(t === "combobox" || !a, "`backfill` only works with `combobox` mode."), Xe(t === "combobox" || !c, "`getInputElement` only work with `combobox` mode."), dn(t !== "combobox" || !c || !i || !l, "Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."), h && !S && t !== "combobox" && t !== "tags" && Xe(!1, "`onSearch` should work with `showSearch` instead of use alone."), dn(!m || s, "`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."), u != null) {
1756
- var I = kt(u);
1757
- Xe(!d || I.every(function(O) {
1758
- return ft(O) === "object" && ("key" in O || "value" in O);
1759
- }), "`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"), Xe(!p || Array.isArray(u), "`value` should be array when `mode` is `multiple` or `tags`");
1760
- }
1761
- if (o) {
1762
- var H = null;
1763
- Xt(o).some(function(O) {
1764
- if (!/* @__PURE__ */ r.isValidElement(O) || !O.type)
1765
- return !1;
1766
- var $ = O, j = $.type;
1767
- if (j.isSelectOption)
1768
- return !1;
1769
- if (j.isSelectOptGroup) {
1770
- var q = Xt(O.props.children).every(function(B) {
1771
- return !/* @__PURE__ */ r.isValidElement(B) || !O.type || B.type.isSelectOption ? !0 : (H = B.type, !1);
1772
- });
1773
- return !q;
1774
- }
1775
- return H = j, !0;
1776
- }), H && Xe(!1, "`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(H.displayName || H.name || H, "`.")), Xe(g === void 0, "`inputValue` is deprecated, please use `searchValue` instead.");
1777
- }
1778
- }
1779
- function jr(e, t) {
1780
- if (e) {
1781
- var n = function o(a) {
1782
- for (var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, l = 0; l < a.length; l++) {
1783
- var c = a[l];
1784
- if (c[t == null ? void 0 : t.value] === null)
1785
- return Xe(!1, "`value` in Select options should not be `null`."), !0;
1786
- if (!i && Array.isArray(c[t == null ? void 0 : t.options]) && o(c[t == null ? void 0 : t.options], !0))
1787
- break;
1788
- }
1789
- };
1790
- n(e);
1791
- }
1792
- }
1793
- var Kr = ["id", "mode", "prefixCls", "backfill", "fieldNames", "inputValue", "searchValue", "onSearch", "autoClearSearchValue", "onSelect", "onDeselect", "dropdownMatchSelectWidth", "filterOption", "filterSort", "optionFilterProp", "optionLabelProp", "options", "optionRender", "children", "defaultActiveFirstOption", "menuItemSelectedIcon", "virtual", "direction", "listHeight", "listItemHeight", "value", "defaultValue", "labelInValue", "onChange", "maxCount"], Ur = ["inputValue"];
1794
- function Xr(e) {
1795
- return !e || ft(e) !== "object";
1796
- }
1797
- var Kn = /* @__PURE__ */ r.forwardRef(function(e, t) {
1798
- var n = e.id, o = e.mode, a = e.prefixCls, i = a === void 0 ? "rc-select" : a, l = e.backfill, c = e.fieldNames, f = e.inputValue, h = e.searchValue, m = e.onSearch, s = e.autoClearSearchValue, d = s === void 0 ? !0 : s, u = e.onSelect, g = e.onDeselect, v = e.dropdownMatchSelectWidth, p = v === void 0 ? !0 : v, S = e.filterOption, b = e.filterSort, M = e.optionFilterProp, I = e.optionLabelProp, H = e.options, O = e.optionRender, $ = e.children, j = e.defaultActiveFirstOption, q = e.menuItemSelectedIcon, B = e.virtual, A = e.direction, G = e.listHeight, F = G === void 0 ? 200 : G, L = e.listItemHeight, te = L === void 0 ? 20 : L, K = e.value, N = e.defaultValue, w = e.labelInValue, se = e.onChange, ne = e.maxCount, xe = ht(e, Kr), be = Hr(n), Y = Tt(o), de = !!(!H && $), pe = r.useMemo(function() {
1799
- return S === void 0 && o === "combobox" ? !1 : S;
1800
- }, [S, o]), le = r.useMemo(
1801
- function() {
1802
- return Ln(c, de);
1803
- },
1804
- /* eslint-disable react-hooks/exhaustive-deps */
1805
- [
1806
- // We stringify fieldNames to avoid unnecessary re-renders.
1807
- JSON.stringify(c),
1808
- de
1809
- ]
1810
- /* eslint-enable react-hooks/exhaustive-deps */
1811
- ), Ne = Ut("", {
1812
- value: h !== void 0 ? h : f,
1813
- postState: function(T) {
1814
- return T || "";
1815
- }
1816
- }), Me = k(Ne, 2), ge = Me[0], x = Me[1], C = Ar(H, $, le, M, I), y = C.valueOptions, D = C.labelOptions, R = C.options, V = r.useCallback(function(_) {
1817
- var T = kt(_);
1818
- return T.map(function(E) {
1819
- var W, ae, ce, Fe, Ke;
1820
- if (Xr(E))
1821
- W = E;
1822
- else {
1823
- var rt;
1824
- ce = E.key, ae = E.label, W = (rt = E.value) !== null && rt !== void 0 ? rt : ce;
1825
- }
1826
- var Ie = y.get(W);
1827
- if (Ie) {
1828
- var Be;
1829
- if (ae === void 0 && (ae = Ie == null ? void 0 : Ie[I || le.label]), ce === void 0 && (ce = (Be = Ie == null ? void 0 : Ie.key) !== null && Be !== void 0 ? Be : W), Fe = Ie == null ? void 0 : Ie.disabled, Ke = Ie == null ? void 0 : Ie.title, process.env.NODE_ENV !== "production" && !I) {
1830
- var tt = Ie == null ? void 0 : Ie[le.label];
1831
- tt !== void 0 && !/* @__PURE__ */ r.isValidElement(tt) && !/* @__PURE__ */ r.isValidElement(ae) && tt !== ae && Xe(!1, "`label` of `value` is not same as `label` in Select options.");
1832
- }
1833
- }
1834
- return {
1835
- label: ae,
1836
- value: W,
1837
- key: ce,
1838
- disabled: Fe,
1839
- title: Ke
1840
- };
1841
- });
1842
- }, [le, I, y]), ee = Ut(N, {
1843
- value: K
1844
- }), Z = k(ee, 2), he = Z[0], ue = Z[1], $e = r.useMemo(function() {
1845
- var _, T = Y && he === null ? [] : he, E = V(T);
1846
- return o === "combobox" && er((_ = E[0]) === null || _ === void 0 ? void 0 : _.value) ? [] : E;
1847
- }, [he, V, o, Y]), Oe = _r($e, y), De = k(Oe, 2), re = De[0], _e = De[1], Te = r.useMemo(function() {
1848
- if (!o && re.length === 1) {
1849
- var _ = re[0];
1850
- if (_.value === null && (_.label === null || _.label === void 0))
1851
- return [];
1852
- }
1853
- return re.map(function(T) {
1854
- var E;
1855
- return oe(oe({}, T), {}, {
1856
- label: (E = T.label) !== null && E !== void 0 ? E : T.value
1857
- });
1858
- });
1859
- }, [o, re]), Ce = r.useMemo(function() {
1860
- return new Set(re.map(function(_) {
1861
- return _.value;
1862
- }));
1863
- }, [re]);
1864
- r.useEffect(function() {
1865
- if (o === "combobox") {
1866
- var _, T = (_ = re[0]) === null || _ === void 0 ? void 0 : _.value;
1867
- x(ko(T) ? String(T) : "");
1868
- }
1869
- }, [re]);
1870
- var Se = xn(function(_, T) {
1871
- var E, W = T ?? _;
1872
- return E = {}, ie(E, le.value, _), ie(E, le.label, W), E;
1873
- }), ze = r.useMemo(function() {
1874
- if (o !== "tags")
1875
- return R;
1876
- var _ = Ze(R), T = function(W) {
1877
- return y.has(W);
1878
- };
1879
- return Ze(re).sort(function(E, W) {
1880
- return E.value < W.value ? -1 : 1;
1881
- }).forEach(function(E) {
1882
- var W = E.value;
1883
- T(W) || _.push(Se(W, E.label));
1884
- }), _;
1885
- }, [Se, R, y, re, o]), we = Tr(ze, le, ge, pe, M), He = r.useMemo(function() {
1886
- return o !== "tags" || !ge || we.some(function(_) {
1887
- return _[M || "value"] === ge;
1888
- }) || we.some(function(_) {
1889
- return _[le.value] === ge;
1890
- }) ? we : [Se(ge)].concat(Ze(we));
1891
- }, [Se, M, o, we, ge, le]), Ee = r.useMemo(function() {
1892
- return b ? Ze(He).sort(function(_, T) {
1893
- return b(_, T);
1894
- }) : He;
1895
- }, [He, b]), ke = r.useMemo(function() {
1896
- return sr(Ee, {
1897
- fieldNames: le,
1898
- childrenAsData: de
1899
- });
1900
- }, [Ee, le, de]), Pe = function(T) {
1901
- var E = V(T);
1902
- if (ue(E), se && // Trigger event only when value changed
1903
- (E.length !== re.length || E.some(function(ce, Fe) {
1904
- var Ke;
1905
- return ((Ke = re[Fe]) === null || Ke === void 0 ? void 0 : Ke.value) !== (ce == null ? void 0 : ce.value);
1906
- }))) {
1907
- var W = w ? E : E.map(function(ce) {
1908
- return ce.value;
1909
- }), ae = E.map(function(ce) {
1910
- return Gt(_e(ce.value));
1911
- });
1912
- se(
1913
- // Value
1914
- Y ? W : W[0],
1915
- // Option
1916
- Y ? ae : ae[0]
1917
- );
1918
- }
1919
- }, Ge = r.useState(null), Ye = k(Ge, 2), mt = Ye[0], fe = Ye[1], qe = r.useState(0), Le = k(qe, 2), Ot = Le[0], bt = Le[1], at = j !== void 0 ? j : o !== "combobox", Ct = r.useCallback(function(_, T) {
1920
- var E = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, W = E.source, ae = W === void 0 ? "keyboard" : W;
1921
- bt(T), l && o === "combobox" && _ !== null && ae === "keyboard" && fe(String(_));
1922
- }, [l, o]), et = function(T, E, W) {
1923
- var ae = function() {
1924
- var Q, me = _e(T);
1925
- return [w ? {
1926
- label: me == null ? void 0 : me[le.label],
1927
- value: T,
1928
- key: (Q = me == null ? void 0 : me.key) !== null && Q !== void 0 ? Q : T
1929
- } : T, Gt(me)];
1930
- };
1931
- if (E && u) {
1932
- var ce = ae(), Fe = k(ce, 2), Ke = Fe[0], rt = Fe[1];
1933
- u(Ke, rt);
1934
- } else if (!E && g && W !== "clear") {
1935
- var Ie = ae(), Be = k(Ie, 2), tt = Be[0], P = Be[1];
1936
- g(tt, P);
1937
- }
1938
- }, it = xn(function(_, T) {
1939
- var E, W = Y ? T.selected : !0;
1940
- W ? E = Y ? [].concat(Ze(re), [_]) : [_] : E = re.filter(function(ae) {
1941
- return ae.value !== _;
1942
- }), Pe(E), et(_, W), o === "combobox" ? fe("") : (!Tt || d) && (x(""), fe(""));
1943
- }), lt = function(T, E) {
1944
- Pe(T);
1945
- var W = E.type, ae = E.values;
1946
- (W === "remove" || W === "clear") && ae.forEach(function(ce) {
1947
- et(ce.value, !1, W);
1948
- });
1949
- }, vt = function(T, E) {
1950
- if (x(T), fe(null), E.source === "submit") {
1951
- var W = (T || "").trim();
1952
- if (W) {
1953
- var ae = Array.from(new Set([].concat(Ze(Ce), [W])));
1954
- Pe(ae), et(W, !0), x("");
1955
- }
1956
- return;
1957
- }
1958
- E.source !== "blur" && (o === "combobox" && Pe(T), m == null || m(T));
1959
- }, gt = function(T) {
1960
- var E = T;
1961
- o !== "tags" && (E = T.map(function(ae) {
1962
- var ce = D.get(ae);
1963
- return ce == null ? void 0 : ce.value;
1964
- }).filter(function(ae) {
1965
- return ae !== void 0;
1966
- }));
1967
- var W = Array.from(new Set([].concat(Ze(Ce), Ze(E))));
1968
- Pe(W), W.forEach(function(ae) {
1969
- et(ae, !0);
1970
- });
1971
- }, ye = r.useMemo(function() {
1972
- var _ = B !== !1 && p !== !1;
1973
- return oe(oe({}, C), {}, {
1974
- flattenOptions: ke,
1975
- onActiveValue: Ct,
1976
- defaultActiveFirstOption: at,
1977
- onSelect: it,
1978
- menuItemSelectedIcon: q,
1979
- rawValues: Ce,
1980
- fieldNames: le,
1981
- virtual: _,
1982
- direction: A,
1983
- listHeight: F,
1984
- listItemHeight: te,
1985
- childrenAsData: de,
1986
- maxCount: ne,
1987
- optionRender: O
1988
- });
1989
- }, [ne, C, ke, Ct, at, it, q, Ce, le, B, p, A, F, te, de, O]);
1990
- return process.env.NODE_ENV !== "production" && (Wr(e), jr(R, le)), /* @__PURE__ */ r.createElement(en.Provider, {
1991
- value: ye
1992
- }, /* @__PURE__ */ r.createElement(Fn, Je({}, xe, {
1993
- // >>> MISC
1994
- id: be,
1995
- prefixCls: i,
1996
- ref: t,
1997
- omitDomProps: Ur,
1998
- mode: o,
1999
- displayValues: Te,
2000
- onDisplayValuesChange: lt,
2001
- direction: A,
2002
- searchValue: ge,
2003
- onSearch: vt,
2004
- autoClearSearchValue: d,
2005
- onSearchSplit: gt,
2006
- dropdownMatchSelectWidth: p,
2007
- OptionList: jn,
2008
- emptyOptions: !ke.length,
2009
- activeValue: mt,
2010
- activeDescendantId: "".concat(be, "_list_").concat(Ot)
2011
- })));
2012
- });
2013
- process.env.NODE_ENV !== "production" && (Kn.displayName = "Select");
2014
- var rn = Kn;
2015
- rn.Option = nn;
2016
- rn.OptGroup = tn;
2017
- const Un = () => {
2018
- const [, e] = qt(), n = new Pt(e.colorBgBase).toHsl().l < 0.5 ? {
2019
- opacity: 0.65
2020
- } : {};
2021
- return /* @__PURE__ */ r.createElement("svg", {
2022
- style: n,
2023
- width: "184",
2024
- height: "152",
2025
- viewBox: "0 0 184 152",
2026
- xmlns: "http://www.w3.org/2000/svg"
2027
- }, /* @__PURE__ */ r.createElement("g", {
2028
- fill: "none",
2029
- fillRule: "evenodd"
2030
- }, /* @__PURE__ */ r.createElement("g", {
2031
- transform: "translate(24 31.67)"
2032
- }, /* @__PURE__ */ r.createElement("ellipse", {
2033
- fillOpacity: ".8",
2034
- fill: "#F5F5F7",
2035
- cx: "67.797",
2036
- cy: "106.89",
2037
- rx: "67.797",
2038
- ry: "12.668"
2039
- }), /* @__PURE__ */ r.createElement("path", {
2040
- d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",
2041
- fill: "#AEB8C2"
2042
- }), /* @__PURE__ */ r.createElement("path", {
2043
- d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
2044
- fill: "url(#linearGradient-1)",
2045
- transform: "translate(13.56)"
2046
- }), /* @__PURE__ */ r.createElement("path", {
2047
- d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",
2048
- fill: "#F5F5F7"
2049
- }), /* @__PURE__ */ r.createElement("path", {
2050
- d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",
2051
- fill: "#DCE0E6"
2052
- })), /* @__PURE__ */ r.createElement("path", {
2053
- d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",
2054
- fill: "#DCE0E6"
2055
- }), /* @__PURE__ */ r.createElement("g", {
2056
- transform: "translate(149.65 15.383)",
2057
- fill: "#FFF"
2058
- }, /* @__PURE__ */ r.createElement("ellipse", {
2059
- cx: "20.654",
2060
- cy: "3.167",
2061
- rx: "2.849",
2062
- ry: "2.815"
2063
- }), /* @__PURE__ */ r.createElement("path", {
2064
- d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
2065
- }))));
2066
- };
2067
- process.env.NODE_ENV !== "production" && (Un.displayName = "EmptyImage");
2068
- const Gr = Un, Xn = () => {
2069
- const [, e] = qt(), {
2070
- colorFill: t,
2071
- colorFillTertiary: n,
2072
- colorFillQuaternary: o,
2073
- colorBgContainer: a
2074
- } = e, {
2075
- borderColor: i,
2076
- shadowColor: l,
2077
- contentColor: c
2078
- } = uo(() => ({
2079
- borderColor: new Pt(t).onBackground(a).toHexShortString(),
2080
- shadowColor: new Pt(n).onBackground(a).toHexShortString(),
2081
- contentColor: new Pt(o).onBackground(a).toHexShortString()
2082
- }), [t, n, o, a]);
2083
- return /* @__PURE__ */ r.createElement("svg", {
2084
- width: "64",
2085
- height: "41",
2086
- viewBox: "0 0 64 41",
2087
- xmlns: "http://www.w3.org/2000/svg"
2088
- }, /* @__PURE__ */ r.createElement("g", {
2089
- transform: "translate(0 1)",
2090
- fill: "none",
2091
- fillRule: "evenodd"
2092
- }, /* @__PURE__ */ r.createElement("ellipse", {
2093
- fill: l,
2094
- cx: "32",
2095
- cy: "33",
2096
- rx: "32",
2097
- ry: "7"
2098
- }), /* @__PURE__ */ r.createElement("g", {
2099
- fillRule: "nonzero",
2100
- stroke: i
2101
- }, /* @__PURE__ */ r.createElement("path", {
2102
- d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
2103
- }), /* @__PURE__ */ r.createElement("path", {
2104
- d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
2105
- fill: c
2106
- }))));
2107
- };
2108
- process.env.NODE_ENV !== "production" && (Xn.displayName = "SimpleImage");
2109
- const Yr = Xn, qr = (e) => {
2110
- const {
2111
- componentCls: t,
2112
- margin: n,
2113
- marginXS: o,
2114
- marginXL: a,
2115
- fontSize: i,
2116
- lineHeight: l
2117
- } = e;
2118
- return {
2119
- [t]: {
2120
- marginInline: o,
2121
- fontSize: i,
2122
- lineHeight: l,
2123
- textAlign: "center",
2124
- // 原来 &-image 没有父子结构,现在为了外层承担我们的hashId,改成父子结果
2125
- [`${t}-image`]: {
2126
- height: e.emptyImgHeight,
2127
- marginBottom: o,
2128
- opacity: e.opacityImage,
2129
- img: {
2130
- height: "100%"
2131
- },
2132
- svg: {
2133
- maxWidth: "100%",
2134
- height: "100%",
2135
- margin: "auto"
2136
- }
2137
- },
2138
- [`${t}-description`]: {
2139
- color: e.colorText
2140
- },
2141
- // 原来 &-footer 没有父子结构,现在为了外层承担我们的hashId,改成父子结果
2142
- [`${t}-footer`]: {
2143
- marginTop: n
2144
- },
2145
- "&-normal": {
2146
- marginBlock: a,
2147
- color: e.colorTextDisabled,
2148
- [`${t}-description`]: {
2149
- color: e.colorTextDisabled
2150
- },
2151
- [`${t}-image`]: {
2152
- height: e.emptyImgHeightMD
2153
- }
2154
- },
2155
- "&-small": {
2156
- marginBlock: o,
2157
- color: e.colorTextDisabled,
2158
- [`${t}-image`]: {
2159
- height: e.emptyImgHeightSM
2160
- }
2161
- }
2162
- }
2163
- };
2164
- }, Qr = $n("Empty", (e) => {
2165
- const {
2166
- componentCls: t,
2167
- controlHeightLG: n,
2168
- calc: o
2169
- } = e, a = xt(e, {
2170
- emptyImgCls: `${t}-img`,
2171
- emptyImgHeight: o(n).mul(2.5).equal(),
2172
- emptyImgHeightMD: n,
2173
- emptyImgHeightSM: o(n).mul(0.875).equal()
2174
- });
2175
- return [qr(a)];
2176
- });
2177
- var Zr = function(e, t) {
2178
- var n = {};
2179
- for (var o in e)
2180
- Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
2181
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
2182
- for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
2183
- t.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (n[o[a]] = e[o[a]]);
2184
- return n;
2185
- };
2186
- const Gn = /* @__PURE__ */ r.createElement(Gr, null), Yn = /* @__PURE__ */ r.createElement(Yr, null), Vt = (e) => {
2187
- var {
2188
- className: t,
2189
- rootClassName: n,
2190
- prefixCls: o,
2191
- image: a = Gn,
2192
- description: i,
2193
- children: l,
2194
- imageStyle: c,
2195
- style: f
2196
- } = e, h = Zr(e, ["className", "rootClassName", "prefixCls", "image", "description", "children", "imageStyle", "style"]);
2197
- const {
2198
- getPrefixCls: m,
2199
- direction: s,
2200
- empty: d
2201
- } = r.useContext(Qt), u = m("empty", o), [g, v, p] = Qr(u), [S] = _o("Empty"), b = typeof i < "u" ? i : S == null ? void 0 : S.description, M = typeof b == "string" ? b : "empty";
2202
- let I = null;
2203
- return typeof a == "string" ? I = /* @__PURE__ */ r.createElement("img", {
2204
- alt: M,
2205
- src: a
2206
- }) : I = a, g(/* @__PURE__ */ r.createElement("div", Object.assign({
2207
- className: je(v, p, u, d == null ? void 0 : d.className, {
2208
- [`${u}-normal`]: a === Yn,
2209
- [`${u}-rtl`]: s === "rtl"
2210
- }, t, n),
2211
- style: Object.assign(Object.assign({}, d == null ? void 0 : d.style), f)
2212
- }, h), /* @__PURE__ */ r.createElement("div", {
2213
- className: `${u}-image`,
2214
- style: c
2215
- }, I), b && /* @__PURE__ */ r.createElement("div", {
2216
- className: `${u}-description`
2217
- }, b), l && /* @__PURE__ */ r.createElement("div", {
2218
- className: `${u}-footer`
2219
- }, l)));
2220
- };
2221
- Vt.PRESENTED_IMAGE_DEFAULT = Gn;
2222
- Vt.PRESENTED_IMAGE_SIMPLE = Yn;
2223
- process.env.NODE_ENV !== "production" && (Vt.displayName = "Empty");
2224
- const $t = Vt, Jr = (e) => {
2225
- const {
2226
- componentName: t
2227
- } = e, {
2228
- getPrefixCls: n
2229
- } = co(Qt), o = n("empty");
2230
- switch (t) {
2231
- case "Table":
2232
- case "List":
2233
- return /* @__PURE__ */ Et.createElement($t, {
2234
- image: $t.PRESENTED_IMAGE_SIMPLE
2235
- });
2236
- case "Select":
2237
- case "TreeSelect":
2238
- case "Cascader":
2239
- case "Transfer":
2240
- case "Mentions":
2241
- return /* @__PURE__ */ Et.createElement($t, {
2242
- image: $t.PRESENTED_IMAGE_SIMPLE,
2243
- className: `${o}-small`
2244
- });
2245
- default:
2246
- return /* @__PURE__ */ Et.createElement($t, null);
2247
- }
2248
- }, kr = Jr, ea = (e) => {
2249
- const n = {
2250
- overflow: {
2251
- adjustX: !0,
2252
- adjustY: !0,
2253
- shiftY: !0
2254
- },
2255
- htmlRegion: e === "scroll" ? "scroll" : "visible",
2256
- dynamicInset: !0
2257
- };
2258
- return {
2259
- bottomLeft: Object.assign(Object.assign({}, n), {
2260
- points: ["tl", "bl"],
2261
- offset: [0, 4]
2262
- }),
2263
- bottomRight: Object.assign(Object.assign({}, n), {
2264
- points: ["tr", "br"],
2265
- offset: [0, 4]
2266
- }),
2267
- topLeft: Object.assign(Object.assign({}, n), {
2268
- points: ["bl", "tl"],
2269
- offset: [0, -4]
2270
- }),
2271
- topRight: Object.assign(Object.assign({}, n), {
2272
- points: ["br", "tr"],
2273
- offset: [0, -4]
2274
- })
2275
- };
2276
- };
2277
- function ta(e, t) {
2278
- return e || ea(t);
2279
- }
2280
- const na = (e) => {
2281
- const {
2282
- optionHeight: t,
2283
- optionFontSize: n,
2284
- optionLineHeight: o,
2285
- optionPadding: a
2286
- } = e;
2287
- return {
2288
- position: "relative",
2289
- display: "block",
2290
- minHeight: t,
2291
- padding: a,
2292
- color: e.colorText,
2293
- fontWeight: "normal",
2294
- fontSize: n,
2295
- lineHeight: o,
2296
- boxSizing: "border-box"
2297
- };
2298
- }, oa = (e) => {
2299
- const {
2300
- antCls: t,
2301
- componentCls: n
2302
- } = e, o = `${n}-item`, a = `&${t}-slide-up-enter${t}-slide-up-enter-active`, i = `&${t}-slide-up-appear${t}-slide-up-appear-active`, l = `&${t}-slide-up-leave${t}-slide-up-leave-active`, c = `${n}-dropdown-placement-`;
2303
- return [
2304
- {
2305
- [`${n}-dropdown`]: Object.assign(Object.assign({}, Zt(e)), {
2306
- position: "absolute",
2307
- top: -9999,
2308
- zIndex: e.zIndexPopup,
2309
- boxSizing: "border-box",
2310
- padding: e.paddingXXS,
2311
- overflow: "hidden",
2312
- fontSize: e.fontSize,
2313
- // Fix select render lag of long text in chrome
2314
- // https://github.com/ant-design/ant-design/issues/11456
2315
- // https://github.com/ant-design/ant-design/issues/11843
2316
- fontVariant: "initial",
2317
- backgroundColor: e.colorBgElevated,
2318
- borderRadius: e.borderRadiusLG,
2319
- outline: "none",
2320
- boxShadow: e.boxShadowSecondary,
2321
- [`
2322
- ${a}${c}bottomLeft,
2323
- ${i}${c}bottomLeft
2324
- `]: {
2325
- animationName: Ho
2326
- },
2327
- [`
2328
- ${a}${c}topLeft,
2329
- ${i}${c}topLeft,
2330
- ${a}${c}topRight,
2331
- ${i}${c}topRight
2332
- `]: {
2333
- animationName: Lo
2334
- },
2335
- [`${l}${c}bottomLeft`]: {
2336
- animationName: Fo
2337
- },
2338
- [`
2339
- ${l}${c}topLeft,
2340
- ${l}${c}topRight
2341
- `]: {
2342
- animationName: Bo
2343
- },
2344
- "&-hidden": {
2345
- display: "none"
2346
- },
2347
- [`${o}`]: Object.assign(Object.assign({}, na(e)), {
2348
- cursor: "pointer",
2349
- transition: `background ${e.motionDurationSlow} ease`,
2350
- borderRadius: e.borderRadiusSM,
2351
- // =========== Group ============
2352
- "&-group": {
2353
- color: e.colorTextDescription,
2354
- fontSize: e.fontSizeSM,
2355
- cursor: "default"
2356
- },
2357
- // =========== Option ===========
2358
- "&-option": {
2359
- display: "flex",
2360
- "&-content": Object.assign({
2361
- flex: "auto"
2362
- }, Kt),
2363
- "&-state": {
2364
- flex: "none",
2365
- display: "flex",
2366
- alignItems: "center"
2367
- },
2368
- [`&-active:not(${o}-option-disabled)`]: {
2369
- backgroundColor: e.optionActiveBg
2370
- },
2371
- [`&-selected:not(${o}-option-disabled)`]: {
2372
- color: e.optionSelectedColor,
2373
- fontWeight: e.optionSelectedFontWeight,
2374
- backgroundColor: e.optionSelectedBg,
2375
- [`${o}-option-state`]: {
2376
- color: e.colorPrimary
2377
- },
2378
- [`&:has(+ ${o}-option-selected:not(${o}-option-disabled))`]: {
2379
- borderEndStartRadius: 0,
2380
- borderEndEndRadius: 0,
2381
- [`& + ${o}-option-selected:not(${o}-option-disabled)`]: {
2382
- borderStartStartRadius: 0,
2383
- borderStartEndRadius: 0
2384
- }
2385
- }
2386
- },
2387
- "&-disabled": {
2388
- [`&${o}-option-selected`]: {
2389
- backgroundColor: e.colorBgContainerDisabled
2390
- },
2391
- color: e.colorTextDisabled,
2392
- cursor: "not-allowed"
2393
- },
2394
- "&-grouped": {
2395
- paddingInlineStart: e.calc(e.controlPaddingHorizontal).mul(2).equal()
2396
- }
2397
- }
2398
- }),
2399
- // =========================== RTL ===========================
2400
- "&-rtl": {
2401
- direction: "rtl"
2402
- }
2403
- })
2404
- },
2405
- // Follow code may reuse in other components
2406
- vn(e, "slide-up"),
2407
- vn(e, "slide-down"),
2408
- gn(e, "move-up"),
2409
- gn(e, "move-down")
2410
- ];
2411
- }, yt = 2, ra = (e) => {
2412
- const {
2413
- multipleSelectItemHeight: t,
2414
- selectHeight: n,
2415
- lineWidth: o
2416
- } = e;
2417
- return e.calc(n).sub(t).div(2).sub(o).equal();
2418
- };
2419
- function At(e, t) {
2420
- const {
2421
- componentCls: n,
2422
- iconCls: o
2423
- } = e, a = `${n}-selection-overflow`, i = e.multipleSelectItemHeight, l = ra(e), c = t ? `${n}-${t}` : "";
2424
- return {
2425
- [`${n}-multiple${c}`]: {
2426
- fontSize: e.fontSize,
2427
- /**
2428
- * Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome
2429
- * may update to redesign with its align logic.
2430
- */
2431
- // =========================== Overflow ===========================
2432
- [a]: {
2433
- position: "relative",
2434
- display: "flex",
2435
- flex: "auto",
2436
- flexWrap: "wrap",
2437
- maxWidth: "100%",
2438
- "&-item": {
2439
- flex: "none",
2440
- alignSelf: "center",
2441
- maxWidth: "100%",
2442
- display: "inline-flex"
2443
- }
2444
- },
2445
- // ========================= Selector =========================
2446
- [`${n}-selector`]: {
2447
- display: "flex",
2448
- flexWrap: "wrap",
2449
- alignItems: "center",
2450
- height: "100%",
2451
- // Multiple is little different that horizontal is follow the vertical
2452
- paddingInline: e.calc(yt).mul(2).equal(),
2453
- paddingBlock: e.calc(l).sub(yt).equal(),
2454
- borderRadius: e.borderRadius,
2455
- [`${n}-show-search&`]: {
2456
- cursor: "text"
2457
- },
2458
- [`${n}-disabled&`]: {
2459
- background: e.multipleSelectorBgDisabled,
2460
- cursor: "not-allowed"
2461
- },
2462
- "&:after": {
2463
- display: "inline-block",
2464
- width: 0,
2465
- margin: `${We(yt)} 0`,
2466
- lineHeight: We(i),
2467
- visibility: "hidden",
2468
- content: '"\\a0"'
2469
- }
2470
- },
2471
- [`
2472
- &${n}-show-arrow ${n}-selector,
2473
- &${n}-allow-clear ${n}-selector
2474
- `]: {
2475
- paddingInlineEnd: e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()
2476
- },
2477
- // ======================== Selections ========================
2478
- [`${n}-selection-item`]: {
2479
- display: "flex",
2480
- alignSelf: "center",
2481
- flex: "none",
2482
- boxSizing: "border-box",
2483
- maxWidth: "100%",
2484
- height: i,
2485
- marginTop: yt,
2486
- marginBottom: yt,
2487
- lineHeight: We(e.calc(i).sub(e.calc(e.lineWidth).mul(2)).equal()),
2488
- borderRadius: e.borderRadiusSM,
2489
- cursor: "default",
2490
- transition: `font-size ${e.motionDurationSlow}, line-height ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,
2491
- marginInlineEnd: e.calc(yt).mul(2).equal(),
2492
- paddingInlineStart: e.paddingXS,
2493
- paddingInlineEnd: e.calc(e.paddingXS).div(2).equal(),
2494
- [`${n}-disabled&`]: {
2495
- color: e.multipleItemColorDisabled,
2496
- borderColor: e.multipleItemBorderColorDisabled,
2497
- cursor: "not-allowed"
2498
- },
2499
- // It's ok not to do this, but 24px makes bottom narrow in view should adjust
2500
- "&-content": {
2501
- display: "inline-block",
2502
- marginInlineEnd: e.calc(e.paddingXS).div(2).equal(),
2503
- overflow: "hidden",
2504
- whiteSpace: "pre",
2505
- // fix whitespace wrapping. custom tags display all whitespace within.
2506
- textOverflow: "ellipsis"
2507
- },
2508
- "&-remove": Object.assign(Object.assign({}, Mn()), {
2509
- display: "inline-flex",
2510
- alignItems: "center",
2511
- color: e.colorIcon,
2512
- fontWeight: "bold",
2513
- fontSize: 10,
2514
- lineHeight: "inherit",
2515
- cursor: "pointer",
2516
- [`> ${o}`]: {
2517
- verticalAlign: "-0.2em"
2518
- },
2519
- "&:hover": {
2520
- color: e.colorIconHover
2521
- }
2522
- })
2523
- },
2524
- // ========================== Input ==========================
2525
- [`${a}-item + ${a}-item`]: {
2526
- [`${n}-selection-search`]: {
2527
- marginInlineStart: 0
2528
- }
2529
- },
2530
- // https://github.com/ant-design/ant-design/issues/44754
2531
- [`${a}-item-suffix`]: {
2532
- height: "100%"
2533
- },
2534
- [`${n}-selection-search`]: {
2535
- display: "inline-flex",
2536
- position: "relative",
2537
- maxWidth: "100%",
2538
- marginInlineStart: e.calc(e.inputPaddingHorizontalBase).sub(l).equal(),
2539
- "\n &-input,\n &-mirror\n ": {
2540
- height: i,
2541
- fontFamily: e.fontFamily,
2542
- lineHeight: We(i),
2543
- transition: `all ${e.motionDurationSlow}`
2544
- },
2545
- "&-input": {
2546
- width: "100%",
2547
- minWidth: 4.1
2548
- // fix search cursor missing
2549
- },
2550
- "&-mirror": {
2551
- position: "absolute",
2552
- top: 0,
2553
- insetInlineStart: 0,
2554
- insetInlineEnd: "auto",
2555
- zIndex: 999,
2556
- whiteSpace: "pre",
2557
- // fix whitespace wrapping caused width calculation bug
2558
- visibility: "hidden"
2559
- }
2560
- },
2561
- // ======================= Placeholder =======================
2562
- [`${n}-selection-placeholder`]: {
2563
- position: "absolute",
2564
- top: "50%",
2565
- insetInlineStart: e.inputPaddingHorizontalBase,
2566
- insetInlineEnd: e.inputPaddingHorizontalBase,
2567
- transform: "translateY(-50%)",
2568
- transition: `all ${e.motionDurationSlow}`
2569
- }
2570
- }
2571
- };
2572
- }
2573
- const aa = (e) => {
2574
- const {
2575
- componentCls: t
2576
- } = e, n = xt(e, {
2577
- selectHeight: e.controlHeightSM,
2578
- multipleSelectItemHeight: e.controlHeightXS,
2579
- borderRadius: e.borderRadiusSM,
2580
- borderRadiusSM: e.borderRadiusXS
2581
- }), o = xt(e, {
2582
- fontSize: e.fontSizeLG,
2583
- selectHeight: e.controlHeightLG,
2584
- multipleSelectItemHeight: e.multipleItemHeightLG,
2585
- borderRadius: e.borderRadiusLG,
2586
- borderRadiusSM: e.borderRadius
2587
- });
2588
- return [
2589
- At(e),
2590
- // ======================== Small ========================
2591
- At(n, "sm"),
2592
- // Padding
2593
- {
2594
- [`${t}-multiple${t}-sm`]: {
2595
- [`${t}-selection-placeholder`]: {
2596
- insetInline: e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()
2597
- },
2598
- // https://github.com/ant-design/ant-design/issues/29559
2599
- [`${t}-selection-search`]: {
2600
- marginInlineStart: 2
2601
- // Magic Number
2602
- }
2603
- }
2604
- },
2605
- // ======================== Large ========================
2606
- At(o, "lg")
2607
- ];
2608
- };
2609
- function Wt(e, t) {
2610
- const {
2611
- componentCls: n,
2612
- inputPaddingHorizontalBase: o,
2613
- borderRadius: a
2614
- } = e, i = e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(), l = t ? `${n}-${t}` : "";
2615
- return {
2616
- [`${n}-single${l}`]: {
2617
- fontSize: e.fontSize,
2618
- height: e.controlHeight,
2619
- // ========================= Selector =========================
2620
- [`${n}-selector`]: Object.assign(Object.assign({}, Zt(e, !0)), {
2621
- display: "flex",
2622
- borderRadius: a,
2623
- [`${n}-selection-search`]: {
2624
- position: "absolute",
2625
- top: 0,
2626
- insetInlineStart: o,
2627
- insetInlineEnd: o,
2628
- bottom: 0,
2629
- "&-input": {
2630
- width: "100%",
2631
- WebkitAppearance: "textfield"
2632
- }
2633
- },
2634
- [`
2635
- ${n}-selection-item,
2636
- ${n}-selection-placeholder
2637
- `]: {
2638
- padding: 0,
2639
- lineHeight: We(i),
2640
- transition: `all ${e.motionDurationSlow}, visibility 0s`,
2641
- alignSelf: "center"
2642
- },
2643
- [`${n}-selection-placeholder`]: {
2644
- transition: "none",
2645
- pointerEvents: "none"
2646
- },
2647
- // For common baseline align
2648
- [[
2649
- "&:after",
2650
- /* For '' value baseline align */
2651
- `${n}-selection-item:empty:after`,
2652
- /* For undefined value baseline align */
2653
- `${n}-selection-placeholder:empty:after`
2654
- ].join(",")]: {
2655
- display: "inline-block",
2656
- width: 0,
2657
- visibility: "hidden",
2658
- content: '"\\a0"'
2659
- }
2660
- }),
2661
- [`
2662
- &${n}-show-arrow ${n}-selection-item,
2663
- &${n}-show-arrow ${n}-selection-placeholder
2664
- `]: {
2665
- paddingInlineEnd: e.showArrowPaddingInlineEnd
2666
- },
2667
- // Opacity selection if open
2668
- [`&${n}-open ${n}-selection-item`]: {
2669
- color: e.colorTextPlaceholder
2670
- },
2671
- // ========================== Input ==========================
2672
- // We only change the style of non-customize input which is only support by `combobox` mode.
2673
- // Not customize
2674
- [`&:not(${n}-customize-input)`]: {
2675
- [`${n}-selector`]: {
2676
- width: "100%",
2677
- height: "100%",
2678
- padding: `0 ${We(o)}`,
2679
- [`${n}-selection-search-input`]: {
2680
- height: i
2681
- },
2682
- "&:after": {
2683
- lineHeight: We(i)
2684
- }
2685
- }
2686
- },
2687
- [`&${n}-customize-input`]: {
2688
- [`${n}-selector`]: {
2689
- "&:after": {
2690
- display: "none"
2691
- },
2692
- [`${n}-selection-search`]: {
2693
- position: "static",
2694
- width: "100%"
2695
- },
2696
- [`${n}-selection-placeholder`]: {
2697
- position: "absolute",
2698
- insetInlineStart: 0,
2699
- insetInlineEnd: 0,
2700
- padding: `0 ${We(o)}`,
2701
- "&:after": {
2702
- display: "none"
2703
- }
2704
- }
2705
- }
2706
- }
2707
- }
2708
- };
2709
- }
2710
- function ia(e) {
2711
- const {
2712
- componentCls: t
2713
- } = e, n = e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();
2714
- return [
2715
- Wt(e),
2716
- // ======================== Small ========================
2717
- // Shared
2718
- Wt(xt(e, {
2719
- controlHeight: e.controlHeightSM,
2720
- borderRadius: e.borderRadiusSM
2721
- }), "sm"),
2722
- // padding
2723
- {
2724
- [`${t}-single${t}-sm`]: {
2725
- [`&:not(${t}-customize-input)`]: {
2726
- [`${t}-selection-search`]: {
2727
- insetInlineStart: n,
2728
- insetInlineEnd: n
2729
- },
2730
- [`${t}-selector`]: {
2731
- padding: `0 ${We(n)}`
2732
- },
2733
- // With arrow should provides `padding-right` to show the arrow
2734
- [`&${t}-show-arrow ${t}-selection-search`]: {
2735
- insetInlineEnd: e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()
2736
- },
2737
- [`
2738
- &${t}-show-arrow ${t}-selection-item,
2739
- &${t}-show-arrow ${t}-selection-placeholder
2740
- `]: {
2741
- paddingInlineEnd: e.calc(e.fontSize).mul(1.5).equal()
2742
- }
2743
- }
2744
- }
2745
- },
2746
- // ======================== Large ========================
2747
- // Shared
2748
- Wt(xt(e, {
2749
- controlHeight: e.singleItemHeightLG,
2750
- fontSize: e.fontSizeLG,
2751
- borderRadius: e.borderRadiusLG
2752
- }), "lg")
2753
- ];
2754
- }
2755
- const la = (e) => {
2756
- const {
2757
- fontSize: t,
2758
- lineHeight: n,
2759
- controlHeight: o,
2760
- controlPaddingHorizontal: a,
2761
- zIndexPopupBase: i,
2762
- colorText: l,
2763
- fontWeightStrong: c,
2764
- controlItemBgActive: f,
2765
- controlItemBgHover: h,
2766
- colorBgContainer: m,
2767
- colorFillSecondary: s,
2768
- controlHeightLG: d,
2769
- controlHeightSM: u,
2770
- colorBgContainerDisabled: g,
2771
- colorTextDisabled: v
2772
- } = e;
2773
- return {
2774
- zIndexPopup: i + 50,
2775
- optionSelectedColor: l,
2776
- optionSelectedFontWeight: c,
2777
- optionSelectedBg: f,
2778
- optionActiveBg: h,
2779
- optionPadding: `${(o - t * n) / 2}px ${a}px`,
2780
- optionFontSize: t,
2781
- optionLineHeight: n,
2782
- optionHeight: o,
2783
- selectorBg: m,
2784
- clearBg: m,
2785
- singleItemHeightLG: d,
2786
- multipleItemBg: s,
2787
- multipleItemBorderColor: "transparent",
2788
- multipleItemHeight: u,
2789
- multipleItemHeightLG: o,
2790
- multipleSelectorBgDisabled: g,
2791
- multipleItemColorDisabled: v,
2792
- multipleItemBorderColorDisabled: "transparent",
2793
- showArrowPaddingInlineEnd: Math.ceil(e.fontSize * 1.25)
2794
- };
2795
- }, qn = (e, t) => {
2796
- const {
2797
- componentCls: n,
2798
- antCls: o,
2799
- controlOutlineWidth: a
2800
- } = e;
2801
- return {
2802
- [`&:not(${n}-customize-input) ${n}-selector`]: {
2803
- border: `${We(e.lineWidth)} ${e.lineType} ${t.borderColor}`,
2804
- background: e.selectorBg
2805
- },
2806
- [`&:not(${n}-disabled):not(${n}-customize-input):not(${o}-pagination-size-changer)`]: {
2807
- [`&:hover ${n}-selector`]: {
2808
- borderColor: t.hoverBorderHover
2809
- },
2810
- [`${n}-focused& ${n}-selector`]: {
2811
- borderColor: t.activeBorderColor,
2812
- boxShadow: `0 0 0 ${We(a)} ${t.activeShadowColor}`,
2813
- outline: 0
2814
- }
2815
- }
2816
- };
2817
- }, On = (e, t) => ({
2818
- [`&${e.componentCls}-status-${t.status}`]: Object.assign({}, qn(e, t))
2819
- }), ua = (e) => ({
2820
- "&-outlined": Object.assign(Object.assign(Object.assign(Object.assign({}, qn(e, {
2821
- borderColor: e.colorBorder,
2822
- hoverBorderHover: e.colorPrimaryHover,
2823
- activeBorderColor: e.colorPrimary,
2824
- activeShadowColor: e.controlOutline
2825
- })), On(e, {
2826
- status: "error",
2827
- borderColor: e.colorError,
2828
- hoverBorderHover: e.colorErrorHover,
2829
- activeBorderColor: e.colorError,
2830
- activeShadowColor: e.colorErrorOutline
2831
- })), On(e, {
2832
- status: "warning",
2833
- borderColor: e.colorWarning,
2834
- hoverBorderHover: e.colorWarningHover,
2835
- activeBorderColor: e.colorWarning,
2836
- activeShadowColor: e.colorWarningOutline
2837
- })), {
2838
- [`&${e.componentCls}-disabled`]: {
2839
- [`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]: {
2840
- background: e.colorBgContainerDisabled,
2841
- color: e.colorTextDisabled
2842
- }
2843
- },
2844
- [`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]: {
2845
- background: e.multipleItemBg,
2846
- border: `${We(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`
2847
- }
2848
- })
2849
- }), Qn = (e, t) => {
2850
- const {
2851
- componentCls: n,
2852
- antCls: o
2853
- } = e;
2854
- return {
2855
- [`&:not(${n}-customize-input) ${n}-selector`]: {
2856
- background: t.bg,
2857
- border: `${We(e.lineWidth)} ${e.lineType} transparent`,
2858
- color: t.color
2859
- },
2860
- [`&:not(${n}-disabled):not(${n}-customize-input):not(${o}-pagination-size-changer)`]: {
2861
- [`&:hover ${n}-selector`]: {
2862
- background: t.hoverBg
2863
- },
2864
- [`${n}-focused& ${n}-selector`]: {
2865
- background: e.selectorBg,
2866
- borderColor: t.activeBorderColor,
2867
- outline: 0
2868
- }
2869
- }
2870
- };
2871
- }, Rn = (e, t) => ({
2872
- [`&${e.componentCls}-status-${t.status}`]: Object.assign({}, Qn(e, t))
2873
- }), ca = (e) => ({
2874
- "&-filled": Object.assign(Object.assign(Object.assign(Object.assign({}, Qn(e, {
2875
- bg: e.colorFillTertiary,
2876
- hoverBg: e.colorFillSecondary,
2877
- activeBorderColor: e.colorPrimary,
2878
- color: e.colorText
2879
- })), Rn(e, {
2880
- status: "error",
2881
- bg: e.colorErrorBg,
2882
- hoverBg: e.colorErrorBgHover,
2883
- activeBorderColor: e.colorError,
2884
- color: e.colorError
2885
- })), Rn(e, {
2886
- status: "warning",
2887
- bg: e.colorWarningBg,
2888
- hoverBg: e.colorWarningBgHover,
2889
- activeBorderColor: e.colorWarning,
2890
- color: e.colorWarning
2891
- })), {
2892
- [`&${e.componentCls}-disabled`]: {
2893
- [`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]: {
2894
- borderColor: e.colorBorder,
2895
- background: e.colorBgContainerDisabled,
2896
- color: e.colorTextDisabled
2897
- }
2898
- },
2899
- [`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]: {
2900
- background: e.colorBgContainer,
2901
- border: `${We(e.lineWidth)} ${e.lineType} ${e.colorSplit}`
2902
- }
2903
- })
2904
- }), sa = (e) => ({
2905
- "&-borderless": {
2906
- [`${e.componentCls}-selector`]: {
2907
- background: "transparent",
2908
- borderColor: "transparent"
2909
- },
2910
- [`&${e.componentCls}-disabled`]: {
2911
- [`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]: {
2912
- color: e.colorTextDisabled
2913
- }
2914
- },
2915
- [`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]: {
2916
- background: e.multipleItemBg,
2917
- border: `${We(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`
2918
- }
2919
- }
2920
- }), da = (e) => ({
2921
- [e.componentCls]: Object.assign(Object.assign(Object.assign({}, ua(e)), ca(e)), sa(e))
2922
- }), fa = da, ma = (e) => {
2923
- const {
2924
- componentCls: t
2925
- } = e;
2926
- return {
2927
- position: "relative",
2928
- transition: `all ${e.motionDurationMid} ${e.motionEaseInOut}`,
2929
- input: {
2930
- cursor: "pointer"
2931
- },
2932
- [`${t}-show-search&`]: {
2933
- cursor: "text",
2934
- input: {
2935
- cursor: "auto",
2936
- color: "inherit",
2937
- height: "100%"
2938
- }
2939
- },
2940
- [`${t}-disabled&`]: {
2941
- cursor: "not-allowed",
2942
- input: {
2943
- cursor: "not-allowed"
2944
- }
2945
- }
2946
- };
2947
- }, va = (e) => {
2948
- const {
2949
- componentCls: t
2950
- } = e;
2951
- return {
2952
- [`${t}-selection-search-input`]: {
2953
- margin: 0,
2954
- padding: 0,
2955
- background: "transparent",
2956
- border: "none",
2957
- outline: "none",
2958
- appearance: "none",
2959
- fontFamily: "inherit",
2960
- "&::-webkit-search-cancel-button": {
2961
- display: "none",
2962
- "-webkit-appearance": "none"
2963
- }
2964
- }
2965
- };
2966
- }, ga = (e) => {
2967
- const {
2968
- antCls: t,
2969
- componentCls: n,
2970
- inputPaddingHorizontalBase: o,
2971
- iconCls: a
2972
- } = e;
2973
- return {
2974
- [n]: Object.assign(Object.assign({}, Zt(e)), {
2975
- position: "relative",
2976
- display: "inline-block",
2977
- cursor: "pointer",
2978
- [`&:not(${n}-customize-input) ${n}-selector`]: Object.assign(Object.assign({}, ma(e)), va(e)),
2979
- // ======================== Selection ========================
2980
- [`${n}-selection-item`]: Object.assign(Object.assign({
2981
- flex: 1,
2982
- fontWeight: "normal",
2983
- position: "relative",
2984
- userSelect: "none"
2985
- }, Kt), {
2986
- // https://github.com/ant-design/ant-design/issues/40421
2987
- [`> ${t}-typography`]: {
2988
- display: "inline"
2989
- }
2990
- }),
2991
- // ======================= Placeholder =======================
2992
- [`${n}-selection-placeholder`]: Object.assign(Object.assign({}, Kt), {
2993
- flex: 1,
2994
- color: e.colorTextPlaceholder,
2995
- pointerEvents: "none"
2996
- }),
2997
- // ========================== Arrow ==========================
2998
- [`${n}-arrow`]: Object.assign(Object.assign({}, Mn()), {
2999
- position: "absolute",
3000
- top: "50%",
3001
- insetInlineStart: "auto",
3002
- insetInlineEnd: o,
3003
- height: e.fontSizeIcon,
3004
- marginTop: e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),
3005
- color: e.colorTextQuaternary,
3006
- fontSize: e.fontSizeIcon,
3007
- lineHeight: 1,
3008
- textAlign: "center",
3009
- pointerEvents: "none",
3010
- display: "flex",
3011
- alignItems: "center",
3012
- transition: `opacity ${e.motionDurationSlow} ease`,
3013
- [a]: {
3014
- verticalAlign: "top",
3015
- transition: `transform ${e.motionDurationSlow}`,
3016
- "> svg": {
3017
- verticalAlign: "top"
3018
- },
3019
- [`&:not(${n}-suffix)`]: {
3020
- pointerEvents: "auto"
3021
- }
3022
- },
3023
- [`${n}-disabled &`]: {
3024
- cursor: "not-allowed"
3025
- },
3026
- "> *:not(:last-child)": {
3027
- marginInlineEnd: 8
3028
- // FIXME: magic
3029
- }
3030
- }),
3031
- // ========================== Clear ==========================
3032
- [`${n}-clear`]: {
3033
- position: "absolute",
3034
- top: "50%",
3035
- insetInlineStart: "auto",
3036
- insetInlineEnd: o,
3037
- zIndex: 1,
3038
- display: "inline-block",
3039
- width: e.fontSizeIcon,
3040
- height: e.fontSizeIcon,
3041
- marginTop: e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),
3042
- color: e.colorTextQuaternary,
3043
- fontSize: e.fontSizeIcon,
3044
- fontStyle: "normal",
3045
- lineHeight: 1,
3046
- textAlign: "center",
3047
- textTransform: "none",
3048
- cursor: "pointer",
3049
- opacity: 0,
3050
- transition: `color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,
3051
- textRendering: "auto",
3052
- "&:before": {
3053
- display: "block"
3054
- },
3055
- "&:hover": {
3056
- color: e.colorTextTertiary
3057
- }
3058
- },
3059
- "&:hover": {
3060
- [`${n}-clear`]: {
3061
- opacity: 1
3062
- },
3063
- // Should use the following selector, but since `:has` has poor compatibility,
3064
- // we use `:not(:last-child)` instead, which may cause some problems in some cases.
3065
- // [`${componentCls}-arrow:has(+ ${componentCls}-clear)`]: {
3066
- [`${n}-arrow:not(:last-child)`]: {
3067
- opacity: 0
3068
- }
3069
- }
3070
- }),
3071
- // ========================= Feedback ==========================
3072
- [`${n}-has-feedback`]: {
3073
- [`${n}-clear`]: {
3074
- insetInlineEnd: e.calc(o).add(e.fontSize).add(e.paddingXS).equal()
3075
- }
3076
- }
3077
- };
3078
- }, pa = (e) => {
3079
- const {
3080
- componentCls: t
3081
- } = e;
3082
- return [
3083
- {
3084
- [t]: {
3085
- // ==================== In Form ====================
3086
- [`&${t}-in-form-item`]: {
3087
- width: "100%"
3088
- }
3089
- }
3090
- },
3091
- // =====================================================
3092
- // == LTR ==
3093
- // =====================================================
3094
- // Base
3095
- ga(e),
3096
- // Single
3097
- ia(e),
3098
- // Multiple
3099
- aa(e),
3100
- // Dropdown
3101
- oa(e),
3102
- // =====================================================
3103
- // == RTL ==
3104
- // =====================================================
3105
- {
3106
- [`${t}-rtl`]: {
3107
- direction: "rtl"
3108
- }
3109
- },
3110
- // =====================================================
3111
- // == Space Compact ==
3112
- // =====================================================
3113
- Vo(e, {
3114
- borderElCls: `${t}-selector`,
3115
- focusElCls: `${t}-focused`
3116
- })
3117
- ];
3118
- }, ha = $n("Select", (e, t) => {
3119
- let {
3120
- rootPrefixCls: n
3121
- } = t;
3122
- const o = xt(e, {
3123
- rootPrefixCls: n,
3124
- inputPaddingHorizontalBase: e.calc(e.paddingSM).sub(1).equal(),
3125
- multipleSelectItemHeight: e.multipleItemHeight,
3126
- selectHeight: e.controlHeight
3127
- });
3128
- return [pa(o), fa(o)];
3129
- }, la, {
3130
- unitless: {
3131
- optionLineHeight: !0,
3132
- optionSelectedFontWeight: !0
3133
- }
3134
- });
3135
- var Sa = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, name: "down", theme: "outlined" };
3136
- const ba = Sa;
3137
- var Zn = function(t, n) {
3138
- return /* @__PURE__ */ r.createElement(Io, Je({}, t, {
3139
- ref: n,
3140
- icon: ba
3141
- }));
3142
- };
3143
- process.env.NODE_ENV !== "production" && (Zn.displayName = "DownOutlined");
3144
- const Ca = /* @__PURE__ */ r.forwardRef(Zn);
3145
- function wa(e) {
3146
- let {
3147
- suffixIcon: t,
3148
- clearIcon: n,
3149
- menuItemSelectedIcon: o,
3150
- removeIcon: a,
3151
- loading: i,
3152
- multiple: l,
3153
- hasFeedback: c,
3154
- prefixCls: f,
3155
- showSuffixIcon: h,
3156
- feedbackIcon: m,
3157
- showArrow: s,
3158
- componentName: d
3159
- } = e;
3160
- process.env.NODE_ENV !== "production" && Dn(d).deprecated(!n, "clearIcon", "allowClear={{ clearIcon: React.ReactNode }}");
3161
- const u = n ?? /* @__PURE__ */ r.createElement(Wo, null), g = (b) => t === null && !c && !s ? null : /* @__PURE__ */ r.createElement(r.Fragment, null, h !== !1 && b, c && m);
3162
- let v = null;
3163
- if (t !== void 0)
3164
- v = g(t);
3165
- else if (i)
3166
- v = g(/* @__PURE__ */ r.createElement(Ko, {
3167
- spin: !0
3168
- }));
3169
- else {
3170
- const b = `${f}-suffix`;
3171
- v = (M) => {
3172
- let {
3173
- open: I,
3174
- showSearch: H
3175
- } = M;
3176
- return g(I && H ? /* @__PURE__ */ r.createElement(Uo, {
3177
- className: b
3178
- }) : /* @__PURE__ */ r.createElement(Ca, {
3179
- className: b
3180
- }));
3181
- };
3182
- }
3183
- let p = null;
3184
- o !== void 0 ? p = o : l ? p = /* @__PURE__ */ r.createElement(Ao, null) : p = null;
3185
- let S = null;
3186
- return a !== void 0 ? S = a : S = /* @__PURE__ */ r.createElement(jo, null), {
3187
- clearIcon: u,
3188
- suffixIcon: v,
3189
- itemIcon: p,
3190
- removeIcon: S
3191
- };
3192
- }
3193
- function ya(e, t) {
3194
- return t !== void 0 ? t : e !== null;
3195
- }
3196
- var Ea = function(e, t) {
3197
- var n = {};
3198
- for (var o in e)
3199
- Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
3200
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
3201
- for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
3202
- t.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (n[o[a]] = e[o[a]]);
3203
- return n;
3204
- };
3205
- const Jn = "SECRET_COMBOBOX_MODE_DO_NOT_USE", kn = (e, t) => {
3206
- var n;
3207
- const {
3208
- prefixCls: o,
3209
- bordered: a,
3210
- className: i,
3211
- rootClassName: l,
3212
- getPopupContainer: c,
3213
- popupClassName: f,
3214
- dropdownClassName: h,
3215
- listHeight: m = 256,
3216
- placement: s,
3217
- listItemHeight: d,
3218
- size: u,
3219
- disabled: g,
3220
- notFoundContent: v,
3221
- status: p,
3222
- builtinPlacements: S,
3223
- dropdownMatchSelectWidth: b,
3224
- popupMatchSelectWidth: M,
3225
- direction: I,
3226
- style: H,
3227
- allowClear: O,
3228
- variant: $,
3229
- dropdownStyle: j,
3230
- transitionName: q,
3231
- tagRender: B,
3232
- maxCount: A
3233
- } = e, G = Ea(e, ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "direction", "style", "allowClear", "variant", "dropdownStyle", "transitionName", "tagRender", "maxCount"]), {
3234
- getPopupContainer: F,
3235
- getPrefixCls: L,
3236
- renderEmpty: te,
3237
- direction: K,
3238
- virtual: N,
3239
- popupMatchSelectWidth: w,
3240
- popupOverflow: se,
3241
- select: ne
3242
- } = r.useContext(Qt), [, xe] = qt(), be = d ?? (xe == null ? void 0 : xe.controlHeight), Y = L("select", o), de = L(), pe = I ?? K, {
3243
- compactSize: le,
3244
- compactItemClassnames: Ne
3245
- } = xo(Y, pe), [Me, ge] = Do($, a), x = To(Y), [C, y, D] = ha(Y, x), R = r.useMemo(() => {
3246
- const {
3247
- mode: fe
3248
- } = e;
3249
- if (fe !== "combobox")
3250
- return fe === Jn ? "combobox" : fe;
3251
- }, [e.mode]), V = R === "multiple" || R === "tags", ee = ya(e.suffixIcon, e.showArrow), Z = (n = M ?? b) !== null && n !== void 0 ? n : w, {
3252
- status: he,
3253
- hasFeedback: ue,
3254
- isFormItemInput: $e,
3255
- feedbackIcon: Oe
3256
- } = r.useContext(zo), De = Po(he, p);
3257
- let re;
3258
- v !== void 0 ? re = v : R === "combobox" ? re = null : re = (te == null ? void 0 : te("Select")) || /* @__PURE__ */ r.createElement(kr, {
3259
- componentName: "Select"
3260
- });
3261
- const {
3262
- suffixIcon: _e,
3263
- itemIcon: Te,
3264
- removeIcon: Ce,
3265
- clearIcon: Se
3266
- } = wa(Object.assign(Object.assign({}, G), {
3267
- multiple: V,
3268
- hasFeedback: ue,
3269
- feedbackIcon: Oe,
3270
- showSuffixIcon: ee,
3271
- prefixCls: Y,
3272
- componentName: "Select"
3273
- })), ze = O === !0 ? {
3274
- clearIcon: Se
3275
- } : O, we = Nn(G, ["suffixIcon", "itemIcon"]), He = je(f || h, {
3276
- [`${Y}-dropdown-${pe}`]: pe === "rtl"
3277
- }, l, D, x, y), Ee = Oo((fe) => {
3278
- var qe;
3279
- return (qe = u ?? le) !== null && qe !== void 0 ? qe : fe;
3280
- }), ke = r.useContext(Co), Pe = g ?? ke, Ge = je({
3281
- [`${Y}-lg`]: Ee === "large",
3282
- [`${Y}-sm`]: Ee === "small",
3283
- [`${Y}-rtl`]: pe === "rtl",
3284
- [`${Y}-${Me}`]: ge,
3285
- [`${Y}-in-form-item`]: $e
3286
- }, No(Y, De, ue), Ne, ne == null ? void 0 : ne.className, i, l, D, x, y), Ye = r.useMemo(() => s !== void 0 ? s : pe === "rtl" ? "bottomRight" : "bottomLeft", [s, pe]);
3287
- if (process.env.NODE_ENV !== "production") {
3288
- const fe = Dn("Select");
3289
- fe.deprecated(!h, "dropdownClassName", "popupClassName"), fe.deprecated(b === void 0, "dropdownMatchSelectWidth", "popupMatchSelectWidth"), process.env.NODE_ENV !== "production" && fe(!("showArrow" in e), "deprecated", "`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null."), fe.deprecated(!("bordered" in e), "bordered", "variant"), process.env.NODE_ENV !== "production" && fe(!(typeof A < "u" && !V), "usage", "`maxCount` only works with mode `multiple` or `tags`");
3290
- }
3291
- const [mt] = Ro("SelectLike", j == null ? void 0 : j.zIndex);
3292
- return C(/* @__PURE__ */ r.createElement(rn, Object.assign({
3293
- ref: t,
3294
- virtual: N,
3295
- showSearch: ne == null ? void 0 : ne.showSearch
3296
- }, we, {
3297
- style: Object.assign(Object.assign({}, ne == null ? void 0 : ne.style), H),
3298
- dropdownMatchSelectWidth: Z,
3299
- transitionName: $o(de, "slide-up", q),
3300
- builtinPlacements: ta(S, se),
3301
- listHeight: m,
3302
- listItemHeight: be,
3303
- mode: R,
3304
- prefixCls: Y,
3305
- placement: Ye,
3306
- direction: pe,
3307
- suffixIcon: _e,
3308
- menuItemSelectedIcon: Te,
3309
- removeIcon: Ce,
3310
- allowClear: ze,
3311
- notFoundContent: re,
3312
- className: Ge,
3313
- getPopupContainer: c || F,
3314
- dropdownClassName: He,
3315
- disabled: Pe,
3316
- dropdownStyle: Object.assign(Object.assign({}, j), {
3317
- zIndex: mt
3318
- }),
3319
- maxCount: V ? A : void 0,
3320
- tagRender: V ? B : void 0
3321
- })));
3322
- };
3323
- process.env.NODE_ENV !== "production" && (kn.displayName = "Select");
3324
- const St = /* @__PURE__ */ r.forwardRef(kn), Ia = Mo(St);
3325
- St.SECRET_COMBOBOX_MODE_DO_NOT_USE = Jn;
3326
- St.Option = nn;
3327
- St.OptGroup = tn;
3328
- St._InternalPanelDoNotUseOrYouWillBeFired = Ia;
3329
- process.env.NODE_ENV !== "production" && (St.displayName = "Select");
3330
- const Ja = St;
3331
- export {
3332
- Ja as A,
3333
- Ca as D,
3334
- $t as E,
3335
- Wn as L,
3336
- kr as a
3337
- };