@dative-gpi/foundation-shared-components 1.0.156-maps → 1.0.156
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/FSAccordionPanel.vue +40 -21
- package/components/FSCard.vue +18 -0
- package/components/FSChip.vue +9 -6
- package/components/FSIcon.vue +2 -2
- package/components/FSIconCard.vue +43 -27
- package/components/FSInformationsMenu.vue +22 -4
- package/components/map/FSMapMarkerClusterGroup.vue +13 -16
- package/components/tiles/FSChartTileUI.vue +1 -1
- package/components/tiles/FSSimpleTileUI.vue +3 -6
- package/models/colors.ts +2 -1
- package/package.json +4 -4
- package/styles/components/fs_card.scss +1 -0
- package/styles/components/fs_chip.scss +4 -0
- package/utils/operations.ts +42 -3
|
@@ -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
|
-
<
|
|
12
|
-
|
|
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
|
-
|
|
19
|
-
|
|
16
|
+
<FSRow
|
|
17
|
+
gap="4px"
|
|
18
|
+
>
|
|
19
|
+
<FSCol
|
|
20
|
+
v-if="$props.actionPosition === 'start'"
|
|
21
|
+
width="hug"
|
|
22
|
+
align="center-center"
|
|
20
23
|
>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
<FSIcon
|
|
25
|
+
size="22.5px"
|
|
26
|
+
:icon="expanded ? collapseIcon : expandIcon"
|
|
27
|
+
/>
|
|
28
|
+
</FSCol>
|
|
29
|
+
<slot
|
|
30
|
+
name="title"
|
|
26
31
|
>
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
</
|
|
31
|
-
</
|
|
32
|
-
<
|
|
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
|
-
</
|
|
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) {
|
package/components/FSCard.vue
CHANGED
|
@@ -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!,
|
package/components/FSChip.vue
CHANGED
|
@@ -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" :
|
|
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.
|
|
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.
|
|
152
|
-
"--fs-chip-hover-border-color" : colors.value.
|
|
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!,
|
package/components/FSIcon.vue
CHANGED
|
@@ -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<
|
|
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="
|
|
14
|
-
:color="
|
|
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:
|
|
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<
|
|
66
|
+
type: String as PropType<ColorBaseVariations | null>,
|
|
68
67
|
required: false,
|
|
69
|
-
default:
|
|
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
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
116
|
-
|
|
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="
|
|
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-
|
|
42
|
-
:lineClamp="
|
|
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:
|
|
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"],
|
|
@@ -58,30 +58,27 @@ export default {
|
|
|
58
58
|
if (!map.value) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
|
|
62
61
|
const layers = markerClusterGroup.value.getLayers();
|
|
62
|
+
if (layers.length === props.expectedLayers && !added) {
|
|
63
|
+
markerClusterGroup.value.addTo(map.value);
|
|
64
|
+
added = true;
|
|
65
|
+
}
|
|
63
66
|
|
|
64
67
|
if (layers.length === 0 && added) {
|
|
65
68
|
map.value.removeLayer(markerClusterGroup.value as unknown as L.Layer);
|
|
66
69
|
added = false;
|
|
67
|
-
return;
|
|
68
70
|
}
|
|
69
|
-
if (layers.length === props.expectedLayers && !added) {
|
|
70
|
-
markerClusterGroup.value.addTo(map.value);
|
|
71
|
-
added = true;
|
|
72
|
-
}
|
|
73
|
-
if (layers.length === props.expectedLayers) {
|
|
74
|
-
const bounds = new LatLngBounds([]);
|
|
75
|
-
for (const layer of layers as any[]) {
|
|
76
|
-
if (layer.getBounds) {
|
|
77
|
-
bounds.extend(layer.getBounds());
|
|
78
|
-
} else if (layer.getLatLng) {
|
|
79
|
-
bounds.extend(layer.getLatLng());
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
71
|
|
|
83
|
-
|
|
72
|
+
const bounds = new LatLngBounds([]);
|
|
73
|
+
for (const layer of layers as any[]) {
|
|
74
|
+
if (layer.getBounds) {
|
|
75
|
+
bounds.extend(layer.getBounds());
|
|
76
|
+
} else if (layer.getLatLng) {
|
|
77
|
+
bounds.extend(layer.getLatLng());
|
|
78
|
+
}
|
|
84
79
|
}
|
|
80
|
+
|
|
81
|
+
emit("update:bounds", layers.length > 0 ? bounds : null);
|
|
85
82
|
};
|
|
86
83
|
|
|
87
84
|
markerClusterGroup.value.on("layeradd", handleLayerChange);
|
|
@@ -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>,
|
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
|
|
4
|
+
"version": "1.0.156",
|
|
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
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.156
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.156",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.156"
|
|
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": "
|
|
38
|
+
"gitHead": "d67f90e266b8ae583f46c82aec2dbd381c5d3629"
|
|
39
39
|
}
|
package/utils/operations.ts
CHANGED
|
@@ -1,7 +1,42 @@
|
|
|
1
1
|
const MinusOperator = "-";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
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++) {
|