@unicom-cloud/ui 0.8.95 → 0.8.97

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 (326) hide show
  1. package/Affix.js +1 -1
  2. package/Carousel.js +1 -1
  3. package/LiquidFill.js +4 -0
  4. package/Message.js +1 -1
  5. package/Notification.js +1 -1
  6. package/OverflowEllipsis.js +1 -1
  7. package/PageHeader.js +1 -1
  8. package/QrCode.js +57 -0
  9. package/Switch.js +1 -1
  10. package/Tour.js +63 -0
  11. package/Trigger.js +2 -2
  12. package/_virtual/_commonjsHelpers.js +6 -0
  13. package/_virtual/index.js +7 -0
  14. package/_virtual/index2.js +4 -0
  15. package/affix/index.js +70 -72
  16. package/alert/index.js +52 -51
  17. package/anchor/Anchor.js +55 -55
  18. package/anchor/Link.js +34 -34
  19. package/anchor/util.js +5 -5
  20. package/auto-complete/index.js +116 -122
  21. package/avatar/Avatar.js +33 -33
  22. package/avatar/Group.js +26 -26
  23. package/back-top/index.js +58 -61
  24. package/badge/index.js +46 -46
  25. package/breadcrumb/Item.js +42 -43
  26. package/breadcrumb/index.js +47 -47
  27. package/button/Group.js +6 -6
  28. package/button/index.js +91 -91
  29. package/calendar/Month.js +75 -75
  30. package/calendar/Year.js +35 -35
  31. package/calendar/header/index.js +25 -25
  32. package/calendar/index.js +103 -103
  33. package/card/Grid.js +8 -8
  34. package/card/Meta.js +16 -16
  35. package/card/index.js +49 -49
  36. package/carousel/Arrow.js +19 -19
  37. package/carousel/Indicator.js +26 -26
  38. package/carousel/index.js +108 -108
  39. package/cascader/Cascader.js +178 -191
  40. package/cascader/base/node.js +133 -136
  41. package/cascader/base/store.js +82 -85
  42. package/cascader/panel/List.js +126 -130
  43. package/cascader/panel/Search.js +79 -81
  44. package/cascader/util.js +13 -13
  45. package/checkbox/Checkbox.js +94 -96
  46. package/checkbox/Group.js +54 -56
  47. package/checkbox/GroupBlock.js +28 -29
  48. package/collapse/Collapse.js +45 -45
  49. package/collapse/Item.js +53 -55
  50. package/color-picker/ControlBar.js +43 -43
  51. package/color-picker/InputAlpha.js +12 -12
  52. package/color-picker/InputHex.js +30 -31
  53. package/color-picker/InputRgb.js +24 -24
  54. package/color-picker/Palette.js +18 -18
  55. package/color-picker/Panel.js +122 -125
  56. package/color-picker/hooks/useColorPicker.js +85 -88
  57. package/color-picker/hooks/useControlBlock.js +38 -40
  58. package/color-picker/index.js +47 -47
  59. package/comment/index.js +29 -29
  60. package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
  61. package/components/common/hooks/useForceUpdate.js +6 -2
  62. package/components/common/hooks/useId.js +4 -4
  63. package/components/common/hooks/useInView.js +16 -16
  64. package/components/common/hooks/useIntersectionObserver.js +1 -1
  65. package/components/common/hooks/useKeyboardEvent.js +9 -10
  66. package/components/common/hooks/useOverflowHidden.js +1 -4
  67. package/components/common/hooks/usePersistCallback.js +7 -7
  68. package/components/common/hooks/useStateCallback.js +9 -10
  69. package/components/common/hooks/useWindowSize.js +8 -8
  70. package/components/common/space/index.js +11 -10
  71. package/components/common/utils/PqbCSSTransition.js +1 -1
  72. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  73. package/components/common/utils/dom.js +27 -29
  74. package/components/common/utils/findScrollParent.js +17 -0
  75. package/components/common/utils/intersectionObserver.js +21 -0
  76. package/components/common/utils/is.js +99 -109
  77. package/components/common/utils/mutationObserver.js +19 -0
  78. package/components/common/utils/reactDOM.js +34 -34
  79. package/components/common/utils/resizeObserver.js +21 -0
  80. package/copy/index.js +38 -40
  81. package/date-picker/Picker.js +290 -295
  82. package/date-picker/RangePicker.js +367 -372
  83. package/date-picker/index.js +33 -35
  84. package/date-picker/panel/Body.js +46 -47
  85. package/date-picker/panel/Header.js +33 -33
  86. package/date-picker/panel/Shortcut.js +31 -31
  87. package/date-picker/panel/date/index.js +85 -85
  88. package/date-picker/panel/month/index.js +59 -59
  89. package/date-picker/panel/quarter/index.js +67 -70
  90. package/date-picker/panel/range/index.js +101 -101
  91. package/date-picker/panel/year/index.js +39 -39
  92. package/date-picker/util.js +17 -18
  93. package/descriptions/index.js +62 -62
  94. package/details/index.js +55 -56
  95. package/development/index.js +9 -9
  96. package/dist/react-transition-group/src/CSSTransition.js +1 -1
  97. package/dist/react-transition-group/src/SwitchTransition.js +1 -1
  98. package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
  99. package/dist/tween/src/tween.js +24 -25
  100. package/dist/validate/src/index.js +5 -5
  101. package/dist/validate/src/util.js +1 -1
  102. package/divider/index.js +21 -21
  103. package/draggable/Item.js +35 -35
  104. package/draggable/index.js +22 -22
  105. package/drawer/Drawer.js +142 -147
  106. package/dropdown/Button.js +48 -48
  107. package/dropdown/index.js +88 -92
  108. package/empty/index.js +16 -16
  109. package/form/Control.js +211 -225
  110. package/form/Form.js +109 -113
  111. package/form/FormItem.js +118 -120
  112. package/form/FormList.js +60 -66
  113. package/form/FormProvider.js +31 -34
  114. package/form/hook/useContext.js +17 -19
  115. package/form/hook/useState.js +22 -23
  116. package/form/hook/useWatch.js +26 -27
  117. package/form/promisify.js +14 -18
  118. package/form/store.js +304 -316
  119. package/form/util.js +14 -15
  120. package/grid/Col.js +64 -64
  121. package/grid/Grid.js +51 -51
  122. package/grid/GridItem.js +48 -48
  123. package/grid/Row.js +39 -39
  124. package/hooks/index.js +50 -52
  125. package/hooks/useVerificationCode.js +41 -43
  126. package/hooks/useWatermark.js +89 -92
  127. package/icon/index.js +23 -24
  128. package/icon-hover/index.js +16 -16
  129. package/icons/file.js +11 -11
  130. package/image/Image.js +140 -141
  131. package/image/ImagePreview.js +252 -255
  132. package/image/ImagePreviewArrow.js +25 -25
  133. package/image/ImagePreviewGroup.js +62 -62
  134. package/image/util/getScale.js +25 -28
  135. package/index.js +682 -679
  136. package/input/Button.js +48 -50
  137. package/input/Group.js +9 -9
  138. package/input/Input.js +145 -154
  139. package/input/InputElement.js +108 -115
  140. package/input/Password.js +38 -38
  141. package/input/Search.js +51 -55
  142. package/input/Textarea.js +80 -81
  143. package/input/useComposition.js +23 -23
  144. package/input-number/decimal.js +59 -62
  145. package/input-number/index.js +139 -141
  146. package/input-tag/InputTag.js +223 -231
  147. package/layout/Content.js +6 -6
  148. package/layout/Footer.js +8 -8
  149. package/layout/Header.js +7 -7
  150. package/layout/Sider.js +88 -90
  151. package/layout/index.js +30 -30
  152. package/link/index.js +45 -46
  153. package/liquid-fill/LiquidFill.js +189 -0
  154. package/liquid-fill/LiquidFill2.js +3 -0
  155. package/liquid-fill/index.js +4 -0
  156. package/liquid-fill/interface.js +1 -0
  157. package/list/Item.js +28 -28
  158. package/list/Meta.js +12 -12
  159. package/list/index.js +146 -148
  160. package/mentions/index.js +75 -76
  161. package/menu/Item.js +58 -58
  162. package/menu/Menu.js +125 -127
  163. package/menu/OverflowWrap.js +39 -40
  164. package/menu/sub-menu/Inline.js +45 -45
  165. package/menu/util.js +26 -28
  166. package/message/index.js +97 -100
  167. package/message/useMessage.js +26 -27
  168. package/modal/Confirm.js +47 -49
  169. package/modal/Modal.js +250 -257
  170. package/modal/use-modal/Hook.js +26 -28
  171. package/modal/use-modal/index.js +46 -49
  172. package/notice/index.js +89 -90
  173. package/notification/index.js +61 -66
  174. package/notification/withNotification.js +35 -35
  175. package/overflow-ellipsis/OverflowItem.js +19 -20
  176. package/overflow-ellipsis/index.js +45 -46
  177. package/package.json +1 -1
  178. package/page-header/index.js +45 -45
  179. package/pagination/PageItem.js +87 -91
  180. package/pagination/PageJumper.js +40 -41
  181. package/pagination/PageOption.js +31 -35
  182. package/pagination/Pagination.js +162 -163
  183. package/picker/Input.js +90 -96
  184. package/picker/InputRange.js +115 -122
  185. package/popconfirm/index.js +98 -100
  186. package/popover/index.js +28 -28
  187. package/portal/Portal.js +10 -11
  188. package/progress/index.js +36 -36
  189. package/qr-code/index.js +99 -0
  190. package/qr-code/interface.js +1 -0
  191. package/radio/Group.js +48 -48
  192. package/radio/GroupBlock.js +32 -33
  193. package/radio/Radio.js +62 -64
  194. package/rate/index.js +88 -88
  195. package/resize-box/ResizeTrigger.js +39 -39
  196. package/resize-box/Split.js +92 -96
  197. package/resize-box/SplitGroup.js +116 -122
  198. package/resize-box/index.js +112 -115
  199. package/result/index.js +44 -44
  200. package/select/Option.js +53 -56
  201. package/select/Select.js +365 -381
  202. package/select/util.js +95 -99
  203. package/select-view/Core.js +159 -160
  204. package/skeleton/index.js +23 -23
  205. package/slider/Button.js +84 -92
  206. package/slider/Input.js +47 -49
  207. package/slider/Tick.js +28 -31
  208. package/slider/index.js +108 -108
  209. package/slider/util.js +1 -1
  210. package/space/index.js +26 -26
  211. package/space-/index.js +51 -51
  212. package/spin/DotLoading.js +8 -8
  213. package/spin/index.js +47 -47
  214. package/statistic/Countdown.js +37 -37
  215. package/statistic/index.js +61 -61
  216. package/steps/Step.js +42 -42
  217. package/steps/index.js +54 -54
  218. package/style.css +1 -1
  219. package/switch/index.js +78 -79
  220. package/table/ColGroup.js +36 -37
  221. package/table/Table.js +447 -450
  222. package/table/hook/useExpand.js +24 -24
  223. package/table/hook/useRowSelection.js +62 -62
  224. package/table/summary/Row.js +16 -17
  225. package/table/tbody/Td.js +119 -118
  226. package/table/tbody/Tr.js +119 -121
  227. package/table/tbody/index.js +62 -63
  228. package/table/th-resizable/index.js +30 -30
  229. package/table/thead/Column.js +148 -148
  230. package/table/thead/index.js +87 -88
  231. package/tabs/Tab.js +55 -55
  232. package/tabs/TabContent.js +8 -8
  233. package/tabs/TabPane.js +15 -15
  234. package/tabs/hook/useHeaderScroll.js +36 -36
  235. package/tabs/tab-header/TabInk.js +31 -33
  236. package/tabs/tab-header/TabNavIcon.js +34 -35
  237. package/tabs/tab-header/index.js +192 -195
  238. package/tag/index.js +94 -97
  239. package/time-picker/Picker.js +167 -172
  240. package/time-picker/RangePicker.js +28 -28
  241. package/time-picker/TimePicker.js +146 -146
  242. package/time-picker/util.js +4 -4
  243. package/timeline/Item.js +46 -46
  244. package/timeline/Timeline.js +52 -52
  245. package/tooltip/index.js +89 -95
  246. package/tour/index.js +289 -0
  247. package/transfer/Item.js +54 -54
  248. package/transfer/List.js +134 -136
  249. package/transfer/index.js +91 -91
  250. package/tree/Animation.js +49 -52
  251. package/tree/Node.js +114 -122
  252. package/tree/NodeList.js +51 -51
  253. package/tree/Tree.js +386 -393
  254. package/tree-select/List.js +71 -72
  255. package/tree-select/Select.js +135 -143
  256. package/tree-select/hook/useKeyCache.js +39 -39
  257. package/tree-select/hook/useStateValue.js +12 -12
  258. package/trigger/getPopupStyle.js +60 -61
  259. package/trigger/index.js +338 -347
  260. package/types/common/space/interface.d.ts +1 -1
  261. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  262. package/types/common/utils/findScrollParent.d.ts +2 -0
  263. package/types/common/utils/index.d.ts +5 -0
  264. package/types/common/utils/intersectionObserver.d.ts +2 -0
  265. package/types/common/utils/math.d.ts +1 -1
  266. package/types/common/utils/mutationObserver.d.ts +2 -0
  267. package/types/common/utils/resizeObserver.d.ts +2 -0
  268. package/types/pc/alert/interface.d.ts +2 -2
  269. package/types/pc/details/interface.d.ts +2 -2
  270. package/types/pc/hooks/index.d.ts +0 -1
  271. package/types/pc/index.d.ts +3 -0
  272. package/types/pc/liquid-fill/LiquidFill.d.ts +30 -0
  273. package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
  274. package/types/pc/liquid-fill/index.d.ts +4 -0
  275. package/types/pc/liquid-fill/interface.d.ts +0 -0
  276. package/types/pc/qr-code/index.d.ts +34 -0
  277. package/types/pc/qr-code/interface.d.ts +39 -0
  278. package/types/pc/table/interface.d.ts +2 -2
  279. package/types/pc/tour/index.d.ts +42 -0
  280. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  281. package/types/pc/utils/findScrollParent.d.ts +2 -0
  282. package/types/pc/utils/index.d.ts +5 -0
  283. package/types/pc/utils/intersectionObserver.d.ts +2 -0
  284. package/types/pc/utils/math.d.ts +1 -1
  285. package/types/pc/utils/mutationObserver.d.ts +2 -0
  286. package/types/pc/utils/names.d.ts +18 -0
  287. package/types/pc/utils/resizeObserver.d.ts +2 -0
  288. package/typography/Base.js +79 -81
  289. package/typography/EditContent.js +30 -33
  290. package/typography/Ellipsis.js +78 -75
  291. package/typography/Operations.js +50 -52
  292. package/typography/Paragraph.js +7 -7
  293. package/typography/Typography.js +7 -7
  294. package/typography/useEllipsis.js +105 -106
  295. package/upload/TriggerNode.js +69 -76
  296. package/upload/Upload.js +84 -87
  297. package/upload/Uploader.js +115 -118
  298. package/upload/list/PictureItem.js +61 -71
  299. package/upload/list/TextItem.js +61 -67
  300. package/upload/list/UploadProgress.js +42 -49
  301. package/upload/list/index.js +49 -50
  302. package/upload/request_.js +37 -38
  303. package/upload/util.js +39 -39
  304. package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  305. package/utils/findScrollParent.js +4 -0
  306. package/utils/index.js +274 -275
  307. package/utils/intersectionObserver.js +4 -0
  308. package/utils/math.js +7 -11
  309. package/utils/mutationObserver.js +4 -0
  310. package/utils/names.js +12 -0
  311. package/utils/reactTransitionGroup.js +1 -1
  312. package/utils/resizeObserver.js +4 -0
  313. package/verification-code/VerificationCode.js +50 -51
  314. package/version/index.js +1 -1
  315. package/virtual-list/VirtualList.js +243 -244
  316. package/virtual-list/util/item.js +3 -4
  317. package/watermark/Watermark.js +27 -31
  318. package/components/common/hooks/useComputedState.js +0 -11
  319. package/components/common/utils/resizeObserverEffect.js +0 -23
  320. package/hooks/useComputedState.js +0 -4
  321. package/types/common/hooks/useComputedState.d.ts +0 -4
  322. package/types/common/utils/resizeObserverEffect.d.ts +0 -2
  323. package/types/pc/hooks/useComputedState.d.ts +0 -1
  324. package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
  325. package/utils/resizeObserverEffect.js +0 -4
  326. /package/dist/react-transition-group/chunk/{C6QwjD4L.js → CPfP7aNL.js} +0 -0
