@dative-gpi/foundation-core-components 1.0.137 → 1.0.139-auth-token
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/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +17 -3
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +29 -15
- package/components/lists/charts/FSBaseChartsList.vue +24 -6
- package/components/lists/dashboards/FSSimpleDashboardsList.vue +3 -4
- package/components/lists/userOrganisations/FSChipUserOrganisationsList.vue +61 -0
- package/package.json +7 -7
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
:headersOptions="headersOptions"
|
|
8
8
|
:tableCode="$props.tableCode"
|
|
9
9
|
:modelValue="$props.modelValue"
|
|
10
|
+
:showSelect="$props.editable"
|
|
11
|
+
:singleSelect="$props.singleSelect"
|
|
10
12
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
11
13
|
v-bind="$attrs"
|
|
12
14
|
>
|
|
@@ -76,16 +78,18 @@
|
|
|
76
78
|
/>
|
|
77
79
|
</template>
|
|
78
80
|
<template
|
|
79
|
-
#item.tile="{item}"
|
|
81
|
+
#item.tile="{ item, toggleSelect}"
|
|
80
82
|
>
|
|
81
83
|
<FSChartTileUI
|
|
82
|
-
variant="standard"
|
|
83
84
|
:label="item.label"
|
|
84
85
|
:category-label="item.chartCategoryLabel"
|
|
86
|
+
:singleSelect="$props.singleSelect"
|
|
87
|
+
:editable="$props.editable"
|
|
85
88
|
:icon="item.icon"
|
|
86
89
|
:imageId="item.imageId"
|
|
87
90
|
:type="item.chartType"
|
|
88
|
-
:
|
|
91
|
+
:modelValue="isSelected(item.id)"
|
|
92
|
+
@update:modelValue="toggleSelect(item)"
|
|
89
93
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
90
94
|
/>
|
|
91
95
|
</template>
|
|
@@ -144,6 +148,16 @@ export default defineComponent({
|
|
|
144
148
|
type: Array as PropType<string[]>,
|
|
145
149
|
default: () => [],
|
|
146
150
|
required: false
|
|
151
|
+
},
|
|
152
|
+
editable: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
required: false,
|
|
155
|
+
default: true
|
|
156
|
+
},
|
|
157
|
+
singleSelect: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
required: false,
|
|
160
|
+
default: false
|
|
147
161
|
}
|
|
148
162
|
},
|
|
149
163
|
emits: ["update:modelValue"],
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
:headersOptions="headersOptions"
|
|
8
8
|
:tableCode="$props.tableCode"
|
|
9
9
|
:modelValue="$props.modelValue"
|
|
10
|
+
:singleSelect="$props.singleSelect"
|
|
11
|
+
:showSelect="$props.editable"
|
|
10
12
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
11
13
|
v-bind="$attrs"
|
|
12
14
|
>
|
|
@@ -61,20 +63,6 @@
|
|
|
61
63
|
:tags="item.modelsLabels.map((d: any) => d.label)"
|
|
62
64
|
/>
|
|
63
65
|
</template>
|
|
64
|
-
<template
|
|
65
|
-
#item.tile="{ item }"
|
|
66
|
-
>
|
|
67
|
-
<FSChartTileUI
|
|
68
|
-
variant="standard"
|
|
69
|
-
:label="item.label"
|
|
70
|
-
:categoryLabel="item.chartCategoryLabel"
|
|
71
|
-
:icon="item.icon"
|
|
72
|
-
:imageId="item.imageId"
|
|
73
|
-
:type="item.chartType"
|
|
74
|
-
:color="ColorEnum.Light"
|
|
75
|
-
:to="$props.itemTo && $props.itemTo(item)"
|
|
76
|
-
/>
|
|
77
|
-
</template>
|
|
78
66
|
<template
|
|
79
67
|
#item.chartType="{ item }"
|
|
80
68
|
>
|
|
@@ -89,6 +77,22 @@
|
|
|
89
77
|
</FSText>
|
|
90
78
|
</FSRow>
|
|
91
79
|
</template>
|
|
80
|
+
<template
|
|
81
|
+
#item.tile="{ item, toggleSelect }"
|
|
82
|
+
>
|
|
83
|
+
<FSChartTileUI
|
|
84
|
+
:label="item.label"
|
|
85
|
+
:singleSelect="$props.singleSelect"
|
|
86
|
+
:editable="$props.editable"
|
|
87
|
+
:categoryLabel="item.chartCategoryLabel"
|
|
88
|
+
:icon="item.icon"
|
|
89
|
+
:imageId="item.imageId"
|
|
90
|
+
:type="item.chartType"
|
|
91
|
+
:modelValue="isSelected(item.id)"
|
|
92
|
+
@update:modelValue="toggleSelect(item)"
|
|
93
|
+
:to="$props.itemTo && $props.itemTo(item)"
|
|
94
|
+
/>
|
|
95
|
+
</template>
|
|
92
96
|
</FSDataTable>
|
|
93
97
|
</template>
|
|
94
98
|
|
|
@@ -144,7 +148,17 @@ export default defineComponent({
|
|
|
144
148
|
type: Array as PropType<string[]>,
|
|
145
149
|
default: () => [],
|
|
146
150
|
required: false
|
|
147
|
-
}
|
|
151
|
+
},
|
|
152
|
+
editable: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
required: false,
|
|
155
|
+
default: true
|
|
156
|
+
},
|
|
157
|
+
singleSelect: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
required: false,
|
|
160
|
+
default: false
|
|
161
|
+
},
|
|
148
162
|
},
|
|
149
163
|
emits: ["update:modelValue"],
|
|
150
164
|
setup(props) {
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
:loading="fetchingChartOrganisationTypes || fetchingChartOrganisations"
|
|
5
5
|
:headersOptions="headersOptions"
|
|
6
6
|
:items="charts"
|
|
7
|
+
:showSelect="$props.editable"
|
|
8
|
+
:singleSelect="$props.singleSelect"
|
|
7
9
|
:tableCode="$props.tableCode"
|
|
8
10
|
:modelValue="$props.modelValue"
|
|
9
11
|
@update:modelValue="onSelect"
|
|
@@ -75,16 +77,19 @@
|
|
|
75
77
|
/>
|
|
76
78
|
</template>
|
|
77
79
|
<template
|
|
78
|
-
#item.tile="{ item }"
|
|
80
|
+
#item.tile="{ item, toggleSelect }"
|
|
79
81
|
>
|
|
80
82
|
<FSChartTileUI
|
|
81
|
-
variant="standard"
|
|
82
83
|
:label="item.label"
|
|
83
84
|
:categoryLabel="item.chartCategoryLabel"
|
|
84
85
|
:icon="item.icon"
|
|
85
86
|
:imageId="item.imageId"
|
|
86
87
|
:type="item.chartType"
|
|
87
|
-
:
|
|
88
|
+
:singleSelect="$props.singleSelect"
|
|
89
|
+
:editable="$props.editable"
|
|
90
|
+
:activeColor="ColorEnum.Primary"
|
|
91
|
+
:modelValue="isSelected(item.id)"
|
|
92
|
+
@update:modelValue="toggleSelect(item)"
|
|
88
93
|
@click="update(item.id)"
|
|
89
94
|
/>
|
|
90
95
|
</template>
|
|
@@ -141,6 +146,16 @@ export default defineComponent({
|
|
|
141
146
|
type: Array as PropType<string[]>,
|
|
142
147
|
default: () => [],
|
|
143
148
|
required: false
|
|
149
|
+
},
|
|
150
|
+
editable: {
|
|
151
|
+
type: Boolean,
|
|
152
|
+
required: false,
|
|
153
|
+
default: true
|
|
154
|
+
},
|
|
155
|
+
singleSelect: {
|
|
156
|
+
type: Boolean,
|
|
157
|
+
required: false,
|
|
158
|
+
default: false
|
|
144
159
|
}
|
|
145
160
|
},
|
|
146
161
|
emits: ["update", "update:modelValue", "update:scope"],
|
|
@@ -219,11 +234,14 @@ export default defineComponent({
|
|
|
219
234
|
}));
|
|
220
235
|
|
|
221
236
|
const update = (value : string) => {
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
237
|
+
const isAlreadySelected = isSelected(value);
|
|
238
|
+
if (isAlreadySelected) {
|
|
224
239
|
onSelect(props.modelValue.filter(m => m != value));
|
|
225
240
|
}
|
|
226
|
-
else {
|
|
241
|
+
else if(props.singleSelect){
|
|
242
|
+
onSelect([value]);
|
|
243
|
+
}
|
|
244
|
+
else{
|
|
227
245
|
onSelect([...props.modelValue, value]);
|
|
228
246
|
}
|
|
229
247
|
}
|
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
<script lang="ts">
|
|
10
10
|
import { defineComponent, type PropType, watch, computed } from "vue";
|
|
11
11
|
|
|
12
|
-
import type { DashboardOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
13
|
-
import { useDashboardOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
14
|
-
import { useDashboardOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
|
|
12
|
+
import type { DashboardOrganisationFilters, DashboardOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
13
|
+
import { useDashboardOrganisations, useDashboardOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
|
|
15
14
|
|
|
16
15
|
import FSSimpleList from "@dative-gpi/foundation-shared-components/components/lists/FSSimpleList.vue";
|
|
17
16
|
|
|
@@ -27,7 +26,7 @@ export default defineComponent({
|
|
|
27
26
|
default: () => ({})
|
|
28
27
|
},
|
|
29
28
|
dashboardOrganisationTypeFilters: {
|
|
30
|
-
type: Object as PropType<
|
|
29
|
+
type: Object as PropType<DashboardOrganisationTypeFilters>,
|
|
31
30
|
required: false,
|
|
32
31
|
default: () => ({})
|
|
33
32
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
v-if="fetching"
|
|
4
|
+
>
|
|
5
|
+
<FSLoader
|
|
6
|
+
v-for="i in 4"
|
|
7
|
+
:key="i"
|
|
8
|
+
variant="chip"
|
|
9
|
+
height="12px"
|
|
10
|
+
/>
|
|
11
|
+
</FSRow>
|
|
12
|
+
<FSChipGroup
|
|
13
|
+
v-else
|
|
14
|
+
:color="ColorEnum.Light"
|
|
15
|
+
:labels="userOrganisations?.map(u => u.name)"
|
|
16
|
+
v-bind="$attrs"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { defineComponent, watch, type PropType } from "vue";
|
|
22
|
+
|
|
23
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
24
|
+
import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
25
|
+
|
|
26
|
+
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
27
|
+
import FSLoader from "@dative-gpi/foundation-shared-components/components/FSLoader.vue";
|
|
28
|
+
import FSChipGroup from "@dative-gpi/foundation-shared-components/components/FSChipGroup.vue";
|
|
29
|
+
|
|
30
|
+
export default defineComponent({
|
|
31
|
+
name: "FSChipUserOrganisationsList",
|
|
32
|
+
components: {
|
|
33
|
+
FSChipGroup,
|
|
34
|
+
FSLoader,
|
|
35
|
+
FSRow
|
|
36
|
+
},
|
|
37
|
+
props: {
|
|
38
|
+
userOrganisationIds: {
|
|
39
|
+
type: Array as PropType<string[]>,
|
|
40
|
+
required: false
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
setup(props) {
|
|
44
|
+
const {getMany: fetchUserOrganisations, fetching, entities: userOrganisations} = useUserOrganisations();
|
|
45
|
+
|
|
46
|
+
watch(() => props.userOrganisationIds, async () => {
|
|
47
|
+
if(props.userOrganisationIds && props.userOrganisationIds.length > 0){
|
|
48
|
+
fetchUserOrganisations({
|
|
49
|
+
userOrganisationsIds: props.userOrganisationIds
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, {immediate: true});
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
userOrganisations,
|
|
56
|
+
ColorEnum,
|
|
57
|
+
fetching
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
</script>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.139-auth-token",
|
|
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": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-core-services": "1.0.
|
|
15
|
-
"@dative-gpi/foundation-shared-components": "1.0.
|
|
16
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
17
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-core-domain": "1.0.139-auth-token",
|
|
14
|
+
"@dative-gpi/foundation-core-services": "1.0.139-auth-token",
|
|
15
|
+
"@dative-gpi/foundation-shared-components": "1.0.139-auth-token",
|
|
16
|
+
"@dative-gpi/foundation-shared-domain": "1.0.139-auth-token",
|
|
17
|
+
"@dative-gpi/foundation-shared-services": "1.0.139-auth-token"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@dative-gpi/bones-ui": "^1.0.0",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"sass": "1.71.1",
|
|
27
27
|
"sass-loader": "13.3.2"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "af9d894b3fa209b796f8466b8545bb1ecc46a399"
|
|
30
30
|
}
|