@dative-gpi/foundation-core-components 1.0.56 → 1.0.58-groupings

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 (82) hide show
  1. package/components/autocompletes/FSAutocompleteChart.vue +15 -8
  2. package/components/autocompletes/FSAutocompleteDashboard.vue +14 -6
  3. package/components/autocompletes/FSAutocompleteDashboardOrganisation.vue +7 -1
  4. package/components/autocompletes/FSAutocompleteDataCategory.vue +11 -5
  5. package/components/autocompletes/FSAutocompleteDataDefinition.vue +7 -1
  6. package/components/autocompletes/FSAutocompleteGroup.vue +7 -1
  7. package/components/autocompletes/FSAutocompleteLocation.vue +6 -0
  8. package/components/autocompletes/FSAutocompleteManufacturer.vue +8 -0
  9. package/components/autocompletes/FSAutocompleteModel.vue +9 -1
  10. package/components/autocompletes/FSAutocompleteOrganisationType.vue +7 -1
  11. package/components/autocompletes/FSAutocompleteRole.vue +14 -6
  12. package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +7 -1
  13. package/components/autocompletes/FSAutocompleteUserOrganisation.vue +9 -1
  14. package/components/customProperties/FSMetaField.vue +35 -40
  15. package/components/customProperties/FSMetaFormContent.vue +4 -3
  16. package/components/customProperties/FSMetaHistory.vue +2 -2
  17. package/components/customProperties/FSMetaValue.vue +63 -31
  18. package/components/customProperties/helpers.ts +57 -165
  19. package/components/entities/FSBaseEntitiesList.vue +14 -4
  20. package/components/entities/FSDialogSelectEntities.vue +28 -106
  21. package/components/entities/FSEntityField.vue +75 -14
  22. package/components/entities/FSSelectEntitiesList.vue +225 -0
  23. package/components/explorers/FSBaseDevicesExplorer.vue +312 -0
  24. package/components/explorers/FSBaseFoldersExplorer.vue +286 -0
  25. package/components/lists/FSDataTable.vue +23 -21
  26. package/components/lists/alerts/FSBaseAlertsList.vue +95 -97
  27. package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +4 -4
  28. package/components/lists/authTokens/FSBaseAuthTokensList.vue +6 -4
  29. package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +103 -38
  30. package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +104 -39
  31. package/components/lists/charts/FSBaseChartsList.vue +147 -66
  32. package/components/lists/comments/FSBaseCommentsList.vue +39 -23
  33. package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
  34. package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +39 -7
  35. package/components/lists/dashboards/FSBaseDashboardsList.vue +44 -13
  36. package/components/lists/dashboards/FSSimpleDashboardsList.vue +33 -7
  37. package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +6 -5
  38. package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +6 -4
  39. package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +179 -61
  40. package/components/lists/folders/FSBaseFoldersList.vue +37 -146
  41. package/components/lists/groupings/FSBaseGroupingsList.vue +117 -0
  42. package/components/lists/groups/FSBaseGroupsList.vue +24 -7
  43. package/components/lists/locations/FSBaseLocationsList.vue +52 -13
  44. package/components/lists/models/FSBaseModelsList.vue +45 -15
  45. package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +17 -10
  46. package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +28 -21
  47. package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +56 -13
  48. package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +56 -12
  49. package/components/lists/scenarios/FSBaseScenariosList.vue +122 -81
  50. package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +31 -18
  51. package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +128 -0
  52. package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +30 -19
  53. package/components/lists/userOrganisations/FSChipUserOrganisationsList.vue +61 -0
  54. package/components/tiles/FSChartTile.vue +71 -0
  55. package/components/tiles/FSDashboardOrganisationTile.vue +3 -3
  56. package/components/tiles/FSDashboardOrganisationTypeTile.vue +3 -3
  57. package/components/tiles/FSDashboardShallowTile.vue +3 -3
  58. package/components/tiles/FSDeviceOrganisationTile.vue +12 -5
  59. package/components/tiles/FSFolderTile.vue +3 -3
  60. package/components/tiles/FSGroupTile.vue +3 -3
  61. package/components/tiles/FSLocationTile.vue +5 -3
  62. package/components/tiles/FSModelTile.vue +64 -0
  63. package/components/tiles/FSServiceAccountOrganisationTile.vue +3 -3
  64. package/components/tiles/FSUserOrganisationTile.vue +3 -3
  65. package/components/treeviews/FSTreeViewFolder.vue +15 -3
  66. package/components/treeviews/FSTreeViewGroup.vue +22 -4
  67. package/package.json +9 -9
  68. package/utils/dashboards.ts +3 -3
  69. package/utils/index.ts +0 -1
  70. package/utils/roles.ts +3 -3
  71. package/utils/users.ts +3 -3
  72. package/components/selects/FSAggregationSelector.vue +0 -51
  73. package/components/selects/FSAxisTypeSelector.vue +0 -48
  74. package/components/selects/FSDisplayAsSelector.vue +0 -52
  75. package/components/selects/FSFilterTypeSelector.vue +0 -53
  76. package/components/selects/FSHeatmapRuleSelector.vue +0 -52
  77. package/components/selects/FSOperationOnSelector.vue +0 -51
  78. package/components/selects/FSPlanningTypeSelector.vue +0 -51
  79. package/components/selects/FSPlotPerSelector.vue +0 -51
  80. package/components/selects/FSSelectEntityType.vue +0 -59
  81. package/components/selects/FSSerieTypeSelector.vue +0 -51
  82. package/utils/charts.ts +0 -137
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <FSDataTable
3
+ :loading="fetchingServiceAccountRoleOrganisations"
4
+ :items="serviceAccountRoleOrganisations"
5
+ :selectable="$props.selectable"
6
+ :tableCode="$props.tableCode"
7
+ :itemTo="$props.itemTo"
8
+ :modelValue="$props.modelValue"
9
+ @update:modelValue="$emit('update:modelValue', $event)"
10
+ v-bind="$attrs"
11
+ >
12
+ <template
13
+ v-for="(_, name) in $slots"
14
+ v-slot:[name]="slotData"
15
+ >
16
+ <slot
17
+ :name="name"
18
+ v-bind="slotData"
19
+ />
20
+ </template>
21
+ <template
22
+ #item.icon="{ item }"
23
+ >
24
+ <FSIcon>
25
+ {{ item.icon }}
26
+ </FSIcon>
27
+ </template>
28
+ <template
29
+ #item.userType="{ item }"
30
+ >
31
+ <FSRow
32
+ align="center-left"
33
+ >
34
+ <FSIcon>
35
+ {{ userTypeIcon(item.userType) }}
36
+ </FSIcon>
37
+ <FSText>
38
+ {{ userTypeLabel(item.userType) }}
39
+ </FSText>
40
+ </FSRow>
41
+ </template>
42
+ <template
43
+ #item.tags="{ item }"
44
+ >
45
+ <FSTagGroup
46
+ variant="slide"
47
+ :showRemove="false"
48
+ :tags="item.tags"
49
+ />
50
+ </template>
51
+ </FSDataTable>
52
+ </template>
53
+
54
+ <script lang="ts">
55
+ import { defineComponent, type PropType, watch } from "vue";
56
+ import { type RouteLocation } from "vue-router";
57
+ import _ from "lodash";
58
+
59
+ import { type ServiceAccountRoleOrganisationFilters, type ServiceAccountRoleOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
60
+ import { useServiceAccountRoleOrganisations } from "@dative-gpi/foundation-core-services/composables";
61
+ import { userTypeIcon, userTypeLabel } from "@dative-gpi/foundation-core-components/utils";
62
+
63
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
64
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
65
+ import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
66
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
67
+
68
+ import FSDataTable from "../FSDataTable.vue";
69
+
70
+ export default defineComponent({
71
+ name: "FSBaseServiceAccountRoleOrganisationsList",
72
+ components: {
73
+ FSDataTable,
74
+ FSTagGroup,
75
+ FSIcon,
76
+ FSText,
77
+ FSRow
78
+ },
79
+ props: {
80
+ tableCode: {
81
+ type: String as PropType<string | null>,
82
+ required: false,
83
+ default: null
84
+ },
85
+ serviceAccountRoleOrganisationsFilters: {
86
+ type: Object as PropType<ServiceAccountRoleOrganisationFilters | null>,
87
+ required: false,
88
+ default: null
89
+ },
90
+ itemTo: {
91
+ type: Function as PropType<(item: ServiceAccountRoleOrganisationInfos) => Partial<RouteLocation>>,
92
+ required: false
93
+ },
94
+ selectable: {
95
+ type: Boolean,
96
+ required: false,
97
+ default: true
98
+ },
99
+ modelValue: {
100
+ type: Array as PropType<string[]>,
101
+ required: false,
102
+ default: () => []
103
+ }
104
+ },
105
+ emits: ["update:modelValue"],
106
+ setup(props) {
107
+ const { getMany: getManyServiceAccountRoleOrganisations, fetching: fetchingServiceAccountRoleOrganisations, entities: serviceAccountRoleOrganisations } = useServiceAccountRoleOrganisations();
108
+
109
+ const isSelected = (id: string): boolean => {
110
+ return props.modelValue.includes(id);
111
+ };
112
+
113
+ watch(() => props.serviceAccountRoleOrganisationsFilters, (next, previous) => {
114
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
115
+ getManyServiceAccountRoleOrganisations(props.serviceAccountRoleOrganisationsFilters ?? undefined);
116
+ }
117
+ }, { immediate: true });
118
+
119
+ return {
120
+ fetchingServiceAccountRoleOrganisations,
121
+ serviceAccountRoleOrganisations,
122
+ userTypeLabel,
123
+ userTypeIcon,
124
+ isSelected
125
+ };
126
+ }
127
+ });
128
+ </script>
@@ -3,8 +3,9 @@
3
3
  :items="userOrganisations"
