@visactor/vtable 0.22.1 → 0.22.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/cjs/body-helper/style/Style.d.ts +3 -0
  2. package/cjs/body-helper/style/Style.js +22 -15
  3. package/cjs/body-helper/style/Style.js.map +1 -1
  4. package/cjs/core/BaseTable.d.ts +1 -1
  5. package/cjs/core/BaseTable.js +3 -2
  6. package/cjs/core/BaseTable.js.map +1 -1
  7. package/cjs/event/event.js +2 -1
  8. package/cjs/event/event.js.map +1 -1
  9. package/cjs/header-helper/style/Style.d.ts +3 -0
  10. package/cjs/header-helper/style/Style.js +26 -19
  11. package/cjs/header-helper/style/Style.js.map +1 -1
  12. package/cjs/index.d.ts +1 -1
  13. package/cjs/index.js +1 -1
  14. package/cjs/index.js.map +1 -1
  15. package/cjs/layout/tree-helper.js +1 -0
  16. package/cjs/plugins/themes.js +1 -2
  17. package/cjs/scenegraph/group-creater/cell-helper.js +3 -1
  18. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  19. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +5 -4
  20. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  21. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
  22. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  23. package/cjs/scenegraph/layout/compute-col-width.js +7 -4
  24. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  25. package/cjs/scenegraph/layout/compute-row-height.js +70 -71
  26. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  27. package/cjs/scenegraph/layout/update-height.js +18 -11
  28. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  29. package/cjs/scenegraph/layout/update-width.js +19 -13
  30. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  31. package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
  32. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  33. package/cjs/scenegraph/utils/text-measure.js +6 -6
  34. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  35. package/cjs/vrender.js.map +1 -1
  36. package/dist/vtable.js +183 -123
  37. package/dist/vtable.min.js +2 -2
  38. package/es/body-helper/style/Style.d.ts +3 -0
  39. package/es/body-helper/style/Style.js +22 -15
  40. package/es/body-helper/style/Style.js.map +1 -1
  41. package/es/core/BaseTable.d.ts +1 -1
  42. package/es/core/BaseTable.js +3 -2
  43. package/es/core/BaseTable.js.map +1 -1
  44. package/es/event/event.js +2 -1
  45. package/es/event/event.js.map +1 -1
  46. package/es/header-helper/style/Style.d.ts +3 -0
  47. package/es/header-helper/style/Style.js +26 -19
  48. package/es/header-helper/style/Style.js.map +1 -1
  49. package/es/index.d.ts +1 -1
  50. package/es/index.js +1 -1
  51. package/es/index.js.map +1 -1
  52. package/es/layout/tree-helper.js +2 -1
  53. package/es/plugins/themes.js +1 -2
  54. package/es/scenegraph/group-creater/cell-helper.js +2 -1
  55. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  56. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +6 -3
  57. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  58. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
  59. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  60. package/es/scenegraph/layout/compute-col-width.js +6 -4
  61. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  62. package/es/scenegraph/layout/compute-row-height.js +69 -70
  63. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  64. package/es/scenegraph/layout/update-height.js +16 -9
  65. package/es/scenegraph/layout/update-height.js.map +1 -1
  66. package/es/scenegraph/layout/update-width.js +19 -10
  67. package/es/scenegraph/layout/update-width.js.map +1 -1
  68. package/es/scenegraph/utils/text-icon-layout.js +1 -1
  69. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  70. package/es/scenegraph/utils/text-measure.js +6 -6
  71. package/es/scenegraph/utils/text-measure.js.map +1 -1
  72. package/es/vrender.js.map +1 -1
  73. package/package.json +5 -5
package/dist/vtable.js CHANGED
@@ -21687,6 +21687,7 @@
21687
21687
  _padding;
21688
21688
  _defaultPadding = [10, 16, 10, 16];
21689
21689
  _textStick;
21690
+ _textStickBaseOnAlign;
21690
21691
  _textOverflow;
