@vc-shell/framework 1.0.119 → 1.0.120

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 (35) hide show
  1. package/CHANGELOG.md +6 -5771
  2. package/dist/framework.mjs +7140 -7116
  3. package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts +1 -1
  4. package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
  5. package/dist/shared/modules/dynamic/types/index.d.ts +115 -19
  6. package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
  7. package/dist/ui/components/atoms/vc-checkbox/index.d.ts +13 -0
  8. package/dist/ui/components/atoms/vc-checkbox/index.d.ts.map +1 -1
  9. package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts +1 -0
  10. package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts.map +1 -1
  11. package/dist/ui/components/molecules/vc-multivalue/index.d.ts +3 -3
  12. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +3 -3
  13. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +3 -3
  14. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
  15. package/dist/ui/components/molecules/vc-textarea/index.d.ts +13 -13
  16. package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts +3 -3
  17. package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
  18. package/dist/ui/components/organisms/vc-gallery/index.d.ts +6 -6
  19. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
  20. package/dist/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue.d.ts +3 -14
  21. package/dist/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue.d.ts.map +1 -1
  22. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
  23. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.d.ts.map +1 -1
  24. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  25. package/package.json +4 -4
  26. package/shared/modules/dynamic/helpers/nodeBuilder.ts +64 -27
  27. package/shared/modules/dynamic/types/index.ts +115 -19
  28. package/ui/components/atoms/vc-checkbox/vc-checkbox.vue +6 -0
  29. package/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +1 -1
  30. package/ui/components/organisms/vc-gallery/vc-gallery.vue +24 -20
  31. package/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue +2 -4
  32. package/ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue +1 -1
  33. package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +7 -5
  34. package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +11 -16
  35. package/ui/components/organisms/vc-table/vc-table.vue +33 -31
@@ -65,7 +65,7 @@
65
65
  >
66
66
  <NotificationItem
67
67
  :notification="item"
68
- :templates="templates"
68
+ :templates="templates || []"
69
69
  @on-click="() => (isDropdownVisible = false)"
70
70
  />
71
71
  </div>
@@ -58,7 +58,7 @@
58
58
 
59
59
  <script lang="ts" setup>
60
60
  import { ref, watch, computed, nextTick } from "vue";
61
- import { offset, computePosition, ComputePositionReturn } from "@floating-ui/vue";
61
+ import { offset, computePosition, ComputePositionReturn, ReferenceElement } from "@floating-ui/vue";
62
62
 
