diff --git a/packages/nc-gui-v2/components/cell/Currency.vue b/packages/nc-gui-v2/components/cell/Currency.vue index fa6c0a6b22..789ef8457e 100644 --- a/packages/nc-gui-v2/components/cell/Currency.vue +++ b/packages/nc-gui-v2/components/cell/Currency.vue @@ -3,7 +3,7 @@ import type { VNodeRef } from '@vue/runtime-core' import { ColumnInj, ReadonlyInj, computed, inject, useVModel } from '#imports' interface Props { - modelValue: number | null + modelValue: number | null | undefined } const props = defineProps() diff --git a/packages/nc-gui-v2/components/cell/DatePicker.vue b/packages/nc-gui-v2/components/cell/DatePicker.vue index 412626ddff..2ff27e5000 100644 --- a/packages/nc-gui-v2/components/cell/DatePicker.vue +++ b/packages/nc-gui-v2/components/cell/DatePicker.vue @@ -3,7 +3,7 @@ import dayjs from 'dayjs' import { ColumnInj, ReadonlyInj } from '#imports' interface Props { - modelValue: string | null + modelValue: string | null | undefined } const { modelValue } = defineProps() diff --git a/packages/nc-gui-v2/components/cell/DateTimePicker.vue b/packages/nc-gui-v2/components/cell/DateTimePicker.vue index 8b76ef12c2..22e15ed384 100644 --- a/packages/nc-gui-v2/components/cell/DateTimePicker.vue +++ b/packages/nc-gui-v2/components/cell/DateTimePicker.vue @@ -3,7 +3,7 @@ import dayjs from 'dayjs' import { ReadonlyInj } from '#imports' interface Props { - modelValue: string | null + modelValue: string | null | undefined } const { modelValue } = defineProps() diff --git a/packages/nc-gui-v2/components/cell/Decimal.vue b/packages/nc-gui-v2/components/cell/Decimal.vue index c29f365437..bada15abc1 100644 --- a/packages/nc-gui-v2/components/cell/Decimal.vue +++ b/packages/nc-gui-v2/components/cell/Decimal.vue @@ -3,7 +3,7 @@ import type { VNodeRef } from '@vue/runtime-core' import { ReadonlyInj, inject, useVModel } from '#imports' interface Props { - modelValue: number | null | string + modelValue: number | null | string | undefined } interface Emits { diff --git a/packages/nc-gui-v2/components/cell/Duration.vue b/packages/nc-gui-v2/components/cell/Duration.vue index 5182e3514f..b267e13dce 100644 --- a/packages/nc-gui-v2/components/cell/Duration.vue +++ b/packages/nc-gui-v2/components/cell/Duration.vue @@ -11,7 +11,7 @@ import { } from '#imports' interface Props { - modelValue: number | string | null + modelValue: number | string | null | undefined } const { modelValue } = defineProps() diff --git a/packages/nc-gui-v2/components/cell/Email.vue b/packages/nc-gui-v2/components/cell/Email.vue index e59cb95992..f85ef871ee 100644 --- a/packages/nc-gui-v2/components/cell/Email.vue +++ b/packages/nc-gui-v2/components/cell/Email.vue @@ -3,7 +3,7 @@ import type { VNodeRef } from '@vue/runtime-core' import { ReadonlyInj, computed, inject, isEmail, useVModel } from '#imports' interface Props { - modelValue: string | null + modelValue: string | null | undefined } interface Emits { diff --git a/packages/nc-gui-v2/components/cell/Float.vue b/packages/nc-gui-v2/components/cell/Float.vue index 09f23fa791..ff9b02b877 100644 --- a/packages/nc-gui-v2/components/cell/Float.vue +++ b/packages/nc-gui-v2/components/cell/Float.vue @@ -3,7 +3,7 @@ import type { VNodeRef } from '@vue/runtime-core' import { ReadonlyInj, inject, useVModel } from '#imports' interface Props { - modelValue: number | null + modelValue: number | null | undefined } interface Emits { diff --git a/packages/nc-gui-v2/components/cell/Integer.vue b/packages/nc-gui-v2/components/cell/Integer.vue index 2fe13c4d0c..f3686409c1 100644 --- a/packages/nc-gui-v2/components/cell/Integer.vue +++ b/packages/nc-gui-v2/components/cell/Integer.vue @@ -3,7 +3,7 @@ import type { VNodeRef } from '@vue/runtime-core' import { ReadonlyInj, inject, useVModel } from '#imports' interface Props { - modelValue: number | null + modelValue: number | null | undefined } interface Emits { diff --git a/packages/nc-gui-v2/components/cell/Json.vue b/packages/nc-gui-v2/components/cell/Json.vue index 14297ffa9f..3e621b870f 100644 --- a/packages/nc-gui-v2/components/cell/Json.vue +++ b/packages/nc-gui-v2/components/cell/Json.vue @@ -2,6 +2,7 @@ import { Modal as AModal } from 'ant-design-vue' import Editor from '~/components/monaco/Editor.vue' import { ReadonlyInj, computed, inject, ref, useVModel, watch } from '#imports' +import { EditModeInj } from '~/context' interface Props { modelValue: string | Record | undefined @@ -15,7 +16,9 @@ const props = defineProps() const emits = defineEmits() -const editEnabled = inject(ReadonlyInj) +const editEnabled = inject(EditModeInj, ref(false)) + +const readonly = inject(ReadonlyInj) const vModel = useVModel(props, 'modelValue', emits) @@ -87,7 +90,7 @@ watch(editEnabled, () => {