4
4
  :itemTo="$props.itemTo"
5
5
  :loading="fetchingUserOrganisations"
6
- :modelValue="$props.modelValue"
6
+ :selectable="$props.selectable"
7
7
  :tableCode="$props.tableCode"
8
+ :modelValue="$props.modelValue"
8
9
  @update:modelValue="$emit('update:modelValue', $event)"
9
10
  v-bind="$attrs"
10
11
  >
@@ -17,6 +18,13 @@
17
18
  v-bind="slotData"
18
19
  />
19
20
  </template>
21
+ <template
22
+ #header.imageId-title
23
+ >
24
+ <FSIcon>
25
+ mdi-panorama-variant-outline
26
+ </FSIcon>
27
+ </template>
20
28
  <template
21
29
  #item.imageId="{ item }"
22
30
  >
@@ -25,6 +33,7 @@
25
33
  height="32px"
26
34
  width="32px"
27
35
  :imageId="item.imageId"
36
+ :thumbnail="true"
28
37
  />
29
38
  </template>
30
39
  <template
@@ -46,7 +55,7 @@
46
55
  >
47
56
  <FSTagGroup
48
57
  variant="slide"
49
- :editable="false"
58
+ :showRemove="false"
50
59
  :tags="item.tags"
51
60
  />
52
61
  </template>
