@visactor/vtable 0.22.1 → 0.22.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/cjs/body-helper/style/Style.d.ts +3 -0
  2. package/cjs/body-helper/style/Style.js +22 -15
  3. package/cjs/body-helper/style/Style.js.map +1 -1
  4. package/cjs/core/BaseTable.d.ts +1 -1
  5. package/cjs/core/BaseTable.js +3 -2
  6. package/cjs/core/BaseTable.js.map +1 -1
  7. package/cjs/event/event.js +2 -1
  8. package/cjs/event/event.js.map +1 -1
  9. package/cjs/header-helper/style/Style.d.ts +3 -0
  10. package/cjs/header-helper/style/Style.js +26 -19
  11. package/cjs/header-helper/style/Style.js.map +1 -1
  12. package/cjs/index.d.ts +1 -1
  13. package/cjs/index.js +1 -1
  14. package/cjs/index.js.map +1 -1
  15. package/cjs/layout/tree-helper.js +1 -0
  16. package/cjs/plugins/themes.js +1 -2
  17. package/cjs/scenegraph/group-creater/cell-helper.js +3 -1
  18. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  19. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +5 -4
  20. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  21. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
  22. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  23. package/cjs/scenegraph/layout/compute-col-width.js +7 -4
  24. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  25. package/cjs/scenegraph/layout/compute-row-height.js +70 -71
  26. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  27. package/cjs/scenegraph/layout/update-height.js +18 -11
  28. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  29. package/cjs/scenegraph/layout/update-width.js +19 -13
  30. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  31. package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
  32. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  33. package/cjs/scenegraph/utils/text-measure.js +6 -6
  34. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  35. package/cjs/vrender.js.map +1 -1
  36. package/dist/vtable.js +183 -123
  37. package/dist/vtable.min.js +2 -2
  38. package/es/body-helper/style/Style.d.ts +3 -0
  39. package/es/body-helper/style/Style.js +22 -15
  40. package/es/body-helper/style/Style.js.map +1 -1
  41. package/es/core/BaseTable.d.ts +1 -1
  42. package/es/core/BaseTable.js +3 -2
  43. package/es/core/BaseTable.js.map +1 -1
  44. package/es/event/event.js +2 -1
  45. package/es/event/event.js.map +1 -1
  46. package/es/header-helper/style/Style.d.ts +3 -0
  47. package/es/header-helper/style/Style.js +26 -19
  48. package/es/header-helper/style/Style.js.map +1 -1
  49. package/es/index.d.ts +1 -1
  50. package/es/index.js +1 -1
  51. package/es/index.js.map +1 -1
  52. package/es/layout/tree-helper.js +2 -1
  53. package/es/plugins/themes.js +1 -2
  54. package/es/scenegraph/group-creater/cell-helper.js +2 -1
  55. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  56. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +6 -3
  57. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  58. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
  59. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  60. package/es/scenegraph/layout/compute-col-width.js +6 -4
  61. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  62. package/es/scenegraph/layout/compute-row-height.js +69 -70
  63. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  64. package/es/scenegraph/layout/update-height.js +16 -9
  65. package/es/scenegraph/layout/update-height.js.map +1 -1
  66. package/es/scenegraph/layout/update-width.js +19 -10
  67. package/es/scenegraph/layout/update-width.js.map +1 -1
  68. package/es/scenegraph/utils/text-icon-layout.js +1 -1
  69. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  70. package/es/scenegraph/utils/text-measure.js +6 -6
  71. package/es/scenegraph/utils/text-measure.js.map +1 -1
  72. package/es/vrender.js.map +1 -1
  73. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/layout/update-width.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAEzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAW5D,MAAM,UAAU,cAAc,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa,EAAE,iBAA2B;IACvG,IAAI,CAAC,iBAAiB,EAAE;QACtB,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,KA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AAK,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9F,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAGhD,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,UAAU,GAAG,SAAS,CAAC;QAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;YACzB,OAAO;SACR;QAED,sBAAsB,CACpB,KAAK,EACL,IAAI,EACJ,GAAG,EACH,GAAG,EACH,UAAU,EACV,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAClC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAC/B,CAAC;KACH;AACH,CAAC","file":"update-width.js","sourcesContent":["import type { IGraphic } from './../../vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport { resizeCellGroup, getCustomCellMergeCustom } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { computeRowHeight } from './compute-row-height';\nimport { updateCellHeightForRow } from './update-height';\nimport { getHierarchyOffset } from '../utils/get-hierarchy-offset';\nimport { getCellMergeRange } from '../../tools/merge-range';\nimport type { ColumnDefine } from '../../ts-types';\n// import { updateAutoRowHeight } from './auto-height';\n\n/**\n * @description: 更新指定列列宽,在拖拽调整列宽中使用\n * @param {Scenegraph} scene\n * @param {number} col\n * @param {number} detaX\n * @return {*}\n */\nexport function updateColWidth(scene: Scenegraph, col: number, detaX: number, skipTableWidthMap?: boolean) {\n if (!skipTableWidthMap) {\n scene.table._setColWidth(col, scene.table.getColWidth(col) + detaX, true);\n }\n\n const autoRowHeight = scene.table.heightMode === 'autoHeight';\n // deal with corner header or column header\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const rightTopColumn = scene.getColGroupInRightTopCorner(col);\n if (colOrCornerHeaderColumn && !rightTopColumn) {\n updateColunmWidth(colOrCornerHeaderColumn, detaX, autoRowHeight, 'col-corner', scene);\n }\n // deal with right bottom frozen cells\n if (rightTopColumn) {\n updateColunmWidth(rightTopColumn, detaX, autoRowHeight, 'right-top', scene);\n }\n\n // deal with row header or body or right frozen cells\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n if (rowHeaderOrBodyColumn) {\n updateColunmWidth(rowHeaderOrBodyColumn, detaX, autoRowHeight, 'row-body', scene);\n }\n\n const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);\n // deal with left bottom frozen cells\n if (leftBottomColumn) {\n updateColunmWidth(leftBottomColumn, detaX, autoRowHeight, 'left-bottom', scene);\n }\n // deal with bottom frozen cells\n const bottomColumn = scene.getColGroupInBottom(col);\n if (bottomColumn) {\n updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'bottom', scene);\n }\n // deal with right bottom frozen cells\n const rightBottomColumn = scene.getColGroupInRightBottomCorner(col);\n if (rightBottomColumn) {\n updateColunmWidth(rightBottomColumn, detaX, autoRowHeight, 'right-bottom', scene);\n }\n\n // 更新剩余列位置\n if (col < scene.frozenColCount) {\n scene.cornerHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.rowHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n } else {\n scene.colHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.bodyGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n if (leftBottomColumn) {\n scene.leftBottomCornerGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n if (bottomColumn) {\n scene.bottomFrozenGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n if (rightBottomColumn) {\n scene.rightBottomCornerGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n // scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);\n}\n\nfunction updateColunmWidth(\n columnGroup: Group,\n detaX: number,\n autoRowHeight: boolean,\n mode: 'col-corner' | 'row-body' | 'bottom' | 'left-bottom' | 'right-top' | 'right-bottom',\n scene: Scenegraph\n) {\n let needRerangeRow = false;\n // const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const oldColumnWidth = columnGroup?.attribute.width ?? 0;\n columnGroup?.setAttribute('width', oldColumnWidth + detaX);\n // 更新单元格宽度\n columnGroup?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n cell.col,\n cell.row,\n oldColumnWidth,\n oldColumnWidth + detaX,\n detaX,\n mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true,\n autoRowHeight,\n scene.table.internalProps.autoWrapText\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n let colGroup;\n let oldContainerHeight;\n let row;\n for (let col = 0; col < scene.table.colCount; col++) {\n // const colGroup = scene.getColGroup(col, true);\n if (mode === 'col-corner') {\n row = 0;\n colGroup = scene.getColGroup(col, true);\n oldContainerHeight = scene.colHeaderGroup.attribute.height ?? 0;\n } else if (mode === 'row-body') {\n row = scene.table.frozenRowCount;\n colGroup = scene.getColGroup(col, false);\n oldContainerHeight = scene.bodyGroup.attribute.height ?? 0;\n } else if (mode === 'bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInBottom(col);\n oldContainerHeight = scene.bottomFrozenGroup.attribute.height ?? 0;\n } else if (mode === 'left-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInLeftBottomCorner(col);\n oldContainerHeight = scene.leftBottomCornerGroup.attribute.height ?? 0;\n } else if (mode === 'right-top') {\n row = 0;\n colGroup = scene.getColGroupInRightTopCorner(col);\n oldContainerHeight = scene.rightTopCornerGroup.attribute.height ?? 0;\n } else if (mode === 'right-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInRightBottomCorner(col);\n oldContainerHeight = scene.rightBottomCornerGroup.attribute.height ?? 0;\n }\n if (!colGroup) {\n continue;\n }\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row) ?? 0;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(row, newTotalHeight - oldContainerHeight);\n //#region 修改bug:https://github.com/VisActor/VTable/issues/954 添加底部冻结行的三块区域\n for (let col = 0; col < scene.table.frozenColCount; col++) {\n const leftBottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);\n // reset cell y\n let y = 0;\n leftBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n for (let col = scene.table.colCount - scene.table.rightFrozenColCount; col < scene.table.colCount; col++) {\n const rightBottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);\n // reset cell y\n let y = 0;\n rightBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n\n for (let col = scene.table.frozenColCount; col < scene.table.colCount - scene.table.rightFrozenColCount; col++) {\n const rightBottomFrozenColumnGroup = scene.getColGroupInBottom(col);\n // reset cell y\n let y = 0;\n rightBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n //#endregion\n }\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n oldWidth: number, // old width, not dist\n distWidth: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoRowHeight: boolean,\n autoWrapText: boolean\n): boolean {\n if (cell.attribute.width === distWidth && !cell.needUpdateWidth) {\n return false;\n }\n cell.needUpdateWidth = false;\n\n cell.setAttribute('width', distWidth);\n // const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // if (mergeInfo && mergeInfo.start.row !== row) {\n // return false;\n // }\n const cellGroup = cell;\n // const distWidth = width + detaX;\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? (scene.table._getHeaderLayoutMap(col, row) as HeaderData).headerType\n : scene.table.getBodyColumnType(col, row);\n let isHeightChange = false;\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cellGroup.attribute.width,\n // cellGroup.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cellGroup.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cellGroup.insertBefore(newBarCell, oldBarCell);\n cellGroup.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cellGroup.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cellGroup,\n cellGroup.parent,\n cellGroup.attribute.x,\n cellGroup.attribute.y,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n updateImageCellContentWhileResize(cellGroup, col, row, scene.table);\n } else if (cellGroup.firstChild?.name === 'axis') {\n // recreate axis component\n const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n const cellStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', cellStyle, col, row, scene.table));\n if (axisConfig) {\n const axis = new CartesianAxis(\n axisConfig,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table\n );\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n }\n } else if (cell.firstChild?.name === 'axis') {\n (cell.firstChild as any)?.originAxis.resize(cell.attribute.width, cell.attribute.height);\n } else {\n let renderDefault = true;\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n if (!getCustomCellMergeCustom(col, row, cell, scene.table)) {\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellLocation(col, row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = (define as ColumnDefine)?.headerCustomRender;\n customLayout = (define as ColumnDefine)?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = (define as ColumnDefine)?.customRender || scene.table.customRender;\n customLayout = (define as ColumnDefine)?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n false,\n scene.table.heightMode === 'autoHeight',\n padding,\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n isHeightChange = true;\n }\n\n if (cell.childrenCount > 0 && customElementsGroup) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else if (customElementsGroup) {\n cell.appendChild(customElementsGroup);\n }\n }\n }\n\n if (renderDefault) {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n isHeightChange = updateMergeCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene.table\n );\n }\n }\n\n return autoRowHeight && autoWrapText ? isHeightChange : false;\n}\n\nfunction updateMergeCellContentWidth(\n cellGroup: Group,\n distWidth: number,\n detaX: number,\n autoRowHeight: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI\n) {\n if (isMergeCellGroup(cellGroup)) {\n distWidth = 0;\n let isHeightChange = false;\n for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {\n distWidth += table.getColWidth(col);\n }\n let cellHeight = 0;\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n cellHeight += table.getRowHeight(row);\n }\n\n const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const singleCellGroup = table.scenegraph.getCell(col, row);\n singleCellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: 0,\n dy: 0\n });\n });\n const changed = updateCellContentWidth(\n singleCellGroup,\n distWidth,\n cellHeight,\n detaX,\n autoRowHeight,\n padding,\n textAlign,\n textBaseline,\n table.scenegraph\n );\n\n // reset hierarchy offset\n const hierarchyOffset = getHierarchyOffset(singleCellGroup.col, singleCellGroup.row, table);\n if (hierarchyOffset) {\n const text = singleCellGroup.getChildByName('text');\n const icon = singleCellGroup.getChildByName('expand') || singleCellGroup.getChildByName('collapse');\n // icon-left deal with hierarchy offset, no need add to text dx\n if (icon?.role !== 'icon-left' && text) {\n text.setAttribute('dx', hierarchyOffset);\n }\n }\n\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n // const { width: contentWidth } = cellGroup.attribute;\n singleCellGroup.contentWidth = distWidth;\n\n const { heightChange } = resizeCellGroup(\n singleCellGroup,\n rangeWidth,\n rangeHeight,\n {\n start: {\n col: cellGroup.mergeStartCol,\n row: cellGroup.mergeStartRow\n },\n end: {\n col: cellGroup.mergeEndCol,\n row: cellGroup.mergeEndRow\n }\n },\n table\n );\n\n if (heightChange) {\n singleCellGroup.needUpdateHeight = true;\n }\n\n isHeightChange = isHeightChange || changed;\n }\n }\n return isHeightChange;\n }\n return updateCellContentWidth(\n cellGroup,\n distWidth,\n table.getRowHeight(cellGroup.row),\n detaX,\n autoRowHeight,\n padding,\n textAlign,\n textBaseline,\n table.scenegraph\n );\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n // 获取高度\n const maxHeight = Math.round(computeRowHeight(row, 0, scene.table.colCount - 1, scene.table));\n // 更新table行高存储\n scene.table._setRowHeight(row, maxHeight, true);\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n if (cell.role === 'empty') {\n return;\n }\n\n updateCellHeightForRow(\n scene,\n cell,\n col,\n row,\n distHeight,\n distHeight - cell.attribute.height,\n scene.table.isHeader(col, row)\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/layout/update-width.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAEzF,OAAO,EAAE,gBAAgB,E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CAAC,EACjC,KAAK,EACL,aAAa,EACb,OAAO,EACP,SAAS,EACT,YAAY,EACZ,KAAK,CAAC,UAAU,CACjB,CAAC;AACJ,CAAC;AAQD,SAAS,cAAc,CAAC,KAAiB,EAAE,GAAW;IAEpD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9F,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAGhD,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACnD,MAAM,UAAU,GAAG,SAAS,CAAC;QAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;YACzB,OAAO;SACR;QAED,sBAAsB,CACpB,KAAK,EACL,IAAI,EACJ,GAAG,EACH,GAAG,EACH,UAAU,EACV,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAClC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAC/B,CAAC;KACH;AACH,CAAC","file":"update-width.js","sourcesContent":["import type { IGraphic } from './../../vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport { resizeCellGroup, getCustomCellMergeCustom } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { isMergeCellGroup } from '../utils/is-merge-cell-group';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { computeRowHeight } from './compute-row-height';\nimport { updateCellHeightForRow } from './update-height';\nimport { getHierarchyOffset } from '../utils/get-hierarchy-offset';\nimport { getCellMergeRange } from '../../tools/merge-range';\nimport type { ColumnDefine } from '../../ts-types';\n// import { updateAutoRowHeight } from './auto-height';\n\n/**\n * @description: 更新指定列列宽,在拖拽调整列宽中使用\n * @param {Scenegraph} scene\n * @param {number} col\n * @param {number} detaX\n * @return {*}\n */\nexport function updateColWidth(scene: Scenegraph, col: number, detaX: number, skipTableWidthMap?: boolean) {\n if (!skipTableWidthMap) {\n scene.table._setColWidth(col, scene.table.getColWidth(col) + detaX, true);\n }\n\n const autoRowHeight = scene.table.heightMode === 'autoHeight';\n // deal with corner header or column header\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const rightTopColumn = scene.getColGroupInRightTopCorner(col);\n if (colOrCornerHeaderColumn && !rightTopColumn) {\n updateColunmWidth(colOrCornerHeaderColumn, detaX, autoRowHeight, 'col-corner', scene);\n }\n // deal with right bottom frozen cells\n if (rightTopColumn) {\n updateColunmWidth(rightTopColumn, detaX, autoRowHeight, 'right-top', scene);\n }\n\n // deal with row header or body or right frozen cells\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n if (rowHeaderOrBodyColumn) {\n updateColunmWidth(rowHeaderOrBodyColumn, detaX, autoRowHeight, 'row-body', scene);\n }\n\n const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);\n // deal with left bottom frozen cells\n if (leftBottomColumn) {\n updateColunmWidth(leftBottomColumn, detaX, autoRowHeight, 'left-bottom', scene);\n }\n // deal with bottom frozen cells\n const bottomColumn = scene.getColGroupInBottom(col);\n if (bottomColumn) {\n updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'bottom', scene);\n }\n // deal with right bottom frozen cells\n const rightBottomColumn = scene.getColGroupInRightBottomCorner(col);\n if (rightBottomColumn) {\n updateColunmWidth(rightBottomColumn, detaX, autoRowHeight, 'right-bottom', scene);\n }\n\n // 更新剩余列位置\n if (col < scene.frozenColCount) {\n scene.cornerHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.rowHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n } else {\n scene.colHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.bodyGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n if (leftBottomColumn) {\n scene.leftBottomCornerGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n if (bottomColumn) {\n scene.bottomFrozenGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n if (rightBottomColumn) {\n scene.rightBottomCornerGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n // scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);\n}\n\nfunction updateColunmWidth(\n columnGroup: Group,\n detaX: number,\n autoRowHeight: boolean,\n mode: 'col-corner' | 'row-body' | 'bottom' | 'left-bottom' | 'right-top' | 'right-bottom',\n scene: Scenegraph\n) {\n let needRerangeRow = false;\n // const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const oldColumnWidth = columnGroup?.attribute.width ?? 0;\n columnGroup?.setAttribute('width', oldColumnWidth + detaX);\n // 更新单元格宽度\n columnGroup?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n cell.col,\n cell.row,\n oldColumnWidth,\n oldColumnWidth + detaX,\n detaX,\n mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true,\n autoRowHeight,\n scene.table.internalProps.autoWrapText\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n let colGroup;\n let oldContainerHeight;\n let row;\n for (let col = 0; col < scene.table.colCount; col++) {\n // const colGroup = scene.getColGroup(col, true);\n if (mode === 'col-corner') {\n row = 0;\n colGroup = scene.getColGroup(col, true);\n oldContainerHeight = scene.colHeaderGroup.attribute.height ?? 0;\n } else if (mode === 'row-body') {\n row = scene.table.frozenRowCount;\n colGroup = scene.getColGroup(col, false);\n oldContainerHeight = scene.bodyGroup.attribute.height ?? 0;\n } else if (mode === 'bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInBottom(col);\n oldContainerHeight = scene.bottomFrozenGroup.attribute.height ?? 0;\n } else if (mode === 'left-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInLeftBottomCorner(col);\n oldContainerHeight = scene.leftBottomCornerGroup.attribute.height ?? 0;\n } else if (mode === 'right-top') {\n row = 0;\n colGroup = scene.getColGroupInRightTopCorner(col);\n oldContainerHeight = scene.rightTopCornerGroup.attribute.height ?? 0;\n } else if (mode === 'right-bottom') {\n row = scene.table.rowCount - scene.table.bottomFrozenRowCount;\n colGroup = scene.getColGroupInRightBottomCorner(col);\n oldContainerHeight = scene.rightBottomCornerGroup.attribute.height ?? 0;\n }\n if (!colGroup) {\n continue;\n }\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row) ?? 0;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(row, newTotalHeight - oldContainerHeight);\n //#region 修改bug:https://github.com/VisActor/VTable/issues/954 添加底部冻结行的三块区域\n for (let col = 0; col < scene.table.frozenColCount; col++) {\n const leftBottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);\n // reset cell y\n let y = 0;\n leftBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n for (let col = scene.table.colCount - scene.table.rightFrozenColCount; col < scene.table.colCount; col++) {\n const rightBottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);\n // reset cell y\n let y = 0;\n rightBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n\n for (let col = scene.table.frozenColCount; col < scene.table.colCount - scene.table.rightFrozenColCount; col++) {\n const rightBottomFrozenColumnGroup = scene.getColGroupInBottom(col);\n // reset cell y\n let y = 0;\n rightBottomFrozenColumnGroup?.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += scene.table.getRowHeight(cellGroup.row);\n });\n }\n //#endregion\n }\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n oldWidth: number, // old width, not dist\n distWidth: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoRowHeight: boolean,\n autoWrapText: boolean\n): boolean {\n if (cell.attribute.width === distWidth && !cell.needUpdateWidth) {\n return false;\n }\n cell.needUpdateWidth = false;\n\n cell.setAttribute('width', distWidth);\n // const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // if (mergeInfo && mergeInfo.start.row !== row) {\n // return false;\n // }\n const cellGroup = cell;\n // const distWidth = width + detaX;\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? (scene.table._getHeaderLayoutMap(col, row) as HeaderData).headerType\n : scene.table.getBodyColumnType(col, row);\n let isHeightChange = false;\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cellGroup.attribute.width,\n // cellGroup.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cellGroup.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cellGroup.insertBefore(newBarCell, oldBarCell);\n cellGroup.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cellGroup.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cellGroup,\n cellGroup.parent,\n cellGroup.attribute.x,\n cellGroup.attribute.y,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table,\n getStyleTheme(headerStyle, scene.table, col, row, getProp).theme\n );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n updateImageCellContentWhileResize(cellGroup, col, row, scene.table);\n } else if (cellGroup.firstChild?.name === 'axis') {\n // recreate axis component\n const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n const cellStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', cellStyle, col, row, scene.table));\n if (axisConfig) {\n const axis = new CartesianAxis(\n axisConfig,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table\n );\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n }\n } else if (cell.firstChild?.name === 'axis') {\n (cell.firstChild as any)?.originAxis.resize(cell.attribute.width, cell.attribute.height);\n } else {\n let renderDefault = true;\n const customContainer = cell.getChildByName('custom-container') as Group;\n if (customContainer) {\n let customElementsGroup;\n customContainer.removeAllChild();\n cell.removeChild(customContainer);\n\n if (!getCustomCellMergeCustom(col, row, cell, scene.table)) {\n let customRender;\n let customLayout;\n const cellType = scene.table.getCellLocation(col, row);\n if (cellType !== 'body') {\n const define = scene.table.getHeaderDefine(col, row);\n customRender = (define as ColumnDefine)?.headerCustomRender;\n customLayout = (define as ColumnDefine)?.headerCustomLayout;\n } else {\n const define = scene.table.getBodyColumnDefine(col, row);\n customRender = (define as ColumnDefine)?.customRender || scene.table.customRender;\n customLayout = (define as ColumnDefine)?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n let width = cellGroup.attribute.width;\n let height = cellGroup.attribute.height;\n if (isMergeCellGroup(cellGroup)) {\n width = scene.table.getColsWidth(cellGroup.mergeStartCol, cellGroup.mergeEndCol);\n height = scene.table.getRowsHeight(cellGroup.mergeStartRow, cellGroup.mergeEndRow);\n }\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n width,\n height,\n false,\n scene.table.heightMode === 'autoHeight',\n padding,\n scene.table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n isHeightChange = true;\n }\n\n if (cell.childrenCount > 0 && customElementsGroup) {\n cell.insertBefore(customElementsGroup, cell.firstChild);\n } else if (customElementsGroup) {\n cell.appendChild(customElementsGroup);\n }\n }\n }\n const cellChange = updateMergeCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n renderDefault,\n scene.table\n );\n isHeightChange = isHeightChange || cellChange;\n }\n\n return autoRowHeight && autoWrapText ? isHeightChange : false;\n}\n\nfunction updateMergeCellContentWidth(\n cellGroup: Group,\n distWidth: number,\n detaX: number,\n autoRowHeight: boolean,\n renderDefault: boolean,\n table: BaseTableAPI\n) {\n if (isMergeCellGroup(cellGroup)) {\n distWidth = 0;\n let isHeightChange = false;\n for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {\n distWidth += table.getColWidth(col);\n }\n let cellHeight = 0;\n for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {\n cellHeight += table.getRowHeight(row);\n }\n\n const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n if (col === cellGroup.col && row !== cellGroup.row) {\n continue;\n }\n const singleCellGroup = table.scenegraph.getCell(col, row);\n singleCellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: 0,\n dy: 0\n });\n });\n\n let changed = false;\n if (renderDefault) {\n // 处理文字\n const style = table._getCellStyle(col, row);\n const padding = getQuadProps(style.padding as number);\n const textAlign = style.textAlign;\n const textBaseline = style.textBaseline;\n changed = updateCellContentWidth(\n singleCellGroup,\n distWidth,\n cellHeight,\n detaX,\n autoRowHeight,\n padding,\n textAlign,\n textBaseline,\n table.scenegraph\n );\n\n // reset hierarchy offset\n const hierarchyOffset = getHierarchyOffset(singleCellGroup.col, singleCellGroup.row, table);\n if (hierarchyOffset) {\n const text = singleCellGroup.getChildByName('text');\n const icon = singleCellGroup.getChildByName('expand') || singleCellGroup.getChildByName('collapse');\n // icon-left deal with hierarchy offset, no need add to text dx\n if (icon?.role !== 'icon-left' && text) {\n text.setAttribute('dx', hierarchyOffset);\n }\n }\n }\n\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n // const { width: contentWidth } = cellGroup.attribute;\n singleCellGroup.contentWidth = distWidth;\n\n const { heightChange } = resizeCellGroup(\n singleCellGroup,\n rangeWidth,\n rangeHeight,\n {\n start: {\n col: cellGroup.mergeStartCol,\n row: cellGroup.mergeStartRow\n },\n end: {\n col: cellGroup.mergeEndCol,\n row: cellGroup.mergeEndRow\n }\n },\n table\n );\n\n if (heightChange) {\n singleCellGroup.needUpdateHeight = true;\n }\n\n isHeightChange = isHeightChange || changed;\n }\n }\n return isHeightChange;\n }\n\n // 处理文字\n const style = table._getCellStyle(cellGroup.col, cellGroup.row);\n const padding = getQuadProps(style.padding as number);\n const textAlign = style.textAlign;\n const textBaseline = style.textBaseline;\n return updateCellContentWidth(\n cellGroup,\n distWidth,\n table.getRowHeight(cellGroup.row),\n detaX,\n autoRowHeight,\n padding,\n textAlign,\n textBaseline,\n table.scenegraph\n );\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n // 获取高度\n const maxHeight = Math.round(computeRowHeight(row, 0, scene.table.colCount - 1, scene.table));\n // 更新table行高存储\n scene.table._setRowHeight(row, maxHeight, true);\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n if (cell.role === 'empty') {\n return;\n }\n\n updateCellHeightForRow(\n scene,\n cell,\n col,\n row,\n distHeight,\n distHeight - cell.attribute.height,\n scene.table.isHeader(col, row)\n );\n }\n}\n"]}
