@dative-gpi/foundation-core-components 1.0.73 → 1.0.75
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="
|
|
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="
|
|
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
|
|
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
|
-
|
|
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.
|
|
4
|
+
"version": "1.0.75",
|
|
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.
|
|
14
|
-
"@dative-gpi/foundation-core-services": "1.0.
|
|
15
|
-
"@dative-gpi/foundation-shared-components": "1.0.
|
|
16
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
17
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-core-domain": "1.0.75",
|
|
14
|
+
"@dative-gpi/foundation-core-services": "1.0.75",
|
|
15
|
+
"@dative-gpi/foundation-shared-components": "1.0.75",
|
|
16
|
+
"@dative-gpi/foundation-shared-domain": "1.0.75",
|
|
17
|
+
"@dative-gpi/foundation-shared-services": "1.0.75"
|
|
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": "
|
|
29
|
+
"gitHead": "ef20cc0c223aabf078f1383104e2651a9f6b290c"
|
|
30
30
|
}
|