|
@@ -29,10 +29,11 @@ export class Node extends TreeNode {
|
|
|
}
|
|
|
|
|
|
export default class ViewSystem {
|
|
|
- constructor(MS, ES) {
|
|
|
+ constructor(CS) {
|
|
|
this.views = {};
|
|
|
- this.ModuleSystem = MS;
|
|
|
- this.EventSystem = ES;
|
|
|
+ this.CoreSystem = CS;
|
|
|
+ this.ModuleSystem = CS.ModuleSystem;
|
|
|
+ this.EventSystem = CS.EventSystem;
|
|
|
}
|
|
|
|
|
|
getNode(ViewId, NodeId) {
|
|
@@ -54,7 +55,7 @@ export default class ViewSystem {
|
|
|
}
|
|
|
|
|
|
render(name) {
|
|
|
- return this.views[name].render(this.ModuleSystem, this.EventSystem);
|
|
|
+ return this.views[name].render(this.CoreSystem);
|
|
|
}
|
|
|
|
|
|
export() {
|
|
@@ -109,9 +110,9 @@ export class View {
|
|
|
return this.getNode(node.id);
|
|
|
}
|
|
|
|
|
|
- render(MS, ES) {
|
|
|
+ render(CS) {
|
|
|
let node = this.ViewTree.root;
|
|
|
- return (<Renderer ModuleSystem={MS} EventSystem={ES} node={node} tree={this.ViewTree}/>);
|
|
|
+ return (<Renderer CoreSystem={CS} node={node} tree={this.ViewTree}/>);
|
|
|
}
|
|
|
|
|
|
addViewNode(node,parentNode = null){
|
|
@@ -249,17 +250,17 @@ export class View {
|
|
|
|
|
|
|
|
|
let Renderer = (props) => {
|
|
|
- let { node , tree, ModuleSystem, EventSystem } = props;
|
|
|
+ let { node , tree, CoreSystem } = props;
|
|
|
let childrens = tree.getChildren(node);
|
|
|
let childrenReact = childrens.map(child => {
|
|
|
return(
|
|
|
<Renderer node = {child}
|
|
|
tree={tree}
|
|
|
key={child.id}
|
|
|
- ModuleSystem={ModuleSystem}
|
|
|
- EventSystem={EventSystem} />)
|
|
|
+ CoreSystem={CoreSystem} />)
|
|
|
});
|
|
|
-
|
|
|
+ let ModuleSystem = CoreSystem.ModuleSystem;
|
|
|
+ let EventSystem = CoreSystem.EventSystem;
|
|
|
let viewNode = node.content;
|
|
|
let ViewNodeReact;
|
|
|
// IF CONTENT
|
|
@@ -273,7 +274,8 @@ let Renderer = (props) => {
|
|
|
{
|
|
|
...viewNode.props,
|
|
|
ModuleID: viewNode.id,
|
|
|
- EventSystem: EventSystem
|
|
|
+ EventSystem: EventSystem,
|
|
|
+ CoreSystem: CoreSystem
|
|
|
},
|
|
|
[], // children
|
|
|
viewNode.namespace,
|