@visactor/vtable 0.17.3-alpha.0 → 0.17.3-alpha.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 (63) hide show
  1. package/cjs/core/BaseTable.js +1 -1
  2. package/cjs/core/BaseTable.js.map +1 -1
  3. package/cjs/index.d.ts +1 -1
  4. package/cjs/index.js +1 -1
  5. package/cjs/index.js.map +1 -1
  6. package/cjs/scenegraph/component/cell-content.d.ts +1 -0
  7. package/cjs/scenegraph/component/cell-content.js +4 -3
  8. package/cjs/scenegraph/component/cell-content.js.map +1 -1
  9. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +5 -5
  10. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  11. package/cjs/scenegraph/graphic/group.d.ts +2 -0
  12. package/cjs/scenegraph/graphic/group.js.map +1 -1
  13. package/cjs/scenegraph/group-creater/column-helper.d.ts +4 -1
  14. package/cjs/scenegraph/group-creater/column-helper.js +7 -3
  15. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  16. package/cjs/scenegraph/layout/compute-col-width.js +6 -2
  17. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  18. package/cjs/scenegraph/layout/compute-row-height.js +14 -9
  19. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  20. package/cjs/scenegraph/layout/update-height.d.ts +1 -1
  21. package/cjs/scenegraph/layout/update-height.js +7 -5
  22. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  23. package/cjs/scenegraph/layout/update-width.d.ts +1 -1
  24. package/cjs/scenegraph/layout/update-width.js +8 -6
  25. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  26. package/cjs/scenegraph/scenegraph.d.ts +2 -2
  27. package/cjs/scenegraph/scenegraph.js +5 -4
  28. package/cjs/scenegraph/scenegraph.js.map +1 -1
  29. package/cjs/state/state.js +4 -6
  30. package/cjs/state/state.js.map +1 -1
  31. package/dist/vtable.js +70 -28
  32. package/dist/vtable.min.js +2 -2
  33. package/es/core/BaseTable.js +1 -1
  34. package/es/core/BaseTable.js.map +1 -1
  35. package/es/index.d.ts +1 -1
  36. package/es/index.js +1 -1
  37. package/es/index.js.map +1 -1
  38. package/es/scenegraph/component/cell-content.d.ts +1 -0
  39. package/es/scenegraph/component/cell-content.js +4 -3
  40. package/es/scenegraph/component/cell-content.js.map +1 -1
  41. package/es/scenegraph/graphic/contributions/chart-render-helper.js +5 -5
  42. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  43. package/es/scenegraph/graphic/group.d.ts +2 -0
  44. package/es/scenegraph/graphic/group.js.map +1 -1
  45. package/es/scenegraph/group-creater/column-helper.d.ts +4 -1
  46. package/es/scenegraph/group-creater/column-helper.js +7 -3
  47. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  48. package/es/scenegraph/layout/compute-col-width.js +6 -2
  49. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  50. package/es/scenegraph/layout/compute-row-height.js +14 -9
  51. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  52. package/es/scenegraph/layout/update-height.d.ts +1 -1
  53. package/es/scenegraph/layout/update-height.js +7 -5
  54. package/es/scenegraph/layout/update-height.js.map +1 -1
  55. package/es/scenegraph/layout/update-width.d.ts +1 -1
  56. package/es/scenegraph/layout/update-width.js +8 -6
  57. package/es/scenegraph/layout/update-width.js.map +1 -1
  58. package/es/scenegraph/scenegraph.d.ts +2 -2
  59. package/es/scenegraph/scenegraph.js +5 -4
  60. package/es/scenegraph/scenegraph.js.map +1 -1
  61. package/es/state/state.js +4 -6
  62. package/es/state/state.js.map +1 -1
  63. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/layout/compute-col-width.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAA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CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;SACpF;QACD,IAAI,MAAM,EAAE;YACV,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SACvD;aAAM,IAAI,cAAc,EAAE;YACzB,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;SACzE;aAAM;YACL,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;SAC5E;KACF;AACH,CAAC","file":"compute-col-width.js","sourcesContent":["import type { SimpleHeaderLayoutMap } from '../../layout';\nimport type { ColumnTypeOption, TextColumnDefine } from '../../ts-types';\nimport { HierarchyState, IconPosition } from '../../ts-types';\nimport * as calc from '../../tools/calc';\nimport { validToString } from '../../tools/util';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentWidth } from '../../components/axis/get-axis-component-size';\nimport { Group as VGroup } from '@visactor/vrender';\nimport { isObject } from '@visactor/vutils';\nimport { decodeReactDom, dealPercentCalc } from '../component/custom';\n\nexport function computeColsWidth(table: BaseTableAPI, colStart?: number, colEnd?: number, update?: boolean): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n colStart = colStart ?? 0;\n colEnd = colEnd ?? table.colCount - 1;\n // table._clearColRangeWidthsMap();\n // clear colRangeWidthsMap\n if (colStart === 0 && colEnd === table.colCount - 1) {\n table._clearColRangeWidthsMap();\n // } else {\n // for (let col = colStart; col <= colEnd; col++) {\n // table._clearColRangeWidthsMap(col);\n // }\n }\n\n const oldColWidths: number[] = [];\n const newWidths: number[] = [];\n if (update) {\n for (let col = 0; col < table.colCount; col++) {\n oldColWidths[col] = table.getColWidth(col);\n }\n }\n for (let col = colStart; col <= colEnd; col++) {\n let maxWidth;\n if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-header' &&\n 'showHeader' in table.internalProps.layoutMap\n ) {\n const temp = table.internalProps.layoutMap.showHeader;\n table.internalProps.layoutMap.showHeader = true;\n maxWidth = computeColWidth(col, 0, table.internalProps.layoutMap.headerLevelCount - 1, table);\n table.internalProps.layoutMap.showHeader = temp;\n } else if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-body'\n ) {\n maxWidth = computeColWidth(\n col,\n table.internalProps.layoutMap.getBodyRange().start.row,\n table.internalProps.layoutMap.getBodyRange().end.row,\n table\n );\n } else {\n maxWidth = computeColWidth(col, 0, table.rowCount - 1, table);\n }\n\n table._setColContentWidth(col, maxWidth);\n\n const oldWidth = table.getColWidth(col);\n if (oldWidth !== maxWidth) {\n table._clearColRangeWidthsMap(col);\n }\n if (update) {\n newWidths[col] = table._adjustColWidth(col, maxWidth);\n } else {\n table._setColWidth(col, table._adjustColWidth(col, maxWidth), false, true);\n }\n }\n\n // 处理adaptive宽度\n if (table.widthMode === 'adaptive') {\n const rowHeaderWidth = table.getColsWidth(0, table.rowHeaderLevelCount - 1);\n const rightHeaderWidth = table.isPivotChart() ? table.getRightFrozenColsWidth() : 0;\n const totalDrawWidth = table.tableNoFrameWidth - rowHeaderWidth - rightHeaderWidth;\n\n table._clearColRangeWidthsMap();\n const canvasWidth = table.tableNoFrameWidth;\n let actualHeaderWidth = 0;\n for (let col = 0; col < table.colCount; col++) {\n const colWidth = update ? newWidths[col] : table.getColWidth(col);\n if (col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) {\n actualHeaderWidth += colWidth;\n }\n }\n const startCol = table.frozenColCount;\n const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;\n getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);\n // const canvasWidth = table.internalProps.canvas.width;\n // const rowHeaderWidth = table.getColsWidth(0, table.rowHeaderLevelCount - 1);\n // const rightHeaderWidth = table.isPivotChart() ? table.getRightFrozenColsWidth() : 0;\n // const totalDrawWidth = table.tableNoFrameWidth - rowHeaderWidth - rightHeaderWidth;\n // const startCol = table.rowHeaderLevelCount;\n // const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;\n // let actualWidth = 0;\n // for (let col = startCol; col < endCol; col++) {\n // actualWidth += update ? newWidths[col] : table.getColWidth(col);\n // }\n // const factor = totalDrawWidth / actualWidth;\n // for (let col = startCol; col < endCol; col++) {\n // let colWidth;\n // if (col === endCol - 1) {\n // colWidth =\n // totalDrawWidth -\n // (update\n // ? newWidths.reduce((acr, cur, index) => {\n // if (index >= startCol && index <= endCol - 2) {\n // return acr + cur;\n // }\n // return acr;\n // }, 0)\n // : table.getColsWidth(startCol, endCol - 2));\n // } else {\n // colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);\n // }\n // if (update) {\n // newWidths[col] = table._adjustColWidth(col, colWidth);\n // } else {\n // table._setColWidth(col, table._adjustColWidth(col, colWidth), false, true);\n // }\n // }\n } else if (table.autoFillWidth) {\n // 处理风神列宽特殊逻辑\n table._clearColRangeWidthsMap();\n const canvasWidth = table.tableNoFrameWidth;\n let actualHeaderWidth = 0;\n let actualWidth = 0;\n for (let col = 0; col < table.colCount; col++) {\n const colWidth = update ? newWidths[col] : table.getColWidth(col);\n if (col < table.frozenColCount || (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)) {\n actualHeaderWidth += colWidth;\n }\n actualWidth += colWidth;\n }\n // 如果内容宽度小于canvas宽度,执行adaptive放大\n if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {\n const startCol = table.frozenColCount;\n const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;\n getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);\n }\n\n // // 如果内容宽度小于canvas宽度,执行adaptive放大\n // if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {\n // const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);\n // for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {\n // let colWidth;\n // if (col === table.colCount - table.rightFrozenColCount - 1) {\n // colWidth =\n // canvasWidth -\n // actualHeaderWidth -\n // (update\n // ? newWidths.reduce((acr, cur, index) => {\n // if (index >= table.frozenColCount && index <= table.colCount - table.rightFrozenColCount - 2) {\n // return acr + cur;\n // }\n // return acr;\n // }, 0)\n // : table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2));\n // } else {\n // colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);\n // }\n // if (update) {\n // // newWidths[col] = newWidths[col] * factor;\n // newWidths[col] = table._adjustColWidth(col, colWidth);\n // } else {\n // // table.setColWidth(col, table.getColWidth(col) * factor, false, true);\n // table._setColWidth(col, table._adjustColWidth(col, colWidth), false, true);\n // }\n // }\n // }\n }\n // console.log('computeColsWidth time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time);\n\n if (update) {\n for (let col = 0; col < table.colCount; col++) {\n // newColWidth could not be in column min max range possibly\n // const newColWidth = table._adjustColWidth(col, newWidths[col]) ?? table.getColWidth(col);\n const newColWidth = newWidths[col] ?? table.getColWidth(col);\n if (newColWidth !== oldColWidths[col]) {\n // update the column width in scenegraph\n table.scenegraph.updateColWidth(col, newColWidth - oldColWidths[col], true);\n }\n }\n table.scenegraph.updateContainer();\n }\n // console.log('computeColsWidth time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, colStart, colEnd);\n}\n\n/**\n * @description: 计算列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {BaseTableAPI} table\n * @param {boolean} forceCompute\n * @return {*}\n */\nexport function computeColWidth(\n col: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n forceCompute: boolean = false //forceCompute如果设置为true 即便不是自动列宽的列也会按内容计算列宽\n): number {\n // const { layoutMap, transpose } = table.internalProps;\n // let { width } = layoutMap?.getColumnWidthDefined(col) ?? {};\n\n // if (transpose) {\n // // 转置模式\n // if (table.widthMode === 'standard') {\n // // return table.getColWidth(col);\n // // standard模式使用默认值\n // if (table.isRowHeader(col, 0) || table.isCornerHeader(col, 0)) {\n // const defaultWidth = Array.isArray(table.defaultHeaderColWidth)\n // ? table.defaultHeaderColWidth[col] ?? table.defaultColWidth\n // : table.defaultHeaderColWidth;\n // if (defaultWidth === 'auto') {\n // widthfffff = 'auto';\n // } else {\n // return defaultWidth;\n // }\n // }\n\n // if (widthfffff !== 'auto') {\n // // if (width && (typeof width === 'string' || width > 0)) return width;\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // return table.defaultColWidth;\n // }\n // } else if (\n // table.widthMode === 'adaptive' &&\n // col === 0 &&\n // widthfffff !== 'auto' &&\n // (layoutMap as SimpleHeaderLayoutMap)?.showHeader\n // ) {\n // // ToBeFixed hack逻辑,转置第一列列宽为header[0]\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // }\n // // autoWidth adaptive 需要计算内容宽度\n // // do nothing\n // } else if (widthfffff !== 'auto' && table.widthMode !== 'autoWidth' && !forceCompute) {\n // // if (width && (typeof width === 'string' || width > 0)) return width;\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // //是透视表的行表头部分 则宽度按defaultHeaderColWidth设置\n // const defaultWidth = table.getColWidthDefine(col);\n // if (defaultWidth !== 'auto') {\n // return table.getColWidth(col);\n // }\n // }\n const width = getColWidthDefinedWidthResizedWidth(col, table);\n if (forceCompute && !table.internalProps.transpose) {\n return computeAutoColWidth(width, col, startRow, endRow, forceCompute, table);\n } else if (typeof width === 'number') {\n return width;\n } else if (width !== 'auto' && typeof width === 'string') {\n // return calc.toPx(width, table.internalProps.calcWidthContext);\n return table._adjustColWidth(col, table._colWidthDefineToPxWidth(width));\n }\n return computeAutoColWidth(width, col, startRow, endRow, forceCompute, table);\n}\n\n/**\n * @description: 计算width: auto情况下的列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeAutoColWidth(\n widthDeifne: string | number,\n col: number,\n startRow: number,\n endRow: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number {\n // 处理 auto width\n let maxWidth = 0;\n let deltaRow = 1;\n let prepareDeltaRow = 1; // 当计算完表头单元格的宽度后再采用采用逻辑,prepareDeltaRow这个值为期body部分做准备\n if (endRow - startRow > 5000) {\n // 超过5000行启动列宽自动计算采样\n prepareDeltaRow = Math.ceil((endRow - startRow) / 5000);\n }\n // 如果是透视图\n if (table.isPivotChart() && col >= table.rowHeaderLevelCount && col < table.colCount - table.rightFrozenColCount) {\n if (!(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) {\n //并且指标是以行展示 计算列宽需要根据x轴的值域范围\n const optimunWidth = (table.internalProps.layoutMap as PivotHeaderLayoutMap).getOptimunWidthForChart(col);\n if (optimunWidth > 0) {\n return optimunWidth;\n }\n } else {\n //直接拿表头的默认列宽\n return table.defaultColWidth;\n }\n }\n\n for (let row = startRow; row <= endRow; row += deltaRow) {\n // 判断透视图轴组件\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentWidth(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxWidth = Math.max(axisWidth, maxWidth);\n continue;\n }\n } else if (\n layout.isLeftBottomCorner(col, row) ||\n layout.isRightTopCorner(col, row) ||\n layout.isRightBottomCorner(col, row)\n ) {\n // 透视图三角为无效单元格,不参与宽度计算\n continue;\n }\n }\n\n // 判断CustomRender\n const customWidth = computeCustomRenderWidth(col, row, table);\n if (customWidth) {\n maxWidth = Math.max(customWidth.width, maxWidth);\n if (!customWidth.renderDefault) {\n continue;\n }\n }\n\n // 判断透视表如果在指标\n // const indicatorWidth = computeIndicatorWidth(col, row, forceCompute, table);\n // const indicatorWidth = table.internalProps.layoutMap.getColumnWidthDefined(col);\n const indicatorWidth = widthDeifne;\n if (typeof indicatorWidth === 'number' && table.widthMode === 'standard' && !forceCompute) {\n maxWidth = Math.max(indicatorWidth, maxWidth);\n continue;\n }\n\n const cellType = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row)?.headerType\n : table.getBodyColumnType(col, row);\n if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {\n // text&link&progressbar测量文字宽度\n // image&video&sparkline使用默认宽度\n maxWidth = Math.max(maxWidth, table.getColWidthDefinedNumber(col) || 0);\n continue;\n }\n\n // 处理树形展开\n let cellHierarchyIndent = 0;\n const layoutMap = table.internalProps.layoutMap;\n //判断是否为表头\n if (layoutMap.isHeader(col, row)) {\n const hd = layoutMap.getHeader(col, row);\n // 如果某级表头设置了only-body,在计算表头内容宽度时跳过改级表头\n if (hd?.define?.columnWidthComputeMode === 'only-body') {\n continue;\n }\n if (hd?.hierarchyLevel) {\n cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * ((layoutMap as PivotHeaderLayoutMap).rowHierarchyIndent ?? 0);\n }\n } else {\n deltaRow = prepareDeltaRow;\n // 基本表格表身body单元格 如果是树形展开 需要考虑缩进值\n // const cellHierarchyState = table.getHierarchyState(col, row);\n // if (cellHierarchyState === HierarchyState.expand || cellHierarchyState === HierarchyState.collapse) {\n const define = table.getBodyColumnDefine(col, row);\n if (define?.tree) {\n const indexArr = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row));\n cellHierarchyIndent =\n Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none\n ? (indexArr.length - 1) * ((layoutMap as SimpleHeaderLayoutMap).hierarchyIndent ?? 0)\n : 0;\n }\n }\n\n // 测量文字宽度\n const textWidth = computeTextWidth(col, row, cellType, table);\n maxWidth = Math.max(textWidth + cellHierarchyIndent, maxWidth);\n //在前面设置了采用规则的情况下,为了确保底部冻结的每一行都测到\n if (\n deltaRow > 1 &&\n table.bottomFrozenRowCount > 0 &&\n row < table.rowCount - table.bottomFrozenRowCount &&\n row + deltaRow >= table.rowCount - table.bottomFrozenRowCount\n ) {\n row = table.rowCount - table.bottomFrozenRowCount - deltaRow;\n deltaRow = 1;\n prepareDeltaRow = 1;\n }\n }\n\n // 处理宽度限制\n const colMinWidth = table.getMinColWidth(col);\n const colMaxWidth = table.getMaxColWidth(col);\n if (maxWidth < colMinWidth) {\n return colMinWidth;\n } else if (maxWidth > colMaxWidth) {\n return colMaxWidth;\n }\n return maxWidth;\n}\n\n/**\n * @description: 计算customRender相关列宽\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderWidth(col: number, row: number, table: BaseTableAPI) {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanCol = 1;\n let width = 0;\n let renderDefault = false;\n let enableCellPadding = false;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);\n dealPercentCalc(customLayoutObj.rootContainer, 0, table.getRowHeight(row));\n customLayoutObj.rootContainer.setStage(table.scenegraph.stage);\n width = (customLayoutObj.rootContainer as VGroup).AABBBounds.width() ?? 0;\n renderDefault = customLayoutObj.renderDefault;\n enableCellPadding = customLayoutObj.enableCellPadding;\n } else {\n width = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n width = customRenderObj?.expectedWidth ?? 0;\n renderDefault = customRenderObj?.renderDefault;\n } else {\n width = customRender?.expectedWidth ?? 0;\n renderDefault = customRender?.renderDefault;\n }\n if (enableCellPadding) {\n const actStyle = table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n width += padding[1] + padding[3];\n }\n return {\n width: width / spanCol,\n renderDefault\n };\n }\n return undefined;\n}\n\n/**\n * @description: 计算指标相关列宽\n * @param {number} col\n * @param {number} row\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeIndicatorWidth(\n col: number,\n row: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number | undefined {\n const { layoutMap } = table.internalProps;\n if (table.isPivotTable() && (layoutMap as PivotHeaderLayoutMap).isColumnIndicatorHeader(col, row)) {\n // 透视表如果在指标中配置了宽度,使用该宽度作为指标单元格及下面内容单元格的列宽\n const body = layoutMap.getBody(col, row);\n if (body && body.width && body.width !== 'auto' && !forceCompute) {\n const width = Math.round(calc.toPx(body.width, table.internalProps.calcWidthContext));\n return width;\n }\n }\n return undefined;\n}\n\n/**\n * @description: 计算文字宽度\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextWidth(col: number, row: number, cellType: ColumnTypeOption, table: BaseTableAPI): number {\n let maxWidth = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconWidth = 0;\n\n // const define = table.getBodyColumnDefine(col, row);\n // const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n\n let mayHaveIcon = false;\n if (table.getCellLocation(col, row) !== 'body') {\n mayHaveIcon = true;\n } else {\n const define = table.getBodyColumnDefine(col, row);\n mayHaveIcon = !!define?.icon || !!define?.tree;\n }\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (icon.positionType !== IconPosition.absoluteRight) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n }\n });\n }\n\n let spanCol = 1;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const paddingWidth = padding[1] + padding[3]; // + cellHierarchyIndent\n\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n let text;\n if (cellType === 'checkbox') {\n text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n } else {\n text = cellValue;\n }\n const lines = validToString(text).split('\\n') || [];\n if (lines.length >= 1) {\n // eslint-disable-next-line no-loop-func\n lines.forEach((line: string) => {\n const width = table.measureText(line.slice(0, table.options.maxCharactersNumber || 200), {\n fontSize,\n fontFamily,\n fontWeight\n }).width;\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (width + paddingWidth + 4 + iconWidth) / spanCol, // 这里+4为列宽测量结果的buffer\n maxWidth\n );\n });\n } else {\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (paddingWidth + 4 + iconWidth) / spanCol,\n maxWidth\n );\n }\n // 判断是否需要限制最大宽度 之前写死的450 需要使用配置来判断\n if (table.internalProps.limitMaxAutoWidth !== false) {\n maxWidth = Math.min(\n typeof table.internalProps.limitMaxAutoWidth === 'number' ? table.internalProps.limitMaxAutoWidth : 450,\n maxWidth\n );\n }\n\n if (cellType === 'checkbox') {\n const size = getProp('size', actStyle, col, row, table);\n maxWidth += size;\n\n if (text) {\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);\n maxWidth += spaceBetweenTextAndIcon;\n }\n }\n\n return maxWidth;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: 0,\n height: 0\n };\n}\n\nfunction getColWidthDefinedWidthResizedWidth(col: number, table: BaseTableAPI) {\n const widthDefined = table.getColWidthDefined(col);\n if (table.internalProps._widthResizedColMap.has(col)) {\n return table.getColWidth(col);\n }\n return widthDefined;\n}\n\nexport function getAdaptiveWidth(\n totalDrawWidth: number,\n startCol: number,\n endColPlus1: number,\n update: boolean,\n newWidths: number[],\n table: BaseTableAPI,\n fromScenegraph?: boolean\n) {\n let actualWidth = 0;\n const adaptiveColumns: number[] = [];\n for (let col = startCol; col < endColPlus1; col++) {\n const width = update ? newWidths[col] : table.getColWidth(col);\n const maxWidth = table.getMaxColWidth(col);\n const minWidth = table.getMinColWidth(col);\n if (width !== maxWidth && width !== minWidth) {\n actualWidth += width;\n adaptiveColumns.push(col);\n } else {\n // fixed width, do not adaptive\n totalDrawWidth -= width;\n }\n }\n\n const factor = totalDrawWidth / actualWidth;\n\n for (let i = 0; i < adaptiveColumns.length; i++) {\n const col = adaptiveColumns[i];\n let colWidth;\n if (i === adaptiveColumns.length - 1) {\n colWidth =\n totalDrawWidth -\n adaptiveColumns.reduce((acr, cur, index) => {\n if (cur !== col) {\n return acr + (update ? newWidths[cur] : table.getColWidth(cur));\n }\n return acr;\n }, 0);\n } else {\n colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);\n }\n if (update) {\n newWidths[col] = table._adjustColWidth(col, colWidth);\n } else if (fromScenegraph) {\n table.scenegraph.setColWidth(col, table._adjustColWidth(col, colWidth));\n } else {\n table._setColWidth(col, table._adjustColWidth(col, colWidth), false, true);\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/layout/compute-col-width.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,UAAU,gBAAgB,CAAC,KAAmB,EAAE,QAAiB,EAAE,MAAe,EAAE,MAAgB;;IACxG,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,CAAC,CAAC;IACzB,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC;IAGtC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AAC;SAC5E;KACF;AACH,CAAC","file":"compute-col-width.js","sourcesContent":["import type { SimpleHeaderLayoutMap } from '../../layout';\nimport type { ColumnTypeOption, TextColumnDefine } from '../../ts-types';\nimport { HierarchyState, IconPosition } from '../../ts-types';\nimport * as calc from '../../tools/calc';\nimport { validToString } from '../../tools/util';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentWidth } from '../../components/axis/get-axis-component-size';\nimport { Group as VGroup } from '@visactor/vrender';\nimport { isObject } from '@visactor/vutils';\nimport { decodeReactDom, dealPercentCalc } from '../component/custom';\n\nexport function computeColsWidth(table: BaseTableAPI, colStart?: number, colEnd?: number, update?: boolean): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n colStart = colStart ?? 0;\n colEnd = colEnd ?? table.colCount - 1;\n // table._clearColRangeWidthsMap();\n // clear colRangeWidthsMap\n if (colStart === 0 && colEnd === table.colCount - 1) {\n table._clearColRangeWidthsMap();\n // } else {\n // for (let col = colStart; col <= colEnd; col++) {\n // table._clearColRangeWidthsMap(col);\n // }\n }\n\n const oldColWidths: number[] = [];\n const newWidths: number[] = [];\n if (update) {\n for (let col = 0; col < table.colCount; col++) {\n oldColWidths[col] = table.getColWidth(col);\n }\n }\n for (let col = colStart; col <= colEnd; col++) {\n let maxWidth;\n if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-header' &&\n 'showHeader' in table.internalProps.layoutMap\n ) {\n const temp = table.internalProps.layoutMap.showHeader;\n table.internalProps.layoutMap.showHeader = true;\n maxWidth = computeColWidth(col, 0, table.internalProps.layoutMap.headerLevelCount - 1, table);\n table.internalProps.layoutMap.showHeader = temp;\n } else if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-body'\n ) {\n maxWidth = computeColWidth(\n col,\n table.internalProps.layoutMap.getBodyRange().start.row,\n table.internalProps.layoutMap.getBodyRange().end.row,\n table\n );\n } else {\n maxWidth = computeColWidth(col, 0, table.rowCount - 1, table);\n }\n\n table._setColContentWidth(col, maxWidth);\n\n const oldWidth = table.getColWidth(col);\n if (oldWidth !== maxWidth) {\n table._clearColRangeWidthsMap(col);\n }\n if (update) {\n newWidths[col] = Math.round(table._adjustColWidth(col, maxWidth));\n } else {\n table._setColWidth(col, table._adjustColWidth(col, maxWidth), false, true);\n }\n }\n\n // 处理adaptive宽度\n if (table.widthMode === 'adaptive') {\n const rowHeaderWidth = table.getColsWidth(0, table.rowHeaderLevelCount - 1);\n const rightHeaderWidth = table.isPivotChart() ? table.getRightFrozenColsWidth() : 0;\n const totalDrawWidth = table.tableNoFrameWidth - rowHeaderWidth - rightHeaderWidth;\n\n table._clearColRangeWidthsMap();\n const canvasWidth = table.tableNoFrameWidth;\n let actualHeaderWidth = 0;\n for (let col = 0; col < table.colCount; col++) {\n const colWidth = update ? newWidths[col] : table.getColWidth(col);\n if (col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) {\n actualHeaderWidth += colWidth;\n }\n }\n const startCol = table.frozenColCount;\n const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;\n getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);\n // const canvasWidth = table.internalProps.canvas.width;\n // const rowHeaderWidth = table.getColsWidth(0, table.rowHeaderLevelCount - 1);\n // const rightHeaderWidth = table.isPivotChart() ? table.getRightFrozenColsWidth() : 0;\n // const totalDrawWidth = table.tableNoFrameWidth - rowHeaderWidth - rightHeaderWidth;\n // const startCol = table.rowHeaderLevelCount;\n // const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;\n // let actualWidth = 0;\n // for (let col = startCol; col < endCol; col++) {\n // actualWidth += update ? newWidths[col] : table.getColWidth(col);\n // }\n // const factor = totalDrawWidth / actualWidth;\n // for (let col = startCol; col < endCol; col++) {\n // let colWidth;\n // if (col === endCol - 1) {\n // colWidth =\n // totalDrawWidth -\n // (update\n // ? newWidths.reduce((acr, cur, index) => {\n // if (index >= startCol && index <= endCol - 2) {\n // return acr + cur;\n // }\n // return acr;\n // }, 0)\n // : table.getColsWidth(startCol, endCol - 2));\n // } else {\n // colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);\n // }\n // if (update) {\n // newWidths[col] = table._adjustColWidth(col, colWidth);\n // } else {\n // table._setColWidth(col, table._adjustColWidth(col, colWidth), false, true);\n // }\n // }\n } else if (table.autoFillWidth) {\n // 处理风神列宽特殊逻辑\n table._clearColRangeWidthsMap();\n const canvasWidth = table.tableNoFrameWidth;\n let actualHeaderWidth = 0;\n let actualWidth = 0;\n for (let col = 0; col < table.colCount; col++) {\n const colWidth = update ? newWidths[col] : table.getColWidth(col);\n if (col < table.frozenColCount || (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)) {\n actualHeaderWidth += colWidth;\n }\n actualWidth += colWidth;\n }\n // 如果内容宽度小于canvas宽度,执行adaptive放大\n if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {\n const startCol = table.frozenColCount;\n const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;\n getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);\n }\n\n // // 如果内容宽度小于canvas宽度,执行adaptive放大\n // if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {\n // const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);\n // for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {\n // let colWidth;\n // if (col === table.colCount - table.rightFrozenColCount - 1) {\n // colWidth =\n // canvasWidth -\n // actualHeaderWidth -\n // (update\n // ? newWidths.reduce((acr, cur, index) => {\n // if (index >= table.frozenColCount && index <= table.colCount - table.rightFrozenColCount - 2) {\n // return acr + cur;\n // }\n // return acr;\n // }, 0)\n // : table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2));\n // } else {\n // colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);\n // }\n // if (update) {\n // // newWidths[col] = newWidths[col] * factor;\n // newWidths[col] = table._adjustColWidth(col, colWidth);\n // } else {\n // // table.setColWidth(col, table.getColWidth(col) * factor, false, true);\n // table._setColWidth(col, table._adjustColWidth(col, colWidth), false, true);\n // }\n // }\n // }\n }\n // console.log('computeColsWidth time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time);\n\n if (update) {\n for (let col = 0; col < table.colCount; col++) {\n // newColWidth could not be in column min max range possibly\n // const newColWidth = table._adjustColWidth(col, newWidths[col]) ?? table.getColWidth(col);\n const newColWidth = newWidths[col] ?? table.getColWidth(col);\n if (newColWidth !== oldColWidths[col]) {\n // update the column width in scenegraph\n table._setColWidth(col, newColWidth);\n // table.scenegraph.updateColWidth(col, newColWidth - oldColWidths[col], true, true);\n }\n }\n for (let col = 0; col < table.colCount; col++) {\n // newColWidth could not be in column min max range possibly\n // const newColWidth = table._adjustColWidth(col, newWidths[col]) ?? table.getColWidth(col);\n const newColWidth = table.getColWidth(col);\n if (newColWidth !== oldColWidths[col]) {\n // update the column width in scenegraph\n // table._setColWidth(col, newColWidth);\n table.scenegraph.updateColWidth(col, newColWidth - oldColWidths[col], true, true);\n }\n }\n table.scenegraph.updateContainer();\n }\n // console.log('computeColsWidth time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, colStart, colEnd);\n}\n\n/**\n * @description: 计算列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {BaseTableAPI} table\n * @param {boolean} forceCompute\n * @return {*}\n */\nexport function computeColWidth(\n col: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n forceCompute: boolean = false //forceCompute如果设置为true 即便不是自动列宽的列也会按内容计算列宽\n): number {\n // const { layoutMap, transpose } = table.internalProps;\n // let { width } = layoutMap?.getColumnWidthDefined(col) ?? {};\n\n // if (transpose) {\n // // 转置模式\n // if (table.widthMode === 'standard') {\n // // return table.getColWidth(col);\n // // standard模式使用默认值\n // if (table.isRowHeader(col, 0) || table.isCornerHeader(col, 0)) {\n // const defaultWidth = Array.isArray(table.defaultHeaderColWidth)\n // ? table.defaultHeaderColWidth[col] ?? table.defaultColWidth\n // : table.defaultHeaderColWidth;\n // if (defaultWidth === 'auto') {\n // widthfffff = 'auto';\n // } else {\n // return defaultWidth;\n // }\n // }\n\n // if (widthfffff !== 'auto') {\n // // if (width && (typeof width === 'string' || width > 0)) return width;\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // return table.defaultColWidth;\n // }\n // } else if (\n // table.widthMode === 'adaptive' &&\n // col === 0 &&\n // widthfffff !== 'auto' &&\n // (layoutMap as SimpleHeaderLayoutMap)?.showHeader\n // ) {\n // // ToBeFixed hack逻辑,转置第一列列宽为header[0]\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // }\n // // autoWidth adaptive 需要计算内容宽度\n // // do nothing\n // } else if (widthfffff !== 'auto' && table.widthMode !== 'autoWidth' && !forceCompute) {\n // // if (width && (typeof width === 'string' || width > 0)) return width;\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // //是透视表的行表头部分 则宽度按defaultHeaderColWidth设置\n // const defaultWidth = table.getColWidthDefine(col);\n // if (defaultWidth !== 'auto') {\n // return table.getColWidth(col);\n // }\n // }\n const width = getColWidthDefinedWidthResizedWidth(col, table);\n if (forceCompute && !table.internalProps.transpose) {\n return computeAutoColWidth(width, col, startRow, endRow, forceCompute, table);\n } else if (typeof width === 'number') {\n return width;\n } else if (width !== 'auto' && typeof width === 'string') {\n // return calc.toPx(width, table.internalProps.calcWidthContext);\n return table._adjustColWidth(col, table._colWidthDefineToPxWidth(width));\n }\n return computeAutoColWidth(width, col, startRow, endRow, forceCompute, table);\n}\n\n/**\n * @description: 计算width: auto情况下的列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeAutoColWidth(\n widthDeifne: string | number,\n col: number,\n startRow: number,\n endRow: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number {\n // 处理 auto width\n let maxWidth = 0;\n let deltaRow = 1;\n let prepareDeltaRow = 1; // 当计算完表头单元格的宽度后再采用采用逻辑,prepareDeltaRow这个值为期body部分做准备\n if (endRow - startRow > 5000) {\n // 超过5000行启动列宽自动计算采样\n prepareDeltaRow = Math.ceil((endRow - startRow) / 5000);\n }\n // 如果是透视图\n if (table.isPivotChart() && col >= table.rowHeaderLevelCount && col < table.colCount - table.rightFrozenColCount) {\n if (!(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) {\n //并且指标是以行展示 计算列宽需要根据x轴的值域范围\n const optimunWidth = (table.internalProps.layoutMap as PivotHeaderLayoutMap).getOptimunWidthForChart(col);\n if (optimunWidth > 0) {\n return optimunWidth;\n }\n } else {\n //直接拿表头的默认列宽\n return table.defaultColWidth;\n }\n }\n\n for (let row = startRow; row <= endRow; row += deltaRow) {\n // 判断透视图轴组件\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentWidth(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxWidth = Math.max(axisWidth, maxWidth);\n continue;\n }\n } else if (\n layout.isLeftBottomCorner(col, row) ||\n layout.isRightTopCorner(col, row) ||\n layout.isRightBottomCorner(col, row)\n ) {\n // 透视图三角为无效单元格,不参与宽度计算\n continue;\n }\n }\n\n // 判断CustomRender\n const customWidth = computeCustomRenderWidth(col, row, table);\n if (customWidth) {\n maxWidth = Math.max(customWidth.width, maxWidth);\n if (!customWidth.renderDefault) {\n continue;\n }\n }\n\n // 判断透视表如果在指标\n // const indicatorWidth = computeIndicatorWidth(col, row, forceCompute, table);\n // const indicatorWidth = table.internalProps.layoutMap.getColumnWidthDefined(col);\n const indicatorWidth = widthDeifne;\n if (typeof indicatorWidth === 'number' && table.widthMode === 'standard' && !forceCompute) {\n maxWidth = Math.max(indicatorWidth, maxWidth);\n continue;\n }\n\n const cellType = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row)?.headerType\n : table.getBodyColumnType(col, row);\n if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {\n // text&link&progressbar测量文字宽度\n // image&video&sparkline使用默认宽度\n maxWidth = Math.max(maxWidth, table.getColWidthDefinedNumber(col) || 0);\n continue;\n }\n\n // 处理树形展开\n let cellHierarchyIndent = 0;\n const layoutMap = table.internalProps.layoutMap;\n //判断是否为表头\n if (layoutMap.isHeader(col, row)) {\n const hd = layoutMap.getHeader(col, row);\n // 如果某级表头设置了only-body,在计算表头内容宽度时跳过改级表头\n if (hd?.define?.columnWidthComputeMode === 'only-body') {\n continue;\n }\n if (hd?.hierarchyLevel) {\n cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * ((layoutMap as PivotHeaderLayoutMap).rowHierarchyIndent ?? 0);\n }\n } else {\n deltaRow = prepareDeltaRow;\n // 基本表格表身body单元格 如果是树形展开 需要考虑缩进值\n // const cellHierarchyState = table.getHierarchyState(col, row);\n // if (cellHierarchyState === HierarchyState.expand || cellHierarchyState === HierarchyState.collapse) {\n const define = table.getBodyColumnDefine(col, row);\n if (define?.tree) {\n const indexArr = table.dataSource.getIndexKey(table.getRecordShowIndexByCell(col, row));\n cellHierarchyIndent =\n Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none\n ? (indexArr.length - 1) * ((layoutMap as SimpleHeaderLayoutMap).hierarchyIndent ?? 0)\n : 0;\n }\n }\n\n // 测量文字宽度\n const textWidth = computeTextWidth(col, row, cellType, table);\n maxWidth = Math.max(textWidth + cellHierarchyIndent, maxWidth);\n //在前面设置了采用规则的情况下,为了确保底部冻结的每一行都测到\n if (\n deltaRow > 1 &&\n table.bottomFrozenRowCount > 0 &&\n row < table.rowCount - table.bottomFrozenRowCount &&\n row + deltaRow >= table.rowCount - table.bottomFrozenRowCount\n ) {\n row = table.rowCount - table.bottomFrozenRowCount - deltaRow;\n deltaRow = 1;\n prepareDeltaRow = 1;\n }\n }\n\n // 处理宽度限制\n const colMinWidth = table.getMinColWidth(col);\n const colMaxWidth = table.getMaxColWidth(col);\n if (maxWidth < colMinWidth) {\n return colMinWidth;\n } else if (maxWidth > colMaxWidth) {\n return colMaxWidth;\n }\n return maxWidth;\n}\n\n/**\n * @description: 计算customRender相关列宽\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderWidth(col: number, row: number, table: BaseTableAPI) {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanCol = 1;\n let width = 0;\n let renderDefault = false;\n let enableCellPadding = false;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);\n dealPercentCalc(customLayoutObj.rootContainer, 0, table.getRowHeight(row));\n customLayoutObj.rootContainer.setStage(table.scenegraph.stage);\n width = (customLayoutObj.rootContainer as VGroup).AABBBounds.width() ?? 0;\n renderDefault = customLayoutObj.renderDefault;\n enableCellPadding = customLayoutObj.enableCellPadding;\n } else {\n width = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n width = customRenderObj?.expectedWidth ?? 0;\n renderDefault = customRenderObj?.renderDefault;\n } else {\n width = customRender?.expectedWidth ?? 0;\n renderDefault = customRender?.renderDefault;\n }\n if (enableCellPadding) {\n const actStyle = table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n width += padding[1] + padding[3];\n }\n return {\n width: width / spanCol,\n renderDefault\n };\n }\n return undefined;\n}\n\n/**\n * @description: 计算指标相关列宽\n * @param {number} col\n * @param {number} row\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeIndicatorWidth(\n col: number,\n row: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number | undefined {\n const { layoutMap } = table.internalProps;\n if (table.isPivotTable() && (layoutMap as PivotHeaderLayoutMap).isColumnIndicatorHeader(col, row)) {\n // 透视表如果在指标中配置了宽度,使用该宽度作为指标单元格及下面内容单元格的列宽\n const body = layoutMap.getBody(col, row);\n if (body && body.width && body.width !== 'auto' && !forceCompute) {\n const width = Math.round(calc.toPx(body.width, table.internalProps.calcWidthContext));\n return width;\n }\n }\n return undefined;\n}\n\n/**\n * @description: 计算文字宽度\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextWidth(col: number, row: number, cellType: ColumnTypeOption, table: BaseTableAPI): number {\n let maxWidth = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconWidth = 0;\n\n // const define = table.getBodyColumnDefine(col, row);\n // const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n\n let mayHaveIcon = false;\n if (table.getCellLocation(col, row) !== 'body') {\n mayHaveIcon = true;\n } else {\n const define = table.getBodyColumnDefine(col, row);\n mayHaveIcon = !!define?.icon || !!define?.tree;\n }\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (icon.positionType !== IconPosition.absoluteRight) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n }\n });\n }\n\n let spanCol = 1;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const paddingWidth = padding[1] + padding[3]; // + cellHierarchyIndent\n\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n let text;\n if (cellType === 'checkbox') {\n text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n } else {\n text = cellValue;\n }\n const lines = validToString(text).split('\\n') || [];\n if (lines.length >= 1) {\n // eslint-disable-next-line no-loop-func\n lines.forEach((line: string) => {\n const width = table.measureText(line.slice(0, table.options.maxCharactersNumber || 200), {\n fontSize,\n fontFamily,\n fontWeight\n }).width;\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (width + paddingWidth + 4 + iconWidth) / spanCol, // 这里+4为列宽测量结果的buffer\n maxWidth\n );\n });\n } else {\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (paddingWidth + 4 + iconWidth) / spanCol,\n maxWidth\n );\n }\n // 判断是否需要限制最大宽度 之前写死的450 需要使用配置来判断\n if (table.internalProps.limitMaxAutoWidth !== false) {\n maxWidth = Math.min(\n typeof table.internalProps.limitMaxAutoWidth === 'number' ? table.internalProps.limitMaxAutoWidth : 450,\n maxWidth\n );\n }\n\n if (cellType === 'checkbox') {\n const size = getProp('size', actStyle, col, row, table);\n maxWidth += size;\n\n if (text) {\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);\n maxWidth += spaceBetweenTextAndIcon;\n }\n }\n\n return maxWidth;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: 0,\n height: 0\n };\n}\n\nfunction getColWidthDefinedWidthResizedWidth(col: number, table: BaseTableAPI) {\n const widthDefined = table.getColWidthDefined(col);\n if (table.internalProps._widthResizedColMap.has(col)) {\n return table.getColWidth(col);\n }\n return widthDefined;\n}\n\nexport function getAdaptiveWidth(\n totalDrawWidth: number,\n startCol: number,\n endColPlus1: number,\n update: boolean,\n newWidths: number[],\n table: BaseTableAPI,\n fromScenegraph?: boolean\n) {\n let actualWidth = 0;\n const adaptiveColumns: number[] = [];\n for (let col = startCol; col < endColPlus1; col++) {\n const width = update ? newWidths[col] : table.getColWidth(col);\n const maxWidth = table.getMaxColWidth(col);\n const minWidth = table.getMinColWidth(col);\n if (width !== maxWidth && width !== minWidth) {\n actualWidth += width;\n adaptiveColumns.push(col);\n } else {\n // fixed width, do not adaptive\n totalDrawWidth -= width;\n }\n }\n\n const factor = totalDrawWidth / actualWidth;\n\n for (let i = 0; i < adaptiveColumns.length; i++) {\n const col = adaptiveColumns[i];\n let colWidth;\n if (i === adaptiveColumns.length - 1) {\n colWidth =\n totalDrawWidth -\n adaptiveColumns.reduce((acr, cur, index) => {\n if (cur !== col) {\n return acr + (update ? newWidths[cur] : table.getColWidth(cur));\n }\n return acr;\n }, 0);\n } else {\n colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);\n }\n if (update) {\n newWidths[col] = table._adjustColWidth(col, colWidth);\n } else if (fromScenegraph) {\n table.scenegraph.setColWidth(col, table._adjustColWidth(col, colWidth));\n } else {\n table._setColWidth(col, table._adjustColWidth(col, colWidth), false, true);\n }\n }\n}\n"]}
