@visactor/vtable 1.17.6-alpha.3 → 1.17.7-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 (83) hide show
  1. package/cjs/ListTable.js +19 -1
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/core/BaseTable.js +1 -1
  4. package/cjs/core/BaseTable.js.map +1 -1
  5. package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
  6. package/cjs/core/TABLE_EVENT_TYPE.js +2 -1
  7. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  8. package/cjs/event/listener/container-dom.js +3 -1
  9. package/cjs/event/listener/container-dom.js.map +1 -1
  10. package/cjs/event/listener/table-group.js +1 -1
  11. package/cjs/event/listener/table-group.js.map +1 -1
  12. package/cjs/index.d.ts +1 -1
  13. package/cjs/index.js +1 -1
  14. package/cjs/index.js.map +1 -1
  15. package/cjs/layout/simple-header-layout.d.ts +3 -1
  16. package/cjs/layout/simple-header-layout.js +11 -5
  17. package/cjs/layout/simple-header-layout.js.map +1 -1
  18. package/cjs/scenegraph/component/menu.js.map +1 -1
  19. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +3 -0
  20. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  21. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
  22. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  23. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +4 -2
  24. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  25. package/cjs/scenegraph/group-creater/progress/proxy.js +2 -2
  26. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  27. package/cjs/state/checkbox/checkbox.js +2 -2
  28. package/cjs/state/checkbox/checkbox.js.map +1 -1
  29. package/cjs/state/select/update-position.js +138 -44
  30. package/cjs/state/select/update-position.js.map +1 -1
  31. package/cjs/state/state.d.ts +1 -0
  32. package/cjs/state/state.js +4 -4
  33. package/cjs/state/state.js.map +1 -1
  34. package/cjs/ts-types/base-table.d.ts +1 -0
  35. package/cjs/ts-types/base-table.js.map +1 -1
  36. package/cjs/ts-types/events.d.ts +5 -0
  37. package/cjs/ts-types/events.js.map +1 -1
  38. package/cjs/ts-types/table-engine.d.ts +2 -0
  39. package/cjs/ts-types/table-engine.js.map +1 -1
  40. package/cjs/vrender.js.map +1 -1
  41. package/dist/vtable.js +112 -17
  42. package/dist/vtable.min.js +2 -2
  43. package/es/ListTable.js +19 -1
  44. package/es/ListTable.js.map +1 -1
  45. package/es/core/BaseTable.js +1 -1
  46. package/es/core/BaseTable.js.map +1 -1
  47. package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
  48. package/es/core/TABLE_EVENT_TYPE.js +2 -1
  49. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  50. package/es/event/listener/container-dom.js +2 -1
  51. package/es/event/listener/container-dom.js.map +1 -1
  52. package/es/event/listener/table-group.js +1 -1
  53. package/es/event/listener/table-group.js.map +1 -1
  54. package/es/index.d.ts +1 -1
  55. package/es/index.js +1 -1
  56. package/es/index.js.map +1 -1
  57. package/es/layout/simple-header-layout.d.ts +3 -1
  58. package/es/layout/simple-header-layout.js +12 -4
  59. package/es/layout/simple-header-layout.js.map +1 -1
  60. package/es/scenegraph/component/menu.js.map +1 -1
  61. package/es/scenegraph/graphic/contributions/chart-render-helper.js +3 -0
  62. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  63. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
  64. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  65. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +2 -2
  66. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  67. package/es/scenegraph/group-creater/progress/proxy.js +4 -3
  68. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  69. package/es/state/checkbox/checkbox.js +2 -2
  70. package/es/state/checkbox/checkbox.js.map +1 -1
  71. package/es/state/select/update-position.js +138 -44
  72. package/es/state/select/update-position.js.map +1 -1
  73. package/es/state/state.d.ts +1 -0
  74. package/es/state/state.js +4 -4
  75. package/es/state/state.js.map +1 -1
  76. package/es/ts-types/base-table.d.ts +1 -0
  77. package/es/ts-types/base-table.js.map +1 -1
  78. package/es/ts-types/events.d.ts +5 -0
  79. package/es/ts-types/events.js.map +1 -1
  80. package/es/ts-types/table-engine.d.ts +2 -0
  81. package/es/ts-types/table-engine.js.map +1 -1
  82. package/es/vrender.js.map +1 -1
  83. package/package.json +2 -2
package/dist/vtable.js CHANGED
@@ -29057,7 +29057,8 @@
29057
29057
  DBLCLICK_FILL_HANDLE: 'dblclick_fill_handle',
