@dative-gpi/foundation-core-components 0.1.120 → 1.0.1

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.
Files changed (46) hide show
  1. package/components/autocompletes/FSAutocompleteChart.vue +208 -0
  2. package/components/autocompletes/FSAutocompleteDashboard.vue +33 -37
  3. package/components/autocompletes/FSAutocompleteDashboardOrganisation.vue +115 -0
  4. package/components/autocompletes/FSAutocompleteDataCategory.vue +16 -25
  5. package/components/autocompletes/FSAutocompleteDataDefinition.vue +17 -26
  6. package/components/autocompletes/FSAutocompleteGroup.vue +18 -27
  7. package/components/autocompletes/FSAutocompleteLocation.vue +22 -31
  8. package/components/autocompletes/FSAutocompleteManufacturer.vue +8 -8
  9. package/components/autocompletes/FSAutocompleteModel.vue +4 -4
  10. package/components/autocompletes/FSAutocompleteOrganisationType.vue +4 -4
  11. package/components/autocompletes/FSAutocompleteRole.vue +30 -34
  12. package/components/autocompletes/FSAutocompleteUserOrganisation.vue +20 -34
  13. package/components/customProperties/FSMetaField.vue +139 -107
  14. package/components/customProperties/FSMetaFormContent.vue +3 -2
  15. package/components/customProperties/FSMetaGrid.vue +4 -3
  16. package/components/customProperties/FSMetaHistory.vue +3 -2
  17. package/components/customProperties/FSMetaValue.vue +4 -2
  18. package/components/customProperties/helpers.ts +2 -1
  19. package/components/lists/FSDataTable.vue +48 -133
  20. package/components/selects/FSAggregationSelector.vue +51 -0
  21. package/components/selects/FSAxisTypeSelector.vue +48 -0
  22. package/components/selects/FSDataCategorySelector.vue +62 -0
  23. package/components/selects/FSDataDefinitionSelector.vue +66 -0
  24. package/components/selects/FSDisplayAsSelector.vue +52 -0
  25. package/components/selects/FSFilterTypeSelector.vue +53 -0
  26. package/components/selects/FSHeatmapRuleSelector.vue +52 -0
  27. package/components/selects/FSModelSelector.vue +56 -0
  28. package/components/selects/FSOperationOnSelector.vue +51 -0
  29. package/components/selects/FSPlanningTypeSelector.vue +50 -0
  30. package/components/selects/FSPlotPerSelector.vue +51 -0
  31. package/components/selects/FSSelectSelectedEntities.vue +59 -0
  32. package/components/selects/FSSerieTypeSelector.vue +51 -0
  33. package/components/tiles/FSDashboardOrganisationTile.vue +3 -2
  34. package/components/tiles/FSDashboardOrganisationTypeTile.vue +3 -2
  35. package/components/tiles/FSDashboardShallowTile.vue +4 -3
  36. package/components/tiles/FSFolderTile.vue +2 -1
  37. package/components/tiles/FSServiceAccountOrganisationTile.vue +68 -0
  38. package/components/tiles/FSUserOrganisationTile.vue +19 -21
  39. package/components/treeviews/FSTreeViewFolder.vue +77 -0
  40. package/components/treeviews/FSTreeViewGroup.vue +77 -0
  41. package/package.json +14 -12
  42. package/utils/charts.ts +136 -0
  43. package/utils/dashboards.ts +6 -5
  44. package/utils/index.ts +1 -0
  45. package/utils/roles.ts +2 -1
  46. package/utils/users.ts +11 -2
@@ -27,43 +27,35 @@
27
27
  </FSRow>
28
28
  </template>
29
29
  <template
30
- #autocomplete-item="{ props, item }"
30
+ #item-label="{ item, font }"
31
31
  >
32
- <v-list-item
33
- v-bind="{ ...props, title: '' }"
32
+ <FSRow
33
+ align="center-left"
34
+ :wrap="false"
34
35
  >
35
- <FSRow
36
- align="center-left"
37
- :wrap="false"
36
+ <FSIcon
37
+ v-if="item.raw.icon"
38
+ >
39
+ {{ item.raw.icon }}
40
+ </FSIcon>
41
+ <FSSpan
42
+ :font="font"
38
43
  >
