@unicom-cloud/ui 0.8.100 → 0.8.101

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 (188) hide show
  1. package/Details.js +13 -2
  2. package/Divider.js +3 -2
  3. package/Flex.js +14 -4
  4. package/Loading.js +16 -3
  5. package/Space.js +3 -3
  6. package/Splitter.js +4 -3
  7. package/SuspenseFallbackTest.js +2 -4
  8. package/alert/index.js +60 -62
  9. package/back-top/index.js +32 -33
  10. package/calendar/index.js +85 -84
  11. package/components/common/development/index.js +44 -29
  12. package/components/common/empty/index.js +35 -23
  13. package/components/common/flex/index.js +64 -0
  14. package/components/common/flex/interface.js +9 -0
  15. package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
  16. package/components/common/space/index.js +71 -91
  17. package/components/common/suspense-fallback-test/index.js +16 -0
  18. package/components/common/utils/toArray.js +12 -0
  19. package/details/index.js +102 -62
  20. package/divider/index.js +27 -21
  21. package/empty/index.js +13 -13
  22. package/flex/index.js +43 -55
  23. package/flex/interface.js +1 -34
  24. package/icon/interface.js +1 -0
  25. package/icon-hover/interface.js +1 -0
  26. package/index.js +537 -536
  27. package/loading/index.js +72 -53
  28. package/loading/interface.js +1 -0
  29. package/modal/Modal.js +73 -74
  30. package/package.json +1 -1
  31. package/portal/interface.js +1 -0
  32. package/segmented/index.js +47 -47
  33. package/space/index.js +41 -35
  34. package/speech-synthesis/interface.js +1 -0
  35. package/splitter/Splitter.js +85 -89
  36. package/splitter/hooks/useItems.js +1 -1
  37. package/splitter/index.js +5 -4
  38. package/style.css +1 -1
  39. package/suspense-fallback-test/index.js +2 -11
  40. package/suspense-fallback-test/interface.js +1 -0
  41. package/table/Table.js +38 -38
  42. package/trigger/index.js +67 -70
  43. package/types/common/development/index.d.ts +7 -1
  44. package/types/common/development/interface.d.ts +22 -0
  45. package/types/common/empty/index.d.ts +2 -1
  46. package/types/common/flex/index.d.ts +14 -0
  47. package/types/common/flex/interface.d.ts +62 -0
  48. package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
  49. package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
  50. package/types/common/space/index.d.ts +4 -4
  51. package/types/common/space/interface.d.ts +10 -18
  52. package/types/common/suspense-fallback-test/index.d.ts +7 -0
  53. package/types/common/suspense-fallback-test/interface.d.ts +1 -0
  54. package/types/common/utils/PqbCSSTransition.d.ts +1 -1
  55. package/types/common/utils/toArray.d.ts +13 -0
  56. package/types/pc/alert/index.d.ts +2 -1
  57. package/types/pc/alert/interface.d.ts +7 -1
  58. package/types/pc/badge/Count.d.ts +1 -1
  59. package/types/pc/breadcrumb/Item.d.ts +1 -1
  60. package/types/pc/calendar/Month.d.ts +1 -1
  61. package/types/pc/calendar/WeekList.d.ts +1 -1
  62. package/types/pc/calendar/Year.d.ts +1 -1
  63. package/types/pc/calendar/header/Panel.d.ts +1 -1
  64. package/types/pc/calendar/header/index.d.ts +1 -1
  65. package/types/pc/calendar/index.d.ts +1 -1
  66. package/types/pc/calendar/interface.d.ts +2 -1
  67. package/types/pc/cascader/interface.d.ts +1 -1
  68. package/types/pc/cascader/panel/List.d.ts +1 -1
  69. package/types/pc/cascader/panel/Option.d.ts +1 -1
  70. package/types/pc/cascader/panel/Search.d.ts +1 -1
  71. package/types/pc/checkbox/Group.d.ts +2 -2
  72. package/types/pc/checkbox/GroupBlock.d.ts +1 -1
  73. package/types/pc/checkbox/IconCheck.d.ts +1 -1
  74. package/types/pc/color-picker/InputRgb.d.ts +1 -1
  75. package/types/pc/color-picker/Palette.d.ts +1 -1
  76. package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
  77. package/types/pc/config-provider/interface.d.ts +4 -0
  78. package/types/pc/copy/index.d.ts +1 -1
  79. package/types/pc/date-picker/panel/Body.d.ts +1 -1
  80. package/types/pc/date-picker/panel/Footer.d.ts +1 -1
  81. package/types/pc/date-picker/panel/Header.d.ts +1 -1
  82. package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
  83. package/types/pc/date-picker/panel/date/index.d.ts +1 -1
  84. package/types/pc/date-picker/panel/month/index.d.ts +1 -1
  85. package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
  86. package/types/pc/date-picker/panel/range/index.d.ts +1 -1
  87. package/types/pc/date-picker/panel/week/index.d.ts +1 -1
  88. package/types/pc/date-picker/panel/year/index.d.ts +1 -1
  89. package/types/pc/descriptions/index.d.ts +1 -1
  90. package/types/pc/details/index.d.ts +3 -2
  91. package/types/pc/details/interface.d.ts +16 -0
  92. package/types/pc/development/index.d.ts +2 -1
  93. package/types/pc/development/interface.d.ts +15 -0
  94. package/types/pc/divider/index.d.ts +7 -2
  95. package/types/pc/draggable/Item.d.ts +1 -1
  96. package/types/pc/draggable/index.d.ts +1 -1
  97. package/types/pc/flex/index.d.ts +4 -4
  98. package/types/pc/flex/interface.d.ts +8 -53
  99. package/types/pc/form/Control.d.ts +1 -1
  100. package/types/pc/form/FormList.d.ts +1 -1
  101. package/types/pc/form/IconSymbol.d.ts +1 -1
  102. package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
  103. package/types/pc/icon/index.d.ts +2 -7
  104. package/types/pc/icon/interface.d.ts +13 -0
  105. package/types/pc/icon-hover/index.d.ts +2 -8
  106. package/types/pc/icon-hover/interface.d.ts +8 -0
  107. package/types/pc/image/ImageFooter.d.ts +1 -1
  108. package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
  109. package/types/pc/image/TriggerForToolbar.d.ts +1 -1
  110. package/types/pc/index.d.ts +60 -51
  111. package/types/pc/loading/index.d.ts +4 -3
  112. package/types/pc/loading/interface.d.ts +6 -0
  113. package/types/pc/menu/Indent.d.ts +1 -1
  114. package/types/pc/menu/OverflowWrap.d.ts +1 -1
  115. package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
  116. package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
  117. package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
  118. package/types/pc/overflow-ellipsis/index.d.ts +1 -1
  119. package/types/pc/pagination/PageItem.d.ts +3 -3
  120. package/types/pc/pagination/PageJumper.d.ts +1 -1
  121. package/types/pc/pagination/PageOption.d.ts +1 -1
  122. package/types/pc/portal/Portal.d.ts +2 -6
  123. package/types/pc/portal/index.d.ts +2 -9
  124. package/types/pc/portal/interface.d.ts +14 -0
  125. package/types/pc/progress/CircleProgress.d.ts +1 -1
  126. package/types/pc/progress/LineProgess.d.ts +1 -1
  127. package/types/pc/progress/StepProgress.d.ts +1 -1
  128. package/types/pc/radio/Group.d.ts +2 -2
  129. package/types/pc/radio/GroupBlock.d.ts +1 -1
  130. package/types/pc/radio/Radio.d.ts +1 -1
  131. package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
  132. package/types/pc/result/403.d.ts +1 -1
  133. package/types/pc/result/404.d.ts +1 -1
  134. package/types/pc/result/500.d.ts +1 -1
  135. package/types/pc/segmented/interface.d.ts +6 -6
  136. package/types/pc/skeleton/Image.d.ts +1 -1
  137. package/types/pc/skeleton/Text.d.ts +2 -1
  138. package/types/pc/slider/Button.d.ts +1 -1
  139. package/types/pc/slider/Input.d.ts +1 -1
  140. package/types/pc/slider/Tick.d.ts +1 -1
  141. package/types/pc/space/index.d.ts +6 -5
  142. package/types/pc/speech-synthesis/index.d.ts +3 -1
  143. package/types/pc/speech-synthesis/interface.d.ts +7 -0
  144. package/types/pc/spin/DotLoading.d.ts +1 -1
  145. package/types/pc/splitter/index.d.ts +5 -4
  146. package/types/pc/splitter/interface.d.ts +16 -16
  147. package/types/pc/suspense-fallback-test/index.d.ts +2 -3
  148. package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
  149. package/types/pc/table/ColGroup.d.ts +1 -1
  150. package/types/pc/table/summary/Cell.d.ts +1 -1
  151. package/types/pc/table/summary/Row.d.ts +1 -1
  152. package/types/pc/table/tbody/Td.d.ts +1 -1
  153. package/types/pc/table/tbody/index.d.ts +1 -1
  154. package/types/pc/table/tfoot/index.d.ts +1 -1
  155. package/types/pc/table/th-resizable/index.d.ts +1 -1
  156. package/types/pc/table/thead/Column.d.ts +1 -1
  157. package/types/pc/table/thead/index.d.ts +1 -1
  158. package/types/pc/tabs/TabContent.d.ts +1 -1
  159. package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
  160. package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
  161. package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
  162. package/types/pc/time-picker/Picker.d.ts +1 -1
  163. package/types/pc/time-picker/RangePicker.d.ts +1 -1
  164. package/types/pc/time-picker/TimeColumn.d.ts +1 -1
  165. package/types/pc/time-picker/TimePicker.d.ts +1 -1
  166. package/types/pc/time-picker/index.d.ts +1 -1
  167. package/types/pc/transfer/Item.d.ts +1 -1
  168. package/types/pc/transfer/List.d.ts +1 -1
  169. package/types/pc/tree/Animation.d.ts +1 -1
  170. package/types/pc/typography/Operations.d.ts +1 -1
  171. package/types/pc/upload/list/index.d.ts +1 -1
  172. package/types/pc/utils/toArray.d.ts +1 -5
  173. package/types/pc/verification-code/VerificationCode.d.ts +1 -1
  174. package/types/pc/virtual-list/VirtualList.d.ts +2 -38
  175. package/types/pc/virtual-list/index.d.ts +2 -1
  176. package/types/pc/virtual-list/interface.d.ts +56 -0
  177. package/types/pc/watermark/Watermark.d.ts +1 -1
  178. package/utils/index.js +1 -1
  179. package/utils/toArray.js +3 -10
  180. package/version/index.js +1 -1
  181. package/virtual-list/interface.js +1 -0
  182. package/components/common/space/toArray.js +0 -11
  183. package/flex/utils.js +0 -13
  184. package/loading/style/index.module.less.js +0 -4
  185. package/types/common/space/toArray.d.ts +0 -3
  186. package/types/pc/flex/utils.d.ts +0 -9
  187. package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
  188. /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
