@visactor/vrender 1.0.0-alpha.1 → 1.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +73 -31
- package/dist/index.js +73 -31
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -16889,7 +16889,7 @@
|
|
|
16889
16889
|
}
|
|
16890
16890
|
initAnimate(params) {
|
|
16891
16891
|
var _a;
|
|
16892
|
-
this.createTicker && this.createTimeline && (this.ticker = params.ticker || this.createTicker(this), "
|
|
16892
|
+
this.createTicker && this.createTimeline && (this.ticker = params.ticker || this.createTicker(this), "performance" === (null === (_a = this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) && this.ticker.setFPS(30), this.timeline = this.createTimeline(), this.ticker.addTimeline(this.timeline), this.ticker.on("tick", this.afterTickCb));
|
|
16893
16893
|
}
|
|
16894
16894
|
startAnimate() {
|
|
16895
16895
|
this.ticker && this.timeline && (this.ticker.start(), this.timeline.resume());
|
|
@@ -30099,10 +30099,12 @@
|
|
|
30099
30099
|
function noop() {}
|
|
30100
30100
|
class Step {
|
|
30101
30101
|
constructor(type, props, duration, easing) {
|
|
30102
|
-
this._startTime = 0, this._hasFirstRun = !1, this.
|
|
30102
|
+
this._startTime = 0, this._hasFirstRun = !1, this._syncAttributeUpdate = () => {
|
|
30103
|
+
this.target.setAttributes(this.target.attribute);
|
|
30104
|
+
}, this.type = type, this.props = props, this.duration = duration, this.easing = easing ? "function" == typeof easing ? easing : Easing[easing] : Easing.linear, "wait" === type && (this.onUpdate = noop), this.id = Generator.GenAutoIncrementId(), this.syncAttributeUpdate = noop;
|
|
30103
30105
|
}
|
|
30104
30106
|
bind(target, animate) {
|
|
30105
|
-
this.target = target, this.animate = animate, this.onBind();
|
|
30107
|
+
this.target = target, this.animate = animate, this.onBind(), this.syncAttributeUpdate();
|
|
30106
30108
|
}
|
|
30107
30109
|
append(step) {
|
|
30108
30110
|
this.next = step, step.prev = this, step.setStartTime(this.getStartTime() + this.duration, !1);
|
|
@@ -30145,7 +30147,9 @@
|
|
|
30145
30147
|
getStartTime() {
|
|
30146
30148
|
return this._startTime;
|
|
30147
30149
|
}
|
|
30148
|
-
onBind() {
|
|
30150
|
+
onBind() {
|
|
30151
|
+
"glyph" === this.target.type && (this.syncAttributeUpdate = this._syncAttributeUpdate);
|
|
30152
|
+
}
|
|
30149
30153
|
onFirstRun() {}
|
|
30150
30154
|
onStart() {
|
|
30151
30155
|
if (!this._hasFirstRun) {
|
|
@@ -30185,7 +30189,7 @@
|
|
|
30185
30189
|
if (!this.animate.validAttr(this.propKeys[index])) return;
|
|
30186
30190
|
const key = this.propKeys[index];
|
|
30187
30191
|
func(key, this.fromProps[key], this.props[key], easedRatio, this, this.target);
|
|
30188
|
-
}), this.onUpdate(end, easedRatio, out);
|
|
30192
|
+
}), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
|
|
30189
30193
|
}
|
|
30190
30194
|
onUpdate(end, ratio, out) {}
|
|
30191
30195
|
onEnd(cb) {
|
|
@@ -30886,6 +30890,7 @@
|
|
|
30886
30890
|
delayAfterValue = isFunction$1(delayAfter) ? delayAfter(null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, {}) : delayAfter;
|
|
30887
30891
|
delayValue > 0 && animate.wait(delayValue);
|
|
30888
30892
|
(Array.isArray(effects) ? effects : [effects]).forEach(effect => {
|
|
30893
|
+
var _a, _b;
|
|
30889
30894
|
const {
|
|
30890
30895
|
type = "fromTo",
|
|
30891
30896
|
channel: channel,
|
|
@@ -30896,7 +30901,10 @@
|
|
|
30896
30901
|
let parsedFromProps = null,
|
|
30897
30902
|
props = effect.to,
|
|
30898
30903
|
from = effect.from;
|
|
30899
|
-
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from)
|
|
30904
|
+
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
|
|
30905
|
+
const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
|
|
30906
|
+
customType = null !== (_b = effect.customType) && void 0 !== _b ? _b : custom && isFunction$1(custom) ? /^class\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2 : 0;
|
|
30907
|
+
this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, options, type, graphic);
|
|
30900
30908
|
}), delayAfterValue > 0 && animate.wait(delayAfterValue);
|
|
30901
30909
|
}
|
|
30902
30910
|
createCustomInterpolatorAnimation(animate, interpolator, props, duration, easing, customParams) {
|
|
@@ -31168,7 +31176,7 @@
|
|
|
31168
31176
|
update(end, ratio, out) {
|
|
31169
31177
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
31170
31178
|
const easedRatio = this.easing(ratio);
|
|
31171
|
-
this.onUpdate(end, easedRatio, out);
|
|
31179
|
+
this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
|
|
31172
31180
|
}
|
|
31173
31181
|
setProps(props) {
|
|
31174
31182
|
this.props = props, this.propKeys = Object.keys(props), this.animate.reSyncProps();
|
|
@@ -31362,7 +31370,7 @@
|
|
|
31362
31370
|
super(null, null, duration, easing, params), this.clipFromAttribute = from, this.clipToAttribute = to, this._group = null == params ? void 0 : params.group, this._clipGraphic = null == params ? void 0 : params.clipGraphic;
|
|
31363
31371
|
}
|
|
31364
31372
|
onBind() {
|
|
31365
|
-
this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip, this._lastPath = this._group.attribute.path, this._group.setAttributes({
|
|
31373
|
+
super.onBind(), this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip, this._lastPath = this._group.attribute.path, this._group.setAttributes({
|
|
31366
31374
|
clip: !0,
|
|
31367
31375
|
path: [this._clipGraphic]
|
|
31368
31376
|
}, !1, {
|
|
@@ -31520,6 +31528,7 @@
|
|
|
31520
31528
|
return [];
|
|
31521
31529
|
}
|
|
31522
31530
|
onBind() {
|
|
31531
|
+
super.onBind();
|
|
31523
31532
|
const {
|
|
31524
31533
|
points: points,
|
|
31525
31534
|
segments: segments
|
|
@@ -31601,6 +31610,7 @@
|
|
|
31601
31610
|
}
|
|
31602
31611
|
onBind() {
|
|
31603
31612
|
var _a;
|
|
31613
|
+
super.onBind();
|
|
31604
31614
|
const attrs = this.target.getFinalAttribute(),
|
|
31605
31615
|
fromAttrs = null !== (_a = this.target.attribute) && void 0 !== _a ? _a : {},
|
|
31606
31616
|
to = {},
|
|
@@ -31627,6 +31637,7 @@
|
|
|
31627
31637
|
super(from, to, duration, easing, params);
|
|
31628
31638
|
}
|
|
31629
31639
|
onBind() {
|
|
31640
|
+
super.onBind();
|
|
31630
31641
|
const attrs = this.target.attribute,
|
|
31631
31642
|
to = {},
|
|
31632
31643
|
from = {};
|
|
@@ -31670,7 +31681,9 @@
|
|
|
31670
31681
|
let theta = Math.acos((startX - center.x) / r / Math.sin(phi));
|
|
31671
31682
|
startZ - center.z < 0 && (theta = pi2 - theta), this.theta = theta, this.phi = phi;
|
|
31672
31683
|
}
|
|
31673
|
-
onBind() {
|
|
31684
|
+
onBind() {
|
|
31685
|
+
super.onBind();
|
|
31686
|
+
}
|
|
31674
31687
|
onEnd() {}
|
|
31675
31688
|
onUpdate(end, ratio, out) {
|
|
31676
31689
|
if (null == this.phi || null == this.theta) return;
|
|
@@ -31834,6 +31847,7 @@
|
|
|
31834
31847
|
class GrowAngleIn extends GrowAngleBase {
|
|
31835
31848
|
onBind() {
|
|
31836
31849
|
var _a, _b;
|
|
31850
|
+
super.onBind();
|
|
31837
31851
|
const {
|
|
31838
31852
|
from: from,
|
|
31839
31853
|
to: to
|
|
@@ -31846,6 +31860,7 @@
|
|
|
31846
31860
|
}
|
|
31847
31861
|
class GrowAngleOut extends GrowAngleBase {
|
|
31848
31862
|
onBind() {
|
|
31863
|
+
super.onBind();
|
|
31849
31864
|
const {
|
|
31850
31865
|
from: from,
|
|
31851
31866
|
to: to
|
|
@@ -31984,6 +31999,7 @@
|
|
|
31984
31999
|
}
|
|
31985
32000
|
onBind() {
|
|
31986
32001
|
var _a, _b;
|
|
32002
|
+
super.onBind();
|
|
31987
32003
|
const {
|
|
31988
32004
|
from: from,
|
|
31989
32005
|
to: to
|
|
@@ -32008,6 +32024,7 @@
|
|
|
32008
32024
|
super(from, to, duration, easing, params);
|
|
32009
32025
|
}
|
|
32010
32026
|
onBind() {
|
|
32027
|
+
super.onBind();
|
|
32011
32028
|
const {
|
|
32012
32029
|
from: from,
|
|
32013
32030
|
to: to
|
|
@@ -32089,6 +32106,7 @@
|
|
|
32089
32106
|
}
|
|
32090
32107
|
onBind() {
|
|
32091
32108
|
var _a, _b;
|
|
32109
|
+
super.onBind();
|
|
32092
32110
|
const {
|
|
32093
32111
|
from: from,
|
|
32094
32112
|
to: to
|
|
@@ -32151,6 +32169,7 @@
|
|
|
32151
32169
|
super(from, to, duration, easing, params);
|
|
32152
32170
|
}
|
|
32153
32171
|
onBind() {
|
|
32172
|
+
super.onBind();
|
|
32154
32173
|
const {
|
|
32155
32174
|
from: from,
|
|
32156
32175
|
to: to
|
|
@@ -32203,7 +32222,7 @@
|
|
|
32203
32222
|
}
|
|
32204
32223
|
class GrowPointsIn extends GworPointsBase {
|
|
32205
32224
|
onBind() {
|
|
32206
|
-
if (["area", "line", "polygon"].includes(this.target.type)) {
|
|
32225
|
+
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
32207
32226
|
const {
|
|
32208
32227
|
from: from,
|
|
32209
32228
|
to: to
|
|
@@ -32216,7 +32235,7 @@
|
|
|
32216
32235
|
}
|
|
32217
32236
|
class GrowPointsOut extends GworPointsBase {
|
|
32218
32237
|
onBind() {
|
|
32219
|
-
if (["area", "line"].includes(this.target.type)) {
|
|
32238
|
+
if (super.onBind(), ["area", "line"].includes(this.target.type)) {
|
|
32220
32239
|
const attrs = this.target.getFinalAttribute(),
|
|
32221
32240
|
{
|
|
32222
32241
|
from: from,
|
|
@@ -32267,7 +32286,7 @@
|
|
|
32267
32286
|
};
|
|
32268
32287
|
class GrowPointsXIn extends GworPointsBase {
|
|
32269
32288
|
onBind() {
|
|
32270
|
-
if (["area", "line", "polygon"].includes(this.target.type)) {
|
|
32289
|
+
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
32271
32290
|
const {
|
|
32272
32291
|
from: from,
|
|
32273
32292
|
to: to
|
|
@@ -32280,7 +32299,7 @@
|
|
|
32280
32299
|
}
|
|
32281
32300
|
class GrowPointsXOut extends GworPointsBase {
|
|
32282
32301
|
onBind() {
|
|
32283
|
-
if (["area", "line"].includes(this.target.type)) {
|
|
32302
|
+
if (super.onBind(), ["area", "line"].includes(this.target.type)) {
|
|
32284
32303
|
const attrs = this.target.getFinalAttribute(),
|
|
32285
32304
|
{
|
|
32286
32305
|
from: from,
|
|
@@ -32331,7 +32350,7 @@
|
|
|
32331
32350
|
};
|
|
32332
32351
|
class GrowPointsYIn extends GworPointsBase {
|
|
32333
32352
|
onBind() {
|
|
32334
|
-
if (["area", "line", "polygon"].includes(this.target.type)) {
|
|
32353
|
+
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
32335
32354
|
const {
|
|
32336
32355
|
from: from,
|
|
32337
32356
|
to: to
|
|
@@ -32344,7 +32363,7 @@
|
|
|
32344
32363
|
}
|
|
32345
32364
|
class GrowPointsYOut extends GworPointsBase {
|
|
32346
32365
|
onBind() {
|
|
32347
|
-
if (["area", "line", "polygon"].includes(this.target.type)) {
|
|
32366
|
+
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
32348
32367
|
const {
|
|
32349
32368
|
from: from,
|
|
32350
32369
|
to: to
|
|
@@ -32444,6 +32463,7 @@
|
|
|
32444
32463
|
class GrowRadiusIn extends GrowPointsBase {
|
|
32445
32464
|
onBind() {
|
|
32446
32465
|
var _a, _b;
|
|
32466
|
+
super.onBind();
|
|
32447
32467
|
const {
|
|
32448
32468
|
from: from,
|
|
32449
32469
|
to: to
|
|
@@ -32456,6 +32476,7 @@
|
|
|
32456
32476
|
}
|
|
32457
32477
|
class GrowRadiusOut extends GrowPointsBase {
|
|
32458
32478
|
onBind() {
|
|
32479
|
+
super.onBind();
|
|
32459
32480
|
const {
|
|
32460
32481
|
to: to
|
|
32461
32482
|
} = (graphic = this.target, options = this.params.options, this.params, !1 !== (null !== (_a = null == options ? void 0 : options.overall) && void 0 !== _a && _a) ? growRadiusOutOverall(graphic, options) : growRadiusOutIndividual(graphic, options));
|
|
@@ -32566,6 +32587,7 @@
|
|
|
32566
32587
|
}
|
|
32567
32588
|
onBind() {
|
|
32568
32589
|
var _a, _b;
|
|
32590
|
+
super.onBind();
|
|
32569
32591
|
const {
|
|
32570
32592
|
from: from,
|
|
32571
32593
|
to: to
|
|
@@ -32590,6 +32612,7 @@
|
|
|
32590
32612
|
super(from, to, duration, easing, params);
|
|
32591
32613
|
}
|
|
32592
32614
|
onBind() {
|
|
32615
|
+
super.onBind();
|
|
32593
32616
|
const {
|
|
32594
32617
|
from: from,
|
|
32595
32618
|
to: to
|
|
@@ -32610,6 +32633,7 @@
|
|
|
32610
32633
|
|
|
32611
32634
|
class LabelItemAppear extends AComponentAnimate {
|
|
32612
32635
|
onBind() {
|
|
32636
|
+
super.onBind();
|
|
32613
32637
|
const animator = createComponentAnimator(this.target);
|
|
32614
32638
|
this._animator = animator;
|
|
32615
32639
|
const duration = this.duration,
|
|
@@ -32748,6 +32772,7 @@
|
|
|
32748
32772
|
}
|
|
32749
32773
|
class LabelItemDisappear extends AComponentAnimate {
|
|
32750
32774
|
onBind() {
|
|
32775
|
+
super.onBind();
|
|
32751
32776
|
const animator = createComponentAnimator(this.target);
|
|
32752
32777
|
this._animator = animator;
|
|
32753
32778
|
const duration = this.duration,
|
|
@@ -32830,6 +32855,7 @@
|
|
|
32830
32855
|
|
|
32831
32856
|
class PoptipAppear extends AComponentAnimate {
|
|
32832
32857
|
onBind() {
|
|
32858
|
+
super.onBind();
|
|
32833
32859
|
const animator = createComponentAnimator(this.target);
|
|
32834
32860
|
this._animator = animator;
|
|
32835
32861
|
const duration = this.duration,
|
|
@@ -32912,6 +32938,7 @@
|
|
|
32912
32938
|
}
|
|
32913
32939
|
class PoptipDisappear extends AComponentAnimate {
|
|
32914
32940
|
onBind() {
|
|
32941
|
+
super.onBind();
|
|
32915
32942
|
const animator = createComponentAnimator(this.target);
|
|
32916
32943
|
this._animator = animator;
|
|
32917
32944
|
const duration = this.duration,
|
|
@@ -33321,6 +33348,7 @@
|
|
|
33321
33348
|
onBind() {
|
|
33322
33349
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
33323
33350
|
let from, to;
|
|
33351
|
+
super.onBind();
|
|
33324
33352
|
const attrs = this.target.getFinalAttribute(),
|
|
33325
33353
|
fromAttrs = null !== (_a = this.target.attribute) && void 0 !== _a ? _a : {};
|
|
33326
33354
|
switch (null === (_b = this.params) || void 0 === _b ? void 0 : _b.direction) {
|
|
@@ -33378,6 +33406,7 @@
|
|
|
33378
33406
|
onBind() {
|
|
33379
33407
|
var _a, _b, _c, _d, _e;
|
|
33380
33408
|
let from, to;
|
|
33409
|
+
super.onBind();
|
|
33381
33410
|
const attrs = this.target.attribute;
|
|
33382
33411
|
switch (null === (_a = this.params) || void 0 === _a ? void 0 : _a.direction) {
|
|
33383
33412
|
case "x":
|
|
@@ -33427,7 +33456,7 @@
|
|
|
33427
33456
|
if (!this.animate.validAttr(this.propKeys[index])) return;
|
|
33428
33457
|
const key = this.propKeys[index];
|
|
33429
33458
|
func(key, this.fromProps[key], this.props[key], easedRatio, this, this.target);
|
|
33430
|
-
}), this.onUpdate(end, easedRatio, out);
|
|
33459
|
+
}), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
|
|
33431
33460
|
}
|
|
33432
33461
|
}
|
|
33433
33462
|
|
|
@@ -33437,6 +33466,7 @@
|
|
|
33437
33466
|
}
|
|
33438
33467
|
onBind() {
|
|
33439
33468
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
33469
|
+
super.onBind();
|
|
33440
33470
|
const attrs = this.target.getFinalAttribute(),
|
|
33441
33471
|
direction = (null === (_a = this.params) || void 0 === _a ? void 0 : _a.direction) || "right",
|
|
33442
33472
|
distance = (null === (_b = this.params) || void 0 === _b ? void 0 : _b.distance) || 50,
|
|
@@ -33464,6 +33494,7 @@
|
|
|
33464
33494
|
}
|
|
33465
33495
|
onBind() {
|
|
33466
33496
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
33497
|
+
super.onBind();
|
|
33467
33498
|
const attrs = this.target.getFinalAttribute(),
|
|
33468
33499
|
fromScale = null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromScale) && void 0 !== _b ? _b : 0,
|
|
33469
33500
|
direction = (null === (_c = this.params) || void 0 === _c ? void 0 : _c.direction) || "xy",
|
|
@@ -33491,6 +33522,7 @@
|
|
|
33491
33522
|
}
|
|
33492
33523
|
onBind() {
|
|
33493
33524
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
33525
|
+
super.onBind();
|
|
33494
33526
|
const attrs = this.target.getFinalAttribute(),
|
|
33495
33527
|
fromAngle = null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromAngle) && void 0 !== _b ? _b : 2 * Math.PI,
|
|
33496
33528
|
fromScale = null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.fromScale) && void 0 !== _d ? _d : 0,
|
|
@@ -33527,6 +33559,7 @@
|
|
|
33527
33559
|
}
|
|
33528
33560
|
onBind() {
|
|
33529
33561
|
var _a, _b, _c, _d, _e, _f;
|
|
33562
|
+
super.onBind();
|
|
33530
33563
|
const executor = new AnimateExecutor(this.target);
|
|
33531
33564
|
executor.execute({
|
|
33532
33565
|
type: "custom",
|
|
@@ -33562,6 +33595,7 @@
|
|
|
33562
33595
|
}
|
|
33563
33596
|
onBind() {
|
|
33564
33597
|
var _a, _b, _c, _d, _e, _f;
|
|
33598
|
+
super.onBind();
|
|
33565
33599
|
const executor = new AnimateExecutor(this.target);
|
|
33566
33600
|
executor.execute({
|
|
33567
33601
|
type: "custom",
|
|
@@ -33757,6 +33791,7 @@
|
|
|
33757
33791
|
}
|
|
33758
33792
|
onBind() {
|
|
33759
33793
|
var _a, _b;
|
|
33794
|
+
super.onBind();
|
|
33760
33795
|
let {
|
|
33761
33796
|
diffAttrs = {}
|
|
33762
33797
|
} = null !== (_a = this.target.context) && void 0 !== _a ? _a : {};
|
|
@@ -33889,6 +33924,7 @@
|
|
|
33889
33924
|
}
|
|
33890
33925
|
class MoveIn extends MoveBase {
|
|
33891
33926
|
onBind() {
|
|
33927
|
+
super.onBind();
|
|
33892
33928
|
const {
|
|
33893
33929
|
from: from,
|
|
33894
33930
|
to: to
|
|
@@ -33900,6 +33936,7 @@
|
|
|
33900
33936
|
}
|
|
33901
33937
|
class MoveOut extends MoveBase {
|
|
33902
33938
|
onBind() {
|
|
33939
|
+
super.onBind();
|
|
33903
33940
|
const {
|
|
33904
33941
|
from: from,
|
|
33905
33942
|
to: to
|
|
@@ -33947,6 +33984,7 @@
|
|
|
33947
33984
|
}
|
|
33948
33985
|
class RotateIn extends RotateBase {
|
|
33949
33986
|
onBind() {
|
|
33987
|
+
super.onBind();
|
|
33950
33988
|
const {
|
|
33951
33989
|
from: from,
|
|
33952
33990
|
to: to
|
|
@@ -33958,6 +33996,7 @@
|
|
|
33958
33996
|
}
|
|
33959
33997
|
class RotateOut extends RotateBase {
|
|
33960
33998
|
onBind() {
|
|
33999
|
+
super.onBind();
|
|
33961
34000
|
const {
|
|
33962
34001
|
from: from,
|
|
33963
34002
|
to: to
|
|
@@ -33968,33 +34007,36 @@
|
|
|
33968
34007
|
|
|
33969
34008
|
class FromTo extends ACustomAnimate {
|
|
33970
34009
|
constructor(from, to, duration, easing, params) {
|
|
33971
|
-
super(from, to, duration, easing, params), this.from = from
|
|
34010
|
+
super(from, to, duration, easing, params), this.from = null != from ? from : {};
|
|
33972
34011
|
}
|
|
33973
34012
|
onBind() {
|
|
34013
|
+
super.onBind();
|
|
34014
|
+
const finalAttribute = this.target.getFinalAttribute();
|
|
34015
|
+
Object.keys(this.from).forEach(key => {
|
|
34016
|
+
null == this.props[key] && (this.props[key] = finalAttribute[key]);
|
|
34017
|
+
});
|
|
34018
|
+
}
|
|
34019
|
+
onFirstRun() {
|
|
33974
34020
|
var _a;
|
|
33975
|
-
|
|
33976
|
-
|
|
33977
|
-
|
|
33978
|
-
toKeys = Object.keys(this.to);
|
|
33979
|
-
if (fromKeys.forEach(key => {
|
|
33980
|
-
var _a;
|
|
33981
|
-
null == this.to[key] && (this.to[key] = null !== (_a = finalAttribute[key]) && void 0 !== _a ? _a : 0);
|
|
33982
|
-
}), toKeys.forEach(key => {
|
|
34021
|
+
this.from = Object.assign(Object.assign({}, this.getLastProps()), this.from);
|
|
34022
|
+
const startProps = this.animate.getStartProps();
|
|
34023
|
+
if (this.propKeys && this.propKeys.forEach(key => {
|
|
33983
34024
|
var _a;
|
|
33984
|
-
|
|
33985
|
-
}),
|
|
34025
|
+
this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
|
|
34026
|
+
}), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState)) {
|
|
33986
34027
|
const finalAttribute = this.target.getFinalAttribute();
|
|
33987
34028
|
this.target.setAttributes(finalAttribute);
|
|
33988
34029
|
}
|
|
34030
|
+
this.target.setAttributes(this.from);
|
|
33989
34031
|
}
|
|
33990
34032
|
update(end, ratio, out) {
|
|
33991
34033
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
33992
34034
|
const easedRatio = this.easing(ratio);
|
|
33993
|
-
this.interpolateUpdateFunctions.forEach((func, index) => {
|
|
34035
|
+
this.animate.interpolateUpdateFunction ? this.animate.interpolateUpdateFunction(this.from, this.props, easedRatio, this, this.target) : this.interpolateUpdateFunctions.forEach((func, index) => {
|
|
33994
34036
|
if (!this.animate.validAttr(this.propKeys[index])) return;
|
|
33995
34037
|
const key = this.propKeys[index];
|
|
33996
|
-
func(key, this.from[key], this.
|
|
33997
|
-
});
|
|
34038
|
+
func(key, this.from[key], this.props[key], easedRatio, this, this.target);
|
|
34039
|
+
}), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
|
|
33998
34040
|
}
|
|
33999
34041
|
}
|
|
34000
34042
|
|
|
@@ -34002,7 +34044,7 @@
|
|
|
34002
34044
|
AnimateExecutor.registerBuiltInAnimate("increaseCount", IncreaseCount), AnimateExecutor.registerBuiltInAnimate("fromTo", FromTo), AnimateExecutor.registerBuiltInAnimate("scaleIn", ScaleIn), AnimateExecutor.registerBuiltInAnimate("scaleOut", ScaleOut), AnimateExecutor.registerBuiltInAnimate("growHeightIn", GrowHeightIn), AnimateExecutor.registerBuiltInAnimate("growHeightOut", GrowHeightOut), AnimateExecutor.registerBuiltInAnimate("growWidthIn", GrowWidthIn), AnimateExecutor.registerBuiltInAnimate("growWidthOut", GrowWidthOut), AnimateExecutor.registerBuiltInAnimate("growCenterIn", GrowCenterIn), AnimateExecutor.registerBuiltInAnimate("growCenterOut", GrowCenterOut), AnimateExecutor.registerBuiltInAnimate("clipIn", ClipIn), AnimateExecutor.registerBuiltInAnimate("clipOut", ClipOut), AnimateExecutor.registerBuiltInAnimate("fadeIn", FadeIn), AnimateExecutor.registerBuiltInAnimate("fadeOut", FadeOut), AnimateExecutor.registerBuiltInAnimate("growPointsIn", GrowPointsIn), AnimateExecutor.registerBuiltInAnimate("growPointsOut", GrowPointsOut), AnimateExecutor.registerBuiltInAnimate("growPointsXIn", GrowPointsXIn), AnimateExecutor.registerBuiltInAnimate("growPointsXOut", GrowPointsXOut), AnimateExecutor.registerBuiltInAnimate("growPointsYIn", GrowPointsYIn), AnimateExecutor.registerBuiltInAnimate("growPointsYOut", GrowPointsYOut), AnimateExecutor.registerBuiltInAnimate("growAngleIn", GrowAngleIn), AnimateExecutor.registerBuiltInAnimate("growAngleOut", GrowAngleOut), AnimateExecutor.registerBuiltInAnimate("growRadiusIn", GrowRadiusIn), AnimateExecutor.registerBuiltInAnimate("growRadiusOut", GrowRadiusOut), AnimateExecutor.registerBuiltInAnimate("moveIn", MoveIn), AnimateExecutor.registerBuiltInAnimate("moveOut", MoveOut), AnimateExecutor.registerBuiltInAnimate("rotateIn", RotateIn), AnimateExecutor.registerBuiltInAnimate("rotateOut", RotateOut), AnimateExecutor.registerBuiltInAnimate("update", Update), AnimateExecutor.registerBuiltInAnimate("state", State), AnimateExecutor.registerBuiltInAnimate("labelItemAppear", LabelItemAppear), AnimateExecutor.registerBuiltInAnimate("labelItemDisappear", LabelItemDisappear), AnimateExecutor.registerBuiltInAnimate("poptipAppear", PoptipAppear), AnimateExecutor.registerBuiltInAnimate("poptipDisappear", PoptipDisappear), AnimateExecutor.registerBuiltInAnimate("inputText", InputText), AnimateExecutor.registerBuiltInAnimate("inputRichText", InputRichText), AnimateExecutor.registerBuiltInAnimate("outputRichText", OutputRichText), AnimateExecutor.registerBuiltInAnimate("slideRichText", SlideRichText), AnimateExecutor.registerBuiltInAnimate("slideOutRichText", SlideOutRichText), AnimateExecutor.registerBuiltInAnimate("slideIn", SlideIn), AnimateExecutor.registerBuiltInAnimate("growIn", GrowIn), AnimateExecutor.registerBuiltInAnimate("spinIn", SpinIn), AnimateExecutor.registerBuiltInAnimate("moveScaleIn", MoveScaleIn), AnimateExecutor.registerBuiltInAnimate("moveRotateIn", MoveRotateIn), AnimateExecutor.registerBuiltInAnimate("slideOut", SlideOut), AnimateExecutor.registerBuiltInAnimate("growOut", GrowOut), AnimateExecutor.registerBuiltInAnimate("spinOut", SpinOut), AnimateExecutor.registerBuiltInAnimate("moveScaleOut", MoveScaleOut), AnimateExecutor.registerBuiltInAnimate("moveRotateOut", MoveRotateOut);
|
|
34003
34045
|
};
|
|
34004
34046
|
|
|
34005
|
-
const version = "1.0.0-alpha.
|
|
34047
|
+
const version = "1.0.0-alpha.2";
|
|
34006
34048
|
preLoadAllModule();
|
|
34007
34049
|
if (isBrowserEnv()) {
|
|
34008
34050
|
loadBrowserEnv(container);
|