##// 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:

r34:e8012fdf09ae 1.0.0-rc16 default
r53:deb0ed6fb680 v1.0.7 default
Show More
tsx.ts
40 lines | 1.4 KiB | video/mp2t | TypeScriptLexer
cin
added 'dom-inject' and 'css' modules
r6 import { Constructor } from "@implab/core-amd/interfaces";
cin
sync
r7 import { HtmlElementContext } from "./tsx/HtmlElementContext";
import { WidgetContext } from "./tsx/WidgetContext";
import { isWidgetConstructor, BuildContext } from "./tsx/traits";
cin
Support for Function Components...
r34 import { FunctionComponentContext } from "./tsx/FunctionComponentContext";
cin
added 'dom-inject' and 'css' modules
r6
cin
Support for Function Components...
r34 export function createElement<T extends Constructor | string | ((props: any) => Element)>(elementType: T, ...args: any[]): BuildContext {
cin
added 'dom-inject' and 'css' modules
r6 if (typeof elementType === "string") {
const ctx = new HtmlElementContext(elementType);
if (args)
args.forEach(x => ctx.visitNext(x));
return ctx;
} else if (isWidgetConstructor(elementType)) {
const ctx = new WidgetContext(elementType);
if (args)
args.forEach(x => ctx.visitNext(x));
return ctx;
cin
Support for Function Components...
r34 } else if (typeof elementType === "function") {
const ctx = new FunctionComponentContext(elementType as (props: any) => Element);
if (args)
args.forEach(x => ctx.visitNext(x));
return ctx;
cin
added 'dom-inject' and 'css' modules
r6 } else {
throw new Error(`The element type '${elementType}' is unsupported`);
}
}
export interface EventDetails<T = any> {
detail: T;
}
export interface EventSelector {
selectorTarget: HTMLElement;
target: HTMLElement;
}
export type DojoMouseEvent<T = any> = MouseEvent & EventSelector & EventDetails<T>;