@visactor/vrender 1.1.4-alpha.2 → 1.1.4-alpha.3
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 +54 -121
- package/dist/index.js +54 -121
- 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
|
@@ -2728,7 +2728,7 @@
|
|
|
2728
2728
|
constructor() {
|
|
2729
2729
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
2730
2730
|
}
|
|
2731
|
-
onParentSharedStateTreeChanged(_stage, _layer
|
|
2731
|
+
onParentSharedStateTreeChanged(_stage, _layer) {}
|
|
2732
2732
|
forEachChildren(cb, reverse = !1) {
|
|
2733
2733
|
if (reverse) {
|
|
2734
2734
|
let child = this._lastChild,
|
|
@@ -8038,8 +8038,6 @@
|
|
|
8038
8038
|
this.graphic === graphic && this.baseAttributes === baseAttributes || this.invalidateResolverCache(), this.graphic = graphic, this.baseAttributes = baseAttributes;
|
|
8039
8039
|
}
|
|
8040
8040
|
applyStates(stateNames) {
|
|
8041
|
-
const singleStaticStateResult = this.tryApplySingleStaticState(stateNames);
|
|
8042
|
-
if (singleStaticStateResult) return singleStaticStateResult;
|
|
8043
8041
|
const uniqueStates = Array.from(new Set(stateNames)),
|
|
8044
8042
|
sortedStates = this.sortStates(uniqueStates),
|
|
8045
8043
|
adjudicated = this.adjudicate(sortedStates),
|
|
@@ -8054,19 +8052,6 @@
|
|
|
8054
8052
|
suppressed: [...this._suppressed]
|
|
8055
8053
|
};
|
|
8056
8054
|
}
|
|
8057
|
-
tryApplySingleStaticState(stateNames) {
|
|
8058
|
-
if (1 !== stateNames.length || "shallow" !== this.mergeMode) return;
|
|
8059
|
-
const stateName = stateNames[0],
|
|
8060
|
-
definition = this.compiledDefinitions.get(stateName);
|
|
8061
|
-
if (definition && (definition.hasResolver || definition.exclude.size || definition.suppress.size)) return;
|
|
8062
|
-
const changed = 1 !== this._activeStates.length || this._activeStates[0] !== stateName || 1 !== this._effectiveStates.length || this._effectiveStates[0] !== stateName || 0 !== this._suppressed.length;
|
|
8063
|
-
return this._activeStates = [stateName], this._effectiveStates = [stateName], this._suppressed = [], !changed && this.resolverCacheValid || (this.resolverPatchCache.clear(), this.resolverCacheKey = stateName, this.resolverCacheValid = !0, this._resolvedPatch = (null == definition ? void 0 : definition.patch) ? cloneValue(definition.patch) : {}), {
|
|
8064
|
-
changed: changed,
|
|
8065
|
-
activeStates: [...this._activeStates],
|
|
8066
|
-
effectiveStates: [...this._effectiveStates],
|
|
8067
|
-
suppressed: []
|
|
8068
|
-
};
|
|
8069
|
-
}
|
|
8070
8055
|
addState(stateName, keepCurrentStates) {
|
|
8071
8056
|
if (this._activeStates.includes(stateName) && (keepCurrentStates || 1 === this._activeStates.length)) return {
|
|
8072
8057
|
changed: !1,
|
|
@@ -8502,17 +8487,14 @@
|
|
|
8502
8487
|
}
|
|
8503
8488
|
return null === (_a = this.stage) || void 0 === _a ? void 0 : _a.rootSharedStateScope;
|
|
8504
8489
|
}
|
|
8505
|
-
|
|
8490
|
+
syncSharedStateScopeBindingFromTree(markDirty = !0) {
|
|
8506
8491
|
var _a;
|
|
8492
|
+
const nextScope = this.resolveBoundSharedStateScope();
|
|
8507
8493
|
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);
|
|
8508
8494
|
}
|
|
8509
|
-
|
|
8510
|
-
const nextScope = void 0 === inheritedSharedStateScope ? this.resolveBoundSharedStateScope() : null != inheritedSharedStateScope ? inheritedSharedStateScope : void 0;
|
|
8511
|
-
return this.syncSharedStateScopeBinding(nextScope, markDirty);
|
|
8512
|
-
}
|
|
8513
|
-
syncSharedStateScopeBindingOnTreeChange(markDirty = !0, inheritedSharedStateScope) {
|
|
8495
|
+
syncSharedStateScopeBindingOnTreeChange(markDirty = !0) {
|
|
8514
8496
|
var _a, _b;
|
|
8515
|
-
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
|
|
8497
|
+
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);
|
|
8516
8498
|
}
|
|
8517
8499
|
syncSharedStateActiveRegistrations() {
|
|
8518
8500
|
var _a;
|
|
@@ -8520,7 +8502,6 @@
|
|
|
8520
8502
|
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.boundSharedStateScope) return (null == previousScopes ? void 0 : previousScopes.size) && (previousScopes.forEach(scope => {
|
|
8521
8503
|
scope.subtreeActiveDescendants.delete(this);
|
|
8522
8504
|
}), previousScopes.clear()), void (this.registeredActiveScopes = void 0);
|
|
8523
|
-
if ((null == previousScopes ? void 0 : previousScopes.size) && this.isSharedStateScopeChainRegistered(previousScopes)) return;
|
|
8524
8505
|
const nextScopes = new Set(collectSharedStateScopeChain(this.boundSharedStateScope));
|
|
8525
8506
|
null == previousScopes || previousScopes.forEach(scope => {
|
|
8526
8507
|
nextScopes.has(scope) || scope.subtreeActiveDescendants.delete(this);
|
|
@@ -8528,15 +8509,6 @@
|
|
|
8528
8509
|
scope.subtreeActiveDescendants.add(this);
|
|
8529
8510
|
}), this.registeredActiveScopes = nextScopes;
|
|
8530
8511
|
}
|
|
8531
|
-
isSharedStateScopeChainRegistered(previousScopes) {
|
|
8532
|
-
let scope = this.boundSharedStateScope,
|
|
8533
|
-
scopeCount = 0;
|
|
8534
|
-
for (; scope;) {
|
|
8535
|
-
if (!previousScopes.has(scope)) return !1;
|
|
8536
|
-
scopeCount += 1, scope = scope.parentScope;
|
|
8537
|
-
}
|
|
8538
|
-
return scopeCount === previousScopes.size;
|
|
8539
|
-
}
|
|
8540
8512
|
clearSharedStateActiveRegistrations() {
|
|
8541
8513
|
const previousScopes = this.registeredActiveScopes;
|
|
8542
8514
|
previousScopes && (previousScopes.forEach(scope => {
|
|
@@ -8546,8 +8518,8 @@
|
|
|
8546
8518
|
markSharedStateDirty() {
|
|
8547
8519
|
this.sharedStateDirty = !0, enqueueGraphicSharedStateRefresh(this.stage, this), scheduleStageSharedStateRefresh(this.stage);
|
|
8548
8520
|
}
|
|
8549
|
-
onParentSharedStateTreeChanged(stage, layer
|
|
8550
|
-
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange(
|
|
8521
|
+
onParentSharedStateTreeChanged(stage, layer) {
|
|
8522
|
+
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange() : this.setStage(stage, layer);
|
|
8551
8523
|
}
|
|
8552
8524
|
refreshSharedStateBeforeRender() {
|
|
8553
8525
|
var _a;
|
|
@@ -9198,10 +9170,6 @@
|
|
|
9198
9170
|
var _a;
|
|
9199
9171
|
return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
|
|
9200
9172
|
}
|
|
9201
|
-
setStateDefinitionsWithCompiled(definitions, compiledDefinitions) {
|
|
9202
|
-
var _a;
|
|
9203
|
-
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}`;
|
|
9204
|
-
}
|
|
9205
9173
|
getStateResolveBaseAttrs() {
|
|
9206
9174
|
var _a;
|
|
9207
9175
|
return null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
@@ -9395,10 +9363,8 @@
|
|
|
9395
9363
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
9396
9364
|
}
|
|
9397
9365
|
addState(stateName, keepCurrentStates, hasAnimation) {
|
|
9398
|
-
const
|
|
9399
|
-
|
|
9400
|
-
const nextStates = keepCurrentStates && (null == currentStates ? void 0 : currentStates.length) ? currentStates.concat([stateName]) : [stateName];
|
|
9401
|
-
this.useStates(nextStates, hasAnimation);
|
|
9366
|
+
const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
|
|
9367
|
+
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
9402
9368
|
}
|
|
9403
9369
|
setStates(states, options) {
|
|
9404
9370
|
var _a, _b, _c;
|
|
@@ -9551,12 +9517,12 @@
|
|
|
9551
9517
|
this._globalTransMatrix.translate(scrollX, scrollY);
|
|
9552
9518
|
}
|
|
9553
9519
|
}
|
|
9554
|
-
setStage(stage, layer
|
|
9520
|
+
setStage(stage, layer) {
|
|
9555
9521
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
9556
9522
|
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,
|
|
9557
9523
|
previousStage = this.stage;
|
|
9558
9524
|
if (this.stage !== stage || this.layer !== layer) {
|
|
9559
|
-
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
|
|
9525
|
+
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()) {
|
|
9560
9526
|
const previousTimeline = null === (_f = null == previousStage ? void 0 : previousStage.getTimeline) || void 0 === _f ? void 0 : _f.call(previousStage),
|
|
9561
9527
|
nextTimeline = null === (_g = null == stage ? void 0 : stage.getTimeline) || void 0 === _g ? void 0 : _g.call(stage),
|
|
9562
9528
|
detachedStageAnimates = [];
|
|
@@ -9573,7 +9539,7 @@
|
|
|
9573
9539
|
}
|
|
9574
9540
|
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));
|
|
9575
9541
|
}
|
|
9576
|
-
((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
|
|
9542
|
+
((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);
|
|
9577
9543
|
}
|
|
9578
9544
|
detachStageForRelease() {
|
|
9579
9545
|
var _a, _b, _c;
|
|
@@ -12147,8 +12113,8 @@
|
|
|
12147
12113
|
clone() {
|
|
12148
12114
|
return new RichText(Object.assign({}, this.attribute));
|
|
12149
12115
|
}
|
|
12150
|
-
setStage(stage, layer
|
|
12151
|
-
super.setStage(stage, layer
|
|
12116
|
+
setStage(stage, layer) {
|
|
12117
|
+
super.setStage(stage, layer);
|
|
12152
12118
|
this.getFrameCache().icons.forEach(icon => {
|
|
12153
12119
|
icon.setStage(stage, layer);
|
|
12154
12120
|
});
|
|
@@ -12819,17 +12785,17 @@
|
|
|
12819
12785
|
}
|
|
12820
12786
|
incrementalAppendChild(node) {
|
|
12821
12787
|
const data = super.appendChild(node);
|
|
12822
|
-
return data && this.
|
|
12788
|
+
return data && this.syncChildSharedStateTreeBinding(data), this.addUpdateBoundTag(), this.getGraphicService().onAddIncremental(node, this, this.stage), data;
|
|
12823
12789
|
}
|
|
12824
12790
|
incrementalClearChild() {
|
|
12825
12791
|
super.removeAllChild(), this.addUpdateBoundTag(), this.getGraphicService().onClearIncremental(this, this.stage);
|
|
12826
12792
|
}
|
|
12827
12793
|
_updateChildToStage(child) {
|
|
12828
|
-
return child && this.
|
|
12794
|
+
return child && this.syncChildSharedStateTreeBinding(child), this.addUpdateBoundTag(), child;
|
|
12829
12795
|
}
|
|
12830
12796
|
appendChild(node, addStage = !0) {
|
|
12831
12797
|
const data = super.appendChild(node);
|
|
12832
|
-
return data && addStage && this.
|
|
12798
|
+
return data && addStage && this.syncChildSharedStateTreeBinding(data), this.addUpdateBoundTag(), data;
|
|
12833
12799
|
}
|
|
12834
12800
|
insertBefore(newNode, referenceNode) {
|
|
12835
12801
|
return this._updateChildToStage(super.insertBefore(newNode, referenceNode));
|
|
@@ -12852,13 +12818,13 @@
|
|
|
12852
12818
|
child.setStage(null, null);
|
|
12853
12819
|
}), this.addUpdateBoundTag();
|
|
12854
12820
|
}
|
|
12855
|
-
setStage(stage, layer
|
|
12821
|
+
setStage(stage, layer) {
|
|
12856
12822
|
var _a, _b, _c, _d, _e, _f;
|
|
12857
12823
|
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,
|
|
12858
12824
|
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;
|
|
12859
|
-
if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0
|
|
12825
|
+
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();
|
|
12860
12826
|
const layerChanged = this.layer !== layer;
|
|
12861
|
-
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0
|
|
12827
|
+
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0), this.notifyChildrenSharedStateTreeChanged()) : layerChanged && this.notifyChildrenSharedStateTreeChanged();
|
|
12862
12828
|
}
|
|
12863
12829
|
addUpdatePositionTag() {
|
|
12864
12830
|
super.addUpdatePositionTag(), this.forEachChildren(g => {
|
|
@@ -12917,29 +12883,17 @@
|
|
|
12917
12883
|
hasSharedStateDefinitions() {
|
|
12918
12884
|
return !!this._sharedStateDefinitions && Object.keys(this._sharedStateDefinitions).length > 0;
|
|
12919
12885
|
}
|
|
12920
|
-
|
|
12921
|
-
var _a;
|
|
12922
|
-
return this.sharedStateScope ? this.sharedStateScope : void 0 !== inheritedSharedStateScope ? inheritedSharedStateScope : null !== (_a = this.resolveBoundSharedStateScope()) && void 0 !== _a ? _a : null;
|
|
12923
|
-
}
|
|
12924
|
-
notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope) {
|
|
12925
|
-
const childSharedStateScope = this.resolveChildSharedStateScope(inheritedSharedStateScope);
|
|
12886
|
+
notifyChildrenSharedStateTreeChanged() {
|
|
12926
12887
|
this.forEachChildren(item => {
|
|
12927
|
-
this.
|
|
12888
|
+
this.syncChildSharedStateTreeBinding(item);
|
|
12928
12889
|
});
|
|
12929
12890
|
}
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
}
|
|
12933
|
-
setStageToChild(child, inheritedSharedStateScope) {
|
|
12934
|
-
const graphic = child;
|
|
12935
|
-
"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);
|
|
12891
|
+
syncChildSharedStateTreeBinding(child) {
|
|
12892
|
+
child.onParentSharedStateTreeChanged(this.stage, this.layer);
|
|
12936
12893
|
}
|
|
12937
|
-
|
|
12938
|
-
void 0 === inheritedSharedStateScope && (inheritedSharedStateScope = this.resolveChildSharedStateScope()), this.setStageToChild(child, inheritedSharedStateScope);
|
|
12939
|
-
}
|
|
12940
|
-
onParentSharedStateTreeChanged(stage, layer, inheritedSharedStateScope) {
|
|
12894
|
+
onParentSharedStateTreeChanged(stage, layer) {
|
|
12941
12895
|
var _a;
|
|
12942
|
-
this.stage === stage && this.layer === layer ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)
|
|
12896
|
+
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);
|
|
12943
12897
|
}
|
|
12944
12898
|
}
|
|
12945
12899
|
Group.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
|
|
@@ -28863,6 +28817,8 @@
|
|
|
28863
28817
|
var _a, _b;
|
|
28864
28818
|
return null !== (_b = null !== (_a = null == params ? void 0 : params.lynx) && void 0 !== _a ? _a : null == params ? void 0 : params.runtime) && void 0 !== _b ? _b : getGlobalLynxRuntime();
|
|
28865
28819
|
}
|
|
28820
|
+
const requestAnimationFrameBasedSTO = callback => rafBasedSto.call(callback),
|
|
28821
|
+
cancelAnimationFrameBasedSTO = handle => rafBasedSto.clear(handle);
|
|
28866
28822
|
function getLynxPixelRatio(params, runtime) {
|
|
28867
28823
|
var _a, _b, _c, _d, _e;
|
|
28868
28824
|
return null !== (_e = null !== (_d = null !== (_a = null == params ? void 0 : params.pixelRatio) && void 0 !== _a ? _a : null === (_c = null === (_b = null == runtime ? void 0 : runtime.getSystemInfoSync) || void 0 === _b ? void 0 : _b.call(runtime)) || void 0 === _c ? void 0 : _c.pixelRatio) && void 0 !== _d ? _d : getGlobalSystemPixelRatio()) && void 0 !== _e ? _e : 1;
|
|
@@ -28934,7 +28890,7 @@
|
|
|
28934
28890
|
}
|
|
28935
28891
|
class LynxEnvContribution extends BaseEnvContribution {
|
|
28936
28892
|
constructor() {
|
|
28937
|
-
super(), this.type = "lynx", this.supportEvent = !0, this.canvasMap = new Map(), this.freeCanvasList = [], this.canvasIdx = 0, this.supportsTouchEvents = !0;
|
|
28893
|
+
super(), this.type = "lynx", this.supportEvent = !0, this.canvasMap = new Map(), this.freeCanvasList = [], this.canvasIdx = 0, this.requestAnimationFrame = requestAnimationFrameBasedSTO, this.cancelAnimationFrame = cancelAnimationFrameBasedSTO, this.supportsTouchEvents = !0;
|
|
28938
28894
|
try {
|
|
28939
28895
|
this.supportsPointerEvents = !!globalThis.PointerEvent, this.supportsMouseEvents = !!globalThis.MouseEvent;
|
|
28940
28896
|
} catch (err) {
|
|
@@ -28943,7 +28899,8 @@
|
|
|
28943
28899
|
this.applyStyles = !0;
|
|
28944
28900
|
}
|
|
28945
28901
|
configure(service, params = {}) {
|
|
28946
|
-
|
|
28902
|
+
var _a, _b;
|
|
28903
|
+
service.env === this.type && (service.setActiveEnvContribution(this), this.lynxEnvParams = params, this.lynxRuntime = getLynxRuntime(params), "function" == typeof (null === (_a = this.lynxRuntime) || void 0 === _a ? void 0 : _a.requestAnimationFrame) && "function" == typeof (null === (_b = this.lynxRuntime) || void 0 === _b ? void 0 : _b.cancelAnimationFrame) ? (this.requestAnimationFrame = this.lynxRuntime.requestAnimationFrame.bind(this.lynxRuntime), this.cancelAnimationFrame = this.lynxRuntime.cancelAnimationFrame.bind(this.lynxRuntime)) : (this.requestAnimationFrame = requestAnimationFrameBasedSTO, this.cancelAnimationFrame = cancelAnimationFrameBasedSTO));
|
|
28947
28904
|
}
|
|
28948
28905
|
getDynamicCanvasCount() {
|
|
28949
28906
|
return this.freeCanvasList.length;
|
|
@@ -28995,14 +28952,10 @@
|
|
|
28995
28952
|
return getLynxPixelRatio(void 0, this.lynxRuntime);
|
|
28996
28953
|
}
|
|
28997
28954
|
getRequestAnimationFrame() {
|
|
28998
|
-
return
|
|
28999
|
-
return rafBasedSto.call(callback);
|
|
29000
|
-
};
|
|
28955
|
+
return this.requestAnimationFrame;
|
|
29001
28956
|
}
|
|
29002
28957
|
getCancelAnimationFrame() {
|
|
29003
|
-
return
|
|
29004
|
-
rafBasedSto.clear(h);
|
|
29005
|
-
};
|
|
28958
|
+
return this.cancelAnimationFrame;
|
|
29006
28959
|
}
|
|
29007
28960
|
mapToCanvasPoint(event) {
|
|
29008
28961
|
var _a;
|
|
@@ -49991,7 +49944,7 @@
|
|
|
49991
49944
|
loadDiscreteLegendComponent();
|
|
49992
49945
|
class DiscreteLegend extends LegendBase {
|
|
49993
49946
|
constructor(attributes, options) {
|
|
49994
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._contentMaxHeight = 0, this.
|
|
49947
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._contentMaxHeight = 0, this._onHover = e => {
|
|
49995
49948
|
const target = e.target;
|
|
49996
49949
|
if (target && target.name && target.name.startsWith(exports.LEGEND_ELEMENT_NAME.item)) {
|
|
49997
49950
|
const legendItem = target.delegate;
|
|
@@ -50039,7 +49992,7 @@
|
|
|
50039
49992
|
};
|
|
50040
49993
|
}
|
|
50041
49994
|
render() {
|
|
50042
|
-
|
|
49995
|
+
super.render(), this._lastActiveItem = null;
|
|
50043
49996
|
}
|
|
50044
49997
|
setSelected(selectedData) {
|
|
50045
49998
|
var _a;
|
|
@@ -50219,7 +50172,7 @@
|
|
|
50219
50172
|
}), this._appendDataToShape(itemGroup, exports.LEGEND_ELEMENT_NAME.item, item, itemGroup)) : (itemGroup = graphicCreator.group(Object.assign({
|
|
50220
50173
|
x: 0,
|
|
50221
50174
|
y: 0
|
|
50222
|
-
}, backgroundStyle.style)), this._appendDataToShape(itemGroup, exports.LEGEND_ELEMENT_NAME.item, item, itemGroup, backgroundStyle.state
|
|
50175
|
+
}, backgroundStyle.style)), this._appendDataToShape(itemGroup, exports.LEGEND_ELEMENT_NAME.item, item, itemGroup, backgroundStyle.state)), itemGroup.id = `${null != id ? id : label}-${index}`, itemGroup.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected);
|
|
50223
50176
|
const innerGroup = graphicCreator.group({
|
|
50224
50177
|
x: 0,
|
|
50225
50178
|
y: 0,
|
|
@@ -50234,21 +50187,15 @@
|
|
|
50234
50187
|
const s = get$1(shapeStyle, "style.size", DEFAULT_SHAPE_SIZE);
|
|
50235
50188
|
shapeSize = isArray$1(s) ? s[0] || 0 : s, shapeSpace = get$1(shapeAttr, "space", DEFAULT_SHAPE_SPACE);
|
|
50236
50189
|
const itemShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
50237
|
-
|
|
50238
|
-
|
|
50239
|
-
|
|
50240
|
-
|
|
50241
|
-
|
|
50242
|
-
|
|
50243
|
-
|
|
50244
|
-
|
|
50245
|
-
|
|
50246
|
-
shapeStates = shapeStateNeedsItemColor ? merge({}, shapeStyle.state) : shapeStyle.state;
|
|
50247
|
-
Object.keys(shapeStates || {}).forEach(key => {
|
|
50248
|
-
const state = shapeStates[key],
|
|
50249
|
-
color = state.fill || state.stroke;
|
|
50250
|
-
shape.fill && isNil$1(state.fill) && color && (state.fill = color), shape.stroke && isNil$1(state.stroke) && color && (state.stroke = color);
|
|
50251
|
-
}), this._appendDataToShape(itemShape, exports.LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStates, !shapeStateNeedsItemColor && !1 !== shapeStyle.reuseStateDefinitions), itemShape.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected), innerGroup.add(itemShape);
|
|
50190
|
+
x: 0,
|
|
50191
|
+
y: 0,
|
|
50192
|
+
symbolType: "circle",
|
|
50193
|
+
strokeBoundsBuffer: 0
|
|
50194
|
+
}, shape), shapeStyle.style));
|
|
50195
|
+
Object.keys(shapeStyle.state || {}).forEach(key => {
|
|
50196
|
+
const color = shapeStyle.state[key].fill || shapeStyle.state[key].stroke;
|
|
50197
|
+
shape.fill && isNil$1(shapeStyle.state[key].fill) && color && (shapeStyle.state[key].fill = color), shape.stroke && isNil$1(shapeStyle.state[key].stroke) && color && (shapeStyle.state[key].stroke = color);
|
|
50198
|
+
}), this._appendDataToShape(itemShape, exports.LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state), itemShape.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected), innerGroup.add(itemShape);
|
|
50252
50199
|
}
|
|
50253
50200
|
let focusSpace = 0;
|
|
50254
50201
|
if (focus) {
|
|
@@ -50275,7 +50222,7 @@
|
|
|
50275
50222
|
_originText: labelAttr.formatMethod ? label : void 0
|
|
50276
50223
|
}),
|
|
50277
50224
|
labelShape = createTextGraphicByType(labelAttributes);
|
|
50278
|
-
this._appendDataToShape(labelShape, exports.LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state
|
|
50225
|
+
this._appendDataToShape(labelShape, exports.LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state), labelShape.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected), innerGroup.add(labelShape);
|
|
50279
50226
|
const labelSpace = get$1(labelAttr, "space", DEFAULT_LABEL_SPACE);
|
|
50280
50227
|
if (isValid$1(value)) {
|
|
50281
50228
|
const valueSpace = get$1(valueAttr, "space", focus ? DEFAULT_VALUE_SPACE : 0),
|
|
@@ -50291,7 +50238,7 @@
|
|
|
50291
50238
|
_originText: valueAttr.formatMethod ? value : void 0
|
|
50292
50239
|
}),
|
|
50293
50240
|
valueShape = createTextGraphicByType(valueAttributes);
|
|
50294
|
-
if (this._appendDataToShape(valueShape, exports.LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state
|
|
50241
|
+
if (this._appendDataToShape(valueShape, exports.LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state), valueShape.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected), this._itemWidthByUser) {
|
|
50295
50242
|
const layoutWidth = this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - labelSpace - focusSpace - valueSpace;
|
|
50296
50243
|
this._autoEllipsis(autoEllipsisStrategy, layoutWidth, labelShape, valueShape), valueAttr.alignRight ? valueShape.setAttributes({
|
|
50297
50244
|
textAlign: "right",
|
|
@@ -50721,17 +50668,8 @@
|
|
|
50721
50668
|
item.hasState(exports.LegendStateValue.selected) && selectedData.push(item.data);
|
|
50722
50669
|
}), selectedData;
|
|
50723
50670
|
}
|
|
50724
|
-
_appendDataToShape(shape, name, data, delegateShape, states
|
|
50725
|
-
|
|
50726
|
-
const source = null != states ? states : DEFAULT_STATES,
|
|
50727
|
-
cached = this._stateDefinitionsCache.get(source);
|
|
50728
|
-
if (cached) return shape.states = cached.definitions, void shape.setStateDefinitionsWithCompiled(cached.definitions, cached.compiledDefinitions);
|
|
50729
|
-
const definitions = states ? merge({}, DEFAULT_STATES, states) : DEFAULT_STATES,
|
|
50730
|
-
entry = {
|
|
50731
|
-
definitions: definitions,
|
|
50732
|
-
compiledDefinitions: new StateDefinitionCompiler().compile(definitions)
|
|
50733
|
-
};
|
|
50734
|
-
this._stateDefinitionsCache.set(source, entry), shape.states = entry.definitions, shape.setStateDefinitionsWithCompiled(entry.definitions, entry.compiledDefinitions);
|
|
50671
|
+
_appendDataToShape(shape, name, data, delegateShape, states = {}) {
|
|
50672
|
+
shape.name = name, shape.data = data, shape.delegate = delegateShape, shape.states = merge({}, DEFAULT_STATES, states);
|
|
50735
50673
|
}
|
|
50736
50674
|
_dispatchLegendEvent(eventName, legendItem, event) {
|
|
50737
50675
|
const currentSelectedItems = this._getSelectedLegends();
|
|
@@ -50748,17 +50686,12 @@
|
|
|
50748
50686
|
}
|
|
50749
50687
|
_handleStyle(config, item, isSelected, index, items) {
|
|
50750
50688
|
const newConfig = {};
|
|
50751
|
-
|
|
50752
|
-
|
|
50753
|
-
|
|
50754
|
-
newConfig.reuseStateDefinitions = !hasStateFunction, hasStateFunction ? (newConfig.state = {}, stateKeys.forEach(key => {
|
|
50755
|
-
config.state[key] && (newConfig.state[key] = isFunction$1(config.state[key]) ? config.state[key](item, isSelected, index, items) : config.state[key]);
|
|
50756
|
-
})) : newConfig.state = config.state;
|
|
50757
|
-
}
|
|
50758
|
-
return newConfig;
|
|
50689
|
+
return config.style && (isFunction$1(config.style) ? newConfig.style = config.style(item, isSelected, index, items) : newConfig.style = config.style), config.state && (newConfig.state = {}, Object.keys(config.state).forEach(key => {
|
|
50690
|
+
config.state[key] && (isFunction$1(config.state[key]) ? newConfig.state[key] = config.state[key](item, isSelected, index, items) : newConfig.state[key] = config.state[key]);
|
|
50691
|
+
})), newConfig;
|
|
50759
50692
|
}
|
|
50760
50693
|
release() {
|
|
50761
|
-
|
|
50694
|
+
super.release(), this.removeAllEventListeners();
|
|
50762
50695
|
}
|
|
50763
50696
|
}
|
|
50764
50697
|
DiscreteLegend.defaultAttributes = {
|
|
@@ -55640,7 +55573,7 @@
|
|
|
55640
55573
|
return resolveLegacyApp().createStage(params);
|
|
55641
55574
|
}
|
|
55642
55575
|
|
|
55643
|
-
const version = "1.1.4-alpha.
|
|
55576
|
+
const version = "1.1.4-alpha.3";
|
|
55644
55577
|
|
|
55645
55578
|
exports.AComponentAnimate = AComponentAnimate;
|
|
55646
55579
|
exports.ACustomAnimate = ACustomAnimate;
|