@dative-gpi/foundation-core-components 1.0.185 → 1.0.186-tile-list-5

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,99 @@
1
+ <template>
2
+ <component
3
+ :is="component"
4
+ v-bind="componentProps"
5
+ />
6
+ </template>
7
+
8
+ <script lang="ts">
9
+ import { computed, defineAsyncComponent, defineComponent, type PropType, type Component } from "vue";
10
+ import { EntityType } from "@/shared/foundation-shared-domain/enums";
11
+
12
+
13
+ export default defineComponent({
14
+ name: "FSTileEntitiesList",
15
+ components: {
16
+ },
17
+ props: {
18
+ entityType: {
19
+ type: Number as PropType<EntityType>,
20
+ required: true
21
+ },
22
+ filters: {
23
+ type: Object,
24
+ required: false,
25
+ default: null
26
+ }
27
+ },
28
+ setup(props, { attrs }) {
29
+ const component = computed<Component | null>(() => {
30
+ switch(props.entityType) {
31
+ case EntityType.Device:
32
+ return defineAsyncComponent(() => import("../lists/deviceOrganisations/FSTileDeviceOrganisationsList.vue"));
33
+ case EntityType.Dashboard:
34
+ return defineAsyncComponent(() => import("../lists/dashboards/FSTileDashboardsList.vue"));
35
+ case EntityType.Folder:
36
+ return defineAsyncComponent(() => import("../lists/folders/FSTileFoldersList.vue"));
37
+ case EntityType.User:
38
+ return defineAsyncComponent(() => import("../lists/userOrganisations/FSTileUserOrganisationsList.vue"));
39
+ case EntityType.Group:
40
+ return defineAsyncComponent(() => import("../lists/groups/FSTileGroupsList.vue"));
41
+ case EntityType.Location:
42
+ return defineAsyncComponent(() => import("../lists/locations/FSTileLocationsList.vue"));
43
+ case EntityType.Model:
44
+ return defineAsyncComponent(() => import("../lists/models/FSTileModelsList.vue"));
45
+ default:
46
+ return null;
47
+ };
48
+ });
49
+
50
+ const componentProps = computed(() => {
51
+ switch(props.entityType) {
52
+ case EntityType.Device:
53
+ return {
54
+ ...attrs,
55
+ deviceOrganisationFilters : props.filters
56
+ };
57
+ case EntityType.Dashboard:
58
+ return {
59
+ ...attrs,
60
+ dashboardOrganisationFilters : props.filters,
61
+ dashboardOrganisationTypeFilters : props.filters
62
+ };
63
+ case EntityType.Folder:
64
+ return {
65
+ ...attrs,
66
+ folderFilters : props.filters
67
+ };
68
+ case EntityType.User:
69
+ return {
70
+ ...attrs,
71
+ userFilters : props.filters
72
+ };
73
+ case EntityType.Group:
74
+ return {
75
+ ...attrs,
76
+ groupFilters : props.filters
77
+ };
78
+ case EntityType.Location:
79
+ return {
80
+ ...attrs,
81
+ locationFilters : props.filters
82
+ };
83
+ case EntityType.Model:
84
+ return {
85
+ ...attrs,
86
+ modelFilters : props.filters
87
+ };
88
+ default:
89
+ return null;
90
+ }
91
+ });
92
+
93
+ return {
94
+ component,
95
+ componentProps
96
+ };
97
+ },
98
+ });
99
+ </script>
@@ -0,0 +1,154 @@
1
+ <template>
2
+ <FSTileList
3
+ :items="dashboards"
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
+ #item.tile="{ item, toggleSelect }"
13
+ >
14
+ <FSDashboardOrganisationTileUI
15
+ v-if="item.dashboardType === DashboardType.Organisation"
16
+ :code="item.code"
17
+ :icon="item.icon"
18
+ :label="item.label"
19
+ :imageId="item.imageId"
20
+ :selectable="$props.selectable"
21
+ :bottomColor="item.colors"
22
+ :modelValue="($props.modelValue ?? []).includes(item.id)"
23
+ @update:modelValue="toggleSelect(item)"
24
+ />
25
+ <FSDashboardOrganisationTypeTileUI
26
+ v-else-if="item.dashboardType === DashboardType.OrganisationType"
27
+ :code="item.code"
28
+ :icon="item.icon"
29
+ :label="item.label"
30
+ :imageId="item.imageId"
31
+ :selectable="$props.selectable"
32
+ :bottomColor="item.colors"
33
+ :modelValue="($props.modelValue ?? []).includes(item.id)"
34
+ @update:modelValue="toggleSelect(item)"
35
+ />
36
+ <FSDashboardShallowTileUI
37
+ v-else-if="item.dashboardType === DashboardType.Shallow"
38
+ :code="item.code"
39
+ :icon="item.icon"
40
+ :label="item.label"
41
+ :imageId="item.imageId"
42
+ :selectable="$props.selectable"
43
+ :bottomColor="item.colors"
44
+ :modelValue="($props.modelValue ?? []).includes(item.id)"
45
+ @update:modelValue="toggleSelect(item)"
46
+ />
47
+ </template>
48
+ </FSTileList>
49
+ </template>
50
+
51
+ <script lang="ts">
52
+ import { defineComponent, type PropType, watch, computed } from "vue";
53
+ import _ from "lodash";
54
+
55
+ import type { DashboardOrganisationFilters, DashboardOrganisationTypeFilters, DashboardShallowFilters } from "@dative-gpi/foundation-core-domain/models";
56
+ import { useDashboardOrganisations, useDashboardOrganisationTypes, useDashboardShallows } from "@dative-gpi/foundation-core-services/composables";
57
+
58
+ import { DashboardType } from '@dative-gpi/foundation-shared-domain/enums';
59
+ import type { DashboardsListItem } from '@dative-gpi/foundation-core-components/utils';
60
+
61
+ import FSDashboardOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTileUI.vue";
62
+ import FSDashboardOrganisationTypeTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTypeTileUI.vue";
63
+ import FSDashboardShallowTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardShallowTileUI.vue";
64
+ import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
65
+
66
+ export default defineComponent({
67
+ name: "FSTileDashboardsList",
68
+ components: {
69
+ FSTileList,
70
+ FSDashboardOrganisationTileUI,
71
+ FSDashboardOrganisationTypeTileUI,
72
+ FSDashboardShallowTileUI
73
+ },
74
+ props: {
75
+ dashboardOrganisationFilters: {
76
+ type: Object as PropType<DashboardOrganisationFilters>,
77
+ required: false,
78
+ default: () => ({})
79
+ },
80
+ dashboardOrganisationTypeFilters: {
81
+ type: Object as PropType<DashboardOrganisationTypeFilters>,
82
+ required: false,
83
+ default: () => ({})
84
+ },
85
+ dashboardShallowFilters: {
86
+ type: Object as PropType<DashboardShallowFilters>,
87
+ required: false,
88
+ default: () => ({})
89
+ },
90
+ selectable: {
91
+ type: Boolean,
92
+ required: false,
93
+ default: false
94
+ },
95
+ singleSelect: {
96
+ type: Boolean,
97
+ required: false,
98
+ default: false
99
+ },
100
+ modelValue: {
101
+ type: Array as PropType<string[]>,
102
+ required: false,
103
+ default: () => []
104
+ }
105
+ },
106
+ emits: ["update:modelValue"],
107
+ setup(props) {
108
+ const { entities: dashboardOrganisations,
109
+ getMany: getManyDashboardOrganisations,
110
+ fetching: fetchingDashboardOrganisations } = useDashboardOrganisations();
111
+ const { entities: dashboardOrganisationTypes,
112
+ getMany: getManyDashboardOrganisationTypes,
113
+ fetching: fetchingDashboardOrganisationTypes } = useDashboardOrganisationTypes();
114
+ const { entities: dashboardShallows,
115
+ getMany: getManyDashboardShallows,
116
+ fetching: fetchingDashboardShallows } = useDashboardShallows();
117
+
118
+ const fetching = computed(() => fetchingDashboardOrganisations.value
119
+ || fetchingDashboardOrganisationTypes.value
120
+ || fetchingDashboardShallows.value);
121
+
122
+ const dashboards = computed((): DashboardsListItem[] => {
123
+ return _.sortBy([
124
+ ...dashboardOrganisationTypes.value.map(g => ({
125
+ ...g,
126
+ dashboardType: DashboardType.OrganisationType
127
+ })) satisfies DashboardsListItem[],
128
+ ...dashboardOrganisations.value.map(d => ({
129
+ ...d,
130
+ dashboardType: DashboardType.Organisation
131
+ })) as DashboardsListItem[],
132
+ ...dashboardShallows.value.map(d => ({
133
+ ...d,
134
+ dashboardType: DashboardType.Shallow
135
+ })) as DashboardsListItem[]
136
+ ], d => d.label);
137
+ });
138
+
139
+ const fetch = () => {
140
+ getManyDashboardOrganisations(props.dashboardOrganisationFilters);
141
+ getManyDashboardOrganisationTypes(props.dashboardOrganisationTypeFilters);
142
+ getManyDashboardShallows(props.dashboardShallowFilters);
143
+ };
144
+
145
+ watch(() => [props.dashboardOrganisationFilters, props.dashboardOrganisationTypeFilters, props.dashboardShallowFilters], fetch, { immediate: true });
146
+
147
+ return {
148
+ dashboards,
149
+ fetching,
150
+ DashboardType
151
+ };
152
+ }
153
+ });
154
+ </script>
@@ -0,0 +1,90 @@
1
+ <template>
2
+ <FSTileList
3
+ :items="deviceOrganisations"
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
+ #item.tile="{ item, toggleSelect }"
13
+ >
14
+ <FSDeviceOrganisationTileUI
15
+ :imageId="item.imageId"
16
+ :label="item.label"
17
+ :code="item.code"
18
+ :deviceConnectivity="item.connectivity"
19
+ :deviceWorstAlert="item.worstAlert"
20
+ :deviceAlerts="item.alerts"
21
+ :modelStatuses="item.modelStatuses"
22
+ :deviceStatuses="item.status?.statuses"
23
+ :selectable="$props.selectable"
24
+ :alertTo="$props.alertTo"
25
+ :modelValue="($props.modelValue ?? []).includes(item.id)"
26
+ @update:modelValue="toggleSelect(item)"
27
+ />
28
+ </template>
29
+ </FSTileList>
30
+ </template>
31
+
32
+ <script lang="ts">
33
+ import { defineComponent, type PropType, watch } from "vue";
34
+
35
+ import type { DeviceOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
36
+ import { useDeviceOrganisations } from "@dative-gpi/foundation-core-services/composables";
37
+
38
+ import FSDeviceOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDeviceOrganisationTileUI.vue";
39
+ import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
40
+
41
+ export default defineComponent({
42
+ name: "FSTileDeviceOrganisationsList",
43
+ components: {
44
+ FSTileList,
45
+ FSDeviceOrganisationTileUI
46
+ },
47
+ props: {
48
+ deviceOrganisationFilters: {
49
+ type: Object as PropType<DeviceOrganisationFilters>,
50
+ required: false,
51
+ default: () => ({})
52
+ },
53
+ selectable: {
54
+ type: Boolean,
55
+ required: false,
56
+ default: false
57
+ },
58
+ singleSelect: {
59
+ type: Boolean,
60
+ required: false,
61
+ default: false
62
+ },
63
+ alertTo: {
64
+ type: Function,
65
+ required: false,
66
+ default: null
67
+ },
68
+ modelValue: {
69
+ type: Array as PropType<string[]>,
70
+ required: false,
71
+ default: () => []
72
+ }
73
+ },
74
+ emits: ["update:modelValue"],
75
+ setup(props) {
76
+ const { entities: deviceOrganisations, getMany, fetching } = useDeviceOrganisations();
77
+
78
+ const fetch = () => {
79
+ getMany(props.deviceOrganisationFilters);
80
+ };
81
+
82
+ watch(() => props.deviceOrganisationFilters, fetch, { immediate: true });
83
+
84
+ return {
85
+ deviceOrganisations,
86
+ fetching
87
+ };
88
+ }
89
+ });
90
+ </script>
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <FSTileList
3
+ :items="folders"
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
+ #item.tile="{ item, toggleSelect }"
13
+ >
14
+ <FSFolderTileUI
15
+ :code="item.code"
16
+ :icon="item.icon"
17
+ :label="item.label"
18
+ :imageId="item.imageId"
19
+ :bottomColor="item.colors"
20
+ :recursiveFoldersIds="item.recursiveFoldersIds"
21
+ :recursiveDashboardsIds="item.recursiveDashboardsIds"
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 { FolderFilters } from "@dative-gpi/foundation-core-domain/models";
34
+ import { useFolders } from "@dative-gpi/foundation-core-services/composables";
35
+
36
+ import FSFolderTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSFolderTileUI.vue";
37
+ import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
38
+
39
+ export default defineComponent({
40
+ name: "FSTileFoldersList",
41
+ components: {
42
+ FSTileList,
43
+ FSFolderTileUI
44
+ },
45
+ props: {
46
+ folderFilters: {
47
+ type: Object as PropType<FolderFilters>,
48
+ required: false,
49
+ default: () => ({})
50
+ },
51
+ selectable: {
52
+ type: Boolean,
53
+ required: false,
54
+ default: false
55
+ },
56
+ singleSelect: {
57
+ type: Boolean,
58
+ required: false,
59
+ default: false
60
+ },
61
+ modelValue: {
62
+ type: Array as PropType<string[]>,
63
+ required: false,
64
+ default: () => []
65
+ }
66
+ },
67
+ emits: ["update:modelValue"],
68
+ setup(props) {
69
+ const { entities: folders, getMany, fetching } = useFolders();
70
+
71
+ const fetch = () => {
72
+ getMany(props.folderFilters);
73
+ };
74
+
75
+ watch(() => props.folderFilters, fetch, { immediate: true });
76
+
77
+ return {
78
+ folders,
79
+ fetching
80
+ };
81
+ }
82
+ });
83
+ </script>
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <FSTileList
3
+ :items="groups"
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
+ #item.tile="{ item, toggleSelect }"
13
+ >
14
+ <FSGroupTileUI
15
+ :imageId="item.imageId"
16
+ :label="item.label"
17
+ :code="item.code"
18
+ :recursiveGroupsIds="item.recursiveGroupsIds"
19
+ :recursiveDeviceOrganisationsIds="item.recursiveDeviceOrganisationsIds"
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 { GroupFilters } from "@dative-gpi/foundation-core-domain/models";
32
+ import { useGroups } from "@dative-gpi/foundation-core-services/composables";
33
+
34
+ import FSGroupTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSGroupTileUI.vue";
35
+ import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
36
+
37
+ export default defineComponent({
38
+ name: "FSTileGroupsList",
39
+ components: {
40
+ FSTileList,
41
+ FSGroupTileUI
42
+ },
43
+ props: {
44
+ groupFilters: {
45
+ type: Object as PropType<GroupFilters>,
46
+ required: false,
47
+ default: () => ({})
48
+ },
49
+ selectable: {
50
+ type: Boolean,
51
+ required: false,
52
+ default: false
53
+ },
54
+ singleSelect: {
55
+ type: Boolean,
56
+ required: false,
57
+ default: false
58
+ },
59
+ modelValue: {
60
+ type: Array as PropType<string[]>,
61
+ required: false,
62
+ default: () => []
63
+ }
64
+ },
65
+ emits: ["update:modelValue"],
66
+ setup(props) {
67
+ const { entities: groups, getMany, fetching } = useGroups();
68
+
69
+ const fetch = () => {
70
+ getMany(props.groupFilters);
71
+ };
72
+
73
+ watch(() => props.groupFilters, fetch, { immediate: true });
74
+
75
+ return {
76
+ groups,
77
+ fetching
78
+ };
79
+ }
80
+ });
81
+ </script>
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <FSTileList
3
+ :items="locations"
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
+ #item.tile="{ item, toggleSelect }"
13
+ >
14
+ <FSLocationTileUI
15
+ :icon="item.icon"
16
+ :label="item.label"
17
+ :code="item.code"
18
+ :color="item.color"
19
+ :address="item.address?.placeLabel"
20
+ :deviceCount="item.deviceOrganisationsCount"
21
+ :selectable="$props.selectable"
22
+ :modelValue="($props.modelValue ?? []).includes(item.id)"
23
+ @update:modelValue="toggleSelect(item)"
24
+ />
25
+ </template>
26
+ </FSTileList>
27
+ </template>
28
+
29
+ <script lang="ts">
30
+ import { defineComponent, type PropType, watch } from "vue";
31
+
32
+ import type { LocationFilters } from "@dative-gpi/foundation-core-domain/models";
33
+ import { useLocations } from "@dative-gpi/foundation-core-services/composables";
34
+
35
+ import FSLocationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSLocationTileUI.vue";
36
+ import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
37
+
38
+ export default defineComponent({
39
+ name: "FSTileLocationsList",
40
+ components: {
41
+ FSTileList,
42
+ FSLocationTileUI
43
+ },
44
+ props: {
45
+ locationFilters: {
46
+ type: Object as PropType<LocationFilters>,
47
+ required: false,
48
+ default: () => ({})
49
+ },
50
+ selectable: {
51
+ type: Boolean,
52
+ required: false,
53
+ default: false
54
+ },
55
+ singleSelect: {
56
+ type: Boolean,
57
+ required: false,
58
+ default: false
59
+ },
60
+ modelValue: {
61
+ type: Array as PropType<string[]>,
62
+ required: false,
63
+ default: () => []
64
+ }
65
+ },
66
+ emits: ["update:modelValue"],
67
+ setup(props) {
68
+ const { entities: locations, getMany, fetching } = useLocations();
69
+
70
+ const fetch = () => {
71
+ getMany(props.locationFilters);
72
+ };
73
+
74
+ watch(() => props.locationFilters, fetch, { immediate: true });
75
+
76
+ return {
77
+ locations,
78
+ fetching
79
+ };
80
+ }
81
+ });
82
+ </script>
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <FSTileList
3
+ :items="models"
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
+ #item.tile="{ item, toggleSelect }"
13
+ >
14
+ <FSModelTileUI
15
+ :imageId="item.imageId"
16
+ :label="item.label"
17
+ :code="item.code"
18
+ :selectable="$props.selectable"
19
+ :modelValue="($props.modelValue ?? []).includes(item.id)"
20
+ @update:modelValue="toggleSelect(item)"
21
+ />
22
+ </template>
23
+ </FSTileList>
24
+ </template>
25
+
26
+ <script lang="ts">
27
+ import { defineComponent, type PropType, watch } from "vue";
28
+
29
+ import type { ModelFilters } from "@dative-gpi/foundation-core-domain/models";
30
+ import { useModels } from "@dative-gpi/foundation-core-services/composables";
31
+
32
+ import FSModelTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSModelTileUI.vue";
33
+ import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
34
+
35
+ export default defineComponent({
36
+ name: "FSTileModelsList",
37
+ components: {
38
+ FSTileList,
39
+ FSModelTileUI
40
+ },
41
+ props: {
42
+ modelFilters: {
43
+ type: Object as PropType<ModelFilters>,
44
+ required: false,
45
+ default: () => ({})
46
+ },
47
+ selectable: {
48
+ type: Boolean,
49
+ required: false,
50
+ default: false
51
+ },
52
+ singleSelect: {
53
+ type: Boolean,
54
+ required: false,
55
+ default: false
56
+ },
57
+ modelValue: {
58
+ type: Array as PropType<string[]>,
59
+ required: false,
60
+ default: () => []
61
+ }
62
+ },
63
+ emits: ["update:modelValue"],
64
+ setup(props) {
65
+ const { entities: models, getMany, fetching } = useModels();
66
+
67
+ const fetch = () => {
68
+ getMany(props.modelFilters);
69
+ };
70
+
71
+ watch(() => props.modelFilters, fetch, { immediate: true });
72
+
73
+ return {
74
+ models,
75
+ fetching
76
+ };
77
+ }
78
+ });
79
+ </script>
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <FSTileList
3
+ :items="userOrganisations"
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
+ #item.tile="{ item, toggleSelect }"
13
+ >
14
+ <FSUserOrganisationTileUI
15
+ :imageId="item.imageId"
16
+ :name="item.name"
17
+ :roleLabel="item.roleLabel"
18
+ :roleIcon="item.roleIcon"
19
+ :admin="item.admin"
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 { UserOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
32
+ import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
33
+
34
+ import FSUserOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSUserOrganisationTileUI.vue";
35
+ import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
36
+
37
+ export default defineComponent({
38
+ name: "FSTileUserOrganisationsList",
39
+ components: {
40
+ FSTileList,
41
+ FSUserOrganisationTileUI
42
+ },
43
+ props: {
44
+ userOrganisationFilters: {
45
+ type: Object as PropType<UserOrganisationFilters>,
46
+ required: false,
47
+ default: () => ({})
48
+ },
49
+ selectable: {
50
+ type: Boolean,
51
+ required: false,
52
+ default: false
53
+ },
54
+ singleSelect: {
55
+ type: Boolean,
56
+ required: false,
57
+ default: false
58
+ },
59
+ modelValue: {
60
+ type: Array as PropType<string[]>,
61
+ required: false,
62
+ default: () => []
63
+ }
64
+ },
65
+ emits: ["update:modelValue"],
66
+ setup(props) {
67
+ const { entities: userOrganisations, getMany, fetching } = useUserOrganisations();
68
+
69
+ const fetch = () => {
70
+ getMany(props.userOrganisationFilters);
71
+ };
72
+
73
+ watch(() => props.userOrganisationFilters, fetch, { immediate: true });
74
+
75
+ return {
76
+ userOrganisations,
77
+ fetching
78
+ };
79
+ }
80
+ });
81
+ </script>
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-core-components",
3
+ "repository": {
4
+ "url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
5
+ },
3
6
  "sideEffects": false,
4
- "version": "1.0.185",
7
+ "version": "1.0.186-tile-list-5",
5
8
  "description": "",
6
9
  "publishConfig": {
7
10
  "access": "public"
@@ -10,11 +13,11 @@
10
13
  "author": "",
11
14
  "license": "ISC",
12
15
  "dependencies": {
13
- "@dative-gpi/foundation-core-domain": "1.0.185",
14
- "@dative-gpi/foundation-core-services": "1.0.185",
15
- "@dative-gpi/foundation-shared-components": "1.0.185",
16
- "@dative-gpi/foundation-shared-domain": "1.0.185",
17
- "@dative-gpi/foundation-shared-services": "1.0.185"
16
+ "@dative-gpi/foundation-core-domain": "1.0.186-tile-list-5",
17
+ "@dative-gpi/foundation-core-services": "1.0.186-tile-list-5",
18
+ "@dative-gpi/foundation-shared-components": "1.0.186-tile-list-5",
19
+ "@dative-gpi/foundation-shared-domain": "1.0.186-tile-list-5",
20
+ "@dative-gpi/foundation-shared-services": "1.0.186-tile-list-5"
18
21
  },
19
22
  "peerDependencies": {
20
23
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -26,5 +29,5 @@
26
29
  "sass": "1.71.1",
27
30
  "sass-loader": "13.3.2"
28
31
  },
29
- "gitHead": "b2b0c5c6f53ecc2da483b659bb48ece7d1112f95"
32
+ "gitHead": "8ddd95344bae8a58eab6a9dc7c73bf13ed517fbb"
30
33
  }