@visactor/vtable 0.22.1 → 0.22.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/body-helper/style/Style.d.ts +3 -0
- package/cjs/body-helper/style/Style.js +22 -15
- package/cjs/body-helper/style/Style.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -1
- package/cjs/core/BaseTable.js +3 -2
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/event.js +2 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/header-helper/style/Style.d.ts +3 -0
- package/cjs/header-helper/style/Style.js +26 -19
- package/cjs/header-helper/style/Style.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/tree-helper.js +1 -0
- package/cjs/plugins/themes.js +1 -2
- package/cjs/scenegraph/group-creater/cell-helper.js +3 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +5 -4
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +7 -4
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +70 -71
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +18 -11
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +19 -13
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/scenegraph/utils/text-measure.js +6 -6
- package/cjs/scenegraph/utils/text-measure.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +183 -123
- package/dist/vtable.min.js +2 -2
- package/es/body-helper/style/Style.d.ts +3 -0
- package/es/body-helper/style/Style.js +22 -15
- package/es/body-helper/style/Style.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -1
- package/es/core/BaseTable.js +3 -2
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/event.js +2 -1
- package/es/event/event.js.map +1 -1
- package/es/header-helper/style/Style.d.ts +3 -0
- package/es/header-helper/style/Style.js +26 -19
- package/es/header-helper/style/Style.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/tree-helper.js +2 -1
- package/es/plugins/themes.js +1 -2
- package/es/scenegraph/group-creater/cell-helper.js +2 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +6 -3
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +6 -4
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +69 -70
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +16 -9
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +19 -10
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +1 -1
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/scenegraph/utils/text-measure.js +6 -6
- package/es/scenegraph/utils/text-measure.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/layout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AM,GAAG,CAAC,EAAE;YACpC,QAAQ;gBACN,cAAc;oBACd,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;wBACzC,IAAI,GAAG,KAAK,GAAG,EAAE;4BACf,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;yBACjE;wBACD,OAAO,GAAG,CAAC;oBACb,CAAC,EAAE,CAAC,CAAC,CAAC;SACT;aAAM;YACL,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,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 { ColumnDefine, ColumnTypeOption, IRowSeriesNumber, 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, HeaderData } 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 './../../vrender';\nimport { isObject, isValid } 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 (\n col < table.rowHeaderLevelCount ||\n (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)\n ) {\n actualHeaderWidth += colWidth;\n }\n }\n const startCol = table.rowHeaderLevelCount;\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 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 (\n col < table.rowHeaderLevelCount ||\n (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)\n ) {\n actualHeaderWidth += colWidth;\n }\n actualWidth += colWidth;\n }\n // 如果内容宽度小于canvas宽度,执行adaptive放大\n if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {\n const startCol = table.rowHeaderLevelCount;\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, false, true);\n // table.scenegraph.updateColWidth(col, newColWidth - oldColWidths[col], true, true);\n }\n }\n table.stateManager.checkFrozen();\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(true);\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) as HeaderData)?.headerType\n : table.getBodyColumnType(col, row);\n if (\n isValid(cellType) &&\n cellType !== 'text' &&\n cellType !== 'link' &&\n cellType !== 'progressbar' &&\n cellType !== 'checkbox'\n ) {\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 as HeaderData)?.define?.columnWidthComputeMode === 'only-body') {\n continue;\n }\n if ((hd as HeaderData)?.hierarchyLevel) {\n cellHierarchyIndent =\n ((hd as HeaderData).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 as ColumnDefine)?.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 (\n table.isHeader(col, row) ||\n (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell ||\n table.hasCustomMerge()\n ) {\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 as ColumnDefine)?.tree || (define as IRowSeriesNumber)?.dragOrder;\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 (\n table.isHeader(col, row) ||\n (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell ||\n table.hasCustomMerge()\n ) {\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): any {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: null, // vrender 逻辑中通过判断null对flex的元素来自动计算宽高\n height: null\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,iBAAiB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,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,IAAI,QAAQ,KAAK,CAAC,IAAI,MAAM,KAAK,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE;QACnD,KAAK,CAAC,uBAAuB,EAAE,CAAC;KAKjC;IAED,MAAM,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C5E;KACF;AACH,CAAC","file":"compute-col-width.js","sourcesContent":["import type { SimpleHeaderLayoutMap } from '../../layout';\nimport type { ColumnDefine, ColumnTypeOption, IRowSeriesNumber, 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, HeaderData } 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 './../../vrender';\nimport { isObject, isValid } 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 (\n col < table.rowHeaderLevelCount ||\n (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)\n ) {\n actualHeaderWidth += colWidth;\n }\n }\n const startCol = table.rowHeaderLevelCount;\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 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 (\n col < table.rowHeaderLevelCount ||\n (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)\n ) {\n actualHeaderWidth += colWidth;\n }\n actualWidth += colWidth;\n }\n // 如果内容宽度小于canvas宽度,执行adaptive放大\n if (actualWidth < canvasWidth && actualWidth > actualHeaderWidth) {\n const startCol = table.rowHeaderLevelCount;\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, false, true);\n // table.scenegraph.updateColWidth(col, newColWidth - oldColWidths[col], true, true);\n }\n }\n table.stateManager.checkFrozen();\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(true);\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) as HeaderData)?.headerType\n : table.getBodyColumnType(col, row);\n if (\n isValid(cellType) &&\n cellType !== 'text' &&\n cellType !== 'link' &&\n cellType !== 'progressbar' &&\n cellType !== 'checkbox'\n ) {\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 as HeaderData)?.define?.columnWidthComputeMode === 'only-body') {\n continue;\n }\n if ((hd as HeaderData)?.hierarchyLevel) {\n cellHierarchyIndent =\n ((hd as HeaderData).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 as ColumnDefine)?.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 (\n table.isHeader(col, row) ||\n (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell ||\n table.hasCustomMerge()\n ) {\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 const setedWidth = (customLayoutObj.rootContainer as VGroup).attribute.width;\n customLayoutObj.rootContainer.setStage(table.scenegraph.stage);\n width = setedWidth > 0 ? setedWidth : (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 as ColumnDefine)?.tree || (define as IRowSeriesNumber)?.dragOrder;\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 (\n table.isHeader(col, row) ||\n (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell ||\n table.hasCustomMerge()\n ) {\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): any {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: null, // vrender 逻辑中通过判断null对flex的元素来自动计算宽高\n height: null\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"]}
|
|
@@ -122,7 +122,7 @@ export function computeRowsHeight(table, rowStart, rowEnd, isClearRowRangeHeight
|
|
|
122
122
|
|
|
123
123
|
export function computeRowHeight(row, startCol, endCol, table) {
|
|
124
124
|
var _a;
|
|
125
|
-
let maxHeight
|
|
125
|
+
let maxHeight;
|
|
126
126
|
if (table.isPivotChart() && row >= table.columnHeaderLevelCount && row < table.rowCount - table.bottomFrozenRowCount) if (table.internalProps.layoutMap.indicatorsAsCol) {
|
|
127
127
|
const optimunHeight = table.internalProps.layoutMap.getOptimunHeightForChart(row);
|
|
128
128
|
if (optimunHeight > 0) return optimunHeight;
|
|
@@ -132,28 +132,25 @@ export function computeRowHeight(row, startCol, endCol, table) {
|
|
|
132
132
|
}
|
|
133
133
|
for (let col = startCol; col <= endCol; col++) {
|
|
134
134
|
const customHeight = computeCustomRenderHeight(col, row, table);
|
|
135
|
-
if (customHeight && (maxHeight = Math.max(customHeight.height, maxHeight)
|
|
135
|
+
if (customHeight && (maxHeight = isValid(maxHeight) ? Math.max(customHeight.height, maxHeight) : customHeight.height,
|
|
136
|
+
!customHeight.renderDefault)) continue;
|
|
136
137
|
if (table.isPivotChart()) {
|
|
137
138
|
const layout = table.internalProps.layoutMap, axisConfig = getAxisConfigInPivotChart(col, row, layout);
|
|
138
139
|
if (axisConfig) {
|
|
139
140
|
const axisWidth = computeAxisComponentHeight(axisConfig, table);
|
|
140
141
|
if ("number" == typeof axisWidth) {
|
|
141
|
-
maxHeight = Math.max(axisWidth, maxHeight);
|
|
142
|
+
maxHeight = isValid(maxHeight) ? Math.max(axisWidth, maxHeight) : axisWidth;
|
|
142
143
|
continue;
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
if (table.isPivotChart() && (table.isLeftFrozenColumn(col) && table.isBottomFrozenRow(row) || table.isRightFrozenColumn(col) && table.isBottomFrozenRow(row))) continue;
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
const defaultHeight = table.getDefaultRowHeight(row);
|
|
150
|
-
maxHeight = Math.max(maxHeight, isNumber(defaultHeight) ? defaultHeight : table.defaultRowHeight);
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
const textHeight = computeTextHeight(col, row, cellType, table);
|
|
154
|
-
maxHeight = Math.max(textHeight, maxHeight);
|
|
148
|
+
const textHeight = computeTextHeight(col, row, table.isHeader(col, row) ? null === (_a = table._getHeaderLayoutMap(col, row)) || void 0 === _a ? void 0 : _a.headerType : table.getBodyColumnType(col, row), table);
|
|
149
|
+
maxHeight = isValid(maxHeight) ? Math.max(textHeight, maxHeight) : textHeight;
|
|
155
150
|
}
|
|
156
|
-
return maxHeight;
|
|
151
|
+
if (isValid(maxHeight)) return maxHeight;
|
|
152
|
+
const defaultHeight = table.getDefaultRowHeight(row);
|
|
153
|
+
return isNumber(defaultHeight) ? defaultHeight : table.defaultRowHeight;
|
|
157
154
|
}
|
|
158
155
|
|
|
159
156
|
function checkFixedStyleAndNoWrap(table) {
|
|
@@ -264,64 +261,66 @@ function computeTextHeight(col, row, cellType, table) {
|
|
|
264
261
|
}
|
|
265
262
|
const padding = getQuadProps(getProp("padding", actStyle, col, row, table)), fontSize = getProp("fontSize", actStyle, col, row, table), fontStyle = getProp("fontStyle", actStyle, col, row, table), fontWeight = getProp("fontWeight", actStyle, col, row, table), lineHeight = null !== (_b = getProp("lineHeight", actStyle, col, row, table)) && void 0 !== _b ? _b : fontSize, fontFamily = getProp("fontFamily", actStyle, col, row, table), autoWrapText = getProp("autoWrapText", actStyle, col, row, table);
|
|
266
263
|
let text;
|
|
267
|
-
text
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
264
|
+
if ("text" !== cellType && "link" !== cellType && "progressbar" !== cellType && "checkbox" !== cellType) maxHeight = lineHeight; else {
|
|
265
|
+
text = "checkbox" === cellType && isObject(cellValue) ? cellValue.text : cellValue;
|
|
266
|
+
const lines = validToString(text).split("\n") || [], cellWidth = table.getColsWidth(col, endCol);
|
|
267
|
+
if ("checkbox" === cellType) {
|
|
268
|
+
const size = getProp("size", actStyle, col, row, table);
|
|
269
|
+
if (autoWrapText) {
|
|
270
|
+
const spaceBetweenTextAndIcon = getProp("spaceBetweenTextAndIcon", actStyle, col, row, table), maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - size - spaceBetweenTextAndIcon;
|
|
271
|
+
utilCheckBoxMark.setAttributes({
|
|
272
|
+
text: {
|
|
273
|
+
maxLineWidth: maxLineWidth,
|
|
274
|
+
text: lines,
|
|
275
|
+
fontSize: fontSize,
|
|
276
|
+
fontStyle: fontStyle,
|
|
277
|
+
fontWeight: fontWeight,
|
|
278
|
+
fontFamily: fontFamily,
|
|
279
|
+
lineHeight: lineHeight,
|
|
280
|
+
wordBreak: "break-word"
|
|
281
|
+
},
|
|
282
|
+
icon: {
|
|
283
|
+
width: Math.floor(size / 1.4),
|
|
284
|
+
height: Math.floor(size / 1.4)
|
|
285
|
+
},
|
|
286
|
+
box: {
|
|
287
|
+
width: size,
|
|
288
|
+
height: size
|
|
289
|
+
},
|
|
290
|
+
spaceBetweenTextAndIcon: spaceBetweenTextAndIcon
|
|
291
|
+
}), utilCheckBoxMark.render(), maxHeight = utilTextMark.AABBBounds.height();
|
|
292
|
+
} else maxHeight = Math.max(size, lines.length * lineHeight);
|
|
293
|
+
} else if (iconInlineFront.length || iconInlineEnd.length) {
|
|
294
|
+
const textOption = Object.assign({
|
|
295
|
+
text: null == cellValue ? void 0 : cellValue.toString(),
|
|
296
|
+
fontFamily: fontFamily,
|
|
297
|
+
fontSize: fontSize,
|
|
298
|
+
fontStyle: fontStyle,
|
|
299
|
+
fontWeight: fontWeight,
|
|
300
|
+
lineHeight: lineHeight
|
|
301
|
+
});
|
|
302
|
+
textOption.textBaseline = "middle";
|
|
303
|
+
const textConfig = [ ...iconInlineFront.map((icon => dealWithRichTextIcon(icon))), textOption, ...iconInlineEnd.map((icon => dealWithRichTextIcon(icon))) ];
|
|
304
|
+
utilRichTextMark.setAttributes({
|
|
305
|
+
width: cellWidth - (padding[1] + padding[3]) - iconWidth,
|
|
306
|
+
height: 0,
|
|
307
|
+
textConfig: textConfig
|
|
308
|
+
}), maxHeight = utilRichTextMark.AABBBounds.height();
|
|
309
|
+
} else if (autoWrapText) {
|
|
310
|
+
const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;
|
|
311
|
+
utilTextMark.setAttributes({
|
|
312
|
+
maxLineWidth: maxLineWidth,
|
|
313
|
+
text: lines,
|
|
314
|
+
fontSize: fontSize,
|
|
315
|
+
fontStyle: fontStyle,
|
|
316
|
+
fontWeight: fontWeight,
|
|
317
|
+
fontFamily: fontFamily,
|
|
318
|
+
lineHeight: lineHeight,
|
|
319
|
+
wordBreak: "break-word",
|
|
320
|
+
whiteSpace: 1 !== lines.length || autoWrapText ? "normal" : "no-wrap"
|
|
321
|
+
}), maxHeight = utilTextMark.AABBBounds.height() || ("number" == typeof lineHeight ? lineHeight : fontSize);
|
|
322
|
+
} else maxHeight = lines.length * lineHeight;
|
|
323
|
+
}
|
|
325
324
|
return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;
|
|
326
325
|
}
|
|
327
326
|
|