21691
21692
  _textAlign;
21692
21693
  _textBaseline;
@@ -21725,6 +21726,7 @@
21725
21726
  this._borderColor = style?.borderColor ?? bodyStyle?.borderColor;
21726
21727
  this._textOverflow = style?.textOverflow ?? bodyStyle?.textOverflow;
21727
21728
  this._textStick = style.textStick ?? bodyStyle?.textStick ?? false;
21729
+ this._textStickBaseOnAlign = style.textStickBaseOnAlign ?? bodyStyle?.textStickBaseOnAlign ?? false;
21728
21730
  this._bgColor = style?.bgColor ?? bodyStyle?.bgColor;
21729
21731
  this._lineHeight = style?.lineHeight ?? bodyStyle?.lineHeight;
21730
21732
  this._underline = style?.underline ?? bodyStyle?.underline;
@@ -21806,6 +21808,12 @@
21806
21808
  set textStick(textStick) {
21807
21809
  this._textStick = textStick;
21808
21810
  }
21811
+ get textStickBaseOnAlign() {
21812
+ return this._textStickBaseOnAlign;
21813
+ }
21814
+ set textStickBaseOnAlign(textStickBaseOnAlign) {
21815
+ this._textStickBaseOnAlign = textStickBaseOnAlign;
21816
+ }
21809
21817
  get textAlign() {
21810
21818
  return this._textAlign;
21811
21819
  }
@@ -22089,6 +22097,7 @@
22089
22097
  _padding;
22090
22098
  _defaultPadding = [10, 16, 10, 16];
22091
22099
  _textStick;
22100
+ _textStickBaseOnAlign;
22092
22101
  _marked;
22093
22102
  _textAlign;
22094
22103
  _textBaseline;
@@ -22122,6 +22131,7 @@
22122
22131
  this._fontStyle = style.fontStyle ?? headerStyle?.fontStyle;
22123
22132
  this._textOverflow = (style.textOverflow ?? headerStyle?.textOverflow) || 'ellipsis';
22124
22133
  this._textStick = style.textStick ?? headerStyle?.textStick ?? false;
22134
+ this._textStickBaseOnAlign = style.textStickBaseOnAlign ?? headerStyle?.textStickBaseOnAlign ?? false;
22125
22135
  this._marked = style.marked ?? headerStyle?.marked ?? false;
22126
22136
  this._textAlign = (style.textAlign ?? headerStyle?.textAlign) || 'left';
22127
22137
  this._textBaseline = (style.textBaseline ?? headerStyle?.textBaseline) || 'middle';
@@ -22207,6 +22217,12 @@
22207
22217
  set textStick(textStick) {
22208
22218
  this._textStick = textStick;
22209
22219
  }
22220
+ get textStickBaseOnAlign() {
22221
+ return this._textStickBaseOnAlign;
22222
+ }
22223
+ set textStickBaseOnAlign(textStickBaseOnAlign) {
22224
+ this._textStickBaseOnAlign = textStickBaseOnAlign;
22225
+ }
22210
22226
  get marked() {
22211
22227
  return this._marked;
22212
22228
  }
@@ -36459,9 +36475,13 @@
36459
36475
  const height = table.getRowHeight(row);
36460
36476
  let contentWidth = width;
36461
36477
  let contentHeight = height;
36478
+ let _contentOffset = 0;
36479
+ if (isNumber$4(table.theme._contentOffset)) {
36480
+ _contentOffset = table.theme._contentOffset;
36481
+ }
36462
36482
  const percentCompleteBarGroup = new Group$1({
36463
- x: 0,
36464
- y: 0,
36483
+ x: -_contentOffset,
36484
+ y: -_contentOffset,
36465
36485
  width: contentWidth,
36466
36486
  height: contentHeight
36467
36487
  });
@@ -37790,7 +37810,7 @@
37790
37810
  }
