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