@infinite-table/infinite-react 1.3.20 → 1.3.21

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
@@ -1222,6 +1222,7 @@ interface InfiniteTableMappedState<T> {
1222
1222
  showSeparatePivotColumnForSingleAggregation: NonUndefined<InfiniteTableProps<T>['showSeparatePivotColumnForSingleAggregation']>;
1223
1223
  domProps: InfiniteTableProps<T>['domProps'];
1224
1224
  editable: InfiniteTableProps<T>['editable'];
1225
+ columnMenuRealignDelay: NonUndefined<InfiniteTableProps<T>['columnMenuRealignDelay']>;
1225
1226
  columnDefaultEditable: InfiniteTableProps<T>['columnDefaultEditable'];
1226
1227
  columnDefaultFilterable: InfiniteTableProps<T>['columnDefaultFilterable'];
1227
1228
  rowStyle: InfiniteTableProps<T>['rowStyle'];
@@ -2655,6 +2656,14 @@ interface InfiniteTableProps<T> {
2655
2656
  onSelfBlur?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
2656
2657
  onFocusWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
2657
2658
  onBlurWithin?: (event: React$1.FocusEvent<HTMLDivElement>) => void;
2659
+ /**
2660
+ * When a column is hidden by using the column menu, the column menu will stay open,
2661
+ * so it needs (generally) to be realigned to the correct location. This prop
2662
+ * configures the delay in milliseconds before the column menu is realigned.
2663
+ *
2664
+ * @default 50
2665
+ */
2666
+ columnMenuRealignDelay?: number;
2658
2667
  onScrollToTop?: () => void;
2659
2668
  onScrollToBottom?: () => void;
2660
2669
  scrollStopDelay?: number;
package/index.dev.js CHANGED
@@ -13793,12 +13793,21 @@ var InfiniteTableApiImpl = class {
13793
13793
  this.actions.contextMenuVisibleFor = null;
13794
13794
  this.actions.cellContextMenuVisibleFor = null;
13795
13795
  }
13796
- realignColumnContextMenu() {
13797
- realignColumnContextMenu({
13796
+ realignColumnContextMenu(callback) {
13797
+ const param = {
13798
13798
  actions: this.actions,
13799
13799
  getState: this.getState,
13800
13800
  getComputed: this.getComputed
13801
- });
13801
+ };
13802
+ const delay = this.getState().columnMenuRealignDelay;
13803
+ if (!delay || delay < 0) {
13804
+ realignColumnContextMenu(param);
13805
+ callback == null ? void 0 : callback();
13806
+ }
13807
+ setTimeout(() => {
13808
+ realignColumnContextMenu(param);
13809
+ callback == null ? void 0 : callback();
13810
+ }, delay);
13802
13811
  }
13803
13812
  getColumnOrder() {
13804
13813
  return this.getComputed().computedColumnOrder;
@@ -14968,6 +14977,7 @@ var forwardProps4 = (setupState) => {
14968
14977
  onScrollbarsChange: 1,
14969
14978
  autoSizeColumnsKey: 1,
14970
14979
  columnDefaultFlex: 1,
14980
+ columnMenuRealignDelay: (columnMenuRealignDelay) => columnMenuRealignDelay != null ? columnMenuRealignDelay : 50,
14971
14981
  scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
14972
14982
  viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
14973
14983
  resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
@@ -16670,7 +16680,7 @@ var useLicense = (licenseKey = "") => {
16670
16680
  const valid = (0, import_react49.useMemo)(() => {
16671
16681
  let valid2 = isValidLicense(licenseKey, {
16672
16682
  publishedAt: 1624970570587,
16673
- version: "1.3.20"
16683
+ version: "1.3.21"
16674
16684
  });
16675
16685
  if (!licenseKey && !valid2 && isInsidePlayground) {
16676
16686
  return true;
package/index.dev.mjs CHANGED
@@ -13779,12 +13779,21 @@ var InfiniteTableApiImpl = class {
13779
13779
  this.actions.contextMenuVisibleFor = null;
13780
13780
  this.actions.cellContextMenuVisibleFor = null;
13781
13781
  }
13782
- realignColumnContextMenu() {
13783
- realignColumnContextMenu({
13782
+ realignColumnContextMenu(callback) {
13783
+ const param = {
13784
13784
  actions: this.actions,
13785
13785
  getState: this.getState,
13786
13786
  getComputed: this.getComputed
13787
- });
13787
+ };
13788
+ const delay = this.getState().columnMenuRealignDelay;
13789
+ if (!delay || delay < 0) {
13790
+ realignColumnContextMenu(param);
13791
+ callback == null ? void 0 : callback();
13792
+ }
13793
+ setTimeout(() => {
13794
+ realignColumnContextMenu(param);
13795
+ callback == null ? void 0 : callback();
13796
+ }, delay);
13788
13797
  }
13789
13798
  getColumnOrder() {
13790
13799
  return this.getComputed().computedColumnOrder;
@@ -14958,6 +14967,7 @@ var forwardProps4 = (setupState) => {
14958
14967
  onScrollbarsChange: 1,
14959
14968
  autoSizeColumnsKey: 1,
14960
14969
  columnDefaultFlex: 1,
14970
+ columnMenuRealignDelay: (columnMenuRealignDelay) => columnMenuRealignDelay != null ? columnMenuRealignDelay : 50,
14961
14971
  scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
14962
14972
  viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
14963
14973
  resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
@@ -16660,7 +16670,7 @@ var useLicense = (licenseKey = "") => {
16660
16670
  const valid = useMemo11(() => {
16661
16671
  let valid2 = isValidLicense(licenseKey, {
16662
16672
  publishedAt: 1624970570587,
16663
- version: "1.3.20"
16673
+ version: "1.3.21"
16664
16674
  });
16665
16675
  if (!licenseKey && !valid2 && isInsidePlayground) {
16666
16676
  return true;