@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/loading/index.js CHANGED
@@ -1,61 +1,80 @@
1
- import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
- import m from "./style/index.module.less.js";
3
- import u, { useImperativeHandle as f, useEffect as x } from "react";
4
- function $(a, o) {
5
- const d = ["#FF5F57", "#FEBC2E", "#28C840"], i = a.colors || d;
6
- let s = 12, l = 25, e = 25, c = 4, r = "0.5 0 0.5 1;0.5 0 0.5 1", n = "0.7s";
7
- return f(o, () => ({})), x(() => () => {
8
- }, []), /* @__PURE__ */ p(
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as d, useContext as g, useMemo as u } from "react";
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 A from "../components/common/hooks/useMergeProps.js";
12
+ import "../components/common/utils/reactDOM.js";
13
+ import "@unicom-cloud/utils/constant";
14
+ import "lodash/debounce";
15
+ import E from "@unicom-cloud/utils/class-name";
16
+ import I from "../config-provider/context.js";
17
+ const v = ["#FF5F57", "#FEBC2E", "#28C840"], e = 50, o = e / 2, S = 4, t = 7, c = 12, T = "0.7s", w = "0.5 0 0.5 1;0.5 0 0.5 1", D = (l, M) => {
18
+ const { getPrefixCls: m, componentConfig: p, rtl: a } = g(I), f = A(
19
+ l,
20
+ {},
21
+ p?.Loading
22
+ ), { colors: s = v, style: x, className: $, ...O } = f, n = m?.("mentions"), C = u(
23
+ () => [
24
+ {
25
+ cx: o - c,
26
+ fill: s[0],
27
+ values: `${o + t};${o};${o + t}`
28
+ },
29
+ {
30
+ cx: o,
31
+ fill: s[1],
32
+ values: `${o - t};${o};${o - t}`
33
+ },
34
+ {
35
+ cx: o + c,
36
+ fill: s[2],
37
+ values: `${o + t};${o};${o + t}`
38
+ }
39
+ ],
40
+ [s]
41
+ );
42
+ return /* @__PURE__ */ r(
9
43
  "svg",
10
44
  {
11
- className: m.module,
45
+ style: { ...x },
46
+ className: E(`${n}`, !!a && `${n}-rtl`, $),
12
47
  xmlns: "http://www.w3.org/2000/svg",
13
- width: "50px",
14
- height: "50px",
15
- viewBox: "0 0 50 50",
48
+ width: `${e}px`,
49
+ height: `${e}px`,
50
+ viewBox: `0 0 ${e} ${e}`,
16
51
  preserveAspectRatio: "xMidYMid",
17
- children: [
18
- /* @__PURE__ */ t("circle", { cx: l - s, cy: e, r: c, fill: i[0], children: /* @__PURE__ */ t(
19
- "animate",
20
- {
21
- attributeName: "cy",
22
- values: `${e + 7};${e};${e + 7}`,
23
- dur: n,
24
- calcMode: "spline",
25
- keySplines: r,
26
- begin: "0s",
27
- repeatCount: "indefinite"
28
- }
29
- ) }),
30
- /* @__PURE__ */ t("circle", { cx: l, cy: e, r: c, fill: i[1], children: /* @__PURE__ */ t(
31
- "animate",
32
- {
33
- attributeName: "cy",
34
- values: `${e - 7};${e};${e - 7}`,
35
- dur: n,
36
- calcMode: "spline",
37
- keySplines: r,
38
- begin: "0s",
39
- repeatCount: "indefinite"
40
- }
41
- ) }),
42
- /* @__PURE__ */ t("circle", { cx: l + s, cy: e, r: c, fill: i[2], children: /* @__PURE__ */ t(
43
- "animate",
44
- {
45
- attributeName: "cy",
46
- values: `${e + 7};${e};${e + 7}`,
47
- dur: n,
48
- calcMode: "spline",
49
- keySplines: r,
50
- begin: "0s",
51
- repeatCount: "indefinite"
52
- }
53
- ) })
54
- ]
52
+ children: C.map((i, N) => /* @__PURE__ */ r(
53
+ "circle",
54
+ {
55
+ cx: i.cx,
56
+ cy: o,
57
+ r: S,
58
+ fill: i.fill,
59
+ children: /* @__PURE__ */ r(
60
+ "animate",
61
+ {
62
+ attributeName: "cy",
63
+ values: i.values,
64
+ dur: T,
65
+ calcMode: "spline",
66
+ keySplines: w,
67
+ begin: "0s",
68
+ repeatCount: "indefinite"
69
+ }
70
+ )
71
+ },
72
+ N
73
+ ))
55
74
  }
56
75
  );
57
- }
58
- const w = u.forwardRef($);
76
+ }, L = d(D);
77
+ L.displayName = "Loading";
59
78
  export {
60
- w as default
79
+ L as default
61
80
  };
