@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.
Files changed (39) hide show
  1. package/components/autocompletes/FSAutocompleteDataCategory.vue +11 -2
  2. package/components/entities/FSBaseEntitiesList.vue +4 -0
  3. package/components/entities/FSEntityField.vue +11 -5
  4. package/components/entities/FSSelectEntitiesList.vue +35 -8
  5. package/components/entities/FSSimpleEntitiesList.vue +15 -2
  6. package/components/entities/FSTileEntitiesList.vue +1 -3
  7. package/components/explorers/FSBaseDashboardsExplorer.vue +312 -0
  8. package/components/explorers/FSDashboardExplorerElementTypeChip.vue +37 -0
  9. package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +7 -6
  10. package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +7 -6
  11. package/components/lists/charts/FSBaseChartsList.vue +7 -14
  12. package/components/lists/dashboards/FSBaseDashboardsList.vue +40 -224
  13. package/components/lists/dashboards/FSSimpleDashboardsList.vue +27 -53
  14. package/components/lists/dashboards/FSTileDashboardsList.vue +30 -62
  15. package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +10 -8
  16. package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +10 -7
  17. package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +66 -1
  18. package/components/lists/folders/FSBaseFoldersList.vue +1 -5
  19. package/components/lists/groupings/FSBaseGroupingsList.vue +5 -17
  20. package/components/lists/groupings/FSSimpleGroupingsList.vue +44 -0
  21. package/components/lists/groupings/FSTileGroupingsList.vue +79 -0
  22. package/components/lists/groups/FSSimpleGroupsList.vue +1 -0
  23. package/components/lists/locations/FSBaseLocationsList.vue +3 -3
  24. package/components/lists/playlists/FSTilePlaylistsList.vue +93 -0
  25. package/components/lists/subgroupings/FSBaseSubgroupingsList.vue +197 -0
  26. package/components/lists/subgroupings/FSSimpleSubgroupingsList.vue +45 -0
  27. package/components/lists/subgroupings/FSSubgroupingsChipGroup.vue +61 -0
  28. package/components/lists/subgroupings/FSTileSubgroupingsList.vue +81 -0
  29. package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +21 -1
  30. package/components/lists/userOrganisations/{FSChipUserOrganisationsList.vue → FSUserOrganisationsChipGroup.vue} +2 -2
  31. package/components/tiles/FSGroupingTile.vue +67 -0
  32. package/components/tiles/FSLocationTile.vue +2 -1
  33. package/components/tiles/FSPlaylistTile.vue +78 -0
  34. package/components/tiles/FSSubgroupingTile.vue +69 -0
  35. package/package.json +8 -8
  36. package/utils/dashboards.ts +12 -30
  37. package/utils/tables.ts +13 -7
  38. package/utils/users.ts +1 -1
  39. package/components/explorers/FSBaseFoldersExplorer.vue +0 -337
