@unicom-cloud/ui 0.8.81 → 0.8.82

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