@useinsider/guido 3.1.0 → 3.1.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/composables/useToaster.js +12 -10
- package/dist/stores/toaster.js +7 -7
- package/package.json +1 -1
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { ToasterTypeOptions as T } from "../enums/toaster.js";
|
|
2
|
-
import { useToasterStore as
|
|
3
|
-
import { watch as
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
2
|
+
import { useToasterStore as c } from "../stores/toaster.js";
|
|
3
|
+
import { watch as u, nextTick as l } from "vue";
|
|
4
|
+
const p = () => {
|
|
5
|
+
const t = c();
|
|
6
6
|
let o = null;
|
|
7
7
|
const s = () => {
|
|
8
8
|
o && (clearTimeout(o), o = null);
|
|
9
9
|
};
|
|
10
10
|
function r(e = { message: "" }) {
|
|
11
|
-
s(), t.hideToaster(),
|
|
11
|
+
s(), t.hideToaster(), l(() => {
|
|
12
|
+
t.showToaster(e);
|
|
13
|
+
});
|
|
12
14
|
}
|
|
13
15
|
function i() {
|
|
14
16
|
s(), t.hideToaster();
|
|
15
17
|
}
|
|
16
|
-
function
|
|
18
|
+
function n(e, a) {
|
|
17
19
|
const m = e instanceof Error ? e.message : String(e);
|
|
18
|
-
r({ type: T.Alert, message: `${
|
|
20
|
+
r({ type: T.Alert, message: `${a}: ${m}` });
|
|
19
21
|
}
|
|
20
|
-
return
|
|
22
|
+
return u(
|
|
21
23
|
() => t.shouldAutoHide,
|
|
22
24
|
(e) => {
|
|
23
25
|
s(), e && (o = setTimeout(() => {
|
|
24
26
|
t.hideToaster(), s();
|
|
25
27
|
}, 6e3));
|
|
26
28
|
}
|
|
27
|
-
), { showToaster: r, hideToaster: i, handleError:
|
|
29
|
+
), { showToaster: r, hideToaster: i, handleError: n };
|
|
28
30
|
};
|
|
29
31
|
export {
|
|
30
|
-
|
|
32
|
+
p as useToaster
|
|
31
33
|
};
|
package/dist/stores/toaster.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { ToasterTypeOptions as
|
|
1
|
+
import { ToasterTypeOptions as e } from "../enums/toaster.js";
|
|
2
2
|
import { defineStore as i } from "pinia";
|
|
3
3
|
const a = () => ({
|
|
4
4
|
status: !1,
|
|
5
|
-
type:
|
|
5
|
+
type: e.Success,
|
|
6
6
|
text: "",
|
|
7
7
|
icon: "",
|
|
8
8
|
withIcon: !0,
|
|
9
9
|
withoutLeftMargin: !1,
|
|
10
10
|
actionButton: void 0
|
|
11
|
-
}),
|
|
11
|
+
}), n = i("guidoToaster", {
|
|
12
12
|
state: () => a(),
|
|
13
13
|
getters: {
|
|
14
14
|
shouldAutoHide: (t) => t.status && !!t.text
|
|
15
15
|
},
|
|
16
16
|
actions: {
|
|
17
|
-
showToaster({ type: t =
|
|
18
|
-
this.status = !0, this.text =
|
|
17
|
+
showToaster({ type: t = e.Success, message: s, actionButton: o }) {
|
|
18
|
+
this.status = !0, this.text = s, this.type = t, this.actionButton = o;
|
|
19
19
|
},
|
|
20
20
|
hideToaster() {
|
|
21
|
-
this.status = !1
|
|
21
|
+
this.status = !1;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
n as useToasterStore
|
|
27
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|