@unicom-cloud/ui 0.8.106 → 0.8.108

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 (197) hide show
  1. package/App.js +7 -0
  2. package/BackTop.js +2 -4
  3. package/Calendar.js +2 -2
  4. package/ColorPicker.js +15 -14
  5. package/Constant.js +4 -0
  6. package/Copy.js +4 -3
  7. package/Countdown.js +25 -0
  8. package/Grid.js +8 -10
  9. package/LiquidFill.js +4 -3
  10. package/List.js +7 -6
  11. package/Marquee.js +4 -3
  12. package/Modal.js +4 -2
  13. package/PageHeader.js +3 -2
  14. package/QrCode.js +4 -3
  15. package/RowCol.js +8 -0
  16. package/Segmented.js +14 -4
  17. package/Statistic.js +5 -4
  18. package/Tour.js +4 -3
  19. package/Transfer.js +4 -2
  20. package/anchor/Link.js +1 -1
  21. package/app/App.js +26 -0
  22. package/app/context.js +9 -0
  23. package/app/index.js +9 -0
  24. package/app/interface.js +1 -0
  25. package/app/useApp.js +8 -0
  26. package/avatar/Group.js +1 -1
  27. package/back-top/index.js +44 -56
  28. package/button/index.js +52 -51
  29. package/calendar/Lunar.js +71 -0
  30. package/calendar/index.js +11 -11
  31. package/cascader/base/node.js +22 -20
  32. package/cascader/base/store.js +10 -10
  33. package/cascader/util.js +29 -27
  34. package/color-picker/Mode.js +8 -7
  35. package/color-picker/hooks/useColorPicker.js +56 -55
  36. package/color-picker/index.js +49 -48
  37. package/color-picker/utils.js +58 -57
  38. package/components/common/empty/index.js +2 -2
  39. package/components/common/flex/index.js +64 -55
  40. package/components/common/flex/interface.js +6 -6
  41. package/components/common/hooks/useInterval.js +6 -6
  42. package/components/common/icons/file/index.js +13 -11
  43. package/components/common/space/index.js +53 -53
  44. package/components/common/utils/dayjs.js +114 -126
  45. package/components/common/utils/is.js +98 -104
  46. package/components/common/utils/setDir.js +12 -0
  47. package/components/common/utils/setTheme.js +13 -13
  48. package/components/common/utils/toArray.js +7 -5
  49. package/config-provider/ConfigProvider.js +32 -30
  50. package/constant/index.js +4 -0
  51. package/copy/index.js +2 -1
  52. package/countdown/index.js +113 -0
  53. package/countdown/interface.js +1 -0
  54. package/countdown/util.js +29 -0
  55. package/descriptions/index.js +45 -45
  56. package/divider/index.js +28 -20
  57. package/dropdown/Button.js +1 -1
  58. package/empty/index.js +1 -1
  59. package/flex/index.js +30 -29
  60. package/form/FormItem.js +126 -122
  61. package/grid/Grid.js +56 -90
  62. package/grid/Item.js +44 -65
  63. package/grid/context.js +2 -6
  64. package/grid/index.js +6 -8
  65. package/grid/util.js +6 -44
  66. package/hooks/useResponsiveState.js +54 -0
  67. package/index.js +614 -605
  68. package/input/Button.js +12 -12
  69. package/input/Group.js +11 -12
  70. package/input/Input.js +112 -102
  71. package/input/InputElement.js +25 -24
  72. package/input/Search.js +24 -24
  73. package/layout/Sider.js +1 -1
  74. package/liquid-fill/index.js +4 -3
  75. package/list/Item.js +21 -21
  76. package/list/index.js +53 -52
  77. package/marquee/index.js +20 -19
  78. package/marquee-/index.js +4 -3
  79. package/mentions/util.js +9 -8
  80. package/modal/Confirm.js +17 -17
  81. package/modal/Modal.js +247 -237
  82. package/modal/index.js +4 -2
  83. package/modal/use-modal/index.js +2 -2
  84. package/package.json +1 -1
  85. package/page-header/index.js +57 -56
  86. package/pagination/Pagination.js +89 -92
  87. package/qr-code/index.js +4 -3
  88. package/radio/Group.js +1 -1
  89. package/row-col/Col-.js +88 -0
  90. package/row-col/Col.js +159 -0
  91. package/row-col/Row.js +73 -0
  92. package/row-col/context.js +5 -0
  93. package/row-col/index.js +11 -0
  94. package/row-col/interface.js +1 -0
  95. package/segmented/index.js +257 -206
  96. package/select/Select.js +191 -191
  97. package/select/util.js +50 -50
  98. package/select-view/Core.js +31 -28
  99. package/space/index.js +15 -13
  100. package/splitter/SplitBar.js +44 -46
  101. package/statistic/index.js +56 -55
  102. package/statistic/interface.js +4 -1
  103. package/style.css +1 -1
  104. package/table/Table.js +198 -210
  105. package/table/hook/useColumns.js +27 -26
  106. package/table/hook/useStickyClassNames.js +9 -8
  107. package/table/hook/useThResizable.js +4 -3
  108. package/table/th-resizable/index.js +2 -2
  109. package/table/thead/index.js +18 -16
  110. package/time-picker/util.js +20 -30
  111. package/timeline/Item.js +1 -1
  112. package/tour/index.js +4 -3
  113. package/transfer/index.js +93 -91
  114. package/trigger/index.js +66 -66
  115. package/types/common/development/interface.d.ts +3 -3
  116. package/types/common/flex/index.d.ts +3 -9
  117. package/types/common/flex/interface.d.ts +15 -4
  118. package/types/common/space/index.d.ts +3 -5
  119. package/types/common/space/interface.d.ts +2 -0
  120. package/types/common/utils/dayjs.d.ts +3 -1
  121. package/types/common/utils/is.d.ts +3 -4
  122. package/types/common/utils/setDir.d.ts +2 -0
  123. package/types/pc/app/App.d.ts +6 -0
  124. package/types/pc/app/context.d.ts +4 -0
  125. package/types/pc/app/index.d.ts +5 -0
  126. package/types/pc/app/interface.d.ts +17 -0
  127. package/types/pc/app/useApp.d.ts +3 -0
  128. package/types/pc/back-top/interface.d.ts +4 -17
  129. package/types/pc/button/interface.d.ts +2 -2
  130. package/types/pc/calendar/Lunar.d.ts +17 -0
  131. package/types/pc/calendar/index.d.ts +1 -1
  132. package/types/pc/config-provider/interface.d.ts +17 -12
  133. package/types/pc/constant/index.d.ts +1 -0
  134. package/types/pc/countdown/interface.d.ts +65 -0
  135. package/types/pc/countdown/util.d.ts +7 -0
  136. package/types/pc/divider/interface.d.ts +1 -0
  137. package/types/pc/flex/index.d.ts +8 -6
  138. package/types/pc/flex/interface.d.ts +3 -10
  139. package/types/pc/form/FormItem.d.ts +1 -1
  140. package/types/pc/form/interface.d.ts +1 -1
  141. package/types/pc/grid/Grid.d.ts +2 -4
  142. package/types/pc/grid/Item.d.ts +1 -5
  143. package/types/pc/grid/context.d.ts +4 -15
  144. package/types/pc/grid/index.d.ts +4 -6
  145. package/types/pc/grid/interface.d.ts +14 -142
  146. package/types/pc/grid/util.d.ts +1 -10
  147. package/types/pc/hooks/useResponsiveState.d.ts +3 -0
  148. package/types/pc/index.d.ts +10 -4
  149. package/types/pc/input/Button.d.ts +2 -2
  150. package/types/pc/list/interface.d.ts +2 -1
  151. package/types/pc/message/index.d.ts +1 -9
  152. package/types/pc/message/interface.d.ts +8 -0
  153. package/types/pc/message/useMessage.d.ts +1 -2
  154. package/types/pc/modal/Modal.d.ts +1 -0
  155. package/types/pc/modal/config.d.ts +1 -2
  156. package/types/pc/modal/index.d.ts +2 -1
  157. package/types/pc/modal/interface.d.ts +17 -5
  158. package/types/pc/notification/index.d.ts +2 -9
  159. package/types/pc/notification/interface.d.ts +7 -0
  160. package/types/pc/notification/useNotification.d.ts +1 -2
  161. package/types/pc/pagination/PageOption.d.ts +0 -1
  162. package/types/pc/pagination/interface.d.ts +5 -6
  163. package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
  164. package/types/pc/{grid → row-col}/Col.d.ts +1 -2
  165. package/types/pc/{grid → row-col}/Row.d.ts +1 -2
  166. package/types/pc/row-col/context.d.ts +6 -0
  167. package/types/pc/row-col/index.d.ts +7 -0
  168. package/types/pc/row-col/interface.d.ts +112 -0
  169. package/types/pc/segmented/index.d.ts +3 -7
  170. package/types/pc/segmented/interface.d.ts +38 -5
  171. package/types/pc/select-view/Core.d.ts +1 -8
  172. package/types/pc/select-view/index.d.ts +1 -8
  173. package/types/pc/select-view/interface.d.ts +9 -2
  174. package/types/pc/space/index.d.ts +5 -7
  175. package/types/pc/space/interface.d.ts +3 -10
  176. package/types/pc/statistic/index.d.ts +1 -1
  177. package/types/pc/statistic/interface.d.ts +1 -49
  178. package/types/pc/utils/is.d.ts +1 -1
  179. package/types/pc/utils/names.d.ts +422 -111
  180. package/types/pc/utils/responsiveObserve.d.ts +8 -8
  181. package/typography/Ellipsis.js +5 -4
  182. package/typography/Operations.js +4 -3
  183. package/utils/dayjs.js +13 -11
  184. package/utils/index.js +245 -244
  185. package/utils/is.js +65 -66
  186. package/utils/names.js +309 -150
  187. package/utils/responsiveObserve.js +43 -36
  188. package/version/index.js +1 -1
  189. package/grid/Col-.js +0 -86
  190. package/grid/Col.js +0 -169
  191. package/grid/Row.js +0 -96
  192. package/grid/hook/useResponsiveState.js +0 -38
  193. package/statistic/Countdown.js +0 -56
  194. package/statistic/util.js +0 -33
  195. package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
  196. package/types/pc/statistic/util.d.ts +0 -1
  197. /package/types/pc/{statistic/Countdown.d.ts → countdown/index.d.ts} +0 -0
