@unicom-cloud/ui 0.8.66 → 0.8.67

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 (357) hide show
  1. package/Affix.js +79 -79
  2. package/Alert.js +46 -46
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +74 -74
  5. package/Avatar.js +36 -36
  6. package/BackTop.js +35 -35
  7. package/Badge.js +55 -55
  8. package/Breadcrumb.js +42 -42
  9. package/Button.js +24 -24
  10. package/Calendar.js +230 -230
  11. package/Card.js +18 -18
  12. package/Carousel.js +165 -165
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +26 -26
  17. package/Comment.js +18 -18
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +28 -27
  20. package/DatePicker.js +872 -871
  21. package/Descriptions.js +34 -34
  22. package/Divider.js +19 -19
  23. package/Draggable.js +27 -26
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +110 -110
  26. package/Empty.js +3 -3
  27. package/Form.js +984 -945
  28. package/Grid.js +34 -34
  29. package/Icon.js +16 -16
  30. package/IconHover.js +2 -2
  31. package/Image.js +2 -2
  32. package/Input.js +7 -6
  33. package/InputNumber.js +6 -6
  34. package/InputTag.js +1 -1
  35. package/Layout.js +24 -24
  36. package/Link.js +30 -30
  37. package/List.js +95 -95
  38. package/Mentions.js +85 -84
  39. package/Menu.js +2 -2
  40. package/Message.js +7 -6
  41. package/Modal.js +1 -1
  42. package/Notice.js +14 -3
  43. package/Notification.js +9 -7
  44. package/OverflowEllipsis.js +64 -62
  45. package/PageHeader.js +73 -73
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +60 -60
  49. package/Popover.js +31 -31
  50. package/Portal.js +23 -31
  51. package/Progress.js +22 -22
  52. package/Radio.js +2 -2
  53. package/Rate.js +24 -24
  54. package/ResizeBox.js +274 -271
  55. package/Result.js +3 -3
  56. package/Select.js +4 -4
  57. package/SelectView.js +257 -238
  58. package/Skeleton.js +46 -46
  59. package/Slider.js +286 -283
  60. package/Space.js +28 -28
  61. package/SpeechSynthesis.js +62 -55
  62. package/Spin.js +23 -23
  63. package/Statistic.js +80 -80
  64. package/Steps.js +67 -67
  65. package/Switch.js +47 -47
  66. package/Table.js +1445 -1380
  67. package/Tabs.js +5 -5
  68. package/Tag.js +45 -45
  69. package/TimePicker.js +154 -154
  70. package/Timeline.js +2 -2
  71. package/Tooltip.js +80 -79
  72. package/Transfer.js +103 -102
  73. package/Tree.js +3 -2
  74. package/TreeSelect.js +2 -2
  75. package/Trigger.js +699 -772
  76. package/Typography.js +756 -6
  77. package/Upload.js +2 -2
  78. package/VerificationCode.js +1 -1
  79. package/Version.js +1 -1
  80. package/VirtualList.js +1 -1
  81. package/Watermark.js +1 -1
  82. package/chunk/{BHgJ5Y3T.js → -UuKKT0Z.js} +29 -29
  83. package/chunk/{B8QV6E2b.js → AwZqeapI.js} +5 -5
  84. package/chunk/B5gK1Idp.js +19 -0
  85. package/chunk/B7FlazNB.js +24 -0
  86. package/chunk/{DTBtQQ2H.js → BBvWDeuZ.js} +67 -67
  87. package/chunk/BCftTxEy.js +626 -0
  88. package/chunk/{CZOP_ZHJ.js → BGny4zSb.js} +60 -60
  89. package/chunk/BHF15Dog.js +98 -0
  90. package/chunk/BJQ5UNa-.js +1585 -0
  91. package/chunk/BP9sYyk9.js +8 -0
  92. package/chunk/BUdtVdnv.js +38 -0
  93. package/chunk/BVQlOzTS.js +11 -0
  94. package/chunk/B__a_gb_.js +519 -0
  95. package/chunk/BbEYToV1.js +10 -0
  96. package/chunk/BbdDQAnm.js +15 -0
  97. package/chunk/BdUcgWdu.js +11 -0
  98. package/chunk/BfbXSG70.js +26 -0
  99. package/chunk/BndfNLK4.js +186 -0
  100. package/chunk/BoMCZV6K.js +1098 -0
  101. package/chunk/Br0B6y1T.js +18 -0
  102. package/chunk/BrOW642m.js +130 -0
  103. package/chunk/BxUs8_Cr.js +9 -0
  104. package/chunk/{CcV4wQB1.js → C42LIMP9.js} +244 -242
  105. package/chunk/C4YkFMzC.js +778 -0
  106. package/chunk/{Bh23P4l7.js → C9Wcraj7.js} +21 -21
  107. package/chunk/{4-gvEY5y.js → CANgSlh3.js} +10 -10
  108. package/chunk/CJ_o9tZM.js +5 -0
  109. package/chunk/{DNAigumg.js → CK5m7rLl.js} +36 -36
  110. package/chunk/{CANaGbGR.js → CKNyIitu.js} +57 -56
  111. package/chunk/CLiqJm_T.js +10 -0
  112. package/chunk/{BnSVm1YC.js → CNmmhbCn.js} +32 -32
  113. package/chunk/{BFipyA67.js → CP0odX99.js} +51 -51
  114. package/chunk/CPT-OZH2.js +14 -0
  115. package/chunk/CVSF8p0O.js +698 -0
  116. package/chunk/C_agcwLN.js +31 -0
  117. package/chunk/{jhQQCFMn.js → C_gJWGGh.js} +201 -201
  118. package/chunk/{Bc7t9jkb.js → CaasmWg_.js} +11 -11
  119. package/chunk/Ce1j9KTi.js +6 -0
  120. package/chunk/{D_-UD4vO.js → Cf5QNhkG.js} +18 -18
  121. package/chunk/CkNSv2U7.js +56 -0
  122. package/chunk/Cp2f70gB.js +9 -0
  123. package/chunk/CpegYjdC.js +16 -0
  124. package/chunk/CucI3KZr.js +20 -0
  125. package/chunk/CwoFBTYz.js +11 -0
  126. package/chunk/D2KPqPhV.js +17 -0
  127. package/chunk/D7NyvE5f.js +17 -0
  128. package/chunk/D8oTPQ2H.js +384 -0
  129. package/chunk/{CLBavO5c.js → DC1iHEiy.js} +87 -87
  130. package/chunk/{DnvO8A0Z.js → DFrfrmfK.js} +120 -119
  131. package/chunk/DGTIZ_0O.js +6 -0
  132. package/chunk/DJfpiZn_.js +25 -0
  133. package/chunk/DKr2_PYd.js +34 -0
  134. package/chunk/DNUz6zgo.js +11 -0
  135. package/chunk/DRtM649q.js +11 -0
  136. package/chunk/DS_mUWn6.js +41 -0
  137. package/chunk/DU6bs_19.js +10 -0
  138. package/chunk/DWdbwz22.js +10 -0
  139. package/chunk/DcveZuqd.js +6 -0
  140. package/chunk/DdVFknul.js +24 -0
  141. package/chunk/DgRfikwe.js +16 -0
  142. package/chunk/{znkyQ-HR.js → DkyR2EfG.js} +66 -66
  143. package/chunk/{DUeHQKtx.js → DleQ5HwG.js} +42 -42
  144. package/chunk/DnrZEnQ_.js +27 -0
  145. package/chunk/DsRSHWtX.js +1025 -0
  146. package/chunk/Dz5BdmXo.js +270 -0
  147. package/chunk/EANe01DF.js +1030 -0
  148. package/chunk/{CwhPMMWy.js → Ey4YJCkX.js} +7 -7
  149. package/chunk/GoNx5R4F.js +873 -0
  150. package/chunk/HDUQku8d.js +20 -0
  151. package/chunk/HrAP__Hi.js +25 -0
  152. package/chunk/JPPo5nY_.js +9 -0
  153. package/chunk/{Du-bw6qA.js → SLWP34OR.js} +90 -85
  154. package/chunk/VVKtwaGf.js +278 -0
  155. package/chunk/WPNpLxSI.js +16 -0
  156. package/chunk/{CPvvjMwZ.js → WpO_DsK4.js} +49 -48
  157. package/chunk/fdU3ang6.js +14 -0
  158. package/chunk/{DQAot004.js → fkclKOAL.js} +298 -292
  159. package/chunk/flvYlqx3.js +22 -0
  160. package/chunk/kTDayEpF.js +288 -0
  161. package/chunk/{CssIjN1g.js → pZoNQ75H.js} +31 -31
  162. package/chunk/qFf1w_Jq.js +8 -0
  163. package/chunk/{CHnFKgbk.js → w-kM1L5W.js} +155 -155
  164. package/hooks/index.js +53 -49
  165. package/hooks/useComputedState.js +2 -10
  166. package/hooks/useCreate.js +2 -7
  167. package/hooks/useForceUpdate.js +2 -7
  168. package/hooks/useId.js +2 -10
  169. package/hooks/useInView.js +2 -30
  170. package/hooks/useIntersectionObserver.js +2 -23
  171. package/hooks/useInterval.js +2 -17
  172. package/hooks/useIsFirstRender.js +2 -9
  173. package/hooks/useIsomorphicLayoutEffect.js +2 -5
  174. package/hooks/useKeyboardEvent.js +2 -16
  175. package/hooks/useMedia.js +2 -15
  176. package/hooks/useMergeProps.js +2 -18
  177. package/hooks/useMergeValue.js +2 -19
  178. package/hooks/useOnlineStatus.js +4 -0
  179. package/hooks/useOverflowHidden.js +2 -25
  180. package/hooks/useOverrideRef.js +2 -13
  181. package/hooks/usePersistCallback.js +2 -13
  182. package/hooks/usePrefersColorSchemeDark.js +4 -0
  183. package/hooks/usePrevious.js +2 -9
  184. package/hooks/useRefs.js +2 -9
  185. package/hooks/useResizeObserver.js +2 -15
  186. package/hooks/useStateCallback.js +2 -15
  187. package/hooks/useStateWithPromise.js +2 -24
  188. package/hooks/useUpdateEffect.js +2 -9
  189. package/hooks/useVerificationCode.js +73 -0
  190. package/hooks/useWatch.js +2 -10
  191. package/hooks/{use-watermark.js → useWatermark.js} +27 -26
  192. package/hooks/useWindowSize.js +2 -20
  193. package/index.js +571 -584
  194. package/locale/en-US.js +4 -2
  195. package/locale/interface.js +1 -4
  196. package/locale/ja-JP.js +3 -1
  197. package/locale/tr-TR.js +1 -1
  198. package/locale/zh-CN.js +3 -1
  199. package/locale/zh-HK.js +3 -1
  200. package/locale/zh-TW.js +3 -1
  201. package/package.json +1 -1
  202. package/style.css +1 -1
  203. package/types/anchor/util.d.ts +1 -1
  204. package/types/button/index.d.ts +2 -2
  205. package/types/color-picker/hooks/useColorPicker.d.ts +2 -2
  206. package/types/form/Control-old.d.ts +56 -0
  207. package/types/form/Control.d.ts +6 -54
  208. package/types/form/FormItem.d.ts +1 -1
  209. package/types/form/store.d.ts +0 -1
  210. package/types/hooks/index.d.ts +2 -0
  211. package/types/hooks/useComputedState.d.ts +1 -4
  212. package/types/hooks/useCreate.d.ts +1 -2
  213. package/types/hooks/useForceUpdate.d.ts +1 -2
  214. package/types/hooks/useId.d.ts +1 -2
  215. package/types/hooks/useInView.d.ts +1 -11
  216. package/types/hooks/useIntersectionObserver.d.ts +1 -7
  217. package/types/hooks/useInterval.d.ts +1 -2
  218. package/types/hooks/useIsFirstRender.d.ts +1 -2
  219. package/types/hooks/useIsomorphicLayoutEffect.d.ts +1 -3
  220. package/types/hooks/useKeyboardEvent.d.ts +1 -8
  221. package/types/hooks/useMedia.d.ts +1 -2
  222. package/types/hooks/useMergeProps.d.ts +1 -5
  223. package/types/hooks/useMergeValue.d.ts +1 -6
  224. package/types/hooks/useOnlineStatus.d.ts +1 -0
  225. package/types/hooks/useOverflowHidden.d.ts +1 -5
  226. package/types/hooks/useOverrideRef.d.ts +1 -6
  227. package/types/hooks/usePersistCallback.d.ts +1 -2
  228. package/types/hooks/usePrefersColorSchemeDark.d.ts +1 -0
  229. package/types/hooks/usePrevious.d.ts +1 -3
  230. package/types/hooks/useRefs.d.ts +1 -2
  231. package/types/hooks/useResizeObserver.d.ts +1 -6
  232. package/types/hooks/useStateCallback.d.ts +1 -5
  233. package/types/hooks/useStateWithPromise.d.ts +1 -2
  234. package/types/hooks/useUpdateEffect.d.ts +1 -3
  235. package/types/hooks/useWatch.d.ts +1 -3
  236. package/types/hooks/useWindowSize.d.ts +1 -5
  237. package/types/image/interface.d.ts +1 -0
  238. package/types/index.d.ts +157 -86
  239. package/types/input/Input.d.ts +1 -1
  240. package/types/input/Textarea.d.ts +2 -2
  241. package/types/locale/en-US.d.ts +2 -0
  242. package/types/locale/interface.d.ts +1 -2
  243. package/types/locale/ja-JP.d.ts +2 -0
  244. package/types/locale/zh-CN.d.ts +2 -0
  245. package/types/locale/zh-HK.d.ts +2 -0
  246. package/types/locale/zh-TW.d.ts +2 -0
  247. package/types/menu/context.d.ts +1 -1
  248. package/types/message/index.d.ts +14 -14
  249. package/types/message/interface.d.ts +2 -0
  250. package/types/modal/config.d.ts +0 -1
  251. package/types/modal/interface.d.ts +0 -1
  252. package/types/notice/index.d.ts +2 -27
  253. package/types/notification/index.d.ts +15 -16
  254. package/types/notification/interface.d.ts +2 -0
  255. package/types/notification/withNotification.d.ts +2 -0
  256. package/types/select/util.d.ts +1 -2
  257. package/types/select-view/interface.d.ts +2 -1
  258. package/types/speech-synthesis/index.d.ts +1 -1
  259. package/types/table/constant.d.ts +2 -0
  260. package/types/table/hook/useThResizable.d.ts +7 -0
  261. package/types/table/index.d.ts +10 -1
  262. package/types/table/style/index.d.ts +1 -0
  263. package/types/table/th-resizable/index.d.ts +2 -0
  264. package/types/table/thead/Column.d.ts +1 -2
  265. package/types/tree/Tree.d.ts +12 -67
  266. package/types/tree-select/Select.d.ts +2 -2
  267. package/types/trigger/index.d.ts +2 -120
  268. package/types/trigger/interface.d.ts +2 -1
  269. package/types/utils/CSSTransition.d.ts +2 -3
  270. package/types/utils/caseName.d.ts +1 -1
  271. package/types/utils/className.d.ts +1 -1
  272. package/types/utils/constant.d.ts +2 -2
  273. package/types/utils/copy.d.ts +1 -1
  274. package/types/utils/dayjs.d.ts +1 -21
  275. package/types/utils/dom.d.ts +1 -6
  276. package/types/utils/fileToURL.d.ts +1 -1
  277. package/types/utils/fillNBSP.d.ts +1 -1
  278. package/types/utils/getHighlightText.d.ts +1 -5
  279. package/types/utils/getHotkeyHandler.d.ts +1 -8
  280. package/types/utils/getStringLength.d.ts +1 -1
  281. package/types/utils/include.d.ts +1 -1
  282. package/types/utils/index.d.ts +3 -4
  283. package/types/utils/is.d.ts +1 -16
  284. package/types/utils/keyboardCode.d.ts +3 -0
  285. package/types/utils/lodash.d.ts +1 -17
  286. package/types/utils/mergeProps.d.ts +1 -1
  287. package/types/utils/mergedToString.d.ts +1 -1
  288. package/types/utils/omit.d.ts +1 -1
  289. package/types/utils/pad.d.ts +1 -2
  290. package/types/utils/pick.d.ts +2 -4
  291. package/types/utils/reactDOM.d.ts +1 -7
  292. package/types/utils/resizeObserverEffect.d.ts +2 -0
  293. package/types/utils/saveAs.d.ts +1 -1
  294. package/types/utils/screenfull.d.ts +2 -0
  295. package/types/utils/scrollIntoView.d.ts +1 -2
  296. package/types/utils/style.d.ts +1 -3
  297. package/types/utils/throttleByRaf.d.ts +1 -5
  298. package/types/utils/throttleByRaf2.d.ts +1 -0
  299. package/types/utils/warning.d.ts +1 -2
  300. package/types/version/index.d.ts +1 -1
  301. package/utils/CSSTransition.js +2 -6
  302. package/utils/className.js +2 -2
  303. package/utils/constant.js +8 -9
  304. package/utils/contextHolder.js +1 -1
  305. package/utils/copy.js +1 -1
  306. package/utils/dayjs.js +14 -173
  307. package/utils/dom.js +33 -29
  308. package/utils/fillNBSP.js +2 -4
  309. package/utils/getHighlightText.js +2 -38
  310. package/utils/getHotkeyHandler.js +2 -25
  311. package/utils/getStringLength.js +2 -7
  312. package/utils/include.js +2 -7
  313. package/utils/index.js +237 -240
  314. package/utils/is.js +116 -156
  315. package/utils/keyboardCode.js +27 -0
  316. package/utils/mergeProps.js +2 -9
  317. package/utils/mergedToString.js +2 -13
  318. package/utils/omit.js +2 -9
  319. package/utils/pad.js +12 -12
  320. package/utils/pick.js +4 -15
  321. package/utils/reactDOM.js +3 -54
  322. package/utils/resizeObserverEffect.js +4 -0
  323. package/utils/saveAs.js +1 -1
  324. package/utils/screenfull.js +4 -0
  325. package/utils/scrollIntoView.js +2 -21
  326. package/utils/style.js +12 -11
  327. package/utils/throttleByRaf.js +13 -12
  328. package/utils/throttleByRaf2.js +5 -0
  329. package/utils/warning.js +5 -4
  330. package/NotificationBase.js +0 -53
  331. package/chunk/-zpSUpGE.js +0 -1501
  332. package/chunk/BAWsPQBM.js +0 -11
  333. package/chunk/BIT0j3HT.js +0 -269
  334. package/chunk/BbLKnaNO.js +0 -871
  335. package/chunk/Bfhv56O2.js +0 -638
  336. package/chunk/C2lIz2F9.js +0 -60
  337. package/chunk/C6QWSzsM.js +0 -376
  338. package/chunk/CVkHTbic.js +0 -995
  339. package/chunk/CeGEvXby.js +0 -278
  340. package/chunk/D3NFxdmG.js +0 -518
  341. package/chunk/DApXtulb.js +0 -1102
  342. package/chunk/DPByB1ab.js +0 -698
  343. package/chunk/DV1Ab_cG.js +0 -284
  344. package/chunk/dBnNCOIU.js +0 -778
  345. package/chunk/it8qlDZ3.js +0 -1032
  346. package/chunk/l0sNRNKZ.js +0 -1
  347. package/chunk/te_43YrB.js +0 -776
  348. package/hooks/use-verification-code.js +0 -73
  349. package/types/notification-base/index.d.ts +0 -15
  350. package/types/notification-base/style/index.d.ts +0 -2
  351. package/types/trigger/Portal.d.ts +0 -7
  352. package/types/utils/keyCode.d.ts +0 -45
  353. package/types/utils/raf.d.ts +0 -3
  354. package/types/utils/throttleByRafV2.d.ts +0 -5
  355. package/utils/keyCode.js +0 -12
  356. package/utils/raf.js +0 -19
  357. package/utils/throttleByRafV2.js +0 -16
