@visactor/vtable 0.13.2-alpha.2 → 0.13.2-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/listener/scroll-bar.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/graphic/group.js +6 -6
- package/cjs/scenegraph/graphic/group.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +42 -6
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +3 -3
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +5 -5
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +6 -3
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +2 -1
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/layout/move-cell.js +1 -1
- package/cjs/scenegraph/layout/move-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +22 -16
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +2 -1
- package/cjs/scenegraph/scenegraph.js +10 -7
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/state/state.js.map +1 -1
- package/dist/vtable.js +121 -29
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/listener/scroll-bar.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/graphic/group.js +6 -6
- package/es/scenegraph/graphic/group.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +43 -4
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +3 -3
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +5 -5
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +6 -3
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +2 -1
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/layout/move-cell.js +1 -1
- package/es/scenegraph/layout/move-cell.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +23 -15
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +2 -1
- package/es/scenegraph/scenegraph.js +10 -7
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/state/state.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/compute-col-width.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAA8D;AAC9D,uDAAyC;AACzC,2CAAiD;AACjD,8CAAgD;AAChD,gDAA4C;AAG5C,+EAAsF;AACtF,2FAA0F;AAC1F,+CAAoD;AAEpD,SAAgB,gBAAgB,CAAC,KAAmB,EAAE,QAAiB,EAAE,MAAe,EAAE,MAAgB;;IACxG,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,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Y,GAAG,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACnD,IAAI,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACpD,OAAO,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;KAC/B;IACD,OAAO,YAAY,CAAC;AACtB,CAAC","file":"compute-col-width.js","sourcesContent":["import type { SimpleHeaderLayoutMap } from '../../layout';\nimport type { TextColumnDefine } from '../../ts-types';\nimport { HierarchyState, IconPosition } from '../../ts-types';\nimport * as calc from '../../tools/calc';\nimport { validToString } from '../../tools/util';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentWidth } from '../../components/axis/get-axis-component-size';\nimport { Group as VGroup } from '@visactor/vrender';\n\nexport function computeColsWidth(table: BaseTableAPI, colStart?: number, colEnd?: number, update?: boolean): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n colStart = colStart ?? 0;\n colEnd = colEnd ?? table.colCount - 1;\n // table._clearColRangeWidthsMap();\n // clear colRangeWidthsMap\n if (colStart === 0 && colEnd === table.colCount - 1) {\n table._clearColRangeWidthsMap();\n // } else {\n // for (let col = colStart; col <= colEnd; col++) {\n // table._clearColRangeWidthsMap(col);\n // }\n }\n\n const oldColWidths: number[] = [];\n const newWidths: number[] = [];\n if (update) {\n for (let col = 0; col < table.colCount; col++) {\n oldColWidths[col] = table.getColWidth(col);\n }\n }\n for (let col = colStart; col <= colEnd; col++) {\n let maxWidth;\n if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-header' &&\n 'showHeader' in table.internalProps.layoutMap\n ) {\n const temp = table.internalProps.layoutMap.showHeader;\n table.internalProps.layoutMap.showHeader = true;\n maxWidth = computeColWidth(col, 0, table.internalProps.layoutMap.headerLevelCount, table, update);\n table.internalProps.layoutMap.showHeader = temp;\n } else if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-body'\n ) {\n maxWidth = computeColWidth(\n col,\n table.internalProps.layoutMap.getBodyRange().start.row,\n table.internalProps.layoutMap.getBodyRange().end.row,\n table,\n update\n );\n } else {\n maxWidth = computeColWidth(col, 0, table.rowCount - 1, table, update);\n }\n\n table._setColContentWidth(col, maxWidth);\n\n const oldWidth = table.getColWidth(col);\n if (oldWidth !== maxWidth) {\n table._clearColRangeWidthsMap(col);\n }\n if (update) {\n newWidths[col] = maxWidth;\n } else {\n table.setColWidth(col, maxWidth, false, true);\n }\n }\n\n // 处理adaptive宽度\n if (table.widthMode === 'adaptive') {\n table._clearColRangeWidthsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const rowHeaderWidth = table.getColsWidth(0, table.rowHeaderLevelCount - 1);\n const rightHeaderWidth = table.isPivotChart() ? table.getRightFrozenColsWidth() : 0;\n const totalDrawWidth = table.tableNoFrameWidth - rowHeaderWidth - rightHeaderWidth;\n const startCol = table.rowHeaderLevelCount;\n const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;\n let actualWidth = 0;\n for (let col = startCol; col < endCol; col++) {\n actualWidth += update ? newWidths[col] : table.getColWidth(col);\n }\n const factor = totalDrawWidth / actualWidth;\n for (let col = startCol; col < endCol; col++) {\n let colWidth;\n if (col === endCol - 1) {\n colWidth =\n totalDrawWidth -\n (update\n ? newWidths.reduce((acr, cur, index) => {\n if (index >= startCol && index <= endCol - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getColsWidth(startCol, endCol - 2));\n } else {\n colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);\n }\n if (update) {\n newWidths[col] = colWidth;\n } else {\n table.setColWidth(col, colWidth, false, true);\n }\n }\n } else if (table.autoFillWidth) {\n // 处理风神列宽特殊逻辑\n table._clearColRangeWidthsMap();\n const canvasWidth = table.tableNoFrameWidth;\n let actualWidth = 0;\n let actualHeaderWidth = 0;\n for (let col = 0; col < table.colCount; col++) {\n const colWidth = update ? newWidths[col] : table.getColWidth(col);\n if (col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) {\n actualHeaderWidth += colWidth;\n }\n\n actualWidth += colWidth;\n }\n\n // 如果内容宽度小于canvas宽度,执行adaptive放大\n if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {\n const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);\n for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {\n if (update) {\n newWidths[col] = newWidths[col] * factor;\n } else {\n table.setColWidth(col, table.getColWidth(col) * factor, false, true);\n }\n }\n }\n }\n // console.log('computeColsWidth time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time);\n\n if (update) {\n for (let col = 0; col < table.colCount; col++) {\n // newColWidth could not be in column min max range possibly\n // const newColWidth = table._adjustColWidth(col, newWidths[col]) ?? table.getColWidth(col);\n const newColWidth = newWidths[col] ?? table.getColWidth(col);\n if (newColWidth !== oldColWidths[col]) {\n // update the column width in scenegraph\n table.scenegraph.updateColWidth(col, newColWidth - oldColWidths[col]);\n }\n }\n }\n // console.log('computeColsWidth time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, colStart, colEnd);\n}\n\n/**\n * @description: 计算列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {BaseTableAPI} table\n * @param {boolean} forceCompute\n * @return {*}\n */\nexport function computeColWidth(\n col: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n forceCompute: boolean\n): number {\n // const { layoutMap, transpose } = table.internalProps;\n // let { width } = layoutMap?.getColumnWidthDefined(col) ?? {};\n\n // if (transpose) {\n // // 转置模式\n // if (table.widthMode === 'standard') {\n // // return table.getColWidth(col);\n // // standard模式使用默认值\n // if (table.isRowHeader(col, 0) || table.isCornerHeader(col, 0)) {\n // const defaultWidth = Array.isArray(table.defaultHeaderColWidth)\n // ? table.defaultHeaderColWidth[col] ?? table.defaultColWidth\n // : table.defaultHeaderColWidth;\n // if (defaultWidth === 'auto') {\n // widthfffff = 'auto';\n // } else {\n // return defaultWidth;\n // }\n // }\n\n // if (widthfffff !== 'auto') {\n // // if (width && (typeof width === 'string' || width > 0)) return width;\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // return table.defaultColWidth;\n // }\n // } else if (\n // table.widthMode === 'adaptive' &&\n // col === 0 &&\n // widthfffff !== 'auto' &&\n // (layoutMap as SimpleHeaderLayoutMap)?.showHeader\n // ) {\n // // ToBeFixed hack逻辑,转置第一列列宽为header[0]\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // }\n // // autoWidth adaptive 需要计算内容宽度\n // // do nothing\n // } else if (widthfffff !== 'auto' && table.widthMode !== 'autoWidth' && !forceCompute) {\n // // if (width && (typeof width === 'string' || width > 0)) return width;\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // //是透视表的行表头部分 则宽度按defaultHeaderColWidth设置\n // const defaultWidth = table.getColWidthDefine(col);\n // if (defaultWidth !== 'auto') {\n // return table.getColWidth(col);\n // }\n // }\n const width = getColWidthDefinedWidthResizedWidth(col, table);\n if (typeof width === 'number') {\n return width;\n } else if (width !== 'auto' && typeof width === 'string') {\n // return calc.toPx(width, table.internalProps.calcWidthContext);\n return table._adjustColWidth(col, table._colWidthDefineToPxWidth(width));\n }\n return computeAutoColWidth(width, col, startRow, endRow, forceCompute, table);\n}\n\n/**\n * @description: 计算width: auto情况下的列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeAutoColWidth(\n widthDeifne: string | number,\n col: number,\n startRow: number,\n endRow: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number {\n // 处理 auto width\n let maxWidth = 0;\n let deltaRow = 1;\n if (endRow - startRow > 5000) {\n // 超过5000行启动列宽自动计算采样\n deltaRow = Math.ceil((endRow - startRow) / 5000);\n }\n // 如果是透视图\n if (table.isPivotChart() && col >= table.rowHeaderLevelCount && col < table.colCount - table.rightFrozenColCount) {\n if (!(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) {\n //并且指标是以行展示 计算列宽需要根据x轴的值域范围\n const optimunWidth = (table.internalProps.layoutMap as PivotHeaderLayoutMap).getOptimunWidthForChart(col);\n if (optimunWidth > 0) {\n return optimunWidth;\n }\n } else {\n //直接拿表头的默认列宽\n return table.defaultColWidth;\n }\n }\n\n for (let row = startRow; row <= endRow; row += deltaRow) {\n // 判断透视图轴组件\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentWidth(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxWidth = Math.max(axisWidth, maxWidth);\n continue;\n }\n } else if (\n layout.isLeftBottomCorner(col, row) ||\n layout.isRightTopCorner(col, row) ||\n layout.isRightBottomCorner(col, row)\n ) {\n // 透视图三角为无效单元格,不参与宽度计算\n continue;\n }\n }\n\n // 判断CustomRender\n const customWidth = computeCustomRenderWidth(col, row, table);\n if (typeof customWidth === 'number') {\n maxWidth = Math.max(customWidth, maxWidth);\n continue;\n }\n\n // 判断透视表如果在指标\n // const indicatorWidth = computeIndicatorWidth(col, row, forceCompute, table);\n // const indicatorWidth = table.internalProps.layoutMap.getColumnWidthDefined(col);\n const indicatorWidth = widthDeifne;\n if (typeof indicatorWidth === 'number' && table.widthMode === 'standard') {\n maxWidth = Math.max(indicatorWidth, maxWidth);\n continue;\n }\n\n const cellType = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row)?.headerType\n : table.getBodyColumnType(col, row);\n if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar') {\n // text&link&progressbar测量文字宽度\n // image&video&sparkline使用默认宽度\n maxWidth = Math.max(maxWidth, table.getColWidthDefinedNumber(col) || 0);\n continue;\n }\n\n // 处理树形展开\n let cellHierarchyIndent = 0;\n const layoutMap = table.internalProps.layoutMap;\n //判断是否为表头\n if (layoutMap.isHeader(col, row)) {\n const hd = layoutMap.getHeader(col, row);\n // 如果某级表头设置了only-body,在计算表头内容宽度时跳过改级表头\n if (hd?.define?.columnWidthComputeMode === 'only-body') {\n continue;\n }\n if (hd?.hierarchyLevel) {\n cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * ((layoutMap as PivotHeaderLayoutMap).rowHierarchyIndent ?? 0);\n }\n } else {\n // 基本表格表身body单元格 如果是树形展开 需要考虑缩进值\n // const cellHierarchyState = table.getHierarchyState(col, row);\n // if (cellHierarchyState === HierarchyState.expand || cellHierarchyState === HierarchyState.collapse) {\n const define = table.getBodyColumnDefine(col, row);\n if (define?.tree) {\n const indexArr = table.dataSource.getIndexKey(table.getRecordIndexByCell(col, row));\n cellHierarchyIndent =\n Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none\n ? (indexArr.length - 1) * ((layoutMap as SimpleHeaderLayoutMap).hierarchyIndent ?? 0)\n : 0;\n }\n }\n\n // 测量文字宽度\n const textWidth = computeTextWidth(col, row, table);\n maxWidth = Math.max(textWidth + cellHierarchyIndent, maxWidth);\n }\n\n // 处理宽度限制\n const colMinWidth = table.getMinColWidth(col);\n const colMaxWidth = table.getMaxColWidth(col);\n if (maxWidth < colMinWidth) {\n return colMinWidth;\n } else if (maxWidth > colMaxWidth) {\n return colMaxWidth;\n }\n return maxWidth;\n}\n\n/**\n * @description: 计算customRender相关列宽\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderWidth(col: number, row: number, table: BaseTableAPI): number | undefined {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanCol = 1;\n let width = 0;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n width = (customLayoutObj.rootContainer as VGroup).AABBBounds.width() ?? 0;\n // width = (customLayoutObj.rootContainer as VGroup).attribute.width ?? 0;\n } else if (customLayoutObj.rootContainer) {\n customLayoutObj.rootContainer.isRoot = true;\n const size = customLayoutObj.rootContainer.getContentSize();\n width = size.width ?? 0;\n } else {\n width = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n width = customRenderObj?.expectedWidth ?? 0;\n } else {\n width = customRender?.expectedWidth ?? 0;\n }\n return width / spanCol;\n }\n return undefined;\n}\n\n/**\n * @description: 计算指标相关列宽\n * @param {number} col\n * @param {number} row\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeIndicatorWidth(\n col: number,\n row: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number | undefined {\n const { layoutMap } = table.internalProps;\n if (table.isPivotTable() && (layoutMap as PivotHeaderLayoutMap).isColumnIndicatorHeader(col, row)) {\n // 透视表如果在指标中配置了宽度,使用该宽度作为指标单元格及下面内容单元格的列宽\n const body = layoutMap.getBody(col, row);\n if (body && body.width && body.width !== 'auto' && !forceCompute) {\n const width = Math.round(calc.toPx(body.width, table.internalProps.calcWidthContext));\n return width;\n }\n }\n return undefined;\n}\n\n/**\n * @description: 计算文字宽度\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextWidth(col: number, row: number, table: BaseTableAPI): number {\n let maxWidth = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconWidth = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (icon.positionType !== IconPosition.absoluteRight) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n }\n });\n }\n let spanCol = 1;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const paddingWidth = padding[1] + padding[3]; // + cellHierarchyIndent\n\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lines = validToString(cellValue).split('\\n') || [];\n if (lines.length >= 1) {\n // eslint-disable-next-line no-loop-func\n lines.forEach((line: string) => {\n const width = table.measureText(line.slice(0, table.options.maxCharactersNumber || 200), {\n fontSize,\n fontFamily,\n fontWeight\n }).width;\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (width + paddingWidth + 4 + iconWidth) / spanCol, // 这里+4为列宽测量结果的buffer\n maxWidth\n );\n });\n } else {\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (paddingWidth + 4 + iconWidth) / spanCol,\n maxWidth\n );\n }\n // 判断是否需要限制最大宽度 之前写死的450 需要使用配置来判断\n if (table.internalProps.limitMaxAutoWidth !== false) {\n maxWidth = Math.min(\n typeof table.internalProps.limitMaxAutoWidth === 'number' ? table.internalProps.limitMaxAutoWidth : 450,\n maxWidth\n );\n }\n\n return maxWidth;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: 0,\n height: 0\n };\n}\n\nfunction getColWidthDefinedWidthResizedWidth(col: number, table: BaseTableAPI) {\n const widthDefined = table.getColWidthDefined(col);\n if (table.internalProps._widthResizedColMap.has(col)) {\n return table.getColWidth(col);\n }\n return widthDefined;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/compute-col-width.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAA8D;AAC9D,uDAAyC;AACzC,2CAAiD;AACjD,8CAAgD;AAChD,gDAA4C;AAG5C,+EAAsF;AACtF,2FAA0F;AAC1F,+CAAoD;AAEpD,SAAgB,gBAAgB,CAAC,KAAmB,EAAE,QAAiB,EAAE,MAAe,EAAE,MAAgB;;IACxG,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,CAAC,CAAC;IACzB,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC;IAGtC,IAAI,QAAQ,KAAK,CAAC,IAAI,MAAM,KAAK,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE;QACnD,KAAK,CAAC,uBAAuB,EAAE,CAAC;KAKjC;IAED,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,SAAS,GAAa,EAA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ent":["import type { SimpleHeaderLayoutMap } from '../../layout';\nimport type { TextColumnDefine } from '../../ts-types';\nimport { HierarchyState, IconPosition } from '../../ts-types';\nimport * as calc from '../../tools/calc';\nimport { validToString } from '../../tools/util';\nimport { getQuadProps } from '../utils/padding';\nimport { getProp } from '../utils/get-prop';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentWidth } from '../../components/axis/get-axis-component-size';\nimport { Group as VGroup } from '@visactor/vrender';\n\nexport function computeColsWidth(table: BaseTableAPI, colStart?: number, colEnd?: number, update?: boolean): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n colStart = colStart ?? 0;\n colEnd = colEnd ?? table.colCount - 1;\n // table._clearColRangeWidthsMap();\n // clear colRangeWidthsMap\n if (colStart === 0 && colEnd === table.colCount - 1) {\n table._clearColRangeWidthsMap();\n // } else {\n // for (let col = colStart; col <= colEnd; col++) {\n // table._clearColRangeWidthsMap(col);\n // }\n }\n\n const oldColWidths: number[] = [];\n const newWidths: number[] = [];\n if (update) {\n for (let col = 0; col < table.colCount; col++) {\n oldColWidths[col] = table.getColWidth(col);\n }\n }\n for (let col = colStart; col <= colEnd; col++) {\n let maxWidth;\n if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-header' &&\n 'showHeader' in table.internalProps.layoutMap\n ) {\n const temp = table.internalProps.layoutMap.showHeader;\n table.internalProps.layoutMap.showHeader = true;\n maxWidth = computeColWidth(col, 0, table.internalProps.layoutMap.headerLevelCount, table, update);\n table.internalProps.layoutMap.showHeader = temp;\n } else if (\n !table.internalProps.transpose &&\n table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-body'\n ) {\n maxWidth = computeColWidth(\n col,\n table.internalProps.layoutMap.getBodyRange().start.row,\n table.internalProps.layoutMap.getBodyRange().end.row,\n table,\n update\n );\n } else {\n maxWidth = computeColWidth(col, 0, table.rowCount - 1, table, update);\n }\n\n table._setColContentWidth(col, maxWidth);\n\n const oldWidth = table.getColWidth(col);\n if (oldWidth !== maxWidth) {\n table._clearColRangeWidthsMap(col);\n }\n if (update) {\n newWidths[col] = maxWidth;\n } else {\n table.setColWidth(col, maxWidth, false, true);\n }\n }\n\n // 处理adaptive宽度\n if (table.widthMode === 'adaptive') {\n table._clearColRangeWidthsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const rowHeaderWidth = table.getColsWidth(0, table.rowHeaderLevelCount - 1);\n const rightHeaderWidth = table.isPivotChart() ? table.getRightFrozenColsWidth() : 0;\n const totalDrawWidth = table.tableNoFrameWidth - rowHeaderWidth - rightHeaderWidth;\n const startCol = table.rowHeaderLevelCount;\n const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;\n let actualWidth = 0;\n for (let col = startCol; col < endCol; col++) {\n actualWidth += update ? newWidths[col] : table.getColWidth(col);\n }\n const factor = totalDrawWidth / actualWidth;\n for (let col = startCol; col < endCol; col++) {\n let colWidth;\n if (col === endCol - 1) {\n colWidth =\n totalDrawWidth -\n (update\n ? newWidths.reduce((acr, cur, index) => {\n if (index >= startCol && index <= endCol - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getColsWidth(startCol, endCol - 2));\n } else {\n colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);\n }\n if (update) {\n newWidths[col] = colWidth;\n } else {\n table.setColWidth(col, colWidth, false, true);\n }\n }\n } else if (table.autoFillWidth) {\n // 处理风神列宽特殊逻辑\n table._clearColRangeWidthsMap();\n const canvasWidth = table.tableNoFrameWidth;\n let actualWidth = 0;\n let actualHeaderWidth = 0;\n for (let col = 0; col < table.colCount; col++) {\n const colWidth = update ? newWidths[col] : table.getColWidth(col);\n if (col < table.frozenColCount || col >= table.colCount - table.rightFrozenColCount) {\n actualHeaderWidth += colWidth;\n }\n\n actualWidth += colWidth;\n }\n\n // 如果内容宽度小于canvas宽度,执行adaptive放大\n if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {\n const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);\n for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {\n if (update) {\n newWidths[col] = newWidths[col] * factor;\n } else {\n table.setColWidth(col, table.getColWidth(col) * factor, false, true);\n }\n }\n }\n }\n // console.log('computeColsWidth time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time);\n\n if (update) {\n for (let col = 0; col < table.colCount; col++) {\n // newColWidth could not be in column min max range possibly\n // const newColWidth = table._adjustColWidth(col, newWidths[col]) ?? table.getColWidth(col);\n const newColWidth = newWidths[col] ?? table.getColWidth(col);\n if (newColWidth !== oldColWidths[col]) {\n // update the column width in scenegraph\n table.scenegraph.updateColWidth(col, newColWidth - oldColWidths[col], true);\n }\n }\n table.scenegraph.updateContainer();\n }\n // console.log('computeColsWidth time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, colStart, colEnd);\n}\n\n/**\n * @description: 计算列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {BaseTableAPI} table\n * @param {boolean} forceCompute\n * @return {*}\n */\nexport function computeColWidth(\n col: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n forceCompute: boolean\n): number {\n // const { layoutMap, transpose } = table.internalProps;\n // let { width } = layoutMap?.getColumnWidthDefined(col) ?? {};\n\n // if (transpose) {\n // // 转置模式\n // if (table.widthMode === 'standard') {\n // // return table.getColWidth(col);\n // // standard模式使用默认值\n // if (table.isRowHeader(col, 0) || table.isCornerHeader(col, 0)) {\n // const defaultWidth = Array.isArray(table.defaultHeaderColWidth)\n // ? table.defaultHeaderColWidth[col] ?? table.defaultColWidth\n // : table.defaultHeaderColWidth;\n // if (defaultWidth === 'auto') {\n // widthfffff = 'auto';\n // } else {\n // return defaultWidth;\n // }\n // }\n\n // if (widthfffff !== 'auto') {\n // // if (width && (typeof width === 'string' || width > 0)) return width;\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // return table.defaultColWidth;\n // }\n // } else if (\n // table.widthMode === 'adaptive' &&\n // col === 0 &&\n // widthfffff !== 'auto' &&\n // (layoutMap as SimpleHeaderLayoutMap)?.showHeader\n // ) {\n // // ToBeFixed hack逻辑,转置第一列列宽为header[0]\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // }\n // // autoWidth adaptive 需要计算内容宽度\n // // do nothing\n // } else if (widthfffff !== 'auto' && table.widthMode !== 'autoWidth' && !forceCompute) {\n // // if (width && (typeof width === 'string' || width > 0)) return width;\n // if (typeof widthfffff === 'string') {\n // return calc.toPx(widthfffff, table.internalProps.calcWidthContext);\n // } else if (widthfffff) {\n // return widthfffff;\n // }\n // //是透视表的行表头部分 则宽度按defaultHeaderColWidth设置\n // const defaultWidth = table.getColWidthDefine(col);\n // if (defaultWidth !== 'auto') {\n // return table.getColWidth(col);\n // }\n // }\n const width = getColWidthDefinedWidthResizedWidth(col, table);\n if (typeof width === 'number') {\n return width;\n } else if (width !== 'auto' && typeof width === 'string') {\n // return calc.toPx(width, table.internalProps.calcWidthContext);\n return table._adjustColWidth(col, table._colWidthDefineToPxWidth(width));\n }\n return computeAutoColWidth(width, col, startRow, endRow, forceCompute, table);\n}\n\n/**\n * @description: 计算width: auto情况下的列宽\n * @param {number} col\n * @param {number} startRow\n * @param {number} endRow\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeAutoColWidth(\n widthDeifne: string | number,\n col: number,\n startRow: number,\n endRow: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number {\n // 处理 auto width\n let maxWidth = 0;\n let deltaRow = 1;\n if (endRow - startRow > 5000) {\n // 超过5000行启动列宽自动计算采样\n deltaRow = Math.ceil((endRow - startRow) / 5000);\n }\n // 如果是透视图\n if (table.isPivotChart() && col >= table.rowHeaderLevelCount && col < table.colCount - table.rightFrozenColCount) {\n if (!(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) {\n //并且指标是以行展示 计算列宽需要根据x轴的值域范围\n const optimunWidth = (table.internalProps.layoutMap as PivotHeaderLayoutMap).getOptimunWidthForChart(col);\n if (optimunWidth > 0) {\n return optimunWidth;\n }\n } else {\n //直接拿表头的默认列宽\n return table.defaultColWidth;\n }\n }\n\n for (let row = startRow; row <= endRow; row += deltaRow) {\n // 判断透视图轴组件\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentWidth(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxWidth = Math.max(axisWidth, maxWidth);\n continue;\n }\n } else if (\n layout.isLeftBottomCorner(col, row) ||\n layout.isRightTopCorner(col, row) ||\n layout.isRightBottomCorner(col, row)\n ) {\n // 透视图三角为无效单元格,不参与宽度计算\n continue;\n }\n }\n\n // 判断CustomRender\n const customWidth = computeCustomRenderWidth(col, row, table);\n if (typeof customWidth === 'number') {\n maxWidth = Math.max(customWidth, maxWidth);\n continue;\n }\n\n // 判断透视表如果在指标\n // const indicatorWidth = computeIndicatorWidth(col, row, forceCompute, table);\n // const indicatorWidth = table.internalProps.layoutMap.getColumnWidthDefined(col);\n const indicatorWidth = widthDeifne;\n if (typeof indicatorWidth === 'number' && table.widthMode === 'standard') {\n maxWidth = Math.max(indicatorWidth, maxWidth);\n continue;\n }\n\n const cellType = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row)?.headerType\n : table.getBodyColumnType(col, row);\n if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar') {\n // text&link&progressbar测量文字宽度\n // image&video&sparkline使用默认宽度\n maxWidth = Math.max(maxWidth, table.getColWidthDefinedNumber(col) || 0);\n continue;\n }\n\n // 处理树形展开\n let cellHierarchyIndent = 0;\n const layoutMap = table.internalProps.layoutMap;\n //判断是否为表头\n if (layoutMap.isHeader(col, row)) {\n const hd = layoutMap.getHeader(col, row);\n // 如果某级表头设置了only-body,在计算表头内容宽度时跳过改级表头\n if (hd?.define?.columnWidthComputeMode === 'only-body') {\n continue;\n }\n if (hd?.hierarchyLevel) {\n cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * ((layoutMap as PivotHeaderLayoutMap).rowHierarchyIndent ?? 0);\n }\n } else {\n // 基本表格表身body单元格 如果是树形展开 需要考虑缩进值\n // const cellHierarchyState = table.getHierarchyState(col, row);\n // if (cellHierarchyState === HierarchyState.expand || cellHierarchyState === HierarchyState.collapse) {\n const define = table.getBodyColumnDefine(col, row);\n if (define?.tree) {\n const indexArr = table.dataSource.getIndexKey(table.getRecordIndexByCell(col, row));\n cellHierarchyIndent =\n Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none\n ? (indexArr.length - 1) * ((layoutMap as SimpleHeaderLayoutMap).hierarchyIndent ?? 0)\n : 0;\n }\n }\n\n // 测量文字宽度\n const textWidth = computeTextWidth(col, row, table);\n maxWidth = Math.max(textWidth + cellHierarchyIndent, maxWidth);\n }\n\n // 处理宽度限制\n const colMinWidth = table.getMinColWidth(col);\n const colMaxWidth = table.getMaxColWidth(col);\n if (maxWidth < colMinWidth) {\n return colMinWidth;\n } else if (maxWidth > colMaxWidth) {\n return colMaxWidth;\n }\n return maxWidth;\n}\n\n/**\n * @description: 计算customRender相关列宽\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderWidth(col: number, row: number, table: BaseTableAPI): number | undefined {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanCol = 1;\n let width = 0;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n width = (customLayoutObj.rootContainer as VGroup).AABBBounds.width() ?? 0;\n // width = (customLayoutObj.rootContainer as VGroup).attribute.width ?? 0;\n } else if (customLayoutObj.rootContainer) {\n customLayoutObj.rootContainer.isRoot = true;\n const size = customLayoutObj.rootContainer.getContentSize();\n width = size.width ?? 0;\n } else {\n width = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n width = customRenderObj?.expectedWidth ?? 0;\n } else {\n width = customRender?.expectedWidth ?? 0;\n }\n return width / spanCol;\n }\n return undefined;\n}\n\n/**\n * @description: 计算指标相关列宽\n * @param {number} col\n * @param {number} row\n * @param {boolean} forceCompute\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeIndicatorWidth(\n col: number,\n row: number,\n forceCompute: boolean,\n table: BaseTableAPI\n): number | undefined {\n const { layoutMap } = table.internalProps;\n if (table.isPivotTable() && (layoutMap as PivotHeaderLayoutMap).isColumnIndicatorHeader(col, row)) {\n // 透视表如果在指标中配置了宽度,使用该宽度作为指标单元格及下面内容单元格的列宽\n const body = layoutMap.getBody(col, row);\n if (body && body.width && body.width !== 'auto' && !forceCompute) {\n const width = Math.round(calc.toPx(body.width, table.internalProps.calcWidthContext));\n return width;\n }\n }\n return undefined;\n}\n\n/**\n * @description: 计算文字宽度\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextWidth(col: number, row: number, table: BaseTableAPI): number {\n let maxWidth = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconWidth = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (icon.positionType !== IconPosition.absoluteRight) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n }\n });\n }\n let spanCol = 1;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanCol = cellRange.end.col - cellRange.start.col + 1;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const paddingWidth = padding[1] + padding[3]; // + cellHierarchyIndent\n\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lines = validToString(cellValue).split('\\n') || [];\n if (lines.length >= 1) {\n // eslint-disable-next-line no-loop-func\n lines.forEach((line: string) => {\n const width = table.measureText(line.slice(0, table.options.maxCharactersNumber || 200), {\n fontSize,\n fontFamily,\n fontWeight\n }).width;\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (width + paddingWidth + 4 + iconWidth) / spanCol, // 这里+4为列宽测量结果的buffer\n maxWidth\n );\n });\n } else {\n maxWidth = Math.max(\n // 最大字符上限控制测量的字符\n (paddingWidth + 4 + iconWidth) / spanCol,\n maxWidth\n );\n }\n // 判断是否需要限制最大宽度 之前写死的450 需要使用配置来判断\n if (table.internalProps.limitMaxAutoWidth !== false) {\n maxWidth = Math.min(\n typeof table.internalProps.limitMaxAutoWidth === 'number' ? table.internalProps.limitMaxAutoWidth : 450,\n maxWidth\n );\n }\n\n return maxWidth;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: 0,\n height: 0\n };\n}\n\nfunction getColWidthDefinedWidthResizedWidth(col: number, table: BaseTableAPI) {\n const widthDefined = table.getColWidthDefined(col);\n if (table.internalProps._widthResizedColMap.has(col)) {\n return table.getColWidth(col);\n }\n return widthDefined;\n}\n"]}
|
|
@@ -32,7 +32,8 @@ function resetFrozen(scene) {
|
|
|
32
32
|
scene.frozenColCount = scene.table.frozenColCount, scene.frozenRowCount = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : 0,
|
|
33
33
|
scene.proxy.colStart = scene.table.frozenColCount, scene.bodyGroup.setAttribute("x", scene.rowHeaderGroup.attribute.width),
|
|
34
34
|
scene.colHeaderGroup.setAttribute("x", scene.cornerHeaderGroup.attribute.width),
|
|
35
|
-
scene.
|
|
35
|
+
scene.updateContainerAttrWidthAndX(), scene.updateContainer(), scene.updateBorderSizeAndPosition(),
|
|
36
|
+
scene.isPivot || scene.transpose || scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1),
|
|
36
37
|
scene.hasFrozen = !0;
|
|
37
38
|
}
|
|
38
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/frozen.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,oDAAyD;AAGzD,SAAgB,UAAU,CAAC,KAAiB;;IAC1C,IAAI,KAAK,CAAC,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,EAAE;QAEhE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9E,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACpE,KAAK,CAA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C,CAAC,CAAC;aACJ;SACF;KACF;IAED,iBAAiB,CAAC,YAAY,CAC5B,QAAQ,EACR,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,GAAG,mBAAmB,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAC9E,CAAC;IACF,qBAAqB,CAAC,YAAY,CAChC,QAAQ,EACR,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,GAAG,mBAAmB,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAC9E,CAAC;IACF,sBAAsB,CAAC,YAAY,CACjC,QAAQ,EACR,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,GAAG,mBAAmB,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAC9E,CAAC;IAEF,KAAK,CAAC,aAAa,CAAC,oBAAoB,GAAG,mBAAmB,CAAC;IAC/D,KAAK,CAAC,eAAe,EAAE,CAAC;IACxB,KAAK,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;IAClC,KAAK,CAAC,eAAe,EAAE,CAAC;AAC1B,CAAC;AAjLD,4CAiLC;AAED,SAAS,YAAY,CAAC,SAAgB,EAAE,OAAc,EAAE,WAAkB;IACxE,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,EAAE;QAC1B,OAAO;KACR;IACD,IAAI,WAAW,EAAE;QACf,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;KAC9C;SAAM;QACL,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAChC;AACH,CAAC","file":"frozen.js","sourcesContent":["import { Group } from '../graphic/group';\nimport { createColGroup } from '../group-creater/column';\nimport type { Scenegraph } from '../scenegraph';\n\nexport function dealFrozen(scene: Scenegraph) {\n if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {\n // 将对应列移入rowHeaderGroup\n scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);\n scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);\n scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);\n for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) {\n moveColumnFromBodyToRowHeader(scene);\n moveColumnFromColHeaderToCornerHeader(scene);\n moveColumnFromBottomToLeftBottomCorner(scene);\n }\n } else if (scene.table.frozenColCount < scene.table.rowHeaderLevelCount) {\n // move columnGroup from rowHeaderGroup into bodyGroup(from cornerHeaderGroup into colHeaderGroup)\n for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) {\n moveColumnFromRowHeaderToBody(scene);\n moveColumnFromCornerHeaderToColHeader(scene);\n moveColumnFromLeftBottomCornerToBottom(scene);\n }\n }\n scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);\n scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);\n\n scene.updateContainer();\n scene.updateBorderSizeAndPosition();\n\n if (!scene.isPivot && !scene.transpose) {\n scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);\n }\n scene.hasFrozen = true;\n\n // scene.frozenColCount = scene.rowHeaderGroup.childrenCount;\n scene.frozenColCount = scene.table.frozenColCount;\n scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;\n}\n\nexport function resetFrozen(scene: Scenegraph) {\n if (scene.frozenColCount > scene.table.frozenColCount) {\n // move columnGroup from rowHeaderGroup into bodyGroup(from cornerHeaderGroup into colHeaderGroup)\n for (let i = 0; i < scene.frozenColCount - scene.table.frozenColCount; i++) {\n moveColumnFromRowHeaderToBody(scene);\n moveColumnFromCornerHeaderToColHeader(scene);\n moveColumnFromLeftBottomCornerToBottom(scene);\n }\n } else if (scene.frozenColCount < scene.table.frozenColCount) {\n // move columnGroup from bodyGroup into rowHeaderGroup(from colHeaderGroup into cornerHeaderGroup)\n scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);\n scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);\n scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);\n for (let i = 0; i < scene.table.frozenColCount - scene.frozenColCount; i++) {\n moveColumnFromBodyToRowHeader(scene);\n moveColumnFromColHeaderToCornerHeader(scene);\n moveColumnFromBottomToLeftBottomCorner(scene);\n }\n }\n\n // scene.frozenColCount = scene.rowHeaderGroup.childrenCount;\n scene.frozenColCount = scene.table.frozenColCount;\n scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;\n scene.proxy.colStart = scene.table.frozenColCount;\n\n scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);\n scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);\n\n scene.updateContainer();\n scene.updateBorderSizeAndPosition();\n\n if (!scene.isPivot && !scene.transpose) {\n scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);\n }\n scene.hasFrozen = true;\n}\n\nfunction moveColumnFromBodyToRowHeader(scene: Scenegraph) {\n // deal with bodyGroup\n const column = scene.bodyGroup.firstChild instanceof Group ? scene.bodyGroup.firstChild : null;\n if (column) {\n scene.rowHeaderGroup.appendChild(column);\n // update container width\n scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width + column.attribute.width);\n scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width - column.attribute.width);\n }\n}\n\nfunction moveColumnFromColHeaderToCornerHeader(scene: Scenegraph) {\n // deal width colHeaderGroup\n const headerColumn = scene.colHeaderGroup.firstChild instanceof Group ? scene.colHeaderGroup.firstChild : null;\n if (headerColumn) {\n scene.cornerHeaderGroup.appendChild(headerColumn);\n scene.cornerHeaderGroup.setAttribute(\n 'width',\n scene.cornerHeaderGroup.attribute.width + headerColumn.attribute.width\n );\n scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width - headerColumn.attribute.width);\n }\n}\n\nfunction moveColumnFromRowHeaderToBody(scene: Scenegraph) {\n const column =\n scene.rowHeaderGroup.lastChild instanceof Group\n ? scene.rowHeaderGroup.lastChild\n : (scene.rowHeaderGroup.lastChild?._prev as Group);\n if (column) {\n insertBefore(scene.bodyGroup, column, scene.bodyGroup.firstChild as Group);\n // 更新容器宽度\n scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width + column.attribute.width);\n scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width - column.attribute.width);\n }\n}\n\nfunction moveColumnFromCornerHeaderToColHeader(scene: Scenegraph) {\n // 处理列表头\n const headerColumn =\n scene.cornerHeaderGroup.lastChild instanceof Group\n ? scene.cornerHeaderGroup.lastChild\n : (scene.cornerHeaderGroup.lastChild?._prev as Group);\n if (headerColumn) {\n insertBefore(scene.colHeaderGroup, headerColumn, scene.colHeaderGroup.firstChild as Group);\n scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width + headerColumn.attribute.width);\n scene.cornerHeaderGroup.setAttribute(\n 'width',\n scene.cornerHeaderGroup.attribute.width - headerColumn.attribute.width\n );\n }\n}\n\nfunction moveColumnFromBottomToLeftBottomCorner(scene: Scenegraph) {\n // deal with bottomFrozenGroup\n const column = scene.bottomFrozenGroup.firstChild instanceof Group ? scene.bottomFrozenGroup.firstChild : null;\n if (column) {\n scene.leftBottomCornerGroup.appendChild(column);\n // update container width\n scene.leftBottomCornerGroup.setAttribute(\n 'width',\n scene.leftBottomCornerGroup.attribute.width + column.attribute.width\n );\n scene.bottomFrozenGroup.setAttribute('width', scene.bottomFrozenGroup.attribute.width - column.attribute.width);\n }\n}\n\nfunction moveColumnFromLeftBottomCornerToBottom(scene: Scenegraph) {\n const column =\n scene.leftBottomCornerGroup.lastChild instanceof Group\n ? scene.leftBottomCornerGroup.lastChild\n : (scene.leftBottomCornerGroup.lastChild?._prev as Group);\n if (column) {\n insertBefore(scene.bottomFrozenGroup, column, scene.bottomFrozenGroup.firstChild as Group);\n // 更新容器宽度\n scene.bottomFrozenGroup.setAttribute('width', scene.bottomFrozenGroup.attribute.width + column.attribute.width);\n scene.leftBottomCornerGroup.setAttribute(\n 'width',\n scene.leftBottomCornerGroup.attribute.width - column.attribute.width\n );\n }\n}\n\nexport function dealRightFrozen(distRightFrozenCol: number, scene: Scenegraph) {\n const {\n table,\n proxy,\n rightTopCornerGroup,\n rightFrozenGroup,\n rightBottomCornerGroup,\n bottomFrozenGroup,\n bodyGroup,\n colHeaderGroup\n } = scene;\n // const distRightFrozenCol = scene.table.rightFrozenColCount;\n const currentRightFrozenCol = scene.table.rightFrozenColCount;\n if (distRightFrozenCol > currentRightFrozenCol) {\n for (let col = table.colCount - currentRightFrozenCol - 1; col >= table.colCount - distRightFrozenCol; col--) {\n const colGroup = scene.getColGroup(col);\n insertBefore(rightFrozenGroup, colGroup, rightFrozenGroup.firstChild as Group);\n const headerColGroup = scene.getColGroup(col, true);\n insertBefore(rightTopCornerGroup, headerColGroup, rightTopCornerGroup.firstChild as Group);\n const bottomColGroup = scene.getColGroupInBottom(col);\n insertBefore(rightBottomCornerGroup, bottomColGroup, rightBottomCornerGroup.firstChild as Group);\n }\n // reset cell y\n let x = 0;\n rightFrozenGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n x = 0;\n rightTopCornerGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n x = 0;\n rightBottomCornerGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n } else if (distRightFrozenCol < currentRightFrozenCol) {\n for (let col = table.colCount - currentRightFrozenCol; col < table.colCount - distRightFrozenCol; col++) {\n const colGroup = scene.getColGroup(col);\n colGroup.setAttribute(\n 'x',\n (bodyGroup.lastChild as Group).attribute.x + table.getColWidth((bodyGroup.lastChild as Group).col)\n );\n bodyGroup.appendChild(colGroup);\n const headerColGroup = scene.getColGroupInRightTopCorner(col);\n headerColGroup.setAttribute(\n 'x',\n (colHeaderGroup.lastChild as Group).attribute.x + table.getColWidth((colHeaderGroup.lastChild as Group).col)\n );\n colHeaderGroup.appendChild(headerColGroup);\n const bottomColGroup = scene.getColGroupInRightBottomCorner(col);\n bottomColGroup.setAttribute(\n 'x',\n (bottomFrozenGroup.lastChild as Group).attribute.x +\n table.getColWidth((bottomFrozenGroup.lastChild as Group).col)\n );\n bottomFrozenGroup.appendChild(bottomColGroup);\n }\n // reset cell y\n let x = 0;\n rightFrozenGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n x = 0;\n rightTopCornerGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n x = 0;\n rightBottomCornerGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n }\n\n // reset right width\n rightFrozenGroup.setAttribute('width', table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1));\n rightTopCornerGroup.setAttribute(\n 'width',\n table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1)\n );\n rightBottomCornerGroup.setAttribute(\n 'width',\n table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1)\n );\n\n table.internalProps.rightFrozenColCount = distRightFrozenCol;\n scene.updateContainer();\n scene.component.updateScrollBar();\n scene.updateNextFrame();\n}\n\nexport function dealBottomFrozen(distBottomFrozenRow: number, scene: Scenegraph) {\n const { table, proxy, bottomFrozenGroup, leftBottomCornerGroup, rightBottomCornerGroup } = scene;\n if (!bottomFrozenGroup.childrenCount) {\n // init bottom\n if (!proxy.table.isPivotChart()) {\n // create left bottom frozen\n createColGroup(\n leftBottomCornerGroup,\n 0,\n 0,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n 0, // rowStart\n -1, // rowEnd\n 'rowHeader', // isHeader\n table\n );\n createColGroup(\n rightBottomCornerGroup,\n 0,\n 0,\n table.colCount - table.rightFrozenColCount, // colStart\n table.colCount - 1, // colEnd\n 0, // rowStart\n -1, // rowEnd\n 'body', // isHeader\n table\n );\n }\n // create bottomFrozenGroup\n createColGroup(\n bottomFrozenGroup,\n 0,\n 0,\n proxy.colStart, // colStart\n proxy.colEnd, // colEnd\n 0, // rowStart\n -1, // rowEnd\n 'body', // isHeader\n table\n );\n }\n const currentBottomFrozenRow = scene.table.bottomFrozenRowCount;\n if (distBottomFrozenRow > currentBottomFrozenRow) {\n // row header -> left bottom\n for (let col = 0; col < table.frozenColCount; col++) {\n const bottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);\n // move cell\n for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {\n const cellGroup = scene.getCell(col, row, true);\n // bottomFrozenColumnGroup.insertBefore(cellGroup, bottomFrozenColumnGroup.firstChild);\n insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild as Group);\n }\n // reset cell y\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n // body -> bottom\n for (let col = proxy.colStart; col <= proxy.colEnd; col++) {\n const bottomFrozenColumnGroup = scene.getColGroupInBottom(col);\n // move cell\n for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {\n const cellGroup = scene.getCell(col, row, true);\n // bottomFrozenColumnGroup.insertBefore(cellGroup, bottomFrozenColumnGroup.firstChild);\n insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild as Group);\n }\n // reset cell y\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n if (table.rightFrozenColCount > 0) {\n // right -> right bottom\n for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {\n const bottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);\n // move cell\n for (\n let row = table.rowCount - currentBottomFrozenRow - 1;\n row >= table.rowCount - distBottomFrozenRow;\n row--\n ) {\n const cellGroup = scene.getCell(col, row, true);\n // bottomFrozenColumnGroup.insertBefore(cellGroup, bottomFrozenColumnGroup.firstChild);\n insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild as Group);\n }\n // reset cell y\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n }\n } else if (distBottomFrozenRow < currentBottomFrozenRow) {\n // left bottom -> row header\n for (let col = 0; col < table.rowHeaderLevelCount; col++) {\n const columnGroup = scene.getColGroup(col);\n for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {\n const cellGroup = scene.getCell(col, row, true);\n cellGroup.setAttribute(\n 'y',\n (columnGroup.lastChild as Group).attribute.y + table.getRowHeight((columnGroup.lastChild as Group).row)\n );\n columnGroup.appendChild(cellGroup);\n }\n // reset cell y\n const bottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n // bottom -> body\n for (let col = proxy.colStart; col <= proxy.colEnd; col++) {\n const columnGroup = scene.getColGroup(col);\n for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {\n const cellGroup = scene.getCell(col, row, true);\n cellGroup.setAttribute(\n 'y',\n (columnGroup.lastChild as Group).attribute.y + table.getRowHeight((columnGroup.lastChild as Group).row)\n );\n columnGroup.appendChild(cellGroup);\n }\n // reset cell y\n const bottomFrozenColumnGroup = scene.getColGroupInBottom(col);\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n if (table.rightFrozenColCount > 0) {\n // right bottom -> right\n for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {\n const columnGroup = scene.getColGroup(col);\n for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {\n const cellGroup = scene.getCell(col, row, true);\n cellGroup.setAttribute(\n 'y',\n (columnGroup.lastChild as Group).attribute.y + table.getRowHeight((columnGroup.lastChild as Group).row)\n );\n columnGroup.appendChild(cellGroup);\n }\n // reset cell y\n const bottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n }\n }\n // reset bottom height\n bottomFrozenGroup.setAttribute(\n 'height',\n table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1)\n );\n leftBottomCornerGroup.setAttribute(\n 'height',\n table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1)\n );\n rightBottomCornerGroup.setAttribute(\n 'height',\n table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1)\n );\n\n table.internalProps.bottomFrozenRowCount = distBottomFrozenRow;\n scene.updateContainer();\n scene.component.updateScrollBar();\n scene.updateNextFrame();\n}\n\nfunction insertBefore(container: Group, newNode: Group, targetGroup: Group) {\n if (!newNode || !container) {\n return;\n }\n if (targetGroup) {\n container.insertBefore(newNode, targetGroup);\n } else {\n container.appendChild(newNode);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/frozen.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,oDAAyD;AAGzD,SAAgB,UAAU,CAAC,KAAiB;;IAC1C,IAAI,KAAK,CAAC,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,mB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WAAW,CAAC,OAAO,CAAC,CAAC;KAChC;AACH,CAAC","file":"frozen.js","sourcesContent":["import { Group } from '../graphic/group';\nimport { createColGroup } from '../group-creater/column';\nimport type { Scenegraph } from '../scenegraph';\n\nexport function dealFrozen(scene: Scenegraph) {\n if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {\n // 将对应列移入rowHeaderGroup\n scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);\n scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);\n scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);\n for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) {\n moveColumnFromBodyToRowHeader(scene);\n moveColumnFromColHeaderToCornerHeader(scene);\n moveColumnFromBottomToLeftBottomCorner(scene);\n }\n } else if (scene.table.frozenColCount < scene.table.rowHeaderLevelCount) {\n // move columnGroup from rowHeaderGroup into bodyGroup(from cornerHeaderGroup into colHeaderGroup)\n for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) {\n moveColumnFromRowHeaderToBody(scene);\n moveColumnFromCornerHeaderToColHeader(scene);\n moveColumnFromLeftBottomCornerToBottom(scene);\n }\n }\n scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);\n scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);\n\n scene.updateContainer();\n scene.updateBorderSizeAndPosition();\n\n if (!scene.isPivot && !scene.transpose) {\n scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);\n }\n scene.hasFrozen = true;\n\n // scene.frozenColCount = scene.rowHeaderGroup.childrenCount;\n scene.frozenColCount = scene.table.frozenColCount;\n scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;\n}\n\nexport function resetFrozen(scene: Scenegraph) {\n if (scene.frozenColCount > scene.table.frozenColCount) {\n // move columnGroup from rowHeaderGroup into bodyGroup(from cornerHeaderGroup into colHeaderGroup)\n for (let i = 0; i < scene.frozenColCount - scene.table.frozenColCount; i++) {\n moveColumnFromRowHeaderToBody(scene);\n moveColumnFromCornerHeaderToColHeader(scene);\n moveColumnFromLeftBottomCornerToBottom(scene);\n }\n } else if (scene.frozenColCount < scene.table.frozenColCount) {\n // move columnGroup from bodyGroup into rowHeaderGroup(from colHeaderGroup into cornerHeaderGroup)\n scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);\n scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);\n scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);\n for (let i = 0; i < scene.table.frozenColCount - scene.frozenColCount; i++) {\n moveColumnFromBodyToRowHeader(scene);\n moveColumnFromColHeaderToCornerHeader(scene);\n moveColumnFromBottomToLeftBottomCorner(scene);\n }\n }\n\n // scene.frozenColCount = scene.rowHeaderGroup.childrenCount;\n scene.frozenColCount = scene.table.frozenColCount;\n scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;\n scene.proxy.colStart = scene.table.frozenColCount;\n\n scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);\n scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);\n scene.updateContainerAttrWidthAndX();\n scene.updateContainer();\n scene.updateBorderSizeAndPosition();\n\n if (!scene.isPivot && !scene.transpose) {\n scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);\n }\n scene.hasFrozen = true;\n}\n\nfunction moveColumnFromBodyToRowHeader(scene: Scenegraph) {\n // deal with bodyGroup\n const column = scene.bodyGroup.firstChild instanceof Group ? scene.bodyGroup.firstChild : null;\n if (column) {\n scene.rowHeaderGroup.appendChild(column);\n // update container width\n scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width + column.attribute.width);\n scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width - column.attribute.width);\n }\n}\n\nfunction moveColumnFromColHeaderToCornerHeader(scene: Scenegraph) {\n // deal width colHeaderGroup\n const headerColumn = scene.colHeaderGroup.firstChild instanceof Group ? scene.colHeaderGroup.firstChild : null;\n if (headerColumn) {\n scene.cornerHeaderGroup.appendChild(headerColumn);\n scene.cornerHeaderGroup.setAttribute(\n 'width',\n scene.cornerHeaderGroup.attribute.width + headerColumn.attribute.width\n );\n scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width - headerColumn.attribute.width);\n }\n}\n\nfunction moveColumnFromRowHeaderToBody(scene: Scenegraph) {\n const column =\n scene.rowHeaderGroup.lastChild instanceof Group\n ? scene.rowHeaderGroup.lastChild\n : (scene.rowHeaderGroup.lastChild?._prev as Group);\n if (column) {\n insertBefore(scene.bodyGroup, column, scene.bodyGroup.firstChild as Group);\n // 更新容器宽度\n scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width + column.attribute.width);\n scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width - column.attribute.width);\n }\n}\n\nfunction moveColumnFromCornerHeaderToColHeader(scene: Scenegraph) {\n // 处理列表头\n const headerColumn =\n scene.cornerHeaderGroup.lastChild instanceof Group\n ? scene.cornerHeaderGroup.lastChild\n : (scene.cornerHeaderGroup.lastChild?._prev as Group);\n if (headerColumn) {\n insertBefore(scene.colHeaderGroup, headerColumn, scene.colHeaderGroup.firstChild as Group);\n scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width + headerColumn.attribute.width);\n scene.cornerHeaderGroup.setAttribute(\n 'width',\n scene.cornerHeaderGroup.attribute.width - headerColumn.attribute.width\n );\n }\n}\n\nfunction moveColumnFromBottomToLeftBottomCorner(scene: Scenegraph) {\n // deal with bottomFrozenGroup\n const column = scene.bottomFrozenGroup.firstChild instanceof Group ? scene.bottomFrozenGroup.firstChild : null;\n if (column) {\n scene.leftBottomCornerGroup.appendChild(column);\n // update container width\n scene.leftBottomCornerGroup.setAttribute(\n 'width',\n scene.leftBottomCornerGroup.attribute.width + column.attribute.width\n );\n scene.bottomFrozenGroup.setAttribute('width', scene.bottomFrozenGroup.attribute.width - column.attribute.width);\n }\n}\n\nfunction moveColumnFromLeftBottomCornerToBottom(scene: Scenegraph) {\n const column =\n scene.leftBottomCornerGroup.lastChild instanceof Group\n ? scene.leftBottomCornerGroup.lastChild\n : (scene.leftBottomCornerGroup.lastChild?._prev as Group);\n if (column) {\n insertBefore(scene.bottomFrozenGroup, column, scene.bottomFrozenGroup.firstChild as Group);\n // 更新容器宽度\n scene.bottomFrozenGroup.setAttribute('width', scene.bottomFrozenGroup.attribute.width + column.attribute.width);\n scene.leftBottomCornerGroup.setAttribute(\n 'width',\n scene.leftBottomCornerGroup.attribute.width - column.attribute.width\n );\n }\n}\n\nexport function dealRightFrozen(distRightFrozenCol: number, scene: Scenegraph) {\n const {\n table,\n proxy,\n rightTopCornerGroup,\n rightFrozenGroup,\n rightBottomCornerGroup,\n bottomFrozenGroup,\n bodyGroup,\n colHeaderGroup\n } = scene;\n // const distRightFrozenCol = scene.table.rightFrozenColCount;\n const currentRightFrozenCol = scene.table.rightFrozenColCount;\n if (distRightFrozenCol > currentRightFrozenCol) {\n for (let col = table.colCount - currentRightFrozenCol - 1; col >= table.colCount - distRightFrozenCol; col--) {\n const colGroup = scene.getColGroup(col);\n insertBefore(rightFrozenGroup, colGroup, rightFrozenGroup.firstChild as Group);\n const headerColGroup = scene.getColGroup(col, true);\n insertBefore(rightTopCornerGroup, headerColGroup, rightTopCornerGroup.firstChild as Group);\n const bottomColGroup = scene.getColGroupInBottom(col);\n insertBefore(rightBottomCornerGroup, bottomColGroup, rightBottomCornerGroup.firstChild as Group);\n }\n // reset cell y\n let x = 0;\n rightFrozenGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n x = 0;\n rightTopCornerGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n x = 0;\n rightBottomCornerGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n } else if (distRightFrozenCol < currentRightFrozenCol) {\n for (let col = table.colCount - currentRightFrozenCol; col < table.colCount - distRightFrozenCol; col++) {\n const colGroup = scene.getColGroup(col);\n colGroup.setAttribute(\n 'x',\n (bodyGroup.lastChild as Group).attribute.x + table.getColWidth((bodyGroup.lastChild as Group).col)\n );\n bodyGroup.appendChild(colGroup);\n const headerColGroup = scene.getColGroupInRightTopCorner(col);\n headerColGroup.setAttribute(\n 'x',\n (colHeaderGroup.lastChild as Group).attribute.x + table.getColWidth((colHeaderGroup.lastChild as Group).col)\n );\n colHeaderGroup.appendChild(headerColGroup);\n const bottomColGroup = scene.getColGroupInRightBottomCorner(col);\n bottomColGroup.setAttribute(\n 'x',\n (bottomFrozenGroup.lastChild as Group).attribute.x +\n table.getColWidth((bottomFrozenGroup.lastChild as Group).col)\n );\n bottomFrozenGroup.appendChild(bottomColGroup);\n }\n // reset cell y\n let x = 0;\n rightFrozenGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n x = 0;\n rightTopCornerGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n x = 0;\n rightBottomCornerGroup.forEachChildren((columnGroup: Group) => {\n columnGroup.setAttribute('x', x);\n x += columnGroup.attribute.width;\n });\n }\n\n // reset right width\n rightFrozenGroup.setAttribute('width', table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1));\n rightTopCornerGroup.setAttribute(\n 'width',\n table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1)\n );\n rightBottomCornerGroup.setAttribute(\n 'width',\n table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1)\n );\n\n table.internalProps.rightFrozenColCount = distRightFrozenCol;\n scene.updateContainer();\n scene.component.updateScrollBar();\n scene.updateNextFrame();\n}\n\nexport function dealBottomFrozen(distBottomFrozenRow: number, scene: Scenegraph) {\n const { table, proxy, bottomFrozenGroup, leftBottomCornerGroup, rightBottomCornerGroup } = scene;\n if (!bottomFrozenGroup.childrenCount) {\n // init bottom\n if (!proxy.table.isPivotChart()) {\n // create left bottom frozen\n createColGroup(\n leftBottomCornerGroup,\n 0,\n 0,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n 0, // rowStart\n -1, // rowEnd\n 'rowHeader', // isHeader\n table\n );\n createColGroup(\n rightBottomCornerGroup,\n 0,\n 0,\n table.colCount - table.rightFrozenColCount, // colStart\n table.colCount - 1, // colEnd\n 0, // rowStart\n -1, // rowEnd\n 'body', // isHeader\n table\n );\n }\n // create bottomFrozenGroup\n createColGroup(\n bottomFrozenGroup,\n 0,\n 0,\n proxy.colStart, // colStart\n proxy.colEnd, // colEnd\n 0, // rowStart\n -1, // rowEnd\n 'body', // isHeader\n table\n );\n }\n const currentBottomFrozenRow = scene.table.bottomFrozenRowCount;\n if (distBottomFrozenRow > currentBottomFrozenRow) {\n // row header -> left bottom\n for (let col = 0; col < table.frozenColCount; col++) {\n const bottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);\n // move cell\n for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {\n const cellGroup = scene.getCell(col, row, true);\n // bottomFrozenColumnGroup.insertBefore(cellGroup, bottomFrozenColumnGroup.firstChild);\n insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild as Group);\n }\n // reset cell y\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n // body -> bottom\n for (let col = proxy.colStart; col <= proxy.colEnd; col++) {\n const bottomFrozenColumnGroup = scene.getColGroupInBottom(col);\n // move cell\n for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {\n const cellGroup = scene.getCell(col, row, true);\n // bottomFrozenColumnGroup.insertBefore(cellGroup, bottomFrozenColumnGroup.firstChild);\n insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild as Group);\n }\n // reset cell y\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n if (table.rightFrozenColCount > 0) {\n // right -> right bottom\n for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {\n const bottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);\n // move cell\n for (\n let row = table.rowCount - currentBottomFrozenRow - 1;\n row >= table.rowCount - distBottomFrozenRow;\n row--\n ) {\n const cellGroup = scene.getCell(col, row, true);\n // bottomFrozenColumnGroup.insertBefore(cellGroup, bottomFrozenColumnGroup.firstChild);\n insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild as Group);\n }\n // reset cell y\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n }\n } else if (distBottomFrozenRow < currentBottomFrozenRow) {\n // left bottom -> row header\n for (let col = 0; col < table.rowHeaderLevelCount; col++) {\n const columnGroup = scene.getColGroup(col);\n for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {\n const cellGroup = scene.getCell(col, row, true);\n cellGroup.setAttribute(\n 'y',\n (columnGroup.lastChild as Group).attribute.y + table.getRowHeight((columnGroup.lastChild as Group).row)\n );\n columnGroup.appendChild(cellGroup);\n }\n // reset cell y\n const bottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n // bottom -> body\n for (let col = proxy.colStart; col <= proxy.colEnd; col++) {\n const columnGroup = scene.getColGroup(col);\n for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {\n const cellGroup = scene.getCell(col, row, true);\n cellGroup.setAttribute(\n 'y',\n (columnGroup.lastChild as Group).attribute.y + table.getRowHeight((columnGroup.lastChild as Group).row)\n );\n columnGroup.appendChild(cellGroup);\n }\n // reset cell y\n const bottomFrozenColumnGroup = scene.getColGroupInBottom(col);\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n if (table.rightFrozenColCount > 0) {\n // right bottom -> right\n for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {\n const columnGroup = scene.getColGroup(col);\n for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {\n const cellGroup = scene.getCell(col, row, true);\n cellGroup.setAttribute(\n 'y',\n (columnGroup.lastChild as Group).attribute.y + table.getRowHeight((columnGroup.lastChild as Group).row)\n );\n columnGroup.appendChild(cellGroup);\n }\n // reset cell y\n const bottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);\n let y = 0;\n bottomFrozenColumnGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.setAttribute('y', y);\n y += table.getRowHeight(cellGroup.row);\n });\n }\n }\n }\n // reset bottom height\n bottomFrozenGroup.setAttribute(\n 'height',\n table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1)\n );\n leftBottomCornerGroup.setAttribute(\n 'height',\n table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1)\n );\n rightBottomCornerGroup.setAttribute(\n 'height',\n table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1)\n );\n\n table.internalProps.bottomFrozenRowCount = distBottomFrozenRow;\n scene.updateContainer();\n scene.component.updateScrollBar();\n scene.updateNextFrame();\n}\n\nfunction insertBefore(container: Group, newNode: Group, targetGroup: Group) {\n if (!newNode || !container) {\n return;\n }\n if (targetGroup) {\n container.insertBefore(newNode, targetGroup);\n } else {\n container.appendChild(newNode);\n }\n}\n"]}
|
|
@@ -32,7 +32,7 @@ function moveHeaderPosition(colSource, rowSource, colTarget, rowTarget, table) {
|
|
|
32
32
|
columnHeaderGroup && columnHeaderGroup.setAttribute("width", table.getColWidth(col)),
|
|
33
33
|
columnGroup && columnGroup.setAttribute("width", table.getColWidth(col));
|
|
34
34
|
}
|
|
35
|
-
scene.updateContainer();
|
|
35
|
+
scene.updateContainerAttrWidthAndX(), scene.updateContainer();
|
|
36
36
|
for (let col = updateColStart; col <= updateColEnd; col++) {
|
|
37
37
|
const columnGroup = table.scenegraph.getColGroup(col);
|
|
38
38
|
null == columnGroup || columnGroup.setAttribute("chartInstance", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/move-cell.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,4DAA2D;AAG3D,MAAM,gBAAgB,GAAG,IAAI,eAAK,CAAC,EAAE,CAAC,CAAC;AAEvC,SAAgB,kBAAkB,CAChC,SAAiB,EACjB,SAAiB,EACjB,SAAiB,EACjB,SAAiB,EACjB,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAG/B,MAAM,YAAY,GAAG,KAAK,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACjE,MAAM,SAAS,GAAG,YAAY,KAAK,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAEhH,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,cAAc,GAAG,CAAC,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,KAAK,QAAQ,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QAC5E,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,GAAG,GAAG,cAAc,CAAC;QAChE,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,GAAG,GAAG,cAAc,CAAC;KACjE;IACD,IAAI,OAAO,cAAc,KAAK,QAAQ,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;QAC5E,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,GAAG,GAAG,cAAc,CAAC;QAChE,eAAe,CAAC,QAAQ,GAAG,eAAe,CAAC,GAAG,GAAG,cAAc,CAAC;KACjE;AACH,CAAC","file":"move-cell.js","sourcesContent":["import { Group } from '@visactor/vrender';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nconst groupForPosition = new Group({});\n\nexport function moveHeaderPosition(\n colSource: number,\n rowSource: number,\n colTarget: number,\n rowTarget: number,\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n\n // 判断方向\n const cellLocation = table.getCellLocation(colTarget, rowTarget);\n const direction = cellLocation === 'columnHeader' ? 'column' : cellLocation === 'rowHeader' ? 'row' : undefined;\n\n let sourceColStart = 0;\n let sourceRowStart = 0;\n let sourceColEnd = 0;\n let sourceRowEnd = 0;\n let targetColStart = 0;\n let targetRowStart = 0;\n let targetColEnd = 0;\n let targetRowEnd = 0;\n if (direction === 'column') {\n const sourceMergeInfo = getCellMergeInfo(table, colSource, rowSource);\n const targetMergeInfo = getCellMergeInfo(table, colTarget, rowTarget);\n if (sourceMergeInfo && targetMergeInfo) {\n sourceColStart = sourceMergeInfo.start.col;\n sourceColEnd = sourceMergeInfo.end.col;\n targetColStart = targetMergeInfo.start.col;\n targetColEnd = targetMergeInfo.end.col;\n } else {\n sourceColStart = colSource;\n sourceColEnd = colSource;\n targetColStart = colTarget;\n targetColEnd = colTarget;\n }\n sourceRowStart = rowSource;\n sourceRowEnd = table.rowCount - 1;\n targetRowStart = rowTarget;\n targetRowEnd = table.rowCount - 1;\n } else if (direction === 'row') {\n const sourceMergeInfo = getCellMergeInfo(table, colSource, rowSource);\n const targetMergeInfo = getCellMergeInfo(table, colTarget, rowTarget);\n if (sourceMergeInfo && targetMergeInfo) {\n sourceRowStart = sourceMergeInfo.start.row;\n sourceRowEnd = sourceMergeInfo.end.row;\n targetRowStart = targetMergeInfo.start.row;\n targetRowEnd = targetMergeInfo.end.row;\n } else {\n sourceRowStart = rowSource;\n sourceRowEnd = rowSource;\n targetRowStart = rowTarget;\n targetRowEnd = rowTarget;\n }\n sourceColStart = colSource;\n sourceColEnd = table.colCount - 1;\n targetColStart = colTarget;\n targetColEnd = table.colCount - 1;\n }\n\n const updateColStart = Math.min(sourceColStart, targetColStart);\n const updateColEnd = Math.max(sourceColEnd, targetColEnd);\n const updateRowStart = Math.min(sourceRowStart, targetRowStart);\n const updateRowEnd = Math.max(sourceRowEnd, targetRowEnd);\n\n // 更新columnGroup列宽\n for (let col = updateColStart; col <= updateColEnd; col++) {\n const columnHeaderGroup = table.scenegraph.getColGroup(col, true);\n const columnGroup = table.scenegraph.getColGroup(col);\n if (columnHeaderGroup) {\n columnHeaderGroup.setAttribute('width', table.getColWidth(col));\n }\n if (columnGroup) {\n columnGroup.setAttribute('width', table.getColWidth(col));\n }\n }\n\n // 更新容器尺寸\n scene.updateContainer();\n\n for (let col = updateColStart; col <= updateColEnd; col++) {\n // 将该列的chartInstance清除掉\n const columnGroup = table.scenegraph.getColGroup(col);\n columnGroup?.setAttribute('chartInstance', undefined);\n // 更新单元格记录全量属性,不更新column theme\n for (let row = updateRowStart; row <= updateRowEnd; row++) {\n scene.updateCellContent(col, row);\n }\n }\n}\n\nfunction changeCell(colSource: number, rowSource: number, colTarget: number, rowTarget: number, table: BaseTableAPI) {\n // 记录基础属性\n const scene = table.scenegraph;\n const sourceCellGroup = scene.getCell(colSource, rowSource, true);\n const targetCellGroup = scene.getCell(colTarget, rowTarget, true);\n if (sourceCellGroup.role === 'empty' || targetCellGroup.role === 'empty') {\n return;\n }\n const sourceParent = sourceCellGroup.parent as Group;\n const targetParent = targetCellGroup.parent as Group;\n const { x: sourceX, y: sourceY } = sourceCellGroup.attribute;\n const { x: targetX, y: targetY } = targetCellGroup.attribute;\n\n // 判断merge属性\n let sourceDeltaCol;\n let sourceDeltaRow;\n let targetDeltaCol;\n let targetDeltaRow;\n const sourceMergeCol = sourceCellGroup.mergeCol;\n const sourceMergeRow = sourceCellGroup.mergeRow;\n const targetMergeCol = targetCellGroup.mergeCol;\n const targetMergeRow = targetCellGroup.mergeRow;\n if (typeof sourceMergeCol === 'number' && typeof sourceMergeRow === 'number') {\n sourceDeltaCol = sourceMergeCol - colSource;\n sourceDeltaRow = sourceMergeRow - rowSource;\n }\n if (typeof targetMergeCol === 'number' && typeof targetMergeRow === 'number') {\n targetDeltaCol = targetMergeCol - colTarget;\n targetDeltaRow = targetMergeRow - rowTarget;\n }\n\n // 更新位置\n targetParent.insertAfter(groupForPosition, targetCellGroup);\n sourceParent.insertAfter(targetCellGroup, sourceCellGroup);\n targetParent.insertAfter(sourceCellGroup, groupForPosition);\n targetParent.removeChild(groupForPosition);\n\n // 更新属性\n sourceCellGroup.setAttributes({\n x: targetX,\n y: targetY\n });\n sourceCellGroup.col = colTarget;\n sourceCellGroup.row = rowTarget;\n\n targetCellGroup.setAttributes({\n x: sourceX,\n y: sourceY\n });\n targetCellGroup.col = colSource;\n targetCellGroup.row = rowSource;\n if (typeof sourceDeltaCol === 'number' && typeof sourceDeltaRow === 'number') {\n sourceCellGroup.mergeCol = sourceCellGroup.col + sourceDeltaCol;\n sourceCellGroup.mergeRow = sourceCellGroup.row + sourceDeltaRow;\n }\n if (typeof targetDeltaCol === 'number' && typeof targetDeltaRow === 'number') {\n targetCellGroup.mergeCol = targetCellGroup.col + targetDeltaCol;\n targetCellGroup.mergeRow = targetCellGroup.row + targetDeltaRow;\n }\n}\n"]}
|
|
1
|
+
{"version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{ BaseTableAPI } from '../../ts-types/base-table';\n\nconst groupForPosition = new Group({});\n\nexport function moveHeaderPosition(\n colSource: number,\n rowSource: number,\n colTarget: number,\n rowTarget: number,\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n\n // 判断方向\n const cellLocation = table.getCellLocation(colTarget, rowTarget);\n const direction = cellLocation === 'columnHeader' ? 'column' : cellLocation === 'rowHeader' ? 'row' : undefined;\n\n let sourceColStart = 0;\n let sourceRowStart = 0;\n let sourceColEnd = 0;\n let sourceRowEnd = 0;\n let targetColStart = 0;\n let targetRowStart = 0;\n let targetColEnd = 0;\n let targetRowEnd = 0;\n if (direction === 'column') {\n const sourceMergeInfo = getCellMergeInfo(table, colSource, rowSource);\n const targetMergeInfo = getCellMergeInfo(table, colTarget, rowTarget);\n if (sourceMergeInfo && targetMergeInfo) {\n sourceColStart = sourceMergeInfo.start.col;\n sourceColEnd = sourceMergeInfo.end.col;\n targetColStart = targetMergeInfo.start.col;\n targetColEnd = targetMergeInfo.end.col;\n } else {\n sourceColStart = colSource;\n sourceColEnd = colSource;\n targetColStart = colTarget;\n targetColEnd = colTarget;\n }\n sourceRowStart = rowSource;\n sourceRowEnd = table.rowCount - 1;\n targetRowStart = rowTarget;\n targetRowEnd = table.rowCount - 1;\n } else if (direction === 'row') {\n const sourceMergeInfo = getCellMergeInfo(table, colSource, rowSource);\n const targetMergeInfo = getCellMergeInfo(table, colTarget, rowTarget);\n if (sourceMergeInfo && targetMergeInfo) {\n sourceRowStart = sourceMergeInfo.start.row;\n sourceRowEnd = sourceMergeInfo.end.row;\n targetRowStart = targetMergeInfo.start.row;\n targetRowEnd = targetMergeInfo.end.row;\n } else {\n sourceRowStart = rowSource;\n sourceRowEnd = rowSource;\n targetRowStart = rowTarget;\n targetRowEnd = rowTarget;\n }\n sourceColStart = colSource;\n sourceColEnd = table.colCount - 1;\n targetColStart = colTarget;\n targetColEnd = table.colCount - 1;\n }\n\n const updateColStart = Math.min(sourceColStart, targetColStart);\n const updateColEnd = Math.max(sourceColEnd, targetColEnd);\n const updateRowStart = Math.min(sourceRowStart, targetRowStart);\n const updateRowEnd = Math.max(sourceRowEnd, targetRowEnd);\n\n // 更新columnGroup列宽\n for (let col = updateColStart; col <= updateColEnd; col++) {\n const columnHeaderGroup = table.scenegraph.getColGroup(col, true);\n const columnGroup = table.scenegraph.getColGroup(col);\n if (columnHeaderGroup) {\n columnHeaderGroup.setAttribute('width', table.getColWidth(col));\n }\n if (columnGroup) {\n columnGroup.setAttribute('width', table.getColWidth(col));\n }\n }\n\n // 更新容器尺寸\n scene.updateContainerAttrWidthAndX();\n scene.updateContainer();\n\n for (let col = updateColStart; col <= updateColEnd; col++) {\n // 将该列的chartInstance清除掉\n const columnGroup = table.scenegraph.getColGroup(col);\n columnGroup?.setAttribute('chartInstance', undefined);\n // 更新单元格记录全量属性,不更新column theme\n for (let row = updateRowStart; row <= updateRowEnd; row++) {\n scene.updateCellContent(col, row);\n }\n }\n}\n\nfunction changeCell(colSource: number, rowSource: number, colTarget: number, rowTarget: number, table: BaseTableAPI) {\n // 记录基础属性\n const scene = table.scenegraph;\n const sourceCellGroup = scene.getCell(colSource, rowSource, true);\n const targetCellGroup = scene.getCell(colTarget, rowTarget, true);\n if (sourceCellGroup.role === 'empty' || targetCellGroup.role === 'empty') {\n return;\n }\n const sourceParent = sourceCellGroup.parent as Group;\n const targetParent = targetCellGroup.parent as Group;\n const { x: sourceX, y: sourceY } = sourceCellGroup.attribute;\n const { x: targetX, y: targetY } = targetCellGroup.attribute;\n\n // 判断merge属性\n let sourceDeltaCol;\n let sourceDeltaRow;\n let targetDeltaCol;\n let targetDeltaRow;\n const sourceMergeCol = sourceCellGroup.mergeCol;\n const sourceMergeRow = sourceCellGroup.mergeRow;\n const targetMergeCol = targetCellGroup.mergeCol;\n const targetMergeRow = targetCellGroup.mergeRow;\n if (typeof sourceMergeCol === 'number' && typeof sourceMergeRow === 'number') {\n sourceDeltaCol = sourceMergeCol - colSource;\n sourceDeltaRow = sourceMergeRow - rowSource;\n }\n if (typeof targetMergeCol === 'number' && typeof targetMergeRow === 'number') {\n targetDeltaCol = targetMergeCol - colTarget;\n targetDeltaRow = targetMergeRow - rowTarget;\n }\n\n // 更新位置\n targetParent.insertAfter(groupForPosition, targetCellGroup);\n sourceParent.insertAfter(targetCellGroup, sourceCellGroup);\n targetParent.insertAfter(sourceCellGroup, groupForPosition);\n targetParent.removeChild(groupForPosition);\n\n // 更新属性\n sourceCellGroup.setAttributes({\n x: targetX,\n y: targetY\n });\n sourceCellGroup.col = colTarget;\n sourceCellGroup.row = rowTarget;\n\n targetCellGroup.setAttributes({\n x: sourceX,\n y: sourceY\n });\n targetCellGroup.col = colSource;\n targetCellGroup.row = rowSource;\n if (typeof sourceDeltaCol === 'number' && typeof sourceDeltaRow === 'number') {\n sourceCellGroup.mergeCol = sourceCellGroup.col + sourceDeltaCol;\n sourceCellGroup.mergeRow = sourceCellGroup.row + sourceDeltaRow;\n }\n if (typeof targetDeltaCol === 'number' && typeof targetDeltaRow === 'number') {\n targetCellGroup.mergeCol = targetCellGroup.col + targetDeltaCol;\n targetCellGroup.mergeRow = targetCellGroup.row + targetDeltaRow;\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.updateRow = void 0;
|
|
6
6
|
|
|
7
|
-
const cell_helper_1 = require("../group-creater/cell-helper");
|
|
7
|
+
const group_1 = require("../graphic/group"), cell_helper_1 = require("../group-creater/cell-helper");
|
|
8
8
|
|
|
9
9
|
function updateRow(removeCells, addCells, updateCells, table) {
|
|
10
10
|
const scene = table.scenegraph, removeRows = deduplication(removeCells.map((cell => cell.row))).sort(((a, b) => a - b)), addRows = deduplication(addCells.map((cell => cell.row))).sort(((a, b) => a - b));
|
|
@@ -14,7 +14,11 @@ function updateRow(removeCells, addCells, updateCells, table) {
|
|
|
14
14
|
addRow(row, scene);
|
|
15
15
|
})), updateCells.forEach((cell => {
|
|
16
16
|
cell && (0, cell_helper_1.updateCell)(cell.col, cell.row, scene.table, !1);
|
|
17
|
-
}))
|
|
17
|
+
}));
|
|
18
|
+
const newTotalHeight = resetRowNumberAndY(scene);
|
|
19
|
+
addRows.length && (scene.proxy.rowUpdatePos = scene.proxy.rowStart, scene.proxy.rowUpdateDirection = "up",
|
|
20
|
+
scene.proxy.updateCellGroups(2 * scene.proxy.screenRowCount), scene.proxy.progress()),
|
|
21
|
+
scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
function removeRow(row, scene) {
|
|
@@ -24,26 +28,28 @@ function removeRow(row, scene) {
|
|
|
24
28
|
colGroup.forEachChildren((cell => cell.row === row && (cellGroup = cell, !0))),
|
|
25
29
|
cellGroup && colGroup.removeChild(cellGroup);
|
|
26
30
|
}
|
|
27
|
-
scene.proxy.rowEnd--, scene.proxy.bodyBottomRow--, scene.proxy.totalRow--;
|
|
31
|
+
scene.proxy.rowEnd--, scene.proxy.bodyBottomRow--, scene.proxy.currentRow--, scene.proxy.totalRow--;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
function addRow(row, scene) {
|
|
31
|
-
var _a;
|
|
32
35
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
33
|
-
const cellGroup =
|
|
34
|
-
|
|
36
|
+
const cellGroup = new group_1.Group({
|
|
37
|
+
x: 0,
|
|
38
|
+
y: 0,
|
|
39
|
+
width: scene.table.getColWidth(col),
|
|
40
|
+
height: scene.table.getRowHeight(row)
|
|
41
|
+
});
|
|
42
|
+
if (cellGroup.role = "cell", cellGroup.col = col, cellGroup.row = row, cellGroup.needUpdate = !0,
|
|
43
|
+
!cellGroup) continue;
|
|
35
44
|
const colGroup = scene.getColGroup(col);
|
|
36
|
-
if (colGroup.firstChild && row < colGroup.firstChild.row) colGroup.insertBefore(cellGroup, colGroup.firstChild)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
if (colGroup.firstChild && row < colGroup.firstChild.row) colGroup.insertBefore(cellGroup, colGroup.firstChild),
|
|
46
|
+
colGroup.firstChild.row = colGroup.firstChild.row + 1; else if (colGroup.lastChild && row > colGroup.lastChild.row) colGroup.appendChild(cellGroup); else {
|
|
47
|
+
const cellBefore = scene.highPerformanceGetCell(col, row, !0);
|
|
48
|
+
cellBefore !== cellGroup && (colGroup.insertBefore(cellGroup, cellBefore), cellBefore && (cellBefore.row = cellBefore.row + 1),
|
|
49
|
+
cellBefore !== colGroup.lastChild && colGroup.lastChild && (colGroup.lastChild.row = colGroup.lastChild.row + 1));
|
|
40
50
|
}
|
|
41
|
-
let rowIndex = null === (_a = colGroup.firstChild) || void 0 === _a ? void 0 : _a.row;
|
|
42
|
-
colGroup.forEachChildren((cellGroup => {
|
|
43
|
-
cellGroup.row = rowIndex, rowIndex++;
|
|
44
|
-
}));
|
|
45
51
|
}
|
|
46
|
-
scene.proxy.rowEnd++, scene.proxy.bodyBottomRow++, scene.proxy.totalRow++;
|
|
52
|
+
scene.proxy.rowEnd++, scene.proxy.bodyBottomRow++, scene.proxy.currentRow++, scene.proxy.totalRow++;
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
function deduplication(array) {
|
|
@@ -78,7 +84,7 @@ function resetRowNumberAndY(scene) {
|
|
|
78
84
|
y += cellGroup.attribute.height);
|
|
79
85
|
})), newTotalHeight = y;
|
|
80
86
|
}
|
|
81
|
-
|
|
87
|
+
return newTotalHeight;
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
exports.updateRow = updateRow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/update-row.ts"],"names":[],"mappings":";;;AAGA,8DAA0D;AAM1D,SAAgB,SAAS,CACvB,WAA0B,EAC1B,QAAuB,EACvB,WAA0B,EAC1B,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAE/B,MAAM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QAAQ,EAAE,CAAC;YACX,IAAI,SAAS,CAAC,IAAI,KAAK,MAAM,EAAE;gBAC7B,OAAO;aACR;YACD,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAC/B,CAAC,IAAI,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;QAClC,CAAC,CAAC,CAAC;QACH,cAAc,GAAG,CAAC,CAAC;KAOpB;IAGD,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC7G,CAAC","file":"update-row.js","sourcesContent":["import type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateRow(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => a - b);\n const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);\n // const updateRows = deduplication(updateCells.map(cell => cell.row)).sort((a, b) => a - b);\n\n // remove cells\n removeRows.forEach(row => {\n removeRow(row, scene);\n });\n\n if (removeRows.length) {\n resetRowNumber(scene);\n }\n\n // add cells\n addRows.forEach(row => {\n addRow(row, scene);\n });\n\n // add cells\n updateCells.forEach(cell => {\n // updateRowAttr(row, scene);\n cell && updateCell(cell.col, cell.row, scene.table, false);\n });\n\n // reset attribute y and row number in CellGroup\n resetRowNumberAndY(scene);\n}\n\nfunction removeRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n\n // // remove cellGroup in headerColGroup\n // let headerCellGroup;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // headerCellGroup = cellGroup;\n // return true;\n // }\n // return false;\n // });\n // if (headerCellGroup) {\n // headerColGroup.removeChild(headerCellGroup);\n // }\n\n // remove cellGroup in colGroup\n let cellGroup;\n colGroup.forEachChildren((cell: Group) => {\n if (cell.row === row) {\n cellGroup = cell;\n return true;\n }\n return false;\n });\n if (cellGroup) {\n colGroup.removeChild(cellGroup);\n }\n }\n // TODO 需要整体更新proxy的状态\n scene.proxy.rowEnd--;\n scene.proxy.bodyBottomRow--;\n scene.proxy.totalRow--;\n}\n\nfunction addRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // create cellGroup\n const cellGroup = updateCell(col, row, scene.table, true);\n\n if (!cellGroup) {\n // TODO: deal with data promise situation\n continue;\n }\n\n // insert cellGroup in colGroup\n const colGroup = scene.getColGroup(col);\n if (colGroup.firstChild && row < (colGroup.firstChild as Group).row) {\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n } else if (colGroup.lastChild && row > (colGroup.lastChild as Group).row) {\n colGroup.appendChild(cellGroup);\n } else {\n let cellBefore;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.row === row) {\n cellBefore = cellGroup;\n return true;\n }\n return false;\n });\n if (cellBefore !== cellGroup) {\n colGroup.insertBefore(cellGroup, cellBefore);\n }\n }\n\n // reset row number\n let rowIndex = (colGroup.firstChild as Group)?.row;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n }\n // TODO 需要整体更新proxy的状态\n scene.proxy.rowEnd++;\n scene.proxy.bodyBottomRow++;\n scene.proxy.totalRow++;\n}\n\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\nfunction resetRowNumber(scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n headerColGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n rowIndex = (colGroup.firstChild as Group)?.row;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n }\n}\n\nfunction resetRowNumberAndY(scene: Scenegraph) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n let y = 0;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // if (cellGroup.role !== 'cell') {\n // return;\n // }\n // cellGroup.setAttribute('y', y);\n // y+= cellGroup.attribute.height;\n // });\n rowIndex = (colGroup.firstChild as Group)?.row;\n const rowStart = rowIndex;\n y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n\n // const rowCount = rowIndex - rowStart;\n // if (col === 0 && scene.proxy.rowEnd - scene.proxy.rowStart + 1 !== rowCount) {\n // scene.proxy.rowEnd = scene.proxy.rowStart + rowCount - 1;\n // scene.proxy.referenceRow = scene.proxy.rowStart + Math.floor((scene.proxy.rowEnd - scene.proxy.rowStart) / 2);\n // }\n }\n\n // update table size\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/update-row.ts"],"names":[],"mappings":";;;AAEA,4CAAyC;AACzC,8DAA0D;AAM1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,CAAC,CAAC;QACH,cAAc,GAAG,CAAC,CAAC;KAOpB;IACD,OAAO,cAAc,CAAC;AACxB,CAAC","file":"update-row.js","sourcesContent":["import type { CellAddress } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { Group } from '../graphic/group';\nimport { updateCell } from '../group-creater/cell-helper';\nimport type { Scenegraph } from '../scenegraph';\n\n/**\n * add and remove rows in scenegraph\n */\nexport function updateRow(\n removeCells: CellAddress[],\n addCells: CellAddress[],\n updateCells: CellAddress[],\n table: BaseTableAPI\n) {\n const scene = table.scenegraph;\n // deduplication\n const removeRows = deduplication(removeCells.map(cell => cell.row)).sort((a, b) => a - b);\n const addRows = deduplication(addCells.map(cell => cell.row)).sort((a, b) => a - b);\n // const updateRows = deduplication(updateCells.map(cell => cell.row)).sort((a, b) => a - b);\n\n // remove cells\n removeRows.forEach(row => {\n removeRow(row, scene);\n });\n\n if (removeRows.length) {\n resetRowNumber(scene);\n }\n\n // add cells\n addRows.forEach(row => {\n addRow(row, scene);\n });\n\n // add cells\n updateCells.forEach(cell => {\n // updateRowAttr(row, scene);\n cell && updateCell(cell.col, cell.row, scene.table, false);\n });\n\n // reset attribute y and row number in CellGroup\n const newTotalHeight = resetRowNumberAndY(scene);\n\n if (addRows.length) {\n scene.proxy.rowUpdatePos = scene.proxy.rowStart;\n scene.proxy.rowUpdateDirection = 'up';\n scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);\n scene.proxy.progress();\n }\n\n // update table size\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n}\n\nfunction removeRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n\n // // remove cellGroup in headerColGroup\n // let headerCellGroup;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // headerCellGroup = cellGroup;\n // return true;\n // }\n // return false;\n // });\n // if (headerCellGroup) {\n // headerColGroup.removeChild(headerCellGroup);\n // }\n\n // remove cellGroup in colGroup\n let cellGroup;\n colGroup.forEachChildren((cell: Group) => {\n if (cell.row === row) {\n cellGroup = cell;\n return true;\n }\n return false;\n });\n if (cellGroup) {\n colGroup.removeChild(cellGroup);\n }\n }\n // TODO 需要整体更新proxy的状态\n scene.proxy.rowEnd--;\n scene.proxy.bodyBottomRow--;\n scene.proxy.currentRow--;\n scene.proxy.totalRow--;\n}\n\nfunction addRow(row: number, scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n // create cellGroup\n // const cellGroup = updateCell(col, row, scene.table, true);\n const cellGroup = new Group({\n x: 0,\n y: 0,\n width: scene.table.getColWidth(col),\n height: scene.table.getRowHeight(row)\n });\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n cellGroup.needUpdate = true;\n\n if (!cellGroup) {\n // TODO: deal with data promise situation\n continue;\n }\n\n // insert cellGroup in colGroup\n const colGroup = scene.getColGroup(col);\n if (colGroup.firstChild && row < (colGroup.firstChild as Group).row) {\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n (colGroup.firstChild as Group).row = (colGroup.firstChild as Group).row + 1;\n } else if (colGroup.lastChild && row > (colGroup.lastChild as Group).row) {\n colGroup.appendChild(cellGroup);\n } else {\n // let cellBefore: Group;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // if (cellGroup.row === row) {\n // cellBefore = cellGroup;\n // return true;\n // }\n // return false;\n // });\n\n const cellBefore = scene.highPerformanceGetCell(col, row, true);\n if (cellBefore !== cellGroup) {\n colGroup.insertBefore(cellGroup, cellBefore);\n cellBefore && (cellBefore.row = cellBefore.row + 1);\n if (cellBefore !== colGroup.lastChild) {\n colGroup.lastChild && ((colGroup.lastChild as Group).row = (colGroup.lastChild as Group).row + 1);\n }\n }\n }\n\n // // reset row number\n // let rowIndex = (colGroup.firstChild as Group)?.row;\n // colGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // });\n }\n // TODO 需要整体更新proxy的状态\n scene.proxy.rowEnd++;\n scene.proxy.bodyBottomRow++;\n scene.proxy.currentRow++;\n scene.proxy.totalRow++;\n}\n\n// array deduplication\nfunction deduplication(array: number[]) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n if (result.indexOf(array[i]) === -1) {\n result.push(array[i]);\n }\n }\n return result;\n}\n\nfunction resetRowNumber(scene: Scenegraph) {\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n headerColGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n rowIndex = (colGroup.firstChild as Group)?.row;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n });\n }\n}\n\nfunction resetRowNumberAndY(scene: Scenegraph) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const headerColGroup = scene.getColGroup(col, true);\n const colGroup = scene.getColGroup(col, false);\n // reset row number\n let rowIndex = (headerColGroup.firstChild as Group)?.row;\n let y = 0;\n // headerColGroup.forEachChildren((cellGroup: Group) => {\n // cellGroup.row = rowIndex;\n // rowIndex++;\n // if (cellGroup.role !== 'cell') {\n // return;\n // }\n // cellGroup.setAttribute('y', y);\n // y+= cellGroup.attribute.height;\n // });\n rowIndex = (colGroup.firstChild as Group)?.row;\n const rowStart = rowIndex;\n y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.row = rowIndex;\n rowIndex++;\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n\n // const rowCount = rowIndex - rowStart;\n // if (col === 0 && scene.proxy.rowEnd - scene.proxy.rowStart + 1 !== rowCount) {\n // scene.proxy.rowEnd = scene.proxy.rowStart + rowCount - 1;\n // scene.proxy.referenceRow = scene.proxy.rowStart + Math.floor((scene.proxy.rowEnd - scene.proxy.rowStart) / 2);\n // }\n }\n return newTotalHeight;\n}\n"]}
|
|
@@ -85,7 +85,7 @@ export declare class Scenegraph {
|
|
|
85
85
|
getIcon(col: number, row: number, x: number, y: number): Icon | undefined;
|
|
86
86
|
setIconHoverStyle(icon: Icon, col: number, row: number, cellGroup: Group): void;
|
|
87
87
|
setIconNormalStyle(icon: Icon, col: number, row: number): void;
|
|
88
|
-
updateColWidth(col: number, detaX: number): void;
|
|
88
|
+
updateColWidth(col: number, detaX: number, skipUpdateContainer?: boolean): void;
|
|
89
89
|
updateChartSize(col: number): void;
|
|
90
90
|
updateChartState(datum: any): void;
|
|
91
91
|
updateCheckboxCellState(col: number, row: number, checked: boolean): void;
|
|
@@ -111,6 +111,7 @@ export declare class Scenegraph {
|
|
|
111
111
|
resetFrozen(): void;
|
|
112
112
|
updateCellLayoutWidthCertainWidth(columnGroup: Group, detaRow: number, col: number): boolean;
|
|
113
113
|
updateHeaderPosition(colSource: number, rowSource: number, colTarget: number, rowTarget: number): void;
|
|
114
|
+
updateContainerAttrWidthAndX(): void;
|
|
114
115
|
updateContainer(): void;
|
|
115
116
|
updateCellContentWhileResize(col: number, row: number): void;
|
|
116
117
|
createFrameBorder(): void;
|