@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
@@ -0,0 +1,20 @@
1
+ import { useRef as a, useState as p, useEffect as s } from "react";
2
+ import "./CkNSv2U7.js";
3
+ import { n as c } from "./DU6bs_19.js";
4
+ import "./CSC_V_25.js";
5
+ import r from "lodash/isUndefined.js";
6
+ function E(n, i) {
7
+ const { defaultValue: t, value: e } = i || {}, u = a(!0), m = c(e), [f, o] = p(
8
+ r(e) ? r(t) ? n : t : e
9
+ );
10
+ return s(() => {
11
+ if (u.current) {
12
+ u.current = !1;
13
+ return;
14
+ }
15
+ e === void 0 && m !== e && o(e);
16
+ }, [e]), [r(e) ? f : e, o, f];
17
+ }
18
+ export {
19
+ E as R
20
+ };
@@ -0,0 +1,25 @@
1
+ import { useRef as i } from "react";
2
+ import { isServerRendering as s } from "../utils/dom.js";
3
+ import "./CkNSv2U7.js";
4
+ import "./CSC_V_25.js";
5
+ import u from "lodash/isUndefined.js";
6
+ const f = !s && !u(window == null ? void 0 : window.IntersectionObserver);
7
+ function b(t, o = {}) {
8
+ const r = i(), e = () => {
9
+ r.current && (r.current.disconnect(), r.current = null);
10
+ }, c = (n) => {
11
+ n && (e(), f && (r.current = new IntersectionObserver(
12
+ t,
13
+ o
14
+ ), r.current.observe(n)));
15
+ };
16
+ return {
17
+ observer: r.current,
18
+ cor: c,
19
+ dor: e
20
+ };
21
+ }
22
+ export {
23
+ b as O,
24
+ f
25
+ };
@@ -0,0 +1,9 @@
1
+ import l from "lodash/isPlainObject.js";
2
+ import n from "lodash/uniq.js";
3
+ function c(...e) {
4
+ const i = " ", r = e.map((o, f, a) => l(o) ? Object.keys(o).filter((t) => o[t]) : o).flat(1 / 0).filter(Boolean).join(i).split(i).filter(Boolean);
5
+ return n(r).join(i);
6
+ }
7
+ export {
8
+ c as m
9
+ };
@@ -1,47 +1,48 @@
1
- import { jsxs as g, jsx as e } from "react/jsx-runtime";
2
- import Ce from "@unicom-cloud/icons/IconUiImageClose";
3
- import Pe from "@unicom-cloud/icons/IconUiLoading";
4
- import _ from "lodash/isNumber";
1
+ import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
+ import Pe from "@unicom-cloud/icons/IconUiImageClose";
3
+ import Ie from "@unicom-cloud/icons/IconUiLoading";
4
+ import B from "lodash/isNumber";
5
5
  import ee from "lodash/isPlainObject";
6
- import Ie from "lodash/isUndefined";
7
- import xe, { useContext as re, useMemo as R, useRef as oe, useEffect as G } from "react";
8
- import { d as Ve } from "./DlLL5JQo.js";
9
- import { useInView as Le } from "../hooks/useInView.js";
10
- import { useKeyboardEvent as ye } from "../hooks/useKeyboardEvent.js";
11
- import { useMergeProps as Ee } from "../hooks/useMergeProps.js";
12
- import { useMergeValue as Fe } from "../hooks/useMergeValue.js";
13
- import { y as h } from "./BAWsPQBM.js";
14
- import Re from "../utils/omit.js";
15
- import Ge from "@unicom-cloud/icons/IconUiMore";
16
- import { T as Ue, P as ie, a as je, b as Me, u as Se } from "./DqFhzTWC.js";
6
+ import xe from "lodash/isUndefined";
7
+ import Le, { useContext as re, useMemo as R, useRef as oe, useEffect as G } from "react";
8
+ import { a as Ve } from "./BJQ5UNa-.js";
9
+ import { E as ye } from "./C_agcwLN.js";
10
+ import { h as Ee } from "./D2KPqPhV.js";
11
+ import { c as Fe } from "./B5gK1Idp.js";
12
+ import { R as Re } from "./HDUQku8d.js";
13
+ import { m as g } from "./JPPo5nY_.js";
14
+ import { c as Ge } from "./BdUcgWdu.js";
15
+ import Ue from "@unicom-cloud/icons/IconUiMore";
16
+ import { T as je, P as ie, a as Se, b as Te, u as ke } from "./fkclKOAL.js";
17
17
  function te(v) {
18
18
  const { title: w, description: $, actions: t } = v, a = w || $, l = t && t.length;
19
19
  return [a || l, a, l];
20
20
  }
