mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 23:53:57 +00:00
SYNC: uniqied form and grid search in columns
This commit is contained in:
committed by
Diflow
parent
4812519a4c
commit
9b860a6aa6
@@ -29,7 +29,6 @@ export interface GridConfig extends GridConfigColumns {
|
|||||||
isFormView?: boolean;
|
isFormView?: boolean;
|
||||||
formViewRecordNumber?: number;
|
formViewRecordNumber?: number;
|
||||||
formFilterColumns: string[];
|
formFilterColumns: string[];
|
||||||
formColumnFilterText?: string;
|
|
||||||
multiColumnFilter?: string;
|
multiColumnFilter?: string;
|
||||||
searchInColumns?: string;
|
searchInColumns?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -459,7 +459,7 @@
|
|||||||
setConfig(x => ({
|
setConfig(x => ({
|
||||||
...x,
|
...x,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
formColumnFilterText: (x.formColumnFilterText || '') + event.key,
|
searchInColumns: (x.searchInColumns || '') + event.key,
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -473,7 +473,7 @@
|
|||||||
if (event.keyCode == keycodes.escape) {
|
if (event.keyCode == keycodes.escape) {
|
||||||
setConfig(x => ({
|
setConfig(x => ({
|
||||||
...x,
|
...x,
|
||||||
formColumnFilterText: '',
|
searchInColumns: '',
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -541,7 +541,7 @@
|
|||||||
columnIndex = incrementFunc(columnIndex);
|
columnIndex = incrementFunc(columnIndex);
|
||||||
while (
|
while (
|
||||||
isInRange(columnIndex) &&
|
isInRange(columnIndex) &&
|
||||||
!filterName(display.config.formColumnFilterText, display.formColumns[columnIndex].columnName)
|
!filterName(display.config.searchInColumns, display.formColumns[columnIndex].columnName)
|
||||||
) {
|
) {
|
||||||
columnIndex = incrementFunc(columnIndex);
|
columnIndex = incrementFunc(columnIndex);
|
||||||
}
|
}
|
||||||
@@ -549,7 +549,7 @@
|
|||||||
columnIndex = firstInRange;
|
columnIndex = firstInRange;
|
||||||
while (
|
while (
|
||||||
isInRange(columnIndex) &&
|
isInRange(columnIndex) &&
|
||||||
!filterName(display.config.formColumnFilterText, display.formColumns[columnIndex].columnName)
|
!filterName(display.config.searchInColumns, display.formColumns[columnIndex].columnName)
|
||||||
) {
|
) {
|
||||||
columnIndex = incrementFunc(columnIndex);
|
columnIndex = incrementFunc(columnIndex);
|
||||||
}
|
}
|
||||||
@@ -572,7 +572,7 @@
|
|||||||
case keycodes.rightArrow:
|
case keycodes.rightArrow:
|
||||||
return moveCurrentCell(currentCell[0], currentCell[1] + 1);
|
return moveCurrentCell(currentCell[0], currentCell[1] + 1);
|
||||||
case keycodes.upArrow:
|
case keycodes.upArrow:
|
||||||
if (currentCell[1] % 2 == 0 && display.config.formColumnFilterText) {
|
if (currentCell[1] % 2 == 0 && display.config.searchInColumns) {
|
||||||
return findFilteredColumn(
|
return findFilteredColumn(
|
||||||
x => x - 1,
|
x => x - 1,
|
||||||
x => x >= 0,
|
x => x >= 0,
|
||||||
@@ -583,7 +583,7 @@
|
|||||||
|
|
||||||
return moveCurrentCell(currentCell[0] - 1, currentCell[1]);
|
return moveCurrentCell(currentCell[0] - 1, currentCell[1]);
|
||||||
case keycodes.downArrow:
|
case keycodes.downArrow:
|
||||||
if (currentCell[1] % 2 == 0 && display.config.formColumnFilterText) {
|
if (currentCell[1] % 2 == 0 && display.config.searchInColumns) {
|
||||||
return findFilteredColumn(
|
return findFilteredColumn(
|
||||||
x => x + 1,
|
x => x + 1,
|
||||||
x => x < display.formColumns.length,
|
x => x < display.formColumns.length,
|
||||||
@@ -631,8 +631,8 @@
|
|||||||
data-row={rowIndex}
|
data-row={rowIndex}
|
||||||
data-col={chunkIndex * 2}
|
data-col={chunkIndex * 2}
|
||||||
style={rowHeight > 1 ? `height: ${rowHeight}px` : undefined}
|
style={rowHeight > 1 ? `height: ${rowHeight}px` : undefined}
|
||||||
class:columnFiltered={display.config.formColumnFilterText &&
|
class:columnFiltered={display.config.searchInColumns &&
|
||||||
filterName(display.config.formColumnFilterText, col.columnName)}
|
filterName(display.config.searchInColumns, col.columnName)}
|
||||||
class:isSelected={currentCell[0] == rowIndex && currentCell[1] == chunkIndex * 2}
|
class:isSelected={currentCell[0] == rowIndex && currentCell[1] == chunkIndex * 2}
|
||||||
bind:this={domCells[`${rowIndex},${chunkIndex * 2}`]}
|
bind:this={domCells[`${rowIndex},${chunkIndex * 2}`]}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -39,12 +39,12 @@
|
|||||||
<div class="flex">
|
<div class="flex">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
value={display?.config?.formColumnFilterText || ''}
|
value={display?.config?.searchInColumns || ''}
|
||||||
on:keydown={e => {
|
on:keydown={e => {
|
||||||
if (e.keyCode == keycodes.escape) {
|
if (e.keyCode == keycodes.escape) {
|
||||||
setConfig(x => ({
|
setConfig(x => ({
|
||||||
...x,
|
...x,
|
||||||
formColumnFilterText: '',
|
searchInColumns: '',
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
setConfig(x => ({
|
setConfig(x => ({
|
||||||
...x,
|
...x,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
formColumnFilterText: e.target.value,
|
searchInColumns: e.target.value,
|
||||||
}))}
|
}))}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user