From a3e34ebd705778e8bcc11f745087cff2bcafbcaf Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 14 Sep 2020 14:53:20 -0400 Subject: updated the custom text box to specify frontSize through document values. --- src/client/views/DocComponent.tsx | 2 +- src/client/views/nodes/FieldView.tsx | 1 + src/client/views/nodes/formattedText/DashFieldView.scss | 3 ++- src/client/views/nodes/formattedText/FormattedTextBox.tsx | 6 +++--- 4 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/client/views') diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index aa888b34a..ccfc37d4e 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -104,7 +104,7 @@ export function ViewBoxAnnotatableComponent

{ const style: { [key: string]: any } = {}; - const divKeys = ["width", "height", "background", "top", "position"]; + const divKeys = ["width", "height", "fontSize", "left", "background", "top", "position"]; const replacer = (match: any, expr: string, offset: any, string: any) => { // bcz: this executes a script to convert a property expression string: { script } into a value return ScriptField.MakeFunction(expr, { self: Doc.name, this: Doc.name, scale: "number" })?.script.run({ self: this.rootDoc, this: this.layoutDoc, scale }).result as string || ""; }; diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx index 4ec5bc534..0073ff77f 100644 --- a/src/client/views/nodes/FieldView.tsx +++ b/src/client/views/nodes/FieldView.tsx @@ -59,6 +59,7 @@ export interface FieldViewProps { ChromeHeight?: () => number; childLayoutTemplate?: () => Opt; // properties intended to be used from within layout strings (otherwise use the function equivalents that work more efficiently with React) + fontSize?: number; height?: number; width?: number; background?: string; diff --git a/src/client/views/nodes/formattedText/DashFieldView.scss b/src/client/views/nodes/formattedText/DashFieldView.scss index 23cf1e79b..09dfb349f 100644 --- a/src/client/views/nodes/formattedText/DashFieldView.scss +++ b/src/client/views/nodes/formattedText/DashFieldView.scss @@ -18,7 +18,7 @@ .dashFieldView-labelSpan { position: relative; display: inline-block; - font-size: small; + font-weight: normal; } .dashFieldView-fieldSpan { min-width: 20px; @@ -27,6 +27,7 @@ position: relative; display: inline; background-color: rgba(155, 155, 155, 0.24); + font-weight: bold; span { min-width: 100%; display: inline-block; diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 31d471571..c6b4775c9 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -1536,17 +1536,17 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp transformOrigin: "top left", width: `${100 / scale}%`, height: `calc(${100 / scale}% - ${this.props.ChromeHeight?.() || 0}px)`, - ...this.styleFromLayoutString(scale) + ...this.styleFromLayoutString(scale) // this converts any expressions in the format string to style props. e.g., }}>