@vc-shell/framework 1.0.118 → 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 (96) hide show
  1. package/CHANGELOG.md +23 -5770
  2. package/dist/framework.mjs +11063 -10935
  3. package/dist/index.css +1 -1
  4. package/dist/shared/modules/dynamic/components/factories.d.ts +1 -1
  5. package/dist/shared/modules/dynamic/components/factories.d.ts.map +1 -1
  6. package/dist/shared/modules/dynamic/components/fields/Button.d.ts +8 -4
  7. package/dist/shared/modules/dynamic/components/fields/Button.d.ts.map +1 -1
  8. package/dist/shared/modules/dynamic/components/fields/Card.d.ts +8 -4
  9. package/dist/shared/modules/dynamic/components/fields/Card.d.ts.map +1 -1
  10. package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts +8 -4
  11. package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts.map +1 -1
  12. package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts +8 -4
  13. package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts.map +1 -1
  14. package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts +8 -4
  15. package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -1
  16. package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts +8 -4
  17. package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts.map +1 -1
  18. package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts +8 -4
  19. package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts.map +1 -1
  20. package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts +8 -4
  21. package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts.map +1 -1
  22. package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts +8 -4
  23. package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -1
  24. package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts +8 -4
  25. package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts.map +1 -1
  26. package/dist/shared/modules/dynamic/components/fields/InputField.d.ts +13 -9
  27. package/dist/shared/modules/dynamic/components/fields/InputField.d.ts.map +1 -1
  28. package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts +8 -4
  29. package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -1
  30. package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts +8 -4
  31. package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts.map +1 -1
  32. package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts +8 -4
  33. package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -1
  34. package/dist/shared/modules/dynamic/components/fields/props.d.ts +9 -5
  35. package/dist/shared/modules/dynamic/components/fields/props.d.ts.map +1 -1
  36. package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts +1 -1
  37. package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
  38. package/dist/shared/modules/dynamic/types/index.d.ts +120 -19
  39. package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
  40. package/dist/shared/modules/dynamic/types/models.d.ts +1 -0
  41. package/dist/shared/modules/dynamic/types/models.d.ts.map +1 -1
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/dist/ui/components/atoms/vc-checkbox/index.d.ts +13 -0
  44. package/dist/ui/components/atoms/vc-checkbox/index.d.ts.map +1 -1
  45. package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts +1 -0
  46. package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts.map +1 -1
  47. package/dist/ui/components/atoms/vc-col/index.d.ts +1 -80
  48. package/dist/ui/components/atoms/vc-col/index.d.ts.map +1 -1
  49. package/dist/ui/components/atoms/vc-col/vc-col.vue.d.ts +3 -3
  50. package/dist/ui/components/atoms/vc-col/vc-col.vue.d.ts.map +1 -1
  51. package/dist/ui/components/atoms/vc-row/index.d.ts +1 -52
  52. package/dist/ui/components/atoms/vc-row/index.d.ts.map +1 -1
  53. package/dist/ui/components/atoms/vc-row/vc-row.vue.d.ts +3 -3
  54. package/dist/ui/components/atoms/vc-row/vc-row.vue.d.ts.map +1 -1
  55. package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts.map +1 -1
  56. package/dist/ui/components/molecules/vc-multivalue/index.d.ts +3 -3
  57. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +3 -3
  58. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +3 -3
  59. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
  60. package/dist/ui/components/molecules/vc-textarea/index.d.ts +13 -13
  61. package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts +3 -3
  62. package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
  63. package/dist/ui/components/organisms/vc-gallery/index.d.ts +6 -6
  64. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
  65. package/dist/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue.d.ts +3 -14
  66. package/dist/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue.d.ts.map +1 -1
  67. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
  68. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
  69. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.d.ts.map +1 -1
  70. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  71. package/package.json +4 -4
  72. package/shared/modules/dynamic/components/factories.ts +2 -1
  73. package/shared/modules/dynamic/components/fields/EditorField.ts +3 -6
  74. package/shared/modules/dynamic/components/fields/Fieldset.ts +12 -5
  75. package/shared/modules/dynamic/components/fields/GalleryField.ts +8 -5
  76. package/shared/modules/dynamic/components/fields/InputField.ts +25 -3
  77. package/shared/modules/dynamic/components/fields/props.ts +5 -5
  78. package/shared/modules/dynamic/helpers/nodeBuilder.ts +75 -34
  79. package/shared/modules/dynamic/types/index.ts +120 -19
  80. package/shared/modules/dynamic/types/models.ts +1 -0
  81. package/ui/components/atoms/vc-checkbox/vc-checkbox.vue +6 -0
  82. package/ui/components/atoms/vc-col/index.ts +1 -10
  83. package/ui/components/atoms/vc-col/vc-col.vue +10 -5
  84. package/ui/components/atoms/vc-image/vc-image.vue +1 -1
  85. package/ui/components/atoms/vc-label/vc-label.vue +1 -1
  86. package/ui/components/atoms/vc-row/index.ts +1 -10
  87. package/ui/components/atoms/vc-row/vc-row.vue +8 -1
  88. package/ui/components/molecules/vc-field/vc-field.vue +15 -15
  89. package/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +1 -1
  90. package/ui/components/organisms/vc-gallery/vc-gallery.vue +24 -20
  91. package/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue +2 -4
  92. package/ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue +1 -1
  93. package/ui/components/organisms/vc-popup/vc-popup.vue +5 -0
  94. package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +7 -5
  95. package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +11 -16
  96. package/ui/components/organisms/vc-table/vc-table.vue +33 -31
