@luizleon/sf.prefeiturasp.vuecomponents 0.0.43 → 0.0.45
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/components/button/Button.d.ts +77 -42
- package/dist/components/content/Content.d.ts +28 -36
- package/dist/components/drawer/Drawer.d.ts +54 -55
- package/dist/components/icon/Icon.d.ts +59 -38
- package/dist/components/internal/HeaderAvatar.d.ts +6 -0
- package/dist/components/internal/ScrollToTop.d.ts +2 -7
- package/dist/components/internal/ThemeToggle.d.ts +2 -11
- package/dist/components/layout/Layout.d.ts +20 -45
- package/dist/components/message/Message.d.ts +42 -37
- package/dist/components/navmenulink/NavMenuLink.d.ts +18 -35
- package/dist/components/tabnavigation/TabNavigation.d.ts +29 -42
- package/dist/components/tooltip/Tooltip.d.ts +21 -0
- package/dist/index.d.ts +4 -3
- package/dist/keycloak.d.ts +1 -1
- package/dist/services/dialogService.d.ts +16 -5
- package/dist/{lib.es.js → sf.prefeiturasp.vuecomponents.es.js} +2009 -1909
- package/dist/sf.prefeiturasp.vuecomponents.es.js.map +1 -0
- package/dist/sf.prefeiturasp.vuecomponents.umd.js +82 -0
- package/dist/sf.prefeiturasp.vuecomponents.umd.js.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +9 -10
- package/src/components/button/Button.d.ts +2 -18
- package/src/components/button/Button.vue +45 -2
- package/src/components/content/Content.d.ts +0 -8
- package/src/components/content/Content.vue +9 -1
- package/src/components/drawer/Drawer.d.ts +1 -6
- package/src/components/drawer/Drawer.vue +11 -3
- package/src/components/icon/Icon.d.ts +1 -16
- package/src/components/icon/Icon.vue +65 -22
- package/src/components/internal/HeaderAvatar.vue +4 -5
- package/src/components/layout/Layout.d.ts +1 -2
- package/src/components/layout/Layout.vue +6 -1
- package/src/components/message/Message.d.ts +1 -10
- package/src/components/message/Message.vue +28 -12
- package/src/components/navmenulink/NavMenuLink.d.ts +1 -7
- package/src/components/navmenulink/NavMenuLink.vue +10 -2
- package/src/components/tabnavigation/TabNavigation.d.ts +1 -9
- package/src/components/tabnavigation/TabNavigation.vue +9 -1
- package/src/components/tooltip/Tooltip.d.ts +23 -0
- package/src/components/tooltip/Tooltip.vue +91 -0
- package/src/index.ts +8 -6
- package/src/services/dialogService.ts +71 -25
- package/src/style/src/_mixins.scss +5 -0
- package/src/style/src/components/_icon.scss +7 -7
- package/src/style/src/components/_message.scss +1 -1
- package/src/style/src/components/_tooltip.scss +11 -12
- package/src/style/src/sweetalert/scss/_animations.scss +197 -197
- package/src/style/src/sweetalert/scss/_body.scss +45 -45
- package/src/style/src/sweetalert/scss/_core.scss +862 -862
- package/src/style/src/sweetalert/scss/_mixins.scss +16 -16
- package/src/style/src/sweetalert/scss/_theming.scss +8 -8
- package/src/style/src/sweetalert/scss/_toasts-animations.scss +83 -83
- package/src/style/src/sweetalert/scss/_toasts-body.scss +85 -85
- package/src/style/src/sweetalert/scss/_toasts.scss +203 -203
- package/src/ts-helpers.d.ts +9 -9
- package/tsconfig.json +2 -2
- package/vite.config.js +5 -5
- package/dist/enum/cor.d.ts +0 -9
- package/dist/enum/index.d.ts +0 -2
- package/dist/enum/tamanho.d.ts +0 -5
- package/dist/lib.es.js.map +0 -1
- package/dist/lib.umd.js +0 -84
- package/dist/lib.umd.js.map +0 -1
- package/dist/ts-helpers.d.ts +0 -57
- package/src/enum/cor.ts +0 -9
- package/src/enum/index.ts +0 -2
- package/src/enum/tamanho.ts +0 -5
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
import { computed, onMounted, ref } from "vue";
|
|
3
3
|
import SfDrawer from "../drawer/Drawer.vue";
|
|
4
4
|
import SfButton from "../button/Button.vue";
|
|
5
|
-
import {
|
|
6
|
-
import { UseDialogService } from "../../services/dialogService";
|
|
5
|
+
import { UseConfirmService } from "../../services/dialogService";
|
|
7
6
|
|
|
8
|
-
const
|
|
7
|
+
const confirmService = UseConfirmService();
|
|
9
8
|
|
|
10
9
|
const letters = ref("?");
|
|
11
10
|
|
|
@@ -14,7 +13,7 @@ const emit = defineEmits<{
|
|
|
14
13
|
}>();
|
|
15
14
|
|
|
16
15
|
async function Logout() {
|
|
17
|
-
const confirm = await
|
|
16
|
+
const confirm = await confirmService.CreateConfirmAsync({
|
|
18
17
|
text: `Você deseja sair da conta?`,
|
|
19
18
|
confirmLabel: "sair",
|
|
20
19
|
});
|
|
@@ -67,7 +66,7 @@ onMounted(() => {
|
|
|
67
66
|
<template #title>Minha conta</template>
|
|
68
67
|
<template #default>
|
|
69
68
|
<div class="sf-p-4">
|
|
70
|
-
<SfButton :color="
|
|
69
|
+
<SfButton :color="'error'" @click="Logout">Sair</SfButton>
|
|
71
70
|
</div>
|
|
72
71
|
</template>
|
|
73
72
|
</SfDrawer>
|
|
@@ -4,6 +4,9 @@ import { UseNavMenuService } from "../../services/navMenuService";
|
|
|
4
4
|
import HeaderAvatar from "../internal/HeaderAvatar.vue";
|
|
5
5
|
import MenuIcon from "../internal/MenuIcon.vue";
|
|
6
6
|
import ThemeToggle from "../internal/ThemeToggle.vue";
|
|
7
|
+
import SfTooltip from "../tooltip/Tooltip.vue";
|
|
8
|
+
|
|
9
|
+
export interface SfLayoutProps {}
|
|
7
10
|
|
|
8
11
|
const navService = UseNavMenuService();
|
|
9
12
|
|
|
@@ -34,7 +37,9 @@ onMounted(() => {
|
|
|
34
37
|
<slot name="title"></slot>
|
|
35
38
|
</div>
|
|
36
39
|
<slot name="action"> </slot>
|
|
37
|
-
<
|
|
40
|
+
<SfTooltip :text="'alternar tema'">
|
|
41
|
+
<ThemeToggle />
|
|
42
|
+
</SfTooltip>
|
|
38
43
|
<HeaderAvatar @logout="emit('logout')" />
|
|
39
44
|
</header>
|
|
40
45
|
<nav :class="{ visible: navService.IsVisible }">
|
|
@@ -5,16 +5,7 @@ import {
|
|
|
5
5
|
GlobalComponentConstructor,
|
|
6
6
|
} from "../../ts-helpers";
|
|
7
7
|
import { Cor } from "../../enum";
|
|
8
|
-
|
|
9
|
-
export interface SfMessageProps {
|
|
10
|
-
/**
|
|
11
|
-
* @default "Info"
|
|
12
|
-
*/
|
|
13
|
-
severity?: Cor;
|
|
14
|
-
class?: any;
|
|
15
|
-
style?: StyleValue;
|
|
16
|
-
icon?: string;
|
|
17
|
-
}
|
|
8
|
+
import { SfMessageProps } from "./Message.vue";
|
|
18
9
|
|
|
19
10
|
export interface SfMessageSlots {
|
|
20
11
|
default: VNode[];
|
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { Cor } from "../../enum";
|
|
3
2
|
import { CssClassBuilder } from "../internal/cssClassBuilder";
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { StyleValue, computed } from "vue";
|
|
4
|
+
|
|
5
|
+
export interface SfMessageProps {
|
|
6
|
+
/**
|
|
7
|
+
* @default 'info'
|
|
8
|
+
*/
|
|
9
|
+
color?:
|
|
10
|
+
| "primary"
|
|
11
|
+
| "secondary"
|
|
12
|
+
| "info"
|
|
13
|
+
| "success"
|
|
14
|
+
| "help"
|
|
15
|
+
| "warn"
|
|
16
|
+
| "error"
|
|
17
|
+
| undefined;
|
|
18
|
+
class?: any;
|
|
19
|
+
style?: StyleValue;
|
|
20
|
+
icon?: string;
|
|
21
|
+
}
|
|
6
22
|
|
|
7
23
|
const props: SfMessageProps = withDefaults(
|
|
8
24
|
defineProps<SfMessageProps>(),
|
|
9
25
|
{
|
|
10
|
-
|
|
26
|
+
color: "info",
|
|
11
27
|
}
|
|
12
28
|
);
|
|
13
29
|
|
|
14
30
|
const icon = computed(() => {
|
|
15
31
|
if (!!props.icon) return props.icon;
|
|
16
|
-
switch (props.
|
|
32
|
+
switch (props.color) {
|
|
17
33
|
case "error":
|
|
18
34
|
return "cancel";
|
|
19
35
|
case "info":
|
|
@@ -31,13 +47,13 @@ const icon = computed(() => {
|
|
|
31
47
|
|
|
32
48
|
const css = computed(() => {
|
|
33
49
|
return new CssClassBuilder("sf-message")
|
|
34
|
-
.AddClass("sf-message-error", props.
|
|
35
|
-
.AddClass("sf-message-info", props.
|
|
36
|
-
.AddClass("sf-message-warning", props.
|
|
37
|
-
.AddClass("sf-message-success", props.
|
|
38
|
-
.AddClass("sf-message-help", props.
|
|
39
|
-
.AddClass("sf-message-primary", props.
|
|
40
|
-
.AddClass("sf-message-secondary", props.
|
|
50
|
+
.AddClass("sf-message-error", props.color === "error")
|
|
51
|
+
.AddClass("sf-message-info", props.color === "info")
|
|
52
|
+
.AddClass("sf-message-warning", props.color === "warn")
|
|
53
|
+
.AddClass("sf-message-success", props.color === "success")
|
|
54
|
+
.AddClass("sf-message-help", props.color === "help")
|
|
55
|
+
.AddClass("sf-message-primary", props.color === "primary")
|
|
56
|
+
.AddClass("sf-message-secondary", props.color === "secondary")
|
|
41
57
|
.AddClass(props.class)
|
|
42
58
|
.Build();
|
|
43
59
|
});
|
|
@@ -2,13 +2,7 @@ import {
|
|
|
2
2
|
ClassComponent,
|
|
3
3
|
GlobalComponentConstructor,
|
|
4
4
|
} from "../../ts-helpers";
|
|
5
|
-
|
|
6
|
-
export interface SfNavMenuLinkProps {
|
|
7
|
-
href: string;
|
|
8
|
-
text: string;
|
|
9
|
-
icon?: string;
|
|
10
|
-
exact?: boolean;
|
|
11
|
-
}
|
|
5
|
+
import { SfNavMenuLinkProps } from "./NavMenuLink.vue";
|
|
12
6
|
|
|
13
7
|
export interface SfNavMenuLinkSlots {}
|
|
14
8
|
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { SfNavMenuLinkProps } from "./NavMenuLink";
|
|
3
2
|
import { UseNavMenuService } from "../../services/navMenuService";
|
|
4
3
|
import Icon from "../icon/Icon.vue";
|
|
5
4
|
|
|
5
|
+
export interface SfNavMenuLinkProps {
|
|
6
|
+
href: string;
|
|
7
|
+
text: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
iconFilled?: boolean;
|
|
10
|
+
exact?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
const props: SfNavMenuLinkProps = defineProps<SfNavMenuLinkProps>();
|
|
7
14
|
|
|
8
15
|
const navService = UseNavMenuService();
|
|
@@ -32,7 +39,8 @@ function OnClick(ev: Event, navigate: any) {
|
|
|
32
39
|
>
|
|
33
40
|
<Icon
|
|
34
41
|
v-if="props.icon"
|
|
35
|
-
:
|
|
42
|
+
:icon="props.icon"
|
|
43
|
+
:filled="props.iconFilled"
|
|
36
44
|
:button-props="{ tabindex: -1 }"
|
|
37
45
|
/>
|
|
38
46
|
<span class="sf-navmenulink-text">{{ props.text }}</span>
|
|
@@ -2,15 +2,7 @@ import {
|
|
|
2
2
|
ClassComponent,
|
|
3
3
|
GlobalComponentConstructor,
|
|
4
4
|
} from "../../ts-helpers";
|
|
5
|
-
|
|
6
|
-
export interface SfTabNavigationTab {
|
|
7
|
-
text: string;
|
|
8
|
-
route: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface SfTabNavigationProps {
|
|
12
|
-
tabs: SfTabNavigationTab[];
|
|
13
|
-
}
|
|
5
|
+
import { SfTabNavigationProps } from "./TabNavigation.vue";
|
|
14
6
|
|
|
15
7
|
export interface SfTabNavigationSlots {
|
|
16
8
|
item: (scope: {
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { onMounted, onBeforeUnmount, ref } from "vue";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export interface SfTabNavigationTab {
|
|
5
|
+
text: string;
|
|
6
|
+
route: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface SfTabNavigationProps {
|
|
10
|
+
tabs: SfTabNavigationTab[];
|
|
11
|
+
}
|
|
4
12
|
|
|
5
13
|
const props: SfTabNavigationProps =
|
|
6
14
|
defineProps<SfTabNavigationProps>();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClassComponent,
|
|
3
|
+
GlobalComponentConstructor,
|
|
4
|
+
} from "../../ts-helpers";
|
|
5
|
+
import { SfTooltipProps } from "./Tooltip.vue";
|
|
6
|
+
|
|
7
|
+
export interface SfTooltipSlots {}
|
|
8
|
+
|
|
9
|
+
export declare type SfTooltipEmits = {};
|
|
10
|
+
|
|
11
|
+
declare class SfTooltip extends ClassComponent<
|
|
12
|
+
SfTooltipProps,
|
|
13
|
+
SfTooltipSlots,
|
|
14
|
+
SfTooltipEmits
|
|
15
|
+
> {}
|
|
16
|
+
|
|
17
|
+
declare module "@vue/runtime-core" {
|
|
18
|
+
interface GlobalComponents {
|
|
19
|
+
SfTooltip: GlobalComponentConstructor<SfTooltip>;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default SfTooltip;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onBeforeUnmount } from "vue";
|
|
3
|
+
import { GetMaxZindex } from "../internal/getMaxZindex";
|
|
4
|
+
|
|
5
|
+
export interface SfTooltipProps {
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const props = defineProps<SfTooltipProps>();
|
|
10
|
+
|
|
11
|
+
class Tooltip {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.zIndex = GetMaxZindex() + 1;
|
|
14
|
+
this.Render();
|
|
15
|
+
}
|
|
16
|
+
zIndex: number;
|
|
17
|
+
wrapper!: HTMLElement;
|
|
18
|
+
inner!: HTMLElement;
|
|
19
|
+
Render() {
|
|
20
|
+
this.wrapper = document.createElement("div");
|
|
21
|
+
this.wrapper.classList.add("sf-tooltip-wrapper");
|
|
22
|
+
this.wrapper.style.zIndex = `${this.zIndex ?? 0}`;
|
|
23
|
+
this.inner = document.createElement("div");
|
|
24
|
+
this.inner.classList.add("sf-tooltip-inner");
|
|
25
|
+
this.wrapper.appendChild(this.inner);
|
|
26
|
+
}
|
|
27
|
+
Show(ev: MouseEvent) {
|
|
28
|
+
this.inner.textContent = props.text;
|
|
29
|
+
const target = ev.target as HTMLDivElement;
|
|
30
|
+
document.body.appendChild(this.wrapper);
|
|
31
|
+
this.Position(target.getBoundingClientRect());
|
|
32
|
+
this.wrapper.classList.add("visible");
|
|
33
|
+
}
|
|
34
|
+
Hide() {
|
|
35
|
+
this.wrapper.classList.remove("visible");
|
|
36
|
+
this.wrapper.remove();
|
|
37
|
+
}
|
|
38
|
+
Position(rect: DOMRect) {
|
|
39
|
+
const offset = 10;
|
|
40
|
+
const top = rect.top;
|
|
41
|
+
const bottom = rect.bottom;
|
|
42
|
+
const left = rect.left;
|
|
43
|
+
const right = rect.right;
|
|
44
|
+
const margin = rect.width / 2 - 15;
|
|
45
|
+
const wrapper = this.wrapper;
|
|
46
|
+
wrapper.style.top = `${bottom + offset}px`;
|
|
47
|
+
wrapper.style.left = `${left}px`;
|
|
48
|
+
wrapper.style.marginLeft = `${margin}px`;
|
|
49
|
+
if (this.OutOfBottom()) {
|
|
50
|
+
wrapper.style.top = `${top - wrapper.clientHeight - offset}px`;
|
|
51
|
+
wrapper.classList.add("top");
|
|
52
|
+
}
|
|
53
|
+
if (this.OutOfRight()) {
|
|
54
|
+
wrapper.style.left = `${right - wrapper.clientWidth}px`;
|
|
55
|
+
wrapper.style.marginLeft = `-${margin}px`;
|
|
56
|
+
wrapper.classList.add("left");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
OutOfBottom() {
|
|
60
|
+
const rect = this.wrapper.getBoundingClientRect();
|
|
61
|
+
return (
|
|
62
|
+
rect.bottom >
|
|
63
|
+
(window.innerHeight || document.documentElement.clientHeight)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
OutOfRight() {
|
|
67
|
+
const rect = this.wrapper.getBoundingClientRect();
|
|
68
|
+
return (
|
|
69
|
+
rect.right >
|
|
70
|
+
(window.innerWidth || document.documentElement.clientWidth)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const TooltipInstance = new Tooltip();
|
|
76
|
+
|
|
77
|
+
onBeforeUnmount(() => {
|
|
78
|
+
TooltipInstance.Hide();
|
|
79
|
+
});
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<div
|
|
84
|
+
class="sf-tooltip-anchor"
|
|
85
|
+
@mouseenter="TooltipInstance.Show"
|
|
86
|
+
@mouseleave="TooltipInstance.Hide"
|
|
87
|
+
@mousedown="TooltipInstance.Hide"
|
|
88
|
+
>
|
|
89
|
+
<slot name="default"></slot>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
package/src/index.ts
CHANGED
|
@@ -6,15 +6,17 @@ import SfTabNavigation from "./components/tabnavigation/TabNavigation.vue";
|
|
|
6
6
|
import SfButton from "./components/button/Button.vue";
|
|
7
7
|
import SfDrawer from "./components/drawer/Drawer.vue";
|
|
8
8
|
import SfMessage from "./components/message/Message.vue";
|
|
9
|
+
import SfTooltip from "./components/tooltip/Tooltip.vue";
|
|
9
10
|
import { ThemeToggleBase } from "./components/internal/ThemeToggle";
|
|
10
11
|
|
|
11
12
|
import { UseNavMenuService } from "./services/navMenuService";
|
|
12
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
UseAlertService,
|
|
15
|
+
UseConfirmService,
|
|
16
|
+
} from "./services/dialogService";
|
|
13
17
|
import { UseAuthService } from "./services/authService";
|
|
14
18
|
import { AppResult } from "./common/appResult";
|
|
15
19
|
|
|
16
|
-
import { Cor, Tamanho } from "./enum";
|
|
17
|
-
|
|
18
20
|
import "./style/componentes.scss";
|
|
19
21
|
import { AxiosClient, UseAxiosClient } from "./axios/axiosClient";
|
|
20
22
|
|
|
@@ -27,13 +29,13 @@ export {
|
|
|
27
29
|
SfButton,
|
|
28
30
|
SfDrawer,
|
|
29
31
|
SfMessage,
|
|
32
|
+
SfTooltip,
|
|
30
33
|
UseAuthService,
|
|
31
34
|
UseNavMenuService,
|
|
32
|
-
|
|
35
|
+
UseConfirmService,
|
|
36
|
+
UseAlertService,
|
|
33
37
|
UseAxiosClient,
|
|
34
38
|
AppResult,
|
|
35
|
-
Cor,
|
|
36
|
-
Tamanho,
|
|
37
39
|
AxiosClient,
|
|
38
40
|
};
|
|
39
41
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Swal from "sweetalert2";
|
|
1
|
+
import Swal, { SweetAlertIcon } from "sweetalert2";
|
|
2
2
|
import DOMPurify from "dompurify";
|
|
3
3
|
|
|
4
4
|
interface ConfirmOptions {
|
|
@@ -11,15 +11,77 @@ interface ConfirmOptions {
|
|
|
11
11
|
interface AlertOptions {
|
|
12
12
|
text: string | string[];
|
|
13
13
|
title?: string;
|
|
14
|
-
icon?:
|
|
14
|
+
icon?: SweetAlertIcon;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
class
|
|
17
|
+
class Base {
|
|
18
18
|
get IsVisible(): boolean {
|
|
19
19
|
return Swal.isVisible();
|
|
20
20
|
}
|
|
21
|
+
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
class AlertService extends Base {
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
}
|
|
27
|
+
async CreateAlertAsync(
|
|
28
|
+
options: AlertOptions | string | string[]
|
|
29
|
+
): Promise<boolean> {
|
|
30
|
+
let icon: SweetAlertIcon = "info";
|
|
31
|
+
let html: string;
|
|
32
|
+
let title: string;
|
|
33
|
+
if (typeof options === "string" || Array.isArray(options)) {
|
|
34
|
+
html = Array.isArray(options)
|
|
35
|
+
? options.join("<br />")
|
|
36
|
+
: options;
|
|
37
|
+
} else {
|
|
38
|
+
icon = options.icon ?? "info";
|
|
39
|
+
title = options.title ?? "";
|
|
40
|
+
html = Array.isArray(options.text)
|
|
41
|
+
? options.text.join("<br />")
|
|
42
|
+
: options.text;
|
|
43
|
+
}
|
|
44
|
+
return new Promise((r) => {
|
|
45
|
+
Swal.fire({
|
|
46
|
+
allowEscapeKey: false,
|
|
47
|
+
allowOutsideClick: false,
|
|
48
|
+
icon,
|
|
49
|
+
title,
|
|
50
|
+
html: `<div style="max-height: 50vh; overflow: auto">${DOMPurify.sanitize(
|
|
51
|
+
html
|
|
52
|
+
)}</div>`,
|
|
53
|
+
}).then(() => r(true));
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async AlertAsync(message: string | string[]): Promise<boolean> {
|
|
58
|
+
return this.CreateAlertAsync({
|
|
59
|
+
text: message,
|
|
60
|
+
icon: "info",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async AlertErrorAsync(error: string | string[]): Promise<boolean> {
|
|
65
|
+
return this.CreateAlertAsync({
|
|
66
|
+
text: error,
|
|
67
|
+
icon: "error",
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async AlertSuccessAsync(
|
|
72
|
+
message: string | string[]
|
|
73
|
+
): Promise<boolean> {
|
|
74
|
+
return this.CreateAlertAsync({
|
|
75
|
+
text: message,
|
|
76
|
+
icon: "success",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
class ConfirmService extends Base {
|
|
82
|
+
async CreateConfirmAsync(
|
|
83
|
+
options: ConfirmOptions
|
|
84
|
+
): Promise<boolean> {
|
|
23
85
|
return new Promise((r) => {
|
|
24
86
|
Swal.fire({
|
|
25
87
|
showCancelButton: true,
|
|
@@ -35,29 +97,13 @@ class DialogService {
|
|
|
35
97
|
});
|
|
36
98
|
});
|
|
37
99
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
let html: string;
|
|
42
|
-
if (Array.isArray(options.text)) {
|
|
43
|
-
html = `<div style="max-height: 50vh; overflow: auto">
|
|
44
|
-
${options.text.join("<br />")}
|
|
45
|
-
</div>`;
|
|
46
|
-
} else {
|
|
47
|
-
html = options.text;
|
|
48
|
-
}
|
|
49
|
-
return new Promise((r) => {
|
|
50
|
-
Swal.fire({
|
|
51
|
-
allowEscapeKey: false,
|
|
52
|
-
allowOutsideClick: false,
|
|
53
|
-
icon,
|
|
54
|
-
title: options.title,
|
|
55
|
-
html: DOMPurify.sanitize(html),
|
|
56
|
-
}).then(() => r(true));
|
|
100
|
+
async ConfirmAsync(message: string) {
|
|
101
|
+
return this.CreateConfirmAsync({
|
|
102
|
+
text: message,
|
|
57
103
|
});
|
|
58
104
|
}
|
|
59
105
|
}
|
|
60
106
|
|
|
61
|
-
const
|
|
107
|
+
export const UseAlertService = () => new AlertService();
|
|
62
108
|
|
|
63
|
-
export const
|
|
109
|
+
export const UseConfirmService = () => new ConfirmService();
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
@import "../variables";
|
|
2
2
|
@import "../mixins";
|
|
3
3
|
|
|
4
|
+
.material-symbols-outlined {
|
|
5
|
+
font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
|
|
6
|
+
&.icon-filled {
|
|
7
|
+
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
4
11
|
div.#{$prefix}icon {
|
|
5
12
|
position: relative;
|
|
6
13
|
display: inline-flex;
|
|
@@ -37,13 +44,6 @@ div.#{$prefix}icon {
|
|
|
37
44
|
}
|
|
38
45
|
}
|
|
39
46
|
|
|
40
|
-
&.#{$prefix}icon-filled {
|
|
41
|
-
button {
|
|
42
|
-
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0,
|
|
43
|
-
"opsz" 48;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
47
|
&.#{$prefix}icon-small {
|
|
48
48
|
min-width: 28px;
|
|
49
49
|
> button {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
.#{$prefix}tooltip-wrapper {
|
|
2
2
|
--arrow-width: 7.5px;
|
|
3
3
|
pointer-events: none;
|
|
4
4
|
width: 120px;
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
opacity: 0;
|
|
10
10
|
transition: opacity 0.3s;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
.#{$prefix}tooltip-inner {
|
|
13
13
|
position: relative;
|
|
14
|
-
padding:
|
|
14
|
+
padding: 5px 2px;
|
|
15
15
|
border-radius: 4px;
|
|
16
16
|
background-color: var(--text-color);
|
|
17
|
-
font-size: 0.
|
|
17
|
+
font-size: 0.825rem;
|
|
18
18
|
|
|
19
19
|
&::after {
|
|
20
20
|
content: "";
|
|
21
21
|
position: absolute;
|
|
22
22
|
left: var(--arrow-width);
|
|
23
|
-
top: calc(var(--arrow-width) * -
|
|
23
|
+
top: calc(var(--arrow-width) * -0.75);
|
|
24
24
|
border-left: var(--arrow-width) solid transparent;
|
|
25
25
|
border-right: var(--arrow-width) solid transparent;
|
|
26
26
|
border-bottom: var(--arrow-width) solid var(--text-color);
|
|
@@ -31,25 +31,24 @@
|
|
|
31
31
|
opacity: 1;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
&.top
|
|
34
|
+
&.top .#{$prefix}tooltip-inner::after {
|
|
35
35
|
top: unset;
|
|
36
|
-
bottom: calc(var(--arrow-width) * -
|
|
36
|
+
bottom: calc(var(--arrow-width) * -0.75);
|
|
37
37
|
border-bottom: unset;
|
|
38
38
|
border-top: var(--arrow-width) solid var(--text-color);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
&.left
|
|
41
|
+
&.left .#{$prefix}tooltip-inner::after {
|
|
42
42
|
left: unset;
|
|
43
43
|
right: var(--arrow-width);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
.#{$prefix}tooltip-anchor {
|
|
48
48
|
display: inline !important;
|
|
49
49
|
border-radius: 50%;
|
|
50
|
-
&:has(.
|
|
51
|
-
&:has(.
|
|
52
|
-
&:has(.sf-component-freeze) {
|
|
50
|
+
&:has(.component-disabled),
|
|
51
|
+
&:has(.component-loading) {
|
|
53
52
|
pointer-events: none !important;
|
|
54
53
|
}
|
|
55
54
|
}
|