37791
37811
  iconAttribute.marginLeft = (icon.marginLeft ?? 0) + hierarchyOffset;
37792
37812
  iconAttribute.marginRight = icon.marginRight ?? 0;
37793
- if (icon.interactive) {
37813
+ if (icon.interactive === false) {
37794
37814
  iconAttribute.pickable = false;
37795
37815
  }
37796
37816
  if (icon.hover) {
@@ -38693,7 +38713,7 @@
38693
38713
  });
38694
38714
  }
38695
38715
  });
38696
- const lineWidth = cellGroup.attribute.lineWidth;
38716
+ const lineWidth = cellGroup.attribute.strokeArrayWidth ?? cellGroup.attribute.lineWidth;
38697
38717
  const isLineWidthArray = isArray$3(lineWidth);
38698
38718
  const newLineWidth = [0, 0, 0, 0];
38699
38719
  if (col === range.start.col) {
@@ -39912,7 +39932,7 @@
39912
39932
  }
39913
39933
  }
39914
39934
  function computeRowHeight(row, startCol, endCol, table) {
39915
- let maxHeight = 0;
39935
+ let maxHeight;
39916
39936
  if (table.isPivotChart() &&
39917
39937
  row >= table.columnHeaderLevelCount &&
39918
39938
  row < table.rowCount - table.bottomFrozenRowCount) {
@@ -39932,7 +39952,7 @@
39932
39952
  for (let col = startCol; col <= endCol; col++) {
39933
39953
  const customHeight = computeCustomRenderHeight(col, row, table);
39934
39954
  if (customHeight) {
39935
- maxHeight = Math.max(customHeight.height, maxHeight);
39955
+ maxHeight = isValid$3(maxHeight) ? Math.max(customHeight.height, maxHeight) : customHeight.height;
39936
39956
  if (!customHeight.renderDefault) {
39937
39957
  continue;
39938
39958
  }
@@ -39943,7 +39963,7 @@
39943
39963
  if (axisConfig) {
39944
39964
  const axisWidth = computeAxisComponentHeight(axisConfig, table);
39945
39965
  if (typeof axisWidth === 'number') {
39946
- maxHeight = Math.max(axisWidth, maxHeight);
39966
+ maxHeight = isValid$3(maxHeight) ? Math.max(axisWidth, maxHeight) : axisWidth;
39947
39967
  continue;
39948
39968
  }
39949
39969
  }
@@ -39956,19 +39976,14 @@
39956
39976
  const cellType = table.isHeader(col, row)
39957
39977
  ? table._getHeaderLayoutMap(col, row)?.headerType
39958
39978
  : table.getBodyColumnType(col, row);
39959
- if (isValid$3(cellType) &&
39960
- cellType !== 'text' &&
39961
- cellType !== 'link' &&
39962
- cellType !== 'progressbar' &&
39963
- cellType !== 'checkbox') {
39964
- const defaultHeight = table.getDefaultRowHeight(row);
39965
- maxHeight = Math.max(maxHeight, isNumber$4(defaultHeight) ? defaultHeight : table.defaultRowHeight);
39966
- continue;
39967
- }
39968
39979
  const textHeight = computeTextHeight(col, row, cellType, table);
39969
- maxHeight = Math.max(textHeight, maxHeight);
39980
+ maxHeight = isValid$3(maxHeight) ? Math.max(textHeight, maxHeight) : textHeight;
39970
39981
  }
39971
- return maxHeight;
39982
+ if (isValid$3(maxHeight)) {
39983
+ return maxHeight;
39984
+ }
39985
+ const defaultHeight = table.getDefaultRowHeight(row);
39986
+ return isNumber$4(defaultHeight) ? defaultHeight : table.defaultRowHeight;
39972
39987
  }
39973
39988
  function checkFixedStyleAndNoWrap(table) {
39974
39989
  const { layoutMap } = table.internalProps;
@@ -40164,87 +40179,92 @@
40164
40179
  const fontFamily = getProp('fontFamily', actStyle, col, row, table);
40165
40180
  const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);
40166
40181
  let text;
40167
- if (cellType === 'checkbox') {
40168
- text = isObject$4(cellValue) ? cellValue.text : cellValue;
40182
+ if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {
40183
+ maxHeight = lineHeight;
40169
40184
  }
40170
40185
  else {
40171
- text = cellValue;
40172
- }
40173
- const lines = validToString(text).split('\n') || [];
40174
- const cellWidth = table.getColsWidth(col, endCol);
40175
- if (cellType === 'checkbox') {
40176
- const size = getProp('size', actStyle, col, row, table);
40177
- if (autoWrapText) {
40178
- const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);
40179
- const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - size - spaceBetweenTextAndIcon;
40180
- utilCheckBoxMark.setAttributes({
40181
- text: {
40182
- maxLineWidth,
40183
- text: lines,
40184
- fontSize,
40185
- fontStyle,
40186
- fontWeight,
40187
- fontFamily,
40188
- lineHeight,
40189
- wordBreak: 'break-word'
40190
- },
40191
- icon: {
40192
- width: Math.floor(size / 1.4),
40193
- height: Math.floor(size / 1.4)
40194
- },
40195
- box: {
40196
- width: size,
40197
- height: size
40198
- },
40199
- spaceBetweenTextAndIcon
40186
+ if (cellType === 'checkbox') {
40187
+ text = isObject$4(cellValue) ? cellValue.text : cellValue;
40188
+ }
40189
+ else {
40190
+ text = cellValue;
40191
+ }
40192
+ const lines = validToString(text).split('\n') || [];
40193
+ const cellWidth = table.getColsWidth(col, endCol);
40194
+ if (cellType === 'checkbox') {
40195
+ const size = getProp('size', actStyle, col, row, table);
40196
+ if (autoWrapText) {
40197
+ const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);
40198
+ const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - size - spaceBetweenTextAndIcon;
40199
+ utilCheckBoxMark.setAttributes({
40200
+ text: {
40201
+ maxLineWidth,
40202
+ text: lines,
40203
+ fontSize,
40204
+ fontStyle,
40205
+ fontWeight,
40206
+ fontFamily,
40207
+ lineHeight,
40208
+ wordBreak: 'break-word'
40209
+ },
40210
+ icon: {
40211
+ width: Math.floor(size / 1.4),
40212
+ height: Math.floor(size / 1.4)
40213
+ },
40214
+ box: {
40215
+ width: size,
40216
+ height: size
40217
+ },
40218
+ spaceBetweenTextAndIcon
40219
+ });
40220
+ utilCheckBoxMark.render();
40221
+ maxHeight = utilTextMark.AABBBounds.height();
40222
+ }
40223
+ else {
40224
+ maxHeight = Math.max(size, lines.length * lineHeight);
40225
+ }
40226
+ }
40227
+ else if (iconInlineFront.length || iconInlineEnd.length) {
40228
+ const textOption = Object.assign({
40229
+ text: cellValue?.toString(),
40230
+ fontFamily,
40231
+ fontSize,
40232
+ fontStyle,
40233
+ fontWeight,
40234
+ lineHeight
40200
40235
  });
40201
- utilCheckBoxMark.render();
40202
- maxHeight = utilTextMark.AABBBounds.height();
40236
+ textOption.textBaseline = 'middle';
40237
+ const textConfig = [
40238
+ ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),
40239
+ textOption,
40240
+ ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))
40241
+ ];
40242
+ utilRichTextMark.setAttributes({
40243
+ width: cellWidth - (padding[1] + padding[3]) - iconWidth,
40244
+ height: 0,
40245
+ textConfig
40246
+ });
40247
+ maxHeight = utilRichTextMark.AABBBounds.height();
40248
+ }
40249
+ else if (autoWrapText) {
40250
+ const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;
40251
+ utilTextMark.setAttributes({
40252
+ maxLineWidth,
40253
+ text: lines,
40254
+ fontSize,
40255
+ fontStyle,
40256
+ fontWeight,
40257
+ fontFamily,
40258
+ lineHeight,
40259
+ wordBreak: 'break-word',
40260
+ whiteSpace: lines.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
40261
+ });
40262
+ maxHeight = utilTextMark.AABBBounds.height() || (typeof lineHeight === 'number' ? lineHeight : fontSize);
40203
40263
  }
40204
40264
  else {
40205
- maxHeight = Math.max(size, lines.length * lineHeight);
40265
+ maxHeight = lines.length * lineHeight;
40206
40266
  }
40207
40267
  }
40208
- else if (iconInlineFront.length || iconInlineEnd.length) {
40209
- const textOption = Object.assign({
40210
- text: cellValue?.toString(),
40211
- fontFamily,
40212
- fontSize,
40213
- fontStyle,
40214
- fontWeight,
40215
- lineHeight
40216
- });
40217
- textOption.textBaseline = 'middle';
40218
- const textConfig = [
40219
- ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),
40220
- textOption,
40221
- ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))
40222
- ];
40223
- utilRichTextMark.setAttributes({
40224
- width: cellWidth - (padding[1] + padding[3]) - iconWidth,
40225
- height: 0,
40226
- textConfig
40227
- });
40228
- maxHeight = utilRichTextMark.AABBBounds.height();
40229
- }
40230
- else if (autoWrapText) {
40231
- const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;
40232
- utilTextMark.setAttributes({
40233
- maxLineWidth,
40234
- text: lines,
40235
- fontSize,
40236
- fontStyle,
40237
- fontWeight,
40238
- fontFamily,
40239
- lineHeight,
40240
- wordBreak: 'break-word',
40241
- whiteSpace: lines.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
40242
- });
40243
- maxHeight = utilTextMark.AABBBounds.height() || (typeof lineHeight === 'number' ? lineHeight : fontSize);
40244
- }
40245
- else {
40246
- maxHeight = lines.length * lineHeight;
40247
- }
40248
40268
  return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;