@@ -0,0 +1 @@
1
+
package/modal/Modal.js CHANGED
@@ -1,13 +1,13 @@
1
- import { jsxs as T, jsx as r, Fragment as Ke } from "react/jsx-runtime";
1
+ import { jsxs as E, jsx as o, Fragment as Ke } from "react/jsx-runtime";
2
2
  import _e from "@unicom-cloud/icons/IconUiClose";
3
3
  import ue from "lodash/isFunction";
4
- import Ge, { forwardRef as Je, useRef as a, useContext as Qe, useState as k, useCallback as y, useEffect as q } from "react";
4
+ import Ge, { forwardRef as Je, useContext as Qe, useRef as i, useState as T, useCallback as k, useEffect as q } from "react";
5
5
  import de from "../button/index.js";
6
6
  import en from "../config-provider/ConfigProvider.js";
7
7
  import nn from "../components/common/hooks/useIsFirstRender.js";
8
8
  import tn from "../components/common/hooks/useMergeProps.js";
9
- import on from "../components/common/hooks/useMergeValue.js";
10
- import rn from "../components/common/hooks/useOverflowHidden.js";
9
+ import rn from "../components/common/hooks/useMergeValue.js";
10
+ import on from "../components/common/hooks/useOverflowHidden.js";
11
11
  import ln from "../icon-hover/index.js";
12
12
  import sn from "../portal/index.js";
13
13
  import { PqbCSSTransition as me } from "../components/common/utils/PqbCSSTransition.js";
@@ -41,9 +41,8 @@ const bn = {
41
41
  getPopupContainer: () => document.body,
42
42
  alignCenter: !0
43
43
  };
