@unicom-cloud/ui 0.8.73 → 0.8.75

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 (306) hide show
  1. package/Affix.js +2 -2
  2. package/Alert.js +3 -3
  3. package/AutoComplete.js +2 -2
  4. package/BackTop.js +4 -4
  5. package/Badge.js +3 -3
  6. package/Breadcrumb.js +3 -3
  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 +2 -2
  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 +2 -2
  31. package/Mentions.js +2 -2
  32. package/Menu.js +1 -1
  33. package/Message.js +4 -4
  34. package/Modal.js +1 -1
  35. package/Notice.js +2 -2
  36. package/Notification.js +4 -4
  37. package/OverflowEllipsis.js +2 -2
  38. package/PageHeader.js +2 -2
  39. package/Popconfirm.js +2 -2
  40. package/Popover.js +2 -2
  41. package/Progress.js +2 -2
  42. package/Radio.js +1 -1
  43. package/Rate.js +2 -2
  44. package/ResizeBox.js +2 -2
  45. package/Result.js +2 -2
  46. package/SelectView.js +1 -1
  47. package/Skeleton.js +2 -2
  48. package/Slider.js +2 -2
  49. package/Space.js +2 -2
  50. package/SpeechSynthesis.js +4 -4
  51. package/Spin.js +2 -2
  52. package/Statistic.js +3 -3
  53. package/Steps.js +2 -2
  54. package/Switch.js +4 -4
  55. package/Table.js +1 -1
  56. package/Tabs.js +1 -1
  57. package/Tag.js +2 -2
  58. package/Tooltip.js +3 -3
  59. package/Transfer.js +2 -2
  60. package/Tree.js +1 -1
  61. package/Trigger.js +3 -3
  62. package/affix/index.js +2 -2
  63. package/alert/index.js +9 -9
  64. package/anchor/Anchor.js +26 -26
  65. package/anchor/Link.js +2 -2
  66. package/anchor/util.js +1 -1
  67. package/auto-complete/index.js +2 -2
  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 +9 -9
  73. package/breadcrumb/Item.js +6 -6
  74. package/breadcrumb/index.js +3 -3
  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 +3 -3
  87. package/cascader/index.js +1 -1
  88. package/cascader/util.js +1 -1
  89. package/checkbox/Checkbox.js +3 -3
  90. package/checkbox/Group.js +3 -3
  91. package/checkbox/index.js +1 -1
  92. package/chunk/{oHDWCJnz.js → 0mWCmQHr.js} +3 -3
  93. package/chunk/{UDX9U6M7.js → B8hkFIar.js} +3 -3
  94. package/chunk/BFmckYou.js +25 -0
  95. package/chunk/{Cj2SQJiO.js → BJ9_azwQ.js} +487 -487
  96. package/chunk/{Dg0M2OmF.js → BViFMHr-.js} +5 -5
  97. package/chunk/BbqvFW5R.js +927 -0
  98. package/chunk/{uKZyjtff.js → BhBEMwvI.js} +21 -20
  99. package/chunk/{Bj4EV0eG.js → BpYX5PN4.js} +1 -1
  100. package/chunk/{B7hulkj9.js → BxZ39GzB.js} +2 -2
  101. package/chunk/C9XYyypq.js +713 -0
  102. package/chunk/CIkPwQlq.js +6 -0
  103. package/chunk/{uH6uxyao.js → CPlPBkN7.js} +2 -2
  104. package/chunk/CUFsOxJ2.js +10 -0
  105. package/chunk/CWlklVfi.js +257 -0
  106. package/chunk/{Ey4YJCkX.js → D0Dlbc2g.js} +2 -1
  107. package/chunk/{DejjIa3N.js → DFcz9ZPP.js} +35 -35
  108. package/chunk/{AwZqeapI.js → DRTWRsgI.js} +1 -1
  109. package/chunk/{D2LLXZQX.js → DeCsZrXb.js} +4 -4
  110. package/chunk/{DpoumMDw.js → DohlrJ4S.js} +1 -1
  111. package/chunk/DskaI8QL.js +25 -0
  112. package/chunk/{7HDzVe32.js → Dv6USvVF.js} +4 -4
  113. package/chunk/{DJDOFlqC.js → EL5Jmjgr.js} +2 -2
  114. package/chunk/{CiY7w1ZO.js → WVoGhvMI.js} +3 -3
  115. package/chunk/{BJ1soa2K.js → uEGHykhe.js} +18 -18
  116. package/collapse/Collapse.js +3 -3
  117. package/collapse/Item.js +4 -4
  118. package/collapse/index.js +1 -1
  119. package/color-picker/ControlBar.js +2 -2
  120. package/color-picker/InputAlpha.js +1 -1
  121. package/color-picker/InputHex.js +7 -7
  122. package/color-picker/InputRgb.js +6 -6
  123. package/color-picker/Palette.js +5 -5
  124. package/color-picker/Panel.js +4 -4
  125. package/color-picker/colors.js +7 -12
  126. package/color-picker/index.js +20 -20
  127. package/color-picker/utils.js +1 -1
  128. package/comment/index.js +6 -6
  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 +16 -16
  133. package/date-picker/Picker.js +2 -2
  134. package/date-picker/PickerRange.js +3 -3
  135. package/date-picker/index.js +1 -1
  136. package/descriptions/index.js +2 -2
  137. package/divider/index.js +5 -5
  138. package/draggable/Item.js +1 -1
  139. package/draggable/index.js +9 -9
  140. package/drawer/Drawer.js +3 -3
  141. package/dropdown/Button.js +1 -1
  142. package/dropdown/index.js +2 -2
  143. package/empty/index.js +2 -2
  144. package/form/Control.js +1 -1
  145. package/form/Form.js +2 -2
  146. package/form/FormItem.js +3 -3
  147. package/form/FormLabel.js +9 -9
  148. package/form/context.js +1 -1
  149. package/grid/Col.js +2 -2
  150. package/grid/Row.js +2 -2
  151. package/grid/grid-item.js +2 -2
  152. package/grid/grid.js +8 -8
  153. package/icon/index.js +11 -11
  154. package/icon-hover/index.js +2 -2
  155. package/image/Image.js +4 -4
  156. package/image/ImageFooter.js +2 -2
  157. package/image/ImagePreview.js +5 -5
  158. package/image/ImagePreviewArrow.js +4 -4
  159. package/image/ImagePreviewGroup.js +1 -1
  160. package/image/ImagePreviewToolbar.js +1 -1
  161. package/image/TriggerForToolbar.js +4 -4
  162. package/image/index.js +1 -1
  163. package/index.js +586 -592
  164. package/input/Group.js +4 -4
  165. package/input/Input.js +45 -45
  166. package/input/InputElement.js +2 -2
  167. package/input/Password.js +2 -2
  168. package/input/Search.js +2 -2
  169. package/input/Textarea.js +2 -2
  170. package/input-number/index.js +2 -2
  171. package/input-tag/InputTag.js +4 -4
  172. package/layout/Content.js +2 -2
  173. package/layout/Footer.js +5 -5
  174. package/layout/Header.js +4 -4
  175. package/layout/Sider.js +2 -2
  176. package/layout/index.js +2 -2
  177. package/link/index.js +5 -5
  178. package/list/Item.js +2 -2
  179. package/list/Meta.js +4 -4
  180. package/list/index.js +2 -2
  181. package/mentions/index.js +2 -2
  182. package/menu/Item.js +5 -5
  183. package/menu/ItemGroup.js +1 -1
  184. package/menu/Menu.js +3 -3
  185. package/menu/OverflowWrap.js +2 -2
  186. package/menu/index.js +2 -2
  187. package/message/index.js +4 -4
  188. package/message/useMessage.js +1 -1
  189. package/modal/Confirm.js +2 -2
  190. package/modal/Modal.js +4 -4
  191. package/modal/index.js +1 -1
  192. package/notice/index.js +2 -2
  193. package/notification/index.js +4 -4
  194. package/notification/useNotification.js +1 -1
  195. package/overflow-ellipsis/OverflowItem.js +6 -6
  196. package/overflow-ellipsis/index.js +8 -8
  197. package/package.json +1 -1
  198. package/page-header/index.js +2 -2
  199. package/pagination/PageItem.js +2 -2
  200. package/pagination/PageJumper.js +1 -1
  201. package/pagination/PageOption.js +1 -1
  202. package/pagination/Pagination.js +23 -23
  203. package/picker/Input.js +7 -7
  204. package/picker/InputRange.js +9 -9
  205. package/popconfirm/index.js +2 -2
  206. package/popover/index.js +2 -2
  207. package/progress/CircleProgress.js +7 -7
  208. package/progress/LineProgess.js +1 -1
  209. package/progress/StepProgress.js +7 -7
  210. package/progress/index.js +8 -8
  211. package/radio/Group.js +3 -3
  212. package/radio/Radio.js +3 -3
  213. package/radio/index.js +2 -2
  214. package/rate/index.js +2 -2
  215. package/resize-box/ResizeTrigger.js +10 -10
  216. package/resize-box/Split.js +12 -12
  217. package/resize-box/SplitGroup.js +2 -2
  218. package/resize-box/index.js +2 -2
  219. package/result/index.js +9 -9
  220. package/select/Option.js +2 -2
  221. package/select/Select.js +3 -3
  222. package/select-view/Core.js +27 -27
  223. package/select-view/index.js +1 -1
  224. package/skeleton/Image.js +4 -4
  225. package/skeleton/Text.js +7 -7
  226. package/skeleton/index.js +2 -2
  227. package/slider/Button.js +2 -2
  228. package/slider/Dot.js +5 -5
  229. package/slider/Input.js +12 -12
  230. package/slider/Tick.js +6 -6
  231. package/slider/index.js +2 -2
  232. package/space/index.js +12 -12
  233. package/speech-synthesis/index.js +4 -4
  234. package/spin/DotLoading.js +1 -1
  235. package/spin/index.js +2 -2
  236. package/statistic/Countdown.js +7 -7
  237. package/statistic/index.js +20 -20
  238. package/steps/Step.js +1 -1
  239. package/steps/index.js +2 -2
  240. package/style/variables.less +375 -710
  241. package/style.css +1 -1
  242. package/switch/index.js +4 -4
  243. package/table/Table.js +4 -4
  244. package/table/index.js +4 -4
  245. package/tabs/Tab.js +3 -3
  246. package/tabs/TabContent.js +3 -3
  247. package/tabs/TabPane.js +2 -2
  248. package/tabs/index.js +2 -2
  249. package/tag/index.js +6 -6
  250. package/time-picker/Picker.js +2 -2
  251. package/time-picker/TimeColumn.js +7 -7
  252. package/time-picker/TimePicker.js +23 -23
  253. package/time-picker/util.js +5 -5
  254. package/timeline/Item.js +2 -2
  255. package/timeline/Timeline.js +2 -2
  256. package/tooltip/index.js +3 -3
  257. package/transfer/Item.js +3 -3
  258. package/transfer/List.js +3 -3
  259. package/transfer/index.js +2 -2
  260. package/tree/Animation.js +3 -3
  261. package/tree/Node.js +4 -4
  262. package/tree/NodeList.js +1 -1
  263. package/tree/Tree.js +3 -3
  264. package/tree/index.js +1 -1
  265. package/tree-select/Select.js +2 -2
  266. package/trigger/index.js +3 -3
  267. package/types/color-picker/colors.d.ts +1 -1
  268. package/types/config-provider/interface.d.ts +0 -1
  269. package/types/utils/color.d.ts +1 -1
  270. package/types/utils/constant.d.ts +1 -1
  271. package/types/utils/index.d.ts +1 -0
  272. package/types/utils/setDarkTheme.d.ts +4 -0
  273. package/typography/Base.js +2 -2
  274. package/typography/EditContent.js +1 -1
  275. package/typography/Ellipsis.js +14 -15
  276. package/typography/Paragraph.js +6 -6
  277. package/typography/Typography.js +5 -5
  278. package/typography/index.js +12 -13
  279. package/upload/TriggerNode.js +2 -2
  280. package/upload/Upload.js +5 -5
  281. package/upload/Uploader.js +2 -2
  282. package/upload/request.js +1 -1
  283. package/upload/request_.js +1 -1
  284. package/utils/PqbCSSTransition.js +1 -1
  285. package/utils/className.js +3 -3
  286. package/utils/color.js +2 -116
  287. package/utils/constant.js +3 -2
  288. package/utils/contextHolder.js +1 -1
  289. package/utils/copy.js +4 -4
  290. package/utils/dom.js +1 -1
  291. package/utils/fileToURL.js +1 -1
  292. package/utils/index.js +303 -309
  293. package/utils/reactTransitionGroup.js +1 -1
  294. package/utils/saveAs.js +1 -1
  295. package/utils/setDarkTheme.js +7 -0
  296. package/utils/tinycolor.js +13 -13
  297. package/utils/tween.js +1 -1
  298. package/verification-code/VerificationCode.js +7 -7
  299. package/version/index.js +1 -1
  300. package/watermark/Watermark.js +6 -6
  301. package/chunk/B0UZ1Ee2.js +0 -257
  302. package/chunk/Byd0ztYY.js +0 -724
  303. package/chunk/CCVU-Kst.js +0 -770
  304. package/chunk/CTxjmYmx.js +0 -19
  305. package/chunk/D0ZWT7db.js +0 -5
  306. package/chunk/JPPo5nY_.js +0 -9