@@ -0,0 +1,698 @@
1
+ import { jsx as l, jsxs as B, Fragment as ve } from "react/jsx-runtime";
2
+ import Ae from "@unicom-cloud/icons/IconUiMenuFold";
3
+ import Ue from "@unicom-cloud/icons/IconUiMenuUnfold";
4
+ import He from "lodash/isPlainObject";
5
+ import L, { createContext as ze, useContext as K, forwardRef as X, useRef as J, useEffect as Z, useState as Ce, useMemo as Be } from "react";
6
+ import { a as we } from "./BJQ5UNa-.js";
7
+ import { c as Fe } from "./BP9sYyk9.js";
8
+ import { a as le } from "./DRtM649q.js";
9
+ import { h as Ge } from "./D2KPqPhV.js";
10
+ import { c as Ve } from "./B5gK1Idp.js";
11
+ import { R as re } from "./HDUQku8d.js";
12
+ import { a as We } from "./pZoNQ75H.js";
13
+ import { m as H } from "./JPPo5nY_.js";
14
+ import { c as W } from "./BdUcgWdu.js";
15
+ import { p as je } from "./CKNyIitu.js";
16
+ import { u as qe } from "./CLiqJm_T.js";
17
+ import Qe from "../Tooltip.js";
18
+ import { e as ie, y as Ye, n as Je } from "./BrOW642m.js";
19
+ import { l as Xe } from "./flvYlqx3.js";
20
+ import { getStyle as ge } from "../utils/style.js";
21
+ import Ie from "@unicom-cloud/icons/IconUiDown";
22
+ import { i as Ze } from "./DJfpiZn_.js";
23
+ import { N as en } from "./DC1iHEiy.js";
24
+ import { f as nn } from "./D7NyvE5f.js";
25
+ import tn from "@unicom-cloud/icons/IconUiLeft";
26
+ import on from "@unicom-cloud/icons/IconUiRight";
27
+ import rn from "../Dropdown.js";
28
+ const z = ze({});
29
+ function ee(s) {
30
+ const { prefixCls: n, levelIndent: e } = s, { collapse: o } = K(z), t = s.level - 1;
31
+ return !o && t > 0 ? /* @__PURE__ */ l("span", { children: [...new Array(t)].map((r, i) => /* @__PURE__ */ l(
32
+ "span",
33
+ {
34
+ className: `${n}-indent`,
35
+ style: { width: e }
36
+ },
37
+ i
38
+ )) }) : null;
39
+ }
40
+ const Ne = [
41
+ "popup",
42
+ "triggerProps",
43
+ "selectable"
44
+ ], Se = (s) => {
45
+ let n = [];
46
+ return L.Children.forEach(s, (e) => {
47
+ var t;
48
+ const o = (t = e == null ? void 0 : e.type) == null ? void 0 : t.menuType;
49
+ o === "MenuItem" || o === "SubMenu" ? n.push(e) : o === "MenuGroup" && (n = n.concat(
50
+ Se(e.props.children)
51
+ ));
52
+ }), n;
53
+ }, ke = (s, n = [], e = {}) => {
54
+ const o = Se(s);
55
+ return o.forEach((t, r) => {
56
+ var p, C;
57
+ const i = t.key, u = t.type.menuType, f = [i, ...n], h = {
58
+ keyPath: [],
59
+ prev: ((p = o[r - 1]) == null ? void 0 : p.key) || null,
60
+ next: ((C = o[r + 1]) == null ? void 0 : C.key) || null
61
+ };
62
+ if (r === 0 || r === o.length - 1) {
63
+ const c = f[1], S = r === 0 ? "firstChild" : "lastChild";
64
+ c && (e[c] = {
65
+ ...e[c],
66
+ [S]: i
67
+ });
68
+ }
69
+ switch (u) {
70
+ case "SubMenu":
71
+ h.keyPath = f, ke(t.props.children, f, e);
72
+ break;
73
+ case "MenuItem":
74
+ h.keyPath = f, h.disabled = t.props.disabled;
75
+ break;
76
+ }
77
+ e[i] = {
78
+ ...e[i],
79
+ ...h
80
+ };
81
+ }), e;
82
+ }, ne = (s, n) => L.Children.map(s, (e, o) => {
83
+ if (!e || !e.props)
84
+ return e;
85
+ const t = typeof e.type == "string";
86
+ if (!(e.type && e.type.menuType) && e.props.children) {
87
+ const i = t ? {} : n, u = ne(e.props.children, n);
88
+ return L.cloneElement(e, {
89
+ ...i,
90
+ _key: e.key,
91
+ children: u.length === 1 ? u[0] : u
92
+ });
93
+ }
94
+ return t ? e : L.cloneElement(e, {
95
+ ...n,
96
+ // Properties of the component itself have higher priority
97
+ ...e.props,
98
+ _key: e.key || `$menu-${o}`
99
+ });
100
+ });
101
+ function xe(s, n) {
102
+ let e = !1;
103
+ function o(t) {
104
+ !t || e || L.Children.forEach(t, (r) => {
105
+ if (r && r.props && r.type && !e) {
106
+ const i = r.type.menuType, u = r.props.selectable;
107
+ (i === "MenuItem" || i === "SubMenu" && u) && (e = n.indexOf(r.key) !== -1), !e && r.props.children && o(r.props.children);
108
+ }
109
+ });
110
+ }
111
+ return o(s), e;
112
+ }
113
+ function sn(s, n) {
114
+ const {
115
+ _key: e,
116
+ children: o,
117
+ level: t,
118
+ disabled: r,
119
+ className: i,
120
+ style: u,
121
+ wrapper: f = "div",
122
+ onClick: h,
123
+ renderItemInTooltip: p,
124
+ ...C
125
+ } = s, {
126
+ prefixCls: c,
127
+ mode: S,
128
+ collapse: E,
129
+ inDropdown: a,
130
+ levelIndent: y,
131
+ selectedKeys: m,
132
+ autoScrollIntoView: g,
133
+ scrollConfig: M,
134
+ tooltipProps: v,
135
+ onClickMenuItem: I
136
+ } = K(z), d = J(null), x = qe(), $ = S === "vertical" && t > 1, T = E && !a && t === 1, P = m && ~m.indexOf(e);
137
+ Z(() => {
138
+ const k = P && g;
139
+ d.current && k && setTimeout(
140
+ () => {
141
+ d.current && je(d.current, {
142
+ behavior: "smooth",
143
+ block: "start",
144
+ scrollMode: "if-needed",
145
+ boundary: document.body,
146
+ ...M
147
+ });
148
+ },
149
+ x ? 500 : 0
150
+ );
151
+ }, [P, g]);
152
+ const A = (k) => {
153
+ r || (I == null || I(e, k), h == null || h(k));
154
+ }, w = /* @__PURE__ */ B(
155
+ f,
156
+ {
157
+ tabIndex: r ? -1 : 0,
158
+ role: "menuitem",
159
+ ref: (k) => {
160
+ n = k, d.current = n;
161
+ },
162
+ style: u,
163
+ className: H(
164
+ `${c}-item`,
165
+ {
166
+ [`${c}-disabled`]: r,
167
+ [`${c}-selected`]: P,
168
+ // 存在缩进dom
169
+ [`${c}-item-indented`]: $ && !E
170
+ },
171
+ i
172
+ ),
173
+ onClick: A,
174
+ onKeyDown: (k) => {
175
+ k.key === ie.key && A(k);
176
+ },
177
+ ...W(
178
+ C,
179
+ ["key", "_key"].concat(Ne)
180
+ ),
181
+ children: [
182
+ $ && !E ? /* @__PURE__ */ B(ve, { children: [
183
+ /* @__PURE__ */ l(
184
+ ee,
185
+ {
186
+ prefixCls: c,
187
+ levelIndent: y,
188
+ level: t
189
+ }
190
+ ),
191
+ /* @__PURE__ */ l(
192
+ "span",
193
+ {
194
+ className: `${c}-item-inner`,
195
+ style: {
196
+ display: "block"
197
+ },
198
+ children: o
199
+ }
200
+ )
201
+ ] }) : o,
202
+ P && S === "horizontal" ? /* @__PURE__ */ l("div", { className: `${c}-selected-label` }) : null
203
+ ]
204
+ }
205
+ );
206
+ return T ? /* @__PURE__ */ l(
207
+ Qe,
208
+ {
209
+ trigger: "hover",
210
+ position: "right",
211
+ content: typeof p == "function" ? p() : /* @__PURE__ */ l("span", { children: o }),
212
+ triggerProps: {
213
+ className: `${c}-item-tooltip`,
214
+ ...(v == null ? void 0 : v.triggerProps) || {}
215
+ },
216
+ ...W(v, ["triggerProps"]),
217
+ children: w
218
+ }
219
+ ) : w;
220
+ }
221
+ const ln = X(sn), ce = ln;
222
+ ce.displayName = "MenuItem";
223
+ ce.menuType = "MenuItem";
224
+ function cn(s, n) {
225
+ const { children: e, title: o, level: t, className: r, style: i } = s, { prefixCls: u, levelIndent: f } = K(z), h = t === 1 ? t + 1 : t, p = ne(e, {
226
+ level: h
227
+ });
228
+ return /* @__PURE__ */ B(
229
+ "div",
230
+ {
231
+ ref: n,
232
+ className: H(`${u}-group`, r),
233
+ style: i,
234
+ children: [
235
+ /* @__PURE__ */ B("div", { className: `${u}-group-title`, children: [
236
+ /* @__PURE__ */ l(
237
+ ee,
238
+ {
239
+ level: t,
240
+ prefixCls: u,
241
+ levelIndent: f
242
+ }
243
+ ),
244
+ /* @__PURE__ */ l("span", { children: o })
245
+ ] }),
246
+ p
247
+ ]
248
+ }
249
+ );
250
+ }
251
+ const an = X(cn), ae = an;
252
+ ae.displayName = "MenuItemGroup";
253
+ ae.menuType = "MenuGroup";
254
+ const se = { height: 0, visibility: "hidden" }, un = (s) => {
255
+ const {
256
+ _key: n,
257
+ children: e,
258
+ style: o,
259
+ className: t,
260
+ title: r,
261
+ level: i,
262
+ forwardedRef: u,
263
+ selectable: f,
264
+ ...h
265
+ } = s, {
266
+ id: p,
267
+ prefixCls: C,
268
+ levelIndent: c,
269
+ openKeys: S = [],
270
+ selectedKeys: E = [],
271
+ icons: a,
272
+ onClickSubMenu: y,
273
+ onClickMenuItem: m
274
+ } = K(z), g = `${C}-inline`, M = (S == null ? void 0 : S.indexOf(n)) > -1, v = f && E.indexOf(s._key) > -1 || xe(e, E), [I, d] = Ze(
275
+ M ? { height: "auto" } : se
276
+ ), x = (w) => {
277
+ y(n, i, "inline"), f && m(n, w);
278
+ }, $ = le(`${p}-submenu-inline-`), T = ne(e, {
279
+ ...nn(h, Ne),
280
+ level: i + 1,
281
+ selectable: f
282
+ }), P = /* @__PURE__ */ B(
283
+ "div",
284
+ {
285
+ tabIndex: 0,
286
+ "aria-expanded": M,
287
+ "aria-controls": $,
288
+ className: H(`${g}-header`, {
289
+ [`${C}-selected`]: v
290
+ }),
291
+ onClick: x,
292
+ onKeyDown: (w) => {
293
+ w.key === ie.key && x(w);
294
+ },
295
+ children: [
296
+ /* @__PURE__ */ l(
297
+ ee,
298
+ {
299
+ level: i,
300
+ prefixCls: C,
301
+ levelIndent: c
302
+ }
303
+ ),
304
+ /* @__PURE__ */ l("span", { children: r }),
305
+ /* @__PURE__ */ l("span", { className: `${C}-icon-suffix ${M ? "is-open" : ""}`, children: a && a.horizontalArrowDown ? a.horizontalArrowDown : /* @__PURE__ */ l(Ie, {}) })
306
+ ]
307
+ }
308
+ ), A = /* @__PURE__ */ l(
309
+ "div",
310
+ {
311
+ id: $,
312
+ className: H(`${g}-content`),
313
+ style: I,
314
+ children: T
315
+ }
316
+ );
317
+ return /* @__PURE__ */ B(
318
+ "div",
319
+ {
320
+ ref: u,
321
+ className: H(g, t),
322
+ style: o,
323
+ ...W(h, ["key", "popup", "triggerProps"]),
324
+ children: [
325
+ P,
326
+ /* @__PURE__ */ l(
327
+ en,
328
+ {
329
+ in: M,
330
+ timeout: 200,
331
+ classNames: g,
332
+ unmountOnExit: !1,
333
+ onEnter: async (w) => {
334
+ w && (await d(se), await d({ height: w.scrollHeight }));
335
+ },
336
+ onEntered: () => {
337
+ d({ height: "auto" });
338
+ },
339
+ onExit: async (w) => {
340
+ w && (await d({ height: w.scrollHeight }), await d(se));
341
+ },
342
+ children: A
343
+ }
344
+ )
345
+ ]
346
+ }
347
+ );
348
+ }, pn = (s) => {
349
+ const {
350
+ _key: n,
351
+ children: e,
352
+ style: o,
353
+ className: t,
354
+ title: r,
355
+ level: i,
356
+ selectable: u,
357
+ forwardedRef: f,
358
+ triggerProps: h,
359
+ ...p
360
+ } = s, {
361
+ id: C,
362
+ prefixCls: c,
363
+ mode: S,
364
+ inDropdown: E,
365
+ levelIndent: a,
366
+ selectedKeys: y = [],
367
+ icons: m,
368
+ triggerProps: g,
369
+ onClickSubMenu: M,
370
+ onClickMenuItem: v
371
+ } = K(z), { rtl: I } = K(we), d = { ...g, ...h }, [x, $] = Ce(!1), T = `${c}-pop`, P = u && y.indexOf(s._key) > -1, A = S === "horizontal" && !E, w = le(`${C}-submenu-pop-`), k = () => {
372
+ const _ = m && m.popArrowRight ? m.popArrowRight : I ? /* @__PURE__ */ l(tn, {}) : /* @__PURE__ */ l(on, {}), N = m && m.horizontalArrowDown ? m.horizontalArrowDown : /* @__PURE__ */ l(Ie, {});
373
+ return /* @__PURE__ */ l("span", { className: `${c}-icon-suffix`, children: A ? N : _ });
374
+ }, F = xe(e, y) || P, V = I ? ["br", "lt"] : ["bl", "rt"], q = (_) => {
375
+ M(n, i, "pop"), u && v(n, _);
376
+ };
377
+ return /* @__PURE__ */ l(
378
+ rn,
379
+ {
380
+ trigger: "hover",
381
+ popupVisible: x,
382
+ onVisibleChange: $,
383
+ droplist: /* @__PURE__ */ l(
384
+ j,
385
+ {
386
+ id: w,
387
+ selectedKeys: y,
388
+ onClickMenuItem: (_, N) => {
389
+ v(_, N), $(!1);
390
+ },
391
+ children: e
392
+ }
393
+ ),
394
+ triggerProps: {
395
+ position: A ? V[0] : V[1],
396
+ showArrow: !0,
397
+ autoAlignPopupMinWidth: !0,
398
+ classNames: "fadeIn",
399
+ duration: 100,
400
+ mouseEnterDelay: 50,
401
+ mouseLeaveDelay: 50,
402
+ className: H(
403
+ `${T}-trigger`,
404
+ d && d.className
405
+ ),
406
+ ...W(d, ["className"])
407
+ },
408
+ children: /* @__PURE__ */ B(
409
+ "div",
410
+ {
411
+ tabIndex: 0,
412
+ "aria-haspopup": !0,
413
+ "aria-expanded": x,
414
+ "aria-controls": w,
415
+ ref: f,
416
+ style: o,
417
+ className: H(
418
+ T,
419
+ `${T}-header`,
420
+ {
421
+ [`${c}-selected`]: F
422
+ },
423
+ t
424
+ ),
425
+ onClick: q,
426
+ onKeyDown: (_) => {
427
+ const N = _.key;
428
+ N === ie.key ? q(_) : N === Ye.key ? $(!1) : N === Je.key && $(!0);
429
+ },
430
+ ...W(p, ["key", "popup"]),
431
+ children: [
432
+ /* @__PURE__ */ l(
433
+ ee,
434
+ {
435
+ prefixCls: c,
436
+ levelIndent: a,
437
+ level: i
438
+ }
439
+ ),
440
+ r,
441
+ k(),
442
+ F && S === "horizontal" ? /* @__PURE__ */ l("div", { className: `${c}-selected-label` }) : null
443
+ ]
444
+ }
445
+ )
446
+ }
447
+ );
448
+ };
449
+ function dn(s, n) {
450
+ const { children: e, popup: o, level: t } = s, { mode: r, collapse: i, inDropdown: u, collectInlineMenuKeys: f } = K(z), C = !!(typeof o == "function" ? o(t) : o) || i || u || r !== "vertical" ? pn : un;
451
+ return Z(() => (f(s._key), () => {
452
+ f(s._key, !0);
453
+ }), []), /* @__PURE__ */ l(C, { forwardedRef: n, ...s, children: e });
454
+ }
455
+ const fn = X(dn), te = fn;
456
+ te.displayName = "SubMenu";
457
+ te.menuType = "SubMenu";
458
+ const mn = 5;
459
+ function be(s) {
460
+ return s && Math.ceil(+s.getBoundingClientRect().width);
461
+ }
462
+ function Me(s) {
463
+ const n = Number(s.replace("px", ""));
464
+ return isNaN(n) ? 0 : n;
465
+ }
466
+ const hn = (s) => {
467
+ const { children: n, ellipsisText: e = "···", onEllipsisChange: o } = s, { prefixCls: t } = K(z), r = J(null), [i, u] = Ce(null), f = `${t}-overflow-sub-menu`, h = `${t}-overflow-hidden-menu-item`, p = `${t}-overflow-sub-menu-mirror`, C = (a) => {
468
+ if (a !== i) {
469
+ const y = L.Children.toArray(n), m = a === null;
470
+ o == null || o({
471
+ lastVisibleIndex: m ? y.length - 1 : a,
472
+ overflowNodes: m ? [] : y.slice(a + 1)
473
+ }), u(a);
474
+ }
475
+ };
476
+ function c() {
477
+ if (!r.current)
478
+ return;
479
+ const a = r.current, y = be(a) - mn, m = [].slice.call(a.children);
480
+ let g = 0, M = 0, v = 0;
481
+ for (let I = 0; I < m.length; I++) {
482
+ const d = m[I], x = d.className.split(" "), $ = x.indexOf(f) > -1, T = x.indexOf(p) > -1;
483
+ if ($)
484
+ continue;
485
+ const P = be(d) + Me(ge(d, "marginLeft")) + Me(ge(d, "marginRight"));
486
+ if (T) {
487
+ v = P;
488
+ continue;
489
+ }
490
+ if (M += P, M > y) {
491
+ C(
492
+ // 判断如果将最后一个菜单项换为 ... 是否会超出宽度
493
+ g - (M - P + v <= y ? 1 : 2)
494
+ );
495
+ return;
496
+ }
497
+ g++;
498
+ }
499
+ C(null);
500
+ }
501
+ const S = (a, y = !1) => /* @__PURE__ */ l(
502
+ te,
503
+ {
504
+ title: /* @__PURE__ */ l("span", { children: e }),
505
+ className: y ? p : f,
506
+ children: a
507
+ },
508
+ `pqb-menu-overflow-sub-menu${y ? "-mirror" : ""}`
509
+ ), E = () => {
510
+ let a = null;
511
+ const y = S(null, !0), m = L.Children.map(n, (g, M) => {
512
+ var I;
513
+ let v = g;
514
+ if (i !== null && (M > i && (v = L.cloneElement(g, {
515
+ className: H(
516
+ h,
517
+ (I = g == null ? void 0 : g.props) == null ? void 0 : I.className
518
+ )
519
+ })), M === i + 1)) {
520
+ const d = L.Children.toArray(n).slice(i + 1).map(
521
+ (x) => L.cloneElement(x, {
522
+ key: x.props._key
523
+ })
524
+ );
525
+ a = S(d);
526
+ }
527
+ return v;
528
+ }) ?? [];
529
+ return [y, ...m, a];
530
+ };
531
+ return Z(() => {
532
+ const a = Xe([r.current], c);
533
+ return () => {
534
+ a();
535
+ };
536
+ }, [r.current]), /* @__PURE__ */ l("div", { className: `${t}-overflow-wrap`, ref: r, children: E() });
537
+ }, yn = "light", gn = {
538
+ mode: "vertical",
539
+ selectable: !0,
540
+ ellipsis: !0
541
+ };
542
+ function bn(s, n) {
543
+ const { getPrefixCls: e, componentConfig: o, rtl: t } = K(we), r = Ve(
544
+ s,
545
+ gn,
546
+ o == null ? void 0 : o.Menu
547
+ ), {
548
+ style: i,
549
+ children: u,
550
+ className: f,
551
+ prefixCls: h,
552
+ mode: p,
553
+ theme: C,
554
+ icons: c,
555
+ levelIndent: S,
556
+ collapse: E,
557
+ inDropdown: a,
558
+ selectable: y,
559
+ triggerProps: m,
560
+ tooltipProps: g,
561
+ ellipsis: M,
562
+ accordion: v,
563
+ autoOpen: I,
564
+ autoScrollIntoView: d,
565
+ scrollConfig: x,
566
+ hasCollapseButton: $,
567
+ defaultOpenKeys: T,
568
+ defaultSelectedKeys: P,
569
+ openKeys: A,
570
+ selectedKeys: w,
571
+ onClickSubMenu: k,
572
+ onClickMenuItem: F,
573
+ onCollapseChange: V,
574
+ onEllipsisChange: q,
575
+ ..._
576
+ } = r, [N, ue] = re([], {
577
+ defaultValue: T,
578
+ value: A
579
+ }), [$e, Pe] = re([], {
580
+ defaultValue: P,
581
+ value: w
582
+ }), [Q, Ee] = re(!1, {
583
+ value: E
584
+ }), Oe = K(z), { siderCollapsed: Te } = K(We), D = h || e("menu"), Y = Te || Q || a || p === "popButton", pe = C || Oe.theme || yn, G = J([]), de = J([]), _e = Fe(), De = Ge(), fe = Be(() => ke(u), [u]), Re = le(`${D}-`), oe = _.id || Re;
585
+ Z(() => {
586
+ let b = N.filter(
587
+ (O) => G.current.indexOf(O) !== -1
588
+ );
589
+ if (I) {
590
+ const O = G.current.filter(
591
+ (R) => de.current.indexOf(R) === -1
592
+ );
593
+ b = N.concat(O);
594
+ }
595
+ ue(v ? b.slice(0, 1) : b), de.current = G.current.slice();
596
+ }, [G.current.toString()]);
597
+ const me = p !== "horizontal" && p !== "popButton" && !a && $, Ke = () => {
598
+ const b = ne(u, { level: 1 }), O = Q ? c && c.collapseActive || /* @__PURE__ */ l(Ue, {}) : c && c.collapseDefault || /* @__PURE__ */ l(Ae, {}), R = () => {
599
+ const U = !Q;
600
+ Ee(U), V == null || V(U);
601
+ };
602
+ return /* @__PURE__ */ B(ve, { children: [
603
+ /* @__PURE__ */ l("div", { className: `${D}-inner`, children: p === "horizontal" && M !== !1 ? /* @__PURE__ */ l(
604
+ hn,
605
+ {
606
+ ellipsisText: He(M) ? M.text : "···",
607
+ onEllipsisChange: q,
608
+ children: b
609
+ }
610
+ ) : b }),
611
+ me && /* @__PURE__ */ l(
612
+ "div",
613
+ {
614
+ tabIndex: 0,
615
+ role: "button",
616
+ "aria-controls": oe,
617
+ "aria-expanded": !Q,
618
+ className: `${D}-collapse-button`,
619
+ onClick: R,
620
+ ...De({ onPressEnter: R }),
621
+ children: O
622
+ }
623
+ )
624
+ ] });
625
+ }, he = { ...i };
626
+ return Y && !a && delete he.width, /* @__PURE__ */ l(
627
+ "div",
628
+ {
629
+ id: me ? oe : void 0,
630
+ role: "menu",
631
+ ...W(_, ["isMenu"]),
632
+ ref: n,
633
+ style: he,
634
+ className: H(
635
+ D,
636
+ `${D}-${pe}`,
637
+ `${D}-${p === "horizontal" ? "horizontal" : "vertical"}`,
638
+ {
639
+ [`${D}-collapse`]: Y,
640
+ // 缩起状态自动变成 pop 模式
641
+ [`${D}-pop`]: p === "pop" || Y,
642
+ [`${D}-pop-button`]: p === "popButton",
643
+ [`${D}-rtl`]: t
644
+ },
645
+ f
646
+ ),
647
+ children: /* @__PURE__ */ l(
648
+ z.Provider,
649
+ {
650
+ value: {
651
+ mode: p,
652
+ theme: pe,
653
+ collapse: Y,
654
+ levelIndent: S,
655
+ inDropdown: a,
656
+ selectedKeys: $e,
657
+ openKeys: N,
658
+ icons: c,
659
+ triggerProps: m,
660
+ tooltipProps: g,
661
+ autoScrollIntoView: d,
662
+ scrollConfig: x,
663
+ // pass props directly
664
+ id: oe,
665
+ prefixCls: D,
666
+ collectInlineMenuKeys: (b, O) => {
667
+ O ? G.current = G.current.filter(
668
+ (R) => R !== b
669
+ ) : G.current.push(b), _e();
670
+ },
671
+ onClickMenuItem: (b, O) => {
672
+ var R;
673
+ y && Pe([b]), F == null || F(b, O, (R = fe[b]) == null ? void 0 : R.keyPath);
674
+ },
675
+ onClickSubMenu: (b, O, R) => {
676
+ var ye;
677
+ let U = [...N];
678
+ R === "inline" && ((N == null ? void 0 : N.indexOf(b)) > -1 ? v && O === 1 ? U = [] : U = N.filter((Le) => Le !== b) : v && O === 1 ? U = [b] : U = N.concat([b])), ue(U), k == null || k(b, U, (ye = fe[b]) == null ? void 0 : ye.keyPath);
679
+ }
680
+ },
681
+ children: Ke()
682
+ }
683
+ )
684
+ }
685
+ );
686
+ }
687
+ const Mn = X(bn), j = Mn;
688
+ j.displayName = "Menu";
689
+ j.Item = ce;
690
+ j.SubMenu = te;
691
+ j.ItemGroup = ae;
692
+ j.__PQB_MENU__ = !0;
693
+ export {
694
+ ce as I,
695
+ j as M,
696
+ te as S,
697
+ ae as a
698
+ };