@dative-gpi/foundation-core-components 0.0.9 → 0.0.10
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.
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSDataTableUI
|
|
3
|
+
v-if="!getting"
|
|
4
|
+
:filters="getFilters()"
|
|
5
|
+
@update:filters="updateFilters"
|
|
6
|
+
v-model:rowsPerPage="innerRowsPerPage"
|
|
7
|
+
v-model:headers="innerHeaders"
|
|
8
|
+
v-model:sortBy="innerSortBy"
|
|
9
|
+
v-model:page="innerPage"
|
|
10
|
+
v-model:mode="innerMode"
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
import { defineComponent, onMounted, onUnmounted, PropType, ref, Ref, watch } from "vue";
|
|
17
|
+
|
|
18
|
+
import { ColumnInfos, TableFilter, TableOrder } from "@dative-gpi/foundation-core-domain/models";
|
|
19
|
+
import { useTable, useUpdateTable } from "@dative-gpi/foundation-core-services/composables";
|
|
20
|
+
import { FSDataTableFilter } from "@dative-gpi/foundation-shared-components/models";
|
|
21
|
+
|
|
22
|
+
import FSDataTableUI from "@dative-gpi/foundation-shared-components/components/lists/FSDataTableUI.vue";
|
|
23
|
+
|
|
24
|
+
export default defineComponent({
|
|
25
|
+
name: "FSDataTable",
|
|
26
|
+
components: {
|
|
27
|
+
FSDataTableUI
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
tableCode: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true
|
|
33
|
+
},
|
|
34
|
+
mode: {
|
|
35
|
+
type: String as PropType<"table" | "iterator">,
|
|
36
|
+
required: false,
|
|
37
|
+
default: "table"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
setup(props) {
|
|
41
|
+
const { update: updateTable } = useUpdateTable();
|
|
42
|
+
const { get: getTable, getting, entity } = useTable();
|
|
43
|
+
|
|
44
|
+
const innerHeaders: Ref<ColumnInfos[]> = ref([]);
|
|
45
|
+
const innerFilters = ref<TableFilter[]>([]);
|
|
46
|
+
const innerRowsPerPage = ref(10);
|
|
47
|
+
const innerSortBy: Ref<TableOrder | null> = ref(null);
|
|
48
|
+
const innerMode = ref(props.mode);
|
|
49
|
+
const innerPage = ref(1);
|
|
50
|
+
|
|
51
|
+
const getFilters = (): { [key: string]: FSDataTableFilter[] } => {
|
|
52
|
+
return innerFilters.value.reduce((acc, filter) => {
|
|
53
|
+
if (!acc[filter.key]) {
|
|
54
|
+
acc[filter.key] = [];
|
|
55
|
+
}
|
|
56
|
+
acc[filter.key].push({ value: filter.value, hidden: filter.hidden });
|
|
57
|
+
return acc;
|
|
58
|
+
}, {});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const updateFilters = (value: { [key: string]: FSDataTableFilter[] }): void => {
|
|
62
|
+
innerFilters.value = Object.entries(value).map(([key, filters]) => filters.map((filter) => ({
|
|
63
|
+
key: key,
|
|
64
|
+
value: filter.value,
|
|
65
|
+
hidden: filter.hidden
|
|
66
|
+
}))).reduce((acc, filters) => acc.concat(filters), []);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const reset = (): void => {
|
|
70
|
+
innerHeaders.value = entity.value.columns;
|
|
71
|
+
innerRowsPerPage.value = entity.value.rowsPerPage;
|
|
72
|
+
innerSortBy.value = entity.value.sortBy;
|
|
73
|
+
innerMode.value = entity.value.mode;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
onMounted(() => {
|
|
77
|
+
getTable(props.tableCode);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
onUnmounted(() => {
|
|
81
|
+
// update();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
watch(() => props.tableCode, () => {
|
|
85
|
+
getTable(props.tableCode);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
watch(entity, () => {
|
|
89
|
+
reset();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
watch([innerHeaders, innerFilters, innerRowsPerPage, innerSortBy, innerMode, ], () => {
|
|
93
|
+
// update();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
getting,
|
|
98
|
+
innerHeaders,
|
|
99
|
+
innerRowsPerPage,
|
|
100
|
+
innerPage,
|
|
101
|
+
innerSortBy,
|
|
102
|
+
innerMode,
|
|
103
|
+
getFilters,
|
|
104
|
+
updateFilters
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
</script>
|
|
@@ -24,48 +24,48 @@
|
|
|
24
24
|
<script lang="ts">
|
|
25
25
|
import { defineComponent, onMounted, watch } from "vue";
|
|
26
26
|
|
|
27
|
+
import { useDeviceOrganisation } from "@dative-gpi/foundation-core-services/composables";
|
|
28
|
+
|
|
27
29
|
import FSDeviceOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDeviceOrganisationTileUI.vue";
|
|
28
30
|
import FSLoadTile from "@dative-gpi/foundation-shared-components/components/FSLoadTile.vue";
|
|
29
31
|
|
|
30
|
-
import { useDeviceOrganisation } from "@dative-gpi/foundation-core-services/composables";
|
|
31
|
-
|
|
32
32
|
export default defineComponent({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
name: "FSDeviceOrganisationTile",
|
|
34
|
+
components: {
|
|
35
|
+
FSDeviceOrganisationTileUI,
|
|
36
|
+
FSLoadTile
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
deviceOrganisationId: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: true
|
|
37
42
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
modelValue: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
required: false,
|
|
46
|
-
default: false
|
|
47
|
-
},
|
|
48
|
-
editable: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
required: false,
|
|
51
|
-
default: true
|
|
52
|
-
}
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
required: false,
|
|
46
|
+
default: false
|
|
53
47
|
},
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
editable: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
required: false,
|
|
51
|
+
default: true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
setup(props) {
|
|
55
|
+
const { get, getting, entity } = useDeviceOrganisation();
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
onMounted(() => {
|
|
58
|
+
get(props.deviceOrganisationId);
|
|
59
|
+
});
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
watch(() => props.deviceOrganisationId, () => {
|
|
62
|
+
get(props.deviceOrganisationId);
|
|
63
|
+
});
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
return {
|
|
66
|
+
getting,
|
|
67
|
+
entity
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
70
|
});
|
|
71
71
|
</script>
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
<script lang="ts">
|
|
22
22
|
import { defineComponent, onMounted, watch } from "vue";
|
|
23
23
|
|
|
24
|
+
import { useGroup } from "@dative-gpi/foundation-core-services/composables";
|
|
25
|
+
|
|
24
26
|
import FSGroupTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSGroupTileUI.vue";
|
|
25
27
|
import FSLoadTile from "@dative-gpi/foundation-shared-components/components/FSLoadTile.vue";
|
|
26
28
|
|
|
27
|
-
import { useGroup } from "@dative-gpi/foundation-core-services/composables";
|
|
28
|
-
|
|
29
29
|
export default defineComponent({
|
|
30
30
|
name: "FSGroupTile",
|
|
31
31
|
components: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"author": "",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@dative-gpi/foundation-core-domain": "0.0.
|
|
13
|
-
"@dative-gpi/foundation-core-services": "0.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-components": "0.0.
|
|
15
|
-
"@dative-gpi/foundation-shared-domain": "0.0.
|
|
16
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
12
|
+
"@dative-gpi/foundation-core-domain": "0.0.10",
|
|
13
|
+
"@dative-gpi/foundation-core-services": "0.0.10",
|
|
14
|
+
"@dative-gpi/foundation-shared-components": "0.0.10",
|
|
15
|
+
"@dative-gpi/foundation-shared-domain": "0.0.10",
|
|
16
|
+
"@dative-gpi/foundation-shared-services": "0.0.10",
|
|
17
17
|
"color": "^4.2.3",
|
|
18
18
|
"vue": "^3.2.0",
|
|
19
19
|
"vuedraggable": "^4.1.0"
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"sass": "^1.69.5",
|
|
24
24
|
"sass-loader": "^13.3.2"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "765222a4eb6a5cdd690f64bc0ae3c5415081e0f0"
|
|
27
27
|
}
|