@visactor/vtable-calendar 1.22.8-alpha.2 → 1.22.8-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/dist/vtable-calendar.js +154 -70
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +3 -3
package/dist/vtable-calendar.js
CHANGED
|
@@ -627,28 +627,59 @@
|
|
|
627
627
|
}
|
|
628
628
|
addEventListener(type, listener, options) {
|
|
629
629
|
if (!listener) return;
|
|
630
|
+
const capture = this._resolveCapture(options),
|
|
631
|
+
once = this._resolveOnce(options),
|
|
632
|
+
listenerTypeMap = this._getOrCreateListenerTypeMap(type),
|
|
633
|
+
wrappedMap = this._getOrCreateWrappedMap(listenerTypeMap, listener);
|
|
634
|
+
if (wrappedMap.has(capture)) return;
|
|
630
635
|
const wrappedListener = event => {
|
|
631
636
|
const transformedEvent = this._eventListenerTransformer(event);
|
|
632
|
-
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent);
|
|
637
|
+
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent), once && this._deleteListenerRecord(type, listener, capture);
|
|
633
638
|
};
|
|
634
|
-
|
|
639
|
+
wrappedMap.set(capture, {
|
|
640
|
+
wrappedListener: wrappedListener,
|
|
641
|
+
options: options
|
|
642
|
+
}), this._nativeAddEventListener(type, wrappedListener, options);
|
|
635
643
|
}
|
|
636
644
|
removeEventListener(type, listener, options) {
|
|
637
|
-
var _a;
|
|
645
|
+
var _a, _b;
|
|
638
646
|
if (!listener) return;
|
|
639
|
-
const
|
|
640
|
-
|
|
647
|
+
const capture = this._resolveCapture(options),
|
|
648
|
+
wrappedRecord = null === (_b = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener)) || void 0 === _b ? void 0 : _b.get(capture);
|
|
649
|
+
wrappedRecord && (this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture), this._deleteListenerRecord(type, listener, capture));
|
|
641
650
|
}
|
|
642
651
|
dispatchEvent(event) {
|
|
643
652
|
return this._nativeDispatchEvent(event);
|
|
644
653
|
}
|
|
645
654
|
clearAllEventListeners() {
|
|
646
|
-
this._listenerMap.forEach((
|
|
647
|
-
|
|
648
|
-
|
|
655
|
+
this._listenerMap.forEach((listenerMap, type) => {
|
|
656
|
+
listenerMap.forEach(wrappedMap => {
|
|
657
|
+
wrappedMap.forEach((wrappedRecord, capture) => {
|
|
658
|
+
this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture);
|
|
659
|
+
});
|
|
649
660
|
});
|
|
650
661
|
}), this._listenerMap.clear();
|
|
651
662
|
}
|
|
663
|
+
_resolveCapture(options) {
|
|
664
|
+
return "boolean" == typeof options ? options : !!(null == options ? void 0 : options.capture);
|
|
665
|
+
}
|
|
666
|
+
_resolveOnce(options) {
|
|
667
|
+
return "object" == typeof options && !!(null == options ? void 0 : options.once);
|
|
668
|
+
}
|
|
669
|
+
_getOrCreateListenerTypeMap(type) {
|
|
670
|
+
let listenerTypeMap = this._listenerMap.get(type);
|
|
671
|
+
return listenerTypeMap || (listenerTypeMap = new Map(), this._listenerMap.set(type, listenerTypeMap)), listenerTypeMap;
|
|
672
|
+
}
|
|
673
|
+
_getOrCreateWrappedMap(listenerTypeMap, listener) {
|
|
674
|
+
let wrappedMap = listenerTypeMap.get(listener);
|
|
675
|
+
return wrappedMap || (wrappedMap = new Map(), listenerTypeMap.set(listener, wrappedMap)), wrappedMap;
|
|
676
|
+
}
|
|
677
|
+
_deleteListenerRecord(type, listener, capture) {
|
|
678
|
+
const listenerTypeMap = this._listenerMap.get(type);
|
|
679
|
+
if (!listenerTypeMap) return;
|
|
680
|
+
const wrappedMap = listenerTypeMap.get(listener);
|
|
681
|
+
wrappedMap && (wrappedMap.delete(capture), 0 === wrappedMap.size && listenerTypeMap.delete(listener), 0 === listenerTypeMap.size && this._listenerMap.delete(type));
|
|
682
|
+
}
|
|
652
683
|
_nativeAddEventListener(type, listener, options) {
|
|
653
684
|
throw new Error("_nativeAddEventListener must be implemented by derived classes");
|
|
654
685
|
}
|
|
@@ -7134,7 +7165,9 @@
|
|
|
7134
7165
|
var _a;
|
|
7135
7166
|
if (event.manager !== this) throw new Error("It is illegal to free an event not managed by this EventManager!");
|
|
7136
7167
|
const constructor = event.constructor;
|
|
7137
|
-
this.eventPool.has(constructor) || this.eventPool.
|
|
7168
|
+
this.eventPool.has(constructor) || (this.eventPool.get(constructor).forEach(e => {
|
|
7169
|
+
e.eventPhase = event.NONE, e.currentTarget = null, e.path = [], e.detailPath = [], e.target = null;
|
|
7170
|
+
}), this.eventPool.set(constructor, [])), null === (_a = this.eventPool.get(constructor)) || void 0 === _a || _a.push(event);
|
|
7138
7171
|
}
|
|
7139
7172
|
notifyListeners(e, type) {
|
|
7140
7173
|
const listeners = e.currentTarget._events[type];
|
|
@@ -9554,6 +9587,7 @@
|
|
|
9554
9587
|
var _a;
|
|
9555
9588
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
9556
9589
|
if (!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) !== states.length || states.some((stateName, index) => this.currentStates[index] !== stateName))) return;
|
|
9590
|
+
this.stateSort && (states = states.sort(this.stateSort));
|
|
9557
9591
|
const stateAttrs = {};
|
|
9558
9592
|
states.forEach(stateName => {
|
|
9559
9593
|
var _a;
|
|
@@ -9737,7 +9771,7 @@
|
|
|
9737
9771
|
});
|
|
9738
9772
|
}
|
|
9739
9773
|
release() {
|
|
9740
|
-
this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this);
|
|
9774
|
+
this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this), super.release();
|
|
9741
9775
|
}
|
|
9742
9776
|
_emitCustomEvent(type, context) {
|
|
9743
9777
|
var _a, _b;
|
|
@@ -17144,12 +17178,12 @@
|
|
|
17144
17178
|
throw new Error("暂不支持");
|
|
17145
17179
|
}
|
|
17146
17180
|
release() {
|
|
17147
|
-
var _a, _b;
|
|
17181
|
+
var _a, _b, _d;
|
|
17148
17182
|
super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
|
|
17149
17183
|
layer.release();
|
|
17150
17184
|
}), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
|
|
17151
17185
|
item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
|
|
17152
|
-
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.renderService.renderTreeRoots = [];
|
|
17186
|
+
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.params.ticker || null === (_d = this._ticker) || void 0 === _d || _d.release(), this.renderService.renderTreeRoots = [];
|
|
17153
17187
|
}
|
|
17154
17188
|
setStage(stage) {}
|
|
17155
17189
|
dirty(b, matrix) {
|
|
@@ -18295,9 +18329,11 @@
|
|
|
18295
18329
|
}
|
|
18296
18330
|
emitEvent(type, e) {
|
|
18297
18331
|
if (!this.element) return;
|
|
18298
|
-
const
|
|
18332
|
+
const events = this.element._events;
|
|
18333
|
+
this._callListeners(type, e, events[WILDCARD]), this._callListeners(type, e, events[type]), this.emit(type, e);
|
|
18334
|
+
}
|
|
18335
|
+
_callListeners(type, e, listeners) {
|
|
18299
18336
|
if (listeners) if ("fn" in listeners) listeners.fn.call(listeners.context, e, type);else for (let i = 0, j = listeners.length; i < j && !e.propagationImmediatelyStopped; i++) listeners[i].fn.call(listeners[i].context, e, type);
|
|
18300
|
-
this.emit(type, e);
|
|
18301
18337
|
}
|
|
18302
18338
|
}
|
|
18303
18339
|
|
|
@@ -18431,7 +18467,7 @@
|
|
|
18431
18467
|
return !!this._inuse;
|
|
18432
18468
|
}
|
|
18433
18469
|
set inuse(use) {
|
|
18434
|
-
use !== !!this._inuse && (this._inuse = use, use ? (this.nativeContext.save(), this.reset()) : this.nativeContext.restore());
|
|
18470
|
+
use !== !!this._inuse && (this._inuse = use, use ? (this.nativeContext.save(), this.reset()) : (this.nativeContext.restore(), this._font = ""));
|
|
18435
18471
|
}
|
|
18436
18472
|
constructor(canvas, dpr) {
|
|
18437
18473
|
this.fillAttributes = Object.assign(Object.assign({}, DefaultFillStyle), {
|
|
@@ -21168,14 +21204,20 @@
|
|
|
21168
21204
|
x: x,
|
|
21169
21205
|
y: y
|
|
21170
21206
|
} = this.stage.eventPointTransform(e);
|
|
21171
|
-
let
|
|
21172
|
-
|
|
21207
|
+
let currentPos,
|
|
21208
|
+
currentScrollValue = 0,
|
|
21173
21209
|
delta = 0;
|
|
21174
21210
|
const {
|
|
21175
|
-
|
|
21176
|
-
|
|
21177
|
-
|
|
21178
|
-
|
|
21211
|
+
width: width,
|
|
21212
|
+
height: height
|
|
21213
|
+
} = this.getSliderRenderBounds(),
|
|
21214
|
+
track = "vertical" === direction ? height : width,
|
|
21215
|
+
travel = Math.max(track - this._sliderSize, 0),
|
|
21216
|
+
{
|
|
21217
|
+
range: range
|
|
21218
|
+
} = this.attribute,
|
|
21219
|
+
ratio = clamp$3(range[1] - range[0], 0, 1);
|
|
21220
|
+
return "vertical" === direction ? (currentPos = y, delta = currentPos - this._prePos) : (currentPos = x, delta = currentPos - this._prePos), currentScrollValue = travel > 0 && ratio < 1 ? delta / travel * (1 - ratio) : 0, [currentPos, currentScrollValue];
|
|
21179
21221
|
}, this._onSliderPointerMove = e => {
|
|
21180
21222
|
const {
|
|
21181
21223
|
stopSliderMovePropagation = !0
|
|
@@ -21319,15 +21361,24 @@
|
|
|
21319
21361
|
}
|
|
21320
21362
|
_getSliderPos(range) {
|
|
21321
21363
|
const {
|
|
21322
|
-
direction: direction
|
|
21364
|
+
direction: direction,
|
|
21365
|
+
minSliderSize = 0
|
|
21323
21366
|
} = this.attribute,
|
|
21324
21367
|
{
|
|
21325
21368
|
width: width,
|
|
21326
21369
|
height: height,
|
|
21327
21370
|
x1: x1,
|
|
21328
21371
|
y1: y1
|
|
21329
|
-
} = this.getSliderRenderBounds()
|
|
21330
|
-
|
|
21372
|
+
} = this.getSliderRenderBounds(),
|
|
21373
|
+
track = "horizontal" === direction ? width : height,
|
|
21374
|
+
origin = "horizontal" === direction ? x1 : y1,
|
|
21375
|
+
start = clamp$3(range[0], 0, 1),
|
|
21376
|
+
end = clamp$3(range[1], 0, 1),
|
|
21377
|
+
ratio = clamp$3(end - start, 0, 1),
|
|
21378
|
+
L = Math.max(ratio * track, minSliderSize),
|
|
21379
|
+
T = Math.max(track - L, 0),
|
|
21380
|
+
pStart = origin + start / Math.max(1 - ratio, 1e-12) * T;
|
|
21381
|
+
return [pStart, pStart + L];
|
|
21331
21382
|
}
|
|
21332
21383
|
_getScrollRange() {
|
|
21333
21384
|
if (this._sliderLimitRange) return this._sliderLimitRange;
|
|
@@ -21358,7 +21409,7 @@
|
|
|
21358
21409
|
this._sliderRenderBounds = null, this._sliderLimitRange = null;
|
|
21359
21410
|
}
|
|
21360
21411
|
release(all) {
|
|
21361
|
-
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).
|
|
21412
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
21362
21413
|
passive: !1
|
|
21363
21414
|
}), this._clearDragEvents();
|
|
21364
21415
|
}
|
|
@@ -21367,6 +21418,7 @@
|
|
|
21367
21418
|
direction: "horizontal",
|
|
21368
21419
|
round: !0,
|
|
21369
21420
|
sliderSize: 20,
|
|
21421
|
+
minSliderSize: 0,
|
|
21370
21422
|
sliderStyle: {
|
|
21371
21423
|
fill: "rgba(0, 0, 0, .5)"
|
|
21372
21424
|
},
|
|
@@ -22940,17 +22992,21 @@
|
|
|
22940
22992
|
} = this.attribute.label;
|
|
22941
22993
|
textStyle = isFunction$7(textStyle) ? merge$2({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
|
|
22942
22994
|
const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
|
|
22943
|
-
|
|
22995
|
+
textStyle = merge$2(labelAlign, textStyle), isFunction$7(textStyle.text) && (textStyle.text = textStyle.text({
|
|
22944
22996
|
label: tickDatum.label,
|
|
22945
22997
|
value: tickDatum.rawValue,
|
|
22946
22998
|
index: tickDatum.index,
|
|
22947
22999
|
layer: layer
|
|
22948
|
-
}))
|
|
23000
|
+
}));
|
|
23001
|
+
let reactStyle = textStyle.react;
|
|
23002
|
+
return isFunction$7(reactStyle) && (reactStyle = reactStyle(tickDatum, index, tickData, layer)), Object.assign(Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, textContent, textStyle)), {
|
|
22949
23003
|
text: null != text ? text : textContent,
|
|
22950
23004
|
_originText: tickDatum.label,
|
|
22951
23005
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize,
|
|
22952
23006
|
type: type
|
|
22953
|
-
}), textStyle)
|
|
23007
|
+
}), textStyle), {
|
|
23008
|
+
react: reactStyle
|
|
23009
|
+
});
|
|
22954
23010
|
}
|
|
22955
23011
|
getLabelPosition(point, vector, text, style) {
|
|
22956
23012
|
return point;
|
|
@@ -23096,9 +23152,10 @@
|
|
|
23096
23152
|
} = rotateConfig;
|
|
23097
23153
|
if (0 === labelRotateAngle.length || items.some(item => !!item.attribute.angle)) return;
|
|
23098
23154
|
let i = 0,
|
|
23099
|
-
n = 0
|
|
23100
|
-
|
|
23101
|
-
|
|
23155
|
+
n = 0,
|
|
23156
|
+
testAngle = labelRotateAngle;
|
|
23157
|
+
for (items.length > 2 && ("bottom" === orient || "top" === orient ? Math.abs(items[1].attribute.x - items[0].attribute.x) < items[0].attribute.fontSize / 2 && (testAngle = [labelRotateAngle[labelRotateAngle.length - 1]]) : Math.abs(items[1].attribute.y - items[0].attribute.y) < items[0].attribute.fontSize / 2 && (testAngle = [labelRotateAngle[labelRotateAngle.length - 1]])), testAngle && testAngle.length > 0 && (n = testAngle.length); i < n;) {
|
|
23158
|
+
const angle = testAngle[i++];
|
|
23102
23159
|
if (items.forEach(item => {
|
|
23103
23160
|
item.attribute.angle = degreeToRadian$1(angle);
|
|
23104
23161
|
}), tryRotate(orient, items), !hasIntersect(items)) break;
|
|
@@ -23978,6 +24035,8 @@
|
|
|
23978
24035
|
this.status === STATUS$1.RUNNING && (this.tickCounts++, this.timelines.forEach(timeline => {
|
|
23979
24036
|
timeline.tick(delta);
|
|
23980
24037
|
}), this.emit("tick", delta));
|
|
24038
|
+
}, this._handleGraphTick = () => {
|
|
24039
|
+
this.initHandler(!1);
|
|
23981
24040
|
}, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.stage = stage, this.autoStop = !0, this.interval = 16, this.computeTimeOffsetAndJitter();
|
|
23982
24041
|
}
|
|
23983
24042
|
bindStage(stage) {
|
|
@@ -23987,9 +24046,7 @@
|
|
|
23987
24046
|
this.timeOffset = Math.floor(Math.random() * this.interval), this._jitter = Math.min(Math.max(.2 * this.interval, 6), .7 * this.interval);
|
|
23988
24047
|
}
|
|
23989
24048
|
init() {
|
|
23990
|
-
this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker",
|
|
23991
|
-
this.initHandler(!1);
|
|
23992
|
-
}), application.global.env && this.initHandler(!1);
|
|
24049
|
+
this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", this._handleGraphTick), application.global.env && this.initHandler(!1);
|
|
23993
24050
|
}
|
|
23994
24051
|
addTimeline(timeline) {
|
|
23995
24052
|
this.timelines.push(timeline);
|
|
@@ -24062,7 +24119,7 @@
|
|
|
24062
24119
|
}
|
|
24063
24120
|
release() {
|
|
24064
24121
|
var _a;
|
|
24065
|
-
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
|
|
24122
|
+
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1, application.global.hooks.onSetEnv.unTap("graph-ticker", this._handleGraphTick);
|
|
24066
24123
|
}
|
|
24067
24124
|
checkSkip(delta) {
|
|
24068
24125
|
var _a, _b, _c;
|
|
@@ -24168,6 +24225,18 @@
|
|
|
24168
24225
|
}
|
|
24169
24226
|
AnimationTransitionRegistry.getInstance();
|
|
24170
24227
|
|
|
24228
|
+
function getCustomType(custom) {
|
|
24229
|
+
if (!custom || !isFunction$7(custom)) return 0;
|
|
24230
|
+
const functionStr = Function.prototype.toString.call(custom);
|
|
24231
|
+
if (/^class\s/.test(functionStr)) return 1;
|
|
24232
|
+
if (!custom.prototype) return 2;
|
|
24233
|
+
if (custom.prototype.constructor === custom) {
|
|
24234
|
+
const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
|
|
24235
|
+
if (descriptor && !descriptor.writable) return 1;
|
|
24236
|
+
}
|
|
24237
|
+
return 2;
|
|
24238
|
+
}
|
|
24239
|
+
|
|
24171
24240
|
class AnimateExecutor {
|
|
24172
24241
|
static registerBuiltInAnimate(name, animate) {
|
|
24173
24242
|
AnimateExecutor.builtInAnimateMap[name] = animate;
|
|
@@ -24197,8 +24266,8 @@
|
|
|
24197
24266
|
}
|
|
24198
24267
|
parseParams(params, isTimeline, child) {
|
|
24199
24268
|
var _a, _b;
|
|
24200
|
-
const totalTime = this.resolveValue(params.totalTime,
|
|
24201
|
-
startTime = this.resolveValue(params.startTime,
|
|
24269
|
+
const totalTime = this.resolveValue(params.totalTime, child, void 0),
|
|
24270
|
+
startTime = this.resolveValue(params.startTime, child, 0),
|
|
24202
24271
|
parsedParams = Object.assign({}, params);
|
|
24203
24272
|
parsedParams.oneByOneDelay = 0, parsedParams.startTime = startTime, parsedParams.totalTime = totalTime;
|
|
24204
24273
|
const oneByOne = this.resolveValue(params.oneByOne, child, !1);
|
|
@@ -24232,7 +24301,7 @@
|
|
|
24232
24301
|
effects: effects.map(effect => {
|
|
24233
24302
|
var _a, _b;
|
|
24234
24303
|
const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[null !== (_b = effect.type) && void 0 !== _b ? _b : "fromTo"],
|
|
24235
|
-
customType =
|
|
24304
|
+
customType = getCustomType(custom);
|
|
24236
24305
|
return Object.assign(Object.assign({}, effect), {
|
|
24237
24306
|
custom: custom,
|
|
24238
24307
|
customType: customType
|
|
@@ -24246,12 +24315,11 @@
|
|
|
24246
24315
|
duration = this.resolveValue(params.duration, child, 300);
|
|
24247
24316
|
let oneByOneDelay = 0;
|
|
24248
24317
|
oneByOne && (oneByOneDelay = "number" == typeof oneByOne ? oneByOne : oneByOne ? delay + delayAfter + duration : 0), parsedParams.oneByOneDelay = oneByOneDelay, parsedParams.custom = null !== (_a = params.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[null !== (_b = params.type) && void 0 !== _b ? _b : "fromTo"];
|
|
24249
|
-
const customType =
|
|
24250
|
-
|
|
24251
|
-
|
|
24252
|
-
|
|
24253
|
-
|
|
24254
|
-
}
|
|
24318
|
+
const customType = getCustomType(parsedParams.custom);
|
|
24319
|
+
parsedParams.customType = customType;
|
|
24320
|
+
const _totalTime = delay + delayAfter + duration + oneByOneDelay * (this._target.count - 2),
|
|
24321
|
+
scale = isValidNumber$3(totalTime) ? totalTime / _totalTime : 1;
|
|
24322
|
+
parsedParams.delay = delay * scale, parsedParams.delayAfter = delayAfter * scale, parsedParams.duration = duration * scale, parsedParams.oneByOneDelay = oneByOneDelay * scale, parsedParams.startTime = startTime;
|
|
24255
24323
|
}
|
|
24256
24324
|
return parsedParams;
|
|
24257
24325
|
}
|
|
@@ -24311,7 +24379,7 @@
|
|
|
24311
24379
|
let parsedFromProps = null,
|
|
24312
24380
|
props = params.to,
|
|
24313
24381
|
from = params.from;
|
|
24314
|
-
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
|
|
24382
|
+
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel), this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
|
|
24315
24383
|
let totalDelay = 0;
|
|
24316
24384
|
oneByOneDelay && (totalDelay = oneByOneDelay * (count - index - 1));
|
|
24317
24385
|
const delayAfterValue = isFunction$7(delayAfter) ? delayAfter(null === (_h = null === (_g = graphic.context) || void 0 === _g ? void 0 : _g.data) || void 0 === _h ? void 0 : _h[0], graphic, {}) : delayAfter;
|
|
@@ -24320,6 +24388,7 @@
|
|
|
24320
24388
|
_handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
|
|
24321
24389
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
24322
24390
|
if (custom && customType) {
|
|
24391
|
+
customType = getCustomType(custom);
|
|
24323
24392
|
let customParams = this.resolveValue(customParameters, graphic);
|
|
24324
24393
|
"function" == typeof customParams && (customParams = customParams(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {})), customParams = Object.assign({
|
|
24325
24394
|
width: (null === (_c = graphic.stage) || void 0 === _c ? void 0 : _c.width) || 0,
|
|
@@ -24373,9 +24442,9 @@
|
|
|
24373
24442
|
let parsedFromProps = null,
|
|
24374
24443
|
props = effect.to,
|
|
24375
24444
|
from = effect.from;
|
|
24376
|
-
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
|
|
24445
|
+
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel);
|
|
24377
24446
|
const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
|
|
24378
|
-
customType = effect.customType;
|
|
24447
|
+
customType = effect.custom ? effect.customType : getCustomType(custom);
|
|
24379
24448
|
this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
|
|
24380
24449
|
}), delayAfterValue > 0 && animate.wait(delayAfterValue);
|
|
24381
24450
|
}
|
|
@@ -24392,22 +24461,31 @@
|
|
|
24392
24461
|
animate.play(customAnimate);
|
|
24393
24462
|
}
|
|
24394
24463
|
createPropsFromChannel(channel, graphic) {
|
|
24464
|
+
var _a;
|
|
24395
24465
|
const props = {};
|
|
24396
24466
|
let from = null;
|
|
24397
|
-
|
|
24398
|
-
|
|
24399
|
-
|
|
24400
|
-
|
|
24401
|
-
}
|
|
24467
|
+
if (!channel) return {
|
|
24468
|
+
from: from,
|
|
24469
|
+
props: props,
|
|
24470
|
+
attrOutChannel: null
|
|
24471
|
+
};
|
|
24472
|
+
const attrOutChannel = {};
|
|
24473
|
+
let hasAttrs = !1;
|
|
24474
|
+
const diffAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.diffAttrs;
|
|
24475
|
+
if (Array.isArray(channel) && (channel = channel.reduce((res, key) => (void 0 === diffAttrs[key] || (res[key] = {
|
|
24476
|
+
to: diffAttrs[key]
|
|
24477
|
+
}), res), {})), Object.keys(channel).forEach(key => {
|
|
24402
24478
|
var _a, _b, _c, _d;
|
|
24403
24479
|
const config = channel[key];
|
|
24404
24480
|
void 0 !== config.to && ("function" == typeof config.to ? props[key] = config.to(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : props[key] = config.to), void 0 !== config.from && (from || (from = {}), "function" == typeof config.from ? from[key] = config.from(null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, {}) : from[key] = config.from);
|
|
24405
|
-
}), {
|
|
24406
|
-
|
|
24407
|
-
props
|
|
24408
|
-
}
|
|
24481
|
+
}), diffAttrs) for (const key in diffAttrs) {
|
|
24482
|
+
const value = diffAttrs[key];
|
|
24483
|
+
void 0 !== value && (props.hasOwnProperty(key) || (attrOutChannel[key] = value, hasAttrs = !0));
|
|
24484
|
+
}
|
|
24485
|
+
return {
|
|
24409
24486
|
from: from,
|
|
24410
|
-
props: props
|
|
24487
|
+
props: props,
|
|
24488
|
+
attrOutChannel: hasAttrs ? attrOutChannel : null
|
|
24411
24489
|
};
|
|
24412
24490
|
}
|
|
24413
24491
|
resolveValue(value, graphic, defaultValue) {
|
|
@@ -24691,7 +24769,7 @@
|
|
|
24691
24769
|
}
|
|
24692
24770
|
class AStageAnimate extends ACustomAnimate {
|
|
24693
24771
|
constructor(customFrom, customTo, duration, easing, params) {
|
|
24694
|
-
super(customFrom, customTo, duration, easing, params), this.willCallBeforeStageRender = !0, this.willCallAfterStageRender = !0, this._beforeStageRender = () => {
|
|
24772
|
+
super(customFrom, customTo, duration, easing, params), this.willCallBeforeStageRender = !0, this.willCallAfterStageRender = !0, this.checkStatusAfterRender = !0, this._beforeStageRender = () => {
|
|
24695
24773
|
if (!this.willCallBeforeStageRender) return;
|
|
24696
24774
|
this.willCallBeforeStageRender = !1;
|
|
24697
24775
|
const stage = this.target.stage,
|
|
@@ -24704,7 +24782,7 @@
|
|
|
24704
24782
|
const stage = this.target.stage,
|
|
24705
24783
|
canvas = stage.window.getContext().canvas.nativeCanvas,
|
|
24706
24784
|
outputCanvas = this.afterStageRender(stage, canvas);
|
|
24707
|
-
outputCanvas && this.renderToStage(stage, outputCanvas);
|
|
24785
|
+
outputCanvas && this.renderToStage(stage, outputCanvas), this.checkStatusAfterRender && this.animate.status === AnimateStatus.END && this.animate.timeline.removeAnimate(this.animate);
|
|
24708
24786
|
}, this.props = {};
|
|
24709
24787
|
}
|
|
24710
24788
|
beforeStageRender(stage, canvas) {
|
|
@@ -29165,8 +29243,9 @@
|
|
|
29165
29243
|
let tickLength = 0;
|
|
29166
29244
|
(null === (_b = this.attribute.tick) || void 0 === _b ? void 0 : _b.visible) && !1 === this.attribute.tick.inside && (tickLength = this.attribute.tick.length || 4), (null === (_c = this.attribute.subTick) || void 0 === _c ? void 0 : _c.visible) && !1 === this.attribute.subTick.inside && (tickLength = Math.max(tickLength, this.attribute.subTick.length || 2));
|
|
29167
29245
|
const offset = tickLength + labelLength + space,
|
|
29168
|
-
|
|
29169
|
-
|
|
29246
|
+
actualOffset = this.getActualOffset(offset),
|
|
29247
|
+
titlePoint = this.getVerticalCoord(point, actualOffset, !1),
|
|
29248
|
+
vector = this.getVerticalVector(actualOffset, !1, {
|
|
29170
29249
|
x: 0,
|
|
29171
29250
|
y: 0
|
|
29172
29251
|
});
|
|
@@ -29195,11 +29274,11 @@
|
|
|
29195
29274
|
if (angle !== Math.PI / 2) {
|
|
29196
29275
|
const cosValue = Math.abs(Math.cos(null != angle ? angle : 0));
|
|
29197
29276
|
maxTagWidth = cosValue < 1e-6 ? 1 / 0 : this.attribute.end.x / cosValue;
|
|
29198
|
-
} else maxTagWidth = limitSize -
|
|
29277
|
+
} else maxTagWidth = limitSize - actualOffset;
|
|
29199
29278
|
} else if (angle && 0 !== angle) {
|
|
29200
29279
|
const sinValue = Math.abs(Math.sin(angle));
|
|
29201
29280
|
maxTagWidth = sinValue < 1e-6 ? 1 / 0 : this.attribute.end.y / sinValue;
|
|
29202
|
-
} else maxTagWidth = limitSize -
|
|
29281
|
+
} else maxTagWidth = limitSize - actualOffset;
|
|
29203
29282
|
}
|
|
29204
29283
|
}
|
|
29205
29284
|
const attrs = Object.assign(Object.assign(Object.assign({}, titlePoint), restAttrs), {
|
|
@@ -29504,6 +29583,10 @@
|
|
|
29504
29583
|
visibleAll: !1
|
|
29505
29584
|
});
|
|
29506
29585
|
}
|
|
29586
|
+
getActualOffset(offset) {
|
|
29587
|
+
const orient = this.attribute.orient;
|
|
29588
|
+
return "left" === orient || "right" === orient ? this.attribute.width ? this.attribute.width : (this.attribute.maxWidth && (offset = Math.min(offset, this.attribute.maxWidth)), this.attribute.minWidth && (offset = Math.max(offset, this.attribute.minWidth)), offset) : offset;
|
|
29589
|
+
}
|
|
29507
29590
|
release() {
|
|
29508
29591
|
super.release(), this._breaks = null;
|
|
29509
29592
|
}
|
|
@@ -32029,7 +32112,7 @@
|
|
|
32029
32112
|
};
|
|
32030
32113
|
}
|
|
32031
32114
|
release(all) {
|
|
32032
|
-
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).
|
|
32115
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
32033
32116
|
passive: !1
|
|
32034
32117
|
}), this._clearAllDragEvents();
|
|
32035
32118
|
}
|
|
@@ -56083,7 +56166,7 @@
|
|
|
56083
56166
|
}
|
|
56084
56167
|
constructor(container, options = {}) {
|
|
56085
56168
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
56086
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.8-alpha.
|
|
56169
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.8-alpha.3", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
56087
56170
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
56088
56171
|
options: options,
|
|
56089
56172
|
container: container
|
|
@@ -57012,17 +57095,18 @@
|
|
|
57012
57095
|
this.release();
|
|
57013
57096
|
}
|
|
57014
57097
|
release() {
|
|
57015
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
57098
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
57099
|
+
null === (_c = null === (_b = null === (_a = this.scenegraph) || void 0 === _a ? void 0 : _a.component) || void 0 === _b ? void 0 : _b.vScrollBar) || void 0 === _c || _c.release(), null === (_f = null === (_e = null === (_d = this.scenegraph) || void 0 === _d ? void 0 : _d.component) || void 0 === _e ? void 0 : _e.hScrollBar) || void 0 === _f || _f.release(), this.animationManager.clear(), this.animationManager.ticker.release(), null === (_j = null === (_h = null === (_g = this.scenegraph) || void 0 === _g ? void 0 : _g.stage) || void 0 === _h ? void 0 : _h.ticker) || void 0 === _j || _j.release();
|
|
57016
57100
|
const internalProps = this.internalProps;
|
|
57017
57101
|
if (this.isReleased) return;
|
|
57018
|
-
null === (
|
|
57102
|
+
null === (_l = null === (_k = internalProps.tooltipHandler) || void 0 === _k ? void 0 : _k.release) || void 0 === _l || _l.call(_k), null === (_o = null === (_m = internalProps.menuHandler) || void 0 === _m ? void 0 : _m.release) || void 0 === _o || _o.call(_m), null === (_p = super.release) || void 0 === _p || _p.call(this), this.pluginManager.release(), null === (_r = null === (_q = internalProps.handler) || void 0 === _q ? void 0 : _q.release) || void 0 === _r || _r.call(_q), this.eventManager.release(), null === (_t = null === (_s = internalProps.focusControl) || void 0 === _s ? void 0 : _s.release) || void 0 === _t || _t.call(_s), null === (_u = internalProps.legends) || void 0 === _u || _u.forEach(legend => {
|
|
57019
57103
|
null == legend || legend.release();
|
|
57020
|
-
}), null === (
|
|
57104
|
+
}), null === (_v = internalProps.title) || void 0 === _v || _v.release(), internalProps.title = null, null === (_w = internalProps.emptyTip) || void 0 === _w || _w.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach(releaseObj => {
|
|
57021
57105
|
var _a;
|
|
57022
57106
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
57023
57107
|
}), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release(), internalProps.focusControl.release();
|
|
57024
|
-
const parentElement = null === (
|
|
57025
|
-
parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element), null === (
|
|
57108
|
+
const parentElement = null === (_x = internalProps.element) || void 0 === _x ? void 0 : _x.parentElement;
|
|
57109
|
+
parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element), null === (_0 = null === (_z = null === (_y = this.editorManager) || void 0 === _y ? void 0 : _y.editingEditor) || void 0 === _z ? void 0 : _z.onEnd) || void 0 === _0 || _0.call(_z), this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_1 = this.reactCustomLayout) || void 0 === _1 || _1.clearCache(), clearChartRenderQueue();
|
|
57026
57110
|
}
|
|
57027
57111
|
fireListeners(type, event) {
|
|
57028
57112
|
return super.fireListeners(type, event);
|