@visactor/vtable 0.15.1 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/cjs/core/BaseTable.js +2 -2
  2. package/cjs/core/BaseTable.js.map +1 -1
  3. package/cjs/event/listener/table-group.js +12 -2
  4. package/cjs/event/listener/table-group.js.map +1 -1
  5. package/cjs/index.d.ts +1 -1
  6. package/cjs/index.js +1 -1
  7. package/cjs/index.js.map +1 -1
  8. package/cjs/scenegraph/group-creater/cell-helper.js +1 -1
  9. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  10. package/cjs/scenegraph/group-creater/column-helper.js +2 -2
  11. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  12. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +11 -4
  13. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  14. package/cjs/themes/ARCO.js +1 -2
  15. package/cjs/themes/BRIGHT.js +2 -1
  16. package/dist/vtable.js +41 -12
  17. package/dist/vtable.min.js +2 -2
  18. package/es/core/BaseTable.js +2 -2
  19. package/es/core/BaseTable.js.map +1 -1
  20. package/es/event/listener/table-group.js +12 -1
  21. package/es/event/listener/table-group.js.map +1 -1
  22. package/es/index.d.ts +1 -1
  23. package/es/index.js +1 -1
  24. package/es/index.js.map +1 -1
  25. package/es/scenegraph/group-creater/cell-helper.js +1 -1
  26. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  27. package/es/scenegraph/group-creater/column-helper.js +2 -2
  28. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  29. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +11 -4
  30. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  31. package/es/themes/ARCO.js +1 -2
  32. package/es/themes/BRIGHT.js +2 -1
  33. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scen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G,CAAC,CAAC;IACnB,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5G,IAAI,CAAC,WAAW,EAAE;QAChB,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC3D,SAAS,IAAI,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;SACrC;QAGD,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YACrD,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;SACrC;QAED,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE;YACtF,SAAS;YACT,UAAU;SACX,CAAC,CAAC;KACJ;SAAM;QACL,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;QAClC,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;KACrC;IACD,OAAO;QACL,SAAS;QACT,UAAU;KACX,CAAC;AACJ,CAAC","file":"column-helper.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IGraphic, IThemeSpec } from '@visactor/vrender';\nimport type { CellLocation, CellRange, TextColumnDefine } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { getProp, getRawProp } from '../utils/get-prop';\nimport type { MergeMap } from '../scenegraph';\nimport { createCell } from './cell-helper';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { isArray } from '@visactor/vutils';\n/**\n * 创建复合列 同一列支持创建不同类型单元格\n * @param columnGroup 列Group\n * @param col\n * @param colWidth 配置列宽\n * @param rowStart\n * @param rowEnd\n * @param mergeMap merge单元格信息\n * @param defaultRowHeight\n * @param table\n * @param cellLocation\n * @param rowLimit\n * @param customRender\n * @param customLayout\n * @returns\n */\nexport function createComplexColumn(\n columnGroup: Group,\n col: number,\n colWidth: number,\n rowStart: number,\n rowEnd: number,\n mergeMap: MergeMap,\n defaultRowHeight: number | number[],\n table: BaseTableAPI,\n cellLocation: CellLocation,\n rowLimit?: number\n) {\n let padding;\n let textAlign;\n let textBaseline;\n /** useColumnTheme 判断是否可以使用columnTheme */\n // insert cell into column group top\n let y = 0;\n // if (columnGroup.colHeight) {\n // // insert cell into column group bottom\n // y = columnGroup.colHeight;\n // }\n if (columnGroup.lastChild) {\n y = (columnGroup.lastChild as Group).attribute.y + (columnGroup.lastChild as Group).attribute.height;\n } else if (columnGroup.colHeight) {\n y = columnGroup.colHeight;\n }\n\n for (let j = rowStart; j <= rowEnd; j++) {\n const row = j;\n const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n let value = table.getCellValue(col, row);\n\n // 处理单元格合并\n let cellWidth = colWidth;\n // let cellHeight = table.internalProps.autoRowHeight ? 0 : table.getRowHeight(row);\n let cellHeight = table.getRowHeight(row);\n let range;\n let isMerge;\n let customStyle;\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;\n range = customMergeRange;\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n if (isMerge) {\n const mergeSize = dealMerge(range, mergeMap, table);\n cellWidth = mergeSize.cellWidth;\n cellHeight = mergeSize.cellHeight;\n }\n value = customMergeText;\n customStyle = customMergeStyle;\n }\n }\n if (!range && (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell)) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n // 所有Merge单元格,只保留左上角一个真实的单元格,其他使用空Group占位\n if (isMerge) {\n const mergeSize = dealMerge(range, mergeMap, table);\n cellWidth = mergeSize.cellWidth;\n cellHeight = mergeSize.cellHeight;\n }\n }\n\n const cellStyle = customStyle || table._getCellStyle(col, row);\n const cellTheme = getStyleTheme(\n cellStyle,\n table,\n range ? range.start.col : col,\n range ? range.start.row : row,\n getProp\n ).theme;\n cellTheme.group.width = colWidth;\n cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight;\n if (cellTheme._vtable.padding) {\n padding = cellTheme._vtable.padding;\n }\n if (cellTheme.text.textAlign) {\n textAlign = cellTheme.text.textAlign;\n }\n if (cellTheme.text.textBaseline) {\n textBaseline = cellTheme.text.textBaseline;\n }\n\n // enable clip body\n if (cellLocation !== 'body' && !cellTheme.group.fill) {\n cellTheme.group.fill = '#fff';\n }\n // margin = getProp('margin', headerStyle, col, 0, table)\n\n const type =\n (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||\n 'text';\n\n // deal with promise data\n if (isPromise(value)) {\n dealPromiseData(\n value,\n table,\n createCell.bind(\n null,\n type,\n value,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme\n )\n );\n columnGroup.updateColumnRowNumber(row);\n // const height = table.getRowHeight(row);\n const height = isMerge\n ? table.getRowHeight(row) / (range.end.row - range.start.row + 1)\n : table.getRowHeight(row);\n columnGroup.updateColumnHeight(height);\n y += height;\n } else {\n const cellGroup = createCell(\n type,\n value,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme\n );\n columnGroup.updateColumnRowNumber(row);\n // // const height = cellGroup.attribute.height;\n // const height = isMerge\n // ? cellGroup.attribute.height / (range.end.row - range.start.row + 1)\n // : cellGroup.attribute.height;\n // columnGroup.updateColumnHeight(height);\n // y += height;\n if (isMerge) {\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n const { width: contentWidth } = cellGroup.attribute;\n const { height: contentHeight } = cellGroup.attribute;\n cellGroup.contentWidth = contentWidth;\n cellGroup.contentHeight = contentHeight;\n\n resizeCellGroup(cellGroup, rangeWidth, rangeHeight, range, table);\n columnGroup.updateColumnHeight(rangeHeight);\n y += rangeHeight;\n } else {\n columnGroup.updateColumnHeight(cellGroup.attribute.height);\n y += cellGroup.attribute.height;\n }\n }\n if (rowLimit && row > rowLimit) {\n break;\n }\n }\n\n columnGroup.setAttribute('width', colWidth);\n return {\n width: colWidth,\n height: y\n };\n}\n\n/**\n * 获取列分组主题\n * @param col 列索引\n * @param colWidth 列宽\n * @param table 表格实例\n * @returns 列分组主题\n */\nexport function getColumnGroupTheme(\n col: number,\n colWidth: number,\n table: BaseTableAPI\n): { theme: IThemeSpec & { _vtable: any }; hasFunctionPros: boolean } {\n const style = table._getCellStyle(col, table.columnHeaderLevelCount); // to be fixed\n const { theme: columnTheme, hasFunctionPros } = getStyleTheme(\n style,\n table,\n col,\n table.columnHeaderLevelCount,\n getRawProp\n );\n\n // get column header style\n columnTheme.group.width = colWidth;\n columnTheme.group.height = 0;\n return { theme: columnTheme, hasFunctionPros };\n}\n\nexport function resizeCellGroup(\n cellGroup: Group,\n rangeWidth: number,\n rangeHeight: number,\n range: CellRange,\n table: BaseTableAPI\n) {\n const { col, row } = cellGroup;\n const dx = -table.getColsWidth(range.start.col, col - 1);\n const dy = -table.getRowsHeight(range.start.row, row - 1);\n\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: (child.attribute.dx ?? 0) + dx,\n dy: (child.attribute.dy ?? 0) + dy\n });\n });\n\n const lineWidth = cellGroup.attribute.lineWidth;\n const isLineWidthArray = isArray(lineWidth);\n const newLineWidth = [0, 0, 0, 0];\n\n if (col === range.start.col) {\n newLineWidth[3] = isLineWidthArray ? lineWidth[3] : lineWidth;\n }\n if (row === range.start.row) {\n newLineWidth[0] = isLineWidthArray ? lineWidth[0] : lineWidth;\n }\n if (col === range.end.col) {\n newLineWidth[1] = isLineWidthArray ? lineWidth[1] : lineWidth;\n }\n if (row === range.end.row) {\n newLineWidth[2] = isLineWidthArray ? lineWidth[2] : lineWidth;\n }\n\n cellGroup.setAttributes({\n width: rangeWidth,\n height: rangeHeight,\n strokeArrayWidth: newLineWidth\n } as any);\n\n cellGroup.mergeStartCol = range.start.col;\n cellGroup.mergeStartRow = range.start.row;\n cellGroup.mergeEndCol = range.end.col;\n cellGroup.mergeEndRow = range.end.row;\n}\n\nfunction dealMerge(range: CellRange, mergeMap: MergeMap, table: BaseTableAPI) {\n let cellWidth = 0;\n let cellHeight = 0;\n const mergeResult = mergeMap.get(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`);\n if (!mergeResult) {\n for (let col = range.start.col; col <= range.end.col; col++) {\n cellWidth += table.getColWidth(col);\n }\n\n // let cellHeight = 0;\n for (let i = range.start.row; i <= range.end.row; i++) {\n cellHeight += table.getRowHeight(i);\n }\n\n mergeMap.set(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`, {\n cellWidth,\n cellHeight\n });\n } else {\n cellWidth = mergeResult.cellWidth;\n cellHeight = mergeResult.cellHeight;\n }\n return {\n cellWidth,\n cellHeight\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/group-creater/column-helper.ts"],"names":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AAK,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5G,IAAI,CAAC,WAAW,EAAE;QAChB,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC3D,SAAS,IAAI,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;SACrC;QAGD,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YACrD,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;SACrC;QAED,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE;YACtF,SAAS;YACT,UAAU;SACX,CAAC,CAAC;KACJ;SAAM;QACL,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;QAClC,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;KACrC;IACD,OAAO;QACL,SAAS;QACT,UAAU;KACX,CAAC;AACJ,CAAC","file":"column-helper.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IGraphic, IThemeSpec } from '@visactor/vrender';\nimport type { CellLocation, CellRange, TextColumnDefine } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { getProp, getRawProp } from '../utils/get-prop';\nimport type { MergeMap } from '../scenegraph';\nimport { createCell } from './cell-helper';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { isArray } from '@visactor/vutils';\n/**\n * 创建复合列 同一列支持创建不同类型单元格\n * @param columnGroup 列Group\n * @param col\n * @param colWidth 配置列宽\n * @param rowStart\n * @param rowEnd\n * @param mergeMap merge单元格信息\n * @param defaultRowHeight\n * @param table\n * @param cellLocation\n * @param rowLimit\n * @param customRender\n * @param customLayout\n * @returns\n */\nexport function createComplexColumn(\n columnGroup: Group,\n col: number,\n colWidth: number,\n rowStart: number,\n rowEnd: number,\n mergeMap: MergeMap,\n defaultRowHeight: number | number[],\n table: BaseTableAPI,\n cellLocation: CellLocation,\n rowLimit?: number\n) {\n let padding;\n let textAlign;\n let textBaseline;\n /** useColumnTheme 判断是否可以使用columnTheme */\n // insert cell into column group top\n let y = 0;\n // if (columnGroup.colHeight) {\n // // insert cell into column group bottom\n // y = columnGroup.colHeight;\n // }\n if (columnGroup.lastChild && (columnGroup.lastChild as Group).row === rowStart - 1) {\n y = (columnGroup.lastChild as Group).attribute.y + (columnGroup.lastChild as Group).attribute.height;\n } else if (columnGroup.colHeight) {\n y = columnGroup.colHeight;\n }\n\n for (let j = rowStart; j <= rowEnd; j++) {\n const row = j;\n const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n let value = table.getCellValue(col, row);\n\n // 处理单元格合并\n let cellWidth = colWidth;\n // let cellHeight = table.internalProps.autoRowHeight ? 0 : table.getRowHeight(row);\n let cellHeight = table.getRowHeight(row);\n let range;\n let isMerge;\n let customStyle;\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;\n range = customMergeRange;\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n if (isMerge) {\n const mergeSize = dealMerge(range, mergeMap, table);\n cellWidth = mergeSize.cellWidth;\n cellHeight = mergeSize.cellHeight;\n }\n value = customMergeText;\n customStyle = customMergeStyle;\n }\n }\n if (!range && (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell)) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n // 所有Merge单元格,只保留左上角一个真实的单元格,其他使用空Group占位\n if (isMerge) {\n const mergeSize = dealMerge(range, mergeMap, table);\n cellWidth = mergeSize.cellWidth;\n cellHeight = mergeSize.cellHeight;\n }\n }\n\n const cellStyle = customStyle || table._getCellStyle(col, row);\n const cellTheme = getStyleTheme(\n cellStyle,\n table,\n range ? range.start.col : col,\n range ? range.start.row : row,\n getProp\n ).theme;\n cellTheme.group.width = colWidth;\n cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight;\n if (cellTheme._vtable.padding) {\n padding = cellTheme._vtable.padding;\n }\n if (cellTheme.text.textAlign) {\n textAlign = cellTheme.text.textAlign;\n }\n if (cellTheme.text.textBaseline) {\n textBaseline = cellTheme.text.textBaseline;\n }\n\n // enable clip body\n if (cellLocation !== 'body' && !cellTheme.group.fill) {\n cellTheme.group.fill = '#fff';\n }\n // margin = getProp('margin', headerStyle, col, 0, table)\n\n const type =\n (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||\n 'text';\n\n // deal with promise data\n if (isPromise(value)) {\n dealPromiseData(\n value,\n table,\n createCell.bind(\n null,\n type,\n value,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme\n )\n );\n columnGroup.updateColumnRowNumber(row);\n const height = table.getRowHeight(row);\n columnGroup.updateColumnHeight(height);\n y += height;\n } else {\n const cellGroup = createCell(\n type,\n value,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme\n );\n columnGroup.updateColumnRowNumber(row);\n if (isMerge) {\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n const { width: contentWidth } = cellGroup.attribute;\n const { height: contentHeight } = cellGroup.attribute;\n cellGroup.contentWidth = contentWidth;\n cellGroup.contentHeight = contentHeight;\n\n resizeCellGroup(cellGroup, rangeWidth, rangeHeight, range, table);\n columnGroup.updateColumnHeight(rangeHeight);\n y += rangeHeight;\n } else {\n columnGroup.updateColumnHeight(cellGroup.attribute.height);\n y += cellGroup.attribute.height;\n }\n }\n if (rowLimit && row > rowLimit) {\n break;\n }\n }\n\n columnGroup.setAttribute('width', colWidth);\n return {\n width: colWidth,\n height: y\n };\n}\n\n/**\n * 获取列分组主题\n * @param col 列索引\n * @param colWidth 列宽\n * @param table 表格实例\n * @returns 列分组主题\n */\nexport function getColumnGroupTheme(\n col: number,\n colWidth: number,\n table: BaseTableAPI\n): { theme: IThemeSpec & { _vtable: any }; hasFunctionPros: boolean } {\n const style = table._getCellStyle(col, table.columnHeaderLevelCount); // to be fixed\n const { theme: columnTheme, hasFunctionPros } = getStyleTheme(\n style,\n table,\n col,\n table.columnHeaderLevelCount,\n getRawProp\n );\n\n // get column header style\n columnTheme.group.width = colWidth;\n columnTheme.group.height = 0;\n return { theme: columnTheme, hasFunctionPros };\n}\n\nexport function resizeCellGroup(\n cellGroup: Group,\n rangeWidth: number,\n rangeHeight: number,\n range: CellRange,\n table: BaseTableAPI\n) {\n const { col, row } = cellGroup;\n const dx = -table.getColsWidth(range.start.col, col - 1);\n const dy = -table.getRowsHeight(range.start.row, row - 1);\n\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: (child.attribute.dx ?? 0) + dx,\n dy: (child.attribute.dy ?? 0) + dy\n });\n });\n\n const lineWidth = cellGroup.attribute.lineWidth;\n const isLineWidthArray = isArray(lineWidth);\n const newLineWidth = [0, 0, 0, 0];\n\n if (col === range.start.col) {\n newLineWidth[3] = isLineWidthArray ? lineWidth[3] : lineWidth;\n }\n if (row === range.start.row) {\n newLineWidth[0] = isLineWidthArray ? lineWidth[0] : lineWidth;\n }\n if (col === range.end.col) {\n newLineWidth[1] = isLineWidthArray ? lineWidth[1] : lineWidth;\n }\n if (row === range.end.row) {\n newLineWidth[2] = isLineWidthArray ? lineWidth[2] : lineWidth;\n }\n\n cellGroup.setAttributes({\n width: rangeWidth,\n height: rangeHeight,\n strokeArrayWidth: newLineWidth\n } as any);\n\n cellGroup.mergeStartCol = range.start.col;\n cellGroup.mergeStartRow = range.start.row;\n cellGroup.mergeEndCol = range.end.col;\n cellGroup.mergeEndRow = range.end.row;\n}\n\nfunction dealMerge(range: CellRange, mergeMap: MergeMap, table: BaseTableAPI) {\n let cellWidth = 0;\n let cellHeight = 0;\n const mergeResult = mergeMap.get(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`);\n if (!mergeResult) {\n for (let col = range.start.col; col <= range.end.col; col++) {\n cellWidth += table.getColWidth(col);\n }\n\n // let cellHeight = 0;\n for (let i = range.start.row; i <= range.end.row; i++) {\n cellHeight += table.getRowHeight(i);\n }\n\n mergeMap.set(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`, {\n cellWidth,\n cellHeight\n });\n } else {\n cellWidth = mergeResult.cellWidth;\n cellHeight = mergeResult.cellHeight;\n }\n return {\n cellWidth,\n cellHeight\n };\n}\n"]}
@@ -43,11 +43,11 @@ function dynamicSetY(y, proxy) {
43
43
  }
44
44
 
45
45
  function move(deltaRow, screenTopRow, screenTopY, y, proxy) {
46
- deltaRow > 0 ? (moveCell(deltaRow, "up", screenTopRow, screenTopY, proxy), proxy.updateBody(y - proxy.deltaY)) : deltaRow < 0 ? (moveCell(-deltaRow, "down", screenTopRow, screenTopY, proxy),
46
+ deltaRow > 0 ? (moveCell(deltaRow, "up", screenTopRow, screenTopY, y, proxy), proxy.updateBody(y - proxy.deltaY)) : deltaRow < 0 ? (moveCell(-deltaRow, "down", screenTopRow, screenTopY, y, proxy),
47
47
  proxy.updateBody(y - proxy.deltaY)) : proxy.updateBody(y - proxy.deltaY);
48
48
  }
49
49
 
50
- function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
50
+ function moveCell(count, direction, screenTopRow, screenTopY, y, proxy) {
51
51
  return __awaiter(this, void 0, void 0, (function*() {
52
52
  if ("up" === direction && proxy.rowEnd + count > proxy.bodyBottomRow ? count = proxy.bodyBottomRow - proxy.rowEnd : "down" === direction && proxy.rowStart - count < proxy.bodyTopRow && (count = proxy.rowStart - proxy.bodyTopRow),
53
53
  count < 0 && (direction = "up" === direction ? "down" : "up", count = -count), count < proxy.rowEnd - proxy.rowStart) {
@@ -75,7 +75,7 @@ function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
75
75
  } else {
76
76
  const distStartRow = "up" === direction ? proxy.rowStart + count : proxy.rowStart - count, distEndRow = "up" === direction ? proxy.rowEnd + count : proxy.rowEnd - count, distStartRowY = proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1);
77
77
  let syncTopRow, syncBottomRow;
78
- "autoHeight" === proxy.table.heightMode ? (syncTopRow = distStartRow, syncBottomRow = distEndRow) : (syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - 1 * proxy.screenRowCount),
78
+ if ("autoHeight" === proxy.table.heightMode ? (syncTopRow = distStartRow, syncBottomRow = distEndRow) : (syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - 1 * proxy.screenRowCount),
79
79
  syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + 2 * proxy.screenRowCount)),
80
80
  (0, compute_row_height_1.computeRowsHeight)(proxy.table, syncTopRow, syncBottomRow),
81
81
  updateAllRowPosition(distStartRowY, count, direction, proxy), proxy.rowStart = distStartRow,
@@ -83,7 +83,14 @@ function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
83
83
  update_auto_row_1.updateAutoRow)(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? "down" : "up"),
84
84
  (0, update_auto_row_1.updateAutoRow)(0, proxy.table.frozenColCount - 1, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? "down" : "up"),
85
85
  (0, update_auto_row_1.updateAutoRow)(proxy.table.colCount - proxy.table.rightFrozenColCount, proxy.table.colCount - 1, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? "down" : "up")),
86
- proxy.table.scenegraph.proxy.deltaY = 0, proxy.currentRow = "up" === direction ? proxy.currentRow + count : proxy.currentRow - count,
86
+ syncTopRow === proxy.bodyTopRow) {
87
+ const delaY = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, syncTopRow, !0).attribute.y - y;
88
+ proxy.table.scenegraph.proxy.deltaY = delaY;
89
+ } else if (syncBottomRow === proxy.bodyBottomRow) {
90
+ const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, syncBottomRow, !0), delaY = cellGroup.attribute.y + cellGroup.attribute.height - (proxy.table.tableNoFrameHeight - proxy.table.getFrozenRowsHeight()) - y;
91
+ proxy.table.scenegraph.proxy.deltaY = -delaY;
92
+ } else proxy.table.scenegraph.proxy.deltaY = 0;
93
+ proxy.currentRow = "up" === direction ? proxy.currentRow + count : proxy.currentRow - count,
87
94
  proxy.totalRow = Math.max(0, Math.min(proxy.table.rowCount - 1, "up" === direction ? proxy.totalRow + count : proxy.totalRow - count)),
