@dative-gpi/foundation-shared-components 1.0.59 → 1.0.62

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 (31) hide show
  1. package/components/FSEditImage.vue +1 -1
  2. package/components/FSEditImageUI.vue +7 -5
  3. package/components/FSGrid.vue +1 -0
  4. package/components/FSTag.vue +2 -2
  5. package/components/FSTagGroup.vue +1 -1
  6. package/components/deviceOrganisations/FSConnectivity.vue +1 -0
  7. package/components/deviceOrganisations/FSConnectivityCard.vue +17 -45
  8. package/components/deviceOrganisations/FSStatus.vue +6 -1
  9. package/components/deviceOrganisations/FSStatusCard.vue +33 -57
  10. package/components/deviceOrganisations/FSStatusesRow.vue +8 -2
  11. package/components/deviceOrganisations/FSWorstAlert.vue +17 -10
  12. package/components/deviceOrganisations/FSWorstAlertCard.vue +33 -43
  13. package/components/fields/FSBaseField.vue +12 -5
  14. package/components/fields/FSEntityFieldUI.vue +17 -3
  15. package/components/fields/FSNumberField.vue +1 -0
  16. package/components/fields/FSTagField.vue +1 -1
  17. package/components/fields/FSTermField.vue +3 -0
  18. package/components/lists/FSDataTableUI.vue +2 -2
  19. package/components/lists/FSSimpleList.vue +1 -0
  20. package/components/tiles/FSDeviceOrganisationTileUI.vue +6 -0
  21. package/components/tiles/FSLocationTileUI.vue +9 -2
  22. package/components/tiles/FSModelTileUI.vue +5 -46
  23. package/components/tiles/FSSimpleTileUI.vue +2 -3
  24. package/components/views/FSEntityHeader.vue +20 -27
  25. package/components/views/FSEntityView.vue +6 -0
  26. package/package.json +4 -4
  27. package/styles/components/fs_color_field.scss +1 -0
  28. package/styles/components/fs_edit_image.scss +8 -0
  29. package/styles/components/fs_tabs.scss +1 -0
  30. package/styles/globals/overrides.scss +2 -7
  31. package/utils/time.ts +3 -3
