Browse Source

refactor(nc-gui): kanban styles

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
177f4db3a0
  1. 23
      packages/nc-gui/components/smartsheet/Kanban.vue

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

@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import Draggable from 'vuedraggable' import Draggable from 'vuedraggable'
import { isVirtualCol } from 'nocodb-sdk' import { UITypes, isVirtualCol } from 'nocodb-sdk'
import { import {
ActiveViewInj, ActiveViewInj,
FieldsInj, FieldsInj,
@ -203,13 +203,13 @@ openNewRecordFormHook?.on(async (stackTitle) => {
> >
<div :style="`background-color: ${stack.color}`" class="nc-kanban-stack-head-color h-[10px]"></div> <div :style="`background-color: ${stack.color}`" class="nc-kanban-stack-head-color h-[10px]"></div>
<a-skeleton v-if="!formattedData[stack.title] || !countByStack" class="p-4" /> <a-skeleton v-if="!formattedData[stack.title] || !countByStack" class="p-4" />
<a-layout v-else class="px-[15px] !bg-[#f0f2f5]"> <a-layout v-else class="!bg-[#f0f2f5]">
<a-layout-header> <a-layout-header>
<div class="nc-kanban-stack-head text-slate-500 font-bold flex items-center"> <div class="nc-kanban-stack-head text-slate-500 font-bold flex items-center px-[15px]">
<a-dropdown :trigger="['click']" overlay-class-name="nc-dropdown-actions-menu"> <a-dropdown :trigger="['click']" overlay-class-name="nc-dropdown-actions-menu">
<div class="flex items-center cursor-pointer w-full"> <div class="flex items-center cursor-pointer w-full">
<GeneralTruncateText>{{ stack.title }}</GeneralTruncateText> <GeneralTruncateText>{{ stack.title }}</GeneralTruncateText>
<span class="w-full items-center flex"> <span class="w-full flex">
<mdi-menu-down class="text-grey text-lg ml-auto" /> <mdi-menu-down class="text-grey text-lg ml-auto" />
</span> </span>
</div> </div>
@ -261,13 +261,13 @@ openNewRecordFormHook?.on(async (stackTitle) => {
@change="onMove($event, stack.title)" @change="onMove($event, stack.title)"
> >
<template #item="{ element: record }"> <template #item="{ element: record }">
<div class="nc-kanban-item py-2"> <div class="nc-kanban-item py-2 px-[15px]">
<Row :row="record"> <Row :row="record">
<a-card <a-card
hoverable hoverable
:data-stack="stack.title" :data-stack="stack.title"
class="!rounded-lg h-full overflow-hidden break-all max-w-[450px]" class="!rounded-lg h-full overflow-hidden break-all max-w-[450px]"
body-style="padding: 5px;" body-style="padding: 10px 5px;"
@click="expandFormClick($event, record)" @click="expandFormClick($event, record)"
> >
<div <div
@ -275,14 +275,17 @@ openNewRecordFormHook?.on(async (stackTitle) => {
:key="`record-${record.row.id}-${col.id}`" :key="`record-${record.row.id}-${col.id}`"
class="flex flex-col rounded-lg w-full" class="flex flex-col rounded-lg w-full"
> >
<div class="flex flex-row w-full justify-start border-b-1 border-gray-100 py-2"> <div class="flex flex-row w-full justify-start pt-2">
<div class="w-full text-gray-600"> <div class="w-full text-gray-600">
<SmartsheetHeaderVirtualCell v-if="isVirtualCol(col)" :column="col" :hide-menu="true" /> <SmartsheetHeaderVirtualCell v-if="isVirtualCol(col)" :column="col" :hide-menu="true" />
<SmartsheetHeaderCell v-else :column="col" :hide-menu="true" /> <SmartsheetHeaderCell v-else :column="col" :hide-menu="true" />
</div> </div>
</div> </div>
<div class="flex flex-row w-full pt-2 pl-2 items-center justify-start"> <div
<div v-if="isRowEmpty(record, col)" class="h-4 bg-gray-200 px-5 rounded-lg"></div> class="flex flex-row w-full items-center justify-start"
:class="{ 'pt-2 pl-2': col.uidt !== UITypes.SingleSelect }"
>
<div v-if="isRowEmpty(record, col)" class="h-4 bg-gray-200 px-5 ml-3 mt-2 rounded-lg"></div>
<template v-else> <template v-else>
<SmartsheetVirtualCell <SmartsheetVirtualCell
v-if="isVirtualCol(col)" v-if="isVirtualCol(col)"
@ -391,4 +394,4 @@ openNewRecordFormHook?.on(async (stackTitle) => {
transform-origin: left top 0px; transform-origin: left top 0px;
transition: left 0.2s ease-in-out 0s; transition: left 0.2s ease-in-out 0s;
} }
</style> </style>
Loading…
Cancel
Save