@unicom-cloud/ui 0.8.72 → 0.8.73

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 (357) hide show
  1. package/Affix.js +2 -2
  2. package/Alert.js +2 -2
  3. package/AutoComplete.js +2 -2
  4. package/BackTop.js +2 -2
  5. package/Badge.js +2 -2
  6. package/Breadcrumb.js +3 -3
  7. package/Button.js +1 -1
  8. package/Calendar.js +1 -1
  9. package/Card.js +1 -1
  10. package/Carousel.js +1 -1
  11. package/Cascader.js +1 -1
  12. package/Checkbox.js +1 -1
  13. package/Collapse.js +1 -1
  14. package/ColorPicker.js +1 -1
  15. package/Comment.js +1 -1
  16. package/ConfigProvider.js +1 -1
  17. package/Copy.js +1 -1
  18. package/DatePicker.js +1 -1
  19. package/Descriptions.js +1 -1
  20. package/Divider.js +1 -1
  21. package/Draggable.js +1 -1
  22. package/Dropdown.js +4 -4
  23. package/Empty.js +1 -1
  24. package/Icon.js +1 -1
  25. package/IconHover.js +1 -1
  26. package/Image.js +1 -1
  27. package/InputNumber.js +1 -1
  28. package/Layout.js +1 -1
  29. package/Link.js +1 -1
  30. package/List.js +2 -2
  31. package/Mentions.js +2 -2
  32. package/Menu.js +1 -1
  33. package/Message.js +6 -5
  34. package/Modal.js +1 -1
  35. package/Notice.js +4 -4
  36. package/Notification.js +7 -6
  37. package/OverflowEllipsis.js +1 -1
  38. package/PageHeader.js +1 -1
  39. package/Popconfirm.js +2 -2
  40. package/Popover.js +2 -2
  41. package/Progress.js +1 -1
  42. package/Radio.js +1 -1
  43. package/Rate.js +2 -2
  44. package/ResizeBox.js +2 -2
  45. package/Result.js +1 -1
  46. package/SelectView.js +4 -3
  47. package/Skeleton.js +1 -1
  48. package/Slider.js +3 -3
  49. package/Space.js +1 -1
  50. package/SpeechSynthesis.js +20 -20
  51. package/Spin.js +2 -2
  52. package/Statistic.js +1 -1
  53. package/Steps.js +1 -1
  54. package/Switch.js +7 -5
  55. package/Table.js +1 -1
  56. package/Tabs.js +1 -1
  57. package/Tag.js +1 -1
  58. package/Tooltip.js +3 -3
  59. package/Transfer.js +2 -2
  60. package/Tree.js +1 -1
  61. package/Trigger.js +8 -7
  62. package/affix/index.js +2 -2
  63. package/alert/index.js +2 -2
  64. package/anchor/Anchor.js +53 -50
  65. package/anchor/Link.js +1 -1
  66. package/anchor/util.js +1 -1
  67. package/auto-complete/index.js +2 -2
  68. package/avatar/Avatar.js +1 -1
  69. package/avatar/Group.js +1 -1
  70. package/back-top/index.js +2 -2
  71. package/badge/Count.js +1 -1
  72. package/badge/index.js +50 -48
  73. package/breadcrumb/index.js +3 -3
  74. package/button/Group.js +1 -1
  75. package/button/index.js +1 -1
  76. package/calendar/index.js +2 -2
  77. package/card/Grid.js +1 -1
  78. package/card/Meta.js +1 -1
  79. package/card/index.js +1 -1
  80. package/carousel/Arrow.js +1 -1
  81. package/carousel/Indicator.js +1 -1
  82. package/carousel/index.js +1 -1
  83. package/cascader/Cascader.js +4 -4
  84. package/cascader/index.js +1 -1
  85. package/cascader/util.js +1 -1
  86. package/checkbox/Checkbox.js +3 -3
  87. package/checkbox/Group.js +3 -3
  88. package/checkbox/index.js +1 -1
  89. package/chunk/{BnWo0OJ0.js → 7HDzVe32.js} +7 -7
  90. package/chunk/{6nKl68Er.js → B0UZ1Ee2.js} +3 -3
  91. package/chunk/{b1e8awfs.js → B0n0iRhF.js} +1 -1
  92. package/chunk/{BDHuWwhT.js → B7hulkj9.js} +2 -2
  93. package/chunk/Bj4EV0eG.js +27 -0
  94. package/chunk/{Bfq4YEcr.js → Bmvhjhzq.js} +9 -8
  95. package/chunk/{Cgbja_v_.js → Byd0ztYY.js} +13 -12
  96. package/chunk/{URXCKjXr.js → C0pRaDCf.js} +23 -23
  97. package/chunk/{B4JiMp8I.js → CCVU-Kst.js} +8 -2
  98. package/chunk/{ClaNycDy.js → Cc_-i0o_.js} +2 -2
  99. package/chunk/CiY7w1ZO.js +647 -0
  100. package/chunk/{fFjj2KuF.js → Cj2SQJiO.js} +392 -414
  101. package/chunk/Coz3rCng.js +33 -0
  102. package/chunk/{BHL-PzAD.js → CplLA01W.js} +17 -17
  103. package/chunk/{CAVVFFyZ.js → D2LLXZQX.js} +5 -7
  104. package/chunk/DAAff-FT.js +59 -0
  105. package/chunk/{Cf4qn5jY.js → DJDOFlqC.js} +2 -2
  106. package/chunk/DU1RCDfh.js +29 -0
  107. package/chunk/{CdaT1b_F.js → DeV0v__J.js} +2 -2
  108. package/chunk/{IUjEMHU1.js → DejjIa3N.js} +176 -173
  109. package/chunk/{y9unmTx_.js → Dg0M2OmF.js} +125 -125
  110. package/chunk/{DV7ywe_q.js → RS6OAxzv.js} +2 -2
  111. package/chunk/{rp1MtSd0.js → UDX9U6M7.js} +3 -3
  112. package/chunk/{Biupwn8l.js → ZrBrCzQX.js} +6 -5
  113. package/chunk/{CP7Ac47f.js → oHDWCJnz.js} +3 -3
  114. package/chunk/{CdAuhef7.js → uH6uxyao.js} +1 -1
  115. package/chunk/{D090jlwP.js → xAb6ZgqS.js} +1 -1
  116. package/collapse/Collapse.js +3 -3
  117. package/collapse/Item.js +3 -3
  118. package/collapse/index.js +1 -1
  119. package/color-picker/ControlBar.js +1 -1
  120. package/color-picker/InputAlpha.js +1 -1
  121. package/color-picker/InputHex.js +8 -8
  122. package/color-picker/InputRgb.js +6 -6
  123. package/color-picker/Palette.js +2 -2
  124. package/color-picker/Panel.js +16 -16
  125. package/color-picker/colors.js +4 -4
  126. package/color-picker/index.js +3 -3
  127. package/color-picker/utils.js +1 -1
  128. package/comment/index.js +1 -1
  129. package/config-provider/ConfigProvider.js +2 -2
  130. package/config-provider/context.js +1 -1
  131. package/config-provider/index.js +2 -2
  132. package/copy/index.js +1 -1
  133. package/date-picker/Picker.js +1 -1
  134. package/date-picker/PickerRange.js +2 -2
  135. package/date-picker/index.js +1 -1
  136. package/descriptions/index.js +2 -2
  137. package/divider/index.js +1 -1
  138. package/draggable/index.js +1 -1
  139. package/drawer/Drawer.js +121 -111
  140. package/dropdown/Button.js +1 -1
  141. package/dropdown/index.js +4 -4
  142. package/empty/index.js +1 -1
  143. package/form/Form.js +2 -2
  144. package/form/FormItem.js +2 -2
  145. package/form/promisify.js +9 -8
  146. package/form/store.js +1 -1
  147. package/form/util.js +1 -1
  148. package/grid/Col.js +1 -1
  149. package/grid/Row.js +2 -2
  150. package/grid/grid-item.js +2 -2
  151. package/grid/grid.js +2 -2
  152. package/hooks/index.js +5 -5
  153. package/hooks/useInView.js +1 -1
  154. package/hooks/useIntersectionObserver.js +1 -1
  155. package/hooks/useMergeValue.js +1 -1
  156. package/hooks/useOverflowHidden.js +1 -1
  157. package/hooks/useOverrideRef.js +1 -1
  158. package/hooks/useVerificationCode.js +2 -2
  159. package/icon/index.js +1 -1
  160. package/icon-hover/index.js +1 -1
  161. package/image/Image.js +4 -4
  162. package/image/ImagePreview.js +8 -8
  163. package/image/ImagePreviewArrow.js +1 -1
  164. package/image/ImagePreviewGroup.js +2 -2
  165. package/image/index.js +1 -1
  166. package/index.js +591 -571
  167. package/input/Group.js +1 -1
  168. package/input/Input.js +47 -46
  169. package/input/InputElement.js +3 -3
  170. package/input/Password.js +2 -2
  171. package/input/Search.js +2 -2
  172. package/input/Textarea.js +6 -5
  173. package/input-number/index.js +1 -1
  174. package/input-tag/InputTag.js +52 -50
  175. package/layout/Content.js +1 -1
  176. package/layout/Footer.js +1 -1
  177. package/layout/Header.js +1 -1
  178. package/layout/Sider.js +3 -3
  179. package/layout/index.js +1 -1
  180. package/link/index.js +1 -1
  181. package/list/Item.js +1 -1
  182. package/list/Meta.js +1 -1
  183. package/list/index.js +2 -2
  184. package/locale/en-US.js +1 -1
  185. package/locale/tr-TR.js +1 -1
  186. package/mentions/index.js +2 -2
  187. package/menu/Item.js +1 -1
  188. package/menu/Menu.js +3 -3
  189. package/menu/OverflowWrap.js +1 -1
  190. package/menu/index.js +2 -2
  191. package/message/index.js +6 -5
  192. package/message/useMessage.js +1 -1
  193. package/modal/Confirm.js +2 -2
  194. package/modal/Modal.js +8 -7
  195. package/modal/index.js +1 -1
  196. package/notice/index.js +4 -4
  197. package/notification/index.js +7 -6
  198. package/notification/useNotification.js +1 -1
  199. package/overflow-ellipsis/OverflowItem.js +1 -1
  200. package/overflow-ellipsis/index.js +1 -1
  201. package/package.json +1 -1
  202. package/page-header/index.js +1 -1
  203. package/pagination/PageItem.js +1 -1
  204. package/pagination/PageJumper.js +1 -1
  205. package/pagination/PageOption.js +1 -1
  206. package/pagination/Pagination.js +2 -2
  207. package/picker/Input.js +1 -1
  208. package/picker/InputRange.js +1 -1
  209. package/popconfirm/index.js +2 -2
  210. package/popover/index.js +2 -2
  211. package/progress/index.js +1 -1
  212. package/radio/Group.js +3 -3
  213. package/radio/Radio.js +3 -3
  214. package/radio/index.js +2 -2
  215. package/rate/index.js +26 -26
  216. package/resize-box/ResizeTrigger.js +21 -20
  217. package/resize-box/Split.js +1 -1
  218. package/resize-box/SplitGroup.js +1 -1
  219. package/resize-box/index.js +2 -2
  220. package/result/index.js +1 -1
  221. package/select/Option.js +1 -1
  222. package/select/Select.js +5 -4
  223. package/select/util.js +12 -12
  224. package/select-view/Core.js +3 -3
  225. package/select-view/index.js +2 -1
  226. package/skeleton/index.js +1 -1
  227. package/slider/Button.js +2 -2
  228. package/slider/Tick.js +1 -1
  229. package/slider/index.js +19 -19
  230. package/slider/util.js +8 -8
  231. package/space/index.js +1 -1
  232. package/speech-synthesis/index.js +20 -20
  233. package/spin/DotLoading.js +1 -1
  234. package/spin/index.js +2 -2
  235. package/statistic/Countdown.js +1 -1
  236. package/statistic/index.js +1 -1
  237. package/steps/index.js +1 -1
  238. package/style/variables.less +1 -1
  239. package/style.css +1 -1
  240. package/switch/index.js +16 -14
  241. package/table/Table.js +2 -2
  242. package/table/index.js +3 -3
  243. package/tabs/Tab.js +3 -3
  244. package/tabs/TabContent.js +2 -2
  245. package/tabs/TabPane.js +1 -1
  246. package/tabs/index.js +2 -2
  247. package/tag/index.js +1 -1
  248. package/time-picker/Picker.js +1 -1
  249. package/time-picker/TimePicker.js +1 -1
  250. package/timeline/Item.js +1 -1
  251. package/timeline/Timeline.js +1 -1
  252. package/tooltip/index.js +3 -3
  253. package/transfer/Item.js +2 -2
  254. package/transfer/List.js +2 -2
  255. package/transfer/index.js +2 -2
  256. package/tree/Animation.js +3 -3
  257. package/tree/Node.js +3 -3
  258. package/tree/NodeList.js +2 -2
  259. package/tree/Tree.js +3 -3
  260. package/tree/index.js +1 -1
  261. package/tree-select/Select.js +25 -25
  262. package/trigger/getPopupStyle.js +2 -2
  263. package/trigger/index.js +7 -6
  264. package/types/badge/interface.d.ts +1 -0
  265. package/types/color-picker/colors.d.ts +1 -1
  266. package/types/date-picker/util.d.ts +1 -1
  267. package/types/drawer/interface.d.ts +10 -0
  268. package/types/index.d.ts +0 -7
  269. package/types/modal/Confirm.d.ts +1 -0
  270. package/types/utils/PqbCSSTransition.d.ts +3 -0
  271. package/types/utils/caseName.d.ts +1 -0
  272. package/types/utils/className.d.ts +1 -0
  273. package/types/utils/color.d.ts +1 -0
  274. package/types/utils/computeScrollIntoView.d.ts +1 -0
  275. package/types/utils/contextHolder.d.ts +1 -0
  276. package/types/utils/copy.d.ts +1 -0
  277. package/types/utils/fileToURL.d.ts +1 -0
  278. package/types/utils/fillNBSP.d.ts +1 -0
  279. package/types/utils/getHighlightText.d.ts +1 -0
  280. package/types/utils/getHotkeyHandler.d.ts +1 -0
  281. package/types/utils/getStringLength.d.ts +1 -0
  282. package/types/utils/include.d.ts +1 -0
  283. package/types/utils/index.d.ts +29 -25
  284. package/types/utils/is.d.ts +1 -1
  285. package/types/utils/keyboardCode.d.ts +1 -0
  286. package/types/utils/math.d.ts +1 -0
  287. package/types/utils/mergeProps.d.ts +1 -0
  288. package/types/utils/mergedToString.d.ts +1 -0
  289. package/types/utils/names.d.ts +497 -81
  290. package/types/utils/omit.d.ts +1 -0
  291. package/types/utils/pick.d.ts +1 -1
  292. package/types/utils/reactTransitionGroup.d.ts +1 -0
  293. package/types/utils/responsiveObserve.d.ts +1 -0
  294. package/types/utils/saveAs.d.ts +1 -0
  295. package/types/utils/screenfull.d.ts +1 -0
  296. package/types/utils/scrollIntoView.d.ts +1 -0
  297. package/types/utils/tinycolor.d.ts +1 -0
  298. package/types/utils/tree.d.ts +1 -0
  299. package/types/utils/tween.d.ts +1 -0
  300. package/types/utils/uuid.d.ts +1 -0
  301. package/types/utils/validate.d.ts +1 -0
  302. package/types/version/index.d.ts +1 -1
  303. package/typography/Base.js +6 -5
  304. package/typography/Ellipsis.js +30 -29
  305. package/typography/Paragraph.js +1 -1
  306. package/typography/Typography.js +1 -1
  307. package/typography/index.js +28 -27
  308. package/upload/TriggerNode.js +1 -1
  309. package/upload/Upload.js +60 -58
  310. package/upload/Uploader.js +21 -21
  311. package/upload/request_.js +4 -3
  312. package/utils/PqbCSSTransition.js +5 -0
  313. package/utils/caseName.js +3 -2
  314. package/utils/className.js +3 -2
  315. package/{chunk/B6X4lnd0.js → utils/color.js} +55 -53
  316. package/utils/computeScrollIntoView.js +128 -0
  317. package/utils/contextHolder.js +3 -2
  318. package/utils/copy.js +4 -2
  319. package/utils/fileToURL.js +3 -2
  320. package/utils/fillNBSP.js +2 -1
  321. package/utils/getHighlightText.js +2 -1
  322. package/utils/getHotkeyHandler.js +2 -1
  323. package/utils/getStringLength.js +2 -1
  324. package/utils/include.js +2 -1
  325. package/utils/index.js +302 -249
  326. package/utils/is.js +104 -101
  327. package/utils/keyboardCode.js +2 -1
  328. package/utils/math.js +35 -0
  329. package/utils/mergeProps.js +2 -1
  330. package/utils/mergedToString.js +2 -1
  331. package/utils/names.js +332 -81
  332. package/utils/omit.js +2 -1
  333. package/utils/pick.js +1 -0
  334. package/utils/react19Adapter.js +1 -1
  335. package/utils/reactDOM.js +1 -1
  336. package/utils/reactTransitionGroup.js +10 -0
  337. package/utils/responsiveObserve.js +2 -1
  338. package/utils/saveAs.js +3 -2
  339. package/utils/screenfull.js +2 -1
  340. package/utils/scrollIntoView.js +4 -2
  341. package/utils/tinycolor.js +30 -0
  342. package/utils/tree.js +87 -0
  343. package/utils/tween.js +6 -0
  344. package/utils/uuid.js +5 -0
  345. package/utils/validate.js +7 -0
  346. package/verification-code/VerificationCode.js +1 -1
  347. package/version/index.js +3 -3
  348. package/virtual-list/VirtualList.js +1 -1
  349. package/watermark/Watermark.js +1 -1
  350. package/chunk/BibHFOCF.js +0 -34
  351. package/chunk/CVYWxu00.js +0 -155
  352. package/chunk/CbLaCJmG.js +0 -26
  353. package/chunk/D-TPB2Do.js +0 -56
  354. package/chunk/DVfOiRp-.js +0 -629
  355. package/chunk/DxxOUMSa.js +0 -98
  356. package/types/utils/CSSTransition.d.ts +0 -2
  357. package/utils/CSSTransition.js +0 -4
