@infinite-table/infinite-react 0.0.10 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +3 -5
- package/index.d.ts +166 -112
- package/index.esm.css +3 -5
- package/index.esm.js +380 -285
- package/index.js +635 -538
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -639,7 +639,7 @@ __export(exports, {
|
|
|
639
639
|
});
|
|
640
640
|
|
|
641
641
|
// src/components/InfiniteTable/index.tsx
|
|
642
|
-
var
|
|
642
|
+
var React35 = __toModule(require("react"));
|
|
643
643
|
|
|
644
644
|
// src/components/InfiniteTable/internalProps.ts
|
|
645
645
|
var rootClassName = "Infinite";
|
|
@@ -719,6 +719,17 @@ var ScrollListener = class {
|
|
|
719
719
|
}
|
|
720
720
|
};
|
|
721
721
|
|
|
722
|
+
// src/components/InfiniteTable/utils/toMap.ts
|
|
723
|
+
function toMap(mapOrObject) {
|
|
724
|
+
if (!mapOrObject) {
|
|
725
|
+
return new Map();
|
|
726
|
+
}
|
|
727
|
+
if (mapOrObject instanceof Map) {
|
|
728
|
+
return mapOrObject;
|
|
729
|
+
}
|
|
730
|
+
return new Map(Object.entries(mapOrObject));
|
|
731
|
+
}
|
|
732
|
+
|
|
722
733
|
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
723
734
|
function computeColumnGroupsDepths(columnGroups) {
|
|
724
735
|
const map2 = new Map();
|
|
@@ -742,15 +753,6 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
742
753
|
}
|
|
743
754
|
|
|
744
755
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
745
|
-
function toMap(mapOrObject) {
|
|
746
|
-
if (!mapOrObject) {
|
|
747
|
-
return new Map();
|
|
748
|
-
}
|
|
749
|
-
if (mapOrObject instanceof Map) {
|
|
750
|
-
return mapOrObject;
|
|
751
|
-
}
|
|
752
|
-
return new Map(Object.entries(mapOrObject));
|
|
753
|
-
}
|
|
754
756
|
function toColumnTypesMap(mapOrObject) {
|
|
755
757
|
return toMap(mapOrObject);
|
|
756
758
|
}
|
|
@@ -820,6 +822,7 @@ var forwardProps = () => {
|
|
|
820
822
|
columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 2e3,
|
|
821
823
|
columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
|
|
822
824
|
draggableColumns: (draggableColumns) => draggableColumns != null ? draggableColumns : true,
|
|
825
|
+
showSeparatePivotColumnForSingleAggregation: (showSeparatePivotColumnForSingleAggregation) => showSeparatePivotColumnForSingleAggregation != null ? showSeparatePivotColumnForSingleAggregation : false,
|
|
823
826
|
sortable: (sortable) => sortable != null ? sortable : true,
|
|
824
827
|
hideEmptyGroupColumns: (hideEmptyGroupColumns) => hideEmptyGroupColumns != null ? hideEmptyGroupColumns : false,
|
|
825
828
|
pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
|
|
@@ -831,7 +834,10 @@ var forwardProps = () => {
|
|
|
831
834
|
virtualizeColumns: (virtualizeColumns) => virtualizeColumns != null ? virtualizeColumns : true,
|
|
832
835
|
rowHeight: (rowHeight) => typeof rowHeight === "number" ? rowHeight : 0,
|
|
833
836
|
headerHeight: (headerHeight) => typeof headerHeight === "number" ? headerHeight : 0,
|
|
834
|
-
columnVisibility: (columnVisibility) =>
|
|
837
|
+
columnVisibility: (columnVisibility) => {
|
|
838
|
+
var _a;
|
|
839
|
+
return (_a = toMap(columnVisibility)) != null ? _a : new Map();
|
|
840
|
+
},
|
|
835
841
|
columnPinning: (columnPinning) => columnPinning != null ? columnPinning : new Map(),
|
|
836
842
|
columnSizing: (columnSizing) => {
|
|
837
843
|
var _a;
|
|
@@ -841,21 +847,20 @@ var forwardProps = () => {
|
|
|
841
847
|
var _a;
|
|
842
848
|
return (_a = toColumnTypesMap(columnTypes)) != null ? _a : new Map();
|
|
843
849
|
},
|
|
844
|
-
columnAggregations: (columnAggregations) => columnAggregations != null ? columnAggregations : new Map(),
|
|
845
850
|
collapsedColumnGroups: (collapsedColumnGroups) => collapsedColumnGroups != null ? collapsedColumnGroups : new Map(),
|
|
846
851
|
columnGroups: (columnGroups) => columnGroups != null ? columnGroups : new Map()
|
|
847
852
|
};
|
|
848
853
|
};
|
|
849
854
|
function getGroupRenderStrategy(options) {
|
|
850
|
-
const {
|
|
855
|
+
const { groupBy, groupColumn, groupRenderStrategy } = options;
|
|
851
856
|
if (groupRenderStrategy) {
|
|
852
857
|
return groupRenderStrategy;
|
|
853
858
|
}
|
|
854
859
|
if (groupColumn != null && typeof groupColumn === "object") {
|
|
855
860
|
return "single-column";
|
|
856
861
|
}
|
|
857
|
-
const
|
|
858
|
-
if (
|
|
862
|
+
const columnsInGroupBy = groupBy.filter((g) => g.column);
|
|
863
|
+
if (columnsInGroupBy.length) {
|
|
859
864
|
return "multi-column";
|
|
860
865
|
}
|
|
861
866
|
return "multi-column";
|
|
@@ -866,16 +871,17 @@ var mapPropsToState = (params) => {
|
|
|
866
871
|
const computedColumnGroups = state.pivotColumnGroups || state.columnGroups;
|
|
867
872
|
const virtualizeHeader = header && virtualizeColumns && (!computedColumnGroups || (computedColumnGroups == null ? void 0 : computedColumnGroups.size) === 0);
|
|
868
873
|
const columnGroupsDepthsMap = state.columnGroups && state.columnGroups != (oldState == null ? void 0 : oldState.columnGroups) || state.pivotColumnGroups && state.pivotColumnGroups != (oldState == null ? void 0 : oldState.pivotColumnGroups) ? computeColumnGroupsDepths(computedColumnGroups) : state.columnGroupsDepthsMap;
|
|
869
|
-
const
|
|
874
|
+
const groupBy = parentState == null ? void 0 : parentState.groupBy;
|
|
870
875
|
const groupRenderStrategy = getGroupRenderStrategy({
|
|
871
876
|
groupRenderStrategy: props.groupRenderStrategy,
|
|
872
|
-
|
|
877
|
+
groupBy,
|
|
873
878
|
groupColumn: props.groupColumn
|
|
874
879
|
});
|
|
880
|
+
const computedColumns = state.computedPivotColumns || state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns;
|
|
875
881
|
return {
|
|
876
882
|
groupRenderStrategy,
|
|
877
|
-
|
|
878
|
-
computedColumns
|
|
883
|
+
groupBy,
|
|
884
|
+
computedColumns,
|
|
879
885
|
virtualizeHeader,
|
|
880
886
|
columnGroupsDepthsMap,
|
|
881
887
|
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
|
|
@@ -1653,37 +1659,10 @@ var useComputedVisibleColumns = ({
|
|
|
1653
1659
|
var sortAscending = (a, b) => a - b;
|
|
1654
1660
|
|
|
1655
1661
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
1656
|
-
var
|
|
1657
|
-
|
|
1658
|
-
// src/components/InfiniteTable/hooks/useColumnAggregations.ts
|
|
1659
|
-
var import_react12 = __toModule(require("react"));
|
|
1660
|
-
|
|
1661
|
-
// src/components/DataSource/publicHooks/useDataSourceActions.ts
|
|
1662
|
-
var React3 = __toModule(require("react"));
|
|
1663
|
-
|
|
1664
|
-
// src/components/DataSource/DataSourceContext.ts
|
|
1665
|
-
var React2 = __toModule(require("react"));
|
|
1666
|
-
var DSContext;
|
|
1667
|
-
function getDataSourceContext() {
|
|
1668
|
-
if (DSContext) {
|
|
1669
|
-
return DSContext;
|
|
1670
|
-
}
|
|
1671
|
-
return DSContext = React2.createContext({
|
|
1672
|
-
getState: () => null,
|
|
1673
|
-
componentState: null,
|
|
1674
|
-
componentActions: null
|
|
1675
|
-
});
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
// src/components/DataSource/publicHooks/useDataSourceActions.ts
|
|
1679
|
-
function useDataSourceActions() {
|
|
1680
|
-
const DataSourceContext = getDataSourceContext();
|
|
1681
|
-
const contextValue = React3.useContext(DataSourceContext);
|
|
1682
|
-
return contextValue.componentActions;
|
|
1683
|
-
}
|
|
1662
|
+
var import_react19 = __toModule(require("react"));
|
|
1684
1663
|
|
|
1685
1664
|
// src/components/hooks/useComponentState.tsx
|
|
1686
|
-
var
|
|
1665
|
+
var React2 = __toModule(require("react"));
|
|
1687
1666
|
var import_react11 = __toModule(require("react"));
|
|
1688
1667
|
|
|
1689
1668
|
// src/utils/proxyFnCall.ts
|
|
@@ -1813,7 +1792,7 @@ function forwardProps2(propsToForward, props) {
|
|
|
1813
1792
|
return mappedState;
|
|
1814
1793
|
}
|
|
1815
1794
|
function getComponentStateRoot(config) {
|
|
1816
|
-
return
|
|
1795
|
+
return React2.memo(function ComponentStateRoot(props) {
|
|
1817
1796
|
var _a, _b;
|
|
1818
1797
|
const propsToStateSetRef = (0, import_react11.useRef)(new Set());
|
|
1819
1798
|
const propsToForward = (0, import_react11.useMemo)(() => config.forwardProps ? config.forwardProps() : {}, []);
|
|
@@ -1918,7 +1897,7 @@ function getComponentStateRoot(config) {
|
|
|
1918
1897
|
if (oldValue === newValue) {
|
|
1919
1898
|
continue;
|
|
1920
1899
|
}
|
|
1921
|
-
if (isControlled(key, props)) {
|
|
1900
|
+
if (isControlled(key, props) || isControlled(key, prevProps)) {
|
|
1922
1901
|
if (propsToForward.hasOwnProperty(k)) {
|
|
1923
1902
|
let valueToSet = newValue;
|
|
1924
1903
|
const forwardFn = propsToForward[k];
|
|
@@ -1948,61 +1927,47 @@ function getComponentStateRoot(config) {
|
|
|
1948
1927
|
});
|
|
1949
1928
|
}
|
|
1950
1929
|
});
|
|
1951
|
-
return /* @__PURE__ */
|
|
1930
|
+
return /* @__PURE__ */ React2.createElement(Context.Provider, {
|
|
1952
1931
|
value: contextValue
|
|
1953
1932
|
}, props.children);
|
|
1954
1933
|
});
|
|
1955
1934
|
}
|
|
1956
1935
|
function useComponentState() {
|
|
1957
1936
|
const Context = getComponentStateContext();
|
|
1958
|
-
return
|
|
1937
|
+
return React2.useContext(Context);
|
|
1959
1938
|
}
|
|
1960
1939
|
|
|
1961
|
-
// src/components/
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
getter: (data) => colField ? data[colField] : data
|
|
1977
|
-
}, aggregator);
|
|
1978
|
-
reducers.push(newAggregator);
|
|
1979
|
-
});
|
|
1980
|
-
dataSourceActions.aggregationReducers = reducers;
|
|
1981
|
-
}
|
|
1982
|
-
updateDataSourceAggregations();
|
|
1983
|
-
return interceptMap(columnAggregations, {
|
|
1984
|
-
clear: updateDataSourceAggregations,
|
|
1985
|
-
delete: updateDataSourceAggregations,
|
|
1986
|
-
set: updateDataSourceAggregations
|
|
1987
|
-
});
|
|
1988
|
-
}, [columnAggregations]);
|
|
1940
|
+
// src/components/DataSource/publicHooks/useDataSource.ts
|
|
1941
|
+
var React4 = __toModule(require("react"));
|
|
1942
|
+
|
|
1943
|
+
// src/components/DataSource/DataSourceContext.ts
|
|
1944
|
+
var React3 = __toModule(require("react"));
|
|
1945
|
+
var DSContext;
|
|
1946
|
+
function getDataSourceContext() {
|
|
1947
|
+
if (DSContext) {
|
|
1948
|
+
return DSContext;
|
|
1949
|
+
}
|
|
1950
|
+
return DSContext = React3.createContext({
|
|
1951
|
+
getState: () => null,
|
|
1952
|
+
componentState: null,
|
|
1953
|
+
componentActions: null
|
|
1954
|
+
});
|
|
1989
1955
|
}
|
|
1990
1956
|
|
|
1991
1957
|
// src/components/DataSource/publicHooks/useDataSource.ts
|
|
1992
|
-
var React5 = __toModule(require("react"));
|
|
1993
1958
|
function useDataSource() {
|
|
1994
1959
|
const DataSourceContext = getDataSourceContext();
|
|
1995
|
-
const contextValue =
|
|
1960
|
+
const contextValue = React4.useContext(DataSourceContext);
|
|
1996
1961
|
return contextValue.componentState;
|
|
1997
1962
|
}
|
|
1998
1963
|
function useDataSourceContextValue() {
|
|
1999
1964
|
const DataSourceContext = getDataSourceContext();
|
|
2000
|
-
const contextValue =
|
|
1965
|
+
const contextValue = React4.useContext(DataSourceContext);
|
|
2001
1966
|
return contextValue;
|
|
2002
1967
|
}
|
|
2003
1968
|
|
|
2004
1969
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
2005
|
-
var
|
|
1970
|
+
var import_react12 = __toModule(require("react"));
|
|
2006
1971
|
function useColumnGroups() {
|
|
2007
1972
|
const {
|
|
2008
1973
|
componentState: {
|
|
@@ -2012,7 +1977,7 @@ function useColumnGroups() {
|
|
|
2012
1977
|
componentActions,
|
|
2013
1978
|
getComponentState
|
|
2014
1979
|
} = useComponentState();
|
|
2015
|
-
(0,
|
|
1980
|
+
(0, import_react12.useEffect)(() => {
|
|
2016
1981
|
const recompute = () => {
|
|
2017
1982
|
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
2018
1983
|
};
|
|
@@ -2023,7 +1988,7 @@ function useColumnGroups() {
|
|
|
2023
1988
|
set: update
|
|
2024
1989
|
});
|
|
2025
1990
|
}, [computedColumnGroups]);
|
|
2026
|
-
(0,
|
|
1991
|
+
(0, import_react12.useEffect)(() => {
|
|
2027
1992
|
return interceptMap(collapsedColumnGroups, {
|
|
2028
1993
|
set: (key, visibleCol) => {
|
|
2029
1994
|
const colIds = key.slice(1);
|
|
@@ -2055,41 +2020,28 @@ function useColumnGroups() {
|
|
|
2055
2020
|
}
|
|
2056
2021
|
|
|
2057
2022
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
2058
|
-
var
|
|
2023
|
+
var import_react18 = __toModule(require("react"));
|
|
2059
2024
|
|
|
2060
2025
|
// src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
|
|
2061
|
-
var
|
|
2026
|
+
var React6 = __toModule(require("react"));
|
|
2062
2027
|
|
|
2063
2028
|
// src/utils/join.ts
|
|
2064
2029
|
var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
|
|
2065
2030
|
|
|
2066
2031
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
2067
|
-
var
|
|
2068
|
-
var
|
|
2032
|
+
var React5 = __toModule(require("react"));
|
|
2033
|
+
var import_react13 = __toModule(require("react"));
|
|
2069
2034
|
|
|
2070
|
-
// src/components/InfiniteTable/
|
|
2071
|
-
var
|
|
2072
|
-
var
|
|
2073
|
-
var
|
|
2074
|
-
var display = { flex: "_16lm1iwj", block: "_16lm1iwk", inlineBlock: "_16lm1iwl" };
|
|
2075
|
-
var fill = { currentColor: "_16lm1iw5", accentColor: "_16lm1iw6" };
|
|
2076
|
-
var flex = { "1": "_16lm1iwc", none: "_16lm1iwd" };
|
|
2077
|
-
var flexFlow = { column: "_16lm1iwz", row: "_16lm1iw10" };
|
|
2078
|
-
var justifyContent = { center: "_16lm1iw13", start: "_16lm1iw14", end: "_16lm1iw15" };
|
|
2079
|
-
var left = { "0": "_16lm1iwt", "100%": "_16lm1iwu" };
|
|
2080
|
-
var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
|
|
2081
|
-
var top = { "0": "_16lm1iwr", "100%": "_16lm1iws" };
|
|
2082
|
-
var transform = { translateZero: "_16lm1iw9", rotate90: "_16lm1iwa" };
|
|
2083
|
-
var transformTranslateZero = "_16lm1iw8";
|
|
2084
|
-
var userSelect = { none: "_16lm1iwm" };
|
|
2085
|
-
var willChange = { transform: "_16lm1iw19" };
|
|
2086
|
-
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
2035
|
+
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
2036
|
+
var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
2037
|
+
var ExpanderIconCls = "_16lm1iw6 _16lm1iwd _16lm1iwb";
|
|
2038
|
+
var ExpanderIconClsVariants = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwa", false: "_198z9782" } }, defaultVariants: {}, compoundVariants: [] });
|
|
2087
2039
|
|
|
2088
2040
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
2089
2041
|
function ExpanderIcon(props) {
|
|
2090
2042
|
var _a;
|
|
2091
2043
|
const { size = 24 } = props;
|
|
2092
|
-
const [expanded, setExpanded] = (0,
|
|
2044
|
+
const [expanded, setExpanded] = (0, import_react13.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
2093
2045
|
const onClick = () => {
|
|
2094
2046
|
var _a2;
|
|
2095
2047
|
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
@@ -2097,12 +2049,12 @@ function ExpanderIcon(props) {
|
|
|
2097
2049
|
setExpanded(!expanded);
|
|
2098
2050
|
}
|
|
2099
2051
|
};
|
|
2100
|
-
|
|
2052
|
+
React5.useEffect(() => {
|
|
2101
2053
|
if (isControlled("expanded", props)) {
|
|
2102
2054
|
setExpanded(props.expanded);
|
|
2103
2055
|
}
|
|
2104
2056
|
}, [props.expanded]);
|
|
2105
|
-
return /* @__PURE__ */
|
|
2057
|
+
return /* @__PURE__ */ React5.createElement("svg", {
|
|
2106
2058
|
"data-name": "expander-icon",
|
|
2107
2059
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2108
2060
|
height: `${size}px`,
|
|
@@ -2110,18 +2062,37 @@ function ExpanderIcon(props) {
|
|
|
2110
2062
|
width: `${size}px`,
|
|
2111
2063
|
style: props.style,
|
|
2112
2064
|
onClick,
|
|
2113
|
-
className: join(props.className,
|
|
2114
|
-
|
|
2065
|
+
className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
|
|
2066
|
+
expanded
|
|
2067
|
+
}), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`)
|
|
2068
|
+
}, /* @__PURE__ */ React5.createElement("path", {
|
|
2115
2069
|
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
2116
2070
|
}));
|
|
2117
2071
|
}
|
|
2118
2072
|
|
|
2119
2073
|
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
2120
|
-
var
|
|
2074
|
+
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
2121
2075
|
var GroupRowExpanderCls = "_7pupv0b";
|
|
2122
|
-
var RowClsRecipe = (0,
|
|
2076
|
+
var RowClsRecipe = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "_7pupv00", variantClassNames: { zebra: { false: "_7pupv02", even: "_7pupv03", odd: "_7pupv04" }, groupRow: { true: "_7pupv05", false: "_7pupv06" }, inlineGroupRow: { true: "_7pupv07", false: "_7pupv08" }, showHoverRows: { true: "_7pupv09", false: "_7pupv0a" } }, defaultVariants: {}, compoundVariants: [] });
|
|
2123
2077
|
var RowHoverCls = "_7pupv01";
|
|
2124
2078
|
|
|
2079
|
+
// src/components/InfiniteTable/utilities.css.ts
|
|
2080
|
+
var alignItems = { center: "_16lm1iw11", stretch: "_16lm1iw12" };
|
|
2081
|
+
var cssEllipsisClassName = "_16lm1iw1a _16lm1iw1b _16lm1iw16";
|
|
2082
|
+
var cursor = { pointer: "_16lm1iwb" };
|
|
2083
|
+
var display = { flex: "_16lm1iwj", block: "_16lm1iwk", inlineBlock: "_16lm1iwl" };
|
|
2084
|
+
var flex = { "1": "_16lm1iwc", none: "_16lm1iwd" };
|
|
2085
|
+
var flexFlow = { column: "_16lm1iwz", row: "_16lm1iw10" };
|
|
2086
|
+
var justifyContent = { center: "_16lm1iw13", start: "_16lm1iw14", end: "_16lm1iw15" };
|
|
2087
|
+
var left = { "0": "_16lm1iwt", "100%": "_16lm1iwu" };
|
|
2088
|
+
var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
|
|
2089
|
+
var top = { "0": "_16lm1iwr", "100%": "_16lm1iws" };
|
|
2090
|
+
var transform = { translateZero: "_16lm1iw9", rotate90: "_16lm1iwa" };
|
|
2091
|
+
var transformTranslateZero = "_16lm1iw8";
|
|
2092
|
+
var userSelect = { none: "_16lm1iwm" };
|
|
2093
|
+
var willChange = { transform: "_16lm1iw19" };
|
|
2094
|
+
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
2095
|
+
|
|
2125
2096
|
// src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
|
|
2126
2097
|
function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params) {
|
|
2127
2098
|
if (!pivotColumns) {
|
|
@@ -2131,7 +2102,7 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
|
|
|
2131
2102
|
pivotColumn,
|
|
2132
2103
|
pivotRowLabelsColumn,
|
|
2133
2104
|
pivotBy,
|
|
2134
|
-
|
|
2105
|
+
groupBy,
|
|
2135
2106
|
pivotTotalColumnPosition,
|
|
2136
2107
|
toggleGroupRow
|
|
2137
2108
|
} = params;
|
|
@@ -2148,7 +2119,7 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
|
|
|
2148
2119
|
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
2149
2120
|
column,
|
|
2150
2121
|
pivotBy,
|
|
2151
|
-
|
|
2122
|
+
groupBy
|
|
2152
2123
|
}));
|
|
2153
2124
|
} else {
|
|
2154
2125
|
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
@@ -2160,7 +2131,7 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
|
|
|
2160
2131
|
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn({
|
|
2161
2132
|
column,
|
|
2162
2133
|
pivotBy,
|
|
2163
|
-
|
|
2134
|
+
groupBy
|
|
2164
2135
|
}));
|
|
2165
2136
|
} else {
|
|
2166
2137
|
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn);
|
|
@@ -2169,19 +2140,19 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
|
|
|
2169
2140
|
if (!column.render) {
|
|
2170
2141
|
column.render = (renderOptions) => {
|
|
2171
2142
|
var _a;
|
|
2172
|
-
let { value, rowInfo, column: column2,
|
|
2143
|
+
let { value, rowInfo, column: column2, groupBy: groupBy2 } = renderOptions;
|
|
2173
2144
|
if (column2.renderValue) {
|
|
2174
2145
|
value = column2.renderValue(renderOptions);
|
|
2175
2146
|
}
|
|
2176
|
-
const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) <
|
|
2177
|
-
return /* @__PURE__ */
|
|
2147
|
+
const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < groupBy2.length;
|
|
2148
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
2178
2149
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2179
|
-
}, showExpanderIcon ? /* @__PURE__ */
|
|
2150
|
+
}, showExpanderIcon ? /* @__PURE__ */ React6.createElement(ExpanderIcon, {
|
|
2180
2151
|
expanded: !rowInfo.collapsed,
|
|
2181
2152
|
onChange: () => {
|
|
2182
2153
|
toggleGroupRow(rowInfo.groupKeys);
|
|
2183
2154
|
}
|
|
2184
|
-
}) : null, /* @__PURE__ */
|
|
2155
|
+
}) : null, /* @__PURE__ */ React6.createElement("div", {
|
|
2185
2156
|
className: cssEllipsisClassName
|
|
2186
2157
|
}, value != null ? value : null));
|
|
2187
2158
|
};
|
|
@@ -2198,7 +2169,7 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
|
|
|
2198
2169
|
}
|
|
2199
2170
|
|
|
2200
2171
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2201
|
-
var
|
|
2172
|
+
var React7 = __toModule(require("react"));
|
|
2202
2173
|
function getGroupColumnRender({
|
|
2203
2174
|
groupIndexForColumn,
|
|
2204
2175
|
groupRenderStrategy,
|
|
@@ -2231,14 +2202,14 @@ function getGroupColumnRender({
|
|
|
2231
2202
|
return null;
|
|
2232
2203
|
}
|
|
2233
2204
|
}
|
|
2234
|
-
return /* @__PURE__ */
|
|
2205
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
2235
2206
|
className: join(display.flex, alignItems.center)
|
|
2236
|
-
}, /* @__PURE__ */
|
|
2207
|
+
}, /* @__PURE__ */ React7.createElement(ExpanderIcon, {
|
|
2237
2208
|
expanded: !collapsed,
|
|
2238
2209
|
onChange: () => {
|
|
2239
2210
|
toggleGroupRow(groupKeys);
|
|
2240
2211
|
}
|
|
2241
|
-
}), /* @__PURE__ */
|
|
2212
|
+
}), /* @__PURE__ */ React7.createElement("div", {
|
|
2242
2213
|
className: cssEllipsisClassName
|
|
2243
2214
|
}, value != null ? value : null));
|
|
2244
2215
|
};
|
|
@@ -2271,7 +2242,7 @@ function getColumnForGroupBy(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2271
2242
|
function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
2272
2243
|
let generatedGroupColumn = {
|
|
2273
2244
|
header: `Group`,
|
|
2274
|
-
groupByField: options.
|
|
2245
|
+
groupByField: options.groupBy.map((g) => g.field),
|
|
2275
2246
|
sortable: false,
|
|
2276
2247
|
render: (renderOptions) => {
|
|
2277
2248
|
let { value, rowInfo, column } = renderOptions;
|
|
@@ -2281,14 +2252,14 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2281
2252
|
if (column.renderValue) {
|
|
2282
2253
|
value = column.renderValue(renderOptions);
|
|
2283
2254
|
}
|
|
2284
|
-
return /* @__PURE__ */
|
|
2255
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
2285
2256
|
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2286
|
-
}, /* @__PURE__ */
|
|
2257
|
+
}, /* @__PURE__ */ React7.createElement(ExpanderIcon, {
|
|
2287
2258
|
expanded: !rowInfo.collapsed,
|
|
2288
2259
|
onChange: () => {
|
|
2289
2260
|
toggleGroupRow(rowInfo.groupKeys);
|
|
2290
2261
|
}
|
|
2291
|
-
}), /* @__PURE__ */
|
|
2262
|
+
}), /* @__PURE__ */ React7.createElement("div", {
|
|
2292
2263
|
className: cssEllipsisClassName
|
|
2293
2264
|
}, value != null ? value : null));
|
|
2294
2265
|
}
|
|
@@ -2304,10 +2275,10 @@ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
|
2304
2275
|
}
|
|
2305
2276
|
|
|
2306
2277
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
2307
|
-
var
|
|
2278
|
+
var import_react17 = __toModule(require("react"));
|
|
2308
2279
|
|
|
2309
2280
|
// src/components/DataSource/index.tsx
|
|
2310
|
-
var
|
|
2281
|
+
var React8 = __toModule(require("react"));
|
|
2311
2282
|
|
|
2312
2283
|
// src/utils/multisort/sortTypes.ts
|
|
2313
2284
|
var numberComparator = function(first, second) {
|
|
@@ -2384,15 +2355,15 @@ var getMultisortFunction = (sortInfo, get) => {
|
|
|
2384
2355
|
};
|
|
2385
2356
|
|
|
2386
2357
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
2387
|
-
var
|
|
2358
|
+
var import_react15 = __toModule(require("react"));
|
|
2388
2359
|
|
|
2389
2360
|
// src/components/hooks/useEffectWithChanges.ts
|
|
2390
|
-
var
|
|
2361
|
+
var import_react14 = __toModule(require("react"));
|
|
2391
2362
|
function useEffectWithChanges(fn, deps) {
|
|
2392
|
-
const prevRef = (0,
|
|
2393
|
-
const oldValuesRef = (0,
|
|
2363
|
+
const prevRef = (0, import_react14.useRef)({});
|
|
2364
|
+
const oldValuesRef = (0, import_react14.useRef)({});
|
|
2394
2365
|
const oldValues = oldValuesRef.current;
|
|
2395
|
-
const changesRef = (0,
|
|
2366
|
+
const changesRef = (0, import_react14.useRef)({});
|
|
2396
2367
|
const changes = changesRef.current;
|
|
2397
2368
|
const useEffectDeps = [];
|
|
2398
2369
|
for (let k in deps) {
|
|
@@ -2405,7 +2376,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
2405
2376
|
}
|
|
2406
2377
|
}
|
|
2407
2378
|
prevRef.current = deps;
|
|
2408
|
-
(0,
|
|
2379
|
+
(0, import_react14.useEffect)(() => {
|
|
2409
2380
|
const changes2 = changesRef.current;
|
|
2410
2381
|
const result = fn(changes2, oldValues);
|
|
2411
2382
|
changesRef.current = {};
|
|
@@ -2421,7 +2392,7 @@ function buildDataSourceDataParams(componentState) {
|
|
|
2421
2392
|
const dataSourceParams = {
|
|
2422
2393
|
originalDataArray: componentState.originalDataArray,
|
|
2423
2394
|
sortInfo,
|
|
2424
|
-
|
|
2395
|
+
groupBy: componentState.groupBy,
|
|
2425
2396
|
pivotBy: componentState.pivotBy
|
|
2426
2397
|
};
|
|
2427
2398
|
if (componentState.livePagination !== void 0) {
|
|
@@ -2469,7 +2440,7 @@ function useLoadData() {
|
|
|
2469
2440
|
componentActions: actions,
|
|
2470
2441
|
componentState: { data }
|
|
2471
2442
|
} = useComponentState();
|
|
2472
|
-
(0,
|
|
2443
|
+
(0, import_react15.useLayoutEffect)(() => {
|
|
2473
2444
|
loadData(data, getComponentState(), actions);
|
|
2474
2445
|
}, [data]);
|
|
2475
2446
|
useLivePagination();
|
|
@@ -2483,17 +2454,17 @@ function useLivePagination() {
|
|
|
2483
2454
|
const {
|
|
2484
2455
|
notifyScrollbarsChange,
|
|
2485
2456
|
sortInfo,
|
|
2486
|
-
|
|
2457
|
+
groupBy,
|
|
2487
2458
|
pivotBy,
|
|
2488
2459
|
livePaginationCursor,
|
|
2489
2460
|
scrollBottomId
|
|
2490
2461
|
} = componentState;
|
|
2491
|
-
const [scrollbars, setScrollbars] = (0,
|
|
2462
|
+
const [scrollbars, setScrollbars] = (0, import_react15.useState)({
|
|
2492
2463
|
vertical: false,
|
|
2493
2464
|
horizontal: false
|
|
2494
2465
|
});
|
|
2495
|
-
const scrollbarsRef = (0,
|
|
2496
|
-
(0,
|
|
2466
|
+
const scrollbarsRef = (0, import_react15.useRef)(scrollbars);
|
|
2467
|
+
(0, import_react15.useEffect)(() => {
|
|
2497
2468
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
2498
2469
|
if (!scrollbars2) {
|
|
2499
2470
|
return;
|
|
@@ -2503,8 +2474,8 @@ function useLivePagination() {
|
|
|
2503
2474
|
});
|
|
2504
2475
|
return () => notifyScrollbarsChange.destroy();
|
|
2505
2476
|
}, [notifyScrollbarsChange]);
|
|
2506
|
-
const [cursorId, updateCursorId] = (0,
|
|
2507
|
-
(0,
|
|
2477
|
+
const [cursorId, updateCursorId] = (0, import_react15.useState)(void 0);
|
|
2478
|
+
(0, import_react15.useEffect)(() => {
|
|
2508
2479
|
const frameId = requestAnimationFrame(() => {
|
|
2509
2480
|
var _a;
|
|
2510
2481
|
if (!((_a = scrollbarsRef.current) == null ? void 0 : _a.vertical)) {
|
|
@@ -2513,18 +2484,18 @@ function useLivePagination() {
|
|
|
2513
2484
|
});
|
|
2514
2485
|
return () => cancelAnimationFrame(frameId);
|
|
2515
2486
|
}, [livePaginationCursor]);
|
|
2516
|
-
(0,
|
|
2487
|
+
(0, import_react15.useEffect)(() => {
|
|
2517
2488
|
const { livePaginationCursor: livePaginationCursor2, livePagination } = getComponentState();
|
|
2518
2489
|
if (!scrollbars.vertical && livePagination) {
|
|
2519
2490
|
updateCursorId(livePaginationCursor2);
|
|
2520
2491
|
}
|
|
2521
2492
|
}, [scrollbars.vertical]);
|
|
2522
|
-
(0,
|
|
2493
|
+
(0, import_react15.useEffect)(() => {
|
|
2523
2494
|
updateCursorId(scrollBottomId);
|
|
2524
2495
|
}, [scrollBottomId]);
|
|
2525
2496
|
const depsObject = {
|
|
2526
2497
|
sortInfo,
|
|
2527
|
-
|
|
2498
|
+
groupBy,
|
|
2528
2499
|
pivotBy,
|
|
2529
2500
|
cursorId
|
|
2530
2501
|
};
|
|
@@ -2543,7 +2514,7 @@ var normalizeSortInfo = (sortInfo) => {
|
|
|
2543
2514
|
};
|
|
2544
2515
|
|
|
2545
2516
|
// src/components/hooks/useOnce.ts
|
|
2546
|
-
var
|
|
2517
|
+
var import_react16 = __toModule(require("react"));
|
|
2547
2518
|
function once(fn) {
|
|
2548
2519
|
let called = false;
|
|
2549
2520
|
let result = null;
|
|
@@ -2558,7 +2529,7 @@ function once(fn) {
|
|
|
2558
2529
|
return onceFn;
|
|
2559
2530
|
}
|
|
2560
2531
|
function useOnce(fn) {
|
|
2561
|
-
const onceFn = (0,
|
|
2532
|
+
const onceFn = (0, import_react16.useMemo)(() => {
|
|
2562
2533
|
return once(fn);
|
|
2563
2534
|
}, []);
|
|
2564
2535
|
return onceFn();
|
|
@@ -2605,6 +2576,13 @@ var DeepMap = class {
|
|
|
2605
2576
|
});
|
|
2606
2577
|
}
|
|
2607
2578
|
}
|
|
2579
|
+
static clone(map2) {
|
|
2580
|
+
const clone = new DeepMap();
|
|
2581
|
+
map2.visit((pair, keys) => {
|
|
2582
|
+
clone.set(keys, pair.value);
|
|
2583
|
+
});
|
|
2584
|
+
return clone;
|
|
2585
|
+
}
|
|
2608
2586
|
set(keys, value) {
|
|
2609
2587
|
let currentMap = this.map;
|
|
2610
2588
|
if (!keys.length) {
|
|
@@ -2981,6 +2959,7 @@ function initSetupState2() {
|
|
|
2981
2959
|
pivotTotalColumnPosition: "end",
|
|
2982
2960
|
originalDataArray,
|
|
2983
2961
|
scrollBottomId: Symbol("scrollBottomId"),
|
|
2962
|
+
showSeparatePivotColumnForSingleAggregation: false,
|
|
2984
2963
|
pivotColumns: void 0,
|
|
2985
2964
|
pivotColumnGroups: void 0,
|
|
2986
2965
|
dataArray,
|
|
@@ -2989,7 +2968,6 @@ function initSetupState2() {
|
|
|
2989
2968
|
sortedAt: 0,
|
|
2990
2969
|
reducedAt: now,
|
|
2991
2970
|
generateGroupRows: true,
|
|
2992
|
-
aggregationReducers: void 0,
|
|
2993
2971
|
groupDeepMap: void 0,
|
|
2994
2972
|
postSortDataArray: void 0,
|
|
2995
2973
|
postGroupDataArray: void 0,
|
|
@@ -3005,15 +2983,15 @@ function getCompareObject(dataParams) {
|
|
|
3005
2983
|
var forwardProps3 = () => {
|
|
3006
2984
|
return {
|
|
3007
2985
|
onDataParamsChange: (fn) => fn ? discardCallsWithEqualArg(fn, 100, getCompareObject) : void 0,
|
|
3008
|
-
remoteCount: 1,
|
|
3009
2986
|
data: 1,
|
|
3010
2987
|
pivotBy: 1,
|
|
3011
2988
|
primaryKey: 1,
|
|
3012
2989
|
livePagination: 1,
|
|
3013
2990
|
livePaginationCursor: 1,
|
|
2991
|
+
aggregationReducers: 1,
|
|
3014
2992
|
loading: (loading) => loading != null ? loading : false,
|
|
3015
2993
|
sortInfo: (sortInfo) => normalizeSortInfo(sortInfo),
|
|
3016
|
-
|
|
2994
|
+
groupBy: (groupBy) => groupBy != null ? groupBy : [],
|
|
3017
2995
|
groupRowsState: (groupRowsState) => {
|
|
3018
2996
|
return groupRowsState || new GroupRowsState({
|
|
3019
2997
|
expandedRows: true,
|
|
@@ -3045,19 +3023,28 @@ function DEFAULT_TO_KEY(value) {
|
|
|
3045
3023
|
return value;
|
|
3046
3024
|
}
|
|
3047
3025
|
function initReducers(reducers) {
|
|
3048
|
-
if (!reducers || !reducers.length) {
|
|
3049
|
-
return
|
|
3026
|
+
if (!reducers || !Object.keys(reducers).length) {
|
|
3027
|
+
return {};
|
|
3050
3028
|
}
|
|
3051
|
-
|
|
3029
|
+
const result = {};
|
|
3030
|
+
for (let key in reducers)
|
|
3031
|
+
if (reducers.hasOwnProperty(key)) {
|
|
3032
|
+
result[key] = reducers[key].initialValue;
|
|
3033
|
+
}
|
|
3034
|
+
return result;
|
|
3052
3035
|
}
|
|
3053
3036
|
function computeReducersFor(data, reducers, reducerResults) {
|
|
3054
|
-
|
|
3037
|
+
var _a, _b;
|
|
3038
|
+
if (!reducers || !Object.keys(reducers).length) {
|
|
3055
3039
|
return;
|
|
3056
3040
|
}
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3041
|
+
for (let key in reducers)
|
|
3042
|
+
if (reducers.hasOwnProperty(key)) {
|
|
3043
|
+
const reducer = reducers[key];
|
|
3044
|
+
const currentValue = reducerResults[key];
|
|
3045
|
+
const value = reducer.field ? data[reducer.field] : (_b = (_a = reducer.getter) == null ? void 0 : _a.call(reducer, data)) != null ? _b : null;
|
|
3046
|
+
reducerResults[key] = reducer.reducer(currentValue, value, data);
|
|
3047
|
+
}
|
|
3061
3048
|
}
|
|
3062
3049
|
function group(groupParams, data) {
|
|
3063
3050
|
const {
|
|
@@ -3072,7 +3059,7 @@ function group(groupParams, data) {
|
|
|
3072
3059
|
let currentGroupKeys = [];
|
|
3073
3060
|
let currentPivotKeys = [];
|
|
3074
3061
|
const initialReducerValue = initReducers(reducers);
|
|
3075
|
-
const globalReducerResults =
|
|
3062
|
+
const globalReducerResults = __spreadValues({}, initialReducerValue);
|
|
3076
3063
|
for (let i = 0, len = data.length; i < len; i++) {
|
|
3077
3064
|
let item = data[i];
|
|
3078
3065
|
for (let groupByIndex = 0; groupByIndex < groupByLength; groupByIndex++) {
|
|
@@ -3082,7 +3069,7 @@ function group(groupParams, data) {
|
|
|
3082
3069
|
if (!deepMap.has(currentGroupKeys)) {
|
|
3083
3070
|
const deepMapGroupValue = {
|
|
3084
3071
|
items: [],
|
|
3085
|
-
reducerResults:
|
|
3072
|
+
reducerResults: __spreadValues({}, initialReducerValue)
|
|
3086
3073
|
};
|
|
3087
3074
|
if (pivot) {
|
|
3088
3075
|
deepMapGroupValue.pivotDeepMap = new DeepMap();
|
|
@@ -3106,7 +3093,7 @@ function group(groupParams, data) {
|
|
|
3106
3093
|
if (!pivotDeepMap.has(currentPivotKeys)) {
|
|
3107
3094
|
topLevelPivotColumns.set(currentPivotKeys, true);
|
|
3108
3095
|
pivotDeepMap == null ? void 0 : pivotDeepMap.set(currentPivotKeys, {
|
|
3109
|
-
reducerResults:
|
|
3096
|
+
reducerResults: __spreadValues({}, initialReducerValue),
|
|
3110
3097
|
items: []
|
|
3111
3098
|
});
|
|
3112
3099
|
}
|
|
@@ -3168,11 +3155,23 @@ function flatten(groupResult) {
|
|
|
3168
3155
|
return result;
|
|
3169
3156
|
}
|
|
3170
3157
|
function getEnhancedGroupData(options, deepMapValue) {
|
|
3171
|
-
const { groupBy, groupKeys, collapsed, parents } = options;
|
|
3158
|
+
const { groupBy, groupKeys, collapsed, parents, reducers } = options;
|
|
3172
3159
|
const groupNesting = groupKeys.length;
|
|
3173
3160
|
const { items: groupItems, reducerResults, pivotDeepMap } = deepMapValue;
|
|
3161
|
+
let data = null;
|
|
3162
|
+
if (Object.keys(reducerResults).length > 0) {
|
|
3163
|
+
data = {};
|
|
3164
|
+
for (let key in reducers)
|
|
3165
|
+
if (reducers.hasOwnProperty(key)) {
|
|
3166
|
+
const reducer = reducers[key];
|
|
3167
|
+
const field = reducer.field;
|
|
3168
|
+
if (field) {
|
|
3169
|
+
data[field] = reducerResults[key];
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3174
3173
|
const enhancedGroupData = {
|
|
3175
|
-
data
|
|
3174
|
+
data,
|
|
3176
3175
|
groupCount: groupItems.length,
|
|
3177
3176
|
groupData: groupItems,
|
|
3178
3177
|
groupKeys,
|
|
@@ -3194,17 +3193,25 @@ function getEnhancedGroupData(options, deepMapValue) {
|
|
|
3194
3193
|
return enhancedGroupData;
|
|
3195
3194
|
}
|
|
3196
3195
|
function completeReducers(reducers, reducerResults, items) {
|
|
3197
|
-
if (reducers
|
|
3198
|
-
|
|
3199
|
-
if (
|
|
3200
|
-
|
|
3196
|
+
if (reducers) {
|
|
3197
|
+
for (let key in reducers)
|
|
3198
|
+
if (reducers.hasOwnProperty(key)) {
|
|
3199
|
+
const reducer = reducers[key];
|
|
3200
|
+
if (reducer.done) {
|
|
3201
|
+
reducerResults[key] = reducer.done(reducerResults[key], items);
|
|
3202
|
+
}
|
|
3201
3203
|
}
|
|
3202
|
-
});
|
|
3203
3204
|
}
|
|
3204
3205
|
return reducerResults;
|
|
3205
3206
|
}
|
|
3206
3207
|
function enhancedFlatten(param) {
|
|
3207
|
-
const {
|
|
3208
|
+
const {
|
|
3209
|
+
groupResult,
|
|
3210
|
+
toPrimaryKey,
|
|
3211
|
+
groupRowsState,
|
|
3212
|
+
generateGroupRows,
|
|
3213
|
+
reducers = {}
|
|
3214
|
+
} = param;
|
|
3208
3215
|
const { groupParams, deepMap, pivot } = groupResult;
|
|
3209
3216
|
const { groupBy } = groupParams;
|
|
3210
3217
|
const groupByStrings = groupBy.map((g) => g.field);
|
|
@@ -3219,6 +3226,7 @@ function enhancedFlatten(param) {
|
|
|
3219
3226
|
const enhancedGroupData = getEnhancedGroupData({
|
|
3220
3227
|
groupBy: groupByStrings,
|
|
3221
3228
|
parents: Array.from(parents),
|
|
3229
|
+
reducers,
|
|
3222
3230
|
indexInGroup,
|
|
3223
3231
|
indexInParentGroups: Array.from(indexInParentGroups),
|
|
3224
3232
|
indexInAll: result.length,
|
|
@@ -3271,13 +3279,45 @@ function enhancedFlatten(param) {
|
|
|
3271
3279
|
}
|
|
3272
3280
|
|
|
3273
3281
|
// src/utils/groupAndPivot/getPivotColumnsAndColumnGroups.ts
|
|
3274
|
-
function
|
|
3282
|
+
function prepareColumn(column) {
|
|
3283
|
+
const { pivotByAtIndex: pivotByForColumn } = column;
|
|
3284
|
+
if (pivotByForColumn.column) {
|
|
3285
|
+
if (typeof pivotByForColumn.column === "function") {
|
|
3286
|
+
Object.assign(column, pivotByForColumn.column({ column }));
|
|
3287
|
+
} else {
|
|
3288
|
+
Object.assign(column, pivotByForColumn.column);
|
|
3289
|
+
}
|
|
3290
|
+
}
|
|
3291
|
+
return column;
|
|
3292
|
+
}
|
|
3293
|
+
function prepareColumnGroup(columnGroup) {
|
|
3294
|
+
const { pivotByAtIndex: pivotByForColumnGroup } = columnGroup;
|
|
3295
|
+
if (pivotByForColumnGroup.columnGroup) {
|
|
3296
|
+
if (typeof pivotByForColumnGroup.columnGroup === "function") {
|
|
3297
|
+
Object.assign(columnGroup, pivotByForColumnGroup.columnGroup({ columnGroup }));
|
|
3298
|
+
} else {
|
|
3299
|
+
Object.assign(columnGroup, pivotByForColumnGroup.columnGroup);
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
return columnGroup;
|
|
3303
|
+
}
|
|
3304
|
+
function getPivotColumnsAndColumnGroups({
|
|
3305
|
+
deepMap,
|
|
3306
|
+
pivotBy,
|
|
3307
|
+
pivotTotalColumnPosition,
|
|
3308
|
+
reducers = {},
|
|
3309
|
+
showSeparatePivotColumnForSingleAggregation = false
|
|
3310
|
+
}) {
|
|
3275
3311
|
const pivotLength = pivotBy.length;
|
|
3312
|
+
const aggregationReducers = Object.keys(reducers).map((key) => {
|
|
3313
|
+
return __spreadProps(__spreadValues({}, reducers[key]), { id: key });
|
|
3314
|
+
});
|
|
3276
3315
|
const columns = new Map([
|
|
3277
3316
|
[
|
|
3278
3317
|
"labels",
|
|
3279
3318
|
{
|
|
3280
3319
|
header: "Row labels",
|
|
3320
|
+
pivotBy,
|
|
3281
3321
|
valueGetter: (params) => {
|
|
3282
3322
|
var _a;
|
|
3283
3323
|
const { rowInfo } = params;
|
|
@@ -3287,72 +3327,104 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
|
|
|
3287
3327
|
]
|
|
3288
3328
|
]);
|
|
3289
3329
|
const columnGroups = new Map();
|
|
3330
|
+
const isSingleAggregationColumn = !showSeparatePivotColumnForSingleAggregation && aggregationReducers.length === 1;
|
|
3290
3331
|
deepMap.visitDepthFirst((_value, keys, _indexInGroup, next) => {
|
|
3291
3332
|
keys = [...keys];
|
|
3292
3333
|
if (pivotTotalColumnPosition === "end") {
|
|
3293
3334
|
next == null ? void 0 : next();
|
|
3294
3335
|
}
|
|
3295
3336
|
if (keys.length === pivotLength) {
|
|
3296
|
-
const parentKeys = keys.slice(0, -1);
|
|
3297
|
-
let columnGroupId = parentKeys.join("/");
|
|
3298
3337
|
const pivotByForColumn = pivotBy[keys.length - 1];
|
|
3299
|
-
let computedPivotColumn = __spreadValues({
|
|
3300
|
-
pivotBy,
|
|
3301
|
-
pivotColumn: true,
|
|
3302
|
-
pivotGroupKeys: keys,
|
|
3303
|
-
pivotGroupKeyForColumn: keys[keys.length - 1],
|
|
3304
|
-
pivotIndexForColumn: keys.length - 1,
|
|
3305
|
-
pivotByForColumn,
|
|
3306
|
-
sortable: false,
|
|
3307
|
-
columnGroup: parentKeys.length ? `${columnGroupId}` : void 0,
|
|
3308
|
-
header: keys[keys.length - 1],
|
|
3309
|
-
valueGetter: ({ rowInfo }) => {
|
|
3310
|
-
var _a, _b, _c;
|
|
3311
|
-
const value = (_c = (_b = (_a = rowInfo.pivotValuesMap) == null ? void 0 : _a.get(keys)) == null ? void 0 : _b.reducerResults[0]) != null ? _c : null;
|
|
3312
|
-
return value;
|
|
3313
|
-
}
|
|
3314
|
-
}, pivotByForColumn.column);
|
|
3315
|
-
if (pivotByForColumn.column) {
|
|
3316
|
-
if (typeof pivotByForColumn.column === "function") {
|
|
3317
|
-
Object.assign(computedPivotColumn, pivotByForColumn.column({ column: computedPivotColumn }));
|
|
3318
|
-
} else {
|
|
3319
|
-
Object.assign(computedPivotColumn, pivotByForColumn.column);
|
|
3320
|
-
}
|
|
3321
|
-
}
|
|
3322
|
-
columns.set(`${keys.join("/")}`, computedPivotColumn);
|
|
3323
|
-
} else {
|
|
3324
|
-
const colGroupId = keys.join("/");
|
|
3325
3338
|
const parentKeys = keys.slice(0, -1);
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
columnGroup:
|
|
3334
|
-
|
|
3335
|
-
pivotTotalColumn: true,
|
|
3339
|
+
let parentColumnGroupId = parentKeys.join("/");
|
|
3340
|
+
if (!isSingleAggregationColumn) {
|
|
3341
|
+
const columnGroupId = parentColumnGroupId;
|
|
3342
|
+
parentColumnGroupId = keys.join("/");
|
|
3343
|
+
const pivotGroupKey = keys[keys.length - 1];
|
|
3344
|
+
columnGroups.set(parentColumnGroupId, prepareColumnGroup({
|
|
3345
|
+
header: pivotGroupKey,
|
|
3346
|
+
columnGroup: columnGroupId,
|
|
3347
|
+
pivotBy,
|
|
3336
3348
|
pivotGroupKeys: keys,
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3349
|
+
pivotByAtIndex: pivotByForColumn,
|
|
3350
|
+
pivotIndex: keys.length - 1,
|
|
3351
|
+
pivotGroupKey
|
|
3352
|
+
}));
|
|
3353
|
+
}
|
|
3354
|
+
aggregationReducers.forEach((reducer, index) => {
|
|
3355
|
+
const header = isSingleAggregationColumn ? keys[keys.length - 1] : reducer.id;
|
|
3356
|
+
const computedPivotColumn = prepareColumn({
|
|
3340
3357
|
pivotBy,
|
|
3358
|
+
pivotColumn: true,
|
|
3359
|
+
pivotTotalColumn: false,
|
|
3360
|
+
pivotAggregator: reducer,
|
|
3361
|
+
pivotAggregatorIndex: index,
|
|
3362
|
+
pivotGroupKeys: keys,
|
|
3363
|
+
pivotGroupKey: keys[keys.length - 1],
|
|
3364
|
+
pivotIndex: keys.length - 1,
|
|
3365
|
+
pivotByAtIndex: pivotByForColumn,
|
|
3341
3366
|
sortable: false,
|
|
3367
|
+
columnGroup: parentColumnGroupId,
|
|
3368
|
+
header,
|
|
3342
3369
|
valueGetter: ({ rowInfo }) => {
|
|
3343
|
-
var _a, _b
|
|
3344
|
-
|
|
3345
|
-
return value;
|
|
3346
|
-
}
|
|
3347
|
-
}, pivotByForColumn.column);
|
|
3348
|
-
if (pivotByForColumn.column) {
|
|
3349
|
-
if (typeof pivotByForColumn.column === "function") {
|
|
3350
|
-
Object.assign(computedPivotColumn, pivotByForColumn.column({ column: computedPivotColumn }));
|
|
3351
|
-
} else {
|
|
3352
|
-
Object.assign(computedPivotColumn, pivotByForColumn.column);
|
|
3370
|
+
var _a, _b;
|
|
3371
|
+
return (_b = (_a = rowInfo.pivotValuesMap) == null ? void 0 : _a.get(keys)) == null ? void 0 : _b.reducerResults[reducer.id];
|
|
3353
3372
|
}
|
|
3373
|
+
});
|
|
3374
|
+
const columnId = `${keys.join("/")}-${reducer.id}`;
|
|
3375
|
+
columns.set(columnId, computedPivotColumn);
|
|
3376
|
+
});
|
|
3377
|
+
} else {
|
|
3378
|
+
const colGroupId = keys.join("/");
|
|
3379
|
+
const parentKeys = keys.slice(0, -1);
|
|
3380
|
+
columnGroups.set(colGroupId, prepareColumnGroup({
|
|
3381
|
+
columnGroup: parentKeys.length ? parentKeys.join("/") : void 0,
|
|
3382
|
+
header: keys[keys.length - 1],
|
|
3383
|
+
pivotBy,
|
|
3384
|
+
pivotGroupKeys: keys,
|
|
3385
|
+
pivotIndex: keys.length - 1,
|
|
3386
|
+
pivotByAtIndex: pivotBy[keys.length - 1],
|
|
3387
|
+
pivotGroupKey: keys[keys.length - 1]
|
|
3388
|
+
}));
|
|
3389
|
+
if (pivotTotalColumnPosition !== false) {
|
|
3390
|
+
const pivotByForColumn = pivotBy[keys.length - 1];
|
|
3391
|
+
let columnGroupId = parentKeys.length ? parentKeys.join("/") : void 0;
|
|
3392
|
+
if (!isSingleAggregationColumn) {
|
|
3393
|
+
let parentGroupForTotalsGroup = columnGroupId;
|
|
3394
|
+
columnGroupId = `total:${keys.join("/")}`;
|
|
3395
|
+
columnGroups.set(columnGroupId, prepareColumnGroup({
|
|
3396
|
+
header: `${keys[keys.length - 1]} total`,
|
|
3397
|
+
columnGroup: parentGroupForTotalsGroup,
|
|
3398
|
+
pivotBy,
|
|
3399
|
+
pivotTotalColumnGroup: true,
|
|
3400
|
+
pivotGroupKeys: keys,
|
|
3401
|
+
pivotIndex: keys.length - 1,
|
|
3402
|
+
pivotByAtIndex: pivotByForColumn,
|
|
3403
|
+
pivotGroupKey: keys[keys.length - 1]
|
|
3404
|
+
}));
|
|
3354
3405
|
}
|
|
3355
|
-
|
|
3406
|
+
aggregationReducers.forEach((reducer, index) => {
|
|
3407
|
+
const header = isSingleAggregationColumn ? `${keys[keys.length - 1]} total ` : `${reducer.id} total`;
|
|
3408
|
+
const computedPivotColumn = prepareColumn({
|
|
3409
|
+
columnGroup: columnGroupId,
|
|
3410
|
+
header,
|
|
3411
|
+
pivotAggregator: reducer,
|
|
3412
|
+
pivotAggregatorIndex: index,
|
|
3413
|
+
pivotColumn: true,
|
|
3414
|
+
pivotTotalColumn: true,
|
|
3415
|
+
pivotGroupKeys: keys,
|
|
3416
|
+
pivotGroupKey: keys[keys.length - 1],
|
|
3417
|
+
pivotByAtIndex: pivotByForColumn,
|
|
3418
|
+
pivotIndex: keys.length - 1,
|
|
3419
|
+
pivotBy,
|
|
3420
|
+
sortable: false,
|
|
3421
|
+
valueGetter: ({ rowInfo }) => {
|
|
3422
|
+
var _a, _b;
|
|
3423
|
+
return (_b = (_a = rowInfo.pivotValuesMap) == null ? void 0 : _a.get(keys)) == null ? void 0 : _b.reducerResults[reducer.id];
|
|
3424
|
+
}
|
|
3425
|
+
});
|
|
3426
|
+
columns.set(`total:${keys.join("/")}-${reducer.id}`, computedPivotColumn);
|
|
3427
|
+
});
|
|
3356
3428
|
}
|
|
3357
3429
|
}
|
|
3358
3430
|
if (pivotTotalColumnPosition === "start" || pivotTotalColumnPosition === false) {
|
|
@@ -3362,9 +3434,12 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
|
|
|
3362
3434
|
if (columns.size === 1) {
|
|
3363
3435
|
columns.set("single", {
|
|
3364
3436
|
header: "Reduced",
|
|
3437
|
+
pivotBy,
|
|
3438
|
+
pivotColumn: true,
|
|
3365
3439
|
valueGetter: ({ rowInfo }) => {
|
|
3366
3440
|
var _a;
|
|
3367
|
-
|
|
3441
|
+
const key = Object.keys(rowInfo.reducerResults || {})[0];
|
|
3442
|
+
return (_a = rowInfo.reducerResults) == null ? void 0 : _a[key];
|
|
3368
3443
|
}
|
|
3369
3444
|
});
|
|
3370
3445
|
}
|
|
@@ -3388,7 +3463,14 @@ var haveDepsChanged = (state1, state2, deps) => {
|
|
|
3388
3463
|
return false;
|
|
3389
3464
|
};
|
|
3390
3465
|
function toRowInfo(data, id, index) {
|
|
3391
|
-
return {
|
|
3466
|
+
return {
|
|
3467
|
+
data,
|
|
3468
|
+
collapsed: true,
|
|
3469
|
+
id,
|
|
3470
|
+
indexInAll: index,
|
|
3471
|
+
indexInGroup: index,
|
|
3472
|
+
isGroupRow: false
|
|
3473
|
+
};
|
|
3392
3474
|
}
|
|
3393
3475
|
function concludeReducer(params) {
|
|
3394
3476
|
var _a;
|
|
@@ -3400,17 +3482,18 @@ function concludeReducer(params) {
|
|
|
3400
3482
|
"sortInfo"
|
|
3401
3483
|
]);
|
|
3402
3484
|
const shouldSortAgain = shouldSort && (sortDepsChanged || !state.lastSortDataArray);
|
|
3403
|
-
const groupBy = state.
|
|
3485
|
+
const groupBy = state.groupBy;
|
|
3404
3486
|
const pivotBy = state.pivotBy;
|
|
3405
3487
|
const shouldGroup = groupBy.length || pivotBy;
|
|
3406
3488
|
const groupsDepsChanged = haveDepsChanged(previousState, state, [
|
|
3407
3489
|
"generateGroupRows",
|
|
3408
3490
|
"originalDataArray",
|
|
3409
|
-
"
|
|
3491
|
+
"groupBy",
|
|
3410
3492
|
"groupRowsState",
|
|
3411
3493
|
"pivotBy",
|
|
3412
3494
|
"aggregationReducers",
|
|
3413
3495
|
"pivotTotalColumnPosition",
|
|
3496
|
+
"showSeparatePivotColumnForSingleAggregation",
|
|
3414
3497
|
"sortInfo"
|
|
3415
3498
|
]);
|
|
3416
3499
|
const shouldGroupAgain = shouldGroup && (groupsDepsChanged || !state.lastGroupDataArray);
|
|
@@ -3436,13 +3519,20 @@ function concludeReducer(params) {
|
|
|
3436
3519
|
}, dataArray);
|
|
3437
3520
|
const flattenResult = enhancedFlatten({
|
|
3438
3521
|
groupResult,
|
|
3522
|
+
reducers: state.aggregationReducers,
|
|
3439
3523
|
toPrimaryKey,
|
|
3440
3524
|
groupRowsState: state.groupRowsState,
|
|
3441
3525
|
generateGroupRows: state.generateGroupRows
|
|
3442
3526
|
});
|
|
3443
3527
|
rowInfoDataArray = flattenResult.data;
|
|
3444
3528
|
state.groupDeepMap = groupResult.deepMap;
|
|
3445
|
-
const pivotGroupsAndCols = pivotBy ? getPivotColumnsAndColumnGroups(
|
|
3529
|
+
const pivotGroupsAndCols = pivotBy ? getPivotColumnsAndColumnGroups({
|
|
3530
|
+
deepMap: groupResult.topLevelPivotColumns,
|
|
3531
|
+
pivotBy,
|
|
3532
|
+
pivotTotalColumnPosition: (_a = state.pivotTotalColumnPosition) != null ? _a : "end",
|
|
3533
|
+
reducers: state.aggregationReducers,
|
|
3534
|
+
showSeparatePivotColumnForSingleAggregation: state.showSeparatePivotColumnForSingleAggregation
|
|
3535
|
+
}) : void 0;
|
|
3446
3536
|
state.pivotColumns = pivotGroupsAndCols == null ? void 0 : pivotGroupsAndCols.columns;
|
|
3447
3537
|
state.pivotColumnGroups = pivotGroupsAndCols == null ? void 0 : pivotGroupsAndCols.columnGroups;
|
|
3448
3538
|
} else {
|
|
@@ -3483,7 +3573,7 @@ function DataSourceWithContext(props) {
|
|
|
3483
3573
|
if (typeof children === "function") {
|
|
3484
3574
|
children = children(computedValues);
|
|
3485
3575
|
}
|
|
3486
|
-
return /* @__PURE__ */
|
|
3576
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);
|
|
3487
3577
|
}
|
|
3488
3578
|
var DataSourceRoot = getComponentStateRoot({
|
|
3489
3579
|
initSetupState: initSetupState2,
|
|
@@ -3505,14 +3595,14 @@ function DataSourceCmp({ children }) {
|
|
|
3505
3595
|
globalThis.getDataSourceState = getState;
|
|
3506
3596
|
}
|
|
3507
3597
|
useLoadData();
|
|
3508
|
-
return /* @__PURE__ */
|
|
3598
|
+
return /* @__PURE__ */ React8.createElement(DataSourceContext.Provider, {
|
|
3509
3599
|
value: contextValue
|
|
3510
|
-
}, /* @__PURE__ */
|
|
3600
|
+
}, /* @__PURE__ */ React8.createElement(DataSourceWithContext, {
|
|
3511
3601
|
children
|
|
3512
3602
|
}));
|
|
3513
3603
|
}
|
|
3514
3604
|
function DataSource(props) {
|
|
3515
|
-
return /* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ React8.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React8.createElement(DataSourceCmp, {
|
|
3516
3606
|
children: props.children
|
|
3517
3607
|
}));
|
|
3518
3608
|
}
|
|
@@ -3520,7 +3610,7 @@ function DataSource(props) {
|
|
|
3520
3610
|
// src/components/InfiniteTable/hooks/useToggleGroupRow.ts
|
|
3521
3611
|
function useToggleGroupRow() {
|
|
3522
3612
|
const { getState: getDataSourceState, componentActions: dataSourceActions } = useDataSourceContextValue();
|
|
3523
|
-
const toggleGroupRow = (0,
|
|
3613
|
+
const toggleGroupRow = (0, import_react17.useCallback)((groupKeys) => {
|
|
3524
3614
|
const newState = new GroupRowsState(getDataSourceState().groupRowsState);
|
|
3525
3615
|
newState.toggleGroupRow(groupKeys);
|
|
3526
3616
|
dataSourceActions.groupRowsState = newState;
|
|
@@ -3529,49 +3619,49 @@ function useToggleGroupRow() {
|
|
|
3529
3619
|
}
|
|
3530
3620
|
|
|
3531
3621
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
3532
|
-
function
|
|
3533
|
-
const
|
|
3534
|
-
return
|
|
3535
|
-
acc.set(
|
|
3536
|
-
groupBy,
|
|
3622
|
+
function useGroupByMap(groupBy) {
|
|
3623
|
+
const groupByMap = (0, import_react18.useMemo)(() => {
|
|
3624
|
+
return groupBy.reduce((acc, groupBy2, index) => {
|
|
3625
|
+
acc.set(groupBy2.field, {
|
|
3626
|
+
groupBy: groupBy2,
|
|
3537
3627
|
groupIndex: index
|
|
3538
3628
|
});
|
|
3539
3629
|
return acc;
|
|
3540
3630
|
}, new Map());
|
|
3541
|
-
}, [
|
|
3542
|
-
return
|
|
3631
|
+
}, [groupBy]);
|
|
3632
|
+
return groupByMap;
|
|
3543
3633
|
}
|
|
3544
3634
|
function useColumnsWhen() {
|
|
3545
3635
|
const {
|
|
3546
|
-
componentState: {
|
|
3636
|
+
componentState: { groupBy },
|
|
3547
3637
|
componentActions: dataSourceActions
|
|
3548
3638
|
} = useDataSourceContextValue();
|
|
3549
3639
|
const {
|
|
3550
3640
|
componentState: { groupRenderStrategy, pivotTotalColumnPosition }
|
|
3551
3641
|
} = useComponentState();
|
|
3552
|
-
const
|
|
3553
|
-
(0,
|
|
3642
|
+
const groupByMap = useGroupByMap(groupBy);
|
|
3643
|
+
(0, import_react18.useEffect)(() => {
|
|
3554
3644
|
dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
|
|
3555
3645
|
}, [groupRenderStrategy]);
|
|
3556
|
-
(0,
|
|
3646
|
+
(0, import_react18.useEffect)(() => {
|
|
3557
3647
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
3558
3648
|
}, [pivotTotalColumnPosition]);
|
|
3559
|
-
useColumnsWhenInlineGroupRenderStrategy(
|
|
3649
|
+
useColumnsWhenInlineGroupRenderStrategy(groupByMap);
|
|
3560
3650
|
useColumnsWhenPivoting();
|
|
3561
3651
|
useColumnsWhenGrouping();
|
|
3562
|
-
useHideEmptyGroupColumns(
|
|
3652
|
+
useHideEmptyGroupColumns(groupByMap);
|
|
3563
3653
|
}
|
|
3564
|
-
function useColumnsWhenInlineGroupRenderStrategy(
|
|
3654
|
+
function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
3565
3655
|
const toggleGroupRow = useToggleGroupRow();
|
|
3566
3656
|
const {
|
|
3567
3657
|
componentActions,
|
|
3568
3658
|
componentState: { columns, groupRenderStrategy }
|
|
3569
3659
|
} = useComponentState();
|
|
3570
|
-
function computeColumnsWhenInlineGroupRenderStrategy(columns2,
|
|
3660
|
+
function computeColumnsWhenInlineGroupRenderStrategy(columns2, groupByMap2, groupRenderStrategy2, toggleGroupRow2) {
|
|
3571
3661
|
const computedColumns = new Map();
|
|
3572
3662
|
columns2.forEach((column, id) => {
|
|
3573
3663
|
let base = {};
|
|
3574
|
-
const groupByForColumn =
|
|
3664
|
+
const groupByForColumn = groupByMap2.get(column.field);
|
|
3575
3665
|
if (groupByForColumn && groupRenderStrategy2 === "inline") {
|
|
3576
3666
|
const { groupIndex } = groupByForColumn;
|
|
3577
3667
|
const field = groupByForColumn.groupBy.field;
|
|
@@ -3616,9 +3706,9 @@ function useColumnsWhenInlineGroupRenderStrategy(groupRowsMap) {
|
|
|
3616
3706
|
});
|
|
3617
3707
|
return computedColumns.size === 0 ? void 0 : computedColumns;
|
|
3618
3708
|
}
|
|
3619
|
-
(0,
|
|
3709
|
+
(0, import_react18.useEffect)(() => {
|
|
3620
3710
|
const update = () => {
|
|
3621
|
-
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns,
|
|
3711
|
+
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(columns, groupByMap, groupRenderStrategy, toggleGroupRow);
|
|
3622
3712
|
};
|
|
3623
3713
|
update();
|
|
3624
3714
|
return interceptMap(columns, {
|
|
@@ -3626,11 +3716,11 @@ function useColumnsWhenInlineGroupRenderStrategy(groupRowsMap) {
|
|
|
3626
3716
|
delete: update,
|
|
3627
3717
|
clear: update
|
|
3628
3718
|
});
|
|
3629
|
-
}, [columns,
|
|
3719
|
+
}, [columns, groupByMap, groupRenderStrategy, toggleGroupRow]);
|
|
3630
3720
|
}
|
|
3631
3721
|
function useColumnsWhenPivoting() {
|
|
3632
3722
|
const {
|
|
3633
|
-
componentState: {
|
|
3723
|
+
componentState: { groupBy, pivotBy }
|
|
3634
3724
|
} = useDataSourceContextValue();
|
|
3635
3725
|
const {
|
|
3636
3726
|
componentActions,
|
|
@@ -3642,13 +3732,13 @@ function useColumnsWhenPivoting() {
|
|
|
3642
3732
|
}
|
|
3643
3733
|
} = useComponentState();
|
|
3644
3734
|
const toggleGroupRow = useToggleGroupRow();
|
|
3645
|
-
(0,
|
|
3735
|
+
(0, import_react18.useEffect)(() => {
|
|
3646
3736
|
const computedPivotColumns = getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, {
|
|
3647
3737
|
pivotColumn,
|
|
3648
3738
|
pivotRowLabelsColumn,
|
|
3649
3739
|
pivotTotalColumnPosition,
|
|
3650
3740
|
pivotBy,
|
|
3651
|
-
|
|
3741
|
+
groupBy,
|
|
3652
3742
|
toggleGroupRow
|
|
3653
3743
|
});
|
|
3654
3744
|
componentActions.computedPivotColumns = computedPivotColumns;
|
|
@@ -3656,14 +3746,14 @@ function useColumnsWhenPivoting() {
|
|
|
3656
3746
|
}
|
|
3657
3747
|
function useColumnsWhenGrouping() {
|
|
3658
3748
|
const {
|
|
3659
|
-
componentState: {
|
|
3749
|
+
componentState: { groupBy }
|
|
3660
3750
|
} = useDataSourceContextValue();
|
|
3661
3751
|
const {
|
|
3662
3752
|
componentActions,
|
|
3663
3753
|
componentState: { columns, groupColumn, groupRenderStrategy, pivotColumns }
|
|
3664
3754
|
} = useComponentState();
|
|
3665
3755
|
const toggleGroupRow = useToggleGroupRow();
|
|
3666
|
-
(0,
|
|
3756
|
+
(0, import_react18.useEffect)(() => {
|
|
3667
3757
|
if (pivotColumns) {
|
|
3668
3758
|
return;
|
|
3669
3759
|
}
|
|
@@ -3672,7 +3762,7 @@ function useColumnsWhenGrouping() {
|
|
|
3672
3762
|
columns,
|
|
3673
3763
|
groupColumn,
|
|
3674
3764
|
groupRenderStrategy,
|
|
3675
|
-
|
|
3765
|
+
groupBy,
|
|
3676
3766
|
pivotColumns,
|
|
3677
3767
|
toggleGroupRow
|
|
3678
3768
|
});
|
|
@@ -3684,11 +3774,11 @@ function useColumnsWhenGrouping() {
|
|
|
3684
3774
|
delete: update,
|
|
3685
3775
|
clear: update
|
|
3686
3776
|
});
|
|
3687
|
-
}, [
|
|
3777
|
+
}, [columns, groupBy, groupColumn, groupRenderStrategy, pivotColumns]);
|
|
3688
3778
|
}
|
|
3689
3779
|
function useHideEmptyGroupColumns(groupRowsMap) {
|
|
3690
3780
|
const {
|
|
3691
|
-
componentState: {
|
|
3781
|
+
componentState: { groupBy, groupRowsState },
|
|
3692
3782
|
getState: getDataSourceState
|
|
3693
3783
|
} = useDataSourceContextValue();
|
|
3694
3784
|
const {
|
|
@@ -3700,11 +3790,11 @@ function useHideEmptyGroupColumns(groupRowsMap) {
|
|
|
3700
3790
|
groupRenderStrategy
|
|
3701
3791
|
}
|
|
3702
3792
|
} = useComponentState();
|
|
3703
|
-
(0,
|
|
3704
|
-
if (groupRenderStrategy
|
|
3793
|
+
(0, import_react18.useEffect)(() => {
|
|
3794
|
+
if (groupRenderStrategy !== "multi-column") {
|
|
3705
3795
|
return;
|
|
3706
3796
|
}
|
|
3707
|
-
const groupsLength =
|
|
3797
|
+
const groupsLength = groupBy.length;
|
|
3708
3798
|
let expandedGroupsLevel = 0;
|
|
3709
3799
|
const { dataArray } = getDataSourceState();
|
|
3710
3800
|
const len = dataArray.length;
|
|
@@ -3720,15 +3810,15 @@ function useHideEmptyGroupColumns(groupRowsMap) {
|
|
|
3720
3810
|
let updated = false;
|
|
3721
3811
|
const columnVisibility = new Map(currentState.columnVisibility);
|
|
3722
3812
|
const cols = computedColumns;
|
|
3723
|
-
|
|
3724
|
-
const colId =
|
|
3725
|
-
|
|
3813
|
+
groupBy.forEach(({ field, column: groupColumn }, index) => {
|
|
3814
|
+
const colId = (groupColumn == null ? void 0 : groupColumn.id) || `group-by-${field}`;
|
|
3815
|
+
let col = cols.get(colId);
|
|
3726
3816
|
if (!col) {
|
|
3727
3817
|
return;
|
|
3728
3818
|
}
|
|
3729
|
-
const shouldBeHidden = index > expandedGroupsLevel;
|
|
3819
|
+
const shouldBeHidden = index > expandedGroupsLevel && hideEmptyGroupColumns;
|
|
3730
3820
|
updated = true;
|
|
3731
|
-
if (shouldBeHidden
|
|
3821
|
+
if (shouldBeHidden) {
|
|
3732
3822
|
columnVisibility.set(colId, false);
|
|
3733
3823
|
} else {
|
|
3734
3824
|
columnVisibility.delete(colId);
|
|
@@ -3741,7 +3831,7 @@ function useHideEmptyGroupColumns(groupRowsMap) {
|
|
|
3741
3831
|
getDataSourceState,
|
|
3742
3832
|
groupRenderStrategy,
|
|
3743
3833
|
generatedColumns,
|
|
3744
|
-
|
|
3834
|
+
groupBy,
|
|
3745
3835
|
groupRowsMap,
|
|
3746
3836
|
hideEmptyGroupColumns ? groupRowsState : null,
|
|
3747
3837
|
hideEmptyGroupColumns
|
|
@@ -3750,7 +3840,7 @@ function useHideEmptyGroupColumns(groupRowsMap) {
|
|
|
3750
3840
|
function getColumnsWhenGrouping(params) {
|
|
3751
3841
|
const {
|
|
3752
3842
|
pivotColumns,
|
|
3753
|
-
|
|
3843
|
+
groupBy,
|
|
3754
3844
|
groupColumn,
|
|
3755
3845
|
groupRenderStrategy,
|
|
3756
3846
|
toggleGroupRow,
|
|
@@ -3764,10 +3854,10 @@ function getColumnsWhenGrouping(params) {
|
|
|
3764
3854
|
}
|
|
3765
3855
|
const computedColumns = new Map();
|
|
3766
3856
|
if (groupRenderStrategy === "multi-column") {
|
|
3767
|
-
|
|
3857
|
+
groupBy.forEach((groupByForColumn, groupIndexForColumn, arr) => {
|
|
3768
3858
|
const generatedGroupColumn = getColumnForGroupBy({
|
|
3769
3859
|
groupByForColumn,
|
|
3770
|
-
|
|
3860
|
+
groupBy,
|
|
3771
3861
|
groupIndexForColumn,
|
|
3772
3862
|
groupCount: arr.length,
|
|
3773
3863
|
groupRenderStrategy
|
|
@@ -3776,8 +3866,8 @@ function getColumnsWhenGrouping(params) {
|
|
|
3776
3866
|
});
|
|
3777
3867
|
} else if (groupRenderStrategy === "single-column") {
|
|
3778
3868
|
const singleGroupColumn = getSingleGroupColumn({
|
|
3779
|
-
groupCount:
|
|
3780
|
-
|
|
3869
|
+
groupCount: groupBy.length,
|
|
3870
|
+
groupBy,
|
|
3781
3871
|
groupRenderStrategy
|
|
3782
3872
|
}, toggleGroupRow, groupColumn);
|
|
3783
3873
|
computedColumns.set(singleGroupColumn.id || "group-by", singleGroupColumn);
|
|
@@ -3802,9 +3892,10 @@ function useComputed() {
|
|
|
3802
3892
|
columnPinning,
|
|
3803
3893
|
columnSizing,
|
|
3804
3894
|
columnTypes,
|
|
3805
|
-
bodySize
|
|
3895
|
+
bodySize,
|
|
3896
|
+
showSeparatePivotColumnForSingleAggregation
|
|
3806
3897
|
} = componentState;
|
|
3807
|
-
(0,
|
|
3898
|
+
(0, import_react19.useState)(() => {
|
|
3808
3899
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
3809
3900
|
if (rowHeight) {
|
|
3810
3901
|
componentActions.rowHeight = rowHeight;
|
|
@@ -3816,11 +3907,13 @@ function useComputed() {
|
|
|
3816
3907
|
}
|
|
3817
3908
|
});
|
|
3818
3909
|
});
|
|
3819
|
-
|
|
3910
|
+
(0, import_react19.useEffect)(() => {
|
|
3911
|
+
dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
|
|
3912
|
+
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
3820
3913
|
const { multiSort } = dataSourceState;
|
|
3821
3914
|
useColumnGroups();
|
|
3822
3915
|
useColumnsWhen();
|
|
3823
|
-
const setSortInfo = (0,
|
|
3916
|
+
const setSortInfo = (0, import_react19.useCallback)((sortInfo) => {
|
|
3824
3917
|
var _a2;
|
|
3825
3918
|
const newSortInfo = multiSort ? sortInfo : (_a2 = sortInfo[0]) != null ? _a2 : null;
|
|
3826
3919
|
dataSourceActions.sortInfo = newSortInfo;
|
|
@@ -3911,7 +4004,7 @@ function useComputed() {
|
|
|
3911
4004
|
}
|
|
3912
4005
|
|
|
3913
4006
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
3914
|
-
var
|
|
4007
|
+
var React9 = __toModule(require("react"));
|
|
3915
4008
|
|
|
3916
4009
|
// src/components/InfiniteTable/hooks/useInternalProps.ts
|
|
3917
4010
|
var useInternalProps = () => {
|
|
@@ -3919,9 +4012,9 @@ var useInternalProps = () => {
|
|
|
3919
4012
|
};
|
|
3920
4013
|
|
|
3921
4014
|
// src/components/InfiniteTable/components/InfiniteTableBody/InfiniteTableBody.tsx
|
|
3922
|
-
var InfiniteTableBody =
|
|
4015
|
+
var InfiniteTableBody = React9.forwardRef(function InfiniteTableBody2(props, ref) {
|
|
3923
4016
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
3924
|
-
return /* @__PURE__ */
|
|
4017
|
+
return /* @__PURE__ */ React9.createElement("div", __spreadProps(__spreadValues({
|
|
3925
4018
|
ref
|
|
3926
4019
|
}, props), {
|
|
3927
4020
|
className: join(`${rootClassName12}Body`, position.relative, flex["1"], transformTranslateZero, props.className)
|
|
@@ -3929,16 +4022,16 @@ var InfiniteTableBody = React10.forwardRef(function InfiniteTableBody2(props, re
|
|
|
3929
4022
|
});
|
|
3930
4023
|
|
|
3931
4024
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
3932
|
-
var
|
|
4025
|
+
var React21 = __toModule(require("react"));
|
|
3933
4026
|
|
|
3934
4027
|
// src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
|
|
3935
|
-
var
|
|
4028
|
+
var React10 = __toModule(require("react"));
|
|
3936
4029
|
function HorizontalScrollbarPlaceholderFn(props) {
|
|
3937
4030
|
const scrollbarWidth2 = getScrollbarWidth();
|
|
3938
4031
|
if (!scrollbarWidth2) {
|
|
3939
4032
|
return null;
|
|
3940
4033
|
}
|
|
3941
|
-
return /* @__PURE__ */
|
|
4034
|
+
return /* @__PURE__ */ React10.createElement("div", {
|
|
3942
4035
|
"data-name": "horizontal-scrollbar-placeholder",
|
|
3943
4036
|
style: __spreadValues({
|
|
3944
4037
|
position: "absolute",
|
|
@@ -3948,13 +4041,13 @@ function HorizontalScrollbarPlaceholderFn(props) {
|
|
|
3948
4041
|
}, props.style)
|
|
3949
4042
|
});
|
|
3950
4043
|
}
|
|
3951
|
-
var HorizontalScrollbarPlaceholder =
|
|
4044
|
+
var HorizontalScrollbarPlaceholder = React10.memo(HorizontalScrollbarPlaceholderFn);
|
|
3952
4045
|
function VerticalScrollbarPlaceholderFn(props) {
|
|
3953
4046
|
const scrollbarWidth2 = getScrollbarWidth();
|
|
3954
4047
|
if (!scrollbarWidth2) {
|
|
3955
4048
|
return null;
|
|
3956
4049
|
}
|
|
3957
|
-
return /* @__PURE__ */
|
|
4050
|
+
return /* @__PURE__ */ React10.createElement("div", {
|
|
3958
4051
|
"data-name": "vertical-scrollbar-placeholder",
|
|
3959
4052
|
style: __spreadValues({
|
|
3960
4053
|
position: "absolute",
|
|
@@ -3964,14 +4057,14 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
3964
4057
|
}, props.style)
|
|
3965
4058
|
});
|
|
3966
4059
|
}
|
|
3967
|
-
var VerticalScrollbarPlaceholder =
|
|
4060
|
+
var VerticalScrollbarPlaceholder = React10.memo(VerticalScrollbarPlaceholderFn);
|
|
3968
4061
|
|
|
3969
4062
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
3970
|
-
var
|
|
4063
|
+
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
3971
4064
|
var CellCls = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
|
|
3972
4065
|
var HeaderCellProxy = "_12zfob10";
|
|
3973
|
-
var HeaderCellRecipe = (0,
|
|
3974
|
-
var HeaderClsRecipe = (0,
|
|
4066
|
+
var HeaderCellRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "_12zfob1c", variantClassNames: { dragging: { true: "_12zfob1d", false: "_12zfob1e" }, first: { true: "_12zfob1f", false: "_12zfob1g" }, last: { true: "_12zfob1h", false: "_12zfob1i" }, groupByField: { true: "_12zfob1j", false: "_12zfob1k" }, firstInCategory: { true: "_12zfob1l", false: "_12zfob1m" }, lastInCategory: { true: "_12zfob1n", false: "_12zfob1o" }, pinned: { start: "_12zfob1p", end: "_12zfob1q", false: "_12zfob1r" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob1s"], [{ pinned: "end", firstInCategory: true }, "_12zfob1t"], [{ pinned: false, lastInCategory: true }, "_12zfob1u"]] });
|
|
4067
|
+
var HeaderClsRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "_12zfob12 _16lm1iw10", variantClassNames: { pinned: { start: "_12zfob13", end: "_12zfob14", false: "_12zfob15" }, virtualized: { true: "_12zfob16", false: "_12zfob17" }, overflow: { true: "_12zfob18", false: "_12zfob19" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1a"], [{ overflow: true, pinned: "end" }, "_12zfob1b"]] });
|
|
3975
4068
|
var HeaderGroupCls = "_16lm1iwz _16lm1iwj";
|
|
3976
4069
|
var HeaderGroup_Children = "_16lm1iwj _16lm1iw10 _16lm1iw12 _16lm1iwc";
|
|
3977
4070
|
var HeaderGroup_Header = "_12zfob1x _16lm1iwj _16lm1iw10 _16lm1iw11";
|
|
@@ -3979,29 +4072,29 @@ var HeaderSortIconCls = "_12zfob11 _16lm1iw1";
|
|
|
3979
4072
|
var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
|
|
3980
4073
|
|
|
3981
4074
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
3982
|
-
var
|
|
3983
|
-
var
|
|
4075
|
+
var React17 = __toModule(require("react"));
|
|
4076
|
+
var import_react27 = __toModule(require("react"));
|
|
3984
4077
|
|
|
3985
4078
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
3986
|
-
var
|
|
3987
|
-
var
|
|
4079
|
+
var React13 = __toModule(require("react"));
|
|
4080
|
+
var import_react23 = __toModule(require("react"));
|
|
3988
4081
|
|
|
3989
4082
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
3990
|
-
var
|
|
4083
|
+
var React11 = __toModule(require("react"));
|
|
3991
4084
|
|
|
3992
4085
|
// src/components/InfiniteTable/hooks/useInfiniteTableState.ts
|
|
3993
|
-
var
|
|
4086
|
+
var import_react20 = __toModule(require("react"));
|
|
3994
4087
|
var useInfiniteTableState = () => {
|
|
3995
4088
|
const TableContext2 = getInfiniteTableContext();
|
|
3996
|
-
const { componentState } = (0,
|
|
4089
|
+
const { componentState } = (0, import_react20.useContext)(TableContext2);
|
|
3997
4090
|
return componentState;
|
|
3998
4091
|
};
|
|
3999
4092
|
|
|
4000
4093
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
4001
|
-
var
|
|
4094
|
+
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
4002
4095
|
var CellCls2 = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
|
|
4003
4096
|
var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
|
|
4004
|
-
var ColumnCellRecipe = (0,
|
|
4097
|
+
var ColumnCellRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "_16lm1iw2 _16lm1iwo _16lm1iw7 _16lm1iwr", variantClassNames: { dragging: { false: "_1eexc2a7" }, first: { true: "_1eexc2a8", false: "_1eexc2a9" }, last: { true: "_1eexc2aa", false: "_1eexc2ab" }, groupByField: { true: "_1eexc2ac", false: "_1eexc2ad" }, firstInCategory: { true: "_1eexc2ae", false: "_1eexc2af" }, lastInCategory: { true: "_1eexc2ag", false: "_1eexc2ah" }, pinned: { start: "_1eexc2ai", end: "_1eexc2aj", false: "_1eexc2ak" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2al"], [{ pinned: "end", firstInCategory: true }, "_1eexc2am"]] });
|
|
4005
4098
|
var columnAlignCellStyle = { center: "_1eexc2a0", start: "_1eexc2a1", end: "_1eexc2a2" };
|
|
4006
4099
|
|
|
4007
4100
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
@@ -4046,20 +4139,20 @@ function InfiniteTableCellFn(props) {
|
|
|
4046
4139
|
style.transform = `translate3d(${shiftLeft}px, 0px, 0px)`;
|
|
4047
4140
|
}
|
|
4048
4141
|
}
|
|
4049
|
-
return /* @__PURE__ */
|
|
4142
|
+
return /* @__PURE__ */ React11.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
4050
4143
|
ref: domRef,
|
|
4051
4144
|
style,
|
|
4052
4145
|
"data-name": `Cell`,
|
|
4053
4146
|
className: join(domProps.className, columnAlignCellStyle[(_b = column.align) != null ? _b : "start"], justifyContent[(_c = column.align) != null ? _c : "start"], InfiniteTableCellClassName, CellCls2, shifting ? `${InfiniteTableCellClassName}--shifting ${CellClsVariants.shifting}` : "")
|
|
4054
|
-
}), beforeChildren, cssEllipsis ? /* @__PURE__ */
|
|
4147
|
+
}), beforeChildren, cssEllipsis ? /* @__PURE__ */ React11.createElement("div", {
|
|
4055
4148
|
className: `${rootClassName2}Cell_content ${cssEllipsisClassName}`
|
|
4056
4149
|
}, children) : children, afterChildren);
|
|
4057
4150
|
}
|
|
4058
|
-
var InfiniteTableCell =
|
|
4151
|
+
var InfiniteTableCell = React11.memo(InfiniteTableCellFn);
|
|
4059
4152
|
|
|
4060
4153
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
4061
4154
|
var import_binary_search = __toModule(require_binary_search());
|
|
4062
|
-
var
|
|
4155
|
+
var import_react21 = __toModule(require("react"));
|
|
4063
4156
|
|
|
4064
4157
|
// src/components/InfiniteTable/utils/moveXatY.ts
|
|
4065
4158
|
var moveXatY = (arr, dragIndex, dropIndex) => {
|
|
@@ -4093,18 +4186,18 @@ var useColumnPointerEvents = ({
|
|
|
4093
4186
|
columns,
|
|
4094
4187
|
computedRemainingSpace
|
|
4095
4188
|
}) => {
|
|
4096
|
-
const [draggingDiff, setDraggingDiff] = (0,
|
|
4097
|
-
const [proxyOffset, setProxyOffset] = (0,
|
|
4098
|
-
const breakpointsRef = (0,
|
|
4099
|
-
const pointerMoveRef = (0,
|
|
4100
|
-
const didDragRef = (0,
|
|
4101
|
-
const initialClientPos = (0,
|
|
4102
|
-
const currentDropIndexRef = (0,
|
|
4189
|
+
const [draggingDiff, setDraggingDiff] = (0, import_react21.useState)(null);
|
|
4190
|
+
const [proxyOffset, setProxyOffset] = (0, import_react21.useState)(null);
|
|
4191
|
+
const breakpointsRef = (0, import_react21.useRef)([]);
|
|
4192
|
+
const pointerMoveRef = (0, import_react21.useRef)(null);
|
|
4193
|
+
const didDragRef = (0, import_react21.useRef)(false);
|
|
4194
|
+
const initialClientPos = (0, import_react21.useRef)(null);
|
|
4195
|
+
const currentDropIndexRef = (0, import_react21.useRef)(null);
|
|
4103
4196
|
const dragging = draggingDiff != null;
|
|
4104
4197
|
const { componentActions, computed } = useInfiniteTable();
|
|
4105
4198
|
const { computedColumnOrder } = computed;
|
|
4106
|
-
const column = (0,
|
|
4107
|
-
const { columnIndex, columnWidth, columnsArray } = (0,
|
|
4199
|
+
const column = (0, import_react21.useMemo)(() => columns.get(columnId), [columnId, columns]);
|
|
4200
|
+
const { columnIndex, columnWidth, columnsArray } = (0, import_react21.useMemo)(() => {
|
|
4108
4201
|
const columnsArray2 = Array.from(columns.values());
|
|
4109
4202
|
return {
|
|
4110
4203
|
columnsArray: columnsArray2,
|
|
@@ -4112,8 +4205,8 @@ var useColumnPointerEvents = ({
|
|
|
4112
4205
|
columnWidth: column.computedWidth
|
|
4113
4206
|
};
|
|
4114
4207
|
}, [columns, columnId, column]);
|
|
4115
|
-
let cursorRef = (0,
|
|
4116
|
-
const onPointerDown = (0,
|
|
4208
|
+
let cursorRef = (0, import_react21.useRef)("auto");
|
|
4209
|
+
const onPointerDown = (0, import_react21.useCallback)((e) => {
|
|
4117
4210
|
const target = domRef.current;
|
|
4118
4211
|
cursorRef.current = target.style.cursor;
|
|
4119
4212
|
didDragRef.current = false;
|
|
@@ -4176,7 +4269,7 @@ var useColumnPointerEvents = ({
|
|
|
4176
4269
|
target.addEventListener("pointermove", onPointerMove);
|
|
4177
4270
|
target.setPointerCapture(e.pointerId);
|
|
4178
4271
|
}, [columns, column, columnIndex, columnsArray, computedRemainingSpace]);
|
|
4179
|
-
const onPointerUp = (0,
|
|
4272
|
+
const onPointerUp = (0, import_react21.useCallback)((e) => {
|
|
4180
4273
|
const target = domRef.current;
|
|
4181
4274
|
target.style.cursor = cursorRef.current;
|
|
4182
4275
|
target.releasePointerCapture(e.pointerId);
|
|
@@ -4250,8 +4343,8 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
4250
4343
|
var import_react_dom = __toModule(require("react-dom"));
|
|
4251
4344
|
|
|
4252
4345
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
4253
|
-
var
|
|
4254
|
-
var
|
|
4346
|
+
var React12 = __toModule(require("react"));
|
|
4347
|
+
var import_react22 = __toModule(require("react"));
|
|
4255
4348
|
var defaultLineStyle = {
|
|
4256
4349
|
marginTop: 2,
|
|
4257
4350
|
marginBottom: 2,
|
|
@@ -4259,8 +4352,8 @@ var defaultLineStyle = {
|
|
|
4259
4352
|
};
|
|
4260
4353
|
function SortIcon(props) {
|
|
4261
4354
|
var _a;
|
|
4262
|
-
const [rendered, setRendered] = (0,
|
|
4263
|
-
const [opacity, setOpacity] = (0,
|
|
4355
|
+
const [rendered, setRendered] = (0, import_react22.useState)(true);
|
|
4356
|
+
const [opacity, setOpacity] = (0, import_react22.useState)(0);
|
|
4264
4357
|
const { direction, lineWidth = 1, style, className, index } = props;
|
|
4265
4358
|
const showIndex = index != null && index > 0;
|
|
4266
4359
|
const size = (_a = props.size) != null ? _a : 16;
|
|
@@ -4274,7 +4367,7 @@ function SortIcon(props) {
|
|
|
4274
4367
|
}), props.lineStyle), {
|
|
4275
4368
|
opacity
|
|
4276
4369
|
});
|
|
4277
|
-
(0,
|
|
4370
|
+
(0, import_react22.useEffect)(() => {
|
|
4278
4371
|
const newOpacity = direction != 0 ? 1 : 0;
|
|
4279
4372
|
if (!rendered && newOpacity) {
|
|
4280
4373
|
setRendered(true);
|
|
@@ -4304,18 +4397,18 @@ function SortIcon(props) {
|
|
|
4304
4397
|
if (direction === -1) {
|
|
4305
4398
|
indexStyle.top = "100%";
|
|
4306
4399
|
}
|
|
4307
|
-
return /* @__PURE__ */
|
|
4400
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
4308
4401
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
4309
4402
|
className: join(className, "ITableIcon", "ITableIcon-sort")
|
|
4310
|
-
}, showIndex ? /* @__PURE__ */
|
|
4403
|
+
}, showIndex ? /* @__PURE__ */ React12.createElement("div", {
|
|
4311
4404
|
"data-name": "index",
|
|
4312
4405
|
style: indexStyle
|
|
4313
|
-
}, index) : null, /* @__PURE__ */
|
|
4406
|
+
}, index) : null, /* @__PURE__ */ React12.createElement("div", {
|
|
4314
4407
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
4315
4408
|
onTransitionEnd
|
|
4316
|
-
}), /* @__PURE__ */
|
|
4409
|
+
}), /* @__PURE__ */ React12.createElement("div", {
|
|
4317
4410
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
4318
|
-
}), /* @__PURE__ */
|
|
4411
|
+
}), /* @__PURE__ */ React12.createElement("div", {
|
|
4319
4412
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
4320
4413
|
}));
|
|
4321
4414
|
}
|
|
@@ -4346,13 +4439,13 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4346
4439
|
});
|
|
4347
4440
|
}
|
|
4348
4441
|
header = header != null ? header : column.name;
|
|
4349
|
-
const sortTool = /* @__PURE__ */
|
|
4442
|
+
const sortTool = /* @__PURE__ */ React13.createElement(SortIcon, {
|
|
4350
4443
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
4351
4444
|
className: `${baseCls}__sort-icon ${HeaderSortIconCls}`,
|
|
4352
4445
|
direction: column.computedSorted ? column.computedSortedAsc ? 1 : -1 : 0
|
|
4353
4446
|
});
|
|
4354
|
-
const domRef = (0,
|
|
4355
|
-
const ref = (0,
|
|
4447
|
+
const domRef = (0, import_react23.useRef)(null);
|
|
4448
|
+
const ref = (0, import_react23.useCallback)((node) => {
|
|
4356
4449
|
var _a2;
|
|
4357
4450
|
domRef.current = node;
|
|
4358
4451
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
@@ -4361,7 +4454,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4361
4454
|
computed: { computedRemainingSpace },
|
|
4362
4455
|
componentState: { portalDOMRef }
|
|
4363
4456
|
} = useInfiniteTable();
|
|
4364
|
-
(0,
|
|
4457
|
+
(0, import_react23.useEffect)(() => {
|
|
4365
4458
|
let clearOnResize = null;
|
|
4366
4459
|
const node = domRef.current;
|
|
4367
4460
|
if (onResize && node) {
|
|
@@ -4384,7 +4477,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4384
4477
|
let offset = offsetFromProps != null ? offsetFromProps : virtualized ? 0 : column.computedPinningOffset;
|
|
4385
4478
|
let draggingProxy = null;
|
|
4386
4479
|
if (dragging) {
|
|
4387
|
-
draggingProxy = /* @__PURE__ */
|
|
4480
|
+
draggingProxy = /* @__PURE__ */ React13.createElement("div", {
|
|
4388
4481
|
className: `${baseCls}Proxy ${HeaderCellProxy}`,
|
|
4389
4482
|
style: {
|
|
4390
4483
|
position: "absolute",
|
|
@@ -4397,7 +4490,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4397
4490
|
}, header);
|
|
4398
4491
|
draggingProxy = (0, import_react_dom.createPortal)(draggingProxy, portalDOMRef.current);
|
|
4399
4492
|
}
|
|
4400
|
-
return /* @__PURE__ */
|
|
4493
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(InfiniteTableCell, {
|
|
4401
4494
|
domRef: ref,
|
|
4402
4495
|
column,
|
|
4403
4496
|
"data-name": `HeaderCell`,
|
|
@@ -4413,29 +4506,29 @@ function InfiniteTableHeaderCell(props) {
|
|
|
4413
4506
|
}
|
|
4414
4507
|
|
|
4415
4508
|
// src/components/RawList/index.tsx
|
|
4416
|
-
var
|
|
4417
|
-
var
|
|
4509
|
+
var React16 = __toModule(require("react"));
|
|
4510
|
+
var import_react26 = __toModule(require("react"));
|
|
4418
4511
|
|
|
4419
4512
|
// src/components/RawList/AvoidReactDiff.tsx
|
|
4420
|
-
var
|
|
4421
|
-
var
|
|
4513
|
+
var React14 = __toModule(require("react"));
|
|
4514
|
+
var import_react24 = __toModule(require("react"));
|
|
4422
4515
|
function AvoidReactDiffFn(props) {
|
|
4423
|
-
const [children, setChildren] = (0,
|
|
4424
|
-
(0,
|
|
4516
|
+
const [children, setChildren] = (0, import_react24.useState)(props.updater.get());
|
|
4517
|
+
(0, import_react24.useLayoutEffect)(() => {
|
|
4425
4518
|
const remove = props.updater.onChange((children2) => {
|
|
4426
4519
|
setChildren(children2);
|
|
4427
4520
|
});
|
|
4428
4521
|
return remove;
|
|
4429
4522
|
}, [props.updater]);
|
|
4430
|
-
return /* @__PURE__ */
|
|
4523
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, children);
|
|
4431
4524
|
}
|
|
4432
|
-
var AvoidReactDiff =
|
|
4525
|
+
var AvoidReactDiff = React14.memo(AvoidReactDiffFn);
|
|
4433
4526
|
|
|
4434
4527
|
// src/components/RawList/useVirtualRenderer.ts
|
|
4435
|
-
var
|
|
4528
|
+
var import_react25 = __toModule(require("react"));
|
|
4436
4529
|
|
|
4437
4530
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
4438
|
-
var
|
|
4531
|
+
var React15 = __toModule(require("react"));
|
|
4439
4532
|
|
|
4440
4533
|
// src/components/RawList/MappedItems.ts
|
|
4441
4534
|
var MappedItems = class extends Logger {
|
|
@@ -4680,7 +4773,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4680
4773
|
};
|
|
4681
4774
|
this.itemDOMRefs[elementIndex] = domRef;
|
|
4682
4775
|
this.updaters[elementIndex] = buildSubscriptionCallback();
|
|
4683
|
-
const item = /* @__PURE__ */
|
|
4776
|
+
const item = /* @__PURE__ */ React15.createElement(AvoidReactDiff, {
|
|
4684
4777
|
key: elementIndex,
|
|
4685
4778
|
name: `${elementIndex}`,
|
|
4686
4779
|
updater: this.updaters[elementIndex]
|
|
@@ -4746,7 +4839,7 @@ function createRenderer(brain) {
|
|
|
4746
4839
|
function useVirtualRenderer({
|
|
4747
4840
|
brain
|
|
4748
4841
|
}) {
|
|
4749
|
-
return (0,
|
|
4842
|
+
return (0, import_react25.useMemo)(() => {
|
|
4750
4843
|
return createRenderer(brain);
|
|
4751
4844
|
}, [brain]);
|
|
4752
4845
|
}
|
|
@@ -4759,7 +4852,7 @@ function RawListFn(props) {
|
|
|
4759
4852
|
debugChannel
|
|
4760
4853
|
});
|
|
4761
4854
|
const getRenderItem = useLatest(renderItem);
|
|
4762
|
-
(0,
|
|
4855
|
+
(0, import_react26.useEffect)(() => {
|
|
4763
4856
|
const renderRange = brain.getRenderRange();
|
|
4764
4857
|
renderer.renderRange(renderRange, {
|
|
4765
4858
|
renderItem,
|
|
@@ -4767,7 +4860,7 @@ function RawListFn(props) {
|
|
|
4767
4860
|
onRender: onRenderUpdater
|
|
4768
4861
|
});
|
|
4769
4862
|
}, [brain, renderItem, onRenderUpdater]);
|
|
4770
|
-
(0,
|
|
4863
|
+
(0, import_react26.useEffect)(() => {
|
|
4771
4864
|
const remove = brain.onRenderRangeChange((renderRange) => {
|
|
4772
4865
|
renderer.renderRange(renderRange, {
|
|
4773
4866
|
force: false,
|
|
@@ -4777,11 +4870,11 @@ function RawListFn(props) {
|
|
|
4777
4870
|
});
|
|
4778
4871
|
return remove;
|
|
4779
4872
|
}, [brain, onRenderUpdater]);
|
|
4780
|
-
return /* @__PURE__ */
|
|
4873
|
+
return /* @__PURE__ */ React16.createElement(AvoidReactDiff, {
|
|
4781
4874
|
updater: onRenderUpdater
|
|
4782
4875
|
});
|
|
4783
4876
|
}
|
|
4784
|
-
var RawList =
|
|
4877
|
+
var RawList = React16.memo(RawListFn);
|
|
4785
4878
|
|
|
4786
4879
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
4787
4880
|
var debug3 = dbg("Header");
|
|
@@ -4794,7 +4887,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4794
4887
|
componentState: { headerHeight }
|
|
4795
4888
|
} = useInfiniteTable();
|
|
4796
4889
|
const { computedVisibleColumnsMap } = computed;
|
|
4797
|
-
const renderColumn = (0,
|
|
4890
|
+
const renderColumn = (0, import_react27.useCallback)(({ domRef: domRef2, itemIndex: columnIndex }) => {
|
|
4798
4891
|
const column = columns[columnIndex];
|
|
4799
4892
|
if (!column) {
|
|
4800
4893
|
if (true) {
|
|
@@ -4802,21 +4895,21 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4802
4895
|
}
|
|
4803
4896
|
return null;
|
|
4804
4897
|
}
|
|
4805
|
-
return /* @__PURE__ */
|
|
4898
|
+
return /* @__PURE__ */ React17.createElement(InfiniteTableHeaderCell, {
|
|
4806
4899
|
domRef: domRef2,
|
|
4807
4900
|
column,
|
|
4808
4901
|
headerHeight,
|
|
4809
4902
|
columns: computedVisibleColumnsMap
|
|
4810
4903
|
});
|
|
4811
4904
|
}, [computedVisibleColumnsMap, columns, repaintId, headerHeight]);
|
|
4812
|
-
(0,
|
|
4905
|
+
(0, import_react27.useEffect)(() => {
|
|
4813
4906
|
const onScroll = (scrollPosition) => {
|
|
4814
4907
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
4815
4908
|
};
|
|
4816
4909
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
4817
4910
|
return removeOnScroll;
|
|
4818
4911
|
}, [brain]);
|
|
4819
|
-
const domRef = (0,
|
|
4912
|
+
const domRef = (0, import_react27.useRef)(null);
|
|
4820
4913
|
const headerCls = HeaderClsRecipe({
|
|
4821
4914
|
pinned: pinning,
|
|
4822
4915
|
overflow: false,
|
|
@@ -4827,18 +4920,18 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4827
4920
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
4828
4921
|
style
|
|
4829
4922
|
};
|
|
4830
|
-
return /* @__PURE__ */
|
|
4923
|
+
return /* @__PURE__ */ React17.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React17.createElement(RawList, {
|
|
4831
4924
|
brain,
|
|
4832
4925
|
renderItem: renderColumn
|
|
4833
4926
|
}));
|
|
4834
4927
|
}
|
|
4835
|
-
var InfiniteTableHeader =
|
|
4928
|
+
var InfiniteTableHeader = React17.memo(InfiniteTableHeaderFn);
|
|
4836
4929
|
|
|
4837
4930
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
4838
|
-
var
|
|
4931
|
+
var React20 = __toModule(require("react"));
|
|
4839
4932
|
|
|
4840
4933
|
// src/components/InfiniteTable/components/InfiniteTableHeader/renderColumnHeaderGroups.tsx
|
|
4841
|
-
var
|
|
4934
|
+
var React19 = __toModule(require("react"));
|
|
4842
4935
|
|
|
4843
4936
|
// src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
|
|
4844
4937
|
function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap) {
|
|
@@ -4928,7 +5021,7 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
4928
5021
|
}
|
|
4929
5022
|
|
|
4930
5023
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
4931
|
-
var
|
|
5024
|
+
var React18 = __toModule(require("react"));
|
|
4932
5025
|
var TableHeaderGroupClassName = `${rootClassName}HeaderGroup`;
|
|
4933
5026
|
function InfiniteTableHeaderGroup(props) {
|
|
4934
5027
|
const { columnGroup, height, headerHeight } = props;
|
|
@@ -4942,16 +5035,16 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
4942
5035
|
width: columnGroup.computedWidth,
|
|
4943
5036
|
height
|
|
4944
5037
|
};
|
|
4945
|
-
return /* @__PURE__ */
|
|
5038
|
+
return /* @__PURE__ */ React18.createElement("div", {
|
|
4946
5039
|
"data-group-id": columnGroup.id,
|
|
4947
5040
|
className: join(HeaderGroupCls, TableHeaderGroupClassName, `${TableHeaderGroupClassName}--unvirtualized`),
|
|
4948
5041
|
style
|
|
4949
|
-
}, /* @__PURE__ */
|
|
5042
|
+
}, /* @__PURE__ */ React18.createElement("div", {
|
|
4950
5043
|
className: join(`${TableHeaderGroupClassName}__header`, HeaderGroup_Header),
|
|
4951
5044
|
style: { height: headerHeight }
|
|
4952
|
-
}, /* @__PURE__ */
|
|
5045
|
+
}, /* @__PURE__ */ React18.createElement("div", {
|
|
4953
5046
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
4954
|
-
}, header)), /* @__PURE__ */
|
|
5047
|
+
}, header)), /* @__PURE__ */ React18.createElement("div", {
|
|
4955
5048
|
className: join(`${TableHeaderGroupClassName}__children`, HeaderGroup_Children)
|
|
4956
5049
|
}, props.children));
|
|
4957
5050
|
}
|
|
@@ -4974,7 +5067,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
4974
5067
|
return items2.map((colGroupItem) => {
|
|
4975
5068
|
if (colGroupItem.type === "column") {
|
|
4976
5069
|
const col = colGroupItem.ref;
|
|
4977
|
-
return /* @__PURE__ */
|
|
5070
|
+
return /* @__PURE__ */ React19.createElement(InfiniteTableHeaderCell, {
|
|
4978
5071
|
key: col.id,
|
|
4979
5072
|
headerHeight: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
4980
5073
|
column: col,
|
|
@@ -4988,7 +5081,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
4988
5081
|
colIds.push(col.id);
|
|
4989
5082
|
return col;
|
|
4990
5083
|
});
|
|
4991
|
-
return /* @__PURE__ */
|
|
5084
|
+
return /* @__PURE__ */ React19.createElement(InfiniteTableHeaderGroup, {
|
|
4992
5085
|
key: `${colGroupItem.uniqueGroupId.join("/")}`,
|
|
4993
5086
|
columns: columns2,
|
|
4994
5087
|
height: (columnGroupsMaxDepth - colGroupItem.depth + 2) * headerHeight,
|
|
@@ -5008,7 +5101,7 @@ function renderColumnHeaderGroups(config) {
|
|
|
5008
5101
|
}
|
|
5009
5102
|
|
|
5010
5103
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderUnvirtualized.tsx
|
|
5011
|
-
var
|
|
5104
|
+
var import_react28 = __toModule(require("react"));
|
|
5012
5105
|
var { rootClassName: rootClassName5 } = internalProps;
|
|
5013
5106
|
var TableHeaderClassName2 = `${rootClassName5}Header`;
|
|
5014
5107
|
var UPDATE_SCROLL = (node, scrollPosition) => {
|
|
@@ -5041,9 +5134,9 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5041
5134
|
},
|
|
5042
5135
|
computed: { computedVisibleColumnsMap: columnsMap }
|
|
5043
5136
|
} = useInfiniteTable();
|
|
5044
|
-
const domRef =
|
|
5137
|
+
const domRef = React20.useRef(null);
|
|
5045
5138
|
const hasColumnGroups = computedColumnGroups.size > 0;
|
|
5046
|
-
const columnHeaderGroups =
|
|
5139
|
+
const columnHeaderGroups = React20.useMemo(() => {
|
|
5047
5140
|
return hasColumnGroups ? renderColumnHeaderGroups({
|
|
5048
5141
|
columnGroups: computedColumnGroups,
|
|
5049
5142
|
columnGroupsDepthsMap,
|
|
@@ -5062,7 +5155,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5062
5155
|
columnGroupsMaxDepth
|
|
5063
5156
|
]);
|
|
5064
5157
|
const children = hasColumnGroups ? columnHeaderGroups : columns.map((c) => {
|
|
5065
|
-
return /* @__PURE__ */
|
|
5158
|
+
return /* @__PURE__ */ React20.createElement(InfiniteTableHeaderCell, {
|
|
5066
5159
|
key: c.id,
|
|
5067
5160
|
headerHeight,
|
|
5068
5161
|
column: c,
|
|
@@ -5074,7 +5167,7 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5074
5167
|
if (totalWidth != null) {
|
|
5075
5168
|
style.width = availableWidth;
|
|
5076
5169
|
}
|
|
5077
|
-
(0,
|
|
5170
|
+
(0, import_react28.useEffect)(() => {
|
|
5078
5171
|
const scroller = brain || scrollListener;
|
|
5079
5172
|
if (!scroller || !scrollable) {
|
|
5080
5173
|
return;
|
|
@@ -5085,20 +5178,20 @@ function InfiniteTableHeaderUnvirtualizedFn(props) {
|
|
|
5085
5178
|
const removeOnScroll = scroller.onScroll(onScroll);
|
|
5086
5179
|
return removeOnScroll;
|
|
5087
5180
|
}, [brain, scrollListener]);
|
|
5088
|
-
return /* @__PURE__ */
|
|
5181
|
+
return /* @__PURE__ */ React20.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
5089
5182
|
className: join(TableHeaderClassName2, `${TableHeaderClassName2}--unvirtualized`, pinning ? `${TableHeaderClassName2}--pinned ${TableHeaderClassName2}-${pinning}` : "", scrollable ? `${TableHeaderClassName2}--overflow` : "", domProps.className, HeaderClsRecipe({
|
|
5090
5183
|
pinned: pinning,
|
|
5091
5184
|
virtualized: false,
|
|
5092
5185
|
overflow: scrollable
|
|
5093
5186
|
})),
|
|
5094
5187
|
style
|
|
5095
|
-
}), /* @__PURE__ */
|
|
5188
|
+
}), /* @__PURE__ */ React20.createElement("div", {
|
|
5096
5189
|
style: { width: totalWidth },
|
|
5097
5190
|
className: join(flexFlow.row, display.flex),
|
|
5098
5191
|
ref: domRef
|
|
5099
5192
|
}, children));
|
|
5100
5193
|
}
|
|
5101
|
-
var InfiniteTableHeaderUnvirtualized =
|
|
5194
|
+
var InfiniteTableHeaderUnvirtualized = React20.memo(InfiniteTableHeaderUnvirtualizedFn);
|
|
5102
5195
|
|
|
5103
5196
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
5104
5197
|
function TableHeaderWrapper(props) {
|
|
@@ -5128,7 +5221,7 @@ function TableHeaderWrapper(props) {
|
|
|
5128
5221
|
const hasPinnedStart = computedPinnedStartColumns.length > 0;
|
|
5129
5222
|
const hasPinnedEnd = computedPinnedEndColumns.length > 0;
|
|
5130
5223
|
const height = columnGroupsMaxDepth ? columnGroupsMaxDepth * headerHeight : headerHeight;
|
|
5131
|
-
const header = virtualizeHeader ? /* @__PURE__ */
|
|
5224
|
+
const header = virtualizeHeader ? /* @__PURE__ */ React21.createElement(InfiniteTableHeader, {
|
|
5132
5225
|
columns: computedUnpinnedColumns,
|
|
5133
5226
|
repaintId: virtualizeHeader ? repaintId : void 0,
|
|
5134
5227
|
brain,
|
|
@@ -5141,7 +5234,7 @@ function TableHeaderWrapper(props) {
|
|
|
5141
5234
|
},
|
|
5142
5235
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
5143
5236
|
totalWidth: computedUnpinnedColumnsWidth
|
|
5144
|
-
}) : /* @__PURE__ */
|
|
5237
|
+
}) : /* @__PURE__ */ React21.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
5145
5238
|
brain,
|
|
5146
5239
|
scrollable: true,
|
|
5147
5240
|
pinning: false,
|
|
@@ -5149,12 +5242,12 @@ function TableHeaderWrapper(props) {
|
|
|
5149
5242
|
availableWidth: computedUnpinnedColumnsWidth,
|
|
5150
5243
|
totalWidth: computedUnpinnedColumnsWidth
|
|
5151
5244
|
});
|
|
5152
|
-
return /* @__PURE__ */
|
|
5245
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
5153
5246
|
className: HeaderWrapperCls,
|
|
5154
5247
|
style: {
|
|
5155
5248
|
height: virtualizeHeader ? height : void 0
|
|
5156
5249
|
}
|
|
5157
|
-
}, hasPinnedStart ? /* @__PURE__ */
|
|
5250
|
+
}, hasPinnedStart ? /* @__PURE__ */ React21.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
5158
5251
|
style: {
|
|
5159
5252
|
left: 0,
|
|
5160
5253
|
position: "absolute",
|
|
@@ -5166,7 +5259,7 @@ function TableHeaderWrapper(props) {
|
|
|
5166
5259
|
scrollable: computedPinnedStartOverflow,
|
|
5167
5260
|
pinning: "start",
|
|
5168
5261
|
scrollListener: computedPinnedStartOverflow ? pinnedStartScrollListener : void 0
|
|
5169
|
-
}) : null, header, hasPinnedEnd ? /* @__PURE__ */
|
|
5262
|
+
}) : null, header, hasPinnedEnd ? /* @__PURE__ */ React21.createElement(InfiniteTableHeaderUnvirtualized, {
|
|
5170
5263
|
style: {
|
|
5171
5264
|
right: scrollbars.vertical ? getScrollbarWidth() : 0,
|
|
5172
5265
|
position: "absolute",
|
|
@@ -5178,7 +5271,7 @@ function TableHeaderWrapper(props) {
|
|
|
5178
5271
|
scrollable: computedPinnedEndOverflow,
|
|
5179
5272
|
pinning: "end",
|
|
5180
5273
|
scrollListener: computedPinnedEndOverflow ? pinnedEndScrollListener : void 0
|
|
5181
|
-
}) : null, scrollbars.vertical ? /* @__PURE__ */
|
|
5274
|
+
}) : null, scrollbars.vertical ? /* @__PURE__ */ React21.createElement(VerticalScrollbarPlaceholder, {
|
|
5182
5275
|
style: {
|
|
5183
5276
|
height: "100%",
|
|
5184
5277
|
right: 0
|
|
@@ -5187,13 +5280,13 @@ function TableHeaderWrapper(props) {
|
|
|
5187
5280
|
}
|
|
5188
5281
|
|
|
5189
5282
|
// src/components/VirtualScrollContainer/index.tsx
|
|
5190
|
-
var
|
|
5191
|
-
var
|
|
5283
|
+
var React22 = __toModule(require("react"));
|
|
5284
|
+
var import_react30 = __toModule(require("react"));
|
|
5192
5285
|
|
|
5193
5286
|
// src/components/hooks/useOnScroll.ts
|
|
5194
|
-
var
|
|
5287
|
+
var import_react29 = __toModule(require("react"));
|
|
5195
5288
|
var useOnScroll = (domRef, onScroll) => {
|
|
5196
|
-
(0,
|
|
5289
|
+
(0, import_react29.useEffect)(() => {
|
|
5197
5290
|
const domNode = domRef == null ? void 0 : domRef.current;
|
|
5198
5291
|
const scrollFn = (event) => {
|
|
5199
5292
|
const node = event.target;
|
|
@@ -5231,7 +5324,7 @@ var getScrollableClassName = (scrollable) => {
|
|
|
5231
5324
|
|
|
5232
5325
|
// src/components/VirtualScrollContainer/index.tsx
|
|
5233
5326
|
var rootClassName6 = "InfiniteVirtualScrollContainer";
|
|
5234
|
-
var VirtualScrollContainer =
|
|
5327
|
+
var VirtualScrollContainer = React22.forwardRef(function VirtualScrollContainer2(props, ref) {
|
|
5235
5328
|
const {
|
|
5236
5329
|
children,
|
|
5237
5330
|
scrollable = true,
|
|
@@ -5239,9 +5332,9 @@ var VirtualScrollContainer = React23.forwardRef(function VirtualScrollContainer2
|
|
|
5239
5332
|
className,
|
|
5240
5333
|
style
|
|
5241
5334
|
} = props;
|
|
5242
|
-
const domRef = ref != null ? ref : (0,
|
|
5335
|
+
const domRef = ref != null ? ref : (0, import_react30.useRef)(null);
|
|
5243
5336
|
useOnScroll(domRef, onContainerScroll);
|
|
5244
|
-
return /* @__PURE__ */
|
|
5337
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
5245
5338
|
ref: domRef,
|
|
5246
5339
|
style,
|
|
5247
5340
|
className: join(className, rootClassName6, VirtualScrollContainerCls, getScrollableClassName(scrollable))
|
|
@@ -5249,7 +5342,7 @@ var VirtualScrollContainer = React23.forwardRef(function VirtualScrollContainer2
|
|
|
5249
5342
|
});
|
|
5250
5343
|
|
|
5251
5344
|
// src/components/VirtualList/SpacePlaceholder.tsx
|
|
5252
|
-
var
|
|
5345
|
+
var React23 = __toModule(require("react"));
|
|
5253
5346
|
function SpacePlaceholderFn(props) {
|
|
5254
5347
|
const { height, width, count } = props;
|
|
5255
5348
|
const style = {
|
|
@@ -5259,7 +5352,7 @@ function SpacePlaceholderFn(props) {
|
|
|
5259
5352
|
opacity: 0,
|
|
5260
5353
|
pointerEvents: "none"
|
|
5261
5354
|
};
|
|
5262
|
-
return /* @__PURE__ */
|
|
5355
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
5263
5356
|
"data-count": count,
|
|
5264
5357
|
"data-placeholder-width": true ? width : void 0,
|
|
5265
5358
|
"data-placeholder-height": true ? height : void 0,
|
|
@@ -5267,24 +5360,24 @@ function SpacePlaceholderFn(props) {
|
|
|
5267
5360
|
style
|
|
5268
5361
|
});
|
|
5269
5362
|
}
|
|
5270
|
-
var SpacePlaceholder =
|
|
5363
|
+
var SpacePlaceholder = React23.memo(SpacePlaceholderFn);
|
|
5271
5364
|
|
|
5272
5365
|
// src/components/InfiniteTable/hooks/useListRendering.tsx
|
|
5273
|
-
var
|
|
5366
|
+
var import_react41 = __toModule(require("react"));
|
|
5274
5367
|
|
|
5275
5368
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
5276
|
-
var
|
|
5277
|
-
var
|
|
5369
|
+
var React29 = __toModule(require("react"));
|
|
5370
|
+
var import_react34 = __toModule(require("react"));
|
|
5278
5371
|
|
|
5279
5372
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
5280
|
-
var
|
|
5373
|
+
var React25 = __toModule(require("react"));
|
|
5281
5374
|
|
|
5282
5375
|
// src/components/VirtualList/VirtualList.tsx
|
|
5283
|
-
var
|
|
5284
|
-
var
|
|
5376
|
+
var React24 = __toModule(require("react"));
|
|
5377
|
+
var import_react31 = __toModule(require("react"));
|
|
5285
5378
|
|
|
5286
5379
|
// src/components/VirtualList/VirtualList.css.ts
|
|
5287
|
-
var VirtualListCls = "
|
|
5380
|
+
var VirtualListCls = "_16lm1iw1 _16lm1iw8 _16lm1iw0";
|
|
5288
5381
|
var VirtualListClsOrientation = { horizontal: "mlx2t1", vertical: "mlx2t2" };
|
|
5289
5382
|
var scrollTransformTargetCls = "mlx2t3";
|
|
5290
5383
|
|
|
@@ -5324,11 +5417,11 @@ var VirtualList = (props) => {
|
|
|
5324
5417
|
"onContainerScroll",
|
|
5325
5418
|
"children"
|
|
5326
5419
|
]);
|
|
5327
|
-
const domRef = (0,
|
|
5420
|
+
const domRef = (0, import_react31.useRef)(null);
|
|
5328
5421
|
const [, rerender] = useRerender();
|
|
5329
|
-
const [totalSize, setTotalSize] = (0,
|
|
5330
|
-
const renderCountRef = (0,
|
|
5331
|
-
(0,
|
|
5422
|
+
const [totalSize, setTotalSize] = (0, import_react31.useState)(0);
|
|
5423
|
+
const renderCountRef = (0, import_react31.useRef)(0);
|
|
5424
|
+
(0, import_react31.useEffect)(() => {
|
|
5332
5425
|
const removeOnRenderCount = virtualBrain.onRenderCountChange((renderCount) => {
|
|
5333
5426
|
renderCountRef.current = renderCount;
|
|
5334
5427
|
if (true) {
|
|
@@ -5347,7 +5440,7 @@ var VirtualList = (props) => {
|
|
|
5347
5440
|
removeOnTotalSizeChange();
|
|
5348
5441
|
};
|
|
5349
5442
|
}, [virtualBrain]);
|
|
5350
|
-
(0,
|
|
5443
|
+
(0, import_react31.useEffect)(() => {
|
|
5351
5444
|
const onScroll = (scrollPosition) => {
|
|
5352
5445
|
UPDATE_SCROLL2(domRef.current, scrollPosition);
|
|
5353
5446
|
};
|
|
@@ -5362,19 +5455,19 @@ var VirtualList = (props) => {
|
|
|
5362
5455
|
if (true) {
|
|
5363
5456
|
domProps["data-cmp-name"] = `VirtualList`;
|
|
5364
5457
|
}
|
|
5365
|
-
return /* @__PURE__ */
|
|
5458
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React24.createElement(VirtualScrollContainer, {
|
|
5366
5459
|
scrollable,
|
|
5367
5460
|
onContainerScroll
|
|
5368
|
-
}, /* @__PURE__ */
|
|
5461
|
+
}, /* @__PURE__ */ React24.createElement("div", {
|
|
5369
5462
|
ref: domRef,
|
|
5370
5463
|
className: scrollTransformTargetCls,
|
|
5371
5464
|
"data-name": "scroll-transform-target"
|
|
5372
|
-
}, /* @__PURE__ */
|
|
5465
|
+
}, /* @__PURE__ */ React24.createElement(RawList, {
|
|
5373
5466
|
brain: virtualBrain,
|
|
5374
5467
|
renderItem,
|
|
5375
5468
|
repaintId,
|
|
5376
5469
|
debugChannel: "VirtualList-" + mainAxis
|
|
5377
|
-
})), children, /* @__PURE__ */
|
|
5470
|
+
})), children, /* @__PURE__ */ React24.createElement(SpacePlaceholder, {
|
|
5378
5471
|
count,
|
|
5379
5472
|
width,
|
|
5380
5473
|
height
|
|
@@ -5384,14 +5477,14 @@ var VirtualList = (props) => {
|
|
|
5384
5477
|
// src/components/VirtualList/VirtualRowList.tsx
|
|
5385
5478
|
var VirtualRowList = (props) => {
|
|
5386
5479
|
const _a = props, { rowWidth, rowHeight, renderRow } = _a, listProps = __objRest(_a, ["rowWidth", "rowHeight", "renderRow"]);
|
|
5387
|
-
const renderItem =
|
|
5480
|
+
const renderItem = React25.useCallback((renderProps) => {
|
|
5388
5481
|
return renderRow({
|
|
5389
5482
|
domRef: renderProps.domRef,
|
|
5390
5483
|
rowHeight: renderProps.itemSize,
|
|
5391
5484
|
rowIndex: renderProps.itemIndex
|
|
5392
5485
|
});
|
|
5393
5486
|
}, [renderRow]);
|
|
5394
|
-
return /* @__PURE__ */
|
|
5487
|
+
return /* @__PURE__ */ React25.createElement(VirtualList, __spreadProps(__spreadValues({}, listProps), {
|
|
5395
5488
|
renderItem,
|
|
5396
5489
|
mainAxis: "vertical",
|
|
5397
5490
|
itemMainAxisSize: rowHeight,
|
|
@@ -5400,11 +5493,11 @@ var VirtualRowList = (props) => {
|
|
|
5400
5493
|
};
|
|
5401
5494
|
|
|
5402
5495
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRow.tsx
|
|
5403
|
-
var
|
|
5404
|
-
var
|
|
5496
|
+
var React27 = __toModule(require("react"));
|
|
5497
|
+
var import_react33 = __toModule(require("react"));
|
|
5405
5498
|
|
|
5406
5499
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
5407
|
-
var
|
|
5500
|
+
var React26 = __toModule(require("react"));
|
|
5408
5501
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
5409
5502
|
var InfiniteTableColumnCellClassName = `${rootClassName8}ColumnCell`;
|
|
5410
5503
|
function isColumnWithField(c) {
|
|
@@ -5431,32 +5524,38 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5431
5524
|
const groupRowInfo = null;
|
|
5432
5525
|
let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
|
|
5433
5526
|
if (column.valueGetter) {
|
|
5434
|
-
value = column.valueGetter({
|
|
5435
|
-
data,
|
|
5436
|
-
rowInfo
|
|
5437
|
-
|
|
5527
|
+
value = column.valueGetter(isGroupRow ? {
|
|
5528
|
+
data: rowInfo.data,
|
|
5529
|
+
rowInfo
|
|
5530
|
+
} : {
|
|
5531
|
+
data: rowInfo.data,
|
|
5532
|
+
rowInfo
|
|
5438
5533
|
});
|
|
5439
5534
|
}
|
|
5440
5535
|
const { componentState: computedDataSource } = useDataSourceContextValue();
|
|
5441
|
-
const
|
|
5442
|
-
|
|
5443
|
-
|
|
5536
|
+
const rest = rowInfo.isGroupRow ? {
|
|
5537
|
+
rowInfo,
|
|
5538
|
+
data: rowInfo.data
|
|
5539
|
+
} : {
|
|
5444
5540
|
rowInfo,
|
|
5445
|
-
data
|
|
5541
|
+
data: rowInfo.data
|
|
5446
5542
|
};
|
|
5543
|
+
const stylingRenderParam = __spreadValues({
|
|
5544
|
+
value,
|
|
5545
|
+
column
|
|
5546
|
+
}, rest);
|
|
5447
5547
|
let renderValue = value;
|
|
5448
5548
|
if (column.render || column.renderValue) {
|
|
5449
|
-
const renderParam = {
|
|
5549
|
+
const renderParam = __spreadProps(__spreadValues({
|
|
5450
5550
|
value,
|
|
5451
5551
|
column,
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
data,
|
|
5552
|
+
groupRowInfo
|
|
5553
|
+
}, rest), {
|
|
5455
5554
|
rowIndex,
|
|
5456
5555
|
toggleGroupRow,
|
|
5457
5556
|
toggleCurrentGroupRow: () => toggleGroupRow(rowInfo.groupKeys),
|
|
5458
|
-
|
|
5459
|
-
};
|
|
5557
|
+
groupBy: computedDataSource.groupBy
|
|
5558
|
+
});
|
|
5460
5559
|
if (column.render) {
|
|
5461
5560
|
renderValue = column.render(renderParam);
|
|
5462
5561
|
} else if (column.renderValue) {
|
|
@@ -5491,7 +5590,7 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5491
5590
|
}
|
|
5492
5591
|
}
|
|
5493
5592
|
}
|
|
5494
|
-
return /* @__PURE__ */
|
|
5593
|
+
return /* @__PURE__ */ React26.createElement(InfiniteTableCell, __spreadProps(__spreadValues({
|
|
5495
5594
|
domRef,
|
|
5496
5595
|
offsetProperty
|
|
5497
5596
|
}, dataset), {
|
|
@@ -5502,10 +5601,10 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5502
5601
|
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false }), colClassName)
|
|
5503
5602
|
}), hidden ? null : renderValue);
|
|
5504
5603
|
}
|
|
5505
|
-
var InfiniteTableColumnCell =
|
|
5604
|
+
var InfiniteTableColumnCell = React26.memo(InfiniteTableColumnCellFn);
|
|
5506
5605
|
|
|
5507
5606
|
// src/components/InfiniteTable/components/InfiniteTableRow/useRowDOMProps.ts
|
|
5508
|
-
var
|
|
5607
|
+
var import_react32 = __toModule(require("react"));
|
|
5509
5608
|
|
|
5510
5609
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowClassName.ts
|
|
5511
5610
|
var { rootClassName: rootClassName9 } = internalProps;
|
|
@@ -5530,17 +5629,16 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
5530
5629
|
domRef: domRefFromProps,
|
|
5531
5630
|
rowInfo
|
|
5532
5631
|
} = props;
|
|
5533
|
-
const domRef = (0,
|
|
5534
|
-
const rowDOMRef = (0,
|
|
5632
|
+
const domRef = (0, import_react32.useRef)(null);
|
|
5633
|
+
const rowDOMRef = (0, import_react32.useCallback)((node) => {
|
|
5535
5634
|
domRefFromProps(node);
|
|
5536
5635
|
domRef.current = node;
|
|
5537
5636
|
}, []);
|
|
5538
|
-
const
|
|
5539
|
-
|
|
5540
|
-
rowInfo,
|
|
5637
|
+
const rest = rowInfo.isGroupRow ? { data: rowInfo.data, rowInfo } : { data: rowInfo.data, rowInfo };
|
|
5638
|
+
const rowPropsAndStyleArgs = __spreadProps(__spreadValues({}, rest), {
|
|
5541
5639
|
rowIndex,
|
|
5542
|
-
|
|
5543
|
-
};
|
|
5640
|
+
groupBy: rowInfo.groupBy
|
|
5641
|
+
});
|
|
5544
5642
|
if (typeof rowProps === "function") {
|
|
5545
5643
|
rowProps = rowProps(rowPropsAndStyleArgs);
|
|
5546
5644
|
}
|
|
@@ -5563,7 +5661,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
5563
5661
|
}), `${InfiniteTableRowClassName}--${rowInfo.isGroupRow ? "group" : "normal"}-row`, inlineGroupRoot ? `${InfiniteTableRowClassName}--inline-group-row` : "", showZebraRows ? `${InfiniteTableRowClassName}--${odd ? "odd" : "even"}` : null, showHoverRows ? `${InfiniteTableRowClassName}--show-hover` : null, domProps == null ? void 0 : domProps.className, rowProps == null ? void 0 : rowProps.className, rowComputedClassName);
|
|
5564
5662
|
const initialMouseEnter = rowProps == null ? void 0 : rowProps.onMouseEnter;
|
|
5565
5663
|
const initialMouseLeave = rowProps == null ? void 0 : rowProps.onMouseLeave;
|
|
5566
|
-
const onMouseEnter = (0,
|
|
5664
|
+
const onMouseEnter = (0, import_react32.useCallback)((event) => {
|
|
5567
5665
|
var _a;
|
|
5568
5666
|
initialMouseEnter == null ? void 0 : initialMouseEnter(event);
|
|
5569
5667
|
const rowIndex2 = ((_a = event.currentTarget) == null ? void 0 : _a.dataset.rowIndex) * 1;
|
|
@@ -5577,7 +5675,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
5577
5675
|
const rows = parentNode.querySelectorAll(hoverSelector.join(","));
|
|
5578
5676
|
rows.forEach((row) => row.classList.add(InfiniteTableRowClassName__hover, RowHoverCls));
|
|
5579
5677
|
}, [initialMouseEnter, showHoverRows]);
|
|
5580
|
-
const onMouseLeave = (0,
|
|
5678
|
+
const onMouseLeave = (0, import_react32.useCallback)((event) => {
|
|
5581
5679
|
var _a;
|
|
5582
5680
|
initialMouseLeave == null ? void 0 : initialMouseLeave(event);
|
|
5583
5681
|
const rowIndex2 = (_a = event.currentTarget) == null ? void 0 : _a.dataset.rowIndex;
|
|
@@ -5633,13 +5731,13 @@ function InfiniteTableRowFn(props) {
|
|
|
5633
5731
|
width: rowWidth,
|
|
5634
5732
|
height: rowHeight
|
|
5635
5733
|
}, domProps.style);
|
|
5636
|
-
const renderCellRef = (0,
|
|
5637
|
-
const renderCell =
|
|
5734
|
+
const renderCellRef = (0, import_react33.useRef)(null);
|
|
5735
|
+
const renderCell = React27.useCallback(({ domRef, itemIndex }) => {
|
|
5638
5736
|
const column = columns[itemIndex];
|
|
5639
5737
|
if (!column) {
|
|
5640
5738
|
}
|
|
5641
5739
|
const hidden = false;
|
|
5642
|
-
return /* @__PURE__ */
|
|
5740
|
+
return /* @__PURE__ */ React27.createElement(InfiniteTableColumnCell, {
|
|
5643
5741
|
getData,
|
|
5644
5742
|
rowInfo,
|
|
5645
5743
|
groupRenderStrategy,
|
|
@@ -5666,18 +5764,18 @@ function InfiniteTableRowFn(props) {
|
|
|
5666
5764
|
if (true) {
|
|
5667
5765
|
domProps["data-cmp-name"] = "ITableRow";
|
|
5668
5766
|
}
|
|
5669
|
-
return /* @__PURE__ */
|
|
5767
|
+
return /* @__PURE__ */ React27.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
5670
5768
|
style
|
|
5671
|
-
}), /* @__PURE__ */
|
|
5769
|
+
}), /* @__PURE__ */ React27.createElement(RawList, {
|
|
5672
5770
|
brain,
|
|
5673
5771
|
renderItem: renderCell,
|
|
5674
5772
|
debugChannel: `${rowIndex}`
|
|
5675
5773
|
}));
|
|
5676
5774
|
}
|
|
5677
|
-
var InfiniteTableRow =
|
|
5775
|
+
var InfiniteTableRow = React27.memo(InfiniteTableRowFn);
|
|
5678
5776
|
|
|
5679
5777
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableRowUnvirtualized.tsx
|
|
5680
|
-
var
|
|
5778
|
+
var React28 = __toModule(require("react"));
|
|
5681
5779
|
function TableRowUnvirtualizedFn(props) {
|
|
5682
5780
|
const {
|
|
5683
5781
|
rowHeight,
|
|
@@ -5698,7 +5796,7 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
5698
5796
|
}, domProps.style);
|
|
5699
5797
|
const children = columns.map((col) => {
|
|
5700
5798
|
const hidden = false;
|
|
5701
|
-
return /* @__PURE__ */
|
|
5799
|
+
return /* @__PURE__ */ React28.createElement(InfiniteTableColumnCell, {
|
|
5702
5800
|
key: col.id,
|
|
5703
5801
|
virtualized: false,
|
|
5704
5802
|
rowHeight,
|
|
@@ -5711,11 +5809,11 @@ function TableRowUnvirtualizedFn(props) {
|
|
|
5711
5809
|
column: col
|
|
5712
5810
|
});
|
|
5713
5811
|
});
|
|
5714
|
-
return /* @__PURE__ */
|
|
5812
|
+
return /* @__PURE__ */ React28.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
5715
5813
|
style
|
|
5716
5814
|
}), children);
|
|
5717
5815
|
}
|
|
5718
|
-
var TableRowUnvirtualized =
|
|
5816
|
+
var TableRowUnvirtualized = React28.memo(TableRowUnvirtualizedFn);
|
|
5719
5817
|
|
|
5720
5818
|
// src/components/InfiniteTable/hooks/useUnpinnedRendering.tsx
|
|
5721
5819
|
function useUnpinnedRendering(params) {
|
|
@@ -5737,7 +5835,7 @@ function useUnpinnedRendering(params) {
|
|
|
5737
5835
|
} = params;
|
|
5738
5836
|
const { virtualizeColumns } = getState();
|
|
5739
5837
|
const shouldVirtualizeColumns = typeof virtualizeColumns === "function" ? virtualizeColumns(computedUnpinnedColumns) : virtualizeColumns != null ? virtualizeColumns : true;
|
|
5740
|
-
const renderRowUnpinned = (0,
|
|
5838
|
+
const renderRowUnpinned = (0, import_react34.useCallback)((rowParams) => {
|
|
5741
5839
|
const dataArray = getData();
|
|
5742
5840
|
const rowInfo = dataArray[rowParams.rowIndex];
|
|
5743
5841
|
const { showZebraRows, showHoverRows } = getState();
|
|
@@ -5758,7 +5856,7 @@ function useUnpinnedRendering(params) {
|
|
|
5758
5856
|
rowProps.repaintId = repaintId;
|
|
5759
5857
|
}
|
|
5760
5858
|
const TableRowComponent = shouldVirtualizeColumns ? InfiniteTableRow : TableRowUnvirtualized;
|
|
5761
|
-
return /* @__PURE__ */
|
|
5859
|
+
return /* @__PURE__ */ React29.createElement(TableRowComponent, __spreadValues({}, rowProps));
|
|
5762
5860
|
}, [
|
|
5763
5861
|
repaintId,
|
|
5764
5862
|
rowHeight,
|
|
@@ -5768,7 +5866,7 @@ function useUnpinnedRendering(params) {
|
|
|
5768
5866
|
horizontalVirtualBrain,
|
|
5769
5867
|
verticalVirtualBrain
|
|
5770
5868
|
]);
|
|
5771
|
-
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */
|
|
5869
|
+
const fakeScrollbar = getScrollbarWidth() ? /* @__PURE__ */ React29.createElement("div", {
|
|
5772
5870
|
"data-name": "horizontal-scrollbar-placeholder--fake",
|
|
5773
5871
|
style: {
|
|
5774
5872
|
position: "absolute",
|
|
@@ -5779,10 +5877,10 @@ function useUnpinnedRendering(params) {
|
|
|
5779
5877
|
overflow: "auto",
|
|
5780
5878
|
visibility: columnShifts ? "visible" : "hidden"
|
|
5781
5879
|
}
|
|
5782
|
-
}, /* @__PURE__ */
|
|
5880
|
+
}, /* @__PURE__ */ React29.createElement("div", {
|
|
5783
5881
|
style: { height: "100%", width: computedUnpinnedColumnsWidth }
|
|
5784
5882
|
})) : null;
|
|
5785
|
-
return rowHeight != 0 ? /* @__PURE__ */
|
|
5883
|
+
return rowHeight != 0 ? /* @__PURE__ */ React29.createElement(VirtualRowList, {
|
|
5786
5884
|
repaintId: `${repaintId}-unpinned-`,
|
|
5787
5885
|
brain: verticalVirtualBrain,
|
|
5788
5886
|
onContainerScroll: applyScrollHorizontal,
|
|
@@ -5803,17 +5901,17 @@ function useUnpinnedRendering(params) {
|
|
|
5803
5901
|
}
|
|
5804
5902
|
|
|
5805
5903
|
// src/components/InfiniteTable/hooks/useOnContainerScroll.ts
|
|
5806
|
-
var
|
|
5904
|
+
var import_react35 = __toModule(require("react"));
|
|
5807
5905
|
|
|
5808
5906
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
5809
|
-
var
|
|
5907
|
+
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5810
5908
|
var FooterCls = "_16lm1iw1";
|
|
5811
5909
|
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwj _16lm1iwz _16lm1iw0";
|
|
5812
|
-
var InfiniteClsRecipe = (0,
|
|
5910
|
+
var InfiniteClsRecipe = (0, import_createRuntimeFn5.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: [] });
|
|
5813
5911
|
var InfiniteClsScrolling = "_1yeub2v1";
|
|
5814
5912
|
var InfiniteClsShiftingColumns = "_16lm1iwm";
|
|
5815
5913
|
var PinnedRowsClsVariants = { pinnedStart: "_1yeub2ve", pinnedEnd: "_1yeub2vf", overflow: "_1yeub2vg" };
|
|
5816
|
-
var PinnedRowsContainerClsVariants = (0,
|
|
5914
|
+
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vh", end: "_1yeub2vi", false: "_1yeub2vj" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5817
5915
|
|
|
5818
5916
|
// src/components/InfiniteTable/hooks/useOnContainerScroll.ts
|
|
5819
5917
|
var DELAY = 200;
|
|
@@ -5836,14 +5934,14 @@ var useOnContainerScroll = ({
|
|
|
5836
5934
|
}
|
|
5837
5935
|
} = useInfiniteTable();
|
|
5838
5936
|
const { componentActions: dataSourceActions, getState: getDataSourceState } = useDataSourceContextValue();
|
|
5839
|
-
const timeoutIdRef = (0,
|
|
5840
|
-
const scrollingRef = (0,
|
|
5841
|
-
const scrollTopMaxRef = (0,
|
|
5842
|
-
(0,
|
|
5937
|
+
const timeoutIdRef = (0, import_react35.useRef)(0);
|
|
5938
|
+
const scrollingRef = (0, import_react35.useRef)(false);
|
|
5939
|
+
const scrollTopMaxRef = (0, import_react35.useRef)(0);
|
|
5940
|
+
(0, import_react35.useEffect)(() => {
|
|
5843
5941
|
const { current: node } = scrollerDOMRef;
|
|
5844
5942
|
scrollTopMaxRef.current = node.scrollHeight - node.clientHeight;
|
|
5845
5943
|
}, [reservedContentHeight, bodySize.height]);
|
|
5846
|
-
const setScrolling = (0,
|
|
5944
|
+
const setScrolling = (0, import_react35.useCallback)((scrolling) => {
|
|
5847
5945
|
var _a;
|
|
5848
5946
|
const prevScrolling = scrollingRef.current;
|
|
5849
5947
|
scrollingRef.current = scrolling;
|
|
@@ -5868,7 +5966,7 @@ var useOnContainerScroll = ({
|
|
|
5868
5966
|
}
|
|
5869
5967
|
}
|
|
5870
5968
|
}, []);
|
|
5871
|
-
const onContainerScroll = (0,
|
|
5969
|
+
const onContainerScroll = (0, import_react35.useCallback)((scrollInfo) => {
|
|
5872
5970
|
verticalVirtualBrain.setScrollPosition(scrollInfo);
|
|
5873
5971
|
horizontalVirtualBrain.setScrollPosition(scrollInfo);
|
|
5874
5972
|
setScrolling(true);
|
|
@@ -5878,15 +5976,15 @@ var useOnContainerScroll = ({
|
|
|
5878
5976
|
domRef.current,
|
|
5879
5977
|
setScrolling
|
|
5880
5978
|
]);
|
|
5881
|
-
const scrollPositionRef = (0,
|
|
5979
|
+
const scrollPositionRef = (0, import_react35.useRef)({
|
|
5882
5980
|
scrollLeft: 0,
|
|
5883
5981
|
scrollTop: 0
|
|
5884
5982
|
});
|
|
5885
|
-
const applyScrollHorizontal = (0,
|
|
5983
|
+
const applyScrollHorizontal = (0, import_react35.useCallback)(({ scrollLeft }) => {
|
|
5886
5984
|
scrollPositionRef.current.scrollLeft = scrollLeft;
|
|
5887
5985
|
onContainerScroll(scrollPositionRef.current);
|
|
5888
5986
|
}, [onContainerScroll]);
|
|
5889
|
-
const applyScrollVertical = (0,
|
|
5987
|
+
const applyScrollVertical = (0, import_react35.useCallback)(({ scrollTop }) => {
|
|
5890
5988
|
scrollPositionRef.current.scrollTop = scrollTop;
|
|
5891
5989
|
onContainerScroll(scrollPositionRef.current);
|
|
5892
5990
|
if (scrollTop === 0) {
|
|
@@ -5908,17 +6006,17 @@ var useOnContainerScroll = ({
|
|
|
5908
6006
|
};
|
|
5909
6007
|
|
|
5910
6008
|
// src/components/InfiniteTable/hooks/usePinnedRendering.tsx
|
|
5911
|
-
var React32 = __toModule(require("react"));
|
|
5912
|
-
var import_react39 = __toModule(require("react"));
|
|
5913
|
-
|
|
5914
|
-
// src/components/VirtualList/RowListWithExternalScrolling.tsx
|
|
5915
6009
|
var React31 = __toModule(require("react"));
|
|
5916
6010
|
var import_react38 = __toModule(require("react"));
|
|
5917
6011
|
|
|
5918
|
-
// src/components/
|
|
6012
|
+
// src/components/VirtualList/RowListWithExternalScrolling.tsx
|
|
6013
|
+
var React30 = __toModule(require("react"));
|
|
5919
6014
|
var import_react37 = __toModule(require("react"));
|
|
6015
|
+
|
|
6016
|
+
// src/components/hooks/useOnMount.ts
|
|
6017
|
+
var import_react36 = __toModule(require("react"));
|
|
5920
6018
|
function useOnMount(domRef, props) {
|
|
5921
|
-
(0,
|
|
6019
|
+
(0, import_react36.useEffect)(() => {
|
|
5922
6020
|
const { onMount, onUnmount } = props;
|
|
5923
6021
|
const node = domRef == null ? void 0 : domRef.current;
|
|
5924
6022
|
onMount == null ? void 0 : onMount(node);
|
|
@@ -5949,8 +6047,8 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
5949
6047
|
onMount,
|
|
5950
6048
|
onUnmount
|
|
5951
6049
|
} = props;
|
|
5952
|
-
const domRef = (0,
|
|
5953
|
-
const renderItem = (0,
|
|
6050
|
+
const domRef = (0, import_react37.useRef)(null);
|
|
6051
|
+
const renderItem = (0, import_react37.useCallback)((renderProps) => renderRow({
|
|
5954
6052
|
domRef: renderProps.domRef,
|
|
5955
6053
|
rowHeight: renderProps.itemSize,
|
|
5956
6054
|
rowIndex: renderProps.itemIndex
|
|
@@ -5959,7 +6057,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
5959
6057
|
onMount,
|
|
5960
6058
|
onUnmount
|
|
5961
6059
|
});
|
|
5962
|
-
(0,
|
|
6060
|
+
(0, import_react37.useEffect)(() => {
|
|
5963
6061
|
const onScroll = (scrollPosition) => {
|
|
5964
6062
|
const node = domRef.current;
|
|
5965
6063
|
if (node) {
|
|
@@ -5988,7 +6086,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
5988
6086
|
if (true) {
|
|
5989
6087
|
domProps["data-cmp-name"] = "RowListWithExternalScrolling";
|
|
5990
6088
|
}
|
|
5991
|
-
return /* @__PURE__ */
|
|
6089
|
+
return /* @__PURE__ */ React30.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React30.createElement(RawList, {
|
|
5992
6090
|
brain,
|
|
5993
6091
|
renderItem,
|
|
5994
6092
|
repaintId
|
|
@@ -6011,7 +6109,7 @@ function PinnedRowsContainer(props) {
|
|
|
6011
6109
|
brain,
|
|
6012
6110
|
renderRow
|
|
6013
6111
|
} = props;
|
|
6014
|
-
const style =
|
|
6112
|
+
const style = React31.useMemo(() => {
|
|
6015
6113
|
const result = pinning === "end" ? {
|
|
6016
6114
|
width: rowWidth,
|
|
6017
6115
|
height,
|
|
@@ -6026,7 +6124,7 @@ function PinnedRowsContainer(props) {
|
|
|
6026
6124
|
}
|
|
6027
6125
|
return result;
|
|
6028
6126
|
}, [height, rowWidth, pinning, hasOverflow]);
|
|
6029
|
-
const updateScroll = (0,
|
|
6127
|
+
const updateScroll = (0, import_react38.useCallback)((node, scrollPosition) => {
|
|
6030
6128
|
UPDATE_SCROLL3(node, scrollPosition, hasOverflow ? pinnedScrollListener.getScrollPosition() : void 0);
|
|
6031
6129
|
}, [hasOverflow, pinnedScrollListener]);
|
|
6032
6130
|
const rowListProps = {
|
|
@@ -6037,7 +6135,7 @@ function PinnedRowsContainer(props) {
|
|
|
6037
6135
|
className: join(`${PinnedRowsContainerClassName}`, PinnedRowsClsVariants[pinning === "start" ? "pinnedStart" : "pinnedEnd"], `${PinnedRowsContainerClassName}--pinned-${pinning}`, `${PinnedRowsContainerClassName}--overflow`, PinnedRowsClsVariants.overflow)
|
|
6038
6136
|
};
|
|
6039
6137
|
if (hasOverflow) {
|
|
6040
|
-
return /* @__PURE__ */
|
|
6138
|
+
return /* @__PURE__ */ React31.createElement(VirtualScrollContainer, {
|
|
6041
6139
|
scrollable: {
|
|
6042
6140
|
horizontal: true,
|
|
6043
6141
|
vertical: false
|
|
@@ -6053,22 +6151,22 @@ function PinnedRowsContainer(props) {
|
|
|
6053
6151
|
className: join(PinnedRowsContainerClsVariants({
|
|
6054
6152
|
pinned: pinning
|
|
6055
6153
|
}), `${PinnedRowsContainerClassName}Container`, `${PinnedRowsContainerClassName}Container--pinned-${pinning}`)
|
|
6056
|
-
}, /* @__PURE__ */
|
|
6154
|
+
}, /* @__PURE__ */ React31.createElement(RowListWithExternalScrolling, __spreadProps(__spreadValues({}, rowListProps), {
|
|
6057
6155
|
onMount: (node) => {
|
|
6058
6156
|
pinnedScrollListener == null ? void 0 : pinnedScrollListener.onScroll((scrollPosition) => {
|
|
6059
6157
|
updateScroll(node, brain.getScrollPosition(), scrollPosition);
|
|
6060
6158
|
});
|
|
6061
6159
|
}
|
|
6062
|
-
})), /* @__PURE__ */
|
|
6160
|
+
})), /* @__PURE__ */ React31.createElement(SpacePlaceholder, {
|
|
6063
6161
|
width: rowWidth,
|
|
6064
6162
|
height: 1
|
|
6065
6163
|
}));
|
|
6066
6164
|
}
|
|
6067
|
-
return /* @__PURE__ */
|
|
6165
|
+
return /* @__PURE__ */ React31.createElement(RowListWithExternalScrolling, __spreadValues({}, rowListProps));
|
|
6068
6166
|
}
|
|
6069
6167
|
function useRenderPinnedRow(params) {
|
|
6070
6168
|
const { getData, getState, columnsWidth, columns, verticalBrain } = params;
|
|
6071
|
-
const renderPinnedRow = (0,
|
|
6169
|
+
const renderPinnedRow = (0, import_react38.useCallback)((rowParams) => {
|
|
6072
6170
|
const dataArray = getData();
|
|
6073
6171
|
const rowInfo = dataArray[rowParams.rowIndex];
|
|
6074
6172
|
const { showZebraRows, showHoverRows } = getState();
|
|
@@ -6084,7 +6182,7 @@ function useRenderPinnedRow(params) {
|
|
|
6084
6182
|
rowWidth: columnsWidth,
|
|
6085
6183
|
columns
|
|
6086
6184
|
}, rowParams);
|
|
6087
|
-
return /* @__PURE__ */
|
|
6185
|
+
return /* @__PURE__ */ React31.createElement(TableRowUnvirtualized, __spreadValues({}, rowProps));
|
|
6088
6186
|
}, [columnsWidth, columns, verticalBrain]);
|
|
6089
6187
|
return renderPinnedRow;
|
|
6090
6188
|
}
|
|
@@ -6127,7 +6225,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6127
6225
|
columns,
|
|
6128
6226
|
columnsWidth
|
|
6129
6227
|
});
|
|
6130
|
-
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */
|
|
6228
|
+
const pinnedList = columns.length && rowHeight !== 0 ? /* @__PURE__ */ React31.createElement(PinnedRowsContainer, {
|
|
6131
6229
|
pinning: side,
|
|
6132
6230
|
pinnedScrollListener,
|
|
6133
6231
|
hasOverflow,
|
|
@@ -6140,7 +6238,7 @@ function usePinnedRenderingForSide(side, params) {
|
|
|
6140
6238
|
brain: verticalVirtualBrain,
|
|
6141
6239
|
renderRow: renderRowPinned
|
|
6142
6240
|
}) : null;
|
|
6143
|
-
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */
|
|
6241
|
+
const pinnedScrollbarPlaceholder = pinnedList && hasHorizontalScrollbar && !hasOverflow ? /* @__PURE__ */ React31.createElement(HorizontalScrollbarPlaceholder, {
|
|
6144
6242
|
style: side === "end" ? {
|
|
6145
6243
|
width: columnsWidth,
|
|
6146
6244
|
right: hasVerticalScrollbar ? getScrollbarWidth() : 0
|
|
@@ -6182,7 +6280,7 @@ function usePinnedStartRendering(params) {
|
|
|
6182
6280
|
}
|
|
6183
6281
|
|
|
6184
6282
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
6185
|
-
var
|
|
6283
|
+
var import_react40 = __toModule(require("react"));
|
|
6186
6284
|
|
|
6187
6285
|
// src/components/VirtualBrain/index.ts
|
|
6188
6286
|
var import_binary_search2 = __toModule(require_binary_search());
|
|
@@ -6620,9 +6718,9 @@ var VirtualBrain = class extends Logger {
|
|
|
6620
6718
|
};
|
|
6621
6719
|
|
|
6622
6720
|
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
6623
|
-
var
|
|
6721
|
+
var import_react39 = __toModule(require("react"));
|
|
6624
6722
|
function useColumnSizeFn(computedUnpinnedColumns) {
|
|
6625
|
-
const columnSize = (0,
|
|
6723
|
+
const columnSize = (0, import_react39.useCallback)((index) => {
|
|
6626
6724
|
const column = computedUnpinnedColumns[index];
|
|
6627
6725
|
if (!column) {
|
|
6628
6726
|
console.log("cannot find column at index", index, computedUnpinnedColumns);
|
|
@@ -6661,7 +6759,7 @@ function useYourBrain(param) {
|
|
|
6661
6759
|
});
|
|
6662
6760
|
return brain;
|
|
6663
6761
|
});
|
|
6664
|
-
(0,
|
|
6762
|
+
(0, import_react40.useEffect)(() => {
|
|
6665
6763
|
return () => {
|
|
6666
6764
|
horizontalVirtualBrain.destroy();
|
|
6667
6765
|
verticalVirtualBrain.destroy();
|
|
@@ -6669,13 +6767,13 @@ function useYourBrain(param) {
|
|
|
6669
6767
|
}, []);
|
|
6670
6768
|
horizontalVirtualBrain.update(computedUnpinnedColumns.length, columnSize);
|
|
6671
6769
|
verticalVirtualBrain.update(dataArray.length, rowHeight, rowSpan);
|
|
6672
|
-
(0,
|
|
6770
|
+
(0, import_react40.useEffect)(() => {
|
|
6673
6771
|
verticalVirtualBrain.setAvailableSize({
|
|
6674
6772
|
height: bodySize.height,
|
|
6675
6773
|
width: 0
|
|
6676
6774
|
});
|
|
6677
6775
|
}, [bodySize, verticalVirtualBrain]);
|
|
6678
|
-
(0,
|
|
6776
|
+
(0, import_react40.useEffect)(() => {
|
|
6679
6777
|
horizontalVirtualBrain.setAvailableSize({
|
|
6680
6778
|
height: 0,
|
|
6681
6779
|
width: Math.max(bodySize.width - computedPinnedStartWidth - computedPinnedEndWidth, 0)
|
|
@@ -6713,12 +6811,12 @@ function useListRendering(param) {
|
|
|
6713
6811
|
pinnedEndScrollListener
|
|
6714
6812
|
} = componentState;
|
|
6715
6813
|
const prevDataSourceTimestamp = usePrevious(dataSourceState.updatedAt);
|
|
6716
|
-
const repaintIdRef = (0,
|
|
6814
|
+
const repaintIdRef = (0, import_react41.useRef)(0);
|
|
6717
6815
|
if (!shallowEqualObjects(prevComputed, computed) || prevDataSourceTimestamp !== dataSourceState.updatedAt) {
|
|
6718
6816
|
repaintIdRef.current++;
|
|
6719
6817
|
}
|
|
6720
6818
|
const repaintId = repaintIdRef.current;
|
|
6721
|
-
const rowSpan = (0,
|
|
6819
|
+
const rowSpan = (0, import_react41.useMemo)(() => {
|
|
6722
6820
|
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
6723
6821
|
return colsWithRowspan.length ? ({ itemIndex }) => {
|
|
6724
6822
|
let maxSpan = 1;
|
|
@@ -6756,11 +6854,11 @@ function useListRendering(param) {
|
|
|
6756
6854
|
const hasHorizontalScrollbar = computedUnpinnedColumnsWidth > bodySize.width - computedPinnedStartColumnsWidth - computedPinnedEndColumnsWidth;
|
|
6757
6855
|
const reservedContentHeight = verticalVirtualBrain.getTotalSize() + (hasHorizontalScrollbar ? getScrollbarWidth() : 0);
|
|
6758
6856
|
const hasVerticalScrollbar = bodySize.height > 0 && bodySize.height < reservedContentHeight;
|
|
6759
|
-
const scrollbars = (0,
|
|
6857
|
+
const scrollbars = (0, import_react41.useMemo)(() => ({
|
|
6760
6858
|
vertical: hasVerticalScrollbar,
|
|
6761
6859
|
horizontal: hasHorizontalScrollbar
|
|
6762
6860
|
}), [hasVerticalScrollbar, hasHorizontalScrollbar]);
|
|
6763
|
-
(0,
|
|
6861
|
+
(0, import_react41.useEffect)(() => {
|
|
6764
6862
|
if (!bodySize.height) {
|
|
6765
6863
|
return;
|
|
6766
6864
|
}
|
|
@@ -6773,7 +6871,6 @@ function useListRendering(param) {
|
|
|
6773
6871
|
setColumnVisibility: (columnVisibility) => {
|
|
6774
6872
|
componentActions.columnVisibility = columnVisibility;
|
|
6775
6873
|
},
|
|
6776
|
-
setColumnAggregations: (columnAggregations) => componentActions.columnAggregations = columnAggregations,
|
|
6777
6874
|
getState,
|
|
6778
6875
|
getDataSourceState
|
|
6779
6876
|
};
|
|
@@ -6786,7 +6883,7 @@ function useListRendering(param) {
|
|
|
6786
6883
|
reservedContentHeight
|
|
6787
6884
|
});
|
|
6788
6885
|
const { componentActions: dataSourceActions } = useDataSourceContextValue();
|
|
6789
|
-
const toggleGroupRow = (0,
|
|
6886
|
+
const toggleGroupRow = (0, import_react41.useCallback)((groupKeys) => {
|
|
6790
6887
|
const newState = new GroupRowsState(getDataSourceState().groupRowsState);
|
|
6791
6888
|
newState.toggleGroupRow(groupKeys);
|
|
6792
6889
|
dataSourceActions.groupRowsState = newState;
|
|
@@ -6821,7 +6918,7 @@ function useListRendering(param) {
|
|
|
6821
6918
|
computedUnpinnedColumns
|
|
6822
6919
|
});
|
|
6823
6920
|
const [, rerender] = useRerender();
|
|
6824
|
-
(0,
|
|
6921
|
+
(0, import_react41.useEffect)(() => {
|
|
6825
6922
|
rerender();
|
|
6826
6923
|
}, [dataSourceState]);
|
|
6827
6924
|
const { pinnedStartList, pinnedStartScrollbarPlaceholder } = usePinnedStartRendering(pinnedRenderingParams);
|
|
@@ -6844,8 +6941,8 @@ function useListRendering(param) {
|
|
|
6844
6941
|
}
|
|
6845
6942
|
|
|
6846
6943
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
6847
|
-
var
|
|
6848
|
-
var
|
|
6944
|
+
var React32 = __toModule(require("react"));
|
|
6945
|
+
var import_react42 = __toModule(require("react"));
|
|
6849
6946
|
|
|
6850
6947
|
// src/components/utils/decamelize.ts
|
|
6851
6948
|
function decamelize(str, options) {
|
|
@@ -6880,10 +6977,10 @@ var enforceStyle = (node, style) => {
|
|
|
6880
6977
|
node.style.setProperty(decamelize(propertyName), propertyValue, "important");
|
|
6881
6978
|
}
|
|
6882
6979
|
};
|
|
6883
|
-
var InfiniteTableLicenseFooter =
|
|
6980
|
+
var InfiniteTableLicenseFooter = React32.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
|
|
6884
6981
|
const { rootClassName: rootClassName12 } = useInternalProps();
|
|
6885
|
-
const domRef =
|
|
6886
|
-
const domCallback =
|
|
6982
|
+
const domRef = React32.useRef(null);
|
|
6983
|
+
const domCallback = React32.useCallback((node) => {
|
|
6887
6984
|
domRef.current = node;
|
|
6888
6985
|
if (!ref) {
|
|
6889
6986
|
return;
|
|
@@ -6894,7 +6991,7 @@ var InfiniteTableLicenseFooter = React33.forwardRef(function InfiniteTableLicens
|
|
|
6894
6991
|
ref.current = node;
|
|
6895
6992
|
}
|
|
6896
6993
|
}, []);
|
|
6897
|
-
(0,
|
|
6994
|
+
(0, import_react42.useEffect)(() => {
|
|
6898
6995
|
const forceStyle = () => {
|
|
6899
6996
|
requestAnimationFrame(() => {
|
|
6900
6997
|
var _a;
|
|
@@ -6908,12 +7005,12 @@ var InfiniteTableLicenseFooter = React33.forwardRef(function InfiniteTableLicens
|
|
|
6908
7005
|
clearInterval(intervalId);
|
|
6909
7006
|
};
|
|
6910
7007
|
}, []);
|
|
6911
|
-
return /* @__PURE__ */
|
|
7008
|
+
return /* @__PURE__ */ React32.createElement("div", __spreadProps(__spreadValues({
|
|
6912
7009
|
ref: domCallback
|
|
6913
7010
|
}, props), {
|
|
6914
7011
|
className: join(`${rootClassName12}-Footer`, FooterCls, props.className),
|
|
6915
7012
|
style: defaultStyle2
|
|
6916
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7013
|
+
}), "Powered by", " ", /* @__PURE__ */ React32.createElement("a", {
|
|
6917
7014
|
href: "https://infinite-table.com",
|
|
6918
7015
|
rel: "noopener noreferrer",
|
|
6919
7016
|
role: "link",
|
|
@@ -6922,7 +7019,7 @@ var InfiniteTableLicenseFooter = React33.forwardRef(function InfiniteTableLicens
|
|
|
6922
7019
|
});
|
|
6923
7020
|
|
|
6924
7021
|
// src/components/InfiniteTable/hooks/useLicense/useLicense.ts
|
|
6925
|
-
var
|
|
7022
|
+
var import_react43 = __toModule(require("react"));
|
|
6926
7023
|
|
|
6927
7024
|
// src/components/InfiniteTable/hooks/useLicense/crc32.ts
|
|
6928
7025
|
var DEFAULT_ReversedPolynomial = 3988292384;
|
|
@@ -7072,10 +7169,10 @@ var origin = typeof window !== "undefined" ? window.location.origin : "";
|
|
|
7072
7169
|
var [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
|
|
7073
7170
|
var isInsideSandbox = protocol === "https" && sandboxUrl === "sandpack.codesandbox.io";
|
|
7074
7171
|
var useLicense = (licenseKey = "") => {
|
|
7075
|
-
const valid = (0,
|
|
7172
|
+
const valid = (0, import_react43.useMemo)(() => {
|
|
7076
7173
|
let valid2 = isValidLicense(licenseKey, {
|
|
7077
7174
|
publishedAt: 1624970570587,
|
|
7078
|
-
version: "0.0
|
|
7175
|
+
version: "0.1.0"
|
|
7079
7176
|
});
|
|
7080
7177
|
if (!licenseKey && !valid2 && isInsideSandbox) {
|
|
7081
7178
|
return true;
|
|
@@ -7086,8 +7183,8 @@ var useLicense = (licenseKey = "") => {
|
|
|
7086
7183
|
};
|
|
7087
7184
|
|
|
7088
7185
|
// src/components/CSSVariableWatch.tsx
|
|
7089
|
-
var
|
|
7090
|
-
var
|
|
7186
|
+
var React33 = __toModule(require("react"));
|
|
7187
|
+
var import_react44 = __toModule(require("react"));
|
|
7091
7188
|
var error = err("CSSVariableWatch");
|
|
7092
7189
|
var debug5 = dbg("CSSVariableWatch");
|
|
7093
7190
|
var WRAPPER_STYLE = {
|
|
@@ -7100,15 +7197,15 @@ var WRAPPER_STYLE = {
|
|
|
7100
7197
|
overflow: "hidden"
|
|
7101
7198
|
};
|
|
7102
7199
|
var useCSSVariableWatch = (params) => {
|
|
7103
|
-
const lastValueRef = (0,
|
|
7104
|
-
const onResize =
|
|
7200
|
+
const lastValueRef = (0, import_react44.useRef)(0);
|
|
7201
|
+
const onResize = React33.useCallback(({ height }) => {
|
|
7105
7202
|
if (height && height !== lastValueRef.current) {
|
|
7106
7203
|
lastValueRef.current = height;
|
|
7107
7204
|
params.onChange(height);
|
|
7108
7205
|
}
|
|
7109
7206
|
}, [params.onChange]);
|
|
7110
7207
|
useResizeObserver(params.ref, onResize, { earlyAttach: true });
|
|
7111
|
-
|
|
7208
|
+
React33.useLayoutEffect(() => {
|
|
7112
7209
|
const value = params.ref.current.getBoundingClientRect().height;
|
|
7113
7210
|
if (value) {
|
|
7114
7211
|
lastValueRef.current = value;
|
|
@@ -7120,15 +7217,15 @@ var useCSSVariableWatch = (params) => {
|
|
|
7120
7217
|
}, []);
|
|
7121
7218
|
};
|
|
7122
7219
|
var CSSVariableWatch = (props) => {
|
|
7123
|
-
const domRef = (0,
|
|
7220
|
+
const domRef = (0, import_react44.useRef)(null);
|
|
7124
7221
|
useCSSVariableWatch(__spreadProps(__spreadValues({}, props), {
|
|
7125
7222
|
ref: domRef
|
|
7126
7223
|
}));
|
|
7127
|
-
return /* @__PURE__ */
|
|
7224
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
7128
7225
|
"data-name": "css-variable-watcher",
|
|
7129
7226
|
"data-var": props.varName,
|
|
7130
7227
|
style: WRAPPER_STYLE
|
|
7131
|
-
}, /* @__PURE__ */
|
|
7228
|
+
}, /* @__PURE__ */ React33.createElement("div", {
|
|
7132
7229
|
ref: domRef,
|
|
7133
7230
|
style: {
|
|
7134
7231
|
height: props.varName.startsWith("var(") ? props.varName : `var(${props.varName})`
|
|
@@ -7221,7 +7318,7 @@ function useDOMProps(initialDOMProps) {
|
|
|
7221
7318
|
}
|
|
7222
7319
|
|
|
7223
7320
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
7224
|
-
var
|
|
7321
|
+
var React34 = __toModule(require("react"));
|
|
7225
7322
|
|
|
7226
7323
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
7227
7324
|
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv" };
|
|
@@ -7233,15 +7330,15 @@ var { rootClassName: rootClassName11 } = internalProps;
|
|
|
7233
7330
|
var baseCls2 = `${rootClassName11}-LoadMask`;
|
|
7234
7331
|
function LoadMaskFn(props) {
|
|
7235
7332
|
const { visible, children = "Loading" } = props;
|
|
7236
|
-
return /* @__PURE__ */
|
|
7333
|
+
return /* @__PURE__ */ React34.createElement("div", {
|
|
7237
7334
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls2}`
|
|
7238
|
-
}, /* @__PURE__ */
|
|
7335
|
+
}, /* @__PURE__ */ React34.createElement("div", {
|
|
7239
7336
|
className: `${LoadMaskOverlayCls} ${baseCls2}-Overlay`
|
|
7240
|
-
}), /* @__PURE__ */
|
|
7337
|
+
}), /* @__PURE__ */ React34.createElement("div", {
|
|
7241
7338
|
className: `${LoadMaskTextCls} ${baseCls2}-Text`
|
|
7242
7339
|
}, children));
|
|
7243
7340
|
}
|
|
7244
|
-
var LoadMask =
|
|
7341
|
+
var LoadMask = React34.memo(LoadMaskFn);
|
|
7245
7342
|
|
|
7246
7343
|
// src/components/InfiniteTable/index.tsx
|
|
7247
7344
|
var InfiniteTableClassName = internalProps.rootClassName;
|
|
@@ -7260,7 +7357,7 @@ var InfiniteTableRoot = getComponentStateRoot({
|
|
|
7260
7357
|
getParentState: () => useDataSource(),
|
|
7261
7358
|
debugName: "InfiniteTable"
|
|
7262
7359
|
});
|
|
7263
|
-
var InfiniteTableComponent =
|
|
7360
|
+
var InfiniteTableComponent = React35.memo(function InfiniteTableComponent2() {
|
|
7264
7361
|
var _a;
|
|
7265
7362
|
const {
|
|
7266
7363
|
componentState,
|
|
@@ -7307,7 +7404,7 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
7307
7404
|
const licenseValid = useLicense(licenseKey);
|
|
7308
7405
|
const domProps = useDOMProps(componentState.domProps);
|
|
7309
7406
|
const LoadMaskCmp = (_a = components == null ? void 0 : components.LoadMask) != null ? _a : LoadMask;
|
|
7310
|
-
|
|
7407
|
+
React35.useLayoutEffect(() => {
|
|
7311
7408
|
const dataSourceState = getDataSourceState();
|
|
7312
7409
|
const { onScrollbarsChange } = getInfiniteTableState();
|
|
7313
7410
|
const { notifyScrollbarsChange } = dataSourceState;
|
|
@@ -7316,31 +7413,31 @@ var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
|
7316
7413
|
}
|
|
7317
7414
|
notifyScrollbarsChange(scrollbars);
|
|
7318
7415
|
}, [scrollbars]);
|
|
7319
|
-
return /* @__PURE__ */
|
|
7416
|
+
return /* @__PURE__ */ React35.createElement("div", __spreadValues({
|
|
7320
7417
|
ref: domRef
|
|
7321
|
-
}, domProps), header ? /* @__PURE__ */
|
|
7418
|
+
}, domProps), header ? /* @__PURE__ */ React35.createElement(TableHeaderWrapper, {
|
|
7322
7419
|
brain: horizontalVirtualBrain,
|
|
7323
7420
|
repaintId,
|
|
7324
7421
|
scrollbars
|
|
7325
|
-
}) : null, /* @__PURE__ */
|
|
7422
|
+
}) : null, /* @__PURE__ */ React35.createElement(InfiniteTableBody, null, /* @__PURE__ */ React35.createElement(VirtualScrollContainer, {
|
|
7326
7423
|
ref: scrollerDOMRef,
|
|
7327
7424
|
onContainerScroll: applyScrollVertical,
|
|
7328
7425
|
scrollable: ONLY_VERTICAL_SCROLLBAR
|
|
7329
|
-
}, /* @__PURE__ */
|
|
7426
|
+
}, /* @__PURE__ */ React35.createElement("div", {
|
|
7330
7427
|
className: display.flex
|
|
7331
|
-
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */
|
|
7428
|
+
}, pinnedStartList, centerList, pinnedEndList), /* @__PURE__ */ React35.createElement(SpacePlaceholder, {
|
|
7332
7429
|
count: dataArray.length,
|
|
7333
7430
|
width: 0,
|
|
7334
7431
|
height: reservedContentHeight
|
|
7335
|
-
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */
|
|
7432
|
+
})), pinnedStartScrollbarPlaceholder, pinnedEndScrollbarPlaceholder, /* @__PURE__ */ React35.createElement(LoadMaskCmp, {
|
|
7336
7433
|
visible: loading
|
|
7337
|
-
}, loadingText)), licenseValid ? null : /* @__PURE__ */
|
|
7434
|
+
}, loadingText)), licenseValid ? null : /* @__PURE__ */ React35.createElement(InfiniteTableLicenseFooter, null), /* @__PURE__ */ React35.createElement("div", {
|
|
7338
7435
|
ref: portalDOMRef,
|
|
7339
7436
|
className: join(`${rootClassName}Portal`, zIndex[1e3], position.absolute, top[0], left[0])
|
|
7340
|
-
}), rowHeightCSSVar ? /* @__PURE__ */
|
|
7437
|
+
}), rowHeightCSSVar ? /* @__PURE__ */ React35.createElement(CSSVariableWatch, {
|
|
7341
7438
|
varName: rowHeightCSSVar,
|
|
7342
7439
|
onChange: onRowHeightCSSVarChange
|
|
7343
|
-
}) : null, headerHeightCSSVar ? /* @__PURE__ */
|
|
7440
|
+
}) : null, headerHeightCSSVar ? /* @__PURE__ */ React35.createElement(CSSVariableWatch, {
|
|
7344
7441
|
varName: headerHeightCSSVar,
|
|
7345
7442
|
onChange: onHeaderHeightCSSVarChange
|
|
7346
7443
|
}) : null);
|
|
@@ -7376,25 +7473,25 @@ function InfiniteTableContextProvider() {
|
|
|
7376
7473
|
}
|
|
7377
7474
|
componentActions.bodySize = bodySize;
|
|
7378
7475
|
}, { earlyAttach: true });
|
|
7379
|
-
|
|
7476
|
+
React35.useEffect(() => {
|
|
7380
7477
|
return () => {
|
|
7381
7478
|
componentState.onRowHeightCSSVarChange.destroy();
|
|
7382
7479
|
componentState.onHeaderHeightCSSVarChange.destroy();
|
|
7383
7480
|
};
|
|
7384
7481
|
}, []);
|
|
7385
|
-
|
|
7482
|
+
React35.useEffect(() => {
|
|
7386
7483
|
if (scrollerDOMRef.current) {
|
|
7387
7484
|
scrollerDOMRef.current.scrollTop = 0;
|
|
7388
7485
|
}
|
|
7389
7486
|
}, [scrollTopId, scrollerDOMRef]);
|
|
7390
7487
|
const TableContext2 = getInfiniteTableContext();
|
|
7391
|
-
return /* @__PURE__ */
|
|
7488
|
+
return /* @__PURE__ */ React35.createElement(TableContext2.Provider, {
|
|
7392
7489
|
value: contextValue
|
|
7393
|
-
}, /* @__PURE__ */
|
|
7490
|
+
}, /* @__PURE__ */ React35.createElement(InfiniteTableComponent, null));
|
|
7394
7491
|
}
|
|
7395
7492
|
function InfiniteTable(props) {
|
|
7396
|
-
const table = /* @__PURE__ */
|
|
7397
|
-
return /* @__PURE__ */
|
|
7493
|
+
const table = /* @__PURE__ */ React35.createElement(InfiniteTableRoot, __spreadValues({}, props), /* @__PURE__ */ React35.createElement(InfiniteTableContextProvider, null));
|
|
7494
|
+
return /* @__PURE__ */ React35.createElement(React35.StrictMode, null, table);
|
|
7398
7495
|
}
|
|
7399
7496
|
InfiniteTable.defaultProps = {
|
|
7400
7497
|
rowHeight: 40,
|