@unicom-cloud/ui 0.8.61 → 0.8.62

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 (179) hide show
  1. package/Affix.js +1 -1
  2. package/Alert.js +44 -40
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +4 -4
  5. package/Avatar.js +1 -1
  6. package/BackTop.js +7 -7
  7. package/Badge.js +2 -2
  8. package/Breadcrumb.js +22 -22
  9. package/Button.js +2 -2
  10. package/Calendar.js +106 -104
  11. package/Card.js +1 -1
  12. package/Carousel.js +34 -33
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +12 -12
  17. package/Comment.js +1 -1
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +16 -16
  20. package/DatePicker.js +165 -162
  21. package/Descriptions.js +1 -1
  22. package/Divider.js +1 -1
  23. package/Draggable.js +1 -1
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +9 -9
  26. package/Empty.js +2 -2
  27. package/Form.js +60 -54
  28. package/Grid.js +2 -2
  29. package/Icon.js +1 -1
  30. package/IconHover.js +1 -1
  31. package/Image.js +1 -1
  32. package/Input.js +1 -1
  33. package/InputNumber.js +6 -6
  34. package/InputTag.js +1 -1
  35. package/Layout.js +2 -2
  36. package/Link.js +14 -14
  37. package/List.js +3 -3
  38. package/Mentions.js +3 -3
  39. package/Menu.js +1 -1
  40. package/Message.js +2 -2
  41. package/Modal.js +1 -1
  42. package/Notice.js +9 -3
  43. package/Notification.js +2 -2
  44. package/OverflowEllipsis.js +32 -32
  45. package/PageHeader.js +23 -22
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +7 -7
  49. package/Popover.js +1 -1
  50. package/Progress.js +14 -14
  51. package/Radio.js +2 -2
  52. package/Rate.js +43 -40
  53. package/ResizeBox.js +97 -96
  54. package/Result.js +15 -15
  55. package/Select.js +1 -1
  56. package/SelectView.js +295 -249
  57. package/Skeleton.js +1 -1
  58. package/Slider.js +25 -25
  59. package/Space.js +1 -1
  60. package/SpeechSynthesis.js +32 -29
  61. package/Spin.js +2 -2
  62. package/Statistic.js +1 -1
  63. package/Steps.js +11 -11
  64. package/Switch.js +3 -3
  65. package/Table.js +9 -9
  66. package/Tabs.js +1 -1
  67. package/Tag.js +68 -67
  68. package/TimePicker.js +17 -17
  69. package/Timeline.js +1 -1
  70. package/Tooltip.js +1 -1
  71. package/Transfer.js +47 -46
  72. package/Tree.js +2 -2
  73. package/TreeSelect.js +1 -1
  74. package/Trigger.js +3 -3
  75. package/Typography.js +1 -1
  76. package/Upload.js +2 -2
  77. package/VerificationCode.js +1 -1
  78. package/Version.js +1 -1
  79. package/Watermark.js +1 -1
  80. package/chunk/{V6euPXVB.js → -Z968QpN.js} +257 -251
  81. package/chunk/{IooeSKJJ.js → AqH9yP_J.js} +19 -19
  82. package/chunk/{cZiP8FvM.js → B0oDiPqE.js} +1 -1
  83. package/chunk/{B16KHtX-.js → B4-WpgY2.js} +191 -185
  84. package/chunk/{CuOl4X0X.js → B8SZFOjt.js} +1 -1
  85. package/chunk/{CbiWdbr_.js → BXWxA-tS.js} +35 -34
  86. package/chunk/{DpfUGhi4.js → BlNFmhNa.js} +288 -283
  87. package/chunk/{C1xMmQIZ.js → BmO1y0vr.js} +34 -34
  88. package/chunk/{Kbr6FzOG.js → BnqeQYIZ.js} +210 -186
  89. package/chunk/{BPZ-6HKJ.js → Bp3XomF8.js} +1 -2
  90. package/chunk/BsWphzcT.js +20 -0
  91. package/chunk/{RMBPs_Ry.js → C4eJ9vCf.js} +4 -3
  92. package/chunk/{BNHrEI0Y.js → C6fEFlPt.js} +52 -48
  93. package/chunk/C8o-VGyc.js +376 -0
  94. package/chunk/{eK7lxdak.js → CDJ1EnJ2.js} +8 -8
  95. package/chunk/{C5AQWbC4.js → CHyuuVxl.js} +1 -1
  96. package/chunk/{B2vORJQ8.js → CJnshq6A.js} +13 -13
  97. package/chunk/CT1lZ7ss.js +116 -0
  98. package/chunk/{Bdh4XVuf.js → CV1kLw5Z.js} +290 -281
  99. package/chunk/{DmUhn9ib.js → CazXy0r4.js} +54 -53
  100. package/chunk/{BBVjSFnw.js → Cqyp4qni.js} +23 -19
  101. package/chunk/{BJ_7JTqC.js → D3VMG9V1.js} +1 -1
  102. package/chunk/{D2HkyI6A.js → DGasAUHE.js} +2 -2
  103. package/chunk/{YIlBPVAs.js → DRQ1v6Ux.js} +1 -1
  104. package/chunk/{DhBo0pPJ.js → DRp7voqz.js} +119 -118
  105. package/chunk/{gIbzjQ-X.js → Dtm4BmKB.js} +2 -2
  106. package/chunk/{BEDYCG-I.js → KchYsivk.js} +18 -18
  107. package/chunk/{Cbd50gx8.js → Wum88vrW.js} +33 -33
  108. package/chunk/{BjSHZA0m.js → mfn4EgmQ.js} +1 -1
  109. package/chunk/{BYhtrDV3.js → nbEvdwT0.js} +152 -148
  110. package/chunk/{C1D7T29r.js → qpd2axxs.js} +83 -76
  111. package/chunk/{BVLwPZis.js → tOFzwzpT.js} +31 -30
  112. package/chunk/{DSGRHf-1.js → yESVS-qX.js} +157 -156
  113. package/hooks/useMergeValue.js +1 -1
  114. package/icons.js +4 -6001
  115. package/index.js +420 -392
  116. package/locale/en-US.js +1 -1
  117. package/locale/tr-TR.js +1 -1
  118. package/package.json +1 -1
  119. package/style.css +1 -1
  120. package/types/cascader/panel/Search.d.ts +1 -1
  121. package/types/config-provider/interface.d.ts +1 -1
  122. package/types/form/interface.d.ts +1 -1
  123. package/types/index.d.ts +1 -1
  124. package/types/message/index.d.ts +2 -2
  125. package/types/notification/index.d.ts +2 -2
  126. package/types/notification-base/index.d.ts +2 -2
  127. package/types/select/interface.d.ts +1 -0
  128. package/types/select-view/interface.d.ts +1 -0
  129. package/types/tree/Context.d.ts +1 -0
  130. package/types/tree/Tree.d.ts +1 -1
  131. package/types/tree/index.d.ts +5 -4
  132. package/types/tree/interface.d.ts +1 -0
  133. package/types/utils/index.d.ts +1 -0
  134. package/types/utils/lodash.d.ts +14 -1
  135. package/types/version/index.d.ts +1 -1
  136. package/utils/CSSTransition.js +1 -1
  137. package/utils/caseName.js +2 -18
  138. package/utils/contextHolder.js +1 -1
  139. package/utils/index.js +220 -191
  140. package/utils/is.js +68 -67
  141. package/utils/lodash.js +32 -6
  142. package/utils/reactDOM.js +1 -1
  143. package/chunk/-LZOUh53.js +0 -29
  144. package/chunk/-jdfq71f.js +0 -23
  145. package/chunk/B0GOLsj_.js +0 -58
  146. package/chunk/B7Zsp3gO.js +0 -29
  147. package/chunk/BDjXkzNj.js +0 -23
  148. package/chunk/BHn4xgbv.js +0 -209
  149. package/chunk/BLSiP_gg.js +0 -32
  150. package/chunk/BMJfSSLX.js +0 -23
  151. package/chunk/B_nfMl0e.js +0 -116
  152. package/chunk/BcS17Pzy.js +0 -66
  153. package/chunk/BdiEwtQO.js +0 -41
  154. package/chunk/Bpug_KxP.js +0 -34
  155. package/chunk/C1u_ckwU.js +0 -29
  156. package/chunk/C43Hv2Bl.js +0 -34
  157. package/chunk/C9vsih_D.js +0 -29
  158. package/chunk/CAfR2wLq.js +0 -41
  159. package/chunk/CAfecMDF.js +0 -46
  160. package/chunk/CKp4rZnD.js +0 -207
  161. package/chunk/CV2Aqv9q.js +0 -52
  162. package/chunk/CYdarMv9.js +0 -32
  163. package/chunk/C_S5Mdvd.js +0 -379
  164. package/chunk/CmB-TL7C.js +0 -46
  165. package/chunk/D-ER56Sf.js +0 -29
  166. package/chunk/D-aYnb6u.js +0 -41
  167. package/chunk/D3xQFJcO.js +0 -23
  168. package/chunk/DJcEys80.js +0 -29
  169. package/chunk/DLIm6rRJ.js +0 -29
  170. package/chunk/DOWEHtqM.js +0 -41
  171. package/chunk/DT37l12z.js +0 -40
  172. package/chunk/DW-B7npC.js +0 -23
  173. package/chunk/D_MTFBb0.js +0 -38
  174. package/chunk/Dx_5J4fO.js +0 -29
  175. package/chunk/Dy487FZ1.js +0 -118
  176. package/chunk/Uz-rNulO.js +0 -98
  177. package/chunk/cDZI_t6o.js +0 -52
  178. package/chunk/sScV-J56.js +0 -206
  179. package/chunk/wI2I1qb0.js +0 -23
