@dative-gpi/foundation-core-components 1.0.94 → 1.0.96

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.
@@ -118,7 +118,7 @@ export default defineComponent({
118
118
  default: false
119
119
  }
120
120
  },
121
- emits: ["update:modelValue", "update:type"],
121
+ emits: ["update", "update:modelValue", "update:type"],
122
122
  setup(props, { emit }) {
123
123
  const { getMany: getManyChartOrganisationTypes, fetching: fetchingChartOrganisationTypes, entities: chartOrganisationTypes } = useChartOrganisationTypes();
124
124
  const { getMany: getManyChartOrganisations, fetching: fetchingChartOrganisations, entities: chartOrganisations } = useChartOrganisations();
@@ -151,12 +151,16 @@ export default defineComponent({
151
151
 
152
152
  const update = (value: Chart[] | Chart | null) => {
153
153
  if (Array.isArray(value)) {
154
- emit("update:modelValue", value.map(v => v.id));
155
- emit("update:type", value.map(v => v.type));
154
+ const newModelValue = value.map(v => v.id);
155
+ const newType = value.map(v => v.type);
156
+ emit("update:modelValue", newModelValue);
157
+ emit("update:type", newType);
158
+ emit("update", { modelValue: newModelValue, type: newType });
156
159
  }
157
160
  else {
158
161
  emit("update:modelValue", value?.id);
159
162
  emit("update:type", value?.type);
163
+ emit("update", { modelValue: value?.id, type: value?.type });
160
164
  }
161
165
  };
162
166
 
@@ -125,7 +125,7 @@ export default defineComponent({
125
125
  default: false
126
126
  }
127
127
  },
128
- emits: ["update:modelValue", "update:type"],
128
+ emits: ["update", "update:modelValue", "update:type"],
129
129
  setup(props, { emit }) {
130
130
  const { getMany: getManyDashboardOrganisationTypes, fetching: fetchingDashboardOrganisationTypes, entities: dashboardOrganisationTypes } = useDashboardOrganisationTypes();
131
131
  const { getMany: getManyDashboardOrganisations, fetching: fetchingDashboardOrganisations, entities: dashboardOrganisations } = useDashboardOrganisations();
@@ -164,12 +164,16 @@ export default defineComponent({
164
164
 
165
165
  const update = (value: Dashboard[] | Dashboard | null) => {
166
166
  if (Array.isArray(value)) {
167
- emit("update:modelValue", value.map(v => v.id));
168
- emit("update:type", value.map(v => v.type));
167
+ const newModelValue = value.map(v => v.id);
168
+ const newType = value.map(v => v.type);
169
+ emit("update:modelValue", newModelValue);
170
+ emit("update:type", newType);
171
+ emit("update", { modelValue: newModelValue, type: newType });
169
172
  }
170
173
  else {
171
174
  emit("update:modelValue", value?.id);
172
175
  emit("update:type", value?.type);
176
+ emit("update", { modelValue: value?.id, type: value?.type });
173
177
  }
174
178
  };
175
179
 
@@ -119,7 +119,7 @@ export default defineComponent({
119
119
  default: false
120
120
  }
121
121
  },
122
- emits: ["update:modelValue", "update:type"],
122
+ emits: ["update", "update:modelValue", "update:type"],
123
123
  setup(props, { emit }) {
124
124
  const { getMany: getManyRoleOrganisationTypes, fetching: fetchingRoleOrganisationTypes, entities: roleOrganisationTypes } = useRoleOrganisationTypes();
125
125
  const { getMany: getManyRoleOrganisations, fetching: fetchingRoleOrganisations, entities: roleOrganisations } = useRoleOrganisations();
@@ -152,12 +152,16 @@ export default defineComponent({
152
152
 
153
153
  const update = (value: Role[] | Role | null) => {
154
154
  if (Array.isArray(value)) {
155
- emit("update:modelValue", value.map(v => v.id));
156
- emit("update:type", value.map(v => v.type));
155
+ const newModelValue = value.map(v => v.id);
156
+ const newType = value.map(v => v.type);
157
+ emit("update:modelValue", newModelValue);
158
+ emit("update:type", newType);
159
+ emit("update", { modelValue: newModelValue, type: newType });
157
160
  }
158
161
  else {
159
162
  emit("update:modelValue", value?.id);
160
163
  emit("update:type", value?.type);
164
+ emit("update", { modelValue: value?.id, type: value?.type });
161
165
  }
162
166
  };
163
167
 
@@ -33,7 +33,7 @@ export default defineComponent({
33
33
  FSSelectEntitiesList,
34
34
  FSDialogSubmit,
35
35
  },
36
- emits: ["update:modelValue", "update:selecteds"],
36
+ emits: ["update", "update:modelValue", "update:selecteds"],
37
37
  props: {
38
38
  entityType: {
39
39
  type: Number as PropType<EntityType>,
@@ -61,6 +61,7 @@ export default defineComponent({
61
61
  const onSubmit = () => {
62
62
  emit("update:selecteds", actualSelecteds.value);
63
63
  emit("update:modelValue", false);
64
+ emit("update", { selecteds: actualSelecteds.value, modelValue: false });
64
65
  }
65
66
 
66
67
  watch(() => props.selecteds, (value) => {
@@ -30,7 +30,7 @@
30
30
  :filters="$props.filters"
31
31
  v-model="dialog"
32
32
  :selecteds="$props.modelValue || []"
33
- @update:selecteds="$emit('update:modelValue', $event)"
33
+ @update:selecteds="onModelValueChanged"
34
34
  />
35
35
  </template>
36
36
 
@@ -162,6 +162,10 @@ export default defineComponent({
162
162
 
163
163
  const onRemove = (id: string) => {
164
164
  emit("update:modelValue", props.modelValue.filter((i) => i !== id));
165
+ emit("update", {
166
+ entityType: props.entityType,
167
+ modelValue: props.modelValue.filter((i) => i !== id)
168
+ })
165
169
  }
166
170
 
167
171
  const onEntityTypeChanged = (entityType: EntityType) => {
@@ -173,11 +177,20 @@ export default defineComponent({
173
177
  })
174
178
  }
175
179
 
180
+ const onModelValueChanged = (modelValue: string[]) => {
181
+ emit('update:modelValue', modelValue);
182
+ emit("update", {
183
+ entityType: props.entityType,
184
+ modelValue
185
+ })
186
+ }
187
+
176
188
  return {
177
189
  dialog,
178
190
  simpleListFilters,
179
191
  onRemove,
180
- onEntityTypeChanged
192
+ onEntityTypeChanged,
193
+ onModelValueChanged
181
194
  }
182
195
  }
183
196
  });
@@ -153,7 +153,7 @@ export default defineComponent({
153
153
  required: true
154
154
  }
155
155
  },
156
- emits: ["update:modelValue", "update:type", "update:dashboard-type"],
156
+ emits: ["update", "update:modelValue", "update:type", "update:dashboard-type"],
157
157
  setup(props, { emit }) {
158
158
 
159
159
  const { fetch: fetchUserOrganisation, entity: userOrganisation } = useCurrentUserOrganisation();
@@ -199,9 +199,13 @@ export default defineComponent({
199
199
  const onSelect = (values: string[]) => {
200
200
  selecteds.value = values;
201
201
  const selectedItems = items.value.filter(i => selecteds.value!.includes(i.id));
202
- emit("update:dashboard-type", selectedItems.map(i => i.dashboardType));
203
- emit("update:modelValue", selectedItems.map(i => i.id));
204
- emit("update:type", selectedItems.map(i => i.type));
202
+ const newDashboardType = selectedItems.map(i => i.dashboardType);
203
+ const newModelValue = selectedItems.map(i => i.id);
204
+ const newType = selectedItems.map(i => i.type);
205
+ emit("update:dashboard-type", newDashboardType);
206
+ emit("update:modelValue", newModelValue);
207
+ emit("update:type", newType);
208
+ emit("update", { dashboardType: newDashboardType, modelValue: newModelValue, type: newType });
205
209
  };
206
210
 
207
211
  const isSelected = (id: string) => {
@@ -141,7 +141,7 @@ export default defineComponent({
141
141
  required: false
142
142
  }
143
143
  },
144
- emits: ["update:modelValue", "update:scope"],
144
+ emits: ["update", "update:modelValue", "update:scope"],
145
145
  setup(props, { emit }) {
146
146
  const { entities: chartOrganisations, fetching: fetchingChartOrganisations, getMany: getManyChartOrganisations } = useChartOrganisations();
147
147
  const { entities: chartOrganisationTypes, fetching: fetchingChartOrganisationTypes, getMany: getManyChartOrganisationTypes } = useChartOrganisationTypes();
@@ -227,11 +227,15 @@ export default defineComponent({
227
227
  if(!values){
228
228
  emit("update:modelValue", []);
229
229
  emit("update:scope", []);
230
+ emit("update", { modelValue: [], scope: [] });
230
231
  return;
231
232
  }
232
233
  const selectedItems = charts.value.filter(i => values.includes(i.id));
233
- emit("update:modelValue", selectedItems.map(i => i.id));
234
- emit("update:scope", selectedItems.map(i => i.scope));
234
+ const newModelValue = selectedItems.map(i => i.id);
235
+ const newScope = selectedItems.map(i => i.scope);
236
+ emit("update:modelValue", newModelValue);
237
+ emit("update:scope", newScope);
238
+ emit("update", { modelValue: newModelValue, scope: newScope });
235
239
  };
236
240
 
237
241
  watch(() => [props.chartOrganisationFilters,props.chartOrganisationTypeFilters], (next, previous) => {
@@ -132,7 +132,7 @@ export default defineComponent({
132
132
  required: false
133
133
  }
134
134
  },
135
- emits: ["update:modelValue", "update:type"],
135
+ emits: ["update", "update:modelValue", "update:type"],
136
136
  setup(props, { emit }) {
137
137
  const { entities: dashboardOrganisationTypes, fetching: fetchingDashboardOrganisationTypes, getMany: getManyDashboardOrganisationTypes } = useDashboardOrganisationTypes();
138
138
  const { entities: dashboardOrganisations, fetching: fetchingDashboardOrganisations, getMany: getManyDashboardOrganisations } = useDashboardOrganisations();
@@ -171,8 +171,11 @@ export default defineComponent({
171
171
  const onSelect = (values: string[]) => {
172
172
  selecteds.value = values;
173
173
  const selectedItems = items.value.filter(i => selecteds.value!.includes(i.id));
174
- emit("update:modelValue", selectedItems.map(i => i.id));
175
- emit("update:type", selectedItems.map(i => i.dashboardType));
174
+ const newModelValue = selectedItems.map(i => i.id);
175
+ const newType = selectedItems.map(i => i.dashboardType);
176
+ emit("update:modelValue", newModelValue);
177
+ emit("update:type", newType);
178
+ emit("update", { modelValue: newModelValue, type: newType });
176
179
  };
177
180
 
178
181
  const isSelected = (id: string) => {
@@ -26,6 +26,15 @@
26
26
  {{ item.icon }}
27
27
  </FSIcon>
28
28
  </template>
29
+ <template
30
+ #item.tags="{ item }"
31
+ >
32
+ <FSTagGroup
33
+ variant="slide"
34
+ :editable="false"
35
+ :tags="item.tags"
36
+ />
37
+ </template>
29
38
 
30
39
  <template
31
40
  #item.tile="{ item, toggleSelect }"
@@ -43,9 +52,8 @@
43
52
 
44
53
  <script lang="ts">
45
54
  import _ from "lodash";
46
- import type { PropType} from "vue";
47
55
  import type { RouteLocation } from "vue-router";
48
- import { defineComponent, watch } from "vue";
56
+ import { defineComponent, type PropType, watch } from "vue";
49
57
 
50
58
  import { useFolders } from "@dative-gpi/foundation-core-services/composables";
51
59
 
@@ -54,6 +62,7 @@ import { FoldersListType } from "@dative-gpi/foundation-core-components/utils";
54
62
  import type { FolderFilters, DashboardInfos } from "@dative-gpi/foundation-core-domain/models";
55
63
 
56
64
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
65
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
57
66
  import FSFolderTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSFolderTileUI.vue";
58
67
 
59
68
  import FSDataTable from "../FSDataTable.vue";
@@ -61,9 +70,10 @@ import FSDataTable from "../FSDataTable.vue";
61
70
  export default defineComponent({
62
71
  name: "FSBaseFoldersList",
63
72
  components: {
73
+ FSFolderTileUI,
64
74
  FSDataTable,
65
- FSIcon,
66
- FSFolderTileUI
75
+ FSTagGroup,
76
+ FSIcon
67
77
  },
68
78
  props: {
69
79
  tableCode: {
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.94",
4
+ "version": "1.0.96",
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.94",
14
- "@dative-gpi/foundation-core-services": "1.0.94",
15
- "@dative-gpi/foundation-shared-components": "1.0.94",
16
- "@dative-gpi/foundation-shared-domain": "1.0.94",
17
- "@dative-gpi/foundation-shared-services": "1.0.94"
13
+ "@dative-gpi/foundation-core-domain": "1.0.96",
14
+ "@dative-gpi/foundation-core-services": "1.0.96",
15
+ "@dative-gpi/foundation-shared-components": "1.0.96",
16
+ "@dative-gpi/foundation-shared-domain": "1.0.96",
17
+ "@dative-gpi/foundation-shared-services": "1.0.96"
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": "be58c8299c1fc3d18c29089e157f248527da9234"
29
+ "gitHead": "208043509258652b856a824d62a2a91e98328007"
30
30
  }