@vc-shell/framework 1.1.3 → 1.1.5

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 (136) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/core/directives/loading/styles.css +1 -1
  3. package/core/plugins/modularity/README.md +347 -17
  4. package/core/plugins/modularity/loader.ts +217 -3
  5. package/dist/core/plugins/modularity/loader.d.ts +4 -0
  6. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  7. package/dist/framework.js +1 -1
  8. package/dist/{index-DRL7VovM.js → index-BBHl6nap.js} +1 -1
  9. package/dist/{index-BKR3ecN5.js → index-BG6N4UCY.js} +1 -1
  10. package/dist/{index-Cv6c_1IG.js → index-Bv5as3SI.js} +1 -1
  11. package/dist/{index-BUHouW8T.js → index-C4VyqVxv.js} +1 -1
  12. package/dist/{index-Ek7_XgGk.js → index-CKLiFGZ-.js} +1 -1
  13. package/dist/{index-B83didIY.js → index-CTmAMa_1.js} +1 -1
  14. package/dist/{index-C6tcHNVl.js → index-CtGZgIiV.js} +1 -1
  15. package/dist/{index-DyGIijU2.js → index-D13Jcezf.js} +1 -1
  16. package/dist/{index-CnQ56kqq.js → index-DbpKygJh.js} +1 -1
  17. package/dist/{index-Dfcy8w9c.js → index-DgCtSr4P.js} +1 -1
  18. package/dist/{index-TSGli7LX.js → index-Dh1XjfgY.js} +1 -1
  19. package/dist/{index-BW3krAiY.js → index-DpDbQQg6.js} +1 -1
  20. package/dist/{index-CxMfHOup.js → index-DwuQbDJG.js} +1 -1
  21. package/dist/{index-xFQltarK.js → index-Fhuqbkq2.js} +1 -1
  22. package/dist/{index-BN-_cebP.js → index-JTAZpxKF.js} +1 -1
  23. package/dist/{index-UnPPbmRc.js → index-MKD2CP5c.js} +49617 -48276
  24. package/dist/{index-CGyGGihY.js → index-Q3k1PYzc.js} +1 -1
  25. package/dist/index.css +3 -3
  26. package/dist/shared/components/generic-dropdown/generic-dropdown.vue.d.ts.map +1 -1
  27. package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts.map +1 -1
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/dist/ui/components/atoms/vc-icon/composables/index.d.ts +3 -0
  30. package/dist/ui/components/atoms/vc-icon/composables/index.d.ts.map +1 -0
  31. package/dist/ui/components/atoms/vc-icon/composables/use-icon-type.d.ts +22 -0
  32. package/dist/ui/components/atoms/vc-icon/composables/use-icon-type.d.ts.map +1 -0
  33. package/dist/ui/components/atoms/vc-icon/composables/use-icon.d.ts +30 -0
  34. package/dist/ui/components/atoms/vc-icon/composables/use-icon.d.ts.map +1 -0
  35. package/dist/ui/components/atoms/vc-icon/index.d.ts +1 -0
  36. package/dist/ui/components/atoms/vc-icon/index.d.ts.map +1 -1
  37. package/dist/ui/components/atoms/vc-icon/types.d.ts +31 -0
  38. package/dist/ui/components/atoms/vc-icon/types.d.ts.map +1 -0
  39. package/dist/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue.d.ts +18 -4
  40. package/dist/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue.d.ts.map +1 -1
  41. package/dist/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue.d.ts +15 -2
  42. package/dist/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue.d.ts.map +1 -1
  43. package/dist/ui/components/atoms/vc-icon/vc-icon-examples.vue.d.ts.map +1 -1
  44. package/dist/ui/components/atoms/vc-icon/vc-icon-test.vue.d.ts.map +1 -1
  45. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts +11 -6
  46. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  47. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts +21 -4
  48. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
  49. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts +30 -4
  50. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
  51. package/dist/ui/components/atoms/vc-icon/vc-svg-icon.vue.d.ts +33 -0
  52. package/dist/ui/components/atoms/vc-icon/vc-svg-icon.vue.d.ts.map +1 -0
  53. package/dist/ui/components/atoms/vc-widget/vc-widget.vue.d.ts.map +1 -1
  54. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
  55. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
  56. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/props.d.ts +14 -0
  57. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/props.d.ts.map +1 -0
  58. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue.d.ts +2 -13
  59. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue.d.ts.map +1 -1
  60. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts +1 -1
  61. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts.map +1 -1
  62. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue.d.ts.map +1 -1
  63. package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts +1 -1
  64. package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
  65. package/dist/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue.d.ts +1 -1
  66. package/dist/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue.d.ts.map +1 -1
  67. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue.d.ts +1 -1
  68. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue.d.ts.map +1 -1
  69. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue.d.ts +1 -1
  70. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue.d.ts.map +1 -1
  71. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue.d.ts +1 -1
  72. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue.d.ts.map +1 -1
  73. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue.d.ts +1 -1
  74. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue.d.ts.map +1 -1
  75. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts +1 -1
  76. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts.map +1 -1
  77. package/dist/ui/components/organisms/vc-table/composables/useTableActions.d.ts +1 -1
  78. package/dist/ui/components/organisms/vc-table/composables/useTableActions.d.ts.map +1 -1
  79. package/dist/ui/components/organisms/vc-table/composables/useTableColumnReorder.d.ts +1 -1
  80. package/dist/ui/components/organisms/vc-table/composables/useTableColumnReorder.d.ts.map +1 -1
  81. package/dist/ui/components/organisms/vc-table/composables/useTableColumnResize.d.ts +1 -1
  82. package/dist/ui/components/organisms/vc-table/composables/useTableColumnResize.d.ts.map +1 -1
  83. package/dist/ui/components/organisms/vc-table/composables/useTableRowReorder.d.ts +1 -1
  84. package/dist/ui/components/organisms/vc-table/composables/useTableRowReorder.d.ts.map +1 -1
  85. package/dist/ui/components/organisms/vc-table/composables/useTableSelection.d.ts +1 -1
  86. package/dist/ui/components/organisms/vc-table/composables/useTableSelection.d.ts.map +1 -1
  87. package/dist/ui/components/organisms/vc-table/composables/useTableState.d.ts +1 -1
  88. package/dist/ui/components/organisms/vc-table/composables/useTableState.d.ts.map +1 -1
  89. package/dist/ui/components/organisms/vc-table/types.d.ts +36 -0
  90. package/dist/ui/components/organisms/vc-table/types.d.ts.map +1 -0
  91. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +2 -34
  92. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  93. package/package.json +4 -4
  94. package/shared/components/generic-dropdown/generic-dropdown.vue +1 -1
  95. package/shared/components/settings-menu-item/settings-menu-item.vue +1 -6
  96. package/shared/components/user-dropdown-button/_internal/user-info.vue +3 -3
  97. package/ui/components/atoms/vc-icon/README.md +198 -220
  98. package/ui/components/atoms/vc-icon/composables/index.ts +2 -0
  99. package/ui/components/atoms/vc-icon/composables/use-icon-type.ts +83 -0
  100. package/ui/components/atoms/vc-icon/composables/use-icon.ts +129 -0
  101. package/ui/components/atoms/vc-icon/index.ts +1 -0
  102. package/ui/components/atoms/vc-icon/types.ts +36 -0
  103. package/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue +111 -10
  104. package/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue +119 -17
  105. package/ui/components/atoms/vc-icon/vc-icon-examples.vue +485 -124
  106. package/ui/components/atoms/vc-icon/vc-icon-test.vue +399 -209
  107. package/ui/components/atoms/vc-icon/vc-icon.stories.ts +502 -56
  108. package/ui/components/atoms/vc-icon/vc-icon.vue +240 -155
  109. package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +163 -33
  110. package/ui/components/atoms/vc-icon/vc-material-icon.vue +136 -30
  111. package/ui/components/atoms/vc-icon/vc-svg-icon.vue +168 -0
  112. package/ui/components/atoms/vc-widget/vc-widget.stories.ts +13 -0
  113. package/ui/components/atoms/vc-widget/vc-widget.vue +2 -0
  114. package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +1 -1
  115. package/ui/components/molecules/vc-pagination/vc-pagination.vue +23 -14
  116. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarHeader.vue +2 -2
  117. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +2 -3
  118. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/props.ts +14 -0
  119. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue +1 -12
  120. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue +1 -1
  121. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +65 -32
  122. package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +1 -1
  123. package/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue +1 -1
  124. package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue +1 -1
  125. package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue +1 -1
  126. package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue +1 -1
  127. package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue +1 -1
  128. package/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue +1 -1
  129. package/ui/components/organisms/vc-table/composables/useTableActions.ts +1 -1
  130. package/ui/components/organisms/vc-table/composables/useTableColumnReorder.ts +1 -1
  131. package/ui/components/organisms/vc-table/composables/useTableColumnResize.ts +1 -1
  132. package/ui/components/organisms/vc-table/composables/useTableRowReorder.ts +1 -1
  133. package/ui/components/organisms/vc-table/composables/useTableSelection.ts +1 -1
  134. package/ui/components/organisms/vc-table/composables/useTableState.ts +1 -1
  135. package/ui/components/organisms/vc-table/types.ts +32 -0
  136. package/ui/components/organisms/vc-table/vc-table.vue +2 -30
