k-vtable 1.0.1 → 1.0.3

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 (109) hide show
  1. package/cjs/ListTable.d.ts +1 -1
  2. package/cjs/core/BaseTable.js +7 -5
  3. package/cjs/core/BaseTable.js.map +1 -1
  4. package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
  5. package/cjs/core/TABLE_EVENT_TYPE.js +2 -1
  6. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  7. package/cjs/core/record-helper.d.ts +1 -1
  8. package/cjs/core/record-helper.js +6 -4
  9. package/cjs/core/record-helper.js.map +1 -1
  10. package/cjs/data/CachedDataSource.js +5 -5
  11. package/cjs/data/CachedDataSource.js.map +1 -1
  12. package/cjs/dataset/dataset-pivot-table.js +2 -1
  13. package/cjs/dataset/flatDataToObject.js +1 -2
  14. package/cjs/event/event.js +2 -2
  15. package/cjs/event/event.js.map +1 -1
  16. package/cjs/event/listener/container-dom.js +51 -26
  17. package/cjs/event/listener/container-dom.js.map +1 -1
  18. package/cjs/event/self-event-listener/list-table/checkbox.d.ts +2 -0
  19. package/cjs/event/self-event-listener/list-table/checkbox.js +47 -34
  20. package/cjs/event/self-event-listener/list-table/checkbox.js.map +1 -1
  21. package/cjs/index.d.ts +1 -1
  22. package/cjs/index.js +1 -1
  23. package/cjs/index.js.map +1 -1
  24. package/cjs/layout/simple-header-layout.js +1 -1
  25. package/cjs/layout/simple-header-layout.js.map +1 -1
  26. package/cjs/scenegraph/component/checkbox-content.d.ts +34 -0
  27. package/cjs/scenegraph/component/checkbox-content.js +97 -0
  28. package/cjs/scenegraph/component/checkbox-content.js.map +1 -0
  29. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +6 -7
  30. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  31. package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +6 -0
  32. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +27 -1
  33. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  34. package/cjs/scenegraph/graphic/contributions/index.js +2 -0
  35. package/cjs/scenegraph/graphic/contributions/index.js.map +1 -1
  36. package/cjs/scenegraph/group-creater/cell-helper.js +4 -2
  37. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  38. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +2 -2
  39. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +54 -15
  40. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  41. package/cjs/scenegraph/scenegraph.js +12 -4
  42. package/cjs/scenegraph/scenegraph.js.map +1 -1
  43. package/cjs/state/checkbox/checkbox.js +2 -1
  44. package/cjs/state/checkbox/checkbox.js.map +1 -1
  45. package/cjs/ts-types/base-table.d.ts +3 -0
  46. package/cjs/ts-types/base-table.js.map +1 -1
  47. package/cjs/ts-types/events.d.ts +7 -0
  48. package/cjs/ts-types/events.js.map +1 -1
  49. package/cjs/ts-types/list-table/define/checkbox-define.d.ts +1 -0
  50. package/cjs/ts-types/list-table/define/checkbox-define.js.map +1 -1
  51. package/cjs/ts-types/table-engine.d.ts +2 -1
  52. package/cjs/ts-types/table-engine.js.map +1 -1
  53. package/cjs/vrender.js.map +1 -1
  54. package/dist/vtable.js +481 -70
  55. package/dist/vtable.min.js +2 -2
  56. package/es/ListTable.d.ts +1 -1
  57. package/es/core/BaseTable.js +7 -5
  58. package/es/core/BaseTable.js.map +1 -1
  59. package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
  60. package/es/core/TABLE_EVENT_TYPE.js +2 -1
  61. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  62. package/es/core/record-helper.d.ts +1 -1
  63. package/es/core/record-helper.js +6 -4
  64. package/es/core/record-helper.js.map +1 -1
  65. package/es/data/CachedDataSource.js +5 -5
  66. package/es/data/CachedDataSource.js.map +1 -1
  67. package/es/dataset/dataset-pivot-table.js +2 -1
  68. package/es/dataset/flatDataToObject.js +1 -2
  69. package/es/event/event.js +3 -3
  70. package/es/event/event.js.map +1 -1
  71. package/es/event/listener/container-dom.js +51 -26
  72. package/es/event/listener/container-dom.js.map +1 -1
  73. package/es/event/self-event-listener/list-table/checkbox.d.ts +2 -0
  74. package/es/event/self-event-listener/list-table/checkbox.js +43 -29
  75. package/es/event/self-event-listener/list-table/checkbox.js.map +1 -1
  76. package/es/index.d.ts +1 -1
  77. package/es/index.js +1 -1
  78. package/es/index.js.map +1 -1
  79. package/es/layout/simple-header-layout.js +1 -1
  80. package/es/layout/simple-header-layout.js.map +1 -1
  81. package/es/scenegraph/component/checkbox-content.d.ts +34 -0
  82. package/es/scenegraph/component/checkbox-content.js +91 -0
  83. package/es/scenegraph/component/checkbox-content.js.map +1 -0
  84. package/es/scenegraph/graphic/contributions/chart-render-helper.js +6 -7
  85. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  86. package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +6 -0
  87. package/es/scenegraph/graphic/contributions/group-contribution-render.js +26 -0
  88. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  89. package/es/scenegraph/graphic/contributions/index.js +2 -1
  90. package/es/scenegraph/graphic/contributions/index.js.map +1 -1
  91. package/es/scenegraph/group-creater/cell-helper.js +4 -2
  92. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  93. package/es/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +2 -2
  94. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +60 -15
  95. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  96. package/es/scenegraph/scenegraph.js +12 -4
  97. package/es/scenegraph/scenegraph.js.map +1 -1
  98. package/es/state/checkbox/checkbox.js +2 -1
  99. package/es/state/checkbox/checkbox.js.map +1 -1
  100. package/es/ts-types/base-table.d.ts +3 -0
  101. package/es/ts-types/base-table.js.map +1 -1
  102. package/es/ts-types/events.d.ts +7 -0
  103. package/es/ts-types/events.js.map +1 -1
  104. package/es/ts-types/list-table/define/checkbox-define.d.ts +1 -0
  105. package/es/ts-types/list-table/define/checkbox-define.js.map +1 -1
  106. package/es/ts-types/table-engine.d.ts +2 -1
  107. package/es/ts-types/table-engine.js.map +1 -1
  108. package/es/vrender.js.map +1 -1
  109. package/package.json +2 -2
package/dist/vtable.js CHANGED
@@ -30695,7 +30695,8 @@
30695
30695
  EMPTY_TIP_CLICK: 'empty_tip_click',
30696
30696
  EMPTY_TIP_DBLCLICK: 'empty_tip_dblclick',
30697
30697
  BUTTON_CLICK: 'button_click',
30698
- BEFORE_CACHE_CHART_IMAGE: 'before_cache_chart_image'
30698
+ BEFORE_CACHE_CHART_IMAGE: 'before_cache_chart_image',
30699
+ PASTED_DATA: 'pasted_data'
30699
30700
  };
30700
30701
 
