@dative-gpi/foundation-core-components 0.0.168 → 0.0.170
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.
|
@@ -193,7 +193,7 @@ export default defineComponent({
|
|
|
193
193
|
]);
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
-
const { toggleSet,
|
|
196
|
+
const { toggleSet, init, onUpdate } = useAutocomplete(
|
|
197
197
|
dashboards,
|
|
198
198
|
[() => props.dashboardOrganisationTypeFilters, () => props.dashboardOrganisationFilters, () => props.dashboardShallowFilters],
|
|
199
199
|
emit,
|
|
@@ -202,10 +202,9 @@ export default defineComponent({
|
|
|
202
202
|
);
|
|
203
203
|
|
|
204
204
|
return {
|
|
205
|
+
dashboards,
|
|
205
206
|
toggleSet,
|
|
206
207
|
loading,
|
|
207
|
-
search,
|
|
208
|
-
dashboards,
|
|
209
208
|
dashboardTypeColor,
|
|
210
209
|
dashboardTypeLabel,
|
|
211
210
|
onUpdate
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSAutocompleteField
|
|
3
|
+
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
|
+
:loading="loading"
|
|
5
|
+
:items="dashboardOrganisations"
|
|
6
|
+
:modelValue="$props.modelValue"
|
|
7
|
+
@update:modelValue="onUpdate"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
>
|
|
10
|
+
<template
|
|
11
|
+
#autocomplete-selection="{ item }"
|
|
12
|
+
>
|
|
13
|
+
<FSRow
|
|
14
|
+
v-if="$props.modelValue"
|
|
15
|
+
align="center-center"
|
|
16
|
+
:wrap="false"
|
|
17
|
+
>
|
|
18
|
+
<FSIcon
|
|
19
|
+
v-if="item.raw.icon"
|
|
20
|
+
>
|
|
21
|
+
{{ item.raw.icon }}
|
|
22
|
+
</FSIcon>
|
|
23
|
+
<FSSpan>
|
|
24
|
+
{{ item.raw.label }}
|
|
25
|
+
</FSSpan>
|
|
26
|
+
</FSRow>
|
|
27
|
+
</template>
|
|
28
|
+
<template
|
|
29
|
+
#item-label="{ item, font }"
|
|
30
|
+
>
|
|
31
|
+
<FSRow
|
|
32
|
+
align="center-left"
|
|
33
|
+
:wrap="false"
|
|
34
|
+
>
|
|
35
|
+
<FSIcon
|
|
36
|
+
v-if="item.raw.icon"
|
|
37
|
+
>
|
|
38
|
+
{{ item.raw.icon }}
|
|
39
|
+
</FSIcon>
|
|
40
|
+
<FSSpan
|
|
41
|
+
:font="font"
|
|
42
|
+
>
|
|
43
|
+
{{ item.raw.label }}
|
|
44
|
+
</FSSpan>
|
|
45
|
+
</FSRow>
|
|
46
|
+
</template>
|
|
47
|
+
</FSAutocompleteField>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script lang="ts">
|
|
51
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
52
|
+
|
|
53
|
+
import { DashboardOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
54
|
+
import { useDashboardOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
55
|
+
import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
|
|
56
|
+
|
|
57
|
+
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
58
|
+
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
59
|
+
import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
|
|
60
|
+
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export default defineComponent({
|
|
64
|
+
name: "FSAutocompleteDashboard",
|
|
65
|
+
components: {
|
|
66
|
+
FSAutocompleteField,
|
|
67
|
+
FSIcon,
|
|
68
|
+
FSSpan,
|
|
69
|
+
FSRow
|
|
70
|
+
},
|
|
71
|
+
props: {
|
|
72
|
+
dashboardOrganisationFilters: {
|
|
73
|
+
type: Object as PropType<DashboardOrganisationFilters>,
|
|
74
|
+
required: false,
|
|
75
|
+
default: null
|
|
76
|
+
},
|
|
77
|
+
modelValue: {
|
|
78
|
+
type: [Array, String] as PropType<string[] | string | null>,
|
|
79
|
+
required: false,
|
|
80
|
+
default: null
|
|
81
|
+
},
|
|
82
|
+
toggleSetDisabled: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
required: false,
|
|
85
|
+
default: false
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
emits: ["update:modelValue"],
|
|
89
|
+
setup(props, { emit }) {
|
|
90
|
+
const { getMany: getManyDashboardOrganisations, fetching: fetchingDashboardOrganisations, entities: dashboardOrganisations } = useDashboardOrganisations();
|
|
91
|
+
|
|
92
|
+
const loading = computed((): boolean => {
|
|
93
|
+
return init.value && fetchingDashboardOrganisations.value;
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const innerFetch = (search: string | null) => {
|
|
97
|
+
return getManyDashboardOrganisations({ ...props.dashboardOrganisationFilters, search: search ?? undefined });
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const { toggleSet, init, onUpdate } = useAutocomplete(
|
|
101
|
+
dashboardOrganisations,
|
|
102
|
+
[() => props.dashboardOrganisationFilters],
|
|
103
|
+
emit,
|
|
104
|
+
innerFetch
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
dashboardOrganisations,
|
|
109
|
+
toggleSet,
|
|
110
|
+
loading,
|
|
111
|
+
onUpdate
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
</script>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.170",
|
|
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": "0.0.
|
|
14
|
-
"@dative-gpi/foundation-core-services": "0.0.
|
|
15
|
-
"@dative-gpi/foundation-shared-components": "0.0.
|
|
16
|
-
"@dative-gpi/foundation-shared-domain": "0.0.
|
|
17
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-core-domain": "0.0.170",
|
|
14
|
+
"@dative-gpi/foundation-core-services": "0.0.170",
|
|
15
|
+
"@dative-gpi/foundation-shared-components": "0.0.170",
|
|
16
|
+
"@dative-gpi/foundation-shared-domain": "0.0.170",
|
|
17
|
+
"@dative-gpi/foundation-shared-services": "0.0.170",
|
|
18
18
|
"color": "4.2.3",
|
|
19
19
|
"vue": "3.4.23",
|
|
20
20
|
"vuedraggable": "4.1.0"
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"sass": "1.71.1",
|
|
25
25
|
"sass-loader": "13.3.2"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "d79b84587b0ec9f795db4405313d4353e1ce1603"
|
|
28
28
|
}
|