@@ -0,0 +1,647 @@
1
+ import { jsx as s, jsxs as O, Fragment as rn } from "react/jsx-runtime";
2
+ import ln from "@unicom-cloud/icons/IconUiClose";
3
+ import Ie from "lodash/isFunction";
4
+ import sn, { forwardRef as Oe, useState as $, useImperativeHandle as an, useRef as x, useContext as cn, useCallback as U, useEffect as oe } from "react";
5
+ import De from "../button/index.js";
6
+ import { b as Le, d as un, a as dn, I as mn } from "./Byd0ztYY.js";
7
+ import { u as fn } from "./oopARUrq.js";
8
+ import { u as pn } from "./BFTV6myl.js";
9
+ import { u as Cn } from "./DeV0v__J.js";
10
+ import { u as hn } from "./DU1RCDfh.js";
11
+ import bn from "../portal/index.js";
12
+ import { P as $e } from "./Bj4EV0eG.js";
13
+ import { m as Be } from "./JPPo5nY_.js";
14
+ import { contains as gn, isServerRendering as xn } from "../utils/dom.js";
15
+ import { o as kn } from "./BrOW642m.js";
16
+ import { o as vn } from "./BKKEev13.js";
17
+ import { f as wn } from "./Cc_-i0o_.js";
18
+ import En from "@unicom-cloud/icons/IconUiCheckCircleFill";
19
+ import Mn from "@unicom-cloud/icons/IconUiCloseCircleFill";
20
+ import Re from "@unicom-cloud/icons/IconUiExclamationCircleFill";
21
+ import Tn from "@unicom-cloud/icons/IconUiInfoCircleFill";
22
+ import { createRoot as yn } from "react-dom/client";
23
+ import { destroyList as D, getConfigProviderProps as Nn, getModalConfig as Pn, setModalConfig as In } from "../modal/config.js";
24
+ function Dn(n) {
25
+ const { prefixCls: i, simple: u } = Pn();
26
+ return /* @__PURE__ */ s(T, { prefixCls: i, simple: u, ...n, children: n.content });
27
+ }
28
+ const V = (n) => {
29
+ let i = n.icon;
30
+ if (!i) {
31
+ if (i !== null) {
32
+ if (i = /* @__PURE__ */ s(Re, {}), n.isNotice)
33
+ switch (n.noticeType) {
34
+ case "info":
35
+ i = /* @__PURE__ */ s(Tn, {});
36
+ break;
37
+ case "success":
38
+ i = /* @__PURE__ */ s(En, {});
39
+ break;
40
+ case "warning":
41
+ i = /* @__PURE__ */ s(Re, {});
42
+ break;
43
+ case "error":
44
+ i = /* @__PURE__ */ s(Mn, {});
45
+ break;
46
+ }
47
+ }
48
+ }
49
+ return n.noticeType === "show" && (i = n.icon), n.isNotice && (n.hideCancel = !0), n.title = i === null && n.title === null ? null : /* @__PURE__ */ O("span", { children: [
50
+ i,
51
+ n.title
52
+ ] }), n;
53
+ };
54
+ function le(n, i) {
55
+ let u;
56
+ const t = document.createElement("div");
57
+ t.className = "pqb-modal-root", document.body.appendChild(t);
58
+ const m = Nn();
59
+ function k(a) {
60
+ const h = /* @__PURE__ */ s(Le, { ...m, children: /* @__PURE__ */ s(
61
+ Dn,
62
+ {
63
+ getPopupContainer: () => t,
64
+ ...a,
65
+ onCancel: C
66
+ }
67
+ ) });
68
+ u || (u = yn(t)), u.render(h);
69
+ }
70
+ const l = i || k;
71
+ let r = {
72
+ ...n,
73
+ visible: !1
74
+ };
75
+ const c = () => {
76
+ let a;
77
+ const h = n.onOk;
78
+ h && (a = h(C)), a && a.then && (r.confirmLoading = !0, l(r), a.then(
79
+ () => {
80
+ C(!0);
81
+ },
82
+ (f) => {
83
+ console.error(f), r.confirmLoading = !1, l(r);
84
+ }
85
+ )), a || C(!0);
86
+ };
87
+ r.onOk = c, r = V(r), r.visible = !0, l(r);
88
+ function b() {
89
+ t.remove();
90
+ for (let a = 0; a < D.length; a++)
91
+ if (D[a] === v) {
92
+ D.splice(a, 1);
93
+ break;
94
+ }
95
+ u && setTimeout(() => {
96
+ u.unmount(), u = null;
97
+ }, 7);
98
+ }
99
+ function C(a) {
100
+ var h;
101
+ !a && ((h = n.onCancel) == null || h.call(n)), v();
102
+ }
103
+ function P(a) {
104
+ r = {
105
+ ...r,
106
+ title: n.title,
107
+ // 避免 newConfig 未传递 title 时,icon 出现多个的问题
108
+ ...a
109
+ }, r = V(r), l(r);
110
+ }
111
+ function v() {
112
+ r.visible = !1, r.afterClose = () => {
113
+ var a;
114
+ (a = n.afterClose) == null || a.call(n), b();
115
+ }, l(r);
116
+ }
117
+ return D.push(v), {
118
+ close: v,
119
+ update: P,
120
+ destroy: b
121
+ };
122
+ }
123
+ function $n(n, i) {
124
+ const [u, t] = $(!0), [m, k] = $(n);
125
+ an(i, () => ({
126
+ update: (c) => {
127
+ k(c);
128
+ },
129
+ close: () => {
130
+ t(!1);
131
+ }
132
+ }));
133
+ function l() {
134
+ var b;
135
+ const c = (b = m.onOk) == null ? void 0 : b.call(m);
136
+ c && c.then && (k((C) => ({
137
+ ...C,
138
+ confirmLoading: !0
139
+ })), c.then(
140
+ () => {
141
+ t(!1);
142
+ },
143
+ (C) => {
144
+ console.error(C), k((P) => ({
145
+ ...P,
146
+ confirmLoading: !1
147
+ }));
148
+ }
149
+ )), c || t(!1);
150
+ }
151
+ function r() {
152
+ var c;
153
+ (c = m.onCancel) == null || c.call(m), t(!1);
154
+ }
155
+ return /* @__PURE__ */ s(
156
+ T,
157
+ {
158
+ unmountOnExit: !0,
159
+ simple: !0,
160
+ ...m,
161
+ visible: u,
162
+ onOk: l,
163
+ onCancel: r,
164
+ children: m.content
165
+ }
166
+ );
167
+ }
168
+ const Bn = Oe($n);
169
+ function Rn() {
170
+ const n = x(), i = /* @__PURE__ */ s(un, { ref: n });
171
+ let u = 0;
172
+ function t(l) {
173
+ var h;
174
+ u += 1;
175
+ let r, c = { ...l };
176
+ function b() {
177
+ var f;
178
+ (f = l.afterClose) == null || f.call(l), P();
179
+ }
180
+ const C = /* @__PURE__ */ s(
181
+ Bn,
182
+ {
183
+ ref: (f) => {
184
+ r = f;
185
+ },
186
+ ...V({ ...l }),
187
+ afterClose: b
188
+ },
189
+ u
190
+ );
191
+ (h = n.current) == null || h.addInstance(C);
192
+ function P() {
193
+ var f;
194
+ (f = n.current) == null || f.removeInstance(C);
195
+ }
196
+ function v() {
197
+ r == null || r.close();
198
+ }
199
+ function a(f) {
200
+ c = {
201
+ ...c,
202
+ ...f
203
+ }, r == null || r.update(V({ ...c }));
204
+ }
205
+ return D.push(v), {
206
+ close: v,
207
+ update: a
208
+ };
209
+ }
210
+ function m(l) {
211
+ return t({
212
+ ...l
213
+ });
214
+ }
215
+ const k = {
216
+ confirm: m,
217
+ show: m
218
+ // 潘启宝添加于 2023年10月18日 星期三 10时31分58秒 CST
219
+ };
220
+ return ["info", "success", "warning", "error"].forEach((l) => {
221
+ k[l] = (r) => t({
222
+ ...r,
223
+ isNotice: !0,
224
+ noticeType: l
225
+ });
226
+ }), [k, i];
227
+ }
228
+ let re = null, On = 0;
229
+ xn || document.documentElement.addEventListener(
230
+ "click",
231
+ (n) => {
232
+ re = {
233
+ left: n.clientX,
234
+ top: n.clientY
235
+ }, setTimeout(() => {
236
+ re = null;
237
+ }, 100);
238
+ },
239
+ !0
240
+ );
241
+ const Ln = {
242
+ mask: !0,
243
+ maskClosable: !0,
244
+ mountOnEnter: !0,
245
+ escToExit: !0,
246
+ getPopupContainer: () => document.body,
247
+ alignCenter: !0
248
+ };
249
+ function Xn(n, i) {
250
+ var Ee;
251
+ i || (i = x());
252
+ const u = cn(dn), t = pn(
253
+ n,
254
+ Ln,
255
+ (Ee = u.componentConfig) == null ? void 0 : Ee.Modal
256
+ ), {
257
+ className: m,
258
+ style: k,
259
+ visible: l,
260
+ simple: r,
261
+ title: c,
262
+ subtitle: b,
263
+ children: C,
264
+ cancelText: P,
265
+ okText: v,
266
+ okButtonProps: a,
267
+ cancelButtonProps: h,
268
+ getPopupContainer: f = () => document.body,
269
+ footer: L,
270
+ afterClose: z,
271
+ confirmLoading: Xe,
272
+ mountOnEnter: q,
273
+ unmountOnExit: W,
274
+ afterOpen: Z,
275
+ hideCancel: Ye,
276
+ maskClosable: Fe,
277
+ mask: X,
278
+ alignCenter: He,
279
+ getChildrenPopupContainer: se,
280
+ wrapClassName: Se,
281
+ escToExit: j,
282
+ modalRender: ie,
283
+ maskStyle: Ue,
284
+ wrapStyle: Ve,
285
+ closeIcon: ae,
286
+ fullscreenable: Yn,
287
+ ...ce
288
+ } = t, B = x(null), ue = x(null), w = x(null), [de, me] = $(), [fe, ze] = $(), Y = x(null), R = x(!1), [qe, pe] = $(""), [Ce, he] = $("");
289
+ fn();
290
+ const A = x(!0);
291
+ l && A.current && (A.current = !1);
292
+ const F = x();
293
+ F.current || (F.current = On++);
294
+ const [We, K] = Cn(!1, {
295
+ defaultValue: !1,
296
+ value: Xe
297
+ }), d = u.getPrefixCls("modal", t.prefixCls), { locale: G, rtl: be } = u, Ze = !r || ce.noticeType === "show", je = "closable" in t ? t.closable : Ze, Ae = U(() => wn(f()), [f]);
298
+ hn(Ae, { hidden: l && X });
299
+ function J(e) {
300
+ e.stopPropagation(), Q();
301
+ }
302
+ function Q() {
303
+ var e;
304
+ (e = t.onCancel) == null || e.call(t);
305
+ }
306
+ const Ke = (e) => {
307
+ j && l && e.key === kn.key && (e.stopPropagation(), Q());
308
+ }, _ = x(!1), Ge = (e) => {
309
+ R.current && (R.current = !1, !_.current && Fe && X && e.target === e.currentTarget && setTimeout(() => {
310
+ Q();
311
+ }, 100));
312
+ }, Je = (e) => {
313
+ var p;
314
+ const o = (p = t.onOk ?? t.onConfirm) == null ? void 0 : p(e);
315
+ o != null && o.then && (K(!0), o.then(
316
+ () => {
317
+ K(!1);
318
+ },
319
+ (g) => {
320
+ K(!1), console.error(g);
321
+ }
322
+ ));
323
+ };
324
+ oe(() => {
325
+ let e = null;
326
+ return j && (e = setTimeout(() => {
327
+ var o;
328
+ gn(document.body, B.current) && ((o = B.current) == null || o.focus());
329
+ })), () => {
330
+ e && clearTimeout(e);
331
+ };
332
+ }, [l, j]);
333
+ const Qe = () => {
334
+ var e;
335
+ if (l && fe === void 0 && B.current) {
336
+ const o = +((e = window.getComputedStyle(B.current, null)) == null ? void 0 : e.zIndex);
337
+ isNaN(o) || ze(o + 1);
338
+ }
339
+ }, _e = () => {
340
+ var g, E, M, I, S, y, N, Me, Te, ye, Ne, Pe;
341
+ if (L === null)
342
+ return;
343
+ const e = ((g = t.cancelButton) == null ? void 0 : g.visible) !== !1 && /* @__PURE__ */ s(
344
+ De,
345
+ {
346
+ onClick: J,
347
+ ...h,
348
+ ...(E = t.cancelButton) == null ? void 0 : E.props,
349
+ children: ((I = (M = t.cancelButton) == null ? void 0 : M.props) == null ? void 0 : I.children) || ((S = t.cancelButton) == null ? void 0 : S.label) || ((y = t.cancelButton) == null ? void 0 : y.text) || P || G.Modal.cancelText
350
+ }
351
+ ), o = ((N = t.okButton) == null ? void 0 : N.visible) !== !1 && /* @__PURE__ */ s(
352
+ De,
353
+ {
354
+ loading: We,
355
+ onClick: Je,
356
+ type: "primary",
357
+ ...a,
358
+ ...(Me = t.okButton) == null ? void 0 : Me.props,
359
+ children: ((ye = (Te = t.okButton) == null ? void 0 : Te.props) == null ? void 0 : ye.children) || ((Ne = t.okButton) == null ? void 0 : Ne.label) || ((Pe = t.okButton) == null ? void 0 : Pe.text) || v || G.Modal.okText
360
+ }
361
+ ), p = Ie(L) ? L(e, o) : L || /* @__PURE__ */ O(rn, { children: [
362
+ !Ye && e,
363
+ o
364
+ ] });
365
+ return /* @__PURE__ */ s("div", { className: `${d}-footer`, children: p });
366
+ }, ee = x(
367
+ ke()
368
+ ), en = U((e) => {
369
+ var p, g, E, M, I;
370
+ if (!w.current) return;
371
+ e.preventDefault();
372
+ const o = ee.current;
373
+ o.screenX = e.screenX, o.screenY = e.screenY, o.prewTranslateX = o.translateX, o.prewTranslateY = o.translateY, o.boundingClientRect = ((g = (p = w.current) == null ? void 0 : p.getBoundingClientRect) == null ? void 0 : g.call(p)) ?? {}, o.offsetParentBoundingClientRect = ((I = (M = (E = w.current) == null ? void 0 : E.offsetParent) == null ? void 0 : M.getBoundingClientRect) == null ? void 0 : I.call(M)) ?? {}, H(), nn();
374
+ }, []), ge = U((e) => {
375
+ e.preventDefault();
376
+ const o = ee.current, { left: p, right: g, top: E, bottom: M } = o.boundingClientRect ?? {}, { width: I, height: S } = o.offsetParentBoundingClientRect ?? {};
377
+ let y = Math.max(e.screenX - o.screenX, -p);
378
+ y = Math.min(y, I - g);
379
+ let N = Math.max(e.screenY - o.screenY, -E);
380
+ N = Math.min(N, S - M), y += o.prewTranslateX, N += o.prewTranslateY, o.translateX = y, o.translateY = N, pe(`translate(${y}px, ${N}px)`);
381
+ }, []), xe = U((e) => {
382
+ e.preventDefault(), H();
383
+ }, []);
384
+ function nn() {
385
+ document.documentElement.addEventListener(
386
+ "mousemove",
387
+ ge
388
+ ), document.documentElement.addEventListener(
389
+ "mouseup",
390
+ xe
391
+ );
392
+ }
393
+ function H() {
394
+ document.documentElement.removeEventListener(
395
+ "mousemove",
396
+ ge
397
+ ), document.documentElement.removeEventListener(
398
+ "mouseup",
399
+ xe
400
+ );
401
+ }
402
+ function ke() {
403
+ return {
404
+ screenX: 0,
405
+ screenY: 0,
406
+ prewTranslateX: 0,
407
+ prewTranslateY: 0,
408
+ translateX: 0,
409
+ translateY: 0,
410
+ boundingClientRect: null,
411
+ offsetParentBoundingClientRect: null
412
+ };
413
+ }
414
+ function ne() {
415
+ ee.current = ke(), pe(""), he("");
416
+ }
417
+ oe(() => () => {
418
+ ne(), H();
419
+ }, []), oe(() => (w.current || (ne(), H()), () => {
420
+ }), [w.current]);
421
+ const tn = /* @__PURE__ */ O(
422
+ Le,
423
+ {
424
+ ...u,
425
+ prefixCls: t.prefixCls || u.prefixCls,
426
+ locale: G,
427
+ zIndex: fe || 1050,
428
+ getPopupContainer: (e) => typeof se == "function" ? se(e) : ue.current,
429
+ children: [
430
+ (!!c || !!b) && /* @__PURE__ */ O("div", { className: `${d}-header`, children: [
431
+ !!c && /* @__PURE__ */ s(
432
+ "div",
433
+ {
434
+ className: `${d}-title`,
435
+ id: `pqb-dialog-${F.current}`,
436
+ children: c
437
+ }
438
+ ),
439
+ !!b && /* @__PURE__ */ s("div", { className: `${d}-subtitle`, children: b })
440
+ ] }),
441
+ /* @__PURE__ */ s("div", { ref: ue, className: `${d}-content`, children: C }),
442
+ _e(),
443
+ !t.fullscreenable && t.draggable !== !1 && /* @__PURE__ */ s(
444
+ "div",
445
+ {
446
+ className: `${d}-drag-icon`,
447
+ onMouseDown: en,
448
+ onDoubleClick: ne
449
+ }
450
+ ),
451
+ (je || !!t.fullscreenable) && (ae !== void 0 ? /* @__PURE__ */ s(
452
+ "span",
453
+ {
454
+ className: `${d}-close-icon`,
455
+ onClick: J,
456
+ children: ae
457
+ }
458
+ ) : /* @__PURE__ */ s(
459
+ mn,
460
+ {
461
+ tabIndex: -1,
462
+ className: `${d}-close-icon`,
463
+ onClick: J,
464
+ role: "button",
465
+ "aria-label": "Close",
466
+ children: /* @__PURE__ */ s(ln, {})
467
+ }
468
+ ))
469
+ ]
470
+ }
471
+ ), on = c ? { "aria-labelledby": `pqb-dialog-${F.current}` } : {}, ve = /* @__PURE__ */ s(
472
+ "div",
473
+ {
474
+ role: "dialog",
475
+ "aria-modal": "true",
476
+ ...on,
477
+ className: Be(
478
+ d,
479
+ {
480
+ [`${d}-simple`]: r,
481
+ [`${d}-rtl`]: be,
482
+ [`${d}-fullscreenable`]: t.fullscreenable
483
+ },
484
+ m
485
+ ),
486
+ style: {
487
+ ...k,
488
+ transform: qe,
489
+ transformOrigin: Ce
490
+ },
491
+ ref: w,
492
+ children: tn
493
+ }
494
+ ), te = (e) => {
495
+ if (Ce)
496
+ return;
497
+ let o = "";
498
+ if (Y.current) {
499
+ const p = e.getBoundingClientRect(), { left: g, top: E } = Y.current;
500
+ o = `${g - p.left}px ${E - p.top}px`;
501
+ }
502
+ he(o);
503
+ }, we = A.current ? !q : !!w.current;
504
+ return l || we ? /* @__PURE__ */ s(
505
+ bn,
506
+ {
507
+ visible: l,
508
+ forceRender: we,
509
+ getContainer: f,
510
+ children: /* @__PURE__ */ O(
511
+ "div",
512
+ {
513
+ ref: i,
514
+ className: `${d}-container`,
515
+ children: [
516
+ X ? /* @__PURE__ */ s(
517
+ $e,
518
+ {
519
+ in: l,
520
+ timeout: 400,
521
+ appear: !0,
522
+ mountOnEnter: q,
523
+ classNames: "fadeModal",
524
+ unmountOnExit: W,
525
+ onEnter: (e) => {
526
+ e && (e.style.display = "block");
527
+ },
528
+ onExited: (e) => {
529
+ e && (e.style.display = "none");
530
+ },
531
+ children: /* @__PURE__ */ s(
532
+ "div",
533
+ {
534
+ "aria-hidden": !0,
535
+ className: `${d}-mask`,
536
+ style: Ue
537
+ }
538
+ )
539
+ }
540
+ ) : null,
541
+ /* @__PURE__ */ s(
542
+ "div",
543
+ {
544
+ ...vn(ce, [
545
+ "content",
546
+ "icon",
547
+ "showIcon",
548
+ "isNotice",
549
+ "noticeType",
550
+ "onCancel",
551
+ "onOk",
552
+ "onConfirm",
553
+ "closable",
554
+ "prefixCls"
555
+ ]),
556
+ tabIndex: -1,
557
+ ref: (e) => {
558
+ B.current = e, Qe();
559
+ },
560
+ className: Be(
561
+ `${d}-wrapper`,
562
+ {
563
+ [`${d}-wrapper-no-mask`]: !X,
564
+ [`${d}-wrapper-align-center`]: He,
565
+ [`${d}-wrapper-rtl`]: be
566
+ },
567
+ Se
568
+ ),
569
+ style: {
570
+ ...Ve || {},
571
+ // 必须 visible=false,立即设置display:none,否则modal加载react-monaco-editor的时候,编辑器显示异常
572
+ display: l || de ? "block" : "none",
573
+ overflow: !l && de ? "hidden" : ""
574
+ },
575
+ onKeyDown: Ke,
576
+ onMouseDown: (e) => {
577
+ R.current = e.target === e.currentTarget;
578
+ },
579
+ onClick: Ge,
580
+ children: /* @__PURE__ */ s(
581
+ $e,
582
+ {
583
+ in: l,
584
+ timeout: 400,
585
+ appear: !0,
586
+ classNames: "zoomModal",
587
+ unmountOnExit: W,
588
+ mountOnEnter: q,
589
+ onEnter: (e) => {
590
+ e && (me(!0), Y.current = re, te(e), w.current = e);
591
+ },
592
+ onEntered: (e) => {
593
+ e && (te(e), Y.current = null, Z == null || Z());
594
+ },
595
+ onExit: () => {
596
+ _.current = !0;
597
+ },
598
+ onExited: (e) => {
599
+ e && (me(!1), te(e), z == null || z(), _.current = !1, W && (w.current = null));
600
+ },
601
+ children: sn.cloneElement(
602
+ Ie(ie) ? ie(ve) : ve,
603
+ {
604
+ onMouseDown: () => {
605
+ R.current = !1;
606
+ },
607
+ onMouseUp: () => {
608
+ R.current = !1;
609
+ }
610
+ }
611
+ )
612
+ }
613
+ )
614
+ }
615
+ )
616
+ ]
617
+ }
618
+ )
619
+ }
620
+ ) : null;
621
+ }
622
+ const T = Oe(
623
+ Xn
624
+ );
625
+ T.displayName = "Modal";
626
+ T.config = In;
627
+ T.show = (n) => le({ ...n, noticeType: "show" });
628
+ T.confirm = (n) => le(n);
629
+ T.useModal = Rn;
630
+ ["info", "success", "warning", "error"].forEach((n) => {
631
+ T[n] = (i) => le({
632
+ ...i,
633
+ isNotice: !0,
634
+ noticeType: n
635
+ });
636
+ });
637
+ T.destroyAll = () => {
638
+ for (; D.length; ) {
639
+ const n = D.pop();
640
+ n && n();
641
+ }
642
+ };
643
+ export {
644
+ T as E,
645
+ le as c,
646
+ V as n
647
+ };