40249
40269
  }
40250
40270
  function getCellRect$1(col, row, table) {
@@ -40395,7 +40415,13 @@
40395
40415
  if (customLayout || customRender) {
40396
40416
  const style = scene.table._getCellStyle(col, row);
40397
40417
  const padding = getQuadProps(getProp('padding', style, col, row, scene.table));
40398
- const customResult = dealWithCustom(customLayout, customRender, col, row, cell.attribute.width, cell.attribute.height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
40418
+ let width = cell.attribute.width;
40419
+ let height = cell.attribute.height;
40420
+ if (isMergeCellGroup(cell)) {
40421
+ width = scene.table.getColsWidth(cell.mergeStartCol, cell.mergeEndCol);
40422
+ height = scene.table.getRowsHeight(cell.mergeStartRow, cell.mergeEndRow);
40423
+ }
40424
+ const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
40399
40425
  customElementsGroup = customResult.elementsGroup;
40400
40426
  renderDefault = customResult.renderDefault;
40401
40427
  }
@@ -40407,13 +40433,10 @@
40407
40433
  }
40408
40434
  }
40409
40435
  }
40410
- if (renderDefault) {
40411
- const style = scene.table._getCellStyle(col, row);
40412
- updateMergeCellContentHeight(cell, distHeight, detaY, scene.table.heightMode === 'autoHeight', getQuadProps(style.padding), style.textAlign, style.textBaseline, scene.table);
40413
- }
40436
+ updateMergeCellContentHeight(cell, distHeight, detaY, scene.table.heightMode === 'autoHeight', renderDefault, scene.table);
40414
40437
  }
