@visactor/vtable-calendar 1.18.0 → 1.18.1
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 +51 -44
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -3805,6 +3805,11 @@
|
|
|
3805
3805
|
return this.context.tryUpdateLength();
|
|
3806
3806
|
}
|
|
3807
3807
|
};
|
|
3808
|
+
class StepClosed extends Step$1 {
|
|
3809
|
+
lineEnd() {
|
|
3810
|
+
this.context.closePath();
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3808
3813
|
function genStepSegments(points, t) {
|
|
3809
3814
|
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
3810
3815
|
const {
|
|
@@ -3818,6 +3823,16 @@
|
|
|
3818
3823
|
function genStepTypeSegments(path, points) {
|
|
3819
3824
|
return genCurveSegments(path, points);
|
|
3820
3825
|
}
|
|
3826
|
+
function genStepClosedSegments(points, t) {
|
|
3827
|
+
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
3828
|
+
const {
|
|
3829
|
+
direction: direction,
|
|
3830
|
+
startPoint: startPoint
|
|
3831
|
+
} = params;
|
|
3832
|
+
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
3833
|
+
const segContext = new SegContext("step", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? Direction$2.ROW : Direction$2.COLUMN);
|
|
3834
|
+
return genStepTypeSegments(new StepClosed(segContext, t, startPoint), points), segContext;
|
|
3835
|
+
}
|
|
3821
3836
|
|
|
3822
3837
|
class LinearClosed extends Linear {
|
|
3823
3838
|
lineEnd() {
|
|
@@ -4047,6 +4062,8 @@
|
|
|
4047
4062
|
return genMonotoneYSegments(points, params);
|
|
4048
4063
|
case "step":
|
|
4049
4064
|
return genStepSegments(points, .5, params);
|
|
4065
|
+
case "stepClosed":
|
|
4066
|
+
return genStepClosedSegments(points, .5, params);
|
|
4050
4067
|
case "stepBefore":
|
|
4051
4068
|
return genStepSegments(points, 0, params);
|
|
4052
4069
|
case "stepAfter":
|
|
@@ -4921,7 +4938,7 @@
|
|
|
4921
4938
|
function createColor(context, c, params) {
|
|
4922
4939
|
let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
4923
4940
|
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
4924
|
-
var _a, _b;
|
|
4941
|
+
var _a, _b, _c, _d;
|
|
4925
4942
|
if (!c || !0 === c) return "black";
|
|
4926
4943
|
let result, color;
|
|
4927
4944
|
if (isArray$9(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
|
|
@@ -4938,7 +4955,7 @@
|
|
|
4938
4955
|
scaleY = 1,
|
|
4939
4956
|
angle = 0
|
|
4940
4957
|
} = params.attribute;
|
|
4941
|
-
w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY, (angle || 1 !== scaleX || 1 !== scaleY) && (x = 0, y = 0, w = null !== (
|
|
4958
|
+
w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY, (angle || 1 !== scaleX || 1 !== scaleY) && (x = null !== (_a = params.x1WithoutTransform) && void 0 !== _a ? _a : 0, y = null !== (_b = params.y1WithoutTransform) && void 0 !== _b ? _b : 0, w = null !== (_c = params.widthWithoutTransform) && void 0 !== _c ? _c : w, h = null !== (_d = params.heightWithoutTransform) && void 0 !== _d ? _d : h);
|
|
4942
4959
|
}
|
|
4943
4960
|
"linear" === color.gradient ? result = createLinearGradient(context, color, x, y, w, h) : "conical" === color.gradient ? result = createConicGradient(context, color, x, y, w, h) : "radial" === color.gradient && (result = createRadialGradient(context, color, x, y, w, h));
|
|
4944
4961
|
}
|
|
@@ -4963,7 +4980,7 @@
|
|
|
4963
4980
|
const canvasGradient = context.createConicGradient(x + (null !== (_a = color.x) && void 0 !== _a ? _a : 0) * w, y + (null !== (_b = color.y) && void 0 !== _b ? _b : 0) * h, color.startAngle, color.endAngle);
|
|
4964
4981
|
return color.stops.forEach(stop => {
|
|
4965
4982
|
canvasGradient.addColorStop(stop.offset, stop.color);
|
|
4966
|
-
}), canvasGradient.GetPattern(w + x, h + y, undefined);
|
|
4983
|
+
}), canvasGradient.GetPattern ? canvasGradient.GetPattern(w + x, h + y, undefined) : canvasGradient;
|
|
4967
4984
|
}
|
|
4968
4985
|
|
|
4969
4986
|
const DIRECTION_KEY = {
|
|
@@ -8525,7 +8542,7 @@
|
|
|
8525
8542
|
}
|
|
8526
8543
|
var rect = new RectSymbol();
|
|
8527
8544
|
|
|
8528
|
-
const tempBounds
|
|
8545
|
+
const tempBounds = new AABBBounds$1();
|
|
8529
8546
|
class CustomSymbolClass {
|
|
8530
8547
|
constructor(type, path) {
|
|
8531
8548
|
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
@@ -8554,7 +8571,7 @@
|
|
|
8554
8571
|
let {
|
|
8555
8572
|
path: path
|
|
8556
8573
|
} = _ref;
|
|
8557
|
-
tempBounds
|
|
8574
|
+
tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size, tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
|
|
8558
8575
|
});
|
|
8559
8576
|
}
|
|
8560
8577
|
this.path.bounds && (bounds.x1 = this.path.bounds.x1 * size, bounds.y1 = this.path.bounds.y1 * size, bounds.x2 = this.path.bounds.x2 * size, bounds.y2 = this.path.bounds.y2 * size);
|
|
@@ -8868,8 +8885,8 @@
|
|
|
8868
8885
|
const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);
|
|
8869
8886
|
|
|
8870
8887
|
const _tempBounds$1 = new AABBBounds$1(),
|
|
8871
|
-
tempMatrix = new Matrix()
|
|
8872
|
-
|
|
8888
|
+
tempMatrix = new Matrix();
|
|
8889
|
+
new AABBBounds$1();
|
|
8873
8890
|
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
8874
8891
|
const tempConstantXYKey = ["x", "y"],
|
|
8875
8892
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
@@ -9388,25 +9405,12 @@
|
|
|
9388
9405
|
needUpdateLayout() {
|
|
9389
9406
|
return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
|
|
9390
9407
|
}
|
|
9391
|
-
getAnchor(anchor, params) {
|
|
9408
|
+
getAnchor(anchor, params, resetScale) {
|
|
9392
9409
|
const _anchor = [0, 0],
|
|
9393
9410
|
getBounds = () => {
|
|
9394
9411
|
if (params.b) return params.b;
|
|
9395
|
-
const
|
|
9396
|
-
|
|
9397
|
-
scaleY: scaleY,
|
|
9398
|
-
angle: angle,
|
|
9399
|
-
scaleCenter: scaleCenter
|
|
9400
|
-
} = this.attribute;
|
|
9401
|
-
return tempBounds.copy(this._AABBBounds), this.setAttributes({
|
|
9402
|
-
angle: 0,
|
|
9403
|
-
scaleCenter: null
|
|
9404
|
-
}), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
|
|
9405
|
-
scaleX: scaleX,
|
|
9406
|
-
scaleY: scaleY,
|
|
9407
|
-
angle: angle,
|
|
9408
|
-
scaleCenter: scaleCenter
|
|
9409
|
-
}), params.b;
|
|
9412
|
+
const graphic = this.clone();
|
|
9413
|
+
return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1, graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
|
|
9410
9414
|
};
|
|
9411
9415
|
if ("string" == typeof anchor[0]) {
|
|
9412
9416
|
const ratio = parseFloat(anchor[0]) / 100,
|
|
@@ -9435,7 +9439,7 @@
|
|
|
9435
9439
|
const params = {};
|
|
9436
9440
|
if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
|
|
9437
9441
|
const m = this._transMatrix;
|
|
9438
|
-
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
9442
|
+
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
9439
9443
|
x: _anchor[0],
|
|
9440
9444
|
y: _anchor[1]
|
|
9441
9445
|
});
|
|
@@ -11508,7 +11512,7 @@
|
|
|
11508
11512
|
tb1: tb1,
|
|
11509
11513
|
tb2: tb2
|
|
11510
11514
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
11511
|
-
updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
11515
|
+
updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, this.x1WithoutTransform = aabbBounds.x1, this.y1WithoutTransform = aabbBounds.y1;
|
|
11512
11516
|
const {
|
|
11513
11517
|
lineJoin = symbolTheme.lineJoin
|
|
11514
11518
|
} = attribute;
|
|
@@ -18784,6 +18788,7 @@
|
|
|
18784
18788
|
return this.nativeContext.createRadialGradient(x0, y0, r0, x1, y1, r1);
|
|
18785
18789
|
}
|
|
18786
18790
|
createConicGradient(x, y, startAngle, endAngle) {
|
|
18791
|
+
if (this.nativeContext.createConicGradient && Math.abs(endAngle - startAngle - 2 * Math.PI) < .001) return this.nativeContext.createConicGradient(startAngle, x, y);
|
|
18787
18792
|
let pattern,
|
|
18788
18793
|
edit = !1;
|
|
18789
18794
|
const ctx = this;
|
|
@@ -21295,7 +21300,9 @@
|
|
|
21295
21300
|
loadScrollbarComponent();
|
|
21296
21301
|
class ScrollBar extends AbstractComponent {
|
|
21297
21302
|
constructor(attributes, options) {
|
|
21298
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this.
|
|
21303
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this._handleTouchMove = e => {
|
|
21304
|
+
isValid$5(this._prePos) && e.preventDefault();
|
|
21305
|
+
}, this._onRailPointerDown = e => {
|
|
21299
21306
|
const {
|
|
21300
21307
|
viewX: viewX,
|
|
21301
21308
|
viewY: viewY
|
|
@@ -21339,8 +21346,7 @@
|
|
|
21339
21346
|
const triggers = getEndTriggersOfDrag(),
|
|
21340
21347
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
21341
21348
|
obj.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
21342
|
-
capture: !0
|
|
21343
|
-
passive: !0
|
|
21349
|
+
capture: !0
|
|
21344
21350
|
}), triggers.forEach(trigger => {
|
|
21345
21351
|
obj.addEventListener(trigger, this._onSliderPointerUp);
|
|
21346
21352
|
});
|
|
@@ -21361,7 +21367,6 @@
|
|
|
21361
21367
|
} = this.getSliderRenderBounds();
|
|
21362
21368
|
return "vertical" === direction ? (currentPos = y, delta = currentPos - this._prePos, currentScrollValue = delta / height) : (currentPos = x, delta = currentPos - this._prePos, currentScrollValue = delta / width), [currentPos, currentScrollValue];
|
|
21363
21369
|
}, this._onSliderPointerMove = e => {
|
|
21364
|
-
e.preventDefault();
|
|
21365
21370
|
const {
|
|
21366
21371
|
stopSliderMovePropagation = !0
|
|
21367
21372
|
} = this.attribute;
|
|
@@ -21377,7 +21382,7 @@
|
|
|
21377
21382
|
preScrollRange = this.getScrollRange(),
|
|
21378
21383
|
[currentPos, currentScrollValue] = this._computeScrollValue(e),
|
|
21379
21384
|
range = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
|
|
21380
|
-
this._dispatchEvent(SCROLLBAR_END_EVENT, {
|
|
21385
|
+
this._prePos = null, this._dispatchEvent(SCROLLBAR_END_EVENT, {
|
|
21381
21386
|
pre: preRange,
|
|
21382
21387
|
value: clampRange$1(range, limitRange[0], limitRange[1])
|
|
21383
21388
|
}), this._clearDragEvents();
|
|
@@ -21419,7 +21424,9 @@
|
|
|
21419
21424
|
delayType = "throttle",
|
|
21420
21425
|
delayTime = 0
|
|
21421
21426
|
} = this.attribute;
|
|
21422
|
-
this._rail && this._rail.addEventListener("pointerdown", delayMap[delayType](this._onRailPointerDown, delayTime)), this._slider && this._slider.addEventListener("pointerdown", this._onSliderPointerDown)
|
|
21427
|
+
this._rail && this._rail.addEventListener("pointerdown", delayMap[delayType](this._onRailPointerDown, delayTime)), this._slider && this._slider.addEventListener("pointerdown", this._onSliderPointerDown), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
21428
|
+
passive: !1
|
|
21429
|
+
});
|
|
21423
21430
|
}
|
|
21424
21431
|
render() {
|
|
21425
21432
|
this._reset();
|
|
@@ -21533,8 +21540,7 @@
|
|
|
21533
21540
|
const triggers = getEndTriggersOfDrag(),
|
|
21534
21541
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
21535
21542
|
obj.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
21536
|
-
capture: !0
|
|
21537
|
-
passive: !1
|
|
21543
|
+
capture: !0
|
|
21538
21544
|
}), triggers.forEach(trigger => {
|
|
21539
21545
|
obj.removeEventListener(trigger, this._onSliderPointerUp);
|
|
21540
21546
|
});
|
|
@@ -21542,6 +21548,11 @@
|
|
|
21542
21548
|
_reset() {
|
|
21543
21549
|
this._sliderRenderBounds = null, this._sliderLimitRange = null;
|
|
21544
21550
|
}
|
|
21551
|
+
release(all) {
|
|
21552
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
21553
|
+
passive: !1
|
|
21554
|
+
}), this._clearDragEvents();
|
|
21555
|
+
}
|
|
21545
21556
|
}
|
|
21546
21557
|
ScrollBar.defaultAttributes = {
|
|
21547
21558
|
direction: "horizontal",
|
|
@@ -25867,14 +25878,13 @@
|
|
|
25867
25878
|
const triggers = getEndTriggersOfDrag(),
|
|
25868
25879
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
25869
25880
|
obj.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
25870
|
-
capture: !0
|
|
25871
|
-
passive: !1
|
|
25881
|
+
capture: !0
|
|
25872
25882
|
}), triggers.forEach(trigger => {
|
|
25873
25883
|
obj.addEventListener(trigger, this._onHandlerPointerUp);
|
|
25874
25884
|
});
|
|
25875
25885
|
}, this._onHandlerPointerMove = e => {
|
|
25876
25886
|
var _a, _b;
|
|
25877
|
-
|
|
25887
|
+
this._isChanging = !0;
|
|
25878
25888
|
const {
|
|
25879
25889
|
railWidth: railWidth,
|
|
25880
25890
|
railHeight: railHeight,
|
|
@@ -25908,13 +25918,12 @@
|
|
|
25908
25918
|
const triggers = getEndTriggersOfDrag(),
|
|
25909
25919
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
25910
25920
|
obj.addEventListener("pointermove", this._onTrackPointerMove, {
|
|
25911
|
-
capture: !0
|
|
25912
|
-
passive: !1
|
|
25921
|
+
capture: !0
|
|
25913
25922
|
}), triggers.forEach(trigger => {
|
|
25914
25923
|
obj.addEventListener(trigger, this._onTrackPointerUp);
|
|
25915
25924
|
});
|
|
25916
25925
|
}, this._onTrackPointerMove = e => {
|
|
25917
|
-
|
|
25926
|
+
this._isChanging = !0;
|
|
25918
25927
|
const {
|
|
25919
25928
|
railWidth: railWidth,
|
|
25920
25929
|
railHeight: railHeight,
|
|
@@ -26289,13 +26298,11 @@
|
|
|
26289
26298
|
const triggers = getEndTriggersOfDrag(),
|
|
26290
26299
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
26291
26300
|
obj.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
26292
|
-
capture: !0
|
|
26293
|
-
passive: !1
|
|
26301
|
+
capture: !0
|
|
26294
26302
|
}), triggers.forEach(trigger => {
|
|
26295
26303
|
obj.removeEventListener(trigger, this._onHandlerPointerUp);
|
|
26296
26304
|
}), obj.removeEventListener("pointermove", this._onTrackPointerMove, {
|
|
26297
|
-
capture: !0
|
|
26298
|
-
passive: !1
|
|
26305
|
+
capture: !0
|
|
26299
26306
|
}), triggers.forEach(trigger => {
|
|
26300
26307
|
obj.removeEventListener(trigger, this._onTrackPointerUp);
|
|
26301
26308
|
});
|
|
@@ -49428,7 +49435,7 @@
|
|
|
49428
49435
|
constructor(container) {
|
|
49429
49436
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
49430
49437
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
49431
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.18.
|
|
49438
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.18.1", 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");
|
|
49432
49439
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
49433
49440
|
options: options,
|
|
49434
49441
|
container: container
|