39
- <FSCheckbox
40
- v-if="$props.multiple"
41
- :modelValue="$props.modelValue?.includes(item.value)"
42
- @click="props.onClick"
43
- />
44
- <FSIcon
45
- v-if="item.raw.icon"
46
- >
47
- {{ item.raw.icon }}
48
- </FSIcon>
49
- <FSSpan>
50
- {{ item.raw.label }}
51
- </FSSpan>
52
- </FSRow>
53
- </v-list-item>
44
+ {{ item.raw.label }}
45
+ </FSSpan>
46
+ </FSRow>
54
47
  </template>
55
48
  </FSAutocompleteField>
56
49
  </template>
57
50
 
58
51
  <script lang="ts">
59
- import { computed, defineComponent, PropType } from "vue";
52
+ import { computed, defineComponent, type PropType } from "vue";
60
53
 
61
54
  import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
55
+ import { type GroupFilters } from "@dative-gpi/foundation-core-domain/models";
62
56
  import { useGroups } from "@dative-gpi/foundation-core-services/composables";
63
- import { GroupFilters } from "@dative-gpi/foundation-core-domain/models";
64
57
 
65
58
  import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
66
- import FSCheckbox from "@dative-gpi/foundation-shared-components/components/FSCheckbox.vue";
67
59
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
68
60
  import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
69
61
  import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
