@dative-gpi/foundation-shared-components 0.0.87 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/FSButton.vue +23 -7
- package/components/FSCalendar.vue +3 -1
- package/components/FSCalendarTwin.vue +16 -6
- package/components/FSCard.vue +9 -3
- package/components/FSCheckbox.vue +6 -2
- package/components/FSClickable.vue +33 -9
- package/components/FSDialog.vue +9 -5
- package/components/FSDialogMenu.vue +80 -0
- package/components/FSDialogSubmit.vue +0 -1
- package/components/FSEditImage.vue +196 -34
- package/components/FSImage.vue +21 -7
- package/components/FSLink.vue +4 -2
- package/components/FSOptionGroup.vue +61 -72
- package/components/FSOptionItem.vue +22 -7
- package/components/FSRadioGroup.vue +11 -3
- package/components/FSToggleSet.vue +22 -60
- package/components/FSWindow.vue +2 -0
- package/components/autocompletes/FSAutocompleteLanguage.vue +28 -22
- package/components/autocompletes/FSAutocompleteTimeZone.vue +117 -17
- package/components/buttons/FSButtonFileMini.vue +6 -1
- package/components/fields/FSAutocompleteField.vue +139 -72
- package/components/fields/FSBaseField.vue +134 -0
- package/components/fields/FSColorField.vue +1 -1
- package/components/fields/FSDateField.vue +124 -35
- package/components/fields/FSDateTimeField.vue +171 -63
- package/components/fields/FSIconField.vue +4 -2
- package/components/fields/FSNumberField.vue +9 -3
- package/components/fields/FSPasswordField.vue +15 -5
- package/components/fields/FSRichTextField.vue +34 -18
- package/components/fields/FSSearchField.vue +24 -8
- package/components/fields/FSSelectField.vue +254 -93
- package/components/fields/FSTagField.vue +15 -9
- package/components/fields/FSTextArea.vue +31 -59
- package/components/fields/FSTextField.vue +22 -70
- package/components/fields/FSTimeField.vue +20 -55
- package/components/fields/FSTimeSlotField.vue +13 -59
- package/components/lists/FSDataIteratorItem.vue +16 -4
- package/components/lists/FSDataTableUI.vue +433 -181
- package/components/lists/FSDraggable.vue +26 -13
- package/components/lists/FSFilterButton.vue +10 -4
- package/components/lists/FSHeaderButton.vue +3 -1
- package/components/lists/FSHiddenButton.vue +3 -1
- package/composables/useAutocomplete.ts +6 -7
- package/composables/useSlots.ts +6 -18
- package/package.json +4 -4
- package/styles/components/fs_base_field.scss +12 -0
- package/styles/components/fs_dialog.scss +10 -2
- package/styles/components/fs_dialog_menu.scss +11 -0
- package/styles/components/fs_draggable.scss +12 -0
- package/styles/components/fs_edit_image.scss +29 -2
- package/styles/components/fs_text_area.scss +0 -13
- package/styles/components/fs_text_field.scss +1 -14
- package/styles/components/index.scss +2 -0
- package/styles/globals/overrides.scss +4 -0
- package/components/autocompletes/FSAutocompleteOrganisation.vue +0 -77
package/components/FSButton.vue
CHANGED
|
@@ -19,7 +19,10 @@
|
|
|
19
19
|
width="fill"
|
|
20
20
|
:wrap="false"
|
|
21
21
|
>
|
|
22
|
-
<slot
|
|
22
|
+
<slot
|
|
23
|
+
name="prepend"
|
|
24
|
+
v-bind="{ color: $props.color, colors }"
|
|
25
|
+
>
|
|
23
26
|
<FSIcon
|
|
24
27
|
v-if="$props.prependIcon || $props.icon"
|
|
25
28
|
size="l"
|
|
@@ -27,14 +30,19 @@
|
|
|
27
30
|
{{ $props.prependIcon ?? $props.icon }}
|
|
28
31
|
</FSIcon>
|
|
29
32
|
</slot>
|
|
30
|
-
<slot
|
|
33
|
+
<slot
|
|
34
|
+
v-bind="{ color: $props.color, colors }"
|
|
35
|
+
>
|
|
31
36
|
<FSSpan
|
|
32
37
|
v-if="$props.label"
|
|
33
38
|
>
|
|
34
39
|
{{ $props.label }}
|
|
35
40
|
</FSSpan>
|
|
36
41
|
</slot>
|
|
37
|
-
<slot
|
|
42
|
+
<slot
|
|
43
|
+
name="append"
|
|
44
|
+
v-bind="{ color: $props.color, colors }"
|
|
45
|
+
>
|
|
38
46
|
<FSIcon
|
|
39
47
|
v-if="$props.appendIcon"
|
|
40
48
|
size="l"
|
|
@@ -52,7 +60,9 @@
|
|
|
52
60
|
@click.stop="onClick"
|
|
53
61
|
v-bind="$attrs"
|
|
54
62
|
>
|
|
55
|
-
<template
|
|
63
|
+
<template
|
|
64
|
+
v-if="$props.load"
|
|
65
|
+
>
|
|
56
66
|
<v-progress-circular
|
|
57
67
|
class="fs-button-load"
|
|
58
68
|
width="2"
|
|
@@ -61,7 +71,9 @@
|
|
|
61
71
|
:color="loadColor"
|
|
62
72
|
/>
|
|
63
73
|
</template>
|
|
64
|
-
<template
|
|
74
|
+
<template
|
|
75
|
+
v-else-if="$props.href"
|
|
76
|
+
>
|
|
65
77
|
<a
|
|
66
78
|
:href="$props.href"
|
|
67
79
|
>
|
|
@@ -78,7 +90,9 @@
|
|
|
78
90
|
</FSSpan>
|
|
79
91
|
</a>
|
|
80
92
|
</template>
|
|
81
|
-
<template
|
|
93
|
+
<template
|
|
94
|
+
v-else-if="$props.to"
|
|
95
|
+
>
|
|
82
96
|
<router-link
|
|
83
97
|
:to="$props.to"
|
|
84
98
|
>
|
|
@@ -95,7 +109,9 @@
|
|
|
95
109
|
</FSSpan>
|
|
96
110
|
</router-link>
|
|
97
111
|
</template>
|
|
98
|
-
<template
|
|
112
|
+
<template
|
|
113
|
+
v-else
|
|
114
|
+
>
|
|
99
115
|
<FSIcon
|
|
100
116
|
v-if="$props.icon"
|
|
101
117
|
size="l"
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FSCol
|
|
2
|
+
<FSCol
|
|
3
|
+
width="hug"
|
|
4
|
+
>
|
|
3
5
|
<FSRow
|
|
4
6
|
v-if="$props.label"
|
|
5
7
|
>
|
|
@@ -12,10 +14,13 @@
|
|
|
12
14
|
</FSRow>
|
|
13
15
|
<FSRow
|
|
14
16
|
class="fs-calendar-twin"
|
|
17
|
+
align="center-center"
|
|
18
|
+
width="hug"
|
|
15
19
|
:style="style"
|
|
16
20
|
>
|
|
17
21
|
<FSCol
|
|
18
22
|
align="top-center"
|
|
23
|
+
width="hug"
|
|
19
24
|
:class="leftClasses"
|
|
20
25
|
:style="style"
|
|
21
26
|
>
|
|
@@ -42,7 +47,9 @@
|
|
|
42
47
|
class="fs-calendar-divider"
|
|
43
48
|
:style="style"
|
|
44
49
|
/>
|
|
45
|
-
<v-locale-provider
|
|
50
|
+
<v-locale-provider
|
|
51
|
+
:locale="languageCode"
|
|
52
|
+
>
|
|
46
53
|
<v-date-picker-month
|
|
47
54
|
:month="innerLeftMonth"
|
|
48
55
|
:year="innerLeftYear"
|
|
@@ -57,6 +64,7 @@
|
|
|
57
64
|
</FSCol>
|
|
58
65
|
<FSCol
|
|
59
66
|
align="top-center"
|
|
67
|
+
width="hug"
|
|
60
68
|
:class="rightClasses"
|
|
61
69
|
:style="style"
|
|
62
70
|
>
|
|
@@ -83,7 +91,9 @@
|
|
|
83
91
|
class="fs-calendar-divider"
|
|
84
92
|
:style="style"
|
|
85
93
|
/>
|
|
86
|
-
<v-locale-provider
|
|
94
|
+
<v-locale-provider
|
|
95
|
+
:locale="languageCode"
|
|
96
|
+
>
|
|
87
97
|
<v-date-picker-month
|
|
88
98
|
:month="innerRightMonth"
|
|
89
99
|
:year="innerRightYear"
|
|
@@ -193,21 +203,21 @@ export default defineComponent({
|
|
|
193
203
|
switch (side) {
|
|
194
204
|
case "left":
|
|
195
205
|
return innerLeftYear.value > date.y || (innerLeftYear.value === date.y && innerLeftMonth.value > date.m);
|
|
196
|
-
|
|
206
|
+
default:
|
|
197
207
|
return innerRightYear.value > date.y || (innerRightYear.value === date.y && innerRightMonth.value > date.m);
|
|
198
208
|
}
|
|
199
209
|
case "during":
|
|
200
210
|
switch (side) {
|
|
201
211
|
case "left":
|
|
202
212
|
return innerLeftYear.value === date.y && innerLeftMonth.value === date.m;
|
|
203
|
-
|
|
213
|
+
default:
|
|
204
214
|
return innerRightYear.value === date.y && innerRightMonth.value === date.m;
|
|
205
215
|
}
|
|
206
216
|
case "after":
|
|
207
217
|
switch (side) {
|
|
208
218
|
case "left":
|
|
209
219
|
return innerLeftYear.value < date.y || (innerLeftYear.value === date.y && innerLeftMonth.value < date.m);
|
|
210
|
-
|
|
220
|
+
default:
|
|
211
221
|
return innerRightYear.value < date.y || (innerRightYear.value === date.y && innerRightMonth.value < date.m);
|
|
212
222
|
}
|
|
213
223
|
}
|
package/components/FSCard.vue
CHANGED
|
@@ -10,17 +10,23 @@
|
|
|
10
10
|
<FSRow
|
|
11
11
|
v-if="$slots.header"
|
|
12
12
|
>
|
|
13
|
-
<slot
|
|
13
|
+
<slot
|
|
14
|
+
name="header"
|
|
15
|
+
/>
|
|
14
16
|
</FSRow>
|
|
15
17
|
<FSRow
|
|
16
18
|
v-if="$slots.body"
|
|
17
19
|
>
|
|
18
|
-
<slot
|
|
20
|
+
<slot
|
|
21
|
+
name="body"
|
|
22
|
+
/>
|
|
19
23
|
</FSRow>
|
|
20
24
|
<FSRow
|
|
21
25
|
v-if="$slots.footer"
|
|
22
26
|
>
|
|
23
|
-
<slot
|
|
27
|
+
<slot
|
|
28
|
+
name="footer"
|
|
29
|
+
/>
|
|
24
30
|
</FSRow>
|
|
25
31
|
</FSCol>
|
|
26
32
|
</slot>
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
@blur="blurred = true"
|
|
14
14
|
v-bind="$attrs"
|
|
15
15
|
>
|
|
16
|
-
<template
|
|
16
|
+
<template
|
|
17
|
+
#input
|
|
18
|
+
>
|
|
17
19
|
<FSRow
|
|
18
20
|
align="center-left"
|
|
19
21
|
width="hug"
|
|
@@ -39,7 +41,9 @@
|
|
|
39
41
|
</FSRow>
|
|
40
42
|
</template>
|
|
41
43
|
</v-checkbox>
|
|
42
|
-
<slot
|
|
44
|
+
<slot
|
|
45
|
+
name="description"
|
|
46
|
+
>
|
|
43
47
|
<FSSpan
|
|
44
48
|
v-if="$props.description"
|
|
45
49
|
class="fs-checkbox-description"
|
|
@@ -17,11 +17,19 @@
|
|
|
17
17
|
:style="style"
|
|
18
18
|
v-bind="$attrs"
|
|
19
19
|
>
|
|
20
|
-
<template
|
|
21
|
-
|
|
20
|
+
<template
|
|
21
|
+
v-for="(_, name) in $slots"
|
|
22
|
+
v-slot:[name]="slotData"
|
|
23
|
+
>
|
|
24
|
+
<slot
|
|
25
|
+
:name="name"
|
|
26
|
+
v-bind="{ ...slotData, contentVariant }"
|
|
27
|
+
/>
|
|
22
28
|
</template>
|
|
23
29
|
</FSCard>
|
|
24
|
-
<template
|
|
30
|
+
<template
|
|
31
|
+
v-if="$props.load"
|
|
32
|
+
>
|
|
25
33
|
<v-progress-circular
|
|
26
34
|
class="fs-clickable-load"
|
|
27
35
|
width="2"
|
|
@@ -49,11 +57,19 @@
|
|
|
49
57
|
:style="style"
|
|
50
58
|
v-bind="$attrs"
|
|
51
59
|
>
|
|
52
|
-
<template
|
|
53
|
-
|
|
60
|
+
<template
|
|
61
|
+
v-for="(_, name) in $slots"
|
|
62
|
+
v-slot:[name]="slotData"
|
|
63
|
+
>
|
|
64
|
+
<slot
|
|
65
|
+
:name="name"
|
|
66
|
+
v-bind="{ ...slotData, contentVariant }"
|
|
67
|
+
/>
|
|
54
68
|
</template>
|
|
55
69
|
</FSCard>
|
|
56
|
-
<template
|
|
70
|
+
<template
|
|
71
|
+
v-if="$props.load"
|
|
72
|
+
>
|
|
57
73
|
<v-progress-circular
|
|
58
74
|
class="fs-clickable-load"
|
|
59
75
|
width="2"
|
|
@@ -82,11 +98,19 @@
|
|
|
82
98
|
:style="style"
|
|
83
99
|
v-bind="$attrs"
|
|
84
100
|
>
|
|
85
|
-
<template
|
|
86
|
-
|
|
101
|
+
<template
|
|
102
|
+
v-for="(_, name) in $slots"
|
|
103
|
+
v-slot:[name]="slotData"
|
|
104
|
+
>
|
|
105
|
+
<slot
|
|
106
|
+
:name="name"
|
|
107
|
+
v-bind="{ ...slotData, contentVariant }"
|
|
108
|
+
/>
|
|
87
109
|
</template>
|
|
88
110
|
</FSCard>
|
|
89
|
-
<template
|
|
111
|
+
<template
|
|
112
|
+
v-if="$props.load"
|
|
113
|
+
>
|
|
90
114
|
<v-progress-circular
|
|
91
115
|
class="fs-clickable-load"
|
|
92
116
|
width="2"
|
package/components/FSDialog.vue
CHANGED
|
@@ -14,8 +14,14 @@
|
|
|
14
14
|
:color="$props.color"
|
|
15
15
|
:class="classes"
|
|
16
16
|
>
|
|
17
|
-
<template
|
|
18
|
-
|
|
17
|
+
<template
|
|
18
|
+
v-for="(_, name) in $slots"
|
|
19
|
+
v-slot:[name]="slotData"
|
|
20
|
+
>
|
|
21
|
+
<slot
|
|
22
|
+
:name="name"
|
|
23
|
+
v-bind="slotData"
|
|
24
|
+
/>
|
|
19
25
|
</template>
|
|
20
26
|
</FSCard>
|
|
21
27
|
<FSButton
|
|
@@ -37,14 +43,12 @@ import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
|
37
43
|
|
|
38
44
|
import FSButton from "./FSButton.vue";
|
|
39
45
|
import FSCard from "./FSCard.vue";
|
|
40
|
-
import FSCol from "./FSCol.vue";
|
|
41
46
|
|
|
42
47
|
export default defineComponent({
|
|
43
48
|
name: "FSDialog",
|
|
44
49
|
components: {
|
|
45
50
|
FSButton,
|
|
46
|
-
FSCard
|
|
47
|
-
FSCol
|
|
51
|
+
FSCard
|
|
48
52
|
},
|
|
49
53
|
props: {
|
|
50
54
|
width: {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-dialog
|
|
3
|
+
:modelValue="$props.modelValue"
|
|
4
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
>
|
|
7
|
+
<FSCard
|
|
8
|
+
padding="8px"
|
|
9
|
+
gap="24px"
|
|
10
|
+
:color="$props.color"
|
|
11
|
+
:class="classes"
|
|
12
|
+
>
|
|
13
|
+
<template
|
|
14
|
+
v-for="(_, name) in $slots"
|
|
15
|
+
v-slot:[name]="slotData"
|
|
16
|
+
>
|
|
17
|
+
<slot
|
|
18
|
+
:name="name"
|
|
19
|
+
v-bind="slotData"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
</FSCard>
|
|
23
|
+
</v-dialog>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
28
|
+
|
|
29
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
30
|
+
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
31
|
+
|
|
32
|
+
import FSCard from "./FSCard.vue";
|
|
33
|
+
|
|
34
|
+
export default defineComponent({
|
|
35
|
+
name: "FSDialogMenu",
|
|
36
|
+
components: {
|
|
37
|
+
FSCard
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
cardClasses: {
|
|
41
|
+
type: [Array, String] as PropType<string[] | string | null>,
|
|
42
|
+
required: false,
|
|
43
|
+
default: null
|
|
44
|
+
},
|
|
45
|
+
modelValue: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
required: false,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
color: {
|
|
51
|
+
type: String as PropType<ColorBase>,
|
|
52
|
+
required: false,
|
|
53
|
+
default: ColorEnum.Dark
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
emits: ["update:modelValue"],
|
|
57
|
+
setup(props) {
|
|
58
|
+
const { isExtraSmall } = useBreakpoints();
|
|
59
|
+
|
|
60
|
+
const classes = computed((): string[] => {
|
|
61
|
+
const classNames = ["fs-dialog-menu"];
|
|
62
|
+
if (props.cardClasses) {
|
|
63
|
+
if (Array.isArray(props.cardClasses)) {
|
|
64
|
+
classNames.push(...props.cardClasses);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
classNames.push(props.cardClasses);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return classNames;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
isExtraSmall,
|
|
75
|
+
ColorEnum,
|
|
76
|
+
classes
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
</script>
|
|
@@ -188,7 +188,6 @@ export default defineComponent({
|
|
|
188
188
|
+ (props.subtitle ? isMobileSized.value ? 14 + 8 : 16 + 8 : 0) // Subtitle
|
|
189
189
|
+ (isMobileSized.value ? 36 : 40) // Footer
|
|
190
190
|
+ 64; // Debug mask
|
|
191
|
-
console.log(document.documentElement.clientHeight, document.documentElement.clientHeight*0.9 - other);
|
|
192
191
|
return `calc(90vh - ${other}px)`;
|
|
193
192
|
});
|
|
194
193
|
|
|
@@ -1,52 +1,181 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
gap="24px"
|
|
2
|
+
<FSCol
|
|
3
|
+
gap="8px"
|
|
5
4
|
>
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
<slot
|
|
6
|
+
v-if="!$props.hideHeader"
|
|
7
|
+
name="label"
|
|
8
|
+
>
|
|
9
|
+
<FSRow
|
|
10
|
+
:wrap="false"
|
|
11
|
+
>
|
|
12
|
+
<FSSpan
|
|
13
|
+
v-if="$props.label"
|
|
14
|
+
class="fs-edit-image-label"
|
|
15
|
+
font="text-overline"
|
|
16
|
+
:style="style"
|
|
17
|
+
>
|
|
18
|
+
{{ $props.label }}
|
|
19
|
+
</FSSpan>
|
|
20
|
+
<FSSpan
|
|
21
|
+
v-if="$props.label && $props.required"
|
|
22
|
+
class="fs-edit-image-label"
|
|
23
|
+
style="margin-left: -8px;"
|
|
24
|
+
font="text-overline"
|
|
25
|
+
:ellipsis="false"
|
|
26
|
+
:style="style"
|
|
27
|
+
>
|
|
28
|
+
*
|
|
29
|
+
</FSSpan>
|
|
30
|
+
</FSRow>
|
|
31
|
+
</slot>
|
|
32
|
+
<FSCard
|
|
33
|
+
v-if="['standard'].includes($props.variant)"
|
|
34
|
+
padding="12px"
|
|
35
|
+
width="100%"
|
|
36
|
+
>
|
|
37
|
+
<FSRow
|
|
38
|
+
align="center-left"
|
|
39
|
+
:wrap="false"
|
|
40
|
+
>
|
|
41
|
+
<FSRow
|
|
42
|
+
gap="24px"
|
|
43
|
+
:wrap="false"
|
|
44
|
+
>
|
|
45
|
+
<FSImage
|
|
46
|
+
v-if="$props.imageId || realSource"
|
|
47
|
+
:aspectRatio="$props.aspectRatio"
|
|
48
|
+
:height="$props.height"
|
|
49
|
+
:width="$props.width"
|
|
50
|
+
:imageId="$props.imageId"
|
|
51
|
+
:imageB64="realSource"
|
|
52
|
+
/>
|
|
53
|
+
<FSCard
|
|
54
|
+
v-else
|
|
55
|
+
borderStyle="dashed"
|
|
56
|
+
:aspectRatio="$props.aspectRatio"
|
|
57
|
+
:height="$props.height"
|
|
58
|
+
:width="$props.width"
|
|
59
|
+
/>
|
|
60
|
+
<FSCol
|
|
61
|
+
align="center-left"
|
|
62
|
+
height="fill"
|
|
63
|
+
width="hug"
|
|
64
|
+
gap="10px"
|
|
65
|
+
>
|
|
66
|
+
<FSText
|
|
67
|
+
v-if="fileSelected && fileSelected.fileName"
|
|
68
|
+
lineClamp="2"
|
|
69
|
+
font="text-body"
|
|
70
|
+
>
|
|
71
|
+
{{ fileSelected.fileName }}
|
|
72
|
+
</FSText>
|
|
73
|
+
<FSCol
|
|
74
|
+
gap="0"
|
|
75
|
+
>
|
|
76
|
+
<FSText
|
|
77
|
+
class="fs-edit-image-overline"
|
|
78
|
+
font="text-overline"
|
|
79
|
+
:style="style"
|
|
80
|
+
>
|
|
81
|
+
{{ $tr('ui.edit-image.format', 'PNG or JPG format') }}
|
|
82
|
+
</FSText>
|
|
83
|
+
<FSText
|
|
84
|
+
class="fs-edit-image-overline"
|
|
85
|
+
font="text-overline"
|
|
86
|
+
:style="style"
|
|
87
|
+
>
|
|
88
|
+
{{ $tr('ui.edit-image.size', '10 MB Maximum') }}
|
|
89
|
+
</FSText>
|
|
90
|
+
</FSCol>
|
|
91
|
+
</FSCol>
|
|
92
|
+
</FSRow>
|
|
93
|
+
<v-spacer />
|
|
94
|
+
<FSRow
|
|
95
|
+
width="hug"
|
|
96
|
+
>
|
|
97
|
+
<FSButtonFileMini
|
|
98
|
+
accept="image/*"
|
|
99
|
+
:readFile="false"
|
|
100
|
+
@update:modelValue="onUpload"
|
|
101
|
+
/>
|
|
102
|
+
<FSButtonRemoveMini
|
|
103
|
+
@click="onRemove"
|
|
104
|
+
/>
|
|
105
|
+
</FSRow>
|
|
106
|
+
</FSRow>
|
|
107
|
+
</FSCard>
|
|
108
|
+
<FSRow
|
|
109
|
+
v-else-if="$props.imageId || realSource"
|
|
10
110
|
:width="$props.width"
|
|
11
|
-
|
|
12
|
-
:imageB64="realSource"
|
|
13
|
-
:style="style"
|
|
14
|
-
/>
|
|
15
|
-
<FSCol
|
|
16
|
-
align="bottom-left"
|
|
17
|
-
height="fill"
|
|
18
|
-
width="hug"
|
|
111
|
+
class="fs-edit-image-full"
|
|
19
112
|
>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
113
|
+
<FSImage
|
|
114
|
+
:aspectRatio="$props.aspectRatio"
|
|
115
|
+
:height="$props.height"
|
|
116
|
+
:width="$props.width"
|
|
117
|
+
:imageId="$props.imageId"
|
|
118
|
+
:imageB64="realSource"
|
|
119
|
+
/>
|
|
120
|
+
<FSRow
|
|
121
|
+
class="fs-edit-image-full-toolbar"
|
|
122
|
+
padding="4px"
|
|
23
123
|
>
|
|
24
|
-
|
|
25
|
-
</FSText>
|
|
26
|
-
<FSRow>
|
|
27
|
-
<FSButtonFileIcon
|
|
124
|
+
<FSButtonFileMini
|
|
28
125
|
accept="image/*"
|
|
29
126
|
:readFile="false"
|
|
30
127
|
@update:modelValue="onUpload"
|
|
31
128
|
/>
|
|
32
|
-
<
|
|
129
|
+
<FSButtonRemoveMini
|
|
33
130
|
@click="onRemove"
|
|
34
131
|
/>
|
|
35
132
|
</FSRow>
|
|
36
|
-
</
|
|
37
|
-
|
|
133
|
+
</FSRow>
|
|
134
|
+
<FSClickable
|
|
135
|
+
v-else
|
|
136
|
+
borderStyle="dashed"
|
|
137
|
+
variant="background"
|
|
138
|
+
:height="$props.height"
|
|
139
|
+
:width="$props.width"
|
|
140
|
+
@click="() => invisibleButtonRef.input.click()"
|
|
141
|
+
>
|
|
142
|
+
<FSRow
|
|
143
|
+
align="center-center"
|
|
144
|
+
:wrap="false"
|
|
145
|
+
>
|
|
146
|
+
<FSIcon>
|
|
147
|
+
mdi-plus-box-outline
|
|
148
|
+
</FSIcon>
|
|
149
|
+
<FSText
|
|
150
|
+
lineClamp="2"
|
|
151
|
+
font="text-body"
|
|
152
|
+
>
|
|
153
|
+
{{ $tr('ui.edit-image.add-image', 'Add an image.') }}
|
|
154
|
+
</FSText>
|
|
155
|
+
<FSButtonFileMini
|
|
156
|
+
ref="invisibleButtonRef"
|
|
157
|
+
class="fs-edit-image-hidden-button"
|
|
158
|
+
accept="image/*"
|
|
159
|
+
:readFile="false"
|
|
160
|
+
@update:modelValue="onUpload"
|
|
161
|
+
/>
|
|
162
|
+
</FSRow>
|
|
163
|
+
</FSClickable>
|
|
164
|
+
</FSCol>
|
|
38
165
|
</template>
|
|
39
166
|
|
|
40
167
|
<script lang="ts">
|
|
41
168
|
import { computed, defineComponent, PropType, ref } from "vue";
|
|
42
169
|
|
|
43
|
-
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
170
|
+
import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
44
171
|
import { useFiles } from "@dative-gpi/foundation-shared-services/composables";
|
|
45
172
|
import { ColorEnum, FileImage } from "@dative-gpi/foundation-shared-components/models";
|
|
46
173
|
|
|
47
|
-
import
|
|
48
|
-
import
|
|
174
|
+
import FSButtonRemoveMini from "./buttons/FSButtonRemoveMini.vue";
|
|
175
|
+
import FSButtonFileMini from "./buttons/FSButtonFileMini.vue";
|
|
176
|
+
import FSClickable from "./FSClickable.vue";
|
|
49
177
|
import FSImage from "./FSImage.vue";
|
|
178
|
+
import FSCard from "./FSCard.vue";
|
|
50
179
|
import FSText from "./FSText.vue";
|
|
51
180
|
import FSCol from "./FSCol.vue";
|
|
52
181
|
import FSRow from "./FSRow.vue";
|
|
@@ -54,9 +183,11 @@ import FSRow from "./FSRow.vue";
|
|
|
54
183
|
export default defineComponent({
|
|
55
184
|
name: "FSEditImage",
|
|
56
185
|
components: {
|
|
57
|
-
|
|
58
|
-
|
|
186
|
+
FSButtonRemoveMini,
|
|
187
|
+
FSButtonFileMini,
|
|
188
|
+
FSClickable,
|
|
59
189
|
FSImage,
|
|
190
|
+
FSCard,
|
|
60
191
|
FSText,
|
|
61
192
|
FSCol,
|
|
62
193
|
FSRow
|
|
@@ -86,20 +217,46 @@ export default defineComponent({
|
|
|
86
217
|
type: String as PropType<string | null>,
|
|
87
218
|
required: false,
|
|
88
219
|
default: null
|
|
220
|
+
},
|
|
221
|
+
variant: {
|
|
222
|
+
type: String as PropType<"standard" | "full">,
|
|
223
|
+
required: false,
|
|
224
|
+
default: "standard"
|
|
225
|
+
},
|
|
226
|
+
hideHeader: {
|
|
227
|
+
type: Boolean,
|
|
228
|
+
required: false,
|
|
229
|
+
default: false
|
|
230
|
+
},
|
|
231
|
+
required: {
|
|
232
|
+
type: Boolean,
|
|
233
|
+
required: false,
|
|
234
|
+
default: false
|
|
235
|
+
},
|
|
236
|
+
label: {
|
|
237
|
+
type: String as PropType<string | null>,
|
|
238
|
+
required: false,
|
|
239
|
+
default: null
|
|
89
240
|
}
|
|
90
241
|
},
|
|
91
242
|
emits: ["update:modelValue", "update:imageId"],
|
|
92
243
|
setup(props, { emit }) {
|
|
244
|
+
const { isExtraSmall } = useBreakpoints();
|
|
93
245
|
const { getColors } = useColors();
|
|
94
246
|
const { readFile } = useFiles();
|
|
95
247
|
|
|
96
|
-
const lights = getColors(ColorEnum.Light);
|
|
97
|
-
|
|
98
248
|
const fileSelected = ref<FileImage>({ fileName: "", fileContent: null });
|
|
249
|
+
const invisibleButtonRef = ref<HTMLFormElement | null>(null);
|
|
99
250
|
|
|
100
|
-
const
|
|
251
|
+
const errors = getColors(ColorEnum.Error);
|
|
252
|
+
const lights = getColors(ColorEnum.Light);
|
|
253
|
+
const darks = getColors(ColorEnum.Dark);
|
|
254
|
+
|
|
255
|
+
const style = computed((): { [key: string]: string | undefined } => {
|
|
101
256
|
return {
|
|
102
|
-
"--fs-edit-image-
|
|
257
|
+
"--fs-edit-image-overline-text-color": lights.dark,
|
|
258
|
+
"--fs-edit-image-color" : darks.base,
|
|
259
|
+
"--fs-edit-image-error-color" : errors.base
|
|
103
260
|
};
|
|
104
261
|
});
|
|
105
262
|
|
|
@@ -115,6 +272,9 @@ export default defineComponent({
|
|
|
115
272
|
fileSelected.value.fileName = payload.name;
|
|
116
273
|
fileSelected.value.fileContent = content;
|
|
117
274
|
emit("update:modelValue", content.substring(content.indexOf(',') + 1));
|
|
275
|
+
if (props.imageId) {
|
|
276
|
+
emit("update:imageId", null);
|
|
277
|
+
}
|
|
118
278
|
};
|
|
119
279
|
|
|
120
280
|
const onRemove = () => {
|
|
@@ -129,7 +289,9 @@ export default defineComponent({
|
|
|
129
289
|
};
|
|
130
290
|
|
|
131
291
|
return {
|
|
292
|
+
invisibleButtonRef,
|
|
132
293
|
fileSelected,
|
|
294
|
+
isExtraSmall,
|
|
133
295
|
realSource,
|
|
134
296
|
style,
|
|
135
297
|
onUpload,
|