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