@unicom-cloud/ui 0.8.96 → 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 (303) hide show
  1. package/Affix.js +1 -1
  2. package/Carousel.js +1 -1
  3. package/LiquidFill.js +4 -0
  4. package/OverflowEllipsis.js +1 -1
  5. package/PageHeader.js +1 -1
  6. package/QrCode.js +57 -0
  7. package/Tour.js +63 -0
  8. package/Trigger.js +1 -1
  9. package/_virtual/_commonjsHelpers.js +6 -0
  10. package/_virtual/index.js +7 -0
  11. package/_virtual/index2.js +4 -0
  12. package/affix/index.js +70 -72
  13. package/alert/index.js +56 -56
  14. package/anchor/Anchor.js +55 -55
  15. package/anchor/Link.js +34 -34
  16. package/anchor/util.js +5 -5
  17. package/auto-complete/index.js +116 -122
  18. package/avatar/Avatar.js +33 -33
  19. package/avatar/Group.js +26 -26
  20. package/back-top/index.js +58 -61
  21. package/badge/index.js +46 -46
  22. package/breadcrumb/Item.js +42 -43
  23. package/breadcrumb/index.js +47 -47
  24. package/button/Group.js +6 -6
  25. package/button/index.js +91 -91
  26. package/calendar/Month.js +75 -75
  27. package/calendar/Year.js +35 -35
  28. package/calendar/header/index.js +25 -25
  29. package/calendar/index.js +103 -103
  30. package/card/Grid.js +8 -8
  31. package/card/Meta.js +16 -16
  32. package/card/index.js +49 -49
  33. package/carousel/Arrow.js +19 -19
  34. package/carousel/Indicator.js +26 -26
  35. package/carousel/index.js +108 -108
  36. package/cascader/Cascader.js +178 -191
  37. package/cascader/base/node.js +133 -136
  38. package/cascader/base/store.js +82 -85
  39. package/cascader/panel/List.js +125 -129
  40. package/cascader/panel/Search.js +79 -81
  41. package/cascader/util.js +13 -13
  42. package/checkbox/Checkbox.js +94 -96
  43. package/checkbox/Group.js +54 -56
  44. package/checkbox/GroupBlock.js +28 -29
  45. package/collapse/Collapse.js +45 -45
  46. package/collapse/Item.js +53 -55
  47. package/color-picker/ControlBar.js +43 -43
  48. package/color-picker/InputAlpha.js +12 -12
  49. package/color-picker/InputHex.js +30 -31
  50. package/color-picker/InputRgb.js +24 -24
  51. package/color-picker/Palette.js +18 -18
  52. package/color-picker/Panel.js +122 -125
  53. package/color-picker/hooks/useColorPicker.js +85 -88
  54. package/color-picker/hooks/useControlBlock.js +38 -40
  55. package/color-picker/index.js +47 -47
  56. package/comment/index.js +29 -29
  57. package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
  58. package/components/common/hooks/useId.js +8 -8
  59. package/components/common/hooks/useInView.js +16 -16
  60. package/components/common/hooks/useIntersectionObserver.js +1 -1
  61. package/components/common/hooks/useKeyboardEvent.js +9 -10
  62. package/components/common/hooks/useOverflowHidden.js +1 -4
  63. package/components/common/hooks/usePersistCallback.js +7 -7
  64. package/components/common/hooks/useStateCallback.js +9 -10
  65. package/components/common/hooks/useWindowSize.js +8 -8
  66. package/components/common/space/index.js +9 -7
  67. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  68. package/components/common/utils/dom.js +27 -29
  69. package/components/common/utils/findScrollParent.js +17 -0
  70. package/components/common/utils/intersectionObserver.js +21 -0
  71. package/components/common/utils/is.js +99 -109
  72. package/components/common/utils/mutationObserver.js +19 -0
  73. package/components/common/utils/reactDOM.js +34 -34
  74. package/components/common/utils/resizeObserver.js +21 -0
  75. package/copy/index.js +38 -40
  76. package/date-picker/Picker.js +290 -295
  77. package/date-picker/RangePicker.js +367 -372
  78. package/date-picker/index.js +33 -35
  79. package/date-picker/panel/Body.js +46 -47
  80. package/date-picker/panel/Header.js +33 -33
  81. package/date-picker/panel/Shortcut.js +31 -31
  82. package/date-picker/panel/date/index.js +85 -85
  83. package/date-picker/panel/month/index.js +59 -59
  84. package/date-picker/panel/quarter/index.js +67 -70
  85. package/date-picker/panel/range/index.js +101 -101
  86. package/date-picker/panel/year/index.js +39 -39
  87. package/date-picker/util.js +17 -18
  88. package/descriptions/index.js +62 -62
  89. package/details/index.js +53 -55
  90. package/development/index.js +9 -9
  91. package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
  92. package/dist/validate/src/index.js +5 -5
  93. package/dist/validate/src/util.js +1 -1
  94. package/divider/index.js +21 -21
  95. package/draggable/Item.js +35 -35
  96. package/draggable/index.js +22 -22
  97. package/drawer/Drawer.js +142 -147
  98. package/dropdown/Button.js +48 -48
  99. package/dropdown/index.js +88 -92
  100. package/empty/index.js +16 -16
  101. package/form/Control.js +211 -225
  102. package/form/Form.js +109 -113
  103. package/form/FormItem.js +118 -120
  104. package/form/FormList.js +60 -66
  105. package/form/FormProvider.js +31 -34
  106. package/form/hook/useContext.js +17 -19
  107. package/form/hook/useState.js +22 -23
  108. package/form/hook/useWatch.js +26 -27
  109. package/form/promisify.js +14 -18
  110. package/form/store.js +304 -316
  111. package/form/util.js +14 -15
  112. package/grid/Col.js +64 -64
  113. package/grid/Grid.js +51 -51
  114. package/grid/GridItem.js +48 -48
  115. package/grid/Row.js +39 -39
  116. package/hooks/useVerificationCode.js +41 -43
  117. package/hooks/useWatermark.js +89 -92
  118. package/icon/index.js +23 -24
  119. package/icon-hover/index.js +16 -16
  120. package/icons/file.js +11 -11
  121. package/image/Image.js +140 -141
  122. package/image/ImagePreview.js +252 -255
  123. package/image/ImagePreviewArrow.js +25 -25
  124. package/image/ImagePreviewGroup.js +62 -62
  125. package/image/util/getScale.js +25 -28
  126. package/index.js +684 -675
  127. package/input/Button.js +48 -50
  128. package/input/Group.js +9 -9
  129. package/input/Input.js +145 -154
  130. package/input/InputElement.js +108 -115
  131. package/input/Password.js +38 -38
  132. package/input/Search.js +51 -55
  133. package/input/Textarea.js +80 -81
  134. package/input/useComposition.js +23 -23
  135. package/input-number/decimal.js +59 -62
  136. package/input-number/index.js +139 -141
  137. package/input-tag/InputTag.js +222 -230
  138. package/layout/Content.js +6 -6
  139. package/layout/Footer.js +8 -8
  140. package/layout/Header.js +7 -7
  141. package/layout/Sider.js +88 -90
  142. package/layout/index.js +30 -30
  143. package/link/index.js +45 -46
  144. package/liquid-fill/LiquidFill.js +189 -0
  145. package/liquid-fill/LiquidFill2.js +3 -0
  146. package/liquid-fill/index.js +4 -0
  147. package/liquid-fill/interface.js +1 -0
  148. package/list/Item.js +28 -28
  149. package/list/Meta.js +12 -12
  150. package/list/index.js +146 -148
  151. package/mentions/index.js +75 -76
  152. package/menu/Item.js +58 -58
  153. package/menu/Menu.js +125 -127
  154. package/menu/OverflowWrap.js +39 -40
  155. package/menu/sub-menu/Inline.js +45 -45
  156. package/menu/util.js +26 -28
  157. package/message/index.js +96 -99
  158. package/message/useMessage.js +26 -27
  159. package/modal/Confirm.js +47 -49
  160. package/modal/Modal.js +250 -257
  161. package/modal/use-modal/Hook.js +26 -28
  162. package/modal/use-modal/index.js +46 -49
  163. package/notice/index.js +89 -90
  164. package/notification/index.js +60 -65
  165. package/notification/withNotification.js +35 -35
  166. package/overflow-ellipsis/OverflowItem.js +19 -20
  167. package/overflow-ellipsis/index.js +45 -46
  168. package/package.json +1 -1
  169. package/page-header/index.js +45 -45
  170. package/pagination/PageItem.js +87 -91
  171. package/pagination/PageJumper.js +40 -41
  172. package/pagination/PageOption.js +31 -35
  173. package/pagination/Pagination.js +162 -163
  174. package/picker/Input.js +90 -96
  175. package/picker/InputRange.js +115 -122
  176. package/popconfirm/index.js +98 -100
  177. package/popover/index.js +28 -28
  178. package/portal/Portal.js +10 -11
  179. package/progress/index.js +36 -36
  180. package/qr-code/index.js +99 -0
  181. package/qr-code/interface.js +1 -0
  182. package/radio/Group.js +48 -48
  183. package/radio/GroupBlock.js +32 -33
  184. package/radio/Radio.js +62 -64
  185. package/rate/index.js +88 -88
  186. package/resize-box/ResizeTrigger.js +39 -39
  187. package/resize-box/Split.js +92 -96
  188. package/resize-box/SplitGroup.js +116 -122
  189. package/resize-box/index.js +112 -115
  190. package/result/index.js +44 -44
  191. package/select/Option.js +53 -56
  192. package/select/Select.js +365 -381
  193. package/select/util.js +95 -99
  194. package/select-view/Core.js +159 -160
  195. package/skeleton/index.js +23 -23
  196. package/slider/Button.js +84 -92
  197. package/slider/Input.js +47 -49
  198. package/slider/Tick.js +28 -31
  199. package/slider/index.js +107 -107
  200. package/space/index.js +26 -26
  201. package/space-/index.js +51 -51
  202. package/spin/DotLoading.js +8 -8
  203. package/spin/index.js +47 -47
  204. package/statistic/Countdown.js +37 -37
  205. package/statistic/index.js +58 -58
  206. package/steps/Step.js +42 -42
  207. package/steps/index.js +54 -54
  208. package/style.css +1 -1
  209. package/switch/index.js +77 -78
  210. package/table/ColGroup.js +36 -37
  211. package/table/Table.js +447 -450
  212. package/table/hook/useExpand.js +24 -24
  213. package/table/hook/useRowSelection.js +62 -62
  214. package/table/summary/Row.js +16 -17
  215. package/table/tbody/Td.js +119 -118
  216. package/table/tbody/Tr.js +119 -121
  217. package/table/tbody/index.js +62 -63
  218. package/table/th-resizable/index.js +30 -30
  219. package/table/thead/Column.js +148 -148
  220. package/table/thead/index.js +87 -88
  221. package/tabs/Tab.js +55 -55
  222. package/tabs/TabContent.js +8 -8
  223. package/tabs/TabPane.js +15 -15
  224. package/tabs/hook/useHeaderScroll.js +36 -36
  225. package/tabs/tab-header/TabInk.js +31 -33
  226. package/tabs/tab-header/TabNavIcon.js +34 -35
  227. package/tabs/tab-header/index.js +192 -195
  228. package/tag/index.js +94 -97
  229. package/time-picker/Picker.js +167 -172
  230. package/time-picker/RangePicker.js +28 -28
  231. package/time-picker/TimePicker.js +146 -146
  232. package/timeline/Item.js +46 -46
  233. package/timeline/Timeline.js +52 -52
  234. package/tooltip/index.js +89 -95
  235. package/tour/index.js +289 -0
  236. package/transfer/Item.js +54 -54
  237. package/transfer/List.js +134 -136
  238. package/transfer/index.js +91 -91
  239. package/tree/Animation.js +49 -52
  240. package/tree/Node.js +114 -122
  241. package/tree/NodeList.js +51 -51
  242. package/tree/Tree.js +386 -393
  243. package/tree-select/List.js +71 -72
  244. package/tree-select/Select.js +135 -143
  245. package/tree-select/hook/useKeyCache.js +39 -39
  246. package/tree-select/hook/useStateValue.js +12 -12
  247. package/trigger/getPopupStyle.js +60 -61
  248. package/trigger/index.js +337 -346
  249. package/types/common/space/interface.d.ts +1 -1
  250. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  251. package/types/common/utils/findScrollParent.d.ts +2 -0
  252. package/types/common/utils/index.d.ts +5 -0
  253. package/types/common/utils/intersectionObserver.d.ts +2 -0
  254. package/types/common/utils/mutationObserver.d.ts +2 -0
  255. package/types/common/utils/resizeObserver.d.ts +2 -0
  256. package/types/pc/index.d.ts +3 -0
  257. package/types/pc/liquid-fill/LiquidFill.d.ts +30 -0
  258. package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
  259. package/types/pc/liquid-fill/index.d.ts +4 -0
  260. package/types/pc/liquid-fill/interface.d.ts +0 -0
  261. package/types/pc/qr-code/index.d.ts +34 -0
  262. package/types/pc/qr-code/interface.d.ts +39 -0
  263. package/types/pc/table/interface.d.ts +2 -2
  264. package/types/pc/tour/index.d.ts +42 -0
  265. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  266. package/types/pc/utils/findScrollParent.d.ts +2 -0
  267. package/types/pc/utils/index.d.ts +5 -0
  268. package/types/pc/utils/intersectionObserver.d.ts +2 -0
  269. package/types/pc/utils/mutationObserver.d.ts +2 -0
  270. package/types/pc/utils/names.d.ts +18 -0
  271. package/types/pc/utils/resizeObserver.d.ts +2 -0
  272. package/typography/Base.js +79 -81
  273. package/typography/EditContent.js +30 -33
  274. package/typography/Ellipsis.js +77 -73
  275. package/typography/Operations.js +50 -52
  276. package/typography/Paragraph.js +7 -7
  277. package/typography/Typography.js +7 -7
  278. package/typography/useEllipsis.js +105 -106
  279. package/upload/TriggerNode.js +69 -76
  280. package/upload/Upload.js +84 -87
  281. package/upload/Uploader.js +115 -118
  282. package/upload/list/PictureItem.js +61 -71
  283. package/upload/list/TextItem.js +61 -67
  284. package/upload/list/UploadProgress.js +42 -49
  285. package/upload/list/index.js +48 -49
  286. package/upload/request_.js +37 -38
  287. package/upload/util.js +39 -39
  288. package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  289. package/utils/findScrollParent.js +4 -0
  290. package/utils/index.js +281 -278
  291. package/utils/intersectionObserver.js +4 -0
  292. package/utils/mutationObserver.js +4 -0
  293. package/utils/names.js +12 -0
  294. package/utils/resizeObserver.js +4 -0
  295. package/verification-code/VerificationCode.js +50 -51
  296. package/version/index.js +1 -1
  297. package/virtual-list/VirtualList.js +243 -244
  298. package/virtual-list/util/item.js +3 -4
  299. package/watermark/Watermark.js +27 -31
  300. package/components/common/utils/resizeObserverEffect.js +0 -23
  301. package/types/common/utils/resizeObserverEffect.d.ts +0 -2
  302. package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
  303. package/utils/resizeObserverEffect.js +0 -4