63
63
  export interface Props {
64
64
  title?: string;
@@ -100,10 +100,12 @@ function openPanel(isMobile: boolean) {
100
100
  if (!isMobile) {
101
101
  if (isPanelVisible.value) {
102
102
  nextTick(() => {
103
- computePosition(filterToggle.value, filterPanel.value, {
104
- placement: "bottom-end",
105
- middleware: [offset(10)],
106
- }).then((item) => (popper.value = item));
103
+ if (filterToggle.value && filterPanel.value) {
104
+ computePosition(filterToggle.value as ReferenceElement, filterPanel.value, {
105
+ placement: "bottom-end",
106
+ middleware: [offset(10)],
107
+ }).then((item) => (popper.value = item));
108
+ }
107
109
  });
108
110
  }
109
111
  }
@@ -17,7 +17,7 @@
17
17
  <div
18
18
  class="tw-flex tw-grow tw-basis-[1] tw-flex-col tw-justify-center tw-items-center tw-text-white"
19
19
  :class="[`vc-table-mobile__item-action_${leftSwipeActions[0].variant}`]"
20
- @click.stop="leftSwipeActions[0].clickHandler(item)"
20
+ @click.stop="leftSwipeActions[0].clickHandler(item as T)"
21
21
  >
22
22
  <VcIcon :icon="leftSwipeActions[0].icon"></VcIcon>
23
23
  <div class="tw-mt-1 tw-text-lg">
@@ -40,7 +40,7 @@
40
40
  <div
41
41
  class="tw-flex tw-grow tw-basis-[1] tw-flex-col tw-justify-center tw-items-center tw-text-white"
42
42
  :class="[`vc-table-mobile__item-action_${rightSwipeActions[0].variant}`]"
43
- @click.stop="rightSwipeActions[0].clickHandler(item)"
43
+ @click.stop="rightSwipeActions[0].clickHandler(item as T)"
44
44
  >
45
45
  <VcIcon :icon="rightSwipeActions[0].icon"></VcIcon>
46
46
  <div class="vc-table-mobile__item-action-text">
@@ -53,7 +53,7 @@
53
53
  v-if="rightSwipeActions.length === 2"
54
54
  class="tw-flex tw-grow tw-basis-[1] tw-flex-col tw-justify-center tw-items-center tw-text-white"
55
55
  :class="[`vc-table-mobile__item-action_${rightSwipeActions[1].variant}`]"
56
- @click.stop="rightSwipeActions[1].clickHandler(item)"
56
+ @click.stop="rightSwipeActions[1].clickHandler(item as T)"
57
57
  >
58
58
  <VcIcon :icon="rightSwipeActions[1].icon"></VcIcon>
59
59
  <div class="tw-mt-1 tw-text-lg">
@@ -99,7 +99,7 @@
99
99
  v-for="(itemAction, i) in itemActions"
100
100
  :key="i"
101
101
  class="tw-flex tw-grow tw-shrink-0 tw-flex-col tw-items-center tw-text-[#319ed4] tw-my-2 tw-box-border tw-p-1 tw-max-w-[80px]"
102
- @click="itemAction.clickHandler(item)"
102
+ @click="itemAction.clickHandler(item as T)"
103
103
  >
104
104
  <VcIcon
105
105
  :icon="itemAction.icon"
@@ -119,7 +119,7 @@
119
119
  </template>
120
120
 
121
121
  <script lang="ts" setup generic="T extends TableItem | string">
122
- import { computed, ref, watch } from "vue";
122
+ import { Ref, computed, ref, watch } from "vue";
123
123
  import { IActionBuilderResult } from "./../../../../../../core/types";
124
124
  import { useI18n } from "vue-i18n";
125
125
 
@@ -133,16 +133,11 @@ export interface TableItem {
133
133
  actions?: IActionBuilderResult[];
134
134
  }
135
135
 
136
- const props = withDefaults(
137
- defineProps<{
138
- item: T;
139
- actionBuilder?: (item: T) => IActionBuilderResult[];
140
- swipingItem?: string;
141
- }>(),
142
- {
143
- swipingItem: null,
144
- }
145
- );
136
+ const props = defineProps<{
137
+ item: T;
138
+ actionBuilder?: (item: T) => IActionBuilderResult[];
139
+ swipingItem?: string;
140
+ }>();
146
141
 
147
142
  const emit = defineEmits<Emits>();
148
143
  const { t } = useI18n({ useScope: "global" });
@@ -154,7 +149,7 @@ const isMoving = ref(false);
154
149
  const threshold = 10;
155
150
  const maxWidth = 80;
156
151
  const isActionsPopupVisible = ref(false);
157
- const itemActions = ref([]);
152
+ const itemActions: Ref<IActionBuilderResult<T>[]> = ref([]);
158
153
 
159
154
  watch(
160
155
  () => props.swipingItem,
@@ -143,7 +143,7 @@
143
143
  >
144
144
  <div
145
145
  class="tw-flex tw-items-center tw-flex-nowrap tw-truncate tw-px-3"
146
- :class="tableAlignment[item.align]"
146
+ :class="item.align ? tableAlignment[item.align as keyof typeof tableAlignment] : ''"
147
147
  >
148
148
  <div class="tw-truncate">
149
149
  <slot :name="`header_${item.id}`">{{ item.title }}</slot>
@@ -187,7 +187,7 @@
187
187
  class="tw-sticky tw-h-[42px] tw-z-[1] tw-right-0 tw-top-0 tw-table-cell tw-align-middle tw-w-0"
188
188
  >
189
189
  <VcTableColumnSwitcher
190
- :items="toggleCols"
190
+ :items="toggleCols.filter((col): col is ITableColumns => col !== undefined)"
191
191
  @change="toggleColumn"
192
192
  ></VcTableColumnSwitcher>
193
193
  </div>
@@ -547,8 +547,8 @@ const reorderRef = ref<HTMLElement | null>();
547
547
  const tableRef = ref<HTMLElement | null>();
548
548
 
549
549
  // event listeners
550
- let columnResizeListener: (...args: any[]) => any = null;
551
- let columnResizeEndListener: (...args: any[]) => any = null;
550
+ let columnResizeListener: ((...args: any[]) => any) | null = null;
551
+ let columnResizeEndListener: ((...args: any[]) => any) | null = null;
552
552
 
553
553
  const selection = ref<T[]>([]) as Ref<T[]>;
554
554
  const allSelected = ref(false);
@@ -732,9 +732,9 @@ function setActionToggleRefs(el: Element, id: string) {
732
732
 
733
733
  function setTooltipArrowRefs(el: Element, id: string) {
734
734
  if (el) {
735
- const isExists = tooltipArrowRefs.value.some((item) => item.id === id);
735
+ const isExists = tooltipArrowRefs.value?.some((item) => item.id === id);
736
736
  if (!isExists) {
737
- tooltipArrowRefs.value.push({ element: el, id });
737
+ tooltipArrowRefs.value?.push({ element: el, id });
738
738
  }
739
739
  }
740
740
  }
@@ -748,9 +748,9 @@ function showActions(item: T, index: string) {
748
748
 
749
749
  selectedRow.value = item.id;
750
750
 
751
- const toggleRef = actionToggleRefs.value.find((item) => item.id === index).element;
752
- const tooltipRef = tooltipRefs.value.find((item) => item.id === index).element;
753
- const tooltipArrowRef = tooltipArrowRefs.value.find((item) => item.id === index).element;
751
+ const toggleRef = actionToggleRefs.value.find((item) => item.id === index)?.element;
752
+ const tooltipRef = tooltipRefs.value.find((item) => item.id === index)?.element;
753
+ const tooltipArrowRef = tooltipArrowRefs.value?.find((item) => item.id === index)?.element;
754
754
 
755
755
  if (toggleRef && tooltipRef && tooltipArrowRef) {
756
756
  nextTick(() => {
@@ -868,42 +868,44 @@ function getOffset(element: HTMLElement) {
868
868
  const rect = element.getBoundingClientRect();
869
869
  const win = element.ownerDocument.defaultView;
870
870
  return {
871
- top: rect.top + win.pageYOffset,
872
- left: rect.left + win.pageXOffset,
871
+ top: rect.top + ((win && win.scrollY) ?? 0),
872
+ left: rect.left + ((win && win.scrollX) ?? 0),
873
873
  };
874
874
  }
875
875
 
876
876
  function onColumnResizeEnd() {
877
- const delta = resizer.value.offsetLeft - lastResize.value;
877
+ const delta = resizer.value.offsetLeft - (lastResize.value ?? 0);
878
878
 
879
- const columnElement: HTMLElement = table.value.querySelector(`#${resizeColumnElement.value.id}`);
879
+ const columnElement: HTMLElement | null = table.value.querySelector(`#${resizeColumnElement.value?.id}`);
880
880
 
881
- const columnWidth = columnElement.offsetWidth;
882
- const newColumnWidth = columnWidth + delta;
881
+ if (columnElement) {
882
+ const columnWidth = columnElement.offsetWidth;
883
+ const newColumnWidth = columnWidth + delta;
883
884
 
884
- const minWidth = 15;
885
+ const minWidth = 15;
885
886
 
886
- if (columnWidth + delta > parseInt(minWidth.toString(), 10) && resizeColumnElement.value) {
887
- nextColumn.value = filteredCols.value[filteredCols.value.indexOf(resizeColumnElement.value) + 1];
887
+ if (columnWidth + delta > parseInt(minWidth.toString(), 10) && resizeColumnElement.value) {
888
+ nextColumn.value = filteredCols.value[filteredCols.value.indexOf(resizeColumnElement.value) + 1];
888
889
 
889
- if (nextColumn.value) {
890
- const nextColElement = table.value.querySelector(`#${nextColumn.value.id}`);
890
+ if (nextColumn.value) {
891
+ const nextColElement = table.value.querySelector(`#${nextColumn.value.id}`);
891
892
 
892
- const nextColumnWidth = (nextColElement as HTMLElement).offsetWidth - delta;
893
- if (newColumnWidth > 15 && nextColumnWidth > 15) {
894
- resizeTableCells(newColumnWidth, nextColumnWidth);
895
- }
896
- } else {
897
- if (newColumnWidth > 15) {
898
- resizeColumnElement.value.width = newColumnWidth + "px";
893
+ const nextColumnWidth = (nextColElement as HTMLElement).offsetWidth - delta;
894
+ if (newColumnWidth > 15 && nextColumnWidth > 15) {
895
+ resizeTableCells(newColumnWidth, nextColumnWidth);
896
+ }
897
+ } else {
898
+ if (newColumnWidth > 15) {
899
+ resizeColumnElement.value.width = newColumnWidth + "px";
900
+ }
899
901
  }
900
902
  }
901
- }
902
- resizer.value.style.display = "none";
903
+ resizer.value.style.display = "none";
903
904
 
904
- unbindColumnResizeEvents();
905
+ unbindColumnResizeEvents();
905
906
 
906
- saveState();
907
+ saveState();
908
+ }
907
909
  }
908
910
 
909
911
  function resizeTableCells(newColumnWidth: number, nextColumnWidth: number) {