@visactor/vtable 1.20.1-alpha.0 → 1.20.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 (107) hide show
  1. package/cjs/ListTable.js +3 -2
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotTable.js +2 -1
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/core/BaseTable.d.ts +4 -4
  6. package/cjs/core/BaseTable.js +21 -21
  7. package/cjs/core/BaseTable.js.map +1 -1
  8. package/cjs/core/record-helper.js +12 -4
  9. package/cjs/core/record-helper.js.map +1 -1
  10. package/cjs/data/DataSource.d.ts +1 -0
  11. package/cjs/data/DataSource.js +6 -9
  12. package/cjs/data/DataSource.js.map +1 -1
  13. package/cjs/event/event.js +17 -8
  14. package/cjs/event/event.js.map +1 -1
  15. package/cjs/event/listener/container-dom.js +20 -17
  16. package/cjs/event/listener/container-dom.js.map +1 -1
  17. package/cjs/event/self-event-listener/list-table/checkbox.js +4 -2
  18. package/cjs/event/self-event-listener/list-table/checkbox.js.map +1 -1
  19. package/cjs/index.d.ts +1 -1
  20. package/cjs/index.js +1 -1
  21. package/cjs/index.js.map +1 -1
  22. package/cjs/layout/pivot-header-layout.d.ts +2 -2
  23. package/cjs/layout/pivot-header-layout.js +5 -4
  24. package/cjs/layout/pivot-header-layout.js.map +1 -1
  25. package/cjs/plugins/custom-cell-style.js +1 -1
  26. package/cjs/scenegraph/graphic/chart.d.ts +1 -0
  27. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  28. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +4 -1
  29. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  30. package/cjs/scenegraph/graphic/contributions/chart-render.js +4 -1
  31. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  32. package/cjs/scenegraph/graphic/contributions/vchart-graphic-picker.js +9 -0
  33. package/cjs/scenegraph/graphic/contributions/vchart-graphic-picker.js.map +1 -1
  34. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  35. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  36. package/cjs/scenegraph/layout/compute-col-width.js +3 -1
  37. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  38. package/cjs/scenegraph/layout/compute-row-height.js +13 -6
  39. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  40. package/cjs/scenegraph/scenegraph.js +1 -1
  41. package/cjs/scenegraph/scenegraph.js.map +1 -1
  42. package/cjs/state/select/update-position.d.ts +1 -1
  43. package/cjs/state/select/update-position.js +7 -7
  44. package/cjs/state/select/update-position.js.map +1 -1
  45. package/cjs/state/state.d.ts +2 -1
  46. package/cjs/state/state.js +5 -4
  47. package/cjs/state/state.js.map +1 -1
  48. package/cjs/ts-types/base-table.d.ts +1 -0
  49. package/cjs/ts-types/base-table.js.map +1 -1
  50. package/cjs/ts-types/table-engine.d.ts +1 -0
  51. package/cjs/ts-types/table-engine.js.map +1 -1
  52. package/cjs/vrender.js.map +1 -1
  53. package/dist/vtable.js +130 -66
  54. package/dist/vtable.min.js +2 -2
  55. package/es/ListTable.js +3 -2
  56. package/es/ListTable.js.map +1 -1
  57. package/es/PivotTable.js +2 -1
  58. package/es/PivotTable.js.map +1 -1
  59. package/es/core/BaseTable.d.ts +4 -4
  60. package/es/core/BaseTable.js +21 -21
  61. package/es/core/BaseTable.js.map +1 -1
  62. package/es/core/record-helper.js +12 -4
  63. package/es/core/record-helper.js.map +1 -1
  64. package/es/data/DataSource.d.ts +1 -0
  65. package/es/data/DataSource.js +6 -9
  66. package/es/data/DataSource.js.map +1 -1
  67. package/es/event/event.js +17 -8
  68. package/es/event/event.js.map +1 -1
  69. package/es/event/listener/container-dom.js +20 -17
  70. package/es/event/listener/container-dom.js.map +1 -1
  71. package/es/event/self-event-listener/list-table/checkbox.js +4 -2
  72. package/es/event/self-event-listener/list-table/checkbox.js.map +1 -1
  73. package/es/index.d.ts +1 -1
  74. package/es/index.js +1 -1
  75. package/es/index.js.map +1 -1
  76. package/es/layout/pivot-header-layout.d.ts +2 -2
  77. package/es/layout/pivot-header-layout.js +5 -4
  78. package/es/layout/pivot-header-layout.js.map +1 -1
  79. package/es/plugins/custom-cell-style.js +1 -1
  80. package/es/scenegraph/graphic/chart.d.ts +1 -0
  81. package/es/scenegraph/graphic/chart.js.map +1 -1
  82. package/es/scenegraph/graphic/contributions/chart-render-helper.js +4 -1
  83. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  84. package/es/scenegraph/graphic/contributions/chart-render.js +4 -1
  85. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  86. package/es/scenegraph/graphic/contributions/vchart-graphic-picker.js +9 -0
  87. package/es/scenegraph/graphic/contributions/vchart-graphic-picker.js.map +1 -1
  88. package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  89. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  90. package/es/scenegraph/layout/compute-col-width.js +3 -1
  91. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  92. package/es/scenegraph/layout/compute-row-height.js +13 -6
  93. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  94. package/es/scenegraph/scenegraph.js +1 -1
  95. package/es/scenegraph/scenegraph.js.map +1 -1
  96. package/es/state/select/update-position.d.ts +1 -1
  97. package/es/state/select/update-position.js +7 -7
  98. package/es/state/select/update-position.js.map +1 -1
  99. package/es/state/state.d.ts +2 -1
  100. package/es/state/state.js +5 -4
  101. package/es/state/state.js.map +1 -1
  102. package/es/ts-types/base-table.d.ts +1 -0
  103. package/es/ts-types/base-table.js.map +1 -1
  104. package/es/ts-types/table-engine.d.ts +1 -0
  105. package/es/ts-types/table-engine.js.map +1 -1
  106. package/es/vrender.js.map +1 -1
  107. package/package.json +5 -5
