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