@infinite-table/infinite-react 0.4.9 → 0.4.12

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.js CHANGED
@@ -632,6 +632,8 @@ __export(exports, {
632
632
  InfiniteTable: () => InfiniteTable,
633
633
  InfiniteTableClassName: () => InfiniteTableClassName,
634
634
  InfiniteTableComponent: () => InfiniteTableComponent,
635
+ Menu: () => Menu,
636
+ MenuItem: () => MenuItem,
635
637
  NumberFilterEditor: () => NumberFilterEditor,
636
638
  RowSelectionState: () => RowSelectionState,
637
639
  StringFilterEditor: () => StringFilterEditor,
@@ -1096,7 +1098,7 @@ function stripVar(cssVariableWithVarString) {
1096
1098
 
1097
1099
  // src/components/InfiniteTable/theme.css.ts
1098
1100
  var InternalVars = { currentColumnWidth: "var(--_1slvgu90)", currentColumnTransformX: "var(--_1slvgu91)", currentColumnTransformY: "var(--_1slvgu92)", activeCellRowOffset: "var(--_1slvgu93)", activeCellRowHeight: "var(--_1slvgu94)", activeCellOffsetX: "var(--_1slvgu95)", activeCellOffsetY: "var(--_1slvgu96)", scrollTopForActiveRow: "var(--_1slvgu97)", activeCellColWidth: "var(--_1slvgu98)", activeCellColOffset: "var(--_1slvgu99)", columnReorderEffectDurationAtIndex: "var(--_1slvgu9a)", columnWidthAtIndex: "var(--_1slvgu9b)", columnOffsetAtIndex: "var(--_1slvgu9c)", columnOffsetAtIndexWhileReordering: "var(--_1slvgu9d)", columnZIndexAtIndex: "var(--_1slvgu9e)", pinnedStartWidth: "var(--_1slvgu9f)", pinnedEndWidth: "var(--_1slvgu9g)", pinnedEndOffset: "var(--_1slvgu9h)", computedVisibleColumnsCount: "var(--_1slvgu9i)", baseZIndexForCells: "var(--_1slvgu9j)", bodyWidth: "var(--_1slvgu9k)", bodyHeight: "var(--_1slvgu9l)", scrollbarWidthHorizontal: "var(--_1slvgu9m)", scrollbarWidthVertical: "var(--_1slvgu9n)", scrollLeft: "var(--_1slvgu9o)", scrollTop: "var(--_1slvgu9p)" };
1099
- var ThemeVars = { color: { accent: "var(--infinite-accent-color)", error: "var(--infinite-error-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: { background: "var(--infinite-header-cell-background)", hoverBackground: "var(--infinite-header-cell-hover-background)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)" }, Cell: { padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", border: "var(--infinite-cell-border)", borderInvisible: "var(--infinite-cell-border-invisible)", borderRadius: "var(--infinite-cell-border-radius)", reorderEffectDuration: "var(--infinite-column-reorder-effect-duration)", pinnedBorder: "var(--infinite-pinned-cell-border)", color: "var(--infinite-cell-color)", activeBorderColor_R: "var(--infinite-active-cell-border-color--r)", activeBorderColor_G: "var(--infinite-active-cell-border-color--g)", activeBorderColor_B: "var(--infinite-active-cell-border-color--b)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, SelectionCheckBox: { marginInline: "var(--infinite-selection-checkbox-margin-inline)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", selectedBackground: "var(--infinite-row-selected-background)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", selectedHoverBackground: "var(--infinite-row-selected-hover-background)", groupRowBackground: "var(--infinite-group-row-background)", groupRowColumnNesting: "var(--infinite-group-row-column-nesting)", groupNesting: "var(--infinite-dont-override-group-row-nesting-length)", pointerEventsWhileScrolling: "var(--infinite-row-pointer-events-while-scrolling)" }, ColumnCell: { background: "var(--infinite-column-cell-bg-dont-override)" } } };
1101
+ var ThemeVars = { color: { accent: "var(--infinite-accent-color)", error: "var(--infinite-error-color)", color: "var(--infinite-color)" }, spacing: { "0": "var(--infinite-space-0)", "1": "var(--infinite-space-1)", "2": "var(--infinite-space-2)", "3": "var(--infinite-space-3)", "4": "var(--infinite-space-4)", "5": "var(--infinite-space-5)", "6": "var(--infinite-space-6)", "7": "var(--infinite-space-7)", "8": "var(--infinite-space-8)", "9": "var(--infinite-space-9)", "10": "var(--infinite-space-10)" }, fontSize: { "0": "var(--infinite-font-size-0)", "1": "var(--infinite-font-size-1)", "2": "var(--infinite-font-size-2)", "3": "var(--infinite-font-size-3)", "4": "var(--infinite-font-size-4)", "5": "var(--infinite-font-size-5)", "6": "var(--infinite-font-size-6)", "7": "var(--infinite-font-size-7)" }, fontFamily: "var(--infinite-font-family)", minHeight: "var(--infinite-min-height)", borderRadius: "var(--infinite-border-radius)", background: "var(--infinite-background)", components: { LoadMask: { padding: "var(--infinite-load-mask-padding)", color: "var(--infinite-load-mask-color)", textBackground: "var(--infinite-load-mask-text-background)", overlayBackground: "var(--infinite-load-mask-overlay-background)", overlayOpacity: "var(--infinite-load-mask-overlay-opacity)", borderRadius: "var(--infinite-load-mask-border-radius)" }, Header: { background: "var(--infinite-header-background)", color: "var(--infinite-header-color)", columnHeaderHeight: "var(--infinite-column-header-height)" }, HeaderCell: { background: "var(--infinite-header-cell-background)", hoverBackground: "var(--infinite-header-cell-hover-background)", padding: "var(--infinite-header-cell-padding)", paddingX: "var(--infinite-header-cell-padding-x)", paddingY: "var(--infinite-header-cell-padding-y)", iconSize: "var(--infinite-header-cell-icon-size)", sortIconMargin: "var(--infinite-header-cell-sort-icon-margin)", resizeHandleActiveAreaWidth: "var(--infinite-resize-handle-active-area-width)", resizeHandleWidth: "var(--infinite-resize-handle-width)", resizeHandleHoverBackground: "var(--infinite-resize-handle-hover-background)", resizeHandleConstrainedHoverBackground: "var(--infinite-resize-handle-constrained-hover-background)" }, Cell: { padding: "var(--infinite-cell-padding)", borderWidth: "var(--infinite-cell-border-width)", border: "var(--infinite-cell-border)", borderInvisible: "var(--infinite-cell-border-invisible)", borderRadius: "var(--infinite-cell-border-radius)", reorderEffectDuration: "var(--infinite-column-reorder-effect-duration)", pinnedBorder: "var(--infinite-pinned-cell-border)", color: "var(--infinite-cell-color)", activeBorderColor_R: "var(--infinite-active-cell-border-color--r)", activeBorderColor_G: "var(--infinite-active-cell-border-color--g)", activeBorderColor_B: "var(--infinite-active-cell-border-color--b)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, SelectionCheckBox: { marginInline: "var(--infinite-selection-checkbox-margin-inline)" }, Menu: { background: "var(--infinite-menu-background)", color: "var(--infinite-menu-color)", padding: "var(--infinite-menu-padding)", cellPaddingVertical: "var(--infinite-menu-cell-padding-vertical)", cellPaddingHorizontal: "var(--infinite-menu-cell-padding-horizontal)", cellMarginVertical: "var(--infinite-menu-cell-margin-vertical)", itemDisabledBackground: "var(--infinite-menu-item-disabled-background)", itemHoverBackground: "var(--infinite-menu-item-hover-background)", itemHoverOpacity: "var(--infinite-menu-item-hover-opacity)", itemPressedOpacity: "var(--infinite-menu-item-pressed-opacity)", itemPressedBackground: "var(--infinite-menu-item-pressed-background)", itemDisabledOpacity: "var(--infinite-menu-item-disabled-opacity)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", selectedBackground: "var(--infinite-row-selected-background)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", selectedHoverBackground: "var(--infinite-row-selected-hover-background)", groupRowBackground: "var(--infinite-group-row-background)", groupRowColumnNesting: "var(--infinite-group-row-column-nesting)", groupNesting: "var(--infinite-dont-override-group-row-nesting-length)", pointerEventsWhileScrolling: "var(--infinite-row-pointer-events-while-scrolling)" }, ColumnCell: { background: "var(--infinite-column-cell-bg-dont-override)" } } };
1100
1102
  var columnHeaderHeightName = "column-header-height";
1101
1103
 
1102
1104
  // src/utils/selectParent.ts
@@ -3652,11 +3654,11 @@ var useRerender = () => {
3652
3654
  };
3653
3655
 
3654
3656
  // src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
3655
- var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwg _16lm1iw3 _16lm1iw15 _16lm1iw13", hidden: "nxbq1c3 nxbq1c1 _16lm1iwg _16lm1iw3 _16lm1iw15 _16lm1iw13" };
3656
- var ActiveIndicatorWrapperCls = "_16lm1iwg _16lm1iw3 _16lm1iw15 _16lm1iw13 _16lm1iwz _16lm1iwp";
3657
+ var ActiveCellIndicatorCls = { visible: "nxbq1c2 nxbq1c1 _16lm1iwi _16lm1iw3 _16lm1iw1b _16lm1iw19", hidden: "nxbq1c3 nxbq1c1 _16lm1iwi _16lm1iw3 _16lm1iw1b _16lm1iw19" };
3658
+ var ActiveIndicatorWrapperCls = "_16lm1iwi _16lm1iw3 _16lm1iw1b _16lm1iw19 _16lm1iw15 _16lm1iwr";
3657
3659
 
3658
3660
  // src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
3659
- var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwg _16lm1iw3 _16lm1iw12 _16lm1iw13 _16lm1iw15", hidden: "j26lrx2 j26lrx0 _16lm1iwg _16lm1iw3 _16lm1iw12 _16lm1iw13 _16lm1iw15" };
3661
+ var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwi _16lm1iw3 _16lm1iw18 _16lm1iw19 _16lm1iw1b", hidden: "j26lrx2 j26lrx0 _16lm1iwi _16lm1iw3 _16lm1iw18 _16lm1iw19 _16lm1iw1b" };
3660
3662
 
3661
3663
  // src/components/InfiniteTable/components/ActiveRowIndicator.tsx
3662
3664
  var { rootClassName: rootClassName3 } = internalProps;
@@ -4186,20 +4188,20 @@ var useInternalProps = () => {
4186
4188
  };
4187
4189
 
4188
4190
  // src/components/InfiniteTable/utilities.css.ts
4189
- var alignItems = { center: "_16lm1iw1h", stretch: "_16lm1iw1i" };
4190
- var cssEllipsisClassName = "_16lm1iw1s _16lm1iw1t _16lm1iw1m";
4191
- var cursor = { pointer: "_16lm1iwe", colResize: "_16lm1iwf" };
4192
- var display = { flex: "_16lm1iwu", none: "_16lm1iwv", block: "_16lm1iww", inlineBlock: "_16lm1iwx" };
4193
- var flex = { "1": "_16lm1iwh", none: "_16lm1iwi" };
4194
- var flexFlow = { column: "_16lm1iw1d", columnReverse: "_16lm1iw1e", row: "_16lm1iw1f", rowReverse: "_16lm1iw1g" };
4195
- var justifyContent = { center: "_16lm1iw1j", start: "_16lm1iw1k", end: "_16lm1iw1l" };
4196
- var left = { "0": "_16lm1iw15", "100%": "_16lm1iw16", auto: "_16lm1iw17" };
4197
- var overflow = { hidden: "_16lm1iw1m", auto: "_16lm1iw1n", visible: "_16lm1iw1o" };
4191
+ var alignItems = { center: "_16lm1iw1n", stretch: "_16lm1iw1o" };
4192
+ var cssEllipsisClassName = "_16lm1iw1y _16lm1iw1z _16lm1iw1s";
4193
+ var cursor = { pointer: "_16lm1iwf", "default": "_16lm1iwg", colResize: "_16lm1iwh" };
4194
+ var display = { flex: "_16lm1iww", contents: "_16lm1iwx", none: "_16lm1iwy", block: "_16lm1iwz", grid: "_16lm1iw10", inlineBlock: "_16lm1iw11", inlineFlex: "_16lm1iw12", inlineGrid: "_16lm1iw13" };
4195
+ var flex = { "1": "_16lm1iwj", none: "_16lm1iwk" };
4196
+ var flexFlow = { column: "_16lm1iw1j", columnReverse: "_16lm1iw1k", row: "_16lm1iw1l", rowReverse: "_16lm1iw1m" };
4197
+ var justifyContent = { center: "_16lm1iw1p", start: "_16lm1iw1q", end: "_16lm1iw1r" };
4198
+ var left = { "0": "_16lm1iw1b", "100%": "_16lm1iw1c", auto: "_16lm1iw1d" };
4199
+ var overflow = { hidden: "_16lm1iw1s", auto: "_16lm1iw1t", visible: "_16lm1iw1u" };
4198
4200
  var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
4199
- var top = { "0": "_16lm1iw13", "100%": "_16lm1iw14" };
4200
- var transformTranslateZero = "_16lm1iwa";
4201
- var userSelect = { none: "_16lm1iwy" };
4202
- var zIndex = { "1": "_16lm1iwj", "10": "_16lm1iwk", "100": "_16lm1iwl", "1000": "_16lm1iwm", "10000": "_16lm1iwn", "100000": "_16lm1iwo", "1000000": "_16lm1iwp", "10000000": "_16lm1iwq", "1k": "_16lm1iwr", "10k": "_16lm1iws", "100k": "_16lm1iwt" };
4201
+ var top = { "0": "_16lm1iw19", "100%": "_16lm1iw1a" };
4202
+ var transformTranslateZero = "_16lm1iwb";
4203
+ var userSelect = { none: "_16lm1iw14" };
4204
+ var zIndex = { "1": "_16lm1iwl", "10": "_16lm1iwm", "100": "_16lm1iwn", "1000": "_16lm1iwo", "10000": "_16lm1iwp", "100000": "_16lm1iwq", "1000000": "_16lm1iwr", "10000000": "_16lm1iws", "1k": "_16lm1iwt", "10k": "_16lm1iwu", "100k": "_16lm1iwv" };
4203
4205
 
4204
4206
  // src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
4205
4207
  var InfiniteTableBody = React14.forwardRef(function InfiniteTableBody2(props, ref) {
@@ -4323,6 +4325,10 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
4323
4325
  if (extraFlags.rowSelected) {
4324
4326
  result.push(...baseClasses.map((c) => `${c}--row-selected`));
4325
4327
  }
4328
+ if (extraFlags.groupRow) {
4329
+ result.push(...baseClasses.map((c) => `${c}--group-row`));
4330
+ result.push(...baseClasses.map((c) => `${c}--${extraFlags.rowExpanded ? "group-row-expanded" : "group-row-collapsed"}`));
4331
+ }
4326
4332
  if (column.computedPinned) {
4327
4333
  result.push(...baseClasses.map((c) => `${c}--pinned-${column.computedPinned}`));
4328
4334
  } else {
@@ -4356,14 +4362,14 @@ var useInfiniteTable = () => {
4356
4362
  // src/components/InfiniteTable/InfiniteCls.css.ts
4357
4363
  var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
4358
4364
  var FooterCls = "_16lm1iw1";
4359
- var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwu _16lm1iw1d _16lm1iw0";
4365
+ var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iww _16lm1iw1j _16lm1iw0";
4360
4366
  var InfiniteClsHasPinnedEnd = "_1yeub2vo";
4361
4367
  var InfiniteClsHasPinnedStart = "_1yeub2vn";
4362
4368
  var InfiniteClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "_1yeub2ve"]] });
4363
4369
  var InfiniteClsShiftingColumns = "_1yeub2vl";
4364
- var PinnedEndIndicatorBorder = "_1yeub2vr _1yeub2vp _16lm1iw2 _16lm1iw13 _16lm1iwf _16lm1iwy _16lm1iw11 _16lm1iw1q _16lm1iwg _16lm1iwq";
4370
+ var PinnedEndIndicatorBorder = "_1yeub2vr _1yeub2vp _16lm1iw2 _16lm1iw19 _16lm1iwh _16lm1iw14 _16lm1iw17 _16lm1iw1w _16lm1iwi _16lm1iws";
4365
4371
  var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
4366
- var PinnedStartIndicatorBorder = "_1yeub2vq _1yeub2vp _16lm1iw2 _16lm1iw13 _16lm1iwf _16lm1iwy _16lm1iw11 _16lm1iw1q _16lm1iwg _16lm1iwq";
4372
+ var PinnedStartIndicatorBorder = "_1yeub2vq _1yeub2vp _16lm1iw2 _16lm1iw19 _16lm1iwh _16lm1iw14 _16lm1iw17 _16lm1iw1w _16lm1iwi _16lm1iws";
4367
4373
 
4368
4374
  // src/components/utils/getScrollbarWidth.ts
4369
4375
  var scrollbarWidth;
@@ -5096,7 +5102,7 @@ var useColumnPointerEvents = ({
5096
5102
  };
5097
5103
  };
5098
5104
 
5099
- // src/components/InfiniteTable/utils/RenderHookComponent.tsx
5105
+ // src/components/InfiniteTable/utils/RenderHookComponentForInfinite.tsx
5100
5106
  var React22 = __toModule(require("react"));
5101
5107
 
5102
5108
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
@@ -5120,8 +5126,8 @@ var import_react17 = __toModule(require("react"));
5120
5126
 
5121
5127
  // src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
5122
5128
  var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5123
- var ExpanderIconCls = "_16lm1iw6 _16lm1iwi _16lm1iwe";
5124
- var ExpanderIconClsVariants = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwc", false: "_198z9782" }, direction: { end: "_198z9783", start: "_198z9784" } }, defaultVariants: {}, compoundVariants: [[{ expanded: false, direction: "end" }, "_16lm1iwd"]] });
5129
+ var ExpanderIconCls = "_16lm1iw6 _16lm1iwk _16lm1iwf";
5130
+ var ExpanderIconClsVariants = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwd", false: "_198z9782" }, direction: { end: "_198z9783", start: "_198z9784" } }, defaultVariants: {}, compoundVariants: [[{ expanded: false, direction: "end" }, "_16lm1iwe"]] });
5125
5131
 
5126
5132
  // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
5127
5133
  function ExpanderIcon(props) {
@@ -5161,7 +5167,7 @@ function ExpanderIcon(props) {
5161
5167
  var React17 = __toModule(require("react"));
5162
5168
 
5163
5169
  // src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
5164
- var LoadingIconCls = "_16lm1iw8 _16lm1iwi _16lm1iwe";
5170
+ var LoadingIconCls = "_16lm1iw9 _16lm1iwk _16lm1iwf";
5165
5171
 
5166
5172
  // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
5167
5173
  var LoadingIcon = (props) => {
@@ -5359,7 +5365,7 @@ function objectValuesExcept(obj, exceptList) {
5359
5365
 
5360
5366
  // src/components/InfiniteTable/components/cell.css.ts
5361
5367
  var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5362
- var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw2 _16lm1iw1r _16lm1iw1s _16lm1iwy";
5368
+ var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iww _16lm1iw1l _16lm1iw1n _16lm1iw2 _16lm1iw1x _16lm1iw1y _16lm1iw14";
5363
5369
  var ColumnCellRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "_1eexc2a8", variantClassNames: { dragging: { false: "_1eexc2a9", true: "_1eexc2aa" }, rowActive: { false: "_1eexc2ab", true: "_1eexc2ac" }, zebra: { false: "_1eexc2ad", even: "_1eexc2ae", odd: "_1eexc2af" }, rowSelected: { true: "_1eexc2ag", false: "_1eexc2ah", null: "_1eexc2ai" }, first: { true: "_1eexc2aj", false: "_1eexc2ak" }, last: { true: "_1eexc2al", false: "_1eexc2am" }, groupByField: { true: "_1eexc2an", false: "_1eexc2ao" }, firstInCategory: { true: "_1eexc2ap", false: "_1eexc2aq" }, lastInCategory: { true: "_1eexc2ar", false: "_1eexc2as" }, pinned: { start: "_1eexc2at", end: "_1eexc2au", false: "_1eexc2av" }, filtered: { true: "_1eexc2aw", false: "_1eexc2ax" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2ay"], [{ pinned: "start", firstInCategory: true }, "_1eexc2az"], [{ pinned: "end", firstInCategory: true }, "_1eexc2a10"], [{ pinned: "end", lastInCategory: true }, "_1eexc2a11"]] });
5364
5370
  var SelectionCheckboxCls = "_1eexc2a7";
5365
5371
 
@@ -5368,7 +5374,7 @@ var React19 = __toModule(require("react"));
5368
5374
  var import_react18 = __toModule(require("react"));
5369
5375
 
5370
5376
  // src/components/InfiniteTable/components/CheckBox.css.ts
5371
- var CheckBoxCls = "_16lm1iwe";
5377
+ var CheckBoxCls = "_16lm1iwf";
5372
5378
 
5373
5379
  // src/components/InfiniteTable/components/CheckBox.tsx
5374
5380
  function forwardProps2() {
@@ -5849,7 +5855,14 @@ function InfiniteTableColumnCellFn(props) {
5849
5855
  onClick,
5850
5856
  onMouseDown,
5851
5857
  cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
5852
- className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false, zebra, rowActive, rowSelected }), colClassName, rowComputedClassName),
5858
+ className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, {
5859
+ dragging: false,
5860
+ zebra,
5861
+ rowActive,
5862
+ rowSelected,
5863
+ groupRow: rowInfo.isGroupRow,
5864
+ rowExpanded: rowInfo.isGroupRow ? !rowInfo.collapsed : false
5865
+ }), colClassName, rowComputedClassName),
5853
5866
  renderChildren
5854
5867
  };
5855
5868
  return /* @__PURE__ */ React21.createElement(InfiniteTableCell, __spreadValues({}, cellProps));
@@ -5860,11 +5873,13 @@ function useInfiniteColumnCell() {
5860
5873
  return result;
5861
5874
  }
5862
5875
 
5863
- // src/components/InfiniteTable/utils/RenderHookComponent.tsx
5876
+ // src/components/RenderHookComponent.tsx
5864
5877
  function RenderHookComponent(props) {
5865
5878
  var _a;
5866
5879
  return (_a = props.render(props.renderParam)) != null ? _a : null;
5867
5880
  }
5881
+
5882
+ // src/components/InfiniteTable/utils/RenderHookComponentForInfinite.tsx
5868
5883
  function RenderCellHookComponent(props) {
5869
5884
  const ContextProvider = InfiniteTableColumnCellContext.Provider;
5870
5885
  return /* @__PURE__ */ React22.createElement(ContextProvider, {
@@ -5926,19 +5941,19 @@ var import_react20 = __toModule(require("react"));
5926
5941
 
5927
5942
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
5928
5943
  var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5929
- var CellCls = "_1eexc2a5 _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw2 _16lm1iw1r _16lm1iw1s _16lm1iwy";
5930
- var HeaderCellContentRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob11e _16lm1iw10 _16lm1iw12 _16lm1iwu _16lm1iw1f _16lm1iw1h", variantClassNames: { filtered: { false: "_12zfob11f", true: "_12zfob11g" } }, defaultVariants: {}, compoundVariants: [] });
5931
- var HeaderCellProxy = "_12zfob1k _16lm1iw1s _16lm1iw1t _16lm1iw1m";
5932
- var HeaderCellRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob1l _16lm1iww", variantClassNames: { rowActive: { false: "_12zfob1m", true: "_12zfob1n" }, rowSelected: { false: "_12zfob1o", true: "_12zfob1p", null: "_12zfob1q" }, zebra: { false: "_12zfob1r", even: "_12zfob1s", odd: "_12zfob1t" }, dragging: { true: "_12zfob1u", false: "_12zfob1v" }, first: { true: "_12zfob1w", false: "_12zfob1x" }, last: { true: "_12zfob1y", false: "_12zfob1z" }, groupByField: { true: "_12zfob110", false: "_12zfob111" }, firstInCategory: { true: "_12zfob112", false: "_12zfob113" }, lastInCategory: { true: "_12zfob114", false: "_12zfob115" }, pinned: { start: "_12zfob116", end: "_12zfob117", false: "_12zfob118" }, filtered: { true: "_12zfob119", false: "_12zfob11a" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob11b"], [{ pinned: "end", firstInCategory: true }, "_12zfob11c"], [{ pinned: false, lastInCategory: true }, "_12zfob11d"]] });
5933
- var HeaderClsRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob16 _16lm1iww _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob17", end: "_12zfob18", false: "_12zfob19" }, firstInCategory: { true: "_12zfob1a", false: "_12zfob1b" }, lastInCategory: { true: "_12zfob1c", false: "_12zfob1d" }, overflow: { true: "_12zfob1e", false: "_12zfob1f" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1g"], [{ pinned: "start", firstInCategory: true }, "_12zfob1h"], [{ overflow: true, pinned: "end" }, "_12zfob1i"], [{ pinned: "end", lastInCategory: true }, "_12zfob1j"]] });
5934
- var HeaderFilterCls = "_12zfob11j _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw1";
5935
- var HeaderFilterEditorCls = "_16lm1iw12 _16lm1iw10";
5936
- var HeaderGroupCls = "_12zfob11i _16lm1iwu _16lm1iw1f _16lm1iw1h";
5944
+ var CellCls = "_1eexc2a5 _16lm1iww _16lm1iw1l _16lm1iw1n _16lm1iw2 _16lm1iw1x _16lm1iw1y _16lm1iw14";
5945
+ var HeaderCellContentRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob11e _16lm1iw16 _16lm1iw18 _16lm1iww _16lm1iw1l _16lm1iw1n", variantClassNames: { filtered: { false: "_12zfob11f", true: "_12zfob11g" } }, defaultVariants: {}, compoundVariants: [] });
5946
+ var HeaderCellProxy = "_12zfob1k _16lm1iw1y _16lm1iw1z _16lm1iw1s";
5947
+ var HeaderCellRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob1l _16lm1iwz", variantClassNames: { rowActive: { false: "_12zfob1m", true: "_12zfob1n" }, rowSelected: { false: "_12zfob1o", true: "_12zfob1p", null: "_12zfob1q" }, zebra: { false: "_12zfob1r", even: "_12zfob1s", odd: "_12zfob1t" }, dragging: { true: "_12zfob1u", false: "_12zfob1v" }, first: { true: "_12zfob1w", false: "_12zfob1x" }, last: { true: "_12zfob1y", false: "_12zfob1z" }, groupByField: { true: "_12zfob110", false: "_12zfob111" }, firstInCategory: { true: "_12zfob112", false: "_12zfob113" }, lastInCategory: { true: "_12zfob114", false: "_12zfob115" }, pinned: { start: "_12zfob116", end: "_12zfob117", false: "_12zfob118" }, filtered: { true: "_12zfob119", false: "_12zfob11a" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob11b"], [{ pinned: "end", firstInCategory: true }, "_12zfob11c"], [{ pinned: false, lastInCategory: true }, "_12zfob11d"]] });
5948
+ var HeaderClsRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob16 _16lm1iwz _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob17", end: "_12zfob18", false: "_12zfob19" }, firstInCategory: { true: "_12zfob1a", false: "_12zfob1b" }, lastInCategory: { true: "_12zfob1c", false: "_12zfob1d" }, overflow: { true: "_12zfob1e", false: "_12zfob1f" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1g"], [{ pinned: "start", firstInCategory: true }, "_12zfob1h"], [{ overflow: true, pinned: "end" }, "_12zfob1i"], [{ pinned: "end", lastInCategory: true }, "_12zfob1j"]] });
5949
+ var HeaderFilterCls = "_12zfob11j _16lm1iww _16lm1iw1l _16lm1iw1n _16lm1iw1";
5950
+ var HeaderFilterEditorCls = "_16lm1iw18 _16lm1iw16";
5951
+ var HeaderGroupCls = "_12zfob11i _16lm1iww _16lm1iw1l _16lm1iw1n";
5937
5952
  var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
