@unicom-cloud/ui 0.8.69 → 0.8.70

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