40415
40438
  }
40416
- function updateMergeCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline, table) {
40439
+ function updateMergeCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, renderDefault, table) {
40417
40440
  if (isMergeCellGroup(cellGroup)) {
40418
40441
  distHeight = 0;
40419
40442
  for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
@@ -40429,7 +40452,10 @@
40429
40452
  dy: 0
40430
40453
  });
40431
40454
  });
40432
- updateCellContentHeight(singleCellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);
40455
+ if (renderDefault) {
40456
+ const style = table._getCellStyle(col, row);
40457
+ updateCellContentHeight(singleCellGroup, distHeight, detaY, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline);
40458
+ }
40433
40459
  const rangeHeight = table.getRowHeight(row);
40434
40460
  const rangeWidth = table.getColWidth(col);
40435
40461
  singleCellGroup.contentHeight = distHeight;
@@ -40450,7 +40476,8 @@
40450
40476
  }
40451
40477
  }
40452
40478
  else {
40453
- updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);
40479
+ const style = table._getCellStyle(cellGroup.col, cellGroup.row);
40480
+ updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline);
40454
40481
  }
40455
40482
  }
40456
40483
 
@@ -40695,7 +40722,13 @@
40695
40722
  if (customLayout || customRender) {
40696
40723
  const style = scene.table._getCellStyle(col, row);
40697
40724
  const padding = getQuadProps(getProp('padding', style, col, row, scene.table));
40698
- const customResult = dealWithCustom(customLayout, customRender, col, row, cellGroup.attribute.width, cellGroup.attribute.height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
40725
+ let width = cellGroup.attribute.width;
40726
+ let height = cellGroup.attribute.height;
40727
+ if (isMergeCellGroup(cellGroup)) {
40728
+ width = scene.table.getColsWidth(cellGroup.mergeStartCol, cellGroup.mergeEndCol);
40729
+ height = scene.table.getRowsHeight(cellGroup.mergeStartRow, cellGroup.mergeEndRow);
40730
+ }
40731
+ const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
40699
40732
  customElementsGroup = customResult.elementsGroup;
40700
40733
  renderDefault = customResult.renderDefault;
40701
40734
  isHeightChange = true;
@@ -40708,14 +40741,12 @@
40708
40741
  }
40709
40742
  }