@@ -1,30 +1,32 @@
1
- import { jsx as i, jsxs as F, Fragment as Ie } from "react/jsx-runtime";
2
- import { I as Ae, a as Ue } from "./CV2Aqv9q.js";
1
+ import { jsx as i, jsxs as F, Fragment as we } from "react/jsx-runtime";
2
+ import Ae from "@unicom-cloud/icons/IconUiMenuFold";
3
+ import Ue from "@unicom-cloud/icons/IconUiMenuUnfold";
3
4
  import He from "lodash/isPlainObject";
4
- import L, { createContext as Be, useContext as K, forwardRef as X, useRef as J, useEffect as Z, useState as we, useMemo as Fe } from "react";
5
- import { d as Ce } from "./Bdh4XVuf.js";
5
+ import L, { createContext as Be, useContext as K, forwardRef as X, useRef as J, useEffect as Z, useState as Ce, useMemo as Fe } from "react";
6
+ import { d as Ie } from "./CV1kLw5Z.js";
6
7
  import { useForceUpdate as Ve } from "../hooks/useForceUpdate.js";
7
8
  import { useId as le } from "../hooks/useId.js";
8
9
  import { useKeyboardEvent as We } from "../hooks/useKeyboardEvent.js";
9
10
  import { useMergeProps as Ge } from "../hooks/useMergeProps.js";
