@dative-gpi/foundation-core-components 0.0.119 → 0.0.121
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/components/lists/FSDataTable.vue +67 -88
- package/components/tiles/FSDashboardOrganisationTile.vue +3 -2
- package/components/tiles/FSDashboardOrganisationTypeTile.vue +3 -2
- package/components/tiles/FSDashboardShallowTile.vue +4 -3
- package/components/tiles/FSFolderTile.vue +1 -0
- package/package.json +7 -7
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
/>
|
|
5
5
|
<FSDataTableUI
|
|
6
6
|
v-else
|
|
7
|
-
:headers="
|
|
8
|
-
:mode="
|
|
9
|
-
:sortBy="
|
|
10
|
-
:rowsPerPage="
|
|
11
|
-
:filters="
|
|
12
|
-
:page="
|
|
7
|
+
:headers="table.headers"
|
|
8
|
+
:mode="table.mode"
|
|
9
|
+
:sortBy="table.sortBy"
|
|
10
|
+
:rowsPerPage="table.rowsPerPage"
|
|
11
|
+
:filters="table.filters"
|
|
12
|
+
:page="table.page"
|
|
13
13
|
@update:headers="updateHeaders"
|
|
14
14
|
@update:mode="updateMode"
|
|
15
15
|
@update:sortBy="updateSortBy"
|
|
@@ -31,12 +31,11 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script lang="ts">
|
|
34
|
-
import { defineComponent, onUnmounted, ref,
|
|
35
|
-
import { useRouter } from "vue-router";
|
|
34
|
+
import { defineComponent, onUnmounted, ref, watch } from "vue";
|
|
36
35
|
|
|
37
36
|
import { useUserOrganisationTable, useUpdateUserOrganisationTable } from "@dative-gpi/foundation-core-services/composables";
|
|
38
|
-
import { FSDataTableColumn, FSDataTableFilter, FSDataTableOrder } from "@dative-gpi/foundation-shared-components/models";
|
|
39
|
-
import { useDebounce } from "@dative-gpi/foundation-shared-components/composables";
|
|
37
|
+
import { FSDataTable, FSDataTableColumn, FSDataTableFilter, FSDataTableOrder } from "@dative-gpi/foundation-shared-components/models";
|
|
38
|
+
import { useDebounce, useTables } from "@dative-gpi/foundation-shared-components/composables";
|
|
40
39
|
|
|
41
40
|
import FSLoadDataTable from "@dative-gpi/foundation-shared-components/components/lists/FSLoadDataTable.vue";
|
|
42
41
|
import FSDataTableUI from "@dative-gpi/foundation-shared-components/components/lists/FSDataTableUI.vue";
|
|
@@ -61,108 +60,93 @@ export default defineComponent({
|
|
|
61
60
|
setup(props) {
|
|
62
61
|
const { get: getUserOrganisationTable, getting: gettingUserOrganisationTable, entity: userOrganisationTable } = useUserOrganisationTable();
|
|
63
62
|
const { update: updateUserOrganisationTable } = useUpdateUserOrganisationTable();
|
|
63
|
+
const { getTable, setTable } = useTables();
|
|
64
64
|
const { debounce, cancel } = useDebounce();
|
|
65
|
-
const router = useRouter();
|
|
66
65
|
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
const table = ref<FSDataTable | null>({
|
|
67
|
+
headers: [],
|
|
68
|
+
mode: "table",
|
|
69
|
+
sortBy: null,
|
|
70
|
+
rowsPerPage: 10,
|
|
71
|
+
filters: {},
|
|
72
|
+
page: 1
|
|
73
|
+
});
|
|
74
74
|
|
|
75
75
|
const reset = (): void => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
console.log("tableCode found");
|
|
79
|
-
console.log(router.currentRoute.value.meta[props.tableCode]);
|
|
80
|
-
|
|
81
|
-
const meta = router.currentRoute.value.meta[props.tableCode] as any;
|
|
82
|
-
innerHeaders.value = meta.columns;
|
|
83
|
-
innerRowsPerPage.value = meta.rowsPerPage;
|
|
84
|
-
innerSortBy.value = meta.sortBy;
|
|
85
|
-
innerMode.value = meta.mode;
|
|
86
|
-
|
|
87
|
-
innerFilters.value = meta.filters;
|
|
88
|
-
innerPage.value = meta.page;
|
|
76
|
+
if (getTable(props.tableCode)) {
|
|
77
|
+
table.value = getTable(props.tableCode);
|
|
89
78
|
}
|
|
90
79
|
else if (userOrganisationTable.value) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
innerHeaders.value = userOrganisationTable.value.columns;
|
|
95
|
-
innerRowsPerPage.value = userOrganisationTable.value.rowsPerPage;
|
|
96
|
-
if (userOrganisationTable.value.sortByKey && userOrganisationTable.value.sortByOrder) {
|
|
97
|
-
innerSortBy.value = {
|
|
80
|
+
table.value = {
|
|
81
|
+
headers: userOrganisationTable.value.columns,
|
|
82
|
+
sortBy: {
|
|
98
83
|
key: userOrganisationTable.value.sortByKey,
|
|
99
84
|
order: userOrganisationTable.value.sortByOrder
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
85
|
+
},
|
|
86
|
+
mode: userOrganisationTable.value.mode,
|
|
87
|
+
rowsPerPage: userOrganisationTable.value.rowsPerPage,
|
|
88
|
+
filters: {},
|
|
89
|
+
page: 1
|
|
90
|
+
};
|
|
103
91
|
}
|
|
104
92
|
};
|
|
105
93
|
|
|
106
94
|
const updateHeaders = (value: FSDataTableColumn[]): void => {
|
|
107
|
-
|
|
108
|
-
|
|
95
|
+
if (table.value) {
|
|
96
|
+
table.value.headers = value;
|
|
97
|
+
debounce(updateTable, props.debounceTime);
|
|
98
|
+
}
|
|
109
99
|
};
|
|
110
100
|
|
|
111
101
|
const updateMode = (value: "table" | "iterator"): void => {
|
|
112
|
-
|
|
113
|
-
|
|
102
|
+
if (table.value) {
|
|
103
|
+
table.value.mode = value;
|
|
104
|
+
debounce(updateTable, props.debounceTime);
|
|
105
|
+
}
|
|
114
106
|
};
|
|
115
107
|
|
|
116
108
|
const updateSortBy = (value: FSDataTableOrder | null): void => {
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
if (table.value) {
|
|
110
|
+
table.value.sortBy = value;
|
|
111
|
+
debounce(updateTable, props.debounceTime);
|
|
112
|
+
}
|
|
119
113
|
};
|
|
120
114
|
|
|
121
115
|
const updateRowsPerPage = (value: -1 | 10 | 30): void => {
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
if (table.value) {
|
|
117
|
+
table.value.rowsPerPage = value;
|
|
118
|
+
debounce(updateTable, props.debounceTime);
|
|
119
|
+
}
|
|
124
120
|
};
|
|
125
121
|
|
|
126
122
|
const updateFilters = (value: { [key: string]: FSDataTableFilter[] }): void => {
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
if (table.value) {
|
|
124
|
+
table.value.filters = value;
|
|
125
|
+
setTable(props.tableCode, table.value);
|
|
126
|
+
}
|
|
129
127
|
};
|
|
130
128
|
|
|
131
129
|
const updatePage = (value: number): void => {
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
if (table.value) {
|
|
131
|
+
table.value.page = value;
|
|
132
|
+
setTable(props.tableCode, table.value);
|
|
133
|
+
}
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
const updateTable = (): void => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const updateRouter = (): void => {
|
|
152
|
-
console.log("updateRouter");
|
|
153
|
-
if (router) {
|
|
154
|
-
router.currentRoute.value.meta = {
|
|
155
|
-
...router.currentRoute.value.meta,
|
|
156
|
-
[props.tableCode]: {
|
|
157
|
-
columns: innerHeaders.value,
|
|
158
|
-
filters: innerFilters.value,
|
|
159
|
-
rowsPerPage: innerRowsPerPage.value,
|
|
160
|
-
sortBy: innerSortBy.value,
|
|
161
|
-
mode: innerMode.value,
|
|
162
|
-
page: innerPage.value
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
console.log(router.currentRoute.value.meta[props.tableCode]);
|
|
137
|
+
if (table.value) {
|
|
138
|
+
setTable(props.tableCode, table.value);
|
|
139
|
+
updateUserOrganisationTable(props.tableCode, {
|
|
140
|
+
columns: table.value.headers.map(column => ({
|
|
141
|
+
columnId: column.columnId,
|
|
142
|
+
hidden: column.hidden,
|
|
143
|
+
index: column.index
|
|
144
|
+
})),
|
|
145
|
+
rowsPerPage: table.value.rowsPerPage,
|
|
146
|
+
sortByKey: table.value.sortBy?.key ?? null,
|
|
147
|
+
sortByOrder: table.value.sortBy?.order ?? null,
|
|
148
|
+
mode: table.value.mode
|
|
149
|
+
});
|
|
166
150
|
}
|
|
167
151
|
};
|
|
168
152
|
|
|
@@ -183,12 +167,7 @@ export default defineComponent({
|
|
|
183
167
|
|
|
184
168
|
return {
|
|
185
169
|
gettingUserOrganisationTable,
|
|
186
|
-
|
|
187
|
-
innerFilters,
|
|
188
|
-
innerHeaders,
|
|
189
|
-
innerSortBy,
|
|
190
|
-
innerMode,
|
|
191
|
-
innerPage,
|
|
170
|
+
table,
|
|
192
171
|
updateRowsPerPage,
|
|
193
172
|
updateFilters,
|
|
194
173
|
updateHeaders,
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
/>
|
|
8
8
|
<FSDashboardOrganisationTileUI
|
|
9
9
|
v-else-if="entity"
|
|
10
|
-
:label="entity.label"
|
|
11
10
|
:code="entity.code"
|
|
12
|
-
:bottomColor="entity.colors"
|
|
13
11
|
:icon="entity.icon"
|
|
12
|
+
:label="entity.label"
|
|
13
|
+
:imageId="entity.imageId"
|
|
14
14
|
:editable="$props.editable"
|
|
15
|
+
:bottomColor="entity.colors"
|
|
15
16
|
:modelValue="$props.modelValue"
|
|
16
17
|
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
17
18
|
v-bind="$attrs"
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
/>
|
|
8
8
|
<FSDashboardOrganisationTypeTileUI
|
|
9
9
|
v-else-if="entity"
|
|
10
|
-
:label="entity.label"
|
|
11
10
|
:code="entity.code"
|
|
12
|
-
:bottomColor="entity.colors"
|
|
13
11
|
:icon="entity.icon"
|
|
12
|
+
:label="entity.label"
|
|
13
|
+
:imageId="entity.imageId"
|
|
14
14
|
:editable="$props.editable"
|
|
15
|
+
:bottomColor="entity.colors"
|
|
15
16
|
:modelValue="$props.modelValue"
|
|
16
17
|
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
17
18
|
v-bind="$attrs"
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
/>
|
|
8
8
|
<FSDashboardShallowTileUI
|
|
9
9
|
v-else-if="entity"
|
|
10
|
-
:label="entity.label"
|
|
11
|
-
:code="entity.code"
|
|
12
|
-
:bottomColor="entity.colors"
|
|
13
10
|
:icon="entity.icon"
|
|
11
|
+
:code="entity.code"
|
|
12
|
+
:label="entity.label"
|
|
13
|
+
:imageId="entity.imageId"
|
|
14
14
|
:editable="$props.editable"
|
|
15
|
+
:bottomColor="entity.colors"
|
|
15
16
|
:modelValue="$props.modelValue"
|
|
16
17
|
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
17
18
|
v-bind="$attrs"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.121",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-core-domain": "0.0.
|
|
14
|
-
"@dative-gpi/foundation-core-services": "0.0.
|
|
15
|
-
"@dative-gpi/foundation-shared-components": "0.0.
|
|
16
|
-
"@dative-gpi/foundation-shared-domain": "0.0.
|
|
17
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-core-domain": "0.0.121",
|
|
14
|
+
"@dative-gpi/foundation-core-services": "0.0.121",
|
|
15
|
+
"@dative-gpi/foundation-shared-components": "0.0.121",
|
|
16
|
+
"@dative-gpi/foundation-shared-domain": "0.0.121",
|
|
17
|
+
"@dative-gpi/foundation-shared-services": "0.0.121",
|
|
18
18
|
"color": "^4.2.3",
|
|
19
19
|
"vue": "^3.4.23",
|
|
20
20
|
"vuedraggable": "^4.1.0"
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"sass": "^1.69.5",
|
|
25
25
|
"sass-loader": "^13.3.2"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "305cafbeb6046ce65f2b4917b319f4d36ebbcf00"
|
|
28
28
|
}
|