diff --git a/packages/nc-gui-v2/components/cell/Float.vue b/packages/nc-gui-v2/components/cell/Float.vue index 56e12d0657..009f556a5c 100644 --- a/packages/nc-gui-v2/components/cell/Float.vue +++ b/packages/nc-gui-v2/components/cell/Float.vue @@ -5,18 +5,19 @@ interface Props { modelValue: number } -const { modelValue: value } = defineProps() +interface Emits { + (event: 'update:modelValue', model: number): void +} + +const props = defineProps() -const emit = defineEmits(['update:modelValue']) +const emits = defineEmits() const editEnabled = inject('editEnabled') const root = ref() -const localState = computed({ - get: () => value, - set: (val) => emit('update:modelValue', val), -}) +const vModel = useVModel(props, 'modelValue', emits) onMounted(() => { root.value?.focus() @@ -24,15 +25,8 @@ onMounted(() => { - + diff --git a/packages/nc-gui-v2/components/cell/Integer.vue b/packages/nc-gui-v2/components/cell/Integer.vue index 5cea217783..6798ff348c 100644 --- a/packages/nc-gui-v2/components/cell/Integer.vue +++ b/packages/nc-gui-v2/components/cell/Integer.vue @@ -3,34 +3,32 @@ interface Props { modelValue: number } -const { modelValue: value } = defineProps() +interface Emits { + (event: 'update:modelValue', model: number): void +} + +const props = defineProps() -const emit = defineEmits(['update:modelValue']) +const emits = defineEmits() const editEnabled = inject('editEnabled') const root = ref() -const localState = computed({ - get: () => value, - set: (val) => emit('update:modelValue', val), -}) +const vModel = useVModel(props, 'modelValue', emits) onMounted(() => { root.value?.focus() }) + +function onKeyDown(evt: KeyboardEvent) { + return evt.key === '.' && evt.preventDefault() +} - + diff --git a/packages/nc-gui-v2/components/smartsheet-header/CellIcon.vue b/packages/nc-gui-v2/components/smartsheet-header/CellIcon.vue index b5c69c0508..45551d4d47 100644 --- a/packages/nc-gui-v2/components/smartsheet-header/CellIcon.vue +++ b/packages/nc-gui-v2/components/smartsheet-header/CellIcon.vue @@ -14,6 +14,7 @@ import DatetimeIcon from '~icons/mdi/calendar-clock' import DateIcon from '~icons/mdi/calendar' import RatingIcon from '~icons/mdi/star' import GenericIcon from '~icons/mdi/square-rounded' +import NumericIcon from '~icons/mdi/numeric' import AttachmentIcon from '~icons/mdi/image-multiple-outline' import URLIcon from '~icons/mdi/link' import EmailIcon from '~icons/mdi/email' @@ -49,6 +50,8 @@ const icon = computed(() => { return RatingIcon } else if (additionalColMeta.isAttachment) { return AttachmentIcon + } else if (additionalColMeta.isInt || additionalColMeta.isFloat) { + return NumericIcon } // else if(additionalColMeta.isForeignKey) { // return FKIcon diff --git a/packages/nc-gui-v2/components/smartsheet/Cell.vue b/packages/nc-gui-v2/components/smartsheet/Cell.vue index 781209c7b6..119501e22d 100644 --- a/packages/nc-gui-v2/components/smartsheet/Cell.vue +++ b/packages/nc-gui-v2/components/smartsheet/Cell.vue @@ -41,6 +41,8 @@ const { isAttachment, isTextArea, isString, + isInt, + isFloat, isSingleSelect, isMultiSelect, isPercent, @@ -78,20 +80,6 @@ todo : - - - - - - - - - - - - - - @@ -199,6 +187,8 @@ todo : /> --> + +