@infinite-table/infinite-react 3.2.4 → 3.2.5

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.mjs CHANGED
@@ -123,7 +123,7 @@ function debounce(fn, { wait }) {
123
123
  }
124
124
 
125
125
  // src/components/InfiniteTable/index.tsx
126
- import * as React66 from "react";
126
+ import * as React67 from "react";
127
127
 
128
128
  // src/utils/join.ts
129
129
  var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
@@ -4813,6 +4813,7 @@ var position = { relative: "utilities_position_relative__16lm1iw1", absolute: "u
4813
4813
  var top = { "0": "utilities_top_0__16lm1iw1c", "100%": "utilities_top_100%__16lm1iw1d" };
4814
4814
  var transformTranslateZero = "utilities_transformTranslateZero__16lm1iwe";
4815
4815
  var userSelect = { none: "utilities_userSelect_none__16lm1iw17" };
4816
+ var visibility = { visible: "utilities_visibility_visible__16lm1iw20", hidden: "utilities_visibility_hidden__16lm1iw21" };
4816
4817
  var zIndex = { "1": "utilities_zIndex_1__16lm1iwo", "10": "utilities_zIndex_10__16lm1iwp", "100": "utilities_zIndex_100__16lm1iwq", "1000": "utilities_zIndex_1000__16lm1iwr", "10000": "utilities_zIndex_10000__16lm1iws", "100000": "utilities_zIndex_100000__16lm1iwt", "1000000": "utilities_zIndex_1000000__16lm1iwu", "10000000": "utilities_zIndex_10000000__16lm1iwv", "1k": "utilities_zIndex_1k__16lm1iww", "10k": "utilities_zIndex_10k__16lm1iwx", "100k": "utilities_zIndex_100k__16lm1iwy" };
4817
4818
 
4818
4819
  // src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
@@ -15056,12 +15057,21 @@ function DataSourceCmp({
15056
15057
  }
15057
15058
  function DataSource(props) {
15058
15059
  const masterContext = useMasterDetailContext();
15059
- return /* @__PURE__ */ React51.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React51.createElement(DataSourceCmp, { children: props.children, isDetail: !!masterContext }));
15060
+ const isDetail = !!masterContext;
15061
+ const key = isDetail ? masterContext.masterRowInfo.id : "master";
15062
+ return /* @__PURE__ */ React51.createElement(DataSourceRoot, __spreadProps(__spreadValues({}, props), { key }), /* @__PURE__ */ React51.createElement(DataSourceCmp, { children: props.children, isDetail }));
15060
15063
  }
15061
15064
  function useRowInfoReducers() {
15062
15065
  const { rowInfoReducerResults } = useDataSource();
15063
15066
  return rowInfoReducerResults;
15064
15067
  }
15068
+ function useMasterRowInfo() {
15069
+ const context = useMasterDetailContext();
15070
+ if (!context) {
15071
+ return void 0;
15072
+ }
15073
+ return context.masterRowInfo;
15074
+ }
15065
15075
 
15066
15076
  // src/components/InfiniteTable/api/realignColumnContextMenu.ts
15067
15077
  function realignColumnContextMenu(param) {
@@ -16503,6 +16513,7 @@ function useRegisterDetail(props) {
16503
16513
  getState: getMasterDataSourceState,
16504
16514
  componentActions: masterActions
16505
16515
  } = useDataSourceContextValue();
16516
+ const { getState: getMasterState } = useInfiniteTable();
16506
16517
  const { currentRowCache, cacheCalledByRowDetailRenderer } = useCurrentRowCache(rowInfo.id, rowDetailsCache);
16507
16518
  const masterDetailContextValue = useMemo8(() => {
16508
16519
  const shouldRestoreState = getMasterDataSourceState().detailDataSourcesStateToRestore.has(
@@ -16552,6 +16563,8 @@ function useRegisterDetail(props) {
16552
16563
  };
16553
16564
  }, [rowInfo.id, currentRowCache]);
16554
16565
  masterDetailContextValue.masterRowInfo = rowInfo;
16566
+ masterDetailContextValue.getMasterDataSourceState = getMasterDataSourceState;
16567
+ masterDetailContextValue.getMasterState = getMasterState;
16555
16568
  return { masterDetailContextValue, currentRowCache };
16556
16569
  }
16557
16570
 
@@ -16778,7 +16791,7 @@ function useCellRendering(param) {
16778
16791
  const dataArray2 = getData();
16779
16792
  const rowInfo = dataArray2[rowIndex];
16780
16793
  if (!rowInfo || !isRowDetailsExpanded(rowInfo) || !computedRowSizeCacheForDetails) {
16781
- return null;
16794
+ return /* @__PURE__ */ React53.createElement("div", { ref: domRef, className: visibility.hidden });
16782
16795
  }
16783
16796
  const { rowDetailHeight: rowDetailHeight2, rowHeight: rowHeight2 } = computedRowSizeCacheForDetails.getSize(rowIndex);
16784
16797
  return /* @__PURE__ */ React53.createElement(
@@ -17231,6 +17244,14 @@ function toMap(mapOrObject, weakMapCache) {
17231
17244
  return result;
17232
17245
  }
17233
17246
 
17247
+ // src/components/InfiniteTable/state/rowDetailRendererFromComponent.tsx
17248
+ import * as React54 from "react";
17249
+ function getRowDetailRendererFromComponent(RowDetail) {
17250
+ return (rowInfo, cache) => {
17251
+ return /* @__PURE__ */ React54.createElement(RowDetail, { key: rowInfo.id, rowInfo, cache });
17252
+ };
17253
+ }
17254
+
17234
17255
  // src/components/InfiniteTable/state/getInitialState.ts
17235
17256
  function createRenderer2(brain) {
17236
17257
  const renderer = new ReactHeadlessTableRenderer(brain);
@@ -17362,7 +17383,6 @@ var forwardProps4 = (setupState) => {
17362
17383
  columnDefaultEditable: 1,
17363
17384
  columnDefaultFilterable: 1,
17364
17385
  columnDefaultSortable: 1,
17365
- rowDetailRenderer: 1,
17366
17386
  rowStyle: 1,
17367
17387
  cellStyle: 1,
17368
17388
  rowProps: 1,
@@ -17477,7 +17497,7 @@ function getGroupByMap(groupBy) {
17477
17497
  }
17478
17498
  var weakMap = /* @__PURE__ */ new WeakMap();
17479
17499
  var mapPropsToState = (params) => {
17480
- var _a, _b, _c, _d;
17500
+ var _a, _b, _c, _d, _e;
17481
17501
  const { props, state, oldState, parentState } = params;
17482
17502
  const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
17483
17503
  const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(computedColumnGroups) : state.columnGroupsDepthsMap;
@@ -17488,7 +17508,17 @@ var mapPropsToState = (params) => {
17488
17508
  groupColumn: props.groupColumn
17489
17509
  });
17490
17510
  let rowDetailState = void 0;
17491
- if (props.rowDetailRenderer) {
17511
+ let rowDetailRenderer = props.rowDetailRenderer;
17512
+ const RowDetailComponent = (_a = props.components) == null ? void 0 : _a.RowDetail;
17513
+ if (!rowDetailRenderer && RowDetailComponent) {
17514
+ let rowDetailRendererFromComponent = weakMap.get(RowDetailComponent);
17515
+ if (!rowDetailRendererFromComponent) {
17516
+ rowDetailRendererFromComponent = getRowDetailRendererFromComponent(RowDetailComponent);
17517
+ weakMap.set(RowDetailComponent, rowDetailRendererFromComponent);
17518
+ }
17519
+ rowDetailRenderer = rowDetailRendererFromComponent;
17520
+ }
17521
+ if (rowDetailRenderer) {
17492
17522
  rowDetailState = props.rowDetailState || state.rowDetailState || props.defaultRowDetailState;
17493
17523
  if (rowDetailState && !(rowDetailState instanceof RowDetailState)) {
17494
17524
  rowDetailState = new RowDetailState(rowDetailState);
@@ -17510,19 +17540,20 @@ var mapPropsToState = (params) => {
17510
17540
  }
17511
17541
  }
17512
17542
  }
17513
- const isRowDetailEnabled = !props.rowDetailRenderer ? false : props.isRowDetailEnabled || true;
17543
+ const isRowDetailEnabled = !rowDetailRenderer ? false : props.isRowDetailEnabled || true;
17514
17544
  return {
17545
+ rowDetailRenderer,
17515
17546
  rowDetailState,
17516
17547
  isRowDetailExpanded,
17517
17548
  isRowDetailEnabled,
17518
- showColumnFilters: (_a = props.showColumnFilters) != null ? _a : !!parentState.filterValue,
17549
+ showColumnFilters: (_b = props.showColumnFilters) != null ? _b : !!parentState.filterValue,
17519
17550
  controlledColumnVisibility: !!props.columnVisibility,
17520
17551
  groupRenderStrategy,
17521
17552
  groupBy,
17522
17553
  computedColumns,
17523
17554
  initialColumns: props.columns,
17524
- keyboardNavigation: (_b = props.keyboardNavigation) != null ? _b : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
17525
- columnHeaderCssEllipsis: (_d = (_c = props.columnHeaderCssEllipsis) != null ? _c : props.columnCssEllipsis) != null ? _d : true,
17555
+ keyboardNavigation: (_c = props.keyboardNavigation) != null ? _c : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
17556
+ columnHeaderCssEllipsis: (_e = (_d = props.columnHeaderCssEllipsis) != null ? _d : props.columnCssEllipsis) != null ? _e : true,
17526
17557
  columnGroupsDepthsMap,
17527
17558
  columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
17528
17559
  computedColumnGroups,
@@ -18707,7 +18738,7 @@ var useLicense = (licenseKey = "") => {
18707
18738
  const valid = useMemo14(() => {
18708
18739
  let valid2 = isValidLicense(licenseKey, {
18709
18740
  publishedAt: 1624970570587,
18710
- version: "3.2.4"
18741
+ version: "3.2.5"
18711
18742
  });
18712
18743
  if (!licenseKey && !valid2 && isInsidePlayground) {
18713
18744
  return true;
@@ -19606,7 +19637,7 @@ function useDOMEventHandlers() {
19606
19637
  import { useEffect as useEffect35 } from "react";
19607
19638
 
19608
19639
  // src/components/hooks/useOverlay/index.tsx
19609
- import * as React54 from "react";
19640
+ import * as React55 from "react";
19610
19641
  import {
19611
19642
  useCallback as useCallback23,
19612
19643
  useEffect as useEffect33,
@@ -19997,10 +20028,10 @@ function retrieveElement(elementGetter) {
19997
20028
  });
19998
20029
  }
19999
20030
  function DefaultOverlayPortal(props) {
20000
- return /* @__PURE__ */ React54.createElement("div", { style: { position: "fixed", top: 0, left: 0 } }, props.children);
20031
+ return /* @__PURE__ */ React55.createElement("div", { style: { position: "fixed", top: 0, left: 0 } }, props.children);
20001
20032
  }
20002
20033
  function OverlayContent(props) {
20003
- const nodeRef = React54.useRef(null);
20034
+ const nodeRef = React55.useRef(null);
20004
20035
  useEffect33(() => {
20005
20036
  return props.realign.onChange((handle) => {
20006
20037
  if (nodeRef.current && handle) {
@@ -20008,7 +20039,7 @@ function OverlayContent(props) {
20008
20039
  }
20009
20040
  });
20010
20041
  }, [props.realign]);
20011
- return /* @__PURE__ */ React54.createElement(
20042
+ return /* @__PURE__ */ React55.createElement(
20012
20043
  "div",
20013
20044
  {
20014
20045
  style: { position: "absolute", top: 0, left: 0 },
@@ -20079,22 +20110,22 @@ function useOverlayPortal(content, portalContainer) {
20079
20110
  }, [portalContainer]);
20080
20111
  return portalContainer ? container ? createPortal2(content, container) : (
20081
20112
  // we're probably still fetching the container
20082
- /* @__PURE__ */ React54.createElement(React54.Fragment, null)
20083
- ) : portalContainer === null || portalContainer === false ? content : /* @__PURE__ */ React54.createElement(DefaultOverlayPortal, null, content);
20113
+ /* @__PURE__ */ React55.createElement(React55.Fragment, null)
20114
+ ) : portalContainer === null || portalContainer === false ? content : /* @__PURE__ */ React55.createElement(DefaultOverlayPortal, null, content);
20084
20115
  }
20085
20116
  function getIdForReactOnlyChild(children) {
20086
- if (React54.Children.count(children) === 1) {
20087
- const child = React54.Children.only(children);
20088
- if (React54.isValidElement(child)) {
20117
+ if (React55.Children.count(children) === 1) {
20118
+ const child = React55.Children.only(children);
20119
+ if (React55.isValidElement(child)) {
20089
20120
  return child.props.id || child.key;
20090
20121
  }
20091
20122
  }
20092
20123
  return null;
20093
20124
  }
20094
20125
  function injectPortalContainerAndConstrainInMenuChild(children, portalContainer, constrainTo) {
20095
- if (React54.Children.count(children) === 1) {
20096
- const child = React54.Children.only(children);
20097
- if (React54.isValidElement(child) && child.props[propToIdentifyMenu]) {
20126
+ if (React55.Children.count(children) === 1) {
20127
+ const child = React55.Children.only(children);
20128
+ if (React55.isValidElement(child) && child.props[propToIdentifyMenu]) {
20098
20129
  const newProps = {};
20099
20130
  if (child.props.portalContainer === void 0) {
20100
20131
  newProps.portalContainer = portalContainer;
@@ -20102,7 +20133,7 @@ function injectPortalContainerAndConstrainInMenuChild(children, portalContainer,
20102
20133
  if (child.props.constrainTo === void 0) {
20103
20134
  newProps.constrainTo = constrainTo;
20104
20135
  }
20105
- return React54.cloneElement(child, newProps);
20136
+ return React55.cloneElement(child, newProps);
20106
20137
  }
20107
20138
  }
20108
20139
  return children;
@@ -20118,7 +20149,7 @@ function useOverlay(params) {
20118
20149
  const contentForPortal = [];
20119
20150
  for (const [_2, handle] of handles) {
20120
20151
  contentForPortal.push(
20121
- /* @__PURE__ */ React54.createElement(OverlayContent, __spreadProps(__spreadValues({}, handle), { key: handle.key }))
20152
+ /* @__PURE__ */ React55.createElement(OverlayContent, __spreadProps(__spreadValues({}, handle), { key: handle.key }))
20122
20153
  );
20123
20154
  }
20124
20155
  return contentForPortal;
@@ -20163,7 +20194,7 @@ function useOverlay(params) {
20163
20194
  },
20164
20195
  [handles, rootParams.portalContainer, updateContent]
20165
20196
  );
20166
- React54.useEffect(() => {
20197
+ React55.useEffect(() => {
20167
20198
  if (handleToRealign) {
20168
20199
  const handle = handles.get(handleToRealign);
20169
20200
  if (handle) {
@@ -20182,7 +20213,7 @@ function useOverlay(params) {
20182
20213
  handles.clear();
20183
20214
  updateContent();
20184
20215
  };
20185
- React54.useEffect(() => {
20216
+ React55.useEffect(() => {
20186
20217
  }, []);
20187
20218
  return {
20188
20219
  portal,
@@ -20194,16 +20225,16 @@ function useOverlay(params) {
20194
20225
  }
20195
20226
 
20196
20227
  // src/components/InfiniteTable/utils/getMenuForColumn.tsx
20197
- import * as React60 from "react";
20228
+ import * as React61 from "react";
20198
20229
 
20199
20230
  // src/components/Menu/index.tsx
20200
- import * as React58 from "react";
20231
+ import * as React59 from "react";
20201
20232
 
20202
20233
  // src/components/Menu/getMenuState.tsx
20203
- import * as React56 from "react";
20234
+ import * as React57 from "react";
20204
20235
 
20205
20236
  // src/components/Menu/childrenToRuntimeItems.tsx
20206
- import * as React55 from "react";
20237
+ import * as React56 from "react";
20207
20238
 
20208
20239
  // src/components/Menu/MenuCls.css.ts
20209
20240
  var MenuCls = "MenuCls_MenuCls__db3arf0 utilities_boxSizingBorderBox__16lm1iw0 utilities_position_relative__16lm1iw1 utilities_display_inlineGrid__16lm1iw16 utilities_flexFlow_column__16lm1iw1m utilities_margin_none__16lm1iw8";
@@ -20214,7 +20245,7 @@ var MenuSeparatorCls = "MenuCls_MenuSeparatorCls__db3arfd";
20214
20245
  // src/components/Menu/childrenToRuntimeItems.tsx
20215
20246
  var SEPARATOR = "-";
20216
20247
  function MenuSeparator() {
20217
- return /* @__PURE__ */ React55.createElement("hr", { className: MenuSeparatorCls });
20248
+ return /* @__PURE__ */ React56.createElement("hr", { className: MenuSeparatorCls });
20218
20249
  }
20219
20250
  var toRuntimeItem = ({
20220
20251
  columns,
@@ -20223,7 +20254,7 @@ var toRuntimeItem = ({
20223
20254
  menuId
20224
20255
  }, item) => {
20225
20256
  const menuItem = item && (item.key != null || item.label != null) ? item : null;
20226
- const menuDecoration = menuItem === null ? item === SEPARATOR ? /* @__PURE__ */ React55.createElement(MenuSeparator, null) : item : null;
20257
+ const menuDecoration = menuItem === null ? item === SEPARATOR ? /* @__PURE__ */ React56.createElement(MenuSeparator, null) : item : null;
20227
20258
  const runtimeItem = menuItem != null ? {
20228
20259
  type: "item",
20229
20260
  parentMenuId: menuId,
@@ -20251,7 +20282,7 @@ var toRuntimeItem = ({
20251
20282
  return runtimeItem;
20252
20283
  };
20253
20284
  function childrenToRuntimeItems(context, children) {
20254
- return React55.Children.map(children, (child) => {
20285
+ return React56.Children.map(children, (child) => {
20255
20286
  if (child == null ? void 0 : child.props.__is_menu_item) {
20256
20287
  const itemProps = __spreadValues({}, child.props);
20257
20288
  if (!itemProps.key) {
@@ -20272,7 +20303,7 @@ function childrenToRuntimeItems(context, children) {
20272
20303
  // src/components/Menu/getMenuState.tsx
20273
20304
  var SUBMENU_COL_NAME = "submenu";
20274
20305
  function getInitialMenuState() {
20275
- const domRef = React56.createRef();
20306
+ const domRef = React57.createRef();
20276
20307
  return {
20277
20308
  keyboardActiveItemKey: null,
20278
20309
  activeItemKey: null,
@@ -20327,7 +20358,7 @@ var deriveStateFromProps2 = (params) => {
20327
20358
  columns.push({
20328
20359
  name: SUBMENU_COL_NAME,
20329
20360
  render: ({ domProps, item }) => {
20330
- return item.menu ? /* @__PURE__ */ React56.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React56.createElement(ExpanderIcon, { expanded: false })) : /* @__PURE__ */ React56.createElement("div", __spreadValues({}, domProps));
20361
+ return item.menu ? /* @__PURE__ */ React57.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React57.createElement(ExpanderIcon, { expanded: false })) : /* @__PURE__ */ React57.createElement("div", __spreadValues({}, domProps));
20331
20362
  }
20332
20363
  });
20333
20364
  }
@@ -20344,7 +20375,7 @@ var deriveStateFromProps2 = (params) => {
20344
20375
  };
20345
20376
 
20346
20377
  // src/components/Menu/Menu.tsx
20347
- import * as React57 from "react";
20378
+ import * as React58 from "react";
20348
20379
  import {
20349
20380
  useCallback as useCallback25,
20350
20381
  useLayoutEffect as useLayoutEffect14,
@@ -20609,7 +20640,7 @@ function renderSubmenuForItem(item, config) {
20609
20640
  if (typeof itemMenu === "function") {
20610
20641
  itemMenu = itemMenu();
20611
20642
  }
20612
- return /* @__PURE__ */ React57.createElement(
20643
+ return /* @__PURE__ */ React58.createElement(
20613
20644
  Menu,
20614
20645
  __spreadProps(__spreadValues({
20615
20646
  key: overlayId,
@@ -20822,7 +20853,7 @@ function MenuComponent(props) {
20822
20853
  setActiveItemKey(key);
20823
20854
  }
20824
20855
  });
20825
- renderedChildren = runtimeItems.map((runtimeItem, index) => /* @__PURE__ */ React57.createElement(
20856
+ renderedChildren = runtimeItems.map((runtimeItem, index) => /* @__PURE__ */ React58.createElement(
20826
20857
  RuntimeItemRenderer,
20827
20858
  {
20828
20859
  key: runtimeItem.type === "item" ? runtimeItem.key : index,
@@ -21007,7 +21038,7 @@ function MenuComponent(props) {
21007
21038
  domRef.current = node;
21008
21039
  }
21009
21040
  }, []);
21010
- const result = /* @__PURE__ */ React57.createElement("div", { className: display.contents }, /* @__PURE__ */ React57.createElement(
21041
+ const result = /* @__PURE__ */ React58.createElement("div", { className: display.contents }, /* @__PURE__ */ React58.createElement(
21011
21042
  "div",
21012
21043
  __spreadProps(__spreadValues({}, domProps), {
21013
21044
  "data-menu-id": menuId,
@@ -21039,12 +21070,12 @@ function MenuComponent(props) {
21039
21070
  return destroyed ? null : result;
21040
21071
  }
21041
21072
  function RuntimeItemRenderer(props) {
21042
- const [pressed, setPressed] = React57.useState(false);
21073
+ const [pressed, setPressed] = React58.useState(false);
21043
21074
  const { columns, item, index, active, keyboardActive } = props;
21044
21075
  const key = item.type === "item" ? item.value.key : index;
21045
21076
  let content = null;
21046
21077
  if (item.type === "decoration") {
21047
- content = /* @__PURE__ */ React57.createElement("div", { style: item.style }, item.value);
21078
+ content = /* @__PURE__ */ React58.createElement("div", { style: item.style }, item.value);
21048
21079
  } else {
21049
21080
  let spanIndex = 0;
21050
21081
  content = columns.map((col, i) => {
@@ -21105,7 +21136,7 @@ function RuntimeItemRenderer(props) {
21105
21136
  }
21106
21137
  }
21107
21138
  };
21108
- return col.render ? /* @__PURE__ */ React57.createElement(
21139
+ return col.render ? /* @__PURE__ */ React58.createElement(
21109
21140
  RenderHookComponent,
21110
21141
  {
21111
21142
  key: `${key}-${field}`,
@@ -21117,10 +21148,10 @@ function RuntimeItemRenderer(props) {
21117
21148
  domProps
21118
21149
  }
21119
21150
  }
21120
- ) : /* @__PURE__ */ React57.createElement("div", __spreadValues({ key: `${key}-${field}` }, domProps), target[field]);
21151
+ ) : /* @__PURE__ */ React58.createElement("div", __spreadValues({ key: `${key}-${field}` }, domProps), target[field]);
21121
21152
  }).filter(Boolean);
21122
21153
  }
21123
- return /* @__PURE__ */ React57.createElement("div", { className: MenuRowCls }, content);
21154
+ return /* @__PURE__ */ React58.createElement("div", { className: MenuRowCls }, content);
21124
21155
  }
21125
21156
  function MenuItem(_props) {
21126
21157
  return null;
@@ -21140,12 +21171,12 @@ var MenuRoot = getComponentStateRoot({
21140
21171
  function MenuContextProvider(props) {
21141
21172
  const { componentActions, componentState } = useComponentState();
21142
21173
  const getState = useLatest(componentState);
21143
- return /* @__PURE__ */ React58.createElement(
21174
+ return /* @__PURE__ */ React59.createElement(
21144
21175
  MenuContext.Provider,
21145
21176
  {
21146
21177
  value: { componentActions, componentState, getState }
21147
21178
  },
21148
- /* @__PURE__ */ React58.createElement(MenuComponent, { domProps: props.domProps })
21179
+ /* @__PURE__ */ React59.createElement(MenuComponent, { domProps: props.domProps })
21149
21180
  );
21150
21181
  }
21151
21182
  function Menu(props) {
@@ -21187,9 +21218,9 @@ function Menu(props) {
21187
21218
  //@ts-ignore
21188
21219
  "__is_infinite_menu_component"
21189
21220
  ]);
21190
- const menu = /* @__PURE__ */ React58.createElement(MenuRoot, __spreadValues({}, props), /* @__PURE__ */ React58.createElement(MenuContextProvider, { domProps }));
21221
+ const menu = /* @__PURE__ */ React59.createElement(MenuRoot, __spreadValues({}, props), /* @__PURE__ */ React59.createElement(MenuContextProvider, { domProps }));
21191
21222
  if (false) {
21192
- return /* @__PURE__ */ React58.createElement(React58.StrictMode, null, menu);
21223
+ return /* @__PURE__ */ React59.createElement(React59.StrictMode, null, menu);
21193
21224
  }
21194
21225
  return menu;
21195
21226
  }
@@ -21206,7 +21237,7 @@ var menuDefaultProps = {
21206
21237
  Menu.defaultProps = menuDefaultProps;
21207
21238
 
21208
21239
  // src/components/InfiniteTable/utils/defaultGetColumnMenuItems.tsx
21209
- import * as React59 from "react";
21240
+ import * as React60 from "react";
21210
21241
  function defaultGetColumnMenuItems(_items, params) {
21211
21242
  const { columnApi, column, getComputed, api } = params;
21212
21243
  const sortable = columnApi.isSortable();
@@ -21293,7 +21324,7 @@ function defaultGetColumnMenuItems(_items, params) {
21293
21324
  colItems.push({
21294
21325
  key: id,
21295
21326
  label,
21296
- check: /* @__PURE__ */ React59.createElement(
21327
+ check: /* @__PURE__ */ React60.createElement(
21297
21328
  InfiniteCheckBox,
21298
21329
  {
21299
21330
  key: col.id,
@@ -21356,7 +21387,7 @@ function getMenuForColumn(columnId, context, onHideIntent) {
21356
21387
  if (!items || !items.length) {
21357
21388
  return null;
21358
21389
  }
21359
- return /* @__PURE__ */ React60.createElement(
21390
+ return /* @__PURE__ */ React61.createElement(
21360
21391
  MenuCmp,
21361
21392
  {
21362
21393
  autoFocus: true,
@@ -21418,13 +21449,14 @@ function showMenuForColumn(options) {
21418
21449
  }
21419
21450
  function useColumnMenu() {
21420
21451
  const context = useInfiniteTable();
21452
+ const masterContext = useMasterDetailContext();
21421
21453
  const { getState, actions } = context;
21422
21454
  const {
21423
21455
  showOverlay,
21424
21456
  portal: menuPortal,
21425
21457
  clearAll
21426
21458
  } = useOverlay({
21427
- portalContainer: false
21459
+ portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
21428
21460
  });
21429
21461
  useEffect35(() => {
21430
21462
  const { actions: actions2, getState: getState2 } = context;
@@ -21475,7 +21507,7 @@ function useColumnMenu() {
21475
21507
  }
21476
21508
 
21477
21509
  // src/components/InfiniteTable/components/FocusDetect.tsx
21478
- import * as React61 from "react";
21510
+ import * as React62 from "react";
21479
21511
  import { useCallback as useCallback26 } from "react";
21480
21512
  var style = {
21481
21513
  width: 0,
@@ -21509,7 +21541,7 @@ function FocusDetect() {
21509
21541
  };
21510
21542
  focusLastFocusableCell(context);
21511
21543
  }), []);
21512
- return /* @__PURE__ */ React61.createElement(
21544
+ return /* @__PURE__ */ React62.createElement(
21513
21545
  "div",
21514
21546
  {
21515
21547
  onFocus,
@@ -21640,18 +21672,18 @@ function useEditingCallbackProps() {
21640
21672
  import { useEffect as useEffect37 } from "react";
21641
21673
 
21642
21674
  // src/components/InfiniteTable/utils/getFilterOperatorMenuForColumn.tsx
21643
- import * as React64 from "react";
21675
+ import * as React65 from "react";
21644
21676
 
21645
21677
  // src/components/InfiniteTable/components/icons/ClearIcon.tsx
21646
- import * as React62 from "react";
21678
+ import * as React63 from "react";
21647
21679
  var ClearIcon = (props) => {
21648
- return /* @__PURE__ */ React62.createElement(Icon, __spreadValues({}, props), /* @__PURE__ */ React62.createElement("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }));
21680
+ return /* @__PURE__ */ React63.createElement(Icon, __spreadValues({}, props), /* @__PURE__ */ React63.createElement("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }));
21649
21681
  };
21650
21682
 
21651
21683
  // src/components/InfiniteTable/components/icons/DoneIcon.tsx
21652
- import * as React63 from "react";
21684
+ import * as React64 from "react";
21653
21685
  var DoneIcon = (props) => {
21654
- return /* @__PURE__ */ React63.createElement(Icon, __spreadValues({}, props), /* @__PURE__ */ React63.createElement("path", { d: "m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z" }));
21686
+ return /* @__PURE__ */ React64.createElement(Icon, __spreadValues({}, props), /* @__PURE__ */ React64.createElement("path", { d: "m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z" }));
21655
21687
  };
21656
21688
 
21657
21689
  // src/components/InfiniteTable/utils/getFilterOperatorMenuForColumn.tsx
@@ -21697,12 +21729,12 @@ function getFilterOperatorMenuForColumn(columnId, context, onHideIntent) {
21697
21729
  const IconCmp = (_b = (_a2 = operator.components) == null ? void 0 : _a2.Icon) != null ? _b : FilterIcon;
21698
21730
  return {
21699
21731
  key,
21700
- icon: /* @__PURE__ */ React64.createElement(IconCmp, null),
21701
- label: /* @__PURE__ */ React64.createElement(React64.Fragment, null, (_c = operator.label) != null ? _c : operator.name),
21732
+ icon: /* @__PURE__ */ React65.createElement(IconCmp, null),
21733
+ label: /* @__PURE__ */ React65.createElement(React65.Fragment, null, (_c = operator.label) != null ? _c : operator.name),
21702
21734
  onAction: () => {
21703
21735
  api.setColumnFilterOperator(columnId, key);
21704
21736
  },
21705
- checked: checked ? /* @__PURE__ */ React64.createElement(DoneIcon, { size: 16 }) : null
21737
+ checked: checked ? /* @__PURE__ */ React65.createElement(DoneIcon, { size: 16 }) : null
21706
21738
  };
21707
21739
  });
21708
21740
  const firstItems = [
@@ -21717,7 +21749,7 @@ function getFilterOperatorMenuForColumn(columnId, context, onHideIntent) {
21717
21749
  {
21718
21750
  key: "reset",
21719
21751
  label: "Reset",
21720
- icon: /* @__PURE__ */ React64.createElement(ClearIcon, null),
21752
+ icon: /* @__PURE__ */ React65.createElement(ClearIcon, null),
21721
21753
  disabled: !column.computedFiltered,
21722
21754
  onAction: () => {
21723
21755
  api.clearColumnFilter(columnId);
@@ -21739,7 +21771,7 @@ function getFilterOperatorMenuForColumn(columnId, context, onHideIntent) {
21739
21771
  filterTypes
21740
21772
  };
21741
21773
  const items = getFilterOperatorMenuItems ? getFilterOperatorMenuItems(defaultItems, param) : defaultItems;
21742
- return /* @__PURE__ */ React64.createElement(
21774
+ return /* @__PURE__ */ React65.createElement(
21743
21775
  MenuCmp,
21744
21776
  {
21745
21777
  autoFocus: true,
@@ -21771,13 +21803,14 @@ function getFilterOperatorMenuForColumn(columnId, context, onHideIntent) {
21771
21803
  var OFFSET2 = 10;
21772
21804
  function useColumnFilterOperatorMenu() {
21773
21805
  const context = useInfiniteTable();
21806
+ const masterContext = useMasterDetailContext();
21774
21807
  const { getState, actions } = context;
21775
21808
  const {
21776
21809
  showOverlay,
21777
21810
  portal: menuPortal,
21778
21811
  clearAll
21779
21812
  } = useOverlay({
21780
- portalContainer: false
21813
+ portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
21781
21814
  });
21782
21815
  useEffect37(() => {
21783
21816
  const { actions: actions2, getState: getState2 } = context;
@@ -21845,7 +21878,7 @@ function useColumnFilterOperatorMenu() {
21845
21878
  import { useEffect as useEffect38 } from "react";
21846
21879
 
21847
21880
  // src/components/InfiniteTable/utils/getCellContextMenu.tsx
21848
- import * as React65 from "react";
21881
+ import * as React66 from "react";
21849
21882
  function getCellContextMenu(cellLocation, context, onHideIntent) {
21850
21883
  var _a;
21851
21884
  const { columnId, rowIndex, event } = cellLocation;
@@ -21885,7 +21918,7 @@ function getCellContextMenu(cellLocation, context, onHideIntent) {
21885
21918
  }
21886
21919
  return {
21887
21920
  preventDefault: true,
21888
- menu: /* @__PURE__ */ React65.createElement(
21921
+ menu: /* @__PURE__ */ React66.createElement(
21889
21922
  MenuCmp,
21890
21923
  {
21891
21924
  columns: menuColumns,
@@ -21940,7 +21973,7 @@ function getTableContextMenu(menuLocation, context, onHideIntent) {
21940
21973
  }
21941
21974
  return {
21942
21975
  preventDefault: true,
21943
- menu: /* @__PURE__ */ React65.createElement(
21976
+ menu: /* @__PURE__ */ React66.createElement(
21944
21977
  MenuCmp,
21945
21978
  {
21946
21979
  columns: menuColumns,
@@ -21978,13 +22011,14 @@ var ALIGN_POSITIONS = [
21978
22011
  ];
21979
22012
  function useCellContextMenu() {
21980
22013
  const context = useInfiniteTable();
22014
+ const masterContext = useMasterDetailContext();
21981
22015
  const { getState, actions } = context;
21982
22016
  const {
21983
22017
  showOverlay,
21984
22018
  portal: menuPortal,
21985
22019
  clearAll
21986
22020
  } = useOverlay({
21987
- portalContainer: false
22021
+ portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
21988
22022
  });
21989
22023
  useEffect38(() => {
21990
22024
  const { actions: actions2, getState: getState2, getDataSourceState } = context;
@@ -22063,13 +22097,14 @@ function useCellContextMenu() {
22063
22097
  }
22064
22098
  function useTableContextMenu() {
22065
22099
  const context = useInfiniteTable();
22100
+ const masterContext = useMasterDetailContext();
22066
22101
  const { getState, actions } = context;
22067
22102
  const {
22068
22103
  showOverlay,
22069
22104
  portal: menuPortal,
22070
22105
  clearAll
22071
22106
  } = useOverlay({
22072
- portalContainer: false
22107
+ portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
22073
22108
  });
22074
22109
  useEffect38(() => {
22075
22110
  const { actions: actions2, getState: getState2 } = context;
@@ -22163,10 +22198,11 @@ var InfiniteTableRoot = getComponentStateRoot({
22163
22198
  getParentState: () => useDataSource(),
22164
22199
  debugName: "InfiniteTable"
22165
22200
  });
22166
- var InfiniteTableComponent = React66.memo(
22201
+ var InfiniteTableComponent = React67.memo(
22167
22202
  function InfiniteTableComponent2() {
22168
22203
  var _a;
22169
22204
  const context = useInfiniteTable();
22205
+ const masterContext = useMasterDetailContext();
22170
22206
  const { state: componentState, getComputed, computed, api } = context;
22171
22207
  const {
22172
22208
  componentState: { loading, dataArray },
@@ -22211,7 +22247,7 @@ var InfiniteTableComponent = React66.memo(
22211
22247
  bodySize,
22212
22248
  computed
22213
22249
  });
22214
- React66.useEffect(() => {
22250
+ React67.useEffect(() => {
22215
22251
  const dataSourceState = getDataSourceState();
22216
22252
  const onChange = debounce(
22217
22253
  (renderRange) => {
@@ -22227,7 +22263,7 @@ var InfiniteTableComponent = React66.memo(
22227
22263
  const licenseValid = useLicense(licenseKey);
22228
22264
  const domProps = useDOMProps(componentState.domProps);
22229
22265
  const LoadMaskCmp = (_a = components2 == null ? void 0 : components2.LoadMask) != null ? _a : LoadMask;
22230
- React66.useEffect(() => {
22266
+ React67.useEffect(() => {
22231
22267
  brain.setScrollStopDelay(scrollStopDelay);
22232
22268
  dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
22233
22269
  }, [scrollStopDelay]);
@@ -22237,7 +22273,7 @@ var InfiniteTableComponent = React66.memo(
22237
22273
  const { menuPortal: cellContextMenuPortal } = useCellContextMenu();
22238
22274
  const { menuPortal: tableContextMenuPortal } = useTableContextMenu();
22239
22275
  const { menuPortal: filterOperatorMenuPortal } = useColumnFilterOperatorMenu();
22240
- React66.useEffect(() => {
22276
+ React67.useEffect(() => {
22241
22277
  if (typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY === "function") {
22242
22278
  globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(
22243
22279
  componentState.id,
@@ -22250,9 +22286,15 @@ var InfiniteTableComponent = React66.memo(
22250
22286
  globalThis.infiniteApi = context.api;
22251
22287
  }
22252
22288
  }, [componentState.ready]);
22253
- const onContextMenu = React66.useCallback((event) => {
22289
+ const onContextMenu = React67.useCallback((event) => {
22254
22290
  const state = context.getState();
22255
22291
  const target = event.target;
22292
+ if (!masterContext && event._from_row_detail) {
22293
+ return;
22294
+ }
22295
+ if (masterContext) {
22296
+ event._from_row_detail = true;
22297
+ }
22256
22298
  const cell = selectParentUntil(
22257
22299
  target,
22258
22300
  getCellSelector(),
@@ -22281,14 +22323,19 @@ var InfiniteTableComponent = React66.memo(
22281
22323
  }
22282
22324
  state.contextMenu(param);
22283
22325
  }, []);
22284
- return /* @__PURE__ */ React66.createElement("div", __spreadValues({ onKeyDown: onKeyDown2, ref: domRef }, domProps), header ? /* @__PURE__ */ React66.createElement(
22326
+ React67.useEffect(() => {
22327
+ if (masterContext) {
22328
+ portalDOMRef.current = masterContext.getMasterState().portalDOMRef.current;
22329
+ }
22330
+ }, []);
22331
+ return /* @__PURE__ */ React67.createElement("div", __spreadValues({ onKeyDown: onKeyDown2, ref: domRef }, domProps), header ? /* @__PURE__ */ React67.createElement(
22285
22332
  TableHeaderWrapper,
22286
22333
  {
22287
22334
  bodyBrain: brain,
22288
22335
  headerBrain,
22289
22336
  scrollbars
22290
22337
  }
22291
- ) : null, /* @__PURE__ */ React66.createElement(InfiniteTableBody, { onContextMenu }, /* @__PURE__ */ React66.createElement(
22338
+ ) : null, /* @__PURE__ */ React67.createElement(InfiniteTableBody, { onContextMenu }, /* @__PURE__ */ React67.createElement(
22292
22339
  HeadlessTable,
22293
22340
  {
22294
22341
  debugId,
@@ -22306,7 +22353,7 @@ var InfiniteTableComponent = React66.memo(
22306
22353
  cellHoverClassNames: HOVERED_CLASS_NAMES,
22307
22354
  scrollerDOMRef
22308
22355
  }
22309
- ), /* @__PURE__ */ React66.createElement(LoadMaskCmp, { visible: loading }, loadingText)), /* @__PURE__ */ React66.createElement(
22356
+ ), /* @__PURE__ */ React67.createElement(LoadMaskCmp, { visible: loading }, loadingText)), /* @__PURE__ */ React67.createElement(
22310
22357
  "div",
22311
22358
  {
22312
22359
  ref: portalDOMRef,
@@ -22322,25 +22369,25 @@ var InfiniteTableComponent = React66.memo(
22322
22369
  cellContextMenuPortal,
22323
22370
  tableContextMenuPortal,
22324
22371
  filterOperatorMenuPortal
22325
- ), rowHeightCSSVar ? /* @__PURE__ */ React66.createElement(
22372
+ ), rowHeightCSSVar ? /* @__PURE__ */ React67.createElement(
22326
22373
  CSSNumericVariableWatch,
22327
22374
  {
22328
22375
  varName: rowHeightCSSVar,
22329
22376
  onChange: onRowHeightCSSVarChange
22330
22377
  }
22331
- ) : null, rowDetailHeightCSSVar ? /* @__PURE__ */ React66.createElement(
22378
+ ) : null, rowDetailHeightCSSVar ? /* @__PURE__ */ React67.createElement(
22332
22379
  CSSNumericVariableWatch,
22333
22380
  {
22334
22381
  varName: rowDetailHeightCSSVar,
22335
22382
  onChange: onRowDetailHeightCSSVarChange
22336
22383
  }
22337
- ) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ React66.createElement(
22384
+ ) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ React67.createElement(
22338
22385
  CSSNumericVariableWatch,
22339
22386
  {
22340
22387
  varName: columnHeaderHeightCSSVar,
22341
22388
  onChange: onColumnHeaderHeightCSSVarChange
22342
22389
  }
22343
- ) : null, /* @__PURE__ */ React66.createElement(InfiniteTableFooter, null), licenseValid ? null : /* @__PURE__ */ React66.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React66.createElement(FocusDetect, null));
22390
+ ) : null, /* @__PURE__ */ React67.createElement(InfiniteTableFooter, null), licenseValid ? null : /* @__PURE__ */ React67.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React67.createElement(FocusDetect, null));
22344
22391
  }
22345
22392
  );
22346
22393
  function InfiniteTableContextProvider() {
@@ -22354,6 +22401,7 @@ function InfiniteTableContextProvider() {
22354
22401
  globalThis.getState = getState;
22355
22402
  globalThis.getComputed = getComputed;
22356
22403
  globalThis.componentActions = componentActions;
22404
+ globalThis.masterBrain = componentState.brain;
22357
22405
  }
22358
22406
  const {
22359
22407
  getState: getDataSourceState,
@@ -22361,7 +22409,7 @@ function InfiniteTableContextProvider() {
22361
22409
  getDataSourceMasterContext,
22362
22410
  api: dataSourceApi
22363
22411
  } = useDataSourceContextValue();
22364
- const [imperativeApi] = React66.useState(() => {
22412
+ const [imperativeApi] = React67.useState(() => {
22365
22413
  return getImperativeApi({
22366
22414
  getComputed,
22367
22415
  getState,
@@ -22396,21 +22444,21 @@ function InfiniteTableContextProvider() {
22396
22444
  },
22397
22445
  { earlyAttach: true, debounce: 50 }
22398
22446
  );
22399
- React66.useEffect(() => {
22447
+ React67.useEffect(() => {
22400
22448
  if (scrollerDOMRef.current) {
22401
22449
  scrollerDOMRef.current.scrollTop = 0;
22402
22450
  }
22403
22451
  }, [scrollTopKey, scrollerDOMRef]);
22404
22452
  const TableContext2 = getInfiniteTableContext();
22405
- return /* @__PURE__ */ React66.createElement(TableContext2.Provider, { value: contextValue }, /* @__PURE__ */ React66.createElement(InfiniteTableComponent, null));
22453
+ return /* @__PURE__ */ React67.createElement(TableContext2.Provider, { value: contextValue }, /* @__PURE__ */ React67.createElement(InfiniteTableComponent, null));
22406
22454
  }
22407
22455
  function InfiniteTable(props) {
22408
22456
  const table = (
22409
22457
  //@ts-ignore
22410
- /* @__PURE__ */ React66.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React66.createElement(InfiniteTableContextProvider, null))
22458
+ /* @__PURE__ */ React67.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React67.createElement(InfiniteTableContextProvider, null))
22411
22459
  );
22412
22460
  if (false) {
22413
- return /* @__PURE__ */ React66.createElement(React66.StrictMode, null, table);
22461
+ return /* @__PURE__ */ React67.createElement(React67.StrictMode, null, table);
22414
22462
  }
22415
22463
  return table;
22416
22464
  }
@@ -22579,6 +22627,7 @@ export {
22579
22627
  useInfiniteColumnEditor,
22580
22628
  useInfiniteColumnFilterEditor,
22581
22629
  useInfiniteHeaderCell,
22630
+ useMasterRowInfo,
22582
22631
  useOverlay,
22583
22632
  useOverlayPortal,
22584
22633
  useRowInfoReducers