k-vtable 1.0.17 → 1.0.19

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 (139) hide show
  1. package/cjs/ListTable.js +2 -1
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.d.ts +4 -0
  4. package/cjs/PivotChart.js +30 -18
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/PivotTable.js +2 -1
  7. package/cjs/PivotTable.js.map +1 -1
  8. package/cjs/core/BaseTable.d.ts +4 -4
  9. package/cjs/core/BaseTable.js +21 -21
  10. package/cjs/core/BaseTable.js.map +1 -1
  11. package/cjs/core/record-helper.js +12 -4
  12. package/cjs/core/record-helper.js.map +1 -1
  13. package/cjs/data/DataSource.d.ts +1 -0
  14. package/cjs/data/DataSource.js +6 -9
  15. package/cjs/data/DataSource.js.map +1 -1
  16. package/cjs/dataset/dataset.js +1 -1
  17. package/cjs/dataset/dataset.js.map +1 -1
  18. package/cjs/event/event.js +17 -8
  19. package/cjs/event/event.js.map +1 -1
  20. package/cjs/event/listener/container-dom.js +20 -17
  21. package/cjs/event/listener/container-dom.js.map +1 -1
  22. package/cjs/event/self-event-listener/list-table/checkbox.js +4 -2
  23. package/cjs/event/self-event-listener/list-table/checkbox.js.map +1 -1
  24. package/cjs/index.d.ts +3 -3
  25. package/cjs/index.js +4 -4
  26. package/cjs/index.js.map +1 -1
  27. package/cjs/layout/chart-helper/get-axis-config.js +73 -28
  28. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  29. package/cjs/layout/chart-helper/get-chart-spec.js +19 -9
  30. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  31. package/cjs/layout/pivot-header-layout.d.ts +3 -3
  32. package/cjs/layout/pivot-header-layout.js +23 -12
  33. package/cjs/layout/pivot-header-layout.js.map +1 -1
  34. package/cjs/scenegraph/graphic/chart.d.ts +1 -0
  35. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  36. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +4 -1
  37. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  38. package/cjs/scenegraph/graphic/contributions/chart-render.js +4 -1
  39. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  40. package/cjs/scenegraph/graphic/contributions/vchart-graphic-picker.js +9 -0
  41. package/cjs/scenegraph/graphic/contributions/vchart-graphic-picker.js.map +1 -1
  42. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  43. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  44. package/cjs/scenegraph/layout/compute-col-width.js +3 -1
  45. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  46. package/cjs/scenegraph/layout/compute-row-height.js +13 -6
  47. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  48. package/cjs/scenegraph/layout/frozen.js +2 -2
  49. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  50. package/cjs/scenegraph/scenegraph.js +1 -1
  51. package/cjs/scenegraph/scenegraph.js.map +1 -1
  52. package/cjs/scenegraph/select/update-select-border.js +24 -21
  53. package/cjs/scenegraph/select/update-select-border.js.map +1 -1
  54. package/cjs/state/cell-move/index.js +1 -1
  55. package/cjs/state/cell-move/index.js.map +1 -1
  56. package/cjs/state/resize/update-resize-column.js +1 -1
  57. package/cjs/state/resize/update-resize-column.js.map +1 -1
  58. package/cjs/state/select/update-position.d.ts +1 -1
  59. package/cjs/state/select/update-position.js +7 -7
  60. package/cjs/state/select/update-position.js.map +1 -1
  61. package/cjs/state/state.d.ts +2 -1
  62. package/cjs/state/state.js +5 -4
  63. package/cjs/state/state.js.map +1 -1
  64. package/cjs/ts-types/base-table.d.ts +1 -0
  65. package/cjs/ts-types/base-table.js.map +1 -1
  66. package/cjs/ts-types/table-engine.d.ts +1 -0
  67. package/cjs/ts-types/table-engine.js.map +1 -1
  68. package/cjs/vrender.js.map +1 -1
  69. package/dist/vtable.js +387 -129
  70. package/dist/vtable.min.js +2 -2
  71. package/es/ListTable.js +2 -1
  72. package/es/ListTable.js.map +1 -1
  73. package/es/PivotChart.d.ts +4 -0
  74. package/es/PivotChart.js +30 -18
  75. package/es/PivotChart.js.map +1 -1
  76. package/es/PivotTable.js +2 -1
  77. package/es/PivotTable.js.map +1 -1
  78. package/es/core/BaseTable.d.ts +4 -4
  79. package/es/core/BaseTable.js +21 -21
  80. package/es/core/BaseTable.js.map +1 -1
  81. package/es/core/record-helper.js +12 -4
  82. package/es/core/record-helper.js.map +1 -1
  83. package/es/data/DataSource.d.ts +1 -0
  84. package/es/data/DataSource.js +6 -9
  85. package/es/data/DataSource.js.map +1 -1
  86. package/es/dataset/dataset.js +1 -1
  87. package/es/dataset/dataset.js.map +1 -1
  88. package/es/event/event.js +17 -8
  89. package/es/event/event.js.map +1 -1
  90. package/es/event/listener/container-dom.js +20 -17
  91. package/es/event/listener/container-dom.js.map +1 -1
  92. package/es/event/self-event-listener/list-table/checkbox.js +4 -2
  93. package/es/event/self-event-listener/list-table/checkbox.js.map +1 -1
  94. package/es/index.d.ts +3 -3
  95. package/es/index.js +3 -3
  96. package/es/index.js.map +1 -1
  97. package/es/layout/chart-helper/get-axis-config.js +73 -28
  98. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  99. package/es/layout/chart-helper/get-chart-spec.js +19 -9
  100. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  101. package/es/layout/pivot-header-layout.d.ts +3 -3
  102. package/es/layout/pivot-header-layout.js +23 -12
  103. package/es/layout/pivot-header-layout.js.map +1 -1
  104. package/es/scenegraph/graphic/chart.d.ts +1 -0
  105. package/es/scenegraph/graphic/chart.js.map +1 -1
  106. package/es/scenegraph/graphic/contributions/chart-render-helper.js +4 -1
  107. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  108. package/es/scenegraph/graphic/contributions/chart-render.js +4 -1
  109. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  110. package/es/scenegraph/graphic/contributions/vchart-graphic-picker.js +9 -0
  111. package/es/scenegraph/graphic/contributions/vchart-graphic-picker.js.map +1 -1
  112. package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  113. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  114. package/es/scenegraph/layout/compute-col-width.js +3 -1
  115. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  116. package/es/scenegraph/layout/compute-row-height.js +13 -6
  117. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  118. package/es/scenegraph/layout/frozen.js +2 -2
  119. package/es/scenegraph/layout/frozen.js.map +1 -1
  120. package/es/scenegraph/scenegraph.js +1 -1
  121. package/es/scenegraph/scenegraph.js.map +1 -1
  122. package/es/scenegraph/select/update-select-border.js +24 -21
  123. package/es/scenegraph/select/update-select-border.js.map +1 -1
  124. package/es/state/cell-move/index.js +1 -1
  125. package/es/state/cell-move/index.js.map +1 -1
  126. package/es/state/resize/update-resize-column.js +1 -1
  127. package/es/state/resize/update-resize-column.js.map +1 -1
  128. package/es/state/select/update-position.d.ts +1 -1
  129. package/es/state/select/update-position.js +7 -7
  130. package/es/state/select/update-position.js.map +1 -1
  131. package/es/state/state.d.ts +2 -1
  132. package/es/state/state.js +5 -4
  133. package/es/state/state.js.map +1 -1
  134. package/es/ts-types/base-table.d.ts +1 -0
  135. package/es/ts-types/base-table.js.map +1 -1
  136. package/es/ts-types/table-engine.d.ts +1 -0
  137. package/es/ts-types/table-engine.js.map +1 -1
  138. package/es/vrender.js.map +1 -1
  139. package/package.json +6 -6
