@dative-gpi/foundation-shared-components 0.0.52 → 0.0.54
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/FSAccordion.vue +7 -4
- package/components/FSCard.vue +21 -21
- package/components/FSClickable.vue +31 -15
- package/components/FSCol.vue +11 -11
- package/components/FSDialog.vue +27 -24
- package/components/FSDivider.vue +7 -7
- package/components/FSEditImage.vue +11 -11
- package/components/FSFadeOut.vue +11 -57
- package/components/FSImage.vue +23 -23
- package/components/FSLoader.vue +10 -10
- package/components/FSOptionGroup.vue +2 -2
- package/components/FSPagination.vue +6 -6
- package/components/FSRow.vue +14 -14
- package/components/FSSlideGroup.vue +4 -5
- package/components/FSSubmitDialog.vue +10 -10
- package/components/FSTabs.vue +4 -3
- package/components/FSToggleSet.vue +2 -2
- package/components/FSWindow.vue +4 -3
- package/components/FSWrapGroup.vue +7 -6
- package/components/fields/FSAutocompleteField.vue +15 -3
- package/components/fields/FSSelectField.vue +13 -1
- package/components/fields/FSTextField.vue +0 -1
- package/components/lists/FSDataTableUI.vue +3 -3
- package/composables/useSlots.ts +4 -4
- package/models/rules.ts +31 -31
- package/package.json +4 -4
- package/styles/components/fs_autocomplete_field.scss +16 -0
- package/styles/components/fs_fade_out.scss +4 -2
- package/styles/components/fs_select_field.scss +18 -0
- package/styles/globals/overrides.scss +0 -4
- package/utils/css.ts +30 -1
- package/utils/time.ts +1 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-expansion-panels
|
|
2
|
+
<v-expansion-panels
|
|
3
|
+
variant="accordion"
|
|
4
|
+
>
|
|
3
5
|
<template
|
|
4
|
-
v-for="
|
|
5
|
-
:key="index"
|
|
6
|
+
v-for="component in getChildren()"
|
|
6
7
|
>
|
|
7
|
-
<component
|
|
8
|
+
<component
|
|
9
|
+
:is="component"
|
|
10
|
+
/>
|
|
8
11
|
</template>
|
|
9
12
|
</v-expansion-panels>
|
|
10
13
|
</template>
|
package/components/FSCard.vue
CHANGED
|
@@ -44,25 +44,25 @@ export default defineComponent({
|
|
|
44
44
|
FSRow
|
|
45
45
|
},
|
|
46
46
|
props: {
|
|
47
|
-
|
|
48
|
-
type: [String, Number]
|
|
47
|
+
height: {
|
|
48
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
49
49
|
required: false,
|
|
50
|
-
default:
|
|
50
|
+
default: null
|
|
51
51
|
},
|
|
52
|
-
|
|
53
|
-
type:
|
|
52
|
+
width: {
|
|
53
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
54
54
|
required: false,
|
|
55
|
-
default:
|
|
55
|
+
default: null
|
|
56
56
|
},
|
|
57
|
-
|
|
58
|
-
type: [String, Number]
|
|
57
|
+
padding: {
|
|
58
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
59
59
|
required: false,
|
|
60
|
-
default: "
|
|
60
|
+
default: "0"
|
|
61
61
|
},
|
|
62
|
-
|
|
63
|
-
type:
|
|
62
|
+
gap: {
|
|
63
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
64
64
|
required: false,
|
|
65
|
-
default:
|
|
65
|
+
default: "8px"
|
|
66
66
|
},
|
|
67
67
|
variant: {
|
|
68
68
|
type: String as PropType<"background" | "standard">,
|
|
@@ -74,20 +74,20 @@ export default defineComponent({
|
|
|
74
74
|
required: false,
|
|
75
75
|
default: ColorEnum.Background
|
|
76
76
|
},
|
|
77
|
-
|
|
78
|
-
type:
|
|
77
|
+
border: {
|
|
78
|
+
type: Boolean,
|
|
79
79
|
required: false,
|
|
80
|
-
default:
|
|
80
|
+
default: true
|
|
81
81
|
},
|
|
82
|
-
|
|
83
|
-
type: [
|
|
82
|
+
borderRadius: {
|
|
83
|
+
type: [String, Number],
|
|
84
84
|
required: false,
|
|
85
|
-
default:
|
|
85
|
+
default: "4px"
|
|
86
86
|
},
|
|
87
|
-
|
|
88
|
-
type:
|
|
87
|
+
elevation: {
|
|
88
|
+
type: Boolean,
|
|
89
89
|
required: false,
|
|
90
|
-
default:
|
|
90
|
+
default: false
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
setup(props) {
|
|
@@ -70,23 +70,23 @@ export default defineComponent({
|
|
|
70
70
|
FSCard
|
|
71
71
|
},
|
|
72
72
|
props: {
|
|
73
|
-
|
|
74
|
-
type: [String,
|
|
73
|
+
height: {
|
|
74
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
75
75
|
required: false,
|
|
76
76
|
default: null
|
|
77
77
|
},
|
|
78
|
-
|
|
79
|
-
type:
|
|
78
|
+
width: {
|
|
79
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
80
80
|
required: false,
|
|
81
|
-
default:
|
|
81
|
+
default: null
|
|
82
82
|
},
|
|
83
|
-
|
|
84
|
-
type: [String,
|
|
83
|
+
to: {
|
|
84
|
+
type: [String, Object] as PropType<string | RouteLocation>,
|
|
85
85
|
required: false,
|
|
86
|
-
default:
|
|
86
|
+
default: null
|
|
87
87
|
},
|
|
88
88
|
variant: {
|
|
89
|
-
type: String as PropType<"standard" | "full">,
|
|
89
|
+
type: String as PropType<"standard" | "background" | "full">,
|
|
90
90
|
required: false,
|
|
91
91
|
default: "standard"
|
|
92
92
|
},
|
|
@@ -100,15 +100,15 @@ export default defineComponent({
|
|
|
100
100
|
required: false,
|
|
101
101
|
default: ColorEnum.Light
|
|
102
102
|
},
|
|
103
|
-
|
|
104
|
-
type:
|
|
103
|
+
border: {
|
|
104
|
+
type: Boolean,
|
|
105
105
|
required: false,
|
|
106
|
-
default:
|
|
106
|
+
default: true
|
|
107
107
|
},
|
|
108
|
-
|
|
109
|
-
type: [
|
|
108
|
+
borderRadius: {
|
|
109
|
+
type: [String, Number],
|
|
110
110
|
required: false,
|
|
111
|
-
default:
|
|
111
|
+
default: "4px"
|
|
112
112
|
},
|
|
113
113
|
load: {
|
|
114
114
|
type: Boolean,
|
|
@@ -127,6 +127,7 @@ export default defineComponent({
|
|
|
127
127
|
const router = useRouter();
|
|
128
128
|
|
|
129
129
|
const colors = computed(() => getColors(props.color));
|
|
130
|
+
const backgrounds = getColors(ColorEnum.Background);
|
|
130
131
|
const lights = getColors(ColorEnum.Light);
|
|
131
132
|
const darks = getColors(ColorEnum.Dark);
|
|
132
133
|
|
|
@@ -158,6 +159,21 @@ export default defineComponent({
|
|
|
158
159
|
"--fs-clickable-height" : sizeToVar(props.height),
|
|
159
160
|
"--fs-clickable-width" : sizeToVar(props.width)
|
|
160
161
|
};
|
|
162
|
+
case "background": return {
|
|
163
|
+
"--fs-clickable-border-size" : props.border ? "1px" : "0",
|
|
164
|
+
"--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
|
|
165
|
+
"--fs-clickable-background-color" : backgrounds.base,
|
|
166
|
+
"--fs-clickable-border-color" : lights.dark,
|
|
167
|
+
"--fs-clickable-color" : darks.base,
|
|
168
|
+
"--fs-clickable-hover-background-color" : colors.value.base,
|
|
169
|
+
"--fs-clickable-hover-border-color" : colors.value.baseContrast,
|
|
170
|
+
"--fs-clickable-hover-color" : colors.value.baseContrast,
|
|
171
|
+
"--fs-clickable-active-background-color": colors.value.dark,
|
|
172
|
+
"--fs-clickable-active-border-color" : colors.value.darkContrast,
|
|
173
|
+
"--fs-clickable-active-color" : colors.value.darkContrast,
|
|
174
|
+
"--fs-clickable-height" : sizeToVar(props.height),
|
|
175
|
+
"--fs-clickable-width" : sizeToVar(props.width)
|
|
176
|
+
};
|
|
161
177
|
case "full": return {
|
|
162
178
|
"--fs-clickable-border-size" : props.border ? "1px" : "0",
|
|
163
179
|
"--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
|
package/components/FSCol.vue
CHANGED
|
@@ -16,30 +16,30 @@ import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
|
16
16
|
export default defineComponent({
|
|
17
17
|
name: "FSCol",
|
|
18
18
|
props: {
|
|
19
|
-
width: {
|
|
20
|
-
type: [String, Number] as PropType<"hug" | "fill" | string | number>,
|
|
21
|
-
required: false,
|
|
22
|
-
default: "fill"
|
|
23
|
-
},
|
|
24
19
|
height: {
|
|
25
|
-
type: [String, Number] as PropType<"hug" | "fill" | string | number>,
|
|
20
|
+
type: [Array, String, Number] as PropType<"hug" | "fill" | string[] | number[] | string | number | null>,
|
|
26
21
|
required: false,
|
|
27
22
|
default: "hug"
|
|
28
23
|
},
|
|
29
|
-
|
|
30
|
-
type: String as PropType<"
|
|
24
|
+
width: {
|
|
25
|
+
type: [Array, String, Number] as PropType<"hug" | "fill" | string[] | number[] | string | number | null>,
|
|
31
26
|
required: false,
|
|
32
|
-
default: "
|
|
27
|
+
default: "fill"
|
|
33
28
|
},
|
|
34
29
|
padding: {
|
|
35
|
-
type: [String, Number]
|
|
30
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
36
31
|
required: false,
|
|
37
32
|
default: "0"
|
|
38
33
|
},
|
|
39
34
|
gap: {
|
|
40
|
-
type: [String, Number]
|
|
35
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
41
36
|
required: false,
|
|
42
37
|
default: "8px"
|
|
38
|
+
},
|
|
39
|
+
align: {
|
|
40
|
+
type: String as PropType<"top-left" | "top-center" | "top-right" | "center-left" | "center-center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right">,
|
|
41
|
+
required: false,
|
|
42
|
+
default: "top-left"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
setup(props) {
|
package/components/FSDialog.vue
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
<FSCard
|
|
10
10
|
padding="24px"
|
|
11
11
|
gap="24px"
|
|
12
|
-
:width="width"
|
|
13
|
-
:class="classes"
|
|
14
|
-
:color="$props.color"
|
|
15
12
|
:border="!isExtraSmall"
|
|
13
|
+
:color="$props.color"
|
|
14
|
+
:class="classes"
|
|
15
|
+
:width="width"
|
|
16
16
|
>
|
|
17
17
|
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
18
18
|
<slot :name="name" v-bind="slotData" />
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
</FSCard>
|
|
21
21
|
<FSButton
|
|
22
22
|
class="fs-dialog-close-button"
|
|
23
|
-
variant="icon"
|
|
24
23
|
icon="mdi-close"
|
|
24
|
+
variant="icon"
|
|
25
25
|
:color="ColorEnum.Dark"
|
|
26
26
|
@click="$emit('update:modelValue', false)"
|
|
27
27
|
/>
|
|
@@ -37,6 +37,7 @@ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composa
|
|
|
37
37
|
import FSButton from "./FSButton.vue";
|
|
38
38
|
import FSCard from "./FSCard.vue";
|
|
39
39
|
import FSCol from "./FSCol.vue";
|
|
40
|
+
import { sizeToVar } from "../utils";
|
|
40
41
|
|
|
41
42
|
export default defineComponent({
|
|
42
43
|
name: "FSDialog",
|
|
@@ -46,25 +47,25 @@ export default defineComponent({
|
|
|
46
47
|
FSCol
|
|
47
48
|
},
|
|
48
49
|
props: {
|
|
50
|
+
width: {
|
|
51
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
52
|
+
required: false,
|
|
53
|
+
default: "auto"
|
|
54
|
+
},
|
|
55
|
+
cardClasses: {
|
|
56
|
+
type: [Array, String] as PropType<string[] | string | null>,
|
|
57
|
+
required: false,
|
|
58
|
+
default: null
|
|
59
|
+
},
|
|
49
60
|
modelValue: {
|
|
50
61
|
type: Boolean,
|
|
51
62
|
required: false,
|
|
52
63
|
default: false
|
|
53
64
|
},
|
|
54
|
-
width: {
|
|
55
|
-
type: [String, Number],
|
|
56
|
-
required: false,
|
|
57
|
-
default: "auto"
|
|
58
|
-
},
|
|
59
65
|
color: {
|
|
60
66
|
type: String as PropType<ColorBase>,
|
|
61
67
|
required: false,
|
|
62
68
|
default: ColorEnum.Dark
|
|
63
|
-
},
|
|
64
|
-
cardClasses: {
|
|
65
|
-
type: [Array, String] as PropType<string[] | string>,
|
|
66
|
-
required: false,
|
|
67
|
-
default: null
|
|
68
69
|
}
|
|
69
70
|
},
|
|
70
71
|
emits: ["update:modelValue"],
|
|
@@ -72,24 +73,26 @@ export default defineComponent({
|
|
|
72
73
|
const { isExtraSmall } = useBreakpoints();
|
|
73
74
|
|
|
74
75
|
const classes = computed((): string[] => {
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
const classNames = ["fs-dialog"];
|
|
77
|
+
if (props.cardClasses) {
|
|
78
|
+
if (Array.isArray(props.cardClasses)) {
|
|
79
|
+
classNames.push(...props.cardClasses);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
classNames.push(props.cardClasses);
|
|
83
|
+
}
|
|
81
84
|
}
|
|
82
85
|
if (isExtraSmall.value) {
|
|
83
|
-
|
|
86
|
+
classNames.push("fs-dialog-mobile");
|
|
84
87
|
}
|
|
85
|
-
return
|
|
88
|
+
return classNames;
|
|
86
89
|
});
|
|
87
90
|
|
|
88
|
-
const width = computed((): string
|
|
91
|
+
const width = computed((): string => {
|
|
89
92
|
if (isExtraSmall.value) {
|
|
90
93
|
return "100%";
|
|
91
94
|
}
|
|
92
|
-
return props.width;
|
|
95
|
+
return sizeToVar(props.width);
|
|
93
96
|
});
|
|
94
97
|
|
|
95
98
|
return {
|
package/components/FSDivider.vue
CHANGED
|
@@ -49,7 +49,7 @@ export default defineComponent({
|
|
|
49
49
|
default: null
|
|
50
50
|
},
|
|
51
51
|
width: {
|
|
52
|
-
type: [String, Number]
|
|
52
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
53
53
|
required: false,
|
|
54
54
|
default: "100%"
|
|
55
55
|
},
|
|
@@ -58,15 +58,15 @@ export default defineComponent({
|
|
|
58
58
|
required: false,
|
|
59
59
|
default: "text-body"
|
|
60
60
|
},
|
|
61
|
-
color: {
|
|
62
|
-
type: String as PropType<ColorBase>,
|
|
63
|
-
required: false,
|
|
64
|
-
default: ColorEnum.Light
|
|
65
|
-
},
|
|
66
61
|
variant: {
|
|
67
62
|
type: String as PropType<"base" | "light" | "dark">,
|
|
68
63
|
required: false,
|
|
69
64
|
default: "dark"
|
|
65
|
+
},
|
|
66
|
+
color: {
|
|
67
|
+
type: String as PropType<ColorBase>,
|
|
68
|
+
required: false,
|
|
69
|
+
default: ColorEnum.Light
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
setup(props) {
|
|
@@ -99,7 +99,7 @@ export default defineComponent({
|
|
|
99
99
|
return {
|
|
100
100
|
style,
|
|
101
101
|
isEmpty
|
|
102
|
-
}
|
|
102
|
+
};
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
</script>
|
|
@@ -62,18 +62,23 @@ export default defineComponent({
|
|
|
62
62
|
FSText
|
|
63
63
|
},
|
|
64
64
|
props: {
|
|
65
|
-
|
|
66
|
-
type: [String, Number]
|
|
65
|
+
height: {
|
|
66
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
67
67
|
required: false,
|
|
68
|
-
default:
|
|
68
|
+
default: null
|
|
69
69
|
},
|
|
70
70
|
width: {
|
|
71
|
-
type: [String, Number]
|
|
71
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
72
72
|
required: false,
|
|
73
73
|
default: null
|
|
74
74
|
},
|
|
75
|
-
|
|
76
|
-
type: [String, Number]
|
|
75
|
+
padding: {
|
|
76
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
77
|
+
required: false,
|
|
78
|
+
default: "8px"
|
|
79
|
+
},
|
|
80
|
+
modelValue: {
|
|
81
|
+
type: String as PropType<string | null>,
|
|
77
82
|
required: false,
|
|
78
83
|
default: null
|
|
79
84
|
},
|
|
@@ -86,11 +91,6 @@ export default defineComponent({
|
|
|
86
91
|
type: [String, Number],
|
|
87
92
|
required: false,
|
|
88
93
|
default: "4px"
|
|
89
|
-
},
|
|
90
|
-
modelValue: {
|
|
91
|
-
type: String as PropType<string | null>,
|
|
92
|
-
required: false,
|
|
93
|
-
default: null
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
emits: ["update:modelValue"],
|
package/components/FSFadeOut.vue
CHANGED
|
@@ -22,21 +22,21 @@ export default defineComponent({
|
|
|
22
22
|
name: "FSFadeOut",
|
|
23
23
|
props: {
|
|
24
24
|
height: {
|
|
25
|
-
type: [Array, String, Number] as PropType<string[] | number[] | string | number>,
|
|
25
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
26
26
|
required: true
|
|
27
27
|
},
|
|
28
28
|
width: {
|
|
29
|
-
type: [Array, String, Number] as PropType<string[] | number[] | string | number>,
|
|
29
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
30
30
|
required: false,
|
|
31
31
|
default: "100%"
|
|
32
32
|
},
|
|
33
33
|
padding: {
|
|
34
|
-
type: [String, Number]
|
|
34
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
35
35
|
required: false,
|
|
36
36
|
default: "0"
|
|
37
37
|
},
|
|
38
38
|
maskHeight: {
|
|
39
|
-
type: [String, Number]
|
|
39
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
40
40
|
required: false,
|
|
41
41
|
default: "64px"
|
|
42
42
|
}
|
|
@@ -59,56 +59,10 @@ export default defineComponent({
|
|
|
59
59
|
"--fs-fade-out-padding" : sizeToVar(props.padding),
|
|
60
60
|
"--fs-fade-out-mask-color" : backgrounds.base,
|
|
61
61
|
"--fs-fade-out-top-mask-height" : topMaskHeight.value,
|
|
62
|
-
"--fs-fade-out-top-mask-top" : topPadding.value,
|
|
63
62
|
"--fs-fade-out-bottom-mask-height" : bottomMaskHeight.value,
|
|
64
|
-
"--fs-fade-out-bottom-mask-bottom" : bottomPadding.value
|
|
65
63
|
};
|
|
66
64
|
});
|
|
67
65
|
|
|
68
|
-
const topPadding = computed((): string => {
|
|
69
|
-
switch (typeof props.padding) {
|
|
70
|
-
case "number": return sizeToVar(props.padding);
|
|
71
|
-
default:
|
|
72
|
-
const paddings = props.padding.split(" ");
|
|
73
|
-
let tempPadding = "0px";
|
|
74
|
-
switch (paddings.length) {
|
|
75
|
-
case 0 :
|
|
76
|
-
break;
|
|
77
|
-
default:
|
|
78
|
-
tempPadding = "-" + sizeToVar(paddings[0]);
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
if (tempPadding === "0px") {
|
|
82
|
-
return "-1px";
|
|
83
|
-
}
|
|
84
|
-
return tempPadding;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
const bottomPadding = computed((): string => {
|
|
89
|
-
switch (typeof props.padding) {
|
|
90
|
-
case "number": return sizeToVar(props.padding);
|
|
91
|
-
default:
|
|
92
|
-
const paddings = props.padding.split(" ");
|
|
93
|
-
let tempPadding = "0px";
|
|
94
|
-
switch (paddings.length) {
|
|
95
|
-
case 0 :
|
|
96
|
-
break;
|
|
97
|
-
case 1 :
|
|
98
|
-
case 2 :
|
|
99
|
-
tempPadding = "-" + sizeToVar(paddings[0]);
|
|
100
|
-
break;
|
|
101
|
-
default:
|
|
102
|
-
tempPadding = "-" + sizeToVar(paddings[2]);
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
if (tempPadding === "0px") {
|
|
106
|
-
return "-1px";
|
|
107
|
-
}
|
|
108
|
-
return tempPadding;
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
|
|
112
66
|
const onScroll = ({ target }): void => debounce(() => {
|
|
113
67
|
const currentTopMaskHeight = target.children[0].clientHeight;
|
|
114
68
|
const currentBottomMaskHeight = target.children[target.children.length - 1].clientHeight;
|
|
@@ -135,15 +89,15 @@ export default defineComponent({
|
|
|
135
89
|
|
|
136
90
|
const onResize = (): void => debounce(() => {
|
|
137
91
|
if (fadeOutRef.value) {
|
|
138
|
-
const currentTopMaskHeight = fadeOutRef.value.children[0].clientHeight;
|
|
139
|
-
const currentBottomMaskHeight = fadeOutRef.value.children[fadeOutRef.value.children.length - 1].clientHeight;
|
|
140
|
-
const contentHeight = fadeOutRef.value.scrollHeight - currentTopMaskHeight - currentBottomMaskHeight;
|
|
92
|
+
const currentTopMaskHeight = (fadeOutRef.value as any).children[0].clientHeight;
|
|
93
|
+
const currentBottomMaskHeight = (fadeOutRef.value as any).children[(fadeOutRef.value as any).children.length - 1].clientHeight;
|
|
94
|
+
const contentHeight = (fadeOutRef.value as any).scrollHeight - currentTopMaskHeight - currentBottomMaskHeight;
|
|
141
95
|
|
|
142
|
-
if (fadeOutRef.value.clientHeight < contentHeight) {
|
|
143
|
-
if (fadeOutRef.value.scrollHeight - fadeOutRef.value.scrollTop - fadeOutRef.value.clientHeight > 0) {
|
|
96
|
+
if ((fadeOutRef.value as any).clientHeight < contentHeight) {
|
|
97
|
+
if ((fadeOutRef.value as any).scrollHeight - (fadeOutRef.value as any).scrollTop - (fadeOutRef.value as any).clientHeight > 0) {
|
|
144
98
|
bottomMaskHeight.value = sizeToVar(props.maskHeight);
|
|
145
99
|
}
|
|
146
|
-
if (fadeOutRef.value.scrollTop > 0) {
|
|
100
|
+
if ((fadeOutRef.value as any).scrollTop > 0) {
|
|
147
101
|
topMaskHeight.value = sizeToVar(props.maskHeight);
|
|
148
102
|
}
|
|
149
103
|
}
|
|
@@ -156,7 +110,7 @@ export default defineComponent({
|
|
|
156
110
|
|
|
157
111
|
onMounted((): void => {
|
|
158
112
|
if (fadeOutRef.value) {
|
|
159
|
-
if (fadeOutRef.value.clientHeight < fadeOutRef.value.scrollHeight) {
|
|
113
|
+
if ((fadeOutRef.value as any).clientHeight < (fadeOutRef.value as any).scrollHeight) {
|
|
160
114
|
bottomMaskHeight.value = sizeToVar(props.maskHeight);
|
|
161
115
|
}
|
|
162
116
|
}
|
package/components/FSImage.vue
CHANGED
|
@@ -39,7 +39,7 @@ import { decode, isBlurhashValid } from "blurhash";
|
|
|
39
39
|
|
|
40
40
|
import { useImageBlurHash } from "@dative-gpi/foundation-shared-services/composables";
|
|
41
41
|
import { IMAGE_RAW_URL } from "@dative-gpi/foundation-shared-services/config/urls";
|
|
42
|
-
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
42
|
+
import { sizeToVar, varToSize } from "@dative-gpi/foundation-shared-components/utils";
|
|
43
43
|
|
|
44
44
|
import FSLoader from "./FSLoader.vue";
|
|
45
45
|
|
|
@@ -49,28 +49,23 @@ export default defineComponent({
|
|
|
49
49
|
FSLoader
|
|
50
50
|
},
|
|
51
51
|
props: {
|
|
52
|
-
|
|
53
|
-
type: String as PropType<string | null>,
|
|
52
|
+
height: {
|
|
53
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
54
54
|
required: false,
|
|
55
55
|
default: null
|
|
56
56
|
},
|
|
57
|
-
|
|
58
|
-
type: String as PropType<string | null>,
|
|
57
|
+
width: {
|
|
58
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
59
59
|
required: false,
|
|
60
60
|
default: null
|
|
61
61
|
},
|
|
62
|
-
|
|
63
|
-
type:
|
|
64
|
-
required: false,
|
|
65
|
-
default: true
|
|
66
|
-
},
|
|
67
|
-
width: {
|
|
68
|
-
type: [String, Number],
|
|
62
|
+
imageId: {
|
|
63
|
+
type: String as PropType<string | null>,
|
|
69
64
|
required: false,
|
|
70
65
|
default: null
|
|
71
66
|
},
|
|
72
|
-
|
|
73
|
-
type:
|
|
67
|
+
imageB64: {
|
|
68
|
+
type: String as PropType<string | null>,
|
|
74
69
|
required: false,
|
|
75
70
|
default: null
|
|
76
71
|
},
|
|
@@ -83,10 +78,15 @@ export default defineComponent({
|
|
|
83
78
|
type: [String, Number],
|
|
84
79
|
required: false,
|
|
85
80
|
default: "4px"
|
|
81
|
+
},
|
|
82
|
+
cover: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
required: false,
|
|
85
|
+
default: true
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
setup(props) {
|
|
89
|
-
const {
|
|
89
|
+
const { fetch: fetchBlurHash, entity: blurHash } = useImageBlurHash();
|
|
90
90
|
|
|
91
91
|
const imageRef = ref<HTMLFormElement | null>(null);
|
|
92
92
|
const canvasRef = ref<HTMLCanvasElement | null>(null);
|
|
@@ -106,9 +106,9 @@ export default defineComponent({
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
const computedHeight = computed(():
|
|
109
|
+
const computedHeight = computed((): string | undefined => {
|
|
110
110
|
if (props.height) {
|
|
111
|
-
return props.height;
|
|
111
|
+
return sizeToVar(props.height);
|
|
112
112
|
}
|
|
113
113
|
if (props.width) {
|
|
114
114
|
if (typeof (props.width) === "string") {
|
|
@@ -117,17 +117,17 @@ export default defineComponent({
|
|
|
117
117
|
if (props.aspectRatio) {
|
|
118
118
|
const split = props.aspectRatio.split('/');
|
|
119
119
|
if (split.length === 2 && !isNaN(parseFloat(split[0])) && !isNaN(parseFloat(split[1]))) {
|
|
120
|
-
return props.width * (parseFloat(split[1]) / parseFloat(split[0]));
|
|
120
|
+
return sizeToVar(varToSize(props.width) * (parseFloat(split[1]) / parseFloat(split[0])));
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
return props.width;
|
|
123
|
+
return sizeToVar(props.width);
|
|
124
124
|
}
|
|
125
125
|
return undefined;
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
const computedWidth = computed(():
|
|
128
|
+
const computedWidth = computed((): string | undefined => {
|
|
129
129
|
if (props.width) {
|
|
130
|
-
return props.width;
|
|
130
|
+
return sizeToVar(props.width);
|
|
131
131
|
}
|
|
132
132
|
if (props.height) {
|
|
133
133
|
if (typeof (props.height) === "string") {
|
|
@@ -136,10 +136,10 @@ export default defineComponent({
|
|
|
136
136
|
if (props.aspectRatio) {
|
|
137
137
|
const split = props.aspectRatio.split('/');
|
|
138
138
|
if (split.length === 2 && !isNaN(parseFloat(split[0])) && !isNaN(parseFloat(split[1]))) {
|
|
139
|
-
return props.height * (parseFloat(split[0]) / parseFloat(split[1]));
|
|
139
|
+
return sizeToVar(varToSize(props.height) * (parseFloat(split[0]) / parseFloat(split[1])));
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
return props.height;
|
|
142
|
+
return sizeToVar(props.height);
|
|
143
143
|
}
|
|
144
144
|
return undefined;
|
|
145
145
|
});
|
package/components/FSLoader.vue
CHANGED
|
@@ -16,30 +16,30 @@ import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
|
16
16
|
export default defineComponent({
|
|
17
17
|
name: "FSLoader",
|
|
18
18
|
props: {
|
|
19
|
-
|
|
20
|
-
type: [Array, String, Number] as PropType<string[] | number[] | string | number>,
|
|
19
|
+
height: {
|
|
20
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
21
21
|
required: false,
|
|
22
22
|
default: null
|
|
23
23
|
},
|
|
24
|
-
|
|
25
|
-
type: [Array, String, Number] as PropType<string[] | number[] | string | number>,
|
|
24
|
+
width: {
|
|
25
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
26
26
|
required: false,
|
|
27
27
|
default: null
|
|
28
28
|
},
|
|
29
29
|
padding: {
|
|
30
|
-
type: [String, Number]
|
|
30
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
31
31
|
required: false,
|
|
32
32
|
default: "0"
|
|
33
33
|
},
|
|
34
|
-
borderRadius: {
|
|
35
|
-
type: [String, Number],
|
|
36
|
-
required: false,
|
|
37
|
-
default: "4px"
|
|
38
|
-
},
|
|
39
34
|
variant: {
|
|
40
35
|
type: String as PropType<"standard" | "button" | "input" | "field" | "chip" | "text-h1" | "text-h2" | "text-h3" | "text-h4" | "text-body" | "text-button" | "text-overline" | "text-underline">,
|
|
41
36
|
required: false,
|
|
42
37
|
default: "standard"
|
|
38
|
+
},
|
|
39
|
+
borderRadius: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
required: false,
|
|
42
|
+
default: "4px"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
setup(props) {
|
|
@@ -161,12 +161,12 @@ export default defineComponent({
|
|
|
161
161
|
default: ColorEnum.Primary
|
|
162
162
|
},
|
|
163
163
|
padding: {
|
|
164
|
-
type: [String, Number]
|
|
164
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
165
165
|
required: false,
|
|
166
166
|
default: "3px"
|
|
167
167
|
},
|
|
168
168
|
gap: {
|
|
169
|
-
type: [String, Number]
|
|
169
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
170
170
|
required: false,
|
|
171
171
|
default: "0"
|
|
172
172
|
},
|