@dative-gpi/foundation-core-components 1.1.23 → 1.1.24-unit-formatter

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 (39) hide show
  1. package/components/autocompletes/FSAutocompleteDataCategory.vue +2 -11
  2. package/components/entities/FSBaseEntitiesList.vue +0 -4
  3. package/components/entities/FSEntityField.vue +5 -11
  4. package/components/entities/FSSelectEntitiesList.vue +8 -35
  5. package/components/entities/FSSimpleEntitiesList.vue +2 -15
  6. package/components/entities/FSTileEntitiesList.vue +3 -1
  7. package/components/explorers/FSBaseFoldersExplorer.vue +337 -0
  8. package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +6 -7
  9. package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +6 -7
  10. package/components/lists/charts/FSBaseChartsList.vue +14 -7
  11. package/components/lists/dashboards/FSBaseDashboardsList.vue +224 -40
  12. package/components/lists/dashboards/FSSimpleDashboardsList.vue +53 -27
  13. package/components/lists/dashboards/FSTileDashboardsList.vue +62 -30
  14. package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +8 -10
  15. package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +7 -10
  16. package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +1 -66
  17. package/components/lists/folders/FSBaseFoldersList.vue +5 -1
  18. package/components/lists/groupings/FSBaseGroupingsList.vue +17 -5
  19. package/components/lists/groups/FSSimpleGroupsList.vue +0 -1
  20. package/components/lists/locations/FSBaseLocationsList.vue +3 -3
  21. package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +1 -21
  22. package/components/lists/userOrganisations/{FSUserOrganisationsChipGroup.vue → FSChipUserOrganisationsList.vue} +2 -2
  23. package/components/tiles/FSLocationTile.vue +1 -2
  24. package/package.json +8 -8
  25. package/utils/dashboards.ts +30 -12
  26. package/utils/tables.ts +7 -13
  27. package/utils/users.ts +1 -1
  28. package/components/explorers/FSBaseDashboardsExplorer.vue +0 -312
  29. package/components/explorers/FSDashboardExplorerElementTypeChip.vue +0 -37
  30. package/components/lists/groupings/FSSimpleGroupingsList.vue +0 -44
  31. package/components/lists/groupings/FSTileGroupingsList.vue +0 -79
  32. package/components/lists/playlists/FSTilePlaylistsList.vue +0 -93
  33. package/components/lists/subgroupings/FSBaseSubgroupingsList.vue +0 -197
  34. package/components/lists/subgroupings/FSSimpleSubgroupingsList.vue +0 -45
  35. package/components/lists/subgroupings/FSSubgroupingsChipGroup.vue +0 -61
  36. package/components/lists/subgroupings/FSTileSubgroupingsList.vue +0 -81
  37. package/components/tiles/FSGroupingTile.vue +0 -67
  38. package/components/tiles/FSPlaylistTile.vue +0 -78
  39. package/components/tiles/FSSubgroupingTile.vue +0 -69