30701
30702
  const judgeType = (value) => {
@@ -35301,8 +35302,9 @@
35301
35302
  this.dataSourceObj.records.splice(recordIndex, 0, ...recordArr);
35302
35303
  }
35303
35304
  else {
35304
- const index = recordIndex.pop();
35305
- const parentRecord = this.getOriginalRecord(recordIndex);
35305
+ const recordIndex_copy = [...recordIndex];
35306
+ const index = recordIndex_copy.pop();
35307
+ const parentRecord = this.getOriginalRecord(recordIndex_copy);
35306
35308
  if (parentRecord.children) {
35307
35309
  parentRecord.children.splice(index, 0, ...recordArr);
35308
35310
  }
@@ -35328,8 +35330,9 @@
35328
35330
  this.dataSourceObj.records.splice(recordIndex, 1);
35329
35331
  }
35330
35332
  else {
35331
- const index = recordIndex.pop();
35332
- const parentRecord = this.getOriginalRecord(recordIndex);
35333
+ const recordIndex_copy = [...recordIndex];
35334
+ const index = recordIndex_copy.pop();
35335
+ const parentRecord = this.getOriginalRecord(recordIndex_copy);
35333
35336
  parentRecord.children.splice(index, 1);
35334
35337
  }
35335
35338
  this.adjustBeforeChangedRecordsMap(recordIndex, 1, 'delete');
@@ -35349,8 +35352,9 @@
35349
35352
  this.dataSourceObj.records.splice(recordIndex, 1, record);
35350
35353
  }
35351
35354
  else {
35352
- const index = recordIndex.pop();
35353
- const parentRecord = this.getOriginalRecord(recordIndex);
35355
+ const recordIndex_copy = [...recordIndex];
35356
+ const index = recordIndex_copy.pop();
35357
+ const parentRecord = this.getOriginalRecord(recordIndex_copy);
35354
35358
  parentRecord.children.splice(index, 1, record);
35355
35359
  }
35356
35360
  }
@@ -39144,7 +39148,11 @@
39144
39148
  value = table.getCellValue(col, row);
39145
39149
  isAsync = true;
39146
39150
  }
39147
- if (type === 'text' || type === 'link' || customResult) {
39151
+ if (type === 'checkbox' && define.tree) {
39152
+ const createCheckboxCellGroup = Factory.getFunction('createCheckboxCellGroup');
39153
+ cellGroup = createCheckboxCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, true);
39154
+ }
39155
+ else if (type === 'text' || type === 'link' || customResult) {
39148
39156
  if (type === 'link') {
39149
39157
  const cellValue = value;
39150
39158
  const cellOriginValue = table.getCellOriginValue(col, row);
@@ -39240,7 +39248,7 @@
39240
39248
  }
39241
39249
  else {
39242
39250
  const createCheckboxCellGroup = Factory.getFunction('createCheckboxCellGroup');
39243
- cellGroup = createCheckboxCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
39251
+ cellGroup = createCheckboxCellGroup(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, false);
39244
39252
  }
39245
39253
  }
39246
39254
  else if (type === 'radio') {
@@ -43082,11 +43090,11 @@
43082
43090
  y2: viewBox.y2 - viewBox.y1
43083
43091
  }, false, false);
43084
43092
  const chartStage = chartInstance.getStage();
43085
- const matrix = chart.globalTransMatrix.clone();
43086
- const stageMatrix = chart.stage.window.getViewBoxTransform();
43087
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
43093
+ const matrix = chart.globalTransMatrix;
43094
+ const stageMatrix = chart.stage.window.getViewBoxTransform().clone();
43095
+ stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
43088
43096
  chartStage.window.setViewBoxTransform &&
43089
- chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
43097
+ chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
43090
43098
  const { table } = chart.getRootNode();
43091
43099
  let updateSpec = false;
43092
43100
  if (table.options.specFormat) {
@@ -43204,10 +43212,7 @@
43204
43212
  if (stage.releaseStatus === 'released') {
43205
43213
  return null;
43206
43214
  }
43207
- const matrix = stage.window.getViewBoxTransform();
43208
43215
  const window = renderToNewWindow(stage, fullImage, viewBox);
43209
- window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, 0, 0);
43210
- stage.renderTo(window);
43211
43216
  const c = window.getNativeHandler();
43212
43217
  if (c.nativeCanvas) {
43213
43218
  return c.nativeCanvas;
@@ -43245,6 +43250,7 @@
43245
43250
  title: ''
43246
43251
  });
43247
43252
  }
43253
+ window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, 0, 0);
43248
43254
  stage.renderTo(window);
43249
43255
  return window;
43250
43256
  }
@@ -44209,6 +44215,32 @@
44209
44215
  AdjustColorGroupAfterRenderContribution = __decorate([
44210
44216
  injectable()
44211
44217
  ], AdjustColorGroupAfterRenderContribution);
44218
+ let AdjustInfoGroupAfterRenderContribution = class AdjustInfoGroupAfterRenderContribution {
44219
+ time = BaseRenderContributionTime.afterFillStroke;
44220
+ useStyle = true;
44221
+ order = 0;
44222
+ drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
44223
+ if (group.__customInfo) {
44224
+ group.__customInfo({
44225
+ group,
44226
+ context,
44227
+ x,
44228
+ y,
44229
+ doFill,
44230
+ doStroke,
44231
+ fVisible,
44232
+ sVisible,
44233
+ groupAttribute,
44234
+ drawContext,
44235
+ fillCb,
44236
+ strokeCb,
44237
+ });
44238
+ }
44239
+ }
44240
+ };
44241
+ AdjustInfoGroupAfterRenderContribution = __decorate([
44242
+ injectable()
44243
+ ], AdjustInfoGroupAfterRenderContribution);
44212
44244
  let ClipBodyGroupBeforeRenderContribution = class ClipBodyGroupBeforeRenderContribution {
44213
44245
  time = BaseRenderContributionTime.beforeFillStroke;
44214
44246
  useStyle = true;
@@ -44767,6 +44799,8 @@
44767
44799
  bind(GroupRenderContribution).toService(AdjustColorGroupBeforeRenderContribution);
44768
44800
  bind(AdjustColorGroupAfterRenderContribution).toSelf().inSingletonScope();
44769
44801
  bind(GroupRenderContribution).toService(AdjustColorGroupAfterRenderContribution);
44802
+ bind(AdjustInfoGroupAfterRenderContribution).toSelf().inSingletonScope();
44803
+ bind(GroupRenderContribution).toService(AdjustInfoGroupAfterRenderContribution);
44770
44804
  bind(SplitGroupAfterRenderContribution).toSelf().inSingletonScope();
44771
44805
  bind(GroupRenderContribution).toService(SplitGroupAfterRenderContribution);
44772
44806
  bind(SplitGroupBeforeRenderContribution).toSelf().inSingletonScope();
@@ -50705,6 +50739,16 @@
50705
50739
  node.setAttribute('checked', checked);
50706
50740
  }
50707
50741
  }
