@visactor/vtable 1.26.4 → 1.26.6

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 (195) hide show
  1. package/cjs/ListTable.d.ts +5 -1
  2. package/cjs/ListTable.js +41 -11
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/body-helper/body-helper.d.ts +1 -0
  5. package/cjs/body-helper/body-helper.js +4 -3
  6. package/cjs/body-helper/body-helper.js.map +1 -1
  7. package/cjs/body-helper/style.js +2 -1
  8. package/cjs/components/legend/discrete-legend/discrete-legend.d.ts +1 -1
  9. package/cjs/core/BaseTable.d.ts +1 -0
  10. package/cjs/core/BaseTable.js +37 -27
  11. package/cjs/core/BaseTable.js.map +1 -1
  12. package/cjs/core/row-series-number-helper.d.ts +1 -0
  13. package/cjs/core/row-series-number-helper.js +3 -1
  14. package/cjs/core/row-series-number-helper.js.map +1 -1
  15. package/cjs/data/CachedDataSource.js +5 -3
  16. package/cjs/data/CachedDataSource.js.map +1 -1
  17. package/cjs/data/DataSource.js +1 -2
  18. package/cjs/dataset/DataStatistics.js +2 -1
  19. package/cjs/header-helper/header-helper.d.ts +1 -0
  20. package/cjs/header-helper/header-helper.js +4 -3
  21. package/cjs/header-helper/header-helper.js.map +1 -1
  22. package/cjs/header-helper/style.js +2 -1
  23. package/cjs/index.d.ts +1 -1
  24. package/cjs/index.js +1 -1
  25. package/cjs/index.js.map +1 -1
  26. package/cjs/plugins/custom-cell-style.js +1 -1
  27. package/cjs/plugins/interface.d.ts +2 -1
  28. package/cjs/plugins/interface.js.map +1 -1
  29. package/cjs/plugins/plugin-manager.d.ts +1 -1
  30. package/cjs/plugins/plugin-manager.js +11 -6
  31. package/cjs/plugins/plugin-manager.js.map +1 -1
  32. package/cjs/scenegraph/animation/appear.js +18 -3
  33. package/cjs/scenegraph/animation/appear.js.map +1 -1
  34. package/cjs/scenegraph/component/custom.js +3 -3
  35. package/cjs/scenegraph/component/custom.js.map +1 -1
  36. package/cjs/scenegraph/component/menu.js +4 -4
  37. package/cjs/scenegraph/component/menu.js.map +1 -1
  38. package/cjs/scenegraph/graphic/chart.d.ts +6 -1
  39. package/cjs/scenegraph/graphic/chart.js +38 -4
  40. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  41. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +2 -1
  42. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  43. package/cjs/scenegraph/graphic/group.d.ts +3 -1
  44. package/cjs/scenegraph/graphic/group.js +21 -3
  45. package/cjs/scenegraph/graphic/group.js.map +1 -1
  46. package/cjs/scenegraph/group-creater/cell-helper.js +4 -3
  47. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  48. package/cjs/scenegraph/group-creater/cell-type/button-cell.js +2 -2
  49. package/cjs/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
  50. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +4 -4
  51. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  52. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
  53. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  54. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +2 -2
  55. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  56. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
  57. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  58. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +2 -2
  59. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  60. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js +2 -2
  61. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -1
  62. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +6 -6
  63. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  64. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +10 -7
  65. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  66. package/cjs/scenegraph/group-creater/column-helper.js +3 -2
  67. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  68. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +24 -8
  69. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  70. package/cjs/scenegraph/layout/compute-row-height.js +15 -4
  71. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  72. package/cjs/scenegraph/layout/update-row.js +24 -3
  73. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  74. package/cjs/scenegraph/runtime-contributions.d.ts +2 -0
  75. package/cjs/scenegraph/runtime-contributions.js +28 -0
  76. package/cjs/scenegraph/runtime-contributions.js.map +1 -0
  77. package/cjs/scenegraph/scenegraph.d.ts +4 -1
  78. package/cjs/scenegraph/scenegraph.js +81 -35
  79. package/cjs/scenegraph/scenegraph.js.map +1 -1
  80. package/cjs/scenegraph/utils/text-icon-layout.d.ts +4 -0
  81. package/cjs/scenegraph/utils/text-icon-layout.js +27 -9
  82. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  83. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  84. package/cjs/state/checkbox/checkbox.d.ts +3 -0
  85. package/cjs/state/checkbox/checkbox.js +138 -2
  86. package/cjs/state/checkbox/checkbox.js.map +1 -1
  87. package/cjs/ts-types/base-table.d.ts +5 -1
  88. package/cjs/ts-types/base-table.js.map +1 -1
  89. package/cjs/ts-types/table-engine.d.ts +7 -1
  90. package/cjs/ts-types/table-engine.js.map +1 -1
  91. package/cjs/vrender-app.d.ts +20 -0
  92. package/cjs/vrender-app.js +141 -0
  93. package/cjs/vrender-app.js.map +1 -0
  94. package/cjs/vrender.d.ts +17 -1
  95. package/cjs/vrender.js +36 -15
  96. package/cjs/vrender.js.map +1 -1
  97. package/dist/vtable.js +106194 -96838
  98. package/dist/vtable.min.js +1 -1
  99. package/es/ListTable.d.ts +5 -1
  100. package/es/ListTable.js +41 -11
  101. package/es/ListTable.js.map +1 -1
  102. package/es/body-helper/body-helper.d.ts +1 -0
  103. package/es/body-helper/body-helper.js +4 -3
  104. package/es/body-helper/body-helper.js.map +1 -1
  105. package/es/body-helper/style.js +2 -1
  106. package/es/components/legend/discrete-legend/discrete-legend.d.ts +1 -1
  107. package/es/core/BaseTable.d.ts +1 -0
  108. package/es/core/BaseTable.js +39 -29
  109. package/es/core/BaseTable.js.map +1 -1
  110. package/es/core/row-series-number-helper.d.ts +1 -0
  111. package/es/core/row-series-number-helper.js +3 -1
  112. package/es/core/row-series-number-helper.js.map +1 -1
  113. package/es/data/CachedDataSource.js +5 -3
  114. package/es/data/CachedDataSource.js.map +1 -1
  115. package/es/data/DataSource.js +1 -2
  116. package/es/dataset/DataStatistics.js +2 -1
  117. package/es/header-helper/header-helper.d.ts +1 -0
  118. package/es/header-helper/header-helper.js +4 -3
  119. package/es/header-helper/header-helper.js.map +1 -1
  120. package/es/header-helper/style.js +2 -1
  121. package/es/index.d.ts +1 -1
  122. package/es/index.js +1 -1
  123. package/es/index.js.map +1 -1
  124. package/es/plugins/custom-cell-style.js +1 -1
  125. package/es/plugins/interface.d.ts +2 -1
  126. package/es/plugins/interface.js.map +1 -1
  127. package/es/plugins/plugin-manager.d.ts +1 -1
  128. package/es/plugins/plugin-manager.js +11 -6
  129. package/es/plugins/plugin-manager.js.map +1 -1
  130. package/es/scenegraph/animation/appear.js +18 -3
  131. package/es/scenegraph/animation/appear.js.map +1 -1
  132. package/es/scenegraph/component/custom.js +3 -3
  133. package/es/scenegraph/component/custom.js.map +1 -1
  134. package/es/scenegraph/component/menu.js +4 -4
  135. package/es/scenegraph/component/menu.js.map +1 -1
  136. package/es/scenegraph/graphic/chart.d.ts +6 -1
  137. package/es/scenegraph/graphic/chart.js +39 -3
  138. package/es/scenegraph/graphic/chart.js.map +1 -1
  139. package/es/scenegraph/graphic/contributions/chart-render-helper.js +2 -1
  140. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  141. package/es/scenegraph/graphic/group.d.ts +3 -1
  142. package/es/scenegraph/graphic/group.js +21 -3
  143. package/es/scenegraph/graphic/group.js.map +1 -1
  144. package/es/scenegraph/group-creater/cell-helper.js +4 -3
  145. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  146. package/es/scenegraph/group-creater/cell-type/button-cell.js +2 -2
  147. package/es/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
  148. package/es/scenegraph/group-creater/cell-type/chart-cell.js +4 -4
  149. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  150. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
  151. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  152. package/es/scenegraph/group-creater/cell-type/image-cell.js +2 -2
  153. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  154. package/es/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
  155. package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  156. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +2 -2
  157. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  158. package/es/scenegraph/group-creater/cell-type/switch-cell.js +2 -2
  159. package/es/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -1
  160. package/es/scenegraph/group-creater/cell-type/text-cell.js +5 -5
  161. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  162. package/es/scenegraph/group-creater/cell-type/video-cell.js +10 -7
  163. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  164. package/es/scenegraph/group-creater/column-helper.js +3 -2
  165. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  166. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +24 -8
  167. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  168. package/es/scenegraph/layout/compute-row-height.js +15 -4
  169. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  170. package/es/scenegraph/layout/update-row.js +25 -2
  171. package/es/scenegraph/layout/update-row.js.map +1 -1
  172. package/es/scenegraph/runtime-contributions.d.ts +2 -0
  173. package/es/scenegraph/runtime-contributions.js +20 -0
  174. package/es/scenegraph/runtime-contributions.js.map +1 -0
  175. package/es/scenegraph/scenegraph.d.ts +4 -1
  176. package/es/scenegraph/scenegraph.js +83 -35
  177. package/es/scenegraph/scenegraph.js.map +1 -1
  178. package/es/scenegraph/utils/text-icon-layout.d.ts +4 -0
  179. package/es/scenegraph/utils/text-icon-layout.js +25 -8
  180. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  181. package/es/scenegraph/utils/text-measure.js.map +1 -1
  182. package/es/state/checkbox/checkbox.d.ts +3 -0
  183. package/es/state/checkbox/checkbox.js +133 -0
  184. package/es/state/checkbox/checkbox.js.map +1 -1
  185. package/es/ts-types/base-table.d.ts +5 -1
  186. package/es/ts-types/base-table.js.map +1 -1
  187. package/es/ts-types/table-engine.d.ts +7 -1
  188. package/es/ts-types/table-engine.js.map +1 -1
  189. package/es/vrender-app.d.ts +20 -0
  190. package/es/vrender-app.js +161 -0
  191. package/es/vrender-app.js.map +1 -0
  192. package/es/vrender.d.ts +17 -1
  193. package/es/vrender.js +27 -8
  194. package/es/vrender.js.map +1 -1
  195. package/package.json +10 -9