@@ -5,8 +5,8 @@
5
5
  <!-- First page button -->
6
6
  <div
7
7
  class="vc-pagination__item"
8
- :class="{ 'vc-pagination__item_disabled': currentPage === 1 }"
9
- @click="currentPage !== 1 && setPage(1)"
8
+ :class="{ 'vc-pagination__item_disabled': localCurrentPage === 1 }"
9
+ @click="localCurrentPage !== 1 && setPage(1)"
10
10
  >
11
11
  <VcIcon
12
12
  size="xs"
@@ -17,8 +17,8 @@
17
17
  <!-- Previous page button -->
18
18
  <div
19
19
  class="vc-pagination__item"
20
- :class="{ 'vc-pagination__item_disabled': currentPage === 1 }"
21
- @click="currentPage !== 1 && setPage(currentPage - 1)"
20
+ :class="{ 'vc-pagination__item_disabled': localCurrentPage === 1 }"
21
+ @click="localCurrentPage !== 1 && setPage(localCurrentPage - 1)"
22
22
  >
23
23
  <VcIcon
24
24
  size="xs"
@@ -31,8 +31,8 @@
31
31
  :key="page"
32
32
  class="vc-pagination__item"
33
33
  :class="{
34
- 'vc-pagination__item_current': page === currentPage,
35
- 'vc-pagination__item_hover': page !== currentPage,
34
+ 'vc-pagination__item_current': page === localCurrentPage,
35
+ 'vc-pagination__item_hover': page !== localCurrentPage,
36
36
  }"
