##// END OF EJS Templates
corrected i18n, css modules to support requirejs optimizer...
corrected i18n, css modules to support requirejs optimizer i18n bundles now conforms js modules with default exports (breaking change!)

File last commit:

r48:030ea350f98b v1.0.3 default
r53:deb0ed6fb680 v1.0.7 default
Show More
FunctionComponentContext.ts
33 lines | 949 B | video/mp2t | TypeScriptLexer
/ src / main / ts / tsx / FunctionComponentContext.ts
import dom = require("dojo/dom-construct");
import attr = require("dojo/dom-attr");
import { argumentNotNull } from "@implab/core-amd/safe";
import { BuildContextBase } from "./BuildContextBase";
import registry = require("dijit/registry");
export class FunctionComponentContext extends BuildContextBase<Node> {
private _component: (props: any) => any;
private _node: Node | undefined;
constructor(component: (props: any) => any) {
super();
argumentNotNull(component, "component");
this._component = component;
}
_create(attrs: object, children: any[]) {
const _attrs: any = attrs || {};
_attrs.children = children.map(x => this.getChildDom(x));
this._node = this.getChildDom(this._component.call(null, _attrs));
}
_getDomNode() {
if (!this._node)
throw new Error("The instance of the widget isn't created");
return this._node;
}
}