@@ -10,6 +10,7 @@ export declare class BodyHelper {
10
10
  collapseIcon: SvgIcon;
11
11
  _table: BaseTableAPI;
12
12
  constructor(_table: BaseTableAPI);
13
+ updateIcons(): void;
13
14
  getIcons(col: number, row: number, cellValue: any, dataValue: any, context: CanvasRenderingContext2D): ColumnIconOption[];
14
15
  getStyleClass(cellType: 'text' | 'link' | 'image' | 'video' | 'chart' | 'sparkline' | 'progressbar' | 'chart' | 'checkbox' | 'radio' | 'switch' | 'button'): typeof Style | typeof RadioStyle | typeof SwitchStyle | typeof ButtonStyle | typeof CheckboxStyle;
15
16
  getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;
@@ -33,7 +33,9 @@ const ts_types_1 = require("../ts-types"), registerIcons = __importStar(require(
33
33
 
34
34
  class BodyHelper {
35
35
  constructor(_table) {
36
- this._table = _table;
36
+ this._table = _table, this.updateIcons();
37
+ }
38
+ updateIcons() {
37
39
  const regedIcons = registerIcons.get();
38
40
  this.expandIcon = regedIcons[ts_types_1.InternalIconName.expandIconName], this.collapseIcon = regedIcons[ts_types_1.InternalIconName.collapseIconName];
39
41
  }
@@ -117,5 +119,4 @@ class BodyHelper {
117
119
  }
118
120
  }
119
121
 
120
- exports.BodyHelper = BodyHelper;
121
- //# sourceMappingURL=body-helper.js.map
122
+ exports.BodyHelper = BodyHelper;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/body-helper/body-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA+D;AAC/D,wDAA0C;AAC1C,yCAAsC;AACtC,mEAAuD;AACvD,+DAA4D;AAC5D,mDAAgD;AAEhD,sDAAwC;AACxC,4CAAsC;AACtC,yDAAsD;AACtD,mDAAgD;AAChD,6CAA2C;AAC3C,qDAAkD;AAClD,qDAAkD;AAClD,MAAa,UAAU;IAIrB,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,CAAC;QAEvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,2BAAgB,CAAC,cAAc,CAAY,CAAC;QACzE,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,2BAAgB,CAAC,gBAAgB,CAAY,CAAC;IAC/E,CAAC;IACD,QAAQ,CACN,GAAW,EACX,GAAW,EACX,SAAc,EACd,SAAc,EACd,OAAiC;QAGjC,MAAM,OAAO,GAAuB,EAAE,CAAC;QAEvC,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG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U,CAAC,WAAW,mCAAI,CAAC,CAAC,CAAC;IACxG,CAAC;CACF;AApKD,gCAoKC","file":"body-helper.js","sourcesContent":["import type { ColumnIconOption, ImageIcon, ListTableAPI, SvgIcon } from '../ts-types';\nimport { HierarchyState, InternalIconName } from '../ts-types';\nimport * as registerIcons from '../icons';\nimport { Style } from './style/Style';\nimport { TextStyle } from './style/MultilineTextStyle';\nimport { ProgressBarStyle } from './style/ProgressBarStyle';\nimport { ImageStyle } from './style/ImageStyle';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport * as icons from '../tools/icons';\nimport { obj } from '../tools/helper';\nimport { CheckboxStyle } from './style/CheckboxStyle';\nimport { RadioStyle } from './style/RadioStyle';\nimport { isValid } from '@visactor/vutils';\nimport { SwitchStyle } from './style/SwitchStyle';\nimport { ButtonStyle } from './style/ButtonStyle';\nexport class BodyHelper {\n expandIcon: SvgIcon;\n collapseIcon: SvgIcon;\n _table: BaseTableAPI;\n constructor(_table: BaseTableAPI) {\n this._table = _table;\n const regedIcons = registerIcons.get();\n //展开折叠按钮\n this.expandIcon = regedIcons[InternalIconName.expandIconName] as SvgIcon;\n this.collapseIcon = regedIcons[InternalIconName.collapseIconName] as SvgIcon;\n }\n getIcons(\n col: number,\n row: number,\n cellValue: any,\n dataValue: any,\n context: CanvasRenderingContext2D\n ): ColumnIconOption[] {\n //加入固定列图标 排序 文本中元素\n const iconArr: ColumnIconOption[] = [];\n\n const hierarchyIcon = this.getHierarchyIcon(col, row);\n if (hierarchyIcon) {\n iconArr.push(hierarchyIcon);\n }\n\n const { icon: iconDefine } = this._table.getBodyColumnDefine(col, row);\n\n if (iconDefine) {\n let iconResults;\n if (typeof iconDefine === 'function') {\n const arg = {\n col,\n row,\n value: cellValue,\n dataValue,\n table: this._table\n };\n iconResults = iconDefine(arg);\n } else {\n iconResults = iconDefine;\n }\n const regedIcons = registerIcons.get();\n const addIcon = (columnIcon: string | ColumnIconOption) => {\n let icon;\n if (typeof columnIcon === 'string') {\n icon = regedIcons[columnIcon];\n } else {\n icon = columnIcon;\n }\n if (icon) {\n iconArr.push(icon);\n }\n };\n if (Array.isArray(iconResults)) {\n iconResults.forEach((columnIcon: string | ColumnIconOption, index: number) => {\n addIcon(columnIcon);\n });\n } else {\n addIcon(iconResults);\n }\n }\n\n context &&\n iconArr.forEach((i, index) => {\n if ((i as any).content || (<ImageIcon>i).src) {\n iconArr[index] = this.getCellIconFromRecordValue(i, col, row);\n // if ((<FontIcon>i).font)\n // helper.testFontLoad((<FontIcon>i).font, (<FontIcon>i).content, col, row);\n }\n });\n\n return iconArr;\n }\n getStyleClass(\n cellType:\n | 'text'\n | 'link'\n | 'image'\n | 'video'\n | 'chart'\n | 'sparkline'\n | 'progressbar'\n | 'chart'\n | 'checkbox'\n | 'radio'\n | 'switch'\n | 'button'\n ) {\n switch (cellType) {\n case 'text':\n return TextStyle;\n case 'image':\n return ImageStyle;\n case 'video':\n return ImageStyle;\n case 'link':\n return TextStyle;\n case 'chart':\n return Style;\n case 'sparkline':\n return Style;\n case 'progressbar':\n return ProgressBarStyle;\n case 'checkbox':\n return CheckboxStyle;\n case 'radio':\n return RadioStyle;\n case 'switch':\n return SwitchStyle;\n case 'button':\n return ButtonStyle;\n }\n return TextStyle;\n }\n getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;\n getCellIconFromRecordValue(icon: ColumnIconOption[], col: number, row: number): ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[] {\n if (Array.isArray(icon)) {\n return icon.map(i => this.getCellIconFromRecordValue(i, col, row));\n }\n // icon.positionType = IconPosition.inlineFront;\n if (!obj.isObject(icon) || typeof icon === 'function') {\n return (this._table as ListTableAPI).getFieldData(icon, col, row);\n }\n // 新建对象 挨个属性赋值\n const retIcon: any = {};\n const iconOpt: any = icon;\n icons.iconPropKeys.forEach(k => {\n if (typeof iconOpt[k] !== 'undefined') {\n const f = (this._table as ListTableAPI).getFieldData(iconOpt[k], col, row);\n if (isValid(f)) {\n retIcon[k] = f;\n } else if (!this._table._hasField?.(iconOpt[k], col, row)) {\n retIcon[k] = iconOpt[k];\n }\n }\n });\n return retIcon;\n }\n\n getHierarchyIcon(col: number, row: number) {\n const hierarchyState = this._table.getHierarchyState(col, row);\n if (hierarchyState === HierarchyState.expand) {\n //展开状态 应该显示-号\n return this.expandIcon;\n } else if (hierarchyState === HierarchyState.collapse) {\n //折叠状态 应该显示-号\n return this.collapseIcon;\n }\n return undefined;\n }\n getHierarchyIconWidth() {\n return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/body-helper/body-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA+D;AAC/D,wDAA0C;AAC1C,yCAAsC;AACtC,mEAAuD;AACvD,+DAA4D;AAC5D,mDAAgD;AAEhD,sDAAwC;AACxC,4CAAsC;AACtC,yDAAsD;AACtD,mDAAgD;AAChD,6CAA2C;AAC3C,qDAAkD;AAClD,qDAAkD;AAClD,MAAa,UAAU;IAIrB,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,WAAW;QACT,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,CAAC;QAEvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,2BAAgB,CAAC,cAAc,CAAY,CAAC;QACzE,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,2BAAgB,CAAC,gBAAgB,CAAY,CAAC;IAC/E,CAAC;IACD,QAAQ,CACN,GAAW,EACX,GAAW,EACX,SAAc,EACd,SAAc,EACd,O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GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,WAAW,mCAAI,CAAC,CAAC,CAAC;IACxG,CAAC;CACF;AAxKD,gCAwKC","file":"body-helper.js","sourcesContent":["import type { ColumnIconOption, ImageIcon, ListTableAPI, SvgIcon } from '../ts-types';\nimport { HierarchyState, InternalIconName } from '../ts-types';\nimport * as registerIcons from '../icons';\nimport { Style } from './style/Style';\nimport { TextStyle } from './style/MultilineTextStyle';\nimport { ProgressBarStyle } from './style/ProgressBarStyle';\nimport { ImageStyle } from './style/ImageStyle';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport * as icons from '../tools/icons';\nimport { obj } from '../tools/helper';\nimport { CheckboxStyle } from './style/CheckboxStyle';\nimport { RadioStyle } from './style/RadioStyle';\nimport { isValid } from '@visactor/vutils';\nimport { SwitchStyle } from './style/SwitchStyle';\nimport { ButtonStyle } from './style/ButtonStyle';\nexport class BodyHelper {\n expandIcon: SvgIcon;\n collapseIcon: SvgIcon;\n _table: BaseTableAPI;\n constructor(_table: BaseTableAPI) {\n this._table = _table;\n this.updateIcons();\n }\n\n updateIcons() {\n const regedIcons = registerIcons.get();\n //展开折叠按钮\n this.expandIcon = regedIcons[InternalIconName.expandIconName] as SvgIcon;\n this.collapseIcon = regedIcons[InternalIconName.collapseIconName] as SvgIcon;\n }\n getIcons(\n col: number,\n row: number,\n cellValue: any,\n dataValue: any,\n context: CanvasRenderingContext2D\n ): ColumnIconOption[] {\n //加入固定列图标 排序 文本中元素\n const iconArr: ColumnIconOption[] = [];\n\n const hierarchyIcon = this.getHierarchyIcon(col, row);\n if (hierarchyIcon) {\n iconArr.push(hierarchyIcon);\n }\n\n const { icon: iconDefine } = this._table.getBodyColumnDefine(col, row);\n\n if (iconDefine) {\n let iconResults;\n if (typeof iconDefine === 'function') {\n const arg = {\n col,\n row,\n value: cellValue,\n dataValue,\n table: this._table\n };\n iconResults = iconDefine(arg);\n } else {\n iconResults = iconDefine;\n }\n const regedIcons = registerIcons.get();\n const addIcon = (columnIcon: string | ColumnIconOption) => {\n let icon;\n if (typeof columnIcon === 'string') {\n icon = regedIcons[columnIcon];\n } else {\n icon = columnIcon;\n }\n if (icon) {\n iconArr.push(icon);\n }\n };\n if (Array.isArray(iconResults)) {\n iconResults.forEach((columnIcon: string | ColumnIconOption, index: number) => {\n addIcon(columnIcon);\n });\n } else {\n addIcon(iconResults);\n }\n }\n\n context &&\n iconArr.forEach((i, index) => {\n if ((i as any).content || (<ImageIcon>i).src) {\n iconArr[index] = this.getCellIconFromRecordValue(i, col, row);\n // if ((<FontIcon>i).font)\n // helper.testFontLoad((<FontIcon>i).font, (<FontIcon>i).content, col, row);\n }\n });\n\n return iconArr;\n }\n getStyleClass(\n cellType:\n | 'text'\n | 'link'\n | 'image'\n | 'video'\n | 'chart'\n | 'sparkline'\n | 'progressbar'\n | 'chart'\n | 'checkbox'\n | 'radio'\n | 'switch'\n | 'button'\n ) {\n switch (cellType) {\n case 'text':\n return TextStyle;\n case 'image':\n return ImageStyle;\n case 'video':\n return ImageStyle;\n case 'link':\n return TextStyle;\n case 'chart':\n return Style;\n case 'sparkline':\n return Style;\n case 'progressbar':\n return ProgressBarStyle;\n case 'checkbox':\n return CheckboxStyle;\n case 'radio':\n return RadioStyle;\n case 'switch':\n return SwitchStyle;\n case 'button':\n return ButtonStyle;\n }\n return TextStyle;\n }\n getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;\n getCellIconFromRecordValue(icon: ColumnIconOption[], col: number, row: number): ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[] {\n if (Array.isArray(icon)) {\n return icon.map(i => this.getCellIconFromRecordValue(i, col, row));\n }\n // icon.positionType = IconPosition.inlineFront;\n if (!obj.isObject(icon) || typeof icon === 'function') {\n return (this._table as ListTableAPI).getFieldData(icon, col, row);\n }\n // 新建对象 挨个属性赋值\n const retIcon: any = {};\n const iconOpt: any = icon;\n icons.iconPropKeys.forEach(k => {\n if (typeof iconOpt[k] !== 'undefined') {\n const f = (this._table as ListTableAPI).getFieldData(iconOpt[k], col, row);\n if (isValid(f)) {\n retIcon[k] = f;\n } else if (!this._table._hasField?.(iconOpt[k], col, row)) {\n retIcon[k] = iconOpt[k];\n }\n }\n });\n return retIcon;\n }\n\n getHierarchyIcon(col: number, row: number) {\n const hierarchyState = this._table.getHierarchyState(col, row);\n if (hierarchyState === HierarchyState.expand) {\n //展开状态 应该显示-号\n return this.expandIcon;\n } else if (hierarchyState === HierarchyState.collapse) {\n //折叠状态 应该显示-号\n return this.collapseIcon;\n }\n return undefined;\n }\n getHierarchyIconWidth() {\n return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);\n }\n}\n"]}
@@ -49,4 +49,5 @@ function of(columnStyle, bodyStyle, styleArg, StyleClassDef = Style_1.Style, glo
49
49
  StyleClassDef === CheckboxStyle_1.CheckboxStyle ? new CheckboxStyle_1.CheckboxStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : StyleClassDef === RadioStyle_1.RadioStyle ? new RadioStyle_1.RadioStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_b = theme.radioStyle) && void 0 !== _b ? _b : {}) : StyleClassDef === SwitchStyle_1.SwitchStyle ? new SwitchStyle_1.SwitchStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_c = theme.switchStyle) && void 0 !== _c ? _c : {}) : StyleClassDef === ButtonStyle_1.ButtonStyle ? new ButtonStyle_1.ButtonStyle(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {}, null !== (_d = theme.buttonStyle) && void 0 !== _d ? _d : {}) : new StyleClassDef(null != columnStyle ? columnStyle : {}, null != bodyStyle ? bodyStyle : {})) : StyleClassDef.DEFAULT;
50
50
  }