package/Details.js CHANGED
@@ -6,10 +6,21 @@ import "@unicom-cloud/icons/IconUiExclamationCircleFill";
6
6
  import "@unicom-cloud/icons/IconUiInfoCircleFill";
7
7
  import "react";
8
8
  import "./config-provider/ConfigProvider.js";
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";
9
16
  import "./components/common/hooks/useMergeProps.js";
17
+ import "./components/common/utils/reactDOM.js";
18
+ import "@unicom-cloud/utils/constant";
19
+ import "./components/common/hooks/useUpdateEffect.js";
20
+ import "lodash/debounce";
10
21
  import "@unicom-cloud/utils/class-name";
11
22
  import "./config-provider/context.js";
12
- import { default as b } from "./details/index.js";
23
+ import { default as y } from "./details/index.js";
13
24
  export {
14
- b as default
25
+ y as default
15
26
  };
package/Divider.js CHANGED
@@ -4,7 +4,8 @@ import "./config-provider/ConfigProvider.js";
4
4
  import "./components/common/hooks/useMergeProps.js";
5
5
  import "@unicom-cloud/utils/class-name";
6
6
  import "./config-provider/context.js";
7
- import { default as a } from "./divider/index.js";
7
+ import { DividerVertical as d, default as f } from "./divider/index.js";
8
8
  export {
9
- a as default
9
+ d as DividerVertical,
10
+ f as default
10
11
  };