@@ -281,14 +281,14 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
281
281
  getTargetColAtConsiderRightFrozen(absoluteX: number, isConsider: boolean): ColumnInfo | null;
282
282
  getTargetRowAtConsiderBottomFrozen(absoluteY: number, isConsider: boolean): RowInfo | null;
283
283
  clearSelected(): void;
284
- selectCell(col: number, row: number, isShift?: boolean, isCtrl?: boolean, makeSelectCellVisible?: boolean, skipBodyMerge?: boolean): void;
284
+ selectCell(col: number, row: number, enableShiftSelectMode?: boolean, enableCtrlSelectMode?: boolean, makeSelectCellVisible?: boolean, skipBodyMerge?: boolean): void;
285
285
  selectCells(cellRanges: CellRange[]): void;
286
286
  selectRow(rowIndex: number, isCtrl?: boolean, isShift?: boolean): void;
287
287
  selectCol(colIndex: number, isCtrl?: boolean, isShift?: boolean): void;
288
- startDragSelectCol(colIndex: number, isCtrl?: boolean, isShift?: boolean): void;
289
- dragSelectCol(colIndex: number, isCtrl?: boolean): void;
288
+ startDragSelectCol(colIndex: number, enableCtrlSelectMode?: boolean, enableShiftSelectMode?: boolean): void;
289
+ dragSelectCol(colIndex: number, enableCtrlSelectMode?: boolean): void;
290
290
  endDragSelect(): void;
291
- startDragSelectRow(rowIndex: number, isCtrl?: boolean, isShift?: boolean): void;
291
+ startDragSelectRow(rowIndex: number, enableCtrlSelectMode?: boolean, isShift?: boolean): void;
292
292
  dragSelectRow(rowIndex: number, isCtrl?: boolean): void;
293
293
  abstract isListTable(): boolean;
294
294
  abstract isPivotTable(): boolean;