88
95
  proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2),
89
96
  proxy.rowUpdatePos = proxy.rowStart, proxy.rowUpdateDirection = distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? "down" : "up",
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/group-creater/progress/update-position/d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CAAC,cAAc,EAAE,GAAG,EAAE,EAAE;QACzD,KAAK,IAAI,GAAG,GAAG,UAAU,EAAE,GAAG,IAAI,aAAa,EAAE,GAAG,EAAE,EAAE;YAEtD,MAAM,SAAS,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;YAC/D,KAAK,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;SACzC;KACF;IAED,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;QACxG,KAAK,IAAI,GAAG,GAAG,UAAU,EAAE,GAAG,IAAI,aAAa,EAAE,GAAG,EAAE,EAAE;YAEtD,MAAM,SAAS,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACzD,KAAK,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;SACzC;KACF;IAED,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE,EAAE;QAClE,KAAK,IAAI,GAAG,GAAG,UAAU,EAAE,GAAG,IAAI,aAAa,EAAE,GAAG,EAAE,EAAE;YAEtD,MAAM,SAAS,GAAG,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACzD,KAAK,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;SACzC;KACF;IACD,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;AAC3C,CAAC;AA1BD,4CA0BC","file":"dynamic-set-y.js","sourcesContent":["import type { Group } from '../../../graphic/group';\nimport { computeRowsHeight } from '../../../layout/compute-row-height';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoRow } from './update-auto-row';\n\nexport async function dynamicSetY(y: number, proxy: SceneProxy) {\n // 计算变动row range\n // const screenTopRow = proxy.table.getRowAt(y).row;\n // proxy.deltaY = 0;\n const screenTop = (proxy.table as any).getTargetRowAt(y + proxy.table.scenegraph.colHeaderGroup.attribute.height);\n if (!screenTop) {\n return;\n }\n const screenTopRow = screenTop.row;\n const screenTopY = screenTop.top;\n proxy.screenTopRow = screenTopRow;\n const deltaRow = screenTopRow - proxy.referenceRow;\n move(deltaRow, screenTopRow, screenTopY, y, proxy);\n // proxy.table.scenegraph.updateNextFrame();\n}\n\nfunction move(deltaRow: number, screenTopRow: number, screenTopY: number, y: number, proxy: SceneProxy) {\n if (deltaRow > 0) {\n // 向下滚动,顶部cell group移到底部\n moveCell(deltaRow, 'up', screenTopRow, screenTopY, proxy);\n proxy.updateBody(y - proxy.deltaY);\n } else if (deltaRow < 0) {\n // 向上滚动,底部cell group移到顶部\n moveCell(-deltaRow, 'down', screenTopRow, screenTopY, proxy);\n proxy.updateBody(y - proxy.deltaY);\n } else {\n // 不改变row,更新body group范围\n proxy.updateBody(y - proxy.deltaY);\n }\n}\n\nasync function moveCell(\n count: number,\n direction: 'up' | 'down',\n screenTopRow: number,\n screenTopY: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'up' && proxy.rowEnd + count > proxy.bodyBottomRow) {\n count = proxy.bodyBottomRow - proxy.rowEnd;\n } else if (direction === 'down' && proxy.rowStart - count < proxy.bodyTopRow) {\n count = proxy.rowStart - proxy.bodyTopRow;\n }\n if (count < 0) {\n direction = direction === 'up' ? 'down' : 'up';\n count = -count;\n }\n\n // 两种更新模式\n // 1. count < rowEnd - rowStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= rowEnd - rowStart:整体移动到目标位置\n if (count < proxy.rowEnd - proxy.rowStart) {\n // 计算更新区域\n const startRow = direction === 'up' ? proxy.rowStart : proxy.rowEnd - count + 1;\n const endRow = direction === 'up' ? proxy.rowStart + count - 1 : proxy.rowEnd;\n const distStartRow = direction === 'up' ? proxy.rowEnd + 1 : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowStart - 1;\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n const topRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n const bottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n // get coincide of distStartRow&distEndRow and topRow&BottomRow\n // syncTopRow = Math.max(distStartRow, topRow);\n // syncBottomRow = Math.min(distEndRow, bottomRow);\n syncTopRow = topRow;\n syncBottomRow = bottomRow;\n }\n\n // const syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n // const syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n // console.log('move', startRow, endRow, direction);\n updatePartRowPosition(startRow, endRow, direction, proxy);\n\n proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n // body group\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n\n // row header group\n updateAutoRow(\n 0, // colStart\n proxy.table.frozenColCount - 1, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n\n // right frozen group\n updateAutoRow(\n proxy.table.colCount - proxy.table.rightFrozenColCount, // colStart\n proxy.table.colCount - 1, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n\n const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, screenTopRow, true);\n const delaY =\n screenTopY - (cellGroup.attribute.y + proxy.table.getFrozenRowsHeight() + proxy.table.scenegraph.proxy.deltaY);\n proxy.table.scenegraph.proxy.deltaY += delaY;\n }\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = Math.max(\n 0,\n Math.min(proxy.table.rowCount - 1, direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count)\n );\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = Math.min(proxy.rowUpdatePos, distStartRow);\n proxy.rowUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n } else {\n const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n const distStartRowY = proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1);\n\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n }\n //console.log('更新同步范围', syncTopRow, syncBottomRow);\n\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n // 更新同步范围\n updateAllRowPosition(distStartRowY, count, direction, proxy);\n\n proxy.rowStart = distStartRow;\n proxy.rowEnd = distEndRow;\n\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n // body group\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n\n // row header group\n updateAutoRow(\n 0, // colStart\n proxy.table.frozenColCount - 1, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n\n // right frozen group\n updateAutoRow(\n proxy.table.colCount - proxy.table.rightFrozenColCount, // colStart\n proxy.table.colCount - 1, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n proxy.table.scenegraph.proxy.deltaY = 0;\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = Math.max(\n 0,\n Math.min(proxy.table.rowCount - 1, direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count)\n );\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = proxy.rowStart;\n proxy.rowUpdateDirection = distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up';\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n }\n}\n\nfunction updatePartRowPosition(startRow: number, endRow: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n if (colGroup) {\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n }\n}\n\nfunction updateCellGroupPosition(colGroup: Group, direction: 'up' | 'down', proxy: SceneProxy) {\n if (direction === 'up') {\n const cellGroup = colGroup.firstChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.lastChild as Group).row + 1,\n (colGroup.lastChild as Group).attribute.y + proxy.table.getRowHeight((colGroup.lastChild as Group).row) // (colGroup.lastChild as Group).attribute.height\n );\n colGroup.appendChild(cellGroup);\n } else {\n const cellGroup = colGroup.lastChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.firstChild as Group).row - 1,\n (colGroup.firstChild as Group).attribute.y - proxy.table.getRowHeight((cellGroup as Group).row) // cellGroup.attribute.height\n );\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n }\n}\n\nfunction updateAllRowPosition(distStartRowY: number, count: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n}\n\nexport function updateRowContent(syncTopRow: number, syncBottomRow: number, proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row, true);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n proxy.table.scenegraph.updateNextFrame();\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/group-creater/progress/update-position/dynamic-set-y.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2EAAuE;AAEvE,uDAAkD;AAElD,SAAsB,WAAW,CAAC,CAAS,EAAE,KAAiB;;QAI5D,MAAM,SAAS,GAAI,KAAK,CAAC,KAAa,CAAC,cAAc,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAClH,IAAI,CAAC,SAAS,EAAE;YACd,OAAO;SACR;QACD,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC;QACnC,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC;QACjC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;QAClC,MAAM,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QACnD,IAAI,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAErD,CAAC;CAAA;AAdD,kCAcC;AAED,SAAS,IAAI,CAAC,QAAgB,EAAE,YAAoB,EAAE,UAAkB,EAAE,CAAS,EAAE,KAAiB;IACpG,IAAI,QAAQ,GAAG,CAAC,EAAE;QAEhB,QAAQ,CAAC,QAAQ,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/group';\nimport { computeRowsHeight } from '../../../layout/compute-row-height';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoRow } from './update-auto-row';\n\nexport async function dynamicSetY(y: number, proxy: SceneProxy) {\n // 计算变动row range\n // const screenTopRow = proxy.table.getRowAt(y).row;\n // proxy.deltaY = 0;\n const screenTop = (proxy.table as any).getTargetRowAt(y + proxy.table.scenegraph.colHeaderGroup.attribute.height);\n if (!screenTop) {\n return;\n }\n const screenTopRow = screenTop.row;\n const screenTopY = screenTop.top;\n proxy.screenTopRow = screenTopRow;\n const deltaRow = screenTopRow - proxy.referenceRow;\n move(deltaRow, screenTopRow, screenTopY, y, proxy);\n // proxy.table.scenegraph.updateNextFrame();\n}\n\nfunction move(deltaRow: number, screenTopRow: number, screenTopY: number, y: number, proxy: SceneProxy) {\n if (deltaRow > 0) {\n // 向下滚动,顶部cell group移到底部\n moveCell(deltaRow, 'up', screenTopRow, screenTopY, y, proxy);\n proxy.updateBody(y - proxy.deltaY);\n } else if (deltaRow < 0) {\n // 向上滚动,底部cell group移到顶部\n moveCell(-deltaRow, 'down', screenTopRow, screenTopY, y, proxy);\n proxy.updateBody(y - proxy.deltaY);\n } else {\n // 不改变row,更新body group范围\n proxy.updateBody(y - proxy.deltaY);\n }\n}\n\nasync function moveCell(\n count: number,\n direction: 'up' | 'down',\n screenTopRow: number,\n screenTopY: number,\n y: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'up' && proxy.rowEnd + count > proxy.bodyBottomRow) {\n count = proxy.bodyBottomRow - proxy.rowEnd;\n } else if (direction === 'down' && proxy.rowStart - count < proxy.bodyTopRow) {\n count = proxy.rowStart - proxy.bodyTopRow;\n }\n if (count < 0) {\n direction = direction === 'up' ? 'down' : 'up';\n count = -count;\n }\n\n // 两种更新模式\n // 1. count < rowEnd - rowStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= rowEnd - rowStart:整体移动到目标位置\n if (count < proxy.rowEnd - proxy.rowStart) {\n // 计算更新区域\n const startRow = direction === 'up' ? proxy.rowStart : proxy.rowEnd - count + 1;\n const endRow = direction === 'up' ? proxy.rowStart + count - 1 : proxy.rowEnd;\n const distStartRow = direction === 'up' ? proxy.rowEnd + 1 : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowStart - 1;\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n const topRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n const bottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n // get coincide of distStartRow&distEndRow and topRow&BottomRow\n // syncTopRow = Math.max(distStartRow, topRow);\n // syncBottomRow = Math.min(distEndRow, bottomRow);\n syncTopRow = topRow;\n syncBottomRow = bottomRow;\n }\n\n // const syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n // const syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n // console.log('move', startRow, endRow, direction);\n updatePartRowPosition(startRow, endRow, direction, proxy);\n\n proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n // body group\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n\n // row header group\n updateAutoRow(\n 0, // colStart\n proxy.table.frozenColCount - 1, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n\n // right frozen group\n updateAutoRow(\n proxy.table.colCount - proxy.table.rightFrozenColCount, // colStart\n proxy.table.colCount - 1, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n\n const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, screenTopRow, true);\n const delaY =\n screenTopY - (cellGroup.attribute.y + proxy.table.getFrozenRowsHeight() + proxy.table.scenegraph.proxy.deltaY);\n proxy.table.scenegraph.proxy.deltaY += delaY;\n }\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = Math.max(\n 0,\n Math.min(proxy.table.rowCount - 1, direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count)\n );\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = Math.min(proxy.rowUpdatePos, distStartRow);\n proxy.rowUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n } else {\n const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;\n const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;\n const distStartRowY = proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1);\n\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);\n syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);\n }\n //console.log('更新同步范围', syncTopRow, syncBottomRow);\n\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n // 更新同步范围\n updateAllRowPosition(distStartRowY, count, direction, proxy);\n\n proxy.rowStart = distStartRow;\n proxy.rowEnd = distEndRow;\n\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n // body group\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n\n // row header group\n updateAutoRow(\n 0, // colStart\n proxy.table.frozenColCount - 1, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n\n // right frozen group\n updateAutoRow(\n proxy.table.colCount - proxy.table.rightFrozenColCount, // colStart\n proxy.table.colCount - 1, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n\n // update body position when click scroll bar\n if (syncTopRow === proxy.bodyTopRow) {\n const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, syncTopRow, true);\n const delaY = cellGroup.attribute.y - y;\n proxy.table.scenegraph.proxy.deltaY = delaY;\n } else if (syncBottomRow === proxy.bodyBottomRow) {\n const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, syncBottomRow, true);\n const delaY =\n cellGroup.attribute.y +\n cellGroup.attribute.height -\n (proxy.table.tableNoFrameHeight - proxy.table.getFrozenRowsHeight()) -\n y;\n proxy.table.scenegraph.proxy.deltaY = -delaY;\n } else {\n proxy.table.scenegraph.proxy.deltaY = 0;\n }\n\n proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;\n proxy.totalRow = Math.max(\n 0,\n Math.min(proxy.table.rowCount - 1, direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count)\n );\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n proxy.rowUpdatePos = proxy.rowStart;\n proxy.rowUpdateDirection = distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up';\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n }\n}\n\nfunction updatePartRowPosition(startRow: number, endRow: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n if (colGroup) {\n for (let row = startRow; row <= endRow; row++) {\n updateCellGroupPosition(colGroup, direction, proxy);\n }\n }\n }\n}\n\nfunction updateCellGroupPosition(colGroup: Group, direction: 'up' | 'down', proxy: SceneProxy) {\n if (direction === 'up') {\n const cellGroup = colGroup.firstChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.lastChild as Group).row + 1,\n (colGroup.lastChild as Group).attribute.y + proxy.table.getRowHeight((colGroup.lastChild as Group).row) // (colGroup.lastChild as Group).attribute.height\n );\n colGroup.appendChild(cellGroup);\n } else {\n const cellGroup = colGroup.lastChild as Group;\n proxy.updateCellGroupPosition(\n cellGroup,\n (colGroup.firstChild as Group).row - 1,\n (colGroup.firstChild as Group).attribute.y - proxy.table.getRowHeight((cellGroup as Group).row) // cellGroup.attribute.height\n );\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n }\n}\n\nfunction updateAllRowPosition(distStartRowY: number, count: number, direction: 'up' | 'down', proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup?.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for proxy.rowStart to proxy.rowEndproxy.rowEnd是因为在更新内可能出现row号码重复的情况\n proxy.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === proxy.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + proxy.table.getRowHeight((cellGroup._prev as Group).row)\n );\n });\n }\n}\n\nexport function updateRowContent(syncTopRow: number, syncBottomRow: number, proxy: SceneProxy) {\n // row header group\n for (let col = 0; col < proxy.table.frozenColCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row, true);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // right frozen group\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n // body group\n for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = proxy.table.scenegraph.getCell(col, row);\n const cellGroup = proxy.highPerformanceGetCell(col, row);\n proxy.updateCellGroupContent(cellGroup);\n }\n }\n proxy.table.scenegraph.updateNextFrame();\n}\n"]}
@@ -102,5 +102,4 @@ Object.defineProperty(exports, "__esModule", {
102
102
  cellBorderLineWidth: 2,
103
103
  cellBorderColor: "#3073f2"
104
104
  }
105
- };
106
- //# sourceMappingURL=ARCO.js.map
105
+ };
@@ -59,4 +59,5 @@ Object.defineProperty(exports, "__esModule", {
59
59
  selectionStyle: {
60
60
  cellBgColor: "rgba(0, 0, 255,0.1)"
61
61
  }
62
- };
62
+ };
63
+ //# sourceMappingURL=BRIGHT.js.map
package/dist/vtable.js CHANGED
@@ -37612,7 +37612,7 @@
37612
37612
  const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);
