@dative-gpi/foundation-shared-components 1.0.4 → 1.0.6
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/FSBreadcrumbs.vue +4 -5
- package/components/FSButton.vue +3 -5
- package/components/FSCard.vue +18 -9
- package/components/FSColor.vue +13 -31
- package/components/FSIconCard.vue +4 -6
- package/components/fields/FSColorField.vue +15 -9
- package/components/views/FSEntityHeader.vue +319 -0
- package/components/views/FSEntityView.vue +148 -0
- package/components/views/FSSkeletonView.vue +100 -0
- package/composables/useColors.ts +12 -3
- package/package.json +4 -4
- package/styles/components/fs_text_area.scss +1 -2
|
@@ -27,11 +27,9 @@
|
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
29
|
<script lang="ts">
|
|
30
|
-
import type
|
|
31
|
-
import { defineComponent, ref } from "vue";
|
|
30
|
+
import { defineComponent, type PropType, type Ref, ref } from "vue";
|
|
32
31
|
|
|
33
|
-
import type
|
|
34
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
32
|
+
import { ColorEnum, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
|
|
35
33
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
36
34
|
|
|
37
35
|
import FSSpan from "./FSSpan.vue";
|
|
@@ -46,7 +44,8 @@ export default defineComponent({
|
|
|
46
44
|
props: {
|
|
47
45
|
items: {
|
|
48
46
|
type: Array as PropType<FSBreadcrumbItem[]>,
|
|
49
|
-
required:
|
|
47
|
+
required: false,
|
|
48
|
+
default: () => []
|
|
50
49
|
}
|
|
51
50
|
},
|
|
52
51
|
setup() {
|
package/components/FSButton.vue
CHANGED
|
@@ -128,13 +128,11 @@
|
|
|
128
128
|
</template>
|
|
129
129
|
|
|
130
130
|
<script lang="ts">
|
|
131
|
-
import type
|
|
132
|
-
import {
|
|
133
|
-
import type { RouteLocation } from "vue-router";
|
|
131
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
132
|
+
import { type RouteLocation } from "vue-router";
|
|
134
133
|
|
|
134
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
135
135
|
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
136
|
-
import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
|
|
137
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
138
136
|
|
|
139
137
|
import FSClickable from "./FSClickable.vue";
|
|
140
138
|
import FSSpan from "./FSSpan.vue";
|
package/components/FSCard.vue
CHANGED
|
@@ -34,11 +34,9 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script lang="ts">
|
|
37
|
-
import type
|
|
38
|
-
import { computed, defineComponent } from "vue";
|
|
37
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
39
38
|
|
|
40
|
-
import type
|
|
41
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
39
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
42
40
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
43
41
|
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
44
42
|
|
|
@@ -73,7 +71,7 @@ export default defineComponent({
|
|
|
73
71
|
default: "8px"
|
|
74
72
|
},
|
|
75
73
|
variant: {
|
|
76
|
-
type: String as PropType<"background" | "standard" | "gradient">,
|
|
74
|
+
type: String as PropType<"background" | "standard" | "full" | "gradient">,
|
|
77
75
|
required: false,
|
|
78
76
|
default: "background"
|
|
79
77
|
},
|
|
@@ -119,6 +117,17 @@ export default defineComponent({
|
|
|
119
117
|
|
|
120
118
|
const style = computed((): { [key: string] : string | null | undefined } => {
|
|
121
119
|
switch (props.variant) {
|
|
120
|
+
case "background": return {
|
|
121
|
+
"--fs-card-border-size" : props.border ? "1px" : "0",
|
|
122
|
+
"--fs-card-border-style" : props.borderStyle,
|
|
123
|
+
"--fs-card-border-radius" : sizeToVar(props.borderRadius),
|
|
124
|
+
"--fs-card-padding" : sizeToVar(props.padding),
|
|
125
|
+
"--fs-card-height" : sizeToVar(props.height),
|
|
126
|
+
"--fs-card-width" : sizeToVar(props.width),
|
|
127
|
+
"--fs-card-background-color": backgrounds.base,
|
|
128
|
+
"--fs-card-border-color" : lights.dark,
|
|
129
|
+
"--fs-card-color" : darks.base
|
|
130
|
+
}
|
|
122
131
|
case "standard": return {
|
|
123
132
|
"--fs-card-border-size" : props.border ? "1px" : "0",
|
|
124
133
|
"--fs-card-border-style" : props.borderStyle,
|
|
@@ -130,16 +139,16 @@ export default defineComponent({
|
|
|
130
139
|
"--fs-card-border-color" : colors.value.lightContrast,
|
|
131
140
|
"--fs-card-color" : colors.value.lightContrast
|
|
132
141
|
}
|
|
133
|
-
case "
|
|
142
|
+
case "full": return {
|
|
134
143
|
"--fs-card-border-size" : props.border ? "1px" : "0",
|
|
135
144
|
"--fs-card-border-style" : props.borderStyle,
|
|
136
145
|
"--fs-card-border-radius" : sizeToVar(props.borderRadius),
|
|
137
146
|
"--fs-card-padding" : sizeToVar(props.padding),
|
|
138
147
|
"--fs-card-height" : sizeToVar(props.height),
|
|
139
148
|
"--fs-card-width" : sizeToVar(props.width),
|
|
140
|
-
"--fs-card-background-color":
|
|
141
|
-
"--fs-card-border-color" :
|
|
142
|
-
"--fs-card-color" :
|
|
149
|
+
"--fs-card-background-color": colors.value.base,
|
|
150
|
+
"--fs-card-border-color" : colors.value.base,
|
|
151
|
+
"--fs-card-color" : colors.value.baseContrast
|
|
143
152
|
}
|
|
144
153
|
case "gradient": return {
|
|
145
154
|
"--fs-card-border-size" : props.border ? "1px" : "0",
|
package/components/FSColor.vue
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSCard
|
|
3
|
+
:variant="$props.variant"
|
|
3
4
|
:border="$props.border"
|
|
4
|
-
:
|
|
5
|
-
:style="style"
|
|
5
|
+
:color="$props.color"
|
|
6
6
|
v-bind="$attrs"
|
|
7
7
|
>
|
|
8
8
|
<slot
|
|
@@ -12,11 +12,9 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script lang="ts">
|
|
15
|
-
import type
|
|
16
|
-
import { computed, defineComponent } from "vue";
|
|
15
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
17
16
|
|
|
18
|
-
import type
|
|
19
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
17
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
20
18
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
21
19
|
|
|
22
20
|
import FSCard from "./FSCard.vue";
|
|
@@ -27,15 +25,20 @@ export default defineComponent({
|
|
|
27
25
|
FSCard
|
|
28
26
|
},
|
|
29
27
|
props: {
|
|
30
|
-
|
|
31
|
-
type:
|
|
28
|
+
variant: {
|
|
29
|
+
type: String as PropType<"standard" | "full">,
|
|
32
30
|
required: false,
|
|
33
|
-
default:
|
|
31
|
+
default: "standard"
|
|
34
32
|
},
|
|
35
33
|
color: {
|
|
36
34
|
type: String as PropType<ColorBase>,
|
|
37
35
|
required: false,
|
|
38
36
|
default: ColorEnum.Primary
|
|
37
|
+
},
|
|
38
|
+
border: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
required: false,
|
|
41
|
+
default: true
|
|
39
42
|
}
|
|
40
43
|
},
|
|
41
44
|
setup(props) {
|
|
@@ -43,29 +46,8 @@ export default defineComponent({
|
|
|
43
46
|
|
|
44
47
|
const colors = computed(() => getColors(props.color));
|
|
45
48
|
|
|
46
|
-
const style = computed((): { [key: string] : string | null | undefined } => {
|
|
47
|
-
return {
|
|
48
|
-
"--fs-color-background-color": colors.value.light,
|
|
49
|
-
"--fs-color-border-color" : colors.value.lightContrast,
|
|
50
|
-
"--fs-color-color" : colors.value.lightContrast,
|
|
51
|
-
"--fs-color-light" : colors.value.light,
|
|
52
|
-
"--fs-color-base" : colors.value.base,
|
|
53
|
-
"--fs-color-dark" : colors.value.dark
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
const classes = computed((): string[] => {
|
|
58
|
-
const classNames = ["fs-color"];
|
|
59
|
-
if (props.border) {
|
|
60
|
-
classNames.push("fs-color-border");
|
|
61
|
-
}
|
|
62
|
-
return classNames;
|
|
63
|
-
});
|
|
64
|
-
|
|
65
49
|
return {
|
|
66
|
-
|
|
67
|
-
colors,
|
|
68
|
-
style
|
|
50
|
+
colors
|
|
69
51
|
};
|
|
70
52
|
}
|
|
71
53
|
});
|
|
@@ -21,11 +21,9 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script lang="ts">
|
|
24
|
-
import type
|
|
25
|
-
import { computed, defineComponent } from "vue";
|
|
24
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
26
25
|
|
|
27
|
-
import type
|
|
28
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
26
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
29
27
|
|
|
30
28
|
import FSCard from "./FSCard.vue";
|
|
31
29
|
import FSIcon from "./FSIcon.vue";
|
|
@@ -67,14 +65,14 @@ export default defineComponent({
|
|
|
67
65
|
const variant = computed((): "background" | "gradient" => {
|
|
68
66
|
switch (props.backgroundColor) {
|
|
69
67
|
case ColorEnum.Background: return "background";
|
|
70
|
-
default:
|
|
68
|
+
default : return "gradient";
|
|
71
69
|
}
|
|
72
70
|
});
|
|
73
71
|
|
|
74
72
|
const border = computed((): boolean => {
|
|
75
73
|
switch (props.backgroundColor) {
|
|
76
74
|
case ColorEnum.Background: return true;
|
|
77
|
-
default:
|
|
75
|
+
default : return false;
|
|
78
76
|
}
|
|
79
77
|
});
|
|
80
78
|
|
|
@@ -112,7 +112,7 @@ export default defineComponent({
|
|
|
112
112
|
default: null
|
|
113
113
|
},
|
|
114
114
|
modelValue: {
|
|
115
|
-
type: String
|
|
115
|
+
type: String as PropType<string | null>,
|
|
116
116
|
required: false,
|
|
117
117
|
default: "#000000"
|
|
118
118
|
},
|
|
@@ -164,9 +164,9 @@ export default defineComponent({
|
|
|
164
164
|
|
|
165
165
|
const menu = ref(false);
|
|
166
166
|
|
|
167
|
-
const innerColor = ref(
|
|
168
|
-
const innerOpacity = ref(
|
|
169
|
-
const fullColor = ref(
|
|
167
|
+
const innerColor = ref("#000000");
|
|
168
|
+
const innerOpacity = ref("00");
|
|
169
|
+
const fullColor = ref("#00000000");
|
|
170
170
|
|
|
171
171
|
const style = computed((): { [key: string]: string | undefined } => {
|
|
172
172
|
if (!props.editable) {
|
|
@@ -185,7 +185,6 @@ export default defineComponent({
|
|
|
185
185
|
};
|
|
186
186
|
});
|
|
187
187
|
|
|
188
|
-
|
|
189
188
|
const onSubmit = (value: string) => {
|
|
190
189
|
innerColor.value = value.substring(0, 7);
|
|
191
190
|
innerOpacity.value = value.length === 9 ? value.substring(7, 9) : "FF";
|
|
@@ -195,14 +194,21 @@ export default defineComponent({
|
|
|
195
194
|
};
|
|
196
195
|
|
|
197
196
|
const reset = (): void => {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
if (props.modelValue) {
|
|
198
|
+
innerColor.value = getColors(props.modelValue)['base'];
|
|
199
|
+
innerOpacity.value = getHexFromPercentage(props.opacityValue);
|
|
200
|
+
fullColor.value = innerColor.value + innerOpacity.value;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
innerColor.value = "#000000";
|
|
204
|
+
innerOpacity.value = "00";
|
|
205
|
+
fullColor.value = "#00000000";
|
|
206
|
+
}
|
|
201
207
|
};
|
|
202
208
|
|
|
203
209
|
watch(() => props.modelValue, () => {
|
|
204
210
|
reset();
|
|
205
|
-
});
|
|
211
|
+
}, { immediate: true });
|
|
206
212
|
|
|
207
213
|
return {
|
|
208
214
|
getPercentageFromHex,
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template
|
|
3
|
+
v-if="isExtraSmall"
|
|
4
|
+
>
|
|
5
|
+
<FSCol
|
|
6
|
+
class="f-entity-header"
|
|
7
|
+
padding="0 10px 0 0"
|
|
8
|
+
align="center-left"
|
|
9
|
+
gap="12px"
|
|
10
|
+
>
|
|
11
|
+
<FSRow
|
|
12
|
+
align="center-left"
|
|
13
|
+
gap="12px"
|
|
14
|
+
:height="imageSize"
|
|
15
|
+
:wrap="false"
|
|
16
|
+
>
|
|
17
|
+
<FSImage
|
|
18
|
+
v-if="$props.imageId"
|
|
19
|
+
:imageId="$props.imageId"
|
|
20
|
+
:height="imageSize"
|
|
21
|
+
:width="imageSize"
|
|
22
|
+
:cover="imageCover"
|
|
23
|
+
/>
|
|
24
|
+
<FSIcon
|
|
25
|
+
v-else-if="$props.icon && $props.color"
|
|
26
|
+
:icon="$props.icon"
|
|
27
|
+
:size="imageSize"
|
|
28
|
+
:color="$props.color"
|
|
29
|
+
/>
|
|
30
|
+
<FSIconCard
|
|
31
|
+
v-else-if="$props.icon && $props.iconBackgroundColors && $props.iconBackgroundColors.length > 0"
|
|
32
|
+
:icon="$props.icon"
|
|
33
|
+
:size="imageSize"
|
|
34
|
+
:backgroundColor="$props.iconBackgroundColors"
|
|
35
|
+
/>
|
|
36
|
+
<FSCol
|
|
37
|
+
align="center-left"
|
|
38
|
+
:width="`calc(100% - ${rightOverflow})`"
|
|
39
|
+
>
|
|
40
|
+
<template
|
|
41
|
+
v-if="$props.subtitle && $props.description"
|
|
42
|
+
>
|
|
43
|
+
<FSText
|
|
44
|
+
font="text-h3"
|
|
45
|
+
>
|
|
46
|
+
{{ $props.title }}
|
|
47
|
+
</FSText>
|
|
48
|
+
<FSCol
|
|
49
|
+
align="center-left"
|
|
50
|
+
gap="4px"
|
|
51
|
+
>
|
|
52
|
+
<FSText>
|
|
53
|
+
{{ $props.subtitle }}
|
|
54
|
+
</FSText>
|
|
55
|
+
<FSText
|
|
56
|
+
font="text-overline"
|
|
57
|
+
>
|
|
58
|
+
{{ $props.description }}
|
|
59
|
+
</FSText>
|
|
60
|
+
</FSCol>
|
|
61
|
+
</template>
|
|
62
|
+
<template
|
|
63
|
+
v-else-if="$props.subtitle && !$props.description"
|
|
64
|
+
>
|
|
65
|
+
<FSText
|
|
66
|
+
font="text-h3"
|
|
67
|
+
:lineClamp="2"
|
|
68
|
+
>
|
|
69
|
+
{{ $props.title }}
|
|
70
|
+
</FSText>
|
|
71
|
+
<FSText>
|
|
72
|
+
{{ $props.subtitle }}
|
|
73
|
+
</FSText>
|
|
74
|
+
</template>
|
|
75
|
+
<template
|
|
76
|
+
v-else-if="!$props.subtitle && $props.description"
|
|
77
|
+
>
|
|
78
|
+
<FSText
|
|
79
|
+
font="text-h3"
|
|
80
|
+
:lineClamp="2"
|
|
81
|
+
>
|
|
82
|
+
{{ $props.title }}
|
|
83
|
+
</FSText>
|
|
84
|
+
<FSText
|
|
85
|
+
font="text-overline"
|
|
86
|
+
:lineClamp="2"
|
|
87
|
+
>
|
|
88
|
+
{{ $props.description }}
|
|
89
|
+
</FSText>
|
|
90
|
+
</template>
|
|
91
|
+
<template
|
|
92
|
+
v-else
|
|
93
|
+
>
|
|
94
|
+
<FSText
|
|
95
|
+
font="text-h3"
|
|
96
|
+
:lineClamp="2"
|
|
97
|
+
>
|
|
98
|
+
{{ $props.title }}
|
|
99
|
+
</FSText>
|
|
100
|
+
</template>
|
|
101
|
+
</FSCol>
|
|
102
|
+
</FSRow>
|
|
103
|
+
<template
|
|
104
|
+
v-if="!$props.light"
|
|
105
|
+
>
|
|
106
|
+
<FSBreadcrumbs
|
|
107
|
+
:items="$props.breadcrumbs"
|
|
108
|
+
/>
|
|
109
|
+
<FSSlideGroup
|
|
110
|
+
v-if="slots['toolbar']"
|
|
111
|
+
>
|
|
112
|
+
<slot
|
|
113
|
+
name="toolbar"
|
|
114
|
+
/>
|
|
115
|
+
</FSSlideGroup>
|
|
116
|
+
<slot
|
|
117
|
+
name="title-append"
|
|
118
|
+
/>
|
|
119
|
+
</template>
|
|
120
|
+
</FSCol>
|
|
121
|
+
</template>
|
|
122
|
+
<template
|
|
123
|
+
v-else
|
|
124
|
+
>
|
|
125
|
+
<FSCol
|
|
126
|
+
class="f-entity-header"
|
|
127
|
+
padding="0 14px 0 0"
|
|
128
|
+
align="center-left"
|
|
129
|
+
gap="16px"
|
|
130
|
+
>
|
|
131
|
+
<FSRow
|
|
132
|
+
align="center-left"
|
|
133
|
+
gap="16px"
|
|
134
|
+
:height="imageSize"
|
|
135
|
+
:wrap="false"
|
|
136
|
+
>
|
|
137
|
+
<FSImage
|
|
138
|
+
v-if="$props.imageId"
|
|
139
|
+
:imageId="$props.imageId"
|
|
140
|
+
:height="imageSize"
|
|
141
|
+
:width="imageSize"
|
|
142
|
+
:cover="imageCover"
|
|
143
|
+
/>
|
|
144
|
+
<FSIconCard
|
|
145
|
+
v-else-if="$props.icon && $props.iconBackgroundColors && $props.iconBackgroundColors.length > 0"
|
|
146
|
+
:icon="$props.icon"
|
|
147
|
+
:size="imageSize"
|
|
148
|
+
iconSize="70px"
|
|
149
|
+
:backgroundColor="$props.iconBackgroundColors"
|
|
150
|
+
/>
|
|
151
|
+
<FSIcon
|
|
152
|
+
v-else-if="$props.icon"
|
|
153
|
+
:icon="$props.icon"
|
|
154
|
+
:size="imageSize"
|
|
155
|
+
:color="$props.color"
|
|
156
|
+
/>
|
|
157
|
+
<FSCol
|
|
158
|
+
align="center-left"
|
|
159
|
+
>
|
|
160
|
+
<FSText
|
|
161
|
+
:font="$props.light ? 'text-h3' : 'text-h2'"
|
|
162
|
+
>
|
|
163
|
+
{{ $props.title }}
|
|
164
|
+
</FSText>
|
|
165
|
+
<FSCol
|
|
166
|
+
v-if="!$props.light && ($props.subtitle || $props.description)"
|
|
167
|
+
gap="4px"
|
|
168
|
+
>
|
|
169
|
+
<FSText
|
|
170
|
+
v-if="$props.subtitle"
|
|
171
|
+
>
|
|
172
|
+
{{ $props.subtitle }}
|
|
173
|
+
</FSText>
|
|
174
|
+
<FSText
|
|
175
|
+
v-if="$props.description"
|
|
176
|
+
font="text-overline"
|
|
177
|
+
:lineClamp="2"
|
|
178
|
+
>
|
|
179
|
+
{{ $props.description }}
|
|
180
|
+
</FSText>
|
|
181
|
+
</FSCol>
|
|
182
|
+
</FSCol>
|
|
183
|
+
<FSRow
|
|
184
|
+
v-if="!$props.light"
|
|
185
|
+
align="center-right"
|
|
186
|
+
>
|
|
187
|
+
<slot
|
|
188
|
+
name="title-append"
|
|
189
|
+
/>
|
|
190
|
+
</FSRow>
|
|
191
|
+
</FSRow>
|
|
192
|
+
<template
|
|
193
|
+
v-if="!$props.light"
|
|
194
|
+
>
|
|
195
|
+
<FSBreadcrumbs
|
|
196
|
+
:items="$props.breadcrumbs"
|
|
197
|
+
/>
|
|
198
|
+
<FSSlideGroup
|
|
199
|
+
v-if="slots['toolbar']"
|
|
200
|
+
>
|
|
201
|
+
<slot
|
|
202
|
+
name="toolbar"
|
|
203
|
+
/>
|
|
204
|
+
</FSSlideGroup>
|
|
205
|
+
</template>
|
|
206
|
+
</FSCol>
|
|
207
|
+
</template>
|
|
208
|
+
</template>
|
|
209
|
+
|
|
210
|
+
<script lang="ts">
|
|
211
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
212
|
+
|
|
213
|
+
import { type ColorEnum, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
|
|
214
|
+
import { useBreakpoints, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
215
|
+
|
|
216
|
+
import FSBreadcrumbs from "../FSBreadcrumbs.vue";
|
|
217
|
+
import FSSlideGroup from "../FSSlideGroup.vue";
|
|
218
|
+
import FSIconCard from "../FSIconCard.vue";
|
|
219
|
+
import FSImage from "../FSImage.vue";
|
|
220
|
+
import FSIcon from "../FSIcon.vue";
|
|
221
|
+
import FSText from "../FSText.vue";
|
|
222
|
+
import FSCol from "../FSCol.vue";
|
|
223
|
+
import FSRow from "../FSRow.vue";
|
|
224
|
+
|
|
225
|
+
export default defineComponent({
|
|
226
|
+
name: "FSEntityHeader",
|
|
227
|
+
components: {
|
|
228
|
+
FSBreadcrumbs,
|
|
229
|
+
FSSlideGroup,
|
|
230
|
+
FSIconCard,
|
|
231
|
+
FSImage,
|
|
232
|
+
FSIcon,
|
|
233
|
+
FSText,
|
|
234
|
+
FSCol,
|
|
235
|
+
FSRow
|
|
236
|
+
},
|
|
237
|
+
props: {
|
|
238
|
+
imageId: {
|
|
239
|
+
type: String as PropType<string | null>,
|
|
240
|
+
required: false,
|
|
241
|
+
default: null
|
|
242
|
+
},
|
|
243
|
+
icon: {
|
|
244
|
+
type: String as PropType<string | null>,
|
|
245
|
+
required: false,
|
|
246
|
+
default: null
|
|
247
|
+
},
|
|
248
|
+
color : {
|
|
249
|
+
type: Object as PropType<ColorEnum | null>,
|
|
250
|
+
required: false,
|
|
251
|
+
default: null
|
|
252
|
+
},
|
|
253
|
+
iconBackgroundColors: {
|
|
254
|
+
type: Array as PropType<string[]>,
|
|
255
|
+
required: false,
|
|
256
|
+
default: () => []
|
|
257
|
+
},
|
|
258
|
+
title: {
|
|
259
|
+
type: String as PropType<string | null>,
|
|
260
|
+
required: false,
|
|
261
|
+
default: null
|
|
262
|
+
},
|
|
263
|
+
subtitle: {
|
|
264
|
+
type: String as PropType<string | null>,
|
|
265
|
+
required: false,
|
|
266
|
+
default: null
|
|
267
|
+
},
|
|
268
|
+
description: {
|
|
269
|
+
type: String as PropType<string | null>,
|
|
270
|
+
required: false,
|
|
271
|
+
default: null
|
|
272
|
+
},
|
|
273
|
+
breadcrumbs: {
|
|
274
|
+
type: Array as PropType<Array<FSBreadcrumbItem>>,
|
|
275
|
+
required: false,
|
|
276
|
+
default: () => []
|
|
277
|
+
},
|
|
278
|
+
light: {
|
|
279
|
+
type: Boolean,
|
|
280
|
+
required: false,
|
|
281
|
+
default: false
|
|
282
|
+
},
|
|
283
|
+
imageCover: {
|
|
284
|
+
type: Boolean,
|
|
285
|
+
required: false,
|
|
286
|
+
default: true
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
setup(props) {
|
|
290
|
+
const { isExtraSmall, isMobileSized } = useBreakpoints();
|
|
291
|
+
const { slots } = useSlots();
|
|
292
|
+
|
|
293
|
+
const imageSize = computed((): string[] | string => {
|
|
294
|
+
if (props.light) {
|
|
295
|
+
return ["40px", "36px"];
|
|
296
|
+
}
|
|
297
|
+
return ["124px", "96px", "80px"];
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
const rightOverflow = computed(() => {
|
|
301
|
+
let result = imageSize.value[0];
|
|
302
|
+
if (isExtraSmall.value && imageSize.value[2]) {
|
|
303
|
+
result = imageSize.value[2];
|
|
304
|
+
}
|
|
305
|
+
if ((isExtraSmall.value || isMobileSized.value) && imageSize.value[1]) {
|
|
306
|
+
result = imageSize.value[1];
|
|
307
|
+
}
|
|
308
|
+
return result;
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
return {
|
|
312
|
+
rightOverflow,
|
|
313
|
+
isExtraSmall,
|
|
314
|
+
imageSize,
|
|
315
|
+
slots
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
</script>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSSkeletonView>
|
|
3
|
+
<template
|
|
4
|
+
#header
|
|
5
|
+
>
|
|
6
|
+
<FSEntityHeader
|
|
7
|
+
ref="headerRef"
|
|
8
|
+
:breadcrumbs="$props.breadcrumbs"
|
|
9
|
+
:description="$props.description"
|
|
10
|
+
:subtitle="$props.subtitle"
|
|
11
|
+
:imageId="$props.imageId"
|
|
12
|
+
:title="$props.title"
|
|
13
|
+
:light="lightHeader"
|
|
14
|
+
:icon="$props.icon"
|
|
15
|
+
:color="$props.color"
|
|
16
|
+
:iconBackgroundColors="$props.iconBackgroundColors"
|
|
17
|
+
:imageCover="$props.imageCover"
|
|
18
|
+
>
|
|
19
|
+
<template
|
|
20
|
+
#title-append
|
|
21
|
+
>
|
|
22
|
+
<slot
|
|
23
|
+
name="title-append"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
26
|
+
<template
|
|
27
|
+
#toolbar
|
|
28
|
+
v-if="slots['toolbar']"
|
|
29
|
+
>
|
|
30
|
+
<slot
|
|
31
|
+
name="toolbar"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
34
|
+
</FSEntityHeader>
|
|
35
|
+
</template>
|
|
36
|
+
<template
|
|
37
|
+
#default
|
|
38
|
+
>
|
|
39
|
+
<!-- <FSFadeOut
|
|
40
|
+
padding="0 8px 0 0"
|
|
41
|
+
:height="height"
|
|
42
|
+
@scroll="onScroll"
|
|
43
|
+
> -->
|
|
44
|
+
<slot
|
|
45
|
+
name="default"
|
|
46
|
+
/>
|
|
47
|
+
<!-- </FSFadeOut> -->
|
|
48
|
+
</template>
|
|
49
|
+
</FSSkeletonView>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script lang="ts">
|
|
53
|
+
import { computed, defineComponent, type PropType, ref } from "vue";
|
|
54
|
+
|
|
55
|
+
import { type ColorEnum, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
|
|
56
|
+
import { useBreakpoints, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
57
|
+
|
|
58
|
+
import FSEntityHeader from "./FSEntityHeader.vue";
|
|
59
|
+
import FSSkeletonView from "./FSSkeletonView.vue";
|
|
60
|
+
// import FSFadeOut from "../FSFadeOut.vue";
|
|
61
|
+
|
|
62
|
+
export default defineComponent({
|
|
63
|
+
name: "FSEntityView",
|
|
64
|
+
components: {
|
|
65
|
+
FSEntityHeader,
|
|
66
|
+
FSSkeletonView
|
|
67
|
+
// FSFadeOut
|
|
68
|
+
},
|
|
69
|
+
props: {
|
|
70
|
+
imageId: {
|
|
71
|
+
type: String as PropType<string | null>,
|
|
72
|
+
required: false,
|
|
73
|
+
default: null
|
|
74
|
+
},
|
|
75
|
+
imageCover: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
required: false,
|
|
78
|
+
default: true
|
|
79
|
+
},
|
|
80
|
+
icon: {
|
|
81
|
+
type: String as PropType<string | null>,
|
|
82
|
+
required: false,
|
|
83
|
+
default: null
|
|
84
|
+
},
|
|
85
|
+
color : {
|
|
86
|
+
type: Object as PropType<ColorEnum | null>,
|
|
87
|
+
required: false,
|
|
88
|
+
default: null
|
|
89
|
+
},
|
|
90
|
+
iconBackgroundColors: {
|
|
91
|
+
type: Array as PropType<string[]>,
|
|
92
|
+
required: false,
|
|
93
|
+
default: () => []
|
|
94
|
+
},
|
|
95
|
+
title: {
|
|
96
|
+
type: String as PropType<string | null>,
|
|
97
|
+
required: false,
|
|
98
|
+
default: null
|
|
99
|
+
},
|
|
100
|
+
subtitle: {
|
|
101
|
+
type: String as PropType<string | null>,
|
|
102
|
+
required: false,
|
|
103
|
+
default: null
|
|
104
|
+
},
|
|
105
|
+
description: {
|
|
106
|
+
type: String as PropType<string | null>,
|
|
107
|
+
required: false,
|
|
108
|
+
default: null
|
|
109
|
+
},
|
|
110
|
+
breadcrumbs: {
|
|
111
|
+
type: Array as PropType<FSBreadcrumbItem[]>,
|
|
112
|
+
required: false,
|
|
113
|
+
default: () => []
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
setup() {
|
|
117
|
+
const { isExtraSmall, windowHeight } = useBreakpoints();
|
|
118
|
+
const { slots } = useSlots();
|
|
119
|
+
|
|
120
|
+
const headerRef = ref<HTMLElement | null>(null);
|
|
121
|
+
|
|
122
|
+
const lightHeader = ref(false);
|
|
123
|
+
|
|
124
|
+
const height = computed((): string => {
|
|
125
|
+
let other = isExtraSmall.value ? 16 + 16 : 24 + 24; // Paddings
|
|
126
|
+
|
|
127
|
+
return `${windowHeight.value - other}px`;
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// const onScroll = (event: any): void => {
|
|
131
|
+
// if (event.onTop) {
|
|
132
|
+
// lightHeader.value = false;
|
|
133
|
+
// }
|
|
134
|
+
// else if (event.target.scrollTop > (headerRef.value as any)?.$el.clientHeight) {
|
|
135
|
+
// lightHeader.value = true;
|
|
136
|
+
// }
|
|
137
|
+
// };
|
|
138
|
+
|
|
139
|
+
return {
|
|
140
|
+
lightHeader,
|
|
141
|
+
headerRef,
|
|
142
|
+
height,
|
|
143
|
+
slots
|
|
144
|
+
// onScroll
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
</script>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template
|
|
3
|
+
v-if="isExtraSmall"
|
|
4
|
+
>
|
|
5
|
+
<FSCol
|
|
6
|
+
padding="16px 4px 16px 12px"
|
|
7
|
+
height="100vh"
|
|
8
|
+
gap="16px"
|
|
9
|
+
>
|
|
10
|
+
<slot
|
|
11
|
+
name="header"
|
|
12
|
+
>
|
|
13
|
+
<slot
|
|
14
|
+
name="title"
|
|
15
|
+
>
|
|
16
|
+
<FSRow
|
|
17
|
+
gap="12px"
|
|
18
|
+
>
|
|
19
|
+
<slot
|
|
20
|
+
name="title-image"
|
|
21
|
+
/>
|
|
22
|
+
<slot
|
|
23
|
+
name="title-texts"
|
|
24
|
+
/>
|
|
25
|
+
</FSRow>
|
|
26
|
+
</slot>
|
|
27
|
+
</slot>
|
|
28
|
+
<slot
|
|
29
|
+
name="breadcrumbs"
|
|
30
|
+
/>
|
|
31
|
+
<slot
|
|
32
|
+
name="toolbar"
|
|
33
|
+
/>
|
|
34
|
+
<slot
|
|
35
|
+
name="title-append"
|
|
36
|
+
/>
|
|
37
|
+
<slot
|
|
38
|
+
name="default"
|
|
39
|
+
/>
|
|
40
|
+
</FSCol>
|
|
41
|
+
</template>
|
|
42
|
+
<template
|
|
43
|
+
v-else
|
|
44
|
+
>
|
|
45
|
+
<FSCol
|
|
46
|
+
padding="24px 8px 24px 24px"
|
|
47
|
+
height="100vh"
|
|
48
|
+
gap="16px"
|
|
49
|
+
>
|
|
50
|
+
<slot
|
|
51
|
+
name="header"
|
|
52
|
+
>
|
|
53
|
+
<slot
|
|
54
|
+
name="title"
|
|
55
|
+
>
|
|
56
|
+
<FSRow
|
|
57
|
+
gap="32px"
|
|
58
|
+
>
|
|
59
|
+
<slot
|
|
60
|
+
name="title-image"
|
|
61
|
+
/>
|
|
62
|
+
<slot
|
|
63
|
+
name="title-texts"
|
|
64
|
+
/>
|
|
65
|
+
<v-spacer />
|
|
66
|
+
<slot
|
|
67
|
+
name="title-append"
|
|
68
|
+
/>
|
|
69
|
+
</FSRow>
|
|
70
|
+
</slot>
|
|
71
|
+
</slot>
|
|
72
|
+
<slot
|
|
73
|
+
name="breadcrumbs"
|
|
74
|
+
/>
|
|
75
|
+
<slot
|
|
76
|
+
name="toolbar"
|
|
77
|
+
/>
|
|
78
|
+
<slot
|
|
79
|
+
name="default"
|
|
80
|
+
/>
|
|
81
|
+
</FSCol>
|
|
82
|
+
</template>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<script lang="ts">
|
|
86
|
+
import { defineComponent } from "vue";
|
|
87
|
+
|
|
88
|
+
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
89
|
+
|
|
90
|
+
export default defineComponent({
|
|
91
|
+
name: "FSSkeletonView",
|
|
92
|
+
setup() {
|
|
93
|
+
const { isExtraSmall } = useBreakpoints();
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
isExtraSmall
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
</script>
|
package/composables/useColors.ts
CHANGED
|
@@ -56,11 +56,20 @@ export const useColors = () => {
|
|
|
56
56
|
return color.lighten(color.value() / 50);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const
|
|
59
|
+
const parseColor = (color: ColorBase): Color => {
|
|
60
60
|
const themed = (Object as any).values(ColorEnum).includes(color);
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
return themed ? new Color(theme.colors[color as ColorEnum]) : new Color(color);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return new Color("#000000");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
61
69
|
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
const getColors = (color: ColorBase): ColorVariations => {
|
|
71
|
+
const base = parseColor(color);
|
|
72
|
+
|
|
64
73
|
const light = getLight(base);
|
|
65
74
|
const soft = getSoft(base);
|
|
66
75
|
const dark = getDark(base);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
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": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.6",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.6"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@dative-gpi/bones-ui": "^0.0.75",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"sass": "1.71.1",
|
|
36
36
|
"sass-loader": "13.3.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "b2bbdea22792b7454a5234d8a6b8bb43553f3202"
|
|
39
39
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.fs-text-area:not(.fs-text-area-auto-grow) {
|
|
2
2
|
& > .v-input__control > .v-field {
|
|
3
3
|
border: 1px solid var(--fs-text-area-border-color) !important;
|
|
4
|
+
height: var(--fs-text-area-height);
|
|
4
5
|
|
|
5
6
|
&--error {
|
|
6
7
|
border-color: var(--fs-text-area-error-border-color) !important;
|
|
@@ -24,8 +25,6 @@
|
|
|
24
25
|
color: var(--fs-text-area-color);
|
|
25
26
|
padding: 0;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
height: var(--fs-text-area-height);
|
|
29
28
|
|
|
30
29
|
@include web {
|
|
31
30
|
padding: 11px 16px !important;
|