50742
+ if (node.name === 'checkbox-content') {
50743
+ if (checked === 'indeterminate') {
50744
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('indeterminate', true);
50745
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('checked', undefined);
50746
+ }
50747
+ else {
50748
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('indeterminate', undefined);
50749
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('checked', checked);
50750
+ }
50751
+ }
50708
50752
  });
50709
50753
  });
50710
50754
  }
@@ -50722,6 +50766,16 @@
50722
50766
  node.setAttribute('checked', checked);
50723
50767
  }
50724
50768
  }
50769
+ if (node.name === 'checkbox-content') {
50770
+ if (checked === 'indeterminate') {
50771
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('indeterminate', true);
50772
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('checked', undefined);
50773
+ }
50774
+ else {
50775
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('indeterminate', undefined);
50776
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('checked', checked);
50777
+ }
50778
+ }
50725
50779
  });
50726
50780
  });
50727
50781
  }
@@ -50743,6 +50797,16 @@
50743
50797
  node.setAttribute('checked', checked);
50744
50798
  }
50745
50799
  }
50800
+ if (node.name === 'checkbox-content') {
50801
+ if (checked === 'indeterminate') {
50802
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('indeterminate', true);
50803
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('checked', undefined);
50804
+ }
50805
+ else {
50806
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('indeterminate', undefined);
50807
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('checked', checked);
50808
+ }
50809
+ }
50746
50810
  });
50747
50811
  });
50748
50812
  }
@@ -50760,6 +50824,16 @@
50760
50824
  node.setAttribute('checked', checked);
50761
50825
  }
50762
50826
  }
50827
+ if (node.name === 'checkbox-content') {
50828
+ if (checked === 'indeterminate') {
50829
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('indeterminate', true);
50830
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('checked', undefined);
50831
+ }
50832
+ else {
50833
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('indeterminate', undefined);
50834
+ node._checkboxGroup.getChildByName('checkbox').setAttribute('checked', checked);
50835
+ }
50836
+ }
50763
50837
  });
50764
50838
  });
50765
50839
  }
@@ -53443,7 +53517,8 @@
53443
53517
  }
53444
53518
  function setCellCheckboxStateByAttribute(col, row, checked, table) {
53445
53519
  const cellGroup = table.scenegraph.getCell(col, row);
53446
- const checkbox = cellGroup?.getChildByName('checkbox');
53520
+ const checkbox = cellGroup?.getChildByName('checkbox') ||
53521
+ cellGroup?.getChildByName('checkbox-content')?._checkboxGroup?.getChildByName('checkbox');
53447
53522
  if (checkbox) {
53448
53523
  if (checked === 'indeterminate') {
53449
53524
  checkbox.setAttribute('indeterminate', true);
@@ -56338,10 +56413,10 @@
56338
56413
  table.selectCell(targetCol, targetRow, e.shiftKey);
56339
56414
  if ((table.options.keyboardOptions?.moveEditCellOnArrowKeys ?? false) &&
56340
56415
  table.editorManager?.editingEditor) {
56341
- table.editorManager.completeEdit();
56416
+ table.editorManager?.completeEdit();
56342
56417
  table.getElement().focus();
56343
56418
  if (table.getEditor(targetCol, targetRow)) {
56344
- table.editorManager.startEditCell(targetCol, targetRow);
56419
+ table.editorManager?.startEditCell(targetCol, targetRow);
56345
56420
  }
56346
56421
  }
56347
56422
  }
@@ -56352,7 +56427,7 @@
56352
56427
  else if (e.key === 'Enter') {
56353
56428
  if (table.editorManager?.editingEditor) {
56354
56429
  handleKeydownListener(e);
56355
- table.editorManager.completeEdit();
56430
+ table.editorManager?.completeEdit();
56356
56431
  table.getElement().focus();
56357
56432
  if (table.options.keyboardOptions?.moveFocusCellOnEnter === true) {
56358
56433
  const targetCol = stateManager.select.cellPos.col;
@@ -56380,7 +56455,7 @@
56380
56455
  const endRow = table.stateManager.select.ranges[0].end.row;
56381
56456
  if (startCol === endCol && startRow === endRow) {
56382
56457
  if (table.getEditor(startCol, startRow)) {
56383
- table.editorManager.startEditCell(startCol, startRow);
56458
+ table.editorManager?.startEditCell(startCol, startRow);
56384
56459
  }
56385
56460
  }
56386
56461
  }
@@ -56409,10 +56484,10 @@
56409
56484
  }
56410
56485
  table.selectCell(targetCol, targetRow);
56411
56486
  if (table.editorManager?.editingEditor) {
56412
- table.editorManager.completeEdit();
56487
+ table.editorManager?.completeEdit();
56413
56488
  table.getElement().focus();
56414
56489
  if (table.getEditor(targetCol, targetRow)) {
56415
- table.editorManager.startEditCell(targetCol, targetRow);
56490
+ table.editorManager?.startEditCell(targetCol, targetRow);
56416
56491
  }
56417
56492
  }
56418
56493
  }
@@ -56424,8 +56499,8 @@
56424
56499
  !table.editorManager?.editingEditor) {
56425
56500
  const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
56426
56501
  if (e.key.match(allowedKeys)) {
56427
- table.editorManager.beginTriggerEditCellMode = 'keydown';
56428
- table.editorManager.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, '');
56502
+ table.editorManager && (table.editorManager.beginTriggerEditCellMode = 'keydown');
56503
+ table.editorManager?.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, '');
56429
56504
  }
56430
56505
  }
56431
56506
  }
@@ -56548,7 +56623,15 @@
56548
56623
  rowValues.push(cell);
56549
56624
  });
56550
56625
  });
56551
- table.changeCellValues(col, row, values);
56626
+ const changedCellResults = table.changeCellValues(col, row, values);
56627
+ if (table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA)) {
56628
+ table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
56629
+ col,
56630
+ row,
56631
+ pasteData: values,
56632
+ changedCellResults
56633
+ });
56634
+ }
56552
56635
  }
56553
56636
  }
56554
56637
  }
@@ -56614,7 +56697,15 @@
56614
56697
  }
56615
56698
  pasteValuesRowCount = values.length ?? 0;
56616
56699
  values = handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
56617
- table.changeCellValues(col, row, values, true);
56700
+ const changedCellResults = table.changeCellValues(col, row, values, true);
56701
+ if (table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA)) {
56702
+ table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
56703
+ col,
56704
+ row,
56705
+ pasteData: values,
56706
+ changedCellResults
56707
+ });
56708
+ }
56618
56709
  }
56619
56710
  else {
56620
56711
  navigator.clipboard.read().then(clipboardItems => {
@@ -56655,7 +56746,15 @@
56655
56746
  });
56656
56747
  pasteValuesRowCount = values.length ?? 0;
56657
56748
  values = handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
56658
- table.changeCellValues(col, row, values, true);
56749
+ const changedCellResults = table.changeCellValues(col, row, values, true);
56750
+ if (table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA)) {
56751
+ table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
56752
+ col,
56753
+ row,
56754
+ pasteData: values,
56755
+ changedCellResults
56756
+ });
56757
+ }
56659
56758
  }