51
51
 
52
- exports.EVENT_TYPE = EVENT_TYPE, exports.of = of;
52
+ exports.EVENT_TYPE = EVENT_TYPE, exports.of = of;
53
+ //# sourceMappingURL=style.js.map
@@ -15,7 +15,7 @@ export declare class DiscreteTableLegend {
15
15
  resize(): void;
16
16
  adjustTableSize(attrs: any): void;
17
17
  getLegendAttributes(rect: any): any;
18
- getLegendItems(): import("@visactor/vrender-components/es/legend/discrete/type").LegendItemDatum[];
18
+ getLegendItems(): import("@visactor/vrender-components/legend/discrete/type").LegendItemDatum[];
19
19
  initEvent(): void;
20
20
  getLegendBounds(): {
21
21
  width: number;
@@ -352,6 +352,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
352
352
  get enableLineBreak(): boolean;
353
353
  set enableLineBreak(enableLineBreak: boolean);
354
354
  updateAutoWrapText(autoWrapText: boolean): void;
355
+ private _updateFunctionalIcons;
355
356
  get theme(): TableTheme;
356
357
  set theme(theme: TableTheme);
357
358
  updateTheme(theme: ITableThemeDefine): void;
@@ -35,6 +35,10 @@ Object.defineProperty(exports, "__esModule", {
35
35
 
36
36
  const columnStyleContents = __importStar(require("../body-helper/style")), style_1 = require("./style"), style = __importStar(require("../tools/style")), ts_types_1 = require("../ts-types"), helper_1 = require("../tools/helper"), TABLE_EVENT_TYPE_1 = require("./TABLE_EVENT_TYPE"), EventHandler_1 = require("../event/EventHandler"), EventTarget_1 = require("../event/EventTarget"), NumberMap_1 = require("../tools/NumberMap"), Rect_1 = require("../tools/Rect"), util_1 = require("../tools/util"), themes_1 = __importDefault(require("../themes")), env_1 = require("../tools/env"), scenegraph_1 = require("../scenegraph/scenegraph"), state_1 = require("../state/state"), event_1 = require("../event/event"), body_helper_1 = require("../body-helper/body-helper"), header_helper_1 = require("../header-helper/header-helper"), vutils_1 = require("@visactor/vutils"), text_measure_1 = require("../scenegraph/utils/text-measure"), get_prop_1 = require("../scenegraph/utils/get-prop"), tableHelper_1 = require("./tableHelper"), FouseInput_1 = require("./FouseInput"), pixel_ratio_1 = require("../tools/pixel-ratio"), chart_render_helper_1 = require("../scenegraph/graphic/contributions/chart-render-helper"), row_height_map_1 = require("../layout/row-height-map"), row_series_number_helper_1 = require("./row-series-number-helper"), update_select_border_1 = require("../scenegraph/select/update-select-border"), react_custom_layout_1 = require("../components/react/react-custom-layout"), layout_helper_1 = require("../layout/layout-helper"), factory_1 = require("./factory"), get_cell_position_1 = require("./utils/get-cell-position"), style_helper_1 = require("./style-helper"), frozen_react_1 = require("../scenegraph/layout/frozen-react"), icons_1 = require("../icons"), animation_1 = require("./animation"), check_in_select_1 = require("../state/common/check-in-select"), is_cell_select_highlight_1 = require("../state/select/is-cell-select-highlight"), get_custom_merge_cell_func_1 = require("./utils/get-custom-merge-cell-func"), vrender_1 = require("./../vrender"), plugin_manager_1 = require("../plugins/plugin-manager"), {toBoxArray: toBoxArray} = helper_1.style, {isTouchEvent: isTouchEvent} = helper_1.event, rangeReg = /^\$(\d+)\$(\d+)$/;
37
37
 
38
+ function normalizeCellType(cellType) {
39
+ return (0, vutils_1.isValid)(cellType) ? cellType : "text";
40
+ }
41
+
38
42
  (0, style_1.importStyle)();
39
43
 
40
44
  class BaseTable extends EventTarget_1.EventTarget {
@@ -45,7 +49,7 @@ class BaseTable extends EventTarget_1.EventTarget {
45
49
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
46
50
  if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0,
47
51
  this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0,
48
- this.version = "1.26.4", this.id = `VTable${Date.now()}`, this.isReleased = !1,
52
+ this.version = "1.26.6", this.id = `VTable${Date.now()}`, this.isReleased = !1,
49
53
  this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
50
54
  "undefined" != typeof window) {
51
55
  const g = window;
@@ -57,7 +61,7 @@ class BaseTable extends EventTarget_1.EventTarget {
57
61
  });
58
62
  registry.byId[this.id] = this, registry.list.push(this), registry.last = this, g.__vtable_last_id__ = this.id;
59
63
  }
60
- if ("node" === env_1.Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
64
+ if ("node" === env_1.Env.mode ? (options = container, container = null) : !container || container instanceof HTMLElement || (options = container,
61
65
  container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
62
66
  this.pluginManager = new plugin_manager_1.PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.BEFORE_INIT, {
63
67
  options: options,
@@ -137,7 +141,7 @@ class BaseTable extends EventTarget_1.EventTarget {
137
141
  return "node" === env_1.Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_b = null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : that.internalProps.pixelRatio) && void 0 !== _b ? _b : window.devicePixelRatio);
138
142
  }
139
143
  }, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes_1.default.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes_1.default.DEFAULT),
140
- internalProps.theme.isPivot = this.isPivotTable(), (0, icons_1.setIconColor)(internalProps.theme.functionalIconsStyle),
144
+ internalProps.theme.isPivot = this.isPivotTable(), this._updateFunctionalIcons(),
141
145
  container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element),
142
146
  this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new body_helper_1.BodyHelper(this),
143
147
  internalProps.headerHelper = new header_helper_1.HeaderHelper(this), internalProps.rowSeriesNumberHelper = new row_series_number_helper_1.RowSeriesNumberHelper(this),
@@ -902,7 +906,7 @@ class BaseTable extends EventTarget_1.EventTarget {
902
906
  }
903
907
  getBodyVisibleCellRange() {
904
908
  var _a, _b, _c, _d;
905
- const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, frozenColsContentWidth = this.getFrozenColsContentWidth(), frozenColsOffset = this.getFrozenColsOffset(), bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.getRightFrozenColsWidth(), rowStart = Math.max(null !== (_b = null === (_a = this.getTargetRowAt(scrollTop + 1)) || void 0 === _a ? void 0 : _a.row) && void 0 !== _b ? _b : -1, this.frozenRowCount), {col: colStart} = this.getColAt(scrollLeft + frozenColsContentWidth + 1), rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? Math.max(null !== (_d = null === (_c = this.getTargetRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight)) || void 0 === _c ? void 0 : _c.row) && void 0 !== _d ? _d : -1, rowStart) : this.rowCount - 1, colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + frozenColsOffset + this.tableNoFrameWidth - 1 - rightFrozenColsWidth).col : this.colCount - 1;
909
+ const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, frozenColsContentWidth = this.getFrozenColsContentWidth(), frozenColsOffset = this.getFrozenColsOffset(), bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.getRightFrozenColsWidth(), frozenHeaderHeight = this.frozenRowCount > this.columnHeaderLevelCount ? this.getRowsHeight(0, this.columnHeaderLevelCount - 1) : 0, rowStart = Math.max(null !== (_b = null === (_a = this.getTargetRowAt(scrollTop + 1)) || void 0 === _a ? void 0 : _a.row) && void 0 !== _b ? _b : -1, this.frozenRowCount), {col: colStart} = this.getColAt(scrollLeft + frozenColsContentWidth + 1), rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? Math.max(null !== (_d = null === (_c = this.getTargetRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight - frozenHeaderHeight)) || void 0 === _c ? void 0 : _c.row) && void 0 !== _d ? _d : -1, rowStart) : this.rowCount - 1, colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + frozenColsOffset + this.tableNoFrameWidth - 1 - rightFrozenColsWidth).col : this.colCount - 1;
906
910
  return colEnd < 0 || rowEnd < 0 ? null : {
907
911
  rowStart: rowStart,
908
912
  colStart: colStart,
@@ -912,7 +916,7 @@ class BaseTable extends EventTarget_1.EventTarget {
912
916
  }
913
917
  getBodyVisibleRowRange(start_deltaY = 0, end_deltaY = 0) {
914
918
  var _a, _b, _c, _d;
915
- const {scrollTop: scrollTop} = this, bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(), rowStart = Math.max(null !== (_b = null === (_a = this.getTargetRowAt(scrollTop + 1 + start_deltaY)) || void 0 === _a ? void 0 : _a.row) && void 0 !== _b ? _b : -1, this.frozenRowCount), rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? Math.max(null !== (_d = null === (_c = this.getTargetRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight + end_deltaY)) || void 0 === _c ? void 0 : _c.row) && void 0 !== _d ? _d : -1, rowStart) : this.rowCount - 1;
919
+ const {scrollTop: scrollTop} = this, bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(), frozenHeaderHeight = this.frozenRowCount > this.columnHeaderLevelCount ? this.getRowsHeight(0, this.columnHeaderLevelCount - 1) : 0, rowStart = Math.max(null !== (_b = null === (_a = this.getTargetRowAt(scrollTop + 1 + start_deltaY)) || void 0 === _a ? void 0 : _a.row) && void 0 !== _b ? _b : -1, this.frozenRowCount), rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? Math.max(null !== (_d = null === (_c = this.getTargetRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight - frozenHeaderHeight + end_deltaY)) || void 0 === _c ? void 0 : _c.row) && void 0 !== _d ? _d : -1, rowStart) : this.rowCount - 1;
916
920
  return rowEnd < 0 ? null : {
917
921
  rowStart: rowStart,
918
922
  rowEnd: rowEnd
@@ -976,7 +980,7 @@ class BaseTable extends EventTarget_1.EventTarget {
976
980
  this._scrollToRowCorrectTimer && (clearTimeout(this._scrollToRowCorrectTimer), this._scrollToRowCorrectTimer = null);
977
981
  }
978
982
  release() {
979
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
983
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
980
984
  if ("undefined" != typeof window) {
981
985
  const g = window;
982
986
  (null == g ? void 0 : g[this.id]) === this ? delete g[this.id] : (null == g ? void 0 : g[this.id]) && (g[this.id] = null);
@@ -990,29 +994,29 @@ class BaseTable extends EventTarget_1.EventTarget {
990
994
  if (this.isReleased) return;
991
995
  null === (_f = null === (_e = null === (_d = this.scenegraph) || void 0 === _d ? void 0 : _d.component) || void 0 === _e ? void 0 : _e.vScrollBar) || void 0 === _f || _f.release(),
992
996
  null === (_j = null === (_h = null === (_g = this.scenegraph) || void 0 === _g ? void 0 : _g.component) || void 0 === _h ? void 0 : _h.hScrollBar) || void 0 === _j || _j.release(),
993
- this.animationManager.clear(), this.animationManager.ticker.release(), null === (_m = null === (_l = null === (_k = this.scenegraph) || void 0 === _k ? void 0 : _k.stage) || void 0 === _l ? void 0 : _l.ticker) || void 0 === _m || _m.release();
997
+ this.animationManager.clear(), this.animationManager.ticker.release(), (null === (_k = this.scenegraph) || void 0 === _k ? void 0 : _k.stageOwned) && (null === (_o = null === (_m = null === (_l = this.scenegraph) || void 0 === _l ? void 0 : _l.stage) || void 0 === _m ? void 0 : _m.ticker) || void 0 === _o || _o.release());
994
998
  const internalProps = this.internalProps, canvas = null == internalProps ? void 0 : internalProps.canvas;
995
999
  (null == canvas ? void 0 : canvas.__vtable__) === this && (delete canvas.__vtable__,
996
1000
  delete canvas.__vtable_id__);
997
1001
  const element = null == internalProps ? void 0 : internalProps.element;
998
1002
  (null == element ? void 0 : element.__vtable__) === this && (delete element.__vtable__,
999
- delete element.__vtable_id__), this.clearCorrectTimer(), null === (_p = null === (_o = internalProps.tooltipHandler) || void 0 === _o ? void 0 : _o.release) || void 0 === _p || _p.call(_o),
1000
- null === (_r = null === (_q = internalProps.menuHandler) || void 0 === _q ? void 0 : _q.release) || void 0 === _r || _r.call(_q),
1001
- null === (_s = super.release) || void 0 === _s || _s.call(this), this.pluginManager.release(),
1002
- null === (_u = null === (_t = internalProps.handler) || void 0 === _t ? void 0 : _t.release) || void 0 === _u || _u.call(_t),
1003
- this.eventManager.release(), null === (_w = null === (_v = internalProps.focusControl) || void 0 === _v ? void 0 : _v.release) || void 0 === _w || _w.call(_v),
1004
- null === (_x = internalProps.legends) || void 0 === _x || _x.forEach((legend => {
1003
+ delete element.__vtable_id__), this.clearCorrectTimer(), null === (_q = null === (_p = internalProps.tooltipHandler) || void 0 === _p ? void 0 : _p.release) || void 0 === _q || _q.call(_p),
1004
+ null === (_s = null === (_r = internalProps.menuHandler) || void 0 === _r ? void 0 : _r.release) || void 0 === _s || _s.call(_r),
1005
+ null === (_t = super.release) || void 0 === _t || _t.call(this), this.pluginManager.release(),
1006
+ null === (_v = null === (_u = internalProps.handler) || void 0 === _u ? void 0 : _u.release) || void 0 === _v || _v.call(_u),
1007
+ this.eventManager.release(), null === (_x = null === (_w = internalProps.focusControl) || void 0 === _w ? void 0 : _w.release) || void 0 === _x || _x.call(_w),
1008
+ null === (_y = internalProps.legends) || void 0 === _y || _y.forEach((legend => {
1005
1009
  null == legend || legend.release();
1006
- })), null === (_y = internalProps.title) || void 0 === _y || _y.release(), internalProps.title = null,
1007
- null === (_z = internalProps.emptyTip) || void 0 === _z || _z.release(), internalProps.emptyTip = null,
1010
+ })), null === (_z = internalProps.title) || void 0 === _z || _z.release(), internalProps.title = null,
1011
+ null === (_0 = internalProps.emptyTip) || void 0 === _0 || _0.release(), internalProps.emptyTip = null,
1008
1012
  internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
1009
1013
  var _a;
1010
1014
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
1011
- })), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
1012
- const parentElement = null === (_0 = internalProps.element) || void 0 === _0 ? void 0 : _0.parentElement;
1015
+ })), internalProps.releaseList = null), this.scenegraph.releaseStage(), this.scenegraph.proxy.release();
1016
+ const parentElement = null === (_1 = internalProps.element) || void 0 === _1 ? void 0 : _1.parentElement;
1013
1017
  parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
