@dative-gpi/foundation-shared-components 1.0.156-maps2 → 1.0.157-mobile

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.
@@ -6,32 +6,47 @@
6
6
  :disabled="false"
7
7
  :elevation="0"
8
8
  :style="style"
9
+ :hideActions="$props.actionPosition === 'start'"
9
10
  v-bind="$attrs"
10
11
  >
11
- <template
12
- #title
13
- >
14
- <slot
15
- name="title"
12
+ <v-expansion-panel-title>
13
+ <template
14
+ v-slot:default="{ expanded, collapseIcon, expandIcon }"
16
15
  >
17
- <FSRow>
18
- <FSIcon
19
- v-if="$props.prependIcon"
16
+ <FSRow
17
+ gap="4px"
18
+ >
19
+ <FSCol
20
+ v-if="$props.actionPosition === 'start'"
21
+ width="hug"
22
+ align="center-center"
20
23
  >
21
- {{ $props.prependIcon }}
22
- </FSIcon>
23
- <FSSpan
24
- class="fs-accordion-panel-title"
25
- :lineClamp="$props.lineClampTitle"
24
+ <FSIcon
25
+ size="22.5px"
26
+ :icon="expanded ? collapseIcon : expandIcon"
27
+ />
28
+ </FSCol>
29
+ <slot
30
+ name="title"
26
31
  >
27
- {{ $props.title }}
28
- </FSSpan>
32
+ <FSRow>
33
+ <FSIcon
34
+ v-if="$props.prependIcon"
35
+ >
36
+ {{ $props.prependIcon }}
37
+ </FSIcon>
38
+ <FSSpan
39
+ class="fs-accordion-panel-title"
40
+ :lineClamp="$props.lineClampTitle"
41
+ >
42
+ {{ $props.title }}
43
+ </FSSpan>
44
+ </FSRow>
45
+ </slot>
29
46
  </FSRow>
30
- </slot>
31
- </template>
32
- <template
33
- #text
34
- >
47
+ </template>
48
+ </v-expansion-panel-title>
49
+ <v-expansion-panel-text>
35
50
  <slot
36
51
  name="content"
37
52
  >
@@ -47,7 +62,7 @@
47
62
  :modelValue="$props.content"
48
63
  />
49
64
  </slot>
50
- </template>
65
+ </v-expansion-panel-text>
51
66
  </v-expansion-panel>
52
67
  </template>
53
68
 
@@ -128,6 +143,10 @@ export default defineComponent({
128
143
  type: String as PropType<"standard" | "rich-text">,
129
144
  required: false,
130
145
  default: "standard"
146
+ },
147
+ actionPosition: {
148
+ type: String as () => "start" | "end",
149
+ default: "end"
131
150
  }
132
151
  },
