@dative-gpi/foundation-shared-components 0.0.102 → 0.0.104

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.
@@ -5,7 +5,9 @@
5
5
  :style="style"
6
6
  v-bind="$attrs"
7
7
  >
8
- <slot v-bind="{ color: $props.color, colors }" />
8
+ <slot
9
+ v-bind="{ color: $props.color, colors }"
10
+ />
9
11
  </FSCard>
10
12
  </template>
11
13
 
@@ -39,7 +41,7 @@ export default defineComponent({
39
41
 
40
42
  const colors = computed(() => getColors(props.color));
41
43
 
42
- const style = computed((): { [key: string] : string | undefined } => {
44
+ const style = computed((): { [key: string] : string | null | undefined } => {
43
45
  return {
44
46
  "--fs-color-background-color": colors.value.light,
45
47
  "--fs-color-border-color" : colors.value.lightContrast,
@@ -14,27 +14,37 @@
14
14
  <FSCol
15
15
  gap="2px"
16
16
  >
17
- <template v-if="headerSlot(item.code)">
17
+ <template
18
+ v-if="headerSlot(item.code)"
19
+ >
18
20
  <component
19
21
  :is="headerSlot(item.code)"
20
22
  v-bind="{ item }"
21
23
  />
22
24
  </template>
23
- <template v-else>
25
+ <template
26
+ v-else
27
+ >
24
28
  <FSText
25
29
  :font="item.hideDefault ? 'text-body' : 'text-overline'"
26
30
  >
27
31
  {{ item.label }}
28
32
  </FSText>
29
33
  </template>
30
- <template v-if="!item.hideDefault">
31
- <template v-if="itemSlot(item.code)">
34
+ <template
35
+ v-if="!item.hideDefault"
36
+ >
37
+ <template
38
+ v-if="itemSlot(item.code)"
39
+ >
32
40
  <component
33
41
  :is="itemSlot(item.code)"
34
42
  v-bind="{ item }"
35
43
  />
36
44
  </template>
37
- <template v-else>
45
+ <template
46
+ v-else
47
+ >
38
48
  <FSText>
39
49
  {{ item.value }}
40
50
  </FSText>
@@ -75,8 +85,8 @@ export default defineComponent({
75
85
  props: {
76
86
  items: {
77
87
  type: Array as PropType<FSGridItem[]>,
78
- default: [],
79
- required: false
88
+ required: false,
89
+ default: () => []
80
90
  }
81
91
  },
82
92
  setup() {
@@ -123,9 +133,9 @@ export default defineComponent({
123
133
 
124
134
  return {
125
135
  style,
126
- itemSlot,
136
+ itemEndSlot,
127
137
  headerSlot,
128
- itemEndSlot
138
+ itemSlot
129
139
  };
130
140
  }
131
141
  });
@@ -18,8 +18,14 @@
18
18
  <FSGrid
19
19
  :items="item.items"
20
20
  >
21
- <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
22
- <slot :name="name" v-bind="slotData" />
21
+ <template
22
+ v-for="(_, name) in $slots"
23
+ v-slot:[name]="slotData"
24
+ >
25
+ <slot
26
+ :name="name"
27
+ v-bind="slotData"
28
+ />
23
29
  </template>
24
30
  </FSGrid>
25
31
  </FSCol>
@@ -47,8 +53,8 @@ export default defineComponent({
47
53
  props: {
48
54
  items: {
49
55
  type: Array as PropType<FSGridMosaic[]>,
50
- default: [],
51
- required: false
56
+ required: false,
57
+ default: () => []
52
58
  },
53
59
  cols: {
54
60
  type: Number as PropType<1 | 2>,
@@ -60,7 +66,7 @@ export default defineComponent({
60
66
  const { isExtraSmall } = useBreakpoints();
61
67
 
62
68
  const width = computed(() => {
63
- return props.cols == 2 && !isExtraSmall.value ? "calc(50% - 16px)" : "100%";
69
+ return props.cols == 2 && !isExtraSmall.value ? "calc(50% - 16px)" : "100%";
64
70
  });
65
71
 
66
72
  return {
@@ -1,36 +1,66 @@
1
1
  <template>
2
2
  <FSRow
3
- v-for="(modelStatus, index) in $props.modelStatuses"
4
- align="center-center"
5
- width="hug"
3
+ align="center-left"
6
4
  gap="4px"
7
- :key="index"
8
5
  :wrap="false"
9
6
  >
10
- <FSStatus
11
- v-for="(statusGroup, index) in deviceStatus(modelStatus)"
12
- :modelStatus="modelStatus"
13
- :statusGroup="statusGroup"
14
- :key="index"
7
+ <FSConnectivity
8
+ v-if="$props.deviceConnectivity && $props.deviceConnectivity.status != ConnectivityStatus.None"
9
+ :deviceConnectivity="$props.deviceConnectivity"
15
10
  />
11
+ <FSWorstAlert
12
+ v-if="$props.deviceWorstAlert"
13
+ :deviceAlerts="$props.deviceAlerts.length"
14
+ :deviceAlert="$props.deviceWorstAlert"
15
+ />
16
+ <template
17
+ v-for="(modelStatus, index) in $props.modelStatuses"
18
+ >
19
+ <FSStatus
20
+ v-if="deviceStatus(modelStatus)"
21
+ :statusGroup="deviceStatus(modelStatus)"
22
+ :modelStatus="modelStatus"
23
+ :key="index"
24
+ />
25
+ </template>
16
26
  </FSRow>
17
27
  </template>
18
28
 
19
29
  <script lang="ts">
20
30
  import { defineComponent, PropType } from "vue";
21
31
 
22
- import { FSDeviceStatus, FSDeviceStatusGroup, FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
32
+ import { FSDeviceAlert, FSDeviceConnectivity, FSDeviceStatus, FSDeviceStatusGroup, FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
33
+ import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/models";
23
34
 
35
+ import FSConnectivity from "./FSConnectivity.vue";
36
+ import FSWorstAlert from "./FSWorstAlert.vue";
24
37
  import FSStatus from "./FSStatus.vue";
25
38
  import FSRow from "../FSRow.vue";
26
39
 
27
40
  export default defineComponent({
28
41
  name: "FSStatusesRow",
29
42
  components: {
43
+ FSConnectivity,
44
+ FSWorstAlert,
30
45
  FSStatus,
31
46
  FSRow
32
47
  },
33
48
  props: {
49
+ deviceConnectivity: {
50
+ type: Object as PropType<FSDeviceConnectivity>,
51
+ required: false,
52
+ default: null
53
+ },
54
+ deviceWorstAlert: {
55
+ type: Object as PropType<FSDeviceAlert>,
56
+ required: false,
57
+ default: null
58
+ },
59
+ deviceAlerts: {
60
+ type: Array as PropType<FSDeviceAlert[]>,
61
+ required: false,
62
+ default: () => []
63
+ },
34
64
  modelStatuses: {
35
65
  type: Array as PropType<FSModelStatus[]>,
36
66
  required: true
@@ -41,23 +71,24 @@ export default defineComponent({
41
71
  }
42
72
  },
43
73
  setup(props) {
44
- const deviceStatus = (modelStatus: FSModelStatus): FSDeviceStatusGroup[] => {
74
+ const deviceStatus = (modelStatus: FSModelStatus): FSDeviceStatusGroup | null => {
45
75
  const deviceStatus = props.deviceStatuses
46
76
  .find((deviceStatus: FSDeviceStatus) => deviceStatus.modelStatusId === modelStatus.id);
47
77
  if (deviceStatus != null) {
48
- return deviceStatus.statusGroups;
78
+ return deviceStatus.statusGroups[0];
49
79
  }
50
80
  if (modelStatus.showDefault) {
51
- return [{
81
+ return {
52
82
  label: modelStatus.label,
53
83
  icon: modelStatus.iconDefault!,
54
84
  color: modelStatus.colorDefault!
55
- }];
85
+ };
56
86
  }
57
- return [];
58
- }
87
+ return null;
88
+ };
59
89
 
60
90
  return {
91
+ ConnectivityStatus,
61
92
  deviceStatus
62
93
  };
63
94
  }
@@ -12,8 +12,8 @@
12
12
  <FSRow
13
13
  align="center-center"
14
14
  gap="24px"
15
- :wrap="false"
16
15
  :height="imageSize"
16
+ :wrap="false"
17
17
  >
18
18
  <FSCol
19
19
  gap="12px"
@@ -35,23 +35,13 @@
35
35
  {{ $props.code }}
36
36
  </FSText>
37
37
  </FSCol>
38
- <FSRow
39
- gap="4px"
40
- >
41
- <FSConnectivity
42
- v-if="$props.deviceConnectivity && $props.deviceConnectivity.status != ConnectivityStatus.None"
43
- :deviceConnectivity="$props.deviceConnectivity"
44
- />
45
- <FSWorstAlert
46
- v-if="$props.deviceWorstAlert"
47
- :deviceAlert="$props.deviceWorstAlert"
48
- :deviceAlerts="$props.deviceAlerts.length"
49
- />
50
- <FSStatusesRow
51
- :modelStatuses="lineModelStatuses"
52
- :deviceStatuses="lineDeviceStatuses"
53
- />
54
- </FSRow>
38
+ <FSStatusesRow
39
+ :deviceConnectivity="$props.deviceConnectivity"
40
+ :deviceWorstAlert="$props.deviceWorstAlert"
41
+ :deviceStatuses="singleDeviceStatuses"
42
+ :modelStatuses="singleModelStatuses"
43
+ :deviceAlerts="$props.deviceAlerts"
44
+ />
55
45
  </FSCol>
56
46
  <FSImage
57
47
  v-if="$props.imageId"
@@ -77,13 +67,10 @@ import { computed, defineComponent, PropType } from "vue";
77
67
 
78
68
  import { FSModelStatus, FSDeviceStatus, FSDeviceAlert, FSDeviceConnectivity } from "@dative-gpi/foundation-shared-components/models";
79
69
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
80
- import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/models";
81
70
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
82
71
 
83
72
  import FSStatusesCarousel from "../deviceOrganisations/FSStatusesCarousel.vue";
84
- import FSConnectivity from "../deviceOrganisations/FSConnectivity.vue";
85
73
  import FSStatusesRow from "../deviceOrganisations/FSStatusesRow.vue";
86
- import FSWorstAlert from "../deviceOrganisations/FSWorstAlert.vue";
87
74
  import FSDivider from "../FSDivider.vue";
88
75
  import FSImage from "../FSImage.vue";
89
76
  import FSText from "../FSText.vue";
@@ -95,9 +82,7 @@ export default defineComponent({
95
82
  name: "FSDeviceOrganisationTileUI",
96
83
  components: {
97
84
  FSStatusesCarousel,
98
- FSConnectivity,
99
85
  FSStatusesRow,
100
- FSWorstAlert,
101
86
  FSDivider,
102
87
  FSImage,
103
88
  FSText,
@@ -160,9 +145,9 @@ export default defineComponent({
160
145
  setup(props) {
161
146
  const { isMobileSized } = useBreakpoints();
162
147
 
163
- const lineModelStatuses = computed((): FSModelStatus[] => {
148
+ const singleModelStatuses = computed((): FSModelStatus[] => {
164
149
  return props.modelStatuses.filter(modelStatus => {
165
- if (!modelStatus.inline || modelStatus.groupById) {
150
+ if (modelStatus.groupById != null) {
166
151
  return false;
167
152
  }
168
153
  if (!modelStatus.showDefault) {
@@ -171,24 +156,18 @@ export default defineComponent({
171
156
  }
172
157
  }
173
158
  return true;
174
- }).slice(0, 4).sort((a, b) => a.index - b.index);
159
+ }).slice(0, 5).sort((a, b) => a.index - b.index);
175
160
  });
176
161
 
177
- const lineDeviceStatuses = computed((): FSDeviceStatus[] => {
162
+ const singleDeviceStatuses = computed((): FSDeviceStatus[] => {
178
163
  return props.deviceStatuses.filter(deviceStatus => {
179
- return lineModelStatuses.value.some(modelStatus => modelStatus.id === deviceStatus.modelStatusId)
164
+ return singleModelStatuses.value.some(modelStatus => modelStatus.id === deviceStatus.modelStatusId)
180
165
  });
181
166
  });
182
167
 
183
168
  const carouselModelStatuses = computed((): FSModelStatus[] => {
184
- const notCarouselModelStatuses = props.modelStatuses.filter(modelStatus => {
185
- if (!modelStatus.inline || modelStatus.groupById) {
186
- return false;
187
- }
188
- return true;
189
- }).slice(0, 4);
190
169
  return props.modelStatuses.filter(modelStatus => {
191
- if (notCarouselModelStatuses.some(lineModelStatus => modelStatus.id === lineModelStatus.id)) {
170
+ if (modelStatus.groupById == null) {
192
171
  return false;
193
172
  }
194
173
  if (!modelStatus.showDefault) {
@@ -197,7 +176,7 @@ export default defineComponent({
197
176
  }
198
177
  }
199
178
  return true;
200
- }).sort((a, b) => (a.index + (a.inline ? b.index : 0)) - b.index);
179
+ }).sort((a, b) => a.index - b.index);
201
180
  });
202
181
 
203
182
  const carouselDeviceStatuses = computed((): FSDeviceStatus[] => {
@@ -219,12 +198,11 @@ export default defineComponent({
219
198
  });
220
199
 
221
200
  return {
222
- ColorEnum,
223
- lineModelStatuses,
224
- lineDeviceStatuses,
225
- ConnectivityStatus,
226
- carouselModelStatuses,
227
201
  carouselDeviceStatuses,
202
+ carouselModelStatuses,
203
+ singleDeviceStatuses,
204
+ singleModelStatuses,
205
+ ColorEnum,
228
206
  imageSize,
229
207
  infoWidth
230
208
  };
@@ -1,11 +1,10 @@
1
1
  export interface FSModelStatus {
2
- id: string;
3
- label: string;
4
- inline: boolean;
5
- index: number;
6
- groupById?: string | null;
7
- groupByLabel?: string | null;
8
- showDefault: boolean;
9
- iconDefault?: string | null;
10
- colorDefault?: string | null;
2
+ id: string;
3
+ label: string;
4
+ index: number;
5
+ groupById?: string | null;
6
+ groupByLabel?: string | null;
7
+ showDefault: boolean;
8
+ iconDefault?: string | null;
9
+ colorDefault?: string | null;
11
10
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "0.0.102",
4
+ "version": "0.0.104",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "0.0.102",
14
- "@dative-gpi/foundation-shared-services": "0.0.102",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.104",
14
+ "@dative-gpi/foundation-shared-services": "0.0.104",
15
15
  "@fontsource/montserrat": "^5.0.16",
16
16
  "@lexical/clipboard": "^0.12.5",
17
17
  "@lexical/history": "^0.12.5",
@@ -32,5 +32,5 @@
32
32
  "sass": "^1.69.5",
33
33
  "sass-loader": "^13.3.2"
34
34
  },
35
- "gitHead": "d2534b5fa79d557769bcdfd5da4b8dffa0f42c3e"
35
+ "gitHead": "2c21d0a59340ac959e6b885b75638469148cde26"
36
36
  }