@infinite-table/infinite-react 0.3.0 → 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.
- package/index.css +76 -50
- package/index.d.ts +543 -410
- package/index.esm.css +76 -50
- package/index.esm.js +1093 -598
- package/index.js +1153 -665
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -636,9 +636,9 @@ function debounce(fn, { wait }) {
|
|
|
636
636
|
// src/components/InfiniteTable/index.tsx
|
|
637
637
|
import {
|
|
638
638
|
StrictMode,
|
|
639
|
-
createElement as
|
|
639
|
+
createElement as createElement24,
|
|
640
640
|
memo as memo9,
|
|
641
|
-
useEffect as
|
|
641
|
+
useEffect as useEffect24
|
|
642
642
|
} from "react";
|
|
643
643
|
|
|
644
644
|
// src/utils/join.ts
|
|
@@ -2782,6 +2782,9 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2782
2782
|
});
|
|
2783
2783
|
};
|
|
2784
2784
|
this.onMouseLeave = (rowIndex) => {
|
|
2785
|
+
if (this.currentHoveredRow != -1 && this.currentHoveredRow === rowIndex) {
|
|
2786
|
+
this.removeHoverClass(rowIndex);
|
|
2787
|
+
}
|
|
2785
2788
|
this.currentHoveredRow = -1;
|
|
2786
2789
|
if (this.scrolling) {
|
|
2787
2790
|
return;
|
|
@@ -2820,7 +2823,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2820
2823
|
this.hoverRowUpdatesInProgress.delete(rowIndex);
|
|
2821
2824
|
});
|
|
2822
2825
|
};
|
|
2823
|
-
this.updateElementPosition = (elementIndex) => {
|
|
2826
|
+
this.updateElementPosition = (elementIndex, options) => {
|
|
2824
2827
|
const itemElement = this.itemDOMElements[elementIndex];
|
|
2825
2828
|
const cell = this.mappedCells.getRenderedCellAtElement(elementIndex);
|
|
2826
2829
|
if (cell == null) {
|
|
@@ -2845,7 +2848,8 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2845
2848
|
itemElement.style.transform = `translate3d(${x}px, ${y}px, 0)`;
|
|
2846
2849
|
itemElement.style.willChange = "transform";
|
|
2847
2850
|
itemElement.style.backfaceVisibility = "hidden";
|
|
2848
|
-
|
|
2851
|
+
const hidden = options ? options.hidden : !!this.isCellCovered(rowIndex, colIndex);
|
|
2852
|
+
itemElement.style.zIndex = hidden ? "-1" : "auto";
|
|
2849
2853
|
} else {
|
|
2850
2854
|
itemElement.style.display = "";
|
|
2851
2855
|
itemElement.style.left = `${x}px`;
|
|
@@ -2855,9 +2859,6 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2855
2859
|
};
|
|
2856
2860
|
this.onScrollStart = () => {
|
|
2857
2861
|
this.scrolling = true;
|
|
2858
|
-
if (this.currentHoveredRow != -1) {
|
|
2859
|
-
this.removeHoverClass(this.currentHoveredRow);
|
|
2860
|
-
}
|
|
2861
2862
|
};
|
|
2862
2863
|
this.onScrollStop = () => {
|
|
2863
2864
|
this.scrolling = false;
|
|
@@ -3040,6 +3041,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
3040
3041
|
const heightWithRowspan = rowspan === 1 ? height : this.brain.getRowHeightWithSpan(rowIndex, colIndex, rowspan);
|
|
3041
3042
|
const widthWithColspan = colspan === 1 ? width : this.brain.getColWidthWithSpan(rowIndex, colIndex, colspan);
|
|
3042
3043
|
const { row: rowFixed, col: colFixed } = this.isCellFixed(rowIndex, colIndex);
|
|
3044
|
+
const hidden = !!covered;
|
|
3043
3045
|
const renderedNode = renderCell({
|
|
3044
3046
|
rowIndex,
|
|
3045
3047
|
colIndex,
|
|
@@ -3049,7 +3051,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
3049
3051
|
colspan,
|
|
3050
3052
|
rowFixed,
|
|
3051
3053
|
colFixed,
|
|
3052
|
-
hidden
|
|
3054
|
+
hidden,
|
|
3053
3055
|
heightWithRowspan,
|
|
3054
3056
|
widthWithColspan,
|
|
3055
3057
|
onMouseEnter: this.onMouseEnter.bind(null, rowIndex),
|
|
@@ -3066,7 +3068,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
3066
3068
|
this.debug(`Render cell ${rowIndex},${colIndex} at element ${elementIndex}`);
|
|
3067
3069
|
}
|
|
3068
3070
|
itemUpdater(renderedNode);
|
|
3069
|
-
this.updateElementPosition(elementIndex);
|
|
3071
|
+
this.updateElementPosition(elementIndex, { hidden, rowspan, colspan });
|
|
3070
3072
|
return;
|
|
3071
3073
|
}
|
|
3072
3074
|
reset() {
|
|
@@ -3550,6 +3552,7 @@ var cssEllipsisClassName = "_16lm1iw1c _16lm1iw1d _16lm1iw18";
|
|
|
3550
3552
|
var cursor = { pointer: "_16lm1iwd" };
|
|
3551
3553
|
var display = { flex: "_16lm1iwl", block: "_16lm1iwm", inlineBlock: "_16lm1iwn" };
|
|
3552
3554
|
var flex = { "1": "_16lm1iwe", none: "_16lm1iwf" };
|
|
3555
|
+
var flexFlow = { column: "_16lm1iw11", row: "_16lm1iw12" };
|
|
3553
3556
|
var justifyContent = { center: "_16lm1iw15", start: "_16lm1iw16", end: "_16lm1iw17" };
|
|
3554
3557
|
var left = { "0": "_16lm1iwv", "100%": "_16lm1iww" };
|
|
3555
3558
|
var overflow = { hidden: "_16lm1iw18", auto: "_16lm1iw19", visible: "_16lm1iw1a" };
|
|
@@ -3561,122 +3564,135 @@ var zIndex = { "1": "_16lm1iwg", "10": "_16lm1iwh", "1000": "_16lm1iwi", "10000"
|
|
|
3561
3564
|
|
|
3562
3565
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
3563
3566
|
var InfiniteTableBody = forwardRef2(function InfiniteTableBody2(props, ref) {
|
|
3564
|
-
const { rootClassName:
|
|
3567
|
+
const { rootClassName: rootClassName9 } = useInternalProps();
|
|
3565
3568
|
return /* @__PURE__ */ createElement8("div", __spreadProps(__spreadValues({
|
|
3566
3569
|
ref
|
|
3567
3570
|
}, props), {
|
|
3568
|
-
className: join(`${
|
|
3571
|
+
className: join(`${rootClassName9}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
|
|
3569
3572
|
}));
|
|
3570
3573
|
});
|
|
3571
3574
|
|
|
3572
|
-
// src/components/InfiniteTable/components/
|
|
3575
|
+
// src/components/InfiniteTable/components/InfiniteTableFooter/InfiniteTableFooter.tsx
|
|
3573
3576
|
import {
|
|
3574
|
-
|
|
3575
|
-
|
|
3577
|
+
createElement as createElement9,
|
|
3578
|
+
forwardRef as forwardRef3
|
|
3576
3579
|
} from "react";
|
|
3577
|
-
|
|
3578
|
-
|
|
3580
|
+
var InfiniteTableFooter = forwardRef3(function InfiniteTableFooter2(props, ref) {
|
|
3581
|
+
const { rootClassName: rootClassName9 } = useInternalProps();
|
|
3582
|
+
return /* @__PURE__ */ createElement9("div", __spreadProps(__spreadValues({
|
|
3583
|
+
ref
|
|
3584
|
+
}, props), {
|
|
3585
|
+
className: join(`${rootClassName9}Footer`, position.relative, display.flex, flexFlow.row, props.className)
|
|
3586
|
+
}));
|
|
3587
|
+
});
|
|
3579
3588
|
|
|
3580
|
-
// src/components/InfiniteTable/components/
|
|
3589
|
+
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
3581
3590
|
import {
|
|
3582
|
-
Fragment,
|
|
3583
|
-
|
|
3584
|
-
|
|
3591
|
+
Fragment as Fragment2,
|
|
3592
|
+
createContext as createContext4,
|
|
3593
|
+
createElement as createElement13,
|
|
3594
|
+
useMemo as useMemo5
|
|
3585
3595
|
} from "react";
|
|
3596
|
+
import { useCallback as useCallback6, useContext as useContext5, useEffect as useEffect9, useRef as useRef10 } from "react";
|
|
3597
|
+
import { createPortal } from "react-dom";
|
|
3586
3598
|
|
|
3587
|
-
// src/components/
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3599
|
+
// src/components/DataSource/defaultFilterTypes.ts
|
|
3600
|
+
function getFilterTypes() {
|
|
3601
|
+
const result = {
|
|
3602
|
+
string: {
|
|
3603
|
+
label: "Text",
|
|
3604
|
+
emptyValues: new Set([""]),
|
|
3605
|
+
defaultOperator: "contains",
|
|
3606
|
+
operators: [
|
|
3607
|
+
{
|
|
3608
|
+
name: "contains",
|
|
3609
|
+
fn: ({ currentValue, filterValue, emptyValues }) => {
|
|
3610
|
+
if (emptyValues.has(currentValue) || emptyValues.has(filterValue)) {
|
|
3611
|
+
return true;
|
|
3612
|
+
}
|
|
3613
|
+
return typeof currentValue === "string" && typeof filterValue == "string" && currentValue.toLowerCase().includes(filterValue.toLowerCase());
|
|
3614
|
+
}
|
|
3615
|
+
},
|
|
3616
|
+
{
|
|
3617
|
+
name: "eq",
|
|
3618
|
+
fn: ({ currentValue: value, filterValue, emptyValues }) => {
|
|
3619
|
+
if (emptyValues.has(value) || emptyValues.has(filterValue)) {
|
|
3620
|
+
return true;
|
|
3621
|
+
}
|
|
3622
|
+
return typeof value === "string" && value === filterValue;
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
]
|
|
3626
|
+
},
|
|
3627
|
+
number: {
|
|
3628
|
+
label: "Number",
|
|
3629
|
+
emptyValues: new Set(["", null, void 0]),
|
|
3630
|
+
defaultOperator: "eq",
|
|
3631
|
+
operators: [
|
|
3632
|
+
{
|
|
3633
|
+
name: "eq",
|
|
3634
|
+
fn: ({ currentValue, filterValue, emptyValues }) => {
|
|
3635
|
+
if (emptyValues.has(currentValue) || emptyValues.has(filterValue)) {
|
|
3636
|
+
return true;
|
|
3637
|
+
}
|
|
3638
|
+
return currentValue == filterValue;
|
|
3639
|
+
}
|
|
3640
|
+
},
|
|
3641
|
+
{
|
|
3642
|
+
name: "between",
|
|
3643
|
+
fn: ({ currentValue, filterValue, emptyValues }) => {
|
|
3644
|
+
if (emptyValues.has(currentValue) || emptyValues.has(filterValue)) {
|
|
3645
|
+
return true;
|
|
3646
|
+
}
|
|
3647
|
+
const [min, max] = filterValue;
|
|
3648
|
+
return currentValue >= min && currentValue <= max;
|
|
3649
|
+
}
|
|
3650
|
+
}
|
|
3651
|
+
]
|
|
3652
|
+
}
|
|
3653
|
+
};
|
|
3654
|
+
return result;
|
|
3598
3655
|
}
|
|
3656
|
+
var defaultFilterTypes = getFilterTypes();
|
|
3599
3657
|
|
|
3600
|
-
// src/components/InfiniteTable/hooks/
|
|
3601
|
-
|
|
3602
|
-
const
|
|
3603
|
-
const
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
function InfiniteTableCellFn(props) {
|
|
3619
|
-
var _b, _c, _d, _e;
|
|
3620
|
-
const _a = props, {
|
|
3621
|
-
cssEllipsis = true,
|
|
3622
|
-
virtualized = true,
|
|
3623
|
-
skipColumnShifting = false,
|
|
3624
|
-
offsetProperty = "left",
|
|
3625
|
-
column,
|
|
3626
|
-
domRef,
|
|
3627
|
-
width,
|
|
3628
|
-
afterChildren,
|
|
3629
|
-
beforeChildren,
|
|
3630
|
-
offset,
|
|
3631
|
-
cellType,
|
|
3632
|
-
cssPosition: _cssPosition,
|
|
3633
|
-
renderChildren
|
|
3634
|
-
} = _a, domProps = __objRest(_a, [
|
|
3635
|
-
"cssEllipsis",
|
|
3636
|
-
"virtualized",
|
|
3637
|
-
"skipColumnShifting",
|
|
3638
|
-
"offsetProperty",
|
|
3639
|
-
"column",
|
|
3640
|
-
"domRef",
|
|
3641
|
-
"width",
|
|
3642
|
-
"afterChildren",
|
|
3643
|
-
"beforeChildren",
|
|
3644
|
-
"offset",
|
|
3645
|
-
"cellType",
|
|
3646
|
-
"cssPosition",
|
|
3647
|
-
"renderChildren"
|
|
3648
|
-
]);
|
|
3649
|
-
const children = renderChildren();
|
|
3650
|
-
const { columnShifts } = useInfiniteTableState();
|
|
3651
|
-
const shifting = !!columnShifts;
|
|
3652
|
-
const style = __spreadValues({
|
|
3653
|
-
width
|
|
3654
|
-
}, domProps.style);
|
|
3655
|
-
if (!skipColumnShifting && columnShifts && columnShifts[column.computedVisibleIndex]) {
|
|
3656
|
-
const shiftLeft = columnShifts[column.computedVisibleIndex] + (offset != null ? offset : 0);
|
|
3657
|
-
if (virtualized) {
|
|
3658
|
-
style.left = shiftLeft;
|
|
3659
|
-
} else {
|
|
3660
|
-
style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
|
|
3661
|
-
}
|
|
3658
|
+
// src/components/InfiniteTable/hooks/useCellClassName.ts
|
|
3659
|
+
function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
3660
|
+
const result = [...baseClasses];
|
|
3661
|
+
const variantObject = {
|
|
3662
|
+
filtered: column.computedFiltered,
|
|
3663
|
+
first: column.computedFirst,
|
|
3664
|
+
last: column.computedLast,
|
|
3665
|
+
groupByField: !!column.groupByField,
|
|
3666
|
+
firstInCategory: column.computedFirstInCategory,
|
|
3667
|
+
lastInCategory: column.computedLastInCategory,
|
|
3668
|
+
pinned: column.computedPinned || false,
|
|
3669
|
+
dragging: extraFlags.dragging,
|
|
3670
|
+
zebra: extraFlags.zebra
|
|
3671
|
+
};
|
|
3672
|
+
const theVariant = variants(variantObject);
|
|
3673
|
+
result.push(theVariant);
|
|
3674
|
+
if (column.computedFirst) {
|
|
3675
|
+
result.push(...baseClasses.map((c) => `${c}--first`));
|
|
3662
3676
|
}
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
"data-column-id": column.id,
|
|
3666
|
-
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}` : ""),
|
|
3667
|
-
children: /* @__PURE__ */ createElement9(Fragment, null, beforeChildren, /* @__PURE__ */ createElement9("div", {
|
|
3668
|
-
className: `${InfiniteTableCellContentClassName} ${cssEllipsis ? cssEllipsisClassName : overflow.hidden}`
|
|
3669
|
-
}, children), afterChildren)
|
|
3670
|
-
});
|
|
3671
|
-
const RenderComponent = cellType === "body" ? (_d = column.components) == null ? void 0 : _d.ColumnCell : (_e = column.components) == null ? void 0 : _e.HeaderCell;
|
|
3672
|
-
if (RenderComponent) {
|
|
3673
|
-
return /* @__PURE__ */ createElement9(RenderComponent, __spreadValues({}, finalDOMProps));
|
|
3677
|
+
if (column.groupByField) {
|
|
3678
|
+
result.push(...baseClasses.map((c) => `${c}--group-column`));
|
|
3674
3679
|
}
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
}
|
|
3680
|
+
if (column.computedLast) {
|
|
3681
|
+
result.push(...baseClasses.map((c) => `${c}--last`));
|
|
3682
|
+
}
|
|
3683
|
+
if (column.computedFirstInCategory) {
|
|
3684
|
+
result.push(...baseClasses.map((c) => `${c}--first-in-category`));
|
|
3685
|
+
}
|
|
3686
|
+
if (column.computedLastInCategory) {
|
|
3687
|
+
result.push(...baseClasses.map((c) => `${c}--last-in-category`));
|
|
3688
|
+
}
|
|
3689
|
+
if (column.computedPinned) {
|
|
3690
|
+
result.push(...baseClasses.map((c) => `${c}--pinned-${column.computedPinned}`));
|
|
3691
|
+
} else {
|
|
3692
|
+
result.push(...baseClasses.map((c) => `${c}--unpinned`));
|
|
3693
|
+
}
|
|
3694
|
+
return result.filter(Boolean).join(" ");
|
|
3678
3695
|
}
|
|
3679
|
-
var InfiniteTableCell = memo5(InfiniteTableCellFn);
|
|
3680
3696
|
|
|
3681
3697
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
3682
3698
|
var import_binary_search2 = __toModule(require_binary_search());
|
|
@@ -3688,10 +3704,22 @@ import {
|
|
|
3688
3704
|
} from "react";
|
|
3689
3705
|
|
|
3690
3706
|
// src/components/InfiniteTable/hooks/useInfiniteTable.ts
|
|
3691
|
-
import { useContext as
|
|
3707
|
+
import { useContext as useContext3 } from "react";
|
|
3708
|
+
|
|
3709
|
+
// src/components/InfiniteTable/InfiniteTableContext.ts
|
|
3710
|
+
import { createContext as createContext3 } from "react";
|
|
3711
|
+
var TableContext;
|
|
3712
|
+
function getInfiniteTableContext() {
|
|
3713
|
+
if (TableContext) {
|
|
3714
|
+
return TableContext;
|
|
3715
|
+
}
|
|
3716
|
+
return TableContext = createContext3(null);
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3719
|
+
// src/components/InfiniteTable/hooks/useInfiniteTable.ts
|
|
3692
3720
|
var useInfiniteTable = () => {
|
|
3693
3721
|
const TableContext2 = getInfiniteTableContext();
|
|
3694
|
-
return
|
|
3722
|
+
return useContext3(TableContext2);
|
|
3695
3723
|
};
|
|
3696
3724
|
|
|
3697
3725
|
// src/components/InfiniteTable/utils/moveXatY.ts
|
|
@@ -3842,42 +3870,46 @@ var useColumnPointerEvents = ({
|
|
|
3842
3870
|
};
|
|
3843
3871
|
};
|
|
3844
3872
|
|
|
3845
|
-
// src/components/InfiniteTable/
|
|
3846
|
-
function
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3873
|
+
// src/components/InfiniteTable/utils/RenderHookComponent.tsx
|
|
3874
|
+
function RenderHookComponent(props) {
|
|
3875
|
+
var _a;
|
|
3876
|
+
return (_a = props.render(props.renderParam)) != null ? _a : null;
|
|
3877
|
+
}
|
|
3878
|
+
|
|
3879
|
+
// src/components/InfiniteTable/components/FilterEditors.tsx
|
|
3880
|
+
import React14 from "react";
|
|
3881
|
+
function getFilterEditors() {
|
|
3882
|
+
return {
|
|
3883
|
+
string: StringFilterEditor,
|
|
3884
|
+
number: NumberFilterEditor
|
|
3857
3885
|
};
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3886
|
+
}
|
|
3887
|
+
var defaultFilterEditors = getFilterEditors();
|
|
3888
|
+
function StringFilterEditor(props) {
|
|
3889
|
+
return /* @__PURE__ */ React14.createElement("input", {
|
|
3890
|
+
"aria-label": `Filter for ${props.ariaLabel}`,
|
|
3891
|
+
type: "text",
|
|
3892
|
+
value: props.filterValue,
|
|
3893
|
+
onChange: (event) => {
|
|
3894
|
+
props.onChange(event.target.value);
|
|
3895
|
+
},
|
|
3896
|
+
className: props.className
|
|
3897
|
+
});
|
|
3898
|
+
}
|
|
3899
|
+
function NumberFilterEditor(props) {
|
|
3900
|
+
return /* @__PURE__ */ React14.createElement("input", {
|
|
3901
|
+
"aria-label": `Filter for ${props.ariaLabel}`,
|
|
3902
|
+
type: "number",
|
|
3903
|
+
value: props.filterValue,
|
|
3904
|
+
onChange: (event) => {
|
|
3905
|
+
let value = event.target.value;
|
|
3906
|
+
if (!isNaN(value + "")) {
|
|
3907
|
+
value = value + "";
|
|
3908
|
+
}
|
|
3909
|
+
props.onChange(value);
|
|
3910
|
+
},
|
|
3911
|
+
className: props.className
|
|
3912
|
+
});
|
|
3881
3913
|
}
|
|
3882
3914
|
|
|
3883
3915
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
@@ -3885,6 +3917,24 @@ import {
|
|
|
3885
3917
|
createElement as createElement10
|
|
3886
3918
|
} from "react";
|
|
3887
3919
|
import { useEffect as useEffect7, useState as useState5 } from "react";
|
|
3920
|
+
|
|
3921
|
+
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
3922
|
+
var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
3923
|
+
var CellCls = "_1eexc2a5 _16lm1iwl _16lm1iw12 _16lm1iw13 _16lm1iw2 _16lm1iw1b _16lm1iw1c";
|
|
3924
|
+
var HeaderCellContentRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob115 _16lm1iwq _16lm1iws _16lm1iwl _16lm1iw12 _16lm1iw13", variantClassNames: { filtered: { false: "_12zfob116", true: "_12zfob117" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3925
|
+
var HeaderCellProxy = "_12zfob10";
|
|
3926
|
+
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"]] });
|
|
3927
|
+
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"]] });
|
|
3928
|
+
var HeaderFilterCls = "_12zfob11a _16lm1iwl _16lm1iw12 _16lm1iw13 _16lm1iw1";
|
|
3929
|
+
var HeaderFilterEditorCls = "_16lm1iws _16lm1iwq";
|
|
3930
|
+
var HeaderGroupCls = "_12zfob119 _16lm1iwl _16lm1iw12 _16lm1iw13";
|
|
3931
|
+
var HeaderScrollbarPlaceholderCls = "_12zfob16 _16lm1iw2";
|
|
3932
|
+
var HeaderSortIconCls = "_16lm1iw1";
|
|
3933
|
+
var HeaderSortIconIndexCls = "_12zfob15";
|
|
3934
|
+
var HeaderSortIconRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob12", center: "_12zfob13", end: "_12zfob14" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3935
|
+
var HeaderWrapperCls = "_12zfob118 _16lm1iw18 _16lm1iw1 _16lm1iwl _16lm1iw12";
|
|
3936
|
+
|
|
3937
|
+
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
3888
3938
|
var defaultLineStyle = {
|
|
3889
3939
|
marginTop: 2,
|
|
3890
3940
|
marginBottom: 2,
|
|
@@ -3929,12 +3979,7 @@ function SortIcon(props) {
|
|
|
3929
3979
|
if (!rendered) {
|
|
3930
3980
|
return null;
|
|
3931
3981
|
}
|
|
3932
|
-
const indexStyle = {
|
|
3933
|
-
position: "absolute",
|
|
3934
|
-
transition: "top 0.2s",
|
|
3935
|
-
top: 0,
|
|
3936
|
-
right: 2
|
|
3937
|
-
};
|
|
3982
|
+
const indexStyle = {};
|
|
3938
3983
|
if (direction === -1) {
|
|
3939
3984
|
indexStyle.top = "100%";
|
|
3940
3985
|
}
|
|
@@ -3943,7 +3988,8 @@ function SortIcon(props) {
|
|
|
3943
3988
|
className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
|
|
3944
3989
|
}, showIndex ? /* @__PURE__ */ createElement10("div", {
|
|
3945
3990
|
"data-name": "index",
|
|
3946
|
-
style: indexStyle
|
|
3991
|
+
style: indexStyle,
|
|
3992
|
+
className: HeaderSortIconIndexCls
|
|
3947
3993
|
}, index) : null, /* @__PURE__ */ createElement10("div", {
|
|
3948
3994
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
3949
3995
|
onTransitionEnd
|
|
@@ -3954,32 +4000,166 @@ function SortIcon(props) {
|
|
|
3954
4000
|
}));
|
|
3955
4001
|
}
|
|
3956
4002
|
|
|
3957
|
-
// src/components/InfiniteTable/components/
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
var
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
4003
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4004
|
+
import {
|
|
4005
|
+
Fragment,
|
|
4006
|
+
createElement as createElement11,
|
|
4007
|
+
memo as memo5
|
|
4008
|
+
} from "react";
|
|
4009
|
+
|
|
4010
|
+
// src/components/InfiniteTable/hooks/useInfiniteTableState.ts
|
|
4011
|
+
import { useContext as useContext4 } from "react";
|
|
4012
|
+
var useInfiniteTableState = () => {
|
|
4013
|
+
const TableContext2 = getInfiniteTableContext();
|
|
4014
|
+
const { componentState } = useContext4(TableContext2);
|
|
4015
|
+
return componentState;
|
|
4016
|
+
};
|
|
4017
|
+
|
|
4018
|
+
// src/components/InfiniteTable/components/cell.css.ts
|
|
4019
|
+
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4020
|
+
var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
|
|
4021
|
+
var ColumnCellCls = "_1eexc2a5 _16lm1iwl _16lm1iw12 _16lm1iw13 _16lm1iw2 _16lm1iw1b _16lm1iw1c";
|
|
4022
|
+
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"]] });
|
|
4023
|
+
|
|
4024
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4025
|
+
var { rootClassName: rootClassName3 } = internalProps;
|
|
4026
|
+
var InfiniteTableCellClassName = `${rootClassName3}Cell`;
|
|
4027
|
+
var InfiniteTableCellContentClassName = `${rootClassName3}Cell_content`;
|
|
4028
|
+
function InfiniteTableCellFn(props) {
|
|
4029
|
+
var _b, _c, _d;
|
|
4030
|
+
const _a = props, {
|
|
4031
|
+
cssEllipsis = true,
|
|
4032
|
+
virtualized = true,
|
|
4033
|
+
skipColumnShifting = false,
|
|
4034
|
+
offsetProperty = "left",
|
|
4035
|
+
contentStyle,
|
|
4036
|
+
column,
|
|
4037
|
+
domRef,
|
|
4038
|
+
width,
|
|
4039
|
+
contentClassName,
|
|
4040
|
+
afterChildren,
|
|
4041
|
+
beforeChildren,
|
|
4042
|
+
offset,
|
|
4043
|
+
cellType,
|
|
4044
|
+
cssPosition: _cssPosition,
|
|
4045
|
+
renderChildren
|
|
4046
|
+
} = _a, domProps = __objRest(_a, [
|
|
4047
|
+
"cssEllipsis",
|
|
4048
|
+
"virtualized",
|
|
4049
|
+
"skipColumnShifting",
|
|
4050
|
+
"offsetProperty",
|
|
4051
|
+
"contentStyle",
|
|
4052
|
+
"column",
|
|
4053
|
+
"domRef",
|
|
4054
|
+
"width",
|
|
4055
|
+
"contentClassName",
|
|
4056
|
+
"afterChildren",
|
|
4057
|
+
"beforeChildren",
|
|
4058
|
+
"offset",
|
|
4059
|
+
"cellType",
|
|
4060
|
+
"cssPosition",
|
|
4061
|
+
"renderChildren"
|
|
4062
|
+
]);
|
|
4063
|
+
const children = renderChildren();
|
|
4064
|
+
const { columnShifts } = useInfiniteTableState();
|
|
4065
|
+
const shifting = !!columnShifts;
|
|
4066
|
+
const style = __spreadValues({
|
|
4067
|
+
width
|
|
4068
|
+
}, domProps.style);
|
|
4069
|
+
if (!skipColumnShifting && columnShifts && columnShifts[column.computedVisibleIndex]) {
|
|
4070
|
+
const shiftLeft = columnShifts[column.computedVisibleIndex] + (offset != null ? offset : 0);
|
|
4071
|
+
if (virtualized) {
|
|
4072
|
+
style.left = shiftLeft;
|
|
4073
|
+
} else {
|
|
4074
|
+
style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
|
|
4075
|
+
}
|
|
4076
|
+
}
|
|
4077
|
+
const finalDOMProps = __spreadProps(__spreadValues({}, domProps), {
|
|
4078
|
+
style,
|
|
4079
|
+
"data-column-id": column.id,
|
|
4080
|
+
className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls, shifting ? `${InfiniteTableCellClassName}--shifting ${CellClsVariants.shifting}` : ""),
|
|
4081
|
+
children: /* @__PURE__ */ createElement11(Fragment, null, beforeChildren, /* @__PURE__ */ createElement11("div", {
|
|
4082
|
+
className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
|
|
4083
|
+
style: contentStyle
|
|
4084
|
+
}, children), afterChildren)
|
|
4085
|
+
});
|
|
4086
|
+
const RenderComponent = cellType === "body" ? (_c = column.components) == null ? void 0 : _c.ColumnCell : (_d = column.components) == null ? void 0 : _d.HeaderCell;
|
|
4087
|
+
if (RenderComponent) {
|
|
4088
|
+
return /* @__PURE__ */ createElement11(RenderComponent, __spreadValues({}, finalDOMProps));
|
|
4089
|
+
}
|
|
4090
|
+
return /* @__PURE__ */ createElement11("div", __spreadProps(__spreadValues({}, finalDOMProps), {
|
|
4091
|
+
ref: domRef
|
|
4092
|
+
}));
|
|
4093
|
+
}
|
|
4094
|
+
var InfiniteTableCell = memo5(InfiniteTableCellFn);
|
|
4095
|
+
|
|
4096
|
+
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx
|
|
4097
|
+
import {
|
|
4098
|
+
createElement as createElement12
|
|
4099
|
+
} from "react";
|
|
4100
|
+
import { useEffect as useEffect8, useState as useState6 } from "react";
|
|
4101
|
+
var { rootClassName: rootClassName4 } = internalProps;
|
|
4102
|
+
var InfiniteTableColumnHeaderFilterClassName = `${rootClassName4}HeaderCell__filter`;
|
|
4103
|
+
var stopPropagation = (e) => e.stopPropagation();
|
|
4104
|
+
function InfiniteTableColumnHeaderFilter(props) {
|
|
4105
|
+
var _a, _b, _c, _d;
|
|
4106
|
+
const [theValue, setTheValue] = useState6((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
|
|
4107
|
+
const onInputChange = (filterValue) => {
|
|
4108
|
+
setTheValue(filterValue);
|
|
4109
|
+
props.onChange(filterValue);
|
|
4110
|
+
};
|
|
4111
|
+
useEffect8(() => {
|
|
4112
|
+
var _a2;
|
|
4113
|
+
if (props.columnFilterValue) {
|
|
4114
|
+
if (theValue !== props.columnFilterValue.filterValue) {
|
|
4115
|
+
setTheValue(props.columnFilterValue.filterValue);
|
|
4116
|
+
}
|
|
4117
|
+
} else {
|
|
4118
|
+
const currentFilterType = props.filterTypes[(_a2 = props.columnFilterType) != null ? _a2 : "string"];
|
|
4119
|
+
if (currentFilterType) {
|
|
4120
|
+
const emptyValue = [...currentFilterType.emptyValues][0];
|
|
4121
|
+
if (emptyValue !== theValue) {
|
|
4122
|
+
setTheValue(emptyValue);
|
|
4123
|
+
}
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
}, [(_c = props.columnFilterValue) == null ? void 0 : _c.filterValue]);
|
|
4127
|
+
const filterType = props.columnFilterValue ? props.columnFilterValue.filterType : (_d = props.columnFilterType) != null ? _d : "string";
|
|
4128
|
+
const operator = props.columnFilterValue ? props.columnFilterValue.operator : props.filterTypes[filterType] ? props.filterTypes[filterType].defaultOperator : props.filterTypes.string.defaultOperator;
|
|
4129
|
+
const filterEditorProps = {
|
|
4130
|
+
ariaLabel: `Filter for ${props.columnLabel}`,
|
|
4131
|
+
filterValue: theValue,
|
|
4132
|
+
className: HeaderFilterEditorCls,
|
|
4133
|
+
operator,
|
|
4134
|
+
filterType,
|
|
4135
|
+
onChange: onInputChange
|
|
4136
|
+
};
|
|
4137
|
+
const FilterEditor = props.filterEditor;
|
|
4138
|
+
return /* @__PURE__ */ createElement12("div", {
|
|
4139
|
+
onPointerUp: stopPropagation,
|
|
4140
|
+
onPointerDown: stopPropagation,
|
|
4141
|
+
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
|
|
4142
|
+
style: { height: props.columnHeaderHeight }
|
|
4143
|
+
}, FilterEditor ? /* @__PURE__ */ createElement12(FilterEditor, __spreadValues({}, filterEditorProps)) : null);
|
|
4144
|
+
}
|
|
4145
|
+
function InfiniteTableColumnHeaderFilterEmpty() {
|
|
4146
|
+
return /* @__PURE__ */ createElement12("div", {
|
|
4147
|
+
onPointerUp: stopPropagation,
|
|
4148
|
+
onPointerDown: stopPropagation,
|
|
4149
|
+
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
|
|
4150
|
+
style: { height: "100%" }
|
|
4151
|
+
});
|
|
3972
4152
|
}
|
|
3973
4153
|
|
|
3974
4154
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
3975
4155
|
var InfiniteTableHeaderCellContext = createContext4(null);
|
|
3976
|
-
var { rootClassName:
|
|
3977
|
-
var InfiniteTableHeaderCellClassName = `${
|
|
4156
|
+
var { rootClassName: rootClassName5 } = internalProps;
|
|
4157
|
+
var InfiniteTableHeaderCellClassName = `${rootClassName5}HeaderCell`;
|
|
3978
4158
|
function InfiniteTableHeaderCell(props) {
|
|
3979
|
-
var _a, _b, _c, _d;
|
|
4159
|
+
var _a, _b, _c, _d, _e;
|
|
3980
4160
|
const column = props.column;
|
|
3981
4161
|
const columns = props.columns;
|
|
3982
|
-
const { onResize, height, width } = props;
|
|
4162
|
+
const { onResize, height, width, headerOptions } = props;
|
|
3983
4163
|
const sortInfo = column.computedSortInfo;
|
|
3984
4164
|
let header = column.header;
|
|
3985
4165
|
const ref = useCallback6((node) => {
|
|
@@ -3987,33 +4167,43 @@ function InfiniteTableHeaderCell(props) {
|
|
|
3987
4167
|
domRef.current = node;
|
|
3988
4168
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
3989
4169
|
}, [props.domRef]);
|
|
3990
|
-
const
|
|
4170
|
+
const alwaysShow = headerOptions.alwaysReserveSpaceForSortIcon;
|
|
4171
|
+
const sortTool = column.computedSorted || alwaysShow ? /* @__PURE__ */ createElement13(SortIcon, {
|
|
3991
4172
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
3992
|
-
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls}
|
|
4173
|
+
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls} ${HeaderSortIconRecipe({
|
|
4174
|
+
align: column.align || "start"
|
|
4175
|
+
})}`,
|
|
3993
4176
|
direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
|
|
3994
|
-
});
|
|
4177
|
+
}) : null;
|
|
3995
4178
|
const renderParam = {
|
|
3996
4179
|
domRef: ref,
|
|
3997
4180
|
column,
|
|
3998
4181
|
columnSortInfo: sortInfo,
|
|
4182
|
+
columnFilterValue: column.computedFilterValue,
|
|
3999
4183
|
sortTool
|
|
4000
4184
|
};
|
|
4185
|
+
const align = column.align || "start";
|
|
4001
4186
|
const renderChildren = () => {
|
|
4002
4187
|
if (header instanceof Function) {
|
|
4003
|
-
header = /* @__PURE__ */
|
|
4188
|
+
header = /* @__PURE__ */ createElement13(RenderHookComponent, {
|
|
4004
4189
|
render: header,
|
|
4005
4190
|
renderParam
|
|
4006
4191
|
});
|
|
4007
4192
|
}
|
|
4008
4193
|
header = header != null ? header : column.name;
|
|
4009
|
-
return header;
|
|
4194
|
+
return /* @__PURE__ */ createElement13(Fragment2, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
|
|
4010
4195
|
};
|
|
4011
4196
|
const domRef = useRef10(null);
|
|
4012
4197
|
const {
|
|
4013
|
-
computed: { computedRemainingSpace },
|
|
4014
|
-
componentState: { portalDOMRef }
|
|
4198
|
+
computed: { computedRemainingSpace, showColumnFilters },
|
|
4199
|
+
componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
|
|
4015
4200
|
} = useInfiniteTable();
|
|
4016
|
-
|
|
4201
|
+
const {
|
|
4202
|
+
componentActions: dataSourceActions,
|
|
4203
|
+
getState: getDataSourceState,
|
|
4204
|
+
componentState: { filterDelay, filterTypes }
|
|
4205
|
+
} = useDataSourceContextValue();
|
|
4206
|
+
useEffect9(() => {
|
|
4017
4207
|
let clearOnResize = null;
|
|
4018
4208
|
const node = domRef.current;
|
|
4019
4209
|
if (onResize && node) {
|
|
@@ -4034,7 +4224,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4034
4224
|
});
|
|
4035
4225
|
let draggingProxy = null;
|
|
4036
4226
|
if (dragging) {
|
|
4037
|
-
draggingProxy = /* @__PURE__ */
|
|
4227
|
+
draggingProxy = /* @__PURE__ */ createElement13("div", {
|
|
4038
4228
|
className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
|
|
4039
4229
|
style: {
|
|
4040
4230
|
position: "absolute",
|
|
@@ -4048,9 +4238,73 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4048
4238
|
draggingProxy = createPortal(draggingProxy, portalDOMRef.current);
|
|
4049
4239
|
}
|
|
4050
4240
|
const ContextProvider = InfiniteTableHeaderCellContext.Provider;
|
|
4051
|
-
|
|
4241
|
+
const contentRecipeVariants = {
|
|
4242
|
+
filtered: column.computedFiltered
|
|
4243
|
+
};
|
|
4244
|
+
const setFilterValue = useCallback6((filterValue) => {
|
|
4245
|
+
var _a2;
|
|
4246
|
+
const state = getDataSourceState();
|
|
4247
|
+
let newFilterValue = (_a2 = state.filterValue) != null ? _a2 : [];
|
|
4248
|
+
let found = false;
|
|
4249
|
+
newFilterValue = newFilterValue.map((currentFilterValue) => {
|
|
4250
|
+
if (filterValue.id && currentFilterValue.id === filterValue.id || filterValue.field && currentFilterValue.field === column.field) {
|
|
4251
|
+
found = true;
|
|
4252
|
+
return filterValue;
|
|
4253
|
+
}
|
|
4254
|
+
return currentFilterValue;
|
|
4255
|
+
});
|
|
4256
|
+
if (!found) {
|
|
4257
|
+
newFilterValue.push(filterValue);
|
|
4258
|
+
}
|
|
4259
|
+
newFilterValue = newFilterValue.filter((filterValue2) => {
|
|
4260
|
+
const filterType2 = filterTypes[filterValue2.filterType];
|
|
4261
|
+
if (!filterType2 || filterType2.emptyValues.has(filterValue2.filterValue)) {
|
|
4262
|
+
return false;
|
|
4263
|
+
}
|
|
4264
|
+
return true;
|
|
4265
|
+
});
|
|
4266
|
+
dataSourceActions.filterValue = newFilterValue;
|
|
4267
|
+
}, [column, filterTypes]);
|
|
4268
|
+
const debouncedOnFilterValueChange = useMemo5(() => {
|
|
4269
|
+
const fn = (filterValue) => {
|
|
4270
|
+
let newFilterValueForColumn;
|
|
4271
|
+
if (column.computedFilterValue) {
|
|
4272
|
+
newFilterValueForColumn = __spreadValues({}, column.computedFilterValue);
|
|
4273
|
+
} else {
|
|
4274
|
+
const filterType2 = column.computedFilterType;
|
|
4275
|
+
const filterValueForColumn = {
|
|
4276
|
+
filterType: filterType2,
|
|
4277
|
+
operator: filterTypes[filterType2].defaultOperator,
|
|
4278
|
+
filterValue,
|
|
4279
|
+
valueGetter: column.valueGetter
|
|
4280
|
+
};
|
|
4281
|
+
if (column.field) {
|
|
4282
|
+
filterValueForColumn.field = column.field;
|
|
4283
|
+
} else {
|
|
4284
|
+
filterValueForColumn.id = column.id;
|
|
4285
|
+
}
|
|
4286
|
+
newFilterValueForColumn = filterValueForColumn;
|
|
4287
|
+
}
|
|
4288
|
+
newFilterValueForColumn.filterValue = filterValue;
|
|
4289
|
+
setFilterValue(newFilterValueForColumn);
|
|
4290
|
+
};
|
|
4291
|
+
if (filterDelay > 0) {
|
|
4292
|
+
return debounce(fn, { wait: filterDelay });
|
|
4293
|
+
}
|
|
4294
|
+
return fn;
|
|
4295
|
+
}, [
|
|
4296
|
+
filterDelay,
|
|
4297
|
+
setFilterValue,
|
|
4298
|
+
column.computedFilterValue,
|
|
4299
|
+
column.id,
|
|
4300
|
+
column.field,
|
|
4301
|
+
column.computedFilterType
|
|
4302
|
+
]);
|
|
4303
|
+
const filterType = column.computedFilterType;
|
|
4304
|
+
const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
|
|
4305
|
+
return /* @__PURE__ */ createElement13(ContextProvider, {
|
|
4052
4306
|
value: renderParam
|
|
4053
|
-
}, /* @__PURE__ */
|
|
4307
|
+
}, /* @__PURE__ */ createElement13(InfiniteTableCell, {
|
|
4054
4308
|
domRef: ref,
|
|
4055
4309
|
cellType: "header",
|
|
4056
4310
|
column,
|
|
@@ -4060,9 +4314,19 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4060
4314
|
width,
|
|
4061
4315
|
onPointerDown,
|
|
4062
4316
|
onPointerUp,
|
|
4317
|
+
contentClassName: join(HeaderCellContentRecipe(contentRecipeVariants), justifyContent[(_c = column.align) != null ? _c : "start"]),
|
|
4318
|
+
contentStyle: showColumnFilters ? { height: height / 2 } : void 0,
|
|
4063
4319
|
className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging, zebra: false }), CellCls),
|
|
4064
|
-
cssEllipsis: (
|
|
4065
|
-
afterChildren:
|
|
4320
|
+
cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
|
|
4321
|
+
afterChildren: showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement13(InfiniteTableColumnHeaderFilter, {
|
|
4322
|
+
filterEditor: FilterEditor,
|
|
4323
|
+
filterTypes,
|
|
4324
|
+
onChange: debouncedOnFilterValueChange,
|
|
4325
|
+
columnFilterType: filterType,
|
|
4326
|
+
columnLabel: column.field || column.name || column.id,
|
|
4327
|
+
columnFilterValue: column.computedFilterValue,
|
|
4328
|
+
columnHeaderHeight
|
|
4329
|
+
}) : /* @__PURE__ */ createElement13(InfiniteTableColumnHeaderFilterEmpty, null) : null,
|
|
4066
4330
|
renderChildren
|
|
4067
4331
|
}), draggingProxy);
|
|
4068
4332
|
}
|
|
@@ -4073,9 +4337,9 @@ function useInfiniteHeaderCell() {
|
|
|
4073
4337
|
|
|
4074
4338
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
4075
4339
|
import {
|
|
4076
|
-
createElement as
|
|
4340
|
+
createElement as createElement16,
|
|
4077
4341
|
useCallback as useCallback8,
|
|
4078
|
-
useMemo as
|
|
4342
|
+
useMemo as useMemo6
|
|
4079
4343
|
} from "react";
|
|
4080
4344
|
|
|
4081
4345
|
// src/components/utils/getScrollbarWidth.ts
|
|
@@ -4199,14 +4463,14 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
4199
4463
|
|
|
4200
4464
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
4201
4465
|
import {
|
|
4202
|
-
createElement as
|
|
4466
|
+
createElement as createElement15,
|
|
4203
4467
|
memo as memo6
|
|
4204
4468
|
} from "react";
|
|
4205
|
-
import { useCallback as useCallback7, useEffect as
|
|
4469
|
+
import { useCallback as useCallback7, useEffect as useEffect10, useRef as useRef11 } from "react";
|
|
4206
4470
|
|
|
4207
4471
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
4208
4472
|
import {
|
|
4209
|
-
createElement as
|
|
4473
|
+
createElement as createElement14
|
|
4210
4474
|
} from "react";
|
|
4211
4475
|
var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
|
|
4212
4476
|
function InfiniteTableHeaderGroup(props) {
|
|
@@ -4217,35 +4481,35 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
4217
4481
|
columnGroup
|
|
4218
4482
|
});
|
|
4219
4483
|
}
|
|
4220
|
-
return /* @__PURE__ */
|
|
4484
|
+
return /* @__PURE__ */ createElement14("div", {
|
|
4221
4485
|
ref: props.domRef,
|
|
4222
4486
|
"data-group-id": columnGroup.uniqueGroupId,
|
|
4223
4487
|
className: join(HeaderGroupCls, TableHeaderGroupClassName),
|
|
4224
4488
|
style: { width, height }
|
|
4225
|
-
}, /* @__PURE__ */
|
|
4489
|
+
}, /* @__PURE__ */ createElement14("div", {
|
|
4226
4490
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
4227
4491
|
}, header));
|
|
4228
4492
|
}
|
|
4229
4493
|
|
|
4230
4494
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
4231
|
-
var { rootClassName:
|
|
4232
|
-
var TableHeaderClassName = `${
|
|
4495
|
+
var { rootClassName: rootClassName6 } = internalProps;
|
|
4496
|
+
var TableHeaderClassName = `${rootClassName6}Header`;
|
|
4233
4497
|
function InfiniteTableHeaderFn(props) {
|
|
4234
4498
|
const {
|
|
4235
4499
|
brain,
|
|
4236
4500
|
columns,
|
|
4237
4501
|
style,
|
|
4238
4502
|
className,
|
|
4239
|
-
|
|
4503
|
+
columnHeaderHeight,
|
|
4240
4504
|
columnAndGroupTreeInfo,
|
|
4241
4505
|
columnGroupsMaxDepth
|
|
4242
4506
|
} = props;
|
|
4243
4507
|
const {
|
|
4244
4508
|
computed,
|
|
4245
|
-
componentState: { headerBrain }
|
|
4509
|
+
componentState: { headerBrain, headerOptions }
|
|
4246
4510
|
} = useInfiniteTable();
|
|
4247
|
-
const { computedVisibleColumnsMap } = computed;
|
|
4248
|
-
|
|
4511
|
+
const { computedVisibleColumnsMap, showColumnFilters } = computed;
|
|
4512
|
+
useEffect10(() => {
|
|
4249
4513
|
const onScroll = (scrollPosition) => {
|
|
4250
4514
|
if (domRef.current) {
|
|
4251
4515
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
@@ -4262,7 +4526,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4262
4526
|
const domProps = {
|
|
4263
4527
|
ref: domRef,
|
|
4264
4528
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
4265
|
-
style: __spreadProps(__spreadValues({}, style), { height:
|
|
4529
|
+
style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
|
|
4266
4530
|
};
|
|
4267
4531
|
const renderCell = useCallback7((params) => {
|
|
4268
4532
|
const {
|
|
@@ -4289,7 +4553,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4289
4553
|
computedWidth: colGroupItem.computedWidth,
|
|
4290
4554
|
groupOffset: colGroupItem.groupOffset
|
|
4291
4555
|
});
|
|
4292
|
-
return /* @__PURE__ */
|
|
4556
|
+
return /* @__PURE__ */ createElement15(InfiniteTableHeaderGroup, {
|
|
4293
4557
|
domRef: domRef2,
|
|
4294
4558
|
columns: columns2,
|
|
4295
4559
|
width: widthWithColspan,
|
|
@@ -4297,15 +4561,23 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4297
4561
|
columnGroup: computedColumnGroup
|
|
4298
4562
|
});
|
|
4299
4563
|
}
|
|
4300
|
-
return /* @__PURE__ */
|
|
4564
|
+
return /* @__PURE__ */ createElement15(InfiniteTableHeaderCell, {
|
|
4301
4565
|
domRef: domRef2,
|
|
4302
4566
|
column,
|
|
4567
|
+
headerOptions,
|
|
4303
4568
|
width: widthWithColspan,
|
|
4304
4569
|
height: heightWithRowspan,
|
|
4305
4570
|
columns: computedVisibleColumnsMap
|
|
4306
4571
|
});
|
|
4307
|
-
}, [
|
|
4308
|
-
|
|
4572
|
+
}, [
|
|
4573
|
+
headerOptions,
|
|
4574
|
+
columns,
|
|
4575
|
+
columnHeaderHeight,
|
|
4576
|
+
columnAndGroupTreeInfo,
|
|
4577
|
+
columnGroupsMaxDepth,
|
|
4578
|
+
showColumnFilters
|
|
4579
|
+
]);
|
|
4580
|
+
return /* @__PURE__ */ createElement15("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement15(RawTable, {
|
|
4309
4581
|
renderCell,
|
|
4310
4582
|
brain: headerBrain,
|
|
4311
4583
|
cellHoverClassNames: []
|
|
@@ -4321,19 +4593,20 @@ function TableHeaderWrapper(props) {
|
|
|
4321
4593
|
computedPinnedStartColumns,
|
|
4322
4594
|
computedPinnedEndColumns,
|
|
4323
4595
|
computedVisibleColumns,
|
|
4324
|
-
columnSize
|
|
4596
|
+
columnSize,
|
|
4597
|
+
showColumnFilters
|
|
4325
4598
|
} = tableContextValue.computed;
|
|
4326
4599
|
const {
|
|
4327
4600
|
componentState: {
|
|
4328
|
-
|
|
4601
|
+
columnHeaderHeight,
|
|
4329
4602
|
columnGroupsDepthsMap,
|
|
4330
4603
|
columnGroupsMaxDepth,
|
|
4331
4604
|
computedColumnGroups
|
|
4332
4605
|
}
|
|
4333
4606
|
} = tableContextValue;
|
|
4334
4607
|
const rows = !computedColumnGroups || !computedColumnGroups.size ? 1 : columnGroupsMaxDepth + 2;
|
|
4335
|
-
const height = rows *
|
|
4336
|
-
const columnAndGroupTreeInfo =
|
|
4608
|
+
const height = rows * columnHeaderHeight + (showColumnFilters ? columnHeaderHeight : 0);
|
|
4609
|
+
const columnAndGroupTreeInfo = useMemo6(() => {
|
|
4337
4610
|
if (!computedColumnGroups || !computedColumnGroups.size) {
|
|
4338
4611
|
return void 0;
|
|
4339
4612
|
}
|
|
@@ -4374,9 +4647,12 @@ function TableHeaderWrapper(props) {
|
|
|
4374
4647
|
]);
|
|
4375
4648
|
const rowspan = useCallback8(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).rowspan, [cellspan]);
|
|
4376
4649
|
const colspan = useCallback8(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).colspan, [cellspan]);
|
|
4650
|
+
const rowHeight = useCallback8((index) => {
|
|
4651
|
+
return showColumnFilters ? index < rows - 1 ? columnHeaderHeight : 2 * columnHeaderHeight : columnHeaderHeight;
|
|
4652
|
+
}, [rows, showColumnFilters, columnHeaderHeight]);
|
|
4377
4653
|
useMatrixBrain(brain, {
|
|
4378
4654
|
colWidth: columnSize,
|
|
4379
|
-
rowHeight
|
|
4655
|
+
rowHeight,
|
|
4380
4656
|
rows,
|
|
4381
4657
|
cols: computedVisibleColumns.length,
|
|
4382
4658
|
height,
|
|
@@ -4386,21 +4662,21 @@ function TableHeaderWrapper(props) {
|
|
|
4386
4662
|
fixedColsEnd: computedPinnedEndColumns.length,
|
|
4387
4663
|
fixedColsStart: computedPinnedStartColumns.length
|
|
4388
4664
|
});
|
|
4389
|
-
const header = /* @__PURE__ */
|
|
4665
|
+
const header = /* @__PURE__ */ createElement16(InfiniteTableHeader, {
|
|
4390
4666
|
columns: computedVisibleColumns,
|
|
4391
4667
|
brain,
|
|
4392
|
-
|
|
4668
|
+
columnHeaderHeight: height,
|
|
4393
4669
|
columnGroupsMaxDepth,
|
|
4394
4670
|
columnAndGroupTreeInfo
|
|
4395
4671
|
});
|
|
4396
|
-
const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */
|
|
4672
|
+
const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ createElement16("div", {
|
|
4397
4673
|
className: HeaderScrollbarPlaceholderCls,
|
|
4398
4674
|
style: {
|
|
4399
4675
|
zIndex: 1e3,
|
|
4400
4676
|
width: getScrollbarWidth()
|
|
4401
4677
|
}
|
|
4402
4678
|
}) : null;
|
|
4403
|
-
return /* @__PURE__ */
|
|
4679
|
+
return /* @__PURE__ */ createElement16("div", {
|
|
4404
4680
|
className: HeaderWrapperCls,
|
|
4405
4681
|
style: {
|
|
4406
4682
|
height
|
|
@@ -4410,12 +4686,12 @@ function TableHeaderWrapper(props) {
|
|
|
4410
4686
|
|
|
4411
4687
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
4412
4688
|
import {
|
|
4413
|
-
createElement as
|
|
4414
|
-
forwardRef as
|
|
4689
|
+
createElement as createElement17,
|
|
4690
|
+
forwardRef as forwardRef4,
|
|
4415
4691
|
useCallback as useCallback9,
|
|
4416
4692
|
useRef as useRef12
|
|
4417
4693
|
} from "react";
|
|
4418
|
-
import { useEffect as
|
|
4694
|
+
import { useEffect as useEffect11 } from "react";
|
|
4419
4695
|
|
|
4420
4696
|
// src/components/utils/decamelize.ts
|
|
4421
4697
|
function decamelize(str, options) {
|
|
@@ -4424,7 +4700,7 @@ function decamelize(str, options) {
|
|
|
4424
4700
|
}
|
|
4425
4701
|
|
|
4426
4702
|
// src/components/InfiniteTable/theme.css.ts
|
|
4427
|
-
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)",
|
|
4703
|
+
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)" } } };
|
|
4428
4704
|
|
|
4429
4705
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
4430
4706
|
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -4461,8 +4737,8 @@ var enforceStyle = (node, style) => {
|
|
|
4461
4737
|
node.style.setProperty(decamelize(propertyName), propertyValue, "important");
|
|
4462
4738
|
}
|
|
4463
4739
|
};
|
|
4464
|
-
var InfiniteTableLicenseFooter =
|
|
4465
|
-
const { rootClassName:
|
|
4740
|
+
var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter2(props, ref) {
|
|
4741
|
+
const { rootClassName: rootClassName9 } = useInternalProps();
|
|
4466
4742
|
const domRef = useRef12(null);
|
|
4467
4743
|
const domCallback = useCallback9((node) => {
|
|
4468
4744
|
domRef.current = node;
|
|
@@ -4475,7 +4751,7 @@ var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter
|
|
|
4475
4751
|
ref.current = node;
|
|
4476
4752
|
}
|
|
4477
4753
|
}, []);
|
|
4478
|
-
|
|
4754
|
+
useEffect11(() => {
|
|
4479
4755
|
const forceStyle = () => {
|
|
4480
4756
|
requestAnimationFrame(() => {
|
|
4481
4757
|
var _a;
|
|
@@ -4489,12 +4765,12 @@ var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter
|
|
|
4489
4765
|
clearInterval(intervalId);
|
|
4490
4766
|
};
|
|
4491
4767
|
}, []);
|
|
4492
|
-
return /* @__PURE__ */
|
|
4768
|
+
return /* @__PURE__ */ createElement17("div", __spreadProps(__spreadValues({
|
|
4493
4769
|
ref: domCallback
|
|
4494
4770
|
}, props), {
|
|
4495
|
-
className: join(`${
|
|
4771
|
+
className: join(`${rootClassName9}-Footer`, FooterCls, props.className),
|
|
4496
4772
|
style: defaultStyle
|
|
4497
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
4773
|
+
}), "Powered by", " ", /* @__PURE__ */ createElement17("a", {
|
|
4498
4774
|
href: "https://infinite-table.com",
|
|
4499
4775
|
rel: "noopener noreferrer",
|
|
4500
4776
|
role: "link",
|
|
@@ -4505,13 +4781,13 @@ var InfiniteTableLicenseFooter = forwardRef3(function InfiniteTableLicenseFooter
|
|
|
4505
4781
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
4506
4782
|
import {
|
|
4507
4783
|
createContext as createContext5,
|
|
4508
|
-
createElement as
|
|
4784
|
+
createElement as createElement18,
|
|
4509
4785
|
memo as memo7
|
|
4510
4786
|
} from "react";
|
|
4511
4787
|
import { useContext as useContext6 } from "react";
|
|
4512
|
-
var { rootClassName:
|
|
4788
|
+
var { rootClassName: rootClassName7 } = internalProps;
|
|
4513
4789
|
var InfiniteTableColumnCellContext = createContext5(null);
|
|
4514
|
-
var InfiniteTableColumnCellClassName = `${
|
|
4790
|
+
var InfiniteTableColumnCellClassName = `${rootClassName7}ColumnCell`;
|
|
4515
4791
|
function isColumnWithField(c) {
|
|
4516
4792
|
return typeof c.field === "string";
|
|
4517
4793
|
}
|
|
@@ -4519,6 +4795,8 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
4519
4795
|
var _a;
|
|
4520
4796
|
const {
|
|
4521
4797
|
rowInfo,
|
|
4798
|
+
rowStyle,
|
|
4799
|
+
rowClassName,
|
|
4522
4800
|
width,
|
|
4523
4801
|
column,
|
|
4524
4802
|
onMouseLeave,
|
|
@@ -4533,7 +4811,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
4533
4811
|
showZebraRows
|
|
4534
4812
|
} = props;
|
|
4535
4813
|
if (!column) {
|
|
4536
|
-
return /* @__PURE__ */
|
|
4814
|
+
return /* @__PURE__ */ createElement18("div", {
|
|
4537
4815
|
ref: domRef
|
|
4538
4816
|
}, "no column");
|
|
4539
4817
|
}
|
|
@@ -4542,37 +4820,49 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
4542
4820
|
const groupRowInfo = null;
|
|
4543
4821
|
let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
|
|
4544
4822
|
if (column.valueGetter) {
|
|
4545
|
-
|
|
4823
|
+
if (!rowInfo.isGroupRow && rowInfo.data) {
|
|
4824
|
+
value = column.valueGetter({ data: rowInfo.data, field: column.field });
|
|
4825
|
+
}
|
|
4826
|
+
}
|
|
4827
|
+
if (column.valueFormatter) {
|
|
4828
|
+
value = column.valueFormatter(isGroupRow ? {
|
|
4546
4829
|
data: rowInfo.data,
|
|
4547
4830
|
isGroupRow,
|
|
4548
|
-
rowInfo
|
|
4831
|
+
rowInfo,
|
|
4832
|
+
field: column.field,
|
|
4833
|
+
value
|
|
4549
4834
|
} : {
|
|
4550
4835
|
data: rowInfo.data,
|
|
4551
4836
|
isGroupRow,
|
|
4552
|
-
rowInfo
|
|
4837
|
+
rowInfo,
|
|
4838
|
+
field: column.field,
|
|
4839
|
+
value
|
|
4553
4840
|
});
|
|
4554
4841
|
}
|
|
4555
4842
|
const { componentState: computedDataSource } = useDataSourceContextValue();
|
|
4556
4843
|
const rest = rowInfo.isGroupRow ? {
|
|
4557
4844
|
rowInfo,
|
|
4558
|
-
|
|
4845
|
+
isGroupRow: rowInfo.isGroupRow,
|
|
4846
|
+
data: rowInfo.data,
|
|
4847
|
+
value,
|
|
4848
|
+
field: column.field
|
|
4559
4849
|
} : {
|
|
4560
4850
|
rowInfo,
|
|
4561
|
-
|
|
4851
|
+
isGroupRow: rowInfo.isGroupRow,
|
|
4852
|
+
data: rowInfo.data,
|
|
4853
|
+
value,
|
|
4854
|
+
field: column.field
|
|
4562
4855
|
};
|
|
4563
4856
|
const stylingRenderParam = __spreadValues({
|
|
4564
|
-
|
|
4565
|
-
column,
|
|
4566
|
-
isGroupRow
|
|
4857
|
+
column
|
|
4567
4858
|
}, rest);
|
|
4568
4859
|
const renderValue = value;
|
|
4569
4860
|
const renderParam = __spreadProps(__spreadValues({
|
|
4570
|
-
value,
|
|
4571
4861
|
column,
|
|
4572
4862
|
domRef,
|
|
4573
|
-
groupRowInfo
|
|
4574
|
-
isGroupRow
|
|
4863
|
+
groupRowInfo
|
|
4575
4864
|
}, rest), {
|
|
4865
|
+
isGroupRow,
|
|
4576
4866
|
rowIndex,
|
|
4577
4867
|
toggleGroupRow,
|
|
4578
4868
|
toggleCurrentGroupRow: () => {
|
|
@@ -4590,15 +4880,23 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
4590
4880
|
}
|
|
4591
4881
|
const renderFn = column.render || column.renderValue;
|
|
4592
4882
|
if (renderFn) {
|
|
4593
|
-
return /* @__PURE__ */
|
|
4883
|
+
return /* @__PURE__ */ createElement18(RenderHookComponent, {
|
|
4594
4884
|
render: renderFn,
|
|
4595
4885
|
renderParam
|
|
4596
4886
|
});
|
|
4597
4887
|
}
|
|
4598
4888
|
return renderValue;
|
|
4599
4889
|
};
|
|
4890
|
+
const rowPropsAndStyleArgs = __spreadProps(__spreadValues({}, rest), {
|
|
4891
|
+
rowIndex
|
|
4892
|
+
});
|
|
4893
|
+
const rowComputedClassName = typeof rowClassName === "function" ? rowClassName(rowPropsAndStyleArgs) : rowClassName;
|
|
4600
4894
|
const colClassName = column.className ? typeof column.className === "function" ? column.className(stylingRenderParam) : column.className : void 0;
|
|
4601
|
-
|
|
4895
|
+
let style;
|
|
4896
|
+
if (rowStyle) {
|
|
4897
|
+
style = typeof rowStyle === "function" ? __spreadValues(__spreadValues({}, style), rowStyle(rowPropsAndStyleArgs)) : __spreadValues(__spreadValues({}, style), rowStyle);
|
|
4898
|
+
}
|
|
4899
|
+
style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
|
|
4602
4900
|
style.width = width;
|
|
4603
4901
|
style.height = rowHeight;
|
|
4604
4902
|
const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
|
|
@@ -4614,13 +4912,13 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
4614
4912
|
onMouseLeave,
|
|
4615
4913
|
onMouseEnter,
|
|
4616
4914
|
cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
|
|
4617
|
-
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false, zebra }), colClassName),
|
|
4915
|
+
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false, zebra }), colClassName, rowComputedClassName),
|
|
4618
4916
|
renderChildren
|
|
4619
4917
|
};
|
|
4620
4918
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
4621
|
-
return /* @__PURE__ */
|
|
4919
|
+
return /* @__PURE__ */ createElement18(ContextProvider, {
|
|
4622
4920
|
value: renderParam
|
|
4623
|
-
}, /* @__PURE__ */
|
|
4921
|
+
}, /* @__PURE__ */ createElement18(InfiniteTableCell, __spreadValues({}, cellProps)));
|
|
4624
4922
|
}
|
|
4625
4923
|
var InfiniteTableColumnCell = memo7(InfiniteTableColumnCellFn);
|
|
4626
4924
|
function useInfiniteColumnCell() {
|
|
@@ -4636,7 +4934,7 @@ var RowHoverCls = "_7pupv01";
|
|
|
4636
4934
|
|
|
4637
4935
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
4638
4936
|
import {
|
|
4639
|
-
createElement as
|
|
4937
|
+
createElement as createElement19,
|
|
4640
4938
|
memo as memo8
|
|
4641
4939
|
} from "react";
|
|
4642
4940
|
|
|
@@ -4646,15 +4944,15 @@ var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwt _16lm1iwv _16lm1iwz _16lm1
|
|
|
4646
4944
|
var LoadMaskTextCls = "qy58ya4";
|
|
4647
4945
|
|
|
4648
4946
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
4649
|
-
var { rootClassName:
|
|
4650
|
-
var baseCls = `${
|
|
4947
|
+
var { rootClassName: rootClassName8 } = internalProps;
|
|
4948
|
+
var baseCls = `${rootClassName8}-LoadMask`;
|
|
4651
4949
|
function LoadMaskFn(props) {
|
|
4652
4950
|
const { visible, children = "Loading" } = props;
|
|
4653
|
-
return /* @__PURE__ */
|
|
4951
|
+
return /* @__PURE__ */ createElement19("div", {
|
|
4654
4952
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls}`
|
|
4655
|
-
}, /* @__PURE__ */
|
|
4953
|
+
}, /* @__PURE__ */ createElement19("div", {
|
|
4656
4954
|
className: `${LoadMaskOverlayCls} ${baseCls}-Overlay`
|
|
4657
|
-
}), /* @__PURE__ */
|
|
4955
|
+
}), /* @__PURE__ */ createElement19("div", {
|
|
4658
4956
|
className: `${LoadMaskTextCls} ${baseCls}-Text`
|
|
4659
4957
|
}, children));
|
|
4660
4958
|
}
|
|
@@ -4662,9 +4960,9 @@ var LoadMask = memo8(LoadMaskFn);
|
|
|
4662
4960
|
|
|
4663
4961
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
4664
4962
|
import {
|
|
4665
|
-
useEffect as
|
|
4963
|
+
useEffect as useEffect12,
|
|
4666
4964
|
useRef as useRef13,
|
|
4667
|
-
useState as
|
|
4965
|
+
useState as useState7
|
|
4668
4966
|
} from "react";
|
|
4669
4967
|
var OFFSET = 10;
|
|
4670
4968
|
function getColumnContentMaxWidths(domRef, options) {
|
|
@@ -4687,6 +4985,7 @@ function getColumnContentMaxWidths(domRef, options) {
|
|
|
4687
4985
|
contentClone.style.pointerEvents = "none";
|
|
4688
4986
|
contentClone.classList.remove(...cssEllipsisClassName.split(" "));
|
|
4689
4987
|
contentClone.style.position = "absolute";
|
|
4988
|
+
contentClone.style.width = "auto";
|
|
4690
4989
|
cell.appendChild(contentClone);
|
|
4691
4990
|
let measuredWidth = contentClone.offsetWidth;
|
|
4692
4991
|
cell.removeChild(contentClone);
|
|
@@ -4724,11 +5023,11 @@ function useAutoSizeColumns() {
|
|
|
4724
5023
|
componentActions,
|
|
4725
5024
|
componentState: { domRef, ready, autoSizeColumnsKey, brain }
|
|
4726
5025
|
} = useComponentState();
|
|
4727
|
-
const [refreshId, setRefreshId] =
|
|
5026
|
+
const [refreshId, setRefreshId] = useState7(0);
|
|
4728
5027
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
4729
5028
|
const getTheKey = useLatest(theKey);
|
|
4730
5029
|
const lastExecutedIdentifierRef = useRef13(null);
|
|
4731
|
-
|
|
5030
|
+
useEffect12(() => {
|
|
4732
5031
|
const key = getTheKey();
|
|
4733
5032
|
if (key == null) {
|
|
4734
5033
|
return;
|
|
@@ -4741,7 +5040,7 @@ function useAutoSizeColumns() {
|
|
|
4741
5040
|
};
|
|
4742
5041
|
return brain.onRenderRangeChange(onChange);
|
|
4743
5042
|
}, [brain]);
|
|
4744
|
-
|
|
5043
|
+
useEffect12(() => {
|
|
4745
5044
|
var _a;
|
|
4746
5045
|
if (theKey == null) {
|
|
4747
5046
|
return;
|
|
@@ -4786,13 +5085,13 @@ function useAutoSizeColumns() {
|
|
|
4786
5085
|
}
|
|
4787
5086
|
|
|
4788
5087
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
4789
|
-
import { useCallback as useCallback11, useEffect as
|
|
4790
|
-
import
|
|
5088
|
+
import { useCallback as useCallback11, useEffect as useEffect13, useRef as useRef14 } from "react";
|
|
5089
|
+
import React25 from "react";
|
|
4791
5090
|
|
|
4792
5091
|
// src/components/hooks/useRerender.ts
|
|
4793
|
-
import { useCallback as useCallback10, useState as
|
|
5092
|
+
import { useCallback as useCallback10, useState as useState8 } from "react";
|
|
4794
5093
|
var useRerender = () => {
|
|
4795
|
-
const [state, setState] =
|
|
5094
|
+
const [state, setState] = useState8(0);
|
|
4796
5095
|
return [
|
|
4797
5096
|
state,
|
|
4798
5097
|
useCallback10(() => {
|
|
@@ -4851,6 +5150,8 @@ function useCellRendering(param) {
|
|
|
4851
5150
|
groupRenderStrategy,
|
|
4852
5151
|
brain,
|
|
4853
5152
|
showZebraRows,
|
|
5153
|
+
rowStyle,
|
|
5154
|
+
rowClassName,
|
|
4854
5155
|
onScrollToTop,
|
|
4855
5156
|
onScrollToBottom,
|
|
4856
5157
|
scrollToBottomOffset
|
|
@@ -4868,12 +5169,12 @@ function useCellRendering(param) {
|
|
|
4868
5169
|
rowspan
|
|
4869
5170
|
});
|
|
4870
5171
|
const scrollTopMaxRef = useRef14(0);
|
|
4871
|
-
|
|
5172
|
+
useEffect13(() => {
|
|
4872
5173
|
return brain.onRenderCountChange(() => {
|
|
4873
5174
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
4874
5175
|
});
|
|
4875
5176
|
}, [brain]);
|
|
4876
|
-
|
|
5177
|
+
useEffect13(() => {
|
|
4877
5178
|
return brain.onScrollStop((scrollPosition) => {
|
|
4878
5179
|
const { scrollTop } = scrollPosition;
|
|
4879
5180
|
if (scrollTop === 0) {
|
|
@@ -4890,7 +5191,7 @@ function useCellRendering(param) {
|
|
|
4890
5191
|
}
|
|
4891
5192
|
});
|
|
4892
5193
|
}, [brain, onScrollToTop, onScrollToBottom]);
|
|
4893
|
-
|
|
5194
|
+
useEffect13(() => {
|
|
4894
5195
|
if (!bodySize.height) {
|
|
4895
5196
|
return;
|
|
4896
5197
|
}
|
|
@@ -4911,7 +5212,7 @@ function useCellRendering(param) {
|
|
|
4911
5212
|
}
|
|
4912
5213
|
}, [!!bodySize.height]);
|
|
4913
5214
|
const [, rerender] = useRerender();
|
|
4914
|
-
|
|
5215
|
+
useEffect13(() => {
|
|
4915
5216
|
rerender();
|
|
4916
5217
|
}, [dataSourceState]);
|
|
4917
5218
|
const renderCell = useCallback11((params) => {
|
|
@@ -4945,9 +5246,11 @@ function useCellRendering(param) {
|
|
|
4945
5246
|
onMouseLeave,
|
|
4946
5247
|
domRef,
|
|
4947
5248
|
width,
|
|
4948
|
-
column
|
|
5249
|
+
column,
|
|
5250
|
+
rowStyle,
|
|
5251
|
+
rowClassName
|
|
4949
5252
|
};
|
|
4950
|
-
return /* @__PURE__ */
|
|
5253
|
+
return /* @__PURE__ */ React25.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
|
|
4951
5254
|
}, [
|
|
4952
5255
|
rowHeight,
|
|
4953
5256
|
getData,
|
|
@@ -4955,7 +5258,9 @@ function useCellRendering(param) {
|
|
|
4955
5258
|
groupRenderStrategy,
|
|
4956
5259
|
toggleGroupRow,
|
|
4957
5260
|
showZebraRows,
|
|
4958
|
-
repaintId
|
|
5261
|
+
repaintId,
|
|
5262
|
+
rowStyle,
|
|
5263
|
+
rowClassName
|
|
4959
5264
|
]);
|
|
4960
5265
|
return {
|
|
4961
5266
|
renderCell
|
|
@@ -4963,13 +5268,13 @@ function useCellRendering(param) {
|
|
|
4963
5268
|
}
|
|
4964
5269
|
|
|
4965
5270
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
4966
|
-
import { useCallback as useCallback14, useEffect as
|
|
5271
|
+
import { useCallback as useCallback14, useEffect as useEffect23, useState as useState12 } from "react";
|
|
4967
5272
|
|
|
4968
5273
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
4969
|
-
import { useEffect as
|
|
5274
|
+
import { useEffect as useEffect15 } from "react";
|
|
4970
5275
|
|
|
4971
5276
|
// src/components/hooks/useInterceptedMap.ts
|
|
4972
|
-
import { useEffect as
|
|
5277
|
+
import { useEffect as useEffect14 } from "react";
|
|
4973
5278
|
function interceptMap(map2, fns) {
|
|
4974
5279
|
const { set, delete: deleteKey, clear } = map2;
|
|
4975
5280
|
if (fns.set) {
|
|
@@ -5057,7 +5362,7 @@ function useColumnGroups() {
|
|
|
5057
5362
|
componentActions,
|
|
5058
5363
|
getComponentState
|
|
5059
5364
|
} = useComponentState();
|
|
5060
|
-
|
|
5365
|
+
useEffect15(() => {
|
|
5061
5366
|
const recompute = () => {
|
|
5062
5367
|
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
5063
5368
|
};
|
|
@@ -5068,7 +5373,7 @@ function useColumnGroups() {
|
|
|
5068
5373
|
set: update
|
|
5069
5374
|
});
|
|
5070
5375
|
}, [computedColumnGroups]);
|
|
5071
|
-
|
|
5376
|
+
useEffect15(() => {
|
|
5072
5377
|
return interceptMap(collapsedColumnGroups, {
|
|
5073
5378
|
set: (key, visibleCol) => {
|
|
5074
5379
|
const colIds = key.slice(1);
|
|
@@ -5103,14 +5408,17 @@ function useColumnGroups() {
|
|
|
5103
5408
|
}
|
|
5104
5409
|
|
|
5105
5410
|
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
5106
|
-
import { useMemo as
|
|
5411
|
+
import { useMemo as useMemo7 } from "react";
|
|
5107
5412
|
function useColumnRowspan(computedVisibleColumns) {
|
|
5108
5413
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
5109
|
-
const rowspan =
|
|
5414
|
+
const rowspan = useMemo7(() => {
|
|
5110
5415
|
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
5111
5416
|
return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
|
|
5112
5417
|
const dataArray = getDataSourceState().dataArray;
|
|
5113
5418
|
const rowInfo = dataArray[rowIndex];
|
|
5419
|
+
if (!rowInfo) {
|
|
5420
|
+
return 1;
|
|
5421
|
+
}
|
|
5114
5422
|
const data = rowInfo.data;
|
|
5115
5423
|
const column = computedVisibleColumns[colIndex];
|
|
5116
5424
|
if (!column || !column.rowspan) {
|
|
@@ -5143,11 +5451,11 @@ function useColumnSizeFn(columns) {
|
|
|
5143
5451
|
}
|
|
5144
5452
|
|
|
5145
5453
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
5146
|
-
import { useEffect as
|
|
5454
|
+
import { useEffect as useEffect20, useMemo as useMemo9 } from "react";
|
|
5147
5455
|
|
|
5148
5456
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
5149
5457
|
import {
|
|
5150
|
-
createElement as
|
|
5458
|
+
createElement as createElement22
|
|
5151
5459
|
} from "react";
|
|
5152
5460
|
|
|
5153
5461
|
// src/utils/stripVar.ts
|
|
@@ -5165,10 +5473,10 @@ var showLoadingIcon = (rowInfo) => {
|
|
|
5165
5473
|
|
|
5166
5474
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5167
5475
|
import {
|
|
5168
|
-
createElement as
|
|
5169
|
-
useEffect as
|
|
5476
|
+
createElement as createElement20,
|
|
5477
|
+
useEffect as useEffect16
|
|
5170
5478
|
} from "react";
|
|
5171
|
-
import { useState as
|
|
5479
|
+
import { useState as useState9 } from "react";
|
|
5172
5480
|
|
|
5173
5481
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
5174
5482
|
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
@@ -5179,7 +5487,7 @@ var ExpanderIconClsVariants = (0, import_createRuntimeFn5.createRuntimeFn)({ def
|
|
|
5179
5487
|
function ExpanderIcon(props) {
|
|
5180
5488
|
var _a;
|
|
5181
5489
|
const { size = 24 } = props;
|
|
5182
|
-
const [expanded, setExpanded] =
|
|
5490
|
+
const [expanded, setExpanded] = useState9((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
5183
5491
|
const onClick = () => {
|
|
5184
5492
|
var _a2;
|
|
5185
5493
|
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
@@ -5187,12 +5495,12 @@ function ExpanderIcon(props) {
|
|
|
5187
5495
|
setExpanded(!expanded);
|
|
5188
5496
|
}
|
|
5189
5497
|
};
|
|
5190
|
-
|
|
5498
|
+
useEffect16(() => {
|
|
5191
5499
|
if (isControlled("expanded", props)) {
|
|
5192
5500
|
setExpanded(props.expanded);
|
|
5193
5501
|
}
|
|
5194
5502
|
}, [props.expanded]);
|
|
5195
|
-
return /* @__PURE__ */
|
|
5503
|
+
return /* @__PURE__ */ createElement20("svg", {
|
|
5196
5504
|
"data-name": "expander-icon",
|
|
5197
5505
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5198
5506
|
height: `${size}px`,
|
|
@@ -5203,14 +5511,14 @@ function ExpanderIcon(props) {
|
|
|
5203
5511
|
className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
|
|
5204
5512
|
expanded
|
|
5205
5513
|
}), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`)
|
|
5206
|
-
}, /* @__PURE__ */
|
|
5514
|
+
}, /* @__PURE__ */ createElement20("path", {
|
|
5207
5515
|
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
5208
5516
|
}));
|
|
5209
5517
|
}
|
|
5210
5518
|
|
|
5211
5519
|
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5212
5520
|
import {
|
|
5213
|
-
createElement as
|
|
5521
|
+
createElement as createElement21
|
|
5214
5522
|
} from "react";
|
|
5215
5523
|
|
|
5216
5524
|
// src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
|
|
@@ -5218,7 +5526,7 @@ var LoadingIconCls = "_16lm1iw8 _16lm1iwf _16lm1iwd";
|
|
|
5218
5526
|
|
|
5219
5527
|
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5220
5528
|
var LoadingIcon = (props) => {
|
|
5221
|
-
return /* @__PURE__ */
|
|
5529
|
+
return /* @__PURE__ */ createElement21("svg", {
|
|
5222
5530
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5223
5531
|
style: {
|
|
5224
5532
|
margin: "auto",
|
|
@@ -5230,14 +5538,14 @@ var LoadingIcon = (props) => {
|
|
|
5230
5538
|
viewBox: "0 0 100 100",
|
|
5231
5539
|
preserveAspectRatio: "xMidYMid",
|
|
5232
5540
|
className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
|
|
5233
|
-
}, /* @__PURE__ */
|
|
5541
|
+
}, /* @__PURE__ */ createElement21("circle", {
|
|
5234
5542
|
cx: "50",
|
|
5235
5543
|
cy: "50",
|
|
5236
5544
|
fill: "none",
|
|
5237
5545
|
strokeWidth: "10",
|
|
5238
5546
|
r: "35",
|
|
5239
5547
|
strokeDasharray: "164.93361431346415 56.97787143782138"
|
|
5240
|
-
}, /* @__PURE__ */
|
|
5548
|
+
}, /* @__PURE__ */ createElement21("animateTransform", {
|
|
5241
5549
|
attributeName: "transform",
|
|
5242
5550
|
type: "rotate",
|
|
5243
5551
|
repeatCount: "indefinite",
|
|
@@ -5257,7 +5565,7 @@ function getGroupColumnRender({
|
|
|
5257
5565
|
var _a, _b, _c;
|
|
5258
5566
|
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
5259
5567
|
if (column.renderValue) {
|
|
5260
|
-
value = /* @__PURE__ */
|
|
5568
|
+
value = /* @__PURE__ */ createElement22(RenderHookComponent, {
|
|
5261
5569
|
render: column.renderValue,
|
|
5262
5570
|
renderParam: renderOptions
|
|
5263
5571
|
});
|
|
@@ -5287,22 +5595,22 @@ function getGroupColumnRender({
|
|
|
5287
5595
|
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);
|
|
5288
5596
|
const isLoading = showLoadingIcon(groupRowInfo);
|
|
5289
5597
|
if (isLoading) {
|
|
5290
|
-
icon = /* @__PURE__ */
|
|
5598
|
+
icon = /* @__PURE__ */ createElement22(LoadingIcon, null);
|
|
5291
5599
|
} else if (showExpanderIcon) {
|
|
5292
|
-
const defaultIcon = /* @__PURE__ */
|
|
5600
|
+
const defaultIcon = /* @__PURE__ */ createElement22(ExpanderIcon, {
|
|
5293
5601
|
expanded: !collapsed,
|
|
5294
5602
|
onChange: () => {
|
|
5295
5603
|
toggleGroupRow(groupKeys);
|
|
5296
5604
|
}
|
|
5297
5605
|
});
|
|
5298
|
-
icon = column.renderGroupIcon ? /* @__PURE__ */
|
|
5606
|
+
icon = column.renderGroupIcon ? /* @__PURE__ */ createElement22(RenderHookComponent, {
|
|
5299
5607
|
render: column.renderGroupIcon,
|
|
5300
5608
|
renderParam: Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)
|
|
5301
5609
|
}) : defaultIcon;
|
|
5302
5610
|
}
|
|
5303
|
-
return /* @__PURE__ */
|
|
5611
|
+
return /* @__PURE__ */ createElement22("div", {
|
|
5304
5612
|
className: join(display.flex, alignItems.center)
|
|
5305
|
-
}, icon, /* @__PURE__ */
|
|
5613
|
+
}, icon, /* @__PURE__ */ createElement22("div", {
|
|
5306
5614
|
className: cssEllipsisClassName
|
|
5307
5615
|
}, value != null ? value : null));
|
|
5308
5616
|
};
|
|
@@ -5347,9 +5655,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
5347
5655
|
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;
|
|
5348
5656
|
const isLoading = showLoadingIcon(rowInfo);
|
|
5349
5657
|
if (isLoading) {
|
|
5350
|
-
icon = /* @__PURE__ */
|
|
5658
|
+
icon = /* @__PURE__ */ createElement22(LoadingIcon, null);
|
|
5351
5659
|
} else if (showExpanderIcon) {
|
|
5352
|
-
const defaultIcon = /* @__PURE__ */
|
|
5660
|
+
const defaultIcon = /* @__PURE__ */ createElement22(ExpanderIcon, {
|
|
5353
5661
|
expanded: !collapsed,
|
|
5354
5662
|
onChange: () => {
|
|
5355
5663
|
if (!rowInfo.isGroupRow) {
|
|
@@ -5364,9 +5672,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
5364
5672
|
icon = column.renderGroupIcon(renderParam);
|
|
5365
5673
|
}
|
|
5366
5674
|
}
|
|
5367
|
-
return /* @__PURE__ */
|
|
5675
|
+
return /* @__PURE__ */ createElement22("div", {
|
|
5368
5676
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
5369
|
-
}, icon, /* @__PURE__ */
|
|
5677
|
+
}, icon, /* @__PURE__ */ createElement22("div", {
|
|
5370
5678
|
className: cssEllipsisClassName
|
|
5371
5679
|
}, value != null ? value : null));
|
|
5372
5680
|
}
|
|
@@ -5382,11 +5690,11 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
5382
5690
|
}
|
|
5383
5691
|
|
|
5384
5692
|
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
5385
|
-
import { useEffect as
|
|
5693
|
+
import { useEffect as useEffect17, useRef as useRef15 } from "react";
|
|
5386
5694
|
function useEffectWithRaf(fn, deps) {
|
|
5387
5695
|
const rafId = useRef15(0);
|
|
5388
5696
|
const removeFnRaf = useRef15();
|
|
5389
|
-
|
|
5697
|
+
useEffect17(() => {
|
|
5390
5698
|
rafId.current = requestAnimationFrame(() => {
|
|
5391
5699
|
removeFnRaf.current = fn();
|
|
5392
5700
|
});
|
|
@@ -5471,21 +5779,18 @@ function lazyGroup(groupParams, rootData) {
|
|
|
5471
5779
|
rootData.visitDepthFirst((lazyGroupRowInfo, keys, _index, next) => {
|
|
5472
5780
|
const [_rootKey, ...currentGroupKeys] = keys;
|
|
5473
5781
|
const dataArray = lazyGroupRowInfo.children;
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5782
|
+
const current = deepMap.get(currentGroupKeys);
|
|
5783
|
+
if (current) {
|
|
5784
|
+
current.cache = lazyGroupRowInfo.cache;
|
|
5785
|
+
current.childrenLoading = lazyGroupRowInfo.childrenLoading;
|
|
5786
|
+
current.childrenAvailable = lazyGroupRowInfo.childrenAvailable;
|
|
5787
|
+
current.error = lazyGroupRowInfo.error;
|
|
5480
5788
|
}
|
|
5481
|
-
if (
|
|
5482
|
-
const current = deepMap.get(currentGroupKeys);
|
|
5789
|
+
if (currentGroupKeys.length == groupBy.length && groupBy.length) {
|
|
5483
5790
|
if (current) {
|
|
5484
|
-
current.
|
|
5485
|
-
current.childrenLoading = lazyGroupRowInfo.childrenLoading;
|
|
5486
|
-
current.childrenAvailable = lazyGroupRowInfo.childrenAvailable;
|
|
5487
|
-
current.error = lazyGroupRowInfo.error;
|
|
5791
|
+
current.items = dataArray;
|
|
5488
5792
|
}
|
|
5793
|
+
return next == null ? void 0 : next();
|
|
5489
5794
|
}
|
|
5490
5795
|
for (let i = 0, len = dataArray.length; i < len; i++) {
|
|
5491
5796
|
if (!dataArray[i]) {
|
|
@@ -5504,10 +5809,8 @@ function lazyGroup(groupParams, rootData) {
|
|
|
5504
5809
|
}
|
|
5505
5810
|
const dataObject = dataArray[i].data;
|
|
5506
5811
|
const dataKeys = dataArray[i].keys;
|
|
5507
|
-
const item = dataObject;
|
|
5508
5812
|
if (dataKeys.length) {
|
|
5509
|
-
const
|
|
5510
|
-
const key = item[groupByProperty];
|
|
5813
|
+
const key = dataKeys[dataKeys.length - 1];
|
|
5511
5814
|
currentGroupKeys.push(key);
|
|
5512
5815
|
}
|
|
5513
5816
|
const deepMapGroupValue = {
|
|
@@ -5670,6 +5973,7 @@ function flatten(groupResult) {
|
|
|
5670
5973
|
return result;
|
|
5671
5974
|
}
|
|
5672
5975
|
function getEnhancedGroupData(options, deepMapValue) {
|
|
5976
|
+
var _a;
|
|
5673
5977
|
const { groupBy, groupKeys, collapsed, parents, reducers, lazyLoad } = options;
|
|
5674
5978
|
const groupNesting = groupKeys.length;
|
|
5675
5979
|
const {
|
|
@@ -5678,9 +5982,9 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
5678
5982
|
pivotDeepMap,
|
|
5679
5983
|
commonData
|
|
5680
5984
|
} = deepMapValue;
|
|
5681
|
-
let data = null;
|
|
5985
|
+
let data = commonData != null ? commonData : null;
|
|
5682
5986
|
if (Object.keys(reducerResults).length > 0) {
|
|
5683
|
-
data =
|
|
5987
|
+
data = __spreadValues({}, commonData);
|
|
5684
5988
|
for (const key in reducers)
|
|
5685
5989
|
if (reducers.hasOwnProperty(key)) {
|
|
5686
5990
|
const reducer = reducers[key];
|
|
@@ -5691,7 +5995,7 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
5691
5995
|
}
|
|
5692
5996
|
}
|
|
5693
5997
|
let selfLoaded = true;
|
|
5694
|
-
let theValue = groupKeys[groupKeys.length - 1];
|
|
5998
|
+
let theValue = (_a = data != null ? data[groupBy[groupKeys.length - 1]] : null) != null ? _a : groupKeys[groupKeys.length - 1];
|
|
5695
5999
|
if (typeof theValue === "string" && theValue.startsWith(NOT_LOADED_YET_KEY_PREFIX)) {
|
|
5696
6000
|
selfLoaded = false;
|
|
5697
6001
|
theValue = null;
|
|
@@ -5705,6 +6009,7 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
5705
6009
|
collapsed,
|
|
5706
6010
|
dataSourceHasGrouping: true,
|
|
5707
6011
|
selfLoaded,
|
|
6012
|
+
error: options.error,
|
|
5708
6013
|
parents,
|
|
5709
6014
|
deepRowInfoArray: [],
|
|
5710
6015
|
collapsedChildrenCount: 0,
|
|
@@ -5768,6 +6073,7 @@ function enhancedFlatten(param) {
|
|
|
5768
6073
|
indexInParentGroups: Array.from(indexInParentGroups),
|
|
5769
6074
|
indexInAll: result.length,
|
|
5770
6075
|
groupKeys,
|
|
6076
|
+
error: deepMapValue.error,
|
|
5771
6077
|
childrenLoading: deepMapValue.childrenLoading,
|
|
5772
6078
|
childrenAvailable: deepMapValue.childrenAvailable,
|
|
5773
6079
|
directChildrenCount: groupKeys.length === groupByStrings.length ? deepMapValue.items.length : deepMap.getDirectChildrenSizeFor(groupKeys),
|
|
@@ -5813,8 +6119,9 @@ function enhancedFlatten(param) {
|
|
|
5813
6119
|
}
|
|
5814
6120
|
for (let index = 0, len = items.length; index < len; index++) {
|
|
5815
6121
|
const item = items[index];
|
|
6122
|
+
const indexInAll = startIndex + index;
|
|
5816
6123
|
const rowInfo = {
|
|
5817
|
-
id: item ? toPrimaryKey(item) : `${groupKeys}-${index}`,
|
|
6124
|
+
id: item ? toPrimaryKey(item, indexInAll) : `${groupKeys}-${index}`,
|
|
5818
6125
|
data: item,
|
|
5819
6126
|
dataSourceHasGrouping: true,
|
|
5820
6127
|
isGroupRow: false,
|
|
@@ -5825,7 +6132,7 @@ function enhancedFlatten(param) {
|
|
|
5825
6132
|
parents: Array.from(parents),
|
|
5826
6133
|
indexInParentGroups: [...indexInParentGroups, index],
|
|
5827
6134
|
indexInGroup: index,
|
|
5828
|
-
indexInAll
|
|
6135
|
+
indexInAll,
|
|
5829
6136
|
groupBy: groupByStrings,
|
|
5830
6137
|
groupNesting,
|
|
5831
6138
|
groupCount: enhancedGroupData.groupCount
|
|
@@ -5858,8 +6165,8 @@ function enhancedFlatten(param) {
|
|
|
5858
6165
|
|
|
5859
6166
|
// src/components/DataSource/index.tsx
|
|
5860
6167
|
import {
|
|
5861
|
-
Fragment as
|
|
5862
|
-
createElement as
|
|
6168
|
+
Fragment as Fragment3,
|
|
6169
|
+
createElement as createElement23
|
|
5863
6170
|
} from "react";
|
|
5864
6171
|
|
|
5865
6172
|
// src/utils/multisort/sortTypes.ts
|
|
@@ -5871,11 +6178,11 @@ var stringComparator = function(first, second) {
|
|
|
5871
6178
|
second = `${second}`;
|
|
5872
6179
|
return first.localeCompare(second);
|
|
5873
6180
|
};
|
|
5874
|
-
var
|
|
6181
|
+
var defaultSortTypes = {
|
|
5875
6182
|
number: numberComparator,
|
|
5876
6183
|
string: stringComparator
|
|
5877
6184
|
};
|
|
5878
|
-
var sortTypes_default =
|
|
6185
|
+
var sortTypes_default = defaultSortTypes;
|
|
5879
6186
|
|
|
5880
6187
|
// src/utils/multisort/index.ts
|
|
5881
6188
|
var multisort = (sortInfo, array, get) => {
|
|
@@ -5888,7 +6195,8 @@ var getSingleSortFunction = (info) => {
|
|
|
5888
6195
|
return;
|
|
5889
6196
|
}
|
|
5890
6197
|
const field = info.field;
|
|
5891
|
-
|
|
6198
|
+
const valueGetter = info.valueGetter;
|
|
6199
|
+
const dir = info.dir < 0 ? -1 : info.dir > 0 ? 1 : 0;
|
|
5892
6200
|
if (!dir) {
|
|
5893
6201
|
return;
|
|
5894
6202
|
}
|
|
@@ -5903,8 +6211,8 @@ var getSingleSortFunction = (info) => {
|
|
|
5903
6211
|
fn = sortTypes_default.string;
|
|
5904
6212
|
}
|
|
5905
6213
|
return (first, second) => {
|
|
5906
|
-
const a = field ? first[field] : first;
|
|
5907
|
-
const b = field ? second[field] : second;
|
|
6214
|
+
const a = valueGetter ? valueGetter(first) : field ? first[field] : first;
|
|
6215
|
+
const b = valueGetter ? valueGetter(second) : field ? second[field] : second;
|
|
5908
6216
|
return dir * fn(a, b);
|
|
5909
6217
|
};
|
|
5910
6218
|
};
|
|
@@ -5936,11 +6244,121 @@ var getMultisortFunction = (sortInfo, get) => {
|
|
|
5936
6244
|
};
|
|
5937
6245
|
};
|
|
5938
6246
|
|
|
6247
|
+
// src/components/DataSource/GroupRowsState.ts
|
|
6248
|
+
var GroupRowsState = class {
|
|
6249
|
+
constructor(state) {
|
|
6250
|
+
this.update(state instanceof GroupRowsState ? state.getState() : state);
|
|
6251
|
+
}
|
|
6252
|
+
getState() {
|
|
6253
|
+
var _a, _b, _c, _d;
|
|
6254
|
+
return {
|
|
6255
|
+
expandedRows: this.expandedAll ? true : (_b = (_a = this.expandedMap) == null ? void 0 : _a.topDownKeys()) != null ? _b : [],
|
|
6256
|
+
collapsedRows: this.collapsedAll ? true : (_d = (_c = this.collapsedMap) == null ? void 0 : _c.topDownKeys()) != null ? _d : []
|
|
6257
|
+
};
|
|
6258
|
+
}
|
|
6259
|
+
destroy() {
|
|
6260
|
+
var _a, _b;
|
|
6261
|
+
(_a = this.expandedMap) == null ? void 0 : _a.clear();
|
|
6262
|
+
(_b = this.collapsedMap) == null ? void 0 : _b.clear();
|
|
6263
|
+
delete this.expandedMap;
|
|
6264
|
+
delete this.collapsedMap;
|
|
6265
|
+
}
|
|
6266
|
+
update(state) {
|
|
6267
|
+
var _a, _b, _c, _d;
|
|
6268
|
+
this.initialState = state;
|
|
6269
|
+
const { collapsedRows, expandedRows } = this.initialState;
|
|
6270
|
+
this.collapsedAll = collapsedRows === true;
|
|
6271
|
+
this.expandedAll = expandedRows === true;
|
|
6272
|
+
if (this.collapsedAll && this.expandedAll) {
|
|
6273
|
+
throw `Cannot have both collapsedRows and expandedRows be true!`;
|
|
6274
|
+
}
|
|
6275
|
+
if (collapsedRows !== true) {
|
|
6276
|
+
(_a = this.collapsedMap) == null ? void 0 : _a.clear();
|
|
6277
|
+
this.collapsedMap = (_b = this.collapsedMap) != null ? _b : new DeepMap(collapsedRows.map((keys) => [keys, true]));
|
|
6278
|
+
}
|
|
6279
|
+
if (expandedRows !== true) {
|
|
6280
|
+
(_c = this.expandedMap) == null ? void 0 : _c.clear();
|
|
6281
|
+
this.expandedMap = (_d = this.expandedMap) != null ? _d : new DeepMap(expandedRows.map((keys) => [keys, true]));
|
|
6282
|
+
}
|
|
6283
|
+
}
|
|
6284
|
+
areAllCollapsed() {
|
|
6285
|
+
return this.collapsedAll && (this.expandedMap ? this.expandedMap.size === 0 : true);
|
|
6286
|
+
}
|
|
6287
|
+
areAllExpanded() {
|
|
6288
|
+
return this.expandedAll && (this.collapsedMap ? this.collapsedMap.size === 0 : true);
|
|
6289
|
+
}
|
|
6290
|
+
collapseAll() {
|
|
6291
|
+
this.update({
|
|
6292
|
+
collapsedRows: true,
|
|
6293
|
+
expandedRows: []
|
|
6294
|
+
});
|
|
6295
|
+
}
|
|
6296
|
+
expandAll() {
|
|
6297
|
+
this.update({
|
|
6298
|
+
expandedRows: true,
|
|
6299
|
+
collapsedRows: []
|
|
6300
|
+
});
|
|
6301
|
+
}
|
|
6302
|
+
isGroupRowExpanded(keys) {
|
|
6303
|
+
var _a, _b;
|
|
6304
|
+
if (this.expandedAll === true) {
|
|
6305
|
+
if (this.collapsedAll === true) {
|
|
6306
|
+
throw 'Cannot have both expandedRows and collapsedRows be "true"';
|
|
6307
|
+
}
|
|
6308
|
+
return !((_a = this.collapsedMap) == null ? void 0 : _a.has(keys));
|
|
6309
|
+
}
|
|
6310
|
+
return (_b = this.expandedMap) == null ? void 0 : _b.has(keys);
|
|
6311
|
+
}
|
|
6312
|
+
isGroupRowCollapsed(keys) {
|
|
6313
|
+
return !this.isGroupRowExpanded(keys);
|
|
6314
|
+
}
|
|
6315
|
+
setGroupRowExpanded(keys, shouldExpand) {
|
|
6316
|
+
var _a;
|
|
6317
|
+
if (shouldExpand === this.isGroupRowExpanded(keys)) {
|
|
6318
|
+
return;
|
|
6319
|
+
}
|
|
6320
|
+
if (shouldExpand) {
|
|
6321
|
+
if (this.collapsedAll === true) {
|
|
6322
|
+
if (!this.expandedMap) {
|
|
6323
|
+
throw `No expandedMap found when trying to expand group row ${keys.join(",")}`;
|
|
6324
|
+
}
|
|
6325
|
+
this.expandedMap.set(keys, true);
|
|
6326
|
+
} else if (this.expandedAll === true) {
|
|
6327
|
+
if (!this.collapsedMap) {
|
|
6328
|
+
throw `No collapsedMap found when trying to expand group row ${keys.join(",")}`;
|
|
6329
|
+
}
|
|
6330
|
+
this.collapsedMap.delete(keys);
|
|
6331
|
+
}
|
|
6332
|
+
} else {
|
|
6333
|
+
if (this.expandedAll === true) {
|
|
6334
|
+
if (!this.collapsedMap) {
|
|
6335
|
+
throw `No collapsedMap found when trying to collapse group row ${keys.join(",")}`;
|
|
6336
|
+
}
|
|
6337
|
+
this.collapsedMap.set(keys, true);
|
|
6338
|
+
} else if (this.collapsedAll === true) {
|
|
6339
|
+
if (!this.expandedMap) {
|
|
6340
|
+
throw `No expandedMap found when trying to collapse group row ${keys.join(",")}`;
|
|
6341
|
+
}
|
|
6342
|
+
(_a = this.expandedMap) == null ? void 0 : _a.delete(keys);
|
|
6343
|
+
}
|
|
6344
|
+
}
|
|
6345
|
+
}
|
|
6346
|
+
collapseGroupRow(keys) {
|
|
6347
|
+
this.setGroupRowExpanded(keys, false);
|
|
6348
|
+
}
|
|
6349
|
+
expandGroupRow(keys) {
|
|
6350
|
+
this.setGroupRowExpanded(keys, true);
|
|
6351
|
+
}
|
|
6352
|
+
toggleGroupRow(keys) {
|
|
6353
|
+
this.setGroupRowExpanded(keys, !this.isGroupRowExpanded(keys));
|
|
6354
|
+
}
|
|
6355
|
+
};
|
|
6356
|
+
|
|
5939
6357
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
5940
|
-
import { useEffect as
|
|
6358
|
+
import { useEffect as useEffect19, useMemo as useMemo8, useRef as useRef17, useState as useState10 } from "react";
|
|
5941
6359
|
|
|
5942
6360
|
// src/components/hooks/useEffectWithChanges.ts
|
|
5943
|
-
import { useEffect as
|
|
6361
|
+
import { useEffect as useEffect18, useRef as useRef16 } from "react";
|
|
5944
6362
|
function useEffectWithChanges(fn, deps) {
|
|
5945
6363
|
const prevRef = useRef16({});
|
|
5946
6364
|
const oldValuesRef = useRef16({});
|
|
@@ -5958,7 +6376,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
5958
6376
|
}
|
|
5959
6377
|
}
|
|
5960
6378
|
prevRef.current = deps;
|
|
5961
|
-
|
|
6379
|
+
useEffect18(() => {
|
|
5962
6380
|
const changes2 = changesRef.current;
|
|
5963
6381
|
const result = fn(changes2, oldValues);
|
|
5964
6382
|
changesRef.current = {};
|
|
@@ -5967,6 +6385,25 @@ function useEffectWithChanges(fn, deps) {
|
|
|
5967
6385
|
}, useEffectDeps);
|
|
5968
6386
|
}
|
|
5969
6387
|
|
|
6388
|
+
// src/components/InfiniteTable/utils/assignFiltered.ts
|
|
6389
|
+
function assignFiltered(filterFn, target, ...rest) {
|
|
6390
|
+
const result = target;
|
|
6391
|
+
rest.forEach((obj) => {
|
|
6392
|
+
for (const key in obj) {
|
|
6393
|
+
if (obj.hasOwnProperty(key) && filterFn(obj[key], key)) {
|
|
6394
|
+
result[key] = obj[key];
|
|
6395
|
+
}
|
|
6396
|
+
}
|
|
6397
|
+
});
|
|
6398
|
+
return result;
|
|
6399
|
+
}
|
|
6400
|
+
function assignNonNull(target, ...rest) {
|
|
6401
|
+
return assignFiltered((value) => value != null, target, ...rest);
|
|
6402
|
+
}
|
|
6403
|
+
function assignExcept(exceptKeys, target, ...rest) {
|
|
6404
|
+
return assignFiltered((_value, key) => !(key in exceptKeys), target, ...rest);
|
|
6405
|
+
}
|
|
6406
|
+
|
|
5970
6407
|
// src/components/DataSource/privateHooks/getChangeDetect.ts
|
|
5971
6408
|
function getChangeDetect() {
|
|
5972
6409
|
var _a;
|
|
@@ -5992,6 +6429,7 @@ function buildDataSourceDataParams(componentState, overrides) {
|
|
|
5992
6429
|
sortInfo,
|
|
5993
6430
|
groupBy: componentState.groupBy,
|
|
5994
6431
|
pivotBy: componentState.pivotBy,
|
|
6432
|
+
filterValue: componentState.filterValue,
|
|
5995
6433
|
aggregationReducers: componentState.aggregationReducers
|
|
5996
6434
|
};
|
|
5997
6435
|
if (dataSourceParams.groupBy) {
|
|
@@ -6011,6 +6449,13 @@ function buildDataSourceDataParams(componentState, overrides) {
|
|
|
6011
6449
|
if (overrides) {
|
|
6012
6450
|
Object.assign(dataSourceParams, overrides);
|
|
6013
6451
|
}
|
|
6452
|
+
if (dataSourceParams.filterValue && dataSourceParams.filterValue.length) {
|
|
6453
|
+
dataSourceParams.filterValue = dataSourceParams.filterValue.map((f) => {
|
|
6454
|
+
const value = __spreadValues({}, f);
|
|
6455
|
+
delete value.valueGetter;
|
|
6456
|
+
return value;
|
|
6457
|
+
});
|
|
6458
|
+
}
|
|
6014
6459
|
const changes = {};
|
|
6015
6460
|
const oldDataSourceParams = componentState.dataParams || {};
|
|
6016
6461
|
for (const k in dataSourceParams) {
|
|
@@ -6031,6 +6476,13 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
6031
6476
|
const lazyGroupData = componentState.originalLazyGroupData;
|
|
6032
6477
|
const key = [LAZY_ROOT_KEY_FOR_GROUPS, ...dataParams.groupKeys || []];
|
|
6033
6478
|
const existingGroupRowInfo = lazyGroupData.get(key);
|
|
6479
|
+
if (!existingGroupRowInfo) {
|
|
6480
|
+
const groupCacheKeys = [
|
|
6481
|
+
...dataParams.groupKeys || [],
|
|
6482
|
+
dataParams.lazyLoadStartIndex
|
|
6483
|
+
];
|
|
6484
|
+
componentState.lazyLoadCacheOfLoadedBatches.set(groupCacheKeys, true);
|
|
6485
|
+
}
|
|
6034
6486
|
if (existingGroupRowInfo && existingGroupRowInfo.cache && key.length > 1) {
|
|
6035
6487
|
const items = existingGroupRowInfo.children;
|
|
6036
6488
|
const len = items.length;
|
|
@@ -6056,7 +6508,8 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
6056
6508
|
childrenLoading: true,
|
|
6057
6509
|
childrenAvailable: false,
|
|
6058
6510
|
cache: CACHE_DEFAULT,
|
|
6059
|
-
totalCount: 0
|
|
6511
|
+
totalCount: 0,
|
|
6512
|
+
totalCountUnfiltered: 0
|
|
6060
6513
|
});
|
|
6061
6514
|
}
|
|
6062
6515
|
actions.originalLazyGroupDataChangeDetect = getChangeDetect();
|
|
@@ -6080,6 +6533,9 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
6080
6533
|
if (remoteData.mappings) {
|
|
6081
6534
|
actions.pivotMappings = remoteData.mappings;
|
|
6082
6535
|
}
|
|
6536
|
+
if (remoteData.totalCountUnfiltered) {
|
|
6537
|
+
actions.unfilteredCount = remoteData.totalCountUnfiltered;
|
|
6538
|
+
}
|
|
6083
6539
|
if (componentState.lazyLoad) {
|
|
6084
6540
|
let resolveRemoteData = function(keys, remoteData2, parentKeys) {
|
|
6085
6541
|
var _a, _b, _c, _d;
|
|
@@ -6090,24 +6546,19 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
6090
6546
|
childrenLoading: false,
|
|
6091
6547
|
childrenAvailable: true,
|
|
6092
6548
|
totalCount: (_a = remoteData2.totalCount) != null ? _a : dataArray2.length,
|
|
6093
|
-
|
|
6549
|
+
totalCountUnfiltered: (_b = remoteData2.totalCount) != null ? _b : dataArray2.length,
|
|
6550
|
+
children: dataArray2,
|
|
6551
|
+
error: remoteData2.error
|
|
6094
6552
|
};
|
|
6095
6553
|
const childDatasets = [];
|
|
6096
6554
|
if (dataParams.lazyLoadBatchSize && !parentKeys) {
|
|
6097
6555
|
const existingGroupRowInfo = lazyGroupData.get(theKey);
|
|
6098
|
-
const
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
};
|
|
6105
|
-
if (existingGroupRowInfo) {
|
|
6106
|
-
existingGroupRowInfo.cache = newGroupRowInfo.cache;
|
|
6107
|
-
existingGroupRowInfo.totalCount = newGroupRowInfo.totalCount;
|
|
6108
|
-
existingGroupRowInfo.childrenLoading = false;
|
|
6109
|
-
existingGroupRowInfo.childrenAvailable = true;
|
|
6110
|
-
existingGroupRowInfo.error = newGroupRowInfo.error;
|
|
6556
|
+
const isGroupNew = !existingGroupRowInfo;
|
|
6557
|
+
const currentGroupRowInfo = assignExcept({
|
|
6558
|
+
children: true
|
|
6559
|
+
}, existingGroupRowInfo || {}, newGroupRowInfo);
|
|
6560
|
+
if (isGroupNew) {
|
|
6561
|
+
currentGroupRowInfo.chidren = [];
|
|
6111
6562
|
}
|
|
6112
6563
|
currentGroupRowInfo.children.length = currentGroupRowInfo.totalCount;
|
|
6113
6564
|
const start = (_c = dataParams.lazyLoadStartIndex) != null ? _c : 0;
|
|
@@ -6125,13 +6576,13 @@ function loadData(data, componentState, actions, overrides) {
|
|
|
6125
6576
|
});
|
|
6126
6577
|
}
|
|
6127
6578
|
}
|
|
6128
|
-
if (
|
|
6579
|
+
if (isGroupNew) {
|
|
6129
6580
|
lazyGroupData.set(theKey, currentGroupRowInfo);
|
|
6130
6581
|
}
|
|
6131
6582
|
} else {
|
|
6132
6583
|
if (parentKeys) {
|
|
6133
6584
|
newGroupRowInfo.children.forEach((child) => {
|
|
6134
|
-
if (child.dataset) {
|
|
6585
|
+
if (child && child.dataset) {
|
|
6135
6586
|
childDatasets.push({
|
|
6136
6587
|
keys: child.keys,
|
|
6137
6588
|
dataset: child.dataset
|
|
@@ -6188,16 +6639,17 @@ function useLoadData() {
|
|
|
6188
6639
|
sortInfo,
|
|
6189
6640
|
groupBy,
|
|
6190
6641
|
pivotBy,
|
|
6642
|
+
filterValue,
|
|
6191
6643
|
livePagination,
|
|
6192
6644
|
livePaginationCursor,
|
|
6193
6645
|
cursorId: stateCursorId
|
|
6194
6646
|
} = componentState;
|
|
6195
|
-
const [scrollbars, setScrollbars] =
|
|
6647
|
+
const [scrollbars, setScrollbars] = useState10({
|
|
6196
6648
|
vertical: false,
|
|
6197
6649
|
horizontal: false
|
|
6198
6650
|
});
|
|
6199
6651
|
const scrollbarsRef = useRef17(scrollbars);
|
|
6200
|
-
|
|
6652
|
+
useEffect19(() => {
|
|
6201
6653
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
6202
6654
|
if (!scrollbars2) {
|
|
6203
6655
|
return;
|
|
@@ -6207,7 +6659,7 @@ function useLoadData() {
|
|
|
6207
6659
|
});
|
|
6208
6660
|
return () => notifyScrollbarsChange.destroy();
|
|
6209
6661
|
}, [notifyScrollbarsChange]);
|
|
6210
|
-
|
|
6662
|
+
useEffect19(() => {
|
|
6211
6663
|
if (!livePagination) {
|
|
6212
6664
|
return;
|
|
6213
6665
|
}
|
|
@@ -6221,7 +6673,7 @@ function useLoadData() {
|
|
|
6221
6673
|
});
|
|
6222
6674
|
return () => cancelAnimationFrame(frameId);
|
|
6223
6675
|
}, [livePaginationCursor]);
|
|
6224
|
-
|
|
6676
|
+
useEffect19(() => {
|
|
6225
6677
|
if (!livePagination || livePaginationCursor !== void 0) {
|
|
6226
6678
|
return;
|
|
6227
6679
|
}
|
|
@@ -6235,7 +6687,7 @@ function useLoadData() {
|
|
|
6235
6687
|
});
|
|
6236
6688
|
return () => cancelAnimationFrame(frameId);
|
|
6237
6689
|
}, [dataArray.length, livePaginationCursor]);
|
|
6238
|
-
|
|
6690
|
+
useEffect19(() => {
|
|
6239
6691
|
const state = getComponentState();
|
|
6240
6692
|
const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
|
|
6241
6693
|
if (!scrollbars.vertical && livePagination2) {
|
|
@@ -6250,6 +6702,7 @@ function useLoadData() {
|
|
|
6250
6702
|
sortInfo,
|
|
6251
6703
|
groupBy,
|
|
6252
6704
|
pivotBy,
|
|
6705
|
+
filterValue,
|
|
6253
6706
|
cursorId: livePagination ? stateCursorId : null
|
|
6254
6707
|
};
|
|
6255
6708
|
const initialRef = useRef17(true);
|
|
@@ -6284,7 +6737,7 @@ function useLazyLoadRange() {
|
|
|
6284
6737
|
componentActions: actions,
|
|
6285
6738
|
componentState
|
|
6286
6739
|
} = useComponentState();
|
|
6287
|
-
|
|
6740
|
+
useEffect19(() => {
|
|
6288
6741
|
actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
|
|
6289
6742
|
}, [componentState.data, componentState.dataParams]);
|
|
6290
6743
|
const {
|
|
@@ -6312,8 +6765,8 @@ function useLazyLoadRange() {
|
|
|
6312
6765
|
componentActions: actions
|
|
6313
6766
|
}, cache);
|
|
6314
6767
|
};
|
|
6315
|
-
const debouncedLoadRange =
|
|
6316
|
-
|
|
6768
|
+
const debouncedLoadRange = useMemo8(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
6769
|
+
useEffect19(() => {
|
|
6317
6770
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
6318
6771
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
6319
6772
|
latestRenderRangeRef.current = renderRange;
|
|
@@ -6322,7 +6775,7 @@ function useLazyLoadRange() {
|
|
|
6322
6775
|
}
|
|
6323
6776
|
return;
|
|
6324
6777
|
}, [lazyLoadBatchSize]);
|
|
6325
|
-
|
|
6778
|
+
useEffect19(() => {
|
|
6326
6779
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
6327
6780
|
debouncedLoadRange();
|
|
6328
6781
|
}
|
|
@@ -6355,7 +6808,7 @@ function lazyLoadRange(options, cache) {
|
|
|
6355
6808
|
theGroupKeys.pop();
|
|
6356
6809
|
}
|
|
6357
6810
|
const cacheKeys = theGroupKeys.length ? theGroupKeys : rootGroupKeys;
|
|
6358
|
-
const indexInGroup = rowInfo.indexInGroup;
|
|
6811
|
+
const indexInGroup = rowInfo.dataSourceHasGrouping ? rowInfo.indexInGroup : rowInfo.indexInAll;
|
|
6359
6812
|
if (rowInfo.isGroupRow && !rowInfo.collapsed && !rowInfo.childrenAvailable) {
|
|
6360
6813
|
const currentFnCall = {
|
|
6361
6814
|
lazyLoadStartIndex: 0,
|
|
@@ -6378,7 +6831,7 @@ function lazyLoadRange(options, cache) {
|
|
|
6378
6831
|
if (!rowLoaded) {
|
|
6379
6832
|
let cachedFnCalls = perGroupFnCalls.get(cacheKeys);
|
|
6380
6833
|
const batchStartIndexInGroup = Math.floor(indexInGroup / lazyLoadBatchSize) * lazyLoadBatchSize;
|
|
6381
|
-
const offset =
|
|
6834
|
+
const offset = indexInGroup - batchStartIndexInGroup;
|
|
6382
6835
|
const absoluteIndexOfBatchStart = dataArray[rowInfo.indexInAll - offset].indexInAll;
|
|
6383
6836
|
const batchStartRowLoaded = isRowLoaded(absoluteIndexOfBatchStart);
|
|
6384
6837
|
const batchStartRowId = dataArray[absoluteIndexOfBatchStart].id;
|
|
@@ -6476,116 +6929,6 @@ function discardCallsWithEqualArg(fn, timeframe = 50, getCompareObject) {
|
|
|
6476
6929
|
};
|
|
6477
6930
|
}
|
|
6478
6931
|
|
|
6479
|
-
// src/components/DataSource/GroupRowsState.ts
|
|
6480
|
-
var GroupRowsState = class {
|
|
6481
|
-
constructor(state) {
|
|
6482
|
-
this.update(state instanceof GroupRowsState ? state.getState() : state);
|
|
6483
|
-
}
|
|
6484
|
-
getState() {
|
|
6485
|
-
var _a, _b, _c, _d;
|
|
6486
|
-
return {
|
|
6487
|
-
expandedRows: this.expandedAll ? true : (_b = (_a = this.expandedMap) == null ? void 0 : _a.topDownKeys()) != null ? _b : [],
|
|
6488
|
-
collapsedRows: this.collapsedAll ? true : (_d = (_c = this.collapsedMap) == null ? void 0 : _c.topDownKeys()) != null ? _d : []
|
|
6489
|
-
};
|
|
6490
|
-
}
|
|
6491
|
-
destroy() {
|
|
6492
|
-
var _a, _b;
|
|
6493
|
-
(_a = this.expandedMap) == null ? void 0 : _a.clear();
|
|
6494
|
-
(_b = this.collapsedMap) == null ? void 0 : _b.clear();
|
|
6495
|
-
delete this.expandedMap;
|
|
6496
|
-
delete this.collapsedMap;
|
|
6497
|
-
}
|
|
6498
|
-
update(state) {
|
|
6499
|
-
var _a, _b, _c, _d;
|
|
6500
|
-
this.initialState = state;
|
|
6501
|
-
const { collapsedRows, expandedRows } = this.initialState;
|
|
6502
|
-
this.collapsedAll = collapsedRows === true;
|
|
6503
|
-
this.expandedAll = expandedRows === true;
|
|
6504
|
-
if (this.collapsedAll && this.expandedAll) {
|
|
6505
|
-
throw `Cannot have both collapsedRows and expandedRows be true!`;
|
|
6506
|
-
}
|
|
6507
|
-
if (collapsedRows !== true) {
|
|
6508
|
-
(_a = this.collapsedMap) == null ? void 0 : _a.clear();
|
|
6509
|
-
this.collapsedMap = (_b = this.collapsedMap) != null ? _b : new DeepMap(collapsedRows.map((keys) => [keys, true]));
|
|
6510
|
-
}
|
|
6511
|
-
if (expandedRows !== true) {
|
|
6512
|
-
(_c = this.expandedMap) == null ? void 0 : _c.clear();
|
|
6513
|
-
this.expandedMap = (_d = this.expandedMap) != null ? _d : new DeepMap(expandedRows.map((keys) => [keys, true]));
|
|
6514
|
-
}
|
|
6515
|
-
}
|
|
6516
|
-
areAllCollapsed() {
|
|
6517
|
-
return this.collapsedAll && (this.expandedMap ? this.expandedMap.size === 0 : true);
|
|
6518
|
-
}
|
|
6519
|
-
areAllExpanded() {
|
|
6520
|
-
return this.expandedAll && (this.collapsedMap ? this.collapsedMap.size === 0 : true);
|
|
6521
|
-
}
|
|
6522
|
-
collapseAll() {
|
|
6523
|
-
this.update({
|
|
6524
|
-
collapsedRows: true,
|
|
6525
|
-
expandedRows: []
|
|
6526
|
-
});
|
|
6527
|
-
}
|
|
6528
|
-
expandAll() {
|
|
6529
|
-
this.update({
|
|
6530
|
-
expandedRows: true,
|
|
6531
|
-
collapsedRows: []
|
|
6532
|
-
});
|
|
6533
|
-
}
|
|
6534
|
-
isGroupRowExpanded(keys) {
|
|
6535
|
-
var _a, _b;
|
|
6536
|
-
if (this.expandedAll === true) {
|
|
6537
|
-
if (this.collapsedAll === true) {
|
|
6538
|
-
throw 'Cannot have both expandedRows and collapsedRows be "true"';
|
|
6539
|
-
}
|
|
6540
|
-
return !((_a = this.collapsedMap) == null ? void 0 : _a.has(keys));
|
|
6541
|
-
}
|
|
6542
|
-
return (_b = this.expandedMap) == null ? void 0 : _b.has(keys);
|
|
6543
|
-
}
|
|
6544
|
-
isGroupRowCollapsed(keys) {
|
|
6545
|
-
return !this.isGroupRowExpanded(keys);
|
|
6546
|
-
}
|
|
6547
|
-
setGroupRowExpanded(keys, shouldExpand) {
|
|
6548
|
-
var _a;
|
|
6549
|
-
if (shouldExpand === this.isGroupRowExpanded(keys)) {
|
|
6550
|
-
return;
|
|
6551
|
-
}
|
|
6552
|
-
if (shouldExpand) {
|
|
6553
|
-
if (this.collapsedAll === true) {
|
|
6554
|
-
if (!this.expandedMap) {
|
|
6555
|
-
throw `No expandedMap found when trying to expand group row ${keys.join(",")}`;
|
|
6556
|
-
}
|
|
6557
|
-
this.expandedMap.set(keys, true);
|
|
6558
|
-
} else if (this.expandedAll === true) {
|
|
6559
|
-
if (!this.collapsedMap) {
|
|
6560
|
-
throw `No collapsedMap found when trying to expand group row ${keys.join(",")}`;
|
|
6561
|
-
}
|
|
6562
|
-
this.collapsedMap.delete(keys);
|
|
6563
|
-
}
|
|
6564
|
-
} else {
|
|
6565
|
-
if (this.expandedAll === true) {
|
|
6566
|
-
if (!this.collapsedMap) {
|
|
6567
|
-
throw `No collapsedMap found when trying to collapse group row ${keys.join(",")}`;
|
|
6568
|
-
}
|
|
6569
|
-
this.collapsedMap.set(keys, true);
|
|
6570
|
-
} else if (this.collapsedAll === true) {
|
|
6571
|
-
if (!this.expandedMap) {
|
|
6572
|
-
throw `No expandedMap found when trying to collapse group row ${keys.join(",")}`;
|
|
6573
|
-
}
|
|
6574
|
-
(_a = this.expandedMap) == null ? void 0 : _a.delete(keys);
|
|
6575
|
-
}
|
|
6576
|
-
}
|
|
6577
|
-
}
|
|
6578
|
-
collapseGroupRow(keys) {
|
|
6579
|
-
this.setGroupRowExpanded(keys, false);
|
|
6580
|
-
}
|
|
6581
|
-
expandGroupRow(keys) {
|
|
6582
|
-
this.setGroupRowExpanded(keys, true);
|
|
6583
|
-
}
|
|
6584
|
-
toggleGroupRow(keys) {
|
|
6585
|
-
this.setGroupRowExpanded(keys, !this.isGroupRowExpanded(keys));
|
|
6586
|
-
}
|
|
6587
|
-
};
|
|
6588
|
-
|
|
6589
6932
|
// src/components/DataSource/state/normalizeSortInfo.ts
|
|
6590
6933
|
var EMPTY_ARRAY = Object.freeze([]);
|
|
6591
6934
|
var normalizeSortInfo = (initialSortInfo, weakMap) => {
|
|
@@ -6631,9 +6974,12 @@ function initSetupState() {
|
|
|
6631
6974
|
pivotColumns: void 0,
|
|
6632
6975
|
pivotColumnGroups: void 0,
|
|
6633
6976
|
dataArray,
|
|
6977
|
+
unfilteredCount: dataArray.length,
|
|
6978
|
+
filteredCount: dataArray.length,
|
|
6634
6979
|
updatedAt: now,
|
|
6635
6980
|
groupedAt: 0,
|
|
6636
6981
|
sortedAt: 0,
|
|
6982
|
+
filteredAt: 0,
|
|
6637
6983
|
reducedAt: now,
|
|
6638
6984
|
generateGroupRows: true,
|
|
6639
6985
|
groupDeepMap: void 0,
|
|
@@ -6656,6 +7002,15 @@ var forwardProps2 = (setupState) => {
|
|
|
6656
7002
|
pivotBy: 1,
|
|
6657
7003
|
primaryKey: 1,
|
|
6658
7004
|
livePagination: 1,
|
|
7005
|
+
filterFunction: 1,
|
|
7006
|
+
filterValue: 1,
|
|
7007
|
+
filterDelay: (filterDelay) => filterDelay != null ? filterDelay : 200,
|
|
7008
|
+
filterTypes: (filterTypes) => {
|
|
7009
|
+
return __spreadValues(__spreadValues({}, defaultFilterTypes), filterTypes);
|
|
7010
|
+
},
|
|
7011
|
+
sortTypes: (sortTypes) => {
|
|
7012
|
+
return __spreadValues(__spreadValues({}, sortTypes_default), sortTypes);
|
|
7013
|
+
},
|
|
6659
7014
|
aggregationReducers: 1,
|
|
6660
7015
|
collapseGroupRowsOnDataFunctionChange: (collapseGroupRowsOnDataFunctionChange) => collapseGroupRowsOnDataFunctionChange != null ? collapseGroupRowsOnDataFunctionChange : true,
|
|
6661
7016
|
loading: (loading) => loading != null ? loading : false,
|
|
@@ -6681,10 +7036,25 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
|
|
|
6681
7036
|
return livePaginationCursor;
|
|
6682
7037
|
}
|
|
6683
7038
|
function mapPropsToState(params) {
|
|
7039
|
+
var _a;
|
|
6684
7040
|
const { props, state, oldState } = params;
|
|
6685
7041
|
const controlledSort = isControlledValue(props.sortInfo);
|
|
7042
|
+
const controlledFilter = isControlledValue(props.filterValue);
|
|
7043
|
+
const { filterTypes } = state;
|
|
7044
|
+
const operatorsByFilterType = Object.keys(filterTypes).reduce((acc, key) => {
|
|
7045
|
+
const operators = filterTypes[key].operators;
|
|
7046
|
+
acc[key] = acc[key] || {};
|
|
7047
|
+
const currentFilterTypeOperators = acc[key];
|
|
7048
|
+
operators.forEach((operator) => {
|
|
7049
|
+
currentFilterTypeOperators[operator.name] = operator;
|
|
7050
|
+
});
|
|
7051
|
+
return acc;
|
|
7052
|
+
}, {});
|
|
6686
7053
|
const result = {
|
|
7054
|
+
operatorsByFilterType,
|
|
6687
7055
|
controlledSort,
|
|
7056
|
+
controlledFilter,
|
|
7057
|
+
filterMode: ((_a = props.filterMode) != null ? _a : props.filterFunction != null) ? "client" : typeof props.data === "function" ? "server" : "client",
|
|
6688
7058
|
multiSort: Array.isArray(controlledSort ? props.sortInfo : props.defaultSortInfo),
|
|
6689
7059
|
lazyLoadBatchSize: typeof props.lazyLoad === "object" ? props.lazyLoad.batchSize : void 0
|
|
6690
7060
|
};
|
|
@@ -6749,6 +7119,18 @@ function getInterceptActions() {
|
|
|
6749
7119
|
});
|
|
6750
7120
|
}
|
|
6751
7121
|
},
|
|
7122
|
+
filterValue: (filterValue, { actions, state }) => {
|
|
7123
|
+
const dataParams = buildDataSourceDataParams(state, {
|
|
7124
|
+
filterValue,
|
|
7125
|
+
livePaginationCursor: null
|
|
7126
|
+
});
|
|
7127
|
+
actions.dataParams = dataParams;
|
|
7128
|
+
if (state.livePagination) {
|
|
7129
|
+
requestAnimationFrame(() => {
|
|
7130
|
+
actions.livePaginationCursor = null;
|
|
7131
|
+
});
|
|
7132
|
+
}
|
|
7133
|
+
},
|
|
6752
7134
|
cursorId: (cursorId, { actions, state }) => {
|
|
6753
7135
|
const dataParams = buildDataSourceDataParams(state, {
|
|
6754
7136
|
__cursorId: cursorId
|
|
@@ -6830,7 +7212,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
6830
7212
|
pivotGroupKeys: [],
|
|
6831
7213
|
pivotGroupKey: "",
|
|
6832
7214
|
pivotIndex: -1,
|
|
6833
|
-
|
|
7215
|
+
valueFormatter: ({ rowInfo }) => {
|
|
6834
7216
|
var _a;
|
|
6835
7217
|
return rowInfo.isGroupRow ? (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id] : null;
|
|
6836
7218
|
}
|
|
@@ -6879,7 +7261,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
6879
7261
|
sortable: false,
|
|
6880
7262
|
columnGroup: parentColumnGroupId,
|
|
6881
7263
|
header,
|
|
6882
|
-
|
|
7264
|
+
valueFormatter: ({ rowInfo }) => {
|
|
6883
7265
|
var _a, _b;
|
|
6884
7266
|
if (!rowInfo.isGroupRow) {
|
|
6885
7267
|
return null;
|
|
@@ -6934,7 +7316,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
6934
7316
|
pivotIndex: keys.length - 1,
|
|
6935
7317
|
pivotBy,
|
|
6936
7318
|
sortable: false,
|
|
6937
|
-
|
|
7319
|
+
valueFormatter: ({ rowInfo }) => {
|
|
6938
7320
|
var _a, _b;
|
|
6939
7321
|
if (!rowInfo.isGroupRow) {
|
|
6940
7322
|
return null;
|
|
@@ -6978,14 +7360,72 @@ function toRowInfo(data, id, index) {
|
|
|
6978
7360
|
data,
|
|
6979
7361
|
id,
|
|
6980
7362
|
indexInAll: index,
|
|
6981
|
-
indexInGroup: index,
|
|
6982
7363
|
isGroupRow: false,
|
|
6983
7364
|
selfLoaded: true
|
|
6984
7365
|
};
|
|
6985
7366
|
}
|
|
7367
|
+
function filterDataSource(params) {
|
|
7368
|
+
const {
|
|
7369
|
+
filterTypes,
|
|
7370
|
+
filterValue: filterValueArray,
|
|
7371
|
+
operatorsByFilterType,
|
|
7372
|
+
filterFunction,
|
|
7373
|
+
toPrimaryKey
|
|
7374
|
+
} = params;
|
|
7375
|
+
let { dataArray } = params;
|
|
7376
|
+
if (filterFunction) {
|
|
7377
|
+
dataArray = dataArray.filter((data, index, arr) => filterFunction({
|
|
7378
|
+
data,
|
|
7379
|
+
index,
|
|
7380
|
+
dataArray: arr,
|
|
7381
|
+
primaryKey: toPrimaryKey(data, index)
|
|
7382
|
+
}));
|
|
7383
|
+
}
|
|
7384
|
+
if (filterValueArray && filterValueArray.length) {
|
|
7385
|
+
return dataArray.filter((data, index, arr) => {
|
|
7386
|
+
var _a;
|
|
7387
|
+
const param = {
|
|
7388
|
+
data,
|
|
7389
|
+
index,
|
|
7390
|
+
dataArray: arr,
|
|
7391
|
+
primaryKey: toPrimaryKey(data, index)
|
|
7392
|
+
};
|
|
7393
|
+
for (let i = 0, len = filterValueArray.length; i < len; i++) {
|
|
7394
|
+
const currentFilterValue = filterValueArray[i];
|
|
7395
|
+
const {
|
|
7396
|
+
disabled,
|
|
7397
|
+
filterValue,
|
|
7398
|
+
field,
|
|
7399
|
+
filterType: filterTypeKey,
|
|
7400
|
+
valueGetter,
|
|
7401
|
+
operator
|
|
7402
|
+
} = currentFilterValue;
|
|
7403
|
+
const filterType = filterTypes[filterTypeKey];
|
|
7404
|
+
if (disabled || !filterType) {
|
|
7405
|
+
continue;
|
|
7406
|
+
}
|
|
7407
|
+
const currentOperator = (_a = operatorsByFilterType[filterTypeKey]) == null ? void 0 : _a[operator];
|
|
7408
|
+
if (!currentOperator) {
|
|
7409
|
+
continue;
|
|
7410
|
+
}
|
|
7411
|
+
const getter = valueGetter || (({ data: data2 }) => field ? data2[field] : data2);
|
|
7412
|
+
const operatorFnParam = __spreadValues({}, param);
|
|
7413
|
+
operatorFnParam.filterValue = filterValue;
|
|
7414
|
+
operatorFnParam.currentValue = getter(param);
|
|
7415
|
+
operatorFnParam.emptyValues = filterType.emptyValues;
|
|
7416
|
+
if (!currentOperator.fn(operatorFnParam)) {
|
|
7417
|
+
return false;
|
|
7418
|
+
}
|
|
7419
|
+
}
|
|
7420
|
+
return true;
|
|
7421
|
+
});
|
|
7422
|
+
}
|
|
7423
|
+
return dataArray;
|
|
7424
|
+
}
|
|
6986
7425
|
function concludeReducer(params) {
|
|
6987
7426
|
var _a, _b;
|
|
6988
7427
|
const { state, previousState } = params;
|
|
7428
|
+
const primaryKeyDescriptor = state.primaryKey;
|
|
6989
7429
|
const sortInfo = state.sortInfo;
|
|
6990
7430
|
let shouldSort = !!(sortInfo == null ? void 0 : sortInfo.length) && !state.controlledSort;
|
|
6991
7431
|
if (state.lazyLoad || state.livePagination) {
|
|
@@ -7003,15 +7443,24 @@ function concludeReducer(params) {
|
|
|
7003
7443
|
state.originalLazyGroupData = new DeepMap();
|
|
7004
7444
|
originalDataArrayChanged = true;
|
|
7005
7445
|
}
|
|
7446
|
+
const { filterFunction, filterValue, filterTypes, operatorsByFilterType } = state;
|
|
7447
|
+
const shouldFilter = !!filterFunction || Array.isArray(filterValue) && filterValue.length;
|
|
7448
|
+
const shouldFilterClientSide = shouldFilter && state.filterMode === "client";
|
|
7449
|
+
const filterDepsChanged = haveDepsChanged(previousState, state, [
|
|
7450
|
+
"filterFunction",
|
|
7451
|
+
"filterValue",
|
|
7452
|
+
"filterTypes"
|
|
7453
|
+
]);
|
|
7454
|
+
const filterChanged = originalDataArrayChanged || filterDepsChanged;
|
|
7006
7455
|
const sortInfoChanged = haveDepsChanged(previousState, state, ["sortInfo"]);
|
|
7007
|
-
const sortDepsChanged = originalDataArrayChanged || sortInfoChanged;
|
|
7456
|
+
const sortDepsChanged = originalDataArrayChanged || filterDepsChanged || sortInfoChanged;
|
|
7457
|
+
const shouldFilterAgain = state.filterMode === "client" && (filterChanged || !state.lastFilterDataArray);
|
|
7008
7458
|
const shouldSortAgain = shouldSort && (sortDepsChanged || !state.lastSortDataArray);
|
|
7009
7459
|
const groupBy = state.groupBy;
|
|
7010
7460
|
const pivotBy = state.pivotBy;
|
|
7011
7461
|
const shouldGroup = groupBy.length > 0 || !!pivotBy;
|
|
7012
|
-
const groupsDepsChanged = originalDataArrayChanged || haveDepsChanged(previousState, state, [
|
|
7462
|
+
const groupsDepsChanged = originalDataArrayChanged || sortDepsChanged || haveDepsChanged(previousState, state, [
|
|
7013
7463
|
"generateGroupRows",
|
|
7014
|
-
"originalDataArray",
|
|
7015
7464
|
"originalLazyGroupData",
|
|
7016
7465
|
"originalLazyGroupDataChangeDetect",
|
|
7017
7466
|
"groupBy",
|
|
@@ -7020,23 +7469,43 @@ function concludeReducer(params) {
|
|
|
7020
7469
|
"aggregationReducers",
|
|
7021
7470
|
"pivotTotalColumnPosition",
|
|
7022
7471
|
"pivotGrandTotalColumnPosition",
|
|
7023
|
-
"showSeparatePivotColumnForSingleAggregation"
|
|
7024
|
-
"sortInfo"
|
|
7472
|
+
"showSeparatePivotColumnForSingleAggregation"
|
|
7025
7473
|
]);
|
|
7026
7474
|
const shouldGroupAgain = shouldGroup && (groupsDepsChanged || !state.lastGroupDataArray);
|
|
7027
7475
|
const now = Date.now();
|
|
7028
7476
|
let dataArray = state.originalDataArray;
|
|
7029
|
-
|
|
7477
|
+
const toPrimaryKey = typeof primaryKeyDescriptor === "function" ? (data, index) => primaryKeyDescriptor({ data, index }) : (data, _index) => {
|
|
7478
|
+
const pk = data[primaryKeyDescriptor];
|
|
7479
|
+
return pk;
|
|
7480
|
+
};
|
|
7481
|
+
if (!shouldFilter) {
|
|
7482
|
+
state.unfilteredCount = dataArray.length;
|
|
7483
|
+
}
|
|
7484
|
+
if (shouldFilterClientSide) {
|
|
7485
|
+
state.unfilteredCount = dataArray.length;
|
|
7486
|
+
dataArray = shouldFilterAgain ? filterDataSource({
|
|
7487
|
+
dataArray,
|
|
7488
|
+
toPrimaryKey,
|
|
7489
|
+
filterTypes,
|
|
7490
|
+
operatorsByFilterType,
|
|
7491
|
+
filterFunction,
|
|
7492
|
+
filterValue
|
|
7493
|
+
}) : state.lastFilterDataArray;
|
|
7494
|
+
state.lastFilterDataArray = dataArray;
|
|
7495
|
+
state.filteredAt = now;
|
|
7496
|
+
}
|
|
7497
|
+
state.filteredCount = dataArray.length;
|
|
7498
|
+
state.postFilterDataArray = dataArray;
|
|
7030
7499
|
if (shouldSort) {
|
|
7500
|
+
const prevKnownTypes = multisort.knownTypes;
|
|
7501
|
+
multisort.knownTypes = state.sortTypes;
|
|
7031
7502
|
dataArray = shouldSortAgain ? multisort(sortInfo, [...dataArray]) : state.lastSortDataArray;
|
|
7503
|
+
multisort.knownTypes = prevKnownTypes;
|
|
7032
7504
|
state.lastSortDataArray = dataArray;
|
|
7033
7505
|
state.sortedAt = now;
|
|
7034
7506
|
}
|
|
7035
7507
|
state.postSortDataArray = dataArray;
|
|
7036
|
-
|
|
7037
|
-
const pk = data[state.primaryKey];
|
|
7038
|
-
return pk;
|
|
7039
|
-
};
|
|
7508
|
+
let rowInfoDataArray = state.dataArray;
|
|
7040
7509
|
if (shouldGroup) {
|
|
7041
7510
|
if (shouldGroupAgain) {
|
|
7042
7511
|
const groupResult = state.lazyLoad ? lazyGroup({
|
|
@@ -7079,7 +7548,7 @@ function concludeReducer(params) {
|
|
|
7079
7548
|
state.pivotColumns = void 0;
|
|
7080
7549
|
const arrayDifferentAfterSortStep = previousState.postSortDataArray != state.postSortDataArray;
|
|
7081
7550
|
if (arrayDifferentAfterSortStep || groupsDepsChanged) {
|
|
7082
|
-
rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, data ? toPrimaryKey(data) : index, index));
|
|
7551
|
+
rowInfoDataArray = dataArray.map((data, index) => toRowInfo(data, data ? toPrimaryKey(data, index) : index, index));
|
|
7083
7552
|
}
|
|
7084
7553
|
}
|
|
7085
7554
|
state.postGroupDataArray = rowInfoDataArray;
|
|
@@ -7107,7 +7576,7 @@ function DataSourceWithContext(props) {
|
|
|
7107
7576
|
if (typeof children === "function") {
|
|
7108
7577
|
children = children(computedValues);
|
|
7109
7578
|
}
|
|
7110
|
-
return /* @__PURE__ */
|
|
7579
|
+
return /* @__PURE__ */ createElement23(Fragment3, null, children);
|
|
7111
7580
|
}
|
|
7112
7581
|
var DataSourceRoot = getComponentStateRoot({
|
|
7113
7582
|
initSetupState,
|
|
@@ -7130,14 +7599,14 @@ function DataSourceCmp({ children }) {
|
|
|
7130
7599
|
globalThis.getDataSourceState = getState;
|
|
7131
7600
|
}
|
|
7132
7601
|
useLoadData();
|
|
7133
|
-
return /* @__PURE__ */
|
|
7602
|
+
return /* @__PURE__ */ createElement23(DataSourceContext.Provider, {
|
|
7134
7603
|
value: contextValue
|
|
7135
|
-
}, /* @__PURE__ */
|
|
7604
|
+
}, /* @__PURE__ */ createElement23(DataSourceWithContext, {
|
|
7136
7605
|
children
|
|
7137
7606
|
}));
|
|
7138
7607
|
}
|
|
7139
7608
|
function DataSource(props) {
|
|
7140
|
-
return /* @__PURE__ */
|
|
7609
|
+
return /* @__PURE__ */ createElement23(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement23(DataSourceCmp, {
|
|
7141
7610
|
children: props.children
|
|
7142
7611
|
}));
|
|
7143
7612
|
}
|
|
@@ -7177,7 +7646,7 @@ function useToggleGroupRow() {
|
|
|
7177
7646
|
|
|
7178
7647
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
7179
7648
|
function useGroupByMap(groupBy) {
|
|
7180
|
-
const groupByMap =
|
|
7649
|
+
const groupByMap = useMemo9(() => {
|
|
7181
7650
|
return groupBy.reduce((acc, groupBy2, index) => {
|
|
7182
7651
|
acc.set(groupBy2.field, {
|
|
7183
7652
|
groupBy: groupBy2,
|
|
@@ -7201,13 +7670,13 @@ function useColumnsWhen() {
|
|
|
7201
7670
|
}
|
|
7202
7671
|
} = useComponentState();
|
|
7203
7672
|
const groupByMap = useGroupByMap(groupBy);
|
|
7204
|
-
|
|
7673
|
+
useEffect20(() => {
|
|
7205
7674
|
dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
|
|
7206
7675
|
}, [groupRenderStrategy]);
|
|
7207
|
-
|
|
7676
|
+
useEffect20(() => {
|
|
7208
7677
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
7209
7678
|
}, [pivotTotalColumnPosition]);
|
|
7210
|
-
|
|
7679
|
+
useEffect20(() => {
|
|
7211
7680
|
if (pivotGrandTotalColumnPosition != void 0) {
|
|
7212
7681
|
dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
|
|
7213
7682
|
}
|
|
@@ -7237,7 +7706,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
7237
7706
|
base = {
|
|
7238
7707
|
groupByField: field,
|
|
7239
7708
|
field,
|
|
7240
|
-
|
|
7709
|
+
valueFormatter: ({ rowInfo }) => {
|
|
7241
7710
|
var _a;
|
|
7242
7711
|
return rowInfo.isGroupRow ? (_a = rowInfo.groupKeys) == null ? void 0 : _a[groupIndex] : rowInfo.value;
|
|
7243
7712
|
},
|
|
@@ -7281,7 +7750,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
7281
7750
|
});
|
|
7282
7751
|
return computedColumns.size === 0 ? void 0 : computedColumns;
|
|
7283
7752
|
}
|
|
7284
|
-
|
|
7753
|
+
useEffect20(() => {
|
|
7285
7754
|
const update = () => {
|
|
7286
7755
|
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
|
|
7287
7756
|
};
|
|
@@ -7310,7 +7779,7 @@ function useColumnsWhenGrouping() {
|
|
|
7310
7779
|
}
|
|
7311
7780
|
} = useComponentState();
|
|
7312
7781
|
const toggleGroupRow = useToggleGroupRow();
|
|
7313
|
-
|
|
7782
|
+
useEffect20(() => {
|
|
7314
7783
|
const update = () => {
|
|
7315
7784
|
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
7316
7785
|
columns,
|
|
@@ -7446,7 +7915,7 @@ function useHideColumns(groupByMap) {
|
|
|
7446
7915
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
7447
7916
|
hideEmptyGroupColumns
|
|
7448
7917
|
]);
|
|
7449
|
-
|
|
7918
|
+
useEffect20(() => {
|
|
7450
7919
|
const isGrouped = groupBy.length > 0;
|
|
7451
7920
|
const currentState = getComponentState();
|
|
7452
7921
|
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
@@ -7561,7 +8030,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
7561
8030
|
}
|
|
7562
8031
|
|
|
7563
8032
|
// src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
|
|
7564
|
-
import { useMemo as
|
|
8033
|
+
import { useMemo as useMemo10 } from "react";
|
|
7565
8034
|
|
|
7566
8035
|
// src/components/flexbox/index.ts
|
|
7567
8036
|
var computeFlex = (params) => {
|
|
@@ -7718,7 +8187,9 @@ var adjustColumnOrderForPinning = (columnOrder, columnPinning) => {
|
|
|
7718
8187
|
};
|
|
7719
8188
|
|
|
7720
8189
|
// src/components/InfiniteTable/utils/getColumnComputedType.ts
|
|
7721
|
-
var emptyType = Object.freeze({
|
|
8190
|
+
var emptyType = Object.freeze({
|
|
8191
|
+
filterType: "string"
|
|
8192
|
+
});
|
|
7722
8193
|
function getColumnComputedType(column, columnTypes) {
|
|
7723
8194
|
const defaultType = columnTypes["default"] || emptyType;
|
|
7724
8195
|
if (column.type === void 0) {
|
|
@@ -7734,22 +8205,6 @@ function getColumnComputedType(column, columnTypes) {
|
|
|
7734
8205
|
return column.type.reduce((acc, columnType) => Object.assign(acc, columnTypes[columnType]), {});
|
|
7735
8206
|
}
|
|
7736
8207
|
|
|
7737
|
-
// src/components/InfiniteTable/utils/assignFiltered.ts
|
|
7738
|
-
function assignFiltered(filterFn, target, ...rest) {
|
|
7739
|
-
let result = target;
|
|
7740
|
-
rest.forEach((obj) => {
|
|
7741
|
-
for (const key in obj) {
|
|
7742
|
-
if (obj.hasOwnProperty(key) && filterFn(obj[key], key)) {
|
|
7743
|
-
result[key] = obj[key];
|
|
7744
|
-
}
|
|
7745
|
-
}
|
|
7746
|
-
});
|
|
7747
|
-
return result;
|
|
7748
|
-
}
|
|
7749
|
-
function assignNonNull(target, ...rest) {
|
|
7750
|
-
return assignFiltered((value) => value != null, target, ...rest);
|
|
7751
|
-
}
|
|
7752
|
-
|
|
7753
8208
|
// src/components/InfiniteTable/utils/getComputedVisibleColumns.ts
|
|
7754
8209
|
var logError = err("getComputedVisibleColumns");
|
|
7755
8210
|
var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId) => {
|
|
@@ -7770,6 +8225,7 @@ var getComputedVisibleColumns = ({
|
|
|
7770
8225
|
columnHeaderCssEllipsis,
|
|
7771
8226
|
pinnedStartMaxWidth,
|
|
7772
8227
|
pinnedEndMaxWidth,
|
|
8228
|
+
filterValue,
|
|
7773
8229
|
sortable,
|
|
7774
8230
|
sortInfo,
|
|
7775
8231
|
setSortInfo,
|
|
@@ -7784,9 +8240,19 @@ var getComputedVisibleColumns = ({
|
|
|
7784
8240
|
columnVisibilityAssumeVisible
|
|
7785
8241
|
}) => {
|
|
7786
8242
|
let computedOffset = 0;
|
|
8243
|
+
const filterValueRecord = (filterValue || []).reduce((acc, filterValueItem) => {
|
|
8244
|
+
const { id, field } = filterValueItem;
|
|
8245
|
+
if (field) {
|
|
8246
|
+
acc[field] = filterValueItem;
|
|
8247
|
+
}
|
|
8248
|
+
if (id) {
|
|
8249
|
+
acc[id] = filterValueItem;
|
|
8250
|
+
}
|
|
8251
|
+
return acc;
|
|
8252
|
+
}, {});
|
|
7787
8253
|
const normalizedColumnOrder = adjustColumnOrderForPinning(columnOrder === true ? [...columns.keys()] : columnOrder, columnPinning);
|
|
7788
8254
|
const visibleColumnOrder = normalizedColumnOrder.filter((colId) => {
|
|
7789
|
-
|
|
8255
|
+
const col = columns.get(colId);
|
|
7790
8256
|
if (!col) {
|
|
7791
8257
|
logError(`Column with id "${colId}" specified in columnOrder array cannot be found in the columns map.`);
|
|
7792
8258
|
return false;
|
|
@@ -7834,7 +8300,7 @@ var getComputedVisibleColumns = ({
|
|
|
7834
8300
|
delete colTypeSizing.width;
|
|
7835
8301
|
}
|
|
7836
8302
|
colSizing = assignNonNull(colTypeSizing, colSizing);
|
|
7837
|
-
|
|
8303
|
+
const colFlex = (_a = colSizing.flex) != null ? _a : void 0;
|
|
7838
8304
|
const colMinWidth = (_c = (_b = colSizing.minWidth) != null ? _b : column == null ? void 0 : column.minWidth) != null ? _c : columnMinWidth;
|
|
7839
8305
|
const colMaxWidth = (_e = (_d = colSizing.maxWidth) != null ? _d : column == null ? void 0 : column.maxWidth) != null ? _e : columnMaxWidth;
|
|
7840
8306
|
let size = colFlex != void 0 ? void 0 : (_f = colSizing.width) != null ? _f : columnDefaultWidth;
|
|
@@ -7877,7 +8343,7 @@ var getComputedVisibleColumns = ({
|
|
|
7877
8343
|
});
|
|
7878
8344
|
const firstPinnedEndAbsoluteOffset = bodySize.width - totalPinnedEndWidth;
|
|
7879
8345
|
columnsArray.forEach((c, i) => {
|
|
7880
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
8346
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
7881
8347
|
const id = visibleColumnOrder[i];
|
|
7882
8348
|
const nextColumnId = visibleColumnOrder[i + 1];
|
|
7883
8349
|
const colType = getColumnComputedType(c, columnTypes);
|
|
@@ -7888,47 +8354,6 @@ var getComputedVisibleColumns = ({
|
|
|
7888
8354
|
const computedSortedDesc = computedSorted && !computedSortedAsc;
|
|
7889
8355
|
const computedSortIndex = (_c = sortingInfo == null ? void 0 : sortingInfo.index) != null ? _c : -1;
|
|
7890
8356
|
const computedWidth = computedSizes[i];
|
|
7891
|
-
const toggleSort = () => {
|
|
7892
|
-
let currentSortInfo = computedSortInfo;
|
|
7893
|
-
let newColumnSortInfo;
|
|
7894
|
-
if (!currentSortInfo) {
|
|
7895
|
-
newColumnSortInfo = {
|
|
7896
|
-
dir: 1,
|
|
7897
|
-
id,
|
|
7898
|
-
field: c.field,
|
|
7899
|
-
type: c.type
|
|
7900
|
-
};
|
|
7901
|
-
} else {
|
|
7902
|
-
if (computedSortedDesc) {
|
|
7903
|
-
newColumnSortInfo = null;
|
|
7904
|
-
} else {
|
|
7905
|
-
newColumnSortInfo = __spreadProps(__spreadValues({}, computedSortInfo), {
|
|
7906
|
-
dir: -1
|
|
7907
|
-
});
|
|
7908
|
-
}
|
|
7909
|
-
}
|
|
7910
|
-
if (c.field && newColumnSortInfo && !newColumnSortInfo.field) {
|
|
7911
|
-
newColumnSortInfo.field = c.field;
|
|
7912
|
-
}
|
|
7913
|
-
let finalSortInfo = sortInfo ? [...sortInfo] : [];
|
|
7914
|
-
if (multiSort) {
|
|
7915
|
-
if (computedSortIndex === -1) {
|
|
7916
|
-
if (newColumnSortInfo) {
|
|
7917
|
-
finalSortInfo.push(newColumnSortInfo);
|
|
7918
|
-
}
|
|
7919
|
-
} else {
|
|
7920
|
-
finalSortInfo = finalSortInfo.map((info, index) => {
|
|
7921
|
-
if (index === computedSortIndex) {
|
|
7922
|
-
return newColumnSortInfo;
|
|
7923
|
-
}
|
|
7924
|
-
return info;
|
|
7925
|
-
}).filter((x) => x != null);
|
|
7926
|
-
}
|
|
7927
|
-
} else {
|
|
7928
|
-
finalSortInfo = newColumnSortInfo ? [newColumnSortInfo] : [];
|
|
7929
|
-
}
|
|
7930
|
-
setSortInfo(finalSortInfo);
|
|
7931
|
-
};
|
|
7932
8357
|
const computedPinned = getComputedPinned(id, columnPinning);
|
|
7933
8358
|
const computedLast = i === visibleColumnOrder.length - 1;
|
|
7934
8359
|
const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
|
|
@@ -7937,23 +8362,36 @@ var getComputedVisibleColumns = ({
|
|
|
7937
8362
|
const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
|
|
7938
8363
|
const cssEllipsis = (_e = (_d = c.cssEllipsis) != null ? _d : colType.cssEllipsis) != null ? _e : columnCssEllipsis;
|
|
7939
8364
|
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;
|
|
8365
|
+
const computedFilterValue = filterValueRecord[id] || c.field ? filterValueRecord[c.field] || null : null;
|
|
8366
|
+
const computedFiltered = computedFilterValue != null;
|
|
8367
|
+
const computedFilterable = (_l = (_k = c.defaultFilterable) != null ? _k : colType.defaultFilterable) != null ? _l : true;
|
|
8368
|
+
const computedDataType = c.dataType || colType.dataType || (Array.isArray(c.type) ? c.type[0] : c.type) || "string";
|
|
8369
|
+
const computedSortType = c.sortType || colType.sortType || computedDataType;
|
|
8370
|
+
const computedFilterType = c.filterType || colType.filterType || computedDataType;
|
|
7940
8371
|
const result2 = __spreadProps(__spreadValues({
|
|
7941
8372
|
align: colType.align,
|
|
7942
8373
|
verticalAlign: colType.verticalAlign,
|
|
7943
8374
|
defaultHiddenWhenGroupedBy: colType.defaultHiddenWhenGroupedBy,
|
|
7944
8375
|
valueGetter: colType.valueGetter,
|
|
8376
|
+
valueFormatter: colType.valueFormatter,
|
|
7945
8377
|
renderValue: colType.renderValue,
|
|
7946
8378
|
render: colType.render,
|
|
7947
8379
|
style: colType.style,
|
|
7948
8380
|
components: colType.components
|
|
7949
8381
|
}, c), {
|
|
8382
|
+
computedDataType,
|
|
8383
|
+
computedSortType,
|
|
8384
|
+
computedFilterType,
|
|
7950
8385
|
cssEllipsis,
|
|
7951
8386
|
headerCssEllipsis,
|
|
8387
|
+
computedFilterValue,
|
|
8388
|
+
computedFiltered,
|
|
8389
|
+
computedFilterable,
|
|
7952
8390
|
computedWidth,
|
|
7953
8391
|
computedAbsoluteOffset,
|
|
7954
8392
|
computedPinningOffset,
|
|
7955
8393
|
computedOffset,
|
|
7956
|
-
computedSortable: (
|
|
8394
|
+
computedSortable: (_o = (_n = (_m = c.sortable) != null ? _m : colType.sortable) != null ? _n : sortable) != null ? _o : true,
|
|
7957
8395
|
computedSortInfo,
|
|
7958
8396
|
computedSortIndex,
|
|
7959
8397
|
computedMultiSort: multiSort,
|
|
@@ -7962,14 +8400,57 @@ var getComputedVisibleColumns = ({
|
|
|
7962
8400
|
computedSortedDesc,
|
|
7963
8401
|
computedVisibleIndex: i,
|
|
7964
8402
|
computedPinned,
|
|
7965
|
-
computedDraggable: (
|
|
8403
|
+
computedDraggable: (_q = (_p = c.draggable) != null ? _p : draggableColumns) != null ? _q : true,
|
|
7966
8404
|
computedFirstInCategory,
|
|
7967
8405
|
computedLastInCategory,
|
|
7968
8406
|
computedFirst: i === 0,
|
|
7969
8407
|
computedLast,
|
|
7970
|
-
toggleSort
|
|
8408
|
+
toggleSort: () => {
|
|
8409
|
+
const currentSortInfo = computedSortInfo;
|
|
8410
|
+
let newColumnSortInfo;
|
|
8411
|
+
if (!currentSortInfo) {
|
|
8412
|
+
newColumnSortInfo = {
|
|
8413
|
+
dir: 1,
|
|
8414
|
+
id,
|
|
8415
|
+
field: c.field,
|
|
8416
|
+
type: computedSortType
|
|
8417
|
+
};
|
|
8418
|
+
} else {
|
|
8419
|
+
if (computedSortedDesc) {
|
|
8420
|
+
newColumnSortInfo = null;
|
|
8421
|
+
} else {
|
|
8422
|
+
newColumnSortInfo = __spreadProps(__spreadValues({}, computedSortInfo), {
|
|
8423
|
+
dir: -1
|
|
8424
|
+
});
|
|
8425
|
+
}
|
|
8426
|
+
}
|
|
8427
|
+
if (c.field && newColumnSortInfo && !newColumnSortInfo.field) {
|
|
8428
|
+
newColumnSortInfo.field = c.field;
|
|
8429
|
+
}
|
|
8430
|
+
if (c.valueGetter && newColumnSortInfo && !newColumnSortInfo.valueGetter) {
|
|
8431
|
+
newColumnSortInfo.valueGetter = (data) => c.valueGetter({ data, field: c.field });
|
|
8432
|
+
}
|
|
8433
|
+
let finalSortInfo = sortInfo ? [...sortInfo] : [];
|
|
8434
|
+
if (multiSort) {
|
|
8435
|
+
if (computedSortIndex === -1) {
|
|
8436
|
+
if (newColumnSortInfo) {
|
|
8437
|
+
finalSortInfo.push(newColumnSortInfo);
|
|
8438
|
+
}
|
|
8439
|
+
} else {
|
|
8440
|
+
finalSortInfo = finalSortInfo.map((info, index) => {
|
|
8441
|
+
if (index === computedSortIndex) {
|
|
8442
|
+
return newColumnSortInfo;
|
|
8443
|
+
}
|
|
8444
|
+
return info;
|
|
8445
|
+
}).filter((x) => x != null);
|
|
8446
|
+
}
|
|
8447
|
+
} else {
|
|
8448
|
+
finalSortInfo = newColumnSortInfo ? [newColumnSortInfo] : [];
|
|
8449
|
+
}
|
|
8450
|
+
setSortInfo(finalSortInfo);
|
|
8451
|
+
},
|
|
7971
8452
|
id,
|
|
7972
|
-
header: (
|
|
8453
|
+
header: (_t = (_s = (_r = c.header) != null ? _r : colType.header) != null ? _s : c.name) != null ? _t : c.field
|
|
7973
8454
|
});
|
|
7974
8455
|
computedOffset += computedWidth;
|
|
7975
8456
|
computedVisibleColumnsMap.set(result2.id, result2);
|
|
@@ -8010,10 +8491,10 @@ var getComputedVisibleColumns = ({
|
|
|
8010
8491
|
};
|
|
8011
8492
|
|
|
8012
8493
|
// src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts
|
|
8013
|
-
import { useEffect as
|
|
8494
|
+
import { useEffect as useEffect21 } from "react";
|
|
8014
8495
|
var useRerenderOnKeyChange = (map2) => {
|
|
8015
8496
|
const [renderId, rerender] = useRerender();
|
|
8016
|
-
|
|
8497
|
+
useEffect21(() => {
|
|
8017
8498
|
const update = rafFn(rerender);
|
|
8018
8499
|
return interceptMap(map2, {
|
|
8019
8500
|
set: update,
|
|
@@ -8038,6 +8519,7 @@ var useComputedVisibleColumns = ({
|
|
|
8038
8519
|
sortInfo,
|
|
8039
8520
|
multiSort,
|
|
8040
8521
|
setSortInfo,
|
|
8522
|
+
filterValue,
|
|
8041
8523
|
columnOrder,
|
|
8042
8524
|
columnPinning,
|
|
8043
8525
|
columnTypes,
|
|
@@ -8065,7 +8547,7 @@ var useComputedVisibleColumns = ({
|
|
|
8065
8547
|
computedPinnedEndOffset,
|
|
8066
8548
|
computedPinnedEndWidth,
|
|
8067
8549
|
computedPinnedStartWidth
|
|
8068
|
-
} =
|
|
8550
|
+
} = useMemo10(() => {
|
|
8069
8551
|
return getComputedVisibleColumns({
|
|
8070
8552
|
columns,
|
|
8071
8553
|
bodySize,
|
|
@@ -8075,6 +8557,7 @@ var useComputedVisibleColumns = ({
|
|
|
8075
8557
|
columnCssEllipsis,
|
|
8076
8558
|
columnHeaderCssEllipsis,
|
|
8077
8559
|
viewportReservedWidth,
|
|
8560
|
+
filterValue,
|
|
8078
8561
|
sortable,
|
|
8079
8562
|
sortInfo,
|
|
8080
8563
|
setSortInfo,
|
|
@@ -8099,6 +8582,7 @@ var useComputedVisibleColumns = ({
|
|
|
8099
8582
|
sortInfo,
|
|
8100
8583
|
setSortInfo,
|
|
8101
8584
|
multiSort,
|
|
8585
|
+
filterValue,
|
|
8102
8586
|
columnOrder,
|
|
8103
8587
|
columnVisibility,
|
|
8104
8588
|
columnVisibilityAssumeVisible,
|
|
@@ -8131,7 +8615,7 @@ var useComputedVisibleColumns = ({
|
|
|
8131
8615
|
};
|
|
8132
8616
|
|
|
8133
8617
|
// src/components/InfiniteTable/hooks/useScrollbars.ts
|
|
8134
|
-
import { useState as
|
|
8618
|
+
import { useState as useState11, useEffect as useEffect22, useLayoutEffect as useLayoutEffect4 } from "react";
|
|
8135
8619
|
var INITIAL_SCROLLBARS = {
|
|
8136
8620
|
vertical: false,
|
|
8137
8621
|
horizontal: false
|
|
@@ -8139,8 +8623,8 @@ var INITIAL_SCROLLBARS = {
|
|
|
8139
8623
|
function useScrollbars(brain) {
|
|
8140
8624
|
const { getComponentState: getInfiniteTableState } = useComponentState();
|
|
8141
8625
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
8142
|
-
const [scrollbars, setScrollbars] =
|
|
8143
|
-
|
|
8626
|
+
const [scrollbars, setScrollbars] = useState11(INITIAL_SCROLLBARS);
|
|
8627
|
+
useEffect22(() => {
|
|
8144
8628
|
return brain.onRenderCountChange(() => {
|
|
8145
8629
|
const { scrollTopMax, scrollLeftMax } = brain;
|
|
8146
8630
|
setScrollbars({
|
|
@@ -8180,27 +8664,27 @@ function useComputed() {
|
|
|
8180
8664
|
bodySize,
|
|
8181
8665
|
showSeparatePivotColumnForSingleAggregation
|
|
8182
8666
|
} = componentState;
|
|
8183
|
-
|
|
8667
|
+
useState12(() => {
|
|
8184
8668
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
8185
8669
|
if (rowHeight) {
|
|
8186
8670
|
componentActions.rowHeight = rowHeight;
|
|
8187
8671
|
}
|
|
8188
8672
|
});
|
|
8189
|
-
componentState.
|
|
8190
|
-
if (
|
|
8191
|
-
componentActions.
|
|
8673
|
+
componentState.onColumnHeaderHeightCSSVarChange.onChange((columnHeaderHeight) => {
|
|
8674
|
+
if (columnHeaderHeight) {
|
|
8675
|
+
componentActions.columnHeaderHeight = columnHeaderHeight;
|
|
8192
8676
|
}
|
|
8193
8677
|
});
|
|
8194
8678
|
});
|
|
8195
|
-
|
|
8679
|
+
useEffect23(() => {
|
|
8196
8680
|
dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
|
|
8197
8681
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
8198
|
-
const { multiSort } = dataSourceState;
|
|
8682
|
+
const { multiSort, filterValue } = dataSourceState;
|
|
8199
8683
|
useColumnGroups();
|
|
8200
8684
|
const { toggleGroupRow } = useColumnsWhen();
|
|
8201
8685
|
const setSortInfo = useCallback14((sortInfo) => {
|
|
8202
8686
|
var _a2;
|
|
8203
|
-
const newSortInfo = multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
8687
|
+
const newSortInfo = getDataSourceState().multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
8204
8688
|
dataSourceActions.sortInfo = newSortInfo;
|
|
8205
8689
|
}, [getDataSourceState]);
|
|
8206
8690
|
const columns = componentState.computedColumns;
|
|
@@ -8239,6 +8723,7 @@ function useComputed() {
|
|
|
8239
8723
|
columnVisibility,
|
|
8240
8724
|
columnVisibilityAssumeVisible: true,
|
|
8241
8725
|
columnPinning,
|
|
8726
|
+
filterValue,
|
|
8242
8727
|
columnSizing,
|
|
8243
8728
|
columnTypes
|
|
8244
8729
|
});
|
|
@@ -8248,6 +8733,7 @@ function useComputed() {
|
|
|
8248
8733
|
const computedPinnedStartOverflow = computedPinnedStartWidth ? computedPinnedStartColumnsWidth > computedPinnedStartWidth : false;
|
|
8249
8734
|
const computedPinnedEndOverflow = computedPinnedEndWidth ? computedPinnedEndColumnsWidth > computedPinnedEndWidth : false;
|
|
8250
8735
|
return {
|
|
8736
|
+
showColumnFilters: !!dataSourceState.filterValue,
|
|
8251
8737
|
scrollbars,
|
|
8252
8738
|
columnSize,
|
|
8253
8739
|
rowspan,
|
|
@@ -8355,7 +8841,7 @@ function useDOMProps(initialDOMProps) {
|
|
|
8355
8841
|
}
|
|
8356
8842
|
|
|
8357
8843
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
8358
|
-
import { useMemo as
|
|
8844
|
+
import { useMemo as useMemo11 } from "react";
|
|
8359
8845
|
|
|
8360
8846
|
// src/components/InfiniteTable/hooks/useLicense/crc32.ts
|
|
8361
8847
|
var DEFAULT_ReversedPolynomial = 3988292384;
|
|
@@ -8513,10 +8999,10 @@ var isInsideSandbox = () => {
|
|
|
8513
8999
|
};
|
|
8514
9000
|
var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
|
|
8515
9001
|
var useLicense = (licenseKey = "") => {
|
|
8516
|
-
const valid =
|
|
9002
|
+
const valid = useMemo11(() => {
|
|
8517
9003
|
let valid2 = isValidLicense(licenseKey, {
|
|
8518
9004
|
publishedAt: 1624970570587,
|
|
8519
|
-
version: "0.3.
|
|
9005
|
+
version: "0.3.3"
|
|
8520
9006
|
});
|
|
8521
9007
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
8522
9008
|
return true;
|
|
@@ -8608,7 +9094,7 @@ function initSetupState2() {
|
|
|
8608
9094
|
scrollerDOMRef: createRef(),
|
|
8609
9095
|
portalDOMRef: createRef(),
|
|
8610
9096
|
onRowHeightCSSVarChange: buildSubscriptionCallback(),
|
|
8611
|
-
|
|
9097
|
+
onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
|
|
8612
9098
|
bodySize: {
|
|
8613
9099
|
width: 0,
|
|
8614
9100
|
height: 0
|
|
@@ -8658,6 +9144,7 @@ var forwardProps3 = (setupState) => {
|
|
|
8658
9144
|
onScrollbarsChange: 1,
|
|
8659
9145
|
autoSizeColumnsKey: 1,
|
|
8660
9146
|
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
|
|
9147
|
+
filterEditors: (filterEditors) => __spreadValues(__spreadValues({}, defaultFilterEditors), filterEditors),
|
|
8661
9148
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
8662
9149
|
activeIndex: (activeIndex) => activeIndex != null ? activeIndex : 0,
|
|
8663
9150
|
columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
|
|
@@ -8665,6 +9152,9 @@ var forwardProps3 = (setupState) => {
|
|
|
8665
9152
|
columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
|
|
8666
9153
|
columnCssEllipsis: (columnCssEllipsis) => columnCssEllipsis != null ? columnCssEllipsis : true,
|
|
8667
9154
|
draggableColumns: (draggableColumns) => draggableColumns != null ? draggableColumns : true,
|
|
9155
|
+
headerOptions: (headerOptions) => __spreadValues({
|
|
9156
|
+
alwaysReserveSpaceForSortIcon: true
|
|
9157
|
+
}, headerOptions),
|
|
8668
9158
|
showSeparatePivotColumnForSingleAggregation: (showSeparatePivotColumnForSingleAggregation) => showSeparatePivotColumnForSingleAggregation != null ? showSeparatePivotColumnForSingleAggregation : false,
|
|
8669
9159
|
sortable: (sortable) => sortable != null ? sortable : true,
|
|
8670
9160
|
hideEmptyGroupColumns: (hideEmptyGroupColumns) => hideEmptyGroupColumns != null ? hideEmptyGroupColumns : false,
|
|
@@ -8677,7 +9167,7 @@ var forwardProps3 = (setupState) => {
|
|
|
8677
9167
|
showHoverRows: (showHoverRows) => showHoverRows != null ? showHoverRows : true,
|
|
8678
9168
|
virtualizeColumns: (virtualizeColumns) => virtualizeColumns != null ? virtualizeColumns : true,
|
|
8679
9169
|
rowHeight: (rowHeight) => typeof rowHeight === "number" ? rowHeight : 0,
|
|
8680
|
-
|
|
9170
|
+
columnHeaderHeight: (columnHeaderHeight) => typeof columnHeaderHeight === "number" ? columnHeaderHeight : 30,
|
|
8681
9171
|
columns: (columns) => toMap(columns, setupState.propsCache.get("columns")),
|
|
8682
9172
|
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : {},
|
|
8683
9173
|
columnPinning: (columnPinning) => toMap(columnPinning, setupState.propsCache.get("columnPinning")),
|
|
@@ -8723,7 +9213,7 @@ var mapPropsToState2 = (params) => {
|
|
|
8723
9213
|
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
|
|
8724
9214
|
computedColumnGroups,
|
|
8725
9215
|
rowHeightCSSVar: typeof props.rowHeight === "string" ? props.rowHeight : "",
|
|
8726
|
-
|
|
9216
|
+
columnHeaderHeightCSSVar: typeof props.columnHeaderHeight === "string" ? props.columnHeaderHeight || ThemeVars.components.Header.columnHeaderHeight : ""
|
|
8727
9217
|
};
|
|
8728
9218
|
};
|
|
8729
9219
|
|
|
@@ -8736,7 +9226,7 @@ var InfiniteTableRoot = getComponentStateRoot({
|
|
|
8736
9226
|
mapPropsToState: mapPropsToState2,
|
|
8737
9227
|
allowedControlledPropOverrides: {
|
|
8738
9228
|
rowHeight: true,
|
|
8739
|
-
|
|
9229
|
+
columnHeaderHeight: true
|
|
8740
9230
|
},
|
|
8741
9231
|
getParentState: () => useDataSource(),
|
|
8742
9232
|
debugName: "InfiniteTable"
|
|
@@ -8757,9 +9247,9 @@ var InfiniteTableComponent = memo9(function InfiniteTableComponent2() {
|
|
|
8757
9247
|
loadingText,
|
|
8758
9248
|
header,
|
|
8759
9249
|
onRowHeightCSSVarChange,
|
|
8760
|
-
|
|
9250
|
+
onColumnHeaderHeightCSSVarChange,
|
|
8761
9251
|
rowHeightCSSVar,
|
|
8762
|
-
|
|
9252
|
+
columnHeaderHeightCSSVar,
|
|
8763
9253
|
components,
|
|
8764
9254
|
scrollStopDelay,
|
|
8765
9255
|
brain,
|
|
@@ -8774,7 +9264,7 @@ var InfiniteTableComponent = memo9(function InfiniteTableComponent2() {
|
|
|
8774
9264
|
bodySize,
|
|
8775
9265
|
computed
|
|
8776
9266
|
});
|
|
8777
|
-
|
|
9267
|
+
useEffect24(() => {
|
|
8778
9268
|
const dataSourceState = getDataSourceState();
|
|
8779
9269
|
const onChange = debounce((renderRange) => {
|
|
8780
9270
|
dataSourceState.notifyRenderRangeChange({
|
|
@@ -8787,35 +9277,35 @@ var InfiniteTableComponent = memo9(function InfiniteTableComponent2() {
|
|
|
8787
9277
|
const licenseValid = useLicense(licenseKey);
|
|
8788
9278
|
const domProps = useDOMProps(componentState.domProps);
|
|
8789
9279
|
const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
|
|
8790
|
-
|
|
9280
|
+
useEffect24(() => {
|
|
8791
9281
|
brain.setScrollStopDelay(scrollStopDelay);
|
|
8792
9282
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
8793
9283
|
}, [scrollStopDelay]);
|
|
8794
9284
|
useAutoSizeColumns();
|
|
8795
|
-
return /* @__PURE__ */
|
|
9285
|
+
return /* @__PURE__ */ createElement24("div", __spreadValues({
|
|
8796
9286
|
ref: domRef
|
|
8797
|
-
}, domProps), header ? /* @__PURE__ */
|
|
9287
|
+
}, domProps), header ? /* @__PURE__ */ createElement24(TableHeaderWrapper, {
|
|
8798
9288
|
brain: headerBrain,
|
|
8799
9289
|
scrollbars
|
|
8800
|
-
}) : null, /* @__PURE__ */
|
|
9290
|
+
}) : null, /* @__PURE__ */ createElement24(InfiniteTableBody, null, /* @__PURE__ */ createElement24(HeadlessTable, {
|
|
8801
9291
|
tabIndex: 0,
|
|
8802
9292
|
scrollStopDelay,
|
|
8803
9293
|
brain,
|
|
8804
9294
|
renderCell,
|
|
8805
9295
|
cellHoverClassNames: HOVERED_CLASS_NAMES,
|
|
8806
9296
|
scrollerDOMRef
|
|
8807
|
-
}), /* @__PURE__ */
|
|
9297
|
+
}), /* @__PURE__ */ createElement24(LoadMaskCmp, {
|
|
8808
9298
|
visible: loading
|
|
8809
|
-
}, loadingText)),
|
|
9299
|
+
}, loadingText)), /* @__PURE__ */ createElement24("div", {
|
|
8810
9300
|
ref: portalDOMRef,
|
|
8811
9301
|
className: join(`${rootClassName2}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
|
|
8812
|
-
}), rowHeightCSSVar ? /* @__PURE__ */
|
|
9302
|
+
}), rowHeightCSSVar ? /* @__PURE__ */ createElement24(CSSVariableWatch, {
|
|
8813
9303
|
varName: rowHeightCSSVar,
|
|
8814
9304
|
onChange: onRowHeightCSSVarChange
|
|
8815
|
-
}) : null,
|
|
8816
|
-
varName:
|
|
8817
|
-
onChange:
|
|
8818
|
-
}) : null);
|
|
9305
|
+
}) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ createElement24(CSSVariableWatch, {
|
|
9306
|
+
varName: columnHeaderHeightCSSVar,
|
|
9307
|
+
onChange: onColumnHeaderHeightCSSVarChange
|
|
9308
|
+
}) : null, /* @__PURE__ */ createElement24(InfiniteTableFooter, null), licenseValid ? null : /* @__PURE__ */ createElement24(InfiniteTableLicenseFooter, null));
|
|
8819
9309
|
});
|
|
8820
9310
|
function InfiniteTableContextProvider() {
|
|
8821
9311
|
const { componentActions, componentState } = useComponentState();
|
|
@@ -8843,29 +9333,29 @@ function InfiniteTableContextProvider() {
|
|
|
8843
9333
|
bodySize.width = (_b = (_a = scrollerDOMRef.current) == null ? void 0 : _a.scrollWidth) != null ? _b : bodySize.width;
|
|
8844
9334
|
componentActions.bodySize = bodySize;
|
|
8845
9335
|
}, { earlyAttach: true });
|
|
8846
|
-
|
|
9336
|
+
useEffect24(() => {
|
|
8847
9337
|
return () => {
|
|
8848
9338
|
componentState.onRowHeightCSSVarChange.destroy();
|
|
8849
|
-
componentState.
|
|
9339
|
+
componentState.onColumnHeaderHeightCSSVarChange.destroy();
|
|
8850
9340
|
};
|
|
8851
9341
|
}, []);
|
|
8852
|
-
|
|
9342
|
+
useEffect24(() => {
|
|
8853
9343
|
if (scrollerDOMRef.current) {
|
|
8854
9344
|
scrollerDOMRef.current.scrollTop = 0;
|
|
8855
9345
|
}
|
|
8856
9346
|
}, [scrollTopKey, scrollerDOMRef]);
|
|
8857
9347
|
const TableContext2 = getInfiniteTableContext();
|
|
8858
|
-
return /* @__PURE__ */
|
|
9348
|
+
return /* @__PURE__ */ createElement24(TableContext2.Provider, {
|
|
8859
9349
|
value: contextValue
|
|
8860
|
-
}, /* @__PURE__ */
|
|
9350
|
+
}, /* @__PURE__ */ createElement24(InfiniteTableComponent, null));
|
|
8861
9351
|
}
|
|
8862
9352
|
function InfiniteTable(props) {
|
|
8863
|
-
const table = /* @__PURE__ */
|
|
8864
|
-
return /* @__PURE__ */
|
|
9353
|
+
const table = /* @__PURE__ */ createElement24(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ createElement24(InfiniteTableContextProvider, null));
|
|
9354
|
+
return /* @__PURE__ */ createElement24(StrictMode, null, table);
|
|
8865
9355
|
}
|
|
8866
9356
|
InfiniteTable.defaultProps = {
|
|
8867
9357
|
rowHeight: 40,
|
|
8868
|
-
|
|
9358
|
+
columnHeaderHeight: ThemeVars.components.Header.columnHeaderHeight
|
|
8869
9359
|
};
|
|
8870
9360
|
export {
|
|
8871
9361
|
DataSource,
|
|
@@ -8874,7 +9364,12 @@ export {
|
|
|
8874
9364
|
InfiniteTable,
|
|
8875
9365
|
InfiniteTableClassName,
|
|
8876
9366
|
InfiniteTableComponent,
|
|
9367
|
+
NumberFilterEditor,
|
|
9368
|
+
StringFilterEditor,
|
|
8877
9369
|
debounce,
|
|
9370
|
+
defaultFilterEditors,
|
|
9371
|
+
defaultFilterTypes,
|
|
9372
|
+
defaultFilterTypes as filterTypes,
|
|
8878
9373
|
flatten,
|
|
8879
9374
|
getComponentStateRoot,
|
|
8880
9375
|
group,
|