1014
- null === (_3 = null === (_2 = null === (_1 = this.editorManager) || void 0 === _1 ? void 0 : _1.editingEditor) || void 0 === _2 ? void 0 : _2.onEnd) || void 0 === _3 || _3.call(_2),
1015
- this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_4 = this.reactCustomLayout) || void 0 === _4 || _4.clearCache(),
1018
+ null === (_4 = null === (_3 = null === (_2 = this.editorManager) || void 0 === _2 ? void 0 : _2.editingEditor) || void 0 === _3 ? void 0 : _3.onEnd) || void 0 === _4 || _4.call(_3),
1019
+ this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_5 = this.reactCustomLayout) || void 0 === _5 || _5.clearCache(),
1016
1020
  (0, chart_render_helper_1.clearChartRenderQueue)();
1017
1021
  }
1018
1022
  fireListeners(type, event) {
@@ -1078,7 +1082,7 @@ class BaseTable extends EventTarget_1.EventTarget {
1078
1082
  internalProps._rowHeightsMap = new row_height_map_1.NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map,
1079
1083
  internalProps._colRangeWidthsMap = new Map), internalProps.stick.changedCells.clear(),
1080
1084
  internalProps.theme = themes_1.default.of(null !== (_p = options.theme) && void 0 !== _p ? _p : themes_1.default.DEFAULT),
1081
- internalProps.theme.isPivot = this.isPivotTable(), (0, icons_1.setIconColor)(internalProps.theme.functionalIconsStyle),
1085
+ internalProps.theme.isPivot = this.isPivotTable(), this._updateFunctionalIcons(),
1082
1086
  this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText,
1083
1087
  internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_q = options.allowFrozenColCount) && void 0 !== _q ? _q : 0,