package/form/util.js CHANGED
@@ -14,29 +14,28 @@ function F(t) {
14
14
  return n;
15
15
  });
16
16
  }
17
- const G = (t, n) => h(t, (e) => {
18
- if (S(e))
19
- return (s) => e(s, n);
17
+ const G = (t, n) => h(t, (r) => {
18
+ if (S(r))
19
+ return (s) => r(s, n);
20
20
  });
21
- function H(t, n, e) {
22
- return E(t, n, F(e)), t;
21
+ function H(t, n, r) {
22
+ return E(t, n, F(r)), t;
23
23
  }
24
24
  function L(t, n = "") {
25
- const e = /* @__PURE__ */ new Set(), s = (r, o = "") => r ? e.has(r) ? [] : (e.add(r), g(
26
- Object.keys(r).map((i) => (d(r[i]) || y(r[i])) && Object.keys(r[i]).length && !O.isValidElement(r[i]) ? s(r[i], `${o + i}.`) : o + i)
25
+ const r = /* @__PURE__ */ new Set(), s = (e, o = "") => e ? r.has(e) ? [] : (r.add(e), g(
26
+ Object.keys(e).map((i) => (d(e[i]) || y(e[i])) && Object.keys(e[i]).length && !O.isValidElement(e[i]) ? s(e[i], `${o + i}.`) : o + i)
27
27
  )) : [];
28
28
  return s(t, n);
29
29
  }
30
30
  function R(t) {
31
- var n;
32
- return ((n = t == null ? void 0 : t.constructor) == null ? void 0 : n.name) === "SyntheticEvent" || (t == null ? void 0 : t.nativeEvent) instanceof Event;
31
+ return t?.constructor?.name === "SyntheticEvent" || t?.nativeEvent instanceof Event;
33
32
  }
34
- async function U(t, n, e, s) {
35
- const r = [...e || []];
33
+ async function U(t, n, r, s) {
34
+ const e = [...r || []];
36
35
  let o = 0;
37
36
  return new Promise(async (i) => {
38
37
  const a = [], f = async (u) => {
39
- const p = () => o < r.length - 1 ? (o++, f(r[o])) : i({ error: null, warning: a });
38
+ const p = () => o < e.length - 1 ? (o++, f(e[o])) : i({ error: null, warning: a });
40
39
  if (!u)
41
40
  return p();
42
41
  const c = { ...u };
@@ -55,12 +54,12 @@ async function U(t, n, e, s) {
55
54
  return p();
56
55
  });
57
56
  };
58
- f(r[o]);
57
+ f(e[o]);
59
58
  });
60
59
  }
61
60
  function X(t, n) {
62
- const e = w({}, t, void 0, Object);
63
- return n.some((s) => v(e, s));
61
+ const r = w({}, t, void 0, Object);
62
+ return n.some((s) => v(r, s));
64
63
  }
65
64
  const $ = "_input";
66
65
  export {
package/grid/Col.js CHANGED
@@ -1,86 +1,86 @@
1
- import { jsx as F } from "react/jsx-runtime";
2
- import H from "lodash/isNumber";
3
- import T from "lodash/isPlainObject";
4
- import { forwardRef as q, useContext as w, useMemo as D } from "react";
1
+ import { jsx as E } from "react/jsx-runtime";
2
+ import F from "lodash/isNumber";
3
+ import H from "lodash/isPlainObject";
4
+ import { forwardRef as T, useContext as R, useMemo as q } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
6
- import I from "../components/common/hooks/useMergeProps.js";
7
- import J from "@unicom-cloud/utils/class-name";
8
- import { RowContext as K } from "./context.js";
9
- import Q from "../config-provider/context.js";
10
- const U = {
6
+ import D from "../components/common/hooks/useMergeProps.js";
7
+ import I from "@unicom-cloud/utils/class-name";
8
+ import { RowContext as J } from "./context.js";
9
+ import K from "../config-provider/context.js";
10
+ const Q = {
11
11
  span: 24
12
12
  };
13
- function A(i) {
13
+ function S(i) {
14
14
  return typeof i == "string" && /\d+[px|%|em|rem|]{1}/.test(i) ? `0 0 ${i}` : i;
15
15
  }
16
- function W(i, G) {
17
- const { getPrefixCls: l, componentConfig: f, rtl: L } = w(Q), M = I(
16
+ function U(i, v) {
17
+ const { getPrefixCls: w, componentConfig: A, rtl: C } = R(K), G = D(
18
18
  i,
19
- U,
20
- f == null ? void 0 : f["Grid.Col"]
21
- ), { gutter: p, div: e } = w(K), {
22
- className: N,
23
- style: O,
24
- children: P,
25
- span: V,
26
- offset: u,
27
- order: c,
28
- pull: m,
29
- push: x,
30
- xs: y,
19
+ Q,
20
+ A?.["Grid.Col"]
21
+ ), { gutter: p, div: l } = R(J), {
22
+ className: L,
23
+ style: M,
24
+ children: N,
25
+ span: O,
26
+ offset: d,
27
+ order: a,
28
+ pull: u,
29
+ push: c,
30
+ xs: m,
31
31
  sm: g,
32
- md: h,
33
- lg: b,
34
- xl: j,
35
- xxl: R,
36
- xxxl: S,
37
- flex: d,
38
- ...k
39
- } = M;
40
- function z(r, o) {
41
- const v = { xs: y, sm: g, md: h, lg: b, xl: j, xxl: R, xxxl: S };
42
- return Object.keys(v).forEach((n) => {
43
- const t = v[n];
44
- H(t) ? t >= 0 && (o[`${r}-${n}-${t}`] = !0) : T(t) && (o[`${r}-${n}-${t.span}`] = t.span, o[`${r}-${n}-offset-${t.offset}`] = t.offset, o[`${r}-${n}-order-${t.order}`] = t.order, o[`${r}-${n}-pull-${t.pull}`] = t.pull, o[`${r}-${n}-push-${t.push}`] = t.push);
32
+ md: x,
33
+ lg: y,
34
+ xl: h,
35
+ xxl: P,
36
+ xxxl: b,
37
+ flex: f,
38
+ ...V
39
+ } = G;
40
+ function k(r, o) {
41
+ const j = { xs: m, sm: g, md: x, lg: y, xl: h, xxl: P, xxxl: b };
42
+ return Object.keys(j).forEach((s) => {
43
+ const t = j[s];
44
+ F(t) ? t >= 0 && (o[`${r}-${s}-${t}`] = !0) : H(t) && (o[`${r}-${s}-${t.span}`] = t.span, o[`${r}-${s}-offset-${t.offset}`] = t.offset, o[`${r}-${s}-order-${t.order}`] = t.order, o[`${r}-${s}-pull-${t.pull}`] = t.pull, o[`${r}-${s}-push-${t.push}`] = t.push);
45
45
  }), o;
46
46
  }
47
- const s = l == null ? void 0 : l("col");
48
- let a = {
49
- [`${s}`]: !e,
50
- [`${s}-order-${c}`]: c,
51
- [`${s}-${V}`]: !e && !y && !g && !h && !b && !j && !R && !S,
52
- [`${s}-offset-${u}`]: u,
53
- [`${s}-pull-${m}`]: m,
54
- [`${s}-push-${x}`]: x,
55
- [`${s}-rtl`]: L
47
+ const n = w?.("col");
48
+ let $ = {
49
+ [`${n}`]: !l,
50
+ [`${n}-order-${a}`]: a,
51
+ [`${n}-${O}`]: !l && !m && !g && !x && !y && !h && !P && !b,
52
+ [`${n}-offset-${d}`]: d,
53
+ [`${n}-pull-${u}`]: u,
54
+ [`${n}-push-${c}`]: c,
55
+ [`${n}-rtl`]: C
56
56
  };
57
- a = z(s, a);
58
- const B = J(d ? s : a, N), $ = {};
59
- if (Array.isArray(p) && !e) {
57
+ $ = k(n, $);
58
+ const z = I(f ? n : $, L), e = {};
59
+ if (Array.isArray(p) && !l) {
60
60
  const r = p[0] && p[0] / 2 || 0, o = p[1] && p[1] / 2 || 0;
61
- r && ($.paddingLeft = r, $.paddingRight = r), o && ($.paddingTop = o, $.paddingBottom = o);
61
+ r && (e.paddingLeft = r, e.paddingRight = r), o && (e.paddingTop = o, e.paddingBottom = o);
62
62
  }
63
- const E = D(
64
- () => A(d) ? { flex: A(d) } : {},
65
- [d]
63
+ const B = q(
64
+ () => S(f) ? { flex: S(f) } : {},
65
+ [f]
66
66
  );
67
- return /* @__PURE__ */ F(
67
+ return /* @__PURE__ */ E(
68
68
  "div",
69
69
  {
70
- ref: G,
71
- ...k,
70
+ ref: v,
71
+ ...V,
72
72
  style: {
73
- ...O,
74
- ...$,
75
- ...E
73
+ ...M,
74
+ ...e,
75
+ ...B
76
76
  },
77
- className: B,
78
- children: P
77
+ className: z,
78
+ children: N
79
79
  }
80
80
  );
81
81
  }
82
- const X = q(W);
83
- X.displayName = "Col";
82
+ const W = T(U);
83
+ W.displayName = "Col";
84
84
  export {
85
- X as default
85
+ W as default
86
86
  };
package/grid/Grid.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import P from "lodash/get";
3
- import u, { forwardRef as h, useState as S, useContext as E } from "react";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import L from "lodash/get";
3
+ import d, { forwardRef as h, useState as S, useContext as E } from "react";
4
4
  import "../config-provider/ConfigProvider.js";
5
5
  import T from "../components/common/hooks/useMergeProps.js";
6
6
  import b from "@unicom-cloud/utils/class-name";
7
7
  import { GridDataCollectorContext as j, GridContext as B } from "./context.js";
8
- import { useResponsiveState as i } from "./hook/useResponsiveState.js";
8
+ import { useResponsiveState as l } from "./hook/useResponsiveState.js";
9
9
  import { setItemVisible as Q } from "./util.js";
10
10
  import V from "../config-provider/context.js";
11
11
  const k = {
@@ -15,80 +15,80 @@ const k = {
15
15
  colGap: 0,
16
16
  rowGap: 0
17
17
  };
18
- function q(G, x) {
19
- const [e, n] = S(
18
+ function q(f, u) {
19
+ const [t, p] = S(
20
20
  /* @__PURE__ */ new Map()
21
- ), { getPrefixCls: r, componentConfig: s, rtl: w } = E(V), C = T(
22
- G,
21
+ ), { getPrefixCls: x, componentConfig: G, rtl: C } = E(V), w = T(
22
+ f,
23
23
  k,
24
- s == null ? void 0 : s.Grid
24
+ G?.Grid
25
25
  ), {
26
- children: I,
27
- className: D,
28
- style: _,
29
- cols: v,
30
- colGap: g,
26
+ children: g,
27
+ className: I,
28
+ style: D,
29
+ cols: _,
30
+ colGap: v,
31
31
  rowGap: y,
32
- collapsed: m,
32
+ collapsed: n,
33
33
  collapsedRows: M
34
- } = C, a = i(v, 24), c = i(g, 0), N = {
35
- gap: `${i(y, 0)}px ${c}px`,
36
- gridTemplateColumns: `repeat(${a}, minmax(0px, 1fr))`
37
- }, d = r == null ? void 0 : r("grid"), R = {
38
- [`${d}`]: !0,
39
- [`${d}-rtl`]: w
40
- }, $ = b(R, D), L = (() => {
41
- const t = [];
42
- for (const [o, l] of e.entries())
43
- t[o] = l;
44
- return t;
45
- })(), f = Q({
46
- cols: a,
47
- collapsed: m,
34
+ } = w, r = l(_, 24), i = l(v, 0), N = {
35
+ gap: `${l(y, 0)}px ${i}px`,
36
+ gridTemplateColumns: `repeat(${r}, minmax(0px, 1fr))`
37
+ }, m = x?.("grid"), P = {
38
+ [`${m}`]: !0,
39
+ [`${m}-rtl`]: C
40
+ }, R = b(P, I), $ = (() => {
41
+ const e = [];
42
+ for (const [o, s] of t.entries())
43
+ e[o] = s;
44
+ return e;
45
+ })(), c = Q({
46
+ cols: r,
47
+ collapsed: n,
48
48
  collapsedRows: M,
49
- itemDataList: L
49
+ itemDataList: $
50
50
  });
51
- return /* @__PURE__ */ p(
51
+ return /* @__PURE__ */ a(
52
52
  "div",
53
53
  {
54
- ref: x,
55
- className: $,
54
+ ref: u,
55
+ className: R,
56
56
  style: {
57
57
  ...N,
58
- ..._
58
+ ...D
59
59
  },
60
- children: /* @__PURE__ */ p(
60
+ children: /* @__PURE__ */ a(
61
61
  j.Provider,
62
62
  {
63
63
  value: {
64
- collectItemData(t, o) {
65
- e.set(t, o), n(new Map([...e]));
64
+ collectItemData(e, o) {
65
+ t.set(e, o), p(new Map([...t]));
66
66
  },
67
- removeItemData(t) {
68
- e.delete(t), n(new Map([...e]));
67
+ removeItemData(e) {
68
+ t.delete(e), p(new Map([...t]));
69
69
  }
70
70
  },
71
- children: /* @__PURE__ */ p(
71
+ children: /* @__PURE__ */ a(
72
72
  B.Provider,
73
73
  {
74
74
  value: {
75
- cols: a,
76
- colGap: c,
77
- collapsed: m,
78
- overflow: f.overflow,
79
- displayIndexList: f.displayIndexList
75
+ cols: r,
76
+ colGap: i,
77
+ collapsed: n,
78
+ overflow: c.overflow,
79
+ displayIndexList: c.displayIndexList
80
80
  },
81
- children: u.Children.map(I, (t, o) => {
82
- if (t) {
83
- const l = {
81
+ children: d.Children.map(g, (e, o) => {
82
+ if (e) {
83
+ const s = {
84
84
  __index__: o,
85
- ...t.props
85
+ ...e.props
86
86
  };
87
- return u.cloneElement(t, l);
87
+ return d.cloneElement(e, s);
88
88
  }
89
89
  return null;
90
90
  }).filter(
91
- (t) => P(t, "type.__PQB_GRID_ITEM__")
91
+ (e) => L(e, "type.__PQB_GRID_ITEM__")
92
92
  )
93
93
  }
94
94
  )
package/grid/GridItem.js CHANGED
@@ -1,76 +1,76 @@
1
- import { jsx as Q } from "react/jsx-runtime";
2
- import T from "lodash/isFunction";
3
- import V from "lodash/isString";
4
- import l, { forwardRef as k, useContext as u, useMemo as d, useEffect as q } from "react";
1
+ import { jsx as O } from "react/jsx-runtime";
2
+ import Q from "lodash/isFunction";
3
+ import T from "lodash/isString";
4
+ import m, { forwardRef as V, useContext as p, useMemo as c, useEffect as k } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
6
- import z from "../components/common/hooks/useMergeProps.js";
7
- import A from "@unicom-cloud/utils/class-name";
8
- import { GridContext as H, GridDataCollectorContext as J } from "./context.js";
9
- import { useResponsiveState as G } from "./hook/useResponsiveState.js";
10
- import { resolveItemData as K } from "./util.js";
11
- import L from "../config-provider/context.js";
6
+ import q from "../components/common/hooks/useMergeProps.js";
7
+ import z from "@unicom-cloud/utils/class-name";
8
+ import { GridContext as A, GridDataCollectorContext as H } from "./context.js";
9
+ import { useResponsiveState as C } from "./hook/useResponsiveState.js";
10
+ import { resolveItemData as J } from "./util.js";
11
+ import K from "../config-provider/context.js";
12
12
  const U = {
13
13
  suffix: !1,
14
14
  offset: 0,
15
15
  span: 1
16
16
  };
17
- function W(S, g) {
18
- const { getPrefixCls: a, componentConfig: m, rtl: v } = u(L), f = z(
19
- S,
17
+ function W($, g) {
18
+ const { getPrefixCls: G, componentConfig: _, rtl: y } = p(K), i = q(
19
+ $,
20
20
  U,
21
- m == null ? void 0 : m["Grid.GridItem"]
21
+ _?.["Grid.GridItem"]
22
22
  ), {
23
- children: i,
24
- className: y,
25
- style: N,
26
- offset: D,
27
- span: R,
23
+ children: a,
24
+ className: S,
25
+ style: v,
26
+ offset: N,
27
+ span: D,
28
28
  __index__: s
29
- } = f, r = u(H), { collectItemData: E, removeItemData: w } = u(
30
- J
31
- ), { colGap: p, cols: x, displayIndexList: c, overflow: $ } = r, I = G(D, 0), n = G(R, 1), C = a == null ? void 0 : a("grid-item"), M = c == null ? void 0 : c.includes(s), b = {
32
- [`${C}`]: !0,
33
- [`${C}-rtl`]: v
34
- }, F = A(b, y), e = d(() => K(r.cols, {
35
- suffix: !!f.suffix,
29
+ } = i, r = p(A), { collectItemData: R, removeItemData: E } = p(
30
+ H
31
+ ), { colGap: f, cols: l, displayIndexList: P, overflow: u } = r, d = C(N, 0), n = C(D, 1), x = G?.("grid-item"), w = P?.includes(s), M = {
32
+ [`${x}`]: !0,
33
+ [`${x}-rtl`]: y
34
+ }, b = z(M, S), e = c(() => J(r.cols, {
35
+ suffix: !!i.suffix,
36
36
  span: n,
37
- offset: I
38
- }), [r.cols, f.suffix, n, I]);
39
- q(() => (E(s, e), () => {
40
- w(s);
37
+ offset: d
38
+ }), [r.cols, i.suffix, n, d]);
39
+ k(() => (R(s, e), () => {
40
+ E(s);
41
41
  }), [s, e]);
42
- const P = d(() => {
42
+ const F = c(() => {
43
43
  const { offset: t, span: o } = e;
44
44
  return t > 0 ? {
45
- marginLeft: `calc((${`(100% - ${p * (o - 1)}px) / ${o}`} * ${t}) + ${p * t}px)`
45
+ marginLeft: `calc((${`(100% - ${f * (o - 1)}px) / ${o}`} * ${t}) + ${f * t}px)`
46
46
  } : {};
47
- }, [e, p]), j = d(() => {
47
+ }, [e, f]), L = c(() => {
48
48
  const { suffix: t, span: o } = e;
49
- return t ? `${x - o + 1}` : `span ${o}`;
50
- }, [e, x]), B = !M || n === 0 ? { display: "none" } : {}, O = {
51
- gridColumn: `${j} / span ${n}`,
52
- ...P,
53
- ...B
49
+ return t ? `${l - o + 1}` : `span ${o}`;
50
+ }, [e, l]), j = !w || n === 0 ? { display: "none" } : {}, B = {
51
+ gridColumn: `${L} / span ${n}`,
52
+ ...F,
53
+ ...j
54
54
  };
55
- return /* @__PURE__ */ Q(
55
+ return /* @__PURE__ */ O(
56
56
  "div",
57
57
  {
58
58
  ref: g,
59
- className: F,
59
+ className: b,
60
60
  style: {
61
- ...O,
62
- ...N
61
+ ...B,
62
+ ...v
63
63
  },
64
- children: T(i) ? i({ overflow: $ }) : l.Children.map(i, (t) => t && r.collapsed && l.isValidElement(t) && !V(t.type) ? l.cloneElement(t, {
65
- overflow: $,
64
+ children: Q(a) ? a({ overflow: u }) : m.Children.map(a, (t) => t && r.collapsed && m.isValidElement(t) && !T(t.type) ? m.cloneElement(t, {
65
+ overflow: u,
66
66
  ...t.props
67
67
  }) : t)
68
68
  }
69
69
  );
70
70
  }
71
- const X = k(W), _ = X;
72
- _.displayName = "GridItem";
73
- _.__PQB_GRID_ITEM__ = !0;
71
+ const X = V(W), I = X;
72
+ I.displayName = "GridItem";
73
+ I.__PQB_GRID_ITEM__ = !0;
74
74
  export {
75
- _ as default
75
+ I as default
76
76
  };
package/grid/Row.js CHANGED
@@ -1,10 +1,10 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { forwardRef as z, useContext as G, useState as H, useRef as P, useEffect as V } from "react";
1
+ import { jsx as g } from "react/jsx-runtime";
2
+ import { forwardRef as S, useContext as z, useState as G, useRef as H, useEffect as V } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
4
  import B from "../components/common/hooks/useMergeProps.js";
5
5
  import E from "@unicom-cloud/utils/class-name";
6
6
  import { omit as L } from "../components/common/utils/omit.js";
7
- import { responsiveObserve as x, responsiveArray as b } from "../utils/responsiveObserve.js";
7
+ import { responsiveObserve as y, responsiveArray as x } from "../utils/responsiveObserve.js";
8
8
  import { RowContext as M } from "./context.js";
9
9
  import O from "../config-provider/context.js";
10
10
  const T = {
@@ -12,12 +12,12 @@ const T = {
12
12
  align: "start",
13
13
  justify: "start"
14
14
  };
15
- function q(A, j) {
16
- const { getPrefixCls: i, componentConfig: n, rtl: v } = G(O), R = B(
17
- A,
15
+ function q(d, b) {
16
+ const { getPrefixCls: A, componentConfig: j, rtl: v } = z(O), C = B(
17
+ d,
18
18
  T,
19
- n == null ? void 0 : n["Grid.Row"]
20
- ), { className: w, style: $, children: N, div: a, align: l, justify: p, gutter: r, ...h } = R, [C, k] = H({
19
+ j?.["Grid.Row"]
20
+ ), { className: R, style: w, children: $, div: i, align: m, justify: l, gutter: t, ...N } = C, [h, P] = G({
21
21
  xs: !0,
22
22
  sm: !0,
23
23
  md: !0,
@@ -25,62 +25,62 @@ function q(A, j) {
25
25
  xl: !0,
26
26
  xxl: !0,
27
27
  xxxl: !0
28
- }), y = P();
29
- V(() => (y.current = x.subscribe((t) => {
30
- (!Array.isArray(r) && typeof r == "object" || Array.isArray(r) && (typeof r[0] == "object" || typeof r[1] == "object")) && k(t);
28
+ }), u = H();
29
+ V(() => (u.current = y.subscribe((r) => {
30
+ (!Array.isArray(t) && typeof t == "object" || Array.isArray(t) && (typeof t[0] == "object" || typeof t[1] == "object")) && P(r);
31
31
  }), () => {
32
- x.unsubscribe(y.current);
32
+ y.unsubscribe(u.current);
33
33
  }), []);
34
- function g(t) {
34
+ function p(r) {
35
35
  let e = 0;
36
- if (typeof t == "object")
37
- for (let u = 0; u < b.length; u++) {
38
- const f = b[u];
39
- if (C[f] && t[f] !== void 0) {
40
- e = t[f];
36
+ if (typeof r == "object")
37
+ for (let c = 0; c < x.length; c++) {
38
+ const f = x[c];
39
+ if (h[f] && r[f] !== void 0) {
40
+ e = r[f];
41
41
  break;
42
42
  }
43
43
  }
44
44
  else
45
- e = t;
45
+ e = r;
46
46
  return e;
47
47
  }
48
- const s = i == null ? void 0 : i("row"), S = E(
48
+ const s = A?.("row"), k = E(
49
49
  {
50
- [`${s}`]: !a,
51
- [`${s}-align-${l}`]: l,
52
- [`${s}-justify-${p}`]: p,
50
+ [`${s}`]: !i,
51
+ [`${s}-align-${m}`]: m,
52
+ [`${s}-justify-${l}`]: l,
53
53
  [`${s}-rtl`]: v
54
54
  },
55
- w
56
- ), o = {}, c = g(
57
- Array.isArray(r) ? r[0] : r
58
- ), m = g(Array.isArray(r) ? r[1] : 0);
59
- if ((c || m) && !a) {
60
- const t = -c / 2, e = -m / 2;
61
- t && (o.marginLeft = t, o.marginRight = t), e && (o.marginTop = e, o.marginBottom = e);
55
+ R
56
+ ), o = {}, n = p(
57
+ Array.isArray(t) ? t[0] : t
58
+ ), a = p(Array.isArray(t) ? t[1] : 0);
59
+ if ((n || a) && !i) {
60
+ const r = -n / 2, e = -a / 2;
61
+ r && (o.marginLeft = r, o.marginRight = r), e && (o.marginTop = e, o.marginBottom = e);
62
62
  }
63
- return /* @__PURE__ */ d(
63
+ return /* @__PURE__ */ g(
64
64
  "div",
65
65
  {
66
- ref: j,
67
- ...L(h, ["gutter"]),
66
+ ref: b,
67
+ ...L(N, ["gutter"]),
68
68
  style: {
69
- ...$,
69
+ ...w,
70
70
  ...o
71
71
  },
72
- className: S,
73
- children: /* @__PURE__ */ d(
72
+ className: k,
73
+ children: /* @__PURE__ */ g(
74
74
  M.Provider,
75
75
  {
76
- value: { gutter: [c, m], div: a },
77
- children: N
76
+ value: { gutter: [n, a], div: i },
77
+ children: $
78
78
  }
79
79
  )
80
80
  }
81
81
  );
82
82
  }
83
- const D = z(q);
83
+ const D = S(q);
84
84
  D.displayName = "Row";
85
85
  export {
86
86
  D as default