aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-25 01:14:06 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-25 01:14:06 -0400
commit6a3d0cc899020710d5b9aabe164649c686467024 (patch)
tree196723923cb95764a5f174309d7e890f052aa402 /src/client/views/collections/collectionSchema/SchemaTableCell.tsx
parent227a289e49019ad1e9f634b098bb564bd4a8e743 (diff)
progress on refSelect (single click to add cell to equation)
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaTableCell.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaTableCell.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
index aa8401502..75b31315e 100644
--- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
@@ -64,7 +64,7 @@ export interface SchemaTableCellProps {
highlightCells: (text: string) => void;
equationHighlightRef: ObservableMap<HTMLDivElement, string>;
func: (text: string) => HTMLDivElement[] | [];
-
+ refSelectModeInfo: {enabled: boolean, currEditing: SchemaCellField | undefined};
}
function selectedCell(props: SchemaTableCellProps) {
@@ -78,7 +78,7 @@ function selectedCell(props: SchemaTableCellProps) {
@observer
export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellProps> {
- @observable _highlighted: boolean = false;
+ // private _fieldRef: SchemaCellField | null = null;
constructor(props: SchemaTableCellProps) {
super(props);
@@ -143,6 +143,11 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro
const pointerEvents: 'all' | 'none' = !readOnly && isRowActive() ? 'all' : 'none';
return { color, textDecoration, fieldProps, cursor, pointerEvents };
}
+
+ // @action
+ // appendTextToField = (text: string) => {
+ // this._fieldRef?.appendText(text);
+ // }
adjustSelfReference = (field: string) => {
const modField = field.replace(/\bthis.\b/g, `d${this.docIndex}.`);
@@ -180,6 +185,8 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro
pointerEvents: this.lockedInteraction ? 'none' : pointerEvents,
}}>
<SchemaCellField
+ fieldKey={this._props.fieldKey}
+ refSelectModeInfo={this._props.refSelectModeInfo}
Document={this._props.Document}
highlightCells={(text: string) => this._props.highlightCells(this.adjustSelfReference(text))}
getCells={(text: string) => this._props.func(this.adjustSelfReference(text))}