Browse Source

feat(gui-v2): add optional required symbol

pull/3030/head
Wing-Kam Wong 2 years ago
parent
commit
2b87b3ce48
  1. 8
      packages/nc-gui-v2/components/smartsheet-header/Cell.vue
  2. 10
      packages/nc-gui-v2/components/smartsheet-header/VirtualCell.vue

8
packages/nc-gui-v2/components/smartsheet-header/Cell.vue

@ -5,7 +5,12 @@ import { inject } from 'vue'
import { ColumnInj, IsFormInj, MetaInj } from '~/context'
import { useProvideColumnCreateStore } from '#imports'
const { column } = defineProps<{ column: ColumnType & { meta: any } }>()
interface Props {
required?: boolean
column: ColumnType & { meta: any }
}
const { column, required } = defineProps<Props>()
const meta = inject(MetaInj)
@ -21,6 +26,7 @@ useProvideColumnCreateStore(meta as Ref<TableType>, column)
<div class="flex align-center w-full">
<SmartsheetHeaderCellIcon v-if="column" />
<span v-if="column" class="name" style="white-space: nowrap" :title="column.title">{{ column.title }}</span>
<span v-if="(column.rqd && !column.cdf) || required" class="text-red-500">&nbsp;*</span>
<div class="flex-1" />
<SmartsheetHeaderMenu v-if="!isForm" />

10
packages/nc-gui-v2/components/smartsheet-header/VirtualCell.vue

@ -4,7 +4,13 @@ import { inject } from 'vue'
import { ColumnInj, IsFormInj } from '~/context'
import { provide } from '#imports'
const { column } = defineProps<{ column: ColumnType & { meta: any } }>()
interface Props {
required?: boolean
column: ColumnType & { meta: any }
}
const { column, required } = defineProps<Props>()
provide(ColumnInj, column)
const isForm = inject(IsFormInj)
@ -143,7 +149,7 @@ const isForm = inject(IsFormInj)
-->
<SmartsheetHeaderVirtualCellIcon v-if="column" />
<span class="name" style="white-space: nowrap" :title="column.title"> {{ column.title }}</span>
<span v-if="column.rqd" class="error--text text--lighten-1">&nbsp;*</span>
<span v-if="column.rqd || required" class="text-red-500">&nbsp;*</span>
<!-- <span class="caption" v-html="tooltipMsg" /> -->

Loading…
Cancel
Save