@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,85 +1,85 @@
1
1
  import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
- import I from "lodash/isArray";
2
+ import C from "lodash/isArray";
3
3
  import V from "lodash/isNumber";
4
4
  import q from "lodash/isPlainObject";
5
5
  import { useContext as B, useState as G, useRef as J, useEffect as K, Fragment as x } from "react";
6
6
  import "../config-provider/ConfigProvider.js";
7
7
  import Q from "../components/common/hooks/useMergeProps.js";
8
8
  import U from "@unicom-cloud/utils/class-name";
9
- import { responsiveObserve as k, responsiveArray as z } from "../utils/responsiveObserve.js";
9
+ import { responsiveObserve as P, responsiveArray as k } from "../utils/responsiveObserve.js";
10
10
  import W from "../config-provider/context.js";
11
- const P = (f) => I(f) ? f.reduce((p, m) => p + (m.span || 1), 0) : 0, X = {
11
+ const z = (u) => C(u) ? u.reduce((f, h) => f + (h.span || 1), 0) : 0, X = {
12
12
  layout: "horizontal",
13
13
  column: 3,
14
14
  tableLayout: "auto"
15
15
  };
16
- function Y(f) {
16
+ function Y(u) {
17
17
  const {
18
- getPrefixCls: p,
19
- componentConfig: m,
20
- rtl: w,
18
+ getPrefixCls: f,
19
+ componentConfig: h,
20
+ rtl: I,
21
21
  size: d
22
- } = B(W), D = Q(
23
- f,
22
+ } = B(W), w = Q(
23
+ u,
24
24
  X,
25
- m == null ? void 0 : m.Descriptions
25
+ h?.Descriptions
26
26
  ), {
27
- style: L,
28
- className: O,
29
- column: u,
27
+ style: D,
28
+ className: L,
29
+ column: p,
30
30
  title: v,
31
31
  data: b,
32
- border: j,
32
+ border: O,
33
33
  labelStyle: y,
34
34
  valueStyle: $,
35
35
  colon: N,
36
- layout: h,
37
- size: S,
38
- tableLayout: C
39
- } = D, s = p == null ? void 0 : p("descriptions"), [A, E] = G(), g = J(null);
40
- K(() => (g.current = k.subscribe((n) => {
41
- for (let t = 0; t < z.length; t++) {
42
- const e = z[t];
43
- if (n[e]) {
36
+ layout: m,
37
+ size: g,
38
+ tableLayout: j
39
+ } = w, n = f?.("descriptions"), [A, E] = G(), S = J(null);
40
+ K(() => (S.current = P.subscribe((s) => {
41
+ for (let t = 0; t < k.length; t++) {
42
+ const e = k[t];
43
+ if (s[e]) {
44
44
  E(e);
45
45
  break;
46
46
  }
47
47
  }
48
48
  }), () => {
49
- k.unsubscribe(g.current);
49
+ P.unsubscribe(S.current);
50
50
  }), []);
51
51
  let l = 3;
52
- q(u) && (l = u[A] || 3), V(u) && u > 0 && (l = u);
53
- const o = [];
54
- if (I(b) && b.length > 0 && l) {
52
+ q(p) && (l = p[A] || 3), V(p) && p > 0 && (l = p);
53
+ const i = [];
54
+ if (C(b) && b.length > 0 && l) {
55
55
  b.forEach((e) => {
56
- const i = o[o.length - 1], a = P(i);
57
- a === 0 ? o.push([
56
+ const o = i[i.length - 1], a = z(o);
57
+ a === 0 ? i.push([
58
58
  {
59
59
  ...e,
60
60
  span: e.span ? e.span > l ? l : e.span : 1
61
61
  }
62
- ]) : a === l ? o.push([
62
+ ]) : a === l ? i.push([
63
63
  {
64
64
  ...e,
65
65
  span: e.span ? e.span > l ? l : e.span : 1
66
66
  }
67
- ]) : i.push({
67
+ ]) : o.push({
68
68
  ...e,
69
69
  span: e.span ? e.span + a > l ? l - a : e.span : 1
70
70
  });
71
71
  });
72
- const n = o[o.length - 1], t = P(n);
73
- t < l && (n[n.length - 1].span = n[n.length - 1].span + l - t);
72
+ const s = i[i.length - 1], t = z(s);
73
+ t < l && (s[s.length - 1].span = s[s.length - 1].span + l - t);
74
74
  }
75
- function F(n, t) {
75
+ function F(s, t) {
76
76
  return /* @__PURE__ */ c(x, { children: [
77
- /* @__PURE__ */ r("tr", { className: `${s}-row`, children: n.map((e, i) => {
77
+ /* @__PURE__ */ r("tr", { className: `${n}-row`, children: s.map((e, o) => {
78
78
  const a = e.span > 1 ? { colSpan: e.span } : {};
79
79
  return /* @__PURE__ */ c(
80
80
  "td",
81
81
  {
82
- className: `${s}-item-label`,
82
+ className: `${n}-item-label`,
83
83
  ...a,
84
84
  style: y,
85
85
  children: [
@@ -87,57 +87,57 @@ function Y(f) {
87
87
  N
88
88
  ]
89
89
  },
90
- `${e.key || i}_label`
90
+ `${e.key || o}_label`
91
91
  );
92
92
  }) }),
93
- /* @__PURE__ */ r("tr", { className: `${s}-row`, children: n.map((e, i) => {
93
+ /* @__PURE__ */ r("tr", { className: `${n}-row`, children: s.map((e, o) => {
94
94
  const a = e.span > 1 ? { colSpan: e.span } : {};
95
95
  return /* @__PURE__ */ r(
96
96
  "td",
97
97
  {
98
- className: `${s}-item-value`,
98
+ className: `${n}-item-value`,
99
99
  ...a,
100
100
  style: $,
101
101
  children: e.value
102
102
  },
103
- `${e.key || i}_value`
103
+ `${e.key || o}_value`
104
104
  );
105
105
  }) })
106
106
  ] }, t);
107
107
  }
108
- function H(n, t) {
109
- return /* @__PURE__ */ r("tr", { className: `${s}-row`, children: n.map((e, i) => {
108
+ function H(s, t) {
109
+ return /* @__PURE__ */ r("tr", { className: `${n}-row`, children: s.map((e, o) => {
110
110
  const a = e.span > 1 ? { colSpan: e.span * 2 - 1 } : {};
111
111
  return /* @__PURE__ */ c(x, { children: [
112
- /* @__PURE__ */ c("td", { className: `${s}-item-label`, style: y, children: [
112
+ /* @__PURE__ */ c("td", { className: `${n}-item-label`, style: y, children: [
113
113
  e.label,
114
114
  N
115
115
  ] }),
116
116
  /* @__PURE__ */ r(
117
117
  "td",
118
118
  {
119
- className: `${s}-item-value`,
119
+ className: `${n}-item-value`,
120
120
  ...a,
121
121
  style: $,
122
122
  children: e.value
123
123
  }
124
124
  )
125
- ] }, e.key || i);
125
+ ] }, e.key || o);
126
126
  }) }, t);
127
127
  }
128
- function M(n, t) {
129
- return /* @__PURE__ */ r("tr", { className: `${s}-row`, children: n.map((e, i) => {
128
+ function M(s, t) {
129
+ return /* @__PURE__ */ r("tr", { className: `${n}-row`, children: s.map((e, o) => {
130
130
  const a = e.span > 1 ? { colSpan: e.span } : {};
131
131
  return /* @__PURE__ */ c(
132
132
  "td",
133
133
  {
134
134
  ...a,
135
- className: `${s}-item`,
135
+ className: `${n}-item`,
136
136
  children: [
137
137
  /* @__PURE__ */ c(
138
138
  "div",
139
139
  {
140
- className: `${s}-item-label-inline`,
140
+ className: `${n}-item-label-inline`,
141
141
  style: y,
142
142
  children: [
143
143
  e.label,
@@ -148,34 +148,34 @@ function Y(f) {
148
148
  /* @__PURE__ */ r(
149
149
  "div",
150
150
  {
151
- className: `${s}-item-value-inline`,
151
+ className: `${n}-item-value-inline`,
152
152
  style: $,
153
153
  children: e.value
154
154
  }
155
155
  )
156
156
  ]
157
157
  },
158
- e.key || i
158
+ e.key || o
159
159
  );
160
160
  }) }, t);
161
161
  }
162
- function R(n, t) {
163
- return h === "inline-vertical" || h === "inline-horizontal" ? M(n, t) : h === "vertical" ? F(n, t) : H(n, t);
162
+ function R(s, t) {
163
+ return m === "inline-vertical" || m === "inline-horizontal" ? M(s, t) : m === "vertical" ? F(s, t) : H(s, t);
164
164
  }
165
165
  const T = U(
166
- s,
166
+ n,
167
167
  {
168
- [`${s}-border`]: j,
169
- [`${s}-layout-${h}`]: h,
170
- [`${s}-size-${S || d}`]: S || d,
171
- [`${s}-table-layout-fixed`]: C === "fixed",
172
- [`${s}-rtl`]: w
168
+ [`${n}-border`]: O,
169
+ [`${n}-layout-${m}`]: m,
170
+ [`${n}-size-${g || d}`]: g || d,
171
+ [`${n}-table-layout-fixed`]: j === "fixed",
172
+ [`${n}-rtl`]: I
173
173
  },
174
- O
174
+ L
175
175
  );
176
- return /* @__PURE__ */ c("div", { className: T, style: L, children: [
177
- v && /* @__PURE__ */ r("div", { className: `${s}-title`, children: v }),
178
- /* @__PURE__ */ r("div", { className: `${s}-body`, children: /* @__PURE__ */ r("table", { className: `${s}-table`, cellPadding: 0, cellSpacing: 0, children: /* @__PURE__ */ r("tbody", { children: o.map((n, t) => R(n, t)) }) }) })
176
+ return /* @__PURE__ */ c("div", { className: T, style: D, children: [
177
+ v && /* @__PURE__ */ r("div", { className: `${n}-title`, children: v }),
178
+ /* @__PURE__ */ r("div", { className: `${n}-body`, children: /* @__PURE__ */ r("table", { className: `${n}-table`, cellPadding: 0, cellSpacing: 0, children: /* @__PURE__ */ r("tbody", { children: i.map((s, t) => R(s, t)) }) }) })
179
179
  ] });
180
180
  }
181
181
  Y.displayName = "Descriptions";
package/details/index.js CHANGED
@@ -1,83 +1,81 @@
1
- import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
- import b from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
- import j from "@unicom-cloud/icons/IconUiCloseCircleFill";
4
- import S from "@unicom-cloud/icons/IconUiDown";
5
- import k from "@unicom-cloud/icons/IconUiExclamationCircleFill";
6
- import d from "@unicom-cloud/icons/IconUiInfoCircleFill";
7
- import { forwardRef as E, useContext as M, useState as P } from "react";
1
+ import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
+ import v from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
+ import F from "@unicom-cloud/icons/IconUiCloseCircleFill";
4
+ import P from "@unicom-cloud/icons/IconUiDown";
5
+ import b from "@unicom-cloud/icons/IconUiExclamationCircleFill";
6
+ import c from "@unicom-cloud/icons/IconUiInfoCircleFill";
7
+ import { forwardRef as j, useContext as S, useState as k } from "react";
8
8
  import "../config-provider/ConfigProvider.js";
9
- import R from "../components/common/hooks/useMergeProps.js";
10
- import u from "@unicom-cloud/utils/class-name";
11
- import T from "../config-provider/context.js";
12
- const _ = {
9
+ import E from "../components/common/hooks/useMergeProps.js";
10
+ import m from "@unicom-cloud/utils/class-name";
11
+ import M from "../config-provider/context.js";
12
+ const R = {
13
13
  type: "default"
14
14
  };
15
- function q(N, $) {
16
- const { getPrefixCls: t, componentConfig: s, rtl: C } = M(T), h = R(
17
- N,
18
- _,
19
- s == null ? void 0 : s.Details
15
+ function T(p, f) {
16
+ const { getPrefixCls: d, componentConfig: u, rtl: C } = S(M), N = E(
17
+ p,
18
+ R,
19
+ u?.Details
20
20
  ), {
21
- style: x,
22
- className: y,
23
- type: r,
24
- title: i,
25
- content: n,
26
- icon: I,
27
- banner: g,
28
- ...w
29
- } = h, e = t == null ? void 0 : t("details"), [D, U] = P({}), l = I || {
30
- default: /* @__PURE__ */ o(d, {}),
31
- info: /* @__PURE__ */ o(d, {}),
32
- success: /* @__PURE__ */ o(b, {}),
33
- warning: /* @__PURE__ */ o(k, {}),
34
- error: /* @__PURE__ */ o(j, {})
35
- }[r], v = u(
21
+ style: $,
22
+ className: g,
23
+ type: t,
24
+ title: s,
25
+ content: r,
26
+ icon: x,
27
+ banner: h,
28
+ ...y
29
+ } = N, e = d?.("details"), [I, w] = k({}), n = x || {
30
+ default: /* @__PURE__ */ o(c, {}),
31
+ info: /* @__PURE__ */ o(c, {}),
32
+ success: /* @__PURE__ */ o(v, {}),
33
+ warning: /* @__PURE__ */ o(b, {}),
34
+ error: /* @__PURE__ */ o(F, {})
35
+ }[t], D = m(
36
36
  e,
37
- `${e}-${r}`,
37
+ `${e}-${t}`,
38
38
  {
39
- [`${e}-banner`]: g,
39
+ [`${e}-banner`]: h,
40
40
  [`${e}-rtl`]: C
41
41
  },
42
- y
42
+ g
43
43
  );
44
- return /* @__PURE__ */ f(
44
+ return /* @__PURE__ */ a(
45
45
  "details",
46
46
  {
47
- ref: $,
48
- style: x,
49
- className: v,
47
+ ref: f,
48
+ style: $,
49
+ className: D,
50
50
  role: "details",
51
- onToggle: (a) => {
52
- var c;
53
- (c = a.target) != null && c.open, U((F) => {
54
- var p;
55
- const m = { ...F };
56
- return m.open = (p = a.target) == null ? void 0 : p.open, m;
51
+ onToggle: (i) => {
52
+ i.target?.open, w((U) => {
53
+ const l = { ...U };
54
+ return l.open = i.target?.open, l;
57
55
  });
58
56
  },
59
- ...w,
57
+ ...y,
60
58
  children: [
61
- /* @__PURE__ */ f("summary", { className: `${e}-summary-wrapper`, children: [
62
- l && /* @__PURE__ */ o("div", { className: `${e}-icon`, children: l }),
63
- i && /* @__PURE__ */ o("div", { className: `${e}-title`, children: i }),
59
+ /* @__PURE__ */ a("summary", { className: `${e}-summary-wrapper`, children: [
60
+ n && /* @__PURE__ */ o("div", { className: `${e}-icon`, children: n }),
61
+ s && /* @__PURE__ */ o("div", { className: `${e}-title`, children: s }),
64
62
  /* @__PURE__ */ o(
65
- S,
63
+ P,
66
64
  {
67
- className: u(
65
+ className: m(
68
66
  `${e}-collapse-icon`,
69
- D.open && `${e}-collapse-icon-open`
67
+ I.open && `${e}-collapse-icon-open`
70
68
  )
71
69
  }
72
70
  )
73
71
  ] }),
74
- /* @__PURE__ */ o("div", { className: `${e}-content-wrapper`, children: n && /* @__PURE__ */ o("div", { className: `${e}-content`, children: n }) })
72
+ /* @__PURE__ */ o("div", { className: `${e}-content-wrapper`, children: r && /* @__PURE__ */ o("div", { className: `${e}-content`, children: r }) })
75
73
  ]
76
74
  }
77
75
  );
78
76
  }
79
- const z = E(q);
80
- z.displayName = "Details";
77
+ const _ = j(T);
78
+ _.displayName = "Details";
81
79
  export {
82
- z as default
80
+ _ as default
83
81
  };
@@ -1,23 +1,23 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import m from "@unicom-cloud/utils/class-name";
2
+ import t from "@unicom-cloud/utils/class-name";
3
3
  import { forwardRef as s, useContext as l, useEffect as r, useImperativeHandle as f } from "react";
4
4
  import i from "../components/common/development/index.js";
5
5
  import "../config-provider/ConfigProvider.js";
6
6
  import c from "../config-provider/context.js";
7
- function C(e, n) {
8
- const { getPrefixCls: o, componentConfig: p } = l(c), t = o == null ? void 0 : o("development");
7
+ function C(e, m) {
8
+ const { getPrefixCls: n, componentConfig: p } = l(c), o = n?.("development");
9
9
  return r(() => () => {
10
- }, []), f(n, () => ({})), /* @__PURE__ */ a(
10
+ }, []), f(m, () => ({})), /* @__PURE__ */ a(
11
11
  i,
12
12
  {
13
13
  ...e,
14
- className: m(t, e.className),
15
- iconClassName: m(`${t}-icon`, e.iconClassName),
16
- labelClassName: m(`${t}-label`, e.labelClassName)
14
+ className: t(o, e.className),
15
+ iconClassName: t(`${o}-icon`, e.iconClassName),
16
+ labelClassName: t(`${o}-label`, e.labelClassName)
17
17
  }
18
18
  );
19
19
  }
20
- const $ = s(C);
20
+ const g = s(C);
21
21
  export {
22
- $ as default
22
+ g as default
23
23
  };
@@ -86,7 +86,7 @@ const q = {
86
86
  new e("#E8EBEE")
87
87
  ]
88
88
  }, K = i.map((n, s, F) => {
89
- const r = n.name, a = (r == null ? void 0 : r.en) ?? (r == null ? void 0 : r.zh) ?? r, u = n.value;
89
+ const r = n.name, a = r?.en ?? r?.zh ?? r, u = n.value;
90
90
  return {
91
91
  key: a,
92
92
  name: r,
@@ -58,7 +58,7 @@ class p {
58
58
  return (this._not ? t : !t) && this.addError(e), this;
59
59
  }
60
60
  collect(t) {
61
- t == null || t(this.error);
61
+ t?.(this.error);
62
62
  }
63
63
  }
64
64
  class R extends p {
@@ -155,12 +155,12 @@ class A extends p {
155
155
  if (t)
156
156
  return o = t(this.obj, this.addError.bind(this)), o && o.then ? (e && o.then(
157
157
  () => {
158
- e == null || e(this.error);
158
+ e?.(this.error);
159
159
  },
160
160
  (a) => {
161
161
  console.error(a);
162
162
  }
163
- ), [o, this]) : (e == null || e(this.error), this.error);
163
+ ), [o, this]) : (e?.(this.error), this.error);
164
164
  }
165
165
  }
166
166
  class D extends p {
@@ -387,8 +387,8 @@ class J {
387
387
  }), o.length > 0 ? Promise.all(o.map((s) => s.function)).then(() => {
388
388
  o.forEach((s) => {
389
389
  s._this.error && g(s.key, s._this.error);
390
- }), e == null || e(a);
391
- }) : e == null || e(a);
390
+ }), e?.(a);
391
+ }) : e?.(a);
392
392
  }
393
393
  }
394
394
  export {
@@ -2,7 +2,7 @@ import { isObject as l } from "@unicom-cloud/utils/is";
2
2
  const i = (o, n) => {
3
3
  const r = { ...o };
4
4
  return Object.keys(n || {}).forEach((e) => {
5
- const t = r[e], s = n == null ? void 0 : n[e];
5
+ const t = r[e], s = n?.[e];
6
6
  r[e] = l(t) ? {
7
7
  ...t,
8
8
  ...s
package/divider/index.js CHANGED
@@ -1,41 +1,41 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as $, useContext as x } from "react";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as x, useContext as $ } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
4
  import u from "../components/common/hooks/useMergeProps.js";
5
- import N from "@unicom-cloud/utils/class-name";
6
- import h from "../config-provider/context.js";
7
- const v = {
5
+ import C from "@unicom-cloud/utils/class-name";
6
+ import N from "../config-provider/context.js";
7
+ const h = {
8
8
  type: "horizontal",
9
9
  orientation: "center"
10
10
  };
11
- function y(n, m) {
12
- const { getPrefixCls: o, componentConfig: r } = x(h), l = u(
13
- n,
14
- v,
15
- r == null ? void 0 : r.Divider
16
- ), { children: e, style: p, className: c, type: i, orientation: s, ...d } = l, t = o == null ? void 0 : o("divider"), f = N(
11
+ function v(i, n) {
12
+ const { getPrefixCls: a, componentConfig: m } = $(N), l = u(
13
+ i,
14
+ h,
15
+ m?.Divider
16
+ ), { children: e, style: p, className: c, type: r, orientation: o, ...f } = l, t = a?.("divider"), d = C(
17
17
  t,
18
- `${t}-${i}`,
18
+ `${t}-${r}`,
19
19
  {
20
20
  [`${t}-with-text`]: e,
21
- [`${t}-with-text-${s}`]: e && s
21
+ [`${t}-with-text-${o}`]: e && o
22
22
  },
23
23
  c
24
24
  );
25
- return /* @__PURE__ */ a(
25
+ return /* @__PURE__ */ s(
26
26
  "div",
27
27
  {
28
28
  role: "separator",
29
- ref: m,
30
- className: f,
29
+ ref: n,
30
+ className: d,
31
31
  style: p,
32
- ...d,
33
- children: e && i === "horizontal" ? /* @__PURE__ */ a("span", { className: `${t}-text ${t}-text-${s}`, children: e }) : null
32
+ ...f,
33
+ children: e && r === "horizontal" ? /* @__PURE__ */ s("span", { className: `${t}-text ${t}-text-${o}`, children: e }) : null
34
34
  }
35
35
  );
36
36
  }
37
- const D = $(y);
38
- D.displayName = "Divider";
37
+ const g = x(v);
38
+ g.displayName = "Divider";
39
39
  export {
40
- D as default
40
+ g as default
41
41
  };
package/draggable/Item.js CHANGED
@@ -1,35 +1,35 @@
1
- import { jsx as T } from "react/jsx-runtime";
2
- import { useRef as P, useState as m, useEffect as $ } from "react";
3
- import S from "@unicom-cloud/utils/class-name";
4
- function N(h) {
1
+ import { jsx as x } from "react/jsx-runtime";
2
+ import { useRef as d, useState as f, useEffect as u } from "react";
3
+ import T from "@unicom-cloud/utils/class-name";
4
+ function I(c) {
5
5
  const {
6
6
  prefixCls: r,
7
- style: v,
8
- children: b,
9
- direction: w,
10
- disabled: x,
7
+ style: m,
8
+ children: D,
9
+ direction: v,
10
+ disabled: P,
11
11
  droppable: i = !0,
12
- onDrop: s,
13
- onDragStart: l,
14
- onDragEnd: g,
15
- onDragOver: f,
16
- onDragLeave: p
17
- } = h, D = P(null), u = P(null), [a, o] = m("none"), [O, n] = m(!1), [c, d] = m(null);
18
- return $(() => () => {
19
- u.current && clearTimeout(u.current);
20
- }, []), $(() => {
21
- a === "dragged" && (u.current = setTimeout(() => o("none"), 1e3));
22
- }, [a]), /* @__PURE__ */ T(
12
+ onDrop: $,
13
+ onDragStart: h,
14
+ onDragEnd: O,
15
+ onDragOver: b,
16
+ onDragLeave: w
17
+ } = c, p = d(null), s = d(null), [a, o] = f("none"), [S, n] = f(!1), [g, l] = f(null);
18
+ return u(() => () => {
19
+ s.current && clearTimeout(s.current);
20
+ }, []), u(() => {
21
+ a === "dragged" && (s.current = setTimeout(() => o("none"), 1e3));
22
+ }, [a]), /* @__PURE__ */ x(
23
23
  "li",
24
24
  {
25
25
  draggable: !0,
26
- ref: D,
27
- style: v,
28
- className: S(`${r}-item`, {
26
+ ref: p,
27
+ style: m,
28
+ className: T(`${r}-item`, {
29
29
  [`${r}-item-${a}`]: a !== "none",
30
- [`${r}-item-gap-${c}`]: c,
31
- [`${r}-item-disabled`]: x,
32
- [`${r}-item-dragover`]: O
30
+ [`${r}-item-gap-${g}`]: g,
31
+ [`${r}-item-disabled`]: P,
32
+ [`${r}-item-dragover`]: S
33
33
  }),
34
34
  onDragStart: (t) => {
35
35
  t.stopPropagation(), o("dragging");
@@ -38,30 +38,30 @@ function N(h) {
38
38
  } catch (e) {
39
39
  console.error(e);
40
40
  }
41
- l == null || l(t);
41
+ h?.(t);
42
42
  },
43
43
  onDragEnd: (t) => {
44
- t.stopPropagation(), n(!1), o("dragged"), g == null || g(t);
44
+ t.stopPropagation(), n(!1), o("dragged"), O?.(t);
45
45
  },
46
46
  onDragOver: (t) => {
47
47
  if (i) {
48
48
  t.stopPropagation(), t.preventDefault();
49
- const e = D.current.getBoundingClientRect();
50
- d(
51
- w === "vertical" ? t.pageY > window.pageYOffset + e.top + e.height / 2 ? "bottom" : "top" : t.pageX > window.pageXOffset + e.left + e.width / 2 ? "right" : "left"
52
- ), n(!0), f == null || f(t);
49
+ const e = p.current.getBoundingClientRect();
50
+ l(
51
+ v === "vertical" ? t.pageY > window.pageYOffset + e.top + e.height / 2 ? "bottom" : "top" : t.pageX > window.pageXOffset + e.left + e.width / 2 ? "right" : "left"
52
+ ), n(!0), b?.(t);
53
53
  }
54
54
  },
55
55
  onDragLeave: (t) => {
56
- i && (t.stopPropagation(), n(!1), p == null || p(t));
56
+ i && (t.stopPropagation(), n(!1), w?.(t));
57
57
  },
58
58
  onDrop: (t) => {
59
- i && (t.stopPropagation(), t.preventDefault(), n(!1), d(null), o("none"), s == null || s(t, c));
59
+ i && (t.stopPropagation(), t.preventDefault(), n(!1), l(null), o("none"), $?.(t, g));
60
60
  },
61
- children: b
61
+ children: D
62
62
  }
63
63
  );
64
64
  }
65
65
  export {
66
- N as default
66
+ I as default
67
67
  };