@unicom-cloud/ui 0.8.65 → 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 (358) 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 -237
  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 +1463 -1395
  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/{DIx0qmCq.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/{DXZEpA3t.js → BBvWDeuZ.js} +67 -67
  87. package/chunk/BCftTxEy.js +626 -0
  88. package/chunk/{CsbCHnFk.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/{DK4KcodH.js → C42LIMP9.js} +244 -242
  105. package/chunk/C4YkFMzC.js +778 -0
  106. package/chunk/{CF6p9R93.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/{Bqk6yh16.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/{DjtWv6Wn.js → CNmmhbCn.js} +32 -32
  113. package/chunk/{BUCEs557.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/{DTjcKyDN.js → C_gJWGGh.js} +201 -201
  118. package/chunk/{CPcm9Cm5.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/{Dnycc1qJ.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/{DG-epQqF.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/{CIlGCedk.js → SLWP34OR.js} +90 -85
  154. package/chunk/VVKtwaGf.js +278 -0
  155. package/chunk/WPNpLxSI.js +16 -0
  156. package/chunk/{DLvMA1OW.js → WpO_DsK4.js} +49 -48
  157. package/chunk/fdU3ang6.js +14 -0
  158. package/chunk/{DqFhzTWC.js → fkclKOAL.js} +298 -292
  159. package/chunk/flvYlqx3.js +22 -0
  160. package/chunk/kTDayEpF.js +288 -0
  161. package/chunk/{DQDkV47j.js → pZoNQ75H.js} +31 -31
  162. package/chunk/qFf1w_Jq.js +8 -0
  163. package/chunk/{CH1UUxsg.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/1GQdnTJp.js +0 -284
  332. package/chunk/BAWsPQBM.js +0 -11
  333. package/chunk/BS09tn7B.js +0 -638
  334. package/chunk/BqGtwxTi.js +0 -777
  335. package/chunk/BqufsN8i.js +0 -376
  336. package/chunk/BtlvlGQN.js +0 -278
  337. package/chunk/C2lIz2F9.js +0 -60
  338. package/chunk/CGZ0In1p.js +0 -776
  339. package/chunk/CWgltRVL.js +0 -698
  340. package/chunk/D3NFxdmG.js +0 -518
  341. package/chunk/DApXtulb.js +0 -1102
  342. package/chunk/DlLL5JQo.js +0 -1501
  343. package/chunk/Dv_xRzvR.js +0 -269
  344. package/chunk/Ek8U5CTN.js +0 -1032
  345. package/chunk/ewRDIDUz.js +0 -995
  346. package/chunk/l0sNRNKZ.js +0 -1
  347. package/chunk/tYXLFPVI.js +0 -871
  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
  358. /package/style/{variable.less → variables.less} +0 -0
@@ -1,30 +1,30 @@
1
- import { jsxs as Se, jsx as E } from "react/jsx-runtime";
2
- import { H as ve, z as Ve, G as Pe } from "./CSC_V_25.js";
1
+ import { jsxs as Se, jsx as W } from "react/jsx-runtime";
2
+ import { H as Ve, z as ve, G as Pe } from "./CSC_V_25.js";
3
3
  import Ke from "lodash/debounce";
4
4
  import B from "lodash/isArray";
5
- import W from "lodash/isFunction";
6
- import Ie from "lodash/isNil";
7
- import { forwardRef as ue, useRef as w, useCallback as K, useMemo as Y, useImperativeHandle as de, useContext as fe, useState as ee, useEffect as ce } from "react";
8
- import { d as he } from "./DlLL5JQo.js";
9
- import { useId as _e } from "../hooks/useId.js";
10
- import { useIsFirstRender as Te } from "../hooks/useIsFirstRender.js";
11
- import { useMergeProps as Oe } from "../hooks/useMergeProps.js";
12
- import { useMergeValue as ie } from "../hooks/useMergeValue.js";
5
+ import E from "lodash/isFunction";
6
+ import _e from "lodash/isNil";
7
+ import { forwardRef as ue, useRef as D, useCallback as K, useMemo as Y, useImperativeHandle as de, useContext as fe, useState as ee, useEffect as ce } from "react";
8
+ import { a as he } from "./BJQ5UNa-.js";
9
+ import { a as Ie } from "./DRtM649q.js";
10
+ import { u as Te } from "./CLiqJm_T.js";
11
+ import { c as Oe } from "./B5gK1Idp.js";
12
+ import { R as ie } from "./HDUQku8d.js";
13
13
  import xe from "../SelectView.js";
14
- import { T as O, g as Le, a as Re, b as we } from "./ewRDIDUz.js";
15
- import De from "../Trigger.js";
16
- import { y as Z } from "./BAWsPQBM.js";
17
- import "../utils/is.js";
14
+ import { T as O, g as Le, a as we, b as De } from "./DsRSHWtX.js";
15
+ import Re from "../Trigger.js";
16
+ import { m as Z } from "./JPPo5nY_.js";
17
+ import "./CkNSv2U7.js";
18
18
  import He from "lodash/isString";
19
19
  import H from "lodash/get";
20
- import { useForceUpdate as Ne } from "../hooks/useForceUpdate.js";
21
- import { useUpdateEffect as te } from "../hooks/useUpdateEffect.js";
20
+ import { c as Ne } from "./BP9sYyk9.js";
21
+ import { c as te } from "./BbEYToV1.js";
22
22
  import oe from "lodash/isEqualWith";
23
23
  import me from "lodash/isPlainObject";
24
- import Ee from "lodash/isUndefined";
25
- import { usePrevious as Fe } from "../hooks/usePrevious.js";
24
+ import We from "lodash/isUndefined";
25
+ import { n as Ae } from "./DU6bs_19.js";
26
26
  import se from "lodash/isPlainObject.js";
27
- function We(t, a) {
27
+ function Ee(t, a) {
28
28
  const {
29
29
  value: n,
30
30
  multiple: f,
@@ -34,11 +34,11 @@ function We(t, a) {
34
34
  treeData: u,
35
35
  treeProps: p,
36
36
  prefixCls: l,
37
- treeCheckable: V
38
- } = t, C = p && p.renderTitle, m = w(), d = K(
37
+ treeCheckable: v
38
+ } = t, C = p && p.renderTitle, m = D(), d = K(
39
39
  (b, { checkedNodes: o, checked: s, node: g }) => {
40
40
  const P = b.map((y) => {
41
- const T = o.find((I) => I && I.props._key === y);
41
+ const T = o.find((_) => _ && _.props._key === y);
42
42
  return T ? {
43
43
  label: T.props.title,
44
44
  value: T.props._key,
@@ -54,7 +54,7 @@ function We(t, a) {
54
54
  });
55
55
  },
56
56
  [t.onChange, n]
57
- ), _ = K(
57
+ ), I = K(
58
58
  (b, { node: o, selected: s }) => {
59
59
  let g = [
60
60
  {
@@ -73,13 +73,13 @@ function We(t, a) {
73
73
  t.onChange(g, { trigger: o == null ? void 0 : o.props, selected: s });
74
74
  },
75
75
  [t.onChange, n, f]
76
- ), D = K((b, { node: o, e: s }) => {
77
- var I, N;
76
+ ), R = K((b, { node: o, e: s }) => {
77
+ var _, N;
78
78
  const { checked: g, checkable: P, disabled: y, disableCheckbox: T } = o.props;
79
- m.current && !T && !y && P !== !1 && ((N = (I = m.current) == null ? void 0 : I.handleCheck) == null || N.call(I, !g, o.props._key, s));
79
+ m.current && !T && !y && P !== !1 && ((N = (_ = m.current) == null ? void 0 : _.handleCheck) == null || N.call(_, !g, o.props._key, s));
80
80
  }, []), x = K(
81
81
  (b) => {
82
- if (W(h)) {
82
+ if (E(h)) {
83
83
  const o = b.props.dataRef;
84
84
  return h(b, o);
85
85
  }
@@ -98,7 +98,7 @@ function We(t, a) {
98
98
  const P = s.substring(0, g + 1), y = s.substring(g + o.length);
99
99
  return /* @__PURE__ */ Se("span", { children: [
100
100
  P,
101
- /* @__PURE__ */ E("span", { className: `${l}-highlight`, children: s.substring(g, o.length + 1) }),
101
+ /* @__PURE__ */ W("span", { className: `${l}-highlight`, children: s.substring(g, o.length + 1) }),
102
102
  y
103
103
  ] });
104
104
  }
@@ -108,13 +108,13 @@ function We(t, a) {
108
108
  ), S = Y(() => t.treeCheckable ? {
109
109
  onCheck: d,
110
110
  checkedKeys: n.map((b) => b.value)
111
- } : {}, [d, n, t.treeCheckable]), G = Y(() => t.treeCheckable ? [] : n.map((b) => b.value), [t.treeCheckable, n]), F = K(
111
+ } : {}, [d, n, t.treeCheckable]), G = Y(() => t.treeCheckable ? [] : n.map((b) => b.value), [t.treeCheckable, n]), A = K(
112
112
  (b, o) => {
113
- t.treeCheckable ? D(b, o) : _(b, o);
113
+ t.treeCheckable ? R(b, o) : I(b, o);
114
114
  },
115
- [t.treeCheckable, D, _]
115
+ [t.treeCheckable, R, I]
116
116
  );
117
- return de(a, () => m.current, []), /* @__PURE__ */ E(
117
+ return de(a, () => m.current, []), /* @__PURE__ */ W(
118
118
  O,
119
119
  {
120
120
  ref: m,
@@ -122,7 +122,7 @@ function We(t, a) {
122
122
  blockNode: !0,
123
123
  filterNode: t.filterNode,
124
124
  ...p,
125
- checkable: V,
125
+ checkable: v,
126
126
  multiple: f,
127
127
  loadMore: t.loadMore ? x : void 0,
128
128
  checkedStrategy: i,
@@ -134,12 +134,12 @@ function We(t, a) {
134
134
  treeData: u,
135
135
  fieldNames: t.fieldNames,
136
136
  renderTitle: q,
137
- onSelect: F,
137
+ onSelect: A,
138
138
  selectedKeys: G
139
139
  }
140
140
  );
141
141
  }
142
- const Ae = ue(We), be = {
142
+ const Fe = ue(Ee), be = {
143
143
  key: "key",
144
144
  title: "title",
145
145
  children: "children",
@@ -153,8 +153,8 @@ const Ae = ue(We), be = {
153
153
  let h = 0;
154
154
  const i = (e, u) => {
155
155
  const p = e.length;
156
- return e.map((l, V) => {
157
- const C = H(l, n.children) || l[n.children], m = H(l, n.key) || l[n.key] || `${(u == null ? void 0 : u._key) || ""}-${V}`, d = {
156
+ return e.map((l, v) => {
157
+ const C = H(l, n.children) || l[n.children], m = H(l, n.key) || l[n.key] || `${(u == null ? void 0 : u._key) || ""}-${v}`, d = {
158
158
  ...l,
159
159
  title: H(l, n.title) || l[n.title],
160
160
  selectable: H(l, n.selectable) || l[n.selectable],
@@ -170,7 +170,7 @@ const Ae = ue(We), be = {
170
170
  _level: u._level || 0,
171
171
  _index: h++
172
172
  };
173
- return p === V + 1 && (d.className = Z(
173
+ return p === v + 1 && (d.className = Z(
174
174
  `${a}-node-is-tail`,
175
175
  d.className
176
176
  )), f[m] = d, C && C.length && (f[m].children = i(C, {
@@ -181,20 +181,20 @@ const Ae = ue(We), be = {
181
181
  });
182
182
  };
183
183
  return i(t || [], {}), f;
184
- }, Me = (t, a) => {
184
+ }, $e = (t, a) => {
185
185
  const { getPrefixCls: n } = fe(he), f = {
186
186
  ...be,
187
187
  ...a
188
- }, h = Ne(), i = n("tree"), e = w(
188
+ }, h = Ne(), i = n("tree"), e = D(
189
189
  ae(t, i, f)
190
190
  );
191
191
  return te(() => {
192
192
  e.current = ae(t, i, f), h();
193
193
  }, [t]), e.current;
194
- }, j = (t) => {
194
+ }, z = (t) => {
195
195
  let a = t;
196
196
  return B(t) || (a = t == null ? [] : [t]), a.map((n) => me(n) ? n.value : n);
197
- }, z = (t, a, n) => t == null ? [] : (B(t) ? t : [t]).map((h) => {
197
+ }, U = (t, a, n) => t == null ? [] : (B(t) ? t : [t]).map((h) => {
198
198
  let i = me(h) ? { ...h } : { value: h, label: void 0 };
199
199
  const e = a[i.value];
200
200
  if (e)
@@ -206,8 +206,8 @@ const Ae = ue(We), be = {
206
206
  ...u
207
207
  };
208
208
  }
209
- return Ee(i.label) && (i.label = i.value), i;
210
- }), $e = (t, a, n, f) => {
209
+ return We(i.label) && (i.label = i.value), i;
210
+ }), Me = (t, a, n, f) => {
211
211
  if (!f.treeCheckStrictly) {
212
212
  const { checkedKeys: h, indeterminateKeys: i } = Le(t, a);
213
213
  let e = h;
@@ -222,35 +222,35 @@ const Ae = ue(We), be = {
222
222
  })), e;
223
223
  }
224
224
  return n.current = [], t;
225
- }, Ue = (t, a, n) => {
226
- const f = w([]), h = () => {
225
+ }, je = (t, a, n) => {
226
+ const f = D([]), h = () => {
227
227
  const l = t.value || t.defaultValue || [];
228
228
  if (t.treeCheckable) {
229
- const V = $e(
230
- j(l),
229
+ const v = Me(
230
+ z(l),
231
231
  a,
232
232
  n,
233
233
  t
234
- ), C = z(
234
+ ), C = U(
235
235
  l,
236
236
  a,
237
237
  f.current
238
238
  );
239
- return z(
240
- V,
239
+ return U(
240
+ v,
241
241
  a,
242
242
  C
243
243
  );
244
244
  }
245
- return z(l, a);
245
+ return U(l, a);
246
246
  }, [i, e] = ee(h), u = (l) => {
247
247
  f.current = l, e(l);
248
248
  };
249
249
  te(() => {
250
250
  const l = h();
251
251
  "value" in t && (t.labelInValue ? oe(
252
- j(i),
253
- j(l)
252
+ z(i),
253
+ z(l)
254
254
  ) || u(l) : oe(i, l) || u(l));
255
255
  }, [
256
256
  t.treeCheckedStrategy,
@@ -260,11 +260,11 @@ const Ae = ue(We), be = {
260
260
  a
261
261
  ]);
262
262
  const p = K(
263
- (l, V) => {
263
+ (l, v) => {
264
264
  const { onChange: C, labelInValue: m } = t, d = t.multiple || t.treeCheckable;
265
265
  "value" in t || u(l);
266
- let _;
267
- d ? _ = l.map((D) => m ? { label: D.label, value: D.value } : D.value) : _ = m ? l[0] : l[0] && l[0].value, C == null || C(_, V);
266
+ let I;
267
+ d ? I = l.map((R) => m ? { label: R.label, value: R.value } : R.value) : I = m ? l[0] : l[0] && l[0].value, C == null || C(I, v);
268
268
  },
269
269
  [
270
270
  t.onChange,
@@ -276,22 +276,22 @@ const Ae = ue(We), be = {
276
276
  );
277
277
  return [i, p];
278
278
  };
279
- function je(t) {
280
- const a = Fe(t) || {}, n = () => t.treeData || Re(t.children), [f, h] = ee(n());
279
+ function ze(t) {
280
+ const a = Ae(t) || {}, n = () => t.treeData || we(t.children), [f, h] = ee(n());
281
281
  return te(() => {
282
282
  (t.treeData !== a.treeData || t.children !== a.children) && h(n());
283
283
  }, [t]), [f];
284
284
  }
285
- const ze = {
285
+ const Ue = {
286
286
  bordered: !0,
287
287
  treeCheckedStrategy: O.SHOW_CHILD,
288
288
  fieldNames: be
289
289
  }, Be = { bottom: 4 }, qe = (t, a) => {
290
290
  const { getPrefixCls: n, renderEmpty: f, componentConfig: h, rtl: i } = fe(he), e = Oe(
291
291
  t,
292
- ze,
292
+ Ue,
293
293
  h == null ? void 0 : h.TreeSelect
294
- ), u = Te(), p = w(), l = w(null), V = w(null), C = w([]), [m] = je(e), d = Me(m, e.fieldNames), [_, D] = ee(), [x, q] = ie(!1, {
294
+ ), u = Te(), p = D(), l = D(null), v = D(null), C = D([]), [m] = ze(e), d = $e(m, e.fieldNames), [I, R] = ee(), [x, q] = ie(!1, {
295
295
  value: e.popupVisible
296
296
  }), [S, G] = ie(
297
297
  void 0,
@@ -299,40 +299,41 @@ const ze = {
299
299
  {
300
300
  value: "inputValue" in e ? e.inputValue || "" : void 0
301
301
  }
302
- ), F = w(S), b = w(null), { onInputValueChange: o } = e, [s, g] = Ue(
302
+ ), A = D(S), b = D(null), { onInputValueChange: o } = e, [s, g] = je(
303
303
  e,
304
304
  d,
305
305
  C
306
- ), P = e.multiple || e.treeCheckable, y = n("tree-select"), T = S && !W(e.onSearch), I = _e(`${y}-popup-`), N = (r) => {
306
+ ), P = e.multiple || e.treeCheckable, y = n("tree-select"), T = S && !E(e.onSearch), _ = Ie(`${y}-popup-`), N = (r) => {
307
307
  var c;
308
308
  r !== x && (q(r), (c = e.onVisibleChange) == null || c.call(e, r));
309
309
  }, J = (r, c) => {
310
- (r !== F.current || c !== b.current) && (G(r), F.current = r, b.current = c, o == null || o(r, c));
310
+ (r !== A.current || c !== b.current) && (G(r), A.current = r, b.current = c, o == null || o(r, c));
311
311
  }, ge = K(
312
312
  (r) => Ke(async (k) => {
313
- if (W(e.onSearch)) {
313
+ if (E(e.onSearch)) {
314
314
  await e.onSearch(k);
315
315
  return;
316
316
  }
317
- if (!k) return m;
318
- const v = /* @__PURE__ */ new Set();
317
+ if (!k)
318
+ return m;
319
+ const V = /* @__PURE__ */ new Set();
319
320
  Object.keys(d).forEach((L) => {
320
- const R = d[L];
321
- let $ = !1;
322
- if (W(e.filterTreeNode))
323
- e.filterTreeNode(k, /* @__PURE__ */ E(O.Node, { ...R })) && ($ = !0);
321
+ const w = d[L];
322
+ let M = !1;
323
+ if (E(e.filterTreeNode))
324
+ e.filterTreeNode(k, /* @__PURE__ */ W(O.Node, { ...w })) && (M = !0);
324
325
  else {
325
- const U = R.value || R._key;
326
- U && U.indexOf(k) > -1 && ($ = !0);
326
+ const j = w.value || w._key;
327
+ j && j.indexOf(k) > -1 && (M = !0);
327
328
  }
328
- $ && v.add(R.key);
329
- }), D(v);
329
+ M && V.add(w.key);
330
+ }), R(V);
330
331
  }, 100)(r),
331
332
  [e.onSearch, m, d, e.filterTreeNode]
332
333
  ), re = K(() => {
333
334
  let r = !0;
334
335
  se(e.showSearch) && (r = e.showSearch.retainInputValueWhileSelect !== !1), e.multiple && !r && S !== void 0 && J("", "optionChecked");
335
- }, [S, e.multiple, JSON.stringify(e.showSearch)]), M = K(
336
+ }, [S, e.multiple, JSON.stringify(e.showSearch)]), $ = K(
336
337
  (r, c) => {
337
338
  g(r, c), re(), P || N(!1);
338
339
  },
@@ -340,44 +341,44 @@ const ze = {
340
341
  ), pe = (r, c, k) => {
341
342
  if (k.stopPropagation(), r.disabled)
342
343
  return;
343
- const v = se(r.value) ? r.value.value : r.value;
344
- if (!e.treeCheckable || e.treeCheckStrictly || !d[v]) {
345
- const R = s.filter(($, U) => U !== c);
346
- M(R, {
347
- trigger: d[v] || r,
344
+ const V = se(r.value) ? r.value.value : r.value;
345
+ if (!e.treeCheckable || e.treeCheckStrictly || !d[V]) {
346
+ const w = s.filter((M, j) => j !== c);
347
+ $(w, {
348
+ trigger: d[V] || r,
348
349
  checked: !1,
349
350
  selected: !1
350
351
  });
351
352
  return;
352
353
  }
353
- const L = we(
354
- v,
354
+ const L = De(
355
+ V,
355
356
  !1,
356
- j(s),
357
+ z(s),
357
358
  d,
358
359
  C.current
359
360
  );
360
- C.current = L.indeterminateKeys, M(z(L.checkedKeys, d, s), {
361
- trigger: d[v],
361
+ C.current = L.indeterminateKeys, $(U(L.checkedKeys, d, s), {
362
+ trigger: d[V],
362
363
  checked: !1,
363
364
  selected: !1
364
365
  });
365
366
  };
366
367
  function Q(r) {
367
- return ve(r) || Ve(r) || Pe(r);
368
+ return Ve(r) || ve(r) || Pe(r);
368
369
  }
369
370
  ce(() => {
370
- S !== void 0 && ge(S), S !== F.current && (F.current = S);
371
+ S !== void 0 && ge(S), S !== A.current && (A.current = S);
371
372
  }, [S]);
372
373
  const X = Y(() => {
373
374
  let r = [];
374
375
  if (S)
375
376
  for (const c in d) {
376
- const v = [...d[c].pathParentKeys, c];
377
- v.some((L) => _ && _.has(L)) && (r = r.concat(v));
377
+ const V = [...d[c].pathParentKeys, c];
378
+ V.some((L) => I && I.has(L)) && (r = r.concat(V));
378
379
  }
379
380
  return Array.from(new Set(r));
380
- }, [S, d, _]);
381
+ }, [S, d, I]);
381
382
  ce(() => {
382
383
  x ? setTimeout(() => {
383
384
  const r = s[0];
@@ -385,14 +386,14 @@ const ze = {
385
386
  }) : u || S && J("", "optionListHide");
386
387
  }, [x]), de(a, () => ({
387
388
  focus() {
388
- V.current && V.current.focus();
389
+ v.current && v.current.focus();
389
390
  },
390
391
  blur() {
391
- V.current && V.current.blur();
392
+ v.current && v.current.blur();
392
393
  },
393
394
  getRootDOMNode: () => {
394
395
  var r, c;
395
- return (c = (r = V.current) == null ? void 0 : r.getRootDOMNode) == null ? void 0 : c.call(r);
396
+ return (c = (r = v.current) == null ? void 0 : r.getRootDOMNode) == null ? void 0 : c.call(r);
396
397
  }
397
398
  }));
398
399
  const Ce = K(
@@ -401,17 +402,17 @@ const ze = {
401
402
  ), ke = K(
402
403
  (r) => {
403
404
  const { disabled: c, value: k } = r || {};
404
- let v = r == null ? void 0 : r.label;
405
- return W(e.renderFormat) && (v = e.renderFormat(
405
+ let V = r == null ? void 0 : r.label;
406
+ return E(e.renderFormat) && (V = e.renderFormat(
406
407
  d[k] || null,
407
408
  e.labelInValue ? r : k
408
- )), { text: v || k || "", disabled: c };
409
+ )), { text: V || k || "", disabled: c };
409
410
  },
410
411
  [e.renderFormat, e.labelInValue, d]
411
412
  ), ye = (r) => {
412
413
  g(r, {});
413
- }, ne = (r) => /* @__PURE__ */ E(
414
- De,
414
+ }, ne = (r) => /* @__PURE__ */ W(
415
+ Re,
415
416
  {
416
417
  autoAlignPopupWidth: !1,
417
418
  autoAlignPopupMinWidth: !0,
@@ -428,9 +429,9 @@ const ze = {
428
429
  e.triggerProps && e.triggerProps.className
429
430
  ),
430
431
  popup: () => {
431
- var v, L, R;
432
- const c = e.dropdownRender, k = T && Q(X) || Q(m) ? e.notFoundContent || (f == null ? void 0 : f("TreeSelect")) : /* @__PURE__ */ E(
433
- Ae,
432
+ var V, L, w;
433
+ const c = e.dropdownRender, k = T && Q(X) || Q(m) ? e.notFoundContent || (f == null ? void 0 : f("TreeSelect")) : /* @__PURE__ */ W(
434
+ Fe,
434
435
  {
435
436
  prefixCls: y,
436
437
  ref: l,
@@ -438,23 +439,23 @@ const ze = {
438
439
  inputValue: S,
439
440
  filterNode: Ce,
440
441
  value: s,
441
- onChange: M,
442
+ onChange: $,
442
443
  multiple: P,
443
444
  treeData: m
444
445
  }
445
446
  );
446
- return /* @__PURE__ */ E(
447
+ return /* @__PURE__ */ W(
447
448
  "div",
448
449
  {
449
- id: I,
450
+ id: _,
450
451
  className: Z(`${y}-popup`, {
451
452
  [`${y}-rtl-popup`]: i
452
453
  }),
453
454
  style: {
454
- maxHeight: (v = e.treeProps) != null && v.height || (R = (L = e.treeProps) == null ? void 0 : L.virtualListProps) != null && R.height ? "unset" : "",
455
+ maxHeight: (V = e.treeProps) != null && V.height || (w = (L = e.treeProps) == null ? void 0 : L.virtualListProps) != null && w.height ? "unset" : "",
455
456
  ...e.dropdownMenuStyle
456
457
  },
457
- children: W(c) ? c(k) : k
458
+ children: E(c) ? c(k) : k
458
459
  }
459
460
  );
460
461
  },
@@ -472,12 +473,12 @@ const ze = {
472
473
  (k) => e.labelInValue ? { label: k.label, value: k.value } : k.value
473
474
  ) : r = e.labelInValue ? s[0] : (c = s[0]) == null ? void 0 : c.value, e.triggerElement({ value: r });
474
475
  })() : e.triggerElement;
475
- return Ie(le) ? /* @__PURE__ */ E(
476
+ return _e(le) ? /* @__PURE__ */ W(
476
477
  xe,
477
478
  {
478
- ref: V,
479
+ ref: v,
479
480
  rtl: i,
480
- ariaControls: I,
481
+ ariaControls: _,
481
482
  ...e,
482
483
  popupVisible: x,
483
484
  value: !P && B(s) ? s[0] : s,
@@ -490,7 +491,7 @@ const ze = {
490
491
  onRemoveCheckedItem: pe,
491
492
  onClear: (r) => {
492
493
  var c;
493
- r.stopPropagation(), M([], {}), (c = e.onClear) == null || c.call(e, !!x);
494
+ r.stopPropagation(), $([], {}), (c = e.onClear) == null || c.call(e, !!x);
494
495
  },
495
496
  onKeyDown: (r) => {
496
497
  var c;
@@ -505,14 +506,14 @@ const ze = {
505
506
  renderView: ne
506
507
  }
507
508
  ) : ne(le);
508
- }, Ge = ue(qe), A = Ge;
509
- A.displayName = "TreeSelect";
510
- A.Node = O.Node;
511
- A.SHOW_ALL = O.SHOW_ALL;
512
- A.SHOW_PARENT = O.SHOW_PARENT;
513
- A.SHOW_CHILD = O.SHOW_CHILD;
509
+ }, Ge = ue(qe), F = Ge;
510
+ F.displayName = "TreeSelect";
511
+ F.Node = O.Node;
512
+ F.SHOW_ALL = O.SHOW_ALL;
513
+ F.SHOW_PARENT = O.SHOW_PARENT;
514
+ F.SHOW_CHILD = O.SHOW_CHILD;
514
515
  const St = O.Node;
515
516
  export {
516
- A as T,
517
+ F as T,
517
518
  St as a
518
519
  };
@@ -0,0 +1,6 @@
1
+ function r(t) {
2
+ return typeof t == "string" ? t.replace(/(\s{2,})|(\s{1,}$)/g, (e) => " ".repeat(e.length)) : t;
3
+ }
4
+ export {
5
+ r as l
6
+ };
@@ -0,0 +1,25 @@
1
+ import { useState as v, useEffect as s } from "react";
2
+ function f(o) {
3
+ const [e, t] = v({
4
+ value: o,
5
+ resolve: (r) => {
6
+ }
7
+ });
8
+ return s(() => {
9
+ e.resolve(e.value);
10
+ }, [e]), [
11
+ e.value,
12
+ (r) => new Promise((l) => {
13
+ t((n) => {
14
+ let u = r;
15
+ return typeof r == "function" && (u = r(n.value)), {
16
+ value: u,
17
+ resolve: l
18
+ };
19
+ });
20
+ })
21
+ ];
22
+ }
23
+ export {
24
+ f as i
25
+ };
@@ -0,0 +1,34 @@
1
+ import w from "lodash/debounce";
2
+ import { useState as c, useDeferredValue as h, useCallback as u, useEffect as a } from "react";
3
+ const l = (r = !1) => {
4
+ const [i, o] = c({
5
+ width: window.innerWidth,
6
+ height: window.innerHeight
7
+ }), s = h(
8
+ i
9
+ // 延迟一个值与防抖和节流之间有什么不同?
10
+ // 防抖 是指在用户停止输入一段时间(例如一秒钟)之后再更新列表。
11
+ // 节流 是指每隔一段时间(例如最多每秒一次)更新列表。
12
+ // 虽然这些技术在某些情况下是有用的,但 useDeferredValue 更适合优化渲染,因为它与 React 自身深度集成,并且能够适应用户的设备。
13
+ // 与防抖或节流不同,useDeferredValue 不需要选择任何固定延迟时间。如果用户的设备很快(比如性能强劲的笔记本电脑),延迟的重渲染几乎会立即发生并且不会被察觉。如果用户的设备较慢,那么列表会相应地“滞后”于输入,滞后的程度与设备的速度有关。
14
+ // 此外,与防抖或节流不同,useDeferredValue 执行的延迟重新渲染默认是可中断的。这意味着,如果 React 正在重新渲染一个大型列表,但用户进行了另一次键盘输入,React 会放弃该重新渲染,先处理键盘输入,然后再次开始在后台渲染。相比之下,防抖和节流仍会产生不顺畅的体验,因为它们是阻塞的:它们仅仅是将渲染阻塞键盘输入的时刻推迟了。
15
+ // 如果你要优化的工作不是在渲染期间发生的,那么防抖和节流仍然非常有用。例如,它们可以让你减少网络请求的次数。你也可以同时使用这些技术。
16
+ );
17
+ function t(e) {
18
+ const n = e.currentTarget || e.target || window;
19
+ o({
20
+ width: n.innerWidth,
21
+ height: n.innerHeight
22
+ });
23
+ }
24
+ const d = u(w(t, 123), []);
25
+ return a(() => {
26
+ const e = r ? d : t;
27
+ return window.addEventListener("resize", e), () => {
28
+ window.removeEventListener("resize", e);
29
+ };
30
+ }, []), s;
31
+ };
32
+ export {
33
+ l
34
+ };
@@ -0,0 +1,11 @@
1
+ function a(i, n, r, b) {
2
+ const c = n || {}, o = r || {}, s = i || {}, u = b ? new Set(b) : new Set(
3
+ Object.keys(s).concat(Object.keys(c)).concat(Object.keys(o))
4
+ ), t = {};
5
+ return u.forEach((e) => {
6
+ s[e] !== void 0 ? t[e] = s[e] : e in o ? t[e] = o[e] : e in c && (t[e] = c[e]);
7
+ }), t;
8
+ }
9
+ export {
10
+ a as b
11
+ };
@@ -0,0 +1,11 @@
1
+ import { useState as r, useEffect as u } from "react";
2
+ const n = {};
3
+ function c(e) {
4
+ const [o, f] = r();
5
+ return u(() => {
6
+ n[e] = e in n ? n[e] : 0, f(n[e]), n[e] += 1;
7
+ }, []), typeof o == "number" ? `${e}${o}` : void 0;
8
+ }
9
+ export {
10
+ c as a
11
+ };
@@ -0,0 +1,41 @@
1
+ import { jsx as t, Fragment as l } from "react/jsx-runtime";
2
+ import h from "lodash/escapeRegExp";
3
+ import m from "lodash/isArray";
4
+ import { cloneElement as a } from "react";
5
+ function x({
6
+ nodeList: r,
7
+ pattern: i,
8
+ highlightClassName: o
9
+ }) {
10
+ if (!i)
11
+ return r;
12
+ const n = (e) => e && e.props && typeof e.props.children == "string" ? a(
13
+ e,
14
+ void 0,
15
+ /* @__PURE__ */ t(
16
+ c,
17
+ {
18
+ text: e.props.children,
19
+ keyword: i,
20
+ highlightClassName: o
21
+ }
22
+ )
23
+ ) : e;
24
+ return m(r) ? r.map((e) => n(e)) : n(r);
25
+ }
26
+ function c({
27
+ text: r,
28
+ keyword: i,
29
+ highlightClassName: o
30
+ }) {
31
+ if (!i)
32
+ return /* @__PURE__ */ t(l, { children: r });
33
+ i.length > 1e3 && (i = i.slice(0, 1e3));
34
+ const n = new RegExp(`(${h(i)})`, "i"), e = r.split(n);
35
+ return /* @__PURE__ */ t(l, { children: e.map(
36
+ (s, p) => n.test(s) ? /* @__PURE__ */ t("span", { className: o, children: s }, p) : /* @__PURE__ */ t("span", { children: s }, p)
37
+ ) });
38
+ }
39
+ export {
40
+ x as E
41
+ };
@@ -0,0 +1,10 @@
1
+ import { useRef as t, useEffect as n } from "react";
2
+ function c(r) {
3
+ const e = t();
4
+ return n(() => {
5
+ e.current = r;
6
+ }), e.current;
7
+ }
8
+ export {
9
+ c as n
10
+ };