π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix: calendar dark mode corrections
DarkPhoenix27042f1ce5a47a02
diff --git a/packages/nc-gui/components/nc/DateWeekSelector.vue b/packages/nc-gui/components/nc/DateWeekSelector.vueindex aa2963d527..19777a038c 100644--- a/packages/nc-gui/components/nc/DateWeekSelector.vue+++ b/packages/nc-gui/components/nc/DateWeekSelector.vue@@ -179,16 +179,16 @@ const paginate = (action: 'next' | 'prev') => {</template></NcTooltip>- <div v-if="isCellInputField" class="text-gray-700 text-sm font-semibold">- <span class="nc-month-picker-btn cursor-pointer hover:text-brand-500" @click="pickerType = 'month'">{{+ <div v-if="isCellInputField" class="text-nc-content-gray-subtle text-sm font-semibold">+ <span class="nc-month-picker-btn cursor-pointer hover:text-nc-content-brand" @click="pickerType = 'month'">{{currentMonth}}</span>{{ ' ' }}- <span class="nc-year-picker-btn cursor-pointer hover:text-brand-500" @click="pickerType = 'year'">{{+ <span class="nc-year-picker-btn cursor-pointer hover:text-nc-content-brand" @click="pickerType = 'year'">{{currentYear}}</span></div>- <span v-else class="text-gray-700 text-sm font-semibold">{{ currentMonthYear }}</span>+ <span v-else class="text-nc-content-gray-subtle text-sm font-semibold">{{ currentMonthYear }}</span><NcTooltip hide-on-click><NcButton class="!border-0" data-testid="nc-calendar-next-btn" size="small" type="text" @click="paginate('next')">@@ -200,7 +200,7 @@ const paginate = (action: 'next' | 'prev') => {</NcTooltip></template><template v-else>- <div class="text-gray-700 text-sm font-semibold">+ <div class="text-nc-content-gray-subtle text-sm font-semibold"><span class="px-1 font-bold leading-6 text-sm text-nc-content-gray-subtle py-2">{{ currentMonthYear }}</span>@@ -231,13 +231,13 @@ const paginate = (action: 'next' | 'prev') => {<divclass="flex justify-between gap-1":class="{- 'border-b-1 border-gray-200 ': isCellInputField,+ 'border-b-1 border-nc-border-gray-medium ': isCellInputField,}"><spanv-for="(day, index) in days":key="index"- class="flex w-8 h-8 items-center font-[400] justify-center text-gray-500"+ class="flex w-8 h-8 items-center font-[400] justify-center text-nc-content-gray-muted">{{ day }}</span></div>@@ -255,18 +255,20 @@ const paginate = (action: 'next' | 'prev') => {:class="{'rounded-lg': !isWeekPicker && !isCellInputField,'border-1 ': isSelectedDate(date) && !isWeekPicker && isDayInPagedMonth(date),- 'bg-gray-200 !font-bold': isSelectedDate(date) && !isWeekPicker && isDayInPagedMonth(date) && !isCellInputField,- 'bg-gray-300 !font-weight-600': isSelectedDate(date) && !isWeekPicker && isDayInPagedMonth(date) && isCellInputField,- 'hover:(border-1 border-gray-200 bg-gray-100)': !isSelectedDate(date) && !isWeekPicker,+ 'bg-nc-bg-gray-medium !font-bold':+ isSelectedDate(date) && !isWeekPicker && isDayInPagedMonth(date) && !isCellInputField,+ 'bg-nc-bg-gray-dark !font-weight-600':+ isSelectedDate(date) && !isWeekPicker && isDayInPagedMonth(date) && isCellInputField,+ 'hover:(border-1 border-nc-border-gray-medium bg-nc-bg-gray-light)': !isSelectedDate(date) && !isWeekPicker,'nc-selected-week !font-semibold z-1': isDateInSelectedWeek(date) && isWeekPicker,'border-none': isWeekPicker,'border-transparent': !isWeekPicker,- 'text-gray-400': !isDateInCurrentMonth(date),+ 'text-nc-content-gray-disabled': !isDateInCurrentMonth(date),'nc-selected-week-start': isSameDate(date, selectedWeek?.start),'nc-selected-week-end': isSameDate(date, selectedWeek?.end),- 'rounded-md text-brand-500 !font-semibold nc-calendar-today':+ 'rounded-md text-nc-content-brand !font-semibold nc-calendar-today':isSameDate(date, timezoneDayjs.dayjsTz()) && isDateInCurrentMonth(date),- 'text-gray-500': date.get('day') === 0 || date.get('day') === 6,+ 'text-nc-content-gray-muted': date.get('day') === 0 || date.get('day') === 6,'nc-date-item font-weight-400': isCellInputField,'font-medium': !isCellInputField,'rounded': !isWeekPicker && isCellInputField,@@ -279,10 +281,10 @@ const paginate = (action: 'next' | 'prev') => {<spanv-if="isActiveDate(date)":class="{- '!border-white': isSelectedDate(date),- '!border-brand-50': isSameDate(date, timezoneDayjs.dayjsTz()),+ '!border-nc-white': isSelectedDate(date),+ '!border-nc-brand-50': isSameDate(date, timezoneDayjs.dayjsTz()),}"- class="absolute top-1 transition right-1 h-1.5 w-1.5 z-2 border-1 rounded-full border-white bg-brand-500"+ class="absolute top-1 transition right-1 h-1.5 w-1.5 z-2 border-1 rounded-full border-nc-white bg-nc-fill-primary"></span><span class="nc-date-item-inner z-2">{{ date.get('date') }}@@ -323,7 +325,7 @@ const paginate = (action: 'next' | 'prev') => {}.nc-selected-week:before {- @apply absolute top-0 left-0 w-full h-full bg-gray-200;+ @apply absolute top-0 left-0 w-full h-full bg-nc-bg-gray-medium;content: '';width: 134%;height: 100%;diff --git a/packages/nc-gui/components/nc/MonthYearSelector.vue b/packages/nc-gui/components/nc/MonthYearSelector.vueindex 37ebd138a4..41564171ba 100644--- a/packages/nc-gui/components/nc/MonthYearSelector.vue+++ b/packages/nc-gui/components/nc/MonthYearSelector.vue@@ -120,9 +120,9 @@ const compareYear = (date1: dayjs.Dayjs, date2: dayjs.Dayjs) => {</div><span- class="nc-year-picker-btn text-gray-700 font-semibold"+ class="nc-year-picker-btn text-nc-content-gray-subtle font-semibold":class="{- 'cursor-pointer hover:text-brand-500': isCellInputField && !isYearPicker,+ 'cursor-pointer hover:text-nc-content-brand': isCellInputField && !isYearPicker,}"@click="!isYearPicker ? (pickerType = 'year') : () => undefined">{{@@ -145,7 +145,7 @@ const compareYear = (date1: dayjs.Dayjs, date2: dayjs.Dayjs) => {</div></template><template v-else>- <div class="text-gray-700 text-sm font-semibold">+ <div class="text-nc-content-gray-subtle text-sm font-semibold"><span class="px-1 font-bold leading-6 text-sm text-nc-content-gray-subtle py-2">{{ isYearPicker ? timezoneDayjs.dayjsTz(selectedDate).year() : timezoneDayjs.dayjsTz(pageDate).format('YYYY') }}</span>@@ -185,14 +185,14 @@ const compareYear = (date1: dayjs.Dayjs, date2: dayjs.Dayjs) => {v-for="(month, id) in months":key="id":class="{- 'bg-gray-200 !text-brand-900 !font-bold': isMonthSelected(month) && !isCellInputField,- 'bg-gray-300 !font-weight-600 ': isMonthSelected(month) && isCellInputField,- 'hover:(border-1 border-gray-200 bg-gray-100)': !isMonthSelected(month),- '!text-brand-500': timezoneDayjs.dayjsTz().isSame(month, 'month'),+ 'bg-nc-bg-gray-medium !text-nc-brand-900 !font-bold': isMonthSelected(month) && !isCellInputField,+ 'bg-nc-bg-gray-dark !font-weight-600 ': isMonthSelected(month) && isCellInputField,+ 'hover:(border-1 border-nc-border-gray-medium bg-nc-bg-gray-light)': !isMonthSelected(month),+ '!text-nc-content-brand': timezoneDayjs.dayjsTz().isSame(month, 'month'),'font-weight-400': isCellInputField,'font-medium': !isCellInputField,}"- class="nc-month-item h-8 flex items-center rounded transition-all justify-center text-gray-700 cursor-pointer"+ class="nc-month-item h-8 flex items-center rounded transition-all justify-center text-nc-content-gray-subtle cursor-pointer":title="isCellInputField ? month.format('YYYY-MM') : undefined"@click="selectedDate = month">@@ -204,12 +204,12 @@ const compareYear = (date1: dayjs.Dayjs, date2: dayjs.Dayjs) => {v-for="(year, id) in years":key="id":class="{- 'bg-gray-200 !font-bold ': compareYear(year, selectedDate) && !isCellInputField,- 'bg-gray-300 !text-brand-500 !font-weight-600 ': compareYear(year, selectedDate) && isCellInputField,- 'hover:(border-1 border-gray-200 bg-gray-100)': !compareYear(year, selectedDate),- '!text-brand-500': timezoneDayjs.dayjsTz().format('YYYY') === year.format('YYYY'),- 'font-weight-400 text-gray-700': isCellInputField,- 'font-medium text-gray-900': !isCellInputField,+ 'bg-nc-bg-gray-medium !font-bold ': compareYear(year, selectedDate) && !isCellInputField,+ 'bg-nc-bg-gray-dark !text-nc-content-brand !font-weight-600 ': compareYear(year, selectedDate) && isCellInputField,+ 'hover:(border-1 border-nc-border-gray-medium bg-nc-bg-gray-light)': !compareYear(year, selectedDate),+ '!text-nc-content-brand': timezoneDayjs.dayjsTz().format('YYYY') === year.format('YYYY'),+ 'font-weight-400 text-nc-content-gray-subtle': isCellInputField,+ 'font-medium text-nc-content-gray-emphasis': !isCellInputField,}"class="nc-year-item h-8 flex items-center rounded transition-all justify-center cursor-pointer":title="isCellInputField ? year.format('YYYY') : undefined"diff --git a/packages/nc-gui/components/smartsheet/calendar/SideMenu.vue b/packages/nc-gui/components/smartsheet/calendar/SideMenu.vueindex 2e6432bc0c..21d726f7f5 100644--- a/packages/nc-gui/components/smartsheet/calendar/SideMenu.vue+++ b/packages/nc-gui/components/smartsheet/calendar/SideMenu.vue@@ -263,14 +263,26 @@ const newRecord = () => {...rowDefaultData(meta.value?.columns),}+ let fromDateif (activeCalendarView.value === 'day') {- row[calendarRange.value[0]!.fk_from_col!.title!] = selectedDate.value.format(updateFormat.value)+ fromDate = selectedDate.value} else if (activeCalendarView.value === 'week') {- row[calendarRange.value[0]!.fk_from_col!.title!] = selectedDateRange.value.start.format(updateFormat.value)+ fromDate = selectedDateRange.value.start} else if (activeCalendarView.value === 'month') {- row[calendarRange.value[0]!.fk_from_col!.title!] = (selectedDate.value ?? selectedMonth.value).format(updateFormat.value)+ fromDate = selectedDate.value ?? selectedMonth.value} else if (activeCalendarView.value === 'year') {- row[calendarRange.value[0]!.fk_from_col!.title!] = selectedDate.value.format(updateFormat.value)+ fromDate = selectedDate.value+ }++ // Set the from date+ if (calendarRange.value[0]?.fk_from_col) {+ row[calendarRange.value[0].fk_from_col.title!] = fromDate.format(updateFormat.value)+ }++ // Set the to date if to_col is configured (same as from date + 1 hour)+ if (calendarRange.value[0]?.fk_to_col) {+ const toDate = fromDate.endOf('hour')+ row[calendarRange.value[0].fk_to_col.title!] = toDate.format(updateFormat.value)}emit('newRecord', { row, oldRow: {}, rowMeta: { new: true } })@@ -421,7 +433,7 @@ const selectOption = (option) => {data-testid="nc-calendar-sidebar-search-btn"size="small":class="{- '!bg-brand-50 nc-calendar-sidebar-search-active !text-nc-content-brand': showSearch,+ '!bg-nc-brand-50 nc-calendar-sidebar-search-active !text-nc-content-brand': showSearch,}":shadow="false"class="!h-7 !rounded-md nc-calendar-sidebar-search-btn !border-0"@@ -480,8 +492,7 @@ const selectOption = (option) => {@click="newRecord"><div class="flex items-center gap-2">- <component :is="iconMap.plus" />-+ <GeneralIcon icon="ncPlus" />Record</div></NcButton>diff --git a/packages/nc-gui/components/smartsheet/calendar/SideRecordCard.vue b/packages/nc-gui/components/smartsheet/calendar/SideRecordCard.vueindex b37b72623c..5f210ad7b5 100644--- a/packages/nc-gui/components/smartsheet/calendar/SideRecordCard.vue+++ b/packages/nc-gui/components/smartsheet/calendar/SideRecordCard.vue@@ -109,13 +109,13 @@ const errorInfo = computed(() => {<div class="flex relative items-center gap-2"><span:class="{- 'bg-maroon-500': props.color === 'maroon',- 'bg-blue-500': props.color === 'blue',- 'bg-green-500': props.color === 'green',- 'bg-yellow-500': props.color === 'yellow',- 'bg-pink-500': props.color === 'pink',- 'bg-purple-500': props.color === 'purple',- 'bg-gray-900': props.color === 'gray',+ 'bg-nc-fill-coloured-maroon-medium': props.color === 'maroon',+ 'bg-nc-fill-coloured-blue-medium': props.color === 'blue',+ 'bg-nc-fill-coloured-green-medium': props.color === 'green',+ 'bg-nc-fill-coloured-yellow-medium': props.color === 'yellow',+ 'bg-nc-fill-coloured-pink-medium': props.color === 'pink',+ 'bg-nc-fill-coloured-purple-medium': props.color === 'purple',+ 'bg-nc-gray-900': props.color === 'gray',}"class="block h-12 w-1":style="rowColorInfo.rowLeftBorderColor"diff --git a/packages/nc-gui/components/smartsheet/calendar/YearView/Month.vue b/packages/nc-gui/components/smartsheet/calendar/YearView/Month.vueindex 248589999d..f8dcf50dd0 100644--- a/packages/nc-gui/components/smartsheet/calendar/YearView/Month.vue+++ b/packages/nc-gui/components/smartsheet/calendar/YearView/Month.vue@@ -229,7 +229,7 @@ watch(activeDates, (newActiveDates) => {<template><div>- <div class="flex justify-center px-2 nc-date-week-header text-gray-700 text-sm py-2 font-semibold items-center">+ <div class="flex justify-center px-2 nc-date-week-header text-nc-content-gray-subtle text-sm py-2 font-semibold items-center">{{ currentMonthYear }}</div><div@@ -240,7 +240,7 @@ watch(activeDates, (newActiveDates) => {class="max-w-[320px]"><div class="px-2.5">- <div class="flex border-b-1 justify-between gap-0.5 border-gray-200">+ <div class="flex border-b-1 justify-between gap-0.5 border-nc-border-gray-medium"><spanv-for="(day, index) in days":key="index"@@ -248,7 +248,7 @@ watch(activeDates, (newActiveDates) => {'w-8 h-8 text-sm': size === 'medium','text-xs w-6 h-6': size === 'small',}"- class="flex items-center uppercase py-1 font-medium justify-center text-gray-500"+ class="flex items-center uppercase py-1 font-medium justify-center text-nc-content-gray-muted">{{ day[0] }}</span></div>@@ -264,15 +264,15 @@ watch(activeDates, (newActiveDates) => {v-for="(date, index) in dates":key="index":class="{- 'bg-gray-300 border-1 !font-semibold': date.isSelectedAndIsInCurrentMonth,- 'hover:(border-1 border-gray-200 bg-gray-100)': !date.isSelected,- 'text-gray-400': !date.isDayInCurrentMonth,- 'text-brand-500 !font-semibold nc-calendar-today': date.isTodayInCurrentMonth,- 'text-gray-500': date.isWeekend,+ 'bg-nc-bg-gray-dark border-1 !font-semibold': date.isSelectedAndIsInCurrentMonth,+ 'hover:(border-1 border-nc-border-gray-medium bg-nc-bg-gray-light)': !date.isSelected,+ 'text-nc-content-gray-disabled': !date.isDayInCurrentMonth,+ 'text-nc-content-brand !font-semibold nc-calendar-today': date.isTodayInCurrentMonth,+ 'text-nc-content-gray-muted': date.isWeekend,'h-8 w-8 text-sm': size === 'medium','h-6 w-6 text-xs': size === 'small',}"- class="px-1 py-1.5 relative rounded border-transparent transition border-1 font-medium flex text-gray-700 items-center cursor-pointer justify-center"+ class="px-1 py-1.5 relative rounded border-transparent transition border-1 font-medium flex text-nc-content-gray-subtle items-center cursor-pointer justify-center"data-testid="nc-calendar-date":data-date="date.date.format('DD MMM YYYY')"@click="handleSelectDate(date.date)"@@ -283,10 +283,10 @@ watch(activeDates, (newActiveDates) => {:class="{'h-1.25 w-1.25 top-0.5 right-0.5': size === 'small','h-1.5 w-1.5 top-1 right-1': size === 'medium',- '!border-white': date.isDateSelected,- '!border-brand-50': date.isToday,+ '!border-nc-white': date.isDateSelected,+ '!border-nc-brand-50': date.isToday,}"- class="absolute z-2 transition border-1 rounded-full border-white bg-brand-500"+ class="absolute z-2 transition border-1 rounded-full border-nc-white bg-nc-brand-500"></span><span class="z-2">{{ date.dayVal }}