@dative-gpi/foundation-core-components 1.1.23 → 1.1.24-unit-formatter
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 +2 -11
- package/components/entities/FSBaseEntitiesList.vue +0 -4
- package/components/entities/FSEntityField.vue +5 -11
- package/components/entities/FSSelectEntitiesList.vue +8 -35
- package/components/entities/FSSimpleEntitiesList.vue +2 -15
- package/components/entities/FSTileEntitiesList.vue +3 -1
- package/components/explorers/FSBaseFoldersExplorer.vue +337 -0
- package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +6 -7
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +6 -7
- package/components/lists/charts/FSBaseChartsList.vue +14 -7
- package/components/lists/dashboards/FSBaseDashboardsList.vue +224 -40
- package/components/lists/dashboards/FSSimpleDashboardsList.vue +53 -27
- package/components/lists/dashboards/FSTileDashboardsList.vue +62 -30
- package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +8 -10
- package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +7 -10
- package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +1 -66
- package/components/lists/folders/FSBaseFoldersList.vue +5 -1
- package/components/lists/groupings/FSBaseGroupingsList.vue +17 -5
- package/components/lists/groups/FSSimpleGroupsList.vue +0 -1
- package/components/lists/locations/FSBaseLocationsList.vue +3 -3
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +1 -21
- package/components/lists/userOrganisations/{FSUserOrganisationsChipGroup.vue → FSChipUserOrganisationsList.vue} +2 -2
- package/components/tiles/FSLocationTile.vue +1 -2
- package/package.json +8 -8
- package/utils/dashboards.ts +30 -12
- package/utils/tables.ts +7 -13
- package/utils/users.ts +1 -1
- package/components/explorers/FSBaseDashboardsExplorer.vue +0 -312
- package/components/explorers/FSDashboardExplorerElementTypeChip.vue +0 -37
- package/components/lists/groupings/FSSimpleGroupingsList.vue +0 -44
- package/components/lists/groupings/FSTileGroupingsList.vue +0 -79
- package/components/lists/playlists/FSTilePlaylistsList.vue +0 -93
- package/components/lists/subgroupings/FSBaseSubgroupingsList.vue +0 -197
- package/components/lists/subgroupings/FSSimpleSubgroupingsList.vue +0 -45
- package/components/lists/subgroupings/FSSubgroupingsChipGroup.vue +0 -61
- package/components/lists/subgroupings/FSTileSubgroupingsList.vue +0 -81
- package/components/tiles/FSGroupingTile.vue +0 -67
- package/components/tiles/FSPlaylistTile.vue +0 -78
- package/components/tiles/FSSubgroupingTile.vue +0 -69
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FSDataTable
|
|
3
|
-
defaultMode="iterator"
|
|
4
|
-
:loading="fetchingDashboardExplorerElements"
|
|
5
|
-
:singleSelect="$props.singleSelect"
|
|
6
|
-
:items="dashboardExplorerElements"
|
|
7
|
-
:selectable="$props.selectable"
|
|
8
|
-
:tableCode="$props.tableCode"
|
|
9
|
-
:itemTo="$props.itemTo"
|
|
10
|
-
:noSearch="$props.recursiveSearch"
|
|
11
|
-
:headersOptions="headersOptions"
|
|
12
|
-
:modelValue="$props.modelValue"
|
|
13
|
-
@update:modelValue="onUpdate"
|
|
14
|
-
v-model:search="search"
|
|
15
|
-
v-bind="$attrs"
|
|
16
|
-
>
|
|
17
|
-
<template
|
|
18
|
-
v-for="(_, name) in $slots"
|
|
19
|
-
v-slot:[name]="slotData"
|
|
20
|
-
>
|
|
21
|
-
<slot
|
|
22
|
-
:name="name"
|
|
23
|
-
v-bind="slotData"
|
|
24
|
-
/>
|
|
25
|
-
</template>
|
|
26
|
-
<template
|
|
27
|
-
#header.imageId-title
|
|
28
|
-
>
|
|
29
|
-
<FSIcon>
|
|
30
|
-
mdi-panorama-variant-outline
|
|
31
|
-
</FSIcon>
|
|
32
|
-
</template>
|
|
33
|
-
<template
|
|
34
|
-
#item.imageId="{ item }"
|
|
35
|
-
>
|
|
36
|
-
<FSImage
|
|
37
|
-
v-if="item.imageId"
|
|
38
|
-
height="32px"
|
|
39
|
-
width="32px"
|
|
40
|
-
:imageId="item.imageId"
|
|
41
|
-
:thumbnail="true"
|
|
42
|
-
/>
|
|
43
|
-
</template>
|
|
44
|
-
<template
|
|
45
|
-
#item.tags="{ item }"
|
|
46
|
-
>
|
|
47
|
-
<FSTagGroup
|
|
48
|
-
variant="slide"
|
|
49
|
-
:showRemove="false"
|
|
50
|
-
:tags="item.tags"
|
|
51
|
-
/>
|
|
52
|
-
</template>
|
|
53
|
-
<template
|
|
54
|
-
#item.type="{ item }"
|
|
55
|
-
>
|
|
56
|
-
<FSDashboardExplorerElementTypeChip
|
|
57
|
-
:type="item.type"
|
|
58
|
-
/>
|
|
59
|
-
</template>
|
|
60
|
-
<template
|
|
61
|
-
#item.icon="{ item }"
|
|
62
|
-
>
|
|
63
|
-
<FSIcon>
|
|
64
|
-
{{ item.icon }}
|
|
65
|
-
</FSIcon>
|
|
66
|
-
</template>
|
|
67
|
-
<template
|
|
68
|
-
#item.locked="{ item }"
|
|
69
|
-
>
|
|
70
|
-
<FSIconCheck
|
|
71
|
-
v-if="item.locked != null"
|
|
72
|
-
:value="item.locked"
|
|
73
|
-
/>
|
|
74
|
-
</template>
|
|
75
|
-
<template
|
|
76
|
-
#item.tile="{ index, item, toggleSelect }"
|
|
77
|
-
>
|
|
78
|
-
<FSFolderTileUI
|
|
79
|
-
v-if="item.type === DashboardExplorerElementType.Folder"
|
|
80
|
-
:key="index"
|
|
81
|
-
:to="$props.itemTo && $props.itemTo(item)"
|
|
82
|
-
:imageId="item.imageId"
|
|
83
|
-
:icon="item.icon"
|
|
84
|
-
:label="item.label"
|
|
85
|
-
:code="item.code"
|
|
86
|
-
:bottomColor="item.colors"
|
|
87
|
-
:recursiveFoldersIds="item.recursiveFoldersIds"
|
|
88
|
-
:recursiveDashboardOrganisationsIds="item.recursiveDashboardOrganisationsIds"
|
|
89
|
-
:recursiveDashboardShallowsIds="item.recursiveDashboardShallowsIds"
|
|
90
|
-
:modelValue="isSelected(item.id)"
|
|
91
|
-
:selectable="$props.selectable"
|
|
92
|
-
@update:modelValue="toggleSelect(item)"
|
|
93
|
-
/>
|
|
94
|
-
<FSDashboardOrganisationTileUI
|
|
95
|
-
v-if="item.type === DashboardExplorerElementType.DashboardOrganisation"
|
|
96
|
-
:key="index"
|
|
97
|
-
:to="$props.itemTo && $props.itemTo(item)"
|
|
98
|
-
:bottomColor="item.colors"
|
|
99
|
-
:imageId="item.imageId"
|
|
100
|
-
:icon="item.icon"
|
|
101
|
-
:label="item.label"
|
|
102
|
-
:code="item.code"
|
|
103
|
-
:modelValue="isSelected(item.id)"
|
|
104
|
-
:selectable="$props.selectable"
|
|
105
|
-
@update:modelValue="toggleSelect(item)"
|
|
106
|
-
/>
|
|
107
|
-
<FSDashboardShallowTileUI
|
|
108
|
-
v-if="item.type === DashboardExplorerElementType.DashboardShallow"
|
|
109
|
-
:key="index"
|
|
110
|
-
:to="$props.itemTo && $props.itemTo(item)"
|
|
111
|
-
:bottomColor="item.colors"
|
|
112
|
-
:imageId="item.imageId"
|
|
113
|
-
:icon="item.icon"
|
|
114
|
-
:label="item.label"
|
|
115
|
-
:code="item.code"
|
|
116
|
-
:modelValue="isSelected(item.id)"
|
|
117
|
-
:selectable="$props.selectable"
|
|
118
|
-
@update:modelValue="toggleSelect(item)"
|
|
119
|
-
/>
|
|
120
|
-
<FSDashboardOrganisationTypeTileUI
|
|
121
|
-
v-if="item.type === DashboardExplorerElementType.DashboardOrganisationType"
|
|
122
|
-
:key="index"
|
|
123
|
-
:to="$props.itemTo && $props.itemTo(item)"
|
|
124
|
-
:bottomColor="item.colors"
|
|
125
|
-
:imageId="item.imageId"
|
|
126
|
-
:icon="item.icon"
|
|
127
|
-
:label="item.label"
|
|
128
|
-
:code="item.code"
|
|
129
|
-
:modelValue="isSelected(item.id)"
|
|
130
|
-
:selectable="$props.selectable"
|
|
131
|
-
@update:modelValue="toggleSelect(item)"
|
|
132
|
-
/>
|
|
133
|
-
</template>
|
|
134
|
-
</FSDataTable>
|
|
135
|
-
</template>
|
|
136
|
-
|
|
137
|
-
<script lang="ts">
|
|
138
|
-
import { computed, defineComponent, type PropType, ref, watch } from "vue";
|
|
139
|
-
import { type RouteLocation } from "vue-router";
|
|
140
|
-
import _ from "lodash";
|
|
141
|
-
|
|
142
|
-
import { DashboardExplorerElementType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
143
|
-
import { useDashboardExplorerElements } from "@dative-gpi/foundation-core-services/composables";
|
|
144
|
-
import { type DashboardExplorerElementInfos, type DashboardExplorerElementFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
145
|
-
import { dashboardExplorerElementTypeLabel } from "@dative-gpi/foundation-core-components/utils";
|
|
146
|
-
import { useDebounce } from "@dative-gpi/foundation-shared-components/composables";
|
|
147
|
-
|
|
148
|
-
import FSDashboardOrganisationTypeTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTypeTileUI.vue";
|
|
149
|
-
import FSDashboardOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTileUI.vue";
|
|
150
|
-
import FSDashboardShallowTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardShallowTileUI.vue";
|
|
151
|
-
import FSFolderTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSFolderTileUI.vue";
|
|
152
|
-
import FSIconCheck from "@dative-gpi/foundation-shared-components/components/FSIconCheck.vue";
|
|
153
|
-
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
154
|
-
import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
|
|
155
|
-
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
156
|
-
|
|
157
|
-
import FSDashboardExplorerElementTypeChip from "./FSDashboardExplorerElementTypeChip.vue";
|
|
158
|
-
import FSDataTable from "../lists/FSDataTable.vue";
|
|
159
|
-
|
|
160
|
-
export default defineComponent({
|
|
161
|
-
name: "FSBaseDashboardsExplorer",
|
|
162
|
-
components: {
|
|
163
|
-
FSDashboardExplorerElementTypeChip,
|
|
164
|
-
FSDashboardOrganisationTypeTileUI,
|
|
165
|
-
FSDashboardOrganisationTileUI,
|
|
166
|
-
FSDashboardShallowTileUI,
|
|
167
|
-
FSFolderTileUI,
|
|
168
|
-
FSDataTable,
|
|
169
|
-
FSIconCheck,
|
|
170
|
-
FSTagGroup,
|
|
171
|
-
FSImage,
|
|
172
|
-
FSIcon
|
|
173
|
-
},
|
|
174
|
-
props: {
|
|
175
|
-
tableCode: {
|
|
176
|
-
type: String as PropType<string | null>,
|
|
177
|
-
required: false,
|
|
178
|
-
default: null
|
|
179
|
-
},
|
|
180
|
-
recursiveSearch: {
|
|
181
|
-
type: Boolean,
|
|
182
|
-
required: false,
|
|
183
|
-
default: true
|
|
184
|
-
},
|
|
185
|
-
parentId: {
|
|
186
|
-
type: String as PropType<string | null>,
|
|
187
|
-
required: false,
|
|
188
|
-
default: null
|
|
189
|
-
},
|
|
190
|
-
root: {
|
|
191
|
-
type: Boolean,
|
|
192
|
-
required: false,
|
|
193
|
-
default: true
|
|
194
|
-
},
|
|
195
|
-
allowedTypes: {
|
|
196
|
-
type: Array as PropType<DashboardExplorerElementType[]>,
|
|
197
|
-
required: false,
|
|
198
|
-
default: () => [
|
|
199
|
-
DashboardExplorerElementType.Folder,
|
|
200
|
-
DashboardExplorerElementType.DashboardOrganisation,
|
|
201
|
-
DashboardExplorerElementType.DashboardShallow,
|
|
202
|
-
DashboardExplorerElementType.DashboardOrganisationType
|
|
203
|
-
]
|
|
204
|
-
},
|
|
205
|
-
itemTo: {
|
|
206
|
-
type: Function as PropType<(item: DashboardExplorerElementInfos) => Partial<RouteLocation>>,
|
|
207
|
-
required: false
|
|
208
|
-
},
|
|
209
|
-
selectable: {
|
|
210
|
-
type: Boolean,
|
|
211
|
-
required: false,
|
|
212
|
-
default: true
|
|
213
|
-
},
|
|
214
|
-
singleSelect: {
|
|
215
|
-
type: Boolean,
|
|
216
|
-
required: false,
|
|
217
|
-
default: false
|
|
218
|
-
},
|
|
219
|
-
modelValue: {
|
|
220
|
-
type: Array as PropType<string[]>,
|
|
221
|
-
default: () => [],
|
|
222
|
-
required: false
|
|
223
|
-
},
|
|
224
|
-
dashboardExplorerElementsFilters: {
|
|
225
|
-
type: Object as PropType<DashboardExplorerElementFilters>,
|
|
226
|
-
required: false,
|
|
227
|
-
default: () => ({})
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
inheritAttrs: false,
|
|
231
|
-
emits: ["update:modelValue", "update:types"],
|
|
232
|
-
setup(props, { emit }) {
|
|
233
|
-
const { entities, fetching: fetchingDashboardExplorerElements, getMany: getManyDashboardExplorerElements } = useDashboardExplorerElements();
|
|
234
|
-
const { debounce } = useDebounce();
|
|
235
|
-
|
|
236
|
-
const search = ref("");
|
|
237
|
-
|
|
238
|
-
const dashboardExplorerElements = computed((): DashboardExplorerElementInfos[] => {
|
|
239
|
-
return entities.value
|
|
240
|
-
.filter(e => props.allowedTypes.includes(e.type))
|
|
241
|
-
.sort((a, b) => a.type - b.type);
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
const headersOptions = computed(() => ({
|
|
245
|
-
type: {
|
|
246
|
-
fixedFilters: props.allowedTypes.map(t => ({
|
|
247
|
-
value: t,
|
|
248
|
-
text: dashboardExplorerElementTypeLabel(t)
|
|
249
|
-
})),
|
|
250
|
-
methodFilter: (value: DashboardExplorerElementType, type: DashboardExplorerElementType) => {
|
|
251
|
-
return value === type;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}));
|
|
255
|
-
|
|
256
|
-
const isSelected = (id: string): boolean => {
|
|
257
|
-
return props.modelValue.includes(id);
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
const onUpdate = (value: string[]): void => {
|
|
261
|
-
const types = value.map(id => entities.value.find(dee => dee.id === id)?.type);
|
|
262
|
-
emit("update:types", types);
|
|
263
|
-
|
|
264
|
-
emit("update:modelValue", value);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
const fetch = () => {
|
|
268
|
-
if (props.recursiveSearch && search.value) {
|
|
269
|
-
getManyDashboardExplorerElements({
|
|
270
|
-
ancestorId: props.parentId,
|
|
271
|
-
search: search.value,
|
|
272
|
-
types: props.allowedTypes,
|
|
273
|
-
...props.dashboardExplorerElementsFilters
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
getManyDashboardExplorerElements({
|
|
278
|
-
parentId: props.parentId,
|
|
279
|
-
root: props.root,
|
|
280
|
-
types: props.allowedTypes,
|
|
281
|
-
...props.dashboardExplorerElementsFilters
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
// Delay to wait before fetching after a search change
|
|
287
|
-
const debounceFetch = (): void => debounce(fetch, 1000);
|
|
288
|
-
|
|
289
|
-
watch([() => props.parentId, () => props.root, () => props.allowedTypes, () => props.dashboardExplorerElementsFilters], (next, previous) => {
|
|
290
|
-
if ((!next && !previous) || !_.isEqual(next, previous)) {
|
|
291
|
-
fetch();
|
|
292
|
-
}
|
|
293
|
-
}, { immediate: true });
|
|
294
|
-
|
|
295
|
-
watch(search, (next, previous) => {
|
|
296
|
-
if (props.recursiveSearch && next !== previous) {
|
|
297
|
-
debounceFetch();
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
return {
|
|
302
|
-
fetchingDashboardExplorerElements,
|
|
303
|
-
DashboardExplorerElementType,
|
|
304
|
-
dashboardExplorerElements,
|
|
305
|
-
headersOptions,
|
|
306
|
-
search,
|
|
307
|
-
isSelected,
|
|
308
|
-
onUpdate
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
</script>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FSChip
|
|
3
|
-
:label="chipLabel"
|
|
4
|
-
:color="ColorEnum.Light"
|
|
5
|
-
/>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import { computed, defineComponent, type PropType } from "vue";
|
|
10
|
-
|
|
11
|
-
import type { DashboardExplorerElementType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
12
|
-
import { dashboardExplorerElementTypeLabel } from "@dative-gpi/foundation-core-components/utils";
|
|
13
|
-
|
|
14
|
-
import FSChip from "@dative-gpi/foundation-shared-components/components/FSChip.vue";
|
|
15
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
16
|
-
|
|
17
|
-
export default defineComponent({
|
|
18
|
-
name: "FSDashboardExplorerElementTypeChip",
|
|
19
|
-
components: {
|
|
20
|
-
FSChip
|
|
21
|
-
},
|
|
22
|
-
props: {
|
|
23
|
-
type: {
|
|
24
|
-
type: Number as PropType<DashboardExplorerElementType>,
|
|
25
|
-
required: true
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
setup(props) {
|
|
29
|
-
const chipLabel = computed(() => dashboardExplorerElementTypeLabel(props.type));
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
chipLabel,
|
|
33
|
-
ColorEnum
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
</script>
|
|
@@ -1,44 +0,0 @@
|
|
|
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>
|
|
@@ -1,79 +0,0 @@
|
|
|
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>
|
|
@@ -1,93 +0,0 @@
|
|
|
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>
|