@@ -1,197 +0,0 @@
1
- <template>
2
- <FSDataTable
3
- :loading="fetchingSubgroupings"
4
- :items="subgroupings"
5
- :itemTo="$props.itemTo"
6
- :tableCode="$props.tableCode"
7
- :selectable="$props.selectable"
8
- :showSearch="$props.showSearch"
9
- :singleSelect="$props.singleSelect"
10
- :groupBy="groupBy"
11
- :modelValue="$props.modelValue"
12
- @update:modelValue="$emit('update:modelValue', $event)"
13
- v-bind="$attrs"
14
- >
15
- <template
16
- v-for="(_, name) in $slots"
17
- v-slot:[name]="slotData"
18
- >
19
- <slot
20
- :name="name"
21
- v-bind="slotData"
22
- />
23
- </template>
24
- <template
25
- #group-header="{ item }"
26
- >
27
- <FSRow
28
- height="54px"
29
- align="center-left"
30
- >
31
- <FSCard
32
- padding="16px 16px 16px 56px"
33
- height="100%"
34
- width="100%"
35
- :borderRadius="0"
36
- :variant="CardVariants.Full"
37
- :color="getColors(ColorEnum.Light).base"
38
- >
39
- <FSGroupingChip
40
- :label="getGroupingLabel(item.value)"
41
- :iconColor="getGroupingColor(item.value)"
42
- :icon="getGroupingIcon(item.value)"
43
- />
44
- </FSCard>
45
- </FSRow>
46
- </template>
47
- <template
48
- #item.icon="{ item }"
49
- >
50
- <FSIcon>
51
- {{ item.icon }}
52
- </FSIcon>
53
- </template>
54
- <template
55
- #item.tile="{ item, toggleSelect }"
56
- >
57
- <FSSubgroupingTileUI
58
- :selectable="$props.selectable"
59
- :modelValue="isSelected(item.id)"
60
- :singleSelect="$props.singleSelect"
61
- :deviceOrganisationsCount="item.deviceOrganisationsCount"
62
- :groupingLabel="item.groupingLabel"
63
- :groupingIcon="item.groupingIcon"
64
- :groupingColor="item.groupingColor"
65
- :label="item.label"
66
- :icon="item.icon"
67
- :to="$props.itemTo && $props.itemTo(item)"
68
- @update:modelValue="toggleSelect(item)"
69
- />
70
- </template>
71
- </FSDataTable>
72
- </template>
73
-
74
- <script lang="ts">
75
- import { computed, defineComponent, type PropType, watch } from "vue";
76
- import { type RouteLocation } from "vue-router";
77
- import _ from "lodash";
78
-
79
- import type { SubgroupingFilters, SubgroupingInfos } from "@dative-gpi/foundation-core-domain/models";
80
- import { useSubgroupings } from "@dative-gpi/foundation-core-services/composables";
81
-
82
- import FSDataTable from "../FSDataTable.vue";
83
-
84
- import FSSubgroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSSubgroupingTileUI.vue";
85
- import FSGroupingChip from "@dative-gpi/foundation-shared-components/components/FSGroupingChip.vue";
86
- import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
87
- import FSCard from "@dative-gpi/foundation-shared-components/components/FSCard.vue";
88
- import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
89
-
90
- import { ColorEnum, CardVariants } from "@dative-gpi/foundation-shared-components/models";
91
- import { useColors } from "@dative-gpi/foundation-shared-components/composables";
92
-
93
- export default defineComponent({
94
- name: "FSBaseSubgroupingsList",
95
- components: {
96
- FSSubgroupingTileUI,
97
- FSGroupingChip,
98
- FSDataTable,
99
- FSIcon,
100
- FSCard,
101
- FSRow
102
- },
103
- props: {
104
- tableCode: {
105
- type: String as PropType<string | null>,
106
- required: false,
107
- default: null
108
- },
109
- itemTo: {
110
- type: Function as PropType<(item: SubgroupingInfos) => Partial<RouteLocation>>,
111
- required: false
112
- },
113
- subgroupingFilters: {
114
- type: Object as PropType<SubgroupingFilters>,
115
- required: false,
116
- default: null
117
- },
118
- selectable: {
119
- type: Boolean,
120
- required: false,
121
- default: true
122
- },
123
- singleSelect: {
124
- type: Boolean,
125
- required: false,
126
- default: false
127
- },
128
- showSearch: {
129
- type: Boolean,
130
- required: false,
131
- default: true
132
- },
133
- modelValue: {
134
- type: Array as PropType<string[]>,
135
- required: false,
136
- default: () => []
137
- }
138
- },
139
- inheritAttrs: false,
140
- emits: ["update:modelValue"],
141
- setup(props) {
142
- const { getMany: fetchSubgroupings, fetching: fetchingSubgroupings, entities: subgroupings } = useSubgroupings();
143
- const { getColors } = useColors();
144
-
145
- const groupBy = computed(() => ({
146
- key: "groupingId",
147
- order: "asc" as const
148
- }));
149
-
150
- const groupingMap = computed(() => {
151
- return _.chain(subgroupings.value)
152
- .keyBy('groupingId')
153
- .mapValues(s => ({
154
- label: s.groupingLabel,
155
- color: s.groupingColor,
156
- icon: s.groupingIcon
157
- }))
158
- .value();
159
- });
160
-
161
- const getGroupingLabel = (groupingId: string): string => {
162
- return groupingMap.value[groupingId].label;
163
- };
164
-
165
- const getGroupingColor = (groupingId: string): string => {
166
- return groupingMap.value[groupingId].color;
167
- };
168
-
169
- const getGroupingIcon = (groupingId: string): string => {
170
- return groupingMap.value[groupingId].icon;
171
- };
172
-
173
- const isSelected = (id: string) => {
174
- return props.modelValue.includes(id);
175
- };
176
-
177
- watch(() => props.subgroupingFilters, (next, previous) => {
178
- if ((!next && !previous) || !_.isEqual(next, previous)) {
179
- fetchSubgroupings(props.subgroupingFilters);
180
- }
181
- }, { immediate: true });
182
-
183
- return {
184
- fetchingSubgroupings,
185
- getGroupingLabel,
186
- getGroupingColor,
187
- getGroupingIcon,
188
- subgroupings,
189
- CardVariants,
190
- isSelected,
191
- getColors,
192
- ColorEnum,
193
- groupBy,
194
- };
195
- }
196
- });
197
- </script>
@@ -1,45 +0,0 @@
1
- <template>
2
- <FSSimpleList
3
- :items="subgroupings"
4
- :loading="fetching"
5
- v-bind="$attrs"
6
- />
7
- </template>
8
-
9
- <script lang="ts">
10
- import { defineComponent, type PropType, watch } from "vue";
11
-
12
- import type { SubgroupingFilters } from "@dative-gpi/foundation-core-domain/models";
13
- import { useSubgroupings } from "@dative-gpi/foundation-core-services/composables";
14
-
15
- import FSSimpleList from "@dative-gpi/foundation-shared-components/components/lists/FSSimpleList.vue";
16
-
17
- export default defineComponent({
18
- name: "FSSimpleSubgroupingsList",
19
- components: {
20
- FSSimpleList,
21
- },
22
- props: {
23
- subgroupingFilters: {
24
- type: Object as PropType<SubgroupingFilters>,
25
- required: false,
26
- default: () => ({})
27
- }
28
- },
29
- inheritAttrs: false,
30
- setup(props) {
31
- const { entities: subgroupings, getMany, fetching } = useSubgroupings();
32
-
33
- const fetch = () => {
34
- getMany(props.subgroupingFilters);
35
- };
36
-
37
- watch(() => props.subgroupingFilters, fetch, { immediate: true });
38
-
39
- return {
40
- subgroupings,
41
- fetching
42
- };
43
- }
44
- });
45
- </script>
@@ -1,61 +0,0 @@
1
- <template>
2
- <FSChipGroup
3
- v-if="$props.subgroupings && $props.subgroupings.length > 0"
4
- :items="$props.subgroupings"
5
- :maxItems="$props.maxItems"
6
- :variant="$props.variant"
7
- >
8
- <template
9
- #item.chip="{ item }"
10
- >
11
- <FSSubgroupingChip
12
- :groupingLabel="item.groupingLabel"
13
- :groupingIcon="item.groupingIcon"
14
- :groupingColor="item.groupingColor"
15
- :label="item.label"
16
- :icon="item.icon"
17
- :to="$props.itemTo ? $props.itemTo(item) : null"
18
- />
19
- </template>
20
- </FSChipGroup>
21
- </template>
22
-
23
- <script lang="ts">
24
- import type { PropType} from "vue";
25
- import { defineComponent } from "vue";
26
- import { type RouteLocation } from "vue-router";
27
-
28
- import type { SubgroupingInfos } from "@dative-gpi/foundation-core-domain/models";
29
-
30
- import FSSubgroupingChip from "@dative-gpi/foundation-shared-components/components/FSSubgroupingChip.vue";
31
- import FSChipGroup from "@dative-gpi/foundation-shared-components/components/FSChipGroup.vue";
32
- import { ChipGroupVariants, type ChipGroupVariant } from "@dative-gpi/foundation-shared-components/models";
33
-
34
- export default defineComponent({
35
- name: "FSSubgroupingsChipGroup",
36
- components: {
37
- FSSubgroupingChip,
38
- FSChipGroup
39
- },
40
- props: {
41
- subgroupings: {
42
- type: Array as PropType<SubgroupingInfos[]>,
43
- required: true
44
- },
45
- itemTo: {
46
- type: Function as PropType<(item: SubgroupingInfos) => Partial<RouteLocation>>,
47
- required: false
48
- },
49
- maxItems: {
50
- type: Number as PropType<number | null>,
51
- required: false,
52
- default: 1
53
- },
54
- variant: {
55
- type: String as PropType<ChipGroupVariant>,
56
- required: false,
57
- default: ChipGroupVariants.Menu
58
- },
59
- }
60
- });
61
- </script>
@@ -1,81 +0,0 @@
1
- <template>
2
- <FSTileList
3
- :items="subgroupings"
4
- :loading="fetching"
5
- :selectable="$props.selectable"
6
- :modelValue="$props.modelValue"
7
- @update:modelValue="$emit('update:modelValue', $event)"
8
- v-bind="$attrs"
9
- >
10
- <template
11
- #item.tile="{ item, toggleSelect, direction }"
12
- >
13
- <FSSubgroupingTileUI
14
- :icon="item.icon"
15
- :label="item.label"
16
- :code="item.code"
17
- :groupingLabel="item.groupingLabel"
18
- :groupingIcon="item.groupingIcon"
19
- :groupingColor="item.groupingColor"
20
- :deviceOrganisationsCount="item.deviceOrganisationsCount"
21
- :width="direction === ListDirections.Column ? 'fill' : undefined"
22
- :selectable="$props.selectable"
23
- :modelValue="($props.modelValue ?? []).includes(item.id)"
24
- @update:modelValue="toggleSelect(item)"
25
- />
26
- </template>
27
- </FSTileList>
28
- </template>
29
-
30
- <script lang="ts">
31
- import { defineComponent, type PropType, watch } from "vue";
32
-
33
- import type { SubgroupingFilters } from "@dative-gpi/foundation-core-domain/models";
34
- import { useSubgroupings } from "@dative-gpi/foundation-core-services/composables";
35
-
36
- import FSSubgroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSSubgroupingTileUI.vue";
37
- import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
38
-
39
- import { ListDirections } from "@dative-gpi/foundation-shared-domain/enums";
40
-
41
- export default defineComponent({
42
- name: "FSTileSubgroupingsList",
43
- components: {
44
- FSTileList,
45
- FSSubgroupingTileUI
46
- },
47
- props: {
48
- subgroupingFilters: {
49
- type: Object as PropType<SubgroupingFilters>,
50
- required: false,
51
- default: () => ({})
52
- },
53
- modelValue: {
54
- type: Array as PropType<string[]>,
55
- required: false,
56
- default: () => []
57
- },
58
- selectable: {
59
- type: Boolean,
60
- required: false,
61
- default: false
62
- }
63
- },
64
- emits: ["update:modelValue"],
65
- setup(props) {
66
- const { entities: subgroupings, getMany, fetching } = useSubgroupings();
67
-
68
- const fetch = () => {
69
- getMany(props.subgroupingFilters);
70
- };
71
-
72
- watch(() => props.subgroupingFilters, fetch, { immediate: true });
73
-
74
- return {
75
- subgroupings,
76
- fetching,
77
- ListDirections
78
- };
79
- }
80
- });
81
- </script>
@@ -1,67 +0,0 @@
1
- <template>
2
- <FSLoadTile
3
- v-if="getting"
4
- :selectable="$props.selectable"
5
- :modelValue="$props.modelValue"
6
- @update:modelValue="$emit('update:modelValue', $event)"
7
- />
8
- <FSGroupingTileUI
9
- v-else-if="entity"
10
- :icon="entity.icon"
11
- :iconColor="entity.color"
12
- :label="entity.label"
13
- :code="entity.code"
14
- :subgroupingCount="entity.subgroupingCount"
15
- :selectable="$props.selectable"
16
- :modelValue="$props.modelValue"
17
- @update:modelValue="$emit('update:modelValue', $event)"
18
- v-bind="$attrs"
19
- />
20
- </template>
21
-
22
- <script lang="ts">
23
- import { defineComponent, watch } from "vue";
24
-
25
- import { useGrouping } from "@dative-gpi/foundation-core-services/composables";
26
-
27
- import FSGroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSGroupingTileUI.vue";
28
- import FSLoadTile from "@dative-gpi/foundation-shared-components/components/tiles/FSLoadTile.vue";
29
-
30
- export default defineComponent({
31
- name: "FSGroupingTile",
32
- components: {
33
- FSGroupingTileUI,
34
- FSLoadTile
35
- },
36
- props: {
37
- groupingId: {
38
- type: String,
39
- required: true
40
- },
41
- modelValue: {
42
- type: Boolean,
43
- required: false,
44
- default: false
45
- },
46
- selectable: {
47
- type: Boolean,
48
- required: false,
49
- default: true
50
- }
51
- },
52
- emits: ["update:modelValue"],
53
- inheritAttrs: false,
54
- setup(props) {
55
- const { get, getting, entity } = useGrouping();
56
-
57
- watch(() => props.groupingId, () => {
58
- get(props.groupingId);
59
- }, { immediate: true });
60
-
61
- return {
62
- getting,
63
- entity
64
- };
65
- }
66
- });
67
- </script>
@@ -1,78 +0,0 @@
1
- <template>
2
- <FSLoadTile
3
- v-if="getting"
4
- :selectable="$props.selectable"
5
- :modelValue="$props.modelValue"
6
- @update:modelValue="$emit('update:modelValue', $event)"
7
- />
8
- <PlaylistTileUI
9
- v-else-if="entity"
10
- :dashboardsCount="entity.dashboards?.length ?? 0"
11
- :looped="entity.looped"
12
- :delay="entity.delay"
13
- :label="entity.label"
14
- :code="entity.code"
15
- :selectable="$props.selectable"
16
- :modelValue="$props.modelValue"
17
- @update:modelValue="$emit('update:modelValue', $event)"
18
- v-bind="$attrs"
19
- >
20
- <template
21
- v-for="(_, name) in $slots"
22
- v-slot:[name]="slotData"
23
- >
24
- <slot
25
- :name="name"
26
- v-bind="slotData"
27
- />
28
- </template>
29
- </PlaylistTileUI>
30
- </template>
31
-
32
- <script lang="ts">
33
- import { defineComponent, watch } from "vue";
34
-
35
- import { usePlaylist } from "@dative-gpi/foundation-core-services/composables";
36
-
37
- import FSLoadTile from "@dative-gpi/foundation-shared-components/components/tiles/FSLoadTile.vue";
38
-
39
- import PlaylistTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSPlaylistTileUI.vue";
40
-
41
-
42
- export default defineComponent({
43
- name: "FSPlaylistTile",
44
- components: {
45
- PlaylistTileUI,
46
- FSLoadTile
47
- },
48
- props: {
49
- playlistId: {
50
- type: String,
51
- required: true
52
- },
53
- modelValue: {
54
- type: Boolean,
55
- required: false,
56
- default: false
57
- },
58
- selectable: {
59
- type: Boolean,
60
- required: false,
61
- default: false
62
- },
63
- },
64
- emits: ["update:modelValue"],
65
- setup(props) {
66
- const { get, getting, entity } = usePlaylist();
67
-
68
- watch(() => props.playlistId, () => {
69
- get(props.playlistId);
70
- }, { immediate: true });
71
-
72
- return {
73
- getting,
74
- entity
75
- };
76
- }
77
- });
78
- </script>
@@ -1,69 +0,0 @@
1
- <template>
2
- <FSLoadTile
3
- v-if="getting"
4
- :selectable="$props.selectable"
5
- :modelValue="$props.modelValue"
6
- @update:modelValue="$emit('update:modelValue', $event)"
7
- />
8
- <FSSubgroupingTileUI
9
- v-else-if="entity"
10
- :icon="entity.icon"
11
- :label="entity.label"
12
- :code="entity.code"
13
- :groupingLabel="entity.groupingLabel"
14
- :groupingIcon="entity.groupingIcon"
15
- :groupingColor="entity.groupingColor"
16
- :deviceOrganisationsCount="entity.deviceOrganisationsCount"
17
- :selectable="$props.selectable"
18
- :modelValue="$props.modelValue"
19
- @update:modelValue="$emit('update:modelValue', $event)"
20
- v-bind="$attrs"
21
- />
22
- </template>
23
-
24
- <script lang="ts">
25
- import { defineComponent, watch } from "vue";
26
-
27
- import { useSubgrouping } from "@dative-gpi/foundation-core-services/composables";
28
-
29
- import FSSubgroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSSubgroupingTileUI.vue";
30
- import FSLoadTile from "@dative-gpi/foundation-shared-components/components/tiles/FSLoadTile.vue";
31
-
32
- export default defineComponent({
33
- name: "FSSubgroupingTile",
34
- components: {
35
- FSSubgroupingTileUI,
36
- FSLoadTile
37
- },
38
- props: {
39
- subgroupingId: {
40
- type: String,
41
- required: true
42
- },
43
- modelValue: {
44
- type: Boolean,
45
- required: false,
46
- default: false
47
- },
48
- selectable: {
49
- type: Boolean,
50
- required: false,
51
- default: true
52
- }
53
- },
54
- emits: ["update:modelValue"],
55
- inheritAttrs: false,
56
- setup(props) {
57
- const { get, getting, entity } = useSubgrouping();
58
-
59
- watch(() => props.subgroupingId, () => {
60
- get(props.subgroupingId);
61
- }, { immediate: true });
62
-
63
- return {
64
- getting,
65
- entity
66
- };
67
- }
68
- });
69
- </script>