Browse Source

feat(gui-v2): disable add row in form view

pull/3209/head
Wing-Kam Wong 2 years ago
parent
commit
41b392f3ff
  1. 14
      packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/AddRow.vue

14
packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/AddRow.vue

@ -1,14 +1,20 @@
<script setup lang="ts"> <script setup lang="ts">
const emits = defineEmits(['addRow']) const emits = defineEmits(['addRow'])
const { isOpen } = useSidebar({ storageKey: 'nc-right-sidebar' }) const { isOpen } = useSidebar({ storageKey: 'nc-right-sidebar' })
const isLocked = inject(IsLockedInj)
</script> </script>
<template> <template>
<a-tooltip :placement="isOpen ? 'bottomRight' : 'left'"> <a-tooltip :placement="isOpen ? 'bottomRight' : 'left'">
<template #title> {{ $t('activity.addRow') }} </template> <template #title> {{ $t('activity.addRow') }} </template>
<div
<div class="nc-sidebar-right-item hover:after:bg-primary/75 group nc-sidebar-add-row"> :class="{ 'hover:after:bg-primary/75 group': !isLocked, 'disabled-ring': isLocked }"
<MdiPlusOutline class="cursor-pointer group-hover:(!text-white)" @click="emits('addRow')" /> class="nc-sidebar-right-item nc-sidebar-add-row"
>
<MdiPlusOutline
:class="{ 'cursor-pointer group-hover:(!text-white)': !isLocked, 'disabled': isLocked }"
@click="!isLocked ? emits('addRow') : {}"
/>
</div> </div>
</a-tooltip> </a-tooltip>
</template> </template>
Loading…
Cancel
Save