vue-toastflow 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/toastflow.es.js +488 -377
- package/dist/toastflow.umd.js +1 -1
- package/dist/vue-toastflow.css +1 -1
- package/package.json +12 -3
- package/src/components/Toast.vue +103 -62
- package/src/components/ToastContainer.vue +364 -352
- package/src/styles.css +6 -0
package/dist/toastflow.es.js
CHANGED
|
@@ -1,192 +1,198 @@
|
|
|
1
|
-
import { createToastStore as
|
|
1
|
+
import { createToastStore as xe } from "toastflow-core";
|
|
2
2
|
export * from "toastflow-core";
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { defineComponent as se, createElementBlock as f, openBlock as d, createElementVNode as m, normalizeClass as S, toRefs as $e, inject as me, computed as v, ref as k, watch as W, unref as e, createCommentVNode as j, renderSlot as K, createBlock as oe, resolveDynamicComponent as Me, toDisplayString as ne, normalizeStyle as D, withModifiers as Te, createVNode as he, onMounted as Se, onUnmounted as He, Fragment as pe, renderList as ve, TransitionGroup as Be, withCtx as Ke } from "vue";
|
|
4
|
+
const re = Symbol.for(
|
|
5
|
+
"vue-toastflow.toast-store"
|
|
6
|
+
), ge = "__vue_toastflow_store__";
|
|
7
|
+
let R = null;
|
|
8
|
+
function We(o) {
|
|
9
|
+
R = o;
|
|
10
|
+
try {
|
|
11
|
+
globalThis[ge] = o;
|
|
12
|
+
} catch {
|
|
13
|
+
}
|
|
8
14
|
}
|
|
9
|
-
function
|
|
10
|
-
if (!
|
|
15
|
+
function p() {
|
|
16
|
+
if (R || (R = globalThis[ge] ?? null), !R)
|
|
11
17
|
throw new Error(
|
|
12
18
|
"[vue-toastflow] Toast store not initialized. Did you install the plugin?"
|
|
13
19
|
);
|
|
14
|
-
return
|
|
20
|
+
return R;
|
|
15
21
|
}
|
|
16
|
-
const
|
|
22
|
+
const St = {
|
|
17
23
|
getState() {
|
|
18
|
-
return
|
|
24
|
+
return p().getState();
|
|
19
25
|
},
|
|
20
|
-
subscribeEvents(
|
|
21
|
-
return
|
|
26
|
+
subscribeEvents(o) {
|
|
27
|
+
return p().subscribeEvents(o);
|
|
22
28
|
},
|
|
23
|
-
show(
|
|
24
|
-
return
|
|
29
|
+
show(o) {
|
|
30
|
+
return p().show(o);
|
|
25
31
|
},
|
|
26
|
-
loading(
|
|
27
|
-
return
|
|
32
|
+
loading(o, i) {
|
|
33
|
+
return p().loading(o, i);
|
|
28
34
|
},
|
|
29
|
-
update(
|
|
30
|
-
return
|
|
35
|
+
update(o, i) {
|
|
36
|
+
return p().update(o, i);
|
|
31
37
|
},
|
|
32
|
-
dismiss(
|
|
33
|
-
return
|
|
38
|
+
dismiss(o) {
|
|
39
|
+
return p().dismiss(o);
|
|
34
40
|
},
|
|
35
41
|
dismissAll() {
|
|
36
|
-
return
|
|
42
|
+
return p().dismissAll();
|
|
37
43
|
},
|
|
38
|
-
pause(
|
|
39
|
-
return
|
|
44
|
+
pause(o) {
|
|
45
|
+
return p().pause(o);
|
|
40
46
|
},
|
|
41
|
-
resume(
|
|
42
|
-
return
|
|
47
|
+
resume(o) {
|
|
48
|
+
return p().resume(o);
|
|
43
49
|
},
|
|
44
50
|
getConfig() {
|
|
45
|
-
return
|
|
51
|
+
return p().getConfig();
|
|
46
52
|
},
|
|
47
|
-
toast(
|
|
48
|
-
return
|
|
53
|
+
toast(o) {
|
|
54
|
+
return p().show({ ...o, type: "default" });
|
|
49
55
|
},
|
|
50
|
-
success(
|
|
51
|
-
return
|
|
56
|
+
success(o) {
|
|
57
|
+
return p().show({ ...o, type: "success" });
|
|
52
58
|
},
|
|
53
|
-
error(
|
|
54
|
-
return
|
|
59
|
+
error(o) {
|
|
60
|
+
return p().show({ ...o, type: "error" });
|
|
55
61
|
},
|
|
56
|
-
info(
|
|
57
|
-
return
|
|
62
|
+
info(o) {
|
|
63
|
+
return p().show({ ...o, type: "info" });
|
|
58
64
|
},
|
|
59
|
-
warning(
|
|
60
|
-
return
|
|
65
|
+
warning(o) {
|
|
66
|
+
return p().show({ ...o, type: "warning" });
|
|
61
67
|
}
|
|
62
68
|
};
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
install(
|
|
67
|
-
|
|
69
|
+
function Ht(o = {}) {
|
|
70
|
+
const i = xe(o);
|
|
71
|
+
return We(i), {
|
|
72
|
+
install(L) {
|
|
73
|
+
L.provide(re, i);
|
|
68
74
|
}
|
|
69
75
|
};
|
|
70
76
|
}
|
|
71
|
-
const
|
|
77
|
+
const Pe = { class: "tf-toast-progress" }, Ee = /* @__PURE__ */ se({
|
|
72
78
|
__name: "ToastProgress",
|
|
73
79
|
props: {
|
|
74
80
|
type: {}
|
|
75
81
|
},
|
|
76
|
-
setup(
|
|
77
|
-
return (
|
|
78
|
-
|
|
79
|
-
class:
|
|
82
|
+
setup(o) {
|
|
83
|
+
return (i, L) => (d(), f("div", Pe, [
|
|
84
|
+
m("div", {
|
|
85
|
+
class: S(["tf-toast-progress-bar", `tf-toast-progress-bar--${o.type}`])
|
|
80
86
|
}, null, 2)
|
|
81
87
|
]));
|
|
82
88
|
}
|
|
83
|
-
}),
|
|
84
|
-
const
|
|
85
|
-
for (const [
|
|
86
|
-
|
|
87
|
-
return
|
|
88
|
-
},
|
|
89
|
+
}), b = (o, i) => {
|
|
90
|
+
const L = o.__vccOpts || o;
|
|
91
|
+
for (const [s, C] of i)
|
|
92
|
+
L[s] = C;
|
|
93
|
+
return L;
|
|
94
|
+
}, Ze = /* @__PURE__ */ b(Ee, [["__scopeId", "data-v-ca0da064"]]), Oe = {}, Ie = {
|
|
89
95
|
xmlns: "http://www.w3.org/2000/svg",
|
|
90
96
|
viewBox: "0 0 24 24",
|
|
91
97
|
fill: "currentColor"
|
|
92
98
|
};
|
|
93
|
-
function
|
|
94
|
-
return
|
|
95
|
-
|
|
99
|
+
function je(o, i) {
|
|
100
|
+
return d(), f("svg", Ie, [...i[0] || (i[0] = [
|
|
101
|
+
m("path", {
|
|
96
102
|
"fill-rule": "evenodd",
|
|
97
103
|
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
|
|
98
104
|
"clip-rule": "evenodd"
|
|
99
105
|
}, null, -1)
|
|
100
106
|
])]);
|
|
101
107
|
}
|
|
102
|
-
const
|
|
108
|
+
const De = /* @__PURE__ */ b(Oe, [["render", je]]), Re = {}, Ue = {
|
|
103
109
|
xmlns: "http://www.w3.org/2000/svg",
|
|
104
110
|
viewBox: "0 0 24 24",
|
|
105
111
|
fill: "currentColor"
|
|
106
112
|
};
|
|
107
|
-
function
|
|
108
|
-
return
|
|
109
|
-
|
|
113
|
+
function Fe(o, i) {
|
|
114
|
+
return d(), f("svg", Ue, [...i[0] || (i[0] = [
|
|
115
|
+
m("path", {
|
|
110
116
|
"fill-rule": "evenodd",
|
|
111
117
|
d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",
|
|
112
118
|
"clip-rule": "evenodd"
|
|
113
119
|
}, null, -1)
|
|
114
120
|
])]);
|
|
115
121
|
}
|
|
116
|
-
const
|
|
122
|
+
const ze = /* @__PURE__ */ b(Re, [["render", Fe]]), Ne = {}, Ve = {
|
|
117
123
|
xmlns: "http://www.w3.org/2000/svg",
|
|
118
124
|
viewBox: "0 0 24 24",
|
|
119
125
|
fill: "currentColor"
|
|
120
126
|
};
|
|
121
|
-
function
|
|
122
|
-
return
|
|
123
|
-
|
|
127
|
+
function Xe(o, i) {
|
|
128
|
+
return d(), f("svg", Ve, [...i[0] || (i[0] = [
|
|
129
|
+
m("path", {
|
|
124
130
|
"fill-rule": "evenodd",
|
|
125
131
|
d: "M5.25 9a6.75 6.75 0 0 1 13.5 0v.75c0 2.123.8 4.057 2.118 5.52a.75.75 0 0 1-.297 1.206c-1.544.57-3.16.99-4.831 1.243a3.75 3.75 0 1 1-7.48 0 24.585 24.585 0 0 1-4.831-1.244.75.75 0 0 1-.298-1.205A8.217 8.217 0 0 0 5.25 9.75V9Zm4.502 8.9a2.25 2.25 0 1 0 4.496 0 25.057 25.057 0 0 1-4.496 0Z",
|
|
126
132
|
"clip-rule": "evenodd"
|
|
127
133
|
}, null, -1)
|
|
128
134
|
])]);
|
|
129
135
|
}
|
|
130
|
-
const
|
|
136
|
+
const qe = /* @__PURE__ */ b(Ne, [["render", Xe]]), Ge = {}, Qe = {
|
|
131
137
|
xmlns: "http://www.w3.org/2000/svg",
|
|
132
138
|
viewBox: "0 0 24 24",
|
|
133
139
|
fill: "currentColor"
|
|
134
140
|
};
|
|
135
|
-
function
|
|
136
|
-
return
|
|
137
|
-
|
|
141
|
+
function Ye(o, i) {
|
|
142
|
+
return d(), f("svg", Qe, [...i[0] || (i[0] = [
|
|
143
|
+
m("path", {
|
|
138
144
|
"fill-rule": "evenodd",
|
|
139
145
|
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
|
|
140
146
|
"clip-rule": "evenodd"
|
|
141
147
|
}, null, -1)
|
|
142
148
|
])]);
|
|
143
149
|
}
|
|
144
|
-
const
|
|
150
|
+
const Je = /* @__PURE__ */ b(Ge, [["render", Ye]]), et = {}, tt = {
|
|
145
151
|
xmlns: "http://www.w3.org/2000/svg",
|
|
146
152
|
viewBox: "0 0 24 24",
|
|
147
153
|
fill: "currentColor"
|
|
148
154
|
};
|
|
149
|
-
function
|
|
150
|
-
return
|
|
151
|
-
|
|
155
|
+
function nt(o, i) {
|
|
156
|
+
return d(), f("svg", tt, [...i[0] || (i[0] = [
|
|
157
|
+
m("path", {
|
|
152
158
|
"fill-rule": "evenodd",
|
|
153
159
|
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm11.378-3.917c-.89-.777-2.366-.777-3.255 0a.75.75 0 0 1-.988-1.129c1.454-1.272 3.776-1.272 5.23 0 1.513 1.324 1.513 3.518 0 4.842a3.75 3.75 0 0 1-.837.552c-.676.328-1.028.774-1.028 1.152v.75a.75.75 0 0 1-1.5 0v-.75c0-1.279 1.06-2.107 1.875-2.502.182-.088.351-.199.503-.331.83-.727.83-1.857 0-2.584ZM12 18a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
|
|
154
160
|
"clip-rule": "evenodd"
|
|
155
161
|
}, null, -1)
|
|
156
162
|
])]);
|
|
157
163
|
}
|
|
158
|
-
const
|
|
164
|
+
const ot = /* @__PURE__ */ b(et, [["render", nt]]), st = {}, rt = {
|
|
159
165
|
xmlns: "http://www.w3.org/2000/svg",
|
|
160
166
|
viewBox: "0 0 24 24",
|
|
161
167
|
fill: "currentColor"
|
|
162
168
|
};
|
|
163
|
-
function
|
|
164
|
-
return
|
|
165
|
-
|
|
169
|
+
function at(o, i) {
|
|
170
|
+
return d(), f("svg", rt, [...i[0] || (i[0] = [
|
|
171
|
+
m("path", {
|
|
166
172
|
"fill-rule": "evenodd",
|
|
167
173
|
d: "M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",
|
|
168
174
|
"clip-rule": "evenodd"
|
|
169
175
|
}, null, -1)
|
|
170
176
|
])]);
|
|
171
177
|
}
|
|
172
|
-
const
|
|
178
|
+
const it = /* @__PURE__ */ b(st, [["render", at]]), lt = {}, ct = {
|
|
173
179
|
xmlns: "http://www.w3.org/2000/svg",
|
|
174
180
|
viewBox: "0 0 24 24",
|
|
175
181
|
fill: "currentColor"
|
|
176
182
|
};
|
|
177
|
-
function
|
|
178
|
-
return
|
|
179
|
-
|
|
183
|
+
function ut(o, i) {
|
|
184
|
+
return d(), f("svg", ct, [...i[0] || (i[0] = [
|
|
185
|
+
m("path", {
|
|
180
186
|
"fill-rule": "evenodd",
|
|
181
187
|
d: "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",
|
|
182
188
|
"clip-rule": "evenodd"
|
|
183
189
|
}, null, -1)
|
|
184
190
|
])]);
|
|
185
191
|
}
|
|
186
|
-
const
|
|
192
|
+
const dt = /* @__PURE__ */ b(lt, [["render", ut]]), ft = ["role", "aria-live"], pt = ["aria-label"], vt = { class: "tf-toast-surface" }, mt = { class: "tf-toast-main" }, ht = { class: "tf-toast-body" }, gt = { class: "tf-toast-text" }, yt = ["aria-label"], _t = ["aria-label", "innerHTML"], wt = ["aria-label"], bt = ["aria-label", "innerHTML"], Ct = {
|
|
187
193
|
key: 0,
|
|
188
194
|
class: "tf-toast-created-at"
|
|
189
|
-
},
|
|
195
|
+
}, At = ["aria-label"], kt = /* @__PURE__ */ se({
|
|
190
196
|
__name: "Toast",
|
|
191
197
|
props: {
|
|
192
198
|
toast: {},
|
|
@@ -198,285 +204,390 @@ const Pt = /* @__PURE__ */ h(jt, [["render", Dt]]), Vt = ["role", "aria-live"],
|
|
|
198
204
|
updateAnimationClass: {}
|
|
199
205
|
},
|
|
200
206
|
emits: ["dismiss"],
|
|
201
|
-
setup(
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
207
|
+
setup(o, { emit: i }) {
|
|
208
|
+
const L = o, {
|
|
209
|
+
toast: s,
|
|
210
|
+
progressResetKey: C,
|
|
211
|
+
duplicateKey: M,
|
|
212
|
+
updateKey: H,
|
|
213
|
+
bumpAnimationClass: B,
|
|
214
|
+
clearAllAnimationClass: P,
|
|
215
|
+
updateAnimationClass: E
|
|
216
|
+
} = $e(L), U = i, F = me(re, null) ?? p(), T = {
|
|
206
217
|
success: {
|
|
207
218
|
accent: "tf-toast-accent--success",
|
|
208
219
|
icon: "tf-toast-icon--success",
|
|
209
220
|
close: "tf-toast-close--success",
|
|
210
|
-
component:
|
|
221
|
+
component: De
|
|
211
222
|
},
|
|
212
223
|
error: {
|
|
213
224
|
accent: "tf-toast-accent--error",
|
|
214
225
|
icon: "tf-toast-icon--error",
|
|
215
226
|
close: "tf-toast-close--error",
|
|
216
|
-
component:
|
|
227
|
+
component: ze
|
|
217
228
|
},
|
|
218
229
|
warning: {
|
|
219
230
|
accent: "tf-toast-accent--warning",
|
|
220
231
|
icon: "tf-toast-icon--warning",
|
|
221
232
|
close: "tf-toast-close--warning",
|
|
222
|
-
component:
|
|
233
|
+
component: qe
|
|
223
234
|
},
|
|
224
235
|
info: {
|
|
225
236
|
accent: "tf-toast-accent--info",
|
|
226
237
|
icon: "tf-toast-icon--info",
|
|
227
238
|
close: "tf-toast-close--info",
|
|
228
|
-
component:
|
|
239
|
+
component: Je
|
|
229
240
|
},
|
|
230
241
|
default: {
|
|
231
242
|
accent: "tf-toast-accent--default",
|
|
232
243
|
icon: "tf-toast-icon--default",
|
|
233
244
|
close: "tf-toast-close--default",
|
|
234
|
-
component:
|
|
245
|
+
component: ot
|
|
235
246
|
},
|
|
236
247
|
loading: {
|
|
237
248
|
accent: "tf-toast-accent--loading",
|
|
238
249
|
icon: "tf-toast-icon--loading",
|
|
239
250
|
close: "tf-toast-close--loading",
|
|
240
|
-
component:
|
|
251
|
+
component: it
|
|
241
252
|
}
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
}, y = /* @__PURE__ */ new Set(["error", "warning"]), {
|
|
254
|
+
accentClass: Z,
|
|
255
|
+
iconWrapperClass: q,
|
|
256
|
+
closeWrapperClass: O,
|
|
257
|
+
defaultIconComponent: G
|
|
258
|
+
} = we(s), {
|
|
259
|
+
role: Q,
|
|
260
|
+
ariaLive: Y,
|
|
261
|
+
hasCreatedAt: z,
|
|
262
|
+
createdAtText: N,
|
|
263
|
+
createdAtAriaLabel: J,
|
|
264
|
+
titleAriaLabel: A,
|
|
265
|
+
descriptionAriaLabel: n,
|
|
266
|
+
toastAriaLabel: u
|
|
267
|
+
} = be(s), { progressStyle: r, showProgressBar: l, progressKeyLocal: ee } = Ce(
|
|
268
|
+
s,
|
|
269
|
+
C,
|
|
270
|
+
M
|
|
271
|
+
), { isBumped: te, isUpdated: ye } = Ae(M, H), {
|
|
272
|
+
isHovered: _e,
|
|
273
|
+
handleMouseEnter: ae,
|
|
274
|
+
handleMouseLeave: ie,
|
|
275
|
+
handlePointerDown: le,
|
|
276
|
+
handlePointerUp: V
|
|
277
|
+
} = ke(s, F), { handleClick: ce, handleCloseClick: ue } = Le(s, U);
|
|
278
|
+
function we(t) {
|
|
279
|
+
const c = v(function() {
|
|
280
|
+
return T[t.value.type].accent;
|
|
281
|
+
}), a = v(function() {
|
|
282
|
+
return T[t.value.type].icon;
|
|
283
|
+
}), h = v(function() {
|
|
284
|
+
return T[t.value.type].close;
|
|
285
|
+
}), w = v(function() {
|
|
286
|
+
return T[t.value.type].component;
|
|
287
|
+
});
|
|
255
288
|
return {
|
|
256
|
-
|
|
289
|
+
accentClass: c,
|
|
290
|
+
iconWrapperClass: a,
|
|
291
|
+
closeWrapperClass: h,
|
|
292
|
+
defaultIconComponent: w
|
|
257
293
|
};
|
|
258
|
-
}), z = function(i) {
|
|
259
|
-
return new Date(i).toLocaleTimeString([], {
|
|
260
|
-
hour: "2-digit",
|
|
261
|
-
minute: "2-digit"
|
|
262
|
-
});
|
|
263
|
-
}, B = d(function() {
|
|
264
|
-
return !!(t.toast.showCreatedAt && Number.isFinite(t.toast.createdAt));
|
|
265
|
-
}), x = d(function() {
|
|
266
|
-
if (!B.value)
|
|
267
|
-
return "";
|
|
268
|
-
const i = typeof t.toast.createdAtFormatter == "function" ? t.toast.createdAtFormatter : z;
|
|
269
|
-
try {
|
|
270
|
-
return i(t.toast.createdAt);
|
|
271
|
-
} catch {
|
|
272
|
-
return z(t.toast.createdAt);
|
|
273
|
-
}
|
|
274
|
-
}), $ = d(function() {
|
|
275
|
-
return x.value ? `Sent at ${x.value}` : "";
|
|
276
|
-
}), M = d(function() {
|
|
277
|
-
return e(t.toast.title);
|
|
278
|
-
}), L = d(function() {
|
|
279
|
-
return e(t.toast.description);
|
|
280
|
-
}), C = d(function() {
|
|
281
|
-
const i = [];
|
|
282
|
-
return M.value && i.push(M.value), L.value && i.push(L.value), B.value && $.value && i.push($.value), i.length || i.push(`${t.toast.type} notification`), i.join(". ");
|
|
283
|
-
});
|
|
284
|
-
function e(i) {
|
|
285
|
-
return i ? s(i) : "";
|
|
286
294
|
}
|
|
287
|
-
function
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
return
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
295
|
+
function be(t) {
|
|
296
|
+
const c = v(function() {
|
|
297
|
+
return y.has(t.value.type) ? "alert" : "status";
|
|
298
|
+
}), a = v(function() {
|
|
299
|
+
return y.has(t.value.type) ? "assertive" : "polite";
|
|
300
|
+
}), h = v(function() {
|
|
301
|
+
return !!(t.value.showCreatedAt && Number.isFinite(t.value.createdAt));
|
|
302
|
+
}), w = v(function() {
|
|
303
|
+
if (!h.value)
|
|
304
|
+
return "";
|
|
305
|
+
try {
|
|
306
|
+
return t.value.createdAtFormatter(t.value.createdAt);
|
|
307
|
+
} catch ($) {
|
|
308
|
+
console.error(
|
|
309
|
+
"[vue-toastflow] Something failed in createdAtFormatter",
|
|
310
|
+
$
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
}), _ = v(function() {
|
|
314
|
+
return w.value ? `Sent at ${w.value}` : "";
|
|
315
|
+
}), g = v(function() {
|
|
316
|
+
return fe(t.value.title);
|
|
317
|
+
}), I = v(function() {
|
|
318
|
+
return fe(t.value.description);
|
|
319
|
+
}), x = v(function() {
|
|
320
|
+
const $ = [];
|
|
321
|
+
return g.value && $.push(g.value), I.value && $.push(I.value), h.value && _.value && $.push(_.value), $.length || $.push(`${t.value.type} notification`), $.join(". ");
|
|
322
|
+
});
|
|
302
323
|
return {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
324
|
+
role: c,
|
|
325
|
+
ariaLive: a,
|
|
326
|
+
hasCreatedAt: h,
|
|
327
|
+
createdAtText: w,
|
|
328
|
+
createdAtAriaLabel: _,
|
|
329
|
+
titleAriaLabel: g,
|
|
330
|
+
descriptionAriaLabel: I,
|
|
331
|
+
toastAriaLabel: x
|
|
309
332
|
};
|
|
310
333
|
}
|
|
311
|
-
function
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
334
|
+
function Ce(t, c, a) {
|
|
335
|
+
const h = v(function() {
|
|
336
|
+
return {
|
|
337
|
+
"--tf-toast-progress-duration": `${t.value.duration}ms`
|
|
338
|
+
};
|
|
339
|
+
}), w = v(function() {
|
|
340
|
+
return t.value.progressBar && Number.isFinite(t.value.duration) && t.value.duration > 0;
|
|
341
|
+
}), _ = k(0);
|
|
342
|
+
return W(
|
|
343
|
+
() => c?.value,
|
|
344
|
+
function(g) {
|
|
345
|
+
g != null && (_.value += 1);
|
|
346
|
+
}
|
|
347
|
+
), W(
|
|
348
|
+
() => a?.value,
|
|
349
|
+
function(g) {
|
|
350
|
+
g != null && (_.value += 1);
|
|
351
|
+
}
|
|
352
|
+
), {
|
|
353
|
+
progressStyle: h,
|
|
354
|
+
showProgressBar: w,
|
|
355
|
+
progressKeyLocal: _
|
|
356
|
+
};
|
|
317
357
|
}
|
|
318
|
-
function
|
|
319
|
-
|
|
358
|
+
function Ae(t, c) {
|
|
359
|
+
const a = k(!1), h = k(!1);
|
|
360
|
+
function w() {
|
|
361
|
+
a.value = !1, requestAnimationFrame(function() {
|
|
362
|
+
a.value = !0;
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
function _() {
|
|
366
|
+
h.value = !1, requestAnimationFrame(function() {
|
|
367
|
+
h.value = !0;
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
return W(
|
|
371
|
+
() => t?.value,
|
|
372
|
+
function(g) {
|
|
373
|
+
g != null && w();
|
|
374
|
+
}
|
|
375
|
+
), W(
|
|
376
|
+
() => c?.value,
|
|
377
|
+
function(g) {
|
|
378
|
+
g != null && _();
|
|
379
|
+
}
|
|
380
|
+
), {
|
|
381
|
+
isBumped: a,
|
|
382
|
+
isUpdated: h
|
|
383
|
+
};
|
|
320
384
|
}
|
|
321
|
-
function
|
|
322
|
-
|
|
385
|
+
function ke(t, c) {
|
|
386
|
+
const a = k(!1);
|
|
387
|
+
function h() {
|
|
388
|
+
t.value.pauseOnHover && (a.value = !0, c.pause(t.value.id));
|
|
389
|
+
}
|
|
390
|
+
function w() {
|
|
391
|
+
t.value.pauseOnHover && (a.value = !1, c.resume(t.value.id));
|
|
392
|
+
}
|
|
393
|
+
function _(x) {
|
|
394
|
+
return x.pointerType === "touch" || x.pointerType === "pen";
|
|
395
|
+
}
|
|
396
|
+
function g(x) {
|
|
397
|
+
t.value.pauseOnHover && _(x) && (a.value = !0, c.pause(t.value.id));
|
|
398
|
+
}
|
|
399
|
+
function I(x) {
|
|
400
|
+
t.value.pauseOnHover && _(x) && (a.value = !1, c.resume(t.value.id));
|
|
401
|
+
}
|
|
402
|
+
return {
|
|
403
|
+
isHovered: a,
|
|
404
|
+
handleMouseEnter: h,
|
|
405
|
+
handleMouseLeave: w,
|
|
406
|
+
handlePointerDown: g,
|
|
407
|
+
handlePointerUp: I
|
|
408
|
+
};
|
|
323
409
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
410
|
+
function Le(t, c) {
|
|
411
|
+
function a() {
|
|
412
|
+
return {
|
|
413
|
+
id: t.value.id,
|
|
414
|
+
position: t.value.position,
|
|
415
|
+
type: t.value.type,
|
|
416
|
+
title: t.value.title,
|
|
417
|
+
description: t.value.description,
|
|
418
|
+
createdAt: t.value.createdAt
|
|
419
|
+
};
|
|
329
420
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
t.duplicateKey != null && (V.value += 1, nt());
|
|
421
|
+
function h(_) {
|
|
422
|
+
const g = a();
|
|
423
|
+
t.value.onClick && t.value.onClick(g, _), t.value.closeOnClick && c("dismiss", t.value.id);
|
|
334
424
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
function() {
|
|
338
|
-
t.updateKey != null && ot();
|
|
425
|
+
function w() {
|
|
426
|
+
c("dismiss", t.value.id);
|
|
339
427
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
});
|
|
428
|
+
return {
|
|
429
|
+
handleClick: h,
|
|
430
|
+
handleCloseClick: w
|
|
431
|
+
};
|
|
345
432
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
433
|
+
function de(t) {
|
|
434
|
+
return t.replace(/\s+/g, " ").trim();
|
|
435
|
+
}
|
|
436
|
+
function fe(t) {
|
|
437
|
+
if (!t)
|
|
438
|
+
return "";
|
|
439
|
+
const c = de(t.replace(/<[^>]*>/g, " "));
|
|
440
|
+
if (typeof window > "u" || !window.document)
|
|
441
|
+
return c;
|
|
442
|
+
try {
|
|
443
|
+
const a = window.document.createElement("div");
|
|
444
|
+
return a.innerHTML = t, de(a.textContent ?? "");
|
|
445
|
+
} catch {
|
|
446
|
+
return c;
|
|
447
|
+
}
|
|
350
448
|
}
|
|
351
|
-
return (
|
|
352
|
-
role:
|
|
353
|
-
"aria-live":
|
|
449
|
+
return (t, c) => (d(), f("div", {
|
|
450
|
+
role: e(Q),
|
|
451
|
+
"aria-live": e(Y),
|
|
354
452
|
class: "tf-toast-wrapper"
|
|
355
453
|
}, [
|
|
356
|
-
|
|
357
|
-
class:
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
454
|
+
m("div", {
|
|
455
|
+
class: S(["tf-toast", [
|
|
456
|
+
e(Z),
|
|
457
|
+
e(te) && e(s).phase !== "leaving" && e(s).phase !== "clear-all" && e(B),
|
|
458
|
+
e(ye) && e(s).phase !== "leaving" && e(s).phase !== "clear-all" && e(E),
|
|
459
|
+
e(s).phase === "clear-all" && e(P),
|
|
460
|
+
e(_e) && "tf-toast--paused"
|
|
363
461
|
]]),
|
|
364
|
-
"aria-label":
|
|
365
|
-
onClick:
|
|
366
|
-
|
|
367
|
-
|
|
462
|
+
"aria-label": e(u) || void 0,
|
|
463
|
+
onClick: c[1] || (c[1] = //@ts-ignore
|
|
464
|
+
(...a) => e(ce) && e(ce)(...a)),
|
|
465
|
+
onMouseenter: c[2] || (c[2] = //@ts-ignore
|
|
466
|
+
(...a) => e(ae) && e(ae)(...a)),
|
|
467
|
+
onMouseleave: c[3] || (c[3] = //@ts-ignore
|
|
468
|
+
(...a) => e(ie) && e(ie)(...a)),
|
|
469
|
+
onPointerdown: c[4] || (c[4] = //@ts-ignore
|
|
470
|
+
(...a) => e(le) && e(le)(...a)),
|
|
471
|
+
onPointerup: c[5] || (c[5] = //@ts-ignore
|
|
472
|
+
(...a) => e(V) && e(V)(...a)),
|
|
473
|
+
onPointercancel: c[6] || (c[6] = //@ts-ignore
|
|
474
|
+
(...a) => e(V) && e(V)(...a))
|
|
368
475
|
}, [
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
class:
|
|
476
|
+
m("div", vt, [
|
|
477
|
+
m("div", mt, [
|
|
478
|
+
m("div", {
|
|
479
|
+
class: S(["tf-toast-icon", e(q)]),
|
|
373
480
|
"aria-hidden": "true"
|
|
374
481
|
}, [
|
|
375
|
-
K(
|
|
376
|
-
(
|
|
377
|
-
class:
|
|
482
|
+
K(t.$slots, "icon", { toast: e(s) }, () => [
|
|
483
|
+
(d(), oe(Me(e(G)), {
|
|
484
|
+
class: S(["tf-toast-icon-svg", [e(s).type === "loading" && "tf-toast-icon-spin"]]),
|
|
378
485
|
"aria-hidden": "true"
|
|
379
486
|
}, null, 8, ["class"]))
|
|
380
487
|
], !0)
|
|
381
488
|
], 2),
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
489
|
+
m("div", ht, [
|
|
490
|
+
m("div", gt, [
|
|
491
|
+
e(s).title && !e(s).supportHtml ? (d(), f("p", {
|
|
385
492
|
key: 0,
|
|
386
|
-
"aria-label":
|
|
493
|
+
"aria-label": e(A) || void 0,
|
|
387
494
|
class: "tf-toast-title"
|
|
388
|
-
},
|
|
495
|
+
}, ne(e(s).title), 9, yt)) : e(s).title && e(s).supportHtml ? (d(), f("p", {
|
|
389
496
|
key: 1,
|
|
390
497
|
class: "tf-toast-title",
|
|
391
|
-
"aria-label":
|
|
392
|
-
innerHTML:
|
|
393
|
-
}, null, 8,
|
|
394
|
-
|
|
498
|
+
"aria-label": e(A) || void 0,
|
|
499
|
+
innerHTML: e(s).title
|
|
500
|
+
}, null, 8, _t)) : j("", !0),
|
|
501
|
+
e(s).description && !e(s).supportHtml ? (d(), f("p", {
|
|
395
502
|
key: 2,
|
|
396
|
-
"aria-label":
|
|
503
|
+
"aria-label": e(n) || void 0,
|
|
397
504
|
class: "tf-toast-description"
|
|
398
|
-
},
|
|
505
|
+
}, ne(e(s).description), 9, wt)) : e(s).description && e(s).supportHtml ? (d(), f("p", {
|
|
399
506
|
key: 3,
|
|
400
507
|
class: "tf-toast-description",
|
|
401
|
-
"aria-label":
|
|
402
|
-
innerHTML:
|
|
403
|
-
}, null, 8,
|
|
508
|
+
"aria-label": e(n) || void 0,
|
|
509
|
+
innerHTML: e(s).description
|
|
510
|
+
}, null, 8, bt)) : j("", !0)
|
|
404
511
|
]),
|
|
405
|
-
K(
|
|
406
|
-
|
|
407
|
-
K(
|
|
408
|
-
toast:
|
|
409
|
-
formatted:
|
|
512
|
+
K(t.$slots, "default", { toast: e(s) }, void 0, !0),
|
|
513
|
+
e(z) ? (d(), f("div", Ct, [
|
|
514
|
+
K(t.$slots, "created-at", {
|
|
515
|
+
toast: e(s),
|
|
516
|
+
formatted: e(N)
|
|
410
517
|
}, () => [
|
|
411
|
-
|
|
412
|
-
"aria-label":
|
|
413
|
-
},
|
|
518
|
+
m("span", {
|
|
519
|
+
"aria-label": e(J) || void 0
|
|
520
|
+
}, ne(e(N)), 9, At)
|
|
414
521
|
], !0)
|
|
415
|
-
])) :
|
|
522
|
+
])) : j("", !0)
|
|
416
523
|
])
|
|
417
524
|
]),
|
|
418
|
-
|
|
525
|
+
e(l) ? (d(), f("div", {
|
|
419
526
|
key: 0,
|
|
420
527
|
class: "tf-toast-progress-wrapper",
|
|
421
|
-
style:
|
|
528
|
+
style: D(e(r))
|
|
422
529
|
}, [
|
|
423
|
-
K(
|
|
424
|
-
(
|
|
425
|
-
key:
|
|
426
|
-
type:
|
|
530
|
+
K(t.$slots, "progress", { toast: e(s) }, () => [
|
|
531
|
+
(d(), oe(Ze, {
|
|
532
|
+
key: e(ee),
|
|
533
|
+
type: e(s).type
|
|
427
534
|
}, null, 8, ["type"]))
|
|
428
535
|
], !0)
|
|
429
|
-
], 4)) :
|
|
536
|
+
], 4)) : j("", !0)
|
|
430
537
|
]),
|
|
431
|
-
|
|
538
|
+
e(s).closeButton ? (d(), f("button", {
|
|
432
539
|
key: 0,
|
|
433
540
|
type: "button",
|
|
434
|
-
class:
|
|
541
|
+
class: S(["tf-toast-close", e(O)]),
|
|
435
542
|
"aria-label": "Close notification",
|
|
436
|
-
onClick:
|
|
543
|
+
onClick: c[0] || (c[0] = Te(
|
|
544
|
+
//@ts-ignore
|
|
545
|
+
(...a) => e(ue) && e(ue)(...a),
|
|
546
|
+
["stop"]
|
|
547
|
+
))
|
|
437
548
|
}, [
|
|
438
|
-
K(
|
|
439
|
-
|
|
549
|
+
K(t.$slots, "close-icon", { toast: e(s) }, () => [
|
|
550
|
+
he(dt, {
|
|
440
551
|
class: "tf-toast-close-icon",
|
|
441
552
|
"aria-hidden": "true"
|
|
442
553
|
})
|
|
443
554
|
], !0)
|
|
444
|
-
], 2)) :
|
|
445
|
-
], 42,
|
|
446
|
-
], 8,
|
|
555
|
+
], 2)) : j("", !0)
|
|
556
|
+
], 42, pt)
|
|
557
|
+
], 8, ft));
|
|
447
558
|
}
|
|
448
|
-
}),
|
|
559
|
+
}), Lt = /* @__PURE__ */ b(kt, [["__scopeId", "data-v-d5c8f291"]]), xt = ["data-position"], $t = /* @__PURE__ */ se({
|
|
449
560
|
__name: "ToastContainer",
|
|
450
|
-
setup(
|
|
451
|
-
const
|
|
561
|
+
setup(o) {
|
|
562
|
+
const i = [
|
|
452
563
|
"top-left",
|
|
453
564
|
"top-center",
|
|
454
565
|
"top-right",
|
|
455
566
|
"bottom-left",
|
|
456
567
|
"bottom-center",
|
|
457
568
|
"bottom-right"
|
|
458
|
-
],
|
|
459
|
-
let
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}),
|
|
464
|
-
|
|
569
|
+
], s = me(re, null) ?? p(), C = k([]), M = k({}), H = k({}), B = k({});
|
|
570
|
+
let P = null, E = null;
|
|
571
|
+
Se(function() {
|
|
572
|
+
P = s.subscribe(function(n) {
|
|
573
|
+
C.value = n.toasts;
|
|
574
|
+
}), E = s.subscribeEvents(function(n) {
|
|
575
|
+
n.kind === "timer-reset" && (M.value[n.id] = Math.random()), n.kind === "duplicate" && (H.value[n.id] = Math.random()), n.kind === "update" && (B.value[n.id] = Math.random());
|
|
465
576
|
});
|
|
466
|
-
}),
|
|
467
|
-
|
|
577
|
+
}), He(function() {
|
|
578
|
+
P && P(), E && E();
|
|
468
579
|
});
|
|
469
|
-
function
|
|
470
|
-
return
|
|
580
|
+
function U(n) {
|
|
581
|
+
return M.value[n] ?? 0;
|
|
471
582
|
}
|
|
472
|
-
function
|
|
473
|
-
return
|
|
583
|
+
function X(n) {
|
|
584
|
+
return H.value[n] ?? 0;
|
|
474
585
|
}
|
|
475
|
-
function
|
|
476
|
-
return
|
|
586
|
+
function F(n) {
|
|
587
|
+
return B.value[n] ?? 0;
|
|
477
588
|
}
|
|
478
|
-
const
|
|
479
|
-
const
|
|
589
|
+
const T = v(function() {
|
|
590
|
+
const n = {
|
|
480
591
|
"top-left": [],
|
|
481
592
|
"top-center": [],
|
|
482
593
|
"top-right": [],
|
|
@@ -484,153 +595,153 @@ const Pt = /* @__PURE__ */ h(jt, [["render", Dt]]), Vt = ["role", "aria-live"],
|
|
|
484
595
|
"bottom-center": [],
|
|
485
596
|
"bottom-right": []
|
|
486
597
|
};
|
|
487
|
-
for (const
|
|
488
|
-
|
|
489
|
-
return
|
|
490
|
-
}),
|
|
491
|
-
"top-left": { ...
|
|
492
|
-
"top-center": { ...
|
|
493
|
-
"top-right": { ...
|
|
494
|
-
"bottom-left": { ...
|
|
495
|
-
"bottom-center": { ...
|
|
496
|
-
"bottom-right": { ...
|
|
497
|
-
}),
|
|
498
|
-
return
|
|
598
|
+
for (const u of C.value)
|
|
599
|
+
n[u.position].push(u);
|
|
600
|
+
return n;
|
|
601
|
+
}), y = s.getConfig(), Z = k({
|
|
602
|
+
"top-left": { ...y, position: "top-left" },
|
|
603
|
+
"top-center": { ...y, position: "top-center" },
|
|
604
|
+
"top-right": { ...y, position: "top-right" },
|
|
605
|
+
"bottom-left": { ...y, position: "bottom-left" },
|
|
606
|
+
"bottom-center": { ...y, position: "bottom-center" },
|
|
607
|
+
"bottom-right": { ...y, position: "bottom-right" }
|
|
608
|
+
}), q = v(function() {
|
|
609
|
+
return C.value.length ? Math.max(...C.value.map((n) => n.zIndex)) : y.zIndex;
|
|
499
610
|
});
|
|
500
|
-
function
|
|
501
|
-
return
|
|
611
|
+
function O(n) {
|
|
612
|
+
return Z.value[n] ?? { ...y, position: n };
|
|
502
613
|
}
|
|
503
|
-
function
|
|
504
|
-
const { offset:
|
|
505
|
-
return
|
|
614
|
+
function G(n) {
|
|
615
|
+
const { offset: u, width: r } = O(n), l = { width: r, maxWidth: "100%" };
|
|
616
|
+
return n.startsWith("top-") && (l.top = u), n.startsWith("bottom-") && (l.bottom = u), n.endsWith("left") ? l.left = u : n.endsWith("right") ? l.right = u : n.endsWith("center") && (l.left = "50%", l.transform = "translateX(-50%)"), l;
|
|
506
617
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
618
|
+
function Q(n) {
|
|
619
|
+
return n.endsWith("left") ? "tf-toast-stack--left" : n.endsWith("center") ? "tf-toast-stack--center" : "tf-toast-stack--right";
|
|
509
620
|
}
|
|
510
|
-
function
|
|
511
|
-
return
|
|
621
|
+
function Y(n) {
|
|
622
|
+
return n.startsWith("bottom-") ? "tf-toast-stack-inner--bottom" : null;
|
|
512
623
|
}
|
|
513
|
-
function
|
|
514
|
-
|
|
624
|
+
function z(n) {
|
|
625
|
+
s.dismiss(n);
|
|
515
626
|
}
|
|
516
|
-
function
|
|
517
|
-
const
|
|
518
|
-
if (!
|
|
627
|
+
function N(n) {
|
|
628
|
+
const u = n, r = u.parentElement;
|
|
629
|
+
if (!r || r.children.length <= 1)
|
|
519
630
|
return;
|
|
520
|
-
const
|
|
521
|
-
|
|
631
|
+
const l = u.offsetTop, ee = r.clientHeight, te = r.clientWidth;
|
|
632
|
+
r.style.minHeight = `${ee}px`, u.style.position = "absolute", u.style.width = `${te}px`, u.style.left = "0", u.style.right = "0", u.style.top = `${l}px`;
|
|
522
633
|
}
|
|
523
|
-
function
|
|
524
|
-
const
|
|
525
|
-
|
|
634
|
+
function J(n) {
|
|
635
|
+
const u = n, r = u.parentElement;
|
|
636
|
+
r && (r.style.minHeight = ""), u.style.position = "", u.style.width = "", u.style.left = "", u.style.right = "", u.style.top = "";
|
|
526
637
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
function(
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
return
|
|
638
|
+
W(
|
|
639
|
+
C,
|
|
640
|
+
function(n) {
|
|
641
|
+
const u = new Set(
|
|
642
|
+
n.map(function(r) {
|
|
643
|
+
return r.id;
|
|
533
644
|
})
|
|
534
645
|
);
|
|
535
|
-
for (const
|
|
536
|
-
|
|
537
|
-
for (const
|
|
538
|
-
|
|
539
|
-
for (const
|
|
540
|
-
|
|
646
|
+
for (const r of Object.keys(M.value))
|
|
647
|
+
u.has(r) || delete M.value[r];
|
|
648
|
+
for (const r of Object.keys(H.value))
|
|
649
|
+
u.has(r) || delete H.value[r];
|
|
650
|
+
for (const r of Object.keys(B.value))
|
|
651
|
+
u.has(r) || delete B.value[r];
|
|
541
652
|
},
|
|
542
653
|
{ deep: !1 }
|
|
543
654
|
);
|
|
544
|
-
function
|
|
655
|
+
function A(n) {
|
|
545
656
|
return {
|
|
546
|
-
...
|
|
547
|
-
...
|
|
657
|
+
...y.animation,
|
|
658
|
+
...n.animation
|
|
548
659
|
};
|
|
549
660
|
}
|
|
550
|
-
return
|
|
551
|
-
|
|
552
|
-
function(
|
|
553
|
-
const
|
|
554
|
-
Object.keys(
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
...
|
|
558
|
-
...
|
|
559
|
-
position:
|
|
661
|
+
return W(
|
|
662
|
+
T,
|
|
663
|
+
function(n) {
|
|
664
|
+
const u = { ...Z.value };
|
|
665
|
+
Object.keys(n).forEach(function(r) {
|
|
666
|
+
const l = n[r][0];
|
|
667
|
+
l && (u[r] = {
|
|
668
|
+
...y,
|
|
669
|
+
...l,
|
|
670
|
+
position: r,
|
|
560
671
|
animation: {
|
|
561
|
-
...
|
|
562
|
-
...
|
|
672
|
+
...y.animation,
|
|
673
|
+
...l.animation
|
|
563
674
|
}
|
|
564
675
|
});
|
|
565
|
-
}),
|
|
676
|
+
}), Z.value = u;
|
|
566
677
|
},
|
|
567
678
|
{ deep: !1 }
|
|
568
|
-
), (
|
|
679
|
+
), (n, u) => (d(), f("div", {
|
|
569
680
|
class: "tf-toast-root",
|
|
570
|
-
style:
|
|
681
|
+
style: D({ zIndex: q.value })
|
|
571
682
|
}, [
|
|
572
|
-
(
|
|
573
|
-
key:
|
|
574
|
-
class:
|
|
575
|
-
style:
|
|
683
|
+
(d(), f(pe, null, ve(i, (r) => m("div", {
|
|
684
|
+
key: r,
|
|
685
|
+
class: S(["tf-toast-stack", Q(r)]),
|
|
686
|
+
style: D(G(r))
|
|
576
687
|
}, [
|
|
577
|
-
|
|
578
|
-
name:
|
|
579
|
-
onBeforeLeave:
|
|
580
|
-
onAfterLeave:
|
|
688
|
+
he(Be, {
|
|
689
|
+
name: O(r).animation.name,
|
|
690
|
+
onBeforeLeave: N,
|
|
691
|
+
onAfterLeave: J,
|
|
581
692
|
tag: "div",
|
|
582
|
-
class:
|
|
583
|
-
style:
|
|
693
|
+
class: S(["tf-toast-stack-inner", Y(r)]),
|
|
694
|
+
style: D({ gap: O(r).gap })
|
|
584
695
|
}, {
|
|
585
|
-
default:
|
|
586
|
-
(
|
|
587
|
-
key:
|
|
696
|
+
default: Ke(() => [
|
|
697
|
+
(d(!0), f(pe, null, ve(T.value[r], (l) => (d(), f("div", {
|
|
698
|
+
key: l.id,
|
|
588
699
|
class: "tf-toast-item",
|
|
589
|
-
style:
|
|
590
|
-
"data-position":
|
|
700
|
+
style: D({ width: l.width, maxWidth: "100%" }),
|
|
701
|
+
"data-position": l.position
|
|
591
702
|
}, [
|
|
592
|
-
|
|
703
|
+
n.$slots.default ? K(n.$slots, "default", {
|
|
593
704
|
key: 0,
|
|
594
|
-
toast:
|
|
595
|
-
progressResetKey:
|
|
596
|
-
duplicateKey:
|
|
597
|
-
updateKey:
|
|
598
|
-
bumpAnimationClass:
|
|
599
|
-
clearAllAnimationClass:
|
|
600
|
-
updateAnimationClass:
|
|
601
|
-
dismiss:
|
|
602
|
-
}, void 0, !0) : (
|
|
705
|
+
toast: l,
|
|
706
|
+
progressResetKey: U(l.id),
|
|
707
|
+
duplicateKey: X(l.id),
|
|
708
|
+
updateKey: F(l.id),
|
|
709
|
+
bumpAnimationClass: A(l).bump,
|
|
710
|
+
clearAllAnimationClass: A(l).clearAll,
|
|
711
|
+
updateAnimationClass: A(l).update,
|
|
712
|
+
dismiss: z
|
|
713
|
+
}, void 0, !0) : (d(), oe(Lt, {
|
|
603
714
|
key: 1,
|
|
604
|
-
toast:
|
|
605
|
-
progressResetKey:
|
|
606
|
-
duplicateKey:
|
|
607
|
-
updateKey:
|
|
608
|
-
bumpAnimationClass:
|
|
609
|
-
clearAllAnimationClass:
|
|
610
|
-
updateAnimationClass:
|
|
611
|
-
onDismiss:
|
|
715
|
+
toast: l,
|
|
716
|
+
progressResetKey: U(l.id),
|
|
717
|
+
duplicateKey: X(l.id),
|
|
718
|
+
updateKey: F(l.id),
|
|
719
|
+
bumpAnimationClass: A(l).bump,
|
|
720
|
+
clearAllAnimationClass: A(l).clearAll,
|
|
721
|
+
updateAnimationClass: A(l).update,
|
|
722
|
+
onDismiss: z
|
|
612
723
|
}, null, 8, ["toast", "progressResetKey", "duplicateKey", "updateKey", "bumpAnimationClass", "clearAllAnimationClass", "updateAnimationClass"]))
|
|
613
|
-
], 12,
|
|
724
|
+
], 12, xt))), 128))
|
|
614
725
|
]),
|
|
615
726
|
_: 2
|
|
616
727
|
}, 1032, ["name", "class", "style"])
|
|
617
728
|
], 6)), 64))
|
|
618
729
|
], 4));
|
|
619
730
|
}
|
|
620
|
-
}),
|
|
731
|
+
}), Bt = /* @__PURE__ */ b($t, [["__scopeId", "data-v-65f94eb4"]]);
|
|
621
732
|
export {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
733
|
+
it as ArrowPath,
|
|
734
|
+
qe as Bell,
|
|
735
|
+
De as CheckCircle,
|
|
736
|
+
Je as InfoCircle,
|
|
737
|
+
ot as QuestionMarkCircle,
|
|
738
|
+
Lt as Toast,
|
|
739
|
+
Bt as ToastContainer,
|
|
740
|
+
Ze as ToastProgress,
|
|
741
|
+
ze as XCircle,
|
|
742
|
+
dt as XMark,
|
|
743
|
+
Ht as createToastflow,
|
|
744
|
+
p as getToastStore,
|
|
745
|
+
We as setToastStore,
|
|
746
|
+
St as toast
|
|
636
747
|
};
|