|
|
@ -65,129 +65,131 @@ defineExpose({ |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="nc-grid-wrapper"> |
|
|
|
<div class="flex flex-col h-100 min-h-0 w-100"> |
|
|
|
<table class="xc-row-table nc-grid backgroundColorDefault"> |
|
|
|
<div class="nc-grid-wrapper min-h-0 flex-1 scrollbar-thin-primary"> |
|
|
|
<thead> |
|
|
|
<table class="xc-row-table nc-grid backgroundColorDefault"> |
|
|
|
<tr> |
|
|
|
<thead> |
|
|
|
<th>#</th> |
|
|
|
<tr> |
|
|
|
<th v-for="col in fields" :key="col.title"> |
|
|
|
<th>#</th> |
|
|
|
<SmartsheetHeaderVirtualCell v-if="isVirtualCol(col)" :column="col" /> |
|
|
|
<th v-for="col in fields" :key="col.title"> |
|
|
|
<SmartsheetHeaderCell v-else :column="col" /> |
|
|
|
<SmartsheetHeaderVirtualCell v-if="isVirtualCol(col)" :column="col" /> |
|
|
|
</th> |
|
|
|
<SmartsheetHeaderCell v-else :column="col" /> |
|
|
|
</tr> |
|
|
|
</th> |
|
|
|
</thead> |
|
|
|
</tr> |
|
|
|
<tbody> |
|
|
|
</thead> |
|
|
|
<tr v-for="({ row }, rowIndex) in data" :key="rowIndex" class="nc-grid-row"> |
|
|
|
<tbody> |
|
|
|
<td key="row-index" style="width: 65px" class="caption nc-grid-cell"> |
|
|
|
<tr v-for="({ row }, rowIndex) in data" :key="rowIndex" class="nc-grid-row"> |
|
|
|
<div class="d-flex align-center"> |
|
|
|
<td key="row-index" style="width: 65px" class="caption nc-grid-cell"> |
|
|
|
{{ rowIndex + 1 }} |
|
|
|
<div class="d-flex align-center"> |
|
|
|
</div> |
|
|
|
{{ rowIndex + 1 }} |
|
|
|
</td> |
|
|
|
</div> |
|
|
|
<td |
|
|
|
</td> |
|
|
|
v-for="(columnObj, colIndex) in fields" |
|
|
|
<td |
|
|
|
:key="rowIndex + columnObj.title" |
|
|
|
v-for="(columnObj, colIndex) in fields" |
|
|
|
class="cell pointer nc-grid-cell" |
|
|
|
:key="rowIndex + columnObj.title" |
|
|
|
:class="{ |
|
|
|
class="cell pointer nc-grid-cell" |
|
|
|
active: !isPublicView && selected.col === colIndex && selected.row === rowIndex, |
|
|
|
:class="{ |
|
|
|
// 'primary-column': primaryValueColumn === columnObj.title, |
|
|
|
active: !isPublicView && selected.col === colIndex && selected.row === rowIndex, |
|
|
|
// 'text-center': isCentrallyAligned(columnObj), |
|
|
|
// 'primary-column': primaryValueColumn === columnObj.title, |
|
|
|
// 'required': isRequired(columnObj, rowObj), |
|
|
|
// 'text-center': isCentrallyAligned(columnObj), |
|
|
|
}" |
|
|
|
// 'required': isRequired(columnObj, rowObj), |
|
|
|
:data-col="columnObj.title" |
|
|
|
}" |
|
|
|
@click="selectCell(rowIndex, colIndex)" |
|
|
|
:data-col="columnObj.title" |
|
|
|
@dblclick="editEnabled = true" |
|
|
|
@click="selectCell(rowIndex, colIndex)" |
|
|
|
> |
|
|
|
@dblclick="editEnabled = true" |
|
|
|
<!-- @contextmenu=" --> |
|
|
|
> |
|
|
|
<!-- showRowContextMenu($event, rowObj, rowMeta, row, col, columnObj) --> |
|
|
|
<!-- @contextmenu=" --> |
|
|
|
<!-- " --> |
|
|
|
<!-- showRowContextMenu($event, rowObj, rowMeta, row, col, columnObj) --> |
|
|
|
<!-- > --> |
|
|
|
<!-- " --> |
|
|
|
<!-- <virtual-cell --> |
|
|
|
<!-- > --> |
|
|
|
<!-- v-if="isVirtualCol(columnObj)" --> |
|
|
|
<!-- <virtual-cell --> |
|
|
|
<!-- :password="password" --> |
|
|
|
<!-- v-if="isVirtualCol(columnObj)" --> |
|
|
|
<!-- :is-public="isPublicView" --> |
|
|
|
<!-- :password="password" --> |
|
|
|
<!-- :metas="metas" --> |
|
|
|
<!-- :is-public="isPublicView" --> |
|
|
|
<!-- :is-locked="isLocked" --> |
|
|
|
<!-- :metas="metas" --> |
|
|
|
<!-- :column="columnObj" --> |
|
|
|
<!-- :is-locked="isLocked" --> |
|
|
|
<!-- :row="rowObj" --> |
|
|
|
<!-- :column="columnObj" --> |
|
|
|
<!-- :nodes="nodes" --> |
|
|
|
<!-- :row="rowObj" --> |
|
|
|
<!-- :meta="meta" --> |
|
|
|
<!-- :nodes="nodes" --> |
|
|
|
<!-- :api="api" --> |
|
|
|
<!-- :meta="meta" --> |
|
|
|
<!-- :active="selected.col === col && selected.row === row" --> |
|
|
|
<!-- :api="api" --> |
|
|
|
<!-- :sql-ui="sqlUi" --> |
|
|
|
<!-- :active="selected.col === col && selected.row === row" --> |
|
|
|
<!-- :is-new="rowMeta.new" --> |
|
|
|
<!-- :sql-ui="sqlUi" --> |
|
|
|
<!-- v-on="$listeners" --> |
|
|
|
<!-- :is-new="rowMeta.new" --> |
|
|
|
<!-- @updateCol=" --> |
|
|
|
<!-- v-on="$listeners" --> |
|
|
|
<!-- (...args) => --> |
|
|
|
<!-- @updateCol=" --> |
|
|
|
<!-- updateCol( --> |
|
|
|
<!-- (...args) => --> |
|
|
|
<!-- ...args, --> |
|
|
|
<!-- updateCol( --> |
|
|
|
<!-- columnObj.bt --> |
|
|
|
<!-- ...args, --> |
|
|
|
<!-- && meta.columns.find( --> |
|
|
|
<!-- columnObj.bt --> |
|
|
|
<!-- (c) => c.column_name === columnObj.bt.column_name, --> |
|
|
|
<!-- && meta.columns.find( --> |
|
|
|
<!-- ), --> |
|
|
|
<!-- (c) => c.column_name === columnObj.bt.column_name, --> |
|
|
|
<!-- col, --> |
|
|
|
<!-- ), --> |
|
|
|
<!-- row, --> |
|
|
|
<!-- col, --> |
|
|
|
<!-- ) --> |
|
|
|
<!-- row, --> |
|
|
|
<!-- " --> |
|
|
|
<!-- ) --> |
|
|
|
<!-- @saveRow="onCellValueChange(col, row, columnObj, true)" --> |
|
|
|
<!-- " --> |
|
|
|
<!-- /> --> |
|
|
|
<!-- @saveRow="onCellValueChange(col, row, columnObj, true)" --> |
|
|
|
|
|
|
|
<!-- /> --> |
|
|
|
<!-- <editable-cell --> |
|
|
|
|
|
|
|
<!-- v-else-if=" --> |
|
|
|
<!-- <editable-cell --> |
|
|
|
<!-- ((isPkAvail || rowMeta.new) --> |
|
|
|
<!-- v-else-if=" --> |
|
|
|
<!-- && !isView --> |
|
|
|
<!-- ((isPkAvail || rowMeta.new) --> |
|
|
|
<!-- && !isLocked --> |
|
|
|
<!-- && !isView --> |
|
|
|
<!-- && !isPublicView --> |
|
|
|
<!-- && !isLocked --> |
|
|
|
<!-- && editEnabled.col === col --> |
|
|
|
<!-- && !isPublicView --> |
|
|
|
<!-- && editEnabled.row === row) --> |
|
|
|
<!-- && editEnabled.col === col --> |
|
|
|
<!-- || enableEditable(columnObj) --> |
|
|
|
<!-- && editEnabled.row === row) --> |
|
|
|
<!-- " --> |
|
|
|
<!-- || enableEditable(columnObj) --> |
|
|
|
<!-- v-model="rowObj[columnObj.title]" --> |
|
|
|
<!-- " --> |
|
|
|
<!-- :column="columnObj" --> |
|
|
|
<!-- v-model="rowObj[columnObj.title]" --> |
|
|
|
<!-- :meta="meta" --> |
|
|
|
<!-- :column="columnObj" --> |
|
|
|
<!-- :active="selected.col === col && selected.row === row" --> |
|
|
|
<!-- :meta="meta" --> |
|
|
|
<!-- :sql-ui="sqlUi" --> |
|
|
|
<!-- :active="selected.col === col && selected.row === row" --> |
|
|
|
<!-- :db-alias="nodes.dbAlias" --> |
|
|
|
<!-- :sql-ui="sqlUi" --> |
|
|
|
<!-- :is-locked="isLocked" --> |
|
|
|
<!-- :db-alias="nodes.dbAlias" --> |
|
|
|
<!-- :is-public="isPublicView" --> |
|
|
|
<!-- :is-locked="isLocked" --> |
|
|
|
<!-- :view-id="viewId" --> |
|
|
|
<!-- :is-public="isPublicView" --> |
|
|
|
<!-- @save="editEnabled = {}; onCellValueChange(col, row, columnObj, true);" --> |
|
|
|
<!-- :view-id="viewId" --> |
|
|
|
<!-- @cancel="editEnabled = {}" --> |
|
|
|
<!-- @save="editEnabled = {}; onCellValueChange(col, row, columnObj, true);" --> |
|
|
|
<!-- @update="onCellValueChange(col, row, columnObj, false)" --> |
|
|
|
<!-- @cancel="editEnabled = {}" --> |
|
|
|
<!-- @blur="onCellValueChange(col, row, columnObj, true)" --> |
|
|
|
<!-- @update="onCellValueChange(col, row, columnObj, false)" --> |
|
|
|
<!-- @input="unsaved = true" --> |
|
|
|
<!-- @blur="onCellValueChange(col, row, columnObj, true)" --> |
|
|
|
<!-- @navigateToNext="navigateToNext" --> |
|
|
|
<!-- @input="unsaved = true" --> |
|
|
|
<!-- @navigateToPrev="navigateToPrev" --> |
|
|
|
<!-- @navigateToNext="navigateToNext" --> |
|
|
|
<!-- /> --> |
|
|
|
<!-- @navigateToPrev="navigateToPrev" --> |
|
|
|
|
|
|
|
<!-- /> --> |
|
|
|
<SmartsheetVirtualCell v-if="isVirtualCol(columnObj)" v-model="row[columnObj.title]" :column="columnObj" /> |
|
|
|
|
|
|
|
|
|
|
|
<SmartsheetVirtualCell v-if="isVirtualCol(columnObj)" v-model="row[columnObj.title]" :column="columnObj" /> |
|
|
|
<SmartsheetCell |
|
|
|
|
|
|
|
v-else |
|
|
|
<SmartsheetCell |
|
|
|
v-model="row[columnObj.title]" |
|
|
|
v-else |
|
|
|
:column="columnObj" |
|
|
|
v-model="row[columnObj.title]" |
|
|
|
:edit-enabled="editEnabled && selected.col === colIndex && selected.row === rowIndex" |
|
|
|
:column="columnObj" |
|
|
|
@update:model-value="updateRowProperty(row, columnObj.title)" |
|
|
|
:edit-enabled="editEnabled && selected.col === colIndex && selected.row === rowIndex" |
|
|
|
/> |
|
|
|
@update:model-value="updateRowProperty(row, columnObj.title)" |
|
|
|
|
|
|
|
/> |
|
|
|
<!-- <SmartsheetCell v-else :column="columnObj" :value="row[columnObj.title]" /> --> |
|
|
|
|
|
|
|
<!-- :selected="selected.col === col && selected.row === row" --> |
|
|
|
<!-- <SmartsheetCell v-else :column="columnObj" :value="row[columnObj.title]" /> --> |
|
|
|
<!-- :is-locked="isLocked" --> |
|
|
|
<!-- :selected="selected.col === col && selected.row === row" --> |
|
|
|
<!-- :column="columnObj" --> |
|
|
|
<!-- :is-locked="isLocked" --> |
|
|
|
<!-- :meta="meta" --> |
|
|
|
<!-- :column="columnObj" --> |
|
|
|
<!-- :db-alias="nodes.dbAlias" --> |
|
|
|
<!-- :meta="meta" --> |
|
|
|
<!-- :value="rowObj[columnObj.title]" --> |
|
|
|
<!-- :db-alias="nodes.dbAlias" --> |
|
|
|
<!-- :sql-ui="sqlUi" --> |
|
|
|
<!-- :value="rowObj[columnObj.title]" --> |
|
|
|
<!-- @enableedit=" --> |
|
|
|
<!-- :sql-ui="sqlUi" --> |
|
|
|
<!-- makeSelected(col, row); --> |
|
|
|
<!-- @enableedit=" --> |
|
|
|
<!-- makeEditable(col, row, columnObj.ai, rowMeta); --> |
|
|
|
<!-- makeSelected(col, row); --> |
|
|
|
<!-- " --> |
|
|
|
<!-- makeEditable(col, row, columnObj.ai, rowMeta); --> |
|
|
|
<!-- /> --> |
|
|
|
<!-- " --> |
|
|
|
</td> |
|
|
|
<!-- /> --> |
|
|
|
</tr> |
|
|
|
</td> |
|
|
|
</tbody> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
</tbody> |
|
|
|
|
|
|
|
</table> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<SmartsheetPagination /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<SmartsheetPagination /> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
<style scoped lang="scss"> |
|
|
|