update typescript and remove reflect-metadata lib

This commit is contained in:
pengfei.zhou 2020-05-16 18:58:32 +08:00 committed by osborn
parent 4d80048d60
commit 0633c1c19d
30 changed files with 3593 additions and 3384 deletions

View File

@ -222,7 +222,7 @@ var View = /** @class */ (function () {
set: function (v) {
this.x = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(View.prototype, "right", {
@ -232,7 +232,7 @@ var View = /** @class */ (function () {
set: function (v) {
this.x = v - this.width;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(View.prototype, "top", {
@ -242,7 +242,7 @@ var View = /** @class */ (function () {
set: function (v) {
this.y = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(View.prototype, "bottom", {
@ -252,7 +252,7 @@ var View = /** @class */ (function () {
set: function (v) {
this.y = v - this.height;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(View.prototype, "centerX", {
@ -262,7 +262,7 @@ var View = /** @class */ (function () {
set: function (v) {
this.x = v - this.width / 2;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(View.prototype, "centerY", {
@ -272,7 +272,7 @@ var View = /** @class */ (function () {
set: function (v) {
this.y = v - this.height / 2;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(View.prototype, "dirtyProps", {
@ -280,7 +280,7 @@ var View = /** @class */ (function () {
get: function () {
return this.__dirty_props__;
},
enumerable: true,
enumerable: false,
configurable: true
});
View.prototype.onPropertyChanged = function (propKey, oldV, newV) {
@ -1396,7 +1396,7 @@ var ScaleAnimation = /** @class */ (function (_super) {
set: function (v) {
this.scaleXChangeable.fromValue = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(ScaleAnimation.prototype, "toScaleX", {
@ -1406,7 +1406,7 @@ var ScaleAnimation = /** @class */ (function (_super) {
set: function (v) {
this.scaleXChangeable.toValue = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(ScaleAnimation.prototype, "fromScaleY", {
@ -1416,7 +1416,7 @@ var ScaleAnimation = /** @class */ (function (_super) {
set: function (v) {
this.scaleYChangeable.fromValue = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(ScaleAnimation.prototype, "toScaleY", {
@ -1426,7 +1426,7 @@ var ScaleAnimation = /** @class */ (function (_super) {
set: function (v) {
this.scaleYChangeable.toValue = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
return ScaleAnimation;
@ -1456,7 +1456,7 @@ var TranslationAnimation = /** @class */ (function (_super) {
set: function (v) {
this.translationXChangeable.fromValue = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(TranslationAnimation.prototype, "toTranslationX", {
@ -1466,7 +1466,7 @@ var TranslationAnimation = /** @class */ (function (_super) {
set: function (v) {
this.translationXChangeable.toValue = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(TranslationAnimation.prototype, "fromTranslationY", {
@ -1476,7 +1476,7 @@ var TranslationAnimation = /** @class */ (function (_super) {
set: function (v) {
this.translationYChangeable.fromValue = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(TranslationAnimation.prototype, "toTranslationY", {
@ -1486,7 +1486,7 @@ var TranslationAnimation = /** @class */ (function (_super) {
set: function (v) {
this.translationYChangeable.toValue = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
return TranslationAnimation;
@ -1510,7 +1510,7 @@ var RotationAnimation = /** @class */ (function (_super) {
set: function (v) {
this.rotationChaneable.fromValue = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(RotationAnimation.prototype, "toRotation", {
@ -1520,7 +1520,7 @@ var RotationAnimation = /** @class */ (function (_super) {
set: function (v) {
this.rotationChaneable.toValue = v;
},
enumerable: true,
enumerable: false,
configurable: true
});
return RotationAnimation;
@ -1541,7 +1541,7 @@ var AnimationSet = /** @class */ (function () {
this._duration = v;
this.animations.forEach(function (e) { return e.duration = v; });
},
enumerable: true,
enumerable: false,
configurable: true
});
AnimationSet.prototype.toModel = function () {
@ -1927,8 +1927,7 @@ var List = /** @class */ (function (_super) {
}
};
List.prototype.scrollToItem = function (context, index, config) {
var _a;
var animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
var animated = config === null || config === void 0 ? void 0 : config.animated;
return this.nativeChannel(context, 'scrollToItem')({ index: index, animated: animated, });
};
List.prototype.reset = function () {

View File

@ -128,6 +128,7 @@ var __metadata = (undefined && undefined.__metadata) || function (k, v) {
function Property(target, propKey) {
Reflect.defineMetadata(propKey, true, target);
}
let View = /** @class */ (() => {
class View {
constructor() {
this.width = 0;
@ -385,6 +386,8 @@ __decorate([
Property,
__metadata("design:type", Object)
], View.prototype, "flexConfig", void 0);
return View;
})();
class Superview extends View {
subviewById(id) {
for (let v of this.allSubviews()) {
@ -466,6 +469,7 @@ const BOTTOM = (END | SPECIFIED) << SHIFT_Y;
const CENTER_X = SPECIFIED << SHIFT_X;
const CENTER_Y = SPECIFIED << SHIFT_Y;
const CENTER = CENTER_X | CENTER_Y;
let Gravity = /** @class */ (() => {
class Gravity {
constructor() {
this.val = 0;
@ -524,6 +528,8 @@ Gravity.Left = Gravity.origin.left();
Gravity.Right = Gravity.origin.right();
Gravity.Top = Gravity.origin.top();
Gravity.Bottom = Gravity.origin.bottom();
return Gravity;
})();
function gravity() {
return new Gravity;
}
@ -621,6 +627,7 @@ class Stack extends Group {
}
class Root extends Stack {
}
let LinearLayout = /** @class */ (() => {
class LinearLayout extends Group {
}
__decorate$1([
@ -631,6 +638,8 @@ __decorate$1([
Property,
__metadata$1("design:type", Gravity)
], LinearLayout.prototype, "gravity", void 0);
return LinearLayout;
})();
class VLayout extends LinearLayout {
}
class HLayout extends LinearLayout {
@ -707,6 +716,7 @@ function NativeCall(target, propertyKey, descriptor) {
};
return descriptor;
}
let Panel = /** @class */ (() => {
class Panel {
constructor() {
this.destroyed = false;
@ -932,6 +942,8 @@ __decorate$2([
__metadata$2("design:paramtypes", [Array, String]),
__metadata$2("design:returntype", void 0)
], Panel.prototype, "__response__", null);
return Panel;
})();
/*
* Copyright [2019] [Doric.Pub]
@ -1152,6 +1164,7 @@ class AnimationSet {
/**
* Store color as format AARRGGBB or RRGGBB
*/
let Color = /** @class */ (() => {
class Color {
constructor(v) {
this._value = 0;
@ -1203,6 +1216,8 @@ Color.YELLOW = new Color(0xFFFFFF00);
Color.CYAN = new Color(0xFF00FFFF);
Color.MAGENTA = new Color(0xFFFF00FF);
Color.TRANSPARENT = new Color(0);
return Color;
})();
(function (GradientOrientation) {
/** draw the gradient from the top to the bottom */
GradientOrientation[GradientOrientation["TOP_BOTTOM"] = 0] = "TOP_BOTTOM";
@ -1237,6 +1252,7 @@ var __metadata$3 = (undefined && undefined.__metadata) || function (k, v) {
TruncateAt[TruncateAt["Start"] = 2] = "Start";
TruncateAt[TruncateAt["Clip"] = 3] = "Clip";
})(exports.TruncateAt || (exports.TruncateAt = {}));
let Text = /** @class */ (() => {
class Text extends View {
}
__decorate$3([
@ -1295,6 +1311,8 @@ __decorate$3([
Property,
__metadata$3("design:type", Number)
], Text.prototype, "truncateAt", void 0);
return Text;
})();
function text(config) {
const ret = new Text;
ret.layoutConfig = layoutConfig().fit();
@ -1318,6 +1336,7 @@ var __metadata$4 = (undefined && undefined.__metadata) || function (k, v) {
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
ScaleType[ScaleType["ScaleAspectFill"] = 2] = "ScaleAspectFill";
})(exports.ScaleType || (exports.ScaleType = {}));
let Image = /** @class */ (() => {
class Image extends View {
}
__decorate$4([
@ -1385,6 +1404,8 @@ __decorate$4([
Property,
__metadata$4("design:type", Object)
], Image.prototype, "stretchInset", void 0);
return Image;
})();
function image(config) {
const ret = new Image;
ret.layoutConfig = layoutConfig().fit();
@ -1418,12 +1439,16 @@ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$5 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let ListItem = /** @class */ (() => {
class ListItem extends Stack {
}
__decorate$5([
Property,
__metadata$5("design:type", String)
], ListItem.prototype, "identifier", void 0);
return ListItem;
})();
let List = /** @class */ (() => {
class List extends Superview {
constructor() {
super(...arguments);
@ -1441,8 +1466,7 @@ class List extends Superview {
}
}
scrollToItem(context, index, config) {
var _a;
const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
const animated = config === null || config === void 0 ? void 0 : config.animated;
return this.nativeChannel(context, 'scrollToItem')({ index, animated, });
}
reset() {
@ -1513,6 +1537,8 @@ __decorate$5([
Property,
__metadata$5("design:type", Number)
], List.prototype, "scrolledPosition", void 0);
return List;
})();
function list(config) {
const ret = new List;
for (let key in config) {
@ -1548,12 +1574,16 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$6 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let SlideItem = /** @class */ (() => {
class SlideItem extends Stack {
}
__decorate$6([
Property,
__metadata$6("design:type", String)
], SlideItem.prototype, "identifier", void 0);
return SlideItem;
})();
let Slider = /** @class */ (() => {
class Slider extends Superview {
constructor() {
super(...arguments);
@ -1613,6 +1643,8 @@ __decorate$6([
Property,
__metadata$6("design:type", Boolean)
], Slider.prototype, "loop", void 0);
return Slider;
})();
function slider(config) {
const ret = new Slider;
for (let key in config) {
@ -1659,6 +1691,7 @@ function scroller(content, config) {
v.content = content;
});
}
let Scroller = /** @class */ (() => {
class Scroller extends Superview {
allSubviews() {
return [this.content];
@ -1686,6 +1719,8 @@ __decorate$7([
Property,
__metadata$7("design:type", Function)
], Scroller.prototype, "onScrollEnd", void 0);
return Scroller;
})();
var __decorate$8 = (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;
@ -1696,6 +1731,7 @@ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$8 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let Refreshable = /** @class */ (() => {
class Refreshable extends Superview {
allSubviews() {
const ret = [this.content];
@ -1726,6 +1762,8 @@ __decorate$8([
Property,
__metadata$8("design:type", Function)
], Refreshable.prototype, "onRefresh", void 0);
return Refreshable;
})();
function refreshable(config) {
const ret = new Refreshable;
ret.layoutConfig = layoutConfig().fit();
@ -1748,6 +1786,7 @@ var ValueType;
ValueType[ValueType["Percent"] = 2] = "Percent";
ValueType[ValueType["Auto"] = 3] = "Auto";
})(ValueType || (ValueType = {}));
let FlexTypedValue = /** @class */ (() => {
class FlexTypedValue {
constructor(type) {
this.value = 0;
@ -1771,6 +1810,8 @@ class FlexTypedValue {
}
}
FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
return FlexTypedValue;
})();
(function (FlexDirection) {
FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN";
FlexDirection[FlexDirection["COLUMN_REVERSE"] = 1] = "COLUMN_REVERSE";
@ -1828,12 +1869,16 @@ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$9 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let FlowLayoutItem = /** @class */ (() => {
class FlowLayoutItem extends Stack {
}
__decorate$9([
Property,
__metadata$9("design:type", String)
], FlowLayoutItem.prototype, "identifier", void 0);
return FlowLayoutItem;
})();
let FlowLayout = /** @class */ (() => {
class FlowLayout extends Superview {
constructor() {
super(...arguments);
@ -1927,6 +1972,8 @@ __decorate$9([
Property,
__metadata$9("design:type", Function)
], FlowLayout.prototype, "onScrollEnd", void 0);
return FlowLayout;
})();
function flowlayout(config) {
const ret = new FlowLayout;
for (let key in config) {
@ -1962,6 +2009,7 @@ var __decorate$a = (undefined && undefined.__decorate) || function (decorators,
var __metadata$a = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let Input = /** @class */ (() => {
class Input extends View {
getText(context) {
return this.nativeChannel(context, 'getText')();
@ -2019,6 +2067,8 @@ __decorate$a([
Property,
__metadata$a("design:type", Number)
], Input.prototype, "maxLength", void 0);
return Input;
})();
function input(config) {
const ret = new Input;
ret.layoutConfig = layoutConfig().just();
@ -2037,6 +2087,7 @@ var __decorate$b = (undefined && undefined.__decorate) || function (decorators,
var __metadata$b = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let NestedSlider = /** @class */ (() => {
class NestedSlider extends Group {
addSlideItem(view) {
this.addChild(view);
@ -2052,6 +2103,8 @@ __decorate$b([
Property,
__metadata$b("design:type", Function)
], NestedSlider.prototype, "onPageSlided", void 0);
return NestedSlider;
})();
var __decorate$c = (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;
@ -2062,12 +2115,15 @@ var __decorate$c = (undefined && undefined.__decorate) || function (decorators,
var __metadata$c = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let Draggable = /** @class */ (() => {
class Draggable extends Stack {
}
__decorate$c([
Property,
__metadata$c("design:type", Function)
], Draggable.prototype, "onDrag", void 0);
return Draggable;
})();
function draggable(views, config) {
const ret = new Draggable;
ret.layoutConfig = layoutConfig().fit();
@ -2096,6 +2152,7 @@ var __decorate$d = (undefined && undefined.__decorate) || function (decorators,
var __metadata$d = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let Switch = /** @class */ (() => {
class Switch extends View {
}
__decorate$d([
@ -2118,6 +2175,8 @@ __decorate$d([
Property,
__metadata$d("design:type", Color)
], Switch.prototype, "thumbTintColor", void 0);
return Switch;
})();
function switchView(config) {
const ret = new Switch;
ret.layoutConfig = layoutConfig().just();

View File

@ -1705,7 +1705,7 @@ var doric = (function (exports) {
(module.exports = function (key, value) {
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.6.4',
version: '3.6.5',
mode: 'global',
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
});
@ -6489,7 +6489,13 @@ var doric = (function (exports) {
defer = functionBindContext(port.postMessage, port, 1);
// Browsers with postMessage, skip WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
} else if (global_1.addEventListener && typeof postMessage == 'function' && !global_1.importScripts && !fails(post)) {
} else if (
global_1.addEventListener &&
typeof postMessage == 'function' &&
!global_1.importScripts &&
!fails(post) &&
location.protocol !== 'file:'
) {
defer = post;
global_1.addEventListener('message', listener, false);
// IE8-
@ -9861,7 +9867,7 @@ var doric = (function (exports) {
var INVALID_PORT = 'Invalid port';
var ALPHA = /[A-Za-z]/;
var ALPHANUMERIC = /[\d+\-.A-Za-z]/;
var ALPHANUMERIC = /[\d+-.A-Za-z]/;
var DIGIT = /\d/;
var HEX_START = /^(0x|0X)/;
var OCT = /^[0-7]+$/;
@ -11672,8 +11678,8 @@ var doric = (function (exports) {
if (cleanup != null) { subscriptionState.cleanup = typeof cleanup.unsubscribe === 'function'
? function () { subscription.unsubscribe(); }
: aFunction$1(cleanup); }
} catch (error) {
subscriptionObserver.error(error);
} catch (error$1) {
subscriptionObserver.error(error$1);
return;
} if (subscriptionClosed(subscriptionState)) { cleanupSubscription(subscriptionState); }
};
@ -13173,7 +13179,7 @@ var doric = (function (exports) {
// some Chrome versions have non-configurable methods on DOMTokenList
if (CollectionPrototype$1[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) { try {
createNonEnumerableProperty(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME]);
} catch (error) {
} catch (error$1) {
CollectionPrototype$1[METHOD_NAME] = es_array_iterator[METHOD_NAME];
} }
} }

View File

@ -1587,6 +1587,7 @@ var __metadata = (undefined && undefined.__metadata) || function (k, v) {
function Property(target, propKey) {
Reflect.defineMetadata(propKey, true, target);
}
let View = /** @class */ (() => {
class View {
constructor() {
this.width = 0;
@ -1844,6 +1845,8 @@ __decorate([
Property,
__metadata("design:type", Object)
], View.prototype, "flexConfig", void 0);
return View;
})();
class Superview extends View {
subviewById(id) {
for (let v of this.allSubviews()) {
@ -1925,6 +1928,7 @@ const BOTTOM = (END | SPECIFIED) << SHIFT_Y;
const CENTER_X = SPECIFIED << SHIFT_X;
const CENTER_Y = SPECIFIED << SHIFT_Y;
const CENTER = CENTER_X | CENTER_Y;
let Gravity = /** @class */ (() => {
class Gravity {
constructor() {
this.val = 0;
@ -1983,6 +1987,8 @@ Gravity.Left = Gravity.origin.left();
Gravity.Right = Gravity.origin.right();
Gravity.Top = Gravity.origin.top();
Gravity.Bottom = Gravity.origin.bottom();
return Gravity;
})();
function gravity() {
return new Gravity;
}
@ -2080,6 +2086,7 @@ class Stack extends Group {
}
class Root extends Stack {
}
let LinearLayout = /** @class */ (() => {
class LinearLayout extends Group {
}
__decorate$1([
@ -2090,6 +2097,8 @@ __decorate$1([
Property,
__metadata$1("design:type", Gravity)
], LinearLayout.prototype, "gravity", void 0);
return LinearLayout;
})();
class VLayout extends LinearLayout {
}
class HLayout extends LinearLayout {
@ -2166,6 +2175,7 @@ function NativeCall(target, propertyKey, descriptor) {
};
return descriptor;
}
let Panel = /** @class */ (() => {
class Panel {
constructor() {
this.destroyed = false;
@ -2391,6 +2401,8 @@ __decorate$2([
__metadata$2("design:paramtypes", [Array, String]),
__metadata$2("design:returntype", void 0)
], Panel.prototype, "__response__", null);
return Panel;
})();
/*
* Copyright [2019] [Doric.Pub]
@ -2611,6 +2623,7 @@ class AnimationSet {
/**
* Store color as format AARRGGBB or RRGGBB
*/
let Color = /** @class */ (() => {
class Color {
constructor(v) {
this._value = 0;
@ -2662,6 +2675,8 @@ Color.YELLOW = new Color(0xFFFFFF00);
Color.CYAN = new Color(0xFF00FFFF);
Color.MAGENTA = new Color(0xFFFF00FF);
Color.TRANSPARENT = new Color(0);
return Color;
})();
(function (GradientOrientation) {
/** draw the gradient from the top to the bottom */
GradientOrientation[GradientOrientation["TOP_BOTTOM"] = 0] = "TOP_BOTTOM";
@ -2696,6 +2711,7 @@ var __metadata$3 = (undefined && undefined.__metadata) || function (k, v) {
TruncateAt[TruncateAt["Start"] = 2] = "Start";
TruncateAt[TruncateAt["Clip"] = 3] = "Clip";
})(exports.TruncateAt || (exports.TruncateAt = {}));
let Text = /** @class */ (() => {
class Text extends View {
}
__decorate$3([
@ -2754,6 +2770,8 @@ __decorate$3([
Property,
__metadata$3("design:type", Number)
], Text.prototype, "truncateAt", void 0);
return Text;
})();
function text(config) {
const ret = new Text;
ret.layoutConfig = layoutConfig().fit();
@ -2777,6 +2795,7 @@ var __metadata$4 = (undefined && undefined.__metadata) || function (k, v) {
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
ScaleType[ScaleType["ScaleAspectFill"] = 2] = "ScaleAspectFill";
})(exports.ScaleType || (exports.ScaleType = {}));
let Image = /** @class */ (() => {
class Image extends View {
}
__decorate$4([
@ -2844,6 +2863,8 @@ __decorate$4([
Property,
__metadata$4("design:type", Object)
], Image.prototype, "stretchInset", void 0);
return Image;
})();
function image(config) {
const ret = new Image;
ret.layoutConfig = layoutConfig().fit();
@ -2877,12 +2898,16 @@ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$5 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let ListItem = /** @class */ (() => {
class ListItem extends Stack {
}
__decorate$5([
Property,
__metadata$5("design:type", String)
], ListItem.prototype, "identifier", void 0);
return ListItem;
})();
let List = /** @class */ (() => {
class List extends Superview {
constructor() {
super(...arguments);
@ -2900,8 +2925,7 @@ class List extends Superview {
}
}
scrollToItem(context, index, config) {
var _a;
const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
const animated = config === null || config === void 0 ? void 0 : config.animated;
return this.nativeChannel(context, 'scrollToItem')({ index, animated, });
}
reset() {
@ -2972,6 +2996,8 @@ __decorate$5([
Property,
__metadata$5("design:type", Number)
], List.prototype, "scrolledPosition", void 0);
return List;
})();
function list(config) {
const ret = new List;
for (let key in config) {
@ -3007,12 +3033,16 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$6 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let SlideItem = /** @class */ (() => {
class SlideItem extends Stack {
}
__decorate$6([
Property,
__metadata$6("design:type", String)
], SlideItem.prototype, "identifier", void 0);
return SlideItem;
})();
let Slider = /** @class */ (() => {
class Slider extends Superview {
constructor() {
super(...arguments);
@ -3072,6 +3102,8 @@ __decorate$6([
Property,
__metadata$6("design:type", Boolean)
], Slider.prototype, "loop", void 0);
return Slider;
})();
function slider(config) {
const ret = new Slider;
for (let key in config) {
@ -3118,6 +3150,7 @@ function scroller(content, config) {
v.content = content;
});
}
let Scroller = /** @class */ (() => {
class Scroller extends Superview {
allSubviews() {
return [this.content];
@ -3145,6 +3178,8 @@ __decorate$7([
Property,
__metadata$7("design:type", Function)
], Scroller.prototype, "onScrollEnd", void 0);
return Scroller;
})();
var __decorate$8 = (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;
@ -3155,6 +3190,7 @@ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$8 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let Refreshable = /** @class */ (() => {
class Refreshable extends Superview {
allSubviews() {
const ret = [this.content];
@ -3185,6 +3221,8 @@ __decorate$8([
Property,
__metadata$8("design:type", Function)
], Refreshable.prototype, "onRefresh", void 0);
return Refreshable;
})();
function refreshable(config) {
const ret = new Refreshable;
ret.layoutConfig = layoutConfig().fit();
@ -3207,6 +3245,7 @@ var ValueType;
ValueType[ValueType["Percent"] = 2] = "Percent";
ValueType[ValueType["Auto"] = 3] = "Auto";
})(ValueType || (ValueType = {}));
let FlexTypedValue = /** @class */ (() => {
class FlexTypedValue {
constructor(type) {
this.value = 0;
@ -3230,6 +3269,8 @@ class FlexTypedValue {
}
}
FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
return FlexTypedValue;
})();
(function (FlexDirection) {
FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN";
FlexDirection[FlexDirection["COLUMN_REVERSE"] = 1] = "COLUMN_REVERSE";
@ -3287,12 +3328,16 @@ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$9 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let FlowLayoutItem = /** @class */ (() => {
class FlowLayoutItem extends Stack {
}
__decorate$9([
Property,
__metadata$9("design:type", String)
], FlowLayoutItem.prototype, "identifier", void 0);
return FlowLayoutItem;
})();
let FlowLayout = /** @class */ (() => {
class FlowLayout extends Superview {
constructor() {
super(...arguments);
@ -3386,6 +3431,8 @@ __decorate$9([
Property,
__metadata$9("design:type", Function)
], FlowLayout.prototype, "onScrollEnd", void 0);
return FlowLayout;
})();
function flowlayout(config) {
const ret = new FlowLayout;
for (let key in config) {
@ -3421,6 +3468,7 @@ var __decorate$a = (undefined && undefined.__decorate) || function (decorators,
var __metadata$a = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let Input = /** @class */ (() => {
class Input extends View {
getText(context) {
return this.nativeChannel(context, 'getText')();
@ -3478,6 +3526,8 @@ __decorate$a([
Property,
__metadata$a("design:type", Number)
], Input.prototype, "maxLength", void 0);
return Input;
})();
function input(config) {
const ret = new Input;
ret.layoutConfig = layoutConfig().just();
@ -3496,6 +3546,7 @@ var __decorate$b = (undefined && undefined.__decorate) || function (decorators,
var __metadata$b = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let NestedSlider = /** @class */ (() => {
class NestedSlider extends Group {
addSlideItem(view) {
this.addChild(view);
@ -3511,6 +3562,8 @@ __decorate$b([
Property,
__metadata$b("design:type", Function)
], NestedSlider.prototype, "onPageSlided", void 0);
return NestedSlider;
})();
var __decorate$c = (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;
@ -3521,12 +3574,15 @@ var __decorate$c = (undefined && undefined.__decorate) || function (decorators,
var __metadata$c = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let Draggable = /** @class */ (() => {
class Draggable extends Stack {
}
__decorate$c([
Property,
__metadata$c("design:type", Function)
], Draggable.prototype, "onDrag", void 0);
return Draggable;
})();
function draggable(views, config) {
const ret = new Draggable;
ret.layoutConfig = layoutConfig().fit();
@ -3555,6 +3611,7 @@ var __decorate$d = (undefined && undefined.__decorate) || function (decorators,
var __metadata$d = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let Switch = /** @class */ (() => {
class Switch extends View {
}
__decorate$d([
@ -3577,6 +3634,8 @@ __decorate$d([
Property,
__metadata$d("design:type", Color)
], Switch.prototype, "thumbTintColor", void 0);
return Switch;
})();
function switchView(config) {
const ret = new Switch;
ret.layoutConfig = layoutConfig().just();

31
doric-js/index.d.ts vendored
View File

@ -1,6 +1,4 @@
// Generated by dts-bundle v0.7.3
// Dependencies for this module:
// reflect-metadata
declare module 'doric' {
export * from 'doric/lib/src/runtime/global';
@ -12,7 +10,6 @@ declare module 'doric' {
}
declare module 'doric/lib/src/runtime/global' {
export * from 'reflect-metadata';
export type BridgeContext = {
/**
* The identify of current context
@ -739,21 +736,21 @@ declare module 'doric/lib/src/native/modal' {
alert: (arg: string | {
title: string;
msg: string;
okLabel?: string | undefined;
okLabel?: string;
}) => Promise<any>;
confirm: (arg: string | {
title: string;
msg: string;
okLabel?: string | undefined;
cancelLabel?: string | undefined;
okLabel?: string;
cancelLabel?: string;
}) => Promise<any>;
prompt: (arg: {
title?: string | undefined;
msg?: string | undefined;
okLabel?: string | undefined;
cancelLabel?: string | undefined;
text?: string | undefined;
defaultText?: string | undefined;
title?: string;
msg?: string;
okLabel?: string;
cancelLabel?: string;
text?: string;
defaultText?: string;
}) => Promise<string>;
};
}
@ -851,10 +848,10 @@ declare module 'doric/lib/src/native/notification' {
import { BridgeContext } from "doric/lib/src/runtime/global";
export function notification(context: BridgeContext): {
publish: (args: {
biz?: string | undefined;
biz?: string;
name: string;
data?: object | undefined;
androidSystem?: boolean | undefined;
data?: object;
androidSystem?: boolean;
}) => Promise<any>;
subscribe: (args: {
biz?: string | undefined;
@ -889,14 +886,14 @@ declare module 'doric/lib/src/native/coordinator' {
import { Color } from "doric/lib/src/util/color";
export function coordinator(context: BridgeContext): {
verticalScrolling: (argument: {
scrollable: List | Scroller | FlowLayout;
scrollable: Scroller | List | FlowLayout;
scrollRange: {
start: number;
end: number;
};
target: View | "NavBar";
changing: {
name: "width" | "height" | "x" | "y" | "backgroundColor" | "alpha";
name: "backgroundColor" | "width" | "height" | "x" | "y" | "alpha";
start: number | Color;
end: number | Color;
};

View File

@ -1,3 +1,19 @@
/*
* Copyright [2019] [Doric.Pub]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './src/runtime/global';
export * from './src/ui/index.ui';
export * from "./src/widget/index.widget";
export * from './src/native/index.native';

View File

@ -6,14 +6,14 @@ import { View } from "../ui/view";
import { Color } from "../util/color";
export declare function coordinator(context: BridgeContext): {
verticalScrolling: (argument: {
scrollable: List | Scroller | FlowLayout;
scrollable: Scroller | List | FlowLayout;
scrollRange: {
start: number;
end: number;
};
target: View | "NavBar";
changing: {
name: "width" | "height" | "x" | "y" | "backgroundColor" | "alpha";
name: "backgroundColor" | "width" | "height" | "x" | "y" | "alpha";
start: number | Color;
end: number | Color;
};

View File

@ -5,20 +5,20 @@ export declare function modal(context: BridgeContext): {
alert: (arg: string | {
title: string;
msg: string;
okLabel?: string | undefined;
okLabel?: string;
}) => Promise<any>;
confirm: (arg: string | {
title: string;
msg: string;
okLabel?: string | undefined;
cancelLabel?: string | undefined;
okLabel?: string;
cancelLabel?: string;
}) => Promise<any>;
prompt: (arg: {
title?: string | undefined;
msg?: string | undefined;
okLabel?: string | undefined;
cancelLabel?: string | undefined;
text?: string | undefined;
defaultText?: string | undefined;
title?: string;
msg?: string;
okLabel?: string;
cancelLabel?: string;
text?: string;
defaultText?: string;
}) => Promise<string>;
};

View File

@ -1,10 +1,10 @@
import { BridgeContext } from "../runtime/global";
export declare function notification(context: BridgeContext): {
publish: (args: {
biz?: string | undefined;
biz?: string;
name: string;
data?: object | undefined;
androidSystem?: boolean | undefined;
data?: object;
androidSystem?: boolean;
}) => Promise<any>;
subscribe: (args: {
biz?: string | undefined;

View File

@ -1,4 +1,3 @@
export * from 'reflect-metadata';
export declare type BridgeContext = {
/**
* The identify of current context

View File

@ -33,7 +33,8 @@ export function NativeCall(target, propertyKey, descriptor) {
};
return descriptor;
}
export class Panel {
let Panel = /** @class */ (() => {
class Panel {
constructor() {
this.destroyed = false;
this.__root__ = new Root;
@ -258,3 +259,6 @@ __decorate([
__metadata("design:paramtypes", [Array, String]),
__metadata("design:returntype", void 0)
], Panel.prototype, "__response__", null);
return Panel;
})();
export { Panel };

View File

@ -13,7 +13,8 @@ import { loge } from "../util/log";
export function Property(target, propKey) {
Reflect.defineMetadata(propKey, true, target);
}
export class View {
let View = /** @class */ (() => {
class View {
constructor() {
this.width = 0;
this.height = 0;
@ -270,6 +271,9 @@ __decorate([
Property,
__metadata("design:type", Object)
], View.prototype, "flexConfig", void 0);
return View;
})();
export { View };
export class Superview extends View {
subviewById(id) {
for (let v of this.allSubviews()) {

View File

@ -1,7 +1,8 @@
/**
* Store color as format AARRGGBB or RRGGBB
*/
export class Color {
let Color = /** @class */ (() => {
class Color {
constructor(v) {
this._value = 0;
this._value = v | 0x0;
@ -52,6 +53,9 @@ Color.YELLOW = new Color(0xFFFFFF00);
Color.CYAN = new Color(0xFF00FFFF);
Color.MAGENTA = new Color(0xFFFF00FF);
Color.TRANSPARENT = new Color(0);
return Color;
})();
export { Color };
export var GradientOrientation;
(function (GradientOrientation) {
/** draw the gradient from the top to the bottom */

View File

@ -5,7 +5,8 @@ var ValueType;
ValueType[ValueType["Percent"] = 2] = "Percent";
ValueType[ValueType["Auto"] = 3] = "Auto";
})(ValueType || (ValueType = {}));
export class FlexTypedValue {
let FlexTypedValue = /** @class */ (() => {
class FlexTypedValue {
constructor(type) {
this.value = 0;
this.type = type;
@ -28,6 +29,9 @@ export class FlexTypedValue {
}
}
FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
return FlexTypedValue;
})();
export { FlexTypedValue };
export var FlexDirection;
(function (FlexDirection) {
FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN";

View File

@ -10,7 +10,8 @@ export const BOTTOM = (END | SPECIFIED) << SHIFT_Y;
export const CENTER_X = SPECIFIED << SHIFT_X;
export const CENTER_Y = SPECIFIED << SHIFT_Y;
export const CENTER = CENTER_X | CENTER_Y;
export class Gravity {
let Gravity = /** @class */ (() => {
class Gravity {
constructor() {
this.val = 0;
}
@ -68,6 +69,9 @@ Gravity.Left = Gravity.origin.left();
Gravity.Right = Gravity.origin.right();
Gravity.Top = Gravity.origin.top();
Gravity.Bottom = Gravity.origin.bottom();
return Gravity;
})();
export { Gravity };
export function gravity() {
return new Gravity;
}

View File

@ -25,12 +25,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { Property, View } from "../ui/view";
import { Stack } from "../widget/layouts";
import { layoutConfig } from "../util/layoutconfig";
export class Draggable extends Stack {
let Draggable = /** @class */ (() => {
class Draggable extends Stack {
}
__decorate([
Property,
__metadata("design:type", Function)
], Draggable.prototype, "onDrag", void 0);
return Draggable;
})();
export { Draggable };
export function draggable(views, config) {
const ret = new Draggable;
ret.layoutConfig = layoutConfig().fit();

View File

@ -25,13 +25,18 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { Stack } from './layouts';
import { Property, Superview, View } from '../ui/view';
import { layoutConfig } from '../util/index.util';
export class FlowLayoutItem extends Stack {
let FlowLayoutItem = /** @class */ (() => {
class FlowLayoutItem extends Stack {
}
__decorate([
Property,
__metadata("design:type", String)
], FlowLayoutItem.prototype, "identifier", void 0);
export class FlowLayout extends Superview {
return FlowLayoutItem;
})();
export { FlowLayoutItem };
let FlowLayout = /** @class */ (() => {
class FlowLayout extends Superview {
constructor() {
super(...arguments);
this.cachedViews = new Map;
@ -124,6 +129,9 @@ __decorate([
Property,
__metadata("design:type", Function)
], FlowLayout.prototype, "onScrollEnd", void 0);
return FlowLayout;
})();
export { FlowLayout };
export function flowlayout(config) {
const ret = new FlowLayout;
for (let key in config) {

View File

@ -31,7 +31,8 @@ export var ScaleType;
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
ScaleType[ScaleType["ScaleAspectFill"] = 2] = "ScaleAspectFill";
})(ScaleType || (ScaleType = {}));
export class Image extends View {
let Image = /** @class */ (() => {
class Image extends View {
}
__decorate([
Property,
@ -98,6 +99,9 @@ __decorate([
Property,
__metadata("design:type", Object)
], Image.prototype, "stretchInset", void 0);
return Image;
})();
export { Image };
export function image(config) {
const ret = new Image;
ret.layoutConfig = layoutConfig().fit();

View File

@ -26,7 +26,8 @@ import { View, Property } from "../ui/view";
import { Color } from "../util/color";
import { Gravity } from "../util/gravity";
import { layoutConfig } from "../util/index.util";
export class Input extends View {
let Input = /** @class */ (() => {
class Input extends View {
getText(context) {
return this.nativeChannel(context, 'getText')();
}
@ -83,6 +84,9 @@ __decorate([
Property,
__metadata("design:type", Number)
], Input.prototype, "maxLength", void 0);
return Input;
})();
export { Input };
export function input(config) {
const ret = new Input;
ret.layoutConfig = layoutConfig().just();

View File

@ -29,6 +29,7 @@ export class Stack extends Group {
}
export class Root extends Stack {
}
let LinearLayout = /** @class */ (() => {
class LinearLayout extends Group {
}
__decorate([
@ -39,6 +40,8 @@ __decorate([
Property,
__metadata("design:type", Gravity)
], LinearLayout.prototype, "gravity", void 0);
return LinearLayout;
})();
export class VLayout extends LinearLayout {
}
export class HLayout extends LinearLayout {

View File

@ -25,13 +25,18 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { View, Property, Superview } from "../ui/view";
import { Stack } from "./layouts";
import { layoutConfig } from "../util/layoutconfig";
export class ListItem extends Stack {
let ListItem = /** @class */ (() => {
class ListItem extends Stack {
}
__decorate([
Property,
__metadata("design:type", String)
], ListItem.prototype, "identifier", void 0);
export class List extends Superview {
return ListItem;
})();
export { ListItem };
let List = /** @class */ (() => {
class List extends Superview {
constructor() {
super(...arguments);
this.cachedViews = new Map;
@ -48,8 +53,7 @@ export class List extends Superview {
}
}
scrollToItem(context, index, config) {
var _a;
const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
const animated = config === null || config === void 0 ? void 0 : config.animated;
return this.nativeChannel(context, 'scrollToItem')({ index, animated, });
}
reset() {
@ -120,6 +124,9 @@ __decorate([
Property,
__metadata("design:type", Number)
], List.prototype, "scrolledPosition", void 0);
return List;
})();
export { List };
export function list(config) {
const ret = new List;
for (let key in config) {

View File

@ -23,7 +23,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
* limitations under the License.
*/
import { Group, Property } from '../ui/view';
export class NestedSlider extends Group {
let NestedSlider = /** @class */ (() => {
class NestedSlider extends Group {
addSlideItem(view) {
this.addChild(view);
}
@ -38,3 +39,6 @@ __decorate([
Property,
__metadata("design:type", Function)
], NestedSlider.prototype, "onPageSlided", void 0);
return NestedSlider;
})();
export { NestedSlider };

View File

@ -9,7 +9,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
};
import { Property, Superview } from "../ui/view";
import { layoutConfig } from "../util/layoutconfig";
export class Refreshable extends Superview {
let Refreshable = /** @class */ (() => {
class Refreshable extends Superview {
allSubviews() {
const ret = [this.content];
if (this.header) {
@ -39,6 +40,9 @@ __decorate([
Property,
__metadata("design:type", Function)
], Refreshable.prototype, "onRefresh", void 0);
return Refreshable;
})();
export { Refreshable };
export function refreshable(config) {
const ret = new Refreshable;
ret.layoutConfig = layoutConfig().fit();

View File

@ -35,7 +35,8 @@ export function scroller(content, config) {
v.content = content;
});
}
export class Scroller extends Superview {
let Scroller = /** @class */ (() => {
class Scroller extends Superview {
allSubviews() {
return [this.content];
}
@ -62,3 +63,6 @@ __decorate([
Property,
__metadata("design:type", Function)
], Scroller.prototype, "onScrollEnd", void 0);
return Scroller;
})();
export { Scroller };

View File

@ -25,13 +25,18 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { Superview, View, Property } from "../ui/view";
import { Stack } from "./layouts";
import { layoutConfig } from "../util/layoutconfig";
export class SlideItem extends Stack {
let SlideItem = /** @class */ (() => {
class SlideItem extends Stack {
}
__decorate([
Property,
__metadata("design:type", String)
], SlideItem.prototype, "identifier", void 0);
export class Slider extends Superview {
return SlideItem;
})();
export { SlideItem };
let Slider = /** @class */ (() => {
class Slider extends Superview {
constructor() {
super(...arguments);
this.cachedViews = new Map;
@ -90,6 +95,9 @@ __decorate([
Property,
__metadata("design:type", Boolean)
], Slider.prototype, "loop", void 0);
return Slider;
})();
export { Slider };
export function slider(config) {
const ret = new Slider;
for (let key in config) {

View File

@ -25,7 +25,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
import { View, Property } from "../ui/view";
import { Color } from "../util/color";
import { layoutConfig } from "../util/index.util";
export class Switch extends View {
let Switch = /** @class */ (() => {
class Switch extends View {
}
__decorate([
Property,
@ -47,6 +48,9 @@ __decorate([
Property,
__metadata("design:type", Color)
], Switch.prototype, "thumbTintColor", void 0);
return Switch;
})();
export { Switch };
export function switchView(config) {
const ret = new Switch;
ret.layoutConfig = layoutConfig().just();

View File

@ -33,7 +33,8 @@ export var TruncateAt;
TruncateAt[TruncateAt["Start"] = 2] = "Start";
TruncateAt[TruncateAt["Clip"] = 3] = "Clip";
})(TruncateAt || (TruncateAt = {}));
export class Text extends View {
let Text = /** @class */ (() => {
class Text extends View {
}
__decorate([
Property,
@ -91,6 +92,9 @@ __decorate([
Property,
__metadata("design:type", Number)
], Text.prototype, "truncateAt", void 0);
return Text;
})();
export { Text };
export function text(config) {
const ret = new Text;
ret.layoutConfig = layoutConfig().fit();

View File

@ -29,7 +29,7 @@
"reflect-metadata": "^0.1.13",
"rollup": "^1.29.0",
"tslib": "^1.10.0",
"typescript": "^3.7.4",
"typescript": "^3.9.2",
"ws": "^7.2.1"
},
"publishConfig": {

View File

@ -27,7 +27,6 @@ export default [
plugins: [
resolve({ mainFields: ["jsnext"] }),
],
external: ['reflect-metadata'],
onwarn: function (warning) {
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
console.warn(warning.message);
@ -80,7 +79,6 @@ export default [
transforms: { dangerousForOf: true }
}),
],
external: ['reflect-metadata'],
onwarn: function (warning) {
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
console.warn(warning.message);

View File

@ -13,8 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from 'reflect-metadata'
export type BridgeContext = {
/**
* The identify of current context