@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
@@ -1,10 +1,9 @@
1
1
  import { UI_PC_PREFIX as f } from "@unicom-cloud/utils/constant/ui.js";
2
- import p from "lodash/isPlainObject";
3
- import { CSS_VARIABLE_ELEMENT as $ } from "./constant.js";
4
- import "../../../dist/tinycolor/chunk/BOzCVdr0.js";
5
- import { TinyColor as n } from "../../../dist/tinycolor/src/index.js";
6
- function b(s) {
7
- if (!p(s)) return;
2
+ import n from "@unicom-cloud/utils/tinycolor";
3
+ import $ from "lodash/isPlainObject";
4
+ import { CSS_VARIABLE_ELEMENT as p } from "./constant.js";
5
+ function P(s) {
6
+ if (!$(s)) return;
8
7
  const { prefix: e = f, ...i } = s, c = {
9
8
  primary: {
10
9
  default: `--${e}-primary-6`,
@@ -41,7 +40,7 @@ function b(s) {
41
40
  c[`${o}Color`] = r;
42
41
  const l = i[o];
43
42
  if (!l) return;
44
- const a = new n(l), t = $;
43
+ const a = new n(l), t = p;
45
44
  t.style.setProperty(r.default, a.toRgbArrayString());
46
45
  const y = i[`${o}Hover`];
47
46
  y ? t.style.setProperty(r.hover, new n(y).toRgbArrayString()) : t.style.setProperty(r.hover, a.lighten(10).toRgbArrayString());
@@ -50,6 +49,6 @@ function b(s) {
50
49
  });
51
50
  }
52
51
  export {
53
- b as default,
54
- b as setTheme
52
+ P as default,
53
+ P as setTheme
55
54
  };
@@ -0,0 +1,12 @@
1
+ import o from "react";
2
+ import { isFragment as a } from "react-is";
3
+ function t(s, p = {}) {
4
+ const e = [];
5
+ return o.Children.forEach(s, (r) => {
6
+ r == null && !p.keepEmpty || (Array.isArray(r) ? e.push(...t(r, p)) : a(r) && "props" in r && r.props ? e.push(...t(r.props.children, p)) : e.push(r));
7
+ }), e;
8
+ }
9
+ export {
10
+ t as default,
11
+ t as toArray
12
+ };
package/copy/index.js CHANGED
@@ -5,12 +5,11 @@ import { useContext as h, useState as b, useRef as P, useEffect as w } from "rea
5
5
  import "../config-provider/ConfigProvider.js";
6
6
  import E from "../components/common/hooks/useKeyboardEvent.js";
7
7
  import N from "../tooltip/index.js";
8
+ import "@unicom-cloud/utils/date";
8
9
  import "@unicom-cloud/utils/case-name";
9
10
  import k from "@unicom-cloud/utils/class-name";
10
- import "../dist/tinycolor/chunk/BOzCVdr0.js";
11
11
  import "@unicom-cloud/utils/constant/ui";
12
12
  import "../utils/contextHolder.js";
13
- import "@unicom-cloud/utils/dayjs";
14
13
  import I from "@unicom-cloud/utils/clipboard-copy";
15
14
  import "../components/common/utils/dayjs.js";
16
15
  import "../components/common/utils/dom.js";
@@ -47,6 +46,8 @@ import "../dist/react-transition-group/src/TransitionGroup.js";
47
46
  import "../components/common/utils/reactDOM.js";
48
47
  import "@unicom-cloud/utils/file/saveAs";
49
48
  import "@unicom-cloud/utils/screenfull";
49
+ import "@unicom-cloud/utils/tinycolor";
50
+ import "@unicom-cloud/utils/ui-color";
50
51
  import "@unicom-cloud/utils/constant/ui.js";
51
52
  import "lodash/isPlainObject";
52
53
  import "react-is";
package/details/index.js CHANGED
@@ -1,81 +1,121 @@
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";
1
+ import { jsxs as p, 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 T from "@unicom-cloud/icons/IconUiDown";
5
+ import M from "@unicom-cloud/icons/IconUiExclamationCircleFill";
6
+ import f from "@unicom-cloud/icons/IconUiInfoCircleFill";
7
+ import { forwardRef as R, useContext as _, useState as q, useEffect as z } from "react";
8
8
  import "../config-provider/ConfigProvider.js";
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 = {
9
+ import "lodash/isEqualWith";
10
+ import "../components/common/utils/is.js";
11
+ import "@unicom-cloud/utils/constant/keyboardCode";
12
+ import "lodash/isNumber";
13
+ import "lodash/merge";
14
+ import "../components/common/utils/dom.js";
15
+ import "../components/common/hooks/useIntersectionObserver.js";
16
+ import A from "../components/common/hooks/useMergeProps.js";
17
+ import "../components/common/utils/reactDOM.js";
18
+ import "@unicom-cloud/utils/constant";
19
+ import B from "../components/common/hooks/useUpdateEffect.js";
20
+ import "lodash/debounce";
21
+ import d from "@unicom-cloud/utils/class-name";
22
+ import G from "../config-provider/context.js";
23
+ const H = {
13
24
  type: "default"
14
25
  };
15
- function T(p, f) {
16
- const { getPrefixCls: d, componentConfig: u, rtl: C } = S(M), N = E(
17
- p,
18
- R,
19
- u?.Details
26
+ function J(u, C) {
27
+ const { getPrefixCls: N, componentConfig: $, rtl: g } = _(G), v = A(
28
+ u,
29
+ H,
30
+ $?.Details
20
31
  ), {
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(
32
+ style: h,
33
+ className: x,
34
+ type: s = "default",
35
+ title: l,
36
+ content: c,
37
+ icon: y,
38
+ banner: D,
39
+ open: t,
40
+ defaultOpen: I,
41
+ onOpen: U,
42
+ onClose: w,
43
+ ...F
44
+ } = v, e = N?.("details"), [k, a] = q({ open: !!I }), n = t === void 0 ? k.open : t, m = y || {
45
+ default: /* @__PURE__ */ o(f, {}),
46
+ info: /* @__PURE__ */ o(f, {}),
47
+ success: /* @__PURE__ */ o(b, {}),
48
+ warning: /* @__PURE__ */ o(M, {}),
49
+ error: /* @__PURE__ */ o(j, {})
50
+ }[s], E = d(
36
51
  e,
37
- `${e}-${t}`,
52
+ `${e}-${s}`,
38
53
  {
39
- [`${e}-banner`]: h,
40
- [`${e}-rtl`]: C
54
+ [`${e}-banner`]: D,
55
+ [`${e}-rtl`]: g
41
56
  },
42
- g
57
+ x
43
58
  );
44
- return /* @__PURE__ */ a(
59
+ B(() => (n ? U?.() : w?.(), () => {
60
+ }), [n]), z(() => {
61
+ if (t !== void 0)
62
+ return a((r) => {
63
+ const i = { ...r };
64
+ return i.open = t, i;
65
+ }), () => {
66
+ };
67
+ }, [t]);
68
+ const O = (r) => {
69
+ if (t !== void 0) {
70
+ r.preventDefault();
71
+ return;
72
+ }
73
+ const i = r.target;
74
+ a((S) => ({
75
+ ...S,
76
+ open: i.open
77
+ }));
78
+ }, P = (r) => {
79
+ t !== void 0 && r.preventDefault();
80
+ };
81
+ return /* @__PURE__ */ p(
45
82
  "details",
46
83
  {
47
- ref: f,
48
- style: $,
49
- className: D,
84
+ ref: C,
85
+ style: h,
86
+ className: E,
50
87
  role: "details",
51
- onToggle: (i) => {
52
- i.target?.open, w((U) => {
53
- const l = { ...U };
54
- return l.open = i.target?.open, l;
55
- });
56
- },
57
- ...y,
88
+ open: n,
89
+ onToggle: O,
90
+ ...F,
58
91
  children: [
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 }),
62
- /* @__PURE__ */ o(
63
- P,
64
- {
65
- className: m(
66
- `${e}-collapse-icon`,
67
- I.open && `${e}-collapse-icon-open`
92
+ /* @__PURE__ */ p(
93
+ "summary",
94
+ {
95
+ className: `${e}-summary-wrapper`,
96
+ onClick: P,
97
+ children: [
98
+ m && /* @__PURE__ */ o("div", { className: `${e}-icon`, children: m }),
99
+ l && /* @__PURE__ */ o("div", { className: `${e}-title`, children: l }),
100
+ /* @__PURE__ */ o(
101
+ T,
102
+ {
103
+ className: d(
104
+ `${e}-collapse-icon`,
105
+ n && `${e}-collapse-icon-open`
106
+ )
107
+ }
68
108
  )
69
- }
70
- )
71
- ] }),
72
- /* @__PURE__ */ o("div", { className: `${e}-content-wrapper`, children: r && /* @__PURE__ */ o("div", { className: `${e}-content`, children: r }) })
109
+ ]
110
+ }
111
+ ),
112
+ /* @__PURE__ */ o("div", { className: `${e}-content-wrapper`, children: c && /* @__PURE__ */ o("div", { className: `${e}-content`, children: c }) })
73
113
  ]
74
114
  }
75
115
  );
76
116
  }
77
- const _ = j(T);
78
- _.displayName = "Details";
117
+ const K = R(J);
118
+ K.displayName = "Details";
79
119
  export {
80
- _ as default
120
+ K as default
81
121
  };
@@ -0,0 +1,126 @@
1
+ const Z = (t) => typeof t == "object" && t != null && t.nodeType === 1, _ = (t, e) => e && t === "hidden" ? !1 : t !== "visible" && t !== "clip", $ = (t) => {
2
+ if (!t.ownerDocument || !t.ownerDocument.defaultView)
3
+ return null;
4
+ try {
5
+ return t.ownerDocument.defaultView.frameElement;
6
+ } catch {
7
+ return null;
8
+ }
9
+ }, tt = (t) => {
10
+ const e = $(t);
11
+ return e ? e.clientHeight < t.scrollHeight || e.clientWidth < t.scrollWidth : !1;
12
+ }, L = (t, e) => {
13
+ if (t.clientHeight < t.scrollHeight || t.clientWidth < t.scrollWidth) {
14
+ const h = getComputedStyle(t, null);
15
+ return _(h.overflowY, e) || _(h.overflowX, e) || tt(t);
16
+ }
17
+ return !1;
18
+ }, S = (t, e, h, i, d, f, a, u) => f < t && a > e || f > t && a < e ? 0 : f <= t && u <= h || a >= e && u >= h ? f - t - i : a > e && u < h || f < t && u > h ? a - e + d : 0, et = (t) => t.parentElement ?? (t.getRootNode().host || null), ot = (t) => {
19
+ const e = window.getComputedStyle(t);
20
+ return {
21
+ top: parseFloat(e.scrollMarginTop) || 0,
22
+ right: parseFloat(e.scrollMarginRight) || 0,
23
+ bottom: parseFloat(e.scrollMarginBottom) || 0,
24
+ left: parseFloat(e.scrollMarginLeft) || 0
25
+ };
26
+ }, nt = (t, e) => {
27
+ if (typeof document > "u")
28
+ return [];
29
+ const { scrollMode: h, block: i, inline: d, boundary: f, skipOverflowHiddenElements: a } = e, u = typeof f == "function" ? f : (H) => H !== f;
30
+ if (!Z(t))
31
+ throw new TypeError("Invalid target");
32
+ const X = document.scrollingElement || document.documentElement, y = [];
33
+ let l = t;
34
+ for (; Z(l) && u(l); ) {
35
+ if (l = et(l), l === X) {
36
+ y.push(l);
37
+ break;
38
+ }
39
+ l != null && l === document.body && L(l) && !L(document.documentElement) || l != null && L(l, a) && y.push(l);
40
+ }
41
+ const g = window.visualViewport?.width ?? innerWidth, p = window.visualViewport?.height ?? innerHeight, { scrollX: m, scrollY: w } = window, {
42
+ height: W,
43
+ width: b,
44
+ top: M,
45
+ right: Y,
46
+ bottom: j,
47
+ left: v
48
+ } = t.getBoundingClientRect(), {
49
+ top: G,
50
+ right: J,
51
+ bottom: K,
52
+ left: P
53
+ } = ot(t);
54
+ let s = i === "start" || i === "nearest" ? M - G : i === "end" ? j + K : M + W / 2 - G + K, c = d === "center" ? v + b / 2 - P + J : d === "end" ? Y + J : v - P;
55
+ const N = [];
56
+ for (let H = 0; H < y.length; H++) {
57
+ const o = y[H], { height: E, width: x, top: C, right: O, bottom: q, left: I } = o.getBoundingClientRect();
58
+ if (h === "if-needed" && M >= 0 && v >= 0 && j <= p && Y <= g && // scrollingElement is added to the frames array even if it's not scrollable, in which case checking its bounds is not required
59
+ (o === X && !L(o) || M >= C && j <= q && v >= I && Y <= O))
60
+ return N;
61
+ const R = getComputedStyle(o), T = parseInt(R.borderLeftWidth, 10), B = parseInt(R.borderTopWidth, 10), F = parseInt(R.borderRightWidth, 10), V = parseInt(R.borderBottomWidth, 10);
62
+ let n = 0, r = 0;
63
+ const k = "offsetWidth" in o ? o.offsetWidth - o.clientWidth - T - F : 0, D = "offsetHeight" in o ? o.offsetHeight - o.clientHeight - B - V : 0, z = "offsetWidth" in o ? o.offsetWidth === 0 ? 0 : x / o.offsetWidth : 0, A = "offsetHeight" in o ? o.offsetHeight === 0 ? 0 : E / o.offsetHeight : 0;
64
+ if (X === o)
65
+ i === "start" ? n = s : i === "end" ? n = s - p : i === "nearest" ? n = S(
66
+ w,
67
+ w + p,
68
+ p,
69
+ B,
70
+ V,
71
+ w + s,
72
+ w + s + W,
73
+ W
74
+ ) : n = s - p / 2, d === "start" ? r = c : d === "center" ? r = c - g / 2 : d === "end" ? r = c - g : r = S(
75
+ m,
76
+ m + g,
77
+ g,
78
+ T,
79
+ F,
80
+ m + c,
81
+ m + c + b,
82
+ b
83
+ ), n = Math.max(0, n + w), r = Math.max(0, r + m);
84
+ else {
85
+ i === "start" ? n = s - C - B : i === "end" ? n = s - q + V + D : i === "nearest" ? n = S(
86
+ C,
87
+ q,
88
+ E,
89
+ B,
90
+ V + D,
91
+ s,
92
+ s + W,
93
+ W
94
+ ) : n = s - (C + E / 2) + D / 2, d === "start" ? r = c - I - T : d === "center" ? r = c - (I + x / 2) + k / 2 : d === "end" ? r = c - O + F + k : r = S(
95
+ I,
96
+ O,
97
+ x,
98
+ T,
99
+ F + k,
100
+ c,
101
+ c + b,
102
+ b
103
+ );
104
+ const { scrollLeft: Q, scrollTop: U } = o;
105
+ n = A === 0 ? 0 : Math.max(
106
+ 0,
107
+ Math.min(
108
+ U + n / A,
109
+ o.scrollHeight - E / A + D
110
+ )
111
+ ), r = z === 0 ? 0 : Math.max(
112
+ 0,
113
+ Math.min(
114
+ Q + r / z,
115
+ o.scrollWidth - x / z + k
116
+ )
117
+ ), s += U - n, c += Q - r;
118
+ }
119
+ N.push({ el: o, top: n, left: r });
120
+ }
121
+ return N;
122
+ };
123
+ export {
124
+ nt as compute,
125
+ nt as default
126
+ };
@@ -0,0 +1,70 @@
1
+ import u from "../src/index.js";
2
+ let d;
3
+ const b = () => (d || (d = "performance" in window ? performance.now.bind(performance) : Date.now), d());
4
+ function h(o) {
5
+ const s = b(), e = Math.min((s - o.startTime) / o.duration, 1), l = o.ease(e), a = o.startX + (o.x - o.startX) * l, n = o.startY + (o.y - o.startY) * l;
6
+ o.method(a, n, e, l), a !== o.x || n !== o.y ? requestAnimationFrame(() => h(o)) : o.cb();
7
+ }
8
+ function k(o, s, e, l = 600, a = (t) => 1 + --t * t * t * t * t, n, c) {
9
+ const t = o, i = o.scrollLeft, r = o.scrollTop;
10
+ h({
11
+ scrollable: t,
12
+ method: (m, w, v, y) => {
13
+ const f = Math.ceil(m), p = Math.ceil(w);
14
+ o.scrollLeft = f, o.scrollTop = p, c?.({
15
+ target: o,
16
+ elapsed: v,
17
+ value: y,
18
+ left: f,
19
+ top: p
20
+ });
21
+ },
22
+ startTime: b(),
23
+ startX: i,
24
+ startY: r,
25
+ x: s,
26
+ y: e,
27
+ duration: l,
28
+ ease: a,
29
+ cb: n
30
+ });
31
+ }
32
+ const M = (o) => o && !o.behavior || o.behavior === "smooth";
33
+ function T(o, s) {
34
+ const e = s || {};
35
+ return M(e) ? u(o, {
36
+ block: e.block,
37
+ inline: e.inline,
38
+ scrollMode: e.scrollMode,
39
+ boundary: e.boundary,
40
+ skipOverflowHiddenElements: e.skipOverflowHiddenElements,
41
+ behavior: (l) => Promise.all(
42
+ l.reduce(
43
+ (a, { el: n, left: c, top: t }) => {
44
+ const i = n.scrollLeft, r = n.scrollTop;
45
+ return i === c && r === t ? a : [
46
+ ...a,
47
+ new Promise((m) => k(
48
+ n,
49
+ c,
50
+ t,
51
+ e.duration,
52
+ e.ease,
53
+ () => m({
54
+ el: n,
55
+ left: [i, c],
56
+ top: [r, t]
57
+ }),
58
+ e.onScrollChange
59
+ ))
60
+ ];
61
+ },
62
+ []
63
+ )
64
+ )
65
+ }) : Promise.resolve(u(o, s));
66
+ }
67
+ const Y = T;
68
+ export {
69
+ Y as default
70
+ };
@@ -1,29 +1,29 @@
1
- import { compute as r } from "../../compute-scroll-into-view/src/index.js";
2
- const f = (t) => t === Object(t) && Object.keys(t).length !== 0, p = (t) => typeof t == "object" ? typeof t.behavior == "function" : !1, d = (t) => t === !1 ? { block: "end", inline: "nearest" } : f(t) ? t : { block: "start", inline: "nearest" }, u = (t) => {
3
- const o = window.getComputedStyle(t);
1
+ import { compute as r } from "../compute/index.js";
2
+ const f = (o) => o === Object(o) && Object.keys(o).length !== 0, p = (o) => typeof o == "object" ? typeof o.behavior == "function" : !1, d = (o) => o === !1 ? { block: "end", inline: "nearest" } : f(o) ? o : { block: "start", inline: "nearest" }, b = (o) => {
3
+ const t = window.getComputedStyle(o);
4
4
  return {
5
- top: parseFloat(o.scrollMarginTop) || 0,
6
- right: parseFloat(o.scrollMarginRight) || 0,
7
- bottom: parseFloat(o.scrollMarginBottom) || 0,
8
- left: parseFloat(o.scrollMarginLeft) || 0
5
+ top: parseFloat(t.scrollMarginTop) || 0,
6
+ right: parseFloat(t.scrollMarginRight) || 0,
7
+ bottom: parseFloat(t.scrollMarginBottom) || 0,
8
+ left: parseFloat(t.scrollMarginLeft) || 0
9
9
  };
10
- }, b = (t) => {
11
- let o = t;
12
- for (; o && o.parentNode; ) {
13
- if (o.parentNode === document)
10
+ }, u = (o) => {
11
+ let t = o;
12
+ for (; t && t.parentNode; ) {
13
+ if (t.parentNode === document)
14
14
  return !0;
15
- o.parentNode instanceof ShadowRoot ? o = o.parentNode.host : o = o.parentNode;
15
+ t.parentNode instanceof ShadowRoot ? t = t.parentNode.host : t = t.parentNode;
16
16
  }
17
17
  return !1;
18
18
  };
19
- function g(t, o) {
20
- if (!t.isConnected || !b(t))
19
+ function g(o, t) {
20
+ if (!o.isConnected || !u(o))
21
21
  return;
22
- const e = u(t);
23
- if (p(o))
24
- return o.behavior(r(t, o));
25
- const n = typeof o == "boolean" || o == null ? void 0 : o.behavior;
26
- for (const { el: a, top: l, left: s } of r(t, d(o))) {
22
+ const e = b(o);
23
+ if (p(t))
24
+ return t.behavior(r(o, t));
25
+ const n = typeof t == "boolean" ? void 0 : t?.behavior;
26
+ for (const { el: a, top: l, left: s } of r(o, d(t))) {
27
27
  const i = l - e.top + e.bottom, c = s - e.left + e.right;
28
28
  a.scroll({ top: i, left: c, behavior: n });
29
29
  }
package/divider/index.js CHANGED
@@ -1,41 +1,47 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as x, useContext as $ } from "react";
2
+ import { forwardRef as l, useContext as v } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
- import u from "../components/common/hooks/useMergeProps.js";
4
+ import N from "../components/common/hooks/useMergeProps.js";
5
5
  import C from "@unicom-cloud/utils/class-name";
6
- import N from "../config-provider/context.js";
7
- const h = {
6
+ import h from "../config-provider/context.js";
7
+ const y = {
8
8
  type: "horizontal",
9
9
  orientation: "center"
10
10
  };
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(
11
+ function D(r, o) {
12
+ const { getPrefixCls: m, componentConfig: p } = v(h), d = N(
13
+ r,
14
+ y,
15
+ p?.Divider
16
+ ), { children: e, style: f, className: x, type: n, orientation: i, ...$ } = d, t = m?.("divider"), u = C(
17
17
  t,
18
- `${t}-${r}`,
18
+ `${t}-${n}`,
19
19
  {
20
20
  [`${t}-with-text`]: e,
21
- [`${t}-with-text-${o}`]: e && o
21
+ [`${t}-with-text-${i}`]: e && i
22
22
  },
23
- c
23
+ x
24
24
  );
25
25
  return /* @__PURE__ */ s(
26
26
  "div",
27
27
  {
28
28
  role: "separator",
29
- ref: n,
30
- className: d,
31
- style: p,
32
- ...f,
33
- children: e && r === "horizontal" ? /* @__PURE__ */ s("span", { className: `${t}-text ${t}-text-${o}`, children: e }) : null
29
+ ref: o,
30
+ className: u,
31
+ style: f,
32
+ ...$,
33
+ children: e && n === "horizontal" ? /* @__PURE__ */ s("span", { className: `${t}-text ${t}-text-${i}`, children: e }) : null
34
34
  }
35
35
  );
36
36
  }
37
- const g = x(v);
38
- g.displayName = "Divider";
37
+ const a = l(
38
+ D
39
+ );
40
+ a.displayName = "Divider";
41
+ const c = l((r, o) => /* @__PURE__ */ s(a, { ref: o, type: "vertical", ...r }));
42
+ c.displayName = "DividerVertical";
43
+ a.Vertical = c;
39
44
  export {
40
- g as default
45
+ c as DividerVertical,
46
+ a as default
41
47
  };
package/empty/index.js CHANGED
@@ -1,23 +1,23 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { memo as a, forwardRef as c, useContext as l } from "react";
3
- import y from "../components/common/empty/index.js";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { memo as f, forwardRef as c, useContext as l } from "react";
3
+ import { Empty as y } from "../components/common/empty/index.js";
4
4
  import "../config-provider/ConfigProvider.js";
5
5
  import C from "../components/common/hooks/useMergeProps.js";
6
6
  import x from "../config-provider/context.js";
7
- function g(o, t) {
7
+ function E(o, t) {
8
8
  const {
9
- getPrefixCls: r,
10
- locale: e,
11
- componentConfig: m
9
+ getPrefixCls: m,
10
+ locale: r,
11
+ componentConfig: e
12
12
  } = l(x), p = C(
13
13
  o,
14
14
  {},
15
- m?.Empty
16
- ), { ...n } = p, s = r?.("empty"), i = e.Empty.noData;
17
- return /* @__PURE__ */ f(y, { ref: t, prefixCls: s, description: i, ...n });
15
+ e?.Empty
16
+ ), { ...n } = p, s = m?.("empty"), i = r.Empty.noData;
17
+ return /* @__PURE__ */ a(y, { ref: t, prefixCls: s, description: i, ...n });
18
18
  }
19
- const u = a(c(g));
20
- u.displayName = "Empty";
19
+ const g = f(c(E));
20
+ g.displayName = "Empty";
21
21
  export {
22
- u as default
22
+ g as default
23
23
  };