@@ -0,0 +1,197 @@
1
+ <template>
2
+ <FSDataTable
3
+ :loading="fetchingSubgroupings"
4
+ :items="subgroupings"
5
+ :itemTo="$props.itemTo"
6
+ :tableCode="$props.tableCode"
7
+ :selectable="$props.selectable"
8
+ :showSearch="$props.showSearch"
9
+ :singleSelect="$props.singleSelect"
10
+ :groupBy="groupBy"
11
+ :modelValue="$props.modelValue"
12
+ @update:modelValue="$emit('update:modelValue', $event)"
13
+ v-bind="$attrs"
14
+ >
15
+ <template
16
+ v-for="(_, name) in $slots"
17
+ v-slot:[name]="slotData"
18
+ >
19
+ <slot
20
+ :name="name"
21
+ v-bind="slotData"
22
+ />
23
+ </template>
24
+ <template
25
+ #group-header="{ item }"
26
+ >
27
+ <FSRow
28
+ height="54px"
29
+ align="center-left"
30
+ >
31
+ <FSCard
32
+ padding="16px 16px 16px 56px"
33
+ height="100%"
34
+ width="100%"
35
+ :borderRadius="0"
36
+ :variant="CardVariants.Full"
37
+ :color="getColors(ColorEnum.Light).base"
38
+ >
39
+ <FSGroupingChip
40
+ :label="getGroupingLabel(item.value)"
41
+ :iconColor="getGroupingColor(item.value)"
42
+ :icon="getGroupingIcon(item.value)"
43
+ />
44
+ </FSCard>
45
+ </FSRow>
46
+ </template>
47
+ <template
48
+ #item.icon="{ item }"
49
+ >
50
+ <FSIcon>
51
+ {{ item.icon }}
52
+ </FSIcon>
53
+ </template>
54
+ <template
55
+ #item.tile="{ item, toggleSelect }"
56
+ >
57
+ <FSSubgroupingTileUI
58
+ :selectable="$props.selectable"
59
+ :modelValue="isSelected(item.id)"
60
+ :singleSelect="$props.singleSelect"
61
+ :deviceOrganisationsCount="item.deviceOrganisationsCount"
62
+ :groupingLabel="item.groupingLabel"
63
+ :groupingIcon="item.groupingIcon"
64
+ :groupingColor="item.groupingColor"
65
+ :label="item.label"
66
+ :icon="item.icon"
67
+ :to="$props.itemTo && $props.itemTo(item)"
68
+ @update:modelValue="toggleSelect(item)"
69
+ />
70
+ </template>
71
+ </FSDataTable>
72
+ </template>
73
+
74
+ <script lang="ts">
75
+ import { computed, defineComponent, type PropType, watch } from "vue";
76
+ import { type RouteLocation } from "vue-router";
77
+ import _ from "lodash";
78
+
79
+ import type { SubgroupingFilters, SubgroupingInfos } from "@dative-gpi/foundation-core-domain/models";
80
+ import { useSubgroupings } from "@dative-gpi/foundation-core-services/composables";
81
+
82
+ import FSDataTable from "../FSDataTable.vue";
83
+
84
+ import FSSubgroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSSubgroupingTileUI.vue";
85
+ import FSGroupingChip from "@dative-gpi/foundation-shared-components/components/FSGroupingChip.vue";
86
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
87
+ import FSCard from "@dative-gpi/foundation-shared-components/components/FSCard.vue";
88
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
89
+
90
+ import { ColorEnum, CardVariants } from "@dative-gpi/foundation-shared-components/models";
91
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
92
+
93
+ export default defineComponent({
94
+ name: "FSBaseSubgroupingsList",
95
+ components: {
96
+ FSSubgroupingTileUI,
97
+ FSGroupingChip,
98
+ FSDataTable,
99
+ FSIcon,
100
+ FSCard,
101
+ FSRow
102
+ },
103
+ props: {
104
+ tableCode: {
105
+ type: String as PropType<string | null>,
106
+ required: false,
107
+ default: null
108
+ },
109
+ itemTo: {
110
+ type: Function as PropType<(item: SubgroupingInfos) => Partial<RouteLocation>>,
111
+ required: false
112
+ },
113
+ subgroupingFilters: {
114
+ type: Object as PropType<SubgroupingFilters>,
115
+ required: false,
116
+ default: null
117
+ },
118
+ selectable: {
119
+ type: Boolean,
120
+ required: false,
121
+ default: true
122
+ },
123
+ singleSelect: {
124
+ type: Boolean,
125
+ required: false,
126
+ default: false
127
+ },
128
+ showSearch: {
129
+ type: Boolean,
130
+ required: false,
131
+ default: true
132
+ },
133
+ modelValue: {
134
+ type: Array as PropType<string[]>,
135
+ required: false,
136
+ default: () => []
137
+ }
138
+ },
139
+ inheritAttrs: false,
140
+ emits: ["update:modelValue"],
141
+ setup(props) {
142
+ const { getMany: fetchSubgroupings, fetching: fetchingSubgroupings, entities: subgroupings } = useSubgroupings();
143
+ const { getColors } = useColors();
144
+
145
+ const groupBy = computed(() => ({
146
+ key: "groupingId",
147
+ order: "asc" as const
148
+ }));
149
+
150
+ const groupingMap = computed(() => {
151
+ return _.chain(subgroupings.value)
152
+ .keyBy('groupingId')
153
+ .mapValues(s => ({
154
+ label: s.groupingLabel,
155
+ color: s.groupingColor,
156
+ icon: s.groupingIcon
157
+ }))
158
+ .value();
159
+ });
160
+
161
+ const getGroupingLabel = (groupingId: string): string => {
162
+ return groupingMap.value[groupingId].label;
163
+ };
164
+
165
+ const getGroupingColor = (groupingId: string): string => {
166
+ return groupingMap.value[groupingId].color;
167
+ };
168
+
169
+ const getGroupingIcon = (groupingId: string): string => {
170
+ return groupingMap.value[groupingId].icon;
171
+ };
172
+
173
+ const isSelected = (id: string) => {
174
+ return props.modelValue.includes(id);
175
+ };
176
+
177
+ watch(() => props.subgroupingFilters, (next, previous) => {
178
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
179
+ fetchSubgroupings(props.subgroupingFilters);
180
+ }
181
+ }, { immediate: true });
182
+
183
+ return {
184
+ fetchingSubgroupings,
185
+ getGroupingLabel,
186
+ getGroupingColor,
187
+ getGroupingIcon,
188
+ subgroupings,
189
+ CardVariants,
190
+ isSelected,
191
+ getColors,
192
+ ColorEnum,
193
+ groupBy,
194
+ };
195
+ }
196
+ });
197
+ </script>
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <FSSimpleList
3
+ :items="subgroupings"
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 { SubgroupingFilters } from "@dative-gpi/foundation-core-domain/models";
13
+ import { useSubgroupings } 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: "FSSimpleSubgroupingsList",
19
+ components: {
20
+ FSSimpleList,
21
+ },
22
+ props: {
23
+ subgroupingFilters: {
24
+ type: Object as PropType<SubgroupingFilters>,
25
+ required: false,
26
+ default: () => ({})
27
+ }
28
+ },
29
+ inheritAttrs: false,
30
+ setup(props) {
31
+ const { entities: subgroupings, getMany, fetching } = useSubgroupings();
32
+
33
+ const fetch = () => {
34
+ getMany(props.subgroupingFilters);
35
+ };
36
+
37
+ watch(() => props.subgroupingFilters, fetch, { immediate: true });
38
+
39
+ return {
40
+ subgroupings,
41
+ fetching
42
+ };
43
+ }
44
+ });
45
+ </script>
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <FSChipGroup
3
+ v-if="$props.subgroupings && $props.subgroupings.length > 0"
4
+ :items="$props.subgroupings"
5
+ :maxItems="$props.maxItems"
6
+ :variant="$props.variant"
7
+ >
8
+ <template
9
+ #item.chip="{ item }"
10
+ >
11
+ <FSSubgroupingChip
12
+ :groupingLabel="item.groupingLabel"
13
+ :groupingIcon="item.groupingIcon"
14
+ :groupingColor="item.groupingColor"
15
+ :label="item.label"
16
+ :icon="item.icon"
17
+ :to="$props.itemTo ? $props.itemTo(item) : null"
18
+ />
19
+ </template>
20
+ </FSChipGroup>
21
+ </template>
22
+
23
+ <script lang="ts">
24
+ import type { PropType} from "vue";
25
+ import { defineComponent } from "vue";
26
+ import { type RouteLocation } from "vue-router";
27
+
28
+ import type { SubgroupingInfos } from "@dative-gpi/foundation-core-domain/models";
29
+
30
+ import FSSubgroupingChip from "@dative-gpi/foundation-shared-components/components/FSSubgroupingChip.vue";
31
+ import FSChipGroup from "@dative-gpi/foundation-shared-components/components/FSChipGroup.vue";
32
+ import { ChipGroupVariants, type ChipGroupVariant } from "@dative-gpi/foundation-shared-components/models";
33
+
34
+ export default defineComponent({
35
+ name: "FSSubgroupingsChipGroup",
36
+ components: {
37
+ FSSubgroupingChip,
38
+ FSChipGroup
39
+ },
40
+ props: {
41
+ subgroupings: {
42
+ type: Array as PropType<SubgroupingInfos[]>,
43
+ required: true
44
+ },
45
+ itemTo: {
46
+ type: Function as PropType<(item: SubgroupingInfos) => Partial<RouteLocation>>,
47
+ required: false
48
+ },
49
+ maxItems: {
50
+ type: Number as PropType<number | null>,
51
+ required: false,
52
+ default: 1
53
+ },
54
+ variant: {
55
+ type: String as PropType<ChipGroupVariant>,
56
+ required: false,
57
+ default: ChipGroupVariants.Menu
58
+ },
59
+ }
60
+ });
61
+ </script>
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <FSTileList
3
+ :items="subgroupings"
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
+ <FSSubgroupingTileUI
14
+ :icon="item.icon"
15
+ :label="item.label"
16
+ :code="item.code"
17
+ :groupingLabel="item.groupingLabel"
18
+ :groupingIcon="item.groupingIcon"
19
+ :groupingColor="item.groupingColor"
20
+ :deviceOrganisationsCount="item.deviceOrganisationsCount"
21
+ :width="direction === ListDirections.Column ? 'fill' : undefined"
22
+ :selectable="$props.selectable"
23
+ :modelValue="($props.modelValue ?? []).includes(item.id)"
24
+ @update:modelValue="toggleSelect(item)"
25
+ />
26
+ </template>
27
+ </FSTileList>
28
+ </template>
29
+
30
+ <script lang="ts">
31
+ import { defineComponent, type PropType, watch } from "vue";
32
+
33
+ import type { SubgroupingFilters } from "@dative-gpi/foundation-core-domain/models";
34
+ import { useSubgroupings } from "@dative-gpi/foundation-core-services/composables";
35
+
36
+ import FSSubgroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSSubgroupingTileUI.vue";
37
+ import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
38
+
39
+ import { ListDirections } from "@dative-gpi/foundation-shared-domain/enums";
40
+
41
+ export default defineComponent({
42
+ name: "FSTileSubgroupingsList",
43
+ components: {
44
+ FSTileList,
45
+ FSSubgroupingTileUI
46
+ },
47
+ props: {
48
+ subgroupingFilters: {
49
+ type: Object as PropType<SubgroupingFilters>,
50
+ required: false,
51
+ default: () => ({})
52
+ },
53
+ modelValue: {
54
+ type: Array as PropType<string[]>,
55
+ required: false,
56
+ default: () => []
57
+ },
58
+ selectable: {
59
+ type: Boolean,
60
+ required: false,
61
+ default: false
62
+ }
63
+ },
64
+ emits: ["update:modelValue"],
65
+ setup(props) {
66
+ const { entities: subgroupings, getMany, fetching } = useSubgroupings();
67
+
68
+ const fetch = () => {
69
+ getMany(props.subgroupingFilters);
70
+ };
71
+
72
+ watch(() => props.subgroupingFilters, fetch, { immediate: true });
73
+
74
+ return {
75
+ subgroupings,
76
+ fetching,
77
+ ListDirections
78
+ };
79
+ }
80
+ });
81
+ </script>
@@ -50,6 +50,13 @@
50
50
  :value="item.allowSms"
