@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,109 +0,0 @@
1
- <script setup lang="ts">
2
- import PanelMenu from "primevue/panelmenu";
3
- import { UseNavMenuService } from "../../services/navMenuService";
4
- import { SfNavMenuItem } from "./../../types";
5
-
6
- export interface SfNavMenuProps {
7
- items: SfNavMenuItem[];
8
- }
9
-
10
- const props = defineProps<SfNavMenuProps>();
11
-
12
- const navService = UseNavMenuService();
13
-
14
- function OnClickRoute(ev: Event, navigate: () => void) {
15
- ev.preventDefault();
16
- const target = ev.target as HTMLElement;
17
- const nav = target.closest(".panel-menu-wrapper");
18
- if (nav && nav.clientWidth + 10 > document.body.clientWidth) {
19
- navService.Close();
20
- }
21
- navigate();
22
- }
23
- </script>
24
-
25
- <template>
26
- <div class="panel-menu-wrapper">
27
- <PanelMenu :model="props.items" :unstyled="true">
28
- <template #item="{ item, active }">
29
- <router-link
30
- v-if="!!item.href"
31
- v-slot="{ navigate, isActive }"
32
- :to="{
33
- path: item.href,
34
- params: item.params ?? {},
35
- query: item.query ?? {},
36
- }"
37
- custom
38
- >
39
- <a
40
- class="item-menu sf-ripple"
41
- :data-active="isActive"
42
- :href="item.href"
43
- @click="OnClickRoute($event, navigate)"
44
- >
45
- <span class="material-symbols-outlined sf-mr-3">
46
- {{ item.icon ?? "chevron_right" }}
47
- </span>
48
- <span>{{ item.text }}</span>
49
- </a>
50
- </router-link>
51
- <a v-else class="item-menu sf-ripple">
52
- <span
53
- v-if="item.icon"
54
- class="material-symbols-outlined sf-mr-3"
55
- >
56
- {{ item.icon }}
57
- </span>
58
- <span>{{ item.text }}</span>
59
- <div class="sf-flex-grow-1"></div>
60
- <span
61
- :class="[
62
- 'material-symbols-outlined arrow',
63
- { '--expand': active },
64
- ]"
65
- >
66
- chevron_right
67
- </span>
68
- </a>
69
- </template>
70
- </PanelMenu>
71
- </div>
72
- </template>
73
-
74
- <style scoped lang="scss">
75
- .panel-menu-wrapper {
76
- padding: var(--inline-spacing);
77
- :deep(ul, li) {
78
- list-style-type: none;
79
- padding: 0;
80
- margin: 0;
81
- }
82
- :deep(ul) {
83
- padding-left: var(--inline-spacing);
84
- }
85
- }
86
- .item-menu {
87
- display: flex;
88
- align-items: center;
89
- padding: var(--inline-spacing);
90
- color: var(--text-color);
91
- text-decoration: none;
92
- border-radius: 6px;
93
- margin-bottom: 0.25em;
94
- cursor: pointer;
95
- &.sub-item {
96
- margin-bottom: var(--inline-spacing);
97
- }
98
- &[data-active="true"] {
99
- background-color: var(--primary-hover-color);
100
- color: var(--primary-color);
101
- }
102
- }
103
- .arrow {
104
- transition: transform 0.3s;
105
- &.--expand {
106
- transform: rotate(90deg);
107
- }
108
- }
109
- </style>
@@ -1,125 +0,0 @@
1
- <script setup lang="ts">
2
- import { onMounted, onBeforeUnmount, ref } from "vue";
3
-
4
- export interface SfTabNavigationTab {
5
- text: string;
6
- route: string;
7
- }
8
-
9
- export interface SfTabNavigationProps {
10
- tabs: SfTabNavigationTab[];
11
- }
12
-
13
- const props: SfTabNavigationProps =
14
- defineProps<SfTabNavigationProps>();
15
-
16
- const trackerContainer = ref<HTMLInputElement | null>(null);
17
- const trackerContainerObserver = new ResizeObserver((_) => {
18
- AjustarIcones();
19
- });
20
-
21
- const isLeftArrowActive = ref(false);
22
- const isRightArrowActive = ref(false);
23
-
24
- function Scroll(left: boolean = false) {
25
- const amount = trackerContainer.value!.clientWidth;
26
- trackerContainer.value!.scrollLeft += left ? -amount : amount;
27
- }
28
-
29
- function AjustarIcones() {
30
- const maxScrollValue =
31
- trackerContainer.value!.scrollWidth -
32
- trackerContainer.value!.clientWidth;
33
-
34
- isLeftArrowActive.value! = trackerContainer.value!.scrollLeft > 10;
35
-
36
- isRightArrowActive.value! =
37
- trackerContainer.value!.scrollLeft < maxScrollValue - 10;
38
- }
39
-
40
- onMounted(() => {
41
- trackerContainer.value!.addEventListener("scroll", AjustarIcones);
42
- trackerContainerObserver.observe(trackerContainer.value!);
43
- });
44
-
45
- onBeforeUnmount(() => {
46
- try {
47
- trackerContainer.value?.removeEventListener(
48
- "scroll",
49
- AjustarIcones
50
- );
51
- trackerContainerObserver.unobserve(trackerContainer.value!);
52
- trackerContainerObserver.disconnect();
53
- } catch {}
54
- });
55
- </script>
56
-
57
- <template>
58
- <div class="sf-tab-navigation">
59
- <div
60
- :class="['left-arrow', { active: isLeftArrowActive }]"
61
- @click="Scroll(true)"
62
- >
63
- <svg
64
- xmlns="http://www.w3.org/2000/svg"
65
- fill="none"
66
- viewBox="0 0 24 24"
67
- stroke-width="1.5"
68
- stroke="currentColor"
69
- class="w-6 h-6"
70
- >
71
- <path
72
- stroke-linecap="round"
73
- stroke-linejoin="round"
74
- d="M15.75 19.5L8.25 12l7.5-7.5"
75
- />
76
- </svg>
77
- </div>
78
-
79
- <ul ref="trackerContainer">
80
- <RouterLink
81
- v-for="tab in props.tabs"
82
- :to="tab.route"
83
- :custom="true"
84
- v-slot="{ navigate, isActive }"
85
- >
86
- <li :data-active="isActive">
87
- <slot
88
- name="item"
89
- :item="tab"
90
- :navigate="navigate"
91
- :is-active="isActive"
92
- >
93
- <a
94
- :href="tab.route"
95
- :class="{ active: isActive }"
96
- @click="navigate"
97
- >
98
- {{ tab.text }}
99
- </a>
100
- </slot>
101
- </li>
102
- </RouterLink>
103
- </ul>
104
-
105
- <div
106
- :class="['right-arrow', { active: isRightArrowActive }]"
107
- @click="Scroll()"
108
- >
109
- <svg
110
- xmlns="http://www.w3.org/2000/svg"
111
- fill="none"
112
- viewBox="0 0 24 24"
113
- stroke-width="1.5"
114
- stroke="currentColor"
115
- class="w-6 h-6"
116
- >
117
- <path
118
- stroke-linecap="round"
119
- stroke-linejoin="round"
120
- d="M8.25 4.5l7.5 7.5-7.5 7.5"
121
- />
122
- </svg>
123
- </div>
124
- </div>
125
- </template>
@@ -1,91 +0,0 @@
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 DELETED
@@ -1,53 +0,0 @@
1
- import SfLayout from "./components/layout/Layout.vue";
2
- import SfIcon from "./components/icon/Icon.vue";
3
- import SfContent from "./components/content/Content.vue";
4
- import SfTabNavigation from "./components/tabnavigation/TabNavigation.vue";
5
- import SfButton from "./components/button/Button.vue";
6
- import SfDrawer from "./components/drawer/Drawer.vue";
7
- import SfMessage from "./components/message/Message.vue";
8
- import SfTooltip from "./components/tooltip/Tooltip.vue";
9
- import SfNavMenu from "./components/navmenu/NavMenu.vue";
10
- import { ThemeToggleBase } from "./components/internal/ThemeToggle";
11
-
12
- import { UseNavMenuService } from "./services/navMenuService";
13
- import {
14
- UseAlertService,
15
- UseConfirmService,
16
- } from "./services/dialogService";
17
- import {
18
- StartAuthService,
19
- UseAuthService,
20
- } from "./services/authService";
21
- import { AppResult } from "./common/appResult";
22
-
23
- import "./style/componentes.scss";
24
- import { AxiosClient, UseAxiosClient } from "./axios/axiosClient";
25
-
26
- export {
27
- SfLayout,
28
- SfIcon,
29
- SfContent,
30
- SfTabNavigation,
31
- SfButton,
32
- SfDrawer,
33
- SfMessage,
34
- SfTooltip,
35
- SfNavMenu,
36
- StartAuthService,
37
- UseAuthService,
38
- UseNavMenuService,
39
- UseConfirmService,
40
- UseAlertService,
41
- UseAxiosClient,
42
- AppResult,
43
- AxiosClient,
44
- };
45
-
46
- export * from "./types";
47
-
48
- /**
49
- * Tema inicial
50
- */
51
- (() => {
52
- ThemeToggleBase.SetInitialTheme();
53
- })();