@devtron-labs/devtron-fe-common-lib 0.0.51-beta-4 → 0.0.52-beta-1
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/{CodeEditor-a1233daa.js → CodeEditor-68cd2e5b.js} +21 -21
- package/dist/Common/Api.js +13 -13
- package/dist/Common/BreadCrumb/BreadCrumb.js +1 -1
- package/dist/Common/ChartVersionAndTypeSelector.d.ts +3 -0
- package/dist/Common/ChartVersionAndTypeSelector.js +61 -0
- package/dist/Common/ClipboardButton/ClipboardButton.js +1 -1
- package/dist/Common/CodeEditor/CodeEditor.js +2 -2
- package/dist/Common/Common.service.d.ts +1 -0
- package/dist/Common/Common.service.js +32 -28
- package/dist/Common/Constants.d.ts +3 -1
- package/dist/Common/Constants.js +9 -6
- package/dist/Common/CustomTagSelector/PropagateTagInfo.js +1 -1
- package/dist/Common/CustomTagSelector/ResizableTagTextArea.js +1 -1
- package/dist/Common/CustomTagSelector/TagDetails.js +1 -1
- package/dist/Common/CustomTagSelector/TagLabelValueSelector.js +1 -1
- package/dist/Common/DeleteComponentModal/DeleteComponent.js +1 -1
- package/dist/Common/DraggableWrapper/DraggableButton.d.ts +3 -0
- package/dist/Common/DraggableWrapper/DraggableButton.js +16 -0
- package/dist/Common/DraggableWrapper/DraggableWrapper.d.ts +9 -0
- package/dist/Common/DraggableWrapper/DraggableWrapper.js +1499 -0
- package/dist/Common/DraggableWrapper/index.d.ts +3 -0
- package/dist/Common/DraggableWrapper/index.js +8 -0
- package/dist/Common/DraggableWrapper/types.d.ts +23 -0
- package/dist/Common/DraggableWrapper/types.js +4 -0
- package/dist/Common/Grid/Grid.d.ts +1 -1
- package/dist/Common/Grid/Grid.js +19 -10
- package/dist/Common/Grid/types.d.ts +2 -2
- package/dist/Common/Helper.d.ts +9 -0
- package/dist/Common/Helper.js +24 -20
- package/dist/Common/Hooks/UseSuperAdmin/UseSuperAdmin.js +1 -1
- package/dist/Common/Hooks/UseWindowSize/UseWindowSize.d.ts +4 -0
- package/dist/Common/Hooks/UseWindowSize/UseWindowSize.js +17 -0
- package/dist/Common/Hooks/index.d.ts +1 -0
- package/dist/Common/Hooks/index.js +6 -4
- package/dist/Common/ImageTags.js +3 -3
- package/dist/Common/MultiSelectCustomization.js +1 -1
- package/dist/Common/RJSF/widgets/Select.js +1 -1
- package/dist/Common/RadioGroup/RadioGroup.js +1 -1
- package/dist/Common/ResizableTextarea.js +1 -1
- package/dist/Common/Select/Select.js +1 -1
- package/dist/Common/TippyCustomized.js +2 -2
- package/dist/Common/ToastBody.js +1 -1
- package/dist/Common/Toggle/Toggle.js +1 -1
- package/dist/Common/Types.d.ts +64 -0
- package/dist/Common/index.d.ts +2 -0
- package/dist/Common/index.js +206 -190
- package/dist/Helper-1f1cf2ba.js +9824 -0
- package/dist/{TippyCustomized-b4379006.js → TippyCustomized-0d0b9a6f.js} +1 -1
- package/dist/{cssMode-a1869154.js → cssMode-7289250b.js} +1 -1
- package/dist/{freemarker2-51e1c403.js → freemarker2-3b903d5b.js} +1 -1
- package/dist/{handlebars-91940b5d.js → handlebars-702717e9.js} +1 -1
- package/dist/{html-f466e610.js → html-9a684e15.js} +1 -1
- package/dist/{htmlMode-1f121ca6.js → htmlMode-3e336aa8.js} +1 -1
- package/dist/index-c855d89c.js +173 -0
- package/dist/index.js +206 -190
- package/dist/{javascript-c8bf1ba9.js → javascript-101cb9b7.js} +1 -1
- package/dist/{jsonMode-d03e0315.js → jsonMode-006d8be9.js} +1 -1
- package/dist/{liquid-8f190965.js → liquid-729ea99d.js} +1 -1
- package/dist/{python-89c90f80.js → python-c9b92f72.js} +1 -1
- package/dist/{razor-3889a56a.js → razor-c48ef378.js} +1 -1
- package/dist/{react-select.esm-a99b516e.js → react-select.esm-fa95915b.js} +1111 -1279
- package/dist/{react-toastify.esm-f2ac8a63.js → react-toastify.esm-e28f7200.js} +162 -156
- package/dist/{tsMode-a6b9a239.js → tsMode-da78a323.js} +1 -1
- package/dist/{typescript-f36342d1.js → typescript-bd6d35ce.js} +1 -1
- package/dist/{xml-20660057.js → xml-828eca7a.js} +1 -1
- package/dist/{yaml-b321e220.js → yaml-89980d67.js} +1 -1
- package/package.json +5 -2
- package/dist/Helper-e95e2932.js +0 -8839
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ge, { createElement as p, useRef as F, useLayoutEffect as
|
|
2
|
-
import { r as
|
|
1
|
+
import ge, { createElement as p, useRef as F, useLayoutEffect as _e, useEffect as U, useReducer as xe, useState as ie, isValidElement as G, cloneElement as ue } from "react";
|
|
2
|
+
import { r as De } from "./index-5a231705.js";
|
|
3
3
|
function he(e) {
|
|
4
4
|
var t, n, a = "";
|
|
5
5
|
if (typeof e == "string" || typeof e == "number")
|
|
@@ -13,20 +13,25 @@ function he(e) {
|
|
|
13
13
|
e[t] && (a && (a += " "), a += t);
|
|
14
14
|
return a;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function M() {
|
|
17
17
|
for (var e, t, n = 0, a = ""; n < arguments.length; )
|
|
18
18
|
(e = arguments[n++]) && (t = he(e)) && (a && (a += " "), a += t);
|
|
19
19
|
return a;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const Ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
22
|
+
__proto__: null,
|
|
23
|
+
clsx: M,
|
|
24
|
+
default: M
|
|
25
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
26
|
+
function D() {
|
|
27
|
+
return D = Object.assign || function(e) {
|
|
23
28
|
for (var t = 1; t < arguments.length; t++) {
|
|
24
29
|
var n = arguments[t];
|
|
25
30
|
for (var a in n)
|
|
26
31
|
Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
|
|
27
32
|
}
|
|
28
33
|
return e;
|
|
29
|
-
},
|
|
34
|
+
}, D.apply(this, arguments);
|
|
30
35
|
}
|
|
31
36
|
function pe(e, t) {
|
|
32
37
|
if (e == null)
|
|
@@ -54,28 +59,28 @@ function J(e) {
|
|
|
54
59
|
function re(e) {
|
|
55
60
|
return e === 0 || e;
|
|
56
61
|
}
|
|
57
|
-
function
|
|
62
|
+
function Be(e, t) {
|
|
58
63
|
return e === !1 || Z(e) && e > 0 ? e : t;
|
|
59
64
|
}
|
|
60
|
-
var
|
|
65
|
+
var be = !!(typeof window < "u" && window.document && window.document.createElement);
|
|
61
66
|
function se(e) {
|
|
62
67
|
return G(e) || Q(e) || R(e) || Z(e);
|
|
63
68
|
}
|
|
64
|
-
var
|
|
69
|
+
var Ce = {
|
|
65
70
|
TOP_LEFT: "top-left",
|
|
66
71
|
TOP_RIGHT: "top-right",
|
|
67
72
|
TOP_CENTER: "top-center",
|
|
68
73
|
BOTTOM_LEFT: "bottom-left",
|
|
69
74
|
BOTTOM_RIGHT: "bottom-right",
|
|
70
75
|
BOTTOM_CENTER: "bottom-center"
|
|
71
|
-
},
|
|
76
|
+
}, k = {
|
|
72
77
|
INFO: "info",
|
|
73
78
|
SUCCESS: "success",
|
|
74
79
|
WARNING: "warning",
|
|
75
80
|
ERROR: "error",
|
|
76
81
|
DEFAULT: "default"
|
|
77
82
|
};
|
|
78
|
-
function
|
|
83
|
+
function Se(e, t, n) {
|
|
79
84
|
n === void 0 && (n = 300);
|
|
80
85
|
var a = e.scrollHeight, i = e.style;
|
|
81
86
|
requestAnimationFrame(function() {
|
|
@@ -84,21 +89,21 @@ function we(e, t, n) {
|
|
|
84
89
|
});
|
|
85
90
|
});
|
|
86
91
|
}
|
|
87
|
-
function
|
|
92
|
+
function we(e) {
|
|
88
93
|
var t = e.enter, n = e.exit, a = e.appendPosition, i = a === void 0 ? !1 : a, f = e.collapse, g = f === void 0 ? !0 : f, v = e.collapseDuration, o = v === void 0 ? 300 : v;
|
|
89
94
|
return function(m) {
|
|
90
|
-
var
|
|
95
|
+
var O = m.children, T = m.position, y = m.preventExitTransition, L = m.done, h = m.nodeRef, I = m.isIn, u = i ? t + "--" + T : t, c = i ? n + "--" + T : n, C = F(), E = F(
|
|
91
96
|
0
|
|
92
97
|
/* Enter */
|
|
93
98
|
);
|
|
94
|
-
|
|
99
|
+
_e(function() {
|
|
95
100
|
r();
|
|
96
101
|
}, []), U(function() {
|
|
97
|
-
|
|
98
|
-
}, [
|
|
102
|
+
I || (y ? _() : B());
|
|
103
|
+
}, [I]);
|
|
99
104
|
function r() {
|
|
100
105
|
var s = h.current;
|
|
101
|
-
|
|
106
|
+
C.current = s.className, s.className += " " + u, s.addEventListener("animationend", P), s.addEventListener("animationcancel", P);
|
|
102
107
|
}
|
|
103
108
|
function P(s) {
|
|
104
109
|
if (s.target === h.current) {
|
|
@@ -106,22 +111,22 @@ function Se(e) {
|
|
|
106
111
|
d.dispatchEvent(new Event(
|
|
107
112
|
"d"
|
|
108
113
|
/* ENTRANCE_ANIMATION_END */
|
|
109
|
-
)), d.removeEventListener("animationend", P), d.removeEventListener("animationcancel", P), E.current === 0 && (d.className =
|
|
114
|
+
)), d.removeEventListener("animationend", P), d.removeEventListener("animationcancel", P), E.current === 0 && (d.className = C.current);
|
|
110
115
|
}
|
|
111
116
|
}
|
|
112
|
-
function
|
|
117
|
+
function B() {
|
|
113
118
|
E.current = 1;
|
|
114
119
|
var s = h.current;
|
|
115
|
-
s.className += " " + c, s.addEventListener("animationend",
|
|
120
|
+
s.className += " " + c, s.addEventListener("animationend", _);
|
|
116
121
|
}
|
|
117
|
-
function
|
|
122
|
+
function _() {
|
|
118
123
|
var s = h.current;
|
|
119
|
-
s.removeEventListener("animationend",
|
|
124
|
+
s.removeEventListener("animationend", _), g ? Se(s, L, o) : L();
|
|
120
125
|
}
|
|
121
|
-
return ge.createElement(ge.Fragment, null,
|
|
126
|
+
return ge.createElement(ge.Fragment, null, O);
|
|
122
127
|
};
|
|
123
128
|
}
|
|
124
|
-
var
|
|
129
|
+
var w = {
|
|
125
130
|
list: /* @__PURE__ */ new Map(),
|
|
126
131
|
emitQueue: /* @__PURE__ */ new Map(),
|
|
127
132
|
on: function(t, n) {
|
|
@@ -158,9 +163,9 @@ var S = {
|
|
|
158
163
|
n.emitQueue.has(t) || n.emitQueue.set(t, []), n.emitQueue.get(t).push(v);
|
|
159
164
|
});
|
|
160
165
|
}
|
|
161
|
-
},
|
|
162
|
-
function
|
|
163
|
-
var t =
|
|
166
|
+
}, Me = ["delay", "staleId"];
|
|
167
|
+
function Ae(e) {
|
|
168
|
+
var t = xe(function(u) {
|
|
164
169
|
return u + 1;
|
|
165
170
|
}, 0), n = t[1], a = ie([]), i = a[0], f = a[1], g = F(null), v = F(/* @__PURE__ */ new Map()).current, o = function(c) {
|
|
166
171
|
return i.indexOf(c) !== -1;
|
|
@@ -177,7 +182,7 @@ function Me(e) {
|
|
|
177
182
|
}
|
|
178
183
|
}).current;
|
|
179
184
|
U(function() {
|
|
180
|
-
return l.containerId = e.containerId,
|
|
185
|
+
return l.containerId = e.containerId, w.cancelEmit(
|
|
181
186
|
3
|
|
182
187
|
/* WillUnmount */
|
|
183
188
|
).on(
|
|
@@ -186,7 +191,7 @@ function Me(e) {
|
|
|
186
191
|
).on(
|
|
187
192
|
1,
|
|
188
193
|
function(u) {
|
|
189
|
-
return g.current &&
|
|
194
|
+
return g.current && O(u);
|
|
190
195
|
}
|
|
191
196
|
).on(
|
|
192
197
|
5,
|
|
@@ -195,13 +200,13 @@ function Me(e) {
|
|
|
195
200
|
2,
|
|
196
201
|
l
|
|
197
202
|
), function() {
|
|
198
|
-
return
|
|
203
|
+
return w.emit(
|
|
199
204
|
3,
|
|
200
205
|
l
|
|
201
206
|
);
|
|
202
207
|
};
|
|
203
208
|
}, []), U(function() {
|
|
204
|
-
l.isToastActive = o, l.displayedToast = i.length,
|
|
209
|
+
l.isToastActive = o, l.displayedToast = i.length, w.emit(
|
|
205
210
|
4,
|
|
206
211
|
i.length,
|
|
207
212
|
e.containerId
|
|
@@ -210,33 +215,33 @@ function Me(e) {
|
|
|
210
215
|
l.props = e;
|
|
211
216
|
});
|
|
212
217
|
function m(u) {
|
|
213
|
-
var c = u.containerId,
|
|
214
|
-
|
|
218
|
+
var c = u.containerId, C = l.props.limit;
|
|
219
|
+
C && (!c || l.containerId === c) && (l.count -= l.queue.length, l.queue = []);
|
|
215
220
|
}
|
|
216
|
-
function
|
|
221
|
+
function O(u) {
|
|
217
222
|
f(function(c) {
|
|
218
|
-
return re(u) ? c.filter(function(
|
|
219
|
-
return
|
|
223
|
+
return re(u) ? c.filter(function(C) {
|
|
224
|
+
return C !== u;
|
|
220
225
|
}) : [];
|
|
221
226
|
});
|
|
222
227
|
}
|
|
223
228
|
function T() {
|
|
224
|
-
var u = l.queue.shift(), c = u.toastContent,
|
|
225
|
-
h(c,
|
|
229
|
+
var u = l.queue.shift(), c = u.toastContent, C = u.toastProps, E = u.staleId;
|
|
230
|
+
h(c, C, E);
|
|
226
231
|
}
|
|
227
232
|
function y(u) {
|
|
228
233
|
return !g.current || l.props.enableMultiContainer && u.containerId !== l.props.containerId || v.has(u.toastId) && u.updateId == null;
|
|
229
234
|
}
|
|
230
235
|
function L(u, c) {
|
|
231
|
-
var
|
|
236
|
+
var C = c.delay, E = c.staleId, r = pe(c, Me);
|
|
232
237
|
if (!(!se(u) || y(r))) {
|
|
233
|
-
var P = r.toastId,
|
|
234
|
-
return
|
|
235
|
-
}, N =
|
|
238
|
+
var P = r.toastId, B = r.updateId, _ = r.data, s = l.props, d = function() {
|
|
239
|
+
return O(P);
|
|
240
|
+
}, N = B == null;
|
|
236
241
|
N && l.count++;
|
|
237
|
-
var
|
|
242
|
+
var x = {
|
|
238
243
|
toastId: P,
|
|
239
|
-
updateId:
|
|
244
|
+
updateId: B,
|
|
240
245
|
isLoading: r.isLoading,
|
|
241
246
|
theme: r.theme || s.theme,
|
|
242
247
|
icon: r.icon != null ? r.icon : s.icon,
|
|
@@ -261,7 +266,7 @@ function Me(e) {
|
|
|
261
266
|
closeOnClick: $(r.closeOnClick) ? r.closeOnClick : s.closeOnClick,
|
|
262
267
|
progressClassName: J(r.progressClassName || s.progressClassName),
|
|
263
268
|
progressStyle: r.progressStyle || s.progressStyle,
|
|
264
|
-
autoClose: r.isLoading ? !1 :
|
|
269
|
+
autoClose: r.isLoading ? !1 : Be(r.autoClose, s.autoClose),
|
|
265
270
|
hideProgressBar: $(r.hideProgressBar) ? r.hideProgressBar : s.hideProgressBar,
|
|
266
271
|
progress: r.progress,
|
|
267
272
|
role: r.role || s.role,
|
|
@@ -269,11 +274,11 @@ function Me(e) {
|
|
|
269
274
|
v.delete(P);
|
|
270
275
|
var j = l.queue.length;
|
|
271
276
|
if (l.count = re(P) ? l.count - 1 : l.count - l.displayedToast, l.count < 0 && (l.count = 0), j > 0) {
|
|
272
|
-
var
|
|
273
|
-
if (j === 1 ||
|
|
277
|
+
var S = re(P) ? 1 : l.props.limit;
|
|
278
|
+
if (j === 1 || S === 1)
|
|
274
279
|
l.displayedToast++, T();
|
|
275
280
|
else {
|
|
276
|
-
var z =
|
|
281
|
+
var z = S > j ? j : S;
|
|
277
282
|
l.displayedToast = z;
|
|
278
283
|
for (var Y = 0; Y < z; Y++)
|
|
279
284
|
T();
|
|
@@ -282,39 +287,39 @@ function Me(e) {
|
|
|
282
287
|
n();
|
|
283
288
|
}
|
|
284
289
|
};
|
|
285
|
-
R(r.onOpen) && (
|
|
290
|
+
R(r.onOpen) && (x.onOpen = r.onOpen), R(r.onClose) && (x.onClose = r.onClose), x.closeButton = s.closeButton, r.closeButton === !1 || se(r.closeButton) ? x.closeButton = r.closeButton : r.closeButton === !0 && (x.closeButton = se(s.closeButton) ? s.closeButton : !0);
|
|
286
291
|
var A = u;
|
|
287
292
|
G(u) && !Q(u.type) ? A = ue(u, {
|
|
288
293
|
closeToast: d,
|
|
289
|
-
toastProps:
|
|
290
|
-
data:
|
|
294
|
+
toastProps: x,
|
|
295
|
+
data: _
|
|
291
296
|
}) : R(u) && (A = u({
|
|
292
297
|
closeToast: d,
|
|
293
|
-
toastProps:
|
|
294
|
-
data:
|
|
298
|
+
toastProps: x,
|
|
299
|
+
data: _
|
|
295
300
|
})), s.limit && s.limit > 0 && l.count > s.limit && N ? l.queue.push({
|
|
296
301
|
toastContent: A,
|
|
297
|
-
toastProps:
|
|
302
|
+
toastProps: x,
|
|
298
303
|
staleId: E
|
|
299
|
-
}) : Z(
|
|
300
|
-
h(A,
|
|
301
|
-
},
|
|
304
|
+
}) : Z(C) && C > 0 ? setTimeout(function() {
|
|
305
|
+
h(A, x, E);
|
|
306
|
+
}, C) : h(A, x, E);
|
|
302
307
|
}
|
|
303
308
|
}
|
|
304
|
-
function h(u, c,
|
|
309
|
+
function h(u, c, C) {
|
|
305
310
|
var E = c.toastId;
|
|
306
|
-
|
|
311
|
+
C && v.delete(C), v.set(E, {
|
|
307
312
|
content: u,
|
|
308
313
|
props: c
|
|
309
314
|
}), f(function(r) {
|
|
310
315
|
return [].concat(r, [E]).filter(function(P) {
|
|
311
|
-
return P !==
|
|
316
|
+
return P !== C;
|
|
312
317
|
});
|
|
313
318
|
});
|
|
314
319
|
}
|
|
315
|
-
function
|
|
316
|
-
var c = /* @__PURE__ */ new Map(),
|
|
317
|
-
return e.newestOnTop &&
|
|
320
|
+
function I(u) {
|
|
321
|
+
var c = /* @__PURE__ */ new Map(), C = Array.from(v.values());
|
|
322
|
+
return e.newestOnTop && C.reverse(), C.forEach(function(E) {
|
|
318
323
|
var r = E.props.position;
|
|
319
324
|
c.has(r) || c.set(r, []), c.get(r).push(E);
|
|
320
325
|
}), Array.from(c, function(E) {
|
|
@@ -322,7 +327,7 @@ function Me(e) {
|
|
|
322
327
|
});
|
|
323
328
|
}
|
|
324
329
|
return {
|
|
325
|
-
getToastToRender:
|
|
330
|
+
getToastToRender: I,
|
|
326
331
|
containerRef: g,
|
|
327
332
|
isToastActive: o
|
|
328
333
|
};
|
|
@@ -344,7 +349,7 @@ function ke(e) {
|
|
|
344
349
|
canDrag: !1,
|
|
345
350
|
boundingRect: null,
|
|
346
351
|
didMove: !1
|
|
347
|
-
}).current, l = F(e), m = e.autoClose,
|
|
352
|
+
}).current, l = F(e), m = e.autoClose, O = e.pauseOnHover, T = e.closeToast, y = e.onClick, L = e.closeOnClick;
|
|
348
353
|
U(function() {
|
|
349
354
|
l.current = e;
|
|
350
355
|
}), U(function() {
|
|
@@ -359,7 +364,7 @@ function ke(e) {
|
|
|
359
364
|
R(d.onClose) && d.onClose(G(d.children) && d.children.props);
|
|
360
365
|
};
|
|
361
366
|
}, []), U(function() {
|
|
362
|
-
return e.pauseOnFocusLoss &&
|
|
367
|
+
return e.pauseOnFocusLoss && C(), function() {
|
|
363
368
|
e.pauseOnFocusLoss && E();
|
|
364
369
|
};
|
|
365
370
|
}, [e.pauseOnFocusLoss]);
|
|
@@ -370,10 +375,10 @@ function ke(e) {
|
|
|
370
375
|
o.canCloseOnClick = !0, o.canDrag = !0, o.boundingRect = N.getBoundingClientRect(), N.style.transition = "", o.x = me(d.nativeEvent), o.y = Te(d.nativeEvent), e.draggableDirection === "x" ? (o.start = o.x, o.removalDistance = N.offsetWidth * (e.draggablePercent / 100)) : (o.start = o.y, o.removalDistance = N.offsetHeight * (e.draggablePercent === 80 ? e.draggablePercent * 1.5 : e.draggablePercent / 100));
|
|
371
376
|
}
|
|
372
377
|
}
|
|
373
|
-
function
|
|
378
|
+
function I() {
|
|
374
379
|
if (o.boundingRect) {
|
|
375
|
-
var d = o.boundingRect, N = d.top,
|
|
376
|
-
e.pauseOnHover && o.x >= A && o.x <= H && o.y >= N && o.y <=
|
|
380
|
+
var d = o.boundingRect, N = d.top, x = d.bottom, A = d.left, H = d.right;
|
|
381
|
+
e.pauseOnHover && o.x >= A && o.x <= H && o.y >= N && o.y <= x ? c() : u();
|
|
377
382
|
}
|
|
378
383
|
}
|
|
379
384
|
function u() {
|
|
@@ -382,23 +387,23 @@ function ke(e) {
|
|
|
382
387
|
function c() {
|
|
383
388
|
a(!1);
|
|
384
389
|
}
|
|
385
|
-
function
|
|
390
|
+
function C() {
|
|
386
391
|
document.hasFocus() || c(), window.addEventListener("focus", u), window.addEventListener("blur", c);
|
|
387
392
|
}
|
|
388
393
|
function E() {
|
|
389
394
|
window.removeEventListener("focus", u), window.removeEventListener("blur", c);
|
|
390
395
|
}
|
|
391
396
|
function r() {
|
|
392
|
-
o.didMove = !1, document.addEventListener("mousemove",
|
|
397
|
+
o.didMove = !1, document.addEventListener("mousemove", B), document.addEventListener("mouseup", _), document.addEventListener("touchmove", B), document.addEventListener("touchend", _);
|
|
393
398
|
}
|
|
394
399
|
function P() {
|
|
395
|
-
document.removeEventListener("mousemove",
|
|
400
|
+
document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", _), document.removeEventListener("touchmove", B), document.removeEventListener("touchend", _);
|
|
396
401
|
}
|
|
397
|
-
function
|
|
402
|
+
function B(d) {
|
|
398
403
|
var N = v.current;
|
|
399
404
|
o.canDrag && N && (o.didMove = !0, n && c(), o.x = me(d), o.y = Te(d), e.draggableDirection === "x" ? o.delta = o.x - o.start : o.delta = o.y - o.start, o.start !== o.x && (o.canCloseOnClick = !1), N.style.transform = "translate" + e.draggableDirection + "(" + o.delta + "px)", N.style.opacity = "" + (1 - Math.abs(o.delta / o.removalDistance)));
|
|
400
405
|
}
|
|
401
|
-
function
|
|
406
|
+
function _() {
|
|
402
407
|
P();
|
|
403
408
|
var d = v.current;
|
|
404
409
|
if (o.canDrag && o.didMove && d) {
|
|
@@ -412,10 +417,10 @@ function ke(e) {
|
|
|
412
417
|
var s = {
|
|
413
418
|
onMouseDown: h,
|
|
414
419
|
onTouchStart: h,
|
|
415
|
-
onMouseUp:
|
|
416
|
-
onTouchEnd:
|
|
420
|
+
onMouseUp: I,
|
|
421
|
+
onTouchEnd: I
|
|
417
422
|
};
|
|
418
|
-
return m &&
|
|
423
|
+
return m && O && (s.onMouseEnter = c, s.onMouseLeave = u), L && (s.onClick = function(d) {
|
|
419
424
|
y && y(d), o.canCloseOnClick && T();
|
|
420
425
|
}), {
|
|
421
426
|
playToast: u,
|
|
@@ -443,18 +448,18 @@ function Ee(e) {
|
|
|
443
448
|
d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"
|
|
444
449
|
})));
|
|
445
450
|
}
|
|
446
|
-
function
|
|
447
|
-
var t, n, a = e.delay, i = e.isRunning, f = e.closeToast, g = e.type, v = e.hide, o = e.className, l = e.style, m = e.controlledProgress,
|
|
451
|
+
function Oe(e) {
|
|
452
|
+
var t, n, a = e.delay, i = e.isRunning, f = e.closeToast, g = e.type, v = e.hide, o = e.className, l = e.style, m = e.controlledProgress, O = e.progress, T = e.rtl, y = e.isIn, L = e.theme, h = D({}, l, {
|
|
448
453
|
animationDuration: a + "ms",
|
|
449
454
|
animationPlayState: i ? "running" : "paused",
|
|
450
455
|
opacity: v ? 0 : 1
|
|
451
456
|
});
|
|
452
|
-
m && (h.transform = "scaleX(" +
|
|
453
|
-
var
|
|
457
|
+
m && (h.transform = "scaleX(" + O + ")");
|
|
458
|
+
var I = M("Toastify__progress-bar", m ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", "Toastify__progress-bar-theme--" + L, "Toastify__progress-bar--" + g, (t = {}, t["Toastify__progress-bar--rtl"] = T, t)), u = R(o) ? o({
|
|
454
459
|
rtl: T,
|
|
455
460
|
type: g,
|
|
456
|
-
defaultClassName:
|
|
457
|
-
}) :
|
|
461
|
+
defaultClassName: I
|
|
462
|
+
}) : M(I, o), c = (n = {}, n[m && O >= 1 ? "onTransitionEnd" : "onAnimationEnd"] = m && O < 1 ? null : function() {
|
|
458
463
|
y && f();
|
|
459
464
|
}, n);
|
|
460
465
|
return p("div", Object.assign({
|
|
@@ -465,8 +470,8 @@ function Ie(e) {
|
|
|
465
470
|
style: h
|
|
466
471
|
}, c));
|
|
467
472
|
}
|
|
468
|
-
|
|
469
|
-
type:
|
|
473
|
+
Oe.defaultProps = {
|
|
474
|
+
type: k.DEFAULT,
|
|
470
475
|
hide: !1
|
|
471
476
|
};
|
|
472
477
|
var Fe = ["theme", "type"], ee = function(t) {
|
|
@@ -510,16 +515,16 @@ var ye = {
|
|
|
510
515
|
error: qe,
|
|
511
516
|
spinner: Ue
|
|
512
517
|
}, Qe = function(t) {
|
|
513
|
-
var n, a, i = ke(t), f = i.isRunning, g = i.preventExitTransition, v = i.toastRef, o = i.eventHandlers, l = t.closeButton, m = t.children,
|
|
518
|
+
var n, a, i = ke(t), f = i.isRunning, g = i.preventExitTransition, v = i.toastRef, o = i.eventHandlers, l = t.closeButton, m = t.children, O = t.autoClose, T = t.onClick, y = t.type, L = t.hideProgressBar, h = t.closeToast, I = t.transition, u = t.position, c = t.className, C = t.style, E = t.bodyClassName, r = t.bodyStyle, P = t.progressClassName, B = t.progressStyle, _ = t.updateId, s = t.role, d = t.progress, N = t.rtl, x = t.toastId, A = t.deleteToast, H = t.isIn, j = t.isLoading, S = t.icon, z = t.theme, Y = M("Toastify__toast", "Toastify__toast-theme--" + z, "Toastify__toast--" + y, (n = {}, n["Toastify__toast--rtl"] = N, n)), Pe = R(c) ? c({
|
|
514
519
|
rtl: N,
|
|
515
520
|
position: u,
|
|
516
521
|
type: y,
|
|
517
522
|
defaultClassName: Y
|
|
518
|
-
}) :
|
|
523
|
+
}) : M(Y, c), ae = !!d, fe = ye[y], oe = {
|
|
519
524
|
theme: z,
|
|
520
525
|
type: y
|
|
521
526
|
}, q = fe && fe(oe);
|
|
522
|
-
|
|
527
|
+
S === !1 ? q = void 0 : R(S) ? q = S(oe) : G(S) ? q = ue(S, oe) : Q(S) ? q = S : j && (q = ye.spinner());
|
|
523
528
|
function Re(X) {
|
|
524
529
|
if (X) {
|
|
525
530
|
var ve = {
|
|
@@ -533,82 +538,82 @@ var ye = {
|
|
|
533
538
|
return ue(X, ve);
|
|
534
539
|
}
|
|
535
540
|
}
|
|
536
|
-
return p(
|
|
541
|
+
return p(I, {
|
|
537
542
|
isIn: H,
|
|
538
543
|
done: A,
|
|
539
544
|
position: u,
|
|
540
545
|
preventExitTransition: g,
|
|
541
546
|
nodeRef: v
|
|
542
547
|
}, p("div", Object.assign({
|
|
543
|
-
id:
|
|
548
|
+
id: x,
|
|
544
549
|
onClick: T,
|
|
545
550
|
className: Pe
|
|
546
551
|
}, o, {
|
|
547
|
-
style:
|
|
552
|
+
style: C,
|
|
548
553
|
ref: v
|
|
549
554
|
}), p("div", Object.assign({}, H && {
|
|
550
555
|
role: s
|
|
551
556
|
}, {
|
|
552
557
|
className: R(E) ? E({
|
|
553
558
|
type: y
|
|
554
|
-
}) :
|
|
559
|
+
}) : M("Toastify__toast-body", E),
|
|
555
560
|
style: r
|
|
556
561
|
}), q && p("div", {
|
|
557
|
-
className:
|
|
558
|
-
}, q), p("div", null, m)), Re(l), (
|
|
559
|
-
key: "pb-" +
|
|
562
|
+
className: M("Toastify__toast-icon", (a = {}, a["Toastify--animate-icon Toastify__zoom-enter"] = !j, a))
|
|
563
|
+
}, q), p("div", null, m)), Re(l), (O || ae) && p(Oe, Object.assign({}, _ && !ae ? {
|
|
564
|
+
key: "pb-" + _
|
|
560
565
|
} : {}, {
|
|
561
566
|
rtl: N,
|
|
562
567
|
theme: z,
|
|
563
|
-
delay:
|
|
568
|
+
delay: O,
|
|
564
569
|
isRunning: f,
|
|
565
570
|
isIn: H,
|
|
566
571
|
closeToast: h,
|
|
567
572
|
hide: L,
|
|
568
573
|
type: y,
|
|
569
|
-
style:
|
|
574
|
+
style: B,
|
|
570
575
|
className: P,
|
|
571
576
|
controlledProgress: ae,
|
|
572
577
|
progress: d
|
|
573
578
|
}))));
|
|
574
|
-
}, We = /* @__PURE__ */
|
|
579
|
+
}, We = /* @__PURE__ */ we({
|
|
575
580
|
enter: "Toastify--animate Toastify__bounce-enter",
|
|
576
581
|
exit: "Toastify--animate Toastify__bounce-exit",
|
|
577
582
|
appendPosition: !0
|
|
578
|
-
}),
|
|
579
|
-
var n =
|
|
580
|
-
function m(
|
|
581
|
-
var T, y =
|
|
583
|
+
}), Ie = function(t) {
|
|
584
|
+
var n = Ae(t), a = n.getToastToRender, i = n.containerRef, f = n.isToastActive, g = t.className, v = t.style, o = t.rtl, l = t.containerId;
|
|
585
|
+
function m(O) {
|
|
586
|
+
var T, y = M("Toastify__toast-container", "Toastify__toast-container--" + O, (T = {}, T["Toastify__toast-container--rtl"] = o, T));
|
|
582
587
|
return R(g) ? g({
|
|
583
|
-
position:
|
|
588
|
+
position: O,
|
|
584
589
|
rtl: o,
|
|
585
590
|
defaultClassName: y
|
|
586
|
-
}) :
|
|
591
|
+
}) : M(y, J(g));
|
|
587
592
|
}
|
|
588
593
|
return p("div", {
|
|
589
594
|
ref: i,
|
|
590
595
|
className: "Toastify",
|
|
591
596
|
id: l
|
|
592
|
-
}, a(function(
|
|
593
|
-
var y = T.length ?
|
|
597
|
+
}, a(function(O, T) {
|
|
598
|
+
var y = T.length ? D({}, v) : D({}, v, {
|
|
594
599
|
pointerEvents: "none"
|
|
595
600
|
});
|
|
596
601
|
return p("div", {
|
|
597
|
-
className: m(
|
|
602
|
+
className: m(O),
|
|
598
603
|
style: y,
|
|
599
|
-
key: "container-" +
|
|
604
|
+
key: "container-" + O
|
|
600
605
|
}, T.map(function(L) {
|
|
601
|
-
var h = L.content,
|
|
602
|
-
return p(Qe, Object.assign({},
|
|
603
|
-
isIn: f(
|
|
604
|
-
key: "toast-" +
|
|
605
|
-
closeButton:
|
|
606
|
+
var h = L.content, I = L.props;
|
|
607
|
+
return p(Qe, Object.assign({}, I, {
|
|
608
|
+
isIn: f(I.toastId),
|
|
609
|
+
key: "toast-" + I.key,
|
|
610
|
+
closeButton: I.closeButton === !0 ? Ee : I.closeButton
|
|
606
611
|
}), h);
|
|
607
612
|
}));
|
|
608
613
|
}));
|
|
609
614
|
};
|
|
610
|
-
|
|
611
|
-
position:
|
|
615
|
+
Ie.defaultProps = {
|
|
616
|
+
position: Ce.TOP_RIGHT,
|
|
612
617
|
transition: We,
|
|
613
618
|
rtl: !1,
|
|
614
619
|
autoClose: 5e3,
|
|
@@ -636,17 +641,17 @@ function Ye(e) {
|
|
|
636
641
|
return e && (Q(e.toastId) || Z(e.toastId)) ? e.toastId : Le();
|
|
637
642
|
}
|
|
638
643
|
function V(e, t) {
|
|
639
|
-
return W.size > 0 ?
|
|
644
|
+
return W.size > 0 ? w.emit(
|
|
640
645
|
0,
|
|
641
646
|
e,
|
|
642
647
|
t
|
|
643
648
|
) : (ce.push({
|
|
644
649
|
content: e,
|
|
645
650
|
options: t
|
|
646
|
-
}), de &&
|
|
651
|
+
}), de && be && (de = !1, K = document.createElement("div"), document.body.appendChild(K), De.render(p(Ie, Object.assign({}, Ne)), K))), t.toastId;
|
|
647
652
|
}
|
|
648
653
|
function te(e, t) {
|
|
649
|
-
return
|
|
654
|
+
return D({}, t, {
|
|
650
655
|
type: t && t.type || e,
|
|
651
656
|
toastId: Ye(t)
|
|
652
657
|
});
|
|
@@ -656,11 +661,11 @@ function ne(e) {
|
|
|
656
661
|
return V(t, te(e, n));
|
|
657
662
|
};
|
|
658
663
|
}
|
|
659
|
-
function
|
|
660
|
-
return V(e, te(
|
|
664
|
+
function b(e, t) {
|
|
665
|
+
return V(e, te(k.DEFAULT, t));
|
|
661
666
|
}
|
|
662
|
-
|
|
663
|
-
return V(e, te(
|
|
667
|
+
b.loading = function(e, t) {
|
|
668
|
+
return V(e, te(k.DEFAULT, D({
|
|
664
669
|
isLoading: !0,
|
|
665
670
|
autoClose: !1,
|
|
666
671
|
closeOnClick: !1,
|
|
@@ -670,26 +675,26 @@ C.loading = function(e, t) {
|
|
|
670
675
|
};
|
|
671
676
|
function Xe(e, t, n) {
|
|
672
677
|
var a = t.pending, i = t.error, f = t.success, g;
|
|
673
|
-
a && (g = Q(a) ?
|
|
678
|
+
a && (g = Q(a) ? b.loading(a, n) : b.loading(a.render, D({}, n, a)));
|
|
674
679
|
var v = {
|
|
675
680
|
isLoading: null,
|
|
676
681
|
autoClose: null,
|
|
677
682
|
closeOnClick: null,
|
|
678
683
|
closeButton: null,
|
|
679
684
|
draggable: null
|
|
680
|
-
}, o = function(
|
|
685
|
+
}, o = function(O, T, y) {
|
|
681
686
|
if (T == null) {
|
|
682
|
-
|
|
687
|
+
b.dismiss(g);
|
|
683
688
|
return;
|
|
684
689
|
}
|
|
685
|
-
var L =
|
|
686
|
-
type:
|
|
690
|
+
var L = D({
|
|
691
|
+
type: O
|
|
687
692
|
}, v, n, {
|
|
688
693
|
data: y
|
|
689
694
|
}), h = Q(T) ? {
|
|
690
695
|
render: T
|
|
691
696
|
} : T;
|
|
692
|
-
return g ?
|
|
697
|
+
return g ? b.update(g, D({}, L, h)) : b(h.render, D({}, L, h)), y;
|
|
693
698
|
}, l = R(e) ? e() : e;
|
|
694
699
|
return l.then(function(m) {
|
|
695
700
|
return o("success", f, m);
|
|
@@ -697,40 +702,40 @@ function Xe(e, t, n) {
|
|
|
697
702
|
return o("error", i, m);
|
|
698
703
|
}), l;
|
|
699
704
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
return V(e, te(
|
|
705
|
+
b.promise = Xe;
|
|
706
|
+
b.success = /* @__PURE__ */ ne(k.SUCCESS);
|
|
707
|
+
b.info = /* @__PURE__ */ ne(k.INFO);
|
|
708
|
+
b.error = /* @__PURE__ */ ne(k.ERROR);
|
|
709
|
+
b.warning = /* @__PURE__ */ ne(k.WARNING);
|
|
710
|
+
b.warn = b.warning;
|
|
711
|
+
b.dark = function(e, t) {
|
|
712
|
+
return V(e, te(k.DEFAULT, D({
|
|
708
713
|
theme: "dark"
|
|
709
714
|
}, t)));
|
|
710
715
|
};
|
|
711
|
-
|
|
712
|
-
return
|
|
716
|
+
b.dismiss = function(e) {
|
|
717
|
+
return w.emit(
|
|
713
718
|
1,
|
|
714
719
|
e
|
|
715
720
|
);
|
|
716
721
|
};
|
|
717
|
-
|
|
718
|
-
return e === void 0 && (e = {}),
|
|
722
|
+
b.clearWaitingQueue = function(e) {
|
|
723
|
+
return e === void 0 && (e = {}), w.emit(
|
|
719
724
|
5,
|
|
720
725
|
e
|
|
721
726
|
);
|
|
722
727
|
};
|
|
723
|
-
|
|
728
|
+
b.isActive = function(e) {
|
|
724
729
|
var t = !1;
|
|
725
730
|
return W.forEach(function(n) {
|
|
726
731
|
n.isToastActive && n.isToastActive(e) && (t = !0);
|
|
727
732
|
}), t;
|
|
728
733
|
};
|
|
729
|
-
|
|
734
|
+
b.update = function(e, t) {
|
|
730
735
|
t === void 0 && (t = {}), setTimeout(function() {
|
|
731
736
|
var n = Ge(e, t);
|
|
732
737
|
if (n) {
|
|
733
|
-
var a = n.props, i = n.content, f =
|
|
738
|
+
var a = n.props, i = n.content, f = D({}, a, t, {
|
|
734
739
|
toastId: t.toastId || e,
|
|
735
740
|
updateId: Le()
|
|
736
741
|
});
|
|
@@ -740,32 +745,32 @@ C.update = function(e, t) {
|
|
|
740
745
|
}
|
|
741
746
|
}, 0);
|
|
742
747
|
};
|
|
743
|
-
|
|
744
|
-
|
|
748
|
+
b.done = function(e) {
|
|
749
|
+
b.update(e, {
|
|
745
750
|
progress: 1
|
|
746
751
|
});
|
|
747
752
|
};
|
|
748
|
-
|
|
749
|
-
return R(e) &&
|
|
753
|
+
b.onChange = function(e) {
|
|
754
|
+
return R(e) && w.on(
|
|
750
755
|
4,
|
|
751
756
|
e
|
|
752
757
|
), function() {
|
|
753
|
-
R(e) &&
|
|
758
|
+
R(e) && w.off(
|
|
754
759
|
4,
|
|
755
760
|
e
|
|
756
761
|
);
|
|
757
762
|
};
|
|
758
763
|
};
|
|
759
|
-
|
|
764
|
+
b.configure = function(e) {
|
|
760
765
|
e === void 0 && (e = {}), de = !0, Ne = e;
|
|
761
766
|
};
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
767
|
+
b.POSITION = Ce;
|
|
768
|
+
b.TYPE = k;
|
|
769
|
+
w.on(
|
|
765
770
|
2,
|
|
766
771
|
function(e) {
|
|
767
772
|
le = e.containerId || e, W.set(le, e), ce.forEach(function(t) {
|
|
768
|
-
|
|
773
|
+
w.emit(
|
|
769
774
|
0,
|
|
770
775
|
t.content,
|
|
771
776
|
t.options
|
|
@@ -775,7 +780,7 @@ S.on(
|
|
|
775
780
|
).on(
|
|
776
781
|
3,
|
|
777
782
|
function(e) {
|
|
778
|
-
W.delete(e.containerId || e), W.size === 0 &&
|
|
783
|
+
W.delete(e.containerId || e), W.size === 0 && w.off(
|
|
779
784
|
0
|
|
780
785
|
/* Show */
|
|
781
786
|
).off(
|
|
@@ -784,9 +789,10 @@ S.on(
|
|
|
784
789
|
).off(
|
|
785
790
|
5
|
|
786
791
|
/* ClearWaitingQueue */
|
|
787
|
-
),
|
|
792
|
+
), be && K && document.body.removeChild(K);
|
|
788
793
|
}
|
|
789
794
|
);
|
|
790
795
|
export {
|
|
791
|
-
|
|
796
|
+
Ve as c,
|
|
797
|
+
b as t
|
|
792
798
|
};
|