56660
56759
  function pasteTextToTable(item) {
56661
56760
  const ranges = table.stateManager.select.ranges;
@@ -56689,7 +56788,15 @@
56689
56788
  });
56690
56789
  pasteValuesRowCount = values.length ?? 0;
56691
56790
  values = handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
56692
- table.changeCellValues(col, row, values, true);
56791
+ const changedCellResults = table.changeCellValues(col, row, values, true);
56792
+ if (table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA)) {
56793
+ table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
56794
+ col,
56795
+ row,
56796
+ pasteData: values,
56797
+ changedCellResults
56798
+ });
56799
+ }
56693
56800
  });
56694
56801
  });
56695
56802
  }
@@ -56799,7 +56906,7 @@
56799
56906
  const endMoveColSuccess = table.stateManager.endMoveCol();
56800
56907
  fireMoveColEventListeners(table, endMoveColSuccess, e);
56801
56908
  }
56802
- else if (table.editorManager.editingEditor) {
56909
+ else if (table.editorManager?.editingEditor) {
56803
56910
  if (!table.getElement().contains(target)) {
56804
56911
  const isCompleteEdit = table.editorManager?.completeEdit(e);
56805
56912
  getPromiseValue(isCompleteEdit, (isCompleteEdit) => {
@@ -57214,7 +57321,8 @@
57214
57321
  function bindGroupTitleCheckboxChange(table) {
57215
57322
  table.on('checkbox_state_change', args => {
57216
57323
  const { col, row, checked, field } = args;
57217
- if (field !== '_vtable_rowSeries_number' || table.internalProps.rowSeriesNumber?.enableTreeCheckbox !== true) {
57324
+ if (!table.internalProps.layoutMap.isSeriesNumber(col, row) ||
57325
+ table.internalProps.rowSeriesNumber?.enableTreeCheckbox !== true) {
57218
57326
  return;
57219
57327
  }
57220
57328
  if (table.isHeader(col, row)) {
@@ -57230,21 +57338,21 @@
57230
57338
  if (record.vtableMerge || record.children?.length) {
57231
57339
  if (checked) {
57232
57340
  if (getHierarchyState(table, col, row) === HierarchyState.collapse) {
57233
- updateChildrenCheckboxState(true, titleIndex, table);
57341
+ updateChildrenCheckboxState(true, titleIndex, table, field);
57234
57342
  }
57235
57343
  else {
57236
- setAllChildrenCheckboxState(true, titleShowIndex, titleIndex, indexedData, table);
57344
+ setAllChildrenCheckboxState(true, titleShowIndex, titleIndex, indexedData, table, col);
57237
57345
  }
57238
- updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
57346
+ updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col);
57239
57347
  }
57240
57348
  else {
57241
57349
  if (getHierarchyState(table, col, row) === HierarchyState.collapse) {
57242
- updateChildrenCheckboxState(false, titleIndex, table);
57350
+ updateChildrenCheckboxState(false, titleIndex, table, field);
57243
57351
  }
57244
57352
  else {
57245
- setAllChildrenCheckboxState(false, titleShowIndex, titleIndex, indexedData, table);
57353
+ setAllChildrenCheckboxState(false, titleShowIndex, titleIndex, indexedData, table, col);
57246
57354
  }
57247
- updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
57355
+ updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col);
57248
57356
  const oldHeaderCheckedState = table.stateManager.headerCheckedState._vtable_rowSeries_number;
57249
57357
  const newHeaderCheckedState = table.stateManager.updateHeaderCheckedState('_vtable_rowSeries_number', col, row);
57250
57358
  if (oldHeaderCheckedState !== newHeaderCheckedState) {
@@ -57253,20 +57361,69 @@
57253
57361
  }
57254
57362
  }
57255
57363
  else {
57256
- updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
57364
+ updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col);
57365
+ }
57366
+ });
57367
+ }
57368
+ function bindGroupCheckboxTreeChange(table) {
57369
+ table.on('checkbox_state_change', args => {
57370
+ const { col, row, checked, field } = args;
57371
+ const isCheckboxAndTree = table.internalProps.columns.some(column => column.tree);
57372
+ table.internalProps.enableCheckboxCascade && field !== '_vtable_rowSeries_number';
57373
+ if (!isCheckboxAndTree) {
57374
+ return;
57375
+ }
57376
+ if (table.isHeader(col, row)) {
57377
+ return;
57378
+ }
57379
+ const record = table.getCellOriginRecord(col, row);
57380
+ const indexedData = table.dataSource.currentPagerIndexedData;
57381
+ const titleShowIndex = table.getRecordShowIndexByCell(col, row);
57382
+ let titleIndex = indexedData[titleShowIndex];
57383
+ if (isNumber$4(titleIndex)) {
57384
+ titleIndex = [titleIndex];
57385
+ }
57386
+ if (record.vtableMerge || record.children?.length) {
57387
+ if (checked) {
57388
+ if (getHierarchyState(table, col, row) === HierarchyState.collapse) {
57389
+ updateChildrenCheckboxState(true, titleIndex, table, field);
57390
+ }
57391
+ else {
57392
+ setAllChildrenCheckboxState(true, titleShowIndex, titleIndex, indexedData, table, col, field);
57393
+ }
57394
+ updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col, field);
57395
+ }
57396
+ else {
57397
+ if (getHierarchyState(table, col, row) === HierarchyState.collapse) {
57398
+ updateChildrenCheckboxState(false, titleIndex, table, field);
57399
+ }
57400
+ else {
57401
+ setAllChildrenCheckboxState(false, titleShowIndex, titleIndex, indexedData, table, col, field);
57402
+ }
57403
+ updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col, field);
57404
+ const oldHeaderCheckedState = table.stateManager.headerCheckedState._vtable_rowSeries_number;
57405
+ const newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(field, col, row);
57406
+ if (oldHeaderCheckedState !== newHeaderCheckedState) {
57407
+ table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
57408
+ }
57409
+ }
57410
+ }
57411
+ else {
57412
+ updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col, field);
57257
57413
  }
57258
57414
  });
57259
57415
  }
57260
- function setAllChildrenCheckboxState(state, titleShowIndex, titleIndex, indexedData, table) {
57416
+ function setAllChildrenCheckboxState(state, titleShowIndex, titleIndex, indexedData, table, col, field) {
57417
+ const fieldName = field || '_vtable_rowSeries_number';
57261
57418
  let i = titleShowIndex + 1;
57262
57419
  while (isArray$7(indexedData[i]) && indexedData[i]?.length > titleIndex.length) {
57263
57420
  const row = table.columnHeaderLevelCount + i;
57264
- table.stateManager.setCheckedState(0, row, '_vtable_rowSeries_number', state);
57265
- setCellCheckboxStateByAttribute(0, row, state, table);
57421
+ table.stateManager.setCheckedState(col, row, fieldName, state);
57422
+ setCellCheckboxStateByAttribute(col, row, state, table);
57266
57423
  i++;
57267
57424
  }
57268
57425
  }
57269
- function updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table) {
57426
+ function updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col, field) {
57270
57427
  let parentLength = titleIndex.length - 1;
57271
57428
  if (parentLength > 0) {
57272
57429
  let i = titleShowIndex - 1;
@@ -57274,17 +57431,18 @@
57274
57431
  if ((isArray$7(indexedData[i]) && indexedData[i]?.length === parentLength) ||
57275
57432
  (parentLength === 1 && isNumber$4(indexedData[i]))) {
57276
57433
  const row = table.columnHeaderLevelCount + i;
57277
- updateParentCheckboxState(0, row, indexedData[i], table);
57434
+ updateParentCheckboxState(col, row, indexedData[i], table, field);
57278
57435
  parentLength--;
57279
57436
  }
57280
57437
  i--;
57281
57438
  }
57282
57439
  }
57283
57440
  }
57284
- function updateParentCheckboxState(col, row, currentIndex, table) {
57441
+ function updateParentCheckboxState(col, row, currentIndex, table, field) {
57285
57442
  const { checkedState } = table.stateManager;
57286
57443
  const key = currentIndex.toString();
57287
- const currentIndexLength = isArray$7(currentIndex) ? currentIndex.length : 1;
57444
+ const fieldName = field || '_vtable_rowSeries_number';
57445
+ isArray$7(currentIndex) ? currentIndex.length : 1;
57288
57446
  let start = false;
57289
57447
  const result = [];
57290
57448
  const keys = Array.from(checkedState.keys()).sort((a, b) => {
@@ -57301,16 +57459,17 @@
57301
57459
  return 0;
57302
57460
  });
57303
57461
  const stateArr = keys.map(key => checkedState.get(key));
57462
+ const childOfCurrentIndex = keys.filter(item => item.startsWith(key + ',') && item !== key);
57304
57463
  stateArr.forEach((state, i) => {
57305
57464
  const index = keys[i];
57306
57465
  const value = state;
57466
+ const isChildOfCurrentIndex = childOfCurrentIndex.includes(index);
57307
57467
  if (start) {
57308
- const indexData = index.split(',');
57309
- if (indexData.length === currentIndexLength) {
57468
+ if (!isChildOfCurrentIndex) {
57310
57469
  start = false;
57311
57470
  }
57312
57471
  else {
57313
- result.push(value._vtable_rowSeries_number);
57472
+ result.push(value[fieldName]);
57314
57473
  }
57315
57474
  }
57316
57475
  if (index === key) {
@@ -57323,22 +57482,22 @@
57323
57482
  const allChecked = result.every(item => !!item);
57324
57483
  const allUnChecked = result.every(item => !item);
57325
57484
  if (allChecked) {
57326
- table.stateManager.setCheckedState(col, row, '_vtable_rowSeries_number', true);
57485
+ table.stateManager.setCheckedState(col, row, fieldName, true);
57327
57486
  setCellCheckboxStateByAttribute(col, row, true, table);
57328
57487
  }
57329
57488
  else if (allUnChecked) {
57330
- table.stateManager.setCheckedState(col, row, '_vtable_rowSeries_number', false);
57489
+ table.stateManager.setCheckedState(col, row, fieldName, false);
57331
57490
  setCellCheckboxStateByAttribute(col, row, false, table);
57332
57491
  }
57333
57492
  else {
57334
- table.stateManager.setCheckedState(col, row, '_vtable_rowSeries_number', 'indeterminate');
57493
+ table.stateManager.setCheckedState(col, row, fieldName, 'indeterminate');
57335
57494
  setCellCheckboxStateByAttribute(col, row, 'indeterminate', table);
57336
57495
  }
57337
57496
  }
57338
- function updateChildrenCheckboxState(parentState, currentIndex, table) {
57497
+ function updateChildrenCheckboxState(parentState, currentIndex, table, field) {
57339
57498
  const { checkedState } = table.stateManager;
57340
57499
  const key = currentIndex.toString();
57341
- const currentIndexLength = isArray$7(currentIndex) ? currentIndex.length : 1;
57500
+ isArray$7(currentIndex) ? currentIndex.length : 1;
57342
57501
  let start = false;
57343
57502
  const keys = Array.from(checkedState.keys()).sort((a, b) => {
57344
57503
  const aArr = a.split(',');
@@ -57353,17 +57512,18 @@
57353
57512
  }
57354
57513
  return 0;
57355
57514
  });
57515
+ const childrenOfKey = keys.filter(item => item.startsWith(key + ',') && item !== key);
57356
57516
  const stateArr = keys.map(key => checkedState.get(key));
57357
57517
  stateArr.forEach((state, i) => {
57358
57518
  const index = keys[i];
57359
57519
  const value = state;
57520
+ const shouldSelectChildren = childrenOfKey.length !== 0 && childrenOfKey.includes(index);
57360
57521
  if (start) {
57361
- const indexData = index.split(',');
57362
- if (indexData.length === currentIndexLength) {
57522
+ if (!shouldSelectChildren) {
57363
57523
  start = false;
57364
57524
  }
57365
57525
  else {
57366
- value._vtable_rowSeries_number = parentState;
57526
+ value[field] = parentState;
57367
57527
  }
57368
57528
  }
57369
57529
  if (index === key) {
@@ -57576,6 +57736,7 @@
57576
57736
  bindAxisClickEvent(this.table);
57577
57737
  bindAxisHoverEvent(this.table);
57578
57738
  bindGroupTitleCheckboxChange(this.table);
57739
+ bindGroupCheckboxTreeChange(this.table);
57579
57740
  bindHeaderCheckboxChange(this.table);
57580
57741
  bindButtonClickEvent(this.table);
57581
57742
  rightButtonClickEvent(this.table);
@@ -62502,7 +62663,7 @@
62502
62663
  return TABLE_EVENT_TYPE;
62503
62664
  }
62504
62665
  options;
62505
- version = "1.0.1";
62666
+ version = "1.0.3";
62506
62667
  pagination;
62507
62668
  id = `VTable${Date.now()}`;
62508
62669
  headerStyleCache;
@@ -62542,7 +62703,7 @@
62542
62703
  if (options.customConfig?.imageAnonymous === false) {
62543
62704
  vglobal.isImageAnonymous = false;
62544
62705
  }
62545
- const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, frozenRowCount, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, rowResizeMode = 'none', resize, dragHeaderMode, dragOrder, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight, clearDOM = true } = options;
62706
+ const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, frozenRowCount, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, enableCheckboxCascade, columnResizeMode, rowResizeMode = 'none', resize, dragHeaderMode, dragOrder, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight, clearDOM = true } = options;
62546
62707
  this.container = container;
62547
62708
  this.options = options;
62548
62709
  this._widthMode = widthMode;
@@ -62614,6 +62775,7 @@
62614
62775
  internalProps.keyboardOptions = keyboardOptions;
62615
62776
  internalProps.eventOptions = eventOptions;
62616
62777
  internalProps.rowSeriesNumber = rowSeriesNumber;
62778
+ internalProps.enableCheckboxCascade = enableCheckboxCascade;
62617
62779
  internalProps.columnResizeMode = resize?.columnResizeMode ?? columnResizeMode;
62618
62780
  internalProps.rowResizeMode = resize?.rowResizeMode ?? rowResizeMode;
62619
62781
  internalProps.dragHeaderMode = dragOrder?.dragHeaderMode ?? dragHeaderMode ?? 'none';
@@ -63934,7 +64096,7 @@
63934
64096
  this.editorManager?.cancelEdit();
63935
64097
  this.options = options;
63936
64098
  this._hasAutoImageColumn = undefined;
63937
- const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, rowResizeMode = 'none', resize, dragHeaderMode, dragOrder, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, autoFillHeight, widthAdaptiveMode, heightAdaptiveMode, customRender, renderChartAsync, renderChartAsyncBatchCount, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight } = options;
64099
+ const { frozenColCount = 0, unfreezeAllOnExceedsMaxWidth, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, eventOptions, rowSeriesNumber, enableCheckboxCascade, columnResizeMode, rowResizeMode = 'none', resize, dragHeaderMode, dragOrder, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, autoFillHeight, widthAdaptiveMode, heightAdaptiveMode, customRender, renderChartAsync, renderChartAsyncBatchCount, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight } = options;
63938
64100
  if (pixelRatio && pixelRatio !== this.internalProps.pixelRatio) {
63939
64101
  this.internalProps.pixelRatio = pixelRatio;
63940
64102
  }
@@ -63979,6 +64141,7 @@
63979
64141
  internalProps.keyboardOptions = keyboardOptions;
63980
64142
  internalProps.eventOptions = eventOptions;
63981
64143
  internalProps.rowSeriesNumber = rowSeriesNumber;
64144
+ internalProps.enableCheckboxCascade = enableCheckboxCascade;
63982
64145
  internalProps.columnResizeMode = resize?.columnResizeMode ?? columnResizeMode;
63983
64146
  internalProps.rowResizeMode = resize?.rowResizeMode ?? rowResizeMode;
63984
64147
  internalProps.dragHeaderMode = dragOrder?.dragHeaderMode ?? dragHeaderMode ?? 'none';
@@ -67454,7 +67617,7 @@
67454
67617
  style: rowSeriesNumber.style,
67455
67618
  width: rowSeriesNumber.width,
67456
67619
  format: rowSeriesNumber.format,
67457
- field: '_vtable_rowSeries_number',
67620
+ field: rowSeriesNumber.field,
67458
67621
  icon: rowSeriesNumber.icon,
67459
67622
  headerIcon: rowSeriesNumber.headerIcon,
67460
67623
  isChildNode: false
@@ -68865,6 +69028,7 @@
68865
69028
  }
68866
69029
  }
68867
69030
  function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
69031
+ const changedCellResults = [];
68868
69032
  let pasteColEnd = startCol;
68869
69033
  let pasteRowEnd = startRow;
68870
69034
  const beforeChangeValues = [];
@@ -68894,6 +69058,7 @@
68894
69058
  if (startRow + i > table.rowCount - 1) {
68895
69059
  break;
68896
69060
  }
69061
+ changedCellResults[i] = [];
68897
69062
  pasteRowEnd = startRow + i;
68898
69063
  const rowValues = values[i];
68899
69064
  let thisRowPasteColEnd = startCol;
@@ -68924,6 +69089,7 @@
68924
69089
  }
68925
69090
  }
68926
69091
  if (isCanChange) {
69092
+ changedCellResults[i][j] = true;
68927
69093
  const value = rowValues[j];
68928
69094
  const recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i);
68929
69095
  const { field } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i);
@@ -68946,6 +69112,9 @@
68946
69112
  });
