@dative-gpi/foundation-shared-components 0.0.12 → 0.0.14
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 +1 -1
- package/components/FSCalendarTwin.vue +2 -0
- package/components/FSCheckbox.vue +3 -3
- package/components/FSClock.vue +47 -40
- package/components/FSCol.vue +2 -2
- package/components/FSDivider.vue +46 -7
- package/components/FSForm.vue +52 -0
- package/components/FSImage.vue +41 -32
- package/components/FSLabel.vue +105 -0
- package/components/FSPagination.vue +25 -9
- package/components/FSPermissions.vue +0 -0
- package/components/FSRadio.vue +3 -3
- package/components/FSSlideGroup.vue +10 -11
- package/components/FSSubmitDialog.vue +1 -1
- package/components/FSSwitch.vue +3 -3
- package/components/FSText.vue +1 -1
- package/components/FSWrapGroup.vue +10 -11
- package/components/{FSAutocompleteField.vue → fields/FSAutocompleteField.vue} +26 -19
- package/components/fields/FSColorField.vue +205 -0
- package/components/{FSDateField.vue → fields/FSDateField.vue} +15 -50
- package/components/{FSDateRangeField.vue → fields/FSDateRangeField.vue} +17 -67
- package/components/{FSDateTimeField.vue → fields/FSDateTimeField.vue} +17 -52
- package/components/{FSDateTimeRangeField.vue → fields/FSDateTimeRangeField.vue} +45 -81
- package/components/{FSIconField.vue → fields/FSIconField.vue} +16 -55
- package/components/{FSNumberField.vue → fields/FSNumberField.vue} +17 -27
- package/components/{FSPasswordField.vue → fields/FSPasswordField.vue} +5 -29
- package/components/{FSRichTextField.vue → fields/FSRichTextField.vue} +13 -11
- package/components/{FSSearchField.vue → fields/FSSearchField.vue} +1 -1
- package/components/{FSSelectField.vue → fields/FSSelectField.vue} +17 -21
- package/components/{FSTagField.vue → fields/FSTagField.vue} +18 -53
- package/components/{FSTextArea.vue → fields/FSTextArea.vue} +26 -26
- package/components/{FSTextField.vue → fields/FSTextField.vue} +18 -18
- package/components/fields/FSTimeField.vue +202 -0
- package/components/fields/FSTimeSlotField.vue +269 -0
- package/components/lists/FSDataTableUI.vue +10 -12
- package/components/lists/FSFilterButton.vue +1 -1
- package/components/tiles/FSDeviceOrganisationTileUI.vue +4 -9
- package/components/tiles/FSGroupTileUI.vue +4 -9
- package/composables/index.ts +1 -0
- package/composables/useBreakpoints.ts +7 -5
- package/composables/useRules.ts +72 -0
- package/elements/FSFormElement.ts +17 -0
- package/icons/flags/France.vue +9 -0
- package/icons/flags/Germany.vue +7 -0
- package/icons/flags/GreatBritain.vue +9 -0
- package/icons/flags/Italy.vue +9 -0
- package/icons/flags/Portugal.vue +59 -0
- package/icons/flags/Spain.vue +546 -0
- package/icons/flags/UnitedStates.vue +12 -0
- package/icons/sets.ts +17 -0
- package/models/rules.ts +8 -0
- package/package.json +4 -4
- package/styles/components/fs_autocomplete_field.scss +3 -60
- package/styles/components/fs_clock.scss +4 -0
- package/styles/components/fs_color_field.scss +21 -0
- package/styles/components/fs_data_table.scss +7 -2
- package/styles/components/fs_divider.scss +5 -0
- package/styles/components/fs_image.scss +12 -1
- package/styles/components/fs_label.scss +86 -0
- package/styles/components/fs_pagination.scss +3 -3
- package/styles/components/fs_rich_text_field.scss +1 -1
- package/styles/components/fs_select_field.scss +3 -4
- package/styles/components/fs_switch.scss +4 -4
- package/styles/components/fs_text_area.scss +2 -0
- package/styles/components/fs_text_field.scss +1 -0
- package/styles/components/fs_time_field.scss +16 -0
- package/styles/components/fs_timeslot_field.scss +12 -0
- package/styles/components/index.scss +4 -0
- package/styles/globals/overrides.scss +8 -6
- package/styles/globals/text_fonts.scss +18 -0
- package/utils/color.ts +7 -0
- package/utils/css.ts +2 -1
- package/utils/icons.ts +88 -2
- package/utils/index.ts +3 -1
- package/utils/time.ts +29 -0
- package/components/FSHeaderButton.vue +0 -17
- package/components/lists/FSDataIteratorGroup.vue +0 -7
package/components/FSButton.vue
CHANGED
|
@@ -47,16 +47,16 @@ import { useColors } from "@dative-gpi/foundation-shared-components/composables"
|
|
|
47
47
|
|
|
48
48
|
import FSIcon from "./FSIcon.vue";
|
|
49
49
|
import FSSpan from "./FSSpan.vue";
|
|
50
|
-
import FSRow from "./FSRow.vue";
|
|
51
50
|
import FSCol from "./FSCol.vue";
|
|
51
|
+
import FSRow from "./FSRow.vue";
|
|
52
52
|
|
|
53
53
|
export default defineComponent({
|
|
54
54
|
name: "FSCheckbox",
|
|
55
55
|
components: {
|
|
56
56
|
FSIcon,
|
|
57
57
|
FSSpan,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
FSCol,
|
|
59
|
+
FSRow
|
|
60
60
|
},
|
|
61
61
|
props: {
|
|
62
62
|
label: {
|
package/components/FSClock.vue
CHANGED
|
@@ -5,42 +5,46 @@
|
|
|
5
5
|
>
|
|
6
6
|
<FSRow
|
|
7
7
|
align="center-center"
|
|
8
|
+
:wrap="false"
|
|
8
9
|
>
|
|
9
|
-
<
|
|
10
|
+
<FSText
|
|
10
11
|
v-if="$props.reminder"
|
|
11
|
-
:readonly="true"
|
|
12
|
-
:hideHeader="true"
|
|
13
|
-
:modelValue="epochToLongDateFormat($props.date)"
|
|
14
|
-
/>
|
|
15
|
-
<v-text-field
|
|
16
|
-
class="fs-clock-field"
|
|
17
|
-
variant="outlined"
|
|
18
|
-
type="number"
|
|
19
|
-
hide-details
|
|
20
|
-
:style="style"
|
|
21
|
-
:readonly="!$props.editable"
|
|
22
|
-
:modelValue="innerHours.toString().padStart(2, '0')"
|
|
23
|
-
@update:modelValue="onChangeHours"
|
|
24
|
-
/>
|
|
25
|
-
:
|
|
26
|
-
<v-text-field
|
|
27
|
-
class="fs-clock-field"
|
|
28
|
-
variant="outlined"
|
|
29
|
-
type="number"
|
|
30
|
-
hide-details
|
|
31
|
-
:style="style"
|
|
32
|
-
:readonly="!$props.editable"
|
|
33
|
-
:modelValue="innerMinutes.toString().padStart(2, '0')"
|
|
34
|
-
@update:modelValue="onChangeMinutes"
|
|
35
|
-
/>
|
|
36
|
-
</FSRow>
|
|
37
|
-
<FSCol>
|
|
38
|
-
<FSSpan
|
|
39
|
-
font="text-overline"
|
|
40
12
|
>
|
|
41
|
-
{{ $
|
|
42
|
-
</
|
|
13
|
+
{{ epochToLongDateFormat($props.date) }}
|
|
14
|
+
</FSText>
|
|
15
|
+
<v-spacer v-if="$props.reminder" />
|
|
16
|
+
<FSRow
|
|
17
|
+
align="center-center"
|
|
18
|
+
:wrap="false"
|
|
19
|
+
>
|
|
20
|
+
<v-text-field
|
|
21
|
+
class="fs-clock-field"
|
|
22
|
+
variant="outlined"
|
|
23
|
+
type="number"
|
|
24
|
+
hide-details
|
|
25
|
+
:style="style"
|
|
26
|
+
:readonly="!$props.editable"
|
|
27
|
+
:modelValue="innerHours.toString().padStart(2, '0')"
|
|
28
|
+
@update:modelValue="onChangeHours"
|
|
29
|
+
/>
|
|
30
|
+
:
|
|
31
|
+
<v-text-field
|
|
32
|
+
class="fs-clock-field"
|
|
33
|
+
variant="outlined"
|
|
34
|
+
type="number"
|
|
35
|
+
hide-details
|
|
36
|
+
:style="style"
|
|
37
|
+
:readonly="!$props.editable"
|
|
38
|
+
:modelValue="innerMinutes.toString().padStart(2, '0')"
|
|
39
|
+
@update:modelValue="onChangeMinutes"
|
|
40
|
+
/>
|
|
41
|
+
</FSRow>
|
|
42
|
+
</FSRow>
|
|
43
|
+
<FSCol
|
|
44
|
+
v-if="$props.slider"
|
|
45
|
+
>
|
|
43
46
|
<FSSlider
|
|
47
|
+
:label="$tr('ui.clock.hours', 'Hours')"
|
|
44
48
|
:readonly="!$props.editable"
|
|
45
49
|
:color="$props.color"
|
|
46
50
|
:step="1"
|
|
@@ -49,13 +53,11 @@
|
|
|
49
53
|
v-model="innerHours"
|
|
50
54
|
/>
|
|
51
55
|
</FSCol>
|
|
52
|
-
<FSCol
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
>
|
|
56
|
-
{{ $tr("ui.clock.minutes", "Minutes") }}
|
|
57
|
-
</FSSpan>
|
|
56
|
+
<FSCol
|
|
57
|
+
v-if="$props.slider"
|
|
58
|
+
>
|
|
58
59
|
<FSSlider
|
|
60
|
+
:label="$tr('ui.clock.minutes', 'Minutes')"
|
|
59
61
|
:readonly="!$props.editable"
|
|
60
62
|
:color="$props.color"
|
|
61
63
|
:step="1"
|
|
@@ -74,16 +76,16 @@ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/m
|
|
|
74
76
|
import { useTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
75
77
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
76
78
|
|
|
77
|
-
import FSTextField from "./FSTextField.vue";
|
|
78
79
|
import FSSlider from "./FSSlider.vue";
|
|
80
|
+
import FSText from "./FSText.vue";
|
|
79
81
|
import FSCol from "./FSCol.vue";
|
|
80
82
|
import FSRow from "./FSRow.vue";
|
|
81
83
|
|
|
82
84
|
export default defineComponent({
|
|
83
85
|
name: "FSClock",
|
|
84
86
|
components: {
|
|
85
|
-
FSTextField,
|
|
86
87
|
FSSlider,
|
|
88
|
+
FSText,
|
|
87
89
|
FSCol,
|
|
88
90
|
FSRow
|
|
89
91
|
},
|
|
@@ -112,6 +114,11 @@ export default defineComponent({
|
|
|
112
114
|
type: Boolean,
|
|
113
115
|
required: false,
|
|
114
116
|
default: true
|
|
117
|
+
},
|
|
118
|
+
slider: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
required: false,
|
|
121
|
+
default: true
|
|
115
122
|
}
|
|
116
123
|
},
|
|
117
124
|
emits: ["update:modelValue"],
|
package/components/FSCol.vue
CHANGED
package/components/FSDivider.vue
CHANGED
|
@@ -1,40 +1,79 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
+
v-if="isEmpty"
|
|
3
4
|
class="fs-divider"
|
|
4
5
|
:style="style"
|
|
5
6
|
/>
|
|
7
|
+
<FSRow
|
|
8
|
+
v-else
|
|
9
|
+
align="center-center"
|
|
10
|
+
gap="24px"
|
|
11
|
+
>
|
|
12
|
+
<FSCol
|
|
13
|
+
class="fs-divider-around"
|
|
14
|
+
:style="style"
|
|
15
|
+
/>
|
|
16
|
+
<FSText
|
|
17
|
+
variant="light"
|
|
18
|
+
font="text-h4"
|
|
19
|
+
>
|
|
20
|
+
<slot>
|
|
21
|
+
{{ $props.label }}
|
|
22
|
+
</slot>
|
|
23
|
+
</FSText>
|
|
24
|
+
<FSCol
|
|
25
|
+
class="fs-divider-around"
|
|
26
|
+
:style="style"
|
|
27
|
+
/>
|
|
28
|
+
</FSRow>
|
|
6
29
|
</template>
|
|
7
30
|
|
|
8
31
|
<script lang="ts">
|
|
9
32
|
import { computed, defineComponent } from "vue";
|
|
10
33
|
|
|
11
|
-
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
34
|
+
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
12
35
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
13
36
|
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
14
37
|
|
|
38
|
+
import FSText from "./FSText.vue";
|
|
39
|
+
|
|
15
40
|
export default defineComponent({
|
|
16
41
|
name: "FSDivider",
|
|
42
|
+
components: {
|
|
43
|
+
FSText
|
|
44
|
+
},
|
|
17
45
|
props: {
|
|
18
46
|
width: {
|
|
19
47
|
type: [String, Number],
|
|
20
48
|
required: false,
|
|
21
49
|
default: "100%"
|
|
50
|
+
},
|
|
51
|
+
label: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: false,
|
|
54
|
+
default: null
|
|
22
55
|
}
|
|
23
56
|
},
|
|
24
57
|
setup(props) {
|
|
25
58
|
const { getColors } = useColors();
|
|
59
|
+
const { slots } = useSlots();
|
|
26
60
|
|
|
27
61
|
const lights = getColors(ColorEnum.Light);
|
|
28
62
|
|
|
29
|
-
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
63
|
+
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
64
|
+
return {
|
|
65
|
+
"--fs-divider-width": sizeToVar(props.width),
|
|
66
|
+
"--fs-divider-color": lights.dark
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const isEmpty = computed(() => {
|
|
71
|
+
return !slots.default && !props.label;
|
|
34
72
|
});
|
|
35
73
|
|
|
36
74
|
return {
|
|
37
|
-
style
|
|
75
|
+
style,
|
|
76
|
+
isEmpty
|
|
38
77
|
}
|
|
39
78
|
}
|
|
40
79
|
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-form
|
|
3
|
+
ref="formRef"
|
|
4
|
+
:validateOn="validateOn"
|
|
5
|
+
@submit="submitted = true"
|
|
6
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</v-form>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { computed, defineComponent, PropType, provide, ref } from "vue";
|
|
14
|
+
|
|
15
|
+
export default defineComponent({
|
|
16
|
+
name: "FSForm",
|
|
17
|
+
props: {
|
|
18
|
+
modelValue: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
required: false,
|
|
21
|
+
default: null
|
|
22
|
+
},
|
|
23
|
+
variant: {
|
|
24
|
+
type: String as PropType<"standard" | "lazy" | "submit">,
|
|
25
|
+
required: false,
|
|
26
|
+
default: "standard"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
emits: ["update:modelValue"],
|
|
30
|
+
setup(props) {
|
|
31
|
+
const formRef = ref<HTMLFormElement | null>(null);
|
|
32
|
+
const submitted = ref(false);
|
|
33
|
+
|
|
34
|
+
const validateOn = computed((): "submit" | "blur" | "input" => {
|
|
35
|
+
switch (props.variant) {
|
|
36
|
+
case "standard": return "input";
|
|
37
|
+
case "lazy": return "blur";
|
|
38
|
+
case "submit": return "submit";
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
provide("validateOn", validateOn.value);
|
|
43
|
+
provide("submitted", submitted.value);
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
formRef,
|
|
47
|
+
validateOn,
|
|
48
|
+
submitted
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
</script>
|
package/components/FSImage.vue
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<v-img
|
|
3
3
|
class="fs-image"
|
|
4
4
|
:src="source"
|
|
5
|
+
:style="style"
|
|
5
6
|
:cover="$props.cover"
|
|
6
7
|
:width="computedWidth"
|
|
7
8
|
:height="computedHeight"
|
|
@@ -9,23 +10,27 @@
|
|
|
9
10
|
>
|
|
10
11
|
<template #placeholder>
|
|
11
12
|
<v-skeleton-loader
|
|
13
|
+
class="fs-load-image"
|
|
12
14
|
type="image"
|
|
15
|
+
:style="style"
|
|
13
16
|
/>
|
|
14
17
|
</template>
|
|
15
18
|
</v-img>
|
|
16
19
|
</template>
|
|
17
20
|
|
|
18
21
|
<script lang="ts">
|
|
19
|
-
import { computed, defineComponent, onMounted } from "vue";
|
|
22
|
+
import { computed, defineComponent, onMounted, watch } from "vue";
|
|
20
23
|
|
|
21
24
|
import { useImageRaw, useImageBlurHash } from "@dative-gpi/foundation-shared-services/composables";
|
|
25
|
+
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
22
26
|
|
|
23
27
|
export default defineComponent({
|
|
24
28
|
name: "FSImage",
|
|
25
29
|
props: {
|
|
26
30
|
imageId: {
|
|
27
|
-
type: String,
|
|
28
|
-
required:
|
|
31
|
+
type: [String, null, undefined],
|
|
32
|
+
required: false,
|
|
33
|
+
default: null
|
|
29
34
|
},
|
|
30
35
|
cover: {
|
|
31
36
|
type: Boolean,
|
|
@@ -33,12 +38,12 @@ export default defineComponent({
|
|
|
33
38
|
default: true
|
|
34
39
|
},
|
|
35
40
|
width: {
|
|
36
|
-
type: Number,
|
|
41
|
+
type: [String, Number],
|
|
37
42
|
required: false,
|
|
38
43
|
default: null
|
|
39
44
|
},
|
|
40
45
|
height: {
|
|
41
|
-
type: Number,
|
|
46
|
+
type: [String, Number],
|
|
42
47
|
required: false,
|
|
43
48
|
default: null
|
|
44
49
|
},
|
|
@@ -46,17 +51,31 @@ export default defineComponent({
|
|
|
46
51
|
type: String,
|
|
47
52
|
required: false,
|
|
48
53
|
default: null
|
|
54
|
+
},
|
|
55
|
+
borderRadius: {
|
|
56
|
+
type: [String, Number],
|
|
57
|
+
required: false,
|
|
58
|
+
default: "4px"
|
|
49
59
|
}
|
|
50
60
|
},
|
|
51
61
|
setup(props) {
|
|
52
|
-
const {
|
|
53
|
-
const {
|
|
62
|
+
const { getting: fetchingRaw, get: fetchRaw, entity: image } = useImageRaw();
|
|
63
|
+
const { getting: fetchingBlurHash, get: fetchBlurHash, entity: blurHash } = useImageBlurHash();
|
|
54
64
|
|
|
55
|
-
const
|
|
65
|
+
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
66
|
+
return {
|
|
67
|
+
"--fs-image-border-radius": sizeToVar(props.borderRadius)
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const computedWidth = computed((): number | string | undefined => {
|
|
56
72
|
if (props.width) {
|
|
57
73
|
return props.width;
|
|
58
74
|
}
|
|
59
75
|
if (props.height) {
|
|
76
|
+
if (typeof(props.height) === "string") {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
60
79
|
if (props.aspectRatio) {
|
|
61
80
|
const split = props.aspectRatio.split('/');
|
|
62
81
|
if (split.length === 2 && !isNaN(parseFloat(split[0])) && !isNaN(parseFloat(split[1]))) {
|
|
@@ -65,14 +84,17 @@ export default defineComponent({
|
|
|
65
84
|
}
|
|
66
85
|
return props.height;
|
|
67
86
|
}
|
|
68
|
-
return
|
|
87
|
+
return undefined;
|
|
69
88
|
});
|
|
70
89
|
|
|
71
|
-
const computedHeight = computed((): number => {
|
|
90
|
+
const computedHeight = computed((): number | string | undefined => {
|
|
72
91
|
if (props.height) {
|
|
73
92
|
return props.height;
|
|
74
93
|
}
|
|
75
94
|
if (props.width) {
|
|
95
|
+
if (typeof(props.width) === "string") {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
76
98
|
if (props.aspectRatio) {
|
|
77
99
|
const split = props.aspectRatio.split('/');
|
|
78
100
|
if (split.length === 2 && !isNaN(parseFloat(split[0])) && !isNaN(parseFloat(split[1]))) {
|
|
@@ -81,7 +103,7 @@ export default defineComponent({
|
|
|
81
103
|
}
|
|
82
104
|
return props.width;
|
|
83
105
|
}
|
|
84
|
-
return
|
|
106
|
+
return undefined;
|
|
85
107
|
});
|
|
86
108
|
|
|
87
109
|
const source = computed((): string | null => {
|
|
@@ -100,32 +122,18 @@ export default defineComponent({
|
|
|
100
122
|
return null;
|
|
101
123
|
});
|
|
102
124
|
|
|
103
|
-
// const pixels = () => {
|
|
104
|
-
// if (this.value && this.isValid)
|
|
105
|
-
// return decode(this.value, this.width, this.height, this.punch);
|
|
106
|
-
// return [];
|
|
107
|
-
// }
|
|
108
|
-
|
|
109
|
-
// const isValid = () => {
|
|
110
|
-
// return this.value && isBlurhashValid(this.value).result;
|
|
111
|
-
// }
|
|
112
|
-
|
|
113
|
-
// const reset = () => {
|
|
114
|
-
// const ctx = (this.$el as HTMLCanvasElement).getContext("2d");
|
|
115
|
-
// this.$nextTick(() => {
|
|
116
|
-
// if (this.pixels.length) {
|
|
117
|
-
// const imageData = ctx!.createImageData(this.width, this.height);
|
|
118
|
-
// imageData.data.set(this.pixels);
|
|
119
|
-
// ctx!.putImageData(imageData, 0, 0);
|
|
120
|
-
// }
|
|
121
|
-
// });
|
|
122
|
-
// }
|
|
123
|
-
|
|
124
125
|
onMounted(() => {
|
|
125
126
|
fetch();
|
|
126
127
|
});
|
|
127
128
|
|
|
129
|
+
watch(() => props.imageId, () => {
|
|
130
|
+
fetch();
|
|
131
|
+
});
|
|
132
|
+
|
|
128
133
|
const fetch = async () => {
|
|
134
|
+
if (!props.imageId) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
129
137
|
await fetchRaw(props.imageId);
|
|
130
138
|
if (!image.value) {
|
|
131
139
|
await fetchBlurHash(props.imageId);
|
|
@@ -133,6 +141,7 @@ export default defineComponent({
|
|
|
133
141
|
}
|
|
134
142
|
|
|
135
143
|
return {
|
|
144
|
+
style,
|
|
136
145
|
source,
|
|
137
146
|
computedWidth,
|
|
138
147
|
computedHeight
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
v-if="$props.label"
|
|
4
|
+
:class="classes"
|
|
5
|
+
:style="style"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
>
|
|
8
|
+
{{ $props.label }}
|
|
9
|
+
</span>
|
|
10
|
+
<v-skeleton-loader
|
|
11
|
+
v-else
|
|
12
|
+
type="text"
|
|
13
|
+
:class="loadClasses"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
19
|
+
|
|
20
|
+
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
21
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
22
|
+
|
|
23
|
+
export default defineComponent({
|
|
24
|
+
name: "FSLabel",
|
|
25
|
+
props: {
|
|
26
|
+
label: {
|
|
27
|
+
type: [String, null, undefined],
|
|
28
|
+
required: false,
|
|
29
|
+
default: null
|
|
30
|
+
},
|
|
31
|
+
font: {
|
|
32
|
+
type: String as PropType<"text-h1" | "text-h2" | "text-h3" | "text-h4" | "text-body" | "text-button" | "text-overline" | "text-underline">,
|
|
33
|
+
required: false,
|
|
34
|
+
default: "text-body"
|
|
35
|
+
},
|
|
36
|
+
lineClamp: {
|
|
37
|
+
type: Number,
|
|
38
|
+
required: false,
|
|
39
|
+
default: 1
|
|
40
|
+
},
|
|
41
|
+
ellipsis: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
required: false,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
color: {
|
|
47
|
+
type: String as PropType<ColorBase>,
|
|
48
|
+
required: false,
|
|
49
|
+
default: ColorEnum.Dark
|
|
50
|
+
},
|
|
51
|
+
variant: {
|
|
52
|
+
type: String as PropType<"base" | "light" | "dark">,
|
|
53
|
+
required: false,
|
|
54
|
+
default: "dark"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
setup(props) {
|
|
58
|
+
const { getColors } = useColors();
|
|
59
|
+
const { slots } = useSlots();
|
|
60
|
+
|
|
61
|
+
const colors = computed(() => getColors(props.color));
|
|
62
|
+
|
|
63
|
+
const classes = computed((): string[] => {
|
|
64
|
+
const classNames = ["fs-label", props.font];
|
|
65
|
+
if (!slots.default) {
|
|
66
|
+
classNames.push("fs-span-pre-wrap");
|
|
67
|
+
}
|
|
68
|
+
if (props.lineClamp > 1) {
|
|
69
|
+
classNames.push("fs-span-line-clamp");
|
|
70
|
+
}
|
|
71
|
+
else if (props.ellipsis) {
|
|
72
|
+
classNames.push("fs-span-ellipsis");
|
|
73
|
+
}
|
|
74
|
+
return classNames;
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const loadClasses = computed((): string[] => {
|
|
78
|
+
return ["fs-load-label", props.font];
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
82
|
+
switch (props.variant) {
|
|
83
|
+
case "base": return {
|
|
84
|
+
"--fs-span-line-clamp": props.lineClamp.toString(),
|
|
85
|
+
"--fs-label-color" : colors.value.base
|
|
86
|
+
};
|
|
87
|
+
case "light": return {
|
|
88
|
+
"--fs-span-line-clamp": props.lineClamp.toString(),
|
|
89
|
+
"--fs-label-color" : colors.value.light
|
|
90
|
+
};
|
|
91
|
+
case "dark": return {
|
|
92
|
+
"--fs-span-line-clamp": props.lineClamp.toString(),
|
|
93
|
+
"--fs-label-color" : colors.value.dark
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
classes,
|
|
100
|
+
loadClasses,
|
|
101
|
+
style
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
</script>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSRow
|
|
3
|
+
class="fs-pagination"
|
|
3
4
|
align="center-center"
|
|
4
|
-
|
|
5
|
+
:width="$props.width"
|
|
6
|
+
:gap="$props.gap"
|
|
7
|
+
:style="style"
|
|
5
8
|
>
|
|
6
9
|
<div
|
|
7
10
|
v-for="(_, index) in $props.pages"
|
|
@@ -17,6 +20,7 @@ import { computed, defineComponent, PropType } from "vue";
|
|
|
17
20
|
|
|
18
21
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
19
22
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
23
|
+
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
20
24
|
|
|
21
25
|
import FSRow from "./FSRow.vue";
|
|
22
26
|
|
|
@@ -26,16 +30,26 @@ export default defineComponent({
|
|
|
26
30
|
FSRow
|
|
27
31
|
},
|
|
28
32
|
props: {
|
|
29
|
-
|
|
30
|
-
type: Number,
|
|
33
|
+
width: {
|
|
34
|
+
type: [String, Number],
|
|
31
35
|
required: false,
|
|
32
|
-
default:
|
|
36
|
+
default: null
|
|
37
|
+
},
|
|
38
|
+
gap: {
|
|
39
|
+
type: [String, Number],
|
|
40
|
+
required: false,
|
|
41
|
+
default: 4
|
|
33
42
|
},
|
|
34
43
|
pages: {
|
|
35
44
|
type: Number,
|
|
36
45
|
required: false,
|
|
37
46
|
default: 1
|
|
38
47
|
},
|
|
48
|
+
modelValue: {
|
|
49
|
+
type: Number,
|
|
50
|
+
required: false,
|
|
51
|
+
default: 0
|
|
52
|
+
},
|
|
39
53
|
color: {
|
|
40
54
|
type: String as PropType<ColorBase>,
|
|
41
55
|
required: false,
|
|
@@ -53,20 +67,22 @@ export default defineComponent({
|
|
|
53
67
|
switch (props.color) {
|
|
54
68
|
case ColorEnum.Light:
|
|
55
69
|
case ColorEnum.Dark: return {
|
|
56
|
-
"--fs-pagination-
|
|
70
|
+
"--fs-pagination-page-width" : `calc(100% / ${props.pages} - ${sizeToVar(props.gap)}`,
|
|
71
|
+
"--fs-pagination-background-color" : lights.dark,
|
|
57
72
|
"--fs-pagination-active-background-color": darks.base
|
|
58
73
|
}
|
|
59
74
|
default: return {
|
|
60
|
-
"--fs-pagination-
|
|
75
|
+
"--fs-pagination-page-width" : `calc(100% / ${props.pages} - ${sizeToVar(props.gap)}`,
|
|
76
|
+
"--fs-pagination-background-color" : colors.value.light,
|
|
61
77
|
"--fs-pagination-active-background-color": colors.value.base
|
|
62
78
|
}
|
|
63
79
|
}
|
|
64
80
|
});
|
|
65
81
|
|
|
66
82
|
const classes = (page: number): string[] => {
|
|
67
|
-
const innerClasses = ["fs-pagination"];
|
|
68
|
-
if (page
|
|
69
|
-
innerClasses.push("fs-pagination-active");
|
|
83
|
+
const innerClasses = ["fs-pagination-page"];
|
|
84
|
+
if (page <= props.modelValue) {
|
|
85
|
+
innerClasses.push("fs-pagination-active-page");
|
|
70
86
|
}
|
|
71
87
|
return innerClasses;
|
|
72
88
|
};
|
|
File without changes
|
package/components/FSRadio.vue
CHANGED
|
@@ -42,16 +42,16 @@ import { useColors } from "@dative-gpi/foundation-shared-components/composables"
|
|
|
42
42
|
|
|
43
43
|
import FSIcon from "./FSIcon.vue";
|
|
44
44
|
import FSSpan from "./FSSpan.vue";
|
|
45
|
-
import FSRow from "./FSRow.vue";
|
|
46
45
|
import FSCol from "./FSCol.vue";
|
|
46
|
+
import FSRow from "./FSRow.vue";
|
|
47
47
|
|
|
48
48
|
export default defineComponent({
|
|
49
49
|
name: "FSRadio",
|
|
50
50
|
components: {
|
|
51
51
|
FSIcon,
|
|
52
52
|
FSSpan,
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
FSCol,
|
|
54
|
+
FSRow
|
|
55
55
|
},
|
|
56
56
|
props: {
|
|
57
57
|
label: {
|