@dative-gpi/foundation-shared-components 0.0.26 → 0.0.28
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/FSAccordionPanel.vue +16 -19
- package/components/FSClickable.vue +7 -1
- package/components/FSFadeOut.vue +58 -17
- package/components/FSToggleSet.vue +3 -3
- package/components/fields/FSColorField.vue +7 -1
- package/package.json +4 -4
- package/styles/components/fs_accordion_panel.scss +11 -17
- package/styles/components/fs_fade_out.scss +4 -4
|
@@ -70,48 +70,45 @@ export default defineComponent({
|
|
|
70
70
|
required: false,
|
|
71
71
|
default: null
|
|
72
72
|
},
|
|
73
|
-
|
|
73
|
+
paddingTitle: {
|
|
74
74
|
type: [String, Number],
|
|
75
75
|
required: false,
|
|
76
|
-
default: "
|
|
76
|
+
default: "16px"
|
|
77
|
+
},
|
|
78
|
+
paddingContent: {
|
|
79
|
+
type: [String, Number],
|
|
80
|
+
required: false,
|
|
81
|
+
default: "16px"
|
|
77
82
|
},
|
|
78
83
|
divider: {
|
|
79
84
|
type: Boolean,
|
|
80
85
|
required: false,
|
|
81
|
-
default:
|
|
86
|
+
default: true
|
|
82
87
|
},
|
|
83
88
|
expandIcon: {
|
|
84
89
|
type: String,
|
|
85
90
|
required: false,
|
|
86
|
-
default: "
|
|
91
|
+
default: ""
|
|
87
92
|
},
|
|
88
93
|
collapseIcon: {
|
|
89
94
|
type: String,
|
|
90
95
|
required: false,
|
|
91
|
-
default: "
|
|
92
|
-
},
|
|
93
|
-
color: {
|
|
94
|
-
type: String as PropType<ColorBase>,
|
|
95
|
-
required: false,
|
|
96
|
-
default: ColorEnum.Primary
|
|
96
|
+
default: ""
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
setup(props) {
|
|
100
100
|
const { getColors } = useColors();
|
|
101
101
|
|
|
102
|
-
const colors = computed(() => getColors(props.color));
|
|
103
102
|
const backgrounds = getColors(ColorEnum.Background);
|
|
104
|
-
const
|
|
103
|
+
const lights = getColors(ColorEnum.Light);
|
|
105
104
|
|
|
106
105
|
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
107
106
|
return {
|
|
108
|
-
"--fs-accordion-panel-
|
|
109
|
-
"--fs-accordion-panel-
|
|
110
|
-
"--fs-accordion-panel-
|
|
111
|
-
"--fs-accordion-panel-
|
|
112
|
-
"--fs-accordion-panel-color"
|
|
113
|
-
"--fs-accordion-panel-hover-background-color": colors.value.light,
|
|
114
|
-
"--fs-accordion-panel-hover-color" : colors.value.base,
|
|
107
|
+
"--fs-accordion-panel-padding-title" : sizeToVar(props.paddingTitle),
|
|
108
|
+
"--fs-accordion-panel-padding-content" : sizeToVar(props.paddingContent),
|
|
109
|
+
"--fs-accordion-panel-divider-size" : props.divider ? "1px" : "0",
|
|
110
|
+
"--fs-accordion-panel-divider-color" : lights.dark,
|
|
111
|
+
"--fs-accordion-panel-background-color" : backgrounds.base
|
|
115
112
|
};
|
|
116
113
|
});
|
|
117
114
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<button
|
|
3
3
|
v-if="!href"
|
|
4
4
|
:class="wrapperClasses"
|
|
5
|
+
:type="$props.type"
|
|
5
6
|
@click.stop="onClick"
|
|
6
7
|
>
|
|
7
8
|
<FSCard
|
|
@@ -69,10 +70,15 @@ export default defineComponent({
|
|
|
69
70
|
required: false,
|
|
70
71
|
default: "standard"
|
|
71
72
|
},
|
|
73
|
+
type: {
|
|
74
|
+
type: String as PropType<"button" | "submit">,
|
|
75
|
+
required: false,
|
|
76
|
+
default: "submit"
|
|
77
|
+
},
|
|
72
78
|
color: {
|
|
73
79
|
type: String as PropType<ColorBase>,
|
|
74
80
|
required: false,
|
|
75
|
-
default: ColorEnum.
|
|
81
|
+
default: ColorEnum.Light
|
|
76
82
|
},
|
|
77
83
|
fullWidth: {
|
|
78
84
|
type: Boolean,
|
package/components/FSFadeOut.vue
CHANGED
|
@@ -11,23 +11,28 @@
|
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script lang="ts">
|
|
14
|
-
import { defineComponent,
|
|
14
|
+
import { computed, defineComponent, PropType, ref } from "vue";
|
|
15
15
|
|
|
16
16
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
17
17
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
18
|
-
|
|
19
|
-
import FSCol from "./FSCol.vue";
|
|
18
|
+
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
20
19
|
|
|
21
20
|
export default defineComponent({
|
|
22
21
|
name: "FSFadeOut",
|
|
23
|
-
components: {
|
|
24
|
-
FSCol
|
|
25
|
-
},
|
|
26
22
|
props: {
|
|
23
|
+
height: {
|
|
24
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number>,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
padding: {
|
|
28
|
+
type: [String, Number],
|
|
29
|
+
required: false,
|
|
30
|
+
default: "0"
|
|
31
|
+
},
|
|
27
32
|
maskHeight: {
|
|
28
|
-
type: Number,
|
|
33
|
+
type: [String, Number],
|
|
29
34
|
required: false,
|
|
30
|
-
default:
|
|
35
|
+
default: "64px"
|
|
31
36
|
}
|
|
32
37
|
},
|
|
33
38
|
setup(props) {
|
|
@@ -35,23 +40,59 @@ export default defineComponent({
|
|
|
35
40
|
|
|
36
41
|
const backgrounds = getColors(ColorEnum.Background);
|
|
37
42
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
const topMaskHeight = ref("0px");
|
|
44
|
+
const bottomMaskHeight = ref(sizeToVar(props.maskHeight));
|
|
45
|
+
|
|
46
|
+
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
47
|
+
return {
|
|
48
|
+
"--fs-fade-out-height" : sizeToVar(props.height),
|
|
49
|
+
"--fs-fade-out-padding" : sizeToVar(props.padding),
|
|
50
|
+
"--fs-fade-out-mask-color" : backgrounds.base,
|
|
51
|
+
"--fs-fade-out-top-mask-height" : topMaskHeight.value,
|
|
52
|
+
"--fs-fade-out-top-mask-top" : topPadding.value,
|
|
53
|
+
"--fs-fade-out-bottom-mask-height": bottomMaskHeight.value,
|
|
54
|
+
"--fs-fade-out-bottom-mask-bottom": bottomPadding.value
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const topPadding = computed((): string => {
|
|
59
|
+
switch (typeof props.padding) {
|
|
60
|
+
case "number": return sizeToVar(props.padding);
|
|
61
|
+
default:
|
|
62
|
+
const paddings = props.padding.split(" ");
|
|
63
|
+
switch (paddings.length) {
|
|
64
|
+
case 0 : return "0px";
|
|
65
|
+
default: return "-" + sizeToVar(paddings[0]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const bottomPadding = computed((): string => {
|
|
71
|
+
switch (typeof props.padding) {
|
|
72
|
+
case "number": return sizeToVar(props.padding);
|
|
73
|
+
default:
|
|
74
|
+
const paddings = props.padding.split(" ");
|
|
75
|
+
switch (paddings.length) {
|
|
76
|
+
case 0 : return "0px";
|
|
77
|
+
case 1 :
|
|
78
|
+
case 2 : return "-" + sizeToVar(paddings[0]);
|
|
79
|
+
default: return "-" + sizeToVar(paddings[2]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
42
82
|
});
|
|
43
83
|
|
|
44
84
|
const onScroll = ({ target }): void => {
|
|
45
85
|
if (target.scrollHeight - target.scrollTop - target.clientHeight < 1) {
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
86
|
+
bottomMaskHeight.value = "0px";
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
bottomMaskHeight.value = sizeToVar(props.maskHeight);
|
|
49
90
|
}
|
|
50
91
|
if (target.scrollTop === 0) {
|
|
51
|
-
|
|
92
|
+
topMaskHeight.value = "0px";
|
|
52
93
|
}
|
|
53
94
|
else {
|
|
54
|
-
|
|
95
|
+
topMaskHeight.value = sizeToVar(props.maskHeight);
|
|
55
96
|
}
|
|
56
97
|
}
|
|
57
98
|
|
|
@@ -148,12 +148,12 @@ export default defineComponent({
|
|
|
148
148
|
padding: {
|
|
149
149
|
type: [String, Number],
|
|
150
150
|
required: false,
|
|
151
|
-
default: 0
|
|
151
|
+
default: "0"
|
|
152
152
|
},
|
|
153
153
|
gap: {
|
|
154
|
-
type: Number,
|
|
154
|
+
type: [String, Number],
|
|
155
155
|
required: false,
|
|
156
|
-
default:
|
|
156
|
+
default: "8px"
|
|
157
157
|
},
|
|
158
158
|
multiple: {
|
|
159
159
|
type: Boolean,
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
</FSTextField>
|
|
40
40
|
<FSTextField
|
|
41
|
+
v-if="$props.allowOpacity"
|
|
41
42
|
class="fs-color-field-opacity"
|
|
42
43
|
:label="$tr('ui.color-field.opacity', 'Opacity')"
|
|
43
44
|
:hideHeader="$props.hideHeader"
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
class="fs-color-field-picker"
|
|
91
92
|
mode="hexa"
|
|
92
93
|
:elevation="0"
|
|
93
|
-
:modes="['hexa', 'rgba']"
|
|
94
|
+
:modes="allowOpacity ? ['hexa', 'rgba'] : ['hex', 'rgb']"
|
|
94
95
|
:modelValue="fullColor"
|
|
95
96
|
@update:modelValue="onSubmit"
|
|
96
97
|
/>
|
|
@@ -153,6 +154,11 @@ export default defineComponent({
|
|
|
153
154
|
type: Boolean,
|
|
154
155
|
required: false,
|
|
155
156
|
default: true
|
|
157
|
+
},
|
|
158
|
+
allowOpacity: {
|
|
159
|
+
type: Boolean,
|
|
160
|
+
required: false,
|
|
161
|
+
default: true
|
|
156
162
|
}
|
|
157
163
|
},
|
|
158
164
|
emits: ["update:modelValue", "update:opacity"],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.28",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "0.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "0.0.28",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.28",
|
|
15
15
|
"@fontsource/montserrat": "^5.0.16",
|
|
16
16
|
"@lexical/clipboard": "^0.12.5",
|
|
17
17
|
"@lexical/history": "^0.12.5",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"sass": "^1.69.5",
|
|
33
33
|
"sass-loader": "^13.3.2"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "45b9e0404609c0003f918d847f47b5395152df2a"
|
|
36
36
|
}
|
|
@@ -1,38 +1,32 @@
|
|
|
1
1
|
.fs-accordion-panel > .v-expansion-panel-title {
|
|
2
|
-
border-radius: var(--fs-accordion-panel-border-radius) !important;
|
|
3
|
-
transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
|
|
4
|
-
min-height: 0 !important;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
padding: 12px;
|
|
7
|
-
|
|
8
2
|
background-color: var(--fs-accordion-panel-background-color) !important;
|
|
9
|
-
|
|
3
|
+
padding: var(--fs-accordion-panel-padding-title);
|
|
4
|
+
min-height: 0 !important;
|
|
10
5
|
|
|
11
6
|
&:hover,
|
|
12
7
|
&--active {
|
|
13
|
-
background-color: var(--fs-accordion-panel-
|
|
14
|
-
color: var(--fs-accordion-panel-hover-color) !important;
|
|
15
|
-
min-height: 0 !important;
|
|
8
|
+
background-color: var(--fs-accordion-panel-background-color) !important;
|
|
16
9
|
|
|
17
10
|
& .fs-accordion-panel-title {
|
|
18
11
|
@extend .text-button
|
|
19
12
|
}
|
|
20
13
|
}
|
|
14
|
+
|
|
15
|
+
& > .v-expansion-panel-title__overlay {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
21
18
|
}
|
|
22
19
|
|
|
23
20
|
.fs-accordion-panel > .v-expansion-panel-text {
|
|
24
|
-
border-radius: var(--fs-accordion-panel-border-radius) !important;
|
|
25
|
-
transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
|
|
26
|
-
padding: 12px;
|
|
27
|
-
|
|
28
21
|
background-color: var(--fs-accordion-panel-background-color) !important;
|
|
29
|
-
|
|
22
|
+
padding: 0px;
|
|
23
|
+
|
|
30
24
|
|
|
31
25
|
& > .v-expansion-panel-text__wrapper {
|
|
32
|
-
padding:
|
|
26
|
+
padding: var(--fs-accordion-panel-padding-content);
|
|
33
27
|
}
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
.v-expansion-panel:not(:first-child)::after {
|
|
37
|
-
border-top: var(--fs-accordion-panel-
|
|
31
|
+
border-top: var(--fs-accordion-panel-divider-size) solid var(--fs-accordion-panel-divider-color) !important;
|
|
38
32
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
.fs-fade-out {
|
|
2
2
|
@extend .fs-hide-y-scrollbar;
|
|
3
3
|
|
|
4
|
+
padding: var(--fs-fade-out-padding);
|
|
5
|
+
height: var(--fs-fade-out-height);
|
|
4
6
|
flex-direction: column;
|
|
5
7
|
position: relative;
|
|
6
8
|
display: flex;
|
|
@@ -14,8 +16,7 @@
|
|
|
14
16
|
height: var(--fs-fade-out-top-mask-height);
|
|
15
17
|
min-height: var(--fs-fade-out-top-mask-height);
|
|
16
18
|
width: 100%;
|
|
17
|
-
top:
|
|
18
|
-
left: 0;
|
|
19
|
+
top: var(--fs-fade-out-top-mask-top);
|
|
19
20
|
transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
|
|
20
21
|
background: linear-gradient(to top, transparent 0, var(--fs-fade-out-mask-color) var(--fs-fade-out-top-mask-height));
|
|
21
22
|
}
|
|
@@ -28,8 +29,7 @@
|
|
|
28
29
|
height: var(--fs-fade-out-bottom-mask-height);
|
|
29
30
|
min-height: var(--fs-fade-out-bottom-mask-height);
|
|
30
31
|
width: 100%;
|
|
31
|
-
bottom:
|
|
32
|
-
left: 0;
|
|
32
|
+
bottom: var(--fs-fade-out-bottom-mask-bottom);
|
|
33
33
|
transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
|
|
34
34
|
background: linear-gradient(to bottom, transparent 0, var(--fs-fade-out-mask-color) var(--fs-fade-out-bottom-mask-height));
|
|
35
35
|
}
|