-
Notifications
You must be signed in to change notification settings - Fork 7
/
QuickViewCardOverview.vue
146 lines (129 loc) · 3.78 KB
/
QuickViewCardOverview.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<template>
<QuickViewCardBase
:title="title"
:cta-icon="ctaIcon"
@cta-click="$emit('ctaClick')"
>
<div
class="overview-content-card-ct"
:class="{ 'no-padding': contentHasNoPadding }"
>
<slot name="content" />
<QuickViewCardOverviewContentContainer
v-for="(s, i) in sections"
:key="i"
:icon="s.icon"
class="overview-ct"
>
<template #content>
<div
v-for="(c, contentIndex) in s.content"
:key="`c_${contentIndex}`"
:class="{ 'pb-4': contentIndex < s.content.length - 1 }"
>
<QuickViewCardOverviewContentTitle :value="c.title" />
<QuickViewCardOverviewContentText v-if="c.text" :value="c.text" />
<TagCustom
v-if="c.tag"
:size="c.tag.size"
:type="c.tag.type"
:text="c.tag.text"
:has-dot="c.tag.hasDot"
class="mt-1"
/>
</div>
</template>
<template #fullwidth-content>
<div
v-for="(c, contentIndex) in s.fullwidthContent"
:key="`fwc_${contentIndex}`"
:class="{ 'pb-4': contentIndex < s.content.length - 1 }"
>
<div v-if="c.operationScheduleTime">
<div
v-for="(time, indexTime) in c.operationScheduleTime"
:key="indexTime"
class="opening-hour-card-ct"
>
<div v-for="d in time" :key="d.Day" class="opening-hour-card">
<div
class="day"
:class="[
d.Open
? 'bg-hint-calm-secondary text-hint-calm'
: 'bg-hint-error-secondary text-hint-error',
]"
>
{{ d.Day }}
</div>
<div class="time">
<span> {{ d.Open ? d.Start : ' ' }}</span>
<span v-if="d.Open" class="divisor">-</span>
<span v-else>{{ t('datasets.quickView.closed') }}</span>
<span> {{ d.Open ? d.End : ' ' }}</span>
</div>
</div>
</div>
</div>
</div>
</template>
</QuickViewCardOverviewContentContainer>
</div>
</QuickViewCardBase>
</template>
<script setup lang="ts">
import { defineProps, defineEmits } from 'vue';
import { useI18n } from 'vue-i18n';
import QuickViewCardBase from './QuickViewCardBase.vue';
import QuickViewCardOverviewContentContainer from './QuickViewCardOverviewContentContainer.vue';
import QuickViewCardOverviewContentTitle from './QuickViewCardOverviewContentTitle.vue';
import QuickViewCardOverviewContentText from './QuickViewCardOverviewContentText.vue';
import TagCustom from '../tag/TagCustom.vue';
defineProps<{
title?: string;
sections: Array<any>;
contentHasNoPadding?: Boolean;
ctaIcon?: string;
}>();
defineEmits(['ctaClick']);
const { t } = useI18n();
</script>
<style scoped>
.overview-content-card-ct {
@apply p-4;
}
.overview-content-card-ct.no-padding {
@apply p-0;
}
.overview-ct {
@apply py-6;
}
.overview-ct:not(:last-child) {
@apply border-b border-gray-250;
}
.overview-ct:first-child {
@apply pt-0;
}
.overview-ct:last-child {
@apply pb-0;
}
.opening-hour-card-ct {
@apply grid grid-cols-3 md:grid-cols-7 gap-3 mt-4;
}
.opening-hour-card {
@apply border-2 border-gray-250 rounded;
}
.opening-hour-card .day {
@apply font-bold text-2xl text-center p-2;
}
.opening-hour-card .time {
@apply text-dialog text-center p-2
flex flex-col justify-center;
}
.opening-hour-card .time.closed {
@apply pt-5;
}
.opening-hour-card span {
@apply leading-tight;
}
</style>