|
|
|
@ -16,6 +16,7 @@ import {
|
|
|
|
|
inject, |
|
|
|
|
provide, |
|
|
|
|
ref, |
|
|
|
|
rowDefaultData, |
|
|
|
|
useI18n, |
|
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
|
@ -72,8 +73,9 @@ const expandedFormOnRowIdDlg = computed({
|
|
|
|
|
|
|
|
|
|
const expandedFormDlg = ref(false) |
|
|
|
|
const expandedFormRow = ref<RowType>() |
|
|
|
|
const expandedFormRowState = ref<Record<string, any>>() |
|
|
|
|
|
|
|
|
|
const expandRecord = (row: RowType, isNew = false) => { |
|
|
|
|
const expandRecord = (row: RowType) => { |
|
|
|
|
const rowId = extractPkFromRow(row.row, meta.value!.columns!) |
|
|
|
|
|
|
|
|
|
if (rowId) { |
|
|
|
@ -89,6 +91,20 @@ const expandRecord = (row: RowType, isNew = false) => {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const newRecord = () => { |
|
|
|
|
// TODO: The default values has to be filled based on the active calendar view |
|
|
|
|
// and selected sidebar filter option |
|
|
|
|
expandRecord({ |
|
|
|
|
row: { |
|
|
|
|
...rowDefaultData(meta.value?.columns), |
|
|
|
|
}, |
|
|
|
|
oldRow: {}, |
|
|
|
|
rowMeta: { |
|
|
|
|
new: true, |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
|
await loadCalendarMeta() |
|
|
|
|
await loadCalendarData() |
|
|
|
@ -160,9 +176,25 @@ const headerText = computed(() => {
|
|
|
|
|
<GeneralLoader size="xlarge" /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<LazySmartsheetCalendarSideMenu v-if="!isMobileMode" :visible="showSideMenu" @expand-record="expandRecord" /> |
|
|
|
|
<LazySmartsheetCalendarSideMenu |
|
|
|
|
v-if="!isMobileMode" |
|
|
|
|
:visible="showSideMenu" |
|
|
|
|
@expand-record="expandRecord" |
|
|
|
|
@new-record="newRecord" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<Suspense> |
|
|
|
|
<LazySmartsheetExpandedForm |
|
|
|
|
v-if="expandedFormRow && expandedFormDlg" |
|
|
|
|
v-model="expandedFormDlg" |
|
|
|
|
:meta="meta" |
|
|
|
|
:row="expandedFormRow" |
|
|
|
|
:state="expandedFormRowState" |
|
|
|
|
:view="view" |
|
|
|
|
/> |
|
|
|
|
</Suspense> |
|
|
|
|
|
|
|
|
|
<Suspense> |
|
|
|
|
<LazySmartsheetExpandedForm |
|
|
|
|
v-if="expandedFormOnRowIdDlg" |
|
|
|
|