@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
package/components/FSCol.vue
CHANGED
|
@@ -1,109 +1,115 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<div
|
|
3
|
+
:style="style"
|
|
4
|
+
:class="classes"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
>
|
|
7
|
+
<slot />
|
|
8
|
+
</div>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
|
-
import { computed, defineComponent, PropType
|
|
12
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
13
|
+
|
|
14
|
+
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
13
15
|
|
|
14
16
|
export default defineComponent({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
height: {
|
|
23
|
-
type: String as PropType<"hug" | "fill" | string>,
|
|
24
|
-
required: false,
|
|
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"
|
|
31
|
-
},
|
|
32
|
-
gap: {
|
|
33
|
-
type: Number,
|
|
34
|
-
required: false,
|
|
35
|
-
default: 8
|
|
36
|
-
}
|
|
17
|
+
name: "FSCol",
|
|
18
|
+
props: {
|
|
19
|
+
width: {
|
|
20
|
+
type: String as PropType<"hug" | "fill" | string>,
|
|
21
|
+
required: false,
|
|
22
|
+
default: "fill"
|
|
37
23
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
height: {
|
|
25
|
+
type: String as PropType<"hug" | "fill" | string>,
|
|
26
|
+
required: false,
|
|
27
|
+
default: "hug"
|
|
28
|
+
},
|
|
29
|
+
align: {
|
|
30
|
+
type: String as PropType<"top-left" | "top-center" | "top-right" | "center-left" | "center-center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right">,
|
|
31
|
+
required: false,
|
|
32
|
+
default: "top-left"
|
|
33
|
+
},
|
|
34
|
+
padding: {
|
|
35
|
+
type: [String, Number],
|
|
36
|
+
required: false,
|
|
37
|
+
default: "0"
|
|
38
|
+
},
|
|
39
|
+
gap: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
required: false,
|
|
42
|
+
default: "8px"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
setup(props) {
|
|
46
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => ({
|
|
47
|
+
"--fs-col-padding": sizeToVar(props.padding),
|
|
48
|
+
"--fs-col-gap" : sizeToVar(props.gap),
|
|
49
|
+
"--fs-col-width" : sizeToVar(props.width),
|
|
50
|
+
"--fs-col-height" : sizeToVar(props.height)
|
|
51
|
+
}));
|
|
46
52
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
53
|
+
const classes = computed((): string[] => {
|
|
54
|
+
const classNames = ["fs-col"];
|
|
55
|
+
switch (props.width) {
|
|
56
|
+
case "hug":
|
|
57
|
+
classNames.push("fs-col-width-hug");
|
|
58
|
+
break;
|
|
59
|
+
case "fill":
|
|
60
|
+
classNames.push("fs-col-width-fill");
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
classNames.push("fs-col-width-fixed");
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
switch (props.height) {
|
|
67
|
+
case "hug":
|
|
68
|
+
classNames.push("fs-col-height-hug");
|
|
69
|
+
break;
|
|
70
|
+
case "fill":
|
|
71
|
+
classNames.push("fs-col-height-fill");
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
classNames.push("fs-col-height-fixed");
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
switch (props.align) {
|
|
78
|
+
case "top-left":
|
|
79
|
+
classNames.push("fs-col-top-left");
|
|
80
|
+
break;
|
|
81
|
+
case "top-center":
|
|
82
|
+
classNames.push("fs-col-top-center");
|
|
83
|
+
break;
|
|
84
|
+
case "top-right":
|
|
85
|
+
classNames.push("fs-col-top-right");
|
|
86
|
+
break;
|
|
87
|
+
case "center-left":
|
|
88
|
+
classNames.push("fs-col-center-left");
|
|
89
|
+
break;
|
|
90
|
+
case "center-center":
|
|
91
|
+
classNames.push("fs-col-center-center");
|
|
92
|
+
break;
|
|
93
|
+
case "center-right":
|
|
94
|
+
classNames.push("fs-col-center-right");
|
|
95
|
+
break;
|
|
96
|
+
case "bottom-left":
|
|
97
|
+
classNames.push("fs-col-bottom-left");
|
|
98
|
+
break;
|
|
99
|
+
case "bottom-center":
|
|
100
|
+
classNames.push("fs-col-bottom-center");
|
|
101
|
+
break;
|
|
102
|
+
case "bottom-right":
|
|
103
|
+
classNames.push("fs-col-bottom-right");
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
return classNames;
|
|
107
|
+
});
|
|
102
108
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
109
|
+
return {
|
|
110
|
+
style,
|
|
111
|
+
classes
|
|
112
|
+
};
|
|
113
|
+
}
|
|
108
114
|
});
|
|
109
115
|
</script>
|
package/components/FSColor.vue
CHANGED
|
@@ -1,80 +1,77 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 v-bind="{ color: $props.color, colors }" />
|
|
12
|
+
</FSRow>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script lang="ts">
|
|
16
|
-
import { defineComponent, PropType, ref, Ref
|
|
16
|
+
import { computed, defineComponent, PropType, ref, Ref } from "vue";
|
|
17
17
|
|
|
18
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
18
19
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
19
|
-
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
20
20
|
|
|
21
21
|
import FSRow from "./FSRow.vue";
|
|
22
22
|
|
|
23
23
|
export default defineComponent({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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"
|
|
27
33
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
}
|
|
34
|
+
height: {
|
|
35
|
+
type: String as PropType<"hug" | "fill" | string>,
|
|
36
|
+
required: false,
|
|
37
|
+
default: "hug"
|
|
59
38
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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: [String, Number],
|
|
51
|
+
required: false,
|
|
52
|
+
default: "8px"
|
|
53
|
+
},
|
|
54
|
+
color: {
|
|
55
|
+
type: String as PropType<ColorBase>,
|
|
56
|
+
required: false,
|
|
57
|
+
default: ColorEnum.Primary
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
setup(props) {
|
|
61
|
+
const colors = computed(() => useColors().getColors(props.color));
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
|
|
64
|
+
"--fs-color-background-color": colors.value.light,
|
|
65
|
+
"--fs-color-color" : colors.value.base,
|
|
66
|
+
"--fs-color-light" : colors.value.light,
|
|
67
|
+
"--fs-color-base" : colors.value.base,
|
|
68
|
+
"--fs-color-dark" : colors.value.dark
|
|
69
|
+
});
|
|
72
70
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
71
|
+
return {
|
|
72
|
+
colors,
|
|
73
|
+
style
|
|
74
|
+
};
|
|
75
|
+
}
|
|
79
76
|
});
|
|
80
77
|
</script>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-icon
|
|
3
|
+
:color="$props.color"
|
|
4
|
+
:class="classes"
|
|
5
|
+
:style="style"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</v-icon>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
14
|
+
|
|
15
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
16
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
17
|
+
|
|
18
|
+
export default defineComponent({
|
|
19
|
+
name: "FSColorIcon",
|
|
20
|
+
props: {
|
|
21
|
+
size: {
|
|
22
|
+
type: String as PropType<"s" | "m" | "l">,
|
|
23
|
+
required: false,
|
|
24
|
+
default: "m"
|
|
25
|
+
},
|
|
26
|
+
variant: {
|
|
27
|
+
type: String as PropType<"standard" | "fill">,
|
|
28
|
+
required: false,
|
|
29
|
+
default: "standard"
|
|
30
|
+
},
|
|
31
|
+
color: {
|
|
32
|
+
type: String as PropType<ColorBase>,
|
|
33
|
+
required: false,
|
|
34
|
+
default: ColorEnum.Dark
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
setup(props) {
|
|
38
|
+
const colors = computed(() => useColors().getColors(props.color));
|
|
39
|
+
|
|
40
|
+
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
41
|
+
switch (props.variant) {
|
|
42
|
+
case "fill": return {
|
|
43
|
+
"--fs-icon-background-color": colors.value.light
|
|
44
|
+
};
|
|
45
|
+
default: return {
|
|
46
|
+
"--fs-icon-background-color": "transparent"
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const classes = computed((): string[] => {
|
|
52
|
+
const classNames = [`fs-icon-${props.size}`];
|
|
53
|
+
switch (props.variant) {
|
|
54
|
+
case "fill":
|
|
55
|
+
classNames.push("fs-color-icon");
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
return classNames;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
style,
|
|
63
|
+
classes
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
</script>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="classes"
|
|
4
|
+
:style="style"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { computed, defineComponent } from "vue";
|
|
12
|
+
|
|
13
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
14
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: "FSContainer",
|
|
18
|
+
props: {
|
|
19
|
+
padding: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
required: false,
|
|
22
|
+
default: 8
|
|
23
|
+
},
|
|
24
|
+
border: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
required: false,
|
|
27
|
+
default: true
|
|
28
|
+
},
|
|
29
|
+
elevation: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
required: false,
|
|
32
|
+
default: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
setup(props) {
|
|
36
|
+
const backgrounds = useColors().getColors(ColorEnum.Background);
|
|
37
|
+
const lights = useColors().getColors(ColorEnum.Light);
|
|
38
|
+
|
|
39
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
40
|
+
return {
|
|
41
|
+
"--fs-container-padding" : typeof(props.padding) === "string" ? props.padding : `${props.padding}px`,
|
|
42
|
+
"--fs-container-background-color": backgrounds.base,
|
|
43
|
+
"--fs-container-border-color" : lights.dark
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const classes = computed((): string[] => {
|
|
48
|
+
const classNames = ["fs-container"];
|
|
49
|
+
if (props.border) {
|
|
50
|
+
classNames.push("fs-container-border");
|
|
51
|
+
}
|
|
52
|
+
if (props.elevation) {
|
|
53
|
+
classNames.push("fs-container-elevation");
|
|
54
|
+
}
|
|
55
|
+
return classNames;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
style,
|
|
60
|
+
classes
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
</script>
|