Browse Source

feat(gui-v2): add nc-locked-overlay to cells for lock view

pull/3209/head
Wing-Kam Wong 2 years ago
parent
commit
9c891b642b
  1. 22
      packages/nc-gui-v2/components/smartsheet/Cell.vue

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

@ -1,7 +1,20 @@
<script setup lang="ts"> <script setup lang="ts">
import { UITypes } from 'nocodb-sdk' import { UITypes } from 'nocodb-sdk'
import type { ColumnType } from 'nocodb-sdk' import type { ColumnType } from 'nocodb-sdk'
import { ActiveCellInj, ColumnInj, EditModeInj, computed, provide, toRef, useColumn, useDebounceFn, useVModel } from '#imports' import {
ActiveCellInj,
ColumnInj,
EditModeInj,
IsFormInj,
IsLockedInj,
IsPublicInj,
computed,
provide,
toRef,
useColumn,
useDebounceFn,
useVModel,
} from '#imports'
import { NavigateDir } from '~/lib' import { NavigateDir } from '~/lib'
interface Props { interface Props {
@ -26,6 +39,12 @@ provide(EditModeInj, useVModel(props, 'editEnabled', emit))
provide(ActiveCellInj, active) provide(ActiveCellInj, active)
const isForm = inject(IsFormInj)
const isPublic = inject(IsPublicInj)
const isLocked = inject(IsLockedInj)
let changed = $ref(false) let changed = $ref(false)
const syncValue = useDebounceFn(function () { const syncValue = useDebounceFn(function () {
@ -142,5 +161,6 @@ const syncAndNavigate = (dir: NavigateDir) => {
<CellPercent v-else-if="isPercent" v-model="vModel" /> <CellPercent v-else-if="isPercent" v-model="vModel" />
<CellJson v-else-if="isJSON" v-model="vModel" /> <CellJson v-else-if="isJSON" v-model="vModel" />
<CellText v-else v-model="vModel" /> <CellText v-else v-model="vModel" />
<div v-if="(isLocked || (isPublic && !isForm)) && !isAttachment" class="nc-locked-overlay" @click.stop.prevent />
</div> </div>
</template> </template>

Loading…
Cancel
Save