|
|
@ -8,6 +8,8 @@ const meta = inject(MetaInj, ref()) |
|
|
|
|
|
|
|
|
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isMobileMode } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
const reloadViewMetaHook = inject(ReloadViewMetaHookInj) |
|
|
|
const reloadViewMetaHook = inject(ReloadViewMetaHookInj) |
|
|
|
|
|
|
|
|
|
|
|
const reloadViewDataHook = inject(ReloadViewDataHookInj) |
|
|
|
const reloadViewDataHook = inject(ReloadViewDataHookInj) |
|
|
@ -66,7 +68,6 @@ const expandedFormRowState = ref<Record<string, any>>() |
|
|
|
const expandRecord = (row: RowType, state?: Record<string, any>) => { |
|
|
|
const expandRecord = (row: RowType, state?: Record<string, any>) => { |
|
|
|
const rowId = extractPkFromRow(row.row, meta.value!.columns!) |
|
|
|
const rowId = extractPkFromRow(row.row, meta.value!.columns!) |
|
|
|
|
|
|
|
|
|
|
|
expandedFormRow.value = row |
|
|
|
|
|
|
|
expandedFormRowState.value = state |
|
|
|
expandedFormRowState.value = state |
|
|
|
|
|
|
|
|
|
|
|
if (rowId && !isPublic.value) { |
|
|
|
if (rowId && !isPublic.value) { |
|
|
@ -77,6 +78,7 @@ const expandRecord = (row: RowType, state?: Record<string, any>) => { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
expandedFormRow.value = row |
|
|
|
expandedFormDlg.value = true |
|
|
|
expandedFormDlg.value = true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -118,82 +120,97 @@ reloadViewDataHook?.on(async (params: void | { shouldShowLoading?: boolean }) => |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="flex h-full relative flex-row" data-testid="nc-calendar-wrapper"> |
|
|
|
<template v-if="isMobileMode"> |
|
|
|
<div class="flex flex-col w-full"> |
|
|
|
<div class="pl-6 pr-[120px] py-6 bg-white flex-col justify-start items-start gap-2.5 inline-flex"> |
|
|
|
<template v-if="calendarRange?.length && !isCalendarMetaLoading"> |
|
|
|
<div class="text-gray-500 text-5xl font-semibold leading-16"> |
|
|
|
<LazySmartsheetCalendarYearView v-if="activeCalendarView === 'year'" /> |
|
|
|
{{ $t('general.available') }}<br />{{ $t('title.inDesktop') }} |
|
|
|
<template v-if="!isCalendarDataLoading"> |
|
|
|
</div> |
|
|
|
<LazySmartsheetCalendarMonthView |
|
|
|
<div class="text-gray-500 text-base font-medium leading-normal"> |
|
|
|
v-if="activeCalendarView === 'month'" |
|
|
|
{{ $t('msg.calendarViewNotSupportedOnMobile') }} |
|
|
|
@expand-record="expandRecord" |
|
|
|
</div> |
|
|
|
@new-record="newRecord" |
|
|
|
</div> |
|
|
|
/> |
|
|
|
</template> |
|
|
|
<LazySmartsheetCalendarWeekViewDateField |
|
|
|
<template v-else> |
|
|
|
v-else-if="activeCalendarView === 'week' && calDataType === UITypes.Date" |
|
|
|
<div class="flex h-full relative flex-row" data-testid="nc-calendar-wrapper"> |
|
|
|
@expand-record="expandRecord" |
|
|
|
<div class="flex flex-col w-full"> |
|
|
|
@new-record="newRecord" |
|
|
|
<template v-if="calendarRange?.length && !isCalendarMetaLoading"> |
|
|
|
/> |
|
|
|
<LazySmartsheetCalendarYearView v-if="activeCalendarView === 'year'" /> |
|
|
|
<LazySmartsheetCalendarWeekViewDateTimeField |
|
|
|
<template v-if="!isCalendarDataLoading"> |
|
|
|
v-else-if="activeCalendarView === 'week' && calDataType === UITypes.DateTime" |
|
|
|
<LazySmartsheetCalendarMonthView |
|
|
|
@expand-record="expandRecord" |
|
|
|
v-if="activeCalendarView === 'month'" |
|
|
|
@new-record="newRecord" |
|
|
|
@expand-record="expandRecord" |
|
|
|
/> |
|
|
|
@new-record="newRecord" |
|
|
|
<LazySmartsheetCalendarDayViewDateField |
|
|
|
/> |
|
|
|
v-else-if="activeCalendarView === 'day' && calDataType === UITypes.Date" |
|
|
|
<LazySmartsheetCalendarWeekViewDateField |
|
|
|
@expand-record="expandRecord" |
|
|
|
v-else-if="activeCalendarView === 'week' && calDataType === UITypes.Date" |
|
|
|
@new-record="newRecord" |
|
|
|
@expand-record="expandRecord" |
|
|
|
/> |
|
|
|
@new-record="newRecord" |
|
|
|
<LazySmartsheetCalendarDayViewDateTimeField |
|
|
|
/> |
|
|
|
v-else-if="activeCalendarView === 'day' && calDataType === UITypes.DateTime" |
|
|
|
<LazySmartsheetCalendarWeekViewDateTimeField |
|
|
|
@expand-record="expandRecord" |
|
|
|
v-else-if="activeCalendarView === 'week' && calDataType === UITypes.DateTime" |
|
|
|
@new-record="newRecord" |
|
|
|
@expand-record="expandRecord" |
|
|
|
/> |
|
|
|
@new-record="newRecord" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<LazySmartsheetCalendarDayViewDateField |
|
|
|
|
|
|
|
v-else-if="activeCalendarView === 'day' && calDataType === UITypes.Date" |
|
|
|
|
|
|
|
@expand-record="expandRecord" |
|
|
|
|
|
|
|
@new-record="newRecord" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<LazySmartsheetCalendarDayViewDateTimeField |
|
|
|
|
|
|
|
v-else-if="activeCalendarView === 'day' && calDataType === UITypes.DateTime" |
|
|
|
|
|
|
|
@expand-record="expandRecord" |
|
|
|
|
|
|
|
@new-record="newRecord" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
v-if="isCalendarDataLoading && activeCalendarView !== 'year'" |
|
|
|
|
|
|
|
class="flex w-full items-center h-full justify-center" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<GeneralLoader size="xlarge" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template v-else-if="isCalendarMetaLoading"> |
|
|
|
<div v-if="isCalendarDataLoading && activeCalendarView !== 'year'" class="flex w-full items-center h-full justify-center"> |
|
|
|
<div class="flex w-full items-center h-full justify-center"> |
|
|
|
<GeneralLoader size="xlarge" /> |
|
|
|
<GeneralLoader size="xlarge" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-else-if="isCalendarMetaLoading"> |
|
|
|
<template v-else> |
|
|
|
<div class="flex w-full items-center h-full justify-center"> |
|
|
|
<div class="flex w-full items-center h-full justify-center"> |
|
|
|
<GeneralLoader size="xlarge" /> |
|
|
|
{{ $t('activity.noRange') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
</div> |
|
|
|
<div class="flex w-full items-center h-full justify-center"> |
|
|
|
<LazySmartsheetCalendarSideMenu :visible="showSideMenu" @expand-record="expandRecord" @new-record="newRecord" /> |
|
|
|
{{ $t('activity.noRange') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<LazySmartsheetCalendarSideMenu :visible="showSideMenu" @expand-record="expandRecord" @new-record="newRecord" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Suspense> |
|
|
|
<Suspense> |
|
|
|
|
|
|
|
<LazySmartsheetExpandedForm |
|
|
|
|
|
|
|
v-if="expandedFormRow && expandedFormDlg" |
|
|
|
|
|
|
|
v-model="expandedFormDlg" |
|
|
|
|
|
|
|
:row="expandedFormRow" |
|
|
|
|
|
|
|
:load-row="!isPublic" |
|
|
|
|
|
|
|
:state="expandedFormRowState" |
|
|
|
|
|
|
|
:meta="meta" |
|
|
|
|
|
|
|
:view="view" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Suspense> |
|
|
|
|
|
|
|
|
|
|
|
<LazySmartsheetExpandedForm |
|
|
|
<LazySmartsheetExpandedForm |
|
|
|
v-if="expandedFormRow && expandedFormDlg" |
|
|
|
v-if="expandedFormOnRowIdDlg && meta?.id" |
|
|
|
v-model="expandedFormDlg" |
|
|
|
v-model="expandedFormOnRowIdDlg" |
|
|
|
:row="expandedFormRow" |
|
|
|
close-after-save |
|
|
|
:load-row="!isPublic" |
|
|
|
:load-row="!isPublic" |
|
|
|
:state="expandedFormRowState" |
|
|
|
|
|
|
|
:meta="meta" |
|
|
|
:meta="meta" |
|
|
|
|
|
|
|
:state="expandedFormRowState" |
|
|
|
|
|
|
|
:row="{ |
|
|
|
|
|
|
|
row: {}, |
|
|
|
|
|
|
|
oldRow: {}, |
|
|
|
|
|
|
|
rowMeta: {}, |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
:row-id="route.query.rowId" |
|
|
|
|
|
|
|
:expand-form="expandRecord" |
|
|
|
:view="view" |
|
|
|
:view="view" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Suspense> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<LazySmartsheetExpandedForm |
|
|
|
|
|
|
|
v-if="expandedFormOnRowIdDlg && meta?.id" |
|
|
|
|
|
|
|
v-model="expandedFormOnRowIdDlg" |
|
|
|
|
|
|
|
close-after-save |
|
|
|
|
|
|
|
:load-row="!isPublic" |
|
|
|
|
|
|
|
:meta="meta" |
|
|
|
|
|
|
|
:state="expandedFormRowState" |
|
|
|
|
|
|
|
:row="{ |
|
|
|
|
|
|
|
row: {}, |
|
|
|
|
|
|
|
oldRow: {}, |
|
|
|
|
|
|
|
rowMeta: {}, |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
:row-id="route.query.rowId" |
|
|
|
|
|
|
|
:expand-form="expandRecord" |
|
|
|
|
|
|
|
:view="view" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|