lkt-toast 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, mergeDefaults as D, ref as m, computed as
|
|
1
|
+
import { defineComponent as H, mergeDefaults as D, ref as m, computed as a, onMounted as $, resolveComponent as z, createElementBlock as d, openBlock as r, normalizeClass as v, createElementVNode as n, createVNode as S, createBlock as h, createCommentVNode as B, unref as i, mergeProps as T, getCurrentInstance as E, Fragment as V, renderList as R } from "vue";
|
|
2
2
|
import { extractI18nValue as P, LktSettings as F, closeToast as b, ProgressValueFormat as N, ProgressAnimation as A, getDefaultValues as U, Toast as j, ToastController as y } from "lkt-vue-kernel";
|
|
3
3
|
import { closeToast as oe, openToast as ne } from "lkt-vue-kernel";
|
|
4
4
|
const O = {
|
|
@@ -9,6 +9,7 @@ const O = {
|
|
|
9
9
|
props: /* @__PURE__ */ D({
|
|
10
10
|
type: {},
|
|
11
11
|
text: {},
|
|
12
|
+
class: {},
|
|
12
13
|
details: {},
|
|
13
14
|
icon: {},
|
|
14
15
|
positionX: {},
|
|
@@ -17,10 +18,10 @@ const O = {
|
|
|
17
18
|
zIndex: {}
|
|
18
19
|
}, U(j)),
|
|
19
20
|
setup(t) {
|
|
20
|
-
const
|
|
21
|
+
const s = t, l = m(100), u = s.duration ?? 1e4, c = m(null), p = m(!1), k = a(() => {
|
|
21
22
|
let e = [];
|
|
22
|
-
return p.value && e.push("is-visible"),
|
|
23
|
-
}), _ =
|
|
23
|
+
return p.value && e.push("is-visible"), s.positionX && e.push(`animation-${s.positionX}`), s.class && e.push(s.class), e.join(" ");
|
|
24
|
+
}), _ = a(() => P(s.text)), g = a(() => P(s.details)), I = F.defaultCloseToastIcon, x = () => {
|
|
24
25
|
c.value.pause();
|
|
25
26
|
}, M = () => {
|
|
26
27
|
c.value.start();
|
|
@@ -30,8 +31,8 @@ const O = {
|
|
|
30
31
|
p.value = !0;
|
|
31
32
|
}, 100);
|
|
32
33
|
}), (e, f) => {
|
|
33
|
-
const
|
|
34
|
-
return
|
|
34
|
+
const o = z("lkt-icon"), X = z("lkt-progress");
|
|
35
|
+
return r(), d("section", {
|
|
35
36
|
class: v(["lkt-toast", k.value]),
|
|
36
37
|
role: "status",
|
|
37
38
|
"aria-live": "polite",
|
|
@@ -40,28 +41,28 @@ const O = {
|
|
|
40
41
|
onMousemove: x,
|
|
41
42
|
onMouseleave: M
|
|
42
43
|
}, [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
t.icon ? (
|
|
44
|
+
n("div", O, [
|
|
45
|
+
n("div", q, [
|
|
46
|
+
n("div", w, [
|
|
47
|
+
t.icon ? (r(), h(o, {
|
|
47
48
|
key: 0,
|
|
48
49
|
icon: t.icon
|
|
49
50
|
}, null, 8, ["icon"])) : B("", !0),
|
|
50
|
-
|
|
51
|
+
n("div", {
|
|
51
52
|
class: "lkt-toast-text",
|
|
52
53
|
innerHTML: _.value
|
|
53
54
|
}, null, 8, G)
|
|
54
55
|
]),
|
|
55
|
-
|
|
56
|
+
n("div", {
|
|
56
57
|
class: "lkt-toast-close",
|
|
57
58
|
onClick: f[0] || (f[0] = (C) => i(b)(t.zIndex))
|
|
58
59
|
}, [
|
|
59
|
-
|
|
60
|
+
n("i", {
|
|
60
61
|
class: v(i(I))
|
|
61
62
|
}, null, 2)
|
|
62
63
|
])
|
|
63
64
|
]),
|
|
64
|
-
|
|
65
|
+
n("div", {
|
|
65
66
|
class: "lkt-toast-details",
|
|
66
67
|
innerHTML: g.value
|
|
67
68
|
}, null, 8, J),
|
|
@@ -83,7 +84,7 @@ const O = {
|
|
|
83
84
|
pauseOnHover: !0,
|
|
84
85
|
events: {
|
|
85
86
|
updatedVisibleProgress: (C) => {
|
|
86
|
-
C === 0 && i(b)(
|
|
87
|
+
C === 0 && i(b)(s.zIndex);
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
}), null, 16, ["modelValue"])
|
|
@@ -93,45 +94,45 @@ const O = {
|
|
|
93
94
|
}
|
|
94
95
|
}), K = { class: "lkt-toast-canvas" }, Q = /* @__PURE__ */ H({
|
|
95
96
|
__name: "LktToastCanvas",
|
|
96
|
-
setup(t, { expose:
|
|
97
|
+
setup(t, { expose: s }) {
|
|
97
98
|
const l = m(0), u = E(), c = m([]), p = () => {
|
|
98
99
|
l.value = l.value + 1, setTimeout(() => {
|
|
99
100
|
var e;
|
|
100
101
|
(e = u == null ? void 0 : u.proxy) == null || e.$forceUpdate();
|
|
101
102
|
}, 1);
|
|
102
|
-
}, k =
|
|
103
|
-
return
|
|
103
|
+
}, k = a(() => (l.value, y.components.filter((e) => e.positionX === "left"))), _ = a(() => (l.value, y.components.filter((e) => e.positionX === "center"))), g = a(() => (l.value, y.components.filter((e) => e.positionX === "right"))), I = a(() => k.value.length === 0 ? "" : "is-visible"), x = a(() => _.value.length === 0 ? "" : "is-visible"), M = a(() => g.value.length === 0 ? "" : "is-visible");
|
|
104
|
+
return s({
|
|
104
105
|
refresh: p
|
|
105
|
-
}), (e, f) => (
|
|
106
|
-
|
|
106
|
+
}), (e, f) => (r(), d("section", K, [
|
|
107
|
+
n("div", {
|
|
107
108
|
class: v(["lkt-toast-stack left-stack", I.value])
|
|
108
109
|
}, [
|
|
109
|
-
(
|
|
110
|
+
(r(!0), d(V, null, R(k.value, (o) => (r(), h(L, T({
|
|
110
111
|
ref_for: !0,
|
|
111
112
|
ref_key: "instanceReferences",
|
|
112
113
|
ref: c,
|
|
113
|
-
key:
|
|
114
|
-
}, { ref_for: !0 },
|
|
114
|
+
key: o.zIndex
|
|
115
|
+
}, { ref_for: !0 }, o), null, 16))), 128))
|
|
115
116
|
], 2),
|
|
116
|
-
|
|
117
|
+
n("div", {
|
|
117
118
|
class: v(["lkt-toast-stack center-stack", x.value])
|
|
118
119
|
}, [
|
|
119
|
-
(
|
|
120
|
+
(r(!0), d(V, null, R(_.value, (o) => (r(), h(L, T({
|
|
120
121
|
ref_for: !0,
|
|
121
122
|
ref_key: "instanceReferences",
|
|
122
123
|
ref: c,
|
|
123
|
-
key:
|
|
124
|
-
}, { ref_for: !0 },
|
|
124
|
+
key: o.zIndex
|
|
125
|
+
}, { ref_for: !0 }, o), null, 16))), 128))
|
|
125
126
|
], 2),
|
|
126
|
-
|
|
127
|
+
n("div", {
|
|
127
128
|
class: v(["lkt-toast-stack right-stack", M.value])
|
|
128
129
|
}, [
|
|
129
|
-
(
|
|
130
|
+
(r(!0), d(V, null, R(g.value, (o) => (r(), h(L, T({
|
|
130
131
|
ref_for: !0,
|
|
131
132
|
ref_key: "instanceReferences",
|
|
132
133
|
ref: c,
|
|
133
|
-
key:
|
|
134
|
-
}, { ref_for: !0 },
|
|
134
|
+
key: o.zIndex
|
|
135
|
+
}, { ref_for: !0 }, o), null, 16))), 128))
|
|
135
136
|
], 2)
|
|
136
137
|
]));
|
|
137
138
|
}
|
|
@@ -5,6 +5,7 @@ declare const _default: import("vue").DefineComponent<ToastConfig, {}, {}, {}, {
|
|
|
5
5
|
zIndex: number;
|
|
6
6
|
details: string | number;
|
|
7
7
|
text: string | number;
|
|
8
|
+
class: string | number;
|
|
8
9
|
icon: string | number;
|
|
9
10
|
duration: number;
|
|
10
11
|
buttonConfig: import("lkt-vue-kernel").ButtonConfig;
|
package/package.json
CHANGED
|
@@ -23,6 +23,7 @@ const classes = computed(() => {
|
|
|
23
23
|
let r: string[] = [];
|
|
24
24
|
if (addAnimationClass.value) r.push('is-visible');
|
|
25
25
|
if (props.positionX) r.push(`animation-${props.positionX}`);
|
|
26
|
+
if (props.class) r.push(props.class);
|
|
26
27
|
return r.join(' ');
|
|
27
28
|
}),
|
|
28
29
|
computedText = computed(() => extractI18nValue(props.text)),
|