51
51
  />
52
52
  </template>
53
+ <template
54
+ #item.allowNotifications="{ item }"
55
+ >
56
+ <FSIconCheck
57
+ :value="item.allowNotifications"
58
+ />
59
+ </template>
53
60
  <template
54
61
  #item.tags="{ item }"
55
62
  >
@@ -77,6 +84,15 @@
77
84
  {{ userTypeLabel(item.userType) }}
78
85
  </FSSpan>
79
86
  </template>
87
+ <template
88
+ #item.lastActivity="{ item }"
89
+ >
90
+ <FSSpan
91
+ font="text-overline"
92
+ >
93
+ {{ epochToLongTimeFormat(item.lastActivity) }}
94
+ </FSSpan>
95
+ </template>
80
96
  <template
81
97
  #item.tile="{ index, item, toggleSelect }"
82
98
  >
@@ -97,6 +113,8 @@ import { defineComponent, type PropType, watch } from "vue";
97
113
  import { type RouteLocation } from "vue-router";
98
114
  import _ from "lodash";
99
115
 
116
+ import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
117
+
100
118
  import type { UserOrganisationFilters, UserOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
101
119
  import { userTypeLabel, userValidityLabel } from "@dative-gpi/foundation-core-components/utils";
102
120
  import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
@@ -149,6 +167,7 @@ export default defineComponent({
149
167
  emits: ["update:modelValue"],
150
168
  setup(props) {
151
169
  const { getMany: fetchUserOrganisations, entities: userOrganisations, fetching: fetchingUserOrganisations } = useUserOrganisations();
170
+ const { epochToLongTimeFormat } = useDateFormat();
152
171
 
153
172
  const isSelected = (id: string): boolean => {
154
173
  return props.modelValue.includes(id);
@@ -165,7 +184,8 @@ export default defineComponent({
165
184
  userOrganisations,
166
185
  userValidityLabel,
167
186
  userTypeLabel,
168
- isSelected
187
+ isSelected,
188
+ epochToLongTimeFormat,
169
189
  };
170
190
  }
171
191
  });
@@ -12,7 +12,7 @@
12
12
  <FSChipGroup
13
13
  v-else
14
14
  :color="ColorEnum.Light"
15
- :labels="userOrganisations?.map(u => u.name)"
15
+ :items="userOrganisations?.map(u => u.name)"
16
16
  v-bind="$attrs"
17
17
  />
18
18
  </template>
@@ -28,7 +28,7 @@ import FSLoader from "@dative-gpi/foundation-shared-components/components/FSLoad
28
28
  import FSChipGroup from "@dative-gpi/foundation-shared-components/components/FSChipGroup.vue";
29
29
 
30
30
  export default defineComponent({
31
- name: "FSChipUserOrganisationsList",
31
+ name: "FSUserOrganisationsChipGroup",
32
32
  components: {
33
33
  FSChipGroup,
34
34
  FSLoader,
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <FSLoadTile
3
+ v-if="getting"
4
+ :selectable="$props.selectable"
5
+ :modelValue="$props.modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ <FSGroupingTileUI
9
+ v-else-if="entity"
10
+ :icon="entity.icon"
11
+ :iconColor="entity.color"
12
+ :label="entity.label"
13
+ :code="entity.code"
14
+ :subgroupingCount="entity.subgroupingCount"
15
+ :selectable="$props.selectable"
16
+ :modelValue="$props.modelValue"
17
+ @update:modelValue="$emit('update:modelValue', $event)"
18
+ v-bind="$attrs"
19
+ />
20
+ </template>
21
+
22
+ <script lang="ts">
23
+ import { defineComponent, watch } from "vue";
24
+
25
+ import { useGrouping } from "@dative-gpi/foundation-core-services/composables";
26
+
27
+ import FSGroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSGroupingTileUI.vue";
28
+ import FSLoadTile from "@dative-gpi/foundation-shared-components/components/tiles/FSLoadTile.vue";
29
+
30
+ export default defineComponent({
31
+ name: "FSGroupingTile",
32
+ components: {
33
+ FSGroupingTileUI,
34
+ FSLoadTile
35
+ },
36
+ props: {
37
+ groupingId: {
38
+ type: String,
39
+ required: true
40
+ },
41
+ modelValue: {
42
+ type: Boolean,
43
+ required: false,
44
+ default: false
45
+ },
46
+ selectable: {
47
+ type: Boolean,
48
+ required: false,
49
+ default: true
50
+ }
51
+ },
52
+ emits: ["update:modelValue"],
53
+ inheritAttrs: false,
54
+ setup(props) {
55
+ const { get, getting, entity } = useGrouping();
56
+
57
+ watch(() => props.groupingId, () => {
58
+ get(props.groupingId);
59
+ }, { immediate: true });
60
+
61
+ return {
62
+ getting,
63
+ entity
64
+ };
65
+ }
66
+ });
67
+ </script>
@@ -11,7 +11,7 @@
11
11
  :label="entity.label"
12
12
  :code="entity.code"
13
13
  :color="entity.color"
14
- :address="entity.address.placeLabel"
14
+ :address="entity.address.formattedAddress"
15
15
  :deviceCount="entity.deviceOrganisationsCount"
16
16
  :selectable="$props.selectable"
17
17
  :modelValue="modelValue"
@@ -51,6 +51,7 @@ export default defineComponent({
51
51
  }
52
52
  },
53
53
  emits: ['update:modelValue'],
54
+ inheritAttrs: false,
54
55
  setup(props) {
55
56
  const { get, getting, entity } = useLocation();
56
57
 
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <FSLoadTile
3
+ v-if="getting"
4
+ :selectable="$props.selectable"
5
+ :modelValue="$props.modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ <PlaylistTileUI
9
+ v-else-if="entity"
10
+ :dashboardsCount="entity.dashboards?.length ?? 0"
11
+ :looped="entity.looped"
12
+ :delay="entity.delay"
13
+ :label="entity.label"
14
+ :code="entity.code"
15
+ :selectable="$props.selectable"
16
+ :modelValue="$props.modelValue"
17
+ @update:modelValue="$emit('update:modelValue', $event)"
18
+ v-bind="$attrs"
19
+ >
20
+ <template
21
+ v-for="(_, name) in $slots"
22
+ v-slot:[name]="slotData"
23
+ >
24
+ <slot
25
+ :name="name"
26
+ v-bind="slotData"
27
+ />
28
+ </template>
29
+ </PlaylistTileUI>
30
+ </template>
31
+
32
+ <script lang="ts">
33
+ import { defineComponent, watch } from "vue";
34
+
35
+ import { usePlaylist } from "@dative-gpi/foundation-core-services/composables";
36
+
37
+ import FSLoadTile from "@dative-gpi/foundation-shared-components/components/tiles/FSLoadTile.vue";
38
+
39
+ import PlaylistTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSPlaylistTileUI.vue";
40
+
41
+
42
+ export default defineComponent({
43
+ name: "FSPlaylistTile",
44
+ components: {
45
+ PlaylistTileUI,
46
+ FSLoadTile
47
+ },
48
+ props: {
49
+ playlistId: {
50
+ type: String,
51
+ required: true
52
+ },
53
+ modelValue: {
54
+ type: Boolean,
55
+ required: false,
56
+ default: false
57
+ },
58
+ selectable: {
59
+ type: Boolean,
60
+ required: false,
61
+ default: false
62
+ },
63
+ },
64
+ emits: ["update:modelValue"],
65
+ setup(props) {
66
+ const { get, getting, entity } = usePlaylist();
67
+
68
+ watch(() => props.playlistId, () => {
69
+ get(props.playlistId);
70
+ }, { immediate: true });
71
+
72
+ return {
73
+ getting,
74
+ entity
75
+ };
76
+ }
77
+ });
78
+ </script>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <FSLoadTile
3
+ v-if="getting"
4
+ :selectable="$props.selectable"
5
+ :modelValue="$props.modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ <FSSubgroupingTileUI
9
+ v-else-if="entity"
10
+ :icon="entity.icon"
11
+ :label="entity.label"
12
+ :code="entity.code"
13
+ :groupingLabel="entity.groupingLabel"
14
+ :groupingIcon="entity.groupingIcon"
15
+ :groupingColor="entity.groupingColor"
16
+ :deviceOrganisationsCount="entity.deviceOrganisationsCount"
17
+ :selectable="$props.selectable"
18
+ :modelValue="$props.modelValue"
19
+ @update:modelValue="$emit('update:modelValue', $event)"
20
+ v-bind="$attrs"
21
+ />
22
+ </template>
23
+
24
+ <script lang="ts">
25
+ import { defineComponent, watch } from "vue";
26
+
27
+ import { useSubgrouping } from "@dative-gpi/foundation-core-services/composables";
28
+
29
+ import FSSubgroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSSubgroupingTileUI.vue";
30
+ import FSLoadTile from "@dative-gpi/foundation-shared-components/components/tiles/FSLoadTile.vue";
31
+
32
+ export default defineComponent({
33
+ name: "FSSubgroupingTile",
34
+ components: {
35
+ FSSubgroupingTileUI,
36
+ FSLoadTile
37
+ },
38
+ props: {
39
+ subgroupingId: {
40
+ type: String,
41
+ required: true
42
+ },
43
+ modelValue: {
44
+ type: Boolean,
45
+ required: false,
46
+ default: false
47
+ },
48
+ selectable: {
49
+ type: Boolean,
50
+ required: false,
51
+ default: true
52
+ }
53
+ },
54
+ emits: ["update:modelValue"],
55
+ inheritAttrs: false,
56
+ setup(props) {
57
+ const { get, getting, entity } = useSubgrouping();
58
+
59
+ watch(() => props.subgroupingId, () => {
60
+ get(props.subgroupingId);
61
+ }, { immediate: true });
62
+
63
+ return {
64
+ getting,
65
+ entity
66
+ };
67
+ }
68
+ });
69
+ </script>