@@ -72,7 +64,6 @@ export default defineComponent({
72
64
  name: "FSAutocompleteGroup",
73
65
  components: {
74
66
  FSAutocompleteField,
75
- FSCheckbox,
76
67
  FSIcon,
77
68
  FSSpan,
78
69
  FSRow
@@ -107,7 +98,7 @@ export default defineComponent({
107
98
  return init.value && fetchingGroups.value;
108
99
  });
109
100
 
110
- const innerFetch = (search: string | null) => {
101
+ const fetch = (search: string | null) => {
111
102
  return getManyGroups({ ...props.groupFilters, search: search ?? undefined });
112
103
  };
113
104
 
@@ -115,7 +106,7 @@ export default defineComponent({
115
106
  groups,
116
107
  [() => props.groupFilters],
117
108
  emit,
118
- innerFetch
109
+ fetch
119
110
  );
120
111
 
121
112
  return {
@@ -27,43 +27,35 @@
27
27
  </FSRow>
28
28
  </template>
29
29
  <template
30
- #autocomplete-item="{ props, item }"
30
+ #item-label="{ item, font }"
31
31
  >
32
- <v-list-item
33
- v-bind="{ ...props, title: '' }"
32
+ <FSRow
33
+ align="center-left"
34
+ :wrap="false"
34
35
  >
35
- <FSRow
36
- align="center-left"
37
- :wrap="false"
36
+ <FSIcon
37
+ v-if="item.raw.icon"
38
38
  >
39
- <FSCheckbox
40
- v-if="$props.multiple"
41
- :modelValue="$props.modelValue?.includes(item.value)"
42
- @click="props.onClick"
43
- />
44
- <FSIcon
45
- v-if="item.raw.icon"
46
- >
47
- {{ item.raw.icon }}
48
- </FSIcon>
49
- <FSSpan>
50
- {{ item.raw.label }}
51
- </FSSpan>
52
- </FSRow>
53
- </v-list-item>
39
+ {{ item.raw.icon }}
40
+ </FSIcon>
41
+ <FSSpan
42
+ :font="font"
43
+ >
44
+ {{ item.raw.label }}
45
+ </FSSpan>
46
+ </FSRow>
54
47
  </template>
55
48
  </FSAutocompleteField>
56
49
  </template>
57
50
 
58
51
  <script lang="ts">
59
- import { computed, defineComponent, PropType } from "vue";
52
+ import { computed, defineComponent, type PropType } from "vue";
60
53
 
61
54
  import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
55
+ import { type LocationFilters } from "@dative-gpi/foundation-core-domain/models";
62
56
  import { useLocations } from "@dative-gpi/foundation-core-services/composables";
63
- import { LocationFilters } from "@dative-gpi/foundation-core-domain/models";
64
57
 
65
58
  import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
66
- import FSCheckbox from "@dative-gpi/foundation-shared-components/components/FSCheckbox.vue";
67
59
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
68
60
  import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
69
61
  import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
@@ -72,7 +64,6 @@ export default defineComponent({
72
64
  name: "FSAutocompleteLocation",
73
65
  components: {
74
66
  FSAutocompleteField,
75
- FSCheckbox,
76
67
  FSIcon,
77
68
  FSSpan,
78
69
  FSRow
@@ -103,7 +94,11 @@ export default defineComponent({
103
94
  setup(props, { emit }) {
104
95
  const { getMany: getManyLocations, fetching: fetchingLocations, entities: locations } = useLocations();
105
96
 
106
- const innerFetch = (search: string | null) => {
97
+ const loading = computed((): boolean => {
98
+ return init.value && fetchingLocations.value;
99
+ });
100
+
101
+ const fetch = (search: string | null) => {
107
102
  return getManyLocations({ ...props.locationFilters, search: search ?? undefined });
108
103
  };
109
104
 
@@ -111,13 +106,9 @@ export default defineComponent({
111
106
  locations,
112
107
  [() => props.locationFilters],
113
108
  emit,
114
- innerFetch
109
+ fetch
115
110
  );
116
111
 
117
- const loading = computed((): boolean => {
118
- return init.value && fetchingLocations.value;
119
- });
120
-
121
112
  return {
122
113
  locations,
123
114
  toggleSet,
@@ -10,11 +10,11 @@
10
10
  </template>
11
11
 
12
12
  <script lang="ts">
13
- import { computed, defineComponent, PropType } from "vue";
13
+ import { computed, defineComponent, type PropType } from "vue";
14
14
 
15
15
  import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
16
+ import { type ManufacturerFilters } from "@dative-gpi/foundation-core-domain/models";
16
17
  import { useManufacturers } from "@dative-gpi/foundation-core-services/composables";
17
- import { ManufacturerFilters } from "@dative-gpi/foundation-core-domain/models";
18
18
 
19
19
  import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
20
20
 
@@ -44,7 +44,11 @@ export default defineComponent({
44
44
  setup(props, { emit }) {
45
45
  const { getMany: getManyManufacturers, fetching: fetchingManufacturers, entities: manufacturers } = useManufacturers();
46
46
 
47
- const innerFetch = (search: string | null) => {
47
+ const loading = computed((): boolean => {
48
+ return init.value && fetchingManufacturers.value;
49
+ });
50
+
51
+ const fetch = (search: string | null) => {
48
52
  return getManyManufacturers({ ...props.manufacturerFilters, search: search ?? undefined });
49
53
  };
50
54
 
@@ -52,13 +56,9 @@ export default defineComponent({
52
56
  manufacturers,
53
57
  [() => props.manufacturerFilters],
54
58
  emit,
55
- innerFetch
59
+ fetch
56
60
  );
57
61
 
58
- const loading = computed((): boolean => {
59
- return init.value && fetchingManufacturers.value;
60
- });
61
-
62
62
  return {
63
63
  manufacturers,
64
64
  toggleSet,
@@ -10,11 +10,11 @@
10
10
  </template>
11
11
 
12
12
  <script lang="ts">
13
- import { computed, defineComponent, PropType } from "vue";
13
+ import { computed, defineComponent, type PropType } from "vue";
14
14
 
15
15
  import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
16
+ import { type ModelFilters } from "@dative-gpi/foundation-core-domain/models";
16
17
  import { useModels } from "@dative-gpi/foundation-core-services/composables";
17
- import { ModelFilters } from "@dative-gpi/foundation-core-domain/models";
18
18
 
19
19
  import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
20
20
 
@@ -48,7 +48,7 @@ export default defineComponent({
48
48
  return init.value && fetchingModels.value;
49
49
  });
50
50
 
51
- const innerFetch = (search: string | null) => {
51
+ const fetch = (search: string | null) => {
52
52
  return getManyModels({ ...props.modelFilters, search: search ?? undefined });
53
53
  };
54
54
 
@@ -56,7 +56,7 @@ export default defineComponent({
56
56
  models,
57
57
  [() => props.modelFilters],
58
58
  emit,
59
- innerFetch
59
+ fetch
60
60
  );
61
61
 
62
62
  return {
@@ -10,11 +10,11 @@
10
10
  </template>
11
11
 
12
12
  <script lang="ts">
13
- import { computed, defineComponent, PropType } from "vue";
13
+ import { computed, defineComponent, type PropType } from "vue";
14
14
 
15
+ import { type OrganisationTypeFilters } from "@dative-gpi/foundation-shared-domain/models";
15
16
  import { useOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
16
17
  import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
17
- import { OrganisationTypeFilters } from "@dative-gpi/foundation-shared-domain/models";
18
18
 
19
19
  import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
20
20
 
@@ -48,7 +48,7 @@ export default defineComponent({
48
48
  return init.value && fetchingOrganisationTypes.value;
49
49
  });
50
50
 
51
- const innerFetch = (search: string | null) => {
51
+ const fetch = (search: string | null) => {
52
52
  return getManyOrganisationTypes({ ...props.organisationTypeFilters, search: search ?? undefined });
53
53
  };
54
54
 
@@ -56,7 +56,7 @@ export default defineComponent({
56
56
  organisationTypes,
57
57
  [() => props.organisationTypeFilters],
58
58
  emit,
59
- innerFetch
59
+ fetch
60
60
  );
61
61
 
62
62
  return {
@@ -32,35 +32,28 @@
32
32
  </FSRow>
33
33
  </template>
34
34
  <template
35
- #autocomplete-item="{ props, item }"
35
+ #item-label="{ item, font }"
36
36
  >
37
- <v-list-item
38
- v-bind="{ ...props, title: '' }"
37
+ <FSRow
38
+ align="center-left"
39
+ :wrap="false"
39
40
  >
40
- <FSRow
41
- align="center-left"
42
- :wrap="false"
41
+ <FSIcon
42
+ v-if="item.raw.icon"
43
43
  >
44
- <FSCheckbox
45
- v-if="$props.multiple"
46
- :modelValue="$props.modelValue?.includes(item.value)"
47
- @click="props.onClick"
48
- />
49
- <FSIcon
50
- v-if="item.raw.icon"
51
- >
52
- {{ item.raw.icon }}
53
- </FSIcon>
54
- <FSSpan>
55
- {{ item.raw.label }}
56
- </FSSpan>
57
- <FSChip
58
- :color="roleTypeColor(item.raw.type)"
59
- :label="roleTypeLabel(item.raw.type)"
60
- :editable="false"
61
- />
62
- </FSRow>
63
- </v-list-item>
44
+ {{ item.raw.icon }}
45
+ </FSIcon>
46
+ <FSSpan
47
+ :font="font"
48
+ >
49
+ {{ item.raw.label }}
50
+ </FSSpan>
51
+ <FSChip
52
+ :color="roleTypeColor(item.raw.type)"
53
+ :label="roleTypeLabel(item.raw.type)"
54
+ :editable="false"
55
+ />
56
+ </FSRow>
64
57
  </template>
65
58
  <template
66
59
  #toggle-set-item="props"
@@ -88,16 +81,15 @@
88
81
  </template>
89
82
 
90
83
  <script lang="ts">
91
- import { computed, defineComponent, PropType } from "vue";
84
+ import { computed, defineComponent, type PropType } from "vue";
92
85
 
93
- import { RoleOrganisationFilters, RoleOrganisationTypeFilters, RoleType } from "@dative-gpi/foundation-core-domain/models";
86
+ import { type RoleOrganisationFilters, type RoleOrganisationTypeFilters, RoleType } from "@dative-gpi/foundation-core-domain/models";
94
87
  import { useRoleOrganisations, useRoleOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
95
88
  import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
96
89
 
97
90
  import { roleTypeColor, roleTypeLabel } from "../../utils";
98
91
 
99
92
  import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
100
- import FSCheckbox from "@dative-gpi/foundation-shared-components/components/FSCheckbox.vue";
101
93
  import FSButton from "@dative-gpi/foundation-shared-components/components/FSButton.vue";
102
94
  import FSChip from "@dative-gpi/foundation-shared-components/components/FSChip.vue";
103
95
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
@@ -108,7 +100,6 @@ export default defineComponent({
108
100
  name: "FSAutocompleteRole",
109
101
  components: {
110
102
  FSAutocompleteField,
111
- FSCheckbox,
112
103
  FSButton,
113
104
  FSChip,
114
105
  FSIcon,
@@ -131,6 +122,11 @@ export default defineComponent({
131
122
  required: false,
132
123
  default: null
133
124
  },
125
+ type: {
126
+ type: Number as PropType<RoleType>,
127
+ required: false,
128
+ default: RoleType.None
129
+ },
134
130
  multiple: {
135
131
  type: Boolean,
136
132
  required: false,
@@ -165,7 +161,7 @@ export default defineComponent({
165
161
  return init.value && (fetchingRoleOrganisationTypes.value || fetchingRoleOrganisations.value);
166
162
  });
167
163
 
168
- const innerUpdate = (value: Role[] | Role | null) => {
164
+ const update = (value: Role[] | Role | null) => {
169
165
  if (Array.isArray(value)) {
170
166
  emit("update:modelValue", value.map(v => v.id));
171
167
  emit("update:type", value.map(v => v.type));
@@ -176,7 +172,7 @@ export default defineComponent({
176
172
  }
177
173
  };
178
174
 
179
- const innerFetch = (search: string | null) => {
175
+ const fetch = (search: string | null) => {
180
176
  return Promise.all([
181
177
  getManyRoleOrganisationTypes({ ...props.roleOrganisationTypeFilters, search: search ?? undefined }),
182
178
  getManyRoleOrganisations({ ...props.roleOrganisationFilters, search: search ?? undefined })
@@ -187,8 +183,8 @@ export default defineComponent({
187
183
  roles,
188
184
  [() => props.roleOrganisationTypeFilters, () => props.roleOrganisationFilters],
189
185
  emit,
190
- innerFetch,
191
- innerUpdate
186
+ fetch,
187
+ update
192
188
  );
193
189
 
194
190
  return {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSAutocompleteField
3
+ itemTitle="name"
3
4
  :toggleSet="!$props.toggleSetDisabled && toggleSet"
4
- :customFilter="customFilter"
5
5
  :multiple="$props.multiple"
6
6
  :items="userOrganisations"
7
7
  :loading="loading"
@@ -29,31 +29,24 @@
29
29
  </FSRow>
30
30
  </template>
31
31
  <template
32
- #autocomplete-item="{ props, item }"
32
+ #item-label="{ item, font }"
33
33
  >
34
- <v-list-item
35
- v-bind="{ ...props, title: '' }"
34
+ <FSRow
35
+ align="center-left"
36
+ :wrap="false"
36
37
  >
37
- <FSRow
38
- align="center-left"
39
- :wrap="false"
38
+ <FSImage
39
+ v-if="item.raw.imageId"
40
+ height="26px"
41
+ width="26px"
42
+ :imageId="item.raw.imageId"
43
+ />
44
+ <FSSpan
45
+ :font="font"
40
46
  >
41
- <FSCheckbox
42
- v-if="$props.multiple"
43
- :modelValue="$props.modelValue?.includes(item.value)"
44
- @click="props.onClick"
45
- />
46
- <FSImage
47
- v-if="item.raw.imageId"
48
- height="26px"
49
- width="26px"
50
- :imageId="item.raw.imageId"
51
- />
52
- <FSSpan>
53
- {{ item.raw.name }}
54
- </FSSpan>
55
- </FSRow>
56
- </v-list-item>
47
+ {{ item.raw.name }}
48
+ </FSSpan>
49
+ </FSRow>
57
50
  </template>
58
51
  <template
59
52
  #toggle-set-item="props"
@@ -84,14 +77,13 @@
84
77
  </template>
85
78
 
86
79
  <script lang="ts">
87
- import { computed, defineComponent, PropType } from "vue";
80
+ import { computed, defineComponent, type PropType } from "vue";
88
81
 
89
- import { UserOrganisationFilters, UserOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
82
+ import { type UserOrganisationFilters, type UserOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
90
83
  import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
91
84
  import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
92
85
 
93
86
  import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
94
- import FSCheckbox from "@dative-gpi/foundation-shared-components/components/FSCheckbox.vue";
95
87
  import FSButton from "@dative-gpi/foundation-shared-components/components/FSButton.vue";
96
88
  import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
97
89
  import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
@@ -101,7 +93,6 @@ export default defineComponent({
101
93
  name: "FSAutocompleteUserOrganisation",
102
94
  components: {
103
95
  FSAutocompleteField,
104
- FSCheckbox,
105
96
  FSButton,
106
97
  FSImage,
107
98
  FSSpan,
@@ -144,19 +135,15 @@ export default defineComponent({
144
135
  }));
145
136
  });
146
137
 
147
- const innerFetch = (search: string | null) => {
138
+ const fetch = (search: string | null) => {
148
139
  return getManyUserOrganisations({ ...props.userOrganisationFilters, search: search ?? undefined });
149
140
  };
150
141
 
151
- const customFilter = (_: any, search: string, item: any): boolean => {
152
- return item.raw.name.toLowerCase().includes(search.toLowerCase());
153
- };
154
-
155
142
  const { toggleSet, search, init, onUpdate } = useAutocomplete(
156
143
  userOrganisations,
157
144
  [() => props.userOrganisationFilters],
158
145
  emit,
159
- innerFetch,
146
+ fetch,
160
147
  null,
161
148
  (item: UserOrganisationInfos) => item.id,
162
149
  (item: UserOrganisationInfos) => item.name
@@ -168,7 +155,6 @@ export default defineComponent({
168
155
  toggleSet,
169
156
  loading,
170
157
  search,
171
- customFilter,
172
158
  onUpdate
173
159
  };
174
160
  }