From 047bd02ea4f2a7f565ddfb5da9d1c0685d18e08e Mon Sep 17 00:00:00 2001
From: Nathan-SR <144961007+Nathan-SR@users.noreply.github.com>
Date: Sat, 7 Dec 2024 01:32:44 -0500
Subject: work started on field interface --> inheritcance structure

---
 .../nodes/DataVizBox/DocCreatorMenu/Template.tsx     | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

(limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx')

diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx
index 94ef1d212..add588046 100644
--- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx
+++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.tsx
@@ -1,6 +1,6 @@
 
-import { makeAutoObservable } from "mobx";
-import { Doc, FieldType } from "../../../../../fields/Doc";
+import { makeAutoObservable, reaction } from "mobx";
+import { Doc, DocListCast, FieldType } from "../../../../../fields/Doc";
 import { Docs } from "../../../../documents/Documents";
 import { Col } from "./DocCreatorMenu";
 import { DynamicField } from "./FieldTypes/DynamicField";
@@ -8,32 +8,24 @@ import { Field, FieldSettings, ViewType } from "./FieldTypes/Field";
 import {  } from "./FieldTypes/FieldUtils";
 import { } from "./FieldTypes/StaticField";
 import { observer } from "mobx-react";
+import { IDisposer } from "mobx-utils";
 
 export class Template {
 
-    mainField: DynamicField;
-    settings: FieldSettings;
-    
+    private mainField: DynamicField;
+    private settings: FieldSettings;
 
     constructor(templateInfo: FieldSettings) {
         makeAutoObservable(this);
         this.mainField = this.setupMainField(templateInfo);
         this.settings = templateInfo;
-
     }
 
-
-
     get childFields(): Field[] { return this.mainField.getSubfields };
     get allFields(): Field[] { return this.mainField.getAllSubfields };
     get contentFields(): Field[] { return this.allFields.filter(field => field.getViewType === ViewType.STATIC) };
     get doc(){ return this.mainField.renderedDoc(); };
 
-    // addField = (type: FieldType, doc?: Doc): Field => {
-        
-    //     this.mainField.addField();
-    // }
-
     cloneBase = () => {
         const clone: Template = new Template(this.settings);
         clone.allFields.forEach(field => {
@@ -44,7 +36,7 @@ export class Template {
     }
 
     getRenderedDoc = () => {
-        const doc: Doc = this.mainField.renderedDoc();
+        const doc: Doc = this.doc;
         this.contentFields.forEach(field => {
             const title: string = field.getTitle();
             const val: FieldType = field.getContent() as FieldType;
-- 
cgit v1.2.3-70-g09d2

