@visactor/vtable 1.26.4-alpha.0 → 1.26.4

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.d.ts +0 -1
  2. package/cjs/ListTable.js +4 -25
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/body-helper/style.js +1 -2
  5. package/cjs/core/BaseTable.js +3 -4
  6. package/cjs/core/BaseTable.js.map +1 -1
  7. package/cjs/core/FouseInput.js +2 -1
  8. package/cjs/core/tableHelper.d.ts +0 -2
  9. package/cjs/core/tableHelper.js +8 -13
  10. package/cjs/core/tableHelper.js.map +1 -1
  11. package/cjs/data/CachedDataSource.d.ts +0 -1
  12. package/cjs/data/CachedDataSource.js +0 -22
  13. package/cjs/data/CachedDataSource.js.map +1 -1
  14. package/cjs/dataset/DataStatistics.js +1 -2
  15. package/cjs/dataset/flatDataToObject.js +2 -1
  16. package/cjs/event/helper.js +1 -1
  17. package/cjs/event/listener/table-group.js +52 -52
  18. package/cjs/event/listener/table-group.js.map +1 -1
  19. package/cjs/event/media-click.js +1 -1
  20. package/cjs/event/scroll.js +1 -1
  21. package/cjs/event/sparkline-event.js +1 -1
  22. package/cjs/event/util.js +1 -1
  23. package/cjs/header-helper/style.js +1 -2
  24. package/cjs/index.d.ts +1 -1
  25. package/cjs/index.js +1 -1
  26. package/cjs/index.js.map +1 -1
  27. package/cjs/plugins/index.js +1 -1
  28. package/cjs/plugins/interface.js +2 -1
  29. package/cjs/plugins/invert-highlight.js +1 -1
  30. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  31. package/cjs/plugins/plugin-manager.js +1 -1
  32. package/cjs/scenegraph/component/custom.js +2 -2
  33. package/cjs/scenegraph/component/custom.js.map +1 -1
  34. package/cjs/scenegraph/group-creater/cell-helper.d.ts +1 -1
  35. package/cjs/scenegraph/group-creater/cell-helper.js +5 -5
  36. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  37. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +1 -1
  38. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  39. package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -1
  40. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +2 -3
  41. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  42. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +94 -8
  43. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  44. package/cjs/scenegraph/group-creater/column-helper.js +6 -9
  45. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  46. package/cjs/scenegraph/layout/compute-col-width.js +1 -1
  47. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  48. package/cjs/scenegraph/layout/compute-row-height.js +1 -1
  49. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  50. package/cjs/scenegraph/scenegraph.js +13 -22
  51. package/cjs/scenegraph/scenegraph.js.map +1 -1
  52. package/cjs/scenegraph/utils/text-icon-layout.js +4 -4
  53. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  54. package/cjs/ts-types/base-table.d.ts +3 -0
  55. package/cjs/ts-types/base-table.js.map +1 -1
  56. package/cjs/vrender.js.map +1 -1
  57. package/dist/vtable.js +227 -183
  58. package/dist/vtable.min.js +1 -1
  59. package/es/ListTable.d.ts +0 -1
  60. package/es/ListTable.js +6 -26
  61. package/es/ListTable.js.map +1 -1
  62. package/es/body-helper/style.js +1 -2
  63. package/es/core/BaseTable.js +2 -2
  64. package/es/core/BaseTable.js.map +1 -1
  65. package/es/core/FouseInput.js +2 -1
  66. package/es/core/tableHelper.d.ts +0 -2
  67. package/es/core/tableHelper.js +7 -11
  68. package/es/core/tableHelper.js.map +1 -1
  69. package/es/data/CachedDataSource.d.ts +0 -1
  70. package/es/data/CachedDataSource.js +0 -22
  71. package/es/data/CachedDataSource.js.map +1 -1
  72. package/es/dataset/DataStatistics.js +1 -2
  73. package/es/dataset/flatDataToObject.js +2 -1
  74. package/es/event/helper.js +1 -1
  75. package/es/event/listener/table-group.js +52 -52
  76. package/es/event/listener/table-group.js.map +1 -1
  77. package/es/event/media-click.js +1 -1
  78. package/es/event/scroll.js +1 -1
  79. package/es/event/sparkline-event.js +1 -1
  80. package/es/event/util.js +1 -1
  81. package/es/header-helper/style.js +1 -2
  82. package/es/index.d.ts +1 -1
  83. package/es/index.js +1 -1
  84. package/es/index.js.map +1 -1
  85. package/es/plugins/index.js +1 -1
  86. package/es/plugins/interface.js +2 -1
  87. package/es/plugins/invert-highlight.js +1 -1
  88. package/es/plugins/list-tree-stick-cell.js +1 -1
  89. package/es/plugins/plugin-manager.js +1 -1
  90. package/es/scenegraph/component/custom.js +2 -2
  91. package/es/scenegraph/component/custom.js.map +1 -1
  92. package/es/scenegraph/group-creater/cell-helper.d.ts +1 -1
  93. package/es/scenegraph/group-creater/cell-helper.js +5 -5
  94. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  95. package/es/scenegraph/group-creater/cell-type/image-cell.js +1 -1
  96. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  97. package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -1
  98. package/es/scenegraph/group-creater/cell-type/text-cell.js +2 -3
  99. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  100. package/es/scenegraph/group-creater/cell-type/video-cell.js +92 -8
  101. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  102. package/es/scenegraph/group-creater/column-helper.js +6 -9
  103. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  104. package/es/scenegraph/layout/compute-col-width.js +1 -1
  105. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  106. package/es/scenegraph/layout/compute-row-height.js +1 -1
  107. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  108. package/es/scenegraph/scenegraph.js +10 -22
  109. package/es/scenegraph/scenegraph.js.map +1 -1
  110. package/es/scenegraph/utils/text-icon-layout.js +4 -4
  111. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  112. package/es/ts-types/base-table.d.ts +3 -0
  113. package/es/ts-types/base-table.js.map +1 -1
  114. package/es/vrender.js.map +1 -1
  115. package/package.json +4 -4
