@visactor/vtable 0.9.1-alpha.5 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/cjs/core/BaseTable.js +2 -2
  2. package/cjs/core/BaseTable.js.map +1 -1
  3. package/cjs/index.d.ts +1 -1
  4. package/cjs/index.js +1 -1
  5. package/cjs/index.js.map +1 -1
  6. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +5 -4
  7. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  8. package/cjs/scenegraph/layout/frozen.d.ts +3 -0
  9. package/cjs/scenegraph/layout/frozen.js +66 -0
  10. package/cjs/scenegraph/layout/frozen.js.map +1 -0
  11. package/cjs/scenegraph/layout/update-width.js +1 -1
  12. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  13. package/cjs/scenegraph/refresh-node/update-chart.js +5 -5
  14. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  15. package/cjs/scenegraph/scenegraph.js +7 -47
  16. package/cjs/scenegraph/scenegraph.js.map +1 -1
  17. package/cjs/scenegraph/style/frame-border.d.ts +1 -1
  18. package/cjs/scenegraph/style/frame-border.js +3 -3
  19. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  20. package/cjs/scenegraph/utils/text-icon-layout.js +2 -2
  21. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  22. package/dist/vtable.es5.js +129 -109
  23. package/dist/vtable.es5.min.js +1 -1
  24. package/dist/vtable.js +129 -109
  25. package/dist/vtable.min.js +2 -2
  26. package/es/core/BaseTable.js +2 -2
  27. package/es/core/BaseTable.js.map +1 -1
  28. package/es/index.d.ts +1 -1
  29. package/es/index.js +1 -1
  30. package/es/index.js.map +1 -1
  31. package/es/scenegraph/group-creater/cell-type/chart-cell.js +5 -4
  32. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  33. package/es/scenegraph/layout/frozen.d.ts +3 -0
  34. package/es/scenegraph/layout/frozen.js +58 -0
  35. package/es/scenegraph/layout/frozen.js.map +1 -0
  36. package/es/scenegraph/layout/update-width.js +1 -1
  37. package/es/scenegraph/layout/update-width.js.map +1 -1
  38. package/es/scenegraph/refresh-node/update-chart.js +5 -5
  39. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  40. package/es/scenegraph/scenegraph.js +8 -46
  41. package/es/scenegraph/scenegraph.js.map +1 -1
  42. package/es/scenegraph/style/frame-border.d.ts +1 -1
  43. package/es/scenegraph/style/frame-border.js +3 -3
  44. package/es/scenegraph/style/frame-border.js.map +1 -1
  45. package/es/scenegraph/utils/text-icon-layout.js +2 -2
  46. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  47. package/package.json +4 -3
package/cjs/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import { ListTable } from './ListTable';
9
9
  import { PivotTable } from './PivotTable';
10
10
  import type { MousePointerCellEvent } from './ts-types/events';
11
11
  import * as CustomLayout from './render/layout';
12
- export declare const version = "0.9.1-alpha.5";
12
+ export declare const version = "0.9.1";
13
13
  export { TYPES, core, ListTable, ListTableConstructorOptions, PivotTable, PivotTableConstructorOptions, IHeaderTreeDefine, IDimension, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, themes, data, MousePointerCellEvent, getIcons, clearGlobal, register, DataStatistics, CustomLayout };
14
14
  declare function getIcons(): {
15
15
  [key: string]: TYPES.ColumnIconOption;
package/cjs/index.js CHANGED
@@ -81,6 +81,6 @@ function clearGlobal() {
81
81
  register.clearAll();
82
82
  }
83
83
 
84
- exports.CustomLayout = CustomLayout, exports.version = "0.9.1-alpha.5", exports.getIcons = getIcons,
84
+ exports.CustomLayout = CustomLayout, exports.version = "0.9.1", exports.getIcons = getIcons,
85
85
  exports.clearGlobal = clearGlobal, TYPES.AggregationType;
86
86
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,kDAAoC;AAmClC,sBAAK;AAlCP,6CAA+B;AAmC7B,oBAAI;AAlCN,6CAA+B;AAmD7B,oBAAI;AAlDN,+CAAiC;AACjC,qDAAuC;AAsDrC,4BAAQ;AArDV,iDAAmC;AA+CjC,wBAAM;AA9CR,yEAA2D;AAwDzD,wCAAc;AAxChB,2CAAwC;AAetC,0FAfO,qBAAS,OAeP;AAdX,6CAA0C;AAgBxC,2FAhBO,uBAAU,OAgBP;AAdZ,8DAAgD;AAsC9C,oCAAY;AArCD,QAAA,OAAO,GAAG,eAAe,CAAC;AAyCvC,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAhBC,4BAAQ;AAkBV,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AArBC,kCAAW;AAsBb,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\n\n// export { version } from '../../package.json';\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n IHeaderTreeDefine,\n IDimension\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\nexport const version = \"0.9.1-alpha.5\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,kDAAoC;AAmClC,sBAAK;AAlCP,6CAA+B;AAmC7B,oBAAI;AAlCN,6CAA+B;AAmD7B,oBAAI;AAlDN,+CAAiC;AACjC,qDAAuC;AAsDrC,4BAAQ;AArDV,iDAAmC;AA+CjC,wBAAM;AA9CR,yEAA2D;AAwDzD,wCAAc;AAxChB,2CAAwC;AAetC,0FAfO,qBAAS,OAeP;AAdX,6CAA0C;AAgBxC,2FAhBO,uBAAU,OAgBP;AAdZ,8DAAgD;AAsC9C,oCAAY;AArCD,QAAA,OAAO,GAAG,OAAO,CAAC;AAyC/B,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAhBC,4BAAQ;AAkBV,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AArBC,kCAAW;AAsBb,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\n\n// export { version } from '../../package.json';\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n IHeaderTreeDefine,\n IDimension\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\nexport const version = \"0.9.1\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
@@ -51,6 +51,7 @@ function createChartCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row
51
51
  })).role = "cell", cellGroup.col = col, cellGroup.row = row, columnGroup.addChild(cellGroup)),
52
52
  cellGroup.AABBBounds.width();
53
53
  const chartGroup = new chart_1.Chart({
54
+ stroke: !1,
54
55
  x: padding[3],
55
56
  y: padding[0],
56
57
  canvas: table.canvas,
@@ -63,10 +64,10 @@ function createChartCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row
63
64
  data: table.getCellValue(col, row),
64
65
  cellPadding: padding,
65
66
  viewBox: {
66
- x1: Math.ceil(cellGroup.globalAABBBounds.x1 + table.tableX + padding[3]) + table.scrollLeft,
67
- x2: Math.ceil(cellGroup.globalAABBBounds.x1 + width + table.tableX - padding[1]) + table.scrollLeft,
68
- y1: Math.ceil(cellGroup.globalAABBBounds.y1 + table.tableY + padding[0]) + table.scrollTop,
69
- y2: Math.ceil(cellGroup.globalAABBBounds.y1 + height + table.tableY - padding[2] + table.scrollTop)
67
+ x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
68
+ x2: Math.ceil(cellGroup.globalAABBBounds.x1 + width - padding[1] + table.scrollLeft),
69
+ y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
70
+ y2: Math.ceil(cellGroup.globalAABBBounds.y1 + height - padding[2] + table.scrollTop)
70
71
  }
71
72
  });
