@visactor/vtable 0.13.2-alpha.6 → 0.13.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/PivotChart.js +6 -6
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuContainer.js +1 -1
- package/cjs/components/menu/dom/logic/MenuContainer.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +3 -3
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +2 -2
- package/cjs/core/BaseTable.js +7 -2
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.js +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/event/event.js +8 -3
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/table-group.js +29 -5
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +1 -0
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.js +1 -0
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/custom.d.ts +1 -0
- package/cjs/scenegraph/component/custom.js +14 -2
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/component/menu.js +1 -1
- package/cjs/scenegraph/component/menu.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +2 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.js +3 -3
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +3 -2
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +3 -2
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +1 -2
- 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 +4 -1
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +17 -14
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/update-container.d.ts +1 -1
- package/cjs/scenegraph/utils/update-container.js +1 -2
- package/cjs/scenegraph/utils/update-container.js.map +1 -1
- package/cjs/ts-types/events.d.ts +2 -2
- package/cjs/ts-types/events.js.map +1 -1
- package/dist/vtable.js +229 -118
- package/dist/vtable.min.js +2 -2
- package/es/PivotChart.js +6 -6
- package/es/PivotChart.js.map +1 -1
- package/es/components/menu/dom/logic/MenuContainer.js +1 -1
- package/es/components/menu/dom/logic/MenuContainer.js.map +1 -1
- package/es/components/menu/dom/logic/MenuElement.js +3 -3
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/core/BaseTable.d.ts +2 -2
- package/es/core/BaseTable.js +7 -2
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +1 -1
- package/es/core/TABLE_EVENT_TYPE.js +1 -1
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/event/event.js +8 -3
- package/es/event/event.js.map +1 -1
- package/es/event/listener/table-group.js +29 -5
- package/es/event/listener/table-group.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/pivot-header-layout.js +1 -0
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.js +1 -0
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/scenegraph/component/custom.d.ts +1 -0
- package/es/scenegraph/component/custom.js +12 -0
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/component/menu.js +1 -1
- package/es/scenegraph/component/menu.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +2 -2
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/update-auto-column.js +3 -3
- package/es/scenegraph/group-creater/progress/update-position/update-auto-column.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +4 -1
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +4 -1
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +1 -2
- 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 +4 -1
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/scenegraph.js +12 -11
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/update-container.d.ts +1 -1
- package/es/scenegraph/utils/update-container.js +1 -2
- package/es/scenegraph/utils/update-container.js.map +1 -1
- package/es/ts-types/events.d.ts +2 -2
- package/es/ts-types/events.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAE9D,2CAAiD;AAEjD,6CAA8C;AAG9C,0CAA2C;AAC3C,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAiE;AACjE,+EAAsF;AACtF,2FAA2F;AAC3F,6CAAqD;AAErD,MAAM,YAAY,GAAG,IAAI,eAAQ,CAAC;IAChC,SAAS,EAAE,IAAI;CAEhB,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,IAAI,kBAAQ,CAAC;IACpC,KAAK,EAAE,CAAC;IACR,MAAM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,CAAC,aAAa,CAAC;YACzB,YAAY;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ;YACR,SAAS;YACT,UAAU;YACV,UAAU;YACV,UAAU;YACV,SAAS,EAAE,YAAY;SACxB,CAAC,CAAC;QACH,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;KAC9C;SAAM;QAEL,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;KACvC;IAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/E,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;IAChE,OAAO;QACL,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC","file":"compute-row-height.js","sourcesContent":["import { RichText, Group as VGroup } from '@visactor/vrender';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { validToString } from '../../tools/util';\nimport type { ColumnIconOption } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { ColumnData, TextColumnDefine } from '../../ts-types/list-table/layout-map/api';\nimport { WrapText } from '../graphic/text';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { dealWithRichTextIcon } from '../utils/text-icon-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentHeight } from '../../components/axis/get-axis-component-size';\nimport { isArray, isNumber } from '@visactor/vutils';\n\nconst utilTextMark = new WrapText({\n ignoreBuf: true\n // autoWrapText: true\n});\nconst utilRichTextMark = new RichText({\n width: 0,\n height: 0,\n textConfig: []\n});\n\nexport function computeRowsHeight(\n table: BaseTableAPI,\n rowStart?: number,\n rowEnd?: number,\n isClearRowRangeHeightsMap: boolean = true,\n update?: boolean\n): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n\n const oldRowHeights: number[] = [];\n const newHeights: number[] = [];\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n // oldRowHeights.push(table.getRowHeight(row));\n oldRowHeights[row] = table.getRowHeight(row);\n }\n }\n\n table.defaultHeaderRowHeight;\n table.defaultHeaderColWidth;\n const isDefaultHeaderHasAuto =\n table.defaultHeaderRowHeight === 'auto' ||\n (isArray(table.defaultHeaderRowHeight) && table.defaultHeaderRowHeight.some(item => item === 'auto'));\n const isAllRowsAuto = table.heightMode === 'autoHeight' || table.heightMode === 'adaptive';\n\n if (isAllRowsAuto || isDefaultHeaderHasAuto) {\n rowStart = rowStart ?? 0;\n rowEnd = rowEnd ?? table.rowCount - 1;\n\n // clear rowRangeHeightsMap\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n // else {\n // for (let row = rowStart; row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);\n // }\n // }\n\n // compute header row in column header row\n for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n }\n\n // compute bottom frozen row\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n }\n\n if (rowEnd < table.columnHeaderLevelCount || !isAllRowsAuto) {\n // do nothing\n } else {\n // compute body row\n if (\n // 以列展示 且符合只需要计算第一行其他行可复用行高的条条件\n !(\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, fill all row width single compute\n // traspose table and row indicator pivot table cannot use single row height\n const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);\n fillRowsHeight(\n height,\n table.columnHeaderLevelCount,\n table.rowCount - 1 - table.bottomFrozenRowCount,\n table,\n update ? newHeights : undefined\n );\n //底部冻结的行行高需要单独计算\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n } else if (\n // 以行展示\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) {\n // check fixed style and no wrap situation, just compute 0-table.rowHeaderLevelCount column(the column after row header) in ervey row\n // in traspose table and row indicator pivot table\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);//注释掉 注意有无缓存问题\n let height;\n if (checkFixedStyleAndNoWrapForTranspose(table, row)) {\n // 以行展示 只计算到body第一列样式的情况即可\n height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);\n } else {\n height = computeRowHeight(row, 0, table.colCount - 1, table);\n }\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n } else {\n // 以列展示 需要逐行计算情况\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row); //注释掉 注意有无缓存问题\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n }\n }\n }\n\n // 处理adaptive高度\n if (table.heightMode === 'adaptive') {\n table._clearRowRangeHeightsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1);\n const bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0;\n const totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight;\n const startRow = table.columnHeaderLevelCount;\n const endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;\n let actualHeight = 0;\n for (let row = startRow; row < endRow; row++) {\n actualHeight += update ? newHeights[row] : table.getRowHeight(row);\n }\n const factor = totalDrawHeight / actualHeight;\n for (let row = startRow; row < endRow; row++) {\n let rowHeight;\n if (row === endRow - 1) {\n rowHeight =\n totalDrawHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= startRow && index <= endRow - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(startRow, endRow - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table.setRowHeight(row, rowHeight, false);\n }\n }\n } else if (table.autoFillHeight) {\n table._clearRowRangeHeightsMap();\n const canvasHeight = table.tableNoFrameHeight;\n let actualHeight = 0;\n let actualHeaderHeight = 0;\n for (let row = 0; row < table.rowCount; row++) {\n const rowHeight = update ? newHeights[row] : table.getRowHeight(row);\n if (row < table.frozenRowCount || row >= table.rowCount - table.bottomFrozenRowCount) {\n actualHeaderHeight += rowHeight;\n }\n\n actualHeight += rowHeight;\n }\n\n // 如果内容高度小于canvas高度,执行adaptive放大\n if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {\n const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n if (update) {\n newHeights[row] = newHeights[row] * factor;\n } else {\n table.setRowHeight(row, table.getRowHeight(row) * factor);\n }\n }\n }\n }\n\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n const newRowHeight = newHeights[row] ?? table.getRowHeight(row);\n if (newRowHeight !== oldRowHeights[row]) {\n // update the row height in scenegraph\n table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row]);\n }\n }\n }\n // console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, rowStart, rowEnd);\n}\n\nexport function computeRowHeight(row: number, startCol: number, endCol: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n // 如果是透视图\n if (\n table.isPivotChart() &&\n row >= table.columnHeaderLevelCount &&\n row < table.rowCount - table.bottomFrozenRowCount\n ) {\n if ((table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) {\n //并且指标是以列展示 计算行高需要根据y轴的值域范围\n const optimunHeight = (table.internalProps.layoutMap as PivotHeaderLayoutMap).getOptimunHeightForChart(row);\n if (optimunHeight > 0) {\n return optimunHeight;\n }\n } else {\n //直接拿默认行高\n const defaultHeight = table.getDefaultRowHeight(row);\n if (isNumber(defaultHeight)) {\n return defaultHeight;\n }\n }\n }\n for (let col = startCol; col <= endCol; col++) {\n // CustomRender height calculation\n const customHeight = computeCustomRenderHeight(col, row, table);\n if (typeof customHeight === 'number') {\n maxHeight = Math.max(customHeight, maxHeight);\n continue;\n }\n\n // Axis component height calculation\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentHeight(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxHeight = Math.max(axisWidth, maxHeight);\n continue;\n }\n }\n }\n\n // text height calculation\n const textHeight = computeTextHeight(col, row, table);\n maxHeight = Math.max(textHeight, maxHeight);\n }\n return maxHeight;\n}\n\nfunction checkFixedStyleAndNoWrap(table: BaseTableAPI): boolean {\n const { layoutMap } = table.internalProps;\n const row = table.columnHeaderLevelCount;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n (table.internalProps.autoWrapText || table.isPivotChart()) &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n for (let col = 0; col < table.colCount; col++) {\n const cellDefine = layoutMap.getBody(col, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(col, row); //获取的style是结合了theme配置的style\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction checkFixedStyleAndNoWrapForTranspose(table: BaseTableAPI, row: number): boolean {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const cellDefine = layoutMap.getBody(table.rowHeaderLevelCount, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction fillRowsHeight(\n height: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n newHeights: number[] | undefined\n) {\n for (let row = startRow; row <= endRow; row++) {\n if (newHeights) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n}\n\n/**\n * @description: compute customRender height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderHeight(col: number, row: number, table: BaseTableAPI): number | undefined {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanRow = 1;\n let height = 0;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer instanceof VGroup) {\n height = (customLayoutObj.rootContainer as VGroup).AABBBounds.height() ?? 0;\n // height = (customLayoutObj.rootContainer as VGroup).attribute.height ?? 0;\n } else if (customLayoutObj.rootContainer) {\n customLayoutObj.rootContainer.isRoot = true;\n const size = customLayoutObj.rootContainer.getContentSize();\n height = size.height ?? 0;\n } else {\n height = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n height = customRenderObj?.expectedHeight ?? 0;\n } else {\n height = customRender?.expectedHeight ?? 0;\n }\n return height / spanRow;\n }\n return undefined;\n}\n\n/**\n * @description: compute text height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextHeight(col: number, row: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconHeight = 0;\n let iconWidth = 0;\n const iconInlineFront: ColumnIconOption[] = [];\n let iconInlineFrontHeight = 0;\n const iconInlineEnd: ColumnIconOption[] = [];\n let iconInlineEndHeight = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (\n icon.positionType !== IconPosition.absoluteRight &&\n icon.positionType !== IconPosition.inlineFront &&\n icon.positionType !== IconPosition.inlineEnd\n ) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n iconHeight = Math.max(iconHeight, icon.height ?? 0);\n } else if (icon.positionType === IconPosition.inlineFront) {\n iconInlineFront.push(icon);\n iconInlineFrontHeight = Math.max(\n iconInlineFrontHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n } else if (icon.positionType === IconPosition.inlineEnd) {\n iconInlineEnd.push(icon);\n iconInlineEndHeight = Math.max(\n iconInlineEndHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n }\n });\n }\n let spanRow = 1;\n let endCol = col;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n col = cellRange.start.col;\n endCol = cellRange.end.col;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontStyle = getProp('fontStyle', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lineHeight = getProp('lineHeight', actStyle, col, row, table) ?? fontSize;\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);\n const lines = validToString(cellValue).split('\\n') || [];\n\n const cellWidth = table.getColsWidth(col, endCol);\n\n if (iconInlineFront.length || iconInlineEnd.length) {\n // if (autoWrapText) {\n const textOption = Object.assign({\n text: cellValue?.toString(),\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n lineHeight\n });\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))\n ];\n utilRichTextMark.setAttributes({\n width: cellWidth - (padding[1] + padding[3]) - iconWidth,\n height: 0,\n textConfig\n });\n maxHeight = utilRichTextMark.AABBBounds.height();\n // } else {\n // maxHeight = 0;\n // lines.forEach((line: string, index: number) => {\n // if (index === 0 && iconInlineFront.length) {\n // maxHeight += Math.max(lineHeight, iconInlineFrontHeight);\n // } else if (index === lines.length - 1 && iconInlineEnd.length) {\n // maxHeight += Math.max(lineHeight, iconInlineEndHeight);\n // } else {\n // maxHeight += lineHeight;\n // }\n // });\n // }\n } else if (autoWrapText) {\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;\n utilTextMark.setAttributes({\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word'\n });\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n // autoWrapText = false\n maxHeight = lines.length * lineHeight;\n }\n\n return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: table.getColWidth(col),\n height: 0\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/compute-row-height.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAE9D,2CAAiD;AAEjD,6CAA8C;AAG9C,0CAA2C;AAC3C,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAiE;AACjE,+EAAsF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CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;YACxD,MAAM,EAAE,CAAC;YACT,UAAU;SACX,CAAC,CAAC;QACH,SAAS,GAAG,gBAAgB,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;KAalD;SAAM,IAAI,YAAY,EAAE;QACvB,MAAM,YAAY,GAAG,SAAS,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;QACvE,YAAY,CAAC,aAAa,CAAC;YACzB,YAAY;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ;YACR,SAAS;YACT,UAAU;YACV,UAAU;YACV,UAAU;YACV,SAAS,EAAE,YAAY;SACxB,CAAC,CAAC;QACH,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;KAC9C;SAAM;QAEL,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;KACvC;IAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAC/E,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;IAChE,OAAO;QACL,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC","file":"compute-row-height.js","sourcesContent":["import { RichText, Group as VGroup } from '@visactor/vrender';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { validToString } from '../../tools/util';\nimport type { ColumnIconOption } from '../../ts-types';\nimport { IconPosition } from '../../ts-types';\nimport type { BaseTableAPI, HeaderData } from '../../ts-types/base-table';\nimport type { ColumnData, TextColumnDefine } from '../../ts-types/list-table/layout-map/api';\nimport { WrapText } from '../graphic/text';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { dealWithRichTextIcon } from '../utils/text-icon-layout';\nimport { getAxisConfigInPivotChart } from '../../layout/chart-helper/get-axis-config';\nimport { computeAxisComponentHeight } from '../../components/axis/get-axis-component-size';\nimport { isArray, isNumber } from '@visactor/vutils';\nimport { decodeReactDom } from '../component/custom';\n\nconst utilTextMark = new WrapText({\n ignoreBuf: true\n // autoWrapText: true\n});\nconst utilRichTextMark = new RichText({\n width: 0,\n height: 0,\n textConfig: []\n});\n\nexport function computeRowsHeight(\n table: BaseTableAPI,\n rowStart?: number,\n rowEnd?: number,\n isClearRowRangeHeightsMap: boolean = true,\n update?: boolean\n): void {\n const time = typeof window !== 'undefined' ? window.performance.now() : 0;\n\n const oldRowHeights: number[] = [];\n const newHeights: number[] = [];\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n // oldRowHeights.push(table.getRowHeight(row));\n oldRowHeights[row] = table.getRowHeight(row);\n }\n }\n\n table.defaultHeaderRowHeight;\n table.defaultHeaderColWidth;\n const isDefaultHeaderHasAuto =\n table.defaultHeaderRowHeight === 'auto' ||\n (isArray(table.defaultHeaderRowHeight) && table.defaultHeaderRowHeight.some(item => item === 'auto'));\n const isAllRowsAuto = table.heightMode === 'autoHeight' || table.heightMode === 'adaptive';\n\n if (isAllRowsAuto || isDefaultHeaderHasAuto) {\n rowStart = rowStart ?? 0;\n rowEnd = rowEnd ?? table.rowCount - 1;\n\n // clear rowRangeHeightsMap\n if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {\n table._clearRowRangeHeightsMap();\n }\n // else {\n // for (let row = rowStart; row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);\n // }\n // }\n\n // compute header row in column header row\n for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n }\n\n // compute bottom frozen row\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n if (isAllRowsAuto || table.getDefaultRowHeight(row) === 'auto') {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n }\n\n if (rowEnd < table.columnHeaderLevelCount || !isAllRowsAuto) {\n // do nothing\n } else {\n // compute body row\n if (\n // 以列展示 且符合只需要计算第一行其他行可复用行高的条条件\n !(\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) &&\n checkFixedStyleAndNoWrap(table)\n ) {\n // check fixed style and no wrap situation, fill all row width single compute\n // traspose table and row indicator pivot table cannot use single row height\n const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);\n fillRowsHeight(\n height,\n table.columnHeaderLevelCount,\n table.rowCount - 1 - table.bottomFrozenRowCount,\n table,\n update ? newHeights : undefined\n );\n //底部冻结的行行高需要单独计算\n for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n } else if (\n // 以行展示\n table.internalProps.transpose ||\n (table.isPivotTable() && !(table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) {\n // check fixed style and no wrap situation, just compute 0-table.rowHeaderLevelCount column(the column after row header) in ervey row\n // in traspose table and row indicator pivot table\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row);//注释掉 注意有无缓存问题\n let height;\n if (checkFixedStyleAndNoWrapForTranspose(table, row)) {\n // 以行展示 只计算到body第一列样式的情况即可\n height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);\n } else {\n height = computeRowHeight(row, 0, table.colCount - 1, table);\n }\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n } else {\n // 以列展示 需要逐行计算情况\n for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {\n // table._clearRowRangeHeightsMap(row); //注释掉 注意有无缓存问题\n const height = computeRowHeight(row, 0, table.colCount - 1, table);\n // table.setRowHeight(row, height);\n if (update) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n }\n }\n }\n\n // 处理adaptive高度\n if (table.heightMode === 'adaptive') {\n table._clearRowRangeHeightsMap();\n // const canvasWidth = table.internalProps.canvas.width;\n const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1);\n const bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0;\n const totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight;\n const startRow = table.columnHeaderLevelCount;\n const endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;\n let actualHeight = 0;\n for (let row = startRow; row < endRow; row++) {\n actualHeight += update ? newHeights[row] : table.getRowHeight(row);\n }\n const factor = totalDrawHeight / actualHeight;\n for (let row = startRow; row < endRow; row++) {\n let rowHeight;\n if (row === endRow - 1) {\n rowHeight =\n totalDrawHeight -\n (update\n ? newHeights.reduce((acr, cur, index) => {\n if (index >= startRow && index <= endRow - 2) {\n return acr + cur;\n }\n return acr;\n }, 0)\n : table.getRowsHeight(startRow, endRow - 2));\n } else {\n rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);\n }\n if (update) {\n newHeights[row] = rowHeight;\n } else {\n table.setRowHeight(row, rowHeight, false);\n }\n }\n } else if (table.autoFillHeight) {\n table._clearRowRangeHeightsMap();\n const canvasHeight = table.tableNoFrameHeight;\n let actualHeight = 0;\n let actualHeaderHeight = 0;\n for (let row = 0; row < table.rowCount; row++) {\n const rowHeight = update ? newHeights[row] : table.getRowHeight(row);\n if (row < table.frozenRowCount || row >= table.rowCount - table.bottomFrozenRowCount) {\n actualHeaderHeight += rowHeight;\n }\n\n actualHeight += rowHeight;\n }\n\n // 如果内容高度小于canvas高度,执行adaptive放大\n if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {\n const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);\n for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {\n if (update) {\n newHeights[row] = newHeights[row] * factor;\n } else {\n table.setRowHeight(row, table.getRowHeight(row) * factor);\n }\n }\n }\n }\n\n if (update) {\n for (let row = 0; row < table.rowCount; row++) {\n const newRowHeight = newHeights[row] ?? table.getRowHeight(row);\n if (newRowHeight !== oldRowHeights[row]) {\n // update the row height in scenegraph\n table.scenegraph.updateRowHeight(row, newRowHeight - oldRowHeights[row]);\n }\n }\n }\n // console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time, rowStart, rowEnd);\n}\n\nexport function computeRowHeight(row: number, startCol: number, endCol: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n // 如果是透视图\n if (\n table.isPivotChart() &&\n row >= table.columnHeaderLevelCount &&\n row < table.rowCount - table.bottomFrozenRowCount\n ) {\n if ((table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol) {\n //并且指标是以列展示 计算行高需要根据y轴的值域范围\n const optimunHeight = (table.internalProps.layoutMap as PivotHeaderLayoutMap).getOptimunHeightForChart(row);\n if (optimunHeight > 0) {\n return optimunHeight;\n }\n } else {\n //直接拿默认行高\n const defaultHeight = table.getDefaultRowHeight(row);\n if (isNumber(defaultHeight)) {\n return defaultHeight;\n }\n }\n }\n for (let col = startCol; col <= endCol; col++) {\n // CustomRender height calculation\n const customHeight = computeCustomRenderHeight(col, row, table);\n if (typeof customHeight === 'number') {\n maxHeight = Math.max(customHeight, maxHeight);\n continue;\n }\n\n // Axis component height calculation\n if (table.isPivotChart()) {\n const layout = table.internalProps.layoutMap as PivotHeaderLayoutMap;\n const axisConfig = getAxisConfigInPivotChart(col, row, layout);\n if (axisConfig) {\n const axisWidth = computeAxisComponentHeight(axisConfig, table);\n if (typeof axisWidth === 'number') {\n maxHeight = Math.max(axisWidth, maxHeight);\n continue;\n }\n }\n }\n\n // text height calculation\n const textHeight = computeTextHeight(col, row, table);\n maxHeight = Math.max(textHeight, maxHeight);\n }\n return maxHeight;\n}\n\nfunction checkFixedStyleAndNoWrap(table: BaseTableAPI): boolean {\n const { layoutMap } = table.internalProps;\n const row = table.columnHeaderLevelCount;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n (table.internalProps.autoWrapText || table.isPivotChart()) &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n for (let col = 0; col < table.colCount; col++) {\n const cellDefine = layoutMap.getBody(col, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(col, row); //获取的style是结合了theme配置的style\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction checkFixedStyleAndNoWrapForTranspose(table: BaseTableAPI, row: number): boolean {\n const { layoutMap } = table.internalProps;\n //设置了全局自动换行的话 不能复用高度计算\n if (\n table.internalProps.autoWrapText &&\n (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')\n ) {\n return false;\n }\n\n const cellDefine = layoutMap.getBody(table.rowHeaderLevelCount, row);\n if (\n typeof cellDefine.style === 'function' ||\n typeof (cellDefine as ColumnData).icon === 'function' ||\n cellDefine.define?.customRender ||\n typeof cellDefine.define?.icon === 'function'\n ) {\n return false;\n }\n const cellStyle = table._getCellStyle(table.rowHeaderLevelCount, row);\n if (\n typeof cellStyle.padding === 'function' ||\n typeof cellStyle.fontSize === 'function' ||\n typeof cellStyle.lineHeight === 'function' ||\n cellStyle.autoWrapText === true\n ) {\n return false;\n }\n\n return true;\n}\n\nfunction fillRowsHeight(\n height: number,\n startRow: number,\n endRow: number,\n table: BaseTableAPI,\n newHeights: number[] | undefined\n) {\n for (let row = startRow; row <= endRow; row++) {\n if (newHeights) {\n newHeights[row] = height;\n } else {\n table.setRowHeight(row, height);\n }\n }\n}\n\n/**\n * @description: compute customRender height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeCustomRenderHeight(col: number, row: number, table: BaseTableAPI): number | undefined {\n const customRender = table.getCustomRender(col, row);\n const customLayout = table.getCustomLayout(col, row);\n if (customRender || customLayout) {\n let spanRow = 1;\n let height = 0;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n }\n const arg = {\n col,\n row,\n dataValue: table.getCellOriginValue(col, row),\n value: table.getCellValue(col, row) || '',\n rect: getCellRect(col, row, table),\n table\n };\n if (customLayout) {\n // 处理customLayout\n const customLayoutObj = customLayout(arg);\n if (customLayoutObj.rootContainer) {\n customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);\n }\n if (customLayoutObj.rootContainer instanceof VGroup) {\n height = (customLayoutObj.rootContainer as VGroup).AABBBounds.height() ?? 0;\n // height = (customLayoutObj.rootContainer as VGroup).attribute.height ?? 0;\n } else if (customLayoutObj.rootContainer) {\n customLayoutObj.rootContainer.isRoot = true;\n const size = customLayoutObj.rootContainer.getContentSize();\n height = size.height ?? 0;\n } else {\n height = 0;\n }\n } else if (typeof customRender === 'function') {\n // 处理customRender\n const customRenderObj = customRender(arg);\n height = customRenderObj?.expectedHeight ?? 0;\n } else {\n height = customRender?.expectedHeight ?? 0;\n }\n return height / spanRow;\n }\n return undefined;\n}\n\n/**\n * @description: compute text height\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @return {*}\n */\nfunction computeTextHeight(col: number, row: number, table: BaseTableAPI): number {\n let maxHeight = 0;\n const cellValue = table.getCellValue(col, row);\n // const dataValue = table.getCellOriginValue(col, row);\n const actStyle = table._getCellStyle(col, row);\n let iconHeight = 0;\n let iconWidth = 0;\n const iconInlineFront: ColumnIconOption[] = [];\n let iconInlineFrontHeight = 0;\n const iconInlineEnd: ColumnIconOption[] = [];\n let iconInlineEndHeight = 0;\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = table.getCellLocation(col, row) !== 'body' ? true : !!define?.icon || !!define?.tree;\n if (mayHaveIcon) {\n const icons = table.getCellIcons(col, row);\n icons?.forEach(icon => {\n if (\n icon.positionType !== IconPosition.absoluteRight &&\n icon.positionType !== IconPosition.inlineFront &&\n icon.positionType !== IconPosition.inlineEnd\n ) {\n iconWidth += (icon.width ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0);\n iconHeight = Math.max(iconHeight, icon.height ?? 0);\n } else if (icon.positionType === IconPosition.inlineFront) {\n iconInlineFront.push(icon);\n iconInlineFrontHeight = Math.max(\n iconInlineFrontHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n } else if (icon.positionType === IconPosition.inlineEnd) {\n iconInlineEnd.push(icon);\n iconInlineEndHeight = Math.max(\n iconInlineEndHeight,\n (icon.height ?? 0) + (icon.marginLeft ?? 0) + (icon.marginRight ?? 0)\n );\n }\n });\n }\n let spanRow = 1;\n let endCol = col;\n if (table.isHeader(col, row) || (table.getBodyColumnDefine(col, row) as TextColumnDefine)?.mergeCell) {\n const cellRange = table.getCellRange(col, row);\n spanRow = cellRange.end.row - cellRange.start.row + 1;\n col = cellRange.start.col;\n endCol = cellRange.end.col;\n }\n\n const padding = getQuadProps(getProp('padding', actStyle, col, row, table));\n const fontSize = getProp('fontSize', actStyle, col, row, table);\n const fontStyle = getProp('fontStyle', actStyle, col, row, table);\n const fontWeight = getProp('fontWeight', actStyle, col, row, table);\n const lineHeight = getProp('lineHeight', actStyle, col, row, table) ?? fontSize;\n const fontFamily = getProp('fontFamily', actStyle, col, row, table);\n const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);\n const lines = validToString(cellValue).split('\\n') || [];\n\n const cellWidth = table.getColsWidth(col, endCol);\n\n if (iconInlineFront.length || iconInlineEnd.length) {\n // if (autoWrapText) {\n const textOption = Object.assign({\n text: cellValue?.toString(),\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n lineHeight\n });\n textOption.textBaseline = 'middle';\n const textConfig = [\n ...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),\n textOption,\n ...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))\n ];\n utilRichTextMark.setAttributes({\n width: cellWidth - (padding[1] + padding[3]) - iconWidth,\n height: 0,\n textConfig\n });\n maxHeight = utilRichTextMark.AABBBounds.height();\n // } else {\n // maxHeight = 0;\n // lines.forEach((line: string, index: number) => {\n // if (index === 0 && iconInlineFront.length) {\n // maxHeight += Math.max(lineHeight, iconInlineFrontHeight);\n // } else if (index === lines.length - 1 && iconInlineEnd.length) {\n // maxHeight += Math.max(lineHeight, iconInlineEndHeight);\n // } else {\n // maxHeight += lineHeight;\n // }\n // });\n // }\n } else if (autoWrapText) {\n const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;\n utilTextMark.setAttributes({\n maxLineWidth,\n text: lines,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n lineHeight,\n wordBreak: 'break-word'\n });\n maxHeight = utilTextMark.AABBBounds.height();\n } else {\n // autoWrapText = false\n maxHeight = lines.length * lineHeight;\n }\n\n return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;\n}\n\nfunction getCellRect(col: number, row: number, table: BaseTableAPI) {\n return {\n left: 0,\n top: 0,\n right: table.getColWidth(col),\n bottom: table.getRowHeight(row),\n width: table.getColWidth(col),\n height: 0\n };\n}\n"]}
|
|
@@ -32,8 +32,7 @@ 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.
|
|
36
|
-
scene.isPivot || scene.transpose || scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1),
|
|
35
|
+
scene.updateContainer(), scene.updateBorderSizeAndPosition(), scene.isPivot || scene.transpose || scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1),
|
|
37
36
|
scene.hasFrozen = !0;
|
|
38
37
|
}
|
|
39
38
|
|
|
@@ -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,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AC,CAAC;oBAC/B,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;gBACzC,CAAC,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 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"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/frozen.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,oD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,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 // 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.
|
|
35
|
+
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,YAA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GAAG,GAAG,SAAS,CAAC;IAChC,eAAe,CAAC,GAAG,GAAG,SAAS,CAAC;IAChC,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;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.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"]}
|
|
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,CAAC;IACvB,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,SAAS,KAAK,QAAQ,EAAE;QAC1B,MAAM,eAAe,GAAG,IAAA,iCAAgB,EAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QACtE,MAAM,eAAe,GAAG,IAAA,iCAAgB,EAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QACtE,IAAI,eAAe,IAAI,eAAe,EAAE;YACtC,cAAc,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC;YAC3C,YAA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.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.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"]}
|
|
@@ -24,6 +24,7 @@ function updateRow(removeCells, addCells, updateCells, table) {
|
|
|
24
24
|
function removeRow(row, scene) {
|
|
25
25
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
26
26
|
const colGroup = scene.getColGroup(col, !1);
|
|
27
|
+
if (!colGroup) continue;
|
|
27
28
|
let cellGroup;
|
|
28
29
|
colGroup.forEachChildren((cell => cell.row === row && (cellGroup = cell, !0))),
|
|
29
30
|
cellGroup && colGroup.removeChild(cellGroup);
|
|
@@ -42,7 +43,7 @@ function addRow(row, scene) {
|
|
|
42
43
|
if (cellGroup.role = "cell", cellGroup.col = col, cellGroup.row = row, cellGroup.needUpdate = !0,
|
|
43
44
|
!cellGroup) continue;
|
|
44
45
|
const colGroup = scene.getColGroup(col);
|
|
45
|
-
if (colGroup.firstChild && row < colGroup.firstChild.row) colGroup.insertBefore(cellGroup, colGroup.firstChild),
|
|
46
|
+
if (colGroup) if (colGroup.firstChild && row < colGroup.firstChild.row) colGroup.insertBefore(cellGroup, colGroup.firstChild),
|
|
46
47
|
colGroup.firstChild.row = colGroup.firstChild.row + 1; else if (colGroup.lastChild && row > colGroup.lastChild.row) colGroup.appendChild(cellGroup); else {
|
|
47
48
|
const cellBefore = scene.highPerformanceGetCell(col, row, !0);
|
|
48
49
|
cellBefore !== cellGroup && (colGroup.insertBefore(cellGroup, cellBefore), cellBefore && (cellBefore.row = cellBefore.row + 1),
|
|
@@ -62,6 +63,7 @@ function resetRowNumber(scene) {
|
|
|
62
63
|
var _a, _b;
|
|
63
64
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
64
65
|
const headerColGroup = scene.getColGroup(col, !0), colGroup = scene.getColGroup(col, !1);
|
|
66
|
+
if (!headerColGroup || !colGroup) continue;
|
|
65
67
|
let rowIndex = null === (_a = headerColGroup.firstChild) || void 0 === _a ? void 0 : _a.row;
|
|
66
68
|
headerColGroup.forEachChildren((cellGroup => {
|
|
67
69
|
cellGroup.row = rowIndex, rowIndex++;
|
|
@@ -77,6 +79,7 @@ function resetRowNumberAndY(scene) {
|
|
|
77
79
|
let newTotalHeight = 0;
|
|
78
80
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
79
81
|
const headerColGroup = scene.getColGroup(col, !0), colGroup = scene.getColGroup(col, !1);
|
|
82
|
+
if (!headerColGroup || !colGroup) continue;
|
|
80
83
|
let rowIndex = null === (_a = headerColGroup.firstChild) || void 0 === _a ? void 0 : _a.row, y = 0;
|
|
81
84
|
rowIndex = null === (_b = colGroup.firstChild) || void 0 === _b ? void 0 : _b.row;
|
|
82
85
|
y = 0, colGroup.forEachChildren((cellGroup => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-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CAAC,CAAC,CAAC;YAC/B,CAAC,IAAI,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC;QAClC,CAAC,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"]}
|
|
1
|
+
{"version":3,"sources":["scenegraph/layout/update-row.ts"],"names":[],"mappings":";;;AAEA,4CAAyC;AACzC,8DAA0D;AAM1D,SAAgB,SAAS,CACvB,WAA0B,EAC1B,QAAuB,EACvB,WAA0B,EAC1B,KAAmB;IAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;IAE/B,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAIpF,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACvB,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,IAAI,UAAU,CAAC,MAAM,EAAE;QACrB,cAAc,CAAC,KAAK,CAAC,CAAC;KACvB;IAGD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACpB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IAGH,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAE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I,QAAQ,GAAG,MAAC,cAAc,CAAC,UAAoB,0CAAE,GAAG,CAAC;QACzD,IAAI,CAAC,GAAG,CAAC,CAAC;QAUV,QAAQ,GAAG,MAAC,QAAQ,CAAC,UAAoB,0CAAE,GAAG,CAAC;QAC/C,MAAM,QAAQ,GAAG,QAAQ,CAAC;QAC1B,CAAC,GAAG,CAAC,CAAC;QACN,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAgB,EAAE,EAAE;YAC5C,SAAS,CAAC,GAAG,GAAG,QAAQ,CAAC;YACzB,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;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 if (!colGroup) {\n continue;\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) {\n continue;\n }\n\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 if (!headerColGroup || !colGroup) {\n continue;\n }\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 if (!headerColGroup || !colGroup) {\n continue;\n }\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"]}
|
|
@@ -337,8 +337,7 @@ class Scenegraph {
|
|
|
337
337
|
iconBack && iconBack.setAttribute("visible", !1), icon.attribute.hoverImage && icon.attribute.image !== icon.attribute.originImage && (icon.image = icon.attribute.originImage);
|
|
338
338
|
}
|
|
339
339
|
updateColWidth(col, detaX, skipUpdateContainer) {
|
|
340
|
-
(0, update_width_1.updateColWidth)(this, col, Math.round(detaX)), skipUpdateContainer ||
|
|
341
|
-
this.updateContainer());
|
|
340
|
+
(0, update_width_1.updateColWidth)(this, col, Math.round(detaX)), skipUpdateContainer || this.updateContainer();
|
|
342
341
|
}
|
|
343
342
|
updateChartSize(col) {
|
|
344
343
|
(0, update_chart_1.updateChartSize)(this, col);
|
|
@@ -475,9 +474,9 @@ class Scenegraph {
|
|
|
475
474
|
}
|
|
476
475
|
afterScenegraphCreated() {
|
|
477
476
|
this.isPivot || this.transpose || this.component.setFrozenColumnShadow(this.table.frozenColCount - 1),
|
|
478
|
-
this.table.stateManeger.checkFrozen(), this.
|
|
479
|
-
this.
|
|
480
|
-
|
|
477
|
+
this.table.stateManeger.checkFrozen(), this.updateContainer(), this.createFrameBorder(),
|
|
478
|
+
this.updateBorderSizeAndPosition(), this.component.updateScrollBar(), (0, stick_text_1.handleTextStick)(this.table),
|
|
479
|
+
this.updateNextFrame();
|
|
481
480
|
}
|
|
482
481
|
dealWidthMode() {
|
|
483
482
|
const table = this.table;
|
|
@@ -583,13 +582,16 @@ class Scenegraph {
|
|
|
583
582
|
(0, move_cell_1.moveHeaderPosition)(colSource, rowSource, colTarget, rowTarget, this.table);
|
|
584
583
|
}
|
|
585
584
|
updateContainerAttrWidthAndX() {
|
|
586
|
-
|
|
587
|
-
update_container_1.updateContainerChildrenX)(this.
|
|
588
|
-
update_container_1.updateContainerChildrenX)(this.
|
|
589
|
-
update_container_1.updateContainerChildrenX)(this.
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
update_container_1.updateContainerChildrenX)(this.
|
|
585
|
+
var _a, _b, _c;
|
|
586
|
+
const cornerX = (0, update_container_1.updateContainerChildrenX)(this.cornerHeaderGroup, 0), rowHeaderX = (0,
|
|
587
|
+
update_container_1.updateContainerChildrenX)(this.rowHeaderGroup, 0), colHeaderX = this.colHeaderGroup.hasChildNodes() ? (0,
|
|
588
|
+
update_container_1.updateContainerChildrenX)(this.colHeaderGroup, this.colHeaderGroup.firstChild.col > 0 ? this.table.getColsWidth(null !== (_a = this.table.frozenColCount) && void 0 !== _a ? _a : 0, this.colHeaderGroup.firstChild.col - 1) : 0) : 0, bodyX = this.bodyGroup.hasChildNodes() ? (0,
|
|
589
|
+
update_container_1.updateContainerChildrenX)(this.bodyGroup, this.bodyGroup.firstChild.col > 0 ? this.table.getColsWidth(null !== (_b = this.table.frozenColCount) && void 0 !== _b ? _b : 0, this.bodyGroup.firstChild.col - 1) : 0) : 0, rightX = (0,
|
|
590
|
+
update_container_1.updateContainerChildrenX)(this.rightFrozenGroup, 0);
|
|
591
|
+
this.bottomFrozenGroup.hasChildNodes() && (0, update_container_1.updateContainerChildrenX)(this.bottomFrozenGroup, this.bottomFrozenGroup.firstChild.col > 0 ? this.table.getColsWidth(null !== (_c = this.table.frozenColCount) && void 0 !== _c ? _c : 0, this.bottomFrozenGroup.firstChild.col - 1) : 0),
|
|
592
|
+
(0, update_container_1.updateContainerChildrenX)(this.leftBottomCornerGroup, 0),
|
|
593
|
+
(0, update_container_1.updateContainerChildrenX)(this.rightTopCornerGroup, 0), (0,
|
|
594
|
+
update_container_1.updateContainerChildrenX)(this.rightBottomCornerGroup, 0), this.cornerHeaderGroup.setDeltaWidth(cornerX - this.cornerHeaderGroup.attribute.width),
|
|
593
595
|
this.leftBottomCornerGroup.setDeltaWidth(cornerX - this.leftBottomCornerGroup.attribute.width),
|
|
594
596
|
this.colHeaderGroup.setDeltaWidth(colHeaderX - this.colHeaderGroup.attribute.width),
|
|
595
597
|
this.rightFrozenGroup.setDeltaWidth(colHeaderX - this.rightFrozenGroup.attribute.width),
|
|
@@ -602,7 +604,7 @@ class Scenegraph {
|
|
|
602
604
|
this.bottomFrozenGroup.setAttribute("x", this.rowHeaderGroup.attribute.width), this.bodyGroup.setAttribute("x", this.rowHeaderGroup.attribute.width);
|
|
603
605
|
}
|
|
604
606
|
updateContainer() {
|
|
605
|
-
this.updateTableSize();
|
|
607
|
+
this.updateContainerAttrWidthAndX(), this.updateTableSize();
|
|
606
608
|
const oldHorizontalBarPos = this.table.stateManeger.scroll.horizontalBarPos, oldVerticalBarPos = this.table.stateManeger.scroll.verticalBarPos;
|
|
607
609
|
this.component.updateScrollBar(), this.table.stateManeger.setScrollLeft(oldHorizontalBarPos),
|
|
608
610
|
this.table.stateManeger.setScrollTop(oldVerticalBarPos), this.updateNextFrame();
|
|
@@ -730,7 +732,8 @@ class Scenegraph {
|
|
|
730
732
|
}
|
|
731
733
|
updateRow(removeCells, addCells, updateCells = []) {
|
|
732
734
|
(0, update_row_1.updateRow)(removeCells, addCells, updateCells, this.table), this.recalculateColWidths(),
|
|
733
|
-
this.recalculateRowHeights(), this.table.stateManeger.checkFrozen(), this.
|
|
735
|
+
this.recalculateRowHeights(), this.table.stateManeger.checkFrozen(), this.isPivot || this.transpose || this.component.setFrozenColumnShadow(this.table.frozenColCount - 1),
|
|
736
|
+
this.updateNextFrame();
|
|
734
737
|
}
|
|
735
738
|
findAndUpdateIcon(group, funcTypeArr, iconConfig) {
|
|
736
739
|
group.forEachChildren((icon => {
|