@dative-gpi/foundation-core-components 1.0.71 → 1.0.74

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.
@@ -9,7 +9,7 @@
9
9
  :entityType="$props.entityType"
10
10
  :allowedEntityTypes="$props.allowedEntityTypes || []"
11
11
  :itemsCount="($props.modelValue || []).length"
12
- @update:entityType="$emit('update:entityType', $event); $emit('update:modelValue', [])"
12
+ @update:entityType="onEntityTypeChanged"
13
13
  :showEntities="$props.showEntities"
14
14
  :showCount="$props.showCount"
15
15
  @click:select="dialog = true"
@@ -19,7 +19,7 @@
19
19
  >
20
20
  <FSSimpleEntitiesList
21
21
  :entity-type="$props.entityType"
22
- :filters="listComponentFilters"
22
+ :filters="simpleListFilters"
23
23
  :showEdit="false"
24
24
  @click:remove="onRemove"
25
25
  />
@@ -40,7 +40,7 @@ import { defineComponent, ref, type PropType, computed } from "vue";
40
40
 
41
41
  import { EntityType } from "@dative-gpi/foundation-shared-domain/enums";
42
42
 
43
- import type { DeviceOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
43
+ import type { DashboardOrganisationFilters, DashboardOrganisationTypeFilters, DeviceOrganisationFilters, FolderFilters, GroupFilters, LocationFilters, ModelFilters, UserOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
44
44
 
45
45
  import FSEntityFieldUI from "@dative-gpi/foundation-shared-components/components/fields/FSEntityFieldUI.vue";
46
46
 
@@ -120,29 +120,64 @@ export default defineComponent({
120
120
  default: true
121
121
  }
122
122
  },
123
- emits: ["update:modelValue", "update:entityType"],
123
+ emits: ["update","update:modelValue", "update:entityType"],
124
124
  setup(props, { emit }) {
125
125
  const dialog = ref(false);
126
126
 
127
- const listComponentFilters = computed(() => {
127
+ const simpleListFilters = computed(() => {
128
128
  switch(props.entityType) {
129
129
  case EntityType.Device:
130
130
  return {
131
131
  deviceOrganisationsIds: props.modelValue
132
132
  } satisfies DeviceOrganisationFilters;
133
+ case EntityType.Dashboard:
134
+ return {
135
+ dashboardOrganisationsIds: props.modelValue,
136
+ dashboardOrganisationTypesIds: props.modelValue
137
+ } satisfies DashboardOrganisationFilters & DashboardOrganisationTypeFilters;
138
+ case EntityType.Group:
139
+ return {
140
+ groupsIds: props.modelValue
141
+ } satisfies GroupFilters;
142
+ case EntityType.Folder:
143
+ return {
144
+ foldersIds: props.modelValue
145
+ } satisfies FolderFilters;
146
+ case EntityType.Location:
147
+ return {
148
+ locationsIds: props.modelValue
149
+ } satisfies LocationFilters;
150
+ case EntityType.User:
151
+ return {
152
+ userOrganisationsIds: props.modelValue
153
+ } satisfies UserOrganisationFilters;
154
+ case EntityType.Model:
155
+ return {
156
+ modelsIds: props.modelValue
157
+ } satisfies ModelFilters;
133
158
  default:
134
- return {};
159
+ return undefined;
135
160
  };
136
- });
161
+ })
137
162
 
138
163
  const onRemove = (id: string) => {
139
164
  emit("update:modelValue", props.modelValue.filter((i) => i !== id));
140
165
  }
141
166
 
167
+ const onEntityTypeChanged = (entityType: EntityType) => {
168
+ emit('update:entityType', entityType);
169
+ emit('update:modelValue', []);
170
+ emit("update", {
171
+ entityType,
172
+ modelValue: []
173
+ })
174
+ }
175
+
142
176
  return {
143
177
  dialog,
144
- listComponentFilters,
145
- onRemove
178
+ simpleListFilters,
179
+ onRemove,
180
+ onEntityTypeChanged
146
181
  }
147
182
  }
148
183
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-core-components",
3
3
  "sideEffects": false,
4
- "version": "1.0.71",
4
+ "version": "1.0.74",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,11 +10,11 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-core-domain": "1.0.71",
14
- "@dative-gpi/foundation-core-services": "1.0.71",
15
- "@dative-gpi/foundation-shared-components": "1.0.71",
16
- "@dative-gpi/foundation-shared-domain": "1.0.71",
17
- "@dative-gpi/foundation-shared-services": "1.0.71"
13
+ "@dative-gpi/foundation-core-domain": "1.0.74",
14
+ "@dative-gpi/foundation-core-services": "1.0.74",
15
+ "@dative-gpi/foundation-shared-components": "1.0.74",
16
+ "@dative-gpi/foundation-shared-domain": "1.0.74",
17
+ "@dative-gpi/foundation-shared-services": "1.0.74"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -26,5 +26,5 @@
26
26
  "sass": "1.71.1",
27
27
  "sass-loader": "13.3.2"
28
28
  },
29
- "gitHead": "c8c96076d853890bdfa50e805e7797fb390da2b5"
29
+ "gitHead": "b9ba9b12c53de7d812e658a3438903e8e6998aad"
30
30
  }