@dative-gpi/foundation-shared-components 0.0.4 → 0.0.6
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 +23 -18
- package/components/FSButton.vue +138 -30
- package/components/FSCheckbox.vue +41 -26
- package/components/FSCol.vue +56 -16
- package/components/FSColor.vue +80 -0
- package/components/FSFadeOut.vue +11 -6
- package/components/FSIcon.vue +5 -3
- package/components/FSNumberField.vue +65 -0
- package/components/FSPasswordField.vue +119 -0
- package/components/FSRadio.vue +40 -26
- package/components/FSRadioGroup.vue +6 -8
- package/components/FSRow.vue +57 -17
- package/components/FSSearchField.vue +122 -0
- package/components/FSSlideGroup.vue +17 -13
- package/components/FSSpan.vue +28 -4
- package/components/FSSwitch.vue +45 -28
- package/components/FSTab.vue +36 -22
- package/components/FSTabs.vue +21 -12
- package/components/FSTag.vue +48 -31
- package/components/FSTagField.vue +152 -0
- package/components/FSTagGroup.vue +60 -0
- package/components/FSText.vue +78 -0
- package/components/FSTextField.vue +122 -13
- package/components/FSWrapGroup.vue +16 -13
- package/composables/useColors.ts +31 -39
- package/models/FSButtons.ts +111 -0
- package/models/FSTags.ts +8 -0
- package/models/FSTextFields.ts +17 -0
- package/package.json +5 -4
- package/styles/components/fs_breadcrumbs.scss +29 -11
- package/styles/components/fs_button.scss +36 -9
- package/styles/components/fs_checkbox.scss +3 -4
- package/styles/components/fs_col.scss +87 -2
- package/styles/components/fs_color.scss +5 -0
- package/styles/components/fs_icon.scss +4 -4
- package/styles/components/fs_password_field.scss +10 -0
- package/styles/components/fs_radio.scss +3 -4
- package/styles/components/fs_row.scss +86 -1
- package/styles/components/fs_span.scss +8 -3
- package/styles/components/fs_switch.scss +4 -4
- package/styles/components/fs_tabs.scss +8 -9
- 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 +46 -17
- package/styles/components/index.scss +18 -14
- package/styles/globals/fixes.scss +5 -0
- package/styles/globals/index.scss +4 -1
- package/styles/globals/overrides.scss +26 -4
- package/styles/globals/text_fonts.scss +48 -24
- package/themes/default.ts +6 -6
- package/defaults/FSButtons.ts +0 -63
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-breadcrumbs v-bind="$attrs" :style="style" :items="$props.items">
|
|
3
3
|
<template #title="{ item }">
|
|
4
|
-
<FSSpan :class="
|
|
4
|
+
<FSSpan :class="classes(item)">
|
|
5
5
|
{{ item.title }}
|
|
6
6
|
</FSSpan>
|
|
7
7
|
</template>
|
|
8
|
+
<template #divider>
|
|
9
|
+
<FSIcon class="fs-breadcrumbs-divider" size="m">
|
|
10
|
+
mdi-chevron-right
|
|
11
|
+
</FSIcon>
|
|
12
|
+
</template>
|
|
8
13
|
</v-breadcrumbs>
|
|
9
14
|
</template>
|
|
10
15
|
|
|
11
16
|
<script lang="ts">
|
|
12
|
-
import { defineComponent, PropType } from "vue";
|
|
17
|
+
import { defineComponent, PropType, Ref, ref } from "vue";
|
|
13
18
|
|
|
14
19
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
20
|
+
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
15
21
|
|
|
16
22
|
import FSSpan from "./FSSpan.vue";
|
|
17
23
|
import FSIcon from "./FSIcon.vue";
|
|
18
|
-
import FSRow from "./FSRow.vue";
|
|
19
24
|
|
|
20
25
|
export interface FSBreadcrumbItem {
|
|
21
|
-
href: string | undefined
|
|
22
|
-
replace: boolean | undefined
|
|
23
|
-
to: string | undefined
|
|
26
|
+
href: string | undefined,
|
|
27
|
+
replace: boolean | undefined,
|
|
28
|
+
to: string | undefined,
|
|
24
29
|
exact: boolean | undefined,
|
|
25
30
|
title: string,
|
|
26
31
|
disabled: boolean
|
|
@@ -30,8 +35,7 @@ export default defineComponent({
|
|
|
30
35
|
name: "FSBreadcrumbs",
|
|
31
36
|
components: {
|
|
32
37
|
FSSpan,
|
|
33
|
-
FSIcon
|
|
34
|
-
FSRow
|
|
38
|
+
FSIcon
|
|
35
39
|
},
|
|
36
40
|
props: {
|
|
37
41
|
items: {
|
|
@@ -40,24 +44,25 @@ export default defineComponent({
|
|
|
40
44
|
}
|
|
41
45
|
},
|
|
42
46
|
setup() {
|
|
43
|
-
const
|
|
47
|
+
const darks = useColors().getColors(ColorBase.Dark);
|
|
44
48
|
|
|
45
|
-
const style = {
|
|
46
|
-
"--fs-breadcrumbs-
|
|
47
|
-
"--fs-breadcrumbs-
|
|
48
|
-
"--fs-breadcrumbs-
|
|
49
|
-
};
|
|
49
|
+
const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
|
|
50
|
+
"--fs-breadcrumbs-color": darks.dark,
|
|
51
|
+
"--fs-breadcrumbs-active-color": darks.base,
|
|
52
|
+
"--fs-breadcrumbs-disabled-color": darks.light
|
|
53
|
+
});
|
|
50
54
|
|
|
51
|
-
const
|
|
55
|
+
const classes = (item: FSBreadcrumbItem): string[] => {
|
|
56
|
+
const classes = ["fs-breadcrumbs-label"];
|
|
52
57
|
if (item.disabled) {
|
|
53
|
-
|
|
58
|
+
classes.push("fs-breadcrumbs-label--disabled");
|
|
54
59
|
}
|
|
55
|
-
return
|
|
60
|
+
return classes;
|
|
56
61
|
};
|
|
57
62
|
|
|
58
63
|
return {
|
|
59
64
|
style,
|
|
60
|
-
|
|
65
|
+
classes
|
|
61
66
|
};
|
|
62
67
|
}
|
|
63
68
|
})
|
package/components/FSButton.vue
CHANGED
|
@@ -1,25 +1,46 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-btn
|
|
3
|
-
|
|
3
|
+
v-if="!['icon'].includes($props.variant)"
|
|
4
4
|
:ripple="false"
|
|
5
5
|
:style="style"
|
|
6
|
+
:class="classes"
|
|
7
|
+
@click="onClick"
|
|
6
8
|
v-bind="$attrs"
|
|
7
9
|
>
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
<FSIcon v-if="
|
|
11
|
-
{{
|
|
10
|
+
<FSRow :wrap="false">
|
|
11
|
+
<slot name="prepend" v-bind="{ color, colors }">
|
|
12
|
+
<FSIcon v-if="$props.prependIcon" size="m">
|
|
13
|
+
{{ $props.prependIcon }}
|
|
12
14
|
</FSIcon>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
</slot>
|
|
16
|
+
<slot name="default" v-bind="{ color, colors }">
|
|
17
|
+
<FSSpan v-if="$props.label" font="text-body">
|
|
18
|
+
{{ $props.label }}
|
|
15
19
|
</FSSpan>
|
|
16
|
-
</
|
|
17
|
-
|
|
20
|
+
</slot>
|
|
21
|
+
<slot name="append" v-bind="{ color, colors }">
|
|
22
|
+
<FSIcon v-if="$props.appendIcon" size="m">
|
|
23
|
+
{{ $props.appendIcon }}
|
|
24
|
+
</FSIcon>
|
|
25
|
+
</slot>
|
|
26
|
+
</FSRow>
|
|
18
27
|
</v-btn>
|
|
28
|
+
<FSRow
|
|
29
|
+
v-else-if="$props.icon"
|
|
30
|
+
width="hug"
|
|
31
|
+
:style="style"
|
|
32
|
+
:class="classes"
|
|
33
|
+
@click="onClick"
|
|
34
|
+
v-bind="$attrs"
|
|
35
|
+
>
|
|
36
|
+
<FSIcon size="checkbox">
|
|
37
|
+
{{ $props.icon }}
|
|
38
|
+
</FSIcon>
|
|
39
|
+
</FSRow>
|
|
19
40
|
</template>
|
|
20
41
|
|
|
21
42
|
<script lang="ts">
|
|
22
|
-
import { computed, defineComponent, PropType, toRefs } from "vue";
|
|
43
|
+
import { computed, defineComponent, PropType, toRefs, useSlots } from "vue";
|
|
23
44
|
|
|
24
45
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
25
46
|
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
@@ -36,7 +57,7 @@ export default defineComponent({
|
|
|
36
57
|
FSRow
|
|
37
58
|
},
|
|
38
59
|
props: {
|
|
39
|
-
|
|
60
|
+
prependIcon: {
|
|
40
61
|
type: String,
|
|
41
62
|
required: false,
|
|
42
63
|
default: null
|
|
@@ -46,36 +67,123 @@ export default defineComponent({
|
|
|
46
67
|
required: false,
|
|
47
68
|
default: null
|
|
48
69
|
},
|
|
49
|
-
|
|
50
|
-
type:
|
|
70
|
+
appendIcon: {
|
|
71
|
+
type: String,
|
|
72
|
+
required: false,
|
|
73
|
+
default: null
|
|
74
|
+
},
|
|
75
|
+
icon: {
|
|
76
|
+
type: String,
|
|
51
77
|
required: false,
|
|
52
|
-
default:
|
|
78
|
+
default: null
|
|
79
|
+
},
|
|
80
|
+
variant: {
|
|
81
|
+
type: String as PropType<"standard" | "full" | "icon">,
|
|
82
|
+
required: false,
|
|
83
|
+
default: "standard"
|
|
53
84
|
},
|
|
54
85
|
color: {
|
|
55
86
|
type: String as PropType<ColorBase>,
|
|
56
87
|
required: false,
|
|
57
|
-
default: ColorBase.
|
|
88
|
+
default: ColorBase.Dark
|
|
89
|
+
},
|
|
90
|
+
editable: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
required: false,
|
|
93
|
+
default: true
|
|
58
94
|
}
|
|
59
95
|
},
|
|
60
|
-
|
|
61
|
-
|
|
96
|
+
emts: ["click"],
|
|
97
|
+
setup(props, { emit }) {
|
|
98
|
+
const { label, variant, color, editable } = toRefs(props);
|
|
62
99
|
|
|
63
|
-
const
|
|
100
|
+
const textColors = useColors().getContrasts(color.value);
|
|
101
|
+
const colors = useColors().getColors(color.value);
|
|
102
|
+
const slots = useSlots();
|
|
64
103
|
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
104
|
+
const lights = useColors().getColors(ColorBase.Light);
|
|
105
|
+
|
|
106
|
+
const isEmpty = computed(() => {
|
|
107
|
+
return !slots.default && !label.value;
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
111
|
+
if (!editable.value) {
|
|
112
|
+
switch (variant.value) {
|
|
113
|
+
case "standard":
|
|
114
|
+
case "full": return {
|
|
115
|
+
"--fs-button-padding": !isEmpty.value ? "0 16px" : "0",
|
|
116
|
+
"--fs-button-background-color": lights.base,
|
|
117
|
+
"--fs-button-border-color": lights.dark,
|
|
118
|
+
"--fs-button-color": lights.dark
|
|
119
|
+
}
|
|
120
|
+
case "icon": return {
|
|
121
|
+
"--fs-button-color": lights.dark
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
switch (variant.value) {
|
|
126
|
+
case "standard": return {
|
|
127
|
+
"--fs-button-padding": !isEmpty.value ? "0 16px" : "0",
|
|
128
|
+
"--fs-button-background-color": colors.light,
|
|
129
|
+
"--fs-button-border-color": colors.base,
|
|
130
|
+
"--fs-button-color": textColors.base,
|
|
131
|
+
"--fs-button-hover-background-color": colors.base,
|
|
132
|
+
"--fs-button-hover-border-color": colors.base,
|
|
133
|
+
"--fs-button-hover-color": textColors.light,
|
|
134
|
+
"--fs-button-active-background-color": colors.dark,
|
|
135
|
+
"--fs-button-active-border-color": colors.dark,
|
|
136
|
+
"--fs-button-active-color": textColors.light
|
|
137
|
+
};
|
|
138
|
+
case "full": return {
|
|
139
|
+
"--fs-button-padding" : !isEmpty.value ? "0 16px" : "0",
|
|
140
|
+
"--fs-button-background-color": colors.base,
|
|
141
|
+
"--fs-button-border-color": colors.base,
|
|
142
|
+
"--fs-button-color": textColors.light,
|
|
143
|
+
"--fs-button-hover-background-color": colors.base,
|
|
144
|
+
"--fs-button-hover-border-color": colors.base,
|
|
145
|
+
"--fs-button-hover-color": textColors.light,
|
|
146
|
+
"--fs-button-active-background-color": colors.dark,
|
|
147
|
+
"--fs-button-active-border-color": colors.dark,
|
|
148
|
+
"--fs-button-active-color": textColors.light
|
|
149
|
+
|
|
150
|
+
};
|
|
151
|
+
case "icon": return {
|
|
152
|
+
"--fs-button-color": textColors.base,
|
|
153
|
+
"--fs-button-hover-color" : textColors.dark
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const classes = computed((): string[] => {
|
|
159
|
+
const classes = [];
|
|
160
|
+
if (!editable.value) {
|
|
161
|
+
classes.push("fs-button--disabled");
|
|
162
|
+
}
|
|
163
|
+
switch (variant.value) {
|
|
164
|
+
case "icon":
|
|
165
|
+
classes.push("fs-button-icon");
|
|
166
|
+
break;
|
|
167
|
+
default:
|
|
168
|
+
classes.push("fs-button");
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
return classes;
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
const onClick = () => {
|
|
175
|
+
if (!editable.value) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
emit("click");
|
|
179
|
+
}
|
|
74
180
|
|
|
75
181
|
return {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
style
|
|
182
|
+
colors,
|
|
183
|
+
color,
|
|
184
|
+
style,
|
|
185
|
+
classes,
|
|
186
|
+
onClick
|
|
79
187
|
};
|
|
80
188
|
}
|
|
81
189
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FSCol width="hug"
|
|
3
|
-
<FSRow width="hug"
|
|
2
|
+
<FSCol width="hug">
|
|
3
|
+
<FSRow width="hug" align="center-left">
|
|
4
4
|
<FSIcon
|
|
5
5
|
class="fs-checkbox"
|
|
6
6
|
size="checkbox"
|
|
@@ -9,24 +9,28 @@
|
|
|
9
9
|
>
|
|
10
10
|
{{ icon }}
|
|
11
11
|
</FSIcon>
|
|
12
|
+
<slot name="default">
|
|
13
|
+
<FSSpan
|
|
14
|
+
v-if="$props.label"
|
|
15
|
+
class="fs-checkbox-label"
|
|
16
|
+
:style="style"
|
|
17
|
+
:font="font"
|
|
18
|
+
@click="onToggle"
|
|
19
|
+
>
|
|
20
|
+
{{ $props.label }}
|
|
21
|
+
</FSSpan>
|
|
22
|
+
</slot>
|
|
23
|
+
</FSRow>
|
|
24
|
+
<slot name="description">
|
|
12
25
|
<FSSpan
|
|
13
|
-
v-if="$props.
|
|
14
|
-
class="fs-checkbox-
|
|
26
|
+
v-if="$props.description"
|
|
27
|
+
class="fs-checkbox-description"
|
|
28
|
+
font="text-underline"
|
|
15
29
|
:style="style"
|
|
16
|
-
:font="font"
|
|
17
|
-
@click="onToggle"
|
|
18
30
|
>
|
|
19
|
-
{{ $props.
|
|
31
|
+
{{ $props.description }}
|
|
20
32
|
</FSSpan>
|
|
21
|
-
</
|
|
22
|
-
<FSSpan
|
|
23
|
-
v-if="$props.description"
|
|
24
|
-
class="fs-checkbox-description"
|
|
25
|
-
font="text-overline"
|
|
26
|
-
:style="style"
|
|
27
|
-
>
|
|
28
|
-
{{ $props.description }}
|
|
29
|
-
</FSSpan>
|
|
33
|
+
</slot>
|
|
30
34
|
</FSCol>
|
|
31
35
|
</template>
|
|
32
36
|
|
|
@@ -80,20 +84,31 @@ export default defineComponent({
|
|
|
80
84
|
setup(props, { emit }) {
|
|
81
85
|
const { value, color, editable } = toRefs(props);
|
|
82
86
|
|
|
83
|
-
const colors = useColors().
|
|
84
|
-
|
|
87
|
+
const colors = useColors().getColors(color.value);
|
|
88
|
+
|
|
89
|
+
const lights = useColors().getColors(ColorBase.Light);
|
|
90
|
+
const darks = useColors().getColors(ColorBase.Dark);
|
|
85
91
|
|
|
86
|
-
const style = computed(() =>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
93
|
+
if (!editable.value) {
|
|
94
|
+
return {
|
|
95
|
+
"--fs-checkbox-cursor": "default",
|
|
96
|
+
"--fs-checkbox-checkbox-color": lights.dark,
|
|
97
|
+
"--fs-checkbox-color": lights.dark
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
"--fs-checkbox-cursor": "pointer",
|
|
102
|
+
"--fs-checkbox-checkbox-color": value.value ? colors.base : darks.base,
|
|
103
|
+
"--fs-checkbox-color": darks.base
|
|
104
|
+
}
|
|
105
|
+
});
|
|
91
106
|
|
|
92
|
-
const icon = computed(() => value.value ? "mdi-checkbox-marked" : "mdi-checkbox-blank-outline");
|
|
107
|
+
const icon = computed((): string => value.value ? "mdi-checkbox-marked" : "mdi-checkbox-blank-outline");
|
|
93
108
|
|
|
94
|
-
const font = computed(() => value.value ? "text-button" : "text-body");
|
|
109
|
+
const font = computed((): string => value.value ? "text-button" : "text-body");
|
|
95
110
|
|
|
96
|
-
const onToggle = () => {
|
|
111
|
+
const onToggle = (): void => {
|
|
97
112
|
if (!editable.value) {
|
|
98
113
|
return;
|
|
99
114
|
}
|
package/components/FSCol.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="fs-col"
|
|
4
3
|
:style="style"
|
|
4
|
+
:class="classes"
|
|
5
5
|
v-bind="$attrs"
|
|
6
6
|
>
|
|
7
7
|
<slot />
|
|
@@ -22,7 +22,12 @@ export default defineComponent({
|
|
|
22
22
|
height: {
|
|
23
23
|
type: String as PropType<"hug" | "fill" | string>,
|
|
24
24
|
required: false,
|
|
25
|
-
default: "
|
|
25
|
+
default: "hug"
|
|
26
|
+
},
|
|
27
|
+
align: {
|
|
28
|
+
type: String as PropType<"top-left" | "top-center" | "top-right" | "center-left" | "center-center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right">,
|
|
29
|
+
required: false,
|
|
30
|
+
default: "top-left"
|
|
26
31
|
},
|
|
27
32
|
gap: {
|
|
28
33
|
type: Number,
|
|
@@ -31,38 +36,73 @@ export default defineComponent({
|
|
|
31
36
|
}
|
|
32
37
|
},
|
|
33
38
|
setup(props) {
|
|
34
|
-
const { width, height, gap } = toRefs(props);
|
|
39
|
+
const { width, height, align, gap } = toRefs(props);
|
|
40
|
+
|
|
41
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => ({
|
|
42
|
+
"--fs-col-gap": `${gap.value}px`,
|
|
43
|
+
"--fs-col-width": width.value,
|
|
44
|
+
"--fs-col-height": height.value
|
|
45
|
+
}));
|
|
35
46
|
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
"--fs-col-gap": `${gap.value}px`
|
|
39
|
-
};
|
|
47
|
+
const classes = computed((): string[] => {
|
|
48
|
+
const classes = ["fs-col"];
|
|
40
49
|
switch (width.value) {
|
|
41
50
|
case "hug":
|
|
51
|
+
classes.push("fs-col-width-hug");
|
|
42
52
|
break;
|
|
43
53
|
case "fill":
|
|
44
|
-
|
|
54
|
+
classes.push("fs-col-width-fill");
|
|
45
55
|
break;
|
|
46
|
-
default:
|
|
47
|
-
|
|
56
|
+
default:
|
|
57
|
+
classes.push("fs-col-width-fixed");
|
|
48
58
|
break;
|
|
49
59
|
}
|
|
50
60
|
switch (height.value) {
|
|
51
61
|
case "hug":
|
|
62
|
+
classes.push("fs-col-height-hug");
|
|
52
63
|
break;
|
|
53
64
|
case "fill":
|
|
54
|
-
|
|
65
|
+
classes.push("fs-col-height-fill");
|
|
66
|
+
break;
|
|
67
|
+
default:
|
|
68
|
+
classes.push("fs-col-height-fixed");
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
switch (align.value) {
|
|
72
|
+
case "top-left":
|
|
73
|
+
classes.push("fs-col-top-left");
|
|
74
|
+
break;
|
|
75
|
+
case "top-center":
|
|
76
|
+
classes.push("fs-col-top-center");
|
|
77
|
+
break;
|
|
78
|
+
case "top-right":
|
|
79
|
+
classes.push("fs-col-top-right");
|
|
80
|
+
break;
|
|
81
|
+
case "center-left":
|
|
82
|
+
classes.push("fs-col-center-left");
|
|
83
|
+
break;
|
|
84
|
+
case "center-center":
|
|
85
|
+
classes.push("fs-col-center-center");
|
|
86
|
+
break;
|
|
87
|
+
case "center-right":
|
|
88
|
+
classes.push("fs-col-center-right");
|
|
89
|
+
break;
|
|
90
|
+
case "bottom-left":
|
|
91
|
+
classes.push("fs-col-bottom-left");
|
|
92
|
+
break;
|
|
93
|
+
case "bottom-center":
|
|
94
|
+
classes.push("fs-col-bottom-center");
|
|
55
95
|
break;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
style.flexShrink = "0";
|
|
96
|
+
case "bottom-right":
|
|
97
|
+
classes.push("fs-col-bottom-right");
|
|
59
98
|
break;
|
|
60
99
|
}
|
|
61
|
-
return
|
|
100
|
+
return classes;
|
|
62
101
|
});
|
|
63
102
|
|
|
64
103
|
return {
|
|
65
|
-
style
|
|
104
|
+
style,
|
|
105
|
+
classes
|
|
66
106
|
};
|
|
67
107
|
}
|
|
68
108
|
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
class="fs-color"
|
|
4
|
+
:width="$props.width"
|
|
5
|
+
:height="$props.height"
|
|
6
|
+
:align="$props.align"
|
|
7
|
+
:wrap="$props.wrap"
|
|
8
|
+
:gap="$props.gap"
|
|
9
|
+
:style="style"
|
|
10
|
+
>
|
|
11
|
+
<slot name="default" v-bind="{ color, colors }" />
|
|
12
|
+
</FSRow>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
import { defineComponent, PropType, ref, Ref, toRefs } from "vue";
|
|
17
|
+
|
|
18
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
19
|
+
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
20
|
+
|
|
21
|
+
import FSRow from "./FSRow.vue";
|
|
22
|
+
|
|
23
|
+
export default defineComponent({
|
|
24
|
+
name: "FSColor",
|
|
25
|
+
components: {
|
|
26
|
+
FSRow
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
width: {
|
|
30
|
+
type: String as PropType<"hug" | "fill" | string>,
|
|
31
|
+
required: false,
|
|
32
|
+
default: "hug"
|
|
33
|
+
},
|
|
34
|
+
height: {
|
|
35
|
+
type: String as PropType<"hug" | "fill" | string>,
|
|
36
|
+
required: false,
|
|
37
|
+
default: "hug"
|
|
38
|
+
},
|
|
39
|
+
align: {
|
|
40
|
+
type: String as PropType<"top-left" | "top-center" | "top-right" | "center-left" | "center-center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right">,
|
|
41
|
+
required: false,
|
|
42
|
+
default: "center-left"
|
|
43
|
+
},
|
|
44
|
+
wrap: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
required: false,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
gap: {
|
|
50
|
+
type: Number,
|
|
51
|
+
required: false,
|
|
52
|
+
default: 8
|
|
53
|
+
},
|
|
54
|
+
color: {
|
|
55
|
+
type: String as PropType<ColorBase | String>,
|
|
56
|
+
required: false,
|
|
57
|
+
default: ColorBase.Primary
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
setup(props) {
|
|
61
|
+
const { color } = toRefs(props);
|
|
62
|
+
|
|
63
|
+
const colors = useColors().getColors(color.value);
|
|
64
|
+
|
|
65
|
+
const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
|
|
66
|
+
"--fs-color-background-color": colors.light,
|
|
67
|
+
"--fs-color-color": colors.base,
|
|
68
|
+
"--fs-color-light": colors.light,
|
|
69
|
+
"--fs-color-base": colors.base,
|
|
70
|
+
"--fs-color-dark": colors.dark
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
colors,
|
|
75
|
+
color,
|
|
76
|
+
style
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
</script>
|
package/components/FSFadeOut.vue
CHANGED
|
@@ -6,21 +6,26 @@
|
|
|
6
6
|
@scroll="onScroll"
|
|
7
7
|
>
|
|
8
8
|
<div class="fs-fade-out-top" />
|
|
9
|
-
<
|
|
9
|
+
<FSCol height="fill">
|
|
10
10
|
<slot />
|
|
11
|
-
</
|
|
11
|
+
</FSCol>
|
|
12
12
|
<div class="fs-fade-out-bottom" />
|
|
13
13
|
</div>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script lang="ts">
|
|
17
|
-
import { defineComponent, PropType, ref, 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";
|
|
21
21
|
|
|
22
|
+
import FSCol from "./FSCol.vue";
|
|
23
|
+
|
|
22
24
|
export default defineComponent({
|
|
23
25
|
name: "FSFadeOut",
|
|
26
|
+
components: {
|
|
27
|
+
FSCol
|
|
28
|
+
},
|
|
24
29
|
props: {
|
|
25
30
|
maskHeight: {
|
|
26
31
|
type: Number,
|
|
@@ -36,15 +41,15 @@ export default defineComponent({
|
|
|
36
41
|
setup(props) {
|
|
37
42
|
const { maskHeight, color } = toRefs(props);
|
|
38
43
|
|
|
39
|
-
const colors = useColors().
|
|
44
|
+
const colors = useColors().getColors(color.value);
|
|
40
45
|
|
|
41
|
-
const style = ref({
|
|
46
|
+
const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
|
|
42
47
|
"--fs-fade-out-mask-color": colors.base,
|
|
43
48
|
"--fs-fade-out-top-mask-height": "0px",
|
|
44
49
|
"--fs-fade-out-bottom-mask-height": `${maskHeight.value}px`
|
|
45
50
|
});
|
|
46
51
|
|
|
47
|
-
const onScroll = ({ target }) => {
|
|
52
|
+
const onScroll = ({ target }): void => {
|
|
48
53
|
if (target.scrollHeight - target.scrollTop - target.clientHeight < 1) {
|
|
49
54
|
style.value["--fs-fade-out-bottom-mask-height"] = "0px";
|
|
50
55
|
} else {
|
package/components/FSIcon.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-icon
|
|
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, toRefs } from "vue";
|
|
11
|
+
import { computed, defineComponent, PropType, toRefs } from "vue";
|
|
12
12
|
|
|
13
13
|
export default defineComponent({
|
|
14
14
|
name: "FSIcon",
|
|
@@ -22,8 +22,10 @@ export default defineComponent({
|
|
|
22
22
|
setup(props) {
|
|
23
23
|
const { size } = toRefs(props);
|
|
24
24
|
|
|
25
|
+
const classes = computed((): string[] => ["fs-icon", `fs-icon-${size.value}`]);
|
|
26
|
+
|
|
25
27
|
return {
|
|
26
|
-
|
|
28
|
+
classes
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
});
|