@tedi-design-system/react 16.0.1-rc.1 → 16.1.0-rc.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/_virtual/index.es13.js +2 -2
- package/_virtual/index.es14.js +2 -2
- package/bundle-stats.html +1 -1
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/react-toastify/dist/index.cjs.js +3 -0
- package/external/react-toastify/dist/index.es.js +388 -0
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +4 -4
- package/src/tedi/components/form/file-dropzone/file-dropzone.cjs.js +1 -1
- package/src/tedi/components/form/file-dropzone/file-dropzone.es.js +26 -26
- package/src/tedi/components/notifications/toast/toast.cjs.js +1 -1
- package/src/tedi/components/notifications/toast/toast.es.js +10 -9
- package/src/tedi/components/notifications/toast/toast.module.scss.cjs.js +1 -1
- package/src/tedi/components/notifications/toast/toast.module.scss.es.js +4 -2
- package/src/tedi/providers/theme-provider/theme-provider.cjs.js +1 -1
- package/src/tedi/providers/theme-provider/theme-provider.d.ts +2 -1
- package/src/tedi/providers/theme-provider/theme-provider.es.js +25 -26
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +1 -1
- package/external/react-toastify/dist/react-toastify.esm.cjs.js +0 -2
- package/external/react-toastify/dist/react-toastify.esm.es.js +0 -299
- package/external/react-toastify/external/clsx/dist/clsx.m.cjs.js +0 -1
- package/external/react-toastify/external/clsx/dist/clsx.m.es.js +0 -15
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import h, { forwardRef as pe, useEffect as S, useReducer as me, useState as se, useRef as H, cloneElement as ae, isValidElement as G, useLayoutEffect as fe } from "react";
|
|
3
|
-
import { clsx as P } from "../external/clsx/dist/clsx.m.es.js";
|
|
4
|
-
const W = (e) => typeof e == "number" && !isNaN(e), q = (e) => typeof e == "string", L = (e) => typeof e == "function", V = (e) => q(e) || L(e) ? e : null, te = (e) => G(e) || q(e) || L(e) || W(e);
|
|
5
|
-
function ge(e, t, r) {
|
|
6
|
-
r === void 0 && (r = 300);
|
|
7
|
-
const { scrollHeight: d, style: c } = e;
|
|
8
|
-
requestAnimationFrame(() => {
|
|
9
|
-
c.minHeight = "initial", c.height = d + "px", c.transition = `all ${r}ms`, requestAnimationFrame(() => {
|
|
10
|
-
c.height = "0", c.padding = "0", c.margin = "0", setTimeout(t, r);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
function Z(e) {
|
|
15
|
-
let { enter: t, exit: r, appendPosition: d = !1, collapse: c = !0, collapseDuration: i = 300 } = e;
|
|
16
|
-
return function(n) {
|
|
17
|
-
let { children: o, position: C, preventExitTransition: T, done: y, nodeRef: f, isIn: b } = n;
|
|
18
|
-
const a = d ? `${t}--${C}` : t, u = d ? `${r}--${C}` : r, p = H(0);
|
|
19
|
-
return fe(() => {
|
|
20
|
-
const s = f.current, l = a.split(" "), E = (_) => {
|
|
21
|
-
_.target === f.current && (s.dispatchEvent(new Event("d")), s.removeEventListener("animationend", E), s.removeEventListener("animationcancel", E), p.current === 0 && _.type !== "animationcancel" && s.classList.remove(...l));
|
|
22
|
-
};
|
|
23
|
-
s.classList.add(...l), s.addEventListener("animationend", E), s.addEventListener("animationcancel", E);
|
|
24
|
-
}, []), S(() => {
|
|
25
|
-
const s = f.current, l = () => {
|
|
26
|
-
s.removeEventListener("animationend", l), c ? ge(s, y, i) : y();
|
|
27
|
-
};
|
|
28
|
-
b || (T ? l() : (p.current = 1, s.className += ` ${u}`, s.addEventListener("animationend", l)));
|
|
29
|
-
}, [b]), h.createElement(h.Fragment, null, o);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function re(e, t) {
|
|
33
|
-
return e != null ? { content: e.content, containerId: e.props.containerId, id: e.props.toastId, theme: e.props.theme, type: e.props.type, data: e.props.data || {}, isLoading: e.props.isLoading, icon: e.props.icon, status: t } : {};
|
|
34
|
-
}
|
|
35
|
-
const w = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(), on(e, t) {
|
|
36
|
-
return this.list.has(e) || this.list.set(e, []), this.list.get(e).push(t), this;
|
|
37
|
-
}, off(e, t) {
|
|
38
|
-
if (t) {
|
|
39
|
-
const r = this.list.get(e).filter((d) => d !== t);
|
|
40
|
-
return this.list.set(e, r), this;
|
|
41
|
-
}
|
|
42
|
-
return this.list.delete(e), this;
|
|
43
|
-
}, cancelEmit(e) {
|
|
44
|
-
const t = this.emitQueue.get(e);
|
|
45
|
-
return t && (t.forEach(clearTimeout), this.emitQueue.delete(e)), this;
|
|
46
|
-
}, emit(e) {
|
|
47
|
-
this.list.has(e) && this.list.get(e).forEach((t) => {
|
|
48
|
-
const r = setTimeout(() => {
|
|
49
|
-
t(...[].slice.call(arguments, 1));
|
|
50
|
-
}, 0);
|
|
51
|
-
this.emitQueue.has(e) || this.emitQueue.set(e, []), this.emitQueue.get(e).push(r);
|
|
52
|
-
});
|
|
53
|
-
} }, j = (e) => {
|
|
54
|
-
let { theme: t, type: r, ...d } = e;
|
|
55
|
-
return h.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${r})`, ...d });
|
|
56
|
-
}, ne = { info: function(e) {
|
|
57
|
-
return h.createElement(j, { ...e }, h.createElement("path", { 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" }));
|
|
58
|
-
}, warning: function(e) {
|
|
59
|
-
return h.createElement(j, { ...e }, h.createElement("path", { 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" }));
|
|
60
|
-
}, success: function(e) {
|
|
61
|
-
return h.createElement(j, { ...e }, h.createElement("path", { 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" }));
|
|
62
|
-
}, error: function(e) {
|
|
63
|
-
return h.createElement(j, { ...e }, h.createElement("path", { 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" }));
|
|
64
|
-
}, spinner: function() {
|
|
65
|
-
return h.createElement("div", { className: "Toastify__spinner" });
|
|
66
|
-
} };
|
|
67
|
-
function he(e) {
|
|
68
|
-
const [, t] = me((a) => a + 1, 0), [r, d] = se([]), c = H(null), i = H(/* @__PURE__ */ new Map()).current, n = (a) => r.indexOf(a) !== -1, o = H({ toastKey: 1, displayedToast: 0, count: 0, queue: [], props: e, containerId: null, isToastActive: n, getToast: (a) => i.get(a) }).current;
|
|
69
|
-
function C(a) {
|
|
70
|
-
let { containerId: u } = a;
|
|
71
|
-
const { limit: p } = o.props;
|
|
72
|
-
!p || u && o.containerId !== u || (o.count -= o.queue.length, o.queue = []);
|
|
73
|
-
}
|
|
74
|
-
function T(a) {
|
|
75
|
-
d((u) => a == null ? [] : u.filter((p) => p !== a));
|
|
76
|
-
}
|
|
77
|
-
function y() {
|
|
78
|
-
const { toastContent: a, toastProps: u, staleId: p } = o.queue.shift();
|
|
79
|
-
b(a, u, p);
|
|
80
|
-
}
|
|
81
|
-
function f(a, u) {
|
|
82
|
-
let { delay: p, staleId: s, ...l } = u;
|
|
83
|
-
if (!te(a) || function(R) {
|
|
84
|
-
return !c.current || o.props.enableMultiContainer && R.containerId !== o.props.containerId || i.has(R.toastId) && R.updateId == null;
|
|
85
|
-
}(l)) return;
|
|
86
|
-
const { toastId: E, updateId: _, data: m } = l, { props: g } = o, k = () => T(E), B = _ == null;
|
|
87
|
-
B && o.count++;
|
|
88
|
-
const I = { ...g, style: g.toastStyle, key: o.toastKey++, ...Object.fromEntries(Object.entries(l).filter((R) => {
|
|
89
|
-
let [M, O] = R;
|
|
90
|
-
return O != null;
|
|
91
|
-
})), toastId: E, updateId: _, data: m, closeToast: k, isIn: !1, className: V(l.className || g.toastClassName), bodyClassName: V(l.bodyClassName || g.bodyClassName), progressClassName: V(l.progressClassName || g.progressClassName), autoClose: !l.isLoading && ($ = l.autoClose, Q = g.autoClose, $ === !1 || W($) && $ > 0 ? $ : Q), deleteToast() {
|
|
92
|
-
const R = re(i.get(E), "removed");
|
|
93
|
-
i.delete(E), w.emit(4, R);
|
|
94
|
-
const M = o.queue.length;
|
|
95
|
-
if (o.count = E == null ? o.count - o.displayedToast : o.count - 1, o.count < 0 && (o.count = 0), M > 0) {
|
|
96
|
-
const O = E == null ? o.props.limit : 1;
|
|
97
|
-
if (M === 1 || O === 1) o.displayedToast++, y();
|
|
98
|
-
else {
|
|
99
|
-
const A = O > M ? M : O;
|
|
100
|
-
o.displayedToast = A;
|
|
101
|
-
for (let N = 0; N < A; N++) y();
|
|
102
|
-
}
|
|
103
|
-
} else t();
|
|
104
|
-
} };
|
|
105
|
-
var $, Q;
|
|
106
|
-
I.iconOut = function(R) {
|
|
107
|
-
let { theme: M, type: O, isLoading: A, icon: N } = R, x = null;
|
|
108
|
-
const z = { theme: M, type: O };
|
|
109
|
-
return N === !1 || (L(N) ? x = N(z) : G(N) ? x = ae(N, z) : q(N) || W(N) ? x = N : A ? x = ne.spinner() : ((Y) => Y in ne)(O) && (x = ne[O](z))), x;
|
|
110
|
-
}(I), L(l.onOpen) && (I.onOpen = l.onOpen), L(l.onClose) && (I.onClose = l.onClose), I.closeButton = g.closeButton, l.closeButton === !1 || te(l.closeButton) ? I.closeButton = l.closeButton : l.closeButton === !0 && (I.closeButton = !te(g.closeButton) || g.closeButton);
|
|
111
|
-
let D = a;
|
|
112
|
-
G(a) && !q(a.type) ? D = ae(a, { closeToast: k, toastProps: I, data: m }) : L(a) && (D = a({ closeToast: k, toastProps: I, data: m })), g.limit && g.limit > 0 && o.count > g.limit && B ? o.queue.push({ toastContent: D, toastProps: I, staleId: s }) : W(p) ? setTimeout(() => {
|
|
113
|
-
b(D, I, s);
|
|
114
|
-
}, p) : b(D, I, s);
|
|
115
|
-
}
|
|
116
|
-
function b(a, u, p) {
|
|
117
|
-
const { toastId: s } = u;
|
|
118
|
-
p && i.delete(p);
|
|
119
|
-
const l = { content: a, props: u };
|
|
120
|
-
i.set(s, l), d((E) => [...E, s].filter((_) => _ !== p)), w.emit(4, re(l, l.props.updateId == null ? "added" : "updated"));
|
|
121
|
-
}
|
|
122
|
-
return S(() => (o.containerId = e.containerId, w.cancelEmit(3).on(0, f).on(1, (a) => c.current && T(a)).on(5, C).emit(2, o), () => {
|
|
123
|
-
i.clear(), w.emit(3, o);
|
|
124
|
-
}), []), S(() => {
|
|
125
|
-
o.props = e, o.isToastActive = n, o.displayedToast = r.length;
|
|
126
|
-
}), { getToastToRender: function(a) {
|
|
127
|
-
const u = /* @__PURE__ */ new Map(), p = Array.from(i.values());
|
|
128
|
-
return e.newestOnTop && p.reverse(), p.forEach((s) => {
|
|
129
|
-
const { position: l } = s.props;
|
|
130
|
-
u.has(l) || u.set(l, []), u.get(l).push(s);
|
|
131
|
-
}), Array.from(u, (s) => a(s[0], s[1]));
|
|
132
|
-
}, containerRef: c, isToastActive: n };
|
|
133
|
-
}
|
|
134
|
-
function ie(e) {
|
|
135
|
-
return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientX : e.clientX;
|
|
136
|
-
}
|
|
137
|
-
function le(e) {
|
|
138
|
-
return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientY : e.clientY;
|
|
139
|
-
}
|
|
140
|
-
function ye(e) {
|
|
141
|
-
const [t, r] = se(!1), [d, c] = se(!1), i = H(null), n = H({ start: 0, x: 0, y: 0, delta: 0, removalDistance: 0, canCloseOnClick: !0, canDrag: !1, boundingRect: null, didMove: !1 }).current, o = H(e), { autoClose: C, pauseOnHover: T, closeToast: y, onClick: f, closeOnClick: b } = e;
|
|
142
|
-
function a(m) {
|
|
143
|
-
if (e.draggable) {
|
|
144
|
-
m.nativeEvent.type === "touchstart" && m.nativeEvent.preventDefault(), n.didMove = !1, document.addEventListener("mousemove", l), document.addEventListener("mouseup", E), document.addEventListener("touchmove", l), document.addEventListener("touchend", E);
|
|
145
|
-
const g = i.current;
|
|
146
|
-
n.canCloseOnClick = !0, n.canDrag = !0, n.boundingRect = g.getBoundingClientRect(), g.style.transition = "", n.x = ie(m.nativeEvent), n.y = le(m.nativeEvent), e.draggableDirection === "x" ? (n.start = n.x, n.removalDistance = g.offsetWidth * (e.draggablePercent / 100)) : (n.start = n.y, n.removalDistance = g.offsetHeight * (e.draggablePercent === 80 ? 1.5 * e.draggablePercent : e.draggablePercent / 100));
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function u(m) {
|
|
150
|
-
if (n.boundingRect) {
|
|
151
|
-
const { top: g, bottom: k, left: B, right: I } = n.boundingRect;
|
|
152
|
-
m.nativeEvent.type !== "touchend" && e.pauseOnHover && n.x >= B && n.x <= I && n.y >= g && n.y <= k ? s() : p();
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
function p() {
|
|
156
|
-
r(!0);
|
|
157
|
-
}
|
|
158
|
-
function s() {
|
|
159
|
-
r(!1);
|
|
160
|
-
}
|
|
161
|
-
function l(m) {
|
|
162
|
-
const g = i.current;
|
|
163
|
-
n.canDrag && g && (n.didMove = !0, t && s(), n.x = ie(m), n.y = le(m), n.delta = e.draggableDirection === "x" ? n.x - n.start : n.y - n.start, n.start !== n.x && (n.canCloseOnClick = !1), g.style.transform = `translate${e.draggableDirection}(${n.delta}px)`, g.style.opacity = "" + (1 - Math.abs(n.delta / n.removalDistance)));
|
|
164
|
-
}
|
|
165
|
-
function E() {
|
|
166
|
-
document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", E), document.removeEventListener("touchmove", l), document.removeEventListener("touchend", E);
|
|
167
|
-
const m = i.current;
|
|
168
|
-
if (n.canDrag && n.didMove && m) {
|
|
169
|
-
if (n.canDrag = !1, Math.abs(n.delta) > n.removalDistance) return c(!0), void e.closeToast();
|
|
170
|
-
m.style.transition = "transform 0.2s, opacity 0.2s", m.style.transform = `translate${e.draggableDirection}(0)`, m.style.opacity = "1";
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
S(() => {
|
|
174
|
-
o.current = e;
|
|
175
|
-
}), S(() => (i.current && i.current.addEventListener("d", p, { once: !0 }), L(e.onOpen) && e.onOpen(G(e.children) && e.children.props), () => {
|
|
176
|
-
const m = o.current;
|
|
177
|
-
L(m.onClose) && m.onClose(G(m.children) && m.children.props);
|
|
178
|
-
}), []), S(() => (e.pauseOnFocusLoss && (document.hasFocus() || s(), window.addEventListener("focus", p), window.addEventListener("blur", s)), () => {
|
|
179
|
-
e.pauseOnFocusLoss && (window.removeEventListener("focus", p), window.removeEventListener("blur", s));
|
|
180
|
-
}), [e.pauseOnFocusLoss]);
|
|
181
|
-
const _ = { onMouseDown: a, onTouchStart: a, onMouseUp: u, onTouchEnd: u };
|
|
182
|
-
return C && T && (_.onMouseEnter = s, _.onMouseLeave = p), b && (_.onClick = (m) => {
|
|
183
|
-
f && f(m), n.canCloseOnClick && y();
|
|
184
|
-
}), { playToast: p, pauseToast: s, isRunning: t, preventExitTransition: d, toastRef: i, eventHandlers: _ };
|
|
185
|
-
}
|
|
186
|
-
function ue(e) {
|
|
187
|
-
let { closeToast: t, theme: r, ariaLabel: d = "close" } = e;
|
|
188
|
-
return h.createElement("button", { className: `Toastify__close-button Toastify__close-button--${r}`, type: "button", onClick: (c) => {
|
|
189
|
-
c.stopPropagation(), t(c);
|
|
190
|
-
}, "aria-label": d }, h.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, h.createElement("path", { fillRule: "evenodd", 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" })));
|
|
191
|
-
}
|
|
192
|
-
function ve(e) {
|
|
193
|
-
let { delay: t, isRunning: r, closeToast: d, type: c = "default", hide: i, className: n, style: o, controlledProgress: C, progress: T, rtl: y, isIn: f, theme: b } = e;
|
|
194
|
-
const a = i || C && T === 0, u = { ...o, animationDuration: `${t}ms`, animationPlayState: r ? "running" : "paused", opacity: a ? 0 : 1 };
|
|
195
|
-
C && (u.transform = `scaleX(${T})`);
|
|
196
|
-
const p = P("Toastify__progress-bar", C ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${b}`, `Toastify__progress-bar--${c}`, { "Toastify__progress-bar--rtl": y }), s = L(n) ? n({ rtl: y, type: c, defaultClassName: p }) : P(p, n);
|
|
197
|
-
return h.createElement("div", { role: "progressbar", "aria-hidden": a ? "true" : "false", "aria-label": "notification timer", className: s, style: u, [C && T >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: C && T < 1 ? null : () => {
|
|
198
|
-
f && d();
|
|
199
|
-
} });
|
|
200
|
-
}
|
|
201
|
-
const Te = (e) => {
|
|
202
|
-
const { isRunning: t, preventExitTransition: r, toastRef: d, eventHandlers: c } = ye(e), { closeButton: i, children: n, autoClose: o, onClick: C, type: T, hideProgressBar: y, closeToast: f, transition: b, position: a, className: u, style: p, bodyClassName: s, bodyStyle: l, progressClassName: E, progressStyle: _, updateId: m, role: g, progress: k, rtl: B, toastId: I, deleteToast: $, isIn: Q, isLoading: D, iconOut: R, closeOnClick: M, theme: O } = e, A = P("Toastify__toast", `Toastify__toast-theme--${O}`, `Toastify__toast--${T}`, { "Toastify__toast--rtl": B }, { "Toastify__toast--close-on-click": M }), N = L(u) ? u({ rtl: B, position: a, type: T, defaultClassName: A }) : P(A, u), x = !!k || !o, z = { closeToast: f, type: T, theme: O };
|
|
203
|
-
let Y = null;
|
|
204
|
-
return i === !1 || (Y = L(i) ? i(z) : G(i) ? ae(i, z) : ue(z)), h.createElement(b, { isIn: Q, done: $, position: a, preventExitTransition: r, nodeRef: d }, h.createElement("div", { id: I, onClick: C, className: N, ...c, style: p, ref: d }, h.createElement("div", { ...Q && { role: g }, className: L(s) ? s({ type: T }) : P("Toastify__toast-body", s), style: l }, R != null && h.createElement("div", { className: P("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !D }) }, R), h.createElement("div", null, n)), Y, h.createElement(ve, { ...m && !x ? { key: `pb-${m}` } : {}, rtl: B, theme: O, delay: o, isRunning: t, isIn: Q, closeToast: f, hide: y, type: T, style: _, className: E, controlledProgress: x, progress: k || 0 })));
|
|
205
|
-
}, ee = function(e, t) {
|
|
206
|
-
return t === void 0 && (t = !1), { enter: `Toastify--animate Toastify__${e}-enter`, exit: `Toastify--animate Toastify__${e}-exit`, appendPosition: t };
|
|
207
|
-
}, Ee = Z(ee("bounce", !0)), Le = Z(ee("slide", !0));
|
|
208
|
-
Z(ee("zoom"));
|
|
209
|
-
Z(ee("flip"));
|
|
210
|
-
const ce = pe((e, t) => {
|
|
211
|
-
const { getToastToRender: r, containerRef: d, isToastActive: c } = he(e), { className: i, style: n, rtl: o, containerId: C } = e;
|
|
212
|
-
function T(y) {
|
|
213
|
-
const f = P("Toastify__toast-container", `Toastify__toast-container--${y}`, { "Toastify__toast-container--rtl": o });
|
|
214
|
-
return L(i) ? i({ position: y, rtl: o, defaultClassName: f }) : P(f, V(i));
|
|
215
|
-
}
|
|
216
|
-
return S(() => {
|
|
217
|
-
t && (t.current = d.current);
|
|
218
|
-
}, []), h.createElement("div", { ref: d, className: "Toastify", id: C }, r((y, f) => {
|
|
219
|
-
const b = f.length ? { ...n } : { ...n, pointerEvents: "none" };
|
|
220
|
-
return h.createElement("div", { className: T(y), style: b, key: `container-${y}` }, f.map((a, u) => {
|
|
221
|
-
let { content: p, props: s } = a;
|
|
222
|
-
return h.createElement(Te, { ...s, isIn: c(s.toastId), style: { ...s.style, "--nth": u + 1, "--len": f.length }, key: `toast-${s.key}` }, p);
|
|
223
|
-
}));
|
|
224
|
-
}));
|
|
225
|
-
});
|
|
226
|
-
ce.displayName = "ToastContainer", ce.defaultProps = { position: "top-right", transition: Ee, autoClose: 5e3, closeButton: ue, pauseOnHover: !0, pauseOnFocusLoss: !0, closeOnClick: !0, draggable: !0, draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" };
|
|
227
|
-
let oe, F = /* @__PURE__ */ new Map(), U = [], Ce = 1;
|
|
228
|
-
function de() {
|
|
229
|
-
return "" + Ce++;
|
|
230
|
-
}
|
|
231
|
-
function be(e) {
|
|
232
|
-
return e && (q(e.toastId) || W(e.toastId)) ? e.toastId : de();
|
|
233
|
-
}
|
|
234
|
-
function X(e, t) {
|
|
235
|
-
return F.size > 0 ? w.emit(0, e, t) : U.push({ content: e, options: t }), t.toastId;
|
|
236
|
-
}
|
|
237
|
-
function J(e, t) {
|
|
238
|
-
return { ...t, type: t && t.type || e, toastId: be(t) };
|
|
239
|
-
}
|
|
240
|
-
function K(e) {
|
|
241
|
-
return (t, r) => X(t, J(e, r));
|
|
242
|
-
}
|
|
243
|
-
function v(e, t) {
|
|
244
|
-
return X(e, J("default", t));
|
|
245
|
-
}
|
|
246
|
-
v.loading = (e, t) => X(e, J("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...t })), v.promise = function(e, t, r) {
|
|
247
|
-
let d, { pending: c, error: i, success: n } = t;
|
|
248
|
-
c && (d = q(c) ? v.loading(c, r) : v.loading(c.render, { ...r, ...c }));
|
|
249
|
-
const o = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, C = (y, f, b) => {
|
|
250
|
-
if (f == null) return void v.dismiss(d);
|
|
251
|
-
const a = { type: y, ...o, ...r, data: b }, u = q(f) ? { render: f } : f;
|
|
252
|
-
return d ? v.update(d, { ...a, ...u }) : v(u.render, { ...a, ...u }), b;
|
|
253
|
-
}, T = L(e) ? e() : e;
|
|
254
|
-
return T.then((y) => C("success", n, y)).catch((y) => C("error", i, y)), T;
|
|
255
|
-
}, v.success = K("success"), v.info = K("info"), v.error = K("error"), v.warning = K("warning"), v.warn = v.warning, v.dark = (e, t) => X(e, J("default", { theme: "dark", ...t })), v.dismiss = (e) => {
|
|
256
|
-
F.size > 0 ? w.emit(1, e) : U = U.filter((t) => e != null && t.options.toastId !== e);
|
|
257
|
-
}, v.clearWaitingQueue = function(e) {
|
|
258
|
-
return e === void 0 && (e = {}), w.emit(5, e);
|
|
259
|
-
}, v.isActive = (e) => {
|
|
260
|
-
let t = !1;
|
|
261
|
-
return F.forEach((r) => {
|
|
262
|
-
r.isToastActive && r.isToastActive(e) && (t = !0);
|
|
263
|
-
}), t;
|
|
264
|
-
}, v.update = function(e, t) {
|
|
265
|
-
t === void 0 && (t = {}), setTimeout(() => {
|
|
266
|
-
const r = function(d, c) {
|
|
267
|
-
let { containerId: i } = c;
|
|
268
|
-
const n = F.get(i || oe);
|
|
269
|
-
return n && n.getToast(d);
|
|
270
|
-
}(e, t);
|
|
271
|
-
if (r) {
|
|
272
|
-
const { props: d, content: c } = r, i = { delay: 100, ...d, ...t, toastId: t.toastId || e, updateId: de() };
|
|
273
|
-
i.toastId !== e && (i.staleId = e);
|
|
274
|
-
const n = i.render || c;
|
|
275
|
-
delete i.render, X(n, i);
|
|
276
|
-
}
|
|
277
|
-
}, 0);
|
|
278
|
-
}, v.done = (e) => {
|
|
279
|
-
v.update(e, { progress: 1 });
|
|
280
|
-
}, v.onChange = (e) => (w.on(4, e), () => {
|
|
281
|
-
w.off(4, e);
|
|
282
|
-
}), v.POSITION = { TOP_LEFT: "top-left", TOP_RIGHT: "top-right", TOP_CENTER: "top-center", BOTTOM_LEFT: "bottom-left", BOTTOM_RIGHT: "bottom-right", BOTTOM_CENTER: "bottom-center" }, v.TYPE = { INFO: "info", SUCCESS: "success", WARNING: "warning", ERROR: "error", DEFAULT: "default" }, w.on(2, (e) => {
|
|
283
|
-
oe = e.containerId || e, F.set(oe, e), U.forEach((t) => {
|
|
284
|
-
w.emit(0, t.content, t.options);
|
|
285
|
-
}), U = [];
|
|
286
|
-
}).on(3, (e) => {
|
|
287
|
-
F.delete(e.containerId || e), F.size === 0 && w.off(0).off(1).off(5);
|
|
288
|
-
});
|
|
289
|
-
export {
|
|
290
|
-
Ee as Bounce,
|
|
291
|
-
ne as Icons,
|
|
292
|
-
Le as Slide,
|
|
293
|
-
ce as ToastContainer,
|
|
294
|
-
ge as collapseToast,
|
|
295
|
-
Z as cssTransition,
|
|
296
|
-
v as toast,
|
|
297
|
-
ye as useToast,
|
|
298
|
-
he as useToastContainer
|
|
299
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function u(r){var e,o,t="";if(typeof r=="string"||typeof r=="number")t+=r;else if(typeof r=="object")if(Array.isArray(r))for(e=0;e<r.length;e++)r[e]&&(o=u(r[e]))&&(t&&(t+=" "),t+=o);else for(e in r)r[e]&&(t&&(t+=" "),t+=e);return t}function f(){for(var r,e,o=0,t="";o<arguments.length;)(r=arguments[o++])&&(e=u(r))&&(t&&(t+=" "),t+=e);return t}exports.clsx=f;exports.default=f;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
function o(r) {
|
|
2
|
-
var f, n, t = "";
|
|
3
|
-
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
-
else if (typeof r == "object") if (Array.isArray(r)) for (f = 0; f < r.length; f++) r[f] && (n = o(r[f])) && (t && (t += " "), t += n);
|
|
5
|
-
else for (f in r) r[f] && (t && (t += " "), t += f);
|
|
6
|
-
return t;
|
|
7
|
-
}
|
|
8
|
-
function a() {
|
|
9
|
-
for (var r, f, n = 0, t = ""; n < arguments.length; ) (r = arguments[n++]) && (f = o(r)) && (t && (t += " "), t += f);
|
|
10
|
-
return t;
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
a as clsx,
|
|
14
|
-
a as default
|
|
15
|
-
};
|