29058
29058
  EMPTY_TIP_CLICK: 'empty_tip_click',
29059
29059
  EMPTY_TIP_DBLCLICK: 'empty_tip_dblclick',
29060
- BUTTON_CLICK: 'button_click'
29060
+ BUTTON_CLICK: 'button_click',
29061
+ BEFORE_CACHE_CHART_IMAGE: 'before_cache_chart_image'
29061
29062
  };
29062
29063
 
29063
29064
  const judgeType = (value) => {
@@ -41457,6 +41458,7 @@
41457
41458
  chartInstance.updateFullDataSync?.(dataBatch);
41458
41459
  }
41459
41460
  }
41461
+ table.fireListeners('before_cache_chart_image', { chartInstance });
41460
41462
  const sg = chartInstance.getStage();
41461
41463
  cacheStageCanvas(sg, chart);
41462
41464
  }
@@ -42705,7 +42707,7 @@
42705
42707
  context.stroke();
42706
42708
  }
42707
42709
  else {
42708
- renderStroke(rect, context, x, y, rectAttribute, stroke, strokeArrayWidth || lineWidth, strokeArrayColor || strokeColor, Math.ceil(width + deltaWidth), Math.ceil(height + deltaHeight));
42710
+ renderStroke(rect, context, x, y, rectAttribute, stroke, strokeArrayWidth || lineWidth, strokeArrayColor || strokeColor, rect.name !== 'table-border-rect' ? Math.ceil(width + deltaWidth) : width + deltaWidth, rect.name !== 'table-border-rect' ? Math.ceil(height + deltaHeight) : height + deltaHeight);
42709
42711
  }
42710
42712
  }
42711
42713
  }
@@ -43928,10 +43930,14 @@
43928
43930
  computeRowsHeight(table, 0, table.options.canvasHeight === 'auto' ? table.rowCount - 1 : distRowForCompute ?? distRow);
43929
43931
  }
43930
43932
  if (distCol < table.colCount - table.rightFrozenColCount) {
43931
- computeColsWidth(table, table.colCount - table.rightFrozenColCount, table.colCount - 1);
43933
+ if (table.colCount - table.rightFrozenColCount <= table.colCount - 1) {
43934
+ computeColsWidth(table, table.colCount - table.rightFrozenColCount, table.colCount - 1);
43935
+ }
43932
43936
  }
43933
43937
  if (distRow < table.rowCount - table.bottomFrozenRowCount) {
43934
- computeRowsHeight(table, table.rowCount - table.bottomFrozenRowCount, table.rowCount - 1);
43938
+ if (table.rowCount - table.bottomFrozenRowCount <= table.rowCount - 1) {
43939
+ computeRowsHeight(table, table.rowCount - table.bottomFrozenRowCount, table.rowCount - 1);
43940
+ }
43935
43941
  }
43936
43942
  table.scenegraph.colHeaderGroup.setAttribute('x', table.getFrozenColsWidth());
43937
43943
  table.scenegraph.rowHeaderGroup.setAttribute('y', table.getFrozenRowsHeight());
@@ -45260,7 +45266,9 @@
45260
45266
  }
45261
45267
  createColGroup(onceCount) {
45262
45268
  const endCol = Math.min(this.totalCol, this.currentCol + onceCount);
45263
- computeColsWidth(this.table, this.currentCol + 1, endCol);
45269
+ if (this.table.widthMode !== 'adaptive') {
45270
+ computeColsWidth(this.table, this.currentCol + 1, endCol);
45271
+ }
45264
45272
  this.colEnd = endCol;
45265
45273
  for (let row = 0; row < this.table.rowCount; row++) {
45266
45274
  const cellGroup = this.highPerformanceGetCell(this.currentCol, row);
@@ -45410,7 +45418,9 @@
45410
45418
  }
45411
45419
  updateColGroups(count) {
45412
45420
  const distCol = Math.min(this.bodyRightCol, this.colUpdatePos + count);
45413
- computeColsWidth(this.table, this.colUpdatePos, distCol);
45421
+ if (this.table.widthMode === 'autoWidth') {
45422
+ computeColsWidth(this.table, this.colUpdatePos, distCol);
45423
+ }
45414
45424
  updateColContent(this.colUpdatePos, distCol, this);
45415
45425
  this.colUpdatePos = distCol + 1;
45416
45426
  }
@@ -50390,7 +50400,8 @@
50390
50400
  }
