@visactor/vtable 1.22.11-alpha.8 → 1.22.11-alpha.9

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 (147) hide show
  1. package/cjs/ListTable.d.ts +34 -7
  2. package/cjs/ListTable.js +138 -18
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +0 -3
  5. package/cjs/PivotChart.js +5 -12
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/components/index.js +1 -1
  8. package/cjs/core/BaseTable.js +1 -1
  9. package/cjs/core/BaseTable.js.map +1 -1
  10. package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
  11. package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
  12. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  13. package/cjs/core/index.d.ts +1 -0
  14. package/cjs/core/index.js +30 -0
  15. package/cjs/core/index.js.map +1 -0
  16. package/cjs/core/record-helper.d.ts +4 -2
  17. package/cjs/core/record-helper.js +120 -47
  18. package/cjs/core/record-helper.js.map +1 -1
  19. package/cjs/data/DataSource.d.ts +13 -4
  20. package/cjs/data/DataSource.js +174 -60
  21. package/cjs/data/DataSource.js.map +1 -1
  22. package/cjs/event/event.d.ts +2 -1
  23. package/cjs/event/event.js +20 -9
  24. package/cjs/event/event.js.map +1 -1
  25. package/cjs/event/listener/container-dom.js +1 -1
  26. package/cjs/event/listener/container-dom.js.map +1 -1
  27. package/cjs/event/listener/scroll-bar.js +2 -8
  28. package/cjs/event/listener/scroll-bar.js.map +1 -1
  29. package/cjs/event/listener/table-group.js +8 -14
  30. package/cjs/event/listener/table-group.js.map +1 -1
  31. package/cjs/event/media-click.js +1 -1
  32. package/cjs/event/scroll.js +1 -1
  33. package/cjs/event/sparkline-event.js +1 -1
  34. package/cjs/event/util.js +1 -1
  35. package/cjs/index.d.ts +1 -1
  36. package/cjs/index.js +1 -1
  37. package/cjs/index.js.map +1 -1
  38. package/cjs/layout/index.js +1 -2
  39. package/cjs/layout/pivot-header-layout.d.ts +0 -6
  40. package/cjs/layout/pivot-header-layout.js +20 -39
  41. package/cjs/layout/pivot-header-layout.js.map +1 -1
  42. package/cjs/plugins/custom-cell-style.d.ts +5 -0
  43. package/cjs/plugins/custom-cell-style.js +9 -0
  44. package/cjs/plugins/custom-cell-style.js.map +1 -1
  45. package/cjs/plugins/interface.js +1 -1
  46. package/cjs/plugins/invert-highlight.js +2 -1
  47. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  48. package/cjs/plugins/plugin-manager.js +1 -1
  49. package/cjs/scenegraph/graphic/active-cell-chart-list.d.ts +2 -15
  50. package/cjs/scenegraph/graphic/active-cell-chart-list.js +75 -198
  51. package/cjs/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  52. package/cjs/scenegraph/graphic/chart.d.ts +1 -10
  53. package/cjs/scenegraph/graphic/chart.js +27 -61
  54. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  55. package/cjs/scenegraph/graphic/contributions/chart-render.js +4 -3
  56. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  57. package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -1
  58. package/cjs/scenegraph/refresh-node/update-chart.js +1 -2
  59. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  60. package/cjs/scenegraph/scenegraph.d.ts +2 -2
  61. package/cjs/scenegraph/scenegraph.js +11 -44
  62. package/cjs/scenegraph/scenegraph.js.map +1 -1
  63. package/cjs/tools/util.d.ts +0 -5
  64. package/cjs/tools/util.js +4 -22
  65. package/cjs/tools/util.js.map +1 -1
  66. package/cjs/ts-types/base-table.d.ts +2 -2
  67. package/cjs/ts-types/base-table.js.map +1 -1
  68. package/cjs/ts-types/events.d.ts +15 -0
  69. package/cjs/ts-types/events.js.map +1 -1
  70. package/cjs/ts-types/table-engine.d.ts +33 -13
  71. package/cjs/ts-types/table-engine.js.map +1 -1
  72. package/cjs/vrender.js.map +1 -1
  73. package/dist/vtable.js +898 -711
  74. package/dist/vtable.min.js +2 -2
  75. package/es/ListTable.d.ts +34 -7
  76. package/es/ListTable.js +134 -18
  77. package/es/ListTable.js.map +1 -1
  78. package/es/PivotChart.d.ts +0 -3
  79. package/es/PivotChart.js +4 -13
  80. package/es/PivotChart.js.map +1 -1
  81. package/es/components/index.js +1 -1
  82. package/es/core/BaseTable.js +1 -1
  83. package/es/core/BaseTable.js.map +1 -1
  84. package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
  85. package/es/core/TABLE_EVENT_TYPE.js +1 -0
  86. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  87. package/es/core/index.d.ts +1 -0
  88. package/es/core/index.js +2 -0
  89. package/es/core/index.js.map +1 -0
  90. package/es/core/record-helper.d.ts +4 -2
  91. package/es/core/record-helper.js +114 -43
  92. package/es/core/record-helper.js.map +1 -1
  93. package/es/data/DataSource.d.ts +13 -4
  94. package/es/data/DataSource.js +174 -60
  95. package/es/data/DataSource.js.map +1 -1
  96. package/es/event/event.d.ts +2 -1
  97. package/es/event/event.js +20 -9
  98. package/es/event/event.js.map +1 -1
  99. package/es/event/listener/container-dom.js +1 -1
  100. package/es/event/listener/container-dom.js.map +1 -1
  101. package/es/event/listener/scroll-bar.js +2 -8
  102. package/es/event/listener/scroll-bar.js.map +1 -1
  103. package/es/event/listener/table-group.js +8 -13
  104. package/es/event/listener/table-group.js.map +1 -1
  105. package/es/event/media-click.js +1 -1
  106. package/es/event/scroll.js +1 -1
  107. package/es/event/sparkline-event.js +1 -1
  108. package/es/event/util.js +1 -1
  109. package/es/index.d.ts +1 -1
  110. package/es/index.js +1 -1
  111. package/es/index.js.map +1 -1
  112. package/es/layout/index.js +1 -2
  113. package/es/layout/pivot-header-layout.d.ts +0 -6
  114. package/es/layout/pivot-header-layout.js +20 -39
  115. package/es/layout/pivot-header-layout.js.map +1 -1
  116. package/es/plugins/custom-cell-style.d.ts +5 -0
  117. package/es/plugins/custom-cell-style.js +9 -0
  118. package/es/plugins/custom-cell-style.js.map +1 -1
  119. package/es/plugins/interface.js +1 -1
  120. package/es/plugins/invert-highlight.js +2 -1
  121. package/es/plugins/list-tree-stick-cell.js +1 -1
  122. package/es/plugins/plugin-manager.js +1 -1
  123. package/es/scenegraph/graphic/active-cell-chart-list.d.ts +2 -15
  124. package/es/scenegraph/graphic/active-cell-chart-list.js +68 -186
  125. package/es/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  126. package/es/scenegraph/graphic/chart.d.ts +1 -10
  127. package/es/scenegraph/graphic/chart.js +25 -58
  128. package/es/scenegraph/graphic/chart.js.map +1 -1
  129. package/es/scenegraph/graphic/contributions/chart-render.js +4 -3
  130. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  131. package/es/scenegraph/refresh-node/update-chart.d.ts +1 -1
  132. package/es/scenegraph/refresh-node/update-chart.js +1 -2
  133. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  134. package/es/scenegraph/scenegraph.d.ts +2 -2
  135. package/es/scenegraph/scenegraph.js +10 -43
  136. package/es/scenegraph/scenegraph.js.map +1 -1
  137. package/es/tools/util.d.ts +0 -5
  138. package/es/tools/util.js +0 -18
  139. package/es/tools/util.js.map +1 -1
  140. package/es/ts-types/base-table.d.ts +2 -2
  141. package/es/ts-types/base-table.js.map +1 -1
  142. package/es/ts-types/events.d.ts +15 -0
  143. package/es/ts-types/events.js.map +1 -1
  144. package/es/ts-types/table-engine.d.ts +33 -13
  145. package/es/ts-types/table-engine.js.map +1 -1
  146. package/es/vrender.js.map +1 -1
  147. package/package.json +4 -4
