diff options
| author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-03-19 00:56:01 -0400 |
|---|---|---|
| committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-03-19 00:56:01 -0400 |
| commit | be5c28d20f4c3af1a20b03fe8e93c8fd551e99e6 (patch) | |
| tree | 5f3b6760db734e56236dae2ced89e9e78512d179 /src/client/views/collections/collectionSchema/SchemaTableCell.tsx | |
| parent | fdf02e0b421f98512378b21a6435c87da92ecd30 (diff) | |
multiple cell selection started
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaTableCell.tsx')
| -rw-r--r-- | src/client/views/collections/collectionSchema/SchemaTableCell.tsx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx index 46867665d..85b3158a8 100644 --- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx +++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx @@ -36,7 +36,7 @@ export interface SchemaTableCellProps { col: number; deselectCell: () => void; selectCell: (doc: Doc, col: number) => void; - selectedCell: () => [Doc, number] | undefined; + selectedCell: () => [Doc[], number] | undefined; fieldKey: string; maxWidth?: () => number; columnWidth: () => number; @@ -107,8 +107,8 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro } @computed get selected() { - const selected: [Doc, number] | undefined = this._props.selectedCell(); - return this._props.isRowActive() && selected?.[0] === this._props.Document && selected[1] === this._props.col; + const selected = this._props.selectedCell(); + return this._props.isRowActive() && (selected && selected[0]?.filter(doc => doc === this._props.Document).length !== 0) && selected[1] === this._props.col; } @computed get defaultCellContent() { @@ -309,8 +309,9 @@ export class SchemaRTFCell extends ObservableReactComponent<SchemaTableCellProps } @computed get selected() { - const selected: [Doc, number] | undefined = this._props.selectedCell(); - return this._props.isRowActive() && selected?.[0] === this._props.Document && selected[1] === this._props.col; + const selected = this._props.selectedCell(); + 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?.[0] === this._props.Document && selected[1] === this._props.col; } selectedFunc = () => this.selected; render() { @@ -331,8 +332,8 @@ export class SchemaBoolCell extends ObservableReactComponent<SchemaTableCellProp } @computed get selected() { - const selected: [Doc, number] | undefined = this._props.selectedCell(); - return this._props.isRowActive() && selected?.[0] === this._props.Document && selected[1] === this._props.col; + const selected = this._props.selectedCell(); + return this._props.isRowActive() && (selected && selected[0]?.filter(doc => doc === this._props.Document).length !== 0) && selected[1] === this._props.col; } render() { const { color, textDecoration, fieldProps, cursor, pointerEvents } = SchemaTableCell.renderProps(this._props); @@ -375,8 +376,8 @@ export class SchemaEnumerationCell extends ObservableReactComponent<SchemaTableC } @computed get selected() { - const selected: [Doc, number] | undefined = this._props.selectedCell(); - return this._props.isRowActive() && selected?.[0] === this._props.Document && selected[1] === this._props.col; + const selected = this._props.selectedCell(); + return this._props.isRowActive() && (selected && selected[0]?.filter(doc => doc === this._props.Document).length !== 0) && selected[1] === this._props.col; } render() { const { color, textDecoration, fieldProps, cursor, pointerEvents } = SchemaTableCell.renderProps(this._props); |
