From d70abe749b37a14a86672b49bd790f9303993bd6 Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Tue, 20 Feb 2024 07:16:07 +0000 Subject: [PATCH] fix(nc-gui): bug fixes --- .../smartsheet/calendar/DayView.vue | 1 + .../smartsheet/calendar/MonthView.vue | 25 ++++++++++++++----- .../smartsheet/calendar/RecordCard.vue | 10 ++++---- .../smartsheet/calendar/SideMenu.vue | 4 +-- .../smartsheet/calendar/WeekView.vue | 2 +- .../components/smartsheet/calendar/index.vue | 1 + .../composables/useCalendarViewStore.ts | 11 +++++++- 7 files changed, 39 insertions(+), 15 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/calendar/DayView.vue b/packages/nc-gui/components/smartsheet/calendar/DayView.vue index 2690964dc6..3295ef0574 100644 --- a/packages/nc-gui/components/smartsheet/calendar/DayView.vue +++ b/packages/nc-gui/components/smartsheet/calendar/DayView.vue @@ -269,6 +269,7 @@ const dropEvent = (event: DragEvent) => { :name="record.row[displayField.title]" :position="record.rowMeta.position" :record="record" + :resize="false" color="blue" size="small" @click="emit('expand-record', record)" diff --git a/packages/nc-gui/components/smartsheet/calendar/MonthView.vue b/packages/nc-gui/components/smartsheet/calendar/MonthView.vue index ecaecaae6b..4bb6f45df5 100644 --- a/packages/nc-gui/components/smartsheet/calendar/MonthView.vue +++ b/packages/nc-gui/components/smartsheet/calendar/MonthView.vue @@ -245,7 +245,7 @@ const recordsToDisplay = computed<{ position = 'none' } - if (heightRequired > perHeight) { + if (heightRequired + 15 > perHeight) { style.display = 'none' for (let i = startDayIndex; i <= endDayIndex; i++) { const week = dates.value[weekIndex] @@ -289,6 +289,10 @@ const resizeInProgress = ref(false) const isDragging = ref(false) const dragRecord = ref() +const selectedRecord = ref() + +const dragTimeout = ref(null) + const onDrag = (event: MouseEvent) => { const { top, height, width, left } = calendarGridContainer.value.getBoundingClientRect() @@ -564,6 +568,14 @@ const isDateSelected = (date: Date) => { if (!selectedDate.value) return false return dayjs(date).isSame(selectedDate.value, 'day') } + +onMounted(() => { + document.addEventListener('mouseup', stopDrag) +}) + +onBeforeUnmount(() => { + document.removeEventListener('mouseup', stopDrag) +})