gasp-components 1.0.9 → 1.0.11

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 +4 -3
  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,3026 +0,0 @@
1
- import * as a from "react";
2
- import ce, { forwardRef as Lt, useMemo as Lo, useRef as Be, useCallback as Me, useImperativeHandle as Mn, useContext as cn, useState as un, useEffect as Nt, createContext as Ho } from "react";
3
- import { e as J, y as De, G as Pn, s as Nn, x as ue, b as te, N as W, ak as Ko, aa as Rn, _ as ee, i as Se, H as Te, t as Bn, n as Vo, o as Wo, p as Fo, q as Xo, F as qo, g as Go, C as Ze, al as Uo, d as A, am as Yo, an as Zo, h as Dn, m as Rt, j as dn, r as Tn, T as mn, ao as Jo, D as _n, a0 as pn, u as Qo } from "./index-1KQbTQJ2.js";
4
- import { A as pt, i as er, u as An } from "./isVisible-Qi9l15Ty.js";
5
- import { c as K } from "./index-NQd_zMf0.js";
6
- import { T as kn } from "./index-L-MzVDcK.js";
7
- import { K as ve } from "./KeyCode-qFRXB1-n.js";
8
- import { u as qe } from "./useMergedState-qUafLuUa.js";
9
- import { o as we } from "./omit-ylWA0ZLZ.js";
10
- import { u as zn, z as tr } from "./motion-0ToOu81j.js";
11
- import { T as nr, g as or, a as rr, b as ir } from "./index-5Uo03BMk.js";
12
- import { g as ar } from "./PurePanel-hLGnXbul.js";
13
- import { c as ft, i as Ue } from "./reactNode-R20zZQk1.js";
14
- import { F as Ge } from "./Overflow-JFdXKgCr.js";
15
- import { r as lr } from "./index-vtDVJV8q.js";
16
- import { t as jn, N as sr, a as cr } from "./Compact-fdEKV_mF.js";
17
- import { i as ur } from "./motion-NQme0FJ_.js";
18
- import { i as ct, s as dr, a as mr, b as pr, c as fr, d as fn } from "./slide-mFXPRHku.js";
19
- import { i as Ln } from "./zoom-Ps8y0jNW.js";
20
- import { g as vr } from "./collapse-ilv4Tji1.js";
21
- import { u as Hn } from "./useCSSVarCls-GwZT_WiF.js";
22
- import { a as gr } from "./roundedArrow-p1Pmd9av.js";
23
- import { B as vn } from "./button-LN5ZDad8.js";
24
- import { S as br } from "./index-ELHBhuK9.js";
25
- var hr = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, name: "right", theme: "outlined" };
26
- const Cr = hr;
27
- var Kn = function(t, n) {
28
- return /* @__PURE__ */ a.createElement(pt, J({}, t, {
29
- ref: n,
30
- icon: Cr
31
- }));
32
- };
33
- process.env.NODE_ENV !== "production" && (Kn.displayName = "RightOutlined");
34
- const Bt = /* @__PURE__ */ a.forwardRef(Kn);
35
- var $r = ve.ESC, yr = ve.TAB;
36
- function Ir(e) {
37
- var t = e.visible, n = e.triggerRef, r = e.onVisibleChange, o = e.autoFocus, l = e.overlayRef, i = a.useRef(!1), s = function() {
38
- if (t) {
39
- var d, p;
40
- (d = n.current) === null || d === void 0 || (p = d.focus) === null || p === void 0 || p.call(d), r == null || r(!1);
41
- }
42
- }, c = function() {
43
- var d;
44
- return (d = l.current) !== null && d !== void 0 && d.focus ? (l.current.focus(), i.current = !0, !0) : !1;
45
- }, u = function(d) {
46
- switch (d.keyCode) {
47
- case $r:
48
- s();
49
- break;
50
- case yr: {
51
- var p = !1;
52
- i.current || (p = c()), p ? d.preventDefault() : s();
53
- break;
54
- }
55
- }
56
- };
57
- a.useEffect(function() {
58
- return t ? (window.addEventListener("keydown", u), o && De(c, 3), function() {
59
- window.removeEventListener("keydown", u), i.current = !1;
60
- }) : function() {
61
- i.current = !1;
62
- };
63
- }, [t]);
64
- }
65
- var Sr = /* @__PURE__ */ Lt(function(e, t) {
66
- var n = e.overlay, r = e.arrow, o = e.prefixCls, l = Lo(function() {
67
- var s;
68
- return typeof n == "function" ? s = n() : s = n, s;
69
- }, [n]), i = Pn(t, l == null ? void 0 : l.ref);
70
- return /* @__PURE__ */ ce.createElement(ce.Fragment, null, r && /* @__PURE__ */ ce.createElement("div", {
71
- className: "".concat(o, "-arrow")
72
- }), /* @__PURE__ */ ce.cloneElement(l, {
73
- ref: Nn(l) ? i : void 0
74
- }));
75
- }), Pe = {
76
- adjustX: 1,
77
- adjustY: 1
78
- }, Ne = [0, 0], wr = {
79
- topLeft: {
80
- points: ["bl", "tl"],
81
- overflow: Pe,
82
- offset: [0, -4],
83
- targetOffset: Ne
84
- },
85
- top: {
86
- points: ["bc", "tc"],
87
- overflow: Pe,
88
- offset: [0, -4],
89
- targetOffset: Ne
90
- },
91
- topRight: {
92
- points: ["br", "tr"],
93
- overflow: Pe,
94
- offset: [0, -4],
95
- targetOffset: Ne
96
- },
97
- bottomLeft: {
98
- points: ["tl", "bl"],
99
- overflow: Pe,
100
- offset: [0, 4],
101
- targetOffset: Ne
102
- },
103
- bottom: {
104
- points: ["tc", "bc"],
105
- overflow: Pe,
106
- offset: [0, 4],
107
- targetOffset: Ne
108
- },
109
- bottomRight: {
110
- points: ["tr", "br"],
111
- overflow: Pe,
112
- offset: [0, 4],
113
- targetOffset: Ne
114
- }
115
- }, xr = ["arrow", "prefixCls", "transitionName", "animation", "align", "placement", "placements", "getPopupContainer", "showAction", "hideAction", "overlayClassName", "overlayStyle", "visible", "trigger", "autoFocus", "overlay", "children", "onVisibleChange"];
116
- function Or(e, t) {
117
- var n, r = e.arrow, o = r === void 0 ? !1 : r, l = e.prefixCls, i = l === void 0 ? "rc-dropdown" : l, s = e.transitionName, c = e.animation, u = e.align, v = e.placement, d = v === void 0 ? "bottomLeft" : v, p = e.placements, h = p === void 0 ? wr : p, f = e.getPopupContainer, g = e.showAction, $ = e.hideAction, I = e.overlayClassName, y = e.overlayStyle, m = e.visible, C = e.trigger, E = C === void 0 ? ["hover"] : C, w = e.autoFocus, M = e.overlay, S = e.children, N = e.onVisibleChange, O = ue(e, xr), P = ce.useState(), R = te(P, 2), b = R[0], x = R[1], B = "visible" in e ? m : b, k = ce.useRef(null), z = ce.useRef(null), T = ce.useRef(null);
118
- ce.useImperativeHandle(t, function() {
119
- return k.current;
120
- });
121
- var V = function(U) {
122
- x(U), N == null || N(U);
123
- };
124
- Ir({
125
- visible: B,
126
- triggerRef: T,
127
- onVisibleChange: V,
128
- autoFocus: w,
129
- overlayRef: z
130
- });
131
- var L = function(U) {
132
- var re = e.onOverlayClick;
133
- x(!1), re && re(U);
134
- }, q = function() {
135
- return /* @__PURE__ */ ce.createElement(Sr, {
136
- ref: z,
137
- overlay: M,
138
- prefixCls: i,
139
- arrow: o
140
- });
141
- }, Y = function() {
142
- return typeof M == "function" ? q : q();
143
- }, Z = function() {
144
- var U = e.minOverlayWidthMatchTrigger, re = e.alignPoint;
145
- return "minOverlayWidthMatchTrigger" in e ? U : !re;
146
- }, G = function() {
147
- var U = e.openClassName;
148
- return U !== void 0 ? U : "".concat(i, "-open");
149
- }, oe = /* @__PURE__ */ ce.cloneElement(S, {
150
- className: K((n = S.props) === null || n === void 0 ? void 0 : n.className, B && G()),
151
- ref: Nn(S) ? Pn(T, S.ref) : void 0
152
- }), D = $;
153
- return !D && E.indexOf("contextMenu") !== -1 && (D = ["click"]), /* @__PURE__ */ ce.createElement(kn, J({
154
- builtinPlacements: h
155
- }, O, {
156
- prefixCls: i,
157
- ref: k,
158
- popupClassName: K(I, W({}, "".concat(i, "-show-arrow"), o)),
159
- popupStyle: y,
160
- action: E,
161
- showAction: g,
162
- hideAction: D,
163
- popupPlacement: d,
164
- popupAlign: u,
165
- popupTransitionName: s,
166
- popupAnimation: c,
167
- popupVisible: B,
168
- stretch: Z() ? "minWidth" : "",
169
- popup: Y(),
170
- onPopupVisibleChange: V,
171
- onPopupClick: L,
172
- getPopupContainer: f
173
- }), oe);
174
- }
175
- const Er = /* @__PURE__ */ ce.forwardRef(Or);
176
- var Vn = /* @__PURE__ */ a.createContext(null);
177
- function Wn(e, t) {
178
- return e === void 0 ? null : "".concat(e, "-").concat(t);
179
- }
180
- function Fn(e) {
181
- var t = a.useContext(Vn);
182
- return Wn(t, e);
183
- }
184
- var Mr = ["children", "locked"], fe = /* @__PURE__ */ a.createContext(null);
185
- function Pr(e, t) {
186
- var n = ee({}, e);
187
- return Object.keys(t).forEach(function(r) {
188
- var o = t[r];
189
- o !== void 0 && (n[r] = o);
190
- }), n;
191
- }
192
- function Ye(e) {
193
- var t = e.children, n = e.locked, r = ue(e, Mr), o = a.useContext(fe), l = Ko(function() {
194
- return Pr(o, r);
195
- }, [o, r], function(i, s) {
196
- return !n && (i[0] !== s[0] || !Rn(i[1], s[1], !0));
197
- });
198
- return /* @__PURE__ */ a.createElement(fe.Provider, {
199
- value: l
200
- }, t);
201
- }
202
- var Nr = [], Xn = /* @__PURE__ */ a.createContext(null);
203
- function vt() {
204
- return a.useContext(Xn);
205
- }
206
- var qn = /* @__PURE__ */ a.createContext(Nr);
207
- function _e(e) {
208
- var t = a.useContext(qn);
209
- return a.useMemo(function() {
210
- return e !== void 0 ? [].concat(Se(t), [e]) : t;
211
- }, [t, e]);
212
- }
213
- var Gn = /* @__PURE__ */ a.createContext(null), Ht = /* @__PURE__ */ a.createContext({});
214
- function gn(e) {
215
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
216
- if (er(e)) {
217
- var n = e.nodeName.toLowerCase(), r = (
218
- // Focusable element
219
- ["input", "select", "textarea", "button"].includes(n) || // Editable element
220
- e.isContentEditable || // Anchor with href element
221
- n === "a" && !!e.getAttribute("href")
222
- ), o = e.getAttribute("tabindex"), l = Number(o), i = null;
223
- return o && !Number.isNaN(l) ? i = l : r && i === null && (i = 0), r && e.disabled && (i = null), i !== null && (i >= 0 || t && i < 0);
224
- }
225
- return !1;
226
- }
227
- function Rr(e) {
228
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = Se(e.querySelectorAll("*")).filter(function(r) {
229
- return gn(r, t);
230
- });
231
- return gn(e, t) && n.unshift(e), n;
232
- }
233
- var Dt = ve.LEFT, Tt = ve.RIGHT, _t = ve.UP, lt = ve.DOWN, st = ve.ENTER, Un = ve.ESC, We = ve.HOME, Fe = ve.END, bn = [_t, lt, Dt, Tt];
234
- function Br(e, t, n, r) {
235
- var o, l, i, s, c = "prev", u = "next", v = "children", d = "parent";
236
- if (e === "inline" && r === st)
237
- return {
238
- inlineTrigger: !0
239
- };
240
- var p = (o = {}, W(o, _t, c), W(o, lt, u), o), h = (l = {}, W(l, Dt, n ? u : c), W(l, Tt, n ? c : u), W(l, lt, v), W(l, st, v), l), f = (i = {}, W(i, _t, c), W(i, lt, u), W(i, st, v), W(i, Un, d), W(i, Dt, n ? v : d), W(i, Tt, n ? d : v), i), g = {
241
- inline: p,
242
- horizontal: h,
243
- vertical: f,
244
- inlineSub: p,
245
- horizontalSub: f,
246
- verticalSub: f
247
- }, $ = (s = g["".concat(e).concat(t ? "" : "Sub")]) === null || s === void 0 ? void 0 : s[r];
248
- switch ($) {
249
- case c:
250
- return {
251
- offset: -1,
252
- sibling: !0
253
- };
254
- case u:
255
- return {
256
- offset: 1,
257
- sibling: !0
258
- };
259
- case d:
260
- return {
261
- offset: -1,
262
- sibling: !1
263
- };
264
- case v:
265
- return {
266
- offset: 1,
267
- sibling: !1
268
- };
269
- default:
270
- return null;
271
- }
272
- }
273
- function Dr(e) {
274
- for (var t = e; t; ) {
275
- if (t.getAttribute("data-menu-list"))
276
- return t;
277
- t = t.parentElement;
278
- }
279
- return null;
280
- }
281
- function Tr(e, t) {
282
- for (var n = e || document.activeElement; n; ) {
283
- if (t.has(n))
284
- return n;
285
- n = n.parentElement;
286
- }
287
- return null;
288
- }
289
- function Kt(e, t) {
290
- var n = Rr(e, !0);
291
- return n.filter(function(r) {
292
- return t.has(r);
293
- });
294
- }
295
- function hn(e, t, n) {
296
- var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
297
- if (!e)
298
- return null;
299
- var o = Kt(e, t), l = o.length, i = o.findIndex(function(s) {
300
- return n === s;
301
- });
302
- return r < 0 ? i === -1 ? i = l - 1 : i -= 1 : r > 0 && (i += 1), i = (i + l) % l, o[i];
303
- }
304
- var At = function(t, n) {
305
- var r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
306
- return t.forEach(function(i) {
307
- var s = document.querySelector("[data-menu-id='".concat(Wn(n, i), "']"));
308
- s && (r.add(s), l.set(s, i), o.set(i, s));
309
- }), {
310
- elements: r,
311
- key2element: o,
312
- element2key: l
313
- };
314
- };
315
- function _r(e, t, n, r, o, l, i, s, c, u) {
316
- var v = a.useRef(), d = a.useRef();
317
- d.current = t;
318
- var p = function() {
319
- De.cancel(v.current);
320
- };
321
- return a.useEffect(function() {
322
- return function() {
323
- p();
324
- };
325
- }, []), function(h) {
326
- var f = h.which;
327
- if ([].concat(bn, [st, Un, We, Fe]).includes(f)) {
328
- var g = l(), $ = At(g, r), I = $, y = I.elements, m = I.key2element, C = I.element2key, E = m.get(t), w = Tr(E, y), M = C.get(w), S = Br(e, i(M, !0).length === 1, n, f);
329
- if (!S && f !== We && f !== Fe)
330
- return;
331
- (bn.includes(f) || [We, Fe].includes(f)) && h.preventDefault();
332
- var N = function(z) {
333
- if (z) {
334
- var T = z, V = z.querySelector("a");
335
- V != null && V.getAttribute("href") && (T = V);
336
- var L = C.get(z);
337
- s(L), p(), v.current = De(function() {
338
- d.current === L && T.focus();
339
- });
340
- }
341
- };
342
- if ([We, Fe].includes(f) || S.sibling || !w) {
343
- var O;
344
- !w || e === "inline" ? O = o.current : O = Dr(w);
345
- var P, R = Kt(O, y);
346
- f === We ? P = R[0] : f === Fe ? P = R[R.length - 1] : P = hn(O, y, w, S.offset), N(P);
347
- } else if (S.inlineTrigger)
348
- c(M);
349
- else if (S.offset > 0)
350
- c(M, !0), p(), v.current = De(function() {
351
- $ = At(g, r);
352
- var k = w.getAttribute("aria-controls"), z = document.getElementById(k), T = hn(z, $.elements);
353
- N(T);
354
- }, 5);
355
- else if (S.offset < 0) {
356
- var b = i(M, !0), x = b[b.length - 2], B = m.get(x);
357
- c(x, !1), N(B);
358
- }
359
- }
360
- u == null || u(h);
361
- };
362
- }
363
- function Ar(e) {
364
- Promise.resolve().then(e);
365
- }
366
- var Vt = "__RC_UTIL_PATH_SPLIT__", Cn = function(t) {
367
- return t.join(Vt);
368
- }, kr = function(t) {
369
- return t.split(Vt);
370
- }, kt = "rc-menu-more";
371
- function zr() {
372
- var e = a.useState({}), t = te(e, 2), n = t[1], r = Be(/* @__PURE__ */ new Map()), o = Be(/* @__PURE__ */ new Map()), l = a.useState([]), i = te(l, 2), s = i[0], c = i[1], u = Be(0), v = Be(!1), d = function() {
373
- v.current || n({});
374
- }, p = Me(function(m, C) {
375
- process.env.NODE_ENV !== "production" && Te(!r.current.has(m), "Duplicated key '".concat(m, "' used in Menu by path [").concat(C.join(" > "), "]"));
376
- var E = Cn(C);
377
- o.current.set(E, m), r.current.set(m, E), u.current += 1;
378
- var w = u.current;
379
- Ar(function() {
380
- w === u.current && d();
381
- });
382
- }, []), h = Me(function(m, C) {
383
- var E = Cn(C);
384
- o.current.delete(E), r.current.delete(m);
385
- }, []), f = Me(function(m) {
386
- c(m);
387
- }, []), g = Me(function(m, C) {
388
- var E = r.current.get(m) || "", w = kr(E);
389
- return C && s.includes(w[0]) && w.unshift(kt), w;
390
- }, [s]), $ = Me(function(m, C) {
391
- return m.some(function(E) {
392
- var w = g(E, !0);
393
- return w.includes(C);
394
- });
395
- }, [g]), I = function() {
396
- var C = Se(r.current.keys());
397
- return s.length && C.push(kt), C;
398
- }, y = Me(function(m) {
399
- var C = "".concat(r.current.get(m)).concat(Vt), E = /* @__PURE__ */ new Set();
400
- return Se(o.current.keys()).forEach(function(w) {
401
- w.startsWith(C) && E.add(o.current.get(w));
402
- }), E;
403
- }, []);
404
- return a.useEffect(function() {
405
- return function() {
406
- v.current = !0;
407
- };
408
- }, []), {
409
- // Register
410
- registerPath: p,
411
- unregisterPath: h,
412
- refreshOverflowKeys: f,
413
- // Util
414
- isSubPathKey: $,
415
- getKeyPath: g,
416
- getKeys: I,
417
- getSubPathKeys: y
418
- };
419
- }
420
- function Xe(e) {
421
- var t = a.useRef(e);
422
- t.current = e;
423
- var n = a.useCallback(function() {
424
- for (var r, o = arguments.length, l = new Array(o), i = 0; i < o; i++)
425
- l[i] = arguments[i];
426
- return (r = t.current) === null || r === void 0 ? void 0 : r.call.apply(r, [t].concat(l));
427
- }, []);
428
- return e ? n : void 0;
429
- }
430
- var jr = Math.random().toFixed(5).toString().slice(2), $n = 0;
431
- function Lr(e) {
432
- var t = qe(e, {
433
- value: e
434
- }), n = te(t, 2), r = n[0], o = n[1];
435
- return a.useEffect(function() {
436
- $n += 1;
437
- var l = process.env.NODE_ENV === "test" ? "test" : "".concat(jr, "-").concat($n);
438
- o("rc-menu-uuid-".concat(l));
439
- }, []), r;
440
- }
441
- function Yn(e, t, n, r) {
442
- var o = a.useContext(fe), l = o.activeKey, i = o.onActive, s = o.onInactive, c = {
443
- active: l === e
444
- };
445
- return t || (c.onMouseEnter = function(u) {
446
- n == null || n({
447
- key: e,
448
- domEvent: u
449
- }), i(e);
450
- }, c.onMouseLeave = function(u) {
451
- r == null || r({
452
- key: e,
453
- domEvent: u
454
- }), s(e);
455
- }), c;
456
- }
457
- function Zn(e) {
458
- var t = a.useContext(fe), n = t.mode, r = t.rtl, o = t.inlineIndent;
459
- if (n !== "inline")
460
- return null;
461
- var l = e;
462
- return r ? {
463
- paddingRight: l * o
464
- } : {
465
- paddingLeft: l * o
466
- };
467
- }
468
- function Jn(e) {
469
- var t = e.icon, n = e.props, r = e.children, o;
470
- return t === null || t === !1 ? null : (typeof t == "function" ? o = /* @__PURE__ */ a.createElement(t, ee({}, n)) : typeof t != "boolean" && (o = t), o || r || null);
471
- }
472
- var Hr = ["item"];
473
- function ut(e) {
474
- var t = e.item, n = ue(e, Hr);
475
- return Object.defineProperty(n, "item", {
476
- get: function() {
477
- return Te(!1, "`info.item` is deprecated since we will move to function component that not provides React Node instance in future."), t;
478
- }
479
- }), n;
480
- }
481
- var Kr = ["title", "attribute", "elementRef"], Vr = ["style", "className", "eventKey", "warnKey", "disabled", "itemIcon", "children", "role", "onMouseEnter", "onMouseLeave", "onClick", "onKeyDown", "onFocus"], Wr = ["active"], Fr = /* @__PURE__ */ function(e) {
482
- Vo(n, e);
483
- var t = Wo(n);
484
- function n() {
485
- return Fo(this, n), t.apply(this, arguments);
486
- }
487
- return Xo(n, [{
488
- key: "render",
489
- value: function() {
490
- var o = this.props, l = o.title, i = o.attribute, s = o.elementRef, c = ue(o, Kr), u = we(c, ["eventKey", "popupClassName", "popupOffset", "onTitleClick"]);
491
- return Te(!i, "`attribute` of Menu.Item is deprecated. Please pass attribute directly."), /* @__PURE__ */ a.createElement(Ge.Item, J({}, i, {
492
- title: typeof l == "string" ? l : void 0
493
- }, u, {
494
- ref: s
495
- }));
496
- }
497
- }]), n;
498
- }(a.Component), Xr = /* @__PURE__ */ a.forwardRef(function(e, t) {
499
- var n, r = e.style, o = e.className, l = e.eventKey, i = e.warnKey, s = e.disabled, c = e.itemIcon, u = e.children, v = e.role, d = e.onMouseEnter, p = e.onMouseLeave, h = e.onClick, f = e.onKeyDown, g = e.onFocus, $ = ue(e, Vr), I = Fn(l), y = a.useContext(fe), m = y.prefixCls, C = y.onItemClick, E = y.disabled, w = y.overflowDisabled, M = y.itemIcon, S = y.selectedKeys, N = y.onActive, O = a.useContext(Ht), P = O._internalRenderMenuItem, R = "".concat(m, "-item"), b = a.useRef(), x = a.useRef(), B = E || s, k = Bn(t, x), z = _e(l);
500
- process.env.NODE_ENV !== "production" && i && Te(!1, "MenuItem should not leave undefined `key`.");
501
- var T = function(Q) {
502
- return {
503
- key: l,
504
- // Note: For legacy code is reversed which not like other antd component
505
- keyPath: Se(z).reverse(),
506
- item: b.current,
507
- domEvent: Q
508
- };
509
- }, V = c || M, L = Yn(l, B, d, p), q = L.active, Y = ue(L, Wr), Z = S.includes(l), G = Zn(z.length), oe = function(Q) {
510
- if (!B) {
511
- var ie = T(Q);
512
- h == null || h(ut(ie)), C(ie);
513
- }
514
- }, D = function(Q) {
515
- if (f == null || f(Q), Q.which === ve.ENTER) {
516
- var ie = T(Q);
517
- h == null || h(ut(ie)), C(ie);
518
- }
519
- }, F = function(Q) {
520
- N(l), g == null || g(Q);
521
- }, U = {};
522
- e.role === "option" && (U["aria-selected"] = Z);
523
- var re = /* @__PURE__ */ a.createElement(Fr, J({
524
- ref: b,
525
- elementRef: k,
526
- role: v === null ? "none" : v || "menuitem",
527
- tabIndex: s ? null : -1,
528
- "data-menu-id": w && I ? null : I
529
- }, $, Y, U, {
530
- component: "li",
531
- "aria-disabled": s,
532
- style: ee(ee({}, G), r),
533
- className: K(R, (n = {}, W(n, "".concat(R, "-active"), q), W(n, "".concat(R, "-selected"), Z), W(n, "".concat(R, "-disabled"), B), n), o),
534
- onClick: oe,
535
- onKeyDown: D,
536
- onFocus: F
537
- }), u, /* @__PURE__ */ a.createElement(Jn, {
538
- props: ee(ee({}, e), {}, {
539
- isSelected: Z
540
- }),
541
- icon: V
542
- }));
543
- return P && (re = P(re, e, {
544
- selected: Z
545
- })), re;
546
- });
547
- function qr(e, t) {
548
- var n = e.eventKey, r = vt(), o = _e(n);
549
- return a.useEffect(function() {
550
- if (r)
551
- return r.registerPath(n, o), function() {
552
- r.unregisterPath(n, o);
553
- };
554
- }, [o]), r ? null : /* @__PURE__ */ a.createElement(Xr, J({}, e, {
555
- ref: t
556
- }));
557
- }
558
- const gt = /* @__PURE__ */ a.forwardRef(qr);
559
- var Gr = ["className", "children"], Ur = function(t, n) {
560
- var r = t.className, o = t.children, l = ue(t, Gr), i = a.useContext(fe), s = i.prefixCls, c = i.mode, u = i.rtl;
561
- return /* @__PURE__ */ a.createElement("ul", J({
562
- className: K(s, u && "".concat(s, "-rtl"), "".concat(s, "-sub"), "".concat(s, "-").concat(c === "inline" ? "inline" : "vertical"), r),
563
- role: "menu"
564
- }, l, {
565
- "data-menu-list": !0,
566
- ref: n
567
- }), o);
568
- }, Wt = /* @__PURE__ */ a.forwardRef(Ur);
569
- Wt.displayName = "SubMenuList";
570
- function Ft(e, t) {
571
- return jn(e).map(function(n, r) {
572
- if (/* @__PURE__ */ a.isValidElement(n)) {
573
- var o, l, i = n.key, s = (o = (l = n.props) === null || l === void 0 ? void 0 : l.eventKey) !== null && o !== void 0 ? o : i, c = s == null;
574
- c && (s = "tmp_key-".concat([].concat(Se(t), [r]).join("-")));
575
- var u = {
576
- key: s,
577
- eventKey: s
578
- };
579
- return process.env.NODE_ENV !== "production" && c && (u.warnKey = !0), /* @__PURE__ */ a.cloneElement(n, u);
580
- }
581
- return n;
582
- });
583
- }
584
- var ne = {
585
- adjustX: 1,
586
- adjustY: 1
587
- }, Yr = {
588
- topLeft: {
589
- points: ["bl", "tl"],
590
- overflow: ne
591
- },
592
- topRight: {
593
- points: ["br", "tr"],
594
- overflow: ne
595
- },
596
- bottomLeft: {
597
- points: ["tl", "bl"],
598
- overflow: ne
599
- },
600
- bottomRight: {
601
- points: ["tr", "br"],
602
- overflow: ne
603
- },
604
- leftTop: {
605
- points: ["tr", "tl"],
606
- overflow: ne
607
- },
608
- leftBottom: {
609
- points: ["br", "bl"],
610
- overflow: ne
611
- },
612
- rightTop: {
613
- points: ["tl", "tr"],
614
- overflow: ne
615
- },
616
- rightBottom: {
617
- points: ["bl", "br"],
618
- overflow: ne
619
- }
620
- }, Zr = {
621
- topLeft: {
622
- points: ["bl", "tl"],
623
- overflow: ne
624
- },
625
- topRight: {
626
- points: ["br", "tr"],
627
- overflow: ne
628
- },
629
- bottomLeft: {
630
- points: ["tl", "bl"],
631
- overflow: ne
632
- },
633
- bottomRight: {
634
- points: ["tr", "br"],
635
- overflow: ne
636
- },
637
- rightTop: {
638
- points: ["tr", "tl"],
639
- overflow: ne
640
- },
641
- rightBottom: {
642
- points: ["br", "bl"],
643
- overflow: ne
644
- },
645
- leftTop: {
646
- points: ["tl", "tr"],
647
- overflow: ne
648
- },
649
- leftBottom: {
650
- points: ["bl", "br"],
651
- overflow: ne
652
- }
653
- };
654
- function Qn(e, t, n) {
655
- if (t)
656
- return t;
657
- if (n)
658
- return n[e] || n.other;
659
- }
660
- var Jr = {
661
- horizontal: "bottomLeft",
662
- vertical: "rightTop",
663
- "vertical-left": "rightTop",
664
- "vertical-right": "leftTop"
665
- };
666
- function Qr(e) {
667
- var t = e.prefixCls, n = e.visible, r = e.children, o = e.popup, l = e.popupStyle, i = e.popupClassName, s = e.popupOffset, c = e.disabled, u = e.mode, v = e.onVisibleChange, d = a.useContext(fe), p = d.getPopupContainer, h = d.rtl, f = d.subMenuOpenDelay, g = d.subMenuCloseDelay, $ = d.builtinPlacements, I = d.triggerSubMenuAction, y = d.forceSubMenuRender, m = d.rootClassName, C = d.motion, E = d.defaultMotions, w = a.useState(!1), M = te(w, 2), S = M[0], N = M[1], O = h ? ee(ee({}, Zr), $) : ee(ee({}, Yr), $), P = Jr[u], R = Qn(u, C, E), b = a.useRef(R);
668
- u !== "inline" && (b.current = R);
669
- var x = ee(ee({}, b.current), {}, {
670
- leavedClassName: "".concat(t, "-hidden"),
671
- removeOnLeave: !1,
672
- motionAppear: !0
673
- }), B = a.useRef();
674
- return a.useEffect(function() {
675
- return B.current = De(function() {
676
- N(n);
677
- }), function() {
678
- De.cancel(B.current);
679
- };
680
- }, [n]), /* @__PURE__ */ a.createElement(kn, {
681
- prefixCls: t,
682
- popupClassName: K("".concat(t, "-popup"), W({}, "".concat(t, "-rtl"), h), i, m),
683
- stretch: u === "horizontal" ? "minWidth" : null,
684
- getPopupContainer: p,
685
- builtinPlacements: O,
686
- popupPlacement: P,
687
- popupVisible: S,
688
- popup: o,
689
- popupStyle: l,
690
- popupAlign: s && {
691
- offset: s
692
- },
693
- action: c ? [] : [I],
694
- mouseEnterDelay: f,
695
- mouseLeaveDelay: g,
696
- onPopupVisibleChange: v,
697
- forceRender: y,
698
- popupMotion: x,
699
- fresh: !0
700
- }, r);
701
- }
702
- function ei(e) {
703
- var t = e.id, n = e.open, r = e.keyPath, o = e.children, l = "inline", i = a.useContext(fe), s = i.prefixCls, c = i.forceSubMenuRender, u = i.motion, v = i.defaultMotions, d = i.mode, p = a.useRef(!1);
704
- p.current = d === l;
705
- var h = a.useState(!p.current), f = te(h, 2), g = f[0], $ = f[1], I = p.current ? n : !1;
706
- a.useEffect(function() {
707
- p.current && $(!1);
708
- }, [d]);
709
- var y = ee({}, Qn(l, u, v));
710
- r.length > 1 && (y.motionAppear = !1);
711
- var m = y.onVisibleChanged;
712
- return y.onVisibleChanged = function(C) {
713
- return !p.current && !C && $(!0), m == null ? void 0 : m(C);
714
- }, g ? null : /* @__PURE__ */ a.createElement(Ye, {
715
- mode: l,
716
- locked: !p.current
717
- }, /* @__PURE__ */ a.createElement(qo, J({
718
- visible: I
719
- }, y, {
720
- forceRender: c,
721
- removeOnLeave: !1,
722
- leavedClassName: "".concat(s, "-hidden")
723
- }), function(C) {
724
- var E = C.className, w = C.style;
725
- return /* @__PURE__ */ a.createElement(Wt, {
726
- id: t,
727
- className: E,
728
- style: w
729
- }, o);
730
- }));
731
- }
732
- var ti = ["style", "className", "title", "eventKey", "warnKey", "disabled", "internalPopupClose", "children", "itemIcon", "expandIcon", "popupClassName", "popupOffset", "popupStyle", "onClick", "onMouseEnter", "onMouseLeave", "onTitleClick", "onTitleMouseEnter", "onTitleMouseLeave"], ni = ["active"], oi = function(t) {
733
- var n, r = t.style, o = t.className, l = t.title, i = t.eventKey, s = t.warnKey, c = t.disabled, u = t.internalPopupClose, v = t.children, d = t.itemIcon, p = t.expandIcon, h = t.popupClassName, f = t.popupOffset, g = t.popupStyle, $ = t.onClick, I = t.onMouseEnter, y = t.onMouseLeave, m = t.onTitleClick, C = t.onTitleMouseEnter, E = t.onTitleMouseLeave, w = ue(t, ti), M = Fn(i), S = a.useContext(fe), N = S.prefixCls, O = S.mode, P = S.openKeys, R = S.disabled, b = S.overflowDisabled, x = S.activeKey, B = S.selectedKeys, k = S.itemIcon, z = S.expandIcon, T = S.onItemClick, V = S.onOpenChange, L = S.onActive, q = a.useContext(Ht), Y = q._internalRenderSubMenuItem, Z = a.useContext(Gn), G = Z.isSubPathKey, oe = _e(), D = "".concat(N, "-submenu"), F = R || c, U = a.useRef(), re = a.useRef();
734
- process.env.NODE_ENV !== "production" && s && Te(!1, "SubMenu should not leave undefined `key`.");
735
- var ge = d ?? k, Q = p ?? z, ie = P.includes(i), _ = !b && ie, de = G(B, i), ae = Yn(i, F, C, E), $e = ae.active, $t = ue(ae, ni), yt = a.useState(!1), Qe = te(yt, 2), ke = Qe[0], et = Qe[1], tt = function(pe) {
736
- F || et(pe);
737
- }, be = function(pe) {
738
- tt(!0), I == null || I({
739
- key: i,
740
- domEvent: pe
741
- });
742
- }, It = function(pe) {
743
- tt(!1), y == null || y({
744
- key: i,
745
- domEvent: pe
746
- });
747
- }, ze = a.useMemo(function() {
748
- return $e || (O !== "inline" ? ke || G([x], i) : !1);
749
- }, [O, $e, x, ke, i, G]), nt = Zn(oe.length), St = function(pe) {
750
- F || (m == null || m({
751
- key: i,
752
- domEvent: pe
753
- }), O === "inline" && V(i, !ie));
754
- }, xe = Xe(function(he) {
755
- $ == null || $(ut(he)), T(he);
756
- }), je = function(pe) {
757
- O !== "inline" && V(i, pe);
758
- }, Le = function() {
759
- L(i);
760
- }, He = M && "".concat(M, "-popup"), Oe = /* @__PURE__ */ a.createElement("div", J({
761
- role: "menuitem",
762
- style: nt,
763
- className: "".concat(D, "-title"),
764
- tabIndex: F ? null : -1,
765
- ref: U,
766
- title: typeof l == "string" ? l : null,
767
- "data-menu-id": b && M ? null : M,
768
- "aria-expanded": _,
769
- "aria-haspopup": !0,
770
- "aria-controls": He,
771
- "aria-disabled": F,
772
- onClick: St,
773
- onFocus: Le
774
- }, $t), l, /* @__PURE__ */ a.createElement(Jn, {
775
- icon: O !== "horizontal" ? Q : void 0,
776
- props: ee(ee({}, t), {}, {
777
- isOpen: _,
778
- // [Legacy] Not sure why need this mark
779
- isSubMenu: !0
780
- })
781
- }, /* @__PURE__ */ a.createElement("i", {
782
- className: "".concat(D, "-arrow")
783
- }))), me = a.useRef(O);
784
- if (O !== "inline" && oe.length > 1 ? me.current = "vertical" : me.current = O, !b) {
785
- var Ee = me.current;
786
- Oe = /* @__PURE__ */ a.createElement(Qr, {
787
- mode: Ee,
788
- prefixCls: D,
789
- visible: !u && _ && O !== "inline",
790
- popupClassName: h,
791
- popupOffset: f,
792
- popupStyle: g,
793
- popup: /* @__PURE__ */ a.createElement(
794
- Ye,
795
- {
796
- mode: Ee === "horizontal" ? "vertical" : Ee
797
- },
798
- /* @__PURE__ */ a.createElement(Wt, {
799
- id: He,
800
- ref: re
801
- }, v)
802
- ),
803
- disabled: F,
804
- onVisibleChange: je
805
- }, Oe);
806
- }
807
- var ye = /* @__PURE__ */ a.createElement(Ge.Item, J({
808
- role: "none"
809
- }, w, {
810
- component: "li",
811
- style: r,
812
- className: K(D, "".concat(D, "-").concat(O), o, (n = {}, W(n, "".concat(D, "-open"), _), W(n, "".concat(D, "-active"), ze), W(n, "".concat(D, "-selected"), de), W(n, "".concat(D, "-disabled"), F), n)),
813
- onMouseEnter: be,
814
- onMouseLeave: It
815
- }), Oe, !b && /* @__PURE__ */ a.createElement(ei, {
816
- id: He,
817
- open: _,
818
- keyPath: oe
819
- }, v));
820
- return Y && (ye = Y(ye, t, {
821
- selected: de,
822
- active: ze,
823
- open: _,
824
- disabled: F
825
- })), /* @__PURE__ */ a.createElement(Ye, {
826
- onItemClick: xe,
827
- mode: O === "horizontal" ? "vertical" : O,
828
- itemIcon: ge,
829
- expandIcon: Q
830
- }, ye);
831
- };
832
- function bt(e) {
833
- var t = e.eventKey, n = e.children, r = _e(t), o = Ft(n, r), l = vt();
834
- a.useEffect(function() {
835
- if (l)
836
- return l.registerPath(t, r), function() {
837
- l.unregisterPath(t, r);
838
- };
839
- }, [r]);
840
- var i;
841
- return l ? i = o : i = /* @__PURE__ */ a.createElement(oi, e, o), /* @__PURE__ */ a.createElement(qn.Provider, {
842
- value: r
843
- }, i);
844
- }
845
- var ri = ["className", "title", "eventKey", "children"], ii = ["children"], ai = function(t) {
846
- var n = t.className, r = t.title;
847
- t.eventKey;
848
- var o = t.children, l = ue(t, ri), i = a.useContext(fe), s = i.prefixCls, c = "".concat(s, "-item-group");
849
- return /* @__PURE__ */ a.createElement("li", J({
850
- role: "presentation"
851
- }, l, {
852
- onClick: function(v) {
853
- return v.stopPropagation();
854
- },
855
- className: K(c, n)
856
- }), /* @__PURE__ */ a.createElement("div", {
857
- role: "presentation",
858
- className: "".concat(c, "-title"),
859
- title: typeof r == "string" ? r : void 0
860
- }, r), /* @__PURE__ */ a.createElement("ul", {
861
- role: "group",
862
- className: "".concat(c, "-list")
863
- }, o));
864
- };
865
- function ht(e) {
866
- var t = e.children, n = ue(e, ii), r = _e(n.eventKey), o = Ft(t, r), l = vt();
867
- return l ? o : /* @__PURE__ */ a.createElement(ai, we(n, ["warnKey"]), o);
868
- }
869
- function Xt(e) {
870
- var t = e.className, n = e.style, r = a.useContext(fe), o = r.prefixCls, l = vt();
871
- return l ? null : /* @__PURE__ */ a.createElement("li", {
872
- role: "separator",
873
- className: K("".concat(o, "-item-divider"), t),
874
- style: n
875
- });
876
- }
877
- var li = ["label", "children", "key", "type"];
878
- function zt(e) {
879
- return (e || []).map(function(t, n) {
880
- if (t && Go(t) === "object") {
881
- var r = t, o = r.label, l = r.children, i = r.key, s = r.type, c = ue(r, li), u = i ?? "tmp-".concat(n);
882
- return l || s === "group" ? s === "group" ? /* @__PURE__ */ a.createElement(ht, J({
883
- key: u
884
- }, c, {
885
- title: o
886
- }), zt(l)) : /* @__PURE__ */ a.createElement(bt, J({
887
- key: u
888
- }, c, {
889
- title: o
890
- }), zt(l)) : s === "divider" ? /* @__PURE__ */ a.createElement(Xt, J({
891
- key: u
892
- }, c)) : /* @__PURE__ */ a.createElement(gt, J({
893
- key: u
894
- }, c), o);
895
- }
896
- return null;
897
- }).filter(function(t) {
898
- return t;
899
- });
900
- }
901
- function si(e, t, n) {
902
- var r = e;
903
- return t && (r = zt(t)), Ft(r, n);
904
- }
905
- var ci = ["prefixCls", "rootClassName", "style", "className", "tabIndex", "items", "children", "direction", "id", "mode", "inlineCollapsed", "disabled", "disabledOverflow", "subMenuOpenDelay", "subMenuCloseDelay", "forceSubMenuRender", "defaultOpenKeys", "openKeys", "activeKey", "defaultActiveFirst", "selectable", "multiple", "defaultSelectedKeys", "selectedKeys", "onSelect", "onDeselect", "inlineIndent", "motion", "defaultMotions", "triggerSubMenuAction", "builtinPlacements", "itemIcon", "expandIcon", "overflowedIndicator", "overflowedIndicatorPopupClassName", "getPopupContainer", "onClick", "onOpenChange", "onKeyDown", "openAnimation", "openTransitionName", "_internalRenderMenuItem", "_internalRenderSubMenuItem"], Re = [], ui = /* @__PURE__ */ a.forwardRef(function(e, t) {
906
- var n, r, o = e, l = o.prefixCls, i = l === void 0 ? "rc-menu" : l, s = o.rootClassName, c = o.style, u = o.className, v = o.tabIndex, d = v === void 0 ? 0 : v, p = o.items, h = o.children, f = o.direction, g = o.id, $ = o.mode, I = $ === void 0 ? "vertical" : $, y = o.inlineCollapsed, m = o.disabled, C = o.disabledOverflow, E = o.subMenuOpenDelay, w = E === void 0 ? 0.1 : E, M = o.subMenuCloseDelay, S = M === void 0 ? 0.1 : M, N = o.forceSubMenuRender, O = o.defaultOpenKeys, P = o.openKeys, R = o.activeKey, b = o.defaultActiveFirst, x = o.selectable, B = x === void 0 ? !0 : x, k = o.multiple, z = k === void 0 ? !1 : k, T = o.defaultSelectedKeys, V = o.selectedKeys, L = o.onSelect, q = o.onDeselect, Y = o.inlineIndent, Z = Y === void 0 ? 24 : Y, G = o.motion, oe = o.defaultMotions, D = o.triggerSubMenuAction, F = D === void 0 ? "hover" : D, U = o.builtinPlacements, re = o.itemIcon, ge = o.expandIcon, Q = o.overflowedIndicator, ie = Q === void 0 ? "..." : Q, _ = o.overflowedIndicatorPopupClassName, de = o.getPopupContainer, ae = o.onClick, $e = o.onOpenChange, $t = o.onKeyDown, yt = o.openAnimation, Qe = o.openTransitionName, ke = o._internalRenderMenuItem, et = o._internalRenderSubMenuItem, tt = ue(o, ci), be = a.useMemo(function() {
907
- return si(h, p, Re);
908
- }, [h, p]), It = a.useState(!1), ze = te(It, 2), nt = ze[0], St = ze[1], xe = a.useRef(), je = Lr(g), Le = f === "rtl";
909
- process.env.NODE_ENV !== "production" && Te(!yt && !Qe, "`openAnimation` and `openTransitionName` is removed. Please use `motion` or `defaultMotion` instead.");
910
- var He = qe(O, {
911
- value: P,
912
- postState: function(j) {
913
- return j || Re;
914
- }
915
- }), Oe = te(He, 2), me = Oe[0], Ee = Oe[1], ye = function(j) {
916
- var H = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
917
- function le() {
918
- Ee(j), $e == null || $e(j);
919
- }
920
- H ? lr.flushSync(le) : le();
921
- }, he = a.useState(me), pe = te(he, 2), uo = pe[0], mo = pe[1], wt = a.useRef(!1), po = a.useMemo(function() {
922
- return (I === "inline" || I === "vertical") && y ? ["vertical", y] : [I, !1];
923
- }, [I, y]), Gt = te(po, 2), ot = Gt[0], xt = Gt[1], Ut = ot === "inline", fo = a.useState(ot), Yt = te(fo, 2), Ce = Yt[0], vo = Yt[1], go = a.useState(xt), Zt = te(go, 2), bo = Zt[0], ho = Zt[1];
924
- a.useEffect(function() {
925
- vo(ot), ho(xt), wt.current && (Ut ? Ee(uo) : ye(Re));
926
- }, [ot, xt]);
927
- var Co = a.useState(0), Jt = te(Co, 2), rt = Jt[0], $o = Jt[1], Ot = rt >= be.length - 1 || Ce !== "horizontal" || C;
928
- a.useEffect(function() {
929
- Ut && mo(me);
930
- }, [me]), a.useEffect(function() {
931
- return wt.current = !0, function() {
932
- wt.current = !1;
933
- };
934
- }, []);
935
- var Ie = zr(), Qt = Ie.registerPath, en = Ie.unregisterPath, yo = Ie.refreshOverflowKeys, tn = Ie.isSubPathKey, Io = Ie.getKeyPath, nn = Ie.getKeys, So = Ie.getSubPathKeys, wo = a.useMemo(function() {
936
- return {
937
- registerPath: Qt,
938
- unregisterPath: en
939
- };
940
- }, [Qt, en]), xo = a.useMemo(function() {
941
- return {
942
- isSubPathKey: tn
943
- };
944
- }, [tn]);
945
- a.useEffect(function() {
946
- yo(Ot ? Re : be.slice(rt + 1).map(function(X) {
947
- return X.key;
948
- }));
949
- }, [rt, Ot]);
950
- var Oo = qe(R || b && ((n = be[0]) === null || n === void 0 ? void 0 : n.key), {
951
- value: R
952
- }), on = te(Oo, 2), Ke = on[0], Et = on[1], Eo = Xe(function(X) {
953
- Et(X);
954
- }), Mo = Xe(function() {
955
- Et(void 0);
956
- });
957
- Mn(t, function() {
958
- return {
959
- list: xe.current,
960
- focus: function(j) {
961
- var H, le = nn(), se = At(le, je), at = se.elements, Mt = se.key2element, zo = se.element2key, ln = Kt(xe.current, at), sn = Ke ?? (ln[0] ? zo.get(ln[0]) : (H = be.find(function(jo) {
962
- return !jo.props.disabled;
963
- })) === null || H === void 0 ? void 0 : H.key), Ve = Mt.get(sn);
964
- if (sn && Ve) {
965
- var Pt;
966
- Ve == null || (Pt = Ve.focus) === null || Pt === void 0 || Pt.call(Ve, j);
967
- }
968
- }
969
- };
970
- });
971
- var Po = qe(T || [], {
972
- value: V,
973
- // Legacy convert key to array
974
- postState: function(j) {
975
- return Array.isArray(j) ? j : j == null ? Re : [j];
976
- }
977
- }), rn = te(Po, 2), it = rn[0], No = rn[1], Ro = function(j) {
978
- if (B) {
979
- var H = j.key, le = it.includes(H), se;
980
- z ? le ? se = it.filter(function(Mt) {
981
- return Mt !== H;
982
- }) : se = [].concat(Se(it), [H]) : se = [H], No(se);
983
- var at = ee(ee({}, j), {}, {
984
- selectedKeys: se
985
- });
986
- le ? q == null || q(at) : L == null || L(at);
987
- }
988
- !z && me.length && Ce !== "inline" && ye(Re);
989
- }, Bo = Xe(function(X) {
990
- ae == null || ae(ut(X)), Ro(X);
991
- }), an = Xe(function(X, j) {
992
- var H = me.filter(function(se) {
993
- return se !== X;
994
- });
995
- if (j)
996
- H.push(X);
997
- else if (Ce !== "inline") {
998
- var le = So(X);
999
- H = H.filter(function(se) {
1000
- return !le.has(se);
1001
- });
1002
- }
1003
- Rn(me, H, !0) || ye(H, !0);
1004
- }), Do = function(j, H) {
1005
- var le = H ?? !me.includes(j);
1006
- an(j, le);
1007
- }, To = _r(Ce, Ke, Le, je, xe, nn, Io, Et, Do, $t);
1008
- a.useEffect(function() {
1009
- St(!0);
1010
- }, []);
1011
- var _o = a.useMemo(function() {
1012
- return {
1013
- _internalRenderMenuItem: ke,
1014
- _internalRenderSubMenuItem: et
1015
- };
1016
- }, [ke, et]), Ao = Ce !== "horizontal" || C ? be : (
1017
- // Need wrap for overflow dropdown that do not response for open
1018
- be.map(function(X, j) {
1019
- return (
1020
- // Always wrap provider to avoid sub node re-mount
1021
- /* @__PURE__ */ a.createElement(Ye, {
1022
- key: X.key,
1023
- overflowDisabled: j > rt
1024
- }, X)
1025
- );
1026
- })
1027
- ), ko = /* @__PURE__ */ a.createElement(Ge, J({
1028
- id: g,
1029
- ref: xe,
1030
- prefixCls: "".concat(i, "-overflow"),
1031
- component: "ul",
1032
- itemComponent: gt,
1033
- className: K(i, "".concat(i, "-root"), "".concat(i, "-").concat(Ce), u, (r = {}, W(r, "".concat(i, "-inline-collapsed"), bo), W(r, "".concat(i, "-rtl"), Le), r), s),
1034
- dir: f,
1035
- style: c,
1036
- role: "menu",
1037
- tabIndex: d,
1038
- data: Ao,
1039
- renderRawItem: function(j) {
1040
- return j;
1041
- },
1042
- renderRawRest: function(j) {
1043
- var H = j.length, le = H ? be.slice(-H) : null;
1044
- return /* @__PURE__ */ a.createElement(bt, {
1045
- eventKey: kt,
1046
- title: ie,
1047
- disabled: Ot,
1048
- internalPopupClose: H === 0,
1049
- popupClassName: _
1050
- }, le);
1051
- },
1052
- maxCount: Ce !== "horizontal" || C ? Ge.INVALIDATE : Ge.RESPONSIVE,
1053
- ssr: "full",
1054
- "data-menu-list": !0,
1055
- onVisibleChange: function(j) {
1056
- $o(j);
1057
- },
1058
- onKeyDown: To
1059
- }, tt));
1060
- return /* @__PURE__ */ a.createElement(Ht.Provider, {
1061
- value: _o
1062
- }, /* @__PURE__ */ a.createElement(Vn.Provider, {
1063
- value: je
1064
- }, /* @__PURE__ */ a.createElement(Ye, {
1065
- prefixCls: i,
1066
- rootClassName: s,
1067
- mode: Ce,
1068
- openKeys: me,
1069
- rtl: Le,
1070
- disabled: m,
1071
- motion: nt ? G : null,
1072
- defaultMotions: nt ? oe : null,
1073
- activeKey: Ke,
1074
- onActive: Eo,
1075
- onInactive: Mo,
1076
- selectedKeys: it,
1077
- inlineIndent: Z,
1078
- subMenuOpenDelay: w,
1079
- subMenuCloseDelay: S,
1080
- forceSubMenuRender: N,
1081
- builtinPlacements: U,
1082
- triggerSubMenuAction: F,
1083
- getPopupContainer: de,
1084
- itemIcon: re,
1085
- expandIcon: ge,
1086
- onItemClick: Bo,
1087
- onOpenChange: an
1088
- }, /* @__PURE__ */ a.createElement(Gn.Provider, {
1089
- value: xo
1090
- }, ko), /* @__PURE__ */ a.createElement("div", {
1091
- style: {
1092
- display: "none"
1093
- },
1094
- "aria-hidden": !0
1095
- }, /* @__PURE__ */ a.createElement(Xn.Provider, {
1096
- value: wo
1097
- }, be)))));
1098
- }), Je = ui;
1099
- Je.Item = gt;
1100
- Je.SubMenu = bt;
1101
- Je.ItemGroup = ht;
1102
- Je.Divider = Xt;
1103
- var di = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, name: "bars", theme: "outlined" };
1104
- const mi = di;
1105
- var eo = function(t, n) {
1106
- return /* @__PURE__ */ a.createElement(pt, J({}, t, {
1107
- ref: n,
1108
- icon: mi
1109
- }));
1110
- };
1111
- process.env.NODE_ENV !== "production" && (eo.displayName = "BarsOutlined");
1112
- const pi = /* @__PURE__ */ a.forwardRef(eo);
1113
- var fi = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, name: "left", theme: "outlined" };
1114
- const vi = fi;
1115
- var to = function(t, n) {
1116
- return /* @__PURE__ */ a.createElement(pt, J({}, t, {
1117
- ref: n,
1118
- icon: vi
1119
- }));
1120
- };
1121
- process.env.NODE_ENV !== "production" && (to.displayName = "LeftOutlined");
1122
- const yn = /* @__PURE__ */ a.forwardRef(to), gi = (e) => !isNaN(parseFloat(e)) && isFinite(e), bi = /* @__PURE__ */ a.createContext({
1123
- siderHook: {
1124
- addSider: () => null,
1125
- removeSider: () => null
1126
- }
1127
- });
1128
- var hi = function(e, t) {
1129
- var n = {};
1130
- for (var r in e)
1131
- Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
1132
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1133
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
1134
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
1135
- return n;
1136
- };
1137
- const In = {
1138
- xs: "479.98px",
1139
- sm: "575.98px",
1140
- md: "767.98px",
1141
- lg: "991.98px",
1142
- xl: "1199.98px",
1143
- xxl: "1599.98px"
1144
- }, qt = /* @__PURE__ */ a.createContext({}), Ci = /* @__PURE__ */ (() => {
1145
- let e = 0;
1146
- return function() {
1147
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
1148
- return e += 1, `${t}${e}`;
1149
- };
1150
- })(), $i = /* @__PURE__ */ a.forwardRef((e, t) => {
1151
- const {
1152
- prefixCls: n,
1153
- className: r,
1154
- trigger: o,
1155
- children: l,
1156
- defaultCollapsed: i = !1,
1157
- theme: s = "dark",
1158
- style: c = {},
1159
- collapsible: u = !1,
1160
- reverseArrow: v = !1,
1161
- width: d = 200,
1162
- collapsedWidth: p = 80,
1163
- zeroWidthTriggerStyle: h,
1164
- breakpoint: f,
1165
- onCollapse: g,
1166
- onBreakpoint: $
1167
- } = e, I = hi(e, ["prefixCls", "className", "trigger", "children", "defaultCollapsed", "theme", "style", "collapsible", "reverseArrow", "width", "collapsedWidth", "zeroWidthTriggerStyle", "breakpoint", "onCollapse", "onBreakpoint"]), {
1168
- siderHook: y
1169
- } = cn(bi), [m, C] = un("collapsed" in e ? e.collapsed : i), [E, w] = un(!1);
1170
- Nt(() => {
1171
- "collapsed" in e && C(e.collapsed);
1172
- }, [e.collapsed]);
1173
- const M = (b, x) => {
1174
- "collapsed" in e || C(b), g == null || g(b, x);
1175
- }, S = Be();
1176
- S.current = (b) => {
1177
- w(b.matches), $ == null || $(b.matches), m !== b.matches && M(b.matches, "responsive");
1178
- }, Nt(() => {
1179
- function b(B) {
1180
- return S.current(B);
1181
- }
1182
- let x;
1183
- if (typeof window < "u") {
1184
- const {
1185
- matchMedia: B
1186
- } = window;
1187
- if (B && f && f in In) {
1188
- x = B(`screen and (max-width: ${In[f]})`);
1189
- try {
1190
- x.addEventListener("change", b);
1191
- } catch {
1192
- x.addListener(b);
1193
- }
1194
- b(x);
1195
- }
1196
- }
1197
- return () => {
1198
- try {
1199
- x == null || x.removeEventListener("change", b);
1200
- } catch {
1201
- x == null || x.removeListener(b);
1202
- }
1203
- };
1204
- }, [f]), Nt(() => {
1205
- const b = Ci("ant-sider-");
1206
- return y.addSider(b), () => y.removeSider(b);
1207
- }, []);
1208
- const N = () => {
1209
- M(!m, "clickTrigger");
1210
- }, {
1211
- getPrefixCls: O
1212
- } = cn(Ze), P = () => {
1213
- const b = O("layout-sider", n), x = we(I, ["collapsed"]), B = m ? p : d, k = gi(B) ? `${B}px` : String(B), z = parseFloat(String(p || 0)) === 0 ? /* @__PURE__ */ a.createElement("span", {
1214
- onClick: N,
1215
- className: K(`${b}-zero-width-trigger`, `${b}-zero-width-trigger-${v ? "right" : "left"}`),
1216
- style: h
1217
- }, o || /* @__PURE__ */ a.createElement(pi, null)) : null, L = {
1218
- expanded: v ? /* @__PURE__ */ a.createElement(Bt, null) : /* @__PURE__ */ a.createElement(yn, null),
1219
- collapsed: v ? /* @__PURE__ */ a.createElement(yn, null) : /* @__PURE__ */ a.createElement(Bt, null)
1220
- }[m ? "collapsed" : "expanded"], q = o !== null ? z || /* @__PURE__ */ a.createElement("div", {
1221
- className: `${b}-trigger`,
1222
- onClick: N,
1223
- style: {
1224
- width: k
1225
- }
1226
- }, o || L) : null, Y = Object.assign(Object.assign({}, c), {
1227
- flex: `0 0 ${k}`,
1228
- maxWidth: k,
1229
- minWidth: k,
1230
- width: k
1231
- }), Z = K(b, `${b}-${s}`, {
1232
- [`${b}-collapsed`]: !!m,
1233
- [`${b}-has-trigger`]: u && o !== null && !z,
1234
- [`${b}-below`]: !!E,
1235
- [`${b}-zero-width`]: parseFloat(k) === 0
1236
- }, r);
1237
- return /* @__PURE__ */ a.createElement("aside", Object.assign({
1238
- className: Z
1239
- }, x, {
1240
- style: Y,
1241
- ref: t
1242
- }), /* @__PURE__ */ a.createElement("div", {
1243
- className: `${b}-children`
1244
- }, l), u || E && z ? q : null);
1245
- }, R = a.useMemo(() => ({
1246
- siderCollapsed: m
1247
- }), [m]);
1248
- return /* @__PURE__ */ a.createElement(qt.Provider, {
1249
- value: R
1250
- }, P());
1251
- });
1252
- process.env.NODE_ENV !== "production" && ($i.displayName = "Sider");
1253
- var yi = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, name: "ellipsis", theme: "outlined" };
1254
- const Ii = yi;
1255
- var no = function(t, n) {
1256
- return /* @__PURE__ */ a.createElement(pt, J({}, t, {
1257
- ref: n,
1258
- icon: Ii
1259
- }));
1260
- };
1261
- process.env.NODE_ENV !== "production" && (no.displayName = "EllipsisOutlined");
1262
- const oo = /* @__PURE__ */ a.forwardRef(no);
1263
- var Si = function(e, t) {
1264
- var n = {};
1265
- for (var r in e)
1266
- Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
1267
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1268
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
1269
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
1270
- return n;
1271
- };
1272
- const wi = (e) => {
1273
- const {
1274
- prefixCls: t,
1275
- className: n,
1276
- dashed: r
1277
- } = e, o = Si(e, ["prefixCls", "className", "dashed"]), {
1278
- getPrefixCls: l
1279
- } = a.useContext(Ze), i = l("menu", t), s = K({
1280
- [`${i}-item-divider-dashed`]: !!r
1281
- }, n);
1282
- return /* @__PURE__ */ a.createElement(Xt, Object.assign({
1283
- className: s
1284
- }, o));
1285
- }, ro = wi, xi = /* @__PURE__ */ Ho({
1286
- prefixCls: "",
1287
- firstLevel: !0,
1288
- inlineCollapsed: !1
1289
- }), dt = xi, Oi = (e) => {
1290
- var t;
1291
- const {
1292
- className: n,
1293
- children: r,
1294
- icon: o,
1295
- title: l,
1296
- danger: i
1297
- } = e, {
1298
- prefixCls: s,
1299
- firstLevel: c,
1300
- direction: u,
1301
- disableMenuItemTitleTooltip: v,
1302
- inlineCollapsed: d
1303
- } = a.useContext(dt), p = (y) => {
1304
- const m = /* @__PURE__ */ a.createElement("span", {
1305
- className: `${s}-title-content`
1306
- }, r);
1307
- return (!o || Ue(r) && r.type === "span") && r && y && c && typeof r == "string" ? /* @__PURE__ */ a.createElement("div", {
1308
- className: `${s}-inline-collapsed-noicon`
1309
- }, r.charAt(0)) : m;
1310
- }, {
1311
- siderCollapsed: h
1312
- } = a.useContext(qt);
1313
- let f = l;
1314
- typeof l > "u" ? f = c ? r : "" : l === !1 && (f = "");
1315
- const g = {
1316
- title: f
1317
- };
1318
- !h && !d && (g.title = null, g.open = !1);
1319
- const $ = jn(r).length;
1320
- let I = /* @__PURE__ */ a.createElement(gt, Object.assign({}, we(e, ["title", "icon", "danger"]), {
1321
- className: K({
1322
- [`${s}-item-danger`]: i,
1323
- [`${s}-item-only-child`]: (o ? $ + 1 : $) === 1
1324
- }, n),
1325
- title: typeof l == "string" ? l : void 0
1326
- }), ft(o, {
1327
- className: K(Ue(o) ? (t = o.props) === null || t === void 0 ? void 0 : t.className : "", `${s}-item-icon`)
1328
- }), p(d));
1329
- return v || (I = /* @__PURE__ */ a.createElement(nr, Object.assign({}, g, {
1330
- placement: u === "rtl" ? "left" : "right",
1331
- overlayClassName: `${s}-inline-collapsed-tooltip`
1332
- }), I)), I;
1333
- }, io = Oi, Ei = (e) => {
1334
- var t;
1335
- const {
1336
- popupClassName: n,
1337
- icon: r,
1338
- title: o,
1339
- theme: l
1340
- } = e, i = a.useContext(dt), {
1341
- prefixCls: s,
1342
- inlineCollapsed: c,
1343
- theme: u
1344
- } = i, v = _e();
1345
- let d;
1346
- if (!r)
1347
- d = c && !v.length && o && typeof o == "string" ? /* @__PURE__ */ a.createElement("div", {
1348
- className: `${s}-inline-collapsed-noicon`
1349
- }, o.charAt(0)) : /* @__PURE__ */ a.createElement("span", {
1350
- className: `${s}-title-content`
1351
- }, o);
1352
- else {
1353
- const f = Ue(o) && o.type === "span";
1354
- d = /* @__PURE__ */ a.createElement(a.Fragment, null, ft(r, {
1355
- className: K(Ue(r) ? (t = r.props) === null || t === void 0 ? void 0 : t.className : "", `${s}-item-icon`)
1356
- }), f ? o : /* @__PURE__ */ a.createElement("span", {
1357
- className: `${s}-title-content`
1358
- }, o));
1359
- }
1360
- const p = a.useMemo(() => Object.assign(Object.assign({}, i), {
1361
- firstLevel: !1
1362
- }), [i]), [h] = zn("Menu");
1363
- return /* @__PURE__ */ a.createElement(dt.Provider, {
1364
- value: p
1365
- }, /* @__PURE__ */ a.createElement(bt, Object.assign({}, we(e, ["icon"]), {
1366
- title: d,
1367
- popupClassName: K(s, n, `${s}-${l || u}`),
1368
- popupStyle: {
1369
- zIndex: h
1370
- }
1371
- })));
1372
- }, ao = Ei;
1373
- var Mi = function(e, t) {
1374
- var n = {};
1375
- for (var r in e)
1376
- Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
1377
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1378
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
1379
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
1380
- return n;
1381
- };
1382
- function jt(e) {
1383
- return (e || []).map((t, n) => {
1384
- if (t && typeof t == "object") {
1385
- const r = t, {
1386
- label: o,
1387
- children: l,
1388
- key: i,
1389
- type: s
1390
- } = r, c = Mi(r, ["label", "children", "key", "type"]), u = i ?? `tmp-${n}`;
1391
- return l || s === "group" ? s === "group" ? /* @__PURE__ */ a.createElement(ht, Object.assign({
1392
- key: u
1393
- }, c, {
1394
- title: o
1395
- }), jt(l)) : /* @__PURE__ */ a.createElement(ao, Object.assign({
1396
- key: u
1397
- }, c, {
1398
- title: o
1399
- }), jt(l)) : s === "divider" ? /* @__PURE__ */ a.createElement(ro, Object.assign({
1400
- key: u
1401
- }, c)) : /* @__PURE__ */ a.createElement(io, Object.assign({
1402
- key: u
1403
- }, c), o);
1404
- }
1405
- return null;
1406
- }).filter((t) => t);
1407
- }
1408
- function Pi(e) {
1409
- return a.useMemo(() => e && jt(e), [e]);
1410
- }
1411
- var Ni = function(e, t) {
1412
- var n = {};
1413
- for (var r in e)
1414
- Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
1415
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1416
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
1417
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
1418
- return n;
1419
- };
1420
- const mt = /* @__PURE__ */ a.createContext(null), Ri = /* @__PURE__ */ a.forwardRef((e, t) => {
1421
- const {
1422
- children: n
1423
- } = e, r = Ni(e, ["children"]), o = a.useContext(mt), l = a.useMemo(() => Object.assign(Object.assign({}, o), r), [
1424
- o,
1425
- r.prefixCls,
1426
- // restProps.expandIcon, Not mark as deps since this is a ReactNode
1427
- r.mode,
1428
- r.selectable,
1429
- r.rootClassName
1430
- // restProps.validator, Not mark as deps since this is a function
1431
- ]), i = Uo(n), s = Bn(t, i ? n.ref : null);
1432
- return /* @__PURE__ */ a.createElement(mt.Provider, {
1433
- value: l
1434
- }, /* @__PURE__ */ a.createElement(sr, null, i ? /* @__PURE__ */ a.cloneElement(n, {
1435
- ref: s
1436
- }) : n));
1437
- }), Bi = (e) => {
1438
- const {
1439
- componentCls: t,
1440
- motionDurationSlow: n,
1441
- horizontalLineHeight: r,
1442
- colorSplit: o,
1443
- lineWidth: l,
1444
- lineType: i,
1445
- itemPaddingInline: s
1446
- } = e;
1447
- return {
1448
- [`${t}-horizontal`]: {
1449
- lineHeight: r,
1450
- border: 0,
1451
- borderBottom: `${A(l)} ${i} ${o}`,
1452
- boxShadow: "none",
1453
- "&::after": {
1454
- display: "block",
1455
- clear: "both",
1456
- height: 0,
1457
- content: '"\\20"'
1458
- },
1459
- // ======================= Item =======================
1460
- [`${t}-item, ${t}-submenu`]: {
1461
- position: "relative",
1462
- display: "inline-block",
1463
- verticalAlign: "bottom",
1464
- paddingInline: s
1465
- },
1466
- [`> ${t}-item:hover,
1467
- > ${t}-item-active,
1468
- > ${t}-submenu ${t}-submenu-title:hover`]: {
1469
- backgroundColor: "transparent"
1470
- },
1471
- [`${t}-item, ${t}-submenu-title`]: {
1472
- transition: [`border-color ${n}`, `background ${n}`].join(",")
1473
- },
1474
- // ===================== Sub Menu =====================
1475
- [`${t}-submenu-arrow`]: {
1476
- display: "none"
1477
- }
1478
- }
1479
- };
1480
- }, Di = (e) => {
1481
- let {
1482
- componentCls: t,
1483
- menuArrowOffset: n,
1484
- calc: r
1485
- } = e;
1486
- return {
1487
- [`${t}-rtl`]: {
1488
- direction: "rtl"
1489
- },
1490
- [`${t}-submenu-rtl`]: {
1491
- transformOrigin: "100% 0"
1492
- },
1493
- // Vertical Arrow
1494
- [`${t}-rtl${t}-vertical,
1495
- ${t}-submenu-rtl ${t}-vertical`]: {
1496
- [`${t}-submenu-arrow`]: {
1497
- "&::before": {
1498
- transform: `rotate(-45deg) translateY(${A(r(n).mul(-1).equal())})`
1499
- },
1500
- "&::after": {
1501
- transform: `rotate(45deg) translateY(${A(n)})`
1502
- }
1503
- }
1504
- }
1505
- };
1506
- }, Sn = (e) => Object.assign({}, Yo(e)), wn = (e, t) => {
1507
- const {
1508
- componentCls: n,
1509
- itemColor: r,
1510
- itemSelectedColor: o,
1511
- groupTitleColor: l,
1512
- itemBg: i,
1513
- subMenuItemBg: s,
1514
- itemSelectedBg: c,
1515
- activeBarHeight: u,
1516
- activeBarWidth: v,
1517
- activeBarBorderWidth: d,
1518
- motionDurationSlow: p,
1519
- motionEaseInOut: h,
1520
- motionEaseOut: f,
1521
- itemPaddingInline: g,
1522
- motionDurationMid: $,
1523
- itemHoverColor: I,
1524
- lineType: y,
1525
- colorSplit: m,
1526
- // Disabled
1527
- itemDisabledColor: C,
1528
- // Danger
1529
- dangerItemColor: E,
1530
- dangerItemHoverColor: w,
1531
- dangerItemSelectedColor: M,
1532
- dangerItemActiveBg: S,
1533
- dangerItemSelectedBg: N,
1534
- // Bg
1535
- popupBg: O,
1536
- itemHoverBg: P,
1537
- itemActiveBg: R,
1538
- menuSubMenuBg: b,
1539
- // Horizontal
1540
- horizontalItemSelectedColor: x,
1541
- horizontalItemSelectedBg: B,
1542
- horizontalItemBorderRadius: k,
1543
- horizontalItemHoverBg: z
1544
- } = e;
1545
- return {
1546
- [`${n}-${t}, ${n}-${t} > ${n}`]: {
1547
- color: r,
1548
- background: i,
1549
- [`&${n}-root:focus-visible`]: Object.assign({}, Sn(e)),
1550
- // ======================== Item ========================
1551
- [`${n}-item-group-title`]: {
1552
- color: l
1553
- },
1554
- [`${n}-submenu-selected`]: {
1555
- [`> ${n}-submenu-title`]: {
1556
- color: o
1557
- }
1558
- },
1559
- // Disabled
1560
- [`${n}-item-disabled, ${n}-submenu-disabled`]: {
1561
- color: `${C} !important`
1562
- },
1563
- // Hover
1564
- [`${n}-item:not(${n}-item-selected):not(${n}-submenu-selected)`]: {
1565
- [`&:hover, > ${n}-submenu-title:hover`]: {
1566
- color: I
1567
- }
1568
- },
1569
- [`&:not(${n}-horizontal)`]: {
1570
- [`${n}-item:not(${n}-item-selected)`]: {
1571
- "&:hover": {
1572
- backgroundColor: P
1573
- },
1574
- "&:active": {
1575
- backgroundColor: R
1576
- }
1577
- },
1578
- [`${n}-submenu-title`]: {
1579
- "&:hover": {
1580
- backgroundColor: P
1581
- },
1582
- "&:active": {
1583
- backgroundColor: R
1584
- }
1585
- }
1586
- },
1587
- // Danger - only Item has
1588
- [`${n}-item-danger`]: {
1589
- color: E,
1590
- [`&${n}-item:hover`]: {
1591
- [`&:not(${n}-item-selected):not(${n}-submenu-selected)`]: {
1592
- color: w
1593
- }
1594
- },
1595
- [`&${n}-item:active`]: {
1596
- background: S
1597
- }
1598
- },
1599
- [`${n}-item a`]: {
1600
- "&, &:hover": {
1601
- color: "inherit"
1602
- }
1603
- },
1604
- [`${n}-item-selected`]: {
1605
- color: o,
1606
- // Danger
1607
- [`&${n}-item-danger`]: {
1608
- color: M
1609
- },
1610
- "a, a:hover": {
1611
- color: "inherit"
1612
- }
1613
- },
1614
- [`& ${n}-item-selected`]: {
1615
- backgroundColor: c,
1616
- // Danger
1617
- [`&${n}-item-danger`]: {
1618
- backgroundColor: N
1619
- }
1620
- },
1621
- [`${n}-item, ${n}-submenu-title`]: {
1622
- [`&:not(${n}-item-disabled):focus-visible`]: Object.assign({}, Sn(e))
1623
- },
1624
- [`&${n}-submenu > ${n}`]: {
1625
- backgroundColor: b
1626
- },
1627
- // ===== 设置浮层的颜色 =======
1628
- // !dark 模式会被popupBg 会被rest 为 darkPopupBg
1629
- [`&${n}-popup > ${n}`]: {
1630
- backgroundColor: O
1631
- },
1632
- [`&${n}-submenu-popup > ${n}`]: {
1633
- backgroundColor: O
1634
- },
1635
- // ===== 设置浮层的颜色 end =======
1636
- // ====================== Horizontal ======================
1637
- [`&${n}-horizontal`]: Object.assign(Object.assign({}, t === "dark" ? {
1638
- borderBottom: 0
1639
- } : {}), {
1640
- [`> ${n}-item, > ${n}-submenu`]: {
1641
- top: d,
1642
- marginTop: e.calc(d).mul(-1).equal(),
1643
- marginBottom: 0,
1644
- borderRadius: k,
1645
- "&::after": {
1646
- position: "absolute",
1647
- insetInline: g,
1648
- bottom: 0,
1649
- borderBottom: `${A(u)} solid transparent`,
1650
- transition: `border-color ${p} ${h}`,
1651
- content: '""'
1652
- },
1653
- "&:hover, &-active, &-open": {
1654
- background: z,
1655
- "&::after": {
1656
- borderBottomWidth: u,
1657
- borderBottomColor: x
1658
- }
1659
- },
1660
- "&-selected": {
1661
- color: x,
1662
- backgroundColor: B,
1663
- "&:hover": {
1664
- backgroundColor: B
1665
- },
1666
- "&::after": {
1667
- borderBottomWidth: u,
1668
- borderBottomColor: x
1669
- }
1670
- }
1671
- }
1672
- }),
1673
- // ================== Inline & Vertical ===================
1674
- //
1675
- [`&${n}-root`]: {
1676
- [`&${n}-inline, &${n}-vertical`]: {
1677
- borderInlineEnd: `${A(d)} ${y} ${m}`
1678
- }
1679
- },
1680
- // ======================== Inline ========================
1681
- [`&${n}-inline`]: {
1682
- // Sub
1683
- [`${n}-sub${n}-inline`]: {
1684
- background: s
1685
- },
1686
- [`${n}-item`]: {
1687
- position: "relative",
1688
- "&::after": {
1689
- position: "absolute",
1690
- insetBlock: 0,
1691
- insetInlineEnd: 0,
1692
- borderInlineEnd: `${A(v)} solid ${o}`,
1693
- transform: "scaleY(0.0001)",
1694
- opacity: 0,
1695
- transition: [`transform ${$} ${f}`, `opacity ${$} ${f}`].join(","),
1696
- content: '""'
1697
- },
1698
- // Danger
1699
- [`&${n}-item-danger`]: {
1700
- "&::after": {
1701
- borderInlineEndColor: M
1702
- }
1703
- }
1704
- },
1705
- [`${n}-selected, ${n}-item-selected`]: {
1706
- "&::after": {
1707
- transform: "scaleY(1)",
1708
- opacity: 1,
1709
- transition: [`transform ${$} ${h}`, `opacity ${$} ${h}`].join(",")
1710
- }
1711
- }
1712
- }
1713
- }
1714
- };
1715
- }, xn = (e) => {
1716
- const {
1717
- componentCls: t,
1718
- itemHeight: n,
1719
- itemMarginInline: r,
1720
- padding: o,
1721
- menuArrowSize: l,
1722
- marginXS: i,
1723
- itemMarginBlock: s,
1724
- itemWidth: c
1725
- } = e, u = e.calc(l).add(o).add(i).equal();
1726
- return {
1727
- [`${t}-item`]: {
1728
- position: "relative",
1729
- overflow: "hidden"
1730
- },
1731
- [`${t}-item, ${t}-submenu-title`]: {
1732
- height: n,
1733
- lineHeight: A(n),
1734
- paddingInline: o,
1735
- overflow: "hidden",
1736
- textOverflow: "ellipsis",
1737
- marginInline: r,
1738
- marginBlock: s,
1739
- width: c
1740
- },
1741
- [`> ${t}-item,
1742
- > ${t}-submenu > ${t}-submenu-title`]: {
1743
- height: n,
1744
- lineHeight: A(n)
1745
- },
1746
- [`${t}-item-group-list ${t}-submenu-title,
1747
- ${t}-submenu-title`]: {
1748
- paddingInlineEnd: u
1749
- }
1750
- };
1751
- }, Ti = (e) => {
1752
- const {
1753
- componentCls: t,
1754
- iconCls: n,
1755
- itemHeight: r,
1756
- colorTextLightSolid: o,
1757
- dropdownWidth: l,
1758
- controlHeightLG: i,
1759
- motionDurationMid: s,
1760
- motionEaseOut: c,
1761
- paddingXL: u,
1762
- itemMarginInline: v,
1763
- fontSizeLG: d,
1764
- motionDurationSlow: p,
1765
- paddingXS: h,
1766
- boxShadowSecondary: f,
1767
- collapsedWidth: g,
1768
- collapsedIconSize: $
1769
- } = e, I = {
1770
- height: r,
1771
- lineHeight: A(r),
1772
- listStylePosition: "inside",
1773
- listStyleType: "disc"
1774
- };
1775
- return [
1776
- {
1777
- [t]: {
1778
- "&-inline, &-vertical": Object.assign({
1779
- [`&${t}-root`]: {
1780
- boxShadow: "none"
1781
- }
1782
- }, xn(e))
1783
- },
1784
- [`${t}-submenu-popup`]: {
1785
- [`${t}-vertical`]: Object.assign(Object.assign({}, xn(e)), {
1786
- boxShadow: f
1787
- })
1788
- }
1789
- },
1790
- // Vertical only
1791
- {
1792
- [`${t}-submenu-popup ${t}-vertical${t}-sub`]: {
1793
- minWidth: l,
1794
- maxHeight: `calc(100vh - ${A(e.calc(i).mul(2.5).equal())})`,
1795
- padding: "0",
1796
- overflow: "hidden",
1797
- borderInlineEnd: 0,
1798
- // https://github.com/ant-design/ant-design/issues/22244
1799
- // https://github.com/ant-design/ant-design/issues/26812
1800
- "&:not([class*='-active'])": {
1801
- overflowX: "hidden",
1802
- overflowY: "auto"
1803
- }
1804
- }
1805
- },
1806
- // Inline Only
1807
- {
1808
- [`${t}-inline`]: {
1809
- width: "100%",
1810
- // Motion enhance for first level
1811
- [`&${t}-root`]: {
1812
- [`${t}-item, ${t}-submenu-title`]: {
1813
- display: "flex",
1814
- alignItems: "center",
1815
- transition: [`border-color ${p}`, `background ${p}`, `padding ${s} ${c}`].join(","),
1816
- [`> ${t}-title-content`]: {
1817
- flex: "auto",
1818
- minWidth: 0,
1819
- overflow: "hidden",
1820
- textOverflow: "ellipsis"
1821
- },
1822
- "> *": {
1823
- flex: "none"
1824
- }
1825
- }
1826
- },
1827
- // >>>>> Sub
1828
- [`${t}-sub${t}-inline`]: {
1829
- padding: 0,
1830
- border: 0,
1831
- borderRadius: 0,
1832
- boxShadow: "none",
1833
- [`& > ${t}-submenu > ${t}-submenu-title`]: I,
1834
- [`& ${t}-item-group-title`]: {
1835
- paddingInlineStart: u
1836
- }
1837
- },
1838
- // >>>>> Item
1839
- [`${t}-item`]: I
1840
- }
1841
- },
1842
- // Inline Collapse Only
1843
- {
1844
- [`${t}-inline-collapsed`]: {
1845
- width: g,
1846
- [`&${t}-root`]: {
1847
- [`${t}-item, ${t}-submenu ${t}-submenu-title`]: {
1848
- [`> ${t}-inline-collapsed-noicon`]: {
1849
- fontSize: d,
1850
- textAlign: "center"
1851
- }
1852
- }
1853
- },
1854
- [`> ${t}-item,
1855
- > ${t}-item-group > ${t}-item-group-list > ${t}-item,
1856
- > ${t}-item-group > ${t}-item-group-list > ${t}-submenu > ${t}-submenu-title,
1857
- > ${t}-submenu > ${t}-submenu-title`]: {
1858
- insetInlineStart: 0,
1859
- paddingInline: `calc(50% - ${A(e.calc(d).div(2).equal())} - ${A(v)})`,
1860
- textOverflow: "clip",
1861
- [`
1862
- ${t}-submenu-arrow,
1863
- ${t}-submenu-expand-icon
1864
- `]: {
1865
- opacity: 0
1866
- },
1867
- [`${t}-item-icon, ${n}`]: {
1868
- margin: 0,
1869
- fontSize: $,
1870
- lineHeight: A(r),
1871
- "+ span": {
1872
- display: "inline-block",
1873
- opacity: 0
1874
- }
1875
- }
1876
- },
1877
- [`${t}-item-icon, ${n}`]: {
1878
- display: "inline-block"
1879
- },
1880
- "&-tooltip": {
1881
- pointerEvents: "none",
1882
- [`${t}-item-icon, ${n}`]: {
1883
- display: "none"
1884
- },
1885
- "a, a:hover": {
1886
- color: o
1887
- }
1888
- },
1889
- [`${t}-item-group-title`]: Object.assign(Object.assign({}, Zo), {
1890
- paddingInline: h
1891
- })
1892
- }
1893
- }
1894
- ];
1895
- }, On = (e) => {
1896
- const {
1897
- componentCls: t,
1898
- motionDurationSlow: n,
1899
- motionDurationMid: r,
1900
- motionEaseInOut: o,
1901
- motionEaseOut: l,
1902
- iconCls: i,
1903
- iconSize: s,
1904
- iconMarginInlineEnd: c
1905
- } = e;
1906
- return {
1907
- // >>>>> Item
1908
- [`${t}-item, ${t}-submenu-title`]: {
1909
- position: "relative",
1910
- display: "block",
1911
- margin: 0,
1912
- whiteSpace: "nowrap",
1913
- cursor: "pointer",
1914
- transition: [`border-color ${n}`, `background ${n}`, `padding ${n} ${o}`].join(","),
1915
- [`${t}-item-icon, ${i}`]: {
1916
- minWidth: s,
1917
- fontSize: s,
1918
- transition: [`font-size ${r} ${l}`, `margin ${n} ${o}`, `color ${n}`].join(","),
1919
- "+ span": {
1920
- marginInlineStart: c,
1921
- opacity: 1,
1922
- transition: [`opacity ${n} ${o}`, `margin ${n}`, `color ${n}`].join(",")
1923
- }
1924
- },
1925
- [`${t}-item-icon`]: Object.assign({}, Jo()),
1926
- [`&${t}-item-only-child`]: {
1927
- [`> ${i}, > ${t}-item-icon`]: {
1928
- marginInlineEnd: 0
1929
- }
1930
- }
1931
- },
1932
- // Disabled state sets text to gray and nukes hover/tab effects
1933
- [`${t}-item-disabled, ${t}-submenu-disabled`]: {
1934
- background: "none !important",
1935
- cursor: "not-allowed",
1936
- "&::after": {
1937
- borderColor: "transparent !important"
1938
- },
1939
- a: {
1940
- color: "inherit !important"
1941
- },
1942
- [`> ${t}-submenu-title`]: {
1943
- color: "inherit !important",
1944
- cursor: "not-allowed"
1945
- }
1946
- }
1947
- };
1948
- }, En = (e) => {
1949
- const {
1950
- componentCls: t,
1951
- motionDurationSlow: n,
1952
- motionEaseInOut: r,
1953
- borderRadius: o,
1954
- menuArrowSize: l,
1955
- menuArrowOffset: i
1956
- } = e;
1957
- return {
1958
- [`${t}-submenu`]: {
1959
- "&-expand-icon, &-arrow": {
1960
- position: "absolute",
1961
- top: "50%",
1962
- insetInlineEnd: e.margin,
1963
- width: l,
1964
- color: "currentcolor",
1965
- transform: "translateY(-50%)",
1966
- transition: `transform ${n} ${r}, opacity ${n}`
1967
- },
1968
- "&-arrow": {
1969
- // →
1970
- "&::before, &::after": {
1971
- position: "absolute",
1972
- width: e.calc(l).mul(0.6).equal(),
1973
- height: e.calc(l).mul(0.15).equal(),
1974
- backgroundColor: "currentcolor",
1975
- borderRadius: o,
1976
- transition: [`background ${n} ${r}`, `transform ${n} ${r}`, `top ${n} ${r}`, `color ${n} ${r}`].join(","),
1977
- content: '""'
1978
- },
1979
- "&::before": {
1980
- transform: `rotate(45deg) translateY(${A(e.calc(i).mul(-1).equal())})`
1981
- },
1982
- "&::after": {
1983
- transform: `rotate(-45deg) translateY(${A(i)})`
1984
- }
1985
- }
1986
- }
1987
- };
1988
- }, _i = (e) => {
1989
- const {
1990
- antCls: t,
1991
- componentCls: n,
1992
- fontSize: r,
1993
- motionDurationSlow: o,
1994
- motionDurationMid: l,
1995
- motionEaseInOut: i,
1996
- paddingXS: s,
1997
- padding: c,
1998
- colorSplit: u,
1999
- lineWidth: v,
2000
- zIndexPopup: d,
2001
- borderRadiusLG: p,
2002
- subMenuItemBorderRadius: h,
2003
- menuArrowSize: f,
2004
- menuArrowOffset: g,
2005
- lineType: $,
2006
- menuPanelMaskInset: I,
2007
- groupTitleLineHeight: y,
2008
- groupTitleFontSize: m
2009
- } = e;
2010
- return [
2011
- // Misc
2012
- {
2013
- "": {
2014
- [`${n}`]: Object.assign(Object.assign({}, dn()), {
2015
- // Hidden
2016
- "&-hidden": {
2017
- display: "none"
2018
- }
2019
- })
2020
- },
2021
- [`${n}-submenu-hidden`]: {
2022
- display: "none"
2023
- }
2024
- },
2025
- {
2026
- [n]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Tn(e)), dn()), {
2027
- marginBottom: 0,
2028
- paddingInlineStart: 0,
2029
- // Override default ul/ol
2030
- fontSize: r,
2031
- lineHeight: 0,
2032
- listStyle: "none",
2033
- outline: "none",
2034
- // Magic cubic here but smooth transition
2035
- transition: `width ${o} cubic-bezier(0.2, 0, 0, 1) 0s`,
2036
- "ul, ol": {
2037
- margin: 0,
2038
- padding: 0,
2039
- listStyle: "none"
2040
- },
2041
- // Overflow ellipsis
2042
- "&-overflow": {
2043
- display: "flex",
2044
- [`${n}-item`]: {
2045
- flex: "none"
2046
- }
2047
- },
2048
- [`${n}-item, ${n}-submenu, ${n}-submenu-title`]: {
2049
- borderRadius: e.itemBorderRadius
2050
- },
2051
- [`${n}-item-group-title`]: {
2052
- padding: `${A(s)} ${A(c)}`,
2053
- fontSize: m,
2054
- lineHeight: y,
2055
- transition: `all ${o}`
2056
- },
2057
- [`&-horizontal ${n}-submenu`]: {
2058
- transition: [`border-color ${o} ${i}`, `background ${o} ${i}`].join(",")
2059
- },
2060
- [`${n}-submenu, ${n}-submenu-inline`]: {
2061
- transition: [`border-color ${o} ${i}`, `background ${o} ${i}`, `padding ${l} ${i}`].join(",")
2062
- },
2063
- [`${n}-submenu ${n}-sub`]: {
2064
- cursor: "initial",
2065
- transition: [`background ${o} ${i}`, `padding ${o} ${i}`].join(",")
2066
- },
2067
- [`${n}-title-content`]: {
2068
- transition: `color ${o}`,
2069
- // https://github.com/ant-design/ant-design/issues/41143
2070
- [`> ${t}-typography-ellipsis-single-line`]: {
2071
- display: "inline",
2072
- verticalAlign: "unset"
2073
- }
2074
- },
2075
- [`${n}-item a`]: {
2076
- "&::before": {
2077
- position: "absolute",
2078
- inset: 0,
2079
- backgroundColor: "transparent",
2080
- content: '""'
2081
- }
2082
- },
2083
- // Removed a Badge related style seems it's safe
2084
- // https://github.com/ant-design/ant-design/issues/19809
2085
- // >>>>> Divider
2086
- [`${n}-item-divider`]: {
2087
- overflow: "hidden",
2088
- lineHeight: 0,
2089
- borderColor: u,
2090
- borderStyle: $,
2091
- borderWidth: 0,
2092
- borderTopWidth: v,
2093
- marginBlock: v,
2094
- padding: 0,
2095
- "&-dashed": {
2096
- borderStyle: "dashed"
2097
- }
2098
- }
2099
- }), On(e)), {
2100
- [`${n}-item-group`]: {
2101
- [`${n}-item-group-list`]: {
2102
- margin: 0,
2103
- padding: 0,
2104
- [`${n}-item, ${n}-submenu-title`]: {
2105
- paddingInline: `${A(e.calc(r).mul(2).equal())} ${A(c)}`
2106
- }
2107
- }
2108
- },
2109
- // ======================= Sub Menu =======================
2110
- "&-submenu": {
2111
- "&-popup": {
2112
- position: "absolute",
2113
- zIndex: d,
2114
- borderRadius: p,
2115
- boxShadow: "none",
2116
- transformOrigin: "0 0",
2117
- [`&${n}-submenu`]: {
2118
- background: "transparent"
2119
- },
2120
- // https://github.com/ant-design/ant-design/issues/13955
2121
- "&::before": {
2122
- position: "absolute",
2123
- inset: `${A(I)} 0 0`,
2124
- zIndex: -1,
2125
- width: "100%",
2126
- height: "100%",
2127
- opacity: 0,
2128
- content: '""'
2129
- }
2130
- },
2131
- // https://github.com/ant-design/ant-design/issues/13955
2132
- "&-placement-rightTop::before": {
2133
- top: 0,
2134
- insetInlineStart: I
2135
- },
2136
- "\n &-placement-leftTop,\n &-placement-bottomRight,\n ": {
2137
- transformOrigin: "100% 0"
2138
- },
2139
- "\n &-placement-leftBottom,\n &-placement-topRight,\n ": {
2140
- transformOrigin: "100% 100%"
2141
- },
2142
- "\n &-placement-rightBottom,\n &-placement-topLeft,\n ": {
2143
- transformOrigin: "0 100%"
2144
- },
2145
- "\n &-placement-bottomLeft,\n &-placement-rightTop,\n ": {
2146
- transformOrigin: "0 0"
2147
- },
2148
- "\n &-placement-leftTop,\n &-placement-leftBottom\n ": {
2149
- paddingInlineEnd: e.paddingXS
2150
- },
2151
- "\n &-placement-rightTop,\n &-placement-rightBottom\n ": {
2152
- paddingInlineStart: e.paddingXS
2153
- },
2154
- "\n &-placement-topRight,\n &-placement-topLeft\n ": {
2155
- paddingBottom: e.paddingXS
2156
- },
2157
- "\n &-placement-bottomRight,\n &-placement-bottomLeft\n ": {
2158
- paddingTop: e.paddingXS
2159
- },
2160
- [`> ${n}`]: Object.assign(Object.assign(Object.assign({
2161
- borderRadius: p
2162
- }, On(e)), En(e)), {
2163
- [`${n}-item, ${n}-submenu > ${n}-submenu-title`]: {
2164
- borderRadius: h
2165
- },
2166
- [`${n}-submenu-title::after`]: {
2167
- transition: `transform ${o} ${i}`
2168
- }
2169
- })
2170
- }
2171
- }), En(e)), {
2172
- [`&-inline-collapsed ${n}-submenu-arrow,
2173
- &-inline ${n}-submenu-arrow`]: {
2174
- // ↓
2175
- "&::before": {
2176
- transform: `rotate(-45deg) translateX(${A(g)})`
2177
- },
2178
- "&::after": {
2179
- transform: `rotate(45deg) translateX(${A(e.calc(g).mul(-1).equal())})`
2180
- }
2181
- },
2182
- [`${n}-submenu-open${n}-submenu-inline > ${n}-submenu-title > ${n}-submenu-arrow`]: {
2183
- // ↑
2184
- transform: `translateY(${A(e.calc(f).mul(0.2).mul(-1).equal())})`,
2185
- "&::after": {
2186
- transform: `rotate(-45deg) translateX(${A(e.calc(g).mul(-1).equal())})`
2187
- },
2188
- "&::before": {
2189
- transform: `rotate(45deg) translateX(${A(g)})`
2190
- }
2191
- }
2192
- })
2193
- },
2194
- // Integration with header element so menu items have the same height
2195
- {
2196
- [`${t}-layout-header`]: {
2197
- [n]: {
2198
- lineHeight: "inherit"
2199
- }
2200
- }
2201
- }
2202
- ];
2203
- }, Ai = (e) => {
2204
- var t, n, r;
2205
- const {
2206
- colorPrimary: o,
2207
- colorError: l,
2208
- colorTextDisabled: i,
2209
- colorErrorBg: s,
2210
- colorText: c,
2211
- colorTextDescription: u,
2212
- colorBgContainer: v,
2213
- colorFillAlter: d,
2214
- colorFillContent: p,
2215
- lineWidth: h,
2216
- lineWidthBold: f,
2217
- controlItemBgActive: g,
2218
- colorBgTextHover: $,
2219
- controlHeightLG: I,
2220
- lineHeight: y,
2221
- colorBgElevated: m,
2222
- marginXXS: C,
2223
- padding: E,
2224
- fontSize: w,
2225
- controlHeightSM: M,
2226
- fontSizeLG: S,
2227
- colorTextLightSolid: N,
2228
- colorErrorHover: O
2229
- } = e, P = (t = e.activeBarWidth) !== null && t !== void 0 ? t : 0, R = (n = e.activeBarBorderWidth) !== null && n !== void 0 ? n : h, b = (r = e.itemMarginInline) !== null && r !== void 0 ? r : e.marginXXS, x = new mn(N).setAlpha(0.65).toRgbString();
2230
- return {
2231
- dropdownWidth: 160,
2232
- zIndexPopup: e.zIndexPopupBase + 50,
2233
- radiusItem: e.borderRadiusLG,
2234
- itemBorderRadius: e.borderRadiusLG,
2235
- radiusSubMenuItem: e.borderRadiusSM,
2236
- subMenuItemBorderRadius: e.borderRadiusSM,
2237
- colorItemText: c,
2238
- itemColor: c,
2239
- colorItemTextHover: c,
2240
- itemHoverColor: c,
2241
- colorItemTextHoverHorizontal: o,
2242
- horizontalItemHoverColor: o,
2243
- colorGroupTitle: u,
2244
- groupTitleColor: u,
2245
- colorItemTextSelected: o,
2246
- itemSelectedColor: o,
2247
- colorItemTextSelectedHorizontal: o,
2248
- horizontalItemSelectedColor: o,
2249
- colorItemBg: v,
2250
- itemBg: v,
2251
- colorItemBgHover: $,
2252
- itemHoverBg: $,
2253
- colorItemBgActive: p,
2254
- itemActiveBg: g,
2255
- colorSubItemBg: d,
2256
- subMenuItemBg: d,
2257
- colorItemBgSelected: g,
2258
- itemSelectedBg: g,
2259
- colorItemBgSelectedHorizontal: "transparent",
2260
- horizontalItemSelectedBg: "transparent",
2261
- colorActiveBarWidth: 0,
2262
- activeBarWidth: P,
2263
- colorActiveBarHeight: f,
2264
- activeBarHeight: f,
2265
- colorActiveBarBorderSize: h,
2266
- activeBarBorderWidth: R,
2267
- // Disabled
2268
- colorItemTextDisabled: i,
2269
- itemDisabledColor: i,
2270
- // Danger
2271
- colorDangerItemText: l,
2272
- dangerItemColor: l,
2273
- colorDangerItemTextHover: l,
2274
- dangerItemHoverColor: l,
2275
- colorDangerItemTextSelected: l,
2276
- dangerItemSelectedColor: l,
2277
- colorDangerItemBgActive: s,
2278
- dangerItemActiveBg: s,
2279
- colorDangerItemBgSelected: s,
2280
- dangerItemSelectedBg: s,
2281
- itemMarginInline: b,
2282
- horizontalItemBorderRadius: 0,
2283
- horizontalItemHoverBg: "transparent",
2284
- itemHeight: I,
2285
- groupTitleLineHeight: y,
2286
- collapsedWidth: I * 2,
2287
- popupBg: m,
2288
- itemMarginBlock: C,
2289
- itemPaddingInline: E,
2290
- horizontalLineHeight: `${I * 1.15}px`,
2291
- iconSize: w,
2292
- iconMarginInlineEnd: M - w,
2293
- collapsedIconSize: S,
2294
- groupTitleFontSize: w,
2295
- // Disabled
2296
- darkItemDisabledColor: new mn(N).setAlpha(0.25).toRgbString(),
2297
- // Dark
2298
- darkItemColor: x,
2299
- darkDangerItemColor: l,
2300
- darkItemBg: "#001529",
2301
- darkPopupBg: "#001529",
2302
- darkSubMenuItemBg: "#000c17",
2303
- darkItemSelectedColor: N,
2304
- darkItemSelectedBg: o,
2305
- darkDangerItemSelectedBg: l,
2306
- darkItemHoverBg: "transparent",
2307
- darkGroupTitleColor: x,
2308
- darkItemHoverColor: N,
2309
- darkDangerItemHoverColor: O,
2310
- darkDangerItemSelectedColor: N,
2311
- darkDangerItemActiveBg: l,
2312
- // internal
2313
- itemWidth: P ? `calc(100% + ${R}px)` : `calc(100% - ${b * 2}px)`
2314
- };
2315
- }, ki = function(e) {
2316
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
2317
- return Dn("Menu", (o) => {
2318
- const {
2319
- colorBgElevated: l,
2320
- colorPrimary: i,
2321
- colorTextLightSolid: s,
2322
- controlHeightLG: c,
2323
- fontSize: u,
2324
- darkItemColor: v,
2325
- darkDangerItemColor: d,
2326
- darkItemBg: p,
2327
- darkSubMenuItemBg: h,
2328
- darkItemSelectedColor: f,
2329
- darkItemSelectedBg: g,
2330
- darkDangerItemSelectedBg: $,
2331
- darkItemHoverBg: I,
2332
- darkGroupTitleColor: y,
2333
- darkItemHoverColor: m,
2334
- darkItemDisabledColor: C,
2335
- darkDangerItemHoverColor: E,
2336
- darkDangerItemSelectedColor: w,
2337
- darkDangerItemActiveBg: M,
2338
- popupBg: S,
2339
- darkPopupBg: N
2340
- } = o, O = o.calc(u).div(7).mul(5).equal(), P = Rt(o, {
2341
- menuArrowSize: O,
2342
- menuHorizontalHeight: o.calc(c).mul(1.15).equal(),
2343
- menuArrowOffset: o.calc(O).mul(0.25).equal(),
2344
- menuPanelMaskInset: -7,
2345
- // Still a hardcode here since it's offset by rc-align
2346
- menuSubMenuBg: l,
2347
- calc: o.calc,
2348
- popupBg: S
2349
- }), R = Rt(P, {
2350
- itemColor: v,
2351
- itemHoverColor: m,
2352
- groupTitleColor: y,
2353
- itemSelectedColor: f,
2354
- itemBg: p,
2355
- popupBg: N,
2356
- subMenuItemBg: h,
2357
- itemActiveBg: "transparent",
2358
- itemSelectedBg: g,
2359
- activeBarHeight: 0,
2360
- activeBarBorderWidth: 0,
2361
- itemHoverBg: I,
2362
- // Disabled
2363
- itemDisabledColor: C,
2364
- // Danger
2365
- dangerItemColor: d,
2366
- dangerItemHoverColor: E,
2367
- dangerItemSelectedColor: w,
2368
- dangerItemActiveBg: M,
2369
- dangerItemSelectedBg: $,
2370
- menuSubMenuBg: h,
2371
- // Horizontal
2372
- horizontalItemSelectedColor: s,
2373
- horizontalItemSelectedBg: i
2374
- });
2375
- return [
2376
- // Basic
2377
- _i(P),
2378
- // Horizontal
2379
- Bi(P),
2380
- // Hard code for some light style
2381
- // Vertical
2382
- Ti(P),
2383
- // Hard code for some light style
2384
- // Theme
2385
- wn(P, "light"),
2386
- wn(R, "dark"),
2387
- // RTL
2388
- Di(P),
2389
- // Motion
2390
- vr(P),
2391
- ct(P, "slide-up"),
2392
- ct(P, "slide-down"),
2393
- Ln(P, "zoom-big")
2394
- ];
2395
- }, Ai, {
2396
- deprecatedTokens: [["colorGroupTitle", "groupTitleColor"], ["radiusItem", "itemBorderRadius"], ["radiusSubMenuItem", "subMenuItemBorderRadius"], ["colorItemText", "itemColor"], ["colorItemTextHover", "itemHoverColor"], ["colorItemTextHoverHorizontal", "horizontalItemHoverColor"], ["colorItemTextSelected", "itemSelectedColor"], ["colorItemTextSelectedHorizontal", "horizontalItemSelectedColor"], ["colorItemTextDisabled", "itemDisabledColor"], ["colorDangerItemText", "dangerItemColor"], ["colorDangerItemTextHover", "dangerItemHoverColor"], ["colorDangerItemTextSelected", "dangerItemSelectedColor"], ["colorDangerItemBgActive", "dangerItemActiveBg"], ["colorDangerItemBgSelected", "dangerItemSelectedBg"], ["colorItemBg", "itemBg"], ["colorItemBgHover", "itemHoverBg"], ["colorSubItemBg", "subMenuItemBg"], ["colorItemBgActive", "itemActiveBg"], ["colorItemBgSelectedHorizontal", "horizontalItemSelectedBg"], ["colorActiveBarWidth", "activeBarWidth"], ["colorActiveBarHeight", "activeBarHeight"], ["colorActiveBarBorderSize", "activeBarBorderWidth"], ["colorItemBgSelected", "itemSelectedBg"]],
2397
- // Dropdown will handle menu style self. We do not need to handle this.
2398
- injectStyle: n,
2399
- unitless: {
2400
- groupTitleLineHeight: !0
2401
- }
2402
- })(e, t);
2403
- };
2404
- var zi = function(e, t) {
2405
- var n = {};
2406
- for (var r in e)
2407
- Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
2408
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
2409
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
2410
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
2411
- return n;
2412
- };
2413
- const ji = /* @__PURE__ */ Lt((e, t) => {
2414
- var n, r;
2415
- const o = a.useContext(mt), l = o || {}, {
2416
- getPrefixCls: i,
2417
- getPopupContainer: s,
2418
- direction: c,
2419
- menu: u
2420
- } = a.useContext(Ze), v = i(), {
2421
- prefixCls: d,
2422
- className: p,
2423
- style: h,
2424
- theme: f = "light",
2425
- expandIcon: g,
2426
- _internalDisableMenuItemTitleTooltip: $,
2427
- inlineCollapsed: I,
2428
- siderCollapsed: y,
2429
- items: m,
2430
- children: C,
2431
- rootClassName: E,
2432
- mode: w,
2433
- selectable: M,
2434
- onClick: S,
2435
- overflowedIndicatorPopupClassName: N
2436
- } = e, O = zi(e, ["prefixCls", "className", "style", "theme", "expandIcon", "_internalDisableMenuItemTitleTooltip", "inlineCollapsed", "siderCollapsed", "items", "children", "rootClassName", "mode", "selectable", "onClick", "overflowedIndicatorPopupClassName"]), P = we(O, ["collapsedWidth"]), R = Pi(m) || C;
2437
- if (process.env.NODE_ENV !== "production") {
2438
- const D = _n("Menu");
2439
- process.env.NODE_ENV !== "production" && D(!("inlineCollapsed" in e && w !== "inline"), "usage", "`inlineCollapsed` should only be used when `mode` is inline."), process.env.NODE_ENV !== "production" && D(!(e.siderCollapsed !== void 0 && "inlineCollapsed" in e), "usage", "`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead."), D.deprecated("items" in e && !C, "children", "items");
2440
- }
2441
- (n = l.validator) === null || n === void 0 || n.call(l, {
2442
- mode: w
2443
- });
2444
- const b = An(function() {
2445
- var D;
2446
- S == null || S.apply(void 0, arguments), (D = l.onClick) === null || D === void 0 || D.call(l);
2447
- }), x = l.mode || w, B = M ?? l.selectable, k = a.useMemo(() => y !== void 0 ? y : I, [I, y]), z = {
2448
- horizontal: {
2449
- motionName: `${v}-slide-up`
2450
- },
2451
- inline: ur(v),
2452
- other: {
2453
- motionName: `${v}-zoom-big`
2454
- }
2455
- }, T = i("menu", d || l.prefixCls), V = Hn(T), [L, q, Y] = ki(T, V, !o), Z = K(`${T}-${f}`, u == null ? void 0 : u.className, p);
2456
- let G;
2457
- if (typeof g == "function")
2458
- G = g;
2459
- else if (g === null || g === !1)
2460
- G = null;
2461
- else if (l.expandIcon === null || l.expandIcon === !1)
2462
- G = null;
2463
- else {
2464
- const D = g ?? l.expandIcon;
2465
- G = ft(D, {
2466
- className: K(`${T}-submenu-expand-icon`, Ue(D) ? (r = D.props) === null || r === void 0 ? void 0 : r.className : "")
2467
- });
2468
- }
2469
- const oe = a.useMemo(() => ({
2470
- prefixCls: T,
2471
- inlineCollapsed: k || !1,
2472
- direction: c,
2473
- firstLevel: !0,
2474
- theme: f,
2475
- mode: x,
2476
- disableMenuItemTitleTooltip: $
2477
- }), [T, k, c, $, f]);
2478
- return L(/* @__PURE__ */ a.createElement(mt.Provider, {
2479
- value: null
2480
- }, /* @__PURE__ */ a.createElement(dt.Provider, {
2481
- value: oe
2482
- }, /* @__PURE__ */ a.createElement(Je, Object.assign({
2483
- getPopupContainer: s,
2484
- overflowedIndicator: /* @__PURE__ */ a.createElement(oo, null),
2485
- overflowedIndicatorPopupClassName: K(T, `${T}-${f}`, N),
2486
- mode: x,
2487
- selectable: B,
2488
- onClick: b
2489
- }, P, {
2490
- inlineCollapsed: k,
2491
- style: Object.assign(Object.assign({}, u == null ? void 0 : u.style), h),
2492
- className: Z,
2493
- prefixCls: T,
2494
- direction: c,
2495
- defaultMotions: z,
2496
- expandIcon: G,
2497
- ref: t,
2498
- rootClassName: K(E, q, l.rootClassName, Y, V)
2499
- }), R))));
2500
- }), Li = ji, Ae = /* @__PURE__ */ Lt((e, t) => {
2501
- const n = Be(null), r = a.useContext(qt);
2502
- return Mn(t, () => ({
2503
- menu: n.current,
2504
- focus: (o) => {
2505
- var l;
2506
- (l = n.current) === null || l === void 0 || l.focus(o);
2507
- }
2508
- })), /* @__PURE__ */ a.createElement(Li, Object.assign({
2509
- ref: n
2510
- }, e, r));
2511
- });
2512
- Ae.Item = io;
2513
- Ae.SubMenu = ao;
2514
- Ae.Divider = ro;
2515
- Ae.ItemGroup = ht;
2516
- process.env.NODE_ENV !== "production" && (Ae.displayName = "Menu");
2517
- const Hi = Ae, Ki = (e) => {
2518
- const {
2519
- componentCls: t,
2520
- menuCls: n,
2521
- colorError: r,
2522
- colorTextLightSolid: o
2523
- } = e, l = `${n}-item`;
2524
- return {
2525
- [`${t}, ${t}-menu-submenu`]: {
2526
- [`${n} ${l}`]: {
2527
- [`&${l}-danger:not(${l}-disabled)`]: {
2528
- color: r,
2529
- "&:hover": {
2530
- color: o,
2531
- backgroundColor: r
2532
- }
2533
- }
2534
- }
2535
- }
2536
- };
2537
- }, Vi = Ki, Wi = (e) => {
2538
- const {
2539
- componentCls: t,
2540
- menuCls: n,
2541
- zIndexPopup: r,
2542
- dropdownArrowDistance: o,
2543
- sizePopupArrow: l,
2544
- antCls: i,
2545
- iconCls: s,
2546
- motionDurationMid: c,
2547
- paddingBlock: u,
2548
- fontSize: v,
2549
- dropdownEdgeChildPadding: d,
2550
- colorTextDisabled: p,
2551
- fontSizeIcon: h,
2552
- controlPaddingHorizontal: f,
2553
- colorBgElevated: g
2554
- } = e;
2555
- return [
2556
- {
2557
- [t]: Object.assign(Object.assign({}, Tn(e)), {
2558
- position: "absolute",
2559
- top: -9999,
2560
- left: {
2561
- _skip_check_: !0,
2562
- value: -9999
2563
- },
2564
- zIndex: r,
2565
- display: "block",
2566
- // A placeholder out of dropdown visible range to avoid close when user moving
2567
- "&::before": {
2568
- position: "absolute",
2569
- insetBlock: e.calc(l).div(2).sub(o).equal(),
2570
- // insetInlineStart: -7, // FIXME: Seems not work for hidden element
2571
- zIndex: -9999,
2572
- opacity: 1e-4,
2573
- content: '""'
2574
- },
2575
- [`&-trigger${i}-btn`]: {
2576
- [`& > ${s}-down, & > ${i}-btn-icon > ${s}-down`]: {
2577
- fontSize: h
2578
- }
2579
- },
2580
- [`${t}-wrap`]: {
2581
- position: "relative",
2582
- [`${i}-btn > ${s}-down`]: {
2583
- fontSize: h
2584
- },
2585
- [`${s}-down::before`]: {
2586
- transition: `transform ${c}`
2587
- }
2588
- },
2589
- [`${t}-wrap-open`]: {
2590
- [`${s}-down::before`]: {
2591
- transform: "rotate(180deg)"
2592
- }
2593
- },
2594
- "\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ": {
2595
- display: "none"
2596
- },
2597
- // =============================================================
2598
- // == Motion ==
2599
- // =============================================================
2600
- // When position is not enough for dropdown, the placement will revert.
2601
- // We will handle this with revert motion name.
2602
- [`&${i}-slide-down-enter${i}-slide-down-enter-active${t}-placement-bottomLeft,
2603
- &${i}-slide-down-appear${i}-slide-down-appear-active${t}-placement-bottomLeft,
2604
- &${i}-slide-down-enter${i}-slide-down-enter-active${t}-placement-bottom,
2605
- &${i}-slide-down-appear${i}-slide-down-appear-active${t}-placement-bottom,
2606
- &${i}-slide-down-enter${i}-slide-down-enter-active${t}-placement-bottomRight,
2607
- &${i}-slide-down-appear${i}-slide-down-appear-active${t}-placement-bottomRight`]: {
2608
- animationName: dr
2609
- },
2610
- [`&${i}-slide-up-enter${i}-slide-up-enter-active${t}-placement-topLeft,
2611
- &${i}-slide-up-appear${i}-slide-up-appear-active${t}-placement-topLeft,
2612
- &${i}-slide-up-enter${i}-slide-up-enter-active${t}-placement-top,
2613
- &${i}-slide-up-appear${i}-slide-up-appear-active${t}-placement-top,
2614
- &${i}-slide-up-enter${i}-slide-up-enter-active${t}-placement-topRight,
2615
- &${i}-slide-up-appear${i}-slide-up-appear-active${t}-placement-topRight`]: {
2616
- animationName: mr
2617
- },
2618
- [`&${i}-slide-down-leave${i}-slide-down-leave-active${t}-placement-bottomLeft,
2619
- &${i}-slide-down-leave${i}-slide-down-leave-active${t}-placement-bottom,
2620
- &${i}-slide-down-leave${i}-slide-down-leave-active${t}-placement-bottomRight`]: {
2621
- animationName: pr
2622
- },
2623
- [`&${i}-slide-up-leave${i}-slide-up-leave-active${t}-placement-topLeft,
2624
- &${i}-slide-up-leave${i}-slide-up-leave-active${t}-placement-top,
2625
- &${i}-slide-up-leave${i}-slide-up-leave-active${t}-placement-topRight`]: {
2626
- animationName: fr
2627
- }
2628
- })
2629
- },
2630
- // =============================================================
2631
- // == Arrow style ==
2632
- // =============================================================
2633
- or(e, g, {
2634
- arrowPlacement: {
2635
- top: !0,
2636
- bottom: !0
2637
- }
2638
- }),
2639
- {
2640
- // =============================================================
2641
- // == Menu ==
2642
- // =============================================================
2643
- [`${t} ${n}`]: {
2644
- position: "relative",
2645
- margin: 0
2646
- },
2647
- [`${n}-submenu-popup`]: {
2648
- position: "absolute",
2649
- zIndex: r,
2650
- background: "transparent",
2651
- boxShadow: "none",
2652
- transformOrigin: "0 0",
2653
- "ul, li": {
2654
- listStyle: "none",
2655
- margin: 0
2656
- }
2657
- },
2658
- [`${t}, ${t}-menu-submenu`]: {
2659
- [n]: Object.assign(Object.assign({
2660
- padding: d,
2661
- listStyleType: "none",
2662
- backgroundColor: g,
2663
- backgroundClip: "padding-box",
2664
- borderRadius: e.borderRadiusLG,
2665
- outline: "none",
2666
- boxShadow: e.boxShadowSecondary
2667
- }, pn(e)), {
2668
- [`${n}-item-group-title`]: {
2669
- padding: `${A(u)} ${A(f)}`,
2670
- color: e.colorTextDescription,
2671
- transition: `all ${c}`
2672
- },
2673
- // ======================= Item Content =======================
2674
- [`${n}-item`]: {
2675
- position: "relative",
2676
- display: "flex",
2677
- alignItems: "center"
2678
- },
2679
- [`${n}-item-icon`]: {
2680
- minWidth: v,
2681
- marginInlineEnd: e.marginXS,
2682
- fontSize: e.fontSizeSM
2683
- },
2684
- [`${n}-title-content`]: {
2685
- flex: "auto",
2686
- "> a": {
2687
- color: "inherit",
2688
- transition: `all ${c}`,
2689
- "&:hover": {
2690
- color: "inherit"
2691
- },
2692
- "&::after": {
2693
- position: "absolute",
2694
- inset: 0,
2695
- content: '""'
2696
- }
2697
- }
2698
- },
2699
- // =========================== Item ===========================
2700
- [`${n}-item, ${n}-submenu-title`]: Object.assign(Object.assign({
2701
- clear: "both",
2702
- margin: 0,
2703
- padding: `${A(u)} ${A(f)}`,
2704
- color: e.colorText,
2705
- fontWeight: "normal",
2706
- fontSize: v,
2707
- lineHeight: e.lineHeight,
2708
- cursor: "pointer",
2709
- transition: `all ${c}`,
2710
- borderRadius: e.borderRadiusSM,
2711
- "&:hover, &-active": {
2712
- backgroundColor: e.controlItemBgHover
2713
- }
2714
- }, pn(e)), {
2715
- "&-selected": {
2716
- color: e.colorPrimary,
2717
- backgroundColor: e.controlItemBgActive,
2718
- "&:hover, &-active": {
2719
- backgroundColor: e.controlItemBgActiveHover
2720
- }
2721
- },
2722
- "&-disabled": {
2723
- color: p,
2724
- cursor: "not-allowed",
2725
- "&:hover": {
2726
- color: p,
2727
- backgroundColor: g,
2728
- cursor: "not-allowed"
2729
- },
2730
- a: {
2731
- pointerEvents: "none"
2732
- }
2733
- },
2734
- "&-divider": {
2735
- height: 1,
2736
- // By design
2737
- margin: `${A(e.marginXXS)} 0`,
2738
- overflow: "hidden",
2739
- lineHeight: 0,
2740
- backgroundColor: e.colorSplit
2741
- },
2742
- [`${t}-menu-submenu-expand-icon`]: {
2743
- position: "absolute",
2744
- insetInlineEnd: e.paddingXS,
2745
- [`${t}-menu-submenu-arrow-icon`]: {
2746
- marginInlineEnd: "0 !important",
2747
- color: e.colorTextDescription,
2748
- fontSize: h,
2749
- fontStyle: "normal"
2750
- }
2751
- }
2752
- }),
2753
- [`${n}-item-group-list`]: {
2754
- margin: `0 ${A(e.marginXS)}`,
2755
- padding: 0,
2756
- listStyle: "none"
2757
- },
2758
- [`${n}-submenu-title`]: {
2759
- paddingInlineEnd: e.calc(f).add(e.fontSizeSM).equal()
2760
- },
2761
- [`${n}-submenu-vertical`]: {
2762
- position: "relative"
2763
- },
2764
- [`${n}-submenu${n}-submenu-disabled ${t}-menu-submenu-title`]: {
2765
- [`&, ${t}-menu-submenu-arrow-icon`]: {
2766
- color: p,
2767
- backgroundColor: g,
2768
- cursor: "not-allowed"
2769
- }
2770
- },
2771
- // https://github.com/ant-design/ant-design/issues/19264
2772
- [`${n}-submenu-selected ${t}-menu-submenu-title`]: {
2773
- color: e.colorPrimary
2774
- }
2775
- })
2776
- }
2777
- },
2778
- // Follow code may reuse in other components
2779
- [ct(e, "slide-up"), ct(e, "slide-down"), fn(e, "move-up"), fn(e, "move-down"), Ln(e, "zoom-big")]
2780
- ];
2781
- }, Fi = (e) => Object.assign(Object.assign({
2782
- zIndexPopup: e.zIndexPopupBase + 50,
2783
- paddingBlock: (e.controlHeight - e.fontSize * e.lineHeight) / 2
2784
- }, rr({
2785
- contentRadius: e.borderRadiusLG,
2786
- limitVerticalRadius: !0
2787
- })), gr(e)), Xi = Dn("Dropdown", (e) => {
2788
- const {
2789
- marginXXS: t,
2790
- sizePopupArrow: n,
2791
- paddingXXS: r,
2792
- componentCls: o
2793
- } = e, l = Rt(e, {
2794
- menuCls: `${o}-menu`,
2795
- dropdownArrowDistance: e.calc(n).div(2).add(t).equal(),
2796
- dropdownEdgeChildPadding: r
2797
- });
2798
- return [Wi(l), Vi(l)];
2799
- }, Fi), Ct = (e) => {
2800
- const {
2801
- menu: t,
2802
- arrow: n,
2803
- prefixCls: r,
2804
- children: o,
2805
- trigger: l,
2806
- disabled: i,
2807
- dropdownRender: s,
2808
- getPopupContainer: c,
2809
- overlayClassName: u,
2810
- rootClassName: v,
2811
- overlayStyle: d,
2812
- open: p,
2813
- onOpenChange: h,
2814
- // Deprecated
2815
- visible: f,
2816
- onVisibleChange: g,
2817
- mouseEnterDelay: $ = 0.15,
2818
- mouseLeaveDelay: I = 0.1,
2819
- autoAdjustOverflow: y = !0,
2820
- placement: m = "",
2821
- overlay: C,
2822
- transitionName: E
2823
- } = e, {
2824
- getPopupContainer: w,
2825
- getPrefixCls: M,
2826
- direction: S,
2827
- dropdown: N
2828
- } = a.useContext(Ze), O = _n("Dropdown");
2829
- process.env.NODE_ENV !== "production" && ([["visible", "open"], ["onVisibleChange", "onOpenChange"]].forEach((_) => {
2830
- let [de, ae] = _;
2831
- O.deprecated(!(de in e), de, ae);
2832
- }), O.deprecated(!("overlay" in e), "overlay", "menu"));
2833
- const P = a.useMemo(() => {
2834
- const _ = M();
2835
- return E !== void 0 ? E : m.includes("top") ? `${_}-slide-down` : `${_}-slide-up`;
2836
- }, [M, m, E]), R = a.useMemo(() => m ? m.includes("Center") ? m.slice(0, m.indexOf("Center")) : m : S === "rtl" ? "bottomRight" : "bottomLeft", [m, S]);
2837
- if (process.env.NODE_ENV !== "production") {
2838
- if (m.includes("Center")) {
2839
- const _ = m.slice(0, m.indexOf("Center"));
2840
- process.env.NODE_ENV !== "production" && O(!m.includes("Center"), "deprecated", `You are using '${m}' placement in Dropdown, which is deprecated. Try to use '${_}' instead.`);
2841
- }
2842
- [["visible", "open"], ["onVisibleChange", "onOpenChange"]].forEach((_) => {
2843
- let [de, ae] = _;
2844
- O.deprecated(!(de in e), de, ae);
2845
- });
2846
- }
2847
- const b = M("dropdown", r), x = Hn(b), [B, k, z] = Xi(b, x), [, T] = Qo(), V = a.Children.only(o), L = ft(V, {
2848
- className: K(`${b}-trigger`, {
2849
- [`${b}-rtl`]: S === "rtl"
2850
- }, V.props.className),
2851
- disabled: i
2852
- }), q = i ? [] : l;
2853
- let Y;
2854
- q && q.includes("contextMenu") && (Y = !0);
2855
- const [Z, G] = qe(!1, {
2856
- value: p ?? f
2857
- }), oe = An((_) => {
2858
- h == null || h(_, {
2859
- source: "trigger"
2860
- }), g == null || g(_), G(_);
2861
- }), D = K(u, v, k, z, x, N == null ? void 0 : N.className, {
2862
- [`${b}-rtl`]: S === "rtl"
2863
- }), F = ir({
2864
- arrowPointAtCenter: typeof n == "object" && n.pointAtCenter,
2865
- autoAdjustOverflow: y,
2866
- offset: T.marginXXS,
2867
- arrowWidth: n ? T.sizePopupArrow : 0,
2868
- borderRadius: T.borderRadius
2869
- }), U = a.useCallback(() => {
2870
- t != null && t.selectable && (t != null && t.multiple) || (h == null || h(!1, {
2871
- source: "menu"
2872
- }), G(!1));
2873
- }, [t == null ? void 0 : t.selectable, t == null ? void 0 : t.multiple]), re = () => {
2874
- let _;
2875
- return t != null && t.items ? _ = /* @__PURE__ */ a.createElement(Hi, Object.assign({}, t)) : typeof C == "function" ? _ = C() : _ = C, s && (_ = s(_)), _ = a.Children.only(typeof _ == "string" ? /* @__PURE__ */ a.createElement("span", null, _) : _), /* @__PURE__ */ a.createElement(Ri, {
2876
- prefixCls: `${b}-menu`,
2877
- rootClassName: K(z, x),
2878
- expandIcon: /* @__PURE__ */ a.createElement("span", {
2879
- className: `${b}-menu-submenu-arrow`
2880
- }, /* @__PURE__ */ a.createElement(Bt, {
2881
- className: `${b}-menu-submenu-arrow-icon`
2882
- })),
2883
- mode: "vertical",
2884
- selectable: !1,
2885
- onClick: U,
2886
- validator: (de) => {
2887
- let {
2888
- mode: ae
2889
- } = de;
2890
- process.env.NODE_ENV !== "production" && O(!ae || ae === "vertical", "usage", `mode="${ae}" is not supported for Dropdown's Menu.`);
2891
- }
2892
- }, _);
2893
- }, [ge, Q] = zn("Dropdown", d == null ? void 0 : d.zIndex);
2894
- let ie = /* @__PURE__ */ a.createElement(Er, Object.assign({
2895
- alignPoint: Y
2896
- }, we(e, ["rootClassName"]), {
2897
- mouseEnterDelay: $,
2898
- mouseLeaveDelay: I,
2899
- visible: Z,
2900
- builtinPlacements: F,
2901
- arrow: !!n,
2902
- overlayClassName: D,
2903
- prefixCls: b,
2904
- getPopupContainer: c || w,
2905
- transitionName: P,
2906
- trigger: q,
2907
- overlay: re,
2908
- placement: R,
2909
- onVisibleChange: oe,
2910
- overlayStyle: Object.assign(Object.assign(Object.assign({}, N == null ? void 0 : N.style), d), {
2911
- zIndex: ge
2912
- })
2913
- }), L);
2914
- return ge && (ie = /* @__PURE__ */ a.createElement(tr.Provider, {
2915
- value: Q
2916
- }, ie)), B(ie);
2917
- };
2918
- function qi(e) {
2919
- return Object.assign(Object.assign({}, e), {
2920
- align: {
2921
- overflow: {
2922
- adjustX: !1,
2923
- adjustY: !1
2924
- }
2925
- }
2926
- });
2927
- }
2928
- const Gi = ar(Ct, "dropdown", (e) => e, qi), Ui = (e) => /* @__PURE__ */ a.createElement(Gi, Object.assign({}, e), /* @__PURE__ */ a.createElement("span", null));
2929
- Ct._InternalPanelDoNotUseOrYouWillBeFired = Ui;
2930
- process.env.NODE_ENV !== "production" && (Ct.displayName = "Dropdown");
2931
- const lo = Ct;
2932
- var Yi = function(e, t) {
2933
- var n = {};
2934
- for (var r in e)
2935
- Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
2936
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
2937
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
2938
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
2939
- return n;
2940
- };
2941
- const so = (e) => {
2942
- const {
2943
- getPopupContainer: t,
2944
- getPrefixCls: n,
2945
- direction: r
2946
- } = a.useContext(Ze), {
2947
- prefixCls: o,
2948
- type: l = "default",
2949
- danger: i,
2950
- disabled: s,
2951
- loading: c,
2952
- onClick: u,
2953
- htmlType: v,
2954
- children: d,
2955
- className: p,
2956
- menu: h,
2957
- arrow: f,
2958
- autoFocus: g,
2959
- overlay: $,
2960
- trigger: I,
2961
- align: y,
2962
- open: m,
2963
- onOpenChange: C,
2964
- placement: E,
2965
- getPopupContainer: w,
2966
- href: M,
2967
- icon: S = /* @__PURE__ */ a.createElement(oo, null),
2968
- title: N,
2969
- buttonsRender: O = (U) => U,
2970
- mouseEnterDelay: P,
2971
- mouseLeaveDelay: R,
2972
- overlayClassName: b,
2973
- overlayStyle: x,
2974
- destroyPopupOnHide: B,
2975
- dropdownRender: k
2976
- } = e, z = Yi(e, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "open", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyPopupOnHide", "dropdownRender"]), T = n("dropdown", o), V = `${T}-button`, L = {
2977
- menu: h,
2978
- arrow: f,
2979
- autoFocus: g,
2980
- align: y,
2981
- disabled: s,
2982
- trigger: s ? [] : I,
2983
- onOpenChange: C,
2984
- getPopupContainer: w || t,
2985
- mouseEnterDelay: P,
2986
- mouseLeaveDelay: R,
2987
- overlayClassName: b,
2988
- overlayStyle: x,
2989
- destroyPopupOnHide: B,
2990
- dropdownRender: k
2991
- }, {
2992
- compactSize: q,
2993
- compactItemClassnames: Y
2994
- } = cr(T, r), Z = K(V, Y, p);
2995
- "overlay" in e && (L.overlay = $), "open" in e && (L.open = m), "placement" in e ? L.placement = E : L.placement = r === "rtl" ? "bottomLeft" : "bottomRight";
2996
- const G = /* @__PURE__ */ a.createElement(vn, {
2997
- type: l,
2998
- danger: i,
2999
- disabled: s,
3000
- loading: c,
3001
- onClick: u,
3002
- htmlType: v,
3003
- href: M,
3004
- title: N
3005
- }, d), oe = /* @__PURE__ */ a.createElement(vn, {
3006
- type: l,
3007
- danger: i,
3008
- icon: S
3009
- }), [D, F] = O([G, oe]);
3010
- return /* @__PURE__ */ a.createElement(br.Compact, Object.assign({
3011
- className: Z,
3012
- size: q,
3013
- block: !0
3014
- }, z), D, /* @__PURE__ */ a.createElement(lo, Object.assign({}, L), F));
3015
- };
3016
- so.__ANT_BUTTON = !0;
3017
- const Zi = so, co = lo;
3018
- co.Button = Zi;
3019
- const ya = co;
3020
- export {
3021
- ya as A,
3022
- yn as L,
3023
- Hi as M,
3024
- Ri as O,
3025
- Bt as R
3026
- };