@@ -43,25 +43,25 @@ export function computeRowsHeight(table, rowStart, rowEnd, isClearRowRangeHeight
43
43
  if ((table.isPivotTable() && !table.isPivotChart() || table.isPivotChart() && !table.internalProps.layoutMap.indicatorsAsCol) && checkPivotFixedStyleAndNoWrap(table, row) && (startCol = 0,
44
44
  endCol = table.rowHeaderLevelCount), isAllRowsAuto || "auto" === table.getDefaultRowHeight(row)) {
45
45
  const height = computeRowHeight(row, startCol, endCol, table);
46
- update ? newHeights[row] = height : table._setRowHeight(row, height);
46
+ update ? newHeights[row] = Math.round(height) : table._setRowHeight(row, height);
47
47
  }
48
48
  }
49
49
  for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) if (isAllRowsAuto || "auto" === table.getDefaultRowHeight(row)) {
50
50
  const height = computeRowHeight(row, 0, table.colCount - 1, table);
51
- update ? newHeights[row] = height : table._setRowHeight(row, height);
51
+ update ? newHeights[row] = Math.round(height) : table._setRowHeight(row, height);
52
52
  }
53
53
  if (rowEnd < table.columnHeaderLevelCount || !isAllRowsAuto) ; else if (table.internalProps.transpose || table.isPivotTable() && !table.internalProps.layoutMap.indicatorsAsCol || !checkFixedStyleAndNoWrap(table)) if (table.internalProps.transpose || table.isPivotTable() && !table.internalProps.layoutMap.indicatorsAsCol) for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {
54
54
  let height;
55
55
  height = checkFixedStyleAndNoWrapForTranspose(table, row) ? computeRowHeight(row, 0, table.rowHeaderLevelCount, table) : computeRowHeight(row, 0, table.colCount - 1, table),
56
- update ? newHeights[row] = height : table._setRowHeight(row, height);
56
+ update ? newHeights[row] = Math.round(height) : table._setRowHeight(row, height);
57
57
  } else for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {
58
58
  const height = computeRowHeight(row, 0, table.colCount - 1, table);
59
- update ? newHeights[row] = height : table._setRowHeight(row, height);
59
+ update ? newHeights[row] = Math.round(height) : table._setRowHeight(row, height);
60
60
  } else {
61
61
  fillRowsHeight(computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table), table.columnHeaderLevelCount, table.rowCount - 1 - table.bottomFrozenRowCount, table, update ? newHeights : void 0);