37
37
  @click="setPage(page)"
38
38
  >
@@ -42,8 +42,8 @@
42
42
  <!-- Next page button -->
43
43
  <div
44
44
  class="vc-pagination__item"
45
- :class="{ 'vc-pagination__item_disabled': currentPage === pages }"
46
- @click="currentPage !== pages && setPage(currentPage + 1)"
45
+ :class="{ 'vc-pagination__item_disabled': localCurrentPage === pages }"
46
+ @click="localCurrentPage !== pages && setPage(localCurrentPage + 1)"
47
47
  >
48
48
  <VcIcon
49
49
  size="xs"
@@ -54,8 +54,8 @@
54
54
  <!-- Last page button -->
55
55
  <div
56
56
  class="vc-pagination__item"
57
- :class="{ 'vc-pagination__item_disabled': currentPage === pages }"
58
- @click="currentPage !== pages && setPage(pages)"
57
+ :class="{ 'vc-pagination__item_disabled': localCurrentPage === pages }"
58
+ @click="localCurrentPage !== pages && setPage(pages)"
59
59
  >
60
60
  <VcIcon
61
61
  size="xs"
@@ -67,7 +67,7 @@
67
67
  </template>
68
68
 
69
69
  <script lang="ts" setup>
70
- import { ref, computed, toRefs, inject, type Ref } from "vue";
70
+ import { ref, computed, toRefs, inject, type Ref, watch } from "vue";
71
71
  import { VcIcon } from "./../../";
72
72
  import { ArrowLeftIcon, ArrowRightIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon } from "./../../atoms/vc-icon/icons";
73
73
 
@@ -92,20 +92,29 @@ const emit = defineEmits<Emits>();
92
92
 
93
93
  const isMobile = inject("isMobile") as Ref<boolean>;
94
94
 
