@visactor/vtable 1.26.2 → 1.26.3-alpha.0

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 (61) hide show
  1. package/cjs/dataset/DataStatistics.js +1 -2
  2. package/cjs/edit/edit-manager.js +1 -0
  3. package/cjs/event/EventHandler.js +1 -1
  4. package/cjs/event/EventTarget.js +1 -1
  5. package/cjs/event/drill.js +1 -1
  6. package/cjs/event/event.js +1 -1
  7. package/cjs/event/helper.js +1 -1
  8. package/cjs/event/media-click.js +1 -1
  9. package/cjs/event/scroll.js +1 -1
  10. package/cjs/event/sparkline-event.js +1 -1
  11. package/cjs/event/util.js +1 -1
  12. package/cjs/header-helper/style.js +2 -1
  13. package/cjs/layout/pivot-header-layout.js +0 -1
  14. package/cjs/plugins/index.js +1 -1
  15. package/cjs/plugins/interface.js +1 -1
  16. package/cjs/plugins/invert-highlight.js +1 -1
  17. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  18. package/cjs/plugins/plugin-manager.js +1 -1
  19. package/cjs/scenegraph/component/table-component.js +41 -50
  20. package/cjs/scenegraph/component/table-component.js.map +1 -1
  21. package/cjs/scenegraph/component/util.d.ts +1 -0
  22. package/cjs/scenegraph/component/util.js +9 -1
  23. package/cjs/scenegraph/component/util.js.map +1 -1
  24. package/cjs/scenegraph/scenegraph.js +6 -4
  25. package/cjs/scenegraph/scenegraph.js.map +1 -1
  26. package/cjs/state/state.js +16 -16
  27. package/cjs/state/state.js.map +1 -1
  28. package/cjs/themes/ARCO.js +1 -1
  29. package/cjs/themes/BRIGHT.js +1 -1
  30. package/dist/vtable.js +80 -78
  31. package/dist/vtable.min.js +1 -1
  32. package/es/dataset/DataStatistics.js +1 -2
  33. package/es/edit/edit-manager.js +2 -1
  34. package/es/event/EventHandler.js +1 -1
  35. package/es/event/EventTarget.js +1 -1
  36. package/es/event/drill.js +1 -1
  37. package/es/event/event.js +1 -1
  38. package/es/event/helper.js +1 -1
  39. package/es/event/media-click.js +1 -1
  40. package/es/event/scroll.js +1 -1
  41. package/es/event/sparkline-event.js +1 -1
  42. package/es/event/util.js +1 -1
  43. package/es/header-helper/style.js +2 -1
  44. package/es/layout/pivot-header-layout.js +1 -2
  45. package/es/plugins/index.js +1 -1
  46. package/es/plugins/interface.js +1 -1
  47. package/es/plugins/invert-highlight.js +1 -1
  48. package/es/plugins/list-tree-stick-cell.js +1 -1
  49. package/es/plugins/plugin-manager.js +1 -1
  50. package/es/scenegraph/component/table-component.js +41 -51
  51. package/es/scenegraph/component/table-component.js.map +1 -1
  52. package/es/scenegraph/component/util.d.ts +1 -0
  53. package/es/scenegraph/component/util.js +6 -0
  54. package/es/scenegraph/component/util.js.map +1 -1
  55. package/es/scenegraph/scenegraph.js +6 -4
  56. package/es/scenegraph/scenegraph.js.map +1 -1
  57. package/es/state/state.js +16 -14
  58. package/es/state/state.js.map +1 -1
  59. package/es/themes/ARCO.js +1 -1
  60. package/es/themes/BRIGHT.js +1 -1
  61. package/package.json +4 -4
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.StateManager = void 0;
6
6
 