10
11
  import { useMergeValue as re } from "../hooks/useMergeValue.js";
11
- import { a as ze } from "./BVLwPZis.js";
12
- import { y as B } from "./BzPkh4Zv.js";
12
+ import { a as ze } from "./tOFzwzpT.js";
13
+ import { y as H } from "./BzPkh4Zv.js";
13
14
  import z from "../utils/omit.js";
14
15
  import { p as je } from "./CANaGbGR.js";
15
16
  import { useIsFirstRender as qe } from "../hooks/useIsFirstRender.js";
16
17
  import Qe from "../Tooltip.js";
17
18
  import { E as ie, a as Ye, b as Je } from "./C2lIz2F9.js";
18
19
  import { getStyle as ge } from "../utils/style.js";
19
- import { I as ve } from "./BDjXkzNj.js";
20
+ import ve from "@unicom-cloud/icons/IconUiDown";
20
21
  import { useStateWithPromise as Xe } from "../hooks/useStateWithPromise.js";
21
- import { P as Ze } from "./BPZ-6HKJ.js";
22
+ import { P as Ze } from "./Bp3XomF8.js";
22
23
  import en from "../utils/pick.js";
23
- import { a as nn, I as tn } from "./DT37l12z.js";
24
+ import nn from "@unicom-cloud/icons/IconUiLeft";
25
+ import tn from "@unicom-cloud/icons/IconUiRight";
24
26
  import on from "../Dropdown.js";
