diff --git a/packages/nc-gui-v2/components/smartsheet-header/Cell.vue b/packages/nc-gui-v2/components/smartsheet-header/Cell.vue
index 652b617601..20680460ad 100644
--- a/packages/nc-gui-v2/components/smartsheet-header/Cell.vue
+++ b/packages/nc-gui-v2/components/smartsheet-header/Cell.vue
@@ -1,10 +1,14 @@
@@ -102,7 +106,7 @@ defineExpose({
-
+
@@ -237,6 +241,7 @@ defineExpose({
position: relative;
padding: 0 5px !important;
min-width: 200px;
+
& > * {
@apply flex align-center h-auto;
}
diff --git a/packages/nc-gui-v2/composables/useColumnCreateStore.ts b/packages/nc-gui-v2/composables/useColumnCreateStore.ts
new file mode 100644
index 0000000000..fb8f8f59ad
--- /dev/null
+++ b/packages/nc-gui-v2/composables/useColumnCreateStore.ts
@@ -0,0 +1,54 @@
+import { createInjectionState } from '@vueuse/core'
+import { Form } from 'ant-design-vue'
+import type { ColumnType } from 'nocodb-sdk'
+import { UITypes } from 'nocodb-sdk'
+import { computed } from '#imports'
+
+const useForm = Form.useForm
+
+const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState((column?: ColumnType) => {
+ // state
+ // todo: give proper type
+ const formState = ref>>({
+ title: 'title',
+ uidt: UITypes.SingleLineText,
+ ...(column || {}),
+ })
+
+ const additionalValidations = ref>({})
+
+ const validators = computed(() => {
+ return {
+ column_name: [
+ {
+ required: true,
+ message: 'Column name is required',
+ },
+ ],
+ uidt: [
+ {
+ required: true,
+ message: 'UI Datatype is required',
+ },
+ ],
+ ...(additionalValidations?.value || {}),
+ }
+ })
+
+ // actions
+ const setAdditionalValidations = (validations: Record) => {
+ additionalValidations.value = validations
+ }
+
+ const { resetFields, validate, validateInfos } = useForm(formState, validators)
+
+ return { formState, resetFields, validate, validateInfos, setAdditionalValidations }
+})
+
+export { useProvideColumnCreateStore, useColumnCreateStore }
+
+export function useColumnCreateStoreOrThrow() {
+ const columnCreateStore = useColumnCreateStore()
+ if (columnCreateStore == null) throw new Error('Please call `useColumnCreateStore` on the appropriate parent component')
+ return columnCreateStore
+}