@@ -3,7 +3,7 @@ import { useState as l, useDeferredValue as h, useCallback as o, useEffect as m
3
3
  import z from "./useListenResize.js";
4
4
  const R = (i = !1) => {
5
5
  const [s, u] = l({
6
- ...n(null)
6
+ ...t(null)
7
7
  }), c = h(
8
8
  s
9
9
  // 延迟一个值与防抖和节流之间有什么不同?
@@ -14,17 +14,17 @@ const R = (i = !1) => {
14
14
  // 此外,与防抖或节流不同,useDeferredValue 执行的延迟重新渲染默认是可中断的。这意味着,如果 React 正在重新渲染一个大型列表,但用户进行了另一次键盘输入,React 会放弃该重新渲染,先处理键盘输入,然后再次开始在后台渲染。相比之下,防抖和节流仍会产生不顺畅的体验,因为它们是阻塞的:它们仅仅是将渲染阻塞键盘输入的时刻推迟了。
15
15
  // 如果你要优化的工作不是在渲染期间发生的,那么防抖和节流仍然非常有用。例如,它们可以让你减少网络请求的次数。你也可以同时使用这些技术。
16
16
  );
17
- function n(e) {
18
- const t = (e == null ? void 0 : e.currentTarget) ?? (e == null ? void 0 : e.target) ?? window;
17
+ function t(e) {
18
+ const r = e?.currentTarget ?? e?.target ?? window;
19
19
  return {
20
- width: (t == null ? void 0 : t.innerWidth) ?? 0,
21
- height: (t == null ? void 0 : t.innerHeight) ?? 0
20
+ width: r?.innerWidth ?? 0,
21
+ height: r?.innerHeight ?? 0
22
22
  };
23
23
  }
24
- function r(e) {
25
- u(n(e));
24
+ function n(e) {
25
+ u(t(e));
26
26
  }
27
- const a = o(r, []), f = o(d(r, 123), []);
27
+ const a = o(n, []), f = o(d(n, 123), []);
28
28
  return z(i ? f : a, []), m(() => () => {
29
29
  }, []), c;
30
30
  };
@@ -4,6 +4,7 @@ import { forwardRef as c } from "react";
4
4
  import "@unicom-cloud/utils/case-name";
5
5
  import _ from "@unicom-cloud/utils/class-name";
6
6
  import "../../../dist/tinycolor/chunk/BOzCVdr0.js";
7
+ import "@unicom-cloud/utils/dayjs";
7
8
  import "@unicom-cloud/utils/clipboard-copy";
8
9
  import "../utils/dayjs.js";
9
10
  import "../utils/dom.js";
@@ -12,6 +13,8 @@ import "lodash/escapeRegExp";
12
13
  import "lodash/isArray";
13
14
  import "lodash/isNumber";
14
15
  import "lodash/isString";
16
+ import "lodash/isFunction";
17
+ import "lodash/throttle";
15
18
  import "../utils/is.js";
16
19
  import "lodash/camelCase";
17
20
  import "lodash/capitalize";
@@ -26,7 +29,6 @@ import "lodash/set";
26
29
  import "lodash/setWith";
27
30
  import "lodash/snakeCase";
28
31
  import "lodash/startCase";
29
- import "lodash/throttle";
30
32
  import "lodash/uniq";
31
33
  import "lodash/upperFirst";
32
34
  import "@unicom-cloud/utils/math";
@@ -48,7 +50,7 @@ function f(t = 8) {
48
50
  if (I(t))
49
51
  return t;
50
52
  if (l(t))
51
- return t.map((i, r, p) => f(i));
53
+ return t.map((i, r, e) => f(i));
52
54
  switch (t) {
53
55
  case "mini":
54
56
  return 4;
@@ -64,7 +66,7 @@ function f(t = 8) {
64
66
  }
65
67
  function S(t, i) {
66
68
  const r = `${C}-space`, {
67
- className: p,
69
+ className: e,
68
70
  style: d,
69
71
  children: $,
70
72
  inline: y,
@@ -75,8 +77,8 @@ function S(t, i) {
75
77
  alignItems: g,
76
78
  ...w
77
79
  } = t;
78
- let e = g;
79
- n === "horizontal" && (e || (e = "center"));
80
+ let p = g;
81
+ n === "horizontal" && (p ||= "center");
80
82
  const o = f(N), m = { ...d };
81
83
  return l(o) ? (m.rowGap = o[0], m.columnGap = o[1]) : m.gap = o, /* @__PURE__ */ s(
82
84
  "div",
@@ -88,8 +90,8 @@ function S(t, i) {
88
90
  h && `${r}-wrap`,
89
91
  `${r}-${n}`,
90
92
  a && `${r}-justify-content-${a}`,
91
- e && `${r}-align-items-${e}`,
92
- p
93
+ p && `${r}-align-items-${p}`,
94
+ e
93
95
  ),
94
96
  style: m,
95
97
  ...w,
@@ -0,0 +1,6 @@
1
+ import "@unicom-cloud/utils/dayjs";
2
+ import { convertToDurationBasedOnTimeUnits as i, convertToDurationBasedOnTimeUnits as r } from "@unicom-cloud/utils/dayjs";
3
+ export {
4
+ i as convertToDurationBasedOnTimeUnits,
5
+ r as default
6
+ };
@@ -1,51 +1,49 @@
1
- import { NOOP as u } from "./constant.js";
2
- const f = function() {
1
+ import { NOOP as i } from "./constant.js";
2
+ const l = function() {
3
3
  try {
4
4
  return !(typeof window < "u" && document !== void 0);
5
5
  } catch {
6
6
  return !0;
7
7
  }
8
- }(), E = /* @__PURE__ */ function() {
9
- return f ? u : function(t, c, o, n) {
10
- var r;
11
- (r = t == null ? void 0 : t.addEventListener) == null || r.call(t, c, o, n || !1);
8
+ }(), w = /* @__PURE__ */ function() {
9
+ return l ? i : function(t, o, n, e) {
10
+ t?.addEventListener?.(o, n, e || !1);
12
11
  };
13
- }(), g = /* @__PURE__ */ function() {
14
- return f ? u : function(t, c, o, n) {
15
- var r;
16
- (r = t == null ? void 0 : t.removeEventListener) == null || r.call(t, c, o, n || !1);
12
+ }(), E = /* @__PURE__ */ function() {
13
+ return l ? i : function(t, o, n, e) {
14
+ t?.removeEventListener?.(o, n, e || !1);
17
15
  };
18
- }(), p = function(t, c) {
16
+ }(), g = function(t, o) {
19
17
  if (!t)
20
18
  return !1;
21
19
  if (t.contains)
22
- return t.contains(c);
23
- let o = c;
24
- for (; o; ) {
25
- if (o === t)
20
+ return t.contains(o);
21
+ let n = o;
22
+ for (; n; ) {
23
+ if (n === t)
26
24
  return !0;
27
- o = o.parentNode;
25
+ n = n.parentNode;
28
26
  }
29
27
  return !1;
30
28
  };
31
29
  function h(t) {
32
30
  if (!(t instanceof HTMLElement) || t === document.documentElement || t === window)
33
31
  return !1;
34
- const c = t === document.documentElement ? t.clientHeight : t.offsetHeight, o = t === document.documentElement ? t.clientWidth : t.offsetWidth, n = t.scrollHeight, r = t.scrollWidth, i = window.getComputedStyle(t), l = i.getPropertyValue("overflow-x"), d = i.getPropertyValue("overflow-y"), s = ["scroll", "auto"], e = n > c && s.includes(d), a = r > o && s.includes(l);
35
- return e || a;
32
+ const o = t === document.documentElement ? t.clientHeight : t.offsetHeight, n = t === document.documentElement ? t.clientWidth : t.offsetWidth, e = t.scrollHeight, s = t.scrollWidth, c = window.getComputedStyle(t), u = c.getPropertyValue("overflow-x"), f = c.getPropertyValue("overflow-y"), r = ["scroll", "auto"], d = e > o && r.includes(f), a = s > n && r.includes(u);
33
+ return d || a;
36
34
  }
37
- const v = (t, c = document.documentElement) => {
38
- const o = [];
39
- let n = t;
40
- for (; n && n !== c; )
41
- h(n) && o.push(n), n = n.parentElement;
42
- return o;
35
+ const p = (t, o = document.documentElement) => {
36
+ const n = [];
37
+ let e = t;
38
+ for (; e && e !== o; )
39
+ h(e) && n.push(e), e = e.parentElement;
40
+ return n;
43
41
  };
44
42
  export {
45
- p as contains,
46
- v as getScrollElements,
43
+ g as contains,
44
+ p as getScrollElements,
47
45
  h as isScrollElement,
48
- f as isServerRendering,
49
- g as off,
50
- E as on
46
+ l as isServerRendering,
47
+ E as off,
48
+ w as on
51
49
  };
@@ -0,0 +1,17 @@
1
+ function i(o, l = !1) {
2
+ if (!o) return document.documentElement;
3
+ const n = getComputedStyle(o), r = n.position === "absolute", c = l ? /(auto|scroll|hidden)/ : /(auto|scroll)/;
4
+ if (n.position === "fixed")
5
+ return document.documentElement;
6
+ for (let t = o; t = t.parentElement; ) {
7
+ const e = getComputedStyle(t);
8
+ if (!(r && e.position === "static") && (c.test(
9
+ e.overflow + e.overflowY + e.overflowX
10
+ ) || t.scrollHeight > t.clientHeight))
11
+ return t;
12
+ }
13
+ return document.documentElement;
14
+ }
15
+ export {
16
+ i as default
17
+ };
@@ -0,0 +1,21 @@
1
+ import a from "lodash/isFunction";
2
+ import f from "lodash/throttle";
3
+ function h(c, n) {
4
+ const t = [].concat(c).filter(Boolean);
5
+ if (!(t.length && a(n))) return () => {
6
+ };
7
+ const o = f((...e) => {
8
+ n(...e);
9
+ }), r = new IntersectionObserver(o);
10
+ return t.forEach((e, i, s) => {
11
+ r.observe(e);
12
+ }), () => {
13
+ t.forEach((e, i, s) => {
14
+ r.unobserve(e);
15
+ }), r.disconnect(), o.cancel();
16
+ };
17
+ }
18
+ export {
19
+ h as default,
20
+ h as intersectionObserver
21
+ };
@@ -1,126 +1,116 @@
1
- import { isPlainObject as y } from "@unicom-cloud/utils/is";
2
- import { isArguments as V, isArray as W, isArrayBuffer as h, isArrayLike as k, isArrayLikeObject as B, isBlob as j, isBoolean as I, isBuffer as Y, isColor as q, isColor2 as z, isDate as U, isElement as H, isEmpty as J, isEmptyArray as G, isEmptyObject as K, isEmptyValue as Q, isEqual as X, isEqualWith as Z, isError as ii, isFile as si, isFinite as ri, isFunction as ei, isInteger as ti, isJSON as oi, isLength as ai, isMap as ni, isMatch as fi, isMatchWith as ui, isNaN as pi, isNative as li, isNil as ci, isNull as yi, isNumber as di, isObject as Ri, isObjectLike as Ei, isPlainObject as mi, isPromise as Si, isReadableByteStreamControllerSupported as $i, isReadableStream as Ci, isReadableStreamDefaultControllerSupported as Mi, isReadableStreamSupported as bi, isReadableStreamSymbolAsyncIteratorSupported as Ai, isRegExp as Ni, isSafeInteger as Ti, isSet as Fi, isString as Pi, isSymbol as gi, isTypedArray as Oi, isUndefined as wi, isValidColor as xi, isWeakMap as _i, isWeakSet as Di } from "@unicom-cloud/utils/is";
3
- import { isDayjs as d } from "dayjs";
4
- import { isValidElement as n } from "react";
5
- import f from "react-dom";
6
- import { isForwardRef as u, ForwardRef as t, Memo as R } from "react-is";
7
- import { isAsyncMode as vi, isConcurrentMode as Vi, isContextConsumer as Wi, isContextProvider as hi, isElement as ki, isForwardRef as Bi, isFragment as ji, isLazy as Ii, isMemo as Yi, isPortal as qi, isProfiler as zi, isStrictMode as Ui, isSuspense as Hi, isValidElementType as Ji } from "react-is";
8
- function P(i) {
1
+ import { isPlainObject as l } from "@unicom-cloud/utils/is";
2
+ import { isArguments as L, isArray as v, isArrayBuffer as V, isArrayLike as W, isArrayLikeObject as h, isBlob as k, isBoolean as B, isBuffer as j, isColor as I, isColor2 as Y, isDate as q, isElement as z, isEmpty as U, isEmptyArray as H, isEmptyObject as J, isEmptyValue as G, isEqual as K, isEqualWith as Q, isError as X, isFile as Z, isFinite as ii, isFunction as si, isInteger as ri, isJSON as ei, isLength as ti, isMap as oi, isMatch as ai, isMatchWith as ni, isNaN as fi, isNative as ui, isNil as pi, isNull as li, isNumber as ci, isObject as yi, isObjectLike as di, isPlainObject as Ri, isPromise as Ei, isReadableByteStreamControllerSupported as mi, isReadableStream as Si, isReadableStreamDefaultControllerSupported as $i, isReadableStreamSupported as Ci, isReadableStreamSymbolAsyncIteratorSupported as Mi, isRegExp as bi, isSafeInteger as Ai, isSet as Ni, isString as Ti, isSymbol as Fi, isTypedArray as Pi, isUndefined as gi, isValidColor as Oi, isWeakMap as wi, isWeakSet as xi } from "@unicom-cloud/utils/is";
3
+ import { isDayjs as c } from "dayjs";
4
+ import { isValidElement as o } from "react";
5
+ import a from "react-dom";
6
+ import { isForwardRef as n, ForwardRef as t, Memo as y } from "react-is";
7
+ import { isAsyncMode as Di, isConcurrentMode as Li, isContextConsumer as vi, isContextProvider as Vi, isElement as Wi, isForwardRef as hi, isFragment as ki, isLazy as Bi, isMemo as ji, isPortal as Ii, isProfiler as Yi, isStrictMode as qi, isSuspense as zi, isValidElementType as Ui } from "react-is";
8
+ function T(i) {
9
9
  return i == null;
10
10
  }
11
- function g(i, s) {
11
+ function F(i, s) {
12
12
  return i == null || i === !1 || typeof i == "string" && (s ? i.trim() === "" : i === "");
13
13
  }
14
- function O(i) {
14
+ function P(i) {
15
15
  return i || i === 0;
16
16
  }
17
- function w(i) {
17
+ function g(i) {
18
18
  return i === window;
19
19
  }
20
- function x(i) {
21
- return i && d(i) && typeof i.isValid == "function" && i.isValid() && y(i) && "$y" in i && "$M" in i && "$D" in i && "$d" in i && "$H" in i && "$m" in i && "$s" in i;
20
+ function O(i) {
21
+ return i && c(i) && typeof i.isValid == "function" && i.isValid() && l(i) && "$y" in i && "$M" in i && "$D" in i && "$d" in i && "$H" in i && "$m" in i && "$s" in i;
22
22
  }
23
- const p = (i) => i && n(i) && typeof i.type == "function", E = (i) => {
24
- var s;
25
- return p(i) && !!((s = i.type.prototype) != null && s.isReactComponent);
26
- }, m = (i) => n(i) && typeof i.type == "string";
27
- var o;
28
- const _ = Number((o = f.version) == null ? void 0 : o.split(".")[0]) > 17;
29
- var a;
30
- const S = Number((a = f.version) == null ? void 0 : a.split(".")[0]) > 18, $ = (i) => {
31
- if (!S)
32
- return u(i);
33
- const s = Symbol.for("react.element"), l = Symbol.for("react.transitional.element"), c = Symbol.for("react.forward_ref");
23
+ const f = (i) => i && o(i) && typeof i.type == "function", d = (i) => f(i) && !!i.type.prototype?.isReactComponent, R = (i) => o(i) && typeof i.type == "string", w = Number(a.version?.split(".")[0]) > 17, E = Number(a.version?.split(".")[0]) > 18, m = (i) => {
24
+ if (!E)
25
+ return n(i);
26
+ const s = Symbol.for("react.element"), u = Symbol.for("react.transitional.element"), p = Symbol.for("react.forward_ref");
34
27
  if (typeof i == "object" && i !== null) {
35
28
  const r = i.$$typeof;
36
- if (r === s || r === l) {
29
+ if (r === s || r === u) {
37
30
  const e = i.type;
38
- return (e && e.$$typeof) === c;
31
+ return (e && e.$$typeof) === p;
39
32
  }
40
33
  }
41
34
  return !1;
42
- }, C = (i) => {
43
- var s;
44
- return i ? m(i) || $(i) || u(i) || i.$$typeof === t ? !0 : i.$$typeof === R ? ((s = i.type) == null ? void 0 : s.$$typeof) === t : p(i) ? E(i) : !1 : !1;
45
- }, D = C;
35
+ }, S = (i) => i ? R(i) || m(i) || n(i) || i.$$typeof === t ? !0 : i.$$typeof === y ? i.type?.$$typeof === t : f(i) ? d(i) : !1 : !1, x = S;
46
36
  export {
47
- V as isArguments,
48
- W as isArray,
49
- h as isArrayBuffer,
50
- k as isArrayLike,
51
- B as isArrayLikeObject,
52
- j as isBlob,
53
- I as isBoolean,
54
- Y as isBuffer,
55
- E as isClassComponent,
56
- q as isColor,
57
- z as isColor2,
58
- m as isDOMElement,
59
- U as isDate,
60
- x as isDayjs,
61
- H as isElement,
62
- J as isEmpty,
63
- G as isEmptyArray,
64
- K as isEmptyObject,
65
- g as isEmptyReactNode,
66
- Q as isEmptyValue,
67
- X as isEqual,
68
- Z as isEqualWith,
69
- ii as isError,
70
- O as isExist,
71
- si as isFile,
72
- ri as isFinite,
73
- $ as isForwardRefReact,
74
- ei as isFunction,
75
- ti as isInteger,
76
- oi as isJSON,
77
- ai as isLength,
78
- ni as isMap,
79
- fi as isMatch,
80
- ui as isMatchWith,
81
- pi as isNaN,
82
- li as isNative,
83
- ci as isNil,
84
- yi as isNull,
85
- P as isNullOrUndefined,
86
- di as isNumber,
87
- Ri as isObject,
88
- Ei as isObjectLike,
89
- mi as isPlainObject,
90
- Si as isPromise,
91
- _ as isReact18,
92
- S as isReact19,
93
- vi as isReactAsyncMode,
94
- p as isReactComponent,
95
- Vi as isReactConcurrentMode,
96
- Wi as isReactContextConsumer,
97
- hi as isReactContextProvider,
98
- ki as isReactElement,
99
- Bi as isReactForwardRef,
100
- ji as isReactFragment,
101
- Ii as isReactLazy,
102
- Yi as isReactMemo,
103
- qi as isReactPortal,
104
- zi as isReactProfiler,
105
- Ui as isReactStrictMode,
106
- Hi as isReactSuspense,
107
- Ji as isReactValidElementType,
108
- $i as isReadableByteStreamControllerSupported,
109
- Ci as isReadableStream,
110
- Mi as isReadableStreamDefaultControllerSupported,
111
- bi as isReadableStreamSupported,
112
- Ai as isReadableStreamSymbolAsyncIteratorSupported,
113
- Ni as isRegExp,
114
- Ti as isSafeInteger,
115
- Fi as isSet,
116
- Pi as isString,
117
- D as isSupportRef,
118
- gi as isSymbol,
119
- Oi as isTypedArray,
120
- wi as isUndefined,
121
- xi as isValidColor,
122
- _i as isWeakMap,
123
- Di as isWeakSet,
124
- w as isWindow,
125
- C as supportRef
37
+ L as isArguments,
38
+ v as isArray,
39
+ V as isArrayBuffer,
40
+ W as isArrayLike,
41
+ h as isArrayLikeObject,
42
+ k as isBlob,
43
+ B as isBoolean,
44
+ j as isBuffer,
45
+ d as isClassComponent,
46
+ I as isColor,
47
+ Y as isColor2,
48
+ R as isDOMElement,
49
+ q as isDate,
50
+ O as isDayjs,
51
+ z as isElement,
52
+ U as isEmpty,
53
+ H as isEmptyArray,
54
+ J as isEmptyObject,
55
+ F as isEmptyReactNode,
56
+ G as isEmptyValue,
57
+ K as isEqual,
58
+ Q as isEqualWith,
59
+ X as isError,
60
+ P as isExist,
61
+ Z as isFile,
62
+ ii as isFinite,
63
+ m as isForwardRefReact,
64
+ si as isFunction,
65
+ ri as isInteger,
66
+ ei as isJSON,
67
+ ti as isLength,
68
+ oi as isMap,
69
+ ai as isMatch,
70
+ ni as isMatchWith,
71
+ fi as isNaN,
72
+ ui as isNative,
73
+ pi as isNil,
74
+ li as isNull,
75
+ T as isNullOrUndefined,
76
+ ci as isNumber,
77
+ yi as isObject,
78
+ di as isObjectLike,
79
+ Ri as isPlainObject,
80
+ Ei as isPromise,
81
+ w as isReact18,
82
+ E as isReact19,
83
+ Di as isReactAsyncMode,
84
+ f as isReactComponent,
85
+ Li as isReactConcurrentMode,
86
+ vi as isReactContextConsumer,
87
+ Vi as isReactContextProvider,
88
+ Wi as isReactElement,
89
+ hi as isReactForwardRef,
90
+ ki as isReactFragment,
91
+ Bi as isReactLazy,
92
+ ji as isReactMemo,
93
+ Ii as isReactPortal,
94
+ Yi as isReactProfiler,
95
+ qi as isReactStrictMode,
96
+ zi as isReactSuspense,
97
+ Ui as isReactValidElementType,
98
+ mi as isReadableByteStreamControllerSupported,
99
+ Si as isReadableStream,
100
+ $i as isReadableStreamDefaultControllerSupported,
101
+ Ci as isReadableStreamSupported,
102
+ Mi as isReadableStreamSymbolAsyncIteratorSupported,
103
+ bi as isRegExp,
104
+ Ai as isSafeInteger,
105
+ Ni as isSet,
106
+ Ti as isString,
107
+ x as isSupportRef,
108
+ Fi as isSymbol,
109
+ Pi as isTypedArray,
110
+ gi as isUndefined,
111
+ Oi as isValidColor,
112
+ wi as isWeakMap,
113
+ xi as isWeakSet,
114
+ g as isWindow,
115
+ S as supportRef
126
116
  };
@@ -0,0 +1,19 @@
1
+ import s from "lodash/isFunction";
2
+ import u from "lodash/throttle";
3
+ function m(i, e) {
4
+ const r = [].concat(i).filter(Boolean);
5
+ if (!(r.length && s(e))) return () => {
6
+ };
7
+ const o = u((...t) => {
8
+ e(...t);
9
+ }), n = new MutationObserver(o);
10
+ return r.forEach((t, c, a) => {
11
+ n.observe(t, { attributes: !0, childList: !0, subtree: !0 });
12
+ }), () => {
13
+ n.disconnect(), o.cancel();
14
+ };
15
+ }
16
+ export {
17
+ m as default,
18
+ m as mutationObserver
19
+ };
@@ -1,46 +1,46 @@
1
- import { Component as n } from "react";
2
- import u, { findDOMNode as f } from "react-dom";
3
- import { isReact18 as a } from "./is.js";
4
- import { warning as s } from "./warning.js";
5
- import { isFunction as i } from "@unicom-cloud/utils/is";
6
- const p = u;
7
- let e;
1
+ import { Component as c } from "react";
2
+ import a, { findDOMNode as r } from "react-dom";
3
+ import { isReact18 as s } from "./is.js";
4
+ import { warning as u } from "./warning.js";
5
+ import { isFunction as f } from "@unicom-cloud/utils/is";
6
+ const d = a;
7
+ let n;
8
8
  try {
9
- e = p.createRoot;
9
+ n = d.createRoot;
10
10
  } catch {
11
11
  }
12
- let r;
13
- function R(o) {
14
- const t = o.constructor;
15
- if (typeof t != "function")
12
+ let e;
13
+ function p(t) {
14
+ const o = t.constructor;
15
+ if (typeof o != "function")
16
16
  return !1;
17
- !r && typeof WeakSet == "function" && (r = /* @__PURE__ */ new WeakSet());
18
- const c = !!(r != null && r.has(t));
19
- return r == null || r.add(t), c;
17
+ !e && typeof WeakSet == "function" && (e = /* @__PURE__ */ new WeakSet());
18
+ const i = !!e?.has(o);
19
+ return e?.add(o), i;
20
20
  }
21
- const N = (o, t) => {
22
- if (o) {
23
- if (o instanceof Element)
24
- return o;
25
- if (o.current instanceof Element)
26
- return o.current;
27
- if (i(o.getRootDOMNode))
28
- return o.getRootDOMNode();
29
- if (o instanceof n && f)
30
- return f(o);
21
+ const N = (t, o) => {
22
+ if (t) {
23
+ if (t instanceof Element)
24
+ return t;
25
+ if (t.current instanceof Element)
26
+ return t.current;
27
+ if (f(t.getRootDOMNode))
28
+ return t.getRootDOMNode();
29
+ if (t instanceof c && r)
30
+ return r(t);
31
31
  }
32
- return t && (s(
33
- a && !R(t),
32
+ return o && (u(
33
+ s && !p(o),
34
34
  "Element does not define the `getRootDOMNode` method causing a call to React.findDOMNode. but findDOMNode is deprecated in StrictMode. Please check the code logic",
35
- { element: o, instance: t }
36
- ), f) ? f(t) : null;
37
- }, m = (o, t) => {
38
- o && o.ref && (i(o.ref) && (o == null || o.ref(t)), "current" in o.ref && (o.ref.current = t));
39
- }, y = (o) => {
40
- e = o;
35
+ { element: t, instance: o }
36
+ ), r) ? r(o) : null;
37
+ }, m = (t, o) => {
38
+ t && t.ref && (f(t.ref) && t?.ref(o), "current" in t.ref && (t.ref.current = o));
39
+ }, k = (t) => {
40
+ n = t;
41
41
  };
42
42
  export {
43
43
  m as callbackOriginRef,
44
44
  N as findDOMNode_,
45
- y as setCreateRoot
45
+ k as setCreateRoot
46
46
  };
@@ -0,0 +1,21 @@
1
+ import a from "lodash/isFunction";
2
+ import f from "lodash/throttle";
3
+ function h(s, t) {
4
+ const r = [].concat(s).filter(Boolean);
5
+ if (!(r.length && a(t))) return () => {
6
+ };
7
+ const n = f((...e) => {
8
+ t(...e);
9
+ }), o = new ResizeObserver(n);
10
+ return r.forEach((e, i, c) => {
11
+ o.observe(e);
12
+ }), () => {
13
+ r.forEach((e, i, c) => {
14
+ o.unobserve(e);
15
+ }), o.disconnect(), n.cancel();
16
+ };
17
+ }
18
+ export {
19
+ h as default,
20
+ h as resizeObserver
21
+ };