@@ -10,6 +10,11 @@ export declare class CustomCellStylePlugin {
10
10
  customCellStyle: CustomCellStyle[];
11
11
  customCellStyleArrangement: CustomCellStyleArrangement[];
12
12
  constructor(table: BaseTableAPI, customCellStyle: CustomCellStyle[], customCellStyleArrangement: CustomCellStyleArrangement[]);
13
+ clearCustomCellStyleArrangement(): void;
14
+ addCustomCellStyleArrangement(cellPosition: {
15
+ col: number;
16
+ row: number;
17
+ }, customStyleId: string | undefined | null): void;
13
18
  getCustomCellStyle(col: number, row: number): any;
14
19
  getCustomCellStyleIds(col: number, row: number): string[];
15
20
  getCustomCellStyleOption(customStyleId: string): CustomCellStyle;
@@ -10,6 +10,15 @@ class CustomCellStylePlugin {
10
10
  constructor(table, customCellStyle, customCellStyleArrangement) {
11
11
  this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement;
12
12
  }
13
+ clearCustomCellStyleArrangement() {
14
+ this.customCellStyleArrangement = [];
15
+ }
16
+ addCustomCellStyleArrangement(cellPosition, customStyleId) {
17
+ this.customCellStyleArrangement.push({
18
+ cellPosition: cellPosition,
19
+ customStyleId: customStyleId
20
+ });
21
+ }
13
22
  getCustomCellStyle(col, row) {
14
23
  const customStyleIds = this.getCustomCellStyleIds(col, row);
15
24
  if (customStyleIds.length) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugins/custom-cell-style.ts"],"names":[],"mappings":";;;AAAA,6CAA8D;AAE9D,0CAMqB;AAErB,6CAA0C;AAU1C,MAAa,qBAAqB;IAKhC,YACE,KAAmB,EACnB,eAAkC,EAClC,0BAAwD;QAExD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;IAC/D,CAAC;IAED,kBAAkB,CAAC,GAAW,EAAE,GAAW;QACzC,MAAM,cAAc,GAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC5D,IAAI,cAAc,CAAC,MAAM,EAAE;YACzB,MAAM,MAAM,GAAwB,EAAE,CAAC;YAEvC,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;gBACrC,MAAM,WAAW,GAAG,IAAI,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;gBACjE,IAAI,IAAA,mBAAU,EAAC,WAAW,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,UAAiB,EAAE,eAAkC;IAC9E,UAAU,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;IAEhC,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE;QACjC,MAAM,KAAK,GAAI,eAAuB,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,EAAE;YACjB,UAAkB,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;SACxC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAXD,gCAWC;AAEM,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAChD,iBAAO,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,CAAC;AAC5E,CAAC,CAAC;AAFW,QAAA,6BAA6B,iCAExC","file":"custom-cell-style.js","sourcesContent":["import { isFunction, isValid, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport {\n cellStyleKeys,\n type CellRange,\n type ColumnStyleOption,\n type CustomCellStyle,\n type CustomCellStyleArrangement\n} from '../ts-types';\nimport type { Style } from '../body-helper/style';\nimport { Factory } from '../core/factory';\nimport type { StylePropertyFunctionArg } from '../ts-types/style-define';\nexport interface ICustomCellStylePlugin {\n new (\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ): CustomCellStylePlugin;\n}\n\nexport class CustomCellStylePlugin {\n table: BaseTableAPI;\n customCellStyle: CustomCellStyle[];\n customCellStyleArrangement: CustomCellStyleArrangement[];\n\n constructor(\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ) {\n this.table = table;\n this.customCellStyle = customCellStyle;\n this.customCellStyleArrangement = customCellStyleArrangement;\n }\n\n getCustomCellStyle(col: number, row: number) {\n const customStyleIds = this.getCustomCellStyleIds(col, row);\n if (customStyleIds.length) {\n const styles: ColumnStyleOption[] = [];\n\n customStyleIds.forEach(customStyleId => {\n const styleOption = this.getCustomCellStyleOption(customStyleId);\n if (isFunction(styleOption?.style)) {\n const style = styleOption.style({\n col,\n row,\n table: this.table,\n value: this.table.getCellValue(col, row),\n dataValue: this.table.getCellOriginValue(col, row),\n cellHeaderPaths: this.table.getCellHeaderPaths(col, row)\n });\n styles.push(style);\n } else if (styleOption?.style) {\n styles.push(styleOption.style);\n }\n });\n\n return merge({}, ...styles);\n // const styleOption = this.getCustomCellStyleOption(customStyleId);\n // return styleOption?.style;\n }\n return undefined;\n }\n\n getCustomCellStyleIds(col: number, row: number) {\n // let customStyleId;\n const customStyleIds: string[] = [];\n\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n // eslint-disable-next-line no-loop-func\n this.customCellStyleArrangement.forEach(style => {\n if (style.cellPosition.range) {\n if (\n style.cellPosition.range.start.col <= c &&\n style.cellPosition.range.end.col >= c &&\n style.cellPosition.range.start.row <= r &&\n style.cellPosition.range.end.row >= r\n ) {\n // customStyleId = style.customStyleId;\n customStyleIds.push(style.customStyleId);\n }\n } else if (style.cellPosition.col === c && style.cellPosition.row === r) {\n // customStyleId = style.customStyleId;\n customStyleIds.push(style.customStyleId);\n }\n });\n }\n }\n\n return customStyleIds;\n }\n\n getCustomCellStyleOption(customStyleId: string) {\n return this.customCellStyle.find(style => style.id === customStyleId);\n }\n\n registerCustomCellStyle(\n customStyleId: string,\n customStyle: ColumnStyleOption | ((styleArg: StylePropertyFunctionArg) => ColumnStyleOption) | undefined | null\n ) {\n const index = this.customCellStyle.findIndex(style => style.id === customStyleId);\n if (index === -1) {\n this.customCellStyle.push({\n id: customStyleId,\n style: customStyle\n });\n } else {\n this.customCellStyle[index] = {\n id: customStyleId,\n style: customStyle\n };\n }\n\n this.customCellStyleArrangement.forEach(cellStyle => {\n const cellPos = cellStyle.cellPosition;\n if (cellStyle.customStyleId === customStyleId) {\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);\n }\n }\n });\n this.table.scenegraph.updateNextFrame();\n }\n\n arrangeCustomCellStyle(\n cellPos: {\n col?: number;\n row?: number;\n range?: CellRange;\n },\n customStyleId: string | undefined | null,\n forceFastUpdate?: boolean\n ) {\n const index = this.customCellStyleArrangement.findIndex(style => {\n if (style.cellPosition.range && cellPos.range) {\n return (\n style.cellPosition.range.start.col === cellPos.range.start.col &&\n style.cellPosition.range.start.row === cellPos.range.start.row &&\n style.cellPosition.range.end.col === cellPos.range.end.col &&\n style.cellPosition.range.end.row === cellPos.range.end.row\n );\n }\n return style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row;\n });\n\n if (index === -1 && !customStyleId) {\n // do nothing\n return;\n } else if (index === -1 && customStyleId) {\n // add new style\n this.customCellStyleArrangement.push({\n cellPosition: {\n col: cellPos.col,\n row: cellPos.row,\n range: cellPos.range\n },\n customStyleId: customStyleId\n });\n } else if (this.customCellStyleArrangement[index].customStyleId === customStyleId) {\n // same style\n return;\n } else if (customStyleId) {\n // update style\n this.customCellStyleArrangement[index].customStyleId = customStyleId;\n } else {\n // delete useless style\n this.customCellStyleArrangement.splice(index, 1);\n }\n\n const style = this.getCustomCellStyleOption(customStyleId)?.style;\n // let forceFastUpdate;\n if (style) {\n forceFastUpdate = true;\n for (const key in style) {\n if (cellStyleKeys.indexOf(key) === -1) {\n forceFastUpdate = false;\n break;\n }\n }\n }\n\n // update cell group\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n this.table.scenegraph.updateCellContent(c, r, forceFastUpdate);\n }\n }\n // this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row, forceFastUpdate);\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n updateCustomCell(customCellStyle: CustomCellStyle[], customCellStyleArrangement: CustomCellStyleArrangement[]) {\n this.customCellStyle.length = 0;\n this.customCellStyleArrangement.length = 0;\n customCellStyle.forEach((cellStyle: CustomCellStyle) => {\n this.registerCustomCellStyle(cellStyle.id, cellStyle.style);\n });\n customCellStyleArrangement.forEach((cellStyle: CustomCellStyleArrangement) => {\n this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);\n });\n }\n\n hasCustomCellStyle(customStyleId: string) {\n return this.customCellStyle.some(style => style.id === customStyleId);\n }\n}\n\nexport function mergeStyle(cacheStyle: Style, customCellStyle: ColumnStyleOption): Style {\n cacheStyle = cacheStyle.clone();\n\n for (const key in customCellStyle) {\n const value = (customCellStyle as any)[key];\n if (isValid(value)) {\n (cacheStyle as any)[`_${key}`] = value;\n }\n }\n\n return cacheStyle;\n}\n\nexport const registerCustomCellStylePlugin = () => {\n Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin);\n};\n\n// export type ICustomCellStylePlugin = typeof CustomCellStylePlugin;\n"]}
1
+ {"version":3,"sources":["../src/plugins/custom-cell-style.ts"],"names":[],"mappings":";;;AAAA,6CAA8D;AAE9D,0CAMqB;AAErB,6CAA0C;AAU1C,MAAa,qBAAqB;IAKhC,YACE,KAAmB,EACnB,eAAkC,EAClC,0BAAwD;QAExD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,eAAe,CAA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AAG,CAAC,CAAC;QAChC,IAAI,CAAC,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3C,eAAe,CAAC,OAAO,CAAC,CAAC,SAA0B,EAAE,EAAE;YACrD,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;QACH,0BAA0B,CAAC,OAAO,CAAC,CAAC,SAAqC,EAAE,EAAE;YAC3E,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;IACL,CAAC;IAED,kBAAkB,CAAC,aAAqB;QACtC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,aAAa,CAAC,CAAC;IACxE,CAAC;CACF;AA5OD,sDA4OC;AAED,SAAgB,UAAU,CAAC,UAAiB,EAAE,eAAkC;IAC9E,UAAU,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;IAEhC,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE;QACjC,MAAM,KAAK,GAAI,eAAuB,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,EAAE;YACjB,UAAkB,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;SACxC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAXD,gCAWC;AAEM,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAChD,iBAAO,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,CAAC;AAC5E,CAAC,CAAC;AAFW,QAAA,6BAA6B,iCAExC","file":"custom-cell-style.js","sourcesContent":["import { isFunction, isValid, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport {\n cellStyleKeys,\n type CellRange,\n type ColumnStyleOption,\n type CustomCellStyle,\n type CustomCellStyleArrangement\n} from '../ts-types';\nimport type { Style } from '../body-helper/style';\nimport { Factory } from '../core/factory';\nimport type { StylePropertyFunctionArg } from '../ts-types/style-define';\nexport interface ICustomCellStylePlugin {\n new (\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ): CustomCellStylePlugin;\n}\n\nexport class CustomCellStylePlugin {\n table: BaseTableAPI;\n customCellStyle: CustomCellStyle[];\n customCellStyleArrangement: CustomCellStyleArrangement[];\n\n constructor(\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ) {\n this.table = table;\n this.customCellStyle = customCellStyle;\n this.customCellStyleArrangement = customCellStyleArrangement;\n }\n\n clearCustomCellStyleArrangement() {\n this.customCellStyleArrangement = [];\n }\n\n addCustomCellStyleArrangement(\n cellPosition: {\n col: number;\n row: number;\n },\n customStyleId: string | undefined | null\n ) {\n this.customCellStyleArrangement.push({\n cellPosition,\n customStyleId\n });\n }\n\n getCustomCellStyle(col: number, row: number) {\n const customStyleIds = this.getCustomCellStyleIds(col, row);\n if (customStyleIds.length) {\n const styles: ColumnStyleOption[] = [];\n\n customStyleIds.forEach(customStyleId => {\n const styleOption = this.getCustomCellStyleOption(customStyleId);\n if (isFunction(styleOption?.style)) {\n const style = styleOption.style({\n col,\n row,\n table: this.table,\n value: this.table.getCellValue(col, row),\n dataValue: this.table.getCellOriginValue(col, row),\n cellHeaderPaths: this.table.getCellHeaderPaths(col, row)\n });\n styles.push(style);\n } else if (styleOption?.style) {\n styles.push(styleOption.style);\n }\n });\n\n return merge({}, ...styles);\n // const styleOption = this.getCustomCellStyleOption(customStyleId);\n // return styleOption?.style;\n }\n return undefined;\n }\n\n getCustomCellStyleIds(col: number, row: number) {\n // let customStyleId;\n const customStyleIds: string[] = [];\n\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n // eslint-disable-next-line no-loop-func\n this.customCellStyleArrangement.forEach(style => {\n if (style.cellPosition.range) {\n if (\n style.cellPosition.range.start.col <= c &&\n style.cellPosition.range.end.col >= c &&\n style.cellPosition.range.start.row <= r &&\n style.cellPosition.range.end.row >= r\n ) {\n // customStyleId = style.customStyleId;\n customStyleIds.push(style.customStyleId);\n }\n } else if (style.cellPosition.col === c && style.cellPosition.row === r) {\n // customStyleId = style.customStyleId;\n customStyleIds.push(style.customStyleId);\n }\n });\n }\n }\n\n return customStyleIds;\n }\n\n getCustomCellStyleOption(customStyleId: string) {\n return this.customCellStyle.find(style => style.id === customStyleId);\n }\n\n registerCustomCellStyle(\n customStyleId: string,\n customStyle: ColumnStyleOption | ((styleArg: StylePropertyFunctionArg) => ColumnStyleOption) | undefined | null\n ) {\n const index = this.customCellStyle.findIndex(style => style.id === customStyleId);\n if (index === -1) {\n this.customCellStyle.push({\n id: customStyleId,\n style: customStyle\n });\n } else {\n this.customCellStyle[index] = {\n id: customStyleId,\n style: customStyle\n };\n }\n\n this.customCellStyleArrangement.forEach(cellStyle => {\n const cellPos = cellStyle.cellPosition;\n if (cellStyle.customStyleId === customStyleId) {\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);\n }\n }\n });\n this.table.scenegraph.updateNextFrame();\n }\n\n arrangeCustomCellStyle(\n cellPos: {\n col?: number;\n row?: number;\n range?: CellRange;\n },\n customStyleId: string | undefined | null,\n forceFastUpdate?: boolean\n ) {\n const index = this.customCellStyleArrangement.findIndex(style => {\n if (style.cellPosition.range && cellPos.range) {\n return (\n style.cellPosition.range.start.col === cellPos.range.start.col &&\n style.cellPosition.range.start.row === cellPos.range.start.row &&\n style.cellPosition.range.end.col === cellPos.range.end.col &&\n style.cellPosition.range.end.row === cellPos.range.end.row\n );\n }\n return style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row;\n });\n\n if (index === -1 && !customStyleId) {\n // do nothing\n return;\n } else if (index === -1 && customStyleId) {\n // add new style\n this.customCellStyleArrangement.push({\n cellPosition: {\n col: cellPos.col,\n row: cellPos.row,\n range: cellPos.range\n },\n customStyleId: customStyleId\n });\n } else if (this.customCellStyleArrangement[index].customStyleId === customStyleId) {\n // same style\n return;\n } else if (customStyleId) {\n // update style\n this.customCellStyleArrangement[index].customStyleId = customStyleId;\n } else {\n // delete useless style\n this.customCellStyleArrangement.splice(index, 1);\n }\n\n const style = this.getCustomCellStyleOption(customStyleId)?.style;\n // let forceFastUpdate;\n if (style) {\n forceFastUpdate = true;\n for (const key in style) {\n if (cellStyleKeys.indexOf(key) === -1) {\n forceFastUpdate = false;\n break;\n }\n }\n }\n\n // update cell group\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n this.table.scenegraph.updateCellContent(c, r, forceFastUpdate);\n }\n }\n // this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row, forceFastUpdate);\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n updateCustomCell(customCellStyle: CustomCellStyle[], customCellStyleArrangement: CustomCellStyleArrangement[]) {\n this.customCellStyle.length = 0;\n this.customCellStyleArrangement.length = 0;\n customCellStyle.forEach((cellStyle: CustomCellStyle) => {\n this.registerCustomCellStyle(cellStyle.id, cellStyle.style);\n });\n customCellStyleArrangement.forEach((cellStyle: CustomCellStyleArrangement) => {\n this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);\n });\n }\n\n hasCustomCellStyle(customStyleId: string) {\n return this.customCellStyle.some(style => style.id === customStyleId);\n }\n}\n\nexport function mergeStyle(cacheStyle: Style, customCellStyle: ColumnStyleOption): Style {\n cacheStyle = cacheStyle.clone();\n\n for (const key in customCellStyle) {\n const value = (customCellStyle as any)[key];\n if (isValid(value)) {\n (cacheStyle as any)[`_${key}`] = value;\n }\n }\n\n return cacheStyle;\n}\n\nexport const registerCustomCellStylePlugin = () => {\n Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin);\n};\n\n// export type ICustomCellStylePlugin = typeof CustomCellStylePlugin;\n"]}
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=interface.js.map
6
+ //# sourceMappingURL=interface.js.map
@@ -19,4 +19,5 @@ function onBeforeAttributeUpdateForInvertHighlight(val, attribute) {
19
19
  }
20
20
  }
21
21
 
22
- exports.onBeforeAttributeUpdateForInvertHighlight = onBeforeAttributeUpdateForInvertHighlight;
22
+ exports.onBeforeAttributeUpdateForInvertHighlight = onBeforeAttributeUpdateForInvertHighlight;
23
+ //# sourceMappingURL=invert-highlight.js.map
@@ -177,4 +177,4 @@ const registerListTreeStickCellPlugin = () => {
177
177
  };
178
178
 
179
179
  exports.registerListTreeStickCellPlugin = registerListTreeStickCellPlugin;
180
- //# sourceMappingURL=list-tree-stick-cell.js.map
180
+ //# sourceMappingURL=list-tree-stick-cell.js.map
@@ -59,4 +59,4 @@ class PluginManager {
59
59
  }
60
60
 
61
61
  exports.PluginManager = PluginManager;
62
- //# sourceMappingURL=plugin-manager.js.map
62
+ //# sourceMappingURL=plugin-manager.js.map
@@ -1,26 +1,13 @@
1
1
  import type { BaseTableAPI } from '../../ts-types/base-table';
2
- export declare function setBrushingChartInstance(chartInstance: any, col: number, row: number): void;
3
- export declare function clearBrushingChartInstance(): void;
4
- export declare function getBrushingChartInstance(): any;
5
- export declare function getBrushingChartInstanceCellPos(): {
6
- col: number;
7
- row: number;
8
- };
9
2
  export declare const chartInstanceListColumnByColumnDirection: Record<number, Record<number, any>>;
10
3
  export declare const chartInstanceListRowByRowDirection: Record<number, Record<number, any>>;
11
4
  export declare function generateChartInstanceListByColumnDirection(col: number, dimensionValueOrXValue: string, positionValueOrYValue: string | number, canvasXY: {
12
5
  x: number;
13
6
  y: number;
14
7
  }, table: BaseTableAPI, hideTooltip?: boolean, isScatter?: boolean): void;
8
+ export declare function clearChartInstanceListByColumnDirection(col: number, excludedRow: number, table: BaseTableAPI): void;
15
9
  export declare function generateChartInstanceListByRowDirection(row: number, dimensionValueOrXValue: string, positionValueOrYValue: string | number, canvasXY: {
16
10
  x: number;
17
11
  y: number;
18
12
  }, table: BaseTableAPI, hideTooltip?: boolean, isScatter?: boolean): void;
19
- export declare function generateChartInstanceListByViewRange(datum: any, table: BaseTableAPI, deactivate?: boolean): void;
20
- export declare function clearChartInstanceListByColumnDirection(col: number, excludedRow: number, table: BaseTableAPI, forceRelease?: boolean): void;
21
- export declare function clearChartInstanceListByRowDirection(row: number, excludedCol: number, table: BaseTableAPI, forceRelease?: boolean): void;
22
- export declare function clearDelayRunDimensionHoverTimers(): void;
23
- export declare function clearAllChartInstanceList(table: BaseTableAPI, forceRelease?: boolean): void;
24
- export declare function isDisabledShowTooltipToAllChartInstances(): boolean;
25
- export declare function disableTooltipToAllChartInstances(): void;
26
- export declare function enableTooltipToAllChartInstances(): void;
13
+ export declare function clearChartInstanceListByRowDirection(row: number, excludedCol: number, table: BaseTableAPI): void;
@@ -2,228 +2,140 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.enableTooltipToAllChartInstances = exports.disableTooltipToAllChartInstances = exports.isDisabledShowTooltipToAllChartInstances = exports.clearAllChartInstanceList = exports.clearDelayRunDimensionHoverTimers = exports.clearChartInstanceListByRowDirection = exports.clearChartInstanceListByColumnDirection = exports.generateChartInstanceListByViewRange = exports.generateChartInstanceListByRowDirection = exports.generateChartInstanceListByColumnDirection = exports.chartInstanceListRowByRowDirection = exports.chartInstanceListColumnByColumnDirection = exports.getBrushingChartInstanceCellPos = exports.getBrushingChartInstance = exports.clearBrushingChartInstance = exports.setBrushingChartInstance = void 0;
5
+ }), exports.clearChartInstanceListByRowDirection = exports.generateChartInstanceListByRowDirection = exports.clearChartInstanceListByColumnDirection = exports.generateChartInstanceListByColumnDirection = exports.chartInstanceListRowByRowDirection = exports.chartInstanceListColumnByColumnDirection = void 0;
6
6
 
7
7
  const vutils_1 = require("@visactor/vutils");
8
8
 
9
- let brushingChartInstance, brushingChartInstanceCellPos = {
10
- col: -1,
11
- row: -1
12
- };
13
-
14
- function setBrushingChartInstance(chartInstance, col, row) {
15
- brushingChartInstance = chartInstance, brushingChartInstanceCellPos = {
16
- col: col,
17
- row: row
18
- };
19
- }
20
-
21
- function clearBrushingChartInstance() {
22
- brushingChartInstance = void 0, brushingChartInstanceCellPos = {
23
- col: -1,
24
- row: -1
25
- };
26
- }
27
-
28
- function getBrushingChartInstance() {
29
- return brushingChartInstance;
30
- }
31
-
32
- function getBrushingChartInstanceCellPos() {
33
- return brushingChartInstanceCellPos;
34
- }
35
-
36
- exports.setBrushingChartInstance = setBrushingChartInstance, exports.clearBrushingChartInstance = clearBrushingChartInstance,
37
- exports.getBrushingChartInstance = getBrushingChartInstance, exports.getBrushingChartInstanceCellPos = getBrushingChartInstanceCellPos,
38
- exports.chartInstanceListColumnByColumnDirection = {}, exports.chartInstanceListRowByRowDirection = {};
39
-
40
- const delayRunDimensionHoverTimer = [];
41
-
42
9
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
43
10
  var _a;
44
- clearDelayRunDimensionHoverTimers(), (0, vutils_1.isValid)(exports.chartInstanceListColumnByColumnDirection[col]) || (exports.chartInstanceListColumnByColumnDirection[col] = {});
11
+ (0, vutils_1.isValid)(exports.chartInstanceListColumnByColumnDirection[col]) || (exports.chartInstanceListColumnByColumnDirection[col] = {});
45
12
  const {rowStart: rowStart} = table.getBodyVisibleRowRange();
46
13
  let rowEnd = table.getBodyVisibleRowRange().rowEnd;
47
14
  rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
48
15
  for (let i = rowStart; i <= rowEnd; i++) {
49
16
  const cellGroup = table.scenegraph.getCell(col, i), chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
50
- exports.chartInstanceListColumnByColumnDirection[col][i] || (0, vutils_1.isValid)(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(),
51
- chartNode.activeChartInstance || chartNode.activate(table), exports.chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance);
52
- const timer = setTimeout((() => {
53
- var _a, _b, _c, _d;
17
+ chartNode.addUpdateShapeAndBoundsTag(), exports.chartInstanceListColumnByColumnDirection[col][i] || (0,
18
+ vutils_1.isValid)(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table),
19
+ exports.chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance),
20
+ setTimeout((() => {
21
+ var _a, _b, _c, _d, _e, _f;
54
22
  if (null === (_a = exports.chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
55
23
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
56
24
  let isShowTooltip = !isScatter;
57
- if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b,
58
- isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table)), isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_d = (_c = exports.chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _d || _d.call(_c, (axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue)); else {
59
- const cellBoundry = table.getCellRelativeRect(col, i), bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0, absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
25
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b,
26
+ i === rowEnd && isShowTooltip) {
27
+ const heightLimitToShowTooltipForEdgeRow = null !== (_c = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _c ? _c : 0, {rowEnd: rowEnd1} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
28
+ if (rowEnd1 === rowEnd) isShowTooltip = !0; else {
29
+ const {rowEnd: rowEnd2} = table.getBodyVisibleRowRange(0, 5);
30
+ isShowTooltip = rowEnd2 !== rowEnd;
31
+ }
32
+ } else if (i === rowStart && isShowTooltip) {
33
+ const heightLimitToShowTooltipForEdgeRow = null !== (_d = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _d ? _d : 0, {rowStart: rowStart1} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
34
+ if (rowStart1 === rowStart) isShowTooltip = !0; else {
35
+ const {rowStart: rowStart2} = table.getBodyVisibleRowRange(0, -5);
36
+ isShowTooltip = rowStart2 !== rowStart;
37
+ }
38
+ }
39
+ if (isScatter) table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || null === (_f = (_e = exports.chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _f || _f.call(_e, (axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue)); else {
40
+ const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0, absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
60
41
  hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || exports.chartInstanceListColumnByColumnDirection[col][i].hideTooltip(),
61
42
  exports.chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
62
43
  tooltip: !1,
63
44
  showTooltipOption: {
64
- x: canvasXY.x - cellBoundry.left,
65
- y: absolutePositionTop - cellBoundry.top,
45
+ x: canvasXY.x,
46
+ y: absolutePositionTop,
66
47
  activeType: "dimension"
67
48
  }
68
49
  })) : exports.chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
69
50
  tooltip: isShowTooltip,
70
51
  showTooltipOption: {
71
- x: canvasXY.x - cellBoundry.left,
72
- y: absolutePositionTop - cellBoundry.top,
52
+ x: canvasXY.x,
53
+ y: absolutePositionTop,
73
54
  activeType: "dimension"
74
55
  }
75
56
  });
76
57
  }
77
58
  }
78
- }), 0);
79
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
59
+ }), 0), table.scenegraph.updateNextFrame();
60
+ }
61
+ }
62
+
63
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
64
+ var _a;
65
+ if ((0, vutils_1.isValid)(exports.chartInstanceListColumnByColumnDirection[col])) {
66
+ for (const i in exports.chartInstanceListColumnByColumnDirection[col]) {
67
+ if ((0, vutils_1.isValid)(excludedRow) && Number(i) === excludedRow) continue;
68
+ const cellGroup = table.scenegraph.getCell(col, Number(i)), chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
69
+ chartNode.addUpdateShapeAndBoundsTag(), (0, vutils_1.isValid)(chartNode) && (chartNode.deactivate(table, {
70
+ releaseChartInstance: !0,
71
+ releaseColumnChartInstance: !1,
72
+ releaseRowChartInstance: !1
73
+ }), exports.chartInstanceListColumnByColumnDirection[col][i] = null);
74
+ }
75
+ delete exports.chartInstanceListColumnByColumnDirection[col];
80
76
  }
81
77
  }
