@visactor/vtable 1.17.3-alpha.0 → 1.17.3-alpha.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/cjs/PivotTable.d.ts +0 -5
- package/cjs/PivotTable.js +0 -13
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.js +13 -14
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset.js +4 -6
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +3 -5
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +4 -4
- package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/scenegraph/select/create-select-border.js +2 -13
- package/cjs/scenegraph/select/create-select-border.js.map +1 -1
- package/cjs/state/state.js +47 -79
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +0 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/common.d.ts +1 -3
- package/cjs/ts-types/common.js.map +1 -1
- package/cjs/ts-types/events.d.ts +1 -3
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +0 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +62 -184
- package/dist/vtable.min.js +1 -1
- package/es/PivotTable.d.ts +0 -5
- package/es/PivotTable.js +0 -13
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.js +13 -14
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset.js +4 -6
- package/es/dataset/dataset.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/pivot-header-layout.js +3 -5
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/graphic/contributions/rect-contribution-render.js +4 -4
- package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
- package/es/scenegraph/select/create-select-border.js +2 -13
- package/es/scenegraph/select/create-select-border.js.map +1 -1
- package/es/state/state.js +47 -79
- package/es/state/state.js.map +1 -1
- package/es/ts-types/base-table.d.ts +0 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/common.d.ts +1 -3
- package/es/ts-types/common.js.map +1 -1
- package/es/ts-types/events.d.ts +1 -3
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +0 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +4 -4
package/cjs/state/state.js
CHANGED
|
@@ -388,114 +388,82 @@ class StateManager {
|
|
|
388
388
|
updateVerticalScrollBar(yRatio) {
|
|
389
389
|
var _a, _b;
|
|
390
390
|
const totalHeight = this.table.getAllRowsHeight(), oldVerticalBarPos = this.scroll.verticalBarPos;
|
|
391
|
-
|
|
392
|
-
(0, vutils_1.isValid)(verticalBarPos) && !isNaN(verticalBarPos) || (verticalBarPos = 0)
|
|
393
|
-
|
|
394
|
-
|
|
391
|
+
this.scroll.verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height)),
|
|
392
|
+
(0, vutils_1.isValid)(this.scroll.verticalBarPos) && !isNaN(this.scroll.verticalBarPos) || (this.scroll.verticalBarPos = 0),
|
|
393
|
+
this.table.scenegraph.setY(-this.scroll.verticalBarPos, 1 === yRatio), this.scroll.verticalBarPos -= this.table.scenegraph.proxy.deltaY,
|
|
394
|
+
this.table.scenegraph.proxy.deltaY = 0, this.updateHoverPos(-1, -1), this.table.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.SCROLL, {
|
|
395
395
|
event: void 0,
|
|
396
|
-
scrollTop:
|
|
396
|
+
scrollTop: this.scroll.verticalBarPos,
|
|
397
397
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
398
398
|
scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
|
|
399
399
|
scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
|
|
400
400
|
viewHeight: this.table.tableNoFrameHeight,
|
|
401
401
|
viewWidth: this.table.tableNoFrameWidth,
|
|
402
402
|
scrollDirection: "vertical",
|
|
403
|
-
scrollRatioY: yRatio
|
|
404
|
-
|
|
405
|
-
}).some((value => !1 === value))) {
|
|
406
|
-
const yRatio = this.scroll.verticalBarPos / (totalHeight - this.table.scenegraph.height);
|
|
407
|
-
this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
|
|
408
|
-
} else this.scroll.verticalBarPos = verticalBarPos, this.table.scenegraph.setY(-this.scroll.verticalBarPos, 1 === yRatio),
|
|
409
|
-
this.scroll.verticalBarPos -= this.table.scenegraph.proxy.deltaY, this.table.scenegraph.proxy.deltaY = 0,
|
|
410
|
-
this.updateHoverPos(-1, -1), oldVerticalBarPos !== this.scroll.verticalBarPos && this.checkVerticalScrollBarEnd();
|
|
403
|
+
scrollRatioY: yRatio
|
|
404
|
+
}), oldVerticalBarPos !== this.scroll.verticalBarPos && this.checkVerticalScrollBarEnd();
|
|
411
405
|
}
|
|
412
406
|
updateHorizontalScrollBar(xRatio) {
|
|
413
407
|
var _a, _b;
|
|
414
408
|
const totalWidth = this.table.getAllColsWidth(), oldHorizontalBarPos = this.scroll.horizontalBarPos;
|
|
415
|
-
|
|
416
|
-
(0, vutils_1.isValid)(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0)
|
|
417
|
-
|
|
418
|
-
|
|
409
|
+
this.scroll.horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width)),
|
|
410
|
+
(0, vutils_1.isValid)(this.scroll.horizontalBarPos) && !isNaN(this.scroll.horizontalBarPos) || (this.scroll.horizontalBarPos = 0),
|
|
411
|
+
this.table.scenegraph.setX(-this.scroll.horizontalBarPos, 1 === xRatio), this.scroll.horizontalBarPos -= this.table.scenegraph.proxy.deltaX,
|
|
412
|
+
this.table.scenegraph.proxy.deltaX = 0, this.updateHoverPos(-1, -1), this.table.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.SCROLL, {
|
|
419
413
|
event: void 0,
|
|
420
414
|
scrollTop: this.scroll.verticalBarPos,
|
|
421
|
-
scrollLeft:
|
|
415
|
+
scrollLeft: this.scroll.horizontalBarPos,
|
|
422
416
|
scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
|
|
423
417
|
scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
|
|
424
418
|
viewHeight: this.table.tableNoFrameHeight,
|
|
425
419
|
viewWidth: this.table.tableNoFrameWidth,
|
|
426
420
|
scrollDirection: "horizontal",
|
|
427
|
-
scrollRatioX: xRatio
|
|
428
|
-
|
|
429
|
-
}).some((value => !1 === value))) {
|
|
430
|
-
const xRatio = this.scroll.horizontalBarPos / (totalWidth - this.table.scenegraph.width);
|
|
431
|
-
this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
|
|
432
|
-
} else this.scroll.horizontalBarPos = horizontalBarPos, this.table.scenegraph.setX(-this.scroll.horizontalBarPos, 1 === xRatio),
|
|
433
|
-
this.scroll.horizontalBarPos -= this.table.scenegraph.proxy.deltaX, this.table.scenegraph.proxy.deltaX = 0,
|
|
434
|
-
this.updateHoverPos(-1, -1), oldHorizontalBarPos !== this.scroll.horizontalBarPos && this.checkHorizontalScrollBarEnd();
|
|
421
|
+
scrollRatioX: xRatio
|
|
422
|
+
}), oldHorizontalBarPos !== this.scroll.horizontalBarPos && this.checkHorizontalScrollBarEnd();
|
|
435
423
|
}
|
|
436
424
|
setScrollTop(top, event, triggerEvent = !0) {
|
|
437
|
-
var _a, _b, _c
|
|
425
|
+
var _a, _b, _c;
|
|
438
426
|
const totalHeight = this.table.getAllRowsHeight(), sizeTolerance = (null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0;
|
|
439
427
|
top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height - sizeTolerance)),
|
|
440
|
-
top = Math.ceil(top);
|
|
441
|
-
const oldVerticalBarPos = this.scroll.verticalBarPos
|
|
442
|
-
if ((oldVerticalBarPos !== top || !0 === (null === (_c = null === (_b = this.table.options) || void 0 === _b ? void 0 : _b.customConfig) || void 0 === _c ? void 0 : _c.scrollEventAlwaysTrigger)) && triggerEvent) {
|
|
443
|
-
let verticalBarPos = top;
|
|
444
|
-
(0, vutils_1.isValid)(verticalBarPos) && !isNaN(verticalBarPos) || (verticalBarPos = 0);
|
|
445
|
-
const dy = verticalBarPos - oldVerticalBarPos;
|
|
446
|
-
if (this.table.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.SCROLL, {
|
|
447
|
-
event: null == event ? void 0 : event.nativeEvent,
|
|
448
|
-
scrollTop: verticalBarPos,
|
|
449
|
-
scrollLeft: this.scroll.horizontalBarPos,
|
|
450
|
-
scrollHeight: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
|
|
451
|
-
scrollWidth: null === (_e = this.table.theme.scrollStyle) || void 0 === _e ? void 0 : _e.width,
|
|
452
|
-
viewHeight: this.table.tableNoFrameHeight,
|
|
453
|
-
viewWidth: this.table.tableNoFrameWidth,
|
|
454
|
-
scrollDirection: "vertical",
|
|
455
|
-
scrollRatioY: yRatio,
|
|
456
|
-
dy: dy
|
|
457
|
-
}).some((value => !1 === value))) {
|
|
458
|
-
const yRatio = this.scroll.verticalBarPos / (totalHeight - this.table.scenegraph.height);
|
|
459
|
-
return void this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
(top !== this.scroll.verticalBarPos || this.table.isPivotChart()) && this.updateHoverPos(-1, -1),
|
|
428
|
+
((top = Math.ceil(top)) !== this.scroll.verticalBarPos || this.table.isPivotChart()) && this.updateHoverPos(-1, -1);
|
|
429
|
+
const oldVerticalBarPos = this.scroll.verticalBarPos;
|
|
463
430
|
this.scroll.verticalBarPos = top, (0, vutils_1.isValid)(this.scroll.verticalBarPos) && !isNaN(this.scroll.verticalBarPos) || (this.scroll.verticalBarPos = 0),
|
|
464
|
-
this.table.scenegraph.setY(-top)
|
|
465
|
-
|
|
431
|
+
this.table.scenegraph.setY(-top);
|
|
432
|
+
const yRatio = top / (totalHeight - this.table.scenegraph.height);
|
|
433
|
+
this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio), oldVerticalBarPos !== top && triggerEvent && (this.table.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.SCROLL, {
|
|
434
|
+
event: null == event ? void 0 : event.nativeEvent,
|
|
435
|
+
scrollTop: this.scroll.verticalBarPos,
|
|
436
|
+
scrollLeft: this.scroll.horizontalBarPos,
|
|
437
|
+
scrollHeight: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
|
|
438
|
+
scrollWidth: null === (_c = this.table.theme.scrollStyle) || void 0 === _c ? void 0 : _c.width,
|
|
439
|
+
viewHeight: this.table.tableNoFrameHeight,
|
|
440
|
+
viewWidth: this.table.tableNoFrameWidth,
|
|
441
|
+
scrollDirection: "vertical",
|
|
442
|
+
scrollRatioY: yRatio
|
|
443
|
+
}), this.checkVerticalScrollBarEnd());
|
|
466
444
|
}
|
|
467
445
|
setScrollLeft(left, event, triggerEvent = !0) {
|
|
468
|
-
var _a, _b, _c
|
|
446
|
+
var _a, _b, _c;
|
|
469
447
|
this.table.scrollLeft;
|
|
470
448
|
const totalWidth = this.table.getAllColsWidth(), sizeTolerance = (this.table.getFrozenColsWidth(),
|
|
471
449
|
(null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0);
|
|
472
450
|
left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width - sizeTolerance)),
|
|
473
|
-
left = Math.ceil(left);
|
|
474
|
-
const oldHorizontalBarPos = this.scroll.horizontalBarPos
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
dx: dx
|
|
490
|
-
}).some((value => !1 === value))) {
|
|
491
|
-
const xRatio = this.scroll.horizontalBarPos / (totalWidth - this.table.scenegraph.width);
|
|
492
|
-
return void this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
left !== this.scroll.horizontalBarPos && this.updateHoverPos(-1, -1), this.scroll.horizontalBarPos = left,
|
|
496
|
-
(0, vutils_1.isValid)(this.scroll.horizontalBarPos) && !isNaN(this.scroll.horizontalBarPos) || (this.scroll.horizontalBarPos = 0),
|
|
497
|
-
this.table.scenegraph.setX(-left), this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio),
|
|
498
|
-
oldHorizontalBarPos !== left && triggerEvent && this.checkHorizontalScrollBarEnd();
|
|
451
|
+
(left = Math.ceil(left)) !== this.scroll.horizontalBarPos && this.updateHoverPos(-1, -1);
|
|
452
|
+
const oldHorizontalBarPos = this.scroll.horizontalBarPos;
|
|
453
|
+
this.scroll.horizontalBarPos = left, (0, vutils_1.isValid)(this.scroll.horizontalBarPos) && !isNaN(this.scroll.horizontalBarPos) || (this.scroll.horizontalBarPos = 0),
|
|
454
|
+
this.table.scenegraph.setX(-left);
|
|
455
|
+
const xRatio = left / (totalWidth - this.table.scenegraph.width);
|
|
456
|
+
this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio), oldHorizontalBarPos !== left && triggerEvent && (this.table.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.SCROLL, {
|
|
457
|
+
event: null == event ? void 0 : event.nativeEvent,
|
|
458
|
+
scrollTop: this.scroll.verticalBarPos,
|
|
459
|
+
scrollLeft: this.scroll.horizontalBarPos,
|
|
460
|
+
scrollHeight: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
|
|
461
|
+
scrollWidth: null === (_c = this.table.theme.scrollStyle) || void 0 === _c ? void 0 : _c.width,
|
|
462
|
+
viewHeight: this.table.tableNoFrameHeight,
|
|
463
|
+
viewWidth: this.table.tableNoFrameWidth,
|
|
464
|
+
scrollDirection: "horizontal",
|
|
465
|
+
scrollRatioX: xRatio
|
|
466
|
+
}), this.checkHorizontalScrollBarEnd());
|
|
499
467
|
}
|
|
500
468
|
hideVerticalScrollBar() {
|
|
501
469
|
this.table.scenegraph.component.hideVerticalScrollBar();
|