package/Flex.js CHANGED
@@ -1,12 +1,22 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
+ import "./components/common/flex/index.js";
3
4
  import "./config-provider/ConfigProvider.js";
5
+ import "lodash/isEqualWith";
6
+ import "./components/common/utils/is.js";
7
+ import "@unicom-cloud/utils/constant/keyboardCode";
8
+ import "lodash/isNumber";
9
+ import "lodash/merge";
10
+ import "./components/common/utils/dom.js";
11
+ import "./components/common/hooks/useIntersectionObserver.js";
4
12
  import "./components/common/hooks/useMergeProps.js";
13
+ import "./components/common/utils/reactDOM.js";
14
+ import "@unicom-cloud/utils/constant";
15
+ import "lodash/debounce";
5
16
  import "@unicom-cloud/utils/class-name";
6
- import "./flex/utils.js";
7
17
  import "./config-provider/context.js";
8
- import { FlexVertical as f, default as x } from "./flex/index.js";
18
+ import { FlexVertical as j, default as k } from "./flex/index.js";
9
19
  export {
10
- f as FlexVertical,
11
- x as default
20
+ j as FlexVertical,
21
+ k as default
12
22
  };
package/Loading.js CHANGED
@@ -1,7 +1,20 @@
1
1
  import "react/jsx-runtime";
2
- import "./loading/style/index.module.less.js";
3
2
  import "react";
