@visactor/vtable 1.3.3-alpha.0 → 1.3.3-alpha.2

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 (115) hide show
  1. package/cjs/ListTable.js +6 -7
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/core/BaseTable.d.ts +0 -5
  4. package/cjs/core/BaseTable.js +20 -34
  5. package/cjs/core/BaseTable.js.map +1 -1
  6. package/cjs/core/style.js +1 -1
  7. package/cjs/core/style.js.map +1 -1
  8. package/cjs/data/DataSource.d.ts +6 -1
  9. package/cjs/data/DataSource.js +12 -2
  10. package/cjs/data/DataSource.js.map +1 -1
  11. package/cjs/dataset/dataset.d.ts +15 -2
  12. package/cjs/dataset/dataset.js +170 -67
  13. package/cjs/dataset/dataset.js.map +1 -1
  14. package/cjs/dataset/statistics-helper.d.ts +43 -3
  15. package/cjs/dataset/statistics-helper.js +61 -26
  16. package/cjs/dataset/statistics-helper.js.map +1 -1
  17. package/cjs/event/media-click.js +1 -2
  18. package/cjs/event/sparkline-event.js +2 -1
  19. package/cjs/index.d.ts +1 -3
  20. package/cjs/index.js +4 -13
  21. package/cjs/index.js.map +1 -1
  22. package/cjs/scenegraph/component/custom.js +4 -6
  23. package/cjs/scenegraph/component/custom.js.map +1 -1
  24. package/cjs/scenegraph/group-creater/cell-helper.js +0 -4
  25. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  26. package/cjs/scenegraph/layout/compute-col-width.js +1 -1
  27. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  28. package/cjs/scenegraph/layout/compute-row-height.js +1 -1
  29. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  30. package/cjs/scenegraph/scenegraph.d.ts +0 -1
  31. package/cjs/scenegraph/scenegraph.js +2 -11
  32. package/cjs/scenegraph/scenegraph.js.map +1 -1
  33. package/cjs/themes/ARCO.js +1 -1
  34. package/cjs/themes/BRIGHT.js +1 -1
  35. package/cjs/themes/DARK.js +1 -1
  36. package/cjs/themes/DEFAULT.js +1 -1
  37. package/cjs/themes/SIMPLIFY.js +1 -1
  38. package/cjs/tools/LimitPromiseQueue.js +1 -1
  39. package/cjs/tools/NumberMap.js +1 -1
  40. package/cjs/tools/Rect.js +1 -1
  41. package/cjs/tools/calc.js +1 -1
  42. package/cjs/tools/debounce.js +1 -1
  43. package/cjs/tools/diff-cell.js +2 -2
  44. package/cjs/ts-types/base-table.d.ts +0 -8
  45. package/cjs/ts-types/base-table.js.map +1 -1
  46. package/cjs/ts-types/customLayout.d.ts +1 -1
  47. package/cjs/ts-types/customLayout.js.map +1 -1
  48. package/cjs/ts-types/new-data-set.d.ts +9 -1
  49. package/cjs/ts-types/new-data-set.js +1 -1
  50. package/cjs/ts-types/new-data-set.js.map +1 -1
  51. package/cjs/vrender.d.ts +0 -4
  52. package/cjs/vrender.js +11 -39
  53. package/cjs/vrender.js.map +1 -1
  54. package/dist/vtable.js +10352 -25510
  55. package/dist/vtable.min.js +2 -2
  56. package/es/ListTable.js +3 -3
  57. package/es/ListTable.js.map +1 -1
  58. package/es/core/BaseTable.d.ts +0 -5
  59. package/es/core/BaseTable.js +20 -37
  60. package/es/core/BaseTable.js.map +1 -1
  61. package/es/core/style.js +1 -1
  62. package/es/core/style.js.map +1 -1
  63. package/es/data/DataSource.d.ts +6 -1
  64. package/es/data/DataSource.js +12 -2
  65. package/es/data/DataSource.js.map +1 -1
  66. package/es/dataset/dataset.d.ts +15 -2
  67. package/es/dataset/dataset.js +170 -68
  68. package/es/dataset/dataset.js.map +1 -1
  69. package/es/dataset/statistics-helper.d.ts +43 -3
  70. package/es/dataset/statistics-helper.js +55 -23
  71. package/es/dataset/statistics-helper.js.map +1 -1
  72. package/es/event/media-click.js +1 -2
  73. package/es/event/sparkline-event.js +2 -1
  74. package/es/index.d.ts +1 -3
  75. package/es/index.js +1 -5
  76. package/es/index.js.map +1 -1
  77. package/es/scenegraph/component/custom.js +3 -7
  78. package/es/scenegraph/component/custom.js.map +1 -1
  79. package/es/scenegraph/group-creater/cell-helper.js +0 -4
  80. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  81. package/es/scenegraph/layout/compute-col-width.js +2 -2
  82. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  83. package/es/scenegraph/layout/compute-row-height.js +2 -2
  84. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  85. package/es/scenegraph/scenegraph.d.ts +0 -1
  86. package/es/scenegraph/scenegraph.js +2 -11
  87. package/es/scenegraph/scenegraph.js.map +1 -1
  88. package/es/themes/ARCO.js +1 -1
  89. package/es/themes/BRIGHT.js +1 -1
  90. package/es/themes/DARK.js +1 -1
  91. package/es/themes/DEFAULT.js +1 -1
  92. package/es/themes/SIMPLIFY.js +1 -1
  93. package/es/tools/LimitPromiseQueue.js +1 -1
  94. package/es/tools/NumberMap.js +1 -1
  95. package/es/tools/Rect.js +1 -1
  96. package/es/tools/calc.js +1 -1
  97. package/es/tools/debounce.js +1 -1
  98. package/es/tools/diff-cell.js +1 -1
  99. package/es/ts-types/base-table.d.ts +0 -8
  100. package/es/ts-types/base-table.js.map +1 -1
  101. package/es/ts-types/customLayout.d.ts +1 -1
  102. package/es/ts-types/customLayout.js.map +1 -1
  103. package/es/ts-types/new-data-set.d.ts +9 -1
  104. package/es/ts-types/new-data-set.js +1 -1
  105. package/es/ts-types/new-data-set.js.map +1 -1
  106. package/es/vrender.d.ts +0 -4
  107. package/es/vrender.js +3 -9
  108. package/es/vrender.js.map +1 -1
  109. package/package.json +5 -6
  110. package/cjs/components/react/react-custom-layout.d.ts +0 -21
  111. package/cjs/components/react/react-custom-layout.js +0 -48
  112. package/cjs/components/react/react-custom-layout.js.map +0 -1
  113. package/es/components/react/react-custom-layout.d.ts +0 -21
  114. package/es/components/react/react-custom-layout.js +0 -38
  115. package/es/components/react/react-custom-layout.js.map +0 -1
