@vc-shell/framework 1.1.84 → 1.1.86

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 (44) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/core/types/index.ts +4 -4
  3. package/dist/core/types/index.d.ts +4 -4
  4. package/dist/core/types/index.d.ts.map +1 -1
  5. package/dist/framework.js +3482 -3475
  6. package/dist/index.css +1 -1
  7. package/dist/shared/composables/useExternalWidgets.d.ts.map +1 -1
  8. package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts +4 -1
  9. package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts.map +1 -1
  10. package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +1 -0
  11. package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts.map +1 -1
  12. package/dist/shared/modules/dynamic/types/index.d.ts +3 -3
  13. package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
  14. package/dist/tsconfig.tsbuildinfo +1 -1
  15. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +63 -36
  16. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts.map +1 -1
  17. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +1 -1
  18. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue.d.ts +3 -3
  19. 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
  20. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue.d.ts +3 -3
  21. package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue.d.ts.map +1 -1
  22. package/dist/ui/components/organisms/vc-table/_internal/vc-table-empty/vc-table-empty.vue.d.ts +3 -13
  23. package/dist/ui/components/organisms/vc-table/_internal/vc-table-empty/vc-table-empty.vue.d.ts.map +1 -1
  24. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts +3 -3
  25. package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts.map +1 -1
  26. package/dist/ui/components/organisms/vc-table/types.d.ts +5 -5
  27. package/dist/ui/components/organisms/vc-table/types.d.ts.map +1 -1
  28. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +3 -3
  29. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  30. package/package.json +4 -4
  31. package/shared/composables/useExternalWidgets.ts +2 -1
  32. package/shared/composables/useMenuExpanded.ts +1 -1
  33. package/shared/modules/assets/components/assets-details/assets-details.vue +8 -1
  34. package/shared/modules/assets-manager/components/assets-manager/assets-manager.vue +2 -0
  35. package/shared/modules/dynamic/pages/dynamic-blade-list.vue +2 -2
  36. package/shared/modules/dynamic/types/index.ts +2 -2
  37. package/ui/components/molecules/vc-input/vc-input.vue +68 -23
  38. package/ui/components/organisms/vc-blade/vc-blade.vue +1 -1
  39. package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-body/vc-table-body.vue +3 -3
  40. package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue +3 -3
  41. package/ui/components/organisms/vc-table/_internal/vc-table-empty/vc-table-empty.vue +21 -35
  42. package/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue +7 -3
  43. package/ui/components/organisms/vc-table/types.ts +5 -5
  44. package/ui/components/organisms/vc-table/vc-table.vue +3 -3
@@ -241,14 +241,13 @@
241
241
  <script lang="ts" setup>
242
242
  import { computed, ref, unref, watch } from "vue";
243
243
  import { VcLabel, VcIcon, VcHint } from "./../../";
244
- import VueDatePicker, { VueDatePickerProps } from "@vuepic/vue-datepicker";
244
+ import VueDatePicker, { VueDatePickerProps, ModelValue } from "@vuepic/vue-datepicker";
245
245
  import "@vuepic/vue-datepicker/dist/main.css";
246
246
 
