@dative-gpi/foundation-shared-components 0.0.8 → 0.0.10
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/{models/FSButtons.ts → aliases/FSButton.ts} +24 -21
- package/aliases/index.ts +1 -0
- package/components/FSAutocompleteField.vue +207 -0
- package/components/FSBadge.vue +38 -0
- package/components/FSBreadcrumbs.vue +49 -55
- package/components/FSButton.vue +116 -101
- package/components/FSCalendar.vue +52 -39
- package/components/FSCalendarTwin.vue +120 -102
- package/components/FSCard.vue +35 -21
- package/components/FSCarousel.vue +63 -0
- package/components/FSCheckbox.vue +111 -103
- package/components/FSChip.vue +140 -0
- package/components/FSClock.vue +149 -15
- package/components/FSCol.vue +104 -98
- package/components/FSColor.vue +61 -64
- package/components/FSColorIcon.vue +67 -0
- package/components/FSContainer.vue +64 -0
- package/components/FSDateField.vue +211 -0
- package/components/FSDateRangeField.vue +225 -0
- package/components/FSDateTimeField.vue +257 -0
- package/components/FSDateTimeRangeField.vue +286 -0
- package/components/FSDialog.vue +103 -0
- package/components/FSDivider.vue +39 -0
- package/components/FSFadeOut.vue +49 -59
- package/components/FSFileButton.vue +245 -0
- package/components/FSHeaderButton.vue +17 -0
- package/components/FSIcon.vue +23 -23
- package/components/FSIconField.vue +232 -0
- package/components/FSImage.vue +142 -0
- package/components/FSLoadTile.vue +93 -0
- package/components/FSNumberField.vue +51 -53
- package/components/FSPasswordField.vue +99 -101
- package/components/FSRadio.vue +107 -109
- package/components/FSRadioGroup.vue +55 -57
- package/components/FSRemoveDialog.vue +123 -0
- package/components/FSRichTextField.vue +26 -33
- package/components/FSRow.vue +110 -104
- package/components/FSSearchField.vue +35 -27
- package/components/FSSelectField.vue +188 -0
- package/components/FSSlideGroup.vue +45 -49
- package/components/FSSlider.vue +31 -33
- package/components/FSSpan.vue +53 -37
- package/components/FSSubmitDialog.vue +165 -0
- package/components/FSSwitch.vue +110 -109
- package/components/FSTab.vue +61 -61
- package/components/FSTabs.vue +53 -55
- package/components/FSTag.vue +88 -84
- package/components/FSTagField.vue +32 -36
- package/components/FSTagGroup.vue +38 -45
- package/components/FSText.vue +74 -64
- package/components/FSTextArea.vue +187 -185
- package/components/FSTextField.vue +18 -20
- package/components/FSTile.vue +90 -0
- package/components/FSToggleSet.vue +282 -0
- package/components/FSTooltip.vue +21 -0
- package/components/FSWindow.vue +26 -16
- package/components/FSWrapGroup.vue +44 -47
- package/components/deviceOrganisations/FSConnectivity.vue +114 -0
- package/components/deviceOrganisations/FSStatus.vue +117 -0
- package/components/deviceOrganisations/FSStatusesCarousel.vue +105 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +66 -0
- package/components/deviceOrganisations/FSWorstAlert.vue +165 -0
- package/components/lists/FSDataIteratorGroup.vue +7 -0
- package/components/lists/FSDataIteratorItem.vue +103 -0
- package/components/lists/FSDataTableUI.vue +982 -0
- package/components/lists/FSFilterButton.vue +177 -0
- package/components/lists/FSHeaderButton.vue +99 -0
- package/components/lists/FSHiddenButton.vue +81 -0
- package/components/tiles/FSDeviceOrganisationTileUI.vue +232 -0
- package/components/tiles/FSGroupTileUI.vue +192 -0
- package/composables/index.ts +1 -1
- package/composables/useBreakpoints.ts +23 -4
- package/composables/useColors.ts +53 -23
- package/composables/useSlots.ts +43 -0
- package/index.ts +6 -0
- package/models/breadcrumbs.ts +8 -0
- package/models/colors.ts +17 -0
- package/models/deviceAlerts.ts +10 -0
- package/models/deviceConnectivities.ts +11 -0
- package/models/deviceStatuses.ts +16 -0
- package/models/index.ts +9 -0
- package/models/modelStatuses.ts +11 -0
- package/models/rules.ts +50 -0
- package/models/tables.ts +33 -0
- package/models/toggleSets.ts +7 -0
- package/package.json +6 -4
- package/plugins/colorPlugin.ts +2 -2
- package/shims-plugin.d.ts +1 -1
- package/styles/components/fs_autocomplete_field.scss +123 -0
- package/styles/components/fs_button.scss +4 -6
- package/styles/components/fs_calendar.scss +24 -1
- package/styles/components/fs_card.scss +2 -5
- package/styles/components/fs_carousel.scss +4 -0
- package/styles/components/fs_chip.scss +33 -0
- package/styles/components/fs_clock.scss +43 -0
- package/styles/components/fs_col.scss +2 -0
- package/styles/components/fs_color_icon.scss +37 -0
- package/styles/components/fs_container.scss +16 -0
- package/styles/components/fs_data_iterator_item.scss +19 -0
- package/styles/components/fs_data_table.scss +97 -0
- package/styles/components/fs_date_field.scss +8 -0
- package/styles/components/fs_dialog.scss +30 -0
- package/styles/components/fs_divider.scss +5 -0
- package/styles/components/fs_fade_out.scss +10 -2
- package/styles/components/fs_filter_button.scss +21 -0
- package/styles/components/fs_header_button.scss +4 -0
- package/styles/components/fs_hidden_button.scss +12 -0
- package/styles/components/fs_icon.scss +19 -3
- package/styles/components/fs_icon_field.scss +12 -0
- package/styles/components/fs_image.scss +7 -0
- package/styles/components/fs_load_tile.scss +49 -0
- package/styles/components/fs_password_field.scss +2 -2
- package/styles/components/fs_row.scss +4 -1
- package/styles/components/fs_select_field.scss +71 -0
- package/styles/components/fs_slide_group.scss +6 -0
- package/styles/components/fs_slider.scss +29 -9
- package/styles/components/fs_span.scss +8 -0
- package/styles/components/fs_submit_dialog.scss +9 -0
- package/styles/components/fs_tabs.scss +4 -0
- package/styles/components/fs_tag_field.scss +0 -11
- package/styles/components/fs_text_field.scss +23 -15
- package/styles/components/fs_tile.scss +33 -0
- package/styles/components/fs_tooltip.scss +5 -0
- package/styles/components/fs_wrap_group.scss +7 -8
- package/styles/components/index.scss +22 -1
- package/styles/globals/breakpoints.scss +7 -0
- package/styles/globals/overrides.scss +20 -7
- package/styles/globals/text_fonts.scss +8 -8
- package/themes/default.ts +1 -11
- package/utils/css.ts +11 -0
- package/utils/icons.ts +75416 -0
- package/utils/index.ts +5 -1
- package/utils/levenshtein.ts +97 -0
- package/utils/sort.ts +9 -0
- package/components/FSDatePicker.vue +0 -226
- package/composables/useDates.ts +0 -39
- package/models/FSTags.ts +0 -8
- package/models/FSTextFields.ts +0 -23
- package/styles/components/fs_date_picker.scss +0 -0
- /package/utils/{FSRichTextField.ts → lexical.ts} +0 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSDialog
|
|
3
|
+
cardClasses="fs-submit-dialog"
|
|
4
|
+
:width="$props.width"
|
|
5
|
+
:modelValue="$props.modelValue"
|
|
6
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
7
|
+
v-bind="$attrs"
|
|
8
|
+
>
|
|
9
|
+
<template #header>
|
|
10
|
+
<slot name="header">
|
|
11
|
+
<FSCol v-if="$props.title">
|
|
12
|
+
<FSSpan font="text-h2">
|
|
13
|
+
{{ $props.title }}
|
|
14
|
+
</FSSpan>
|
|
15
|
+
<FSSpan v-if="$props.subtitle">
|
|
16
|
+
{{ $props.subtitle }}
|
|
17
|
+
</FSSpan>
|
|
18
|
+
</FSCol>
|
|
19
|
+
</slot>
|
|
20
|
+
</template>
|
|
21
|
+
<template #body>
|
|
22
|
+
<slot name="body" />
|
|
23
|
+
</template>
|
|
24
|
+
<template #footer>
|
|
25
|
+
<slot name="footer">
|
|
26
|
+
<FSRow
|
|
27
|
+
class="fs-submit-dialog-actions"
|
|
28
|
+
align="top-right"
|
|
29
|
+
:wrap="false"
|
|
30
|
+
>
|
|
31
|
+
<FSButton
|
|
32
|
+
:prependIcon="$props.leftButtonPrependIcon"
|
|
33
|
+
:label="cancelButtonLabel"
|
|
34
|
+
:appendIcon="$props.leftButtonAppendIcon"
|
|
35
|
+
:variant="$props.leftButtonVariant"
|
|
36
|
+
:color="$props.leftButtonColor"
|
|
37
|
+
@click="() => $emit('update:modelValue', false)"
|
|
38
|
+
/>
|
|
39
|
+
<FSButton
|
|
40
|
+
:prependIcon="$props.rightButtonPrependIcon"
|
|
41
|
+
:label="submitButtonLabel"
|
|
42
|
+
:appendIcon="$props.rightButtonAppendIcon"
|
|
43
|
+
:variant="$props.rightButtonVariant"
|
|
44
|
+
:color="$props.rightButtonColor"
|
|
45
|
+
:editable="$props.editable"
|
|
46
|
+
@click="() => $emit('click:rightButton')"
|
|
47
|
+
/>
|
|
48
|
+
</FSRow>
|
|
49
|
+
</slot>
|
|
50
|
+
</template>
|
|
51
|
+
</FSDialog>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script lang="ts">
|
|
55
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
56
|
+
|
|
57
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
58
|
+
import { useTranslationsProvider } from "@dative-gpi/foundation-shared-services";
|
|
59
|
+
|
|
60
|
+
import FSDialog from "./FSDialog.vue";
|
|
61
|
+
import FSRow from "./FSRow.vue";
|
|
62
|
+
|
|
63
|
+
export default defineComponent({
|
|
64
|
+
name: "FSSubmitDialog",
|
|
65
|
+
components: {
|
|
66
|
+
FSDialog,
|
|
67
|
+
FSRow
|
|
68
|
+
},
|
|
69
|
+
props: {
|
|
70
|
+
modelValue: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
required: false,
|
|
73
|
+
default: false
|
|
74
|
+
},
|
|
75
|
+
width: {
|
|
76
|
+
type: [String, Number],
|
|
77
|
+
required: false,
|
|
78
|
+
default: "auto"
|
|
79
|
+
},
|
|
80
|
+
title: {
|
|
81
|
+
type: String,
|
|
82
|
+
required: false,
|
|
83
|
+
default: null
|
|
84
|
+
},
|
|
85
|
+
subtitle: {
|
|
86
|
+
type: String,
|
|
87
|
+
required: false,
|
|
88
|
+
default: null
|
|
89
|
+
},
|
|
90
|
+
leftButtonPrependIcon: {
|
|
91
|
+
type: String,
|
|
92
|
+
required: false,
|
|
93
|
+
default: null
|
|
94
|
+
},
|
|
95
|
+
leftButtonLabel: {
|
|
96
|
+
type: String,
|
|
97
|
+
required: false,
|
|
98
|
+
default: null
|
|
99
|
+
},
|
|
100
|
+
leftButtonAppendIcon: {
|
|
101
|
+
type: String,
|
|
102
|
+
required: false,
|
|
103
|
+
default: null
|
|
104
|
+
},
|
|
105
|
+
leftButtonVariant: {
|
|
106
|
+
type: String as PropType<"standard" | "full" | "icon">,
|
|
107
|
+
required: false,
|
|
108
|
+
default: "standard"
|
|
109
|
+
},
|
|
110
|
+
rightButtonPrependIcon: {
|
|
111
|
+
type: String,
|
|
112
|
+
required: false,
|
|
113
|
+
default: null
|
|
114
|
+
},
|
|
115
|
+
rightButtonLabel: {
|
|
116
|
+
type: String,
|
|
117
|
+
required: false,
|
|
118
|
+
default: null
|
|
119
|
+
},
|
|
120
|
+
rightButtonAppendIcon: {
|
|
121
|
+
type: String,
|
|
122
|
+
required: false,
|
|
123
|
+
default: null
|
|
124
|
+
},
|
|
125
|
+
rightButtonVariant: {
|
|
126
|
+
type: String as PropType<"standard" | "full" | "icon">,
|
|
127
|
+
required: false,
|
|
128
|
+
default: "full"
|
|
129
|
+
},
|
|
130
|
+
leftButtonColor: {
|
|
131
|
+
type: String as PropType<ColorBase>,
|
|
132
|
+
required: false,
|
|
133
|
+
default: ColorEnum.Light
|
|
134
|
+
},
|
|
135
|
+
rightButtonColor: {
|
|
136
|
+
type: String as PropType<ColorBase>,
|
|
137
|
+
required: false,
|
|
138
|
+
default: ColorEnum.Primary
|
|
139
|
+
},
|
|
140
|
+
editable: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
required: false,
|
|
143
|
+
default: true
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
emits: ["update:modelValue"],
|
|
147
|
+
setup(props) {
|
|
148
|
+
const { $tr } = useTranslationsProvider();
|
|
149
|
+
|
|
150
|
+
const cancelButtonLabel = computed(() => {
|
|
151
|
+
return props.leftButtonLabel ?? $tr("ui.button.cancel", "Cancel");
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const submitButtonLabel = computed(() => {
|
|
155
|
+
return props.rightButtonLabel ?? $tr("ui.button.validate", "Validate");
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
ColorEnum,
|
|
160
|
+
cancelButtonLabel,
|
|
161
|
+
submitButtonLabel
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
</script>
|
package/components/FSSwitch.vue
CHANGED
|
@@ -1,129 +1,130 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
<FSCol
|
|
3
|
+
width="hug"
|
|
4
|
+
>
|
|
5
|
+
<FSRow
|
|
6
|
+
width="hug"
|
|
7
|
+
align="center-left"
|
|
8
|
+
>
|
|
9
|
+
<v-switch
|
|
10
|
+
class="fs-switch"
|
|
11
|
+
hide-details
|
|
12
|
+
inset
|
|
13
|
+
:style="style"
|
|
14
|
+
:ripple="false"
|
|
15
|
+
:modelValue="$props.modelValue"
|
|
16
|
+
@update:modelValue="onToggle"
|
|
17
|
+
v-bind="$attrs"
|
|
18
|
+
/>
|
|
19
|
+
<slot>
|
|
20
|
+
<FSSpan
|
|
21
|
+
v-if="$props.label"
|
|
22
|
+
class="fs-switch-label"
|
|
23
|
+
:style="style"
|
|
24
|
+
:font="font"
|
|
25
|
+
@click.stop="onToggle"
|
|
26
|
+
>
|
|
27
|
+
{{ $props.label }}
|
|
28
|
+
</FSSpan>
|
|
29
|
+
</slot>
|
|
30
|
+
</FSRow>
|
|
31
|
+
<slot name="description">
|
|
32
|
+
<FSSpan
|
|
33
|
+
v-if="$props.description"
|
|
34
|
+
class="fs-switch-description"
|
|
35
|
+
font="text-underline"
|
|
36
|
+
:style="style"
|
|
37
|
+
>
|
|
38
|
+
{{ $props.description }}
|
|
39
|
+
</FSSpan>
|
|
40
|
+
</slot>
|
|
41
|
+
</FSCol>
|
|
37
42
|
</template>
|
|
38
43
|
|
|
39
44
|
<script lang="ts">
|
|
40
|
-
import { computed, defineComponent, PropType
|
|
45
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
41
46
|
|
|
47
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
42
48
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
43
|
-
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
44
49
|
|
|
45
50
|
import FSSpan from "./FSSpan.vue";
|
|
46
51
|
import FSRow from "./FSRow.vue";
|
|
47
52
|
import FSCol from "./FSCol.vue";
|
|
48
53
|
|
|
49
54
|
export default defineComponent({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
name: "FSSwitch",
|
|
56
|
+
components: {
|
|
57
|
+
FSSpan,
|
|
58
|
+
FSRow,
|
|
59
|
+
FSCol
|
|
60
|
+
},
|
|
61
|
+
props: {
|
|
62
|
+
label: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: false,
|
|
65
|
+
default: null
|
|
55
66
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
default: null
|
|
61
|
-
},
|
|
62
|
-
description: {
|
|
63
|
-
type: String,
|
|
64
|
-
required: false,
|
|
65
|
-
default: null
|
|
66
|
-
},
|
|
67
|
-
modelValue: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
required: false,
|
|
70
|
-
default: false
|
|
71
|
-
},
|
|
72
|
-
color: {
|
|
73
|
-
type: String as PropType<ColorBase>,
|
|
74
|
-
required: false,
|
|
75
|
-
default: ColorBase.Primary
|
|
76
|
-
},
|
|
77
|
-
editable: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
required: false,
|
|
80
|
-
default: true
|
|
81
|
-
}
|
|
67
|
+
description: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: false,
|
|
70
|
+
default: null
|
|
82
71
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"--fs-switch-cursor": "pointer",
|
|
106
|
-
"--fs-switch-track-color": modelValue.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 => modelValue.value ? "text-button" : "text-body");
|
|
113
|
-
|
|
114
|
-
const onToggle = (): void => {
|
|
115
|
-
if (!editable.value) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
emit("update:modelValue", !modelValue.value);
|
|
119
|
-
}
|
|
72
|
+
modelValue: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
required: false,
|
|
75
|
+
default: false
|
|
76
|
+
},
|
|
77
|
+
color: {
|
|
78
|
+
type: String as PropType<ColorBase>,
|
|
79
|
+
required: false,
|
|
80
|
+
default: ColorEnum.Primary
|
|
81
|
+
},
|
|
82
|
+
editable: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
required: false,
|
|
85
|
+
default: true
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
emits: ["update:modelValue"],
|
|
89
|
+
setup(props, { emit }) {
|
|
90
|
+
const colors = computed(() => useColors().getColors(props.color));
|
|
91
|
+
const backgrounds = useColors().getColors(ColorEnum.Background);
|
|
92
|
+
const lights = useColors().getColors(ColorEnum.Light);
|
|
93
|
+
const darks = useColors().getColors(ColorEnum.Dark);
|
|
120
94
|
|
|
95
|
+
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
96
|
+
if (!props.editable) {
|
|
121
97
|
return {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
98
|
+
"--fs-switch-translate-x": props.modelValue ? "8px" : "-8px",
|
|
99
|
+
"--fs-switch-cursor" : "default",
|
|
100
|
+
"--fs-switch-track-color": lights.dark,
|
|
101
|
+
"--fs-switch-thumb-color": backgrounds.base,
|
|
102
|
+
"--fs-switch-color" : lights.dark
|
|
126
103
|
};
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
"--fs-switch-translate-x": props.modelValue ? "8px" : "-8px",
|
|
107
|
+
"--fs-switch-cursor" : "pointer",
|
|
108
|
+
"--fs-switch-track-color": props.modelValue ? colors.value.base : darks.base,
|
|
109
|
+
"--fs-switch-thumb-color": backgrounds.base,
|
|
110
|
+
"--fs-switch-color" : darks.base
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const font = computed((): string => props.modelValue ? "text-button" : "text-body");
|
|
115
|
+
|
|
116
|
+
const onToggle = (): void => {
|
|
117
|
+
if (!props.editable) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
emit("update:modelValue", !props.modelValue);
|
|
127
121
|
}
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
style,
|
|
125
|
+
font,
|
|
126
|
+
onToggle
|
|
127
|
+
};
|
|
128
|
+
}
|
|
128
129
|
});
|
|
129
130
|
</script>
|
package/components/FSTab.vue
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<v-tab
|
|
3
|
+
class="fs-tab"
|
|
4
|
+
:ripple="false"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
>
|
|
7
|
+
<slot>
|
|
8
|
+
<FSRow align="center-left">
|
|
9
|
+
<slot name="prepend">
|
|
10
|
+
<FSIcon v-if="$props.prependIcon" size="m">
|
|
11
|
+
{{ $props.prependIcon }}
|
|
12
|
+
</FSIcon>
|
|
13
|
+
</slot>
|
|
7
14
|
<slot>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{{ $props.tag }}
|
|
23
|
-
</FSSpan>
|
|
24
|
-
</slot>
|
|
25
|
-
<slot name="append">
|
|
26
|
-
<FSIcon v-if="$props.appendIcon" size="m">
|
|
27
|
-
{{ $props.appendIcon }}
|
|
28
|
-
</FSIcon>
|
|
29
|
-
</slot>
|
|
30
|
-
</FSRow>
|
|
15
|
+
<FSSpan v-if="$props.label" font="text-button">
|
|
16
|
+
{{ $props.label }}
|
|
17
|
+
</FSSpan>
|
|
18
|
+
</slot>
|
|
19
|
+
<v-spacer v-if="$props.tag" />
|
|
20
|
+
<slot name="tag">
|
|
21
|
+
<FSSpan v-if="$props.tag" class="fs-tab-tag">
|
|
22
|
+
{{ $props.tag }}
|
|
23
|
+
</FSSpan>
|
|
24
|
+
</slot>
|
|
25
|
+
<slot name="append">
|
|
26
|
+
<FSIcon v-if="$props.appendIcon" size="m">
|
|
27
|
+
{{ $props.appendIcon }}
|
|
28
|
+
</FSIcon>
|
|
31
29
|
</slot>
|
|
32
|
-
|
|
30
|
+
</FSRow>
|
|
31
|
+
</slot>
|
|
32
|
+
</v-tab>
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script lang="ts">
|
|
36
36
|
import { defineComponent, PropType } from "vue";
|
|
37
37
|
|
|
38
|
-
import { ColorBase } from "@dative-gpi/foundation-shared-components/
|
|
38
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
39
39
|
|
|
40
40
|
import FSSpan from "./FSSpan.vue";
|
|
41
41
|
import FSIcon from "./FSIcon.vue";
|
|
42
42
|
import FSRow from "./FSRow.vue";
|
|
43
43
|
|
|
44
44
|
export default defineComponent({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
name: "FSTab",
|
|
46
|
+
components: {
|
|
47
|
+
FSSpan,
|
|
48
|
+
FSIcon,
|
|
49
|
+
FSRow
|
|
50
|
+
},
|
|
51
|
+
props: {
|
|
52
|
+
prependIcon: {
|
|
53
|
+
type: String,
|
|
54
|
+
required: false,
|
|
55
|
+
default: null
|
|
56
|
+
},
|
|
57
|
+
label: {
|
|
58
|
+
type: String,
|
|
59
|
+
required: false,
|
|
60
|
+
default: null
|
|
61
|
+
},
|
|
62
|
+
tag: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: false,
|
|
65
|
+
default: null
|
|
66
|
+
},
|
|
67
|
+
appendIcon: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: false,
|
|
70
|
+
default: null
|
|
50
71
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
default: null
|
|
56
|
-
},
|
|
57
|
-
label: {
|
|
58
|
-
type: String,
|
|
59
|
-
required: false,
|
|
60
|
-
default: null
|
|
61
|
-
},
|
|
62
|
-
tag: {
|
|
63
|
-
type: String,
|
|
64
|
-
required: false,
|
|
65
|
-
default: null
|
|
66
|
-
},
|
|
67
|
-
appendIcon: {
|
|
68
|
-
type: String,
|
|
69
|
-
required: false,
|
|
70
|
-
default: null
|
|
71
|
-
},
|
|
72
|
-
color: {
|
|
73
|
-
type: String as PropType<ColorBase>,
|
|
74
|
-
required: false,
|
|
75
|
-
default: ColorBase.Dark
|
|
76
|
-
}
|
|
72
|
+
color: {
|
|
73
|
+
type: String as PropType<ColorBase>,
|
|
74
|
+
required: false,
|
|
75
|
+
default: ColorEnum.Dark
|
|
77
76
|
}
|
|
77
|
+
}
|
|
78
78
|
});
|
|
79
79
|
</script>
|
package/components/FSTabs.vue
CHANGED
|
@@ -1,69 +1,67 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
<v-tabs
|
|
3
|
+
class="fs-tabs"
|
|
4
|
+
selectedClass="fs-tab-active"
|
|
5
|
+
:grow="true"
|
|
6
|
+
:style="style"
|
|
7
|
+
:showArrows="true"
|
|
8
|
+
:sliderColor="$props.color"
|
|
9
|
+
:modelValue="$props.tab"
|
|
10
|
+
@update:modelValue="(value) => $emit('update:tab', value)"
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
>
|
|
13
|
+
<template
|
|
14
|
+
v-for="(component, index) in getChildren()"
|
|
15
|
+
:key="index"
|
|
12
16
|
>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</v-tabs>
|
|
17
|
+
<component :is="component" />
|
|
18
|
+
</template>
|
|
19
|
+
</v-tabs>
|
|
17
20
|
</template>
|
|
18
21
|
|
|
19
22
|
<script lang="ts">
|
|
20
|
-
import { defineComponent, PropType
|
|
23
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
21
24
|
|
|
22
|
-
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
23
|
-
import { ColorBase } from "@dative-gpi/foundation-shared-components/
|
|
25
|
+
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
26
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
24
27
|
|
|
25
28
|
export default defineComponent({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
color: {
|
|
34
|
-
type: String as PropType<ColorBase>,
|
|
35
|
-
required: false,
|
|
36
|
-
default: ColorBase.Primary
|
|
37
|
-
}
|
|
29
|
+
name: "FSTabs",
|
|
30
|
+
props: {
|
|
31
|
+
tab: {
|
|
32
|
+
type: Number,
|
|
33
|
+
required: false,
|
|
34
|
+
default: 0
|
|
38
35
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
color: {
|
|
37
|
+
type: String as PropType<ColorBase>,
|
|
38
|
+
required: false,
|
|
39
|
+
default: ColorEnum.Primary
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
setup(props) {
|
|
43
|
+
const { getChildren } = useSlots();
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
const textColors = computed(() => useColors().getContrasts(props.color));
|
|
46
|
+
const colors = computed(() => useColors().getColors(props.color));
|
|
47
|
+
const darks = useColors().getColors(ColorEnum.Dark);
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => ({
|
|
50
|
+
"--fs-group-color" : darks.base,
|
|
51
|
+
"--fs-group-hover-background-color": colors.value.light,
|
|
52
|
+
"--fs-group-hover-color" : darks.dark,
|
|
53
|
+
"--fs-group-disabled-color" : darks.light,
|
|
54
|
+
"--fs-group-light" : colors.value.light,
|
|
55
|
+
"--fs-group-base" : colors.value.base,
|
|
56
|
+
"--fs-group-dark" : colors.value.dark,
|
|
57
|
+
"--fs-tab-tag-background-color" : colors.value.base,
|
|
58
|
+
"--fs-tab-tag-color" : textColors.value.light
|
|
59
|
+
}));
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
emit
|
|
66
|
-
};
|
|
67
|
-
}
|
|
61
|
+
return {
|
|
62
|
+
style,
|
|
63
|
+
getChildren
|
|
64
|
+
};
|
|
65
|
+
}
|
|
68
66
|
});
|
|
69
67
|
</script>
|