Browse Source

refactor/gui-v2-added-phonenumber-cell

pull/2925/head
Muhammed Mustafa 2 years ago
parent
commit
31f3bddb34
  1. 31
      packages/nc-gui-v2/components/cell/PhoneNumber.vue
  2. 2
      packages/nc-gui-v2/components/smartsheet/Cell.vue
  3. 2
      packages/nc-gui-v2/composables/useColumn.ts

31
packages/nc-gui-v2/components/cell/PhoneNumber.vue

@ -0,0 +1,31 @@
<script setup lang="ts">
import Text from './Text.vue'
import { computed } from '#imports'
interface Props {
modelValue: any
}
const { modelValue: value } = defineProps<Props>()
const emit = defineEmits(['update:modelValue'])
const localState = computed({
get: () => value,
set: (val) => emit('update:modelValue', val),
})
</script>
<template>
<Text v-model="localState" />
</template>
<style scoped>
input,
textarea {
width: 100%;
height: 100%;
color: var(--v-textColor-base);
outline: none;
}
</style>

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

@ -46,6 +46,7 @@ const {
isSingleSelect,
isMultiSelect,
isPercent,
isPhoneNumber,
} = useColumn(column)
</script>
@ -183,6 +184,7 @@ todo :
<CellDuration v-else-if="isDuration" v-model="localState" />
<CellEmail v-else-if="isEmail" v-model="localState" />
<CellUrl v-else-if="isURL" v-model="localState" />
<CellPhoneNumber v-else-if="isPhoneNumber" v-model="localState" />
<!-- v-on="parentListeners"
/>
-->

2
packages/nc-gui-v2/composables/useColumn.ts

@ -30,6 +30,7 @@ export function useColumn(column: ColumnType) {
const isAttachment = uiDatatype === 'Attachment'
const isRating = uiDatatype === UITypes.Rating
const isCurrency = uiDatatype === 'Currency'
const isPhoneNumber = uiDatatype === 'PhoneNumber'
const isDuration = uiDatatype === UITypes.Duration
const isPercent = uiDatatype === UITypes.Percent
const isAutoSaved = [
@ -74,5 +75,6 @@ export function useColumn(column: ColumnType) {
isSingleSelect,
isMultiSelect,
isPercent,
isPhoneNumber,
}
}

Loading…
Cancel
Save