add tsx support

This commit is contained in:
pengfei.zhou
2021-09-01 10:47:40 +08:00
committed by osborn
parent cde8d1726f
commit 52b2b87e1c
20 changed files with 6856 additions and 6762 deletions

View File

@@ -2640,6 +2640,32 @@ exports.Display = void 0;
Display[Display["NONE"] = 1] = "NONE";
})(exports.Display || (exports.Display = {}));
var jsx = {
createElement: function (constructor, config) {
var arguments$1 = arguments;
var children = [];
for (var _i = 2; _i < arguments.length; _i++) {
children[_i - 2] = arguments$1[_i];
}
var e = new constructor();
if (config) {
for (var key in config) {
Reflect.set(e, key, Reflect.get(config, key, config), e);
}
}
if (children && children.length > 0) {
if (e instanceof Group) {
children.forEach(function (child) { return e.addChild(child); });
}
else {
throw new Error("Can only add child to group view, do not support " + constructor.name);
}
}
return e;
},
};
var __extends$6 = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
@@ -4006,6 +4032,7 @@ exports.hlayout = hlayout;
exports.image = image;
exports.input = input;
exports.internalScheme = internalScheme;
exports.jsx = jsx;
exports.keyboard = keyboard;
exports.layoutConfig = layoutConfig;
exports.list = list;

View File

@@ -2040,6 +2040,26 @@ exports.Display = void 0;
Display[Display["NONE"] = 1] = "NONE";
})(exports.Display || (exports.Display = {}));
const jsx = {
createElement: function (constructor, config, ...children) {
const e = new constructor();
if (config) {
for (let key in config) {
Reflect.set(e, key, Reflect.get(config, key, config), e);
}
}
if (children && children.length > 0) {
if (e instanceof Group) {
children.forEach((child) => e.addChild(child));
}
else {
throw new Error(`Can only add child to group view, do not support ${constructor.name}`);
}
}
return e;
},
};
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -3120,6 +3140,7 @@ exports.hlayout = hlayout;
exports.image = image;
exports.input = input;
exports.internalScheme = internalScheme;
exports.jsx = jsx;
exports.keyboard = keyboard;
exports.layoutConfig = layoutConfig;
exports.list = list;

File diff suppressed because it is too large Load Diff

View File

@@ -3564,6 +3564,26 @@ exports.Display = void 0;
Display[Display["NONE"] = 1] = "NONE";
})(exports.Display || (exports.Display = {}));
const jsx = {
createElement: function (constructor, config, ...children) {
const e = new constructor();
if (config) {
for (let key in config) {
Reflect.set(e, key, Reflect.get(config, key, config), e);
}
}
if (children && children.length > 0) {
if (e instanceof Group) {
children.forEach((child) => e.addChild(child));
}
else {
throw new Error(`Can only add child to group view, do not support ${constructor.name}`);
}
}
return e;
},
};
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -4885,6 +4905,7 @@ exports.hlayout = hlayout;
exports.image = image;
exports.input = input;
exports.internalScheme = internalScheme;
exports.jsx = jsx;
exports.keyboard = keyboard;
exports.layoutConfig = layoutConfig;
exports.list = list;