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