##// END OF EJS Templates
Merge
Merge

File last commit:

r59:bcdd096122ff default
r62:141ef477a5ff merge default
Show More
FunctionComponentContext.ts
33 lines | 947 B | video/mp2t | TypeScriptLexer
/ src / main / ts / tsx / FunctionComponentContext.ts
cin
Support for Function Components...
r34 import dom = require("dojo/dom-construct");
import attr = require("dojo/dom-attr");
import { argumentNotNull } from "@implab/core-amd/safe";
import { BuildContextBase } from "./BuildContextBase";
cin
Added support for ContentPane, corrected widget startup calls
r48 import registry = require("dijit/registry");
cin
Support for Function Components...
r34
cin
Added support for ContentPane, corrected widget startup calls
r48 export class FunctionComponentContext extends BuildContextBase<Node> {
private _component: (props: any) => any;
cin
Support for Function Components...
r34
cin
Added support for ContentPane, corrected widget startup calls
r48 private _node: Node | undefined;
cin
Support for Function Components...
r34
cin
Added support for ContentPane, corrected widget startup calls
r48 constructor(component: (props: any) => any) {
cin
Support for Function Components...
r34 super();
argumentNotNull(component, "component");
this._component = component;
}
_create(attrs: object, children: any[]) {
const _attrs: any = attrs || {};
cin
DjxFragment converted to functionl component...
r59 _attrs.children = children.map(x => this.getItemDom(x));
cin
Support for Function Components...
r34
cin
DjxFragment converted to functionl component...
r59 this._node = this.getItemDom(this._component.call(null, _attrs));
cin
Support for Function Components...
r34 }
_getDomNode() {
cin
Added support for ContentPane, corrected widget startup calls
r48 if (!this._node)
cin
Support for Function Components...
r34 throw new Error("The instance of the widget isn't created");
cin
Added support for ContentPane, corrected widget startup calls
r48 return this._node;
cin
Support for Function Components...
r34 }
}