@unicom-cloud/ui 0.8.96 → 0.8.98

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 (302) hide show
  1. package/Affix.js +1 -1
  2. package/Carousel.js +1 -1
  3. package/LiquidFill.js +4 -0
  4. package/OverflowEllipsis.js +1 -1
  5. package/PageHeader.js +1 -1
  6. package/QrCode.js +57 -0
  7. package/Tour.js +63 -0
  8. package/Trigger.js +1 -1
  9. package/_virtual/_commonjsHelpers.js +6 -0
  10. package/_virtual/index.js +7 -0
  11. package/_virtual/index2.js +4 -0
  12. package/affix/index.js +70 -72
  13. package/alert/index.js +56 -56
  14. package/anchor/Anchor.js +55 -55
  15. package/anchor/Link.js +34 -34
  16. package/anchor/util.js +5 -5
  17. package/auto-complete/index.js +116 -122
  18. package/avatar/Avatar.js +33 -33
  19. package/avatar/Group.js +26 -26
  20. package/back-top/index.js +58 -61
  21. package/badge/index.js +46 -46
  22. package/breadcrumb/Item.js +42 -43
  23. package/breadcrumb/index.js +47 -47
  24. package/button/Group.js +6 -6
  25. package/button/index.js +91 -91
  26. package/calendar/Month.js +75 -75
  27. package/calendar/Year.js +35 -35
  28. package/calendar/header/index.js +25 -25
  29. package/calendar/index.js +103 -103
  30. package/card/Grid.js +8 -8
  31. package/card/Meta.js +16 -16
  32. package/card/index.js +49 -49
  33. package/carousel/Arrow.js +19 -19
  34. package/carousel/Indicator.js +26 -26
  35. package/carousel/index.js +108 -108
  36. package/cascader/Cascader.js +178 -191
  37. package/cascader/base/node.js +133 -136
  38. package/cascader/base/store.js +82 -85
  39. package/cascader/panel/List.js +125 -129
  40. package/cascader/panel/Search.js +79 -81
  41. package/cascader/util.js +13 -13
  42. package/checkbox/Checkbox.js +94 -96
  43. package/checkbox/Group.js +54 -56
  44. package/checkbox/GroupBlock.js +28 -29
  45. package/collapse/Collapse.js +45 -45
  46. package/collapse/Item.js +53 -55
  47. package/color-picker/ControlBar.js +43 -43
  48. package/color-picker/InputAlpha.js +12 -12
  49. package/color-picker/InputHex.js +30 -31
  50. package/color-picker/InputRgb.js +24 -24
  51. package/color-picker/Palette.js +18 -18
  52. package/color-picker/Panel.js +122 -125
  53. package/color-picker/hooks/useColorPicker.js +85 -88
  54. package/color-picker/hooks/useControlBlock.js +38 -40
  55. package/color-picker/index.js +47 -47
  56. package/comment/index.js +29 -29
  57. package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
  58. package/components/common/hooks/useId.js +8 -8
  59. package/components/common/hooks/useInView.js +16 -16
  60. package/components/common/hooks/useIntersectionObserver.js +1 -1
  61. package/components/common/hooks/useKeyboardEvent.js +9 -10
  62. package/components/common/hooks/useOverflowHidden.js +1 -4
  63. package/components/common/hooks/usePersistCallback.js +7 -7
  64. package/components/common/hooks/useStateCallback.js +9 -10
  65. package/components/common/hooks/useWindowSize.js +8 -8
  66. package/components/common/space/index.js +9 -7
  67. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  68. package/components/common/utils/dom.js +27 -29
  69. package/components/common/utils/findScrollParent.js +17 -0
  70. package/components/common/utils/intersectionObserver.js +21 -0
  71. package/components/common/utils/is.js +99 -109
  72. package/components/common/utils/mutationObserver.js +19 -0
  73. package/components/common/utils/reactDOM.js +34 -34
  74. package/components/common/utils/resizeObserver.js +21 -0
  75. package/copy/index.js +38 -40
  76. package/date-picker/Picker.js +290 -295
  77. package/date-picker/RangePicker.js +367 -372
  78. package/date-picker/index.js +33 -35
  79. package/date-picker/panel/Body.js +46 -47
  80. package/date-picker/panel/Header.js +33 -33
  81. package/date-picker/panel/Shortcut.js +31 -31
  82. package/date-picker/panel/date/index.js +85 -85
  83. package/date-picker/panel/month/index.js +59 -59
  84. package/date-picker/panel/quarter/index.js +67 -70
  85. package/date-picker/panel/range/index.js +101 -101
  86. package/date-picker/panel/year/index.js +39 -39
  87. package/date-picker/util.js +17 -18
  88. package/descriptions/index.js +62 -62
  89. package/details/index.js +53 -55
  90. package/development/index.js +9 -9
  91. package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
  92. package/dist/validate/src/index.js +5 -5
  93. package/dist/validate/src/util.js +1 -1
  94. package/divider/index.js +21 -21
  95. package/draggable/Item.js +35 -35
  96. package/draggable/index.js +22 -22
  97. package/drawer/Drawer.js +142 -147
  98. package/dropdown/Button.js +48 -48
  99. package/dropdown/index.js +88 -92
  100. package/empty/index.js +16 -16
  101. package/form/Control.js +211 -225
  102. package/form/Form.js +109 -113
  103. package/form/FormItem.js +118 -120
  104. package/form/FormList.js +60 -66
  105. package/form/FormProvider.js +31 -34
  106. package/form/hook/useContext.js +17 -19
  107. package/form/hook/useState.js +22 -23
  108. package/form/hook/useWatch.js +26 -27
  109. package/form/promisify.js +14 -18
  110. package/form/store.js +304 -316
  111. package/form/util.js +14 -15
  112. package/grid/Col.js +64 -64
  113. package/grid/Grid.js +51 -51
  114. package/grid/GridItem.js +48 -48
  115. package/grid/Row.js +39 -39
  116. package/hooks/useVerificationCode.js +41 -43
  117. package/hooks/useWatermark.js +89 -92
  118. package/icon/index.js +23 -24
  119. package/icon-hover/index.js +16 -16
  120. package/icons/file.js +11 -11
  121. package/image/Image.js +140 -141
  122. package/image/ImagePreview.js +252 -255
  123. package/image/ImagePreviewArrow.js +25 -25
  124. package/image/ImagePreviewGroup.js +62 -62
  125. package/image/util/getScale.js +25 -28
  126. package/index.js +684 -675
  127. package/input/Button.js +48 -50
  128. package/input/Group.js +9 -9
  129. package/input/Input.js +145 -154
  130. package/input/InputElement.js +108 -115
  131. package/input/Password.js +38 -38
  132. package/input/Search.js +51 -55
  133. package/input/Textarea.js +80 -81
  134. package/input/useComposition.js +23 -23
  135. package/input-number/decimal.js +59 -62
  136. package/input-number/index.js +139 -141
  137. package/input-tag/InputTag.js +222 -230
  138. package/layout/Content.js +6 -6
  139. package/layout/Footer.js +8 -8
  140. package/layout/Header.js +7 -7
  141. package/layout/Sider.js +88 -90
  142. package/layout/index.js +30 -30
  143. package/link/index.js +45 -46
  144. package/liquid-fill/LiquidFill.js +226 -0
  145. package/liquid-fill/LiquidFill2.js +3 -0
  146. package/liquid-fill/index.js +4 -0
  147. package/list/Item.js +28 -28
  148. package/list/Meta.js +12 -12
  149. package/list/index.js +146 -148
  150. package/mentions/index.js +75 -76
  151. package/menu/Item.js +58 -58
  152. package/menu/Menu.js +125 -127
  153. package/menu/OverflowWrap.js +39 -40
  154. package/menu/sub-menu/Inline.js +45 -45
  155. package/menu/util.js +26 -28
  156. package/message/index.js +96 -99
  157. package/message/useMessage.js +26 -27
  158. package/modal/Confirm.js +47 -49
  159. package/modal/Modal.js +250 -257
  160. package/modal/use-modal/Hook.js +26 -28
  161. package/modal/use-modal/index.js +46 -49
  162. package/notice/index.js +89 -90
  163. package/notification/index.js +60 -65
  164. package/notification/withNotification.js +35 -35
  165. package/overflow-ellipsis/OverflowItem.js +19 -20
  166. package/overflow-ellipsis/index.js +45 -46
  167. package/package.json +1 -1
  168. package/page-header/index.js +45 -45
  169. package/pagination/PageItem.js +87 -91
  170. package/pagination/PageJumper.js +40 -41
  171. package/pagination/PageOption.js +31 -35
  172. package/pagination/Pagination.js +162 -163
  173. package/picker/Input.js +90 -96
  174. package/picker/InputRange.js +115 -122
  175. package/popconfirm/index.js +98 -100
  176. package/popover/index.js +28 -28
  177. package/portal/Portal.js +10 -11
  178. package/progress/index.js +36 -36
  179. package/qr-code/index.js +99 -0
  180. package/qr-code/interface.js +1 -0
  181. package/radio/Group.js +48 -48
  182. package/radio/GroupBlock.js +32 -33
  183. package/radio/Radio.js +62 -64
  184. package/rate/index.js +88 -88
  185. package/resize-box/ResizeTrigger.js +39 -39
  186. package/resize-box/Split.js +92 -96
  187. package/resize-box/SplitGroup.js +116 -122
  188. package/resize-box/index.js +112 -115
  189. package/result/index.js +44 -44
  190. package/select/Option.js +53 -56
  191. package/select/Select.js +365 -381
  192. package/select/util.js +95 -99
  193. package/select-view/Core.js +159 -160
  194. package/skeleton/index.js +23 -23
  195. package/slider/Button.js +84 -92
  196. package/slider/Input.js +47 -49
  197. package/slider/Tick.js +28 -31
  198. package/slider/index.js +107 -107
  199. package/space/index.js +26 -26
  200. package/space-/index.js +51 -51
  201. package/spin/DotLoading.js +8 -8
  202. package/spin/index.js +47 -47
  203. package/statistic/Countdown.js +37 -37
  204. package/statistic/index.js +58 -58
  205. package/steps/Step.js +42 -42
  206. package/steps/index.js +54 -54
  207. package/style.css +1 -1
  208. package/switch/index.js +77 -78
  209. package/table/ColGroup.js +36 -37
  210. package/table/Table.js +447 -450
  211. package/table/hook/useExpand.js +24 -24
  212. package/table/hook/useRowSelection.js +62 -62
  213. package/table/summary/Row.js +16 -17
  214. package/table/tbody/Td.js +119 -118
  215. package/table/tbody/Tr.js +119 -121
  216. package/table/tbody/index.js +62 -63
  217. package/table/th-resizable/index.js +30 -30
  218. package/table/thead/Column.js +148 -148
  219. package/table/thead/index.js +87 -88
  220. package/tabs/Tab.js +55 -55
  221. package/tabs/TabContent.js +8 -8
  222. package/tabs/TabPane.js +15 -15
  223. package/tabs/hook/useHeaderScroll.js +36 -36
  224. package/tabs/tab-header/TabInk.js +31 -33
  225. package/tabs/tab-header/TabNavIcon.js +34 -35
  226. package/tabs/tab-header/index.js +192 -195
  227. package/tag/index.js +94 -97
  228. package/time-picker/Picker.js +167 -172
  229. package/time-picker/RangePicker.js +28 -28
  230. package/time-picker/TimePicker.js +146 -146
  231. package/timeline/Item.js +46 -46
  232. package/timeline/Timeline.js +52 -52
  233. package/tooltip/index.js +89 -95
  234. package/tour/index.js +289 -0
  235. package/transfer/Item.js +54 -54
  236. package/transfer/List.js +134 -136
  237. package/transfer/index.js +91 -91
  238. package/tree/Animation.js +49 -52
  239. package/tree/Node.js +114 -122
  240. package/tree/NodeList.js +51 -51
  241. package/tree/Tree.js +386 -393
  242. package/tree-select/List.js +71 -72
  243. package/tree-select/Select.js +135 -143
  244. package/tree-select/hook/useKeyCache.js +39 -39
  245. package/tree-select/hook/useStateValue.js +12 -12
  246. package/trigger/getPopupStyle.js +60 -61
  247. package/trigger/index.js +337 -346
  248. package/types/common/space/interface.d.ts +1 -1
  249. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  250. package/types/common/utils/findScrollParent.d.ts +2 -0
  251. package/types/common/utils/index.d.ts +5 -0
  252. package/types/common/utils/intersectionObserver.d.ts +2 -0
  253. package/types/common/utils/mutationObserver.d.ts +2 -0
  254. package/types/common/utils/resizeObserver.d.ts +2 -0
  255. package/types/pc/config-provider/interface.d.ts +6 -0
  256. package/types/pc/index.d.ts +3 -0
  257. package/types/pc/liquid-fill/LiquidFill.d.ts +115 -0
  258. package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
  259. package/types/pc/liquid-fill/index.d.ts +2 -0
  260. package/types/pc/qr-code/index.d.ts +34 -0
  261. package/types/pc/qr-code/interface.d.ts +39 -0
  262. package/types/pc/table/interface.d.ts +2 -2
  263. package/types/pc/tour/index.d.ts +42 -0
  264. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  265. package/types/pc/utils/findScrollParent.d.ts +2 -0
  266. package/types/pc/utils/index.d.ts +5 -0
  267. package/types/pc/utils/intersectionObserver.d.ts +2 -0
  268. package/types/pc/utils/mutationObserver.d.ts +2 -0
  269. package/types/pc/utils/names.d.ts +18 -0
  270. package/types/pc/utils/resizeObserver.d.ts +2 -0
  271. package/typography/Base.js +79 -81
  272. package/typography/EditContent.js +30 -33
  273. package/typography/Ellipsis.js +77 -73
  274. package/typography/Operations.js +50 -52
  275. package/typography/Paragraph.js +7 -7
  276. package/typography/Typography.js +7 -7
  277. package/typography/useEllipsis.js +105 -106
  278. package/upload/TriggerNode.js +69 -76
  279. package/upload/Upload.js +84 -87
  280. package/upload/Uploader.js +115 -118
  281. package/upload/list/PictureItem.js +61 -71
  282. package/upload/list/TextItem.js +61 -67
  283. package/upload/list/UploadProgress.js +42 -49
  284. package/upload/list/index.js +48 -49
  285. package/upload/request_.js +37 -38
  286. package/upload/util.js +39 -39
  287. package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  288. package/utils/findScrollParent.js +4 -0
  289. package/utils/index.js +281 -278
  290. package/utils/intersectionObserver.js +4 -0
  291. package/utils/mutationObserver.js +4 -0
  292. package/utils/names.js +12 -0
  293. package/utils/resizeObserver.js +4 -0
  294. package/verification-code/VerificationCode.js +50 -51
  295. package/version/index.js +1 -1
  296. package/virtual-list/VirtualList.js +243 -244
  297. package/virtual-list/util/item.js +3 -4
  298. package/watermark/Watermark.js +27 -31
  299. package/components/common/utils/resizeObserverEffect.js +0 -23
  300. package/types/common/utils/resizeObserverEffect.d.ts +0 -2
  301. package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
  302. package/utils/resizeObserverEffect.js +0 -4