@@ -43,7 +43,7 @@ class BaseTable extends EventTarget_1.EventTarget {
43
43
  }
44
44
  constructor(container, options = {}) {
45
45
  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;
46
- if (super(), this.showFrozenIcon = !0, this.version = "1.20.1-alpha.0", this.id = `VTable${Date.now()}`,
46
+ if (super(), this.showFrozenIcon = !0, this.version = "1.20.1", this.id = `VTable${Date.now()}`,
47
47
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
48
48
  "node" === env_1.Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
49
49
  container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
@@ -116,8 +116,8 @@ class BaseTable extends EventTarget_1.EventTarget {
116
116
  if (internalProps.calcWidthContext = {
117
117
  _: internalProps,
118
118
  get full() {
119
- var _a;
120
- return "node" === env_1.Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
119
+ var _a, _b;
120
+ return "node" === env_1.Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_b = null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : that.internalProps.pixelRatio) && void 0 !== _b ? _b : window.devicePixelRatio);
121
121
  }
122
122
  }, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes_1.default.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes_1.default.DEFAULT),
123
123
  internalProps.theme.isPivot = this.isPivotTable(), (0, icons_1.setIconColor)(internalProps.theme.functionalIconsStyle),
@@ -434,12 +434,12 @@ class BaseTable extends EventTarget_1.EventTarget {
434
434
  var _a;
435
435
  if (pixelRatio !== (null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.pixelRatio)) {
436
436
  this.internalProps.pixelRatio = pixelRatio;
437
- const canvasWidth = this.canvasWidth;
437
+ const that = this, canvasWidth = this.canvasWidth;
438
438
  this.internalProps.calcWidthContext = {
439
439
  _: this.internalProps,
440
440
  get full() {
441
- var _a;
442
- return "node" === env_1.Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
441
+ var _a, _b;
442
+ return "node" === env_1.Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_b = null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : that.internalProps.pixelRatio) && void 0 !== _b ? _b : window.devicePixelRatio);
443
443
  }
444
444
  }, this.scenegraph.setPixelRatio(pixelRatio);
445
445
  }
@@ -924,7 +924,7 @@ class BaseTable extends EventTarget_1.EventTarget {
924
924
  this.release();
925
925
  }
926
926
  release() {
927
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
927
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
928
928
  const internalProps = this.internalProps;
929
929
  if (this.isReleased) return;
930
930
  null === (_b = null === (_a = internalProps.tooltipHandler) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a),
@@ -941,10 +941,10 @@ class BaseTable extends EventTarget_1.EventTarget {
941
941
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
942
942
  })), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release(),
943
943
  internalProps.focusControl.release();
944
- const {parentElement: parentElement} = internalProps.element;
944
+ const parentElement = null === (_o = internalProps.element) || void 0 === _o ? void 0 : _o.parentElement;
945
945
  parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
946
- null === (_q = null === (_p = null === (_o = this.editorManager) || void 0 === _o ? void 0 : _o.editingEditor) || void 0 === _p ? void 0 : _p.onEnd) || void 0 === _q || _q.call(_p),
947
- this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_r = this.reactCustomLayout) || void 0 === _r || _r.clearCache(),
946
+ null === (_r = null === (_q = null === (_p = this.editorManager) || void 0 === _p ? void 0 : _p.editingEditor) || void 0 === _q ? void 0 : _q.onEnd) || void 0 === _r || _r.call(_q),
947
+ this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_s = this.reactCustomLayout) || void 0 === _s || _s.clearCache(),
948
948
  (0, chart_render_helper_1.clearChartRenderQueue)();
949
949
  }
