k-vtable 1.0.1 → 1.0.2

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