@unicom-cloud/ui 0.8.100 → 0.8.102

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 (301) hide show
  1. package/Badge.js +7 -54
  2. package/Copy.js +5 -4
  3. package/Details.js +13 -2
  4. package/Divider.js +3 -2
  5. package/Flex.js +14 -4
  6. package/LiquidFill.js +5 -4
  7. package/List.js +1 -1
  8. package/Loading.js +16 -3
  9. package/Marquee.js +5 -4
  10. package/QrCode.js +5 -4
  11. package/Space.js +3 -3
  12. package/Splitter.js +4 -3
  13. package/SuspenseFallbackTest.js +2 -4
  14. package/Tooltip.js +3 -4
  15. package/Tour.js +5 -4
  16. package/alert/index.js +60 -62
  17. package/anchor/Anchor.js +12 -12
  18. package/anchor/util.js +10 -10
  19. package/back-top/index.js +33 -34
  20. package/badge/index.js +109 -162
  21. package/calendar/index.js +85 -84
  22. package/card/index.js +63 -43
  23. package/color-picker/InputHex.js +3 -4
  24. package/color-picker/InputRgb.js +7 -8
  25. package/color-picker/Palette.js +3 -4
  26. package/color-picker/Panel.js +3 -4
  27. package/color-picker/colors.js +5 -5
  28. package/color-picker/hooks/useColorPicker.js +3 -4
  29. package/color-picker/utils.js +14 -15
  30. package/components/common/development/index.js +44 -29
  31. package/components/common/empty/index.js +35 -23
  32. package/components/common/flex/index.js +64 -0
  33. package/components/common/flex/interface.js +9 -0
  34. package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
  35. package/components/common/space/index.js +71 -91
  36. package/components/common/suspense-fallback-test/index.js +16 -0
  37. package/components/common/utils/PqbCSSTransition.js +1 -1
  38. package/components/common/utils/constant.js +6 -3
  39. package/components/common/utils/reactDOM.js +6 -4
  40. package/components/common/utils/{scrollIntoView.js → scrollIntoViewIfNeeded.js} +1 -1
  41. package/components/common/utils/setPrimaryColor.js +18 -18
  42. package/components/common/utils/setTheme.js +8 -9
  43. package/components/common/utils/toArray.js +12 -0
  44. package/copy/index.js +3 -2
  45. package/details/index.js +102 -62
  46. package/dist/scroll-into-view-if-needed/compute/index.js +126 -0
  47. package/dist/scroll-into-view-if-needed/smooth/index.js +70 -0
  48. package/dist/scroll-into-view-if-needed/src/index.js +19 -19
  49. package/divider/index.js +27 -21
  50. package/empty/index.js +13 -13
  51. package/flex/index.js +43 -55
  52. package/flex/interface.js +1 -34
  53. package/form/FormItem.js +69 -65
  54. package/form/context.js +6 -7
  55. package/grid/Col-.js +86 -0
  56. package/grid/Col.js +156 -73
  57. package/grid/Grid.js +71 -67
  58. package/grid/Row.js +3 -3
  59. package/grid/index.js +13 -13
  60. package/icon/interface.js +1 -0
  61. package/icon-hover/interface.js +1 -0
  62. package/index.js +641 -663
  63. package/input/Textarea.js +1 -1
  64. package/input/autoSizeTextAreaHeight.js +7 -7
  65. package/liquid-fill/index.js +5 -4
  66. package/list/index.js +1 -1
  67. package/loading/index.js +72 -53
  68. package/loading/interface.js +1 -0
  69. package/marquee/index.js +5 -4
  70. package/menu/Item.js +9 -9
  71. package/modal/Modal.js +73 -74
  72. package/package.json +1 -1
  73. package/portal/interface.js +1 -0
  74. package/qr-code/index.js +5 -4
  75. package/segmented/index.js +47 -47
  76. package/space/index.js +41 -35
  77. package/speech-synthesis/interface.js +1 -0
  78. package/splitter/SplitBar.js +81 -79
  79. package/splitter/Splitter.js +92 -104
  80. package/splitter/hooks/useItems.js +1 -1
  81. package/splitter/hooks/useResizable.js +9 -18
  82. package/splitter/hooks/useResize.js +10 -10
  83. package/splitter/hooks/useSizes.js +28 -28
  84. package/splitter/index.js +5 -4
  85. package/statistic/index.js +10 -10
  86. package/style.css +1 -1
  87. package/suspense-fallback-test/index.js +2 -11
  88. package/suspense-fallback-test/interface.js +1 -0
  89. package/table/Table.js +376 -377
  90. package/table/hook/useThResizable.js +5 -4
  91. package/table/th-resizable/index.js +12 -11
  92. package/time-picker/util.js +8 -8
  93. package/tooltip/index.js +1 -2
  94. package/tour/index.js +5 -4
  95. package/tree/NodeList.js +1 -1
  96. package/trigger/index.js +67 -70
  97. package/types/common/development/index.d.ts +7 -1
  98. package/types/common/development/interface.d.ts +22 -0
  99. package/types/common/empty/index.d.ts +2 -1
  100. package/types/common/flex/index.d.ts +14 -0
  101. package/types/common/flex/interface.d.ts +62 -0
  102. package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
  103. package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
  104. package/types/common/space/index.d.ts +4 -4
  105. package/types/common/space/interface.d.ts +10 -18
  106. package/types/common/suspense-fallback-test/index.d.ts +7 -0
  107. package/types/common/suspense-fallback-test/interface.d.ts +1 -0
  108. package/types/common/utils/PqbCSSTransition.d.ts +1 -1
  109. package/types/common/utils/constant.d.ts +1 -0
  110. package/types/common/utils/scrollIntoViewIfNeeded.d.ts +4 -0
  111. package/types/common/utils/toArray.d.ts +13 -0
  112. package/types/common/utils/tree.d.ts +1 -0
  113. package/types/common/utils/tween.d.ts +1 -0
  114. package/types/pc/alert/index.d.ts +2 -1
  115. package/types/pc/alert/interface.d.ts +7 -1
  116. package/types/pc/anchor/util.d.ts +1 -1
  117. package/types/pc/badge/Count.d.ts +1 -1
  118. package/types/pc/badge/interface.d.ts +2 -0
  119. package/types/pc/breadcrumb/Item.d.ts +1 -1
  120. package/types/pc/calendar/Month.d.ts +1 -1
  121. package/types/pc/calendar/WeekList.d.ts +1 -1
  122. package/types/pc/calendar/Year.d.ts +1 -1
  123. package/types/pc/calendar/header/Panel.d.ts +1 -1
  124. package/types/pc/calendar/header/index.d.ts +1 -1
  125. package/types/pc/calendar/index.d.ts +1 -1
  126. package/types/pc/calendar/interface.d.ts +2 -1
  127. package/types/pc/card/interface.d.ts +8 -0
  128. package/types/pc/cascader/interface.d.ts +1 -1
  129. package/types/pc/cascader/panel/List.d.ts +1 -1
  130. package/types/pc/cascader/panel/Option.d.ts +1 -1
  131. package/types/pc/cascader/panel/Search.d.ts +1 -1
  132. package/types/pc/checkbox/Group.d.ts +2 -2
  133. package/types/pc/checkbox/GroupBlock.d.ts +1 -1
  134. package/types/pc/checkbox/IconCheck.d.ts +1 -1
  135. package/types/pc/color-picker/InputRgb.d.ts +1 -1
  136. package/types/pc/color-picker/Palette.d.ts +1 -1
  137. package/types/pc/color-picker/hooks/useColorPicker.d.ts +7 -2
  138. package/types/pc/color-picker/utils.d.ts +6 -1
  139. package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
  140. package/types/pc/config-provider/interface.d.ts +4 -0
  141. package/types/pc/copy/index.d.ts +1 -1
  142. package/types/pc/date-picker/panel/Body.d.ts +1 -1
  143. package/types/pc/date-picker/panel/Footer.d.ts +1 -1
  144. package/types/pc/date-picker/panel/Header.d.ts +1 -1
  145. package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
  146. package/types/pc/date-picker/panel/date/index.d.ts +1 -1
  147. package/types/pc/date-picker/panel/month/index.d.ts +1 -1
  148. package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
  149. package/types/pc/date-picker/panel/range/index.d.ts +1 -1
  150. package/types/pc/date-picker/panel/week/index.d.ts +1 -1
  151. package/types/pc/date-picker/panel/year/index.d.ts +1 -1
  152. package/types/pc/descriptions/index.d.ts +1 -1
  153. package/types/pc/details/index.d.ts +3 -2
  154. package/types/pc/details/interface.d.ts +16 -0
  155. package/types/pc/development/index.d.ts +2 -1
  156. package/types/pc/development/interface.d.ts +15 -0
  157. package/types/pc/divider/index.d.ts +7 -2
  158. package/types/pc/draggable/Item.d.ts +1 -1
  159. package/types/pc/draggable/index.d.ts +1 -1
  160. package/types/pc/flex/index.d.ts +4 -4
  161. package/types/pc/flex/interface.d.ts +8 -53
  162. package/types/pc/form/Control.d.ts +1 -1
  163. package/types/pc/form/FormItem.d.ts +1 -1
  164. package/types/pc/form/FormList.d.ts +1 -1
  165. package/types/pc/form/IconSymbol.d.ts +1 -1
  166. package/types/pc/grid/Col-.d.ts +4 -0
  167. package/types/pc/grid/Col.d.ts +3 -2
  168. package/types/pc/grid/Grid.d.ts +2 -2
  169. package/types/pc/grid/Item.d.ts +3 -3
  170. package/types/pc/grid/Row.d.ts +2 -2
  171. package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
  172. package/types/pc/grid/interface.d.ts +13 -7
  173. package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
  174. package/types/pc/icon/index.d.ts +2 -7
  175. package/types/pc/icon/interface.d.ts +13 -0
  176. package/types/pc/icon-hover/index.d.ts +2 -8
  177. package/types/pc/icon-hover/interface.d.ts +8 -0
  178. package/types/pc/image/ImageFooter.d.ts +1 -1
  179. package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
  180. package/types/pc/image/TriggerForToolbar.d.ts +1 -1
  181. package/types/pc/index.d.ts +60 -51
  182. package/types/pc/loading/index.d.ts +4 -3
  183. package/types/pc/loading/interface.d.ts +6 -0
  184. package/types/pc/menu/Indent.d.ts +1 -1
  185. package/types/pc/menu/OverflowWrap.d.ts +1 -1
  186. package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
  187. package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
  188. package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
  189. package/types/pc/overflow-ellipsis/index.d.ts +1 -1
  190. package/types/pc/pagination/PageItem.d.ts +3 -3
  191. package/types/pc/pagination/PageJumper.d.ts +1 -1
  192. package/types/pc/pagination/PageOption.d.ts +1 -1
  193. package/types/pc/portal/Portal.d.ts +2 -6
  194. package/types/pc/portal/index.d.ts +2 -9
  195. package/types/pc/portal/interface.d.ts +14 -0
  196. package/types/pc/progress/CircleProgress.d.ts +1 -1
  197. package/types/pc/progress/LineProgess.d.ts +1 -1
  198. package/types/pc/progress/StepProgress.d.ts +1 -1
  199. package/types/pc/radio/Group.d.ts +2 -2
  200. package/types/pc/radio/GroupBlock.d.ts +1 -1
  201. package/types/pc/radio/Radio.d.ts +1 -1
  202. package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
  203. package/types/pc/result/403.d.ts +1 -1
  204. package/types/pc/result/404.d.ts +1 -1
  205. package/types/pc/result/500.d.ts +1 -1
  206. package/types/pc/segmented/interface.d.ts +6 -6
  207. package/types/pc/skeleton/Image.d.ts +1 -1
  208. package/types/pc/skeleton/Text.d.ts +2 -1
  209. package/types/pc/slider/Button.d.ts +1 -1
  210. package/types/pc/slider/Input.d.ts +1 -1
  211. package/types/pc/slider/Tick.d.ts +1 -1
  212. package/types/pc/space/index.d.ts +6 -5
  213. package/types/pc/speech-synthesis/index.d.ts +3 -1
  214. package/types/pc/speech-synthesis/interface.d.ts +7 -0
  215. package/types/pc/spin/DotLoading.d.ts +1 -1
  216. package/types/pc/splitter/SplitBar.d.ts +0 -1
  217. package/types/pc/splitter/hooks/useResizable.d.ts +0 -1
  218. package/types/pc/splitter/hooks/useResize.d.ts +1 -2
  219. package/types/pc/splitter/index.d.ts +5 -4
  220. package/types/pc/splitter/interface.d.ts +16 -24
  221. package/types/pc/suspense-fallback-test/index.d.ts +2 -3
  222. package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
  223. package/types/pc/table/ColGroup.d.ts +1 -1
  224. package/types/pc/table/summary/Cell.d.ts +1 -1
  225. package/types/pc/table/summary/Row.d.ts +1 -1
  226. package/types/pc/table/tbody/Td.d.ts +1 -1
  227. package/types/pc/table/tbody/index.d.ts +1 -1
  228. package/types/pc/table/tfoot/index.d.ts +1 -1
  229. package/types/pc/table/th-resizable/index.d.ts +1 -1
  230. package/types/pc/table/thead/Column.d.ts +1 -1
  231. package/types/pc/table/thead/index.d.ts +1 -1
  232. package/types/pc/tabs/TabContent.d.ts +1 -1
  233. package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
  234. package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
  235. package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
  236. package/types/pc/time-picker/Picker.d.ts +1 -1
  237. package/types/pc/time-picker/RangePicker.d.ts +1 -1
  238. package/types/pc/time-picker/TimeColumn.d.ts +1 -1
  239. package/types/pc/time-picker/TimePicker.d.ts +1 -1
  240. package/types/pc/time-picker/index.d.ts +1 -1
  241. package/types/pc/tour/index.d.ts +1 -1
  242. package/types/pc/transfer/Item.d.ts +1 -1
  243. package/types/pc/transfer/List.d.ts +1 -1
  244. package/types/pc/tree/Animation.d.ts +1 -1
  245. package/types/pc/typography/Operations.d.ts +1 -1
  246. package/types/pc/upload/interface.d.ts +1 -0
  247. package/types/pc/upload/list/index.d.ts +1 -1
  248. package/types/pc/utils/constant.d.ts +1 -2
  249. package/types/pc/utils/dayjs.d.ts +2 -1
  250. package/types/pc/utils/index.d.ts +2 -5
  251. package/types/pc/utils/scrollIntoViewIfNeeded.d.ts +3 -0
  252. package/types/pc/utils/toArray.d.ts +1 -5
  253. package/types/pc/utils/tree.d.ts +2 -1
  254. package/types/pc/utils/tween.d.ts +1 -1
  255. package/types/pc/verification-code/VerificationCode.d.ts +1 -1
  256. package/types/pc/virtual-list/VirtualList.d.ts +2 -38
  257. package/types/pc/virtual-list/index.d.ts +2 -1
  258. package/types/pc/virtual-list/interface.d.ts +56 -0
  259. package/types/pc/watermark/Watermark.d.ts +1 -1
  260. package/typography/Ellipsis.js +5 -4
  261. package/typography/Operations.js +5 -4
  262. package/upload/request.js +12 -13
  263. package/upload/request_.js +2 -3
  264. package/utils/constant.js +5 -5
  265. package/utils/dayjs.js +13 -12
  266. package/utils/index.js +261 -284
  267. package/utils/scrollIntoViewIfNeeded.js +12 -0
  268. package/utils/toArray.js +3 -10
  269. package/utils/tree.js +11 -9
  270. package/utils/tween.js +5 -5
  271. package/version/index.js +1 -1
  272. package/virtual-list/interface.js +1 -0
  273. package/components/common/space/toArray.js +0 -11
  274. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +0 -6
  275. package/dist/compute-scroll-into-view/src/index.js +0 -126
  276. package/dist/tinycolor/chunk/BOzCVdr0.js +0 -182
  277. package/dist/tinycolor/customize/index.js +0 -12
  278. package/dist/tinycolor/src/conversion.js +0 -143
  279. package/dist/tinycolor/src/css-color-names.js +0 -153
  280. package/dist/tinycolor/src/format-input.js +0 -77
  281. package/dist/tinycolor/src/index.js +0 -388
  282. package/dist/tinycolor/src/util.js +0 -32
  283. package/flex/utils.js +0 -13
  284. package/loading/style/index.module.less.js +0 -4
  285. package/types/common/space/toArray.d.ts +0 -3
  286. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
  287. package/types/common/utils/scrollIntoView.d.ts +0 -4
  288. package/types/common/utils/tinycolor.d.ts +0 -1
  289. package/types/pc/flex/utils.d.ts +0 -9
  290. package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
  291. package/types/pc/utils/color.d.ts +0 -1
  292. package/types/pc/utils/computeScrollIntoView.d.ts +0 -1
  293. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
  294. package/types/pc/utils/scrollIntoView.d.ts +0 -3
  295. package/types/pc/utils/tinycolor.d.ts +0 -1
  296. package/utils/color.js +0 -4
  297. package/utils/computeScrollIntoView.js +0 -6
  298. package/utils/convertToDurationBasedOnTimeUnits.js +0 -6
  299. package/utils/scrollIntoView.js +0 -6
  300. package/utils/tinycolor.js +0 -29
  301. /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
