From 664a8a3968ce1d3a4fe549613aae4e509c2409ec Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 17 Mar 2021 12:25:01 -0400 Subject: added autoHeight proeprtyButton. cleaned up stackingViewFieldColumn a bit --- .../collections/CollectionMasonryViewFieldRow.tsx | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/client/views/collections/CollectionMasonryViewFieldRow.tsx') diff --git a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx index 46bfd841e..581520619 100644 --- a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx +++ b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx @@ -25,10 +25,13 @@ export const Flyout = higflyout.default; interface CMVFieldRowProps { rows: () => number; headings: () => object[]; + Document: Doc; + chromeStatus: string; heading: string; headingObject: SchemaHeaderField | undefined; docList: Doc[]; parent: CollectionStackingView; + pivotField: string; type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | undefined; createDropTarget: (ele: HTMLDivElement) => void; screenToLocalTransform: () => Transform; @@ -90,7 +93,7 @@ export class CollectionMasonryViewFieldRow extends React.Component Doc.SetInPlace(d, key, castedValue, !onLayoutDoc)); @@ -110,7 +113,7 @@ export class CollectionMasonryViewFieldRow extends React.Component { this._createAliasSelected = false; - const key = StrCast(this.props.parent.props.Document._pivotField); + const key = this.props.pivotField; const castedValue = this.getValue(value); if (castedValue) { if (this.props.parent.columnHeaders) { @@ -143,7 +146,7 @@ export class CollectionMasonryViewFieldRow extends React.Component { if (!value && !forceEmptyNote) return false; this._createAliasSelected = false; - const key = StrCast(this.props.parent.props.Document._pivotField); + const key = this.props.pivotField; const newDoc = Docs.Create.TextDocument("", { _autoHeight: true, _width: 200, _fitWidth: true, title: value }); const onLayoutDoc = this.onLayoutDoc(key); FormattedTextBox.SelectOnLoad = newDoc[Id]; @@ -155,7 +158,7 @@ export class CollectionMasonryViewFieldRow extends React.Component { this._createAliasSelected = false; - const key = StrCast(this.props.parent.props.Document._pivotField); + const key = this.props.pivotField; this.props.docList.forEach(d => Doc.SetInPlace(d, key, undefined, true)); if (this.props.parent.columnHeaders && this.props.headingObject) { const index = this.props.parent.columnHeaders.indexOf(this.props.headingObject); @@ -171,8 +174,8 @@ export class CollectionMasonryViewFieldRow extends React.Component { - const alias = Doc.MakeAlias(this.props.parent.props.Document); - const key = StrCast(this.props.parent.props.Document._pivotField); + const alias = Doc.MakeAlias(this.props.Document); + const key = this.props.pivotField; let value = this.getValue(this.heading); value = typeof value === "string" ? `"${value}"` : value; const script = `return doc.${key} === ${value}`; @@ -187,7 +190,7 @@ export class CollectionMasonryViewFieldRow extends React.Component) => { if (e.button === 0 && !e.ctrlKey) { - setupMoveUpEvents(this, e, this.headerMove, emptyFunction, e => !this.props.parent.props.Document._chromeStatus && this.collapseSection(e)); + setupMoveUpEvents(this, e, this.headerMove, emptyFunction, e => !this.props.chromeStatus && this.collapseSection(e)); this._createAliasSelected = false; } } @@ -251,8 +254,7 @@ export class CollectionMasonryViewFieldRow extends React.Component evContents} @@ -295,7 +297,7 @@ export class CollectionMasonryViewFieldRow extends React.Component; - return this.props.parent.props.Document.miniHeaders ? + return this.props.Document.miniHeaders ?
{editableHeaderView}
: -- cgit v1.2.3-70-g09d2