@infinite-table/infinite-react 1.3.20 → 1.3.22
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/index.d.ts +22 -5
- package/index.dev.js +172 -169
- package/index.dev.mjs +190 -187
- package/index.js +5 -5
- package/index.mjs +5 -5
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -492,9 +492,6 @@ declare type InfiniteTableComputedColumnBase<T> = {
|
|
|
492
492
|
computedFirst: boolean;
|
|
493
493
|
computedLast: boolean;
|
|
494
494
|
computedEditable: NonUndefined<InfiniteTableColumn<T>['defaultEditable']>;
|
|
495
|
-
toggleSort: (params?: {
|
|
496
|
-
multiSortBehavior: InfiniteTablePropMultiSortBehavior;
|
|
497
|
-
}) => void;
|
|
498
495
|
colType: InfiniteTableColumnType<T>;
|
|
499
496
|
id: string;
|
|
500
497
|
};
|
|
@@ -1222,6 +1219,7 @@ interface InfiniteTableMappedState<T> {
|
|
|
1222
1219
|
showSeparatePivotColumnForSingleAggregation: NonUndefined<InfiniteTableProps<T>['showSeparatePivotColumnForSingleAggregation']>;
|
|
1223
1220
|
domProps: InfiniteTableProps<T>['domProps'];
|
|
1224
1221
|
editable: InfiniteTableProps<T>['editable'];
|
|
1222
|
+
columnMenuRealignDelay: NonUndefined<InfiniteTableProps<T>['columnMenuRealignDelay']>;
|
|
1225
1223
|
columnDefaultEditable: InfiniteTableProps<T>['columnDefaultEditable'];
|
|
1226
1224
|
columnDefaultFilterable: InfiniteTableProps<T>['columnDefaultFilterable'];
|
|
1227
1225
|
rowStyle: InfiniteTableProps<T>['rowStyle'];
|
|
@@ -1654,6 +1652,7 @@ interface DataSourceApi<T> {
|
|
|
1654
1652
|
addDataArray(data: T[], options?: DataSourceCRUDParam): Promise<any>;
|
|
1655
1653
|
insertData(data: T, options: DataSourceInsertParam): Promise<any>;
|
|
1656
1654
|
insertDataArray(data: T[], options: DataSourceInsertParam): Promise<any>;
|
|
1655
|
+
setSortInfo(sortInfo: null | DataSourceSingleSortInfo<T>[]): void;
|
|
1657
1656
|
}
|
|
1658
1657
|
declare type DataSourcePropRowInfoReducers<T> = Record<string, DataSourceRowInfoReducer<T>>;
|
|
1659
1658
|
declare type DataSourceRowInfoReducer<T> = DataSourceRawReducer<InfiniteTableRowInfo<T>, any>;
|
|
@@ -2370,9 +2369,11 @@ declare type InfiniteTableColumnApi<_T> = {
|
|
|
2370
2369
|
toggleFilterOperatorMenu: (target: EventTarget | HTMLElement) => void;
|
|
2371
2370
|
hideFilterOperatorMenu: () => void;
|
|
2372
2371
|
isVisible: () => boolean;
|
|
2373
|
-
|
|
2372
|
+
getSortInfo: () => DataSourceSingleSortInfo<_T> | null;
|
|
2373
|
+
getSortDir(): SortDir | null;
|
|
2374
|
+
toggleSort: (options?: MultiSortBehaviorOptions) => void;
|
|
2374
2375
|
clearSort: () => void;
|
|
2375
|
-
setSort: (sort: SortDir | null) => void;
|
|
2376
|
+
setSort: (sort: SortDir | null, options?: MultiSortBehaviorOptions) => void;
|
|
2376
2377
|
setFilter: (value: any) => void;
|
|
2377
2378
|
clearFilter: (value: any) => void;
|
|
2378
2379
|
getCellValuesByPrimaryKey: (id: any) => null | ColumnCellValues;
|
|
@@ -2406,10 +2407,14 @@ declare type InfiniteTableApiStopEditPromiseResolveType = {
|
|
|
2406
2407
|
reject: Error;
|
|
2407
2408
|
value: any;
|
|
2408
2409
|
} | boolean;
|
|
2410
|
+
declare type MultiSortBehaviorOptions = {
|
|
2411
|
+
multiSortBehavior?: InfiniteTablePropMultiSortBehavior;
|
|
2412
|
+
};
|
|
2409
2413
|
interface InfiniteTableApi<T> {
|
|
2410
2414
|
get selectionApi(): InfiniteTableSelectionApi;
|
|
2411
2415
|
setColumnOrder: (columnOrder: InfiniteTablePropColumnOrder) => void;
|
|
2412
2416
|
setColumnVisibility: (columnVisibility: InfiniteTablePropColumnVisibility) => void;
|
|
2417
|
+
isDestroyed: () => boolean;
|
|
2413
2418
|
clearEditInfo: () => void;
|
|
2414
2419
|
hideContextMenu: () => void;
|
|
2415
2420
|
realignColumnContextMenu: () => void;
|
|
@@ -2441,12 +2446,16 @@ interface InfiniteTableApi<T> {
|
|
|
2441
2446
|
collapseGroupRow: (groupKeys: any[]) => boolean;
|
|
2442
2447
|
expandGroupRow: (groupKeys: any[]) => boolean;
|
|
2443
2448
|
setSortInfoForColumn: (columnId: string, sortInfo: DataSourceSingleSortInfo<T> | null) => void;
|
|
2449
|
+
getSortInfoForColumn: (columnId: string) => DataSourceSingleSortInfo<T> | null;
|
|
2450
|
+
getSortTypeForColumn: (columnId: string) => string | null;
|
|
2451
|
+
toggleSortingForColumn: (columnId: string, options?: MultiSortBehaviorOptions) => void;
|
|
2444
2452
|
setColumnFilter: (columnId: string, filterValue: any) => void;
|
|
2445
2453
|
setColumnFilterOperator: (columnId: string, operator: string) => void;
|
|
2446
2454
|
clearColumnFilter: (columnId: string) => void;
|
|
2447
2455
|
setFilterValueForColumn: (columnId: string, filterValue: DataSourceFilterValueItem<T>) => void;
|
|
2448
2456
|
setPinningForColumn: (columnId: string, pinning: InfiniteTableColumnPinnedValues) => void;
|
|
2449
2457
|
setSortingForColumn: (columnId: string, dir: SortDir | null) => void;
|
|
2458
|
+
getSortingForColumn: (columnId: string) => SortDir | null;
|
|
2450
2459
|
getColumnApi: (columnId: string) => InfiniteTableColumnApi<T> | null;
|
|
2451
2460
|
setVisibilityForColumn: (columnId: string, visible: boolean) => void;
|
|
2452
2461
|
getVisibleColumnsCount: () => number;
|
|
@@ -2655,6 +2664,14 @@ interface InfiniteTableProps<T> {
|
|
|
2655
2664
|
onSelfBlur?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
|
|
2656
2665
|
onFocusWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
|
|
2657
2666
|
onBlurWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
|
|
2667
|
+
/**
|
|
2668
|
+
* When a column is hidden by using the column menu, the column menu will stay open,
|
|
2669
|
+
* so it needs (generally) to be realigned to the correct location. This prop
|
|
2670
|
+
* configures the delay in milliseconds before the column menu is realigned.
|
|
2671
|
+
*
|
|
2672
|
+
* @default 50
|
|
2673
|
+
*/
|
|
2674
|
+
columnMenuRealignDelay?: number;
|
|
2658
2675
|
onScrollToTop?: () => void;
|
|
2659
2676
|
onScrollToBottom?: () => void;
|
|
2660
2677
|
scrollStopDelay?: number;
|
package/index.dev.js
CHANGED
|
@@ -5281,7 +5281,10 @@ function getColumnApiForColumn(colOrColId, param) {
|
|
|
5281
5281
|
toggleSort(params = {
|
|
5282
5282
|
multiSortBehavior: "replace"
|
|
5283
5283
|
}) {
|
|
5284
|
-
column.
|
|
5284
|
+
return api.toggleSortingForColumn(column.id, params);
|
|
5285
|
+
},
|
|
5286
|
+
getSortDir() {
|
|
5287
|
+
return api.getSortingForColumn(column.id);
|
|
5285
5288
|
},
|
|
5286
5289
|
setFilter(value) {
|
|
5287
5290
|
return api.setColumnFilter(column.id, value);
|
|
@@ -5289,6 +5292,9 @@ function getColumnApiForColumn(colOrColId, param) {
|
|
|
5289
5292
|
clearFilter() {
|
|
5290
5293
|
return api.clearColumnFilter(column.id);
|
|
5291
5294
|
},
|
|
5295
|
+
getSortInfo() {
|
|
5296
|
+
return api.getSortInfoForColumn(column.id);
|
|
5297
|
+
},
|
|
5292
5298
|
setSort(sort) {
|
|
5293
5299
|
if (!sort) {
|
|
5294
5300
|
api.setSortInfoForColumn(column.id, null);
|
|
@@ -6525,7 +6531,7 @@ var useColumnPointerEvents = ({
|
|
|
6525
6531
|
target2.removeEventListener("pointerup", onPointerUp);
|
|
6526
6532
|
setProxyPosition(null);
|
|
6527
6533
|
if (!didDragAtLeastOnce && dragColumn.computedSortable) {
|
|
6528
|
-
dragColumn.
|
|
6534
|
+
api.toggleSortingForColumn(dragColumn.id, {
|
|
6529
6535
|
multiSortBehavior: multiSortBehavior === "replace" && (e2.ctrlKey || e2.metaKey) ? "append" : multiSortBehavior
|
|
6530
6536
|
});
|
|
6531
6537
|
}
|
|
@@ -10628,6 +10634,15 @@ var DataSourceApiImpl = class {
|
|
|
10628
10634
|
}
|
|
10629
10635
|
return result;
|
|
10630
10636
|
}
|
|
10637
|
+
setSortInfo(sortInfo) {
|
|
10638
|
+
const multiSort = this.getState().multiSort;
|
|
10639
|
+
if (Array.isArray(sortInfo)) {
|
|
10640
|
+
this.actions.sortInfo = sortInfo.length ? multiSort ? sortInfo : sortInfo[0] : null;
|
|
10641
|
+
return;
|
|
10642
|
+
}
|
|
10643
|
+
this.actions.sortInfo = sortInfo;
|
|
10644
|
+
return;
|
|
10645
|
+
}
|
|
10631
10646
|
};
|
|
10632
10647
|
function getCacheAffectedParts(state) {
|
|
10633
10648
|
const cache = state.cache;
|
|
@@ -13486,7 +13501,29 @@ function realignColumnContextMenu(param) {
|
|
|
13486
13501
|
return colId;
|
|
13487
13502
|
}
|
|
13488
13503
|
|
|
13504
|
+
// src/components/InfiniteTable/types/Utility.ts
|
|
13505
|
+
function notNullable(value) {
|
|
13506
|
+
if (value === null || value === void 0)
|
|
13507
|
+
return false;
|
|
13508
|
+
const testDummyForCompileError = value;
|
|
13509
|
+
return true;
|
|
13510
|
+
}
|
|
13511
|
+
|
|
13489
13512
|
// src/components/InfiniteTable/api/getImperativeApi.ts
|
|
13513
|
+
function isSortInfoForColumn(sortInfo, col) {
|
|
13514
|
+
if (sortInfo.id) {
|
|
13515
|
+
if (sortInfo.id === col.id) {
|
|
13516
|
+
return true;
|
|
13517
|
+
}
|
|
13518
|
+
return false;
|
|
13519
|
+
}
|
|
13520
|
+
if (sortInfo.field) {
|
|
13521
|
+
if (sortInfo.field === col.field) {
|
|
13522
|
+
return true;
|
|
13523
|
+
}
|
|
13524
|
+
}
|
|
13525
|
+
return false;
|
|
13526
|
+
}
|
|
13490
13527
|
var InfiniteTableApiImpl = class {
|
|
13491
13528
|
constructor(context) {
|
|
13492
13529
|
this.persistEdit = (arg) => __async(this, null, function* () {
|
|
@@ -13785,6 +13822,9 @@ var InfiniteTableApiImpl = class {
|
|
|
13785
13822
|
get dataSourceActions() {
|
|
13786
13823
|
return this.context.dataSourceActions;
|
|
13787
13824
|
}
|
|
13825
|
+
get dataSourceApi() {
|
|
13826
|
+
return this.context.dataSourceApi;
|
|
13827
|
+
}
|
|
13788
13828
|
focus() {
|
|
13789
13829
|
var _a;
|
|
13790
13830
|
(_a = this.getState().scrollerDOMRef.current) == null ? void 0 : _a.focus();
|
|
@@ -13793,12 +13833,27 @@ var InfiniteTableApiImpl = class {
|
|
|
13793
13833
|
this.actions.contextMenuVisibleFor = null;
|
|
13794
13834
|
this.actions.cellContextMenuVisibleFor = null;
|
|
13795
13835
|
}
|
|
13796
|
-
realignColumnContextMenu() {
|
|
13797
|
-
|
|
13836
|
+
realignColumnContextMenu(callback) {
|
|
13837
|
+
const param = {
|
|
13798
13838
|
actions: this.actions,
|
|
13799
13839
|
getState: this.getState,
|
|
13800
13840
|
getComputed: this.getComputed
|
|
13801
|
-
}
|
|
13841
|
+
};
|
|
13842
|
+
const delay = this.getState().columnMenuRealignDelay;
|
|
13843
|
+
if (!delay || delay < 0) {
|
|
13844
|
+
realignColumnContextMenu(param);
|
|
13845
|
+
callback == null ? void 0 : callback();
|
|
13846
|
+
}
|
|
13847
|
+
setTimeout(() => {
|
|
13848
|
+
if (this.isDestroyed()) {
|
|
13849
|
+
return;
|
|
13850
|
+
}
|
|
13851
|
+
realignColumnContextMenu(param);
|
|
13852
|
+
callback == null ? void 0 : callback();
|
|
13853
|
+
}, delay);
|
|
13854
|
+
}
|
|
13855
|
+
isDestroyed() {
|
|
13856
|
+
return !this.getState().domRef.current;
|
|
13802
13857
|
}
|
|
13803
13858
|
getColumnOrder() {
|
|
13804
13859
|
return this.getComputed().computedColumnOrder;
|
|
@@ -13905,29 +13960,121 @@ var InfiniteTableApiImpl = class {
|
|
|
13905
13960
|
}
|
|
13906
13961
|
}
|
|
13907
13962
|
}
|
|
13908
|
-
|
|
13963
|
+
toggleSortingForColumn(columnId, options) {
|
|
13909
13964
|
const col = this.getComputed().computedColumnsMap.get(columnId);
|
|
13910
13965
|
if (!col) {
|
|
13911
13966
|
return;
|
|
13912
13967
|
}
|
|
13968
|
+
let dir = this.getSortingForColumn(columnId);
|
|
13969
|
+
if (dir === null) {
|
|
13970
|
+
dir = 1;
|
|
13971
|
+
} else {
|
|
13972
|
+
dir = dir === 1 ? -1 : null;
|
|
13973
|
+
}
|
|
13974
|
+
this.setSortingForColumn(columnId, dir, options);
|
|
13975
|
+
}
|
|
13976
|
+
setSortingForColumn(columnId, dir, options) {
|
|
13977
|
+
const c = this.getComputed().computedColumnsMap.get(columnId);
|
|
13978
|
+
if (!c) {
|
|
13979
|
+
return;
|
|
13980
|
+
}
|
|
13981
|
+
const currentSorting = this.getSortingForColumn(columnId);
|
|
13982
|
+
if (currentSorting === dir) {
|
|
13983
|
+
if (this.getDataSourceState().multiSort === false) {
|
|
13984
|
+
return;
|
|
13985
|
+
}
|
|
13986
|
+
}
|
|
13913
13987
|
if (dir === null) {
|
|
13914
13988
|
this.setSortInfoForColumn(columnId, null, options);
|
|
13915
13989
|
return;
|
|
13916
13990
|
}
|
|
13917
|
-
const
|
|
13918
|
-
|
|
13991
|
+
const groupByForColumn = c.groupByForColumn;
|
|
13992
|
+
let field = c.field;
|
|
13993
|
+
const groupByForCol = groupByForColumn ? Array.isArray(groupByForColumn) ? groupByForColumn : [groupByForColumn] : [];
|
|
13994
|
+
const fieldArr = groupByForCol.map((c2) => {
|
|
13995
|
+
var _a;
|
|
13996
|
+
return c2.valueGetter ? (item) => c2.valueGetter({ data: item, field: c2.field }) : c2.field ? c2.field : (_a = c2.groupField) != null ? _a : void 0;
|
|
13997
|
+
}).filter(notNullable);
|
|
13998
|
+
if (fieldArr.length) {
|
|
13999
|
+
field = fieldArr;
|
|
14000
|
+
}
|
|
14001
|
+
const computedSortType = c.computedSortType;
|
|
14002
|
+
const newColumnSortInfo = {
|
|
14003
|
+
dir,
|
|
14004
|
+
id: c.id,
|
|
14005
|
+
field,
|
|
14006
|
+
type: computedSortType
|
|
13919
14007
|
};
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
|
|
14008
|
+
if (c.valueGetter) {
|
|
14009
|
+
newColumnSortInfo.valueGetter = (data) => c.valueGetter({ data, field: c.field });
|
|
14010
|
+
}
|
|
14011
|
+
this.setSortInfoForColumn(columnId, newColumnSortInfo, options);
|
|
14012
|
+
}
|
|
14013
|
+
setSortInfoForColumn(columnId, columnSortInfo, options) {
|
|
14014
|
+
var _a, _b, _c;
|
|
14015
|
+
const dataSourceState = this.getDataSourceState();
|
|
14016
|
+
const col = this.getComputed().computedColumnsMap.get(columnId);
|
|
14017
|
+
if (!col) {
|
|
14018
|
+
return;
|
|
14019
|
+
}
|
|
14020
|
+
if (!dataSourceState.multiSort) {
|
|
14021
|
+
this.dataSourceApi.setSortInfo(columnSortInfo ? [columnSortInfo] : null);
|
|
14022
|
+
return;
|
|
14023
|
+
}
|
|
14024
|
+
const colField = col.field;
|
|
14025
|
+
const colInfo = {
|
|
14026
|
+
id: columnId,
|
|
14027
|
+
field: colField
|
|
14028
|
+
};
|
|
14029
|
+
let newSortInfo = (_b = (_a = dataSourceState.sortInfo) == null ? void 0 : _a.slice()) != null ? _b : [];
|
|
14030
|
+
if (columnSortInfo === null) {
|
|
14031
|
+
newSortInfo = newSortInfo.filter(
|
|
14032
|
+
(sortInfo) => !isSortInfoForColumn(sortInfo, colInfo)
|
|
14033
|
+
);
|
|
14034
|
+
this.dataSourceApi.setSortInfo(newSortInfo);
|
|
14035
|
+
return;
|
|
14036
|
+
}
|
|
14037
|
+
let matched = false;
|
|
14038
|
+
const multiSortBehavior = (_c = options == null ? void 0 : options.multiSortBehavior) != null ? _c : this.getState().multiSortBehavior;
|
|
14039
|
+
if (multiSortBehavior === "replace") {
|
|
14040
|
+
this.dataSourceApi.setSortInfo([columnSortInfo]);
|
|
14041
|
+
return;
|
|
14042
|
+
}
|
|
14043
|
+
newSortInfo = newSortInfo.map((sortInfo) => {
|
|
14044
|
+
if (matched) {
|
|
14045
|
+
return sortInfo;
|
|
14046
|
+
}
|
|
14047
|
+
if (isSortInfoForColumn(sortInfo, colInfo)) {
|
|
14048
|
+
matched = true;
|
|
14049
|
+
return columnSortInfo;
|
|
14050
|
+
}
|
|
14051
|
+
return sortInfo;
|
|
14052
|
+
});
|
|
14053
|
+
if (!matched) {
|
|
14054
|
+
newSortInfo.push(columnSortInfo);
|
|
14055
|
+
}
|
|
14056
|
+
this.dataSourceApi.setSortInfo(newSortInfo);
|
|
14057
|
+
}
|
|
14058
|
+
getSortTypeForColumn(columnId) {
|
|
14059
|
+
const col = this.getComputed().computedColumnsMap.get(columnId);
|
|
14060
|
+
if (!col) {
|
|
14061
|
+
return null;
|
|
13923
14062
|
}
|
|
13924
|
-
|
|
13925
|
-
|
|
14063
|
+
return col.computedSortType;
|
|
14064
|
+
}
|
|
14065
|
+
getSortInfoForColumn(columnId) {
|
|
14066
|
+
const col = this.getComputed().computedColumnsMap.get(columnId);
|
|
14067
|
+
if (!col) {
|
|
14068
|
+
return null;
|
|
13926
14069
|
}
|
|
13927
|
-
|
|
13928
|
-
|
|
14070
|
+
return col.computedSortInfo;
|
|
14071
|
+
}
|
|
14072
|
+
getSortingForColumn(columnId) {
|
|
14073
|
+
const sortInfo = this.getSortInfoForColumn(columnId);
|
|
14074
|
+
if (!sortInfo) {
|
|
14075
|
+
return null;
|
|
13929
14076
|
}
|
|
13930
|
-
|
|
14077
|
+
return sortInfo.dir;
|
|
13931
14078
|
}
|
|
13932
14079
|
setPinningForColumn(columnId, pinning) {
|
|
13933
14080
|
const columnPinning = __spreadValues({}, this.getState().columnPinning);
|
|
@@ -14048,69 +14195,6 @@ var InfiniteTableApiImpl = class {
|
|
|
14048
14195
|
this.dataSourceActions.filterValue = newFilterValue;
|
|
14049
14196
|
}
|
|
14050
14197
|
}
|
|
14051
|
-
setSortInfoForColumn(columnId, columnSortInfo, options) {
|
|
14052
|
-
var _a, _b, _c;
|
|
14053
|
-
const dataSourceState = this.getDataSourceState();
|
|
14054
|
-
const col = this.getComputed().computedColumnsMap.get(columnId);
|
|
14055
|
-
if (!col) {
|
|
14056
|
-
return;
|
|
14057
|
-
}
|
|
14058
|
-
if (!dataSourceState.multiSort) {
|
|
14059
|
-
this.dataSourceActions.sortInfo = columnSortInfo ? [columnSortInfo] : null;
|
|
14060
|
-
return;
|
|
14061
|
-
}
|
|
14062
|
-
const colField = col.field;
|
|
14063
|
-
let newSortInfo = (_b = (_a = dataSourceState.sortInfo) == null ? void 0 : _a.slice()) != null ? _b : [];
|
|
14064
|
-
if (columnSortInfo === null) {
|
|
14065
|
-
newSortInfo = newSortInfo.filter((sortInfo) => {
|
|
14066
|
-
if (sortInfo.id) {
|
|
14067
|
-
if (sortInfo.id === columnId) {
|
|
14068
|
-
return false;
|
|
14069
|
-
}
|
|
14070
|
-
return true;
|
|
14071
|
-
}
|
|
14072
|
-
if (sortInfo.field) {
|
|
14073
|
-
if (sortInfo.field === colField) {
|
|
14074
|
-
return false;
|
|
14075
|
-
}
|
|
14076
|
-
return true;
|
|
14077
|
-
}
|
|
14078
|
-
return true;
|
|
14079
|
-
});
|
|
14080
|
-
this.dataSourceActions.sortInfo = newSortInfo.length ? newSortInfo : null;
|
|
14081
|
-
return;
|
|
14082
|
-
}
|
|
14083
|
-
let matched = false;
|
|
14084
|
-
const multiSortBehavior = (_c = options == null ? void 0 : options.multiSortBehavior) != null ? _c : this.getState().multiSortBehavior;
|
|
14085
|
-
if (multiSortBehavior === "replace") {
|
|
14086
|
-
this.dataSourceActions.sortInfo = [columnSortInfo];
|
|
14087
|
-
} else {
|
|
14088
|
-
newSortInfo = newSortInfo.map((sortInfo) => {
|
|
14089
|
-
if (matched) {
|
|
14090
|
-
return sortInfo;
|
|
14091
|
-
}
|
|
14092
|
-
if (sortInfo.id) {
|
|
14093
|
-
if (sortInfo.id === columnId) {
|
|
14094
|
-
matched = true;
|
|
14095
|
-
return columnSortInfo;
|
|
14096
|
-
}
|
|
14097
|
-
return sortInfo;
|
|
14098
|
-
}
|
|
14099
|
-
if (sortInfo.field) {
|
|
14100
|
-
if (sortInfo.field === colField) {
|
|
14101
|
-
matched = true;
|
|
14102
|
-
return columnSortInfo;
|
|
14103
|
-
}
|
|
14104
|
-
return sortInfo;
|
|
14105
|
-
}
|
|
14106
|
-
return sortInfo;
|
|
14107
|
-
});
|
|
14108
|
-
if (!matched) {
|
|
14109
|
-
newSortInfo.push(columnSortInfo);
|
|
14110
|
-
}
|
|
14111
|
-
this.dataSourceActions.sortInfo = newSortInfo.length ? newSortInfo : null;
|
|
14112
|
-
}
|
|
14113
|
-
}
|
|
14114
14198
|
setVisibilityForColumn(columnId, visible) {
|
|
14115
14199
|
const columnVisibility = __spreadValues({}, this.getState().columnVisibility);
|
|
14116
14200
|
if (visible) {
|
|
@@ -14968,6 +15052,7 @@ var forwardProps4 = (setupState) => {
|
|
|
14968
15052
|
onScrollbarsChange: 1,
|
|
14969
15053
|
autoSizeColumnsKey: 1,
|
|
14970
15054
|
columnDefaultFlex: 1,
|
|
15055
|
+
columnMenuRealignDelay: (columnMenuRealignDelay) => columnMenuRealignDelay != null ? columnMenuRealignDelay : 50,
|
|
14971
15056
|
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
|
|
14972
15057
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
14973
15058
|
resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
|
|
@@ -15624,17 +15709,9 @@ function getColumnsWhenGrouping(params) {
|
|
|
15624
15709
|
};
|
|
15625
15710
|
}
|
|
15626
15711
|
|
|
15627
|
-
// src/components/InfiniteTable/hooks/
|
|
15712
|
+
// src/components/InfiniteTable/hooks/useComputedColumns.ts
|
|
15628
15713
|
var import_react46 = require("react");
|
|
15629
15714
|
|
|
15630
|
-
// src/components/InfiniteTable/types/Utility.ts
|
|
15631
|
-
function notNullable(value) {
|
|
15632
|
-
if (value === null || value === void 0)
|
|
15633
|
-
return false;
|
|
15634
|
-
const testDummyForCompileError = value;
|
|
15635
|
-
return true;
|
|
15636
|
-
}
|
|
15637
|
-
|
|
15638
15715
|
// src/components/InfiniteTable/utils/adjustColumnOrderForPinning.ts
|
|
15639
15716
|
var order = ["start", void 0, "end"];
|
|
15640
15717
|
var adjustColumnOrderForPinning = (columnOrder, columnPinning) => {
|
|
@@ -15681,7 +15758,7 @@ function getColumnComputedType(column, columnTypes) {
|
|
|
15681
15758
|
);
|
|
15682
15759
|
}
|
|
15683
15760
|
|
|
15684
|
-
// src/components/InfiniteTable/utils/
|
|
15761
|
+
// src/components/InfiniteTable/utils/getComputedColumns.ts
|
|
15685
15762
|
var logError = err("getComputedVisibleColumns");
|
|
15686
15763
|
var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId) => {
|
|
15687
15764
|
return columnVisibility[colId] !== false;
|
|
@@ -15725,7 +15802,7 @@ function isGroupColumnSortable(column, fieldsToColumns) {
|
|
|
15725
15802
|
return acc && !!colSortable;
|
|
15726
15803
|
}, true);
|
|
15727
15804
|
}
|
|
15728
|
-
var
|
|
15805
|
+
var getComputedColumns = ({
|
|
15729
15806
|
columns,
|
|
15730
15807
|
bodySize,
|
|
15731
15808
|
columnMinWidth,
|
|
@@ -15740,7 +15817,6 @@ var getComputedVisibleColumns = ({
|
|
|
15740
15817
|
filterValue,
|
|
15741
15818
|
sortable,
|
|
15742
15819
|
sortInfo,
|
|
15743
|
-
setSortInfo,
|
|
15744
15820
|
multiSort,
|
|
15745
15821
|
filterTypes = defaultFilterTypes,
|
|
15746
15822
|
viewportReservedWidth,
|
|
@@ -16030,67 +16106,6 @@ var getComputedVisibleColumns = ({
|
|
|
16030
16106
|
computedLastInCategory,
|
|
16031
16107
|
computedFirst: theComputedVisibleIndex === 0,
|
|
16032
16108
|
computedLast,
|
|
16033
|
-
toggleSort: ({
|
|
16034
|
-
multiSortBehavior
|
|
16035
|
-
} = {
|
|
16036
|
-
multiSortBehavior: "replace"
|
|
16037
|
-
}) => {
|
|
16038
|
-
const currentSortInfo = computedSortInfo;
|
|
16039
|
-
let newColumnSortInfo;
|
|
16040
|
-
const groupByForColumn = result2.groupByForColumn;
|
|
16041
|
-
let field2 = c.field;
|
|
16042
|
-
const groupByForCol = groupByForColumn ? Array.isArray(groupByForColumn) ? groupByForColumn : [groupByForColumn] : [];
|
|
16043
|
-
const fieldArr = groupByForCol.map((c2) => {
|
|
16044
|
-
return c2.valueGetter ? (item) => c2.valueGetter({ data: item, field: c2.field }) : c2.field ? c2.field : void 0;
|
|
16045
|
-
}).filter(notNullable);
|
|
16046
|
-
if (fieldArr.length) {
|
|
16047
|
-
field2 = fieldArr;
|
|
16048
|
-
}
|
|
16049
|
-
if (!currentSortInfo) {
|
|
16050
|
-
newColumnSortInfo = {
|
|
16051
|
-
dir: 1,
|
|
16052
|
-
id,
|
|
16053
|
-
field: field2,
|
|
16054
|
-
type: computedSortType
|
|
16055
|
-
};
|
|
16056
|
-
} else {
|
|
16057
|
-
if (computedSortedDesc) {
|
|
16058
|
-
newColumnSortInfo = null;
|
|
16059
|
-
} else {
|
|
16060
|
-
newColumnSortInfo = __spreadProps(__spreadValues({}, computedSortInfo), {
|
|
16061
|
-
dir: -1
|
|
16062
|
-
});
|
|
16063
|
-
}
|
|
16064
|
-
}
|
|
16065
|
-
if (field2 && newColumnSortInfo && !newColumnSortInfo.field) {
|
|
16066
|
-
newColumnSortInfo.field = field2;
|
|
16067
|
-
}
|
|
16068
|
-
if (c.valueGetter && newColumnSortInfo && !newColumnSortInfo.valueGetter) {
|
|
16069
|
-
newColumnSortInfo.valueGetter = (data) => c.valueGetter({ data, field: c.field });
|
|
16070
|
-
}
|
|
16071
|
-
let finalSortInfo = sortInfo ? [...sortInfo] : [];
|
|
16072
|
-
if (multiSort) {
|
|
16073
|
-
if (multiSortBehavior === "append") {
|
|
16074
|
-
if (computedSortIndex === -1) {
|
|
16075
|
-
if (newColumnSortInfo) {
|
|
16076
|
-
finalSortInfo.push(newColumnSortInfo);
|
|
16077
|
-
}
|
|
16078
|
-
} else {
|
|
16079
|
-
finalSortInfo = finalSortInfo.map((info, index) => {
|
|
16080
|
-
if (index === computedSortIndex) {
|
|
16081
|
-
return newColumnSortInfo;
|
|
16082
|
-
}
|
|
16083
|
-
return info;
|
|
16084
|
-
}).filter((x) => x != null);
|
|
16085
|
-
}
|
|
16086
|
-
} else {
|
|
16087
|
-
finalSortInfo = newColumnSortInfo ? [newColumnSortInfo] : [];
|
|
16088
|
-
}
|
|
16089
|
-
} else {
|
|
16090
|
-
finalSortInfo = newColumnSortInfo ? [newColumnSortInfo] : [];
|
|
16091
|
-
}
|
|
16092
|
-
setSortInfo(finalSortInfo);
|
|
16093
|
-
},
|
|
16094
16109
|
id,
|
|
16095
16110
|
header: (_B = (_A = (_z = c.header) != null ? _z : colType.header) != null ? _A : c.name) != null ? _B : c.field
|
|
16096
16111
|
});
|
|
@@ -16181,8 +16196,8 @@ var useRerenderOnKeyChange = (map2) => {
|
|
|
16181
16196
|
return renderId;
|
|
16182
16197
|
};
|
|
16183
16198
|
|
|
16184
|
-
// src/components/InfiniteTable/hooks/
|
|
16185
|
-
var
|
|
16199
|
+
// src/components/InfiniteTable/hooks/useComputedColumns.ts
|
|
16200
|
+
var useComputedColumns = ({
|
|
16186
16201
|
columns,
|
|
16187
16202
|
bodySize,
|
|
16188
16203
|
columnMinWidth,
|
|
@@ -16195,7 +16210,6 @@ var useComputedVisibleColumns = ({
|
|
|
16195
16210
|
draggableColumns,
|
|
16196
16211
|
sortInfo,
|
|
16197
16212
|
multiSort,
|
|
16198
|
-
setSortInfo,
|
|
16199
16213
|
filterValue,
|
|
16200
16214
|
filterTypes,
|
|
16201
16215
|
columnOrder,
|
|
@@ -16234,7 +16248,7 @@ var useComputedVisibleColumns = ({
|
|
|
16234
16248
|
computedColumnsMapInInitialOrder,
|
|
16235
16249
|
fieldsToColumn
|
|
16236
16250
|
} = (0, import_react46.useMemo)(() => {
|
|
16237
|
-
return
|
|
16251
|
+
return getComputedColumns({
|
|
16238
16252
|
columns,
|
|
16239
16253
|
scrollbarWidth: scrollbarWidth2,
|
|
16240
16254
|
bodySize,
|
|
@@ -16250,7 +16264,6 @@ var useComputedVisibleColumns = ({
|
|
|
16250
16264
|
filterTypes,
|
|
16251
16265
|
sortable,
|
|
16252
16266
|
sortInfo,
|
|
16253
|
-
setSortInfo,
|
|
16254
16267
|
multiSort,
|
|
16255
16268
|
pinnedEndMaxWidth,
|
|
16256
16269
|
pinnedStartMaxWidth,
|
|
@@ -16275,7 +16288,6 @@ var useComputedVisibleColumns = ({
|
|
|
16275
16288
|
scrollbarWidth2,
|
|
16276
16289
|
sortable,
|
|
16277
16290
|
sortInfo,
|
|
16278
|
-
setSortInfo,
|
|
16279
16291
|
multiSort,
|
|
16280
16292
|
filterValue,
|
|
16281
16293
|
filterTypes,
|
|
@@ -16391,14 +16403,6 @@ function useComputed() {
|
|
|
16391
16403
|
const { multiSort, filterValue, filterTypes } = dataSourceState;
|
|
16392
16404
|
useColumnGroups();
|
|
16393
16405
|
const { toggleGroupRow } = useColumnsWhen();
|
|
16394
|
-
const setSortInfo = (0, import_react48.useCallback)(
|
|
16395
|
-
(sortInfo) => {
|
|
16396
|
-
var _a2;
|
|
16397
|
-
const newSortInfo = getDataSourceState().multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
16398
|
-
dataSourceActions.sortInfo = newSortInfo;
|
|
16399
|
-
},
|
|
16400
|
-
[getDataSourceState]
|
|
16401
|
-
);
|
|
16402
16406
|
const columns = componentState.computedColumns;
|
|
16403
16407
|
const {
|
|
16404
16408
|
computedColumnOrder,
|
|
@@ -16419,7 +16423,7 @@ function useComputed() {
|
|
|
16419
16423
|
computedColumnsMap,
|
|
16420
16424
|
computedColumnsMapInInitialOrder,
|
|
16421
16425
|
fieldsToColumn
|
|
16422
|
-
} =
|
|
16426
|
+
} = useComputedColumns({
|
|
16423
16427
|
columns,
|
|
16424
16428
|
// scrollbarWidth: scrollbars.vertical ? getScrollbarWidth() : 0,
|
|
16425
16429
|
// #scrollbarverticaltag
|
|
@@ -16443,7 +16447,6 @@ function useComputed() {
|
|
|
16443
16447
|
draggableColumns: componentState.draggableColumns,
|
|
16444
16448
|
sortInfo: (_a = dataSourceState.sortInfo) != null ? _a : void 0,
|
|
16445
16449
|
multiSort,
|
|
16446
|
-
setSortInfo,
|
|
16447
16450
|
columnOrder,
|
|
16448
16451
|
columnVisibility,
|
|
16449
16452
|
columnVisibilityAssumeVisible: true,
|
|
@@ -16670,7 +16673,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
16670
16673
|
const valid = (0, import_react49.useMemo)(() => {
|
|
16671
16674
|
let valid2 = isValidLicense(licenseKey, {
|
|
16672
16675
|
publishedAt: 1624970570587,
|
|
16673
|
-
version: "1.3.
|
|
16676
|
+
version: "1.3.22"
|
|
16674
16677
|
});
|
|
16675
16678
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
16676
16679
|
return true;
|