diff --git a/src/common/DV.tsx b/src/common/DV.tsx
index 797796788..be3432d88 100644
--- a/src/common/DV.tsx
+++ b/src/common/DV.tsx
@@ -2,7 +2,7 @@ import {DocString, EdgeHead, ShortAttribETypes as SAType, U} from '../joiner';
import {GObject, RuntimeAccessible} from '../joiner';
import React, {ReactElement} from "react";
// const beautify = require('js-beautify').html; // BEWARE: this adds some newline that might be breaking and introduce syntax errors in our JSX parser
-const beautify = (s: any)=>s;
+const beautify = (s: string) => s;
let ShortAttribETypes: typeof SAType = (window as any).ShortAttribETypes;
@RuntimeAccessible
@@ -17,7 +17,6 @@ export class DV {
public static literalView(): string { return beautify(DefaultView.literal()); }
public static voidView(): string { return beautify(DefaultView.void()); }
public static operationView(): string { return beautify(DefaultView.operation()); }
- public static operationViewm1(): string { return beautify(DefaultView.operationm1()); }
public static objectView(): string { return beautify(DefaultView.object()); }
public static valueView(): string { return beautify(DefaultView.value()); }
public static defaultPackage(): string { return beautify(DefaultView.defaultPackage()); }
@@ -155,81 +154,74 @@ class DefaultView {
public static model(): string {
return `
- {!data && "Model data missing."}
-
{[
- true && data.suggestedEdges.reference &&
- data.suggestedEdges.reference.map(
- se => (!se.vertexOverlaps)
- && )
- ,
- true && data.suggestedEdges.extend &&
- data.suggestedEdges.extend.map(
- se => (!se.vertexOverlaps)
- && )]
- }
-
- {data && data.packages.map((pkg, index) => {
- return
- })}
- {data && data.allSubObjects.map((child, index) => {
- return
- })}
-
`;
+ {!data && "Model data missing."}
+ {[
+ true && data.suggestedEdges.reference &&
+ data.suggestedEdges.reference.map(
+ se => (!se.vertexOverlaps)
+ && )
+ ,
+ true && data.suggestedEdges.extend &&
+ data.suggestedEdges.extend.map(
+ se => (!se.vertexOverlaps)
+ && )]
+ }
+
+ {data && data.packages.map((pkg, index) => {
+ return
+ })}
+ {data && data.allSubObjects.map((child, index) => {
+ return
+ })}
+`;
}
public static void(): string {
return `
-
voidvertex element test
-
data: {props.data ? props.data.name : "empty"}
-
`;
+ voidvertex element test
+ data: {props.data ? props.data.name : "empty"}
+`;
}
public static package(): string {
return `
- { /*
EPackage:} field={'name'} hidden={true} />*/ }
- { /*console.log("evalcontex:", {thiss: this, pname: pname, c: _context}) && null*/ }
- {/*
{pname}:} field={'name'} hidden={true} />*/}
-
-
-
- {data.children.map((child, index) => {
- return
- })}
-
-
`;
+
+
+
+ {data.children.map((child, index) => {
+ return
+ })}
+
+`;
}
public static class(): string {
return `
-
EClass:}
- data={data.id} field={'name'} hidden={true} autosize={true} />
-
EClass:}
- data={data.id} field={'name'} hidden={true} autosize={true} />
-
- {/* i kept them separated because i want them in this order. i could have used data.children once, or put all in same container to mix them. */}
-
{ data.attributes.map(c => ) }
-
{ data.references.map(c => ) }
-
{ data.operations.map(c => ) }
-
`;
+ EClass:}
+ data={data.id} field={'name'} hidden={true} autosize={true} />
+
+ { data.attributes.map(c => ) }
+ { data.references.map(c => ) }
+ { data.operations.map(c => ) }
+`;
}
public static enum(): string {
return `
-
EEnum:}
- data={data.id} field={'name'} hidden={true} autosize={true} />
-
-
- {data.children.map((child, index) => {
- return
- })}
-
-
`;
+ EEnum:}
+ data={data.id} field={'name'} hidden={true} autosize={true} />
+
+
+ {data.children.map((child, index) => {
+ return
+ })}
+
+`;
}
public static feature(): string {
return `
-
-
`;
- return `
`;
+
+`;
}
public static literal(): string {
@@ -239,56 +231,40 @@ class DefaultView {
public static operation(): string {
// data.signature
return `
- '} />
-
`;
- return ` `;
- }
-
-
-
- public static operationm1(): string {
- return `
- {
{props.data.instanceof.name} }
-
→→→{
- `
+ '} />
+ `;
}
public static object(): string {
return `
-
- {data.instanceof ? data.instanceof.name : "Object"}:}
- data={data.id} field={'name'} hidden={true} autosize={true}/>
-
-
-
- {data.features.map((child, index) => {
- return
- })}
-
-
`;
+
+ {data.instanceof ? data.instanceof.name : "Object"}:}
+ data={data.id} field={'name'} hidden={true} autosize={true}/>
+
+
+
+ {data.features.map((child, index) => {
+ return
+ })}
+
+`;
}
public static value() {
return `
- {props.data.instanceof && {props.data.instanceof.name} }
- {!props.data.instanceof && }
- : {props.data.valuestring()}
-
`
+ {props.data.instanceof && {props.data.instanceof.name} }
+ {!props.data.instanceof && }
+ : {props.data.valuestring()}
+`
}
public static defaultPackage() {
return `
- {data.children.map((child, index) => {
- return
- })}
-
`;
+ {data.children.map((child, index) => {
+ return
+ })}
+`;
}
public static error(msg: undefined | string | JSX.Element) {
diff --git a/src/components/forEndUser/GenericInput.tsx b/src/components/forEndUser/GenericInput.tsx
index 1f8769b97..0abcda1fa 100644
--- a/src/components/forEndUser/GenericInput.tsx
+++ b/src/components/forEndUser/GenericInput.tsx
@@ -1,5 +1,5 @@
-import React, {Dispatch, InputHTMLAttributes, PureComponent, ReactNode} from "react";
-import { connect } from "react-redux";
+import React, {Dispatch, InputHTMLAttributes, PureComponent, ReactNode} from 'react';
+import { connect } from 'react-redux';
import './GenericInput.scss';
import {
Pointer,
@@ -12,9 +12,9 @@ import {
Select,
ShortAttribETypes,
Input, LViewElement, DViewElement, U
-} from "../../joiner";
-import {DState, DPointerTargetable, LPointerTargetable, RuntimeAccessibleClass} from "../../joiner";
-import {SizeInput} from "./SizeInput";
+} from '../../joiner';
+import {DState, DPointerTargetable, LPointerTargetable, RuntimeAccessibleClass} from '../../joiner';
+import {SizeInput} from './SizeInput';
// private
interface ThisState {
@@ -30,27 +30,27 @@ class GenericInputComponent extends PureComponent;
- if (!this.props.infoof){
+ let info: GObject;
+ if (!this.props.info){
let DConstructor: typeof DPointerTargetable = RuntimeAccessibleClass.get(d.className);
let singleton: GObject = DConstructor.singleton;
- infoof = singleton["__info_of__" + this.props.field] ;
- } else infoof = this.props.infoof;
+ info = singleton['__info_of__' + this.props.field] ;
+ } else info = this.props.info;
let type: string;
- let enumOptions: Dic, Dic, String<"values">>> = {}; // "Options" entry is a fallback for items without an optgroup
+ let enumOptions: Dic, Dic, String<'values'>>> = {}; // 'Options' entry is a fallback for items without an optgroup
let enumOptionsJSX: JSX.Element | undefined;
- if (infoof.enum) {
- type = "EEnum";
- let prevoptgroup: string = "Options";
+ if (info.enum) {
+ type = 'EEnum';
+ let prevoptgroup: string = 'Options';
let group: string;
let option: string;
- for (let key in infoof.enum) {
- let val: string = infoof.enum[key];
- if (key.indexOf("(") === 0) {
- let endi = key.indexOf(")");
- group = key.substring(1, endi).trim();
- option = key.substring(endi+1).trim();
+ for (let key in info.enum) {
+ let val: string = info.enum[key];
+ if (key.indexOf('(') === 0) {
+ let end = key.indexOf(')');
+ group = key.substring(1, end).trim();
+ option = key.substring(end + 1).trim();
prevoptgroup = group;
} else {
option = key;
@@ -64,28 +64,28 @@ class GenericInputComponent extends PureComponent
{
//data-selected={l[field] === unsorted[optkey]}
- unsorted && Object.keys(unsorted).map( (optkey: string) => {optkey} )
+ unsorted && Object.keys(unsorted).map((optKey: string) => {optKey} )
}
- {Object.keys(enumOptions).map((grpkey: string) => {
- Object.keys(enumOptions[grpkey]).map( (optkey: string) => {optkey} )
+ {Object.keys(enumOptions).map((grpKey: string) => {
+ Object.keys(enumOptions[grpKey]).map( (optKey: string) => {optKey} )
} )}>;
}
else {
- if (typeof infoof.type === "string") {
- if (infoof.type.indexOf("Function") === 0) type = "Function";
- else type = infoof.type;
+ if (typeof info.type === 'string') {
+ if (info.type.indexOf('Function') === 0) type = 'Function';
+ else type = info.type;
}
else {
- if (!infoof.type) { Log.exDevv("missing __info_of__ type for " + d.className + "." + this.props.field, {d, infoof, props:this.props}); return <>>}
- let infotype: GObject = infoof.type;
- type = infotype.cname || infotype.className || infotype.name;
- Log.exDev(!type, "missing type:", {type, infoof});
+ if (!info.type) { Log.exDevv('missing __info_of__ type for ' + d.className + '.' + this.props.field, {d, info, props: this.props}); return <>>}
+ let infoType: GObject = info.type;
+ type = infoType.cname || infoType.className || infoType.name;
+ Log.exDev(!type, 'missing type:', {type, info});
}
}
- /*if (type.indexOf("|") !== -1) {
- type = "EEnum";
- let options = type.split("|");
+ /*if (type.indexOf('|') !== -1) {
+ type = 'EEnum';
+ let options = type.split('|');
if (!enumOptions.Option) enumOptions.Option = {};
for (let o in options){
o = o.trim();
@@ -96,90 +96,91 @@ class GenericInputComponent extends PureComponent = {...this.props} as any;
function setMinMax(max: number): void {
- if (infoof.min !== undefined) otherProps.min = infoof.min;
- else otherProps.min = infoof.positive === true ? 0 : -max / 2; // assume false if non specified
+ if (info.min !== undefined) otherProps.min = info.min;
+ else otherProps.min = info.positive === true ? 0 : -max / 2; // assume false if non specified
- if (infoof.max !== undefined) otherProps.max = infoof.max;
- else otherProps.max = infoof.positive === false ? max/2 - 1 : max-1; // assume true if non specified
+ if (info.max !== undefined) otherProps.max = info.max;
+ else otherProps.max = info.positive === false ? max/2 - 1 : max-1; // assume true if non specified
}
- let label = U.uppercaseFirstLetter(infoof.label || this.props.field);
+ let label = U.uppercaseFirstLetter(info.label || this.props.field);
switch (type) {
default:
- Log.e("invalid type in GenericInput", {type, props:this.props, infoof, d});
- return Invalid GInput type: "{type}"
;
- case "Point": case "GraphPoint": case "Size": case "GraphSize":
+ Log.e('invalid type in GenericInput', {type, props:this.props, info, d});
+ return Invalid GInput type: '{type}'
;
+ case 'Point': case 'GraphPoint': case 'Size': case 'GraphSize':
return ;
- case "text": case "Function":
- return ;
- case "EEnum":
- return ;
+ case 'EEnum':
+ return ;
+ jsxLabel={label} tooltip={this.props.tooltip} />;
// natives
- case "radio":
+ case 'radio':
// problem: this would need to return a