@visactor/vtable 0.18.0-alpha.2 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/ListTable.d.ts +1 -0
- package/cjs/ListTable.js +50 -2
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +102 -83
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.js +4 -4
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/data/DataSource.d.ts +3 -1
- package/cjs/data/DataSource.js +27 -7
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/event/pivot-chart/axis-click.js +2 -2
- package/cjs/event/pivot-chart/axis-click.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/chart-helper/get-axis-config.js +5 -5
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.d.ts +3 -0
- package/cjs/layout/chart-helper/get-chart-spec.js +43 -7
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +4 -3
- package/cjs/layout/pivot-header-layout.js +43 -23
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/custom.d.ts +5 -0
- package/cjs/scenegraph/component/custom.js +20 -3
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.d.ts +6 -3
- package/cjs/scenegraph/group-creater/cell-helper.js +38 -36
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +6 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +11 -7
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/sort-horizontal.js +12 -5
- package/cjs/scenegraph/group-creater/progress/update-position/sort-horizontal.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js +19 -14
- package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
- package/cjs/scenegraph/layout/move-cell.d.ts +2 -1
- package/cjs/scenegraph/layout/move-cell.js +15 -27
- package/cjs/scenegraph/layout/move-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +21 -17
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +40 -17
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +2 -2
- package/cjs/scenegraph/scenegraph.js +10 -7
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/get-cell-merge.js +4 -0
- package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.d.ts +3 -3
- package/cjs/scenegraph/utils/text-icon-layout.js +12 -10
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/cell-move/index.js +4 -2
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/state.js +1 -1
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +5 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +1565 -1207
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +1 -0
- package/es/ListTable.js +49 -2
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +102 -83
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.js +4 -4
- package/es/core/BaseTable.js.map +1 -1
- package/es/data/DataSource.d.ts +3 -1
- package/es/data/DataSource.js +27 -7
- package/es/data/DataSource.js.map +1 -1
- package/es/event/pivot-chart/axis-click.js +2 -2
- package/es/event/pivot-chart/axis-click.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/chart-helper/get-axis-config.js +5 -5
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.d.ts +3 -0
- package/es/layout/chart-helper/get-chart-spec.js +38 -4
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +4 -3
- package/es/layout/pivot-header-layout.js +38 -23
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/component/custom.d.ts +5 -0
- package/es/scenegraph/component/custom.js +18 -0
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.d.ts +6 -3
- package/es/scenegraph/group-creater/cell-helper.js +36 -35
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +6 -2
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +11 -6
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/sort-horizontal.js +12 -5
- package/es/scenegraph/group-creater/progress/update-position/sort-horizontal.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js +19 -14
- package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
- package/es/scenegraph/layout/move-cell.d.ts +2 -1
- package/es/scenegraph/layout/move-cell.js +12 -20
- package/es/scenegraph/layout/move-cell.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +20 -16
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +39 -16
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +2 -2
- package/es/scenegraph/scenegraph.js +9 -6
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/get-cell-merge.js +4 -0
- package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.d.ts +3 -3
- package/es/scenegraph/utils/text-icon-layout.js +10 -10
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/cell-move/index.js +4 -1
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/state.js +1 -1
- package/es/state/state.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +5 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/group-creater/cell-helper.ts"],"names":[],"mappings":";;;AAEA,+CAA4C;AAa5C,gDAAqD;AAErD,gDAA4C;AAC5C,uDAA8D;AAC9D,uDAA8D;AAC9D,qEAAsE;AACtE,iEAAuE;AACvE,qDAAwD;AACxD,uDAA8D;AAG9D,wDAA4E;AAC5E,+CAA+C;AAC/C,kEAA6D;AAC7D,qDAA2D;AAC3D,6DAAoE;AAGpE,mDAAkD;AAClD,wEAAmE;AACnE,8CAAgD;AAChD,2CAAmD;AAEnD,SAAgB,UAAU,CACxB,IAAsB,EACtB,KAAa,EACb,MAAoB,EACpB,KAAmB,EACnB,GAAW,EACX,GAAW,EACX,QAAgB,EAChB,SAAiB,EACjB,UAAkB,EAClB,WAAkB,EAClB,CAAS,EACT,OAAyC,EACzC,SAA0B,EAC1B,YAAgC,EAChC,WAAoB,EACpB,SAAqB;;IAErB,IAAI,IAAA,kBAAS,EAAC,KAAK,CAAC,EAAE;QACpB,KAAK,GAAG,KAA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AAC,CAAC;IACnD,MAAM,WAAW,GAAG,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA,IAAI,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA,CAAC;IACrD,MAAM,QAAQ,GAAG,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,KAAK,YAAY,CAAC;IACxD,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE3C,IACE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;QACzB,YAAY,CAAC,IAAI,KAAK,MAAM;QAC5B,QAAQ,KAAK,MAAM;QACnB,CAAC,YAAY;QACb,CAAC,aAAa;QACd,CAAC,WAAW;QACZ,CAAA,MAAA,YAAY,CAAC,UAAU,0CAAE,IAAI,MAAK,MAAM;QACxC,CAAC,IAAA,kBAAS,EAAC,KAAK,CAAC,EACjB;QACA,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"cell-helper.js","sourcesContent":["import type { Cursor, IThemeSpec } from './../../vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { regUrl } from '../../tools/global';\nimport type {\n CellRange,\n ChartColumnDefine,\n CheckboxColumnDefine,\n ColumnDefine,\n ColumnTypeOption,\n ICustomRender,\n ImageColumnDefine,\n MappingRule,\n ProgressbarColumnDefine,\n TextColumnDefine\n} from '../../ts-types';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport { getProp } from '../utils/get-prop';\nimport { createChartCellGroup } from './cell-type/chart-cell';\nimport { createImageCellGroup } from './cell-type/image-cell';\nimport { createProgressBarCell } from './cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from './cell-type/spark-line-cell';\nimport { createCellGroup } from './cell-type/text-cell';\nimport { createVideoCellGroup } from './cell-type/video-cell';\nimport type { ICustomLayoutFuc } from '../../ts-types/customLayout';\nimport type { BaseTableAPI, PivotTableProtected } from '../../ts-types/base-table';\nimport { getCellCornerRadius, getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { createCheckboxCellGroup } from './cell-type/checkbox-cell';\n// import type { PivotLayoutMap } from '../../layout/pivot-layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { resizeCellGroup } from './column-helper';\nimport { getHierarchyOffset } from '../utils/get-hierarchy-offset';\nimport { getQuadProps } from '../utils/padding';\nimport { convertInternal } from '../../tools/util';\n\nexport function createCell(\n type: ColumnTypeOption,\n value: string,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n colWidth: number,\n cellWidth: number,\n cellHeight: number,\n columnGroup: Group,\n y: number,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n cellTheme: IThemeSpec\n): Group {\n if (isPromise(value)) {\n value = table.getCellValue(col, row);\n }\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n let cellGroup: Group;\n if (type === 'text' || type === 'link') {\n if (type === 'link') {\n //如果是超链接 颜色按照linkColor绘制 TODO:放到方法_getCellStyle中\n // const columnDefine = table.getHeaderDefine(col, row);\n const cellValue = value;\n const headerStyle = table._getCellStyle(col, row);\n\n if (\n type === 'link' &&\n (('templateLink' in define && define.templateLink) ||\n !('linkDetect' in define && define.linkDetect) ||\n regUrl.test(cellValue))\n ) {\n if (cellTheme) {\n cellTheme.text.fill = getProp('linkColor', headerStyle, col, row, table);\n (cellTheme as any).group.cursor = 'pointer';\n } else {\n cellTheme = {\n text: {\n fill: getProp('linkColor', headerStyle, col, row, table)\n },\n group: {\n cursor: 'pointer' as Cursor\n }\n };\n }\n }\n }\n // 判断是否有mapping 遍历dataset中mappingRules 但这里还需要根据fieldName来判断\n if (bgColorFunc) {\n const cellValue = table.getCellOriginValue(col, row);\n const bgColor = bgColorFunc(table, cellValue);\n if (bgColor) {\n if (cellTheme) {\n cellTheme.group.fill = bgColor;\n } else {\n cellTheme = {\n group: {\n fill: bgColor\n }\n };\n }\n }\n }\n\n let customElementsGroup;\n let renderDefault = true;\n let customRender;\n let customLayout;\n const cellLocation = table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n\n if (customLayout || customRender) {\n // const { autoRowHeight } = table.internalProps;\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cellWidth,\n cellHeight,\n false,\n table.heightMode === 'autoHeight',\n padding,\n table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n cellGroup = createCellGroup(\n table,\n value,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n customElementsGroup,\n renderDefault,\n cellTheme\n );\n\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n if (axisConfig) {\n const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, table);\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n } else if (table.internalProps.layoutMap.isEmpty(col, row)) {\n cellGroup.setAttributes({\n fill: false,\n stroke: false\n });\n cellGroup.clear();\n } else if (table.internalProps.layoutMap.isAxisCell(col, row)) {\n cellGroup.clear();\n }\n\n // if ((define as any)?.isAxis && cellLocation === 'columnHeader') {\n // cellGroup.setAttribute('clip', false);\n // const axis = new CartesianAxis(\n // {\n // orient: 'top',\n // type: 'band',\n // data: ['A', 'B', 'C'],\n // title: {\n // visible: true,\n // text: 'X Axis'\n // }\n // },\n // cellGroup.attribute.width,\n // cellGroup.attribute.height,\n // table\n // );\n // cellGroup.clear();\n // // axis.component.setAttribute('y', 40);\n // cellGroup.appendChild(axis.component);\n // } else if ((define as any)?.isAxis && cellLocation === 'rowHeader') {\n // cellGroup.setAttribute('clip', false);\n // const axis = new CartesianAxis(\n // {\n // orient: 'left',\n // type: 'linear',\n // range: { min: 0, max: 30 },\n // label: {\n // flush: true\n // },\n // grid: {\n // visible: true\n // },\n // title: {\n // visible: true,\n // text: 'Y Axis'\n // }\n // },\n // cellGroup.attribute.width,\n // cellGroup.attribute.height,\n // table\n // );\n // cellGroup.clear();\n // // axis.component.setAttribute('x', 80);\n // cellGroup.appendChild(axis.component);\n // axis.overlap();\n // }\n } else if (type === 'image') {\n // 创建图片单元格\n cellGroup = createImageCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'video') {\n // 创建视频单元格\n cellGroup = createVideoCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'chart') {\n const chartInstance = table.internalProps.layoutMap.getChartInstance(col, row);\n cellGroup = createChartCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n padding,\n value,\n (define as ChartColumnDefine).chartModule,\n table.isPivotChart()\n ? (table.internalProps.layoutMap as PivotHeaderLayoutMap).getChartSpec(col, row)\n : (define as ChartColumnDefine).chartSpec,\n chartInstance,\n (table.internalProps.layoutMap as PivotHeaderLayoutMap)?.getChartDataId(col, row) ?? 'data',\n table,\n cellTheme\n );\n } else if (type === 'progressbar') {\n const style = table._getCellStyle(col, row) as ProgressBarStyle;\n const dataValue = table.getCellOriginValue(col, row);\n // 创建基础文字单元格\n cellGroup = createCellGroup(\n table,\n value,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n false,\n null,\n true,\n cellTheme\n );\n\n // 创建bar group\n const progressBarGroup = createProgressBarCell(\n define as ProgressbarColumnDefine,\n style,\n colWidth,\n value,\n dataValue,\n col,\n row,\n padding,\n table\n );\n // 进度图插入到文字前,绘制在文字下\n if (cellGroup.firstChild) {\n cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild);\n } else {\n cellGroup.appendChild(progressBarGroup);\n }\n } else if (type === 'sparkline') {\n cellGroup = createSparkLineCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n padding,\n table,\n cellTheme\n );\n } else if (type === 'checkbox') {\n cellGroup = createCheckboxCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme,\n define as CheckboxColumnDefine\n );\n }\n\n return cellGroup;\n}\n\nexport function updateCell(col: number, row: number, table: BaseTableAPI, addNew?: boolean) {\n // const oldCellGroup = table.scenegraph.getCell(col, row, true);\n const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);\n const cellStyle = table._getCellStyle(col, row);\n const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;\n const cellLocation = table.getCellLocation(col, row);\n const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n\n let isMerge;\n let range;\n if (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell || table.internalProps.customMergeCell) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n }\n\n let cellTheme = getStyleTheme(\n cellStyle,\n table,\n isMerge ? range.start.col : col,\n isMerge ? range.start.row : row,\n getProp\n ).theme;\n\n cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);\n\n // fast method for text\n if (!addNew && !isMerge && canUseFastUpdate(col, row, oldCellGroup, autoWrapText, table)) {\n // update group\n const cellWidth = table.getColWidth(col);\n const cellHeight = table.getRowHeight(row);\n oldCellGroup.setAttributes({\n width: cellWidth,\n height: cellHeight,\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n cornerRadius: cellTheme?.group?.cornerRadius ?? 0,\n\n y: table.scenegraph.getCellGroupY(row)\n } as any);\n\n // update text\n const textMark = oldCellGroup.getChildByName('text');\n if (textMark) {\n const text = table.getCellValue(col, row);\n const textArr = convertInternal(text).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n const hierarchyOffset = getHierarchyOffset(col, row, table);\n const lineClamp = cellStyle.lineClamp;\n const padding = getQuadProps(getProp('padding', cellStyle, col, row, table)) ?? [0, 0, 0, 0];\n\n const textAlign = cellTheme.text.textAlign;\n let x = 0;\n if (textAlign === 'center') {\n x = padding[3] + (cellWidth - (padding[1] + padding[3])) / 2;\n } else if (textAlign === 'right') {\n x = padding[3] + cellWidth - (padding[1] + padding[3]);\n } else {\n x = padding[3];\n }\n\n const attribute = {\n text: textArr.length === 1 && !autoWrapText ? textArr[0] : textArr, // 单行(no-autoWrapText)为字符串,多行(autoWrapText)为字符串数组\n maxLineWidth: cellWidth - (padding[1] + padding[3] + hierarchyOffset),\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: cellHeight - (padding[0] + padding[2]),\n pickable: false,\n dx: hierarchyOffset,\n x\n };\n const oldText = textMark.attribute.text;\n textMark.setAttributes(cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute);\n if (!oldText && textMark.attribute.text) {\n const textBaseline = cellTheme.text.textBaseline;\n const height = cellHeight - (padding[0] + padding[2]);\n let y = 0;\n if (textBaseline === 'middle') {\n y = padding[0] + (height - textMark.AABBBounds.height()) / 2;\n } else if (textBaseline === 'bottom') {\n y = padding[0] + height - textMark.AABBBounds.height();\n } else {\n y = padding[0];\n }\n textMark.setAttributes({\n y\n });\n }\n }\n return oldCellGroup;\n }\n\n if (!addNew && oldCellGroup.role === 'empty') {\n return undefined;\n }\n\n const type = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row).headerType\n : table.getBodyColumnType(col, row);\n let value = table.getCellValue(col, row);\n\n let customStyle;\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;\n range = customMergeRange;\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n value = customMergeText;\n customStyle = customMergeStyle;\n if (customStyle) {\n cellTheme = getStyleTheme(customStyle, table, range.start.col, range.start.row, getProp).theme;\n cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);\n }\n }\n }\n\n let newCellGroup;\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n const padding = cellTheme._vtable.padding;\n const textAlign = cellTheme._vtable.textAlign;\n const textBaseline = cellTheme._vtable.textBaseline;\n\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n\n let customRender;\n let customLayout;\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n\n let cellWidth;\n let cellHeight;\n if (range) {\n cellWidth = table.getColsWidth(range.start.col, range.end.col);\n cellHeight = table.getRowsHeight(range.start.row, range.end.row);\n } else {\n cellWidth = table.getColWidth(col);\n cellHeight = table.getRowHeight(row);\n }\n\n // deal with promise data\n if (isPromise(value)) {\n // clear cell content sync\n oldCellGroup.removeAllChild();\n\n // update cell content async\n dealPromiseData(\n value,\n table,\n updateCellContent.bind(\n null,\n type,\n value,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n addNew,\n cellTheme\n )\n );\n } else {\n newCellGroup = updateCellContent(\n type,\n value,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n addNew,\n cellTheme\n );\n }\n\n if (isMerge) {\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n const { width: contentWidth } = newCellGroup.attribute;\n const { height: contentHeight } = newCellGroup.attribute;\n newCellGroup.contentWidth = contentWidth;\n newCellGroup.contentHeight = contentHeight;\n\n resizeCellGroup(newCellGroup, rangeWidth, rangeHeight, range, table);\n }\n\n return newCellGroup;\n}\n\nfunction updateCellContent(\n type: ColumnTypeOption,\n value: string,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n bgColorFunc: Function,\n cellWidth: number,\n cellHeight: number,\n oldCellGroup: Group,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n addNew: boolean,\n cellTheme?: IThemeSpec\n) {\n if (isPromise(value)) {\n value = table.getCellValue(col, row);\n }\n //解决报错 getCellByCache递归调用 死循环问题\n if (!addNew && (oldCellGroup.row !== row || oldCellGroup.col !== col)) {\n return null;\n }\n const newCellGroup = createCell(\n type,\n value,\n define,\n table,\n col,\n row,\n table.getColWidth(col),\n cellWidth,\n cellHeight,\n // oldCellGroup.parent,\n addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent,\n // oldCellGroup.attribute.y,\n addNew ? 0 : table.scenegraph.getCellGroupY(row), // y\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme\n );\n if (!addNew && oldCellGroup.parent) {\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n // update cache\n if (table.scenegraph?.proxy.cellCache.get(col)) {\n table.scenegraph?.proxy.cellCache.set(col, newCellGroup);\n }\n }\n return newCellGroup;\n}\n\nfunction canUseFastUpdate(col: number, row: number, oldCellGroup: Group, autoWrapText: boolean, table: BaseTableAPI) {\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = !!define?.icon || !!define?.tree;\n const cellType = table.getBodyColumnType(col, row);\n const autoRowHeight = table.heightMode === 'autoHeight';\n const value = table.getCellValue(col, row);\n\n if (\n !table.isHeader(col, row) &&\n oldCellGroup.role === 'cell' &&\n cellType === 'text' &&\n !autoWrapText &&\n !autoRowHeight &&\n !mayHaveIcon &&\n oldCellGroup.firstChild?.type === 'text' &&\n !isPromise(value)\n ) {\n return true;\n }\n return false;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/group-creater/cell-helper.ts"],"names":[],"mappings":";;;AAEA,+CAA4C;AAa5C,gDAAqD;AAErD,gDAA4C;AAC5C,uDAA8D;AAC9D,uDAA8D;AAC9D,qEAAsE;AACtE,iEAAuE;AACvE,qDAAwD;AACxD,uDAA8D;AAG9D,wDAA4E;AAC5E,+CAA+C;AAC/C,kEAA6D;AAC7D,qDAA2D;AAC3D,6DAAoE;AAGpE,mDAAkD;AAClD,wEAAmE;AACnE,8CAAgD;AAChD,2CAAmD;AAEnD,SAAgB,UAAU,CACxB,IAAsB,EACtB,KAAa,EACb,MAAoB,EACpB,KAAmB,EACnB,GAAW,EACX,GAAW,EACX,QAAgB,EAChB,SAAiB,EACjB,UAAkB,EAClB,WAAkB,EAClB,CAAS,EACT,OAAyC,EACzC,SAA0B,EAC1B,YAAgC,EAChC,WAAoB,EACpB,SAAqB,EACrB,KAA4B,EAC5B,YAGC;;IAED,IAAI,IAAA,kBAAS,EAAC,KAAK,CAAC,EAAE;QACpB,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;KACtC;IACD,IAAI,WAAqB,CAAC;IAE1B,IAAI,CAAA,MAAA,MAAC,KAAK,CAAC,aAAqC,0CAAE,UAAU,0CAAE,YAAY,KAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;QACvG,MAAA,MAAA,MAAC,KAAK,CAAC,aAAqC,0CAAE,UAAU,0CAAE,YAAY,0CAAE,OAAO,CAC7E,CAAC,WAAwB,EAAE,CAAS,EAAE,EAAE;YACtC,IACE,WAAW,CAAC,OAAO;gBAClB,KAAK,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AC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;SAC1D;KACF;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAW,EAAE,GAAW,EAAE,YAAmB,EAAE,YAAqB,EAAE,KAAmB;;IACjH,MAAM,MAAM,GAAG,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,WAAW,GAAG,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA,IAAI,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA,CAAC;IACrD,MAAM,QAAQ,GAAG,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,KAAK,YAAY,CAAC;IACxD,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE3C,IACE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;QACzB,YAAY,CAAC,IAAI,KAAK,MAAM;QAC5B,QAAQ,KAAK,MAAM;QACnB,CAAC,YAAY;QACb,CAAC,aAAa;QACd,CAAC,WAAW;QACZ,CAAA,MAAA,YAAY,CAAC,UAAU,0CAAE,IAAI,MAAK,MAAM;QACxC,CAAC,IAAA,kBAAS,EAAC,KAAK,CAAC,EACjB;QACA,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"cell-helper.js","sourcesContent":["import type { Cursor, IThemeSpec, Group as VGroup } from './../../vrender';\nimport type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport { regUrl } from '../../tools/global';\nimport type {\n CellRange,\n ChartColumnDefine,\n CheckboxColumnDefine,\n ColumnDefine,\n ColumnTypeOption,\n ICustomRender,\n ImageColumnDefine,\n MappingRule,\n ProgressbarColumnDefine,\n TextColumnDefine\n} from '../../ts-types';\nimport { dealWithCustom } from '../component/custom';\nimport type { Group } from '../graphic/group';\nimport { getProp } from '../utils/get-prop';\nimport { createChartCellGroup } from './cell-type/chart-cell';\nimport { createImageCellGroup } from './cell-type/image-cell';\nimport { createProgressBarCell } from './cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from './cell-type/spark-line-cell';\nimport { createCellGroup } from './cell-type/text-cell';\nimport { createVideoCellGroup } from './cell-type/video-cell';\nimport type { ICustomLayoutFuc } from '../../ts-types/customLayout';\nimport type { BaseTableAPI, PivotTableProtected } from '../../ts-types/base-table';\nimport { getCellCornerRadius, getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { CartesianAxis } from '../../components/axis/axis';\nimport { createCheckboxCellGroup } from './cell-type/checkbox-cell';\n// import type { PivotLayoutMap } from '../../layout/pivot-layout';\nimport type { PivotHeaderLayoutMap } from '../../layout/pivot-header-layout';\nimport { resizeCellGroup } from './column-helper';\nimport { getHierarchyOffset } from '../utils/get-hierarchy-offset';\nimport { getQuadProps } from '../utils/padding';\nimport { convertInternal } from '../../tools/util';\n\nexport function createCell(\n type: ColumnTypeOption,\n value: string,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n colWidth: number,\n cellWidth: number,\n cellHeight: number,\n columnGroup: Group,\n y: number,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n cellTheme: IThemeSpec,\n range: CellRange | undefined,\n customResult?: {\n elementsGroup: VGroup;\n renderDefault: boolean;\n }\n): Group {\n if (isPromise(value)) {\n value = table.getCellValue(col, row);\n }\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n let cellGroup: Group;\n if (type === 'text' || type === 'link') {\n if (type === 'link') {\n //如果是超链接 颜色按照linkColor绘制 TODO:放到方法_getCellStyle中\n // const columnDefine = table.getHeaderDefine(col, row);\n const cellValue = value;\n const headerStyle = table._getCellStyle(col, row);\n\n if (\n type === 'link' &&\n (('templateLink' in define && define.templateLink) ||\n !('linkDetect' in define && define.linkDetect) ||\n regUrl.test(cellValue))\n ) {\n if (cellTheme) {\n cellTheme.text.fill = getProp('linkColor', headerStyle, col, row, table);\n (cellTheme as any).group.cursor = 'pointer';\n } else {\n cellTheme = {\n text: {\n fill: getProp('linkColor', headerStyle, col, row, table)\n },\n group: {\n cursor: 'pointer' as Cursor\n }\n };\n }\n }\n }\n // 判断是否有mapping 遍历dataset中mappingRules 但这里还需要根据fieldName来判断\n if (bgColorFunc) {\n const cellValue = table.getCellOriginValue(col, row);\n const bgColor = bgColorFunc(table, cellValue);\n if (bgColor) {\n if (cellTheme) {\n cellTheme.group.fill = bgColor;\n } else {\n cellTheme = {\n group: {\n fill: bgColor\n }\n };\n }\n }\n }\n\n let customElementsGroup;\n let renderDefault = true;\n if (customResult) {\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n } else {\n let customRender;\n let customLayout;\n const cellLocation = table.getCellLocation(col, row);\n if (cellLocation !== 'body') {\n customRender = define?.headerCustomRender;\n customLayout = define?.headerCustomLayout;\n } else {\n customRender = define?.customRender || table.customRender;\n customLayout = define?.customLayout;\n }\n if (customLayout || customRender) {\n const customResult = dealWithCustom(\n customLayout,\n customRender,\n col,\n row,\n cellWidth,\n cellHeight,\n false,\n table.heightMode === 'autoHeight',\n padding,\n table\n );\n customElementsGroup = customResult.elementsGroup;\n renderDefault = customResult.renderDefault;\n }\n }\n\n cellGroup = createCellGroup(\n table,\n value,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n customElementsGroup,\n renderDefault,\n cellTheme,\n range\n );\n\n const axisConfig = table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);\n if (axisConfig) {\n const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, padding, table);\n cellGroup.clear();\n cellGroup.appendChild(axis.component);\n axis.overlap();\n } else if (table.internalProps.layoutMap.isEmpty(col, row)) {\n cellGroup.setAttributes({\n fill: false,\n stroke: false\n });\n cellGroup.clear();\n } else if (table.internalProps.layoutMap.isAxisCell(col, row)) {\n cellGroup.clear();\n }\n } else if (type === 'image') {\n // 创建图片单元格\n cellGroup = createImageCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'video') {\n // 创建视频单元格\n cellGroup = createVideoCellGroup(\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n (define as ImageColumnDefine).keepAspectRatio,\n (define as ImageColumnDefine).imageAutoSizing,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme\n );\n } else if (type === 'chart') {\n const chartInstance = table.internalProps.layoutMap.getChartInstance(col, row);\n cellGroup = createChartCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n padding,\n value,\n (define as ChartColumnDefine).chartModule,\n table.isPivotChart()\n ? (table.internalProps.layoutMap as PivotHeaderLayoutMap).getChartSpec(col, row)\n : (define as ChartColumnDefine).chartSpec,\n chartInstance,\n (table.internalProps.layoutMap as PivotHeaderLayoutMap)?.getChartDataId(col, row) ?? 'data',\n table,\n cellTheme\n );\n } else if (type === 'progressbar') {\n const style = table._getCellStyle(col, row) as ProgressBarStyle;\n const dataValue = table.getCellOriginValue(col, row);\n // 创建基础文字单元格\n cellGroup = createCellGroup(\n table,\n value,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n false,\n null,\n true,\n cellTheme,\n range\n );\n\n // 创建bar group\n const progressBarGroup = createProgressBarCell(\n define as ProgressbarColumnDefine,\n style,\n colWidth,\n value,\n dataValue,\n col,\n row,\n padding,\n table\n );\n // 进度图插入到文字前,绘制在文字下\n if (cellGroup.firstChild) {\n cellGroup.insertBefore(progressBarGroup, cellGroup.firstChild);\n } else {\n cellGroup.appendChild(progressBarGroup);\n }\n } else if (type === 'sparkline') {\n cellGroup = createSparkLineCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n cellWidth,\n cellHeight,\n padding,\n table,\n cellTheme\n );\n } else if (type === 'checkbox') {\n cellGroup = createCheckboxCellGroup(\n null,\n columnGroup,\n 0,\n y,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n padding,\n textAlign,\n textBaseline,\n table,\n cellTheme,\n define as CheckboxColumnDefine\n );\n }\n\n return cellGroup;\n}\n\nexport function updateCell(col: number, row: number, table: BaseTableAPI, addNew?: boolean) {\n // const oldCellGroup = table.scenegraph.getCell(col, row, true);\n const oldCellGroup = table.scenegraph.highPerformanceGetCell(col, row, true);\n const cellStyle = table._getCellStyle(col, row);\n const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;\n const cellLocation = table.getCellLocation(col, row);\n let value = table.getCellValue(col, row);\n\n let isMerge;\n let range;\n let cellTheme;\n let customStyle;\n let customResult;\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n const {\n range: customMergeRange,\n text: customMergeText,\n style: customMergeStyle,\n customLayout,\n customRender\n } = customMerge;\n range = customMergeRange;\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n value = customMergeText;\n customStyle = customMergeStyle;\n if (customStyle) {\n cellTheme = getStyleTheme(customStyle, table, range.start.col, range.start.row, getProp).theme;\n cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);\n }\n\n if (customLayout || customRender) {\n customResult = dealWithCustom(\n customLayout,\n customRender,\n customMergeRange.start.col,\n customMergeRange.start.row,\n table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col),\n table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row),\n false,\n table.heightMode === 'autoHeight',\n [0, 0, 0, 0],\n table\n );\n }\n }\n }\n\n // const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n let colForDefine = col;\n let rowForDefine = row;\n if (range) {\n colForDefine = range.start.col;\n rowForDefine = range.start.row;\n }\n const define =\n cellLocation !== 'body'\n ? table.getHeaderDefine(colForDefine, rowForDefine)\n : table.getBodyColumnDefine(colForDefine, rowForDefine);\n\n if (!range && (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell)) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n }\n\n if (!cellTheme) {\n cellTheme = getStyleTheme(\n cellStyle,\n table,\n isMerge ? range.start.col : col,\n isMerge ? range.start.row : row,\n getProp\n ).theme;\n }\n cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);\n\n // fast method for text\n if (!addNew && !isMerge && canUseFastUpdate(col, row, oldCellGroup, autoWrapText, table)) {\n // update group\n const cellWidth = table.getColWidth(col);\n const cellHeight = table.getRowHeight(row);\n oldCellGroup.setAttributes({\n width: cellWidth,\n height: cellHeight,\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n cornerRadius: cellTheme?.group?.cornerRadius ?? 0,\n\n y: table.scenegraph.getCellGroupY(row)\n } as any);\n\n // update text\n const textMark = oldCellGroup.getChildByName('text');\n if (textMark) {\n const text = table.getCellValue(col, row);\n const textArr = convertInternal(text).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n const hierarchyOffset = getHierarchyOffset(col, row, table);\n const lineClamp = cellStyle.lineClamp;\n const padding = getQuadProps(getProp('padding', cellStyle, col, row, table)) ?? [0, 0, 0, 0];\n\n const textAlign = cellTheme.text.textAlign;\n let x = 0;\n if (textAlign === 'center') {\n x = padding[3] + (cellWidth - (padding[1] + padding[3])) / 2;\n } else if (textAlign === 'right') {\n x = padding[3] + cellWidth - (padding[1] + padding[3]);\n } else {\n x = padding[3];\n }\n\n const attribute = {\n text: textArr.length === 1 && !autoWrapText ? textArr[0] : textArr, // 单行(no-autoWrapText)为字符串,多行(autoWrapText)为字符串数组\n maxLineWidth: cellWidth - (padding[1] + padding[3] + hierarchyOffset),\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: cellHeight - (padding[0] + padding[2]),\n pickable: false,\n dx: hierarchyOffset,\n x\n };\n const oldText = textMark.attribute.text;\n textMark.setAttributes(cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute);\n if (!oldText && textMark.attribute.text) {\n const textBaseline = cellTheme.text.textBaseline;\n const height = cellHeight - (padding[0] + padding[2]);\n let y = 0;\n if (textBaseline === 'middle') {\n y = padding[0] + (height - textMark.AABBBounds.height()) / 2;\n } else if (textBaseline === 'bottom') {\n y = padding[0] + height - textMark.AABBBounds.height();\n } else {\n y = padding[0];\n }\n textMark.setAttributes({\n y\n });\n }\n }\n return oldCellGroup;\n }\n\n if (!addNew && oldCellGroup.role === 'empty') {\n return undefined;\n }\n\n const type = table.isHeader(col, row)\n ? table._getHeaderLayoutMap(col, row).headerType\n : table.getBodyColumnType(col, row);\n\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n const padding = cellTheme._vtable.padding;\n const textAlign = cellTheme._vtable.textAlign;\n const textBaseline = cellTheme._vtable.textBaseline;\n\n let newCellGroup;\n let bgColorFunc: Function;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n }\n\n let cellWidth;\n let cellHeight;\n if (range) {\n cellWidth = table.getColsWidth(range.start.col, range.end.col);\n cellHeight = table.getRowsHeight(range.start.row, range.end.row);\n } else {\n cellWidth = table.getColWidth(col);\n cellHeight = table.getRowHeight(row);\n }\n\n // deal with promise data\n if (isPromise(value)) {\n // clear cell content sync\n oldCellGroup.removeAllChild();\n\n // update cell content async\n dealPromiseData(\n value,\n table,\n updateCellContent.bind(\n null,\n type,\n value,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n addNew,\n cellTheme,\n range,\n customResult\n )\n );\n } else {\n newCellGroup = updateCellContent(\n type,\n value,\n define,\n table,\n col,\n row,\n bgColorFunc,\n cellWidth,\n cellHeight,\n oldCellGroup,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n addNew,\n cellTheme,\n range,\n customResult\n );\n }\n\n if (isMerge) {\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n const { width: contentWidth } = newCellGroup.attribute;\n const { height: contentHeight } = newCellGroup.attribute;\n newCellGroup.contentWidth = contentWidth;\n newCellGroup.contentHeight = contentHeight;\n\n resizeCellGroup(newCellGroup, rangeWidth, rangeHeight, range, table);\n }\n\n return newCellGroup;\n}\n\nfunction updateCellContent(\n type: ColumnTypeOption,\n value: string,\n define: ColumnDefine,\n table: BaseTableAPI,\n col: number,\n row: number,\n bgColorFunc: Function,\n cellWidth: number,\n cellHeight: number,\n oldCellGroup: Group,\n padding: [number, number, number, number],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n addNew: boolean,\n cellTheme: IThemeSpec,\n range: CellRange | undefined,\n customResult?: {\n elementsGroup: VGroup;\n renderDefault: boolean;\n }\n) {\n if (isPromise(value)) {\n value = table.getCellValue(col, row);\n }\n //解决报错 getCellByCache递归调用 死循环问题\n if (!addNew && (oldCellGroup.row !== row || oldCellGroup.col !== col)) {\n return null;\n }\n const newCellGroup = createCell(\n type,\n value,\n define,\n table,\n col,\n row,\n table.getColWidth(col),\n cellWidth,\n cellHeight,\n // oldCellGroup.parent,\n addNew ? table.scenegraph.getColGroup(col) : oldCellGroup.parent,\n // oldCellGroup.attribute.y,\n addNew ? 0 : table.scenegraph.getCellGroupY(row), // y\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme,\n range,\n customResult\n );\n if (!addNew && oldCellGroup.parent) {\n oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);\n oldCellGroup.parent.removeChild(oldCellGroup);\n\n // update cache\n if (table.scenegraph?.proxy.cellCache.get(col)) {\n table.scenegraph?.proxy.cellCache.set(col, newCellGroup);\n }\n }\n return newCellGroup;\n}\n\nfunction canUseFastUpdate(col: number, row: number, oldCellGroup: Group, autoWrapText: boolean, table: BaseTableAPI) {\n const define = table.getBodyColumnDefine(col, row);\n const mayHaveIcon = !!define?.icon || !!define?.tree;\n const cellType = table.getBodyColumnType(col, row);\n const autoRowHeight = table.heightMode === 'autoHeight';\n const value = table.getCellValue(col, row);\n\n if (\n !table.isHeader(col, row) &&\n oldCellGroup.role === 'cell' &&\n cellType === 'text' &&\n !autoWrapText &&\n !autoRowHeight &&\n !mayHaveIcon &&\n oldCellGroup.firstChild?.type === 'text' &&\n !isPromise(value)\n ) {\n return true;\n }\n return false;\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IThemeSpec, Group as VGroup } from './../../../vrender';
|
|
2
2
|
import { Group } from '../../graphic/group';
|
|
3
3
|
import type { BaseTableAPI } from '../../../ts-types/base-table';
|
|
4
|
-
|
|
4
|
+
import type { CellRange } from '../../../ts-types';
|
|
5
|
+
export declare function createCellGroup(table: BaseTableAPI, value: string, columnGroup: Group, xOrigin: number, yOrigin: number, col: number, row: number, colWidth: number | 'auto', cellWidth: number, cellHeight: number, padding: number[], textAlign: CanvasTextAlign, textBaseline: CanvasTextBaseline, mayHaveIcon: boolean, customElementsGroup: VGroup, renderDefault: boolean, cellTheme: IThemeSpec, range: CellRange | undefined): Group;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
|
|
7
7
|
const vrender_1 = require("./../../../vrender"), vutils_1 = require("@visactor/vutils"), group_1 = require("../../graphic/group"), get_prop_1 = require("../../utils/get-prop"), text_icon_layout_1 = require("../../utils/text-icon-layout");
|
|
8
8
|
|
|
9
|
-
function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme) {
|
|
9
|
+
function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, customElementsGroup, renderDefault, cellTheme, range) {
|
|
10
10
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
11
11
|
const headerStyle = table._getCellStyle(col, row), functionalPadding = (0, get_prop_1.getFunctionalProp)("padding", headerStyle, col, row, table);
|
|
12
12
|
(0, vutils_1.isValid)(functionalPadding) && (padding = functionalPadding), (null === (_a = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _a ? void 0 : _a.textAlign) && (textAlign = null === (_b = null == cellTheme ? void 0 : cellTheme.text) || void 0 === _b ? void 0 : _b.textAlign),
|
|
@@ -30,7 +30,11 @@ function createCellGroup(table, value, columnGroup, xOrigin, yOrigin, col, row,
|
|
|
30
30
|
customElementsGroup && cellGroup.appendChild(customElementsGroup), renderDefault) {
|
|
31
31
|
const textStr = value;
|
|
32
32
|
let icons;
|
|
33
|
-
if (mayHaveIcon
|
|
33
|
+
if (mayHaveIcon) {
|
|
34
|
+
let iconCol = col, iconRow = row;
|
|
35
|
+
range && (iconCol = range.start.col, iconRow = range.start.row), icons = table.getCellIcons(iconCol, iconRow);
|
|
36
|
+
}
|
|
37
|
+
if ((0, text_icon_layout_1.createCellContent)(cellGroup, icons, textStr, padding, autoColWidth, autoRowHeight, autoWrapText, "number" == typeof lineClamp ? lineClamp : void 0, cellWidth, cellHeight, textAlign, textBaseline, table, cellTheme, range),
|
|
34
38
|
null === (_t = null == cellTheme ? void 0 : cellTheme._vtable) || void 0 === _t ? void 0 : _t.marked) {
|
|
35
39
|
const mark = (0, vrender_1.createArc)({
|
|
36
40
|
x: cellGroup.attribute.width,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/group-creater/cell-type/text-cell.ts"],"names":[],"mappings":";;;AAEA,gDAA+C;AAC/C,6CAA2C;AAC3C,+CAA4C;AAE5C,mDAAyD;AACzD,mEAAiE;
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/group-creater/cell-type/text-cell.ts"],"names":[],"mappings":";;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C,CAAC;YACpF,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAA,mBAAmB,CAAC,SAAS,CAAC,MAAM,mCAAI,CAAC,CAAC;SACxF,CAAC,CAAC;KACJ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAvHD,0CAuHC","file":"text-cell.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IThemeSpec, Group as VGroup } from './../../../vrender';\nimport { createArc } from './../../../vrender';\nimport { isValid } from '@visactor/vutils';\nimport { Group } from '../../graphic/group';\n// import { parseFont } from '../../utils/font';\nimport { getFunctionalProp } from '../../utils/get-prop';\nimport { createCellContent } from '../../utils/text-icon-layout';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { getStyleTheme } from '../../../core/tableHelper';\nimport type { CellRange } from '../../../ts-types';\n\n/**\n * @description: 创建单元格场景节点\n * @param {Group} columnGroup 列Group\n * @param {number} xOrigin 起始x坐标\n * @param {number} yOrigin 起始y坐标\n * @param {number} col\n * @param {number} row\n * @param {BaseTableAPI} table\n * @param {number | 'auto'} colWidth 配置列宽\n * @param {number} padding 单元格padding\n * @param {CanvasTextAlign} textAlign\n * @param {CanvasTextBaseline} textBaseline\n * @param {boolean} noWrap 不进行折行(default column type)\n * @param {IThemeSpec} cellTheme 单元格主题\n * @return {Group}\n */\nexport function createCellGroup(\n table: BaseTableAPI,\n value: string,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n // rowHeight: number,\n colWidth: number | 'auto',\n cellWidth: number,\n cellHeight: number,\n padding: number[],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n mayHaveIcon: boolean,\n customElementsGroup: VGroup,\n renderDefault: boolean,\n cellTheme: IThemeSpec,\n range: CellRange | undefined\n): Group {\n const headerStyle = table._getCellStyle(col, row); // to be fixed\n const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);\n if (isValid(functionalPadding)) {\n padding = functionalPadding;\n }\n if (cellTheme?.text?.textAlign) {\n textAlign = cellTheme?.text?.textAlign;\n }\n if (cellTheme?.text?.textBaseline) {\n textBaseline = cellTheme?.text?.textBaseline;\n }\n const autoRowHeight = table.heightMode === 'autoHeight';\n const autoColWidth = colWidth === 'auto';\n const autoWrapText = headerStyle.autoWrapText ?? table.internalProps.autoWrapText;\n const lineClamp = headerStyle.lineClamp;\n\n // cell\n const cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width: cellWidth,\n height: cellHeight,\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true,\n\n cornerRadius: cellTheme.group.cornerRadius\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n if (customElementsGroup) {\n cellGroup.appendChild(customElementsGroup);\n }\n if (renderDefault) {\n const textStr: string = value;\n let icons;\n if (mayHaveIcon) {\n let iconCol = col;\n let iconRow = row;\n if (range) {\n iconCol = range.start.col;\n iconRow = range.start.row;\n }\n icons = table.getCellIcons(iconCol, iconRow);\n }\n\n createCellContent(\n cellGroup,\n icons,\n textStr,\n padding as any,\n autoColWidth,\n autoRowHeight,\n autoWrapText,\n typeof lineClamp === 'number' ? lineClamp : undefined,\n // autoColWidth ? 0 : colWidth,\n // table.getRowHeight(row),\n cellWidth,\n cellHeight,\n textAlign,\n textBaseline,\n table,\n cellTheme,\n range\n );\n\n if ((cellTheme as any)?._vtable?.marked) {\n const mark = createArc({\n x: cellGroup.attribute.width,\n y: 0,\n startAngle: Math.PI / 2,\n endAngle: Math.PI,\n outerRadius: 6,\n fill: '#3073F2',\n pickable: false\n });\n mark.name = 'mark';\n\n cellGroup.appendChild(mark);\n }\n }\n if (customElementsGroup) {\n cellGroup.setAttributes({\n width: Math.max(cellGroup.attribute.width, customElementsGroup.attribute.width ?? 0),\n height: Math.max(cellGroup.attribute.height, customElementsGroup.attribute.height ?? 0)\n });\n }\n return cellGroup;\n}\n\n// /**\n// * @description: 获取函数式赋值的样式,记录在cellTheme中\n// * @param {BaseTableAPI} table\n// * @param {number} col\n// * @param {number} row\n// * @param {IThemeSpec} cellTheme\n// * @return {IThemeSpec | undefined}\n// */\n// export function getCellTheme(\n// table: BaseTableAPI,\n// col: number,\n// row: number,\n// cellTheme?: IThemeSpec\n// ): IThemeSpec | undefined {\n// // get column header style\n// const headerStyle = table._getCellStyle(col, row);\n\n// const theme = getStyleTheme(headerStyle, table, col, row, getFunctionalProp).theme;\n\n// for (const prop in theme.group) {\n// if (isValid(theme.group[prop])) {\n// if (!cellTheme) {\n// cellTheme = {};\n// }\n\n// if (!cellTheme.group) {\n// cellTheme.group = {};\n// }\n\n// cellTheme.group[prop] = theme.group[prop];\n// }\n// }\n\n// for (const prop in theme.text) {\n// if (isValid(theme.text[prop])) {\n// if (!cellTheme) {\n// cellTheme = {};\n// }\n\n// if (!cellTheme.text) {\n// cellTheme.text = {};\n// }\n\n// cellTheme.text[prop] = theme.text[prop];\n// }\n// }\n\n// for (const prop in theme._vtable) {\n// if (isValid(theme._vtable[prop])) {\n// if (!cellTheme) {\n// cellTheme = {};\n// }\n\n// if (!(cellTheme as any)._vtable) {\n// (cellTheme as any)._vtable = {};\n// }\n\n// (cellTheme as any)._vtable[prop] = theme._vtable[prop];\n// }\n// }\n// return cellTheme;\n// }\n"]}
|
|
@@ -4,26 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.resizeCellGroup = exports.getColumnGroupTheme = exports.createComplexColumn = void 0;
|
|
6
6
|
|
|
7
|
-
const get_prop_1 = require("../utils/get-prop"), cell_helper_1 = require("./cell-helper"), tableHelper_1 = require("../../core/tableHelper"), helper_1 = require("../../tools/helper"), deal_promise_data_1 = require("../utils/deal-promise-data"), vutils_1 = require("@visactor/vutils");
|
|
7
|
+
const get_prop_1 = require("../utils/get-prop"), cell_helper_1 = require("./cell-helper"), tableHelper_1 = require("../../core/tableHelper"), helper_1 = require("../../tools/helper"), deal_promise_data_1 = require("../utils/deal-promise-data"), vutils_1 = require("@visactor/vutils"), custom_1 = require("../component/custom");
|
|
8
8
|
|
|
9
9
|
function createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, mergeMap, defaultRowHeight, table, cellLocation, rowLimit) {
|
|
10
10
|
let padding, textAlign, textBaseline, y = 0;
|
|
11
11
|
columnGroup.lastChild && columnGroup.lastChild.row === rowStart - 1 ? y = columnGroup.lastChild.attribute.y + columnGroup.lastChild.attribute.height : columnGroup.colHeight && (y = columnGroup.colHeight);
|
|
12
12
|
for (let j = rowStart; j <= rowEnd; j++) {
|
|
13
|
-
const row = j
|
|
14
|
-
let range, isMerge, customStyle, value = table.getCellValue(col, row), cellWidth = colWidth, cellHeight = table.getRowHeight(row);
|
|
13
|
+
const row = j;
|
|
14
|
+
let range, isMerge, customStyle, customResult, value = table.getCellValue(col, row), cellWidth = colWidth, cellHeight = table.getRowHeight(row);
|
|
15
15
|
if (table.internalProps.customMergeCell) {
|
|
16
16
|
const customMerge = table.getCustomMerge(col, row);
|
|
17
17
|
if (customMerge) {
|
|
18
|
-
const {range: customMergeRange, text: customMergeText, style: customMergeStyle} = customMerge;
|
|
18
|
+
const {range: customMergeRange, text: customMergeText, style: customMergeStyle, customLayout: customLayout, customRender: customRender} = customMerge;
|
|
19
19
|
if (range = customMergeRange, isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row,
|
|
20
20
|
isMerge) {
|
|
21
21
|
const mergeSize = dealMerge(range, mergeMap, table);
|
|
22
22
|
cellWidth = mergeSize.cellWidth, cellHeight = mergeSize.cellHeight;
|
|
23
23
|
}
|
|
24
|
-
value = customMergeText, customStyle = customMergeStyle
|
|
24
|
+
value = customMergeText, customStyle = customMergeStyle, (customLayout || customRender) && (customResult = (0,
|
|
25
|
+
custom_1.dealWithCustom)(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), !1, "autoHeight" === table.heightMode, [ 0, 0, 0, 0 ], table));
|
|
25
26
|
}
|
|
26
27
|
}
|
|
28
|
+
let colForDefine = col, rowForDefine = row;
|
|
29
|
+
range && (colForDefine = range.start.col, rowForDefine = range.start.row);
|
|
30
|
+
const define = "body" !== cellLocation ? table.getHeaderDefine(colForDefine, rowForDefine) : table.getBodyColumnDefine(colForDefine, rowForDefine), mayHaveIcon = "body" !== cellLocation || (!!(null == define ? void 0 : define.icon) || !!(null == define ? void 0 : define.tree));
|
|
27
31
|
if (!range && ("body" !== cellLocation || (null == define ? void 0 : define.mergeCell)) && (range = table.getCellRange(col, row),
|
|
28
32
|
isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row,
|
|
29
33
|
isMerge)) {
|
|
@@ -38,12 +42,12 @@ function createComplexColumn(columnGroup, col, colWidth, rowStart, rowEnd, merge
|
|
|
38
42
|
cellTheme.text.textBaseline && (textBaseline = cellTheme.text.textBaseline), "body" === cellLocation || cellTheme.group.fill || (cellTheme.group.fill = "#fff");
|
|
39
43
|
const type = (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) || "text";
|
|
40
44
|
if ((0, helper_1.isPromise)(value)) {
|
|
41
|
-
(0, deal_promise_data_1.dealPromiseData)(value, table, cell_helper_1.createCell.bind(null, type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme)),
|
|
45
|
+
(0, deal_promise_data_1.dealPromiseData)(value, table, cell_helper_1.createCell.bind(null, type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult)),
|
|
42
46
|
columnGroup.updateColumnRowNumber(row);
|
|
43
47
|
const height = table.getRowHeight(row);
|
|
44
48
|
columnGroup.updateColumnHeight(height), y += height;
|
|
45
49
|
} else {
|
|
46
|
-
const cellGroup = (0, cell_helper_1.createCell)(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme);
|
|
50
|
+
const cellGroup = (0, cell_helper_1.createCell)(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult);
|
|
47
51
|
if (columnGroup.updateColumnRowNumber(row), isMerge) {
|
|
48
52
|
const rangeHeight = table.getRowHeight(row), rangeWidth = table.getColWidth(col), {width: contentWidth} = cellGroup.attribute, {height: contentHeight} = cellGroup.attribute;
|
|
49
53
|
cellGroup.contentWidth = contentWidth, cellGroup.contentHeight = contentHeight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/group-creater/column-helper.ts"],"names":[],"mappings":";;;AAIA,gDAAwD;AAExD,+CAA2C;AAE3C,wDAA4E;AAC5E,+CAA+C;AAC/C,kEAA6D;AAC7D,6CAA2C;AAiB3C,SAAgB,mBAAmB,CACjC,WAAkB,EAClB,GAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,MAAc,EACd,QAAkB,EAClB,gBAAmC,EACnC,KAAmB,EACnB,YAA0B,EAC1B,QAAiB;IAEjB,IAAI,OAAO,CAAC;IACZ,IAAI,SAAS,CAAC;IACd,IAAI,YAAY,CAAC;IAGjB,IAAI,CAAC,GAAG,CAAC,CAAC;IAKV,IAAI,WAAW,CAAC,SAAS,IAAK,WAAW,CAAC,SAAmB,CAAC,GAAG,KAAK,QAAQ,GAAG,CAAC,EAAE;QAClF,CAAC,GAAI,WAA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I,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC3D,SAAS,IAAI,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;SACrC;QAGD,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YACrD,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;SACrC;QAED,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE;YACtF,SAAS;YACT,UAAU;SACX,CAAC,CAAC;KACJ;SAAM;QACL,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;QAClC,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;KACrC;IACD,OAAO;QACL,SAAS;QACT,UAAU;KACX,CAAC;AACJ,CAAC","file":"column-helper.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IGraphic, IThemeSpec } from './../../vrender';\nimport type { CellLocation, CellRange, TextColumnDefine } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { getProp, getRawProp } from '../utils/get-prop';\nimport type { MergeMap } from '../scenegraph';\nimport { createCell } from './cell-helper';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { getCellCornerRadius, getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { isArray } from '@visactor/vutils';\n/**\n * 创建复合列 同一列支持创建不同类型单元格\n * @param columnGroup 列Group\n * @param col\n * @param colWidth 配置列宽\n * @param rowStart\n * @param rowEnd\n * @param mergeMap merge单元格信息\n * @param defaultRowHeight\n * @param table\n * @param cellLocation\n * @param rowLimit\n * @param customRender\n * @param customLayout\n * @returns\n */\nexport function createComplexColumn(\n columnGroup: Group,\n col: number,\n colWidth: number,\n rowStart: number,\n rowEnd: number,\n mergeMap: MergeMap,\n defaultRowHeight: number | number[],\n table: BaseTableAPI,\n cellLocation: CellLocation,\n rowLimit?: number\n) {\n let padding;\n let textAlign;\n let textBaseline;\n /** useColumnTheme 判断是否可以使用columnTheme */\n // insert cell into column group top\n let y = 0;\n // if (columnGroup.colHeight) {\n // // insert cell into column group bottom\n // y = columnGroup.colHeight;\n // }\n if (columnGroup.lastChild && (columnGroup.lastChild as Group).row === rowStart - 1) {\n y = (columnGroup.lastChild as Group).attribute.y + (columnGroup.lastChild as Group).attribute.height;\n } else if (columnGroup.colHeight) {\n y = columnGroup.colHeight;\n }\n\n for (let j = rowStart; j <= rowEnd; j++) {\n const row = j;\n const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n let value = table.getCellValue(col, row);\n\n // 处理单元格合并\n let cellWidth = colWidth;\n // let cellHeight = table.internalProps.autoRowHeight ? 0 : table.getRowHeight(row);\n let cellHeight = table.getRowHeight(row);\n let range;\n let isMerge;\n let customStyle;\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n const { range: customMergeRange, text: customMergeText, style: customMergeStyle } = customMerge;\n range = customMergeRange;\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n if (isMerge) {\n const mergeSize = dealMerge(range, mergeMap, table);\n cellWidth = mergeSize.cellWidth;\n cellHeight = mergeSize.cellHeight;\n }\n value = customMergeText;\n customStyle = customMergeStyle;\n }\n }\n if (!range && (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell)) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n // 所有Merge单元格,只保留左上角一个真实的单元格,其他使用空Group占位\n if (isMerge) {\n const mergeSize = dealMerge(range, mergeMap, table);\n cellWidth = mergeSize.cellWidth;\n cellHeight = mergeSize.cellHeight;\n }\n }\n\n const cellStyle = customStyle || table._getCellStyle(col, row);\n const cellTheme = getStyleTheme(\n cellStyle,\n table,\n range ? range.start.col : col,\n range ? range.start.row : row,\n getProp\n ).theme;\n cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);\n cellTheme.group.width = colWidth;\n cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight;\n if (cellTheme._vtable.padding) {\n padding = cellTheme._vtable.padding;\n }\n if (cellTheme.text.textAlign) {\n textAlign = cellTheme.text.textAlign;\n }\n if (cellTheme.text.textBaseline) {\n textBaseline = cellTheme.text.textBaseline;\n }\n\n // enable clip body\n if (cellLocation !== 'body' && !cellTheme.group.fill) {\n cellTheme.group.fill = '#fff';\n }\n // margin = getProp('margin', headerStyle, col, 0, table)\n\n const type =\n (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||\n 'text';\n\n // deal with promise data\n if (isPromise(value)) {\n dealPromiseData(\n value,\n table,\n createCell.bind(\n null,\n type,\n value,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme\n )\n );\n columnGroup.updateColumnRowNumber(row);\n const height = table.getRowHeight(row);\n columnGroup.updateColumnHeight(height);\n y += height;\n } else {\n const cellGroup = createCell(\n type,\n value,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme\n );\n columnGroup.updateColumnRowNumber(row);\n if (isMerge) {\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n const { width: contentWidth } = cellGroup.attribute;\n const { height: contentHeight } = cellGroup.attribute;\n cellGroup.contentWidth = contentWidth;\n cellGroup.contentHeight = contentHeight;\n\n resizeCellGroup(cellGroup, rangeWidth, rangeHeight, range, table);\n columnGroup.updateColumnHeight(rangeHeight);\n y += rangeHeight;\n } else {\n columnGroup.updateColumnHeight(cellGroup.attribute.height);\n y += cellGroup.attribute.height;\n }\n }\n if (rowLimit && row > rowLimit) {\n break;\n }\n }\n\n columnGroup.setAttribute('width', colWidth);\n return {\n width: colWidth,\n height: y\n };\n}\n\n/**\n * 获取列分组主题\n * @param col 列索引\n * @param colWidth 列宽\n * @param table 表格实例\n * @returns 列分组主题\n */\nexport function getColumnGroupTheme(\n col: number,\n colWidth: number,\n table: BaseTableAPI\n): { theme: IThemeSpec & { _vtable: any }; hasFunctionPros: boolean } {\n const style = table._getCellStyle(col, table.columnHeaderLevelCount); // to be fixed\n const { theme: columnTheme, hasFunctionPros } = getStyleTheme(\n style,\n table,\n col,\n table.columnHeaderLevelCount,\n getRawProp\n );\n\n // get column header style\n columnTheme.group.width = colWidth;\n columnTheme.group.height = 0;\n return { theme: columnTheme, hasFunctionPros };\n}\n\nexport function resizeCellGroup(\n cellGroup: Group,\n rangeWidth: number,\n rangeHeight: number,\n range: CellRange,\n table: BaseTableAPI\n) {\n const { col, row } = cellGroup;\n const dx = -table.getColsWidth(range.start.col, col - 1);\n const dy = -table.getRowsHeight(range.start.row, row - 1);\n\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: (child.attribute.dx ?? 0) + dx,\n dy: (child.attribute.dy ?? 0) + dy\n });\n });\n\n const lineWidth = cellGroup.attribute.lineWidth;\n const isLineWidthArray = isArray(lineWidth);\n const newLineWidth = [0, 0, 0, 0];\n\n if (col === range.start.col) {\n newLineWidth[3] = isLineWidthArray ? lineWidth[3] : lineWidth;\n }\n if (row === range.start.row) {\n newLineWidth[0] = isLineWidthArray ? lineWidth[0] : lineWidth;\n }\n if (col === range.end.col) {\n newLineWidth[1] = isLineWidthArray ? lineWidth[1] : lineWidth;\n }\n if (row === range.end.row) {\n newLineWidth[2] = isLineWidthArray ? lineWidth[2] : lineWidth;\n }\n\n const widthChange = rangeWidth !== cellGroup.attribute.width;\n const heightChange = rangeHeight !== cellGroup.attribute.height;\n\n cellGroup.setAttributes({\n width: rangeWidth,\n height: rangeHeight,\n strokeArrayWidth: newLineWidth\n } as any);\n\n cellGroup.mergeStartCol = range.start.col;\n cellGroup.mergeStartRow = range.start.row;\n cellGroup.mergeEndCol = range.end.col;\n cellGroup.mergeEndRow = range.end.row;\n\n return {\n widthChange,\n heightChange\n };\n}\n\nfunction dealMerge(range: CellRange, mergeMap: MergeMap, table: BaseTableAPI) {\n let cellWidth = 0;\n let cellHeight = 0;\n const mergeResult = mergeMap.get(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`);\n if (!mergeResult) {\n for (let col = range.start.col; col <= range.end.col; col++) {\n cellWidth += table.getColWidth(col);\n }\n\n // let cellHeight = 0;\n for (let i = range.start.row; i <= range.end.row; i++) {\n cellHeight += table.getRowHeight(i);\n }\n\n mergeMap.set(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`, {\n cellWidth,\n cellHeight\n });\n } else {\n cellWidth = mergeResult.cellWidth;\n cellHeight = mergeResult.cellHeight;\n }\n return {\n cellWidth,\n cellHeight\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/group-creater/column-helper.ts"],"names":[],"mappings":";;;AAIA,gDAAwD;AAExD,+CAA2C;AAE3C,wDAA4E;AAC5E,+CAA+C;AAC/C,kEAA6D;AAC7D,6CAA2C;AAC3C,gDAAqD;AAiBrD,SAAgB,mBAAmB,CACjC,WAAkB,EAClB,GAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,MAAc,EACd,QAAkB,EAClB,gBAAmC,EACnC,KAAmB,EACnB,YAA0B,EAC1B,QAAiB;IAEjB,IAAI,OAAO,CAAC;IACZ,IAAI,SAAS,CAAC;IACd,IAAI,YAAY,CAAC;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AE;YACrD,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;SACrC;QAED,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE;YACtF,SAAS;YACT,UAAU;SACX,CAAC,CAAC;KACJ;SAAM;QACL,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;QAClC,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;KACrC;IACD,OAAO;QACL,SAAS;QACT,UAAU;KACX,CAAC;AACJ,CAAC","file":"column-helper.js","sourcesContent":["/* eslint-disable no-undef */\nimport type { IGraphic, IThemeSpec } from './../../vrender';\nimport type { CellLocation, CellRange, TextColumnDefine } from '../../ts-types';\nimport type { Group } from '../graphic/group';\nimport { getProp, getRawProp } from '../utils/get-prop';\nimport type { MergeMap } from '../scenegraph';\nimport { createCell } from './cell-helper';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { getCellCornerRadius, getStyleTheme } from '../../core/tableHelper';\nimport { isPromise } from '../../tools/helper';\nimport { dealPromiseData } from '../utils/deal-promise-data';\nimport { isArray } from '@visactor/vutils';\nimport { dealWithCustom } from '../component/custom';\n/**\n * 创建复合列 同一列支持创建不同类型单元格\n * @param columnGroup 列Group\n * @param col\n * @param colWidth 配置列宽\n * @param rowStart\n * @param rowEnd\n * @param mergeMap merge单元格信息\n * @param defaultRowHeight\n * @param table\n * @param cellLocation\n * @param rowLimit\n * @param customRender\n * @param customLayout\n * @returns\n */\nexport function createComplexColumn(\n columnGroup: Group,\n col: number,\n colWidth: number,\n rowStart: number,\n rowEnd: number,\n mergeMap: MergeMap,\n defaultRowHeight: number | number[],\n table: BaseTableAPI,\n cellLocation: CellLocation,\n rowLimit?: number\n) {\n let padding;\n let textAlign;\n let textBaseline;\n /** useColumnTheme 判断是否可以使用columnTheme */\n // insert cell into column group top\n let y = 0;\n // if (columnGroup.colHeight) {\n // // insert cell into column group bottom\n // y = columnGroup.colHeight;\n // }\n if (columnGroup.lastChild && (columnGroup.lastChild as Group).row === rowStart - 1) {\n y = (columnGroup.lastChild as Group).attribute.y + (columnGroup.lastChild as Group).attribute.height;\n } else if (columnGroup.colHeight) {\n y = columnGroup.colHeight;\n }\n\n for (let j = rowStart; j <= rowEnd; j++) {\n const row = j;\n let value = table.getCellValue(col, row);\n\n // 处理单元格合并\n let cellWidth = colWidth;\n // let cellHeight = table.internalProps.autoRowHeight ? 0 : table.getRowHeight(row);\n let cellHeight = table.getRowHeight(row);\n let range;\n let isMerge;\n let customStyle;\n let customResult;\n if (table.internalProps.customMergeCell) {\n const customMerge = table.getCustomMerge(col, row);\n if (customMerge) {\n const {\n range: customMergeRange,\n text: customMergeText,\n style: customMergeStyle,\n customLayout,\n customRender\n } = customMerge;\n range = customMergeRange;\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n if (isMerge) {\n const mergeSize = dealMerge(range, mergeMap, table);\n cellWidth = mergeSize.cellWidth;\n cellHeight = mergeSize.cellHeight;\n }\n value = customMergeText;\n customStyle = customMergeStyle;\n\n if (customLayout || customRender) {\n customResult = dealWithCustom(\n customLayout,\n customRender,\n customMergeRange.start.col,\n customMergeRange.start.row,\n table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col),\n table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row),\n false,\n table.heightMode === 'autoHeight',\n [0, 0, 0, 0],\n table\n );\n }\n }\n }\n\n let colForDefine = col;\n let rowForDefine = row;\n if (range) {\n colForDefine = range.start.col;\n rowForDefine = range.start.row;\n }\n const define =\n cellLocation !== 'body'\n ? table.getHeaderDefine(colForDefine, rowForDefine)\n : table.getBodyColumnDefine(colForDefine, rowForDefine);\n const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;\n\n if (!range && (cellLocation !== 'body' || (define as TextColumnDefine)?.mergeCell)) {\n // 只有表头或者column配置合并单元格后再进行信息获取\n range = table.getCellRange(col, row);\n isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;\n // 所有Merge单元格,只保留左上角一个真实的单元格,其他使用空Group占位\n if (isMerge) {\n const mergeSize = dealMerge(range, mergeMap, table);\n cellWidth = mergeSize.cellWidth;\n cellHeight = mergeSize.cellHeight;\n }\n }\n\n const cellStyle = customStyle || table._getCellStyle(col, row);\n const cellTheme = getStyleTheme(\n cellStyle,\n table,\n range ? range.start.col : col,\n range ? range.start.row : row,\n getProp\n ).theme;\n cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);\n cellTheme.group.width = colWidth;\n cellTheme.group.height = Array.isArray(defaultRowHeight) ? defaultRowHeight[row] : defaultRowHeight;\n if (cellTheme._vtable.padding) {\n padding = cellTheme._vtable.padding;\n }\n if (cellTheme.text.textAlign) {\n textAlign = cellTheme.text.textAlign;\n }\n if (cellTheme.text.textBaseline) {\n textBaseline = cellTheme.text.textBaseline;\n }\n\n // enable clip body\n if (cellLocation !== 'body' && !cellTheme.group.fill) {\n cellTheme.group.fill = '#fff';\n }\n // margin = getProp('margin', headerStyle, col, 0, table)\n\n const type =\n (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||\n 'text';\n\n // deal with promise data\n if (isPromise(value)) {\n dealPromiseData(\n value,\n table,\n createCell.bind(\n null,\n type,\n value,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme,\n range,\n customResult\n )\n );\n columnGroup.updateColumnRowNumber(row);\n const height = table.getRowHeight(row);\n columnGroup.updateColumnHeight(height);\n y += height;\n } else {\n const cellGroup = createCell(\n type,\n value,\n define,\n table,\n col,\n row,\n colWidth,\n cellWidth,\n cellHeight,\n columnGroup,\n y,\n padding,\n textAlign,\n textBaseline,\n mayHaveIcon,\n cellTheme,\n range,\n customResult\n );\n columnGroup.updateColumnRowNumber(row);\n if (isMerge) {\n const rangeHeight = table.getRowHeight(row);\n const rangeWidth = table.getColWidth(col);\n\n const { width: contentWidth } = cellGroup.attribute;\n const { height: contentHeight } = cellGroup.attribute;\n cellGroup.contentWidth = contentWidth;\n cellGroup.contentHeight = contentHeight;\n\n resizeCellGroup(cellGroup, rangeWidth, rangeHeight, range, table);\n columnGroup.updateColumnHeight(rangeHeight);\n y += rangeHeight;\n } else {\n columnGroup.updateColumnHeight(cellGroup.attribute.height);\n y += cellGroup.attribute.height;\n }\n }\n if (rowLimit && row > rowLimit) {\n break;\n }\n }\n\n columnGroup.setAttribute('width', colWidth);\n return {\n width: colWidth,\n height: y\n };\n}\n\n/**\n * 获取列分组主题\n * @param col 列索引\n * @param colWidth 列宽\n * @param table 表格实例\n * @returns 列分组主题\n */\nexport function getColumnGroupTheme(\n col: number,\n colWidth: number,\n table: BaseTableAPI\n): { theme: IThemeSpec & { _vtable: any }; hasFunctionPros: boolean } {\n const style = table._getCellStyle(col, table.columnHeaderLevelCount); // to be fixed\n const { theme: columnTheme, hasFunctionPros } = getStyleTheme(\n style,\n table,\n col,\n table.columnHeaderLevelCount,\n getRawProp\n );\n\n // get column header style\n columnTheme.group.width = colWidth;\n columnTheme.group.height = 0;\n return { theme: columnTheme, hasFunctionPros };\n}\n\nexport function resizeCellGroup(\n cellGroup: Group,\n rangeWidth: number,\n rangeHeight: number,\n range: CellRange,\n table: BaseTableAPI\n) {\n const { col, row } = cellGroup;\n const dx = -table.getColsWidth(range.start.col, col - 1);\n const dy = -table.getRowsHeight(range.start.row, row - 1);\n\n cellGroup.forEachChildren((child: IGraphic) => {\n child.setAttributes({\n dx: (child.attribute.dx ?? 0) + dx,\n dy: (child.attribute.dy ?? 0) + dy\n });\n });\n\n const lineWidth = cellGroup.attribute.lineWidth;\n const isLineWidthArray = isArray(lineWidth);\n const newLineWidth = [0, 0, 0, 0];\n\n if (col === range.start.col) {\n newLineWidth[3] = isLineWidthArray ? lineWidth[3] : lineWidth;\n }\n if (row === range.start.row) {\n newLineWidth[0] = isLineWidthArray ? lineWidth[0] : lineWidth;\n }\n if (col === range.end.col) {\n newLineWidth[1] = isLineWidthArray ? lineWidth[1] : lineWidth;\n }\n if (row === range.end.row) {\n newLineWidth[2] = isLineWidthArray ? lineWidth[2] : lineWidth;\n }\n\n const widthChange = rangeWidth !== cellGroup.attribute.width;\n const heightChange = rangeHeight !== cellGroup.attribute.height;\n\n cellGroup.setAttributes({\n width: rangeWidth,\n height: rangeHeight,\n strokeArrayWidth: newLineWidth\n } as any);\n\n cellGroup.mergeStartCol = range.start.col;\n cellGroup.mergeStartRow = range.start.row;\n cellGroup.mergeEndCol = range.end.col;\n cellGroup.mergeEndRow = range.end.row;\n\n return {\n widthChange,\n heightChange\n };\n}\n\nfunction dealMerge(range: CellRange, mergeMap: MergeMap, table: BaseTableAPI) {\n let cellWidth = 0;\n let cellHeight = 0;\n const mergeResult = mergeMap.get(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`);\n if (!mergeResult) {\n for (let col = range.start.col; col <= range.end.col; col++) {\n cellWidth += table.getColWidth(col);\n }\n\n // let cellHeight = 0;\n for (let i = range.start.row; i <= range.end.row; i++) {\n cellHeight += table.getRowHeight(i);\n }\n\n mergeMap.set(`${range.start.col},${range.start.row};${range.end.col},${range.end.row}`, {\n cellWidth,\n cellHeight\n });\n } else {\n cellWidth = mergeResult.cellWidth;\n cellHeight = mergeResult.cellHeight;\n }\n return {\n cellWidth,\n cellHeight\n };\n}\n"]}
|
|
@@ -34,15 +34,22 @@ const compute_col_width_1 = require("../../../layout/compute-col-width"), dynami
|
|
|
34
34
|
|
|
35
35
|
function sortHorizontal(proxy) {
|
|
36
36
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
37
|
-
proxy.table.scenegraph.
|
|
38
|
-
"group" === colGroup.type && (colGroup.needUpdate = !0, null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
39
|
-
cellGroup.needUpdate = !0;
|
|
40
|
-
})));
|
|
41
|
-
})), proxy.table.scenegraph.bodyGroup.forEachChildren(((colGroup, index) => {
|
|
37
|
+
proxy.table.scenegraph.bodyGroup.forEachChildren(((colGroup, index) => {
|
|
42
38
|
"group" === colGroup.type && (colGroup.needUpdate = !0, null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
43
39
|
cellGroup.needUpdate = !0;
|
|
44
40
|
})));
|
|
45
41
|
}));
|
|
42
|
+
for (let col = proxy.colStart; col <= proxy.colEnd; col++) {
|
|
43
|
+
const columnGroup = proxy.table.scenegraph.getColGroup(col);
|
|
44
|
+
null == columnGroup || columnGroup.setAttribute("chartInstance", void 0);
|
|
45
|
+
for (let row = proxy.table.rowCount - proxy.table.bottomFrozenRowCount; row < proxy.table.rowCount; row++) proxy.table.scenegraph.updateCellContent(col, row);
|
|
46
|
+
}
|
|
47
|
+
for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {
|
|
48
|
+
const columnGroup = proxy.table.scenegraph.getColGroup(col);
|
|
49
|
+
null == columnGroup || columnGroup.setAttribute("chartInstance", void 0);
|
|
50
|
+
for (let row = proxy.rowStart; row <= proxy.rowEnd; row++) proxy.table.scenegraph.updateCellContent(col, row);
|
|
51
|
+
for (let row = proxy.table.rowCount - proxy.table.bottomFrozenRowCount; row < proxy.table.rowCount; row++) proxy.table.scenegraph.updateCellContent(col, row);
|
|
52
|
+
}
|
|
46
53
|
const syncLeftCol = Math.max(proxy.bodyLeftCol, proxy.screenLeftCol - 1 * proxy.screenColCount), syncRightCol = Math.min(proxy.bodyRightCol, proxy.screenLeftCol + 2 * proxy.screenColCount);
|
|
47
54
|
(0, compute_col_width_1.computeColsWidth)(proxy.table, syncLeftCol, syncRightCol),
|
|
48
55
|
(0, dynamic_set_x_1.updateColContent)(syncLeftCol, syncRightCol, proxy), proxy.colUpdatePos = proxy.colStart,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/group-creater/progress/update-position/sort-horizontal.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yEAAqE;AAErE,mDAAmD;AAGnD,SAAsB,cAAc,CAAC,KAAiB;;
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/group-creater/progress/update-position/sort-horizontal.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yEAAqE;AAErE,mDAAmD;AAGnD,SAAsB,cAAc,CAAC,KAAiB;;QAEpD,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,QAAe,EAAE,KAAa,EAAE,EAAE;YAClF,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;gBAC7B,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;gBAC3B,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,CAAC,CAAC,SAAgB,EAAE,EAAE;oBAC5C,SAAiB,CAAC,UAAU,GAAG,IAAI,CAAC;gBACvC,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;QACH,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;YAEzD,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YAC5D,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;YACtD,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,oBAAoB,EAAE,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;gBACzG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,C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E,YAAY,EAAE,KAAK,CAAC,CAAC;QASnD,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC;QACpC,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,YAAY,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QAiBtH,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;QACzC,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;CAAA;AAhED,wCAgEC","file":"sort-horizontal.js","sourcesContent":["import type { Group } from '../../../graphic/group';\nimport { computeColsWidth } from '../../../layout/compute-col-width';\nimport type { SceneProxy } from '../proxy';\nimport { updateColContent } from './dynamic-set-x';\nimport { updateAutoColumn } from './update-auto-column';\n\nexport async function sortHorizontal(proxy: SceneProxy) {\n // 更新左 中 右 左下 底部 右下 部分的单元格需更新标记\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n colGroup.needUpdate = true;\n colGroup?.forEachChildren((cellGroup: Group) => {\n (cellGroup as any).needUpdate = true;\n });\n }\n });\n for (let col = proxy.colStart; col <= proxy.colEnd; col++) {\n // 将该列的chartInstance清除掉\n const columnGroup = proxy.table.scenegraph.getColGroup(col);\n columnGroup?.setAttribute('chartInstance', undefined);\n for (let row = proxy.table.rowCount - proxy.table.bottomFrozenRowCount; row < proxy.table.rowCount; row++) {\n proxy.table.scenegraph.updateCellContent(col, row);\n }\n }\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n // 将该列的chartInstance清除掉\n const columnGroup = proxy.table.scenegraph.getColGroup(col);\n columnGroup?.setAttribute('chartInstance', undefined);\n for (let row = proxy.rowStart; row <= proxy.rowEnd; row++) {\n proxy.table.scenegraph.updateCellContent(col, row);\n }\n for (let row = proxy.table.rowCount - proxy.table.bottomFrozenRowCount; row < proxy.table.rowCount; row++) {\n proxy.table.scenegraph.updateCellContent(col, row);\n }\n }\n // 更新同步范围\n const syncLeftCol = Math.max(proxy.bodyLeftCol, proxy.screenLeftCol - proxy.screenColCount * 1);\n const syncRightCol = Math.min(proxy.bodyRightCol, proxy.screenLeftCol + proxy.screenColCount * 2);\n\n computeColsWidth(proxy.table, syncLeftCol, syncRightCol);\n\n updateColContent(syncLeftCol, syncRightCol, proxy);\n\n // updateAutoColumn(\n // syncLeftCol, // colStart\n // syncRightCol, // colEnd\n // proxy.table,\n // proxy.colEnd > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left' // 跳转到右侧时,从右向左对齐\n // );\n\n proxy.colUpdatePos = proxy.colStart;\n proxy.colUpdateDirection = proxy.colEnd > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';\n\n // if (\n // proxy.colEnd === proxy.table.scenegraph.proxy.bodyRightCol &&\n // proxy.colStart === proxy.table.scenegraph.proxy.bodyLeftCol\n // ) {\n // // 全量更新,do nothing\n // } else if (proxy.colEnd === proxy.table.scenegraph.proxy.bodyRightCol) {\n // const totalWidth = proxy.table.getAllColsWidth();\n // const left = totalWidth - proxy.table.scenegraph.width;\n // // proxy.updateBody(top);\n // proxy.table.scenegraph.setBodyAndColHeaderX(-left);\n // } else if (proxy.colStart === proxy.table.scenegraph.proxy.bodyLeftCol) {\n // // proxy.updateBody(0);\n // proxy.table.scenegraph.setBodyAndColHeaderX(0);\n // }\n\n proxy.table.scenegraph.updateNextFrame();\n await proxy.progress();\n}\n"]}
|
|
@@ -33,24 +33,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
33
33
|
const compute_row_height_1 = require("../../../layout/compute-row-height"), dynamic_set_y_1 = require("./dynamic-set-y"), update_auto_row_1 = require("./update-auto-row");
|
|
34
34
|
|
|
35
35
|
function sortVertical(proxy) {
|
|
36
|
+
var _a;
|
|
36
37
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
null == colGroup || colGroup.forEachChildren(((cellGroup, index) => {
|
|
38
|
+
proxy.table.scenegraph.bodyGroup.forEachChildren(((colGroup, index) => {
|
|
39
|
+
"group" === colGroup.type && (colGroup.needUpdate = !0, null == colGroup || colGroup.forEachChildren((cellGroup => {
|
|
40
40
|
cellGroup.needUpdate = !0;
|
|
41
|
-
}));
|
|
41
|
+
})));
|
|
42
|
+
}));
|
|
43
|
+
for (let col = 0; null !== (_a = col < proxy.table.frozenColCount) && void 0 !== _a && _a; col++) {
|
|
44
|
+
const columnGroup = proxy.table.scenegraph.getColGroup(col);
|
|
45
|
+
null == columnGroup || columnGroup.setAttribute("chartInstance", void 0);
|
|
46
|
+
for (let row = proxy.rowStart; row <= proxy.rowEnd; row++) proxy.table.scenegraph.updateCellContent(col, row);
|
|
47
|
+
for (let row = proxy.table.rowCount - proxy.table.bottomFrozenRowCount; row < proxy.table.rowCount; row++) proxy.table.scenegraph.updateCellContent(col, row);
|
|
42
48
|
}
|
|
43
|
-
for (let col = proxy.
|
|
44
|
-
const
|
|
45
|
-
null ==
|
|
46
|
-
|
|
47
|
-
}));
|
|
49
|
+
for (let col = proxy.colStart; col <= proxy.colEnd; col++) {
|
|
50
|
+
const columnGroup = proxy.table.scenegraph.getColGroup(col);
|
|
51
|
+
null == columnGroup || columnGroup.setAttribute("chartInstance", void 0);
|
|
52
|
+
for (let row = proxy.table.rowCount - proxy.table.bottomFrozenRowCount; row < proxy.table.rowCount; row++) proxy.table.scenegraph.updateCellContent(col, row);
|
|
48
53
|
}
|
|
49
|
-
for (let col = proxy.
|
|
50
|
-
const
|
|
51
|
-
null ==
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {
|
|
55
|
+
const columnGroup = proxy.table.scenegraph.getColGroup(col);
|
|
56
|
+
null == columnGroup || columnGroup.setAttribute("chartInstance", void 0);
|
|
57
|
+
for (let row = proxy.rowStart; row <= proxy.rowEnd; row++) proxy.table.scenegraph.updateCellContent(col, row);
|
|
58
|
+
for (let row = proxy.table.rowCount - proxy.table.bottomFrozenRowCount; row < proxy.table.rowCount; row++) proxy.table.scenegraph.updateCellContent(col, row);
|
|
54
59
|
}
|
|
55
60
|
let syncTopRow, syncBottomRow;
|
|
56
61
|
"autoHeight" === proxy.table.heightMode ? (syncTopRow = proxy.rowStart, syncBottomRow = proxy.rowEnd) : (syncTopRow = Math.max(proxy.bodyTopRow, proxy.screenTopRow - 1 * proxy.screenRowCount),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scenegraph/group-creater/progress/update-position/sort-vertical.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2EAAuE;AAEvE,mDAAmD;AACnD,uDAAkD;AAElD,SAAsB,YAAY,CAAC,KAAiB
|
|
1
|
+
{"version":3,"sources":["../src/scenegraph/group-creater/progress/update-position/sort-vertical.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2EAAuE;AAEvE,mDAAmD;AACnD,uDAAkD;AAElD,SAAsB,YAAY,CAAC,KAAiB;;;QAElD,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,QAAe,EAAE,KAAa,EAAE,EAAE;YAClF,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;gBAC7B,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;gBAC3B,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,CAAC,CAAC,SAAgB,EAAE,EAAE;oBAC5C,SAAiB,CAAC,UAAU,GAAG,IAAI,CAAC;gBACvC,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;QAEH,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,MAAA,GAAG,GAAG,KAAK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,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;SAC9F;QAGD,IAAA,sCAAiB,EAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;QAE1D,IAAA,gCAAgB,EAAC,UAAU,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;QAEnD,IAAI,KAAK,CAAC,KAAK,CAAC,UAAU,KAAK,YAAY,EAAE;YAC3C,IAAA,+BAAa,EACX,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,UAAU,EACV,aAAa,EACb,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,aAAa,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CACzF,CAAC;SACH;QACD,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC;QACpC,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,aAAa,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAepH,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;QACzC,IAAI,KAAK,CAAC,KAAK,CAAC,UAAU,KAAK,YAAY,EAAE;YAC3C,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;SACxB;;CACF;AAxFD,oCAwFC","file":"sort-vertical.js","sourcesContent":["import type { Group } from '../../../graphic/group';\nimport { computeRowsHeight } from '../../../layout/compute-row-height';\nimport type { SceneProxy } from '../proxy';\nimport { updateRowContent } from './dynamic-set-y';\nimport { updateAutoRow } from './update-auto-row';\n\nexport async function sortVertical(proxy: SceneProxy) {\n // 更新左 中 右 左下 底部 右下 部分的单元格需更新标记\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n colGroup.needUpdate = true;\n colGroup?.forEachChildren((cellGroup: Group) => {\n (cellGroup as any).needUpdate = true;\n });\n }\n });\n\n for (let col = 0; col < proxy.table.frozenColCount ?? 0; col++) {\n // 将该列的chartInstance清除掉\n const columnGroup = proxy.table.scenegraph.getColGroup(col);\n columnGroup?.setAttribute('chartInstance', undefined);\n for (let row = proxy.rowStart; row <= proxy.rowEnd; row++) {\n proxy.table.scenegraph.updateCellContent(col, row);\n }\n for (let row = proxy.table.rowCount - proxy.table.bottomFrozenRowCount; row < proxy.table.rowCount; row++) {\n proxy.table.scenegraph.updateCellContent(col, row);\n }\n }\n for (let col = proxy.colStart; col <= proxy.colEnd; col++) {\n // 将该列的chartInstance清除掉\n const columnGroup = proxy.table.scenegraph.getColGroup(col);\n columnGroup?.setAttribute('chartInstance', undefined);\n for (let row = proxy.table.rowCount - proxy.table.bottomFrozenRowCount; row < proxy.table.rowCount; row++) {\n proxy.table.scenegraph.updateCellContent(col, row);\n }\n }\n for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {\n // 将该列的chartInstance清除掉\n const columnGroup = proxy.table.scenegraph.getColGroup(col);\n columnGroup?.setAttribute('chartInstance', undefined);\n for (let row = proxy.rowStart; row <= proxy.rowEnd; row++) {\n proxy.table.scenegraph.updateCellContent(col, row);\n }\n for (let row = proxy.table.rowCount - proxy.table.bottomFrozenRowCount; row < proxy.table.rowCount; row++) {\n proxy.table.scenegraph.updateCellContent(col, row);\n }\n }\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (proxy.table.heightMode === 'autoHeight') {\n syncTopRow = proxy.rowStart;\n syncBottomRow = proxy.rowEnd;\n } else {\n syncTopRow = Math.max(proxy.bodyTopRow, proxy.screenTopRow - proxy.screenRowCount * 1);\n syncBottomRow = Math.min(proxy.bodyBottomRow, proxy.screenTopRow + proxy.screenRowCount * 2);\n }\n // console.log('sort更新同步范围', syncTopRow, syncBottomRow);\n\n computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);\n\n updateRowContent(syncTopRow, syncBottomRow, proxy);\n\n if (proxy.table.heightMode === 'autoHeight') {\n updateAutoRow(\n proxy.bodyLeftCol, // colStart\n proxy.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n proxy.table,\n proxy.rowEnd > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n proxy.rowUpdatePos = proxy.rowStart;\n proxy.rowUpdateDirection = proxy.rowEnd > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up';\n\n // if (\n // proxy.rowEnd === proxy.table.scenegraph.proxy.bodyBottomRow &&\n // proxy.rowStart === proxy.table.scenegraph.proxy.bodyTopRow\n // ) {\n // // 全量更新,do nothing\n // } else if (proxy.rowEnd === proxy.table.scenegraph.proxy.bodyBottomRow) {\n // const totalHeight = proxy.table.getAllRowsHeight();\n // const top = totalHeight - proxy.table.scenegraph.height;\n // proxy.updateBody(top);\n // } else if (proxy.rowStart === proxy.table.scenegraph.proxy.bodyTopRow) {\n // proxy.updateBody(0);\n // }\n\n proxy.table.scenegraph.updateNextFrame();\n if (proxy.table.heightMode !== 'autoHeight') {\n await proxy.progress();\n }\n}\n"]}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { BaseTableAPI } from '../../ts-types/base-table';
|
|
2
|
-
|
|
2
|
+
import type { CellRange } from '../../ts-types';
|
|
3
|
+
export declare function moveHeaderPosition(colSource: number, rowSource: number, colTarget: number, rowTarget: number, sourceMergeInfo: false | CellRange, targetMergeInfo: false | CellRange, table: BaseTableAPI): void;
|