62
62
  for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {
63
63
  const height = computeRowHeight(row, 0, table.colCount - 1, table);
64
- update ? newHeights[row] = height : table._setRowHeight(row, height);
64
+ update ? newHeights[row] = Math.round(height) : table._setRowHeight(row, height);
65
65
  }
66
66
  }
67
67
  } else {
@@ -98,10 +98,15 @@ export function computeRowsHeight(table, rowStart, rowEnd, isClearRowRangeHeight
98
98
  }
99
99
  }
100
100
  }
101
- if (update) for (let row = 0; row < table.rowCount; row++) {
102
- const newRowHeight = null !== (_a = newHeights[row]) && void 0 !== _a ? _a : table.getRowHeight(row);
103
- newRowHeight !== oldRowHeights[row] && (table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row]),
104
- table._setRowHeight(row, newRowHeight));
101
+ if (update) {
102
+ for (let row = 0; row < table.rowCount; row++) {
103
+ const newRowHeight = null !== (_a = newHeights[row]) && void 0 !== _a ? _a : table.getRowHeight(row);
104
+ newRowHeight !== oldRowHeights[row] && table._setRowHeight(row, newRowHeight);
105
+ }
106
+ for (let row = 0; row < table.rowCount; row++) {
107
+ const newRowHeight = table.getRowHeight(row);
108
+ newRowHeight !== oldRowHeights[row] && table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row], !0);
109
+ }
105
110
  }