4
- import { default as i } from "./loading/index.js";
3
+ import "./config-provider/ConfigProvider.js";
4
+ import "lodash/isEqualWith";
5
+ import "./components/common/utils/is.js";
6
+ import "@unicom-cloud/utils/constant/keyboardCode";
7
+ import "lodash/isNumber";
8
+ import "lodash/merge";
9
+ import "./components/common/utils/dom.js";
10
+ import "./components/common/hooks/useIntersectionObserver.js";
11
+ import "./components/common/hooks/useMergeProps.js";
12
+ import "./components/common/utils/reactDOM.js";
13
+ import "@unicom-cloud/utils/constant";
14
+ import "lodash/debounce";
15
+ import "@unicom-cloud/utils/class-name";
16
+ import "./config-provider/context.js";
17
+ import { default as k } from "./loading/index.js";
5
18
  export {
6
- i as default
19
+ k as default
7
20
  };
package/Space.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { SpaceVertical as h } from "./components/common/space/index.js";
3
+ import "./components/common/space/index.js";
4
4
  import "./config-provider/ConfigProvider.js";
5
5
  import "lodash/isEqualWith";
6
6
  import "./components/common/utils/is.js";
@@ -15,8 +15,8 @@ import "@unicom-cloud/utils/constant";
15
15
  import "lodash/debounce";
16
16
  import "@unicom-cloud/utils/class-name";
17
17
  import "./config-provider/context.js";
18
- import { default as k } from "./space/index.js";
18
+ import { SpaceVertical as j, default as k } from "./space/index.js";
19
19
  export {
20
- h as SpaceVertical,
20
+ j as SpaceVertical,
21
21
  k as default
22
22
  };
package/Splitter.js CHANGED
@@ -1,6 +1,7 @@
1
- import "./splitter/Panel.js";
1
+ import { default as o } from "./splitter/Panel.js";
2
2
  import "./splitter/Splitter.js";
3
- import { default as p } from "./splitter/index.js";
3
+ import { default as f } from "./splitter/index.js";
4
4
  export {
5
- p as default
5
+ o as SplitterPanel,
6
+ f as default
6
7
  };
@@ -1,6 +1,4 @@
1
- import "./suspense-fallback-test/style/index.less.js";
2
- import "react";
3
- import { default as p } from "./suspense-fallback-test/index.js";
1
+ import { default as o } from "./components/common/suspense-fallback-test/index.js";
4
2
  export {
5
- p as default
3
+ o as default
6
4
  };
package/alert/index.js CHANGED
@@ -1,92 +1,91 @@
1
- import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
- import j from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
- import k from "@unicom-cloud/icons/IconUiClose";
4
- import T from "@unicom-cloud/icons/IconUiCloseCircleFill";
5
- import _ from "@unicom-cloud/icons/IconUiExclamationCircleFill";
6
- import c from "@unicom-cloud/icons/IconUiInfoCircleFill";
7
- import { forwardRef as q, useContext as z, useState as H } from "react";
1
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
+ import k from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
+ import M from "@unicom-cloud/icons/IconUiClose";
4
+ import q from "@unicom-cloud/icons/IconUiCloseCircleFill";
5
+ import z from "@unicom-cloud/icons/IconUiExclamationCircleFill";
6
+ import i from "@unicom-cloud/icons/IconUiInfoCircleFill";
7
+ import { forwardRef as B, useContext as O, useState as R } from "react";
8
8
  import "../config-provider/ConfigProvider.js";
