aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocComponent.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-01-22 21:45:28 -0500
committerbobzel <zzzman@gmail.com>2024-01-22 21:45:28 -0500
commit001127c07f95173d7036db19d07dcfb1135f3caa (patch)
tree6489446110038835536f1916791cfe6faa793bc3 /src/client/views/DocComponent.tsx
parent953a298b49c2345741fd7989f9b62cadd76eea52 (diff)
fixed schema rows to render, fix for resizing docs from left side. all locking docs in non freeform view. fix for labelBox with multiple rows to keep top rows. cleaned up docViewPath/containerViewPath &
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r--src/client/views/DocComponent.tsx20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx
index 4400b3576..6aba4a042 100644
--- a/src/client/views/DocComponent.tsx
+++ b/src/client/views/DocComponent.tsx
@@ -1,6 +1,6 @@
import { action, computed, makeObservable, observable } from 'mobx';
import * as React from 'react';
-import { emptyPath, returnFalse } from '../../Utils';
+import { returnFalse } from '../../Utils';
import { DateField } from '../../fields/DateField';
import { Doc, DocListCast, Opt } from '../../fields/Doc';
import { AclAdmin, AclAugment, AclEdit, AclPrivate, AclReadonly, DocData } from '../../fields/DocSymbols';
@@ -41,7 +41,7 @@ export function DocComponent<P extends DocComponentProps>() {
}
// This is the data part of a document -- ie, the data that is constant across all views of the document
@computed get dataDoc() {
- return this._props.Document[DocData] as Doc;
+ return this._props.Document[DocData];
}
}
return Component;
@@ -55,16 +55,12 @@ export interface ViewBoxBaseProps {
Document: Doc;
TemplateDataDocument?: Doc;
DocumentView?: () => DocumentView;
- containerViewPath?: () => DocumentView[];
fieldKey: string;
isSelected: () => boolean;
isContentActive: () => boolean | undefined;
ScreenToLocalTransform: () => Transform;
renderDepth: number;
}
-function returnEmptyDocViewList() {
- return [] as DocumentView[];
-}
export function ViewBoxBaseComponent<P extends ViewBoxBaseProps>() {
class Component extends ObservableReactComponent<React.PropsWithChildren<P>> {
ScreenToLocalBoxXf = () => this._props.ScreenToLocalTransform();
@@ -72,12 +68,6 @@ export function ViewBoxBaseComponent<P extends ViewBoxBaseProps>() {
get DocumentView() {
return this._props.DocumentView;
}
- get docViewPath() {
- return this.DocumentView?.().docViewPath ?? returnEmptyDocViewList;
- }
- get containerViewPath() {
- return this._props.containerViewPath;
- }
//TODO This might be pretty inefficient if doc isn't observed, because computed doesn't cache then
get Document() {
return this._props.Document;
@@ -132,12 +122,6 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps>()
get DocumentView() {
return this._props.DocumentView;
}
- get docViewPath() {
- return this.DocumentView?.().docViewPath ?? returnEmptyDocViewList;
- }
- get containerViewPath() {
- return this.DocumentView?.().containerViewPath ?? returnEmptyDocViewList;
- }
//TODO This might be pretty inefficient if doc isn't observed, because computed doesn't cache then
@computed get Document() {
return this._props.Document;