44
- function xn(l, b) {
45
- b ||= a();
46
- const d = Qe(gn), o = tn(
44
+ function xn(l, y) {
45
+ const d = Qe(gn), r = tn(
47
46
  l,
48
47
  bn,
49
48
  d.componentConfig?.Modal
@@ -52,7 +51,7 @@ function xn(l, b) {
52
51
  style: Ce,
53
52
  visible: s,
54
53
  simple: Z,
55
- title: x,
54
+ title: b,
56
55
  subtitle: N,
57
56
  children: be,
58
57
  cancelText: xe,
@@ -60,7 +59,7 @@ function xn(l, b) {
60
59
  okButtonProps: ve,
61
60
  cancelButtonProps: Me,
62
61
  getPopupContainer: D = () => document.body,
63
- footer: h,
62
+ footer: x,
64
63
  afterClose: we,
65
64
  confirmLoading: Ee,
66
65
  mountOnEnter: $,
@@ -68,7 +67,7 @@ function xn(l, b) {
68
67
  afterOpen: Te,
69
68
  hideCancel: ke,
70
69
  maskClosable: ye,
71
- mask: v,
70
+ mask: h,
72
71
  alignCenter: Ne,
73
72
  getChildrenPopupContainer: j,
74
73
  wrapClassName: De,
@@ -80,31 +79,31 @@ function xn(l, b) {
80
79
  fullscreenable: hn,
81
80
  okButton: m,
82
81
  ..._
83
- } = o, f = a(null), G = a(null), i = a(null), [J, Q] = k(), [ee, Re] = k(), M = a(null), p = a(!1), [Be, ne] = k(""), [te, oe] = k("");
82
+ } = r, f = i(null), G = i(null), a = i(null), [J, Q] = T(), [ee, Re] = T(), v = i(null), p = i(!1), [Be, ne] = T(""), [te, re] = T("");
84
83
  nn();
85
- const B = a(!0);
84
+ const B = i(!0);
86
85
  s && B.current && (B.current = !1);
87
- const w = a();
88
- w.current || (w.current = Cn++);
89
- const [Ie, I] = on(!1, {
86
+ const M = i();
87
+ M.current || (M.current = Cn++);
88
+ const [Ie, I] = rn(!1, {
90
89
  defaultValue: !1,
91
90
  value: Ee
92
- }), t = d.getPrefixCls?.("modal", o.prefixCls), { locale: O, rtl: re } = d, Oe = !Z || _.noticeType === "show", Xe = "closable" in o ? o.closable : Oe, Ye = y(() => mn(D()), [D]);
93
- rn(Ye, { hidden: s && v });
91
+ }), t = d.getPrefixCls?.("modal", r.prefixCls), { locale: O, rtl: oe } = d, Oe = !Z || _.noticeType === "show", Xe = "closable" in r ? r.closable : Oe, Ye = k(() => mn(D()), [D]);
92
+ on(Ye, { hidden: s && h });
94
93
  function X(e) {
95
94
  e.stopPropagation(), Y();
96
95
  }
97
96
  function Y() {
98
- o.onCancel?.();
97
+ r.onCancel?.();
99
98
  }
100
99
  const Le = (e) => {
101
100
  R && s && e.key === un.key && (e.stopPropagation(), Y());
102
- }, L = a(!1), Se = (e) => {
103
- p.current && (p.current = !1, !L.current && ye && v && e.target === e.currentTarget && setTimeout(() => {
101
+ }, L = i(!1), Se = (e) => {
102
+ p.current && (p.current = !1, !L.current && ye && h && e.target === e.currentTarget && setTimeout(() => {
104
103
  Y();
105
104
  }, 100));
106
105
  }, He = (e) => {
107
- const n = (o.onOk ?? o.onConfirm)?.(e);
106
+ const n = (r.onOk ?? r.onConfirm)?.(e);
108
107
  n?.then && (I(!0), n.then(
109
108
  () => {
110
109
  I(!1);
@@ -128,17 +127,17 @@ function xn(l, b) {
128
127
  isNaN(e) || Re(e + 1);
129
128
  }
130
129
  }, Ve = () => {
131
- if (h === null)
130
+ if (x === null)
132
131
  return;
133
- const e = o.cancelButton?.visible !== !1 && /* @__PURE__ */ r(
132
+ const e = r.cancelButton?.visible !== !1 && /* @__PURE__ */ o(
134
133
  de,
135
134
  {
136
135
  onClick: X,
137
136
  ...Me,
138
- ...o.cancelButton?.props,
139
- children: o.cancelButton?.props?.children || o.cancelButton?.label || o.cancelButton?.text || xe || O?.Modal.cancelText
137
+ ...r.cancelButton?.props,
138
+ children: r.cancelButton?.props?.children || r.cancelButton?.label || r.cancelButton?.text || xe || O?.Modal.cancelText
140
139
  }
141
- ), n = m?.visible !== !1 && /* @__PURE__ */ r(
140
+ ), n = m?.visible !== !1 && /* @__PURE__ */ o(
142
141
  de,
143
142
  {
144
143
  loading: Ie,
@@ -148,27 +147,27 @@ function xn(l, b) {
148
147
  ...m?.props,
149
148
  children: m?.props?.children || m?.label || m?.text || he || O?.Modal.okText
150
149
  }
151
- ), c = ue(h) ? h(e, n) : h || /* @__PURE__ */ T(Ke, { children: [
150
+ ), c = ue(x) ? x(e, n) : x || /* @__PURE__ */ E(Ke, { children: [
152
151
  !ke && e,
153
152
  n
154
153
  ] });
155
- return /* @__PURE__ */ r("div", { className: `${t}-footer`, children: c });
156
- }, S = a(
154
+ return /* @__PURE__ */ o("div", { className: `${t}-footer`, children: c });
155
+ }, S = i(
157
156
  ae()
158
- ), ze = y((e) => {
159
- if (!i.current) return;
157
+ ), ze = k((e) => {
158
+ if (!a.current) return;
160
159
  e.preventDefault();
161
160
  const n = S.current;
162
- n.screenX = e.screenX, n.screenY = e.screenY, n.prewTranslateX = n.translateX, n.prewTranslateY = n.translateY, n.boundingClientRect = i.current?.getBoundingClientRect?.() ?? {}, n.offsetParentBoundingClientRect = i.current?.offsetParent?.getBoundingClientRect?.() ?? {}, E(), qe();
163
- }, []), le = y((e) => {
161
+ n.screenX = e.screenX, n.screenY = e.screenY, n.prewTranslateX = n.translateX, n.prewTranslateY = n.translateY, n.boundingClientRect = a.current?.getBoundingClientRect?.() ?? {}, n.offsetParentBoundingClientRect = a.current?.offsetParent?.getBoundingClientRect?.() ?? {}, w(), qe();
162
+ }, []), le = k((e) => {
164
163
  e.preventDefault();
165
164
  const n = S.current, { left: c, right: V, top: z, bottom: Ze } = n.boundingClientRect ?? {}, { width: je, height: Ae } = n.offsetParentBoundingClientRect ?? {};
166
165
  let g = Math.max(e.screenX - n.screenX, -c);
167
166
  g = Math.min(g, je - V);
168
167
  let C = Math.max(e.screenY - n.screenY, -z);
169
168
  C = Math.min(C, Ae - Ze), g += n.prewTranslateX, C += n.prewTranslateY, n.translateX = g, n.translateY = C, ne(`translate(${g}px, ${C}px)`);
170
- }, []), se = y((e) => {
171
- e.preventDefault(), E();
169
+ }, []), se = k((e) => {
170
+ e.preventDefault(), w();
172
171
  }, []);
173
172
  function qe() {
174
173
  document.documentElement.addEventListener(
@@ -179,7 +178,7 @@ function xn(l, b) {
179
178
  se
180
179
  );
181
180
  }
182
- function E() {
181
+ function w() {
183
182
  document.documentElement.removeEventListener(
184
183
  "mousemove",
185
184
  le
@@ -201,36 +200,36 @@ function xn(l, b) {
201
200
  };
202
201
  }
203
202
  function H() {
204
- S.current = ae(), ne(""), oe("");
203
+ S.current = ae(), ne(""), re("");
205
204
  }
206
205
  q(() => () => {
207
- H(), E();
208
- }, []), q(() => (i.current || (H(), E()), () => {
209
- }), [i.current]);
210
- const Ue = /* @__PURE__ */ T(
206
+ H(), w();
207
+ }, []), q(() => (a.current || (H(), w()), () => {
208
+ }), [a.current]);
209
+ const Ue = /* @__PURE__ */ E(
211
210
  en,
212
211
  {
213
212
  ...d,
214
213
  childrenName: "Modal",
215
- prefixCls: o.prefixCls || d.prefixCls,
214
+ prefixCls: r.prefixCls || d.prefixCls,
216
215
  locale: O,
217
216
  zIndex: ee || 1050,
218
217
  getPopupContainer: (e) => typeof j == "function" ? j(e) : G.current,
219
218
  children: [
220
- (!!x || !!N) && /* @__PURE__ */ T("div", { className: `${t}-header`, children: [
221
- !!x && /* @__PURE__ */ r(
219
+ (!!b || !!N) && /* @__PURE__ */ E("div", { className: `${t}-header`, children: [
220
+ !!b && /* @__PURE__ */ o(
222
221
  "div",
223
222
  {
224
223
  className: `${t}-title`,
225
- id: `pqb-dialog-${w.current}`,
226
- children: x
224
+ id: `pqb-dialog-${M.current}`,
225
+ children: b
227
226
  }
228
227
  ),
229
- !!N && /* @__PURE__ */ r("div", { className: `${t}-subtitle`, children: N })
228
+ !!N && /* @__PURE__ */ o("div", { className: `${t}-subtitle`, children: N })
230
229
  ] }),
231
- /* @__PURE__ */ r("div", { ref: G, className: `${t}-content`, children: be }),
230
+ /* @__PURE__ */ o("div", { ref: G, className: `${t}-content`, children: be }),
232
231
  Ve(),
233
- !o.fullscreenable && o.draggable !== !1 && /* @__PURE__ */ r(
232
+ !r.fullscreenable && r.draggable !== !1 && /* @__PURE__ */ o(
234
233
  "div",
235
234
  {
236
235
  className: `${t}-drag-icon`,
@@ -238,14 +237,14 @@ function xn(l, b) {
238
237
  onDoubleClick: H
239
238
  }
240
239
  ),
241
- (Xe || !!o.fullscreenable) && (K !== void 0 ? /* @__PURE__ */ r(
240
+ (Xe || !!r.fullscreenable) && (K !== void 0 ? /* @__PURE__ */ o(
242
241
  "span",
243
242
  {
244
243
  className: `${t}-close-icon`,
245
244
  onClick: X,
246
245
  children: K
247
246
  }
248
- ) : /* @__PURE__ */ r(
247
+ ) : /* @__PURE__ */ o(
249
248
  ln,
250
249
  {
251
250
  tabIndex: -1,
@@ -253,12 +252,12 @@ function xn(l, b) {
253
252
  onClick: X,
254
253
  role: "button",
255
254
  "aria-label": "Close",
256
- children: /* @__PURE__ */ r(_e, {})
255
+ children: /* @__PURE__ */ o(_e, {})
257
256
  }
258
257
  ))
259
258
  ]
260
259
  }
261
- ), We = x ? { "aria-labelledby": `pqb-dialog-${w.current}` } : {}, ie = /* @__PURE__ */ r(
260
+ ), We = b ? { "aria-labelledby": `pqb-dialog-${M.current}` } : {}, ie = /* @__PURE__ */ o(
262
261
  "div",
263
262
  {
264
263
  role: "dialog",
@@ -268,8 +267,8 @@ function xn(l, b) {
268
267
  t,
269
268
  {
270
269
  [`${t}-simple`]: Z,
271
- [`${t}-rtl`]: re,
272
- [`${t}-fullscreenable`]: o.fullscreenable
270
+ [`${t}-rtl`]: oe,
271
+ [`${t}-fullscreenable`]: r.fullscreenable
273
272
  },
274
273
  ge
275
274
  ),
@@ -278,32 +277,32 @@ function xn(l, b) {
278
277
  transform: Be,
279
278
  transformOrigin: te
280
279
  },
281
- ref: i,
280
+ ref: a,
282
281
  children: Ue
283
282
  }
284
283
  ), F = (e) => {
285
284
  if (te)
286
285
  return;
287
286
  let n = "";
288
- if (M.current) {
289
- const c = e.getBoundingClientRect(), { left: V, top: z } = M.current;
287
+ if (v.current) {
288
+ const c = e.getBoundingClientRect(), { left: V, top: z } = v.current;
290
289
  n = `${V - c.left}px ${z - c.top}px`;
291
290
  }
292
- oe(n);
293
- }, ce = B.current ? !$ : !!i.current;
294
- return s || ce ? /* @__PURE__ */ r(
291
+ re(n);
292
+ }, ce = B.current ? !$ : !!a.current;
293
+ return s || ce ? /* @__PURE__ */ o(
295
294
  sn,
296
295
  {
297
296
  visible: s,
298
297
  forceRender: ce,
299
298
  getContainer: D,
300
- children: /* @__PURE__ */ T(
299
+ children: /* @__PURE__ */ E(
301
300
  "div",
302
301
  {
303
- ref: b,
302
+ ref: y,
304
303
  className: `${t}-container`,
305
304
  children: [
306
- v ? /* @__PURE__ */ r(
305
+ h ? /* @__PURE__ */ o(
307
306
  me,
308
307
  {
309
308
  in: s,
@@ -318,7 +317,7 @@ function xn(l, b) {
318
317
  onExited: (e) => {
319
318
  e && (e.style.display = "none");
320
319
  },
321
- children: /* @__PURE__ */ r(
320
+ children: /* @__PURE__ */ o(
322
321
  "div",
323
322
  {
324
323
  "aria-hidden": !0,
@@ -328,7 +327,7 @@ function xn(l, b) {
328
327
  )
329
328
  }
330
329
  ) : null,
331
- /* @__PURE__ */ r(
330
+ /* @__PURE__ */ o(
332
331
  "div",
333
332
  {
334
333
  ...dn(_, [
@@ -350,9 +349,9 @@ function xn(l, b) {
350
349
  className: fe(
351
350
  `${t}-wrapper`,
352
351
  {
353
- [`${t}-wrapper-no-mask`]: !v,
352
+ [`${t}-wrapper-no-mask`]: !h,
354
353
  [`${t}-wrapper-align-center`]: Ne,
355
- [`${t}-wrapper-rtl`]: re
354
+ [`${t}-wrapper-rtl`]: oe
356
355
  },
357
356
  De
358
357
  ),
@@ -367,7 +366,7 @@ function xn(l, b) {
367
366
  p.current = e.target === e.currentTarget;
368
367
  },
369
368
  onClick: Se,
370
- children: /* @__PURE__ */ r(
369
+ children: /* @__PURE__ */ o(
371
370
  me,
372
371
  {
373
372
  in: s,
@@ -377,16 +376,16 @@ function xn(l, b) {
377
376
  unmountOnExit: P,
378
377
  mountOnEnter: $,
379
378
  onEnter: (e) => {
380
- e && (Q(!0), M.current = U, F(e), i.current = e);
379
+ e && (Q(!0), v.current = U, F(e), a.current = e);
381
380
  },
382
381
  onEntered: (e) => {
383
- e && (F(e), M.current = null, Te?.());
382
+ e && (F(e), v.current = null, Te?.());
384
383
  },
385
384
  onExit: () => {
386
385
  L.current = !0;
387
386
  },
388
387
  onExited: (e) => {
389
- e && (Q(!1), F(e), we?.(), L.current = !1, P && (i.current = null));
388
+ e && (Q(!1), F(e), we?.(), L.current = !1, P && (a.current = null));
390
389
  },
391
390
  children: Ge.cloneElement(
392
391
  ue(A) ? A(ie) : ie,
@@ -418,8 +417,8 @@ u.show = (l) => W({ ...l, noticeType: "show" });
418
417
  u.confirm = (l) => W(l);
419
418
  u.useModal = pn;
420
419
  ["info", "success", "warning", "error"].forEach((l) => {
421
- u[l] = (b) => W({
422
- ...b,
420
+ u[l] = (y) => W({
421
+ ...y,
423
422
  isNotice: !0,
424
423
  noticeType: l
425
424
  });
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@unicom-cloud/ui","version":"0.8.100","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"dayjs":"^1.11.10","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
1
+ {"name":"@unicom-cloud/ui","version":"0.8.101","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"dayjs":"^1.11.10","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
@@ -0,0 +1 @@
1
+