@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
package/chunk/DVfOiRp-.js DELETED
@@ -1,629 +0,0 @@
1
- import { jsx as l, jsxs as O, Fragment as _e } from "react/jsx-runtime";
2
- import en from "@unicom-cloud/icons/IconUiClose";
3
- import Ee from "lodash/isFunction";
4
- import nn, { forwardRef as Pe, useState as P, useImperativeHandle as tn, useRef as b, useContext as on, useCallback as S, useEffect as te } from "react";
5
- import Me from "../button/index.js";
6
- import { b as Ie, d as rn, a as ln, I as sn } from "./Cgbja_v_.js";
7
- import { u as an } from "./BFTV6myl.js";
8
- import { u as cn } from "./CdaT1b_F.js";
9
- import { u as un } from "./CbLaCJmG.js";
10
- import dn from "../portal/index.js";
11
- import { P as Te } from "./fFjj2KuF.js";
12
- import { m as ye } from "./JPPo5nY_.js";
13
- import { contains as mn, isServerRendering as fn } from "../utils/dom.js";
14
- import { o as pn } from "./BrOW642m.js";
15
- import { o as Cn } from "./BKKEev13.js";
16
- import { f as hn } from "./ClaNycDy.js";
17
- import bn from "@unicom-cloud/icons/IconUiCheckCircleFill";
18
- import gn from "@unicom-cloud/icons/IconUiCloseCircleFill";
19
- import Ne from "@unicom-cloud/icons/IconUiExclamationCircleFill";
20
- import xn from "@unicom-cloud/icons/IconUiInfoCircleFill";
21
- import { createRoot as vn } from "react-dom/client";
22
- import { destroyList as T, getConfigProviderProps as kn, getModalConfig as wn, setModalConfig as En } from "../modal/config.js";
23
- function Mn(n) {
24
- const { prefixCls: i, simple: u } = wn();
25
- return /* @__PURE__ */ l(w, { prefixCls: i, simple: u, ...n, children: n.content });
26
- }
27
- const U = (n) => {
28
- let i = n.icon;
29
- if (!i && i !== null && (i = /* @__PURE__ */ l(Ne, {}), n.isNotice))
30
- switch (n.noticeType) {
31
- case "info":
32
- i = /* @__PURE__ */ l(xn, {});
33
- break;
34
- case "success":
35
- i = /* @__PURE__ */ l(bn, {});
36
- break;
37
- case "warning":
38
- i = /* @__PURE__ */ l(Ne, {});
39
- break;
40
- case "error":
41
- i = /* @__PURE__ */ l(gn, {});
42
- break;
43
- }
44
- return n.noticeType === "show" && (i = n.icon), n.isNotice && (n.hideCancel = !0), n.title = i === null && n.title === null ? null : /* @__PURE__ */ O("span", { children: [
45
- i,
46
- n.title
47
- ] }), n;
48
- };
49
- function re(n, i) {
50
- let u;
51
- const s = document.createElement("div");
52
- document.body.appendChild(s);
53
- const m = kn();
54
- function g(a) {
55
- const h = /* @__PURE__ */ l(Ie, { ...m, children: /* @__PURE__ */ l(
56
- Mn,
57
- {
58
- ...a,
59
- onCancel: C
60
- }
61
- ) });
62
- u || (u = vn(s)), u.render(h);
63
- }
64
- const r = i || g;
65
- let o = {
66
- ...n,
67
- visible: !1
68
- };
69
- const c = () => {
70
- let a;
71
- const h = n.onOk;
72
- h && (a = h(C)), a && a.then && (o.confirmLoading = !0, r(o), a.then(
73
- () => {
74
- C(!0);
75
- },
76
- (f) => {
77
- console.error(f), o.confirmLoading = !1, r(o);
78
- }
79
- )), a || C(!0);
80
- };
81
- o.onOk = c, o = U(o), o.visible = !0, r(o);
82
- function x() {
83
- s.remove();
84
- for (let a = 0; a < T.length; a++)
85
- if (T[a] === v) {
86
- T.splice(a, 1);
87
- break;
88
- }
89
- u && setTimeout(() => {
90
- u.unmount(), u = null;
91
- }, 7);
92
- }
93
- function C(a) {
94
- var h;
95
- !a && ((h = n.onCancel) == null || h.call(n)), v();
96
- }
97
- function M(a) {
98
- o = {
99
- ...o,
100
- title: n.title,
101
- // 避免 newConfig 未传递 title 时,icon 出现多个的问题
102
- ...a
103
- }, o = U(o), r(o);
104
- }
105
- function v() {
106
- o.visible = !1, o.afterClose = () => {
107
- var a;
108
- (a = n.afterClose) == null || a.call(n), x();
109
- }, r(o);
110
- }
111
- return T.push(v), {
112
- close: v,
113
- update: M
114
- };
115
- }
116
- function Tn(n, i) {
117
- const [u, s] = P(!0), [m, g] = P(n);
118
- tn(i, () => ({
119
- update: (c) => {
120
- g(c);
121
- },
122
- close: () => {
123
- s(!1);
124
- }
125
- }));
126
- function r() {
127
- var x;
128
- const c = (x = m.onOk) == null ? void 0 : x.call(m);
129
- c && c.then && (g((C) => ({
130
- ...C,
131
- confirmLoading: !0
132
- })), c.then(
133
- () => {
134
- s(!1);
135
- },
136
- (C) => {
137
- console.error(C), g((M) => ({
138
- ...M,
139
- confirmLoading: !1
140
- }));
141
- }
142
- )), c || s(!1);
143
- }
144
- function o() {
145
- var c;
146
- (c = m.onCancel) == null || c.call(m), s(!1);
147
- }
148
- return /* @__PURE__ */ l(
149
- w,
150
- {
151
- unmountOnExit: !0,
152
- simple: !0,
153
- ...m,
154
- visible: u,
155
- onOk: r,
156
- onCancel: o,
157
- children: m.content
158
- }
159
- );
160
- }
161
- const yn = Pe(Tn);
162
- function Nn() {
163
- const n = b(), i = /* @__PURE__ */ l(rn, { ref: n });
164
- let u = 0;
165
- function s(r) {
166
- var h;
167
- u += 1;
168
- let o, c = { ...r };
169
- function x() {
170
- var f;
171
- (f = r.afterClose) == null || f.call(r), M();
172
- }
173
- const C = /* @__PURE__ */ l(
174
- yn,
175
- {
176
- ref: (f) => {
177
- o = f;
178
- },
179
- ...U({ ...r }),
180
- afterClose: x
181
- },
182
- u
183
- );
184
- (h = n.current) == null || h.addInstance(C);
185
- function M() {
186
- var f;
187
- (f = n.current) == null || f.removeInstance(C);
188
- }
189
- function v() {
190
- o == null || o.close();
191
- }
192
- function a(f) {
193
- c = {
194
- ...c,
195
- ...f
196
- }, o == null || o.update(U({ ...c }));
197
- }
198
- return T.push(v), {
199
- close: v,
200
- update: a
201
- };
202
- }
203
- function m(r) {
204
- return s({
205
- ...r
206
- });
207
- }
208
- const g = {
209
- confirm: m,
210
- show: m
211
- // 潘启宝添加于 2023年10月18日 星期三 10时31分58秒 CST
212
- };
213
- return ["info", "success", "warning", "error"].forEach((r) => {
214
- g[r] = (o) => s({
215
- ...o,
216
- isNotice: !0,
217
- noticeType: r
218
- });
219
- }), [g, i];
220
- }
221
- let oe = null, Pn = 0;
222
- fn || document.documentElement.addEventListener(
223
- "click",
224
- (n) => {
225
- oe = {
226
- left: n.clientX,
227
- top: n.clientY
228
- }, setTimeout(() => {
229
- oe = null;
230
- }, 100);
231
- },
232
- !0
233
- );
234
- const In = {
235
- mask: !0,
236
- maskClosable: !0,
237
- mountOnEnter: !0,
238
- escToExit: !0,
239
- getPopupContainer: () => document.body,
240
- alignCenter: !0
241
- };
242
- function Dn(n, i) {
243
- var we;
244
- i || (i = b());
245
- const u = on(ln), s = an(
246
- n,
247
- In,
248
- (we = u.componentConfig) == null ? void 0 : we.Modal
249
- ), {
250
- className: m,
251
- style: g,
252
- visible: r,
253
- simple: o,
254
- title: c,
255
- subtitle: x,
256
- children: C,
257
- cancelText: M,
258
- okText: v,
259
- okButtonProps: a,
260
- cancelButtonProps: h,
261
- getPopupContainer: f = () => document.body,
262
- footer: L,
263
- afterClose: V,
264
- confirmLoading: De,
265
- mountOnEnter: z,
266
- unmountOnExit: q,
267
- afterOpen: W,
268
- hideCancel: $e,
269
- maskClosable: Re,
270
- mask: X,
271
- alignCenter: Oe,
272
- getChildrenPopupContainer: le,
273
- wrapClassName: Le,
274
- escToExit: Z,
275
- modalRender: se,
276
- maskStyle: Xe,
277
- wrapStyle: Ye,
278
- closeIcon: ie,
279
- fullscreenable: $n,
280
- ...ae
281
- } = s, I = b(null), ce = b(null), k = b(null), [ue, de] = P(), [me, Be] = P(), Y = b(null), D = b(!1), [He, fe] = P(""), [pe, Ce] = P(""), j = b(!0);
282
- r && j.current && (j.current = !1);
283
- const B = b();
284
- B.current || (B.current = Pn++);
285
- const [Fe, A] = cn(!1, {
286
- defaultValue: !1,
287
- value: De
288
- }), d = u.getPrefixCls("modal", s.prefixCls), { locale: K, rtl: he } = u, Se = !o || ae.noticeType === "show", Ue = "closable" in s ? s.closable : Se, Ve = S(() => hn(f()), [f]);
289
- un(Ve, { hidden: r && X });
290
- function G(e) {
291
- e.stopPropagation(), J();
292
- }
293
- function J() {
294
- var e;
295
- (e = s.onCancel) == null || e.call(s);
296
- }
297
- const ze = (e) => {
298
- Z && r && e.key === pn.key && (e.stopPropagation(), J());
299
- }, Q = b(!1), qe = (e) => {
300
- D.current && (D.current = !1, !Q.current && Re && X && e.target === e.currentTarget && setTimeout(() => {
301
- J();
302
- }, 100));
303
- }, We = (e) => {
304
- var p;
305
- const t = (p = s.onOk ?? s.onConfirm) == null ? void 0 : p(e);
306
- t != null && t.then && (A(!0), t.then(
307
- () => {
308
- A(!1);
309
- },
310
- (E) => {
311
- A(!1), console.error(E);
312
- }
313
- ));
314
- };
315
- te(() => {
316
- let e = null;
317
- return Z && (e = setTimeout(() => {
318
- var t;
319
- mn(document.body, I.current) && ((t = I.current) == null || t.focus());
320
- })), () => {
321
- e && clearTimeout(e);
322
- };
323
- }, [r, Z]);
324
- const Ze = () => {
325
- var e;
326
- if (r && me === void 0 && I.current) {
327
- const t = +((e = window.getComputedStyle(I.current, null)) == null ? void 0 : e.zIndex);
328
- isNaN(t) || Be(t + 1);
329
- }
330
- }, je = () => {
331
- if (L === null)
332
- return;
333
- const e = /* @__PURE__ */ l(Me, { onClick: G, ...h, children: M || K.Modal.cancelText }), t = /* @__PURE__ */ l(
334
- Me,
335
- {
336
- loading: Fe,
337
- onClick: We,
338
- type: "primary",
339
- ...a,
340
- children: v || K.Modal.okText
341
- }
342
- ), p = Ee(L) ? L(e, t) : L || /* @__PURE__ */ O(_e, { children: [
343
- !$e && e,
344
- t
345
- ] });
346
- return /* @__PURE__ */ l("div", { className: `${d}-footer`, children: p });
347
- }, _ = b(
348
- xe()
349
- ), Ae = S((e) => {
350
- var p, E, y, N, F;
351
- if (!k.current)
352
- return;
353
- e.preventDefault();
354
- const t = _.current;
355
- t.screenX = e.screenX, t.screenY = e.screenY, t.prewTranslateX = t.translateX, t.prewTranslateY = t.translateY, t.boundingClientRect = ((E = (p = k.current) == null ? void 0 : p.getBoundingClientRect) == null ? void 0 : E.call(p)) ?? {}, t.offsetParentBoundingClientRect = ((F = (N = (y = k.current) == null ? void 0 : y.offsetParent) == null ? void 0 : N.getBoundingClientRect) == null ? void 0 : F.call(N)) ?? {}, H(), Ke();
356
- }, []), be = S((e) => {
357
- e.preventDefault();
358
- const t = _.current, { left: p, right: E, top: y, bottom: N } = t.boundingClientRect ?? {}, { width: F, height: Qe } = t.offsetParentBoundingClientRect ?? {};
359
- let $ = Math.max(e.screenX - t.screenX, -p);
360
- $ = Math.min($, F - E);
361
- let R = Math.max(e.screenY - t.screenY, -y);
362
- R = Math.min(R, Qe - N), $ += t.prewTranslateX, R += t.prewTranslateY, t.translateX = $, t.translateY = R, fe(`translate(${$}px, ${R}px)`);
363
- }, []), ge = S((e) => {
364
- e.preventDefault(), H();
365
- }, []);
366
- function Ke() {
367
- document.documentElement.addEventListener(
368
- "mousemove",
369
- be
370
- ), document.documentElement.addEventListener(
371
- "mouseup",
372
- ge
373
- );
374
- }
375
- function H() {
376
- document.documentElement.removeEventListener(
377
- "mousemove",
378
- be
379
- ), document.documentElement.removeEventListener(
380
- "mouseup",
381
- ge
382
- );
383
- }
384
- function xe() {
385
- return {
386
- screenX: 0,
387
- screenY: 0,
388
- prewTranslateX: 0,
389
- prewTranslateY: 0,
390
- translateX: 0,
391
- translateY: 0,
392
- boundingClientRect: null,
393
- offsetParentBoundingClientRect: null
394
- };
395
- }
396
- function ee() {
397
- _.current = xe(), fe(""), Ce("");
398
- }
399
- te(() => () => {
400
- ee(), H();
401
- }, []), te(() => (k.current || (ee(), H()), () => {
402
- }), [k.current]);
403
- const Ge = /* @__PURE__ */ O(
404
- Ie,
405
- {
406
- ...u,
407
- prefixCls: s.prefixCls || u.prefixCls,
408
- locale: K,
409
- zIndex: me || 1050,
410
- getPopupContainer: (e) => typeof le == "function" ? le(e) : ce.current,
411
- children: [
412
- (!!c || !!x) && /* @__PURE__ */ O("div", { className: `${d}-header`, children: [
413
- !!c && /* @__PURE__ */ l(
414
- "div",
415
- {
416
- className: `${d}-title`,
417
- id: `pqb-dialog-${B.current}`,
418
- children: c
419
- }
420
- ),
421
- !!x && /* @__PURE__ */ l("div", { className: `${d}-subtitle`, children: x })
422
- ] }),
423
- /* @__PURE__ */ l("div", { ref: ce, className: `${d}-content`, children: C }),
424
- je(),
425
- !s.fullscreenable && s.draggable !== !1 && /* @__PURE__ */ l(
426
- "div",
427
- {
428
- className: `${d}-drag-icon`,
429
- onMouseDown: Ae,
430
- onDoubleClick: ee
431
- }
432
- ),
433
- (Ue || !!s.fullscreenable) && (ie !== void 0 ? /* @__PURE__ */ l(
434
- "span",
435
- {
436
- className: `${d}-close-icon`,
437
- onClick: G,
438
- children: ie
439
- }
440
- ) : /* @__PURE__ */ l(
441
- sn,
442
- {
443
- tabIndex: -1,
444
- className: `${d}-close-icon`,
445
- onClick: G,
446
- role: "button",
447
- "aria-label": "Close",
448
- children: /* @__PURE__ */ l(en, {})
449
- }
450
- ))
451
- ]
452
- }
453
- ), Je = c ? { "aria-labelledby": `pqb-dialog-${B.current}` } : {}, ve = /* @__PURE__ */ l(
454
- "div",
455
- {
456
- role: "dialog",
457
- "aria-modal": "true",
458
- ...Je,
459
- className: ye(
460
- d,
461
- {
462
- [`${d}-simple`]: o,
463
- [`${d}-rtl`]: he,
464
- [`${d}-fullscreenable`]: s.fullscreenable
465
- },
466
- m
467
- ),
468
- style: {
469
- ...g,
470
- transform: He,
471
- transformOrigin: pe
472
- },
473
- ref: k,
474
- children: Ge
475
- }
476
- ), ne = (e) => {
477
- if (pe)
478
- return;
479
- let t = "";
480
- if (Y.current) {
481
- const p = e.getBoundingClientRect(), { left: E, top: y } = Y.current;
482
- t = `${E - p.left}px ${y - p.top}px`;
483
- }
484
- Ce(t);
485
- }, ke = j.current ? !z : !!k.current;
486
- return r || ke ? /* @__PURE__ */ l(
487
- dn,
488
- {
489
- visible: r,
490
- forceRender: ke,
491
- getContainer: f,
492
- children: /* @__PURE__ */ O(
493
- "div",
494
- {
495
- ref: i,
496
- className: `${d}-container`,
497
- children: [
498
- X ? /* @__PURE__ */ l(
499
- Te,
500
- {
501
- in: r,
502
- timeout: 400,
503
- appear: !0,
504
- mountOnEnter: z,
505
- classNames: "fadeModal",
506
- unmountOnExit: q,
507
- onEnter: (e) => {
508
- e && (e.style.display = "block");
509
- },
510
- onExited: (e) => {
511
- e && (e.style.display = "none");
512
- },
513
- children: /* @__PURE__ */ l(
514
- "div",
515
- {
516
- "aria-hidden": !0,
517
- className: `${d}-mask`,
518
- style: Xe
519
- }
520
- )
521
- }
522
- ) : null,
523
- /* @__PURE__ */ l(
524
- "div",
525
- {
526
- ...Cn(ae, [
527
- "content",
528
- "icon",
529
- "showIcon",
530
- "isNotice",
531
- "noticeType",
532
- "onCancel",
533
- "onOk",
534
- "onConfirm",
535
- "closable",
536
- "prefixCls"
537
- ]),
538
- tabIndex: -1,
539
- ref: (e) => {
540
- I.current = e, Ze();
541
- },
542
- className: ye(
543
- `${d}-wrapper`,
544
- {
545
- [`${d}-wrapper-no-mask`]: !X,
546
- [`${d}-wrapper-align-center`]: Oe,
547
- [`${d}-wrapper-rtl`]: he
548
- },
549
- Le
550
- ),
551
- style: {
552
- ...Ye || {},
553
- // 必须 visible=false,立即设置display:none,否则modal加载react-monaco-editor的时候,编辑器显示异常
554
- display: r || ue ? "block" : "none",
555
- overflow: !r && ue ? "hidden" : ""
556
- },
557
- onKeyDown: ze,
558
- onMouseDown: (e) => {
559
- D.current = e.target === e.currentTarget;
560
- },
561
- onClick: qe,
562
- children: /* @__PURE__ */ l(
563
- Te,
564
- {
565
- in: r,
566
- timeout: 400,
567
- appear: !0,
568
- classNames: "zoomModal",
569
- unmountOnExit: q,
570
- mountOnEnter: z,
571
- onEnter: (e) => {
572
- e && (de(!0), Y.current = oe, ne(e), k.current = e);
573
- },
574
- onEntered: (e) => {
575
- e && (ne(e), Y.current = null, W == null || W());
576
- },
577
- onExit: () => {
578
- Q.current = !0;
579
- },
580
- onExited: (e) => {
581
- e && (de(!1), ne(e), V == null || V(), Q.current = !1, q && (k.current = null));
582
- },
583
- children: nn.cloneElement(
584
- Ee(se) ? se(ve) : ve,
585
- {
586
- onMouseDown: () => {
587
- D.current = !1;
588
- },
589
- onMouseUp: () => {
590
- D.current = !1;
591
- }
592
- }
593
- )
594
- }
595
- )
596
- }
597
- )
598
- ]
599
- }
600
- )
601
- }
602
- ) : null;
603
- }
604
- const w = Pe(
605
- Dn
606
- );
607
- w.displayName = "Modal";
608
- w.config = En;
609
- w.show = (n) => re({ ...n, noticeType: "show" });
610
- w.confirm = (n) => re(n);
611
- w.useModal = Nn;
612
- ["info", "success", "warning", "error"].forEach((n) => {
613
- w[n] = (i) => re({
614
- ...i,
615
- isNotice: !0,
616
- noticeType: n
617
- });
618
- });
619
- w.destroyAll = () => {
620
- for (; T.length; ) {
621
- const n = T.pop();
622
- n && n();
623
- }
624
- };
625
- export {
626
- w as E,
627
- re as c,
628
- U as n
629
- };