@dative-gpi/foundation-core-components 1.1.8 → 1.1.9

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.
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <FSTileList
3
+ :items="groupings"
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
+ <FSGroupingTileUI
14
+ :icon="item.icon"
15
+ :iconColor="item.color"
16
+ :label="item.label"
17
+ :code="item.code"
18
+ :subgroupingCount="item.subgroupingCount"
19
+ :width="direction === ListDirections.Column ? 'fill' : undefined"
20
+ :selectable="$props.selectable"
21
+ :modelValue="($props.modelValue ?? []).includes(item.id)"
22
+ @update:modelValue="toggleSelect(item)"
23
+ />
24
+ </template>
25
+ </FSTileList>
26
+ </template>
27
+
28
+ <script lang="ts">
29
+ import { defineComponent, type PropType, watch } from "vue";
30
+
31
+ import type { GroupingFilters } from "@dative-gpi/foundation-core-domain/models";
32
+ import { useGroupings } from "@dative-gpi/foundation-core-services/composables";
33
+
34
+ import FSGroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSGroupingTileUI.vue";
35
+ import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
36
+
37
+ import { ListDirections } from "@dative-gpi/foundation-shared-domain/enums";
38
+
39
+ export default defineComponent({
40
+ name: "FSTileGroupingsList",
41
+ components: {
42
+ FSTileList,
43
+ FSGroupingTileUI
44
+ },
45
+ props: {
46
+ groupingFilters: {
47
+ type: Object as PropType<GroupingFilters>,
48
+ required: false,
49
+ default: () => ({})
50
+ },
51
+ modelValue: {
52
+ type: Array as PropType<string[]>,
53
+ required: false,
54
+ default: () => []
55
+ },
56
+ selectable: {
57
+ type: Boolean,
58
+ required: false,
59
+ default: false
60
+ }
61
+ },
62
+ emits: ["update:modelValue"],
63
+ setup(props) {
64
+ const { entities: groupings, getMany, fetching } = useGroupings();
65
+
66
+ const fetch = () => {
67
+ getMany(props.groupingFilters);
68
+ };
69
+
70
+ watch(() => props.groupingFilters, fetch, { immediate: true });
71
+
72
+ return {
73
+ groupings,
74
+ fetching,
75
+ ListDirections
76
+ };
77
+ }
78
+ });
79
+ </script>
@@ -0,0 +1,81 @@
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>
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
5
5
  },
6
6
  "sideEffects": false,
7
- "version": "1.1.8",
7
+ "version": "1.1.9",
8
8
  "description": "",
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -13,11 +13,11 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
- "@dative-gpi/foundation-core-domain": "1.1.8",
17
- "@dative-gpi/foundation-core-services": "1.1.8",
18
- "@dative-gpi/foundation-shared-components": "1.1.8",
19
- "@dative-gpi/foundation-shared-domain": "1.1.8",
20
- "@dative-gpi/foundation-shared-services": "1.1.8"
16
+ "@dative-gpi/foundation-core-domain": "1.1.9",
17
+ "@dative-gpi/foundation-core-services": "1.1.9",
18
+ "@dative-gpi/foundation-shared-components": "1.1.9",
19
+ "@dative-gpi/foundation-shared-domain": "1.1.9",
20
+ "@dative-gpi/foundation-shared-services": "1.1.9"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -29,5 +29,5 @@
29
29
  "sass": "1.71.1",
30
30
  "sass-loader": "13.3.2"
31
31
  },
32
- "gitHead": "d3acfab8c634278f1fe3794747580d0b00f10d0a"
32
+ "gitHead": "8038b4a3049af008bc22173c7870de416bce25f1"
33
33
  }