Skip to content

Commit 8df2107

Browse files
author
Dominik Grenz
committed
Add checklistheader with grid layout
1 parent e16010c commit 8df2107

File tree

2 files changed

+100
-5
lines changed

2 files changed

+100
-5
lines changed

personalization-webcomponents/src/checklist-domi.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- eslint-disable-next-line vue/no-v-html -->
66
<div v-html="customIconsSprite" />
77
<div v-html="customIconsSprite" />
8-
<muc-card-container class="checklist-card-container">
8+
99
<div v-if="loading">
1010
<skeleton-loader
1111
v-for="elem in [1, 2, 3, 4]"
@@ -21,7 +21,6 @@
2121
>
2222
</checklist-header>
2323
</div>
24-
</muc-card-container>
2524
</div>
2625

2726
</template>
@@ -35,13 +34,11 @@ import { onMounted, ref} from "vue";
3534
import ChecklistHeader from "@/components/ChecklistHeader.vue";
3635
import type DummyChecklist from "@/api/dummyservice/DummyChecklist.ts";
3736
import DummyChecklistService from "@/api/dummyservice/DummyChecklistService.ts";
38-
import {MucCardContainer} from "@muenchen/muc-patternlab-vue";
39-
import ChecklistCard from "@/components/ChecklistCard.vue";
4037
import SkeletonLoader from "@/components/common/skeleton-loader.vue";
4138
4239
4340
const checklists = ref<DummyChecklist[]>([]);
44-
const loading = ref(false);
41+
const loading = ref(true);
4542
4643
onMounted(() => {
4744
loading.value = true;
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<template>
2+
<div
3+
class="m-intro m-intro-static-image"
4+
style="background-color: var(--color-neutrals-blue-xlight)"
5+
>
6+
<div class="container">
7+
<div style="display: grid; grid-template-columns: 75px auto; column-gap: 20px">
8+
<img class="item1"
9+
width="64px"
10+
height="64px"
11+
:src="getChecklistIconByTitle(checklist.title)"
12+
alt="checklist-icon"
13+
/>
14+
15+
<p class="m-intro-vertical__tagline">
16+
Checkliste
17+
</p>
18+
<h1>
19+
{{ props.checklist.title }}
20+
</h1>
21+
22+
<muc-divider class="item2" />
23+
24+
<div class="item3">
25+
<b>Erstellungsdatum: </b>{{ props.checklist.lastUpdated.toLocaleString() }}
26+
</div>
27+
28+
<div class="item4">
29+
<b>Aufgaben: </b>
30+
<muc-chip
31+
v-if="todoCount"
32+
style="margin-right: 16px"
33+
background-color="#FDD1AC"
34+
>
35+
{{ todoCount }} offen
36+
<svg
37+
style="margin-left: 8px; width: 20px; height: 20px"
38+
aria-hidden="true"
39+
class="m-button__icon"
40+
>
41+
<use href="#icon-pencil"/>
42+
</svg>
43+
</muc-chip>
44+
</div>
45+
46+
</div>
47+
</div>
48+
</div>
49+
50+
</template>
51+
<style>
52+
53+
.item1 {
54+
grid-row: 1 / span 2;
55+
margin: 10px;
56+
}
57+
58+
.item2 {
59+
grid-row: 3 / span 2;
60+
grid-column: 2/ span 1;
61+
margin-top: 10px;
62+
}
63+
64+
.item3 {
65+
grid-row: 4 / span 2;
66+
grid-column: 2 / span 1;
67+
margin-top: 25px;
68+
margin-bottom: 25px;
69+
70+
}
71+
72+
.item4 {
73+
grid-row: 5 / span 2;
74+
grid-column: 2 / span 1;
75+
margin-top: 25px;
76+
margin-bottom: 25px;
77+
78+
}
79+
</style>
80+
81+
<script setup lang="ts">
82+
83+
import type DummyChecklist from "@/api/dummyservice/DummyChecklist.ts";
84+
import {computed} from "vue";
85+
import MucChip from "@/components/common/muc-chip.vue";
86+
import {getChecklistIconByTitle} from "@/util/constants.ts";
87+
import {MucDivider} from "@muenchen/muc-patternlab-vue";
88+
89+
90+
const props = defineProps<{
91+
checklist: DummyChecklist
92+
}>();
93+
94+
const todoCount = computed(() => {
95+
return props.checklist.items.filter(value => !value.checked).length;
96+
})
97+
98+
</script>

0 commit comments

Comments
 (0)