@visactor/vtable 1.26.3-alpha.0 → 1.26.4-alpha.0
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.
- package/cjs/ListTable.d.ts +1 -0
- package/cjs/ListTable.js +25 -4
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.js +7 -6
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/style.js +2 -1
- package/cjs/core/BaseTable.js +9 -8
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.js +1 -2
- package/cjs/core/tableHelper.d.ts +2 -0
- package/cjs/core/tableHelper.js +13 -8
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +1 -0
- package/cjs/data/CachedDataSource.js +22 -0
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/dataset/DataStatistics.js +2 -1
- package/cjs/dataset/flatDataToObject.js +1 -2
- package/cjs/event/EventHandler.js +1 -1
- package/cjs/event/EventTarget.js +1 -1
- package/cjs/event/drill.js +1 -1
- package/cjs/event/event.js +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +2 -2
- package/cjs/layout/pivot-header-layout.js +1 -0
- package/cjs/plugins/interface.js +1 -2
- package/cjs/scenegraph/group-creater/cell-helper.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +5 -5
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +3 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +9 -6
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +7 -3
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +23 -14
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/padding.d.ts +5 -2
- package/cjs/scenegraph/utils/padding.js +16 -13
- package/cjs/scenegraph/utils/padding.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +4 -4
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/state.js +1 -1
- package/cjs/themes/ARCO.js +1 -1
- package/cjs/themes/BRIGHT.js +1 -1
- package/dist/vtable.js +239 -89
- package/dist/vtable.min.js +1 -1
- package/es/ListTable.d.ts +1 -0
- package/es/ListTable.js +26 -6
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.js +7 -6
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/style.js +2 -1
- package/es/core/BaseTable.js +7 -7
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.js +1 -2
- package/es/core/tableHelper.d.ts +2 -0
- package/es/core/tableHelper.js +11 -7
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +1 -0
- package/es/data/CachedDataSource.js +22 -0
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/dataset/DataStatistics.js +2 -1
- package/es/dataset/flatDataToObject.js +1 -2
- package/es/event/EventHandler.js +1 -1
- package/es/event/EventTarget.js +1 -1
- package/es/event/drill.js +1 -1
- package/es/event/event.js +1 -1
- package/es/layout/pivot-header-layout.d.ts +2 -2
- package/es/layout/pivot-header-layout.js +2 -1
- package/es/plugins/interface.js +1 -2
- package/es/scenegraph/group-creater/cell-helper.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +5 -5
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +3 -2
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +9 -6
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +7 -3
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/scenegraph.js +23 -11
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/padding.d.ts +5 -2
- package/es/scenegraph/utils/padding.js +13 -9
- package/es/scenegraph/utils/padding.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +4 -4
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/state.js +1 -1
- package/es/themes/ARCO.js +1 -1
- package/es/themes/BRIGHT.js +1 -1
- package/package.json +4 -4
package/cjs/ListTable.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export declare class ListTable extends BaseTable implements ListTableAPI {
|
|
|
45
45
|
clearColWidthCache?: boolean;
|
|
46
46
|
clearRowHeightCache?: boolean;
|
|
47
47
|
}): Promise<unknown>;
|
|
48
|
+
private _refreshCurrentRecordsForOptionUpdate;
|
|
48
49
|
updatePagination(pagination: IPagination): void;
|
|
49
50
|
refreshHeader(): void;
|
|
50
51
|
refreshRowColCount(): void;
|
package/cjs/ListTable.js
CHANGED
|
@@ -368,9 +368,10 @@ 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;
|
|
372
|
-
if (this.pluginManager.removeOrAddPlugins(options.plugins), super.updateOption(options, updateConfig),
|
|
373
|
-
|
|
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,
|
|
374
375
|
this.pagination = options.pagination, internalProps.sortState = options.sortState,
|
|
375
376
|
internalProps.dataConfig = this.internalProps.groupBy ? (0, group_helper_1.getGroupByDataConfig)(this.internalProps.groupBy, options.addRecordRule) : {
|
|
376
377
|
addRecordRule: options.addRecordRule
|
|
@@ -386,7 +387,7 @@ class ListTable extends core_1.BaseTable {
|
|
|
386
387
|
releaseObj instanceof data_1.DataSource ? releaseObj.updateColumns(this.internalProps.columns) : (null === (_g = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _g || _g.call(releaseObj),
|
|
387
388
|
internalProps.releaseList.splice(i, 1));
|
|
388
389
|
}
|
|
389
|
-
if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
|
|
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, {
|
|
390
391
|
sortState: options.sortState
|
|
391
392
|
}) : (this.refreshRowColCount(), this._resetFrozenColCount(), this.scenegraph.createSceneGraph(),
|
|
392
393
|
this.render()), options.title) {
|
|
@@ -403,6 +404,26 @@ class ListTable extends core_1.BaseTable {
|
|
|
403
404
|
setTimeout(resolve, 0);
|
|
404
405
|
}));
|
|
405
406
|
}
|
|
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
|
+
}
|
|
406
427
|
updatePagination(pagination) {
|
|
407
428
|
this.pagination && ("number" == typeof pagination.currentPage && pagination.currentPage >= 0 && (this.pagination.currentPage = pagination.currentPage),
|
|
408
429
|
pagination.perPageCount && (this.pagination.perPageCount = pagination.perPageCount || this.pagination.perPageCount),
|