aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FieldView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-01-11 11:33:46 -0500
committerbobzel <zzzman@gmail.com>2021-01-11 11:33:46 -0500
commit6c1857193aa51ccfec081aaa4372de164e152355 (patch)
tree8ae584d0c0a262df63153fec097f32ab9ef80441 /src/client/views/nodes/FieldView.tsx
parent768ab508529ab2b7f43a44592e5dc2c9f15a68a5 (diff)
parente80e0e3938f1f7c5f740553eb5cb7b152f2598e8 (diff)
Merge branch 'master' into ink_edits
Diffstat (limited to 'src/client/views/nodes/FieldView.tsx')
-rw-r--r--src/client/views/nodes/FieldView.tsx63
1 files changed, 12 insertions, 51 deletions
diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx
index 79947c023..1b4119210 100644
--- a/src/client/views/nodes/FieldView.tsx
+++ b/src/client/views/nodes/FieldView.tsx
@@ -2,75 +2,36 @@ import React = require("react");
import { computed } from "mobx";
import { observer } from "mobx-react";
import { DateField } from "../../../fields/DateField";
-import { Doc, FieldResult, Opt, Field } from "../../../fields/Doc";
+import { Doc, Field, FieldResult, Opt } from "../../../fields/Doc";
import { List } from "../../../fields/List";
-import { ScriptField } from "../../../fields/ScriptField";
-import { AudioField, VideoField, WebField } from "../../../fields/URLField";
-import { Transform } from "../../util/Transform";
-import { CollectionView } from "../collections/CollectionView";
-import { AudioBox } from "./AudioBox";
+import { VideoField, WebField } from "../../../fields/URLField";
+import { DocumentViewSharedProps } from "./DocumentView";
import { VideoBox } from "./VideoBox";
-import { dropActionType } from "../../util/DragManager";
-import { DocAfterFocusFunc, DocFocusFunc } from "./DocumentView";
//
// these properties get assigned through the render() method of the DocumentView when it creates this node.
// However, that only happens because the properties are "defined" in the markup for the field view.
// See the LayoutString method on each field view : ImageBox, FormattedTextBox, etc.
//
-export interface FieldViewProps {
+export interface FieldViewProps extends DocumentViewSharedProps {
+ // FieldView specific props that are not part of DocumentView props
fieldKey: string;
- fitToBox?: boolean;
- ContainingCollectionView: Opt<CollectionView>;
- ContainingCollectionDoc: Opt<Doc>;
- Document: Doc;
- DataDoc?: Doc;
- LibraryPath: Doc[];
- onClick?: () => ScriptField;
- dropAction: dropActionType;
- backgroundHalo?: () => boolean;
- docFilters: () => string[];
- docRangeFilters: () => string[];
- searchFilterDocs: () => Doc[];
- isSelected: (outsideReaction?: boolean) => boolean;
- select: (isCtrlPressed: boolean) => void;
- rootSelected: (outsideReaction?: boolean) => boolean;
- renderDepth: number;
- addDocument?: (document: Doc | Doc[]) => boolean;
- addDocTab: (document: Doc, where: string) => boolean;
- pinToPres: (document: Doc) => void;
- removeDocument?: (document: Doc | Doc[]) => boolean;
- moveDocument?: (document: Doc | Doc[], targetCollection: Doc | undefined, addDocument: (document: Doc | Doc[]) => boolean) => boolean;
- backgroundColor?: (document: Opt<Doc>, renderDepth: number) => string | undefined;
- ScreenToLocalTransform: () => Transform;
- bringToFront: (doc: Doc, sendToBack?: boolean) => void;
+ overflow?: boolean; // bcz: would like to think this can be avoided -- need to look at further
+
active: (outsideReaction?: boolean) => boolean;
- whenActiveChanged: (isActive: boolean) => void;
- LayoutTemplateString?: string;
- dontRegisterView?: boolean;
- focus: DocFocusFunc;
- presMultiSelect?: (doc: Doc) => void; //added for selecting multiple documents in a presentation
- ignoreAutoHeight?: boolean;
- PanelWidth: () => number;
- PanelHeight: () => number;
- PanelPosition?: string;
- overflow?: boolean;
- NativeHeight?: () => number;
- NativeWidth?: () => number;
- setVideoBox?: (player: VideoBox) => void;
- ContentScaling: () => number;
- ChromeHeight?: () => number;
- childLayoutTemplate?: () => Opt<Doc>;
+ select: (isCtrlPressed: boolean) => void;
+ isSelected: (outsideReaction?: boolean) => boolean;
+ scaling?: () => number;
+
// properties intended to be used from within layout strings (otherwise use the function equivalents that work more efficiently with React)
- fontSize?: number;
pointerEvents?: string;
+ fontSize?: number;
height?: number;
width?: number;
background?: string;
color?: string;
xMargin?: number;
yMargin?: number;
- scriptContext?: any;
}
@observer