package/modal/Modal.js CHANGED
@@ -1,39 +1,39 @@
1
- import { jsxs as E, jsx as o, Fragment as Ke } from "react/jsx-runtime";
2
- import _e from "@unicom-cloud/icons/IconUiClose";
3
- import ue from "lodash/isFunction";
4
- import Ge, { forwardRef as Je, useContext as Qe, useRef as i, useState as T, useCallback as k, useEffect as q } from "react";
5
- import de from "../button/index.js";
6
- import en from "../config-provider/ConfigProvider.js";
7
- import nn from "../components/common/hooks/useIsFirstRender.js";
8
- import tn from "../components/common/hooks/useMergeProps.js";
9
- import rn from "../components/common/hooks/useMergeValue.js";
10
- import on from "../components/common/hooks/useOverflowHidden.js";
11
- import ln from "../icon-hover/index.js";
12
- import sn from "../portal/index.js";
13
- import { PqbCSSTransition as me } from "../components/common/utils/PqbCSSTransition.js";
14
- import fe from "@unicom-cloud/utils/class-name";
15
- import { contains as an, isServerRendering as cn } from "../components/common/utils/dom.js";
16
- import { Esc as un } from "@unicom-cloud/utils/constant/keyboardCode";
17
- import { omit as dn } from "../components/common/utils/omit.js";
18
- import { findDOMNode_ as mn } from "../components/common/utils/reactDOM.js";
19
- import W from "./Confirm.js";
20
- import { setModalConfig as fn, destroyList as pe } from "./config.js";
21
- import pn from "./use-modal/index.js";
22
- import gn from "../config-provider/context.js";
23
- let U = null, Cn = 0;
24
- cn || document.documentElement.addEventListener(
1
+ import { jsxs as y, jsx as r, Fragment as nn } from "react/jsx-runtime";
2
+ import tn from "@unicom-cloud/icons/IconUiClose";
3
+ import de from "lodash/isFunction";
4
+ import rn, { forwardRef as on, useContext as ln, useRef as a, useState as N, useCallback as sn, useEffect as U } from "react";
5
+ import me from "../button/index.js";
6
+ import an from "../config-provider/ConfigProvider.js";
7
+ import cn from "../components/common/hooks/useIsFirstRender.js";
8
+ import un from "../components/common/hooks/useMergeProps.js";
9
+ import dn from "../components/common/hooks/useMergeValue.js";
10
+ import mn from "../components/common/hooks/useOverflowHidden.js";
11
+ import fn from "../icon-hover/index.js";
12
+ import pn from "../portal/index.js";
13
+ import { PqbCSSTransition as fe } from "../components/common/utils/PqbCSSTransition.js";
14
+ import W from "@unicom-cloud/utils/class-name";
15
+ import { contains as gn, isServerRendering as Cn } from "../components/common/utils/dom.js";
16
+ import { Esc as bn } from "@unicom-cloud/utils/constant/keyboardCode";
17
+ import { omit as hn } from "../components/common/utils/omit.js";
18
+ import { findDOMNode_ as xn } from "../components/common/utils/reactDOM.js";
19
+ import j from "./Confirm.js";
20
+ import { setModalConfig as vn, destroyList as pe } from "./config.js";
21
+ import kn from "./use-modal/index.js";
22
+ import wn from "../config-provider/context.js";
23
+ let Z = null, Mn = 0;
24
+ Cn || document.documentElement.addEventListener(
25
25
  "click",
26
- (l) => {
27
- U = {
28
- left: l.clientX,
29
- top: l.clientY
26
+ (o) => {
27
+ Z = {
28
+ left: o.clientX,
29
+ top: o.clientY
30
30
  }, setTimeout(() => {
31
- U = null;
31
+ Z = null;
32
32
  }, 100);
33
33
  },
34
34
  !0
35
35
  );
36
- const bn = {
36
+ const En = {
37
37
  mask: !0,
38
38
  maskClosable: !0,
39
39
  mountOnEnter: !0,
@@ -41,153 +41,160 @@ const bn = {
41
41
  getPopupContainer: () => document.body,
42
42
  alignCenter: !0
43
43
  };
44
- function xn(l, y) {
45
- const d = Qe(gn), r = tn(
46
- l,
47
- bn,
48
- d.componentConfig?.Modal
44
+ function Tn(o, P) {
45
+ const u = ln(wn), d = un(
46
+ o,
47
+ En,
48
+ u.componentConfig?.Modal
49
49
  ), {
50
50
  className: ge,
51
51
  style: Ce,
52
- visible: s,
53
- simple: Z,
54
- title: b,
55
- subtitle: N,
52
+ visible: l,
53
+ simple: A,
54
+ title: v,
55
+ subtitle: $,
56
56
  children: be,
57
- cancelText: xe,
58
- okText: he,
57
+ cancelText: he,
58
+ okText: xe,
59
59
  okButtonProps: ve,
60
- cancelButtonProps: Me,
60
+ cancelButtonProps: ke,
61
61
  getPopupContainer: D = () => document.body,
62
- footer: x,
62
+ footer: m,
63
63
  afterClose: we,
64
- confirmLoading: Ee,
65
- mountOnEnter: $,
66
- unmountOnExit: P,
67
- afterOpen: Te,
68
- hideCancel: ke,
64
+ confirmLoading: Me,
65
+ mountOnEnter: R,
66
+ unmountOnExit: K,
67
+ afterOpen: Ee,
68
+ hideCancel: Te,
69
69
  maskClosable: ye,
70
- mask: h,
71
- alignCenter: Ne,
72
- getChildrenPopupContainer: j,
73
- wrapClassName: De,
74
- escToExit: R,
75
- modalRender: A,
76
- maskStyle: $e,
77
- wrapStyle: Pe,
78
- closeIcon: K,
79
- fullscreenable: hn,
80
- okButton: m,
81
- ..._
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("");
83
- nn();
84
- const B = i(!0);
85
- s && B.current && (B.current = !1);
86
- const M = i();
87
- M.current || (M.current = Cn++);
88
- const [Ie, I] = rn(!1, {
70
+ mask: Ne,
71
+ alignCenter: Pe,
72
+ getChildrenPopupContainer: _,
73
+ wrapClassName: $e,
74
+ escToExit: I,
75
+ modalRender: G,
76
+ maskStyle: De,
77
+ wrapStyle: Re,
78
+ closeIcon: J,
79
+ fullscreenable: f,
80
+ cancelButton: p,
81
+ okButton: g,
82
+ draggable: Ie,
83
+ closable: Be,
84
+ ...Oe
85
+ } = d, k = f ? !1 : Ne, B = f ? !1 : Ie, C = a(null), Q = a(null), i = a(null), [ee, ne] = N(), [te, Xe] = N(), w = a(null), b = a(!1), [Ye, re] = N(""), [Le, oe] = N("");
86
+ cn();
87
+ const O = a(!0);
88
+ l && O.current && (O.current = !1);
89
+ const M = a();
90
+ M.current || (M.current = Mn++);
91
+ const [Se, X] = dn(!1, {
89
92
  defaultValue: !1,
90
- value: Ee
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 });
93
- function X(e) {
94
- e.stopPropagation(), Y();
93
+ value: Me
94
+ }), t = u.getPrefixCls?.("modal"), He = u.getPrefixCls?.("modal-var"), { locale: Y, rtl: le } = u, Ve = !A, Fe = f ? !0 : "closable" in d ? Be : Ve, ze = sn(() => xn(D()), [D]);
95
+ mn(ze, { hidden: l && k });
96
+ function L(e) {
97
+ e.stopPropagation(), S();
95
98
  }
96
- function Y() {
97
- r.onCancel?.();
99
+ function S() {
100
+ d.onCancel?.();
98
101
  }
99
- const Le = (e) => {
100
- R && s && e.key === un.key && (e.stopPropagation(), Y());
101
- }, L = i(!1), Se = (e) => {
102
- p.current && (p.current = !1, !L.current && ye && h && e.target === e.currentTarget && setTimeout(() => {
103
- Y();
102
+ const qe = (e) => {
103
+ I && l && e.key === bn.key && (e.stopPropagation(), S());
104
+ }, H = a(!1), Ue = (e) => {
105
+ b.current && (b.current = !1, !H.current && ye && k && e.target === e.currentTarget && setTimeout(() => {
106
+ S();
104
107
  }, 100));
105
- }, He = (e) => {
106
- const n = (r.onOk ?? r.onConfirm)?.(e);
107
- n?.then && (I(!0), n.then(
108
+ }, We = (e) => {
109
+ const n = (d.onOk ?? d.onConfirm)?.(e);
110
+ n?.then && (X(!0), n.then(
108
111
  () => {
109
- I(!1);
112
+ X(!1);
110
113
  },
111
- (c) => {
112
- I(!1), console.error(c);
114
+ (s) => {
115
+ X(!1), console.error(s);
113
116
  }
114
117
  ));
115
118
  };
116
- q(() => {
119
+ U(() => {
117
120
  let e = null;
118
- return R && (e = setTimeout(() => {
119
- an(document.body, f.current) && f.current?.focus();
121
+ return I && (e = setTimeout(() => {
122
+ gn(document.body, C.current) && C.current?.focus();
120
123
  })), () => {
121
124
  e && clearTimeout(e);
122
125
  };
123
- }, [s, R]);
124
- const Fe = () => {
125
- if (s && ee === void 0 && f.current) {
126
- const e = +window.getComputedStyle(f.current, null)?.zIndex;
127
- isNaN(e) || Re(e + 1);
126
+ }, [l, I]);
127
+ const Ze = () => {
128
+ if (l && te === void 0 && C.current) {
129
+ const e = +window.getComputedStyle(C.current, null)?.zIndex;
130
+ isNaN(e) || Xe(e + 1);
128
131
  }
129
- }, Ve = () => {
130
- if (x === null)
132
+ }, je = () => {
133
+ if (m === !1 || m === null)
131
134
  return;
132
- const e = r.cancelButton?.visible !== !1 && /* @__PURE__ */ o(
133
- de,
135
+ const e = p?.visible !== !1 && /* @__PURE__ */ r(
136
+ me,
134
137
  {
135
- onClick: X,
136
- ...Me,
137
- ...r.cancelButton?.props,
138
- children: r.cancelButton?.props?.children || r.cancelButton?.label || r.cancelButton?.text || xe || O?.Modal.cancelText
138
+ onClick: L,
139
+ ...ke,
140
+ ...p?.props,
141
+ children: p?.props?.children || p?.label || p?.text || he || Y?.Modal.cancelText
139
142
  }
140
- ), n = m?.visible !== !1 && /* @__PURE__ */ o(
141
- de,
143
+ ), n = g?.visible !== !1 && /* @__PURE__ */ r(
144
+ me,
142
145
  {
143
- loading: Ie,
144
- onClick: He,
146
+ loading: Se,
147
+ onClick: We,
145
148
  type: "primary",
146
149
  ...ve,
147
- ...m?.props,
148
- children: m?.props?.children || m?.label || m?.text || he || O?.Modal.okText
150
+ ...g?.props,
151
+ children: g?.props?.children || g?.label || g?.text || xe || Y?.Modal.okText
149
152
  }
150
- ), c = ue(x) ? x(e, n) : x || /* @__PURE__ */ E(Ke, { children: [
151
- !ke && e,
153
+ ), s = de(m) ? m(e, n) : m || /* @__PURE__ */ y(nn, { children: [
154
+ !Te && e,
152
155
  n
153
156
  ] });
154
- return /* @__PURE__ */ o("div", { className: `${t}-footer`, children: c });
155
- }, S = i(
156
- ae()
157
- ), ze = k((e) => {
158
- if (!a.current) return;
157
+ if (s)
158
+ return /* @__PURE__ */ r("div", { className: `${t}-footer`, children: s });
159
+ }, V = a(
160
+ ie()
161
+ );
162
+ function Ae(e) {
163
+ if (!i.current) return;
159
164
  e.preventDefault();
160
- const n = S.current;
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) => {
165
+ const n = V.current;
166
+ 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?.() ?? {}, Ke();
167
+ }
168
+ function se(e) {
163
169
  e.preventDefault();
164
- const n = S.current, { left: c, right: V, top: z, bottom: Ze } = n.boundingClientRect ?? {}, { width: je, height: Ae } = n.offsetParentBoundingClientRect ?? {};
165
- let g = Math.max(e.screenX - n.screenX, -c);
166
- g = Math.min(g, je - V);
167
- let C = Math.max(e.screenY - n.screenY, -z);
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)`);
169
- }, []), se = k((e) => {
170
- e.preventDefault(), w();
171
- }, []);
172
- function qe() {
173
- document.documentElement.addEventListener(
170
+ const n = V.current, { left: s, right: z, top: q, bottom: Je } = n.boundingClientRect ?? {}, { width: Qe, height: en } = n.offsetParentBoundingClientRect ?? {};
171
+ let h = Math.max(e.screenX - n.screenX, -s);
172
+ h = Math.min(h, Qe - z);
173
+ let x = Math.max(e.screenY - n.screenY, -q);
174
+ x = Math.min(x, en - Je), h += n.prewTranslateX, x += n.prewTranslateY, n.translateX = h, n.translateY = x, re(`translate(${h}px, ${x}px)`);
175
+ }
176
+ function ae(e) {
177
+ e.preventDefault(), E();
178
+ }
179
+ function Ke() {
180
+ E(), document.documentElement.addEventListener(
174
181
  "mousemove",
175
- le
182
+ se
176
183
  ), document.documentElement.addEventListener(
177
184
  "mouseup",
178
- se
185
+ ae
179
186
  );
180
187
  }
181
- function w() {
188
+ function E() {
182
189
  document.documentElement.removeEventListener(
183
190
  "mousemove",
184
- le
191
+ se
185
192
  ), document.documentElement.removeEventListener(
186
193
  "mouseup",
187
- se
194
+ ae
188
195
  );
189
196
  }
190
- function ae() {
197
+ function ie() {
191
198
  return {
192
199
  screenX: 0,
193
200
  screenY: 0,
@@ -199,138 +206,140 @@ function xn(l, y) {
199
206
  offsetParentBoundingClientRect: null
200
207
  };
201
208
  }
202
- function H() {
203
- S.current = ae(), ne(""), re("");
209
+ function F(e) {
210
+ V.current = ie(), re(""), oe("");
204
211
  }
205
- q(() => () => {
206
- H(), w();
207
- }, []), q(() => (a.current || (H(), w()), () => {
208
- }), [a.current]);
209
- const Ue = /* @__PURE__ */ E(
210
- en,
212
+ U(() => () => {
213
+ F(), E();
214
+ }, []), U(() => {
215
+ if (B !== !1)
216
+ return i.current || (F(), E()), () => {
217
+ };
218
+ }, [i.current, B]);
219
+ const _e = /* @__PURE__ */ y(
220
+ an,
211
221
  {
212
- ...d,
222
+ ...u,
213
223
  childrenName: "Modal",
214
- prefixCls: r.prefixCls || d.prefixCls,
215
- locale: O,
216
- zIndex: ee || 1050,
217
- getPopupContainer: (e) => typeof j == "function" ? j(e) : G.current,
224
+ prefixCls: u.prefixCls,
225
+ locale: Y,
226
+ zIndex: te || 1050,
227
+ getPopupContainer: (e) => typeof _ == "function" ? _(e) : Q.current,
218
228
  children: [
219
- (!!b || !!N) && /* @__PURE__ */ E("div", { className: `${t}-header`, children: [
220
- !!b && /* @__PURE__ */ o(
229
+ (!!v || !!$) && /* @__PURE__ */ y("div", { className: `${t}-header`, children: [
230
+ !!v && /* @__PURE__ */ r(
221
231
  "div",
222
232
  {
223
233
  className: `${t}-title`,
224
234
  id: `pqb-dialog-${M.current}`,
225
- children: b
235
+ children: v
226
236
  }
227
237
  ),
228
- !!N && /* @__PURE__ */ o("div", { className: `${t}-subtitle`, children: N })
238
+ !!$ && /* @__PURE__ */ r("div", { className: `${t}-subtitle`, children: $ })
229
239
  ] }),
230
- /* @__PURE__ */ o("div", { ref: G, className: `${t}-content`, children: be }),
231
- Ve(),
232
- !r.fullscreenable && r.draggable !== !1 && /* @__PURE__ */ o(
240
+ /* @__PURE__ */ r("div", { ref: Q, className: `${t}-content`, children: be }),
241
+ je(),
242
+ B !== !1 && /* @__PURE__ */ r(
233
243
  "div",
234
244
  {
235
245
  className: `${t}-drag-icon`,
236
- onMouseDown: ze,
237
- onDoubleClick: H
246
+ onMouseDown: Ae,
247
+ onDoubleClick: F
238
248
  }
239
249
  ),
240
- (Xe || !!r.fullscreenable) && (K !== void 0 ? /* @__PURE__ */ o(
250
+ Fe && (J !== void 0 ? /* @__PURE__ */ r(
241
251
  "span",
242
252
  {
243
253
  className: `${t}-close-icon`,
244
- onClick: X,
245
- children: K
254
+ onClick: L,
255
+ children: J
246
256
  }
247
- ) : /* @__PURE__ */ o(
248
- ln,
257
+ ) : /* @__PURE__ */ r(
258
+ fn,
249
259
  {
250
260
  tabIndex: -1,
251
261
  className: `${t}-close-icon`,
252
- onClick: X,
262
+ onClick: L,
253
263
  role: "button",
254
264
  "aria-label": "Close",
255
- children: /* @__PURE__ */ o(_e, {})
265
+ children: /* @__PURE__ */ r(tn, {})
256
266
  }
257
267
  ))
258
268
  ]
259
269
  }
260
- ), We = b ? { "aria-labelledby": `pqb-dialog-${M.current}` } : {}, ie = /* @__PURE__ */ o(
270
+ ), Ge = v ? { "aria-labelledby": `pqb-dialog-${M.current}` } : {}, ce = /* @__PURE__ */ r(
261
271
  "div",
262
272
  {
263
273
  role: "dialog",
264
274
  "aria-modal": "true",
265
- ...We,
266
- className: fe(
275
+ ...Ge,
276
+ className: W(
267
277
  t,
268
278
  {
269
- [`${t}-simple`]: Z,
270
- [`${t}-rtl`]: oe,
271
- [`${t}-fullscreenable`]: r.fullscreenable
279
+ [`${t}-simple`]: A,
280
+ [`${t}-rtl`]: le,
281
+ [`${t}-fullscreenable`]: f
272
282
  },
273
283
  ge
274
284
  ),
275
285
  style: {
286
+ [`--${He}-transform`]: Ye,
276
287
  ...Ce,
277
- transform: Be,
278
- transformOrigin: te
288
+ ...f ? { width: "100%", height: "100%" } : {},
289
+ transformOrigin: Le
279
290
  },
280
- ref: a,
281
- children: Ue
291
+ ref: i,
292
+ children: _e
282
293
  }
283
- ), F = (e) => {
284
- if (te)
285
- return;
294
+ ), T = (e) => {
286
295
  let n = "";
287
- if (v.current) {
288
- const c = e.getBoundingClientRect(), { left: V, top: z } = v.current;
289
- n = `${V - c.left}px ${z - c.top}px`;
296
+ if (w.current) {
297
+ const s = e.getBoundingClientRect(), { left: z, top: q } = w.current;
298
+ n = `${z - s.left}px ${q - s.top}px`;
290
299
  }
291
- re(n);
292
- }, ce = B.current ? !$ : !!a.current;
293
- return s || ce ? /* @__PURE__ */ o(
294
- sn,
300
+ oe(n);
301
+ }, ue = O.current ? !R : !!i.current;
302
+ return l || ue ? /* @__PURE__ */ r(
303
+ pn,
295
304
  {
296
- visible: s,
297
- forceRender: ce,
305
+ visible: l,
306
+ forceRender: ue,
298
307
  getContainer: D,
299
- children: /* @__PURE__ */ E(
308
+ children: /* @__PURE__ */ y(
300
309
  "div",
301
310
  {
302
- ref: y,
303
- className: `${t}-container`,
311
+ ref: P,
312
+ className: W(`${t}-container`),
304
313
  children: [
305
- h ? /* @__PURE__ */ o(
306
- me,
314
+ k ? /* @__PURE__ */ r(
315
+ fe,
307
316
  {
308
- in: s,
317
+ in: l,
309
318
  timeout: 400,
310
319
  appear: !0,
311
- mountOnEnter: $,
320
+ mountOnEnter: R,
312
321
  classNames: "fadeModal",
313
- unmountOnExit: P,
322
+ unmountOnExit: K,
314
323
  onEnter: (e) => {
315
324
  e && (e.style.display = "block");
316
325
  },
317
326
  onExited: (e) => {
318
327
  e && (e.style.display = "none");
319
328
  },
320
- children: /* @__PURE__ */ o(
329
+ children: /* @__PURE__ */ r(
321
330
  "div",
322
331
  {
323
332
  "aria-hidden": !0,
324
333
  className: `${t}-mask`,
325
- style: $e
334
+ style: De
326
335
  }
327
336
  )
328
337
  }
329
338
  ) : null,
330
- /* @__PURE__ */ o(
339
+ /* @__PURE__ */ r(
331
340
  "div",
332
341
  {
333
- ...dn(_, [
342
+ ...hn(Oe, [
334
343
  "content",
335
344
  "icon",
336
345
  "showIcon",
@@ -344,57 +353,57 @@ function xn(l, y) {
344
353
  ]),
345
354
  tabIndex: -1,
346
355
  ref: (e) => {
347
- f.current = e, Fe();
356
+ C.current = e, Ze();
348
357
  },
349
- className: fe(
358
+ className: W(
350
359
  `${t}-wrapper`,
360
+ k ? `${t}-wrapper-mask` : `${t}-wrapper-no-mask`,
351
361
  {
352
- [`${t}-wrapper-no-mask`]: !h,
353
- [`${t}-wrapper-align-center`]: Ne,
354
- [`${t}-wrapper-rtl`]: oe
362
+ [`${t}-wrapper-align-center`]: Pe,
363
+ [`${t}-wrapper-rtl`]: le
355
364
  },
356
- De
365
+ $e
357
366
  ),
358
367
  style: {
359
- ...Pe || {},
368
+ ...Re || {},
360
369
  // 必须 visible=false,立即设置display:none,否则modal加载react-monaco-editor的时候,编辑器显示异常
361
- display: s || J ? "block" : "none",
362
- overflow: !s && J ? "hidden" : ""
370
+ display: l || ee ? "block" : "none",
371
+ overflow: !l && ee ? "hidden" : ""
363
372
  },
364
- onKeyDown: Le,
373
+ onKeyDown: qe,
365
374
  onMouseDown: (e) => {
366
- p.current = e.target === e.currentTarget;
375
+ b.current = e.target === e.currentTarget;
367
376
  },
368
- onClick: Se,
369
- children: /* @__PURE__ */ o(
370
- me,
377
+ onClick: Ue,
378
+ children: /* @__PURE__ */ r(
379
+ fe,
371
380
  {
372
- in: s,
381
+ in: l,
373
382
  timeout: 400,
374
383
  appear: !0,
375
384
  classNames: "zoomModal",
376
- unmountOnExit: P,
377
- mountOnEnter: $,
385
+ unmountOnExit: K,
386
+ mountOnEnter: R,
378
387
  onEnter: (e) => {
379
- e && (Q(!0), v.current = U, F(e), a.current = e);
388
+ e && (ne(!0), w.current = Z, T(e));
380
389
  },
381
390
  onEntered: (e) => {
382
- e && (F(e), v.current = null, Te?.());
391
+ e && (T(e), w.current = null, Ee?.());
383
392
  },
384
- onExit: () => {
385
- L.current = !0;
393
+ onExit: (e) => {
394
+ e && (T(e), H.current = !0);
386
395
  },
387
396
  onExited: (e) => {
388
- e && (Q(!1), F(e), we?.(), L.current = !1, P && (a.current = null));
397
+ e && (ne(!1), T(e), we?.(), H.current = !1);
389
398
  },
390
- children: Ge.cloneElement(
391
- ue(A) ? A(ie) : ie,
399
+ children: rn.cloneElement(
400
+ de(G) ? G(ce) : ce,
392
401
  {
393
402
  onMouseDown: () => {
394
- p.current = !1;
403
+ b.current = !1;
395
404
  },
396
405
  onMouseUp: () => {
397
- p.current = !1;
406
+ b.current = !1;
398
407
  }
399
408
  }
400
409
  )
@@ -408,27 +417,28 @@ function xn(l, y) {
408
417
  }
409
418
  ) : null;
410
419
  }
411
- const u = Je(
412
- xn
420
+ const c = on(
421
+ Tn
413
422
  );
414
- u.displayName = "Modal";
415
- u.config = fn;
416
- u.show = (l) => W({ ...l, noticeType: "show" });
417
- u.confirm = (l) => W(l);
418
- u.useModal = pn;
419
- ["info", "success", "warning", "error"].forEach((l) => {
420
- u[l] = (y) => W({
421
- ...y,
423
+ c.displayName = "Modal";
424
+ c.config = vn;
425
+ c.show = (o) => j({ ...o, noticeType: "show" });
426
+ c.confirm = (o) => j(o);
427
+ c.useModal = kn;
428
+ ["info", "success", "warning", "error"].forEach((o) => {
429
+ c[o] = (P) => j({
430
+ ...P,
422
431
  isNotice: !0,
423
- noticeType: l
432
+ noticeType: o
424
433
  });
425
434
  });
426
- u.destroyAll = () => {
435
+ c.destroyAll = () => {
427
436
  for (; pe.length; ) {
428
- const l = pe.pop();
429
- l && l();
437
+ const o = pe.pop();
438
+ o && o();
430
439
  }
431
440
  };
432
441
  export {
433
- u as default
442
+ c as default,
443
+ kn as useModal
434
444
  };