mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.2 KiB
44 lines
1.2 KiB
<script lang="ts" setup> |
|
// todo: Remove this "Provider" component and use the "EditOrAdd" component directly |
|
import type { ColumnReqType, ColumnType } from 'nocodb-sdk' |
|
|
|
interface Props { |
|
column?: ColumnType |
|
columnPosition?: Pick<ColumnReqType, 'column_order'> |
|
preload?: Partial<ColumnType> |
|
tableExplorerColumns?: ColumnType[] |
|
fromTableExplorer?: boolean |
|
isColumnValid?: (value: Partial<ColumnType>) => boolean |
|
} |
|
|
|
const props = defineProps<Props>() |
|
|
|
const emit = defineEmits(['submit', 'cancel', 'mounted']) |
|
|
|
const meta = inject(MetaInj, ref()) |
|
|
|
const { column, preload, tableExplorerColumns, fromTableExplorer, isColumnValid } = toRefs(props) |
|
|
|
useProvideColumnCreateStore(meta, column, tableExplorerColumns, fromTableExplorer, isColumnValid) |
|
|
|
const { isWebhookCreateModalOpen } = useColumnCreateStoreOrThrow() |
|
|
|
const isWebHookModalOpen = () => { |
|
return isWebhookCreateModalOpen.value |
|
} |
|
|
|
defineExpose({ |
|
isWebHookModalOpen, |
|
}) |
|
</script> |
|
|
|
<template> |
|
<SmartsheetColumnEditOrAdd |
|
:preload="preload" |
|
:column-position="props.columnPosition" |
|
:from-table-explorer="props.fromTableExplorer || false" |
|
@submit="emit('submit')" |
|
@cancel="emit('cancel')" |
|
@mounted="emit('mounted')" |
|
/> |
|
</template>
|
|
|