1084
1088
  internalProps.limitMaxAutoWidth = null !== (_r = options.limitMaxAutoWidth) && void 0 !== _r ? _r : 450,
@@ -1403,13 +1407,19 @@ class BaseTable extends EventTarget_1.EventTarget {
1403
1407
  this.options.autoWrapText = autoWrapText, this.scenegraph.clearCells(), this.clearCellStyleCache(),
1404
1408
  this.scenegraph.createSceneGraph(), this.render());
1405
1409
  }
1410
+ _updateFunctionalIcons() {
1411
+ var _a, _b, _c;
1412
+ (0, icons_1.setIconColor)(this.internalProps.theme.functionalIconsStyle), null === (_a = this.internalProps.headerHelper) || void 0 === _a || _a.updateIcons(),
1413
+ null === (_b = this.internalProps.bodyHelper) || void 0 === _b || _b.updateIcons(),
1414
+ null === (_c = this.internalProps.rowSeriesNumberHelper) || void 0 === _c || _c.updateIcons();
1415
+ }
1406
1416
  get theme() {
1407
1417
  return this.internalProps.theme;
1408
1418
  }
1409
1419
  set theme(theme) {
1410
1420
  this.internalProps.theme = themes_1.default.of(null != theme ? theme : themes_1.default.DEFAULT),
1411
1421
  this.internalProps.theme.isPivot = this.isPivotTable(), this.options.theme = theme,
1412
- (0, icons_1.setIconColor)(this.internalProps.theme.functionalIconsStyle);
1422
+ this._updateFunctionalIcons();
1413
1423
  }
