@unicom-cloud/ui 0.8.72 → 0.8.74

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 (389) hide show
  1. package/Affix.js +3 -3
  2. package/Alert.js +3 -3
  3. package/AutoComplete.js +3 -3
  4. package/BackTop.js +4 -4
  5. package/Badge.js +3 -3
  6. package/Breadcrumb.js +4 -4
  7. package/Button.js +2 -2
  8. package/Calendar.js +3 -3
  9. package/Card.js +2 -2
  10. package/Carousel.js +2 -2
  11. package/Cascader.js +1 -1
  12. package/Checkbox.js +1 -1
  13. package/Collapse.js +1 -1
  14. package/ColorPicker.js +2 -2
  15. package/Comment.js +2 -2
  16. package/ConfigProvider.js +1 -1
  17. package/Copy.js +3 -3
  18. package/DatePicker.js +1 -1
  19. package/Descriptions.js +2 -2
  20. package/Divider.js +2 -2
  21. package/Draggable.js +2 -2
  22. package/Dropdown.js +5 -5
  23. package/Empty.js +2 -2
  24. package/Icon.js +2 -2
  25. package/IconHover.js +2 -2
  26. package/Image.js +1 -1
  27. package/InputNumber.js +2 -2
  28. package/Layout.js +2 -2
  29. package/Link.js +2 -2
  30. package/List.js +3 -3
  31. package/Mentions.js +3 -3
  32. package/Menu.js +1 -1
  33. package/Message.js +7 -6
  34. package/Modal.js +1 -1
  35. package/Notice.js +5 -5
  36. package/Notification.js +8 -7
  37. package/OverflowEllipsis.js +2 -2
  38. package/PageHeader.js +2 -2
  39. package/Popconfirm.js +3 -3
  40. package/Popover.js +3 -3
  41. package/Progress.js +2 -2
  42. package/Radio.js +1 -1
  43. package/Rate.js +3 -3
  44. package/ResizeBox.js +3 -3
  45. package/Result.js +2 -2
  46. package/SelectView.js +5 -4
  47. package/Skeleton.js +2 -2
  48. package/Slider.js +4 -4
  49. package/Space.js +2 -2
  50. package/SpeechSynthesis.js +21 -21
  51. package/Spin.js +3 -3
  52. package/Statistic.js +3 -3
  53. package/Steps.js +2 -2
  54. package/Switch.js +8 -6
  55. package/Table.js +1 -1
  56. package/Tabs.js +1 -1
  57. package/Tag.js +2 -2
  58. package/Tooltip.js +4 -4
  59. package/Transfer.js +3 -3
  60. package/Tree.js +1 -1
  61. package/Trigger.js +9 -8
  62. package/affix/index.js +3 -3
  63. package/alert/index.js +9 -9
  64. package/anchor/Anchor.js +62 -59
  65. package/anchor/Link.js +2 -2
  66. package/anchor/util.js +2 -2
  67. package/auto-complete/index.js +3 -3
  68. package/avatar/Avatar.js +2 -2
  69. package/avatar/Group.js +2 -2
  70. package/back-top/index.js +11 -11
  71. package/badge/Count.js +7 -7
  72. package/badge/index.js +52 -50
  73. package/breadcrumb/Item.js +6 -6
  74. package/breadcrumb/index.js +4 -4
  75. package/button/Group.js +2 -2
  76. package/button/index.js +2 -2
  77. package/calendar/Month.js +2 -2
  78. package/calendar/Year.js +1 -1
  79. package/calendar/index.js +4 -4
  80. package/card/Grid.js +5 -5
  81. package/card/Meta.js +4 -4
  82. package/card/index.js +2 -2
  83. package/carousel/Arrow.js +2 -2
  84. package/carousel/Indicator.js +6 -6
  85. package/carousel/index.js +2 -2
  86. package/cascader/Cascader.js +5 -5
  87. package/cascader/index.js +1 -1
  88. package/cascader/util.js +1 -1
  89. package/checkbox/Checkbox.js +4 -4
  90. package/checkbox/Group.js +4 -4
  91. package/checkbox/index.js +1 -1
  92. package/chunk/{6nKl68Er.js → 9we0Q8Kh.js} +4 -4
  93. package/chunk/{b1e8awfs.js → B0n0iRhF.js} +1 -1
  94. package/chunk/{Cf4qn5jY.js → BDZpJpz-.js} +3 -3
  95. package/chunk/BFmckYou.js +25 -0
  96. package/chunk/{fFjj2KuF.js → BJ9_azwQ.js} +493 -515
  97. package/chunk/{BnWo0OJ0.js → Bd9zhOZS.js} +9 -9
  98. package/chunk/{uKZyjtff.js → BhBEMwvI.js} +21 -20
  99. package/chunk/{Bfq4YEcr.js → Bmvhjhzq.js} +9 -8
  100. package/chunk/{CdAuhef7.js → BoUHPeG7.js} +2 -2
  101. package/chunk/BpYX5PN4.js +27 -0
  102. package/chunk/{CP7Ac47f.js → Bu8A2l60.js} +4 -4
  103. package/chunk/{URXCKjXr.js → C0pRaDCf.js} +23 -23
  104. package/chunk/CUFsOxJ2.js +10 -0
  105. package/chunk/CWjvjpyc.js +873 -0
  106. package/chunk/{ClaNycDy.js → Cc_-i0o_.js} +2 -2
  107. package/chunk/Coz3rCng.js +33 -0
  108. package/chunk/{BHL-PzAD.js → CplLA01W.js} +17 -17
  109. package/chunk/{Cgbja_v_.js → Crs3isAx.js} +14 -13
  110. package/chunk/{Ey4YJCkX.js → D0Dlbc2g.js} +2 -1
  111. package/chunk/{y9unmTx_.js → D5UfU6-H.js} +127 -127
  112. package/chunk/DAAff-FT.js +59 -0
  113. package/chunk/{rp1MtSd0.js → DJ8rDYjb.js} +4 -4
  114. package/chunk/{AwZqeapI.js → DRTWRsgI.js} +1 -1
  115. package/chunk/DU1RCDfh.js +29 -0
  116. package/chunk/{CAVVFFyZ.js → DdT3C0ih.js} +6 -8
  117. package/chunk/{CdaT1b_F.js → DeV0v__J.js} +2 -2
  118. package/chunk/{IUjEMHU1.js → Dn7KbmZ7.js} +194 -191
  119. package/chunk/{DpoumMDw.js → DohlrJ4S.js} +1 -1
  120. package/chunk/{BDHuWwhT.js → NmSLBKjp.js} +3 -3
  121. package/chunk/{DV7ywe_q.js → RS6OAxzv.js} +2 -2
  122. package/chunk/{Biupwn8l.js → ZrBrCzQX.js} +6 -5
  123. package/chunk/_L2dKF58.js +647 -0
  124. package/chunk/{BJ1soa2K.js → uEGHykhe.js} +18 -18
  125. package/chunk/{D090jlwP.js → xAb6ZgqS.js} +1 -1
  126. package/collapse/Collapse.js +4 -4
  127. package/collapse/Item.js +4 -4
  128. package/collapse/index.js +1 -1
  129. package/color-picker/ControlBar.js +2 -2
  130. package/color-picker/InputAlpha.js +1 -1
  131. package/color-picker/InputHex.js +8 -8
  132. package/color-picker/InputRgb.js +6 -6
  133. package/color-picker/Palette.js +2 -2
  134. package/color-picker/Panel.js +17 -17
  135. package/color-picker/colors.js +20 -9
  136. package/color-picker/index.js +21 -21
  137. package/color-picker/utils.js +1 -1
  138. package/comment/index.js +6 -6
  139. package/config-provider/ConfigProvider.js +2 -2
  140. package/config-provider/context.js +1 -1
  141. package/config-provider/index.js +2 -2
  142. package/copy/index.js +16 -16
  143. package/date-picker/Picker.js +2 -2
  144. package/date-picker/PickerRange.js +3 -3
  145. package/date-picker/index.js +1 -1
  146. package/descriptions/index.js +3 -3
  147. package/divider/index.js +5 -5
  148. package/draggable/Item.js +1 -1
  149. package/draggable/index.js +9 -9
  150. package/drawer/Drawer.js +122 -112
  151. package/dropdown/Button.js +1 -1
  152. package/dropdown/index.js +5 -5
  153. package/empty/index.js +2 -2
  154. package/form/Control.js +1 -1
  155. package/form/Form.js +3 -3
  156. package/form/FormItem.js +3 -3
  157. package/form/FormLabel.js +9 -9
  158. package/form/promisify.js +9 -8
  159. package/form/store.js +1 -1
  160. package/form/util.js +1 -1
  161. package/grid/Col.js +2 -2
  162. package/grid/Row.js +3 -3
  163. package/grid/grid-item.js +3 -3
  164. package/grid/grid.js +9 -9
  165. package/hooks/index.js +5 -5
  166. package/hooks/useInView.js +1 -1
  167. package/hooks/useIntersectionObserver.js +1 -1
  168. package/hooks/useMergeValue.js +1 -1
  169. package/hooks/useOverflowHidden.js +1 -1
  170. package/hooks/useOverrideRef.js +1 -1
  171. package/hooks/useVerificationCode.js +2 -2
  172. package/icon/index.js +11 -11
  173. package/icon-hover/index.js +2 -2
  174. package/image/Image.js +6 -6
  175. package/image/ImageFooter.js +2 -2
  176. package/image/ImagePreview.js +10 -10
  177. package/image/ImagePreviewArrow.js +4 -4
  178. package/image/ImagePreviewGroup.js +2 -2
  179. package/image/ImagePreviewToolbar.js +1 -1
  180. package/image/TriggerForToolbar.js +4 -4
  181. package/image/index.js +1 -1
  182. package/index.js +585 -575
  183. package/input/Group.js +4 -4
  184. package/input/Input.js +5 -4
  185. package/input/InputElement.js +4 -4
  186. package/input/Password.js +3 -3
  187. package/input/Search.js +3 -3
  188. package/input/Textarea.js +7 -6
  189. package/input-number/index.js +2 -2
  190. package/input-tag/InputTag.js +53 -51
  191. package/layout/Content.js +2 -2
  192. package/layout/Footer.js +5 -5
  193. package/layout/Header.js +4 -4
  194. package/layout/Sider.js +4 -4
  195. package/layout/index.js +2 -2
  196. package/link/index.js +5 -5
  197. package/list/Item.js +2 -2
  198. package/list/Meta.js +4 -4
  199. package/list/index.js +3 -3
  200. package/locale/en-US.js +1 -1
  201. package/locale/tr-TR.js +1 -1
  202. package/mentions/index.js +3 -3
  203. package/menu/Item.js +6 -6
  204. package/menu/ItemGroup.js +1 -1
  205. package/menu/Menu.js +4 -4
  206. package/menu/OverflowWrap.js +2 -2
  207. package/menu/index.js +2 -2
  208. package/message/index.js +7 -6
  209. package/message/useMessage.js +1 -1
  210. package/modal/Confirm.js +2 -2
  211. package/modal/Modal.js +9 -8
  212. package/modal/index.js +1 -1
  213. package/notice/index.js +5 -5
  214. package/notification/index.js +8 -7
  215. package/notification/useNotification.js +1 -1
  216. package/overflow-ellipsis/OverflowItem.js +6 -6
  217. package/overflow-ellipsis/index.js +8 -8
  218. package/package.json +1 -1
  219. package/page-header/index.js +2 -2
  220. package/pagination/PageItem.js +2 -2
  221. package/pagination/PageJumper.js +1 -1
  222. package/pagination/PageOption.js +1 -1
  223. package/pagination/Pagination.js +24 -24
  224. package/picker/Input.js +7 -7
  225. package/picker/InputRange.js +9 -9
  226. package/popconfirm/index.js +3 -3
  227. package/popover/index.js +3 -3
  228. package/progress/CircleProgress.js +7 -7
  229. package/progress/LineProgess.js +1 -1
  230. package/progress/StepProgress.js +7 -7
  231. package/progress/index.js +8 -8
  232. package/radio/Group.js +4 -4
  233. package/radio/Radio.js +4 -4
  234. package/radio/index.js +2 -2
  235. package/rate/index.js +27 -27
  236. package/resize-box/ResizeTrigger.js +26 -25
  237. package/resize-box/Split.js +12 -12
  238. package/resize-box/SplitGroup.js +2 -2
  239. package/resize-box/index.js +3 -3
  240. package/result/index.js +9 -9
  241. package/select/Option.js +2 -2
  242. package/select/Select.js +6 -5
  243. package/select/util.js +12 -12
  244. package/select-view/Core.js +29 -29
  245. package/select-view/index.js +3 -2
  246. package/skeleton/Image.js +4 -4
  247. package/skeleton/Text.js +7 -7
  248. package/skeleton/index.js +2 -2
  249. package/slider/Button.js +3 -3
  250. package/slider/Dot.js +5 -5
  251. package/slider/Input.js +12 -12
  252. package/slider/Tick.js +7 -7
  253. package/slider/index.js +20 -20
  254. package/slider/util.js +8 -8
  255. package/space/index.js +12 -12
  256. package/speech-synthesis/index.js +21 -21
  257. package/spin/DotLoading.js +1 -1
  258. package/spin/index.js +3 -3
  259. package/statistic/Countdown.js +7 -7
  260. package/statistic/index.js +20 -20
  261. package/steps/Step.js +1 -1
  262. package/steps/index.js +2 -2
  263. package/style/variables.less +1 -1
  264. package/style.css +1 -1
  265. package/switch/index.js +17 -15
  266. package/table/Table.js +4 -4
  267. package/table/index.js +4 -4
  268. package/tabs/Tab.js +4 -4
  269. package/tabs/TabContent.js +3 -3
  270. package/tabs/TabPane.js +2 -2
  271. package/tabs/index.js +2 -2
  272. package/tag/index.js +6 -6
  273. package/time-picker/Picker.js +2 -2
  274. package/time-picker/TimeColumn.js +7 -7
  275. package/time-picker/TimePicker.js +23 -23
  276. package/time-picker/util.js +5 -5
  277. package/timeline/Item.js +2 -2
  278. package/timeline/Timeline.js +2 -2
  279. package/tooltip/index.js +4 -4
  280. package/transfer/Item.js +3 -3
  281. package/transfer/List.js +3 -3
  282. package/transfer/index.js +3 -3
  283. package/tree/Animation.js +3 -3
  284. package/tree/Node.js +4 -4
  285. package/tree/NodeList.js +2 -2
  286. package/tree/Tree.js +4 -4
  287. package/tree/index.js +1 -1
  288. package/tree-select/Select.js +25 -25
  289. package/trigger/getPopupStyle.js +2 -2
  290. package/trigger/index.js +8 -7
  291. package/types/badge/interface.d.ts +1 -0
  292. package/types/color-picker/colors.d.ts +1 -1
  293. package/types/date-picker/util.d.ts +1 -1
  294. package/types/drawer/interface.d.ts +10 -0
  295. package/types/index.d.ts +0 -7
  296. package/types/modal/Confirm.d.ts +1 -0
  297. package/types/utils/PqbCSSTransition.d.ts +3 -0
  298. package/types/utils/caseName.d.ts +1 -0
  299. package/types/utils/className.d.ts +1 -0
  300. package/types/utils/color.d.ts +1 -0
  301. package/types/utils/computeScrollIntoView.d.ts +1 -0
  302. package/types/utils/contextHolder.d.ts +1 -0
  303. package/types/utils/copy.d.ts +1 -0
  304. package/types/utils/fileToURL.d.ts +1 -0
  305. package/types/utils/fillNBSP.d.ts +1 -0
  306. package/types/utils/getHighlightText.d.ts +1 -0
  307. package/types/utils/getHotkeyHandler.d.ts +1 -0
  308. package/types/utils/getStringLength.d.ts +1 -0
  309. package/types/utils/include.d.ts +1 -0
  310. package/types/utils/index.d.ts +29 -25
  311. package/types/utils/is.d.ts +1 -1
  312. package/types/utils/keyboardCode.d.ts +1 -0
  313. package/types/utils/math.d.ts +1 -0
  314. package/types/utils/mergeProps.d.ts +1 -0
  315. package/types/utils/mergedToString.d.ts +1 -0
  316. package/types/utils/names.d.ts +497 -81
  317. package/types/utils/omit.d.ts +1 -0
  318. package/types/utils/pick.d.ts +1 -1
  319. package/types/utils/reactTransitionGroup.d.ts +1 -0
  320. package/types/utils/responsiveObserve.d.ts +1 -0
  321. package/types/utils/saveAs.d.ts +1 -0
  322. package/types/utils/screenfull.d.ts +1 -0
  323. package/types/utils/scrollIntoView.d.ts +1 -0
  324. package/types/utils/tinycolor.d.ts +1 -0
  325. package/types/utils/tree.d.ts +1 -0
  326. package/types/utils/tween.d.ts +1 -0
  327. package/types/utils/uuid.d.ts +1 -0
  328. package/types/utils/validate.d.ts +1 -0
  329. package/types/version/index.d.ts +1 -1
  330. package/typography/Base.js +7 -6
  331. package/typography/EditContent.js +1 -1
  332. package/typography/Ellipsis.js +28 -28
  333. package/typography/Paragraph.js +6 -6
  334. package/typography/Typography.js +5 -5
  335. package/typography/index.js +28 -28
  336. package/upload/TriggerNode.js +2 -2
  337. package/upload/Upload.js +62 -60
  338. package/upload/Uploader.js +21 -21
  339. package/upload/request_.js +4 -3
  340. package/utils/PqbCSSTransition.js +5 -0
  341. package/utils/caseName.js +3 -2
  342. package/utils/className.js +3 -2
  343. package/utils/color.js +4 -0
  344. package/utils/computeScrollIntoView.js +128 -0
  345. package/utils/contextHolder.js +3 -2
  346. package/utils/copy.js +4 -2
  347. package/utils/fileToURL.js +3 -2
  348. package/utils/fillNBSP.js +2 -1
  349. package/utils/getHighlightText.js +2 -1
  350. package/utils/getHotkeyHandler.js +2 -1
  351. package/utils/getStringLength.js +2 -1
  352. package/utils/include.js +2 -1
  353. package/utils/index.js +299 -256
  354. package/utils/is.js +104 -101
  355. package/utils/keyboardCode.js +2 -1
  356. package/utils/math.js +35 -0
  357. package/utils/mergeProps.js +2 -1
  358. package/utils/mergedToString.js +2 -1
  359. package/utils/names.js +332 -81
  360. package/utils/omit.js +2 -1
  361. package/utils/pick.js +1 -0
  362. package/utils/react19Adapter.js +1 -1
  363. package/utils/reactDOM.js +1 -1
  364. package/utils/reactTransitionGroup.js +10 -0
  365. package/utils/responsiveObserve.js +2 -1
  366. package/utils/saveAs.js +3 -2
  367. package/utils/screenfull.js +2 -1
  368. package/utils/scrollIntoView.js +4 -2
  369. package/utils/tinycolor.js +30 -0
  370. package/utils/tree.js +87 -0
  371. package/utils/tween.js +6 -0
  372. package/utils/uuid.js +5 -0
  373. package/utils/validate.js +7 -0
  374. package/verification-code/VerificationCode.js +7 -7
  375. package/version/index.js +3 -3
  376. package/virtual-list/VirtualList.js +1 -1
  377. package/watermark/Watermark.js +6 -6
  378. package/chunk/B4JiMp8I.js +0 -764
  379. package/chunk/B6X4lnd0.js +0 -116
  380. package/chunk/BibHFOCF.js +0 -34
  381. package/chunk/CTxjmYmx.js +0 -19
  382. package/chunk/CVYWxu00.js +0 -155
  383. package/chunk/CbLaCJmG.js +0 -26
  384. package/chunk/D-TPB2Do.js +0 -56
  385. package/chunk/DVfOiRp-.js +0 -629
  386. package/chunk/DxxOUMSa.js +0 -98
  387. package/chunk/JPPo5nY_.js +0 -9
  388. package/types/utils/CSSTransition.d.ts +0 -2
  389. 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
- };