@dative-gpi/foundation-shared-components 0.0.37 → 0.0.39
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 +1 -17
- package/components/FSChip.vue +10 -17
- package/components/FSClickable.vue +11 -12
- package/components/FSColor.vue +2 -2
- package/components/FSDivider.vue +30 -10
- package/components/FSErrorToast.vue +67 -0
- package/components/FSFadeOut.vue +23 -5
- package/components/FSOptionGroup.vue +311 -0
- package/components/FSOptionItem.vue +132 -0
- package/components/FSSlideGroup.vue +25 -1
- package/components/FSTabs.vue +3 -4
- package/components/FSTag.vue +7 -8
- package/components/FSToggleSet.vue +2 -0
- package/components/FSWrapGroup.vue +1 -17
- package/components/fields/FSIconField.vue +1 -1
- package/composables/useColors.ts +66 -37
- package/composables/useRules.ts +3 -0
- package/models/colors.ts +4 -0
- package/models/errors.ts +36 -0
- package/models/index.ts +1 -0
- package/package.json +4 -4
- package/styles/components/fs_color.scss +1 -1
- package/styles/components/fs_container.scss +5 -5
- package/styles/components/fs_error_toast.scss +5 -0
- package/styles/components/fs_option_group.scss +7 -0
- package/styles/components/fs_span.scss +1 -1
- package/styles/components/index.scss +2 -0
- package/utils/error.ts +5 -0
- package/utils/index.ts +1 -0
|
@@ -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
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
</FSClickable>
|
|
47
47
|
<FSRow
|
|
48
48
|
v-else
|
|
49
|
-
align="center-center"
|
|
50
49
|
width="hug"
|
|
51
50
|
:class="iconClasses"
|
|
52
51
|
:style="style"
|
|
@@ -74,7 +73,6 @@
|
|
|
74
73
|
</FSIcon>
|
|
75
74
|
<FSSpan
|
|
76
75
|
v-if="$props.label"
|
|
77
|
-
font="text-overline"
|
|
78
76
|
>
|
|
79
77
|
{{ $props.label }}
|
|
80
78
|
</FSSpan>
|
|
@@ -89,7 +87,6 @@
|
|
|
89
87
|
</FSIcon>
|
|
90
88
|
<FSSpan
|
|
91
89
|
v-if="$props.label"
|
|
92
|
-
font="text-overline"
|
|
93
90
|
>
|
|
94
91
|
{{ $props.label }}
|
|
95
92
|
</FSSpan>
|
|
@@ -99,7 +96,7 @@
|
|
|
99
96
|
|
|
100
97
|
<script lang="ts">
|
|
101
98
|
import { computed, defineComponent, PropType } from "vue";
|
|
102
|
-
import { RouteLocation
|
|
99
|
+
import { RouteLocation } from "vue-router";
|
|
103
100
|
|
|
104
101
|
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
105
102
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -173,7 +170,6 @@ export default defineComponent({
|
|
|
173
170
|
setup(props, { emit }) {
|
|
174
171
|
const { getColors } = useColors();
|
|
175
172
|
const { slots } = useSlots();
|
|
176
|
-
const router = useRouter();
|
|
177
173
|
|
|
178
174
|
const colors = computed(() => getColors(props.color));
|
|
179
175
|
const lights = getColors(ColorEnum.Light);
|
|
@@ -235,18 +231,6 @@ export default defineComponent({
|
|
|
235
231
|
return "fit-content";
|
|
236
232
|
});
|
|
237
233
|
|
|
238
|
-
const href = computed((): string | null => {
|
|
239
|
-
if (!props.to || !props.editable || props.load) {
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
|
-
if (typeof props.to === "string") {
|
|
243
|
-
return props.to;
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
return router.resolve(props.to).href;
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
|
|
250
234
|
const onClick = (event: MouseEvent) => {
|
|
251
235
|
if (!props.to && props.editable && !props.load) {
|
|
252
236
|
emit("click", event);
|
package/components/FSChip.vue
CHANGED
|
@@ -85,41 +85,34 @@ export default defineComponent({
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
setup(props) {
|
|
88
|
-
const { getColors
|
|
88
|
+
const { getColors } = useColors();
|
|
89
89
|
|
|
90
90
|
const colors = computed(() => getColors(props.color));
|
|
91
91
|
const backgrounds = getColors(ColorEnum.Background);
|
|
92
92
|
|
|
93
|
-
const textColors = computed(() => {
|
|
94
|
-
switch (props.variant) {
|
|
95
|
-
case "standard": return colors.value;
|
|
96
|
-
case "full": return getContrasts(props.color);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
|
|
100
93
|
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
101
94
|
switch (props.variant) {
|
|
102
95
|
case "standard": return {
|
|
103
96
|
"--fs-chip-background-color" : backgrounds.base,
|
|
104
97
|
"--fs-chip-border-color" : colors.value.base,
|
|
105
|
-
"--fs-chip-color" :
|
|
98
|
+
"--fs-chip-color" : colors.value.base,
|
|
106
99
|
"--fs-chip-hover-background-color" : backgrounds.base,
|
|
107
100
|
"--fs-chip-hover-border-color" : colors.value.base,
|
|
108
|
-
"--fs-chip-hover-color" :
|
|
101
|
+
"--fs-chip-hover-color" : colors.value.base,
|
|
109
102
|
"--fs-chip-active-background-color": backgrounds.base,
|
|
110
103
|
"--fs-chip-active-border-color" : colors.value.dark,
|
|
111
|
-
"--fs-chip-active-color" :
|
|
104
|
+
"--fs-chip-active-color" : colors.value.dark
|
|
112
105
|
};
|
|
113
106
|
case "full": return {
|
|
114
107
|
"--fs-chip-background-color" : colors.value.base,
|
|
115
|
-
"--fs-chip-border-color" : colors.value.
|
|
116
|
-
"--fs-chip-color" :
|
|
108
|
+
"--fs-chip-border-color" : colors.value.baseContrast,
|
|
109
|
+
"--fs-chip-color" : colors.value.baseContrast,
|
|
117
110
|
"--fs-chip-hover-background-color" : colors.value.base,
|
|
118
|
-
"--fs-chip-hover-border-color" : colors.value.
|
|
119
|
-
"--fs-chip-hover-color" :
|
|
111
|
+
"--fs-chip-hover-border-color" : colors.value.baseContrast,
|
|
112
|
+
"--fs-chip-hover-color" : colors.value.baseContrast,
|
|
120
113
|
"--fs-chip-active-background-color": colors.value.dark,
|
|
121
|
-
"--fs-chip-active-border-color" : colors.value.
|
|
122
|
-
"--fs-chip-active-color" :
|
|
114
|
+
"--fs-chip-active-border-color" : colors.value.darkContrast,
|
|
115
|
+
"--fs-chip-active-color" : colors.value.darkContrast
|
|
123
116
|
};
|
|
124
117
|
}
|
|
125
118
|
});
|
|
@@ -116,10 +116,9 @@ export default defineComponent({
|
|
|
116
116
|
},
|
|
117
117
|
emits: ["click"],
|
|
118
118
|
setup(props, { emit }) {
|
|
119
|
-
const { getColors
|
|
119
|
+
const { getColors } = useColors();
|
|
120
120
|
const router = useRouter();
|
|
121
121
|
|
|
122
|
-
const textColors = computed(() => getContrasts(props.color));
|
|
123
122
|
const colors = computed(() => getColors(props.color));
|
|
124
123
|
const lights = getColors(ColorEnum.Light);
|
|
125
124
|
const darks = getColors(ColorEnum.Dark);
|
|
@@ -129,7 +128,7 @@ export default defineComponent({
|
|
|
129
128
|
return {
|
|
130
129
|
"--fs-clickable-border-size" : props.border ? "1px" : "0",
|
|
131
130
|
"--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
|
|
132
|
-
"--fs-clickable-background-color": lights.
|
|
131
|
+
"--fs-clickable-background-color": lights.light,
|
|
133
132
|
"--fs-clickable-border-color" : lights.dark,
|
|
134
133
|
"--fs-clickable-color" : lights.dark
|
|
135
134
|
};
|
|
@@ -139,27 +138,27 @@ export default defineComponent({
|
|
|
139
138
|
"--fs-clickable-border-size" : props.border ? "1px" : "0",
|
|
140
139
|
"--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
|
|
141
140
|
"--fs-clickable-background-color" : colors.value.light,
|
|
142
|
-
"--fs-clickable-border-color" : colors.value.
|
|
143
|
-
"--fs-clickable-color" :
|
|
141
|
+
"--fs-clickable-border-color" : colors.value.lightContrast,
|
|
142
|
+
"--fs-clickable-color" : colors.value.lightContrast,
|
|
144
143
|
"--fs-clickable-hover-background-color" : colors.value.base,
|
|
145
|
-
"--fs-clickable-hover-border-color" : colors.value.
|
|
146
|
-
"--fs-clickable-hover-color" :
|
|
144
|
+
"--fs-clickable-hover-border-color" : colors.value.baseContrast,
|
|
145
|
+
"--fs-clickable-hover-color" : colors.value.baseContrast,
|
|
147
146
|
"--fs-clickable-active-background-color": colors.value.dark,
|
|
148
|
-
"--fs-clickable-active-border-color" : colors.value.
|
|
149
|
-
"--fs-clickable-active-color" :
|
|
147
|
+
"--fs-clickable-active-border-color" : colors.value.darkContrast,
|
|
148
|
+
"--fs-clickable-active-color" : colors.value.darkContrast
|
|
150
149
|
};
|
|
151
150
|
case "full": return {
|
|
152
151
|
"--fs-clickable-border-size" : props.border ? "1px" : "0",
|
|
153
152
|
"--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
|
|
154
153
|
"--fs-clickable-background-color" : colors.value.base,
|
|
155
154
|
"--fs-clickable-border-color" : colors.value.base,
|
|
156
|
-
"--fs-clickable-color" :
|
|
155
|
+
"--fs-clickable-color" : colors.value.baseContrast,
|
|
157
156
|
"--fs-clickable-hover-background-color" : colors.value.base,
|
|
158
157
|
"--fs-clickable-hover-border-color" : colors.value.base,
|
|
159
|
-
"--fs-clickable-hover-color" :
|
|
158
|
+
"--fs-clickable-hover-color" : colors.value.baseContrast,
|
|
160
159
|
"--fs-clickable-active-background-color": colors.value.dark,
|
|
161
160
|
"--fs-clickable-active-border-color" : colors.value.dark,
|
|
162
|
-
"--fs-clickable-active-color" :
|
|
161
|
+
"--fs-clickable-active-color" : colors.value.darkContrast
|
|
163
162
|
};
|
|
164
163
|
}
|
|
165
164
|
});
|
package/components/FSColor.vue
CHANGED
|
@@ -41,8 +41,8 @@ export default defineComponent({
|
|
|
41
41
|
|
|
42
42
|
const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
|
|
43
43
|
"--fs-color-background-color": colors.value.light,
|
|
44
|
-
"--fs-color-border-color" : colors.value.
|
|
45
|
-
"--fs-color-color" : colors.value.
|
|
44
|
+
"--fs-color-border-color" : colors.value.lightContrast,
|
|
45
|
+
"--fs-color-color" : colors.value.lightContrast,
|
|
46
46
|
"--fs-color-light" : colors.value.light,
|
|
47
47
|
"--fs-color-base" : colors.value.base,
|
|
48
48
|
"--fs-color-dark" : colors.value.dark
|
package/components/FSDivider.vue
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
import { computed, defineComponent, PropType } from "vue";
|
|
33
33
|
|
|
34
34
|
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
35
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
35
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
36
36
|
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
37
37
|
|
|
38
38
|
import FSText from "./FSText.vue";
|
|
@@ -43,32 +43,52 @@ export default defineComponent({
|
|
|
43
43
|
FSText
|
|
44
44
|
},
|
|
45
45
|
props: {
|
|
46
|
-
width: {
|
|
47
|
-
type: [String, Number],
|
|
48
|
-
required: false,
|
|
49
|
-
default: "100%"
|
|
50
|
-
},
|
|
51
46
|
label: {
|
|
52
47
|
type: String,
|
|
53
48
|
required: false,
|
|
54
49
|
default: null
|
|
55
50
|
},
|
|
51
|
+
width: {
|
|
52
|
+
type: [String, Number],
|
|
53
|
+
required: false,
|
|
54
|
+
default: "100%"
|
|
55
|
+
},
|
|
56
56
|
font: {
|
|
57
57
|
type: String as PropType<"text-h1" | "text-h2" | "text-h3" | "text-h4" | "text-body" | "text-button" | "text-overline" | "text-underline">,
|
|
58
58
|
required: false,
|
|
59
59
|
default: "text-body"
|
|
60
|
+
},
|
|
61
|
+
color: {
|
|
62
|
+
type: String as PropType<ColorBase>,
|
|
63
|
+
required: false,
|
|
64
|
+
default: ColorEnum.Light
|
|
65
|
+
},
|
|
66
|
+
variant: {
|
|
67
|
+
type: String as PropType<"base" | "light" | "dark">,
|
|
68
|
+
required: false,
|
|
69
|
+
default: "dark"
|
|
60
70
|
}
|
|
61
71
|
},
|
|
62
72
|
setup(props) {
|
|
63
73
|
const { getColors } = useColors();
|
|
64
74
|
const { slots } = useSlots();
|
|
65
75
|
|
|
66
|
-
const
|
|
76
|
+
const colors = computed(() => getColors(props.color));
|
|
67
77
|
|
|
68
78
|
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
|
|
79
|
+
switch (props.variant) {
|
|
80
|
+
case "base": return {
|
|
81
|
+
"--fs-divider-width": sizeToVar(props.width),
|
|
82
|
+
"--fs-divider-color": colors.value.base
|
|
83
|
+
};
|
|
84
|
+
case "light": return {
|
|
85
|
+
"--fs-divider-width": sizeToVar(props.width),
|
|
86
|
+
"--fs-divider-color": colors.value.light
|
|
87
|
+
};
|
|
88
|
+
case "dark": return {
|
|
89
|
+
"--fs-divider-width": sizeToVar(props.width),
|
|
90
|
+
"--fs-divider-color": colors.value.dark
|
|
91
|
+
};
|
|
72
92
|
}
|
|
73
93
|
});
|
|
74
94
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
padding="18px 0 18px 32px"
|
|
4
|
+
class="fs-error-toast"
|
|
5
|
+
align="center-left"
|
|
6
|
+
:style="style"
|
|
7
|
+
>
|
|
8
|
+
<FSIcon>
|
|
9
|
+
mdi-alert-outline
|
|
10
|
+
</FSIcon>
|
|
11
|
+
<FSSpan>
|
|
12
|
+
{{ $tr(error.code, error.default) }}
|
|
13
|
+
</FSSpan>
|
|
14
|
+
</FSRow>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
import { computed, defineComponent } from "vue";
|
|
19
|
+
|
|
20
|
+
import { getError, sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
21
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
22
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
23
|
+
|
|
24
|
+
import FSIcon from "./FSIcon.vue";
|
|
25
|
+
import FSSpan from "./FSSpan.vue";
|
|
26
|
+
import FSRow from "./FSRow.vue";
|
|
27
|
+
|
|
28
|
+
export default defineComponent({
|
|
29
|
+
name: "FSErrorToast",
|
|
30
|
+
components: {
|
|
31
|
+
FSIcon,
|
|
32
|
+
FSSpan,
|
|
33
|
+
FSRow
|
|
34
|
+
},
|
|
35
|
+
props: {
|
|
36
|
+
errorCode: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
borderRadius: {
|
|
41
|
+
type: [String, Number],
|
|
42
|
+
required: false,
|
|
43
|
+
default: "4px"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
setup(props) {
|
|
47
|
+
const { getColors } = useColors();
|
|
48
|
+
|
|
49
|
+
const errors = getColors(ColorEnum.Error);
|
|
50
|
+
|
|
51
|
+
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
52
|
+
return {
|
|
53
|
+
"--fs-error-toast-border-radius" : sizeToVar(props.borderRadius),
|
|
54
|
+
"--fs-error-toast-background-color": errors.base,
|
|
55
|
+
"--fs-error-toast-color" : errors.light
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const error = computed((): { code: string, default: string, status: number } => getError(props.errorCode));
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
error,
|
|
63
|
+
style
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
</script>
|
package/components/FSFadeOut.vue
CHANGED
|
@@ -66,10 +66,18 @@ export default defineComponent({
|
|
|
66
66
|
case "number": return sizeToVar(props.padding);
|
|
67
67
|
default:
|
|
68
68
|
const paddings = props.padding.split(" ");
|
|
69
|
+
let tempPadding = "0px";
|
|
69
70
|
switch (paddings.length) {
|
|
70
|
-
case 0 :
|
|
71
|
-
|
|
71
|
+
case 0 :
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
tempPadding = "-" + sizeToVar(paddings[0]);
|
|
75
|
+
break;
|
|
72
76
|
}
|
|
77
|
+
if (tempPadding === "0px") {
|
|
78
|
+
return "-1px";
|
|
79
|
+
}
|
|
80
|
+
return tempPadding;
|
|
73
81
|
}
|
|
74
82
|
});
|
|
75
83
|
|
|
@@ -78,12 +86,22 @@ export default defineComponent({
|
|
|
78
86
|
case "number": return sizeToVar(props.padding);
|
|
79
87
|
default:
|
|
80
88
|
const paddings = props.padding.split(" ");
|
|
89
|
+
let tempPadding = "0px";
|
|
81
90
|
switch (paddings.length) {
|
|
82
|
-
case 0 :
|
|
91
|
+
case 0 :
|
|
92
|
+
break;
|
|
83
93
|
case 1 :
|
|
84
|
-
case 2 :
|
|
85
|
-
|
|
94
|
+
case 2 :
|
|
95
|
+
tempPadding = "-" + sizeToVar(paddings[0]);
|
|
96
|
+
break;
|
|
97
|
+
default:
|
|
98
|
+
tempPadding = "-" + sizeToVar(paddings[2]);
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
if (tempPadding === "0px") {
|
|
102
|
+
return "-1px";
|
|
86
103
|
}
|
|
104
|
+
return tempPadding;
|
|
87
105
|
}
|
|
88
106
|
});
|
|
89
107
|
|