##// END OF EJS Templates
created typings for basic part of dojo and dijit further work is required to...
created typings for basic part of dojo and dijit further work is required to complete typings and separate them from this project dojo-typings replaced with @type/dojo, @type/dijit.

File last commit:

r2:8ec37bf1b4d1 default
r2:8ec37bf1b4d1 default
Show More
WidgetContext.ts
42 lines | 1.2 KiB | video/mp2t | TypeScriptLexer
/ src / main / ts / djx / WidgetContext.ts
cin
Initial commit, copied files related to .tsx scripts support.
r0 import dom = require("dojo/dom-construct");
cin
created typings for basic part of dojo and dijit further work is required to...
r2 import { argumentNotNull } from "@implab/core-amd/safe";
cin
Initial commit, copied files related to .tsx scripts support.
r0 import _WidgetBase = require("dijit/_WidgetBase");
import { BuildContextBase } from "./BuildContextBase";
cin
created typings for basic part of dojo and dijit further work is required to...
r2 import { _WidgetBaseConstructor } from "dijit/_WidgetBase";
cin
Initial commit, copied files related to .tsx scripts support.
r0
export class WidgetContext extends BuildContextBase {
widgetClass: _WidgetBaseConstructor;
cin
typescript strict mode...
r1 _instance: _WidgetBase | undefined;
cin
Initial commit, copied files related to .tsx scripts support.
r0
constructor(widgetClass: _WidgetBaseConstructor) {
super();
argumentNotNull(widgetClass, "widgetClass");
this.widgetClass = widgetClass;
}
_addChild(child: any): void {
cin
typescript strict mode...
r1 if (!this._instance || !this._instance.containerNode)
cin
Initial commit, copied files related to .tsx scripts support.
r0 throw new Error("Widget doesn't support adding children");
dom.place(this.getChildDom(child), this._instance.containerNode);
}
_setAttrs(attrs: object): void {
cin
typescript strict mode...
r1 this._instance?.set(attrs);
cin
Initial commit, copied files related to .tsx scripts support.
r0 }
_create(attrs: object, children: any[]) {
this._instance = new this.widgetClass(this._attrs);
if (children)
children.forEach(x => this._addChild(x));
}
_getDomElement() {
cin
typescript strict mode...
r1 if (!this._instance)
throw new Error("The instance of the widget isn't created");
cin
Initial commit, copied files related to .tsx scripts support.
r0 return this._instance.domNode;
}
}