@amateescu/portal-ui-components 0.0.23 → 0.0.25-react19

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 (51) hide show
  1. package/dist/Box-DQNjUj2G.js +102 -0
  2. package/dist/Button-D2XVkO19.js +676 -0
  3. package/dist/ButtonBase-D-XlpvIZ.js +954 -0
  4. package/dist/CircularProgress-BOkP0juA.js +247 -0
  5. package/dist/{EllipsisOutlined-CtmB5yDB.js → EllipsisOutlined-DfTPoz8U.js} +667 -672
  6. package/dist/PurePanel-ByiFMw5U.js +2213 -0
  7. package/dist/{Skeleton-XFbjx7LJ.js → Skeleton-Imy-56Lv.js} +161 -158
  8. package/dist/{UserInfoDropdown-DGaplQo6.js → UserInfoDropdown-6aB5cQyF.js} +1540 -1505
  9. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  10. package/dist/components/ConfirmationModal/ConfirmationModal.js +1 -1
  11. package/dist/components/ConfirmationModal/ConfirmationModal.stories.js +1 -1
  12. package/dist/components/CustomButton/CustomButton.js +1 -1
  13. package/dist/components/CustomPagination/CustomPagination.js +455 -344
  14. package/dist/components/ErrorModal/ErrorModal.js +5 -6
  15. package/dist/components/ErrorModal/ErrorModal.stories.js +1 -1
  16. package/dist/components/InfoModal/InfoModal.js +1 -1
  17. package/dist/components/InfoModal/InfoModal.stories.js +1 -1
  18. package/dist/components/KpiCard/KpiCard.js +1003 -892
  19. package/dist/components/LoadingAnimation/LoadingAnimation.js +6 -215
  20. package/dist/components/Login/Login.js +4485 -3820
  21. package/dist/components/Login/Login.stories.js +1586 -1546
  22. package/dist/components/SideMenu/SideMenu.js +1 -1
  23. package/dist/components/SideMenu/SideMenu.types.d.ts +1 -0
  24. package/dist/components/TotalDataGrid/TotalDataGrid.js +6 -6
  25. package/dist/components/UserInfoDropdown/UserInfoDropdown.js +1 -1
  26. package/dist/components/UserInfoDropdown/UserInfoDropdown.stories.js +1 -1
  27. package/dist/components/index.js +1 -1
  28. package/dist/context-D_FWkiDE.js +7383 -0
  29. package/dist/createSimplePaletteValueFilter-CshNo3IR.js +3439 -0
  30. package/dist/index-CR8gh-dS.js +1689 -0
  31. package/dist/index-CyFfYou3.js +411 -0
  32. package/dist/main.js +33 -30
  33. package/dist/objectWithoutPropertiesLoose-BTau6TOn.js +33 -0
  34. package/dist/portal-utils/formatters.js +68 -0
  35. package/dist/portal-utils/index.d.ts +1 -0
  36. package/dist/portal-utils/index.js +13 -10
  37. package/dist/portal-utils/loggerService.d.ts +12 -0
  38. package/dist/portal-utils/loggerService.js +16 -0
  39. package/dist/useSlot-kDVPuVrn.js +431 -0
  40. package/package.json +38 -38
  41. package/dist/Box-CmKt1PwF.js +0 -68
  42. package/dist/Button-BT8r3F_d.js +0 -355
  43. package/dist/ButtonBase-By486Sca.js +0 -966
  44. package/dist/PurePanel-CfZ1n-M8.js +0 -4782
  45. package/dist/assertThisInitialized-BUtkG-md.js +0 -13
  46. package/dist/createSvgIcon-B8ya7kb4.js +0 -250
  47. package/dist/generateUtilityClasses-Bhjgm_6-.js +0 -3270
  48. package/dist/index-1vDmwq0E.js +0 -19089
  49. package/dist/index-DsP9yT3s.js +0 -1551
  50. package/dist/objectWithoutPropertiesLoose-CIT-1_kH.js +0 -227
  51. package/dist/useId-DbfH3PlN.js +0 -5397
