@infinite-table/infinite-react 3.2.5 → 3.2.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/index.d.ts CHANGED
@@ -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
@@ -15392,6 +15392,20 @@ function getRowDetailApi(param) {
15392
15392
  const expanded = isRowDetailExpanded(rowInfo);
15393
15393
  return !expanded;
15394
15394
  },
15395
+ isRowDetailEnabledForRow(pk) {
15396
+ const { isRowDetailEnabled } = getState();
15397
+ if (!isRowDetailEnabled) {
15398
+ return false;
15399
+ }
15400
+ if (typeof isRowDetailEnabled === "function") {
15401
+ const rowInfo = dataSourceApi.getRowInfoByPrimaryKey(pk);
15402
+ if (!rowInfo) {
15403
+ return false;
15404
+ }
15405
+ return isRowDetailEnabled(rowInfo);
15406
+ }
15407
+ return true;
15408
+ },
15395
15409
  isRowDetailExpanded(pk) {
15396
15410
  return !rowDetailApi.isRowDetailCollapsed(pk);
15397
15411
  },
@@ -18763,7 +18777,7 @@ var useLicense = (licenseKey = "") => {
18763
18777
  const valid = (0, import_react53.useMemo)(() => {
18764
18778
  let valid2 = isValidLicense(licenseKey, {
18765
18779
  publishedAt: 1624970570587,
18766
- version: "3.2.5"
18780
+ version: "3.2.6"
18767
18781
  });
18768
18782
  if (!licenseKey && !valid2 && isInsidePlayground) {
18769
18783
  return true;
@@ -18998,6 +19012,9 @@ function handleRowNavigation(options, event) {
18998
19012
  if (rowInfo && rowInfo.isGroupRow) {
18999
19013
  return api.collapseGroupRow(rowInfo.groupKeys);
19000
19014
  }
19015
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19016
+ return api.rowDetailApi.collapseRowDetail(rowInfo.id);
19017
+ }
19001
19018
  return false;
19002
19019
  },
19003
19020
  ArrowRight: () => {
@@ -19005,6 +19022,9 @@ function handleRowNavigation(options, event) {
19005
19022
  if (rowInfo && rowInfo.isGroupRow) {
19006
19023
  return api.expandGroupRow(rowInfo.groupKeys);
19007
19024
  }
19025
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19026
+ return api.rowDetailApi.expandRowDetail(rowInfo.id);
19027
+ }
19008
19028
  return false;
19009
19029
  },
19010
19030
  Enter: () => {
@@ -19012,6 +19032,12 @@ function handleRowNavigation(options, event) {
19012
19032
  if (rowInfo && rowInfo.isGroupRow) {
19013
19033
  return api.toggleGroupRow(rowInfo.groupKeys);
19014
19034
  }
19035
+ const hasRowDetail = api.rowDetailApi.isRowDetailEnabledForRow(
19036
+ rowInfo.id
19037
+ );
19038
+ if (hasRowDetail) {
19039
+ return api.rowDetailApi.toggleRowDetail(rowInfo.id);
19040
+ }
19015
19041
  return false;
19016
19042
  },
19017
19043
  PageDown: () => {
@@ -19102,6 +19128,9 @@ function handleCellNavigation(options, event) {
19102
19128
  if (rowInfo && rowInfo.isGroupRow) {
19103
19129
  return api.toggleGroupRow(rowInfo.groupKeys);
19104
19130
  }
19131
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19132
+ return api.rowDetailApi.toggleRowDetail(rowInfo.id);
19133
+ }
19105
19134
  return false;
19106
19135
  },
19107
19136
  PageDown: () => {
package/index.dev.mjs CHANGED
@@ -15363,6 +15363,20 @@ function getRowDetailApi(param) {
15363
15363
  const expanded = isRowDetailExpanded(rowInfo);
15364
15364
  return !expanded;
15365
15365
  },
15366
+ isRowDetailEnabledForRow(pk) {
15367
+ const { isRowDetailEnabled } = getState();
15368
+ if (!isRowDetailEnabled) {
15369
+ return false;
15370
+ }
15371
+ if (typeof isRowDetailEnabled === "function") {
15372
+ const rowInfo = dataSourceApi.getRowInfoByPrimaryKey(pk);
15373
+ if (!rowInfo) {
15374
+ return false;
15375
+ }
15376
+ return isRowDetailEnabled(rowInfo);
15377
+ }
15378
+ return true;
15379
+ },
15366
15380
  isRowDetailExpanded(pk) {
15367
15381
  return !rowDetailApi.isRowDetailCollapsed(pk);
15368
15382
  },
@@ -18738,7 +18752,7 @@ var useLicense = (licenseKey = "") => {
18738
18752
  const valid = useMemo14(() => {
18739
18753
  let valid2 = isValidLicense(licenseKey, {
18740
18754
  publishedAt: 1624970570587,
18741
- version: "3.2.5"
18755
+ version: "3.2.6"
18742
18756
  });
18743
18757
  if (!licenseKey && !valid2 && isInsidePlayground) {
18744
18758
  return true;
@@ -18973,6 +18987,9 @@ function handleRowNavigation(options, event) {
18973
18987
  if (rowInfo && rowInfo.isGroupRow) {
18974
18988
  return api.collapseGroupRow(rowInfo.groupKeys);
18975
18989
  }
18990
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
18991
+ return api.rowDetailApi.collapseRowDetail(rowInfo.id);
18992
+ }
18976
18993
  return false;
18977
18994
  },
18978
18995
  ArrowRight: () => {
@@ -18980,6 +18997,9 @@ function handleRowNavigation(options, event) {
18980
18997
  if (rowInfo && rowInfo.isGroupRow) {
18981
18998
  return api.expandGroupRow(rowInfo.groupKeys);
18982
18999
  }
19000
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19001
+ return api.rowDetailApi.expandRowDetail(rowInfo.id);
19002
+ }
18983
19003
  return false;
18984
19004
  },
18985
19005
  Enter: () => {
@@ -18987,6 +19007,12 @@ function handleRowNavigation(options, event) {
18987
19007
  if (rowInfo && rowInfo.isGroupRow) {
18988
19008
  return api.toggleGroupRow(rowInfo.groupKeys);
18989
19009
  }
19010
+ const hasRowDetail = api.rowDetailApi.isRowDetailEnabledForRow(
19011
+ rowInfo.id
19012
+ );
19013
+ if (hasRowDetail) {
19014
+ return api.rowDetailApi.toggleRowDetail(rowInfo.id);
19015
+ }
18990
19016
  return false;
18991
19017
  },
18992
19018
  PageDown: () => {
@@ -19077,6 +19103,9 @@ function handleCellNavigation(options, event) {
19077
19103
  if (rowInfo && rowInfo.isGroupRow) {
19078
19104
  return api.toggleGroupRow(rowInfo.groupKeys);
19079
19105
  }
19106
+ if (rowInfo && api.rowDetailApi.isRowDetailEnabledForRow(rowInfo.id)) {
19107
+ return api.rowDetailApi.toggleRowDetail(rowInfo.id);
19108
+ }
19080
19109
  return false;
19081
19110
  },
19082
19111
  PageDown: () => {