133
152
  setup(props) {
@@ -68,6 +68,11 @@ export default defineComponent({
68
68
  required: false,
69
69
  default: null
70
70
  },
71
+ maxWidth: {
72
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
73
+ required: false,
74
+ default: null
75
+ },
71
76
  padding: {
72
77
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
73
78
  required: false,
@@ -103,6 +108,11 @@ export default defineComponent({
103
108
  required: false,
104
109
  default: "solid"
105
110
  },
111
+ borderColor: {
112
+ type: [Array, String] as PropType<ColorBase | null | string>,
113
+ required: false,
114
+ default: null
115
+ },
106
116
  elevation: {
107
117
  type: Boolean,
108
118
  required: false,
@@ -129,6 +139,10 @@ export default defineComponent({
129
139
  const darks = getColors(ColorEnum.Dark);
130
140
 
131
141
  const borderColor = computed((): ColorBase => {
142
+ if (props.borderColor) {
143
+ return getColors(props.borderColor).base;
144
+ }
145
+
132
146
  switch (props.variant) {
133
147
  case "background":
134
148
  return lights.dark;
@@ -154,6 +168,7 @@ export default defineComponent({
154
168
  "--fs-card-padding" : sizeToVar(props.padding),
155
169
  "--fs-card-height" : sizeToVar(props.height),
156
170
  "--fs-card-width" : sizeToVar(props.width),
171
+ "--fs-card-max-width" : sizeToVar(props.maxWidth, "unset"),
157
172
  "--fs-card-background-color": backgrounds.base,
158
173
  "--fs-card-border-color" : borderColor.value,
159
174
  "--fs-card-color" : darks.base,
@@ -166,6 +181,7 @@ export default defineComponent({
166
181
  "--fs-card-padding" : sizeToVar(props.padding),
167
182
  "--fs-card-height" : sizeToVar(props.height),
168
183
  "--fs-card-width" : sizeToVar(props.width),
184
+ "--fs-card-max-width" : sizeToVar(props.maxWidth, "unset"),
169
185
  "--fs-card-background-color": colors.value.light,
170
186
  "--fs-card-border-color" : borderColor.value,
171
187
  "--fs-card-color" : colors.value.lightContrast!,
@@ -178,6 +194,7 @@ export default defineComponent({
178
194
  "--fs-card-padding" : sizeToVar(props.padding),
179
195
  "--fs-card-height" : sizeToVar(props.height),
180
196
  "--fs-card-width" : sizeToVar(props.width),
197
+ "--fs-card-max-width" : sizeToVar(props.maxWidth, "unset"),
181
198
  "--fs-card-background-color": colors.value.base,
182
199
  "--fs-card-border-color" : borderColor.value,
183
200
  "--fs-card-color" : colors.value.baseContrast!,
@@ -190,6 +207,7 @@ export default defineComponent({
190
207
  "--fs-card-padding" : sizeToVar(props.padding),
191
208
  "--fs-card-height" : sizeToVar(props.height),
192
209
  "--fs-card-width" : sizeToVar(props.width),
210
+ "--fs-card-max-width" : sizeToVar(props.maxWidth, "unset"),
193
211
  "--fs-card-background-color": gradients.value.base,
194
212
  "--fs-card-border-color" : borderColor.value,
195
213
  "--fs-card-color" : colors.value.lightContrast!,
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <component
3
- :is="$props.to ? 'FSRouterLink' : 'div'"
3
+ :is="$props.to && $props.clickable ? 'FSRouterLink' : 'div'"
4
+ class="fs-chip-container"
4
5
  v-bind="$props.to ? { to: $props.to } : {}"
6
+ @click="$emit('click', $event)"
5
7
  >
6
8
  <FSRow
7
9
  :align="$props.align"
@@ -69,7 +71,6 @@ export default defineComponent({
69
71
  FSSpan,
70
72
  FSRow
71
73
  },
72
- inheritsAttrs: false,
73
74
  props: {
74
75
  prependIcon: {
75
76
  type: String as PropType<string | null>,
@@ -122,6 +123,8 @@ export default defineComponent({
122
123
  default: null
123
124
  },
124
125
  },
126
+ inheritsAttrs: false,
127
+ emits: ['click'],
125
128
  setup(props) {
126
129
  const { getColors } = useColors();
127
130
 
@@ -136,9 +139,9 @@ export default defineComponent({
136
139
  "--fs-chip-background-color" : backgrounds.base,
137
140
  "--fs-chip-border-color" : colors.value.base,
138
141
  "--fs-chip-color" : colors.value.base,
139
- "--fs-chip-hover-background-color" : backgrounds.base,
142
+ "--fs-chip-hover-background-color" : colors.value.base,
140
143
  "--fs-chip-hover-border-color" : colors.value.base,
141
- "--fs-chip-hover-color" : colors.value.base,
144
+ "--fs-chip-hover-color" : colors.value.baseContrast!,
142
145
  "--fs-chip-active-background-color": backgrounds.base,
143
146
  "--fs-chip-active-border-color" : colors.value.dark,
144
147
  "--fs-chip-active-color" : colors.value.dark
@@ -148,8 +151,8 @@ export default defineComponent({
148
151
  "--fs-chip-background-color" : colors.value.base,
149
152
  "--fs-chip-border-color" : colors.value.base,
150
153
  "--fs-chip-color" : colors.value.baseContrast!,
151
- "--fs-chip-hover-background-color" : colors.value.base,
152
- "--fs-chip-hover-border-color" : colors.value.base,
154
+ "--fs-chip-hover-background-color" : colors.value.soft,
155
+ "--fs-chip-hover-border-color" : colors.value.soft,
153
156
  "--fs-chip-hover-color" : colors.value.baseContrast!,
154
157
  "--fs-chip-active-background-color": colors.value.dark,
155
158
  "--fs-chip-active-border-color" : colors.value.darkContrast!,
@@ -13,7 +13,7 @@
13
13
  import { computed, defineComponent, type PropType, type StyleValue } from "vue";
14
14
 
15
15
  import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
16
- import { type ColorBase } from "@dative-gpi/foundation-shared-components/models";
16
+ import { type ColorBase, type ColorBaseVariations } from "@dative-gpi/foundation-shared-components/models";
17
17
 
18
18
  import { sizeToVar } from "../utils";
19
19
 
@@ -31,7 +31,7 @@ export default defineComponent({
31
31
  default: null
32
32
  },
33
33
  variant: {
34
- type: String as PropType<"base" | "baseContrast" | "soft" | "softContrast" | "light" | "lightContrast" | "dark" | "darkContrast">,
34
+ type: String as PropType<ColorBaseVariations>,
35
35
  required: false,
36
36
  default: "base"
37
37
  }
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <FSCard
3
3
  :variant="$props.backgroundVariant"
4
+ :borderColor="$props.backgroundVariant === 'background' ? ColorEnum.Light : null"
4
5
  :color="$props.backgroundColor"
5
6
  :border="$props.border"
6
7
  :height="$props.size"
@@ -10,8 +11,8 @@
10
11
  align="center-center"
11
12
  >
12
13
  <FSIcon
13
- :variant="$props.iconVariant"
14
- :color="contrastedIconColor"
14
+ :variant="iconVariant"
15
+ :color="iconColor"
15
16
  :size="actualIconSize"
16
17
  >
17
18
  {{ $props.icon }}
@@ -23,10 +24,9 @@
23
24
  <script lang="ts">
24
25
  import { defineComponent, type PropType, computed } from "vue";
25
26
 
26
- import { ColorEnum, type ColorBase } from "@dative-gpi/foundation-shared-components/models";
27
+ import { ColorEnum, type ColorBase, type ColorBaseVariations } from "@dative-gpi/foundation-shared-components/models";
27
28
 
28
29
  import { sizeToVar } from "../utils";
29
- import { useColors } from "../composables";
30
30
 
31
31
  import FSCard from "./FSCard.vue";
32
32
  import FSIcon from "./FSIcon.vue";
@@ -46,7 +46,7 @@ export default defineComponent({
46
46
  backgroundColor: {
47
47
  type: [Array, String] as PropType<ColorBase | ColorBase[]>,
48
48
  required: false,
49
- default: null
49
+ default: ColorEnum.Background
50
50
  },
51
51
  backgroundVariant: {
52
52
  type: String as PropType<"background" | "standard" | "full" | "gradient">,
@@ -60,13 +60,12 @@ export default defineComponent({
60
60
  },
61
61
  iconColor: {
62
62
  type: String as PropType<ColorBase>,
63
- required: false,
64
- default: ColorEnum.Light
63
+ required: false
65
64
  },
66
65
  iconVariant: {
67
- type: String as PropType<"base" | "baseContrast" | "soft" | "softContrast" | "light" | "lightContrast" | "dark" | "darkContrast">,
66
+ type: String as PropType<ColorBaseVariations | null>,
68
67
  required: false,
69
- default: "base"
68
+ default: null
70
69
  },
71
70
  iconSize: {
72
71
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
@@ -80,14 +79,6 @@ export default defineComponent({
80
79
  }
81
80
  },
82
81
  setup(props){
83
- const { getColors } = useColors();
84
-
85
- const colors = computed(() => {
86
- return Array.isArray(props.backgroundColor)
87
- ? getColors(props.backgroundColor[Math.floor(props.backgroundColor.length/2)])
88
- : getColors(props.backgroundColor)
89
- });
90
-
91
82
  const actualIconSize = computed(() => {
92
83
  if (props.iconSize){
93
84
  return props.iconSize;
@@ -98,22 +89,47 @@ export default defineComponent({
98
89
  return "42px";
99
90
  });
100
91
 
101
- const contrastedIconColor = computed(() => {
92
+ const iconVariant = computed((): ColorBaseVariations | undefined => {
93
+ if (props.iconVariant) {
94
+ return props.iconVariant;
95
+ }
96
+ if (props.iconColor) {
97
+ return "base";
98
+ }
99
+
102
100
  switch (props.backgroundVariant) {
101
+ case "background":
102
+ return "lightContrast";
103
103
  case "standard":
104
- switch (props.iconColor) {
105
- case ColorEnum.Dark :
106
- case ColorEnum.Light:
107
- default: return colors.value.lightContrast!
108
- };
109
- case "background": return colors.value.base
110
- default: return colors.value.baseContrast!
104
+ return "lightContrast";
105
+ case "full":
106
+ return "baseContrast";
107
+ case "gradient":
108
+ return "baseContrast";
109
+ default:
110
+ return "base";
111
+ }
112
+ });
113
+
114
+ const iconColor = computed((): ColorBase | undefined => {
115
+ if (props.iconColor) {
116
+ return props.iconColor;
117
+ }
118
+
119
+ if(Array.isArray(props.backgroundColor)) {
120
+ return props.backgroundColor[Math.floor(props.backgroundColor.length/2)];
121
+ }
122
+ if(props.backgroundVariant === "background") {
123
+ return ColorEnum.Light;
111
124
  }
125
+ return props.backgroundColor;
112
126
  });
113
127
 
114
128
  return {
115
- contrastedIconColor,
116
- actualIconSize
129
+ actualIconSize,
130
+ iconVariant,
131
+ ColorEnum,
132
+ iconColor,
117
133
  };
118
134
  }
119
135
  });
@@ -15,7 +15,7 @@
15
15
  >
16
16
  <FSButton
17
17
  v-bind="props"
18
- :color="lightColors.dark"
18
+ :color="$props.iconColor"
19
19
  :iconSize="$props.iconSize"
20
20
  variant="icon"
21
21
  icon="mdi-information-outline"
@@ -26,6 +26,7 @@
26
26
  name="menuContent"
27
27
  >
28
28
  <FSCard
29
+ :maxWidth="$props.maxWidth"
29
30
  :width="$props.width"
30
31
  :padding="$props.padding"
31
32
  :elevation="true"
@@ -38,14 +39,15 @@
38
39
  align="center-center"
39
40
  >
40
41
  <FSText
41
- font="text-overline"
42
- :lineClamp="4"
42
+ font="text-body"
43
+ :lineClamp="$props.lineClamp"
43
44
  >
44
45
  {{ $props.content }}
45
46
  </FSText>
46
47
  </FSRow>
47
48
  </slot>
48
49
  <template
50
+ v-if="$props.showCloseButton"
49
51
  #top-right
50
52
  >
51
53
  <FSButton
@@ -95,7 +97,11 @@ export default defineComponent({
95
97
  },
96
98
  width: {
97
99
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
98
- default: 182
100
+ default: null
101
+ },
102
+ maxWidth: {
103
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
104
+ default: null
99
105
  },
100
106
  padding: {
101
107
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
@@ -104,6 +110,18 @@ export default defineComponent({
104
110
  iconSize: {
105
111
  type: String,
106
112
  default: "18px"
113
+ },
114
+ iconColor: {
115
+ type: String as PropType<ColorBase>,
116
+ default: ColorEnum.Primary
117
+ },
118
+ showCloseButton: {
119
+ type: Boolean,
120
+ default: true
121
+ },
122
+ lineClamp: {
123
+ type: Number,
124
+ default: 4
107
125
  }
108
126
  },
109
127
  emits: ["update:modelValue"],
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <FSTile
3
- :width="['324px','272px']"
3
+ :width="['296px','336px']"
4
4
  :height="['132px', '116px']"
5
5
  :padding="['16px', '12px']"
6
6
  borderRadius="8px"
@@ -107,13 +107,11 @@ export default defineComponent({
107
107
  },
108
108
  iconBackgroundVariant: {
109
109
  type: String as PropType<"background" | "standard" | "full" | "gradient">,
110
- required: false,
111
- default: "standard"
110
+ required: false
112
111
  },
113
112
  iconBackgroundColor: {
114
113
  type: [Array, String] as PropType<ColorBase | ColorBase[]>,
115
- required: false,
116
- default: ColorEnum.Background
114
+ required: false
117
115
  },
118
116
  iconBorder: {
119
117
  type: Boolean as PropType<boolean>,
@@ -122,8 +120,7 @@ export default defineComponent({
122
120
  },
123
121
  iconColor: {
124
122
  type: String as PropType<ColorBase>,
125
- required: false,
126
- default: ColorEnum.Light
123
+ required: false
127
124
  },
128
125
  activeColor: {
129
126
  type: String as PropType<ColorBase>,
@@ -29,7 +29,7 @@
29
29
  </FSRow>
30
30
  <FSCol
31
31
  v-if="$props.breadcrumbs && $props.breadcrumbs.length > 0"
32
- :padding="$slots.toolbar ? '0px 24px 8px 24px' : '0px 24px'"
32
+ :padding="$slots.toolbar ? '0px 24px 16px 24px' : '0px 24px'"
33
33
  gap="16px"
34
34
  >
35
35
  <FSCol>
@@ -9,6 +9,7 @@
9
9
  >
10
10
  <FSRow
11
11
  gap="24px"
12
+ :height="actualImageSize"
12
13
  :wrap="false"
13
14
  >
14
15
  <template
@@ -54,7 +55,7 @@
54
55
  >
55
56
  <slot
56
57
  name="subtitle"
57
- v-if="topOffset < 60"
58
+ v-if="topOffset < 64"
58
59
  >
59
60
  <FSText
60
61
  v-if="$props.subtitle"
@@ -65,10 +66,11 @@
65
66
  </slot>
66
67
  <slot
67
68
  name="description"
68
- v-if="topOffset < 20"
69
+ v-if="topOffset < 24"
69
70
  >
70
71
  <FSText
71
72
  v-if="$props.description"
73
+ :lineClamp="2"
72
74
  font="text-body"
73
75
  >
74
76
  {{ $props.description }}
@@ -146,9 +148,9 @@ export default defineComponent({
146
148
  default: () => ["124px", "96px", "80px"]
147
149
  },
148
150
  icon: {
149
- type: String as PropType<string>,
151
+ type: String as PropType<string | null>,
150
152
  required: false,
151
- default: "mdi-ab-testing"
153
+ default: null
152
154
  },
153
155
  iconColor: {
154
156
  type: String as PropType<ColorBase>,
@@ -15,7 +15,7 @@
15
15
  <FSRow
16
16
  style="position: sticky; top: 0px; z-index: 3;"
17
17
  :style="{ backgroundColor, marginTop: $props.stickyTitleTopOffset }"
18
- :padding="`24px ${isTouchScreenEnabled ? '24px' : '16px'} 16px 24px`"
18
+ :padding="`16px ${isTouchScreenEnabled ? '20px' : '12px'} 12px 12px`"
19
19
  >
20
20
  <slot
21
21
  name="title"
@@ -29,7 +29,7 @@
29
29
  </FSRow>
30
30
  <FSCol
31
31
  v-if="$props.breadcrumbs && $props.breadcrumbs.length > 0"
32
- :padding="$slots.toolbar ? '0px 24px 8px 24px' : '0px 24px'"
32
+ :padding="`0px ${isTouchScreenEnabled ? '20px' : '12px'} ${$slots.toolbar ? '12px' : '0px'} 12px`"
33
33
  gap="16px"
34
34
  >
35
35
  <FSCol>
@@ -45,7 +45,7 @@
45
45
  <FSRow
46
46
  v-if="$slots.toolbar"
47
47
  :style="stickyToolbar ? `position: sticky; top: ${$props.toolbarTopOffset}; z-index: 3; background-color: ${backgroundColor}` : undefined"
48
- :padding="`0px ${isTouchScreenEnabled ? '24px' : '16px'} 8px 24px`"
48
+ :padding="`0px ${isTouchScreenEnabled ? '20px' : '12px'} 12px 12px`"
49
49
  >
50
50
  <FSSlideGroup>
51
51
  <slot
@@ -58,7 +58,7 @@
58
58
  <FSCol
59
59
  height="fill"
60
60
  gap="0px"
61
- :padding="`${$slots.toolbar ? '8px' : '16px'} ${isTouchScreenEnabled ? '24px' : '16px'} 24px 24px`"
61
+ :padding="`0px ${isTouchScreenEnabled ? '20px' : '12px'} 16px 12px`"
62
62
  >
63
63
  <slot />
64
64
  </FSCol>
@@ -8,7 +8,8 @@
8
8
  #title
9
9
  >
10
10
  <FSRow
11
- gap="24px"
11
+ gap="12px"
12
+ :height="actualImageSize"
12
13
  :wrap="false"
13
14
  >
14
15
  <FSImage
@@ -31,6 +32,7 @@
31
32
  style="min-width: 0"
32
33
  align="center-left"
33
34
  height="fill"
35
+ :gap="$props.subtitle && $props.description ? '6px' : '8px'"
34
36
  >
35
37
  <slot
36
38
  name="title"
@@ -44,26 +46,31 @@
44
46
  name="title-extra"
45
47
  v-bind="{ topOffset }"
46
48
  >
47
- <slot
48
- name="subtitle"
49
+ <FSCol
50
+ gap="4px"
49
51
  >
50
- <FSText
51
- v-if="$props.subtitle && topOffset < 60"
52
- font="text-button"
52
+ <slot
53
+ name="subtitle"
53
54
  >
54
- {{ $props.subtitle }}
55
- </FSText>
56
- </slot>
57
- <slot
58
- name="description"
59
- >
60
- <FSText
61
- v-if="$props.description && topOffset < 20"
62
- font="text-body"
55
+ <FSText
56
+ v-if="$props.subtitle && topOffset < 48"
57
+ font="text-button"
58
+ >
59
+ {{ $props.subtitle }}
60
+ </FSText>
61
+ </slot>
62
+ <slot
63
+ name="description"
63
64
  >
64
- {{ $props.description }}
65
- </FSText>
66
- </slot>
65
+ <FSText
66
+ v-if="$props.description && topOffset < 8"
67
+ :lineClamp="2"
68
+ font="text-body"
69
+ >
70
+ {{ $props.description }}
71
+ </FSText>
72
+ </slot>
73
+ </FSCol>
67
74
  </slot>
68
75
  </slot>
69
76
  </FSCol>
@@ -136,9 +143,9 @@ export default defineComponent({
136
143
  default: () => ["124px", "96px", "80px"]
137
144
  },
138
145
  icon: {
139
- type: String as PropType<string>,
146
+ type: String as PropType<string | null>,
140
147
  required: false,
141
- default: "mdi-ab-testing"
148
+ default: null
142
149
  },
143
150
  iconColor: {
144
151
  type: String as PropType<ColorBase>,
@@ -183,7 +190,7 @@ export default defineComponent({
183
190
  const minSize = sizeToVar(props.minImageSize);
184
191
  const actualMinSize = parseInt(minSize);
185
192
 
186
- topOffset.value = Math.max(0, Math.min(actualScrollTop, actualMinSize + 16 + 24));
193
+ topOffset.value = Math.max(0, Math.min(actualScrollTop, actualMinSize + 16 + 12));
187
194
  }
188
195
 
189
196
  delete slots.title;
package/models/colors.ts CHANGED
@@ -19,4 +19,5 @@ export interface ColorVariations {
19
19
  darkContrast?: string | null;
20
20
  }
21
21
 
22
- export type ColorBase = (string | ColorEnum);
22
+ export type ColorBase = (string | ColorEnum);
23
+ export type ColorBaseVariations = "base" | "baseContrast" | "soft" | "softContrast" | "light" | "lightContrast" | "dark" | "darkContrast";
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.156-maps2",
4
+ "version": "1.0.157-mobile",
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.156-maps2",
14
- "@dative-gpi/foundation-shared-services": "1.0.156-maps2"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.157-mobile",
14
+ "@dative-gpi/foundation-shared-services": "1.0.157-mobile"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "e47363fc9a738d138f94cbf4948da4947d35e0df"
38
+ "gitHead": "d47f58fd240a2f085a13ed5880243a5472bf79f9"
39
39
  }
@@ -4,6 +4,7 @@
4
4
  padding: var(--fs-card-padding);
5
5
  height: var(--fs-card-height);
6
6
  width: var(--fs-card-width);
7
+ max-width: var(--fs-card-max-width);
7
8
  position: relative;
8
9
  display: flex;
9
10
 
@@ -1,3 +1,7 @@
1
+ .fs-chip-container {
2
+ text-decoration: none;
3
+ }
4
+
1
5
  .fs-chip {
2
6
  user-select: none;
3
7
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
@@ -21,19 +21,19 @@ export const AlertTools = {
21
21
  statusLabel(value: AlertStatus): string {
22
22
  switch (value) {
23
23
  case AlertStatus.Pending:
24
- return $tr('ui.alert-status.pending','Pending');
24
+ return $tr('ui.alert-status.pending', 'Pending');
25
25
  case AlertStatus.Untriggered:
26
- return $tr('ui.alert-status.untriggered','Untriggered');
26
+ return $tr('ui.alert-status.untriggered', 'Untriggered');
27
27
  case AlertStatus.Unresolved:
28
- return $tr('ui.alert-status.unresolved','Unresolved');
28
+ return $tr('ui.alert-status.unresolved', 'Unresolved');
29
29
  case AlertStatus.Resolved:
30
- return $tr('ui.alert-status.resolved','Resolved');
30
+ return $tr('ui.alert-status.resolved', 'Resolved');
31
31
  case AlertStatus.Expired:
32
- return $tr('ui.alert-status.expired','Expired');
32
+ return $tr('ui.alert-status.expired', 'Expired');
33
33
  case AlertStatus.Triggered:
34
- return $tr('ui.alert-status.triggered','Triggered');
34
+ return $tr('ui.alert-status.triggered', 'Triggered');
35
35
  case AlertStatus.Abandoned:
36
- return $tr('ui.alert-status.abandoned','Abandoned');
36
+ return $tr('ui.alert-status.abandoned', 'Abandoned');
37
37
  default: return "";
38
38
  }
39
39
  },
@@ -74,11 +74,43 @@ export const AlertTools = {
74
74
  },
75
75
  criticityLabel(value: Criticity): string {
76
76
  switch (value) {
77
- case Criticity.Warning: return $tr('ui.common.warning','Warning');
78
- case Criticity.Error: return $tr('ui.common.error','Error');
79
- default: return $tr('ui.common.information','Information');
77
+ case Criticity.Warning: return $tr('ui.common.warning', 'Warning');
78
+ case Criticity.Error: return $tr('ui.common.error', 'Error');
79
+ default: return $tr('ui.common.information', 'Information');
80
+ }
81
+ },
82
+ statusColor(status: AlertStatus): ColorEnum {
83
+ switch (status) {
84
+ case AlertStatus.None:
85
+ case AlertStatus.Pending:
86
+ case AlertStatus.Expired:
87
+ return ColorEnum.Warning;
88
+ case AlertStatus.Unresolved:
89
+ case AlertStatus.Triggered:
90
+ return ColorEnum.Error;
91
+ case AlertStatus.Resolved:
92
+ case AlertStatus.Untriggered:
93
+ return ColorEnum.Success;
94
+ default:
95
+ return ColorEnum.Warning;
96
+ }
97
+ },
98
+
99
+ formatValue(value: string) {
100
+ const n = parseFloat(value);
101
+
102
+ if (isNaN(n)) {
103
+ return value;
104
+ }
105
+
106
+ if (Number.isInteger(n)) {
107
+ return n;
108
+ }
109
+ else {
110
+ return n.toFixed(2);
80
111
  }
81
112
  }
113
+
82
114
  }
83
115
 
84
116
  export const prettyDuration = (n: number | undefined) => {
@@ -1,7 +1,42 @@
1
1
  const MinusOperator = "-";
2
2
 
3
- // Matches one of the three operators (+, *, /) or the - operator if it is preceded by something that is not another operator
4
- const operatorsRegex = new RegExp(/[\+\*\/]|(?<=.)(?<![-\+\*\/])[-]/gm);
3
+ /**
4
+ * Splits an expression by operators while keeping unary minus signs.
5
+ */
6
+ const splitByOperators = (expression: string): string[] => {
7
+ const tokens: string[] = [];
8
+ let current = '';
9
+ let expectOperand = true;
10
+
11
+ for (let i = 0; i < expression.length; i++) {
12
+ const char = expression[i];
13
+ if ('+-*/'.includes(char)) {
14
+ const isUnaryMinus = char === '-' && expectOperand;
15
+ if (isUnaryMinus) {
16
+ current += char;
17
+ expectOperand = true;
18
+ } else {
19
+ if (expectOperand) {
20
+ // 2 consecutive operators or operator at the start
21
+ return [];
22
+ }
23
+ if (current !== '') {
24
+ tokens.push(current);
25
+ current = '';
26
+ }
27
+ tokens.push(char);
28
+ expectOperand = true;
29
+ }
30
+ } else {
31
+ current += char;
32
+ expectOperand = false;
33
+ }
34
+ }
35
+ if (current !== '') {
36
+ tokens.push(current);
37
+ }
38
+ return tokens;
39
+ };
5
40
 
6
41
  // Matches a nested block of parenthesis
7
42
  const parenthesisRegex = new RegExp(/\([^)(]+\)/gm);
@@ -14,7 +49,11 @@ const validateBlock = (block: string, operands: string[] = [], variables: string
14
49
  block = block.replaceAll("(", "").replaceAll(")", "");
15
50
 
16
51
  // Split block on operators (Leave negative signs)
17
- const components = block.split(operatorsRegex);
52
+ const tokens = splitByOperators(block);
53
+ if (tokens.length === 0) {
54
+ return false;
55
+ }
56
+ const components = tokens.filter(token => !'+-*/'.includes(token));
18
57
 
19
58
  // Check if each bit is a valid operand
20
59
  for (let i = 0; i < components.length; i++) {