@infinite-table/infinite-react 3.2.5 → 3.2.7
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 +2 -1
- package/index.dev.js +97 -52
- package/index.dev.mjs +97 -52
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1969,7 +1969,7 @@ declare type DataSourcePropMultiRowSelectionChangeParamType = RowSelectionStateO
|
|
|
1969
1969
|
declare type DataSourcePropRowSelection = DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
|
|
1970
1970
|
declare type DataSourcePropRowSelection_MultiRow = RowSelectionStateObject;
|
|
1971
1971
|
declare type DataSourcePropRowSelection_SingleRow = null | string | number;
|
|
1972
|
-
declare type DataSourcePropCellSelection_MultiCell = CellSelectionStateObject;
|
|
1972
|
+
declare type DataSourcePropCellSelection_MultiCell = CellSelectionStateObject | CellSelectionState;
|
|
1973
1973
|
declare type DataSourcePropCellSelection_SingleCell = null | CellSelectionPosition;
|
|
1974
1974
|
declare type DataSourcePropCellSelection = DataSourcePropCellSelection_MultiCell | DataSourcePropCellSelection_SingleCell;
|
|
1975
1975
|
declare type DataSourcePropSelectionMode = false | 'single-cell' | 'single-row' | 'multi-cell' | 'multi-row';
|
|
@@ -2690,6 +2690,7 @@ declare type InfiniteTableRowDetailApi = {
|
|
|
2690
2690
|
toggleRowDetail(pk: any): void;
|
|
2691
2691
|
collapseAllDetails(): void;
|
|
2692
2692
|
expandAllDetails(): void;
|
|
2693
|
+
isRowDetailEnabledForRow(pk: any): boolean;
|
|
2693
2694
|
};
|
|
2694
2695
|
|
|
2695
2696
|
declare type LoadMaskProps = {
|
package/index.dev.js
CHANGED
|
@@ -5011,25 +5011,25 @@ var useInfiniteTableState = () => {
|
|
|
5011
5011
|
var React27 = __toESM(require("react"));
|
|
5012
5012
|
var import_react18 = require("react");
|
|
5013
5013
|
|
|
5014
|
-
// ../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-
|
|
5015
|
-
function
|
|
5016
|
-
if (
|
|
5017
|
-
return
|
|
5018
|
-
var
|
|
5019
|
-
if (
|
|
5020
|
-
var
|
|
5021
|
-
if (
|
|
5022
|
-
return
|
|
5014
|
+
// ../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
5015
|
+
function toPrimitive(t, r) {
|
|
5016
|
+
if ("object" != typeof t || !t)
|
|
5017
|
+
return t;
|
|
5018
|
+
var e = t[Symbol.toPrimitive];
|
|
5019
|
+
if (void 0 !== e) {
|
|
5020
|
+
var i = e.call(t, r || "default");
|
|
5021
|
+
if ("object" != typeof i)
|
|
5022
|
+
return i;
|
|
5023
5023
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
5024
5024
|
}
|
|
5025
|
-
return (
|
|
5025
|
+
return ("string" === r ? String : Number)(t);
|
|
5026
5026
|
}
|
|
5027
|
-
function
|
|
5028
|
-
var
|
|
5029
|
-
return
|
|
5027
|
+
function toPropertyKey(t) {
|
|
5028
|
+
var i = toPrimitive(t, "string");
|
|
5029
|
+
return "symbol" == typeof i ? i : String(i);
|
|
5030
5030
|
}
|
|
5031
5031
|
function _defineProperty(obj, key, value) {
|
|
5032
|
-
key =
|
|
5032
|
+
key = toPropertyKey(key);
|
|
5033
5033
|
if (key in obj) {
|
|
5034
5034
|
Object.defineProperty(obj, key, {
|
|
5035
5035
|
value,
|
|
@@ -5042,26 +5042,26 @@ function _defineProperty(obj, key, value) {
|
|
|
5042
5042
|
}
|
|
5043
5043
|
return obj;
|
|
5044
5044
|
}
|
|
5045
|
-
function ownKeys(
|
|
5046
|
-
var
|
|
5045
|
+
function ownKeys(e, r) {
|
|
5046
|
+
var t = Object.keys(e);
|
|
5047
5047
|
if (Object.getOwnPropertySymbols) {
|
|
5048
|
-
var
|
|
5049
|
-
|
|
5050
|
-
return Object.getOwnPropertyDescriptor(
|
|
5051
|
-
})),
|
|
5052
|
-
}
|
|
5053
|
-
return
|
|
5054
|
-
}
|
|
5055
|
-
function _objectSpread2(
|
|
5056
|
-
for (var
|
|
5057
|
-
var
|
|
5058
|
-
|
|
5059
|
-
_defineProperty(
|
|
5060
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
5061
|
-
Object.defineProperty(
|
|
5048
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
5049
|
+
r && (o = o.filter(function(r2) {
|
|
5050
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
5051
|
+
})), t.push.apply(t, o);
|
|
5052
|
+
}
|
|
5053
|
+
return t;
|
|
5054
|
+
}
|
|
5055
|
+
function _objectSpread2(e) {
|
|
5056
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
5057
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
5058
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
5059
|
+
_defineProperty(e, r2, t[r2]);
|
|
5060
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
5061
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
5062
5062
|
});
|
|
5063
5063
|
}
|
|
5064
|
-
return
|
|
5064
|
+
return e;
|
|
5065
5065
|
}
|
|
5066
5066
|
function mapValues(input, fn) {
|
|
5067
5067
|
var result = {};
|
|
@@ -14238,17 +14238,17 @@ var Indexer = class {
|
|
|
14238
14238
|
var EMPTY_ARRAY = Object.freeze(
|
|
14239
14239
|
[]
|
|
14240
14240
|
);
|
|
14241
|
-
var normalizeSortInfo = (initialSortInfo,
|
|
14241
|
+
var normalizeSortInfo = (initialSortInfo, weakMap3) => {
|
|
14242
14242
|
const sortInfo = initialSortInfo != null ? initialSortInfo : EMPTY_ARRAY;
|
|
14243
14243
|
const result = Array.isArray(sortInfo) ? sortInfo : [sortInfo];
|
|
14244
|
-
if (
|
|
14245
|
-
const prevResult =
|
|
14244
|
+
if (weakMap3 && weakMap3.has(sortInfo)) {
|
|
14245
|
+
const prevResult = weakMap3.get(sortInfo);
|
|
14246
14246
|
if (prevResult && prevResult.length === result.length) {
|
|
14247
14247
|
return prevResult;
|
|
14248
14248
|
}
|
|
14249
14249
|
}
|
|
14250
|
-
if (
|
|
14251
|
-
|
|
14250
|
+
if (weakMap3 && sortInfo) {
|
|
14251
|
+
weakMap3.set(sortInfo, result);
|
|
14252
14252
|
}
|
|
14253
14253
|
return result;
|
|
14254
14254
|
};
|
|
@@ -14382,8 +14382,9 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
|
|
|
14382
14382
|
}) : livePaginationCursorProp;
|
|
14383
14383
|
return livePaginationCursor;
|
|
14384
14384
|
}
|
|
14385
|
+
var weakMap = /* @__PURE__ */ new WeakMap();
|
|
14385
14386
|
function deriveStateFromProps(params) {
|
|
14386
|
-
var _a, _b;
|
|
14387
|
+
var _a, _b, _c;
|
|
14387
14388
|
const { props, state, oldState } = params;
|
|
14388
14389
|
const controlledSort = isControlledValue(props.sortInfo);
|
|
14389
14390
|
const controlledFilter = isControlledValue(props.filterValue);
|
|
@@ -14429,19 +14430,34 @@ function deriveStateFromProps(params) {
|
|
|
14429
14430
|
rowSelectionStateConfigGetter(state)
|
|
14430
14431
|
);
|
|
14431
14432
|
} else {
|
|
14432
|
-
|
|
14433
|
-
currentRowSelection
|
|
14434
|
-
|
|
14435
|
-
|
|
14433
|
+
if (selectionMode === "single-row") {
|
|
14434
|
+
rowSelectionState = currentRowSelection;
|
|
14435
|
+
} else {
|
|
14436
|
+
if (currentRowSelection instanceof RowSelectionState) {
|
|
14437
|
+
rowSelectionState = currentRowSelection;
|
|
14438
|
+
} else {
|
|
14439
|
+
const instance = new RowSelectionState(
|
|
14440
|
+
currentRowSelection,
|
|
14441
|
+
rowSelectionStateConfigGetter(state)
|
|
14442
|
+
);
|
|
14443
|
+
rowSelectionState = instance;
|
|
14444
|
+
}
|
|
14445
|
+
}
|
|
14436
14446
|
}
|
|
14437
14447
|
}
|
|
14438
14448
|
if (selectionMode === "single-cell" || selectionMode === "multi-cell") {
|
|
14439
14449
|
if (currentCellSelection === null) {
|
|
14440
14450
|
cellSelectionState = selectionMode === "single-cell" ? null : new CellSelectionState();
|
|
14441
14451
|
} else {
|
|
14442
|
-
|
|
14443
|
-
currentCellSelection
|
|
14444
|
-
|
|
14452
|
+
if (currentCellSelection instanceof CellSelectionState) {
|
|
14453
|
+
cellSelectionState = currentCellSelection;
|
|
14454
|
+
} else {
|
|
14455
|
+
const instance = (_a = weakMap.get(currentCellSelection)) != null ? _a : new CellSelectionState(
|
|
14456
|
+
currentCellSelection
|
|
14457
|
+
);
|
|
14458
|
+
weakMap.set(currentCellSelection, instance);
|
|
14459
|
+
cellSelectionState = instance;
|
|
14460
|
+
}
|
|
14445
14461
|
}
|
|
14446
14462
|
}
|
|
14447
14463
|
}
|
|
@@ -14466,8 +14482,8 @@ function deriveStateFromProps(params) {
|
|
|
14466
14482
|
operatorsByFilterType,
|
|
14467
14483
|
controlledSort,
|
|
14468
14484
|
controlledFilter,
|
|
14469
|
-
sortMode: props.sortFunction ? "local" : (
|
|
14470
|
-
filterMode: typeof props.filterFunction === "function" ? "local" : (
|
|
14485
|
+
sortMode: props.sortFunction ? "local" : (_b = props.sortMode) != null ? _b : controlledSort ? "remote" : "local",
|
|
14486
|
+
filterMode: typeof props.filterFunction === "function" ? "local" : (_c = props.filterMode) != null ? _c : typeof props.data === "function" ? "remote" : "local",
|
|
14471
14487
|
multiSort: Array.isArray(
|
|
14472
14488
|
controlledSort ? props.sortInfo : props.defaultSortInfo
|
|
14473
14489
|
),
|
|
@@ -15392,6 +15408,20 @@ function getRowDetailApi(param) {
|
|
|
15392
15408
|
const expanded = isRowDetailExpanded(rowInfo);
|
|
15393
15409
|
return !expanded;
|
|
15394
15410
|
},
|
|
15411
|
+
isRowDetailEnabledForRow(pk) {
|
|
15412
|
+
const { isRowDetailEnabled } = getState();
|
|
15413
|
+
if (!isRowDetailEnabled) {
|
|
15414
|
+
return false;
|
|
15415
|
+
}
|
|
15416
|
+
if (typeof isRowDetailEnabled === "function") {
|
|
15417
|
+
const rowInfo = dataSourceApi.getRowInfoByPrimaryKey(pk);
|
|
15418
|
+
if (!rowInfo) {
|
|
15419
|
+
return false;
|
|
15420
|
+
}
|
|
15421
|
+
return isRowDetailEnabled(rowInfo);
|
|
15422
|
+
}
|
|
15423
|
+
return true;
|
|
15424
|
+
},
|
|
15395
15425
|
isRowDetailExpanded(pk) {
|
|
15396
15426
|
return !rowDetailApi.isRowDetailCollapsed(pk);
|
|
15397
15427
|
},
|
|
@@ -17520,7 +17550,7 @@ function getGroupByMap(groupBy) {
|
|
|
17520
17550
|
return acc;
|
|
17521
17551
|
}, /* @__PURE__ */ new Map());
|
|
17522
17552
|
}
|
|
17523
|
-
var
|
|
17553
|
+
var weakMap2 = /* @__PURE__ */ new WeakMap();
|
|
17524
17554
|
var mapPropsToState = (params) => {
|
|
17525
17555
|
var _a, _b, _c, _d, _e;
|
|
17526
17556
|
const { props, state, oldState, parentState } = params;
|
|
@@ -17536,10 +17566,10 @@ var mapPropsToState = (params) => {
|
|
|
17536
17566
|
let rowDetailRenderer = props.rowDetailRenderer;
|
|
17537
17567
|
const RowDetailComponent = (_a = props.components) == null ? void 0 : _a.RowDetail;
|
|
17538
17568
|
if (!rowDetailRenderer && RowDetailComponent) {
|
|
17539
|
-
let rowDetailRendererFromComponent =
|
|
17569
|
+
let rowDetailRendererFromComponent = weakMap2.get(RowDetailComponent);
|
|
17540
17570
|
if (!rowDetailRendererFromComponent) {
|
|
17541
17571
|
rowDetailRendererFromComponent = getRowDetailRendererFromComponent(RowDetailComponent);
|
|
17542
|
-
|
|
17572
|
+
weakMap2.set(RowDetailComponent, rowDetailRendererFromComponent);
|
|
17543
17573
|
}
|
|
17544
17574
|
rowDetailRenderer = rowDetailRendererFromComponent;
|
|
17545
17575
|
}
|
|
@@ -17553,7 +17583,7 @@ var mapPropsToState = (params) => {
|
|
|
17553
17583
|
const computedColumns = state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns;
|
|
17554
17584
|
let isRowDetailExpanded = rowDetailState ? props.isRowDetailExpanded : void 0;
|
|
17555
17585
|
if (!isRowDetailExpanded && rowDetailState) {
|
|
17556
|
-
isRowDetailExpanded =
|
|
17586
|
+
isRowDetailExpanded = weakMap2.get(rowDetailState);
|
|
17557
17587
|
if (!isRowDetailExpanded) {
|
|
17558
17588
|
isRowDetailExpanded = (rowInfo) => {
|
|
17559
17589
|
return rowDetailState.isRowDetailsExpanded(
|
|
@@ -17561,7 +17591,7 @@ var mapPropsToState = (params) => {
|
|
|
17561
17591
|
);
|
|
17562
17592
|
};
|
|
17563
17593
|
if (typeof rowDetailState === "object") {
|
|
17564
|
-
|
|
17594
|
+
weakMap2.set(rowDetailState, isRowDetailExpanded);
|
|
17565
17595
|
}
|
|
17566
17596
|
}
|
|
17567
17597
|
}
|
|
@@ -18763,7 +18793,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
18763
18793
|
const valid = (0, import_react53.useMemo)(() => {
|
|
18764
18794
|
let valid2 = isValidLicense(licenseKey, {
|
|
18765
18795
|
publishedAt: 1624970570587,
|
|
18766
|
-
version: "3.2.
|
|
18796
|
+
version: "3.2.7"
|
|
18767
18797
|
});
|
|
18768
18798
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
18769
18799
|
return true;
|
|
@@ -18998,6 +19028,9 @@ function handleRowNavigation(options, event) {
|
|
|
18998
19028
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
18999
19029
|
return api.collapseGroupRow(rowInfo.groupKeys);
|
|
19000
19030
|
}
|
|
19031
|
+
if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
|
|
19032
|
+
return api.rowDetailApi.collapseRowDetail(rowInfo.id);
|
|
19033
|
+
}
|
|
19001
19034
|
return false;
|
|
19002
19035
|
},
|
|
19003
19036
|
ArrowRight: () => {
|
|
@@ -19005,6 +19038,9 @@ function handleRowNavigation(options, event) {
|
|
|
19005
19038
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
19006
19039
|
return api.expandGroupRow(rowInfo.groupKeys);
|
|
19007
19040
|
}
|
|
19041
|
+
if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
|
|
19042
|
+
return api.rowDetailApi.expandRowDetail(rowInfo.id);
|
|
19043
|
+
}
|
|
19008
19044
|
return false;
|
|
19009
19045
|
},
|
|
19010
19046
|
Enter: () => {
|
|
@@ -19012,6 +19048,12 @@ function handleRowNavigation(options, event) {
|
|
|
19012
19048
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
19013
19049
|
return api.toggleGroupRow(rowInfo.groupKeys);
|
|
19014
19050
|
}
|
|
19051
|
+
const hasRowDetail = api.rowDetailApi.isRowDetailEnabledForRow(
|
|
19052
|
+
rowInfo.id
|
|
19053
|
+
);
|
|
19054
|
+
if (hasRowDetail) {
|
|
19055
|
+
return api.rowDetailApi.toggleRowDetail(rowInfo.id);
|
|
19056
|
+
}
|
|
19015
19057
|
return false;
|
|
19016
19058
|
},
|
|
19017
19059
|
PageDown: () => {
|
|
@@ -19102,6 +19144,9 @@ function handleCellNavigation(options, event) {
|
|
|
19102
19144
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
19103
19145
|
return api.toggleGroupRow(rowInfo.groupKeys);
|
|
19104
19146
|
}
|
|
19147
|
+
if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
|
|
19148
|
+
return api.rowDetailApi.toggleRowDetail(rowInfo.id);
|
|
19149
|
+
}
|
|
19105
19150
|
return false;
|
|
19106
19151
|
},
|
|
19107
19152
|
PageDown: () => {
|
package/index.dev.mjs
CHANGED
|
@@ -4982,25 +4982,25 @@ var useInfiniteTableState = () => {
|
|
|
4982
4982
|
import * as React27 from "react";
|
|
4983
4983
|
import { useEffect as useEffect10, useLayoutEffect as useLayoutEffect8, useState as useState5 } from "react";
|
|
4984
4984
|
|
|
4985
|
-
// ../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-
|
|
4986
|
-
function
|
|
4987
|
-
if (
|
|
4988
|
-
return
|
|
4989
|
-
var
|
|
4990
|
-
if (
|
|
4991
|
-
var
|
|
4992
|
-
if (
|
|
4993
|
-
return
|
|
4985
|
+
// ../node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
4986
|
+
function toPrimitive(t, r) {
|
|
4987
|
+
if ("object" != typeof t || !t)
|
|
4988
|
+
return t;
|
|
4989
|
+
var e = t[Symbol.toPrimitive];
|
|
4990
|
+
if (void 0 !== e) {
|
|
4991
|
+
var i = e.call(t, r || "default");
|
|
4992
|
+
if ("object" != typeof i)
|
|
4993
|
+
return i;
|
|
4994
4994
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
4995
4995
|
}
|
|
4996
|
-
return (
|
|
4996
|
+
return ("string" === r ? String : Number)(t);
|
|
4997
4997
|
}
|
|
4998
|
-
function
|
|
4999
|
-
var
|
|
5000
|
-
return
|
|
4998
|
+
function toPropertyKey(t) {
|
|
4999
|
+
var i = toPrimitive(t, "string");
|
|
5000
|
+
return "symbol" == typeof i ? i : String(i);
|
|
5001
5001
|
}
|
|
5002
5002
|
function _defineProperty(obj, key, value) {
|
|
5003
|
-
key =
|
|
5003
|
+
key = toPropertyKey(key);
|
|
5004
5004
|
if (key in obj) {
|
|
5005
5005
|
Object.defineProperty(obj, key, {
|
|
5006
5006
|
value,
|
|
@@ -5013,26 +5013,26 @@ function _defineProperty(obj, key, value) {
|
|
|
5013
5013
|
}
|
|
5014
5014
|
return obj;
|
|
5015
5015
|
}
|
|
5016
|
-
function ownKeys(
|
|
5017
|
-
var
|
|
5016
|
+
function ownKeys(e, r) {
|
|
5017
|
+
var t = Object.keys(e);
|
|
5018
5018
|
if (Object.getOwnPropertySymbols) {
|
|
5019
|
-
var
|
|
5020
|
-
|
|
5021
|
-
return Object.getOwnPropertyDescriptor(
|
|
5022
|
-
})),
|
|
5023
|
-
}
|
|
5024
|
-
return
|
|
5025
|
-
}
|
|
5026
|
-
function _objectSpread2(
|
|
5027
|
-
for (var
|
|
5028
|
-
var
|
|
5029
|
-
|
|
5030
|
-
_defineProperty(
|
|
5031
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
5032
|
-
Object.defineProperty(
|
|
5019
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
5020
|
+
r && (o = o.filter(function(r2) {
|
|
5021
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
5022
|
+
})), t.push.apply(t, o);
|
|
5023
|
+
}
|
|
5024
|
+
return t;
|
|
5025
|
+
}
|
|
5026
|
+
function _objectSpread2(e) {
|
|
5027
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
5028
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
5029
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
5030
|
+
_defineProperty(e, r2, t[r2]);
|
|
5031
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
5032
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
5033
5033
|
});
|
|
5034
5034
|
}
|
|
5035
|
-
return
|
|
5035
|
+
return e;
|
|
5036
5036
|
}
|
|
5037
5037
|
function mapValues(input, fn) {
|
|
5038
5038
|
var result = {};
|
|
@@ -14209,17 +14209,17 @@ var Indexer = class {
|
|
|
14209
14209
|
var EMPTY_ARRAY = Object.freeze(
|
|
14210
14210
|
[]
|
|
14211
14211
|
);
|
|
14212
|
-
var normalizeSortInfo = (initialSortInfo,
|
|
14212
|
+
var normalizeSortInfo = (initialSortInfo, weakMap3) => {
|
|
14213
14213
|
const sortInfo = initialSortInfo != null ? initialSortInfo : EMPTY_ARRAY;
|
|
14214
14214
|
const result = Array.isArray(sortInfo) ? sortInfo : [sortInfo];
|
|
14215
|
-
if (
|
|
14216
|
-
const prevResult =
|
|
14215
|
+
if (weakMap3 && weakMap3.has(sortInfo)) {
|
|
14216
|
+
const prevResult = weakMap3.get(sortInfo);
|
|
14217
14217
|
if (prevResult && prevResult.length === result.length) {
|
|
14218
14218
|
return prevResult;
|
|
14219
14219
|
}
|
|
14220
14220
|
}
|
|
14221
|
-
if (
|
|
14222
|
-
|
|
14221
|
+
if (weakMap3 && sortInfo) {
|
|
14222
|
+
weakMap3.set(sortInfo, result);
|
|
14223
14223
|
}
|
|
14224
14224
|
return result;
|
|
14225
14225
|
};
|
|
@@ -14353,8 +14353,9 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
|
|
|
14353
14353
|
}) : livePaginationCursorProp;
|
|
14354
14354
|
return livePaginationCursor;
|
|
14355
14355
|
}
|
|
14356
|
+
var weakMap = /* @__PURE__ */ new WeakMap();
|
|
14356
14357
|
function deriveStateFromProps(params) {
|
|
14357
|
-
var _a, _b;
|
|
14358
|
+
var _a, _b, _c;
|
|
14358
14359
|
const { props, state, oldState } = params;
|
|
14359
14360
|
const controlledSort = isControlledValue(props.sortInfo);
|
|
14360
14361
|
const controlledFilter = isControlledValue(props.filterValue);
|
|
@@ -14400,19 +14401,34 @@ function deriveStateFromProps(params) {
|
|
|
14400
14401
|
rowSelectionStateConfigGetter(state)
|
|
14401
14402
|
);
|
|
14402
14403
|
} else {
|
|
14403
|
-
|
|
14404
|
-
currentRowSelection
|
|
14405
|
-
|
|
14406
|
-
|
|
14404
|
+
if (selectionMode === "single-row") {
|
|
14405
|
+
rowSelectionState = currentRowSelection;
|
|
14406
|
+
} else {
|
|
14407
|
+
if (currentRowSelection instanceof RowSelectionState) {
|
|
14408
|
+
rowSelectionState = currentRowSelection;
|
|
14409
|
+
} else {
|
|
14410
|
+
const instance = new RowSelectionState(
|
|
14411
|
+
currentRowSelection,
|
|
14412
|
+
rowSelectionStateConfigGetter(state)
|
|
14413
|
+
);
|
|
14414
|
+
rowSelectionState = instance;
|
|
14415
|
+
}
|
|
14416
|
+
}
|
|
14407
14417
|
}
|
|
14408
14418
|
}
|
|
14409
14419
|
if (selectionMode === "single-cell" || selectionMode === "multi-cell") {
|
|
14410
14420
|
if (currentCellSelection === null) {
|
|
14411
14421
|
cellSelectionState = selectionMode === "single-cell" ? null : new CellSelectionState();
|
|
14412
14422
|
} else {
|
|
14413
|
-
|
|
14414
|
-
currentCellSelection
|
|
14415
|
-
|
|
14423
|
+
if (currentCellSelection instanceof CellSelectionState) {
|
|
14424
|
+
cellSelectionState = currentCellSelection;
|
|
14425
|
+
} else {
|
|
14426
|
+
const instance = (_a = weakMap.get(currentCellSelection)) != null ? _a : new CellSelectionState(
|
|
14427
|
+
currentCellSelection
|
|
14428
|
+
);
|
|
14429
|
+
weakMap.set(currentCellSelection, instance);
|
|
14430
|
+
cellSelectionState = instance;
|
|
14431
|
+
}
|
|
14416
14432
|
}
|
|
14417
14433
|
}
|
|
14418
14434
|
}
|
|
@@ -14437,8 +14453,8 @@ function deriveStateFromProps(params) {
|
|
|
14437
14453
|
operatorsByFilterType,
|
|
14438
14454
|
controlledSort,
|
|
14439
14455
|
controlledFilter,
|
|
14440
|
-
sortMode: props.sortFunction ? "local" : (
|
|
14441
|
-
filterMode: typeof props.filterFunction === "function" ? "local" : (
|
|
14456
|
+
sortMode: props.sortFunction ? "local" : (_b = props.sortMode) != null ? _b : controlledSort ? "remote" : "local",
|
|
14457
|
+
filterMode: typeof props.filterFunction === "function" ? "local" : (_c = props.filterMode) != null ? _c : typeof props.data === "function" ? "remote" : "local",
|
|
14442
14458
|
multiSort: Array.isArray(
|
|
14443
14459
|
controlledSort ? props.sortInfo : props.defaultSortInfo
|
|
14444
14460
|
),
|
|
@@ -15363,6 +15379,20 @@ function getRowDetailApi(param) {
|
|
|
15363
15379
|
const expanded = isRowDetailExpanded(rowInfo);
|
|
15364
15380
|
return !expanded;
|
|
15365
15381
|
},
|
|
15382
|
+
isRowDetailEnabledForRow(pk) {
|
|
15383
|
+
const { isRowDetailEnabled } = getState();
|
|
15384
|
+
if (!isRowDetailEnabled) {
|
|
15385
|
+
return false;
|
|
15386
|
+
}
|
|
15387
|
+
if (typeof isRowDetailEnabled === "function") {
|
|
15388
|
+
const rowInfo = dataSourceApi.getRowInfoByPrimaryKey(pk);
|
|
15389
|
+
if (!rowInfo) {
|
|
15390
|
+
return false;
|
|
15391
|
+
}
|
|
15392
|
+
return isRowDetailEnabled(rowInfo);
|
|
15393
|
+
}
|
|
15394
|
+
return true;
|
|
15395
|
+
},
|
|
15366
15396
|
isRowDetailExpanded(pk) {
|
|
15367
15397
|
return !rowDetailApi.isRowDetailCollapsed(pk);
|
|
15368
15398
|
},
|
|
@@ -17495,7 +17525,7 @@ function getGroupByMap(groupBy) {
|
|
|
17495
17525
|
return acc;
|
|
17496
17526
|
}, /* @__PURE__ */ new Map());
|
|
17497
17527
|
}
|
|
17498
|
-
var
|
|
17528
|
+
var weakMap2 = /* @__PURE__ */ new WeakMap();
|
|
17499
17529
|
var mapPropsToState = (params) => {
|
|
17500
17530
|
var _a, _b, _c, _d, _e;
|
|
17501
17531
|
const { props, state, oldState, parentState } = params;
|
|
@@ -17511,10 +17541,10 @@ var mapPropsToState = (params) => {
|
|
|
17511
17541
|
let rowDetailRenderer = props.rowDetailRenderer;
|
|
17512
17542
|
const RowDetailComponent = (_a = props.components) == null ? void 0 : _a.RowDetail;
|
|
17513
17543
|
if (!rowDetailRenderer && RowDetailComponent) {
|
|
17514
|
-
let rowDetailRendererFromComponent =
|
|
17544
|
+
let rowDetailRendererFromComponent = weakMap2.get(RowDetailComponent);
|
|
17515
17545
|
if (!rowDetailRendererFromComponent) {
|
|
17516
17546
|
rowDetailRendererFromComponent = getRowDetailRendererFromComponent(RowDetailComponent);
|
|
17517
|
-
|
|
17547
|
+
weakMap2.set(RowDetailComponent, rowDetailRendererFromComponent);
|
|
17518
17548
|
}
|
|
17519
17549
|
rowDetailRenderer = rowDetailRendererFromComponent;
|
|
17520
17550
|
}
|
|
@@ -17528,7 +17558,7 @@ var mapPropsToState = (params) => {
|
|
|
17528
17558
|
const computedColumns = state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns;
|
|
17529
17559
|
let isRowDetailExpanded = rowDetailState ? props.isRowDetailExpanded : void 0;
|
|
17530
17560
|
if (!isRowDetailExpanded && rowDetailState) {
|
|
17531
|
-
isRowDetailExpanded =
|
|
17561
|
+
isRowDetailExpanded = weakMap2.get(rowDetailState);
|
|
17532
17562
|
if (!isRowDetailExpanded) {
|
|
17533
17563
|
isRowDetailExpanded = (rowInfo) => {
|
|
17534
17564
|
return rowDetailState.isRowDetailsExpanded(
|
|
@@ -17536,7 +17566,7 @@ var mapPropsToState = (params) => {
|
|
|
17536
17566
|
);
|
|
17537
17567
|
};
|
|
17538
17568
|
if (typeof rowDetailState === "object") {
|
|
17539
|
-
|
|
17569
|
+
weakMap2.set(rowDetailState, isRowDetailExpanded);
|
|
17540
17570
|
}
|
|
17541
17571
|
}
|
|
17542
17572
|
}
|
|
@@ -18738,7 +18768,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
18738
18768
|
const valid = useMemo14(() => {
|
|
18739
18769
|
let valid2 = isValidLicense(licenseKey, {
|
|
18740
18770
|
publishedAt: 1624970570587,
|
|
18741
|
-
version: "3.2.
|
|
18771
|
+
version: "3.2.7"
|
|
18742
18772
|
});
|
|
18743
18773
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
18744
18774
|
return true;
|
|
@@ -18973,6 +19003,9 @@ function handleRowNavigation(options, event) {
|
|
|
18973
19003
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
18974
19004
|
return api.collapseGroupRow(rowInfo.groupKeys);
|
|
18975
19005
|
}
|
|
19006
|
+
if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
|
|
19007
|
+
return api.rowDetailApi.collapseRowDetail(rowInfo.id);
|
|
19008
|
+
}
|
|
18976
19009
|
return false;
|
|
18977
19010
|
},
|
|
18978
19011
|
ArrowRight: () => {
|
|
@@ -18980,6 +19013,9 @@ function handleRowNavigation(options, event) {
|
|
|
18980
19013
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
18981
19014
|
return api.expandGroupRow(rowInfo.groupKeys);
|
|
18982
19015
|
}
|
|
19016
|
+
if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
|
|
19017
|
+
return api.rowDetailApi.expandRowDetail(rowInfo.id);
|
|
19018
|
+
}
|
|
18983
19019
|
return false;
|
|
18984
19020
|
},
|
|
18985
19021
|
Enter: () => {
|
|
@@ -18987,6 +19023,12 @@ function handleRowNavigation(options, event) {
|
|
|
18987
19023
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
18988
19024
|
return api.toggleGroupRow(rowInfo.groupKeys);
|
|
18989
19025
|
}
|
|
19026
|
+
const hasRowDetail = api.rowDetailApi.isRowDetailEnabledForRow(
|
|
19027
|
+
rowInfo.id
|
|
19028
|
+
);
|
|
19029
|
+
if (hasRowDetail) {
|
|
19030
|
+
return api.rowDetailApi.toggleRowDetail(rowInfo.id);
|
|
19031
|
+
}
|
|
18990
19032
|
return false;
|
|
18991
19033
|
},
|
|
18992
19034
|
PageDown: () => {
|
|
@@ -19077,6 +19119,9 @@ function handleCellNavigation(options, event) {
|
|
|
19077
19119
|
if (rowInfo && rowInfo.isGroupRow) {
|
|
19078
19120
|
return api.toggleGroupRow(rowInfo.groupKeys);
|
|
19079
19121
|
}
|
|
19122
|
+
if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
|
|
19123
|
+
return api.rowDetailApi.toggleRowDetail(rowInfo.id);
|
|
19124
|
+
}
|
|
19080
19125
|
return false;
|
|
19081
19126
|
},
|
|
19082
19127
|
PageDown: () => {
|