@infinite-table/infinite-react 0.4.9 → 0.4.10

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 CHANGED
@@ -1160,7 +1160,7 @@ interface DataSourceMappedState<T> {
1160
1160
  livePagination: DataSourceProps<T>['livePagination'];
1161
1161
  isRowSelected: DataSourceProps<T>['isRowSelected'];
1162
1162
  lazyLoad: DataSourceProps<T>['lazyLoad'];
1163
- usePrimaryKeysForMultiRowSelection: NonUndefined<DataSourceProps<T>['usePrimaryKeysForMultiRowSelection']>;
1163
+ useGroupKeysForMultiRowSelection: NonUndefined<DataSourceProps<T>['useGroupKeysForMultiRowSelection']>;
1164
1164
  onDataParamsChange: DataSourceProps<T>['onDataParamsChange'];
1165
1165
  data: DataSourceProps<T>['data'];
1166
1166
  sortMode: DataSourceProps<T>['sortMode'];
@@ -1273,7 +1273,7 @@ declare type DataSourceProps<T> = {
1273
1273
  fields?: (keyof T)[];
1274
1274
  data: DataSourceData<T>;
1275
1275
  selectionMode?: DataSourcePropSelectionMode;
1276
- usePrimaryKeysForMultiRowSelection?: boolean;
1276
+ useGroupKeysForMultiRowSelection?: boolean;
1277
1277
  rowSelection?: DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
1278
1278
  defaultRowSelection?: DataSourcePropRowSelection_MultiRow | DataSourcePropRowSelection_SingleRow;
1279
1279
  cellSelection?: DataSourcePropCellSelection;
package/index.esm.js CHANGED
@@ -9245,7 +9245,8 @@ var RowSelectionState = class {
9245
9245
  if (cachedResult != null) {
9246
9246
  return cachedResult;
9247
9247
  }
9248
- if (groupKeys.length > this.getGroupByLength()) {
9248
+ const groupByLength = this.getGroupByLength();
9249
+ if (groupKeys.length > groupByLength) {
9249
9250
  const result2 = this.isRowSelected(groupKeys) ? { selectedCount: 1, deselectedCount: 0 } : {
9250
9251
  selectedCount: 0,
9251
9252
  deselectedCount: 1
@@ -9253,7 +9254,7 @@ var RowSelectionState = class {
9253
9254
  this.selectionCountCache.set(groupKeys, result2);
9254
9255
  return result2;
9255
9256
  }
9256
- if (this.onlyUsePrimaryKeys) {
9257
+ if (groupByLength && this.onlyUsePrimaryKeys) {
9257
9258
  const allKeys2 = this.getAllPrimaryKeysInsideGroup(groupKeys);
9258
9259
  let selectedCount2 = 0;
9259
9260
  let deselectedCount2 = 0;
@@ -9336,7 +9337,7 @@ function rowSelectionStateConfigGetter(stateOrStateGetter) {
9336
9337
  return {
9337
9338
  lazyLoad: !!state.lazyLoad,
9338
9339
  toPrimaryKey: state.toPrimaryKey,
9339
- onlyUsePrimaryKeys: state.usePrimaryKeysForMultiRowSelection,
9340
+ onlyUsePrimaryKeys: !state.useGroupKeysForMultiRowSelection,
9340
9341
  groupBy: state.groupBy,
9341
9342
  groupDeepMap: state.groupDeepMap,
9342
9343
  indexer: state.indexer,
@@ -9658,7 +9659,7 @@ var forwardProps3 = (setupState) => {
9658
9659
  livePagination: 1,
9659
9660
  filterFunction: 1,
9660
9661
  filterValue: 1,
9661
- usePrimaryKeysForMultiRowSelection: (usePrimaryKeysForMultiRowSelection) => usePrimaryKeysForMultiRowSelection != null ? usePrimaryKeysForMultiRowSelection : false,
9662
+ useGroupKeysForMultiRowSelection: (useGroupKeysForMultiRowSelection) => useGroupKeysForMultiRowSelection != null ? useGroupKeysForMultiRowSelection : false,
9662
9663
  filterDelay: (filterDelay) => filterDelay != null ? filterDelay : 200,
9663
9664
  filterTypes: (filterTypes) => {
9664
9665
  return __spreadValues(__spreadValues({}, defaultFilterTypes), filterTypes);
@@ -12490,7 +12491,7 @@ var useLicense = (licenseKey = "") => {
12490
12491
  const valid = useMemo11(() => {
12491
12492
  let valid2 = isValidLicense(licenseKey, {
12492
12493
  publishedAt: 1624970570587,
12493
- version: "0.4.9"
12494
+ version: "0.4.10"
12494
12495
  });
12495
12496
  if (!licenseKey && !valid2 && isInsidePlayground) {
12496
12497
  return true;
package/index.js CHANGED
@@ -9152,7 +9152,8 @@ var RowSelectionState = class {
9152
9152
  if (cachedResult != null) {
9153
9153
  return cachedResult;
9154
9154
  }
9155
- if (groupKeys.length > this.getGroupByLength()) {
9155
+ const groupByLength = this.getGroupByLength();
9156
+ if (groupKeys.length > groupByLength) {
9156
9157
  const result2 = this.isRowSelected(groupKeys) ? { selectedCount: 1, deselectedCount: 0 } : {
9157
9158
  selectedCount: 0,
9158
9159
  deselectedCount: 1
@@ -9160,7 +9161,7 @@ var RowSelectionState = class {
9160
9161
  this.selectionCountCache.set(groupKeys, result2);
9161
9162
  return result2;
9162
9163
  }
9163
- if (this.onlyUsePrimaryKeys) {
9164
+ if (groupByLength && this.onlyUsePrimaryKeys) {
9164
9165
  const allKeys2 = this.getAllPrimaryKeysInsideGroup(groupKeys);
9165
9166
  let selectedCount2 = 0;
9166
9167
  let deselectedCount2 = 0;
@@ -9243,7 +9244,7 @@ function rowSelectionStateConfigGetter(stateOrStateGetter) {
9243
9244
  return {
9244
9245
  lazyLoad: !!state.lazyLoad,
9245
9246
  toPrimaryKey: state.toPrimaryKey,
9246
- onlyUsePrimaryKeys: state.usePrimaryKeysForMultiRowSelection,
9247
+ onlyUsePrimaryKeys: !state.useGroupKeysForMultiRowSelection,
9247
9248
  groupBy: state.groupBy,
9248
9249
  groupDeepMap: state.groupDeepMap,
9249
9250
  indexer: state.indexer,
@@ -9565,7 +9566,7 @@ var forwardProps3 = (setupState) => {
9565
9566
  livePagination: 1,
9566
9567
  filterFunction: 1,
9567
9568
  filterValue: 1,
9568
- usePrimaryKeysForMultiRowSelection: (usePrimaryKeysForMultiRowSelection) => usePrimaryKeysForMultiRowSelection != null ? usePrimaryKeysForMultiRowSelection : false,
9569
+ useGroupKeysForMultiRowSelection: (useGroupKeysForMultiRowSelection) => useGroupKeysForMultiRowSelection != null ? useGroupKeysForMultiRowSelection : false,
9569
9570
  filterDelay: (filterDelay) => filterDelay != null ? filterDelay : 200,
9570
9571
  filterTypes: (filterTypes) => {
9571
9572
  return __spreadValues(__spreadValues({}, defaultFilterTypes), filterTypes);
@@ -12391,7 +12392,7 @@ var useLicense = (licenseKey = "") => {
12391
12392
  const valid = (0, import_react44.useMemo)(() => {
12392
12393
  let valid2 = isValidLicense(licenseKey, {
12393
12394
  publishedAt: 1624970570587,
12394
- version: "0.4.9"
12395
+ version: "0.4.10"
12395
12396
  });
12396
12397
  if (!licenseKey && !valid2 && isInsidePlayground) {
12397
12398
  return true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infinite-table/infinite-react",
3
3
  "description": "Infinite Table for React",
4
- "version": "0.4.9",
4
+ "version": "0.4.10",
5
5
  "main": "index.js",
6
6
  "module": "index.esm.js",
7
7
  "typings": "index.d.ts",
@@ -14,5 +14,5 @@
14
14
  },
15
15
  "license": "Commercial & Open Source",
16
16
  "//": "will be updated at build time",
17
- "publishedAt": 1661328172572
17
+ "publishedAt": 1661331797164
18
18
  }