##// END OF EJS Templates
Working on IntrisictElements to support legacy and new tsx styles
cin -
r40:ac3004768754 default
parent child
Show More
@@ -0,0 +1,4
1 declare module "@implab/djx/css!*" {
2 const result: { url: string };
3 export = result;
4 } No newline at end of file
@@ -0,0 +1,14
1 declare namespace dijit {
2 interface _WidgetBase {
3
4 _started?: boolean;
5
6 _set<K extends keyof this>(key: K, value: this[K]): void;
7 }
8
9 interface TooltipDialog {
10
11 content: any;
12
13 }
14 }
@@ -0,0 +1,7
1 /// <reference path="./index.d.ts"/>
2
3 declare namespace JSX {
4 interface IntrinsicElements {
5
6 }
7 } No newline at end of file
@@ -7,6 +7,7
7 7 "**/.factorypath": true
8 8 },
9 9 "cSpell.words": [
10 "dijit",
10 11 "djbase",
11 12 "djclass"
12 13 ]
@@ -44,7 +44,7 configureTsMain {
44 44 configureTsTest {
45 45 compilerOptions {
46 46 typeRoots = []
47 types = ["requirejs", sources.main.output.typingsDir.get().toString() ]
47 types = ["requirejs", sources.main.output.typingsDir.get().toString()+"/legacy" ]
48 48 }
49 49 }
50 50
@@ -34,9 +34,9
34 34 }
35 35 },
36 36 "@implab/core-amd": {
37 "version": "1.3.2",
38 "resolved": "https://registry.npmjs.org/@implab/core-amd/-/core-amd-1.3.2.tgz",
39 "integrity": "sha512-OPx02obqz60FiOzDqEFuPfag/0ugl1tuQouI+52Op0k+fcmuBK4QACJy7o3fzOYvejdjF1DG4aRXuCm6+vgMYQ==",
37 "version": "1.4.0",
38 "resolved": "https://registry.npmjs.org/@implab/core-amd/-/core-amd-1.4.0.tgz",
39 "integrity": "sha512-gaJX1mhri7YpmXDTAYELZnmTznzXYpk2AI7Decsttdi6xY+bqGgH24q0AFcKrx8RY2jfsFXxDdf0fITz2HpBbw==",
40 40 "dev": true
41 41 },
42 42 "@types/chai": {
@@ -16,10 +16,10
16 16 },
17 17 "peerDependencies": {
18 18 "dojo": "1.16.0",
19 "@implab/core-amd": "^1.3.2"
19 "@implab/core-amd": "^1.4.0"
20 20 },
21 21 "devDependencies": {
22 "@implab/core-amd": "^1.3.2",
22 "@implab/core-amd": "^1.4.0",
23 23 "@types/chai": "4.1.3",
24 24 "@types/requirejs": "2.1.31",
25 25 "@types/yaml": "1.2.0",
@@ -15,7 +15,8 export abstract class BuildContextBase<T
15 15 if (this._created)
16 16 throw new Error("The Element is already created");
17 17
18 if (isNull(v))
18 if (isNull(v) || typeof v === "boolean")
19 // skip null, undefined, booleans ( this will work: {value && <span>{value}</span>} )
19 20 return;
20 21
21 22 if (isPlainObject(v)) {
@@ -29,7 +30,7 export abstract class BuildContextBase<T
29 30
30 31 getChildDom(v: any) {
31 32 const tv = typeof v;
32 if (tv === "string" || tv === "number" || tv === "boolean" || v instanceof RegExp || v instanceof Date) {
33 if (tv === "string" || tv === "number" || v instanceof RegExp || v instanceof Date) {
33 34 return document.createTextNode(v.toString());
34 35 } else if (isNode(v)) {
35 36 return v;
@@ -7,7 +7,7 export class DjxFragment implements _Wid
7 7
8 8 domNode: Node;
9 9
10 containerNode?: Node;
10 containerNode: Node;
11 11
12 12 constructor() {
13 13 this.domNode = this.containerNode = document.createDocumentFragment();
@@ -1,30 +1,34
1 declare module "@implab/djx/css!*" {
2 const result: { url: string };
3 export = result;
4 }
1 /// <reference path="./css.d.ts"/>
2 /// <reference path="./dijit.d.ts"/>
5 3
6 4 declare namespace JSX {
5
7 6 interface DjxIntrinsicAttributes {
8 7 class: string;
9 8 "data-dojo-attach-point": string;
10 9 "data-dojo-attach-event": string;
11 10 }
12 type IntrinsicElements = {
13 [name in keyof HTMLElementTagNameMap]: Partial<Omit<HTMLElementTagNameMap[name], "children"> & DjxIntrinsicAttributes>;
11
12 type RecursivePartial<T> = T extends string | number | boolean | null | undefined | Function ?
13 T :
14 { [k in keyof T]?: RecursivePartial<T[k]> };
15
16 type MatchingMemberKeys<T, U> = {
17 [K in keyof T]: T[K] extends U ? K : never;
18 }[keyof T];
19 type NotMatchingMemberKeys<T, U> = {
20 [K in keyof T]: T[K] extends U ? never : K;
21 }[keyof T];
22 type ElementAttrNames<E> = NotMatchingMemberKeys<E, (...args: any[]) => any>;
23
24 type ElementAttrType<E, K extends keyof any> = K extends keyof E ? RecursivePartial<E[K]> : string;
25
26 type LaxElement<E extends object> = E & { }
27
28 type LegacyElementAttributes<E> = {
29 [attr in ElementAttrNames<E>]?: ElementAttrType<E, attr>;
30 } | Partial<DjxIntrinsicAttributes>;
31 interface IntrinsicElements {
32 [tag: keyof HTMLElementTagNameMap]: LegacyElementAttributes<HTMLElementTagNameMap[tag]>;
14 33 }
15 34 }
16
17 declare namespace dijit {
18 interface _WidgetBase {
19
20 _started?: boolean;
21
22 _set<K extends keyof this>(key: K, value: this[K]): void;
23 }
24
25 interface TooltipDialog {
26
27 content: any;
28
29 }
30 } No newline at end of file
@@ -27,12 +27,17 export class MyWidget extends djbase(Djx
27 27
28 28 render() {
29 29 const Frame = (props: any) => <div>{props.children}</div>;
30 return <div>
30 return <div class="" className="" tabIndex={1} style={{ alignContentz: "", border: "" }} >
31 31 <h1 data-dojo-attach-point="titleNode"></h1>
32 32 <Frame>
33 33 <span class="up-button" onclick={e => this._onIncClick(e)}>[+]</span>
34 <span class="down-button" onclick={() => this._onDecClick()}>[-]</span>
34 <span class="down-button" onclick={() => this._onDecClick()}>[-]</span>
35 35 </Frame>
36 <table style="pretty">
37 <tr>
38 <td colSpan={2} colspan="3" onclick=""></td>
39 </tr>
40 </table>
36 41 </div>;
37 42 }
38 43
@@ -8,6 +8,6
8 8 "../main/ts",
9 9 "../main/typings"
10 10 ],
11 "types": ["requirejs", "../main/typings", "dojo-typings"]
11 "types": ["requirejs", "../main/typings/legacy", "dojo-typings"]
12 12 }
13 13 } No newline at end of file
@@ -6,7 +6,7
6 6 "types": [],
7 7 "experimentalDecorators": true,
8 8 "jsxFactory": "createElement",
9 "skipLibCheck": true,
9 //"skipLibCheck": true,
10 10 "jsx": "react",
11 11 "lib": ["es5", "es2015.promise", "es2015.symbol", "es2015.iterable", "dom", "scripthost"]
12 12 }
General Comments 0
You need to be logged in to leave comments. Login now