@infinite-table/infinite-react 0.3.2 → 0.3.3

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.
Files changed (6) hide show
  1. package/index.css +76 -50
  2. package/index.d.ts +537 -405
  3. package/index.esm.css +76 -50
  4. package/index.esm.js +1029 -553
  5. package/index.js +1092 -623
  6. package/package.json +2 -2
package/index.js CHANGED
@@ -632,7 +632,12 @@ __export(exports, {
632
632
  InfiniteTable: () => InfiniteTable,
633
633
  InfiniteTableClassName: () => InfiniteTableClassName,
634
634
  InfiniteTableComponent: () => InfiniteTableComponent,
635
+ NumberFilterEditor: () => NumberFilterEditor,
636
+ StringFilterEditor: () => StringFilterEditor,
635
637
  debounce: () => debounce,
638
+ defaultFilterEditors: () => defaultFilterEditors,
639
+ defaultFilterTypes: () => defaultFilterTypes,
640
+ filterTypes: () => defaultFilterTypes,
636
641
  flatten: () => flatten,
637
642
  getComponentStateRoot: () => getComponentStateRoot,
638
643
  group: () => group,
@@ -660,7 +665,7 @@ function debounce(fn, { wait }) {
660
665
  }
661
666
 
662
667
  // src/components/InfiniteTable/index.tsx
663
- var React27 = __toModule(require("react"));
668
+ var React30 = __toModule(require("react"));
664
669
 
665
670
  // src/utils/join.ts
666
671
  var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
@@ -2769,6 +2774,9 @@ var ReactHeadlessTableRenderer = class extends Logger {
2769
2774
  });
2770
2775
  };