82
78
 
83
79
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
84
80
  var _a;
85
- clearDelayRunDimensionHoverTimers(), (0, vutils_1.isValid)(exports.chartInstanceListRowByRowDirection[row]) || (exports.chartInstanceListRowByRowDirection[row] = {});
81
+ (0, vutils_1.isValid)(exports.chartInstanceListRowByRowDirection[row]) || (exports.chartInstanceListRowByRowDirection[row] = {});
86
82
  const {colStart: colStart} = table.getBodyVisibleColRange();
87
83
  let colEnd = table.getBodyVisibleColRange().colEnd;
88
84
  colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
89
85
  for (let i = colStart; i <= colEnd; i++) {
90
86
  const cellGroup = table.scenegraph.getCell(i, row), chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
91
- exports.chartInstanceListRowByRowDirection[row][i] || (0, vutils_1.isValid)(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(),
92
- chartNode.activeChartInstance || chartNode.activate(table), exports.chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance);
93
- const timer = setTimeout((() => {
87
+ chartNode.addUpdateShapeAndBoundsTag(), exports.chartInstanceListRowByRowDirection[row][i] || (0,
88
+ vutils_1.isValid)(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table),
89
+ exports.chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance),
90
+ setTimeout((() => {
94
91
  var _a, _b, _c, _d;
95
92
  if (null === (_a = exports.chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
96
93
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
97
94
  let isShowTooltip = !isScatter;
98
- if (isScatter || "object" != typeof chartDimensionLinkage || (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b,
99
- isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(i, table)), isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = exports.chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, (axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue)); else {
100
- const cellBoundry = table.getCellRelativeRect(i, row), bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0, absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
95
+ if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b,
96
+ i === colEnd && isShowTooltip) {
97
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn, {colEnd: colEnd1} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
98
+ if (colEnd1 === colEnd) isShowTooltip = !0; else {
99
+ const {colEnd: colEnd2} = table.getBodyVisibleColRange(0, 5);
100
+ isShowTooltip = colEnd2 !== colEnd;
101
+ }
102
+ } else if (i === colStart && isShowTooltip) {
103
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn, {colStart: colStart1} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
104
+ if (colStart1 === colStart) isShowTooltip = !0; else {
105
+ const {colStart: colStart2} = table.getBodyVisibleColRange(0, -5);
106
+ isShowTooltip = colStart2 !== colStart;
107
+ }
108
+ }
109
+ if (isScatter) table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || null === (_d = (_c = exports.chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, (axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue)); else {
110
+ const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0, absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
101
111
  hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || exports.chartInstanceListRowByRowDirection[row][i].hideTooltip(),
102
112
  exports.chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
103
113
  tooltip: !1,
104
114
  showTooltipOption: {
105
- x: absolutePositionLeft - cellBoundry.left,
106
- y: canvasXY.y - cellBoundry.top,
115
+ x: absolutePositionLeft,
116
+ y: canvasXY.y,
107
117
  activeType: "dimension"
108
118
  }
109
119
  })) : exports.chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
110
120
  tooltip: isShowTooltip,
111
121
  showTooltipOption: {
112
- x: absolutePositionLeft - cellBoundry.left,
113
- y: canvasXY.y - cellBoundry.top,
122
+ x: absolutePositionLeft,
123
+ y: canvasXY.y,
114
124
  activeType: "dimension"
115
125
  }
116
126
  });
117
127
  }
118
128
  }
119
- }), 0);
120
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
121
- }
122
- }
123
-
124
- function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
125
- var _a;
126
- clearDelayRunDimensionHoverTimers();
127
- const {rowStart: rowStart} = table.getBodyVisibleRowRange();
128
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
129
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
130
- const {colStart: colStart} = table.getBodyVisibleColRange();
131
- let colEnd = table.getBodyVisibleColRange().colEnd;
132
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
133
- for (let col = colStart; col <= colEnd; col++) {
134
- (0, vutils_1.isValid)(exports.chartInstanceListColumnByColumnDirection[col]) || (exports.chartInstanceListColumnByColumnDirection[col] = {});
135
- for (let i = rowStart; i <= rowEnd; i++) {
136
- const cellGroup = table.scenegraph.getCell(col, i), chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
137
- exports.chartInstanceListColumnByColumnDirection[col][i] || (0, vutils_1.isValid)(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(),
138
- chartNode.activeChartInstance ? exports.chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance : "pie" === chartNode.attribute.spec.type && (chartNode.activate(table),
139
- exports.chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance));
140
- const timer = setTimeout((() => {
141
- var _a, _b;
142
- if (null === (_a = exports.chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
143
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
144
- let isShowTooltip = !0;
145
- "object" == typeof chartDimensionLinkage && (deactivate ? (exports.chartInstanceListColumnByColumnDirection[col][i].setHovered(),
146
- exports.chartInstanceListColumnByColumnDirection[col][i].hideTooltip()) : (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b,
147
- isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table), isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(col, table),
148
- exports.chartInstanceListColumnByColumnDirection[col][i].setHovered(datum), isShowTooltip && exports.chartInstanceListColumnByColumnDirection[col][i].showTooltip(datum, {
149
- activeType: "mark"
150
- })));
151
- }
152
- }), 0);
153
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
154
- }
155
- }
156
- }
157
-
158
- function checkIsShowTooltipForEdgeRow(row, table) {
159
- var _a, _b;
160
- let isShowTooltip = !0;
161
- const {rowStart: rowStart} = table.getBodyVisibleRowRange();
162
- let rowEnd = table.getBodyVisibleRowRange().rowEnd;
163
- rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
164
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
165
- if (row === rowEnd && isShowTooltip) {
166
- const heightLimitToShowTooltipForEdgeRow = null !== (_a = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _a ? _a : 0, {rowEnd: rowEnd1} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
167
- if (rowEnd1 === rowEnd) isShowTooltip = !0; else {
168
- const {rowEnd: rowEnd2} = table.getBodyVisibleRowRange(0, 5);
169
- isShowTooltip = rowEnd2 !== rowEnd;
170
- }
171
- } else if (row === rowStart && isShowTooltip) {
172
- const heightLimitToShowTooltipForEdgeRow = null !== (_b = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow) && void 0 !== _b ? _b : 0, {rowStart: rowStart1} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
173
- if (rowStart1 === rowStart) isShowTooltip = !0; else {
174
- const {rowStart: rowStart2} = table.getBodyVisibleRowRange(0, -5);
175
- isShowTooltip = rowStart2 !== rowStart;
176
- }
177
- }
178
- return isShowTooltip;
179
- }
180
-
181
- function checkIsShowTooltipForEdgeColumn(col, table) {
182
- let isShowTooltip = !0;
183
- const {colStart: colStart} = table.getBodyVisibleColRange();
184
- let colEnd = table.getBodyVisibleColRange().colEnd;
185
- colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
186
- const chartDimensionLinkage = table.options.chartDimensionLinkage;
187
- if (col === colEnd && isShowTooltip) {
188
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn, {colEnd: colEnd1} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
189
- if (colEnd1 === colEnd) isShowTooltip = !0; else {
190
- const {colEnd: colEnd2} = table.getBodyVisibleColRange(0, 5);
191
- isShowTooltip = colEnd2 !== colEnd;
192
- }
193
- } else if (col === colStart && isShowTooltip) {
194
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn, {colStart: colStart1} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
195
- if (colStart1 === colStart) isShowTooltip = !0; else {
196
- const {colStart: colStart2} = table.getBodyVisibleColRange(0, -5);
197
- isShowTooltip = colStart2 !== colStart;
198
- }
199
- }
200
- return isShowTooltip;
201
- }
202
-
203
- function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = !1) {
204
- var _a;
205
- if ((0, vutils_1.isValid)(exports.chartInstanceListColumnByColumnDirection[col])) {
206
- for (const i in exports.chartInstanceListColumnByColumnDirection[col]) {
207
- if ((0, vutils_1.isValid)(excludedRow) && Number(i) === excludedRow) continue;
208
- const cellGroup = table.scenegraph.getCell(col, Number(i)), chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
209
- (0, vutils_1.isValid)(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
210
- forceRelease: forceRelease,
211
- releaseChartInstance: !0,
212
- releaseColumnChartInstance: !1,
213
- releaseRowChartInstance: !1
214
- }), exports.chartInstanceListColumnByColumnDirection[col][i] = null);
215
- }
216
- delete exports.chartInstanceListColumnByColumnDirection[col];
129
+ }), 0), table.scenegraph.updateNextFrame();
217
130
  }
