@visactor/vrender 1.1.0-alpha.6 → 1.1.0-alpha.8
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 +207 -70
- package/dist/index.js +207 -70
- 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 +7 -7
package/dist/index.js
CHANGED
|
@@ -8651,11 +8651,23 @@
|
|
|
8651
8651
|
if (!hasAnimation) return plan;
|
|
8652
8652
|
const noWorkAnimateAttr = Object.assign(Object.assign({}, null !== (_a = options.noWorkAnimateAttr) && void 0 !== _a ? _a : {}), normalizeNoAnimateAttrConfig(null === (_b = options.animateConfig) || void 0 === _b ? void 0 : _b.noAnimateAttrs)),
|
|
8653
8653
|
isClear = !0 === options.isClear,
|
|
8654
|
-
getDefaultAttribute = options.getDefaultAttribute
|
|
8654
|
+
getDefaultAttribute = options.getDefaultAttribute,
|
|
8655
|
+
shouldSkipDefaultAttribute = options.shouldSkipDefaultAttribute,
|
|
8656
|
+
assignTransitionAttr = (key, value) => {
|
|
8657
|
+
if (noWorkAnimateAttr[key]) return plan.jumpAttrs[key] = value, void (plan.noAnimateAttrs[key] = value);
|
|
8658
|
+
if (isClear && void 0 === value) {
|
|
8659
|
+
if (null == shouldSkipDefaultAttribute ? void 0 : shouldSkipDefaultAttribute(key, targetAttrs)) return;
|
|
8660
|
+
plan.animateAttrs[key] = getDefaultAttribute ? getDefaultAttribute(key) : value;
|
|
8661
|
+
} else plan.animateAttrs[key] = value;
|
|
8662
|
+
};
|
|
8655
8663
|
for (const key in targetAttrs) {
|
|
8656
8664
|
if (!Object.prototype.hasOwnProperty.call(targetAttrs, key)) continue;
|
|
8657
|
-
|
|
8658
|
-
|
|
8665
|
+
assignTransitionAttr(key, targetAttrs[key]);
|
|
8666
|
+
}
|
|
8667
|
+
const extraAnimateAttrs = options.extraAnimateAttrs;
|
|
8668
|
+
if (extraAnimateAttrs) for (const key in extraAnimateAttrs) {
|
|
8669
|
+
const hasTargetAttr = Object.prototype.hasOwnProperty.call(targetAttrs, key);
|
|
8670
|
+
!Object.prototype.hasOwnProperty.call(extraAnimateAttrs, key) || hasTargetAttr && void 0 !== targetAttrs[key] || assignTransitionAttr(key, extraAnimateAttrs[key]);
|
|
8659
8671
|
}
|
|
8660
8672
|
return plan;
|
|
8661
8673
|
}
|
|
@@ -8682,12 +8694,14 @@
|
|
|
8682
8694
|
}), plan;
|
|
8683
8695
|
}
|
|
8684
8696
|
applyClearTransition(graphic, targetAttrs, hasAnimation, stateNames, options = {}) {
|
|
8685
|
-
var _a, _b;
|
|
8697
|
+
var _a, _b, _c, _d;
|
|
8686
8698
|
const plan = this.analyzeTransition({}, targetAttrs, stateNames, hasAnimation, {
|
|
8687
8699
|
noWorkAnimateAttr: null === (_a = graphic.getNoWorkAnimateAttr) || void 0 === _a ? void 0 : _a.call(graphic),
|
|
8688
8700
|
isClear: !0,
|
|
8689
8701
|
getDefaultAttribute: null === (_b = graphic.getDefaultAttribute) || void 0 === _b ? void 0 : _b.bind(graphic),
|
|
8690
|
-
|
|
8702
|
+
shouldSkipDefaultAttribute: null !== (_c = options.shouldSkipDefaultAttribute) && void 0 !== _c ? _c : null === (_d = graphic.shouldSkipStateTransitionDefaultAttribute) || void 0 === _d ? void 0 : _d.bind(graphic),
|
|
8703
|
+
animateConfig: options.animateConfig,
|
|
8704
|
+
extraAnimateAttrs: options.extraAnimateAttrs
|
|
8691
8705
|
});
|
|
8692
8706
|
return this.applyTransition(graphic, plan, hasAnimation, options);
|
|
8693
8707
|
}
|
|
@@ -9035,13 +9049,22 @@
|
|
|
9035
9049
|
"deep" === this.stateMergeMode && isPlainObjectValue(previousValue) && isPlainObjectValue(nextValue) ? snapshot[key] = deepMergeAttributeValue(previousValue, nextValue) : snapshot[key] = cloneAttributeValue(nextValue);
|
|
9036
9050
|
}), snapshot) : snapshot;
|
|
9037
9051
|
}
|
|
9038
|
-
|
|
9039
|
-
const
|
|
9040
|
-
if (!previousResolvedStatePatch) return
|
|
9041
|
-
const snapshot = this.buildStaticAttributeSnapshot()
|
|
9052
|
+
buildRemovedStateAnimationAttrs(targetStateAttrs, previousResolvedStatePatch) {
|
|
9053
|
+
const extraAttrs = {};
|
|
9054
|
+
if (!previousResolvedStatePatch) return extraAttrs;
|
|
9055
|
+
const snapshot = this.buildStaticAttributeSnapshot(),
|
|
9056
|
+
staticTargetAttrs = snapshot;
|
|
9042
9057
|
return Object.keys(previousResolvedStatePatch).forEach(key => {
|
|
9043
|
-
|
|
9044
|
-
|
|
9058
|
+
const hasTargetAttr = Object.prototype.hasOwnProperty.call(targetStateAttrs, key);
|
|
9059
|
+
if (hasTargetAttr && void 0 !== targetStateAttrs[key]) return;
|
|
9060
|
+
const assignFallbackAttr = value => {
|
|
9061
|
+
void 0 === value && this.shouldSkipStateTransitionDefaultAttribute(key, staticTargetAttrs) || (extraAttrs[key] = void 0 === value ? value : cloneAttributeValue(value));
|
|
9062
|
+
};
|
|
9063
|
+
if (hasTargetAttr) assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));else if (Object.prototype.hasOwnProperty.call(snapshot, key)) {
|
|
9064
|
+
const snapshotValue = snapshot[key];
|
|
9065
|
+
assignFallbackAttr(void 0 === snapshotValue ? this.getStateTransitionDefaultAttribute(key, staticTargetAttrs) : snapshotValue);
|
|
9066
|
+
} else assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));
|
|
9067
|
+
}), extraAttrs;
|
|
9045
9068
|
}
|
|
9046
9069
|
syncObjectToSnapshot(target, snapshot) {
|
|
9047
9070
|
const delta = new Map();
|
|
@@ -9464,21 +9487,31 @@
|
|
|
9464
9487
|
var _a, _b, _c;
|
|
9465
9488
|
return null !== (_c = null !== (_a = null != animateConfig ? animateConfig : this.stateAnimateConfig) && void 0 !== _a ? _a : null === (_b = this.context) || void 0 === _b ? void 0 : _b.stateAnimateConfig) && void 0 !== _c ? _c : DefaultStateAnimateConfig;
|
|
9466
9489
|
}
|
|
9467
|
-
applyStateAttrs(attrs, stateNames, hasAnimation, isClear, animateConfig) {
|
|
9490
|
+
applyStateAttrs(attrs, stateNames, hasAnimation, isClear, animateConfig, extraAnimateAttrs) {
|
|
9468
9491
|
const resolvedAnimateConfig = hasAnimation ? this.resolveStateAnimateConfig(animateConfig) : void 0,
|
|
9469
9492
|
transitionOptions = resolvedAnimateConfig ? {
|
|
9470
|
-
animateConfig: resolvedAnimateConfig
|
|
9493
|
+
animateConfig: resolvedAnimateConfig,
|
|
9494
|
+
extraAnimateAttrs: extraAnimateAttrs,
|
|
9495
|
+
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
|
|
9471
9496
|
} : void 0;
|
|
9472
9497
|
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, stateNames, transitionOptions);
|
|
9473
9498
|
const plan = this.getStateTransitionOrchestrator().analyzeTransition({}, attrs, stateNames, hasAnimation, {
|
|
9474
9499
|
noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
|
|
9475
|
-
animateConfig: resolvedAnimateConfig
|
|
9500
|
+
animateConfig: resolvedAnimateConfig,
|
|
9501
|
+
extraAnimateAttrs: extraAnimateAttrs,
|
|
9502
|
+
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
|
|
9476
9503
|
});
|
|
9477
9504
|
this.getStateTransitionOrchestrator().applyTransition(this, plan, hasAnimation, transitionOptions);
|
|
9478
9505
|
}
|
|
9479
9506
|
updateNormalAttrs(stateAttrs) {
|
|
9480
9507
|
this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);
|
|
9481
9508
|
}
|
|
9509
|
+
getStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
9510
|
+
return this.getDefaultAttribute(key);
|
|
9511
|
+
}
|
|
9512
|
+
shouldSkipStateTransitionDefaultAttribute(_key, _targetAttrs) {
|
|
9513
|
+
return !1;
|
|
9514
|
+
}
|
|
9482
9515
|
stopStateAnimates(type = "end") {
|
|
9483
9516
|
const stopAnimationState = this.stopAnimationState;
|
|
9484
9517
|
if ("function" == typeof stopAnimationState) return void stopAnimationState.call(this, "state", type);
|
|
@@ -9495,13 +9528,14 @@
|
|
|
9495
9528
|
clearStates(hasAnimation) {
|
|
9496
9529
|
var _a, _b, _c;
|
|
9497
9530
|
const previousStates = this.currentStates ? this.currentStates.slice() : [],
|
|
9531
|
+
previousResolvedStatePatch = this.resolvedStatePatch ? cloneAttributeValue(this.resolvedStatePatch) : void 0,
|
|
9498
9532
|
transition = this.createStateModel().clearStates();
|
|
9499
9533
|
if (!transition.changed && 0 === previousStates.length) return this.currentStates = [], this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, void this.clearSharedStateActiveRegistrations();
|
|
9500
9534
|
const resolvedStateAttrs = cloneAttributeValue(null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : {});
|
|
9501
9535
|
transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), null === (_b = getStageStatePerfMonitor(this.stage)) || void 0 === _b || _b.incrementCounter("stateCommits"), null === (_c = getStageStatePerfMonitor(this.stage)) || void 0 === _c || _c.recordEvent("state-commit", {
|
|
9502
9536
|
graphicId: this._uid,
|
|
9503
9537
|
targetStates: []
|
|
9504
|
-
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0)) : (this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
9538
|
+
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
9505
9539
|
type: exports.AttributeUpdateType.STATE
|
|
9506
9540
|
}), this._emitCustomEvent("afterStateUpdate", {
|
|
9507
9541
|
type: exports.AttributeUpdateType.STATE
|
|
@@ -9534,7 +9568,7 @@
|
|
|
9534
9568
|
this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs), this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), null === (_d = getStageStatePerfMonitor(this.stage)) || void 0 === _d || _d.incrementCounter("stateCommits"), null === (_e = getStageStatePerfMonitor(this.stage)) || void 0 === _e || _e.recordEvent("state-commit", {
|
|
9535
9569
|
graphicId: this._uid,
|
|
9536
9570
|
targetStates: [...transition.states]
|
|
9537
|
-
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(
|
|
9571
|
+
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
9538
9572
|
type: exports.AttributeUpdateType.STATE
|
|
9539
9573
|
}), this._emitCustomEvent("afterStateUpdate", {
|
|
9540
9574
|
type: exports.AttributeUpdateType.STATE
|
|
@@ -10966,6 +11000,52 @@
|
|
|
10966
11000
|
needUpdateTag(key) {
|
|
10967
11001
|
return super.needUpdateTag(key, RECT_UPDATE_TAG_KEY);
|
|
10968
11002
|
}
|
|
11003
|
+
shouldSkipStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
11004
|
+
var _a;
|
|
11005
|
+
const attrs = null !== (_a = null != targetAttrs ? targetAttrs : this.baseAttributes) && void 0 !== _a ? _a : this.attribute,
|
|
11006
|
+
hasValue = attrKey => null != attrs[attrKey],
|
|
11007
|
+
isNilValue = attrKey => null == attrs[attrKey];
|
|
11008
|
+
switch (key) {
|
|
11009
|
+
case "width":
|
|
11010
|
+
return isNilValue("width") && hasValue("x") && hasValue("x1");
|
|
11011
|
+
case "height":
|
|
11012
|
+
return isNilValue("height") && hasValue("y") && hasValue("y1");
|
|
11013
|
+
case "x1":
|
|
11014
|
+
return isNilValue("x1") && hasValue("x") && hasValue("width");
|
|
11015
|
+
case "y1":
|
|
11016
|
+
return isNilValue("y1") && hasValue("y") && hasValue("height");
|
|
11017
|
+
default:
|
|
11018
|
+
return !1;
|
|
11019
|
+
}
|
|
11020
|
+
}
|
|
11021
|
+
getStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
11022
|
+
var _a;
|
|
11023
|
+
const attrs = null !== (_a = null != targetAttrs ? targetAttrs : this.baseAttributes) && void 0 !== _a ? _a : this.attribute,
|
|
11024
|
+
getNumber = attrKey => {
|
|
11025
|
+
const value = attrs[attrKey];
|
|
11026
|
+
return "number" == typeof value && Number.isFinite(value) ? value : void 0;
|
|
11027
|
+
},
|
|
11028
|
+
x = getNumber("x"),
|
|
11029
|
+
y = getNumber("y"),
|
|
11030
|
+
x1 = getNumber("x1"),
|
|
11031
|
+
y1 = getNumber("y1"),
|
|
11032
|
+
width = getNumber("width"),
|
|
11033
|
+
height = getNumber("height");
|
|
11034
|
+
switch (key) {
|
|
11035
|
+
case "width":
|
|
11036
|
+
if (null == width && null != x && null != x1) return x1 - x;
|
|
11037
|
+
break;
|
|
11038
|
+
case "height":
|
|
11039
|
+
if (null == height && null != y && null != y1) return y1 - y;
|
|
11040
|
+
break;
|
|
11041
|
+
case "x1":
|
|
11042
|
+
if (null == x1 && null != x && null != width) return x + width;
|
|
11043
|
+
break;
|
|
11044
|
+
case "y1":
|
|
11045
|
+
if (null == y1 && null != y && null != height) return y + height;
|
|
11046
|
+
}
|
|
11047
|
+
return super.getStateTransitionDefaultAttribute(key, targetAttrs);
|
|
11048
|
+
}
|
|
10969
11049
|
toCustomPath() {
|
|
10970
11050
|
let path = super.toCustomPath();
|
|
10971
11051
|
if (path) return path;
|
|
@@ -32841,7 +32921,7 @@
|
|
|
32841
32921
|
if (nextTime >= this._startTime + this._totalDuration) {
|
|
32842
32922
|
null === (_a = this._lastStep) || void 0 === _a || _a.onUpdate(!0, 1, {}), null === (_b = this._lastStep) || void 0 === _b || _b.onEnd(), this.onEnd(), this.status = exports.AnimateStatus.END;
|
|
32843
32923
|
const trackerTarget = this.target;
|
|
32844
|
-
return
|
|
32924
|
+
return "function" == typeof (null == trackerTarget ? void 0 : trackerTarget.restoreStaticAttribute) && trackerTarget.restoreStaticAttribute(), void (this.__skipRestoreStaticAttributeOnRemove = !0);
|
|
32845
32925
|
}
|
|
32846
32926
|
this.status = exports.AnimateStatus.RUNNING, this.currentTime <= this._startTime && this.onStart(), this.currentTime = nextTime;
|
|
32847
32927
|
let cycleTime = nextTime - this._startTime,
|
|
@@ -40784,6 +40864,20 @@
|
|
|
40784
40864
|
}
|
|
40785
40865
|
}
|
|
40786
40866
|
|
|
40867
|
+
function commitUpdateAnimationTarget(graphic, targetAttrs, startAttrs) {
|
|
40868
|
+
var _a, _b, _c, _d;
|
|
40869
|
+
if (!graphic || !targetAttrs) return;
|
|
40870
|
+
const committedTargetAttrs = cloneDeep(targetAttrs),
|
|
40871
|
+
transientStartAttrs = cloneDeep(null != startAttrs ? startAttrs : graphic.attribute);
|
|
40872
|
+
graphic.setAttributes(committedTargetAttrs);
|
|
40873
|
+
const baseAttributes = graphic.baseAttributes;
|
|
40874
|
+
baseAttributes && "object" == typeof baseAttributes && Object.keys(committedTargetAttrs).forEach(key => {
|
|
40875
|
+
baseAttributes[key] = cloneDeep(committedTargetAttrs[key]);
|
|
40876
|
+
}), null === (_b = (_a = graphic).setFinalAttributes) || void 0 === _b || _b.call(_a, committedTargetAttrs), null === (_d = (_c = graphic).setAttributesAndPreventAnimate) || void 0 === _d || _d.call(_c, transientStartAttrs, !1, {
|
|
40877
|
+
type: exports.AttributeUpdateType.ANIMATE_BIND
|
|
40878
|
+
});
|
|
40879
|
+
}
|
|
40880
|
+
|
|
40787
40881
|
const DefaultAxisAnimation = {
|
|
40788
40882
|
type: "default",
|
|
40789
40883
|
duration: 300,
|
|
@@ -41109,33 +41203,29 @@
|
|
|
41109
41203
|
var _a;
|
|
41110
41204
|
if ("group" !== el.type && el.id) {
|
|
41111
41205
|
const oldEl = prevInnerView[el.id];
|
|
41112
|
-
if (
|
|
41206
|
+
if (oldEl) {
|
|
41113
41207
|
oldEl.release();
|
|
41114
|
-
const oldAttrs = oldEl.attribute,
|
|
41115
|
-
finalAttrs = el.
|
|
41208
|
+
const oldAttrs = cloneDeep(oldEl.attribute),
|
|
41209
|
+
finalAttrs = cloneDeep(el.attribute),
|
|
41116
41210
|
diffAttrs = diff(oldAttrs, finalAttrs);
|
|
41117
41211
|
let hasDiff = Object.keys(diffAttrs).length > 0;
|
|
41118
|
-
|
|
41119
|
-
|
|
41120
|
-
|
|
41121
|
-
|
|
41122
|
-
|
|
41123
|
-
|
|
41124
|
-
|
|
41125
|
-
|
|
41126
|
-
|
|
41127
|
-
|
|
41128
|
-
|
|
41129
|
-
|
|
41130
|
-
|
|
41131
|
-
|
|
41132
|
-
|
|
41133
|
-
|
|
41134
|
-
|
|
41135
|
-
}
|
|
41136
|
-
})
|
|
41137
|
-
}]);
|
|
41138
|
-
}
|
|
41212
|
+
"opacity" in oldAttrs && finalAttrs.opacity !== oldAttrs.opacity && (diffAttrs.opacity = null !== (_a = finalAttrs.opacity) && void 0 !== _a ? _a : 1, hasDiff = !0), animationConfig.update && hasDiff && (this._newElementAttrMap[el.id] = {
|
|
41213
|
+
state: "update",
|
|
41214
|
+
node: el,
|
|
41215
|
+
attrs: finalAttrs
|
|
41216
|
+
}, commitUpdateAnimationTarget(el, finalAttrs, oldAttrs), el.applyAnimationState(["update"], [{
|
|
41217
|
+
name: "update",
|
|
41218
|
+
animation: Object.assign(Object.assign({
|
|
41219
|
+
selfOnly: !0
|
|
41220
|
+
}, animationConfig.update), {
|
|
41221
|
+
type: "axisUpdate",
|
|
41222
|
+
customParameters: {
|
|
41223
|
+
config: animationConfig.update,
|
|
41224
|
+
diffAttrs: diffAttrs,
|
|
41225
|
+
lastScale: lastScale
|
|
41226
|
+
}
|
|
41227
|
+
})
|
|
41228
|
+
}]));
|
|
41139
41229
|
} else animationConfig.enter && (this._newElementAttrMap[el.id] = {
|
|
41140
41230
|
state: "enter",
|
|
41141
41231
|
node: el,
|
|
@@ -41479,7 +41569,10 @@
|
|
|
41479
41569
|
const point = getTickCoord(lastScale.scale(currData.rawValue)),
|
|
41480
41570
|
newX = this.target.attribute.x,
|
|
41481
41571
|
newY = this.target.attribute.y;
|
|
41482
|
-
this.target
|
|
41572
|
+
commitUpdateAnimationTarget(this.target, {
|
|
41573
|
+
x: newX,
|
|
41574
|
+
y: newY
|
|
41575
|
+
}, {
|
|
41483
41576
|
x: point.x,
|
|
41484
41577
|
y: point.y
|
|
41485
41578
|
}), animator.animate(this.target, {
|
|
@@ -41507,10 +41600,9 @@
|
|
|
41507
41600
|
const duration = this.duration,
|
|
41508
41601
|
easing = this.easing,
|
|
41509
41602
|
{
|
|
41510
|
-
config: config,
|
|
41511
41603
|
diffAttrs: diffAttrs
|
|
41512
41604
|
} = this.params;
|
|
41513
|
-
animator.animate(this.target, {
|
|
41605
|
+
commitUpdateAnimationTarget(this.target, Object.assign({}, diffAttrs)), animator.animate(this.target, {
|
|
41514
41606
|
type: "to",
|
|
41515
41607
|
to: Object.assign({}, diffAttrs),
|
|
41516
41608
|
duration: duration,
|
|
@@ -42395,6 +42487,7 @@
|
|
|
42395
42487
|
super(...arguments), this.mode = exports.AnimateMode.NORMAL;
|
|
42396
42488
|
}
|
|
42397
42489
|
onBind() {
|
|
42490
|
+
this._started = !1;
|
|
42398
42491
|
const currentInnerView = this.target.getInnerView(),
|
|
42399
42492
|
prevInnerView = this.target.getPrevInnerView();
|
|
42400
42493
|
prevInnerView && (this._newElementAttrMap = {}, traverseGroup(currentInnerView, el => {
|
|
@@ -42412,7 +42505,7 @@
|
|
|
42412
42505
|
fillOpacity: null !== (_b = newProps.fillOpacity) && void 0 !== _b ? _b : 1,
|
|
42413
42506
|
strokeOpacity: null !== (_c = newProps.strokeOpacity) && void 0 !== _c ? _c : 1
|
|
42414
42507
|
})
|
|
42415
|
-
}, el.
|
|
42508
|
+
}, commitUpdateAnimationTarget(el, this._newElementAttrMap[el.id].attrs, cloneDeep(oldEl.attribute));
|
|
42416
42509
|
}
|
|
42417
42510
|
} else {
|
|
42418
42511
|
const finalOpacityAttrs = {
|
|
@@ -42424,7 +42517,7 @@
|
|
|
42424
42517
|
state: "enter",
|
|
42425
42518
|
node: el,
|
|
42426
42519
|
attrs: finalOpacityAttrs
|
|
42427
|
-
}, el
|
|
42520
|
+
}, commitUpdateAnimationTarget(el, finalOpacityAttrs, {
|
|
42428
42521
|
opacity: 0,
|
|
42429
42522
|
fillOpacity: 0,
|
|
42430
42523
|
strokeOpacity: 0
|
|
@@ -42434,6 +42527,8 @@
|
|
|
42434
42527
|
}));
|
|
42435
42528
|
}
|
|
42436
42529
|
onStart() {
|
|
42530
|
+
if (this._started) return;
|
|
42531
|
+
this._started = !0;
|
|
42437
42532
|
let duration = this.duration,
|
|
42438
42533
|
easing = this.easing;
|
|
42439
42534
|
this._newElementAttrMap && Object.keys(this._newElementAttrMap).forEach(id => {
|
|
@@ -44530,7 +44625,7 @@
|
|
|
44530
44625
|
text: curText,
|
|
44531
44626
|
labelLine: curLabelLine
|
|
44532
44627
|
} = currentLabel;
|
|
44533
|
-
prevText.applyAnimationState(["update"], [{
|
|
44628
|
+
commitUpdateAnimationTarget(prevText, null == curText ? void 0 : curText.attribute), commitUpdateAnimationTarget(prevLabelLine, null == curLabelLine ? void 0 : curLabelLine.attribute), prevText.applyAnimationState(["update"], [{
|
|
44534
44629
|
name: "update",
|
|
44535
44630
|
animation: {
|
|
44536
44631
|
type: "labelUpdate",
|
|
@@ -44556,7 +44651,6 @@
|
|
|
44556
44651
|
}
|
|
44557
44652
|
_updateLabel(prevLabel, currentLabel) {
|
|
44558
44653
|
const {
|
|
44559
|
-
text: prevText,
|
|
44560
44654
|
labelLine: prevLabelLine
|
|
44561
44655
|
} = prevLabel,
|
|
44562
44656
|
{
|
|
@@ -47125,7 +47219,10 @@
|
|
|
47125
47219
|
null === (_a = null == graphic ? void 0 : graphic.animates) || void 0 === _a || _a.forEach(a => a.stop("end"));
|
|
47126
47220
|
const fillOpacityConfig = null !== (_c = null === (_b = graphic.attribute) || void 0 === _b ? void 0 : _b.fillOpacity) && void 0 !== _c ? _c : 1,
|
|
47127
47221
|
strokeOpacityConfig = null !== (_e = null === (_d = graphic.attribute) || void 0 === _d ? void 0 : _d.strokeOpacity) && void 0 !== _e ? _e : 1;
|
|
47128
|
-
graphic
|
|
47222
|
+
commitUpdateAnimationTarget(graphic, {
|
|
47223
|
+
fillOpacity: fillOpacityConfig,
|
|
47224
|
+
strokeOpacity: strokeOpacityConfig
|
|
47225
|
+
}, {
|
|
47129
47226
|
fillOpacity: 0,
|
|
47130
47227
|
strokeOpacity: 0
|
|
47131
47228
|
}), graphic.animate().wait(delay).to({
|
|
@@ -47141,7 +47238,10 @@
|
|
|
47141
47238
|
}
|
|
47142
47239
|
function graphicFadeOut(graphic, delay, duration, easing) {
|
|
47143
47240
|
var _a, _b, _c, _d;
|
|
47144
|
-
graphic && (graphic
|
|
47241
|
+
graphic && (commitUpdateAnimationTarget(graphic, {
|
|
47242
|
+
fillOpacity: 0,
|
|
47243
|
+
strokeOpacity: 0
|
|
47244
|
+
}, {
|
|
47145
47245
|
fillOpacity: null !== (_b = null === (_a = graphic.attribute) || void 0 === _a ? void 0 : _a.fillOpacity) && void 0 !== _b ? _b : 1,
|
|
47146
47246
|
strokeOpacity: null !== (_d = null === (_c = graphic.attribute) || void 0 === _c ? void 0 : _c.strokeOpacity) && void 0 !== _d ? _d : 1
|
|
47147
47247
|
}), graphic.animate().wait(delay).to({
|
|
@@ -47161,7 +47261,11 @@
|
|
|
47161
47261
|
lineDuration = .7 * duration,
|
|
47162
47262
|
endSymbolDuration = .1 * duration,
|
|
47163
47263
|
labelDuration = .1 * duration;
|
|
47164
|
-
graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing), line.lines.forEach(line =>
|
|
47264
|
+
graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing), line.lines.forEach(line => commitUpdateAnimationTarget(line, {
|
|
47265
|
+
clipRange: 1
|
|
47266
|
+
}, {
|
|
47267
|
+
clipRange: 0
|
|
47268
|
+
})), line.lines.forEach((l, index) => {
|
|
47165
47269
|
const stepDuration = lineDuration / line.lines.length;
|
|
47166
47270
|
l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
|
|
47167
47271
|
clipRange: 1
|
|
@@ -47219,7 +47323,11 @@
|
|
|
47219
47323
|
decorativeDuration = .05 * duration,
|
|
47220
47324
|
endSymbolDuration = .1 * duration,
|
|
47221
47325
|
labelDuration = .1 * duration;
|
|
47222
|
-
graphicFadeIn(itemLine.startSymbol, delay, startSymbolDuration, easing), itemLine.lines.forEach(line => line
|
|
47326
|
+
graphicFadeIn(itemLine.startSymbol, delay, startSymbolDuration, easing), itemLine.lines.forEach(line => commitUpdateAnimationTarget(line, {
|
|
47327
|
+
clipRange: 1
|
|
47328
|
+
}, {
|
|
47329
|
+
clipRange: 0
|
|
47330
|
+
})), itemLine.lines.forEach((l, index) => {
|
|
47223
47331
|
const stepDuration = lineDuration / itemLine.lines.length;
|
|
47224
47332
|
l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
|
|
47225
47333
|
clipRange: 1
|
|
@@ -49503,12 +49611,18 @@
|
|
|
49503
49611
|
let containerSize;
|
|
49504
49612
|
containerSize = this._itemContext.isHorizontal ? this._itemsContainer.AABBBounds.width() : this._itemsContainer.AABBBounds.height();
|
|
49505
49613
|
const startOffset = containerSize * start;
|
|
49506
|
-
this.updateScrollMask(), animation
|
|
49507
|
-
|
|
49508
|
-
|
|
49509
|
-
|
|
49510
|
-
|
|
49511
|
-
|
|
49614
|
+
if (this.updateScrollMask(), animation) {
|
|
49615
|
+
const attrs = {
|
|
49616
|
+
[channel]: -startOffset
|
|
49617
|
+
};
|
|
49618
|
+
commitUpdateAnimationTarget(this._itemsContainer, attrs), this._itemsContainer.animate().to(attrs, animationDuration, animationEasing);
|
|
49619
|
+
} else this._itemsContainer.setAttribute(channel, -startOffset);
|
|
49620
|
+
} else if (animation) {
|
|
49621
|
+
const attrs = {
|
|
49622
|
+
[channel]: -(newPage - 1) * pageSize
|
|
49623
|
+
};
|
|
49624
|
+
commitUpdateAnimationTarget(this._itemsContainer, attrs), this._itemsContainer.animate().to(attrs, animationDuration, animationEasing);
|
|
49625
|
+
} else this._itemsContainer.setAttribute(channel, -(newPage - 1) * pageSize);
|
|
49512
49626
|
}
|
|
49513
49627
|
};
|
|
49514
49628
|
if (this._itemContext.isScrollbar) {
|
|
@@ -52532,6 +52646,7 @@
|
|
|
52532
52646
|
setActive(labelGroup, activeLabelStyle), setActive(symbolGroup, activeSymbolStyle);
|
|
52533
52647
|
}
|
|
52534
52648
|
appearAnimate(animateConfig) {
|
|
52649
|
+
var _a;
|
|
52535
52650
|
const {
|
|
52536
52651
|
duration = 1e3,
|
|
52537
52652
|
easing = "quadOut"
|
|
@@ -52547,26 +52662,39 @@
|
|
|
52547
52662
|
perSymbolNormalDuration = 90 * percent,
|
|
52548
52663
|
symbolDelay = 100 * percent,
|
|
52549
52664
|
symbolNormalDelay = 600 * percent;
|
|
52550
|
-
if (this._line && (this._line
|
|
52665
|
+
if (this._line && (commitUpdateAnimationTarget(this._line, {
|
|
52666
|
+
clipRange: 1
|
|
52667
|
+
}, {
|
|
52551
52668
|
clipRange: 0
|
|
52552
52669
|
}), this._line.animate().to({
|
|
52553
52670
|
clipRange: 1
|
|
52554
|
-
}, lineDuration, easing)), this._activeLine
|
|
52555
|
-
opacity:
|
|
52556
|
-
|
|
52557
|
-
|
|
52558
|
-
|
|
52671
|
+
}, lineDuration, easing)), this._activeLine) {
|
|
52672
|
+
const opacity = null !== (_a = this._activeLine.attribute.opacity) && void 0 !== _a ? _a : 1;
|
|
52673
|
+
commitUpdateAnimationTarget(this._activeLine, {
|
|
52674
|
+
opacity: opacity
|
|
52675
|
+
}, {
|
|
52676
|
+
opacity: 0
|
|
52677
|
+
}), this._activeLine.animate().wait(500).to({
|
|
52678
|
+
opacity: opacity
|
|
52679
|
+
}, activeLineDuration, easing);
|
|
52680
|
+
}
|
|
52681
|
+
if (this._symbolGroup) {
|
|
52559
52682
|
const size = this._symbolGroup.count - 1,
|
|
52560
52683
|
delay = percent * (1 === size ? 0 : 400 / (size - 1)),
|
|
52561
52684
|
delayNormal = percent * (1 === size ? 0 : 240 / (size - 1));
|
|
52562
52685
|
this._symbolGroup.forEachChildren((symbol, i) => {
|
|
52686
|
+
var _a;
|
|
52563
52687
|
const originAttrs = {};
|
|
52564
52688
|
Object.keys(activeSymbolStyle).forEach(k => {
|
|
52565
52689
|
originAttrs[k] = symbol.attribute[k];
|
|
52566
|
-
})
|
|
52690
|
+
});
|
|
52691
|
+
const opacity = null !== (_a = symbol.attribute.opacity) && void 0 !== _a ? _a : 1;
|
|
52692
|
+
commitUpdateAnimationTarget(symbol, {
|
|
52693
|
+
opacity: opacity
|
|
52694
|
+
}, {
|
|
52567
52695
|
opacity: 0
|
|
52568
52696
|
}), symbol.animate().wait(symbolDelay + delay * i).to({
|
|
52569
|
-
opacity:
|
|
52697
|
+
opacity: opacity
|
|
52570
52698
|
}, perSymbolDuration, easing), symbol.animate().wait(symbolNormalDelay + delayNormal * i).to(Object.assign({}, activeSymbolStyle), perSymbolNormalDuration, easing).to(Object.assign({}, originAttrs), perSymbolNormalDuration, easing);
|
|
52571
52699
|
});
|
|
52572
52700
|
}
|
|
@@ -52575,13 +52703,18 @@
|
|
|
52575
52703
|
delay = percent * (1 === size ? 0 : 400 / (size - 1)),
|
|
52576
52704
|
delayNormal = percent * (1 === size ? 0 : 240 / (size - 1));
|
|
52577
52705
|
this._labelGroup.forEachChildren((label, i) => {
|
|
52706
|
+
var _a;
|
|
52578
52707
|
const originAttrs = {};
|
|
52579
52708
|
Object.keys(activeLabelStyle).forEach(k => {
|
|
52580
52709
|
originAttrs[k] = label.attribute[k];
|
|
52581
|
-
})
|
|
52710
|
+
});
|
|
52711
|
+
const opacity = null !== (_a = label.attribute.opacity) && void 0 !== _a ? _a : 1;
|
|
52712
|
+
commitUpdateAnimationTarget(label, {
|
|
52713
|
+
opacity: opacity
|
|
52714
|
+
}, {
|
|
52582
52715
|
opacity: 0
|
|
52583
52716
|
}), label.animate().wait(symbolDelay + delay * i).to({
|
|
52584
|
-
opacity:
|
|
52717
|
+
opacity: opacity
|
|
52585
52718
|
}, perSymbolDuration, easing), label.animate().wait(symbolNormalDelay + delayNormal * i).to(Object.assign({
|
|
52586
52719
|
dy: 10
|
|
52587
52720
|
}, activeLabelStyle), perSymbolNormalDuration, easing).to(Object.assign({
|
|
@@ -52615,7 +52748,11 @@
|
|
|
52615
52748
|
duration = 1e3,
|
|
52616
52749
|
easing = "quadOut"
|
|
52617
52750
|
} = animateConfig;
|
|
52618
|
-
this
|
|
52751
|
+
commitUpdateAnimationTarget(this, {
|
|
52752
|
+
clipRange: nextClipRange
|
|
52753
|
+
}, {
|
|
52754
|
+
clipRange: clipRange
|
|
52755
|
+
}), this.animate().to({
|
|
52619
52756
|
clipRange: nextClipRange
|
|
52620
52757
|
}, duration, easing);
|
|
52621
52758
|
} else this.setAttributes({
|
|
@@ -54334,7 +54471,7 @@
|
|
|
54334
54471
|
return resolveLegacyApp().createStage(params);
|
|
54335
54472
|
}
|
|
54336
54473
|
|
|
54337
|
-
const version = "1.1.0-alpha.
|
|
54474
|
+
const version = "1.1.0-alpha.8";
|
|
54338
54475
|
|
|
54339
54476
|
exports.AComponentAnimate = AComponentAnimate;
|
|
54340
54477
|
exports.ACustomAnimate = ACustomAnimate;
|