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;
@@ -90,7 +90,7 @@ export class BaseTable extends EventTarget {
90
90
  }
91
91
  constructor(container, options = {}) {
92
92
  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;
93
- if (super(), this.showFrozenIcon = !0, this.version = "1.0.17", this.id = `VTable${Date.now()}`,
93
+ if (super(), this.showFrozenIcon = !0, this.version = "1.0.19", this.id = `VTable${Date.now()}`,
94
94
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
95
95
  "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
96
96
  container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
@@ -162,8 +162,8 @@ export class BaseTable extends EventTarget {
162
162
  if (internalProps.calcWidthContext = {
163
163
  _: internalProps,
164
164
  get full() {
165
- var _a;
166
- return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
165
+ var _a, _b;
166
+ return "node" === 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);
167
167
  }
168
168
  }, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes.DEFAULT),
169
169
  internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle),
@@ -480,12 +480,12 @@ export class BaseTable extends EventTarget {
480
480
  var _a;
481
481
  if (pixelRatio !== (null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.pixelRatio)) {
482
482
  this.internalProps.pixelRatio = pixelRatio;
483
- const canvasWidth = this.canvasWidth;
483
+ const that = this, canvasWidth = this.canvasWidth;
484
484
  this.internalProps.calcWidthContext = {
485
485
  _: this.internalProps,
486
486
  get full() {
487
- var _a;
488
- return "node" === Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
487
+ var _a, _b;
488
+ return "node" === 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);
489
489
  }
490
490
  }, this.scenegraph.setPixelRatio(pixelRatio);
491
491
  }
@@ -968,7 +968,7 @@ export class BaseTable extends EventTarget {
968
968
  this.release();
969
969
  }
970
970
  release() {
971
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
971
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
972
972
  const internalProps = this.internalProps;
973
973
  if (this.isReleased) return;
974
974
  null === (_b = null === (_a = internalProps.tooltipHandler) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a),
@@ -985,10 +985,10 @@ export class BaseTable extends EventTarget {
985
985
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
986
986
  })), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release(),
987
987
  internalProps.focusControl.release();
988
- const {parentElement: parentElement} = internalProps.element;
988
+ const parentElement = null === (_o = internalProps.element) || void 0 === _o ? void 0 : _o.parentElement;
989
989
  parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
990
- 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),
991
- this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_r = this.reactCustomLayout) || void 0 === _r || _r.clearCache(),
990
+ 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),
991
+ this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_s = this.reactCustomLayout) || void 0 === _s || _s.clearCache(),
992
992
  clearChartRenderQueue();
993
993
  }
994
994
  fireListeners(type, event) {
@@ -1191,10 +1191,10 @@ export class BaseTable extends EventTarget {
1191
1191
  clearSelected() {
1192
1192
  this.stateManager.updateSelectPos(-1, -1);
1193
1193
  }
1194
- selectCell(col, row, isShift, isCtrl, makeSelectCellVisible, skipBodyMerge = !1) {
1194
+ selectCell(col, row, enableShiftSelectMode, enableCtrlSelectMode, makeSelectCellVisible, skipBodyMerge = !1) {
1195
1195
  var _a, _b, _c;
1196
1196
  const isHasSelected = !!(null === (_a = this.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
1197
- 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),
1197
+ 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),
1198
1198
  this.stateManager.endSelectCells(!0, isHasSelected);
1199
1199
  }
1200
1200
  selectCells(cellRanges) {
@@ -1257,25 +1257,25 @@ export class BaseTable extends EventTarget {
1257
1257
  }
1258
1258
  } ]);
1259
1259
  }
1260
- startDragSelectCol(colIndex, isCtrl, isShift) {
1260
+ startDragSelectCol(colIndex, enableCtrlSelectMode, enableShiftSelectMode) {
1261
1261
  var _a, _b, _c, _d, _e, _f;
1262
- 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;
1263
- 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),
1264
- this.stateManager.updateInteractionState(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);
1262
+ 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;
1263
+ 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),
1264
+ this.stateManager.updateInteractionState(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);
1265
1265
  }
1266
- dragSelectCol(colIndex, isCtrl) {
1266
+ dragSelectCol(colIndex, enableCtrlSelectMode) {
1267
1267
  var _a, _b;
1268
1268
  const currentSelectRanges = this.stateManager.select.ranges, lastSelectRange = currentSelectRanges[currentSelectRanges.length - 1];
1269
- 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);
1269
+ 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);
1270
1270
  }
1271
1271
  endDragSelect() {
1272
1272
  this.stateManager.updateInteractionState(InteractionState.default), this.stateManager.endSelectCells(!1, !1);
1273
1273
  }
1274
- startDragSelectRow(rowIndex, isCtrl, isShift) {
1274
+ startDragSelectRow(rowIndex, enableCtrlSelectMode, isShift) {
1275
1275
  var _a, _b, _c, _d, _e, _f;
1276
1276
  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;
1277
- 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),
1278
- this.stateManager.updateInteractionState(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);
1277
+ 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),
1278
+ this.stateManager.updateInteractionState(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);
1279
1279
  }
1280
1280
  dragSelectRow(rowIndex, isCtrl) {
1281
1281
  var _a, _b;