@canvas-components/list-table 0.3.4 → 0.3.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.
- package/dist/index.cjs +53 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +53 -18
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -10255,6 +10255,25 @@ var ListTableAnimationController = class {
|
|
|
10255
10255
|
}
|
|
10256
10256
|
return getAnimationValue(animation, this.scheduler.now());
|
|
10257
10257
|
}
|
|
10258
|
+
/**
|
|
10259
|
+
* 清理指定列的控制动画及历史值,避免离屏单元格再次出现时播放过期动画。
|
|
10260
|
+
*/
|
|
10261
|
+
resetControlAnimationsForColumn(columnKey) {
|
|
10262
|
+
Array.from(this.runtime.controlAnimations.keys()).forEach((key) => {
|
|
10263
|
+
if (isControlAnimationKeyForColumn(key, columnKey)) {
|
|
10264
|
+
this.runtime.controlAnimations.delete(key);
|
|
10265
|
+
}
|
|
10266
|
+
});
|
|
10267
|
+
Array.from(this.runtime.lastControlValues.keys()).forEach((key) => {
|
|
10268
|
+
if (isControlAnimationKeyForColumn(key, columnKey)) {
|
|
10269
|
+
this.runtime.lastControlValues.delete(key);
|
|
10270
|
+
}
|
|
10271
|
+
});
|
|
10272
|
+
if (this.runtime.controlAnimations.size === 0 && this.runtime.controlAnimationFrameId != null) {
|
|
10273
|
+
this.scheduler.cancelAnimationFrame(this.runtime.controlAnimationFrameId);
|
|
10274
|
+
this.runtime.controlAnimationFrameId = null;
|
|
10275
|
+
}
|
|
10276
|
+
}
|
|
10258
10277
|
getNestedTableHighlight(params) {
|
|
10259
10278
|
return this.runtime.nestedTableHighlights.get(
|
|
10260
10279
|
getNestedTableHighlightKey(
|
|
@@ -10465,6 +10484,14 @@ function createDefaultAnimationScheduler() {
|
|
|
10465
10484
|
clearInterval: (id) => window.clearInterval(id)
|
|
10466
10485
|
};
|
|
10467
10486
|
}
|
|
10487
|
+
function isControlAnimationKeyForColumn(key, columnKey) {
|
|
10488
|
+
const contentSeparatorIndex = key.lastIndexOf("::");
|
|
10489
|
+
if (contentSeparatorIndex < 0) {
|
|
10490
|
+
return false;
|
|
10491
|
+
}
|
|
10492
|
+
const columnSeparatorIndex = key.lastIndexOf("::", contentSeparatorIndex - 1);
|
|
10493
|
+
return columnSeparatorIndex >= 0 && key.slice(columnSeparatorIndex + 2, contentSeparatorIndex) === columnKey;
|
|
10494
|
+
}
|
|
10468
10495
|
|
|
10469
10496
|
// src/shared/carousel/carousel.ts
|
|
10470
10497
|
function resolveCarouselScrollInterval(params) {
|
|
@@ -18078,6 +18105,7 @@ var ListTableHeaderActionController = class {
|
|
|
18078
18105
|
this.options.clearExpandedRows();
|
|
18079
18106
|
this.options.clearCollapsedRows();
|
|
18080
18107
|
this.options.filterPanel.hide();
|
|
18108
|
+
this.options.persistColumnConfig();
|
|
18081
18109
|
this.options.applyFilterQueryAsync();
|
|
18082
18110
|
}
|
|
18083
18111
|
};
|
|
@@ -18527,7 +18555,8 @@ var ListTablePersistenceController = class {
|
|
|
18527
18555
|
__publicField(this, "options");
|
|
18528
18556
|
this.options = options;
|
|
18529
18557
|
}
|
|
18530
|
-
async loadStoredConfig() {
|
|
18558
|
+
async loadStoredConfig(options = {}) {
|
|
18559
|
+
const { restoreQueryState = true } = options;
|
|
18531
18560
|
const tableOptions = this.options.getOptions();
|
|
18532
18561
|
const stored = await loadListTableStoredConfig({
|
|
18533
18562
|
storageKey: tableOptions.storageKey,
|
|
@@ -18536,10 +18565,10 @@ var ListTablePersistenceController = class {
|
|
|
18536
18565
|
if (!stored) {
|
|
18537
18566
|
return;
|
|
18538
18567
|
}
|
|
18539
|
-
if (stored.sortState) {
|
|
18568
|
+
if (restoreQueryState && stored.sortState) {
|
|
18540
18569
|
this.options.setSortState(stored.sortState);
|
|
18541
18570
|
}
|
|
18542
|
-
if (stored.filterState) {
|
|
18571
|
+
if (restoreQueryState && stored.filterState) {
|
|
18543
18572
|
this.options.setFilterState(stored.filterState);
|
|
18544
18573
|
}
|
|
18545
18574
|
if (stored.zoom != null) {
|
|
@@ -21323,13 +21352,14 @@ function syncListTablePagination(params) {
|
|
|
21323
21352
|
scrollPageSize
|
|
21324
21353
|
},
|
|
21325
21354
|
onChange: (page, nextPageSize) => {
|
|
21326
|
-
store.dispatch(
|
|
21327
|
-
|
|
21328
|
-
|
|
21329
|
-
|
|
21330
|
-
|
|
21331
|
-
|
|
21332
|
-
|
|
21355
|
+
store.dispatch(
|
|
21356
|
+
setPaginationAction(
|
|
21357
|
+
updatePaginationState(store.getSnapshot().query.pagination, {
|
|
21358
|
+
currentPage: page,
|
|
21359
|
+
pageSize: nextPageSize
|
|
21360
|
+
})
|
|
21361
|
+
)
|
|
21362
|
+
);
|
|
21333
21363
|
if (options.pagination) {
|
|
21334
21364
|
options.pagination.onChange?.(page, nextPageSize);
|
|
21335
21365
|
}
|
|
@@ -21340,15 +21370,17 @@ function syncListTablePagination(params) {
|
|
|
21340
21370
|
}
|
|
21341
21371
|
},
|
|
21342
21372
|
onPageSizeChange: (page, nextPageSize) => {
|
|
21343
|
-
store.dispatch(
|
|
21344
|
-
|
|
21345
|
-
|
|
21346
|
-
|
|
21347
|
-
|
|
21348
|
-
|
|
21349
|
-
|
|
21373
|
+
store.dispatch(
|
|
21374
|
+
setPaginationAction(
|
|
21375
|
+
updatePaginationState(store.getSnapshot().query.pagination, {
|
|
21376
|
+
currentPage: page,
|
|
21377
|
+
pageSize: nextPageSize
|
|
21378
|
+
})
|
|
21379
|
+
)
|
|
21380
|
+
);
|
|
21350
21381
|
if (options.pagination) {
|
|
21351
21382
|
options.pagination.onShowSizeChange?.(page, nextPageSize);
|
|
21383
|
+
options.pagination.onChange?.(page, nextPageSize);
|
|
21352
21384
|
}
|
|
21353
21385
|
if (options.query?.onChange) {
|
|
21354
21386
|
emitQueryChange("paginate");
|
|
@@ -25736,6 +25768,9 @@ var ListTableRowActionController = class {
|
|
|
25736
25768
|
if (!nextKeys) {
|
|
25737
25769
|
return;
|
|
25738
25770
|
}
|
|
25771
|
+
this.options.animationController.resetControlAnimationsForColumn(
|
|
25772
|
+
ROW_SELECTION_COLUMN_KEY
|
|
25773
|
+
);
|
|
25739
25774
|
this.updateSelectedRowKeys(nextKeys, "all");
|
|
25740
25775
|
this.options.requestRender();
|
|
25741
25776
|
}
|
|
@@ -27200,7 +27235,7 @@ var ListTableCore = class {
|
|
|
27200
27235
|
this.hideFloatingOverlays({ includeLoading: true });
|
|
27201
27236
|
this.refreshRuntimeColumns();
|
|
27202
27237
|
this.renderController.render();
|
|
27203
|
-
this.persistenceController.loadStoredConfig();
|
|
27238
|
+
this.persistenceController.loadStoredConfig({ restoreQueryState: false });
|
|
27204
27239
|
host.tableId = options.tableId?.trim() ? options.tableId : host.tableId;
|
|
27205
27240
|
host.rowDragController.syncRegistration();
|
|
27206
27241
|
}
|