|
|
@ -17,9 +17,11 @@ const { formState, generateNewColumnMeta, addOrUpdate, onAlter, onUidtOrIdTypeCh |
|
|
|
const reloadDataTrigger = inject(ReloadViewDataHookInj) |
|
|
|
const reloadDataTrigger = inject(ReloadViewDataHookInj) |
|
|
|
|
|
|
|
|
|
|
|
const advancedOptions = ref(false) |
|
|
|
const advancedOptions = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const { getMeta } = useMetas() |
|
|
|
const { getMeta } = useMetas() |
|
|
|
|
|
|
|
|
|
|
|
const formulaOptionsRef = ref() |
|
|
|
const formulaOptionsRef = ref() |
|
|
|
|
|
|
|
|
|
|
|
const editOrAddRef = ref<HTMLElement>() |
|
|
|
const editOrAddRef = ref<HTMLElement>() |
|
|
|
|
|
|
|
|
|
|
|
const columnToValidate = [UITypes.Email, UITypes.URL, UITypes.PhoneNumber] |
|
|
|
const columnToValidate = [UITypes.Email, UITypes.URL, UITypes.PhoneNumber] |
|
|
@ -74,23 +76,12 @@ onMounted(() => { |
|
|
|
generateNewColumnMeta() |
|
|
|
generateNewColumnMeta() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (formState.value.uidt === UITypes.Formula) { |
|
|
|
|
|
|
|
formulaOptionsRef.value.formulaSuggestionDrawer = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for cases like formula |
|
|
|
// for cases like formula |
|
|
|
if (formState.value && !formState.value.column_name) { |
|
|
|
if (formState.value && !formState.value.column_name) { |
|
|
|
formState.value.column_name = formState.value?.title |
|
|
|
formState.value.column_name = formState.value?.title |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => { |
|
|
|
|
|
|
|
if (formState.value.uidt === UITypes.Formula) { |
|
|
|
|
|
|
|
// close formula drawer |
|
|
|
|
|
|
|
formulaOptionsRef.value.formulaSuggestionDrawer = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleClose = (e: MouseEvent) => { |
|
|
|
const handleClose = (e: MouseEvent) => { |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
e.target && |
|
|
|
e.target && |
|
|
@ -127,11 +118,7 @@ useEventListener(document, 'click', handleClose) |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
<SmartsheetColumnFormulaOptions |
|
|
|
<SmartsheetColumnFormulaOptions v-if="formState.uidt === UITypes.Formula" v-model:value="formState" /> |
|
|
|
v-if="formState.uidt === UITypes.Formula" |
|
|
|
|
|
|
|
ref="formulaOptionsRef" |
|
|
|
|
|
|
|
v-model:value="formState" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<SmartsheetColumnCurrencyOptions v-if="formState.uidt === UITypes.Currency" v-model:value="formState" /> |
|
|
|
<SmartsheetColumnCurrencyOptions v-if="formState.uidt === UITypes.Currency" v-model:value="formState" /> |
|
|
|
<SmartsheetColumnDurationOptions v-if="formState.uidt === UITypes.Duration" v-model:value="formState" /> |
|
|
|
<SmartsheetColumnDurationOptions v-if="formState.uidt === UITypes.Duration" v-model:value="formState" /> |
|
|
|
<SmartsheetColumnRatingOptions v-if="formState.uidt === UITypes.Rating" v-model:value="formState" /> |
|
|
|
<SmartsheetColumnRatingOptions v-if="formState.uidt === UITypes.Rating" v-model:value="formState" /> |
|
|
|