@luizleon/sf.prefeiturasp.vuecomponents 0.0.18 → 0.0.19
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/lib.es.js +2003 -1509
- package/dist/lib.es.js.map +1 -1
- package/dist/lib.umd.js +36 -35
- package/dist/lib.umd.js.map +1 -1
- package/dist/services/dialogService.d.ts +2 -2
- package/package.json +4 -2
- package/src/components/internal/HeaderAvatar.vue +1 -1
- package/src/services/dialogService.ts +7 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luizleon/sf.prefeiturasp.vuecomponents",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Pacote de componentes Vue para projetos em SF.",
|
|
5
5
|
"main": "dist/lib.umd.js",
|
|
6
6
|
"module": "dist/lib.es.js",
|
|
@@ -15,14 +15,16 @@
|
|
|
15
15
|
"vue-currency-input": "3.0.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
+
"@types/dompurify": "3.0.5",
|
|
18
19
|
"@vitejs/plugin-vue": "4.4.1",
|
|
19
20
|
"base64-js": "1.5.1",
|
|
21
|
+
"dompurify": "3.0.6",
|
|
20
22
|
"js-sha256": "0.10.1",
|
|
21
23
|
"jwt-decode": "4.0.0",
|
|
22
24
|
"rimraf": "3.0.2",
|
|
23
25
|
"sass": "1.69.5",
|
|
24
26
|
"typescript": "5.2.2",
|
|
25
|
-
"vite": "4.5.
|
|
27
|
+
"vite": "4.5.1",
|
|
26
28
|
"vite-plugin-dts": "1.6.4",
|
|
27
29
|
"vite-plugin-vue-type-imports": "0.2.3",
|
|
28
30
|
"vue-tsc": "1.8.22"
|
|
@@ -8,7 +8,7 @@ const letters = Letters();
|
|
|
8
8
|
|
|
9
9
|
async function Logout() {
|
|
10
10
|
const confirm = await dialogService.ConfirmAsync({
|
|
11
|
-
|
|
11
|
+
text: `${AuthService.User.username} - ${AuthService.User.name}.<br /><br />Você deseja sair da conta?`,
|
|
12
12
|
confirmLabel: "sair",
|
|
13
13
|
});
|
|
14
14
|
if (!confirm) return;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Swal from "sweetalert2";
|
|
2
|
+
import DOMPurify from "dompurify";
|
|
2
3
|
|
|
3
4
|
interface ConfirmOptions {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
text: string;
|
|
6
|
+
title?: string;
|
|
6
7
|
confirmLabel?: string;
|
|
7
8
|
rejectLabel?: string;
|
|
8
9
|
}
|
|
@@ -25,8 +26,8 @@ class DialogService {
|
|
|
25
26
|
allowEscapeKey: false,
|
|
26
27
|
allowOutsideClick: false,
|
|
27
28
|
icon: "question",
|
|
28
|
-
title: options.
|
|
29
|
-
html: options.
|
|
29
|
+
title: options.title,
|
|
30
|
+
html: DOMPurify.sanitize(options.text),
|
|
30
31
|
confirmButtonText: options.confirmLabel ?? "confirmar",
|
|
31
32
|
cancelButtonText: options.rejectLabel ?? "cancelar",
|
|
32
33
|
}).then((x: any) => {
|
|
@@ -37,14 +38,13 @@ class DialogService {
|
|
|
37
38
|
|
|
38
39
|
async AlertAsync(options: AlertOptions): Promise<boolean> {
|
|
39
40
|
const icon = options.icon ?? "info";
|
|
40
|
-
let text: string;
|
|
41
41
|
let html: string;
|
|
42
42
|
if (Array.isArray(options.text)) {
|
|
43
43
|
html = `<div style="max-height: 50vh; overflow: auto">
|
|
44
44
|
${options.text.join("<br />")}
|
|
45
45
|
</div>`;
|
|
46
46
|
} else {
|
|
47
|
-
|
|
47
|
+
html = options.text;
|
|
48
48
|
}
|
|
49
49
|
return new Promise((r) => {
|
|
50
50
|
Swal.fire({
|
|
@@ -52,8 +52,7 @@ class DialogService {
|
|
|
52
52
|
allowOutsideClick: false,
|
|
53
53
|
icon,
|
|
54
54
|
title: options.title,
|
|
55
|
-
|
|
56
|
-
html,
|
|
55
|
+
html: DOMPurify.sanitize(html),
|
|
57
56
|
}).then(() => r(true));
|
|
58
57
|
});
|
|
59
58
|
}
|