@@ -95,6 +95,7 @@ export type IStatusField = {
95
95
  export type IInputField = {
96
96
  props: ComponentProps<typeof VcInput> | IControlBaseProps;
97
97
  options: IControlBaseOptions;
98
+ slots?: Partial<Pick<ComponentSlots<typeof VcInput>, "append" | "prepend" | "append-inner" | "prepend-inner">>;
98
99
  } & FieldOpts<typeof VcInput>;
99
100
 
100
101
  export type IContentField = {
@@ -10,6 +10,11 @@
10
10
  :required="required"
11
11
  >
12
12
  <span>{{ label }}</span>
13
+ <template
14
+ v-if="tooltip"
15
+ #tooltip
16
+ >{{ tooltip }}</template
17
+ >
13
18
  </VcLabel>
14
19
  <label class="vc-checkbox__label">
15
20
  <input
@@ -57,6 +62,7 @@ export interface Props {
57
62
  trueValue?: boolean;
58
63
  falseValue?: boolean;
59
64
  label?: string;
65
+ tooltip?: string;
60
66
  }
61
67
 
62
68
  export interface Emits {
@@ -1,10 +1 @@
1
- import { VNode } from "vue";
2
- import _Col from "./vc-col.vue";
3
-
4
- export const VcCol = _Col as typeof _Col & {
5
- new (): {
6
- $slots: {
7
- default: () => VNode[];
8
- };
9
- };
10
- };
1
+ export { default as VcCol } from "./vc-col.vue";
@@ -15,12 +15,17 @@ export interface Props {
15
15
  withDefaults(defineProps<Props>(), {
16
16
  size: "1",
17
17
  });
18
+
19
+ defineSlots<{
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+ default: (props: any) => any;
22
+ }>();
18
23
  </script>
19
24
 
20
25
  <style lang="scss">
21
- .vc-col {
22
- .vc-app_mobile & {
23
- @apply tw-grow #{!important};
24
- }
25
- }
26
+ // .vc-col {
27
+ // .vc-app_mobile & {
28
+ // @apply tw-grow #{!important};
29
+ // }
30
+ // }
26
31
  </style>
@@ -99,7 +99,7 @@ $paddings: xs, s, m, l, xl, xxl;
99
99
 
100
100
  @each $padding in $paddings {
101
101
  &_#{$padding} {
102
- @apply tw-w-[var(--image-size-#{$padding})];
102
+ @apply tw-w-[var(--image-size-#{$padding})] tw-max-w-full tw-min-w-0;
103
103
  }
104
104
  }
105
105
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="tw-flex tw-flex-nowrap tw-font-bold tw-relative">
3
- <span><slot></slot></span>
3
+ <span class="tw-truncate"><slot></slot></span>
4
4
  <span
5
5
  v-if="required"
6
6
  class="tw-text-[color:var(--label-required-color)] tw-ml-1"
@@ -1,10 +1 @@
1
- import { VNode } from "vue";
2
- import _Row from "./vc-row.vue";
3
-
4
- export const VcRow = _Row as typeof _Row & {
5
- new (): {
6
- $slots: {
7
- default: () => VNode[];
8
- };
9
- };
10
- };
1
+ export { default as VcRow } from "./vc-row.vue";
@@ -4,10 +4,17 @@
4
4
  </div>
5
5
  </template>
6
6
 
7
+ <script setup lang="ts">
8
+ defineSlots<{
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ default: (props: any) => any;
11
+ }>();
12
+ </script>
13
+
7
14
  <style lang="scss">
8
15
  .vc-row {
9
16
  .vc-app_mobile & {
10
- display: block;
17
+ display: grid;
11
18
  }
12
19
  }
13
20
  </style>
@@ -9,22 +9,22 @@
9
9
  >{{ tooltip }}</template
10
10
  ></VcLabel
11
11
  >
12
- <div>
13
- <VcFieldType
14
- :value="modelValue"
15
- :type="type"
16
- >
17
- <VcButton
18
- v-if="copyable"
19
- icon="far fa-copy"
20
- size="m"
21
- class="tw-ml-2"
22
- text
23
- @click="copy(modelValue)"
24
- ></VcButton>
25
- </VcFieldType>
26
- </div>
12
+ <!-- <div> -->
13
+ <VcFieldType
14
+ :value="modelValue"
15
+ :type="type"
16
+ >
17
+ <VcButton
18
+ v-if="copyable"
19
+ icon="far fa-copy"
20
+ size="m"
21
+ class="tw-ml-2"
22
+ text
23
+ @click="copy(modelValue)"
24
+ ></VcButton>
25
+ </VcFieldType>
27
26
  </div>
27
+ <!-- </div> -->
28
28
  </template>
29
29
 
30
30
  <script lang="ts" setup>
@@ -7,7 +7,7 @@
7
7
  <template #title>
8
8
  <div>
9
9
  <span>{{ currentImage.name }} (</span>
10
- <VcLink @click="copyLink(currentImage.url)">{{
10
+ <VcLink @click="copyLink(currentImage.url ?? '')">{{
11
11
  t("COMPONENTS.ORGANISMS.VC_GALLERY.INTERNAL.VC_GALLERY_PREVIEW.COPY_IMAGE_LINK")
12
12
  }}</VcLink>
13
13
  <span>)</span>
@@ -175,7 +175,7 @@ function onItemDragStart(event: DragEvent, item: IImage) {
175
175
  if (!props.disableDrag && !props.disabled) {
176
176
  draggedItem.value = item;
177
177
  draggedElement.value = event.target as HTMLElement;
178
- event.dataTransfer.setData("text", "gallery_reorder");
178
+ event.dataTransfer?.setData("text", "gallery_reorder");
179
179
  }
180
180
  }
181
181
 
@@ -185,33 +185,35 @@ function onItemDragOver(event: DragEvent) {
185
185
  if (!props.disableDrag && !props.disabled && draggedItem.value && dropItem) {
186
186
  event.preventDefault();
187
187
 
188
- const containerOffset = galleryRef.value.getBoundingClientRect();
188
+ const containerOffset = galleryRef.value?.getBoundingClientRect();
189
189
  const dropItemOffset = dropItem.getBoundingClientRect();
190
190
 
191
- if (draggedElement.value !== dropItem) {
191
+ if (draggedElement.value !== dropItem && containerOffset) {
192
192
  const elementStyle = getComputedStyle(dropItem);
193
193
  const dropItemOffsetWidth = dropItem.offsetWidth + parseFloat(elementStyle.marginLeft);
194
194
  const targetLeft = dropItemOffset.left - containerOffset.left;
195
195
  const columnCenter = dropItemOffset.left + dropItemOffsetWidth / 2;
196
196
 
197
- reorderGalleryRef.value.style.top = dropItemOffset.top - containerOffset.top + "px";
198
- reorderGalleryRef.value.style.height = dropItem.offsetHeight + "px";
197
+ if (reorderGalleryRef.value) {
198
+ reorderGalleryRef.value.style.top = dropItemOffset.top - containerOffset.top + "px";
199
+ reorderGalleryRef.value.style.height = dropItem.offsetHeight + "px";
199
200
 
200
- if (event.pageX > columnCenter) {
201
- reorderGalleryRef.value.style.left = targetLeft + dropItemOffsetWidth + "px";
202
- dropPosition.value = 1;
203
- } else {
204
- reorderGalleryRef.value.style.left = targetLeft - parseFloat(elementStyle.marginLeft) + "px";
205
- dropPosition.value = -1;
206
- }
201
+ if (event.pageX > columnCenter) {
202
+ reorderGalleryRef.value.style.left = targetLeft + dropItemOffsetWidth + "px";
203
+ dropPosition.value = 1;
204
+ } else {
205
+ reorderGalleryRef.value.style.left = targetLeft - parseFloat(elementStyle.marginLeft) + "px";
206
+ dropPosition.value = -1;
207
+ }
207
208
 
208
- reorderGalleryRef.value.style.display = "block";
209
+ reorderGalleryRef.value.style.display = "block";
210
+ }
209
211
  }
210
212
  }
211
213
  }
212
214
 
213
215
  function onItemDragLeave(event: DragEvent) {
214
- if (!props.disableDrag && !props.disabled && draggedItem.value) {
216
+ if (!props.disableDrag && !props.disabled && draggedItem.value && reorderGalleryRef.value) {
215
217
  event.preventDefault();
216
218
 
217
219
  reorderGalleryRef.value.style.display = "none";
@@ -241,10 +243,12 @@ function onItemDrop(event: DragEvent, item: IImage) {
241
243
  updateOrder();
242
244
  }
243
245
 
244
- reorderGalleryRef.value.style.display = "none";
245
- draggedElement.value.draggable = false;
246
- draggedItem.value = null;
247
- dropPosition.value = null;
246
+ if (reorderGalleryRef.value && draggedElement.value) {
247
+ reorderGalleryRef.value.style.display = "none";
248
+ draggedElement.value.draggable = false;
249
+ draggedItem.value = undefined;
250
+ dropPosition.value = undefined;
251
+ }
248
252
  }
249
253
  }
250
254
 
@@ -265,8 +269,8 @@ function findParentElement(element: HTMLElement) {
265
269
  } else {
266
270
  let parent = element.parentElement;
267
271
 
268
- while (!parent.classList.contains("vc-gallery__item")) {
269
- parent = parent.parentElement;
272
+ while (!(parent && parent.classList.contains("vc-gallery__item"))) {
273
+ parent = parent?.parentElement || null;
270
274
  if (!parent) break;
271
275
  }
272
276
  return parent;
@@ -7,7 +7,7 @@
7
7
  <template v-else>
8
8
  <VcNotificationTemplate
9
9
  :color="notificationStyle.color"
10
- :title="notification.title"
10
+ :title="notification.title ?? ''"
11
11
  :icon="notificationStyle.icon"
12
12
  >
13
13
  <VcHint
@@ -42,9 +42,7 @@ export interface Emits {
42
42
  (event: "onClick"): void;
43
43
  }
44
44
 
45
- const props = withDefaults(defineProps<Props>(), {
46
- notification: undefined,
47
- });
45
+ const props = defineProps<Props>();
48
46
 
49
47
  const emit = defineEmits<Emits>();
50
48
 
@@ -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>
@@ -47,6 +47,11 @@ import VcPopupError from "./_internal/vc-popup-error/vc-popup-error.vue";
47
47
  import { defineComponent, PropType } from "vue";
48
48
 
49
49
  export default defineComponent({
50
+ components: {
51
+ VcIcon,
52
+ VcPopupWarning,
53
+ VcPopupError,
54
+ },
50
55
  props: {
51
56
  title: {
52
57
  type: String,
@@ -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) {