1414
1424
  updateTheme(theme) {
1415
1425
  const oldHoverState = {
@@ -1417,7 +1427,7 @@ class BaseTable extends EventTarget_1.EventTarget {
1417
1427
  row: this.stateManager.hover.cellPos.row
1418
1428
  };
1419
1429
  this.internalProps.theme = themes_1.default.of(null != theme ? theme : themes_1.default.DEFAULT),
1420
- this.internalProps.theme.isPivot = this.isPivotTable(), (0, icons_1.setIconColor)(this.internalProps.theme.functionalIconsStyle),
1430
+ this.internalProps.theme.isPivot = this.isPivotTable(), this._updateFunctionalIcons(),
1421
1431
  this.options.theme = theme, this.scenegraph.updateComponent(), this.scenegraph.updateStageBackground(),
1422
1432
  this.scenegraph.clearCells(), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(),
1423
1433
  this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.render();
@@ -1432,20 +1442,20 @@ class BaseTable extends EventTarget_1.EventTarget {
1432
1442
  getBodyColumnType(col, row) {
1433
1443
  var _a, _b;
1434
1444
  const cellType = null !== (_b = null === (_a = this.internalProps.layoutMap.getBody(col, row)) || void 0 === _a ? void 0 : _a.cellType) && void 0 !== _b ? _b : "text";
1435
- return (0, get_prop_1.getProp)("cellType", {
1445
+ return normalizeCellType((0, get_prop_1.getProp)("cellType", {
1436
1446
  cellType: cellType
1437
- }, col, row, this);
1447
+ }, col, row, this));
1438
1448
  }
1439
1449
  getCellType(col, row) {
1440
1450
  let cellType;
1441
1451
  if (this.isSeriesNumberInHeader(col, row)) {
1442
1452
  const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
1443
- return "radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType;
1453
+ return normalizeCellType("radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType);
1444
1454
  }
1445
1455
  return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType,
1446
- (0, get_prop_1.getProp)("cellType", {
1456
+ normalizeCellType((0, get_prop_1.getProp)("cellType", {
1447
1457
  cellType: cellType
1448
- }, col, row, this);
1458
+ }, col, row, this));
1449
1459
  }
1450
1460
  getHeaderField(col, row) {
1451
1461
  return this.internalProps.layoutMap.getHeaderField(col, row);