@@ -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.0.17", this.id = `VTable${Date.now()}`,
46
+ if (super(), this.showFrozenIcon = !0, this.version = "1.0.19", 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");
@@ -118,8 +118,8 @@ class BaseTable extends EventTarget_1.EventTarget {
118
118
  if (internalProps.calcWidthContext = {
119
119
  _: internalProps,
120
120
  get full() {
121
- var _a;
122
- 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);
121
+ var _a, _b;
122
+ 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);
123
123
  }
124
124
  }, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes_1.default.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes_1.default.DEFAULT),
125
125
  internalProps.theme.isPivot = this.isPivotTable(), (0, icons_1.setIconColor)(internalProps.theme.functionalIconsStyle),
@@ -436,12 +436,12 @@ class BaseTable extends EventTarget_1.EventTarget {
436
436
  var _a;
437
437
  if (pixelRatio !== (null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.pixelRatio)) {
438
438
  this.internalProps.pixelRatio = pixelRatio;
439
- const canvasWidth = this.canvasWidth;
439
+ const that = this, canvasWidth = this.canvasWidth;
440
440
  this.internalProps.calcWidthContext = {
441
441
  _: this.internalProps,
442
442
  get full() {
443
- var _a;
444
- 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);
443
+ var _a, _b;
444
+ 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);
445
445
  }
446
446
  }, this.scenegraph.setPixelRatio(pixelRatio);