40710
40743
  }
40711
- if (renderDefault) {
40712
- const style = scene.table._getCellStyle(col, row);
40713
- isHeightChange = updateMergeCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline, scene.table);
40714
- }
40744
+ const cellChange = updateMergeCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, renderDefault, scene.table);
40745
+ isHeightChange = isHeightChange || cellChange;
40715
40746
  }
40716
40747
  return autoRowHeight && autoWrapText ? isHeightChange : false;
40717
40748
  }
40718
- function updateMergeCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, padding, textAlign, textBaseline, table) {
40749
+ function updateMergeCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, renderDefault, table) {
40719
40750
  if (isMergeCellGroup(cellGroup)) {
40720
40751
  distWidth = 0;
40721
40752
  let isHeightChange = false;
@@ -40729,6 +40760,9 @@
40729
40760
  const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
40730
40761
  for (let col = colStart; col <= colEnd; col++) {
40731
40762
  for (let row = rowStart; row <= rowEnd; row++) {
40763
+ if (col === cellGroup.col && row !== cellGroup.row) {
40764
+ continue;
40765
+ }
40732
40766
  const singleCellGroup = table.scenegraph.getCell(col, row);
40733
40767
  singleCellGroup.forEachChildren((child) => {
40734
40768
  child.setAttributes({
@@ -40736,13 +40770,20 @@
40736
40770
  dy: 0
40737
40771
  });
40738
40772
  });
40739
- const changed = updateCellContentWidth(singleCellGroup, distWidth, cellHeight, detaX, autoRowHeight, padding, textAlign, textBaseline, table.scenegraph);
40740
- const hierarchyOffset = getHierarchyOffset(singleCellGroup.col, singleCellGroup.row, table);
40741
- if (hierarchyOffset) {
40742
- const text = singleCellGroup.getChildByName('text');
40743
- const icon = singleCellGroup.getChildByName('expand') || singleCellGroup.getChildByName('collapse');
40744
- if (icon?.role !== 'icon-left' && text) {
40745
- text.setAttribute('dx', hierarchyOffset);
40773
+ let changed = false;
40774
+ if (renderDefault) {
40775
+ const style = table._getCellStyle(col, row);
40776
+ const padding = getQuadProps(style.padding);
40777
+ const textAlign = style.textAlign;
40778
+ const textBaseline = style.textBaseline;
40779
+ changed = updateCellContentWidth(singleCellGroup, distWidth, cellHeight, detaX, autoRowHeight, padding, textAlign, textBaseline, table.scenegraph);
40780
+ const hierarchyOffset = getHierarchyOffset(singleCellGroup.col, singleCellGroup.row, table);
40781
+ if (hierarchyOffset) {
40782
+ const text = singleCellGroup.getChildByName('text');
40783
+ const icon = singleCellGroup.getChildByName('expand') || singleCellGroup.getChildByName('collapse');
40784
+ if (icon?.role !== 'icon-left' && text) {
40785
+ text.setAttribute('dx', hierarchyOffset);
40786
+ }
40746
40787
  }
40747
40788
  }
40748
40789
  const rangeHeight = table.getRowHeight(row);
@@ -40766,6 +40807,10 @@
40766
40807
  }
40767
40808
  return isHeightChange;
40768
40809
  }
40810
+ const style = table._getCellStyle(cellGroup.col, cellGroup.row);
40811
+ const padding = getQuadProps(style.padding);
40812
+ const textAlign = style.textAlign;
40813
+ const textBaseline = style.textBaseline;
40769
40814
  return updateCellContentWidth(cellGroup, distWidth, table.getRowHeight(cellGroup.row), detaX, autoRowHeight, padding, textAlign, textBaseline, table.scenegraph);
40770
40815
  }
40771
40816
  function resetRowHeight(scene, row) {
@@ -43032,6 +43077,7 @@
43032
43077
  }
43033
43078
 
43034
43079
  let customAlphabetCharSet = '';
43080
+ let textMeasureMode = 'quick';
43035
43081
  const textMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {
43036
43082
  if (isBound(TextMeasureContribution)) {
43037
43083
  rebind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
@@ -43079,13 +43125,13 @@
43079
43125
  measureTextWidth(text, options) {
43080
43126
  const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
43081
43127
  const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
43082
- const textMeasure = fastTextMeasure.measure(text);
43128
+ const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
43083
43129
  return textMeasure.width;
43084
43130
  }
43085
43131
  measureText(text, options) {
43086
43132
  const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
43087
43133
  const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
43088
- const textMeasure = fastTextMeasure.measure(text);
43134
+ const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
43089
43135
  return textMeasure;
43090
43136
  }
43091
43137
  }
@@ -43093,13 +43139,13 @@
43093
43139
  measureText(text, options) {
43094
43140
  const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
43095
43141
  const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
43096
- const textMeasure = fastTextMeasure.measure(text);
43142
+ const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
43097
43143
  return textMeasure;
43098
43144
  }
43099
43145
  measureTextWidth(text, options) {
43100
43146
  const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
43101
43147
  const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
43102
- const textMeasure = fastTextMeasure.measure(text);
43148
+ const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
43103
43149
  return textMeasure.width;
43104
43150
  }
43105
43151
  clipText(text, options, width) {
@@ -43173,6 +43219,7 @@
43173
43219
  fastTextMeasureCache.clear();
43174
43220
  }
43175
43221
  function restoreMeasureText() {
43222
+ textMeasureMode = 'canvas';
43176
43223
  container.load(restoreTextMeasureModule);
43177
43224
  }
43178
43225
 
@@ -43557,8 +43604,9 @@
43557
43604
  if (customLayoutObj.rootContainer instanceof Group$2) {
43558
43605
  customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);
43559
43606
  dealPercentCalc(customLayoutObj.rootContainer, 0, table.getRowHeight(row));
43607
+ const setedWidth = customLayoutObj.rootContainer.attribute.width;
43560
43608
  customLayoutObj.rootContainer.setStage(table.scenegraph.stage);
43561
- width = customLayoutObj.rootContainer.AABBBounds.width() ?? 0;
43609
+ width = setedWidth > 0 ? setedWidth : customLayoutObj.rootContainer.AABBBounds.width() ?? 0;
43562
43610
  renderDefault = customLayoutObj.renderDefault;
43563
43611
  enableCellPadding = customLayoutObj.enableCellPadding;
43564
43612
  }
@@ -43897,7 +43945,8 @@
43897
43945
  proxy.setParamsForColumn();
43898
43946
  let distCol;
43899
43947
  let distRow;
43900
- if (table.widthMode === 'adaptive') {
43948
+ if (table.widthMode === 'adaptive' ||
43949
+ (table.options.autoWrapText && (table.heightMode === 'adaptive' || table.heightMode === 'autoHeight'))) {
43901
43950
  distCol = table.colCount - 1;
43902
43951
  }
43903
43952
  else {
@@ -52112,6 +52161,7 @@
52112
52161
  const resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgsSet.eventArgs?.targetCell);
52113
52162
  if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
52114
52163
  this.table.scenegraph.updateAutoColWidth(resizeCol.col);
52164
+ this.table.internalProps._widthResizedColMap.add(resizeCol.col);
52115
52165
  this.table.scenegraph.updateChartSize(resizeCol.col);
52116
52166
  const state = this.table.stateManager;
52117
52167
  if (state.columnResize.col < state.table.frozenColCount &&
@@ -55495,7 +55545,7 @@
55495
55545
  return TABLE_EVENT_TYPE;
55496
55546
  }
55497
55547
  options;
55498
- version = "0.22.1";
55548
+ version = "0.22.2-alpha.0";
55499
55549
  pagination;
55500
55550
  id = `VTable${Date.now()}`;
55501
55551
  headerStyleCache;
@@ -57754,13 +57804,23 @@
57754
57804
  return customLayout;
57755
57805
  }
57756
57806
  hasAutoImageColumn() {
57757
- return this.internalProps.layoutMap.columnObjects.find((column) => {
57758
- if ((column.cellType === 'image' || typeof column.cellType === 'function') &&
57807
+ const bodyColumn = this.internalProps.layoutMap.columnObjects.find((column) => {
57808
+ if ((column.cellType === 'image' || column.cellType === 'video' || typeof column.cellType === 'function') &&
57759
57809
  column.define.imageAutoSizing) {
57760
57810
  return true;
57761
57811
  }
57762
57812
  return false;
57763
57813
  });
57814
+ const headerObj = this.internalProps.layoutMap.headerObjects.find((column) => {
57815
+ if (column) {
57816
+ if ((column.headerType === 'image' || column.headerType === 'video' || typeof column.headerType === 'function') &&
57817
+ column.define.imageAutoSizing) {
57818
+ return true;
57819
+ }
57820
+ }
57821
+ return false;
57822
+ });
57823
+ return bodyColumn || headerObj;
57764
57824
  }
57765
57825
  _getActiveChartInstance() {
57766
57826
  const cellGroup = this.scenegraph.getCell(this.stateManager.hover?.cellPos?.col, this.stateManager.hover?.cellPos?.row);
@@ -67576,7 +67636,7 @@
67576
67636
  }
67577
67637
 
67578
67638
  registerForVrender();
67579
- const version = "0.22.1";
67639
+ const version = "0.22.2-alpha.0";
67580
67640
  function getIcons() {
67581
67641
  return get$2();
67582
67642
  }