@@ -72,24 +81,19 @@
72
81
  #item.tile="{ item, toggleSelect }"
73
82
  >
74
83
  <FSUserOrganisationTileUI
75
- :roleLabel="item.roleLabel"
76
- :roleIcon="item.roleIcon"
77
- :userType="item.userType"
78
- :imageId="item.imageId"
79
- :admin="item.admin"
80
- :name="item.name"
81
84
  :to="$props.itemTo && $props.itemTo(item)"
85
+ :selectable="$props.selectable"
82
86
  :modelValue="isSelected(item.id)"
83
87
  @update:modelValue="toggleSelect(item)"
88
+ v-bind="item"
84
89
  />
85
90
  </template>
86
91
  </FSDataTable>
87
92
  </template>
88
93
 
89
94
  <script lang="ts">
90
- import type { PropType} from "vue";
91
- import { defineComponent, watch } from "vue";
92
- import type { RouteLocation } from "vue-router";
95
+ import { defineComponent, type PropType, watch } from "vue";
96
+ import { type RouteLocation } from "vue-router";
93
97
  import _ from "lodash";
94
98
 
95
99
  import type { UserOrganisationFilters, UserOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
@@ -97,6 +101,7 @@ import { userTypeLabel, userValidityLabel } from "@dative-gpi/foundation-core-co
97
101
  import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
98
102
 
99
103
  import FSDataTable from "../FSDataTable.vue";
104
+
100
105
  import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
101
106
  import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
102
107
  import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
@@ -115,23 +120,29 @@ export default defineComponent({
115
120
 
116
121
  },
117
122
  props: {
118
- userOrganisationsFilters: {
119
- type: Object as PropType<UserOrganisationFilters | null>,
123
+ tableCode: {
124
+ type: String as PropType<string | null>,
120
125
  required: false,
121
126
  default: null
122
127
  },
123
- modelValue: {
124
- type: Array as PropType<string[]>,
128
+ userOrganisationsFilters: {
129
+ type: Object as PropType<UserOrganisationFilters | null>,
125
130
  required: false,
126
- default: () => []
131
+ default: null
127
132
  },
128
133
  itemTo: {
129
134
  type: Function as PropType<(item: UserOrganisationInfos) => Partial<RouteLocation>>,
130
135
  required: false
131
136
  },
132
- tableCode: {
133
- type: String,
134
- required: true
137
+ selectable: {
138
+ type: Boolean,
139
+ required: false,
140
+ default: true
141
+ },
142
+ modelValue: {
143
+ type: Array as PropType<string[]>,
144
+ required: false,
145
+ default: () => []
135
146
  }
136
147
  },
137
148
  emits: ["update:modelValue"],
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <FSRow
3
+ v-if="fetching"
4
+ >
5
+ <FSLoader
6
+ v-for="i in 4"
7
+ :key="i"
8
+ variant="chip"
9
+ height="12px"
10
+ />
11
+ </FSRow>
12
+ <FSChipGroup
13
+ v-else
14
+ :color="ColorEnum.Light"
15
+ :labels="userOrganisations?.map(u => u.name)"
16
+ v-bind="$attrs"
17
+ />
18
+ </template>
19
+
20
+ <script lang="ts">
21
+ import { defineComponent, watch, type PropType } from "vue";
22
+
23
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
24
+ import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
25
+
26
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
27
+ import FSLoader from "@dative-gpi/foundation-shared-components/components/FSLoader.vue";
28
+ import FSChipGroup from "@dative-gpi/foundation-shared-components/components/FSChipGroup.vue";
29
+
30
+ export default defineComponent({
31
+ name: "FSChipUserOrganisationsList",
32
+ components: {
33
+ FSChipGroup,
34
+ FSLoader,
35
+ FSRow
36
+ },
37
+ props: {
38
+ userOrganisationIds: {
39
+ type: Array as PropType<string[]>,
40
+ required: false
41
+ }
42
+ },
43
+ setup(props) {
44
+ const {getMany: fetchUserOrganisations, fetching, entities: userOrganisations} = useUserOrganisations();
45
+
46
+ watch(() => props.userOrganisationIds, async () => {
47
+ if(props.userOrganisationIds && props.userOrganisationIds.length > 0){
48
+ fetchUserOrganisations({
49
+ userOrganisationsIds: props.userOrganisationIds
50
+ });
51
+ }
52
+ }, {immediate: true});
53
+
54
+ return {
55
+ userOrganisations,
56
+ ColorEnum,
57
+ fetching
58
+ };
59
+ }
60
+ });
61
+ </script>
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <FSChartTileUI
3
+ v-if="chart"
4
+ :label="chart.label"
5
+ :icon="chart.icon"
6
+ :type="chart.chartType"
7
+ :scope="chart.scope"
8
+ :imageId="chart.imageId"
9
+ v-bind="$attrs"
10
+ />
11
+ </template>
12
+
13
+ <script lang="ts">
14
+ import { computed, defineComponent, type PropType, watch } from "vue";
15
+
16
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
17
+ import { chartIcon } from "@dative-gpi/foundation-shared-components/tools";
18
+
19
+ import { useChartOrganisation, useChartOrganisationType } from "@dative-gpi/foundation-core-services/composables";
20
+ import { ApplicationScope } from "@dative-gpi/foundation-shared-domain/enums";
21
+
22
+ import FSChartTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSChartTileUI.vue";
23
+
24
+ export default defineComponent({
25
+ name: "FSChartTile",
26
+ components: {
27
+ FSChartTileUI
28
+ },
29
+ props: {
30
+ chartId: {
31
+ type: String,
32
+ required: true
33
+ },
34
+ scope: {
35
+ type: Object as PropType<ApplicationScope | number>,
36
+ required : true
37
+ }
38
+ },
39
+ setup(props) {
40
+ const { get : fetchChartOrganisationType, entity : chartOrganisationType } = useChartOrganisationType();
41
+ const { get : fetchChartOrganisation, entity : chartOrganisation } = useChartOrganisation();
42
+
43
+ const chart = computed(() => {
44
+ if (props.scope == ApplicationScope.Organisation) {
45
+ return chartOrganisation.value;
46
+ }
47
+ else if (props.scope == ApplicationScope.OrganisationType) {
48
+ return chartOrganisationType.value;
49
+ }
50
+ else {
51
+ return null
52
+ }
53
+ });
54
+
55
+ watch(() => [props.chartId, props.scope], () => {
56
+ if (props.scope == ApplicationScope.Organisation) {
57
+ fetchChartOrganisation(props.chartId);
58
+ }
59
+ else if (props.scope == ApplicationScope.OrganisationType) {
60
+ fetchChartOrganisationType(props.chartId)
61
+ }
62
+ }, {immediate : true})
63
+
64
+ return {
65
+ ColorEnum,
66
+ chart,
67
+ chartIcon
68
+ };
69
+ }
70
+ });
71
+ </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSLoadTile
3
3
  v-if="getting"
4
- :editable="$props.editable"
4
+ :selectable="$props.selectable"
5
5
  :modelValue="$props.modelValue"
6
6
  @update:modelValue="(value) => $emit('update:modelValue', value)"
7
7
  />
@@ -11,7 +11,7 @@
11
11
  :icon="entity.icon"
12
12
  :label="entity.label"
13
13
  :imageId="entity.imageId"
14
- :editable="$props.editable"
14
+ :selectable="$props.selectable"
15
15
  :bottomColor="entity.colors"
16
16
  :modelValue="$props.modelValue"
17
17
  @update:modelValue="(value) => $emit('update:modelValue', value)"
@@ -43,7 +43,7 @@ export default defineComponent({
43
43
  required: false,
44
44
  default: false
45
45
  },
46
- editable: {
46
+ selectable: {
47
47
  type: Boolean,
48
48
  required: false,
49
49
  default: true
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSLoadTile
3
3
  v-if="getting"
4
- :editable="$props.editable"
4
+ :selectable="$props.selectable"
5
5
  :modelValue="$props.modelValue"
6
6
  @update:modelValue="(value) => $emit('update:modelValue', value)"
7
7
  />
@@ -11,7 +11,7 @@
11
11
  :icon="entity.icon"
12
12
  :label="entity.label"
13
13
  :imageId="entity.imageId"
14
- :editable="$props.editable"
14
+ :selectable="$props.selectable"
15
15
  :bottomColor="entity.colors"
16
16
  :modelValue="$props.modelValue"
17
17
  @update:modelValue="(value) => $emit('update:modelValue', value)"
@@ -43,7 +43,7 @@ export default defineComponent({
43
43
  required: false,
44
44
  default: false
45
45
  },
46
- editable: {
46
+ selectable: {
47
47
  type: Boolean,
48
48
  required: false,
49
49
  default: true
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSLoadTile
3
3
  v-if="getting"
4
- :editable="$props.editable"
4
+ :selectable="$props.selectable"
5
5
  :modelValue="$props.modelValue"
6
6
  @update:modelValue="(value) => $emit('update:modelValue', value)"
7
7
  />
@@ -11,7 +11,7 @@
11
11
  :code="entity.code"
12
12
  :label="entity.label"
13
13
  :imageId="entity.imageId"
14
- :editable="$props.editable"
14
+ :selectable="$props.selectable"
15
15
  :bottomColor="entity.colors"
16
16
  :modelValue="$props.modelValue"
17
17
  @update:modelValue="(value) => $emit('update:modelValue', value)"
@@ -43,7 +43,7 @@ export default defineComponent({
43
43
  required: false,
44
44
  default: false
45
45
  },
46
- editable: {
46
+ selectable: {
47
47
  type: Boolean,
48
48
  required: false,
49
49
  default: true
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <FSLoadTile
3
3
  v-if="getting"
4
- :editable="$props.editable"
4
+ :selectable="$props.selectable"
5
5
  :modelValue="$props.modelValue"
6
- @update:modelValue="(value) => $emit('update:modelValue', value)"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
7
  />
8
8
  <FSDeviceOrganisationTileUI
9
9
  v-else-if="entity"
@@ -15,9 +15,10 @@
15
15
  :deviceAlerts="entity.alerts"
16
16
  :modelStatuses="entity.modelStatuses"
17
17
  :deviceStatuses="entity.status?.statuses"
18
- :editable="$props.editable"
18
+ :selectable="$props.selectable"
19
+ :alertTo="$props.alertTo"
19
20
  :modelValue="$props.modelValue"
20
- @update:modelValue="(value) => $emit('update:modelValue', value)"
21
+ @update:modelValue="$emit('update:modelValue', $event)"
21
22
  v-bind="$attrs"
22
23
  />
23
24
  </template>
@@ -46,12 +47,18 @@ export default defineComponent({
46
47
  required: false,
47
48
  default: false
48
49
  },
49
- editable: {
50
+ selectable: {
50
51
  type: Boolean,
51
52
  required: false,
52
53
  default: true
54
+ },
55
+ alertTo: {
56
+ type: Function,
57
+ required: false,
58
+ default: null
53
59
  }
54
60
  },
61
+ emits: ["update:modelValue"],
55
62
  setup(props) {
56
63
  const { get, getting, entity } = useDeviceOrganisation();
57
64
 
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSLoadTile
3
3
  v-if="getting"
4
- :editable="$props.editable"
4
+ :selectable="$props.selectable"
5
5
  :modelValue="$props.modelValue"
6
6
  @update:modelValue="(value) => $emit('update:modelValue', value)"
7
7
  />
@@ -12,7 +12,7 @@
12
12
  :bottomColor="entity.colors"
13
13
  :icon="entity.icon"
14
14
  :imageId="entity.imageId"
15
- :editable="$props.editable"
15
+ :selectable="$props.selectable"
16
16
  :modelValue="$props.modelValue"
17
17
  @update:modelValue="(value) => $emit('update:modelValue', value)"
18
18
  v-bind="$attrs"
@@ -43,7 +43,7 @@ export default defineComponent({
43
43
  required: false,
44
44
  default: false
45
45
  },
46
- editable: {
46
+ selectable: {
47
47
  type: Boolean,
48
48
  required: false,
49
49
  default: true
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSLoadTile
3
3
  v-if="getting"
4
- :editable="$props.editable"
4
+ :selectable="$props.selectable"
5
5
  :modelValue="modelValue"
6
6
  @update:modelValue="(value) => $emit('update:modelValue', value)"
7
7
  />
@@ -12,7 +12,7 @@
12
12
  :code="entity.code"
13
13
  :recursiveGroupsIds="entity.recursiveGroupsIds"
14
14
  :recursiveDeviceOrganisationsIds="entity.recursiveDeviceOrganisationsIds"
15
- :editable="$props.editable"
15
+ :selectable="$props.selectable"
16
16
  :modelValue="modelValue"
17
17
  @update:modelValue="(value) => $emit('update:modelValue', value)"
18
18
  v-bind="$attrs"
@@ -43,7 +43,7 @@ export default defineComponent({
43
43
  required: false,
44
44
  default: false
45
45
  },
46
- editable: {
46
+ selectable: {
47
47
  type: Boolean,
48
48
  required: false,
49
49
  default: true
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSLoadTile
3
3
  v-if="getting"
4
- :editable="$props.editable"
4
+ :selectable="$props.selectable"
5
5
  :modelValue="modelValue"
6
6
  @update:modelValue="(value) => $emit('update:modelValue', value)"
7
7
  />
@@ -11,8 +11,9 @@
11
11
  :label="entity.label"
12
12
  :code="entity.code"
13
13
  :color="entity.color"
14
+ :address="entity.address.placeLabel"
14
15
  :deviceCount="entity.deviceOrganisationsCount"
15
- :editable="$props.editable"
16
+ :selectable="$props.selectable"
16
17
  :modelValue="modelValue"
17
18
  @update:modelValue="(value) => $emit('update:modelValue', value)"
18
19
  v-bind="$attrs"
@@ -43,12 +44,13 @@ export default defineComponent({
43
44
  required: false,
44
45
  default: false
45
46
  },
46
- editable: {
47
+ selectable: {
47
48
  type: Boolean,
48
49
  required: false,
49
50
  default: true
50
51
  }
51
52
  },
53
+ emits: ['update:modelValue'],
52
54
  setup(props) {
53
55
  const { get, getting, entity } = useLocation();
54
56
 
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <FSLoadTile
3
+ v-if="getting"
4
+ :selectable="$props.selectable"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="(value) => $emit('update:modelValue', value)"
7
+ />
8
+ <FSModelTileUI
9
+ v-else-if="entity"
10
+ :imageId="entity.imageId"
11
+ :label="entity.label"
12
+ :code="entity.code"
13
+ :selectable="$props.selectable"
14
+ :modelValue="modelValue"
15
+ @update:modelValue="(value) => $emit('update:modelValue', value)"
16
+ v-bind="$attrs"
17
+ />
18
+ </template>
19
+
20
+ <script lang="ts">
21
+ import { defineComponent, watch } from "vue";
22
+
23
+ import { useModel } from "@dative-gpi/foundation-core-services/composables";
24
+
25
+ import FSModelTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSModelTileUI.vue";
26
+ import FSLoadTile from "@dative-gpi/foundation-shared-components/components/tiles/FSLoadTile.vue";
27
+
28
+ export default defineComponent({
29
+ name: "FSModelTile",
30
+ components: {
31
+ FSModelTileUI,
32
+ FSLoadTile
33
+ },
34
+ props: {
35
+ modelId: {
36
+ type: String,
37
+ required: true
38
+ },
39
+ modelValue: {
40
+ type: Boolean,
41
+ required: false,
42
+ default: false
43
+ },
44
+ selectable: {
45
+ type: Boolean,
46
+ required: false,
47
+ default: true
48
+ }
49
+ },
50
+ emits: ['update:modelValue'],
51
+ setup(props) {
52
+ const { get, getting, entity } = useModel();
53
+
54
+ watch(() => props.modelId, () => {
55
+ get(props.modelId);
56
+ }, { immediate: true });
57
+
58
+ return {
59
+ getting,
60
+ entity
61
+ };
62
+ }
63
+ });
64
+ </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSLoadTile
3
3
  v-if="getting"
4
- :editable="$props.editable"
4
+ :selectable="$props.selectable"
5
5
  :modelValue="modelValue"
6
6
  @update:modelValue="$emit('update:modelValue', $event)"
7
7
  />
@@ -11,7 +11,7 @@
11
11
  :label="entity.label"
12
12
  :roleLabel="entity.roleLabel"
13
13
  :roleIcon="entity.roleIcon"
14
- :editable="$props.editable"
14
+ :selectable="$props.selectable"
15
15
  :modelValue="modelValue"
16
16
  @update:modelValue="$emit('update:modelValue', $event)"
17
17
  v-bind="$attrs"
@@ -42,7 +42,7 @@ export default defineComponent({
42
42
  required: false,
43
43
  default: false
44
44
  },
45
- editable: {
45
+ selectable: {
46
46
  type: Boolean,
47
47
  required: false,
48
48
  default: true