2020-07-10 19:51:36 +02:00
|
|
|
<template>
|
|
|
|
<BaseContextMenu
|
|
|
|
:context-event="contextEvent"
|
2020-08-12 18:11:48 +02:00
|
|
|
@close-context="closeContext"
|
2020-07-10 19:51:36 +02:00
|
|
|
>
|
2021-06-30 19:27:24 +02:00
|
|
|
<div v-if="selectedRows.length === 1" class="context-element">
|
2022-06-21 17:54:47 +02:00
|
|
|
<span class="d-flex"><i class="mdi mdi-18px mdi-content-copy text-light pr-1" /> {{ t('word.copy') }}</span>
|
2021-06-30 19:27:24 +02:00
|
|
|
<i class="mdi mdi-18px mdi-chevron-right text-light pl-1" />
|
|
|
|
<div class="context-submenu">
|
|
|
|
<div
|
|
|
|
v-if="selectedRows.length === 1"
|
|
|
|
class="context-element"
|
|
|
|
@click="copyCell"
|
|
|
|
>
|
|
|
|
<span class="d-flex">
|
2022-06-21 17:54:47 +02:00
|
|
|
<i class="mdi mdi-18px mdi-numeric-0 mdi-rotate-90 text-light pr-1" /> {{ t('word.cell', 1) }}
|
2021-06-30 19:27:24 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
v-if="selectedRows.length === 1"
|
|
|
|
class="context-element"
|
|
|
|
@click="copyRow"
|
|
|
|
>
|
|
|
|
<span class="d-flex">
|
2022-06-21 17:54:47 +02:00
|
|
|
<i class="mdi mdi-18px mdi-table-row text-light pr-1" /> {{ t('word.row', 1) }}
|
2021-06-30 19:27:24 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-28 21:45:38 +01:00
|
|
|
<div
|
2021-07-16 17:09:02 +02:00
|
|
|
v-if="selectedRows.length === 1 && selectedCell.isEditable"
|
2021-02-28 21:45:38 +01:00
|
|
|
class="context-element"
|
|
|
|
@click="setNull"
|
|
|
|
>
|
|
|
|
<span class="d-flex">
|
2022-06-21 17:54:47 +02:00
|
|
|
<i class="mdi mdi-18px mdi-null text-light pr-1" /> {{ t('message.setNull') }}
|
2021-02-28 21:45:38 +01:00
|
|
|
</span>
|
|
|
|
</div>
|
2021-07-16 17:09:02 +02:00
|
|
|
<div
|
|
|
|
v-if="selectedCell.isEditable"
|
|
|
|
class="context-element"
|
|
|
|
@click="showConfirmModal"
|
|
|
|
>
|
2021-02-28 21:45:38 +01:00
|
|
|
<span class="d-flex">
|
2022-06-21 17:54:47 +02:00
|
|
|
<i class="mdi mdi-18px mdi-delete text-light pr-1" /> {{ t('message.deleteRows', selectedRows.length) }}
|
2021-02-28 21:45:38 +01:00
|
|
|
</span>
|
2020-07-10 19:51:36 +02:00
|
|
|
</div>
|
|
|
|
</BaseContextMenu>
|
|
|
|
</template>
|
|
|
|
|
2022-06-21 17:54:47 +02:00
|
|
|
<script setup lang="ts">
|
|
|
|
import BaseContextMenu from '@/components/BaseContextMenu.vue';
|
|
|
|
import { useI18n } from 'vue-i18n';
|
2020-07-10 19:51:36 +02:00
|
|
|
|
2022-06-21 17:54:47 +02:00
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
|
|
defineProps({
|
|
|
|
contextEvent: MouseEvent,
|
|
|
|
selectedRows: Array,
|
|
|
|
selectedCell: Object
|
|
|
|
});
|
|
|
|
|
|
|
|
const emit = defineEmits(['show-delete-modal', 'close-context', 'set-null', 'copy-cell', 'copy-row']);
|
|
|
|
|
|
|
|
const showConfirmModal = () => {
|
|
|
|
emit('show-delete-modal');
|
|
|
|
};
|
|
|
|
|
|
|
|
const closeContext = () => {
|
|
|
|
emit('close-context');
|
|
|
|
};
|
|
|
|
|
|
|
|
const setNull = () => {
|
|
|
|
emit('set-null');
|
|
|
|
closeContext();
|
|
|
|
};
|
|
|
|
|
|
|
|
const copyCell = () => {
|
|
|
|
emit('copy-cell');
|
|
|
|
closeContext();
|
|
|
|
};
|
|
|
|
|
|
|
|
const copyRow = () => {
|
|
|
|
emit('copy-row');
|
|
|
|
closeContext();
|
2020-07-10 19:51:36 +02:00
|
|
|
};
|
|
|
|
</script>
|