2771
2776
  this.onMouseLeave = (rowIndex) => {
2777
+ if (this.currentHoveredRow != -1 && this.currentHoveredRow === rowIndex) {
2778
+ this.removeHoverClass(rowIndex);
2779
+ }
2772
2780
  this.currentHoveredRow = -1;
2773
2781
  if (this.scrolling) {
2774
2782
  return;
@@ -2843,9 +2851,6 @@ var ReactHeadlessTableRenderer = class extends Logger {
2843
2851
  };
2844
2852
  this.onScrollStart = () => {
2845
2853
  this.scrolling = true;
2846
- if (this.currentHoveredRow != -1) {
2847
- this.removeHoverClass(this.currentHoveredRow);
2848
- }
2849
2854
  };
2850
2855
  this.onScrollStop = () => {
2851
2856
  this.scrolling = false;
@@ -3525,6 +3530,7 @@ var cssEllipsisClassName = "_16lm1iw1c _16lm1iw1d _16lm1iw18";
3525
3530
  var cursor = { pointer: "_16lm1iwd" };
3526
3531
  var display = { flex: "_16lm1iwl", block: "_16lm1iwm", inlineBlock: "_16lm1iwn" };
3527
3532
  var flex = { "1": "_16lm1iwe", none: "_16lm1iwf" };
3533
+ var flexFlow = { column: "_16lm1iw11", row: "_16lm1iw12" };
3528
3534
  var justifyContent = { center: "_16lm1iw15", start: "_16lm1iw16", end: "_16lm1iw17" };
3529
3535
  var left = { "0": "_16lm1iwv", "100%": "_16lm1iww" };
3530
3536
  var overflow = { hidden: "_16lm1iw18", auto: "_16lm1iw19", visible: "_16lm1iw1a" };
@@ -3536,23 +3542,133 @@ var zIndex = { "1": "_16lm1iwg", "10": "_16lm1iwh", "1000": "_16lm1iwi", "10000"
3536
3542
 
3537
3543
  // src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
3538
3544
  var InfiniteTableBody = React12.forwardRef(function InfiniteTableBody2(props, ref) {
3539
- const { rootClassName: rootClassName8 } = useInternalProps();
3545
+ const { rootClassName: rootClassName9 } = useInternalProps();
3540
3546
  return /* @__PURE__ */ React12.createElement("div", __spreadProps(__spreadValues({
3541
3547
  ref
3542
3548
  }, props), {
3543
- className: join(`${rootClassName8}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
3549
+ className: join(`${rootClassName9}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
3550
+ }));
3551
+ });
3552
+
3553
+ // src/components/InfiniteTable/components/InfiniteTableFooter/InfiniteTableFooter.tsx
3554
+ var React13 = __toModule(require("react"));
3555
+ var InfiniteTableFooter = React13.forwardRef(function InfiniteTableFooter2(props, ref) {
3556
+ const { rootClassName: rootClassName9 } = useInternalProps();
3557
+ return /* @__PURE__ */ React13.createElement("div", __spreadProps(__spreadValues({
3558
+ ref
3559
+ }, props), {
3560
+ className: join(`${rootClassName9}Footer`, position.relative, display.flex, flexFlow.row, props.className)
3544
3561
  }));
3545
3562
  });
3546
3563
 
3547
3564
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
3548
- var React15 = __toModule(require("react"));
3565
+ var React18 = __toModule(require("react"));
3566
+ var import_react19 = __toModule(require("react"));
3549
3567
  var import_react_dom = __toModule(require("react-dom"));
3550
- var import_react17 = __toModule(require("react"));
3551
3568
 
3552
- // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
3553
- var React13 = __toModule(require("react"));
3569
+ // src/components/DataSource/defaultFilterTypes.ts
3570
+ function getFilterTypes() {
3571
+ const result = {
3572
+ string: {
3573
+ label: "Text",
3574
+ emptyValues: new Set([""]),
3575
+ defaultOperator: "contains",
3576
+ operators: [
3577
+ {
3578
+ name: "contains",
3579
+ fn: ({ currentValue, filterValue, emptyValues }) => {
3580
+ if (emptyValues.has(currentValue) || emptyValues.has(filterValue)) {
3581
+ return true;
3582
+ }
3583
+ return typeof currentValue === "string" && typeof filterValue == "string" && currentValue.toLowerCase().includes(filterValue.toLowerCase());
3584
+ }
3585
+ },
3586
+ {
3587
+ name: "eq",
3588
+ fn: ({ currentValue: value, filterValue, emptyValues }) => {
3589
+ if (emptyValues.has(value) || emptyValues.has(filterValue)) {
3590
+ return true;
3591
+ }
3592
+ return typeof value === "string" && value === filterValue;
3593
+ }
3594
+ }
3595
+ ]
3596
+ },
3597
+ number: {
3598
+ label: "Number",
3599
+ emptyValues: new Set(["", null, void 0]),
3600
+ defaultOperator: "eq",
3601
+ operators: [
3602
+ {
3603
+ name: "eq",
3604
+ fn: ({ currentValue, filterValue, emptyValues }) => {
3605
+ if (emptyValues.has(currentValue) || emptyValues.has(filterValue)) {
3606
+ return true;
3607
+ }
3608
+ return currentValue == filterValue;
3609
+ }
3610
+ },
3611
+ {
3612
+ name: "between",
3613
+ fn: ({ currentValue, filterValue, emptyValues }) => {
3614
+ if (emptyValues.has(currentValue) || emptyValues.has(filterValue)) {
3615
+ return true;
3616
+ }
3617
+ const [min, max] = filterValue;
3618
+ return currentValue >= min && currentValue <= max;
3619
+ }
3620
+ }
3621
+ ]
3622
+ }
3623
+ };
3624
+ return result;
3625
+ }
3626
+ var defaultFilterTypes = getFilterTypes();
3554
3627
 
3555
- // src/components/InfiniteTable/hooks/useInfiniteTableState.ts
3628
+ // src/components/InfiniteTable/hooks/useCellClassName.ts
3629
+ function useCellClassName(column, baseClasses, variants, extraFlags) {
3630
+ const result = [...baseClasses];
3631
+ const variantObject = {
3632
+ filtered: column.computedFiltered,
3633
+ first: column.computedFirst,
3634
+ last: column.computedLast,
3635
+ groupByField: !!column.groupByField,
3636
+ firstInCategory: column.computedFirstInCategory,
3637
+ lastInCategory: column.computedLastInCategory,
3638
+ pinned: column.computedPinned || false,
3639
+ dragging: extraFlags.dragging,
3640
+ zebra: extraFlags.zebra
3641
+ };
3642
+ const theVariant = variants(variantObject);
3643
+ result.push(theVariant);
3644
+ if (column.computedFirst) {
3645
+ result.push(...baseClasses.map((c) => `${c}--first`));
3646
+ }
3647
+ if (column.groupByField) {
3648
+ result.push(...baseClasses.map((c) => `${c}--group-column`));
3649
+ }
3650
+ if (column.computedLast) {
3651
+ result.push(...baseClasses.map((c) => `${c}--last`));
3652
+ }
3653
+ if (column.computedFirstInCategory) {
3654
+ result.push(...baseClasses.map((c) => `${c}--first-in-category`));
3655
+ }
3656
+ if (column.computedLastInCategory) {
3657
+ result.push(...baseClasses.map((c) => `${c}--last-in-category`));
3658
+ }
3659
+ if (column.computedPinned) {
3660
+ result.push(...baseClasses.map((c) => `${c}--pinned-${column.computedPinned}`));
3661
+ } else {
3662
+ result.push(...baseClasses.map((c) => `${c}--unpinned`));
3663
+ }
3664
+ return result.filter(Boolean).join(" ");
3665
+ }
3666
+
3667
+ // src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
3668
+ var import_binary_search2 = __toModule(require_binary_search());
3669
+ var import_react14 = __toModule(require("react"));
3670
+
3671
+ // src/components/InfiniteTable/hooks/useInfiniteTable.ts
3556
3672
  var import_react13 = __toModule(require("react"));
3557
3673
 
3558
3674
  // src/components/InfiniteTable/InfiniteTableContext.ts
@@ -3565,96 +3681,10 @@ function getInfiniteTableContext() {
3565
3681
  return TableContext = (0, import_react12.createContext)(null);
3566
3682
  }
3567
3683
 
3568
- // src/components/InfiniteTable/hooks/useInfiniteTableState.ts
3569
- var useInfiniteTableState = () => {
3570
- const TableContext2 = getInfiniteTableContext();
3571
- const { componentState } = (0, import_react13.useContext)(TableContext2);
3572
- return componentState;
3573
- };
3574
-
3575
- // src/components/InfiniteTable/components/cell.css.ts
3576
- var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
3577
- var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
3578
- var ColumnCellCls = "_1eexc2a5 _16lm1iwl _16lm1iw12 _16lm1iw13 _16lm1iw2 _16lm1iw1b _16lm1iw1c";
3579
- var ColumnCellRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1eexc2a7", variantClassNames: { dragging: { false: "_1eexc2a8", true: "_1eexc2a9" }, zebra: { false: "_1eexc2aa", even: "_1eexc2ab", odd: "_1eexc2ac" }, first: { true: "_1eexc2ad", false: "_1eexc2ae" }, last: { true: "_1eexc2af", false: "_1eexc2ag" }, groupByField: { true: "_1eexc2ah", false: "_1eexc2ai" }, firstInCategory: { true: "_1eexc2aj", false: "_1eexc2ak" }, lastInCategory: { true: "_1eexc2al", false: "_1eexc2am" }, pinned: { start: "_1eexc2an", end: "_1eexc2ao", false: "_1eexc2ap" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2aq"], [{ pinned: "end", firstInCategory: true }, "_1eexc2ar"]] });
3580
- var columnAlignCellStyle = { center: "_1eexc2a0", start: "_1eexc2a1", end: "_1eexc2a2" };
3581
-
3582
- // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
3583
- var { rootClassName: rootClassName3 } = internalProps;
3584
- var InfiniteTableCellClassName = `${rootClassName3}Cell`;
3585
- var InfiniteTableCellContentClassName = `${rootClassName3}Cell_content`;
3586
- function InfiniteTableCellFn(props) {
3587
- var _b, _c, _d, _e;
3588
- const _a = props, {
3589
- cssEllipsis = true,
3590
- virtualized = true,
3591
- skipColumnShifting = false,
3592
- offsetProperty = "left",
3593
- column,
3594
- domRef,
3595
- width,
3596
- afterChildren,
3597
- beforeChildren,
3598
- offset,
3599
- cellType,
3600
- cssPosition: _cssPosition,
3601
- renderChildren
3602
- } = _a, domProps = __objRest(_a, [
3603
- "cssEllipsis",
3604
- "virtualized",
3605
- "skipColumnShifting",
3606
- "offsetProperty",
3607
- "column",
3608
- "domRef",
3609
- "width",
3610
- "afterChildren",
3611
- "beforeChildren",
3612
- "offset",
3613
- "cellType",
3614
- "cssPosition",
3615
- "renderChildren"
3616
- ]);
3617
- const children = renderChildren();
3618
- const { columnShifts } = useInfiniteTableState();
3619
- const shifting = !!columnShifts;
3620
- const style = __spreadValues({
3621
- width
3622
- }, domProps.style);
3623
- if (!skipColumnShifting && columnShifts && columnShifts[column.computedVisibleIndex]) {
3624
- const shiftLeft = columnShifts[column.computedVisibleIndex] + (offset != null ? offset : 0);
3625
- if (virtualized) {
3626
- style.left = shiftLeft;
3627
- } else {
3628
- style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
3629
- }
3630
- }
3631
- const finalDOMProps = __spreadProps(__spreadValues({}, domProps), {
3632
- style,
3633
- "data-column-id": column.id,
3634
- className: join(domProps.className, columnAlignCellStyle[(_b = column.align) != null ? _b : "start"], justifyContent[(_c = column.align) != null ? _c : "start"], InfiniteTableCellClassName, ColumnCellCls, shifting ? `${InfiniteTableCellClassName}--shifting ${CellClsVariants.shifting}` : ""),
3635
- children: /* @__PURE__ */ React13.createElement(React13.Fragment, null, beforeChildren, /* @__PURE__ */ React13.createElement("div", {
3636
- className: `${InfiniteTableCellContentClassName} ${cssEllipsis ? cssEllipsisClassName : overflow.hidden}`
3637
- }, children), afterChildren)
3638
- });
3639
- const RenderComponent = cellType === "body" ? (_d = column.components) == null ? void 0 : _d.ColumnCell : (_e = column.components) == null ? void 0 : _e.HeaderCell;
3640
- if (RenderComponent) {
3641
- return /* @__PURE__ */ React13.createElement(RenderComponent, __spreadValues({}, finalDOMProps));
3642
- }
3643
- return /* @__PURE__ */ React13.createElement("div", __spreadProps(__spreadValues({}, finalDOMProps), {
3644
- ref: domRef
3645
- }));
3646
- }
3647
- var InfiniteTableCell = React13.memo(InfiniteTableCellFn);
3648
-
3649
- // src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
3650
- var import_binary_search2 = __toModule(require_binary_search());
3651
- var import_react15 = __toModule(require("react"));
3652
-
3653
3684
  // src/components/InfiniteTable/hooks/useInfiniteTable.ts
3654
- var import_react14 = __toModule(require("react"));
3655
3685
  var useInfiniteTable = () => {
3656
3686
  const TableContext2 = getInfiniteTableContext();
3657
- return (0, import_react14.useContext)(TableContext2);
3687
+ return (0, import_react13.useContext)(TableContext2);
3658
3688
  };
3659
3689
 
3660
3690
  // src/components/InfiniteTable/utils/moveXatY.ts
@@ -3689,18 +3719,18 @@ var useColumnPointerEvents = ({
3689
3719
  columns,
3690
3720
  computedRemainingSpace
3691
3721
  }) => {
3692
- const [draggingDiff, setDraggingDiff] = (0, import_react15.useState)(null);
3693
- const [proxyOffset, setProxyOffset] = (0, import_react15.useState)(null);
3694
- const breakpointsRef = (0, import_react15.useRef)([]);
3695
- const pointerMoveRef = (0, import_react15.useRef)(null);
3696
- const didDragRef = (0, import_react15.useRef)(false);
3697
- const initialClientPos = (0, import_react15.useRef)(null);
3698
- const currentDropIndexRef = (0, import_react15.useRef)(null);
3722
+ const [draggingDiff, setDraggingDiff] = (0, import_react14.useState)(null);
3723
+ const [proxyOffset, setProxyOffset] = (0, import_react14.useState)(null);
3724
+ const breakpointsRef = (0, import_react14.useRef)([]);
3725
+ const pointerMoveRef = (0, import_react14.useRef)(null);
3726
+ const didDragRef = (0, import_react14.useRef)(false);
3727
+ const initialClientPos = (0, import_react14.useRef)(null);
3728
+ const currentDropIndexRef = (0, import_react14.useRef)(null);
3699
3729
  const dragging = draggingDiff != null;
3700
3730
  const { componentActions, computed } = useInfiniteTable();
3701
3731
  const { computedColumnOrder } = computed;
3702
- const column = (0, import_react15.useMemo)(() => columns.get(columnId), [columnId, columns]);
3703
- const { columnIndex, columnWidth, columnsArray } = (0, import_react15.useMemo)(() => {
3732
+ const column = (0, import_react14.useMemo)(() => columns.get(columnId), [columnId, columns]);
3733
+ const { columnIndex, columnWidth, columnsArray } = (0, import_react14.useMemo)(() => {
3704
3734
  const columnsArray2 = Array.from(columns.values());
3705
3735
  return {
3706
3736
  columnsArray: columnsArray2,
@@ -3708,8 +3738,8 @@ var useColumnPointerEvents = ({
3708
3738
  columnWidth: column.computedWidth
3709
3739
  };
3710
3740
  }, [columns, columnId, column]);
3711
- let cursorRef = (0, import_react15.useRef)("auto");
3712
- const onPointerDown = (0, import_react15.useCallback)((e) => {
3741
+ let cursorRef = (0, import_react14.useRef)("auto");
3742
+ const onPointerDown = (0, import_react14.useCallback)((e) => {
3713
3743
  const target = domRef.current;
3714
3744
  cursorRef.current = target.style.cursor;
3715
3745
  didDragRef.current = false;
@@ -3772,7 +3802,7 @@ var useColumnPointerEvents = ({
3772
3802
  target.addEventListener("pointermove", onPointerMove);
3773
3803
  target.setPointerCapture(e.pointerId);
3774
3804
  }, [columns, column, columnIndex, columnsArray, computedRemainingSpace]);
3775
- const onPointerUp = (0, import_react15.useCallback)((e) => {
3805
+ const onPointerUp = (0, import_react14.useCallback)((e) => {
3776
3806
  const target = domRef.current;
3777
3807
  target.style.cursor = cursorRef.current;
3778
3808
  target.releasePointerCapture(e.pointerId);
@@ -3805,47 +3835,69 @@ var useColumnPointerEvents = ({
3805
3835
  };
3806
3836
  };
3807
3837
 
3808
- // src/components/InfiniteTable/hooks/useCellClassName.ts
3809
- function useCellClassName(column, baseClasses, variants, extraFlags) {
3810
- const result = [...baseClasses];
3811
- const variantObject = {
3812
- first: column.computedFirst,
3813
- last: column.computedLast,
3814
- groupByField: !!column.groupByField,
3815
- firstInCategory: column.computedFirstInCategory,
3816
- lastInCategory: column.computedLastInCategory,
3817
- pinned: column.computedPinned || false,
3818
- dragging: extraFlags.dragging,
3819
- zebra: extraFlags.zebra
3838
+ // src/components/InfiniteTable/utils/RenderHookComponent.tsx
3839
+ function RenderHookComponent(props) {
3840
+ var _a;
3841
+ return (_a = props.render(props.renderParam)) != null ? _a : null;
3842
+ }
3843
+
3844
+ // src/components/InfiniteTable/components/FilterEditors.tsx
3845
+ var import_react15 = __toModule(require("react"));
3846
+ function getFilterEditors() {
3847
+ return {
3848
+ string: StringFilterEditor,
3849
+ number: NumberFilterEditor
3820
3850
  };
3821
- const theVariant = variants(variantObject);
3822
- result.push(theVariant);
3823
- if (column.computedFirst) {
3824
- result.push(...baseClasses.map((c) => `${c}--first`));
3825
- }
3826
- if (column.groupByField) {
3827
- result.push(...baseClasses.map((c) => `${c}--group-column`));
3828
- }
3829
- if (column.computedLast) {
3830
- result.push(...baseClasses.map((c) => `${c}--last`));
3831
- }
3832
- if (column.computedFirstInCategory) {
3833
- result.push(...baseClasses.map((c) => `${c}--first-in-category`));
3834
- }
3835
- if (column.computedLastInCategory) {
3836
- result.push(...baseClasses.map((c) => `${c}--last-in-category`));
3837
- }
3838
- if (column.computedPinned) {
3839
- result.push(...baseClasses.map((c) => `${c}--pinned-${column.computedPinned}`));
3840
- } else {
3841
- result.push(...baseClasses.map((c) => `${c}--unpinned`));
3842
- }
3843
- return result.filter(Boolean).join(" ");
3851
+ }
3852
+ var defaultFilterEditors = getFilterEditors();
3853
+ function StringFilterEditor(props) {
3854
+ return /* @__PURE__ */ import_react15.default.createElement("input", {
3855
+ "aria-label": `Filter for ${props.ariaLabel}`,
3856
+ type: "text",
3857
+ value: props.filterValue,
3858
+ onChange: (event) => {
3859
+ props.onChange(event.target.value);
3860
+ },
3861
+ className: props.className
3862
+ });
3863
+ }
3864
+ function NumberFilterEditor(props) {
3865
+ return /* @__PURE__ */ import_react15.default.createElement("input", {
3866
+ "aria-label": `Filter for ${props.ariaLabel}`,
3867
+ type: "number",
3868
+ value: props.filterValue,
3869
+ onChange: (event) => {
3870
+ let value = event.target.value;
3871
+ if (!isNaN(value + "")) {
3872
+ value = value + "";
3873
+ }
3874
+ props.onChange(value);
3875
+ },
3876
+ className: props.className
3877
+ });
3844
3878
  }
3845
3879
 
3846
3880
  // src/components/InfiniteTable/components/icons/SortIcon.tsx
3847
- var React14 = __toModule(require("react"));
3881
+ var React15 = __toModule(require("react"));
3848
3882
  var import_react16 = __toModule(require("react"));
3883
+
3884
+ // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
3885
+ var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
3886
+ var CellCls = "_1eexc2a5 _16lm1iwl _16lm1iw12 _16lm1iw13 _16lm1iw2 _16lm1iw1b _16lm1iw1c";
3887
+ var HeaderCellContentRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob115 _16lm1iwq _16lm1iws _16lm1iwl _16lm1iw12 _16lm1iw13", variantClassNames: { filtered: { false: "_12zfob116", true: "_12zfob117" } }, defaultVariants: {}, compoundVariants: [] });
3888
+ var HeaderCellProxy = "_12zfob10";
3889
+ var HeaderCellRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob1h _16lm1iwm", variantClassNames: { zebra: { false: "_12zfob1i", even: "_12zfob1j", odd: "_12zfob1k" }, dragging: { true: "_12zfob1l", false: "_12zfob1m" }, first: { true: "_12zfob1n", false: "_12zfob1o" }, last: { true: "_12zfob1p", false: "_12zfob1q" }, groupByField: { true: "_12zfob1r", false: "_12zfob1s" }, firstInCategory: { true: "_12zfob1t", false: "_12zfob1u" }, lastInCategory: { true: "_12zfob1v", false: "_12zfob1w" }, pinned: { start: "_12zfob1x", end: "_12zfob1y", false: "_12zfob1z" }, filtered: { true: "_12zfob110", false: "_12zfob111" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob112"], [{ pinned: "end", firstInCategory: true }, "_12zfob113"], [{ pinned: false, lastInCategory: true }, "_12zfob114"]] });
3890
+ var HeaderClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob17 _16lm1iwm _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob18", end: "_12zfob19", false: "_12zfob1a" }, virtualized: { true: "_12zfob1b", false: "_12zfob1c" }, overflow: { true: "_12zfob1d", false: "_12zfob1e" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1f"], [{ overflow: true, pinned: "end" }, "_12zfob1g"]] });
3891
+ var HeaderFilterCls = "_12zfob11a _16lm1iwl _16lm1iw12 _16lm1iw13 _16lm1iw1";
3892
+ var HeaderFilterEditorCls = "_16lm1iws _16lm1iwq";
3893
+ var HeaderGroupCls = "_12zfob119 _16lm1iwl _16lm1iw12 _16lm1iw13";
3894
+ var HeaderScrollbarPlaceholderCls = "_12zfob16 _16lm1iw2";
3895
+ var HeaderSortIconCls = "_16lm1iw1";
3896
+ var HeaderSortIconIndexCls = "_12zfob15";
3897
+ var HeaderSortIconRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob12", center: "_12zfob13", end: "_12zfob14" } }, defaultVariants: {}, compoundVariants: [] });
3898
+ var HeaderWrapperCls = "_12zfob118 _16lm1iw18 _16lm1iw1 _16lm1iwl _16lm1iw12";
3899
+
3900
+ // src/components/InfiniteTable/components/icons/SortIcon.tsx
3849
3901
  var defaultLineStyle = {
3850
3902
  marginTop: 2,
3851
3903
  marginBottom: 2,
@@ -3890,91 +3942,225 @@ function SortIcon(props) {
3890
3942
  if (!rendered) {
3891
3943
  return null;
3892
3944
  }
3893
- const indexStyle = {
3894
- position: "absolute",
3895
- transition: "top 0.2s",
3896
- top: 0,
3897
- right: 2
3898
- };
3945
+ const indexStyle = {};
3899
3946
  if (direction === -1) {
3900
3947
  indexStyle.top = "100%";
3901
3948
  }
3902
- return /* @__PURE__ */ React14.createElement("div", {
3949
+ return /* @__PURE__ */ React15.createElement("div", {
3903
3950
  style: __spreadProps(__spreadValues({}, style), { width: size }),
3904
3951
  className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
3905
- }, showIndex ? /* @__PURE__ */ React14.createElement("div", {
3952
+ }, showIndex ? /* @__PURE__ */ React15.createElement("div", {
3906
3953
  "data-name": "index",
3907
- style: indexStyle
3908
- }, index) : null, /* @__PURE__ */ React14.createElement("div", {
3954
+ style: indexStyle,
3955
+ className: HeaderSortIconIndexCls
3956
+ }, index) : null, /* @__PURE__ */ React15.createElement("div", {
3909
3957
  style: __spreadValues({ width: sizes[0] }, lineStyle),
3910
3958
  onTransitionEnd
3911
- }), /* @__PURE__ */ React14.createElement("div", {
3959
+ }), /* @__PURE__ */ React15.createElement("div", {
3912
3960
  style: __spreadValues({ width: sizes[1] }, lineStyle)
3913
- }), /* @__PURE__ */ React14.createElement("div", {
3961
+ }), /* @__PURE__ */ React15.createElement("div", {
3914
3962
  style: __spreadValues({ width: sizes[2] }, lineStyle)
3915
3963
  }));
3916
3964
  }
3917
3965
 
3918
- // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
3919
- var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
3920
- var CellCls = "_1eexc2a5 _16lm1iwl _16lm1iw12 _16lm1iw13 _16lm1iw2 _16lm1iw1b _16lm1iw1c";
3921
- var HeaderCellProxy = "_12zfob10";
3922
- var HeaderCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob1d", variantClassNames: { zebra: { false: "_12zfob1e", even: "_12zfob1f", odd: "_12zfob1g" }, dragging: { true: "_12zfob1h", false: "_12zfob1i" }, first: { true: "_12zfob1j", false: "_12zfob1k" }, last: { true: "_12zfob1l", false: "_12zfob1m" }, groupByField: { true: "_12zfob1n", false: "_12zfob1o" }, firstInCategory: { true: "_12zfob1p", false: "_12zfob1q" }, lastInCategory: { true: "_12zfob1r", false: "_12zfob1s" }, pinned: { start: "_12zfob1t", end: "_12zfob1u", false: "_12zfob1v" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob1w"], [{ pinned: "end", firstInCategory: true }, "_12zfob1x"], [{ pinned: false, lastInCategory: true }, "_12zfob1y"]] });
3923
- var HeaderClsRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_12zfob13 _16lm1iw12 _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob14", end: "_12zfob15", false: "_12zfob16" }, virtualized: { true: "_12zfob17", false: "_12zfob18" }, overflow: { true: "_12zfob19", false: "_12zfob1a" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1b"], [{ overflow: true, pinned: "end" }, "_12zfob1c"]] });
3924
- var HeaderGroupCls = "_12zfob110 _16lm1iwl _16lm1iw12 _16lm1iw13";
3925
- var HeaderScrollbarPlaceholderCls = "_12zfob12 _16lm1iw2";
3926
- var HeaderSortIconCls = "_12zfob11 _16lm1iw1";
3927
- var HeaderWrapperCls = "_12zfob1z _16lm1iw18 _16lm1iw1 _16lm1iwl _16lm1iw12";
3966
+ // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
3967
+ var React16 = __toModule(require("react"));
3928
3968
 
3929
- // src/components/InfiniteTable/utils/RenderHookComponent.tsx
3930
- function RenderHookComponent(props) {
3931
- var _a;
3932
- return (_a = props.render(props.renderParam)) != null ? _a : null;
3933
- }
3969
+ // src/components/InfiniteTable/hooks/useInfiniteTableState.ts
3970
+ var import_react17 = __toModule(require("react"));
3971
+ var useInfiniteTableState = () => {
3972
+ const TableContext2 = getInfiniteTableContext();
3973
+ const { componentState } = (0, import_react17.useContext)(TableContext2);
3974
+ return componentState;
3975
+ };
3934
3976
 
3935
- // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
3936
- var InfiniteTableHeaderCellContext = React15.createContext(null);
3937
- var { rootClassName: rootClassName4 } = internalProps;
3938
- var InfiniteTableHeaderCellClassName = `${rootClassName4}HeaderCell`;
3939
- function InfiniteTableHeaderCell(props) {
3940
- var _a, _b, _c, _d;
3941
- const column = props.column;
3942
- const columns = props.columns;
3943
- const { onResize, height, width } = props;
3944
- const sortInfo = column.computedSortInfo;
3945
- let header = column.header;
3946
- const ref = (0, import_react17.useCallback)((node) => {
3947
- var _a2;
3948
- domRef.current = node;
3949
- (_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
3950
- }, [props.domRef]);
3951
- const sortTool = /* @__PURE__ */ React15.createElement(SortIcon, {
3952
- index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
3953
- className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls}`,
3954
- direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
3955
- });
3956
- const renderParam = {
3957
- domRef: ref,
3958
- column,
3959
- columnSortInfo: sortInfo,
3960
- sortTool
3961
- };
3962
- const renderChildren = () => {
3963
- if (header instanceof Function) {
3964
- header = /* @__PURE__ */ React15.createElement(RenderHookComponent, {
3965
- render: header,
3966
- renderParam
3967
- });
3977
+ // src/components/InfiniteTable/components/cell.css.ts
3978
+ var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
3979
+ var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
3980
+ var ColumnCellCls = "_1eexc2a5 _16lm1iwl _16lm1iw12 _16lm1iw13 _16lm1iw2 _16lm1iw1b _16lm1iw1c";
3981
+ var ColumnCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_1eexc2a7", variantClassNames: { dragging: { false: "_1eexc2a8", true: "_1eexc2a9" }, zebra: { false: "_1eexc2aa", even: "_1eexc2ab", odd: "_1eexc2ac" }, first: { true: "_1eexc2ad", false: "_1eexc2ae" }, last: { true: "_1eexc2af", false: "_1eexc2ag" }, groupByField: { true: "_1eexc2ah", false: "_1eexc2ai" }, firstInCategory: { true: "_1eexc2aj", false: "_1eexc2ak" }, lastInCategory: { true: "_1eexc2al", false: "_1eexc2am" }, pinned: { start: "_1eexc2an", end: "_1eexc2ao", false: "_1eexc2ap" }, filtered: { true: "_1eexc2aq", false: "_1eexc2ar" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2as"], [{ pinned: "end", firstInCategory: true }, "_1eexc2at"]] });
3982
+
3983
+ // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
3984
+ var { rootClassName: rootClassName3 } = internalProps;
3985
+ var InfiniteTableCellClassName = `${rootClassName3}Cell`;
3986
+ var InfiniteTableCellContentClassName = `${rootClassName3}Cell_content`;
3987
+ function InfiniteTableCellFn(props) {
3988
+ var _b, _c, _d;
3989
+ const _a = props, {
3990
+ cssEllipsis = true,
3991
+ virtualized = true,
3992
+ skipColumnShifting = false,
3993
+ offsetProperty = "left",
3994
+ contentStyle,
3995
+ column,
3996
+ domRef,
3997
+ width,
3998
+ contentClassName,
3999
+ afterChildren,
4000
+ beforeChildren,
4001
+ offset,
4002
+ cellType,
4003
+ cssPosition: _cssPosition,
4004
+ renderChildren
4005
+ } = _a, domProps = __objRest(_a, [
4006
+ "cssEllipsis",
4007
+ "virtualized",
4008
+ "skipColumnShifting",
4009
+ "offsetProperty",
4010
+ "contentStyle",
4011
+ "column",
4012
+ "domRef",
4013
+ "width",
4014
+ "contentClassName",
4015
+ "afterChildren",
4016
+ "beforeChildren",
4017
+ "offset",
4018
+ "cellType",
4019
+ "cssPosition",
4020
+ "renderChildren"
4021
+ ]);
4022
+ const children = renderChildren();
4023
+ const { columnShifts } = useInfiniteTableState();
4024
+ const shifting = !!columnShifts;
4025
+ const style = __spreadValues({
4026
+ width
4027
+ }, domProps.style);
4028
+ if (!skipColumnShifting && columnShifts && columnShifts[column.computedVisibleIndex]) {
4029
+ const shiftLeft = columnShifts[column.computedVisibleIndex] + (offset != null ? offset : 0);
4030
+ if (virtualized) {
4031
+ style.left = shiftLeft;
4032
+ } else {
4033
+ style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
4034
+ }
4035
+ }
4036
+ const finalDOMProps = __spreadProps(__spreadValues({}, domProps), {
4037
+ style,
4038
+ "data-column-id": column.id,
4039
+ className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls, shifting ? `${InfiniteTableCellClassName}--shifting ${CellClsVariants.shifting}` : ""),
4040
+ children: /* @__PURE__ */ React16.createElement(React16.Fragment, null, beforeChildren, /* @__PURE__ */ React16.createElement("div", {
4041
+ className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
4042
+ style: contentStyle
4043
+ }, children), afterChildren)
4044
+ });
4045
+ const RenderComponent = cellType === "body" ? (_c = column.components) == null ? void 0 : _c.ColumnCell : (_d = column.components) == null ? void 0 : _d.HeaderCell;
4046
+ if (RenderComponent) {
4047
+ return /* @__PURE__ */ React16.createElement(RenderComponent, __spreadValues({}, finalDOMProps));
4048
+ }
4049
+ return /* @__PURE__ */ React16.createElement("div", __spreadProps(__spreadValues({}, finalDOMProps), {
4050
+ ref: domRef
4051
+ }));
4052
+ }
4053
+ var InfiniteTableCell = React16.memo(InfiniteTableCellFn);
4054
+
4055
+ // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx
4056
+ var React17 = __toModule(require("react"));
4057
+ var import_react18 = __toModule(require("react"));
4058
+ var { rootClassName: rootClassName4 } = internalProps;
4059
+ var InfiniteTableColumnHeaderFilterClassName = `${rootClassName4}HeaderCell__filter`;
4060
+ var stopPropagation = (e) => e.stopPropagation();
4061
+ function InfiniteTableColumnHeaderFilter(props) {
4062
+ var _a, _b, _c, _d;
4063
+ const [theValue, setTheValue] = (0, import_react18.useState)((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
4064
+ const onInputChange = (filterValue) => {
4065
+ setTheValue(filterValue);
4066
+ props.onChange(filterValue);
4067
+ };
4068
+ (0, import_react18.useEffect)(() => {
4069
+ var _a2;
4070
+ if (props.columnFilterValue) {
4071
+ if (theValue !== props.columnFilterValue.filterValue) {
4072
+ setTheValue(props.columnFilterValue.filterValue);
4073
+ }
4074
+ } else {
4075
+ const currentFilterType = props.filterTypes[(_a2 = props.columnFilterType) != null ? _a2 : "string"];
4076
+ if (currentFilterType) {
4077
+ const emptyValue = [...currentFilterType.emptyValues][0];
4078
+ if (emptyValue !== theValue) {
4079
+ setTheValue(emptyValue);
4080
+ }
4081
+ }
4082
+ }
4083
+ }, [(_c = props.columnFilterValue) == null ? void 0 : _c.filterValue]);
4084
+ const filterType = props.columnFilterValue ? props.columnFilterValue.filterType : (_d = props.columnFilterType) != null ? _d : "string";
4085
+ const operator = props.columnFilterValue ? props.columnFilterValue.operator : props.filterTypes[filterType] ? props.filterTypes[filterType].defaultOperator : props.filterTypes.string.defaultOperator;
4086
+ const filterEditorProps = {
4087
+ ariaLabel: `Filter for ${props.columnLabel}`,
4088
+ filterValue: theValue,
4089
+ className: HeaderFilterEditorCls,
4090
+ operator,
4091
+ filterType,
4092
+ onChange: onInputChange
4093
+ };
4094
+ const FilterEditor = props.filterEditor;
4095
+ return /* @__PURE__ */ React17.createElement("div", {
4096
+ onPointerUp: stopPropagation,
4097
+ onPointerDown: stopPropagation,
4098
+ className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
4099
+ style: { height: props.columnHeaderHeight }
4100
+ }, FilterEditor ? /* @__PURE__ */ React17.createElement(FilterEditor, __spreadValues({}, filterEditorProps)) : null);
4101
+ }
4102
+ function InfiniteTableColumnHeaderFilterEmpty() {
4103
+ return /* @__PURE__ */ React17.createElement("div", {
4104
+ onPointerUp: stopPropagation,
4105
+ onPointerDown: stopPropagation,
4106
+ className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
4107
+ style: { height: "100%" }
4108
+ });
4109
+ }
4110
+
4111
+ // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
4112
+ var InfiniteTableHeaderCellContext = React18.createContext(null);
4113
+ var { rootClassName: rootClassName5 } = internalProps;
4114
+ var InfiniteTableHeaderCellClassName = `${rootClassName5}HeaderCell`;
4115
+ function InfiniteTableHeaderCell(props) {
4116
+ var _a, _b, _c, _d, _e;
4117
+ const column = props.column;
4118
+ const columns = props.columns;
4119
+ const { onResize, height, width, headerOptions } = props;
4120
+ const sortInfo = column.computedSortInfo;
4121
+ let header = column.header;
4122
+ const ref = (0, import_react19.useCallback)((node) => {
4123
+ var _a2;
4124
+ domRef.current = node;
4125
+ (_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
4126
+ }, [props.domRef]);
4127
+ const alwaysShow = headerOptions.alwaysReserveSpaceForSortIcon;
4128
+ const sortTool = column.computedSorted || alwaysShow ? /* @__PURE__ */ React18.createElement(SortIcon, {
4129
+ index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
4130
+ className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls} ${HeaderSortIconRecipe({
4131
+ align: column.align || "start"
4132
+ })}`,
4133
+ direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
4134
+ }) : null;
4135
+ const renderParam = {
4136
+ domRef: ref,
4137
+ column,
4138
+ columnSortInfo: sortInfo,
4139
+ columnFilterValue: column.computedFilterValue,
4140
+ sortTool
4141
+ };
4142
+ const align = column.align || "start";
4143
+ const renderChildren = () => {
4144
+ if (header instanceof Function) {
4145
+ header = /* @__PURE__ */ React18.createElement(RenderHookComponent, {
4146
+ render: header,
4147
+ renderParam
4148
+ });
3968
4149
  }
3969
4150
  header = header != null ? header : column.name;
3970
- return header;
4151
+ return /* @__PURE__ */ React18.createElement(React18.Fragment, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
3971
4152
  };
3972
- const domRef = (0, import_react17.useRef)(null);
4153
+ const domRef = (0, import_react19.useRef)(null);
3973
4154
  const {
3974
- computed: { computedRemainingSpace },
3975
- componentState: { portalDOMRef }
4155
+ computed: { computedRemainingSpace, showColumnFilters },
4156
+ componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
3976
4157
  } = useInfiniteTable();
3977
- (0, import_react17.useEffect)(() => {
4158
+ const {
4159
+ componentActions: dataSourceActions,
4160
+ getState: getDataSourceState,
4161
+ componentState: { filterDelay, filterTypes }
4162
+ } = useDataSourceContextValue();
4163
+ (0, import_react19.useEffect)(() => {
3978
4164
  let clearOnResize = null;
3979
4165
  const node = domRef.current;
3980
4166
  if (onResize && node) {
@@ -3995,7 +4181,7 @@ function InfiniteTableHeaderCell(props) {
3995
4181
  });
3996
4182
  let draggingProxy = null;
3997
4183
  if (dragging) {
3998
- draggingProxy = /* @__PURE__ */ React15.createElement("div", {
4184
+ draggingProxy = /* @__PURE__ */ React18.createElement("div", {
3999
4185
  className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
4000
4186
  style: {
4001
4187
  position: "absolute",
@@ -4009,9 +4195,73 @@ function InfiniteTableHeaderCell(props) {
4009
4195
  draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
4010
4196
  }
4011
4197
  const ContextProvider = InfiniteTableHeaderCellContext.Provider;
4012
- return /* @__PURE__ */ React15.createElement(ContextProvider, {
4198
+ const contentRecipeVariants = {
4199
+ filtered: column.computedFiltered
4200
+ };
4201
+ const setFilterValue = (0, import_react19.useCallback)((filterValue) => {
4202
+ var _a2;
4203
+ const state = getDataSourceState();
4204
+ let newFilterValue = (_a2 = state.filterValue) != null ? _a2 : [];
4205
+ let found = false;
4206
+ newFilterValue = newFilterValue.map((currentFilterValue) => {
4207
+ if (filterValue.id && currentFilterValue.id === filterValue.id || filterValue.field && currentFilterValue.field === column.field) {
4208
+ found = true;
4209
+ return filterValue;
4210
+ }
4211
+ return currentFilterValue;
4212
+ });
4213
+ if (!found) {
4214
+ newFilterValue.push(filterValue);
4215
+ }
4216
+ newFilterValue = newFilterValue.filter((filterValue2) => {
4217
+ const filterType2 = filterTypes[filterValue2.filterType];
4218
+ if (!filterType2 || filterType2.emptyValues.has(filterValue2.filterValue)) {
4219
+ return false;
4220
+ }
4221
+ return true;
4222
+ });
4223
+ dataSourceActions.filterValue = newFilterValue;
4224
+ }, [column, filterTypes]);
4225
+ const debouncedOnFilterValueChange = React18.useMemo(() => {
4226
+ const fn = (filterValue) => {
4227
+ let newFilterValueForColumn;
4228
+ if (column.computedFilterValue) {
4229
+ newFilterValueForColumn = __spreadValues({}, column.computedFilterValue);
4230
+ } else {
4231
+ const filterType2 = column.computedFilterType;
4232
+ const filterValueForColumn = {
4233
+ filterType: filterType2,
4234
+ operator: filterTypes[filterType2].defaultOperator,
4235
+ filterValue,
4236
+ valueGetter: column.valueGetter
4237
+ };
4238
+ if (column.field) {
4239
+ filterValueForColumn.field = column.field;
4240
+ } else {
4241
+ filterValueForColumn.id = column.id;
4242
+ }
4243
+ newFilterValueForColumn = filterValueForColumn;
4244
+ }
4245
+ newFilterValueForColumn.filterValue = filterValue;
4246
+ setFilterValue(newFilterValueForColumn);
4247
+ };
4248
+ if (filterDelay > 0) {
4249
+ return debounce(fn, { wait: filterDelay });
4250
+ }
4251
+ return fn;
4252
+ }, [
4253
+ filterDelay,
4254
+ setFilterValue,
4255
+ column.computedFilterValue,
4256
+ column.id,
4257
+ column.field,
4258
+ column.computedFilterType
4259
+ ]);
4260
+ const filterType = column.computedFilterType;
4261
+ const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
4262
+ return /* @__PURE__ */ React18.createElement(ContextProvider, {
4013
4263
  value: renderParam
4014
- }, /* @__PURE__ */ React15.createElement(InfiniteTableCell, {
4264
+ }, /* @__PURE__ */ React18.createElement(InfiniteTableCell, {
4015
4265
  domRef: ref,
4016
4266
  cellType: "header",
4017
4267
  column,
@@ -4021,19 +4271,29 @@ function InfiniteTableHeaderCell(props) {
4021
4271
  width,
4022
4272
  onPointerDown,
4023
4273
  onPointerUp,
4274
+ contentClassName: join(HeaderCellContentRecipe(contentRecipeVariants), justifyContent[(_c = column.align) != null ? _c : "start"]),
4275
+ contentStyle: showColumnFilters ? { height: height / 2 } : void 0,
4024
4276
  className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging, zebra: false }), CellCls),
4025
- cssEllipsis: (_d = (_c = column.headerCssEllipsis) != null ? _c : column.cssEllipsis) != null ? _d : true,
4026
- afterChildren: sortTool,
4277
+ cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
4278
+ afterChildren: showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ React18.createElement(InfiniteTableColumnHeaderFilter, {
4279
+ filterEditor: FilterEditor,
4280
+ filterTypes,
4281
+ onChange: debouncedOnFilterValueChange,
4282
+ columnFilterType: filterType,
4283
+ columnLabel: column.field || column.name || column.id,
4284
+ columnFilterValue: column.computedFilterValue,
4285
+ columnHeaderHeight
4286
+ }) : /* @__PURE__ */ React18.createElement(InfiniteTableColumnHeaderFilterEmpty, null) : null,
4027
4287
  renderChildren
4028
4288
  }), draggingProxy);
4029
4289
  }
4030
4290
  function useInfiniteHeaderCell() {
4031
- const result = (0, import_react17.useContext)(InfiniteTableHeaderCellContext);
4291
+ const result = (0, import_react19.useContext)(InfiniteTableHeaderCellContext);
4032
4292
  return result;
4033
4293
  }
4034
4294
 
4035
4295
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
4036
- var React18 = __toModule(require("react"));
4296
+ var React21 = __toModule(require("react"));
4037
4297
 
4038
4298
  // src/components/utils/getScrollbarWidth.ts
4039
4299
  var scrollbarWidth;
@@ -4155,11 +4415,11 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
4155
4415
  }
4156
4416
 
4157
4417
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
4158
- var React17 = __toModule(require("react"));
4159
- var import_react18 = __toModule(require("react"));
4418
+ var React20 = __toModule(require("react"));
4419
+ var import_react20 = __toModule(require("react"));
4160
4420
 
4161
4421
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
4162
- var React16 = __toModule(require("react"));
4422
+ var React19 = __toModule(require("react"));
4163
4423
  var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
4164
4424
  function InfiniteTableHeaderGroup(props) {
4165
4425
  const { columnGroup, height, width } = props;
@@ -4169,35 +4429,35 @@ function InfiniteTableHeaderGroup(props) {
4169
4429
  columnGroup
4170
4430
  });
4171
4431
  }
4172
- return /* @__PURE__ */ React16.createElement("div", {
4432
+ return /* @__PURE__ */ React19.createElement("div", {
4173
4433
  ref: props.domRef,
4174
4434
  "data-group-id": columnGroup.uniqueGroupId,
4175
4435
  className: join(HeaderGroupCls, TableHeaderGroupClassName),
4176
4436
  style: { width, height }
4177
- }, /* @__PURE__ */ React16.createElement("div", {
4437
+ }, /* @__PURE__ */ React19.createElement("div", {
4178
4438
  className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
4179
4439
  }, header));
4180
4440
  }
4181
4441
 
4182
4442
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
4183
- var { rootClassName: rootClassName5 } = internalProps;
4184
- var TableHeaderClassName = `${rootClassName5}Header`;
4443
+ var { rootClassName: rootClassName6 } = internalProps;
4444
+ var TableHeaderClassName = `${rootClassName6}Header`;
4185
4445
  function InfiniteTableHeaderFn(props) {
4186
4446
  const {
4187
4447
  brain,
4188
4448
  columns,
4189
4449
  style,
4190
4450
  className,
4191
- headerHeight,
4451
+ columnHeaderHeight,
4192
4452
  columnAndGroupTreeInfo,
4193
4453
  columnGroupsMaxDepth
4194
4454
  } = props;
4195
4455
  const {
4196
4456
  computed,
4197
- componentState: { headerBrain }
4457
+ componentState: { headerBrain, headerOptions }
4198
4458
  } = useInfiniteTable();
4199
- const { computedVisibleColumnsMap } = computed;
4200
- (0, import_react18.useEffect)(() => {
4459
+ const { computedVisibleColumnsMap, showColumnFilters } = computed;
4460
+ (0, import_react20.useEffect)(() => {
4201
4461
  const onScroll = (scrollPosition) => {
4202
4462
  if (domRef.current) {
4203
4463
  domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
@@ -4206,7 +4466,7 @@ function InfiniteTableHeaderFn(props) {
4206
4466
  const removeOnScroll = brain.onScroll(onScroll);
4207
4467
  return removeOnScroll;
4208
4468
  }, [brain]);
4209
- const domRef = (0, import_react18.useRef)(null);
4469
+ const domRef = (0, import_react20.useRef)(null);
4210
4470
  const headerCls = HeaderClsRecipe({
4211
4471
  overflow: false,
4212
4472
  virtualized: true
@@ -4214,9 +4474,9 @@ function InfiniteTableHeaderFn(props) {
4214
4474
  const domProps = {
4215
4475
  ref: domRef,
4216
4476
  className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
4217
- style: __spreadProps(__spreadValues({}, style), { height: headerHeight })
4477
+ style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
4218
4478
  };
4219
- const renderCell = (0, import_react18.useCallback)((params) => {
4479
+ const renderCell = (0, import_react20.useCallback)((params) => {
4220
4480
  const {
4221
4481
  rowIndex,
4222
4482
  colIndex,
@@ -4241,7 +4501,7 @@ function InfiniteTableHeaderFn(props) {
4241
4501
  computedWidth: colGroupItem.computedWidth,
4242
4502
  groupOffset: colGroupItem.groupOffset
4243
4503
  });
4244
- return /* @__PURE__ */ React17.createElement(InfiniteTableHeaderGroup, {
4504
+ return /* @__PURE__ */ React20.createElement(InfiniteTableHeaderGroup, {
4245
4505
  domRef: domRef2,
4246
4506
  columns: columns2,
4247
4507
  width: widthWithColspan,
@@ -4249,21 +4509,29 @@ function InfiniteTableHeaderFn(props) {
4249
4509
  columnGroup: computedColumnGroup
4250
4510
  });
4251
4511
  }
4252
- return /* @__PURE__ */ React17.createElement(InfiniteTableHeaderCell, {
4512
+ return /* @__PURE__ */ React20.createElement(InfiniteTableHeaderCell, {
4253
4513
  domRef: domRef2,
4254
4514
  column,
4515
+ headerOptions,
4255
4516
  width: widthWithColspan,
4256
4517
  height: heightWithRowspan,
4257
4518
  columns: computedVisibleColumnsMap
4258
4519
  });
4259
- }, [columns, headerHeight, columnAndGroupTreeInfo, columnGroupsMaxDepth]);
4260
- return /* @__PURE__ */ React17.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React17.createElement(RawTable, {
4520
+ }, [
4521
+ headerOptions,
4522
+ columns,
4523
+ columnHeaderHeight,
4524
+ columnAndGroupTreeInfo,
4525
+ columnGroupsMaxDepth,
4526
+ showColumnFilters
4527
+ ]);
4528
+ return /* @__PURE__ */ React20.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React20.createElement(RawTable, {
4261
4529
  renderCell,
4262
4530
  brain: headerBrain,
4263
4531
  cellHoverClassNames: []
4264
4532
  }));
4265
4533
  }
4266
- var InfiniteTableHeader = React17.memo(InfiniteTableHeaderFn);
4534
+ var InfiniteTableHeader = React20.memo(InfiniteTableHeaderFn);
4267
4535
 
4268
4536
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
4269
4537
  function TableHeaderWrapper(props) {
@@ -4273,25 +4541,26 @@ function TableHeaderWrapper(props) {
4273
4541
  computedPinnedStartColumns,
4274
4542
  computedPinnedEndColumns,
4275
4543
  computedVisibleColumns,
4276
- columnSize
4544
+ columnSize,
4545
+ showColumnFilters
4277
4546
  } = tableContextValue.computed;
4278
4547
  const {
4279
4548
  componentState: {
4280
- headerHeight,
4549
+ columnHeaderHeight,
4281
4550
  columnGroupsDepthsMap,
4282
4551
  columnGroupsMaxDepth,
4283
4552
  computedColumnGroups
4284
4553
  }
4285
4554
  } = tableContextValue;
4286
4555
  const rows = !computedColumnGroups || !computedColumnGroups.size ? 1 : columnGroupsMaxDepth + 2;
4287
- const height = rows * headerHeight;
4288
- const columnAndGroupTreeInfo = React18.useMemo(() => {
4556
+ const height = rows * columnHeaderHeight + (showColumnFilters ? columnHeaderHeight : 0);
4557
+ const columnAndGroupTreeInfo = React21.useMemo(() => {
4289
4558
  if (!computedColumnGroups || !computedColumnGroups.size) {
4290
4559
  return void 0;
4291
4560
  }
4292
4561
  return buildColumnAndGroupTree(computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap, columnGroupsMaxDepth);
4293
4562
  }, [computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap]);
4294
- const cellspan = React18.useCallback(({ rowIndex, colIndex }) => {
4563
+ const cellspan = React21.useCallback(({ rowIndex, colIndex }) => {
4295
4564
  const column = computedVisibleColumns[colIndex];
4296
4565
  const rowspan2 = 1;
4297
4566
  const colspan2 = 1;
@@ -4324,11 +4593,14 @@ function TableHeaderWrapper(props) {
4324
4593
  rows,
4325
4594
  columnGroupsDepthsMap
4326
4595
  ]);
4327
- const rowspan = React18.useCallback(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).rowspan, [cellspan]);
4328
- const colspan = React18.useCallback(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).colspan, [cellspan]);
4596
+ const rowspan = React21.useCallback(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).rowspan, [cellspan]);
4597
+ const colspan = React21.useCallback(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).colspan, [cellspan]);
4598
+ const rowHeight = React21.useCallback((index) => {
4599
+ return showColumnFilters ? index < rows - 1 ? columnHeaderHeight : 2 * columnHeaderHeight : columnHeaderHeight;
4600
+ }, [rows, showColumnFilters, columnHeaderHeight]);
4329
4601
  useMatrixBrain(brain, {
4330
4602
  colWidth: columnSize,
4331
- rowHeight: headerHeight,
4603
+ rowHeight,
4332
4604
  rows,
4333
4605
  cols: computedVisibleColumns.length,
4334
4606
  height,
@@ -4338,21 +4610,21 @@ function TableHeaderWrapper(props) {
4338
4610
  fixedColsEnd: computedPinnedEndColumns.length,
4339
4611
  fixedColsStart: computedPinnedStartColumns.length
4340
4612
  });
4341
- const header = /* @__PURE__ */ React18.createElement(InfiniteTableHeader, {
4613
+ const header = /* @__PURE__ */ React21.createElement(InfiniteTableHeader, {
4342
4614
  columns: computedVisibleColumns,
4343
4615
  brain,
4344
- headerHeight: height,
4616
+ columnHeaderHeight: height,
4345
4617
  columnGroupsMaxDepth,
4346
4618
  columnAndGroupTreeInfo
4347
4619
  });
4348
- const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ React18.createElement("div", {
4620
+ const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ React21.createElement("div", {
4349
4621
  className: HeaderScrollbarPlaceholderCls,
4350
4622
  style: {
4351
4623
  zIndex: 1e3,
4352
4624
  width: getScrollbarWidth()
4353
4625
  }
4354
4626
  }) : null;
4355
- return /* @__PURE__ */ React18.createElement("div", {
4627
+ return /* @__PURE__ */ React21.createElement("div", {
4356
4628
  className: HeaderWrapperCls,
4357
4629
  style: {
4358
4630
  height
@@ -4361,8 +4633,8 @@ function TableHeaderWrapper(props) {
4361
4633
  }
4362
4634
 
4363
4635
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
4364
- var React19 = __toModule(require("react"));
4365
- var import_react19 = __toModule(require("react"));
4636
+ var React22 = __toModule(require("react"));
4637
+ var import_react21 = __toModule(require("react"));
4366
4638
 
4367
4639
  // src/components/utils/decamelize.ts
4368
4640
  function decamelize(str, options) {
@@ -4371,7 +4643,7 @@ function decamelize(str, options) {
4371
4643
  }
4372
4644
 
4373
4645
  // src/components/InfiniteTable/theme.css.ts
4374
- var ThemeVars = { color: { accent: "var(--infinite-accent-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)", height: "var(--infinite-header-height)" }, HeaderCell: { draggingBackground: "var(--infinite-header-cell-dragging-background)", background: "var(--infinite-header-cell-background)", padding: "var(--infinite-header-cell-padding)", iconSize: "var(--infinite-header-cell-icon-size)" }, 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)", color: "var(--infinite-cell-color)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", hoverBackground: "var(--infinite-row-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)" } } };
4646
+ var ThemeVars = { color: { accent: "var(--infinite-accent-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: { draggingBackground: "var(--infinite-header-cell-dragging-background)", background: "var(--infinite-header-cell-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)" }, 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)", color: "var(--infinite-cell-color)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", hoverBackground: "var(--infinite-row-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)" } } };
4375
4647
 
4376
4648
  // src/components/InfiniteTable/InfiniteCls.css.ts
4377
4649
  var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
@@ -4408,10 +4680,10 @@ var enforceStyle = (node, style) => {
4408
4680
  node.style.setProperty(decamelize(propertyName), propertyValue, "important");
4409
4681
  }
4410
4682
  };
4411
- var InfiniteTableLicenseFooter = React19.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
4412
- const { rootClassName: rootClassName8 } = useInternalProps();
4413
- const domRef = React19.useRef(null);
4414
- const domCallback = React19.useCallback((node) => {
4683
+ var InfiniteTableLicenseFooter = React22.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
4684
+ const { rootClassName: rootClassName9 } = useInternalProps();
4685
+ const domRef = React22.useRef(null);
4686
+ const domCallback = React22.useCallback((node) => {
4415
4687
  domRef.current = node;
4416
4688
  if (!ref) {
4417
4689
  return;
@@ -4422,7 +4694,7 @@ var InfiniteTableLicenseFooter = React19.forwardRef(function InfiniteTableLicens
4422
4694
  ref.current = node;
4423
4695
  }
4424
4696
  }, []);
4425
- (0, import_react19.useEffect)(() => {
4697
+ (0, import_react21.useEffect)(() => {
4426
4698
  const forceStyle = () => {
4427
4699
  requestAnimationFrame(() => {
4428
4700
  var _a;
@@ -4436,12 +4708,12 @@ var InfiniteTableLicenseFooter = React19.forwardRef(function InfiniteTableLicens
4436
4708
  clearInterval(intervalId);
4437
4709
  };
4438
4710
  }, []);
4439
- return /* @__PURE__ */ React19.createElement("div", __spreadProps(__spreadValues({
4711
+ return /* @__PURE__ */ React22.createElement("div", __spreadProps(__spreadValues({
4440
4712
  ref: domCallback
4441
4713
  }, props), {
4442
- className: join(`${rootClassName8}-Footer`, FooterCls, props.className),
4714
+ className: join(`${rootClassName9}-Footer`, FooterCls, props.className),
4443
4715
  style: defaultStyle
4444
- }), "Powered by", " ", /* @__PURE__ */ React19.createElement("a", {
4716
+ }), "Powered by", " ", /* @__PURE__ */ React22.createElement("a", {
4445
4717
  href: "https://infinite-table.com",
4446
4718
  rel: "noopener noreferrer",
4447
4719
  role: "link",
@@ -4450,11 +4722,11 @@ var InfiniteTableLicenseFooter = React19.forwardRef(function InfiniteTableLicens
4450
4722
  });
4451
4723
 
4452
4724
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
4453
- var React20 = __toModule(require("react"));
4454
- var import_react20 = __toModule(require("react"));
4455
- var { rootClassName: rootClassName6 } = internalProps;
4456
- var InfiniteTableColumnCellContext = React20.createContext(null);
4457
- var InfiniteTableColumnCellClassName = `${rootClassName6}ColumnCell`;
4725
+ var React23 = __toModule(require("react"));
4726
+ var import_react22 = __toModule(require("react"));
4727
+ var { rootClassName: rootClassName7 } = internalProps;
4728
+ var InfiniteTableColumnCellContext = React23.createContext(null);
4729
+ var InfiniteTableColumnCellClassName = `${rootClassName7}ColumnCell`;
4458
4730
  function isColumnWithField(c) {
4459
4731
  return typeof c.field === "string";
4460
4732
  }
@@ -4478,7 +4750,7 @@ function InfiniteTableColumnCellFn(props) {
4478
4750
  showZebraRows
4479
4751
  } = props;
4480
4752
  if (!column) {
4481
- return /* @__PURE__ */ React20.createElement("div", {
4753
+ return /* @__PURE__ */ React23.createElement("div", {
4482
4754
  ref: domRef
4483
4755
  }, "no column");
4484
4756
  }
@@ -4487,33 +4759,44 @@ function InfiniteTableColumnCellFn(props) {
4487
4759
  const groupRowInfo = null;
4488
4760
  let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
4489
4761
  if (column.valueGetter) {
4490
- value = column.valueGetter(isGroupRow ? {
4762
+ if (!rowInfo.isGroupRow && rowInfo.data) {
4763
+ value = column.valueGetter({ data: rowInfo.data, field: column.field });
4764
+ }
4765
+ }
4766
+ if (column.valueFormatter) {
4767
+ value = column.valueFormatter(isGroupRow ? {
4491
4768
  data: rowInfo.data,
4492
4769
  isGroupRow,
4493
- rowInfo
4770
+ rowInfo,
4771
+ field: column.field,
4772
+ value
4494
4773
  } : {
4495
4774
  data: rowInfo.data,
4496
4775
  isGroupRow,
4497
- rowInfo
4776
+ rowInfo,
4777
+ field: column.field,
4778
+ value
4498
4779
  });
4499
4780
  }
4500
4781
  const { componentState: computedDataSource } = useDataSourceContextValue();
4501
4782
  const rest = rowInfo.isGroupRow ? {
4502
4783
  rowInfo,
4503
4784
  isGroupRow: rowInfo.isGroupRow,
4504
- data: rowInfo.data
4785
+ data: rowInfo.data,
4786
+ value,
4787
+ field: column.field
4505
4788
  } : {
4506
4789
  rowInfo,
4507
4790
  isGroupRow: rowInfo.isGroupRow,
4508
- data: rowInfo.data
4791
+ data: rowInfo.data,
4792
+ value,
4793
+ field: column.field
4509
4794
  };
4510
4795
  const stylingRenderParam = __spreadValues({
4511
- value,
4512
4796
  column
4513
4797
  }, rest);
4514
4798
  const renderValue = value;
4515
4799
  const renderParam = __spreadProps(__spreadValues({
4516
- value,
4517
4800
  column,
4518
4801
  domRef,
4519
4802
  groupRowInfo
@@ -4536,7 +4819,7 @@ function InfiniteTableColumnCellFn(props) {
4536
4819
  }
4537
4820
  const renderFn = column.render || column.renderValue;
4538
4821
  if (renderFn) {
4539
- return /* @__PURE__ */ React20.createElement(RenderHookComponent, {
4822
+ return /* @__PURE__ */ React23.createElement(RenderHookComponent, {
4540
4823
  render: renderFn,
4541
4824
  renderParam
4542
4825
  });
@@ -4572,13 +4855,13 @@ function InfiniteTableColumnCellFn(props) {
4572
4855
  renderChildren
4573
4856
  };
4574
4857
  const ContextProvider = InfiniteTableColumnCellContext.Provider;
4575
- return /* @__PURE__ */ React20.createElement(ContextProvider, {
4858
+ return /* @__PURE__ */ React23.createElement(ContextProvider, {
4576
4859
  value: renderParam
4577
- }, /* @__PURE__ */ React20.createElement(InfiniteTableCell, __spreadValues({}, cellProps)));
4860
+ }, /* @__PURE__ */ React23.createElement(InfiniteTableCell, __spreadValues({}, cellProps)));
4578
4861
  }
4579
- var InfiniteTableColumnCell = React20.memo(InfiniteTableColumnCellFn);
4862
+ var InfiniteTableColumnCell = React23.memo(InfiniteTableColumnCellFn);
4580
4863
  function useInfiniteColumnCell() {
4581
- const result = (0, import_react20.useContext)(InfiniteTableColumnCellContext);
4864
+ const result = (0, import_react22.useContext)(InfiniteTableColumnCellContext);
4582
4865
  return result;
4583
4866
  }
4584
4867
 
@@ -4589,7 +4872,7 @@ var RowClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassNa
4589
4872
  var RowHoverCls = "_7pupv01";
4590
4873
 
4591
4874
  // src/components/InfiniteTable/components/LoadMask.tsx
4592
- var React21 = __toModule(require("react"));
4875
+ var React24 = __toModule(require("react"));
4593
4876
 
4594
4877
  // src/components/InfiniteTable/components/LoadMask.css.ts
4595
4878
  var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwt _16lm1iwv _16lm1iwz _16lm1iwx", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwt _16lm1iwv _16lm1iwz _16lm1iwx" };
@@ -4597,22 +4880,22 @@ var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwt _16lm1iwv _16lm1iwz _16lm1
4597
4880
  var LoadMaskTextCls = "qy58ya4";
4598
4881
 
4599
4882
  // src/components/InfiniteTable/components/LoadMask.tsx
4600
- var { rootClassName: rootClassName7 } = internalProps;
4601
- var baseCls = `${rootClassName7}-LoadMask`;
4883
+ var { rootClassName: rootClassName8 } = internalProps;
4884
+ var baseCls = `${rootClassName8}-LoadMask`;
4602
4885
  function LoadMaskFn(props) {
4603
4886
  const { visible, children = "Loading" } = props;
4604
- return /* @__PURE__ */ React21.createElement("div", {
4887
+ return /* @__PURE__ */ React24.createElement("div", {
4605
4888
  className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls}`
4606
- }, /* @__PURE__ */ React21.createElement("div", {
4889
+ }, /* @__PURE__ */ React24.createElement("div", {
4607
4890
  className: `${LoadMaskOverlayCls} ${baseCls}-Overlay`
4608
- }), /* @__PURE__ */ React21.createElement("div", {
4891
+ }), /* @__PURE__ */ React24.createElement("div", {
4609
4892
  className: `${LoadMaskTextCls} ${baseCls}-Text`
4610
4893
  }, children));
4611
4894
  }
4612
- var LoadMask = React21.memo(LoadMaskFn);
4895
+ var LoadMask = React24.memo(LoadMaskFn);
4613
4896
 
4614
4897
  // src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
4615
- var import_react21 = __toModule(require("react"));
4898
+ var import_react23 = __toModule(require("react"));
4616
4899
  var OFFSET = 10;
4617
4900
  function getColumnContentMaxWidths(domRef, options) {
4618
4901
  var _a;
@@ -4634,6 +4917,7 @@ function getColumnContentMaxWidths(domRef, options) {
4634
4917
  contentClone.style.pointerEvents = "none";
4635
4918
  contentClone.classList.remove(...cssEllipsisClassName.split(" "));
4636
4919
  contentClone.style.position = "absolute";
4920
+ contentClone.style.width = "auto";
4637
4921
  cell.appendChild(contentClone);
4638
4922
  let measuredWidth = contentClone.offsetWidth;
4639
4923
  cell.removeChild(contentClone);
@@ -4671,11 +4955,11 @@ function useAutoSizeColumns() {
4671
4955
  componentActions,
4672
4956
  componentState: { domRef, ready, autoSizeColumnsKey, brain }
4673
4957
  } = useComponentState();
4674
- const [refreshId, setRefreshId] = (0, import_react21.useState)(0);
4958
+ const [refreshId, setRefreshId] = (0, import_react23.useState)(0);
4675
4959
  const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
4676
4960
  const getTheKey = useLatest(theKey);
4677
- const lastExecutedIdentifierRef = (0, import_react21.useRef)(null);
4678
- (0, import_react21.useEffect)(() => {
4961
+ const lastExecutedIdentifierRef = (0, import_react23.useRef)(null);
4962
+ (0, import_react23.useEffect)(() => {
4679
4963
  const key = getTheKey();
4680
4964
  if (key == null) {
4681
4965
  return;
@@ -4688,7 +4972,7 @@ function useAutoSizeColumns() {
4688
4972
  };
4689
4973
  return brain.onRenderRangeChange(onChange);
4690
4974
  }, [brain]);
4691
- (0, import_react21.useEffect)(() => {
4975
+ (0, import_react23.useEffect)(() => {
4692
4976
  var _a;
4693
4977
  if (theKey == null) {
4694
4978
  return;
@@ -4733,16 +5017,16 @@ function useAutoSizeColumns() {
4733
5017
  }
4734
5018
 
4735
5019
  // src/components/InfiniteTable/hooks/useCellRendering.tsx
4736
- var import_react23 = __toModule(require("react"));
4737
- var import_react24 = __toModule(require("react"));
5020
+ var import_react25 = __toModule(require("react"));
5021
+ var import_react26 = __toModule(require("react"));
4738
5022
 
4739
5023
  // src/components/hooks/useRerender.ts
4740
- var import_react22 = __toModule(require("react"));
5024
+ var import_react24 = __toModule(require("react"));
4741
5025
  var useRerender = () => {
4742
- const [state, setState] = (0, import_react22.useState)(0);
5026
+ const [state, setState] = (0, import_react24.useState)(0);
4743
5027
  return [
4744
5028
  state,
4745
- (0, import_react22.useCallback)(() => {
5029
+ (0, import_react24.useCallback)(() => {
4746
5030
  setState((state2) => state2 + 1);
4747
5031
  }, [setState])
4748
5032
  ];
@@ -4816,13 +5100,13 @@ function useCellRendering(param) {
4816
5100
  bodySize,
4817
5101
  rowspan
4818
5102
  });
4819
- const scrollTopMaxRef = (0, import_react23.useRef)(0);
4820
- (0, import_react23.useEffect)(() => {
5103
+ const scrollTopMaxRef = (0, import_react25.useRef)(0);
5104
+ (0, import_react25.useEffect)(() => {
4821
5105
  return brain.onRenderCountChange(() => {
4822
5106
  scrollTopMaxRef.current = brain.scrollTopMax;
4823
5107
  });
4824
5108
  }, [brain]);
4825
- (0, import_react23.useEffect)(() => {
5109
+ (0, import_react25.useEffect)(() => {
4826
5110
  return brain.onScrollStop((scrollPosition) => {
4827
5111
  const { scrollTop } = scrollPosition;
4828
5112
  if (scrollTop === 0) {
@@ -4839,7 +5123,7 @@ function useCellRendering(param) {
4839
5123
  }
4840
5124
  });
4841
5125
  }, [brain, onScrollToTop, onScrollToBottom]);
4842
- (0, import_react23.useEffect)(() => {
5126
+ (0, import_react25.useEffect)(() => {
4843
5127
  if (!bodySize.height) {
4844
5128
  return;
4845
5129
  }
@@ -4860,10 +5144,10 @@ function useCellRendering(param) {
4860
5144
  }
4861
5145
  }, [!!bodySize.height]);
4862
5146
  const [, rerender] = useRerender();
4863
- (0, import_react23.useEffect)(() => {
5147
+ (0, import_react25.useEffect)(() => {
4864
5148
  rerender();
4865
5149
  }, [dataSourceState]);
4866
- const renderCell = (0, import_react23.useCallback)((params) => {
5150
+ const renderCell = (0, import_react25.useCallback)((params) => {
4867
5151
  const {
4868
5152
  rowIndex,
4869
5153
  colIndex,
@@ -4898,7 +5182,7 @@ function useCellRendering(param) {
4898
5182
  rowStyle,
4899
5183
  rowClassName
4900
5184
  };
4901
- return /* @__PURE__ */ import_react24.default.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
5185
+ return /* @__PURE__ */ import_react26.default.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
4902
5186
  }, [
4903
5187
  rowHeight,
4904
5188
  getData,
@@ -4916,13 +5200,13 @@ function useCellRendering(param) {
4916
5200
  }
4917
5201
 
4918
5202
  // src/components/InfiniteTable/hooks/useComputed.ts
4919
- var import_react38 = __toModule(require("react"));
5203
+ var import_react40 = __toModule(require("react"));
4920
5204
 
4921
5205
  // src/components/InfiniteTable/hooks/useColumnGroups.ts
4922
- var import_react26 = __toModule(require("react"));
5206
+ var import_react28 = __toModule(require("react"));
4923
5207
 
4924
5208
  // src/components/hooks/useInterceptedMap.ts
4925
- var import_react25 = __toModule(require("react"));
5209
+ var import_react27 = __toModule(require("react"));
4926
5210
  function interceptMap(map2, fns) {
4927
5211
  const { set, delete: deleteKey, clear } = map2;
4928
5212
  if (fns.set) {
@@ -5010,7 +5294,7 @@ function useColumnGroups() {
5010
5294
  componentActions,
5011
5295
  getComponentState
5012
5296
  } = useComponentState();
5013
- (0, import_react26.useEffect)(() => {
5297
+ (0, import_react28.useEffect)(() => {
5014
5298
  const recompute = () => {
5015
5299
  componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
5016
5300
  };
@@ -5021,7 +5305,7 @@ function useColumnGroups() {
5021
5305
  set: update
5022
5306
  });
5023
5307
  }, [computedColumnGroups]);
5024
- (0, import_react26.useEffect)(() => {
5308
+ (0, import_react28.useEffect)(() => {
5025
5309
  return interceptMap(collapsedColumnGroups, {
5026
5310
  set: (key, visibleCol) => {
5027
5311
  const colIds = key.slice(1);
@@ -5056,10 +5340,10 @@ function useColumnGroups() {
5056
5340
  }
5057
5341
 
5058
5342
  // src/components/InfiniteTable/hooks/useColumnRowspan.ts
5059
- var import_react27 = __toModule(require("react"));
5343
+ var import_react29 = __toModule(require("react"));
5060
5344
  function useColumnRowspan(computedVisibleColumns) {
5061
5345
  const { getState: getDataSourceState } = useDataSourceContextValue();
5062
- const rowspan = (0, import_react27.useMemo)(() => {
5346
+ const rowspan = (0, import_react29.useMemo)(() => {
5063
5347
  const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
5064
5348
  return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
5065
5349
  const dataArray = getDataSourceState().dataArray;
@@ -5085,10 +5369,10 @@ function useColumnRowspan(computedVisibleColumns) {
5085
5369
  }
5086
5370
 
5087
5371
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
5088
- var import_react28 = __toModule(require("react"));
5372
+ var import_react30 = __toModule(require("react"));
5089
5373
  var debug4 = dbg("useColumnSizeFn");
5090
5374
  function useColumnSizeFn(columns) {
5091
- const columnSize = (0, import_react28.useCallback)((index) => {
5375
+ const columnSize = (0, import_react30.useCallback)((index) => {
5092
5376
  const column = columns[index];
5093
5377
  if (!column) {
5094
5378
  debug4("cannot find column at index", index, columns);
@@ -5099,10 +5383,10 @@ function useColumnSizeFn(columns) {
5099
5383
  }
5100
5384
 
5101
5385
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
5102
- var import_react34 = __toModule(require("react"));
5386
+ var import_react36 = __toModule(require("react"));
5103
5387
 
5104
5388
  // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
5105
- var React25 = __toModule(require("react"));
5389
+ var React28 = __toModule(require("react"));
5106
5390
 
5107
5391
  // src/utils/stripVar.ts
5108
5392
  function stripVar(cssVariableWithVarString) {
@@ -5118,8 +5402,8 @@ var showLoadingIcon = (rowInfo) => {
5118
5402
  };
5119
5403
 
5120
5404
  // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
5121
- var React23 = __toModule(require("react"));
5122
- var import_react29 = __toModule(require("react"));
5405
+ var React26 = __toModule(require("react"));
5406
+ var import_react31 = __toModule(require("react"));
5123
5407
 
5124
5408
  // src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
5125
5409
  var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
@@ -5130,7 +5414,7 @@ var ExpanderIconClsVariants = (0, import_createRuntimeFn5.createRuntimeFn)({ def
5130
5414
  function ExpanderIcon(props) {
5131
5415
  var _a;
5132
5416
  const { size = 24 } = props;
5133
- const [expanded, setExpanded] = (0, import_react29.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
5417
+ const [expanded, setExpanded] = (0, import_react31.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
5134
5418
  const onClick = () => {
5135
5419
  var _a2;
5136
5420
  (_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
@@ -5138,12 +5422,12 @@ function ExpanderIcon(props) {
5138
5422
  setExpanded(!expanded);
5139
5423
  }
5140
5424
  };
5141
- React23.useEffect(() => {
5425
+ React26.useEffect(() => {
5142
5426
  if (isControlled("expanded", props)) {
5143
5427
  setExpanded(props.expanded);
5144
5428
  }
5145
5429
  }, [props.expanded]);
5146
- return /* @__PURE__ */ React23.createElement("svg", {
5430
+ return /* @__PURE__ */ React26.createElement("svg", {
5147
5431
  "data-name": "expander-icon",
5148
5432
  xmlns: "http://www.w3.org/2000/svg",
5149
5433
  height: `${size}px`,
@@ -5154,20 +5438,20 @@ function ExpanderIcon(props) {
5154
5438
  className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
5155
5439
  expanded
5156
5440
  }), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`)
5157
- }, /* @__PURE__ */ React23.createElement("path", {
5441
+ }, /* @__PURE__ */ React26.createElement("path", {
5158
5442
  d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
5159
5443
  }));
5160
5444
  }
5161
5445
 
5162
5446
  // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
5163
- var React24 = __toModule(require("react"));
5447
+ var React27 = __toModule(require("react"));
5164
5448
 
5165
5449
  // src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
5166
5450
  var LoadingIconCls = "_16lm1iw8 _16lm1iwf _16lm1iwd";
5167
5451
 
5168
5452
  // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
5169
5453
  var LoadingIcon = (props) => {
5170
- return /* @__PURE__ */ React24.createElement("svg", {
5454
+ return /* @__PURE__ */ React27.createElement("svg", {
5171
5455
  xmlns: "http://www.w3.org/2000/svg",
5172
5456
  style: {
5173
5457
  margin: "auto",
@@ -5179,14 +5463,14 @@ var LoadingIcon = (props) => {
5179
5463
  viewBox: "0 0 100 100",
5180
5464
  preserveAspectRatio: "xMidYMid",
5181
5465
  className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
5182
- }, /* @__PURE__ */ React24.createElement("circle", {
5466
+ }, /* @__PURE__ */ React27.createElement("circle", {
5183
5467
  cx: "50",
5184
5468
  cy: "50",
5185
5469
  fill: "none",
5186
5470
  strokeWidth: "10",
5187
5471
  r: "35",
5188
5472
  strokeDasharray: "164.93361431346415 56.97787143782138"
5189
- }, /* @__PURE__ */ React24.createElement("animateTransform", {
5473
+ }, /* @__PURE__ */ React27.createElement("animateTransform", {
5190
5474
  attributeName: "transform",
5191
5475
  type: "rotate",
5192
5476
  repeatCount: "indefinite",
@@ -5206,7 +5490,7 @@ function getGroupColumnRender({
5206
5490
  var _a, _b, _c;
5207
5491
  let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
5208
5492
  if (column.renderValue) {
5209
- value = /* @__PURE__ */ React25.createElement(RenderHookComponent, {
5493
+ value = /* @__PURE__ */ React28.createElement(RenderHookComponent, {
5210
5494
  render: column.renderValue,
5211
5495
  renderParam: renderOptions
5212
5496
  });
@@ -5236,22 +5520,22 @@ function getGroupColumnRender({
5236
5520
  const showExpanderIcon = pivotBy ? (((_b = groupRowInfo.groupKeys) == null ? void 0 : _b.length) || 0) < (groupBy == null ? void 0 : groupBy.length) : (((_c = groupRowInfo.groupKeys) == null ? void 0 : _c.length) || 0) <= (groupBy == null ? void 0 : groupBy.length);
5237
5521
  const isLoading = showLoadingIcon(groupRowInfo);
5238
5522
  if (isLoading) {
5239
- icon = /* @__PURE__ */ React25.createElement(LoadingIcon, null);
5523
+ icon = /* @__PURE__ */ React28.createElement(LoadingIcon, null);
5240
5524
  } else if (showExpanderIcon) {
5241
- const defaultIcon = /* @__PURE__ */ React25.createElement(ExpanderIcon, {
5525
+ const defaultIcon = /* @__PURE__ */ React28.createElement(ExpanderIcon, {
5242
5526
  expanded: !collapsed,
5243
5527
  onChange: () => {
5244
5528
  toggleGroupRow(groupKeys);
5245
5529
  }
5246
5530
  });
5247
- icon = column.renderGroupIcon ? /* @__PURE__ */ React25.createElement(RenderHookComponent, {
5531
+ icon = column.renderGroupIcon ? /* @__PURE__ */ React28.createElement(RenderHookComponent, {
5248
5532
  render: column.renderGroupIcon,
5249
5533
  renderParam: Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)
5250
5534
  }) : defaultIcon;
5251
5535
  }
5252
- return /* @__PURE__ */ React25.createElement("div", {
5536
+ return /* @__PURE__ */ React28.createElement("div", {
5253
5537
  className: join(display.flex, alignItems.center)
5254
- }, icon, /* @__PURE__ */ React25.createElement("div", {
5538
+ }, icon, /* @__PURE__ */ React28.createElement("div", {
5255
5539
  className: cssEllipsisClassName
5256
5540
  }, value != null ? value : null));
5257
5541
  };
@@ -5296,9 +5580,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
5296
5580
  const showExpanderIcon = rowInfo.isGroupRow ? pivotBy ? (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < (groupBy == null ? void 0 : groupBy.length) : (((_b = rowInfo.groupKeys) == null ? void 0 : _b.length) || 0) <= (groupBy == null ? void 0 : groupBy.length) : false;
5297
5581
  const isLoading = showLoadingIcon(rowInfo);
5298
5582
  if (isLoading) {
5299
- icon = /* @__PURE__ */ React25.createElement(LoadingIcon, null);
5583
+ icon = /* @__PURE__ */ React28.createElement(LoadingIcon, null);
5300
5584
  } else if (showExpanderIcon) {
5301
- const defaultIcon = /* @__PURE__ */ React25.createElement(ExpanderIcon, {
5585
+ const defaultIcon = /* @__PURE__ */ React28.createElement(ExpanderIcon, {
5302
5586
  expanded: !collapsed,
5303
5587
  onChange: () => {
5304
5588
  if (!rowInfo.isGroupRow) {
@@ -5313,9 +5597,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
5313
5597
  icon = column.renderGroupIcon(renderParam);
5314
5598
  }
5315
5599
  }
5316
- return /* @__PURE__ */ React25.createElement("div", {
5600
+ return /* @__PURE__ */ React28.createElement("div", {
5317
5601
  className: join(display.flex, alignItems.center, GroupRowExpanderCls)
5318
- }, icon, /* @__PURE__ */ React25.createElement("div", {
5602
+ }, icon, /* @__PURE__ */ React28.createElement("div", {
5319
5603
  className: cssEllipsisClassName
5320
5604
  }, value != null ? value : null));
5321
5605
  }
@@ -5331,11 +5615,11 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
5331
5615
  }
5332
5616
 
5333
5617
  // src/components/InfiniteTable/hooks/useEffectWithRaf.ts
5334
- var import_react30 = __toModule(require("react"));
5618
+ var import_react32 = __toModule(require("react"));
5335
5619
  function useEffectWithRaf(fn, deps) {
5336
- const rafId = (0, import_react30.useRef)(0);
5337
- const removeFnRaf = (0, import_react30.useRef)();
5338
- (0, import_react30.useEffect)(() => {
5620
+ const rafId = (0, import_react32.useRef)(0);
5621
+ const removeFnRaf = (0, import_react32.useRef)();
5622
+ (0, import_react32.useEffect)(() => {
5339
5623
  rafId.current = requestAnimationFrame(() => {
5340
5624
  removeFnRaf.current = fn();
5341
5625
  });
@@ -5352,7 +5636,7 @@ function useEffectWithRaf(fn, deps) {
5352
5636
  }
5353
5637
 
5354
5638
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
5355
- var import_react33 = __toModule(require("react"));
5639
+ var import_react35 = __toModule(require("react"));
5356
5640
 
5357
5641
  // src/utils/groupAndPivot/index.ts
5358
5642
  var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
@@ -5420,21 +5704,18 @@ function lazyGroup(groupParams, rootData) {
5420
5704
  rootData.visitDepthFirst((lazyGroupRowInfo, keys, _index, next) => {
5421
5705
  const [_rootKey, ...currentGroupKeys] = keys;
5422
5706
  const dataArray = lazyGroupRowInfo.children;
5423
- if (currentGroupKeys.length == groupBy.length && groupBy.length) {
5424
- const deepMapGroupValue = deepMap.get(currentGroupKeys);
5425
- if (deepMapGroupValue) {
5426
- deepMapGroupValue.items = dataArray;
5427
- }
5428
- return next == null ? void 0 : next();
5707
+ const current = deepMap.get(currentGroupKeys);
5708
+ if (current) {
5709
+ current.cache = lazyGroupRowInfo.cache;
5710
+ current.childrenLoading = lazyGroupRowInfo.childrenLoading;
5711
+ current.childrenAvailable = lazyGroupRowInfo.childrenAvailable;
5712
+ current.error = lazyGroupRowInfo.error;
5429
5713
  }
5430
- if (lazyGroupRowInfo) {
5431
- const current = deepMap.get(currentGroupKeys);
5714
+ if (currentGroupKeys.length == groupBy.length && groupBy.length) {
5432
5715
  if (current) {
5433
- current.cache = lazyGroupRowInfo.cache;
5434
- current.childrenLoading = lazyGroupRowInfo.childrenLoading;
5435
- current.childrenAvailable = lazyGroupRowInfo.childrenAvailable;
5436
- current.error = lazyGroupRowInfo.error;
5716
+ current.items = dataArray;
5437
5717
  }
5718
+ return next == null ? void 0 : next();
5438
5719
  }
5439
5720
  for (let i = 0, len = dataArray.length; i < len; i++) {
5440
5721
  if (!dataArray[i]) {
@@ -5763,8 +6044,9 @@ function enhancedFlatten(param) {
5763
6044
  }
5764
6045
  for (let index = 0, len = items.length; index < len; index++) {
5765
6046
  const item = items[index];
6047
+ const indexInAll = startIndex + index;
5766
6048
  const rowInfo = {
5767
- id: item ? toPrimaryKey(item) : `${groupKeys}-${index}`,
6049
+ id: item ? toPrimaryKey(item, indexInAll) : `${groupKeys}-${index}`,
5768
6050
  data: item,
5769
6051
  dataSourceHasGrouping: true,
5770
6052
  isGroupRow: false,
@@ -5775,7 +6057,7 @@ function enhancedFlatten(param) {
5775
6057
  parents: Array.from(parents),
5776
6058
  indexInParentGroups: [...indexInParentGroups, index],
5777
6059
  indexInGroup: index,
5778
- indexInAll: startIndex + index,
6060
+ indexInAll,
5779
6061
  groupBy: groupByStrings,
5780
6062
  groupNesting,
5781
6063
  groupCount: enhancedGroupData.groupCount
@@ -5807,7 +6089,7 @@ function enhancedFlatten(param) {
5807
6089
  }
5808
6090
 
5809
6091
  // src/components/DataSource/index.tsx
5810
- var React26 = __toModule(require("react"));
6092
+ var React29 = __toModule(require("react"));
5811
6093
 
5812
6094
  // src/utils/multisort/sortTypes.ts
5813
6095
  var numberComparator = function(first, second) {
@@ -5818,11 +6100,11 @@ var stringComparator = function(first, second) {
5818
6100
  second = `${second}`;
5819
6101
  return first.localeCompare(second);
5820
6102
  };
5821
- var sortTypes = {
6103
+ var defaultSortTypes = {
5822
6104
  number: numberComparator,
5823
6105
  string: stringComparator
5824
6106
  };
5825
- var sortTypes_default = sortTypes;
6107
+ var sortTypes_default = defaultSortTypes;
5826
6108
 
5827
6109
  // src/utils/multisort/index.ts
5828
6110
  var multisort = (sortInfo, array, get) => {
@@ -5835,7 +6117,8 @@ var getSingleSortFunction = (info) => {
5835
6117
  return;
5836
6118
  }
5837
6119
  const field = info.field;
5838
- var dir = info.dir < 0 ? -1 : info.dir > 0 ? 1 : 0;
6120
+ const valueGetter = info.valueGetter;
6121
+ const dir = info.dir < 0 ? -1 : info.dir > 0 ? 1 : 0;
5839
6122
  if (!dir) {
5840
6123
  return;
5841
6124
  }
@@ -5850,8 +6133,8 @@ var getSingleSortFunction = (info) => {
5850
6133
  fn = sortTypes_default.string;
5851
6134
  }
5852
6135
  return (first, second) => {
5853
- const a = field ? first[field] : first;
5854
- const b = field ? second[field] : second;
6136
+ const a = valueGetter ? valueGetter(first) : field ? first[field] : first;
6137
+ const b = valueGetter ? valueGetter(second) : field ? second[field] : second;
5855
6138
  return dir * fn(a, b);
5856
6139
  };
5857
6140
  };
@@ -5874,25 +6157,135 @@ var getMultisortFunction = (sortInfo, get) => {
5874
6157
  if (!fn) {
5875
6158
  continue;
5876
6159
  }
5877
- result = fn(first, second);
5878
- if (result !== 0) {
5879
- return result;
6160
+ result = fn(first, second);
6161
+ if (result !== 0) {
6162
+ return result;
6163
+ }
6164
+ }
6165
+ return result;
6166
+ };
6167
+ };
6168
+
6169
+ // src/components/DataSource/GroupRowsState.ts
6170
+ var GroupRowsState = class {
6171
+ constructor(state) {
6172
+ this.update(state instanceof GroupRowsState ? state.getState() : state);
6173
+ }
6174
+ getState() {
6175
+ var _a, _b, _c, _d;
6176
+ return {
6177
+ expandedRows: this.expandedAll ? true : (_b = (_a = this.expandedMap) == null ? void 0 : _a.topDownKeys()) != null ? _b : [],
6178
+ collapsedRows: this.collapsedAll ? true : (_d = (_c = this.collapsedMap) == null ? void 0 : _c.topDownKeys()) != null ? _d : []
6179
+ };
6180
+ }
6181
+ destroy() {
6182
+ var _a, _b;
6183
+ (_a = this.expandedMap) == null ? void 0 : _a.clear();
6184
+ (_b = this.collapsedMap) == null ? void 0 : _b.clear();
6185
+ delete this.expandedMap;
6186
+ delete this.collapsedMap;
6187
+ }
6188
+ update(state) {
6189
+ var _a, _b, _c, _d;
6190
+ this.initialState = state;
6191
+ const { collapsedRows, expandedRows } = this.initialState;
6192
+ this.collapsedAll = collapsedRows === true;
6193
+ this.expandedAll = expandedRows === true;
6194
+ if (this.collapsedAll && this.expandedAll) {
6195
+ throw `Cannot have both collapsedRows and expandedRows be true!`;
6196
+ }
6197
+ if (collapsedRows !== true) {
6198
+ (_a = this.collapsedMap) == null ? void 0 : _a.clear();
6199
+ this.collapsedMap = (_b = this.collapsedMap) != null ? _b : new DeepMap(collapsedRows.map((keys) => [keys, true]));
6200
+ }
6201
+ if (expandedRows !== true) {
6202
+ (_c = this.expandedMap) == null ? void 0 : _c.clear();
6203
+ this.expandedMap = (_d = this.expandedMap) != null ? _d : new DeepMap(expandedRows.map((keys) => [keys, true]));
6204
+ }
6205
+ }
6206
+ areAllCollapsed() {
6207
+ return this.collapsedAll && (this.expandedMap ? this.expandedMap.size === 0 : true);
6208
+ }
6209
+ areAllExpanded() {
6210
+ return this.expandedAll && (this.collapsedMap ? this.collapsedMap.size === 0 : true);
6211
+ }
6212
+ collapseAll() {
6213
+ this.update({
6214
+ collapsedRows: true,
6215
+ expandedRows: []
6216
+ });
6217
+ }
6218
+ expandAll() {
6219
+ this.update({
6220
+ expandedRows: true,
6221
+ collapsedRows: []
6222
+ });
6223
+ }
6224
+ isGroupRowExpanded(keys) {
6225
+ var _a, _b;
6226
+ if (this.expandedAll === true) {
6227
+ if (this.collapsedAll === true) {
6228
+ throw 'Cannot have both expandedRows and collapsedRows be "true"';
6229
+ }
6230
+ return !((_a = this.collapsedMap) == null ? void 0 : _a.has(keys));
6231
+ }
6232
+ return (_b = this.expandedMap) == null ? void 0 : _b.has(keys);
6233
+ }
6234
+ isGroupRowCollapsed(keys) {
6235
+ return !this.isGroupRowExpanded(keys);
6236
+ }
6237
+ setGroupRowExpanded(keys, shouldExpand) {
6238
+ var _a;
6239
+ if (shouldExpand === this.isGroupRowExpanded(keys)) {
6240
+ return;
6241
+ }
6242
+ if (shouldExpand) {
6243
+ if (this.collapsedAll === true) {
6244
+ if (!this.expandedMap) {
6245
+ throw `No expandedMap found when trying to expand group row ${keys.join(",")}`;
6246
+ }
6247
+ this.expandedMap.set(keys, true);
6248
+ } else if (this.expandedAll === true) {
6249
+ if (!this.collapsedMap) {
6250
+ throw `No collapsedMap found when trying to expand group row ${keys.join(",")}`;
6251
+ }
6252
+ this.collapsedMap.delete(keys);
6253
+ }
6254
+ } else {
6255
+ if (this.expandedAll === true) {
6256
+ if (!this.collapsedMap) {
6257
+ throw `No collapsedMap found when trying to collapse group row ${keys.join(",")}`;
6258
+ }
6259
+ this.collapsedMap.set(keys, true);
6260
+ } else if (this.collapsedAll === true) {
6261
+ if (!this.expandedMap) {
6262
+ throw `No expandedMap found when trying to collapse group row ${keys.join(",")}`;
6263
+ }
6264
+ (_a = this.expandedMap) == null ? void 0 : _a.delete(keys);
5880
6265
  }
5881
6266
  }
5882
- return result;
5883
- };
6267
+ }
6268
+ collapseGroupRow(keys) {
6269
+ this.setGroupRowExpanded(keys, false);
6270
+ }
6271
+ expandGroupRow(keys) {
6272
+ this.setGroupRowExpanded(keys, true);
6273
+ }
6274
+ toggleGroupRow(keys) {
6275
+ this.setGroupRowExpanded(keys, !this.isGroupRowExpanded(keys));
6276
+ }
5884
6277
  };
5885
6278
 
5886
6279
  // src/components/DataSource/privateHooks/useLoadData.ts
5887
- var import_react32 = __toModule(require("react"));
6280
+ var import_react34 = __toModule(require("react"));
5888
6281
 
5889
6282
  // src/components/hooks/useEffectWithChanges.ts
5890
- var import_react31 = __toModule(require("react"));
6283
+ var import_react33 = __toModule(require("react"));
5891
6284
  function useEffectWithChanges(fn, deps) {
5892
- const prevRef = (0, import_react31.useRef)({});
5893
- const oldValuesRef = (0, import_react31.useRef)({});
6285
+ const prevRef = (0, import_react33.useRef)({});
6286
+ const oldValuesRef = (0, import_react33.useRef)({});
5894
6287
  const oldValues = oldValuesRef.current;
5895
- const changesRef = (0, import_react31.useRef)({});
6288
+ const changesRef = (0, import_react33.useRef)({});
5896
6289
  const changes = changesRef.current;
5897
6290
  const useEffectDeps = [];
5898
6291
  for (const k in deps) {
@@ -5905,7 +6298,7 @@ function useEffectWithChanges(fn, deps) {
5905
6298
  }
5906
6299
  }
5907
6300
  prevRef.current = deps;
5908
- (0, import_react31.useEffect)(() => {
6301
+ (0, import_react33.useEffect)(() => {
5909
6302
  const changes2 = changesRef.current;
5910
6303
  const result = fn(changes2, oldValues);
5911
6304
  changesRef.current = {};
@@ -5958,6 +6351,7 @@ function buildDataSourceDataParams(componentState, overrides) {
5958
6351
  sortInfo,
5959
6352
  groupBy: componentState.groupBy,
5960
6353
  pivotBy: componentState.pivotBy,
6354
+ filterValue: componentState.filterValue,
5961
6355
  aggregationReducers: componentState.aggregationReducers
5962
6356
  };
5963
6357
  if (dataSourceParams.groupBy) {
@@ -5977,6 +6371,13 @@ function buildDataSourceDataParams(componentState, overrides) {
5977
6371
  if (overrides) {
5978
6372
  Object.assign(dataSourceParams, overrides);
5979
6373
  }
6374
+ if (dataSourceParams.filterValue && dataSourceParams.filterValue.length) {
6375
+ dataSourceParams.filterValue = dataSourceParams.filterValue.map((f) => {
6376
+ const value = __spreadValues({}, f);
6377
+ delete value.valueGetter;
6378
+ return value;
6379
+ });
6380
+ }
5980
6381
  const changes = {};
5981
6382
  const oldDataSourceParams = componentState.dataParams || {};
5982
6383
  for (const k in dataSourceParams) {
@@ -5997,6 +6398,13 @@ function loadData(data, componentState, actions, overrides) {
5997
6398
  const lazyGroupData = componentState.originalLazyGroupData;
5998
6399
  const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys || []];
5999
6400
  const existingGroupRowInfo = lazyGroupData.get(key);
6401
+ if (!existingGroupRowInfo) {
6402
+ const groupCacheKeys = [
6403
+ ...dataParams.groupKeys || [],
6404
+ dataParams.lazyLoadStartIndex
6405
+ ];
6406
+ componentState.lazyLoadCacheOfLoadedBatches.set(groupCacheKeys, true);
6407
+ }
6000
6408
  if (existingGroupRowInfo && existingGroupRowInfo.cache && key.length > 1) {
6001
6409
  const items = existingGroupRowInfo.children;
6002
6410
  const len = items.length;
@@ -6022,7 +6430,8 @@ function loadData(data, componentState, actions, overrides) {
6022
6430
  childrenLoading: true,
6023
6431
  childrenAvailable: false,
6024
6432
  cache: CACHE_DEFAULT,
6025
- totalCount: 0
6433
+ totalCount: 0,
6434
+ totalCountUnfiltered: 0
6026
6435
  });
6027
6436
  }
6028
6437
  actions.originalLazyGroupDataChangeDetect = getChangeDetect();
@@ -6046,9 +6455,12 @@ function loadData(data, componentState, actions, overrides) {
6046
6455
  if (remoteData.mappings) {
6047
6456
  actions.pivotMappings = remoteData.mappings;
6048
6457
  }
6458
+ if (remoteData.totalCountUnfiltered) {
6459
+ actions.unfilteredCount = remoteData.totalCountUnfiltered;
6460
+ }
6049
6461
  if (componentState.lazyLoad) {
6050
6462
  let resolveRemoteData = function(keys, remoteData2, parentKeys) {
6051
- var _a, _b, _c;
6463
+ var _a, _b, _c, _d;
6052
6464
  const theKey = [LAZY_ROOT_KEY_FOR_GROUPS, ...keys];
6053
6465
  const dataArray2 = remoteData2.data;
6054
6466
  const newGroupRowInfo = {
@@ -6056,6 +6468,7 @@ function loadData(data, componentState, actions, overrides) {
6056
6468
  childrenLoading: false,
6057
6469
  childrenAvailable: true,
6058
6470
  totalCount: (_a = remoteData2.totalCount) != null ? _a : dataArray2.length,
6471
+ totalCountUnfiltered: (_b = remoteData2.totalCount) != null ? _b : dataArray2.length,
6059
6472
  children: dataArray2,
6060
6473
  error: remoteData2.error
6061
6474
  };
@@ -6070,8 +6483,8 @@ function loadData(data, componentState, actions, overrides) {
6070
6483
  currentGroupRowInfo.chidren = [];
6071
6484
  }
6072
6485
  currentGroupRowInfo.children.length = currentGroupRowInfo.totalCount;
6073
- const start = (_b = dataParams.lazyLoadStartIndex) != null ? _b : 0;
6074
- const end = Math.min((_c = remoteData2.totalCount) != null ? _c : dataArray2.length, start + dataParams.lazyLoadBatchSize);
6486
+ const start = (_c = dataParams.lazyLoadStartIndex) != null ? _c : 0;
6487
+ const end = Math.min((_d = remoteData2.totalCount) != null ? _d : dataArray2.length, start + dataParams.lazyLoadBatchSize);
6075
6488
  for (let i = start; i < end; i++) {
6076
6489
  const it = newGroupRowInfo.children[i - start];
6077
6490
  if (!it) {
@@ -6148,16 +6561,17 @@ function useLoadData() {
6148
6561
  sortInfo,
6149
6562
  groupBy,
6150
6563
  pivotBy,
6564
+ filterValue,
6151
6565
  livePagination,
6152
6566
  livePaginationCursor,
6153
6567
  cursorId: stateCursorId
6154
6568
  } = componentState;
6155
- const [scrollbars, setScrollbars] = (0, import_react32.useState)({
6569
+ const [scrollbars, setScrollbars] = (0, import_react34.useState)({
6156
6570
  vertical: false,
6157
6571
  horizontal: false
6158
6572
  });
6159
- const scrollbarsRef = (0, import_react32.useRef)(scrollbars);
6160
- (0, import_react32.useEffect)(() => {
6573
+ const scrollbarsRef = (0, import_react34.useRef)(scrollbars);
6574
+ (0, import_react34.useEffect)(() => {
6161
6575
  notifyScrollbarsChange.onChange((scrollbars2) => {
6162
6576
  if (!scrollbars2) {
6163
6577
  return;
@@ -6167,7 +6581,7 @@ function useLoadData() {
6167
6581
  });
6168
6582
  return () => notifyScrollbarsChange.destroy();
6169
6583
  }, [notifyScrollbarsChange]);
6170
- (0, import_react32.useEffect)(() => {
6584
+ (0, import_react34.useEffect)(() => {
6171
6585
  if (!livePagination) {
6172
6586
  return;
6173
6587
  }
@@ -6181,7 +6595,7 @@ function useLoadData() {
6181
6595
  });
6182
6596
  return () => cancelAnimationFrame(frameId);
6183
6597
  }, [livePaginationCursor]);
6184
- (0, import_react32.useEffect)(() => {
6598
+ (0, import_react34.useEffect)(() => {
6185
6599
  if (!livePagination || livePaginationCursor !== void 0) {
6186
6600
  return;
6187
6601
  }
@@ -6195,7 +6609,7 @@ function useLoadData() {
6195
6609
  });
6196
6610
  return () => cancelAnimationFrame(frameId);
6197
6611
  }, [dataArray.length, livePaginationCursor]);
6198
- (0, import_react32.useEffect)(() => {
6612
+ (0, import_react34.useEffect)(() => {
6199
6613
  const state = getComponentState();
6200
6614
  const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
6201
6615
  if (!scrollbars.vertical && livePagination2) {
@@ -6210,9 +6624,10 @@ function useLoadData() {
6210
6624
  sortInfo,
6211
6625
  groupBy,
6212
6626
  pivotBy,
6627
+ filterValue,
6213
6628
  cursorId: livePagination ? stateCursorId : null
6214
6629
  };
6215
- const initialRef = (0, import_react32.useRef)(true);
6630
+ const initialRef = (0, import_react34.useRef)(true);
6216
6631
  useLazyLoadRange();
6217
6632
  useEffectWithChanges(() => {
6218
6633
  const componentState2 = getComponentState();
@@ -6244,7 +6659,7 @@ function useLazyLoadRange() {
6244
6659
  componentActions: actions,
6245
6660
  componentState
6246
6661
  } = useComponentState();
6247
- (0, import_react32.useEffect)(() => {
6662
+ (0, import_react34.useEffect)(() => {
6248
6663
  actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
6249
6664
  }, [componentState.data, componentState.dataParams]);
6250
6665
  const {
@@ -6253,7 +6668,7 @@ function useLazyLoadRange() {
6253
6668
  dataArray,
6254
6669
  scrollStopDelayUpdatedByTable
6255
6670
  } = componentState;
6256
- const latestRenderRangeRef = (0, import_react32.useRef)(null);
6671
+ const latestRenderRangeRef = (0, import_react34.useRef)(null);
6257
6672
  const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
6258
6673
  const componentState2 = getComponentState();
6259
6674
  renderRange = renderRange || latestRenderRangeRef.current;
@@ -6272,8 +6687,8 @@ function useLazyLoadRange() {
6272
6687
  componentActions: actions
6273
6688
  }, cache);
6274
6689
  };
6275
- const debouncedLoadRange = (0, import_react32.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
6276
- (0, import_react32.useEffect)(() => {
6690
+ const debouncedLoadRange = (0, import_react34.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
6691
+ (0, import_react34.useEffect)(() => {
6277
6692
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
6278
6693
  return notifyRenderRangeChange.onChange((renderRange) => {
6279
6694
  latestRenderRangeRef.current = renderRange;
@@ -6282,7 +6697,7 @@ function useLazyLoadRange() {
6282
6697
  }
6283
6698
  return;
6284
6699
  }, [lazyLoadBatchSize]);
6285
- (0, import_react32.useEffect)(() => {
6700
+ (0, import_react34.useEffect)(() => {
6286
6701
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
6287
6702
  debouncedLoadRange();
6288
6703
  }
@@ -6315,7 +6730,7 @@ function lazyLoadRange(options, cache) {
6315
6730
  theGroupKeys.pop();
6316
6731
  }
6317
6732
  const cacheKeys = theGroupKeys.length ? theGroupKeys : rootGroupKeys;
6318
- const indexInGroup = rowInfo.isGroupRow ? rowInfo.indexInGroup : rowInfo.indexInAll;
6733
+ const indexInGroup = rowInfo.dataSourceHasGrouping ? rowInfo.indexInGroup : rowInfo.indexInAll;
6319
6734
  if (rowInfo.isGroupRow && !rowInfo.collapsed && !rowInfo.childrenAvailable) {
6320
6735
  const currentFnCall = {
6321
6736
  lazyLoadStartIndex: 0,
@@ -6338,7 +6753,7 @@ function lazyLoadRange(options, cache) {
6338
6753
  if (!rowLoaded) {
6339
6754
  let cachedFnCalls = perGroupFnCalls.get(cacheKeys);
6340
6755
  const batchStartIndexInGroup = Math.floor(indexInGroup / lazyLoadBatchSize) * lazyLoadBatchSize;
6341
- const offset = (rowInfo.isGroupRow ? rowInfo.indexInGroup : rowInfo.indexInAll) - batchStartIndexInGroup;
6756
+ const offset = indexInGroup - batchStartIndexInGroup;
6342
6757
  const absoluteIndexOfBatchStart = dataArray[rowInfo.indexInAll - offset].indexInAll;
6343
6758
  const batchStartRowLoaded = isRowLoaded(absoluteIndexOfBatchStart);
6344
6759
  const batchStartRowId = dataArray[absoluteIndexOfBatchStart].id;
@@ -6436,116 +6851,6 @@ function discardCallsWithEqualArg(fn, timeframe = 50, getCompareObject) {
6436
6851
  };
6437
6852
  }
6438
6853
 
6439
- // src/components/DataSource/GroupRowsState.ts
6440
- var GroupRowsState = class {
6441
- constructor(state) {
6442
- this.update(state instanceof GroupRowsState ? state.getState() : state);
6443
- }
6444
- getState() {
6445
- var _a, _b, _c, _d;
6446
- return {
6447
- expandedRows: this.expandedAll ? true : (_b = (_a = this.expandedMap) == null ? void 0 : _a.topDownKeys()) != null ? _b : [],
6448
- collapsedRows: this.collapsedAll ? true : (_d = (_c = this.collapsedMap) == null ? void 0 : _c.topDownKeys()) != null ? _d : []
6449
- };
6450
- }
6451
- destroy() {
6452
- var _a, _b;
6453
- (_a = this.expandedMap) == null ? void 0 : _a.clear();
6454
- (_b = this.collapsedMap) == null ? void 0 : _b.clear();
6455
- delete this.expandedMap;
6456
- delete this.collapsedMap;
6457
- }
6458
- update(state) {
6459
- var _a, _b, _c, _d;
6460
- this.initialState = state;
6461
- const { collapsedRows, expandedRows } = this.initialState;
6462
- this.collapsedAll = collapsedRows === true;
6463
- this.expandedAll = expandedRows === true;
6464
- if (this.collapsedAll && this.expandedAll) {
6465
- throw `Cannot have both collapsedRows and expandedRows be true!`;
6466
- }
6467
- if (collapsedRows !== true) {
6468
- (_a = this.collapsedMap) == null ? void 0 : _a.clear();
6469
- this.collapsedMap = (_b = this.collapsedMap) != null ? _b : new DeepMap(collapsedRows.map((keys) => [keys, true]));
6470
- }
6471
- if (expandedRows !== true) {
6472
- (_c = this.expandedMap) == null ? void 0 : _c.clear();
6473
- this.expandedMap = (_d = this.expandedMap) != null ? _d : new DeepMap(expandedRows.map((keys) => [keys, true]));
6474
- }
6475
- }
6476
- areAllCollapsed() {
6477
- return this.collapsedAll && (this.expandedMap ? this.expandedMap.size === 0 : true);
6478
- }
6479
- areAllExpanded() {
6480
- return this.expandedAll && (this.collapsedMap ? this.collapsedMap.size === 0 : true);
6481
- }
6482
- collapseAll() {
6483
- this.update({
6484
- collapsedRows: true,
6485
- expandedRows: []
6486
- });
6487
- }
6488
- expandAll() {
6489
- this.update({
6490
- expandedRows: true,
6491
- collapsedRows: []
6492
- });
6493
- }
6494
- isGroupRowExpanded(keys) {
6495
- var _a, _b;
6496
- if (this.expandedAll === true) {
6497
- if (this.collapsedAll === true) {
6498
- throw 'Cannot have both expandedRows and collapsedRows be "true"';
6499
- }
6500
- return !((_a = this.collapsedMap) == null ? void 0 : _a.has(keys));
6501
- }
6502
- return (_b = this.expandedMap) == null ? void 0 : _b.has(keys);
6503
- }
6504
- isGroupRowCollapsed(keys) {
6505
- return !this.isGroupRowExpanded(keys);
6506
- }
6507
- setGroupRowExpanded(keys, shouldExpand) {
6508
- var _a;
6509
- if (shouldExpand === this.isGroupRowExpanded(keys)) {
6510
- return;
6511
- }
6512
- if (shouldExpand) {
6513
- if (this.collapsedAll === true) {
6514
- if (!this.expandedMap) {
6515
- throw `No expandedMap found when trying to expand group row ${keys.join(",")}`;
6516
- }
6517
- this.expandedMap.set(keys, true);
6518
- } else if (this.expandedAll === true) {
6519
- if (!this.collapsedMap) {
6520
- throw `No collapsedMap found when trying to expand group row ${keys.join(",")}`;
6521
- }
6522
- this.collapsedMap.delete(keys);
6523
- }
6524
- } else {
6525
- if (this.expandedAll === true) {
6526
- if (!this.collapsedMap) {
6527
- throw `No collapsedMap found when trying to collapse group row ${keys.join(",")}`;
6528
- }
6529
- this.collapsedMap.set(keys, true);
6530
- } else if (this.collapsedAll === true) {
6531
- if (!this.expandedMap) {
6532
- throw `No expandedMap found when trying to collapse group row ${keys.join(",")}`;
6533
- }
6534
- (_a = this.expandedMap) == null ? void 0 : _a.delete(keys);
6535
- }
6536
- }
6537
- }
6538
- collapseGroupRow(keys) {
6539
- this.setGroupRowExpanded(keys, false);
6540
- }
6541
- expandGroupRow(keys) {
6542
- this.setGroupRowExpanded(keys, true);
6543
- }
6544
- toggleGroupRow(keys) {
6545
- this.setGroupRowExpanded(keys, !this.isGroupRowExpanded(keys));
6546
- }
6547
- };
6548
-
6549
6854
  // src/components/DataSource/state/normalizeSortInfo.ts
6550
6855
  var EMPTY_ARRAY = Object.freeze([]);
6551
6856
  var normalizeSortInfo = (initialSortInfo, weakMap) => {
@@ -6591,9 +6896,12 @@ function initSetupState() {
6591
6896
  pivotColumns: void 0,
6592
6897
  pivotColumnGroups: void 0,
6593
6898
  dataArray,
6899
+ unfilteredCount: dataArray.length,
6900
+ filteredCount: dataArray.length,
6594
6901
  updatedAt: now,
6595
6902
  groupedAt: 0,
6596
6903
  sortedAt: 0,
6904
+ filteredAt: 0,
6597
6905
  reducedAt: now,
6598
6906
  generateGroupRows: true,
6599
6907
  groupDeepMap: void 0,
@@ -6616,6 +6924,15 @@ var forwardProps2 = (setupState) => {
6616
6924
  pivotBy: 1,
6617
6925
  primaryKey: 1,
6618
6926
  livePagination: 1,
6927
+ filterFunction: 1,
6928
+ filterValue: 1,
6929
+ filterDelay: (filterDelay) => filterDelay != null ? filterDelay : 200,
6930
+ filterTypes: (filterTypes) => {
6931
+ return __spreadValues(__spreadValues({}, defaultFilterTypes), filterTypes);
6932
+ },
6933
+ sortTypes: (sortTypes) => {
6934
+ return __spreadValues(__spreadValues({}, sortTypes_default), sortTypes);
6935
+ },
6619
6936
  aggregationReducers: 1,
6620
6937
  collapseGroupRowsOnDataFunctionChange: (collapseGroupRowsOnDataFunctionChange) => collapseGroupRowsOnDataFunctionChange != null ? collapseGroupRowsOnDataFunctionChange : true,
6621
6938
  loading: (loading) => loading != null ? loading : false,
@@ -6641,10 +6958,25 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
6641
6958
  return livePaginationCursor;
6642
6959
  }
6643
6960
  function mapPropsToState(params) {
6961
+ var _a;
6644
6962
  const { props, state, oldState } = params;
6645
6963
  const controlledSort = isControlledValue(props.sortInfo);
6964
+ const controlledFilter = isControlledValue(props.filterValue);
6965
+ const { filterTypes } = state;
6966
+ const operatorsByFilterType = Object.keys(filterTypes).reduce((acc, key) => {
6967
+ const operators = filterTypes[key].operators;
6968
+ acc[key] = acc[key] || {};
6969
+ const currentFilterTypeOperators = acc[key];
6970
+ operators.forEach((operator) => {
6971
+ currentFilterTypeOperators[operator.name] = operator;
6972
+ });
6973
+ return acc;
6974
+ }, {});
6646
6975
  const result = {
6976
+ operatorsByFilterType,
6647
6977
  controlledSort,
6978
+ controlledFilter,
6979
+ filterMode: ((_a = props.filterMode) != null ? _a : props.filterFunction != null) ? "client" : typeof props.data === "function" ? "server" : "client",
6648
6980
  multiSort: Array.isArray(controlledSort ? props.sortInfo : props.defaultSortInfo),
6649
6981
  lazyLoadBatchSize: typeof props.lazyLoad === "object" ? props.lazyLoad.batchSize : void 0
6650
6982
  };
@@ -6709,6 +7041,18 @@ function getInterceptActions() {
6709
7041
  });
6710
7042
  }
6711
7043
  },
7044
+ filterValue: (filterValue, { actions, state }) => {
7045
+ const dataParams = buildDataSourceDataParams(state, {
7046
+ filterValue,
7047
+ livePaginationCursor: null
7048
+ });
7049
+ actions.dataParams = dataParams;
7050
+ if (state.livePagination) {
7051
+ requestAnimationFrame(() => {
7052
+ actions.livePaginationCursor = null;
7053
+ });
7054
+ }
7055
+ },
6712
7056
  cursorId: (cursorId, { actions, state }) => {
6713
7057
  const dataParams = buildDataSourceDataParams(state, {
6714
7058
  __cursorId: cursorId
@@ -6790,7 +7134,7 @@ function getPivotColumnsAndColumnGroups({
6790
7134
  pivotGroupKeys: [],
6791
7135
  pivotGroupKey: "",
6792
7136
  pivotIndex: -1,
6793
- valueGetter: ({ rowInfo }) => {
7137
+ valueFormatter: ({ rowInfo }) => {
6794
7138
  var _a;
6795
7139
  return rowInfo.isGroupRow ? (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id] : null;
6796
7140
  }
@@ -6839,7 +7183,7 @@ function getPivotColumnsAndColumnGroups({
6839
7183
  sortable: false,
6840
7184
  columnGroup: parentColumnGroupId,
6841
7185
  header,
6842
- valueGetter: ({ rowInfo }) => {
7186
+ valueFormatter: ({ rowInfo }) => {
6843
7187
  var _a, _b;
6844
7188
  if (!rowInfo.isGroupRow) {
6845
7189
  return null;
@@ -6894,7 +7238,7 @@ function getPivotColumnsAndColumnGroups({
6894
7238
  pivotIndex: keys.length - 1,
6895
7239
  pivotBy,
6896
7240
  sortable: false,
6897
- valueGetter: ({ rowInfo }) => {
7241
+ valueFormatter: ({ rowInfo }) => {
6898
7242
  var _a, _b;
6899
7243
  if (!rowInfo.isGroupRow) {
6900
7244
  return null;
@@ -6942,9 +7286,68 @@ function toRowInfo(data, id, index) {
6942
7286
  selfLoaded: true
6943
7287
  };
6944
7288
  }
7289
+ function filterDataSource(params) {
7290
+ const {
7291
+ filterTypes,
7292
+ filterValue: filterValueArray,
7293
+ operatorsByFilterType,
7294
+ filterFunction,
7295
+ toPrimaryKey
7296
+ } = params;
7297
+ let { dataArray } = params;
7298
+ if (filterFunction) {
7299
+ dataArray = dataArray.filter((data, index, arr) => filterFunction({
7300
+ data,
7301
+ index,
7302
+ dataArray: arr,
7303
+ primaryKey: toPrimaryKey(data, index)
7304
+ }));
7305
+ }
7306
+ if (filterValueArray && filterValueArray.length) {
7307
+ return dataArray.filter((data, index, arr) => {
7308
+ var _a;
7309
+ const param = {
7310
+ data,
7311
+ index,
7312
+ dataArray: arr,
7313
+ primaryKey: toPrimaryKey(data, index)
7314
+ };
7315
+ for (let i = 0, len = filterValueArray.length; i < len; i++) {
7316
+ const currentFilterValue = filterValueArray[i];
7317
+ const {
7318
+ disabled,
7319
+ filterValue,
7320
+ field,
7321
+ filterType: filterTypeKey,
7322
+ valueGetter,
7323
+ operator
7324
+ } = currentFilterValue;
7325
+ const filterType = filterTypes[filterTypeKey];
7326
+ if (disabled || !filterType) {
7327
+ continue;
7328
+ }
7329
+ const currentOperator = (_a = operatorsByFilterType[filterTypeKey]) == null ? void 0 : _a[operator];
7330
+ if (!currentOperator) {
7331
+ continue;
7332
+ }
7333
+ const getter = valueGetter || (({ data: data2 }) => field ? data2[field] : data2);
7334
+ const operatorFnParam = __spreadValues({}, param);
7335
+ operatorFnParam.filterValue = filterValue;
7336
+ operatorFnParam.currentValue = getter(param);
7337
+ operatorFnParam.emptyValues = filterType.emptyValues;
7338
+ if (!currentOperator.fn(operatorFnParam)) {
7339
+ return false;
7340
+ }
7341
+ }
7342
+ return true;
7343
+ });
7344
+ }
7345
+ return dataArray;
7346
+ }
6945
7347
  function concludeReducer(params) {
6946
7348
  var _a, _b;
6947
7349
  const { state, previousState } = params;
7350
+ const primaryKeyDescriptor = state.primaryKey;
6948
7351
  const sortInfo = state.sortInfo;
6949
7352
  let shouldSort = !!(sortInfo == null ? void 0 : sortInfo.length) && !state.controlledSort;
6950
7353
  if (state.lazyLoad || state.livePagination) {
@@ -6962,15 +7365,24 @@ function concludeReducer(params) {
6962
7365
  state.originalLazyGroupData = new DeepMap();
6963
7366
  originalDataArrayChanged = true;
6964
7367
  }
7368
+ const { filterFunction, filterValue, filterTypes, operatorsByFilterType } = state;
7369
+ const shouldFilter = !!filterFunction || Array.isArray(filterValue) && filterValue.length;
7370
+ const shouldFilterClientSide = shouldFilter && state.filterMode === "client";
7371
+ const filterDepsChanged = haveDepsChanged(previousState, state, [
7372
+ "filterFunction",
7373
+ "filterValue",
7374
+ "filterTypes"
7375
+ ]);
7376
+ const filterChanged = originalDataArrayChanged || filterDepsChanged;
6965
7377
  const sortInfoChanged = haveDepsChanged(previousState, state, ["sortInfo"]);
6966
- const sortDepsChanged = originalDataArrayChanged || sortInfoChanged;
7378
+ const sortDepsChanged = originalDataArrayChanged || filterDepsChanged || sortInfoChanged;
7379
+ const shouldFilterAgain = state.filterMode === "client" && (filterChanged || !state.lastFilterDataArray);
6967
7380
  const shouldSortAgain = shouldSort && (sortDepsChanged || !state.lastSortDataArray);
6968
7381
  const groupBy = state.groupBy;
6969
7382
  const pivotBy = state.pivotBy;
6970
7383
  const shouldGroup = groupBy.length > 0 || !!pivotBy;
6971
- const groupsDepsChanged = originalDataArrayChanged || haveDepsChanged(previousState, state, [
7384
+ const groupsDepsChanged = originalDataArrayChanged || sortDepsChanged || haveDepsChanged(previousState, state, [
6972
7385
  "generateGroupRows",
6973
- "originalDataArray",
6974
7386
  "originalLazyGroupData",
6975
7387
  "originalLazyGroupDataChangeDetect",
6976
7388
  "groupBy",
@@ -6979,23 +7391,43 @@ function concludeReducer(params) {
6979
7391
  "aggregationReducers",
6980
7392
  "pivotTotalColumnPosition",
6981
7393
  "pivotGrandTotalColumnPosition",
6982
- "showSeparatePivotColumnForSingleAggregation",
6983
- "sortInfo"
7394
+ "showSeparatePivotColumnForSingleAggregation"
6984
7395
  ]);
6985
7396
  const shouldGroupAgain = shouldGroup && (groupsDepsChanged || !state.lastGroupDataArray);
6986
7397
  const now = Date.now();
6987
7398
  let dataArray = state.originalDataArray;
6988
- let rowInfoDataArray = state.dataArray;
7399
+ const toPrimaryKey = typeof primaryKeyDescriptor === "function" ? (data, index) => primaryKeyDescriptor({ data, index }) : (data, _index) => {
7400
+ const pk = data[primaryKeyDescriptor];
7401
+ return pk;
7402
+ };
7403
+ if (!shouldFilter) {
7404
+ state.unfilteredCount = dataArray.length;
7405
+ }
7406
+ if (shouldFilterClientSide) {
7407
+ state.unfilteredCount = dataArray.length;
7408
+ dataArray = shouldFilterAgain ? filterDataSource({
7409
+ dataArray,
7410
+ toPrimaryKey,
7411
+ filterTypes,
7412
+ operatorsByFilterType,
7413
+ filterFunction,
7414
+ filterValue
7415
+ }) : state.lastFilterDataArray;
7416
+ state.lastFilterDataArray = dataArray;
7417
+ state.filteredAt = now;
7418
+ }
7419
+ state.filteredCount = dataArray.length;
7420
+ state.postFilterDataArray = dataArray;
6989
7421
  if (shouldSort) {
7422
+ const prevKnownTypes = multisort.knownTypes;
7423
+ multisort.knownTypes = state.sortTypes;
6990
7424
  dataArray = shouldSortAgain ? multisort(sortInfo, [...dataArray]) : state.lastSortDataArray;
7425
+ multisort.knownTypes = prevKnownTypes;
6991
7426
  state.lastSortDataArray = dataArray;
6992
7427
  state.sortedAt = now;
6993
7428
  }
6994
7429
  state.postSortDataArray = dataArray;
6995
- const toPrimaryKey = (data) => {
6996
- const pk = data[state.primaryKey];
6997
- return pk;
6998
- };
7430
+ let rowInfoDataArray = state.dataArray;
6999
7431
  if (shouldGroup) {
7000
7432
  if (shouldGroupAgain) {
7001
7433
  const groupResult = state.lazyLoad ? lazyGroup({
@@ -7038,7 +7470,7 @@ function concludeReducer(params) {
7038
7470
  state.pivotColumns = void 0;
7039
7471
  const arrayDifferentAfterSortStep = previousState.postSortDataArray != state.postSortDataArray;
7040
7472
  if (arrayDifferentAfterSortStep || groupsDepsChanged) {
7041
- rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, data ? toPrimaryKey(data) : index, index));
7473
+ rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, data ? toPrimaryKey(data, index) : index, index));
7042
7474
  }
7043
7475
  }
7044
7476
  state.postGroupDataArray = rowInfoDataArray;
@@ -7066,7 +7498,7 @@ function DataSourceWithContext(props) {
7066
7498
  if (typeof children === "function") {
7067
7499
  children = children(computedValues);
7068
7500
  }
7069
- return /* @__PURE__ */ React26.createElement(React26.Fragment, null, children);
7501
+ return /* @__PURE__ */ React29.createElement(React29.Fragment, null, children);
7070
7502
  }
7071
7503
  var DataSourceRoot = getComponentStateRoot({
7072
7504
  initSetupState,
@@ -7089,14 +7521,14 @@ function DataSourceCmp({ children }) {
7089
7521
  globalThis.getDataSourceState = getState;
7090
7522
  }
7091
7523
  useLoadData();
7092
- return /* @__PURE__ */ React26.createElement(DataSourceContext.Provider, {
7524
+ return /* @__PURE__ */ React29.createElement(DataSourceContext.Provider, {
7093
7525
  value: contextValue
7094
- }, /* @__PURE__ */ React26.createElement(DataSourceWithContext, {
7526
+ }, /* @__PURE__ */ React29.createElement(DataSourceWithContext, {
7095
7527
  children
7096
7528
  }));
7097
7529
  }
7098
7530
  function DataSource(props) {
7099
- return /* @__PURE__ */ React26.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React26.createElement(DataSourceCmp, {
7531
+ return /* @__PURE__ */ React29.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React29.createElement(DataSourceCmp, {
7100
7532
  children: props.children
7101
7533
  }));
7102
7534
  }
@@ -7104,7 +7536,7 @@ function DataSource(props) {
7104
7536
  // src/components/InfiniteTable/hooks/useToggleGroupRow.ts
7105
7537
  function useToggleGroupRow() {
7106
7538
  const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
7107
- const toggleGroupRow = (0, import_react33.useCallback)((groupKeys) => {
7539
+ const toggleGroupRow = (0, import_react35.useCallback)((groupKeys) => {
7108
7540
  const state = getDataSourceState();
7109
7541
  const newState = new GroupRowsState(state.groupRowsState);
7110
7542
  newState.toggleGroupRow(groupKeys);
@@ -7136,7 +7568,7 @@ function useToggleGroupRow() {
7136
7568
 
7137
7569
  // src/components/InfiniteTable/hooks/useColumnsWhen.ts
7138
7570
  function useGroupByMap(groupBy) {
7139
- const groupByMap = (0, import_react34.useMemo)(() => {
7571
+ const groupByMap = (0, import_react36.useMemo)(() => {
7140
7572
  return groupBy.reduce((acc, groupBy2, index) => {
7141
7573
  acc.set(groupBy2.field, {
7142
7574
  groupBy: groupBy2,
@@ -7160,13 +7592,13 @@ function useColumnsWhen() {
7160
7592
  }
7161
7593
  } = useComponentState();
7162
7594
  const groupByMap = useGroupByMap(groupBy);
7163
- (0, import_react34.useEffect)(() => {
7595
+ (0, import_react36.useEffect)(() => {
7164
7596
  dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
7165
7597
  }, [groupRenderStrategy]);
7166
- (0, import_react34.useEffect)(() => {
7598
+ (0, import_react36.useEffect)(() => {
7167
7599
  dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
7168
7600
  }, [pivotTotalColumnPosition]);
7169
- (0, import_react34.useEffect)(() => {
7601
+ (0, import_react36.useEffect)(() => {
7170
7602
  if (pivotGrandTotalColumnPosition != void 0) {
7171
7603
  dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
7172
7604
  }
@@ -7196,7 +7628,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
7196
7628
  base = {
7197
7629
  groupByField: field,
7198
7630
  field,
7199
- valueGetter: ({ rowInfo }) => {
7631
+ valueFormatter: ({ rowInfo }) => {
7200
7632
  var _a;
7201
7633
  return rowInfo.isGroupRow ? (_a = rowInfo.groupKeys) == null ? void 0 : _a[groupIndex] : rowInfo.value;
7202
7634
  },
@@ -7240,7 +7672,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
7240
7672
  });
7241
7673
  return computedColumns.size === 0 ? void 0 : computedColumns;
7242
7674
  }
7243
- (0, import_react34.useEffect)(() => {
7675
+ (0, import_react36.useEffect)(() => {
7244
7676
  const update = () => {
7245
7677
  componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
7246
7678
  };
@@ -7269,7 +7701,7 @@ function useColumnsWhenGrouping() {
7269
7701
  }
7270
7702
  } = useComponentState();
7271
7703
  const toggleGroupRow = useToggleGroupRow();
7272
- (0, import_react34.useEffect)(() => {
7704
+ (0, import_react36.useEffect)(() => {
7273
7705
  const update = () => {
7274
7706
  const columnsWhenGrouping = getColumnsWhenGrouping({
7275
7707
  columns,
@@ -7405,7 +7837,7 @@ function useHideColumns(groupByMap) {
7405
7837
  hideEmptyGroupColumns ? groupRowsState : null,
7406
7838
  hideEmptyGroupColumns
7407
7839
  ]);
7408
- (0, import_react34.useEffect)(() => {
7840
+ (0, import_react36.useEffect)(() => {
7409
7841
  const isGrouped = groupBy.length > 0;
7410
7842
  const currentState = getComponentState();
7411
7843
  const { controlledColumnVisibility, columnVisibility } = currentState;
@@ -7520,7 +7952,7 @@ function getColumnsWhenGrouping(params) {
7520
7952
  }
7521
7953
 
7522
7954
  // src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
7523
- var import_react36 = __toModule(require("react"));
7955
+ var import_react38 = __toModule(require("react"));
7524
7956
 
7525
7957
  // src/components/flexbox/index.ts
7526
7958
  var computeFlex = (params) => {
@@ -7677,7 +8109,9 @@ var adjustColumnOrderForPinning = (columnOrder, columnPinning) => {
7677
8109
  };
7678
8110
 
7679
8111
  // src/components/InfiniteTable/utils/getColumnComputedType.ts
7680
- var emptyType = Object.freeze({});
8112
+ var emptyType = Object.freeze({
8113
+ filterType: "string"
8114
+ });
7681
8115
  function getColumnComputedType(column, columnTypes) {
7682
8116
  const defaultType = columnTypes["default"] || emptyType;
7683
8117
  if (column.type === void 0) {
@@ -7713,6 +8147,7 @@ var getComputedVisibleColumns = ({
7713
8147
  columnHeaderCssEllipsis,
7714
8148
  pinnedStartMaxWidth,
7715
8149
  pinnedEndMaxWidth,
8150
+ filterValue,
7716
8151
  sortable,
7717
8152
  sortInfo,
7718
8153
  setSortInfo,
@@ -7727,9 +8162,19 @@ var getComputedVisibleColumns = ({
7727
8162
  columnVisibilityAssumeVisible
7728
8163
  }) => {
7729
8164
  let computedOffset = 0;
8165
+ const filterValueRecord = (filterValue || []).reduce((acc, filterValueItem) => {
8166
+ const { id, field } = filterValueItem;
8167
+ if (field) {
8168
+ acc[field] = filterValueItem;
8169
+ }
8170
+ if (id) {
8171
+ acc[id] = filterValueItem;
8172
+ }
8173
+ return acc;
8174
+ }, {});
7730
8175
  const normalizedColumnOrder = adjustColumnOrderForPinning(columnOrder === true ? [...columns.keys()] : columnOrder, columnPinning);
7731
8176
  const visibleColumnOrder = normalizedColumnOrder.filter((colId) => {
7732
- let col = columns.get(colId);
8177
+ const col = columns.get(colId);
7733
8178
  if (!col) {
7734
8179
  logError(`Column with id "${colId}" specified in columnOrder array cannot be found in the columns map.`);
7735
8180
  return false;
@@ -7777,7 +8222,7 @@ var getComputedVisibleColumns = ({
7777
8222
  delete colTypeSizing.width;
7778
8223
  }
7779
8224
  colSizing = assignNonNull(colTypeSizing, colSizing);
7780
- let colFlex = (_a = colSizing.flex) != null ? _a : void 0;
8225
+ const colFlex = (_a = colSizing.flex) != null ? _a : void 0;
7781
8226
  const colMinWidth = (_c = (_b = colSizing.minWidth) != null ? _b : column == null ? void 0 : column.minWidth) != null ? _c : columnMinWidth;
7782
8227
  const colMaxWidth = (_e = (_d = colSizing.maxWidth) != null ? _d : column == null ? void 0 : column.maxWidth) != null ? _e : columnMaxWidth;
7783
8228
  let size = colFlex != void 0 ? void 0 : (_f = colSizing.width) != null ? _f : columnDefaultWidth;
@@ -7820,7 +8265,7 @@ var getComputedVisibleColumns = ({
7820
8265
  });
7821
8266
  const firstPinnedEndAbsoluteOffset = bodySize.width - totalPinnedEndWidth;
7822
8267
  columnsArray.forEach((c, i) => {
7823
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
8268
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
7824
8269
  const id = visibleColumnOrder[i];
7825
8270
  const nextColumnId = visibleColumnOrder[i + 1];
7826
8271
  const colType = getColumnComputedType(c, columnTypes);
@@ -7831,47 +8276,6 @@ var getComputedVisibleColumns = ({
7831
8276
  const computedSortedDesc = computedSorted && !computedSortedAsc;
7832
8277
  const computedSortIndex = (_c = sortingInfo == null ? void 0 : sortingInfo.index) != null ? _c : -1;
7833
8278
  const computedWidth = computedSizes[i];
7834
- const toggleSort = () => {
7835
- let currentSortInfo = computedSortInfo;
7836
- let newColumnSortInfo;
7837
- if (!currentSortInfo) {
7838
- newColumnSortInfo = {
7839
- dir: 1,
7840
- id,
7841
- field: c.field,
7842
- type: c.type
7843
- };
7844
- } else {
7845
- if (computedSortedDesc) {
7846
- newColumnSortInfo = null;
7847
- } else {
7848
- newColumnSortInfo = __spreadProps(__spreadValues({}, computedSortInfo), {
7849
- dir: -1
7850
- });
7851
- }
7852
- }
7853
- if (c.field && newColumnSortInfo && !newColumnSortInfo.field) {
7854
- newColumnSortInfo.field = c.field;
7855
- }
7856
- let finalSortInfo = sortInfo ? [...sortInfo] : [];
7857
- if (multiSort) {
7858
- if (computedSortIndex === -1) {
7859
- if (newColumnSortInfo) {
7860
- finalSortInfo.push(newColumnSortInfo);
7861
- }
7862
- } else {
7863
- finalSortInfo = finalSortInfo.map((info, index) => {
7864
- if (index === computedSortIndex) {
7865
- return newColumnSortInfo;
7866
- }
7867
- return info;
7868
- }).filter((x) => x != null);
7869
- }
7870
- } else {
7871
- finalSortInfo = newColumnSortInfo ? [newColumnSortInfo] : [];
7872
- }
7873
- setSortInfo(finalSortInfo);
7874
- };
7875
8279
  const computedPinned = getComputedPinned(id, columnPinning);
7876
8280
  const computedLast = i === visibleColumnOrder.length - 1;
7877
8281
  const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
@@ -7880,23 +8284,36 @@ var getComputedVisibleColumns = ({
7880
8284
  const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
7881
8285
  const cssEllipsis = (_e = (_d = c.cssEllipsis) != null ? _d : colType.cssEllipsis) != null ? _e : columnCssEllipsis;
7882
8286
  const headerCssEllipsis = (_j = (_i = (_h = (_g = (_f = c.headerCssEllipsis) != null ? _f : colType.cssEllipsis) != null ? _g : c.cssEllipsis) != null ? _h : colType.headerCssEllipsis) != null ? _i : columnHeaderCssEllipsis) != null ? _j : cssEllipsis;
8287
+ const computedFilterValue = filterValueRecord[id] || c.field ? filterValueRecord[c.field] || null : null;
8288
+ const computedFiltered = computedFilterValue != null;
8289
+ const computedFilterable = (_l = (_k = c.defaultFilterable) != null ? _k : colType.defaultFilterable) != null ? _l : true;
8290
+ const computedDataType = c.dataType || colType.dataType || (Array.isArray(c.type) ? c.type[0] : c.type) || "string";
8291
+ const computedSortType = c.sortType || colType.sortType || computedDataType;
8292
+ const computedFilterType = c.filterType || colType.filterType || computedDataType;
7883
8293
  const result2 = __spreadProps(__spreadValues({
7884
8294
  align: colType.align,
7885
8295
  verticalAlign: colType.verticalAlign,
7886
8296
  defaultHiddenWhenGroupedBy: colType.defaultHiddenWhenGroupedBy,
7887
8297
  valueGetter: colType.valueGetter,
8298
+ valueFormatter: colType.valueFormatter,
7888
8299
  renderValue: colType.renderValue,
7889
8300
  render: colType.render,
7890
8301
  style: colType.style,
7891
8302
  components: colType.components
7892
8303
  }, c), {
8304
+ computedDataType,
8305
+ computedSortType,
8306
+ computedFilterType,
7893
8307
  cssEllipsis,
7894
8308
  headerCssEllipsis,
8309
+ computedFilterValue,
8310
+ computedFiltered,
8311
+ computedFilterable,
7895
8312
  computedWidth,
7896
8313
  computedAbsoluteOffset,
7897
8314
  computedPinningOffset,
7898
8315
  computedOffset,
7899
- computedSortable: (_m = (_l = (_k = c.sortable) != null ? _k : colType.sortable) != null ? _l : sortable) != null ? _m : true,
8316
+ computedSortable: (_o = (_n = (_m = c.sortable) != null ? _m : colType.sortable) != null ? _n : sortable) != null ? _o : true,
7900
8317
  computedSortInfo,
7901
8318
  computedSortIndex,
7902
8319
  computedMultiSort: multiSort,
@@ -7905,14 +8322,57 @@ var getComputedVisibleColumns = ({
7905
8322
  computedSortedDesc,
7906
8323
  computedVisibleIndex: i,
7907
8324
  computedPinned,
7908
- computedDraggable: (_o = (_n = c.draggable) != null ? _n : draggableColumns) != null ? _o : true,
8325
+ computedDraggable: (_q = (_p = c.draggable) != null ? _p : draggableColumns) != null ? _q : true,
7909
8326
  computedFirstInCategory,
7910
8327
  computedLastInCategory,
7911
8328
  computedFirst: i === 0,
7912
8329
  computedLast,
7913
- toggleSort,
8330
+ toggleSort: () => {
8331
+ const currentSortInfo = computedSortInfo;
8332
+ let newColumnSortInfo;
8333
+ if (!currentSortInfo) {
8334
+ newColumnSortInfo = {
8335
+ dir: 1,
8336
+ id,
8337
+ field: c.field,
8338
+ type: computedSortType
8339
+ };
8340
+ } else {
8341
+ if (computedSortedDesc) {
8342
+ newColumnSortInfo = null;
8343
+ } else {
8344
+ newColumnSortInfo = __spreadProps(__spreadValues({}, computedSortInfo), {
8345
+ dir: -1
8346
+ });
8347
+ }
8348
+ }
8349
+ if (c.field && newColumnSortInfo && !newColumnSortInfo.field) {
8350
+ newColumnSortInfo.field = c.field;
8351
+ }
8352
+ if (c.valueGetter && newColumnSortInfo && !newColumnSortInfo.valueGetter) {
8353
+ newColumnSortInfo.valueGetter = (data) => c.valueGetter({ data, field: c.field });
8354
+ }
8355
+ let finalSortInfo = sortInfo ? [...sortInfo] : [];
8356
+ if (multiSort) {
8357
+ if (computedSortIndex === -1) {
8358
+ if (newColumnSortInfo) {
8359
+ finalSortInfo.push(newColumnSortInfo);
8360
+ }
8361
+ } else {
8362
+ finalSortInfo = finalSortInfo.map((info, index) => {
8363
+ if (index === computedSortIndex) {
8364
+ return newColumnSortInfo;
8365
+ }
8366
+ return info;
8367
+ }).filter((x) => x != null);
8368
+ }
8369
+ } else {
8370
+ finalSortInfo = newColumnSortInfo ? [newColumnSortInfo] : [];
8371
+ }
8372
+ setSortInfo(finalSortInfo);
8373
+ },
7914
8374
  id,
7915
- header: (_r = (_q = (_p = c.header) != null ? _p : colType.header) != null ? _q : c.name) != null ? _r : c.field
8375
+ header: (_t = (_s = (_r = c.header) != null ? _r : colType.header) != null ? _s : c.name) != null ? _t : c.field
7916
8376
  });
7917
8377
  computedOffset += computedWidth;
7918
8378
  computedVisibleColumnsMap.set(result2.id, result2);
@@ -7953,10 +8413,10 @@ var getComputedVisibleColumns = ({
7953
8413
  };
7954
8414
 
7955
8415
  // src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts
7956
- var import_react35 = __toModule(require("react"));
8416
+ var import_react37 = __toModule(require("react"));
7957
8417
  var useRerenderOnKeyChange = (map2) => {
7958
8418
  const [renderId, rerender] = useRerender();
7959
- (0, import_react35.useEffect)(() => {
8419
+ (0, import_react37.useEffect)(() => {
7960
8420
  const update = rafFn(rerender);
7961
8421
  return interceptMap(map2, {
7962
8422
  set: update,
@@ -7981,6 +8441,7 @@ var useComputedVisibleColumns = ({
7981
8441
  sortInfo,
7982
8442
  multiSort,
7983
8443
  setSortInfo,
8444
+ filterValue,
7984
8445
  columnOrder,
7985
8446
  columnPinning,
7986
8447
  columnTypes,
@@ -8008,7 +8469,7 @@ var useComputedVisibleColumns = ({
8008
8469
  computedPinnedEndOffset,
8009
8470
  computedPinnedEndWidth,
8010
8471
  computedPinnedStartWidth
8011
- } = (0, import_react36.useMemo)(() => {
8472
+ } = (0, import_react38.useMemo)(() => {
8012
8473
  return getComputedVisibleColumns({
8013
8474
  columns,
8014
8475
  bodySize,
@@ -8018,6 +8479,7 @@ var useComputedVisibleColumns = ({
8018
8479
  columnCssEllipsis,
8019
8480
  columnHeaderCssEllipsis,
8020
8481
  viewportReservedWidth,
8482
+ filterValue,
8021
8483
  sortable,
8022
8484
  sortInfo,
8023
8485
  setSortInfo,
@@ -8042,6 +8504,7 @@ var useComputedVisibleColumns = ({
8042
8504
  sortInfo,
8043
8505
  setSortInfo,
8044
8506
  multiSort,
8507
+ filterValue,
8045
8508
  columnOrder,
8046
8509
  columnVisibility,
8047
8510
  columnVisibilityAssumeVisible,
@@ -8074,7 +8537,7 @@ var useComputedVisibleColumns = ({
8074
8537
  };
8075
8538
 
8076
8539
  // src/components/InfiniteTable/hooks/useScrollbars.ts
8077
- var import_react37 = __toModule(require("react"));
8540
+ var import_react39 = __toModule(require("react"));
8078
8541
  var INITIAL_SCROLLBARS = {
8079
8542
  vertical: false,
8080
8543
  horizontal: false
@@ -8082,8 +8545,8 @@ var INITIAL_SCROLLBARS = {
8082
8545
  function useScrollbars(brain) {
8083
8546
  const { getComponentState: getInfiniteTableState } = useComponentState();
8084
8547
  const { getState: getDataSourceState } = useDataSourceContextValue();
8085
- const [scrollbars, setScrollbars] = (0, import_react37.useState)(INITIAL_SCROLLBARS);
8086
- (0, import_react37.useEffect)(() => {
8548
+ const [scrollbars, setScrollbars] = (0, import_react39.useState)(INITIAL_SCROLLBARS);
8549
+ (0, import_react39.useEffect)(() => {
8087
8550
  return brain.onRenderCountChange(() => {
8088
8551
  const { scrollTopMax, scrollLeftMax } = brain;
8089
8552
  setScrollbars({
@@ -8092,7 +8555,7 @@ function useScrollbars(brain) {
8092
8555
  });
8093
8556
  });
8094
8557
  }, [brain]);
8095
- (0, import_react37.useLayoutEffect)(() => {
8558
+ (0, import_react39.useLayoutEffect)(() => {
8096
8559
  const dataSourceState = getDataSourceState();
8097
8560
  const { onScrollbarsChange } = getInfiniteTableState();
8098
8561
  const { notifyScrollbarsChange } = dataSourceState;
@@ -8123,27 +8586,27 @@ function useComputed() {
8123
8586
  bodySize,
8124
8587
  showSeparatePivotColumnForSingleAggregation
8125
8588
  } = componentState;
8126
- (0, import_react38.useState)(() => {
8589
+ (0, import_react40.useState)(() => {
8127
8590
  componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
8128
8591
  if (rowHeight) {
8129
8592
  componentActions.rowHeight = rowHeight;
8130
8593
  }
8131
8594
  });
8132
- componentState.onHeaderHeightCSSVarChange.onChange((headerHeight) => {
8133
- if (headerHeight) {
8134
- componentActions.headerHeight = headerHeight;
8595
+ componentState.onColumnHeaderHeightCSSVarChange.onChange((columnHeaderHeight) => {
8596
+ if (columnHeaderHeight) {
8597
+ componentActions.columnHeaderHeight = columnHeaderHeight;
8135
8598
  }
8136
8599
  });
8137
8600
  });
8138
- (0, import_react38.useEffect)(() => {
8601
+ (0, import_react40.useEffect)(() => {
8139
8602
  dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
8140
8603
  }, [showSeparatePivotColumnForSingleAggregation]);
8141
- const { multiSort } = dataSourceState;
8604
+ const { multiSort, filterValue } = dataSourceState;
8142
8605
  useColumnGroups();
8143
8606
  const { toggleGroupRow } = useColumnsWhen();
8144
- const setSortInfo = (0, import_react38.useCallback)((sortInfo) => {
8607
+ const setSortInfo = (0, import_react40.useCallback)((sortInfo) => {
8145
8608
  var _a2;
8146
- const newSortInfo = multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
8609
+ const newSortInfo = getDataSourceState().multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
8147
8610
  dataSourceActions.sortInfo = newSortInfo;
8148
8611
  }, [getDataSourceState]);
8149
8612
  const columns = componentState.computedColumns;
@@ -8182,6 +8645,7 @@ function useComputed() {
8182
8645
  columnVisibility,
8183
8646
  columnVisibilityAssumeVisible: true,
8184
8647
  columnPinning,
8648
+ filterValue,
8185
8649
  columnSizing,
8186
8650
  columnTypes
8187
8651
  });
@@ -8191,6 +8655,7 @@ function useComputed() {
8191
8655
  const computedPinnedStartOverflow = computedPinnedStartWidth ? computedPinnedStartColumnsWidth > computedPinnedStartWidth : false;
8192
8656
  const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
8193
8657
  return {
8658
+ showColumnFilters: !!dataSourceState.filterValue,
8194
8659
  scrollbars,
8195
8660
  columnSize,
8196
8661
  rowspan,
@@ -8298,7 +8763,7 @@ function useDOMProps(initialDOMProps) {
8298
8763
  }
8299
8764
 
8300
8765
  // src/components/InfiniteTable/hooks/useLicense/useLicense.ts
8301
- var import_react39 = __toModule(require("react"));
8766
+ var import_react41 = __toModule(require("react"));
8302
8767
 
8303
8768
  // src/components/InfiniteTable/hooks/useLicense/crc32.ts
8304
8769
  var DEFAULT_ReversedPolynomial = 3988292384;
@@ -8456,10 +8921,10 @@ var isInsideSandbox = () => {
8456
8921
  };
8457
8922
  var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
8458
8923
  var useLicense = (licenseKey = "") => {
8459
- const valid = (0, import_react39.useMemo)(() => {
8924
+ const valid = (0, import_react41.useMemo)(() => {
8460
8925
  let valid2 = isValidLicense(licenseKey, {
8461
8926
  publishedAt: 1624970570587,
8462
- version: "0.3.2"
8927
+ version: "0.3.3"
8463
8928
  });
8464
8929
  if (!licenseKey && !valid2 && isInsidePlayground) {
8465
8930
  return true;
@@ -8470,7 +8935,7 @@ var useLicense = (licenseKey = "") => {
8470
8935
  };
8471
8936
 
8472
8937
  // src/components/InfiniteTable/state/getInitialState.ts
8473
- var import_react40 = __toModule(require("react"));
8938
+ var import_react42 = __toModule(require("react"));
8474
8939
 
8475
8940
  // src/components/VirtualBrain/ScrollListener.ts
8476
8941
  var initialScrollPosition = {
@@ -8547,11 +9012,11 @@ function initSetupState2() {
8547
9012
  brain,
8548
9013
  headerBrain,
8549
9014
  columnShifts: null,
8550
- domRef: (0, import_react40.createRef)(),
8551
- scrollerDOMRef: (0, import_react40.createRef)(),
8552
- portalDOMRef: (0, import_react40.createRef)(),
9015
+ domRef: (0, import_react42.createRef)(),
9016
+ scrollerDOMRef: (0, import_react42.createRef)(),
9017
+ portalDOMRef: (0, import_react42.createRef)(),
8553
9018
  onRowHeightCSSVarChange: buildSubscriptionCallback(),
8554
- onHeaderHeightCSSVarChange: buildSubscriptionCallback(),
9019
+ onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
8555
9020
  bodySize: {
8556
9021
  width: 0,
8557
9022
  height: 0
@@ -8601,6 +9066,7 @@ var forwardProps3 = (setupState) => {
8601
9066
  onScrollbarsChange: 1,
8602
9067
  autoSizeColumnsKey: 1,
8603
9068
  scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
9069
+ filterEditors: (filterEditors) => __spreadValues(__spreadValues({}, defaultFilterEditors), filterEditors),
8604
9070
  viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
8605
9071
  activeIndex: (activeIndex) => activeIndex != null ? activeIndex : 0,
8606
9072
  columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
@@ -8608,6 +9074,9 @@ var forwardProps3 = (setupState) => {
8608
9074
  columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
8609
9075
  columnCssEllipsis: (columnCssEllipsis) => columnCssEllipsis != null ? columnCssEllipsis : true,
8610
9076
  draggableColumns: (draggableColumns) => draggableColumns != null ? draggableColumns : true,
9077
+ headerOptions: (headerOptions) => __spreadValues({
9078
+ alwaysReserveSpaceForSortIcon: true
9079
+ }, headerOptions),
8611
9080
  showSeparatePivotColumnForSingleAggregation: (showSeparatePivotColumnForSingleAggregation) => showSeparatePivotColumnForSingleAggregation != null ? showSeparatePivotColumnForSingleAggregation : false,
8612
9081
  sortable: (sortable) => sortable != null ? sortable : true,
8613
9082
  hideEmptyGroupColumns: (hideEmptyGroupColumns) => hideEmptyGroupColumns != null ? hideEmptyGroupColumns : false,
@@ -8620,7 +9089,7 @@ var forwardProps3 = (setupState) => {
8620
9089
  showHoverRows: (showHoverRows) => showHoverRows != null ? showHoverRows : true,
8621
9090
  virtualizeColumns: (virtualizeColumns) => virtualizeColumns != null ? virtualizeColumns : true,
8622
9091
  rowHeight: (rowHeight) => typeof rowHeight === "number" ? rowHeight : 0,
8623
- headerHeight: (headerHeight) => typeof headerHeight === "number" ? headerHeight : 30,
9092
+ columnHeaderHeight: (columnHeaderHeight) => typeof columnHeaderHeight === "number" ? columnHeaderHeight : 30,
8624
9093
  columns: (columns) => toMap(columns, setupState.propsCache.get("columns")),
8625
9094
  columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : {},
8626
9095
  columnPinning: (columnPinning) => toMap(columnPinning, setupState.propsCache.get("columnPinning")),
@@ -8666,7 +9135,7 @@ var mapPropsToState2 = (params) => {
8666
9135
  columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
8667
9136
  computedColumnGroups,
8668
9137
  rowHeightCSSVar: typeof props.rowHeight === "string" ? props.rowHeight : "",
8669
- headerHeightCSSVar: typeof props.headerHeight === "string" ? props.headerHeight || ThemeVars.components.Header.height : ""
9138
+ columnHeaderHeightCSSVar: typeof props.columnHeaderHeight === "string" ? props.columnHeaderHeight || ThemeVars.components.Header.columnHeaderHeight : ""
8670
9139
  };
8671
9140
  };
8672
9141
 
@@ -8679,12 +9148,12 @@ var InfiniteTableRoot = getComponentStateRoot({
8679
9148
  mapPropsToState: mapPropsToState2,
8680
9149
  allowedControlledPropOverrides: {
8681
9150
  rowHeight: true,
8682
- headerHeight: true
9151
+ columnHeaderHeight: true
8683
9152
  },
8684
9153
  getParentState: () => useDataSource(),
8685
9154
  debugName: "InfiniteTable"
8686
9155
  });
8687
- var InfiniteTableComponent = React27.memo(function InfiniteTableComponent2() {
9156
+ var InfiniteTableComponent = React30.memo(function InfiniteTableComponent2() {
8688
9157
  var _a;
8689
9158
  const { componentState, getComputed, computed } = useInfiniteTable();
8690
9159
  const {
@@ -8700,9 +9169,9 @@ var InfiniteTableComponent = React27.memo(function InfiniteTableComponent2() {
8700
9169
  loadingText,
8701
9170
  header,
8702
9171
  onRowHeightCSSVarChange,
8703
- onHeaderHeightCSSVarChange,
9172
+ onColumnHeaderHeightCSSVarChange,
8704
9173
  rowHeightCSSVar,
8705
- headerHeightCSSVar,
9174
+ columnHeaderHeightCSSVar,
8706
9175
  components,
8707
9176
  scrollStopDelay,
8708
9177
  brain,
@@ -8717,7 +9186,7 @@ var InfiniteTableComponent = React27.memo(function InfiniteTableComponent2() {
8717
9186
  bodySize,
8718
9187
  computed
8719
9188
  });
8720
- React27.useEffect(() => {
9189
+ React30.useEffect(() => {
8721
9190
  const dataSourceState = getDataSourceState();
8722
9191
  const onChange = debounce((renderRange) => {
8723
9192
  dataSourceState.notifyRenderRangeChange({
@@ -8730,35 +9199,35 @@ var InfiniteTableComponent = React27.memo(function InfiniteTableComponent2() {
8730
9199
  const licenseValid = useLicense(licenseKey);
8731
9200
  const domProps = useDOMProps(componentState.domProps);
8732
9201
  const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
8733
- React27.useEffect(() => {
9202
+ React30.useEffect(() => {
8734
9203
  brain.setScrollStopDelay(scrollStopDelay);
8735
9204
  dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
8736
9205
  }, [scrollStopDelay]);
8737
9206
  useAutoSizeColumns();
8738
- return /* @__PURE__ */ React27.createElement("div", __spreadValues({
9207
+ return /* @__PURE__ */ React30.createElement("div", __spreadValues({
8739
9208
  ref: domRef
8740
- }, domProps), header ? /* @__PURE__ */ React27.createElement(TableHeaderWrapper, {
9209
+ }, domProps), header ? /* @__PURE__ */ React30.createElement(TableHeaderWrapper, {
8741
9210
  brain: headerBrain,
8742
9211
  scrollbars
8743
- }) : null, /* @__PURE__ */ React27.createElement(InfiniteTableBody, null, /* @__PURE__ */ React27.createElement(HeadlessTable, {
9212
+ }) : null, /* @__PURE__ */ React30.createElement(InfiniteTableBody, null, /* @__PURE__ */ React30.createElement(HeadlessTable, {
8744
9213
  tabIndex: 0,
8745
9214
  scrollStopDelay,
8746
9215
  brain,
8747
9216
  renderCell,
8748
9217
  cellHoverClassNames: HOVERED_CLASS_NAMES,
8749
9218
  scrollerDOMRef
8750
- }), /* @__PURE__ */ React27.createElement(LoadMaskCmp, {
9219
+ }), /* @__PURE__ */ React30.createElement(LoadMaskCmp, {
8751
9220
  visible: loading
8752
- }, loadingText)), licenseValid ? null : /* @__PURE__ */ React27.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React27.createElement("div", {
9221
+ }, loadingText)), /* @__PURE__ */ React30.createElement("div", {
8753
9222
  ref: portalDOMRef,
8754
9223
  className: join(`${rootClassName2}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
8755
- }), rowHeightCSSVar ? /* @__PURE__ */ React27.createElement(CSSVariableWatch, {
9224
+ }), rowHeightCSSVar ? /* @__PURE__ */ React30.createElement(CSSVariableWatch, {
8756
9225
  varName: rowHeightCSSVar,
8757
9226
  onChange: onRowHeightCSSVarChange
8758
- }) : null, headerHeightCSSVar ? /* @__PURE__ */ React27.createElement(CSSVariableWatch, {
8759
- varName: headerHeightCSSVar,
8760
- onChange: onHeaderHeightCSSVarChange
8761
- }) : null);
9227
+ }) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ React30.createElement(CSSVariableWatch, {
9228
+ varName: columnHeaderHeightCSSVar,
9229
+ onChange: onColumnHeaderHeightCSSVarChange
9230
+ }) : null, /* @__PURE__ */ React30.createElement(InfiniteTableFooter, null), licenseValid ? null : /* @__PURE__ */ React30.createElement(InfiniteTableLicenseFooter, null));
8762
9231
  });
8763
9232
  function InfiniteTableContextProvider() {
8764
9233
  const { componentActions, componentState } = useComponentState();
@@ -8786,27 +9255,27 @@ function InfiniteTableContextProvider() {
8786
9255
  bodySize.width = (_b = (_a = scrollerDOMRef.current) == null ? void 0 : _a.scrollWidth) != null ? _b : bodySize.width;
8787
9256
  componentActions.bodySize = bodySize;
8788
9257
  }, { earlyAttach: true });
8789
- React27.useEffect(() => {
9258
+ React30.useEffect(() => {
8790
9259
  return () => {
8791
9260
  componentState.onRowHeightCSSVarChange.destroy();
8792
- componentState.onHeaderHeightCSSVarChange.destroy();
9261
+ componentState.onColumnHeaderHeightCSSVarChange.destroy();
8793
9262
  };
8794
9263
  }, []);
8795
- React27.useEffect(() => {
9264
+ React30.useEffect(() => {
8796
9265
  if (scrollerDOMRef.current) {
8797
9266
  scrollerDOMRef.current.scrollTop = 0;
8798
9267
  }
8799
9268
  }, [scrollTopKey, scrollerDOMRef]);
8800
9269
  const TableContext2 = getInfiniteTableContext();
8801
- return /* @__PURE__ */ React27.createElement(TableContext2.Provider, {
9270
+ return /* @__PURE__ */ React30.createElement(TableContext2.Provider, {
8802
9271
  value: contextValue
8803
- }, /* @__PURE__ */ React27.createElement(InfiniteTableComponent, null));
9272
+ }, /* @__PURE__ */ React30.createElement(InfiniteTableComponent, null));
8804
9273
  }
8805
9274
  function InfiniteTable(props) {
8806
- const table = /* @__PURE__ */ React27.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React27.createElement(InfiniteTableContextProvider, null));
8807
- return /* @__PURE__ */ React27.createElement(React27.StrictMode, null, table);
9275
+ const table = /* @__PURE__ */ React30.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React30.createElement(InfiniteTableContextProvider, null));
9276
+ return /* @__PURE__ */ React30.createElement(React30.StrictMode, null, table);
8808
9277
  }
8809
9278
  InfiniteTable.defaultProps = {
8810
9279
  rowHeight: 40,
8811
- headerHeight: ThemeVars.components.Header.height
9280
+ columnHeaderHeight: ThemeVars.components.Header.columnHeaderHeight
8812
9281
  };