package/grid/Col.js CHANGED
@@ -1,86 +1,169 @@
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";
1
+ import { jsx as U } from "react/jsx-runtime";
2
+ import W from "lodash/isNil";
3
+ import M from "lodash/isNumber";
4
+ import B from "lodash/isPlainObject";
5
+ import { forwardRef as X, useContext as F, useState as Y, useMemo as b, useEffect as Z } from "react";
5
6
  import "../config-provider/ConfigProvider.js";
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 = {
7
+ import ee from "../components/common/hooks/useMergeProps.js";
8
+ import te from "@unicom-cloud/utils/class-name";
9
+ import { responsiveArray as y, responsiveObserve as z } from "../utils/responsiveObserve.js";
10
+ import { RowContext as re } from "./context.js";
11
+ import se from "../config-provider/context.js";
12
+ const oe = {
11
13
  span: 24
14
+ // 默认占据24列
12
15
  };
13
- function S(i) {
14
- return typeof i == "string" && /\d+[px|%|em|rem|]{1}/.test(i) ? `0 0 ${i}` : i;
16
+ function ne(i) {
17
+ return typeof i == "string" && /\d+[px|%|em|rem|]{1}/.test(i) ? { flex: `0 0 ${i}` } : { flex: i };
15
18
  }
16
- function U(i, v) {
17
- const { getPrefixCls: w, componentConfig: A, rtl: C } = R(K), G = D(
19
+ const ie = (i, E) => {
20
+ const { getPrefixCls: G, componentConfig: I, rtl: d } = F(se), T = ee(
18
21
  i,
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
- sm: g,
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
- }), o;
46
- }
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
- };
57
- $ = k(n, $);
58
- const z = I(f ? n : $, L), e = {};
59
- if (Array.isArray(p) && !l) {
60
- const r = p[0] && p[0] / 2 || 0, o = p[1] && p[1] / 2 || 0;
61
- r && (e.paddingLeft = r, e.paddingRight = r), o && (e.paddingTop = o, e.paddingBottom = o);
62
- }
63
- const B = q(
64
- () => S(f) ? { flex: S(f) } : {},
65
- [f]
66
- );
67
- return /* @__PURE__ */ E(
22
+ oe,
23
+ I?.["Grid.Col"]
24
+ ), { gutter: C, div: o } = F(re), {
25
+ className: V,
26
+ style: _,
27
+ children: q,
28
+ span: g = 24,
29
+ offset: p,
30
+ order: u,
31
+ pull: m,
32
+ push: $,
33
+ xs: v,
34
+ sm: k,
35
+ md: P,
36
+ lg: R,
37
+ xl: S,
38
+ xxl: w,
39
+ xxxl: O,
40
+ flex: j,
41
+ ...D
42
+ } = T, f = !W(j), s = G?.("col"), [A, H] = Y({
43
+ xs: !1,
44
+ sm: !1,
45
+ md: !1,
46
+ lg: !1,
47
+ xl: !1,
48
+ xxl: !1,
49
+ xxxl: !1
50
+ }), l = b(() => ({ xs: v, sm: k, md: P, lg: R, xl: S, xxl: w, xxxl: O }), [R, P, k, S, v, w, O]), J = b(() => {
51
+ if (f)
52
+ return;
53
+ const e = {
54
+ [`${s}`]: !o,
55
+ [`${s}-order-${u}`]: u,
56
+ [`${s}-${g}`]: !o && Object.values(l).every((r) => !r),
57
+ [`${s}-offset-${p}`]: p,
58
+ [`${s}-pull-${m}`]: m,
59
+ [`${s}-push-${$}`]: $,
60
+ [`${s}-rtl`]: d
61
+ };
62
+ for (const r in l) {
63
+ const t = l[r];
64
+ M(t) ? t >= 0 && (e[`${s}-${r}-${t}`] = !0) : B(t) && (e[`${s}-${r}-${t.span}`] = t.span, e[`${s}-${r}-offset-${t.offset}`] = t.offset, e[`${s}-${r}-order-${t.order}`] = t.order, e[`${s}-${r}-pull-${t.pull}`] = t.pull, e[`${s}-${r}-push-${t.push}`] = t.push);
65
+ }
66
+ return e;
67
+ }, [
68
+ f,
69
+ s,
70
+ o,
71
+ u,
72
+ g,
73
+ l,
74
+ p,
75
+ m,
76
+ $,
77
+ d
78
+ ]), x = (e) => `${100 / 24 * e}%`, K = b(() => {
79
+ if (o || f)
80
+ return;
81
+ const e = {
82
+ span: g,
83
+ offset: p,
84
+ order: u,
85
+ pull: m,
86
+ push: $
87
+ }, r = y.find((a) => A[a]);
88
+ if (r) {
89
+ const a = y.indexOf(r);
90
+ for (let c = a; c < y.length; c++) {
91
+ const h = y[c], n = l[h];
92
+ if (n !== void 0) {
93
+ if (B(n)) {
94
+ Object.assign(e, n);
95
+ break;
96
+ }
97
+ if (M(n)) {
98
+ Object.assign(e, { span: n });
99
+ break;
100
+ }
101
+ }
102
+ }
103
+ }
104
+ const t = {}, L = x(e.span);
105
+ t.width = L, t.flex = `0 0 ${L}`;
106
+ const N = (a, c, h) => {
107
+ if (d) {
108
+ const n = {
109
+ left: "right",
110
+ right: "left",
111
+ marginLeft: "marginRight",
112
+ marginRight: "marginLeft"
113
+ };
114
+ a[n[c]] = h;
115
+ } else
116
+ a[c] = h;
117
+ };
118
+ return e.offset && N(
119
+ t,
120
+ "marginLeft",
121
+ x(e.offset)
122
+ ), e.order && (t.order = e.order), e.pull && N(t, "right", x(e.pull)), e.push && N(t, "left", x(e.push)), t;
123
+ }, [
124
+ o,
125
+ f,
126
+ g,
127
+ p,
128
+ u,
129
+ m,
130
+ $,
131
+ A,
132
+ l,
133
+ d
134
+ ]), Q = b(() => {
135
+ if (o)
136
+ return;
137
+ const e = {};
138
+ if (Array.isArray(C)) {
139
+ const [r, t] = C;
140
+ r && (e.paddingLeft = r / 2, e.paddingRight = r / 2), t && (e.paddingTop = t / 2, e.paddingBottom = t / 2);
141
+ }
142
+ return e;
143
+ }, [C, o]);
144
+ return Z(() => {
145
+ const e = z.subscribe((r) => {
146
+ H(r);
147
+ });
148
+ return () => {
149
+ z.unsubscribe(e);
150
+ };
151
+ }, []), /* @__PURE__ */ U(
68
152
  "div",
69
153
  {
70
- ref: v,
71
- ...V,
154
+ ref: E,
155
+ ...D,
72
156
  style: {
73
- ...M,
74
- ...e,
75
- ...B
157
+ ...f ? ne(j) : K,
158
+ ...Q,
159
+ ..._
76
160
  },
77
- className: z,
78
- children: N
161
+ className: te(f ? s : J, V),
162
+ children: q
79
163
  }
80
164
  );
81
- }
82
- const W = T(U);
83
- W.displayName = "Col";
165
+ }, fe = X(ie);
166
+ fe.displayName = "Col";
84
167
  export {
85
- W as default
168
+ fe as default
86
169
  };