package/chunk/Byd0ztYY.js DELETED
@@ -1,724 +0,0 @@
1
- import Q, { forwardRef as Z, useContext as D, createContext as He, useRef as k, useImperativeHandle as ee, useEffect as I, useMemo as De, useState as Se } from "react";
2
- import { jsx as r, jsxs as G, Fragment as fe } from "react/jsx-runtime";
3
- import W from "@unicom-cloud/icons/context";
4
- import { a as Ue } from "./CCVU-Kst.js";
5
- import Fe from "lodash/isPlainObject";
6
- import { u as te } from "./BFTV6myl.js";
7
- import { b as me } from "./Cj2SQJiO.js";
8
- import _ from "lodash/isNumber";
9
- import H from "lodash/isUndefined";
10
- import { createRoot as pe } from "react-dom/client";
11
- import Le from "@unicom-cloud/icons/IconUiCheckCircleFill";
12
- import de from "@unicom-cloud/icons/IconUiClose";
13
- import Ae from "@unicom-cloud/icons/IconUiCloseCircleFill";
14
- import ze from "@unicom-cloud/icons/IconUiExclamationCircleFill";
15
- import Ge from "@unicom-cloud/icons/IconUiInfoCircleFill";
16
- import Qe from "@unicom-cloud/icons/IconUiLoading";
17
- import Be from "@unicom-cloud/icons/IconUiEmpty";
18
- import { m as U } from "./JPPo5nY_.js";
19
- import Je from "../locale/zh-CN.js";
20
- import "lodash/isEqualWith";
21
- import "./DAAff-FT.js";
22
- import "lodash/merge";
23
- import "../utils/dom.js";
24
- import "./ZrBrCzQX.js";
25
- import "./Cc_-i0o_.js";
26
- import "./Ce1j9KTi.js";
27
- import "lodash/debounce";
28
- import { createPortal as Ke } from "react-dom";
29
- import { P as Ce } from "./Bj4EV0eG.js";
30
- import ge from "../notification/withNotification.js";
31
- import Ve from "lodash/isString";
32
- import { setConfigProviderProps as We } from "../modal/config.js";
33
- import { o as Xe } from "./BKKEev13.js";
34
- function Ye(e, o) {
35
- const {
36
- getPrefixCls: t,
37
- locale: u,
38
- componentConfig: c
39
- } = D(R), i = te(
40
- e,
41
- {},
42
- c == null ? void 0 : c.Empty
43
- ), { style: l, className: d, description: s, icon: a, imgSrc: f, ...p } = i, g = t("empty"), b = U(g, d), m = u.Empty.noData, n = typeof s == "string" ? s : "empty";
44
- return /* @__PURE__ */ r("div", { ref: o, className: b, style: l, ...p, children: /* @__PURE__ */ G("div", { className: `${g}-wrapper`, children: [
45
- /* @__PURE__ */ r("div", { className: `${g}-image`, children: f ? /* @__PURE__ */ r("img", { alt: n, src: f }) : a || /* @__PURE__ */ r(Be, {}) }),
46
- /* @__PURE__ */ r("div", { className: `${g}-description`, children: s || m })
47
- ] }) });
48
- }
49
- const he = Z(Ye);
50
- he.displayName = "Empty";
51
- const Ze = Q.memo(he);
52
- function et(e) {
53
- return /* @__PURE__ */ r(Ze, {});
54
- }
55
- const xe = {
56
- locale: Je,
57
- prefixCls: "pqb",
58
- getPopupContainer: () => document.body,
59
- size: "default",
60
- renderEmpty: et
61
- }, R = He({
62
- getPrefixCls: (e, o) => `${o || "pqb"}-${e}`,
63
- ...xe
64
- });
65
- function tt(e, o) {
66
- const {
67
- children: t,
68
- className: u,
69
- disabled: c,
70
- prefix: i,
71
- size: l = "default",
72
- ...d
73
- } = e, { getPrefixCls: s } = D(R), a = s("icon-hover"), f = k();
74
- return ee(o, () => ({
75
- getRootDOMNode: () => f.current
76
- })), /* @__PURE__ */ r(
77
- "span",
78
- {
79
- ref: f,
80
- className: U(
81
- a,
82
- {
83
- [`${i}-icon-hover`]: i,
84
- [`${a}-size-${l}`]: l && l !== "default",
85
- [`${a}-disabled`]: c
86
- },
87
- u
88
- ),
89
- onClick: e.onClick,
90
- ...d,
91
- children: t
92
- }
93
- );
94
- }
95
- const ue = Q.forwardRef(tt), ot = {
96
- type: "info",
97
- showIcon: !0,
98
- noticeType: "message",
99
- duration: 3e3
100
- };
101
- function rt(e, o) {
102
- const {
103
- getPrefixCls: t,
104
- componentConfig: u,
105
- rtl: c
106
- } = D(R), i = te(
107
- e,
108
- ot,
109
- u == null ? void 0 : u.Notice
110
- ), l = D(R), d = t("notice");
111
- k();
112
- const s = k(), a = k(), f = k(), {
113
- title: p,
114
- content: g,
115
- showIcon: b,
116
- className: m,
117
- style: n,
118
- type: C,
119
- btn: x,
120
- icon: v,
121
- prefixCls: h,
122
- closable: y,
123
- noticeType: M,
124
- iconPrefix: ie,
125
- rtl: qe = c,
126
- closeIcon: F,
127
- classPrefixCls: se
128
- } = i, Oe = U(
129
- h,
130
- `${h}-${C}`,
131
- {
132
- [`${h}-closable`]: y,
133
- [`${h}-rtl`]: qe
134
- },
135
- m
136
- );
137
- let B = "closable" in i ? y : !0, J = b;
138
- C === "normal" && !v && (J = !1);
139
- const ce = { ...l };
140
- se && (ce.prefixCls = se);
141
- function Te() {
142
- return a.current;
143
- }
144
- function K() {
145
- const { duration: N, onClose: T, id: V } = i;
146
- N !== 0 && (s.current = window.setTimeout(() => {
147
- T == null || T(V), j();
148
- }, N));
149
- }
150
- function j() {
151
- s.current && (window.clearTimeout(s.current), s.current = null);
152
- }
153
- function L() {
154
- var N;
155
- (N = i.onClose) == null || N.call(i, i.id);
156
- }
157
- function le() {
158
- const { showIcon: N, icon: T, type: V, iconPrefix: ae } = i;
159
- let P;
160
- if (T)
161
- P = T;
162
- else if (N) {
163
- switch (V) {
164
- case "info":
165
- P = /* @__PURE__ */ r(Ge, {});
166
- break;
167
- case "success":
168
- P = /* @__PURE__ */ r(Le, {});
169
- break;
170
- case "error":
171
- P = /* @__PURE__ */ r(Ae, {});
172
- break;
173
- case "warning":
174
- P = /* @__PURE__ */ r(ze, {});
175
- break;
176
- case "loading":
177
- P = /* @__PURE__ */ r(Qe, {});
178
- break;
179
- }
180
- P = /* @__PURE__ */ r(
181
- W.Provider,
182
- {
183
- value: ae ? { prefixCls: ae } : {},
184
- children: P
185
- }
186
- );
187
- }
188
- return /* @__PURE__ */ r("span", { className: `${h}-icon`, children: P });
189
- }
190
- function _e() {
191
- j();
192
- }
193
- function je() {
194
- j(), K();
195
- }
196
- ee(o, () => ({
197
- getRootDOMNode: Te
198
- }), []), I(() => {
199
- const N = f.current;
200
- return (N && (N == null ? void 0 : N.duration) !== i.duration || i.update) && (j(), K()), f.current = i, () => {
201
- };
202
- }, [i.duration, i.update]), I(() => (K(), () => {
203
- j();
204
- }), []);
205
- let O;
206
- return M === "message" && (B = y, O = /* @__PURE__ */ G(fe, { children: [
207
- J && le(),
208
- /* @__PURE__ */ r("span", { className: `${h}-content`, children: g }),
209
- B && (F !== void 0 ? /* @__PURE__ */ r("span", { onClick: L, className: `${h}-close-btn`, children: F }) : /* @__PURE__ */ r(
210
- ue,
211
- {
212
- prefix: h,
213
- className: `${h}-close-btn`,
214
- onClick: L,
215
- children: /* @__PURE__ */ r(de, {})
216
- }
217
- ))
218
- ] })), M === "notification" && (O = /* @__PURE__ */ G(fe, { children: [
219
- J && /* @__PURE__ */ r("div", { className: `${h}-left`, children: le() }),
220
- /* @__PURE__ */ G("div", { className: `${h}-right`, children: [
221
- p && /* @__PURE__ */ r("div", { className: `${h}-title`, children: p }),
222
- /* @__PURE__ */ r("div", { className: `${h}-content`, children: g }),
223
- x && /* @__PURE__ */ r("div", { className: `${h}-btn-wrapper`, children: x })
224
- ] }),
225
- B && (F !== void 0 ? /* @__PURE__ */ r("span", { onClick: L, className: `${h}-close-btn`, children: F }) : /* @__PURE__ */ r(
226
- ue,
227
- {
228
- prefix: h,
229
- className: `${h}-close-btn`,
230
- onClick: L,
231
- children: /* @__PURE__ */ r(
232
- W.Provider,
233
- {
234
- value: ie ? { prefixCls: ie } : {},
235
- children: /* @__PURE__ */ r(de, {})
236
- }
237
- )
238
- }
239
- ))
240
- ] })), O && (O = /* @__PURE__ */ r(ne, { ...ce, children: /* @__PURE__ */ r(
241
- "div",
242
- {
243
- ref: a,
244
- className: `${d}-${M}`,
245
- onMouseEnter: _e,
246
- onMouseLeave: je,
247
- children: /* @__PURE__ */ r("div", { className: Oe, style: n, role: "alert", children: O })
248
- }
249
- ) })), O;
250
- }
251
- const be = Z(rt);
252
- function nt(e = {}) {
253
- const {
254
- maxCount: o,
255
- duration: t = 3e3,
256
- prefixCls: u,
257
- getContainer: c
258
- } = e, i = k(), l = /* @__PURE__ */ r(ke, { ref: i }), d = {};
259
- let s;
260
- function a(p) {
261
- let g, b;
262
- if (i.current) {
263
- const v = i.current.getContextConfig();
264
- b = v.rtl, g = v.prefixCls;
265
- }
266
- const m = u || g, n = re(p.position, b), C = {
267
- duration: t,
268
- ...p
269
- }, x = d[n];
270
- if (x) {
271
- if (x.notices.length >= o) {
272
- const v = x.notices[0];
273
- C.id = v.id, x.shift();
274
- }
275
- x.add({ ...C });
276
- } else
277
- s = /* @__PURE__ */ r(
278
- $,
279
- {
280
- ...C,
281
- prefixCls: m,
282
- rtl: b,
283
- getContainer: c,
284
- ref: (v) => {
285
- d[n] = v;
286
- }
287
- }
288
- ), i.current.addInstance(s);
289
- return d[n];
290
- }
291
- const f = {};
292
- return oe.forEach((p) => {
293
- f[p] = (g) => a({
294
- ...g,
295
- type: p
296
- });
297
- }), [f, l];
298
- }
299
- const oe = [
300
- "info",
301
- "success",
302
- "error",
303
- "warning",
304
- "loading",
305
- "normal"
306
- ];
307
- let w = {}, A = [], ve, ye, Ne, X, S;
308
- function re(e, o) {
309
- return H(e) && (e = o || S ? "topLeft" : "topRight"), e;
310
- }
311
- function it(e) {
312
- const { prefixCls: o, rtl: t, getContainer: u, notices: c } = e, i = H(t) ? S : t, l = re(e.position, i), d = o || ye, s = d ? `${d}-notification` : "pqb-notification";
313
- let a;
314
- l === "topLeft" || l === "bottomLeft" ? a = "slideNoticeLeft" : a = "slideNoticeRight";
315
- const f = U(
316
- `${s}-wrapper`,
317
- `${s}-wrapper-${l}`,
318
- { [`${s}-wrapper-rtl`]: S }
319
- ), p = u == null ? void 0 : u();
320
- function g(m) {
321
- const n = c.find((C) => C.id === m);
322
- n && e.update({
323
- ...n,
324
- style: { ...n.style, opacity: 0 }
325
- }), setTimeout(() => {
326
- e.remove(m);
327
- }, 200);
328
- }
329
- I(() => (e.add(e), () => {
330
- e.clear();
331
- }), []);
332
- const b = /* @__PURE__ */ r("div", { className: f, children: /* @__PURE__ */ r(me, { component: null, children: c.map((m) => /* @__PURE__ */ r(
333
- Ce,
334
- {
335
- timeout: {
336
- enter: 400,
337
- exit: 300
338
- },
339
- classNames: a,
340
- onExit: (n) => {
341
- n && (n.style.height = `${n.scrollHeight}px`);
342
- },
343
- onExiting: (n) => {
344
- n && (n.style.height = 0);
345
- },
346
- onExited: (n) => {
347
- var C;
348
- n && (n.style.height = 0, (C = m.onClose) == null || C.call(m));
349
- },
350
- children: /* @__PURE__ */ r(
351
- be,
352
- {
353
- ...m,
354
- onClose: g,
355
- prefixCls: s,
356
- iconPrefix: d,
357
- classPrefixCls: d,
358
- noticeType: "notification",
359
- rtl: i
360
- }
361
- )
362
- },
363
- m.id
364
- )) }) });
365
- return p ? Ke(b, p) : b;
366
- }
367
- const $ = ge(it);
368
- $.useNotification = nt;
369
- $.config = (e = {}) => {
370
- var o;
371
- _(e.maxCount) && (ve = e.maxCount), e.prefixCls && (ye = e.prefixCls), _(e.duration) && (Ne = e.duration), typeof e.rtl == "boolean" && (S = e.rtl), e.getContainer && ((o = e.getContainer) == null ? void 0 : o.call(e)) !== X && (X = e.getContainer(), Object.values(w).forEach(
372
- (t) => {
373
- var u;
374
- return (u = t == null ? void 0 : t.clear) == null ? void 0 : u.call(t);
375
- }
376
- ), w = {});
377
- };
378
- $.clear = () => {
379
- Object.values(w).forEach((e) => {
380
- e == null || e.clear();
381
- });
382
- };
383
- $.remove = (e) => {
384
- Object.values(w).forEach((o) => {
385
- o == null || o.remove(e);
386
- });
387
- };
388
- $.addInstance = (e) => {
389
- const o = re(e.position, S), t = w[o], u = {
390
- duration: Ne,
391
- ...e
392
- };
393
- if (t) {
394
- const c = t.notices.find(
395
- (l) => l.id === e.id
396
- ), i = {
397
- ...u,
398
- update: c
399
- };
400
- t.notices.length >= ve && (c ? i.id = c.id : t.shift()), t.add({ ...i });
401
- }
402
- if (t === null && A.push(e), t === void 0) {
403
- const c = document.createElement("div");
404
- (X || document.body).appendChild(c), pe(c).render(
405
- /* @__PURE__ */ r(
406
- $,
407
- {
408
- ...u,
409
- ref: (l) => {
410
- if (l) {
411
- for (let d = 0; d < A.length; d++)
412
- l.add(A[d]);
413
- A = [], w[o] = l;
414
- }
415
- }
416
- }
417
- )
418
- ), w[o] = null;
419
- }
420
- return w[o];
421
- };
422
- oe.forEach((e) => {
423
- $[e] = (o) => $.addInstance({
424
- ...o,
425
- type: e
426
- });
427
- });
428
- function st(e = {}) {
429
- const { maxCount: o, duration: t = 3e3, prefixCls: u } = e, c = k(), i = De(
430
- () => /* @__PURE__ */ r(ke, { ref: c }),
431
- []
432
- ), l = {};
433
- let d;
434
- function s(f) {
435
- let p, g;
436
- if (c.current) {
437
- const y = c.current.getContextConfig();
438
- g = y.rtl, p = y.prefixCls;
439
- }
440
- const b = u || p, m = {
441
- position: "top",
442
- duration: t,
443
- ...f
444
- }, { position: n, transitionClassNames: C } = m;
445
- let x;
446
- const v = l[n];
447
- if (v) {
448
- const y = v.notices;
449
- y.length >= o ? (x = y[0].id, v.shift(), v.add({ ...m, id: x })) : x = v.add(m);
450
- } else
451
- d = /* @__PURE__ */ r(
452
- E,
453
- {
454
- ...m,
455
- transitionClassNames: C,
456
- prefixCls: b,
457
- rtl: g,
458
- ref: (y) => {
459
- l[n] = y;
460
- }
461
- }
462
- ), c.current.addInstance(d);
463
- return () => {
464
- var y, M;
465
- (M = (y = l[n]) == null ? void 0 : y.remove) == null || M.call(y, x);
466
- };
467
- }
468
- const a = {};
469
- return $e.forEach((f) => {
470
- a[f] = (p) => {
471
- const g = Ve(p) ? { content: p } : p;
472
- return s({
473
- ...g,
474
- type: f
475
- });
476
- };
477
- }), [a, i];
478
- }
479
- const $e = [...oe];
480
- let q = {}, z = [], Pe, Ee, Ie, Y, we, Re;
481
- function ct(e) {
482
- const {
483
- transitionClassNames: o,
484
- transitionTimeout: t,
485
- prefixCls: u,
486
- rtl: c,
487
- closable: i,
488
- notices: l,
489
- position: d
490
- } = e;
491
- function s(n) {
492
- const C = e.notices.find((x) => x.id === n);
493
- C && e.update({
494
- ...C,
495
- style: { ...C.style, opacity: 0 }
496
- }), setTimeout(() => {
497
- e.remove(n);
498
- }, 100);
499
- }
500
- I(() => (e.add(e), () => {
501
- e.clear();
502
- }), []);
503
- const a = u || Ee, f = H(c) ? we : c, p = H(i) ? Re : i, g = a ? `${a}-message` : "pqb-message", b = {
504
- enter: _(t == null ? void 0 : t.enter) ? t == null ? void 0 : t.enter : 100,
505
- exit: _(t == null ? void 0 : t.exit) ? t == null ? void 0 : t.exit : 300
506
- }, m = U(
507
- `${g}-wrapper`,
508
- `${g}-wrapper-${d}`
509
- );
510
- return /* @__PURE__ */ r("div", { className: m, children: /* @__PURE__ */ r(me, { component: null, children: l.map((n) => /* @__PURE__ */ r(
511
- Ce,
512
- {
513
- timeout: b,
514
- classNames: o || "fadeMessage",
515
- onExit: (C) => {
516
- C && (C.style.height = `${C.scrollHeight}px`);
517
- },
518
- onExiting: (C) => {
519
- C && (C.style.height = 0);
520
- },
521
- onExited: (C) => {
522
- var x;
523
- C && (C.style.height = 0, (x = n.onClose) == null || x.call(n));
524
- },
525
- children: /* @__PURE__ */ r(
526
- be,
527
- {
528
- ...n,
529
- prefixCls: g,
530
- classPrefixCls: a,
531
- iconPrefix: a,
532
- onClose: s,
533
- noticeType: "message",
534
- rtl: f,
535
- ...H(p) ? {} : { closable: p }
536
- }
537
- )
538
- },
539
- n.id
540
- )) }) });
541
- }
542
- const E = ge(ct);
543
- E.config = (e = {}) => {
544
- var o;
545
- _(e.maxCount) && (Pe = e.maxCount), e.prefixCls && (Ee = e.prefixCls), _(e.duration) && (Ie = e.duration), typeof e.rtl == "boolean" && (we = e.rtl), typeof e.closable == "boolean" && (Re = e.closable), ((o = e.getContainer) == null ? void 0 : o.call(e)) !== Y && (Y = e.getContainer(), Object.values(q).forEach((t) => t == null ? void 0 : t.clear()), q = {});
546
- };
547
- E.clear = () => {
548
- Object.values(q).forEach((e) => {
549
- e == null || e.clear();
550
- });
551
- };
552
- E.addInstance = (e) => {
553
- const o = {
554
- position: "top",
555
- duration: Ie,
556
- ...e
557
- }, { position: t, transitionClassNames: u, transitionTimeout: c } = o;
558
- let i;
559
- const l = q[t];
560
- if (l) {
561
- const s = l.notices.find(
562
- (f) => f.id === e.id
563
- ), a = {
564
- ...o,
565
- update: s
566
- };
567
- l.notices.length >= Pe ? s ? l.add({
568
- ...a,
569
- id: s.id
570
- }) : (l.shift(), l.add(a)) : i = l.add(a);
571
- }
572
- if (l === null && z.push(e), l === void 0) {
573
- const s = document.createElement("div");
574
- (Y || document.body).appendChild(s), pe(s).render(
575
- /* @__PURE__ */ r(
576
- E,
577
- {
578
- transitionClassNames: u,
579
- transitionTimeout: c,
580
- ...o,
581
- ref: (f) => {
582
- if (f) {
583
- for (let p = 0; p < z.length; p++)
584
- f.add(z[p]);
585
- z = [], q[t] = f;
586
- }
587
- }
588
- }
589
- )
590
- ), q[t] = null;
591
- }
592
- return () => {
593
- var s, a;
594
- (a = (s = q[t]) == null ? void 0 : s.remove) == null || a.call(s, i);
595
- };
596
- };
597
- $e.forEach((e) => {
598
- E[e] = (o) => {
599
- const t = typeof o == "string" ? { content: o } : o;
600
- return E.addInstance({
601
- ...t,
602
- type: e
603
- });
604
- };
605
- });
606
- E.useMessage = st;
607
- const lt = {
608
- primaryColor: {
609
- default: "--pqbblue-6",
610
- hover: "--pqbblue-5",
611
- active: "--pqbblue-7"
612
- },
613
- successColor: {
614
- default: "--green-6",
615
- hover: "--green-5",
616
- active: "--green-7"
617
- },
618
- infoColor: {
619
- default: "--pqbblue-6",
620
- hover: "--pqbblue-5",
621
- active: "--pqbblue-7"
622
- },
623
- warningColor: {
624
- default: "--orangered-6",
625
- hover: "--orangered-5",
626
- active: "--orangered-7"
627
- },
628
- dangerColor: {
629
- default: "--red-6",
630
- hover: "--red-5",
631
- active: "--red-7"
632
- }
633
- }, at = xe, ft = {};
634
- function ne(e) {
635
- const o = te(
636
- e,
637
- at,
638
- ft
639
- ), {
640
- theme: t,
641
- themeMode: u,
642
- prefixCls: c,
643
- children: i,
644
- locale: l,
645
- rtl: d,
646
- effectGlobalNotice: s = !0,
647
- effectGlobalModal: a = !0
648
- } = o, f = window.document.body;
649
- I(() => {
650
- t && Fe(t) && Object.entries(lt).forEach(([m, n], C, x) => {
651
- const v = t[m];
652
- if (!v) return;
653
- const h = new Ue(v);
654
- f.style.setProperty(n.default, h.lighten(0).toRgbArrayString()), t[`${m}Hover`] || f.style.setProperty(n.hover, h.lighten(10).toRgbArrayString()), t[`${m}Active`] || f.style.setProperty(n.active, h.lighten(-10).toRgbArrayString());
655
- });
656
- }, [t]), I(() => {
657
- const m = ["pqb-theme"];
658
- return u ? m.forEach((n) => {
659
- f.setAttribute(n, u);
660
- }) : m.forEach((n) => {
661
- f.removeAttribute(n);
662
- }), () => {
663
- };
664
- }, [u]), I(() => {
665
- s && (E.config({ prefixCls: c, rtl: d }), $.config({ prefixCls: c, rtl: d }));
666
- }, [c, d, s]);
667
- function p(m, n) {
668
- return `${n || c}-${m}`;
669
- }
670
- const g = {
671
- ...Xe(o, ["children"]),
672
- getPrefixCls: p
673
- };
674
- I(() => {
675
- a && We({ locale: l, prefixCls: c, rtl: d });
676
- }, [l, c, d, a]);
677
- let b = i;
678
- return c && c !== "pqb" && (b = /* @__PURE__ */ r(W.Provider, { value: { prefixCls: c }, children: i })), /* @__PURE__ */ r(R.Provider, { value: g, children: b });
679
- }
680
- ne.ConfigContext = R;
681
- ne.displayName = "ConfigProvider";
682
- const Gt = R.Consumer;
683
- function Me(e, o) {
684
- const t = D(R), [u, c] = Se([]);
685
- function i(s) {
686
- c((a) => [...a, s]);
687
- }
688
- function l(s) {
689
- c(
690
- (a) => a.filter((f) => s !== f)
691
- );
692
- }
693
- function d() {
694
- return t;
695
- }
696
- return ee(o, () => ({
697
- addInstance: i,
698
- removeInstance: l,
699
- getContextConfig: d
700
- })), Q.Children.map(
701
- u,
702
- (s, a) => Q.cloneElement(s, { key: a })
703
- );
704
- }
705
- Me.displayName = "ContextHolderElement";
706
- const ke = Z(Me);
707
- export {
708
- Gt as C,
709
- xe as D,
710
- Ze as E,
711
- ue as I,
712
- E as M,
713
- $ as N,
714
- R as a,
715
- ne as b,
716
- nt as c,
717
- ke as d,
718
- lt as e,
719
- be as f,
720
- re as g,
721
- $e as m,
722
- oe as n,
723
- st as u
724
- };