Browse Source

feat(nc-gui): revise kanban styles & apply windicss

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
46c857811d
  1. 64
      packages/nc-gui/components/smartsheet/Kanban.vue

64
packages/nc-gui/components/smartsheet/Kanban.vue

@ -130,7 +130,7 @@ openNewRecordFormHook?.on(async () => {
<template> <template>
<!-- TODO: add loading component when formattedData is not ready --> <!-- TODO: add loading component when formattedData is not ready -->
<div v-if="formattedData" class="flex h-full"> <div v-if="formattedData" class="flex h-full">
<div class="nc-kanban-container flex grid gap-2 my-4 px-3"> <div class="nc-kanban-container flex my-4 px-3 overflow-x-scroll overflow-y-auto">
<Draggable <Draggable
v-model="groupingFieldColOptions" v-model="groupingFieldColOptions"
class="flex gap-5" class="flex gap-5"
@ -139,16 +139,25 @@ openNewRecordFormHook?.on(async () => {
draggable=".nc-kanban-stack" draggable=".nc-kanban-stack"
> >
<template #item="{ element: stack }"> <template #item="{ element: stack }">
<a-card :key="stack.id" class="nc-kanban-stack mx-4" head-style="padding-bottom: 0px;" body-style="padding: 0px 20px;"> <a-card
<template #title> :key="stack.id"
<div class="nc-kanban-stack-head"> class="nc-kanban-stack mx-4 !bg-[#f0f2f5] flex flex-col min-w-[280px] h-full rounded-[12px]"
<span v-if="stack.order === 0" class="text-slate-500">{{ stack.title }}</span> head-style="padding-bottom: 0px;"
<a-tag v-else class="!px-[12px] !rounded-[12px]" :color="stack.color"> body-style="padding: 0px 20px; height: 100%;"
>
<a-layout>
<a-layout-header>
<div class="nc-kanban-stack-head justify-center w-full items-center flex">
<div v-if="stack.order === 0" class="text-slate-500 font-bold">{{ stack.title }}</div>
<div v-else>
<a-tag class="!rounded-[12px]" :color="stack.color">
<span class="text-slate-500">{{ stack.title }}</span> <span class="text-slate-500">{{ stack.title }}</span>
</a-tag> </a-tag>
</div> </div>
</template> </div>
<div class="nc-kanban-list flex flex-col"> </a-layout-header>
<a-layout-content class="overflow-y-hidden">
<div class="nc-kanban-list h-full overflow-y-auto">
<Draggable <Draggable
v-model="formattedData[stack.title]" v-model="formattedData[stack.title]"
item-key="row.Id" item-key="row.Id"
@ -230,8 +239,8 @@ openNewRecordFormHook?.on(async () => {
</template> </template>
</Draggable> </Draggable>
</div> </div>
<a-card-meta> </a-layout-content>
<template #description> <a-layout-footer>
<div class="mt-5 text-center"> <div class="mt-5 text-center">
<mdi-plus class="text-pint-500 text-lg text-primary cursor-pointer" @click="openNewRecordFormHook.trigger()" /> <mdi-plus class="text-pint-500 text-lg text-primary cursor-pointer" @click="openNewRecordFormHook.trigger()" />
<div class="nc-kanban-data-count"> <div class="nc-kanban-data-count">
@ -239,8 +248,8 @@ openNewRecordFormHook?.on(async () => {
{{ formattedData[stack.title]?.length !== 1 ? $t('objects.records') : $t('objects.record') }} {{ formattedData[stack.title]?.length !== 1 ? $t('objects.records') : $t('objects.record') }}
</div> </div>
</div> </div>
</template> </a-layout-footer>
</a-card-meta> </a-layout>
</a-card> </a-card>
</template> </template>
</Draggable> </Draggable>
@ -257,31 +266,14 @@ openNewRecordFormHook?.on(async () => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
// TODO: windicss // override ant design style
.nc-kanban-container { .a-layout,
overflow-x: scroll; .ant-layout-header,
overflow-y: hidden; .ant-layout-content {
display: flex; @apply !bg-[#f0f2f5];
}
.nc-kanban-stack-head {
display: flex;
align-items: center;
width: 100%;
}
.nc-kanban-stack {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 12px;
height: 100%;
min-width: 280px;
display: flex;
flex-direction: column;
} }
.nc-kanban-list { .ant-layout-header {
overflow-y: scroll; @apply !h-[64px];
min-height: 500px;
height: 520px;
} }
</style> </style>

Loading…
Cancel
Save