@luizleon/sf.prefeiturasp.vuecomponents 4.0.1 → 4.0.3

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.
Files changed (95) hide show
  1. package/dist/{src/axios → axios}/axiosClient.d.ts +3 -3
  2. package/dist/{src/components/button/Button.vue.d.ts → components/button/Button.d.ts} +3 -3
  3. package/dist/{src/components/content/Content.vue.d.ts → components/content/Content.d.ts} +2 -2
  4. package/dist/{src/components/drawer/Drawer.vue.d.ts → components/drawer/Drawer.d.ts} +4 -4
  5. package/dist/{src/components/icon/Icon.vue.d.ts → components/icon/Icon.d.ts} +4 -4
  6. package/dist/components/internal/HeaderAvatar.d.ts +6 -0
  7. package/dist/components/internal/LoadingCircle.d.ts +2 -0
  8. package/dist/components/internal/MenuIcon.d.ts +2 -0
  9. package/dist/components/internal/ScrollToTop.d.ts +2 -0
  10. package/dist/components/internal/ThemeToggle.d.ts +2 -0
  11. package/dist/components/layout/Layout.d.ts +19 -0
  12. package/dist/{src/components/message/Message.vue.d.ts → components/message/Message.d.ts} +3 -3
  13. package/dist/components/navmenu/NavMenu.d.ts +15 -0
  14. package/dist/{src/components/tabnavigation/TabNavigation.vue.d.ts → components/tabnavigation/TabNavigation.d.ts} +1 -1
  15. package/dist/{src/components/tooltip/Tooltip.vue.d.ts → components/tooltip/Tooltip.d.ts} +1 -1
  16. package/dist/index.d.ts +16 -0
  17. package/dist/{src/services → services}/authService.d.ts +2 -2
  18. package/dist/{src/services → services}/dialogService.d.ts +1 -1
  19. package/dist/sf.prefeiturasp.vuecomponents.cjs.map +1 -1
  20. package/dist/sf.prefeiturasp.vuecomponents.js.map +1 -1
  21. package/dist/sf.prefeiturasp.vuecomponents.umd.cjs.map +1 -1
  22. package/dist/{src/types → types}/index.d.ts +1 -1
  23. package/package.json +7 -6
  24. package/dist/src/components/internal/HeaderAvatar.vue.d.ts +0 -6
  25. package/dist/src/components/internal/LoadingCircle.vue.d.ts +0 -2
  26. package/dist/src/components/internal/MenuIcon.vue.d.ts +0 -2
  27. package/dist/src/components/internal/ScrollToTop.vue.d.ts +0 -2
  28. package/dist/src/components/internal/ThemeToggle.d.ts +0 -10
  29. package/dist/src/components/internal/ThemeToggle.vue.d.ts +0 -2
  30. package/dist/src/components/layout/Layout.vue.d.ts +0 -27
  31. package/dist/src/components/navmenu/NavMenu.vue.d.ts +0 -15
  32. package/dist/src/index.d.ts +0 -17
  33. package/dist/tsconfig.tsbuildinfo +0 -1
  34. package/src/axios/axiosClient.ts +0 -207
  35. package/src/common/appResult.ts +0 -34
  36. package/src/components/button/Button.vue +0 -104
  37. package/src/components/content/Content.vue +0 -49
  38. package/src/components/drawer/Drawer.vue +0 -146
  39. package/src/components/icon/Icon.vue +0 -96
  40. package/src/components/internal/HeaderAvatar.vue +0 -73
  41. package/src/components/internal/LoadingCircle.vue +0 -16
  42. package/src/components/internal/MenuIcon.vue +0 -13
  43. package/src/components/internal/ScrollToTop.vue +0 -26
  44. package/src/components/internal/ThemeToggle.ts +0 -41
  45. package/src/components/internal/ThemeToggle.vue +0 -23
  46. package/src/components/internal/cssClassBuilder.ts +0 -44
  47. package/src/components/internal/getMaxZindex.ts +0 -15
  48. package/src/components/layout/Layout.vue +0 -67
  49. package/src/components/message/Message.vue +0 -65
  50. package/src/components/navmenu/NavMenu.vue +0 -109
  51. package/src/components/tabnavigation/TabNavigation.vue +0 -125
  52. package/src/components/tooltip/Tooltip.vue +0 -91
  53. package/src/index.ts +0 -53
  54. package/src/keycloak.js +0 -1731
  55. package/src/services/authService.ts +0 -118
  56. package/src/services/dialogService.ts +0 -109
  57. package/src/services/navMenuService.ts +0 -21
  58. package/src/style/componentes.scss +0 -20
  59. package/src/style/src/_functions.scss +0 -19
  60. package/src/style/src/_mixins.scss +0 -193
  61. package/src/style/src/_variables.scss +0 -12
  62. package/src/style/src/components/_button.scss +0 -104
  63. package/src/style/src/components/_content.scss +0 -57
  64. package/src/style/src/components/_drawer.scss +0 -89
  65. package/src/style/src/components/_headerAvatar.scss +0 -22
  66. package/src/style/src/components/_icon.scss +0 -119
  67. package/src/style/src/components/_layout.scss +0 -160
  68. package/src/style/src/components/_loading-circle.scss +0 -24
  69. package/src/style/src/components/_mask.scss +0 -35
  70. package/src/style/src/components/_message.scss +0 -47
  71. package/src/style/src/components/_navmenulink.scss +0 -31
  72. package/src/style/src/components/_scrollToTop.scss +0 -28
  73. package/src/style/src/components/_svg_icon.scss +0 -5
  74. package/src/style/src/components/_tab-navigation.scss +0 -93
  75. package/src/style/src/components/_themetoggle.scss +0 -52
  76. package/src/style/src/components/_tooltip.scss +0 -53
  77. package/src/style/src/sweetalert/_sweetalert.scss +0 -9
  78. package/src/style/src/sweetalert/scss/_animations.scss +0 -197
  79. package/src/style/src/sweetalert/scss/_body.scss +0 -45
  80. package/src/style/src/sweetalert/scss/_core.scss +0 -862
  81. package/src/style/src/sweetalert/scss/_mixins.scss +0 -16
  82. package/src/style/src/sweetalert/scss/_theming.scss +0 -8
  83. package/src/style/src/sweetalert/scss/_toasts-animations.scss +0 -83
  84. package/src/style/src/sweetalert/scss/_toasts-body.scss +0 -85
  85. package/src/style/src/sweetalert/scss/_toasts.scss +0 -203
  86. package/src/style/src/sweetalert/scss/_variables.scss +0 -271
  87. package/src/types/index.ts +0 -59
  88. package/src/vite-env.d.ts +0 -1
  89. package/tsconfig.json +0 -22
  90. package/vite.config.js +0 -28
  91. /package/dist/{src/common → common}/appResult.d.ts +0 -0
  92. /package/dist/{src/components → components}/internal/cssClassBuilder.d.ts +0 -0
  93. /package/dist/{src/components → components}/internal/getMaxZindex.d.ts +0 -0
  94. /package/{src → dist}/keycloak.d.ts +0 -0
  95. /package/dist/{src/services → services}/navMenuService.d.ts +0 -0
