@dative-gpi/foundation-shared-components 0.0.5 → 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 +16 -14
- package/components/FSButton.vue +79 -29
- 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
|
@@ -1,7 +1,7 @@
|
|
|
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>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script lang="ts">
|
|
17
|
-
import { defineComponent, PropType } from "vue";
|
|
17
|
+
import { defineComponent, PropType, Ref, ref } 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";
|
|
@@ -23,9 +23,9 @@ import FSSpan from "./FSSpan.vue";
|
|
|
23
23
|
import FSIcon from "./FSIcon.vue";
|
|
24
24
|
|
|
25
25
|
export interface FSBreadcrumbItem {
|
|
26
|
-
href: string | undefined
|
|
27
|
-
replace: boolean | undefined
|
|
28
|
-
to: string | undefined
|
|
26
|
+
href: string | undefined,
|
|
27
|
+
replace: boolean | undefined,
|
|
28
|
+
to: string | undefined,
|
|
29
29
|
exact: boolean | undefined,
|
|
30
30
|
title: string,
|
|
31
31
|
disabled: boolean
|
|
@@ -44,23 +44,25 @@ export default defineComponent({
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
setup() {
|
|
47
|
-
const
|
|
47
|
+
const darks = useColors().getColors(ColorBase.Dark);
|
|
48
48
|
|
|
49
|
-
const style = {
|
|
50
|
-
"--fs-breadcrumbs-
|
|
51
|
-
"--fs-breadcrumbs-
|
|
52
|
-
|
|
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
|
+
});
|
|
53
54
|
|
|
54
|
-
const
|
|
55
|
+
const classes = (item: FSBreadcrumbItem): string[] => {
|
|
56
|
+
const classes = ["fs-breadcrumbs-label"];
|
|
55
57
|
if (item.disabled) {
|
|
56
|
-
|
|
58
|
+
classes.push("fs-breadcrumbs-label--disabled");
|
|
57
59
|
}
|
|
58
|
-
return
|
|
60
|
+
return classes;
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
return {
|
|
62
64
|
style,
|
|
63
|
-
|
|
65
|
+
classes
|
|
64
66
|
};
|
|
65
67
|
}
|
|
66
68
|
})
|
package/components/FSButton.vue
CHANGED
|
@@ -4,20 +4,21 @@
|
|
|
4
4
|
:ripple="false"
|
|
5
5
|
:style="style"
|
|
6
6
|
:class="classes"
|
|
7
|
+
@click="onClick"
|
|
7
8
|
v-bind="$attrs"
|
|
8
9
|
>
|
|
9
|
-
<FSRow>
|
|
10
|
-
<slot name="prepend">
|
|
10
|
+
<FSRow :wrap="false">
|
|
11
|
+
<slot name="prepend" v-bind="{ color, colors }">
|
|
11
12
|
<FSIcon v-if="$props.prependIcon" size="m">
|
|
12
13
|
{{ $props.prependIcon }}
|
|
13
14
|
</FSIcon>
|
|
14
15
|
</slot>
|
|
15
|
-
<slot name="default">
|
|
16
|
-
<FSSpan v-if="$props.label" font="text-
|
|
16
|
+
<slot name="default" v-bind="{ color, colors }">
|
|
17
|
+
<FSSpan v-if="$props.label" font="text-body">
|
|
17
18
|
{{ $props.label }}
|
|
18
19
|
</FSSpan>
|
|
19
20
|
</slot>
|
|
20
|
-
<slot name="append">
|
|
21
|
+
<slot name="append" v-bind="{ color, colors }">
|
|
21
22
|
<FSIcon v-if="$props.appendIcon" size="m">
|
|
22
23
|
{{ $props.appendIcon }}
|
|
23
24
|
</FSIcon>
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
width="hug"
|
|
30
31
|
:style="style"
|
|
31
32
|
:class="classes"
|
|
33
|
+
@click="onClick"
|
|
32
34
|
v-bind="$attrs"
|
|
33
35
|
>
|
|
34
36
|
<FSIcon size="checkbox">
|
|
@@ -83,57 +85,105 @@ export default defineComponent({
|
|
|
83
85
|
color: {
|
|
84
86
|
type: String as PropType<ColorBase>,
|
|
85
87
|
required: false,
|
|
86
|
-
default: ColorBase.
|
|
88
|
+
default: ColorBase.Dark
|
|
89
|
+
},
|
|
90
|
+
editable: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
required: false,
|
|
93
|
+
default: true
|
|
87
94
|
}
|
|
88
95
|
},
|
|
89
|
-
|
|
90
|
-
|
|
96
|
+
emts: ["click"],
|
|
97
|
+
setup(props, { emit }) {
|
|
98
|
+
const { label, variant, color, editable } = toRefs(props);
|
|
91
99
|
|
|
92
|
-
const
|
|
100
|
+
const textColors = useColors().getContrasts(color.value);
|
|
101
|
+
const colors = useColors().getColors(color.value);
|
|
93
102
|
const slots = useSlots();
|
|
94
103
|
|
|
104
|
+
const lights = useColors().getColors(ColorBase.Light);
|
|
105
|
+
|
|
95
106
|
const isEmpty = computed(() => {
|
|
96
107
|
return !slots.default && !label.value;
|
|
97
108
|
});
|
|
98
109
|
|
|
99
|
-
const style = computed(() => {
|
|
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
|
+
}
|
|
100
125
|
switch (variant.value) {
|
|
101
126
|
case "standard": return {
|
|
102
|
-
"--fs-button-padding"
|
|
103
|
-
"--fs-button-
|
|
104
|
-
"--fs-button-
|
|
105
|
-
"--fs-button-
|
|
106
|
-
"--fs-button-
|
|
107
|
-
"--fs-button-
|
|
108
|
-
"--fs-button-
|
|
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
|
|
109
137
|
};
|
|
110
138
|
case "full": return {
|
|
111
139
|
"--fs-button-padding" : !isEmpty.value ? "0 16px" : "0",
|
|
112
|
-
"--fs-button-
|
|
113
|
-
"--fs-button-
|
|
114
|
-
"--fs-button-
|
|
115
|
-
"--fs-button-
|
|
116
|
-
"--fs-button-
|
|
117
|
-
"--fs-button-
|
|
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
|
|
118
149
|
|
|
119
150
|
};
|
|
120
151
|
case "icon": return {
|
|
121
|
-
"--fs-button-
|
|
122
|
-
"--fs-button-
|
|
152
|
+
"--fs-button-color": textColors.base,
|
|
153
|
+
"--fs-button-hover-color" : textColors.dark
|
|
123
154
|
};
|
|
124
155
|
}
|
|
125
156
|
});
|
|
126
157
|
|
|
127
|
-
const classes = computed(() => {
|
|
158
|
+
const classes = computed((): string[] => {
|
|
159
|
+
const classes = [];
|
|
160
|
+
if (!editable.value) {
|
|
161
|
+
classes.push("fs-button--disabled");
|
|
162
|
+
}
|
|
128
163
|
switch (variant.value) {
|
|
129
|
-
case "icon":
|
|
130
|
-
|
|
164
|
+
case "icon":
|
|
165
|
+
classes.push("fs-button-icon");
|
|
166
|
+
break;
|
|
167
|
+
default:
|
|
168
|
+
classes.push("fs-button");
|
|
169
|
+
break;
|
|
131
170
|
}
|
|
171
|
+
return classes;
|
|
132
172
|
});
|
|
133
173
|
|
|
174
|
+
const onClick = () => {
|
|
175
|
+
if (!editable.value) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
emit("click");
|
|
179
|
+
}
|
|
180
|
+
|
|
134
181
|
return {
|
|
182
|
+
colors,
|
|
183
|
+
color,
|
|
135
184
|
style,
|
|
136
|
-
classes
|
|
185
|
+
classes,
|
|
186
|
+
onClick
|
|
137
187
|
};
|
|
138
188
|
}
|
|
139
189
|
});
|
|
@@ -84,20 +84,31 @@ export default defineComponent({
|
|
|
84
84
|
setup(props, { emit }) {
|
|
85
85
|
const { value, color, editable } = toRefs(props);
|
|
86
86
|
|
|
87
|
-
const colors = useColors().
|
|
88
|
-
const dark = useColors().getVariants(ColorBase.Dark);
|
|
87
|
+
const colors = useColors().getColors(color.value);
|
|
89
88
|
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
"--fs-checkbox-base-color": editable.value ? value.value ? colors.base : dark.base : dark.light,
|
|
93
|
-
"--fs-checkbox-base-text" : editable.value ? dark.base : dark.light
|
|
94
|
-
}));
|
|
89
|
+
const lights = useColors().getColors(ColorBase.Light);
|
|
90
|
+
const darks = useColors().getColors(ColorBase.Dark);
|
|
95
91
|
|
|
96
|
-
const
|
|
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
|
+
});
|
|
106
|
+
|
|
107
|
+
const icon = computed((): string => value.value ? "mdi-checkbox-marked" : "mdi-checkbox-blank-outline");
|
|
97
108
|
|
|
98
|
-
const font = computed(() => value.value ? "text-button" : "text-body");
|
|
109
|
+
const font = computed((): string => value.value ? "text-button" : "text-body");
|
|
99
110
|
|
|
100
|
-
const onToggle = () => {
|
|
111
|
+
const onToggle = (): void => {
|
|
101
112
|
if (!editable.value) {
|
|
102
113
|
return;
|
|
103
114
|
}
|
package/components/FSCol.vue
CHANGED
|
@@ -44,57 +44,57 @@ export default defineComponent({
|
|
|
44
44
|
"--fs-col-height": height.value
|
|
45
45
|
}));
|
|
46
46
|
|
|
47
|
-
const classes = computed((): string => {
|
|
48
|
-
|
|
47
|
+
const classes = computed((): string[] => {
|
|
48
|
+
const classes = ["fs-col"];
|
|
49
49
|
switch (width.value) {
|
|
50
50
|
case "hug":
|
|
51
|
-
classes
|
|
51
|
+
classes.push("fs-col-width-hug");
|
|
52
52
|
break;
|
|
53
53
|
case "fill":
|
|
54
|
-
classes
|
|
54
|
+
classes.push("fs-col-width-fill");
|
|
55
55
|
break;
|
|
56
56
|
default:
|
|
57
|
-
classes
|
|
57
|
+
classes.push("fs-col-width-fixed");
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
switch (height.value) {
|
|
61
61
|
case "hug":
|
|
62
|
-
classes
|
|
62
|
+
classes.push("fs-col-height-hug");
|
|
63
63
|
break;
|
|
64
64
|
case "fill":
|
|
65
|
-
classes
|
|
65
|
+
classes.push("fs-col-height-fill");
|
|
66
66
|
break;
|
|
67
67
|
default:
|
|
68
|
-
classes
|
|
68
|
+
classes.push("fs-col-height-fixed");
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
71
71
|
switch (align.value) {
|
|
72
72
|
case "top-left":
|
|
73
|
-
classes
|
|
73
|
+
classes.push("fs-col-top-left");
|
|
74
74
|
break;
|
|
75
75
|
case "top-center":
|
|
76
|
-
classes
|
|
76
|
+
classes.push("fs-col-top-center");
|
|
77
77
|
break;
|
|
78
78
|
case "top-right":
|
|
79
|
-
classes
|
|
79
|
+
classes.push("fs-col-top-right");
|
|
80
80
|
break;
|
|
81
81
|
case "center-left":
|
|
82
|
-
classes
|
|
82
|
+
classes.push("fs-col-center-left");
|
|
83
83
|
break;
|
|
84
84
|
case "center-center":
|
|
85
|
-
classes
|
|
85
|
+
classes.push("fs-col-center-center");
|
|
86
86
|
break;
|
|
87
87
|
case "center-right":
|
|
88
|
-
classes
|
|
88
|
+
classes.push("fs-col-center-right");
|
|
89
89
|
break;
|
|
90
90
|
case "bottom-left":
|
|
91
|
-
classes
|
|
91
|
+
classes.push("fs-col-bottom-left");
|
|
92
92
|
break;
|
|
93
93
|
case "bottom-center":
|
|
94
|
-
classes
|
|
94
|
+
classes.push("fs-col-bottom-center");
|
|
95
95
|
break;
|
|
96
96
|
case "bottom-right":
|
|
97
|
-
classes
|
|
97
|
+
classes.push("fs-col-bottom-right");
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
100
|
return classes;
|
|
@@ -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
|
@@ -14,7 +14,7 @@
|
|
|
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";
|
|
@@ -41,15 +41,15 @@ export default defineComponent({
|
|
|
41
41
|
setup(props) {
|
|
42
42
|
const { maskHeight, color } = toRefs(props);
|
|
43
43
|
|
|
44
|
-
const colors = useColors().
|
|
44
|
+
const colors = useColors().getColors(color.value);
|
|
45
45
|
|
|
46
|
-
const style = ref({
|
|
46
|
+
const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
|
|
47
47
|
"--fs-fade-out-mask-color": colors.base,
|
|
48
48
|
"--fs-fade-out-top-mask-height": "0px",
|
|
49
49
|
"--fs-fade-out-bottom-mask-height": `${maskHeight.value}px`
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
const onScroll = ({ target }) => {
|
|
52
|
+
const onScroll = ({ target }): void => {
|
|
53
53
|
if (target.scrollHeight - target.scrollTop - target.clientHeight < 1) {
|
|
54
54
|
style.value["--fs-fade-out-bottom-mask-height"] = "0px";
|
|
55
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
|
});
|
|
@@ -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
|
};
|