@@ -1,1551 +0,0 @@
1
- import { L as Sn, D as ue, I as ae, d as P, _ as K, E as On, K as He, F as $n, k as Nn, c as I, f as Ee, b as me, n as Ae, G as Se, H as wn, J as Oe, i as $e, P as Pn, M as In, j as Tn, N as Ve, O as Mn, g as Rn, m as jn, u as N, v as Bn, y as Dn, a as re, s as ge, z as We, r as oe, Q as Fn, B as zn, C as Ge, R as Ln, S as _n, T as Hn, U as qe } from "./useId-DbfH3PlN.js";
2
- import * as r from "react";
3
- import v, { useContext as Y, useRef as U, useMemo as An, useEffect as Ne } from "react";
4
- import { B as Ce, c as Ue, i as Vn, u as Wn, C as Gn, z as qn, a as Un, b as Kn, r as Xn, w as kn } from "./PurePanel-CfZ1n-M8.js";
5
- import { a as D } from "./objectWithoutPropertiesLoose-CIT-1_kH.js";
6
- import { R as ve, S as Qn } from "./Skeleton-XFbjx7LJ.js";
7
- const pe = (e, n) => {
8
- const t = r.useContext(Sn), o = r.useMemo(() => {
9
- var l;
10
- const c = n || ue[e], d = (l = t == null ? void 0 : t[e]) !== null && l !== void 0 ? l : {};
11
- return Object.assign(Object.assign({}, typeof c == "function" ? c() : c), d || {});
12
- }, [e, n, t]), a = r.useMemo(() => {
13
- const l = t == null ? void 0 : t.locale;
14
- return t != null && t.exist && !l ? ue.locale : l;
15
- }, [t]);
16
- return [o, a];
17
- };
18
- var Zn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, name: "check-circle", theme: "filled" }, Yn = function(n, t) {
19
- return /* @__PURE__ */ r.createElement(ae, D({}, n, {
20
- ref: t,
21
- icon: Zn
22
- }));
23
- }, Ke = /* @__PURE__ */ r.forwardRef(Yn);
24
- process.env.NODE_ENV !== "production" && (Ke.displayName = "CheckCircleFilled");
25
- var Jn = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, name: "close-circle", theme: "filled" }, et = function(n, t) {
26
- return /* @__PURE__ */ r.createElement(ae, D({}, n, {
27
- ref: t,
28
- icon: Jn
29
- }));
30
- }, Xe = /* @__PURE__ */ r.forwardRef(et);
31
- process.env.NODE_ENV !== "production" && (Xe.displayName = "CloseCircleFilled");
32
- var nt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, name: "exclamation-circle", theme: "filled" }, tt = function(n, t) {
33
- return /* @__PURE__ */ r.createElement(ae, D({}, n, {
34
- ref: t,
35
- icon: nt
36
- }));
37
- }, ke = /* @__PURE__ */ r.forwardRef(tt);
38
- process.env.NODE_ENV !== "production" && (ke.displayName = "ExclamationCircleFilled");
39
- var ot = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, name: "info-circle", theme: "filled" }, at = function(n, t) {
40
- return /* @__PURE__ */ r.createElement(ae, D({}, n, {
41
- ref: t,
42
- icon: ot
43
- }));
44
- }, Qe = /* @__PURE__ */ r.forwardRef(at);
45
- process.env.NODE_ENV !== "production" && (Qe.displayName = "InfoCircleFilled");
46
- var rt = `accept acceptCharset accessKey action allowFullScreen allowTransparency
47
- alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
48
- charSet checked classID className colSpan cols content contentEditable contextMenu
49
- controls coords crossOrigin data dateTime default defer dir disabled download draggable
50
- encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
51
- headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
52
- is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
53
- mediaGroup method min minLength multiple muted name noValidate nonce open
54
- optimum pattern placeholder poster preload radioGroup readOnly rel required
55
- reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
56
- shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
57
- summary tabIndex target title type useMap value width wmode wrap`, lt = `onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
58
- onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
59
- onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
60
- onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
61
- onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
62
- onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
63
- onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`, it = "".concat(rt, " ").concat(lt).split(/[\s\n]+/), st = "aria-", ct = "data-";
64
- function we(e, n) {
65
- return e.indexOf(n) === 0;
66
- }
67
- function be(e) {
68
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, t;
69
- n === !1 ? t = {
70
- aria: !0,
71
- data: !0,
72
- attr: !0
73
- } : n === !0 ? t = {
74
- aria: !0
75
- } : t = P({}, n);
76
- var o = {};
77
- return Object.keys(e).forEach(function(a) {
78
- // Aria
79
- (t.aria && (a === "role" || we(a, st)) || // Data
80
- t.data && we(a, ct) || // Attr
81
- t.attr && it.includes(a)) && (o[a] = e[a]);
82
- }), o;
83
- }
84
- function dt() {
85
- const [e, n] = r.useState([]), t = r.useCallback((o) => (n((a) => [].concat(K(a), [o])), () => {
86
- n((a) => a.filter((l) => l !== o));
87
- }), []);
88
- return [e, t];
89
- }
90
- const ut = new He("antFadeIn", {
91
- "0%": {
92
- opacity: 0
93
- },
94
- "100%": {
95
- opacity: 1
96
- }
97
- }), ft = new He("antFadeOut", {
98
- "0%": {
99
- opacity: 1
100
- },
101
- "100%": {
102
- opacity: 0
103
- }
104
- }), mt = function(e) {
105
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
106
- const {
107
- antCls: t
108
- } = e, o = `${t}-fade`, a = n ? "&" : "";
109
- return [On(o, ut, ft, e.motionDurationMid, n), {
110
- [`
111
- ${a}${o}-enter,
112
- ${a}${o}-appear
113
- `]: {
114
- opacity: 0,
115
- animationTimingFunction: "linear"
116
- },
117
- [`${a}${o}-leave`]: {
118
- animationTimingFunction: "linear"
119
- }
120
- }];
121
- };
122
- function de(e) {
123
- return !!(e != null && e.then);
124
- }
125
- const Ze = (e) => {
126
- const {
127
- type: n,
128
- children: t,
129
- prefixCls: o,
130
- buttonProps: a,
131
- close: l,
132
- autoFocus: c,
133
- emitEvent: d,
134
- isSilent: s,
135
- quitOnNullishReturnValue: u,
136
- actionFn: i
137
- } = e, f = r.useRef(!1), C = r.useRef(null), [b, h] = $n(!1), m = function() {
138
- l == null || l.apply(void 0, arguments);
139
- };
140
- r.useEffect(() => {
141
- let g = null;
142
- return c && (g = setTimeout(() => {
143
- var x;
144
- (x = C.current) === null || x === void 0 || x.focus();
145
- })), () => {
146
- g && clearTimeout(g);
147
- };
148
- }, []);
149
- const y = (g) => {
150
- de(g) && (h(!0), g.then(function() {
151
- h(!1, !0), m.apply(void 0, arguments), f.current = !1;
152
- }, (x) => {
153
- if (h(!1, !0), f.current = !1, !(s != null && s()))
154
- return Promise.reject(x);
155
- }));
156
- }, p = (g) => {
157
- if (f.current)
158
- return;
159
- if (f.current = !0, !i) {
160
- m();
161
- return;
162
- }
163
- let x;
164
- if (d) {
165
- if (x = i(g), u && !de(x)) {
166
- f.current = !1, m(g);
167
- return;
168
- }
169
- } else if (i.length)
170
- x = i(l), f.current = !1;
171
- else if (x = i(), !de(x)) {
172
- m();
173
- return;
174
- }
175
- y(x);
176
- };
177
- return /* @__PURE__ */ r.createElement(Ce, Object.assign({}, Ue(n), {
178
- onClick: p,
179
- loading: b,
180
- prefixCls: o
181
- }, a, {
182
- ref: C
183
- }), t);
184
- }, J = /* @__PURE__ */ v.createContext({}), {
185
- Provider: Ye
186
- } = J, Pe = () => {
187
- const {
188
- autoFocusButton: e,
189
- cancelButtonProps: n,
190
- cancelTextLocale: t,
191
- isSilent: o,
192
- mergedOkCancel: a,
193
- rootPrefixCls: l,
194
- close: c,
195
- onCancel: d,
196
- onConfirm: s
197
- } = Y(J);
198
- return a ? /* @__PURE__ */ v.createElement(Ze, {
199
- isSilent: o,
200
- actionFn: d,
201
- close: function() {
202
- c == null || c.apply(void 0, arguments), s == null || s(!1);
203
- },
204
- autoFocus: e === "cancel",
205
- buttonProps: n,
206
- prefixCls: `${l}-btn`
207
- }, t) : null;
208
- }, Ie = () => {
209
- const {
210
- autoFocusButton: e,
211
- close: n,
212
- isSilent: t,
213
- okButtonProps: o,
214
- rootPrefixCls: a,
215
- okTextLocale: l,
216
- okType: c,
217
- onConfirm: d,
218
- onOk: s
219
- } = Y(J);
220
- return /* @__PURE__ */ v.createElement(Ze, {
221
- isSilent: t,
222
- type: c || "primary",
223
- actionFn: s,
224
- close: function() {
225
- n == null || n.apply(void 0, arguments), d == null || d(!0);
226
- },
227
- autoFocus: e === "ok",
228
- buttonProps: o,
229
- prefixCls: `${a}-btn`
230
- }, l);
231
- };
232
- var Je = /* @__PURE__ */ r.createContext({});
233
- function Te(e, n, t) {
234
- var o = n;
235
- return !o && t && (o = "".concat(e, "-").concat(t)), o;
236
- }
237
- function Me(e, n) {
238
- var t = e["page".concat(n ? "Y" : "X", "Offset")], o = "scroll".concat(n ? "Top" : "Left");
239
- if (typeof t != "number") {
240
- var a = e.document;
241
- t = a.documentElement[o], typeof t != "number" && (t = a.body[o]);
242
- }
243
- return t;
244
- }
245
- function gt(e) {
246
- var n = e.getBoundingClientRect(), t = {
247
- left: n.left,
248
- top: n.top
249
- }, o = e.ownerDocument, a = o.defaultView || o.parentWindow;
250
- return t.left += Me(a), t.top += Me(a, !0), t;
251
- }
252
- const Ct = /* @__PURE__ */ r.memo(function(e) {
253
- var n = e.children;
254
- return n;
255
- }, function(e, n) {
256
- var t = n.shouldUpdate;
257
- return !t;
258
- });
259
- var vt = {
260
- width: 0,
261
- height: 0,
262
- overflow: "hidden",
263
- outline: "none"
264
- }, pt = {
265
- outline: "none"
266
- }, ye = /* @__PURE__ */ v.forwardRef(function(e, n) {
267
- var t = e.prefixCls, o = e.className, a = e.style, l = e.title, c = e.ariaId, d = e.footer, s = e.closable, u = e.closeIcon, i = e.onClose, f = e.children, C = e.bodyStyle, b = e.bodyProps, h = e.modalRender, m = e.onMouseDown, y = e.onMouseUp, p = e.holderRef, g = e.visible, x = e.forceRender, E = e.width, w = e.height, O = e.classNames, S = e.styles, R = v.useContext(Je), T = R.panel, A = Nn(p, T), F = U(), V = U();
268
- v.useImperativeHandle(n, function() {
269
- return {
270
- focus: function() {
271
- var z;
272
- (z = F.current) === null || z === void 0 || z.focus({
273
- preventScroll: !0
274
- });
275
- },
276
- changeActive: function(z) {
277
- var L = document, M = L.activeElement;
278
- z && M === V.current ? F.current.focus({
279
- preventScroll: !0
280
- }) : !z && M === F.current && V.current.focus({
281
- preventScroll: !0
282
- });
283
- }
284
- };
285
- });
286
- var H = {};
287
- E !== void 0 && (H.width = E), w !== void 0 && (H.height = w);
288
- var j = d ? /* @__PURE__ */ v.createElement("div", {
289
- className: I("".concat(t, "-footer"), O == null ? void 0 : O.footer),
290
- style: P({}, S == null ? void 0 : S.footer)
291
- }, d) : null, B = l ? /* @__PURE__ */ v.createElement("div", {
292
- className: I("".concat(t, "-header"), O == null ? void 0 : O.header),
293
- style: P({}, S == null ? void 0 : S.header)
294
- }, /* @__PURE__ */ v.createElement("div", {
295
- className: "".concat(t, "-title"),
296
- id: c
297
- }, l)) : null, W = An(function() {
298
- return Ee(s) === "object" && s !== null ? s : s ? {
299
- closeIcon: u ?? /* @__PURE__ */ v.createElement("span", {
300
- className: "".concat(t, "-close-x")
301
- })
302
- } : {};
303
- }, [s, u, t]), G = be(W, !0), q = Ee(s) === "object" && s.disabled, Z = s ? /* @__PURE__ */ v.createElement("button", D({
304
- type: "button",
305
- onClick: i,
306
- "aria-label": "Close"
307
- }, G, {
308
- className: "".concat(t, "-close"),
309
- disabled: q
310
- }), W.closeIcon) : null, X = /* @__PURE__ */ v.createElement("div", {
311
- className: I("".concat(t, "-content"), O == null ? void 0 : O.content),
312
- style: S == null ? void 0 : S.content
313
- }, Z, B, /* @__PURE__ */ v.createElement("div", D({
314
- className: I("".concat(t, "-body"), O == null ? void 0 : O.body),
315
- style: P(P({}, C), S == null ? void 0 : S.body)
316
- }, b), f), j);
317
- return /* @__PURE__ */ v.createElement("div", {
318
- key: "dialog-element",
319
- role: "dialog",
320
- "aria-labelledby": l ? c : null,
321
- "aria-modal": "true",
322
- ref: A,
323
- style: P(P({}, a), H),
324
- className: I(t, o),
325
- onMouseDown: m,
326
- onMouseUp: y
327
- }, /* @__PURE__ */ v.createElement("div", {
328
- ref: F,
329
- tabIndex: 0,
330
- style: pt
331
- }, /* @__PURE__ */ v.createElement(Ct, {
332
- shouldUpdate: g || x
333
- }, h ? h(X) : X)), /* @__PURE__ */ v.createElement("div", {
334
- tabIndex: 0,
335
- ref: V,
336
- style: vt
337
- }));
338
- });
339
- process.env.NODE_ENV !== "production" && (ye.displayName = "Panel");
340
- var en = /* @__PURE__ */ r.forwardRef(function(e, n) {
341
- var t = e.prefixCls, o = e.title, a = e.style, l = e.className, c = e.visible, d = e.forceRender, s = e.destroyOnClose, u = e.motionName, i = e.ariaId, f = e.onVisibleChanged, C = e.mousePosition, b = U(), h = r.useState(), m = me(h, 2), y = m[0], p = m[1], g = {};
342
- y && (g.transformOrigin = y);
343
- function x() {
344
- var E = gt(b.current);
345
- p(C && (C.x || C.y) ? "".concat(C.x - E.left, "px ").concat(C.y - E.top, "px") : "");
346
- }
347
- return /* @__PURE__ */ r.createElement(Ae, {
348
- visible: c,
349
- onVisibleChanged: f,
350
- onAppearPrepare: x,
351
- onEnterPrepare: x,
352
- forceRender: d,
353
- motionName: u,
354
- removeOnLeave: s,
355
- ref: b
356
- }, function(E, w) {
357
- var O = E.className, S = E.style;
358
- return /* @__PURE__ */ r.createElement(ye, D({}, e, {
359
- ref: n,
360
- title: o,
361
- ariaId: i,
362
- prefixCls: t,
363
- holderRef: w,
364
- style: P(P(P({}, S), a), g),
365
- className: I(l, O)
366
- }));
367
- });
368
- });
369
- en.displayName = "Content";
370
- var bt = function(n) {
371
- var t = n.prefixCls, o = n.style, a = n.visible, l = n.maskProps, c = n.motionName, d = n.className;
372
- return /* @__PURE__ */ r.createElement(Ae, {
373
- key: "mask",
374
- visible: a,
375
- motionName: c,
376
- leavedClassName: "".concat(t, "-mask-hidden")
377
- }, function(s, u) {
378
- var i = s.className, f = s.style;
379
- return /* @__PURE__ */ r.createElement("div", D({
380
- ref: u,
381
- style: P(P({}, f), o),
382
- className: I("".concat(t, "-mask"), i, d)
383
- }, l));
384
- });
385
- }, yt = function(n) {
386
- var t = n.prefixCls, o = t === void 0 ? "rc-dialog" : t, a = n.zIndex, l = n.visible, c = l === void 0 ? !1 : l, d = n.keyboard, s = d === void 0 ? !0 : d, u = n.focusTriggerAfterClose, i = u === void 0 ? !0 : u, f = n.wrapStyle, C = n.wrapClassName, b = n.wrapProps, h = n.onClose, m = n.afterOpenChange, y = n.afterClose, p = n.transitionName, g = n.animation, x = n.closable, E = x === void 0 ? !0 : x, w = n.mask, O = w === void 0 ? !0 : w, S = n.maskTransitionName, R = n.maskAnimation, T = n.maskClosable, A = T === void 0 ? !0 : T, F = n.maskStyle, V = n.maskProps, H = n.rootClassName, j = n.classNames, B = n.styles;
387
- process.env.NODE_ENV !== "production" && (["wrapStyle", "bodyStyle", "maskStyle"].forEach(function($) {
388
- Se(!($ in n), "".concat($, " is deprecated, please use styles instead."));
389
- }), "wrapClassName" in n && Se(!1, "wrapClassName is deprecated, please use classNames instead."));
390
- var W = U(), G = U(), q = U(), Z = r.useState(c), X = me(Z, 2), k = X[0], z = X[1], L = wn();
391
- function M() {
392
- Oe(G.current, document.activeElement) || (W.current = document.activeElement);
393
- }
394
- function ne() {
395
- if (!Oe(G.current, document.activeElement)) {
396
- var $;
397
- ($ = q.current) === null || $ === void 0 || $.focus();
398
- }
399
- }
400
- function le($) {
401
- if ($)
402
- ne();
403
- else {
404
- if (z(!1), O && W.current && i) {
405
- try {
406
- W.current.focus({
407
- preventScroll: !0
408
- });
409
- } catch {
410
- }
411
- W.current = null;
412
- }
413
- k && (y == null || y());
414
- }
415
- m == null || m($);
416
- }
417
- function ie($) {
418
- h == null || h($);
419
- }
420
- var te = U(!1), se = U(), yn = function() {
421
- clearTimeout(se.current), te.current = !0;
422
- }, hn = function() {
423
- se.current = setTimeout(function() {
424
- te.current = !1;
425
- });
426
- }, xe = null;
427
- A && (xe = function(ce) {
428
- te.current ? te.current = !1 : G.current === ce.target && ie(ce);
429
- });
430
- function xn($) {
431
- if (s && $.keyCode === $e.ESC) {
432
- $.stopPropagation(), ie($);
433
- return;
434
- }
435
- c && $.keyCode === $e.TAB && q.current.changeActive(!$.shiftKey);
436
- }
437
- Ne(function() {
438
- c && (z(!0), M());
439
- }, [c]), Ne(function() {
440
- return function() {
441
- clearTimeout(se.current);
442
- };
443
- }, []);
444
- var En = P(P(P({
445
- zIndex: a
446
- }, f), B == null ? void 0 : B.wrapper), {}, {
447
- display: k ? null : "none"
448
- });
449
- return /* @__PURE__ */ r.createElement("div", D({
450
- className: I("".concat(o, "-root"), H)
451
- }, be(n, {
452
- data: !0
453
- })), /* @__PURE__ */ r.createElement(bt, {
454
- prefixCls: o,
455
- visible: O && c,
456
- motionName: Te(o, S, R),
457
- style: P(P({
458
- zIndex: a
459
- }, F), B == null ? void 0 : B.mask),
460
- maskProps: V,
461
- className: j == null ? void 0 : j.mask
462
- }), /* @__PURE__ */ r.createElement("div", D({
463
- tabIndex: -1,
464
- onKeyDown: xn,
465
- className: I("".concat(o, "-wrap"), C, j == null ? void 0 : j.wrapper),
466
- ref: G,
467
- onClick: xe,
468
- style: En
469
- }, b), /* @__PURE__ */ r.createElement(en, D({}, n, {
470
- onMouseDown: yn,
471
- onMouseUp: hn,
472
- ref: q,
473
- closable: E,
474
- ariaId: L,
475
- prefixCls: o,
476
- visible: c && k,
477
- onClose: ie,
478
- onVisibleChanged: le,
479
- motionName: Te(o, p, g)
480
- }))));
481
- }, nn = function(n) {
482
- var t = n.visible, o = n.getContainer, a = n.forceRender, l = n.destroyOnClose, c = l === void 0 ? !1 : l, d = n.afterClose, s = n.panelRef, u = r.useState(t), i = me(u, 2), f = i[0], C = i[1], b = r.useMemo(function() {
483
- return {
484
- panel: s
485
- };
486
- }, [s]);
487
- return r.useEffect(function() {
488
- t && C(!0);
489
- }, [t]), !a && c && !f ? null : /* @__PURE__ */ r.createElement(Je.Provider, {
490
- value: b
491
- }, /* @__PURE__ */ r.createElement(Pn, {
492
- open: t || a || f,
493
- autoDestroy: !1,
494
- getContainer: o,
495
- autoLock: t || f
496
- }, /* @__PURE__ */ r.createElement(yt, D({}, n, {
497
- destroyOnClose: c,
498
- afterClose: function() {
499
- d == null || d(), C(!1);
500
- }
501
- }))));
502
- };
503
- nn.displayName = "Dialog";
504
- function Re(e) {
505
- if (e)
506
- return {
507
- closable: e.closable,
508
- closeIcon: e.closeIcon
509
- };
510
- }
511
- function je(e) {
512
- const {
513
- closable: n,
514
- closeIcon: t
515
- } = e || {};
516
- return v.useMemo(() => {
517
- if (
518
- // If `closable`, whatever rest be should be true
519
- !n && (n === !1 || t === !1 || t === null)
520
- )
521
- return !1;
522
- if (n === void 0 && t === void 0)
523
- return null;
524
- let o = {
525
- closeIcon: typeof t != "boolean" && t !== null ? t : void 0
526
- };
527
- return n && typeof n == "object" && (o = Object.assign(Object.assign({}, o), n)), o;
528
- }, [n, t]);
529
- }
530
- function Be() {
531
- const e = {};
532
- for (var n = arguments.length, t = new Array(n), o = 0; o < n; o++)
533
- t[o] = arguments[o];
534
- return t.forEach((a) => {
535
- a && Object.keys(a).forEach((l) => {
536
- a[l] !== void 0 && (e[l] = a[l]);
537
- });
538
- }), e;
539
- }
540
- const ht = {};
541
- function xt(e, n) {
542
- let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ht;
543
- const o = je(e), a = je(n), l = typeof o != "boolean" ? !!(o != null && o.disabled) : !1, c = v.useMemo(() => Object.assign({
544
- closeIcon: /* @__PURE__ */ v.createElement(ve, null)
545
- }, t), [t]), d = v.useMemo(() => o === !1 ? !1 : o ? Be(c, a, o) : a === !1 ? !1 : a ? Be(c, a) : c.closable ? c : !1, [o, a, c]);
546
- return v.useMemo(() => {
547
- if (d === !1)
548
- return [!1, null, l];
549
- const {
550
- closeIconRender: s
551
- } = c, {
552
- closeIcon: u
553
- } = d;
554
- let i = u;
555
- if (i != null) {
556
- s && (i = s(u));
557
- const f = be(d, !0);
558
- Object.keys(f).length && (i = /* @__PURE__ */ v.isValidElement(i) ? /* @__PURE__ */ v.cloneElement(i, f) : /* @__PURE__ */ v.createElement("span", Object.assign({}, f), i));
559
- }
560
- return [!0, i, l];
561
- }, [d, c]);
562
- }
563
- const Et = () => In() && window.document.documentElement;
564
- function De() {
565
- }
566
- const St = /* @__PURE__ */ r.createContext({
567
- add: De,
568
- remove: De
569
- });
570
- function Ot(e) {
571
- const n = r.useContext(St), t = r.useRef();
572
- return Tn((a) => {
573
- if (a) {
574
- const l = e ? a.querySelector(e) : a;
575
- n.add(l), t.current = l;
576
- } else
577
- n.remove(t.current);
578
- });
579
- }
580
- const Fe = () => {
581
- const {
582
- cancelButtonProps: e,
583
- cancelTextLocale: n,
584
- onCancel: t
585
- } = Y(J);
586
- return /* @__PURE__ */ v.createElement(Ce, Object.assign({
587
- onClick: t
588
- }, e), n);
589
- }, ze = () => {
590
- const {
591
- confirmLoading: e,
592
- okButtonProps: n,
593
- okType: t,
594
- okTextLocale: o,
595
- onOk: a
596
- } = Y(J);
597
- return /* @__PURE__ */ v.createElement(Ce, Object.assign({}, Ue(t), {
598
- loading: e,
599
- onClick: a
600
- }, n), o);
601
- };
602
- function tn(e, n) {
603
- return /* @__PURE__ */ v.createElement("span", {
604
- className: `${e}-close-x`
605
- }, n || /* @__PURE__ */ v.createElement(ve, {
606
- className: `${e}-close-icon`
607
- }));
608
- }
609
- const on = (e) => {
610
- const {
611
- okText: n,
612
- okType: t = "primary",
613
- cancelText: o,
614
- confirmLoading: a,
615
- onOk: l,
616
- onCancel: c,
617
- okButtonProps: d,
618
- cancelButtonProps: s,
619
- footer: u
620
- } = e, [i] = pe("Modal", Ve()), f = n || (i == null ? void 0 : i.okText), C = o || (i == null ? void 0 : i.cancelText), b = {
621
- confirmLoading: a,
622
- okButtonProps: d,
623
- cancelButtonProps: s,
624
- okTextLocale: f,
625
- cancelTextLocale: C,
626
- okType: t,
627
- onOk: l,
628
- onCancel: c
629
- }, h = v.useMemo(() => b, K(Object.values(b)));
630
- let m;
631
- return typeof u == "function" || typeof u > "u" ? (m = /* @__PURE__ */ v.createElement(v.Fragment, null, /* @__PURE__ */ v.createElement(Fe, null), /* @__PURE__ */ v.createElement(ze, null)), typeof u == "function" && (m = u(m, {
632
- OkBtn: ze,
633
- CancelBtn: Fe
634
- })), m = /* @__PURE__ */ v.createElement(Ye, {
635
- value: h
636
- }, m)) : m = u, /* @__PURE__ */ v.createElement(Mn, {
637
- disabled: !1
638
- }, m);
639
- };
640
- function Le(e) {
641
- return {
642
- position: e,
643
- inset: 0
644
- };
645
- }
646
- const $t = (e) => {
647
- const {
648
- componentCls: n,
649
- antCls: t
650
- } = e;
651
- return [{
652
- [`${n}-root`]: {
653
- [`${n}${t}-zoom-enter, ${n}${t}-zoom-appear`]: {
654
- // reset scale avoid mousePosition bug
655
- transform: "none",
656
- opacity: 0,
657
- animationDuration: e.motionDurationSlow,
658
- // https://github.com/ant-design/ant-design/issues/11777
659
- userSelect: "none"
660
- },
661
- // https://github.com/ant-design/ant-design/issues/37329
662
- // https://github.com/ant-design/ant-design/issues/40272
663
- [`${n}${t}-zoom-leave ${n}-content`]: {
664
- pointerEvents: "none"
665
- },
666
- [`${n}-mask`]: Object.assign(Object.assign({}, Le("fixed")), {
667
- zIndex: e.zIndexPopupBase,
668
- height: "100%",
669
- backgroundColor: e.colorBgMask,
670
- pointerEvents: "none",
671
- [`${n}-hidden`]: {
672
- display: "none"
673
- }
674
- }),
675
- [`${n}-wrap`]: Object.assign(Object.assign({}, Le("fixed")), {
676
- zIndex: e.zIndexPopupBase,
677
- overflow: "auto",
678
- outline: 0,
679
- WebkitOverflowScrolling: "touch"
680
- })
681
- }
682
- }, {
683
- [`${n}-root`]: mt(e)
684
- }];
685
- }, Nt = (e) => {
686
- const {
687
- componentCls: n
688
- } = e;
689
- return [
690
- // ======================== Root =========================
691
- {
692
- [`${n}-root`]: {
693
- [`${n}-wrap-rtl`]: {
694
- direction: "rtl"
695
- },
696
- [`${n}-centered`]: {
697
- textAlign: "center",
698
- "&::before": {
699
- display: "inline-block",
700
- width: 0,
701
- height: "100%",
702
- verticalAlign: "middle",
703
- content: '""'
704
- },
705
- [n]: {
706
- top: 0,
707
- display: "inline-block",
708
- paddingBottom: 0,
709
- textAlign: "start",
710
- verticalAlign: "middle"
711
- }
712
- },
713
- [`@media (max-width: ${e.screenSMMax}px)`]: {
714
- [n]: {
715
- maxWidth: "calc(100vw - 16px)",
716
- margin: `${N(e.marginXS)} auto`
717
- },
718
- [`${n}-centered`]: {
719
- [n]: {
720
- flex: 1
721
- }
722
- }
723
- }
724
- }
725
- },
726
- // ======================== Modal ========================
727
- {
728
- [n]: Object.assign(Object.assign({}, Bn(e)), {
729
- pointerEvents: "none",
730
- position: "relative",
731
- top: 100,
732
- width: "auto",
733
- maxWidth: `calc(100vw - ${N(e.calc(e.margin).mul(2).equal())})`,
734
- margin: "0 auto",
735
- paddingBottom: e.paddingLG,
736
- [`${n}-title`]: {
737
- margin: 0,
738
- color: e.titleColor,
739
- fontWeight: e.fontWeightStrong,
740
- fontSize: e.titleFontSize,
741
- lineHeight: e.titleLineHeight,
742
- wordWrap: "break-word"
743
- },
744
- [`${n}-content`]: {
745
- position: "relative",
746
- backgroundColor: e.contentBg,
747
- backgroundClip: "padding-box",
748
- border: 0,
749
- borderRadius: e.borderRadiusLG,
750
- boxShadow: e.boxShadow,
751
- pointerEvents: "auto",
752
- padding: e.contentPadding
753
- },
754
- [`${n}-close`]: Object.assign({
755
- position: "absolute",
756
- top: e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),
757
- insetInlineEnd: e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),
758
- zIndex: e.calc(e.zIndexPopupBase).add(10).equal(),
759
- padding: 0,
760
- color: e.modalCloseIconColor,
761
- fontWeight: e.fontWeightStrong,
762
- lineHeight: 1,
763
- textDecoration: "none",
764
- background: "transparent",
765
- borderRadius: e.borderRadiusSM,
766
- width: e.modalCloseBtnSize,
767
- height: e.modalCloseBtnSize,
768
- border: 0,
769
- outline: 0,
770
- cursor: "pointer",
771
- transition: `color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,
772
- "&-x": {
773
- display: "flex",
774
- fontSize: e.fontSizeLG,
775
- fontStyle: "normal",
776
- lineHeight: N(e.modalCloseBtnSize),
777
- justifyContent: "center",
778
- textTransform: "none",
779
- textRendering: "auto"
780
- },
781
- "&:disabled": {
782
- pointerEvents: "none"
783
- },
784
- "&:hover": {
785
- color: e.modalCloseIconHoverColor,
786
- backgroundColor: e.colorBgTextHover,
787
- textDecoration: "none"
788
- },
789
- "&:active": {
790
- backgroundColor: e.colorBgTextActive
791
- }
792
- }, Dn(e)),
793
- [`${n}-header`]: {
794
- color: e.colorText,
795
- background: e.headerBg,
796
- borderRadius: `${N(e.borderRadiusLG)} ${N(e.borderRadiusLG)} 0 0`,
797
- marginBottom: e.headerMarginBottom,
798
- padding: e.headerPadding,
799
- borderBottom: e.headerBorderBottom
800
- },
801
- [`${n}-body`]: {
802
- fontSize: e.fontSize,
803
- lineHeight: e.lineHeight,
804
- wordWrap: "break-word",
805
- padding: e.bodyPadding,
806
- [`${n}-body-skeleton`]: {
807
- width: "100%",
808
- height: "100%",
809
- display: "flex",
810
- justifyContent: "center",
811
- alignItems: "center",
812
- margin: `${N(e.margin)} auto`
813
- }
814
- },
815
- [`${n}-footer`]: {
816
- textAlign: "end",
817
- background: e.footerBg,
818
- marginTop: e.footerMarginTop,
819
- padding: e.footerPadding,
820
- borderTop: e.footerBorderTop,
821
- borderRadius: e.footerBorderRadius,
822
- [`> ${e.antCls}-btn + ${e.antCls}-btn`]: {
823
- marginInlineStart: e.marginXS
824
- }
825
- },
826
- [`${n}-open`]: {
827
- overflow: "hidden"
828
- }
829
- })
830
- },
831
- // ======================== Pure =========================
832
- {
833
- [`${n}-pure-panel`]: {
834
- top: "auto",
835
- padding: 0,
836
- display: "flex",
837
- flexDirection: "column",
838
- [`${n}-content,
839
- ${n}-body,
840
- ${n}-confirm-body-wrapper`]: {
841
- display: "flex",
842
- flexDirection: "column",
843
- flex: "auto"
844
- },
845
- [`${n}-confirm-body`]: {
846
- marginBottom: "auto"
847
- }
848
- }
849
- }
850
- ];
851
- }, wt = (e) => {
852
- const {
853
- componentCls: n
854
- } = e;
855
- return {
856
- [`${n}-root`]: {
857
- [`${n}-wrap-rtl`]: {
858
- direction: "rtl",
859
- [`${n}-confirm-body`]: {
860
- direction: "rtl"
861
- }
862
- }
863
- }
864
- };
865
- }, an = (e) => {
866
- const n = e.padding, t = e.fontSizeHeading5, o = e.lineHeightHeading5;
867
- return jn(e, {
868
- modalHeaderHeight: e.calc(e.calc(o).mul(t).equal()).add(e.calc(n).mul(2).equal()).equal(),
869
- modalFooterBorderColorSplit: e.colorSplit,
870
- modalFooterBorderStyle: e.lineType,
871
- modalFooterBorderWidth: e.lineWidth,
872
- modalCloseIconColor: e.colorIcon,
873
- modalCloseIconHoverColor: e.colorIconHover,
874
- modalCloseBtnSize: e.controlHeight,
875
- modalConfirmIconSize: e.fontHeight,
876
- modalTitleHeight: e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()
877
- });
878
- }, rn = (e) => ({
879
- footerBg: "transparent",
880
- headerBg: e.colorBgElevated,
881
- titleLineHeight: e.lineHeightHeading5,
882
- titleFontSize: e.fontSizeHeading5,
883
- contentBg: e.colorBgElevated,
884
- titleColor: e.colorTextHeading,
885
- // internal
886
- contentPadding: e.wireframe ? 0 : `${N(e.paddingMD)} ${N(e.paddingContentHorizontalLG)}`,
887
- headerPadding: e.wireframe ? `${N(e.padding)} ${N(e.paddingLG)}` : 0,
888
- headerBorderBottom: e.wireframe ? `${N(e.lineWidth)} ${e.lineType} ${e.colorSplit}` : "none",
889
- headerMarginBottom: e.wireframe ? 0 : e.marginXS,
890
- bodyPadding: e.wireframe ? e.paddingLG : 0,
891
- footerPadding: e.wireframe ? `${N(e.paddingXS)} ${N(e.padding)}` : 0,
892
- footerBorderTop: e.wireframe ? `${N(e.lineWidth)} ${e.lineType} ${e.colorSplit}` : "none",
893
- footerBorderRadius: e.wireframe ? `0 0 ${N(e.borderRadiusLG)} ${N(e.borderRadiusLG)}` : 0,
894
- footerMarginTop: e.wireframe ? 0 : e.marginSM,
895
- confirmBodyPadding: e.wireframe ? `${N(e.padding * 2)} ${N(e.padding * 2)} ${N(e.paddingLG)}` : 0,
896
- confirmIconMarginInlineEnd: e.wireframe ? e.margin : e.marginSM,
897
- confirmBtnsMarginTop: e.wireframe ? e.marginLG : e.marginSM
898
- }), ln = Rn("Modal", (e) => {
899
- const n = an(e);
900
- return [Nt(n), wt(n), $t(n), Vn(n, "zoom")];
901
- }, rn, {
902
- unitless: {
903
- titleLineHeight: !0
904
- }
905
- });
906
- var Pt = function(e, n) {
907
- var t = {};
908
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
909
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
910
- n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
911
- return t;
912
- };
913
- let fe;
914
- const It = (e) => {
915
- fe = {
916
- x: e.pageX,
917
- y: e.pageY
918
- }, setTimeout(() => {
919
- fe = null;
920
- }, 100);
921
- };
922
- Et() && document.documentElement.addEventListener("click", It, !0);
923
- const sn = (e) => {
924
- var n;
925
- const {
926
- getPopupContainer: t,
927
- getPrefixCls: o,
928
- direction: a,
929
- modal: l
930
- } = r.useContext(re), c = (L) => {
931
- const {
932
- onCancel: M
933
- } = e;
934
- M == null || M(L);
935
- }, d = (L) => {
936
- const {
937
- onOk: M
938
- } = e;
939
- M == null || M(L);
940
- };
941
- if (process.env.NODE_ENV !== "production") {
942
- const L = ge("Modal");
943
- [["visible", "open"], ["bodyStyle", "styles.body"], ["maskStyle", "styles.mask"]].forEach((M) => {
944
- let [ne, le] = M;
945
- L.deprecated(!(ne in e), ne, le);
946
- });
947
- }
948
- const {
949
- prefixCls: s,
950
- className: u,
951
- rootClassName: i,
952
- open: f,
953
- wrapClassName: C,
954
- centered: b,
955
- getContainer: h,
956
- focusTriggerAfterClose: m = !0,
957
- style: y,
958
- // Deprecated
959
- visible: p,
960
- width: g = 520,
961
- footer: x,
962
- classNames: E,
963
- styles: w,
964
- children: O,
965
- loading: S
966
- } = e, R = Pt(e, ["prefixCls", "className", "rootClassName", "open", "wrapClassName", "centered", "getContainer", "focusTriggerAfterClose", "style", "visible", "width", "footer", "classNames", "styles", "children", "loading"]), T = o("modal", s), A = o(), F = We(T), [V, H, j] = ln(T, F), B = I(C, {
967
- [`${T}-centered`]: !!b,
968
- [`${T}-wrap-rtl`]: a === "rtl"
969
- }), W = x !== null && !S ? /* @__PURE__ */ r.createElement(on, Object.assign({}, e, {
970
- onOk: d,
971
- onCancel: c
972
- })) : null, [G, q, Z] = xt(Re(e), Re(l), {
973
- closable: !0,
974
- closeIcon: /* @__PURE__ */ r.createElement(ve, {
975
- className: `${T}-close-icon`
976
- }),
977
- closeIconRender: (L) => tn(T, L)
978
- }), X = Ot(`.${T}-content`), [k, z] = Wn("Modal", R.zIndex);
979
- return V(/* @__PURE__ */ r.createElement(Gn, {
980
- form: !0,
981
- space: !0
982
- }, /* @__PURE__ */ r.createElement(qn.Provider, {
983
- value: z
984
- }, /* @__PURE__ */ r.createElement(nn, Object.assign({
985
- width: g
986
- }, R, {
987
- zIndex: k,
988
- getContainer: h === void 0 ? t : h,
989
- prefixCls: T,
990
- rootClassName: I(H, i, j, F),
991
- footer: W,
992
- visible: f ?? p,
993
- mousePosition: (n = R.mousePosition) !== null && n !== void 0 ? n : fe,
994
- onClose: c,
995
- closable: G && {
996
- disabled: Z,
997
- closeIcon: q
998
- },
999
- closeIcon: q,
1000
- focusTriggerAfterClose: m,
1001
- transitionName: oe(A, "zoom", e.transitionName),
1002
- maskTransitionName: oe(A, "fade", e.maskTransitionName),
1003
- className: I(H, u, l == null ? void 0 : l.className),
1004
- style: Object.assign(Object.assign({}, l == null ? void 0 : l.style), y),
1005
- classNames: Object.assign(Object.assign(Object.assign({}, l == null ? void 0 : l.classNames), E), {
1006
- wrapper: I(B, E == null ? void 0 : E.wrapper)
1007
- }),
1008
- styles: Object.assign(Object.assign({}, l == null ? void 0 : l.styles), w),
1009
- panelRef: X
1010
- }), S ? /* @__PURE__ */ r.createElement(Qn, {
1011
- active: !0,
1012
- title: !1,
1013
- paragraph: {
1014
- rows: 4
1015
- },
1016
- className: `${T}-body-skeleton`
1017
- }) : O))));
1018
- }, Tt = (e) => {
1019
- const {
1020
- componentCls: n,
1021
- titleFontSize: t,
1022
- titleLineHeight: o,
1023
- modalConfirmIconSize: a,
1024
- fontSize: l,
1025
- lineHeight: c,
1026
- modalTitleHeight: d,
1027
- fontHeight: s,
1028
- confirmBodyPadding: u
1029
- } = e, i = `${n}-confirm`;
1030
- return {
1031
- [i]: {
1032
- "&-rtl": {
1033
- direction: "rtl"
1034
- },
1035
- [`${e.antCls}-modal-header`]: {
1036
- display: "none"
1037
- },
1038
- [`${i}-body-wrapper`]: Object.assign({}, zn()),
1039
- [`&${n} ${n}-body`]: {
1040
- padding: u
1041
- },
1042
- // ====================== Body ======================
1043
- [`${i}-body`]: {
1044
- display: "flex",
1045
- flexWrap: "nowrap",
1046
- alignItems: "start",
1047
- [`> ${e.iconCls}`]: {
1048
- flex: "none",
1049
- fontSize: a,
1050
- marginInlineEnd: e.confirmIconMarginInlineEnd,
1051
- marginTop: e.calc(e.calc(s).sub(a).equal()).div(2).equal()
1052
- },
1053
- [`&-has-title > ${e.iconCls}`]: {
1054
- marginTop: e.calc(e.calc(d).sub(a).equal()).div(2).equal()
1055
- }
1056
- },
1057
- [`${i}-paragraph`]: {
1058
- display: "flex",
1059
- flexDirection: "column",
1060
- flex: "auto",
1061
- rowGap: e.marginXS
1062
- },
1063
- // https://github.com/ant-design/ant-design/issues/48159
1064
- [`${e.iconCls} + ${i}-paragraph`]: {
1065
- maxWidth: `calc(100% - ${N(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal())})`
1066
- },
1067
- [`${i}-title`]: {
1068
- color: e.colorTextHeading,
1069
- fontWeight: e.fontWeightStrong,
1070
- fontSize: t,
1071
- lineHeight: o
1072
- },
1073
- [`${i}-content`]: {
1074
- color: e.colorText,
1075
- fontSize: l,
1076
- lineHeight: c
1077
- },
1078
- // ===================== Footer =====================
1079
- [`${i}-btns`]: {
1080
- textAlign: "end",
1081
- marginTop: e.confirmBtnsMarginTop,
1082
- [`${e.antCls}-btn + ${e.antCls}-btn`]: {
1083
- marginBottom: 0,
1084
- marginInlineStart: e.marginXS
1085
- }
1086
- }
1087
- },
1088
- [`${i}-error ${i}-body > ${e.iconCls}`]: {
1089
- color: e.colorError
1090
- },
1091
- [`${i}-warning ${i}-body > ${e.iconCls},
1092
- ${i}-confirm ${i}-body > ${e.iconCls}`]: {
1093
- color: e.colorWarning
1094
- },
1095
- [`${i}-info ${i}-body > ${e.iconCls}`]: {
1096
- color: e.colorInfo
1097
- },
1098
- [`${i}-success ${i}-body > ${e.iconCls}`]: {
1099
- color: e.colorSuccess
1100
- }
1101
- };
1102
- }, Mt = Fn(["Modal", "confirm"], (e) => {
1103
- const n = an(e);
1104
- return [Tt(n)];
1105
- }, rn, {
1106
- // confirm is weak than modal since no conflict here
1107
- order: -1e3
1108
- });
1109
- var Rt = function(e, n) {
1110
- var t = {};
1111
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
1112
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1113
- n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
1114
- return t;
1115
- };
1116
- function cn(e) {
1117
- const {
1118
- prefixCls: n,
1119
- icon: t,
1120
- okText: o,
1121
- cancelText: a,
1122
- confirmPrefixCls: l,
1123
- type: c,
1124
- okCancel: d,
1125
- footer: s,
1126
- // Legacy for static function usage
1127
- locale: u
1128
- } = e, i = Rt(e, ["prefixCls", "icon", "okText", "cancelText", "confirmPrefixCls", "type", "okCancel", "footer", "locale"]);
1129
- if (process.env.NODE_ENV !== "production") {
1130
- const S = ge("Modal");
1131
- process.env.NODE_ENV !== "production" && S(!(typeof t == "string" && t.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${t}\` at https://ant.design/components/icon`);
1132
- }
1133
- let f = t;
1134
- if (!t && t !== null)
1135
- switch (c) {
1136
- case "info":
1137
- f = /* @__PURE__ */ r.createElement(Qe, null);
1138
- break;
1139
- case "success":
1140
- f = /* @__PURE__ */ r.createElement(Ke, null);
1141
- break;
1142
- case "error":
1143
- f = /* @__PURE__ */ r.createElement(Xe, null);
1144
- break;
1145
- default:
1146
- f = /* @__PURE__ */ r.createElement(ke, null);
1147
- }
1148
- const C = d ?? c === "confirm", b = e.autoFocusButton === null ? !1 : e.autoFocusButton || "ok", [h] = pe("Modal"), m = u || h, y = o || (C ? m == null ? void 0 : m.okText : m == null ? void 0 : m.justOkText), p = a || (m == null ? void 0 : m.cancelText), g = Object.assign({
1149
- autoFocusButton: b,
1150
- cancelTextLocale: p,
1151
- okTextLocale: y,
1152
- mergedOkCancel: C
1153
- }, i), x = r.useMemo(() => g, K(Object.values(g))), E = /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Pe, null), /* @__PURE__ */ r.createElement(Ie, null)), w = e.title !== void 0 && e.title !== null, O = `${l}-body`;
1154
- return /* @__PURE__ */ r.createElement("div", {
1155
- className: `${l}-body-wrapper`
1156
- }, /* @__PURE__ */ r.createElement("div", {
1157
- className: I(O, {
1158
- [`${O}-has-title`]: w
1159
- })
1160
- }, f, /* @__PURE__ */ r.createElement("div", {
1161
- className: `${l}-paragraph`
1162
- }, w && /* @__PURE__ */ r.createElement("span", {
1163
- className: `${l}-title`
1164
- }, e.title), /* @__PURE__ */ r.createElement("div", {
1165
- className: `${l}-content`
1166
- }, e.content))), s === void 0 || typeof s == "function" ? /* @__PURE__ */ r.createElement(Ye, {
1167
- value: x
1168
- }, /* @__PURE__ */ r.createElement("div", {
1169
- className: `${l}-btns`
1170
- }, typeof s == "function" ? s(E, {
1171
- OkBtn: Ie,
1172
- CancelBtn: Pe
1173
- }) : E)) : s, /* @__PURE__ */ r.createElement(Mt, {
1174
- prefixCls: n
1175
- }));
1176
- }
1177
- const dn = (e) => {
1178
- const {
1179
- close: n,
1180
- zIndex: t,
1181
- afterClose: o,
1182
- open: a,
1183
- keyboard: l,
1184
- centered: c,
1185
- getContainer: d,
1186
- maskStyle: s,
1187
- direction: u,
1188
- prefixCls: i,
1189
- wrapClassName: f,
1190
- rootPrefixCls: C,
1191
- bodyStyle: b,
1192
- closable: h = !1,
1193
- closeIcon: m,
1194
- modalRender: y,
1195
- focusTriggerAfterClose: p,
1196
- onConfirm: g,
1197
- styles: x
1198
- } = e;
1199
- if (process.env.NODE_ENV !== "production") {
1200
- const V = ge("Modal");
1201
- [["visible", "open"], ["bodyStyle", "styles.body"], ["maskStyle", "styles.mask"]].forEach((H) => {
1202
- let [j, B] = H;
1203
- V.deprecated(!(j in e), j, B);
1204
- });
1205
- }
1206
- const E = `${i}-confirm`, w = e.width || 416, O = e.style || {}, S = e.mask === void 0 ? !0 : e.mask, R = e.maskClosable === void 0 ? !1 : e.maskClosable, T = I(E, `${E}-${e.type}`, {
1207
- [`${E}-rtl`]: u === "rtl"
1208
- }, e.className), [, A] = Ln(), F = r.useMemo(() => t !== void 0 ? t : A.zIndexPopupBase + Un, [t, A]);
1209
- return /* @__PURE__ */ r.createElement(sn, {
1210
- prefixCls: i,
1211
- className: T,
1212
- wrapClassName: I({
1213
- [`${E}-centered`]: !!e.centered
1214
- }, f),
1215
- onCancel: () => {
1216
- n == null || n({
1217
- triggerCancel: !0
1218
- }), g == null || g(!1);
1219
- },
1220
- open: a,
1221
- title: "",
1222
- footer: null,
1223
- transitionName: oe(C || "", "zoom", e.transitionName),
1224
- maskTransitionName: oe(C || "", "fade", e.maskTransitionName),
1225
- mask: S,
1226
- maskClosable: R,
1227
- style: O,
1228
- styles: Object.assign({
1229
- body: b,
1230
- mask: s
1231
- }, x),
1232
- width: w,
1233
- zIndex: F,
1234
- afterClose: o,
1235
- keyboard: l,
1236
- centered: c,
1237
- getContainer: d,
1238
- closable: h,
1239
- closeIcon: m,
1240
- modalRender: y,
1241
- focusTriggerAfterClose: p
1242
- }, /* @__PURE__ */ r.createElement(cn, Object.assign({}, e, {
1243
- confirmPrefixCls: E
1244
- })));
1245
- }, he = (e) => {
1246
- const {
1247
- rootPrefixCls: n,
1248
- iconPrefixCls: t,
1249
- direction: o,
1250
- theme: a
1251
- } = e;
1252
- return /* @__PURE__ */ r.createElement(Ge, {
1253
- prefixCls: n,
1254
- iconPrefixCls: t,
1255
- direction: o,
1256
- theme: a
1257
- }, /* @__PURE__ */ r.createElement(dn, Object.assign({}, e)));
1258
- };
1259
- process.env.NODE_ENV !== "production" && (dn.displayName = "ConfirmDialog", he.displayName = "ConfirmDialogWrapper");
1260
- const Q = [];
1261
- let un = "";
1262
- function fn() {
1263
- return un;
1264
- }
1265
- const jt = (e) => {
1266
- var n, t;
1267
- const {
1268
- prefixCls: o,
1269
- getContainer: a,
1270
- direction: l
1271
- } = e, c = Ve(), d = Y(re), s = fn() || d.getPrefixCls(), u = o || `${s}-modal`;
1272
- let i = a;
1273
- return i === !1 && (i = void 0, process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && qe(!1, "Modal", "Static method not support `getContainer` to be `false` since it do not have context env.")), /* @__PURE__ */ v.createElement(he, Object.assign({}, e, {
1274
- rootPrefixCls: s,
1275
- prefixCls: u,
1276
- iconPrefixCls: d.iconPrefixCls,
1277
- theme: d.theme,
1278
- direction: l ?? d.direction,
1279
- locale: (t = (n = d.locale) === null || n === void 0 ? void 0 : n.Modal) !== null && t !== void 0 ? t : c,
1280
- getContainer: i
1281
- }));
1282
- };
1283
- function ee(e) {
1284
- const n = _n();
1285
- process.env.NODE_ENV !== "production" && !n.holderRender && Hn("Modal");
1286
- const t = document.createDocumentFragment();
1287
- let o = Object.assign(Object.assign({}, e), {
1288
- close: d,
1289
- open: !0
1290
- }), a;
1291
- function l() {
1292
- for (var u, i = arguments.length, f = new Array(i), C = 0; C < i; C++)
1293
- f[C] = arguments[C];
1294
- if (f.some((m) => m == null ? void 0 : m.triggerCancel)) {
1295
- var h;
1296
- (u = e.onCancel) === null || u === void 0 || (h = u).call.apply(h, [e, () => {
1297
- }].concat(K(f.slice(1))));
1298
- }
1299
- for (let m = 0; m < Q.length; m++)
1300
- if (Q[m] === d) {
1301
- Q.splice(m, 1);
1302
- break;
1303
- }
1304
- Kn(t);
1305
- }
1306
- function c(u) {
1307
- clearTimeout(a), a = setTimeout(() => {
1308
- const i = n.getPrefixCls(void 0, fn()), f = n.getIconPrefixCls(), C = n.getTheme(), b = /* @__PURE__ */ v.createElement(jt, Object.assign({}, u));
1309
- Xn(/* @__PURE__ */ v.createElement(Ge, {
1310
- prefixCls: i,
1311
- iconPrefixCls: f,
1312
- theme: C
1313
- }, n.holderRender ? n.holderRender(b) : b), t);
1314
- });
1315
- }
1316
- function d() {
1317
- for (var u = arguments.length, i = new Array(u), f = 0; f < u; f++)
1318
- i[f] = arguments[f];
1319
- o = Object.assign(Object.assign({}, o), {
1320
- open: !1,
1321
- afterClose: () => {
1322
- typeof e.afterClose == "function" && e.afterClose(), l.apply(this, i);
1323
- }
1324
- }), o.visible && delete o.visible, c(o);
1325
- }
1326
- function s(u) {
1327
- typeof u == "function" ? o = u(o) : o = Object.assign(Object.assign({}, o), u), c(o);
1328
- }
1329
- return c(o), Q.push(d), {
1330
- destroy: d,
1331
- update: s
1332
- };
1333
- }
1334
- function mn(e) {
1335
- return Object.assign(Object.assign({}, e), {
1336
- type: "warning"
1337
- });
1338
- }
1339
- function gn(e) {
1340
- return Object.assign(Object.assign({}, e), {
1341
- type: "info"
1342
- });
1343
- }
1344
- function Cn(e) {
1345
- return Object.assign(Object.assign({}, e), {
1346
- type: "success"
1347
- });
1348
- }
1349
- function vn(e) {
1350
- return Object.assign(Object.assign({}, e), {
1351
- type: "error"
1352
- });
1353
- }
1354
- function pn(e) {
1355
- return Object.assign(Object.assign({}, e), {
1356
- type: "confirm"
1357
- });
1358
- }
1359
- function Bt(e) {
1360
- let {
1361
- rootPrefixCls: n
1362
- } = e;
1363
- process.env.NODE_ENV !== "production" && qe(!1, "Modal", "Modal.config is deprecated. Please use ConfigProvider.config instead."), un = n;
1364
- }
1365
- var Dt = function(e, n) {
1366
- var t = {};
1367
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
1368
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1369
- n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
1370
- return t;
1371
- };
1372
- const Ft = (e, n) => {
1373
- var t, {
1374
- afterClose: o,
1375
- config: a
1376
- } = e, l = Dt(e, ["afterClose", "config"]);
1377
- const [c, d] = r.useState(!0), [s, u] = r.useState(a), {
1378
- direction: i,
1379
- getPrefixCls: f
1380
- } = r.useContext(re), C = f("modal"), b = f(), h = () => {
1381
- var g;
1382
- o(), (g = s.afterClose) === null || g === void 0 || g.call(s);
1383
- }, m = function() {
1384
- var g;
1385
- d(!1);
1386
- for (var x = arguments.length, E = new Array(x), w = 0; w < x; w++)
1387
- E[w] = arguments[w];
1388
- if (E.some((R) => R == null ? void 0 : R.triggerCancel)) {
1389
- var S;
1390
- (g = s.onCancel) === null || g === void 0 || (S = g).call.apply(S, [s, () => {
1391
- }].concat(K(E.slice(1))));
1392
- }
1393
- };
1394
- r.useImperativeHandle(n, () => ({
1395
- destroy: m,
1396
- update: (g) => {
1397
- u((x) => Object.assign(Object.assign({}, x), g));
1398
- }
1399
- }));
1400
- const y = (t = s.okCancel) !== null && t !== void 0 ? t : s.type === "confirm", [p] = pe("Modal", ue.Modal);
1401
- return /* @__PURE__ */ r.createElement(he, Object.assign({
1402
- prefixCls: C,
1403
- rootPrefixCls: b
1404
- }, s, {
1405
- close: m,
1406
- open: c,
1407
- afterClose: h,
1408
- okText: s.okText || (y ? p == null ? void 0 : p.okText : p == null ? void 0 : p.justOkText),
1409
- direction: s.direction || i,
1410
- cancelText: s.cancelText || (p == null ? void 0 : p.cancelText)
1411
- }, l));
1412
- }, zt = /* @__PURE__ */ r.forwardRef(Ft);
1413
- let _e = 0;
1414
- const Lt = /* @__PURE__ */ r.memo(/* @__PURE__ */ r.forwardRef((e, n) => {
1415
- const [t, o] = dt();
1416
- return r.useImperativeHandle(n, () => ({
1417
- patchElement: o
1418
- }), []), /* @__PURE__ */ r.createElement(r.Fragment, null, t);
1419
- }));
1420
- function _t() {
1421
- const e = r.useRef(null), [n, t] = r.useState([]);
1422
- r.useEffect(() => {
1423
- n.length && (K(n).forEach((c) => {
1424
- c();
1425
- }), t([]));
1426
- }, [n]);
1427
- const o = r.useCallback((l) => function(d) {
1428
- var s;
1429
- _e += 1;
1430
- const u = /* @__PURE__ */ r.createRef();
1431
- let i;
1432
- const f = new Promise((y) => {
1433
- i = y;
1434
- });
1435
- let C = !1, b;
1436
- const h = /* @__PURE__ */ r.createElement(zt, {
1437
- key: `modal-${_e}`,
1438
- config: l(d),
1439
- ref: u,
1440
- afterClose: () => {
1441
- b == null || b();
1442
- },
1443
- isSilent: () => C,
1444
- onConfirm: (y) => {
1445
- i(y);
1446
- }
1447
- });
1448
- return b = (s = e.current) === null || s === void 0 ? void 0 : s.patchElement(h), b && Q.push(b), {
1449
- destroy: () => {
1450
- function y() {
1451
- var p;
1452
- (p = u.current) === null || p === void 0 || p.destroy();
1453
- }
1454
- u.current ? y() : t((p) => [].concat(K(p), [y]));
1455
- },
1456
- update: (y) => {
1457
- function p() {
1458
- var g;
1459
- (g = u.current) === null || g === void 0 || g.update(y);
1460
- }
1461
- u.current ? p() : t((g) => [].concat(K(g), [p]));
1462
- },
1463
- then: (y) => (C = !0, f.then(y))
1464
- };
1465
- }, []);
1466
- return [r.useMemo(() => ({
1467
- info: o(gn),
1468
- success: o(Cn),
1469
- error: o(vn),
1470
- warning: o(mn),
1471
- confirm: o(pn)
1472
- }), []), /* @__PURE__ */ r.createElement(Lt, {
1473
- key: "modal-holder",
1474
- ref: e
1475
- })];
1476
- }
1477
- var Ht = function(e, n) {
1478
- var t = {};
1479
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
1480
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1481
- n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
1482
- return t;
1483
- };
1484
- const At = (e) => {
1485
- const {
1486
- prefixCls: n,
1487
- className: t,
1488
- closeIcon: o,
1489
- closable: a,
1490
- type: l,
1491
- title: c,
1492
- children: d,
1493
- footer: s
1494
- } = e, u = Ht(e, ["prefixCls", "className", "closeIcon", "closable", "type", "title", "children", "footer"]), {
1495
- getPrefixCls: i
1496
- } = r.useContext(re), f = i(), C = n || i("modal"), b = We(f), [h, m, y] = ln(C, b), p = `${C}-confirm`;
1497
- let g = {};
1498
- return l ? g = {
1499
- closable: a ?? !1,
1500
- title: "",
1501
- footer: "",
1502
- children: /* @__PURE__ */ r.createElement(cn, Object.assign({}, e, {
1503
- prefixCls: C,
1504
- confirmPrefixCls: p,
1505
- rootPrefixCls: f,
1506
- content: d
1507
- }))
1508
- } : g = {
1509
- closable: a ?? !0,
1510
- title: c,
1511
- footer: s !== null && /* @__PURE__ */ r.createElement(on, Object.assign({}, e)),
1512
- children: d
1513
- }, h(/* @__PURE__ */ r.createElement(ye, Object.assign({
1514
- prefixCls: C,
1515
- className: I(m, `${C}-pure-panel`, l && p, l && `${p}-${l}`, t, y, b)
1516
- }, u, {
1517
- closeIcon: tn(C, o),
1518
- closable: a
1519
- }, g)));
1520
- }, Vt = kn(At);
1521
- function bn(e) {
1522
- return ee(mn(e));
1523
- }
1524
- const _ = sn;
1525
- _.useModal = _t;
1526
- _.info = function(n) {
1527
- return ee(gn(n));
1528
- };
1529
- _.success = function(n) {
1530
- return ee(Cn(n));
1531
- };
1532
- _.error = function(n) {
1533
- return ee(vn(n));
1534
- };
1535
- _.warning = bn;
1536
- _.warn = bn;
1537
- _.confirm = function(n) {
1538
- return ee(pn(n));
1539
- };
1540
- _.destroyAll = function() {
1541
- for (; Q.length; ) {
1542
- const n = Q.pop();
1543
- n && n();
1544
- }
1545
- };
1546
- _.config = Bt;
1547
- _._InternalPanelDoNotUseOrYouWillBeFired = Vt;
1548
- process.env.NODE_ENV !== "production" && (_.displayName = "Modal");
1549
- export {
1550
- _ as M
1551
- };