95
- const { currentPage, variant } = toRefs(props);
95
+ const { variant } = toRefs(props);
96
+ const localCurrentPage = ref(props.currentPage);
97
+
98
+ watch(
99
+ () => props.currentPage,
100
+ (newValue) => {
101
+ localCurrentPage.value = newValue;
102
+ },
103
+ { immediate: true },
104
+ );
96
105
 
97
106
  const setPage = (page: number | string) => {
98
107
  if (typeof page === "undefined" || (typeof page === "number" && isNaN(page))) return;
99
108
  const pageNumber = typeof page === "string" ? parseInt(page) : page;
100
109
  if (pageNumber < 1 || pageNumber > props.pages) return;
101
- currentPage.value = pageNumber;
110
+ localCurrentPage.value = pageNumber;
102
111
  emit("itemClick", pageNumber);
103
112
  };
104
113
 
105
114
  const pagesToShow = computed(() => {
106
115
  const pages = [];
107
116
  const totalPages = props.pages;
108
- const current = currentPage.value;
117
+ const current = localCurrentPage.value;
109
118
  const maxPages = isMobile.value ? 3 : 5;
110
119
 
111
120
  if (totalPages <= maxPages) {
@@ -132,10 +132,10 @@ const hasUnread = computed(() => {
132
132
  }
133
133
 
134
134
  &-image {
135
- @apply tw-cursor-pointer tw-max-w-[var(--app-bar-logo-width)] tw-max-h-[var(--app-bar-logo-height)] tw-rounded-full tw-overflow-hidden tw-w-full tw-shrink-0;
135
+ @apply tw-cursor-pointer tw-max-w-[var(--app-bar-logo-width)] tw-max-h-[var(--app-bar-logo-height)] tw-overflow-hidden tw-w-full tw-shrink-0;
136
136
 
137
137
  &--mobile {
138
- @apply tw-mx-1 tw-max-w-[var(--app-bar-logo-mobile-width)] tw-max-h-[var(--app-bar-logo-mobile-height)];
138
+ @apply tw-mx-1 tw-max-w-[var(--app-bar-logo-mobile-width)] tw-max-h-[var(--app-bar-logo-mobile-height)] tw-rounded-full;
139
139
  }
140
140
  }
141
141
  }
@@ -26,9 +26,8 @@
26
26
  <VcIcon
27
27
  v-show="true"
28
28
  class="vc-app-bar__collapse-button-icon"
29
- :icon="ChevronLeftIcon"
29
+ :icon="state.isSidebarExpanded ? ChevronLeftIcon : ChevronRightIcon"
30
30
  size="xs"
31
- :class="{ 'rotate-180': !state.isSidebarExpanded }"
32
31
  />
33
32
  </Transition>
34
33
  </div>
@@ -112,7 +111,7 @@
112
111
 
113
112
  <script lang="ts" setup>
114
113
  import { VcIcon } from "../../../../";
115
- import { ChevronLeftIcon } from "../../../../atoms/vc-icon/icons";
114
+ import { ChevronLeftIcon, ChevronRightIcon } from "../../../../atoms/vc-icon/icons";
116
115
  import { useAppMenuState } from "../composables/useAppMenuState";
117
116
  import { useAppBarWidgets } from "./composables/useAppBarWidgets";
118
117
  import AppBarHeader from "./_internal/AppBarHeader.vue";
@@ -0,0 +1,14 @@
1
+ import { Ref, ComputedRef } from "vue";
2
+
3
+ export interface Props {
4
+ id?: string;
5
+ icon?: string | (() => string);
6
+ disabled?: boolean | ComputedRef<boolean | undefined>;
7
+ title?: string | Ref<string> | ComputedRef<string>;
8
+ size?: "s" | "m";
9
+ separator?: "left" | "right" | "both";
10
+ contentDirection?: "row" | "row-reverse" | "column";
11
+ iconClassName?: string;
12
+ titleClassName?: string;
13
+ onClick?: () => Promise<void> | void;
14
+ }
@@ -34,19 +34,8 @@
34
34
  <script lang="ts" setup>
35
35
  import { ref, ComputedRef, Ref } from "vue";
36
36
  import { VcIcon } from "../../../../../../../../";
37
+ import type { Props } from "./props";
37
38
 
38
- export interface Props {
39
- id?: string;
40
- icon?: string | (() => string);
41
- disabled?: boolean | ComputedRef<boolean | undefined>;
42
- title?: string | Ref<string> | ComputedRef<string>;
43
- size?: "s" | "m";
44
- separator?: "left" | "right" | "both";
45
- contentDirection?: "row" | "row-reverse" | "column";
46
- iconClassName?: string;
47
- titleClassName?: string;
48
- onClick?: () => Promise<void> | void;
49
- }
50
39
 
51
40
  const props = withDefaults(defineProps<Props>(), {
52
41
  disabled: false,
@@ -16,7 +16,7 @@
16
16
  <script lang="ts" setup>
17
17
  import { computed } from "vue";
18
18
  import VcBladeToolbarBaseButton from "./vc-blade-toolbar-base-button.vue";
19
- import type { Props as BaseButtonProps } from "./vc-blade-toolbar-base-button.vue";
19
+ import type { Props as BaseButtonProps } from "./props";
20
20
 
21
21
  export interface Props extends Omit<BaseButtonProps, "size" | "contentDirection" | "iconClassName"> {
22
22
  isMain?: boolean;
@@ -20,7 +20,7 @@
20
20
  </template>
21
21
 
22
22
  <script lang="ts" setup>
23
- import { ComputedRef, computed, inject, onBeforeMount, onBeforeUnmount, watch, useSlots } from "vue";
23
+ import { ComputedRef, computed, inject, onBeforeMount, onBeforeUnmount, watch, useSlots, reactive } from "vue";
24
24
  import { useLocalStorage } from "@vueuse/core";
25
25
  import { usePermissions, useToolbar } from "../../../../../../core/composables";
26
26
  import { IBladeToolbar } from "../../../../../../core/types";
@@ -41,7 +41,8 @@ const props = withDefaults(defineProps<Props>(), {
41
41
  const slots = useSlots();
42
42
  const isExpanded = useLocalStorage("VC_BLADE_TOOLBAR_IS_EXPANDED", true);
43
43
  const { hasAccess } = usePermissions();
44
- const { registerToolbarItem, unregisterToolbarItem, getToolbarItems, clearBladeToolbarItems } = useToolbar();
44
+ const { registerToolbarItem, unregisterToolbarItem, getToolbarItems, clearBladeToolbarItems, updateToolbarItem } =
45
+ useToolbar();
45
46
 
46
47
  // Get the ID of the current blade
47
48
  const blade = inject<ComputedRef<IBladeInstance>>(
@@ -58,43 +59,80 @@ const blade = inject<ComputedRef<IBladeInstance>>(
58
59
 
59
60
  const bladeId = computed(() => blade.value?.id ?? FALLBACK_BLADE_ID);
60
61
 
62
+ const isMobile = inject<ComputedRef<boolean>>(
63
+ "isMobile",
64
+ computed(() => false),
65
+ );
66
+
61
67
  // Prefix for prop items to avoid ID conflicts
62
68
  const PROP_ITEM_ID_PREFIX = "prop_toolbar_item_";
63
69
 
64
- // Generate IDs for items without them
65
- function ensureItemHasId(item: IBladeToolbar, index: number): IToolbarItem {
66
- const itemCopy = { ...item } as IToolbarItem;
67
- if (!("id" in itemCopy) || !itemCopy.id) {
68
- itemCopy.id = `${PROP_ITEM_ID_PREFIX}${bladeId.value}_${index}`;
69
- }
70
- return itemCopy;
71
- }
70
+ // Create map to track registered item IDs
71
+ const registeredItemIds = reactive(new Map<number, string>());
72
+
73
+ // Convert IBladeToolbar to IToolbarItem
74
+ function convertToToolbarItem(item: IBladeToolbar, index: number): IToolbarItem {
75
+ const id = item.id || `${PROP_ITEM_ID_PREFIX}${bladeId.value}_${index}`;
72
76
 
73
- // Register prop items in the service
74
- function registerPropItems() {
75
- // Unregister previous items first to avoid duplicates
76
- unregisterPropItems();
77
+ return {
78
+ ...item,
79
+ id,
80
+ bladeId: bladeId.value,
81
+ priority: index * -1,
82
+ } as unknown as IToolbarItem;
83
+ }
77
84
 
78
- // Register new items
85
+ // Update all items from props
86
+ function updateItems(): void {
87
+ // Register new items or update existing ones
79
88
  props.items.forEach((item, index) => {
80
- const toolbarItem = ensureItemHasId(item, index);
81
- registerToolbarItem(toolbarItem);
89
+ const id = registeredItemIds.get(index);
90
+
91
+ if (id) {
92
+ // Item already registered, update it
93
+ const toolbarItem = convertToToolbarItem(item, index);
94
+ updateToolbarItem(id, toolbarItem);
95
+ } else {
96
+ // New item, register it
97
+ const toolbarItem = convertToToolbarItem(item, index);
98
+ registerToolbarItem(toolbarItem);
99
+ registeredItemIds.set(index, toolbarItem.id);
100
+ }
101
+ });
102
+
103
+ // Remove items that no longer exist in props.items
104
+ const indices = [...registeredItemIds.keys()];
105
+ indices.forEach((index) => {
106
+ if (index >= props.items.length) {
107
+ const id = registeredItemIds.get(index);
108
+ if (id) {
109
+ unregisterToolbarItem(id);
110
+ registeredItemIds.delete(index);
111
+ }
112
+ }
82
113
  });
83
114
  }
84
115
 
85
- // Unregister prop items from the service
86
- function unregisterPropItems() {
87
- const itemsToRemove = getToolbarItems().filter((item) => item.id.startsWith(PROP_ITEM_ID_PREFIX + bladeId.value));
116
+ // Unregister all toolbar items
117
+ function clearToolbarItems(): void {
118
+ // Clear all previously registered items
119
+ for (const id of registeredItemIds.values()) {
120
+ unregisterToolbarItem(id);
121
+ }
88
122
 
89
- itemsToRemove.forEach((item) => {
90
- unregisterToolbarItem(item.id);
91
- });
123
+ // Clear the map
124
+ registeredItemIds.clear();
92
125
  }
93
126
 
94
127
  // Filter visible items from service
95
128
  const visibleItems = computed(() => {
96
129
  return getToolbarItems()
97
- .filter((item) => hasAccess(item.permissions) && (item.isVisible === undefined || item.isVisible) && !item.disabled)
130
+ .filter(
131
+ (item) =>
132
+ hasAccess(item.permissions) &&
133
+ (item.isVisible === undefined || item.isVisible) &&
134
+ (isMobile.value ? !item.disabled : true),
135
+ )
98
136
  .sort((a, b) => {
99
137
  const priorityA = a.priority ?? 0;
100
138
  const priorityB = b.priority ?? 0;
@@ -106,19 +144,14 @@ const visibleItems = computed(() => {
106
144
  watch(
107
145
  () => props.items,
108
146
  () => {
109
- registerPropItems();
147
+ updateItems();
110
148
  },
111
- { deep: true },
149
+ { deep: true, immediate: true },
112
150
  );
113
151
 
114
- // Initial registration
115
- onBeforeMount(() => {
116
- registerPropItems();
117
- });
118
-
119
152
  // Cleanup on unmount
120
153
  onBeforeUnmount(() => {
121
- unregisterPropItems();
154
+ clearToolbarItems();
122
155
  });
123
156
  </script>
124
157
 
@@ -287,7 +287,7 @@ import VcInputCurrency from "../../../../molecules/vc-input-currency/vc-input-cu
287
287
  import VcInput from "../../../../molecules/vc-input/vc-input.vue";
288
288
  import VcTooltip from "../../../../atoms/vc-tooltip/vc-tooltip.vue";
289
289
  import { Field } from "vee-validate";
290
- import type { TableItem } from "../../vc-table.vue";
290
+ import type { TableItem } from "../../types";
291
291
  import { ITableColumns } from "../../../../../../core/types";
292
292
 
293
293
  export interface Props {
@@ -41,7 +41,7 @@
41
41
  <script lang="ts" setup>
42
42
  import { ref, watch } from "vue";
43
43
  import { ITableColumns } from "./../../../../../../core/types";
44
- import { TableColPartial } from "../../vc-table.vue";
44
+ import { TableColPartial } from "../../types";
45
45
  import { GenericDropdown } from "../../../../../../shared/components/generic-dropdown";
46
46
 
47
47
  export interface Props {
@@ -74,7 +74,7 @@
74
74
  import VcTableRow from "../vc-table-row/vc-table-row.vue";
75
75
  import VcTableEmpty from "../../../vc-table-empty/vc-table-empty.vue";
76
76
  import type { IActionBuilderResult } from "../../../../../../../../core/types";
77
- import type { TableSlots, TableItem, TableColPartial, StatusImage } from "../../../../vc-table.vue";
77
+ import type { TableSlots, TableItem, TableColPartial, StatusImage } from "../../../../types";
78
78
  import { MaybeRef, useSlots } from "vue";
79
79
 
80
80
  defineProps<{
@@ -111,7 +111,7 @@
111
111
  import { toRefs, ref } from "vue";
112
112
  import { VcCheckbox, VcIcon } from "../../../../../..";
113
113
  import VcTableColumnSwitcher from "../../../vc-table-column-switcher/vc-table-column-switcher.vue";
114
- import type { TableItem, TableColPartial } from "../../../../vc-table.vue";
114
+ import type { TableItem, TableColPartial } from "../../../../types";
115
115
  import { useTableColumnReorder } from "../../../../composables/useTableColumnReorder";
116
116
  import { useTableColumnResize } from "../../../../composables/useTableColumnResize";
117
117
  import { ITableColumns } from "../../../../../../../../core/types";
@@ -105,7 +105,7 @@
105
105
  <script lang="ts" setup generic="T extends TableItem | string">
106
106
  import { VcCheckbox, VcIcon, VcTooltip } from "../../../../../../";
107
107
  import VcTableCell from "../../../vc-table-cell/vc-table-cell.vue";
108
- import type { TableItem, TableColPartial } from "../../../../vc-table.vue";
108
+ import type { TableItem, TableColPartial } from "../../../../types";
109
109
  import type { IActionBuilderResult, ITableColumns } from "../../../../../../../../core/types";
110
110
  import { MaybeRef } from "vue";
111
111
  defineProps<{
@@ -94,7 +94,7 @@ import VcTableSelectAllHeader from "./_internal/vc-table-select-all-header/vc-ta
94
94
  import VcTableBody from "./_internal/vc-table-body/vc-table-body.vue";
95
95
  import type { IActionBuilderResult, ITableColumns } from "../../../../../../core/types";
96
96
  import { useTableRowReorder } from "../../composables/useTableRowReorder";
97
- import type { TableSlots, TableItem, TableColPartial, StatusImage } from "../../vc-table.vue";
97
+ import type { TableSlots, TableItem, TableColPartial, StatusImage } from "../../types";
98
98
 
99
99
  const props = defineProps<{
100
100
  items: T[];
@@ -189,7 +189,7 @@ import { computed } from "vue";
189
189
  import VcTableCell from "../vc-table-cell/vc-table-cell.vue";
190
190
  import VcTableEmpty from "../vc-table-empty/vc-table-empty.vue";
191
191
  import VcTableMobileItem from "../vc-table-mobile-item/vc-table-mobile-item.vue";
192
- import type { TableItem, StatusImage } from "../../vc-table.vue";
192
+ import type { TableItem, StatusImage } from "../../types";
193
193
  import { IActionBuilderResult, ITableColumns } from "../../../../../../core/types";
194
194
  import { provideTableSwipe } from "../../composables/useTableSwipe";
195
195
 
@@ -1,6 +1,6 @@
1
1
  import { Ref, ref, shallowRef } from "vue";
2
2
  import { IActionBuilderResult } from "../../../../../core/types";
3
- import type { TableItem } from "./../vc-table.vue";
3
+ import type { TableItem } from "./../types";
4
4
 
5
5
  export interface UseTableActionsOptions<T extends TableItem | string> {
6
6
  enableItemActions?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { ref, Ref } from "vue";
2
- import { TableItem, TableColPartial } from "../vc-table.vue";
2
+ import { TableItem, TableColPartial } from "../types";
3
3
 
4
4
  export function useTableColumnReorder<T extends TableItem | string>(
5
5
  internalColumns: Ref<TableColPartial[]>,
@@ -1,5 +1,5 @@
1
1
  import { ref, Ref } from "vue";
2
- import { TableColPartial } from "../vc-table.vue";
2
+ import { TableColPartial } from "../types";
3
3
  import * as _ from "lodash-es";
4
4
 
5
5
  export function useTableColumnResize(
@@ -1,5 +1,5 @@
1
1
  import { computed, ref, Ref } from "vue";
2
- import { TableItem } from "../vc-table.vue";
2
+ import { TableItem } from "../types";
3
3
 
4
4
  export function useTableRowReorder<T extends TableItem | string>(
5
5
  items: Ref<T[]>,
@@ -1,5 +1,5 @@
1
1
  import { computed, ref, Ref, watch } from "vue";
2
- import { TableItem } from "../vc-table.vue";
2
+ import { TableItem } from "../types";
3
3
  import * as _ from "lodash-es";
4
4
 
5
5
  type TableItemType = TableItem | string;
@@ -2,7 +2,7 @@
2
2
  import { ref, Ref, computed, toValue, toRefs, MaybeRef } from "vue";
3
3
  import { useLocalStorage } from "@vueuse/core";
4
4
  import * as _ from "lodash-es";
5
- import { TableColPartial } from "../vc-table.vue";
5
+ import { TableColPartial } from "../types";
6
6
  import { ITableColumns } from "../../../../../core/types";
7
7
 
8
8
  export interface UseTableStateOptions {
@@ -0,0 +1,32 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import type { Ref, VNode } from "vue";
3
+ import { IActionBuilderResult, ITableColumns } from "../../../../core/types";
4
+
5
+ export interface TableSlots<T> {
6
+ header: (props: { header: VNode }) => any;
7
+ filters: (args: { closePanel: () => void }) => any;
8
+ "mobile-item": (args: { item: T }) => any;
9
+ [key: `header_${string}`]: (props: any) => any;
10
+ [key: `item_${string}`]: (args: { item: T; cell: ITableColumns | TableColPartial; index: number }) => any;
11
+ notfound: (props: any) => any;
12
+ empty: (props: any) => any;
13
+ footer: (props: any) => any;
14
+ }
15
+
16
+ export interface TableItem {
17
+ [x: string]: any;
18
+ actions?: IActionBuilderResult<any>[];
19
+ }
20
+
21
+ export type TableColPartial = Partial<
22
+ ITableColumns & {
23
+ predefined?: boolean;
24
+ }
25
+ >;
26
+
27
+ export interface StatusImage {
28
+ image?: string;
29
+ text: string | Ref<string>;
30
+ action?: string;
31
+ clickHandler?: () => void;
32
+ }
@@ -168,7 +168,7 @@
168
168
  :pages="pages"
169
169
  :current-page="currentPage"
170
170
  :pagination-variant="paginationVariant"
171
- @item-click="
171
+ @pagination-click="
172
172
  (event: number) => {
173
173
  //scroll table to top
174
174
  tableBody?.scrollTo(0, 0);
@@ -197,35 +197,7 @@ import VcTableDesktopView from "./_internal/vc-table-desktop-view/vc-table-deskt
197
197
  import VcTableHeader from "./_internal/vc-table-header/vc-table-header.vue";
198
198
  import VcTableSelectAll from "./_internal/vc-table-select-all/vc-table-select-all.vue";
199
199
  import VcTableFooter from "./_internal/vc-table-footer/vc-table-footer.vue";
200
-
201
- export interface StatusImage {
202
- image?: string;
203
- text: string | Ref<string>;
204
- action?: string;
205
- clickHandler?: () => void;
206
- }
207
-
208
- export interface TableItem {
209
- [x: string]: any;
210
- actions?: IActionBuilderResult<any>[];
211
- }
212
-
213
- export type TableColPartial = Partial<
214
- ITableColumns & {
215
- predefined?: boolean;
216
- }
217
- >;
218
-
219
- export interface TableSlots<T> {
220
- header: (props: { header: VNode }) => any;
221
- filters: (args: { closePanel: () => void }) => any;
222
- "mobile-item": (args: { item: T }) => any;
223
- [key: `header_${string}`]: (props: any) => any;
224
- [key: `item_${string}`]: (args: { item: T; cell: ITableColumns | TableColPartial; index: number }) => any;
225
- notfound: (props: any) => any;
226
- empty: (props: any) => any;
227
- footer: (props: any) => any;
228
- }
200
+ import type { TableSlots, TableItem, TableColPartial, StatusImage } from "./types";
229
201
 
230
202
  defineSlots<TableSlots<T>>();
231
203