@dative-gpi/foundation-shared-components 0.0.5 → 0.0.7
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/FSBreadcrumbs.vue +16 -14
- package/components/FSButton.vue +171 -115
- package/components/FSCheckbox.vue +21 -10
- package/components/FSCol.vue +17 -17
- package/components/FSColor.vue +80 -0
- package/components/FSFadeOut.vue +4 -4
- package/components/FSIcon.vue +5 -3
- package/components/FSNumberField.vue +1 -1
- package/components/FSPasswordField.vue +20 -9
- package/components/FSRadio.vue +20 -10
- package/components/FSRadioGroup.vue +5 -7
- package/components/FSRow.vue +17 -17
- package/components/FSSearchField.vue +122 -0
- package/components/FSSlideGroup.vue +16 -12
- package/components/FSSpan.vue +27 -2
- package/components/FSSwitch.vue +25 -12
- package/components/FSTab.vue +9 -2
- package/components/FSTabs.vue +18 -10
- package/components/FSTag.vue +31 -17
- package/components/FSTagField.vue +152 -0
- package/components/FSTagGroup.vue +60 -0
- package/components/FSText.vue +78 -0
- package/components/FSTextField.vue +74 -18
- package/components/FSWrapGroup.vue +15 -12
- package/composables/useColors.ts +31 -21
- package/{defaults → models}/FSButtons.ts +24 -6
- package/models/FSTags.ts +8 -0
- package/models/FSTextFields.ts +17 -0
- package/package.json +5 -4
- package/styles/components/fs_breadcrumbs.scss +10 -5
- package/styles/components/fs_button.scss +21 -20
- package/styles/components/fs_checkbox.scss +3 -4
- package/styles/components/fs_color.scss +5 -0
- package/styles/components/fs_password_field.scss +6 -1
- package/styles/components/fs_radio.scss +3 -4
- package/styles/components/fs_span.scss +7 -2
- package/styles/components/fs_switch.scss +4 -4
- package/styles/components/fs_tabs.scss +8 -8
- package/styles/components/fs_tag.scss +8 -8
- package/styles/components/fs_tag_field.scss +10 -0
- package/styles/components/fs_text.scss +5 -0
- package/styles/components/fs_text_field.scss +25 -14
- package/styles/components/index.scss +3 -0
- package/styles/globals/overrides.scss +13 -4
- package/styles/globals/text_fonts.scss +4 -0
- package/themes/default.ts +6 -6
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
@update:value="(value) => $emit('update:value', value)"
|
|
11
11
|
v-bind="$attrs"
|
|
12
12
|
>
|
|
13
|
-
<template #append>
|
|
13
|
+
<template #append-inner>
|
|
14
14
|
<FSIcon
|
|
15
15
|
class="fs-password-field-icon"
|
|
16
16
|
size="m"
|
|
@@ -79,18 +79,29 @@ export default defineComponent({
|
|
|
79
79
|
|
|
80
80
|
const stars = ref(true);
|
|
81
81
|
|
|
82
|
-
const
|
|
82
|
+
const lights = useColors().getColors(ColorBase.Light);
|
|
83
|
+
const darks = useColors().getColors(ColorBase.Dark);
|
|
83
84
|
|
|
84
|
-
const
|
|
85
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
86
|
+
if (!editable.value) {
|
|
87
|
+
return {
|
|
88
|
+
"--fs-password-field-cursor" : "default",
|
|
89
|
+
"--fs-password-field-base-text": lights.dark,
|
|
90
|
+
"--fs-password-field-dark-text": lights.dark
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
"--fs-password-field-cursor" : "pointer",
|
|
95
|
+
"--fs-password-field-base-text": darks.base,
|
|
96
|
+
"--fs-password-field-dark-text": darks.dark
|
|
97
|
+
};
|
|
98
|
+
});
|
|
85
99
|
|
|
86
|
-
const
|
|
100
|
+
const type = computed((): string => stars.value ? "password" : "text");
|
|
87
101
|
|
|
88
|
-
const
|
|
89
|
-
"--fs-password-field-cursor" : editable.value ? "pointer" : "default",
|
|
90
|
-
"--fs-password-field-base-text": editable.value ? dark.base : dark.light
|
|
91
|
-
}));
|
|
102
|
+
const icon = computed((): string => stars.value ? "mdi-eye-off-outline" : "mdi-eye-outline");
|
|
92
103
|
|
|
93
|
-
const onToggle = () => {
|
|
104
|
+
const onToggle = (): void => {
|
|
94
105
|
if (!editable.value) {
|
|
95
106
|
return;
|
|
96
107
|
}
|
package/components/FSRadio.vue
CHANGED
|
@@ -88,21 +88,31 @@ export default defineComponent({
|
|
|
88
88
|
setup(props, { emit }) {
|
|
89
89
|
const { value, selected, color, editable } = toRefs(props);
|
|
90
90
|
|
|
91
|
-
const colors = useColors().
|
|
92
|
-
const dark = useColors().getVariants(ColorBase.Dark);
|
|
91
|
+
const colors = useColors().getColors(color.value);
|
|
93
92
|
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
"--fs-radio-base-color": editable.value ? selected.value ? colors.base : dark.base : dark.light,
|
|
97
|
-
"--fs-radio-base-text" : editable.value ? dark.base : dark.light
|
|
93
|
+
const lights = useColors().getColors(ColorBase.Light);
|
|
94
|
+
const darks = useColors().getColors(ColorBase.Dark);
|
|
98
95
|
|
|
99
|
-
}
|
|
96
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
97
|
+
if (!editable.value) {
|
|
98
|
+
return {
|
|
99
|
+
"--fs-radio-cursor": "default",
|
|
100
|
+
"--fs-radio-radio-color": lights.dark,
|
|
101
|
+
"--fs-radio-color": lights.dark
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
"--fs-radio-cursor": selected.value ? "default" : "pointer",
|
|
106
|
+
"--fs-radio-radio-color": selected.value ? colors.base : darks.base,
|
|
107
|
+
"--fs-radio-color" : darks.base
|
|
108
|
+
};
|
|
109
|
+
});
|
|
100
110
|
|
|
101
|
-
const icon = computed(() => selected.value ? "mdi-radiobox-marked" : "mdi-radiobox-blank");
|
|
111
|
+
const icon = computed((): string => selected.value ? "mdi-radiobox-marked" : "mdi-radiobox-blank");
|
|
102
112
|
|
|
103
|
-
const font = computed(() => selected.value ? "text-button" : "text-body");
|
|
113
|
+
const font = computed((): string => selected.value ? "text-button" : "text-body");
|
|
104
114
|
|
|
105
|
-
const onToggle = () => {
|
|
115
|
+
const onToggle = (): void => {
|
|
106
116
|
if (!editable.value) {
|
|
107
117
|
return;
|
|
108
118
|
}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
:description="item.description"
|
|
8
8
|
:value="item.value"
|
|
9
9
|
:selected="isSelected(item.value)"
|
|
10
|
-
:color="color"
|
|
11
|
-
:editable="editable"
|
|
10
|
+
:color="$props.color"
|
|
11
|
+
:editable="$props.editable"
|
|
12
12
|
@update:value="onToggle"
|
|
13
13
|
/>
|
|
14
14
|
</FSCol>
|
|
@@ -52,21 +52,19 @@ export default defineComponent({
|
|
|
52
52
|
},
|
|
53
53
|
emits: ["update:value"],
|
|
54
54
|
setup(props, { emit }) {
|
|
55
|
-
const { value
|
|
55
|
+
const { value } = toRefs(props);
|
|
56
56
|
|
|
57
|
-
const isSelected = (item: String | Boolean | Number) => {
|
|
57
|
+
const isSelected = (item: String | Boolean | Number): boolean => {
|
|
58
58
|
return item == value.value;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
const onToggle = (item: String | Boolean | Number) => {
|
|
61
|
+
const onToggle = (item: String | Boolean | Number): void => {
|
|
62
62
|
if (item != value.value) {
|
|
63
63
|
emit("update:value", item);
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
return {
|
|
68
|
-
color,
|
|
69
|
-
editable,
|
|
70
68
|
isSelected,
|
|
71
69
|
onToggle
|
|
72
70
|
};
|
package/components/FSRow.vue
CHANGED
|
@@ -50,57 +50,57 @@ export default defineComponent({
|
|
|
50
50
|
"--fs-row-height": height.value
|
|
51
51
|
}));
|
|
52
52
|
|
|
53
|
-
const classes = computed((): string => {
|
|
54
|
-
|
|
53
|
+
const classes = computed((): string[] => {
|
|
54
|
+
const classes = ["fs-row"];
|
|
55
55
|
switch (width.value) {
|
|
56
56
|
case "hug":
|
|
57
|
-
classes
|
|
57
|
+
classes.push("fs-row-width-hug");
|
|
58
58
|
break;
|
|
59
59
|
case "fill":
|
|
60
|
-
classes
|
|
60
|
+
classes.push("fs-row-width-fill");
|
|
61
61
|
break;
|
|
62
62
|
default:
|
|
63
|
-
classes
|
|
63
|
+
classes.push("fs-row-width-fixed");
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
switch (height.value) {
|
|
67
67
|
case "hug":
|
|
68
|
-
classes
|
|
68
|
+
classes.push("fs-row-height-hug");
|
|
69
69
|
break;
|
|
70
70
|
case "fill":
|
|
71
|
-
classes
|
|
71
|
+
classes.push("fs-row-height-fill");
|
|
72
72
|
break;
|
|
73
73
|
default:
|
|
74
|
-
classes
|
|
74
|
+
classes.push("fs-row-height-fixed");
|
|
75
75
|
break;
|
|
76
76
|
}
|
|
77
77
|
switch (align.value) {
|
|
78
78
|
case "top-left":
|
|
79
|
-
classes
|
|
79
|
+
classes.push("fs-row-top-left");
|
|
80
80
|
break;
|
|
81
81
|
case "top-center":
|
|
82
|
-
classes
|
|
82
|
+
classes.push("fs-row-top-center");
|
|
83
83
|
break;
|
|
84
84
|
case "top-right":
|
|
85
|
-
classes
|
|
85
|
+
classes.push("fs-row-top-right");
|
|
86
86
|
break;
|
|
87
87
|
case "center-left":
|
|
88
|
-
classes
|
|
88
|
+
classes.push("fs-row-center-left");
|
|
89
89
|
break;
|
|
90
90
|
case "center-center":
|
|
91
|
-
classes
|
|
91
|
+
classes.push("fs-row-center-center");
|
|
92
92
|
break;
|
|
93
93
|
case "center-right":
|
|
94
|
-
classes
|
|
94
|
+
classes.push("fs-row-center-right");
|
|
95
95
|
break;
|
|
96
96
|
case "bottom-left":
|
|
97
|
-
classes
|
|
97
|
+
classes.push("fs-row-bottom-left");
|
|
98
98
|
break;
|
|
99
99
|
case "bottom-center":
|
|
100
|
-
classes
|
|
100
|
+
classes.push("fs-row-bottom-center");
|
|
101
101
|
break;
|
|
102
102
|
case "bottom-right":
|
|
103
|
-
classes
|
|
103
|
+
classes.push("fs-row-bottom-right");
|
|
104
104
|
break;
|
|
105
105
|
}
|
|
106
106
|
return classes;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSTextField
|
|
3
|
+
:label="$props.label"
|
|
4
|
+
:description="$props.description"
|
|
5
|
+
:type="type"
|
|
6
|
+
:color="$props.color"
|
|
7
|
+
:required="$props.required"
|
|
8
|
+
:editable="$props.editable"
|
|
9
|
+
:value="innerValue"
|
|
10
|
+
@update:value="(value) => innerValue = value"
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
>
|
|
13
|
+
<template #append>
|
|
14
|
+
<FSButton
|
|
15
|
+
:prependIcon="$props.buttonPrependIcon"
|
|
16
|
+
:label="$props.buttonLabel"
|
|
17
|
+
:appendIcon="$props.buttonAppendIcon"
|
|
18
|
+
:variant="$props.buttonVariant"
|
|
19
|
+
:color="$props.buttonColor"
|
|
20
|
+
:editable="$props.editable"
|
|
21
|
+
@click="onUpdate"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
24
|
+
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
25
|
+
<slot :name="name" v-bind="slotData" />
|
|
26
|
+
</template>
|
|
27
|
+
</FSTextField>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts">
|
|
31
|
+
import { defineComponent, PropType, Ref, ref, toRefs } from "vue";
|
|
32
|
+
|
|
33
|
+
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
34
|
+
|
|
35
|
+
import FSTextField from "./FSTextField.vue";
|
|
36
|
+
import FSButton from "./FSButton.vue";
|
|
37
|
+
import FSIcon from "./FSIcon.vue";
|
|
38
|
+
|
|
39
|
+
export default defineComponent({
|
|
40
|
+
name: "FSSearchField",
|
|
41
|
+
components: {
|
|
42
|
+
FSTextField,
|
|
43
|
+
FSButton,
|
|
44
|
+
FSIcon
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
label: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: false,
|
|
50
|
+
default: null
|
|
51
|
+
},
|
|
52
|
+
description: {
|
|
53
|
+
type: String,
|
|
54
|
+
required: false,
|
|
55
|
+
default: null
|
|
56
|
+
},
|
|
57
|
+
buttonPrependIcon: {
|
|
58
|
+
type: String,
|
|
59
|
+
required: false,
|
|
60
|
+
default: "mdi-magnify"
|
|
61
|
+
},
|
|
62
|
+
buttonLabel: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: false,
|
|
65
|
+
default: null
|
|
66
|
+
},
|
|
67
|
+
buttonAppendIcon: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: false,
|
|
70
|
+
default: null
|
|
71
|
+
},
|
|
72
|
+
buttonVariant: {
|
|
73
|
+
type: String as PropType<"standard" | "full" | "icon">,
|
|
74
|
+
required: false,
|
|
75
|
+
default: "standard"
|
|
76
|
+
},
|
|
77
|
+
value: {
|
|
78
|
+
type: String,
|
|
79
|
+
required: false,
|
|
80
|
+
default: null
|
|
81
|
+
},
|
|
82
|
+
color: {
|
|
83
|
+
type: String as PropType<ColorBase>,
|
|
84
|
+
required: false,
|
|
85
|
+
default: ColorBase.Dark
|
|
86
|
+
},
|
|
87
|
+
buttonColor: {
|
|
88
|
+
type: String as PropType<ColorBase>,
|
|
89
|
+
required: false,
|
|
90
|
+
default: ColorBase.Primary
|
|
91
|
+
},
|
|
92
|
+
required: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
required: false,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
97
|
+
editable: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
required: false,
|
|
100
|
+
default: true
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
emits: ["update:value"],
|
|
104
|
+
setup(props, { emit }) {
|
|
105
|
+
const { editable } = toRefs(props);
|
|
106
|
+
|
|
107
|
+
const innerValue: Ref<String> = ref(props.value);
|
|
108
|
+
|
|
109
|
+
const onUpdate = (): void => {
|
|
110
|
+
if (!editable.value) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
emit("update:value", innerValue.value);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
innerValue,
|
|
118
|
+
onUpdate
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
</script>
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
>
|
|
8
8
|
<FSRow>
|
|
9
9
|
<v-slide-group-item v-for="(component, index) in $slots.default()" :key="index">
|
|
10
|
-
<component :is="component" v-bind="{ color }" />
|
|
10
|
+
<component :is="component" v-bind="{ color, colors, style }" />
|
|
11
11
|
</v-slide-group-item>
|
|
12
12
|
</FSRow>
|
|
13
13
|
</v-slide-group>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script lang="ts">
|
|
17
|
-
import { defineComponent, PropType, toRefs } from "vue";
|
|
17
|
+
import { defineComponent, PropType, Ref, ref, toRefs } from "vue";
|
|
18
18
|
|
|
19
19
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
20
20
|
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
@@ -36,20 +36,24 @@ export default defineComponent({
|
|
|
36
36
|
setup(props) {
|
|
37
37
|
const { color } = toRefs(props);
|
|
38
38
|
|
|
39
|
-
const
|
|
40
|
-
const
|
|
39
|
+
const textColors = useColors().getContrasts(color.value);
|
|
40
|
+
const colors = useColors().getColors(color.value);
|
|
41
41
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"--fs-group-
|
|
46
|
-
"--fs-group-
|
|
47
|
-
"--fs-group-
|
|
48
|
-
"--fs-group-
|
|
49
|
-
|
|
42
|
+
const darks = useColors().getColors(ColorBase.Dark);
|
|
43
|
+
|
|
44
|
+
const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
|
|
45
|
+
"--fs-group-color": darks.base,
|
|
46
|
+
"--fs-group-hover-background-color": colors.light,
|
|
47
|
+
"--fs-group-hover-color": darks.dark,
|
|
48
|
+
"--fs-group-disabled-color": darks.light,
|
|
49
|
+
"--fs-group-light": colors.light,
|
|
50
|
+
"--fs-group-base": colors.base,
|
|
51
|
+
"--fs-group-dark": colors.dark
|
|
52
|
+
});
|
|
50
53
|
|
|
51
54
|
return {
|
|
52
55
|
color,
|
|
56
|
+
colors,
|
|
53
57
|
style
|
|
54
58
|
};
|
|
55
59
|
}
|
package/components/FSSpan.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span
|
|
3
|
-
:class="
|
|
3
|
+
:class="classes"
|
|
4
4
|
v-bind="$attrs"
|
|
5
5
|
>
|
|
6
6
|
<slot />
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
import { defineComponent, PropType } from "vue";
|
|
11
|
+
import { computed, defineComponent, PropType, toRefs, useSlots } from "vue";
|
|
12
12
|
|
|
13
13
|
export default defineComponent({
|
|
14
14
|
name: "FSSpan",
|
|
@@ -17,7 +17,32 @@ export default defineComponent({
|
|
|
17
17
|
type: String as PropType<"text-h1" | "text-h2" | "text-h3" | "text-body" | "text-button" | "text-overline" | "text-underline">,
|
|
18
18
|
required: false,
|
|
19
19
|
default: "text-body"
|
|
20
|
+
},
|
|
21
|
+
ellipsis: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
required: false,
|
|
24
|
+
default: true
|
|
20
25
|
}
|
|
26
|
+
},
|
|
27
|
+
setup(props) {
|
|
28
|
+
const { font } = toRefs(props);
|
|
29
|
+
|
|
30
|
+
const slots = useSlots();
|
|
31
|
+
|
|
32
|
+
const classes = computed((): string[] => {
|
|
33
|
+
const classes = ["fs-span", font.value];
|
|
34
|
+
if (props.ellipsis) {
|
|
35
|
+
classes.push("fs-span-ellipsis");
|
|
36
|
+
}
|
|
37
|
+
if (!slots.default) {
|
|
38
|
+
classes.push("fs-span-pre-wrap");
|
|
39
|
+
}
|
|
40
|
+
return classes;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
classes
|
|
45
|
+
};
|
|
21
46
|
}
|
|
22
47
|
});
|
|
23
48
|
</script>
|
package/components/FSSwitch.vue
CHANGED
|
@@ -84,21 +84,34 @@ export default defineComponent({
|
|
|
84
84
|
setup(props, { emit }) {
|
|
85
85
|
const { value, color, editable } = toRefs(props);
|
|
86
86
|
|
|
87
|
-
const
|
|
88
|
-
const colors = useColors().getVariants(color.value);
|
|
89
|
-
const dark = useColors().getVariants(ColorBase.Dark);
|
|
87
|
+
const colors = useColors().getColors(color.value);
|
|
90
88
|
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"--fs-switch-base-color" : value.value ? colors.base : editable.value ? dark.base : dark.light,
|
|
95
|
-
"--fs-switch-base-text" : editable.value ? dark.base : dark.light,
|
|
96
|
-
"--fs-switch-base-background": background.base
|
|
97
|
-
}));
|
|
89
|
+
const backgrounds = useColors().getColors(ColorBase.Background);
|
|
90
|
+
const lights = useColors().getColors(ColorBase.Light);
|
|
91
|
+
const darks = useColors().getColors(ColorBase.Dark);
|
|
98
92
|
|
|
99
|
-
const
|
|
93
|
+
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
94
|
+
if (!editable.value) {
|
|
95
|
+
return {
|
|
96
|
+
"--fs-switch-translate-x": value.value ? "8px" : "-8px",
|
|
97
|
+
"--fs-switch-cursor": "default",
|
|
98
|
+
"--fs-switch-track-color": lights.dark,
|
|
99
|
+
"--fs-switch-thumb-color": backgrounds.base,
|
|
100
|
+
"--fs-switch-color": lights.dark
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
"--fs-switch-translate-x": value.value ? "8px" : "-8px",
|
|
105
|
+
"--fs-switch-cursor": "pointer",
|
|
106
|
+
"--fs-switch-track-color": value.value ? colors.base : darks.base,
|
|
107
|
+
"--fs-switch-thumb-color": backgrounds.base,
|
|
108
|
+
"--fs-switch-color": darks.base
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const font = computed((): string => value.value ? "text-button" : "text-body");
|
|
100
113
|
|
|
101
|
-
const onToggle = () => {
|
|
114
|
+
const onToggle = (): void => {
|
|
102
115
|
if (!editable.value) {
|
|
103
116
|
return;
|
|
104
117
|
}
|
package/components/FSTab.vue
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
{{ $props.label }}
|
|
17
17
|
</FSSpan>
|
|
18
18
|
</slot>
|
|
19
|
-
<v-spacer />
|
|
19
|
+
<v-spacer v-if="$props.tag" />
|
|
20
20
|
<slot name="tag">
|
|
21
21
|
<FSSpan v-if="$props.tag" class="fs-tab-tag">
|
|
22
22
|
{{ $props.tag }}
|
|
@@ -33,7 +33,9 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script lang="ts">
|
|
36
|
-
import { defineComponent } from "vue";
|
|
36
|
+
import { defineComponent, PropType } from "vue";
|
|
37
|
+
|
|
38
|
+
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
37
39
|
|
|
38
40
|
import FSSpan from "./FSSpan.vue";
|
|
39
41
|
import FSIcon from "./FSIcon.vue";
|
|
@@ -66,6 +68,11 @@ export default defineComponent({
|
|
|
66
68
|
type: String,
|
|
67
69
|
required: false,
|
|
68
70
|
default: null
|
|
71
|
+
},
|
|
72
|
+
color: {
|
|
73
|
+
type: String as PropType<ColorBase>,
|
|
74
|
+
required: false,
|
|
75
|
+
default: ColorBase.Dark
|
|
69
76
|
}
|
|
70
77
|
}
|
|
71
78
|
});
|
package/components/FSTabs.vue
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
v-bind="$attrs"
|
|
12
12
|
>
|
|
13
13
|
<template v-for="(component, index) in $slots.default()" :key="index">
|
|
14
|
-
<component :is="component" />
|
|
14
|
+
<component :is="component" v-bind="{ color, colors, style }" />
|
|
15
15
|
</template>
|
|
16
16
|
</v-tabs>
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script lang="ts">
|
|
20
|
-
import { defineComponent, PropType, toRefs } from "vue";
|
|
20
|
+
import { defineComponent, PropType, Ref, ref, toRefs } from "vue";
|
|
21
21
|
|
|
22
22
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
23
23
|
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
@@ -40,18 +40,26 @@ export default defineComponent({
|
|
|
40
40
|
setup(props, { emit }) {
|
|
41
41
|
const { tab, color } = toRefs(props);
|
|
42
42
|
|
|
43
|
-
const
|
|
44
|
-
const
|
|
43
|
+
const textColors = useColors().getContrasts(color.value);
|
|
44
|
+
const colors = useColors().getColors(color.value);
|
|
45
45
|
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"--fs-group-
|
|
50
|
-
"--fs-group-
|
|
51
|
-
|
|
46
|
+
const darks = useColors().getColors(ColorBase.Dark);
|
|
47
|
+
|
|
48
|
+
const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
|
|
49
|
+
"--fs-group-color": darks.base,
|
|
50
|
+
"--fs-group-hover-background-color": colors.light,
|
|
51
|
+
"--fs-group-hover-color": darks.dark,
|
|
52
|
+
"--fs-group-disabled-color": darks.light,
|
|
53
|
+
"--fs-group-light": colors.light,
|
|
54
|
+
"--fs-group-base": colors.base,
|
|
55
|
+
"--fs-group-dark": colors.dark,
|
|
56
|
+
"--fs-tab-tag-background-color": colors.base,
|
|
57
|
+
"--fs-tab-tag-color": textColors.light
|
|
58
|
+
});
|
|
52
59
|
|
|
53
60
|
return {
|
|
54
61
|
tab,
|
|
62
|
+
color,
|
|
55
63
|
colors,
|
|
56
64
|
style,
|
|
57
65
|
emit
|
package/components/FSTag.vue
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
:style="style"
|
|
7
7
|
v-bind="$attrs"
|
|
8
8
|
>
|
|
9
|
-
<slot name="default">
|
|
9
|
+
<slot name="default" v-bind="{ color, colors }">
|
|
10
10
|
<FSSpan class="fs-tag-label">
|
|
11
11
|
{{ $props.label }}
|
|
12
12
|
</FSSpan>
|
|
13
13
|
</slot>
|
|
14
|
-
<slot name="button">
|
|
14
|
+
<slot name="button" v-bind="{ color, colors }">
|
|
15
15
|
<v-btn
|
|
16
|
-
v-if="editable"
|
|
16
|
+
v-if="$props.editable"
|
|
17
17
|
class="fs-tag-button"
|
|
18
18
|
:ripple="false"
|
|
19
19
|
@click="$emit('remove')"
|
|
@@ -48,10 +48,10 @@ export default defineComponent({
|
|
|
48
48
|
type: String,
|
|
49
49
|
required: true
|
|
50
50
|
},
|
|
51
|
-
|
|
52
|
-
type:
|
|
51
|
+
variant: {
|
|
52
|
+
type: String as PropType<"standard" | "full">,
|
|
53
53
|
required: false,
|
|
54
|
-
default:
|
|
54
|
+
default: "full"
|
|
55
55
|
},
|
|
56
56
|
color: {
|
|
57
57
|
type: String as PropType<ColorBase>,
|
|
@@ -66,21 +66,35 @@ export default defineComponent({
|
|
|
66
66
|
},
|
|
67
67
|
emits: ["remove"],
|
|
68
68
|
setup(props) {
|
|
69
|
-
const {
|
|
69
|
+
const { variant, color } = toRefs(props);
|
|
70
70
|
|
|
71
|
-
const
|
|
71
|
+
const textColors = useColors().getContrasts(color.value);
|
|
72
|
+
const colors = useColors().getColors(color.value);
|
|
72
73
|
|
|
73
|
-
const style = computed(() =>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
75
|
+
switch (variant.value) {
|
|
76
|
+
case "standard": return {
|
|
77
|
+
"--fs-tag-background-color": colors.light,
|
|
78
|
+
"--fs-tag-color": textColors.base,
|
|
79
|
+
"--fs-tag-hover-background-color": colors.base,
|
|
80
|
+
"--fs-tag-hover-color": textColors.light,
|
|
81
|
+
"--fs-tag-active-background-color": colors.dark,
|
|
82
|
+
"--fs-tag-active-color": textColors.light
|
|
83
|
+
};
|
|
84
|
+
case "full": return {
|
|
85
|
+
"--fs-tag-background-color": colors.base,
|
|
86
|
+
"--fs-tag-color": textColors.light,
|
|
87
|
+
"--fs-tag-hover-background-color": colors.base,
|
|
88
|
+
"--fs-tag-hover-color": textColors.light,
|
|
89
|
+
"--fs-tag-active-background-color": colors.dark,
|
|
90
|
+
"--fs-tag-active-color": textColors.light
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
});
|
|
81
94
|
|
|
82
95
|
return {
|
|
83
|
-
|
|
96
|
+
colors,
|
|
97
|
+
color,
|
|
84
98
|
style
|
|
85
99
|
};
|
|
86
100
|
}
|