@@ -1,146 +0,0 @@
1
- <script setup lang="ts">
2
- import { StyleValue, ref, useSlots, watch } from "vue";
3
- import { CssClassBuilder } from "../internal/cssClassBuilder";
4
- import { GetMaxZindex } from "../internal/getMaxZindex";
5
- import { nanoid } from "nanoid";
6
- import SfIcon from "../icon/Icon.vue";
7
-
8
- export interface SfDrawerProps {
9
- visible: boolean;
10
- /**
11
- * @default 'left'
12
- */
13
- position?: "left" | "right" | "bottom" | "full";
14
- style?: StyleValue;
15
- }
16
-
17
- const props: SfDrawerProps = withDefaults(
18
- defineProps<SfDrawerProps>(),
19
- {
20
- visible: false,
21
- position: "left",
22
- }
23
- );
24
-
25
- const emit = defineEmits<{
26
- (e: "update:visible", v: boolean): void;
27
- (e: "open"): void;
28
- (e: "before-close"): void;
29
- }>();
30
-
31
- const slots = useSlots();
32
-
33
- const visible = ref(props.visible);
34
-
35
- const maskVisible = ref(false);
36
-
37
- const zIndex = ref(0);
38
-
39
- const id = nanoid();
40
-
41
- function Close() {
42
- visible.value = false;
43
- }
44
-
45
- function OnKeydown(ev: KeyboardEvent) {
46
- if (ev.key === "Escape" || ev.code === "Escape") {
47
- Close();
48
- }
49
- }
50
-
51
- function OnEnter() {
52
- emit("open");
53
- window.document.addEventListener("keydown", OnKeydown, true);
54
- }
55
-
56
- function OnBeforeEnter(el: Element) {
57
- zIndex.value = GetMaxZindex();
58
- (el as HTMLElement).style.zIndex = `${zIndex.value}`;
59
- }
60
-
61
- function OnBeforeLeave(el: Element) {
62
- emit("before-close");
63
- el?.parentElement?.classList.add("sf-mask-overlay-leave");
64
- }
65
-
66
- function OnAfterLeave() {
67
- window.document.removeEventListener("keydown", OnKeydown, true);
68
- maskVisible.value = false;
69
- }
70
-
71
- function CssMask() {
72
- return new CssClassBuilder("sf-mask sf-mask-overlay")
73
- .AddClass("right", props.position === "right")
74
- .AddClass("bottom", props.position === "bottom")
75
- .AddClass("full", props.position === "full")
76
- .AddClass("sf-mask-overlay-enter", props.visible === true)
77
- .Build();
78
- }
79
-
80
- watch(
81
- () => props.visible,
82
- (v) => {
83
- visible.value = v;
84
- }
85
- );
86
- watch(
87
- () => visible.value,
88
- (v) => {
89
- emit("update:visible", v);
90
- if (v) {
91
- maskVisible.value = true;
92
- }
93
- }
94
- );
95
- </script>
96
-
97
- <template>
98
- <Teleport :to="'body'">
99
- <div
100
- v-if="maskVisible"
101
- :id="id"
102
- :class="CssMask()"
103
- :style="{ zIndex: zIndex - 1 }"
104
- @click.stop="Close"
105
- >
106
- <transition
107
- name="sf-drawer"
108
- appear
109
- @before-enter="OnBeforeEnter"
110
- @enter="OnEnter"
111
- @before-leave="OnBeforeLeave"
112
- @after-leave="OnAfterLeave"
113
- >
114
- <div
115
- v-if="visible"
116
- :class="[
117
- 'sf-drawer',
118
- {
119
- 'sf-drawer-with-footer': !!slots.footer,
120
- },
121
- ]"
122
- :style="props.style"
123
- role="dialog"
124
- @click.stop="void"
125
- >
126
- <div class="sf-drawer-header">
127
- <span class="sf-drawer-title">
128
- <slot name="title"></slot>
129
- </span>
130
- <SfIcon
131
- :button="true"
132
- :icon="'close'"
133
- @click.stop="Close"
134
- />
135
- </div>
136
- <div class="sf-drawer-content">
137
- <slot name="default"></slot>
138
- </div>
139
- <div class="sf-drawer-footer" v-if="slots.footer">
140
- <slot name="footer"></slot>
141
- </div>
142
- </div>
143
- </transition>
144
- </div>
145
- </Teleport>
146
- </template>
@@ -1,96 +0,0 @@
1
- <script setup lang="ts">
2
- import { ButtonHTMLAttributes, StyleValue, computed } from "vue";
3
- import LoadingCircle from "../internal/LoadingCircle.vue";
4
- import { CssClassBuilder } from "../internal/cssClassBuilder";
5
- import Tooltip from "../tooltip/Tooltip.vue";
6
- import { Color, IconSize } from "../../types";
7
-
8
- export interface SfIconProps {
9
- icon?: string;
10
- visible?: boolean;
11
- class?: any;
12
- style?: StyleValue;
13
- disabled?: boolean;
14
- loading?: boolean;
15
- button?: boolean;
16
- size?: IconSize;
17
- dot?: boolean;
18
- dotColor?: Color;
19
- filled?: boolean;
20
- buttonProps?: ButtonHTMLAttributes;
21
- tooltip?: string;
22
- color?: Color | "inherit";
23
- }
24
-
25
- const props: SfIconProps = withDefaults(defineProps<SfIconProps>(), {
26
- visible: true,
27
- class: "",
28
- style: "",
29
- size: "md",
30
- dotColor: "error",
31
- color: "inherit",
32
- });
33
-
34
- const dynamicComponent = computed(() =>
35
- props.tooltip ? Tooltip : "div"
36
- );
37
-
38
- const componentClass = computed(() => {
39
- return props.tooltip ? "" : "display-content";
40
- });
41
-
42
- const cssClass = computed(() => {
43
- return new CssClassBuilder(`${props.class} sf-icon`)
44
- .AddClass("sf-component-loading", props.loading)
45
- .AddClass("sf-component-disabled", props.disabled)
46
- .AddClass("sf-icon-button", props.button)
47
- .AddClass("sf-icon-small", props.size === "sm")
48
- .AddClass("sf-icon-medium", props.size === "md")
49
- .AddClass("sf-icon-large", props.size === "lg")
50
- .AddClass("sf-icon-xlarge", props.size === "xl")
51
- .AddClass("sf-icon-2xlarge", props.size === "2xl")
52
- .AddClass("sf-icon-3xlarge", props.size === "3xl")
53
- .AddClass("sf-ripple", props.button === true)
54
- .AddClass(
55
- `${props.color}-color`,
56
- !!props.color && props.color !== "inherit"
57
- )
58
- .Build();
59
- });
60
- </script>
61
-
62
- <template>
63
- <component
64
- :is="dynamicComponent"
65
- :text="props.tooltip"
66
- :class="componentClass"
67
- >
68
- <div
69
- v-if="!!props.visible"
70
- :style="props.style"
71
- :class="cssClass"
72
- >
73
- <button
74
- :class="[
75
- 'material-symbols-outlined',
76
- { 'icon-filled': !!props.filled },
77
- ]"
78
- :disabled="props.disabled || props.loading"
79
- v-bind="props.buttonProps"
80
- :tabindex="!props.button ? -1 : undefined"
81
- >
82
- <template v-if="props.loading">
83
- <LoadingCircle></LoadingCircle>
84
- </template>
85
- <template v-else>{{ props.icon }}</template>
86
- </button>
87
- <span v-if="props.dot" :data-color="props.dotColor"></span>
88
- </div>
89
- </component>
90
- </template>
91
-
92
- <style scoped>
93
- .display-content {
94
- display: contents;
95
- }
96
- </style>
@@ -1,73 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, onMounted, ref } from "vue";
3
- import SfDrawer from "../drawer/Drawer.vue";
4
- import SfButton from "../button/Button.vue";
5
- import { UseConfirmService } from "../../services/dialogService";
6
-
7
- const confirmService = UseConfirmService();
8
-
9
- const letters = ref("?");
10
-
11
- const emit = defineEmits<{
12
- (event: "logout"): void;
13
- }>();
14
-
15
- async function Logout() {
16
- const confirm = await confirmService.CreateConfirmAsync({
17
- text: `Você deseja sair da conta?`,
18
- confirmLabel: "sair",
19
- });
20
- if (!confirm) return;
21
- emit("logout");
22
- }
23
-
24
- function Letters() {
25
- const name = sessionStorage.getItem("name");
26
- let letters = "?";
27
- if (!name) return letters;
28
-
29
- const parts = name
30
- .split(" ")
31
- .filter((x) => x.length > 0)
32
- .map((x) => x[0].toUpperCase());
33
-
34
- const count = Math.min(2, parts.length);
35
-
36
- letters = parts.slice(0, count).join("");
37
-
38
- return letters.length > 0 ? letters : "?";
39
- }
40
-
41
- const color = computed(() => {
42
- const primeiraLetra = letters.value[0];
43
- const cor =
44
- primeiraLetra === "?"
45
- ? 0
46
- : (primeiraLetra.charCodeAt(0) - 64) % 19;
47
- return Math.max(cor, 0);
48
- });
49
-
50
- const showDrawer = ref(false);
51
-
52
- onMounted(() => {
53
- letters.value = Letters();
54
- });
55
- </script>
56
-
57
- <template>
58
- <div
59
- id="sf-header-avatar"
60
- :data-cor="color"
61
- @click="showDrawer = true"
62
- >
63
- {{ letters }}
64
- </div>
65
- <SfDrawer v-model:visible="showDrawer" :position="'right'">
66
- <template #title>Minha conta</template>
67
- <template #default>
68
- <div class="sf-p-4">
69
- <SfButton :color="'error'" @click="Logout">Sair</SfButton>
70
- </div>
71
- </template>
72
- </SfDrawer>
73
- </template>
@@ -1,16 +0,0 @@
1
- <template>
2
- <div class="sf-loading-circle">
3
- <div>
4
- <svg viewBox="25 25 50 50">
5
- <circle
6
- cx="50"
7
- cy="50"
8
- r="20"
9
- fill="none"
10
- stroke-width="4"
11
- stroke-miterlimit="10"
12
- ></circle>
13
- </svg>
14
- </div>
15
- </div>
16
- </template>
@@ -1,13 +0,0 @@
1
- <template>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- height="48"
5
- viewBox="0 -960 960 960"
6
- width="48"
7
- class="sf-svg-icon"
8
- >
9
- <path
10
- d="m307.231-83.463-54.999-55.23 343.923-343.922-343.923-343.539 54.999-54.614 398.153 398.153L307.231-83.462Z"
11
- />
12
- </svg>
13
- </template>
@@ -1,26 +0,0 @@
1
- <script setup lang="ts">
2
- import { onMounted, ref } from "vue";
3
-
4
- const visible = ref(false);
5
- const id = `--${+new Date()}`;
6
- let parent: HTMLElement | null = null;
7
-
8
- function ButtonClick() {
9
- parent?.scrollTo(0, 0);
10
- }
11
-
12
- onMounted(() => {
13
- parent = document.getElementById(id)?.parentElement ?? null;
14
- if (!parent) return;
15
- parent.addEventListener("scroll", function () {
16
- visible.value = this.scrollTop - this.clientHeight > 0;
17
- });
18
- });
19
- </script>
20
- <template>
21
- <button
22
- :id="id"
23
- :class="['sf-scrollToTop', { 'sf-scrollToTop-visible': visible }]"
24
- @click="ButtonClick"
25
- ></button>
26
- </template>
@@ -1,41 +0,0 @@
1
- class ThemeToggle {
2
- get storedTheme() {
3
- return localStorage.getItem("color-scheme") as
4
- | "light"
5
- | "dark"
6
- | null;
7
- }
8
- get IsDark() {
9
- return document.documentElement.classList.contains("dark");
10
- }
11
- Toggle() {
12
- this.IsDark ? this.EnableLightMode() : this.EnableDarkMode();
13
- }
14
- EnableDarkMode() {
15
- document.documentElement.classList.add("dark");
16
- document.documentElement.classList.remove("light");
17
- localStorage.setItem("color-scheme", "dark");
18
- }
19
- EnableLightMode() {
20
- document.documentElement.classList.remove("dark");
21
- document.documentElement.classList.add("light");
22
- localStorage.setItem("color-scheme", "light");
23
- }
24
- SetInitialTheme() {
25
- if (this.storedTheme === "light") {
26
- return this.EnableLightMode();
27
- }
28
- if (this.storedTheme === "dark") {
29
- return this.EnableDarkMode();
30
- }
31
- if (
32
- window.matchMedia &&
33
- window.matchMedia("(prefers-color-scheme: dark)").matches
34
- ) {
35
- return this.EnableDarkMode();
36
- }
37
- this.EnableLightMode();
38
- }
39
- }
40
-
41
- export const ThemeToggleBase = (() => new ThemeToggle())();
@@ -1,23 +0,0 @@
1
- <script setup lang="ts">
2
- import { ThemeToggleBase } from "./ThemeToggle";
3
- </script>
4
-
5
- <template>
6
- <button id="sf-theme-toggle" @click="ThemeToggleBase.Toggle">
7
- <svg
8
- xmlns="http://www.w3.org/2000/svg"
9
- width="472.39"
10
- height="472.39"
11
- viewBox="0 0 472.39 472.39"
12
- >
13
- <g class="toggle-sun">
14
- <path
15
- d="M403.21,167V69.18H305.38L236.2,0,167,69.18H69.18V167L0,236.2l69.18,69.18v97.83H167l69.18,69.18,69.18-69.18h97.83V305.38l69.18-69.18Zm-167,198.17a129,129,0,1,1,129-129A129,129,0,0,1,236.2,365.19Z"
16
- />
17
- </g>
18
- <g class="toggle-circle">
19
- <circle class="cls-1" cx="236.2" cy="236.2" r="103.78" />
20
- </g>
21
- </svg>
22
- </button>
23
- </template>
@@ -1,44 +0,0 @@
1
- /**
2
- * A utility class for building CSS class strings.
3
- */
4
- export class CssClassBuilder {
5
- /**
6
- * Creates a new instance of the CssClassBuilder class.
7
- * @param value The initial value of the CSS class string.
8
- */
9
- constructor(value: string) {
10
- this.retorno = value ?? "";
11
- }
12
-
13
- retorno: string;
14
-
15
- /**
16
- * Concatenates a new CSS class to the existing string.
17
- * @param value The CSS class to concatenate.
18
- * @returns The current instance of the CssClassBuilder class.
19
- */
20
- private Concat(value?: string) {
21
- if (value && value.trim().length) {
22
- this.retorno += ` ${value}`;
23
- }
24
- return this;
25
- }
26
-
27
- /**
28
- * Adds a new CSS class to the string if the specified condition is true.
29
- * @param value The CSS class to add.
30
- * @param when The condition that determines whether to add the CSS class.
31
- * @returns The current instance of the CssClassBuilder class.
32
- */
33
- AddClass(value?: string, when: boolean = true) {
34
- return when ? this.Concat(value) : this;
35
- }
36
-
37
- /**
38
- * Builds the final CSS class string.
39
- * @returns The final CSS class string.
40
- */
41
- Build() {
42
- return this.retorno.trim();
43
- }
44
- }
@@ -1,15 +0,0 @@
1
- function GetMaxZindex(seletores: string[] = []) {
2
- let selector = "body > *:not(script):not(style)";
3
- for (const s of seletores) {
4
- selector += `, ${s}`;
5
- }
6
- const max = Math.max(
7
- ...Array.from(document.querySelectorAll(selector)).map((x) => {
8
- const z = getComputedStyle(x).zIndex;
9
- return +z === +z ? +z : 0;
10
- })
11
- );
12
- return max >= 100 ? max : 100;
13
- }
14
-
15
- export { GetMaxZindex };
@@ -1,67 +0,0 @@
1
- <script setup lang="ts">
2
- import { onMounted } from "vue";
3
- import { UseNavMenuService } from "../../services/navMenuService";
4
- import HeaderAvatar from "../internal/HeaderAvatar.vue";
5
- import MenuIcon from "../internal/MenuIcon.vue";
6
- import ThemeToggle from "../internal/ThemeToggle.vue";
7
- import SfTooltip from "../tooltip/Tooltip.vue";
8
-
9
- export interface SfLayoutProps {}
10
-
11
- export interface SfLayoutSlots {
12
- title: {};
13
- action: {};
14
- menu: {};
15
- content: {};
16
- }
17
-
18
- const navService = UseNavMenuService();
19
-
20
- const emit = defineEmits<{
21
- (event: "mounted"): void;
22
- (event: "logout"): void;
23
- }>();
24
-
25
- onMounted(() => {
26
- emit("mounted");
27
- });
28
- </script>
29
-
30
- <template>
31
- <div id="sf-layout">
32
- <header>
33
- <div
34
- :class="[
35
- 'sf-layout-menu-toggler',
36
- { invert: navService.IsVisible },
37
- ]"
38
- @click="navService.Toggle()"
39
- >
40
- <div class="sf-layout-menu-toggler-logo"></div>
41
- <MenuIcon />
42
- </div>
43
- <div class="title">
44
- <slot name="title"></slot>
45
- </div>
46
- <slot name="action"> </slot>
47
- <SfTooltip :text="'Tema'">
48
- <ThemeToggle />
49
- </SfTooltip>
50
- <HeaderAvatar @logout="emit('logout')" />
51
- </header>
52
- <nav :class="{ visible: navService.IsVisible }">
53
- <div class="sf-layout-nav-content">
54
- <slot name="menu"></slot>
55
- </div>
56
- <div class="sf-layout-nav-footer">
57
- <div class="sf-layout-nav-footer-logo"></div>
58
- </div>
59
- </nav>
60
- <main :class="{ 'menu-visible': navService.IsVisible }">
61
- <section id="sf-layout-page-title"></section>
62
- <section id="sf-layout-content">
63
- <slot name="content"></slot>
64
- </section>
65
- </main>
66
- </div>
67
- </template>
@@ -1,65 +0,0 @@
1
- <script lang="ts" setup>
2
- import { CssClassBuilder } from "../internal/cssClassBuilder";
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
- }
22
-
23
- const props: SfMessageProps = withDefaults(
24
- defineProps<SfMessageProps>(),
25
- {
26
- color: "info",
27
- }
28
- );
29
-
30
- const icon = computed(() => {
31
- if (!!props.icon) return props.icon;
32
- switch (props.color) {
33
- case "error":
34
- return "cancel";
35
- case "info":
36
- return "info";
37
- case "warn":
38
- return "warning";
39
- case "success":
40
- return "check";
41
- case "help":
42
- return "help";
43
- default:
44
- return null;
45
- }
46
- });
47
-
48
- const css = computed(() => {
49
- return new CssClassBuilder("sf-message")
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")
57
- .AddClass(props.class)
58
- .Build();
59
- });
60
- </script>
61
- <template>
62
- <div :class="css" :data-icon="icon">
63
- <slot name="default"></slot>
64
- </div>
65
- </template>