@@ -39,7 +39,7 @@ export default defineComponent({
39
39
 
40
40
  const onError = (): void => {
41
41
  if (props.imageId) {
42
- console.log("onError");
42
+ console.error("Error loading image", props.imageId);
43
43
  getImage(props.imageId);
44
44
  }
45
45
  };
@@ -39,6 +39,7 @@
39
39
  :wrap="false"
40
40
  >
41
41
  <FSRow
42
+ class="fs-edit-image-standard-row"
42
43
  gap="24px"
43
44
  :wrap="false"
44
45
  >
@@ -59,6 +60,7 @@
59
60
  :width="$props.width"
60
61
  />
61
62
  <FSCol
63
+ class="fs-edit-image-standard-label-wrapper"
62
64
  align="center-left"
63
65
  height="fill"
64
66
  width="hug"
@@ -91,12 +93,12 @@
91
93
  </FSCol>
92
94
  </FSCol>
93
95
  </FSRow>
94
- <v-spacer />
95
96
  <FSRow
96
- width="hug"
97
+ align="center-right"
98
+ :width="isExtraSmall ? '40px' : 'hug'"
97
99
  >
98
100
  <FSButtonFileMini
99
- accept="image/*"
101
+ accept=".jpg,.jpeg,.png"
100
102
  :readFile="false"
101
103
  @update:metadata="onUpload"
102
104
  />
@@ -124,7 +126,7 @@
124
126
  padding="4px"
125
127
  >
126
128
  <FSButtonFileMini
127
- accept="image/*"
129
+ accept=".jpg,.jpeg,.png"
128
130
  :readFile="false"
129
131
  @update:metadata="onUpload"
130
132
  />
@@ -157,7 +159,7 @@
157
159
  <FSButtonFileMini
158
160
  class="fs-edit-image-hidden-button"
159
161
  ref="invisibleButtonRef"
160
- accept="image/*"
162
+ accept=".jpg,.jpeg,.png"
161
163
  :readFile="false"
162
164
  @update:metadata="onUpload"
163
165
  />
@@ -27,6 +27,7 @@
27
27
  >
28
28
  <FSText
29
29
  :font="item.hideDefault ? 'text-body' : 'text-overline'"
30
+ variant="soft"
30
31
  >
31
32
  {{ item.label }}
32
33
  </FSText>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <FSRow
3
- align="center-left"
3
+ align="center-center"
4
4
  class="fs-tag"
5
5
  :height="$props.height"
6
6
  :width="$props.width"
@@ -79,7 +79,7 @@ export default defineComponent({
79
79
  color: {
80
80
  type: String as PropType<ColorBase>,
81
81
  required: false,
82
- default: ColorEnum.Primary
82
+ default: ColorEnum.Light
83
83
  },
84
84
  editable: {
85
85
  type: Boolean,
@@ -64,7 +64,7 @@ export default defineComponent({
64
64
  color: {
65
65
  type: String as PropType<ColorBase>,
66
66
  required: false,
67
- default: ColorEnum.Primary
67
+ default: ColorEnum.Light
68
68
  },
69
69
  editable: {
70
70
  type: Boolean,
@@ -2,6 +2,7 @@
2
2
  <v-menu
3
3
  :closeOnContentClick="false"
4
4
  v-model="menu"
5
+ location="bottom center"
5
6
  >
6
7
  <template
7
8
  #activator="{ props }"
@@ -1,55 +1,33 @@
1
1
  <template>
2
2
  <FSCard
3
- padding="2px 2px 8px 2px"
3
+ padding="12px 24px"
4
4
  :elevation="true"
5
- :border="false"
6
5
  >
7
6
  <FSCol
8
7
  align="center-center"
8
+ gap="12px"
9
9
  >
10
+ <FSChip
11
+ :prependIcon="$props.deviceConnectivity.icon"
12
+ :color="$props.deviceConnectivity.color"
13
+ :label="connectivityLabel($props.deviceConnectivity.status)"
14
+ />
10
15
  <FSCol
11
16
  align="center-center"
12
17
  gap="0px"
13
18
  >
14
- <FSRow
15
- align="center-right"
16
- >
17
- <FSButton
18
- icon="mdi-close"
19
- variant="icon"
20
- @click="$emit('close')"
21
- />
22
- </FSRow>
23
- <FSCol
24
- align="center-center"
25
- padding="0px 24px"
26
- gap="12px"
27
- >
28
- <FSChip
29
- :prependIcon="$props.deviceConnectivity.icon"
30
- :color="$props.deviceConnectivity.color"
31
- :label="connectivityLabel($props.deviceConnectivity.status)"
32
- />
33
- <FSRow
34
- width="hug"
35
- >
36
- <FSText>
37
- {{ $tr("ui.shared.device-connectivity.last-message", "Last message") }}
38
- </FSText>
39
- </FSRow>
40
- </FSCol>
41
- </FSCol>
42
- <FSRow
43
- v-if="deviceTimestamp"
44
- padding="0px 24px"
45
- width="hug"
46
- >
47
- <FSSpan
48
- font="text-overline"
19
+ <FSText>
20
+ {{ $tr("ui.device.last-message-received", "Last message received") }}
21
+ </FSText>
22
+ <FSText
23
+ v-if="deviceTimestamp"
24
+ font="text-button"
25
+ :color="$props.deviceConnectivity.color"
26
+ variant="soft"
49
27
  >
50
28
  {{ deviceTimestamp }}
51
- </FSSpan>
52
- </FSRow>
29
+ </FSText>
30
+ </FSCol>
53
31
  </FSCol>
54
32
  </FSCard>
55
33
  </template>
@@ -62,24 +40,18 @@ import { useDateFormat } from "@dative-gpi/foundation-shared-services/composable
62
40
 
63
41
  import { connectivityLabel } from "../../utils";
64
42
 
65
- import FSButton from "../FSButton.vue";
66
43
  import FSCard from "../FSCard.vue";
67
44
  import FSChip from "../FSChip.vue";
68
45
  import FSText from "../FSText.vue";
69
- import FSSpan from "../FSSpan.vue";
70
46
  import FSCol from "../FSCol.vue";
71
- import FSRow from "../FSRow.vue";
72
47
 
73
48
  export default defineComponent({
74
49
  name: "FSConnectivityCard",
75
50
  components: {
76
- FSButton,
77
51
  FSCard,
78
52
  FSChip,
79
53
  FSText,
80
- FSSpan,
81
54
  FSCol,
82
- FSRow
83
55
  },
84
56
  props: {
85
57
  deviceConnectivity: {
@@ -2,13 +2,14 @@
2
2
  <v-menu
3
3
  :closeOnContentClick="false"
4
4
  v-model="menu"
5
+ location="bottom center"
5
6
  >
6
7
  <template
7
8
  #activator="{ props }"
8
9
  >
9
10
  <FSColorIcon
10
11
  class="fs-stopclick"
11
- size="m"
12
+ :size="$props.size"
12
13
  :color="$props.statusGroup.color"
13
14
  @click.prevent.stop
14
15
  v-bind="props"
@@ -47,6 +48,10 @@ export default defineComponent({
47
48
  statusGroup: {
48
49
  type: Object as PropType<FSDeviceStatusGroup>,
49
50
  required: true
51
+ },
52
+ size: {
53
+ type: [Array, String, Number] as PropType<"s" | "m" | "l" | string[] | number[] | string | number | null>,
54
+ default: "m"
50
55
  }
51
56
  },
52
57
  setup() {
@@ -1,68 +1,42 @@
1
1
  <template>
2
2
  <FSCard
3
- padding="2px 2px 8px 2px"
3
+ padding="12px 24px"
4
4
  :elevation="true"
5
- :border="false"
6
5
  >
7
6
  <FSCol
8
7
  align="center-center"
8
+ gap="12px"
9
9
  >
10
+ <FSChip
11
+ :prependIcon="$props.statusGroup.icon"
12
+ :color="$props.statusGroup.color"
13
+ :label="statusLabel"
14
+ />
10
15
  <FSCol
16
+ v-if="$props.statusGroup.value"
11
17
  align="center-center"
12
18
  gap="0px"
13
19
  >
14
- <FSRow
15
- v-if="$props.closable"
16
- align="center-right"
20
+ <FSText
21
+ v-if="$props.statusGroup.value && $props.modelStatus.groupById && $props.statusGroup.groupByValue"
17
22
  >
18
- <FSButton
19
- icon="mdi-close"
20
- variant="icon"
21
- @click="$emit('close')"
22
- />
23
- </FSRow>
24
- <FSCol
25
- align="center-center"
26
- padding="0px 24px"
27
- gap="12px"
23
+ {{ $props.modelStatus.groupByLabel }} {{ $props.statusGroup.groupByValue }}
24
+ </FSText>
25
+ <FSText
26
+ v-if="$props.statusGroup.value"
27
+ font="text-button"
28
+ :color="$props.statusGroup.color"
28
29
  >
29
- <FSChip
30
- :prependIcon="$props.statusGroup.icon"
31
- :color="$props.statusGroup.color"
32
- :label="statusLabel"
33
- />
34
- <FSRow
35
- v-if="$props.statusGroup.value"
36
- width="hug"
37
- >
38
- <FSText
39
- font="text-button"
40
- :color="$props.statusGroup.color"
41
- >
42
- {{ $props.statusGroup.value }} {{ $props.statusGroup.unit }}
43
- </FSText>
44
- </FSRow>
45
- <FSRow
46
- v-if="$props.statusGroup.value && $props.modelStatus.groupById && $props.statusGroup.groupByValue"
47
- width="hug"
48
- >
49
- <FSSpan>
50
- {{ $props.modelStatus.groupByLabel }} {{ $props.statusGroup.groupByValue }}
51
- </FSSpan>
52
- </FSRow>
53
- </FSCol>
30
+ {{ statusValue }} {{ $props.statusGroup.unit }}
31
+ </FSText>
54
32
  </FSCol>
55
- <FSRow
33
+ <FSText
56
34
  v-if="deviceTimestamp"
57
- padding="0px 24px"
58
- width="hug"
35
+ font="text-overline"
36
+ variant="soft"
59
37
  >
60
- <FSSpan
61
- font="text-overline"
62
- >
63
- {{ deviceTimestamp }}
64
- </FSSpan>
65
- </FSRow>
38
+ {{ deviceTimestamp }}
39
+ </FSText>
66
40
  </FSCol>
67
41
  </FSCard>
68
42
  </template>
@@ -73,24 +47,18 @@ import { computed, defineComponent, type PropType } from "vue";
73
47
  import type { FSDeviceStatusGroup, FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
74
48
  import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
75
49
 
76
- import FSButton from "../FSButton.vue";
77
50
  import FSCard from "../FSCard.vue";
78
51
  import FSChip from "../FSChip.vue";
79
52
  import FSText from "../FSText.vue";
80
- import FSSpan from "../FSSpan.vue";
81
53
  import FSCol from "../FSCol.vue";
82
- import FSRow from "../FSRow.vue";
83
54
 
84
55
  export default defineComponent({
85
56
  name: "FSStatusCard",
86
57
  components: {
87
- FSButton,
88
58
  FSCard,
89
59
  FSChip,
90
60
  FSText,
91
- FSSpan,
92
- FSCol,
93
- FSRow
61
+ FSCol
94
62
  },
95
63
  props: {
96
64
  closable: {
@@ -114,6 +82,13 @@ export default defineComponent({
114
82
  return props.statusGroup.label || props.modelStatus.label;
115
83
  });
116
84
 
85
+ const statusValue = computed((): string => {
86
+ if (props.statusGroup.value && !isNaN(parseFloat(props.statusGroup.value))) {
87
+ return parseFloat(props.statusGroup.value).toLocaleString("fullwide", { maximumFractionDigits: 2 });
88
+ }
89
+ return props.statusGroup.value || "";
90
+ });
91
+
117
92
  const deviceTimestamp = computed((): string => {
118
93
  if (props.statusGroup.sourceTimestamp) {
119
94
  return epochToLongTimeFormat(props.statusGroup.sourceTimestamp);
@@ -123,7 +98,8 @@ export default defineComponent({
123
98
 
124
99
  return {
125
100
  deviceTimestamp,
126
- statusLabel
101
+ statusLabel,
102
+ statusValue
127
103
  };
128
104
  }
129
105
  });
@@ -10,8 +10,9 @@
10
10
  />
11
11
  <FSWorstAlert
12
12
  v-if="$props.deviceWorstAlert"
13
- :deviceAlerts="$props.deviceAlerts.length"
14
- :deviceAlert="$props.deviceWorstAlert"
13
+ :deviceWorstAlert="$props.deviceWorstAlert"
14
+ :deviceAlerts="$props.deviceAlerts"
15
+ :alertTo="$props.alertTo"
15
16
  />
16
17
  <template
17
18
  v-for="(modelStatus, index) in $props.modelStatuses"
@@ -68,6 +69,11 @@ export default defineComponent({
68
69
  deviceStatuses: {
69
70
  type: Array as PropType<FSDeviceStatus[]>,
70
71
  required: true
72
+ },
73
+ alertTo: {
74
+ type: Function,
75
+ required: false,
76
+ default: null
71
77
  }
72
78
  },
73
79
  setup(props) {
@@ -2,6 +2,7 @@
2
2
  <v-menu
3
3
  :closeOnContentClick="false"
4
4
  v-model="menu"
5
+ location="bottom center"
5
6
  >
6
7
  <template
7
8
  #activator="{ props }"
@@ -22,7 +23,8 @@
22
23
  </FSBadge>
23
24
  </template>
24
25
  <FSWorstAlertCard
25
- :deviceAlert="deviceAlert"
26
+ :deviceAlert="deviceWorstAlert"
27
+ :alertTo="$props.alertTo"
26
28
  @close="menu = false"
27
29
  />
28
30
  </v-menu>
@@ -31,8 +33,8 @@
31
33
  <script lang="ts">
32
34
  import { computed, defineComponent, type PropType, ref } from "vue";
33
35
 
36
+ import { type FSDeviceAlert } from "@dative-gpi/foundation-shared-components/models";
34
37
  import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/enums";
35
- import type { FSDeviceAlert } from "@dative-gpi/foundation-shared-components/models";
36
38
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
37
39
 
38
40
  import FSWorstAlertCard from "./FSWorstAlertCard.vue";
@@ -47,21 +49,26 @@ export default defineComponent({
47
49
  FSBadge
48
50
  },
49
51
  props: {
50
- deviceAlert: {
52
+ deviceWorstAlert: {
51
53
  type: Object as PropType<FSDeviceAlert>,
52
54
  required: true
53
55
  },
54
56
  deviceAlerts: {
55
- type: Number,
57
+ type: Array as PropType<FSDeviceAlert[]>,
56
58
  required: false,
57
- default: 0
59
+ default: () => []
60
+ },
61
+ alertTo: {
62
+ type: Function,
63
+ required: false,
64
+ default: null
58
65
  }
59
66
  },
60
67
  setup(props) {
61
68
  const menu = ref(false);
62
69
 
63
70
  const criticityColor = computed(() => {
64
- switch (props.deviceAlert?.criticity) {
71
+ switch (props.deviceWorstAlert?.criticity) {
65
72
  case Criticity.Error: return ColorEnum.Error;
66
73
  case Criticity.Warning: return ColorEnum.Warning;
67
74
  default: return ColorEnum.Primary;
@@ -69,7 +76,7 @@ export default defineComponent({
69
76
  });
70
77
 
71
78
  const statusIcon = computed(() => {
72
- switch (props.deviceAlert?.status) {
79
+ switch (props.deviceWorstAlert?.status) {
73
80
  case AlertStatus.Pending: return "mdi-timer-outline";
74
81
  case AlertStatus.Untriggered: return "mdi-timer-off-outline";
75
82
  case AlertStatus.Unresolved: return "mdi-alert-circle-outline";
@@ -82,13 +89,13 @@ export default defineComponent({
82
89
  });
83
90
 
84
91
  const badgeLabel = computed((): string | null => {
85
- if (props.deviceAlerts < 1) {
92
+ if (!props.deviceAlerts || props.deviceAlerts.length < 1) {
86
93
  return null;
87
94
  }
88
- if (props.deviceAlerts > 9) {
95
+ if (props.deviceAlerts.length > 9) {
89
96
  return "9+";
90
97
  }
91
- return (props.deviceAlerts).toString();
98
+ return props.deviceAlerts.length.toString();
92
99
  });
93
100
 
94
101
  return {
@@ -1,55 +1,44 @@
1
1
  <template>
2
2
  <FSCard
3
- padding="2px 2px 8px 2px"
3
+ padding="12px 24px"
4
4
  :elevation="true"
5
- :border="false"
6
5
  >
7
6
  <FSCol
8
7
  align="center-center"
8
+ gap="12px"
9
9
  >
10
+ <FSChip
11
+ :label="$tr('ui.common.alert', 'Alert')"
12
+ :prependIcon="statusIcon"
13
+ :color="criticityColor"
14
+ />
10
15
  <FSCol
11
16
  align="center-center"
12
17
  gap="0px"
13
18
  >
14
- <FSRow
15
- align="center-right"
19
+ <FSText>
20
+ {{ $tr('ui.alert.status', 'Status') }} : {{ statusLabel }}
21
+ </FSText>
22
+ <FSText
23
+ font="text-button"
24
+ :color="criticityColor"
16
25
  >
17
- <FSButton
18
- icon="mdi-close"
19
- variant="icon"
20
- @click="$emit('close')"
21
- />
22
- </FSRow>
23
- <FSCol
24
- align="center-center"
25
- padding="0px 24px"
26
- gap="12px"
27
- >
28
- <FSChip
29
- :label="$props.deviceAlert.label"
30
- :prependIcon="statusIcon"
31
- :color="criticityColor"
32
- />
33
- <FSRow
34
- width="hug"
35
- >
36
- <FSText>
37
- {{ statusLabel }}
38
- </FSText>
39
- </FSRow>
40
- </FSCol>
26
+ {{ $props.deviceAlert.label }}
27
+ </FSText>
41
28
  </FSCol>
42
- <FSRow
29
+ <FSText
43
30
  v-if="deviceTimestamp"
44
- padding="0px 24px"
45
- width="hug"
31
+ font="text-overline"
32
+ variant="dark"
46
33
  >
47
- <FSSpan
48
- font="text-overline"
49
- >
50
- {{ deviceTimestamp }}
51
- </FSSpan>
52
- </FSRow>
34
+ {{ deviceTimestamp }}
35
+ </FSText>
36
+ <FSButton
37
+ v-if="$props.alertTo"
38
+ icon="mdi-information-outline"
39
+ :label="$tr('ui.alert.details', 'Alert details')"
40
+ :to="$props.alertTo($props.deviceAlert.id)"
41
+ />
53
42
  </FSCol>
54
43
  </FSCard>
55
44
  </template>
@@ -58,18 +47,16 @@
58
47
  import { computed, defineComponent, type PropType } from "vue";
59
48
 
60
49
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
61
- import type { FSDeviceAlert} from "@dative-gpi/foundation-shared-components/models";
62
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
50
+ import { type FSDeviceAlert} from "@dative-gpi/foundation-shared-components/models";
63
51
  import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/enums";
64
52
  import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
53
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
65
54
 
66
55
  import FSButton from "../FSButton.vue";
67
56
  import FSCard from "../FSCard.vue";
68
57
  import FSChip from "../FSChip.vue";
69
58
  import FSText from "../FSText.vue";
70
- import FSSpan from "../FSSpan.vue";
71
59
  import FSCol from "../FSCol.vue";
72
- import FSRow from "../FSRow.vue";
73
60
 
74
61
  export default defineComponent({
75
62
  name: "FSWorstAlertCard",
@@ -78,14 +65,17 @@ export default defineComponent({
78
65
  FSCard,
79
66
  FSChip,
80
67
  FSText,
81
- FSSpan,
82
68
  FSCol,
83
- FSRow
84
69
  },
85
70
  props: {
86
71
  deviceAlert: {
87
72
  type: Object as PropType<FSDeviceAlert>,
88
73
  required: true
74
+ },
75
+ alertTo: {
76
+ type: Function,
77
+ required: false,
78
+ default: null
89
79
  }
90
80
  },
91
81
  emits: ["close"],
@@ -1,5 +1,7 @@
1
1
  <template>
2
- <FSCol>
2
+ <FSCol
3
+ :style="style"
4
+ >
3
5
  <slot
4
6
  v-if="!$props.hideHeader"
5
7
  name="label"
@@ -10,7 +12,6 @@
10
12
  <FSSpan
11
13
  class="fs-base-field-label"
12
14
  font="text-overline"
13
- :style="style"
14
15
  >
15
16
  {{ $props.label }}
16
17
  </FSSpan>
@@ -49,7 +50,6 @@
49
50
  v-if="$props.description"
50
51
  class="fs-base-field-description"
51
52
  font="text-overline"
52
- :style="style"
53
53
  >
54
54
  {{ $props.description }}
55
55
  </FSSpan>
@@ -104,6 +104,11 @@ export default defineComponent({
104
104
  type: Boolean,
105
105
  required: false,
106
106
  default: true
107
+ },
108
+ minWidth: {
109
+ type: String,
110
+ required: false,
111
+ default: "120px"
107
112
  }
108
113
  },
109
114
  setup(props) {
@@ -120,12 +125,14 @@ export default defineComponent({
120
125
  const style = computed((): StyleValue => {
121
126
  if (!props.editable) {
122
127
  return {
123
- "--fs-base-field-color": lights.dark
128
+ "--fs-base-field-color" : lights.dark,
129
+ "--fs-base-field-min-width": props.minWidth
124
130
  };
125
131
  }
126
132
  return {
127
133
  "--fs-base-field-color" : darks.base,
128
- "--fs-base-field-error-color": errors.base
134
+ "--fs-base-field-error-color": errors.base,
135
+ "--fs-base-field-min-width" : props.minWidth
129
136
  };
130
137
  });
131
138
 
@@ -10,7 +10,9 @@
10
10
  <FSCol
11
11
  gap="12px"
12
12
  >
13
- <FSRow>
13
+ <FSRow
14
+ :wrap="false"
15
+ >
14
16
  <FSSelectField
15
17
  :hideHeader="true"
16
18
  :modelValue="$props.entityType"
@@ -37,7 +39,9 @@
37
39
  />
38
40
  </template>
39
41
  </FSRow>
40
- <FSRow>
42
+ <FSRow
43
+ v-if="$props.showCount"
44
+ >
41
45
  <template
42
46
  v-if="itemsCount > 0"
43
47
  >
@@ -89,7 +93,7 @@
89
93
 
90
94
  <FSFadeOut
91
95
  v-if="$props.showEntities && itemsCount > 0"
92
- maxHeight="220px"
96
+ :maxHeight="$props.listMaxHeight"
93
97
  width="100%"
94
98
  >
95
99
  <slot
@@ -181,6 +185,16 @@ export default defineComponent({
181
185
  type: Boolean,
182
186
  required: false,
183
187
  default: true
188
+ },
189
+ showCount: {
190
+ type: Boolean,
191
+ required: false,
192
+ default: true
193
+ },
194
+ listMaxHeight: {
195
+ type: String as PropType<string | null>,
196
+ required: false,
197
+ default: "220px"
184
198
  }
185
199
  },
186
200
  emits: ["update:entityType", "click:select"],
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <FSTextField
3
3
  class="fs-number-field"
4
+ minWidth="80px"
4
5
  :editable="$props.editable"
5
6
  :modelValue="$props.modelValue?.toString()"
6
7
  @update:modelValue="onUpdate"
@@ -91,7 +91,7 @@ export default defineComponent({
91
91
  tagColor: {
92
92
  type: String as PropType<ColorBase>,
93
93
  required: false,
94
- default: ColorEnum.Primary
94
+ default: ColorEnum.Light
95
95
  },
96
96
  hideHeader: {
97
97
  type: Boolean,
@@ -14,6 +14,7 @@
14
14
  :wrap="false"
15
15
  >
16
16
  <FSSelectDateSetting
17
+ minWidth="180px"
17
18
  :lastPeriod="$props.lastPeriod"
18
19
  :editable="$props.editable"
19
20
  :variant="$props.variant"
@@ -22,10 +23,12 @@
22
23
  @update:modelValue="innerDateSettingChange"
23
24
  />
24
25
  <FSNumberField
26
+ minWidth="60px"
25
27
  v-if="pastSettings.includes(innerDateSetting)"
26
28
  :rules="[NumberRules.required(), NumberRules.min(0)]"
27
29
  :editable="$props.editable"
28
30
  :hideHeader="true"
31
+ :clearable="false"
29
32
  :modelValue="innerDateValue"
30
33
  @update:modelValue="innerDateValueChange"
31
34
  />
@@ -3,7 +3,7 @@
3
3
  gap="16px"
4
4
  >
5
5
  <FSRow
6
- align="bottom-center"
6
+ align="bottom-left"
7
7
  :wrap="isExtraSmall ? false : true"
8
8
  width="fill"
9
9
  >
@@ -896,7 +896,7 @@ export default defineComponent({
896
896
  const innerSortBy = ref(props.sortBy);
897
897
  const innerMode = ref(props.mode);
898
898
  const innerPage = ref(props.page);
899
- const showFilters = ref(true);
899
+ const showFilters = ref(false);
900
900
  const resetable = ref(false);
901
901
 
902
902
  const intersectionObserver = ref<IntersectionObserver | null>(null);
@@ -46,6 +46,7 @@
46
46
  >
47
47
  <FSRow
48
48
  align="center-left"
49
+ height="24px"
49
50
  :wrap="false"
50
51
  >
51
52
  <FSButtonDragIcon
@@ -43,6 +43,7 @@
43
43
  :deviceStatuses="singleDeviceStatuses"
44
44
  :modelStatuses="singleModelStatuses"
45
45
  :deviceAlerts="$props.deviceAlerts"
46
+ :alertTo="$props.alertTo"
46
47
  />
47
48
  </FSCol>
48
49
  <FSImage
@@ -132,6 +133,11 @@ export default defineComponent({
132
133
  required: true,
133
134
  default: () => []
134
135
  },
136
+ alertTo: {
137
+ type: Function,
138
+ required: false,
139
+ default: null
140
+ },
135
141
  width: {
136
142
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
137
143
  required: false,
@@ -3,6 +3,7 @@
3
3
  :activeColor="$props.color"
4
4
  :bottomColor="$props.color"
5
5
  :modelValue="$props.modelValue"
6
+ :width="$props.width"
6
7
  v-bind="$attrs"
7
8
  >
8
9
  <FSRow
@@ -26,6 +27,7 @@
26
27
  {{ $props.label }}
27
28
  </FSSpan>
28
29
  <FSSpan
30
+ v-if="$props.code"
29
31
  font="text-overline"
30
32
  variant="soft"
31
33
  >
@@ -55,7 +57,7 @@
55
57
  <FSSpan
56
58
  font="text-overline"
57
59
  >
58
- {{ $tr("ui.location-tile.device(s)", "Device(s) in this location.") }}
60
+ {{ $tr("ui.common.devices", "Devices") }}
59
61
  </FSSpan>
60
62
  </FSRow>
61
63
  </FSCol>
@@ -88,7 +90,7 @@ import FSCol from "../FSCol.vue";
88
90
  import FSRow from "../FSRow.vue";
89
91
 
90
92
  export default defineComponent({
91
- name: "FSGroupTileUI",
93
+ name: "FSLocationTileUI",
92
94
  components: {
93
95
  FSIconCard,
94
96
  FSColor,
@@ -128,6 +130,11 @@ export default defineComponent({
128
130
  required: false,
129
131
  default: false
130
132
  },
133
+ width: {
134
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
135
+ required: false,
136
+ default: () => [352, 336]
137
+ },
131
138
  },
132
139
  setup() {
133
140
  return {
@@ -1,59 +1,18 @@
1
1
  <template>
2
- <FSClickable
3
- padding="16px"
4
- height="196px"
5
- width="148px"
6
- :border="false"
2
+ <FSSimpleTileUI
7
3
  v-bind="$attrs"
8
- >
9
- <template
10
- #default
11
- >
12
- <FSCol
13
- align="center-center"
14
- >
15
- <FSImage
16
- :imageId="imageId"
17
- width="116px"
18
- height="116px"
19
- />
20
- <FSSpan
21
- :lineClamp="2"
22
- >
23
- {{ label }}
24
- </FSSpan>
25
- </FSCol>
26
- </template>
27
- </FSClickable>
4
+ />
28
5
  </template>
29
6
 
30
7
  <script lang="ts">
31
- import { defineComponent, type PropType } from "vue";
8
+ import { defineComponent } from "vue";
32
9
 
33
- import FSCol from "../FSCol.vue";
34
- import FSSpan from "../FSSpan.vue";
35
- import FSImage from "../FSImage.vue";
36
- import FSClickable from "../FSClickable.vue";
10
+ import FSSimpleTileUI from "./FSSimpleTileUI.vue";
37
11
 
38
12
  export default defineComponent({
39
13
  name: "FSModelTileUI",
40
14
  components: {
41
- FSCol,
42
- FSSpan,
43
- FSImage,
44
- FSClickable,
45
- },
46
- props:{
47
- label: {
48
- type: String,
49
- required: false,
50
- default: null,
51
- },
52
- imageId: {
53
- type: String as PropType<string | null>,
54
- required: false,
55
- default: null,
56
- }
15
+ FSSimpleTileUI,
57
16
  }
58
17
  });
59
18
  </script>
@@ -12,7 +12,7 @@
12
12
  width="fill"
13
13
  >
14
14
  <FSRow
15
- align="center-center"
15
+ align="center-left"
16
16
  gap="24px"
17
17
  :height="imageSize"
18
18
  :wrap="false"
@@ -41,7 +41,7 @@
41
41
  :width="imageSize"
42
42
  />
43
43
  <FSIconCard
44
- v-else
44
+ v-else-if="$props.icon"
45
45
  :backgroundVariant="$props.iconBackgroundVariant"
46
46
  :backgroundColor="$props.iconBackgroundColor"
47
47
  :border="$props.iconBorder"
@@ -95,7 +95,6 @@ export default defineComponent({
95
95
  icon: {
96
96
  type: String as PropType<string>,
97
97
  required: false,
98
- default: "mdi-ab-testing"
99
98
  },
100
99
  iconBackgroundVariant: {
101
100
  type: String as PropType<"background" | "standard" | "full" | "gradient">,
@@ -29,18 +29,13 @@
29
29
  />
30
30
  </slot>
31
31
  </template>
32
- <FSIcon
33
- v-else-if="$props.icon && $props.color"
34
- :color="$props.color"
35
- :icon="$props.icon"
36
- :size="imageSize"
37
- />
38
32
  <FSIconCard
39
- v-else-if="$props.icon && $props.iconBackgroundColor && $props.iconBackgroundColor.length > 0"
33
+ v-else-if="$props.icon"
40
34
  :backgroundVariant="$props.iconBackgroundVariant"
41
- :backgroundColor="$props.iconBackgroundColor"
35
+ :backgroundColor="$props.iconBackgroundColors"
42
36
  :border="$props.iconBorder"
43
37
  :icon="$props.icon"
38
+ :iconColor="$props.color"
44
39
  :size="imageSize"
45
40
  />
46
41
  <FSCol
@@ -59,11 +54,13 @@
59
54
  align="center-left"
60
55
  gap="4px"
61
56
  >
62
- <FSText>
57
+ <FSText
58
+ font="text-button"
59
+ >
63
60
  {{ $props.subtitle }}
64
61
  </FSText>
65
62
  <FSText
66
- font="text-overline"
63
+ font="text-body"
67
64
  >
68
65
  {{ $props.description }}
69
66
  </FSText>
@@ -78,7 +75,9 @@
78
75
  >
79
76
  {{ $props.title }}
80
77
  </FSText>
81
- <FSText>
78
+ <FSText
79
+ font="text-button"
80
+ >
82
81
  {{ $props.subtitle }}
83
82
  </FSText>
84
83
  </template>
@@ -92,7 +91,7 @@
92
91
  {{ $props.title }}
93
92
  </FSText>
94
93
  <FSText
95
- font="text-overline"
94
+ font="text-body"
96
95
  :lineClamp="2"
97
96
  >
98
97
  {{ $props.description }}
@@ -161,17 +160,12 @@
161
160
  </slot>
162
161
  </template>
163
162
  <FSIconCard
164
- v-else-if="$props.icon && $props.iconBackgroundColor && $props.iconBackgroundColor.length > 0"
163
+ v-else-if="$props.icon"
165
164
  iconSize="70px"
166
165
  :backgroundVariant="$props.iconBackgroundVariant"
167
- :backgroundColor="$props.iconBackgroundColor"
166
+ :backgroundColor="$props.iconBackgroundColors"
168
167
  :border="$props.iconBorder"
169
- :icon="$props.icon"
170
- :size="imageSize"
171
- />
172
- <FSIcon
173
- v-else-if="$props.icon"
174
- :color="$props.color"
168
+ :iconColor="$props.color"
175
169
  :icon="$props.icon"
176
170
  :size="imageSize"
177
171
  />
@@ -189,12 +183,13 @@
189
183
  >
190
184
  <FSText
191
185
  v-if="$props.subtitle"
186
+ font="text-button"
192
187
  >
193
188
  {{ $props.subtitle }}
194
189
  </FSText>
195
190
  <FSText
196
191
  v-if="$props.description"
197
- font="text-overline"
192
+ font="text-body"
198
193
  :lineClamp="2"
199
194
  >
200
195
  {{ $props.description }}
@@ -231,14 +226,13 @@
231
226
  <script lang="ts">
232
227
  import { computed, defineComponent, type PropType } from "vue";
233
228
 
234
- import { ColorEnum, type ColorBase, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
229
+ import { type ColorBase, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
235
230
  import { useBreakpoints, useSlots } from "@dative-gpi/foundation-shared-components/composables";
236
231
 
237
232
  import FSBreadcrumbs from "../FSBreadcrumbs.vue";
238
233
  import FSSlideGroup from "../FSSlideGroup.vue";
239
234
  import FSIconCard from "../FSIconCard.vue";
240
235
  import FSImage from "../FSImage.vue";
241
- import FSIcon from "../FSIcon.vue";
242
236
  import FSText from "../FSText.vue";
243
237
  import FSCol from "../FSCol.vue";
244
238
  import FSRow from "../FSRow.vue";
@@ -250,7 +244,6 @@ export default defineComponent({
250
244
  FSSlideGroup,
251
245
  FSIconCard,
252
246
  FSImage,
253
- FSIcon,
254
247
  FSText,
255
248
  FSCol,
256
249
  FSRow
@@ -276,10 +269,10 @@ export default defineComponent({
276
269
  required: false,
277
270
  default: "background"
278
271
  },
279
- iconBackgroundColor: {
280
- type: [Array, String] as PropType<ColorBase | ColorBase[]>,
272
+ iconBackgroundColors: {
273
+ type: Array as PropType<string[]>,
281
274
  required: false,
282
- default: ColorEnum.Background
275
+ default: () => []
283
276
  },
284
277
  iconBorder: {
285
278
  type: Boolean as PropType<boolean>,
@@ -11,6 +11,7 @@
11
11
  :title="$props.title"
12
12
  :light="lightHeader"
13
13
  :imageId="imageId"
14
+ :iconBackgroundVariant="$props.iconBackgroundVariant"
14
15
  :icon="$props.icon"
15
16
  :color="$props.color"
16
17
  :iconBackgroundColors="$props.iconBackgroundColors"
@@ -120,6 +121,11 @@ export default defineComponent({
120
121
  type: Array as PropType<FSBreadcrumbItem[]>,
121
122
  required: false,
122
123
  default: () => []
124
+ },
125
+ iconBackgroundVariant: {
126
+ type: String as PropType<"background" | "standard" | "full" | "gradient">,
127
+ required: false,
128
+ default: "background"
123
129
  }
124
130
  },
125
131
  setup() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "1.0.59",
4
+ "version": "1.0.62",
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": "1.0.59",
14
- "@dative-gpi/foundation-shared-services": "1.0.59"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.62",
14
+ "@dative-gpi/foundation-shared-services": "1.0.62"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "583e582d2f2185269a2d2880806be36bdc4dffdd"
38
+ "gitHead": "aebca5afe970e1d7117b5515abba742a6c96fa3a"
39
39
  }
@@ -1,5 +1,6 @@
1
1
  .fs-color-field .fs-card {
2
2
  cursor: var(--fs-color-field-cursor) !important;
3
+ min-width: var(--fs-base-field-min-width);
3
4
  border-color: var(--fs-color-field-border-color) !important;
4
5
  .fs-text {
5
6
  color: var(--fs-color-field-color) !important;
@@ -2,6 +2,14 @@
2
2
  color: var(--fs-edit-image-overline-text-color) !important;
3
3
  }
4
4
 
5
+ .fs-edit-image-standard-row {
6
+ min-width: 0;
7
+ }
8
+
9
+ .fs-edit-image-standard-label-wrapper {
10
+ min-width: 0;
11
+ }
12
+
5
13
  .fs-edit-image-hidden-button {
6
14
  display: none;
7
15
  }
@@ -59,6 +59,7 @@
59
59
  color: var(--fs-tab-tag-color);
60
60
  display: flex;
61
61
  align-items: center;
62
+ justify-content: center;
62
63
 
63
64
  @include web {
64
65
  min-width: 28px;
@@ -40,13 +40,8 @@
40
40
  flex: 0 0 auto;
41
41
  }
42
42
 
43
- &:not(.v-checkbox):not(.v-slider):not(.fs-small-input):not(.fs-number-field) {
44
- min-width: 120px;
45
- width: 100%;
46
- }
47
-
48
- &.fs-number-field {
49
- min-width: 80px;
43
+ &:not(.v-checkbox):not(.v-slider):not(.fs-small-input) {
44
+ min-width: var(--fs-base-field-min-width);
50
45
  width: 100%;
51
46
  }
52
47
 
package/utils/time.ts CHANGED
@@ -12,7 +12,7 @@ export const timeSteps = [
12
12
  { id: TimeUnit.Week, label: $tr("ui.time-step.week.singular", "Week"), plural: $tr("ui.time-step.week.plural", "Weeks") },
13
13
  { id: TimeUnit.Month, label: $tr("ui.time-step.month.singular", "Month"), plural: $tr("ui.time-step.month.plural", "Months") },
14
14
  { id: TimeUnit.Year, label: $tr("ui.time-step.year.singular", "Year"), plural: $tr("ui.time-step.year.plural", "Years") },
15
- ]
15
+ ];
16
16
 
17
17
  export const timeStepToString = (value: { value: number, unit: TimeUnit } | null): string => {
18
18
  if (!value) {
@@ -25,7 +25,7 @@ export const timeStepToString = (value: { value: number, unit: TimeUnit } | null
25
25
  }
26
26
 
27
27
  return `${value.value} ${value.value === 1 ? unit.label.toLowerCase() : unit.plural.toLowerCase()}`;
28
- }
28
+ };
29
29
 
30
30
  // TODO : remove everything below this line
31
31
  export const timeScale: any[] = [
@@ -52,4 +52,4 @@ export const getTimeBestString = (value: number): string => {
52
52
  const unit = getTimeScaleIndex(value);
53
53
  const figure = value / timeScale[unit].id;
54
54
  return `${figure} ${figure === 1 ? timeScale[unit].label.toLowerCase() : timeScale[unit].plural.toLowerCase()}`;
55
- }
55
+ };