25
- const H = Be({});
27
+ const B = Be({});
26
28
  function ee(l) {
27
- const { prefixCls: o, levelIndent: e } = l, { collapse: s } = K(H), r = l.level - 1;
29
+ const { prefixCls: o, levelIndent: e } = l, { collapse: s } = K(B), r = l.level - 1;
28
30
  return !s && r > 0 ? /* @__PURE__ */ i("span", { children: [...new Array(r)].map((n, c) => /* @__PURE__ */ i(
29
31
  "span",
30
32
  {
@@ -50,17 +52,17 @@ const Ne = [
50
52
  }, ke = (l, o = [], e = {}) => {
51
53
  const s = Se(l);
52
54
  return s.forEach((r, n) => {
53
- var p, I;
55
+ var p, C;
54
56
  const c = r.key, u = r.type.menuType, h = [c, ...o], y = {
55
57
  keyPath: [],
56
58
  prev: ((p = s[n - 1]) == null ? void 0 : p.key) || null,
57
- next: ((I = s[n + 1]) == null ? void 0 : I.key) || null
59
+ next: ((C = s[n + 1]) == null ? void 0 : C.key) || null
58
60
  };
59
61
  if (n === 0 || n === s.length - 1) {
60
- const a = h[1], N = n === 0 ? "firstChild" : "lastChild";
62
+ const a = h[1], S = n === 0 ? "firstChild" : "lastChild";
61
63
  a && (e[a] = {
62
64
  ...e[a],
63
- [N]: c
65
+ [S]: c
64
66
  });
65
67
  }
66
68
  switch (u) {
@@ -118,52 +120,52 @@ function rn(l, o) {
118
120
  wrapper: h = "div",
119
121
  onClick: y,
120
122
  renderItemInTooltip: p,
121
- ...I
123
+ ...C
122
124
  } = l, {
123
125
  prefixCls: a,
124
- mode: N,
125
- collapse: $,
126
+ mode: S,
127
+ collapse: E,
126
128
  inDropdown: t,
127
- levelIndent: m,
129
+ levelIndent: f,
128
130
  selectedKeys: d,
129
- autoScrollIntoView: C,
130
- scrollConfig: M,
131
- tooltipProps: b,
132
- onClickMenuItem: S
133
- } = K(H), f = J(null), E = qe(), x = N === "vertical" && r > 1, O = $ && !t && r === 1, P = d && ~d.indexOf(e);
131
+ autoScrollIntoView: g,
132
+ scrollConfig: b,
133
+ tooltipProps: w,
134
+ onClickMenuItem: v
135
+ } = K(B), m = J(null), x = qe(), P = S === "vertical" && r > 1, O = E && !t && r === 1, $ = d && ~d.indexOf(e);
134
136
  Z(() => {
135
- const k = P && C;
136
- f.current && k && setTimeout(
137
+ const k = $ && g;
138
+ m.current && k && setTimeout(
137
139
  () => {
138
- f.current && je(f.current, {
140
+ m.current && je(m.current, {
139
141
  behavior: "smooth",
140
142
  block: "start",
141
143
  scrollMode: "if-needed",
142
144
  boundary: document.body,
143
- ...M
145
+ ...b
144
146
  });
145
147
  },
146
- E ? 500 : 0
148
+ x ? 500 : 0
147
149
  );
148
- }, [P, C]);
150
+ }, [$, g]);
149
151
  const A = (k) => {
150
- n || (S == null || S(e, k), y == null || y(k));
151
- }, w = /* @__PURE__ */ F(
152
+ n || (v == null || v(e, k), y == null || y(k));
153
+ }, I = /* @__PURE__ */ F(
152
154
  h,
153
155
  {
154
156
  tabIndex: n ? -1 : 0,
155
157
  role: "menuitem",
156
158
  ref: (k) => {
157
- o = k, f.current = o;
159
+ o = k, m.current = o;
158
160
  },
159
161
  style: u,
160
- className: B(
162
+ className: H(
161
163
  `${a}-item`,
162
164
  {
163
165
  [`${a}-disabled`]: n,
164
- [`${a}-selected`]: P,
166
+ [`${a}-selected`]: $,
165
167
  // 存在缩进dom
166
- [`${a}-item-indented`]: x && !$
168
+ [`${a}-item-indented`]: P && !E
167
169
  },
168
170
  c
169
171
  ),
@@ -172,16 +174,16 @@ function rn(l, o) {
172
174
  k.key === ie.key && A(k);
173
175
  },
174
176
  ...z(
175
- I,
177
+ C,
176
178
  ["key", "_key"].concat(Ne)
177
179
  ),
178
180
  children: [
179
- x && !$ ? /* @__PURE__ */ F(Ie, { children: [
181
+ P && !E ? /* @__PURE__ */ F(we, { children: [
180
182
  /* @__PURE__ */ i(
181
183
  ee,
182
184
  {
183
185
  prefixCls: a,
184
- levelIndent: m,
186
+ levelIndent: f,
185
187
  level: r
186
188
  }
187
189
  ),
@@ -196,7 +198,7 @@ function rn(l, o) {
196
198
  }
197
199
  )
198
200
  ] }) : s,
199
- P && N === "horizontal" ? /* @__PURE__ */ i("div", { className: `${a}-selected-label` }) : null
201
+ $ && S === "horizontal" ? /* @__PURE__ */ i("div", { className: `${a}-selected-label` }) : null
200
202
  ]
201
203
  }
202
204
  );
@@ -208,25 +210,25 @@ function rn(l, o) {
208
210
  content: typeof p == "function" ? p() : /* @__PURE__ */ i("span", { children: s }),
209
211
  triggerProps: {
210
212
  className: `${a}-item-tooltip`,
211
- ...(b == null ? void 0 : b.triggerProps) || {}
213
+ ...(w == null ? void 0 : w.triggerProps) || {}
212
214
  },
213
- ...z(b, ["triggerProps"]),
214
- children: w
215
+ ...z(w, ["triggerProps"]),
216
+ children: I
215
217
  }
216
- ) : w;
218
+ ) : I;
217
219
  }
218
220
  const sn = X(rn), ce = sn;
219
221
  ce.displayName = "MenuItem";
220
222
  ce.menuType = "MenuItem";
221
223
  function ln(l, o) {
222
- const { children: e, title: s, level: r, className: n, style: c } = l, { prefixCls: u, levelIndent: h } = K(H), y = r === 1 ? r + 1 : r, p = ne(e, {
224
+ const { children: e, title: s, level: r, className: n, style: c } = l, { prefixCls: u, levelIndent: h } = K(B), y = r === 1 ? r + 1 : r, p = ne(e, {
223
225
  level: y
224
226
  });
225
227
  return /* @__PURE__ */ F(
226
228
  "div",
227
229
  {
228
230
  ref: o,
229
- className: B(`${u}-group`, n),
231
+ className: H(`${u}-group`, n),
230
232
  style: c,
231
233
  children: [
232
234
  /* @__PURE__ */ F("div", { className: `${u}-group-title`, children: [
@@ -261,53 +263,53 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
261
263
  ...y
262
264
  } = l, {
263
265
  id: p,
264
- prefixCls: I,
266
+ prefixCls: C,
265
267
  levelIndent: a,
266
- openKeys: N = [],
267
- selectedKeys: $ = [],
268
+ openKeys: S = [],
269
+ selectedKeys: E = [],
268
270
  icons: t,
269
- onClickSubMenu: m,
271
+ onClickSubMenu: f,
270
272
  onClickMenuItem: d
271
- } = K(H), C = `${I}-inline`, M = (N == null ? void 0 : N.indexOf(o)) > -1, b = h && $.indexOf(l._key) > -1 || xe(e, $), [S, f] = Xe(
272
- M ? { height: "auto" } : se
273
- ), E = (w) => {
274
- m(o, c, "inline"), h && d(o, w);
275
- }, x = le(`${p}-submenu-inline-`), O = ne(e, {
273
+ } = K(B), g = `${C}-inline`, b = (S == null ? void 0 : S.indexOf(o)) > -1, w = h && E.indexOf(l._key) > -1 || xe(e, E), [v, m] = Xe(
274
+ b ? { height: "auto" } : se
275
+ ), x = (I) => {
276
+ f(o, c, "inline"), h && d(o, I);
277
+ }, P = le(`${p}-submenu-inline-`), O = ne(e, {
276
278
  ...en(y, Ne),
277
279
  level: c + 1,
278
280
  selectable: h
279
- }), P = /* @__PURE__ */ F(
281
+ }), $ = /* @__PURE__ */ F(
280
282
  "div",
281
283
  {
282
284
  tabIndex: 0,
283
- "aria-expanded": M,
284
- "aria-controls": x,
285
- className: B(`${C}-header`, {
286
- [`${I}-selected`]: b
285
+ "aria-expanded": b,
286
+ "aria-controls": P,
287
+ className: H(`${g}-header`, {
288
+ [`${C}-selected`]: w
287
289
  }),
288
- onClick: E,
289
- onKeyDown: (w) => {
290
- w.key === ie.key && E(w);
290
+ onClick: x,
291
+ onKeyDown: (I) => {
292
+ I.key === ie.key && x(I);
291
293
  },
292
294
  children: [
293
295
  /* @__PURE__ */ i(
294
296
  ee,
295
297
  {
296
298
  level: c,
297
- prefixCls: I,
299
+ prefixCls: C,
298
300
  levelIndent: a
299
301
  }
300
302
  ),
301
303
  /* @__PURE__ */ i("span", { children: n }),
302
- /* @__PURE__ */ i("span", { className: `${I}-icon-suffix ${M ? "is-open" : ""}`, children: t && t.horizontalArrowDown ? t.horizontalArrowDown : /* @__PURE__ */ i(ve, {}) })
304
+ /* @__PURE__ */ i("span", { className: `${C}-icon-suffix ${b ? "is-open" : ""}`, children: t && t.horizontalArrowDown ? t.horizontalArrowDown : /* @__PURE__ */ i(ve, {}) })
303
305
  ]
304
306
  }
305
307
  ), A = /* @__PURE__ */ i(
306
308
  "div",
307
309
  {
308
- id: x,
309
- className: B(`${C}-content`),
310
- style: S,
310
+ id: P,
311
+ className: H(`${g}-content`),
312
+ style: v,
311
313
  children: O
312
314
  }
313
315
  );
@@ -315,26 +317,26 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
315
317
  "div",
316
318
  {
317
319
  ref: u,
318
- className: B(C, r),
320
+ className: H(g, r),
319
321
  style: s,
320
322
  ...z(y, ["key", "popup", "triggerProps"]),
321
323
  children: [
322
- P,
324
+ $,
323
325
  /* @__PURE__ */ i(
324
326
  Ze,
325
327
  {
326
- in: M,
328
+ in: b,
327
329
  timeout: 200,
328
- classNames: C,
330
+ classNames: g,
329
331
  unmountOnExit: !1,
330
- onEnter: async (w) => {
331
- w && (await f(se), await f({ height: w.scrollHeight }));
332
+ onEnter: async (I) => {
333
+ I && (await m(se), await m({ height: I.scrollHeight }));
332
334
  },
333
335
  onEntered: () => {
334
- f({ height: "auto" });
336
+ m({ height: "auto" });
335
337
  },
336
- onExit: async (w) => {
337
- w && (await f({ height: w.scrollHeight }), await f(se));
338
+ onExit: async (I) => {
339
+ I && (await m({ height: I.scrollHeight }), await m(se));
338
340
  },
339
341
  children: A
340
342
  }
@@ -355,35 +357,35 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
355
357
  triggerProps: y,
356
358
  ...p
357
359
  } = l, {
358
- id: I,
360
+ id: C,
359
361
  prefixCls: a,
360
- mode: N,
361
- inDropdown: $,
362
+ mode: S,
363
+ inDropdown: E,
362
364
  levelIndent: t,
363
- selectedKeys: m = [],
365
+ selectedKeys: f = [],
364
366
  icons: d,
365
- triggerProps: C,
366
- onClickSubMenu: M,
367
- onClickMenuItem: b
368
- } = K(H), { rtl: S } = K(Ce), f = { ...C, ...y }, [E, x] = we(!1), O = `${a}-pop`, P = u && m.indexOf(l._key) > -1, A = N === "horizontal" && !$, w = le(`${I}-submenu-pop-`), k = () => {
369
- const _ = d && d.popArrowRight ? d.popArrowRight : S ? /* @__PURE__ */ i(nn, {}) : /* @__PURE__ */ i(tn, {}), v = d && d.horizontalArrowDown ? d.horizontalArrowDown : /* @__PURE__ */ i(ve, {});
370
- return /* @__PURE__ */ i("span", { className: `${a}-icon-suffix`, children: A ? v : _ });
371
- }, V = xe(e, m) || P, G = S ? ["br", "lt"] : ["bl", "rt"], q = (_) => {
372
- M(o, c, "pop"), u && b(o, _);
367
+ triggerProps: g,
368
+ onClickSubMenu: b,
369
+ onClickMenuItem: w
370
+ } = K(B), { rtl: v } = K(Ie), m = { ...g, ...y }, [x, P] = Ce(!1), O = `${a}-pop`, $ = u && f.indexOf(l._key) > -1, A = S === "horizontal" && !E, I = le(`${C}-submenu-pop-`), k = () => {
371
+ const _ = d && d.popArrowRight ? d.popArrowRight : v ? /* @__PURE__ */ i(nn, {}) : /* @__PURE__ */ i(tn, {}), N = d && d.horizontalArrowDown ? d.horizontalArrowDown : /* @__PURE__ */ i(ve, {});
372
+ return /* @__PURE__ */ i("span", { className: `${a}-icon-suffix`, children: A ? N : _ });
373
+ }, V = xe(e, f) || $, G = v ? ["br", "lt"] : ["bl", "rt"], q = (_) => {
374
+ b(o, c, "pop"), u && w(o, _);
373
375
  };
374
376
  return /* @__PURE__ */ i(
375
377
  on,
376
378
  {
377
379
  trigger: "hover",
378
- popupVisible: E,
379
- onVisibleChange: x,
380
+ popupVisible: x,
381
+ onVisibleChange: P,
380
382
  droplist: /* @__PURE__ */ i(
381
383
  j,
382
384
  {
383
- id: w,
384
- selectedKeys: m,
385
- onClickMenuItem: (_, v) => {
386
- b(_, v), x(!1);
385
+ id: I,
386
+ selectedKeys: f,
387
+ onClickMenuItem: (_, N) => {
388
+ w(_, N), P(!1);
387
389
  },
388
390
  children: e
389
391
  }
@@ -396,22 +398,22 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
396
398
  duration: 100,
397
399
  mouseEnterDelay: 50,
398
400
  mouseLeaveDelay: 50,
399
- className: B(
401
+ className: H(
400
402
  `${O}-trigger`,
401
- f && f.className
403
+ m && m.className
402
404
  ),
403
- ...z(f, ["className"])
405
+ ...z(m, ["className"])
404
406
  },
405
407
  children: /* @__PURE__ */ F(
406
408
  "div",
407
409
  {
408
410
  tabIndex: 0,
409
411
  "aria-haspopup": !0,
410
- "aria-expanded": E,
411
- "aria-controls": w,
412
+ "aria-expanded": x,
413
+ "aria-controls": I,
412
414
  ref: h,
413
415
  style: s,
414
- className: B(
416
+ className: H(
415
417
  O,
416
418
  `${O}-header`,
417
419
  {
@@ -421,8 +423,8 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
421
423
  ),
422
424
  onClick: q,
423
425
  onKeyDown: (_) => {
424
- const v = _.key;
425
- v === ie.key ? q(_) : v === Ye.key ? x(!1) : v === Je.key && x(!0);
426
+ const N = _.key;
427
+ N === ie.key ? q(_) : N === Ye.key ? P(!1) : N === Je.key && P(!0);
426
428
  },
427
429
  ...z(p, ["key", "popup"]),
428
430
  children: [
@@ -436,7 +438,7 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
436
438
  ),
437
439
  n,
438
440
  k(),
439
- V && N === "horizontal" ? /* @__PURE__ */ i("div", { className: `${a}-selected-label` }) : null
441
+ V && S === "horizontal" ? /* @__PURE__ */ i("div", { className: `${a}-selected-label` }) : null
440
442
  ]
441
443
  }
442
444
  )
@@ -444,10 +446,10 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
444
446
  );
445
447
  };
446
448
  function pn(l, o) {
447
- const { children: e, popup: s, level: r } = l, { mode: n, collapse: c, inDropdown: u, collectInlineMenuKeys: h } = K(H), I = !!(typeof s == "function" ? s(r) : s) || c || u || n !== "vertical" ? un : an;
449
+ const { children: e, popup: s, level: r } = l, { mode: n, collapse: c, inDropdown: u, collectInlineMenuKeys: h } = K(B), C = !!(typeof s == "function" ? s(r) : s) || c || u || n !== "vertical" ? un : an;
448
450
  return Z(() => (h(l._key), () => {
449
451
  h(l._key, !0);
450
- }), []), /* @__PURE__ */ i(I, { forwardedRef: o, ...l, children: e });
452
+ }), []), /* @__PURE__ */ i(C, { forwardedRef: o, ...l, children: e });
451
453
  }
452
454
  const dn = X(pn), te = dn;
453
455
  te.displayName = "SubMenu";
@@ -461,80 +463,84 @@ function be(l) {
461
463
  return isNaN(o) ? 0 : o;
462
464
  }
463
465
  const mn = (l) => {
464
- const { children: o, ellipsisText: e = "···", onEllipsisChange: s } = l, { prefixCls: r } = K(H), n = J(null), [c, u] = we(null), h = `${r}-overflow-sub-menu`, y = `${r}-overflow-hidden-menu-item`, p = `${r}-overflow-sub-menu-mirror`, I = (t) => {
466
+ const { children: o, ellipsisText: e = "···", onEllipsisChange: s } = l, { prefixCls: r } = K(B), n = J(null), [c, u] = Ce(null), h = `${r}-overflow-sub-menu`, y = `${r}-overflow-hidden-menu-item`, p = `${r}-overflow-sub-menu-mirror`, C = (t) => {
465
467
  if (t !== c) {
466
- const m = L.Children.toArray(o), d = t === null;
468
+ const f = L.Children.toArray(o), d = t === null;
467
469
  s == null || s({
468
- lastVisibleIndex: d ? m.length - 1 : t,
469
- overflowNodes: d ? [] : m.slice(t + 1)
470
+ lastVisibleIndex: d ? f.length - 1 : t,
471
+ overflowNodes: d ? [] : f.slice(t + 1)
470
472
  }), u(t);
471
473
  }
472
474
  };
473
475
  function a() {
474
476
  if (!n.current)
475
477
  return;
476
- const t = n.current, m = Me(t) - fn, d = [].slice.call(t.children);
477
- let C = 0, M = 0, b = 0;
478
- for (let S = 0; S < d.length; S++) {
479
- const f = d[S], E = f.className.split(" "), x = E.indexOf(h) > -1, O = E.indexOf(p) > -1;
480
- if (x)
478
+ const t = n.current, f = Me(t) - fn, d = [].slice.call(t.children);
479
+ let g = 0, b = 0, w = 0;
480
+ for (let v = 0; v < d.length; v++) {
481
+ const m = d[v], x = m.className.split(" "), P = x.indexOf(h) > -1, O = x.indexOf(p) > -1;
482
+ if (P)
481
483
  continue;
482
- const P = Me(f) + be(ge(f, "marginLeft")) + be(ge(f, "marginRight"));
484
+ const $ = Me(m) + be(ge(m, "marginLeft")) + be(ge(m, "marginRight"));
483
485
  if (O) {
484
- b = P;
486
+ w = $;
485
487
  continue;
486
488
  }
487
- if (M += P, M > m) {
488
- I(
489
+ if (b += $, b > f) {
490
+ C(
489
491
  // 判断如果将最后一个菜单项换为 ... 是否会超出宽度
490
- C - (M - P + b <= m ? 1 : 2)
492
+ g - (b - $ + w <= f ? 1 : 2)
491
493
  );
492
494
  return;
493
495
  }
494
- C++;
496
+ g++;
495
497
  }
496
- I(null);
498
+ C(null);
497
499
  }
498
- const N = (t, m = !1) => /* @__PURE__ */ i(
500
+ const S = (t, f = !1) => /* @__PURE__ */ i(
499
501
  te,
500
502
  {
501
503
  title: /* @__PURE__ */ i("span", { children: e }),
502
- className: m ? p : h,
504
+ className: f ? p : h,
503
505
  children: t
504
506
  },
505
- `pqb-menu-overflow-sub-menu${m ? "-mirror" : ""}`
506
- ), $ = () => {
507
+ `pqb-menu-overflow-sub-menu${f ? "-mirror" : ""}`
508
+ ), E = () => {
507
509
  let t = null;
508
- const m = N(null, !0), d = L.Children.map(o, (C, M) => {
509
- let b = C;
510
- if (c !== null && (M > c && (b = L.cloneElement(C, {
511
- className: y
512
- })), M === c + 1)) {
513
- const S = L.Children.toArray(o).slice(c + 1).map(
514
- (f) => L.cloneElement(f, {
515
- key: f.props._key
510
+ const f = S(null, !0), d = L.Children.map(o, (g, b) => {
511
+ var v;
512
+ let w = g;
513
+ if (c !== null && (b > c && (w = L.cloneElement(g, {
514
+ className: H(
515
+ y,
516
+ (v = g == null ? void 0 : g.props) == null ? void 0 : v.className
517
+ )
518
+ })), b === c + 1)) {
519
+ const m = L.Children.toArray(o).slice(c + 1).map(
520
+ (x) => L.cloneElement(x, {
521
+ key: x.props._key
516
522
  })
517
523
  );
518
- t = N(S);
524
+ t = S(m);
519
525
  }
520
- return b;
526
+ return w;
521
527
  }) ?? [];
522
- return [m, ...d, t];
528
+ return [f, ...d, t];
523
529
  };
524
530
  return Z(() => {
525
531
  let t;
526
532
  return n.current && (t = new ResizeObserver(a), t.observe(n.current)), () => {
527
- var m, d;
528
- n.current && ((m = t == null ? void 0 : t.unobserve) == null || m.call(t, n.current)), (d = t == null ? void 0 : t.disconnect) == null || d.call(t), t = null;
533
+ var f, d;
534
+ n.current && ((f = t == null ? void 0 : t.unobserve) == null || f.call(t, n.current)), (d = t == null ? void 0 : t.disconnect) == null || d.call(t), t = null;
529
535
  };
530
- }, [n.current]), /* @__PURE__ */ i("div", { className: `${r}-overflow-wrap`, ref: n, children: $() });
536
+ }, [n.current]), /* @__PURE__ */ i("div", { className: `${r}-overflow-wrap`, ref: n, children: E() });
531
537
  }, hn = "light", yn = {
532
538
  mode: "vertical",
533
539
  selectable: !0,
534
540
  ellipsis: !0
535
541
  };
536
542
  function gn(l, o) {
537
- const { getPrefixCls: e, componentConfig: s, rtl: r } = K(Ce), n = Ge(
543
+ const { getPrefixCls: e, componentConfig: s, rtl: r } = K(Ie), n = Ge(
538
544
  l,
539
545
  yn,
540
546
  s == null ? void 0 : s.Menu
@@ -544,64 +550,64 @@ function gn(l, o) {
544
550
  className: h,
545
551
  prefixCls: y,
546
552
  mode: p,
547
- theme: I,
553
+ theme: C,
548
554
  icons: a,
549
- levelIndent: N,
550
- collapse: $,
555
+ levelIndent: S,
556
+ collapse: E,
551
557
  inDropdown: t,
552
- selectable: m,
558
+ selectable: f,
553
559
  triggerProps: d,
554
- tooltipProps: C,
555
- ellipsis: M,
556
- accordion: b,
557
- autoOpen: S,
558
- autoScrollIntoView: f,
559
- scrollConfig: E,
560
- hasCollapseButton: x,
560
+ tooltipProps: g,
561
+ ellipsis: b,
562
+ accordion: w,
563
+ autoOpen: v,
564
+ autoScrollIntoView: m,
565
+ scrollConfig: x,
566
+ hasCollapseButton: P,
561
567
  defaultOpenKeys: O,
562
- defaultSelectedKeys: P,
568
+ defaultSelectedKeys: $,
563
569
  openKeys: A,
564
- selectedKeys: w,
570
+ selectedKeys: I,
565
571
  onClickSubMenu: k,
566
572
  onClickMenuItem: V,
567
573
  onCollapseChange: G,
568
574
  onEllipsisChange: q,
569
575
  ..._
570
- } = n, [v, ue] = re([], {
576
+ } = n, [N, ue] = re([], {
571
577
  defaultValue: O,
572
578
  value: A
573
579
  }), [Pe, $e] = re([], {
574
- defaultValue: P,
575
- value: w
580
+ defaultValue: $,
581
+ value: I
576
582
  }), [Q, Ee] = re(!1, {
577
- value: $
578
- }), Te = K(H), { siderCollapsed: Oe } = K(ze), R = y || e("menu"), Y = Oe || Q || t || p === "popButton", pe = I || Te.theme || hn, W = J([]), de = J([]), _e = Ve(), Re = We(), fe = Fe(() => ke(u), [u]), De = le(`${R}-`), oe = _.id || De;
583
+ value: E
584
+ }), Te = K(B), { siderCollapsed: Oe } = K(ze), R = y || e("menu"), Y = Oe || Q || t || p === "popButton", pe = C || Te.theme || hn, W = J([]), de = J([]), _e = Ve(), Re = We(), fe = Fe(() => ke(u), [u]), De = le(`${R}-`), oe = _.id || De;
579
585
  Z(() => {
580
- let g = v.filter(
586
+ let M = N.filter(
581
587
  (T) => W.current.indexOf(T) !== -1
582
588
  );
583
- if (S) {
589
+ if (v) {
584
590
  const T = W.current.filter(
585
591
  (D) => de.current.indexOf(D) === -1
586
592
  );
587
- g = v.concat(T);
593
+ M = N.concat(T);
588
594
  }
589
- ue(b ? g.slice(0, 1) : g), de.current = W.current.slice();
595
+ ue(w ? M.slice(0, 1) : M), de.current = W.current.slice();
590
596
  }, [W.current.toString()]);
591
- const me = p !== "horizontal" && p !== "popButton" && !t && x, Ke = () => {
592
- const g = ne(u, { level: 1 }), T = Q ? a && a.collapseActive || /* @__PURE__ */ i(Ae, {}) : a && a.collapseDefault || /* @__PURE__ */ i(Ue, {}), D = () => {
597
+ const me = p !== "horizontal" && p !== "popButton" && !t && P, Ke = () => {
598
+ const M = ne(u, { level: 1 }), T = Q ? a && a.collapseActive || /* @__PURE__ */ i(Ue, {}) : a && a.collapseDefault || /* @__PURE__ */ i(Ae, {}), D = () => {
593
599
  const U = !Q;
594
600
  Ee(U), G == null || G(U);
595
601
  };
596
- return /* @__PURE__ */ F(Ie, { children: [
597
- /* @__PURE__ */ i("div", { className: `${R}-inner`, children: p === "horizontal" && M !== !1 ? /* @__PURE__ */ i(
602
+ return /* @__PURE__ */ F(we, { children: [
603
+ /* @__PURE__ */ i("div", { className: `${R}-inner`, children: p === "horizontal" && b !== !1 ? /* @__PURE__ */ i(
598
604
  mn,
599
605
  {
600
- ellipsisText: He(M) ? M.text : "···",
606
+ ellipsisText: He(b) ? b.text : "···",
601
607
  onEllipsisChange: q,
602
- children: g
608
+ children: M
603
609
  }
604
- ) : g }),
610
+ ) : M }),
605
611
  me && /* @__PURE__ */ i(
606
612
  "div",
607
613
  {
@@ -625,7 +631,7 @@ function gn(l, o) {
625
631
  ...z(_, ["isMenu"]),
626
632
  ref: o,
627
633
  style: he,
628
- className: B(
634
+ className: H(
629
635
  R,
630
636
  `${R}-${pe}`,
631
637
  `${R}-${p === "horizontal" ? "horizontal" : "vertical"}`,
@@ -639,37 +645,37 @@ function gn(l, o) {
639
645
  h
640
646
  ),
641
647
  children: /* @__PURE__ */ i(
642
- H.Provider,
648
+ B.Provider,
643
649
  {
644
650
  value: {
645
651
  mode: p,
646
652
  theme: pe,
647
653
  collapse: Y,
648
- levelIndent: N,
654
+ levelIndent: S,
649
655
  inDropdown: t,
650
656
  selectedKeys: Pe,
651
- openKeys: v,
657
+ openKeys: N,
652
658
  icons: a,
653
659
  triggerProps: d,
654
- tooltipProps: C,
655
- autoScrollIntoView: f,
656
- scrollConfig: E,
660
+ tooltipProps: g,
661
+ autoScrollIntoView: m,
662
+ scrollConfig: x,
657
663
  // pass props directly
658
664
  id: oe,
659
665
  prefixCls: R,
660
- collectInlineMenuKeys: (g, T) => {
666
+ collectInlineMenuKeys: (M, T) => {
661
667
  T ? W.current = W.current.filter(
662
- (D) => D !== g
663
- ) : W.current.push(g), _e();
668
+ (D) => D !== M
669
+ ) : W.current.push(M), _e();
664
670
  },
665
- onClickMenuItem: (g, T) => {
671
+ onClickMenuItem: (M, T) => {
666
672
  var D;
667
- m && $e([g]), V == null || V(g, T, (D = fe[g]) == null ? void 0 : D.keyPath);
673
+ f && $e([M]), V == null || V(M, T, (D = fe[M]) == null ? void 0 : D.keyPath);
668
674
  },
669
- onClickSubMenu: (g, T, D) => {
675
+ onClickSubMenu: (M, T, D) => {
670
676
  var ye;
671
- let U = [...v];
672
- D === "inline" && ((v == null ? void 0 : v.indexOf(g)) > -1 ? b && T === 1 ? U = [] : U = v.filter((Le) => Le !== g) : b && T === 1 ? U = [g] : U = v.concat([g])), ue(U), k == null || k(g, U, (ye = fe[g]) == null ? void 0 : ye.keyPath);
677
+ let U = [...N];
678
+ D === "inline" && ((N == null ? void 0 : N.indexOf(M)) > -1 ? w && T === 1 ? U = [] : U = N.filter((Le) => Le !== M) : w && T === 1 ? U = [M] : U = N.concat([M])), ue(U), k == null || k(M, U, (ye = fe[M]) == null ? void 0 : ye.keyPath);
673
679
  }
674
680
  },
675
681
  children: Ke()