9
- import M from "../components/common/hooks/useMergeProps.js";
10
- import O from "@unicom-cloud/utils/class-name";
11
- import { PqbCSSTransition as R } from "../components/common/utils/PqbCSSTransition.js";
12
- import V from "../config-provider/context.js";
13
- const B = {
9
+ import V from "../components/common/hooks/useMergeProps.js";
10
+ import D from "@unicom-cloud/utils/class-name";
11
+ import { PqbCSSTransition as G } from "../components/common/utils/PqbCSSTransition.js";
12
+ import H from "../config-provider/context.js";
13
+ const J = {
14
14
  showIcon: !0,
15
15
  type: "default"
16
- };
17
- function D(a, m) {
18
- const { getPrefixCls: p, componentConfig: f, rtl: d } = z(V), n = M(
16
+ }, K = {
17
+ default: /* @__PURE__ */ o(i, {}),
18
+ info: /* @__PURE__ */ o(i, {}),
19
+ success: /* @__PURE__ */ o(k, {}),
20
+ warning: /* @__PURE__ */ o(z, {}),
21
+ error: /* @__PURE__ */ o(q, {})
22
+ }, L = (a, m) => {
23
+ const { getPrefixCls: p, componentConfig: f, rtl: d } = O(H), n = V(
19
24
  a,
20
- B,
25
+ J,
21
26
  f?.Alert
22
27
  ), {
23
28
  style: u,
24
29
  className: C,
25
30
  action: l,
26
- type: s,
31
+ type: s = "default",
27
32
  title: t,
28
- content: i,
29
- icon: N,
30
- showIcon: b,
31
- closable: h,
32
- closeable: $,
33
- afterClose: x,
34
- onClose: I,
35
- closeElement: v,
36
- banner: w,
33
+ children: h,
34
+ content: N,
35
+ icon: b,
36
+ showIcon: $,
37
+ closable: I,
38
+ closeable: x,
39
+ afterClose: w,
40
+ onClose: v,
41
+ closeElement: y = /* @__PURE__ */ o(M, {}),
42
+ banner: P,
37
43
  ...g
38
- } = n, o = p?.("alert"), [y, U] = H(!0), E = N || {
39
- default: /* @__PURE__ */ e(c, {}),
40
- info: /* @__PURE__ */ e(c, {}),
41
- success: /* @__PURE__ */ e(j, {}),
42
- warning: /* @__PURE__ */ e(_, {}),
43
- error: /* @__PURE__ */ e(T, {})
44
- }[s];
45
- function F(S) {
46
- U(!1), I?.(S);
47
- }
48
- const P = O(
49
- o,
50
- `${o}-${s}`,
44
+ } = n, r = h ?? N, e = p?.("alert") || "alert", [U, A] = R(!0), E = (j) => {
45
+ A(!1), v?.(j);
46
+ }, F = "closeable" in n ? x : I, S = D(
47
+ e,
48
+ `${e}-${s}`,
51
49
  {
52
- [`${o}-with-title`]: t,
53
- [`${o}-banner`]: w,
54
- [`${o}-rtl`]: d
50
+ [`${e}-with-title`]: !!t,
51
+ [`${e}-banner`]: P,
52
+ [`${e}-rtl`]: d
55
53
  },
56
54
  C
57
- ), A = "closeable" in n ? $ : h;
58
- return /* @__PURE__ */ e(
59
- R,
55
+ ), T = b ?? K[s];
56
+ return /* @__PURE__ */ o(
57
+ G,
60
58
  {
61
- in: y,
59
+ in: U,
62
60
  timeout: 300,
63
61
  classNames: "zoomInTop",
64
62
  unmountOnExit: !0,
65
63
  onExited: () => {
66
- x?.();
64
+ w?.();
67
65
  },
68
- children: /* @__PURE__ */ r(
66
+ children: /* @__PURE__ */ c(
69
67
  "div",
70
68
  {
71
69
  ref: m,
72
70
  style: u,
73
- className: P,
71
+ className: S,
74
72
  role: "alert",
75
73
  ...g,
76
74
  children: [
77
- b && /* @__PURE__ */ e("div", { className: `${o}-icon-wrapper`, children: E }),
78
- /* @__PURE__ */ r("div", { className: `${o}-content-wrapper`, children: [
79
- t && /* @__PURE__ */ e("div", { className: `${o}-title`, children: t }),
80
- i && /* @__PURE__ */ e("div", { className: `${o}-content`, children: i })
75
+ $ && /* @__PURE__ */ o("div", { className: `${e}-icon-wrapper`, children: T }),
76
+ /* @__PURE__ */ c("div", { className: `${e}-content-wrapper`, children: [
77
+ t && /* @__PURE__ */ o("div", { className: `${e}-title`, children: t }),
78
+ r && /* @__PURE__ */ o("div", { className: `${e}-content`, children: r })
81
79
  ] }),
82
- l && /* @__PURE__ */ e("div", { className: `${o}-action`, children: l }),
83
- A && /* @__PURE__ */ e(
80
+ l && /* @__PURE__ */ o("div", { className: `${e}-action`, children: l }),
81
+ F && /* @__PURE__ */ o(
84
82
  "button",
85
83
  {
86
84
  type: "button",
87
- onClick: F,
88
- className: `${o}-close-btn`,
89
- children: v || /* @__PURE__ */ e(k, {})
85
+ onClick: E,
86
+ className: `${e}-close-btn`,
87
+ "aria-label": "Close alert",
88
+ children: y
90
89
  }
91
90
  )
92
91
  ]
@@ -94,9 +93,8 @@ function D(a, m) {
94
93
  )
95
94
  }
96
95
  );
97
- }
98
- const G = q(D);
99
- G.displayName = "Alert";
96
+ }, Q = B(L);
97
+ Q.displayName = "Alert";
100
98
  export {
101
- G as default
99
+ Q as default
102
100
  };
package/back-top/index.js CHANGED
@@ -2,40 +2,39 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import C from "@unicom-cloud/icons/IconUiToTop";
3
3
  import { Tween as v } from "../dist/tween/src/tween.js";
4
4
  import { quartOut as k } from "../dist/tween/src/easing.js";
5
- import x, { forwardRef as y, useRef as B, useContext as E, useState as N, useEffect as H } from "react";
5
+ import x, { forwardRef as y, useContext as B, useState as E, useEffect as N } from "react";
6
6
  import "../config-provider/ConfigProvider.js";
7
- import P from "../components/common/hooks/useKeyboardEvent.js";
8
- import R from "../components/common/hooks/useMergeProps.js";
9
- import { PqbCSSTransition as S } from "../components/common/utils/PqbCSSTransition.js";
10
- import q from "@unicom-cloud/utils/class-name";
11
- import { on as $, off as D } from "../components/common/utils/dom.js";
12
- import { pickDataAttributes as I } from "../components/common/utils/pick.js";
13
- import { throttleByRaf as K } from "../components/common/utils/throttleByRaf.js";
14
- import O from "../config-provider/context.js";
15
- function U(p, i) {
16
- i ||= B();
7
+ import H from "../components/common/hooks/useKeyboardEvent.js";
8
+ import P from "../components/common/hooks/useMergeProps.js";
9
+ import { PqbCSSTransition as R } from "../components/common/utils/PqbCSSTransition.js";
10
+ import S from "@unicom-cloud/utils/class-name";
11
+ import { on as q, off as $ } from "../components/common/utils/dom.js";
12
+ import { pickDataAttributes as D } from "../components/common/utils/pick.js";
13
+ import { throttleByRaf as I } from "../components/common/utils/throttleByRaf.js";
14
+ import K from "../config-provider/context.js";
15
+ function O(m, p) {
17
16
  const f = {
18
17
  visibleHeight: 400,
19
18
  tween: !0,
20
19
  easing: k,
21
20
  duration: 400,
22
21
  target: () => window
23
- }, { getPrefixCls: u, componentConfig: d, rtl: g } = E(O), T = P(), o = R(
24
- p,
22
+ }, { getPrefixCls: u, componentConfig: d, rtl: g } = B(K), T = H(), o = P(
23
+ m,
25
24
  f,
26
25
  d?.BackTop
27
- ), s = u?.("backtop"), [b, w] = N(!1), l = (e) => e === window ? document.documentElement : e;
28
- H(() => {
29
- const e = o.target?.(), t = K(() => {
30
- const n = o.visibleHeight, a = l(e).scrollTop;
31
- w(a >= n);
26
+ ), s = u?.("backtop"), [b, w] = E(!1), i = (e) => e === window ? document.documentElement : e;
27
+ N(() => {
28
+ const e = o.target?.(), t = I(() => {
29
+ const n = o.visibleHeight, c = i(e).scrollTop;
30
+ w(c >= n);
32
31
  });
33
- return $(e, "scroll", t), t(), () => {
34
- t.cancel?.(), D(e, "scroll", t);
32
+ return q(e, "scroll", t), t(), () => {
33
+ t.cancel?.(), $(e, "scroll", t);
35
34
  };
36
35
  }, [o.target, o.visibleHeight]);
37
- const c = () => {
38
- const e = o.target?.(), t = l(e), n = t.scrollTop;
36
+ const l = () => {
37
+ const e = o.target?.(), t = i(e), n = t.scrollTop;
39
38
  window.getComputedStyle(t)?.scrollBehavior === "smooth" || o.tween === !1 ? t.scrollTo(0, 0) : new v({
40
39
  from: { scrollTop: n },
41
40
  to: { scrollTop: 0 },
@@ -49,20 +48,20 @@ function U(p, i) {
49
48
  return /* @__PURE__ */ r(
50
49
  "div",
51
50
  {
52
- ...I(o),
53
- ref: i,
54
- className: q(
51
+ ...D(o),
52
+ ref: p,
53
+ className: S(
55
54
  `${s}`,
56
55
  { [`${s}-rtl`]: g },
57
56
  o.className
58
57
  ),
59
58
  style: o.style,
60
- onClick: c,
59
+ onClick: l,
61
60
  ...T({
62
- onPressEnter: c
61
+ onPressEnter: l
63
62
  }),
64
63
  children: /* @__PURE__ */ r(
65
- S,
64
+ R,
66
65
  {
67
66
  in: b,
68
67
  timeout: 100,
@@ -74,11 +73,11 @@ function U(p, i) {
74
73
  }
75
74
  );
76
75
  }
77
- const m = y(
78
- U
76
+ const a = y(
77
+ O
79
78
  );
80
- m.displayName = "BackTop";
81
- const _ = x.memo(m);
79
+ a.displayName = "BackTop";
80
+ const Z = x.memo(a);
82
81
  export {
83
- _ as default
82
+ Z as default
84
83
  };
package/calendar/index.js CHANGED
@@ -1,65 +1,65 @@
1
- import { jsxs as te, jsx as r } from "react/jsx-runtime";
2
- import ne from "lodash/merge";
3
- import { useContext as re, useState as M, useMemo as se } from "react";
1
+ import { jsxs as ne, jsx as r } from "react/jsx-runtime";
2
+ import re from "lodash/merge";
3
+ import { useContext as se, useState as M, useMemo as le } from "react";
4
4
  import "../config-provider/ConfigProvider.js";
5
- import le from "../components/common/hooks/useMergeProps.js";
5
+ import de from "../components/common/hooks/useMergeProps.js";
6
6
  import me from "@unicom-cloud/utils/class-name";
7
- import { getDayjsValue as u, getNow as $, methods as g } from "../components/common/utils/dayjs.js";
8
- import { pickDataAttributes as de } from "../components/common/utils/pick.js";
9
- import ce, { getAllDaysByTime as ie } from "./Month.js";
10
- import pe from "./Year.js";
11
- import fe from "./header/index.js";
12
- import he from "./header/Panel.js";
13
- import ue from "../config-provider/context.js";
14
- function ge(d, y) {
15
- return d === "month" || d === "year" && !y ? "YYYY-MM-DD" : "YYYY-MM";
7
+ import { getDayjsValue as u, getNow as A, methods as g } from "../components/common/utils/dayjs.js";
8
+ import { pickDataAttributes as ce } from "../components/common/utils/pick.js";
9
+ import ie, { getAllDaysByTime as pe } from "./Month.js";
10
+ import fe from "./Year.js";
11
+ import he from "./header/index.js";
12
+ import ue from "./header/Panel.js";
13
+ import ge from "../config-provider/context.js";
14
+ function ye(m, y) {
15
+ return m === "month" || m === "year" && !y ? "YYYY-MM-DD" : "YYYY-MM";
16
16
  }
17
- const ye = {
17
+ const Ce = {
18
18
  dayStartOfWeek: 0,
19
19
  panelWidth: 265,
20
20
  defaultMode: "month",
21
21
  headerType: "button",
22
22
  modes: ["month", "year"]
23
23
  };
24
- function Ce(d) {
24
+ function De(m) {
25
25
  const {
26
26
  getPrefixCls: y,
27
- locale: A,
28
- componentConfig: k,
29
- rtl: H
30
- } = re(ue), s = le(
31
- d,
32
- ye,
33
- k?.Calendar
27
+ locale: k,
28
+ componentConfig: H,
29
+ rtl: L
30
+ } = se(ge), s = de(
31
+ m,
32
+ Ce,
33
+ H?.Calendar
34
34
  ), {
35
- style: L,
36
- className: O,
37
- dayStartOfWeek: T,
38
- panel: m,
39
- locale: W,
40
- panelWidth: j,
41
- panelTodayBtn: B,
42
- defaultPageShowDate: E,
35
+ style: O,
36
+ className: T,
37
+ dayStartOfWeek: W,
38
+ panel: d,
39
+ locale: j,
40
+ panelWidth: B,
41
+ panelTodayBtn: E,
42
+ defaultPageShowDate: F,
43
43
  value: w,
44
- pageShowDate: F,
45
- defaultValue: R,
44
+ pageShowDate: R,
45
+ defaultValue: _,
46
46
  mode: S,
47
- defaultMode: _,
48
- onChange: q,
47
+ defaultMode: q,
48
+ onChange: z,
49
49
  onPanelChange: c,
50
50
  headerRender: P,
51
- headerType: z,
52
- modes: G,
53
- panelOperations: I
54
- } = s, l = ne(A.Calendar, W), o = y?.("calendar"), [J, K] = M(
55
- S || _
56
- ), a = S || J, i = ge(a, m), [Y, Q] = M(
57
- u(w || R, i)
58
- ), [U, p] = M(
59
- u(E, i) || Y || $()
60
- ), t = u(F, i) || U, C = "value" in s ? u(w, i) : Y, N = se(() => ie(s, t), [t.toString(), a, T]);
51
+ headerType: G,
52
+ modes: I,
53
+ panelOperations: J
54
+ } = s, l = re(k.Calendar, j), o = y?.("calendar"), [K, Q] = M(
55
+ S || q
56
+ ), a = S || K, i = ye(a, d), [Y, U] = M(
57
+ u(w || _, i)
58
+ ), [X, p] = M(
59
+ u(F, i) || Y || A()
60
+ ), t = u(R, i) || X, C = "value" in s ? u(w, i) : Y, N = le(() => pe(s, t), [t.toString(), a, W]);
61
61
  function f(e) {
62
- Q(e), q?.(e), v(e);
62
+ U(e), z?.(e), v(e);
63
63
  }
64
64
  function v(e) {
65
65
  p(e), c?.(e);
@@ -69,66 +69,67 @@ function Ce(d) {
69
69
  }
70
70
  let D = "";
71
71
  a === "month" ? D = l.formatMonth : a === "year" && (D = l.formatYear);
72
- function X(e, n) {
72
+ function Z(e, n) {
73
73
  let h;
74
74
  e === "prev" && (h = g.subtract(t, 1, n)), e === "next" && (h = g.add(t, 1, n)), p(h), c?.(h);
75
75
  }
76
- function Z(e) {
76
+ function ee(e) {
77
77
  const n = g.set(t, "year", e);
78
78
  p(n), c?.(n);
79
79
  }
80
- function ee(e) {
80
+ function ae(e) {
81
81
  const n = g.set(t, "month", e - 1);
82
82
  p(n), c?.(n);
83
83
  }
84
84
  function x(e) {
85
- K(e);
85
+ Q(e);
86
86
  }
87
- const ae = me(
87
+ const oe = me(
88
88
  o,
89
89
  a === "month" ? `${o}-mode-month` : `${o}-mode-year`,
90
90
  {
91
- [`${o}-panel`]: m && (a === "month" || a === "year"),
92
- [`${o}-rtl`]: H
91
+ [`${o}-panel`]: d && (a === "month" || a === "year"),
92
+ [`${o}-rtl`]: L
93
93
  },
94
- O
95
- ), oe = m ? { width: j } : {}, V = {
94
+ T
95
+ ), te = d ? { width: B } : {}, V = {
96
96
  prefixCls: o,
97
- changePageShowDate: X,
97
+ changePageShowDate: Z,
98
98
  headerValueFormat: D,
99
99
  mergedPageShowDate: t,
100
- modes: G,
100
+ modes: I,
101
101
  innerMode: a,
102
- panelOperations: I
103
- };
104
- return /* @__PURE__ */ te(
102
+ panelOperations: J
103
+ }, $ = d ? /* @__PURE__ */ r(ue, { ...V }) : /* @__PURE__ */ r(
104
+ he,
105
+ {
106
+ ...V,
107
+ CALENDAR_LOCALE: l,
108
+ move: f,
109
+ innerMode: a,
110
+ changeMode: x,
111
+ onChangeYear: ee,
112
+ onChangeMonth: ae,
113
+ headerType: G
114
+ }
115
+ );
116
+ return /* @__PURE__ */ ne(
105
117
  "div",
106
118
  {
107
- className: ae,
108
- style: { ...L, ...oe },
109
- ...de(s),
119
+ className: oe,
120
+ style: { ...O, ...te },
121
+ ...ce(s),
110
122
  children: [
111
123
  typeof P == "function" ? P({
112
124
  value: C,
113
125
  pageShowDate: t,
114
126
  onChangeMode: x,
115
127
  onChange: f,
116
- onChangePageDate: v
117
- }) : m ? /* @__PURE__ */ r(he, { ...V }) : /* @__PURE__ */ r(
118
- fe,
119
- {
120
- ...V,
121
- CALENDAR_LOCALE: l,
122
- move: f,
123
- innerMode: a,
124
- changeMode: x,
125
- onChangeYear: Z,
126
- onChangeMonth: ee,
127
- headerType: z
128
- }
129
- ),
128
+ onChangePageDate: v,
129
+ header: $
130
+ }) : $,
130
131
  a === "month" && /* @__PURE__ */ r("div", { className: `${o}-body`, children: /* @__PURE__ */ r(
131
- ce,
132
+ ie,
132
133
  {
133
134
  ...s,
134
135
  prefixCls: o,
@@ -141,7 +142,7 @@ function Ce(d) {
141
142
  }
142
143
  ) }),
143
144
  a === "year" && /* @__PURE__ */ r("div", { className: `${o}-body`, children: /* @__PURE__ */ r(
144
- pe,
145
+ fe,
145
146
  {
146
147
  ...s,
147
148
  prefixCls: o,
@@ -153,11 +154,11 @@ function Ce(d) {
153
154
  CALENDAR_LOCALE: l
154
155
  }
155
156
  ) }),
156
- B && m && /* @__PURE__ */ r(
157
+ E && d && /* @__PURE__ */ r(
157
158
  "div",
158
159
  {
159
160
  className: `${o}-footer-btn-wrapper`,
160
- onClick: () => f($()),
161
+ onClick: () => f(A()),
161
162
  children: l.today
162
163
  }
163
164
  )
@@ -165,9 +166,9 @@ function Ce(d) {
165
166
  }
166
167
  );
167
168
  }
168
- Ce.displayName = "Calendar";
169
+ De.displayName = "Calendar";
169
170
  export {
170
- ce as CalendarMonth,
171
- pe as CalendarYear,
172
- Ce as default
171
+ ie as CalendarMonth,
172
+ fe as CalendarYear,
173
+ De as default
173
174
  };