68947
69113
  }
68948
69114
  }
69115
+ else {
69116
+ changedCellResults[i][j] = false;
69117
+ }
68949
69118
  }
68950
69119
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
68951
69120
  }
@@ -68978,7 +69147,7 @@
68978
69147
  table.internalProps.layoutMap.clearCellRangeMap();
68979
69148
  table.scenegraph.clearCells();
68980
69149
  table.scenegraph.createSceneGraph();
68981
- return;
69150
+ return changedCellResults;
68982
69151
  }
68983
69152
  for (let sCol = startRange.start.col; sCol <= range.end.col; sCol++) {
68984
69153
  for (let sRow = startRange.start.row; sRow <= range.end.row; sRow++) {
@@ -69019,6 +69188,7 @@
69019
69188
  table.scenegraph.updateRowsHeight(rows, deltaYs);
69020
69189
  }
69021
69190
  table.scenegraph.updateNextFrame();
69191
+ return changedCellResults;
69022
69192
  }
69023
69193
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
69024
69194
  if (oldCellUpdateType === 'group') {
@@ -74713,7 +74883,155 @@
74713
74883
  return cellGroup;
74714
74884
  }
74715
74885
 
74716
- function createCheckboxCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync) {
74886
+ class CheckboxContent extends Group$1 {
74887
+ _leftGroup;
74888
+ _rightGroup;
74889
+ _checkboxGroup;
74890
+ _autoWidth = false;
74891
+ _autoHeight = false;
74892
+ _cellWidth;
74893
+ _originCellWidth;
74894
+ _cellHeight;
74895
+ _align;
74896
+ _baseline;
74897
+ constructor(params) {
74898
+ super(params);
74899
+ this._leftGroup = new Group$1({
74900
+ pickable: false,
74901
+ fill: false,
74902
+ stroke: false
74903
+ });
74904
+ this._leftGroup.role = 'content-left';
74905
+ this._rightGroup = new Group$1({
74906
+ pickable: false,
74907
+ fill: false,
74908
+ stroke: false
74909
+ });
74910
+ this._rightGroup.role = 'content-right';
74911
+ this._checkboxGroup = new Group$1({
74912
+ pickable: false,
74913
+ fill: false,
74914
+ stroke: false
74915
+ });
74916
+ this._checkboxGroup.role = 'content-center';
74917
+ this.appendChild(this._leftGroup);
74918
+ this.appendChild(this._rightGroup);
74919
+ this.appendChild(this._checkboxGroup);
74920
+ }
74921
+ addLeftOccupyingIcon(icon) {
74922
+ icon.setAttribute('x', this._leftGroup.width + (icon.attribute.marginLeft ?? 0));
74923
+ this._leftGroup.appendChild(icon);
74924
+ this._leftGroup.setDeltaWidth((icon.attribute.marginLeft ?? 0) + (icon.attribute.marginRight ?? 0) + icon.attribute.width);
74925
+ }
74926
+ addRightOccupyingIcon(icon) {
74927
+ icon.setAttribute('x', this._rightGroup.width + (icon.attribute.marginLeft ?? 0));
74928
+ this._rightGroup.appendChild(icon);
74929
+ this._rightGroup.setDeltaWidth((icon.attribute.marginLeft ?? 0) + (icon.attribute.marginRight ?? 0) + icon.attribute.width);
74930
+ }
74931
+ addCheckbox(checkbox) {
74932
+ this._checkboxGroup.appendChild(checkbox);
74933
+ }
74934
+ setCheckboxContentOption(option) {
74935
+ this._autoWidth = option.autoWidth;
74936
+ this._autoHeight = option.autoHeight;
74937
+ this._cellWidth = option.cellWidth;
74938
+ this._originCellWidth = option.cellWidth;
74939
+ this._cellHeight = option.cellHeight;
74940
+ this._align = option.align;
74941
+ this._baseline = option.baseline;
74942
+ }
74943
+ layout() {
74944
+ let leftOccupyingWidth = this._leftGroup.width;
74945
+ if (leftOccupyingWidth === Infinity) {
74946
+ leftOccupyingWidth = 0;
74947
+ }
74948
+ let rightOccupyingWidth = this._rightGroup.width;
74949
+ if (rightOccupyingWidth === -Infinity) {
74950
+ rightOccupyingWidth = 0;
74951
+ }
74952
+ if (this._autoWidth) {
74953
+ const checkboxWidth = this._checkboxGroup.width;
74954
+ this._cellWidth = leftOccupyingWidth + rightOccupyingWidth + checkboxWidth;
74955
+ this.setAttribute('width', this._cellWidth);
74956
+ }
74957
+ else {
74958
+ const contentWidth = this._cellWidth - leftOccupyingWidth - rightOccupyingWidth;
74959
+ this.updateCenterLayout(contentWidth);
74960
+ const centerWidth = this._checkboxGroup.width;
74961
+ this._cellWidth = leftOccupyingWidth + rightOccupyingWidth + centerWidth;
74962
+ this.setAttribute('width', this._cellWidth);
74963
+ }
74964
+ this.updateHorizontalPos();
74965
+ const leftOccupyingHeight = this._leftGroup.height;
74966
+ const rightOccupyingHeight = this._rightGroup.height;
74967
+ const centerHeight = this._checkboxGroup.height;
74968
+ this._cellHeight = Math.max(leftOccupyingHeight, rightOccupyingHeight, centerHeight);
74969
+ this.setAttribute('height', this._cellHeight);
74970
+ this.updateVerticalPos();
74971
+ }
74972
+ updateCenterLayout(contentWidth) {
74973
+ let checkboxWidth = contentWidth;
74974
+ this._checkboxGroup.forEachChildren(child => {
74975
+ if (child instanceof CheckBox) {
74976
+ checkboxWidth -= child.AABBBounds.width();
74977
+ }
74978
+ });
74979
+ const checkbox = this._checkboxGroup.getChildByName('checkbox-content');
74980
+ if (checkbox instanceof CheckBox) {
74981
+ checkbox.setAttribute('width', checkboxWidth);
74982
+ }
74983
+ let x = 0;
74984
+ this._checkboxGroup.forEachChildren((child) => {
74985
+ child.setAttribute('x', x);
74986
+ x += child.AABBBounds.width();
74987
+ });
74988
+ }
74989
+ updateHorizontalPos() {
74990
+ this._leftGroup.setAttribute('x', 0);
74991
+ this._rightGroup.setAttribute('x', this._cellWidth - this._rightGroup.width);
74992
+ this._checkboxGroup.setAttribute('x', 4);
74993
+ if (this._align === 'left' || this._align === 'start') {
74994
+ this.setAttribute('dx', 0);
74995
+ }
74996
+ else if (this._align === 'center') {
74997
+ this.setAttribute('dx', -this.attribute.width / 2);
74998
+ }
74999
+ else if (this._align === 'right' || this._align === 'end') {
75000
+ this.setAttribute('dx', -this.attribute.width);
75001
+ }
75002
+ }
75003
+ updateVerticalPos() {
75004
+ if (this._baseline === 'top') {
75005
+ this._leftGroup.setAttribute('y', 0);
75006
+ this._rightGroup.setAttribute('y', 0);
75007
+ this._checkboxGroup.setAttribute('y', 0);
75008
+ }
75009
+ else if (this._baseline === 'middle') {
75010
+ this._leftGroup.forEachChildren((icon) => {
75011
+ icon.setAttribute('y', (this._leftGroup.height - icon.AABBBounds.height()) / 2);
75012
+ });
75013
+ this._rightGroup.forEachChildren((icon) => {
75014
+ icon.setAttribute('y', (this._rightGroup.height - icon.AABBBounds.height()) / 2);
75015
+ });
75016
+ this._leftGroup.setAttribute('y', this._cellHeight / 2 - this._leftGroup.height / 2);
75017
+ this._rightGroup.setAttribute('y', this._cellHeight / 2 - this._rightGroup.height / 2);
75018
+ this._checkboxGroup.setAttribute('y', this._cellHeight / 2 - this._checkboxGroup.height / 2);
75019
+ }
75020
+ else if (this._baseline === 'bottom') {
75021
+ this._leftGroup.forEachChildren((icon) => {
75022
+ icon.setAttribute('y', this._leftGroup.height - icon.AABBBounds.height());
75023
+ });
75024
+ this._rightGroup.forEachChildren((icon) => {
75025
+ icon.setAttribute('y', this._rightGroup.height - icon.AABBBounds.height());
75026
+ });
75027
+ this._leftGroup.setAttribute('y', this._cellHeight - this._leftGroup.height);
75028
+ this._rightGroup.setAttribute('y', this._cellHeight - this._rightGroup.height);
75029
+ this._checkboxGroup.setAttribute('y', this._cellHeight - this._checkboxGroup.height);
75030
+ }
75031
+ }
75032
+ }
75033
+
75034
+ function createCheckboxCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, isCheckboxTree) {
74717
75035
  if (!cellGroup) {
74718
75036
  const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
74719
75037
  if (isAsync) {
@@ -74772,10 +75090,16 @@
74772
75090
  }
74773
75091
  let iconWidth = 0;
74774
75092
  let cellLeftIconWidth = 0;
75093
+ let cellRightIconWidth = 0;
75094
+ let cellabsoluteRightIconWidth = 0;
75095
+ let cellContentLeftIcons = [];
74775
75096
  if (Array.isArray(icons) && icons.length !== 0) {
74776
- const { leftIconWidth, rightIconWidth, absoluteLeftIconWidth, absoluteRightIconWidth } = dealWithIconLayout(icons, cellGroup, range, table);
75097
+ const { leftIconWidth, rightIconWidth, contentLeftIcons, contentRightIcons, absoluteLeftIconWidth, absoluteRightIconWidth } = dealWithIconLayout(icons, cellGroup, range, table);
74777
75098
  iconWidth = leftIconWidth + rightIconWidth;
74778
75099
  cellLeftIconWidth = leftIconWidth;
75100
+ cellRightIconWidth = rightIconWidth;
75101
+ cellContentLeftIcons = contentLeftIcons;
75102
+ cellabsoluteRightIconWidth = absoluteRightIconWidth;
74779
75103
  cellGroup.forEachChildren((child) => {
74780
75104
  if (child.role === 'icon-left') {
74781
75105
  child.setAttribute('x', child.attribute.x + padding[3]);
@@ -74799,11 +75123,89 @@
74799
75123
  }
74800
75124
  });
74801
75125
  }
74802
- const checkboxComponent = createCheckbox(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
74803
- if (checkboxComponent) {
74804
- cellGroup.appendChild(checkboxComponent);
75126
+ const checkboxComponent = createCheckbox(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, isCheckboxTree);
75127
+ if (cellContentLeftIcons.length === 1 &&
75128
+ (cellContentLeftIcons[0].name === InternalIconName.expandIconName ||
75129
+ cellContentLeftIcons[0].name === InternalIconName.collapseIconName)) {
75130
+ const checkContent = new CheckboxContent({
75131
+ x: 0,
75132
+ y: 0,
75133
+ fill: false,
75134
+ stroke: false,
75135
+ pickable: false
75136
+ });
75137
+ checkContent.name = 'checkbox-content';
75138
+ checkContent.setCheckboxContentOption({
75139
+ autoWidth: false,
75140
+ autoHeight: false,
75141
+ cellWidth: width - (padding[1] + padding[3]),
75142
+ cellHeight: height - padding[0] - padding[2],
75143
+ align: textAlign,
75144
+ baseline: textBaseline
75145
+ });
75146
+ const dealWithIconComputeVar = {
75147
+ addedHierarchyOffset: 0
75148
+ };
75149
+ cellContentLeftIcons.forEach(icon => {
75150
+ const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table, dealWithIconComputeVar);
75151
+ iconMark.role = 'icon-content-left';
75152
+ iconMark.name = icon.name;
75153
+ checkContent.addLeftOccupyingIcon(iconMark);
75154
+ });
75155
+ if (checkboxComponent) {
75156
+ checkContent.addCheckbox(checkboxComponent);
75157
+ }
75158
+ cellGroup.appendChild(checkContent);
75159
+ checkContent.layout();
75160
+ checkContent.AABBBounds.width();
75161
+ checkContent.AABBBounds.height();
75162
+ const Awidth = width - (padding[1] + padding[3]);
75163
+ const Aheight = height - (padding[0] + padding[2]);
75164
+ cellGroup.forEachChildren((child) => {
75165
+ if (child.role === 'icon-left') {
75166
+ child.setAttribute('x', child.attribute.x + padding[3]);
75167
+ }
75168
+ else if (child.role === 'icon-right') {
75169
+ child.setAttribute('x', child.attribute.x + Awidth - cellRightIconWidth + padding[3]);
75170
+ }
75171
+ else if (child.role === 'icon-absolute-right') {
75172
+ child.setAttribute('x', child.attribute.x + Awidth - cellabsoluteRightIconWidth + padding[3] + padding[1]);
75173
+ }
75174
+ else if (child.name === 'content' || child.name === 'checkbox-content') {
75175
+ if (textAlign === 'center' && child.type !== 'richtext') {
75176
+ child.setAttribute('x', padding[3] + cellLeftIconWidth + (Awidth - cellLeftIconWidth - cellRightIconWidth) / 2);
75177
+ }
75178
+ else if (textAlign === 'right' && child.type !== 'richtext') {
75179
+ child.setAttribute('x', padding[3] + Awidth - cellRightIconWidth);
75180
+ }
75181
+ else {
75182
+ child.setAttribute('x', padding[3] + cellLeftIconWidth);
75183
+ }
75184
+ }
75185
+ });
75186
+ cellGroup.forEachChildren((child) => {
75187
+ if (child.name === CUSTOM_CONTAINER_NAME) {
75188
+ return;
75189
+ }
75190
+ if (textBaseline === 'middle') {
75191
+ if (child?._checkboxGroup) {
75192
+ child._leftGroup.setAttribute('y', padding[0] + (Aheight - child._checkboxGroup.AABBBounds.height()) / 2);
75193
+ }
75194
+ }
75195
+ else if (textBaseline === 'bottom') {
75196
+ child.setAttribute('y', padding[0] + Aheight - child.AABBBounds.height());
75197
+ }
75198
+ else {
75199
+ child.setAttribute('y', padding[0]);
75200
+ }
75201
+ });
75202
+ }
75203
+ else {
75204
+ if (checkboxComponent) {
75205
+ cellGroup.appendChild(checkboxComponent);
75206
+ }
75207
+ checkboxComponent.render();
74805
75208
  }
74806
- checkboxComponent.render();
74807
75209
  width -= padding[1] + padding[3] + iconWidth;
74808
75210
  height -= padding[0] + padding[2];
74809
75211
  if (textAlign === 'center') {
@@ -74826,7 +75228,7 @@
74826
75228
  }
74827
75229
  return cellGroup;
74828
75230
  }
74829
- function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
75231
+ function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, isCheckboxTree) {
74830
75232
  const style = table._getCellStyle(col, row);
74831
75233
  const size = getProp('size', style, col, row, table);
74832
75234
  const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', style, col, row, table);
@@ -74853,6 +75255,14 @@
74853
75255
  isChecked = value;
74854
75256
  text = '';
74855
75257
  }
75258
+ if (table.internalProps.layoutMap.isSeriesNumber(col, row)) {
75259
+ const checkboxSeriesNumberStyle = table.getFieldData(define.field, col, row);
75260
+ if (checkboxSeriesNumberStyle) {
75261
+ isChecked = checkboxSeriesNumberStyle.checked;
75262
+ isDisabled = checkboxSeriesNumberStyle.disable;
75263
+ text = checkboxSeriesNumberStyle.text ?? '';
75264
+ }
75265
+ }
74856
75266
  isChecked = table.stateManager.syncCheckedState(col, row, define.field, isChecked);
74857
75267
  const hierarchyOffset = getHierarchyOffset(col, row, table);
74858
75268
  const cellStyle = table._getCellStyle(col, row);
@@ -74892,7 +75302,7 @@
74892
75302
  wordBreak: 'break-word',
74893
75303
  heightLimit: autoRowHeight ? -1 : cellHeight - Math.floor(padding[0] + padding[2]),
74894
75304
  pickable: false,
74895
- dx: hierarchyOffset,
75305
+ dx: isCheckboxTree ? 0 : hierarchyOffset,
74896
75306
  whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
74897
75307
  };
74898
75308
  const testAttribute = cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute;
@@ -74908,6 +75318,7 @@
74908
75318
  width: size,
74909
75319
  height: size
74910
75320
  },
75321
+ dx: isCheckboxTree ? hierarchyOffset : 0,
74911
75322
  spaceBetweenTextAndIcon,
74912
75323
  disabled: isDisabled ?? globalDisable ?? false
74913
75324
  };
@@ -85403,7 +85814,7 @@
85403
85814
  }
85404
85815
 
85405
85816
  registerForVrender();
85406
- const version = "1.0.1";
85817
+ const version = "1.0.3";
85407
85818
  function getIcons() {
85408
85819
  return get$2();
85409
85820
  }