@dative-gpi/foundation-shared-components 0.0.36 → 0.0.38
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 +10 -3
- package/components/FSButton.vue +41 -6
- package/components/FSClickable.vue +2 -2
- package/components/FSColorIcon.vue +3 -3
- package/components/FSDialog.vue +1 -1
- package/components/deviceOrganisations/FSConnectivity.vue +1 -1
- package/components/deviceOrganisations/FSStatus.vue +1 -1
- package/components/deviceOrganisations/FSWorstAlert.vue +1 -1
- package/composables/useBreakpoints.ts +3 -3
- package/package.json +4 -4
- package/styles/components/fs_button.scss +5 -0
- package/styles/components/fs_span.scss +1 -1
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
<template #text>
|
|
28
28
|
<slot name="content">
|
|
29
|
-
<FSText
|
|
29
|
+
<FSText
|
|
30
|
+
:lineClamp="$props.lineClampContent"
|
|
31
|
+
>
|
|
30
32
|
{{ $props.content }}
|
|
31
33
|
</FSText>
|
|
32
34
|
</slot>
|
|
@@ -35,10 +37,10 @@
|
|
|
35
37
|
</template>
|
|
36
38
|
|
|
37
39
|
<script lang="ts">
|
|
38
|
-
import { computed, defineComponent
|
|
40
|
+
import { computed, defineComponent } from "vue";
|
|
39
41
|
|
|
40
|
-
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
41
42
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
43
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
42
44
|
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
43
45
|
|
|
44
46
|
import FSIcon from "./FSIcon.vue";
|
|
@@ -80,6 +82,11 @@ export default defineComponent({
|
|
|
80
82
|
required: false,
|
|
81
83
|
default: "16px"
|
|
82
84
|
},
|
|
85
|
+
lineClampContent: {
|
|
86
|
+
type: Number,
|
|
87
|
+
required: false,
|
|
88
|
+
default: 5
|
|
89
|
+
},
|
|
83
90
|
divider: {
|
|
84
91
|
type: Boolean,
|
|
85
92
|
required: false,
|
package/components/FSButton.vue
CHANGED
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
:color="$props.color"
|
|
9
9
|
:load="$props.load"
|
|
10
10
|
:padding="padding"
|
|
11
|
+
:to="$props.to"
|
|
11
12
|
:style="style"
|
|
12
13
|
:width="width"
|
|
13
|
-
@click="
|
|
14
|
+
@click.stop="onClick"
|
|
14
15
|
v-bind="$attrs"
|
|
15
16
|
>
|
|
16
17
|
<FSRow
|
|
@@ -45,7 +46,6 @@
|
|
|
45
46
|
</FSClickable>
|
|
46
47
|
<FSRow
|
|
47
48
|
v-else
|
|
48
|
-
align="center-center"
|
|
49
49
|
width="hug"
|
|
50
50
|
:class="iconClasses"
|
|
51
51
|
:style="style"
|
|
@@ -61,6 +61,23 @@
|
|
|
61
61
|
:color="loadColor"
|
|
62
62
|
/>
|
|
63
63
|
</template>
|
|
64
|
+
<template v-else-if="$props.to">
|
|
65
|
+
<router-link
|
|
66
|
+
:to="$props.to"
|
|
67
|
+
>
|
|
68
|
+
<FSIcon
|
|
69
|
+
v-if="$props.icon"
|
|
70
|
+
size="l"
|
|
71
|
+
>
|
|
72
|
+
{{ $props.icon }}
|
|
73
|
+
</FSIcon>
|
|
74
|
+
<FSSpan
|
|
75
|
+
v-if="$props.label"
|
|
76
|
+
>
|
|
77
|
+
{{ $props.label }}
|
|
78
|
+
</FSSpan>
|
|
79
|
+
</router-link>
|
|
80
|
+
</template>
|
|
64
81
|
<template v-else>
|
|
65
82
|
<FSIcon
|
|
66
83
|
v-if="$props.icon"
|
|
@@ -70,7 +87,6 @@
|
|
|
70
87
|
</FSIcon>
|
|
71
88
|
<FSSpan
|
|
72
89
|
v-if="$props.label"
|
|
73
|
-
font="text-overline"
|
|
74
90
|
>
|
|
75
91
|
{{ $props.label }}
|
|
76
92
|
</FSSpan>
|
|
@@ -80,6 +96,7 @@
|
|
|
80
96
|
|
|
81
97
|
<script lang="ts">
|
|
82
98
|
import { computed, defineComponent, PropType } from "vue";
|
|
99
|
+
import { RouteLocation, useRouter } from "vue-router";
|
|
83
100
|
|
|
84
101
|
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
85
102
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -98,6 +115,11 @@ export default defineComponent({
|
|
|
98
115
|
FSRow
|
|
99
116
|
},
|
|
100
117
|
props: {
|
|
118
|
+
to: {
|
|
119
|
+
type: [String, Object] as PropType<string | RouteLocation>,
|
|
120
|
+
required: false,
|
|
121
|
+
default: null
|
|
122
|
+
},
|
|
101
123
|
prependIcon: {
|
|
102
124
|
type: String,
|
|
103
125
|
required: false,
|
|
@@ -148,6 +170,7 @@ export default defineComponent({
|
|
|
148
170
|
setup(props, { emit }) {
|
|
149
171
|
const { getColors } = useColors();
|
|
150
172
|
const { slots } = useSlots();
|
|
173
|
+
const router = useRouter();
|
|
151
174
|
|
|
152
175
|
const colors = computed(() => getColors(props.color));
|
|
153
176
|
const lights = getColors(ColorEnum.Light);
|
|
@@ -209,9 +232,21 @@ export default defineComponent({
|
|
|
209
232
|
return "fit-content";
|
|
210
233
|
});
|
|
211
234
|
|
|
212
|
-
const
|
|
213
|
-
if (props.
|
|
214
|
-
|
|
235
|
+
const href = computed((): string | null => {
|
|
236
|
+
if (!props.to || !props.editable || props.load) {
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
if (typeof props.to === "string") {
|
|
240
|
+
return props.to;
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
return router.resolve(props.to).href;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
const onClick = (event: MouseEvent) => {
|
|
248
|
+
if (!props.to && props.editable && !props.load) {
|
|
249
|
+
emit("click", event);
|
|
215
250
|
}
|
|
216
251
|
};
|
|
217
252
|
|
|
@@ -24,7 +24,7 @@ export default defineComponent({
|
|
|
24
24
|
default: "m"
|
|
25
25
|
},
|
|
26
26
|
variant: {
|
|
27
|
-
type: String as PropType<"standard" | "
|
|
27
|
+
type: String as PropType<"standard" | "full">,
|
|
28
28
|
required: false,
|
|
29
29
|
default: "standard"
|
|
30
30
|
},
|
|
@@ -41,7 +41,7 @@ export default defineComponent({
|
|
|
41
41
|
|
|
42
42
|
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
43
43
|
switch (props.variant) {
|
|
44
|
-
case "
|
|
44
|
+
case "full": return {
|
|
45
45
|
"--fs-icon-background-color": colors.value.light
|
|
46
46
|
};
|
|
47
47
|
default: return {
|
|
@@ -53,7 +53,7 @@ export default defineComponent({
|
|
|
53
53
|
const classes = computed((): string[] => {
|
|
54
54
|
const classNames = [`fs-icon-${props.size}`];
|
|
55
55
|
switch (props.variant) {
|
|
56
|
-
case "
|
|
56
|
+
case "full":
|
|
57
57
|
classNames.push("fs-color-icon");
|
|
58
58
|
break;
|
|
59
59
|
}
|
package/components/FSDialog.vue
CHANGED
|
@@ -2,10 +2,10 @@ import { computed, ref } from "vue";
|
|
|
2
2
|
|
|
3
3
|
let initialized = false;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const windowWidth = ref(window.innerWidth);
|
|
5
|
+
const windowHeight = ref(window.innerHeight);
|
|
6
|
+
const windowWidth = ref(window.innerWidth);
|
|
8
7
|
|
|
8
|
+
export const useBreakpoints = () => {
|
|
9
9
|
const onSizeChange = (): void => {
|
|
10
10
|
windowHeight.value = window.innerHeight;
|
|
11
11
|
windowWidth.value = window.innerWidth;
|
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.
|
|
4
|
+
"version": "0.0.38",
|
|
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.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "0.0.38",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.38",
|
|
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": "
|
|
35
|
+
"gitHead": "6dbe0959177629f0285f2eae895690376a6fa0e1"
|
|
36
36
|
}
|