218
131
  }
219
132
 
220
- function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = !1) {
133
+ function clearChartInstanceListByRowDirection(row, excludedCol, table) {
221
134
  var _a;
222
135
  if ((0, vutils_1.isValid)(exports.chartInstanceListRowByRowDirection[row])) for (const i in exports.chartInstanceListRowByRowDirection[row]) {
223
136
  if ((0, vutils_1.isValid)(excludedCol) && Number(i) === excludedCol) continue;
224
137
  const cellGroup = table.scenegraph.getCell(Number(i), row), chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
225
- (0, vutils_1.isValid)(chartNode) && (chartNode.addUpdateShapeAndBoundsTag(), chartNode.deactivate(table, {
226
- forceRelease: forceRelease,
138
+ chartNode.addUpdateShapeAndBoundsTag(), (0, vutils_1.isValid)(chartNode) && (chartNode.deactivate(table, {
227
139
  releaseChartInstance: !0,
228
140
  releaseColumnChartInstance: !1,
229
141
  releaseRowChartInstance: !1
@@ -232,44 +144,9 @@ function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRele
232
144
  delete exports.chartInstanceListRowByRowDirection[row];
233
145
  }
234
146
 
235
- function clearDelayRunDimensionHoverTimers() {
236
- for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
237
- delayRunDimensionHoverTimer.length = 0;
238
- }
239
-
240
- function clearAllChartInstanceList(table, forceRelease = !1) {
241
- clearDelayRunDimensionHoverTimers();
242
- for (const col in exports.chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
243
- for (const row in exports.chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
244
- }
245
-
147
+ exports.chartInstanceListColumnByColumnDirection = {}, exports.chartInstanceListRowByRowDirection = {},
246
148
  exports.generateChartInstanceListByColumnDirection = generateChartInstanceListByColumnDirection,
247
- exports.generateChartInstanceListByRowDirection = generateChartInstanceListByRowDirection,
248
- exports.generateChartInstanceListByViewRange = generateChartInstanceListByViewRange,
249
149
  exports.clearChartInstanceListByColumnDirection = clearChartInstanceListByColumnDirection,
250
- exports.clearChartInstanceListByRowDirection = clearChartInstanceListByRowDirection,
251
- exports.clearDelayRunDimensionHoverTimers = clearDelayRunDimensionHoverTimers, exports.clearAllChartInstanceList = clearAllChartInstanceList;
252
-
253
- let disabledShowTooltipToAllChartInstances = !1;
254
-
255
- function isDisabledShowTooltipToAllChartInstances() {
256
- return disabledShowTooltipToAllChartInstances;
257
- }
258
-
259
- function disableTooltipToAllChartInstances() {
260
- disabledShowTooltipToAllChartInstances = !0, clearDelayRunDimensionHoverTimers();
261
- for (const col in exports.chartInstanceListColumnByColumnDirection) for (const row in exports.chartInstanceListColumnByColumnDirection[col]) exports.chartInstanceListColumnByColumnDirection[col][row].disableTooltip(!0),
262
- exports.chartInstanceListColumnByColumnDirection[col][row].hideTooltip();
263
- for (const row in exports.chartInstanceListRowByRowDirection) for (const col in exports.chartInstanceListRowByRowDirection[row]) exports.chartInstanceListRowByRowDirection[row][col].disableTooltip(!0),
264
- exports.chartInstanceListRowByRowDirection[row][col].hideTooltip();
265
- }
266
-
267
- function enableTooltipToAllChartInstances() {
268
- disabledShowTooltipToAllChartInstances = !1;
269
- for (const col in exports.chartInstanceListColumnByColumnDirection) for (const row in exports.chartInstanceListColumnByColumnDirection[col]) exports.chartInstanceListColumnByColumnDirection[col][row].disableTooltip(!1);
270
- for (const row in exports.chartInstanceListRowByRowDirection) for (const col in exports.chartInstanceListRowByRowDirection[row]) exports.chartInstanceListRowByRowDirection[row][col].disableTooltip(!1);
271
- }
272
-
273
- exports.isDisabledShowTooltipToAllChartInstances = isDisabledShowTooltipToAllChartInstances,
274
- exports.disableTooltipToAllChartInstances = disableTooltipToAllChartInstances, exports.enableTooltipToAllChartInstances = enableTooltipToAllChartInstances;
150
+ exports.generateChartInstanceListByRowDirection = generateChartInstanceListByRowDirection,
151
+ exports.clearChartInstanceListByRowDirection = clearChartInstanceListByRowDirection;
275
152
  //# sourceMappingURL=active-cell-chart-list.js.map