WIP Добавила DescriptionCard

This commit is contained in:
Daria Golova
2022-11-10 18:59:50 +03:00
parent f6659c4728
commit a2d4f06674
5 changed files with 47 additions and 5 deletions

View File

@@ -1,10 +1,10 @@
<template lang="pug"> <template lang="pug">
.wrapper.cursor-pointer.my-1( .wrapper.cursor-pointer.my-1.relative(
@click="transmitEventData", @click="transmitEventData",
:style="themeColors", :style="themeColors",
:class="cardTheme" :class="cardTheme"
) )
.card.flex.items-start.px-2( .card.flex.px-2(
:class="{'py-6px flex-col': longCard}", :class="{'py-6px flex-col': longCard}",
:style="cardHeight" :style="cardHeight"
) )
@@ -20,11 +20,19 @@
.col .col
ul ul
li.mt-2(v-for="elem in descriptionColumns.rightColumn" :key="elem") {{ elem }} li.mt-2(v-for="elem in descriptionColumns.rightColumn" :key="elem") {{ elem }}
calendar-event-description-card.right-0(
v-if="isActive"
:style="descriptionCardPosition"
:owner-event="this.ownerEvent"
:event-types="this.eventTypes"
)
</template> </template>
<script> <script>
import CalendarEventDescriptionCard from "./CalendarEventDescriptionCard.vue";
export default { export default {
name: "CalendarEventCard", name: "CalendarEventCard",
components: { CalendarEventDescriptionCard },
props: { props: {
ownerEvent: Object, ownerEvent: Object,
eventTypes: { eventTypes: {
@@ -136,7 +144,9 @@ export default {
} }
}, },
description() { description() {
return this.ownerEvent.description.split(", "); return this.ownerEvent.description
? this.ownerEvent.description.split(", ")
: [];
}, },
descriptionColumns() { descriptionColumns() {
let leftCol = [], let leftCol = [],
@@ -167,6 +177,11 @@ export default {
if (!remainingDetails) this.changeDetailsShown(); if (!remainingDetails) this.changeDetailsShown();
return remainingDetails; return remainingDetails;
}, },
descriptionCardPosition() {
return {
top: `calc(${this.cardHeight.height} + 8px)`,
};
},
}, },
methods: { methods: {
trimTime(time) { trimTime(time) {

View File

@@ -0,0 +1,27 @@
<template lang="pug">
.wrapper.px-4.pt-14px.pb-4.font-medium
</template>
<script>
export default {
name: "CalendarEventDescriptionCard",
props: {
ownerEvent: Object,
eventTypes: {
type: Array,
default() {
return [];
},
},
},
};
</script>
<style lang="sass" scoped>
.wrapper
width: 426px
background-color: var(--default-white)
border-radius: 4px
color: var(--font-black-color)
box-shadow: var(--default-shadow)
</style>

View File

@@ -34,8 +34,8 @@
<script> <script>
import BaseButton from "@/components/base/BaseButton"; import BaseButton from "@/components/base/BaseButton";
import CalendarSidebarEvent from "./cells/CalendarSidebarEvent.vue"; import CalendarSidebarEvent from "./CalendarSidebarEvent.vue";
import CalendarSidebarTeammate from "./cells/CalendarSidebarTeammate.vue"; import CalendarSidebarTeammate from "./CalendarSidebarTeammate.vue";
export default { export default {
name: "CalendarSidebar", name: "CalendarSidebar",