106
111
  }
107
112
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MA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AAY;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ;YACR,SAAS;YACT,UAAU;YACV,UAAU;YACV,UAAU;YACV,SAAS,EAAE,YAAY;YACvB,UAAU,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;SACvE,CAAC,CAAC;QACH,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;KAC9C;SAAM;QAEL,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;KACvC;IAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/E,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;IAChE,OAAO;QACL,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC","file":"compute-row-height.js","sourcesContent":["import { RichText, Text, Group as VGroup } from '@visactor/vrender';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { validToString } from '../../tools/util';\nimport type { ColumnIconOption, ColumnTypeOption } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { ColumnData, TextColumnDefine } from '../../ts-types/list-table/layout-map/api';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { dealWithRichTextIcon } from '../utils/text-icon-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentHeight } from '../../components/axis/get-axis-component-size';\nimport { isArray, isNumber, isObject } from '@visactor/vutils';\nimport { CheckBox } from '@visactor/vrender-components';\nimport { decodeReactDom, dealPercentCalc } from '../component/custom';\n\nconst utilTextMark = new Text({\n ignoreBuf: true\n // autoWrapText: true\n});\nconst utilRichTextMark = new RichText({\n width: 0,\n height: 0,\n textConfig: []\n});\nconst utilCheckBoxMark = new CheckBox({});\n\nexport function computeRowsHeight(\n table: BaseTableAPI,\n rowStart?: number,\n rowEnd?: number,\n isClearRowRangeHeightsMap: boolean = true,\n update?: boolean\n): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n\n const oldRowHeights: number[] = [];\n const newHeights: number[] = [];\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n // oldRowHeights.push(table.getRowHeight(row));\n oldRowHeights[row] = table.getRowHeight(row);\n }\n }\n\n table.defaultHeaderRowHeight;\n table.defaultHeaderColWidth;\n const isDefaultHeaderHasAuto =\n table.defaultHeaderRowHeight === 'auto' ||\n (isArray(table.defaultHeaderRowHeight) && table.defaultHeaderRowHeight.some(item => item === 'auto'));\n const isAllRowsAuto = table.heightMode === 'autoHeight' || table.heightMode === 'adaptive';\n\n if (isAllRowsAuto || isDefaultHeaderHasAuto) {\n rowStart = rowStart ?? 0;\n rowEnd = rowEnd ?? table.rowCount - 1;\n\n // clear rowRangeHeightsMap\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n // else {\n // for (let row = rowStart; row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);\n // }\n // }\n\n // compute header row in column header row\n for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {\n let startCol = 0;\n let endCol = table.colCount - 1;\n if (\n ((table.isPivotTable() && !table.isPivotChart()) ||\n (table.isPivotChart() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)) && // no top axis\n checkPivotFixedStyleAndNoWrap(table, row)\n ) {\n // 列表头样式一致,只计算第一列行高,作为整行行高\n startCol = 0;\n endCol = table.rowHeaderLevelCount;\n }\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, startCol, endCol, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n\n // compute bottom frozen row\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n\n if (rowEnd < table.columnHeaderLevelCount || !isAllRowsAuto) {\n // do nothing\n } else {\n // compute body row\n if (\n // 以列展示 且符合只需要计算第一行其他行可复用行高的条条件\n !(\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, fill all row width single compute\n // traspose table and row indicator pivot table cannot use single row height\n const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);\n fillRowsHeight(\n height,\n table.columnHeaderLevelCount,\n table.rowCount - 1 - table.bottomFrozenRowCount,\n table,\n update ? newHeights : undefined\n );\n //底部冻结的行行高需要单独计算\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n } else if (\n // 以行展示\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) {\n // check fixed style and no wrap situation, just compute 0-table.rowHeaderLevelCount column(the column after row header) in ervey row\n // in traspose table and row indicator pivot table\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);//注释掉 注意有无缓存问题\n let height;\n if (checkFixedStyleAndNoWrapForTranspose(table, row)) {\n // 以行展示 只计算到body第一列样式的情况即可\n height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);\n } else {\n height = computeRowHeight(row, 0, table.colCount - 1, table);\n }\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n } else {\n // 以列展示 需要逐行计算情况\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row); //注释掉 注意有无缓存问题\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n }\n } else {\n table.rowHeightsMap.clear();\n for (let row = 0; row < table.rowCount; row++) {\n newHeights[row] = table.getRowHeight(row);\n }\n }\n\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n\n // 处理adaptive高度\n if (table.heightMode === 'adaptive') {\n table._clearRowRangeHeightsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1);\n const bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0;\n const totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight;\n const startRow = table.columnHeaderLevelCount;\n const endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;\n let actualHeight = 0;\n for (let row = startRow; row < endRow; row++) {\n actualHeight += update ? newHeights[row] : table.getRowHeight(row);\n }\n const factor = totalDrawHeight / actualHeight;\n for (let row = startRow; row < endRow; row++) {\n let rowHeight;\n if (row === endRow - 1) {\n rowHeight =\n totalDrawHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= startRow && index <= endRow - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(startRow, endRow - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table._setRowHeight(row, rowHeight, false);\n }\n }\n } else if (table.autoFillHeight) {\n table._clearRowRangeHeightsMap();\n const canvasHeight = table.tableNoFrameHeight;\n let actualHeight = 0;\n let actualHeaderHeight = 0;\n for (let row = 0; row < table.rowCount; row++) {\n const rowHeight = update ? newHeights[row] : table.getRowHeight(row);\n if (row < table.frozenRowCount || (table.isPivotChart() && row >= table.rowCount - table.bottomFrozenRowCount)) {\n actualHeaderHeight += rowHeight;\n }\n\n actualHeight += rowHeight;\n }\n table.scenegraph._dealAutoFillHeightOriginRowsHeight = actualHeight;\n // 如果内容高度小于canvas高度,执行adaptive放大\n if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {\n const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n // if (update) {\n // newHeights[row] = newHeights[row] * factor;\n // } else {\n // table.setRowHeight(row, table.getRowHeight(row) * factor);\n // }\n let rowHeight;\n if (row === table.rowCount - table.bottomFrozenRowCount - 1) {\n rowHeight =\n canvasHeight -\n actualHeaderHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= table.frozenRowCount && index <= table.rowCount - table.bottomFrozenRowCount - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table._setRowHeight(row, rowHeight, false);\n }\n }\n }\n }\n\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n const newRowHeight = newHeights[row] ?? table.getRowHeight(row);\n if (newRowHeight !== oldRowHeights[row]) {\n // update the row height in scenegraph\n table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row]);\n table._setRowHeight(row, newRowHeight);\n }\n }\n }\n // console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, rowStart, rowEnd);\n}\n\nexport function computeRowHeight(row: number, startCol: number, endCol: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n // 如果是透视图\n if (\n table.isPivotChart() &&\n row >= table.columnHeaderLevelCount &&\n row < table.rowCount - table.bottomFrozenRowCount\n ) {\n if ((table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) {\n //并且指标是以列展示 计算行高需要根据y轴的值域范围\n const optimunHeight = (table.internalProps.layoutMap as PivotHeaderLayoutMap).getOptimunHeightForChart(row);\n if (optimunHeight > 0) {\n return optimunHeight;\n }\n } else {\n //直接拿默认行高\n const defaultHeight = table.getDefaultRowHeight(row);\n if (isNumber(defaultHeight)) {\n return defaultHeight;\n }\n }\n }\n for (let col = startCol; col <= endCol; col++) {\n // CustomRender height calculation\n const customHeight = computeCustomRenderHeight(col, row, table);\n if (customHeight) {\n maxHeight = Math.max(customHeight.height, maxHeight);\n if (!customHeight.renderDefault) {\n continue;\n }\n }\n\n // Axis component height calculation\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentHeight(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxHeight = Math.max(axisWidth, maxHeight);\n continue;\n }\n }\n }\n\n const cellType = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row)?.headerType\n : table.getBodyColumnType(col, row);\n if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {\n // text&link&progressbar测量文字宽度\n // image&video&sparkline使用默认宽度\n const defaultHeight = table.getDefaultRowHeight(row);\n maxHeight = Math.max(maxHeight, isNumber(defaultHeight) ? defaultHeight : table.defaultRowHeight);\n continue;\n }\n\n // text height calculation\n const textHeight = computeTextHeight(col, row, cellType, table);\n maxHeight = Math.max(textHeight, maxHeight);\n }\n return maxHeight;\n}\n\nfunction checkFixedStyleAndNoWrap(table: BaseTableAPI): boolean {\n const { layoutMap } = table.internalProps;\n const row = table.columnHeaderLevelCount;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n (table.internalProps.autoWrapText || table.isPivotChart()) &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n for (let col = 0; col < table.colCount; col++) {\n const cellDefine = layoutMap.getBody(col, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n cellDefine.define?.customLayout ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(col, row); //获取的style是结合了theme配置的style\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction checkFixedStyleAndNoWrapForTranspose(table: BaseTableAPI, row: number): boolean {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const cellDefine = layoutMap.getBody(table.rowHeaderLevelCount, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n cellDefine.define?.customLayout ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction checkPivotFixedStyleAndNoWrap(table: BaseTableAPI, row: number) {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const headerDefine = layoutMap.getHeader(table.rowHeaderLevelCount, row);\n if (\n typeof headerDefine.style === 'function' ||\n typeof (headerDefine as HeaderData).icons === 'function' ||\n headerDefine.define?.headerCustomRender ||\n headerDefine.define?.headerCustomLayout ||\n typeof headerDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const headerStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof headerStyle.padding === 'function' ||\n typeof headerStyle.fontSize === 'function' ||\n typeof headerStyle.lineHeight === 'function' ||\n headerStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction fillRowsHeight(\n height: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n newHeights: number[] | undefined\n) {\n for (let row = startRow; row <= endRow; row++) {\n if (newHeights) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n}\n\n/**\n * @description: compute customRender height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderHeight(col: number, row: number, table: BaseTableAPI) {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanRow = 1;\n let height = 0;\n let renderDefault = false;\n let enableCellPadding = false;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);\n dealPercentCalc(customLayoutObj.rootContainer, table.getColWidth(col), 0);\n customLayoutObj.rootContainer.setStage(table.scenegraph.stage);\n height = (customLayoutObj.rootContainer as VGroup).AABBBounds.height() ?? 0;\n renderDefault = customLayoutObj.renderDefault;\n enableCellPadding = customLayoutObj.enableCellPadding;\n } else {\n height = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n height = customRenderObj?.expectedHeight ?? 0;\n renderDefault = customRenderObj?.renderDefault;\n } else {\n height = customRender?.expectedHeight ?? 0;\n renderDefault = customRender?.renderDefault;\n }\n if (enableCellPadding) {\n const actStyle = table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n height += padding[0] + padding[2];\n }\n return {\n height: height / spanRow,\n renderDefault\n };\n }\n return undefined;\n}\n\n/**\n * @description: compute text height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextHeight(col: number, row: number, cellType: ColumnTypeOption, table: BaseTableAPI): number {\n let maxHeight = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconHeight = 0;\n let iconWidth = 0;\n const iconInlineFront: ColumnIconOption[] = [];\n let iconInlineFrontHeight = 0;\n const iconInlineEnd: ColumnIconOption[] = [];\n let iconInlineEndHeight = 0;\n // const define = table.getBodyColumnDefine(col, row);\n // const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n\n let mayHaveIcon = false;\n if (table.getCellLocation(col, row) !== 'body') {\n mayHaveIcon = true;\n } else {\n const define = table.getBodyColumnDefine(col, row);\n mayHaveIcon = !!define?.icon || !!define?.tree;\n }\n\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (\n icon.positionType !== IconPosition.absoluteRight &&\n icon.positionType !== IconPosition.inlineFront &&\n icon.positionType !== IconPosition.inlineEnd\n ) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n iconHeight = Math.max(iconHeight, icon.height ?? 0);\n } else if (icon.positionType === IconPosition.inlineFront) {\n iconInlineFront.push(icon);\n iconInlineFrontHeight = Math.max(\n iconInlineFrontHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n } else if (icon.positionType === IconPosition.inlineEnd) {\n iconInlineEnd.push(icon);\n iconInlineEndHeight = Math.max(\n iconInlineEndHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n }\n });\n }\n let spanRow = 1;\n let endCol = col;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n col = cellRange.start.col;\n endCol = cellRange.end.col;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontStyle = getProp('fontStyle', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lineHeight = getProp('lineHeight', actStyle, col, row, table) ?? fontSize;\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);\n let text;\n if (cellType === 'checkbox') {\n text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n } else {\n text = cellValue;\n }\n const lines = validToString(text).split('\\n') || [];\n\n const cellWidth = table.getColsWidth(col, endCol);\n\n if (cellType === 'checkbox') {\n const size = getProp('size', actStyle, col, row, table);\n if (autoWrapText) {\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - size - spaceBetweenTextAndIcon;\n utilCheckBoxMark.setAttributes({\n text: {\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word'\n },\n icon: {\n width: Math.floor(size / 1.4), // icon : box => 10 : 14\n height: Math.floor(size / 1.4)\n },\n box: {\n width: size,\n height: size\n },\n spaceBetweenTextAndIcon\n });\n utilCheckBoxMark.render();\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n maxHeight = Math.max(size, lines.length * lineHeight);\n }\n } else if (iconInlineFront.length || iconInlineEnd.length) {\n // if (autoWrapText) {\n const textOption = Object.assign({\n text: cellValue?.toString(),\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n lineHeight\n });\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))\n ];\n utilRichTextMark.setAttributes({\n width: cellWidth - (padding[1] + padding[3]) - iconWidth,\n height: 0,\n textConfig\n });\n maxHeight = utilRichTextMark.AABBBounds.height();\n // } else {\n // maxHeight = 0;\n // lines.forEach((line: string, index: number) => {\n // if (index === 0 && iconInlineFront.length) {\n // maxHeight += Math.max(lineHeight, iconInlineFrontHeight);\n // } else if (index === lines.length - 1 && iconInlineEnd.length) {\n // maxHeight += Math.max(lineHeight, iconInlineEndHeight);\n // } else {\n // maxHeight += lineHeight;\n // }\n // });\n // }\n } else if (autoWrapText) {\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;\n utilTextMark.setAttributes({\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word',\n whiteSpace: lines.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'\n });\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n // autoWrapText = false\n maxHeight = lines.length * lineHeight;\n }\n\n return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: table.getColWidth(col),\n height: 0\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,YAAY,GAAG,IAAI,IAAI,CAAC;IAC5B,SAAS,EAAE,IAAI;CAEhB,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,IAAI,QAAQ,CAAC;IACpC,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,EAAE;CACf,CAAC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;KAC9C;SAAM;QAEL,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;KACvC;IAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/E,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;IAChE,OAAO;QACL,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC","file":"compute-row-height.js","sourcesContent":["import { RichText, Text, Group as VGroup } from '@visactor/vrender';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { validToString } from '../../tools/util';\nimport type { ColumnIconOption, ColumnTypeOption } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { ColumnData, TextColumnDefine } from '../../ts-types/list-table/layout-map/api';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { dealWithRichTextIcon } from '../utils/text-icon-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentHeight } from '../../components/axis/get-axis-component-size';\nimport { isArray, isNumber, isObject } from '@visactor/vutils';\nimport { CheckBox } from '@visactor/vrender-components';\nimport { decodeReactDom, dealPercentCalc } from '../component/custom';\n\nconst utilTextMark = new Text({\n ignoreBuf: true\n // autoWrapText: true\n});\nconst utilRichTextMark = new RichText({\n width: 0,\n height: 0,\n textConfig: []\n});\nconst utilCheckBoxMark = new CheckBox({});\n\nexport function computeRowsHeight(\n table: BaseTableAPI,\n rowStart?: number,\n rowEnd?: number,\n isClearRowRangeHeightsMap: boolean = true,\n update?: boolean\n): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n\n const oldRowHeights: number[] = [];\n const newHeights: number[] = [];\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n // oldRowHeights.push(table.getRowHeight(row));\n oldRowHeights[row] = table.getRowHeight(row);\n }\n }\n\n table.defaultHeaderRowHeight;\n table.defaultHeaderColWidth;\n const isDefaultHeaderHasAuto =\n table.defaultHeaderRowHeight === 'auto' ||\n (isArray(table.defaultHeaderRowHeight) && table.defaultHeaderRowHeight.some(item => item === 'auto'));\n const isAllRowsAuto = table.heightMode === 'autoHeight' || table.heightMode === 'adaptive';\n\n if (isAllRowsAuto || isDefaultHeaderHasAuto) {\n rowStart = rowStart ?? 0;\n rowEnd = rowEnd ?? table.rowCount - 1;\n\n // clear rowRangeHeightsMap\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n // else {\n // for (let row = rowStart; row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);\n // }\n // }\n\n // compute header row in column header row\n for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {\n let startCol = 0;\n let endCol = table.colCount - 1;\n if (\n ((table.isPivotTable() && !table.isPivotChart()) ||\n (table.isPivotChart() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)) && // no top axis\n checkPivotFixedStyleAndNoWrap(table, row)\n ) {\n // 列表头样式一致,只计算第一列行高,作为整行行高\n startCol = 0;\n endCol = table.rowHeaderLevelCount;\n }\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, startCol, endCol, table);\n if (update) {\n newHeights[row] = Math.round(height);\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n\n // compute bottom frozen row\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = Math.round(height);\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n\n if (rowEnd < table.columnHeaderLevelCount || !isAllRowsAuto) {\n // do nothing\n } else {\n // compute body row\n if (\n // 以列展示 且符合只需要计算第一行其他行可复用行高的条条件\n !(\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, fill all row width single compute\n // traspose table and row indicator pivot table cannot use single row height\n const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);\n fillRowsHeight(\n height,\n table.columnHeaderLevelCount,\n table.rowCount - 1 - table.bottomFrozenRowCount,\n table,\n update ? newHeights : undefined\n );\n //底部冻结的行行高需要单独计算\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = Math.round(height);\n } else {\n table._setRowHeight(row, height);\n }\n }\n } else if (\n // 以行展示\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) {\n // check fixed style and no wrap situation, just compute 0-table.rowHeaderLevelCount column(the column after row header) in ervey row\n // in traspose table and row indicator pivot table\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);//注释掉 注意有无缓存问题\n let height;\n if (checkFixedStyleAndNoWrapForTranspose(table, row)) {\n // 以行展示 只计算到body第一列样式的情况即可\n height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);\n } else {\n height = computeRowHeight(row, 0, table.colCount - 1, table);\n }\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = Math.round(height);\n } else {\n table._setRowHeight(row, height);\n }\n }\n } else {\n // 以列展示 需要逐行计算情况\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row); //注释掉 注意有无缓存问题\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = Math.round(height);\n } else {\n table._setRowHeight(row, height);\n }\n }\n }\n }\n } else {\n table.rowHeightsMap.clear();\n for (let row = 0; row < table.rowCount; row++) {\n newHeights[row] = table.getRowHeight(row);\n }\n }\n\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n\n // 处理adaptive高度\n if (table.heightMode === 'adaptive') {\n table._clearRowRangeHeightsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1);\n const bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0;\n const totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight;\n const startRow = table.columnHeaderLevelCount;\n const endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;\n let actualHeight = 0;\n for (let row = startRow; row < endRow; row++) {\n actualHeight += update ? newHeights[row] : table.getRowHeight(row);\n }\n const factor = totalDrawHeight / actualHeight;\n for (let row = startRow; row < endRow; row++) {\n let rowHeight;\n if (row === endRow - 1) {\n rowHeight =\n totalDrawHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= startRow && index <= endRow - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(startRow, endRow - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table._setRowHeight(row, rowHeight, false);\n }\n }\n } else if (table.autoFillHeight) {\n table._clearRowRangeHeightsMap();\n const canvasHeight = table.tableNoFrameHeight;\n let actualHeight = 0;\n let actualHeaderHeight = 0;\n for (let row = 0; row < table.rowCount; row++) {\n const rowHeight = update ? newHeights[row] : table.getRowHeight(row);\n if (row < table.frozenRowCount || (table.isPivotChart() && row >= table.rowCount - table.bottomFrozenRowCount)) {\n actualHeaderHeight += rowHeight;\n }\n\n actualHeight += rowHeight;\n }\n table.scenegraph._dealAutoFillHeightOriginRowsHeight = actualHeight;\n // 如果内容高度小于canvas高度,执行adaptive放大\n if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {\n const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n // if (update) {\n // newHeights[row] = newHeights[row] * factor;\n // } else {\n // table.setRowHeight(row, table.getRowHeight(row) * factor);\n // }\n let rowHeight;\n if (row === table.rowCount - table.bottomFrozenRowCount - 1) {\n rowHeight =\n canvasHeight -\n actualHeaderHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= table.frozenRowCount && index <= table.rowCount - table.bottomFrozenRowCount - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table._setRowHeight(row, rowHeight, false);\n }\n }\n }\n }\n\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n const newRowHeight = newHeights[row] ?? table.getRowHeight(row);\n if (newRowHeight !== oldRowHeights[row]) {\n // update the row height in scenegraph\n table._setRowHeight(row, newRowHeight);\n // table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row], true);\n }\n }\n for (let row = 0; row < table.rowCount; row++) {\n const newRowHeight = table.getRowHeight(row);\n if (newRowHeight !== oldRowHeights[row]) {\n // update the row height in scenegraph\n // table._setRowHeight(row, newRowHeight);\n table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row], true);\n }\n }\n }\n // console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, rowStart, rowEnd);\n}\n\nexport function computeRowHeight(row: number, startCol: number, endCol: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n // 如果是透视图\n if (\n table.isPivotChart() &&\n row >= table.columnHeaderLevelCount &&\n row < table.rowCount - table.bottomFrozenRowCount\n ) {\n if ((table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) {\n //并且指标是以列展示 计算行高需要根据y轴的值域范围\n const optimunHeight = (table.internalProps.layoutMap as PivotHeaderLayoutMap).getOptimunHeightForChart(row);\n if (optimunHeight > 0) {\n return optimunHeight;\n }\n } else {\n //直接拿默认行高\n const defaultHeight = table.getDefaultRowHeight(row);\n if (isNumber(defaultHeight)) {\n return defaultHeight;\n }\n }\n }\n for (let col = startCol; col <= endCol; col++) {\n // CustomRender height calculation\n const customHeight = computeCustomRenderHeight(col, row, table);\n if (customHeight) {\n maxHeight = Math.max(customHeight.height, maxHeight);\n if (!customHeight.renderDefault) {\n continue;\n }\n }\n\n // Axis component height calculation\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentHeight(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxHeight = Math.max(axisWidth, maxHeight);\n continue;\n }\n }\n }\n\n const cellType = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row)?.headerType\n : table.getBodyColumnType(col, row);\n if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {\n // text&link&progressbar测量文字宽度\n // image&video&sparkline使用默认宽度\n const defaultHeight = table.getDefaultRowHeight(row);\n maxHeight = Math.max(maxHeight, isNumber(defaultHeight) ? defaultHeight : table.defaultRowHeight);\n continue;\n }\n\n // text height calculation\n const textHeight = computeTextHeight(col, row, cellType, table);\n maxHeight = Math.max(textHeight, maxHeight);\n }\n return maxHeight;\n}\n\nfunction checkFixedStyleAndNoWrap(table: BaseTableAPI): boolean {\n const { layoutMap } = table.internalProps;\n const row = table.columnHeaderLevelCount;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n (table.internalProps.autoWrapText || table.isPivotChart()) &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n for (let col = 0; col < table.colCount; col++) {\n const cellDefine = layoutMap.getBody(col, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n cellDefine.define?.customLayout ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(col, row); //获取的style是结合了theme配置的style\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction checkFixedStyleAndNoWrapForTranspose(table: BaseTableAPI, row: number): boolean {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const cellDefine = layoutMap.getBody(table.rowHeaderLevelCount, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n cellDefine.define?.customLayout ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction checkPivotFixedStyleAndNoWrap(table: BaseTableAPI, row: number) {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const headerDefine = layoutMap.getHeader(table.rowHeaderLevelCount, row);\n if (\n typeof headerDefine.style === 'function' ||\n typeof (headerDefine as HeaderData).icons === 'function' ||\n headerDefine.define?.headerCustomRender ||\n headerDefine.define?.headerCustomLayout ||\n typeof headerDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const headerStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof headerStyle.padding === 'function' ||\n typeof headerStyle.fontSize === 'function' ||\n typeof headerStyle.lineHeight === 'function' ||\n headerStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction fillRowsHeight(\n height: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n newHeights: number[] | undefined\n) {\n for (let row = startRow; row <= endRow; row++) {\n if (newHeights) {\n newHeights[row] = height;\n } else {\n table._setRowHeight(row, height);\n }\n }\n}\n\n/**\n * @description: compute customRender height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderHeight(col: number, row: number, table: BaseTableAPI) {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanRow = 1;\n let height = 0;\n let renderDefault = false;\n let enableCellPadding = false;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);\n dealPercentCalc(customLayoutObj.rootContainer, table.getColWidth(col), 0);\n customLayoutObj.rootContainer.setStage(table.scenegraph.stage);\n height = (customLayoutObj.rootContainer as VGroup).AABBBounds.height() ?? 0;\n renderDefault = customLayoutObj.renderDefault;\n enableCellPadding = customLayoutObj.enableCellPadding;\n } else {\n height = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n height = customRenderObj?.expectedHeight ?? 0;\n renderDefault = customRenderObj?.renderDefault;\n } else {\n height = customRender?.expectedHeight ?? 0;\n renderDefault = customRender?.renderDefault;\n }\n if (enableCellPadding) {\n const actStyle = table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n height += padding[0] + padding[2];\n }\n return {\n height: height / spanRow,\n renderDefault\n };\n }\n return undefined;\n}\n\n/**\n * @description: compute text height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextHeight(col: number, row: number, cellType: ColumnTypeOption, table: BaseTableAPI): number {\n let maxHeight = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconHeight = 0;\n let iconWidth = 0;\n const iconInlineFront: ColumnIconOption[] = [];\n let iconInlineFrontHeight = 0;\n const iconInlineEnd: ColumnIconOption[] = [];\n let iconInlineEndHeight = 0;\n // const define = table.getBodyColumnDefine(col, row);\n // const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n\n let mayHaveIcon = false;\n if (table.getCellLocation(col, row) !== 'body') {\n mayHaveIcon = true;\n } else {\n const define = table.getBodyColumnDefine(col, row);\n mayHaveIcon = !!define?.icon || !!define?.tree;\n }\n\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (\n icon.positionType !== IconPosition.absoluteRight &&\n icon.positionType !== IconPosition.inlineFront &&\n icon.positionType !== IconPosition.inlineEnd\n ) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n iconHeight = Math.max(iconHeight, icon.height ?? 0);\n } else if (icon.positionType === IconPosition.inlineFront) {\n iconInlineFront.push(icon);\n iconInlineFrontHeight = Math.max(\n iconInlineFrontHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n } else if (icon.positionType === IconPosition.inlineEnd) {\n iconInlineEnd.push(icon);\n iconInlineEndHeight = Math.max(\n iconInlineEndHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n }\n });\n }\n let spanRow = 1;\n let endCol = col;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n col = cellRange.start.col;\n endCol = cellRange.end.col;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontStyle = getProp('fontStyle', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lineHeight = getProp('lineHeight', actStyle, col, row, table) ?? fontSize;\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);\n let text;\n if (cellType === 'checkbox') {\n text = isObject(cellValue) ? (cellValue as any).text : cellValue;\n } else {\n text = cellValue;\n }\n const lines = validToString(text).split('\\n') || [];\n\n const cellWidth = table.getColsWidth(col, endCol);\n\n if (cellType === 'checkbox') {\n const size = getProp('size', actStyle, col, row, table);\n if (autoWrapText) {\n const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - size - spaceBetweenTextAndIcon;\n utilCheckBoxMark.setAttributes({\n text: {\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word'\n },\n icon: {\n width: Math.floor(size / 1.4), // icon : box => 10 : 14\n height: Math.floor(size / 1.4)\n },\n box: {\n width: size,\n height: size\n },\n spaceBetweenTextAndIcon\n });\n utilCheckBoxMark.render();\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n maxHeight = Math.max(size, lines.length * lineHeight);\n }\n } else if (iconInlineFront.length || iconInlineEnd.length) {\n // if (autoWrapText) {\n const textOption = Object.assign({\n text: cellValue?.toString(),\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n lineHeight\n });\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))\n ];\n utilRichTextMark.setAttributes({\n width: cellWidth - (padding[1] + padding[3]) - iconWidth,\n height: 0,\n textConfig\n });\n maxHeight = utilRichTextMark.AABBBounds.height();\n // } else {\n // maxHeight = 0;\n // lines.forEach((line: string, index: number) => {\n // if (index === 0 && iconInlineFront.length) {\n // maxHeight += Math.max(lineHeight, iconInlineFrontHeight);\n // } else if (index === lines.length - 1 && iconInlineEnd.length) {\n // maxHeight += Math.max(lineHeight, iconInlineEndHeight);\n // } else {\n // maxHeight += lineHeight;\n // }\n // });\n // }\n } else if (autoWrapText) {\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;\n utilTextMark.setAttributes({\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word',\n whiteSpace: lines.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'\n });\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n // autoWrapText = false\n maxHeight = lines.length * lineHeight;\n }\n\n return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: table.getColWidth(col),\n height: 0\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { Group } from '../graphic/group';
2
2
  import type { Scenegraph } from '../scenegraph';
3
- export declare function updateRowHeight(scene: Scenegraph, row: number, detaY: number): void;
3
+ export declare function updateRowHeight(scene: Scenegraph, row: number, detaY: number, skipTableHeightMap?: boolean): void;
4
4
  export declare function updateCellHeightForRow(scene: Scenegraph, cell: Group, col: number, row: number, height: number, detaY: number, isHeader: boolean): void;
5
5
  export declare function updateCellHeightForColumn(scene: Scenegraph, cell: Group, col: number, row: number, height: number, detaY: number, isHeader: boolean): void;
6
6
  export declare function updateCellHeight(scene: Scenegraph, cell: Group, col: number, row: number, distHeight: number, detaY: number, isHeader: boolean): void;
@@ -20,8 +20,8 @@ import { isMergeCellGroup } from "../utils/is-merge-cell-group";
20
20
 
21
21
  import { resizeCellGroup } from "../group-creater/column-helper";
22
22
 
23
- export function updateRowHeight(scene, row, detaY) {
24
- scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, !0);
23
+ export function updateRowHeight(scene, row, detaY, skipTableHeightMap) {
24
+ skipTableHeightMap || scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, !0);
25
25
  for (let col = 0; col < scene.table.colCount; col++) {
26
26
  const cell = scene.getCell(col, row), mergeInfo = getCellMergeInfo(scene.table, col, row);
27
27
  if (mergeInfo && mergeInfo.start.col !== col) continue;
@@ -38,17 +38,17 @@ export function updateRowHeight(scene, row, detaY) {
38
38
  }
39
39
 
40
40
  export function updateCellHeightForRow(scene, cell, col, row, height, detaY, isHeader) {
41
- cell.setAttribute("height", height);
42
41
  cell && updateCellHeight(scene, cell, col, row, height, detaY, isHeader);
43
42
  }
44
43
 
45
44
  export function updateCellHeightForColumn(scene, cell, col, row, height, detaY, isHeader) {
46
- cell.setAttribute("height", height);
47
45
  updateCellHeight(scene, cell, col, row, height, 0, isHeader);
48
46
  }
49
47
 
50
48
  export function updateCellHeight(scene, cell, col, row, distHeight, detaY, isHeader) {
51
49
  var _a, _b;
50
+ if (cell.attribute.height === distHeight && !cell.needUpdateHeight) return;
51
+ cell.needUpdateHeight = !1, cell.setAttribute("height", distHeight);
52
52
  const type = scene.table.isHeader(col, row) ? scene.table._getHeaderLayoutMap(col, row).headerType : scene.table.getBodyColumnType(col, row);
53
53
  if ("progressbar" === type) {
54
54
  const columnDefine = scene.table.getBodyColumnDefine(col, row), style = scene.table._getCellStyle(col, row), value = scene.table.getCellValue(col, row), dataValue = scene.table.getCellOriginValue(col, row), padding = getQuadProps(getProp("padding", style, col, row, scene.table)), newBarCell = createProgressBarCell(columnDefine, style, cell.attribute.width, value, dataValue, col, row, padding, scene.table), oldBarCell = cell.getChildByName("progress-bar");
@@ -98,7 +98,8 @@ function updateMergeCellContentHeight(cellGroup, distHeight, detaY, autoRowHeigh
98
98
  });
99
99
  })), updateCellContentHeight(singleCellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);
100
100
  const rangeHeight = table.getRowHeight(row), rangeWidth = table.getColWidth(col);
101
- singleCellGroup.contentHeight = distHeight, resizeCellGroup(singleCellGroup, rangeWidth, rangeHeight, {
101
+ singleCellGroup.contentHeight = distHeight;
102
+ const {widthChange: widthChange} = resizeCellGroup(singleCellGroup, rangeWidth, rangeHeight, {
102
103
  start: {
103
104
  col: cellGroup.mergeStartCol,
104
105
  row: cellGroup.mergeStartRow
@@ -108,6 +109,7 @@ function updateMergeCellContentHeight(cellGroup, distHeight, detaY, autoRowHeigh
108
109
  row: cellGroup.mergeEndRow
109
110
  }
110
111
  }, table);
112
+ widthChange && (singleCellGroup.needUpdateWidth = !0);
111
113
  }
112
114
  } else updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, padding, textAlign, textBaseline);
113
115
  }