Browse Source

feat: use readonly picker for created/updated time

pull/7304/head
Pranav C 10 months ago
parent
commit
1b46da8edf
  1. 15
      packages/nc-gui/components/cell/ReadOnlyDateTimePicker.vue
  2. 3
      packages/nc-gui/components/smartsheet/Cell.vue
  3. 2
      packages/nc-gui/components/smartsheet/header/Cell.vue

15
packages/nc-gui/components/cell/ReadOnlyDateTimePicker.vue

@ -0,0 +1,15 @@
<script setup lang="ts">
import { ReadonlyInj, provide, ref } from '#imports'
interface Props {
modelValue?: string | null
}
defineProps<Props>()
provide(ReadonlyInj, ref(true))
</script>
<template>
<CellDateTimePicker :model-value="modelValue" :is-pk="false" />
</template>

3
packages/nc-gui/components/smartsheet/Cell.vue

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { ColumnType } from 'nocodb-sdk'
import { isSystemColumn } from 'nocodb-sdk'
import { isCreatedTimeOrUpdatedTimeCol, isSystemColumn } from 'nocodb-sdk'
import {
ActiveCellInj,
ColumnInj,
@ -228,6 +228,7 @@ onUnmounted(() => {
:disable-option-creation="!!isEditColumnMenu"
:row-index="props.rowIndex"
/>
<LazyCellReadOnlyDateTimePicker v-else-if="isCreatedTimeOrUpdatedTimeCol(column)" :model-value="vModel" />
<LazyCellDatePicker v-else-if="isDate(column, abstractType)" v-model="vModel" :is-pk="isPrimaryKey(column)" />
<LazyCellYearPicker v-else-if="isYear(column, abstractType)" v-model="vModel" :is-pk="isPrimaryKey(column)" />
<LazyCellDateTimePicker

2
packages/nc-gui/components/smartsheet/header/Cell.vue

@ -1,3 +1,5 @@
<script setup lang="ts">
import type { ColumnReqType, ColumnType } from 'nocodb-sdk'
import { ColumnInj, IsExpandedFormOpenInj, IsFormInj, IsKanbanInj, inject, provide, ref, toRef, useRoles } from '#imports'

Loading…
Cancel
Save