@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,73 +1,71 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
<FSCol width="hug">
|
|
3
|
+
<FSRadio
|
|
4
|
+
v-for="item in $props.values"
|
|
5
|
+
:key="item.value"
|
|
6
|
+
:label="item.label"
|
|
7
|
+
:description="item.description"
|
|
8
|
+
:selected="isSelected(item.value)"
|
|
9
|
+
:color="$props.color"
|
|
10
|
+
:editable="$props.editable"
|
|
11
|
+
:modelValue="item.value"
|
|
12
|
+
@update:modelValue="onToggle"
|
|
13
|
+
/>
|
|
14
|
+
</FSCol>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script lang="ts">
|
|
18
|
-
import { defineComponent, PropType
|
|
18
|
+
import { defineComponent, PropType } from "vue";
|
|
19
19
|
|
|
20
|
-
import { ColorBase } from "@dative-gpi/foundation-shared-components/
|
|
20
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
21
21
|
|
|
22
22
|
import FSRadio from "./FSRadio.vue";
|
|
23
23
|
import FSCol from "./FSCol.vue";
|
|
24
24
|
|
|
25
25
|
export default defineComponent({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
name: "FSRadioGroup",
|
|
27
|
+
components: {
|
|
28
|
+
FSRadio,
|
|
29
|
+
FSCol
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
values: {
|
|
33
|
+
type: Array as PropType<{ value: String | Boolean | Number, label?: String, description?: string }[]>,
|
|
34
|
+
required: true,
|
|
35
|
+
default: false
|
|
30
36
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
default: false
|
|
36
|
-
},
|
|
37
|
-
modelValue: {
|
|
38
|
-
type: [String, Boolean, Number],
|
|
39
|
-
required: false,
|
|
40
|
-
default: 0
|
|
41
|
-
},
|
|
42
|
-
color: {
|
|
43
|
-
type: String as PropType<ColorBase>,
|
|
44
|
-
required: false,
|
|
45
|
-
default: ColorBase.Primary
|
|
46
|
-
},
|
|
47
|
-
editable: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
required: false,
|
|
50
|
-
default: true
|
|
51
|
-
}
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: [String, Boolean, Number],
|
|
39
|
+
required: false,
|
|
40
|
+
default: 0
|
|
52
41
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
color: {
|
|
43
|
+
type: String as PropType<ColorBase>,
|
|
44
|
+
required: false,
|
|
45
|
+
default: ColorEnum.Primary
|
|
46
|
+
},
|
|
47
|
+
editable: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
required: false,
|
|
50
|
+
default: true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
emits: ["update:modelValue"],
|
|
54
|
+
setup(props, { emit }) {
|
|
55
|
+
const isSelected = (item: String | Boolean | Number): boolean => {
|
|
56
|
+
return item == props.modelValue;
|
|
57
|
+
};
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
const onToggle = (item: String | Boolean | Number): void => {
|
|
60
|
+
if (item != props.modelValue) {
|
|
61
|
+
emit("update:modelValue", item);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
return {
|
|
66
|
+
isSelected,
|
|
67
|
+
onToggle
|
|
68
|
+
};
|
|
69
|
+
}
|
|
72
70
|
});
|
|
73
71
|
</script>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSSubmitDialog
|
|
3
|
+
:rightButtonLabel="$tr('ui.button.remove', 'Remove')"
|
|
4
|
+
:rightButtonColor="ColorEnum.Error"
|
|
5
|
+
:title="title"
|
|
6
|
+
:modelValue="$props.modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
>
|
|
10
|
+
<template #body>
|
|
11
|
+
<FSCol
|
|
12
|
+
gap="16px"
|
|
13
|
+
>
|
|
14
|
+
<FSRow>
|
|
15
|
+
<FSIcon
|
|
16
|
+
:color="ColorEnum.Error"
|
|
17
|
+
>
|
|
18
|
+
mdi-alert-outline
|
|
19
|
+
</FSIcon>
|
|
20
|
+
<FSRow
|
|
21
|
+
gap="2px"
|
|
22
|
+
>
|
|
23
|
+
<FSSpan>
|
|
24
|
+
{{ $tr("ui.remove-dialog.body-regular", "This action is") }}
|
|
25
|
+
</FSSpan>
|
|
26
|
+
<FSSpan
|
|
27
|
+
font="text-button"
|
|
28
|
+
>
|
|
29
|
+
{{ $tr("ui.remove-dialog.body-bold", "definitive") }}
|
|
30
|
+
</FSSpan>
|
|
31
|
+
</FSRow>
|
|
32
|
+
</FSRow>
|
|
33
|
+
<FSSpan>
|
|
34
|
+
{{ $tr("ui.remove-dialog.final-warning", "Once removed, entities won't be retrievable") }}
|
|
35
|
+
</FSSpan>
|
|
36
|
+
</FSCol>
|
|
37
|
+
</template>
|
|
38
|
+
<template #footer v-if="$props.removing">
|
|
39
|
+
<FSRow
|
|
40
|
+
align="center-right"
|
|
41
|
+
:height="footerHeight"
|
|
42
|
+
>
|
|
43
|
+
<FSSpan>
|
|
44
|
+
{{ $props.removeCurrent }} / {{ $props.removeTotal }}
|
|
45
|
+
</FSSpan>
|
|
46
|
+
<v-progress-circular
|
|
47
|
+
:color="ColorEnum.Dark"
|
|
48
|
+
:indeterminate="true"
|
|
49
|
+
/>
|
|
50
|
+
</FSRow>
|
|
51
|
+
</template>
|
|
52
|
+
</FSSubmitDialog>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script lang="ts">
|
|
56
|
+
import { computed, defineComponent } from "vue";
|
|
57
|
+
|
|
58
|
+
import { useTranslationsProvider } from "@dative-gpi/foundation-shared-services/composables";
|
|
59
|
+
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
60
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
61
|
+
|
|
62
|
+
import FSSubmitDialog from "./FSSubmitDialog.vue";
|
|
63
|
+
import FSIcon from "./FSIcon.vue";
|
|
64
|
+
import FSSpan from "./FSSpan.vue";
|
|
65
|
+
import FSCol from "./FSCol.vue";
|
|
66
|
+
import FSRow from "./FSRow.vue";
|
|
67
|
+
|
|
68
|
+
export default defineComponent({
|
|
69
|
+
name: "FSRemoveDialog",
|
|
70
|
+
components: {
|
|
71
|
+
FSSubmitDialog,
|
|
72
|
+
FSIcon,
|
|
73
|
+
FSSpan,
|
|
74
|
+
FSCol,
|
|
75
|
+
FSRow
|
|
76
|
+
},
|
|
77
|
+
props: {
|
|
78
|
+
modelValue: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
required: false,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
removing: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
required: false,
|
|
86
|
+
default: false
|
|
87
|
+
},
|
|
88
|
+
removeTotal: {
|
|
89
|
+
type: Number,
|
|
90
|
+
required: true
|
|
91
|
+
},
|
|
92
|
+
removeCurrent: {
|
|
93
|
+
type: Number,
|
|
94
|
+
required: false,
|
|
95
|
+
default: 0
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
emits: ["update:modelValue"],
|
|
99
|
+
setup(props) {
|
|
100
|
+
const { isMobileSized } = useBreakpoints();
|
|
101
|
+
const { $tr } = useTranslationsProvider();
|
|
102
|
+
|
|
103
|
+
const title = computed((): string => {
|
|
104
|
+
if (props.removeTotal > 1) {
|
|
105
|
+
return $tr("ui.remove-dialog.remove-plural", "Remove {0} entities", props.removeTotal.toString());
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return $tr("ui.remove-dialog.remove-singular", "Remove an entity");
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const footerHeight = computed((): string => {
|
|
113
|
+
return isMobileSized.value ? "36px" : "40px";
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
ColorEnum,
|
|
118
|
+
footerHeight,
|
|
119
|
+
title
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
</script>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</FSRow>
|
|
25
25
|
</slot>
|
|
26
26
|
<v-spacer />
|
|
27
|
-
<template v-if="editable">
|
|
27
|
+
<template v-if="$props.editable">
|
|
28
28
|
<FSIcon
|
|
29
29
|
class="fs-rich-text-field-icon"
|
|
30
30
|
:color="toolbarColors.undo"
|
|
@@ -141,8 +141,9 @@
|
|
|
141
141
|
:contenteditable="!readonly && $props.editable"
|
|
142
142
|
/>
|
|
143
143
|
<FSTextField
|
|
144
|
-
v-if="isLink && editable"
|
|
144
|
+
v-if="isLink && $props.editable"
|
|
145
145
|
v-model="linkUrl"
|
|
146
|
+
:hideHeader="true"
|
|
146
147
|
@keypress.enter.stop="toggleLink"
|
|
147
148
|
/>
|
|
148
149
|
<slot name="description">
|
|
@@ -161,14 +162,14 @@
|
|
|
161
162
|
<script lang="ts">
|
|
162
163
|
import { $createParagraphNode, $getSelection, $isElementNode, $isRangeSelection, $setSelection, CAN_UNDO_COMMAND, createEditor, ElementNode, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, ParagraphNode, UNDO_COMMAND } from "lexical";
|
|
163
164
|
import { $createHeadingNode, HeadingNode, HeadingTagType, registerRichText } from "@lexical/rich-text";
|
|
164
|
-
import { computed, defineComponent, onMounted, PropType, ref, toRefs } from "vue";
|
|
165
165
|
import { createEmptyHistoryState, registerHistory } from "@lexical/history";
|
|
166
|
+
import { computed, defineComponent, onMounted, PropType, ref } from "vue";
|
|
166
167
|
import { $createLinkNode, $isLinkNode, LinkNode } from "@lexical/link";
|
|
167
168
|
import { $wrapNodes } from "@lexical/selection";
|
|
168
169
|
|
|
169
170
|
import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
170
171
|
import { getAncestor, getSelectedNode } from "@dative-gpi/foundation-shared-components/utils";
|
|
171
|
-
import { ColorBase } from "@dative-gpi/foundation-shared-components/
|
|
172
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
172
173
|
|
|
173
174
|
import FSTextField from "./FSTextField.vue";
|
|
174
175
|
import FSIcon from "./FSIcon.vue";
|
|
@@ -186,7 +187,7 @@ export default defineComponent({
|
|
|
186
187
|
props: {
|
|
187
188
|
label: {
|
|
188
189
|
type: String,
|
|
189
|
-
required:
|
|
190
|
+
required: false,
|
|
190
191
|
default: null
|
|
191
192
|
},
|
|
192
193
|
description: {
|
|
@@ -199,15 +200,10 @@ export default defineComponent({
|
|
|
199
200
|
required: false,
|
|
200
201
|
default: null
|
|
201
202
|
},
|
|
202
|
-
color: {
|
|
203
|
-
type: String as PropType<ColorBase>,
|
|
204
|
-
required: false,
|
|
205
|
-
default: ColorBase.Dark
|
|
206
|
-
},
|
|
207
203
|
linkColor: {
|
|
208
204
|
type: String as PropType<ColorBase>,
|
|
209
205
|
required: false,
|
|
210
|
-
default:
|
|
206
|
+
default: ColorEnum.Primary
|
|
211
207
|
},
|
|
212
208
|
required: {
|
|
213
209
|
type: Boolean,
|
|
@@ -232,13 +228,11 @@ export default defineComponent({
|
|
|
232
228
|
},
|
|
233
229
|
emits: ["update:modelValue"],
|
|
234
230
|
setup(props, { emit }) {
|
|
235
|
-
const {
|
|
236
|
-
|
|
237
|
-
const colors = useColors().getColors(color.value);
|
|
238
|
-
const linkColors = useColors().getColors(linkColor.value);
|
|
231
|
+
const { isMobileSized } = useBreakpoints();
|
|
239
232
|
|
|
240
|
-
const
|
|
241
|
-
const
|
|
233
|
+
const linkColors = computed(()=> useColors().getColors(props.linkColor));
|
|
234
|
+
const lights = useColors().getColors(ColorEnum.Light);
|
|
235
|
+
const darks = useColors().getColors(ColorEnum.Dark);
|
|
242
236
|
|
|
243
237
|
const canUndo = ref(false);
|
|
244
238
|
const isLink = ref(false);
|
|
@@ -285,38 +279,38 @@ export default defineComponent({
|
|
|
285
279
|
registerRichText(editor);
|
|
286
280
|
registerHistory(editor, createEmptyHistoryState(), 250);
|
|
287
281
|
|
|
288
|
-
if (modelValue
|
|
282
|
+
if (props.modelValue != null) {
|
|
289
283
|
editor.update((): void => {
|
|
290
|
-
editor.setEditorState(editor.parseEditorState(modelValue
|
|
284
|
+
editor.setEditorState(editor.parseEditorState(props.modelValue));
|
|
291
285
|
});
|
|
292
286
|
}
|
|
293
287
|
});
|
|
294
288
|
|
|
295
289
|
const readonly = computed((): boolean => {
|
|
296
|
-
return variant
|
|
290
|
+
return props.variant === "readonly";
|
|
297
291
|
});
|
|
298
292
|
|
|
299
293
|
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
300
294
|
let minHeight: string | undefined = undefined;
|
|
301
|
-
const base =
|
|
302
|
-
const row =
|
|
303
|
-
if (rows
|
|
304
|
-
minHeight = `${base + (rows
|
|
295
|
+
const base = isMobileSized.value ? 30 : 42;
|
|
296
|
+
const row = isMobileSized.value ? 16 : 20;
|
|
297
|
+
if (props.rows > 1) {
|
|
298
|
+
minHeight = `${base + (props.rows - 1) * row}px`;
|
|
305
299
|
}
|
|
306
300
|
else {
|
|
307
301
|
minHeight = `${base}px`;
|
|
308
302
|
}
|
|
309
303
|
|
|
310
|
-
switch (variant
|
|
304
|
+
switch (props.variant) {
|
|
311
305
|
case "standard": {
|
|
312
|
-
if (!editable
|
|
306
|
+
if (!props.editable) {
|
|
313
307
|
return {
|
|
314
308
|
"--fs-rich-text-field-undo-cursor" : "default",
|
|
315
309
|
"--fs-rich-text-field-icon-cursor" : "default",
|
|
316
310
|
"--fs-rich-text-field-border-color" : lights.base,
|
|
317
311
|
"--fs-rich-text-field-color" : lights.dark,
|
|
318
312
|
"--fs-rich-text-field-active-border-color": lights.base,
|
|
319
|
-
"--fs-rich-text-field-link-color" : linkColors.light,
|
|
313
|
+
"--fs-rich-text-field-link-color" : linkColors.value.light,
|
|
320
314
|
"--fs-rich-text-field-min-height" : minHeight
|
|
321
315
|
};
|
|
322
316
|
}
|
|
@@ -324,10 +318,10 @@ export default defineComponent({
|
|
|
324
318
|
return {
|
|
325
319
|
"--fs-rich-text-field-undo-cursor" : canUndo ? "pointer" : "default",
|
|
326
320
|
"--fs-rich-text-field-icon-cursor" : "pointer",
|
|
327
|
-
"--fs-rich-text-field-border-color" :
|
|
321
|
+
"--fs-rich-text-field-border-color" : lights.dark,
|
|
328
322
|
"--fs-rich-text-field-color" : darks.base,
|
|
329
|
-
"--fs-rich-text-field-active-border-color":
|
|
330
|
-
"--fs-rich-text-field-link-color" : linkColors.dark,
|
|
323
|
+
"--fs-rich-text-field-active-border-color": darks.dark,
|
|
324
|
+
"--fs-rich-text-field-link-color" : linkColors.value.dark,
|
|
331
325
|
"--fs-rich-text-field-min-height" : minHeight
|
|
332
326
|
};
|
|
333
327
|
}
|
|
@@ -336,14 +330,14 @@ export default defineComponent({
|
|
|
336
330
|
"--fs-rich-text-field-border-color" : "transparent",
|
|
337
331
|
"--fs-rich-text-field-color" : darks.base,
|
|
338
332
|
"--fs-rich-text-field-active-border-color": "transparent",
|
|
339
|
-
"--fs-rich-text-field-link-color" : linkColors.dark,
|
|
333
|
+
"--fs-rich-text-field-link-color" : linkColors.value.dark,
|
|
340
334
|
"--fs-rich-text-field-min-height" : minHeight
|
|
341
335
|
}
|
|
342
336
|
}
|
|
343
337
|
});
|
|
344
338
|
|
|
345
339
|
const toolbarColors = computed((): {[code: string]: string} => {
|
|
346
|
-
if (editable
|
|
340
|
+
if (props.editable) {
|
|
347
341
|
return {
|
|
348
342
|
undo: canUndo.value ? darks.base : lights.base,
|
|
349
343
|
bold: isBold.value ? darks.base : lights.base,
|
|
@@ -538,7 +532,6 @@ export default defineComponent({
|
|
|
538
532
|
|
|
539
533
|
return {
|
|
540
534
|
readonly,
|
|
541
|
-
editable,
|
|
542
535
|
style,
|
|
543
536
|
id,
|
|
544
537
|
editor,
|
package/components/FSRow.vue
CHANGED
|
@@ -1,115 +1,121 @@
|
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
gap: {
|
|
38
|
-
type: Number,
|
|
39
|
-
required: false,
|
|
40
|
-
default: 8
|
|
41
|
-
}
|
|
17
|
+
name: "FSRow",
|
|
18
|
+
props: {
|
|
19
|
+
width: {
|
|
20
|
+
type: String as PropType<"hug" | "fill" | string>,
|
|
21
|
+
required: false,
|
|
22
|
+
default: "fill"
|
|
23
|
+
},
|
|
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
|
+
wrap: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
required: false,
|
|
37
|
+
default: true
|
|
42
38
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
padding: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
required: false,
|
|
42
|
+
default: "0"
|
|
43
|
+
},
|
|
44
|
+
gap: {
|
|
45
|
+
type: [String, Number],
|
|
46
|
+
required: false,
|
|
47
|
+
default: "8px"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
setup(props) {
|
|
51
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => ({
|
|
52
|
+
"--fs-row-flex-wrap": props.wrap ? "wrap" : "nowrap",
|
|
53
|
+
"--fs-row-padding" : sizeToVar(props.padding),
|
|
54
|
+
"--fs-row-gap" : sizeToVar(props.gap),
|
|
55
|
+
"--fs-row-width" : sizeToVar(props.width),
|
|
56
|
+
"--fs-row-height" : sizeToVar(props.height)
|
|
57
|
+
}));
|
|
52
58
|
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
59
|
+
const classes = computed((): string[] => {
|
|
60
|
+
const classNames = ["fs-row"];
|
|
61
|
+
switch (props.width) {
|
|
62
|
+
case "hug":
|
|
63
|
+
classNames.push("fs-row-width-hug");
|
|
64
|
+
break;
|
|
65
|
+
case "fill":
|
|
66
|
+
classNames.push("fs-row-width-fill");
|
|
67
|
+
break;
|
|
68
|
+
default:
|
|
69
|
+
classNames.push("fs-row-width-fixed");
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
switch (props.height) {
|
|
73
|
+
case "hug":
|
|
74
|
+
classNames.push("fs-row-height-hug");
|
|
75
|
+
break;
|
|
76
|
+
case "fill":
|
|
77
|
+
classNames.push("fs-row-height-fill");
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
classNames.push("fs-row-height-fixed");
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
switch (props.align) {
|
|
84
|
+
case "top-left":
|
|
85
|
+
classNames.push("fs-row-top-left");
|
|
86
|
+
break;
|
|
87
|
+
case "top-center":
|
|
88
|
+
classNames.push("fs-row-top-center");
|
|
89
|
+
break;
|
|
90
|
+
case "top-right":
|
|
91
|
+
classNames.push("fs-row-top-right");
|
|
92
|
+
break;
|
|
93
|
+
case "center-left":
|
|
94
|
+
classNames.push("fs-row-center-left");
|
|
95
|
+
break;
|
|
96
|
+
case "center-center":
|
|
97
|
+
classNames.push("fs-row-center-center");
|
|
98
|
+
break;
|
|
99
|
+
case "center-right":
|
|
100
|
+
classNames.push("fs-row-center-right");
|
|
101
|
+
break;
|
|
102
|
+
case "bottom-left":
|
|
103
|
+
classNames.push("fs-row-bottom-left");
|
|
104
|
+
break;
|
|
105
|
+
case "bottom-center":
|
|
106
|
+
classNames.push("fs-row-bottom-center");
|
|
107
|
+
break;
|
|
108
|
+
case "bottom-right":
|
|
109
|
+
classNames.push("fs-row-bottom-right");
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
return classNames;
|
|
113
|
+
});
|
|
108
114
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
return {
|
|
116
|
+
style,
|
|
117
|
+
classes
|
|
118
|
+
};
|
|
119
|
+
}
|
|
114
120
|
});
|
|
115
121
|
</script>
|