21
- const ke = (v) => {
22
- const { style: w, className: $, title: t, description: a, actions: l, prefixCls: o, simple: x } = v, [s, V, b] = te({
21
+ const Ae = (v) => {
22
+ const { style: w, className: $, title: t, description: a, actions: l, prefixCls: o, simple: x } = v, [s, L, b] = te({
23
23
  title: t,
24
24
  description: a,
25
25
  actions: l
26
26
  });
27
- if (!s) return null;
28
- const c = `${o}-footer`, L = h(c, $, {
27
+ if (!s)
28
+ return null;
29
+ const c = `${o}-footer`, V = g(c, $, {
29
30
  [`${c}-with-actions`]: b
30
31
  }), y = () => {
31
32
  const N = /* @__PURE__ */ e("div", { className: `${o}-actions-list`, children: l.map((E, C) => /* @__PURE__ */ e("div", { className: `${o}-actions-item`, children: E }, `${C}`)) });
32
- return x ? /* @__PURE__ */ e("div", { className: `${o}-actions-list`, children: /* @__PURE__ */ e(Ue, { prefixCls: o, popup: () => N, children: /* @__PURE__ */ e(
33
+ return x ? /* @__PURE__ */ e("div", { className: `${o}-actions-list`, children: /* @__PURE__ */ e(je, { prefixCls: o, popup: () => N, children: /* @__PURE__ */ e(
33
34
  "div",
34
35
  {
35
- className: h(
36
+ className: g(
36
37
  `${o}-actions-item`,
37
38
  `${o}-actions-item-trigger`
38
39
  ),
39
- children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(Ge, {}) })
40
+ children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(Ue, {}) })
40
41
  }
41
42
  ) }) }) : N;
42
43
  };
43
- return /* @__PURE__ */ g("div", { className: L, style: w, children: [
44
- V && /* @__PURE__ */ g("div", { className: h(`${c}-block`, `${o}-caption`), children: [
44
+ return /* @__PURE__ */ h("div", { className: V, style: w, children: [
45
+ L && /* @__PURE__ */ h("div", { className: g(`${c}-block`, `${o}-caption`), children: [
45
46
  t && /* @__PURE__ */ e("div", { className: `${o}-caption-title`, title: t, children: t }),
46
47
  a && !x && /* @__PURE__ */ e(
47
48
  "div",
@@ -52,118 +53,122 @@ const ke = (v) => {
52
53
  }
53
54
  )
54
55
  ] }),
55
- b && /* @__PURE__ */ e("div", { className: h(`${c}-block`, `${o}-actions`), children: y() })
56
+ b && /* @__PURE__ */ e("div", { className: g(`${c}-block`, `${o}-actions`), children: y() })
56
57
  ] });
57
58
  };
58
- let B = 0;
59
- const Ae = {
59
+ let K = 0;
60
+ const Oe = {
60
61
  footerPosition: "inner",
61
62
  preview: !0
62
63
  };
63
- function Oe(v, w) {
64
- const { getPrefixCls: $, componentConfig: t, rtl: a } = re(Ve), l = Ee(
64
+ function ze(v, w) {
65
+ const { getPrefixCls: $, componentConfig: t, rtl: a } = re(Ve), l = Fe(
65
66
  v,
66
- Ae,
67
+ Oe,
67
68
  t == null ? void 0 : t.Image
68
69
  ), {
69
70
  style: o,
70
71
  className: x,
71
72
  src: s,
72
- width: V,
73
+ width: L,
73
74
  height: b,
74
75
  title: c,
75
- description: L,
76
+ description: V,
76
77
  actions: y,
77
78
  footerPosition: N,
78
79
  simple: E,
79
80
  loader: C,
80
81
  loaderClassName: se,
81
- error: ne,
82
+ loaderTip: ne,
83
+ error: ae,
82
84
  preview: u,
83
85
  previewProps: U,
84
86
  alt: j,
85
- onClick: M,
86
- index: S,
87
+ onClick: S,
88
+ index: T,
87
89
  _index: D,
88
90
  onError: k,
89
91
  onLoad: A,
90
92
  lazyload: f,
91
- ...ae
92
- } = l, ce = ye(), {
93
+ ...ce
94
+ } = l, le = Ee(), {
93
95
  previewGroup: P,
94
- handleVisibleChange: le,
95
- registerPreviewUrl: de,
96
- registerPreviewProps: me,
97
- setCurrentIndex: ue
98
- } = re(Me), n = R(() => ee(U) ? U : {}, [U]), fe = R(() => ee(f) ? f : {}, [f]), d = R(() => _(S) || _(D) ? (B = _(S) ? S : D, B) : B++, []), O = n.src || s, [T] = te({ title: c, description: L, actions: y }), { isLoading: H, isError: z, isLoaded: p, isBeforeLoad: pe, setStatus: I } = Se("beforeLoad"), F = oe(!1), [J, ge] = Fe(!1, {
96
+ handleVisibleChange: de,
97
+ registerPreviewUrl: me,
98
+ registerPreviewProps: ue,
99
+ setCurrentIndex: fe
100
+ } = re(Te), n = R(() => ee(U) ? U : {}, [U]), pe = R(() => ee(f) ? f : {}, [f]), d = R(() => B(T) || B(D) ? (K = B(T) ? T : D, K) : K++, []), O = n.src || s, [z] = te({ title: c, description: V, actions: y }), { isLoading: H, isError: M, isLoaded: p, isBeforeLoad: he, setStatus: I } = ke("beforeLoad"), F = oe(!1), [J, ge] = Re(!1, {
99
101
  defaultValue: n.defaultVisible,
100
102
  value: n.visible
101
- }), K = R(() => Re(n, [
103
+ }), _ = R(() => Ge(n, [
102
104
  "visible",
103
105
  "defaultVisible",
104
106
  "src",
105
107
  "onVisibleChange"
106
- ]), [n]), r = $("image"), he = !Ie(n.visible), ve = h(
108
+ ]), [n]), r = $("image"), ve = !xe(n.visible), we = g(
107
109
  r,
108
110
  {
109
111
  [`${r}-rtl`]: a,
110
112
  [`${r}-simple`]: E,
111
- [`${r}-before-load`]: pe,
113
+ [`${r}-before-load`]: he,
112
114
  [`${r}-loading`]: H,
113
- [`${r}-loading-error`]: z,
114
- [`${r}-with-footer-inner`]: p && T && N === "inner",
115
- [`${r}-with-footer-outer`]: p && T && N === "outer",
116
- [`${r}-with-preview`]: p && u && !z && !he
115
+ [`${r}-loading-error`]: M,
116
+ [`${r}-with-footer-inner`]: p && z && N === "inner",
117
+ [`${r}-with-footer-outer`]: p && z && N === "outer",
118
+ [`${r}-with-preview`]: p && u && !M && !ve
117
119
  },
118
120
  x
119
121
  ), m = oe();
120
- function we(i) {
122
+ function $e(i) {
121
123
  F.current = !0, I("loaded"), A == null || A(i);
122
124
  }
123
- function $e(i) {
125
+ function be(i) {
124
126
  F.current = !0, I("error"), k == null || k(i);
125
127
  }
126
128
  function Q(i) {
127
- u && P ? (ue(d), le(!0)) : u && W(!0), M == null || M(i);
129
+ u && P ? (fe(d), de(!0)) : u && W(!0), S == null || S(i);
128
130
  }
129
131
  function W(i) {
130
132
  var Z;
131
133
  (Z = n == null ? void 0 : n.onVisibleChange) == null || Z.call(n, i, J), ge(i);
132
134
  }
133
- const { inView: X } = Le({
135
+ const { inView: X } = ye({
134
136
  target: m.current,
135
137
  defaultInView: !f,
136
- ...fe
138
+ ...pe
137
139
  });
138
140
  G(() => {
139
141
  F.current = !1, s || I("error");
140
142
  }, [s]), G(() => {
141
143
  m.current && (X ? ((m.current.src || s) && m.current.src !== s && (m.current.src = s), !F.current && !m.current.complete && I("loading")) : I("lazyload"));
142
144
  }, [s, X]), G(() => {
143
- if (!P) return;
144
- const i = me(d, K);
145
+ if (!P)
146
+ return;
147
+ const i = ue(d, _);
145
148
  return () => i(d);
146
- }, [d, P, K]), G(() => {
147
- if (!P) return;
148
- const i = de(d, O, u);
149
+ }, [d, P, _]), G(() => {
150
+ if (!P)
151
+ return;
152
+ const i = me(d, O, u);
149
153
  return () => i(d);
150
154
  }, [d, P, O, u]);
151
- const be = /* @__PURE__ */ g("div", { className: `${r}-error`, children: [
152
- /* @__PURE__ */ e("div", { className: `${r}-error-icon`, children: /* @__PURE__ */ e(Ce, {}) }),
155
+ const Ne = /* @__PURE__ */ h("div", { className: `${r}-error`, children: [
156
+ /* @__PURE__ */ e("div", { className: `${r}-error-icon`, children: /* @__PURE__ */ e(Pe, {}) }),
153
157
  j && /* @__PURE__ */ e("div", { className: `${r}-error-alt`, children: j })
154
- ] }), Y = /* @__PURE__ */ e("div", { className: h(`${r}-loader`, se), children: /* @__PURE__ */ g("div", { className: `${r}-loader-spin`, children: [
155
- /* @__PURE__ */ e(Pe, {}),
156
- /* @__PURE__ */ e("div", { className: `${r}-loader-spin-text`, children: "Loading" })
157
- ] }) }), Ne = () => {
158
- if (C === !0) return Y;
158
+ ] }), Y = /* @__PURE__ */ e("div", { className: g(`${r}-loader`, se), children: /* @__PURE__ */ h("div", { className: `${r}-loader-spin`, children: [
159
+ /* @__PURE__ */ e(Ie, {}),
160
+ /* @__PURE__ */ e("div", { className: `${r}-loader-spin-text`, children: ne ?? "Loading" })
161
+ ] }) }), Ce = () => {
162
+ if (C === !0)
163
+ return Y;
159
164
  const i = C || Y;
160
165
  return f || C ? i : null;
161
166
  };
162
- return /* @__PURE__ */ g(
167
+ return /* @__PURE__ */ h(
163
168
  "div",
164
169
  {
165
- className: ve,
166
- style: Object.assign({ width: V, height: b }, o),
170
+ className: we,
171
+ style: Object.assign({ width: L, height: b }, o),
167
172
  ref: w,
168
173
  children: [
169
174
  /* @__PURE__ */ e(
@@ -172,29 +177,29 @@ function Oe(v, w) {
172
177
  ref: m,
173
178
  className: `${r}-img`,
174
179
  tabIndex: 0,
175
- ...ce({
180
+ ...le({
176
181
  onPressEnter: Q
177
182
  }),
178
- ...ae,
183
+ ...ce,
179
184
  ...f || s === void 0 ? {} : { src: s },
180
185
  title: c,
181
- width: V,
186
+ width: L,
182
187
  height: b,
183
- onLoad: we,
184
- onError: $e,
188
+ onLoad: $e,
189
+ onError: be,
185
190
  onClick: Q,
186
191
  alt: j
187
192
  }
188
193
  ),
189
- !p && /* @__PURE__ */ g("div", { className: `${r}-overlay`, children: [
190
- z && (ne || be),
191
- H && Ne()
194
+ !p && /* @__PURE__ */ h("div", { className: `${r}-overlay`, children: [
195
+ M && (ae || Ne),
196
+ H && Ce()
192
197
  ] }),
193
- p && T && /* @__PURE__ */ e(
194
- ke,
198
+ p && z && /* @__PURE__ */ e(
199
+ Ae,
195
200
  {
196
201
  title: c,
197
- description: L,
202
+ description: V,
198
203
  actions: y,
199
204
  prefixCls: r,
200
205
  simple: E
@@ -205,7 +210,7 @@ function Oe(v, w) {
205
210
  {
206
211
  visible: J,
207
212
  src: O,
208
- ...K,
213
+ ..._,
209
214
  onVisibleChange: W
210
215
  }
211
216
  )
@@ -213,11 +218,11 @@ function Oe(v, w) {
213
218
  }
214
219
  );
215
220
  }
216
- const Te = xe.forwardRef(
217
- Oe
218
- ), q = Te;
221
+ const Me = Le.forwardRef(
222
+ ze
223
+ ), q = Me;
219
224
  q.Preview = ie;
220
- q.PreviewGroup = je;
225
+ q.PreviewGroup = Se;
221
226
  q.displayName = "Image";
222
227
  export {
223
228
  q as I
@@ -0,0 +1,278 @@
1
+ import { jsxs as q, jsx as m } from "react/jsx-runtime";
2
+ import fe from "@unicom-cloud/icons/IconUiClose";
3
+ import U from "lodash/isArray";
4
+ import { forwardRef as oe, useContext as ne, useRef as b, useState as te, useImperativeHandle as se } from "react";
5
+ import { a as re, I as me } from "./BJQ5UNa-.js";
6
+ import { m as G } from "./JPPo5nY_.js";
7
+ import { e as ie, c as ue } from "./BrOW642m.js";
8
+ import { c as $e } from "./BdUcgWdu.js";
9
+ function Ne({
10
+ style: J,
11
+ className: Q,
12
+ prefixCls: V,
13
+ allowClear: X,
14
+ status: Y,
15
+ error: $,
16
+ disabled: k,
17
+ placeholder: g,
18
+ format: F,
19
+ size: z,
20
+ onClear: Z,
21
+ editable: _,
22
+ value: u,
23
+ inputValue: D,
24
+ onPressEnter: d,
25
+ suffixIcon: v,
26
+ prefix: y,
27
+ onChange: w,
28
+ popupVisible: x,
29
+ isPlaceholder: B,
30
+ inputProps: c,
31
+ ...I
32
+ }, R) {
33
+ const {
34
+ getPrefixCls: n,
35
+ size: K,
36
+ locale: T,
37
+ rtl: E
38
+ } = ne(re), O = b(null), [P, H] = te(!1), p = z || K, N = b(null);
39
+ se(R, () => ({
40
+ focus() {
41
+ var o, s;
42
+ (s = (o = O.current) == null ? void 0 : o.focus) == null || s.call(o);
43
+ },
44
+ blur() {
45
+ var o, s;
46
+ (s = (o = O.current) == null ? void 0 : o.blur) == null || s.call(o);
47
+ },
48
+ getRootDOMNode: () => N.current
49
+ }));
50
+ function S(o) {
51
+ var j;
52
+ (j = c == null ? void 0 : c.onKeyDown) == null || j.call(c, o), o.key === ie.key && (d == null || d());
53
+ }
54
+ function L(o) {
55
+ var s;
56
+ (s = c == null ? void 0 : c.onChange) == null || s.call(c, o), w == null || w(o);
57
+ }
58
+ let h = "";
59
+ D !== void 0 ? h = D : u && !U(u) && (h = typeof F == "function" ? F(u) : u.locale(T.dayjsLocale).format(F));
60
+ const M = _ ? {} : { readOnly: !0 }, t = V || n("picker"), C = Y || ($ ? "error" : void 0), W = P || x, A = G(
61
+ t,
62
+ `${t}-size-${p}`,
63
+ {
64
+ [`${t}-focused`]: W,
65
+ [`${t}-disabled`]: k,
66
+ [`${t}-has-prefix`]: y,
67
+ [`${t}-${C}`]: C,
68
+ [`${t}-rtl`]: E
69
+ },
70
+ Q
71
+ );
72
+ return /* @__PURE__ */ q(
73
+ "div",
74
+ {
75
+ style: J,
76
+ className: A,
77
+ ref: N,
78
+ ...$e(I, ["onChange", "onPressEnter"]),
79
+ children: [
80
+ y && /* @__PURE__ */ m("div", { className: `${t}-prefix`, children: y }),
81
+ /* @__PURE__ */ m(
82
+ "div",
83
+ {
84
+ className: G(`${t}-input`, {
85
+ [`${t}-input-placeholder`]: B
86
+ }),
87
+ children: /* @__PURE__ */ m(
88
+ "input",
89
+ {
90
+ ref: O,
91
+ ...c,
92
+ disabled: k,
93
+ placeholder: g,
94
+ className: `${t}-start-time`,
95
+ value: h,
96
+ onKeyDown: S,
97
+ onChange: L,
98
+ ...M,
99
+ onFocus: (o) => {
100
+ var s;
101
+ H(!0), (s = c == null ? void 0 : c.onFocus) == null || s.call(c, o);
102
+ },
103
+ onBlur: (o) => {
104
+ var s;
105
+ H(!1), (s = c == null ? void 0 : c.onBlur) == null || s.call(c, o);
106
+ }
107
+ }
108
+ )
109
+ }
110
+ ),
111
+ /* @__PURE__ */ q("div", { className: `${t}-suffix`, children: [
112
+ X && h && /* @__PURE__ */ m(
113
+ me,
114
+ {
115
+ prefix: t,
116
+ onClick: Z,
117
+ className: `${t}-clear-icon`,
118
+ children: /* @__PURE__ */ m(fe, {})
119
+ }
120
+ ),
121
+ /* @__PURE__ */ m("span", { className: `${t}-suffix-icon`, children: v })
122
+ ] })
123
+ ]
124
+ }
125
+ );
126
+ }
127
+ const Ke = oe(Ne);
128
+ function Ce({
129
+ allowClear: J,
130
+ error: Q,
131
+ status: V,
132
+ style: X,
133
+ className: Y,
134
+ disabled: $,
135
+ placeholder: k = [],
136
+ value: g = [],
137
+ popupVisible: F,
138
+ format: z,
139
+ size: Z,
140
+ onClear: _,
141
+ editable: u,
142
+ inputValue: D,
143
+ onPressEnter: d,
144
+ onPressTab: v,
145
+ onChange: y,
146
+ separator: w,
147
+ suffixIcon: x,
148
+ changeFocusedInputIndex: B,
149
+ focusedInputIndex: c,
150
+ isPlaceholder: I,
151
+ prefix: R,
152
+ inputProps: n = [],
153
+ onBlur: K,
154
+ ...T
155
+ }, E) {
156
+ const {
157
+ getPrefixCls: O,
158
+ size: P,
159
+ locale: H,
160
+ rtl: p
161
+ } = ne(re), N = b(null), S = b(null), L = b(null), [h, M] = te([!1, !1]), t = U($) ? $[0] : $, C = U($) ? $[1] : $;
162
+ se(E, () => ({
163
+ focus(e) {
164
+ var f, i;
165
+ (c === 0 && !t || c === 1 && !C) && ((i = (f = ((typeof e == "number" ? e : c) === 0 ? N : S).current) == null ? void 0 : f.focus) == null || i.call(f));
166
+ },
167
+ blur() {
168
+ var e, a, l, f;
169
+ c === 0 && ((a = (e = N.current) == null ? void 0 : e.blur) == null || a.call(e)), c === 1 && ((f = (l = S.current) == null ? void 0 : l.blur) == null || f.call(l));
170
+ },
171
+ getRootDOMNode: () => L.current
172
+ }));
173
+ function W(e, a) {
174
+ var l, f;
175
+ (f = (l = n == null ? void 0 : n[a]) == null ? void 0 : l.onClick) == null || f.call(l, e), c !== a && B(a);
176
+ }
177
+ function A(e, a) {
178
+ var f, i;
179
+ const l = e.key;
180
+ (i = (f = n == null ? void 0 : n[a]) == null ? void 0 : f.onKeyDown) == null || i.call(f, e), l === ie.key && (d == null || d()), l === ue.key && (v == null || v(e));
181
+ }
182
+ function o(e, a) {
183
+ var l, f;
184
+ e.stopPropagation(), (f = (l = n == null ? void 0 : n[a]) == null ? void 0 : l.onChange) == null || f.call(l, e), y == null || y(e);
185
+ }
186
+ function s(e, a) {
187
+ var l, f;
188
+ M((i) => (i[a] = !1, [...i])), (f = (l = n == null ? void 0 : n[a]) == null ? void 0 : l.onBlur) == null || f.call(l, e), K == null || K(e);
189
+ }
190
+ function j(e, a) {
191
+ var l, f;
192
+ (a === 0 || a === 1) && (M((i) => (i[a] = !0, [...i])), c !== a && B(a, !0)), (f = (l = n == null ? void 0 : n[a]) == null ? void 0 : l.onFocus) == null || f.call(l, e);
193
+ }
194
+ const r = O("picker"), de = Z || P, ye = h[0] || h[1] || !!F, ee = V || (Q ? "error" : void 0), he = G(
195
+ r,
196
+ `${r}-range`,
197
+ `${r}-size-${de}`,
198
+ {
199
+ [`${r}-focused`]: ye,
200
+ [`${r}-disabled`]: t && C,
201
+ [`${r}-${ee}`]: ee,
202
+ [`${r}-rtl`]: p,
203
+ [`${r}-has-prefix`]: R
204
+ },
205
+ Y
206
+ ), ce = (e) => {
207
+ const a = g[e] ? g[e].locale(H.dayjsLocale).format(U(z) ? z[e] : z) : "";
208
+ return D && e === c ? D : a;
209
+ }, le = u ? {} : { readOnly: !0 };
210
+ function ae(e) {
211
+ return G(`${r}-input`, {
212
+ [`${r}-input-active`]: c === e,
213
+ [`${r}-input-placeholder`]: I && c === e
214
+ });
215
+ }
216
+ return /* @__PURE__ */ q(
217
+ "div",
218
+ {
219
+ style: X,
220
+ ref: L,
221
+ className: he,
222
+ ...$e(T, ["onChange", "onPressEnter"]),
223
+ children: [
224
+ R && /* @__PURE__ */ m("div", { className: `${r}-prefix`, children: R }),
225
+ /* @__PURE__ */ m("div", { className: ae(0), children: /* @__PURE__ */ m(
226
+ "input",
227
+ {
228
+ ref: N,
229
+ ...n[0],
230
+ disabled: t,
231
+ placeholder: k[0],
232
+ value: ce(0),
233
+ onChange: (e) => o(e, 0),
234
+ onKeyDown: (e) => A(e, 0),
235
+ onClick: (e) => W(e, 0),
236
+ onBlur: (e) => s(e, 0),
237
+ onFocus: (e) => j(e, 0),
238
+ ...le
239
+ }
240
+ ) }),
241
+ /* @__PURE__ */ m("span", { className: `${r}-separator`, children: w || "-" }),
242
+ /* @__PURE__ */ m("div", { className: ae(1), children: /* @__PURE__ */ m(
243
+ "input",
244
+ {
245
+ ref: S,
246
+ ...n[1],
247
+ disabled: C,
248
+ placeholder: k[1],
249
+ value: ce(1),
250
+ onChange: (e) => o(e, 1),
251
+ onKeyDown: (e) => A(e, 1),
252
+ onClick: (e) => W(e, 1),
253
+ onBlur: (e) => s(e, 1),
254
+ onFocus: (e) => j(e, 1),
255
+ ...le
256
+ }
257
+ ) }),
258
+ /* @__PURE__ */ q("div", { className: `${r}-suffix`, children: [
259
+ J && g.length === 2 && /* @__PURE__ */ m(
260
+ me,
261
+ {
262
+ prefix: r,
263
+ onClick: _,
264
+ className: `${r}-clear-icon`,
265
+ children: /* @__PURE__ */ m(fe, {})
266
+ }
267
+ ),
268
+ /* @__PURE__ */ m("span", { className: `${r}-suffix-icon`, children: x })
269
+ ] })
270
+ ]
271
+ }
272
+ );
273
+ }
274
+ const Oe = oe(Ce);
275
+ export {
276
+ Ke as I,
277
+ Oe as a
278
+ };
@@ -0,0 +1,16 @@
1
+ import { useRef as u } from "react";
2
+ function s(c) {
3
+ const r = u(), e = () => {
4
+ r.current && (r.current.disconnect(), r.current = null);
5
+ }, t = (n) => {
6
+ n && (r.current && e(), r.current = new ResizeObserver(c), r.current.observe(n));
7
+ };
8
+ return {
9
+ currentOr: r.current,
10
+ cor: t,
11
+ dor: e
12
+ };
13
+ }
14
+ export {
15
+ s as o
16
+ };