@dative-gpi/foundation-core-components 1.1.24-unit-formatter → 1.1.24-unit-formatter-2
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/autocompletes/FSAutocompleteDataCategory.vue +11 -2
- package/components/entities/FSBaseEntitiesList.vue +4 -0
- package/components/entities/FSEntityField.vue +11 -5
- package/components/entities/FSSelectEntitiesList.vue +35 -8
- package/components/entities/FSSimpleEntitiesList.vue +15 -2
- package/components/entities/FSTileEntitiesList.vue +1 -3
- package/components/explorers/FSBaseDashboardsExplorer.vue +312 -0
- package/components/explorers/FSDashboardExplorerElementTypeChip.vue +37 -0
- package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +7 -6
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +7 -6
- package/components/lists/charts/FSBaseChartsList.vue +7 -14
- package/components/lists/dashboards/FSBaseDashboardsList.vue +40 -224
- package/components/lists/dashboards/FSSimpleDashboardsList.vue +27 -53
- package/components/lists/dashboards/FSTileDashboardsList.vue +30 -62
- package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +10 -8
- package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +10 -7
- package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +66 -1
- package/components/lists/folders/FSBaseFoldersList.vue +1 -5
- package/components/lists/groupings/FSBaseGroupingsList.vue +5 -17
- package/components/lists/groupings/FSSimpleGroupingsList.vue +44 -0
- package/components/lists/groupings/FSTileGroupingsList.vue +79 -0
- package/components/lists/groups/FSSimpleGroupsList.vue +1 -0
- package/components/lists/locations/FSBaseLocationsList.vue +3 -3
- package/components/lists/playlists/FSTilePlaylistsList.vue +93 -0
- package/components/lists/subgroupings/FSBaseSubgroupingsList.vue +197 -0
- package/components/lists/subgroupings/FSSimpleSubgroupingsList.vue +45 -0
- package/components/lists/subgroupings/FSSubgroupingsChipGroup.vue +61 -0
- package/components/lists/subgroupings/FSTileSubgroupingsList.vue +81 -0
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +21 -1
- package/components/lists/userOrganisations/{FSChipUserOrganisationsList.vue → FSUserOrganisationsChipGroup.vue} +2 -2
- package/components/tiles/FSGroupingTile.vue +67 -0
- package/components/tiles/FSLocationTile.vue +2 -1
- package/components/tiles/FSPlaylistTile.vue +78 -0
- package/components/tiles/FSSubgroupingTile.vue +69 -0
- package/package.json +8 -8
- package/utils/dashboards.ts +12 -30
- package/utils/tables.ts +13 -7
- package/utils/users.ts +1 -1
- package/components/explorers/FSBaseFoldersExplorer.vue +0 -337
|
@@ -41,17 +41,18 @@
|
|
|
41
41
|
<template
|
|
42
42
|
#item.tile="{ index, item }"
|
|
43
43
|
>
|
|
44
|
-
<
|
|
44
|
+
<FSCard
|
|
45
45
|
:key="index"
|
|
46
46
|
padding="12px"
|
|
47
47
|
height="60px"
|
|
48
48
|
width="233px"
|
|
49
|
-
:
|
|
49
|
+
:variant="isSelected(item.id) ? CardVariants.Standard : CardVariants.Background"
|
|
50
|
+
:color="ColorEnum.Primary"
|
|
50
51
|
@click="$emit('update:modelValue', [item.id])"
|
|
51
52
|
v-bind="$attrs"
|
|
52
53
|
>
|
|
53
54
|
<template
|
|
54
|
-
#default
|
|
55
|
+
#default="{ contentVariant }"
|
|
55
56
|
>
|
|
56
57
|
<FSRow
|
|
57
58
|
align="center-center"
|
|
@@ -66,11 +67,11 @@
|
|
|
66
67
|
<FSIcon
|
|
67
68
|
:color="item.correlated ? ColorEnum.Primary : ColorEnum.Light"
|
|
68
69
|
:icon="item.correlated ? 'mdi-link' : 'mdi-link-off'"
|
|
69
|
-
variant="
|
|
70
|
+
:variant="contentVariant"
|
|
70
71
|
/>
|
|
71
72
|
</FSRow>
|
|
72
73
|
</template>
|
|
73
|
-
</
|
|
74
|
+
</FSCard>
|
|
74
75
|
</template>
|
|
75
76
|
</FSDataTable>
|
|
76
77
|
</FSFadeOut>
|
|
@@ -81,7 +82,7 @@
|
|
|
81
82
|
import { defineComponent, type PropType, ref, watch } from "vue";
|
|
82
83
|
import _ from "lodash";
|
|
83
84
|
|
|
84
|
-
import {ColorEnum} from "@dative-gpi/foundation-shared-components/models";
|
|
85
|
+
import {CardVariants, ColorEnum} from "@dative-gpi/foundation-shared-components/models";
|
|
85
86
|
|
|
86
87
|
import { useDataCategories } from "@dative-gpi/foundation-core-services/composables";
|
|
87
88
|
import type { DataCategoryFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
@@ -89,10 +90,10 @@ import type { DataCategoryFilters } from "@dative-gpi/foundation-core-domain/mod
|
|
|
89
90
|
import FSDataTable from "../FSDataTable.vue";
|
|
90
91
|
import FSCol from "@dative-gpi/foundation-shared-components/components/FSCol.vue";
|
|
91
92
|
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
93
|
+
import FSCard from "@dative-gpi/foundation-shared-components/components/FSCard.vue";
|
|
92
94
|
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
93
95
|
import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
|
|
94
96
|
import FSFadeOut from "@dative-gpi/foundation-shared-components/components/FSFadeOut.vue";
|
|
95
|
-
import FSClickable from "@dative-gpi/foundation-shared-components/components/FSClickable.vue";
|
|
96
97
|
import FSSearchField from "@dative-gpi/foundation-shared-components/components/fields/FSSearchField.vue";
|
|
97
98
|
import FSButtonCheckbox from "@dative-gpi/foundation-shared-components/components/buttons/FSButtonCheckbox.vue";
|
|
98
99
|
|
|
@@ -102,7 +103,7 @@ export default defineComponent({
|
|
|
102
103
|
FSDataTable,
|
|
103
104
|
FSCol,
|
|
104
105
|
FSFadeOut,
|
|
105
|
-
|
|
106
|
+
FSCard,
|
|
106
107
|
FSRow,
|
|
107
108
|
FSSpan,
|
|
108
109
|
FSSearchField,
|
|
@@ -146,6 +147,7 @@ export default defineComponent({
|
|
|
146
147
|
return {
|
|
147
148
|
fetchingDataCategories,
|
|
148
149
|
dataCategories,
|
|
150
|
+
CardVariants,
|
|
149
151
|
ColorEnum,
|
|
150
152
|
search,
|
|
151
153
|
correlated,
|
|
@@ -28,17 +28,18 @@
|
|
|
28
28
|
<template
|
|
29
29
|
#item.tile="{ index, item }"
|
|
30
30
|
>
|
|
31
|
-
<
|
|
31
|
+
<FSCard
|
|
32
32
|
:key="index"
|
|
33
33
|
padding="12px"
|
|
34
34
|
height="60px"
|
|
35
35
|
width="233px"
|
|
36
|
-
:color="
|
|
36
|
+
:color="ColorEnum.Primary"
|
|
37
|
+
:variant="isSelected(item.id) ? CardVariants.Standard : CardVariants.Background"
|
|
37
38
|
@click="$emit('update:modelValue', [item.id])"
|
|
38
39
|
v-bind="$attrs"
|
|
39
40
|
>
|
|
40
41
|
<template
|
|
41
|
-
#default
|
|
42
|
+
#default="{ contentVariant }"
|
|
42
43
|
>
|
|
43
44
|
<FSRow
|
|
44
45
|
align="center-center"
|
|
@@ -54,11 +55,12 @@
|
|
|
54
55
|
<v-spacer/>
|
|
55
56
|
<FSIcon
|
|
56
57
|
:color="ColorEnum.Primary"
|
|
58
|
+
:variant="contentVariant"
|
|
57
59
|
icon="mdi-link"
|
|
58
60
|
/>
|
|
59
61
|
</FSRow>
|
|
60
62
|
</template>
|
|
61
|
-
</
|
|
63
|
+
</FSCard>
|
|
62
64
|
</template>
|
|
63
65
|
</FSDataTable>
|
|
64
66
|
</template>
|
|
@@ -67,7 +69,7 @@
|
|
|
67
69
|
import { defineComponent, type PropType, watch } from "vue";
|
|
68
70
|
import _ from "lodash";
|
|
69
71
|
|
|
70
|
-
import {ColorEnum} from "@dative-gpi/foundation-shared-components/models";
|
|
72
|
+
import { CardVariants, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
71
73
|
|
|
72
74
|
import { useDataDefinitions } from "@dative-gpi/foundation-core-services/composables";
|
|
73
75
|
import type { DataDefinitionFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
@@ -76,7 +78,7 @@ import FSDataTable from "../FSDataTable.vue";
|
|
|
76
78
|
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
77
79
|
import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
|
|
78
80
|
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
79
|
-
import
|
|
81
|
+
import FSCard from "@dative-gpi/foundation-shared-components/components/FSCard.vue";
|
|
80
82
|
import FSButtonCheckbox from "@dative-gpi/foundation-shared-components/components/buttons/FSButtonCheckbox.vue";
|
|
81
83
|
|
|
82
84
|
export default defineComponent({
|
|
@@ -84,7 +86,7 @@ export default defineComponent({
|
|
|
84
86
|
components: {
|
|
85
87
|
FSButtonCheckbox,
|
|
86
88
|
FSDataTable,
|
|
87
|
-
|
|
89
|
+
FSCard,
|
|
88
90
|
FSSpan,
|
|
89
91
|
FSIcon,
|
|
90
92
|
FSRow,
|
|
@@ -123,6 +125,7 @@ export default defineComponent({
|
|
|
123
125
|
return {
|
|
124
126
|
fetchingDataDefinitions,
|
|
125
127
|
dataDefinitions,
|
|
128
|
+
CardVariants,
|
|
126
129
|
ColorEnum,
|
|
127
130
|
isSelected
|
|
128
131
|
};
|
|
@@ -115,6 +115,29 @@
|
|
|
115
115
|
{{ item.ownerAddress ? item.ownerAddress.formattedAddress : '' }}
|
|
116
116
|
</FSSpan>
|
|
117
117
|
</template>
|
|
118
|
+
<template
|
|
119
|
+
#item.subgroupings="{ item }"
|
|
120
|
+
>
|
|
121
|
+
<FSSubgroupingsChipGroup
|
|
122
|
+
:subgroupings="item.subgroupings"
|
|
123
|
+
/>
|
|
124
|
+
</template>
|
|
125
|
+
<template
|
|
126
|
+
#filter.subgroupings-custom="{ filter, toggle, variant }"
|
|
127
|
+
>
|
|
128
|
+
<FSSubgroupingChip
|
|
129
|
+
v-if="filter.value && subgroupingMap[filter.value]"
|
|
130
|
+
width="100%"
|
|
131
|
+
:groupingLabel="subgroupingMap[filter.value].groupingLabel"
|
|
132
|
+
:groupingIcon="subgroupingMap[filter.value].groupingIcon"
|
|
133
|
+
:groupingColor="subgroupingMap[filter.value].groupingColor"
|
|
134
|
+
:label="subgroupingMap[filter.value].label"
|
|
135
|
+
:icon="subgroupingMap[filter.value].icon"
|
|
136
|
+
:color="'primary'"
|
|
137
|
+
:variant="variant"
|
|
138
|
+
@click="toggle()"
|
|
139
|
+
/>
|
|
140
|
+
</template>
|
|
118
141
|
<template
|
|
119
142
|
#item.actions="{ item }"
|
|
120
143
|
>
|
|
@@ -188,15 +211,19 @@ import FSDeviceOrganisationTileUI from "@dative-gpi/foundation-shared-components
|
|
|
188
211
|
import FSStatusesCarousel from "@dative-gpi/foundation-shared-components/components/deviceOrganisations/FSStatusesCarousel.vue";
|
|
189
212
|
import FSConnectivity from "@dative-gpi/foundation-shared-components/components/deviceOrganisations/FSConnectivity.vue";
|
|
190
213
|
import FSWorstAlert from "@dative-gpi/foundation-shared-components/components/deviceOrganisations/FSWorstAlert.vue";
|
|
214
|
+
import FSSubgroupingChip from "@dative-gpi/foundation-shared-components/components/FSSubgroupingChip.vue";
|
|
191
215
|
import FSIconCheck from "@dative-gpi/foundation-shared-components/components/FSIconCheck.vue";
|
|
192
216
|
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
193
217
|
import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
|
|
194
218
|
import FSSpan from '@dative-gpi/foundation-shared-components/components/FSSpan.vue';
|
|
219
|
+
import FSSubgroupingsChipGroup from "../subgroupings/FSSubgroupingsChipGroup.vue";
|
|
195
220
|
|
|
196
221
|
export default defineComponent({
|
|
197
222
|
name: "FSBaseDeviceOrganisationsList",
|
|
198
223
|
components: {
|
|
199
224
|
FSDeviceOrganisationTileUI,
|
|
225
|
+
FSSubgroupingsChipGroup,
|
|
226
|
+
FSSubgroupingChip,
|
|
200
227
|
FSStatusesCarousel,
|
|
201
228
|
FSConnectivity,
|
|
202
229
|
FSWorstAlert,
|
|
@@ -261,7 +288,33 @@ export default defineComponent({
|
|
|
261
288
|
return entities.value;
|
|
262
289
|
});
|
|
263
290
|
|
|
264
|
-
const
|
|
291
|
+
const subgroupingFilters = computed(() => {
|
|
292
|
+
const filters: { value: string | null, text: string }[] = [{
|
|
293
|
+
value: null,
|
|
294
|
+
text: "—"
|
|
295
|
+
}];
|
|
296
|
+
|
|
297
|
+
const uniqueSubgroupings = _.uniqBy(
|
|
298
|
+
entities.value.flatMap(device => device.subgroupings),
|
|
299
|
+
'id'
|
|
300
|
+
);
|
|
301
|
+
|
|
302
|
+
filters.push(...uniqueSubgroupings.map(subgrouping => ({
|
|
303
|
+
value: subgrouping.id,
|
|
304
|
+
text: `${subgrouping.groupingLabel} - ${subgrouping.label}`
|
|
305
|
+
})));
|
|
306
|
+
|
|
307
|
+
return filters.sort((a, b) => a.text.localeCompare(b.text));
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
const subgroupingMap = computed(() => {
|
|
311
|
+
return _.chain(entities.value)
|
|
312
|
+
.flatMap(device => device.subgroupings)
|
|
313
|
+
.keyBy('id')
|
|
314
|
+
.value();
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
const headersOptions = computed((): Record<string, any> => ({
|
|
265
318
|
status: {
|
|
266
319
|
fixedFilters: [{
|
|
267
320
|
value: true,
|
|
@@ -339,6 +392,17 @@ export default defineComponent({
|
|
|
339
392
|
},
|
|
340
393
|
sort: (a: DeviceOrganisationAlert, b: DeviceOrganisationAlert) => alphanumericSort(a?.criticity, b?.criticity)
|
|
341
394
|
},
|
|
395
|
+
subgroupings: {
|
|
396
|
+
|
|
397
|
+
fixedFilters: subgroupingFilters.value,
|
|
398
|
+
methodFilterRaw: (value: string | null, item: DeviceOrganisationInfos) => {
|
|
399
|
+
if (!value) {
|
|
400
|
+
return item.subgroupings.length === 0;
|
|
401
|
+
}
|
|
402
|
+
return item.subgroupings.some(s => s.id === value);
|
|
403
|
+
},
|
|
404
|
+
sort: (a: any[], b: any[]) => a.length - b.length
|
|
405
|
+
},
|
|
342
406
|
...customProperties.value.reduce((acc, cp) => ({
|
|
343
407
|
...acc,
|
|
344
408
|
[`meta.${cp.code}`]: {
|
|
@@ -382,6 +446,7 @@ export default defineComponent({
|
|
|
382
446
|
deviceOrganisations,
|
|
383
447
|
ConnectivityStatus,
|
|
384
448
|
customProperties,
|
|
449
|
+
subgroupingMap,
|
|
385
450
|
headersOptions,
|
|
386
451
|
isSelected
|
|
387
452
|
};
|
|
@@ -58,8 +58,6 @@ import { defineComponent, type PropType, watch } from "vue";
|
|
|
58
58
|
|
|
59
59
|
import { useFolders } from "@dative-gpi/foundation-core-services/composables";
|
|
60
60
|
|
|
61
|
-
import { DashboardType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
62
|
-
import { FoldersListType } from "@dative-gpi/foundation-core-components/utils";
|
|
63
61
|
import type { FolderFilters, DashboardInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
64
62
|
|
|
65
63
|
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
@@ -119,9 +117,7 @@ export default defineComponent({
|
|
|
119
117
|
fetchingFolders,
|
|
120
118
|
folders,
|
|
121
119
|
onSelect,
|
|
122
|
-
isSelected
|
|
123
|
-
FoldersListType,
|
|
124
|
-
DashboardType
|
|
120
|
+
isSelected
|
|
125
121
|
};
|
|
126
122
|
}
|
|
127
123
|
});
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
<FSDataTable
|
|
3
3
|
defaultMode="iterator"
|
|
4
4
|
:loading="fetchingGroupings"
|
|
5
|
+
:singleSelect="$props.singleSelect"
|
|
6
|
+
:selectable="$props.selectable"
|
|
5
7
|
:items="groupings"
|
|
6
8
|
:itemTo="$props.itemTo"
|
|
7
|
-
:selectable="$props.selectable"
|
|
8
|
-
:showSearch="$props.showSearch"
|
|
9
|
-
:singleSelect="$props.singleSelect"
|
|
10
|
-
:disableTable="$props.disableTable"
|
|
11
9
|
:modelValue="$props.modelValue"
|
|
12
10
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
13
11
|
v-bind="$attrs"
|
|
@@ -74,7 +72,7 @@ export default defineComponent({
|
|
|
74
72
|
type: Function as PropType<(item: GroupingInfos) => Partial<RouteLocation>>,
|
|
75
73
|
required: false
|
|
76
74
|
},
|
|
77
|
-
|
|
75
|
+
groupingFilters: {
|
|
78
76
|
type: Object as PropType<GroupingFilters>,
|
|
79
77
|
required: false,
|
|
80
78
|
default: null
|
|
@@ -94,16 +92,6 @@ export default defineComponent({
|
|
|
94
92
|
required: false,
|
|
95
93
|
default: () => []
|
|
96
94
|
},
|
|
97
|
-
showSearch: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
required: false,
|
|
100
|
-
default: false
|
|
101
|
-
},
|
|
102
|
-
disableTable: {
|
|
103
|
-
type: Boolean,
|
|
104
|
-
required: false,
|
|
105
|
-
default: true
|
|
106
|
-
}
|
|
107
95
|
},
|
|
108
96
|
emits: ["update:modelValue"],
|
|
109
97
|
setup(props) {
|
|
@@ -113,9 +101,9 @@ export default defineComponent({
|
|
|
113
101
|
return props.modelValue.includes(id);
|
|
114
102
|
};
|
|
115
103
|
|
|
116
|
-
watch(() => props.
|
|
104
|
+
watch(() => props.groupingFilters, (next, previous) => {
|
|
117
105
|
if ((!next && !previous) || !_.isEqual(next, previous)) {
|
|
118
|
-
fetchGroupings(props.
|
|
106
|
+
fetchGroupings(props.groupingFilters);
|
|
119
107
|
}
|
|
120
108
|
}, { immediate: true });
|
|
121
109
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSSimpleList
|
|
3
|
+
:items="groupings"
|
|
4
|
+
:loading="fetching"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { defineComponent, type PropType, watch } from "vue";
|
|
11
|
+
|
|
12
|
+
import type { GroupingFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
13
|
+
import { useGroupings } from "@dative-gpi/foundation-core-services/composables";
|
|
14
|
+
|
|
15
|
+
import FSSimpleList from "@dative-gpi/foundation-shared-components/components/lists/FSSimpleList.vue";
|
|
16
|
+
|
|
17
|
+
export default defineComponent({
|
|
18
|
+
name: "FSSimpleGroupingsList",
|
|
19
|
+
components: {
|
|
20
|
+
FSSimpleList,
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
groupingFilters: {
|
|
24
|
+
type: Object as PropType<GroupingFilters>,
|
|
25
|
+
required: false,
|
|
26
|
+
default: () => ({})
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setup(props) {
|
|
30
|
+
const { entities: groupings, getMany, fetching } = useGroupings();
|
|
31
|
+
|
|
32
|
+
const fetch = () => {
|
|
33
|
+
getMany(props.groupingFilters);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
watch(() => props.groupingFilters, fetch, { immediate: true });
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
groupings,
|
|
40
|
+
fetching
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSTileList
|
|
3
|
+
:items="groupings"
|
|
4
|
+
:loading="fetching"
|
|
5
|
+
:selectable="$props.selectable"
|
|
6
|
+
:modelValue="$props.modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
>
|
|
10
|
+
<template
|
|
11
|
+
#item.tile="{ item, toggleSelect, direction }"
|
|
12
|
+
>
|
|
13
|
+
<FSGroupingTileUI
|
|
14
|
+
:icon="item.icon"
|
|
15
|
+
:iconColor="item.color"
|
|
16
|
+
:label="item.label"
|
|
17
|
+
:code="item.code"
|
|
18
|
+
:subgroupingCount="item.subgroupingCount"
|
|
19
|
+
:width="direction === ListDirections.Column ? 'fill' : undefined"
|
|
20
|
+
:selectable="$props.selectable"
|
|
21
|
+
:modelValue="($props.modelValue ?? []).includes(item.id)"
|
|
22
|
+
@update:modelValue="toggleSelect(item)"
|
|
23
|
+
/>
|
|
24
|
+
</template>
|
|
25
|
+
</FSTileList>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { defineComponent, type PropType, watch } from "vue";
|
|
30
|
+
|
|
31
|
+
import type { GroupingFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
32
|
+
import { useGroupings } from "@dative-gpi/foundation-core-services/composables";
|
|
33
|
+
|
|
34
|
+
import FSGroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSGroupingTileUI.vue";
|
|
35
|
+
import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
|
|
36
|
+
|
|
37
|
+
import { ListDirections } from "@dative-gpi/foundation-shared-domain/enums";
|
|
38
|
+
|
|
39
|
+
export default defineComponent({
|
|
40
|
+
name: "FSTileGroupingsList",
|
|
41
|
+
components: {
|
|
42
|
+
FSTileList,
|
|
43
|
+
FSGroupingTileUI
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
groupingFilters: {
|
|
47
|
+
type: Object as PropType<GroupingFilters>,
|
|
48
|
+
required: false,
|
|
49
|
+
default: () => ({})
|
|
50
|
+
},
|
|
51
|
+
modelValue: {
|
|
52
|
+
type: Array as PropType<string[]>,
|
|
53
|
+
required: false,
|
|
54
|
+
default: () => []
|
|
55
|
+
},
|
|
56
|
+
selectable: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
required: false,
|
|
59
|
+
default: false
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
emits: ["update:modelValue"],
|
|
63
|
+
setup(props) {
|
|
64
|
+
const { entities: groupings, getMany, fetching } = useGroupings();
|
|
65
|
+
|
|
66
|
+
const fetch = () => {
|
|
67
|
+
getMany(props.groupingFilters);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
watch(() => props.groupingFilters, fetch, { immediate: true });
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
groupings,
|
|
74
|
+
fetching,
|
|
75
|
+
ListDirections
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
>
|
|
32
32
|
<FSLocationTileUI
|
|
33
33
|
:key="index"
|
|
34
|
+
v-bind="item"
|
|
34
35
|
:bottomColor="item.colors"
|
|
35
|
-
:address="item.address.placeLabel"
|
|
36
36
|
:selectable="$props.selectable"
|
|
37
|
-
:singleSelect="singleSelect"
|
|
37
|
+
:singleSelect="$props.singleSelect"
|
|
38
38
|
:modelValue="isSelected(item.id)"
|
|
39
39
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
40
40
|
@update:modelValue="toggleSelect(item)"
|
|
41
|
-
|
|
41
|
+
:address="item.address.formattedAddress"
|
|
42
42
|
/>
|
|
43
43
|
</template>
|
|
44
44
|
</FSDataTable>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSTileList
|
|
3
|
+
:items="playlists"
|
|
4
|
+
:loading="fetching"
|
|
5
|
+
:selectable="$props.selectable"
|
|
6
|
+
:singleSelect="$props.singleSelect"
|
|
7
|
+
:modelValue="$props.modelValue"
|
|
8
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
>
|
|
11
|
+
<template
|
|
12
|
+
v-for="(_, name) in $slots"
|
|
13
|
+
v-slot:[name]="slotData"
|
|
14
|
+
>
|
|
15
|
+
<slot
|
|
16
|
+
:name="name"
|
|
17
|
+
v-bind="slotData"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
20
|
+
<template
|
|
21
|
+
#item.tile="{ item, toggleSelect, direction }"
|
|
22
|
+
>
|
|
23
|
+
<FSPlaylistTileUI
|
|
24
|
+
:dashboardsCount="item.dashboards.length"
|
|
25
|
+
:selectable="$props.selectable"
|
|
26
|
+
:singleSelect="$props.singleSelect"
|
|
27
|
+
:modelValue="($props.modelValue ?? []).includes(item.id)"
|
|
28
|
+
:width="direction === ListDirections.Column ? 'fill' : undefined"
|
|
29
|
+
@update:modelValue="toggleSelect(item)"
|
|
30
|
+
v-bind="item"
|
|
31
|
+
/>
|
|
32
|
+
</template>
|
|
33
|
+
</FSTileList>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script lang="ts">
|
|
37
|
+
import type { PropType} from "vue";
|
|
38
|
+
import { defineComponent, watch } from "vue";
|
|
39
|
+
|
|
40
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
41
|
+
import { ListDirections } from "@dative-gpi/foundation-shared-domain/enums";
|
|
42
|
+
|
|
43
|
+
import type { PlaylistFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
44
|
+
import { usePlaylists } from "@dative-gpi/foundation-core-services/composables";
|
|
45
|
+
|
|
46
|
+
import FSPlaylistTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSPlaylistTileUI.vue";
|
|
47
|
+
import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export default defineComponent({
|
|
51
|
+
title: "FSTilePlaylistsList",
|
|
52
|
+
components: {
|
|
53
|
+
FSPlaylistTileUI,
|
|
54
|
+
FSTileList
|
|
55
|
+
},
|
|
56
|
+
props: {
|
|
57
|
+
playlistFilters: {
|
|
58
|
+
type: Object as PropType<PlaylistFilters>,
|
|
59
|
+
required: true
|
|
60
|
+
},
|
|
61
|
+
modelValue: {
|
|
62
|
+
type: Array as PropType<string[]>,
|
|
63
|
+
required: false,
|
|
64
|
+
default: () => []
|
|
65
|
+
},
|
|
66
|
+
selectable: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
required: false,
|
|
69
|
+
default: false
|
|
70
|
+
},
|
|
71
|
+
singleSelect: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
required: false,
|
|
74
|
+
default: false
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
setup(props) {
|
|
78
|
+
const { entities: playlists, getMany, fetching } = usePlaylists();
|
|
79
|
+
|
|
80
|
+
const fetch = () => {
|
|
81
|
+
getMany(props.playlistFilters);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
watch(() => props.playlistFilters, fetch, { immediate: true });
|
|
85
|
+
return {
|
|
86
|
+
ListDirections,
|
|
87
|
+
playlists,
|
|
88
|
+
ColorEnum,
|
|
89
|
+
fetching
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
</script>
|