@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.
Files changed (59) hide show
  1. package/cjs/PivotTable.d.ts +0 -5
  2. package/cjs/PivotTable.js +0 -13
  3. package/cjs/PivotTable.js.map +1 -1
  4. package/cjs/core/BaseTable.js +13 -14
  5. package/cjs/core/BaseTable.js.map +1 -1
  6. package/cjs/dataset/dataset.js +4 -6
  7. package/cjs/dataset/dataset.js.map +1 -1
  8. package/cjs/index.d.ts +1 -1
  9. package/cjs/index.js +1 -1
  10. package/cjs/index.js.map +1 -1
  11. package/cjs/layout/pivot-header-layout.js +3 -5
  12. package/cjs/layout/pivot-header-layout.js.map +1 -1
  13. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  14. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +4 -4
  15. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  16. package/cjs/scenegraph/select/create-select-border.js +2 -13
  17. package/cjs/scenegraph/select/create-select-border.js.map +1 -1
  18. package/cjs/state/state.js +47 -79
  19. package/cjs/state/state.js.map +1 -1
  20. package/cjs/ts-types/base-table.d.ts +0 -1
  21. package/cjs/ts-types/base-table.js.map +1 -1
  22. package/cjs/ts-types/common.d.ts +1 -3
  23. package/cjs/ts-types/common.js.map +1 -1
  24. package/cjs/ts-types/events.d.ts +1 -3
  25. package/cjs/ts-types/events.js.map +1 -1
  26. package/cjs/ts-types/table-engine.d.ts +0 -1
  27. package/cjs/ts-types/table-engine.js.map +1 -1
  28. package/cjs/vrender.js.map +1 -1
  29. package/dist/vtable.js +62 -184
  30. package/dist/vtable.min.js +1 -1
  31. package/es/PivotTable.d.ts +0 -5
  32. package/es/PivotTable.js +0 -13
  33. package/es/PivotTable.js.map +1 -1
  34. package/es/core/BaseTable.js +13 -14
  35. package/es/core/BaseTable.js.map +1 -1
  36. package/es/dataset/dataset.js +4 -6
  37. package/es/dataset/dataset.js.map +1 -1
  38. package/es/index.d.ts +1 -1
  39. package/es/index.js +1 -1
  40. package/es/index.js.map +1 -1
  41. package/es/layout/pivot-header-layout.js +3 -5
  42. package/es/layout/pivot-header-layout.js.map +1 -1
  43. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  44. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +4 -4
  45. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  46. package/es/scenegraph/select/create-select-border.js +2 -13
  47. package/es/scenegraph/select/create-select-border.js.map +1 -1
  48. package/es/state/state.js +47 -79
  49. package/es/state/state.js.map +1 -1
  50. package/es/ts-types/base-table.d.ts +0 -1
  51. package/es/ts-types/base-table.js.map +1 -1
  52. package/es/ts-types/common.d.ts +1 -3
  53. package/es/ts-types/common.js.map +1 -1
  54. package/es/ts-types/events.d.ts +1 -3
  55. package/es/ts-types/events.js.map +1 -1
  56. package/es/ts-types/table-engine.d.ts +0 -1
  57. package/es/ts-types/table-engine.js.map +1 -1
  58. package/es/vrender.js.map +1 -1
  59. package/package.json +4 -4
@@ -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
- let verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height));
392
- (0, vutils_1.isValid)(verticalBarPos) && !isNaN(verticalBarPos) || (verticalBarPos = 0);
393
- const dy = verticalBarPos - this.table.scenegraph.proxy.deltaY - oldVerticalBarPos;
394
- if (this.table.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.SCROLL, {
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: verticalBarPos - this.table.scenegraph.proxy.deltaY,
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
- dy: dy
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
- let horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width));
416
- (0, vutils_1.isValid)(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
417
- const dx = horizontalBarPos - this.table.scenegraph.proxy.deltaX - oldHorizontalBarPos;
418
- if (this.table.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.SCROLL, {
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: horizontalBarPos - this.table.scenegraph.proxy.deltaX,
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
- dx: dx
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, _d, _e;
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, yRatio = top / (totalHeight - this.table.scenegraph.height);
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), this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio),
465
- oldVerticalBarPos !== top && triggerEvent && this.checkVerticalScrollBarEnd();
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, _d, _e;
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, xRatio = left / (totalWidth - this.table.scenegraph.width);
475
- if ((oldHorizontalBarPos !== left || !0 === (null === (_c = null === (_b = this.table.options) || void 0 === _b ? void 0 : _b.customConfig) || void 0 === _c ? void 0 : _c.scrollEventAlwaysTrigger)) && triggerEvent) {
476
- let horizontalBarPos = left;
477
- (0, vutils_1.isValid)(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
478
- const dx = horizontalBarPos - oldHorizontalBarPos;
479
- if (this.table.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.SCROLL, {
480
- event: null == event ? void 0 : event.nativeEvent,
481
- scrollTop: this.scroll.verticalBarPos,
482
- scrollLeft: horizontalBarPos,
483
- scrollHeight: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
484
- scrollWidth: null === (_e = this.table.theme.scrollStyle) || void 0 === _e ? void 0 : _e.width,
485
- viewHeight: this.table.tableNoFrameHeight,
486
- viewWidth: this.table.tableNoFrameWidth,
487
- scrollDirection: "horizontal",
488
- scrollRatioX: xRatio,
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();