mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 04:36:00 +00:00
data grid - no rows info
This commit is contained in:
@@ -483,6 +483,7 @@
|
|||||||
let domFocusField;
|
let domFocusField;
|
||||||
let domHorizontalScroll;
|
let domHorizontalScroll;
|
||||||
let domVerticalScroll;
|
let domVerticalScroll;
|
||||||
|
let domContainer;
|
||||||
|
|
||||||
let currentCell = topLeftCell;
|
let currentCell = topLeftCell;
|
||||||
let selectedCells = [topLeftCell];
|
let selectedCells = [topLeftCell];
|
||||||
@@ -596,6 +597,7 @@
|
|||||||
selectedCells = [cell];
|
selectedCells = [cell];
|
||||||
await tick();
|
await tick();
|
||||||
scrollIntoView(cell);
|
scrollIntoView(cell);
|
||||||
|
domFocusField?.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function cloneRows() {
|
export async function cloneRows() {
|
||||||
@@ -1838,11 +1840,11 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{:else if isDynamicStructure && isLoadedAll && grider?.rowCount == 0}
|
{:else if isDynamicStructure && isLoadedAll && grider?.rowCount == 0}
|
||||||
<div>
|
<div class="ml-2">
|
||||||
<ErrorInfo
|
<ErrorInfo
|
||||||
alignTop
|
alignTop
|
||||||
message={grider.editable
|
message={grider.editable
|
||||||
? 'No rows loaded, check filter or add new documents. You could copy documents from ohter collections/tables with Copy advanved/Copy as JSON command.'
|
? 'No rows loaded, check filter or add new documents. You could copy documents from other collections/tables with Copy advanved/Copy as JSON command.'
|
||||||
: 'No rows loaded'}
|
: 'No rows loaded'}
|
||||||
/>
|
/>
|
||||||
{#if display.filterCount > 0}
|
{#if display.filterCount > 0}
|
||||||
@@ -1867,9 +1869,15 @@
|
|||||||
class:data-grid-focused={isGridFocused}
|
class:data-grid-focused={isGridFocused}
|
||||||
bind:clientWidth={containerWidth}
|
bind:clientWidth={containerWidth}
|
||||||
bind:clientHeight={containerHeight}
|
bind:clientHeight={containerHeight}
|
||||||
|
bind:this={domContainer}
|
||||||
use:contextMenu={buildMenu}
|
use:contextMenu={buildMenu}
|
||||||
use:contextMenuActivator={activator}
|
use:contextMenuActivator={activator}
|
||||||
on:wheel={handleGridWheel}
|
on:wheel={handleGridWheel}
|
||||||
|
on:click={e => {
|
||||||
|
if (e.target == domContainer) {
|
||||||
|
domFocusField?.focus();
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
@@ -2014,6 +2022,24 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
{#if !isDynamicStructure && isLoadedAll && grider?.rowCount == 0}
|
||||||
|
<div class="no-rows-info ml-2">
|
||||||
|
<div class="mb-3">
|
||||||
|
<ErrorInfo alignTop message="No rows loaded" icon="img info" />
|
||||||
|
</div>
|
||||||
|
{#if display.filterCount > 0}
|
||||||
|
<FormStyledButton value="Reset filter" on:click={() => display.clearFilters()} />
|
||||||
|
{/if}
|
||||||
|
{#if grider.editable}
|
||||||
|
<FormStyledButton value="Add row" on:click={insertNewRow} />
|
||||||
|
{/if}
|
||||||
|
{#if onOpenQuery}
|
||||||
|
<FormStyledButton value="Open Query" on:click={onOpenQuery} />
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<HorizontalScrollBar
|
<HorizontalScrollBar
|
||||||
minimum={0}
|
minimum={0}
|
||||||
maximum={maxScrollColumn}
|
maximum={maxScrollColumn}
|
||||||
@@ -2092,4 +2118,8 @@
|
|||||||
right: 40px;
|
right: 40px;
|
||||||
bottom: 20px;
|
bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.no-rows-info {
|
||||||
|
margin-top: 60px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user