##// END OF EJS Templates
fixed dependencies
fixed dependencies

File last commit:

r2:8ec37bf1b4d1 default
r3:fb4d13ff05ae default
Show More
DjxWidgetBase.ts
50 lines | 1.9 KiB | video/mp2t | TypeScriptLexer
/ src / main / ts / djx / DjxWidgetBase.ts
cin
Initial commit, copied files related to .tsx scripts support.
r0 import { djbase, djclass } from "../declare";
import _WidgetBase = require("dijit/_WidgetBase");
import _AttachMixin = require("dijit/_AttachMixin");
import { BuildContext, isNode } from "./traits";
import registry = require("dijit/registry");
cin
created typings for basic part of dojo and dijit further work is required to...
r2 import { Handle } from "dojo/interfaces";
cin
Initial commit, copied files related to .tsx scripts support.
r0
@djclass
export abstract class DjxWidgetBase extends djbase(_WidgetBase, _AttachMixin) {
buildRendering() {
this.domNode = this.render().getDomElement();
super.buildRendering();
}
abstract render(): BuildContext;
_processTemplateNode<T extends (Element | Node | _WidgetBase)>(
baseNode: T,
getAttrFunc: (baseNode: T, attr: string) => string,
cin
typescript strict mode...
r1 // tslint:disable-next-line: ban-types
cin
created typings for basic part of dojo and dijit further work is required to...
r2 attachFunc: (node: T, type: string, func?: Function) => Handle
cin
Initial commit, copied files related to .tsx scripts support.
r0 ): boolean {
if (isNode(baseNode)) {
const w = registry.byNode(baseNode);
if (w) {
// from dijit/_WidgetsInTemplateMixin
this._processTemplateNode(w,
cin
typescript strict mode...
r1 (n, p) => n.get(p), // callback to get a property of a widget
cin
Initial commit, copied files related to .tsx scripts support.
r0 (widget, type, callback) => {
cin
typescript strict mode...
r1 if (!callback)
throw new Error("The callback must be specified");
cin
Initial commit, copied files related to .tsx scripts support.
r0 // callback to do data-dojo-attach-event to a widget
if (type in widget) {
// back-compat, remove for 2.0
cin
typescript strict mode...
r1 return widget.connect(widget, type, callback as EventListener);
cin
Initial commit, copied files related to .tsx scripts support.
r0 } else {
// 1.x may never hit this branch, but it's the default for 2.0
return widget.on(type, callback);
}
cin
typescript strict mode...
r1
cin
Initial commit, copied files related to .tsx scripts support.
r0 });
// don't process widgets internals
return false;
}
}
return super._processTemplateNode(baseNode, getAttrFunc, attachFunc);
}
}