@dative-gpi/foundation-shared-components 1.0.71 → 1.0.74
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 +1 -0
- package/components/FSCard.vue +22 -5
- package/components/FSDialogContent.vue +2 -4
- package/components/FSDialogFormBody.vue +2 -8
- package/components/FSDialogMultiFormBody.vue +1 -4
- package/components/FSDialogRemove.vue +0 -1
- package/components/FSDialogSubmit.vue +1 -4
- package/components/FSFadeOut.vue +29 -12
- package/components/FSIconCard.vue +1 -1
- package/components/autocompletes/FSAutoCompleteAddress.vue +16 -20
- package/components/deviceOrganisations/FSWorstAlert.vue +15 -29
- package/components/deviceOrganisations/FSWorstAlertCard.vue +7 -46
- package/components/fields/FSAutocompleteField.vue +1 -0
- package/components/lists/FSFilterButton.vue +3 -6
- package/components/lists/FSHiddenButton.vue +1 -3
- package/components/lists/FSSimpleList.vue +0 -2
- package/components/map/FSMapLayerButton.vue +0 -1
- package/components/tiles/FSSimpleTileUI.vue +6 -1
- package/components/views/FSBaseView.vue +64 -0
- package/components/views/FSEntityView.vue +12 -146
- package/components/views/FSSimpleView.vue +29 -0
- package/components/views/desktop/FSBaseDefaultDesktopView.vue +132 -0
- package/components/views/desktop/FSBaseDesktopView.vue +53 -0
- package/components/views/desktop/FSBaseEntityDesktopView.vue +199 -0
- package/components/views/mobile/FSBaseDefaultMobileView.vue +132 -0
- package/components/views/mobile/FSBaseEntityMobileView.vue +199 -0
- package/components/views/mobile/FSBaseMobileView.vue +53 -0
- package/package.json +4 -4
- package/styles/components/fs_breadcrumbs.scss +6 -12
- package/styles/components/fs_clickable.scss +1 -0
- package/styles/components/fs_fade_out.scss +5 -1
- package/styles/components/fs_slide_group.scss +1 -1
- package/components/views/FSListView.vue +0 -83
- package/components/views/FSSkeletonView.vue +0 -100
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSBaseMobileView
|
|
3
|
+
v-if="isExtraSmall"
|
|
4
|
+
:variant="$props.variant"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
>
|
|
7
|
+
<template
|
|
8
|
+
v-for="(_, name) in $slots"
|
|
9
|
+
v-slot:[name]="slotData"
|
|
10
|
+
>
|
|
11
|
+
<slot
|
|
12
|
+
:name="name"
|
|
13
|
+
v-bind="slotData"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
</FSBaseMobileView>
|
|
17
|
+
|
|
18
|
+
<FSBaseDesktopView
|
|
19
|
+
v-else
|
|
20
|
+
:variant="$props.variant"
|
|
21
|
+
v-bind="$attrs"
|
|
22
|
+
>
|
|
23
|
+
<template
|
|
24
|
+
v-for="(_, name) in $slots"
|
|
25
|
+
v-slot:[name]="slotData"
|
|
26
|
+
>
|
|
27
|
+
<slot
|
|
28
|
+
:name="name"
|
|
29
|
+
v-bind="slotData"
|
|
30
|
+
/>
|
|
31
|
+
</template>
|
|
32
|
+
</FSBaseDesktopView>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script lang="ts">
|
|
36
|
+
import { defineComponent, type PropType } from "vue";
|
|
37
|
+
|
|
38
|
+
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
39
|
+
|
|
40
|
+
import FSBaseDesktopView from "./desktop/FSBaseDesktopView.vue";
|
|
41
|
+
import FSBaseMobileView from "./mobile/FSBaseMobileView.vue";
|
|
42
|
+
|
|
43
|
+
export default defineComponent({
|
|
44
|
+
name: "FSBaseView",
|
|
45
|
+
components: {
|
|
46
|
+
FSBaseDesktopView,
|
|
47
|
+
FSBaseMobileView
|
|
48
|
+
},
|
|
49
|
+
props: {
|
|
50
|
+
variant: {
|
|
51
|
+
type: String as PropType<"default" | "entity">,
|
|
52
|
+
required: true,
|
|
53
|
+
default: "default"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
setup() {
|
|
57
|
+
const { isExtraSmall } = useBreakpoints();
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
isExtraSmall
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
</script>
|
|
@@ -1,163 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSBaseView
|
|
3
|
+
variant="entity"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
>
|
|
3
6
|
<template
|
|
4
|
-
|
|
7
|
+
v-for="(_, name) in $slots"
|
|
8
|
+
v-slot:[name]="slotData"
|
|
5
9
|
>
|
|
6
|
-
<FSEntityHeader
|
|
7
|
-
ref="headerRef"
|
|
8
|
-
:breadcrumbs="$props.breadcrumbs"
|
|
9
|
-
:description="$props.description"
|
|
10
|
-
:subtitle="$props.subtitle"
|
|
11
|
-
:title="$props.title"
|
|
12
|
-
:light="lightHeader"
|
|
13
|
-
:imageId="imageId"
|
|
14
|
-
:iconBackgroundVariant="$props.iconBackgroundVariant"
|
|
15
|
-
:icon="$props.icon"
|
|
16
|
-
:color="$props.color"
|
|
17
|
-
:iconBackgroundColors="$props.iconBackgroundColors"
|
|
18
|
-
:imageCover="$props.imageCover"
|
|
19
|
-
>
|
|
20
|
-
<template
|
|
21
|
-
v-if="$slots.image"
|
|
22
|
-
#image="props"
|
|
23
|
-
>
|
|
24
|
-
<slot
|
|
25
|
-
name="image"
|
|
26
|
-
v-bind="props"
|
|
27
|
-
/>
|
|
28
|
-
</template>
|
|
29
|
-
<template
|
|
30
|
-
#title-append
|
|
31
|
-
>
|
|
32
|
-
<slot
|
|
33
|
-
name="title-append"
|
|
34
|
-
/>
|
|
35
|
-
</template>
|
|
36
|
-
<template
|
|
37
|
-
#toolbar
|
|
38
|
-
v-if="slots['toolbar']"
|
|
39
|
-
>
|
|
40
|
-
<slot
|
|
41
|
-
name="toolbar"
|
|
42
|
-
/>
|
|
43
|
-
</template>
|
|
44
|
-
</FSEntityHeader>
|
|
45
|
-
</template>
|
|
46
|
-
<template
|
|
47
|
-
#default
|
|
48
|
-
>
|
|
49
|
-
<!-- <FSFadeOut
|
|
50
|
-
padding="0 8px 0 0"
|
|
51
|
-
:height="height"
|
|
52
|
-
@scroll="onScroll"
|
|
53
|
-
> -->
|
|
54
10
|
<slot
|
|
55
|
-
name="
|
|
11
|
+
:name="name"
|
|
12
|
+
v-bind="slotData"
|
|
56
13
|
/>
|
|
57
|
-
<!-- </FSFadeOut> -->
|
|
58
14
|
</template>
|
|
59
|
-
</
|
|
15
|
+
</FSBaseView>
|
|
60
16
|
</template>
|
|
61
17
|
|
|
62
18
|
<script lang="ts">
|
|
63
|
-
import {
|
|
19
|
+
import { defineComponent } from "vue";
|
|
64
20
|
|
|
65
|
-
import
|
|
66
|
-
import { useBreakpoints, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
67
|
-
|
|
68
|
-
import FSEntityHeader from "./FSEntityHeader.vue";
|
|
69
|
-
import FSSkeletonView from "./FSSkeletonView.vue";
|
|
70
|
-
// import FSFadeOut from "../FSFadeOut.vue";
|
|
21
|
+
import FSBaseView from "./FSBaseView.vue";
|
|
71
22
|
|
|
72
23
|
export default defineComponent({
|
|
73
24
|
name: "FSEntityView",
|
|
74
25
|
components: {
|
|
75
|
-
|
|
76
|
-
FSSkeletonView
|
|
77
|
-
// FSFadeOut
|
|
78
|
-
},
|
|
79
|
-
props: {
|
|
80
|
-
imageId: {
|
|
81
|
-
type: String as PropType<string | null>,
|
|
82
|
-
required: false,
|
|
83
|
-
default: null
|
|
84
|
-
},
|
|
85
|
-
imageCover: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
required: false,
|
|
88
|
-
default: true
|
|
89
|
-
},
|
|
90
|
-
icon: {
|
|
91
|
-
type: String as PropType<string | null>,
|
|
92
|
-
required: false,
|
|
93
|
-
default: null
|
|
94
|
-
},
|
|
95
|
-
color : {
|
|
96
|
-
type: Object as PropType<ColorEnum | null>,
|
|
97
|
-
required: false,
|
|
98
|
-
default: null
|
|
99
|
-
},
|
|
100
|
-
iconBackgroundColors: {
|
|
101
|
-
type: Array as PropType<string[]>,
|
|
102
|
-
required: false,
|
|
103
|
-
default: () => []
|
|
104
|
-
},
|
|
105
|
-
title: {
|
|
106
|
-
type: String as PropType<string | null>,
|
|
107
|
-
required: false,
|
|
108
|
-
default: null
|
|
109
|
-
},
|
|
110
|
-
subtitle: {
|
|
111
|
-
type: String as PropType<string | null>,
|
|
112
|
-
required: false,
|
|
113
|
-
default: null
|
|
114
|
-
},
|
|
115
|
-
description: {
|
|
116
|
-
type: String as PropType<string | null>,
|
|
117
|
-
required: false,
|
|
118
|
-
default: null
|
|
119
|
-
},
|
|
120
|
-
breadcrumbs: {
|
|
121
|
-
type: Array as PropType<FSBreadcrumbItem[]>,
|
|
122
|
-
required: false,
|
|
123
|
-
default: () => []
|
|
124
|
-
},
|
|
125
|
-
iconBackgroundVariant: {
|
|
126
|
-
type: String as PropType<"background" | "standard" | "full" | "gradient">,
|
|
127
|
-
required: false,
|
|
128
|
-
default: "background"
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
setup() {
|
|
132
|
-
const { isExtraSmall, windowHeight } = useBreakpoints();
|
|
133
|
-
const { slots } = useSlots();
|
|
134
|
-
|
|
135
|
-
const headerRef = ref<HTMLElement | null>(null);
|
|
136
|
-
|
|
137
|
-
const lightHeader = ref(false);
|
|
138
|
-
|
|
139
|
-
const height = computed((): string => {
|
|
140
|
-
let other = isExtraSmall.value ? 16 + 16 : 24 + 24; // Paddings
|
|
141
|
-
|
|
142
|
-
return `${windowHeight.value - other}px`;
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
// const onScroll = (event: any): void => {
|
|
146
|
-
// if (event.onTop) {
|
|
147
|
-
// lightHeader.value = false;
|
|
148
|
-
// }
|
|
149
|
-
// else if (event.target.scrollTop > (headerRef.value as any)?.$el.clientHeight) {
|
|
150
|
-
// lightHeader.value = true;
|
|
151
|
-
// }
|
|
152
|
-
// };
|
|
153
|
-
|
|
154
|
-
return {
|
|
155
|
-
lightHeader,
|
|
156
|
-
headerRef,
|
|
157
|
-
height,
|
|
158
|
-
slots
|
|
159
|
-
// onScroll
|
|
160
|
-
};
|
|
26
|
+
FSBaseView
|
|
161
27
|
}
|
|
162
28
|
});
|
|
163
29
|
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSBaseView
|
|
3
|
+
variant="default"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
>
|
|
6
|
+
<template
|
|
7
|
+
v-for="(_, name) in $slots"
|
|
8
|
+
v-slot:[name]="slotData"
|
|
9
|
+
>
|
|
10
|
+
<slot
|
|
11
|
+
:name="name"
|
|
12
|
+
v-bind="slotData"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
</FSBaseView>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import { defineComponent } from "vue";
|
|
20
|
+
|
|
21
|
+
import FSBaseView from "./FSBaseView.vue";
|
|
22
|
+
|
|
23
|
+
export default defineComponent({
|
|
24
|
+
name: "FSEntityView",
|
|
25
|
+
components: {
|
|
26
|
+
FSBaseView
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSFadeOut
|
|
3
|
+
height="100%"
|
|
4
|
+
maxHeight="100%"
|
|
5
|
+
:scrollOutside="false"
|
|
6
|
+
:disableTopMask="true"
|
|
7
|
+
>
|
|
8
|
+
<FSCol
|
|
9
|
+
height="fill"
|
|
10
|
+
gap="0px"
|
|
11
|
+
>
|
|
12
|
+
<slot
|
|
13
|
+
name="header"
|
|
14
|
+
>
|
|
15
|
+
|
|
16
|
+
<FSRow
|
|
17
|
+
padding="24px 16px 16px 24px"
|
|
18
|
+
style="position: sticky; top: 0px; z-index: 1;"
|
|
19
|
+
:style="{ backgroundColor, marginTop: $props.stickyTitleTopOffset }"
|
|
20
|
+
>
|
|
21
|
+
<slot
|
|
22
|
+
name="title"
|
|
23
|
+
>
|
|
24
|
+
<FSText
|
|
25
|
+
font="text-h2"
|
|
26
|
+
>
|
|
27
|
+
{{ $props.title }}
|
|
28
|
+
</FSText>
|
|
29
|
+
</slot>
|
|
30
|
+
</FSRow>
|
|
31
|
+
<FSCol
|
|
32
|
+
v-if="$props.breadcrumbs && $props.breadcrumbs.length > 0"
|
|
33
|
+
:padding="$slots.toolbar ? '0px 24px 8px 24px' : '0px 24px'"
|
|
34
|
+
gap="16px"
|
|
35
|
+
>
|
|
36
|
+
<FSCol>
|
|
37
|
+
<slot
|
|
38
|
+
name="breadcrumbs"
|
|
39
|
+
>
|
|
40
|
+
<FSBreadcrumbs
|
|
41
|
+
:items="$props.breadcrumbs"
|
|
42
|
+
/>
|
|
43
|
+
</slot>
|
|
44
|
+
</FSCol>
|
|
45
|
+
</FSCol>
|
|
46
|
+
<FSRow
|
|
47
|
+
v-if="$slots.toolbar"
|
|
48
|
+
padding="0px 16px 8px 24px"
|
|
49
|
+
:style="stickyToolbar ? `position: sticky; top: ${$props.toolbarTopOffset}; z-index: 1; background-color: ${backgroundColor}` : undefined"
|
|
50
|
+
>
|
|
51
|
+
<FSSlideGroup>
|
|
52
|
+
<slot
|
|
53
|
+
name="toolbar"
|
|
54
|
+
/>
|
|
55
|
+
</FSSlideGroup>
|
|
56
|
+
</FSRow>
|
|
57
|
+
</slot>
|
|
58
|
+
|
|
59
|
+
<FSCol
|
|
60
|
+
height="fill"
|
|
61
|
+
:padding="$slots.toolbar ? '8px 16px 24px 24px' : '16px 16px 24px 24px'"
|
|
62
|
+
gap="0px"
|
|
63
|
+
>
|
|
64
|
+
<slot />
|
|
65
|
+
</FSCol>
|
|
66
|
+
</FSCol>
|
|
67
|
+
</FSFadeOut>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script lang="ts">
|
|
71
|
+
import { defineComponent, type PropType, computed } from "vue";
|
|
72
|
+
|
|
73
|
+
import { type FSBreadcrumbItem, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
74
|
+
|
|
75
|
+
import { useColors } from "../../../composables"
|
|
76
|
+
|
|
77
|
+
import FSCol from "../../FSCol.vue";
|
|
78
|
+
import FSRow from "../../FSRow.vue"
|
|
79
|
+
import FSText from "../../FSText.vue";
|
|
80
|
+
import FSBreadcrumbs from "../../FSBreadcrumbs.vue";
|
|
81
|
+
import FSSlideGroup from "../../FSSlideGroup.vue";
|
|
82
|
+
import FSFadeOut from "../../FSFadeOut.vue"
|
|
83
|
+
|
|
84
|
+
export default defineComponent({
|
|
85
|
+
name: "FSBaseDefaultDesktopView",
|
|
86
|
+
components: {
|
|
87
|
+
FSCol,
|
|
88
|
+
FSRow,
|
|
89
|
+
FSText,
|
|
90
|
+
FSBreadcrumbs,
|
|
91
|
+
FSSlideGroup,
|
|
92
|
+
FSFadeOut
|
|
93
|
+
},
|
|
94
|
+
props: {
|
|
95
|
+
title: {
|
|
96
|
+
type: String,
|
|
97
|
+
required: false
|
|
98
|
+
},
|
|
99
|
+
breadcrumbs: {
|
|
100
|
+
type: Array as PropType<FSBreadcrumbItem[]>,
|
|
101
|
+
required: false,
|
|
102
|
+
default: () => []
|
|
103
|
+
},
|
|
104
|
+
stickyToolbar: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
required: false,
|
|
107
|
+
default: true
|
|
108
|
+
},
|
|
109
|
+
toolbarTopOffset: {
|
|
110
|
+
type: String,
|
|
111
|
+
required: false,
|
|
112
|
+
default: "72px"
|
|
113
|
+
},
|
|
114
|
+
stickyTitleTopOffset: {
|
|
115
|
+
type: String,
|
|
116
|
+
required: false,
|
|
117
|
+
default: "0px"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
setup(){
|
|
121
|
+
const { getColors } = useColors();
|
|
122
|
+
|
|
123
|
+
const backgroundColor = computed(() => {
|
|
124
|
+
return getColors(ColorEnum.Background).base;
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
backgroundColor
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSBaseDefaultDesktopView
|
|
3
|
+
v-if="$props.variant === 'default'"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
>
|
|
6
|
+
<template
|
|
7
|
+
v-for="(_, name) in $slots"
|
|
8
|
+
v-slot:[name]="slotData"
|
|
9
|
+
>
|
|
10
|
+
<slot
|
|
11
|
+
:name="name"
|
|
12
|
+
v-bind="slotData"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
</FSBaseDefaultDesktopView>
|
|
16
|
+
|
|
17
|
+
<FSBaseEntityDesktopView
|
|
18
|
+
v-if="$props.variant === 'entity'"
|
|
19
|
+
v-bind="$attrs"
|
|
20
|
+
>
|
|
21
|
+
<template
|
|
22
|
+
v-for="(_, name) in $slots"
|
|
23
|
+
v-slot:[name]="slotData"
|
|
24
|
+
>
|
|
25
|
+
<slot
|
|
26
|
+
:name="name"
|
|
27
|
+
v-bind="slotData"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
</FSBaseEntityDesktopView>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script lang="ts">
|
|
34
|
+
import { defineComponent, type PropType } from "vue";
|
|
35
|
+
|
|
36
|
+
import FSBaseDefaultDesktopView from "./FSBaseDefaultDesktopView.vue";
|
|
37
|
+
import FSBaseEntityDesktopView from "./FSBaseEntityDesktopView.vue";
|
|
38
|
+
|
|
39
|
+
export default defineComponent({
|
|
40
|
+
name: "FSBaseDesktopView",
|
|
41
|
+
components: {
|
|
42
|
+
FSBaseDefaultDesktopView,
|
|
43
|
+
FSBaseEntityDesktopView
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
variant: {
|
|
47
|
+
type: String as PropType<"default" | "entity">,
|
|
48
|
+
required: false,
|
|
49
|
+
default: "default"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSBaseDefaultDesktopView
|
|
3
|
+
:toolbarTopOffset="topOffset + 'px'"
|
|
4
|
+
:stickyTitleTopOffset="topOffset + 'px'"
|
|
5
|
+
@scroll="onScroll"
|
|
6
|
+
>
|
|
7
|
+
<template
|
|
8
|
+
#title
|
|
9
|
+
>
|
|
10
|
+
<FSRow
|
|
11
|
+
gap="24px"
|
|
12
|
+
:wrap="false"
|
|
13
|
+
>
|
|
14
|
+
<FSImage
|
|
15
|
+
v-if="$props.imageId"
|
|
16
|
+
:imageId="$props.imageId"
|
|
17
|
+
:cover="$props.imageCover"
|
|
18
|
+
:height="actualImageSize"
|
|
19
|
+
:width="actualImageSize"
|
|
20
|
+
/>
|
|
21
|
+
<FSIconCard
|
|
22
|
+
v-else-if="$props.icon"
|
|
23
|
+
:backgroundVariant="$props.iconBackgroundVariant"
|
|
24
|
+
:backgroundColor="$props.iconBackgroundColors"
|
|
25
|
+
:border="$props.iconBorder"
|
|
26
|
+
:icon="$props.icon"
|
|
27
|
+
:iconColor="$props.color"
|
|
28
|
+
:size="actualImageSize"
|
|
29
|
+
/>
|
|
30
|
+
<FSCol
|
|
31
|
+
align="center-left"
|
|
32
|
+
height="fill"
|
|
33
|
+
>
|
|
34
|
+
<slot
|
|
35
|
+
name="title"
|
|
36
|
+
>
|
|
37
|
+
<FSText
|
|
38
|
+
font="text-h3"
|
|
39
|
+
>
|
|
40
|
+
{{ $props.title }}
|
|
41
|
+
</FSText>
|
|
42
|
+
<slot
|
|
43
|
+
name="title-extra"
|
|
44
|
+
v-bind="{ topOffset }"
|
|
45
|
+
>
|
|
46
|
+
<slot
|
|
47
|
+
name="subtitle"
|
|
48
|
+
>
|
|
49
|
+
<FSText
|
|
50
|
+
v-if="$props.subtitle && topOffset < 60"
|
|
51
|
+
font="text-button"
|
|
52
|
+
>
|
|
53
|
+
{{ $props.subtitle }}
|
|
54
|
+
</FSText>
|
|
55
|
+
</slot>
|
|
56
|
+
<slot
|
|
57
|
+
name="description"
|
|
58
|
+
>
|
|
59
|
+
<FSText
|
|
60
|
+
v-if="$props.description && topOffset < 20"
|
|
61
|
+
font="text-body"
|
|
62
|
+
>
|
|
63
|
+
{{ $props.description }}
|
|
64
|
+
</FSText>
|
|
65
|
+
</slot>
|
|
66
|
+
</slot>
|
|
67
|
+
</slot>
|
|
68
|
+
</FSCol>
|
|
69
|
+
</FSRow>
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<template
|
|
73
|
+
v-for="(_, name) in slots"
|
|
74
|
+
v-slot:[name]="slotData"
|
|
75
|
+
>
|
|
76
|
+
<slot
|
|
77
|
+
:name="name"
|
|
78
|
+
v-bind="slotData"
|
|
79
|
+
/>
|
|
80
|
+
</template>
|
|
81
|
+
</FSBaseDefaultDesktopView>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script lang="ts">
|
|
85
|
+
import { defineComponent, useSlots, type PropType, computed, ref } from "vue";
|
|
86
|
+
|
|
87
|
+
import { type ColorBase } from "@dative-gpi/foundation-shared-components/models";
|
|
88
|
+
|
|
89
|
+
import { sizeToVar } from "../../../utils"
|
|
90
|
+
|
|
91
|
+
import FSCol from "../../FSCol.vue";
|
|
92
|
+
import FSRow from "../../FSRow.vue"
|
|
93
|
+
import FSText from "../../FSText.vue";
|
|
94
|
+
import FSImage from "../../FSImage.vue";
|
|
95
|
+
import FSIconCard from "../../FSIconCard.vue"
|
|
96
|
+
|
|
97
|
+
import FSBaseDefaultDesktopView from "./FSBaseDefaultDesktopView.vue";
|
|
98
|
+
|
|
99
|
+
export default defineComponent({
|
|
100
|
+
name: "FSBaseEntityDesktopView",
|
|
101
|
+
components: {
|
|
102
|
+
FSCol,
|
|
103
|
+
FSRow,
|
|
104
|
+
FSText,
|
|
105
|
+
FSBaseDefaultDesktopView,
|
|
106
|
+
FSImage,
|
|
107
|
+
FSIconCard,
|
|
108
|
+
},
|
|
109
|
+
props: {
|
|
110
|
+
title: {
|
|
111
|
+
type: String,
|
|
112
|
+
required: false
|
|
113
|
+
},
|
|
114
|
+
subtitle: {
|
|
115
|
+
type: String,
|
|
116
|
+
required: false
|
|
117
|
+
},
|
|
118
|
+
description: {
|
|
119
|
+
type: String,
|
|
120
|
+
required: false
|
|
121
|
+
},
|
|
122
|
+
imageId: {
|
|
123
|
+
type: String as PropType<string | null>,
|
|
124
|
+
required: false,
|
|
125
|
+
default: null
|
|
126
|
+
},
|
|
127
|
+
imageCover: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
required: false,
|
|
130
|
+
default: true
|
|
131
|
+
},
|
|
132
|
+
imageSize: {
|
|
133
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
134
|
+
required: false,
|
|
135
|
+
default: () => ["124px", "96px", "80px"]
|
|
136
|
+
},
|
|
137
|
+
color: {
|
|
138
|
+
type: String as PropType<ColorBase>,
|
|
139
|
+
required: false,
|
|
140
|
+
default: null
|
|
141
|
+
},
|
|
142
|
+
icon: {
|
|
143
|
+
type: String as PropType<string>,
|
|
144
|
+
required: false,
|
|
145
|
+
default: "mdi-ab-testing"
|
|
146
|
+
},
|
|
147
|
+
iconBackgroundVariant: {
|
|
148
|
+
type: String as PropType<"background" | "standard" | "full" | "gradient">,
|
|
149
|
+
required: false,
|
|
150
|
+
default: "background"
|
|
151
|
+
},
|
|
152
|
+
iconBackgroundColors: {
|
|
153
|
+
type: Array as PropType<string[]>,
|
|
154
|
+
required: false,
|
|
155
|
+
default: () => []
|
|
156
|
+
},
|
|
157
|
+
iconBorder: {
|
|
158
|
+
type: Boolean as PropType<boolean>,
|
|
159
|
+
required: false,
|
|
160
|
+
default: true
|
|
161
|
+
},
|
|
162
|
+
minImageSize: {
|
|
163
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
164
|
+
required: false,
|
|
165
|
+
default: () => ["48px", "48px", "48px"]
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
setup(props){
|
|
169
|
+
const slots = { ...useSlots() };
|
|
170
|
+
|
|
171
|
+
const topOffset = ref(0);
|
|
172
|
+
|
|
173
|
+
const actualImageSize = computed(() => {
|
|
174
|
+
const size = sizeToVar(props.imageSize);
|
|
175
|
+
const minSize = sizeToVar(props.minImageSize);
|
|
176
|
+
return `max(calc(${size} - ${topOffset.value}px), ${minSize})`;
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const onScroll = (event: Event) => {
|
|
180
|
+
const actualScrollTop = (event.target as HTMLElement).scrollTop;
|
|
181
|
+
|
|
182
|
+
const minSize = sizeToVar(props.minImageSize);
|
|
183
|
+
const actualMinSize = parseInt(minSize);
|
|
184
|
+
|
|
185
|
+
topOffset.value = Math.max(0, Math.min(actualScrollTop, actualMinSize + 16 + 24));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
delete slots.title;
|
|
190
|
+
|
|
191
|
+
return {
|
|
192
|
+
slots,
|
|
193
|
+
onScroll,
|
|
194
|
+
topOffset,
|
|
195
|
+
actualImageSize
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
</script>
|