diff --git a/packages/nc-gui-v2/app.vue b/packages/nc-gui-v2/app.vue index 5ae49b4f84..3fe585a1a1 100644 --- a/packages/nc-gui-v2/app.vue +++ b/packages/nc-gui-v2/app.vue @@ -30,20 +30,20 @@ const toggleSidebar = () => {
-
+
NocoDB
+
+
{{ $t('general.loading') }}
-
-
diff --git a/packages/nc-gui-v2/components.d.ts b/packages/nc-gui-v2/components.d.ts index ca9f1693ce..0e5864cd54 100644 --- a/packages/nc-gui-v2/components.d.ts +++ b/packages/nc-gui-v2/components.d.ts @@ -66,6 +66,7 @@ declare module '@vue/runtime-core' { MdiDotsVertical: typeof import('~icons/mdi/dots-vertical')['default'] MdiLogout: typeof import('~icons/mdi/logout')['default'] MdiReload: typeof import('~icons/mdi/reload')['default'] + MdiTableArrowRight: typeof import('~icons/mdi/table-arrow-right')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] } diff --git a/packages/nc-gui-v2/components/cell/Checkbox.vue b/packages/nc-gui-v2/components/cell/Checkbox.vue index ec6fb56386..f24d797de5 100644 --- a/packages/nc-gui-v2/components/cell/Checkbox.vue +++ b/packages/nc-gui-v2/components/cell/Checkbox.vue @@ -26,7 +26,7 @@ const checkboxMeta = $computed(() => { unchecked: 'mdi-checkbox-blank-circle-outline', }, color: 'primary', - ...(column?.meta || {}), + ...(column?.value?.meta || {}), } }) diff --git a/packages/nc-gui-v2/components/cell/Currency.vue b/packages/nc-gui-v2/components/cell/Currency.vue index fe99200482..54bfdc53d2 100644 --- a/packages/nc-gui-v2/components/cell/Currency.vue +++ b/packages/nc-gui-v2/components/cell/Currency.vue @@ -3,7 +3,7 @@ import { computed, inject, ref, useVModel } from '#imports' import { ColumnInj, EditModeInj } from '~/context' interface Props { - modelValue: number + modelValue: number | null } const props = defineProps() @@ -22,7 +22,7 @@ const currencyMeta = computed(() => { return { currency_locale: 'en-US', currency_code: 'USD', - ...(column && column.meta ? column.meta : {}), + ...(column?.value?.meta ? column?.value?.meta : {}), } }) const currency = computed(() => { @@ -37,10 +37,18 @@ const currency = computed(() => { return vModel.value } }) + +const focus = (el: HTMLInputElement) => el?.focus() diff --git a/packages/nc-gui-v2/components/cell/DatePicker.vue b/packages/nc-gui-v2/components/cell/DatePicker.vue index 19e59b98a6..d69202b6ee 100644 --- a/packages/nc-gui-v2/components/cell/DatePicker.vue +++ b/packages/nc-gui-v2/components/cell/DatePicker.vue @@ -2,19 +2,18 @@ import dayjs from 'dayjs' import { ColumnInj, ReadonlyInj } from '~/context' +interface Props { + modelValue: string | null +} const { modelValue } = defineProps() const emit = defineEmits(['update:modelValue']) -interface Props { - modelValue: string -} - const columnMeta = inject(ColumnInj, null) const readOnlyMode = inject(ReadonlyInj, false) let isDateInvalid = $ref(false) -const dateFormat = columnMeta?.meta?.date_format ?? 'YYYY-MM-DD' +const dateFormat = columnMeta?.value?.meta?.date_format ?? 'YYYY-MM-DD' const localState = $computed({ get() { diff --git a/packages/nc-gui-v2/components/cell/DateTimePicker.vue b/packages/nc-gui-v2/components/cell/DateTimePicker.vue index 68f4a9087a..038e218c95 100644 --- a/packages/nc-gui-v2/components/cell/DateTimePicker.vue +++ b/packages/nc-gui-v2/components/cell/DateTimePicker.vue @@ -2,14 +2,14 @@ import dayjs from 'dayjs' import { ReadonlyInj } from '~/context' +interface Props { + modelValue: string | null +} + const { modelValue } = defineProps() const emit = defineEmits(['update:modelValue']) -interface Props { - modelValue: string -} - const { isMysql } = useProject() const readOnlyMode = inject(ReadonlyInj, false) diff --git a/packages/nc-gui-v2/components/cell/Decimal.vue b/packages/nc-gui-v2/components/cell/Decimal.vue index 677c482042..7f1ef4c114 100644 --- a/packages/nc-gui-v2/components/cell/Decimal.vue +++ b/packages/nc-gui-v2/components/cell/Decimal.vue @@ -1,8 +1,9 @@ diff --git a/packages/nc-gui-v2/components/cell/Duration.vue b/packages/nc-gui-v2/components/cell/Duration.vue index 9a19351556..aa888120cd 100644 --- a/packages/nc-gui-v2/components/cell/Duration.vue +++ b/packages/nc-gui-v2/components/cell/Duration.vue @@ -4,7 +4,7 @@ import { ColumnInj } from '~/context' import { convertDurationToSeconds, convertMS2Duration, durationOptions } from '~/utils' interface Props { - modelValue: number | string + modelValue: number | string | null } const { modelValue } = defineProps() @@ -16,7 +16,7 @@ const column = inject(ColumnInj) const showWarningMessage = ref(false) const durationInMS = ref(0) const isEdited = ref(false) -const durationType = ref(column?.meta?.duration || 0) +const durationType = ref(column?.value?.meta?.duration || 0) const durationPlaceholder = computed(() => durationOptions[durationType.value].title) const localState = computed({ diff --git a/packages/nc-gui-v2/components/cell/Email.vue b/packages/nc-gui-v2/components/cell/Email.vue index 33407812bd..ab10f0aebb 100644 --- a/packages/nc-gui-v2/components/cell/Email.vue +++ b/packages/nc-gui-v2/components/cell/Email.vue @@ -25,7 +25,7 @@ const focus = (el: HTMLInputElement) => el?.focus() diff --git a/packages/nc-gui-v2/components/cell/Integer.vue b/packages/nc-gui-v2/components/cell/Integer.vue index 38691d0fa2..f62ef8e345 100644 --- a/packages/nc-gui-v2/components/cell/Integer.vue +++ b/packages/nc-gui-v2/components/cell/Integer.vue @@ -32,6 +32,7 @@ function onKeyDown(evt: KeyboardEvent) { v-model="vModel" class="outline-none pa-0 border-none w-full h-full prose-sm" type="number" + @blur="editEnabled = false" @keydown="onKeyDown" /> {{ vModel }} diff --git a/packages/nc-gui-v2/components/cell/JsonEditableCell.vue b/packages/nc-gui-v2/components/cell/JsonEditableCell.vue index acf815fc54..f92bd346ca 100644 --- a/packages/nc-gui-v2/components/cell/JsonEditableCell.vue +++ b/packages/nc-gui-v2/components/cell/JsonEditableCell.vue @@ -4,7 +4,7 @@ import { computed, inject } from '#imports' import { EditModeInj } from '~/context' interface Props { - modelValue: string | Record + modelValue: string | Record | null isForm: boolean } diff --git a/packages/nc-gui-v2/components/cell/MultiSelect.vue b/packages/nc-gui-v2/components/cell/MultiSelect.vue index fffc9f347c..f43f62fc8f 100644 --- a/packages/nc-gui-v2/components/cell/MultiSelect.vue +++ b/packages/nc-gui-v2/components/cell/MultiSelect.vue @@ -3,7 +3,7 @@ import { computed, inject } from '#imports' import { ColumnInj, EditModeInj } from '~/context' interface Props { - modelValue: string + modelValue: string | null } const { modelValue } = defineProps() @@ -14,7 +14,7 @@ const column = inject(ColumnInj) const isForm = inject('isForm', false) const editEnabled = inject(EditModeInj, ref(false)) -const options = computed(() => column?.dtxp?.split(',').map((v) => v.replace(/\\'/g, "'").replace(/^'|'$/g, '')) || []) +const options = computed(() => column?.value?.dtxp?.split(',').map((v) => v.replace(/\\'/g, "'").replace(/^'|'$/g, '')) || []) const localState = computed({ get() { diff --git a/packages/nc-gui-v2/components/cell/Percent.vue b/packages/nc-gui-v2/components/cell/Percent.vue index dde455185c..4b25a11f50 100644 --- a/packages/nc-gui-v2/components/cell/Percent.vue +++ b/packages/nc-gui-v2/components/cell/Percent.vue @@ -4,7 +4,7 @@ import { ColumnInj } from '~/context' import { getPercentStep, isValidPercent, renderPercent } from '@/utils/percentUtils' interface Props { - modelValue: number | string + modelValue: number | string | null } const { modelValue } = defineProps() @@ -17,7 +17,7 @@ const percent = ref() const isEdited = ref(false) -const percentType = computed(() => column?.meta?.precision || 0) +const percentType = computed(() => column?.value?.meta?.precision || 0) const percentStep = computed(() => getPercentStep(percentType.value)) @@ -27,7 +27,7 @@ const localState = computed({ }, set: (val) => { if (val === null) val = 0 - if (isValidPercent(val, column?.meta?.negative)) { + if (isValidPercent(val, column?.value?.meta?.negative)) { percent.value = val / 100 } }, diff --git a/packages/nc-gui-v2/components/cell/Rating.vue b/packages/nc-gui-v2/components/cell/Rating.vue index 08bce5f227..cc23e23db1 100644 --- a/packages/nc-gui-v2/components/cell/Rating.vue +++ b/packages/nc-gui-v2/components/cell/Rating.vue @@ -8,7 +8,7 @@ import MdiThumbUpIcon from '~icons/mdi/thumb-up' import MdiFlagIcon from '~icons/mdi/flag' interface Props { - modelValue?: number + modelValue?: number | null readOnly?: boolean } @@ -26,7 +26,7 @@ const ratingMeta = computed(() => { }, color: '#fcb401', max: 5, - ...(column?.meta || {}), + ...(column?.value?.meta || {}), } }) diff --git a/packages/nc-gui-v2/components/cell/SingleSelect.vue b/packages/nc-gui-v2/components/cell/SingleSelect.vue index 66570ef61c..2511d3404a 100644 --- a/packages/nc-gui-v2/components/cell/SingleSelect.vue +++ b/packages/nc-gui-v2/components/cell/SingleSelect.vue @@ -3,7 +3,7 @@ import { computed, inject } from '#imports' import { ColumnInj, EditModeInj } from '~/context' interface Props { - modelValue: string + modelValue: string | null } const { modelValue } = defineProps() @@ -19,7 +19,7 @@ const vModel = computed({ set: (val) => emit('update:modelValue', val), }) -const options = computed(() => column?.dtxp?.split(',').map((v) => v.replace(/\\'/g, "'").replace(/^'|'$/g, '')) || []) +const options = computed(() => column?.value?.dtxp?.split(',').map((v) => v.replace(/\\'/g, "'").replace(/^'|'$/g, '')) || []) diff --git a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue index cff836c888..03160906da 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue @@ -1,10 +1,11 @@