@@ -45,7 +45,6 @@ export declare class ListTable extends BaseTable implements ListTableAPI {
45
45
  clearColWidthCache?: boolean;
46
46
  clearRowHeightCache?: boolean;
47
47
  }): Promise<unknown>;
48
- private _refreshCurrentRecordsForOptionUpdate;
49
48
  updatePagination(pagination: IPagination): void;
50
49
  refreshHeader(): void;
51
50
  refreshRowColCount(): void;
package/cjs/ListTable.js CHANGED
@@ -368,10 +368,9 @@ class ListTable extends core_1.BaseTable {
368
368
  clearRowHeightCache: !0
369
369
  }) {
370
370
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
371
- const internalProps = this.internalProps, prevSortState = internalProps.sortState, hasActiveSortState = (Array.isArray(options.sortState) ? options.sortState : options.sortState ? [ options.sortState ] : []).some((item => (null == item ? void 0 : item.field) && (null == item ? void 0 : item.order) && "normal" !== item.order)), shouldSkipInitialClearCells = Boolean(options.records) || !!options.dataSource && this.dataSource !== options.dataSource;
372
- if (this.pluginManager.removeOrAddPlugins(options.plugins), super.updateOption(options, Object.assign(Object.assign({}, updateConfig), {
373
- skipClearCells: shouldSkipInitialClearCells
374
- })), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode,
371
+ const internalProps = this.internalProps;
372
+ if (this.pluginManager.removeOrAddPlugins(options.plugins), super.updateOption(options, updateConfig),
373
+ internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode,
375
374
  this.pagination = options.pagination, internalProps.sortState = options.sortState,
376
375
  internalProps.dataConfig = this.internalProps.groupBy ? (0, group_helper_1.getGroupByDataConfig)(this.internalProps.groupBy, options.addRecordRule) : {
377
376
  addRecordRule: options.addRecordRule
@@ -387,7 +386,7 @@ class ListTable extends core_1.BaseTable {
387
386
  releaseObj instanceof data_1.DataSource ? releaseObj.updateColumns(this.internalProps.columns) : (null === (_g = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _g || _g.call(releaseObj),
388
387
  internalProps.releaseList.splice(i, 1));
389
388
  }
390
- if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records && options.records === internalProps.records && options.sortState === prevSortState && !hasActiveSortState && this.dataSource instanceof data_1.CachedDataSource ? this._refreshCurrentRecordsForOptionUpdate(options.records) : options.records ? this.setRecords(options.records, {
389
+ if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
391
390
  sortState: options.sortState
392
391
  }) : (this.refreshRowColCount(), this._resetFrozenColCount(), this.scenegraph.createSceneGraph(),
393
392
  this.render()), options.title) {
@@ -404,26 +403,6 @@ class ListTable extends core_1.BaseTable {
404
403
  setTimeout(resolve, 0);
405
404
  }));
406
405
  }
407
- _refreshCurrentRecordsForOptionUpdate(records) {
408
- var _a;
409
- const dataSource = this.dataSource;
410
- this.stateManager.endResizeIfResizing(), (0, chart_render_helper_1.clearChartRenderQueue)();
411
- const oldHoverState = {
412
- col: this.stateManager.hover.cellPos.col,
413
- row: this.stateManager.hover.cellPos.row
414
- };
415
- this.scenegraph.clearCells(), this.internalProps.records = records, dataSource.refreshRecords(records, this.internalProps.dataConfig, this.pagination, this.internalProps.columns, (0,
416
- tableHelper_1.getListTableRowHierarchyType)(this), (0, tableHelper_1.getHierarchyExpandLevel)(this)),
417
- this.refreshRowColCount(), this.stateManager.initCheckedState(records), this.clearCellStyleCache(),
418
- this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
419
- this._updateSize();
420
- (null !== (_a = this.options.componentLayoutOrder) && void 0 !== _a ? _a : [ "legend", "title" ]).forEach((component => {
421
- var _a, _b;
422
- "legend" === component ? null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach((legend => {
423
- null == legend || legend.resize();
424
- })) : "title" === component && (null === (_b = this.internalProps.title) || void 0 === _b || _b.resize());
425
- })), this.scenegraph.resize(), this.render();
426
- }
427
406
  updatePagination(pagination) {
428
407
  this.pagination && ("number" == typeof pagination.currentPage && pagination.currentPage >= 0 && (this.pagination.currentPage = pagination.currentPage),
429
408
  pagination.perPageCount && (this.pagination.perPageCount = pagination.perPageCount || this.pagination.perPageCount),