Browse Source

fix(nc-gui): update record card styles

pull/7611/head
DarkPhoenix2704 9 months ago
parent
commit
dd0b058b90
  1. 34
      packages/nc-gui/components/smartsheet/calendar/RecordCard.vue
  2. 28
      packages/nc-gui/components/smartsheet/calendar/SideMenu.vue

34
packages/nc-gui/components/smartsheet/calendar/RecordCard.vue

@ -39,8 +39,9 @@ const emit = defineEmits(['resize-start'])
'bg-yellow-50': color === 'yellow', 'bg-yellow-50': color === 'yellow',
'bg-pink-50': color === 'pink', 'bg-pink-50': color === 'pink',
'bg-purple-50': color === 'purple', 'bg-purple-50': color === 'purple',
'group-hover:(border-brand-500 border-2)': resize,
}" }"
class="relative" class="relative group"
> >
<div class="h-full absolute py-2"> <div class="h-full absolute py-2">
<div <div
@ -56,12 +57,18 @@ const emit = defineEmits(['resize-start'])
class="block h-full min-h-5 ml-1 w-1 rounded mr-2" class="block h-full min-h-5 ml-1 w-1 rounded mr-2"
></div> ></div>
</div> </div>
<span
v-if="resize" <div
class="absolute -left-1 resize mt-1.5 h-9 w-2" v-if="position === 'leftRounded' || position === 'rounded'"
@mousedown.stop="emit('resize-start', 'left', $event, record)" :class="{
'!group-hover:(border-brand-500 block border-2 rounded-lg)': resize,
}"
class="absolute mt-0.6 h-7.1 hidden -left-3 resize"
> >
</span> <NcButton v-if="resize" size="xsmall" type="secondary" @mousedown.stop="emit('resize-start', 'left', $event, record)">
<component :is="iconMap.drag" class="text-gray-400"></component>
</NcButton>
</div>
<div class="ml-3 mt-2 text-ellipsis overflow-hidden w-full h-6 absolute"> <div class="ml-3 mt-2 text-ellipsis overflow-hidden w-full h-6 absolute">
<span v-if="position === 'rightRounded' || position === 'none'"> .... </span> <span v-if="position === 'rightRounded' || position === 'none'"> .... </span>
@ -69,12 +76,17 @@ const emit = defineEmits(['resize-start'])
<span v-if="showDate" class="text-xs ml-1 text-gray-600">{{ date }}</span> <span v-if="showDate" class="text-xs ml-1 text-gray-600">{{ date }}</span>
<span v-if="position === 'leftRounded' || position === 'none'" class="absolute my-0 right-5"> .... </span> <span v-if="position === 'leftRounded' || position === 'none'" class="absolute my-0 right-5"> .... </span>
</div> </div>
<span <div
v-if="resize" v-if="position === 'rightRounded' || position === 'rounded'"
class="absolute mt-1.5 right-1 w-2 h-9 px-1 resize" :class="{
@mousedown.stop="emit('resize-start', 'right', $event, record)" '!group-hover:(border-brand-500 border-2 block rounded-lg)': resize,
}"
class="absolute mt-0.6 hidden h-7.1 -right-3 border-1 resize"
> >
</span> <NcButton v-if="resize" size="xsmall" type="secondary" @mousedown.stop="emit('resize-start', 'right', $event, record)">
<component :is="iconMap.drag" class="text-gray-400"></component>
</NcButton>
</div>
</div> </div>
</template> </template>

28
packages/nc-gui/components/smartsheet/calendar/SideMenu.vue

@ -262,39 +262,31 @@ const sideBarListScrollHandle = useDebounceFn(async (e: Event) => {
year-picker year-picker
/> />
<div class="px-4 flex flex-col gap-y-6 pt-4"> <div class="px-4 relative flex flex-col gap-y-6 pt-4">
<div class="flex justify-between items-center">
<span class="text-lg font-bold">{{ t('objects.Records') }}</span>
<NcSelect v-model:value="sideBarFilterOption" :options="options" />
</div>
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<a-input <a-input v-model:value="searchQuery.value" class="!rounded-lg !border-gray-200 !px-4 !py-2" placeholder="Search records">
v-model:value="searchQuery.value"
class="!rounded-lg !border-gray-200 !px-4 !py-2"
placeholder="Search your records"
>
<template #prefix> <template #prefix>
<component :is="iconMap.search" class="h-4 w-4 mr-1 text-gray-500" /> <component :is="iconMap.search" class="h-4 w-4 mr-1 text-gray-500" />
</template> </template>
</a-input> </a-input>
<NcButton type="secondary" @click="emit('new-record', { row: {} })"> <NcSelect v-model:value="sideBarFilterOption" :options="options" />
<div class="px-4 flex items-center gap-2 justify-center">
<component :is="iconMap.plus" class="h-4 w-4 text-gray-700" />
{{ t('activity.newRecord') }}
</div>
</NcButton>
</div> </div>
<div <div
v-if="calendarRange" v-if="calendarRange"
:ref="sideBarListRef" :ref="sideBarListRef"
:class="{ :class="{
'h-[calc(100vh-40rem)]': activeCalendarView === ('day' as const) || activeCalendarView === ('week' as const), 'h-[calc(100vh-36.2rem)]': activeCalendarView === ('day' as const) || activeCalendarView === ('week' as const),
'h-[calc(100vh-29rem)]': activeCalendarView === ('month' as const) || activeCalendarView === ('year' as const), 'h-[calc(100vh-25.1rem)]': activeCalendarView === ('month' as const) || activeCalendarView === ('year' as const),
}" }"
class="gap-2 flex flex-col nc-scrollbar-md overflow-y-auto nc-calendar-top-height" class="gap-2 flex flex-col nc-scrollbar-md overflow-y-auto nc-calendar-top-height"
@scroll="sideBarListScrollHandle" @scroll="sideBarListScrollHandle"
> >
<NcButton class="!absolute right-5 bottom-5 !h-12 !w-12" type="secondary" @click="emit('new-record', { row: {} })">
<div class="px-4 flex items-center gap-2 justify-center">
<component :is="iconMap.plus" class="h-6 w-6 text-lg text-brand-500" />
</div>
</NcButton>
<div v-if="renderData.length === 0 || isSidebarLoading" class="flex h-full items-center justify-center"> <div v-if="renderData.length === 0 || isSidebarLoading" class="flex h-full items-center justify-center">
<GeneralLoader v-if="isSidebarLoading" size="large" /> <GeneralLoader v-if="isSidebarLoading" size="large" />

Loading…
Cancel
Save