aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-05-08 02:51:21 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-05-08 02:51:21 -0400
commit1a8a370f67c3076d1b47c3bd8c3929d65badcfeb (patch)
treec5453718d6b8cd60d53a8eb74e13c33d5c524c23 /src/client/views/nodes/DocumentView.tsx
parent921c3b95b22d5e4125435abb45cd322fc170ccb3 (diff)
parenta61d794b7018f0ac9723ce2d3b93547ba11f444b (diff)
Merge branch 'nathan-starter' of https://github.com/brown-dash/Dash-Web into nathan-starter
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 3191e04db..dc597e5ff 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -122,14 +122,14 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
animateScaleTime = () => this._animateScaleTime ?? 100;
style = (doc: Doc, sprop: StyleProp | string) => this._props.styleProvider?.(doc, this._props, sprop);
- @computed get layout_showTitle() { return this.style(this.layoutDoc, StyleProp.ShowTitle) as Opt<string>; } // prettier-ignore
+ @computed get showTitle() { return this.style(this.layoutDoc, StyleProp.ShowTitle) as Opt<string>; } // prettier-ignore
@computed get opacity() { return this.style(this.layoutDoc, StyleProp.Opacity); } // prettier-ignore
@computed get boxShadow() { return this.style(this.layoutDoc, StyleProp.BoxShadow); } // prettier-ignore
@computed get borderRounding() { return this.style(this.layoutDoc, StyleProp.BorderRounding); } // prettier-ignore
@computed get widgetDecorations() { return this.style(this.layoutDoc, StyleProp.Decorations); } // prettier-ignore
@computed get backgroundBoxColor() { return this.style(this.layoutDoc, StyleProp.BackgroundColor + ':box'); } // prettier-ignore
@computed get headerMargin() { return this.style(this.layoutDoc, StyleProp.HeaderMargin) ?? 0; } // prettier-ignore
- @computed get layout_showCaption() { return this.style(this.layoutDoc, StyleProp.ShowCaption) ?? 0; } // prettier-ignore
+ @computed get showCaption() { return this.style(this.layoutDoc, StyleProp.ShowCaption) ?? 0; } // prettier-ignore
@computed get titleHeight() { return this.style(this.layoutDoc, StyleProp.TitleHeight) ?? 0; } // prettier-ignore
@computed get docContents() { return this.style(this.Document, StyleProp.DocContents); } // prettier-ignore
@computed get highlighting() { return this.style(this.Document, StyleProp.Highlighting); } // prettier-ignore
@@ -762,7 +762,7 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
selectFunc={action((field: string | number) => {
if (this.layoutDoc.layout_showTitle) {
this.layoutDoc._layout_showTitle = field;
- } else if (!this._props.layout_showTitle) {
+ } else if (!this._props.showTitle) {
Doc.UserDoc().layout_showTitle = field;
}
this._changingTitleField = false;
@@ -776,8 +776,8 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
* setting layout_showTitle using the format: field1[:hover]
* */
@computed get titleView() {
- const showTitle = this.layout_showTitle?.split(':')[0];
- const showTitleHover = this.layout_showTitle?.includes(':hover');
+ const showTitle = this.showTitle?.split(':')[0];
+ const showTitleHover = this.showTitle?.includes(':hover');
const targetDoc = showTitle?.startsWith('_') ? this.layoutDoc : this.Document;
const background = StrCast(
@@ -835,7 +835,7 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
if (input?.startsWith('$')) {
if (this.layoutDoc.layout_showTitle) {
this.layoutDoc._layout_showTitle = input?.substring(1) ? input.substring(1) : undefined;
- } else if (!this._props.layout_showTitle) {
+ } else if (!this._props.showTitle) {
Doc.UserDoc().layout_showTitle = input?.substring(1) ? input.substring(1) : 'title';
}
} else if (showTitle && !showTitle.includes(';') && !showTitle.includes('Date') && showTitle !== 'author') {
@@ -850,7 +850,7 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
}
@computed get captionView() {
- return !this.layout_showCaption ? null : (
+ return !this.showCaption ? null : (
<div
className="documentView-captionWrapper"
style={{
@@ -862,7 +862,7 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
{...this._props}
yPadding={10}
xPadding={10}
- fieldKey={this.layout_showCaption}
+ fieldKey={this.showCaption}
styleProvider={this.captionStyleProvider}
dontRegisterView
rootSelected={this.rootSelected}
@@ -877,7 +877,7 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
renderDoc = (style: object) => {
TraceMobx();
- const showTitle = this.layout_showTitle?.split(':')[0];
+ const showTitle = this.showTitle?.split(':')[0];
return !DocCast(this.Document) || GetEffectiveAcl(this.dataDoc) === AclPrivate
? null
: this.docContents ?? (
@@ -895,7 +895,7 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
transform: this._animateScalingTo ? `scale(${this._animateScalingTo})` : undefined,
transition: !this._animateScalingTo ? this._props.DataTransition?.() : `transform ${this.animateScaleTime() / 1000}s ease-${this._animateScalingTo < 1 ? 'in' : 'out'}`,
}}>
- {this._props.hideTitle || (!showTitle && !this.layout_showCaption) ? (
+ {this._props.hideTitle || (!showTitle && !this.showCaption) ? (
this.viewBoxContents
) : (
<div className="documentView-styleWrapper">
@@ -1124,7 +1124,7 @@ export class DocumentView extends DocComponent<DocumentViewProps>() {
}
@computed get layout_fitWidth() {
- return this._props.layout_fitWidth?.(this.layoutDoc) ?? this.layoutDoc?.layout_fitWidth;
+ return this._props.fitWidth?.(this.layoutDoc) ?? this.layoutDoc?.layout_fitWidth;
}
@computed get anchorViewDoc() {
return this._props.LayoutTemplateString?.includes('link_anchor_2') ? DocCast(this.Document.link_anchor_2) : this._props.LayoutTemplateString?.includes('link_anchor_1') ? DocCast(this.Document.link_anchor_1) : undefined;
@@ -1319,8 +1319,6 @@ export class DocumentView extends DocComponent<DocumentViewProps>() {
screenToLocalScale = () => this._props.ScreenToLocalTransform().Scale;
isSelected = () => this.IsSelected;
select = (extendSelection: boolean, focusSelection?: boolean) => {
- // if (this.IsSelected && DocumentView.Selected().length > 1) DocumentView.DeselectView(this);
- // else {
DocumentView.SelectView(this, extendSelection);
if (focusSelection) {
DocumentView.showDocument(this.Document, {
@@ -1329,7 +1327,6 @@ export class DocumentView extends DocComponent<DocumentViewProps>() {
zoomTime: 500,
});
}
- //}
};
backgroundColor = () => this._docViewInternal?.backgroundBoxColor;
DataTransition = () => this._props.DataTransition?.() || StrCast(this.Document.dataTransition);
@@ -1415,7 +1412,7 @@ export class DocumentView extends DocComponent<DocumentViewProps>() {
NativeDimScaling={this.NativeDimScaling}
isSelected={this.isSelected}
select={this.select}
- layout_fitWidth={this.layout_fitWidthFunc}
+ fitWidth={this.layout_fitWidthFunc}
ScreenToLocalTransform={this.screenToContentsTransform}
focus={this._props.focus || emptyFunction}
ref={action((r: DocumentViewInternal | null) => {