@@ -1,38 +0,0 @@
1
- import { Group } from "./../../vrender";
2
-
3
- export function emptyCustomLayout(args) {
4
- return {
5
- rootContainer: new Group({}),
6
- renderDefault: !0
7
- };
8
- }
9
-
10
- export class ReactCustomLayout {
11
- constructor(table) {
12
- this.table = table, this.customLayoutFuncCache = new Map, this.reactRemoveGraphicCache = new Map,
13
- this.headerCustomLayoutFuncCache = new Map, this.headerReactRemoveGraphicCache = new Map;
14
- }
15
- hasReactCreateGraphic(componentIndex, isHeaderCustomLayout) {
16
- return isHeaderCustomLayout ? this.headerCustomLayoutFuncCache.has(componentIndex) : this.customLayoutFuncCache.has(componentIndex);
17
- }
18
- setReactCreateGraphic(componentIndex, createGraphic, isHeaderCustomLayout) {
19
- isHeaderCustomLayout ? this.headerCustomLayoutFuncCache.set(componentIndex, createGraphic) : this.customLayoutFuncCache.set(componentIndex, createGraphic);
20
- }
21
- setReactRemoveGraphic(componentIndex, removeGraphic, isHeaderCustomLayout) {
22
- isHeaderCustomLayout ? this.headerReactRemoveGraphicCache.set(componentIndex, removeGraphic) : this.reactRemoveGraphicCache.set(componentIndex, removeGraphic);
23
- }
24
- updateCustomCell(componentIndex, isHeaderCustomLayout) {
25
- const table = this.table, col = componentIndex;
26
- if (isHeaderCustomLayout) for (let row = 0; row < table.columnHeaderLevelCount; row++) table.scenegraph.updateCellContent(col, row); else for (let row = table.columnHeaderLevelCount; row < table.rowCount; row++) table.scenegraph.updateCellContent(col, row);
27
- table.scenegraph.renderSceneGraph();
28
- }
29
- getCustomLayoutFunc(col, row) {
30
- const {startInTotal: startInTotal} = this.table.getBodyColumnDefine(col, row);
31
- return (this.table.isHeader(col, row) ? this.headerCustomLayoutFuncCache.get(startInTotal) : this.customLayoutFuncCache.get(startInTotal)) || emptyCustomLayout;
32
- }
33
- removeCustomCell(col, row) {
34
- const {startInTotal: startInTotal} = this.table.getBodyColumnDefine(col, row), removeFun = this.table.isHeader(col, row) ? this.headerReactRemoveGraphicCache.get(startInTotal) : this.reactRemoveGraphicCache.get(startInTotal);
35
- removeFun && removeFun(col, row);
36
- }
37
- }
38
- //# sourceMappingUR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AgB,CAAC,GAAW,EAAE,GAAW;QACvC,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAQ,CAAC;QACzE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,QAAQ;YACxB,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,GAAG,CAAC,YAAY,CAAC;YACtD,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACnD,IAAI,SAAS,EAAE;YACb,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;SACrB;IACH,CAAC;CACF","file":"react-custom-layout.js","sourcesContent":["import { Group } from './../../vrender';\nimport type { CustomRenderFunctionArg, ICustomLayoutFuc } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport function emptyCustomLayout(args: CustomRenderFunctionArg) {\n const group = new Group({});\n return {\n rootContainer: group,\n renderDefault: true\n };\n}\n\nexport class ReactCustomLayout {\n table: BaseTableAPI;\n customLayoutFuncCache: Map<number, ICustomLayoutFuc>;\n reactRemoveGraphicCache: Map<number, (col: number, row: number) => void>;\n headerCustomLayoutFuncCache: Map<number, ICustomLayoutFuc>;\n headerReactRemoveGraphicCache: Map<number, (col: number, row: number) => void>;\n // reactContainerCache: Map<number, Map<string, any>>;\n constructor(table: BaseTableAPI) {\n this.table = table;\n this.customLayoutFuncCache = new Map();\n // this.reactContainerCache = new Map();\n this.reactRemoveGraphicCache = new Map();\n this.headerCustomLayoutFuncCache = new Map();\n // this.headerCeactContainerCache = new Map();\n this.headerReactRemoveGraphicCache = new Map();\n }\n\n hasReactCreateGraphic(componentIndex: number, isHeaderCustomLayout?: boolean) {\n if (isHeaderCustomLayout) {\n return this.headerCustomLayoutFuncCache.has(componentIndex);\n }\n return this.customLayoutFuncCache.has(componentIndex);\n }\n\n setReactCreateGraphic(\n componentIndex: number,\n createGraphic: ICustomLayoutFuc,\n // containerCache: Map<string, any>,\n isHeaderCustomLayout?: boolean\n ) {\n if (isHeaderCustomLayout) {\n this.headerCustomLayoutFuncCache.set(componentIndex, createGraphic);\n } else {\n this.customLayoutFuncCache.set(componentIndex, createGraphic);\n }\n // this.reactContainerCache.set(componentIndex, containerCache);\n }\n\n setReactRemoveGraphic(\n componentIndex: number,\n removeGraphic: (col: number, row: number) => void,\n isHeaderCustomLayout?: boolean\n ) {\n if (isHeaderCustomLayout) {\n this.headerReactRemoveGraphicCache.set(componentIndex, removeGraphic);\n } else {\n this.reactRemoveGraphicCache.set(componentIndex, removeGraphic);\n }\n }\n\n updateCustomCell(componentIndex: number, isHeaderCustomLayout?: boolean) {\n const table = this.table;\n const col = componentIndex;\n // to do: deal with transpose table\n if (isHeaderCustomLayout) {\n for (let row = 0; row < table.columnHeaderLevelCount; row++) {\n table.scenegraph.updateCellContent(col, row);\n }\n } else {\n for (let row = table.columnHeaderLevelCount; row < table.rowCount; row++) {\n table.scenegraph.updateCellContent(col, row);\n }\n }\n // table.scenegraph.updateNextFrame();\n table.scenegraph.renderSceneGraph(); // use sync render for faster update\n }\n\n getCustomLayoutFunc(col: number, row: number) {\n const { startInTotal } = this.table.getBodyColumnDefine(col, row) as any;\n const isHeader = this.table.isHeader(col, row);\n return (\n (isHeader ? this.headerCustomLayoutFuncCache.get(startInTotal) : this.customLayoutFuncCache.get(startInTotal)) ||\n emptyCustomLayout\n );\n }\n\n removeCustomCell(col: number, row: number) {\n const { startInTotal } = this.table.getBodyColumnDefine(col, row) as any;\n const isHeader = this.table.isHeader(col, row);\n const removeFun = isHeader\n ? this.headerReactRemoveGraphicCache.get(startInTotal)\n : this.reactRemoveGraphicCache.get(startInTotal);\n if (removeFun) {\n removeFun(col, row);\n }\n }\n}\n"]}