|
|
@ -16,6 +16,7 @@ import { |
|
|
|
inject, |
|
|
|
inject, |
|
|
|
provide, |
|
|
|
provide, |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
|
|
|
|
rowDefaultData, |
|
|
|
useI18n, |
|
|
|
useI18n, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
|
|
|
@ -72,8 +73,9 @@ const expandedFormOnRowIdDlg = computed({ |
|
|
|
|
|
|
|
|
|
|
|
const expandedFormDlg = ref(false) |
|
|
|
const expandedFormDlg = ref(false) |
|
|
|
const expandedFormRow = ref<RowType>() |
|
|
|
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!) |
|
|
|
const rowId = extractPkFromRow(row.row, meta.value!.columns!) |
|
|
|
|
|
|
|
|
|
|
|
if (rowId) { |
|
|
|
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 () => { |
|
|
|
onMounted(async () => { |
|
|
|
await loadCalendarMeta() |
|
|
|
await loadCalendarMeta() |
|
|
|
await loadCalendarData() |
|
|
|
await loadCalendarData() |
|
|
@ -160,9 +176,25 @@ const headerText = computed(() => { |
|
|
|
<GeneralLoader size="xlarge" /> |
|
|
|
<GeneralLoader size="xlarge" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<LazySmartsheetCalendarSideMenu v-if="!isMobileMode" :visible="showSideMenu" @expand-record="expandRecord" /> |
|
|
|
<LazySmartsheetCalendarSideMenu |
|
|
|
|
|
|
|
v-if="!isMobileMode" |
|
|
|
|
|
|
|
:visible="showSideMenu" |
|
|
|
|
|
|
|
@expand-record="expandRecord" |
|
|
|
|
|
|
|
@new-record="newRecord" |
|
|
|
|
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Suspense> |
|
|
|
|
|
|
|
<LazySmartsheetExpandedForm |
|
|
|
|
|
|
|
v-if="expandedFormRow && expandedFormDlg" |
|
|
|
|
|
|
|
v-model="expandedFormDlg" |
|
|
|
|
|
|
|
:meta="meta" |
|
|
|
|
|
|
|
:row="expandedFormRow" |
|
|
|
|
|
|
|
:state="expandedFormRowState" |
|
|
|
|
|
|
|
:view="view" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Suspense> |
|
|
|
|
|
|
|
|
|
|
|
<Suspense> |
|
|
|
<Suspense> |
|
|
|
<LazySmartsheetExpandedForm |
|
|
|
<LazySmartsheetExpandedForm |
|
|
|
v-if="expandedFormOnRowIdDlg" |
|
|
|
v-if="expandedFormOnRowIdDlg" |
|
|
|