@visactor/vchart 2.1.5-alpha.1 → 2.1.5-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/build/index.js CHANGED
@@ -15707,6 +15707,11 @@
15707
15707
  }
15708
15708
  return !0;
15709
15709
  }
15710
+ hasStatePatch(patch) {
15711
+ if (!patch) return !1;
15712
+ for (const key in patch) if (Object.prototype.hasOwnProperty.call(patch, key)) return !0;
15713
+ return !1;
15714
+ }
15710
15715
  commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = !1) {
15711
15716
  var _a;
15712
15717
  const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
@@ -15774,15 +15779,17 @@
15774
15779
  transition = this.resolveClearStatesTransition();
15775
15780
  if (!transition.changed && 0 === previousStates.length) return this.currentStates = [], this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, void this.clearSharedStateActiveRegistrations();
15776
15781
  const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
15777
- if (!transition.changed || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0)) if (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), hasAnimation) {
15778
- this._syncFinalAttributeFromStaticTruth();
15779
- const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
15780
- this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.extraAttrs, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.stateTransitionTargetAttrs);
15781
- } else this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
15782
- type: AttributeUpdateType.STATE
15783
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
15784
- type: AttributeUpdateType.STATE
15785
- }), this.emitStateUpdateEvent();
15782
+ if (!transition.changed || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0)) if (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), this.attributeMayContainTransientAttrs || this.hasStatePatch(previousResolvedStatePatch)) {
15783
+ if (hasAnimation) {
15784
+ this._syncFinalAttributeFromStaticTruth();
15785
+ const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
15786
+ this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.extraAttrs, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.stateTransitionTargetAttrs);
15787
+ } else this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
15788
+ type: AttributeUpdateType.STATE
15789
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
15790
+ type: AttributeUpdateType.STATE
15791
+ }), this.emitStateUpdateEvent();
15792
+ } else this.emitStateUpdateEvent();
15786
15793
  }
15787
15794
  removeState(stateName, hasAnimation) {
15788
15795
  const transition = this.resolveRemoveStateTransition(stateName);
@@ -15823,15 +15830,17 @@
15823
15830
  effectiveStates: effectiveStates,
15824
15831
  resolvedStateAttrs: resolvedStateAttrs
15825
15832
  } = this.resolveGraphicStateTransition(states);
15826
- if ((transition.changed || !this.sameStateNames(previousStates, transition.states)) && this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) if (this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), hasAnimation) {
15827
- this._syncFinalAttributeFromStaticTruth();
15828
- const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
15829
- this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.extraAttrs, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.stateTransitionTargetAttrs);
15830
- } else this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
15831
- type: AttributeUpdateType.STATE
15832
- }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
15833
- type: AttributeUpdateType.STATE
15834
- }), this.emitStateUpdateEvent();
15833
+ if ((transition.changed || !this.sameStateNames(previousStates, transition.states)) && this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) if (this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.attributeMayContainTransientAttrs || this.hasStatePatch(previousResolvedStatePatch) || this.hasStatePatch(resolvedStateAttrs)) {
15834
+ if (hasAnimation) {
15835
+ this._syncFinalAttributeFromStaticTruth();
15836
+ const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
15837
+ this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.extraAttrs, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.stateTransitionTargetAttrs);
15838
+ } else this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
15839
+ type: AttributeUpdateType.STATE
15840
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
15841
+ type: AttributeUpdateType.STATE
15842
+ }), this.emitStateUpdateEvent();
15843
+ } else this.emitStateUpdateEvent();
15835
15844
  }
15836
15845
  invalidateResolver() {
15837
15846
  var _a, _b;