247
- export interface Props {
248
- /**
249
- * Model of the component; Use with a listener for 'update:model-value' event OR use v-model directive
250
- */
251
- modelValue?: string | number | Date | null | undefined;
247
+ /**
248
+ * Base props for VcInput
249
+ */
250
+ interface VcInputBaseProps {
252
251
  /**
253
252
  * Input label text
254
253
  */
@@ -257,15 +256,6 @@ export interface Props {
257
256
  * Input placeholder text
258
257
  */
259
258
  placeholder?: string;
260
- /**
261
- * Input type
262
- * Default value: text
263
- */
264
- type?: "text" | "password" | "email" | "tel" | "number" | "integer" | "url" | "time" | "date" | "datetime-local";
265
- /**
266
- * The step attribute is a number that specifies the granularity that the value must adhere to.
267
- */
268
- step?: string;
269
259
  /**
270
260
  * Input description (hint) text below input component
271
261
  */
@@ -332,6 +322,56 @@ export interface Props {
332
322
  * Input current language
333
323
  */
334
324
  currentLanguage?: string;
325
+ /**
326
+ * The step attribute is a number that specifies the granularity that the value must adhere to.
327
+ */
328
+ step?: string;
329
+ size?: "default" | "small";
330
+ }
331
+
332
+ /**
333
+ * Props for string-based inputs
334
+ */
335
+ interface VcInputStringProps extends VcInputBaseProps {
336
+ /**
337
+ * Model of the component; Use with a listener for 'update:model-value' event OR use v-model directive
338
+ */
339
+ modelValue?: string | null;
340
+ /**
341
+ * Input type
342
+ * Default value: text
343
+ */
344
+ type?: "text" | "password" | "email" | "tel" | "url" | "time";
345
+ datePickerOptions?: never;
346
+ }
347
+
348
+ /**
349
+ * Props for number-based inputs
350
+ */
351
+ interface VcInputNumberProps extends VcInputBaseProps {
352
+ /**
353
+ * Model of the component; Use with a listener for 'update:model-value' event OR use v-model directive
354
+ */
355
+ modelValue?: number | null;
356
+ /**
357
+ * Input type
358
+ */
359
+ type: "number" | "integer";
360
+ datePickerOptions?: never;
361
+ }
362
+
363
+ /**
364
+ * Props for date-based inputs
365
+ */
366
+ interface VcInputDateProps extends VcInputBaseProps {
367
+ /**
368
+ * Model of the component; Use with a listener for 'update:model-value' event OR use v-model directive
369
+ */
370
+ modelValue?: ModelValue;
371
+ /**
372
+ * Input type
373
+ */
374
+ type: "date" | "datetime-local";
335
375
  /**
336
376
  * VueDatePicker options
337
377
  *
@@ -340,14 +380,19 @@ export interface Props {
340
380
  * @see https://vue3datepicker.com/
341
381
  */
342
382
  datePickerOptions?: VueDatePickerProps;
343
- size?: "default" | "small";
344
383
  }
345
384
 
385
+ export type Props = VcInputStringProps | VcInputNumberProps | VcInputDateProps;
386
+
346
387
  export interface Emits {
347
388
  /**
348
389
  * Emitted when the component needs to change the model; Is also used by v-model
390
+ * Type of value depends on input type:
391
+ * - string inputs: string | null
392
+ * - number inputs: number | null
393
+ * - date inputs: ModelValue
349
394
  */
350
- (event: "update:modelValue", value: string | number | Date | null | undefined): void;
395
+ (event: "update:modelValue", value: string | number | ModelValue | null | undefined): void;
351
396
  (event: "blur", value: Event): void;
352
397
  (event: "focus"): void;
353
398
  }
@@ -377,14 +422,14 @@ defineSlots<{
377
422
  */
378
423
  focused: boolean | undefined;
379
424
  /**
380
- * Field's value
425
+ * Field's value - type depends on input type
381
426
  */
382
- modelValue: string | number | Date | null;
427
+ modelValue: string | number | ModelValue | null;
383
428
  /**
384
429
  * Function that emits an @input event in the context of the field
385
- * @param value Value to be emitted
430
+ * @param value Value to be emitted - type depends on input type
386
431
  */
387
- emitValue: (value: string | number | Date | null) => void;
432
+ emitValue: (value: string | number | ModelValue | null) => void;
388
433
  /**
389
434
  * Field placeholder text
390
435
  */
@@ -522,11 +567,11 @@ function onKeyDown(e: KeyboardEvent) {
522
567
  }
523
568
 
524
569
  // Handle input event and emit changes
525
- function onInput(value: string | number | Date | null) {
570
+ function onInput(value: string | number | ModelValue | null) {
526
571
  emitValue(value);
527
572
  }
528
573
 
529
- function emitValue(val: string | number | Date | null) {
574
+ function emitValue(val: string | number | ModelValue | null) {
530
575
  emitValueFn = () => {
531
576
  if (mutatedModel.value !== val) {
532
577
  let value;
@@ -175,7 +175,7 @@ const slots = defineSlots<{
175
175
  * Use `useWidgets` composable instead
176
176
  * @example
177
177
  * // Register widget in blade:
178
- * const blade = inject(BladeInstance);
178
+ * const blade = useBlade();
179
179
  * const widgetService = useWidgets();
180
180
  * widgetService.registerWidget({
181
181
  * id: "widget-id",
@@ -73,7 +73,7 @@
73
73
  import VcTableRow from "../vc-table-row/vc-table-row.vue";
74
74
  import VcTableEmpty from "../../../vc-table-empty/vc-table-empty.vue";
75
75
  import type { IActionBuilderResult } from "../../../../../../../../core/types";
76
- import type { TableSlots, TableItem, TableColPartial, StatusImage } from "../../../../types";
76
+ import type { TableSlots, TableItem, TableColPartial, TableEmptyAction } from "../../../../types";
77
77
  import { MaybeRef, useSlots } from "vue";
78
78
 
79
79
  defineProps<{
@@ -93,8 +93,8 @@ defineProps<{
93
93
  columnsInit: boolean;
94
94
  searchValue?: string;
95
95
  activeFilterCount?: number;
96
- notfound?: StatusImage;
97
- empty?: StatusImage;
96
+ notfound?: TableEmptyAction;
97
+ empty?: TableEmptyAction;
98
98
  isSelected: (item: T) => boolean;
99
99
  }>();
100
100
 
@@ -93,7 +93,7 @@ import VcTableSelectAllHeader from "./_internal/vc-table-select-all-header/vc-ta
93
93
  import VcTableBody from "./_internal/vc-table-body/vc-table-body.vue";
94
94
  import type { IActionBuilderResult, ITableColumns } from "../../../../../../core/types";
95
95
  import { useTableRowReorder } from "../../composables/useTableRowReorder";
96
- import type { TableSlots, TableItem, TableColPartial, StatusImage } from "../../types";
96
+ import type { TableSlots, TableItem, TableColPartial, TableEmptyAction } from "../../types";
97
97
 
98
98
  const props = defineProps<{
99
99
  items: T[];
@@ -123,8 +123,8 @@ const props = defineProps<{
123
123
  hasClickListener?: boolean;
124
124
  searchValue?: string;
125
125
  activeFilterCount?: number;
126
- notfound?: StatusImage;
127
- empty?: StatusImage;
126
+ notfound?: TableEmptyAction;
127
+ empty?: TableEmptyAction;
128
128
  isSelected: (item: T) => boolean;
129
129
  rowCheckbox: (item: T) => void;
130
130
  internalColumns: TableColPartial[];
@@ -6,18 +6,17 @@
6
6
  name="notfound"
7
7
  >
8
8
  <div class="vc-table-empty">
9
- <img
10
- v-if="notfound?.image"
11
- :src="notfound.image"
12
- alt="Not Found"
13
- class="vc-table-empty__image"
9
+ <VcIcon
10
+ v-if="notfound?.icon"
11
+ :icon="notfound.icon"
12
+ size="xxxl"
13
+ class="vc-table-empty__icon"
14
14
  />
15
15
  <div class="vc-table-empty__text">
16
16
  {{ notfound?.text || $t("COMPONENTS.ORGANISMS.VC_TABLE.NOT_FOUND") }}
17
17
  </div>
18
18
  <VcButton
19
19
  v-if="notfound?.action"
20
- class="vc-table-empty__button"
21
20
  @click="notfound?.clickHandler"
22
21
  >
23
22
  {{ notfound.action }}
@@ -29,18 +28,17 @@
29
28
  name="empty"
30
29
  >
31
30
  <div class="vc-table-empty vc-table-empty--default">
32
- <img
33
- v-if="empty?.image"
34
- :src="empty.image"
35
- alt="Empty Table"
36
- class="vc-table-empty__image"
37
- />
31
+ <VcIcon
32
+ v-if="empty?.icon"
33
+ :icon="empty.icon"
34
+ size="xxxl"
35
+ class="vc-table-empty__icon"
36
+ />
38
37
  <div class="vc-table-empty__text">
39
38
  {{ empty?.text || $t("COMPONENTS.ORGANISMS.VC_TABLE.EMPTY") }}
40
39
  </div>
41
40
  <VcButton
42
41
  v-if="empty?.action"
43
- class="vc-table-empty__button"
44
42
  @click="empty?.clickHandler"
45
43
  >
46
44
  {{ empty.action }}
@@ -53,24 +51,15 @@
53
51
  <!-- eslint-disable @typescript-eslint/no-explicit-any -->
54
52
  <script lang="ts" setup>
55
53
  import { Ref } from "vue";
54
+ import { TableEmptyAction } from "../../types";
56
55
 
57
56
  export interface Props {
58
57
  items: any[];
59
58
  columnsInit: boolean;
60
59
  searchValue?: string;
61
60
  activeFilterCount?: number;
62
- notfound?: {
63
- image?: string;
64
- text: string | Ref<string>;
65
- action?: string;
66
- clickHandler?: () => void;
67
- };
68
- empty?: {
69
- image?: string;
70
- text: string | Ref<string>;
71
- action?: string;
72
- clickHandler?: () => void;
73
- };
61
+ notfound?: TableEmptyAction;
62
+ empty?: TableEmptyAction;
74
63
  }
75
64
 
76
65
  defineProps<Props>();
@@ -81,22 +70,19 @@ defineSlots<{
81
70
  </script>
82
71
 
83
72
  <style lang="scss">
73
+ :root {
74
+ --table-empty-icon-color: var(--secondary-500);
75
+ }
76
+
84
77
  .vc-table-empty {
85
78
  @apply tw-w-full tw-h-full tw-box-border tw-flex tw-flex-col tw-items-center tw-justify-center;
86
79
 
87
- &__image {
88
- @apply tw-w-auto tw-h-auto;
80
+ &__icon {
81
+ @apply tw-text-[color:var(--table-empty-icon-color)];
89
82
  }
90
83
 
91
84
  &__text {
92
- @apply tw-m-4;
93
- @apply tw-text-center;
94
- @apply tw-text-xl tw-font-medium;
95
- }
96
-
97
- &__button {
98
- @apply tw-px-4 tw-py-2 tw-rounded tw-font-medium tw-text-sm tw-cursor-pointer;
99
- transition: background-color 0.3s ease;
85
+ @apply tw-m-4 tw-text-xl tw-font-medium;
100
86
  }
101
87
  }
102
88
  </style>
@@ -53,6 +53,7 @@
53
53
  :cell="column"
54
54
  :item="item"
55
55
  :index="i"
56
+ :editing="editing"
56
57
  @update="$emit('onEditComplete', { event: $event, index: i })"
57
58
  @blur="$emit('onCellBlur', $event)"
58
59
  />
@@ -81,6 +82,7 @@
81
82
  :cell="column"
82
83
  :item="item"
83
84
  :index="i"
85
+ :editing="editing"
84
86
  @update="$emit('onEditComplete', { event: $event, index: i })"
85
87
  @blur="$emit('onCellBlur', $event)"
86
88
  />
@@ -116,6 +118,7 @@
116
118
  :cell="column"
117
119
  :item="item"
118
120
  :index="i"
121
+ :editing="editing"
119
122
  @update="$emit('onEditComplete', { event: $event, index: i })"
120
123
  @blur="$emit('onCellBlur', $event)"
121
124
  />
@@ -148,6 +151,7 @@
148
151
  :cell="column"
149
152
  :item="item"
150
153
  :index="i"
154
+ :editing="editing"
151
155
  @update="$emit('onEditComplete', { event: $event, index: i })"
152
156
  @blur="$emit('onCellBlur', $event)"
153
157
  />
@@ -189,7 +193,7 @@ import { computed } from "vue";
189
193
  import VcTableCell from "../vc-table-cell/vc-table-cell.vue";
190
194
  import VcTableEmpty from "../vc-table-empty/vc-table-empty.vue";
191
195
  import VcTableMobileItem from "../vc-table-mobile-item/vc-table-mobile-item.vue";
192
- import type { TableItem, StatusImage } from "../../types";
196
+ import type { TableItem, TableEmptyAction } from "../../types";
193
197
  import { IActionBuilderResult, ITableColumns } from "../../../../../../core/types";
194
198
  import { provideTableSwipe } from "../../composables/useTableSwipe";
195
199
 
@@ -206,8 +210,8 @@ const props = defineProps<{
206
210
  columnsInit: boolean;
207
211
  searchValue?: string;
208
212
  activeFilterCount?: number;
209
- notfound?: StatusImage;
210
- empty?: StatusImage;
213
+ notfound?: TableEmptyAction;
214
+ empty?: TableEmptyAction;
211
215
  }>();
212
216
 
213
217
  const emit = defineEmits<{
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import type { Ref, VNode } from "vue";
2
+ import type { ComputedRef, Ref, VNode } from "vue";
3
3
  import { IActionBuilderResult, ITableColumns } from "../../../../core/types";
4
4
 
5
5
  export interface TableSlots<T> {
@@ -24,9 +24,9 @@ export type TableColPartial = Partial<
24
24
  }
25
25
  >;
26
26
 
27
- export interface StatusImage {
28
- image?: string;
29
- text: string | Ref<string>;
30
- action?: string;
27
+ export interface TableEmptyAction {
28
+ icon?: string;
29
+ text: string | Ref<string> | ComputedRef<string>;
30
+ action?: string | Ref<string> | ComputedRef<string>;
31
31
  clickHandler?: () => void;
32
32
  }
@@ -196,7 +196,7 @@ import VcTableDesktopView from "./_internal/vc-table-desktop-view/vc-table-deskt
196
196
  import VcTableHeader from "./_internal/vc-table-header/vc-table-header.vue";
197
197
  import VcTableSelectAll from "./_internal/vc-table-select-all/vc-table-select-all.vue";
198
198
  import VcTableFooter from "./_internal/vc-table-footer/vc-table-footer.vue";
199
- import type { TableSlots, TableItem, TableColPartial, StatusImage } from "./types";
199
+ import type { TableSlots, TableItem, TableColPartial, TableEmptyAction } from "./types";
200
200
 
201
201
  defineSlots<TableSlots<T>>();
202
202
 
@@ -216,8 +216,8 @@ const props = withDefaults(
216
216
  searchPlaceholder?: string;
217
217
  searchValue?: string;
218
218
  loading?: MaybeRef<boolean>;
219
- empty?: StatusImage;
220
- notfound?: StatusImage;
219
+ empty?: TableEmptyAction;
220
+ notfound?: TableEmptyAction;
221
221
  header?: boolean;
222
222
  footer?: boolean;
223
223
  activeFilterCount?: number;