@lanaco/lnc-react-ui 4.0.2 → 4.0.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/bundle-visualization.html +4842 -0
- package/dist/Accordion.cjs +1 -1
- package/dist/Accordion.js +55 -50
- package/dist/AccordionDetails.cjs +1 -1
- package/dist/AccordionDetails.js +15 -15
- package/dist/AccordionSummary.cjs +1 -1
- package/dist/AccordionSummary.js +11 -11
- package/dist/ActionsToolbar.cjs +2 -2
- package/dist/ActionsToolbar.js +16 -16
- package/dist/Alert.cjs +1 -1
- package/dist/Alert.js +23 -23
- package/dist/Avatar.cjs +2 -2
- package/dist/Avatar.js +23 -25
- package/dist/Badge.cjs +1 -1
- package/dist/Badge.js +21 -14
- package/dist/Breadcrumbs.cjs +1 -1
- package/dist/Breadcrumbs.js +28 -28
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +21 -21
- package/dist/ButtonGroup.cjs +1 -1
- package/dist/ButtonGroup.js +10 -6
- package/dist/CheckBoxInput.cjs +1 -1
- package/dist/CheckBoxInput.js +4 -4
- package/dist/Chip.cjs +1 -1
- package/dist/Chip.js +9 -9
- package/dist/ColorInput.cjs +1 -1
- package/dist/ColorInput.js +5 -5
- package/dist/ConfirmationForm.cjs +5 -5
- package/dist/ConfirmationForm.js +59 -59
- package/dist/Content.cjs +1 -1
- package/dist/Content.js +8 -8
- package/dist/{CustomStyles-nfD3J1mi.js → CustomStyles-BUSJ8bZt.js} +5 -5
- package/dist/{CustomStyles-CqlCjTgU.cjs → CustomStyles-Dlqxic2X.cjs} +1 -1
- package/dist/DataView.cjs +1 -1
- package/dist/DataView.js +2 -2
- package/dist/DateInput.cjs +4 -4
- package/dist/DateInput.js +491 -491
- package/dist/DecimalInput.cjs +1 -1
- package/dist/DecimalInput.js +5 -5
- package/dist/DetailsView.cjs +4 -4
- package/dist/DetailsView.js +40 -40
- package/dist/DoubleRangeSlider.cjs +1 -1
- package/dist/DoubleRangeSlider.js +4 -4
- package/dist/DragAndDropFile.cjs +1 -1
- package/dist/DragAndDropFile.js +6 -6
- package/dist/DragDropFiles.cjs +1 -1
- package/dist/DragDropFiles.js +4 -4
- package/dist/Drawer.cjs +1 -1
- package/dist/Drawer.js +15 -15
- package/dist/Dropdown.cjs +1 -1
- package/dist/Dropdown.js +6 -6
- package/dist/DropdownItem.cjs +1 -1
- package/dist/DropdownItem.js +4 -4
- package/dist/DropdownLookup.cjs +1 -1
- package/dist/DropdownLookup.js +6 -6
- package/dist/DropdownMenu.cjs +7 -1
- package/dist/DropdownMenu.js +192 -10
- package/dist/EditableTable.cjs +1 -1
- package/dist/EditableTable.js +4 -4
- package/dist/FileInput.cjs +1 -1
- package/dist/FileInput.js +4 -4
- package/dist/FlexBox.cjs +1 -1
- package/dist/FlexBox.js +14 -14
- package/dist/FlexGrid.cjs +1 -1
- package/dist/FlexGrid.js +30 -30
- package/dist/FlexGridItem.cjs +1 -1
- package/dist/FlexGridItem.js +3 -3
- package/dist/Footer.cjs +1 -1
- package/dist/Footer.js +5 -5
- package/dist/FormField.cjs +1 -1
- package/dist/FormField.js +8 -9
- package/dist/FormView.cjs +1 -1
- package/dist/FormView.js +31 -31
- package/dist/Grid.cjs +1 -1
- package/dist/Grid.js +2 -2
- package/dist/GridItem.cjs +1 -1
- package/dist/GridItem.js +2 -2
- package/dist/Header.cjs +1 -1
- package/dist/Header.js +7 -7
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +33 -10
- package/dist/IconButton.cjs +5 -5
- package/dist/IconButton.js +33 -33
- package/dist/Kanban.cjs +12 -12
- package/dist/Kanban.js +948 -936
- package/dist/KanbanActionsToolbar.cjs +2 -2
- package/dist/KanbanActionsToolbar.js +28 -28
- package/dist/{KanbanCard-D9OhU8C6.js → KanbanCard-CHZ_C9kk.js} +50 -50
- package/dist/KanbanCard-DV3VnSUi.cjs +30 -0
- package/dist/KanbanCard.cjs +1 -1
- package/dist/KanbanCard.js +5 -5
- package/dist/KanbanFooter.cjs +1 -1
- package/dist/KanbanFooter.js +40 -40
- package/dist/KanbanHeader.cjs +2 -2
- package/dist/KanbanHeader.js +46 -46
- package/dist/KanbanView.cjs +1 -1
- package/dist/KanbanView.js +27 -27
- package/dist/Link.cjs +1 -1
- package/dist/Link.js +9 -9
- package/dist/MenuItem.cjs +1 -1
- package/dist/MenuItem.js +11 -11
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +7 -7
- package/dist/MultiSelectDropdown.cjs +1 -1
- package/dist/MultiSelectDropdown.js +4 -4
- package/dist/MultiSelectDropdownLookup.cjs +1 -1
- package/dist/MultiSelectDropdownLookup.js +4 -4
- package/dist/NestedDropdownItem.cjs +1 -1
- package/dist/NestedDropdownItem.js +18 -18
- package/dist/NestedMenuItem.cjs +1 -1
- package/dist/NestedMenuItem.js +9 -9
- package/dist/Notification.cjs +1 -83
- package/dist/Notification.js +3 -1077
- package/dist/NotificationContainer.cjs +37 -0
- package/dist/NotificationContainer.js +162 -0
- package/dist/NotificationMessage.cjs +47 -0
- package/dist/NotificationMessage.js +133 -0
- package/dist/NumberInput.cjs +1 -1
- package/dist/NumberInput.js +5 -5
- package/dist/PageLayout.cjs +2 -2
- package/dist/PageLayout.js +27 -27
- package/dist/Pagination.cjs +12 -0
- package/dist/Pagination.js +248 -0
- package/dist/PasswordInput.cjs +1 -1
- package/dist/PasswordInput.js +14 -14
- package/dist/Popover.cjs +1 -0
- package/dist/Popover.js +36 -0
- package/dist/PopoverClose.cjs +1 -0
- package/dist/PopoverClose.js +15 -0
- package/dist/PopoverContent.cjs +10 -0
- package/dist/PopoverContent.js +68 -0
- package/dist/PopoverContext.cjs +1 -0
- package/dist/PopoverContext.js +5 -0
- package/dist/PopoverDescription.cjs +1 -0
- package/dist/PopoverDescription.js +16 -0
- package/dist/PopoverHeading.cjs +1 -0
- package/dist/PopoverHeading.js +16 -0
- package/dist/PopoverTrigger.cjs +1 -0
- package/dist/PopoverTrigger.js +38 -0
- package/dist/ProgressBar.cjs +1 -1
- package/dist/ProgressBar.js +35 -24
- package/dist/RadioGroup.cjs +1 -1
- package/dist/RadioGroup.js +3 -3
- package/dist/RadioInput.cjs +1 -1
- package/dist/RadioInput.js +4 -4
- package/dist/RangeSlider.cjs +1 -1
- package/dist/RangeSlider.js +4 -4
- package/dist/SearchBar.cjs +1 -1
- package/dist/SearchBar.js +6 -6
- package/dist/Separator.cjs +1 -1
- package/dist/Separator.js +9 -9
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +4 -4
- package/dist/Spinner.cjs +1 -1
- package/dist/Spinner.js +25 -20
- package/dist/Surface.cjs +2 -2
- package/dist/Surface.js +14 -15
- package/dist/SwipeableDrawer.cjs +1 -1
- package/dist/SwipeableDrawer.js +4 -4
- package/dist/TabItem.cjs +26 -0
- package/dist/TabItem.js +210 -0
- package/dist/Table.cjs +20 -20
- package/dist/Table.js +13 -12
- package/dist/TableView.cjs +8 -1
- package/dist/TableView.js +238 -9
- package/dist/Tabs.cjs +1 -1
- package/dist/Tabs.js +3 -3
- package/dist/TextAreaInput.cjs +1 -1
- package/dist/TextAreaInput.js +5 -5
- package/dist/TextInput.cjs +1 -1
- package/dist/TextInput.js +5 -5
- package/dist/ThemeProvider.cjs +1 -1
- package/dist/ThemeProvider.js +5 -5
- package/dist/TimeInput.cjs +1 -1
- package/dist/TimeInput.js +9 -9
- package/dist/Toggle.cjs +1 -1
- package/dist/Toggle.js +4 -4
- package/dist/TreeMenu.cjs +1 -1
- package/dist/TreeMenu.js +2 -2
- package/dist/TreeMenuSeparator.cjs +3 -3
- package/dist/TreeMenuSeparator.js +11 -11
- package/dist/UploadedFile.cjs +1 -1
- package/dist/UploadedFile.js +29 -29
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/{defineProperty-BHpTtkhC.js → defineProperty-B5pLF6px.js} +8 -8
- package/dist/{emotion-element-5486c51c.browser.esm-CSejtOeT.js → emotion-element-5486c51c.browser.esm-Bb4VkP8U.js} +4 -4
- package/dist/{emotion-is-prop-valid.esm-BzFBwmJz.js → emotion-is-prop-valid.esm-DkbeH1Xy.js} +1 -1
- package/dist/{emotion-react.browser.esm-OWM-uG8Q.js → emotion-react.browser.esm-CN-s34fZ.js} +6 -6
- package/dist/{emotion-react.browser.esm-DQBL7Wls.cjs → emotion-react.browser.esm-D7h2t2Bz.cjs} +1 -1
- package/dist/{emotion-styled.browser.esm-BZSYYThs.js → emotion-styled.browser.esm-BiK8DcgW.js} +12 -12
- package/dist/floating-ui.react.esm-72DKnou_.js +1198 -0
- package/dist/floating-ui.react.esm-C4vrBVJU.cjs +4 -0
- package/dist/{hoist-non-react-statics.cjs-Drf1aBlk.js → hoist-non-react-statics.cjs-CAHiRNzQ.js} +1 -1
- package/dist/{hoist-non-react-statics.cjs-B8r9S_ak.cjs → hoist-non-react-statics.cjs-Dr-ytKVG.cjs} +3 -3
- package/dist/{index-CZJEA84h.js → index--Kmch3aI.js} +1 -1
- package/dist/index-BIlhCoy2.cjs +20 -0
- package/dist/{index-BLQWNy78.js → index-BUChtubz.js} +4 -4
- package/dist/{index-Ds9PUTwb.js → index-BYnWp42a.js} +208 -213
- package/dist/{index-D5vEbKUT.js → index-CNBqQrtK.js} +1 -1
- package/dist/{index-IO9v6o0I.cjs → index-CSXL784P.cjs} +2 -2
- package/dist/{index-C29T0m2a.cjs → index-Ct1N7fF4.cjs} +1 -1
- package/dist/{index-BklgDeu4.js → index-Cu0xwYjD.js} +1 -1
- package/dist/{index-Cdkz-XH-.js → index-CvebWhtp.js} +1 -1
- package/dist/index-DAOBjHnD.cjs +1 -0
- package/dist/index-DBXXH_TD.cjs +1 -0
- package/dist/{index-B_da1uvD.js → index-DLVVKJXD.js} +1 -1
- package/dist/index-DaiUAQVF.cjs +1 -0
- package/dist/index.cjs +1 -26
- package/dist/index.js +180 -376
- package/dist/{motion-CtkUpWEn.js → motion-ecIGZGwI.js} +1 -1
- package/dist/react-toastify.esm-CkXGwKXL.js +798 -0
- package/dist/react-toastify.esm-Dqcb4SQT.cjs +1 -0
- package/dist/{setPrototypeOf-a891FLQJ.js → setPrototypeOf-CttqfWo1.js} +2 -2
- package/dist/{tslib.es6-ZNVz5r_T.js → tslib.es6-DQ-SzcmG.js} +5 -5
- package/dist/usePopover.cjs +1 -0
- package/dist/usePopover.js +44 -0
- package/dist/{utils-DEke8iwo.js → utils-C52T57HO.js} +73 -73
- package/dist/{utils-hdRGTsQ7.cjs → utils-DTAPpJXU.cjs} +1 -1
- package/package.json +17 -5
- package/vite.config.js +16 -0
- package/dist/DropdownMenu-B6qr13ik.cjs +0 -19
- package/dist/DropdownMenu-DZi3TJ8Q.js +0 -1547
- package/dist/KanbanCard-ConTmu3w.cjs +0 -30
- package/dist/TableView-Cj5_fbSR.js +0 -481
- package/dist/TableView-D8ex512p.cjs +0 -19
- package/dist/index-BjdOz5Ok.cjs +0 -1
- package/dist/index-DXnSjbfJ.cjs +0 -20
- package/dist/index-Dzkd2i4n.cjs +0 -1
- package/dist/index-P-naJISQ.cjs +0 -1
|
@@ -0,0 +1,798 @@
|
|
|
1
|
+
import S, { createElement as B, useRef as J, useLayoutEffect as Be, useEffect as z, useReducer as ye, isValidElement as Y, cloneElement as ue, useState as Te } from "react";
|
|
2
|
+
import { r as _e } from "./index--Kmch3aI.js";
|
|
3
|
+
function Ce(e) {
|
|
4
|
+
var t, n, o = "";
|
|
5
|
+
if (typeof e == "string" || typeof e == "number") o += e;
|
|
6
|
+
else if (typeof e == "object") if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (n = Ce(e[t])) && (o && (o += " "), o += n);
|
|
7
|
+
else for (t in e) e[t] && (o && (o += " "), o += t);
|
|
8
|
+
return o;
|
|
9
|
+
}
|
|
10
|
+
function H() {
|
|
11
|
+
for (var e, t, n = 0, o = ""; n < arguments.length; ) (e = arguments[n++]) && (t = Ce(e)) && (o && (o += " "), o += t);
|
|
12
|
+
return o;
|
|
13
|
+
}
|
|
14
|
+
function _() {
|
|
15
|
+
return _ = Object.assign || function(e) {
|
|
16
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
17
|
+
var n = arguments[t];
|
|
18
|
+
for (var o in n)
|
|
19
|
+
Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
|
|
20
|
+
}
|
|
21
|
+
return e;
|
|
22
|
+
}, _.apply(this, arguments);
|
|
23
|
+
}
|
|
24
|
+
function Ee(e, t) {
|
|
25
|
+
if (e == null) return {};
|
|
26
|
+
var n = {}, o = Object.keys(e), s, u;
|
|
27
|
+
for (u = 0; u < o.length; u++)
|
|
28
|
+
s = o[u], !(t.indexOf(s) >= 0) && (n[s] = e[s]);
|
|
29
|
+
return n;
|
|
30
|
+
}
|
|
31
|
+
function Z(e) {
|
|
32
|
+
return typeof e == "number" && !isNaN(e);
|
|
33
|
+
}
|
|
34
|
+
function $(e) {
|
|
35
|
+
return typeof e == "boolean";
|
|
36
|
+
}
|
|
37
|
+
function U(e) {
|
|
38
|
+
return typeof e == "string";
|
|
39
|
+
}
|
|
40
|
+
function D(e) {
|
|
41
|
+
return typeof e == "function";
|
|
42
|
+
}
|
|
43
|
+
function te(e) {
|
|
44
|
+
return U(e) || D(e) ? e : null;
|
|
45
|
+
}
|
|
46
|
+
function ce(e) {
|
|
47
|
+
return e === 0 || e;
|
|
48
|
+
}
|
|
49
|
+
function Se(e, t) {
|
|
50
|
+
return e === !1 || Z(e) && e > 0 ? e : t;
|
|
51
|
+
}
|
|
52
|
+
var Ie = !!(typeof window < "u" && window.document && window.document.createElement);
|
|
53
|
+
function le(e) {
|
|
54
|
+
return Y(e) || U(e) || D(e) || Z(e);
|
|
55
|
+
}
|
|
56
|
+
var Oe = {
|
|
57
|
+
TOP_LEFT: "top-left",
|
|
58
|
+
TOP_RIGHT: "top-right",
|
|
59
|
+
TOP_CENTER: "top-center",
|
|
60
|
+
BOTTOM_LEFT: "bottom-left",
|
|
61
|
+
BOTTOM_RIGHT: "bottom-right",
|
|
62
|
+
BOTTOM_CENTER: "bottom-center"
|
|
63
|
+
}, A = {
|
|
64
|
+
INFO: "info",
|
|
65
|
+
SUCCESS: "success",
|
|
66
|
+
WARNING: "warning",
|
|
67
|
+
ERROR: "error",
|
|
68
|
+
DEFAULT: "default"
|
|
69
|
+
};
|
|
70
|
+
function we(e, t, n) {
|
|
71
|
+
n === void 0 && (n = 300);
|
|
72
|
+
var o = e.scrollHeight, s = e.style;
|
|
73
|
+
requestAnimationFrame(function() {
|
|
74
|
+
s.minHeight = "initial", s.height = o + "px", s.transition = "all " + n + "ms", requestAnimationFrame(function() {
|
|
75
|
+
s.height = "0", s.padding = "0", s.margin = "0", setTimeout(t, n);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function ke(e) {
|
|
80
|
+
var t = e.enter, n = e.exit, o = e.appendPosition, s = o === void 0 ? !1 : o, u = e.collapse, g = u === void 0 ? !0 : u, v = e.collapseDuration, r = v === void 0 ? 300 : v;
|
|
81
|
+
return function(l) {
|
|
82
|
+
var b = l.children, C = l.position, T = l.preventExitTransition, P = l.done, E = l.nodeRef, N = l.isIn, R = s ? t + "--" + C : t, L = s ? n + "--" + C : n, F = J(), i = J(
|
|
83
|
+
0
|
|
84
|
+
/* Enter */
|
|
85
|
+
);
|
|
86
|
+
Be(function() {
|
|
87
|
+
c();
|
|
88
|
+
}, []), z(function() {
|
|
89
|
+
N || (T ? I() : y());
|
|
90
|
+
}, [N]);
|
|
91
|
+
function c() {
|
|
92
|
+
var a = E.current;
|
|
93
|
+
F.current = a.className, a.className += " " + R, a.addEventListener("animationend", m);
|
|
94
|
+
}
|
|
95
|
+
function m(a) {
|
|
96
|
+
if (a.target === E.current) {
|
|
97
|
+
var f = E.current;
|
|
98
|
+
f.removeEventListener("animationend", m), i.current === 0 && (f.className = F.current);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function y() {
|
|
102
|
+
i.current = 1;
|
|
103
|
+
var a = E.current;
|
|
104
|
+
a.className += " " + L, a.addEventListener("animationend", I);
|
|
105
|
+
}
|
|
106
|
+
function I() {
|
|
107
|
+
var a = E.current;
|
|
108
|
+
a.removeEventListener("animationend", I), g ? we(a, P, r) : P();
|
|
109
|
+
}
|
|
110
|
+
return S.createElement(S.Fragment, null, b);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
var w = {
|
|
114
|
+
list: /* @__PURE__ */ new Map(),
|
|
115
|
+
emitQueue: /* @__PURE__ */ new Map(),
|
|
116
|
+
on: function(t, n) {
|
|
117
|
+
return this.list.has(t) || this.list.set(t, []), this.list.get(t).push(n), this;
|
|
118
|
+
},
|
|
119
|
+
off: function(t, n) {
|
|
120
|
+
if (n) {
|
|
121
|
+
var o = this.list.get(t).filter(function(s) {
|
|
122
|
+
return s !== n;
|
|
123
|
+
});
|
|
124
|
+
return this.list.set(t, o), this;
|
|
125
|
+
}
|
|
126
|
+
return this.list.delete(t), this;
|
|
127
|
+
},
|
|
128
|
+
cancelEmit: function(t) {
|
|
129
|
+
var n = this.emitQueue.get(t);
|
|
130
|
+
return n && (n.forEach(clearTimeout), this.emitQueue.delete(t)), this;
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* Enqueue the event at the end of the call stack
|
|
134
|
+
* Doing so let the user call toast as follow:
|
|
135
|
+
* toast('1')
|
|
136
|
+
* toast('2')
|
|
137
|
+
* toast('3')
|
|
138
|
+
* Without setTimemout the code above will not work
|
|
139
|
+
*/
|
|
140
|
+
emit: function(t) {
|
|
141
|
+
for (var n = this, o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), u = 1; u < o; u++)
|
|
142
|
+
s[u - 1] = arguments[u];
|
|
143
|
+
this.list.has(t) && this.list.get(t).forEach(function(g) {
|
|
144
|
+
var v = setTimeout(function() {
|
|
145
|
+
g.apply(void 0, s);
|
|
146
|
+
}, 0);
|
|
147
|
+
n.emitQueue.has(t) || n.emitQueue.set(t, []), n.emitQueue.get(t).push(v);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
function q(e, t) {
|
|
152
|
+
t === void 0 && (t = !1);
|
|
153
|
+
var n = J(e);
|
|
154
|
+
return z(function() {
|
|
155
|
+
t && (n.current = e);
|
|
156
|
+
}), n.current;
|
|
157
|
+
}
|
|
158
|
+
function Ae(e, t) {
|
|
159
|
+
switch (t.type) {
|
|
160
|
+
case 0:
|
|
161
|
+
return [].concat(e, [t.toastId]).filter(function(n) {
|
|
162
|
+
return n !== t.staleId;
|
|
163
|
+
});
|
|
164
|
+
case 1:
|
|
165
|
+
return ce(t.toastId) ? e.filter(function(n) {
|
|
166
|
+
return n !== t.toastId;
|
|
167
|
+
}) : [];
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
var Fe = ["delay", "staleId"];
|
|
171
|
+
function Me(e) {
|
|
172
|
+
var t = ye(function(i) {
|
|
173
|
+
return i + 1;
|
|
174
|
+
}, 0), n = t[1], o = ye(Ae, []), s = o[0], u = o[1], g = J(null), v = q(0), r = q([]), h = q({}), l = q({
|
|
175
|
+
toastKey: 1,
|
|
176
|
+
displayedToast: 0,
|
|
177
|
+
props: e,
|
|
178
|
+
containerId: null,
|
|
179
|
+
isToastActive: b,
|
|
180
|
+
getToast: function(c) {
|
|
181
|
+
return h[c] || null;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
z(function() {
|
|
185
|
+
return l.containerId = e.containerId, w.cancelEmit(
|
|
186
|
+
3
|
|
187
|
+
/* WillUnmount */
|
|
188
|
+
).on(
|
|
189
|
+
0,
|
|
190
|
+
N
|
|
191
|
+
).on(
|
|
192
|
+
1,
|
|
193
|
+
function(i) {
|
|
194
|
+
return g.current && T(i);
|
|
195
|
+
}
|
|
196
|
+
).on(
|
|
197
|
+
5,
|
|
198
|
+
C
|
|
199
|
+
).emit(
|
|
200
|
+
2,
|
|
201
|
+
l
|
|
202
|
+
), function() {
|
|
203
|
+
return w.emit(
|
|
204
|
+
3,
|
|
205
|
+
l
|
|
206
|
+
);
|
|
207
|
+
};
|
|
208
|
+
}, []), z(function() {
|
|
209
|
+
l.isToastActive = b, l.displayedToast = s.length, w.emit(
|
|
210
|
+
4,
|
|
211
|
+
s.length,
|
|
212
|
+
e.containerId
|
|
213
|
+
);
|
|
214
|
+
}, [s]), z(function() {
|
|
215
|
+
l.props = e;
|
|
216
|
+
});
|
|
217
|
+
function b(i) {
|
|
218
|
+
return s.indexOf(i) !== -1;
|
|
219
|
+
}
|
|
220
|
+
function C(i) {
|
|
221
|
+
var c = i.containerId, m = l.props.limit;
|
|
222
|
+
m && (!c || l.containerId === c) && (v -= r.length, r = []);
|
|
223
|
+
}
|
|
224
|
+
function T(i) {
|
|
225
|
+
u({
|
|
226
|
+
type: 1,
|
|
227
|
+
toastId: i
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function P() {
|
|
231
|
+
var i = r.shift(), c = i.toastContent, m = i.toastProps, y = i.staleId;
|
|
232
|
+
R(c, m, y);
|
|
233
|
+
}
|
|
234
|
+
function E(i) {
|
|
235
|
+
var c = i.containerId, m = i.toastId, y = i.updateId;
|
|
236
|
+
return !!(!g.current || l.props.enableMultiContainer && c !== l.props.containerId || h[m] && y == null);
|
|
237
|
+
}
|
|
238
|
+
function N(i, c) {
|
|
239
|
+
var m, y = c.delay, I = c.staleId, a = Ee(c, Fe);
|
|
240
|
+
if (!(!le(i) || E(a))) {
|
|
241
|
+
var f = a.toastId, x = a.updateId, W = a.data, d = l.props, k = function() {
|
|
242
|
+
return T(f);
|
|
243
|
+
}, K = a.updateId == null;
|
|
244
|
+
K && v++;
|
|
245
|
+
var O = {
|
|
246
|
+
toastId: f,
|
|
247
|
+
updateId: x,
|
|
248
|
+
isLoading: a.isLoading,
|
|
249
|
+
theme: a.theme || d.theme,
|
|
250
|
+
icon: (m = a.icon) != null ? m : d.icon,
|
|
251
|
+
isIn: !1,
|
|
252
|
+
key: a.key || l.toastKey++,
|
|
253
|
+
type: a.type,
|
|
254
|
+
closeToast: k,
|
|
255
|
+
closeButton: a.closeButton,
|
|
256
|
+
rtl: d.rtl,
|
|
257
|
+
position: a.position || d.position,
|
|
258
|
+
transition: a.transition || d.transition,
|
|
259
|
+
className: te(a.className || d.toastClassName),
|
|
260
|
+
bodyClassName: te(a.bodyClassName || d.bodyClassName),
|
|
261
|
+
style: a.style || d.toastStyle,
|
|
262
|
+
bodyStyle: a.bodyStyle || d.bodyStyle,
|
|
263
|
+
onClick: a.onClick || d.onClick,
|
|
264
|
+
pauseOnHover: $(a.pauseOnHover) ? a.pauseOnHover : d.pauseOnHover,
|
|
265
|
+
pauseOnFocusLoss: $(a.pauseOnFocusLoss) ? a.pauseOnFocusLoss : d.pauseOnFocusLoss,
|
|
266
|
+
draggable: $(a.draggable) ? a.draggable : d.draggable,
|
|
267
|
+
draggablePercent: Z(a.draggablePercent) ? a.draggablePercent : d.draggablePercent,
|
|
268
|
+
draggableDirection: a.draggableDirection || d.draggableDirection,
|
|
269
|
+
closeOnClick: $(a.closeOnClick) ? a.closeOnClick : d.closeOnClick,
|
|
270
|
+
progressClassName: te(a.progressClassName || d.progressClassName),
|
|
271
|
+
progressStyle: a.progressStyle || d.progressStyle,
|
|
272
|
+
autoClose: a.isLoading ? !1 : Se(a.autoClose, d.autoClose),
|
|
273
|
+
hideProgressBar: $(a.hideProgressBar) ? a.hideProgressBar : d.hideProgressBar,
|
|
274
|
+
progress: a.progress,
|
|
275
|
+
role: U(a.role) ? a.role : d.role,
|
|
276
|
+
deleteToast: function() {
|
|
277
|
+
L(f);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
D(a.onOpen) && (O.onOpen = a.onOpen), D(a.onClose) && (O.onClose = a.onClose), O.draggableDirection === "y" && O.draggablePercent === 80 && (O.draggablePercent *= 1.5);
|
|
281
|
+
var M = d.closeButton;
|
|
282
|
+
a.closeButton === !1 || le(a.closeButton) ? M = a.closeButton : a.closeButton === !0 && (M = le(d.closeButton) ? d.closeButton : !0), O.closeButton = M;
|
|
283
|
+
var j = i;
|
|
284
|
+
Y(i) && !U(i.type) ? j = ue(i, {
|
|
285
|
+
closeToast: k,
|
|
286
|
+
toastProps: O,
|
|
287
|
+
data: W
|
|
288
|
+
}) : D(i) && (j = i({
|
|
289
|
+
closeToast: k,
|
|
290
|
+
toastProps: O,
|
|
291
|
+
data: W
|
|
292
|
+
})), d.limit && d.limit > 0 && v > d.limit && K ? r.push({
|
|
293
|
+
toastContent: j,
|
|
294
|
+
toastProps: O,
|
|
295
|
+
staleId: I
|
|
296
|
+
}) : Z(y) && y > 0 ? setTimeout(function() {
|
|
297
|
+
R(j, O, I);
|
|
298
|
+
}, y) : R(j, O, I);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function R(i, c, m) {
|
|
302
|
+
var y = c.toastId;
|
|
303
|
+
m && delete h[m], h[y] = {
|
|
304
|
+
content: i,
|
|
305
|
+
props: c
|
|
306
|
+
}, u({
|
|
307
|
+
type: 0,
|
|
308
|
+
toastId: y,
|
|
309
|
+
staleId: m
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
function L(i) {
|
|
313
|
+
delete h[i];
|
|
314
|
+
var c = r.length;
|
|
315
|
+
if (v = ce(i) ? v - 1 : v - l.displayedToast, v < 0 && (v = 0), c > 0) {
|
|
316
|
+
var m = ce(i) ? 1 : l.props.limit;
|
|
317
|
+
if (c === 1 || m === 1)
|
|
318
|
+
l.displayedToast++, P();
|
|
319
|
+
else {
|
|
320
|
+
var y = m > c ? c : m;
|
|
321
|
+
l.displayedToast = y;
|
|
322
|
+
for (var I = 0; I < y; I++)
|
|
323
|
+
P();
|
|
324
|
+
}
|
|
325
|
+
} else
|
|
326
|
+
n();
|
|
327
|
+
}
|
|
328
|
+
function F(i) {
|
|
329
|
+
for (var c = {}, m = e.newestOnTop ? Object.keys(h).reverse() : Object.keys(h), y = 0; y < m.length; y++) {
|
|
330
|
+
var I = h[m[y]], a = I.props.position;
|
|
331
|
+
c[a] || (c[a] = []), c[a].push(I);
|
|
332
|
+
}
|
|
333
|
+
return Object.keys(c).map(function(f) {
|
|
334
|
+
return i(f, c[f]);
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
return {
|
|
338
|
+
getToastToRender: F,
|
|
339
|
+
collection: h,
|
|
340
|
+
containerRef: g,
|
|
341
|
+
isToastActive: b
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
function he(e) {
|
|
345
|
+
return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientX : e.clientX;
|
|
346
|
+
}
|
|
347
|
+
function pe(e) {
|
|
348
|
+
return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientY : e.clientY;
|
|
349
|
+
}
|
|
350
|
+
function je(e) {
|
|
351
|
+
var t = Te(!0), n = t[0], o = t[1], s = Te(!1), u = s[0], g = s[1], v = J(null), r = q({
|
|
352
|
+
start: 0,
|
|
353
|
+
x: 0,
|
|
354
|
+
y: 0,
|
|
355
|
+
delta: 0,
|
|
356
|
+
removalDistance: 0,
|
|
357
|
+
canCloseOnClick: !0,
|
|
358
|
+
canDrag: !1,
|
|
359
|
+
boundingRect: null
|
|
360
|
+
}), h = q(e, !0), l = e.autoClose, b = e.pauseOnHover, C = e.closeToast, T = e.onClick, P = e.closeOnClick;
|
|
361
|
+
z(function() {
|
|
362
|
+
return D(e.onOpen) && e.onOpen(Y(e.children) && e.children.props), function() {
|
|
363
|
+
D(h.onClose) && h.onClose(Y(h.children) && h.children.props);
|
|
364
|
+
};
|
|
365
|
+
}, []), z(function() {
|
|
366
|
+
return e.draggable && c(), function() {
|
|
367
|
+
e.draggable && m();
|
|
368
|
+
};
|
|
369
|
+
}, [e.draggable]), z(function() {
|
|
370
|
+
return e.pauseOnFocusLoss && F(), function() {
|
|
371
|
+
e.pauseOnFocusLoss && i();
|
|
372
|
+
};
|
|
373
|
+
}, [e.pauseOnFocusLoss]);
|
|
374
|
+
function E(f) {
|
|
375
|
+
if (e.draggable) {
|
|
376
|
+
var x = v.current;
|
|
377
|
+
r.canCloseOnClick = !0, r.canDrag = !0, r.boundingRect = x.getBoundingClientRect(), x.style.transition = "", r.x = he(f.nativeEvent), r.y = pe(f.nativeEvent), e.draggableDirection === "x" ? (r.start = r.x, r.removalDistance = x.offsetWidth * (e.draggablePercent / 100)) : (r.start = r.y, r.removalDistance = x.offsetHeight * (e.draggablePercent / 100));
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function N() {
|
|
381
|
+
if (r.boundingRect) {
|
|
382
|
+
var f = r.boundingRect, x = f.top, W = f.bottom, d = f.left, k = f.right;
|
|
383
|
+
e.pauseOnHover && r.x >= d && r.x <= k && r.y >= x && r.y <= W ? L() : R();
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function R() {
|
|
387
|
+
o(!0);
|
|
388
|
+
}
|
|
389
|
+
function L() {
|
|
390
|
+
o(!1);
|
|
391
|
+
}
|
|
392
|
+
function F() {
|
|
393
|
+
document.hasFocus() || L(), window.addEventListener("focus", R), window.addEventListener("blur", L);
|
|
394
|
+
}
|
|
395
|
+
function i() {
|
|
396
|
+
window.removeEventListener("focus", R), window.removeEventListener("blur", L);
|
|
397
|
+
}
|
|
398
|
+
function c() {
|
|
399
|
+
document.addEventListener("mousemove", y), document.addEventListener("mouseup", I), document.addEventListener("touchmove", y), document.addEventListener("touchend", I);
|
|
400
|
+
}
|
|
401
|
+
function m() {
|
|
402
|
+
document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", I), document.removeEventListener("touchmove", y), document.removeEventListener("touchend", I);
|
|
403
|
+
}
|
|
404
|
+
function y(f) {
|
|
405
|
+
if (r.canDrag) {
|
|
406
|
+
f.preventDefault();
|
|
407
|
+
var x = v.current;
|
|
408
|
+
n && L(), r.x = he(f), r.y = pe(f), e.draggableDirection === "x" ? r.delta = r.x - r.start : r.delta = r.y - r.start, r.start !== r.x && (r.canCloseOnClick = !1), x.style.transform = "translate" + e.draggableDirection + "(" + r.delta + "px)", x.style.opacity = "" + (1 - Math.abs(r.delta / r.removalDistance));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function I() {
|
|
412
|
+
var f = v.current;
|
|
413
|
+
if (r.canDrag) {
|
|
414
|
+
if (r.canDrag = !1, Math.abs(r.delta) > r.removalDistance) {
|
|
415
|
+
g(!0), e.closeToast();
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
f.style.transition = "transform 0.2s, opacity 0.2s", f.style.transform = "translate" + e.draggableDirection + "(0)", f.style.opacity = "1";
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
var a = {
|
|
422
|
+
onMouseDown: E,
|
|
423
|
+
onTouchStart: E,
|
|
424
|
+
onMouseUp: N,
|
|
425
|
+
onTouchEnd: N
|
|
426
|
+
};
|
|
427
|
+
return l && b && (a.onMouseEnter = L, a.onMouseLeave = R), P && (a.onClick = function(f) {
|
|
428
|
+
T && T(f), r.canCloseOnClick && C();
|
|
429
|
+
}), {
|
|
430
|
+
playToast: R,
|
|
431
|
+
pauseToast: L,
|
|
432
|
+
isRunning: n,
|
|
433
|
+
preventExitTransition: u,
|
|
434
|
+
toastRef: v,
|
|
435
|
+
eventHandlers: a
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
function Ne(e) {
|
|
439
|
+
var t = e.closeToast, n = e.theme, o = e.ariaLabel, s = o === void 0 ? "close" : o;
|
|
440
|
+
return B("button", {
|
|
441
|
+
className: "Toastify__close-button Toastify__close-button--" + n,
|
|
442
|
+
type: "button",
|
|
443
|
+
onClick: function(g) {
|
|
444
|
+
g.stopPropagation(), t(g);
|
|
445
|
+
},
|
|
446
|
+
"aria-label": s
|
|
447
|
+
}, B("svg", {
|
|
448
|
+
"aria-hidden": "true",
|
|
449
|
+
viewBox: "0 0 14 16"
|
|
450
|
+
}, B("path", {
|
|
451
|
+
fillRule: "evenodd",
|
|
452
|
+
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"
|
|
453
|
+
})));
|
|
454
|
+
}
|
|
455
|
+
function Pe(e) {
|
|
456
|
+
var t, n, o = e.delay, s = e.isRunning, u = e.closeToast, g = e.type, v = e.hide, r = e.className, h = e.style, l = e.controlledProgress, b = e.progress, C = e.rtl, T = e.isIn, P = e.theme, E = _({}, h, {
|
|
457
|
+
animationDuration: o + "ms",
|
|
458
|
+
animationPlayState: s ? "running" : "paused",
|
|
459
|
+
opacity: v ? 0 : 1
|
|
460
|
+
});
|
|
461
|
+
l && (E.transform = "scaleX(" + b + ")");
|
|
462
|
+
var N = H("Toastify__progress-bar", l ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", "Toastify__progress-bar-theme--" + P, "Toastify__progress-bar--" + g, (t = {}, t["Toastify__progress-bar--rtl"] = C, t)), R = D(r) ? r({
|
|
463
|
+
rtl: C,
|
|
464
|
+
type: g,
|
|
465
|
+
defaultClassName: N
|
|
466
|
+
}) : H(N, r), L = (n = {}, n[l && b >= 1 ? "onTransitionEnd" : "onAnimationEnd"] = l && b < 1 ? null : function() {
|
|
467
|
+
T && u();
|
|
468
|
+
}, n);
|
|
469
|
+
return B("div", Object.assign({
|
|
470
|
+
role: "progressbar",
|
|
471
|
+
"aria-hidden": v ? "true" : "false",
|
|
472
|
+
"aria-label": "notification timer",
|
|
473
|
+
className: R,
|
|
474
|
+
style: E
|
|
475
|
+
}, L));
|
|
476
|
+
}
|
|
477
|
+
Pe.defaultProps = {
|
|
478
|
+
type: A.DEFAULT,
|
|
479
|
+
hide: !1
|
|
480
|
+
};
|
|
481
|
+
var He = ["theme", "type"], ne = function(t) {
|
|
482
|
+
var n = t.theme, o = t.type, s = Ee(t, He);
|
|
483
|
+
return S.createElement("svg", Object.assign({
|
|
484
|
+
viewBox: "0 0 24 24",
|
|
485
|
+
width: "100%",
|
|
486
|
+
height: "100%",
|
|
487
|
+
fill: n === "colored" ? "currentColor" : "var(--toastify-icon-color-" + o + ")"
|
|
488
|
+
}, s));
|
|
489
|
+
};
|
|
490
|
+
function ze(e) {
|
|
491
|
+
return S.createElement(ne, Object.assign({}, e), S.createElement("path", {
|
|
492
|
+
d: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"
|
|
493
|
+
}));
|
|
494
|
+
}
|
|
495
|
+
function Ue(e) {
|
|
496
|
+
return S.createElement(ne, Object.assign({}, e), S.createElement("path", {
|
|
497
|
+
d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"
|
|
498
|
+
}));
|
|
499
|
+
}
|
|
500
|
+
function Qe(e) {
|
|
501
|
+
return S.createElement(ne, Object.assign({}, e), S.createElement("path", {
|
|
502
|
+
d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"
|
|
503
|
+
}));
|
|
504
|
+
}
|
|
505
|
+
function We(e) {
|
|
506
|
+
return S.createElement(ne, Object.assign({}, e), S.createElement("path", {
|
|
507
|
+
d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"
|
|
508
|
+
}));
|
|
509
|
+
}
|
|
510
|
+
function qe() {
|
|
511
|
+
return S.createElement("div", {
|
|
512
|
+
className: "Toastify__spinner"
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
var be = {
|
|
516
|
+
info: Ue,
|
|
517
|
+
warning: ze,
|
|
518
|
+
success: Qe,
|
|
519
|
+
error: We,
|
|
520
|
+
spinner: qe
|
|
521
|
+
}, Ge = function(t) {
|
|
522
|
+
var n, o, s = je(t), u = s.isRunning, g = s.preventExitTransition, v = s.toastRef, r = s.eventHandlers, h = t.closeButton, l = t.children, b = t.autoClose, C = t.onClick, T = t.type, P = t.hideProgressBar, E = t.closeToast, N = t.transition, R = t.position, L = t.className, F = t.style, i = t.bodyClassName, c = t.bodyStyle, m = t.progressClassName, y = t.progressStyle, I = t.updateId, a = t.role, f = t.progress, x = t.rtl, W = t.toastId, d = t.deleteToast, k = t.isIn, K = t.isLoading, O = t.icon, M = t.theme, j = H("Toastify__toast", "Toastify__toast-theme--" + M, "Toastify__toast--" + T, (n = {}, n["Toastify__toast--rtl"] = x, n)), re = D(L) ? L({
|
|
523
|
+
rtl: x,
|
|
524
|
+
position: R,
|
|
525
|
+
type: T,
|
|
526
|
+
defaultClassName: j
|
|
527
|
+
}) : H(j, L), se = !!f, ge = be[T], ie = {
|
|
528
|
+
theme: M,
|
|
529
|
+
type: T
|
|
530
|
+
}, Q = ge && ge(ie);
|
|
531
|
+
O === !1 ? Q = void 0 : D(O) ? Q = O(ie) : Y(O) ? Q = ue(O, ie) : U(O) ? Q = O : K && (Q = be.spinner());
|
|
532
|
+
function xe(X) {
|
|
533
|
+
if (X) {
|
|
534
|
+
var me = {
|
|
535
|
+
closeToast: E,
|
|
536
|
+
type: T,
|
|
537
|
+
theme: M
|
|
538
|
+
};
|
|
539
|
+
if (D(X)) return X(me);
|
|
540
|
+
if (Y(X)) return ue(X, me);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return B(N, {
|
|
544
|
+
isIn: k,
|
|
545
|
+
done: d,
|
|
546
|
+
position: R,
|
|
547
|
+
preventExitTransition: g,
|
|
548
|
+
nodeRef: v
|
|
549
|
+
}, B("div", Object.assign({
|
|
550
|
+
id: W,
|
|
551
|
+
onClick: C,
|
|
552
|
+
className: re
|
|
553
|
+
}, r, {
|
|
554
|
+
style: F,
|
|
555
|
+
ref: v
|
|
556
|
+
}), B("div", Object.assign({}, k && {
|
|
557
|
+
role: a
|
|
558
|
+
}, {
|
|
559
|
+
className: D(i) ? i({
|
|
560
|
+
type: T
|
|
561
|
+
}) : H("Toastify__toast-body", i),
|
|
562
|
+
style: c
|
|
563
|
+
}), Q && B("div", {
|
|
564
|
+
className: H("Toastify__toast-icon", (o = {}, o["Toastify--animate-icon Toastify__zoom-enter"] = !K, o))
|
|
565
|
+
}, Q), B("div", null, l)), xe(h), (b || se) && B(Pe, Object.assign({}, I && !se ? {
|
|
566
|
+
key: "pb-" + I
|
|
567
|
+
} : {}, {
|
|
568
|
+
rtl: x,
|
|
569
|
+
theme: M,
|
|
570
|
+
delay: b,
|
|
571
|
+
isRunning: u,
|
|
572
|
+
isIn: k,
|
|
573
|
+
closeToast: E,
|
|
574
|
+
hide: P,
|
|
575
|
+
type: T,
|
|
576
|
+
style: y,
|
|
577
|
+
className: m,
|
|
578
|
+
controlledProgress: se,
|
|
579
|
+
progress: f
|
|
580
|
+
}))));
|
|
581
|
+
}, Ye = /* @__PURE__ */ ke({
|
|
582
|
+
enter: "Toastify--animate Toastify__bounce-enter",
|
|
583
|
+
exit: "Toastify--animate Toastify__bounce-exit",
|
|
584
|
+
appendPosition: !0
|
|
585
|
+
}), Le = function(t) {
|
|
586
|
+
var n = Me(t), o = n.getToastToRender, s = n.containerRef, u = n.isToastActive, g = t.className, v = t.style, r = t.rtl, h = t.containerId;
|
|
587
|
+
function l(b) {
|
|
588
|
+
var C, T = H("Toastify__toast-container", "Toastify__toast-container--" + b, (C = {}, C["Toastify__toast-container--rtl"] = r, C));
|
|
589
|
+
return D(g) ? g({
|
|
590
|
+
position: b,
|
|
591
|
+
rtl: r,
|
|
592
|
+
defaultClassName: T
|
|
593
|
+
}) : H(T, te(g));
|
|
594
|
+
}
|
|
595
|
+
return B("div", {
|
|
596
|
+
ref: s,
|
|
597
|
+
className: "Toastify",
|
|
598
|
+
id: h
|
|
599
|
+
}, o(function(b, C) {
|
|
600
|
+
var T = C.length === 0 ? _({}, v, {
|
|
601
|
+
pointerEvents: "none"
|
|
602
|
+
}) : _({}, v);
|
|
603
|
+
return B("div", {
|
|
604
|
+
className: l(b),
|
|
605
|
+
style: T,
|
|
606
|
+
key: "container-" + b
|
|
607
|
+
}, C.map(function(P) {
|
|
608
|
+
var E = P.content, N = P.props;
|
|
609
|
+
return B(Ge, Object.assign({}, N, {
|
|
610
|
+
isIn: u(N.toastId),
|
|
611
|
+
key: "toast-" + N.key,
|
|
612
|
+
closeButton: N.closeButton === !0 ? Ne : N.closeButton
|
|
613
|
+
}), E);
|
|
614
|
+
}));
|
|
615
|
+
}));
|
|
616
|
+
};
|
|
617
|
+
Le.defaultProps = {
|
|
618
|
+
position: Oe.TOP_RIGHT,
|
|
619
|
+
transition: Ye,
|
|
620
|
+
rtl: !1,
|
|
621
|
+
autoClose: 5e3,
|
|
622
|
+
hideProgressBar: !1,
|
|
623
|
+
closeButton: Ne,
|
|
624
|
+
pauseOnHover: !0,
|
|
625
|
+
pauseOnFocusLoss: !0,
|
|
626
|
+
closeOnClick: !0,
|
|
627
|
+
newestOnTop: !1,
|
|
628
|
+
draggable: !0,
|
|
629
|
+
draggablePercent: 80,
|
|
630
|
+
draggableDirection: "x",
|
|
631
|
+
role: "alert",
|
|
632
|
+
theme: "light"
|
|
633
|
+
};
|
|
634
|
+
var G = /* @__PURE__ */ new Map(), de, V, Re, fe = [], ve = !1;
|
|
635
|
+
function Ke() {
|
|
636
|
+
return G.size > 0;
|
|
637
|
+
}
|
|
638
|
+
function Xe(e, t) {
|
|
639
|
+
var n = t.containerId, o = G.get(n || de);
|
|
640
|
+
return o ? o.getToast(e) : null;
|
|
641
|
+
}
|
|
642
|
+
function De() {
|
|
643
|
+
return Math.random().toString(36).substr(2, 9);
|
|
644
|
+
}
|
|
645
|
+
function $e(e) {
|
|
646
|
+
return e && (U(e.toastId) || Z(e.toastId)) ? e.toastId : De();
|
|
647
|
+
}
|
|
648
|
+
function ee(e, t) {
|
|
649
|
+
return Ke() ? w.emit(
|
|
650
|
+
0,
|
|
651
|
+
e,
|
|
652
|
+
t
|
|
653
|
+
) : (fe.push({
|
|
654
|
+
content: e,
|
|
655
|
+
options: t
|
|
656
|
+
}), ve && Ie && (ve = !1, V = document.createElement("div"), document.body.appendChild(V), _e.render(B(Le, Object.assign({}, Re)), V))), t.toastId;
|
|
657
|
+
}
|
|
658
|
+
function ae(e, t) {
|
|
659
|
+
return _({}, t, {
|
|
660
|
+
type: t && t.type || e,
|
|
661
|
+
toastId: $e(t)
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
var oe = function(t) {
|
|
665
|
+
return function(n, o) {
|
|
666
|
+
return ee(n, ae(t, o));
|
|
667
|
+
};
|
|
668
|
+
}, p = function(t, n) {
|
|
669
|
+
return ee(t, ae(A.DEFAULT, n));
|
|
670
|
+
};
|
|
671
|
+
p.loading = function(e, t) {
|
|
672
|
+
return ee(e, ae(A.DEFAULT, _({
|
|
673
|
+
isLoading: !0,
|
|
674
|
+
autoClose: !1,
|
|
675
|
+
closeOnClick: !1,
|
|
676
|
+
closeButton: !1,
|
|
677
|
+
draggable: !1
|
|
678
|
+
}, t)));
|
|
679
|
+
};
|
|
680
|
+
function Ve(e, t, n) {
|
|
681
|
+
var o = t.pending, s = t.error, u = t.success, g;
|
|
682
|
+
o && (g = U(o) ? p.loading(o, n) : p.loading(o.render, _({}, n, o)));
|
|
683
|
+
var v = {
|
|
684
|
+
isLoading: null,
|
|
685
|
+
autoClose: null,
|
|
686
|
+
closeOnClick: null,
|
|
687
|
+
closeButton: null,
|
|
688
|
+
draggable: null
|
|
689
|
+
}, r = function(b, C, T) {
|
|
690
|
+
var P = _({
|
|
691
|
+
type: b
|
|
692
|
+
}, v, n, {
|
|
693
|
+
data: T
|
|
694
|
+
}), E = U(C) ? {
|
|
695
|
+
render: C
|
|
696
|
+
} : C;
|
|
697
|
+
return g ? p.update(g, _({}, P, E)) : p(E.render, _({}, P, E)), T;
|
|
698
|
+
}, h = D(e) ? e() : e;
|
|
699
|
+
return h.then(function(l) {
|
|
700
|
+
return u && r("success", u, l);
|
|
701
|
+
}).catch(function(l) {
|
|
702
|
+
return s && r("error", s, l);
|
|
703
|
+
}), h;
|
|
704
|
+
}
|
|
705
|
+
p.promise = Ve;
|
|
706
|
+
p.success = /* @__PURE__ */ oe(A.SUCCESS);
|
|
707
|
+
p.info = /* @__PURE__ */ oe(A.INFO);
|
|
708
|
+
p.error = /* @__PURE__ */ oe(A.ERROR);
|
|
709
|
+
p.warning = /* @__PURE__ */ oe(A.WARNING);
|
|
710
|
+
p.warn = p.warning;
|
|
711
|
+
p.dark = function(e, t) {
|
|
712
|
+
return ee(e, ae(A.DEFAULT, _({
|
|
713
|
+
theme: "dark"
|
|
714
|
+
}, t)));
|
|
715
|
+
};
|
|
716
|
+
p.dismiss = function(e) {
|
|
717
|
+
return w.emit(
|
|
718
|
+
1,
|
|
719
|
+
e
|
|
720
|
+
);
|
|
721
|
+
};
|
|
722
|
+
p.clearWaitingQueue = function(e) {
|
|
723
|
+
return e === void 0 && (e = {}), w.emit(
|
|
724
|
+
5,
|
|
725
|
+
e
|
|
726
|
+
);
|
|
727
|
+
};
|
|
728
|
+
p.isActive = function(e) {
|
|
729
|
+
var t = !1;
|
|
730
|
+
return G.forEach(function(n) {
|
|
731
|
+
n.isToastActive && n.isToastActive(e) && (t = !0);
|
|
732
|
+
}), t;
|
|
733
|
+
};
|
|
734
|
+
p.update = function(e, t) {
|
|
735
|
+
t === void 0 && (t = {}), setTimeout(function() {
|
|
736
|
+
var n = Xe(e, t);
|
|
737
|
+
if (n) {
|
|
738
|
+
var o = n.props, s = n.content, u = _({}, o, t, {
|
|
739
|
+
toastId: t.toastId || e,
|
|
740
|
+
updateId: De()
|
|
741
|
+
});
|
|
742
|
+
u.toastId !== e && (u.staleId = e);
|
|
743
|
+
var g = u.render || s;
|
|
744
|
+
delete u.render, ee(g, u);
|
|
745
|
+
}
|
|
746
|
+
}, 0);
|
|
747
|
+
};
|
|
748
|
+
p.done = function(e) {
|
|
749
|
+
p.update(e, {
|
|
750
|
+
progress: 1
|
|
751
|
+
});
|
|
752
|
+
};
|
|
753
|
+
p.onChange = function(e) {
|
|
754
|
+
return D(e) && w.on(
|
|
755
|
+
4,
|
|
756
|
+
e
|
|
757
|
+
), function() {
|
|
758
|
+
D(e) && w.off(
|
|
759
|
+
4,
|
|
760
|
+
e
|
|
761
|
+
);
|
|
762
|
+
};
|
|
763
|
+
};
|
|
764
|
+
p.configure = function(e) {
|
|
765
|
+
e === void 0 && (e = {}), ve = !0, Re = e;
|
|
766
|
+
};
|
|
767
|
+
p.POSITION = Oe;
|
|
768
|
+
p.TYPE = A;
|
|
769
|
+
w.on(
|
|
770
|
+
2,
|
|
771
|
+
function(e) {
|
|
772
|
+
de = e.containerId || e, G.set(de, e), fe.forEach(function(t) {
|
|
773
|
+
w.emit(
|
|
774
|
+
0,
|
|
775
|
+
t.content,
|
|
776
|
+
t.options
|
|
777
|
+
);
|
|
778
|
+
}), fe = [];
|
|
779
|
+
}
|
|
780
|
+
).on(
|
|
781
|
+
3,
|
|
782
|
+
function(e) {
|
|
783
|
+
G.delete(e.containerId || e), G.size === 0 && w.off(
|
|
784
|
+
0
|
|
785
|
+
/* Show */
|
|
786
|
+
).off(
|
|
787
|
+
1
|
|
788
|
+
/* Clear */
|
|
789
|
+
).off(
|
|
790
|
+
5
|
|
791
|
+
/* ClearWaitingQueue */
|
|
792
|
+
), Ie && V && document.body.removeChild(V);
|
|
793
|
+
}
|
|
794
|
+
);
|
|
795
|
+
export {
|
|
796
|
+
Le as T,
|
|
797
|
+
p as t
|
|
798
|
+
};
|