5938
5953
  var HeaderSortIconCls = "_16lm1iw1";
5939
5954
  var HeaderSortIconIndexCls = "_12zfob14";
5940
5955
  var HeaderSortIconRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
5941
- var HeaderWrapperCls = "_12zfob11h _16lm1iw1m _16lm1iw1 _16lm1iwu _16lm1iw1f";
5956
+ var HeaderWrapperCls = "_12zfob11h _16lm1iw1s _16lm1iw1 _16lm1iww _16lm1iw1l";
5942
5957
 
5943
5958
  // src/components/InfiniteTable/components/icons/SortIcon.tsx
5944
5959
  var defaultLineStyle = {
@@ -6501,9 +6516,9 @@ function getColumnGroupResizer(colIndexes, config) {
6501
6516
 
6502
6517
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
6503
6518
  var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
6504
- var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iw13 _16lm1iw1a _16lm1iw18 _16lm1iwf _16lm1iw1m";
6505
- var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2 _16lm1iw13 _16lm1iw18", variantClassNames: { constrained: { false: "zneyzhc", true: "zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
6506
- var ResizeHandleRecipeCls = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { computedPinned: { start: "zneyzh1", end: "zneyzh2 _16lm1iw15 _16lm1iw1c", false: "zneyzh3" }, computedFirstInCategory: { true: "zneyzh4", false: "zneyzh5" }, computedLastInCategory: { true: "zneyzh6", false: "zneyzh7" } }, defaultVariants: {}, compoundVariants: [[{ computedPinned: "end", computedLastInCategory: false, computedFirstInCategory: true }, "zneyzh8"], [{ computedPinned: false, computedFirstInCategory: false, computedLastInCategory: true }, "zneyzh9"], [{ computedPinned: "start", computedFirstInCategory: false, computedLastInCategory: true }, "zneyzha"]] });
6519
+ var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iw19 _16lm1iw1g _16lm1iw1e _16lm1iwh _16lm1iw1s";
6520
+ var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2 _16lm1iw19 _16lm1iw1e", variantClassNames: { constrained: { false: "zneyzhc", true: "zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
6521
+ var ResizeHandleRecipeCls = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { computedPinned: { start: "zneyzh1", end: "zneyzh2 _16lm1iw1b _16lm1iw1i", false: "zneyzh3" }, computedFirstInCategory: { true: "zneyzh4", false: "zneyzh5" }, computedLastInCategory: { true: "zneyzh6", false: "zneyzh7" } }, defaultVariants: {}, compoundVariants: [[{ computedPinned: "end", computedLastInCategory: false, computedFirstInCategory: true }, "zneyzh8"], [{ computedPinned: false, computedFirstInCategory: false, computedLastInCategory: true }, "zneyzh9"], [{ computedPinned: "start", computedFirstInCategory: false, computedLastInCategory: true }, "zneyzha"]] });
6507
6522
 
