From dec235231875333100d3c63e62bdca808153ed5b Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 10 Mar 2021 12:08:26 -0500 Subject: tweaks to sliderBox range to prevent it from not appearing, or not having draggable ends. --- src/client/views/nodes/FilterBox.tsx | 2 +- src/client/views/nodes/SliderBox.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/FilterBox.tsx b/src/client/views/nodes/FilterBox.tsx index 003b3adbe..34986e87a 100644 --- a/src/client/views/nodes/FilterBox.tsx +++ b/src/client/views/nodes/FilterBox.tsx @@ -143,7 +143,7 @@ export class FilterBox extends ViewBoxBaseComponent Date: Wed, 10 Mar 2021 14:11:08 -0500 Subject: finally completed the process of moving DashDocView into a React compoment in DashDocView from RichTextSchema --- .../views/nodes/formattedText/DashDocView.tsx | 343 ++++++++------------- .../views/nodes/formattedText/FormattedTextBox.tsx | 65 ++-- .../views/nodes/formattedText/RichTextSchema.tsx | 1 - src/client/views/nodes/formattedText/nodes_rts.ts | 1 - 4 files changed, 168 insertions(+), 242 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/formattedText/DashDocView.tsx b/src/client/views/nodes/formattedText/DashDocView.tsx index 91d123efe..86a9f4347 100644 --- a/src/client/views/nodes/formattedText/DashDocView.tsx +++ b/src/client/views/nodes/formattedText/DashDocView.tsx @@ -1,7 +1,6 @@ -import { IReactionDisposer, reaction } from "mobx"; +import { IReactionDisposer, reaction, observable, action } from "mobx"; import { NodeSelection } from "prosemirror-state"; import { Doc, HeightSym, WidthSym } from "../../../../fields/Doc"; -import { Id } from "../../../../fields/FieldSymbols"; import { Cast, StrCast } from "../../../../fields/Types"; import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnEmptyString, returnFalse, Utils } from "../../../../Utils"; import { DocServer } from "../../../DocServer"; @@ -11,250 +10,182 @@ import { Transform } from "../../../util/Transform"; import { DocumentView } from "../DocumentView"; import { FormattedTextBox } from "./FormattedTextBox"; import React = require("react"); +import * as ReactDOM from 'react-dom'; +import { observer } from "mobx-react"; + +export class DashDocView { + _fieldWrapper: HTMLSpanElement; // container for label and value + + constructor(node: any, view: any, getPos: any, tbox: FormattedTextBox) { + this._fieldWrapper = document.createElement("span"); + this._fieldWrapper.style.position = "relative"; + this._fieldWrapper.style.textIndent = "0"; + this._fieldWrapper.style.border = "1px solid " + StrCast(tbox.layoutDoc.color, (CurrentUserUtils.ActiveDashboard.darkScheme ? "dimGray" : "lightGray")); + this._fieldWrapper.style.width = node.attrs.width; + this._fieldWrapper.style.height = node.attrs.height; + this._fieldWrapper.style.display = node.attrs.hidden ? "none" : "inline-block"; + (this._fieldWrapper.style as any).float = node.attrs.float; + this._fieldWrapper.onkeypress = function (e: any) { e.stopPropagation(); }; + this._fieldWrapper.onkeydown = function (e: any) { e.stopPropagation(); }; + this._fieldWrapper.onkeyup = function (e: any) { e.stopPropagation(); }; + this._fieldWrapper.onmousedown = function (e: any) { e.stopPropagation(); }; + + ReactDOM.render(