72
73
  return cellGroup.appendChild(chartGroup), columnGroup.setAttribute("chartInstance", chartGroup.chartInstance),
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/group-creater/cell-type/chart-cell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4C;AAC5C,2CAA2C;AAC3C,+CAA4C;AAC5C,uEAAyD;AACzD,mDAAyD;AACzD,8CAA8C;AAE9C,SAAgB,oBAAoB,CAClC,SAAuB,EACvB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,OAAiB,EACjB,SAAiB,EACjB,SAAc,EACd,SAAc,EACd,aAAkB,EAClB,KAAmB;;IAGnB,MAAM,cAAc,GAAG,kBAAkB,CAAC,GAAG,EAAE,CAAC;IAChD,MAAM,SAAS,GAAG,cAAc,CAAC,SAAS,CAAC,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AC,gBAAgB,CAAC,EAAE,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;SACpG;KAOF,CAAC,CAAC;IACH,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAElC,WAAW,CAAC,YAAY,CAAC,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACpE,OAAO,SAAS,CAAC;AACnB,CAAC;AAjFD,oDAiFC","file":"chart-cell.js","sourcesContent":["import { Group } from '../../graphic/group';\nimport { getCellTheme } from './text-cell';\nimport { Chart } from '../../graphic/chart';\nimport * as registerChartTypes from '../../../chartType';\nimport { getFunctionalProp } from '../../utils/get-prop';\nimport { isValid } from '../../../tools/util';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nexport function createChartCellGroup(\n cellGroup: Group | null,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n padding: number[],\n dataValue: string,\n chartType: any,\n chartSpec: any,\n chartInstance: any,\n table: BaseTableAPI\n) {\n // 获取注册的chart图表类型\n const registerCharts = registerChartTypes.get();\n const ClassType = registerCharts[chartType];\n const cellTheme = getCellTheme(table, col, row);\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 // cell\n if (!cellGroup) {\n cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n\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 } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup.addChild(cellGroup);\n }\n cellGroup.AABBBounds.width(); // TODO 需要底层VRender修改\n // chart\n const chartGroup = new Chart({\n x: padding[3],\n y: padding[0],\n canvas: table.canvas,\n spec: chartSpec,\n ClassType,\n width: width - padding[3] - padding[1],\n height: height - padding[2] - padding[0],\n chartInstance,\n dataId: 'data',\n data: table.getCellValue(col, row),\n cellPadding: padding,\n viewBox: {\n x1: Math.ceil(cellGroup.globalAABBBounds.x1 + table.tableX + padding[3]) + table.scrollLeft,\n x2: Math.ceil(cellGroup.globalAABBBounds.x1 + width + table.tableX - padding[1]) + table.scrollLeft,\n y1: Math.ceil(cellGroup.globalAABBBounds.y1 + table.tableY + padding[0]) + table.scrollTop,\n y2: Math.ceil(cellGroup.globalAABBBounds.y1 + height + table.tableY - padding[2] + table.scrollTop)\n }\n // clipRect: {\n // left: cellGroup.globalAABBBounds.x1 + (table as any).tableX + padding[3],\n // top: cellGroup.globalAABBBounds.y1 + (table as any).tableY + padding[0],\n // width: width - padding[1] - padding[3], //cellGroup.globalAABBBounds.width() - padding[1] - padding[3],\n // height: height - padding[0] - padding[2],\n // },\n });\n cellGroup.appendChild(chartGroup);\n // 将生成的实例存到columnGroup中 已共享\n columnGroup.setAttribute('chartInstance', chartGroup.chartInstance);\n return cellGroup;\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/group-creater/cell-type/chart-cell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4C;AAC5C,2CAA2C;AAC3C,+CAA4C;AAC5C,uEAAyD;AACzD,mDAAyD;AACzD,8CAA8C;AAE9C,SAAgB,oBAAoB,CAClC,SAAuB,EACvB,WAAkB,EAClB,OAAe,EACf,OAAe,EACf,GAAW,EACX,GAAW,EACX,KAAa,EACb,MAAc,EACd,OAAiB,EACjB,SAAiB,EACjB,SAAc,EACd,SAAc,EACd,aAA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AAK,CAAC,SAAS,CAAC;YAC3E,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;SACrF;KAOF,CAAC,CAAC;IAQH,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAElC,WAAW,CAAC,YAAY,CAAC,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IAoBpE,OAAO,SAAS,CAAC;AACnB,CAAC;AA5GD,oDA4GC","file":"chart-cell.js","sourcesContent":["import { Group } from '../../graphic/group';\nimport { getCellTheme } from './text-cell';\nimport { Chart } from '../../graphic/chart';\nimport * as registerChartTypes from '../../../chartType';\nimport { getFunctionalProp } from '../../utils/get-prop';\nimport { isValid } from '../../../tools/util';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nexport function createChartCellGroup(\n cellGroup: Group | null,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n width: number,\n height: number,\n padding: number[],\n dataValue: string,\n chartType: any,\n chartSpec: any,\n chartInstance: any,\n table: BaseTableAPI\n) {\n // 获取注册的chart图表类型\n const registerCharts = registerChartTypes.get();\n const ClassType = registerCharts[chartType];\n const cellTheme = getCellTheme(table, col, row);\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 // cell\n if (!cellGroup) {\n cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n\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 } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup.addChild(cellGroup);\n }\n cellGroup.AABBBounds.width(); // TODO 需要底层VRender修改\n // chart\n const chartGroup = new Chart({\n stroke: false,\n x: padding[3],\n y: padding[0],\n canvas: table.canvas,\n spec: chartSpec,\n ClassType,\n width: width - padding[3] - padding[1],\n height: height - padding[2] - padding[0],\n chartInstance,\n dataId: 'data',\n data: table.getCellValue(col, row),\n cellPadding: padding,\n viewBox: {\n x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),\n x2: Math.ceil(cellGroup.globalAABBBounds.x1 + width - padding[1] + table.scrollLeft),\n y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),\n y2: Math.ceil(cellGroup.globalAABBBounds.y1 + height - padding[2] + table.scrollTop)\n }\n // clipRect: {\n // left: cellGroup.globalAABBBounds.x1 + (table as any).tableX + padding[3],\n // top: cellGroup.globalAABBBounds.y1 + (table as any).tableY + padding[0],\n // width: width - padding[1] - padding[3], //cellGroup.globalAABBBounds.width() - padding[1] - padding[3],\n // height: height - padding[0] - padding[2],\n // },\n });\n\n // 调试使用\n // (chartGroup as Group).onBeforeAttributeUpdate = (val: any) => {\n // if (val.y === 9.5) {\n // console.log('ffffff------------------', val);\n // }\n // };\n cellGroup.appendChild(chartGroup);\n // 将生成的实例存到columnGroup中 已共享\n columnGroup.setAttribute('chartInstance', chartGroup.chartInstance);\n\n // 调试问题使用\n // if (col === 2) {\n // columnGroup.AABBBounds.width();\n // chartGroup.AABBBounds.width();\n // console.log(\n // 'set viewbox y1',\n // Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),\n // chartGroup.globalAABBBounds.height()\n // );\n\n // console.log(\n // 'create chart',\n // columnGroup,\n // columnGroup.globalAABBBounds.y1,\n // cellGroup.globalAABBBounds.y1,\n // chartGroup.globalAABBBounds.y1\n // );\n // }\n return cellGroup;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { Scenegraph } from '../scenegraph';
2
+ export declare function dealFrozen(scene: Scenegraph): void;
3
+ export declare function resetFrozen(scene: Scenegraph): void;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.resetFrozen = exports.dealFrozen = void 0;
6
+
7
+ const group_1 = require("../graphic/group");
8
+
9
+ function dealFrozen(scene) {
10
+ var _a, _b;
11
+ if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {
12
+ scene.rowHeaderGroup.setAttribute("height", scene.bodyGroup.attribute.height), scene.rowHeaderGroup.setAttribute("y", scene.bodyGroup.attribute.y),
13
+ scene.cornerHeaderGroup.setAttribute("height", scene.colHeaderGroup.attribute.height);
14
+ for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) moveColumnFromBodyToRowHeader(scene),
15
+ moveColumnFromColHeaderToCornerHeader(scene);
16
+ } else if (scene.table.frozenColCount < scene.table.rowHeaderLevelCount) for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) moveColumnFromRowHeaderToBody(scene),
17
+ moveColumnFromCornerHeaderToColHeader(scene);
18
+ scene.bodyGroup.setAttribute("x", scene.rowHeaderGroup.attribute.width), scene.colHeaderGroup.setAttribute("x", scene.cornerHeaderGroup.attribute.width),
19
+ scene.updateContainer(), scene.updateBorderSizeAndPosition(), scene.isPivot || scene.transpose || scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1),
20
+ scene.hasFrozen = !0, scene.frozenColCount = scene.table.frozenColCount, scene.frozenRowCount = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : 0;
21
+ }
22
+
23
+ function resetFrozen(scene) {
24
+ var _a, _b;
25
+ if (scene.frozenColCount > scene.table.rowHeaderLevelCount) for (let i = 0; i < scene.frozenColCount - scene.table.rowHeaderLevelCount; i++) moveColumnFromRowHeaderToBody(scene),
26
+ moveColumnFromCornerHeaderToColHeader(scene); else if (scene.frozenColCount < scene.table.rowHeaderLevelCount) {
27
+ scene.rowHeaderGroup.setAttribute("height", scene.bodyGroup.attribute.height), scene.rowHeaderGroup.setAttribute("y", scene.bodyGroup.attribute.y),
28
+ scene.cornerHeaderGroup.setAttribute("height", scene.colHeaderGroup.attribute.height);
29
+ for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.frozenColCount; i++) moveColumnFromBodyToRowHeader(scene),
30
+ moveColumnFromColHeaderToCornerHeader(scene);
31
+ }
32
+ scene.bodyGroup.setAttribute("x", scene.rowHeaderGroup.attribute.width), scene.colHeaderGroup.setAttribute("x", scene.cornerHeaderGroup.attribute.width),
33
+ scene.updateContainer(), scene.updateBorderSizeAndPosition(), scene.isPivot || scene.transpose || scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1),
34
+ scene.hasFrozen = !0, scene.frozenColCount = scene.table.rowHeaderLevelCount, scene.frozenRowCount = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : 0;
35
+ }
36
+
37
+ function moveColumnFromBodyToRowHeader(scene) {
38
+ const column = scene.bodyGroup.firstChild instanceof group_1.Group ? scene.bodyGroup.firstChild : null;
39
+ column && (scene.rowHeaderGroup.appendChild(column), scene.rowHeaderGroup.setAttribute("width", scene.rowHeaderGroup.attribute.width + column.attribute.width),
40
+ scene.bodyGroup.setAttribute("width", scene.bodyGroup.attribute.width - column.attribute.width));
41
+ }
42
+
43
+ function moveColumnFromColHeaderToCornerHeader(scene) {
44
+ const headerColumn = scene.colHeaderGroup.firstChild instanceof group_1.Group ? scene.colHeaderGroup.firstChild : null;
45
+ headerColumn && (scene.cornerHeaderGroup.appendChild(headerColumn), scene.cornerHeaderGroup.setAttribute("width", scene.cornerHeaderGroup.attribute.width + headerColumn.attribute.width),
46
+ scene.colHeaderGroup.setAttribute("width", scene.colHeaderGroup.attribute.width - headerColumn.attribute.width));
47
+ }
48
+
49
+ function moveColumnFromRowHeaderToBody(scene) {
50
+ var _a;
51
+ const column = scene.rowHeaderGroup.lastChild instanceof group_1.Group ? scene.rowHeaderGroup.lastChild : null === (_a = scene.rowHeaderGroup.lastChild) || void 0 === _a ? void 0 : _a._prev;
52
+ column && (scene.bodyGroup.firstChild ? scene.bodyGroup.insertBefore(column, scene.bodyGroup.firstChild) : scene.bodyGroup.appendChild(column),
53
+ scene.bodyGroup.setAttribute("width", scene.bodyGroup.attribute.width + column.attribute.width),
54
+ scene.rowHeaderGroup.setAttribute("width", scene.rowHeaderGroup.attribute.width - column.attribute.width));
55
+ }
56
+
57
+ function moveColumnFromCornerHeaderToColHeader(scene) {
58
+ var _a;
59
+ const headerColumn = scene.cornerHeaderGroup.lastChild instanceof group_1.Group ? scene.cornerHeaderGroup.lastChild : null === (_a = scene.cornerHeaderGroup.lastChild) || void 0 === _a ? void 0 : _a._prev;
60
+ headerColumn && (scene.colHeaderGroup.firstChild ? scene.colHeaderGroup.insertBefore(headerColumn, scene.colHeaderGroup.firstChild) : scene.bodyGroup.appendChild(headerColumn),
61
+ scene.colHeaderGroup.setAttribute("width", scene.colHeaderGroup.attribute.width + headerColumn.attribute.width),
62
+ scene.cornerHeaderGroup.setAttribute("width", scene.cornerHeaderGroup.attribute.width - headerColumn.attribute.width));
63
+ }
64
+
65
+ exports.dealFrozen = dealFrozen, exports.resetFrozen = resetFrozen;
66
+ //# sourceMappingURL=frozen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["scenegraph/layout/frozen.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAGzC,SAAgB,UAAU,CAAC,KAAiB;;IAC1C,IAAI,KAAK,CAAC,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,EAAE;QAEhE,KAAK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AAO,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAChG,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KAC3G;AACH,CAAC;AAED,SAAS,qCAAqC,CAAC,KAAiB;;IAE9D,MAAM,YAAY,GAChB,KAAK,CAAC,iBAAiB,CAAC,SAAS,YAAY,aAAK;QAChD,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS;QACnC,CAAC,CAAE,MAAA,KAAK,CAAC,iBAAiB,CAAC,SAAS,0CAAE,KAAe,CAAC;IAC1D,IAAI,YAAY,EAAE;QAChB,IAAI,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE;YACnC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;SAClF;aAAM;YACL,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;SAC3C;QACD,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,GAAG,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAChH,KAAK,CAAC,iBAAiB,CAAC,YAAY,CAClC,OAAO,EACP,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,KAAK,GAAG,YAAY,CAAC,SAAS,CAAC,KAAK,CACvE,CAAC;KACH;AACH,CAAC","file":"frozen.js","sourcesContent":["import { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\n\nexport function dealFrozen(scene: Scenegraph) {\n if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {\n // 将对应列移入rowHeaderGroup\n scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);\n scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);\n scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);\n for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) {\n moveColumnFromBodyToRowHeader(scene);\n moveColumnFromColHeaderToCornerHeader(scene);\n }\n } else if (scene.table.frozenColCount < scene.table.rowHeaderLevelCount) {\n // move columnGroup from rowHeaderGroup into bodyGroup(from cornerHeaderGroup into colHeaderGroup)\n for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) {\n moveColumnFromRowHeaderToBody(scene);\n moveColumnFromCornerHeaderToColHeader(scene);\n }\n }\n scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);\n scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);\n\n scene.updateContainer();\n scene.updateBorderSizeAndPosition();\n\n if (!scene.isPivot && !scene.transpose) {\n scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);\n }\n scene.hasFrozen = true;\n\n // scene.frozenColCount = scene.rowHeaderGroup.childrenCount;\n scene.frozenColCount = scene.table.frozenColCount;\n scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;\n}\n\nexport function resetFrozen(scene: Scenegraph) {\n if (scene.frozenColCount > scene.table.rowHeaderLevelCount) {\n // move columnGroup from rowHeaderGroup into bodyGroup(from cornerHeaderGroup into colHeaderGroup)\n for (let i = 0; i < scene.frozenColCount - scene.table.rowHeaderLevelCount; i++) {\n moveColumnFromRowHeaderToBody(scene);\n moveColumnFromCornerHeaderToColHeader(scene);\n }\n } else if (scene.frozenColCount < scene.table.rowHeaderLevelCount) {\n // move columnGroup from bodyGroup into rowHeaderGroup(from colHeaderGroup into cornerHeaderGroup)\n scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);\n scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);\n scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);\n for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.frozenColCount; i++) {\n moveColumnFromBodyToRowHeader(scene);\n moveColumnFromColHeaderToCornerHeader(scene);\n }\n }\n scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);\n scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);\n\n scene.updateContainer();\n scene.updateBorderSizeAndPosition();\n\n if (!scene.isPivot && !scene.transpose) {\n scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);\n }\n scene.hasFrozen = true;\n\n // scene.frozenColCount = scene.rowHeaderGroup.childrenCount;\n scene.frozenColCount = scene.table.rowHeaderLevelCount;\n scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;\n}\n\nfunction moveColumnFromBodyToRowHeader(scene: Scenegraph) {\n // deal with bodyGroup\n const column = scene.bodyGroup.firstChild instanceof Group ? scene.bodyGroup.firstChild : null;\n if (column) {\n scene.rowHeaderGroup.appendChild(column);\n // update container width\n scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width + column.attribute.width);\n scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width - column.attribute.width);\n }\n}\n\nfunction moveColumnFromColHeaderToCornerHeader(scene: Scenegraph) {\n // deal width colHeaderGroup\n const headerColumn = scene.colHeaderGroup.firstChild instanceof Group ? scene.colHeaderGroup.firstChild : null;\n if (headerColumn) {\n scene.cornerHeaderGroup.appendChild(headerColumn);\n scene.cornerHeaderGroup.setAttribute(\n 'width',\n scene.cornerHeaderGroup.attribute.width + headerColumn.attribute.width\n );\n scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width - headerColumn.attribute.width);\n }\n}\n\nfunction moveColumnFromRowHeaderToBody(scene: Scenegraph) {\n const column =\n scene.rowHeaderGroup.lastChild instanceof Group\n ? scene.rowHeaderGroup.lastChild\n : (scene.rowHeaderGroup.lastChild?._prev as Group);\n if (column) {\n if (scene.bodyGroup.firstChild) {\n scene.bodyGroup.insertBefore(column, scene.bodyGroup.firstChild);\n } else {\n scene.bodyGroup.appendChild(column);\n }\n // 更新容器宽度\n scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width + column.attribute.width);\n scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width - column.attribute.width);\n }\n}\n\nfunction moveColumnFromCornerHeaderToColHeader(scene: Scenegraph) {\n // 处理列表头\n const headerColumn =\n scene.cornerHeaderGroup.lastChild instanceof Group\n ? scene.cornerHeaderGroup.lastChild\n : (scene.cornerHeaderGroup.lastChild?._prev as Group);\n if (headerColumn) {\n if (scene.colHeaderGroup.firstChild) {\n scene.colHeaderGroup.insertBefore(headerColumn, scene.colHeaderGroup.firstChild);\n } else {\n scene.bodyGroup.appendChild(headerColumn);\n }\n scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width + headerColumn.attribute.width);\n scene.cornerHeaderGroup.setAttribute(\n 'width',\n scene.cornerHeaderGroup.attribute.width - headerColumn.attribute.width\n );\n }\n}\n"]}
@@ -9,7 +9,7 @@ const image_cell_1 = require("../group-creater/cell-type/image-cell"), progress_
9
9
  function updateColWidth(scene, col, detaX) {
10
10
  const {autoRowHeight: autoRowHeight} = scene.table.internalProps;
11
11
  let needRerangeRow = !1;
12
- const colOrCornerHeaderColumn = scene.getColGroup(col, !0), oldColOrCornerHeaderColumnWidth = colOrCornerHeaderColumn.attribute.width;
12
+ const colOrCornerHeaderColumn = scene.getColGroup(col, !0), oldColOrCornerHeaderColumnWidth = null == colOrCornerHeaderColumn ? void 0 : colOrCornerHeaderColumn.attribute.width;
13
13
  if (null == colOrCornerHeaderColumn || colOrCornerHeaderColumn.setAttribute("width", oldColOrCornerHeaderColumnWidth + detaX),
14
14
  null == colOrCornerHeaderColumn || colOrCornerHeaderColumn.forEachChildren(((cell, index) => {
15
15
  if (updateCellWidth(scene, cell, col, cell.row, oldColOrCornerHeaderColumnWidth, detaX, index < scene.table.columnHeaderLevelCount, autoRowHeight)) {
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/layout/update-width.ts"],"names":[],"mappings":";;;AAIA,sEAA0F;AAC1F,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAmE;AACnE,mDAAyD;AAUzD,SAAgB,cAAc,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAW1E,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC;IACpD,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,MAAM,uBAAuB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAU,CAAC;IACtE,MAAM,+BAA+B,GAAG,uBAAuB,CAAC,SAAS,CAAC,KAAK,CAAC;IAChF,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,YAAY,CAAC,OAAO,EAAE,+BAA+B,GAAG,KAAK,CAAC,CAAC;IAExF,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,eAAe,CAAC,CAAC,IAAW,EAAE,KAAa,EAAE,EAAE;QACtE,MAAM,cAAc,GAAG,eAAe,CACpC,KAAK,EACL,IAAI,EACJ,GAAG,EAEH,IAAI,CAAC,GAAG,EACR,+BAA+B,EAC/B,KAAK,EAEL,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,sBAAsB,EAC1C,aAAa,CACd,CAAC;QACF,IAAI,cAAc,EAAE;YAClB,MAAM,SAAS,GAAG,IAAA,iCAAgB,EAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YACpE,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE;gBACxD,KAAK,IAAI,GAAG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,CAAC,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,OAAiB,CAAC,CAAC;IAC9F,OAAO,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC","file":"update-width.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport type { Group } from '../graphic/group';\nimport type { Icon } from '../graphic/icon';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { updateCellHeightForRow } from './update-height';\n// import { updateAutoRowHeight } from './auto-height';\n\n/**\n * @description: 更新指定列列宽,在拖拽调整列宽中使用\n * @param {Scenegraph} scene\n * @param {number} col\n * @param {number} detaX\n * @return {*}\n */\nexport function updateColWidth(scene: Scenegraph, col: number, detaX: number) {\n // getColWidth会进行Math.round,所以先从colWidthsMap获取:\n // 如果是数值,直接使用;如果不是,则通过getColWidth获取像素值\n // const widthCache = (scene.table as any).colWidthsMap.get(col);\n // let width = 0;\n // if (typeof widthCache === 'number') {\n // width = widthCache;\n // } else {\n // width = scene.table.getColWidth(col);\n // }\n\n const { autoRowHeight } = scene.table.internalProps;\n let needRerangeRow = false;\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const oldColOrCornerHeaderColumnWidth = colOrCornerHeaderColumn.attribute.width;\n colOrCornerHeaderColumn?.setAttribute('width', oldColOrCornerHeaderColumnWidth + detaX);\n // 更新单元格宽度\n colOrCornerHeaderColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n col,\n // index,\n cell.row,\n oldColOrCornerHeaderColumnWidth,\n detaX,\n // true\n index < scene.table.columnHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, true);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(0, newTotalHeight - scene.colHeaderGroup.attribute.height);\n }\n\n needRerangeRow = false;\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n const oldRowHeaderOrBodyColumn = rowHeaderOrBodyColumn.attribute.width;\n rowHeaderOrBodyColumn?.setAttribute('width', oldRowHeaderOrBodyColumn + detaX);\n rowHeaderOrBodyColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n // col + (!isRowHeader ? scene.table.frozenColCount : 0),\n cell.col,\n // index + scene.table.frozenRowCount,\n cell.row,\n oldRowHeaderOrBodyColumn,\n detaX,\n // isRowHeader\n col < scene.table.rowHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, false);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n }\n\n // 更新剩余列位置\n if (col < scene.frozenColCount) {\n scene.cornerHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.rowHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n } else {\n scene.colHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.bodyGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n width: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoRowHeight: boolean\n): boolean {\n let cellGroup;\n let distWidth;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col) {\n // 更新横向merge cell width\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellWidth = mergeCell.attribute.width;\n mergeCell.setAttribute('width', mergeCellWidth + detaX);\n\n cellGroup = mergeCell;\n distWidth = mergeCell.attribute.width;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (mergeInfo && mergeInfo.start.row === row) {\n // 更新纵向merge cell width,只更新一次\n cell.setAttribute('width', width + detaX);\n\n cellGroup = cell;\n distWidth = width + detaX;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (!mergeInfo) {\n cell.setAttribute('width', width + detaX);\n cellGroup = cell;\n distWidth = width + detaX;\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n let isHeightChange = false;\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cellGroup.attribute.width,\n // cellGroup.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cellGroup.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cellGroup.insertBefore(newBarCell, oldBarCell);\n cellGroup.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cellGroup.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cellGroup,\n cellGroup.parent,\n cellGroup.attribute.x,\n cellGroup.attribute.y,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table\n );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n updateImageCellContentWhileResize(cellGroup, col, row, scene.table);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n isHeightChange = updateCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n }\n\n return isHeightChange;\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n let maxHeight = 0;\n // 获取高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.highPerformanceGetCell(col, row);\n let cellHeight = getCleanCellHeight(cell, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cellHeight = cellHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n }\n maxHeight = Math.max(maxHeight, cellHeight);\n }\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n let distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) {\n if (rowIndex !== row) {\n distHeight += scene.table.getRowHeight(rowIndex);\n }\n }\n }\n updateCellHeightForRow(scene, cell, col, row, distHeight, 0, scene.table.isHeader(col, row));\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, maxHeight, true);\n}\n\nfunction getCleanCellHeight(cell: Group, scene: Scenegraph) {\n let maxHeight = 0;\n cell.forEachChildren((child: Icon) => {\n if (\n child.role === 'icon-left' ||\n child.role === 'icon-right' ||\n child.name === 'text' ||\n child.name === 'content'\n ) {\n maxHeight = Math.max(maxHeight, child.AABBBounds.height());\n }\n });\n\n const padding = getQuadProps(scene.table._getCellStyle(cell.col, cell.row).padding as number);\n return maxHeight + padding[0] + padding[2];\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/layout/update-width.ts"],"names":[],"mappings":";;;AAIA,sEAA0F;AAC1F,oFAAqF;AACrF,gFAAsF;AAEtF,4DAA2D;AAC3D,gDAA4C;AAC5C,8CAAgD;AAChD,gEAAmE;AACnE,mDAAyD;AAUzD,SAAgB,cAAc,CAAC,KAAiB,EAAE,GAAW,EAAE,KAAa;IAW1E,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC;IACpD,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,MAAM,uBAAuB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAU,CAAC;IACtE,MAAM,+BAA+B,GAAG,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,SAAS,CAAC,KAAK,CAAC;IACjF,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,YAAY,CAAC,OAAO,EAAE,+BAA+B,GAAG,KAAK,CAAC,CAAC;IAExF,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,eAAe,CAAC,CAAC,IAAW,EAAE,KAAa,EAAE,EAAE;QACtE,MAAM,cAAc,GAAG,eAAe,CACpC,KAAK,EACL,IAAI,EACJ,GAAG,EAEH,IAAI,CAAC,GAAG,EACR,+BAA+B,EAC/B,KAAK,EAEL,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,sBAAsB,EAC1C,aAAa,CACd,CAAC;QACF,IAAI,cAAc,EAAE;YAClB,MAAM,S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C,eAAe,CAAC,CAAC,KAAW,EAAE,EAAE;QACnC,IACE,KAAK,CAAC,IAAI,KAAK,WAAW;YAC1B,KAAK,CAAC,IAAI,KAAK,YAAY;YAC3B,KAAK,CAAC,IAAI,KAAK,MAAM;YACrB,KAAK,CAAC,IAAI,KAAK,SAAS,EACxB;YACA,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,OAAiB,CAAC,CAAC;IAC9F,OAAO,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC","file":"update-width.js","sourcesContent":["import type { ProgressBarStyle } from '../../body-helper/style/ProgressBarStyle';\nimport type { IProgressbarColumnBodyDefine } from '../../ts-types/list-table/define/progressbar-define';\nimport type { Group } from '../graphic/group';\nimport type { Icon } from '../graphic/icon';\nimport { updateImageCellContentWhileResize } from '../group-creater/cell-type/image-cell';\nimport { createProgressBarCell } from '../group-creater/cell-type/progress-bar-cell';\nimport { createSparkLineCellGroup } from '../group-creater/cell-type/spark-line-cell';\nimport type { Scenegraph } from '../scenegraph';\nimport { getCellMergeInfo } from '../utils/get-cell-merge';\nimport { getProp } from '../utils/get-prop';\nimport { getQuadProps } from '../utils/padding';\nimport { updateCellContentWidth } from '../utils/text-icon-layout';\nimport { updateCellHeightForRow } from './update-height';\n// import { updateAutoRowHeight } from './auto-height';\n\n/**\n * @description: 更新指定列列宽,在拖拽调整列宽中使用\n * @param {Scenegraph} scene\n * @param {number} col\n * @param {number} detaX\n * @return {*}\n */\nexport function updateColWidth(scene: Scenegraph, col: number, detaX: number) {\n // getColWidth会进行Math.round,所以先从colWidthsMap获取:\n // 如果是数值,直接使用;如果不是,则通过getColWidth获取像素值\n // const widthCache = (scene.table as any).colWidthsMap.get(col);\n // let width = 0;\n // if (typeof widthCache === 'number') {\n // width = widthCache;\n // } else {\n // width = scene.table.getColWidth(col);\n // }\n\n const { autoRowHeight } = scene.table.internalProps;\n let needRerangeRow = false;\n const colOrCornerHeaderColumn = scene.getColGroup(col, true) as Group;\n const oldColOrCornerHeaderColumnWidth = colOrCornerHeaderColumn?.attribute.width;\n colOrCornerHeaderColumn?.setAttribute('width', oldColOrCornerHeaderColumnWidth + detaX);\n // 更新单元格宽度\n colOrCornerHeaderColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n col,\n // index,\n cell.row,\n oldColOrCornerHeaderColumnWidth,\n detaX,\n // true\n index < scene.table.columnHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, true);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(0, newTotalHeight - scene.colHeaderGroup.attribute.height);\n }\n\n needRerangeRow = false;\n const rowHeaderOrBodyColumn = scene.getColGroup(col) as Group;\n const oldRowHeaderOrBodyColumn = rowHeaderOrBodyColumn.attribute.width;\n rowHeaderOrBodyColumn?.setAttribute('width', oldRowHeaderOrBodyColumn + detaX);\n rowHeaderOrBodyColumn?.forEachChildren((cell: Group, index: number) => {\n const isHeightChange = updateCellWidth(\n scene,\n cell,\n // col + (!isRowHeader ? scene.table.frozenColCount : 0),\n cell.col,\n // index + scene.table.frozenRowCount,\n cell.row,\n oldRowHeaderOrBodyColumn,\n detaX,\n // isRowHeader\n col < scene.table.rowHeaderLevelCount,\n autoRowHeight\n );\n if (isHeightChange) {\n const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {\n resetRowHeight(scene, row);\n }\n } else {\n resetRowHeight(scene, cell.row);\n }\n needRerangeRow = true;\n }\n });\n\n if (needRerangeRow) {\n let newTotalHeight = 0;\n for (let col = 0; col < scene.table.colCount; col++) {\n const colGroup = scene.getColGroup(col, false);\n let y = 0;\n colGroup.forEachChildren((cellGroup: Group) => {\n if (cellGroup.role !== 'cell') {\n return;\n }\n cellGroup.setAttribute('y', y);\n y += cellGroup.attribute.height;\n });\n newTotalHeight = y;\n }\n scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);\n }\n\n // 更新剩余列位置\n if (col < scene.frozenColCount) {\n scene.cornerHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.rowHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n } else {\n scene.colHeaderGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n scene.bodyGroup.forEachChildrenSkipChild((column: Group, index) => {\n if (column.col > col) {\n column.setAttribute('x', column.attribute.x + detaX);\n }\n });\n }\n\n scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);\n}\n\n/**\n * @description: 更新单个单元格宽度\n * @return {*}\n */\nfunction updateCellWidth(\n scene: Scenegraph,\n cell: Group,\n col: number,\n row: number,\n width: number, // old width, not dist\n detaX: number,\n isHeader: boolean,\n // autoColWidth: boolean,\n autoRowHeight: boolean\n): boolean {\n let cellGroup;\n let distWidth;\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n // TO BE FIXED 这里使用横向和纵向来判断单元格merge情况,目前没有横纵都merge的情况,\n // 如果有这里的逻辑要修改\n if (mergeInfo && mergeInfo.end.col - mergeInfo.start.col) {\n // 更新横向merge cell width\n const mergeCell = scene.getCell(mergeInfo.start.col, mergeInfo.start.row);\n const mergeCellWidth = mergeCell.attribute.width;\n mergeCell.setAttribute('width', mergeCellWidth + detaX);\n\n cellGroup = mergeCell;\n distWidth = mergeCell.attribute.width;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (mergeInfo && mergeInfo.start.row === row) {\n // 更新纵向merge cell width,只更新一次\n cell.setAttribute('width', width + detaX);\n\n cellGroup = cell;\n distWidth = width + detaX;\n col = cellGroup.col;\n row = cellGroup.row;\n } else if (!mergeInfo) {\n cell.setAttribute('width', width + detaX);\n cellGroup = cell;\n distWidth = width + detaX;\n }\n\n if (!cellGroup) {\n // 合并单元格非主单元格,不处理\n return false;\n }\n\n // 更新单元格布局\n const type = scene.table.isHeader(col, row)\n ? scene.table._getHeaderLayoutMap(col, row).headerType\n : scene.table.getBodyColumnType(col, row);\n let isHeightChange = false;\n if (type === 'progressbar') {\n // 目前先采用重新生成节点的方案\n const columnDefine = scene.table.getBodyColumnDefine(col, row) as IProgressbarColumnBodyDefine;\n const style = scene.table._getCellStyle(col, row) as ProgressBarStyle;\n const value = scene.table.getCellValue(col, row);\n const dataValue = scene.table.getCellOriginValue(col, row);\n const padding = getQuadProps(getProp('padding', style, col, row, scene.table));\n\n const newBarCell = createProgressBarCell(\n columnDefine,\n style,\n cellGroup.attribute.width,\n // cellGroup.attribute.height,\n value,\n dataValue,\n col,\n row,\n padding,\n scene.table\n );\n\n const oldBarCell = cellGroup.getChildByName('progress-bar') as Group;\n // cell.replaceChild(newBarCell, oldBarCell);\n cellGroup.insertBefore(newBarCell, oldBarCell);\n cellGroup.removeChild(oldBarCell);\n oldBarCell.removeAllChild();\n oldBarCell.release();\n } else if (type === 'sparkline') {\n // 目前先采用重新生成节点的方案\n cellGroup.removeAllChild();\n const headerStyle = scene.table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, scene.table));\n createSparkLineCellGroup(\n cellGroup,\n cellGroup.parent,\n cellGroup.attribute.x,\n cellGroup.attribute.y,\n col,\n row,\n cellGroup.attribute.width,\n cellGroup.attribute.height,\n padding,\n scene.table\n );\n } else if (type === 'image' || type === 'video') {\n // // 只更新背景边框\n // const rect = cell.firstChild as Rect;\n // rect.setAttribute('width', cell.attribute.width);\n updateImageCellContentWhileResize(cellGroup, col, row, scene.table);\n } else {\n // 处理文字\n const style = scene.table._getCellStyle(col, row);\n isHeightChange = updateCellContentWidth(\n cellGroup,\n distWidth,\n detaX,\n autoRowHeight,\n getQuadProps(style.padding as number),\n style.textAlign,\n style.textBaseline,\n scene\n );\n }\n\n return isHeightChange;\n}\n\n/**\n * @description: 重置指定行行高\n * @param {Scenegraph} scene\n * @param {number} row\n * @return {*}\n */\nfunction resetRowHeight(scene: Scenegraph, row: number) {\n let maxHeight = 0;\n // 获取高度\n for (let col = 0; col < scene.table.colCount; col++) {\n const cell = scene.highPerformanceGetCell(col, row);\n let cellHeight = getCleanCellHeight(cell, scene);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n cellHeight = cellHeight / (mergeInfo.end.row - mergeInfo.start.row + 1);\n }\n maxHeight = Math.max(maxHeight, cellHeight);\n }\n\n // 更新高度\n for (let col = 0; col < scene.table.colCount; col++) {\n let distHeight = maxHeight;\n const cell = scene.highPerformanceGetCell(col, row);\n const mergeInfo = getCellMergeInfo(scene.table, col, row);\n if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {\n for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) {\n if (rowIndex !== row) {\n distHeight += scene.table.getRowHeight(rowIndex);\n }\n }\n }\n updateCellHeightForRow(scene, cell, col, row, distHeight, 0, scene.table.isHeader(col, row));\n }\n\n // 更新table行高存储\n scene.table.setRowHeight(row, maxHeight, true);\n}\n\nfunction getCleanCellHeight(cell: Group, scene: Scenegraph) {\n let maxHeight = 0;\n cell.forEachChildren((child: Icon) => {\n if (\n child.role === 'icon-left' ||\n child.role === 'icon-right' ||\n child.name === 'text' ||\n child.name === 'content'\n ) {\n maxHeight = Math.max(maxHeight, child.AABBBounds.height());\n }\n });\n\n const padding = getQuadProps(scene.table._getCellStyle(cell.col, cell.row).padding as number);\n return maxHeight + padding[0] + padding[2];\n}\n"]}
@@ -5,15 +5,15 @@ function updateChartSize(scenegraph, col) {
5
5
  for (let c = col; c < scenegraph.table.colCount; c++) {
6
6
  const columnGroup = scenegraph.getColGroup(c);
7
7
  (null === (_a = columnGroup.attribute) || void 0 === _a ? void 0 : _a.chartInstance) && columnGroup.getChildren().forEach((cellNode => {
8
- const width = cellNode.AABBBounds.width(), height = cellNode.AABBBounds.height();
8
+ const width = scenegraph.table.getColWidth(cellNode.col), height = scenegraph.table.getRowHeight(cellNode.row);
9
9
  cellNode.children.forEach((node => {
10
10
  "chart" === node.type && (node.cacheCanvas = null, node.setAttribute("width", Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])),
11
11
  node.setAttribute("height", Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])),
12
12
  node.setAttribute("viewBox", {
13
- x1: Math.ceil(cellNode.globalAABBBounds.x1 + scenegraph.table.tableX + node.attribute.cellPadding[3] + scenegraph.table.scrollLeft),
14
- x2: Math.ceil(cellNode.globalAABBBounds.x1 + width + scenegraph.table.tableX - node.attribute.cellPadding[1] + scenegraph.table.scrollLeft),
15
- y1: Math.ceil(cellNode.globalAABBBounds.y1 + scenegraph.table.tableY + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),
16
- y2: Math.ceil(cellNode.globalAABBBounds.y1 + height + scenegraph.table.tableY - node.attribute.cellPadding[2] + scenegraph.table.scrollTop)
13
+ x1: Math.ceil(cellNode.globalAABBBounds.x1 + node.attribute.cellPadding[3] + scenegraph.table.scrollLeft),
14
+ x2: Math.ceil(cellNode.globalAABBBounds.x1 + width - node.attribute.cellPadding[1] + scenegraph.table.scrollLeft),
15
+ y1: Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),
16
+ y2: Math.ceil(cellNode.globalAABBBounds.y1 + height - node.attribute.cellPadding[2] + scenegraph.table.scrollTop)
17
17
  }));
18
18
  }));
19
19
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/refresh-node/update-chart.ts"],"names":[],"mappings":";;;AAKA,SAAgB,eAAe,CAAC,UAAsB,EAAE,GAAW;;IAEjE,KAAK,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE;QACpD,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC9C,MAAM,aAAa,GAAG,MAAC,WAAW,CAAC,SAAiB,0CAAE,aAAa,CAAC;QACpE,IAAI,aAAa,EAAE;YAEjB,WAAW,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,QAAe,EAAE,EAAE;gBACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;gBAC1C,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;gBAE5C,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAW,EAAE,EAAE;oBACxC,IAAK,IAAY,CAAC,IAAI,KAAK,OAAO,EAAE;wBAClC,IAAI,CAAC,WAAW,GAAG,IAA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vB,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;gCAC7B,UAAU,CAAC,KAAK,CAAC,SAAS,CAC7B;yBACF,CAAC,CAAC;qBACJ;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;KACF;AACH,CAAC;AAxDD,0CAwDC","file":"update-chart.js","sourcesContent":["import type { Chart } from '../graphic/chart';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSize(scenegraph: Scenegraph, col: number) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = col; c < scenegraph.table.colCount; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n const chartInstance = (columnGroup.attribute as any)?.chartInstance;\n if (chartInstance) {\n // chartInstance.updateViewBox();\n columnGroup.getChildren().forEach((cellNode: Group) => {\n const width = cellNode.AABBBounds.width();\n const height = cellNode.AABBBounds.height();\n\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n node.cacheCanvas = null;\n node.setAttribute(\n 'width',\n Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])\n );\n node.setAttribute(\n 'height',\n Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n );\n\n node.setAttribute('viewBox', {\n x1: Math.ceil(\n cellNode.globalAABBBounds.x1 +\n scenegraph.table.tableX +\n node.attribute.cellPadding[3] +\n scenegraph.table.scrollLeft\n ),\n x2: Math.ceil(\n cellNode.globalAABBBounds.x1 +\n width +\n scenegraph.table.tableX -\n node.attribute.cellPadding[1] +\n scenegraph.table.scrollLeft\n ),\n y1: Math.ceil(\n cellNode.globalAABBBounds.y1 +\n scenegraph.table.tableY +\n node.attribute.cellPadding[0] +\n scenegraph.table.scrollTop\n ),\n y2: Math.ceil(\n cellNode.globalAABBBounds.y1 +\n height +\n scenegraph.table.t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AAW,CAAC,CAAC,CAAC,CAAC,CAClF,CAAC;wBAEF,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;4BAC3B,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC;4BACzG,EAAE,EAAE,IAAI,CAAC,IAAI,CACX,QAAQ,CAAC,gBAAgB,CAAC,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,UAAU,CACnG;4BACD,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC;4BACxG,EAAE,EAAE,IAAI,CAAC,IAAI,CACX,QAAQ,CAAC,gBAAgB,CAAC,EAAE,GAAG,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,CACnG;yBACF,CAAC,CAAC;qBACJ;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;KACF;AACH,CAAC;AAzDD,0CAyDC","file":"update-chart.js","sourcesContent":["import type { Chart } from '../graphic/chart';\nimport type { Group } from '../graphic/group';\nimport type { Scenegraph } from '../scenegraph';\n\n/** 供调整列宽后更新chart使用 */\nexport function updateChartSize(scenegraph: Scenegraph, col: number) {\n // 将调整列宽的后面的面也都一起需要调整viewbox。 TODO:columnResizeType支持后需要根据变化的列去调整,范围可能变多或者变少\n for (let c = col; c < scenegraph.table.colCount; c++) {\n const columnGroup = scenegraph.getColGroup(c);\n const chartInstance = (columnGroup.attribute as any)?.chartInstance;\n if (chartInstance) {\n // chartInstance.updateViewBox();\n columnGroup.getChildren().forEach((cellNode: Group) => {\n const width = scenegraph.table.getColWidth(cellNode.col);\n const height = scenegraph.table.getRowHeight(cellNode.row);\n\n cellNode.children.forEach((node: Chart) => {\n if ((node as any).type === 'chart') {\n // 调试问题使用\n // if (columnGroup.col === 2) {\n // columnGroup.AABBBounds.width();\n // node.AABBBounds.width();\n // console.log(\n // 'set viewbox y1',\n // Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),\n // node.globalAABBBounds.height()\n // );\n\n // console.log(\n // 'updateChartSize',\n // columnGroup,\n // columnGroup.globalAABBBounds.y1,\n // cellNode.globalAABBBounds.y1,\n // node.globalAABBBounds.y1\n // );\n // }\n\n node.cacheCanvas = null;\n node.setAttribute(\n 'width',\n Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1])\n );\n node.setAttribute(\n 'height',\n Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2])\n );\n\n node.setAttribute('viewBox', {\n x1: Math.ceil(cellNode.globalAABBBounds.x1 + node.attribute.cellPadding[3] + scenegraph.table.scrollLeft),\n x2: Math.ceil(\n cellNode.globalAABBBounds.x1 + width - node.attribute.cellPadding[1] + scenegraph.table.scrollLeft\n ),\n y1: Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),\n y2: Math.ceil(\n cellNode.globalAABBBounds.y1 + height - node.attribute.cellPadding[2] + scenegraph.table.scrollTop\n )\n });\n }\n });\n });\n }\n }\n}\n"]}
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", {
10
10
  value: !0
11
11
  }), exports.Scenegraph = void 0;
12
12
 
13
- const vrender_1 = require("@visactor/vrender"), ts_types_1 = require("../ts-types"), vutils_1 = require("@visactor/vutils"), group_1 = require("./graphic/group"), column_1 = require("./group-creater/column"), auto_height_1 = require("./layout/auto-height"), get_cell_merge_1 = require("./utils/get-cell-merge"), update_width_1 = require("./layout/update-width"), table_component_1 = require("./component/table-component"), update_height_1 = require("./layout/update-height"), image_cell_1 = require("./group-creater/cell-type/image-cell"), padding_1 = require("./utils/padding"), frame_border_1 = require("./style/frame-border"), global_1 = require("../tools/global"), contributions_1 = __importDefault(require("./graphic/contributions")), get_prop_1 = require("./utils/get-prop"), text_icon_layout_1 = require("./utils/text-icon-layout"), proxy_1 = require("./group-creater/progress/proxy"), compute_col_width_1 = require("./layout/compute-col-width"), move_cell_1 = require("./layout/move-cell"), cell_helper_1 = require("./group-creater/cell-helper"), update_select_border_1 = require("./select/update-select-border"), create_select_border_1 = require("./select/create-select-border"), move_select_border_1 = require("./select/move-select-border"), delete_select_border_1 = require("./select/delete-select-border"), update_row_1 = require("./layout/update-row"), stick_text_1 = require("./stick-text"), empty_group_1 = require("./utils/empty-group"), update_chart_1 = require("./refresh-node/update-chart");
13
+ const vrender_1 = require("@visactor/vrender"), ts_types_1 = require("../ts-types"), vutils_1 = require("@visactor/vutils"), group_1 = require("./graphic/group"), column_1 = require("./group-creater/column"), auto_height_1 = require("./layout/auto-height"), get_cell_merge_1 = require("./utils/get-cell-merge"), update_width_1 = require("./layout/update-width"), table_component_1 = require("./component/table-component"), update_height_1 = require("./layout/update-height"), image_cell_1 = require("./group-creater/cell-type/image-cell"), padding_1 = require("./utils/padding"), frame_border_1 = require("./style/frame-border"), global_1 = require("../tools/global"), contributions_1 = __importDefault(require("./graphic/contributions")), get_prop_1 = require("./utils/get-prop"), text_icon_layout_1 = require("./utils/text-icon-layout"), proxy_1 = require("./group-creater/progress/proxy"), compute_col_width_1 = require("./layout/compute-col-width"), move_cell_1 = require("./layout/move-cell"), cell_helper_1 = require("./group-creater/cell-helper"), update_select_border_1 = require("./select/update-select-border"), create_select_border_1 = require("./select/create-select-border"), move_select_border_1 = require("./select/move-select-border"), delete_select_border_1 = require("./select/delete-select-border"), update_row_1 = require("./layout/update-row"), stick_text_1 = require("./stick-text"), empty_group_1 = require("./utils/empty-group"), update_chart_1 = require("./refresh-node/update-chart"), frozen_1 = require("./layout/frozen");
14
14
 
15
15
  vrender_1.container.load(contributions_1.default);
16
16
 
@@ -155,6 +155,7 @@ class Scenegraph {
155
155
  createSceneGraph() {
156
156
  this.clear = !1, (0, compute_col_width_1.computeColsWidth)(this.table), this.frozenColCount = this.table.rowHeaderLevelCount,
157
157
  this.frozenRowCount = this.table.columnHeaderLevelCount, this.proxy = new proxy_1.SceneProxy(this.table),
158
+ (0, frame_border_1.createFrameBorder)(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, void 0, !0),
158
159
  this.createHeaderSceneGraph(), this.transpose || this.isPivot ? this.createBodySceneGraph() : this.createBodySceneGraphForFirstScreen();
159
160
  }
160
161
  createHeaderSceneGraph() {
@@ -328,7 +329,7 @@ class Scenegraph {
328
329
  iconBack && iconBack.setAttribute("visible", !1), icon.attribute.hoverImage && icon.attribute.image !== icon.attribute.originImage && (icon.image = icon.attribute.originImage);
329
330
  }
330
331
  updateColWidth(col, detaX) {
331
- (0, update_width_1.updateColWidth)(this, col, detaX), this.updateContainerWidth(col, detaX);
332
+ (0, update_width_1.updateColWidth)(this, col, detaX), this.updateContainer();
332
333
  }
333
334
  updateChartSize(col) {
334
335
  (0, update_chart_1.updateChartSize)(this, col);
@@ -448,51 +449,10 @@ class Scenegraph {
448
449
  });
449
450
  }
450
451
  dealFrozen() {
451
- var _a, _b, _c, _d, _e, _f;
452
- if (this.table.frozenColCount > this.table.rowHeaderLevelCount) {
453
- this.rowHeaderGroup.setAttribute("height", this.bodyGroup.attribute.height), this.rowHeaderGroup.setAttribute("y", this.bodyGroup.attribute.y),
454
- this.cornerHeaderGroup.setAttribute("height", this.colHeaderGroup.attribute.height);
455
- for (let i = 0; i < this.table.frozenColCount - this.table.rowHeaderLevelCount; i++) {
456
- const column = this.bodyGroup.firstChild;
457
- column && (this.rowHeaderGroup.appendChild(column), this.rowHeaderGroup.setAttribute("width", this.rowHeaderGroup.attribute.width + column.attribute.width),
458
- this.bodyGroup.setAttribute("width", this.bodyGroup.attribute.width - column.attribute.width));
459
- const headerColumn = this.colHeaderGroup.firstChild;
460
- headerColumn && (this.cornerHeaderGroup.appendChild(headerColumn), this.cornerHeaderGroup.setAttribute("width", this.cornerHeaderGroup.attribute.width + headerColumn.attribute.width),
461
- this.colHeaderGroup.setAttribute("width", this.colHeaderGroup.attribute.width - headerColumn.attribute.width));
462
- }
463
- }
464
- this.bodyGroup.setAttribute("x", this.rowHeaderGroup.attribute.width), this.colHeaderGroup.setAttribute("x", this.cornerHeaderGroup.attribute.width);
465
- const bodyDeltaX = null !== (_b = null === (_a = this.bodyGroup.firstChild) || void 0 === _a ? void 0 : _a.attribute.x) && void 0 !== _b ? _b : 0;
466
- this.bodyGroup.forEachChildrenSkipChild((column => {
467
- column.setAttribute("x", column.attribute.x - bodyDeltaX);
468
- }));
469
- const colDeltaX = null !== (_d = null === (_c = this.colHeaderGroup.firstChild) || void 0 === _c ? void 0 : _c.attribute.x) && void 0 !== _d ? _d : 0;
470
- this.colHeaderGroup.forEachChildrenSkipChild((column => {
471
- column.setAttribute("x", column.attribute.x - colDeltaX);
472
- })), this.updateBorderSizeAndPosition(), this.isPivot || this.transpose || this.component.setFrozenColumnShadow(this.table.frozenColCount - 1),
473
- this.hasFrozen = !0, this.frozenColCount = this.table.frozenColCount, this.frozenRowCount = null !== (_f = null === (_e = this.colHeaderGroup.firstChild) || void 0 === _e ? void 0 : _e.childrenCount) && void 0 !== _f ? _f : 0;
452
+ (0, frozen_1.dealFrozen)(this);
474
453
  }
475
454
  resetFrozen() {
476
- var _a, _b;
477
- if (this.frozenColCount > this.table.rowHeaderLevelCount) for (let i = 0; i < this.frozenColCount - this.table.rowHeaderLevelCount; i++) {
478
- const column = this.rowHeaderGroup.lastChild instanceof group_1.Group ? this.rowHeaderGroup.lastChild : this.rowHeaderGroup.lastChild._prev;
479
- column && (this.bodyGroup.insertBefore(column, this.bodyGroup.firstChild), this.bodyGroup.setAttribute("width", this.bodyGroup.attribute.width + column.attribute.width),
480
- this.rowHeaderGroup.setAttribute("width", this.rowHeaderGroup.attribute.width - column.attribute.width));
481
- const headerColumn = this.cornerHeaderGroup.lastChild instanceof group_1.Group ? this.cornerHeaderGroup.lastChild : this.cornerHeaderGroup.lastChild._prev;
482
- headerColumn && (this.colHeaderGroup.insertBefore(headerColumn, this.colHeaderGroup.firstChild),
483
- this.colHeaderGroup.setAttribute("width", this.colHeaderGroup.attribute.width + headerColumn.attribute.width),
484
- this.cornerHeaderGroup.setAttribute("width", this.cornerHeaderGroup.attribute.width - headerColumn.attribute.width));
485
- }
486
- this.bodyGroup.setAttribute("x", this.rowHeaderGroup.attribute.width), this.colHeaderGroup.setAttribute("x", this.cornerHeaderGroup.attribute.width);
487
- let bodyX = 0;
488
- this.bodyGroup.forEachChildrenSkipChild((column => {
489
- column.setAttribute("x", bodyX), bodyX += column.attribute.width;
490
- }));
491
- let colX = 0;
492
- this.colHeaderGroup.forEachChildrenSkipChild((column => {
493
- column.setAttribute("x", colX), colX += column.attribute.width;
494
- })), this.updateBorderSizeAndPosition(), this.isPivot || this.transpose || this.component.setFrozenColumnShadow(this.table.frozenColCount - 1),
495
- this.hasFrozen = !0, this.frozenColCount = this.table.rowHeaderLevelCount, this.frozenRowCount = null !== (_b = null === (_a = this.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : 0;
455
+ (0, frozen_1.resetFrozen)(this);
496
456
  }
497
457
  updateCellLayoutWidthCertainWidth(columnGroup, detaRow, col) {
498
458
  const width = columnGroup.attribute.width;
@@ -538,7 +498,7 @@ class Scenegraph {
538
498
  this.colHeaderGroup.setDeltaWidth(colHeaderX - this.colHeaderGroup.attribute.width),
539
499
  this.rowHeaderGroup.setDeltaWidth(rowHeaderX - this.rowHeaderGroup.attribute.width),
540
500
  this.bodyGroup.setDeltaWidth(bodyX - this.bodyGroup.attribute.width), this.colHeaderGroup.setAttribute("x", this.cornerHeaderGroup.attribute.width),
541
- this.bodyGroup.setAttribute("x", this.rowHeaderGroup.attribute.width);
501
+ this.bodyGroup.setAttribute("x", this.rowHeaderGroup.attribute.width), this.updateTableSize();
542
502
  const oldHorizontalBarPos = this.table.stateManeger.scroll.horizontalBarPos, oldVerticalBarPos = this.table.stateManeger.scroll.verticalBarPos;
543
503
  this.component.updateScrollBar(), this.table.stateManeger.setScrollLeft(oldHorizontalBarPos),
544
504
  this.table.stateManeger.setScrollTop(oldVerticalBarPos), this.updateNextFrame();
@@ -554,7 +514,7 @@ class Scenegraph {
554
514
  (0, frame_border_1.createFrameBorder)(this.rowHeaderGroup, this.isPivot ? this.table.theme.rowHeaderStyle.frameStyle : this.table.theme.bodyStyle.frameStyle, this.rowHeaderGroup.role, isListTableWithFrozen ? [ !0, !1, !0, !0 ] : void 0),
555
515
  (0, frame_border_1.createFrameBorder)(this.colHeaderGroup, this.table.theme.headerStyle.frameStyle, this.colHeaderGroup.role, isListTableWithFrozen ? [ !0, !0, !0, !1 ] : void 0),
556
516
  (0, frame_border_1.createFrameBorder)(this.cornerHeaderGroup, this.isPivot ? this.table.theme.cornerHeaderStyle.frameStyle : this.table.theme.headerStyle.frameStyle, this.cornerHeaderGroup.role, isListTableWithFrozen ? [ !0, !1, !0, !0 ] : void 0),
557
- (0, frame_border_1.createFrameBorder)(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role);
517
+ (0, frame_border_1.createFrameBorder)(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, void 0);
558
518
  }
559
519
  getResizeColAt(abstractX, abstractY, cellGroup, offset = global_1.ResizeColumnHotSpotSize / 2) {
560
520
  if (cellGroup) {