6508
6523
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
6509
6524
  var { rootClassName: rootClassName8 } = internalProps;
@@ -6886,7 +6901,9 @@ function InfiniteTableHeaderCell(props) {
6886
6901
  dragging,
6887
6902
  rowSelected: false,
6888
6903
  zebra: false,
6889
- rowActive: false
6904
+ rowActive: false,
6905
+ groupRow: false,
6906
+ rowExpanded: false
6890
6907
  }), CellCls),
6891
6908
  cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
6892
6909
  afterChildren: /* @__PURE__ */ React28.createElement(React28.Fragment, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ React28.createElement(InfiniteTableColumnHeaderFilter, {
@@ -7478,8 +7495,8 @@ var InfiniteTableLicenseFooter = React34.forwardRef(function InfiniteTableLicens
7478
7495
  var React35 = __toModule(require("react"));
7479
7496
 
7480
7497
  // src/components/InfiniteTable/components/LoadMask.css.ts
7481
- var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw13 _16lm1iw15 _16lm1iw1a _16lm1iw18", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw13 _16lm1iw15 _16lm1iw1a _16lm1iw18" };
7482
- var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iw13 _16lm1iw15 _16lm1iw1a _16lm1iw18";
7498
+ var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw19 _16lm1iw1b _16lm1iw1g _16lm1iw1e", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw19 _16lm1iw1b _16lm1iw1g _16lm1iw1e" };
7499
+ var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iw19 _16lm1iw1b _16lm1iw1g _16lm1iw1e";
7483
7500
  var LoadMaskTextCls = "qy58ya4";
7484
7501
 
7485
7502
  // src/components/InfiniteTable/components/LoadMask.tsx
@@ -7528,12 +7545,14 @@ function deepClone(source) {
7528
7545
  return target;
7529
7546
  }
7530
7547
 
7531
- // src/utils/groupAndPivot/index.ts
7532
- var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
7533
- var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
7548
+ // src/utils/groupAndPivot/defaultToKey.ts
7534
7549
  function DEFAULT_TO_KEY(value) {
7535
7550
  return value;
7536
7551
  }
7552
+
7553
+ // src/utils/groupAndPivot/index.ts
7554
+ var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
7555
+ var NOT_LOADED_YET_KEY_PREFIX = "____not_loaded_yet____";
7537
7556
  function initReducers(reducers) {
7538
7557
  if (!reducers || !Object.keys(reducers).length) {
7539
7558
  return {};
@@ -7606,6 +7625,14 @@ function lazyGroup(groupParams, rootData) {
7606
7625
  if (currentGroupKeys.length == groupBy.length && groupBy.length) {
7607
7626
  if (current) {
7608
7627
  current.items = dataArray;
7628
+ for (let i = 0, len = currentGroupKeys.length; i < len; i++) {
7629
+ const currentKeys = currentGroupKeys.slice(0, i);
7630
+ const deepMapGroupValue = deepMap.get(currentKeys);
7631
+ if (deepMapGroupValue) {
7632
+ deepMapGroupValue.items = deepMapGroupValue.items || [];
7633
+ deepMapGroupValue.items = deepMapGroupValue.items.concat(dataArray);
7634
+ }
7635
+ }
7609
7636
  indexer.indexArray(dataArray, toPrimaryKey);
7610
7637
  }
7611
7638
  return next == null ? void 0 : next();
@@ -7626,7 +7653,7 @@ function lazyGroup(groupParams, rootData) {
7626
7653
  continue;
7627
7654
  }
7628
7655
  const dataObject = dataArray[i].data;
7629
- const dataKeys = dataArray[i].keys;
7656
+ const dataKeys = dataArray[i].keys || [];
7630
7657
  if (dataKeys.length) {
7631
7658
  const key = dataKeys[dataKeys.length - 1];
7632
7659
  currentGroupKeys.push(key);
@@ -7695,14 +7722,6 @@ function processGroup(deepMap, currentGroupKeys, currentPivotKeys, item, itemInd
7695
7722
  currentPivotKeys.length = 0;
7696
7723
  }
7697
7724
  }
7698
- function getGroupKeysForDataItem(data, groupBy) {
7699
- return groupBy.reduce((groupKeys, groupBy2) => {
7700
- const { field: groupByProperty, toKey: groupToKey } = groupBy2;
7701
- const key = (groupToKey || DEFAULT_TO_KEY)(data[groupByProperty], data);
7702
- groupKeys.push(key);
7703
- return groupKeys;
7704
- }, []);
7705
- }
7706
7725
  function group(groupParams, data) {
7707
7726
  const {
7708
7727
  groupBy,
@@ -7804,7 +7823,7 @@ function flatten(groupResult) {
7804
7823
  }
7805
7824
  function getEnhancedGroupData(options, deepMapValue) {
7806
7825
  var _a;
7807
- const { groupBy, groupKeys, collapsed, parents, reducers, lazyLoad } = options;
7826
+ const { groupBy, groupKeys, parents, reducers, lazyLoad } = options;
7808
7827
  const groupNesting = groupKeys.length;
7809
7828
  const {
7810
7829
  items: groupItems,
@@ -7839,7 +7858,7 @@ function getEnhancedGroupData(options, deepMapValue) {
7839
7858
  selectedChildredCount: 0,
7840
7859
  deselectedChildredCount: 0,
7841
7860
  id: `${groupKeys}`,
7842
- collapsed,
7861
+ collapsed: false,
7843
7862
  dataSourceHasGrouping: true,
7844
7863
  selfLoaded,
7845
7864
  error: options.error,
@@ -7898,7 +7917,7 @@ function enhancedFlatten(param) {
7898
7917
  var _a, _b;
7899
7918
  const items = deepMapValue.items;
7900
7919
  const groupNesting = groupKeys.length;
7901
- const collapsed = (_a = groupRowsState == null ? void 0 : groupRowsState.isGroupRowCollapsed(groupKeys)) != null ? _a : false;
7920
+ let collapsed = (_a = groupRowsState == null ? void 0 : groupRowsState.isGroupRowCollapsed(groupKeys)) != null ? _a : false;
7902
7921
  indexInParentGroups.push(indexInGroup);
7903
7922
  const enhancedGroupData = getEnhancedGroupData({
7904
7923
  lazyLoad,
@@ -7911,11 +7930,10 @@ function enhancedFlatten(param) {
7911
7930
  groupKeys,
7912
7931
  error: deepMapValue.error,
7913
7932
  totalChildrenCount: deepMapValue.totalChildrenCount,
7914
- childrenLoading: deepMapValue.childrenLoading,
7933
+ childrenLoading: (deepMapValue.childrenLoading || !collapsed && !deepMapValue.childrenAvailable) && lazyLoad,
7915
7934
  childrenAvailable: deepMapValue.childrenAvailable,
7916
7935
  directChildrenCount: groupKeys.length === groupByStrings.length ? deepMapValue.items.length : deepMap.getDirectChildrenSizeFor(groupKeys),
7917
- directChildrenLoadedCount: 0,
7918
- collapsed
7936
+ directChildrenLoadedCount: 0
7919
7937
  }, deepMapValue);
7920
7938
  if (isRowSelected) {
7921
7939
  enhancedGroupData.rowSelected = isRowSelected(enhancedGroupData);
@@ -7927,6 +7945,10 @@ function enhancedFlatten(param) {
7927
7945
  }
7928
7946
  const parent = parents[parents.length - 1];
7929
7947
  const parentCollapsed = (_b = parent == null ? void 0 : parent.collapsed) != null ? _b : false;
7948
+ if (parentCollapsed) {
7949
+ collapsed = true;
7950
+ }
7951
+ enhancedGroupData.collapsed = collapsed;
7930
7952
  let include = generateGroupRows || collapsed;
7931
7953
  if (parentCollapsed) {
7932
7954
  include = false;
@@ -7934,27 +7956,16 @@ function enhancedFlatten(param) {
7934
7956
  if (include) {
7935
7957
  result.push(enhancedGroupData);
7936
7958
  }
7937
- if (collapsed) {
7938
- enhancedGroupData.collapsedChildrenCount = enhancedGroupData.groupCount;
7939
- parents.forEach((parent2) => {
7940
- if (!parentCollapsed) {
7941
- parent2.deepRowInfoArray.push(enhancedGroupData);
7942
- }
7943
- parent2.collapsedChildrenCount += enhancedGroupData.groupCount;
7944
- parent2.collapsedGroupsCount += 1;
7945
- });
7946
- } else {
7947
- if (!parentCollapsed) {
7948
- parents.forEach((parent2) => {
7949
- parent2.deepRowInfoArray.push(enhancedGroupData);
7950
- });
7951
- }
7952
- }
7959
+ enhancedGroupData.collapsedChildrenCount = 0;
7960
+ parents.forEach((parent2) => {
7961
+ parent2.deepRowInfoArray.push(enhancedGroupData);
7962
+ parent2.collapsedGroupsCount += collapsed ? 1 : 0;
7963
+ });
7953
7964
  if (parent && enhancedGroupData.selfLoaded && lazyLoad) {
7954
7965
  parent.directChildrenLoadedCount += 1;
7955
7966
  }
7956
7967
  parents.push(enhancedGroupData);
7957
- const continueWithChildren = !collapsed || lazyLoad;
7968
+ const continueWithChildren = true;
7958
7969
  if (continueWithChildren) {
7959
7970
  if (!next) {
7960
7971
  if (!pivot) {
@@ -7992,9 +8003,10 @@ function enhancedFlatten(param) {
7992
8003
  if (last && item) {
7993
8004
  parent2.directChildrenLoadedCount += 1;
7994
8005
  }
7995
- if (!parentCollapsed) {
7996
- parent2.deepRowInfoArray.push(rowInfo);
8006
+ if (collapsed) {
8007
+ parent2.collapsedChildrenCount += 1;
7997
8008
  }
8009
+ parent2.deepRowInfoArray.push(rowInfo);
7998
8010
  });
7999
8011
  if (!collapsed) {
8000
8012
  result[startIndex + index] = rowInfo;
@@ -8660,8 +8672,10 @@ function useLazyLoadRange() {
8660
8672
  const {
8661
8673
  lazyLoadBatchSize,
8662
8674
  lazyLoad,
8675
+ originalLazyGroupDataChangeDetect,
8663
8676
  notifyRenderRangeChange,
8664
8677
  dataArray,
8678
+ groupRowsState,
8665
8679
  scrollStopDelayUpdatedByTable
8666
8680
  } = componentState;
8667
8681
  const latestRenderRangeRef = (0, import_react30.useRef)(null);
@@ -8690,20 +8704,27 @@ function useLazyLoadRange() {
8690
8704
  }, cache);
8691
8705
  };
8692
8706
  const debouncedLoadRange = (0, import_react30.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
8693
- (0, import_react30.useEffect)(() => {
8707
+ useEffectWithChanges((changes) => {
8694
8708
  if (lazyLoad) {
8709
+ if (changes.originalLazyGroupDataChangeDetect || changes.groupRowsState) {
8710
+ loadRange(notifyRenderRangeChange.get());
8711
+ }
8695
8712
  return notifyRenderRangeChange.onChange((renderRange) => {
8696
8713
  latestRenderRangeRef.current = renderRange;
8697
8714
  loadRange(renderRange);
8698
8715
  });
8699
8716
  }
8700
8717
  return;
8701
- }, [lazyLoadBatchSize, lazyLoad]);
8718
+ }, {
8719
+ lazyLoadBatchSize,
8720
+ lazyLoad,
8721
+ originalLazyGroupDataChangeDetect,
8722
+ groupRowsState
8723
+ });
8702
8724
  (0, import_react30.useEffect)(() => {
8703
8725
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
8704
8726
  debouncedLoadRange();
8705
8727
  }
8706
- return;
8707
8728
  }, [dataArray]);
8708
8729
  }
8709
8730
  function lazyLoadRange(options, cache) {
@@ -8793,6 +8814,16 @@ function lazyLoadRange(options, cache) {
8793
8814
  }, initialPromise);
8794
8815
  }
8795
8816
 
8817
+ // src/utils/groupAndPivot/getGroupKeysForDataItem.ts
8818
+ function getGroupKeysForDataItem(data, groupBy) {
8819
+ return groupBy.reduce((groupKeys, groupBy2) => {
8820
+ const { field: groupByProperty, toKey: groupToKey } = groupBy2;
8821
+ const key = (groupToKey || DEFAULT_TO_KEY)(data[groupByProperty], data);
8822
+ groupKeys.push(key);
8823
+ return groupKeys;
8824
+ }, []);
8825
+ }
8826
+
8796
8827
  // src/components/DataSource/RowSelectionState.ts
8797
8828
  var RowSelectionState = class {
8798
8829
  constructor(state, getConfig, _forTestingOnly) {
@@ -8869,8 +8900,8 @@ var RowSelectionState = class {
8869
8900
  getGroupByLength() {
8870
8901
  return this.getConfig().groupBy.length;
8871
8902
  }
8872
- static from(rowSeleStateObject, getConfig, _forTestingOnly) {
8873
- return new RowSelectionState(rowSeleStateObject, getConfig, _forTestingOnly);
8903
+ static from(rowSeleStateObject, getConfig, overrides) {
8904
+ return new RowSelectionState(rowSeleStateObject, getConfig, overrides);
8874
8905
  }
8875
8906
  update(stateObject) {
8876
8907
  var _a, _b;
@@ -9152,7 +9183,8 @@ var RowSelectionState = class {
9152
9183
  if (cachedResult != null) {
9153
9184
  return cachedResult;
9154
9185
  }
9155
- if (groupKeys.length > this.getGroupByLength()) {
9186
+ const groupByLength = this.getGroupByLength();
9187
+ if (groupKeys.length > groupByLength) {
9156
9188
  const result2 = this.isRowSelected(groupKeys) ? { selectedCount: 1, deselectedCount: 0 } : {
9157
9189
  selectedCount: 0,
9158
9190
  deselectedCount: 1
@@ -9160,7 +9192,7 @@ var RowSelectionState = class {
9160
9192
  this.selectionCountCache.set(groupKeys, result2);
9161
9193
  return result2;
9162
9194
  }
9163
- if (this.onlyUsePrimaryKeys) {
9195
+ if (groupByLength && this.onlyUsePrimaryKeys) {
9164
9196
  const allKeys2 = this.getAllPrimaryKeysInsideGroup(groupKeys);
9165
9197
  let selectedCount2 = 0;
9166
9198
  let deselectedCount2 = 0;
@@ -9237,13 +9269,16 @@ var RowSelectionState = class {
9237
9269
  };
9238
9270
 
9239
9271
  // src/components/InfiniteTable/api/getSelectionApi.ts
9272
+ function cloneRowSelection(rowSelection, stateOrGetDataSourceState) {
9273
+ return new RowSelectionState(rowSelection, rowSelectionStateConfigGetter(stateOrGetDataSourceState));
9274
+ }
9240
9275
  function rowSelectionStateConfigGetter(stateOrStateGetter) {
9241
9276
  return () => {
9242
9277
  const state = typeof stateOrStateGetter === "function" ? stateOrStateGetter() : stateOrStateGetter;
9243
9278
  return {
9244
9279
  lazyLoad: !!state.lazyLoad,
9245
9280
  toPrimaryKey: state.toPrimaryKey,
9246
- onlyUsePrimaryKeys: state.usePrimaryKeysForMultiRowSelection,
9281
+ onlyUsePrimaryKeys: !state.useGroupKeysForMultiRowSelection,
9247
9282
  groupBy: state.groupBy,
9248
9283
  groupDeepMap: state.groupDeepMap,
9249
9284
  indexer: state.indexer,
@@ -9565,7 +9600,7 @@ var forwardProps3 = (setupState) => {
9565
9600
  livePagination: 1,
9566
9601
  filterFunction: 1,
9567
9602
  filterValue: 1,
9568
- usePrimaryKeysForMultiRowSelection: (usePrimaryKeysForMultiRowSelection) => usePrimaryKeysForMultiRowSelection != null ? usePrimaryKeysForMultiRowSelection : false,
9603
+ useGroupKeysForMultiRowSelection: (useGroupKeysForMultiRowSelection) => useGroupKeysForMultiRowSelection != null ? useGroupKeysForMultiRowSelection : false,
9569
9604
  filterDelay: (filterDelay) => filterDelay != null ? filterDelay : 200,
9570
9605
  filterTypes: (filterTypes) => {
9571
9606
  return __spreadValues(__spreadValues({}, defaultFilterTypes), filterTypes);
@@ -9579,16 +9614,7 @@ var forwardProps3 = (setupState) => {
9579
9614
  collapseGroupRowsOnDataFunctionChange: (collapseGroupRowsOnDataFunctionChange) => collapseGroupRowsOnDataFunctionChange != null ? collapseGroupRowsOnDataFunctionChange : true,
9580
9615
  loading: (loading) => loading != null ? loading : false,
9581
9616
  sortInfo: (sortInfo) => normalizeSortInfo(sortInfo, setupState.propsCache.get("sortInfo")),
9582
- groupBy: (groupBy) => groupBy != null ? groupBy : [],
9583
- groupRowsState: (groupRowsState) => {
9584
- if (groupRowsState && !(groupRowsState instanceof GroupRowsState)) {
9585
- groupRowsState = new GroupRowsState(groupRowsState);
9586
- }
9587
- return groupRowsState || new GroupRowsState({
9588
- expandedRows: true,
9589
- collapsedRows: []
9590
- });
9591
- }
9617
+ groupBy: (groupBy) => groupBy != null ? groupBy : []
9592
9618
  };
9593
9619
  };
9594
9620
  function getLivePaginationCursorValue(livePaginationCursorProp, state) {
@@ -9647,8 +9673,17 @@ function mapPropsToState(params) {
9647
9673
  }
9648
9674
  const primaryKeyDescriptor = state.primaryKey;
9649
9675
  const toPrimaryKey = typeof primaryKeyDescriptor === "function" ? (data) => primaryKeyDescriptor(data) : (data) => data[primaryKeyDescriptor];
9676
+ let groupRowsState = props.groupRowsState || state.groupRowsState || props.defaultGroupRowsState;
9677
+ if (groupRowsState && !(groupRowsState instanceof GroupRowsState)) {
9678
+ groupRowsState = new GroupRowsState(groupRowsState);
9679
+ }
9680
+ groupRowsState = groupRowsState || new GroupRowsState(state.lazyLoad ? { expandedRows: [], collapsedRows: true } : {
9681
+ expandedRows: true,
9682
+ collapsedRows: []
9683
+ });
9650
9684
  const result = {
9651
9685
  selectionMode,
9686
+ groupRowsState,
9652
9687
  rowSelection: rowSelectionState,
9653
9688
  toPrimaryKey,
9654
9689
  operatorsByFilterType,
@@ -12391,7 +12426,7 @@ var useLicense = (licenseKey = "") => {
12391
12426
  const valid = (0, import_react44.useMemo)(() => {
12392
12427
  let valid2 = isValidLicense(licenseKey, {
12393
12428
  publishedAt: 1624970570587,
12394
- version: "0.4.9"
12429
+ version: "0.4.12"
12395
12430
  });
12396
12431
  if (!licenseKey && !valid2 && isInsidePlayground) {
12397
12432
  return true;
@@ -12726,7 +12761,14 @@ function onCellClick(context, event) {
12726
12761
  updateRowSelectionOnCellClick(context, event);
12727
12762
  }
12728
12763
  function updateRowSelectionOnCellClick(context, event) {
12729
- const { rowIndex, getDataSourceState, getComputed, dataSourceActions, api } = context;
12764
+ const {
12765
+ rowIndex,
12766
+ getDataSourceState,
12767
+ getComputed,
12768
+ dataSourceActions,
12769
+ api,
12770
+ cloneRowSelection: cloneRowSelection2
12771
+ } = context;
12730
12772
  const { multiRowSelector, renderSelectionCheckBox } = getComputed();
12731
12773
  const dataSourceState = getDataSourceState();
12732
12774
  const { selectionMode, groupBy, dataArray } = dataSourceState;
@@ -12738,7 +12780,7 @@ function updateRowSelectionOnCellClick(context, event) {
12738
12780
  return false;
12739
12781
  }
12740
12782
  let { rowSelection: rowSelectionState } = dataSourceState;
12741
- rowSelectionState = new RowSelectionState(rowSelectionState, rowSelectionStateConfigGetter(getDataSourceState));
12783
+ rowSelectionState = cloneRowSelection2(rowSelectionState);
12742
12784
  multiRowSelector.rowSelectionState = rowSelectionState;
12743
12785
  if (rowSelectionState && typeof rowSelectionState === "object") {
12744
12786
  if (event.shiftKey) {
@@ -12768,8 +12810,9 @@ function clamp(value, min, max) {
12768
12810
  }
12769
12811
 
12770
12812
  // src/components/InfiniteTable/eventHandlers/keyboardNavigation.ts
12771
- function handleRowNavigation(options) {
12772
- const { key, getState, getDataSourceState, actions, api } = options;
12813
+ function handleRowNavigation(options, event) {
12814
+ const { getState, getDataSourceState, actions, api } = options;
12815
+ const { key } = event;
12773
12816
  const dataArray = getDataSourceState().dataArray;
12774
12817
  const arrLength = dataArray.length;
12775
12818
  const state = getState();
@@ -12834,16 +12877,15 @@ function handleRowNavigation(options) {
12834
12877
  actions.activeRowIndex = activeRowIndex;
12835
12878
  return true;
12836
12879
  }
12837
- function handleCellNavigation(options) {
12880
+ function handleCellNavigation(options, event) {
12838
12881
  const {
12839
12882
  api,
12840
- key,
12841
- shiftKey,
12842
12883
  getState,
12843
12884
  getComputed,
12844
12885
  getDataSourceState,
12845
12886
  actions
12846
12887
  } = options;
12888
+ const { key, shiftKey } = event;
12847
12889
  const dataArray = getDataSourceState().dataArray;
12848
12890
  const state = getState();
12849
12891
  const { activeCellIndex, brain } = state;
@@ -12933,18 +12975,19 @@ var validKeys = {
12933
12975
  Enter: true,
12934
12976
  " ": true
12935
12977
  };
12936
- function handleKeyboardNavigation(options) {
12978
+ function handleKeyboardNavigation(options, event) {
12979
+ const { key } = event;
12937
12980
  const { getState } = options;
12938
12981
  const state = getState();
12939
12982
  const { activeRowIndex, activeCellIndex, keyboardNavigation } = state;
12940
- if (!validKeys[options.key]) {
12983
+ if (!validKeys[key]) {
12941
12984
  return false;
12942
12985
  }
12943
12986
  if (activeRowIndex != null && keyboardNavigation === "row") {
12944
- return handleRowNavigation(options);
12987
+ return handleRowNavigation(options, event);
12945
12988
  }
12946
12989
  if (activeCellIndex != null && keyboardNavigation === "cell") {
12947
- return handleCellNavigation(options);
12990
+ return handleCellNavigation(options, event);
12948
12991
  }
12949
12992
  return false;
12950
12993
  }
@@ -12955,16 +12998,15 @@ var validKeys2 = {
12955
12998
  " ": true,
12956
12999
  a: true
12957
13000
  };
12958
- function handleKeyboardSelection(context) {
13001
+ function handleKeyboardSelection(context, keyboardEvent) {
12959
13002
  const {
12960
13003
  getState,
12961
13004
  getDataSourceState,
12962
13005
  dataSourceActions,
12963
13006
  api: imperativeApi,
12964
- key,
12965
- ctrlKey,
12966
- metaKey
13007
+ cloneRowSelection: cloneRowSelection2
12967
13008
  } = context;
13009
+ const { key, ctrlKey, metaKey } = keyboardEvent;
12968
13010
  if (!validKeys2[key]) {
12969
13011
  return false;
12970
13012
  }
@@ -12993,21 +13035,21 @@ function handleKeyboardSelection(context) {
12993
13035
  return false;
12994
13036
  }
12995
13037
  if (key === "a" && (ctrlKey || metaKey)) {
12996
- const rowSelectionState = new RowSelectionState(rowSelection, rowSelectionStateConfigGetter(getDataSourceState));
13038
+ const rowSelectionState = cloneRowSelection2(rowSelection);
12997
13039
  rowSelectionState.selectAll();
12998
13040
  dataSourceActions.rowSelection = rowSelectionState;
12999
13041
  return true;
13000
13042
  }
13001
13043
  if (key === " ") {
13002
13044
  if (groupBy.length) {
13003
- if (rowInfo.isGroupRow) {
13045
+ if (rowInfo.isGroupRow && rowInfo.groupKeys) {
13004
13046
  imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.groupKeys);
13005
13047
  } else {
13006
13048
  imperativeApi.selectionApi.toggleRowSelection(rowInfo.id);
13007
13049
  }
13008
13050
  return true;
13009
13051
  } else {
13010
- const event = __spreadValues({}, context);
13052
+ const event = __spreadValues({}, keyboardEvent);
13011
13053
  const { renderSelectionCheckBox } = context.getComputed();
13012
13054
  if (renderSelectionCheckBox) {
13013
13055
  event.metaKey = false;
@@ -13022,15 +13064,14 @@ function handleKeyboardSelection(context) {
13022
13064
  // src/components/InfiniteTable/eventHandlers/onKeyDown.ts
13023
13065
  function onKeyDown(context, event) {
13024
13066
  const keyboardHandlerContext = __spreadProps(__spreadValues({}, context), {
13025
- key: event.key,
13026
- metaKey: event.metaKey,
13027
- ctrlKey: event.ctrlKey,
13028
- shiftKey: event.shiftKey
13067
+ cloneRowSelection: (rowSelection) => {
13068
+ return cloneRowSelection(rowSelection, context.getDataSourceState);
13069
+ }
13029
13070
  });
13030
- if (handleKeyboardSelection(keyboardHandlerContext)) {
13071
+ if (handleKeyboardSelection(keyboardHandlerContext, event)) {
13031
13072
  event.preventDefault();
13032
13073
  }
13033
- if (handleKeyboardNavigation(keyboardHandlerContext)) {
13074
+ if (handleKeyboardNavigation(keyboardHandlerContext, event)) {
13034
13075
  event.preventDefault();
13035
13076
  }
13036
13077
  }
@@ -13051,7 +13092,10 @@ function useEventHandlersContext() {
13051
13092
  getState,
13052
13093
  actions,
13053
13094
  getDataSourceState,
13054
- dataSourceActions
13095
+ dataSourceActions,
13096
+ cloneRowSelection: (rowSelection) => {
13097
+ return cloneRowSelection(rowSelection, getDataSourceState);
13098
+ }
13055
13099
  };
13056
13100
  return context2;
13057
13101
  }, [getState, actions, getDataSourceState, dataSourceActions]);
@@ -13061,13 +13105,7 @@ function handleDOMEvents() {
13061
13105
  const context = useEventHandlersContext();
13062
13106
  (0, import_react48.useEffect)(() => {
13063
13107
  const removeOnKeyDown = context.getState().keyDown.onChange((event) => {
13064
- onKeyDown(__spreadProps(__spreadValues({}, context), {
13065
- key: event.key,
13066
- metaKey: event.metaKey,
13067
- ctrlKey: event.ctrlKey,
13068
- shiftKey: event.shiftKey,
13069
- preventDefault: () => event.preventDefault()
13070
- }), event);
13108
+ onKeyDown(context, event);
13071
13109
  });
13072
13110
  function cellClickHandler(cellClickParam) {
13073
13111
  if (!cellClickParam) {
@@ -13081,10 +13119,10 @@ function handleDOMEvents() {
13081
13119
  key: "",
13082
13120
  preventDefault: () => event.preventDefault()
13083
13121
  };
13084
- onCellClick(__spreadValues(__spreadProps(__spreadValues({}, context), {
13122
+ onCellClick(__spreadProps(__spreadValues({}, context), {
13085
13123
  rowIndex: cellClickParam.rowIndex,
13086
13124
  colIndex: cellClickParam.colIndex
13087
- }), virtualEvent), virtualEvent);
13125
+ }), virtualEvent);
13088
13126
  }
13089
13127
  const removeOnCellClick = context.getState().cellClick.onChange(cellClickHandler);
13090
13128
  return () => {
@@ -13279,8 +13317,244 @@ InfiniteTable.defaultProps = {
13279
13317
  columnHeaderHeight: toCSSVarName(columnHeaderHeightName)
13280
13318
  };
13281
13319
 
13320
+ // src/components/Menu/index.tsx
13321
+ var React39 = __toModule(require("react"));
13322
+ var import_react49 = __toModule(require("react"));
13323
+
13324
+ // src/components/Menu/MenuCls.css.ts
13325
+ var import_createRuntimeFn7 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
13326
+ var MenuCls = "db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw13 _16lm1iw1j _16lm1iw7";
13327
+ var MenuItemCls = (0, import_createRuntimeFn7.createRuntimeFn)({ defaultClassName: "db3arf2 _16lm1iww _16lm1iw1n _16lm1iw14", variantClassNames: { disabled: { true: "db3arf3 _16lm1iwg _16lm1iw14", false: "_16lm1iwf" }, hover: { true: "db3arf5", false: "db3arf6" }, pressed: { false: "db3arf7", true: "db3arf8" }, active: { true: "db3arf9", false: "db3arfa" } }, defaultVariants: {}, compoundVariants: [[{ pressed: true, hover: true }, "db3arfb"]] });
13328
+ var MenuRowCls = "_16lm1iwx";
13329
+ var MenuSeparatorCls = "db3arfc";
13330
+
13331
+ // src/components/Menu/index.tsx
13332
+ var SEPARATOR = "-";
13333
+ function MenuSeparator() {
13334
+ return /* @__PURE__ */ React39.createElement("hr", {
13335
+ className: MenuSeparatorCls
13336
+ });
13337
+ }
13338
+ var toRuntimeItem = ({ columns, activeItemKey }, item) => {
13339
+ const menuItem = item && (item.key != null || item.label != null) ? item : null;
13340
+ const menuDecoration = menuItem === null ? item === SEPARATOR ? /* @__PURE__ */ React39.createElement(MenuSeparator, null) : item : null;
13341
+ const runtimeItem = menuItem != null ? {
13342
+ type: "item",
13343
+ disabled: !!menuItem.disabled,
13344
+ active: menuItem.key === activeItemKey,
13345
+ value: menuItem,
13346
+ span: menuItem.span || 1,
13347
+ key: menuItem.key,
13348
+ menu: menuItem.menu || null
13349
+ } : {
13350
+ type: "decoration",
13351
+ value: menuDecoration,
13352
+ span: columns.length,
13353
+ style: {
13354
+ gridColumnStart: 1,
13355
+ gridColumnEnd: columns.length + 10
13356
+ }
13357
+ };
13358
+ return runtimeItem;
13359
+ };
13360
+ function childrenToRuntimeItems(context, children) {
13361
+ return React39.Children.map(children, (child) => {
13362
+ if (child == null ? void 0 : child.props.__is_menu_item) {
13363
+ const itemProps = __spreadValues({}, child.props);
13364
+ if (!itemProps.key) {
13365
+ itemProps.key = child.key;
13366
+ }
13367
+ if (!itemProps.description) {
13368
+ itemProps.description = child.props.children;
13369
+ }
13370
+ if (!itemProps.label) {
13371
+ itemProps.label = itemProps.children;
13372
+ }
13373
+ return toRuntimeItem(context, itemProps);
13374
+ }
13375
+ return toRuntimeItem(context, child);
13376
+ }) || [];
13377
+ }
13378
+ var defaultColumns = [
13379
+ {
13380
+ name: "label"
13381
+ }
13382
+ ];
13383
+ function Menu(props) {
13384
+ const _a = props, {
13385
+ children,
13386
+ items,
13387
+ columns: cols,
13388
+ addSubmenuColumnIfNeeded
13389
+ } = _a, domProps = __objRest(_a, [
13390
+ "children",
13391
+ "items",
13392
+ "columns",
13393
+ "addSubmenuColumnIfNeeded"
13394
+ ]);
13395
+ const [activeItemKey, setActiveItemKey] = (0, import_react49.useState)(null);
13396
+ const columns = cols || defaultColumns;
13397
+ let runtimeItems = [];
13398
+ let renderedChildren = null;
13399
+ const context = { columns, activeItemKey };
13400
+ if (items) {
13401
+ runtimeItems = items.map(toRuntimeItem.bind(null, context));
13402
+ } else if (!items && typeof children !== "function") {
13403
+ runtimeItems = childrenToRuntimeItems(context, children);
13404
+ }
13405
+ if (addSubmenuColumnIfNeeded) {
13406
+ const hasSubmenus = runtimeItems.filter((item) => item.type === "item" && item.menu != null).length > 0;
13407
+ if (hasSubmenus && !columns.find((col) => col.name == "submenu")) {
13408
+ columns.push({
13409
+ name: "submenu",
13410
+ render: ({ domProps: domProps2, item }) => {
13411
+ return item.menu ? /* @__PURE__ */ React39.createElement("div", __spreadValues({}, domProps2), /* @__PURE__ */ React39.createElement(ExpanderIcon, null)) : /* @__PURE__ */ React39.createElement("div", __spreadValues({}, domProps2));
13412
+ }
13413
+ });
13414
+ }
13415
+ }
13416
+ renderedChildren = runtimeItems.map((runtimeItem, index) => /* @__PURE__ */ React39.createElement(RuntimeItemRenderer, {
13417
+ columns,
13418
+ item: runtimeItem,
13419
+ index,
13420
+ onClick: (item) => setActiveItemKey(item.key)
13421
+ }));
13422
+ const gridTemplateColumns = columns.map((col) => {
13423
+ return col.width || (typeof col.flex === "number" ? `${col.flex}fr` : col.flex) || "auto";
13424
+ }).join(" ");
13425
+ const style = __spreadProps(__spreadValues({}, domProps.style), {
13426
+ gridTemplateColumns,
13427
+ gridTemplateRows: runtimeItems.map(() => `auto`).join(" ")
13428
+ });
13429
+ function handleKeydown(event) {
13430
+ const selectableRuntimeItems = runtimeItems.filter((item) => item.type === "item" && !item.disabled);
13431
+ let activeIndex = selectableRuntimeItems.findIndex((runtimeItem) => runtimeItem.key === activeItemKey);
13432
+ let newActiveIndex = activeIndex;
13433
+ const validKeys3 = {
13434
+ ArrowUp: () => {
13435
+ newActiveIndex--;
13436
+ },
13437
+ ArrowDown: () => {
13438
+ newActiveIndex++;
13439
+ },
13440
+ PageUp: () => {
13441
+ newActiveIndex = 0;
13442
+ },
13443
+ PageDown: () => {
13444
+ newActiveIndex = selectableRuntimeItems.length - 1;
13445
+ }
13446
+ };
13447
+ const fn = validKeys3[event.key];
13448
+ if (fn) {
13449
+ fn();
13450
+ }
13451
+ newActiveIndex = clamp(newActiveIndex, 0, selectableRuntimeItems.length - 1);
13452
+ if (newActiveIndex != activeIndex) {
13453
+ setActiveItemKey(selectableRuntimeItems[newActiveIndex].key);
13454
+ }
13455
+ }
13456
+ return /* @__PURE__ */ React39.createElement("div", __spreadProps(__spreadValues({}, domProps), {
13457
+ onKeyDown: (event) => {
13458
+ if (domProps.onKeyDown) {
13459
+ domProps.onKeyDown(event);
13460
+ }
13461
+ handleKeydown(event);
13462
+ },
13463
+ tabIndex: 0,
13464
+ className: join(MenuCls, domProps.className),
13465
+ style
13466
+ }), renderedChildren);
13467
+ }
13468
+ var menuDefaultProps = {
13469
+ addSubmenuColumnIfNeeded: true
13470
+ };
13471
+ Menu.defaultProps = menuDefaultProps;
13472
+ function RuntimeItemRenderer(props) {
13473
+ const [hover, setHover] = React39.useState(false);
13474
+ const [pressed, setPressed] = React39.useState(false);
13475
+ const { columns, item, index } = props;
13476
+ const key = item.type === "item" ? item.value.key : index;
13477
+ let content = null;
13478
+ if (item.type === "decoration") {
13479
+ content = /* @__PURE__ */ React39.createElement("div", {
13480
+ style: item.style
13481
+ }, item.value);
13482
+ } else {
13483
+ let spanIndex = 0;
13484
+ content = columns.map((col, i) => {
13485
+ const target = item.value;
13486
+ const field = col.field || col.name;
13487
+ const start = i + 1;
13488
+ const end = start + item.span;
13489
+ if (start < spanIndex) {
13490
+ return null;
13491
+ }
13492
+ spanIndex = end;
13493
+ const style = __spreadProps(__spreadValues(__spreadValues({}, col.style), item.style), {
13494
+ gridColumnStart: start,
13495
+ gridColumnEnd: end
13496
+ });
13497
+ const domProps = {
13498
+ style,
13499
+ className: MenuItemCls({
13500
+ hover,
13501
+ disabled: !!item.disabled,
13502
+ active: item.active,
13503
+ pressed
13504
+ }),
13505
+ onMouseEnter: () => {
13506
+ if (!item.disabled) {
13507
+ setHover(true);
13508
+ }
13509
+ },
13510
+ onMouseLeave: () => {
13511
+ if (!item.disabled) {
13512
+ setHover(false);
13513
+ }
13514
+ },
13515
+ onMouseDown: () => {
13516
+ if (!item.disabled) {
13517
+ setPressed(true);
13518
+ }
13519
+ },
13520
+ onMouseUp: () => {
13521
+ if (!item.disabled) {
13522
+ setPressed(false);
13523
+ }
13524
+ },
13525
+ onClick: () => {
13526
+ if (!item.disabled) {
13527
+ props.onClick(item);
13528
+ }
13529
+ }
13530
+ };
13531
+ return col.render ? /* @__PURE__ */ React39.createElement(RenderHookComponent, {
13532
+ render: col.render,
13533
+ renderParam: {
13534
+ item: target,
13535
+ column: col,
13536
+ value: target[field],
13537
+ domProps
13538
+ }
13539
+ }) : /* @__PURE__ */ React39.createElement("div", __spreadValues({
13540
+ key: `${key}-${field}`
13541
+ }, domProps), target[field]);
13542
+ }).filter(Boolean);
13543
+ }
13544
+ return /* @__PURE__ */ React39.createElement("div", {
13545
+ className: MenuRowCls
13546
+ }, content);
13547
+ }
13548
+ function MenuItem(_props) {
13549
+ return null;
13550
+ }
13551
+ MenuItem.defaultProps = {
13552
+ __is_menu_item: true
13553
+ };
13554
+
13282
13555
  // src/index.tsx
13283
13556
  var components = {
13284
13557
  CheckBox: InfiniteCheckBox,
13285
13558
  LoadMask
13286
13559
  };
13560
+ //!collapsed || lazyLoad;