@@ -169,7 +169,7 @@ export function dealWithIcon(icon, mark, col, row, range, table) {
169
169
  if (isNumber(col) && isNumber(row) && table && (icon.funcType === IconFuncTypeEnum.collapse || icon.funcType === IconFuncTypeEnum.expand) && (hierarchyOffset = range ? getHierarchyOffset(range.start.col, range.start.row, table) : getHierarchyOffset(col, row, table)),
170
170
  iconAttribute.marginLeft = (null !== (_b = icon.marginLeft) && void 0 !== _b ? _b : 0) + hierarchyOffset,
171
171
  iconAttribute.marginRight = null !== (_c = icon.marginRight) && void 0 !== _c ? _c : 0,
172
- icon.interactive && (iconAttribute.pickable = !1), icon.hover && (iconAttribute.backgroundWidth = null !== (_d = icon.hover.width) && void 0 !== _d ? _d : icon.width,
172
+ !1 === icon.interactive && (iconAttribute.pickable = !1), icon.hover && (iconAttribute.backgroundWidth = null !== (_d = icon.hover.width) && void 0 !== _d ? _d : icon.width,
173
173
  iconAttribute.backgroundHeight = null !== (_e = icon.hover.width) && void 0 !== _e ? _e : icon.width,
174
174
  iconAttribute.backgroundColor = null !== (_f = icon.hover.bgColor) && void 0 !== _f ? _f : "rgba(22,44,66,0.2)",
175
175
  iconAttribute.hoverImage = icon.hover.image), icon.cursor && (iconAttribute.cursor = icon.cursor),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/utils/text-icon-layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,gBAA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AAC,CAAC,CAAC;QACtE,KAAK,IAAI,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;YAClF,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAE/C,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE;gBAEtD,OAAO,IAAI,CAAC;aACb;iBAAM,IAAI,SAAS,GAAG,SAAS,EAAE;gBAEhC,OAAO,IAAI,CAAC;aACb;SACF;KACF;SAAM;QACL,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAEpD,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE;YAEtD,OAAO,IAAI,CAAC;SACb;aAAM,IAAI,SAAS,GAAG,SAAS,EAAE;YAEhC,OAAO,IAAI,CAAC;SACb;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC","file":"text-icon-layout.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IThemeSpec } from './../../vrender';\nimport { RichText, Text } from './../../vrender';\nimport { convertInternal } from '../../tools/util';\nimport type { CellRange, ColumnIconOption } from '../../ts-types';\nimport { IconFuncTypeEnum, IconPosition } from '../../ts-types';\nimport { CellContent } from '../component/cell-content';\nimport type { Group } from '../graphic/group';\nimport { Icon } from '../graphic/icon';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from './get-cell-merge';\nimport { getHierarchyOffset } from './get-hierarchy-offset';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isNil, isNumber, isValid } from '@visactor/vutils';\nimport { isMergeCellGroup } from './is-merge-cell-group';\n\n/**\n * @description: 创建单元格内容\n * cellGroup\n * |-- content\n * |-- leftContentIcons\n * |-- rightContentIcons\n * |-- wrapText / richtext\n * |-- leftIcons\n * |-- rightIcons\n * |-- absoluteIcons\n * @param {ColumnIconOption} icons\n * @param {string} textStr\n * @param {array} padding\n * @param {boolean} autoColWidth\n * @param {boolean} autoRowHeight\n * @param {boolean} autoWrapText\n * @param {number} cellWidth\n * @param {number} cellHeight\n * @param {CanvasTextAlign} textAlign\n * @param {CanvasTextBaseline} textBaseline\n * @return {*}\n */\nexport function createCellContent(\n cellGroup: Group,\n icons: ColumnIconOption[] | null,\n textStr: string,\n padding: [number, number, number, number],\n autoColWidth: boolean,\n autoRowHeight: boolean,\n autoWrapText: boolean,\n lineClamp: number | undefined,\n cellWidth: number,\n cellHeight: number,\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI,\n cellTheme: IThemeSpec,\n range: CellRange | undefined\n) {\n const leftIcons: ColumnIconOption[] = [];\n const rightIcons: ColumnIconOption[] = [];\n const contentLeftIcons: ColumnIconOption[] = [];\n const contentRightIcons: ColumnIconOption[] = [];\n const inlineFrontIcons: ColumnIconOption[] = [];\n const inlineEndIcons: ColumnIconOption[] = [];\n const absoluteLeftIcons: ColumnIconOption[] = [];\n const absoluteRightIcons: ColumnIconOption[] = [];\n\n let contentWidth: number;\n let contentHeight: number;\n let leftIconWidth = 0;\n let leftIconHeight = 0;\n let rightIconWidth = 0;\n let rightIconHeight = 0;\n let absoluteLeftIconWidth = 0;\n let absoluteRightIconWidth = 0;\n\n if (!Array.isArray(icons) || icons.length === 0) {\n if (isValid(textStr)) {\n // 没有icon,cellGroup只添加WrapText\n const text = convertInternal(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n\n const hierarchyOffset = range\n ? getHierarchyOffset(range.start.col, range.start.row, table)\n : getHierarchyOffset(cellGroup.col, cellGroup.row, table);\n\n let _contentOffset = 0;\n if (isNumber(table.theme._contentOffset)) {\n if (textAlign === 'left') {\n _contentOffset = table.theme._contentOffset;\n } else if (textAlign === 'right') {\n _contentOffset = -table.theme._contentOffset;\n }\n }\n\n const attribute = {\n text: text.length === 1 ? text[0] : text,\n maxLineWidth: autoColWidth ? Infinity : cellWidth - (padding[1] + padding[3] + hierarchyOffset),\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),\n pickable: false,\n dx: hierarchyOffset + _contentOffset,\n whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'\n };\n const wrapText = new Text(cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute);\n wrapText.name = 'text';\n (wrapText as any).textBaseline = textBaseline;\n\n cellGroup.appendChild(wrapText);\n\n contentWidth = wrapText.AABBBounds.width();\n contentHeight = wrapText.AABBBounds.height();\n }\n } else {\n // icon分类\n icons.forEach(icon => {\n switch (icon.positionType) {\n case IconPosition.left:\n leftIcons.push(icon);\n break;\n case IconPosition.right:\n rightIcons.push(icon);\n break;\n case IconPosition.contentLeft:\n contentLeftIcons.push(icon);\n break;\n case IconPosition.contentRight:\n contentRightIcons.push(icon);\n break;\n // case IconPosition.absoluteLeft:\n // absoluteLeftIcons.push(icon);\n // break;\n case IconPosition.absoluteRight:\n absoluteRightIcons.push(icon);\n break;\n case IconPosition.inlineFront:\n inlineFrontIcons.push(icon);\n break;\n case IconPosition.inlineEnd:\n inlineEndIcons.push(icon);\n break;\n }\n });\n\n // 添加非cell icon & absolute icon\n leftIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-left';\n iconMark.name = icon.name;\n iconMark.setAttribute('x', leftIconWidth + (iconMark.attribute.marginLeft ?? 0));\n leftIconWidth +=\n iconMark.AABBBounds.width() + (iconMark.attribute.marginLeft ?? 0) + (iconMark.attribute.marginRight ?? 0);\n leftIconHeight = Math.max(leftIconHeight, iconMark.AABBBounds.height());\n cellGroup.appendChild(iconMark);\n });\n\n rightIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-right';\n iconMark.name = icon.name;\n iconMark.setAttribute('x', rightIconWidth + (iconMark.attribute.marginLeft ?? 0));\n rightIconWidth +=\n iconMark.AABBBounds.width() + (iconMark.attribute.marginLeft ?? 0) + (iconMark.attribute.marginRight ?? 0);\n rightIconHeight = Math.max(rightIconHeight, iconMark.AABBBounds.height());\n cellGroup.appendChild(iconMark);\n });\n\n absoluteLeftIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-absolute-left';\n iconMark.name = icon.name;\n iconMark.setAttribute('x', absoluteLeftIconWidth + (iconMark.attribute.marginLeft ?? 0));\n absoluteLeftIconWidth +=\n iconMark.AABBBounds.width() + (iconMark.attribute.marginLeft ?? 0) + (iconMark.attribute.marginRight ?? 0);\n cellGroup.appendChild(iconMark);\n });\n\n absoluteRightIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-absolute-right';\n iconMark.name = icon.name;\n iconMark.setAttribute('x', absoluteRightIconWidth + (iconMark.attribute.marginLeft ?? 0));\n absoluteRightIconWidth +=\n iconMark.AABBBounds.width() + (iconMark.attribute.marginLeft ?? 0) + (iconMark.attribute.marginRight ?? 0);\n cellGroup.appendChild(iconMark);\n });\n\n // 添加text & content icon & inline icon\n let textMark;\n // 直接添加richtext / wrapText\n if (inlineFrontIcons.length === 0 && inlineEndIcons.length === 0) {\n let _contentOffset = 0;\n if (isNumber(table.theme._contentOffset)) {\n if (textAlign === 'left') {\n _contentOffset = table.theme._contentOffset;\n } else if (textAlign === 'right') {\n _contentOffset = -table.theme._contentOffset;\n }\n }\n const hierarchyOffset = range\n ? getHierarchyOffset(range.start.col, range.start.row, table)\n : getHierarchyOffset(cellGroup.col, cellGroup.row, table);\n const text = convertInternal(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n const attribute = {\n text: text.length === 1 ? text[0] : text,\n maxLineWidth: autoColWidth\n ? Infinity\n : cellWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth - hierarchyOffset,\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),\n pickable: false,\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal',\n dx: _contentOffset + (!contentLeftIcons.length && !contentRightIcons.length ? hierarchyOffset : 0)\n };\n const wrapText = new Text(cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute);\n wrapText.name = 'text';\n textMark = wrapText;\n } else {\n const textOption = Object.assign(\n {\n text: textStr?.toString()\n },\n (cellGroup.parent as Group)?.theme?.userTheme?.text || {}\n );\n if (cellTheme.text) {\n Object.assign(textOption, cellTheme.text);\n }\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...inlineFrontIcons.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...inlineEndIcons.map(icon => dealWithRichTextIcon(icon))\n ];\n textConfig[0].textAlign = textAlign;\n const text = new RichText({\n width: autoColWidth ? 0 : cellWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth,\n height: autoRowHeight ? 0 : cellHeight - (padding[0] + padding[2]),\n textConfig,\n verticalDirection: autoRowHeight ? 'top' : (textBaseline as any),\n\n ellipsis: textOption.ellipsis\n // verticalDirection: textBaseline as any\n // textAlign: textAlign as any,\n // textBaseline: textBaseline as any,\n });\n text.name = 'text';\n textMark = text;\n text.bindIconEvent();\n }\n\n if (contentLeftIcons.length !== 0 || contentRightIcons.length !== 0) {\n // 创建CellContent处理conten icon;有content icon,cellGroup: CellIcons + cellContent\n\n const cellContent = new CellContent({\n // x: padding[3] + leftIconWidth,\n // y: padding[0],\n x: 0,\n y: 0,\n fill: false,\n stroke: false\n // pickable: false,\n });\n cellContent.name = 'content';\n\n cellContent.setCellContentOption({\n autoWidth: autoColWidth,\n autoHeight: autoRowHeight,\n cellWidth: cellWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth,\n cellHeight: cellHeight - (padding[0] + padding[2]),\n align: textAlign,\n baseline: textBaseline\n });\n\n contentLeftIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-content-left';\n iconMark.name = icon.name;\n cellContent.addLeftOccupyingIcon(iconMark);\n });\n contentRightIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-content-right';\n iconMark.name = icon.name;\n cellContent.addRightOccupyingIcon(iconMark);\n });\n cellContent.addContent(textMark);\n\n cellGroup.appendChild(cellContent);\n cellContent.layout();\n\n contentWidth = cellContent.AABBBounds.width();\n contentHeight = cellContent.AABBBounds.height();\n } else {\n // 没有content icon,cellGroup: CellIcons + wrapText/richtext\n // cellGroup.appendChild(textMark);\n if (cellGroup.firstChild) {\n cellGroup.insertBefore(textMark, cellGroup.firstChild);\n } else {\n cellGroup.appendChild(textMark);\n }\n contentWidth = textMark.AABBBounds.width();\n contentHeight = textMark.AABBBounds.height();\n }\n }\n\n // 内容添加后单元格的宽高\n const width = autoColWidth\n ? leftIconWidth + contentWidth + rightIconWidth // + padding[1] + padding[3]\n : cellWidth - (padding[1] + padding[3]);\n // const height = autoRowHeight\n // ? Math.max(leftIconHeight, contentHeight, rightIconHeight) // + padding[0] + padding[2]\n // : cellHeight - (padding[0] + padding[2]);\n const height = cellHeight - (padding[0] + padding[2]);\n\n // 更新各个部分横向位置\n cellGroup.forEachChildren((child: any) => {\n if (child.role === 'icon-left') {\n child.setAttribute('x', child.attribute.x + padding[3]);\n } else if (child.role === 'icon-right') {\n child.setAttribute('x', child.attribute.x + width - rightIconWidth + padding[3]);\n } else if (child.role === 'icon-absolute-right') {\n child.setAttribute('x', child.attribute.x + width - absoluteRightIconWidth + padding[3] + padding[1]);\n } else if (child.name === 'content' || child.name === 'text') {\n if (textAlign === 'center' && child.type !== 'richtext') {\n child.setAttribute('x', padding[3] + leftIconWidth + (width - leftIconWidth - rightIconWidth) / 2);\n } else if (textAlign === 'right' && child.type !== 'richtext') {\n child.setAttribute('x', padding[3] + width - rightIconWidth);\n } else {\n child.setAttribute('x', padding[3] + leftIconWidth);\n }\n }\n });\n\n // 更新各个部分纵向位置\n cellGroup.forEachChildren((child: any) => {\n if (textBaseline === 'middle') {\n child.setAttribute('y', padding[0] + (height - child.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n child.setAttribute('y', padding[0] + height - child.AABBBounds.height());\n } else {\n child.setAttribute('y', padding[0]);\n }\n });\n\n // 更新cell Group宽高\n cellGroup.setAttributes({\n width: width + padding[1] + padding[3],\n height: height + padding[0] + padding[2]\n } as any);\n}\n\n/**\n * @description: icon option生成icon mark\n * @param {ColumnIconOption} icon\n * @return {*}\n */\nexport function dealWithIcon(\n icon: ColumnIconOption,\n mark?: Icon,\n col?: number,\n row?: number,\n range?: CellRange,\n table?: BaseTableAPI\n): Icon {\n // positionType在外部处理\n const iconAttribute = {} as any;\n\n // 图片内容\n if (icon.type === 'image') {\n iconAttribute.image = icon.src;\n } else if (icon.type === 'svg' || 'svg' in icon) {\n iconAttribute.image = icon.svg;\n // } else if (icon.type === 'path') {\n // // to do: 暂不支持\n // } else if (icon.type === 'font') {\n // // to do: 暂不支持\n }\n\n // name\n // iconAttribute.name = icon.name;\n iconAttribute.width = icon.width;\n iconAttribute.height = icon.height;\n iconAttribute.visibleTime = icon.visibleTime ?? 'always';\n iconAttribute.funcType = icon.funcType;\n iconAttribute.interactive = icon.interactive;\n\n let hierarchyOffset = 0;\n if (\n isNumber(col) &&\n isNumber(row) &&\n table &&\n (icon.funcType === IconFuncTypeEnum.collapse || icon.funcType === IconFuncTypeEnum.expand)\n ) {\n // compute hierarchy offset\n // hierarchyOffset = getHierarchyOffset(col, row, table);\n hierarchyOffset = range\n ? getHierarchyOffset(range.start.col, range.start.row, table)\n : getHierarchyOffset(col, row, table);\n }\n\n iconAttribute.marginLeft = (icon.marginLeft ?? 0) + hierarchyOffset;\n iconAttribute.marginRight = icon.marginRight ?? 0;\n\n if (icon.interactive) {\n iconAttribute.pickable = false;\n }\n\n if (icon.hover) {\n iconAttribute.backgroundWidth = icon.hover.width ?? icon.width;\n iconAttribute.backgroundHeight = icon.hover.width ?? icon.width;\n iconAttribute.backgroundColor = icon.hover.bgColor ?? 'rgba(22,44,66,0.2)';\n iconAttribute.hoverImage = icon.hover.image;\n }\n\n if (icon.cursor) {\n iconAttribute.cursor = icon.cursor;\n }\n\n if ('shape' in icon && icon.shape === 'circle') {\n iconAttribute.shape = icon.shape;\n }\n\n if (mark) {\n mark.setAttributes(iconAttribute);\n mark.loadImage(iconAttribute.image);\n return mark;\n }\n // funcType, cursor, tooltip, hover在事件响应阶段处理\n const iconMark = new Icon(iconAttribute);\n iconMark.tooltip = icon.tooltip;\n\n return iconMark;\n}\n\n/**\n * @description: icon option生成richtext icon config\n * @param {ColumnIconOption} icon\n * @return {*}\n */\nexport function dealWithRichTextIcon(icon: ColumnIconOption) {\n // positionType在外部处理\n const config = {} as any;\n\n // 图片内容\n if (icon.type === 'image') {\n config.image = icon.src;\n } else if (icon.type === 'svg' || 'svg' in icon) {\n config.image = icon.svg;\n // } else if (icon.type === 'path') {\n // // to do: 暂不支持\n // } else if (icon.type === 'font') {\n // // to do: 暂不支持\n }\n\n // name\n config.visibleTime = icon.visibleTime ?? 'always';\n config.funcType = icon.funcType;\n config.id = icon.name;\n config.width = icon.width;\n config.height = icon.height;\n\n if (icon.marginRight || icon.marginLeft) {\n config.margin = [0, icon.marginRight ?? 0, 0, icon.marginLeft ?? 0];\n }\n\n if (icon.hover) {\n config.backgroundWidth = icon.hover.width ?? icon.width;\n config.backgroundHeight = icon.hover.height ?? icon.height;\n config.backgroundShowMode = 'hover';\n config.hoverImage = icon.hover.image;\n config.backgroundStroke = false;\n config.backgroundFill = icon.hover.bgColor ?? 'rgba(22,44,66,0.2)';\n }\n\n if (icon.cursor) {\n config.cursor = icon.cursor;\n }\n\n config.tooltip = icon.tooltip;\n\n // funcType, cursor, tooltip在事件响应阶段处理\n return config;\n}\n\n/**\n * @description: 更新单元格内容宽度\n * @param {Group} cellGroup\n * @param {number} distWidth\n * @param {boolean} autoRowHeight\n * @return {*}\n */\nexport function updateCellContentWidth(\n cellGroup: Group,\n distWidth: number,\n cellHeight: number,\n detaX: number,\n autoRowHeight: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n scene: Scenegraph\n): boolean {\n let leftIconWidth = 0;\n let leftIconHeight = 0;\n let rightIconWidth = 0;\n let rightIconHeight = 0;\n // let hasIcon = false;\n cellGroup.forEachChildren((iconMark: Icon) => {\n if (iconMark.role === 'icon-left') {\n leftIconWidth += iconMark.AABBBounds.width();\n leftIconHeight = Math.max(leftIconHeight, iconMark.AABBBounds.height());\n } else if (iconMark.role === 'icon-right') {\n rightIconWidth += iconMark.AABBBounds.width();\n rightIconHeight = Math.max(rightIconHeight, iconMark.AABBBounds.height());\n }\n });\n\n // 记录原始内容高度\n let oldTextHeight;\n const textMark = cellGroup.getChildByName('text');\n const cellContent = cellGroup.getChildByName('content') as CellContent;\n let contentHeight: number;\n if (textMark instanceof Text) {\n oldTextHeight = textMark.AABBBounds.height();\n textMark.setAttribute('maxLineWidth', distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]));\n // contentWidth = textMark.AABBBounds.width();\n contentHeight = textMark.AABBBounds.height();\n } else if (textMark instanceof RichText) {\n oldTextHeight = textMark.AABBBounds.height();\n textMark.setAttribute('width', distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]));\n // contentWidth = textMark.AABBBounds.width();\n contentHeight = textMark.AABBBounds.height();\n } else if (cellContent) {\n oldTextHeight = cellContent.AABBBounds.height();\n cellContent.updateWidth(distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]));\n // contentWidth = cellContent.AABBBounds.width();\n contentHeight = cellContent.AABBBounds.height();\n }\n\n const oldCellHeight = Math.max(leftIconHeight, rightIconHeight, oldTextHeight) + padding[0] + padding[2];\n\n // 更新x方向位置\n cellGroup.forEachChildren((child: any) => {\n if (child.role === 'icon-left') {\n // do nothing\n } else if (child.role === 'icon-right') {\n child.setAttribute('x', child.attribute.x + detaX);\n } else if (child.role === 'icon-absolute-right') {\n child.setAttribute('x', child.attribute.x + detaX);\n } else if (child.name === 'content' || child.name === 'text') {\n const childTextAlign = child.attribute.textAlign ?? textAlign;\n if (childTextAlign === 'center') {\n child.setAttribute(\n 'x',\n padding[3] + leftIconWidth + (distWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth) / 2\n );\n } else if (childTextAlign === 'right') {\n child.setAttribute('x', padding[3] + distWidth - (padding[1] + padding[3]) - rightIconWidth);\n } else {\n // left: do nothing\n }\n } else if (child.name === 'mark') {\n child.setAttribute('x', cellGroup.attribute.width);\n }\n });\n\n // 如果autoRowHeight && 高度改变 更新y方向位置\n if (autoRowHeight) {\n let newHeight = Math.max(leftIconHeight, contentHeight, rightIconHeight); // + padding[0] + padding[2]\n\n if (isCellHeightUpdate(scene, cellGroup, newHeight + padding[0] + padding[2], oldCellHeight)) {\n // cellGroup.setAttribute('height', newHeight + padding[0] + padding[2]);\n return true;\n }\n\n newHeight = (cellGroup.contentHeight ?? cellHeight) - (padding[0] + padding[2]);\n\n cellGroup.forEachChildren((child: any) => {\n if (child.type === 'rect' || child.type === 'chart') {\n return;\n }\n if (child.name === 'mark') {\n child.setAttribute('y', 0);\n } else if (textBaseline === 'middle') {\n child.setAttribute('y', padding[0] + (newHeight - child.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n child.setAttribute('y', padding[0] + newHeight - child.AABBBounds.height());\n } else {\n child.setAttribute('y', padding[0]);\n }\n });\n } else if (textBaseline === 'middle' || textBaseline === 'bottom') {\n cellGroup.forEachChildren((child: any) => {\n if (child.type === 'rect' || child.type === 'chart') {\n return;\n }\n if (child.name === 'mark') {\n child.setAttribute('y', 0);\n } else if (textBaseline === 'middle') {\n child.setAttribute('y', (cellHeight - padding[2] + padding[0] - child.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n child.setAttribute('y', cellHeight - child.AABBBounds.height() - padding[2]);\n } else {\n child.setAttribute('y', padding[0]);\n }\n });\n }\n return false;\n}\n\n/**\n * @description: 更新单元格内容宽度\n */\nexport function updateCellContentHeight(\n cellGroup: Group,\n distHeight: number,\n detaY: number,\n autoRowHeight: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline\n) {\n const newHeight = distHeight - (padding[0] + padding[2]);\n\n const textMark = cellGroup.getChildByName('text');\n\n if (textMark instanceof Text && !autoRowHeight) {\n textMark.setAttributes({\n heightLimit: newHeight\n } as any);\n } else if (textMark instanceof RichText && !autoRowHeight) {\n textMark.setAttributes({\n height: newHeight\n });\n } else if (cellGroup.getChildByName('content')) {\n const cellContent = cellGroup.getChildByName('content') as CellContent;\n cellContent.updateHeight(newHeight);\n }\n\n // 更新y方向位置\n cellGroup.forEachChildren((child: any) => {\n child.setAttribute('dy', 0);\n if (child.type === 'rect' || child.type === 'chart') {\n // do nothing\n } else if (child.name === 'mark') {\n child.setAttribute('y', 0);\n } else if (textBaseline === 'middle') {\n child.setAttribute('y', padding[0] + (newHeight - child.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n child.setAttribute('y', padding[0] + newHeight - child.AABBBounds.height());\n } else {\n child.setAttribute('y', padding[0]);\n }\n });\n}\n\n/**\n * @description: 自适应行高模式下,判断当前单元格是否需要更新行高\n * @param {Scenegraph} scene\n * @param {Group} cellGroup\n * @param {number} newHeight\n * @param {number} oldHeight\n * @return {*}\n */\nfunction isCellHeightUpdate(scene: Scenegraph, cellGroup: Group, newHeight: number, oldHeight: number): boolean {\n const table = scene.table;\n const mergeInfo = getCellMergeInfo(table, cellGroup.col, cellGroup.row);\n\n // let rowHeight: number = 0;\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n oldHeight = oldHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n newHeight = newHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) {\n const rowHeight = table.getRowHeight(rowIndex);\n\n if (rowHeight === oldHeight && newHeight !== rowHeight) {\n // 当前行的自适应行高,是由本单元格撑起;如果当前单元格高度发生变化,则更新行高\n return true;\n } else if (newHeight > rowHeight) {\n // 如果当前单元格高度超过目前所在行的行高,则更新行高\n return true;\n }\n }\n } else {\n const rowHeight = table.getRowHeight(cellGroup.row);\n\n if (rowHeight === oldHeight && newHeight !== rowHeight) {\n // 当前行的自适应行高,是由本单元格撑起;如果当前单元格高度发生变化,则更新行高\n return true;\n } else if (newHeight > rowHeight) {\n // 如果当前单元格高度超过目前所在行的行高,则更新行高\n return true;\n }\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/utils/text-icon-layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CA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CAAC,GAAG,EAAE,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;YAClF,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAE/C,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE;gBAEtD,OAAO,IAAI,CAAC;aACb;iBAAM,IAAI,SAAS,GAAG,SAAS,EAAE;gBAEhC,OAAO,IAAI,CAAC;aACb;SACF;KACF;SAAM;QACL,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAEpD,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE;YAEtD,OAAO,IAAI,CAAC;SACb;aAAM,IAAI,SAAS,GAAG,SAAS,EAAE;YAEhC,OAAO,IAAI,CAAC;SACb;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC","file":"text-icon-layout.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IThemeSpec } from './../../vrender';\nimport { RichText, Text } from './../../vrender';\nimport { convertInternal } from '../../tools/util';\nimport type { CellRange, ColumnIconOption } from '../../ts-types';\nimport { IconFuncTypeEnum, IconPosition } from '../../ts-types';\nimport { CellContent } from '../component/cell-content';\nimport type { Group } from '../graphic/group';\nimport { Icon } from '../graphic/icon';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from './get-cell-merge';\nimport { getHierarchyOffset } from './get-hierarchy-offset';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isNil, isNumber, isValid } from '@visactor/vutils';\nimport { isMergeCellGroup } from './is-merge-cell-group';\n\n/**\n * @description: 创建单元格内容\n * cellGroup\n * |-- content\n * |-- leftContentIcons\n * |-- rightContentIcons\n * |-- wrapText / richtext\n * |-- leftIcons\n * |-- rightIcons\n * |-- absoluteIcons\n * @param {ColumnIconOption} icons\n * @param {string} textStr\n * @param {array} padding\n * @param {boolean} autoColWidth\n * @param {boolean} autoRowHeight\n * @param {boolean} autoWrapText\n * @param {number} cellWidth\n * @param {number} cellHeight\n * @param {CanvasTextAlign} textAlign\n * @param {CanvasTextBaseline} textBaseline\n * @return {*}\n */\nexport function createCellContent(\n cellGroup: Group,\n icons: ColumnIconOption[] | null,\n textStr: string,\n padding: [number, number, number, number],\n autoColWidth: boolean,\n autoRowHeight: boolean,\n autoWrapText: boolean,\n lineClamp: number | undefined,\n cellWidth: number,\n cellHeight: number,\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI,\n cellTheme: IThemeSpec,\n range: CellRange | undefined\n) {\n const leftIcons: ColumnIconOption[] = [];\n const rightIcons: ColumnIconOption[] = [];\n const contentLeftIcons: ColumnIconOption[] = [];\n const contentRightIcons: ColumnIconOption[] = [];\n const inlineFrontIcons: ColumnIconOption[] = [];\n const inlineEndIcons: ColumnIconOption[] = [];\n const absoluteLeftIcons: ColumnIconOption[] = [];\n const absoluteRightIcons: ColumnIconOption[] = [];\n\n let contentWidth: number;\n let contentHeight: number;\n let leftIconWidth = 0;\n let leftIconHeight = 0;\n let rightIconWidth = 0;\n let rightIconHeight = 0;\n let absoluteLeftIconWidth = 0;\n let absoluteRightIconWidth = 0;\n\n if (!Array.isArray(icons) || icons.length === 0) {\n if (isValid(textStr)) {\n // 没有icon,cellGroup只添加WrapText\n const text = convertInternal(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n\n const hierarchyOffset = range\n ? getHierarchyOffset(range.start.col, range.start.row, table)\n : getHierarchyOffset(cellGroup.col, cellGroup.row, table);\n\n let _contentOffset = 0;\n if (isNumber(table.theme._contentOffset)) {\n if (textAlign === 'left') {\n _contentOffset = table.theme._contentOffset;\n } else if (textAlign === 'right') {\n _contentOffset = -table.theme._contentOffset;\n }\n }\n\n const attribute = {\n text: text.length === 1 ? text[0] : text,\n maxLineWidth: autoColWidth ? Infinity : cellWidth - (padding[1] + padding[3] + hierarchyOffset),\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),\n pickable: false,\n dx: hierarchyOffset + _contentOffset,\n whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'\n };\n const wrapText = new Text(cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute);\n wrapText.name = 'text';\n (wrapText as any).textBaseline = textBaseline;\n\n cellGroup.appendChild(wrapText);\n\n contentWidth = wrapText.AABBBounds.width();\n contentHeight = wrapText.AABBBounds.height();\n }\n } else {\n // icon分类\n icons.forEach(icon => {\n switch (icon.positionType) {\n case IconPosition.left:\n leftIcons.push(icon);\n break;\n case IconPosition.right:\n rightIcons.push(icon);\n break;\n case IconPosition.contentLeft:\n contentLeftIcons.push(icon);\n break;\n case IconPosition.contentRight:\n contentRightIcons.push(icon);\n break;\n // case IconPosition.absoluteLeft:\n // absoluteLeftIcons.push(icon);\n // break;\n case IconPosition.absoluteRight:\n absoluteRightIcons.push(icon);\n break;\n case IconPosition.inlineFront:\n inlineFrontIcons.push(icon);\n break;\n case IconPosition.inlineEnd:\n inlineEndIcons.push(icon);\n break;\n }\n });\n\n // 添加非cell icon & absolute icon\n leftIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-left';\n iconMark.name = icon.name;\n iconMark.setAttribute('x', leftIconWidth + (iconMark.attribute.marginLeft ?? 0));\n leftIconWidth +=\n iconMark.AABBBounds.width() + (iconMark.attribute.marginLeft ?? 0) + (iconMark.attribute.marginRight ?? 0);\n leftIconHeight = Math.max(leftIconHeight, iconMark.AABBBounds.height());\n cellGroup.appendChild(iconMark);\n });\n\n rightIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-right';\n iconMark.name = icon.name;\n iconMark.setAttribute('x', rightIconWidth + (iconMark.attribute.marginLeft ?? 0));\n rightIconWidth +=\n iconMark.AABBBounds.width() + (iconMark.attribute.marginLeft ?? 0) + (iconMark.attribute.marginRight ?? 0);\n rightIconHeight = Math.max(rightIconHeight, iconMark.AABBBounds.height());\n cellGroup.appendChild(iconMark);\n });\n\n absoluteLeftIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-absolute-left';\n iconMark.name = icon.name;\n iconMark.setAttribute('x', absoluteLeftIconWidth + (iconMark.attribute.marginLeft ?? 0));\n absoluteLeftIconWidth +=\n iconMark.AABBBounds.width() + (iconMark.attribute.marginLeft ?? 0) + (iconMark.attribute.marginRight ?? 0);\n cellGroup.appendChild(iconMark);\n });\n\n absoluteRightIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-absolute-right';\n iconMark.name = icon.name;\n iconMark.setAttribute('x', absoluteRightIconWidth + (iconMark.attribute.marginLeft ?? 0));\n absoluteRightIconWidth +=\n iconMark.AABBBounds.width() + (iconMark.attribute.marginLeft ?? 0) + (iconMark.attribute.marginRight ?? 0);\n cellGroup.appendChild(iconMark);\n });\n\n // 添加text & content icon & inline icon\n let textMark;\n // 直接添加richtext / wrapText\n if (inlineFrontIcons.length === 0 && inlineEndIcons.length === 0) {\n let _contentOffset = 0;\n if (isNumber(table.theme._contentOffset)) {\n if (textAlign === 'left') {\n _contentOffset = table.theme._contentOffset;\n } else if (textAlign === 'right') {\n _contentOffset = -table.theme._contentOffset;\n }\n }\n const hierarchyOffset = range\n ? getHierarchyOffset(range.start.col, range.start.row, table)\n : getHierarchyOffset(cellGroup.col, cellGroup.row, table);\n const text = convertInternal(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n const attribute = {\n text: text.length === 1 ? text[0] : text,\n maxLineWidth: autoColWidth\n ? Infinity\n : cellWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth - hierarchyOffset,\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),\n pickable: false,\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n whiteSpace: text.length === 1 && !autoWrapText ? 'no-wrap' : 'normal',\n dx: _contentOffset + (!contentLeftIcons.length && !contentRightIcons.length ? hierarchyOffset : 0)\n };\n const wrapText = new Text(cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute);\n wrapText.name = 'text';\n textMark = wrapText;\n } else {\n const textOption = Object.assign(\n {\n text: textStr?.toString()\n },\n (cellGroup.parent as Group)?.theme?.userTheme?.text || {}\n );\n if (cellTheme.text) {\n Object.assign(textOption, cellTheme.text);\n }\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...inlineFrontIcons.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...inlineEndIcons.map(icon => dealWithRichTextIcon(icon))\n ];\n textConfig[0].textAlign = textAlign;\n const text = new RichText({\n width: autoColWidth ? 0 : cellWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth,\n height: autoRowHeight ? 0 : cellHeight - (padding[0] + padding[2]),\n textConfig,\n verticalDirection: autoRowHeight ? 'top' : (textBaseline as any),\n\n ellipsis: textOption.ellipsis\n // verticalDirection: textBaseline as any\n // textAlign: textAlign as any,\n // textBaseline: textBaseline as any,\n });\n text.name = 'text';\n textMark = text;\n text.bindIconEvent();\n }\n\n if (contentLeftIcons.length !== 0 || contentRightIcons.length !== 0) {\n // 创建CellContent处理conten icon;有content icon,cellGroup: CellIcons + cellContent\n\n const cellContent = new CellContent({\n // x: padding[3] + leftIconWidth,\n // y: padding[0],\n x: 0,\n y: 0,\n fill: false,\n stroke: false\n // pickable: false,\n });\n cellContent.name = 'content';\n\n cellContent.setCellContentOption({\n autoWidth: autoColWidth,\n autoHeight: autoRowHeight,\n cellWidth: cellWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth,\n cellHeight: cellHeight - (padding[0] + padding[2]),\n align: textAlign,\n baseline: textBaseline\n });\n\n contentLeftIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-content-left';\n iconMark.name = icon.name;\n cellContent.addLeftOccupyingIcon(iconMark);\n });\n contentRightIcons.forEach(icon => {\n const iconMark = dealWithIcon(icon, undefined, cellGroup.col, cellGroup.row, range, table);\n iconMark.role = 'icon-content-right';\n iconMark.name = icon.name;\n cellContent.addRightOccupyingIcon(iconMark);\n });\n cellContent.addContent(textMark);\n\n cellGroup.appendChild(cellContent);\n cellContent.layout();\n\n contentWidth = cellContent.AABBBounds.width();\n contentHeight = cellContent.AABBBounds.height();\n } else {\n // 没有content icon,cellGroup: CellIcons + wrapText/richtext\n // cellGroup.appendChild(textMark);\n if (cellGroup.firstChild) {\n cellGroup.insertBefore(textMark, cellGroup.firstChild);\n } else {\n cellGroup.appendChild(textMark);\n }\n contentWidth = textMark.AABBBounds.width();\n contentHeight = textMark.AABBBounds.height();\n }\n }\n\n // 内容添加后单元格的宽高\n const width = autoColWidth\n ? leftIconWidth + contentWidth + rightIconWidth // + padding[1] + padding[3]\n : cellWidth - (padding[1] + padding[3]);\n // const height = autoRowHeight\n // ? Math.max(leftIconHeight, contentHeight, rightIconHeight) // + padding[0] + padding[2]\n // : cellHeight - (padding[0] + padding[2]);\n const height = cellHeight - (padding[0] + padding[2]);\n\n // 更新各个部分横向位置\n cellGroup.forEachChildren((child: any) => {\n if (child.role === 'icon-left') {\n child.setAttribute('x', child.attribute.x + padding[3]);\n } else if (child.role === 'icon-right') {\n child.setAttribute('x', child.attribute.x + width - rightIconWidth + padding[3]);\n } else if (child.role === 'icon-absolute-right') {\n child.setAttribute('x', child.attribute.x + width - absoluteRightIconWidth + padding[3] + padding[1]);\n } else if (child.name === 'content' || child.name === 'text') {\n if (textAlign === 'center' && child.type !== 'richtext') {\n child.setAttribute('x', padding[3] + leftIconWidth + (width - leftIconWidth - rightIconWidth) / 2);\n } else if (textAlign === 'right' && child.type !== 'richtext') {\n child.setAttribute('x', padding[3] + width - rightIconWidth);\n } else {\n child.setAttribute('x', padding[3] + leftIconWidth);\n }\n }\n });\n\n // 更新各个部分纵向位置\n cellGroup.forEachChildren((child: any) => {\n if (textBaseline === 'middle') {\n child.setAttribute('y', padding[0] + (height - child.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n child.setAttribute('y', padding[0] + height - child.AABBBounds.height());\n } else {\n child.setAttribute('y', padding[0]);\n }\n });\n\n // 更新cell Group宽高\n cellGroup.setAttributes({\n width: width + padding[1] + padding[3],\n height: height + padding[0] + padding[2]\n } as any);\n}\n\n/**\n * @description: icon option生成icon mark\n * @param {ColumnIconOption} icon\n * @return {*}\n */\nexport function dealWithIcon(\n icon: ColumnIconOption,\n mark?: Icon,\n col?: number,\n row?: number,\n range?: CellRange,\n table?: BaseTableAPI\n): Icon {\n // positionType在外部处理\n const iconAttribute = {} as any;\n\n // 图片内容\n if (icon.type === 'image') {\n iconAttribute.image = icon.src;\n } else if (icon.type === 'svg' || 'svg' in icon) {\n iconAttribute.image = icon.svg;\n // } else if (icon.type === 'path') {\n // // to do: 暂不支持\n // } else if (icon.type === 'font') {\n // // to do: 暂不支持\n }\n\n // name\n // iconAttribute.name = icon.name;\n iconAttribute.width = icon.width;\n iconAttribute.height = icon.height;\n iconAttribute.visibleTime = icon.visibleTime ?? 'always';\n iconAttribute.funcType = icon.funcType;\n iconAttribute.interactive = icon.interactive;\n\n let hierarchyOffset = 0;\n if (\n isNumber(col) &&\n isNumber(row) &&\n table &&\n (icon.funcType === IconFuncTypeEnum.collapse || icon.funcType === IconFuncTypeEnum.expand)\n ) {\n // compute hierarchy offset\n // hierarchyOffset = getHierarchyOffset(col, row, table);\n hierarchyOffset = range\n ? getHierarchyOffset(range.start.col, range.start.row, table)\n : getHierarchyOffset(col, row, table);\n }\n\n iconAttribute.marginLeft = (icon.marginLeft ?? 0) + hierarchyOffset;\n iconAttribute.marginRight = icon.marginRight ?? 0;\n\n if (icon.interactive === false) {\n iconAttribute.pickable = false;\n }\n\n if (icon.hover) {\n iconAttribute.backgroundWidth = icon.hover.width ?? icon.width;\n iconAttribute.backgroundHeight = icon.hover.width ?? icon.width;\n iconAttribute.backgroundColor = icon.hover.bgColor ?? 'rgba(22,44,66,0.2)';\n iconAttribute.hoverImage = icon.hover.image;\n }\n\n if (icon.cursor) {\n iconAttribute.cursor = icon.cursor;\n }\n\n if ('shape' in icon && icon.shape === 'circle') {\n iconAttribute.shape = icon.shape;\n }\n\n if (mark) {\n mark.setAttributes(iconAttribute);\n mark.loadImage(iconAttribute.image);\n return mark;\n }\n // funcType, cursor, tooltip, hover在事件响应阶段处理\n const iconMark = new Icon(iconAttribute);\n iconMark.tooltip = icon.tooltip;\n\n return iconMark;\n}\n\n/**\n * @description: icon option生成richtext icon config\n * @param {ColumnIconOption} icon\n * @return {*}\n */\nexport function dealWithRichTextIcon(icon: ColumnIconOption) {\n // positionType在外部处理\n const config = {} as any;\n\n // 图片内容\n if (icon.type === 'image') {\n config.image = icon.src;\n } else if (icon.type === 'svg' || 'svg' in icon) {\n config.image = icon.svg;\n // } else if (icon.type === 'path') {\n // // to do: 暂不支持\n // } else if (icon.type === 'font') {\n // // to do: 暂不支持\n }\n\n // name\n config.visibleTime = icon.visibleTime ?? 'always';\n config.funcType = icon.funcType;\n config.id = icon.name;\n config.width = icon.width;\n config.height = icon.height;\n\n if (icon.marginRight || icon.marginLeft) {\n config.margin = [0, icon.marginRight ?? 0, 0, icon.marginLeft ?? 0];\n }\n\n if (icon.hover) {\n config.backgroundWidth = icon.hover.width ?? icon.width;\n config.backgroundHeight = icon.hover.height ?? icon.height;\n config.backgroundShowMode = 'hover';\n config.hoverImage = icon.hover.image;\n config.backgroundStroke = false;\n config.backgroundFill = icon.hover.bgColor ?? 'rgba(22,44,66,0.2)';\n }\n\n if (icon.cursor) {\n config.cursor = icon.cursor;\n }\n\n config.tooltip = icon.tooltip;\n\n // funcType, cursor, tooltip在事件响应阶段处理\n return config;\n}\n\n/**\n * @description: 更新单元格内容宽度\n * @param {Group} cellGroup\n * @param {number} distWidth\n * @param {boolean} autoRowHeight\n * @return {*}\n */\nexport function updateCellContentWidth(\n cellGroup: Group,\n distWidth: number,\n cellHeight: number,\n detaX: number,\n autoRowHeight: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n scene: Scenegraph\n): boolean {\n let leftIconWidth = 0;\n let leftIconHeight = 0;\n let rightIconWidth = 0;\n let rightIconHeight = 0;\n // let hasIcon = false;\n cellGroup.forEachChildren((iconMark: Icon) => {\n if (iconMark.role === 'icon-left') {\n leftIconWidth += iconMark.AABBBounds.width();\n leftIconHeight = Math.max(leftIconHeight, iconMark.AABBBounds.height());\n } else if (iconMark.role === 'icon-right') {\n rightIconWidth += iconMark.AABBBounds.width();\n rightIconHeight = Math.max(rightIconHeight, iconMark.AABBBounds.height());\n }\n });\n\n // 记录原始内容高度\n let oldTextHeight;\n const textMark = cellGroup.getChildByName('text');\n const cellContent = cellGroup.getChildByName('content') as CellContent;\n let contentHeight: number;\n if (textMark instanceof Text) {\n oldTextHeight = textMark.AABBBounds.height();\n textMark.setAttribute('maxLineWidth', distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]));\n // contentWidth = textMark.AABBBounds.width();\n contentHeight = textMark.AABBBounds.height();\n } else if (textMark instanceof RichText) {\n oldTextHeight = textMark.AABBBounds.height();\n textMark.setAttribute('width', distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]));\n // contentWidth = textMark.AABBBounds.width();\n contentHeight = textMark.AABBBounds.height();\n } else if (cellContent) {\n oldTextHeight = cellContent.AABBBounds.height();\n cellContent.updateWidth(distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]));\n // contentWidth = cellContent.AABBBounds.width();\n contentHeight = cellContent.AABBBounds.height();\n }\n\n const oldCellHeight = Math.max(leftIconHeight, rightIconHeight, oldTextHeight) + padding[0] + padding[2];\n\n // 更新x方向位置\n cellGroup.forEachChildren((child: any) => {\n if (child.role === 'icon-left') {\n // do nothing\n } else if (child.role === 'icon-right') {\n child.setAttribute('x', child.attribute.x + detaX);\n } else if (child.role === 'icon-absolute-right') {\n child.setAttribute('x', child.attribute.x + detaX);\n } else if (child.name === 'content' || child.name === 'text') {\n const childTextAlign = child.attribute.textAlign ?? textAlign;\n if (childTextAlign === 'center') {\n child.setAttribute(\n 'x',\n padding[3] + leftIconWidth + (distWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth) / 2\n );\n } else if (childTextAlign === 'right') {\n child.setAttribute('x', padding[3] + distWidth - (padding[1] + padding[3]) - rightIconWidth);\n } else {\n // left: do nothing\n }\n } else if (child.name === 'mark') {\n child.setAttribute('x', cellGroup.attribute.width);\n }\n });\n\n // 如果autoRowHeight && 高度改变 更新y方向位置\n if (autoRowHeight) {\n let newHeight = Math.max(leftIconHeight, contentHeight, rightIconHeight); // + padding[0] + padding[2]\n\n if (isCellHeightUpdate(scene, cellGroup, newHeight + padding[0] + padding[2], oldCellHeight)) {\n // cellGroup.setAttribute('height', newHeight + padding[0] + padding[2]);\n return true;\n }\n\n newHeight = (cellGroup.contentHeight ?? cellHeight) - (padding[0] + padding[2]);\n\n cellGroup.forEachChildren((child: any) => {\n if (child.type === 'rect' || child.type === 'chart') {\n return;\n }\n if (child.name === 'mark') {\n child.setAttribute('y', 0);\n } else if (textBaseline === 'middle') {\n child.setAttribute('y', padding[0] + (newHeight - child.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n child.setAttribute('y', padding[0] + newHeight - child.AABBBounds.height());\n } else {\n child.setAttribute('y', padding[0]);\n }\n });\n } else if (textBaseline === 'middle' || textBaseline === 'bottom') {\n cellGroup.forEachChildren((child: any) => {\n if (child.type === 'rect' || child.type === 'chart') {\n return;\n }\n if (child.name === 'mark') {\n child.setAttribute('y', 0);\n } else if (textBaseline === 'middle') {\n child.setAttribute('y', (cellHeight - padding[2] + padding[0] - child.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n child.setAttribute('y', cellHeight - child.AABBBounds.height() - padding[2]);\n } else {\n child.setAttribute('y', padding[0]);\n }\n });\n }\n return false;\n}\n\n/**\n * @description: 更新单元格内容宽度\n */\nexport function updateCellContentHeight(\n cellGroup: Group,\n distHeight: number,\n detaY: number,\n autoRowHeight: boolean,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline\n) {\n const newHeight = distHeight - (padding[0] + padding[2]);\n\n const textMark = cellGroup.getChildByName('text');\n\n if (textMark instanceof Text && !autoRowHeight) {\n textMark.setAttributes({\n heightLimit: newHeight\n } as any);\n } else if (textMark instanceof RichText && !autoRowHeight) {\n textMark.setAttributes({\n height: newHeight\n });\n } else if (cellGroup.getChildByName('content')) {\n const cellContent = cellGroup.getChildByName('content') as CellContent;\n cellContent.updateHeight(newHeight);\n }\n\n // 更新y方向位置\n cellGroup.forEachChildren((child: any) => {\n child.setAttribute('dy', 0);\n if (child.type === 'rect' || child.type === 'chart') {\n // do nothing\n } else if (child.name === 'mark') {\n child.setAttribute('y', 0);\n } else if (textBaseline === 'middle') {\n child.setAttribute('y', padding[0] + (newHeight - child.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n child.setAttribute('y', padding[0] + newHeight - child.AABBBounds.height());\n } else {\n child.setAttribute('y', padding[0]);\n }\n });\n}\n\n/**\n * @description: 自适应行高模式下,判断当前单元格是否需要更新行高\n * @param {Scenegraph} scene\n * @param {Group} cellGroup\n * @param {number} newHeight\n * @param {number} oldHeight\n * @return {*}\n */\nfunction isCellHeightUpdate(scene: Scenegraph, cellGroup: Group, newHeight: number, oldHeight: number): boolean {\n const table = scene.table;\n const mergeInfo = getCellMergeInfo(table, cellGroup.col, cellGroup.row);\n\n // let rowHeight: number = 0;\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n oldHeight = oldHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n newHeight = newHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) {\n const rowHeight = table.getRowHeight(rowIndex);\n\n if (rowHeight === oldHeight && newHeight !== rowHeight) {\n // 当前行的自适应行高,是由本单元格撑起;如果当前单元格高度发生变化,则更新行高\n return true;\n } else if (newHeight > rowHeight) {\n // 如果当前单元格高度超过目前所在行的行高,则更新行高\n return true;\n }\n }\n } else {\n const rowHeight = table.getRowHeight(cellGroup.row);\n\n if (rowHeight === oldHeight && newHeight !== rowHeight) {\n // 当前行的自适应行高,是由本单元格撑起;如果当前单元格高度发生变化,则更新行高\n return true;\n } else if (newHeight > rowHeight) {\n // 如果当前单元格高度超过目前所在行的行高,则更新行高\n return true;\n }\n }\n\n return false;\n}\n"]}
@@ -2,7 +2,7 @@ import { DefaultTextStyle, getTextBounds, DefaultTextMeasureContribution, TextMe
2
2
 
3
3
  import { TextMeasure } from "@visactor/vutils";
4
4
 
5
- let customAlphabetCharSet = "";
5
+ let customAlphabetCharSet = "", textMeasureMode = "quick";
6
6
 
7
7
  const textMeasureModule = new ContainerModule(((bind, unbind, isBound, rebind) => {
8
8
  isBound(TextMeasureContribution) ? rebind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope() : bind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
@@ -46,22 +46,22 @@ function getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle = "norma
46
46
  export class FastTextMeasureContribution extends DefaultTextMeasureContribution {
47
47
  measureTextWidth(text, options) {
48
48
  const {fontSize: fontSize, fontFamily: fontFamily = "Arial,sans-serif", fontWeight: fontWeight = "normal", fontStyle: fontStyle = "normal"} = options;
49
- return getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle).measure(text).width;
49
+ return getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle).measure(text, textMeasureMode).width;
50
50
  }
51
51
  measureText(text, options) {
52
52
  const {fontSize: fontSize, fontFamily: fontFamily = "Arial,sans-serif", fontWeight: fontWeight = "normal", fontStyle: fontStyle = "normal"} = options;
53
- return getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle).measure(text);
53
+ return getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle).measure(text, textMeasureMode);
54
54
  }
55
55
  }
56
56
 
57
57
  export class TextMeasureTool {
58
58
  measureText(text, options) {
59
59
  const {fontSize: fontSize, fontFamily: fontFamily = "Arial,sans-serif", fontWeight: fontWeight = "normal", fontStyle: fontStyle = "normal"} = options;
60
- return getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle).measure(text);
60
+ return getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle).measure(text, textMeasureMode);
61
61
  }
62
62
  measureTextWidth(text, options) {
63
63
  const {fontSize: fontSize, fontFamily: fontFamily = "Arial,sans-serif", fontWeight: fontWeight = "normal", fontStyle: fontStyle = "normal"} = options;
64
- return getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle).measure(text).width;
64
+ return getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle).measure(text, textMeasureMode).width;
65
65
  }
66
66
  clipText(text, options, width) {
67
67
  if (0 === text.length) return {
@@ -136,6 +136,6 @@ export function setCustomAlphabetCharSet(str) {
136
136
  }
137
137
 
138
138
  export function restoreMeasureText() {
139
- container.load(restoreTextMeasureModule);
139
+ textMeasureMode = "canvas", container.load(restoreTextMeasureModule);
140
140
  }
141
141
  //# sourceMappingURL=text-measure.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/utils/text-measure.ts"],"names":[],"mappings":"AACA,OAAO,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K,EAAE,CAAC,EAAE,CAAC;SAC9B;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpD,IAAI,MAAM,IAAI,KAAK,EAAE;YACnB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;SACrC;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC3D,IAAI,WAAW,GAAG,KAAK,EAAE;YACvB,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;SAC9B;QACD,KAAK,IAAI,WAAW,CAAC;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACtE,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC;QACnB,IAAI,CAAC,KAAK,IAAI,WAAW,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;AAGjD,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,qBAAqB,GAAG,GAAG,CAAC;IAC5B,oBAAoB,CAAC,KAAK,EAAE,CAAC;AAE/B,CAAC;AAGD,MAAM,UAAU,kBAAkB;IAChC,SAAS,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AAC3C,CAAC","file":"text-measure.js","sourcesContent":["import type { ITextGraphicAttribute, TextOptionsType } from './../../vrender';\nimport {\n DefaultTextStyle,\n getTextBounds,\n DefaultTextMeasureContribution,\n TextMeasureContribution,\n ContainerModule,\n container\n} from './../../vrender';\n// eslint-disable-next-line max-len\n// import {\n// DefaultTextMeasureContribution,\n// TextMeasureContribution\n// } from '@visactor/vrender/es/core/contributions/textMeasure/textMeasure-contribution';\nimport type { ITextMeasureOption, ITextSize } from '@visactor/vutils';\nimport { TextMeasure } from '@visactor/vutils';\n\nlet customAlphabetCharSet = '';\n\ntype ITextGraphicAttributeFroMeasure = Omit<ITextGraphicAttribute, 'lineHeight'> & {\n lineHeight?: number;\n};\n\nconst textMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {\n if (isBound(TextMeasureContribution)) {\n rebind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();\n } else {\n bind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();\n }\n});\n\nconst restoreTextMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {\n if (isBound(TextMeasureContribution)) {\n rebind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();\n } else {\n bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();\n }\n});\n\nexport default textMeasureModule;\n\nexport const initTextMeasure = (\n textSpec?: ITextGraphicAttributeFroMeasure,\n option?: Partial<ITextMeasureOption>,\n useNaiveCanvas?: boolean\n): TextMeasure<ITextGraphicAttributeFroMeasure> => {\n return new TextMeasure<ITextGraphicAttributeFroMeasure>(\n {\n defaultFontParams: {\n fontFamily: DefaultTextStyle.fontFamily,\n fontSize: DefaultTextStyle.fontSize\n },\n getTextBounds: useNaiveCanvas ? undefined : getTextBounds,\n specialCharSet: `{}()//&-/: .,@%'\"~…=${\n TextMeasure.ALPHABET_CHAR_SET\n }${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}0123456789${customAlphabetCharSet}`,\n ...(option ?? {})\n },\n textSpec\n );\n};\n\nconst fastTextMeasureCache: Map<string, TextMeasure<ITextGraphicAttributeFroMeasure>> = new Map();\n\nfunction getFastTextMeasure(\n fontSize: number,\n fontWeight: string | number,\n fontFamily: string,\n fontStyle: string = 'normal'\n) {\n const key = `${fontSize}-${fontWeight}-${fontFamily}-${fontStyle}`;\n const cache = fastTextMeasureCache.get(key);\n if (cache) {\n return cache;\n }\n const fastTextMeasure = initTextMeasure({\n // 16px sans-serif\n fontSize,\n fontFamily,\n fontWeight,\n fontStyle\n });\n fastTextMeasureCache.set(key, fastTextMeasure);\n return fastTextMeasure;\n}\n\nexport class FastTextMeasureContribution extends DefaultTextMeasureContribution {\n /**\n * 获取text宽度,measureText.width\n * @param text\n * @param options\n */\n measureTextWidth(text: string, options: TextOptionsType): number {\n // if (!this.context) {\n // return this.estimate(text, options).width;\n // }\n // this.context.setTextStyleWithoutAlignBaseline(options);\n // const textMeasure = this.context.measureText(text);\n // return textMeasure.width;\n\n const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;\n const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);\n const textMeasure = fastTextMeasure.measure(text);\n return textMeasure.width;\n }\n\n /**\n * 获取text测量对象\n * @param text\n * @param options\n */\n measureText(text: string, options: TextOptionsType): TextMetrics | { width: number } {\n // if (!this.context) {\n // return this.estimate(text, options);\n // }\n // this.context.setTextStyleWithoutAlignBaseline(options);\n // return this.context.measureText(text);\n\n const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;\n const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);\n const textMeasure = fastTextMeasure.measure(text);\n return textMeasure;\n }\n}\n\nexport class TextMeasureTool {\n /**\n * 获取text宽度,measureText.width\n * @param text\n * @param options\n */\n measureText(text: string, options: ITextGraphicAttribute): ITextSize {\n const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;\n const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);\n const textMeasure = fastTextMeasure.measure(text);\n return textMeasure;\n }\n\n /**\n * 获取text宽度,measureText.width\n * @param text\n * @param options\n */\n measureTextWidth(text: string, options: ITextGraphicAttribute): number {\n const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;\n const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);\n const textMeasure = fastTextMeasure.measure(text);\n return textMeasure.width;\n }\n\n /**\n * 将文本裁剪到width宽\n * @param text\n * @param options\n * @param width\n */\n clipText(\n text: string,\n options: ITextGraphicAttribute,\n width: number\n ): {\n str: string;\n width: number;\n } {\n if (text.length === 0) {\n return { str: '', width: 0 };\n }\n let length = this.measureTextWidth(text, options);\n if (length <= width) {\n return { str: text, width: length };\n }\n length = this.measureTextWidth(text[0], options);\n if (length > width) {\n return { str: '', width: 0 };\n }\n return this._clipText(text, options, width, 0, text.length - 1);\n }\n\n // 二分法找到最佳宽\n private _clipText(\n text: string,\n options: ITextGraphicAttribute,\n width: number,\n leftIdx: number,\n rightIdx: number\n ): { str: string; width: number } {\n const middleIdx = Math.floor((leftIdx + rightIdx) / 2);\n const subText = text.substring(0, middleIdx + 1);\n const strWidth = this.measureTextWidth(subText, options);\n let length: number;\n if (strWidth > width) {\n // 如果字符串的宽度大于限制宽度\n if (subText.length <= 1) {\n return { str: '', width: 0 };\n } // 如果子字符串长度小于1,而且大于给定宽的话,返回空字符串\n // 先判断是不是左侧的那个字符\n const str = text.substring(0, middleIdx);\n // 如果到左侧的字符小于或等于width,那么说明就是左侧的字符\n length = this.measureTextWidth(str, options);\n if (length <= width) {\n return { str, width: length };\n }\n // 返回leftIdx到middleIdx\n return this._clipText(text, options, width, leftIdx, middleIdx);\n } else if (strWidth < width) {\n // 如果字符串的宽度小于限制宽度\n if (middleIdx >= text.length - 1) {\n return { str: text, width: this.measureTextWidth(text, options) };\n } // 如果已经到结尾了,返回text\n // 先判断是不是右侧的那个字符\n const str = text.substring(0, middleIdx + 2);\n // 如果到右侧的字符大于或等于width,那么说明就是这个字符串\n length = this.measureTextWidth(str, options);\n if (length >= width) {\n return { str: subText, width: strWidth };\n }\n // 返回middleIdx到rightIdx\n return this._clipText(text, options, width, middleIdx, rightIdx);\n }\n // 如果相同,那么就找到text\n return { str: subText, width: strWidth };\n }\n\n clipTextWithSuffix(\n text: string,\n options: ITextGraphicAttribute,\n width: number,\n suffix: string\n ): {\n str: string;\n width: number;\n } {\n if (suffix === '') {\n return this.clipText(text, options, width);\n }\n if (text.length === 0) {\n return { str: '', width: 0 };\n }\n const length = this.measureTextWidth(text, options);\n if (length <= width) {\n return { str: text, width: length };\n }\n const suffixWidth = this.measureTextWidth(suffix, options);\n if (suffixWidth > width) {\n return { str: '', width: 0 };\n }\n width -= suffixWidth;\n const data = this._clipText(text, options, width, 0, text.length - 1);\n data.str += suffix;\n data.width += suffixWidth;\n return data;\n }\n}\n\nexport const textMeasure = new TextMeasureTool();\n\n// add user custom alphabet char set into fast measurement\nexport function setCustomAlphabetCharSet(str: string) {\n customAlphabetCharSet = str;\n fastTextMeasureCache.clear();\n // container.load(textMeasureModule);\n}\n\n// change fast textMeasure into canvas textMeasure\nexport function restoreMeasureText() {\n container.load(restoreTextMeasureModule);\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/utils/text-measure.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,8BAA8B,EAC9B,uBAAuB,EACvB,eAAe,EACf,SAAS,EACV,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,IAAI,qBAAqB,GAAG,EAAE,CAAC;AAC/B,IAAI,eAAe,GAAuB,OAAO,CAAC;AAMlD,MAAM,iBAAiB,GAAG,IAAI,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9E,IAAI,OAAO,CAAC,uBAAuB,CAAC,EAAE;QACpC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC,gBAAgB,EAAE,CAAC;KACpF;SAAM;QACL,IAAI,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC,g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AAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACtE,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC;QACnB,IAAI,CAAC,KAAK,IAAI,WAAW,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;AAGjD,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,qBAAqB,GAAG,GAAG,CAAC;IAC5B,oBAAoB,CAAC,KAAK,EAAE,CAAC;AAE/B,CAAC;AAGD,MAAM,UAAU,kBAAkB;IAChC,eAAe,GAAG,QAAQ,CAAC;IAC3B,SAAS,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AAC3C,CAAC","file":"text-measure.js","sourcesContent":["import type { ITextGraphicAttribute, TextOptionsType } from './../../vrender';\nimport {\n DefaultTextStyle,\n getTextBounds,\n DefaultTextMeasureContribution,\n TextMeasureContribution,\n ContainerModule,\n container\n} from './../../vrender';\n// eslint-disable-next-line max-len\n// import {\n// DefaultTextMeasureContribution,\n// TextMeasureContribution\n// } from '@visactor/vrender/es/core/contributions/textMeasure/textMeasure-contribution';\nimport type { ITextMeasureOption, ITextSize } from '@visactor/vutils';\nimport { TextMeasure } from '@visactor/vutils';\n\nlet customAlphabetCharSet = '';\nlet textMeasureMode: 'quick' | 'canvas' = 'quick';\n\ntype ITextGraphicAttributeFroMeasure = Omit<ITextGraphicAttribute, 'lineHeight'> & {\n lineHeight?: number;\n};\n\nconst textMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {\n if (isBound(TextMeasureContribution)) {\n rebind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();\n } else {\n bind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();\n }\n});\n\nconst restoreTextMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {\n if (isBound(TextMeasureContribution)) {\n rebind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();\n } else {\n bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();\n }\n});\n\nexport default textMeasureModule;\n\nexport const initTextMeasure = (\n textSpec?: ITextGraphicAttributeFroMeasure,\n option?: Partial<ITextMeasureOption>,\n useNaiveCanvas?: boolean\n): TextMeasure<ITextGraphicAttributeFroMeasure> => {\n return new TextMeasure<ITextGraphicAttributeFroMeasure>(\n {\n defaultFontParams: {\n fontFamily: DefaultTextStyle.fontFamily,\n fontSize: DefaultTextStyle.fontSize\n },\n getTextBounds: useNaiveCanvas ? undefined : getTextBounds,\n specialCharSet: `{}()//&-/: .,@%'\"~…=${\n TextMeasure.ALPHABET_CHAR_SET\n }${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}0123456789${customAlphabetCharSet}`,\n ...(option ?? {})\n },\n textSpec\n );\n};\n\nconst fastTextMeasureCache: Map<string, TextMeasure<ITextGraphicAttributeFroMeasure>> = new Map();\n\nfunction getFastTextMeasure(\n fontSize: number,\n fontWeight: string | number,\n fontFamily: string,\n fontStyle: string = 'normal'\n) {\n const key = `${fontSize}-${fontWeight}-${fontFamily}-${fontStyle}`;\n const cache = fastTextMeasureCache.get(key);\n if (cache) {\n return cache;\n }\n const fastTextMeasure = initTextMeasure({\n // 16px sans-serif\n fontSize,\n fontFamily,\n fontWeight,\n fontStyle\n });\n fastTextMeasureCache.set(key, fastTextMeasure);\n return fastTextMeasure;\n}\n\nexport class FastTextMeasureContribution extends DefaultTextMeasureContribution {\n /**\n * 获取text宽度,measureText.width\n * @param text\n * @param options\n */\n measureTextWidth(text: string, options: TextOptionsType): number {\n // if (!this.context) {\n // return this.estimate(text, options).width;\n // }\n // this.context.setTextStyleWithoutAlignBaseline(options);\n // const textMeasure = this.context.measureText(text);\n // return textMeasure.width;\n\n const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;\n const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);\n const textMeasure = fastTextMeasure.measure(text, textMeasureMode);\n return textMeasure.width;\n }\n\n /**\n * 获取text测量对象\n * @param text\n * @param options\n */\n measureText(text: string, options: TextOptionsType): TextMetrics | { width: number } {\n // if (!this.context) {\n // return this.estimate(text, options);\n // }\n // this.context.setTextStyleWithoutAlignBaseline(options);\n // return this.context.measureText(text);\n\n const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;\n const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);\n const textMeasure = fastTextMeasure.measure(text, textMeasureMode);\n return textMeasure;\n }\n}\n\nexport class TextMeasureTool {\n /**\n * 获取text宽度,measureText.width\n * @param text\n * @param options\n */\n measureText(text: string, options: ITextGraphicAttribute): ITextSize {\n const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;\n const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);\n const textMeasure = fastTextMeasure.measure(text, textMeasureMode);\n return textMeasure;\n }\n\n /**\n * 获取text宽度,measureText.width\n * @param text\n * @param options\n */\n measureTextWidth(text: string, options: ITextGraphicAttribute): number {\n const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;\n const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);\n const textMeasure = fastTextMeasure.measure(text, textMeasureMode);\n return textMeasure.width;\n }\n\n /**\n * 将文本裁剪到width宽\n * @param text\n * @param options\n * @param width\n */\n clipText(\n text: string,\n options: ITextGraphicAttribute,\n width: number\n ): {\n str: string;\n width: number;\n } {\n if (text.length === 0) {\n return { str: '', width: 0 };\n }\n let length = this.measureTextWidth(text, options);\n if (length <= width) {\n return { str: text, width: length };\n }\n length = this.measureTextWidth(text[0], options);\n if (length > width) {\n return { str: '', width: 0 };\n }\n return this._clipText(text, options, width, 0, text.length - 1);\n }\n\n // 二分法找到最佳宽\n private _clipText(\n text: string,\n options: ITextGraphicAttribute,\n width: number,\n leftIdx: number,\n rightIdx: number\n ): { str: string; width: number } {\n const middleIdx = Math.floor((leftIdx + rightIdx) / 2);\n const subText = text.substring(0, middleIdx + 1);\n const strWidth = this.measureTextWidth(subText, options);\n let length: number;\n if (strWidth > width) {\n // 如果字符串的宽度大于限制宽度\n if (subText.length <= 1) {\n return { str: '', width: 0 };\n } // 如果子字符串长度小于1,而且大于给定宽的话,返回空字符串\n // 先判断是不是左侧的那个字符\n const str = text.substring(0, middleIdx);\n // 如果到左侧的字符小于或等于width,那么说明就是左侧的字符\n length = this.measureTextWidth(str, options);\n if (length <= width) {\n return { str, width: length };\n }\n // 返回leftIdx到middleIdx\n return this._clipText(text, options, width, leftIdx, middleIdx);\n } else if (strWidth < width) {\n // 如果字符串的宽度小于限制宽度\n if (middleIdx >= text.length - 1) {\n return { str: text, width: this.measureTextWidth(text, options) };\n } // 如果已经到结尾了,返回text\n // 先判断是不是右侧的那个字符\n const str = text.substring(0, middleIdx + 2);\n // 如果到右侧的字符大于或等于width,那么说明就是这个字符串\n length = this.measureTextWidth(str, options);\n if (length >= width) {\n return { str: subText, width: strWidth };\n }\n // 返回middleIdx到rightIdx\n return this._clipText(text, options, width, middleIdx, rightIdx);\n }\n // 如果相同,那么就找到text\n return { str: subText, width: strWidth };\n }\n\n clipTextWithSuffix(\n text: string,\n options: ITextGraphicAttribute,\n width: number,\n suffix: string\n ): {\n str: string;\n width: number;\n } {\n if (suffix === '') {\n return this.clipText(text, options, width);\n }\n if (text.length === 0) {\n return { str: '', width: 0 };\n }\n const length = this.measureTextWidth(text, options);\n if (length <= width) {\n return { str: text, width: length };\n }\n const suffixWidth = this.measureTextWidth(suffix, options);\n if (suffixWidth > width) {\n return { str: '', width: 0 };\n }\n width -= suffixWidth;\n const data = this._clipText(text, options, width, 0, text.length - 1);\n data.str += suffix;\n data.width += suffixWidth;\n return data;\n }\n}\n\nexport const textMeasure = new TextMeasureTool();\n\n// add user custom alphabet char set into fast measurement\nexport function setCustomAlphabetCharSet(str: string) {\n customAlphabetCharSet = str;\n fastTextMeasureCache.clear();\n // container.load(textMeasureModule);\n}\n\n// change fast textMeasure into canvas textMeasure\nexport function restoreMeasureText() {\n textMeasureMode = 'canvas';\n container.load(restoreTextMeasureModule);\n}\n"]}
package/es/vrender.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,MAAM,UAAU,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,gBAAgB,EAAE,CAAC;IAEnB,IAAI,YAAY,EAAE,EAAE;QAClB,cAAc,CAAC,SAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,SAAS,EAAE,EAAE;QACtB,WAAW,CAAC,SAAS,CAAC,CAAC;KACxB;IACD,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC;IACnB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","file":"vrender.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"0.22.1\";\n\nlet registed = false;\nexport function registerForVrender() {\n if (registed) {\n return;\n }\n registed = true;\n // 注册内置组件\n preLoadAllModule();\n\n if (isBrowserEnv()) {\n loadBrowserEnv(container);\n } else if (isNodeEnv()) {\n loadNodeEnv(container);\n }\n registerArc();\n registerArc3d();\n registerArea();\n registerCircle();\n registerGlyph();\n registerGroup();\n registerImage();\n registerLine();\n registerPath();\n registerPolygon();\n registerPyramid3d();\n registerRect();\n registerRect3d();\n registerRichtext();\n registerShadowRoot();\n registerSymbol();\n registerText();\n registerWrapText();\n}\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
1
+ {"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,MAAM,UAAU,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,gBAAgB,EAAE,CAAC;IAEnB,IAAI,YAAY,EAAE,EAAE;QAClB,cAAc,CAAC,SAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,SAAS,EAAE,EAAE;QACtB,WAAW,CAAC,SAAS,CAAC,CAAC;KACxB;IACD,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC;IACnB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","file":"vrender.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"0.22.2-alpha.0\";\n\nlet registed = false;\nexport function registerForVrender() {\n if (registed) {\n return;\n }\n registed = true;\n // 注册内置组件\n preLoadAllModule();\n\n if (isBrowserEnv()) {\n loadBrowserEnv(container);\n } else if (isNodeEnv()) {\n loadNodeEnv(container);\n }\n registerArc();\n registerArc3d();\n registerArea();\n registerCircle();\n registerGlyph();\n registerGroup();\n registerImage();\n registerLine();\n registerPath();\n registerPolygon();\n registerPyramid3d();\n registerRect();\n registerRect3d();\n registerRichtext();\n registerShadowRoot();\n registerSymbol();\n registerText();\n registerWrapText();\n}\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}