@visactor/vchart-extension 2.1.4-alpha.0 → 2.1.5-alpha.0
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 +46 -20
- package/build/index.min.js +1 -1
- package/package.json +7 -7
package/build/index.js
CHANGED
|
@@ -2914,7 +2914,7 @@
|
|
|
2914
2914
|
constructor() {
|
|
2915
2915
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
2916
2916
|
}
|
|
2917
|
-
onParentSharedStateTreeChanged(_stage, _layer) {}
|
|
2917
|
+
onParentSharedStateTreeChanged(_stage, _layer, _inheritedSharedStateScope) {}
|
|
2918
2918
|
forEachChildren(cb, reverse = !1) {
|
|
2919
2919
|
if (reverse) {
|
|
2920
2920
|
let child = this._lastChild,
|
|
@@ -7415,14 +7415,17 @@
|
|
|
7415
7415
|
}
|
|
7416
7416
|
return null === (_a = this.stage) || void 0 === _a ? void 0 : _a.rootSharedStateScope;
|
|
7417
7417
|
}
|
|
7418
|
-
|
|
7418
|
+
syncSharedStateScopeBinding(nextScope, markDirty = !0) {
|
|
7419
7419
|
var _a;
|
|
7420
|
-
const nextScope = this.resolveBoundSharedStateScope();
|
|
7421
7420
|
return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(), !1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.syncSharedStateActiveRegistrations(), markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(), !0);
|
|
7422
7421
|
}
|
|
7423
|
-
|
|
7422
|
+
syncSharedStateScopeBindingFromTree(markDirty = !0, inheritedSharedStateScope) {
|
|
7423
|
+
const nextScope = void 0 === inheritedSharedStateScope ? this.resolveBoundSharedStateScope() : null != inheritedSharedStateScope ? inheritedSharedStateScope : void 0;
|
|
7424
|
+
return this.syncSharedStateScopeBinding(nextScope, markDirty);
|
|
7425
|
+
}
|
|
7426
|
+
syncSharedStateScopeBindingOnTreeChange(markDirty = !0, inheritedSharedStateScope) {
|
|
7424
7427
|
var _a, _b;
|
|
7425
|
-
return !!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || this.boundSharedStateScope || (null === (_b = this.registeredActiveScopes) || void 0 === _b ? void 0 : _b.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingFromTree(markDirty);
|
|
7428
|
+
return !!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || this.boundSharedStateScope || (null === (_b = this.registeredActiveScopes) || void 0 === _b ? void 0 : _b.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingFromTree(markDirty, inheritedSharedStateScope);
|
|
7426
7429
|
}
|
|
7427
7430
|
syncSharedStateActiveRegistrations() {
|
|
7428
7431
|
var _a;
|
|
@@ -7430,6 +7433,7 @@
|
|
|
7430
7433
|
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.boundSharedStateScope) return (null == previousScopes ? void 0 : previousScopes.size) && (previousScopes.forEach(scope => {
|
|
7431
7434
|
scope.subtreeActiveDescendants.delete(this);
|
|
7432
7435
|
}), previousScopes.clear()), void (this.registeredActiveScopes = void 0);
|
|
7436
|
+
if ((null == previousScopes ? void 0 : previousScopes.size) && this.isSharedStateScopeChainRegistered(previousScopes)) return;
|
|
7433
7437
|
const nextScopes = new Set(collectSharedStateScopeChain(this.boundSharedStateScope));
|
|
7434
7438
|
null == previousScopes || previousScopes.forEach(scope => {
|
|
7435
7439
|
nextScopes.has(scope) || scope.subtreeActiveDescendants.delete(this);
|
|
@@ -7437,6 +7441,15 @@
|
|
|
7437
7441
|
scope.subtreeActiveDescendants.add(this);
|
|
7438
7442
|
}), this.registeredActiveScopes = nextScopes;
|
|
7439
7443
|
}
|
|
7444
|
+
isSharedStateScopeChainRegistered(previousScopes) {
|
|
7445
|
+
let scope = this.boundSharedStateScope,
|
|
7446
|
+
scopeCount = 0;
|
|
7447
|
+
for (; scope;) {
|
|
7448
|
+
if (!previousScopes.has(scope)) return !1;
|
|
7449
|
+
scopeCount += 1, scope = scope.parentScope;
|
|
7450
|
+
}
|
|
7451
|
+
return scopeCount === previousScopes.size;
|
|
7452
|
+
}
|
|
7440
7453
|
clearSharedStateActiveRegistrations() {
|
|
7441
7454
|
const previousScopes = this.registeredActiveScopes;
|
|
7442
7455
|
previousScopes && (previousScopes.forEach(scope => {
|
|
@@ -7446,8 +7459,8 @@
|
|
|
7446
7459
|
markSharedStateDirty() {
|
|
7447
7460
|
this.sharedStateDirty = !0, enqueueGraphicSharedStateRefresh(this.stage, this), scheduleStageSharedStateRefresh(this.stage);
|
|
7448
7461
|
}
|
|
7449
|
-
onParentSharedStateTreeChanged(stage, layer) {
|
|
7450
|
-
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange() : this.setStage(stage, layer);
|
|
7462
|
+
onParentSharedStateTreeChanged(stage, layer, inheritedSharedStateScope) {
|
|
7463
|
+
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange(!0, inheritedSharedStateScope) : this.setStage(stage, layer, inheritedSharedStateScope);
|
|
7451
7464
|
}
|
|
7452
7465
|
refreshSharedStateBeforeRender() {
|
|
7453
7466
|
var _a;
|
|
@@ -8098,6 +8111,10 @@
|
|
|
8098
8111
|
var _a;
|
|
8099
8112
|
return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
|
|
8100
8113
|
}
|
|
8114
|
+
setStateDefinitionsWithCompiled(definitions, compiledDefinitions) {
|
|
8115
|
+
var _a;
|
|
8116
|
+
this.states = definitions, this.localStateDefinitionsSource !== definitions && (this.localStateDefinitionsSource = definitions, this.localStateDefinitionsVersion = (null !== (_a = this.localStateDefinitionsVersion) && void 0 !== _a ? _a : 0) + 1), this.compiledStateDefinitions = compiledDefinitions, this.compiledStateDefinitionsCacheKey = `local:${this.localStateDefinitionsVersion}`;
|
|
8117
|
+
}
|
|
8101
8118
|
getStateResolveBaseAttrs() {
|
|
8102
8119
|
var _a;
|
|
8103
8120
|
return null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
@@ -8445,12 +8462,12 @@
|
|
|
8445
8462
|
this._globalTransMatrix.translate(scrollX, scrollY);
|
|
8446
8463
|
}
|
|
8447
8464
|
}
|
|
8448
|
-
setStage(stage, layer) {
|
|
8465
|
+
setStage(stage, layer, inheritedSharedStateScope) {
|
|
8449
8466
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
8450
8467
|
const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService,
|
|
8451
8468
|
previousStage = this.stage;
|
|
8452
8469
|
if (this.stage !== stage || this.layer !== layer) {
|
|
8453
|
-
if (this.stage = stage, this.layer = layer, ((null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0), this.setStageToShadowRoot(stage, layer), this.mayHaveTrackedAnimates() && this.hasAnyTrackedAnimate()) {
|
|
8470
|
+
if (this.stage = stage, this.layer = layer, ((null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0, inheritedSharedStateScope), this.setStageToShadowRoot(stage, layer), this.mayHaveTrackedAnimates() && this.hasAnyTrackedAnimate()) {
|
|
8454
8471
|
const previousTimeline = null === (_f = null == previousStage ? void 0 : previousStage.getTimeline) || void 0 === _f ? void 0 : _f.call(previousStage),
|
|
8455
8472
|
nextTimeline = null === (_g = null == stage ? void 0 : stage.getTimeline) || void 0 === _g ? void 0 : _g.call(stage),
|
|
8456
8473
|
detachedStageAnimates = [];
|
|
@@ -8467,7 +8484,7 @@
|
|
|
8467
8484
|
}
|
|
8468
8485
|
return this._onSetStage && this._onSetStage(this, stage, layer), void (null === (_h = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _h || _h.call(graphicService, this, stage));
|
|
8469
8486
|
}
|
|
8470
|
-
((null === (_j = this.currentStates) || void 0 === _j ? void 0 : _j.length) || this.boundSharedStateScope || (null === (_k = this.registeredActiveScopes) || void 0 === _k ? void 0 : _k.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0);
|
|
8487
|
+
((null === (_j = this.currentStates) || void 0 === _j ? void 0 : _j.length) || this.boundSharedStateScope || (null === (_k = this.registeredActiveScopes) || void 0 === _k ? void 0 : _k.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0, inheritedSharedStateScope);
|
|
8471
8488
|
}
|
|
8472
8489
|
detachStageForRelease() {
|
|
8473
8490
|
var _a, _b, _c;
|
|
@@ -8889,13 +8906,13 @@
|
|
|
8889
8906
|
child.setStage(null, null);
|
|
8890
8907
|
}), this.addUpdateBoundTag();
|
|
8891
8908
|
}
|
|
8892
|
-
setStage(stage, layer) {
|
|
8909
|
+
setStage(stage, layer, inheritedSharedStateScope) {
|
|
8893
8910
|
var _a, _b, _c, _d, _e, _f;
|
|
8894
8911
|
const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService,
|
|
8895
8912
|
needsSharedStateTreeSync = this.hasSharedStateDefinitions() || this.sharedStateScope || (null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty;
|
|
8896
|
-
if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0)), this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), null === (_f = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _f || _f.call(graphicService, this, stage), void this.notifyChildrenSharedStateTreeChanged();
|
|
8913
|
+
if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0, inheritedSharedStateScope)), this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), null === (_f = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _f || _f.call(graphicService, this, stage), void this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope);
|
|
8897
8914
|
const layerChanged = this.layer !== layer;
|
|
8898
|
-
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0), this.notifyChildrenSharedStateTreeChanged()) : layerChanged && this.notifyChildrenSharedStateTreeChanged();
|
|
8915
|
+
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0, inheritedSharedStateScope), this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope)) : layerChanged && this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope);
|
|
8899
8916
|
}
|
|
8900
8917
|
addUpdatePositionTag() {
|
|
8901
8918
|
super.addUpdatePositionTag(), this.forEachChildren(g => {
|
|
@@ -8954,17 +8971,26 @@
|
|
|
8954
8971
|
hasSharedStateDefinitions() {
|
|
8955
8972
|
return !!this._sharedStateDefinitions && Object.keys(this._sharedStateDefinitions).length > 0;
|
|
8956
8973
|
}
|
|
8957
|
-
|
|
8974
|
+
resolveChildSharedStateScope(inheritedSharedStateScope) {
|
|
8975
|
+
var _a;
|
|
8976
|
+
return this.sharedStateScope ? this.sharedStateScope : void 0 !== inheritedSharedStateScope ? inheritedSharedStateScope : null !== (_a = this.resolveBoundSharedStateScope()) && void 0 !== _a ? _a : null;
|
|
8977
|
+
}
|
|
8978
|
+
notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope) {
|
|
8979
|
+
const childSharedStateScope = this.resolveChildSharedStateScope(inheritedSharedStateScope);
|
|
8958
8980
|
this.forEachChildren(item => {
|
|
8959
|
-
this.
|
|
8981
|
+
this.setStageToChild(item, childSharedStateScope);
|
|
8960
8982
|
});
|
|
8961
8983
|
}
|
|
8962
|
-
|
|
8963
|
-
child
|
|
8984
|
+
setStageToChild(child, inheritedSharedStateScope) {
|
|
8985
|
+
const graphic = child;
|
|
8986
|
+
"function" != typeof graphic.setStage || child.onParentSharedStateTreeChanged !== Graphic.prototype.onParentSharedStateTreeChanged && child.onParentSharedStateTreeChanged !== Group.prototype.onParentSharedStateTreeChanged || graphic.stage === this.stage && graphic.layer === this.layer ? child.onParentSharedStateTreeChanged(this.stage, this.layer, inheritedSharedStateScope) : graphic.setStage(this.stage, this.layer, inheritedSharedStateScope);
|
|
8987
|
+
}
|
|
8988
|
+
syncChildSharedStateTreeBinding(child, inheritedSharedStateScope) {
|
|
8989
|
+
void 0 === inheritedSharedStateScope && (inheritedSharedStateScope = this.resolveChildSharedStateScope()), this.setStageToChild(child, inheritedSharedStateScope);
|
|
8964
8990
|
}
|
|
8965
|
-
onParentSharedStateTreeChanged(stage, layer) {
|
|
8991
|
+
onParentSharedStateTreeChanged(stage, layer, inheritedSharedStateScope) {
|
|
8966
8992
|
var _a;
|
|
8967
|
-
this.stage === stage && this.layer === layer ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)), this.notifyChildrenSharedStateTreeChanged()) : this.setStage(stage, layer);
|
|
8993
|
+
this.stage === stage && this.layer === layer ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length), inheritedSharedStateScope), this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope)) : this.setStage(stage, layer, inheritedSharedStateScope);
|
|
8968
8994
|
}
|
|
8969
8995
|
}
|
|
8970
8996
|
Group.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
|
|
@@ -10316,7 +10342,7 @@
|
|
|
10316
10342
|
}
|
|
10317
10343
|
|
|
10318
10344
|
var _a;
|
|
10319
|
-
const factoryRegistryKey = Symbol.for("@visactor/vchart/factory-registry@2.1.
|
|
10345
|
+
const factoryRegistryKey = Symbol.for("@visactor/vchart/factory-registry@2.1.4"),
|
|
10320
10346
|
globalFactoryRegistry = globalThis;
|
|
10321
10347
|
const factoryRegistry = null !== (_a = globalFactoryRegistry[factoryRegistryKey]) && void 0 !== _a ? _a : globalFactoryRegistry[factoryRegistryKey] = {
|
|
10322
10348
|
charts: {},
|