50391
50401
  else if (table.internalProps.layoutMap.isSeriesNumberInHeader(col, row)) {
50392
50402
  extendSelectRange = false;
50393
- if (state.select.headerSelectMode === 'body') {
50403
+ const { cornerHeaderSelectMode } = state.select;
50404
+ if (cornerHeaderSelectMode === 'body') {
50394
50405
  state.select.ranges.push({
50395
50406
  start: {
50396
50407
  col: table.leftRowSeriesNumberCount,
@@ -50400,6 +50411,22 @@
50400
50411
  skipBodyMerge: true
50401
50412
  });
50402
50413
  }
50414
+ else if (cornerHeaderSelectMode === 'inline') {
50415
+ const cellRange = skipBodyMerge ? { start: { col, row }, end: { col, row } } : table.getCellRange(col, row);
50416
+ state.select.ranges.push({
50417
+ start: { col: cellRange.start.col, row: cellRange.start.row },
50418
+ end: { col: cellRange.end.col, row: table.rowCount - 1 },
50419
+ skipBodyMerge: true
50420
+ });
50421
+ }
50422
+ else if (cornerHeaderSelectMode === 'cell') {
50423
+ const cellRange = skipBodyMerge ? { start: { col, row }, end: { col, row } } : table.getCellRange(col, row);
50424
+ state.select.ranges.push({
50425
+ start: { col: cellRange.start.col, row: cellRange.start.row },
50426
+ end: { col: cellRange.end.col, row: cellRange.end.row },
50427
+ skipBodyMerge: skipBodyMerge || undefined
50428
+ });
50429
+ }
50403
50430
  else {
50404
50431
  state.select.ranges.push({
50405
50432
  start: { col: 0, row: 0 },
@@ -50430,7 +50457,8 @@
50430
50457
  }
50431
50458
  else if (table.internalProps.layoutMap.isCornerHeader(col, row)) {
50432
50459
  extendSelectRange = false;
50433
- if (state.select.headerSelectMode === 'body') {
50460
+ const { cornerHeaderSelectMode } = state.select;
50461
+ if (cornerHeaderSelectMode === 'body') {
50434
50462
  state.select.ranges.push({
50435
50463
  start: {
50436
50464
  col: table.rowHeaderLevelCount + table.leftRowSeriesNumberCount,
@@ -50440,9 +50468,38 @@
50440
50468
  skipBodyMerge: true
50441
50469
  });
50442
50470
  }
50471
+ else if (cornerHeaderSelectMode === 'cell') {
50472
+ const cellRange = skipBodyMerge ? { start: { col, row }, end: { col, row } } : table.getCellRange(col, row);
50473
+ state.select.ranges.push({
50474
+ start: { col: cellRange.start.col, row: cellRange.start.row },
50475
+ end: { col: cellRange.end.col, row: cellRange.end.row },
50476
+ skipBodyMerge: skipBodyMerge || undefined
50477
+ });
50478
+ }
50479
+ else if (cornerHeaderSelectMode === 'inline') {
50480
+ const cellRange = skipBodyMerge ? { start: { col, row }, end: { col, row } } : table.getCellRange(col, row);
50481
+ state.select.ranges.push({
50482
+ start: { col: cellRange.start.col, row: cellRange.start.row },
50483
+ end: { col: cellRange.end.col, row: table.rowCount - 1 },
50484
+ skipBodyMerge: true
50485
+ });
50486
+ }
50487
+ else if (cornerHeaderSelectMode === 'all') {
50488
+ state.select.ranges.push({
50489
+ start: {
50490
+ col: table.leftRowSeriesNumberCount,
50491
+ row: 0
50492
+ },
50493
+ end: { col: table.colCount - 1, row: table.rowCount - 1 },
50494
+ skipBodyMerge: true
50495
+ });
50496
+ }
50443
50497
  else {
50444
50498
  state.select.ranges.push({
50445
- start: { col: table.leftRowSeriesNumberCount, row: 0 },
50499
+ start: {
50500
+ col: table.leftRowSeriesNumberCount,
50501
+ row: 0
50502
+ },
50446
50503
  end: { col: table.colCount - 1, row: table.rowCount - 1 },
50447
50504
  skipBodyMerge: true
50448
50505
  });
@@ -51419,7 +51476,7 @@
51419
51476
  const recordIndex = state.table.getRecordShowIndexByCell(col, row);
51420
51477
  if (recordIndex >= 0) {
51421
51478
  const dataIndex = state.table.dataSource.getIndexKey(recordIndex).toString();
51422
- if (state.checkedState.has(dataIndex)) {
51479
+ if (state.checkedState.get(dataIndex)) {
51423
51480
  state.checkedState.get(dataIndex)[field] = checked;
51424
51481
  }
51425
51482
  else {
@@ -51458,7 +51515,7 @@
51458
51515
  if (isValid$3(state.checkedState.get(dataIndex)?.[field])) {
51459
51516
  return state.checkedState.get(dataIndex)[field];
51460
51517
  }
51461
- if (state.checkedState.has(dataIndex)) {
51518
+ if (state.checkedState.get(dataIndex)) {
51462
51519
  state.checkedState.get(dataIndex)[field] = checked;
51463
51520
  }
51464
51521
  else if (dataIndex.includes(',')) {
@@ -52133,6 +52190,11 @@
52133
52190
  highlightMode: 'cell',
52134
52191
  highlightInRange: false
52135
52192
  }, this.table.options.select);
52193
+ const cornerHeaderSelectMode = this.table.options.select?.cornerHeaderSelectMode
52194
+ ? this.table.options.select?.cornerHeaderSelectMode
52195
+ : this.table.options.select?.headerSelectMode === 'body'
52196
+ ? this.table.options.select?.headerSelectMode
52197
+ : 'all';
52136
52198
  if (disableSelect === true) {
52137
52199
  this.select.highlightScope = HighlightScope.none;
52138
52200
  }
@@ -52153,6 +52215,7 @@
52153
52215
  this.select.singleStyle = !disableSelect;
52154
52216
  this.select.disableHeader = disableHeaderSelect;
52155
52217
  this.select.headerSelectMode = headerSelectMode;
52218
+ this.select.cornerHeaderSelectMode = cornerHeaderSelectMode;
52156
52219
  this.select.highlightInRange = highlightInRange;
52157
52220
  this.select.disableCtrlMultiSelect = this.table.options.keyboardOptions?.ctrlMultiSelect === false;
52158
52221
  }
@@ -54008,7 +54071,8 @@
54008
54071
  }
54009
54072
  const hitIcon = e.target.role?.startsWith('icon') ? e.target : undefined;
54010
54073
  eventManager.downIcon = hitIcon;
54011
- if (!hitIcon &&
54074
+ if (e.pointerType !== 'touch' &&
54075
+ !hitIcon &&
54012
54076
  !eventManager.checkCellFillhandle(eventArgsSet) &&
54013
54077
  !stateManager.columnResize.resizing &&
54014
54078
  eventManager.checkColumnResize(eventArgsSet, true)) {
@@ -55114,7 +55178,7 @@
55114
55178
  table.stateManager.updateInteractionState(InteractionState.grabing);
55115
55179
  const targetCol = table.getTargetColAtConsiderRightFrozen(selectX, considerFrozenX);
55116
55180
  const targetRow = table.getTargetRowAtConsiderBottomFrozen(selectY, considerFrozenY);
55117
- if (isValid$3(targetCol) && isValid$3(targetRow)) {
55181
+ if (!table.options.select?.disableDragSelect && isValid$3(targetCol) && isValid$3(targetRow)) {
55118
55182
  table.stateManager.updateSelectPos(targetCol.col, targetRow.row, false, false, false, false);
55119
55183
  }
55120
55184
  });
@@ -60588,7 +60652,7 @@
60588
60652
  return TABLE_EVENT_TYPE;
60589
60653
  }
60590
60654
  options;
60591
- version = "1.17.6-alpha.3";
60655
+ version = "1.17.7-alpha.0";
60592
60656
  pagination;
60593
60657
  id = `VTable${Date.now()}`;
60594
60658
  headerStyleCache;
@@ -65429,6 +65493,8 @@
65429
65493
  _hasAggregationOnTopCount = 0;
65430
65494
  _hasAggregationOnBottomCount = 0;
65431
65495
  rowHierarchyType;
65496
+ columnHierarchyType;
65497
+ columnExpandLevel;
65432
65498
  _cellRangeMap;
65433
65499
  constructor(table, columns, showHeader, hierarchyIndent) {
65434
65500
  this._cellRangeMap = new Map();
@@ -65439,7 +65505,9 @@
65439
65505
  this._headerCellIds = [];
65440
65506
  this.hierarchyIndent = hierarchyIndent ?? 20;
65441
65507
  this.hierarchyTextStartAlignment = table.options.hierarchyTextStartAlignment;
65442
- this.columnTree = new DimensionTree(columns, { seqId: 0 }, null);
65508
+ this.columnHierarchyType = table.options.headerHierarchyType;
65509
+ this.columnExpandLevel = table.options.headerExpandLevel ?? 1;
65510
+ this.columnTree = new DimensionTree(columns, { seqId: 0 }, this.columnHierarchyType ?? null, this.columnHierarchyType === 'grid-tree' ? this.columnExpandLevel : undefined);
65443
65511
  this._headerObjectsIncludeHided = this._addHeaders(0, columns, []);
65444
65512
  this._headerObjects = this._headerObjectsIncludeHided.filter(col => {
65445
65513
  return col.define.hide !== true;
@@ -66235,6 +66303,7 @@
66235
66303
  headerType: hd.headerType ?? 'text',
66236
66304
  dropDownMenu: hd.dropDownMenu,
66237
66305
  define: hd,
66306
+ hierarchyState: hd.hierarchyState,
66238
66307
  columnWidthComputeMode: hd.columnWidthComputeMode
66239
66308
  };
66240
66309
  results[id] = cell;
@@ -66247,7 +66316,8 @@
66247
66316
  else if (this._headerCellIds[row - 1]) {
66248
66317
  rowCells[col] = this._headerCellIds[row - 1][col];
66249
66318
  }
66250
- if (hd.columns) {
66319
+ const expand = !hd.hierarchyState || hd.hierarchyState === HierarchyState.expand;
66320
+ if (!!hd.columns && !!expand) {
66251
66321
  const isAllHided = hd.columns.every((c) => c.hide);
66252
66322
  !isAllHided &&
66253
66323
  this._addHeaders(row + 1, hd.columns, [...roots, id], hd.hideColumnsSubHeader || hideColumnsSubHeader).forEach(c => results.push(c));
@@ -68125,6 +68195,9 @@
68125
68195
  return null;
68126
68196
  }
68127
68197
  getHierarchyState(col, row) {
68198
+ if (this.isHeader(col, row)) {
68199
+ return this._getHeaderLayoutMap(col, row)?.hierarchyState;
68200
+ }
68128
68201
  if (!this.options.groupBy || (isArray$7(this.options.groupBy) && this.options.groupBy.length === 0)) {
68129
68202
  const define = this.getBodyColumnDefine(col, row);
68130
68203
  if (!define.tree) {
@@ -68137,6 +68210,28 @@
68137
68210
  toggleHierarchyState(col, row, recalculateColWidths = true) {
68138
68211
  this.stateManager.updateHoverIcon(col, row, undefined, undefined);
68139
68212
  const hierarchyState = this.getHierarchyState(col, row);
68213
+ if (this.isHeader(col, row)) {
68214
+ const headerTreeNode = this.internalProps.layoutMap.getHeader(col, row);
68215
+ const { hierarchyState: rawHierarchyState, define: columnDefine } = headerTreeNode;
68216
+ if (![HierarchyState.collapse, HierarchyState.expand].includes(rawHierarchyState) || !columnDefine) {
68217
+ return;
68218
+ }
68219
+ const children = columnDefine.columns;
68220
+ if (!!Array.isArray(children) && children.length > 0) {
68221
+ const hierarchyState = rawHierarchyState === HierarchyState.expand ? HierarchyState.collapse : HierarchyState.expand;
68222
+ headerTreeNode.hierarchyState = hierarchyState;
68223
+ headerTreeNode.define.hierarchyState = hierarchyState;
68224
+ this.updateColumns(this.internalProps.columns);
68225
+ }
68226
+ this.fireListeners(TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
68227
+ col,
68228
+ row,
68229
+ hierarchyState,
68230
+ originData: headerTreeNode,
68231
+ cellLocation: this.getCellLocation(col, row)
68232
+ });
68233
+ return;
68234
+ }
68140
68235
  if (hierarchyState === HierarchyState.expand) {
68141
68236
  this._refreshHierarchyState(col, row, recalculateColWidths);
68142
68237
  this.fireListeners(TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE, {
@@ -83409,7 +83504,7 @@
83409
83504
  }
83410
83505
 
83411
83506
  registerForVrender();
83412
- const version = "1.17.6-alpha.3";
83507
+ const version = "1.17.7-alpha.0";
83413
83508
  function getIcons() {
83414
83509
  return get$2();
83415
83510
  }