diff options
| author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-03-21 00:43:08 -0400 |
|---|---|---|
| committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-03-21 00:43:08 -0400 |
| commit | 9ccbc0a6d6f6fffbc479d37ac2a880eafe85c65d (patch) | |
| tree | 9eb60db4c05a7a79bf12a4bb31920b15f7689eac /src/client/views/collections/collectionSchema/SchemaTableCell.tsx | |
| parent | a598877cc71c1f2a25e8cac4b831ab947a2539e0 (diff) | |
multiple cell column switching working
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaTableCell.tsx')
| -rw-r--r-- | src/client/views/collections/collectionSchema/SchemaTableCell.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx index cae16be36..52c34e8d6 100644 --- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx +++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx @@ -36,7 +36,8 @@ export interface SchemaTableCellProps { col: number; deselectCell: () => void; selectCell: (doc: Doc, col: number, shift: boolean) => void; - selectedCells: () => [Doc[], number] | undefined; + selectedCells: () => Doc[] | undefined; + selectedCol: () => number; fieldKey: string; maxWidth?: () => number; columnWidth: () => number; @@ -108,9 +109,9 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro } @computed get selected() { - const selected: [Doc[], number] | undefined = this._props.selectedCells(); - let istrue = this._props.isRowActive() && (selected && selected[0]?.filter(doc => doc === this._props.Document).length !== 0) && selected[1] === this._props.col; - //console.log("col: " + this._props.col + "true: " + istrue); + const selected: Doc[] | undefined = this._props.selectedCells(); + let istrue = this._props.isRowActive() && (selected && selected?.filter(doc => doc === this._props.Document).length !== 0) && this._props.selectedCol() === this._props.col; + console.log("col: " + this._props.col + " selCol: " + this._props.selectedCol() + " true: " + istrue); return istrue; } @@ -320,7 +321,7 @@ export class SchemaRTFCell extends ObservableReactComponent<SchemaTableCellProps @computed get selected() { const selected = this._props.selectedCells(); - return this._props.isRowActive() && (selected && selected[0]?.filter(doc => doc === this._props.Document).length !== 0) && selected[1] === this._props.col; + return this._props.isRowActive() && (selected && selected?.filter(doc => doc === this._props.Document).length !== 0) && this._props.selectedCol() === this._props.col; //return this._props.isRowActive() && selected?.[0] === this._props.Document && selected[1] === this._props.col; } selectedFunc = () => this.selected; @@ -343,7 +344,7 @@ export class SchemaBoolCell extends ObservableReactComponent<SchemaTableCellProp @computed get selected() { const selected = this._props.selectedCells(); - return this._props.isRowActive() && (selected && selected[0]?.filter(doc => doc === this._props.Document).length !== 0) && selected[1] === this._props.col; + return this._props.isRowActive() && (selected && selected?.filter(doc => doc === this._props.Document).length !== 0) && this._props.selectedCol() === this._props.col; } render() { const { color, textDecoration, fieldProps, cursor, pointerEvents } = SchemaTableCell.renderProps(this._props); @@ -387,7 +388,7 @@ export class SchemaEnumerationCell extends ObservableReactComponent<SchemaTableC @computed get selected() { const selected = this._props.selectedCells(); - return this._props.isRowActive() && (selected && selected[0]?.filter(doc => doc === this._props.Document).length !== 0) && selected[1] === this._props.col; + return this._props.isRowActive() && (selected && selected?.filter(doc => doc === this._props.Document).length !== 0) && this._props.selectedCol() === this._props.col; } render() { const { color, textDecoration, fieldProps, cursor, pointerEvents } = SchemaTableCell.renderProps(this._props); |