37613
37613
  let isMerge;
37614
37614
  let range;
37615
- if (cellLocation !== 'body' || define?.mergeCell) {
37615
+ if (cellLocation !== 'body' || define?.mergeCell || table.internalProps.customMergeCell) {
37616
37616
  range = table.getCellRange(col, row);
37617
37617
  isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
37618
37618
  }
@@ -37775,7 +37775,7 @@
37775
37775
  let textAlign;
37776
37776
  let textBaseline;
37777
37777
  let y = 0;
37778
- if (columnGroup.lastChild) {
37778
+ if (columnGroup.lastChild && columnGroup.lastChild.row === rowStart - 1) {
37779
37779
  y = columnGroup.lastChild.attribute.y + columnGroup.lastChild.attribute.height;
37780
37780
  }
37781
37781
  else if (columnGroup.colHeight) {
@@ -37836,9 +37836,7 @@
37836
37836
  if (isPromise$1(value)) {
37837
37837
  dealPromiseData(value, table, createCell.bind(null, type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme));
37838
37838
  columnGroup.updateColumnRowNumber(row);
37839
- const height = isMerge
37840
- ? table.getRowHeight(row) / (range.end.row - range.start.row + 1)
37841
- : table.getRowHeight(row);
37839
+ const height = table.getRowHeight(row);
37842
37840
  columnGroup.updateColumnHeight(height);
37843
37841
  y += height;
37844
37842
  }
@@ -42248,18 +42246,18 @@
42248
42246
  }
42249
42247
  function move(deltaRow, screenTopRow, screenTopY, y, proxy) {
42250
42248
  if (deltaRow > 0) {
42251
- moveCell(deltaRow, 'up', screenTopRow, screenTopY, proxy);
42249
+ moveCell(deltaRow, 'up', screenTopRow, screenTopY, y, proxy);
42252
42250
  proxy.updateBody(y - proxy.deltaY);
42253
42251
  }
42254
42252
  else if (deltaRow < 0) {
42255
- moveCell(-deltaRow, 'down', screenTopRow, screenTopY, proxy);
42253
+ moveCell(-deltaRow, 'down', screenTopRow, screenTopY, y, proxy);
42256
42254
  proxy.updateBody(y - proxy.deltaY);
42257
42255
  }
42258
42256
  else {
42259
42257
  proxy.updateBody(y - proxy.deltaY);
42260
42258
  }
42261
42259
  }
42262
- async function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
42260
+ async function moveCell(count, direction, screenTopRow, screenTopY, y, proxy) {
42263
42261
  if (direction === 'up' && proxy.rowEnd + count > proxy.bodyBottomRow) {
42264
42262
  count = proxy.bodyBottomRow - proxy.rowEnd;
42265
42263
  }
@@ -42334,7 +42332,22 @@
42334
42332
  updateAutoRow(0, proxy.table.frozenColCount - 1, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
42335
42333
  updateAutoRow(proxy.table.colCount - proxy.table.rightFrozenColCount, proxy.table.colCount - 1, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
42336
42334
  }
42337
- proxy.table.scenegraph.proxy.deltaY = 0;
42335
+ if (syncTopRow === proxy.bodyTopRow) {
42336
+ const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, syncTopRow, true);
42337
+ const delaY = cellGroup.attribute.y - y;
42338
+ proxy.table.scenegraph.proxy.deltaY = delaY;
42339
+ }
42340
+ else if (syncBottomRow === proxy.bodyBottomRow) {
42341
+ const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, syncBottomRow, true);
42342
+ const delaY = cellGroup.attribute.y +
42343
+ cellGroup.attribute.height -
42344
+ (proxy.table.tableNoFrameHeight - proxy.table.getFrozenRowsHeight()) -
42345
+ y;
42346
+ proxy.table.scenegraph.proxy.deltaY = -delaY;
42347
+ }
42348
+ else {
42349
+ proxy.table.scenegraph.proxy.deltaY = 0;
42350
+ }
42338
42351
  proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;
42339
42352
  proxy.totalRow = Math.max(0, Math.min(proxy.table.rowCount - 1, direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count));
42340
42353
  proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);
@@ -48068,6 +48081,22 @@
48068
48081
  const eventArgsSet = getCellEventArgsSet(e);
48069
48082
  const { col, row } = eventArgsSet.eventArgs;
48070
48083
  const cellInfo = table.getCellInfo(col, row);
48084
+ const mergeRange = getCellMergeInfo(table, col, row);
48085
+ if (mergeRange) {
48086
+ for (let col = mergeRange.start.col; col <= mergeRange.end.col; col++) {
48087
+ for (let row = mergeRange.start.row; row <= mergeRange.end.row; row++) {
48088
+ const cellGroup = table.scenegraph.getCell(col, row);
48089
+ cellGroup.forEachChildren((checkbox) => {
48090
+ if (checkbox.name === 'checkbox') {
48091
+ checkbox.setAttributes({
48092
+ checked: e.target.attribute.checked,
48093
+ indeterminate: e.target.attribute.indeterminate
48094
+ });
48095
+ }
48096
+ });
48097
+ }
48098
+ }
48099
+ }
48071
48100
  const cellsEvent = {
48072
48101
  ...cellInfo,
48073
48102
  event: e.nativeEvent,
@@ -51660,7 +51689,7 @@
51660
51689
  return TABLE_EVENT_TYPE;
51661
51690
  }
51662
51691
  options;
51663
- version = "0.15.1";
51692
+ version = "0.15.2";
51664
51693
  pagination;
51665
51694
  id = `VTable${Date.now()}`;
51666
51695
  headerStyleCache;
@@ -53171,7 +53200,7 @@
53171
53200
  col,
53172
53201
  row,
53173
53202
  table: this,
53174
- value: this.getCellValue(col, row),
53203
+ value: customMerge.text,
53175
53204
  dataValue: this.getCellOriginValue(col, row),
53176
53205
  cellHeaderPaths: this.getCellHeaderPaths(col, row)
53177
53206
  }, styleClass, this.options.autoWrapText);
@@ -61550,7 +61579,7 @@
61550
61579
  return new Tag$1(params ? params.attribute : {});
61551
61580
  }
61552
61581
 
61553
- const version = "0.15.1";
61582
+ const version = "0.15.2";
61554
61583
  function getIcons() {
61555
61584
  return get$2();
61556
61585
  }