@infinite-table/infinite-react 5.0.6 → 5.0.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 CHANGED
@@ -2279,7 +2279,7 @@ declare type DataSourceRowInfoReducer<T> = DataSourceRawReducer<InfiniteTableRow
2279
2279
  declare type DataSourcePropShouldReloadDataObject<T> = {
2280
2280
  [key in keyof Pick<DataSourceDataParams<T>, 'sortInfo' | 'pivotBy' | 'groupBy' | 'filterValue'>]: boolean;
2281
2281
  };
2282
- declare type DataSourcePropShouldReloadData<T> = DataSourcePropShouldReloadDataObject<T>;
2282
+ declare type DataSourcePropShouldReloadData<T> = DataSourcePropShouldReloadDataObject<T> | boolean;
2283
2283
  declare type DataSourceProps<T> = {
2284
2284
  debugId?: string;
2285
2285
  children?: React$1.ReactNode | ((contextData: DataSourceState<T>) => React$1.ReactNode);
@@ -2456,7 +2456,7 @@ declare type DataSourceDerivedState<T> = {
2456
2456
  filterMode: 'local' | 'remote';
2457
2457
  groupMode: 'local' | 'remote';
2458
2458
  pivotMode: 'local' | 'remote';
2459
- shouldReloadData: NonUndefined<Required<DataSourcePropShouldReloadData<T>>>;
2459
+ shouldReloadData: NonUndefined<Required<DataSourcePropShouldReloadDataObject<T>>>;
2460
2460
  groupRowsState: GroupRowsState<T>;
2461
2461
  multiSort: boolean;
2462
2462
  controlledSort: boolean;
@@ -2655,7 +2655,7 @@ declare const useManagedDataSource: (props: unknown) => {
2655
2655
  filterMode: never;
2656
2656
  groupMode: never;
2657
2657
  pivotMode: never;
2658
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
2658
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
2659
2659
  groupRowsState: GroupRowsState<unknown>;
2660
2660
  multiSort: never;
2661
2661
  controlledSort: never;
@@ -2753,7 +2753,7 @@ declare const useManagedDataSource: (props: unknown) => {
2753
2753
  filterMode: never;
2754
2754
  groupMode: never;
2755
2755
  pivotMode: never;
2756
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
2756
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
2757
2757
  groupRowsState: GroupRowsState<unknown>;
2758
2758
  multiSort: never;
2759
2759
  controlledSort: never;
@@ -2851,7 +2851,7 @@ declare const useManagedDataSource: (props: unknown) => {
2851
2851
  filterMode: never;
2852
2852
  groupMode: never;
2853
2853
  pivotMode: never;
2854
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
2854
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
2855
2855
  groupRowsState: GroupRowsState<unknown>;
2856
2856
  multiSort: never;
2857
2857
  controlledSort: never;
@@ -2950,7 +2950,7 @@ declare const useManagedDataSource: (props: unknown) => {
2950
2950
  filterMode: never;
2951
2951
  groupMode: never;
2952
2952
  pivotMode: never;
2953
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
2953
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
2954
2954
  groupRowsState: GroupRowsState<unknown>;
2955
2955
  multiSort: never;
2956
2956
  controlledSort: never;
@@ -3048,7 +3048,7 @@ declare const useManagedDataSource: (props: unknown) => {
3048
3048
  filterMode: never;
3049
3049
  groupMode: never;
3050
3050
  pivotMode: never;
3051
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
3051
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
3052
3052
  groupRowsState: GroupRowsState<unknown>;
3053
3053
  multiSort: never;
3054
3054
  controlledSort: never;
@@ -3146,7 +3146,7 @@ declare const useManagedDataSource: (props: unknown) => {
3146
3146
  filterMode: never;
3147
3147
  groupMode: never;
3148
3148
  pivotMode: never;
3149
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
3149
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
3150
3150
  groupRowsState: GroupRowsState<unknown>;
3151
3151
  multiSort: never;
3152
3152
  controlledSort: never;
@@ -3245,7 +3245,7 @@ declare const useManagedDataSource: (props: unknown) => {
3245
3245
  filterMode: never;
3246
3246
  groupMode: never;
3247
3247
  pivotMode: never;
3248
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
3248
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
3249
3249
  groupRowsState: GroupRowsState<unknown>;
3250
3250
  multiSort: never;
3251
3251
  controlledSort: never;
@@ -3343,7 +3343,7 @@ declare const useManagedDataSource: (props: unknown) => {
3343
3343
  filterMode: never;
3344
3344
  groupMode: never;
3345
3345
  pivotMode: never;
3346
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
3346
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
3347
3347
  groupRowsState: GroupRowsState<unknown>;
3348
3348
  multiSort: never;
3349
3349
  controlledSort: never;
@@ -3441,7 +3441,7 @@ declare const useManagedDataSource: (props: unknown) => {
3441
3441
  filterMode: never;
3442
3442
  groupMode: never;
3443
3443
  pivotMode: never;
3444
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
3444
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
3445
3445
  groupRowsState: GroupRowsState<unknown>;
3446
3446
  multiSort: never;
3447
3447
  controlledSort: never;
@@ -3540,7 +3540,7 @@ declare const useManagedDataSource: (props: unknown) => {
3540
3540
  filterMode: never;
3541
3541
  groupMode: never;
3542
3542
  pivotMode: never;
3543
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
3543
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
3544
3544
  groupRowsState: GroupRowsState<unknown>;
3545
3545
  multiSort: never;
3546
3546
  controlledSort: never;
@@ -3638,7 +3638,7 @@ declare const useManagedDataSource: (props: unknown) => {
3638
3638
  filterMode: never;
3639
3639
  groupMode: never;
3640
3640
  pivotMode: never;
3641
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
3641
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
3642
3642
  groupRowsState: GroupRowsState<unknown>;
3643
3643
  multiSort: never;
3644
3644
  controlledSort: never;
@@ -3736,7 +3736,7 @@ declare const useManagedDataSource: (props: unknown) => {
3736
3736
  filterMode: never;
3737
3737
  groupMode: never;
3738
3738
  pivotMode: never;
3739
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
3739
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
3740
3740
  groupRowsState: GroupRowsState<unknown>;
3741
3741
  multiSort: never;
3742
3742
  controlledSort: never;
@@ -3835,7 +3835,7 @@ declare const useManagedDataSource: (props: unknown) => {
3835
3835
  filterMode: never;
3836
3836
  groupMode: never;
3837
3837
  pivotMode: never;
3838
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
3838
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
3839
3839
  groupRowsState: GroupRowsState<unknown>;
3840
3840
  multiSort: never;
3841
3841
  controlledSort: never;
@@ -3933,7 +3933,7 @@ declare const useManagedDataSource: (props: unknown) => {
3933
3933
  filterMode: never;
3934
3934
  groupMode: never;
3935
3935
  pivotMode: never;
3936
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
3936
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
3937
3937
  groupRowsState: GroupRowsState<unknown>;
3938
3938
  multiSort: never;
3939
3939
  controlledSort: never;
@@ -4031,7 +4031,7 @@ declare const useManagedDataSource: (props: unknown) => {
4031
4031
  filterMode: never;
4032
4032
  groupMode: never;
4033
4033
  pivotMode: never;
4034
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
4034
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
4035
4035
  groupRowsState: GroupRowsState<unknown>;
4036
4036
  multiSort: never;
4037
4037
  controlledSort: never;
@@ -4131,7 +4131,7 @@ declare const useManagedDataSource: (props: unknown) => {
4131
4131
  filterMode: never;
4132
4132
  groupMode: never;
4133
4133
  pivotMode: never;
4134
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
4134
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
4135
4135
  groupRowsState: GroupRowsState<unknown>;
4136
4136
  multiSort: never;
4137
4137
  controlledSort: never;
@@ -4229,7 +4229,7 @@ declare const useManagedDataSource: (props: unknown) => {
4229
4229
  filterMode: never;
4230
4230
  groupMode: never;
4231
4231
  pivotMode: never;
4232
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
4232
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
4233
4233
  groupRowsState: GroupRowsState<unknown>;
4234
4234
  multiSort: never;
4235
4235
  controlledSort: never;
@@ -4327,7 +4327,7 @@ declare const useManagedDataSource: (props: unknown) => {
4327
4327
  filterMode: never;
4328
4328
  groupMode: never;
4329
4329
  pivotMode: never;
4330
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
4330
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
4331
4331
  groupRowsState: GroupRowsState<unknown>;
4332
4332
  multiSort: never;
4333
4333
  controlledSort: never;
@@ -4425,7 +4425,7 @@ declare const useManagedDataSource: (props: unknown) => {
4425
4425
  filterMode: never;
4426
4426
  groupMode: never;
4427
4427
  pivotMode: never;
4428
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
4428
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
4429
4429
  groupRowsState: GroupRowsState<unknown>;
4430
4430
  multiSort: never;
4431
4431
  controlledSort: never;
@@ -4523,7 +4523,7 @@ declare const useManagedDataSource: (props: unknown) => {
4523
4523
  filterMode: never;
4524
4524
  groupMode: never;
4525
4525
  pivotMode: never;
4526
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
4526
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
4527
4527
  groupRowsState: GroupRowsState<unknown>;
4528
4528
  multiSort: never;
4529
4529
  controlledSort: never;
@@ -4621,7 +4621,7 @@ declare const useManagedDataSource: (props: unknown) => {
4621
4621
  filterMode: never;
4622
4622
  groupMode: never;
4623
4623
  pivotMode: never;
4624
- shouldReloadData: Required<DataSourcePropShouldReloadData<unknown>>;
4624
+ shouldReloadData: Required<DataSourcePropShouldReloadDataObject<unknown>>;
4625
4625
  groupRowsState: GroupRowsState<unknown>;
4626
4626
  multiSort: never;
4627
4627
  controlledSort: never;
package/index.dev.js CHANGED
@@ -15513,6 +15513,30 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
15513
15513
  return livePaginationCursor;
15514
15514
  }
15515
15515
  var weakMap = /* @__PURE__ */ new WeakMap();
15516
+ function toShouldReloadObject(shouldReloadData) {
15517
+ if (typeof shouldReloadData === "boolean") {
15518
+ return {
15519
+ filterValue: shouldReloadData,
15520
+ sortInfo: shouldReloadData,
15521
+ groupBy: shouldReloadData,
15522
+ pivotBy: shouldReloadData
15523
+ };
15524
+ }
15525
+ const result = {};
15526
+ if (shouldReloadData.filterValue != null) {
15527
+ result.filterValue = shouldReloadData.filterValue;
15528
+ }
15529
+ if (shouldReloadData.sortInfo != null) {
15530
+ result.sortInfo = shouldReloadData.sortInfo;
15531
+ }
15532
+ if (shouldReloadData.groupBy != null) {
15533
+ result.groupBy = shouldReloadData.groupBy;
15534
+ }
15535
+ if (shouldReloadData.pivotBy != null) {
15536
+ result.pivotBy = shouldReloadData.pivotBy;
15537
+ }
15538
+ return result;
15539
+ }
15516
15540
  function deriveStateFromProps(params) {
15517
15541
  const { props, state, oldState } = params;
15518
15542
  const controlledSort = isControlledValue(props.sortInfo);
@@ -15602,7 +15626,7 @@ function deriveStateFromProps(params) {
15602
15626
  collapsedRows: []
15603
15627
  }
15604
15628
  );
15605
- const { shouldReloadData = {} } = props;
15629
+ const shouldReloadData = toShouldReloadObject(props.shouldReloadData || {});
15606
15630
  const propsGroupMode = props.groupMode ?? (shouldReloadData.groupBy != null ? shouldReloadData.groupBy ? "remote" : "local" : void 0);
15607
15631
  const propsSortMode = props.sortMode ?? shouldReloadData.sortInfo != null ? shouldReloadData.sortInfo ? "remote" : "local" : void 0;
15608
15632
  const propsFilterMode = props.filterMode ?? shouldReloadData.filterValue != null ? shouldReloadData.filterValue ? "remote" : "local" : void 0;
@@ -15655,10 +15679,10 @@ function deriveStateFromProps(params) {
15655
15679
  // since we want a subtle difference between the computed sortMode and shouldReloadData.sortInfo (for example)
15656
15680
  // difference: sortMode will be local when sortFunction is provided, however, the user may want to reload data when sortInfo changes
15657
15681
  // and thus the data will be refetched, but will be sorted locally
15658
- filterValue: props.shouldReloadData?.filterValue ?? filterMode === "remote",
15659
- sortInfo: props.shouldReloadData?.sortInfo ?? sortMode === "remote",
15660
- groupBy: props.shouldReloadData?.groupBy ?? groupMode === "remote",
15661
- pivotBy: props.shouldReloadData?.pivotBy ?? pivotMode === "remote"
15682
+ filterValue: shouldReloadData?.filterValue ?? filterMode === "remote",
15683
+ sortInfo: shouldReloadData?.sortInfo ?? sortMode === "remote",
15684
+ groupBy: shouldReloadData?.groupBy ?? groupMode === "remote",
15685
+ pivotBy: shouldReloadData?.pivotBy ?? pivotMode === "remote"
15662
15686
  },
15663
15687
  isRowDisabled,
15664
15688
  rowSelection: rowSelectionState,
@@ -20210,7 +20234,7 @@ var useLicense = (licenseKey = "") => {
20210
20234
  }
20211
20235
  let valid2 = isValidLicense(licenseKey, {
20212
20236
  publishedAt: 1624970570587,
20213
- version: "5.0.6"
20237
+ version: "5.0.7"
20214
20238
  });
20215
20239
  if (!licenseKey && !valid2 && isInsidePlayground) {
20216
20240
  return true;
package/index.dev.mjs CHANGED
@@ -15468,6 +15468,30 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
15468
15468
  return livePaginationCursor;
15469
15469
  }
15470
15470
  var weakMap = /* @__PURE__ */ new WeakMap();
15471
+ function toShouldReloadObject(shouldReloadData) {
15472
+ if (typeof shouldReloadData === "boolean") {
15473
+ return {
15474
+ filterValue: shouldReloadData,
15475
+ sortInfo: shouldReloadData,
15476
+ groupBy: shouldReloadData,
15477
+ pivotBy: shouldReloadData
15478
+ };
15479
+ }
15480
+ const result = {};
15481
+ if (shouldReloadData.filterValue != null) {
15482
+ result.filterValue = shouldReloadData.filterValue;
15483
+ }
15484
+ if (shouldReloadData.sortInfo != null) {
15485
+ result.sortInfo = shouldReloadData.sortInfo;
15486
+ }
15487
+ if (shouldReloadData.groupBy != null) {
15488
+ result.groupBy = shouldReloadData.groupBy;
15489
+ }
15490
+ if (shouldReloadData.pivotBy != null) {
15491
+ result.pivotBy = shouldReloadData.pivotBy;
15492
+ }
15493
+ return result;
15494
+ }
15471
15495
  function deriveStateFromProps(params) {
15472
15496
  const { props, state, oldState } = params;
15473
15497
  const controlledSort = isControlledValue(props.sortInfo);
@@ -15557,7 +15581,7 @@ function deriveStateFromProps(params) {
15557
15581
  collapsedRows: []
15558
15582
  }
15559
15583
  );
15560
- const { shouldReloadData = {} } = props;
15584
+ const shouldReloadData = toShouldReloadObject(props.shouldReloadData || {});
15561
15585
  const propsGroupMode = props.groupMode ?? (shouldReloadData.groupBy != null ? shouldReloadData.groupBy ? "remote" : "local" : void 0);
15562
15586
  const propsSortMode = props.sortMode ?? shouldReloadData.sortInfo != null ? shouldReloadData.sortInfo ? "remote" : "local" : void 0;
15563
15587
  const propsFilterMode = props.filterMode ?? shouldReloadData.filterValue != null ? shouldReloadData.filterValue ? "remote" : "local" : void 0;
@@ -15610,10 +15634,10 @@ function deriveStateFromProps(params) {
15610
15634
  // since we want a subtle difference between the computed sortMode and shouldReloadData.sortInfo (for example)
15611
15635
  // difference: sortMode will be local when sortFunction is provided, however, the user may want to reload data when sortInfo changes
15612
15636
  // and thus the data will be refetched, but will be sorted locally
15613
- filterValue: props.shouldReloadData?.filterValue ?? filterMode === "remote",
15614
- sortInfo: props.shouldReloadData?.sortInfo ?? sortMode === "remote",
15615
- groupBy: props.shouldReloadData?.groupBy ?? groupMode === "remote",
15616
- pivotBy: props.shouldReloadData?.pivotBy ?? pivotMode === "remote"
15637
+ filterValue: shouldReloadData?.filterValue ?? filterMode === "remote",
15638
+ sortInfo: shouldReloadData?.sortInfo ?? sortMode === "remote",
15639
+ groupBy: shouldReloadData?.groupBy ?? groupMode === "remote",
15640
+ pivotBy: shouldReloadData?.pivotBy ?? pivotMode === "remote"
15617
15641
  },
15618
15642
  isRowDisabled,
15619
15643
  rowSelection: rowSelectionState,
@@ -20174,7 +20198,7 @@ var useLicense = (licenseKey = "") => {
20174
20198
  }
20175
20199
  let valid2 = isValidLicense(licenseKey, {
20176
20200
  publishedAt: 1624970570587,
20177
- version: "5.0.6"
20201
+ version: "5.0.7"
20178
20202
  });
20179
20203
  if (!licenseKey && !valid2 && isInsidePlayground) {
20180
20204
  return true;
package/index.js CHANGED
@@ -15513,6 +15513,30 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
15513
15513
  return livePaginationCursor;
15514
15514
  }
15515
15515
  var weakMap = /* @__PURE__ */ new WeakMap();
15516
+ function toShouldReloadObject(shouldReloadData) {
15517
+ if (typeof shouldReloadData === "boolean") {
15518
+ return {
15519
+ filterValue: shouldReloadData,
15520
+ sortInfo: shouldReloadData,
15521
+ groupBy: shouldReloadData,
15522
+ pivotBy: shouldReloadData
15523
+ };
15524
+ }
15525
+ const result = {};
15526
+ if (shouldReloadData.filterValue != null) {
15527
+ result.filterValue = shouldReloadData.filterValue;
15528
+ }
15529
+ if (shouldReloadData.sortInfo != null) {
15530
+ result.sortInfo = shouldReloadData.sortInfo;
15531
+ }
15532
+ if (shouldReloadData.groupBy != null) {
15533
+ result.groupBy = shouldReloadData.groupBy;
15534
+ }
15535
+ if (shouldReloadData.pivotBy != null) {
15536
+ result.pivotBy = shouldReloadData.pivotBy;
15537
+ }
15538
+ return result;
15539
+ }
15516
15540
  function deriveStateFromProps(params) {
15517
15541
  const { props, state, oldState } = params;
15518
15542
  const controlledSort = isControlledValue(props.sortInfo);
@@ -15602,7 +15626,7 @@ function deriveStateFromProps(params) {
15602
15626
  collapsedRows: []
15603
15627
  }
15604
15628
  );
15605
- const { shouldReloadData = {} } = props;
15629
+ const shouldReloadData = toShouldReloadObject(props.shouldReloadData || {});
15606
15630
  const propsGroupMode = props.groupMode ?? (shouldReloadData.groupBy != null ? shouldReloadData.groupBy ? "remote" : "local" : void 0);
15607
15631
  const propsSortMode = props.sortMode ?? shouldReloadData.sortInfo != null ? shouldReloadData.sortInfo ? "remote" : "local" : void 0;
15608
15632
  const propsFilterMode = props.filterMode ?? shouldReloadData.filterValue != null ? shouldReloadData.filterValue ? "remote" : "local" : void 0;
@@ -15655,10 +15679,10 @@ function deriveStateFromProps(params) {
15655
15679
  // since we want a subtle difference between the computed sortMode and shouldReloadData.sortInfo (for example)
15656
15680
  // difference: sortMode will be local when sortFunction is provided, however, the user may want to reload data when sortInfo changes
15657
15681
  // and thus the data will be refetched, but will be sorted locally
15658
- filterValue: props.shouldReloadData?.filterValue ?? filterMode === "remote",
15659
- sortInfo: props.shouldReloadData?.sortInfo ?? sortMode === "remote",
15660
- groupBy: props.shouldReloadData?.groupBy ?? groupMode === "remote",
15661
- pivotBy: props.shouldReloadData?.pivotBy ?? pivotMode === "remote"
15682
+ filterValue: shouldReloadData?.filterValue ?? filterMode === "remote",
15683
+ sortInfo: shouldReloadData?.sortInfo ?? sortMode === "remote",
15684
+ groupBy: shouldReloadData?.groupBy ?? groupMode === "remote",
15685
+ pivotBy: shouldReloadData?.pivotBy ?? pivotMode === "remote"
15662
15686
  },
15663
15687
  isRowDisabled,
15664
15688
  rowSelection: rowSelectionState,
@@ -20210,7 +20234,7 @@ var useLicense = (licenseKey = "") => {
20210
20234
  }
20211
20235
  let valid2 = isValidLicense(licenseKey, {
20212
20236
  publishedAt: 1624970570587,
20213
- version: "5.0.6"
20237
+ version: "5.0.7"
20214
20238
  });
20215
20239
  if (!licenseKey && !valid2 && isInsidePlayground) {
20216
20240
  return true;
package/index.mjs CHANGED
@@ -15468,6 +15468,30 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
15468
15468
  return livePaginationCursor;
15469
15469
  }
15470
15470
  var weakMap = /* @__PURE__ */ new WeakMap();
15471
+ function toShouldReloadObject(shouldReloadData) {
15472
+ if (typeof shouldReloadData === "boolean") {
15473
+ return {
15474
+ filterValue: shouldReloadData,
15475
+ sortInfo: shouldReloadData,
15476
+ groupBy: shouldReloadData,
15477
+ pivotBy: shouldReloadData
15478
+ };
15479
+ }
15480
+ const result = {};
15481
+ if (shouldReloadData.filterValue != null) {
15482
+ result.filterValue = shouldReloadData.filterValue;
15483
+ }
15484
+ if (shouldReloadData.sortInfo != null) {
15485
+ result.sortInfo = shouldReloadData.sortInfo;
15486
+ }
15487
+ if (shouldReloadData.groupBy != null) {
15488
+ result.groupBy = shouldReloadData.groupBy;
15489
+ }
15490
+ if (shouldReloadData.pivotBy != null) {
15491
+ result.pivotBy = shouldReloadData.pivotBy;
15492
+ }
15493
+ return result;
15494
+ }
15471
15495
  function deriveStateFromProps(params) {
15472
15496
  const { props, state, oldState } = params;
15473
15497
  const controlledSort = isControlledValue(props.sortInfo);
@@ -15557,7 +15581,7 @@ function deriveStateFromProps(params) {
15557
15581
  collapsedRows: []
15558
15582
  }
15559
15583
  );
15560
- const { shouldReloadData = {} } = props;
15584
+ const shouldReloadData = toShouldReloadObject(props.shouldReloadData || {});
15561
15585
  const propsGroupMode = props.groupMode ?? (shouldReloadData.groupBy != null ? shouldReloadData.groupBy ? "remote" : "local" : void 0);
15562
15586
  const propsSortMode = props.sortMode ?? shouldReloadData.sortInfo != null ? shouldReloadData.sortInfo ? "remote" : "local" : void 0;
15563
15587
  const propsFilterMode = props.filterMode ?? shouldReloadData.filterValue != null ? shouldReloadData.filterValue ? "remote" : "local" : void 0;
@@ -15610,10 +15634,10 @@ function deriveStateFromProps(params) {
15610
15634
  // since we want a subtle difference between the computed sortMode and shouldReloadData.sortInfo (for example)
15611
15635
  // difference: sortMode will be local when sortFunction is provided, however, the user may want to reload data when sortInfo changes
15612
15636
  // and thus the data will be refetched, but will be sorted locally
15613
- filterValue: props.shouldReloadData?.filterValue ?? filterMode === "remote",
15614
- sortInfo: props.shouldReloadData?.sortInfo ?? sortMode === "remote",
15615
- groupBy: props.shouldReloadData?.groupBy ?? groupMode === "remote",
15616
- pivotBy: props.shouldReloadData?.pivotBy ?? pivotMode === "remote"
15637
+ filterValue: shouldReloadData?.filterValue ?? filterMode === "remote",
15638
+ sortInfo: shouldReloadData?.sortInfo ?? sortMode === "remote",
15639
+ groupBy: shouldReloadData?.groupBy ?? groupMode === "remote",
15640
+ pivotBy: shouldReloadData?.pivotBy ?? pivotMode === "remote"
15617
15641
  },
15618
15642
  isRowDisabled,
15619
15643
  rowSelection: rowSelectionState,
@@ -20174,7 +20198,7 @@ var useLicense = (licenseKey = "") => {
20174
20198
  }
20175
20199
  let valid2 = isValidLicense(licenseKey, {
20176
20200
  publishedAt: 1624970570587,
20177
- version: "5.0.6"
20201
+ version: "5.0.7"
20178
20202
  });
20179
20203
  if (!licenseKey && !valid2 && isInsidePlayground) {
20180
20204
  return true;
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "bugs": {
26
26
  "url": "https://github.com/infinite-table/infinite-react/issues"
27
27
  },
28
- "version": "5.0.6",
28
+ "version": "5.0.7",
29
29
  "main": "index.js",
30
30
  "module": "index.mjs",
31
31
  "typings": "index.d.ts",
@@ -34,5 +34,5 @@
34
34
  },
35
35
  "license": "Commercial & Open Source",
36
36
  "//": "will be updated at build time",
37
- "publishedAt": 1729161216357
37
+ "publishedAt": 1729165013374
38
38
  }