@vc-shell/framework 1.0.310 → 1.0.312
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.
- package/CHANGELOG.md +32 -0
- package/core/composables/useErrorHandler/index.ts +16 -6
- package/dist/{azuread-D_-YSXMY.js → azuread-Csgs_sKj.js} +2 -2
- package/dist/core/composables/useErrorHandler/index.d.ts.map +1 -1
- package/dist/{external-provider-CxkqPmUa.js → external-provider-CyDAiiDP.js} +1 -1
- package/dist/{external-provider.vue_vue_type_script_setup_true_lang-BX4frPix.js → external-provider.vue_vue_type_script_setup_true_lang-CnVoBBp4.js} +1 -1
- package/dist/external-providers-True-qPq.js +4 -0
- package/dist/framework.js +1 -1
- package/dist/{index-BDN9lqET.js → index-B19dE8eg.js} +18297 -18263
- package/dist/{index-BOrRV1c5.js → index-BOUFJM1n.js} +1 -1
- package/dist/{index-Cn46fOF_.js → index-Be_7BCcT.js} +1 -1
- package/dist/{index-D05sdNAU.js → index-Bpdi_Sze.js} +1 -1
- package/dist/{index-D6dVOtAa.js → index-BzCp1GTJ.js} +1 -1
- package/dist/{index-Dx60WxW_.js → index-C0vdLxzV.js} +1 -1
- package/dist/{index-1XoCglle.js → index-C7XsNd0G.js} +1 -1
- package/dist/{index-BffTZ6x3.js → index-CQGYL1ZP.js} +1 -1
- package/dist/{index-DsZA_G22.js → index-CWxBR18X.js} +1 -1
- package/dist/{index-B7Jhi3-9.js → index-CaBPmZRk.js} +1 -1
- package/dist/{index-TfW1-l3Z.js → index-CqnDQOLE.js} +1 -1
- package/dist/{index-DoEMyMXF.js → index-D987uc87.js} +1 -1
- package/dist/{index-DjRS4HPL.js → index-Dc7_DReQ.js} +1 -1
- package/dist/{index-CX3KIwQO.js → index-DdKKc4hb.js} +1 -1
- package/dist/{index-vXt3fADg.js → index-DoJZnaE4.js} +1 -1
- package/dist/{index-B3u_K2zK.js → index-VqeC_uGQ.js} +1 -1
- package/dist/{index-BWTJFZEI.js → index-i_fSWJAs.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/types/index.d.ts +1 -0
- package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts +15 -0
- package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +3 -0
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/components/user-dropdown-button/user-dropdown-button.vue +82 -50
- package/shared/modules/dynamic/components/fields/StatusField.ts +1 -1
- package/shared/modules/dynamic/composables/useFilterBuilder/index.ts +1 -1
- package/shared/modules/dynamic/factories/types/index.ts +1 -0
- package/shared/modules/dynamic/helpers/override.ts +0 -2
- package/shared/modules/dynamic/index.ts +30 -16
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +0 -4
- package/ui/components/atoms/vc-status/vc-status.vue +9 -9
- package/ui/components/molecules/vc-pagination/vc-pagination.vue +8 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +17 -8
- package/ui/components/organisms/vc-app/vc-app.vue +9 -18
- package/ui/components/organisms/vc-blade/vc-blade.vue +2 -1
- package/ui/components/organisms/vc-table/vc-table.vue +71 -22
- package/dist/external-providers-BjKh317l.js +0 -4
|
@@ -6,17 +6,22 @@
|
|
|
6
6
|
<slot name="app-switcher"></slot>
|
|
7
7
|
|
|
8
8
|
<template v-if="!$isMobile.value || quantity === 0">
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
<div class="tw-w-auto">
|
|
10
|
+
<!-- Logo -->
|
|
11
|
+
<img
|
|
12
|
+
class="vc-app-bar__logo"
|
|
13
|
+
:class="{
|
|
14
|
+
'vc-app-bar__logo--mobile': $isMobile.value,
|
|
15
|
+
}"
|
|
16
|
+
alt="logo"
|
|
17
|
+
:src="logo"
|
|
18
|
+
@click="$emit('logo:click')"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
16
21
|
|
|
17
22
|
<!-- Title -->
|
|
18
23
|
<div
|
|
19
|
-
v-if="title"
|
|
24
|
+
v-if="title && $isDesktop.value"
|
|
20
25
|
class="vc-app-bar__title"
|
|
21
26
|
>
|
|
22
27
|
{{ title }}
|
|
@@ -144,6 +149,10 @@ watchDebounced(
|
|
|
144
149
|
|
|
145
150
|
.vc-app-bar__logo {
|
|
146
151
|
@apply tw-h-1/2 tw-cursor-pointer tw-mx-4;
|
|
152
|
+
|
|
153
|
+
&--mobile {
|
|
154
|
+
@apply tw-mx-1;
|
|
155
|
+
}
|
|
147
156
|
}
|
|
148
157
|
|
|
149
158
|
.vc-app-bar__title {
|
|
@@ -56,17 +56,15 @@
|
|
|
56
56
|
<slot name="toolbar:notifications-dropdown">
|
|
57
57
|
<NotificationDropdown />
|
|
58
58
|
</slot>
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</slot>
|
|
69
|
-
</template>
|
|
59
|
+
<slot
|
|
60
|
+
name="toolbar:user-dropdown"
|
|
61
|
+
:user-dropdown="UserDropdownButton"
|
|
62
|
+
>
|
|
63
|
+
<UserDropdownButton
|
|
64
|
+
:avatar-url="avatar"
|
|
65
|
+
:role="role"
|
|
66
|
+
/>
|
|
67
|
+
</slot>
|
|
70
68
|
</slot>
|
|
71
69
|
</template>
|
|
72
70
|
</VcAppBar>
|
|
@@ -80,13 +78,6 @@
|
|
|
80
78
|
:version="version"
|
|
81
79
|
@item:click="onMenuItemClick"
|
|
82
80
|
>
|
|
83
|
-
<template #mobile>
|
|
84
|
-
<UserDropdownButton
|
|
85
|
-
class="vc-app__user-dropdown-button"
|
|
86
|
-
:avatar-url="avatar"
|
|
87
|
-
:role="role"
|
|
88
|
-
/>
|
|
89
|
-
</template>
|
|
90
81
|
</VcAppMenu>
|
|
91
82
|
|
|
92
83
|
<!-- Blade navigation -->
|
|
@@ -275,7 +275,8 @@ const { open } = usePopup({
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
&__error-button {
|
|
278
|
-
@apply tw-shrink-0 tw-opacity-80
|
|
278
|
+
@apply tw-shrink-0 tw-opacity-80 hover:tw-opacity-100 hover:tw-text-[color:var(--blade-text-color)];
|
|
279
|
+
@apply tw-text-[color:var(--blade-text-color)] #{!important};
|
|
279
280
|
}
|
|
280
281
|
|
|
281
282
|
&__unsaved-changes {
|
|
@@ -273,6 +273,7 @@
|
|
|
273
273
|
</div>
|
|
274
274
|
<div
|
|
275
275
|
v-if="items && items.length && !columnsInit"
|
|
276
|
+
ref="tableBody"
|
|
276
277
|
class="vc-table__body"
|
|
277
278
|
>
|
|
278
279
|
<div
|
|
@@ -426,7 +427,13 @@
|
|
|
426
427
|
:pages="pages"
|
|
427
428
|
:current-page="currentPage"
|
|
428
429
|
:variant="paginationVariant"
|
|
429
|
-
@item-click="
|
|
430
|
+
@item-click="
|
|
431
|
+
(event) => {
|
|
432
|
+
//scroll table to top
|
|
433
|
+
tableBody?.scrollTo(0, 0);
|
|
434
|
+
$emit('paginationClick', event);
|
|
435
|
+
}
|
|
436
|
+
"
|
|
430
437
|
></VcPagination>
|
|
431
438
|
|
|
432
439
|
<!-- Table counter -->
|
|
@@ -538,6 +545,7 @@ const props = withDefaults(
|
|
|
538
545
|
paginationVariant?: ComponentProps<typeof VcPagination>["variant"];
|
|
539
546
|
selectionItems?: T[];
|
|
540
547
|
disableFilter?: boolean;
|
|
548
|
+
columnSelector?: "auto" | "defined" | MaybeRef<ITableColumns[]> | (() => ITableColumns[]);
|
|
541
549
|
}>(),
|
|
542
550
|
{
|
|
543
551
|
items: () => [],
|
|
@@ -551,6 +559,7 @@ const props = withDefaults(
|
|
|
551
559
|
resizableColumns: true,
|
|
552
560
|
reorderableColumns: true,
|
|
553
561
|
paginationVariant: "default",
|
|
562
|
+
columnSelector: "auto",
|
|
554
563
|
},
|
|
555
564
|
);
|
|
556
565
|
|
|
@@ -575,6 +584,7 @@ const slots = useSlots();
|
|
|
575
584
|
// template refs
|
|
576
585
|
const reorderRef = ref<HTMLElement | null>();
|
|
577
586
|
const tableRef = ref<HTMLElement | null>();
|
|
587
|
+
const tableBody = ref<HTMLElement | null>();
|
|
578
588
|
|
|
579
589
|
// event listeners
|
|
580
590
|
let columnResizeListener: ((...args: any[]) => any) | null = null;
|
|
@@ -763,32 +773,56 @@ watch(
|
|
|
763
773
|
watch(
|
|
764
774
|
[() => props.items, () => props.columns],
|
|
765
775
|
([newValItems, newValCols]) => {
|
|
766
|
-
let cols: ITableColumns[] = [];
|
|
767
776
|
let predefinedCols: ITableColumns[] = [];
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
777
|
+
let otherCols: ITableColumns[] = [];
|
|
778
|
+
|
|
779
|
+
// Helper function to process columns
|
|
780
|
+
const processColumns = (columns: ITableColumns[], predefined: boolean, defaultVisible: boolean) =>
|
|
781
|
+
columns.map((item) => ({
|
|
782
|
+
...item,
|
|
783
|
+
predefined,
|
|
784
|
+
visible: typeof item.visible !== "undefined" ? item.visible : defaultVisible,
|
|
785
|
+
}));
|
|
786
|
+
|
|
787
|
+
// Process predefined columns
|
|
788
|
+
if (newValCols && newValCols.length) {
|
|
789
|
+
predefinedCols = processColumns(newValCols, true, true);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
if (props.columnSelector === "auto") {
|
|
793
|
+
// Generate columns automatically from items
|
|
794
|
+
if (newValItems && newValItems.length) {
|
|
795
|
+
const itemKeys = Object.keys(newValItems[0]);
|
|
796
|
+
otherCols = itemKeys.map((key) => ({
|
|
771
797
|
id: key,
|
|
772
|
-
// From camelCase to human readable with first letter capitalized
|
|
773
798
|
title: key.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()),
|
|
774
799
|
visible: false,
|
|
775
800
|
predefined: false,
|
|
776
|
-
};
|
|
777
|
-
}
|
|
778
|
-
}
|
|
801
|
+
}));
|
|
802
|
+
}
|
|
779
803
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
predefinedCols
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
804
|
+
// Combine columns and restore state
|
|
805
|
+
allColumns.value = _.unionBy(predefinedCols, otherCols, "id");
|
|
806
|
+
restoreState(predefinedCols);
|
|
807
|
+
} else if (props.columnSelector === "defined") {
|
|
808
|
+
allColumns.value = predefinedCols;
|
|
809
|
+
restoreState(predefinedCols);
|
|
810
|
+
} else {
|
|
811
|
+
// Get columns from columnSelector
|
|
812
|
+
const getDefinedColumns = (): ITableColumns[] => {
|
|
813
|
+
if (typeof props.columnSelector === "function") {
|
|
814
|
+
return props.columnSelector();
|
|
815
|
+
}
|
|
816
|
+
return toValue(props.columnSelector) as ITableColumns[];
|
|
817
|
+
};
|
|
788
818
|
|
|
789
|
-
|
|
819
|
+
const definedCols = processColumns(getDefinedColumns(), false, false);
|
|
820
|
+
|
|
821
|
+
// Combine columns and restore state
|
|
822
|
+
allColumns.value = _.unionBy(predefinedCols, definedCols, "id");
|
|
823
|
+
restoreState(allColumns.value);
|
|
824
|
+
}
|
|
790
825
|
|
|
791
|
-
restoreState(predefinedCols);
|
|
792
826
|
columnsInit.value = false;
|
|
793
827
|
},
|
|
794
828
|
{ deep: true, immediate: true },
|
|
@@ -1211,10 +1245,25 @@ function restoreState(predefinedColumns: TableColPartial[] = []) {
|
|
|
1211
1245
|
}
|
|
1212
1246
|
|
|
1213
1247
|
const predefinedMap = new Map(predefinedColumns.map((col) => [col.id, col]));
|
|
1248
|
+
const mergedColumns: TableColPartial[] = storedState
|
|
1249
|
+
.map((storedCol) => {
|
|
1250
|
+
const predefinedCol = predefinedMap.get(storedCol.id);
|
|
1251
|
+
return mergeColumns(storedCol, predefinedCol);
|
|
1252
|
+
})
|
|
1253
|
+
.filter((col) => col.title);
|
|
1254
|
+
|
|
1255
|
+
// add predefined columns that are not in stored state
|
|
1256
|
+
predefinedColumns.forEach((predefinedCol) => {
|
|
1257
|
+
if (!mergedColumns.find((col) => col.id === predefinedCol.id)) {
|
|
1258
|
+
mergedColumns.push({ ...predefinedCol, visible: true, predefined: true });
|
|
1259
|
+
}
|
|
1260
|
+
});
|
|
1214
1261
|
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1262
|
+
// add other columns to mergedColumns from allColumns array without duplicates
|
|
1263
|
+
allColumns.value.forEach((col) => {
|
|
1264
|
+
if (!mergedColumns.find((c) => c.id === col.id)) {
|
|
1265
|
+
mergedColumns.push(col as TableColPartial);
|
|
1266
|
+
}
|
|
1218
1267
|
});
|
|
1219
1268
|
|
|
1220
1269
|
resetRemovedColumns(storedState, predefinedMap, mergedColumns);
|