@infinite-table/infinite-react 1.3.19 → 1.3.20

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.dev.js CHANGED
@@ -13459,7 +13459,8 @@ function realignColumnContextMenu(param) {
13459
13459
  }
13460
13460
  function tryCol(diff2, sign2) {
13461
13461
  const colId2 = order2[index + diff2 * sign2];
13462
- if (visibleCols.has(colId2)) {
13462
+ const col = visibleCols.get(colId2);
13463
+ if (col && col.renderMenuIcon !== false) {
13463
13464
  return colId2;
13464
13465
  }
13465
13466
  return;
@@ -16669,7 +16670,7 @@ var useLicense = (licenseKey = "") => {
16669
16670
  const valid = (0, import_react49.useMemo)(() => {
16670
16671
  let valid2 = isValidLicense(licenseKey, {
16671
16672
  publishedAt: 1624970570587,
16672
- version: "1.3.19"
16673
+ version: "1.3.20"
16673
16674
  });
16674
16675
  if (!licenseKey && !valid2 && isInsidePlayground) {
16675
16676
  return true;
@@ -19235,29 +19236,31 @@ function showMenuForColumn(options) {
19235
19236
  var _a;
19236
19237
  const { columnId, context, clearAll, showOverlay } = options;
19237
19238
  const { getState, actions } = context;
19239
+ const { columnMenuTargetRef, domRef } = getState();
19238
19240
  function onHideIntent() {
19239
19241
  clearAll();
19240
19242
  actions.columnMenuVisibleForColumnId = null;
19241
19243
  }
19242
19244
  let target = options.target;
19245
+ if (!target) {
19246
+ target = (_a = columnMenuTargetRef.current) != null ? _a : void 0;
19247
+ if (target && !domRef.current.contains(target)) {
19248
+ target = void 0;
19249
+ }
19250
+ }
19243
19251
  if (!target) {
19244
19252
  const iconSelector = `[${InfiniteHeaderCellDataAttributes["data-column-id"]}="${columnId}"] ${menuIconSelector}`;
19245
19253
  target = getState().domRef.current.querySelector(
19246
19254
  iconSelector
19247
19255
  );
19248
- if (!target) {
19249
- target = (_a = getState().columnMenuTargetRef.current) != null ? _a : void 0;
19250
- if (!(target == null ? void 0 : target.parentElement)) {
19251
- target = void 0;
19252
- }
19253
- }
19254
19256
  }
19255
19257
  if (!target) {
19256
19258
  console.warn(`Cannot show column menu for column "${columnId}"`);
19257
19259
  return;
19258
19260
  }
19261
+ columnMenuTargetRef.current = null;
19259
19262
  showOverlay(() => getMenuForColumn(columnId, context, onHideIntent), {
19260
- constrainTo: getState().domRef.current,
19263
+ constrainTo: domRef.current,
19261
19264
  id: "column-menu",
19262
19265
  alignTo: target,
19263
19266
  alignPosition: [
package/index.dev.mjs CHANGED
@@ -13445,7 +13445,8 @@ function realignColumnContextMenu(param) {
13445
13445
  }
13446
13446
  function tryCol(diff2, sign2) {
13447
13447
  const colId2 = order2[index + diff2 * sign2];
13448
- if (visibleCols.has(colId2)) {
13448
+ const col = visibleCols.get(colId2);
13449
+ if (col && col.renderMenuIcon !== false) {
13449
13450
  return colId2;
13450
13451
  }
13451
13452
  return;
@@ -16659,7 +16660,7 @@ var useLicense = (licenseKey = "") => {
16659
16660
  const valid = useMemo11(() => {
16660
16661
  let valid2 = isValidLicense(licenseKey, {
16661
16662
  publishedAt: 1624970570587,
16662
- version: "1.3.19"
16663
+ version: "1.3.20"
16663
16664
  });
16664
16665
  if (!licenseKey && !valid2 && isInsidePlayground) {
16665
16666
  return true;
@@ -19235,29 +19236,31 @@ function showMenuForColumn(options) {
19235
19236
  var _a;
19236
19237
  const { columnId, context, clearAll, showOverlay } = options;
19237
19238
  const { getState, actions } = context;
19239
+ const { columnMenuTargetRef, domRef } = getState();
19238
19240
  function onHideIntent() {
19239
19241
  clearAll();
19240
19242
  actions.columnMenuVisibleForColumnId = null;
19241
19243
  }
19242
19244
  let target = options.target;
19245
+ if (!target) {
19246
+ target = (_a = columnMenuTargetRef.current) != null ? _a : void 0;
19247
+ if (target && !domRef.current.contains(target)) {
19248
+ target = void 0;
19249
+ }
19250
+ }
19243
19251
  if (!target) {
19244
19252
  const iconSelector = `[${InfiniteHeaderCellDataAttributes["data-column-id"]}="${columnId}"] ${menuIconSelector}`;
19245
19253
  target = getState().domRef.current.querySelector(
19246
19254
  iconSelector
19247
19255
  );
19248
- if (!target) {
19249
- target = (_a = getState().columnMenuTargetRef.current) != null ? _a : void 0;
19250
- if (!(target == null ? void 0 : target.parentElement)) {
19251
- target = void 0;
19252
- }
19253
- }
19254
19256
  }
19255
19257
  if (!target) {
19256
19258
  console.warn(`Cannot show column menu for column "${columnId}"`);
19257
19259
  return;
19258
19260
  }
19261
+ columnMenuTargetRef.current = null;
19259
19262
  showOverlay(() => getMenuForColumn(columnId, context, onHideIntent), {
19260
- constrainTo: getState().domRef.current,
19263
+ constrainTo: domRef.current,
19261
19264
  id: "column-menu",
19262
19265
  alignTo: target,
19263
19266
  alignPosition: [