@@ -1,58 +1,56 @@
1
- import { useState as b, useRef as E, useEffect as x } from "react";
2
- function M({
3
- value: f,
4
- multiple: s = !1,
5
- onActive: L,
6
- onAdd: k,
7
- onChange: u
1
+ import { useState as y, useRef as w, useEffect as h } from "react";
2
+ function b({
3
+ value: s,
4
+ multiple: r = !1,
5
+ onActive: m,
6
+ onAdd: g,
7
+ onChange: l
8
8
  }) {
9
- const [p, d] = b(!1), c = E(), y = E();
10
- function w(e, t) {
9
+ const [v, u] = y(!1), i = w(), E = w();
10
+ function c(e, t) {
11
11
  return e < 0 ? 0 : e > t ? 1 : e / t;
12
12
  }
13
- function a(e) {
14
- var i, v;
15
- const { clientX: t, clientY: r } = e, n = (v = (i = c.current) == null ? void 0 : i.getBoundingClientRect) == null ? void 0 : v.call(i);
16
- return n ? [
17
- w(t - n.x, n.width),
18
- w(r - n.y, n.height)
13
+ function f(e) {
14
+ const { clientX: t, clientY: p } = e, o = i.current?.getBoundingClientRect?.();
15
+ return o ? [
16
+ c(t - o.x, o.width),
17
+ c(p - o.y, o.height)
19
18
  ] : [0, 0];
20
19
  }
21
- function m(e) {
22
- const t = a(e);
23
- (s || !s && (t[0] !== f[0] || t[1] !== f[1])) && (u == null || u(t));
20
+ function d(e) {
21
+ const t = f(e);
22
+ (r || !r && (t[0] !== s[0] || t[1] !== s[1])) && l?.(t);
24
23
  }
25
- function o() {
26
- d(!1), window.removeEventListener("mousemove", l), window.removeEventListener("mouseup", o), window.removeEventListener("contextmenu", o);
24
+ function n() {
25
+ u(!1), window.removeEventListener("mousemove", a), window.removeEventListener("mouseup", n), window.removeEventListener("contextmenu", n);
27
26
  }
28
- function g() {
29
- window.addEventListener("mousemove", l), window.addEventListener("mouseup", o), window.addEventListener("contextmenu", o);
27
+ function L() {
28
+ window.addEventListener("mousemove", a), window.addEventListener("mouseup", n), window.addEventListener("contextmenu", n);
30
29
  }
31
- function R(e) {
32
- var t, r;
33
- if (e.preventDefault(), d(!0), s) {
34
- if (e.target === c.current)
35
- k(a(e));
36
- else if (typeof ((r = (t = e.target) == null ? void 0 : t.dataset) == null ? void 0 : r.key) < "u") {
37
- const n = e.target.dataset.key;
38
- L(n);
30
+ function k(e) {
31
+ if (e.preventDefault(), u(!0), r) {
32
+ if (e.target === i.current)
33
+ g(f(e));
34
+ else if (typeof e.target?.dataset?.key < "u") {
35
+ const t = e.target.dataset.key;
36
+ m(t);
39
37
  }
40
38
  return;
41
39
  }
42
- m(e), g();
40
+ d(e), L();
43
41
  }
44
- function l(e) {
45
- e.preventDefault(), e.buttons > 0 ? m(e) : o();
42
+ function a(e) {
43
+ e.preventDefault(), e.buttons > 0 ? d(e) : n();
46
44
  }
47
- return x(() => () => {
48
- o();
45
+ return h(() => () => {
46
+ n();
49
47
  }, []), {
50
- active: p,
51
- blockRef: c,
52
- handlerRef: y,
53
- onMouseDown: R
48
+ active: v,
49
+ blockRef: i,
50
+ handlerRef: E,
51
+ onMouseDown: k
54
52
  };
55
53
  }
56
54
  export {
57
- M as useControlBlock
55
+ b as useControlBlock
58
56
  };
@@ -1,4 +1,4 @@
1
- import { jsx as e, jsxs as m } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
2
  import G from "lodash/isFunction";
3
3
  import S from "lodash/isNil";
4
4
  import D, { useContext as q } from "react";
@@ -8,32 +8,32 @@ import K from "../components/common/hooks/useMergeProps.js";
8
8
  import L from "../trigger/index.js";
9
9
  import Q from "@unicom-cloud/utils/class-name";
10
10
  import { colors as U } from "./colors.js";
11
- import { ControlBar as kr } from "./ControlBar.js";
11
+ import { ControlBar as vo } from "./ControlBar.js";
12
12
  import { useColorPicker as W } from "./hooks/useColorPicker.js";
13
- import { InputAlpha as yr } from "./InputAlpha.js";
14
- import { InputHex as Nr } from "./InputHex.js";
15
- import { InputRgb as br } from "./InputRgb.js";
16
- import { Palette as zr } from "./Palette.js";
13
+ import { InputAlpha as Io } from "./InputAlpha.js";
14
+ import { InputHex as Ao } from "./InputHex.js";
15
+ import { InputRgb as $o } from "./InputRgb.js";
16
+ import { Palette as wo } from "./Palette.js";
17
17
  import { Panel as X } from "./Panel.js";
18
18
  import { getGradientString as Y, renderBackground as Z } from "./utils.js";
19
19
  import _ from "../config-provider/context.js";
20
- const d = {
20
+ const c = {
21
21
  size: "default",
22
22
  presetColors: U
23
23
  };
24
- function rr(t, u) {
24
+ function oo(t, m) {
25
25
  const {
26
- getPrefixCls: n,
27
- componentConfig: s,
28
- size: g
29
- } = q(_), l = K(
26
+ getPrefixCls: d,
27
+ componentConfig: g,
28
+ size: u
29
+ } = q(_), n = K(
30
30
  t,
31
- { ...d, size: g || d.size },
32
- s == null ? void 0 : s.ColorPicker
31
+ { ...c, size: u || c.size },
32
+ g?.ColorPicker
33
33
  ), {
34
34
  style: C,
35
35
  className: f,
36
- size: p,
36
+ size: l,
37
37
  mode: h,
38
38
  disabled: i,
39
39
  disabledAlpha: x = !1,
@@ -45,8 +45,8 @@ function rr(t, u) {
45
45
  showHistory: N,
46
46
  showPreset: A,
47
47
  renderFooter: b
48
- } = l, o = n == null ? void 0 : n("color-picker"), {
49
- value: r,
48
+ } = n, r = d?.("color-picker"), {
49
+ value: o,
50
50
  activeMode: $,
51
51
  gradientColors: z,
52
52
  activeColorId: w,
@@ -60,14 +60,14 @@ function rr(t, u) {
60
60
  onActiveModeChange: V,
61
61
  onGradientColorsChange: j,
62
62
  onActiveColorIdChange: F
63
- } = W(l);
63
+ } = W(n);
64
64
  return /* @__PURE__ */ e(
65
65
  L,
66
66
  {
67
67
  popup: () => /* @__PURE__ */ e(
68
68
  X,
69
69
  {
70
- value: r,
70
+ value: o,
71
71
  mode: h,
72
72
  activeMode: $,
73
73
  gradientColors: z,
@@ -103,43 +103,43 @@ function rr(t, u) {
103
103
  ...P,
104
104
  onVisibleChange: T,
105
105
  children: (() => {
106
- const c = G(t.triggerElement) ? t.triggerElement({ value: r }) : t.triggerElement;
107
- if (!S(c))
108
- return c;
109
- const a = typeof r == "string" ? r : Y(r);
110
- return /* @__PURE__ */ m(
106
+ const a = G(t.triggerElement) ? t.triggerElement({ value: o }) : t.triggerElement;
107
+ if (!S(a))
108
+ return a;
109
+ const s = typeof o == "string" ? o : Y(o);
110
+ return /* @__PURE__ */ p(
111
111
  "div",
112
112
  {
113
- className: Q(o, f, {
114
- [`${o}-size-${p}`]: p,
115
- [`${o}-disabled`]: i
113
+ className: Q(r, f, {
114
+ [`${r}-size-${l}`]: l,
115
+ [`${r}-disabled`]: i
116
116
  }),
117
117
  style: C,
118
- ref: u,
118
+ ref: m,
119
119
  children: [
120
120
  /* @__PURE__ */ e(
121
121
  "div",
122
122
  {
123
- className: `${o}-preview`,
124
- style: Array.isArray(r) ? {
125
- background: Z(r)
126
- } : { backgroundColor: r }
123
+ className: `${r}-preview`,
124
+ style: Array.isArray(o) ? {
125
+ background: Z(o)
126
+ } : { backgroundColor: o }
127
127
  }
128
128
  ),
129
- !!v && /* @__PURE__ */ m("div", { className: `${o}-value`, children: [
130
- a,
131
- !i && /* @__PURE__ */ e(J, { text: a, className: `${o}-copy` })
129
+ !!v && /* @__PURE__ */ p("div", { className: `${r}-value`, children: [
130
+ s,
131
+ !i && /* @__PURE__ */ e(J, { text: s, className: `${r}-copy` })
132
132
  ] }),
133
133
  /* @__PURE__ */ e(
134
134
  "input",
135
135
  {
136
- className: `${o}-input`,
137
- value: a,
136
+ className: `${r}-input`,
137
+ value: s,
138
138
  disabled: i,
139
139
  readOnly: !0
140
140
  }
141
141
  ),
142
- l.extra
142
+ n.extra
143
143
  ]
144
144
  }
145
145
  );
@@ -147,16 +147,16 @@ function rr(t, u) {
147
147
  }
148
148
  );
149
149
  }
150
- const or = D.forwardRef(
151
- rr
150
+ const ro = D.forwardRef(
151
+ oo
152
152
  );
153
- or.displayName = "ColorPicker";
153
+ ro.displayName = "ColorPicker";
154
154
  export {
155
- kr as ColorPickerControlBar,
156
- yr as ColorPickerInputAlpha,
157
- Nr as ColorPickerInputHex,
158
- br as ColorPickerInputRgb,
159
- zr as ColorPickerPalette,
155
+ vo as ColorPickerControlBar,
156
+ Io as ColorPickerInputAlpha,
157
+ Ao as ColorPickerInputHex,
158
+ $o as ColorPickerInputRgb,
159
+ wo as ColorPickerPalette,
160
160
  X as ColorPickerPanel,
161
- or as default
161
+ ro as default
162
162
  };
package/comment/index.js CHANGED
@@ -1,26 +1,26 @@
1
1
  import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
- import N from "lodash/isPlainObject";
3
- import g from "lodash/isString";
2
+ import h from "lodash/isPlainObject";
3
+ import N from "lodash/isString";
4
4
  import { forwardRef as v, useContext as u } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
6
6
  import C from "../components/common/hooks/useMergeProps.js";
7
- import f from "@unicom-cloud/utils/class-name";
7
+ import c from "@unicom-cloud/utils/class-name";
8
8
  import { pickDataAttributes as x } from "../components/common/utils/pick.js";
9
- import j from "../config-provider/context.js";
10
- const y = {
9
+ import P from "../config-provider/context.js";
10
+ const j = {
11
11
  datetime: "left",
12
12
  actions: "left"
13
- }, b = {
13
+ }, y = {
14
14
  align: "left"
15
15
  };
16
- function A(p, $) {
17
- const { getPrefixCls: s, componentConfig: r, rtl: h } = u(j), e = C(
18
- p,
19
- b,
20
- r == null ? void 0 : r.Comment
21
- ), t = s == null ? void 0 : s("comment"), { actions: l, author: m, avatar: i, content: c, datetime: o } = e, d = {
22
- ...y,
23
- ...N(e.align) ? e.align : {
16
+ function b(d, f) {
17
+ const { getPrefixCls: p, componentConfig: g, rtl: $ } = u(P), e = C(
18
+ d,
19
+ y,
20
+ g?.Comment
21
+ ), t = p?.("comment"), { actions: r, author: s, avatar: i, content: m, datetime: o } = e, l = {
22
+ ...j,
23
+ ...h(e.align) ? e.align : {
24
24
  datetime: e.align,
25
25
  actions: e.align
26
26
  }
@@ -28,34 +28,34 @@ function A(p, $) {
28
28
  return /* @__PURE__ */ n(
29
29
  "div",
30
30
  {
31
- ref: $,
32
- className: f(
31
+ ref: f,
32
+ className: c(
33
33
  `${t}`,
34
- { [`${t}-rtl`]: h },
34
+ { [`${t}-rtl`]: $ },
35
35
  e.className
36
36
  ),
37
37
  style: e.style,
38
38
  ...x(e),
39
39
  children: [
40
- i && /* @__PURE__ */ a("div", { className: f(`${t}-avatar`), children: g(i) ? /* @__PURE__ */ a("img", { src: i, alt: "comment-avatar" }) : i }),
40
+ i && /* @__PURE__ */ a("div", { className: c(`${t}-avatar`), children: N(i) ? /* @__PURE__ */ a("img", { src: i, alt: "comment-avatar" }) : i }),
41
41
  /* @__PURE__ */ n("div", { className: `${t}-inner`, children: [
42
42
  /* @__PURE__ */ n("div", { className: `${t}-inner-content`, children: [
43
- (m || o) && /* @__PURE__ */ n(
43
+ (s || o) && /* @__PURE__ */ n(
44
44
  "div",
45
45
  {
46
- className: `${t}-title ${t}-title-align-${d.datetime}`,
46
+ className: `${t}-title ${t}-title-align-${l.datetime}`,
47
47
  children: [
48
- m && /* @__PURE__ */ a("span", { className: `${t}-author`, children: m }),
48
+ s && /* @__PURE__ */ a("span", { className: `${t}-author`, children: s }),
49
49
  o && /* @__PURE__ */ a("span", { className: `${t}-datetime`, children: o })
50
50
  ]
51
51
  }
52
52
  ),
53
- c && /* @__PURE__ */ a("div", { className: `${t}-content`, children: c }),
54
- l && /* @__PURE__ */ a(
53
+ m && /* @__PURE__ */ a("div", { className: `${t}-content`, children: m }),
54
+ r && /* @__PURE__ */ a(
55
55
  "div",
56
56
  {
57
- className: `${t}-actions ${t}-actions-align-${d.actions}`,
58
- children: l
57
+ className: `${t}-actions ${t}-actions-align-${l.actions}`,
58
+ children: r
59
59
  }
60
60
  )
61
61
  ] }),
@@ -65,10 +65,10 @@ function A(p, $) {
65
65
  }
66
66
  );
67
67
  }
68
- const P = v(
69
- A
68
+ const A = v(
69
+ b
70
70
  );
71
- P.displayName = "Comment";
71
+ A.displayName = "Comment";
72
72
  export {
73
- P as default
73
+ A as default
74
74
  };
@@ -1,61 +1,58 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import y from "@unicom-cloud/icons/IconUiMute";
3
- import I from "@unicom-cloud/icons/IconUiPauseCircleFill";
4
- import x from "@unicom-cloud/icons/IconUiPlayCircleFill";
5
- import C from "@unicom-cloud/icons/IconUiSound";
6
- import { memo as U, forwardRef as g, useState as v, useEffect as F, useImperativeHandle as H } from "react";
7
- function T(m) {
8
- function h(S, d) {
9
- const { useButton: k = !0, buttonProps: t, ...i } = S ?? {}, [l, s] = v(!1);
10
- function f() {
11
- var n, e;
12
- (e = (n = window.speechSynthesis) == null ? void 0 : n.cancel) == null || e.call(n);
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import w from "@unicom-cloud/icons/IconUiMute";
3
+ import y from "@unicom-cloud/icons/IconUiPauseCircleFill";
4
+ import I from "@unicom-cloud/icons/IconUiPlayCircleFill";
5
+ import x from "@unicom-cloud/icons/IconUiSound";
6
+ import { memo as C, forwardRef as P, useState as U, useEffect as g, useImperativeHandle as b } from "react";
7
+ function B(u) {
8
+ function p(f, m) {
9
+ const { useButton: h = !0, buttonProps: c, ...o } = f ?? {}, [s, t] = U(!1);
10
+ function l() {
11
+ window.speechSynthesis?.cancel?.();
13
12
  }
14
- function w() {
15
- var c, o, p;
16
- let n = ((c = i.getText) == null ? void 0 : c.call(i)) || i.text, e = new SpeechSynthesisUtterance(n);
13
+ function S() {
14
+ let n = o.getText?.() || o.text, e = new SpeechSynthesisUtterance(n);
17
15
  e.onstart = function() {
18
- s(!0);
16
+ t(!0);
19
17
  }, e.onerror = () => {
20
- s(!1);
18
+ t(!1);
21
19
  }, e.onmark = () => {
22
20
  }, e.onpause = () => {
23
- s(!1);
21
+ t(!1);
24
22
  }, e.onresume = () => {
25
- s(!0);
23
+ t(!0);
26
24
  }, e.onboundary = () => {
27
25
  }, e.onend = () => {
28
- s(!1);
29
- }, (p = (o = window.speechSynthesis) == null ? void 0 : o.speak) == null || p.call(o, e);
26
+ t(!1);
27
+ }, window.speechSynthesis?.speak?.(e);
30
28
  }
31
- function u(n) {
32
- var e;
33
- f(), l || w(), (e = t == null ? void 0 : t.onClick) == null || e.call(t, n);
29
+ function a(n) {
30
+ l(), s || S(), c?.onClick?.(n);
34
31
  }
35
- let a;
32
+ let r;
36
33
  if (window.speechSynthesis && window.SpeechSynthesisUtterance)
37
- if (k) {
38
- let { label: n, text: e, children: c, ...o } = t ?? {};
39
- a = /* @__PURE__ */ r(
40
- m,
34
+ if (h) {
35
+ let { label: n, text: e, children: d, ...k } = c ?? {};
36
+ r = /* @__PURE__ */ i(
37
+ u,
41
38
  {
42
- ...i,
39
+ ...o,
43
40
  type: "text",
44
41
  size: "mini",
45
- icon: l ? /* @__PURE__ */ r(y, {}) : /* @__PURE__ */ r(C, {}),
46
- ...o,
47
- onClick: u,
48
- children: n || e || c
42
+ icon: s ? /* @__PURE__ */ i(w, {}) : /* @__PURE__ */ i(x, {}),
43
+ ...k,
44
+ onClick: a,
45
+ children: n || e || d
49
46
  }
50
47
  );
51
48
  } else
52
- a = /* @__PURE__ */ r(l ? I : x, { ...i.iconProps, onClick: u });
53
- return F(() => () => {
54
- f();
55
- }, []), H(d, () => ({})), a;
49
+ r = /* @__PURE__ */ i(s ? y : I, { ...o.iconProps, onClick: a });
50
+ return g(() => () => {
51
+ l();
52
+ }, []), b(m, () => ({})), r;
56
53
  }
57
- return U(g(h));
54
+ return C(P(p));
58
55
  }
59
56
  export {
60
- T as default
57
+ B as default
61
58
  };
@@ -1,11 +1,11 @@
1
- import { useState as d, useEffect as n } from "react";
2
- const o = {};
3
- function e(t) {
4
- const [u, s] = d();
5
- return n(() => {
6
- o[t] ?? (o[t] = 0), s(o[t]), o[t] += 1;
7
- }, []), typeof u == "number" ? `${t}${u}` : void 0;
1
+ import { useState as s, useEffect as u } from "react";
2
+ const e = {};
3
+ function d(t) {
4
+ const [o, n] = s();
5
+ return u(() => {
6
+ e[t] ??= 0, n(e[t]), e[t] += 1;
7
+ }, []), typeof o == "number" ? `${t}${o}` : void 0;
8
8
  }
9
9
  export {
10
- e as default
10
+ d as default
11
11
  };
@@ -1,31 +1,31 @@
1
- import { useState as w, useCallback as h, useEffect as m } from "react";
1
+ import { useState as I, useCallback as w, useEffect as m } from "react";
2
2
  import p, { supportIntersectionObserver as O } from "./useIntersectionObserver.js";
3
- function E(u) {
3
+ function k(u) {
4
4
  const {
5
- defaultInView: s,
5
+ defaultInView: t,
6
6
  unobserverOnEnter: r = !0,
7
- onChange: t,
8
- target: n,
7
+ onChange: o,
8
+ target: s,
9
9
  ...a
10
- } = u, [f, l] = w(
11
- O ? s : !0
12
- ), b = h(
10
+ } = u, [f, l] = I(
11
+ O ? t : !0
12
+ ), b = w(
13
13
  ([e], c) => {
14
- const o = c.thresholds.some(
15
- (I) => e.intersectionRatio >= I
14
+ const n = c.thresholds.some(
15
+ (v) => e.intersectionRatio >= v
16
16
  ) && e.isIntersecting;
17
- l(o), t == null || t(o, e), o && r && c.unobserve(e.target);
17
+ l(n), o?.(n, e), n && r && c.unobserve(e.target);
18
18
  },
19
- [t, r]
20
- ), { cor: d, dor: i, observer: v } = p(
19
+ [o, r]
20
+ ), { cor: d, dor: i, observer: h } = p(
21
21
  b,
22
22
  a
23
23
  );
24
- return m(() => (s && r ? i() : n && d(n), i), [n, s, r]), {
24
+ return m(() => (t && r ? i() : s && d(s), i), [s, t, r]), {
25
25
  inView: f,
26
- observer: v
26
+ observer: h
27
27
  };
28
28
  }
29
29
  export {
30
- E as default
30
+ k as default
31
31
  };
@@ -2,7 +2,7 @@ import { useRef as c } from "react";
2
2
  import { isServerRendering as i } from "../utils/dom.js";
3
3
  import "../utils/is.js";
4
4
  import { isUndefined as u } from "@unicom-cloud/utils/is";
5
- const f = !i && !u(window == null ? void 0 : window.IntersectionObserver);
5
+ const f = !i && !u(window?.IntersectionObserver);
6
6
  function O(t, o = {}) {
7
7
  const r = c(), e = () => {
8
8
  r.current && (r.current.disconnect(), r.current = null);
@@ -1,17 +1,16 @@
1
- import { useCallback as u } from "react";
2
- import { Enter as E, ArrowDown as g, ArrowLeft as m, ArrowRight as D, ArrowUp as L } from "@unicom-cloud/utils/constant/keyboardCode";
3
- function h(r) {
4
- return u(
5
- (e) => ({
6
- onKeyDown(n) {
7
- var o, i, w, f, y, A;
8
- const t = n.key;
9
- t === E.key && ((o = e.onPressEnter) == null || o.call(e, n)), t === g.key && ((i = e.onArrowDown) == null || i.call(e, n)), t === m.key && ((w = e.onArrowLeft) == null || w.call(e, n)), t === D.key && ((f = e.onArrowRight) == null || f.call(e, n)), t === L.key && ((y = e.onArrowUp) == null || y.call(e, n)), (A = r == null ? void 0 : r.onKeyDown) == null || A.call(r, n);
1
+ import { useCallback as t } from "react";
2
+ import { Enter as i, ArrowDown as w, ArrowLeft as f, ArrowRight as y, ArrowUp as A } from "@unicom-cloud/utils/constant/keyboardCode";
3
+ function E(n) {
4
+ return t(
5
+ (o) => ({
6
+ onKeyDown(r) {
7
+ const e = r.key;
8
+ e === i.key && o.onPressEnter?.(r), e === w.key && o.onArrowDown?.(r), e === f.key && o.onArrowLeft?.(r), e === y.key && o.onArrowRight?.(r), e === A.key && o.onArrowUp?.(r), n?.onKeyDown?.(r);
10
9
  }
11
10
  }),
12
11
  []
13
12
  );
14
13
  }
15
14
  export {
16
- h as default
15
+ E as default
17
16
  };
@@ -1,9 +1,6 @@
1
1
  import { useRef as d, useEffect as f } from "react";
2
2
  function a(o, { hidden: s }) {
3
- const c = d(!1), r = d({}), u = (t) => {
4
- var e, n;
5
- return t === document.body || ((n = (e = t.tagName) == null ? void 0 : e.toLowerCase) == null ? void 0 : n.call(e)) === "body" ? window.innerWidth - (document.body.clientWidth || document.documentElement.clientWidth) : t.offsetWidth - t.clientWidth;
6
- }, l = () => {
3
+ const c = d(!1), r = d({}), u = (t) => t === document.body || t.tagName?.toLowerCase?.() === "body" ? window.innerWidth - (document.body.clientWidth || document.documentElement.clientWidth) : t.offsetWidth - t.clientWidth, l = () => {
7
4
  const t = o();
8
5
  if (t && t.style.overflow !== "hidden") {
9
6
  const e = t.style;
@@ -1,10 +1,10 @@
1
- import { useRef as c, useCallback as n } from "react";
2
- function a(t) {
3
- const r = c();
4
- return r.current = t, n(
5
- (...u) => {
6
- const e = r.current;
7
- return e == null ? void 0 : e(...u);
1
+ import { useRef as u, useCallback as c } from "react";
2
+ function a(e) {
3
+ const r = u();
4
+ return r.current = e, c(
5
+ (...t) => {
6
+ const n = r.current;
7
+ return n?.(...t);
8
8
  },
9
9
  [r.current]
10
10
  );
@@ -1,16 +1,15 @@
1
- import { useState as c, useRef as o, useCallback as f, useEffect as S } from "react";
2
- function i(u) {
3
- const [s, a] = c(u), t = o(), r = f(
4
- (e, n) => {
5
- t.current = n, a(e);
1
+ import { useState as n, useRef as f, useCallback as l, useEffect as o } from "react";
2
+ function b(a) {
3
+ const [t, s] = n(a), e = f(), c = l(
4
+ (u, r) => {
5
+ e.current = r, s(u);
6
6
  },
7
7
  []
8
8
  );
9
- return S(() => {
10
- var e;
11
- (e = t.current) == null || e.call(t, s);
12
- }, [s]), [s, r];
9
+ return o(() => {
10
+ e.current?.(t);
11
+ }, [t]), [t, c];
13
12
  }
14
13
  export {
15
- i as default
14
+ b as default
16
15
  };