@dative-gpi/foundation-shared-components 0.0.8 → 0.0.9
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/FSDataTable.vue +964 -0
- package/components/lists/FSFilterButton.vue +176 -0
- package/components/lists/FSHeaderButton.vue +99 -0
- package/components/lists/FSHiddenButton.vue +79 -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/dispositions.ts +33 -0
- package/models/index.ts +9 -0
- package/models/modelStatuses.ts +11 -0
- package/models/rules.ts +50 -0
- package/models/toggleSets.ts +7 -0
- package/package.json +5 -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 +12 -0
- package/styles/components/fs_header_button.scss +4 -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 +21 -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
|
@@ -1,207 +1,209 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</FSSpan>
|
|
13
|
-
<FSSpan
|
|
14
|
-
v-if="$props.label && $props.required"
|
|
15
|
-
class="fs-text-area-label"
|
|
16
|
-
style="margin-left: -8px;"
|
|
17
|
-
font="text-overline"
|
|
18
|
-
:ellipsis="false"
|
|
19
|
-
:style="style"
|
|
20
|
-
>
|
|
21
|
-
*
|
|
22
|
-
</FSSpan>
|
|
23
|
-
<v-spacer style="min-width: 40px;" />
|
|
24
|
-
<FSSpan
|
|
25
|
-
v-if="messages.length > 0"
|
|
26
|
-
class="fs-text-area-messages"
|
|
27
|
-
font="text-overline"
|
|
28
|
-
:style="style"
|
|
29
|
-
>
|
|
30
|
-
{{ messages.join(", ") }}
|
|
31
|
-
</FSSpan>
|
|
32
|
-
</FSRow>
|
|
33
|
-
</slot>
|
|
34
|
-
<v-textarea
|
|
35
|
-
:class="classes"
|
|
36
|
-
variant="outlined"
|
|
37
|
-
hide-details
|
|
38
|
-
:style="style"
|
|
39
|
-
:rows="$props.rows"
|
|
40
|
-
:rules="$props.rules"
|
|
41
|
-
:noResize="!$props.resize"
|
|
42
|
-
:autoGrow="$props.autoGrow"
|
|
43
|
-
:readonly="!$props.editable"
|
|
44
|
-
:modelValue="$props.modelValue"
|
|
45
|
-
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
46
|
-
v-bind="$attrs"
|
|
2
|
+
<FSCol>
|
|
3
|
+
<slot v-if="!$props.hideHeader" name="label">
|
|
4
|
+
<FSRow
|
|
5
|
+
:wrap="false"
|
|
6
|
+
>
|
|
7
|
+
<FSSpan
|
|
8
|
+
v-if="$props.label"
|
|
9
|
+
class="fs-text-area-label"
|
|
10
|
+
font="text-overline"
|
|
11
|
+
:style="style"
|
|
47
12
|
>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
13
|
+
{{ $props.label }}
|
|
14
|
+
</FSSpan>
|
|
15
|
+
<FSSpan
|
|
16
|
+
v-if="$props.label && $props.required"
|
|
17
|
+
class="fs-text-area-label"
|
|
18
|
+
style="margin-left: -8px;"
|
|
19
|
+
font="text-overline"
|
|
20
|
+
:ellipsis="false"
|
|
21
|
+
:style="style"
|
|
22
|
+
>
|
|
23
|
+
*
|
|
24
|
+
</FSSpan>
|
|
25
|
+
<v-spacer style="min-width: 40px;" />
|
|
26
|
+
<FSSpan
|
|
27
|
+
v-if="messages.length > 0"
|
|
28
|
+
class="fs-text-area-messages"
|
|
29
|
+
font="text-overline"
|
|
30
|
+
:style="style"
|
|
31
|
+
>
|
|
32
|
+
{{ messages.join(", ") }}
|
|
33
|
+
</FSSpan>
|
|
34
|
+
</FSRow>
|
|
35
|
+
</slot>
|
|
36
|
+
<v-textarea
|
|
37
|
+
clearIcon="mdi-close"
|
|
38
|
+
variant="outlined"
|
|
39
|
+
hide-details
|
|
40
|
+
:style="style"
|
|
41
|
+
:class="classes"
|
|
42
|
+
:rows="$props.rows"
|
|
43
|
+
:rules="$props.rules"
|
|
44
|
+
:noResize="!$props.resize"
|
|
45
|
+
:autoGrow="$props.autoGrow"
|
|
46
|
+
:readonly="!$props.editable"
|
|
47
|
+
:clearable="$props.editable"
|
|
48
|
+
:modelValue="$props.modelValue"
|
|
49
|
+
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
50
|
+
v-bind="$attrs"
|
|
51
|
+
>
|
|
52
|
+
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
53
|
+
<slot :name="name" v-bind="slotData" />
|
|
54
|
+
</template>
|
|
55
|
+
</v-textarea>
|
|
56
|
+
<slot name="description">
|
|
57
|
+
<FSSpan
|
|
58
|
+
v-if="$props.description"
|
|
59
|
+
class="fs-text-area-description"
|
|
60
|
+
font="text-underline"
|
|
61
|
+
:style="style"
|
|
62
|
+
>
|
|
63
|
+
{{ $props.description }}
|
|
64
|
+
</FSSpan>
|
|
65
|
+
</slot>
|
|
66
|
+
</FSCol>
|
|
63
67
|
</template>
|
|
64
68
|
|
|
65
69
|
<script lang="ts">
|
|
66
|
-
import { computed, defineComponent, PropType
|
|
70
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
67
71
|
|
|
68
72
|
import { useColors, useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
69
|
-
import {
|
|
73
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
70
74
|
|
|
71
75
|
import FSSpan from "./FSSpan.vue";
|
|
72
76
|
import FSCol from "./FSCol.vue";
|
|
73
77
|
import FSRow from "./FSRow.vue";
|
|
74
78
|
|
|
75
79
|
export default defineComponent({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
name: "FSTextArea",
|
|
81
|
+
components: {
|
|
82
|
+
FSSpan,
|
|
83
|
+
FSCol,
|
|
84
|
+
FSRow
|
|
85
|
+
},
|
|
86
|
+
inheritAttrs: false,
|
|
87
|
+
props: {
|
|
88
|
+
label: {
|
|
89
|
+
type: String,
|
|
90
|
+
required: false,
|
|
91
|
+
default: null
|
|
81
92
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
required: true,
|
|
87
|
-
default: null
|
|
88
|
-
},
|
|
89
|
-
description: {
|
|
90
|
-
type: String,
|
|
91
|
-
required: false,
|
|
92
|
-
default: null
|
|
93
|
-
},
|
|
94
|
-
modelValue: {
|
|
95
|
-
type: String,
|
|
96
|
-
required: false,
|
|
97
|
-
default: null
|
|
98
|
-
},
|
|
99
|
-
color: {
|
|
100
|
-
type: String as PropType<ColorBase>,
|
|
101
|
-
required: false,
|
|
102
|
-
default: ColorBase.Dark
|
|
103
|
-
},
|
|
104
|
-
required: {
|
|
105
|
-
type: Boolean,
|
|
106
|
-
required: false,
|
|
107
|
-
default: false
|
|
108
|
-
},
|
|
109
|
-
rows: {
|
|
110
|
-
type: Number,
|
|
111
|
-
required: false,
|
|
112
|
-
default: 1
|
|
113
|
-
},
|
|
114
|
-
resize: {
|
|
115
|
-
type: Boolean,
|
|
116
|
-
required: false,
|
|
117
|
-
default: true
|
|
118
|
-
},
|
|
119
|
-
autoGrow: {
|
|
120
|
-
type: Boolean,
|
|
121
|
-
required: false,
|
|
122
|
-
default: false
|
|
123
|
-
},
|
|
124
|
-
rules: {
|
|
125
|
-
type: Array as PropType<Function[]>,
|
|
126
|
-
required: false,
|
|
127
|
-
default: () => []
|
|
128
|
-
},
|
|
129
|
-
editable: {
|
|
130
|
-
type: Boolean,
|
|
131
|
-
required: false,
|
|
132
|
-
default: true
|
|
133
|
-
}
|
|
93
|
+
description: {
|
|
94
|
+
type: String,
|
|
95
|
+
required: false,
|
|
96
|
+
default: null
|
|
134
97
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
98
|
+
modelValue: {
|
|
99
|
+
type: String,
|
|
100
|
+
required: false,
|
|
101
|
+
default: null
|
|
102
|
+
},
|
|
103
|
+
required: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
required: false,
|
|
106
|
+
default: false
|
|
107
|
+
},
|
|
108
|
+
rows: {
|
|
109
|
+
type: Number,
|
|
110
|
+
required: false,
|
|
111
|
+
default: 1
|
|
112
|
+
},
|
|
113
|
+
resize: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
required: false,
|
|
116
|
+
default: true
|
|
117
|
+
},
|
|
118
|
+
autoGrow: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
required: false,
|
|
121
|
+
default: false
|
|
122
|
+
},
|
|
123
|
+
hideHeader: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
required: false,
|
|
126
|
+
default: false
|
|
127
|
+
},
|
|
128
|
+
rules: {
|
|
129
|
+
type: Array as PropType<Function[]>,
|
|
130
|
+
required: false,
|
|
131
|
+
default: () => []
|
|
132
|
+
},
|
|
133
|
+
editable: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
required: false,
|
|
136
|
+
default: true
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
emits: ["update:modelValue"],
|
|
140
|
+
setup(props) {
|
|
141
|
+
const { isMobileSized } = useBreakpoints();
|
|
140
142
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
const errors = useColors().getColors(ColorEnum.Error);
|
|
144
|
+
const lights = useColors().getColors(ColorEnum.Light);
|
|
145
|
+
const darks = useColors().getColors(ColorEnum.Dark);
|
|
144
146
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
147
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
148
|
+
let height: string | undefined = undefined;
|
|
149
|
+
let minHeight: string | undefined = undefined;
|
|
150
|
+
if (!props.autoGrow) {
|
|
151
|
+
const base = isMobileSized.value ? 30 : 42;
|
|
152
|
+
const row = isMobileSized.value ? 16 : 20;
|
|
153
|
+
minHeight = `${base}px`;
|
|
154
|
+
if (props.rows > 1) {
|
|
155
|
+
height = `${base + (props.rows - 1) * row}px`;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
height = `${base}px`;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (!props.editable) {
|
|
162
|
+
return {
|
|
163
|
+
"--fs-text-area-cursor" : "default",
|
|
164
|
+
"--fs-text-area-border-color" : lights.base,
|
|
165
|
+
"--fs-text-area-color" : lights.dark,
|
|
166
|
+
"--fs-text-area-active-border-color": lights.base,
|
|
167
|
+
"--fs-text-area-min-height" : minHeight,
|
|
168
|
+
"--fs-text-area-height" : height
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
"--fs-text-area-cursor" : "text",
|
|
173
|
+
"--fs-text-area-border-color" : lights.dark,
|
|
174
|
+
"--fs-text-area-color" : darks.base,
|
|
175
|
+
"--fs-text-area-active-border-color": darks.dark,
|
|
176
|
+
"--fs-text-area-error-color" : errors.base,
|
|
177
|
+
"--fs-text-area-error-border-color" : errors.base,
|
|
178
|
+
"--fs-text-area-min-height" : minHeight,
|
|
179
|
+
"--fs-text-area-height" : height
|
|
180
|
+
};
|
|
181
|
+
});
|
|
180
182
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
183
|
+
const messages = computed(() => {
|
|
184
|
+
const messages = [];
|
|
185
|
+
for (const rule of props.rules) {
|
|
186
|
+
const message = rule(props.modelValue);
|
|
187
|
+
if (typeof(message) === "string") {
|
|
188
|
+
messages.push(message);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return messages;
|
|
192
|
+
});
|
|
191
193
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
const classes = computed((): string[] => {
|
|
195
|
+
const classNames = ["fs-text-area"];
|
|
196
|
+
if (props.autoGrow) {
|
|
197
|
+
classNames.push("fs-text-area-auto-grow");
|
|
198
|
+
}
|
|
199
|
+
return classNames;
|
|
200
|
+
});
|
|
199
201
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
202
|
+
return {
|
|
203
|
+
messages,
|
|
204
|
+
style,
|
|
205
|
+
classes
|
|
206
|
+
};
|
|
207
|
+
}
|
|
206
208
|
});
|
|
207
209
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSCol>
|
|
3
|
-
<slot name="label">
|
|
3
|
+
<slot v-if="!$props.hideHeader" name="label">
|
|
4
4
|
<FSRow :wrap="false">
|
|
5
5
|
<FSSpan
|
|
6
6
|
v-if="$props.label"
|
|
@@ -33,12 +33,14 @@
|
|
|
33
33
|
</slot>
|
|
34
34
|
<v-text-field
|
|
35
35
|
class="fs-text-field"
|
|
36
|
+
clearIcon="mdi-close"
|
|
36
37
|
variant="outlined"
|
|
37
38
|
hide-details
|
|
38
39
|
:style="style"
|
|
39
40
|
:type="$props.type"
|
|
40
41
|
:rules="$props.rules"
|
|
41
42
|
:readonly="!$props.editable"
|
|
43
|
+
:clearable="$props.editable"
|
|
42
44
|
:modelValue="$props.modelValue"
|
|
43
45
|
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
44
46
|
v-bind="$attrs"
|
|
@@ -61,10 +63,10 @@
|
|
|
61
63
|
</template>
|
|
62
64
|
|
|
63
65
|
<script lang="ts">
|
|
64
|
-
import { computed, defineComponent, PropType
|
|
66
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
65
67
|
|
|
66
|
-
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
67
|
-
import {
|
|
68
|
+
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
69
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
68
70
|
|
|
69
71
|
import FSSpan from "./FSSpan.vue";
|
|
70
72
|
import FSCol from "./FSCol.vue";
|
|
@@ -81,7 +83,7 @@ export default defineComponent({
|
|
|
81
83
|
props: {
|
|
82
84
|
label: {
|
|
83
85
|
type: String,
|
|
84
|
-
required:
|
|
86
|
+
required: false,
|
|
85
87
|
default: null
|
|
86
88
|
},
|
|
87
89
|
description: {
|
|
@@ -99,10 +101,10 @@ export default defineComponent({
|
|
|
99
101
|
required: false,
|
|
100
102
|
default: null
|
|
101
103
|
},
|
|
102
|
-
|
|
103
|
-
type:
|
|
104
|
+
hideHeader: {
|
|
105
|
+
type: Boolean,
|
|
104
106
|
required: false,
|
|
105
|
-
default:
|
|
107
|
+
default: false
|
|
106
108
|
},
|
|
107
109
|
required: {
|
|
108
110
|
type: Boolean,
|
|
@@ -122,20 +124,16 @@ export default defineComponent({
|
|
|
122
124
|
},
|
|
123
125
|
emits: ["update:modelValue"],
|
|
124
126
|
setup(props) {
|
|
125
|
-
const {
|
|
126
|
-
|
|
127
|
-
const slots = { ...useSlots() };
|
|
127
|
+
const { slots } = useSlots();
|
|
128
128
|
delete slots.label;
|
|
129
129
|
delete slots.description;
|
|
130
130
|
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
const lights = useColors().getColors(ColorBase.Light);
|
|
135
|
-
const darks = useColors().getColors(ColorBase.Dark);
|
|
131
|
+
const errors = useColors().getColors(ColorEnum.Error);
|
|
132
|
+
const lights = useColors().getColors(ColorEnum.Light);
|
|
133
|
+
const darks = useColors().getColors(ColorEnum.Dark);
|
|
136
134
|
|
|
137
135
|
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
138
|
-
if (!editable
|
|
136
|
+
if (!props.editable) {
|
|
139
137
|
return {
|
|
140
138
|
"--fs-text-field-cursor" : "default",
|
|
141
139
|
"--fs-text-field-border-color" : lights.base,
|
|
@@ -145,9 +143,9 @@ export default defineComponent({
|
|
|
145
143
|
}
|
|
146
144
|
return {
|
|
147
145
|
"--fs-text-field-cursor" : "text",
|
|
148
|
-
"--fs-text-field-border-color" :
|
|
146
|
+
"--fs-text-field-border-color" : lights.dark,
|
|
149
147
|
"--fs-text-field-color" : darks.base,
|
|
150
|
-
"--fs-text-field-active-border-color":
|
|
148
|
+
"--fs-text-field-active-border-color": darks.dark,
|
|
151
149
|
"--fs-text-field-error-color" : errors.base,
|
|
152
150
|
"--fs-text-field-error-border-color" : errors.base
|
|
153
151
|
};
|
|
@@ -155,7 +153,7 @@ export default defineComponent({
|
|
|
155
153
|
|
|
156
154
|
const messages = computed((): string[] => {
|
|
157
155
|
const messages = [];
|
|
158
|
-
for (const rule of rules
|
|
156
|
+
for (const rule of props.rules) {
|
|
159
157
|
const message = rule(props.modelValue ?? "");
|
|
160
158
|
if (typeof(message) === "string") {
|
|
161
159
|
messages.push(message);
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCard
|
|
3
|
+
class="fs-tile"
|
|
4
|
+
padding="12px"
|
|
5
|
+
:style="style"
|
|
6
|
+
:width="width"
|
|
7
|
+
:height="height"
|
|
8
|
+
>
|
|
9
|
+
<slot />
|
|
10
|
+
<FSContainer
|
|
11
|
+
v-if="$props.editable"
|
|
12
|
+
class="fs-tile-checkbox"
|
|
13
|
+
:border="false"
|
|
14
|
+
>
|
|
15
|
+
<FSCheckbox
|
|
16
|
+
:color="ColorEnum.Dark"
|
|
17
|
+
:modelValue="$props.modelValue"
|
|
18
|
+
@update:modelValue="() => $emit('update:modelValue', !$props.modelValue)"
|
|
19
|
+
/>
|
|
20
|
+
</FSContainer>
|
|
21
|
+
<div
|
|
22
|
+
class="fs-tile-bottom"
|
|
23
|
+
:style="style"
|
|
24
|
+
/>
|
|
25
|
+
</FSCard>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
30
|
+
|
|
31
|
+
import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
32
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
33
|
+
|
|
34
|
+
import FSContainer from "./FSContainer.vue";
|
|
35
|
+
import FSCheckbox from "./FSCheckbox.vue";
|
|
36
|
+
import FSCard from "./FSCard.vue";
|
|
37
|
+
|
|
38
|
+
export default defineComponent({
|
|
39
|
+
name: "FSTile",
|
|
40
|
+
components: {
|
|
41
|
+
FSContainer,
|
|
42
|
+
FSCheckbox,
|
|
43
|
+
FSCard
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
modelValue: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
required: false,
|
|
49
|
+
default: false
|
|
50
|
+
},
|
|
51
|
+
bottomColor: {
|
|
52
|
+
type: [Array, String] as PropType<ColorBase[] | ColorBase>,
|
|
53
|
+
required: false,
|
|
54
|
+
default: ColorEnum.Primary
|
|
55
|
+
},
|
|
56
|
+
editable: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
required: false,
|
|
59
|
+
default: false
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
emits: ["update:modelValue"],
|
|
63
|
+
setup(props) {
|
|
64
|
+
const { isMobileSized } = useBreakpoints();
|
|
65
|
+
|
|
66
|
+
const bottomColors = computed(() => useColors().getGradients(props.bottomColor));
|
|
67
|
+
|
|
68
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
69
|
+
return {
|
|
70
|
+
"--fs-tile-border-color": bottomColors.value.base
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const width = computed(() => {
|
|
75
|
+
return isMobileSized.value ? 336 : 352;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const height = computed(() => {
|
|
79
|
+
return isMobileSized.value ? 156 : 170;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
ColorEnum,
|
|
84
|
+
style,
|
|
85
|
+
width,
|
|
86
|
+
height
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
</script>
|