7
- const menu_1 = require("../scenegraph/component/menu"), ts_types_1 = require("../ts-types"), ts_types_2 = require("../ts-types"), check_in_select_1 = require("./common/check-in-select"), update_position_1 = require("./hover/update-position"), frozen_1 = require("./frozen"), sort_1 = require("./sort"), update_position_2 = require("./select/update-position"), helper_1 = require("../tools/helper"), PIVOT_TABLE_EVENT_TYPE_1 = require("../ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE"), TABLE_EVENT_TYPE_1 = require("../core/TABLE_EVENT_TYPE"), vutils_1 = require("@visactor/vutils"), drill_1 = require("./drill"), spark_line_1 = require("./spark-line"), cell_move_1 = require("./cell-move"), icon_1 = require("../scenegraph/utils/icon"), debounce_1 = require("../tools/debounce"), update_resize_column_1 = require("./resize/update-resize-column"), radio_1 = require("./radio/radio"), checkbox_1 = require("./checkbox/checkbox"), update_resize_row_1 = require("./resize/update-resize-row"), delete_select_border_1 = require("../scenegraph/select/delete-select-border"), util_1 = require("../tools/util"), custom_select_1 = require("./select/custom-select"), merge_range_1 = require("../tools/merge-range");
7
+ const menu_1 = require("../scenegraph/component/menu"), ts_types_1 = require("../ts-types"), ts_types_2 = require("../ts-types"), check_in_select_1 = require("./common/check-in-select"), update_position_1 = require("./hover/update-position"), frozen_1 = require("./frozen"), sort_1 = require("./sort"), update_position_2 = require("./select/update-position"), helper_1 = require("../tools/helper"), PIVOT_TABLE_EVENT_TYPE_1 = require("../ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE"), TABLE_EVENT_TYPE_1 = require("../core/TABLE_EVENT_TYPE"), vutils_1 = require("@visactor/vutils"), drill_1 = require("./drill"), spark_line_1 = require("./spark-line"), cell_move_1 = require("./cell-move"), icon_1 = require("../scenegraph/utils/icon"), util_1 = require("../scenegraph/component/util"), debounce_1 = require("../tools/debounce"), update_resize_column_1 = require("./resize/update-resize-column"), radio_1 = require("./radio/radio"), checkbox_1 = require("./checkbox/checkbox"), update_resize_row_1 = require("./resize/update-resize-row"), delete_select_border_1 = require("../scenegraph/select/delete-select-border"), util_2 = require("../tools/util"), custom_select_1 = require("./select/custom-select"), merge_range_1 = require("../tools/merge-range");
8
8
 
9
9
  class StateManager {
10
10
  constructor(table) {
@@ -490,8 +490,8 @@ class StateManager {
490
490
  }), oldVerticalBarPos !== this.scroll.verticalBarPos && this.checkVerticalScrollBarEnd();
491
491
  }