950
950
  fireListeners(type, event) {
@@ -1148,10 +1148,10 @@ class BaseTable extends EventTarget_1.EventTarget {
1148
1148
  clearSelected() {
1149
1149
  this.stateManager.updateSelectPos(-1, -1);
1150
1150
  }
1151
- selectCell(col, row, isShift, isCtrl, makeSelectCellVisible, skipBodyMerge = !1) {
1151
+ selectCell(col, row, enableShiftSelectMode, enableCtrlSelectMode, makeSelectCellVisible, skipBodyMerge = !1) {
1152
1152
  var _a, _b, _c;
1153
1153
  const isHasSelected = !!(null === (_a = this.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
1154
- this.stateManager.updateSelectPos(col, row, isShift, isCtrl, !1, null === (_c = null != makeSelectCellVisible ? makeSelectCellVisible : null === (_b = this.options.select) || void 0 === _b ? void 0 : _b.makeSelectCellVisible) || void 0 === _c || _c, skipBodyMerge),
1154
+ this.stateManager.updateSelectPos(col, row, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_c = null != makeSelectCellVisible ? makeSelectCellVisible : null === (_b = this.options.select) || void 0 === _b ? void 0 : _b.makeSelectCellVisible) || void 0 === _c || _c, skipBodyMerge),
1155
1155
  this.stateManager.endSelectCells(!0, isHasSelected);
1156
1156
  }
1157
1157
  selectCells(cellRanges) {
@@ -1214,25 +1214,25 @@ class BaseTable extends EventTarget_1.EventTarget {
1214
1214
  }
1215
1215
  } ]);
1216
1216
  }
1217
- startDragSelectCol(colIndex, isCtrl, isShift) {
1217
+ startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode) {
1218
1218
  var _a, _b, _c, _d, _e, _f;
1219
- const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1], startCol = isShift && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.col) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.col : colIndex, endCol = colIndex, endRow = this.rowCount - 1;
1220
- this.stateManager.updateSelectPos(startCol, 0, isShift, isCtrl, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0),
1221
- this.stateManager.updateInteractionState(ts_types_1.InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, isCtrl, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
1219
+ const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1], startCol = enableShiftSelectMode && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.col) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.col : colIndex, endCol = colIndex, endRow = this.rowCount - 1;
1220
+ this.stateManager.updateSelectPos(startCol, 0, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0),
1221
+ this.stateManager.updateInteractionState(ts_types_1.InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, enableShiftSelectMode, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
1222
1222
  }
1223
- dragSelectCol(colIndex, isCtrl) {
1223
+ dragSelectCol(colIndex, enableCtrlSelectMode) {
1224
1224
  var _a, _b;
1225
1225
  const currentSelectRanges = this.stateManager.select.ranges, lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
1226
- lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, isCtrl, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
1226
+ lastSelectRange && (lastSelectRange.end.col = colIndex), this.stateManager.updateSelectPos(colIndex, this.rowCount - 1, !1, enableCtrlSelectMode, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0);
1227
1227
  }
1228
1228
  endDragSelect() {
1229
1229
  this.stateManager.updateInteractionState(ts_types_1.InteractionState.default), this.stateManager.endSelectCells(!1, !1);
1230
1230
  }
1231
- startDragSelectRow(rowIndex, isCtrl, isShift) {
1231
+ startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
1232
1232
  var _a, _b, _c, _d, _e, _f;
1233
1233
  const lastSelectRange = this.stateManager.select.ranges[this.stateManager.select.ranges.length - 1], startRow = isShift && (null === (_a = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _a ? void 0 : _a.row) ? null === (_b = null == lastSelectRange ? void 0 : lastSelectRange.start) || void 0 === _b ? void 0 : _b.row : rowIndex, endCol = this.colCount - 1, endRow = rowIndex;
1234
- this.stateManager.updateSelectPos(0, startRow, isShift, isCtrl, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0),
1235
- this.stateManager.updateInteractionState(ts_types_1.InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, isCtrl, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
1234
+ this.stateManager.updateSelectPos(0, startRow, isShift, enableCtrlSelectMode, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0),
1235
+ this.stateManager.updateInteractionState(ts_types_1.InteractionState.grabing), this.stateManager.updateSelectPos(endCol, endRow, isShift, enableCtrlSelectMode, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0);
1236
1236
  }
1237
1237
  dragSelectRow(rowIndex, isCtrl) {
1238
1238
  var _a, _b;