@dative-gpi/foundation-core-components 1.1.7 → 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.
- package/components/lists/groupings/FSTileGroupingsList.vue +79 -0
- package/components/lists/subgroupings/FSBaseSubgroupingsList.vue +3 -1
- package/components/lists/subgroupings/FSTileSubgroupingsList.vue +81 -0
- package/components/tiles/FSGroupingTile.vue +67 -0
- package/components/tiles/FSSubgroupingTile.vue +69 -0
- package/package.json +7 -7
|
@@ -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>
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
:tableCode="$props.tableCode"
|
|
7
7
|
:selectable="$props.selectable"
|
|
8
8
|
:showSearch="$props.showSearch"
|
|
9
|
-
:disableIterator="true"
|
|
10
9
|
:singleSelect="$props.singleSelect"
|
|
11
10
|
:groupBy="groupBy"
|
|
12
11
|
:modelValue="$props.modelValue"
|
|
@@ -60,6 +59,9 @@
|
|
|
60
59
|
:modelValue="isSelected(item.id)"
|
|
61
60
|
:singleSelect="$props.singleSelect"
|
|
62
61
|
:deviceOrganisationsCount="item.deviceOrganisationsCount"
|
|
62
|
+
:groupingLabel="item.groupingLabel"
|
|
63
|
+
:groupingIcon="item.groupingIcon"
|
|
64
|
+
:groupingColor="item.groupingColor"
|
|
63
65
|
:label="item.label"
|
|
64
66
|
:icon="item.icon"
|
|
65
67
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
@@ -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>
|
|
@@ -0,0 +1,67 @@
|
|
|
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>
|
|
@@ -0,0 +1,69 @@
|
|
|
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>
|
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.
|
|
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.
|
|
17
|
-
"@dative-gpi/foundation-core-services": "1.1.
|
|
18
|
-
"@dative-gpi/foundation-shared-components": "1.1.
|
|
19
|
-
"@dative-gpi/foundation-shared-domain": "1.1.
|
|
20
|
-
"@dative-gpi/foundation-shared-services": "1.1.
|
|
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": "
|
|
32
|
+
"gitHead": "8038b4a3049af008bc22173c7870de416bce25f1"
|
|
33
33
|
}
|