447
447
  }
@@ -926,7 +926,7 @@ class BaseTable extends EventTarget_1.EventTarget {
926
926
  this.release();
927
927
  }
928
928
  release() {
929
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
929
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
930
930
  const internalProps = this.internalProps;
931
931
  if (this.isReleased) return;
932
932
  null === (_b = null === (_a = internalProps.tooltipHandler) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a),
@@ -943,10 +943,10 @@ class BaseTable extends EventTarget_1.EventTarget {
943
943
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
944
944
  })), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release(),
945
945
  internalProps.focusControl.release();
946
- const {parentElement: parentElement} = internalProps.element;
946
+ const parentElement = null === (_o = internalProps.element) || void 0 === _o ? void 0 : _o.parentElement;
947
947
  parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
948
- 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),
949
- this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_r = this.reactCustomLayout) || void 0 === _r || _r.clearCache(),
948
+ 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),
949
+ this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_s = this.reactCustomLayout) || void 0 === _s || _s.clearCache(),
950
950
  (0, chart_render_helper_1.clearChartRenderQueue)();
951
951
  }
952
952
  fireListeners(type, event) {
@@ -1150,10 +1150,10 @@ class BaseTable extends EventTarget_1.EventTarget {
1150
1150
  clearSelected() {
1151
1151
  this.stateManager.updateSelectPos(-1, -1);
1152
1152
  }
1153
- selectCell(col, row, isShift, isCtrl, makeSelectCellVisible, skipBodyMerge = !1) {
1153
+ selectCell(col, row, enableShiftSelectMode, enableCtrlSelectMode, makeSelectCellVisible, skipBodyMerge = !1) {
1154
1154
  var _a, _b, _c;
1155
1155
  const isHasSelected = !!(null === (_a = this.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
1156
- 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),
1156
+ 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),
1157
1157
  this.stateManager.endSelectCells(!0, isHasSelected);
1158
1158
  }
1159
1159
  selectCells(cellRanges) {
@@ -1216,25 +1216,25 @@ class BaseTable extends EventTarget_1.EventTarget {
1216
1216
  }
1217
1217
  } ]);
1218
1218
  }
1219
- startDragSelectCol(colIndex, isCtrl, isShift) {
1219
+ startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode) {
1220
1220
  var _a, _b, _c, _d, _e, _f;
1221
- 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;
1222
- 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),
1223
- 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);
1221
+ 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;
1222
+ 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),
1223
+ 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);
1224
1224
  }
1225
- dragSelectCol(colIndex, isCtrl) {
1225
+ dragSelectCol(colIndex, enableCtrlSelectMode) {
1226
1226
  var _a, _b;
1227
1227
  const currentSelectRanges = this.stateManager.select.ranges, lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
1228
- 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);
1228
+ 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);
1229
1229
  }
1230
1230
  endDragSelect() {
1231
1231
  this.stateManager.updateInteractionState(ts_types_1.InteractionState.default), this.stateManager.endSelectCells(!1, !1);
1232
1232
  }
1233
- startDragSelectRow(rowIndex, isCtrl, isShift) {
1233
+ startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
1234
1234
  var _a, _b, _c, _d, _e, _f;
1235
1235
  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;
1236
- 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),
1237
- 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);
1236
+ 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),
1237
+ 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);
1238
1238
  }
1239
1239
  dragSelectRow(rowIndex, isCtrl) {
1240
1240
  var _a, _b;