492
492
  updateHorizontalScrollBar(xRatio) {
493
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
494
- const totalWidth = this.table.getAllColsWidth(), oldHorizontalBarPos = this.scroll.horizontalBarPos, frozenOffset = null !== (_c = null === (_b = (_a = this.table).getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0, rightFrozenOffset = null !== (_f = null === (_e = (_d = this.table).getRightFrozenColsOffset) || void 0 === _e ? void 0 : _e.call(_d)) && void 0 !== _f ? _f : 0, scrollRange = Math.max(0, totalWidth - this.table.scenegraph.width - frozenOffset - rightFrozenOffset);
493
+ var _a, _b, _c, _d;
494
+ const oldHorizontalBarPos = this.scroll.horizontalBarPos, scrollRange = (0, util_1.getBodyHorizontalScrollRange)(this.table);
495
495
  let horizontalBarPos = Math.ceil(xRatio * scrollRange);
496
496
  (0, vutils_1.isValid)(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
497
497
  const dx = horizontalBarPos - this.table.scenegraph.proxy.deltaX - oldHorizontalBarPos;
@@ -499,8 +499,8 @@ class StateManager {
499
499
  event: void 0,
500
500
  scrollTop: this.scroll.verticalBarPos,
501
501
  scrollLeft: horizontalBarPos - this.table.scenegraph.proxy.deltaX,
502
- scrollHeight: null === (_g = this.table.theme.scrollStyle) || void 0 === _g ? void 0 : _g.width,
503
- scrollWidth: null === (_h = this.table.theme.scrollStyle) || void 0 === _h ? void 0 : _h.width,
502
+ scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
503
+ scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
504
504
  viewHeight: this.table.tableNoFrameHeight,
505
505
  viewWidth: this.table.tableNoFrameWidth,
506
506
  scrollDirection: "horizontal",
@@ -515,8 +515,8 @@ class StateManager {
515
515
  event: void 0,
516
516
  scrollTop: this.scroll.verticalBarPos,
517
517
  scrollLeft: this.scroll.horizontalBarPos,
518
- scrollHeight: null === (_j = this.table.theme.scrollStyle) || void 0 === _j ? void 0 : _j.width,
519
- scrollWidth: null === (_k = this.table.theme.scrollStyle) || void 0 === _k ? void 0 : _k.width,
518
+ scrollHeight: null === (_c = this.table.theme.scrollStyle) || void 0 === _c ? void 0 : _c.width,
519
+ scrollWidth: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
520
520
  viewHeight: this.table.tableNoFrameHeight,
521
521
  viewWidth: this.table.tableNoFrameWidth,
522
522
  scrollDirection: "horizontal",
@@ -569,13 +569,13 @@ class StateManager {
569
569
  }), oldVerticalBarPos !== top && triggerEvent && this.checkVerticalScrollBarEnd();
570
570
  }
571
571
  setScrollLeft(left, event, triggerEvent = !0) {
572
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
572
+ var _a, _b, _c, _d, _e, _f, _g;
573
573
  if (!this.table || !this.table.scenegraph) return;
574
574
  this.table.scrollLeft;
575
- const totalWidth = this.table.getAllColsWidth(), frozenOffset = null !== (_c = null === (_b = (_a = this.table).getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0, rightFrozenOffset = null !== (_f = null === (_e = (_d = this.table).getRightFrozenColsOffset) || void 0 === _e ? void 0 : _e.call(_d)) && void 0 !== _f ? _f : 0, scrollRange = Math.max(0, totalWidth - this.table.scenegraph.width - frozenOffset - rightFrozenOffset), sizeTolerance = (null === (_g = this.table.options.customConfig) || void 0 === _g ? void 0 : _g._disableColumnAndRowSizeRound) ? 1 : 0;
575
+ const scrollRange = (0, util_1.getBodyHorizontalScrollRange)(this.table), sizeTolerance = (null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0;
576
576
  left = Math.max(0, Math.min(left, scrollRange - sizeTolerance)), left = Math.ceil(left);
577
577
  const oldHorizontalBarPos = this.scroll.horizontalBarPos, xRatio = scrollRange ? left / scrollRange : 0;
578
- if ((oldHorizontalBarPos !== left || !0 === (null === (_j = null === (_h = this.table.options) || void 0 === _h ? void 0 : _h.customConfig) || void 0 === _j ? void 0 : _j.scrollEventAlwaysTrigger)) && triggerEvent) {
578
+ 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) {
579
579
  let horizontalBarPos = left;
580
580
  (0, vutils_1.isValid)(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
581
581
  const dx = horizontalBarPos - oldHorizontalBarPos;
@@ -583,8 +583,8 @@ class StateManager {
583
583
  event: null == event ? void 0 : event.nativeEvent,
584
584
  scrollTop: this.scroll.verticalBarPos,
585
585
  scrollLeft: horizontalBarPos,
586
- scrollHeight: null === (_k = this.table.theme.scrollStyle) || void 0 === _k ? void 0 : _k.width,
587
- scrollWidth: null === (_l = this.table.theme.scrollStyle) || void 0 === _l ? void 0 : _l.width,
586
+ scrollHeight: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
587
+ scrollWidth: null === (_e = this.table.theme.scrollStyle) || void 0 === _e ? void 0 : _e.width,
588
588
  viewHeight: this.table.tableNoFrameHeight,
589
589
  viewWidth: this.table.tableNoFrameWidth,
590
590
  scrollDirection: "horizontal",
@@ -603,8 +603,8 @@ class StateManager {
603
603
  event: null == event ? void 0 : event.nativeEvent,
604
604
  scrollTop: this.scroll.verticalBarPos,
605
605
  scrollLeft: this.scroll.horizontalBarPos,
606
- scrollHeight: null === (_m = this.table.theme.scrollStyle) || void 0 === _m ? void 0 : _m.width,
607
- scrollWidth: null === (_o = this.table.theme.scrollStyle) || void 0 === _o ? void 0 : _o.width,
606
+ scrollHeight: null === (_f = this.table.theme.scrollStyle) || void 0 === _f ? void 0 : _f.width,
607
+ scrollWidth: null === (_g = this.table.theme.scrollStyle) || void 0 === _g ? void 0 : _g.width,
608
608
  viewHeight: this.table.tableNoFrameHeight,
609
609
  viewWidth: this.table.tableNoFrameWidth,
610
610
  scrollDirection: "horizontal",
@@ -778,7 +778,7 @@ class StateManager {
778
778
  this.sort[index].col = cellAddress.col, this.sort[index].row = cellAddress.row;
779
779
  const cellGroup = this.table.scenegraph.getCell(this.sort[index].col, this.sort[index].row);
780
780
  let iconMark;
781
- (0, util_1.traverseObject)(cellGroup, "children", (mark => "sort" === mark.attribute.funcType && (iconMark = mark,
781
+ (0, util_2.traverseObject)(cellGroup, "children", (mark => "sort" === mark.attribute.funcType && (iconMark = mark,
782
782
  !0))), this.table.scenegraph.updateSortIcon({
783
783
  col: this.sort[index].col,
784
784
  row: this.sort[index].row,
@@ -870,4 +870,4 @@ class StateManager {
870
870
  }
871
871
 
872
872
  exports.StateManager = StateManager;
873
- //# sourceMappingURL=state.js.map
873
+ //# sourceMappingURL=state.js.map