|
|
@ -208,115 +208,117 @@ const onNavigate = (dir: NavigateDir) => { |
|
|
|
<a-dropdown v-model:visible="contextMenu" :trigger="['contextmenu']"> |
|
|
|
<a-dropdown v-model:visible="contextMenu" :trigger="['contextmenu']"> |
|
|
|
<table class="xc-row-table nc-grid backgroundColorDefault" @contextmenu.prevent="contextMenu = true"> |
|
|
|
<table class="xc-row-table nc-grid backgroundColorDefault" @contextmenu.prevent="contextMenu = true"> |
|
|
|
<thead> |
|
|
|
<thead> |
|
|
|
<tr class="group"> |
|
|
|
<tr class="group"> |
|
|
|
<th> |
|
|
|
<th> |
|
|
|
<div class="flex align-center w-[80px]"> |
|
|
|
<div class="flex align-center w-[80px]"> |
|
|
|
<div class="group-hover:hidden" :class="{ hidden: selectedAllRecords }">#</div> |
|
|
|
<div class="group-hover:hidden" :class="{ hidden: selectedAllRecords }">#</div> |
|
|
|
<div |
|
|
|
<div |
|
|
|
:class="{ hidden: !selectedAllRecords, flex: selectedAllRecords }" |
|
|
|
:class="{ hidden: !selectedAllRecords, flex: selectedAllRecords }" |
|
|
|
class="group-hover:flex w-full align-center" |
|
|
|
class="group-hover:flex w-full align-center" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-checkbox v-model:checked="selectedAllRecords" /> |
|
|
|
<a-checkbox v-model:checked="selectedAllRecords" /> |
|
|
|
<span class="flex-1" /> |
|
|
|
<span class="flex-1" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
<th |
|
|
|
<th |
|
|
|
v-for="col in fields" |
|
|
|
v-for="col in fields" |
|
|
|
:key="col.title" |
|
|
|
:key="col.title" |
|
|
|
v-xc-ver-resize |
|
|
|
v-xc-ver-resize |
|
|
|
:data-col="col.id" |
|
|
|
:data-col="col.id" |
|
|
|
@xcresize="onresize(col.id, $event)" |
|
|
|
@xcresize="onresize(col.id, $event)" |
|
|
|
@xcresizing="onXcResizing(col.title, $event)" |
|
|
|
@xcresizing="onXcResizing(col.title, $event)" |
|
|
|
@xcresized="resizingCol = null" |
|
|
|
@xcresized="resizingCol = null" |
|
|
|
> |
|
|
|
> |
|
|
|
<SmartsheetHeaderVirtualCell v-if="isVirtualCol(col)" :column="col" /> |
|
|
|
<SmartsheetHeaderVirtualCell v-if="isVirtualCol(col)" :column="col" /> |
|
|
|
<SmartsheetHeaderCell v-else :column="col" /> |
|
|
|
<SmartsheetHeaderCell v-else :column="col" /> |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
<!-- v-if="!isLocked && !isVirtual && !isPublicView && _isUIAllowed('add-column')" --> |
|
|
|
<!-- v-if="!isLocked && !isVirtual && !isPublicView && _isUIAllowed('add-column')" --> |
|
|
|
<th v-t="['c:column:add']" @click="addColumnDropdown = true"> |
|
|
|
<th v-t="['c:column:add']" @click="addColumnDropdown = true"> |
|
|
|
<a-dropdown v-model:visible="addColumnDropdown" :trigger="['click']"> |
|
|
|
<a-dropdown v-model:visible="addColumnDropdown" :trigger="['click']"> |
|
|
|
<div class="h-full w-full flex align-center justify-center"> |
|
|
|
<div class="h-full w-full flex align-center justify-center"> |
|
|
|
<MdiPlusIcon class="text-sm" /> |
|
|
|
<MdiPlusIcon class="text-sm" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
|
<SmartsheetColumnEditOrAdd @click.stop @cancel="addColumnDropdown = false" /> |
|
|
|
<SmartsheetColumnEditOrAdd @click.stop @cancel="addColumnDropdown = false" /> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</a-dropdown> |
|
|
|
</a-dropdown> |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
|
|
|
|
</thead> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tbody> |
|
|
|
<tr v-for="(row, rowIndex) in data" :key="rowIndex" class="nc-grid-row group"> |
|
|
|
<tr v-for="(row, rowIndex) in data" :key="rowIndex" class="nc-grid-row group"> |
|
|
|
<td key="row-index" class="caption nc-grid-cell"> |
|
|
|
<td key="row-index" class="caption nc-grid-cell"> |
|
|
|
<div class="align-center flex w-[80px]"> |
|
|
|
<div class="align-center flex w-[80px]"> |
|
|
|
<div class="group-hover:hidden" :class="{ hidden: row.rowMeta.selected }">{{ rowIndex + 1 }}</div> |
|
|
|
<div class="group-hover:hidden" :class="{ hidden: row.rowMeta.selected }">{{ rowIndex + 1 }}</div> |
|
|
|
<div |
|
|
|
<div |
|
|
|
:class="{ hidden: !row.rowMeta.selected, flex: row.rowMeta.selected }" |
|
|
|
:class="{ hidden: !row.rowMeta.selected, flex: row.rowMeta.selected }" |
|
|
|
class="group-hover:flex w-full align-center" |
|
|
|
class="group-hover:flex w-full align-center" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-checkbox v-model:checked="row.rowMeta.selected" /> |
|
|
|
<a-checkbox v-model:checked="row.rowMeta.selected" /> |
|
|
|
<span class="flex-1" /> |
|
|
|
<span class="flex-1" /> |
|
|
|
<MdiArrowExpandIcon class="text-sm text-pink hidden group-hover:inline-block" /> |
|
|
|
<MdiArrowExpandIcon class="text-sm text-pink hidden group-hover:inline-block" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<td |
|
|
|
<td |
|
|
|
v-for="(columnObj, colIndex) in fields" |
|
|
|
v-for="(columnObj, colIndex) in fields" |
|
|
|
:key="rowIndex + columnObj.title" |
|
|
|
:key="rowIndex + columnObj.title" |
|
|
|
class="cell pointer nc-grid-cell" |
|
|
|
class="cell pointer nc-grid-cell" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
|
|
|
|
active: !isPublicView && selected.col === colIndex && selected.row === rowIndex, |
|
|
|
active: !isPublicView && selected.col === colIndex && selected.row === rowIndex, |
|
|
|
}" |
|
|
|
}" |
|
|
|
:data-col="columnObj.id" |
|
|
|
:data-col="columnObj.id" |
|
|
|
@click="selectCell(rowIndex, colIndex)" |
|
|
|
@click="selectCell(rowIndex, colIndex)" |
|
|
|
@dblclick="editEnabled = true" |
|
|
|
@dblclick="editEnabled = true" |
|
|
|
@contextmenu="contextMenuTarget = { row: rowIndex, col: colIndex }" |
|
|
|
@contextmenu="contextMenuTarget = { row: rowIndex, col: colIndex }" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="w-full h-full"> |
|
|
|
<div class="w-full h-full"> |
|
|
|
<SmartsheetVirtualCell v-if="isVirtualCol(columnObj)" v-model="row.row[columnObj.title]" |
|
|
|
<SmartsheetVirtualCell |
|
|
|
:column="columnObj" |
|
|
|
v-if="isVirtualCol(columnObj)" |
|
|
|
@navigate="onNavigate" |
|
|
|
v-model="row.row[columnObj.title]" |
|
|
|
/> |
|
|
|
:column="columnObj" |
|
|
|
|
|
|
|
@navigate="onNavigate" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<SmartsheetCell |
|
|
|
<SmartsheetCell |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
v-model="row.row[columnObj.title]" |
|
|
|
v-model="row.row[columnObj.title]" |
|
|
|
:column="columnObj" |
|
|
|
:column="columnObj" |
|
|
|
:edit-enabled="editEnabled && selected.col === colIndex && selected.row === rowIndex" |
|
|
|
:edit-enabled="editEnabled && selected.col === colIndex && selected.row === rowIndex" |
|
|
|
@save="updateOrSaveRow(row, columnObj.title)" |
|
|
|
@save="updateOrSaveRow(row, columnObj.title)" |
|
|
|
@navigate="onNavigate" |
|
|
|
@navigate="onNavigate" |
|
|
|
/> |
|
|
|
@cancel="editEnabled = false" |
|
|
|
</div> |
|
|
|
/> |
|
|
|
</td> |
|
|
|
</div> |
|
|
|
</tr> |
|
|
|
</td> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
|
|
|
|
<tr v-if="!isLocked"> |
|
|
|
<tr v-if="!isLocked"> |
|
|
|
<td |
|
|
|
<td |
|
|
|
v-t="['c:row:add:grid-bottom']" |
|
|
|
v-t="['c:row:add:grid-bottom']" |
|
|
|
:colspan="visibleColLength + 1" |
|
|
|
:colspan="visibleColLength + 1" |
|
|
|
class="text-left pointer nc-grid-add-new-cell" |
|
|
|
class="text-left pointer nc-grid-add-new-cell" |
|
|
|
@click="addEmptyRow()" |
|
|
|
@click="addEmptyRow()" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-tooltip top left> |
|
|
|
<a-tooltip top left> |
|
|
|
<div class="w-min flex align-center"> |
|
|
|
<div class="w-min flex align-center"> |
|
|
|
<MdiPlusIcon class="text-pint-500 text-xs" /> |
|
|
|
<MdiPlusIcon class="text-pint-500 text-xs" /> |
|
|
|
<span class="ml-1 caption grey--text"> |
|
|
|
<span class="ml-1 caption grey--text"> |
|
|
|
{{ $t('activity.addRow') }} |
|
|
|
{{ $t('activity.addRow') }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<template #title> |
|
|
|
<template #title> |
|
|
|
<span class="caption"> Add new row</span> |
|
|
|
<span class="caption"> Add new row</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</a-tooltip> |
|
|
|
</a-tooltip> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
|
<div class="bg-white shadow" @click="contextMenu = false"> |
|
|
|
<div class="bg-white shadow" @click="contextMenu = false"> |
|
|
|
<div v-if="contextMenuTarget" class="nc-menu-item" @click="deleteRow(contextMenuTarget.row)">Delete row |
|
|
|
<div v-if="contextMenuTarget" class="nc-menu-item" @click="deleteRow(contextMenuTarget.row)">Delete row</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="nc-menu-item" @click="deleteSelectedRows">Delete all selected rows</div> |
|
|
|
<div class="nc-menu-item" @click="deleteSelectedRows">Delete all selected rows</div> |
|
|
|
<div v-if="contextMenuTarget" class="nc-menu-item" @click="clearCell(contextMenuTarget)">Clear cell</div> |
|
|
|
<div v-if="contextMenuTarget" class="nc-menu-item" @click="clearCell(contextMenuTarget)">Clear cell</div> |
|
|
|
<div v-if="contextMenuTarget" class="nc-menu-item" @click="addEmptyRow(contextMenuTarget.row + 1)"> |
|
|
|
<div v-if="contextMenuTarget" class="nc-menu-item" @click="addEmptyRow(contextMenuTarget.row + 1)"> |
|
|
|