@dative-gpi/foundation-core-components 1.0.67 → 1.0.68

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.
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <FSDataTable
3
- :items="roleOrganisations"
4
- :itemTo="$props.itemTo"
5
3
  :loading="fetchingRoleOrganisations"
6
4
  :showSelect="$props.editable"
7
5
  :tableCode="$props.tableCode"
6
+ :items="roleOrganisations"
7
+ :itemTo="$props.itemTo"
8
8
  :modelValue="$props.modelValue"
9
9
  @update:modelValue="$emit('update:modelValue', $event)"
10
10
  v-bind="$attrs"
@@ -52,29 +52,29 @@
52
52
  </template>
53
53
 
54
54
  <script lang="ts">
55
- import type { PropType} from "vue";
56
- import { defineComponent, watch } from "vue";
57
- import type { RouteLocation } from "vue-router";
55
+ import { defineComponent, type PropType, watch } from "vue";
56
+ import { type RouteLocation } from "vue-router";
58
57
  import _ from "lodash";
59
58
 
60
- import type { RoleOrganisationFilters, RoleOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
59
+ import { type RoleOrganisationFilters, type RoleOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
61
60
  import { userTypeIcon, userTypeLabel } from "@dative-gpi/foundation-core-components/utils";
62
61
  import { useRoleOrganisations } from "@dative-gpi/foundation-core-services/composables";
63
62
 
64
- import FSDataTable from "../FSDataTable.vue";
65
- import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
63
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
66
64
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
67
65
  import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
68
- import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
66
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
67
+
68
+ import FSDataTable from "../FSDataTable.vue";
69
69
 
70
70
  export default defineComponent({
71
71
  name: "FSBaseRoleOrganisationsList",
72
72
  components: {
73
73
  FSDataTable,
74
- FSRow,
74
+ FSTagGroup,
75
75
  FSIcon,
76
76
  FSText,
77
- FSTagGroup
77
+ FSRow
78
78
  },
79
79
  props: {
80
80
  tableCode: {
@@ -0,0 +1,127 @@
1
+ <template>
2
+ <FSDataTable
3
+ :loading="fetchingServiceAccountRoleOrganisations"
4
+ :items="serviceAccountRoleOrganisations"
5
+ :showSelect="$props.editable"
6
+ :tableCode="$props.tableCode"
7
+ :itemTo="$props.itemTo"
8
+ :modelValue="$props.modelValue"
9
+ @update:modelValue="$emit('update:modelValue', $event)"
10
+ v-bind="$attrs"
11
+ >
12
+ <template
13
+ v-for="(_, name) in $slots"
14
+ v-slot:[name]="slotData"
15
+ >
16
+ <slot
17
+ :name="name"
18
+ v-bind="slotData"
19
+ />
20
+ </template>
21
+ <template
22
+ #item.icon="{ item }"
23
+ >
24
+ <FSIcon>
25
+ {{ item.icon }}
26
+ </FSIcon>
27
+ </template>
28
+ <template
29
+ #item.userType="{ item }"
30
+ >
31
+ <FSRow
32
+ align="center-left"
33
+ >
34
+ <FSIcon>
35
+ {{ userTypeIcon(item.userType) }}
36
+ </FSIcon>
37
+ <FSText>
38
+ {{ userTypeLabel(item.userType) }}
39
+ </FSText>
40
+ </FSRow>
41
+ </template>
42
+ <template
43
+ #item.tags="{ item }"
44
+ >
45
+ <FSTagGroup
46
+ variant="slide"
47
+ :editable="false"
48
+ :tags="item.tags"
49
+ />
50
+ </template>
51
+ </FSDataTable>
52
+ </template>
53
+
54
+ <script lang="ts">
55
+ import { defineComponent, type PropType, watch } from "vue";
56
+ import { type RouteLocation } from "vue-router";
57
+ import _ from "lodash";
58
+
59
+ import { type ServiceAccountRoleOrganisationFilters, type ServiceAccountRoleOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
60
+ import { useServiceAccountRoleOrganisations } from "@dative-gpi/foundation-core-services/composables";
61
+ import { userTypeIcon, userTypeLabel } from "@dative-gpi/foundation-core-components/utils";
62
+
63
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
64
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
65
+ import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
66
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
67
+
68
+ import FSDataTable from "../FSDataTable.vue";
69
+
70
+ export default defineComponent({
71
+ name: "FSBaseServiceAccountRoleOrganisationsList",
72
+ components: {
73
+ FSDataTable,
74
+ FSTagGroup,
75
+ FSIcon,
76
+ FSText,
77
+ FSRow
78
+ },
79
+ props: {
80
+ tableCode: {
81
+ type: String,
82
+ required: true
83
+ },
84
+ serviceAccountRoleOrganisationsFilters: {
85
+ type: Object as PropType<ServiceAccountRoleOrganisationFilters | null>,
86
+ required: false,
87
+ default: null
88
+ },
89
+ itemTo: {
90
+ type: Function as PropType<(item: ServiceAccountRoleOrganisationInfos) => Partial<RouteLocation>>,
91
+ required: false
92
+ },
93
+ editable: {
94
+ type: Boolean,
95
+ required: false,
96
+ default: true
97
+ },
98
+ modelValue: {
99
+ type: Array as PropType<string[]>,
100
+ required: false,
101
+ default: () => []
102
+ }
103
+ },
104
+ emits: ["update:modelValue"],
105
+ setup(props) {
106
+ const { getMany: getManyServiceAccountRoleOrganisations, fetching: fetchingServiceAccountRoleOrganisations, entities: serviceAccountRoleOrganisations } = useServiceAccountRoleOrganisations();
107
+
108
+ const isSelected = (id: string): boolean => {
109
+ return props.modelValue.includes(id);
110
+ };
111
+
112
+ watch(() => props.serviceAccountRoleOrganisationsFilters, (next, previous) => {
113
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
114
+ getManyServiceAccountRoleOrganisations(props.serviceAccountRoleOrganisationsFilters ?? undefined);
115
+ }
116
+ }, { immediate: true });
117
+
118
+ return {
119
+ fetchingServiceAccountRoleOrganisations,
120
+ serviceAccountRoleOrganisations,
121
+ userTypeLabel,
122
+ userTypeIcon,
123
+ isSelected
124
+ };
125
+ }
126
+ });
127
+ </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": "1.0.67",
4
+ "version": "1.0.68",
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": "1.0.67",
14
- "@dative-gpi/foundation-core-services": "1.0.67",
15
- "@dative-gpi/foundation-shared-components": "1.0.67",
16
- "@dative-gpi/foundation-shared-domain": "1.0.67",
17
- "@dative-gpi/foundation-shared-services": "1.0.67"
13
+ "@dative-gpi/foundation-core-domain": "1.0.68",
14
+ "@dative-gpi/foundation-core-services": "1.0.68",
15
+ "@dative-gpi/foundation-shared-components": "1.0.68",
16
+ "@dative-gpi/foundation-shared-domain": "1.0.68",
17
+ "@dative-gpi/foundation-shared-services": "1.0.68"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -26,5 +26,5 @@
26
26
  "sass": "1.71.1",
27
27
  "sass-loader": "13.3.2"
28
28
  },
29
- "gitHead": "ba62d45e0ff1f5df1090b715b4a01abc8ce9c3a4"
29
+ "gitHead": "341389f8890f7ebe2e0ac03ea54e5ed38e9c7e56"
30
30
  }