@infinite-table/infinite-react 0.3.3 → 0.3.6
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/LICENSE.md +1 -1
- package/index.css +116 -61
- package/index.d.ts +122 -9
- package/index.esm.css +116 -61
- package/index.esm.js +960 -358
- package/index.js +961 -365
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -636,10 +636,11 @@ function debounce(fn, { wait }) {
|
|
|
636
636
|
// src/components/InfiniteTable/index.tsx
|
|
637
637
|
import {
|
|
638
638
|
StrictMode,
|
|
639
|
-
createElement as
|
|
640
|
-
memo as
|
|
641
|
-
useEffect as
|
|
639
|
+
createElement as createElement26,
|
|
640
|
+
memo as memo11,
|
|
641
|
+
useEffect as useEffect26
|
|
642
642
|
} from "react";
|
|
643
|
+
import { useCallback as useCallback16, useEffect as useEffect27, useState as useState15 } from "react";
|
|
643
644
|
|
|
644
645
|
// src/utils/join.ts
|
|
645
646
|
var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
|
|
@@ -865,13 +866,13 @@ function useDataSourceContextValue() {
|
|
|
865
866
|
|
|
866
867
|
// src/components/HeadlessTable/index.tsx
|
|
867
868
|
import {
|
|
868
|
-
createElement as
|
|
869
|
+
createElement as createElement8
|
|
869
870
|
} from "react";
|
|
870
871
|
import {
|
|
871
|
-
useCallback as
|
|
872
|
-
useEffect as
|
|
873
|
-
useRef as
|
|
874
|
-
useState as
|
|
872
|
+
useCallback as useCallback4,
|
|
873
|
+
useEffect as useEffect7,
|
|
874
|
+
useRef as useRef7,
|
|
875
|
+
useState as useState5
|
|
875
876
|
} from "react";
|
|
876
877
|
|
|
877
878
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
@@ -2520,6 +2521,171 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
2520
2521
|
this.items = [];
|
|
2521
2522
|
this.currentHoveredRow = -1;
|
|
2522
2523
|
this.hoverRowUpdatesInProgress = new Map();
|
|
2524
|
+
this.getFullyVisibleRowsRange = () => {
|
|
2525
|
+
let {
|
|
2526
|
+
start: [startRow],
|
|
2527
|
+
end: [endRow]
|
|
2528
|
+
} = this.brain.getRenderRange();
|
|
2529
|
+
while (!this.isRowFullyVisible(startRow)) {
|
|
2530
|
+
startRow++;
|
|
2531
|
+
if (startRow === endRow) {
|
|
2532
|
+
return null;
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
while (!this.isRowFullyVisible(endRow)) {
|
|
2536
|
+
endRow--;
|
|
2537
|
+
if (endRow === startRow) {
|
|
2538
|
+
return null;
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
return { start: startRow, end: endRow };
|
|
2542
|
+
};
|
|
2543
|
+
this.getScrollPositionForScrollRowIntoView = (rowIndex, config = { offset: 0 }) => {
|
|
2544
|
+
const { brain } = this;
|
|
2545
|
+
const scrollPosition = brain.getScrollPosition();
|
|
2546
|
+
let { scrollAdjustPosition, offset = 0 } = config;
|
|
2547
|
+
if (this.isRowFullyVisible(rowIndex) && !scrollAdjustPosition) {
|
|
2548
|
+
return scrollPosition;
|
|
2549
|
+
}
|
|
2550
|
+
const rowOffset = brain.getItemOffsetFor(rowIndex, "vertical");
|
|
2551
|
+
const rowHeight = brain.getItemSize(rowIndex, "vertical");
|
|
2552
|
+
const top2 = scrollPosition.scrollTop;
|
|
2553
|
+
const availableSize = brain.getAvailableSize();
|
|
2554
|
+
const bottom = top2 + availableSize.height;
|
|
2555
|
+
if (!scrollAdjustPosition) {
|
|
2556
|
+
scrollAdjustPosition = rowOffset > bottom ? "end" : rowOffset < top2 ? "start" : "end";
|
|
2557
|
+
}
|
|
2558
|
+
let scrollTop = scrollPosition.scrollTop;
|
|
2559
|
+
if (scrollAdjustPosition === "center") {
|
|
2560
|
+
scrollTop = rowOffset - Math.floor(brain.getAvailableSize().height / 2);
|
|
2561
|
+
} else if (scrollAdjustPosition === "start") {
|
|
2562
|
+
offset = -offset;
|
|
2563
|
+
scrollTop += rowOffset - top2 + offset;
|
|
2564
|
+
} else {
|
|
2565
|
+
offset += rowHeight;
|
|
2566
|
+
scrollTop += rowOffset - bottom + offset;
|
|
2567
|
+
}
|
|
2568
|
+
return __spreadProps(__spreadValues({}, scrollPosition), {
|
|
2569
|
+
scrollTop
|
|
2570
|
+
});
|
|
2571
|
+
};
|
|
2572
|
+
this.getScrollPositionForScrollColumnIntoView = (colIndex, config = { offset: 0 }) => {
|
|
2573
|
+
const { brain } = this;
|
|
2574
|
+
const scrollPosition = brain.getScrollPosition();
|
|
2575
|
+
let { scrollAdjustPosition, offset = 0 } = config;
|
|
2576
|
+
if (this.isColumnFullyVisible(colIndex) && !scrollAdjustPosition) {
|
|
2577
|
+
return scrollPosition;
|
|
2578
|
+
}
|
|
2579
|
+
const rowOffset = brain.getItemOffsetFor(colIndex, "horizontal");
|
|
2580
|
+
const colWidth = brain.getItemSize(colIndex, "horizontal");
|
|
2581
|
+
const left2 = scrollPosition.scrollLeft;
|
|
2582
|
+
const availableSize = brain.getAvailableSize();
|
|
2583
|
+
const right = left2 + availableSize.width;
|
|
2584
|
+
if (!scrollAdjustPosition) {
|
|
2585
|
+
scrollAdjustPosition = rowOffset > right ? "end" : rowOffset < left2 ? "start" : "end";
|
|
2586
|
+
}
|
|
2587
|
+
let scrollLeft = scrollPosition.scrollLeft;
|
|
2588
|
+
if (scrollAdjustPosition === "center") {
|
|
2589
|
+
scrollLeft = rowOffset - Math.floor(brain.getAvailableSize().width / 2);
|
|
2590
|
+
} else if (scrollAdjustPosition === "start") {
|
|
2591
|
+
offset = -offset;
|
|
2592
|
+
scrollLeft += rowOffset - left2 + offset;
|
|
2593
|
+
} else {
|
|
2594
|
+
offset += colWidth;
|
|
2595
|
+
scrollLeft += rowOffset - right + offset;
|
|
2596
|
+
}
|
|
2597
|
+
return __spreadProps(__spreadValues({}, scrollPosition), {
|
|
2598
|
+
scrollLeft
|
|
2599
|
+
});
|
|
2600
|
+
};
|
|
2601
|
+
this.getScrollPositionForScrollCellIntoView = (rowIndex, colIndex, config = { offsetLeft: 0, offsetTop: 0 }) => {
|
|
2602
|
+
const { scrollLeft } = this.getScrollPositionForScrollColumnIntoView(colIndex, {
|
|
2603
|
+
scrollAdjustPosition: config.colScrollAdjustPosition || config.scrollAdjustPosition,
|
|
2604
|
+
offset: config.offsetLeft
|
|
2605
|
+
});
|
|
2606
|
+
const { scrollTop } = this.getScrollPositionForScrollRowIntoView(rowIndex, {
|
|
2607
|
+
scrollAdjustPosition: config.rowScrollAdjustPosition || config.scrollAdjustPosition,
|
|
2608
|
+
offset: config.offsetTop
|
|
2609
|
+
});
|
|
2610
|
+
return { scrollLeft, scrollTop };
|
|
2611
|
+
};
|
|
2612
|
+
this.isRowFullyVisible = (rowIndex, offsetMargin = 2) => {
|
|
2613
|
+
return this.isRowVisible(rowIndex, this.brain.getRowHeight(rowIndex) - offsetMargin);
|
|
2614
|
+
};
|
|
2615
|
+
this.isRowVisible = (rowIndex, offsetMargin = 10) => {
|
|
2616
|
+
if (!this.isRowRendered(rowIndex)) {
|
|
2617
|
+
return false;
|
|
2618
|
+
}
|
|
2619
|
+
const { brain } = this;
|
|
2620
|
+
const {
|
|
2621
|
+
start: [startRow],
|
|
2622
|
+
end: [endRow]
|
|
2623
|
+
} = this.brain.getRenderRange();
|
|
2624
|
+
const midRow = Math.floor((startRow + endRow) / 2);
|
|
2625
|
+
if (rowIndex < startRow) {
|
|
2626
|
+
return false;
|
|
2627
|
+
}
|
|
2628
|
+
if (rowIndex >= endRow) {
|
|
2629
|
+
return false;
|
|
2630
|
+
}
|
|
2631
|
+
if (rowIndex >= midRow) {
|
|
2632
|
+
const lastVisibleRow = brain.getItemAt(brain.getAvailableSize().height + brain.getScrollPosition().scrollTop - offsetMargin, "vertical");
|
|
2633
|
+
return rowIndex <= lastVisibleRow;
|
|
2634
|
+
}
|
|
2635
|
+
if (rowIndex < midRow) {
|
|
2636
|
+
const firstVisibleRow = brain.getItemAt(brain.getScrollPosition().scrollTop + offsetMargin, "vertical");
|
|
2637
|
+
return rowIndex >= firstVisibleRow;
|
|
2638
|
+
}
|
|
2639
|
+
return true;
|
|
2640
|
+
};
|
|
2641
|
+
this.isRowRendered = (rowIndex) => {
|
|
2642
|
+
const elements = this.mappedCells.getElementsForRowIndex(rowIndex);
|
|
2643
|
+
return elements.length > 0;
|
|
2644
|
+
};
|
|
2645
|
+
this.isCellVisible = (rowIndex, colIndex) => {
|
|
2646
|
+
return this.isRowVisible(rowIndex) && this.isColumnVisible(colIndex);
|
|
2647
|
+
};
|
|
2648
|
+
this.isCellFullyVisible = (rowIndex, colIndex) => {
|
|
2649
|
+
return this.isRowFullyVisible(rowIndex) && this.isColumnVisible(colIndex);
|
|
2650
|
+
};
|
|
2651
|
+
this.isColumnFullyVisible = (colIndex, offsetMargin = 2) => {
|
|
2652
|
+
return this.isColumnVisible(colIndex, this.brain.getColWidth(colIndex) - offsetMargin);
|
|
2653
|
+
};
|
|
2654
|
+
this.isColumnVisible = (colIndex, offsetMargin = 10) => {
|
|
2655
|
+
if (!this.isColumnRendered(colIndex)) {
|
|
2656
|
+
return false;
|
|
2657
|
+
}
|
|
2658
|
+
const { brain } = this;
|
|
2659
|
+
const {
|
|
2660
|
+
start: [_, startCol],
|
|
2661
|
+
end: [__, endCol]
|
|
2662
|
+
} = brain.getRenderRange();
|
|
2663
|
+
const midCol = Math.floor((startCol + endCol) / 2);
|
|
2664
|
+
if (colIndex < startCol) {
|
|
2665
|
+
return false;
|
|
2666
|
+
}
|
|
2667
|
+
if (colIndex >= endCol) {
|
|
2668
|
+
return false;
|
|
2669
|
+
}
|
|
2670
|
+
if (colIndex >= midCol) {
|
|
2671
|
+
const lastVisibleCol = brain.getItemAt(brain.getAvailableSize().width + brain.getScrollPosition().scrollLeft - offsetMargin, "horizontal");
|
|
2672
|
+
return colIndex <= lastVisibleCol;
|
|
2673
|
+
}
|
|
2674
|
+
if (colIndex < midCol) {
|
|
2675
|
+
const firstVisibleCol = brain.getItemAt(brain.getScrollPosition().scrollLeft + offsetMargin, "horizontal");
|
|
2676
|
+
return colIndex >= firstVisibleCol;
|
|
2677
|
+
}
|
|
2678
|
+
return true;
|
|
2679
|
+
};
|
|
2680
|
+
this.isCellRendered = (rowIndex, colIndex) => {
|
|
2681
|
+
return this.isRowRendered(rowIndex) && this.isColumnRendered(colIndex);
|
|
2682
|
+
};
|
|
2683
|
+
this.isColumnRendered = (colIndex) => {
|
|
2684
|
+
const {
|
|
2685
|
+
start: [startRow]
|
|
2686
|
+
} = this.brain.getRenderRange();
|
|
2687
|
+
return this.mappedCells.getRenderedNodeForCell(startRow, colIndex) !== null;
|
|
2688
|
+
};
|
|
2523
2689
|
this.getExtraSpanCellsForRange = (range) => {
|
|
2524
2690
|
const { start, end } = range;
|
|
2525
2691
|
const [startRow, startCol] = start;
|
|
@@ -3096,8 +3262,11 @@ function createRenderer(brain) {
|
|
|
3096
3262
|
function RawTableFn(props) {
|
|
3097
3263
|
const { brain, renderCell } = props;
|
|
3098
3264
|
const { renderer, onRenderUpdater } = useMemo2(() => {
|
|
3099
|
-
return
|
|
3100
|
-
|
|
3265
|
+
return props.onRenderUpdater && props.renderer ? {
|
|
3266
|
+
renderer: props.renderer,
|
|
3267
|
+
onRenderUpdater: props.onRenderUpdater
|
|
3268
|
+
} : createRenderer(brain);
|
|
3269
|
+
}, [brain, props.onRenderUpdater, props.renderer]);
|
|
3101
3270
|
useEffect4(() => {
|
|
3102
3271
|
renderer.cellHoverClassNames = props.cellHoverClassNames || [];
|
|
3103
3272
|
}, [renderer, props.cellHoverClassNames]);
|
|
@@ -3131,6 +3300,150 @@ function RawTableFn(props) {
|
|
|
3131
3300
|
}
|
|
3132
3301
|
var RawTable = memo3(RawTableFn);
|
|
3133
3302
|
|
|
3303
|
+
// src/components/InfiniteTable/components/ActiveRowIndicator.tsx
|
|
3304
|
+
import {
|
|
3305
|
+
createElement as createElement6,
|
|
3306
|
+
memo as memo4
|
|
3307
|
+
} from "react";
|
|
3308
|
+
import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect3, useRef as useRef5, useState as useState3 } from "react";
|
|
3309
|
+
|
|
3310
|
+
// src/components/hooks/useRerender.ts
|
|
3311
|
+
import { useCallback as useCallback3, useState as useState2 } from "react";
|
|
3312
|
+
var useRerender = () => {
|
|
3313
|
+
const [state, setState] = useState2(0);
|
|
3314
|
+
return [
|
|
3315
|
+
state,
|
|
3316
|
+
useCallback3(() => {
|
|
3317
|
+
setState((state2) => state2 + 1);
|
|
3318
|
+
}, [setState])
|
|
3319
|
+
];
|
|
3320
|
+
};
|
|
3321
|
+
|
|
3322
|
+
// src/components/InfiniteTable/internalProps.ts
|
|
3323
|
+
var rootClassName2 = "Infinite";
|
|
3324
|
+
var internalProps = {
|
|
3325
|
+
rootClassName: rootClassName2
|
|
3326
|
+
};
|
|
3327
|
+
|
|
3328
|
+
// src/components/InfiniteTable/components/ActiveRowIndicator.css.ts
|
|
3329
|
+
var ActiveRowIndicatorCls = { visible: "j26lrx1 j26lrx0 _16lm1iwe _16lm1iw3 _16lm1iwt _16lm1iwu _16lm1iww", hidden: "j26lrx2 j26lrx0 _16lm1iwe _16lm1iw3 _16lm1iwt _16lm1iwu _16lm1iww" };
|
|
3330
|
+
|
|
3331
|
+
// src/components/InfiniteTable/components/ActiveRowIndicator.tsx
|
|
3332
|
+
var { rootClassName: rootClassName3 } = internalProps;
|
|
3333
|
+
var baseCls = `${rootClassName3}-ActiveRowIndicator`;
|
|
3334
|
+
var ActiveRowIndicatorFn = (props) => {
|
|
3335
|
+
const { brain } = props;
|
|
3336
|
+
const [state, setState] = useState3({
|
|
3337
|
+
top: 0,
|
|
3338
|
+
rowHeight: 0
|
|
3339
|
+
});
|
|
3340
|
+
const domRef = useRef5(null);
|
|
3341
|
+
const stateRef = useRef5(state);
|
|
3342
|
+
const active = props.activeRowIndex != null && brain.getRowCount() > props.activeRowIndex;
|
|
3343
|
+
const [rerenderId, rerender] = useRerender();
|
|
3344
|
+
useLayoutEffect3(() => {
|
|
3345
|
+
if (props.activeRowIndex == null) {
|
|
3346
|
+
return;
|
|
3347
|
+
}
|
|
3348
|
+
setState(stateRef.current = {
|
|
3349
|
+
top: brain.getItemOffsetFor(props.activeRowIndex, "vertical"),
|
|
3350
|
+
rowHeight: brain.getRowHeight(props.activeRowIndex)
|
|
3351
|
+
});
|
|
3352
|
+
}, [props.activeRowIndex, rerenderId]);
|
|
3353
|
+
useEffect5(() => {
|
|
3354
|
+
const removeOnScroll = brain.onScroll((scrollPos) => {
|
|
3355
|
+
const node = domRef.current;
|
|
3356
|
+
const topOffset = stateRef.current.top;
|
|
3357
|
+
node.style.transform = `translate3d(0px, ${-scrollPos.scrollTop + topOffset}px, 0px)`;
|
|
3358
|
+
});
|
|
3359
|
+
const removeOnRenderCountChange = brain.onRenderCountChange(rerender);
|
|
3360
|
+
return () => {
|
|
3361
|
+
removeOnRenderCountChange();
|
|
3362
|
+
removeOnScroll();
|
|
3363
|
+
};
|
|
3364
|
+
}, [brain]);
|
|
3365
|
+
return /* @__PURE__ */ createElement6("div", {
|
|
3366
|
+
ref: domRef,
|
|
3367
|
+
"data-name": "active-row-indicator",
|
|
3368
|
+
className: `${baseCls} ${active ? ActiveRowIndicatorCls.visible : ActiveRowIndicatorCls.hidden}`,
|
|
3369
|
+
style: active ? {
|
|
3370
|
+
transform: `translate3d(0px, ${-brain.getScrollPosition().scrollTop + state.top}px,0)`,
|
|
3371
|
+
height: state.rowHeight
|
|
3372
|
+
} : void 0
|
|
3373
|
+
});
|
|
3374
|
+
};
|
|
3375
|
+
var ActiveRowIndicator = memo4(ActiveRowIndicatorFn);
|
|
3376
|
+
|
|
3377
|
+
// src/components/InfiniteTable/components/ActiveCellIndicator.tsx
|
|
3378
|
+
import {
|
|
3379
|
+
createElement as createElement7,
|
|
3380
|
+
memo as memo5
|
|
3381
|
+
} from "react";
|
|
3382
|
+
import { useEffect as useEffect6, useLayoutEffect as useLayoutEffect4, useRef as useRef6, useState as useState4 } from "react";
|
|
3383
|
+
|
|
3384
|
+
// src/components/InfiniteTable/components/ActiveCellIndicator.css.ts
|
|
3385
|
+
var ActiveCellIndicatorCls = { visible: "nxbq1c1 nxbq1c0 _16lm1iwe _16lm1iw3 _16lm1iww _16lm1iwu", hidden: "nxbq1c2 nxbq1c0 _16lm1iwe _16lm1iw3 _16lm1iww _16lm1iwu" };
|
|
3386
|
+
|
|
3387
|
+
// src/components/InfiniteTable/components/ActiveCellIndicator.tsx
|
|
3388
|
+
var { rootClassName: rootClassName4 } = internalProps;
|
|
3389
|
+
var baseCls2 = `${rootClassName4}-ActiveCellIndicator`;
|
|
3390
|
+
var ActiveCellIndicatorFn = (props) => {
|
|
3391
|
+
const { brain } = props;
|
|
3392
|
+
const [rerenderId, rerender] = useRerender();
|
|
3393
|
+
const [state, setState] = useState4({
|
|
3394
|
+
top: 0,
|
|
3395
|
+
rowHeight: 0,
|
|
3396
|
+
colWidth: 0,
|
|
3397
|
+
left: 0
|
|
3398
|
+
});
|
|
3399
|
+
const domRef = useRef6(null);
|
|
3400
|
+
const stateRef = useRef6(state);
|
|
3401
|
+
const active = props.activeCellIndex != null && brain.getRowCount() > props.activeCellIndex[0];
|
|
3402
|
+
useLayoutEffect4(() => {
|
|
3403
|
+
if (props.activeCellIndex == null) {
|
|
3404
|
+
return;
|
|
3405
|
+
}
|
|
3406
|
+
const rowIndex = props.activeCellIndex[0];
|
|
3407
|
+
setState(stateRef.current = {
|
|
3408
|
+
top: brain.getItemOffsetFor(rowIndex, "vertical"),
|
|
3409
|
+
rowHeight: brain.getRowHeight(rowIndex),
|
|
3410
|
+
left: brain.getItemOffsetFor(props.activeCellIndex[1], "horizontal"),
|
|
3411
|
+
colWidth: brain.getColWidth(props.activeCellIndex[1])
|
|
3412
|
+
});
|
|
3413
|
+
}, [props.activeCellIndex, rerenderId]);
|
|
3414
|
+
useEffect6(() => {
|
|
3415
|
+
const removeOnSCroll = brain.onScroll((scrollPos) => {
|
|
3416
|
+
const node = domRef.current;
|
|
3417
|
+
const topOffset = stateRef.current.top;
|
|
3418
|
+
const leftOffset = stateRef.current.left;
|
|
3419
|
+
node.style.transform = `translate3d(${-scrollPos.scrollLeft + leftOffset}px, ${-scrollPos.scrollTop + topOffset}px, 0px)`;
|
|
3420
|
+
});
|
|
3421
|
+
const removeOnRenderCountChange = brain.onRenderCountChange(() => {
|
|
3422
|
+
rerender();
|
|
3423
|
+
});
|
|
3424
|
+
const removeOnAvailableSizeChange = brain.onAvailableSizeChange(() => {
|
|
3425
|
+
rerender();
|
|
3426
|
+
});
|
|
3427
|
+
return () => {
|
|
3428
|
+
removeOnAvailableSizeChange();
|
|
3429
|
+
removeOnRenderCountChange();
|
|
3430
|
+
removeOnSCroll();
|
|
3431
|
+
};
|
|
3432
|
+
}, [brain]);
|
|
3433
|
+
const scrollPosition = brain.getScrollPosition();
|
|
3434
|
+
return /* @__PURE__ */ createElement7("div", {
|
|
3435
|
+
ref: domRef,
|
|
3436
|
+
"data-name": "active-cell-indicator",
|
|
3437
|
+
className: `${baseCls2} ${active ? ActiveCellIndicatorCls.visible : ActiveCellIndicatorCls.hidden}`,
|
|
3438
|
+
style: active ? {
|
|
3439
|
+
transform: `translate3d(${-scrollPosition.scrollLeft + state.left}px, ${-scrollPosition.scrollTop + state.top}px,0)`,
|
|
3440
|
+
width: state.colWidth,
|
|
3441
|
+
height: state.rowHeight
|
|
3442
|
+
} : void 0
|
|
3443
|
+
});
|
|
3444
|
+
};
|
|
3445
|
+
var ActiveCellIndicator = memo5(ActiveCellIndicatorFn);
|
|
3446
|
+
|
|
3134
3447
|
// src/components/HeadlessTable/index.tsx
|
|
3135
3448
|
function useMatrixBrain(brain, brainOptions, fixedCellsInfo) {
|
|
3136
3449
|
if (fixedCellsInfo && (fixedCellsInfo.fixedColsStart || fixedCellsInfo.fixedColsEnd || fixedCellsInfo.fixedRowsStart || fixedCellsInfo.fixedRowsEnd)) {
|
|
@@ -3158,25 +3471,33 @@ function HeadlessTable(props) {
|
|
|
3158
3471
|
scrollerDOMRef,
|
|
3159
3472
|
scrollStopDelay,
|
|
3160
3473
|
renderCell,
|
|
3161
|
-
cellHoverClassNames
|
|
3474
|
+
cellHoverClassNames,
|
|
3475
|
+
renderer,
|
|
3476
|
+
activeRowIndex,
|
|
3477
|
+
activeCellIndex,
|
|
3478
|
+
onRenderUpdater
|
|
3162
3479
|
} = _a, domProps = __objRest(_a, [
|
|
3163
3480
|
"brain",
|
|
3164
3481
|
"scrollerDOMRef",
|
|
3165
3482
|
"scrollStopDelay",
|
|
3166
3483
|
"renderCell",
|
|
3167
|
-
"cellHoverClassNames"
|
|
3484
|
+
"cellHoverClassNames",
|
|
3485
|
+
"renderer",
|
|
3486
|
+
"activeRowIndex",
|
|
3487
|
+
"activeCellIndex",
|
|
3488
|
+
"onRenderUpdater"
|
|
3168
3489
|
]);
|
|
3169
|
-
const domRef =
|
|
3170
|
-
const [scrollSize, setTotalScrollSize] =
|
|
3490
|
+
const domRef = useRef7(null);
|
|
3491
|
+
const [scrollSize, setTotalScrollSize] = useState5({
|
|
3171
3492
|
width: 0,
|
|
3172
3493
|
height: 0
|
|
3173
3494
|
});
|
|
3174
|
-
|
|
3495
|
+
useEffect7(() => {
|
|
3175
3496
|
if (scrollStopDelay != null) {
|
|
3176
3497
|
brain.setScrollStopDelay(scrollStopDelay);
|
|
3177
3498
|
}
|
|
3178
3499
|
}, [scrollStopDelay, brain]);
|
|
3179
|
-
|
|
3500
|
+
useEffect7(() => {
|
|
3180
3501
|
var _a2;
|
|
3181
3502
|
const node = (_a2 = domRef.current) == null ? void 0 : _a2.parentNode;
|
|
3182
3503
|
if (!node) {
|
|
@@ -3192,31 +3513,39 @@ function HeadlessTable(props) {
|
|
|
3192
3513
|
const remove = setupResizeObserver(node, onResize);
|
|
3193
3514
|
return remove;
|
|
3194
3515
|
}, []);
|
|
3195
|
-
const onContainerScroll =
|
|
3516
|
+
const onContainerScroll = useCallback4((scrollPos) => {
|
|
3196
3517
|
brain.setScrollPosition(scrollPos, (scrollPos2) => {
|
|
3197
3518
|
domRef.current.style.transform = `translate3d(${-scrollPos2.scrollLeft}px, ${-scrollPos2.scrollTop}px, 0px)`;
|
|
3198
3519
|
});
|
|
3199
3520
|
}, [brain]);
|
|
3200
|
-
|
|
3521
|
+
useEffect7(() => {
|
|
3201
3522
|
const removeOnRenderCount = brain.onRenderCountChange(() => {
|
|
3202
3523
|
setTotalScrollSize(brain.getTotalSize());
|
|
3203
3524
|
});
|
|
3204
3525
|
setTotalScrollSize(brain.getTotalSize());
|
|
3205
3526
|
return removeOnRenderCount;
|
|
3206
3527
|
}, [brain]);
|
|
3207
|
-
return /* @__PURE__ */
|
|
3528
|
+
return /* @__PURE__ */ createElement8(VirtualScrollContainer, __spreadProps(__spreadValues({
|
|
3208
3529
|
onContainerScroll
|
|
3209
3530
|
}, domProps), {
|
|
3210
3531
|
ref: scrollerDOMRef
|
|
3211
|
-
}), /* @__PURE__ */
|
|
3532
|
+
}), /* @__PURE__ */ createElement8("div", {
|
|
3212
3533
|
ref: domRef,
|
|
3213
3534
|
className: scrollTransformTargetCls,
|
|
3214
3535
|
"data-name": "scroll-transform-target"
|
|
3215
|
-
}, /* @__PURE__ */
|
|
3536
|
+
}, /* @__PURE__ */ createElement8(RawTable, {
|
|
3537
|
+
renderer,
|
|
3538
|
+
onRenderUpdater,
|
|
3216
3539
|
renderCell,
|
|
3217
3540
|
brain,
|
|
3218
3541
|
cellHoverClassNames
|
|
3219
|
-
})), /* @__PURE__ */
|
|
3542
|
+
})), /* @__PURE__ */ createElement8(ActiveRowIndicator, {
|
|
3543
|
+
brain,
|
|
3544
|
+
activeRowIndex
|
|
3545
|
+
}), /* @__PURE__ */ createElement8(ActiveCellIndicator, {
|
|
3546
|
+
brain,
|
|
3547
|
+
activeCellIndex
|
|
3548
|
+
}), /* @__PURE__ */ createElement8(SpacePlaceholder, {
|
|
3220
3549
|
width: scrollSize.width,
|
|
3221
3550
|
height: scrollSize.height
|
|
3222
3551
|
}));
|
|
@@ -3224,17 +3553,17 @@ function HeadlessTable(props) {
|
|
|
3224
3553
|
|
|
3225
3554
|
// src/components/hooks/useComponentState/index.tsx
|
|
3226
3555
|
import {
|
|
3227
|
-
createElement as
|
|
3228
|
-
memo as
|
|
3556
|
+
createElement as createElement9,
|
|
3557
|
+
memo as memo6,
|
|
3229
3558
|
useContext as useContext2
|
|
3230
3559
|
} from "react";
|
|
3231
3560
|
import {
|
|
3232
3561
|
useReducer,
|
|
3233
3562
|
createContext as createContext2,
|
|
3234
3563
|
useMemo as useMemo3,
|
|
3235
|
-
useEffect as
|
|
3236
|
-
useState as
|
|
3237
|
-
useRef as
|
|
3564
|
+
useEffect as useEffect8,
|
|
3565
|
+
useState as useState6,
|
|
3566
|
+
useRef as useRef10
|
|
3238
3567
|
} from "react";
|
|
3239
3568
|
|
|
3240
3569
|
// src/utils/proxyFnCall.ts
|
|
@@ -3278,18 +3607,18 @@ function isControlled(propName, props) {
|
|
|
3278
3607
|
}
|
|
3279
3608
|
|
|
3280
3609
|
// src/components/hooks/useLatest.tsx
|
|
3281
|
-
import { useCallback as
|
|
3610
|
+
import { useCallback as useCallback5, useRef as useRef8 } from "react";
|
|
3282
3611
|
function useLatest(value) {
|
|
3283
|
-
const ref =
|
|
3612
|
+
const ref = useRef8(value);
|
|
3284
3613
|
ref.current = value;
|
|
3285
|
-
return
|
|
3614
|
+
return useCallback5(() => ref.current, []);
|
|
3286
3615
|
}
|
|
3287
3616
|
|
|
3288
3617
|
// src/components/hooks/usePrevious.ts
|
|
3289
|
-
import { useRef as
|
|
3618
|
+
import { useRef as useRef9, useLayoutEffect as useLayoutEffect5 } from "react";
|
|
3290
3619
|
var usePrevious = (value, initialValue) => {
|
|
3291
|
-
const ref =
|
|
3292
|
-
|
|
3620
|
+
const ref = useRef9(initialValue === void 0 ? value : initialValue);
|
|
3621
|
+
useLayoutEffect5(() => {
|
|
3293
3622
|
ref.current = value;
|
|
3294
3623
|
});
|
|
3295
3624
|
return ref.current;
|
|
@@ -3369,16 +3698,16 @@ function forwardProps(propsToForward, props) {
|
|
|
3369
3698
|
return mappedState;
|
|
3370
3699
|
}
|
|
3371
3700
|
function getComponentStateRoot(config) {
|
|
3372
|
-
return
|
|
3701
|
+
return memo6(function ComponentStateRoot(props) {
|
|
3373
3702
|
var _a, _b;
|
|
3374
|
-
const [initialSetupState] =
|
|
3703
|
+
const [initialSetupState] = useState6(() => {
|
|
3375
3704
|
return config.initSetupState ? config.initSetupState() : {};
|
|
3376
3705
|
});
|
|
3377
|
-
const propsToStateSetRef =
|
|
3706
|
+
const propsToStateSetRef = useRef10(new Set());
|
|
3378
3707
|
const propsToForward = useMemo3(() => config.forwardProps ? config.forwardProps(initialSetupState) : {}, [initialSetupState]);
|
|
3379
3708
|
const parentState = (_b = (_a = config.getParentState) == null ? void 0 : _a.call(config)) != null ? _b : null;
|
|
3380
3709
|
const getParentState = useLatest(parentState);
|
|
3381
|
-
const [wholeState] =
|
|
3710
|
+
const [wholeState] = useState6(() => {
|
|
3382
3711
|
let mappedState = {};
|
|
3383
3712
|
if (propsToForward) {
|
|
3384
3713
|
mappedState = forwardProps(propsToForward, props);
|
|
@@ -3463,7 +3792,7 @@ function getComponentStateRoot(config) {
|
|
|
3463
3792
|
getComponentState
|
|
3464
3793
|
}), [state, actions, getComponentState]);
|
|
3465
3794
|
const prevProps = usePrevious(props);
|
|
3466
|
-
|
|
3795
|
+
useEffect8(() => {
|
|
3467
3796
|
const currentProps = props;
|
|
3468
3797
|
const newMappedState = {};
|
|
3469
3798
|
let newMappedStateCount = 0;
|
|
@@ -3519,7 +3848,7 @@ function getComponentStateRoot(config) {
|
|
|
3519
3848
|
}
|
|
3520
3849
|
}
|
|
3521
3850
|
});
|
|
3522
|
-
return /* @__PURE__ */
|
|
3851
|
+
return /* @__PURE__ */ createElement9(Context.Provider, {
|
|
3523
3852
|
value: contextValue
|
|
3524
3853
|
}, props.children);
|
|
3525
3854
|
});
|
|
@@ -3531,58 +3860,52 @@ function useComponentState() {
|
|
|
3531
3860
|
|
|
3532
3861
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
3533
3862
|
import {
|
|
3534
|
-
createElement as
|
|
3863
|
+
createElement as createElement10,
|
|
3535
3864
|
forwardRef as forwardRef2
|
|
3536
3865
|
} from "react";
|
|
3537
3866
|
|
|
3538
|
-
// src/components/InfiniteTable/internalProps.ts
|
|
3539
|
-
var rootClassName2 = "Infinite";
|
|
3540
|
-
var internalProps = {
|
|
3541
|
-
rootClassName: rootClassName2
|
|
3542
|
-
};
|
|
3543
|
-
|
|
3544
3867
|
// src/components/InfiniteTable/hooks/useInternalProps.ts
|
|
3545
3868
|
var useInternalProps = () => {
|
|
3546
3869
|
return internalProps;
|
|
3547
3870
|
};
|
|
3548
3871
|
|
|
3549
3872
|
// src/components/InfiniteTable/utilities.css.ts
|
|
3550
|
-
var alignItems = { center: "
|
|
3551
|
-
var cssEllipsisClassName = "
|
|
3873
|
+
var alignItems = { center: "_16lm1iw14", stretch: "_16lm1iw15" };
|
|
3874
|
+
var cssEllipsisClassName = "_16lm1iw1d _16lm1iw1e _16lm1iw19";
|
|
3552
3875
|
var cursor = { pointer: "_16lm1iwd" };
|
|
3553
|
-
var display = { flex: "
|
|
3554
|
-
var flex = { "1": "
|
|
3555
|
-
var flexFlow = { column: "
|
|
3556
|
-
var justifyContent = { center: "
|
|
3557
|
-
var left = { "0": "
|
|
3558
|
-
var overflow = { hidden: "
|
|
3876
|
+
var display = { flex: "_16lm1iwm", block: "_16lm1iwn", inlineBlock: "_16lm1iwo" };
|
|
3877
|
+
var flex = { "1": "_16lm1iwf", none: "_16lm1iwg" };
|
|
3878
|
+
var flexFlow = { column: "_16lm1iw12", row: "_16lm1iw13" };
|
|
3879
|
+
var justifyContent = { center: "_16lm1iw16", start: "_16lm1iw17", end: "_16lm1iw18" };
|
|
3880
|
+
var left = { "0": "_16lm1iww", "100%": "_16lm1iwx" };
|
|
3881
|
+
var overflow = { hidden: "_16lm1iw19", auto: "_16lm1iw1a", visible: "_16lm1iw1b" };
|
|
3559
3882
|
var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
|
|
3560
|
-
var top = { "0": "
|
|
3883
|
+
var top = { "0": "_16lm1iwu", "100%": "_16lm1iwv" };
|
|
3561
3884
|
var transformTranslateZero = "_16lm1iwa";
|
|
3562
|
-
var userSelect = { none: "
|
|
3563
|
-
var zIndex = { "1": "
|
|
3885
|
+
var userSelect = { none: "_16lm1iwp" };
|
|
3886
|
+
var zIndex = { "1": "_16lm1iwh", "10": "_16lm1iwi", "1000": "_16lm1iwj", "10000": "_16lm1iwk", "100000": "_16lm1iwl" };
|
|
3564
3887
|
|
|
3565
3888
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
3566
3889
|
var InfiniteTableBody = forwardRef2(function InfiniteTableBody2(props, ref) {
|
|
3567
|
-
const { rootClassName:
|
|
3568
|
-
return /* @__PURE__ */
|
|
3890
|
+
const { rootClassName: rootClassName11 } = useInternalProps();
|
|
3891
|
+
return /* @__PURE__ */ createElement10("div", __spreadProps(__spreadValues({
|
|
3569
3892
|
ref
|
|
3570
3893
|
}, props), {
|
|
3571
|
-
className: join(`${
|
|
3894
|
+
className: join(`${rootClassName11}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
|
|
3572
3895
|
}));
|
|
3573
3896
|
});
|
|
3574
3897
|
|
|
3575
3898
|
// src/components/InfiniteTable/components/InfiniteTableFooter/InfiniteTableFooter.tsx
|
|
3576
3899
|
import {
|
|
3577
|
-
createElement as
|
|
3900
|
+
createElement as createElement11,
|
|
3578
3901
|
forwardRef as forwardRef3
|
|
3579
3902
|
} from "react";
|
|
3580
3903
|
var InfiniteTableFooter = forwardRef3(function InfiniteTableFooter2(props, ref) {
|
|
3581
|
-
const { rootClassName:
|
|
3582
|
-
return /* @__PURE__ */
|
|
3904
|
+
const { rootClassName: rootClassName11 } = useInternalProps();
|
|
3905
|
+
return /* @__PURE__ */ createElement11("div", __spreadProps(__spreadValues({
|
|
3583
3906
|
ref
|
|
3584
3907
|
}, props), {
|
|
3585
|
-
className: join(`${
|
|
3908
|
+
className: join(`${rootClassName11}Footer`, position.relative, display.flex, flexFlow.row, props.className)
|
|
3586
3909
|
}));
|
|
3587
3910
|
});
|
|
3588
3911
|
|
|
@@ -3590,10 +3913,10 @@ var InfiniteTableFooter = forwardRef3(function InfiniteTableFooter2(props, ref)
|
|
|
3590
3913
|
import {
|
|
3591
3914
|
Fragment as Fragment2,
|
|
3592
3915
|
createContext as createContext4,
|
|
3593
|
-
createElement as
|
|
3916
|
+
createElement as createElement15,
|
|
3594
3917
|
useMemo as useMemo5
|
|
3595
3918
|
} from "react";
|
|
3596
|
-
import { useCallback as
|
|
3919
|
+
import { useCallback as useCallback7, useContext as useContext5, useEffect as useEffect11, useRef as useRef12 } from "react";
|
|
3597
3920
|
import { createPortal } from "react-dom";
|
|
3598
3921
|
|
|
3599
3922
|
// src/components/DataSource/defaultFilterTypes.ts
|
|
@@ -3666,6 +3989,7 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
3666
3989
|
firstInCategory: column.computedFirstInCategory,
|
|
3667
3990
|
lastInCategory: column.computedLastInCategory,
|
|
3668
3991
|
pinned: column.computedPinned || false,
|
|
3992
|
+
rowActive: extraFlags.rowActive,
|
|
3669
3993
|
dragging: extraFlags.dragging,
|
|
3670
3994
|
zebra: extraFlags.zebra
|
|
3671
3995
|
};
|
|
@@ -3697,10 +4021,10 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
3697
4021
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
3698
4022
|
var import_binary_search2 = __toModule(require_binary_search());
|
|
3699
4023
|
import {
|
|
3700
|
-
useCallback as
|
|
4024
|
+
useCallback as useCallback6,
|
|
3701
4025
|
useMemo as useMemo4,
|
|
3702
|
-
useRef as
|
|
3703
|
-
useState as
|
|
4026
|
+
useRef as useRef11,
|
|
4027
|
+
useState as useState7
|
|
3704
4028
|
} from "react";
|
|
3705
4029
|
|
|
3706
4030
|
// src/components/InfiniteTable/hooks/useInfiniteTable.ts
|
|
@@ -3754,13 +4078,13 @@ var useColumnPointerEvents = ({
|
|
|
3754
4078
|
columns,
|
|
3755
4079
|
computedRemainingSpace
|
|
3756
4080
|
}) => {
|
|
3757
|
-
const [draggingDiff, setDraggingDiff] =
|
|
3758
|
-
const [proxyOffset, setProxyOffset] =
|
|
3759
|
-
const breakpointsRef =
|
|
3760
|
-
const pointerMoveRef =
|
|
3761
|
-
const didDragRef =
|
|
3762
|
-
const initialClientPos =
|
|
3763
|
-
const currentDropIndexRef =
|
|
4081
|
+
const [draggingDiff, setDraggingDiff] = useState7(null);
|
|
4082
|
+
const [proxyOffset, setProxyOffset] = useState7(null);
|
|
4083
|
+
const breakpointsRef = useRef11([]);
|
|
4084
|
+
const pointerMoveRef = useRef11(null);
|
|
4085
|
+
const didDragRef = useRef11(false);
|
|
4086
|
+
const initialClientPos = useRef11(null);
|
|
4087
|
+
const currentDropIndexRef = useRef11(null);
|
|
3764
4088
|
const dragging = draggingDiff != null;
|
|
3765
4089
|
const { componentActions, computed } = useInfiniteTable();
|
|
3766
4090
|
const { computedColumnOrder } = computed;
|
|
@@ -3773,8 +4097,8 @@ var useColumnPointerEvents = ({
|
|
|
3773
4097
|
columnWidth: column.computedWidth
|
|
3774
4098
|
};
|
|
3775
4099
|
}, [columns, columnId, column]);
|
|
3776
|
-
let cursorRef =
|
|
3777
|
-
const onPointerDown =
|
|
4100
|
+
let cursorRef = useRef11("auto");
|
|
4101
|
+
const onPointerDown = useCallback6((e) => {
|
|
3778
4102
|
const target = domRef.current;
|
|
3779
4103
|
cursorRef.current = target.style.cursor;
|
|
3780
4104
|
didDragRef.current = false;
|
|
@@ -3837,7 +4161,7 @@ var useColumnPointerEvents = ({
|
|
|
3837
4161
|
target.addEventListener("pointermove", onPointerMove);
|
|
3838
4162
|
target.setPointerCapture(e.pointerId);
|
|
3839
4163
|
}, [columns, column, columnIndex, columnsArray, computedRemainingSpace]);
|
|
3840
|
-
const onPointerUp =
|
|
4164
|
+
const onPointerUp = useCallback6((e) => {
|
|
3841
4165
|
const target = domRef.current;
|
|
3842
4166
|
target.style.cursor = cursorRef.current;
|
|
3843
4167
|
target.releasePointerCapture(e.pointerId);
|
|
@@ -3877,7 +4201,7 @@ function RenderHookComponent(props) {
|
|
|
3877
4201
|
}
|
|
3878
4202
|
|
|
3879
4203
|
// src/components/InfiniteTable/components/FilterEditors.tsx
|
|
3880
|
-
import
|
|
4204
|
+
import React16 from "react";
|
|
3881
4205
|
function getFilterEditors() {
|
|
3882
4206
|
return {
|
|
3883
4207
|
string: StringFilterEditor,
|
|
@@ -3886,7 +4210,7 @@ function getFilterEditors() {
|
|
|
3886
4210
|
}
|
|
3887
4211
|
var defaultFilterEditors = getFilterEditors();
|
|
3888
4212
|
function StringFilterEditor(props) {
|
|
3889
|
-
return /* @__PURE__ */
|
|
4213
|
+
return /* @__PURE__ */ React16.createElement("input", {
|
|
3890
4214
|
"aria-label": `Filter for ${props.ariaLabel}`,
|
|
3891
4215
|
type: "text",
|
|
3892
4216
|
value: props.filterValue,
|
|
@@ -3897,7 +4221,7 @@ function StringFilterEditor(props) {
|
|
|
3897
4221
|
});
|
|
3898
4222
|
}
|
|
3899
4223
|
function NumberFilterEditor(props) {
|
|
3900
|
-
return /* @__PURE__ */
|
|
4224
|
+
return /* @__PURE__ */ React16.createElement("input", {
|
|
3901
4225
|
"aria-label": `Filter for ${props.ariaLabel}`,
|
|
3902
4226
|
type: "number",
|
|
3903
4227
|
value: props.filterValue,
|
|
@@ -3914,25 +4238,25 @@ function NumberFilterEditor(props) {
|
|
|
3914
4238
|
|
|
3915
4239
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
3916
4240
|
import {
|
|
3917
|
-
createElement as
|
|
4241
|
+
createElement as createElement12
|
|
3918
4242
|
} from "react";
|
|
3919
|
-
import { useEffect as
|
|
4243
|
+
import { useEffect as useEffect9, useState as useState8 } from "react";
|
|
3920
4244
|
|
|
3921
4245
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
3922
4246
|
var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
3923
|
-
var CellCls = "_1eexc2a5
|
|
3924
|
-
var HeaderCellContentRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "
|
|
4247
|
+
var CellCls = "_1eexc2a5 _16lm1iwm _16lm1iw13 _16lm1iw14 _16lm1iw2 _16lm1iw1c _16lm1iw1d";
|
|
4248
|
+
var HeaderCellContentRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob117 _16lm1iwr _16lm1iwt _16lm1iwm _16lm1iw13 _16lm1iw14", variantClassNames: { filtered: { false: "_12zfob118", true: "_12zfob119" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3925
4249
|
var HeaderCellProxy = "_12zfob10";
|
|
3926
|
-
var HeaderCellRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob1h
|
|
3927
|
-
var HeaderClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob17
|
|
3928
|
-
var HeaderFilterCls = "
|
|
3929
|
-
var HeaderFilterEditorCls = "
|
|
3930
|
-
var HeaderGroupCls = "
|
|
4250
|
+
var HeaderCellRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob1h _16lm1iwn", variantClassNames: { rowActive: { false: "_12zfob1i", true: "_12zfob1j" }, zebra: { false: "_12zfob1k", even: "_12zfob1l", odd: "_12zfob1m" }, dragging: { true: "_12zfob1n", false: "_12zfob1o" }, first: { true: "_12zfob1p", false: "_12zfob1q" }, last: { true: "_12zfob1r", false: "_12zfob1s" }, groupByField: { true: "_12zfob1t", false: "_12zfob1u" }, firstInCategory: { true: "_12zfob1v", false: "_12zfob1w" }, lastInCategory: { true: "_12zfob1x", false: "_12zfob1y" }, pinned: { start: "_12zfob1z", end: "_12zfob110", false: "_12zfob111" }, filtered: { true: "_12zfob112", false: "_12zfob113" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob114"], [{ pinned: "end", firstInCategory: true }, "_12zfob115"], [{ pinned: false, lastInCategory: true }, "_12zfob116"]] });
|
|
4251
|
+
var HeaderClsRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_12zfob17 _16lm1iwn _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"]] });
|
|
4252
|
+
var HeaderFilterCls = "_12zfob11c _16lm1iwm _16lm1iw13 _16lm1iw14 _16lm1iw1";
|
|
4253
|
+
var HeaderFilterEditorCls = "_16lm1iwt _16lm1iwr";
|
|
4254
|
+
var HeaderGroupCls = "_12zfob11b _16lm1iwm _16lm1iw13 _16lm1iw14";
|
|
3931
4255
|
var HeaderScrollbarPlaceholderCls = "_12zfob16 _16lm1iw2";
|
|
3932
4256
|
var HeaderSortIconCls = "_16lm1iw1";
|
|
3933
4257
|
var HeaderSortIconIndexCls = "_12zfob15";
|
|
3934
4258
|
var HeaderSortIconRecipe = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob12", center: "_12zfob13", end: "_12zfob14" } }, defaultVariants: {}, compoundVariants: [] });
|
|
3935
|
-
var HeaderWrapperCls = "
|
|
4259
|
+
var HeaderWrapperCls = "_12zfob11a _16lm1iw19 _16lm1iw1 _16lm1iwm _16lm1iw13";
|
|
3936
4260
|
|
|
3937
4261
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
3938
4262
|
var defaultLineStyle = {
|
|
@@ -3943,8 +4267,8 @@ var defaultLineStyle = {
|
|
|
3943
4267
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
3944
4268
|
function SortIcon(props) {
|
|
3945
4269
|
var _a;
|
|
3946
|
-
const [rendered, setRendered] =
|
|
3947
|
-
const [opacity, setOpacity] =
|
|
4270
|
+
const [rendered, setRendered] = useState8(true);
|
|
4271
|
+
const [opacity, setOpacity] = useState8(0);
|
|
3948
4272
|
const { direction, lineWidth = 1, style, className, index } = props;
|
|
3949
4273
|
const showIndex = index != null && index > 0;
|
|
3950
4274
|
const size = (_a = props.size) != null ? _a : 16;
|
|
@@ -3958,16 +4282,21 @@ function SortIcon(props) {
|
|
|
3958
4282
|
}), props.lineStyle), {
|
|
3959
4283
|
opacity
|
|
3960
4284
|
});
|
|
3961
|
-
|
|
4285
|
+
useEffect9(() => {
|
|
3962
4286
|
const newOpacity = direction != 0 ? 1 : 0;
|
|
3963
4287
|
if (!rendered && newOpacity) {
|
|
3964
4288
|
setRendered(true);
|
|
3965
4289
|
}
|
|
3966
4290
|
if (newOpacity !== opacity) {
|
|
3967
|
-
requestAnimationFrame(() => {
|
|
4291
|
+
const rafId = requestAnimationFrame(() => {
|
|
3968
4292
|
setOpacity(newOpacity);
|
|
3969
4293
|
});
|
|
4294
|
+
return () => {
|
|
4295
|
+
cancelAnimationFrame(rafId);
|
|
4296
|
+
};
|
|
3970
4297
|
}
|
|
4298
|
+
return () => {
|
|
4299
|
+
};
|
|
3971
4300
|
}, [direction, rendered]);
|
|
3972
4301
|
const onTransitionEnd = () => {
|
|
3973
4302
|
const hidden = opacity === 0 && direction === 0;
|
|
@@ -3983,19 +4312,19 @@ function SortIcon(props) {
|
|
|
3983
4312
|
if (direction === -1) {
|
|
3984
4313
|
indexStyle.top = "100%";
|
|
3985
4314
|
}
|
|
3986
|
-
return /* @__PURE__ */
|
|
4315
|
+
return /* @__PURE__ */ createElement12("div", {
|
|
3987
4316
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
3988
4317
|
className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
|
|
3989
|
-
}, showIndex ? /* @__PURE__ */
|
|
4318
|
+
}, showIndex ? /* @__PURE__ */ createElement12("div", {
|
|
3990
4319
|
"data-name": "index",
|
|
3991
4320
|
style: indexStyle,
|
|
3992
4321
|
className: HeaderSortIconIndexCls
|
|
3993
|
-
}, index) : null, /* @__PURE__ */
|
|
4322
|
+
}, index) : null, /* @__PURE__ */ createElement12("div", {
|
|
3994
4323
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
3995
4324
|
onTransitionEnd
|
|
3996
|
-
}), /* @__PURE__ */
|
|
4325
|
+
}), /* @__PURE__ */ createElement12("div", {
|
|
3997
4326
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
3998
|
-
}), /* @__PURE__ */
|
|
4327
|
+
}), /* @__PURE__ */ createElement12("div", {
|
|
3999
4328
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
4000
4329
|
}));
|
|
4001
4330
|
}
|
|
@@ -4003,8 +4332,8 @@ function SortIcon(props) {
|
|
|
4003
4332
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4004
4333
|
import {
|
|
4005
4334
|
Fragment,
|
|
4006
|
-
createElement as
|
|
4007
|
-
memo as
|
|
4335
|
+
createElement as createElement13,
|
|
4336
|
+
memo as memo7
|
|
4008
4337
|
} from "react";
|
|
4009
4338
|
|
|
4010
4339
|
// src/components/InfiniteTable/hooks/useInfiniteTableState.ts
|
|
@@ -4018,13 +4347,13 @@ var useInfiniteTableState = () => {
|
|
|
4018
4347
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
4019
4348
|
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4020
4349
|
var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
|
|
4021
|
-
var ColumnCellCls = "_1eexc2a5
|
|
4022
|
-
var ColumnCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_1eexc2a7", variantClassNames: { dragging: { false: "_1eexc2a8", true: "_1eexc2a9" },
|
|
4350
|
+
var ColumnCellCls = "_1eexc2a5 _16lm1iwm _16lm1iw13 _16lm1iw14 _16lm1iw2 _16lm1iw1c _16lm1iw1d";
|
|
4351
|
+
var ColumnCellRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_1eexc2a7", variantClassNames: { dragging: { false: "_1eexc2a8", true: "_1eexc2a9" }, rowActive: { false: "_1eexc2aa", true: "_1eexc2ab" }, zebra: { false: "_1eexc2ac", even: "_1eexc2ad", odd: "_1eexc2ae" }, first: { true: "_1eexc2af", false: "_1eexc2ag" }, last: { true: "_1eexc2ah", false: "_1eexc2ai" }, groupByField: { true: "_1eexc2aj", false: "_1eexc2ak" }, firstInCategory: { true: "_1eexc2al", false: "_1eexc2am" }, lastInCategory: { true: "_1eexc2an", false: "_1eexc2ao" }, pinned: { start: "_1eexc2ap", end: "_1eexc2aq", false: "_1eexc2ar" }, filtered: { true: "_1eexc2as", false: "_1eexc2at" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2au"], [{ pinned: "end", firstInCategory: true }, "_1eexc2av"]] });
|
|
4023
4352
|
|
|
4024
4353
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
4025
|
-
var { rootClassName:
|
|
4026
|
-
var InfiniteTableCellClassName = `${
|
|
4027
|
-
var InfiniteTableCellContentClassName = `${
|
|
4354
|
+
var { rootClassName: rootClassName5 } = internalProps;
|
|
4355
|
+
var InfiniteTableCellClassName = `${rootClassName5}Cell`;
|
|
4356
|
+
var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
|
|
4028
4357
|
function InfiniteTableCellFn(props) {
|
|
4029
4358
|
var _b, _c, _d;
|
|
4030
4359
|
const _a = props, {
|
|
@@ -4078,37 +4407,37 @@ function InfiniteTableCellFn(props) {
|
|
|
4078
4407
|
style,
|
|
4079
4408
|
"data-column-id": column.id,
|
|
4080
4409
|
className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls, shifting ? `${InfiniteTableCellClassName}--shifting ${CellClsVariants.shifting}` : ""),
|
|
4081
|
-
children: /* @__PURE__ */
|
|
4410
|
+
children: /* @__PURE__ */ createElement13(Fragment, null, beforeChildren, /* @__PURE__ */ createElement13("div", {
|
|
4082
4411
|
className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
|
|
4083
4412
|
style: contentStyle
|
|
4084
4413
|
}, children), afterChildren)
|
|
4085
4414
|
});
|
|
4086
4415
|
const RenderComponent = cellType === "body" ? (_c = column.components) == null ? void 0 : _c.ColumnCell : (_d = column.components) == null ? void 0 : _d.HeaderCell;
|
|
4087
4416
|
if (RenderComponent) {
|
|
4088
|
-
return /* @__PURE__ */
|
|
4417
|
+
return /* @__PURE__ */ createElement13(RenderComponent, __spreadValues({}, finalDOMProps));
|
|
4089
4418
|
}
|
|
4090
|
-
return /* @__PURE__ */
|
|
4419
|
+
return /* @__PURE__ */ createElement13("div", __spreadProps(__spreadValues({}, finalDOMProps), {
|
|
4091
4420
|
ref: domRef
|
|
4092
4421
|
}));
|
|
4093
4422
|
}
|
|
4094
|
-
var InfiniteTableCell =
|
|
4423
|
+
var InfiniteTableCell = memo7(InfiniteTableCellFn);
|
|
4095
4424
|
|
|
4096
4425
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx
|
|
4097
4426
|
import {
|
|
4098
|
-
createElement as
|
|
4427
|
+
createElement as createElement14
|
|
4099
4428
|
} from "react";
|
|
4100
|
-
import { useEffect as
|
|
4101
|
-
var { rootClassName:
|
|
4102
|
-
var InfiniteTableColumnHeaderFilterClassName = `${
|
|
4429
|
+
import { useEffect as useEffect10, useState as useState9 } from "react";
|
|
4430
|
+
var { rootClassName: rootClassName6 } = internalProps;
|
|
4431
|
+
var InfiniteTableColumnHeaderFilterClassName = `${rootClassName6}HeaderCell__filter`;
|
|
4103
4432
|
var stopPropagation = (e) => e.stopPropagation();
|
|
4104
4433
|
function InfiniteTableColumnHeaderFilter(props) {
|
|
4105
4434
|
var _a, _b, _c, _d;
|
|
4106
|
-
const [theValue, setTheValue] =
|
|
4435
|
+
const [theValue, setTheValue] = useState9((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
|
|
4107
4436
|
const onInputChange = (filterValue) => {
|
|
4108
4437
|
setTheValue(filterValue);
|
|
4109
4438
|
props.onChange(filterValue);
|
|
4110
4439
|
};
|
|
4111
|
-
|
|
4440
|
+
useEffect10(() => {
|
|
4112
4441
|
var _a2;
|
|
4113
4442
|
if (props.columnFilterValue) {
|
|
4114
4443
|
if (theValue !== props.columnFilterValue.filterValue) {
|
|
@@ -4135,15 +4464,15 @@ function InfiniteTableColumnHeaderFilter(props) {
|
|
|
4135
4464
|
onChange: onInputChange
|
|
4136
4465
|
};
|
|
4137
4466
|
const FilterEditor = props.filterEditor;
|
|
4138
|
-
return /* @__PURE__ */
|
|
4467
|
+
return /* @__PURE__ */ createElement14("div", {
|
|
4139
4468
|
onPointerUp: stopPropagation,
|
|
4140
4469
|
onPointerDown: stopPropagation,
|
|
4141
4470
|
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
|
|
4142
4471
|
style: { height: props.columnHeaderHeight }
|
|
4143
|
-
}, FilterEditor ? /* @__PURE__ */
|
|
4472
|
+
}, FilterEditor ? /* @__PURE__ */ createElement14(FilterEditor, __spreadValues({}, filterEditorProps)) : null);
|
|
4144
4473
|
}
|
|
4145
4474
|
function InfiniteTableColumnHeaderFilterEmpty() {
|
|
4146
|
-
return /* @__PURE__ */
|
|
4475
|
+
return /* @__PURE__ */ createElement14("div", {
|
|
4147
4476
|
onPointerUp: stopPropagation,
|
|
4148
4477
|
onPointerDown: stopPropagation,
|
|
4149
4478
|
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
|
|
@@ -4153,8 +4482,8 @@ function InfiniteTableColumnHeaderFilterEmpty() {
|
|
|
4153
4482
|
|
|
4154
4483
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
4155
4484
|
var InfiniteTableHeaderCellContext = createContext4(null);
|
|
4156
|
-
var { rootClassName:
|
|
4157
|
-
var InfiniteTableHeaderCellClassName = `${
|
|
4485
|
+
var { rootClassName: rootClassName7 } = internalProps;
|
|
4486
|
+
var InfiniteTableHeaderCellClassName = `${rootClassName7}HeaderCell`;
|
|
4158
4487
|
function InfiniteTableHeaderCell(props) {
|
|
4159
4488
|
var _a, _b, _c, _d, _e;
|
|
4160
4489
|
const column = props.column;
|
|
@@ -4162,13 +4491,13 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4162
4491
|
const { onResize, height, width, headerOptions } = props;
|
|
4163
4492
|
const sortInfo = column.computedSortInfo;
|
|
4164
4493
|
let header = column.header;
|
|
4165
|
-
const ref =
|
|
4494
|
+
const ref = useCallback7((node) => {
|
|
4166
4495
|
var _a2;
|
|
4167
4496
|
domRef.current = node;
|
|
4168
4497
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
4169
4498
|
}, [props.domRef]);
|
|
4170
4499
|
const alwaysShow = headerOptions.alwaysReserveSpaceForSortIcon;
|
|
4171
|
-
const sortTool = column.computedSorted || alwaysShow ? /* @__PURE__ */
|
|
4500
|
+
const sortTool = column.computedSorted || alwaysShow ? /* @__PURE__ */ createElement15(SortIcon, {
|
|
4172
4501
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
4173
4502
|
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls} ${HeaderSortIconRecipe({
|
|
4174
4503
|
align: column.align || "start"
|
|
@@ -4185,15 +4514,15 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4185
4514
|
const align = column.align || "start";
|
|
4186
4515
|
const renderChildren = () => {
|
|
4187
4516
|
if (header instanceof Function) {
|
|
4188
|
-
header = /* @__PURE__ */
|
|
4517
|
+
header = /* @__PURE__ */ createElement15(RenderHookComponent, {
|
|
4189
4518
|
render: header,
|
|
4190
4519
|
renderParam
|
|
4191
4520
|
});
|
|
4192
4521
|
}
|
|
4193
4522
|
header = header != null ? header : column.name;
|
|
4194
|
-
return /* @__PURE__ */
|
|
4523
|
+
return /* @__PURE__ */ createElement15(Fragment2, null, align === "end" ? sortTool : null, header, align !== "end" ? sortTool : null);
|
|
4195
4524
|
};
|
|
4196
|
-
const domRef =
|
|
4525
|
+
const domRef = useRef12(null);
|
|
4197
4526
|
const {
|
|
4198
4527
|
computed: { computedRemainingSpace, showColumnFilters },
|
|
4199
4528
|
componentState: { portalDOMRef, columnHeaderHeight, filterEditors }
|
|
@@ -4203,7 +4532,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4203
4532
|
getState: getDataSourceState,
|
|
4204
4533
|
componentState: { filterDelay, filterTypes }
|
|
4205
4534
|
} = useDataSourceContextValue();
|
|
4206
|
-
|
|
4535
|
+
useEffect11(() => {
|
|
4207
4536
|
let clearOnResize = null;
|
|
4208
4537
|
const node = domRef.current;
|
|
4209
4538
|
if (onResize && node) {
|
|
@@ -4224,7 +4553,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4224
4553
|
});
|
|
4225
4554
|
let draggingProxy = null;
|
|
4226
4555
|
if (dragging) {
|
|
4227
|
-
draggingProxy = /* @__PURE__ */
|
|
4556
|
+
draggingProxy = /* @__PURE__ */ createElement15("div", {
|
|
4228
4557
|
className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
|
|
4229
4558
|
style: {
|
|
4230
4559
|
position: "absolute",
|
|
@@ -4241,7 +4570,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4241
4570
|
const contentRecipeVariants = {
|
|
4242
4571
|
filtered: column.computedFiltered
|
|
4243
4572
|
};
|
|
4244
|
-
const setFilterValue =
|
|
4573
|
+
const setFilterValue = useCallback7((filterValue) => {
|
|
4245
4574
|
var _a2;
|
|
4246
4575
|
const state = getDataSourceState();
|
|
4247
4576
|
let newFilterValue = (_a2 = state.filterValue) != null ? _a2 : [];
|
|
@@ -4302,9 +4631,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4302
4631
|
]);
|
|
4303
4632
|
const filterType = column.computedFilterType;
|
|
4304
4633
|
const FilterEditor = filterEditors[filterType] || defaultFilterEditors[filterType] || StringFilterEditor;
|
|
4305
|
-
return /* @__PURE__ */
|
|
4634
|
+
return /* @__PURE__ */ createElement15(ContextProvider, {
|
|
4306
4635
|
value: renderParam
|
|
4307
|
-
}, /* @__PURE__ */
|
|
4636
|
+
}, /* @__PURE__ */ createElement15(InfiniteTableCell, {
|
|
4308
4637
|
domRef: ref,
|
|
4309
4638
|
cellType: "header",
|
|
4310
4639
|
column,
|
|
@@ -4316,9 +4645,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4316
4645
|
onPointerUp,
|
|
4317
4646
|
contentClassName: join(HeaderCellContentRecipe(contentRecipeVariants), justifyContent[(_c = column.align) != null ? _c : "start"]),
|
|
4318
4647
|
contentStyle: showColumnFilters ? { height: height / 2 } : void 0,
|
|
4319
|
-
className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging, zebra: false }), CellCls),
|
|
4648
|
+
className: join(InfiniteTableHeaderCellClassName, userSelect.none, column.computedSortable ? cursor.pointer : "", useCellClassName(column, [InfiniteTableHeaderCellClassName, InfiniteTableCellClassName], HeaderCellRecipe, { dragging, zebra: false, rowActive: false }), CellCls),
|
|
4320
4649
|
cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
|
|
4321
|
-
afterChildren: showColumnFilters ? column.computedFilterable ? /* @__PURE__ */
|
|
4650
|
+
afterChildren: showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement15(InfiniteTableColumnHeaderFilter, {
|
|
4322
4651
|
filterEditor: FilterEditor,
|
|
4323
4652
|
filterTypes,
|
|
4324
4653
|
onChange: debouncedOnFilterValueChange,
|
|
@@ -4326,7 +4655,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4326
4655
|
columnLabel: column.field || column.name || column.id,
|
|
4327
4656
|
columnFilterValue: column.computedFilterValue,
|
|
4328
4657
|
columnHeaderHeight
|
|
4329
|
-
}) : /* @__PURE__ */
|
|
4658
|
+
}) : /* @__PURE__ */ createElement15(InfiniteTableColumnHeaderFilterEmpty, null) : null,
|
|
4330
4659
|
renderChildren
|
|
4331
4660
|
}), draggingProxy);
|
|
4332
4661
|
}
|
|
@@ -4337,8 +4666,8 @@ function useInfiniteHeaderCell() {
|
|
|
4337
4666
|
|
|
4338
4667
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
4339
4668
|
import {
|
|
4340
|
-
createElement as
|
|
4341
|
-
useCallback as
|
|
4669
|
+
createElement as createElement18,
|
|
4670
|
+
useCallback as useCallback9,
|
|
4342
4671
|
useMemo as useMemo6
|
|
4343
4672
|
} from "react";
|
|
4344
4673
|
|
|
@@ -4463,14 +4792,14 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
4463
4792
|
|
|
4464
4793
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
4465
4794
|
import {
|
|
4466
|
-
createElement as
|
|
4467
|
-
memo as
|
|
4795
|
+
createElement as createElement17,
|
|
4796
|
+
memo as memo8
|
|
4468
4797
|
} from "react";
|
|
4469
|
-
import { useCallback as
|
|
4798
|
+
import { useCallback as useCallback8, useEffect as useEffect12, useRef as useRef13 } from "react";
|
|
4470
4799
|
|
|
4471
4800
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
4472
4801
|
import {
|
|
4473
|
-
createElement as
|
|
4802
|
+
createElement as createElement16
|
|
4474
4803
|
} from "react";
|
|
4475
4804
|
var TableHeaderGroupClassName = `${rootClassName2}HeaderGroup`;
|
|
4476
4805
|
function InfiniteTableHeaderGroup(props) {
|
|
@@ -4481,19 +4810,19 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
4481
4810
|
columnGroup
|
|
4482
4811
|
});
|
|
4483
4812
|
}
|
|
4484
|
-
return /* @__PURE__ */
|
|
4813
|
+
return /* @__PURE__ */ createElement16("div", {
|
|
4485
4814
|
ref: props.domRef,
|
|
4486
4815
|
"data-group-id": columnGroup.uniqueGroupId,
|
|
4487
4816
|
className: join(HeaderGroupCls, TableHeaderGroupClassName),
|
|
4488
4817
|
style: { width, height }
|
|
4489
|
-
}, /* @__PURE__ */
|
|
4818
|
+
}, /* @__PURE__ */ createElement16("div", {
|
|
4490
4819
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
4491
4820
|
}, header));
|
|
4492
4821
|
}
|
|
4493
4822
|
|
|
4494
4823
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
4495
|
-
var { rootClassName:
|
|
4496
|
-
var TableHeaderClassName = `${
|
|
4824
|
+
var { rootClassName: rootClassName8 } = internalProps;
|
|
4825
|
+
var TableHeaderClassName = `${rootClassName8}Header`;
|
|
4497
4826
|
function InfiniteTableHeaderFn(props) {
|
|
4498
4827
|
const {
|
|
4499
4828
|
brain,
|
|
@@ -4509,7 +4838,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4509
4838
|
componentState: { headerBrain, headerOptions }
|
|
4510
4839
|
} = useInfiniteTable();
|
|
4511
4840
|
const { computedVisibleColumnsMap, showColumnFilters } = computed;
|
|
4512
|
-
|
|
4841
|
+
useEffect12(() => {
|
|
4513
4842
|
const onScroll = (scrollPosition) => {
|
|
4514
4843
|
if (domRef.current) {
|
|
4515
4844
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
@@ -4518,7 +4847,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4518
4847
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
4519
4848
|
return removeOnScroll;
|
|
4520
4849
|
}, [brain]);
|
|
4521
|
-
const domRef =
|
|
4850
|
+
const domRef = useRef13(null);
|
|
4522
4851
|
const headerCls = HeaderClsRecipe({
|
|
4523
4852
|
overflow: false,
|
|
4524
4853
|
virtualized: true
|
|
@@ -4528,7 +4857,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4528
4857
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
4529
4858
|
style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
|
|
4530
4859
|
};
|
|
4531
|
-
const renderCell =
|
|
4860
|
+
const renderCell = useCallback8((params) => {
|
|
4532
4861
|
const {
|
|
4533
4862
|
rowIndex,
|
|
4534
4863
|
colIndex,
|
|
@@ -4553,7 +4882,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4553
4882
|
computedWidth: colGroupItem.computedWidth,
|
|
4554
4883
|
groupOffset: colGroupItem.groupOffset
|
|
4555
4884
|
});
|
|
4556
|
-
return /* @__PURE__ */
|
|
4885
|
+
return /* @__PURE__ */ createElement17(InfiniteTableHeaderGroup, {
|
|
4557
4886
|
domRef: domRef2,
|
|
4558
4887
|
columns: columns2,
|
|
4559
4888
|
width: widthWithColspan,
|
|
@@ -4561,7 +4890,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4561
4890
|
columnGroup: computedColumnGroup
|
|
4562
4891
|
});
|
|
4563
4892
|
}
|
|
4564
|
-
return /* @__PURE__ */
|
|
4893
|
+
return /* @__PURE__ */ createElement17(InfiniteTableHeaderCell, {
|
|
4565
4894
|
domRef: domRef2,
|
|
4566
4895
|
column,
|
|
4567
4896
|
headerOptions,
|
|
@@ -4577,13 +4906,13 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4577
4906
|
columnGroupsMaxDepth,
|
|
4578
4907
|
showColumnFilters
|
|
4579
4908
|
]);
|
|
4580
|
-
return /* @__PURE__ */
|
|
4909
|
+
return /* @__PURE__ */ createElement17("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement17(RawTable, {
|
|
4581
4910
|
renderCell,
|
|
4582
4911
|
brain: headerBrain,
|
|
4583
4912
|
cellHoverClassNames: []
|
|
4584
4913
|
}));
|
|
4585
4914
|
}
|
|
4586
|
-
var InfiniteTableHeader =
|
|
4915
|
+
var InfiniteTableHeader = memo8(InfiniteTableHeaderFn);
|
|
4587
4916
|
|
|
4588
4917
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
4589
4918
|
function TableHeaderWrapper(props) {
|
|
@@ -4612,7 +4941,7 @@ function TableHeaderWrapper(props) {
|
|
|
4612
4941
|
}
|
|
4613
4942
|
return buildColumnAndGroupTree(computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap, columnGroupsMaxDepth);
|
|
4614
4943
|
}, [computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap]);
|
|
4615
|
-
const cellspan =
|
|
4944
|
+
const cellspan = useCallback9(({ rowIndex, colIndex }) => {
|
|
4616
4945
|
const column = computedVisibleColumns[colIndex];
|
|
4617
4946
|
const rowspan2 = 1;
|
|
4618
4947
|
const colspan2 = 1;
|
|
@@ -4645,9 +4974,9 @@ function TableHeaderWrapper(props) {
|
|
|
4645
4974
|
rows,
|
|
4646
4975
|
columnGroupsDepthsMap
|
|
4647
4976
|
]);
|
|
4648
|
-
const rowspan =
|
|
4649
|
-
const colspan =
|
|
4650
|
-
const rowHeight =
|
|
4977
|
+
const rowspan = useCallback9(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).rowspan, [cellspan]);
|
|
4978
|
+
const colspan = useCallback9(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).colspan, [cellspan]);
|
|
4979
|
+
const rowHeight = useCallback9((index) => {
|
|
4651
4980
|
return showColumnFilters ? index < rows - 1 ? columnHeaderHeight : 2 * columnHeaderHeight : columnHeaderHeight;
|
|
4652
4981
|
}, [rows, showColumnFilters, columnHeaderHeight]);
|
|
4653
4982
|
useMatrixBrain(brain, {
|
|
@@ -4662,21 +4991,21 @@ function TableHeaderWrapper(props) {
|
|
|
4662
4991
|
fixedColsEnd: computedPinnedEndColumns.length,
|
|
4663
4992
|
fixedColsStart: computedPinnedStartColumns.length
|
|
4664
4993
|
});
|
|
4665
|
-
const header = /* @__PURE__ */
|
|
4994
|
+
const header = /* @__PURE__ */ createElement18(InfiniteTableHeader, {
|
|
4666
4995
|
columns: computedVisibleColumns,
|
|
4667
4996
|
brain,
|
|
4668
4997
|
columnHeaderHeight: height,
|
|
4669
4998
|
columnGroupsMaxDepth,
|
|
4670
4999
|
columnAndGroupTreeInfo
|
|
4671
5000
|
});
|
|
4672
|
-
const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */
|
|
5001
|
+
const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ createElement18("div", {
|
|
4673
5002
|
className: HeaderScrollbarPlaceholderCls,
|
|
4674
5003
|
style: {
|
|
4675
5004
|
zIndex: 1e3,
|
|
4676
5005
|
width: getScrollbarWidth()
|
|
4677
5006
|
}
|
|
4678
5007
|
}) : null;
|
|
4679
|
-
return /* @__PURE__ */
|
|
5008
|
+
return /* @__PURE__ */ createElement18("div", {
|
|
4680
5009
|
className: HeaderWrapperCls,
|
|
4681
5010
|
style: {
|
|
4682
5011
|
height
|
|
@@ -4686,12 +5015,12 @@ function TableHeaderWrapper(props) {
|
|
|
4686
5015
|
|
|
4687
5016
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
4688
5017
|
import {
|
|
4689
|
-
createElement as
|
|
5018
|
+
createElement as createElement19,
|
|
4690
5019
|
forwardRef as forwardRef4,
|
|
4691
|
-
useCallback as
|
|
4692
|
-
useRef as
|
|
5020
|
+
useCallback as useCallback10,
|
|
5021
|
+
useRef as useRef14
|
|
4693
5022
|
} from "react";
|
|
4694
|
-
import { useEffect as
|
|
5023
|
+
import { useEffect as useEffect13 } from "react";
|
|
4695
5024
|
|
|
4696
5025
|
// src/components/utils/decamelize.ts
|
|
4697
5026
|
function decamelize(str, options) {
|
|
@@ -4700,15 +5029,15 @@ function decamelize(str, options) {
|
|
|
4700
5029
|
}
|
|
4701
5030
|
|
|
4702
5031
|
// src/components/InfiniteTable/theme.css.ts
|
|
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)" } } };
|
|
5032
|
+
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)", activeBorderColor_R: "var(--infinite-active-cell-border-color--r)", activeBorderColor_G: "var(--infinite-active-cell-border-color--g)", activeBorderColor_B: "var(--infinite-active-cell-border-color--b)", activeBackgroundAlpha: "var(--infinite-active-cell-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-cell-background-alpha--table-unfocused)", activeBackground: "var(--infinite-active-cell-background)", activeBorderColor: "var(--infinite-active-cell-border-color)", activeBorderWidth: "var(--infinite-active-cell-border-width)", activeBorderStyle: "var(--infinite-active-cell-border-style)", activeBorder: "var(--infinite-active-cell-border)" }, Row: { background: "var(--infinite-row-background)", oddBackground: "var(--infinite-row-odd-background)", activeBackground: "var(--infinite-active-row-background)", activeBorderColor: "var(--infinite-active-row-border-color)", activeBorderWidth: "var(--infinite-active-row-border-width)", activeBorderStyle: "var(--infinite-active-row-border-style)", activeBorder: "var(--infinite-active-row-border)", activeBackgroundAlpha: "var(--infinite-active-row-background-alpha)", activeBackgroundAlphaWhenTableUnfocused: "var(--infinite-active-row-background-alpha--table-unfocused)", hoverBackground: "var(--infinite-row-hover-background)", 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)" } } };
|
|
4704
5033
|
|
|
4705
5034
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
4706
5035
|
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4707
5036
|
var FooterCls = "_16lm1iw1";
|
|
4708
|
-
var InfiniteCls = "_1yeub2v0 _16lm1iw1
|
|
4709
|
-
var InfiniteClsRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4710
|
-
var InfiniteClsShiftingColumns = "
|
|
4711
|
-
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "
|
|
5037
|
+
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwm _16lm1iw12 _16lm1iw0";
|
|
5038
|
+
var InfiniteClsRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { focused: { true: "_1yeub2v2", false: "_1yeub2v3" }, focusedWithin: { true: "_1yeub2v4", false: "_1yeub2v5" }, hasPinnedStart: { true: "_1yeub2v6", false: "_1yeub2v7" }, hasPinnedEnd: { true: "_1yeub2v8", false: "_1yeub2v9" }, hasPinnedStartOverflow: { true: "_1yeub2va", false: "_1yeub2vb" }, hasPinnedEndOverflow: { true: "_1yeub2vc", false: "_1yeub2vd" } }, defaultVariants: {}, compoundVariants: [[{ focused: false, focusedWithin: false }, "_1yeub2ve"]] });
|
|
5039
|
+
var InfiniteClsShiftingColumns = "_16lm1iwp";
|
|
5040
|
+
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vi", end: "_1yeub2vj", false: "_1yeub2vk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4712
5041
|
|
|
4713
5042
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
4714
5043
|
var defaultStyle = {
|
|
@@ -4738,9 +5067,9 @@ var enforceStyle = (node, style) => {
|
|
|
4738
5067
|
}
|
|
4739
5068
|
};
|
|
4740
5069
|
var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter2(props, ref) {
|
|
4741
|
-
const { rootClassName:
|
|
4742
|
-
const domRef =
|
|
4743
|
-
const domCallback =
|
|
5070
|
+
const { rootClassName: rootClassName11 } = useInternalProps();
|
|
5071
|
+
const domRef = useRef14(null);
|
|
5072
|
+
const domCallback = useCallback10((node) => {
|
|
4744
5073
|
domRef.current = node;
|
|
4745
5074
|
if (!ref) {
|
|
4746
5075
|
return;
|
|
@@ -4751,7 +5080,7 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
|
|
|
4751
5080
|
ref.current = node;
|
|
4752
5081
|
}
|
|
4753
5082
|
}, []);
|
|
4754
|
-
|
|
5083
|
+
useEffect13(() => {
|
|
4755
5084
|
const forceStyle = () => {
|
|
4756
5085
|
requestAnimationFrame(() => {
|
|
4757
5086
|
var _a;
|
|
@@ -4765,12 +5094,12 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
|
|
|
4765
5094
|
clearInterval(intervalId);
|
|
4766
5095
|
};
|
|
4767
5096
|
}, []);
|
|
4768
|
-
return /* @__PURE__ */
|
|
5097
|
+
return /* @__PURE__ */ createElement19("div", __spreadProps(__spreadValues({
|
|
4769
5098
|
ref: domCallback
|
|
4770
5099
|
}, props), {
|
|
4771
|
-
className: join(`${
|
|
5100
|
+
className: join(`${rootClassName11}-Footer`, FooterCls, props.className),
|
|
4772
5101
|
style: defaultStyle
|
|
4773
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
5102
|
+
}), "Powered by", " ", /* @__PURE__ */ createElement19("a", {
|
|
4774
5103
|
href: "https://infinite-table.com",
|
|
4775
5104
|
rel: "noopener noreferrer",
|
|
4776
5105
|
role: "link",
|
|
@@ -4781,13 +5110,13 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
|
|
|
4781
5110
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
4782
5111
|
import {
|
|
4783
5112
|
createContext as createContext5,
|
|
4784
|
-
createElement as
|
|
4785
|
-
memo as
|
|
5113
|
+
createElement as createElement20,
|
|
5114
|
+
memo as memo9
|
|
4786
5115
|
} from "react";
|
|
4787
|
-
import { useContext as useContext6 } from "react";
|
|
4788
|
-
var { rootClassName:
|
|
5116
|
+
import { useCallback as useCallback11, useContext as useContext6, useMemo as useMemo7 } from "react";
|
|
5117
|
+
var { rootClassName: rootClassName9 } = internalProps;
|
|
4789
5118
|
var InfiniteTableColumnCellContext = createContext5(null);
|
|
4790
|
-
var InfiniteTableColumnCellClassName = `${
|
|
5119
|
+
var InfiniteTableColumnCellClassName = `${rootClassName9}ColumnCell`;
|
|
4791
5120
|
function isColumnWithField(c) {
|
|
4792
5121
|
return typeof c.field === "string";
|
|
4793
5122
|
}
|
|
@@ -4811,13 +5140,16 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
4811
5140
|
showZebraRows
|
|
4812
5141
|
} = props;
|
|
4813
5142
|
if (!column) {
|
|
4814
|
-
return /* @__PURE__ */
|
|
5143
|
+
return /* @__PURE__ */ createElement20("div", {
|
|
4815
5144
|
ref: domRef
|
|
4816
5145
|
}, "no column");
|
|
4817
5146
|
}
|
|
4818
5147
|
const { data, isGroupRow, dataSourceHasGrouping } = rowInfo;
|
|
4819
5148
|
const groupBy = dataSourceHasGrouping ? rowInfo.groupBy : void 0;
|
|
4820
5149
|
const groupRowInfo = null;
|
|
5150
|
+
const { getState, componentActions } = useInfiniteTable();
|
|
5151
|
+
const { activeRowIndex, keyboardNavigation } = getState();
|
|
5152
|
+
const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
|
|
4821
5153
|
let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
|
|
4822
5154
|
if (column.valueGetter) {
|
|
4823
5155
|
if (!rowInfo.isGroupRow && rowInfo.data) {
|
|
@@ -4829,27 +5161,43 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
4829
5161
|
data: rowInfo.data,
|
|
4830
5162
|
isGroupRow,
|
|
4831
5163
|
rowInfo,
|
|
5164
|
+
rowActive,
|
|
4832
5165
|
field: column.field,
|
|
4833
5166
|
value
|
|
4834
5167
|
} : {
|
|
4835
5168
|
data: rowInfo.data,
|
|
4836
5169
|
isGroupRow,
|
|
5170
|
+
rowActive,
|
|
4837
5171
|
rowInfo,
|
|
4838
5172
|
field: column.field,
|
|
4839
5173
|
value
|
|
4840
5174
|
});
|
|
4841
5175
|
}
|
|
5176
|
+
const onClick = useCallback11(() => {
|
|
5177
|
+
if (keyboardNavigation === "row") {
|
|
5178
|
+
componentActions.activeRowIndex = rowIndex;
|
|
5179
|
+
return;
|
|
5180
|
+
}
|
|
5181
|
+
if (keyboardNavigation === "cell") {
|
|
5182
|
+
componentActions.activeCellIndex = [
|
|
5183
|
+
rowIndex,
|
|
5184
|
+
column.computedVisibleIndex
|
|
5185
|
+
];
|
|
5186
|
+
}
|
|
5187
|
+
}, [rowIndex, column.computedVisibleIndex, keyboardNavigation]);
|
|
4842
5188
|
const { componentState: computedDataSource } = useDataSourceContextValue();
|
|
4843
5189
|
const rest = rowInfo.isGroupRow ? {
|
|
4844
5190
|
rowInfo,
|
|
4845
5191
|
isGroupRow: rowInfo.isGroupRow,
|
|
4846
5192
|
data: rowInfo.data,
|
|
5193
|
+
rowActive,
|
|
4847
5194
|
value,
|
|
4848
5195
|
field: column.field
|
|
4849
5196
|
} : {
|
|
4850
5197
|
rowInfo,
|
|
4851
5198
|
isGroupRow: rowInfo.isGroupRow,
|
|
4852
5199
|
data: rowInfo.data,
|
|
5200
|
+
rowActive,
|
|
4853
5201
|
value,
|
|
4854
5202
|
field: column.field
|
|
4855
5203
|
};
|
|
@@ -4865,28 +5213,28 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
4865
5213
|
isGroupRow,
|
|
4866
5214
|
rowIndex,
|
|
4867
5215
|
toggleGroupRow,
|
|
4868
|
-
toggleCurrentGroupRow: () => {
|
|
5216
|
+
toggleCurrentGroupRow: useCallback11(() => {
|
|
4869
5217
|
if (!rowInfo.isGroupRow) {
|
|
4870
5218
|
return;
|
|
4871
5219
|
}
|
|
4872
5220
|
toggleGroupRow(rowInfo.groupKeys);
|
|
4873
|
-
},
|
|
5221
|
+
}, []),
|
|
4874
5222
|
groupBy: computedDataSource.groupBy,
|
|
4875
5223
|
pivotBy: computedDataSource.pivotBy
|
|
4876
5224
|
});
|
|
4877
|
-
const renderChildren = () => {
|
|
5225
|
+
const renderChildren = useCallback11(() => {
|
|
4878
5226
|
if (hidden) {
|
|
4879
5227
|
return null;
|
|
4880
5228
|
}
|
|
4881
5229
|
const renderFn = column.render || column.renderValue;
|
|
4882
5230
|
if (renderFn) {
|
|
4883
|
-
return /* @__PURE__ */
|
|
5231
|
+
return /* @__PURE__ */ createElement20(RenderHookComponent, {
|
|
4884
5232
|
render: renderFn,
|
|
4885
5233
|
renderParam
|
|
4886
5234
|
});
|
|
4887
5235
|
}
|
|
4888
5236
|
return renderValue;
|
|
4889
|
-
};
|
|
5237
|
+
}, [column, hidden, ...Object.values(renderParam)]);
|
|
4890
5238
|
const rowPropsAndStyleArgs = __spreadProps(__spreadValues({}, rest), {
|
|
4891
5239
|
rowIndex
|
|
4892
5240
|
});
|
|
@@ -4899,6 +5247,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
4899
5247
|
style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
|
|
4900
5248
|
style.width = width;
|
|
4901
5249
|
style.height = rowHeight;
|
|
5250
|
+
const memoizedStyle = useMemo7(() => style, [!style ? null : JSON.stringify(style)]);
|
|
4902
5251
|
const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
|
|
4903
5252
|
const zebra = showZebraRows ? odd ? "odd" : "even" : false;
|
|
4904
5253
|
const cellProps = {
|
|
@@ -4908,19 +5257,20 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
4908
5257
|
column,
|
|
4909
5258
|
width,
|
|
4910
5259
|
offset: virtualized ? 0 : column.computedPinningOffset,
|
|
4911
|
-
style,
|
|
5260
|
+
style: memoizedStyle,
|
|
4912
5261
|
onMouseLeave,
|
|
4913
5262
|
onMouseEnter,
|
|
5263
|
+
onClick,
|
|
4914
5264
|
cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
|
|
4915
|
-
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false, zebra }), colClassName, rowComputedClassName),
|
|
5265
|
+
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false, zebra, rowActive }), colClassName, rowComputedClassName),
|
|
4916
5266
|
renderChildren
|
|
4917
5267
|
};
|
|
4918
5268
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
4919
|
-
return /* @__PURE__ */
|
|
5269
|
+
return /* @__PURE__ */ createElement20(ContextProvider, {
|
|
4920
5270
|
value: renderParam
|
|
4921
|
-
}, /* @__PURE__ */
|
|
5271
|
+
}, /* @__PURE__ */ createElement20(InfiniteTableCell, __spreadValues({}, cellProps)));
|
|
4922
5272
|
}
|
|
4923
|
-
var InfiniteTableColumnCell =
|
|
5273
|
+
var InfiniteTableColumnCell = memo9(InfiniteTableColumnCellFn);
|
|
4924
5274
|
function useInfiniteColumnCell() {
|
|
4925
5275
|
const result = useContext6(InfiniteTableColumnCellContext);
|
|
4926
5276
|
return result;
|
|
@@ -4934,35 +5284,97 @@ var RowHoverCls = "_7pupv01";
|
|
|
4934
5284
|
|
|
4935
5285
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
4936
5286
|
import {
|
|
4937
|
-
createElement as
|
|
4938
|
-
memo as
|
|
5287
|
+
createElement as createElement21,
|
|
5288
|
+
memo as memo10
|
|
4939
5289
|
} from "react";
|
|
4940
5290
|
|
|
4941
5291
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
4942
|
-
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2
|
|
4943
|
-
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2
|
|
5292
|
+
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwu _16lm1iww _16lm1iw10 _16lm1iwy", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwu _16lm1iww _16lm1iw10 _16lm1iwy" };
|
|
5293
|
+
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwu _16lm1iww _16lm1iw10 _16lm1iwy";
|
|
4944
5294
|
var LoadMaskTextCls = "qy58ya4";
|
|
4945
5295
|
|
|
4946
5296
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
4947
|
-
var { rootClassName:
|
|
4948
|
-
var
|
|
5297
|
+
var { rootClassName: rootClassName10 } = internalProps;
|
|
5298
|
+
var baseCls3 = `${rootClassName10}-LoadMask`;
|
|
4949
5299
|
function LoadMaskFn(props) {
|
|
4950
5300
|
const { visible, children = "Loading" } = props;
|
|
4951
|
-
return /* @__PURE__ */
|
|
4952
|
-
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${
|
|
4953
|
-
}, /* @__PURE__ */
|
|
4954
|
-
className: `${LoadMaskOverlayCls} ${
|
|
4955
|
-
}), /* @__PURE__ */
|
|
4956
|
-
className: `${LoadMaskTextCls} ${
|
|
5301
|
+
return /* @__PURE__ */ createElement21("div", {
|
|
5302
|
+
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls3}`
|
|
5303
|
+
}, /* @__PURE__ */ createElement21("div", {
|
|
5304
|
+
className: `${LoadMaskOverlayCls} ${baseCls3}-Overlay`
|
|
5305
|
+
}), /* @__PURE__ */ createElement21("div", {
|
|
5306
|
+
className: `${LoadMaskTextCls} ${baseCls3}-Text`
|
|
4957
5307
|
}, children));
|
|
4958
5308
|
}
|
|
4959
|
-
var LoadMask =
|
|
5309
|
+
var LoadMask = memo10(LoadMaskFn);
|
|
5310
|
+
|
|
5311
|
+
// src/components/InfiniteTable/getImperativeApi.ts
|
|
5312
|
+
function getImperativeApi(getState, getComputed, getDataSourceState, componentActions) {
|
|
5313
|
+
const imperativeApi = {
|
|
5314
|
+
setColumnOrder: (columnOrder) => {
|
|
5315
|
+
componentActions.columnOrder = columnOrder;
|
|
5316
|
+
},
|
|
5317
|
+
setColumnVisibility: (columnVisibility) => {
|
|
5318
|
+
componentActions.columnVisibility = columnVisibility;
|
|
5319
|
+
},
|
|
5320
|
+
getState,
|
|
5321
|
+
getDataSourceState,
|
|
5322
|
+
scrollRowIntoView(rowIndex, config = { offset: 0 }) {
|
|
5323
|
+
const state = getState();
|
|
5324
|
+
const scrollPosition = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
|
|
5325
|
+
const currentScrollPosition = state.brain.getScrollPosition();
|
|
5326
|
+
if (scrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
5327
|
+
state.scrollerDOMRef.current.scrollTop = scrollPosition.scrollTop;
|
|
5328
|
+
}
|
|
5329
|
+
},
|
|
5330
|
+
scrollColumnIntoView(colId, config = { offset: 0 }) {
|
|
5331
|
+
const state = getState();
|
|
5332
|
+
const computed = getComputed();
|
|
5333
|
+
const computedColumn = computed.computedVisibleColumnsMap.get(colId);
|
|
5334
|
+
if (!computedColumn) {
|
|
5335
|
+
return;
|
|
5336
|
+
}
|
|
5337
|
+
const colIndex = computedColumn.computedVisibleIndex;
|
|
5338
|
+
const scrollPosition = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
|
|
5339
|
+
const currentScrollPosition = state.brain.getScrollPosition();
|
|
5340
|
+
if (scrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
5341
|
+
state.scrollerDOMRef.current.scrollLeft = scrollPosition.scrollLeft;
|
|
5342
|
+
}
|
|
5343
|
+
},
|
|
5344
|
+
scrollCellIntoView(rowIndex, colIdOrIndex, config = { offset: 0 }) {
|
|
5345
|
+
const state = getState();
|
|
5346
|
+
const computed = getComputed();
|
|
5347
|
+
let colIndex = colIdOrIndex;
|
|
5348
|
+
if (typeof colIdOrIndex === "string") {
|
|
5349
|
+
const computedColumn = computed.computedVisibleColumnsMap.get(colIdOrIndex);
|
|
5350
|
+
if (!computedColumn) {
|
|
5351
|
+
return;
|
|
5352
|
+
}
|
|
5353
|
+
colIndex = computedColumn.computedVisibleIndex;
|
|
5354
|
+
}
|
|
5355
|
+
const scrollPositionForCol = state.renderer.getScrollPositionForScrollColumnIntoView(colIndex, config);
|
|
5356
|
+
const scrollPositionForRow = state.renderer.getScrollPositionForScrollRowIntoView(rowIndex, config);
|
|
5357
|
+
const newScrollPosition = {
|
|
5358
|
+
scrollLeft: scrollPositionForCol.scrollLeft,
|
|
5359
|
+
scrollTop: scrollPositionForRow.scrollTop
|
|
5360
|
+
};
|
|
5361
|
+
const currentScrollPosition = state.brain.getScrollPosition();
|
|
5362
|
+
if (newScrollPosition.scrollLeft !== currentScrollPosition.scrollLeft) {
|
|
5363
|
+
state.scrollerDOMRef.current.scrollLeft = newScrollPosition.scrollLeft;
|
|
5364
|
+
}
|
|
5365
|
+
if (newScrollPosition.scrollTop !== currentScrollPosition.scrollTop) {
|
|
5366
|
+
state.scrollerDOMRef.current.scrollTop = newScrollPosition.scrollTop;
|
|
5367
|
+
}
|
|
5368
|
+
}
|
|
5369
|
+
};
|
|
5370
|
+
return imperativeApi;
|
|
5371
|
+
}
|
|
4960
5372
|
|
|
4961
5373
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
4962
5374
|
import {
|
|
4963
|
-
useEffect as
|
|
4964
|
-
useRef as
|
|
4965
|
-
useState as
|
|
5375
|
+
useEffect as useEffect14,
|
|
5376
|
+
useRef as useRef15,
|
|
5377
|
+
useState as useState10
|
|
4966
5378
|
} from "react";
|
|
4967
5379
|
var OFFSET = 10;
|
|
4968
5380
|
function getColumnContentMaxWidths(domRef, options) {
|
|
@@ -5023,11 +5435,11 @@ function useAutoSizeColumns() {
|
|
|
5023
5435
|
componentActions,
|
|
5024
5436
|
componentState: { domRef, ready, autoSizeColumnsKey, brain }
|
|
5025
5437
|
} = useComponentState();
|
|
5026
|
-
const [refreshId, setRefreshId] =
|
|
5438
|
+
const [refreshId, setRefreshId] = useState10(0);
|
|
5027
5439
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
5028
5440
|
const getTheKey = useLatest(theKey);
|
|
5029
|
-
const lastExecutedIdentifierRef =
|
|
5030
|
-
|
|
5441
|
+
const lastExecutedIdentifierRef = useRef15(null);
|
|
5442
|
+
useEffect14(() => {
|
|
5031
5443
|
const key = getTheKey();
|
|
5032
5444
|
if (key == null) {
|
|
5033
5445
|
return;
|
|
@@ -5040,7 +5452,7 @@ function useAutoSizeColumns() {
|
|
|
5040
5452
|
};
|
|
5041
5453
|
return brain.onRenderRangeChange(onChange);
|
|
5042
5454
|
}, [brain]);
|
|
5043
|
-
|
|
5455
|
+
useEffect14(() => {
|
|
5044
5456
|
var _a;
|
|
5045
5457
|
if (theKey == null) {
|
|
5046
5458
|
return;
|
|
@@ -5085,20 +5497,8 @@ function useAutoSizeColumns() {
|
|
|
5085
5497
|
}
|
|
5086
5498
|
|
|
5087
5499
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
5088
|
-
import { useCallback as
|
|
5089
|
-
import
|
|
5090
|
-
|
|
5091
|
-
// src/components/hooks/useRerender.ts
|
|
5092
|
-
import { useCallback as useCallback10, useState as useState8 } from "react";
|
|
5093
|
-
var useRerender = () => {
|
|
5094
|
-
const [state, setState] = useState8(0);
|
|
5095
|
-
return [
|
|
5096
|
-
state,
|
|
5097
|
-
useCallback10(() => {
|
|
5098
|
-
setState((state2) => state2 + 1);
|
|
5099
|
-
}, [setState])
|
|
5100
|
-
];
|
|
5101
|
-
};
|
|
5500
|
+
import { useCallback as useCallback12, useEffect as useEffect15, useRef as useRef16 } from "react";
|
|
5501
|
+
import React27 from "react";
|
|
5102
5502
|
|
|
5103
5503
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
5104
5504
|
function useYourBrain(param) {
|
|
@@ -5128,7 +5528,7 @@ function useYourBrain(param) {
|
|
|
5128
5528
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
5129
5529
|
var SCROLL_BOTTOM_OFFSET = 1;
|
|
5130
5530
|
function useCellRendering(param) {
|
|
5131
|
-
const { computed, bodySize } = param;
|
|
5531
|
+
const { computed, bodySize, imperativeApi } = param;
|
|
5132
5532
|
const { componentActions, componentState, getState } = useInfiniteTable();
|
|
5133
5533
|
const {
|
|
5134
5534
|
computedPinnedStartColumns,
|
|
@@ -5168,13 +5568,13 @@ function useCellRendering(param) {
|
|
|
5168
5568
|
bodySize,
|
|
5169
5569
|
rowspan
|
|
5170
5570
|
});
|
|
5171
|
-
const scrollTopMaxRef =
|
|
5172
|
-
|
|
5571
|
+
const scrollTopMaxRef = useRef16(0);
|
|
5572
|
+
useEffect15(() => {
|
|
5173
5573
|
return brain.onRenderCountChange(() => {
|
|
5174
5574
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
5175
5575
|
});
|
|
5176
5576
|
}, [brain]);
|
|
5177
|
-
|
|
5577
|
+
useEffect15(() => {
|
|
5178
5578
|
return brain.onScrollStop((scrollPosition) => {
|
|
5179
5579
|
const { scrollTop } = scrollPosition;
|
|
5180
5580
|
if (scrollTop === 0) {
|
|
@@ -5191,31 +5591,21 @@ function useCellRendering(param) {
|
|
|
5191
5591
|
}
|
|
5192
5592
|
});
|
|
5193
5593
|
}, [brain, onScrollToTop, onScrollToBottom]);
|
|
5194
|
-
|
|
5594
|
+
useEffect15(() => {
|
|
5195
5595
|
if (!bodySize.height) {
|
|
5196
5596
|
return;
|
|
5197
5597
|
}
|
|
5198
5598
|
const { onReady } = getState();
|
|
5199
5599
|
componentActions.ready = true;
|
|
5200
5600
|
if (onReady) {
|
|
5201
|
-
const imperativeApi = {
|
|
5202
|
-
setColumnOrder: (columnOrder) => {
|
|
5203
|
-
componentActions.columnOrder = columnOrder;
|
|
5204
|
-
},
|
|
5205
|
-
setColumnVisibility: (columnVisibility) => {
|
|
5206
|
-
componentActions.columnVisibility = columnVisibility;
|
|
5207
|
-
},
|
|
5208
|
-
getState,
|
|
5209
|
-
getDataSourceState
|
|
5210
|
-
};
|
|
5211
5601
|
onReady(imperativeApi);
|
|
5212
5602
|
}
|
|
5213
5603
|
}, [!!bodySize.height]);
|
|
5214
5604
|
const [, rerender] = useRerender();
|
|
5215
|
-
|
|
5605
|
+
useEffect15(() => {
|
|
5216
5606
|
rerender();
|
|
5217
5607
|
}, [dataSourceState]);
|
|
5218
|
-
const renderCell =
|
|
5608
|
+
const renderCell = useCallback12((params) => {
|
|
5219
5609
|
const {
|
|
5220
5610
|
rowIndex,
|
|
5221
5611
|
colIndex,
|
|
@@ -5250,7 +5640,7 @@ function useCellRendering(param) {
|
|
|
5250
5640
|
rowStyle,
|
|
5251
5641
|
rowClassName
|
|
5252
5642
|
};
|
|
5253
|
-
return /* @__PURE__ */
|
|
5643
|
+
return /* @__PURE__ */ React27.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
|
|
5254
5644
|
}, [
|
|
5255
5645
|
rowHeight,
|
|
5256
5646
|
getData,
|
|
@@ -5268,13 +5658,13 @@ function useCellRendering(param) {
|
|
|
5268
5658
|
}
|
|
5269
5659
|
|
|
5270
5660
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
5271
|
-
import { useCallback as
|
|
5661
|
+
import { useCallback as useCallback15, useEffect as useEffect25, useState as useState14 } from "react";
|
|
5272
5662
|
|
|
5273
5663
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
5274
|
-
import { useEffect as
|
|
5664
|
+
import { useEffect as useEffect17 } from "react";
|
|
5275
5665
|
|
|
5276
5666
|
// src/components/hooks/useInterceptedMap.ts
|
|
5277
|
-
import { useEffect as
|
|
5667
|
+
import { useEffect as useEffect16 } from "react";
|
|
5278
5668
|
function interceptMap(map2, fns) {
|
|
5279
5669
|
const { set, delete: deleteKey, clear } = map2;
|
|
5280
5670
|
if (fns.set) {
|
|
@@ -5362,7 +5752,7 @@ function useColumnGroups() {
|
|
|
5362
5752
|
componentActions,
|
|
5363
5753
|
getComponentState
|
|
5364
5754
|
} = useComponentState();
|
|
5365
|
-
|
|
5755
|
+
useEffect17(() => {
|
|
5366
5756
|
const recompute = () => {
|
|
5367
5757
|
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
5368
5758
|
};
|
|
@@ -5373,7 +5763,7 @@ function useColumnGroups() {
|
|
|
5373
5763
|
set: update
|
|
5374
5764
|
});
|
|
5375
5765
|
}, [computedColumnGroups]);
|
|
5376
|
-
|
|
5766
|
+
useEffect17(() => {
|
|
5377
5767
|
return interceptMap(collapsedColumnGroups, {
|
|
5378
5768
|
set: (key, visibleCol) => {
|
|
5379
5769
|
const colIds = key.slice(1);
|
|
@@ -5408,10 +5798,10 @@ function useColumnGroups() {
|
|
|
5408
5798
|
}
|
|
5409
5799
|
|
|
5410
5800
|
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
5411
|
-
import { useMemo as
|
|
5801
|
+
import { useMemo as useMemo8 } from "react";
|
|
5412
5802
|
function useColumnRowspan(computedVisibleColumns) {
|
|
5413
5803
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
5414
|
-
const rowspan =
|
|
5804
|
+
const rowspan = useMemo8(() => {
|
|
5415
5805
|
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
5416
5806
|
return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
|
|
5417
5807
|
const dataArray = getDataSourceState().dataArray;
|
|
@@ -5437,10 +5827,10 @@ function useColumnRowspan(computedVisibleColumns) {
|
|
|
5437
5827
|
}
|
|
5438
5828
|
|
|
5439
5829
|
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
5440
|
-
import { useCallback as
|
|
5830
|
+
import { useCallback as useCallback13 } from "react";
|
|
5441
5831
|
var debug4 = dbg("useColumnSizeFn");
|
|
5442
5832
|
function useColumnSizeFn(columns) {
|
|
5443
|
-
const columnSize =
|
|
5833
|
+
const columnSize = useCallback13((index) => {
|
|
5444
5834
|
const column = columns[index];
|
|
5445
5835
|
if (!column) {
|
|
5446
5836
|
debug4("cannot find column at index", index, columns);
|
|
@@ -5451,11 +5841,11 @@ function useColumnSizeFn(columns) {
|
|
|
5451
5841
|
}
|
|
5452
5842
|
|
|
5453
5843
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
5454
|
-
import { useEffect as
|
|
5844
|
+
import { useEffect as useEffect22, useMemo as useMemo10 } from "react";
|
|
5455
5845
|
|
|
5456
5846
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
5457
5847
|
import {
|
|
5458
|
-
createElement as
|
|
5848
|
+
createElement as createElement24
|
|
5459
5849
|
} from "react";
|
|
5460
5850
|
|
|
5461
5851
|
// src/utils/stripVar.ts
|
|
@@ -5473,21 +5863,21 @@ var showLoadingIcon = (rowInfo) => {
|
|
|
5473
5863
|
|
|
5474
5864
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5475
5865
|
import {
|
|
5476
|
-
createElement as
|
|
5477
|
-
useEffect as
|
|
5866
|
+
createElement as createElement22,
|
|
5867
|
+
useEffect as useEffect18
|
|
5478
5868
|
} from "react";
|
|
5479
|
-
import { useState as
|
|
5869
|
+
import { useState as useState11 } from "react";
|
|
5480
5870
|
|
|
5481
5871
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
5482
5872
|
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5483
|
-
var ExpanderIconCls = "_16lm1iw6
|
|
5873
|
+
var ExpanderIconCls = "_16lm1iw6 _16lm1iwg _16lm1iwd";
|
|
5484
5874
|
var ExpanderIconClsVariants = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwc", false: "_198z9782" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5485
5875
|
|
|
5486
5876
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5487
5877
|
function ExpanderIcon(props) {
|
|
5488
5878
|
var _a;
|
|
5489
5879
|
const { size = 24 } = props;
|
|
5490
|
-
const [expanded, setExpanded] =
|
|
5880
|
+
const [expanded, setExpanded] = useState11((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
5491
5881
|
const onClick = () => {
|
|
5492
5882
|
var _a2;
|
|
5493
5883
|
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
@@ -5495,12 +5885,12 @@ function ExpanderIcon(props) {
|
|
|
5495
5885
|
setExpanded(!expanded);
|
|
5496
5886
|
}
|
|
5497
5887
|
};
|
|
5498
|
-
|
|
5888
|
+
useEffect18(() => {
|
|
5499
5889
|
if (isControlled("expanded", props)) {
|
|
5500
5890
|
setExpanded(props.expanded);
|
|
5501
5891
|
}
|
|
5502
5892
|
}, [props.expanded]);
|
|
5503
|
-
return /* @__PURE__ */
|
|
5893
|
+
return /* @__PURE__ */ createElement22("svg", {
|
|
5504
5894
|
"data-name": "expander-icon",
|
|
5505
5895
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5506
5896
|
height: `${size}px`,
|
|
@@ -5511,22 +5901,22 @@ function ExpanderIcon(props) {
|
|
|
5511
5901
|
className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
|
|
5512
5902
|
expanded
|
|
5513
5903
|
}), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`)
|
|
5514
|
-
}, /* @__PURE__ */
|
|
5904
|
+
}, /* @__PURE__ */ createElement22("path", {
|
|
5515
5905
|
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
5516
5906
|
}));
|
|
5517
5907
|
}
|
|
5518
5908
|
|
|
5519
5909
|
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5520
5910
|
import {
|
|
5521
|
-
createElement as
|
|
5911
|
+
createElement as createElement23
|
|
5522
5912
|
} from "react";
|
|
5523
5913
|
|
|
5524
5914
|
// src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
|
|
5525
|
-
var LoadingIconCls = "_16lm1iw8
|
|
5915
|
+
var LoadingIconCls = "_16lm1iw8 _16lm1iwg _16lm1iwd";
|
|
5526
5916
|
|
|
5527
5917
|
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5528
5918
|
var LoadingIcon = (props) => {
|
|
5529
|
-
return /* @__PURE__ */
|
|
5919
|
+
return /* @__PURE__ */ createElement23("svg", {
|
|
5530
5920
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5531
5921
|
style: {
|
|
5532
5922
|
margin: "auto",
|
|
@@ -5538,14 +5928,14 @@ var LoadingIcon = (props) => {
|
|
|
5538
5928
|
viewBox: "0 0 100 100",
|
|
5539
5929
|
preserveAspectRatio: "xMidYMid",
|
|
5540
5930
|
className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
|
|
5541
|
-
}, /* @__PURE__ */
|
|
5931
|
+
}, /* @__PURE__ */ createElement23("circle", {
|
|
5542
5932
|
cx: "50",
|
|
5543
5933
|
cy: "50",
|
|
5544
5934
|
fill: "none",
|
|
5545
5935
|
strokeWidth: "10",
|
|
5546
5936
|
r: "35",
|
|
5547
5937
|
strokeDasharray: "164.93361431346415 56.97787143782138"
|
|
5548
|
-
}, /* @__PURE__ */
|
|
5938
|
+
}, /* @__PURE__ */ createElement23("animateTransform", {
|
|
5549
5939
|
attributeName: "transform",
|
|
5550
5940
|
type: "rotate",
|
|
5551
5941
|
repeatCount: "indefinite",
|
|
@@ -5565,7 +5955,7 @@ function getGroupColumnRender({
|
|
|
5565
5955
|
var _a, _b, _c;
|
|
5566
5956
|
let { value, rowInfo, column, groupBy, pivotBy } = renderOptions;
|
|
5567
5957
|
if (column.renderValue) {
|
|
5568
|
-
value = /* @__PURE__ */
|
|
5958
|
+
value = /* @__PURE__ */ createElement24(RenderHookComponent, {
|
|
5569
5959
|
render: column.renderValue,
|
|
5570
5960
|
renderParam: renderOptions
|
|
5571
5961
|
});
|
|
@@ -5595,22 +5985,22 @@ function getGroupColumnRender({
|
|
|
5595
5985
|
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);
|
|
5596
5986
|
const isLoading = showLoadingIcon(groupRowInfo);
|
|
5597
5987
|
if (isLoading) {
|
|
5598
|
-
icon = /* @__PURE__ */
|
|
5988
|
+
icon = /* @__PURE__ */ createElement24(LoadingIcon, null);
|
|
5599
5989
|
} else if (showExpanderIcon) {
|
|
5600
|
-
const defaultIcon = /* @__PURE__ */
|
|
5990
|
+
const defaultIcon = /* @__PURE__ */ createElement24(ExpanderIcon, {
|
|
5601
5991
|
expanded: !collapsed,
|
|
5602
5992
|
onChange: () => {
|
|
5603
5993
|
toggleGroupRow(groupKeys);
|
|
5604
5994
|
}
|
|
5605
5995
|
});
|
|
5606
|
-
icon = column.renderGroupIcon ? /* @__PURE__ */
|
|
5996
|
+
icon = column.renderGroupIcon ? /* @__PURE__ */ createElement24(RenderHookComponent, {
|
|
5607
5997
|
render: column.renderGroupIcon,
|
|
5608
5998
|
renderParam: Object.assign({ collapsed, groupIcon: defaultIcon }, renderOptions)
|
|
5609
5999
|
}) : defaultIcon;
|
|
5610
6000
|
}
|
|
5611
|
-
return /* @__PURE__ */
|
|
6001
|
+
return /* @__PURE__ */ createElement24("div", {
|
|
5612
6002
|
className: join(display.flex, alignItems.center)
|
|
5613
|
-
}, icon, /* @__PURE__ */
|
|
6003
|
+
}, icon, /* @__PURE__ */ createElement24("div", {
|
|
5614
6004
|
className: cssEllipsisClassName
|
|
5615
6005
|
}, value != null ? value : null));
|
|
5616
6006
|
};
|
|
@@ -5655,9 +6045,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
5655
6045
|
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;
|
|
5656
6046
|
const isLoading = showLoadingIcon(rowInfo);
|
|
5657
6047
|
if (isLoading) {
|
|
5658
|
-
icon = /* @__PURE__ */
|
|
6048
|
+
icon = /* @__PURE__ */ createElement24(LoadingIcon, null);
|
|
5659
6049
|
} else if (showExpanderIcon) {
|
|
5660
|
-
const defaultIcon = /* @__PURE__ */
|
|
6050
|
+
const defaultIcon = /* @__PURE__ */ createElement24(ExpanderIcon, {
|
|
5661
6051
|
expanded: !collapsed,
|
|
5662
6052
|
onChange: () => {
|
|
5663
6053
|
if (!rowInfo.isGroupRow) {
|
|
@@ -5672,9 +6062,9 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
5672
6062
|
icon = column.renderGroupIcon(renderParam);
|
|
5673
6063
|
}
|
|
5674
6064
|
}
|
|
5675
|
-
return /* @__PURE__ */
|
|
6065
|
+
return /* @__PURE__ */ createElement24("div", {
|
|
5676
6066
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
5677
|
-
}, icon, /* @__PURE__ */
|
|
6067
|
+
}, icon, /* @__PURE__ */ createElement24("div", {
|
|
5678
6068
|
className: cssEllipsisClassName
|
|
5679
6069
|
}, value != null ? value : null));
|
|
5680
6070
|
}
|
|
@@ -5690,11 +6080,11 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
5690
6080
|
}
|
|
5691
6081
|
|
|
5692
6082
|
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
5693
|
-
import { useEffect as
|
|
6083
|
+
import { useEffect as useEffect19, useRef as useRef17 } from "react";
|
|
5694
6084
|
function useEffectWithRaf(fn, deps) {
|
|
5695
|
-
const rafId =
|
|
5696
|
-
const removeFnRaf =
|
|
5697
|
-
|
|
6085
|
+
const rafId = useRef17(0);
|
|
6086
|
+
const removeFnRaf = useRef17();
|
|
6087
|
+
useEffect19(() => {
|
|
5698
6088
|
rafId.current = requestAnimationFrame(() => {
|
|
5699
6089
|
removeFnRaf.current = fn();
|
|
5700
6090
|
});
|
|
@@ -5711,7 +6101,7 @@ function useEffectWithRaf(fn, deps) {
|
|
|
5711
6101
|
}
|
|
5712
6102
|
|
|
5713
6103
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
5714
|
-
import { useCallback as
|
|
6104
|
+
import { useCallback as useCallback14 } from "react";
|
|
5715
6105
|
|
|
5716
6106
|
// src/utils/groupAndPivot/index.ts
|
|
5717
6107
|
var LAZY_ROOT_KEY_FOR_GROUPS = "____root____";
|
|
@@ -6166,7 +6556,7 @@ function enhancedFlatten(param) {
|
|
|
6166
6556
|
// src/components/DataSource/index.tsx
|
|
6167
6557
|
import {
|
|
6168
6558
|
Fragment as Fragment3,
|
|
6169
|
-
createElement as
|
|
6559
|
+
createElement as createElement25
|
|
6170
6560
|
} from "react";
|
|
6171
6561
|
|
|
6172
6562
|
// src/utils/multisort/sortTypes.ts
|
|
@@ -6355,15 +6745,15 @@ var GroupRowsState = class {
|
|
|
6355
6745
|
};
|
|
6356
6746
|
|
|
6357
6747
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
6358
|
-
import { useEffect as
|
|
6748
|
+
import { useEffect as useEffect21, useMemo as useMemo9, useRef as useRef19, useState as useState12 } from "react";
|
|
6359
6749
|
|
|
6360
6750
|
// src/components/hooks/useEffectWithChanges.ts
|
|
6361
|
-
import { useEffect as
|
|
6751
|
+
import { useEffect as useEffect20, useRef as useRef18 } from "react";
|
|
6362
6752
|
function useEffectWithChanges(fn, deps) {
|
|
6363
|
-
const prevRef =
|
|
6364
|
-
const oldValuesRef =
|
|
6753
|
+
const prevRef = useRef18({});
|
|
6754
|
+
const oldValuesRef = useRef18({});
|
|
6365
6755
|
const oldValues = oldValuesRef.current;
|
|
6366
|
-
const changesRef =
|
|
6756
|
+
const changesRef = useRef18({});
|
|
6367
6757
|
const changes = changesRef.current;
|
|
6368
6758
|
const useEffectDeps = [];
|
|
6369
6759
|
for (const k in deps) {
|
|
@@ -6376,7 +6766,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
6376
6766
|
}
|
|
6377
6767
|
}
|
|
6378
6768
|
prevRef.current = deps;
|
|
6379
|
-
|
|
6769
|
+
useEffect20(() => {
|
|
6380
6770
|
const changes2 = changesRef.current;
|
|
6381
6771
|
const result = fn(changes2, oldValues);
|
|
6382
6772
|
changesRef.current = {};
|
|
@@ -6644,12 +7034,12 @@ function useLoadData() {
|
|
|
6644
7034
|
livePaginationCursor,
|
|
6645
7035
|
cursorId: stateCursorId
|
|
6646
7036
|
} = componentState;
|
|
6647
|
-
const [scrollbars, setScrollbars] =
|
|
7037
|
+
const [scrollbars, setScrollbars] = useState12({
|
|
6648
7038
|
vertical: false,
|
|
6649
7039
|
horizontal: false
|
|
6650
7040
|
});
|
|
6651
|
-
const scrollbarsRef =
|
|
6652
|
-
|
|
7041
|
+
const scrollbarsRef = useRef19(scrollbars);
|
|
7042
|
+
useEffect21(() => {
|
|
6653
7043
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
6654
7044
|
if (!scrollbars2) {
|
|
6655
7045
|
return;
|
|
@@ -6659,7 +7049,7 @@ function useLoadData() {
|
|
|
6659
7049
|
});
|
|
6660
7050
|
return () => notifyScrollbarsChange.destroy();
|
|
6661
7051
|
}, [notifyScrollbarsChange]);
|
|
6662
|
-
|
|
7052
|
+
useEffect21(() => {
|
|
6663
7053
|
if (!livePagination) {
|
|
6664
7054
|
return;
|
|
6665
7055
|
}
|
|
@@ -6673,7 +7063,7 @@ function useLoadData() {
|
|
|
6673
7063
|
});
|
|
6674
7064
|
return () => cancelAnimationFrame(frameId);
|
|
6675
7065
|
}, [livePaginationCursor]);
|
|
6676
|
-
|
|
7066
|
+
useEffect21(() => {
|
|
6677
7067
|
if (!livePagination || livePaginationCursor !== void 0) {
|
|
6678
7068
|
return;
|
|
6679
7069
|
}
|
|
@@ -6687,7 +7077,7 @@ function useLoadData() {
|
|
|
6687
7077
|
});
|
|
6688
7078
|
return () => cancelAnimationFrame(frameId);
|
|
6689
7079
|
}, [dataArray.length, livePaginationCursor]);
|
|
6690
|
-
|
|
7080
|
+
useEffect21(() => {
|
|
6691
7081
|
const state = getComponentState();
|
|
6692
7082
|
const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
|
|
6693
7083
|
if (!scrollbars.vertical && livePagination2) {
|
|
@@ -6705,7 +7095,7 @@ function useLoadData() {
|
|
|
6705
7095
|
filterValue,
|
|
6706
7096
|
cursorId: livePagination ? stateCursorId : null
|
|
6707
7097
|
};
|
|
6708
|
-
const initialRef =
|
|
7098
|
+
const initialRef = useRef19(true);
|
|
6709
7099
|
useLazyLoadRange();
|
|
6710
7100
|
useEffectWithChanges(() => {
|
|
6711
7101
|
const componentState2 = getComponentState();
|
|
@@ -6737,7 +7127,7 @@ function useLazyLoadRange() {
|
|
|
6737
7127
|
componentActions: actions,
|
|
6738
7128
|
componentState
|
|
6739
7129
|
} = useComponentState();
|
|
6740
|
-
|
|
7130
|
+
useEffect21(() => {
|
|
6741
7131
|
actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
|
|
6742
7132
|
}, [componentState.data, componentState.dataParams]);
|
|
6743
7133
|
const {
|
|
@@ -6746,7 +7136,7 @@ function useLazyLoadRange() {
|
|
|
6746
7136
|
dataArray,
|
|
6747
7137
|
scrollStopDelayUpdatedByTable
|
|
6748
7138
|
} = componentState;
|
|
6749
|
-
const latestRenderRangeRef =
|
|
7139
|
+
const latestRenderRangeRef = useRef19(null);
|
|
6750
7140
|
const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
|
|
6751
7141
|
const componentState2 = getComponentState();
|
|
6752
7142
|
renderRange = renderRange || latestRenderRangeRef.current;
|
|
@@ -6765,8 +7155,8 @@ function useLazyLoadRange() {
|
|
|
6765
7155
|
componentActions: actions
|
|
6766
7156
|
}, cache);
|
|
6767
7157
|
};
|
|
6768
|
-
const debouncedLoadRange =
|
|
6769
|
-
|
|
7158
|
+
const debouncedLoadRange = useMemo9(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
7159
|
+
useEffect21(() => {
|
|
6770
7160
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
6771
7161
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
6772
7162
|
latestRenderRangeRef.current = renderRange;
|
|
@@ -6775,7 +7165,7 @@ function useLazyLoadRange() {
|
|
|
6775
7165
|
}
|
|
6776
7166
|
return;
|
|
6777
7167
|
}, [lazyLoadBatchSize]);
|
|
6778
|
-
|
|
7168
|
+
useEffect21(() => {
|
|
6779
7169
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
6780
7170
|
debouncedLoadRange();
|
|
6781
7171
|
}
|
|
@@ -7011,6 +7401,7 @@ var forwardProps2 = (setupState) => {
|
|
|
7011
7401
|
sortTypes: (sortTypes) => {
|
|
7012
7402
|
return __spreadValues(__spreadValues({}, sortTypes_default), sortTypes);
|
|
7013
7403
|
},
|
|
7404
|
+
sortMode: (sortMode) => sortMode != null ? sortMode : "local",
|
|
7014
7405
|
aggregationReducers: 1,
|
|
7015
7406
|
collapseGroupRowsOnDataFunctionChange: (collapseGroupRowsOnDataFunctionChange) => collapseGroupRowsOnDataFunctionChange != null ? collapseGroupRowsOnDataFunctionChange : true,
|
|
7016
7407
|
loading: (loading) => loading != null ? loading : false,
|
|
@@ -7054,7 +7445,7 @@ function mapPropsToState(params) {
|
|
|
7054
7445
|
operatorsByFilterType,
|
|
7055
7446
|
controlledSort,
|
|
7056
7447
|
controlledFilter,
|
|
7057
|
-
filterMode: ((_a = props.filterMode) != null ? _a : props.filterFunction != null) ? "
|
|
7448
|
+
filterMode: ((_a = props.filterMode) != null ? _a : props.filterFunction != null) ? "local" : typeof props.data === "function" ? "remote" : "local",
|
|
7058
7449
|
multiSort: Array.isArray(controlledSort ? props.sortInfo : props.defaultSortInfo),
|
|
7059
7450
|
lazyLoadBatchSize: typeof props.lazyLoad === "object" ? props.lazyLoad.batchSize : void 0
|
|
7060
7451
|
};
|
|
@@ -7445,7 +7836,7 @@ function concludeReducer(params) {
|
|
|
7445
7836
|
}
|
|
7446
7837
|
const { filterFunction, filterValue, filterTypes, operatorsByFilterType } = state;
|
|
7447
7838
|
const shouldFilter = !!filterFunction || Array.isArray(filterValue) && filterValue.length;
|
|
7448
|
-
const shouldFilterClientSide = shouldFilter && state.filterMode === "
|
|
7839
|
+
const shouldFilterClientSide = shouldFilter && state.filterMode === "local";
|
|
7449
7840
|
const filterDepsChanged = haveDepsChanged(previousState, state, [
|
|
7450
7841
|
"filterFunction",
|
|
7451
7842
|
"filterValue",
|
|
@@ -7454,7 +7845,7 @@ function concludeReducer(params) {
|
|
|
7454
7845
|
const filterChanged = originalDataArrayChanged || filterDepsChanged;
|
|
7455
7846
|
const sortInfoChanged = haveDepsChanged(previousState, state, ["sortInfo"]);
|
|
7456
7847
|
const sortDepsChanged = originalDataArrayChanged || filterDepsChanged || sortInfoChanged;
|
|
7457
|
-
const shouldFilterAgain = state.filterMode === "
|
|
7848
|
+
const shouldFilterAgain = state.filterMode === "local" && (filterChanged || !state.lastFilterDataArray);
|
|
7458
7849
|
const shouldSortAgain = shouldSort && (sortDepsChanged || !state.lastSortDataArray);
|
|
7459
7850
|
const groupBy = state.groupBy;
|
|
7460
7851
|
const pivotBy = state.pivotBy;
|
|
@@ -7496,7 +7887,8 @@ function concludeReducer(params) {
|
|
|
7496
7887
|
}
|
|
7497
7888
|
state.filteredCount = dataArray.length;
|
|
7498
7889
|
state.postFilterDataArray = dataArray;
|
|
7499
|
-
|
|
7890
|
+
const shouldSortClientSide = shouldSort && state.sortMode === "local";
|
|
7891
|
+
if (shouldSortClientSide) {
|
|
7500
7892
|
const prevKnownTypes = multisort.knownTypes;
|
|
7501
7893
|
multisort.knownTypes = state.sortTypes;
|
|
7502
7894
|
dataArray = shouldSortAgain ? multisort(sortInfo, [...dataArray]) : state.lastSortDataArray;
|
|
@@ -7576,7 +7968,7 @@ function DataSourceWithContext(props) {
|
|
|
7576
7968
|
if (typeof children === "function") {
|
|
7577
7969
|
children = children(computedValues);
|
|
7578
7970
|
}
|
|
7579
|
-
return /* @__PURE__ */
|
|
7971
|
+
return /* @__PURE__ */ createElement25(Fragment3, null, children);
|
|
7580
7972
|
}
|
|
7581
7973
|
var DataSourceRoot = getComponentStateRoot({
|
|
7582
7974
|
initSetupState,
|
|
@@ -7599,14 +7991,14 @@ function DataSourceCmp({ children }) {
|
|
|
7599
7991
|
globalThis.getDataSourceState = getState;
|
|
7600
7992
|
}
|
|
7601
7993
|
useLoadData();
|
|
7602
|
-
return /* @__PURE__ */
|
|
7994
|
+
return /* @__PURE__ */ createElement25(DataSourceContext.Provider, {
|
|
7603
7995
|
value: contextValue
|
|
7604
|
-
}, /* @__PURE__ */
|
|
7996
|
+
}, /* @__PURE__ */ createElement25(DataSourceWithContext, {
|
|
7605
7997
|
children
|
|
7606
7998
|
}));
|
|
7607
7999
|
}
|
|
7608
8000
|
function DataSource(props) {
|
|
7609
|
-
return /* @__PURE__ */
|
|
8001
|
+
return /* @__PURE__ */ createElement25(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement25(DataSourceCmp, {
|
|
7610
8002
|
children: props.children
|
|
7611
8003
|
}));
|
|
7612
8004
|
}
|
|
@@ -7614,7 +8006,7 @@ function DataSource(props) {
|
|
|
7614
8006
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
7615
8007
|
function useToggleGroupRow() {
|
|
7616
8008
|
const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
|
|
7617
|
-
const toggleGroupRow =
|
|
8009
|
+
const toggleGroupRow = useCallback14((groupKeys) => {
|
|
7618
8010
|
const state = getDataSourceState();
|
|
7619
8011
|
const newState = new GroupRowsState(state.groupRowsState);
|
|
7620
8012
|
newState.toggleGroupRow(groupKeys);
|
|
@@ -7646,7 +8038,7 @@ function useToggleGroupRow() {
|
|
|
7646
8038
|
|
|
7647
8039
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
7648
8040
|
function useGroupByMap(groupBy) {
|
|
7649
|
-
const groupByMap =
|
|
8041
|
+
const groupByMap = useMemo10(() => {
|
|
7650
8042
|
return groupBy.reduce((acc, groupBy2, index) => {
|
|
7651
8043
|
acc.set(groupBy2.field, {
|
|
7652
8044
|
groupBy: groupBy2,
|
|
@@ -7670,13 +8062,13 @@ function useColumnsWhen() {
|
|
|
7670
8062
|
}
|
|
7671
8063
|
} = useComponentState();
|
|
7672
8064
|
const groupByMap = useGroupByMap(groupBy);
|
|
7673
|
-
|
|
8065
|
+
useEffect22(() => {
|
|
7674
8066
|
dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
|
|
7675
8067
|
}, [groupRenderStrategy]);
|
|
7676
|
-
|
|
8068
|
+
useEffect22(() => {
|
|
7677
8069
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
7678
8070
|
}, [pivotTotalColumnPosition]);
|
|
7679
|
-
|
|
8071
|
+
useEffect22(() => {
|
|
7680
8072
|
if (pivotGrandTotalColumnPosition != void 0) {
|
|
7681
8073
|
dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
|
|
7682
8074
|
}
|
|
@@ -7750,7 +8142,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
7750
8142
|
});
|
|
7751
8143
|
return computedColumns.size === 0 ? void 0 : computedColumns;
|
|
7752
8144
|
}
|
|
7753
|
-
|
|
8145
|
+
useEffect22(() => {
|
|
7754
8146
|
const update = () => {
|
|
7755
8147
|
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
|
|
7756
8148
|
};
|
|
@@ -7779,7 +8171,7 @@ function useColumnsWhenGrouping() {
|
|
|
7779
8171
|
}
|
|
7780
8172
|
} = useComponentState();
|
|
7781
8173
|
const toggleGroupRow = useToggleGroupRow();
|
|
7782
|
-
|
|
8174
|
+
useEffect22(() => {
|
|
7783
8175
|
const update = () => {
|
|
7784
8176
|
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
7785
8177
|
columns,
|
|
@@ -7915,7 +8307,7 @@ function useHideColumns(groupByMap) {
|
|
|
7915
8307
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
7916
8308
|
hideEmptyGroupColumns
|
|
7917
8309
|
]);
|
|
7918
|
-
|
|
8310
|
+
useEffect22(() => {
|
|
7919
8311
|
const isGrouped = groupBy.length > 0;
|
|
7920
8312
|
const currentState = getComponentState();
|
|
7921
8313
|
const { controlledColumnVisibility, columnVisibility } = currentState;
|
|
@@ -8030,7 +8422,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
8030
8422
|
}
|
|
8031
8423
|
|
|
8032
8424
|
// src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
|
|
8033
|
-
import { useMemo as
|
|
8425
|
+
import { useMemo as useMemo11 } from "react";
|
|
8034
8426
|
|
|
8035
8427
|
// src/components/flexbox/index.ts
|
|
8036
8428
|
var computeFlex = (params) => {
|
|
@@ -8343,7 +8735,7 @@ var getComputedVisibleColumns = ({
|
|
|
8343
8735
|
});
|
|
8344
8736
|
const firstPinnedEndAbsoluteOffset = bodySize.width - totalPinnedEndWidth;
|
|
8345
8737
|
columnsArray.forEach((c, i) => {
|
|
8346
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
8738
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
8347
8739
|
const id = visibleColumnOrder[i];
|
|
8348
8740
|
const nextColumnId = visibleColumnOrder[i + 1];
|
|
8349
8741
|
const colType = getColumnComputedType(c, columnTypes);
|
|
@@ -8368,16 +8760,26 @@ var getComputedVisibleColumns = ({
|
|
|
8368
8760
|
const computedDataType = c.dataType || colType.dataType || (Array.isArray(c.type) ? c.type[0] : c.type) || "string";
|
|
8369
8761
|
const computedSortType = c.sortType || colType.sortType || computedDataType;
|
|
8370
8762
|
const computedFilterType = c.filterType || colType.filterType || computedDataType;
|
|
8763
|
+
const field = (_m = c.field) != null ? _m : colType.field;
|
|
8764
|
+
const valueGetter = (_n = c.valueGetter) != null ? _n : colType.valueGetter;
|
|
8765
|
+
let sortableColumnOrType = (_o = c.sortable) != null ? _o : colType.sortable;
|
|
8766
|
+
if (sortableColumnOrType == null) {
|
|
8767
|
+
if (field == null && valueGetter == null) {
|
|
8768
|
+
sortableColumnOrType = false;
|
|
8769
|
+
}
|
|
8770
|
+
}
|
|
8771
|
+
let computedSortable = (_p = sortableColumnOrType != null ? sortableColumnOrType : sortable) != null ? _p : true;
|
|
8371
8772
|
const result2 = __spreadProps(__spreadValues({
|
|
8372
8773
|
align: colType.align,
|
|
8373
8774
|
verticalAlign: colType.verticalAlign,
|
|
8374
8775
|
defaultHiddenWhenGroupedBy: colType.defaultHiddenWhenGroupedBy,
|
|
8375
|
-
valueGetter
|
|
8776
|
+
valueGetter,
|
|
8376
8777
|
valueFormatter: colType.valueFormatter,
|
|
8377
8778
|
renderValue: colType.renderValue,
|
|
8378
8779
|
render: colType.render,
|
|
8379
8780
|
style: colType.style,
|
|
8380
|
-
components: colType.components
|
|
8781
|
+
components: colType.components,
|
|
8782
|
+
field
|
|
8381
8783
|
}, c), {
|
|
8382
8784
|
computedDataType,
|
|
8383
8785
|
computedSortType,
|
|
@@ -8391,7 +8793,7 @@ var getComputedVisibleColumns = ({
|
|
|
8391
8793
|
computedAbsoluteOffset,
|
|
8392
8794
|
computedPinningOffset,
|
|
8393
8795
|
computedOffset,
|
|
8394
|
-
computedSortable
|
|
8796
|
+
computedSortable,
|
|
8395
8797
|
computedSortInfo,
|
|
8396
8798
|
computedSortIndex,
|
|
8397
8799
|
computedMultiSort: multiSort,
|
|
@@ -8400,7 +8802,7 @@ var getComputedVisibleColumns = ({
|
|
|
8400
8802
|
computedSortedDesc,
|
|
8401
8803
|
computedVisibleIndex: i,
|
|
8402
8804
|
computedPinned,
|
|
8403
|
-
computedDraggable: (
|
|
8805
|
+
computedDraggable: (_r = (_q = c.draggable) != null ? _q : draggableColumns) != null ? _r : true,
|
|
8404
8806
|
computedFirstInCategory,
|
|
8405
8807
|
computedLastInCategory,
|
|
8406
8808
|
computedFirst: i === 0,
|
|
@@ -8450,7 +8852,7 @@ var getComputedVisibleColumns = ({
|
|
|
8450
8852
|
setSortInfo(finalSortInfo);
|
|
8451
8853
|
},
|
|
8452
8854
|
id,
|
|
8453
|
-
header: (
|
|
8855
|
+
header: (_u = (_t = (_s = c.header) != null ? _s : colType.header) != null ? _t : c.name) != null ? _u : c.field
|
|
8454
8856
|
});
|
|
8455
8857
|
computedOffset += computedWidth;
|
|
8456
8858
|
computedVisibleColumnsMap.set(result2.id, result2);
|
|
@@ -8491,10 +8893,10 @@ var getComputedVisibleColumns = ({
|
|
|
8491
8893
|
};
|
|
8492
8894
|
|
|
8493
8895
|
// src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts
|
|
8494
|
-
import { useEffect as
|
|
8896
|
+
import { useEffect as useEffect23 } from "react";
|
|
8495
8897
|
var useRerenderOnKeyChange = (map2) => {
|
|
8496
8898
|
const [renderId, rerender] = useRerender();
|
|
8497
|
-
|
|
8899
|
+
useEffect23(() => {
|
|
8498
8900
|
const update = rafFn(rerender);
|
|
8499
8901
|
return interceptMap(map2, {
|
|
8500
8902
|
set: update,
|
|
@@ -8547,7 +8949,7 @@ var useComputedVisibleColumns = ({
|
|
|
8547
8949
|
computedPinnedEndOffset,
|
|
8548
8950
|
computedPinnedEndWidth,
|
|
8549
8951
|
computedPinnedStartWidth
|
|
8550
|
-
} =
|
|
8952
|
+
} = useMemo11(() => {
|
|
8551
8953
|
return getComputedVisibleColumns({
|
|
8552
8954
|
columns,
|
|
8553
8955
|
bodySize,
|
|
@@ -8615,7 +9017,7 @@ var useComputedVisibleColumns = ({
|
|
|
8615
9017
|
};
|
|
8616
9018
|
|
|
8617
9019
|
// src/components/InfiniteTable/hooks/useScrollbars.ts
|
|
8618
|
-
import { useState as
|
|
9020
|
+
import { useState as useState13, useEffect as useEffect24, useLayoutEffect as useLayoutEffect6 } from "react";
|
|
8619
9021
|
var INITIAL_SCROLLBARS = {
|
|
8620
9022
|
vertical: false,
|
|
8621
9023
|
horizontal: false
|
|
@@ -8623,8 +9025,8 @@ var INITIAL_SCROLLBARS = {
|
|
|
8623
9025
|
function useScrollbars(brain) {
|
|
8624
9026
|
const { getComponentState: getInfiniteTableState } = useComponentState();
|
|
8625
9027
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
8626
|
-
const [scrollbars, setScrollbars] =
|
|
8627
|
-
|
|
9028
|
+
const [scrollbars, setScrollbars] = useState13(INITIAL_SCROLLBARS);
|
|
9029
|
+
useEffect24(() => {
|
|
8628
9030
|
return brain.onRenderCountChange(() => {
|
|
8629
9031
|
const { scrollTopMax, scrollLeftMax } = brain;
|
|
8630
9032
|
setScrollbars({
|
|
@@ -8633,7 +9035,7 @@ function useScrollbars(brain) {
|
|
|
8633
9035
|
});
|
|
8634
9036
|
});
|
|
8635
9037
|
}, [brain]);
|
|
8636
|
-
|
|
9038
|
+
useLayoutEffect6(() => {
|
|
8637
9039
|
const dataSourceState = getDataSourceState();
|
|
8638
9040
|
const { onScrollbarsChange } = getInfiniteTableState();
|
|
8639
9041
|
const { notifyScrollbarsChange } = dataSourceState;
|
|
@@ -8664,7 +9066,7 @@ function useComputed() {
|
|
|
8664
9066
|
bodySize,
|
|
8665
9067
|
showSeparatePivotColumnForSingleAggregation
|
|
8666
9068
|
} = componentState;
|
|
8667
|
-
|
|
9069
|
+
useState14(() => {
|
|
8668
9070
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
8669
9071
|
if (rowHeight) {
|
|
8670
9072
|
componentActions.rowHeight = rowHeight;
|
|
@@ -8676,13 +9078,13 @@ function useComputed() {
|
|
|
8676
9078
|
}
|
|
8677
9079
|
});
|
|
8678
9080
|
});
|
|
8679
|
-
|
|
9081
|
+
useEffect25(() => {
|
|
8680
9082
|
dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
|
|
8681
9083
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
8682
9084
|
const { multiSort, filterValue } = dataSourceState;
|
|
8683
9085
|
useColumnGroups();
|
|
8684
9086
|
const { toggleGroupRow } = useColumnsWhen();
|
|
8685
|
-
const setSortInfo =
|
|
9087
|
+
const setSortInfo = useCallback15((sortInfo) => {
|
|
8686
9088
|
var _a2;
|
|
8687
9089
|
const newSortInfo = getDataSourceState().multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
8688
9090
|
dataSourceActions.sortInfo = newSortInfo;
|
|
@@ -8841,7 +9243,7 @@ function useDOMProps(initialDOMProps) {
|
|
|
8841
9243
|
}
|
|
8842
9244
|
|
|
8843
9245
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
8844
|
-
import { useMemo as
|
|
9246
|
+
import { useMemo as useMemo12 } from "react";
|
|
8845
9247
|
|
|
8846
9248
|
// src/components/InfiniteTable/hooks/useLicense/crc32.ts
|
|
8847
9249
|
var DEFAULT_ReversedPolynomial = 3988292384;
|
|
@@ -8999,10 +9401,10 @@ var isInsideSandbox = () => {
|
|
|
8999
9401
|
};
|
|
9000
9402
|
var isInsidePlayground = isInsideSandbox() || isInsideSandpack();
|
|
9001
9403
|
var useLicense = (licenseKey = "") => {
|
|
9002
|
-
const valid =
|
|
9404
|
+
const valid = useMemo12(() => {
|
|
9003
9405
|
let valid2 = isValidLicense(licenseKey, {
|
|
9004
9406
|
publishedAt: 1624970570587,
|
|
9005
|
-
version: "0.3.
|
|
9407
|
+
version: "0.3.6"
|
|
9006
9408
|
});
|
|
9007
9409
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
9008
9410
|
return true;
|
|
@@ -9012,6 +9414,140 @@ var useLicense = (licenseKey = "") => {
|
|
|
9012
9414
|
return valid;
|
|
9013
9415
|
};
|
|
9014
9416
|
|
|
9417
|
+
// src/components/utils/clamp.ts
|
|
9418
|
+
function clamp(value, min, max) {
|
|
9419
|
+
return Math.min(Math.max(value, min), max);
|
|
9420
|
+
}
|
|
9421
|
+
|
|
9422
|
+
// src/components/InfiniteTable/keyboardNavigationAndSelection.ts
|
|
9423
|
+
function handleRowNavigation(options) {
|
|
9424
|
+
const { key, getState, getDataSourceState, actions } = options;
|
|
9425
|
+
const arrLength = getDataSourceState().dataArray.length;
|
|
9426
|
+
const state = getState();
|
|
9427
|
+
const { brain } = state;
|
|
9428
|
+
let { activeRowIndex } = state;
|
|
9429
|
+
if (activeRowIndex == null) {
|
|
9430
|
+
return false;
|
|
9431
|
+
}
|
|
9432
|
+
const {
|
|
9433
|
+
start: [startRow],
|
|
9434
|
+
end: [endRow]
|
|
9435
|
+
} = brain.getRenderRange();
|
|
9436
|
+
const renderRowCount = endRow - startRow - 1;
|
|
9437
|
+
const min = 0;
|
|
9438
|
+
const max = arrLength - 1;
|
|
9439
|
+
const KeyToFunction = {
|
|
9440
|
+
ArrowDown: () => {
|
|
9441
|
+
activeRowIndex = clamp(activeRowIndex + 1, min, max);
|
|
9442
|
+
},
|
|
9443
|
+
ArrowUp: () => {
|
|
9444
|
+
activeRowIndex = clamp(activeRowIndex - 1, min, max);
|
|
9445
|
+
},
|
|
9446
|
+
PageDown: () => {
|
|
9447
|
+
activeRowIndex = Math.min(activeRowIndex + renderRowCount, arrLength - 1);
|
|
9448
|
+
},
|
|
9449
|
+
PageUp: () => {
|
|
9450
|
+
activeRowIndex = Math.max(activeRowIndex - renderRowCount, min);
|
|
9451
|
+
},
|
|
9452
|
+
End: () => {
|
|
9453
|
+
activeRowIndex = max;
|
|
9454
|
+
},
|
|
9455
|
+
Home: () => {
|
|
9456
|
+
activeRowIndex = min;
|
|
9457
|
+
}
|
|
9458
|
+
};
|
|
9459
|
+
const Fn = KeyToFunction[key];
|
|
9460
|
+
if (!Fn) {
|
|
9461
|
+
return false;
|
|
9462
|
+
}
|
|
9463
|
+
Fn();
|
|
9464
|
+
actions.activeRowIndex = activeRowIndex;
|
|
9465
|
+
return true;
|
|
9466
|
+
}
|
|
9467
|
+
function handleCellNavigation(options) {
|
|
9468
|
+
const { key, shiftKey, getState, getComputed, getDataSourceState, actions } = options;
|
|
9469
|
+
const state = getState();
|
|
9470
|
+
const { activeCellIndex, brain } = state;
|
|
9471
|
+
if (!activeCellIndex) {
|
|
9472
|
+
return false;
|
|
9473
|
+
}
|
|
9474
|
+
let [rowIndex, colIndex] = activeCellIndex;
|
|
9475
|
+
const {
|
|
9476
|
+
start: [startRow, startCol],
|
|
9477
|
+
end: [endRow, endCol]
|
|
9478
|
+
} = brain.getRenderRange();
|
|
9479
|
+
const renderRowCount = endRow - startRow - 1;
|
|
9480
|
+
const renderColCount = endCol - startCol - 1;
|
|
9481
|
+
const maxRow = getDataSourceState().dataArray.length - 1;
|
|
9482
|
+
const maxCol = getComputed().computedVisibleColumns.length - 1;
|
|
9483
|
+
const minRow = 0;
|
|
9484
|
+
const minCol = 0;
|
|
9485
|
+
rowIndex = clamp(rowIndex, 0, maxRow);
|
|
9486
|
+
colIndex = clamp(colIndex, 0, maxCol);
|
|
9487
|
+
actions.activeCellIndex = [rowIndex, colIndex];
|
|
9488
|
+
const KeyToFunction = {
|
|
9489
|
+
ArrowDown: () => {
|
|
9490
|
+
rowIndex = clamp(rowIndex + 1, minRow, maxRow);
|
|
9491
|
+
},
|
|
9492
|
+
ArrowUp: () => {
|
|
9493
|
+
rowIndex = clamp(rowIndex - 1, minRow, maxRow);
|
|
9494
|
+
},
|
|
9495
|
+
ArrowLeft: () => {
|
|
9496
|
+
colIndex = clamp(colIndex - 1, minCol, maxCol);
|
|
9497
|
+
},
|
|
9498
|
+
ArrowRight: () => {
|
|
9499
|
+
colIndex = clamp(colIndex + 1, minCol, maxCol);
|
|
9500
|
+
},
|
|
9501
|
+
PageDown: () => {
|
|
9502
|
+
if (!shiftKey) {
|
|
9503
|
+
rowIndex = Math.min(rowIndex + renderRowCount, maxRow);
|
|
9504
|
+
} else {
|
|
9505
|
+
colIndex = Math.min(colIndex + renderColCount, maxCol);
|
|
9506
|
+
}
|
|
9507
|
+
},
|
|
9508
|
+
PageUp: () => {
|
|
9509
|
+
if (!shiftKey) {
|
|
9510
|
+
rowIndex = Math.max(rowIndex - renderRowCount, minRow);
|
|
9511
|
+
} else {
|
|
9512
|
+
colIndex = Math.max(colIndex - renderColCount, minCol);
|
|
9513
|
+
}
|
|
9514
|
+
},
|
|
9515
|
+
End: () => {
|
|
9516
|
+
if (!shiftKey) {
|
|
9517
|
+
rowIndex = maxRow;
|
|
9518
|
+
} else {
|
|
9519
|
+
colIndex = maxCol;
|
|
9520
|
+
}
|
|
9521
|
+
},
|
|
9522
|
+
Home: () => {
|
|
9523
|
+
if (!shiftKey) {
|
|
9524
|
+
rowIndex = minRow;
|
|
9525
|
+
} else {
|
|
9526
|
+
colIndex = minCol;
|
|
9527
|
+
}
|
|
9528
|
+
}
|
|
9529
|
+
};
|
|
9530
|
+
const Fn = KeyToFunction[key];
|
|
9531
|
+
if (!Fn) {
|
|
9532
|
+
return false;
|
|
9533
|
+
}
|
|
9534
|
+
Fn();
|
|
9535
|
+
actions.activeCellIndex = [rowIndex, colIndex];
|
|
9536
|
+
return true;
|
|
9537
|
+
}
|
|
9538
|
+
function handleKeyboardNavigation(options) {
|
|
9539
|
+
const { getState } = options;
|
|
9540
|
+
const state = getState();
|
|
9541
|
+
const { activeRowIndex, activeCellIndex, keyboardNavigation } = state;
|
|
9542
|
+
if (activeRowIndex != null && keyboardNavigation === "row") {
|
|
9543
|
+
return handleRowNavigation(options);
|
|
9544
|
+
}
|
|
9545
|
+
if (activeCellIndex != null && keyboardNavigation === "cell") {
|
|
9546
|
+
return handleCellNavigation(options);
|
|
9547
|
+
}
|
|
9548
|
+
return false;
|
|
9549
|
+
}
|
|
9550
|
+
|
|
9015
9551
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
9016
9552
|
import { createRef } from "react";
|
|
9017
9553
|
|
|
@@ -9069,6 +9605,18 @@ function toMap(mapOrObject, weakMapCache) {
|
|
|
9069
9605
|
}
|
|
9070
9606
|
|
|
9071
9607
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
9608
|
+
function createRenderer2(brain) {
|
|
9609
|
+
const renderer = new ReactHeadlessTableRenderer(brain);
|
|
9610
|
+
const onRenderUpdater = buildSubscriptionCallback();
|
|
9611
|
+
brain.onDestroy(() => {
|
|
9612
|
+
renderer.destroy();
|
|
9613
|
+
onRenderUpdater.destroy();
|
|
9614
|
+
});
|
|
9615
|
+
return {
|
|
9616
|
+
renderer,
|
|
9617
|
+
onRenderUpdater
|
|
9618
|
+
};
|
|
9619
|
+
}
|
|
9072
9620
|
function initSetupState2() {
|
|
9073
9621
|
const columnsGeneratedForGrouping = new Map();
|
|
9074
9622
|
const brain = new MatrixBrain();
|
|
@@ -9082,10 +9630,16 @@ function initSetupState2() {
|
|
|
9082
9630
|
if (true) {
|
|
9083
9631
|
globalThis.brain = brain;
|
|
9084
9632
|
}
|
|
9633
|
+
const { renderer, onRenderUpdater } = createRenderer2(brain);
|
|
9085
9634
|
brain.onAvailableSizeChange((size) => {
|
|
9086
9635
|
headerBrain.setAvailableSize({ width: size.width });
|
|
9087
9636
|
});
|
|
9637
|
+
if (true) {
|
|
9638
|
+
globalThis.renderer = renderer;
|
|
9639
|
+
}
|
|
9088
9640
|
return {
|
|
9641
|
+
renderer,
|
|
9642
|
+
onRenderUpdater,
|
|
9089
9643
|
propsCache: new Map([]),
|
|
9090
9644
|
brain,
|
|
9091
9645
|
headerBrain,
|
|
@@ -9146,7 +9700,6 @@ var forwardProps3 = (setupState) => {
|
|
|
9146
9700
|
scrollStopDelay: (scrollStopDelay) => scrollStopDelay != null ? scrollStopDelay : 250,
|
|
9147
9701
|
filterEditors: (filterEditors) => __spreadValues(__spreadValues({}, defaultFilterEditors), filterEditors),
|
|
9148
9702
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
9149
|
-
activeIndex: (activeIndex) => activeIndex != null ? activeIndex : 0,
|
|
9150
9703
|
columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
|
|
9151
9704
|
columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 2e3,
|
|
9152
9705
|
columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
|
|
@@ -9161,6 +9714,9 @@ var forwardProps3 = (setupState) => {
|
|
|
9161
9714
|
pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
|
|
9162
9715
|
pivotGrandTotalColumnPosition: 1,
|
|
9163
9716
|
licenseKey: (licenseKey) => licenseKey || "",
|
|
9717
|
+
keyboardNavigation: (keyboardNavigation) => keyboardNavigation || "cell",
|
|
9718
|
+
activeRowIndex: 1,
|
|
9719
|
+
activeCellIndex: 1,
|
|
9164
9720
|
columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
|
|
9165
9721
|
header: (header) => header != null ? header : true,
|
|
9166
9722
|
showZebraRows: (showZebraRows) => showZebraRows != null ? showZebraRows : true,
|
|
@@ -9231,14 +9787,23 @@ var InfiniteTableRoot = getComponentStateRoot({
|
|
|
9231
9787
|
getParentState: () => useDataSource(),
|
|
9232
9788
|
debugName: "InfiniteTable"
|
|
9233
9789
|
});
|
|
9234
|
-
var InfiniteTableComponent =
|
|
9790
|
+
var InfiniteTableComponent = memo11(function InfiniteTableComponent2() {
|
|
9235
9791
|
var _a;
|
|
9236
|
-
const {
|
|
9792
|
+
const {
|
|
9793
|
+
componentState,
|
|
9794
|
+
getComputed,
|
|
9795
|
+
computed,
|
|
9796
|
+
componentActions: actions,
|
|
9797
|
+
getState
|
|
9798
|
+
} = useInfiniteTable();
|
|
9237
9799
|
const {
|
|
9238
9800
|
componentState: { loading },
|
|
9239
9801
|
getState: getDataSourceState,
|
|
9240
9802
|
componentActions: dataSourceActions
|
|
9241
9803
|
} = useDataSourceContextValue();
|
|
9804
|
+
const [imperativeApi] = useState15(() => {
|
|
9805
|
+
return getImperativeApi(getState, getComputed, getDataSourceState, actions);
|
|
9806
|
+
});
|
|
9242
9807
|
const {
|
|
9243
9808
|
domRef,
|
|
9244
9809
|
scrollerDOMRef,
|
|
@@ -9253,18 +9818,38 @@ var InfiniteTableComponent = memo9(function InfiniteTableComponent2() {
|
|
|
9253
9818
|
components,
|
|
9254
9819
|
scrollStopDelay,
|
|
9255
9820
|
brain,
|
|
9256
|
-
headerBrain
|
|
9821
|
+
headerBrain,
|
|
9822
|
+
renderer,
|
|
9823
|
+
keyboardNavigation,
|
|
9824
|
+
activeRowIndex,
|
|
9825
|
+
activeCellIndex,
|
|
9826
|
+
onRenderUpdater
|
|
9257
9827
|
} = componentState;
|
|
9828
|
+
useEffect27(() => {
|
|
9829
|
+
if (activeRowIndex != null) {
|
|
9830
|
+
imperativeApi.scrollRowIntoView(activeRowIndex, {
|
|
9831
|
+
offset: 30
|
|
9832
|
+
});
|
|
9833
|
+
}
|
|
9834
|
+
}, [activeRowIndex]);
|
|
9835
|
+
useEffect27(() => {
|
|
9836
|
+
if (activeCellIndex != null) {
|
|
9837
|
+
imperativeApi.scrollCellIntoView(activeCellIndex[0], activeCellIndex[1], {
|
|
9838
|
+
offset: 30
|
|
9839
|
+
});
|
|
9840
|
+
}
|
|
9841
|
+
}, [activeCellIndex]);
|
|
9258
9842
|
const { columnShifts, bodySize } = componentState;
|
|
9259
9843
|
const { scrollbars } = computed;
|
|
9260
9844
|
const { renderCell } = useCellRendering({
|
|
9845
|
+
imperativeApi,
|
|
9261
9846
|
getComputed,
|
|
9262
9847
|
domRef: componentState.domRef,
|
|
9263
9848
|
columnShifts,
|
|
9264
9849
|
bodySize,
|
|
9265
9850
|
computed
|
|
9266
9851
|
});
|
|
9267
|
-
|
|
9852
|
+
useEffect26(() => {
|
|
9268
9853
|
const dataSourceState = getDataSourceState();
|
|
9269
9854
|
const onChange = debounce((renderRange) => {
|
|
9270
9855
|
dataSourceState.notifyRenderRangeChange({
|
|
@@ -9277,35 +9862,52 @@ var InfiniteTableComponent = memo9(function InfiniteTableComponent2() {
|
|
|
9277
9862
|
const licenseValid = useLicense(licenseKey);
|
|
9278
9863
|
const domProps = useDOMProps(componentState.domProps);
|
|
9279
9864
|
const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
|
|
9280
|
-
|
|
9865
|
+
useEffect26(() => {
|
|
9281
9866
|
brain.setScrollStopDelay(scrollStopDelay);
|
|
9282
9867
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
9283
9868
|
}, [scrollStopDelay]);
|
|
9284
9869
|
useAutoSizeColumns();
|
|
9285
|
-
|
|
9870
|
+
const onKeyDown = useCallback16((event) => {
|
|
9871
|
+
if (handleKeyboardNavigation({
|
|
9872
|
+
getState,
|
|
9873
|
+
actions,
|
|
9874
|
+
getDataSourceState,
|
|
9875
|
+
getComputed,
|
|
9876
|
+
key: event.key,
|
|
9877
|
+
shiftKey: !!event.shiftKey
|
|
9878
|
+
})) {
|
|
9879
|
+
event.preventDefault();
|
|
9880
|
+
}
|
|
9881
|
+
}, []);
|
|
9882
|
+
return /* @__PURE__ */ createElement26("div", __spreadValues({
|
|
9883
|
+
onKeyDown,
|
|
9286
9884
|
ref: domRef
|
|
9287
|
-
}, domProps), header ? /* @__PURE__ */
|
|
9885
|
+
}, domProps), header ? /* @__PURE__ */ createElement26(TableHeaderWrapper, {
|
|
9288
9886
|
brain: headerBrain,
|
|
9289
9887
|
scrollbars
|
|
9290
|
-
}) : null, /* @__PURE__ */
|
|
9888
|
+
}) : null, /* @__PURE__ */ createElement26(InfiniteTableBody, null, /* @__PURE__ */ createElement26(HeadlessTable, {
|
|
9291
9889
|
tabIndex: 0,
|
|
9890
|
+
activeRowIndex: componentState.ready && keyboardNavigation === "row" ? activeRowIndex : null,
|
|
9891
|
+
activeCellIndex: componentState.ready && keyboardNavigation === "cell" ? activeCellIndex : null,
|
|
9292
9892
|
scrollStopDelay,
|
|
9893
|
+
renderer,
|
|
9894
|
+
onRenderUpdater,
|
|
9293
9895
|
brain,
|
|
9294
9896
|
renderCell,
|
|
9295
9897
|
cellHoverClassNames: HOVERED_CLASS_NAMES,
|
|
9296
9898
|
scrollerDOMRef
|
|
9297
|
-
}), /* @__PURE__ */
|
|
9899
|
+
}), /* @__PURE__ */ createElement26(LoadMaskCmp, {
|
|
9298
9900
|
visible: loading
|
|
9299
|
-
}, loadingText)), /* @__PURE__ */
|
|
9901
|
+
}, loadingText)), /* @__PURE__ */ createElement26("div", {
|
|
9300
9902
|
ref: portalDOMRef,
|
|
9301
9903
|
className: join(`${rootClassName2}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
|
|
9302
|
-
}), rowHeightCSSVar ? /* @__PURE__ */
|
|
9904
|
+
}), rowHeightCSSVar ? /* @__PURE__ */ createElement26(CSSVariableWatch, {
|
|
9303
9905
|
varName: rowHeightCSSVar,
|
|
9304
9906
|
onChange: onRowHeightCSSVarChange
|
|
9305
|
-
}) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */
|
|
9907
|
+
}) : null, columnHeaderHeightCSSVar ? /* @__PURE__ */ createElement26(CSSVariableWatch, {
|
|
9306
9908
|
varName: columnHeaderHeightCSSVar,
|
|
9307
9909
|
onChange: onColumnHeaderHeightCSSVarChange
|
|
9308
|
-
}) : null, /* @__PURE__ */
|
|
9910
|
+
}) : null, /* @__PURE__ */ createElement26(InfiniteTableFooter, null), licenseValid ? null : /* @__PURE__ */ createElement26(InfiniteTableLicenseFooter, null));
|
|
9309
9911
|
});
|
|
9310
9912
|
function InfiniteTableContextProvider() {
|
|
9311
9913
|
const { componentActions, componentState } = useComponentState();
|
|
@@ -9333,25 +9935,25 @@ function InfiniteTableContextProvider() {
|
|
|
9333
9935
|
bodySize.width = (_b = (_a = scrollerDOMRef.current) == null ? void 0 : _a.scrollWidth) != null ? _b : bodySize.width;
|
|
9334
9936
|
componentActions.bodySize = bodySize;
|
|
9335
9937
|
}, { earlyAttach: true });
|
|
9336
|
-
|
|
9938
|
+
useEffect26(() => {
|
|
9337
9939
|
return () => {
|
|
9338
9940
|
componentState.onRowHeightCSSVarChange.destroy();
|
|
9339
9941
|
componentState.onColumnHeaderHeightCSSVarChange.destroy();
|
|
9340
9942
|
};
|
|
9341
9943
|
}, []);
|
|
9342
|
-
|
|
9944
|
+
useEffect26(() => {
|
|
9343
9945
|
if (scrollerDOMRef.current) {
|
|
9344
9946
|
scrollerDOMRef.current.scrollTop = 0;
|
|
9345
9947
|
}
|
|
9346
9948
|
}, [scrollTopKey, scrollerDOMRef]);
|
|
9347
9949
|
const TableContext2 = getInfiniteTableContext();
|
|
9348
|
-
return /* @__PURE__ */
|
|
9950
|
+
return /* @__PURE__ */ createElement26(TableContext2.Provider, {
|
|
9349
9951
|
value: contextValue
|
|
9350
|
-
}, /* @__PURE__ */
|
|
9952
|
+
}, /* @__PURE__ */ createElement26(InfiniteTableComponent, null));
|
|
9351
9953
|
}
|
|
9352
9954
|
function InfiniteTable(props) {
|
|
9353
|
-
const table = /* @__PURE__ */
|
|
9354
|
-
return /* @__PURE__ */
|
|
9955
|
+
const table = /* @__PURE__ */ createElement26(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ createElement26(InfiniteTableContextProvider, null));
|
|
9956
|
+
return /* @__PURE__ */ createElement26(StrictMode, null, table);
|
|
9355
9957
|
}
|
|
9356
9958
|
InfiniteTable.defaultProps = {
|
|
9357
9959
|
rowHeight: 40,
|