package/grid/Grid.js CHANGED
@@ -1,95 +1,99 @@
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";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import A from "lodash/get";
3
+ import B from "lodash/isArray";
4
+ import n from "lodash/isNil";
5
+ import g, { forwardRef as Q, useState as V, useContext as k } from "react";
4
6
  import "../config-provider/ConfigProvider.js";
5
- import T from "../components/common/hooks/useMergeProps.js";
6
- import b from "@unicom-cloud/utils/class-name";
7
- import { GridDataCollectorContext as j, GridContext as B } from "./context.js";
8
- import { useResponsiveState as l } from "./hook/useResponsiveState.js";
9
- import { setItemVisible as Q } from "./util.js";
10
- import V from "../config-provider/context.js";
11
- const k = {
7
+ import q from "../components/common/hooks/useMergeProps.js";
8
+ import z from "@unicom-cloud/utils/class-name";
9
+ import { GridDataCollectorContext as F, GridContext as H } from "./context.js";
10
+ import { useResponsiveState as m } from "./hook/useResponsiveState.js";
11
+ import { setItemVisible as J } from "./util.js";
12
+ import K from "../config-provider/context.js";
13
+ const O = {
12
14
  collapsed: !1,
13
15
  collapsedRows: 1,
14
16
  cols: 24,
15
- colGap: 0,
16
- rowGap: 0
17
+ gap: 0
17
18
  };
18
- function q(f, u) {
19
- const [t, p] = S(
19
+ function U(w, _) {
20
+ const [o, c] = V(
20
21
  /* @__PURE__ */ new Map()
21
- ), { getPrefixCls: x, componentConfig: G, rtl: C } = E(V), w = T(
22
- f,
23
- k,
24
- G?.Grid
22
+ ), { getPrefixCls: I, componentConfig: N, rtl: D } = k(K), v = q(
23
+ w,
24
+ O,
25
+ N?.Grid
25
26
  ), {
26
- children: g,
27
- className: I,
28
- style: D,
29
- cols: _,
30
- colGap: v,
31
- rowGap: y,
32
- collapsed: n,
33
- collapsedRows: 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), $ = (() => {
27
+ children: y,
28
+ className: R,
29
+ style: M,
30
+ cols: P,
31
+ gap: t,
32
+ colGap: f,
33
+ rowGap: d,
34
+ collapsed: G,
35
+ collapsedRows: $
36
+ } = v;
37
+ let r, a;
38
+ const L = n(t), h = n(d), S = n(f);
39
+ L || (B(t) ? (r = t[0], a = t[1] ?? t[0]) : r = a = t), h || (r = d), S || (a = f);
40
+ const l = m(P, 24), u = m(a, 0), E = {
41
+ gap: `${m(r, 0)}px ${u}px`,
42
+ gridTemplateColumns: `repeat(${l}, minmax(0px, 1fr))`
43
+ }, x = I?.("grid"), T = {
44
+ [`${x}`]: !0,
45
+ [`${x}-rtl`]: D
46
+ }, b = z(T, R), j = (() => {
41
47
  const e = [];
42
- for (const [o, s] of t.entries())
43
- e[o] = s;
48
+ for (const [s, p] of o.entries())
49
+ e[s] = p;
44
50
  return e;
45
- })(), c = Q({
46
- cols: r,
47
- collapsed: n,
48
- collapsedRows: M,
49
- itemDataList: $
51
+ })(), C = J({
52
+ cols: l,
53
+ collapsed: G,
54
+ collapsedRows: $,
55
+ itemDataList: j
50
56
  });
51
- return /* @__PURE__ */ a(
57
+ return /* @__PURE__ */ i(
52
58
  "div",
53
59
  {
54
- ref: u,
55
- className: R,
60
+ ref: _,
61
+ className: b,
56
62
  style: {
57
- ...N,
58
- ...D
63
+ ...E,
64
+ ...M
59
65
  },
60
- children: /* @__PURE__ */ a(
61
- j.Provider,
66
+ children: /* @__PURE__ */ i(
67
+ F.Provider,
62
68
  {
63
69
  value: {
64
- collectItemData(e, o) {
65
- t.set(e, o), p(new Map([...t]));
70
+ collectItemData(e, s) {
71
+ o.set(e, s), c(new Map([...o]));
66
72
  },
67
73
  removeItemData(e) {
68
- t.delete(e), p(new Map([...t]));
74
+ o.delete(e), c(new Map([...o]));
69
75
  }
70
76
  },
71
- children: /* @__PURE__ */ a(
72
- B.Provider,
77
+ children: /* @__PURE__ */ i(
78
+ H.Provider,
73
79
  {
74
80
  value: {
75
- cols: r,
76
- colGap: i,
77
- collapsed: n,
78
- overflow: c.overflow,
79
- displayIndexList: c.displayIndexList
81
+ cols: l,
82
+ colGap: u,
83
+ collapsed: G,
84
+ overflow: C.overflow,
85
+ displayIndexList: C.displayIndexList
80
86
  },
81
- children: d.Children.map(g, (e, o) => {
87
+ children: g.Children.map(y, (e, s) => {
82
88
  if (e) {
83
- const s = {
84
- __index__: o,
89
+ const p = {
90
+ __index__: s,
85
91
  ...e.props
86
92
  };
87
- return d.cloneElement(e, s);
93
+ return g.cloneElement(e, p);
88
94
  }
89
95
  return null;
90
- }).filter(
91
- (e) => L(e, "type.__PQB_GRID_ITEM__")
92
- )
96
+ }).filter((e) => A(e, "type.__PQB_GRID_ITEM__"))
93
97
  }
94
98
  )
95
99
  }
@@ -97,8 +101,8 @@ function q(f, u) {
97
101
  }
98
102
  );
99
103
  }
100
- const z = h(q);
101
- z.displayName = "Grid";
104
+ const W = Q(U);
105
+ W.displayName = "Grid";
102
106
  export {
103
- z as default
107
+ W as default
104
108
  };
package/grid/Row.js CHANGED
@@ -17,7 +17,7 @@ function q(d, b) {
17
17
  d,
18
18
  T,
19
19
  j?.["Grid.Row"]
20
- ), { className: R, style: w, children: $, div: i, align: m, justify: l, gutter: t, ...N } = C, [h, P] = G({
20
+ ), { className: R, style: $, children: w, 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,
@@ -66,7 +66,7 @@ function q(d, b) {
66
66
  ref: b,
67
67
  ...L(N, ["gutter"]),
68
68
  style: {
69
- ...w,
69
+ ...$,
70
70
  ...o
71
71
  },
72
72
  className: k,
@@ -74,7 +74,7 @@ function q(d, b) {
74
74
  M.Provider,
75
75
  {
76
76
  value: { gutter: [n, a], div: i },
77
- children: $
77
+ children: w
78
78
  }
79
79
  )
80
80
  }
package/grid/index.js CHANGED
@@ -1,16 +1,16 @@
1
- import m from "./Col.js";
2
- import r from "./Grid.js";
3
- import t from "./Item.js";
4
- import i from "./Row.js";
5
- const o = r;
6
- o.Col = m;
7
- o.Row = i;
8
- o.Item = t;
1
+ import r from "./Col.js";
2
+ import m from "./Grid.js";
3
+ import i from "./Item.js";
4
+ import t from "./Row.js";
5
+ const o = m;
6
+ o.Col = r;
7
+ o.Row = t;
8
+ o.Item = i;
9
9
  export {
10
- m as Col,
11
- m as GridCol,
12
- t as GridItem,
13
- i as GridRow,
14
- i as Row,
10
+ r as Col,
11
+ r as GridCol,
12
+ i as GridItem,
13
+ t as GridRow,
14
+ t as Row,
15
15
  o as default
16
16
  };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+