@dative-gpi/foundation-core-components 1.0.57 → 1.0.59

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.
@@ -4,7 +4,7 @@
4
4
  :items="charts"
5
5
  :tableCode="$props.tableCode"
6
6
  :modelValue="$props.modelValue"
7
- @update:modelValue="$emit('update:modelValue', $event)"
7
+ @update:modelValue="onSelect"
8
8
  v-bind="$attrs"
9
9
  >
10
10
  <template
@@ -117,7 +117,7 @@ export default defineComponent({
117
117
  required: true
118
118
  }
119
119
  },
120
- emits: ["update:modelValue"],
120
+ emits: ["update:modelValue", "update:scope"],
121
121
  setup(props, { emit }) {
122
122
 
123
123
  const { entities: chartOrganisations, fetching: fetchingChartOrganisations, getMany: getManyChartOrganisations } = useChartOrganisations();
@@ -135,7 +135,7 @@ export default defineComponent({
135
135
  const charts = computed(() => {
136
136
  return chartOrganisations.value.map(c => {
137
137
  return {
138
- id: `${c.id}_${c.scope}`,
138
+ id: c.id,
139
139
  imageId: c.imageId,
140
140
  chartId: c.chartId,
141
141
  chartCategoryId: c.chartCategoryId,
@@ -153,7 +153,7 @@ export default defineComponent({
153
153
  })
154
154
  .concat(chartOrganisationTypes.value.map(c => {
155
155
  return {
156
- id: `${c.id}_${c.scope}`,
156
+ id: c.id,
157
157
  imageId: c.imageId,
158
158
  chartId: c.chartId,
159
159
  chartCategoryId: c.chartCategoryId,
@@ -176,12 +176,23 @@ export default defineComponent({
176
176
  const item = isSelected(value);
177
177
 
178
178
  if(item){
179
- emit("update:modelValue", props.modelValue.filter(m => m != value))
179
+ onSelect(props.modelValue.filter(m => m != value))
180
180
  }
181
181
  else{
182
- emit("update:modelValue", [...props.modelValue, value])
182
+ onSelect([...props.modelValue, value])
183
183
  }
184
184
  }
185
+
186
+ const onSelect = (values: string[] | null) => {
187
+ if(!values){
188
+ emit("update:modelValue", [])
189
+ emit("update:scope", [])
190
+ return;
191
+ }
192
+ const selectedItems = charts.value.filter(i => values.includes(i.id));
193
+ emit("update:modelValue", selectedItems.map(i => i.id));
194
+ emit("update:scope", selectedItems.map(i => i.scope));
195
+ };
185
196
 
186
197
  watch(() => [props.chartOrganisationFilters,props.chartOrganisationTypeFilters], (next, previous) => {
187
198
  if ((!next && !previous) || !_.isEqual(next, previous)) {
@@ -197,6 +208,7 @@ export default defineComponent({
197
208
  ColorEnum,
198
209
  charts,
199
210
  isSelected,
211
+ onSelect,
200
212
  update
201
213
  };
202
214
  }
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.57",
4
+ "version": "1.0.59",
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.57",
14
- "@dative-gpi/foundation-core-services": "1.0.57",
15
- "@dative-gpi/foundation-shared-components": "1.0.57",
16
- "@dative-gpi/foundation-shared-domain": "1.0.57",
17
- "@dative-gpi/foundation-shared-services": "1.0.57"
13
+ "@dative-gpi/foundation-core-domain": "1.0.59",
14
+ "@dative-gpi/foundation-core-services": "1.0.59",
15
+ "@dative-gpi/foundation-shared-components": "1.0.59",
16
+ "@dative-gpi/foundation-shared-domain": "1.0.59",
17
+ "@dative-gpi/foundation-shared-services": "1.0.59"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -26,5 +26,5 @@
26
26
  "sass": "1.71.1",
27
27
  "sass-loader": "13.3.2"
28
28
  },
29
- "gitHead": "4445a164fed7501246674432eba3e8227c8bc827"
29
+ "gitHead": "583e582d2f2185269a2d2880806be36bdc4dffdd"
30
30
  }