@infinite-table/infinite-react 0.0.2-canary.5 → 0.0.4
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 +43 -37
- package/index.d.ts +83 -32
- package/index.esm.css +43 -37
- package/index.esm.js +131 -129
- package/index.js +131 -129
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -674,7 +674,7 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
674
674
|
while (parentGroupId) {
|
|
675
675
|
const parent = columnGroups.get(parentGroupId);
|
|
676
676
|
if (!parent) {
|
|
677
|
-
if (
|
|
677
|
+
if (true) {
|
|
678
678
|
console.warn(`Cannot find column group ${parentGroupId}`);
|
|
679
679
|
}
|
|
680
680
|
break;
|
|
@@ -1083,7 +1083,7 @@ var Logger = class {
|
|
|
1083
1083
|
constructor(channelName) {
|
|
1084
1084
|
this.debug = emptyLogFn;
|
|
1085
1085
|
this.error = emptyLogFn;
|
|
1086
|
-
if (
|
|
1086
|
+
if (true) {
|
|
1087
1087
|
this.debug = dbg(channelName);
|
|
1088
1088
|
this.error = err(channelName);
|
|
1089
1089
|
}
|
|
@@ -1670,16 +1670,16 @@ function getComponentStateRoot(config) {
|
|
|
1670
1670
|
return [__spreadProps(__spreadValues({}, initialArg), { props: props2 })];
|
|
1671
1671
|
}
|
|
1672
1672
|
});
|
|
1673
|
-
propsToStateSetRef.current = new Set([
|
|
1674
|
-
...propsToStateSetRef.current,
|
|
1675
|
-
...propertyReads
|
|
1676
|
-
]);
|
|
1677
1673
|
const stateFromProps = mapPropsToState3({
|
|
1678
1674
|
props,
|
|
1679
1675
|
state: state2,
|
|
1680
1676
|
oldState: null,
|
|
1681
1677
|
parentState
|
|
1682
1678
|
});
|
|
1679
|
+
propsToStateSetRef.current = new Set([
|
|
1680
|
+
...propsToStateSetRef.current,
|
|
1681
|
+
...propertyReads
|
|
1682
|
+
]);
|
|
1683
1683
|
return __spreadValues(__spreadValues({}, state2), stateFromProps);
|
|
1684
1684
|
}
|
|
1685
1685
|
return state2;
|
|
@@ -1701,16 +1701,16 @@ function getComponentStateRoot(config) {
|
|
|
1701
1701
|
return [__spreadProps(__spreadValues({}, initialArg), { props: props2 })];
|
|
1702
1702
|
}
|
|
1703
1703
|
});
|
|
1704
|
-
propsToStateSetRef.current = new Set([
|
|
1705
|
-
...propsToStateSetRef.current,
|
|
1706
|
-
...propertyReads
|
|
1707
|
-
]);
|
|
1708
1704
|
const stateFromProps = mapPropsToState3({
|
|
1709
1705
|
props: getProps(),
|
|
1710
1706
|
state: newState,
|
|
1711
1707
|
oldState: previousState,
|
|
1712
1708
|
parentState: parentState2
|
|
1713
1709
|
});
|
|
1710
|
+
propsToStateSetRef.current = new Set([
|
|
1711
|
+
...propsToStateSetRef.current,
|
|
1712
|
+
...propertyReads
|
|
1713
|
+
]);
|
|
1714
1714
|
Object.assign(newState, stateFromProps);
|
|
1715
1715
|
}
|
|
1716
1716
|
const result = config.concludeReducer ? config.concludeReducer({
|
|
@@ -1905,31 +1905,28 @@ var React6 = __toModule(require("react"));
|
|
|
1905
1905
|
var import_react14 = __toModule(require("react"));
|
|
1906
1906
|
|
|
1907
1907
|
// src/components/InfiniteTable/utilities.css.ts
|
|
1908
|
-
var alignItems = { center: "
|
|
1909
|
-
var cssEllipsisClassName = "
|
|
1910
|
-
var cursor = { pointer: "
|
|
1911
|
-
var display = { flex: "
|
|
1908
|
+
var alignItems = { center: "_16lm1iw11", stretch: "_16lm1iw12" };
|
|
1909
|
+
var cssEllipsisClassName = "_16lm1iw1a _16lm1iw1b _16lm1iw16";
|
|
1910
|
+
var cursor = { pointer: "_16lm1iwb" };
|
|
1911
|
+
var display = { flex: "_16lm1iwj", block: "_16lm1iwk", inlineBlock: "_16lm1iwl" };
|
|
1912
1912
|
var fill = { currentColor: "_16lm1iw5", accentColor: "_16lm1iw6" };
|
|
1913
|
-
var flex = { "1": "
|
|
1914
|
-
var flexFlow = { column: "
|
|
1915
|
-
var justifyContent = { center: "
|
|
1916
|
-
var left = { "0": "
|
|
1913
|
+
var flex = { "1": "_16lm1iwc", none: "_16lm1iwd" };
|
|
1914
|
+
var flexFlow = { column: "_16lm1iwz", row: "_16lm1iw10" };
|
|
1915
|
+
var justifyContent = { center: "_16lm1iw13", start: "_16lm1iw14", end: "_16lm1iw15" };
|
|
1916
|
+
var left = { "0": "_16lm1iwt", "100%": "_16lm1iwu" };
|
|
1917
1917
|
var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
|
|
1918
|
-
var top = { "0": "
|
|
1918
|
+
var top = { "0": "_16lm1iwr", "100%": "_16lm1iws" };
|
|
1919
|
+
var transform = { translateZero: "_16lm1iw9", rotate90: "_16lm1iwa" };
|
|
1919
1920
|
var transformTranslateZero = "_16lm1iw8";
|
|
1920
|
-
var userSelect = { none: "
|
|
1921
|
-
var willChange = { transform: "
|
|
1922
|
-
var zIndex = { "1": "
|
|
1921
|
+
var userSelect = { none: "_16lm1iwm" };
|
|
1922
|
+
var willChange = { transform: "_16lm1iw19" };
|
|
1923
|
+
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
1923
1924
|
|
|
1924
1925
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
1925
1926
|
function ExpanderIcon(props) {
|
|
1926
1927
|
var _a;
|
|
1927
1928
|
const { size = 24 } = props;
|
|
1928
|
-
const style = __spreadValues({}, props.style);
|
|
1929
1929
|
const [expanded, setExpanded] = (0, import_react14.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
1930
|
-
if (expanded) {
|
|
1931
|
-
style.transform = `rotate(90deg)`;
|
|
1932
|
-
}
|
|
1933
1930
|
const onClick = () => {
|
|
1934
1931
|
var _a2;
|
|
1935
1932
|
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
@@ -1948,14 +1945,53 @@ function ExpanderIcon(props) {
|
|
|
1948
1945
|
height: `${size}px`,
|
|
1949
1946
|
viewBox: "0 0 24 24",
|
|
1950
1947
|
width: `${size}px`,
|
|
1951
|
-
style,
|
|
1948
|
+
style: props.style,
|
|
1952
1949
|
onClick,
|
|
1953
|
-
className: join(props.className, fill.
|
|
1950
|
+
className: join(props.className, fill.accentColor, flex.none, cursor.pointer, expanded ? fill.accentColor : "", expanded ? transform.rotate90 : "", "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`)
|
|
1954
1951
|
}, /* @__PURE__ */ React6.createElement("path", {
|
|
1955
1952
|
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
1956
1953
|
}));
|
|
1957
1954
|
}
|
|
1958
1955
|
|
|
1956
|
+
// node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
|
|
1957
|
+
var shouldApplyCompound = (compoundCheck, selections) => {
|
|
1958
|
+
for (const key of Object.keys(compoundCheck)) {
|
|
1959
|
+
if (compoundCheck[key] !== selections[key]) {
|
|
1960
|
+
return false;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
return true;
|
|
1964
|
+
};
|
|
1965
|
+
var createRuntimeFn = (config) => (options) => {
|
|
1966
|
+
let className = config.defaultClassName;
|
|
1967
|
+
const selections = {
|
|
1968
|
+
...config.defaultVariants,
|
|
1969
|
+
...options
|
|
1970
|
+
};
|
|
1971
|
+
for (const variantName in selections) {
|
|
1972
|
+
var _selections$variantNa;
|
|
1973
|
+
const variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
1974
|
+
if (variantSelection != null) {
|
|
1975
|
+
let selection = variantSelection;
|
|
1976
|
+
if (typeof selection === "boolean") {
|
|
1977
|
+
selection = selection === true ? "true" : "false";
|
|
1978
|
+
}
|
|
1979
|
+
className += " " + config.variantClassNames[variantName][selection];
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
for (const [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
1983
|
+
if (shouldApplyCompound(compoundCheck, selections)) {
|
|
1984
|
+
className += " " + compoundClassName;
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
return className;
|
|
1988
|
+
};
|
|
1989
|
+
|
|
1990
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
1991
|
+
var GroupRowExpanderCls = "_7pupv0b";
|
|
1992
|
+
var RowClsRecipe = 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: [] });
|
|
1993
|
+
var RowHoverCls = "_7pupv01";
|
|
1994
|
+
|
|
1959
1995
|
// src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
|
|
1960
1996
|
function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params) {
|
|
1961
1997
|
if (!pivotColumns) {
|
|
@@ -2007,10 +2043,7 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
|
|
|
2007
2043
|
}
|
|
2008
2044
|
const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < groupRowsBy2.length;
|
|
2009
2045
|
return /* @__PURE__ */ React7.createElement("div", {
|
|
2010
|
-
className: join(display.flex, alignItems.center)
|
|
2011
|
-
style: {
|
|
2012
|
-
paddingInlineStart: `calc(${rowInfo.groupNesting - 1} * var(--ITableRow-group-column-nesting))`
|
|
2013
|
-
}
|
|
2046
|
+
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2014
2047
|
}, showExpanderIcon ? /* @__PURE__ */ React7.createElement(ExpanderIcon, {
|
|
2015
2048
|
expanded: !rowInfo.collapsed,
|
|
2016
2049
|
onChange: () => {
|
|
@@ -2033,49 +2066,8 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
|
|
|
2033
2066
|
|
|
2034
2067
|
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2035
2068
|
var React8 = __toModule(require("react"));
|
|
2036
|
-
|
|
2037
|
-
// node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
|
|
2038
|
-
var shouldApplyCompound = (compoundCheck, selections) => {
|
|
2039
|
-
for (const key of Object.keys(compoundCheck)) {
|
|
2040
|
-
if (compoundCheck[key] !== selections[key]) {
|
|
2041
|
-
return false;
|
|
2042
|
-
}
|
|
2043
|
-
}
|
|
2044
|
-
return true;
|
|
2045
|
-
};
|
|
2046
|
-
var createRuntimeFn = (config) => (options) => {
|
|
2047
|
-
let className = config.defaultClassName;
|
|
2048
|
-
const selections = {
|
|
2049
|
-
...config.defaultVariants,
|
|
2050
|
-
...options
|
|
2051
|
-
};
|
|
2052
|
-
for (const variantName in selections) {
|
|
2053
|
-
var _selections$variantNa;
|
|
2054
|
-
const variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
2055
|
-
if (variantSelection != null) {
|
|
2056
|
-
let selection = variantSelection;
|
|
2057
|
-
if (typeof selection === "boolean") {
|
|
2058
|
-
selection = selection === true ? "true" : "false";
|
|
2059
|
-
}
|
|
2060
|
-
className += " " + config.variantClassNames[variantName][selection];
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
|
-
for (const [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
2064
|
-
if (shouldApplyCompound(compoundCheck, selections)) {
|
|
2065
|
-
className += " " + compoundClassName;
|
|
2066
|
-
}
|
|
2067
|
-
}
|
|
2068
|
-
return className;
|
|
2069
|
-
};
|
|
2070
|
-
|
|
2071
|
-
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
2072
|
-
var GroupRowExpanderCls = "_7pupv0b";
|
|
2073
|
-
var RowClsRecipe = 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: [] });
|
|
2074
|
-
var RowHoverCls = "_7pupv01";
|
|
2075
|
-
|
|
2076
|
-
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2077
2069
|
function getGroupColumnRender({
|
|
2078
|
-
|
|
2070
|
+
groupIndexForColumn,
|
|
2079
2071
|
groupRenderStrategy,
|
|
2080
2072
|
toggleGroupRow
|
|
2081
2073
|
}) {
|
|
@@ -2085,7 +2077,7 @@ function getGroupColumnRender({
|
|
|
2085
2077
|
if (column.renderValue) {
|
|
2086
2078
|
value = column.renderValue(renderOptions);
|
|
2087
2079
|
}
|
|
2088
|
-
let groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : ((_a = rowInfo.parents) == null ? void 0 : _a[
|
|
2080
|
+
let groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
|
|
2089
2081
|
if (!groupRowInfo) {
|
|
2090
2082
|
return null;
|
|
2091
2083
|
}
|
|
@@ -2095,14 +2087,14 @@ function getGroupColumnRender({
|
|
|
2095
2087
|
if (groupRowInfo.groupCount === 1) {
|
|
2096
2088
|
return value;
|
|
2097
2089
|
}
|
|
2098
|
-
if (groupRowInfo.groupNesting ===
|
|
2090
|
+
if (groupRowInfo.groupNesting === groupIndexForColumn && collapsed) {
|
|
2099
2091
|
return null;
|
|
2100
2092
|
}
|
|
2101
2093
|
} else {
|
|
2102
2094
|
if (!groupRowInfo.isGroupRow) {
|
|
2103
2095
|
return null;
|
|
2104
2096
|
}
|
|
2105
|
-
if (
|
|
2097
|
+
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting) {
|
|
2106
2098
|
return null;
|
|
2107
2099
|
}
|
|
2108
2100
|
}
|
|
@@ -2119,17 +2111,21 @@ function getGroupColumnRender({
|
|
|
2119
2111
|
};
|
|
2120
2112
|
}
|
|
2121
2113
|
function getColumnForGroupBy(options, toggleGroupRow, groupColumnFromProps) {
|
|
2122
|
-
const {
|
|
2114
|
+
const {
|
|
2115
|
+
groupByForColumn,
|
|
2116
|
+
groupIndexForColumn,
|
|
2117
|
+
groupRenderStrategy
|
|
2118
|
+
} = options;
|
|
2123
2119
|
let generatedGroupColumn = __spreadValues({
|
|
2124
|
-
header: `Group by ${
|
|
2125
|
-
groupByField:
|
|
2120
|
+
header: `Group by ${groupByForColumn.field}`,
|
|
2121
|
+
groupByField: groupByForColumn.field,
|
|
2126
2122
|
sortable: false,
|
|
2127
2123
|
render: getGroupColumnRender({
|
|
2128
|
-
|
|
2124
|
+
groupIndexForColumn,
|
|
2129
2125
|
toggleGroupRow,
|
|
2130
2126
|
groupRenderStrategy
|
|
2131
2127
|
})
|
|
2132
|
-
},
|
|
2128
|
+
}, groupByForColumn.column);
|
|
2133
2129
|
if (groupColumnFromProps) {
|
|
2134
2130
|
if (typeof groupColumnFromProps === "function") {
|
|
2135
2131
|
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps(options, toggleGroupRow));
|
|
@@ -3174,7 +3170,7 @@ function DataSourceCmp({ children }) {
|
|
|
3174
3170
|
componentActions,
|
|
3175
3171
|
getState
|
|
3176
3172
|
};
|
|
3177
|
-
if (
|
|
3173
|
+
if (true) {
|
|
3178
3174
|
globalThis.getDataSourceState = getState;
|
|
3179
3175
|
}
|
|
3180
3176
|
useLoadData();
|
|
@@ -3278,7 +3274,7 @@ function useColumnsWhenInlineGroupRenderStrategy(groupRowsMap) {
|
|
|
3278
3274
|
return rowspan;
|
|
3279
3275
|
},
|
|
3280
3276
|
render: getGroupColumnRender({
|
|
3281
|
-
groupIndex,
|
|
3277
|
+
groupIndexForColumn: groupIndex,
|
|
3282
3278
|
groupRenderStrategy: groupRenderStrategy2,
|
|
3283
3279
|
toggleGroupRow: toggleGroupRow2
|
|
3284
3280
|
})
|
|
@@ -3341,7 +3337,7 @@ function useColumnsWhenGrouping() {
|
|
|
3341
3337
|
return;
|
|
3342
3338
|
}
|
|
3343
3339
|
const update = () => {
|
|
3344
|
-
|
|
3340
|
+
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
3345
3341
|
columns,
|
|
3346
3342
|
groupColumn,
|
|
3347
3343
|
groupRenderStrategy,
|
|
@@ -3349,6 +3345,7 @@ function useColumnsWhenGrouping() {
|
|
|
3349
3345
|
pivotColumns,
|
|
3350
3346
|
toggleGroupRow
|
|
3351
3347
|
});
|
|
3348
|
+
componentActions.columnsWhenGrouping = columnsWhenGrouping;
|
|
3352
3349
|
};
|
|
3353
3350
|
update();
|
|
3354
3351
|
return interceptMap(columns, {
|
|
@@ -3436,11 +3433,11 @@ function getColumnsWhenGrouping(params) {
|
|
|
3436
3433
|
}
|
|
3437
3434
|
const computedColumns = new Map();
|
|
3438
3435
|
if (groupRenderStrategy === "multi-column") {
|
|
3439
|
-
groupRowsBy.forEach((
|
|
3440
|
-
computedColumns.set(`group-by-${
|
|
3441
|
-
|
|
3436
|
+
groupRowsBy.forEach((groupByForColumn, groupIndexForColumn, arr) => {
|
|
3437
|
+
computedColumns.set(`group-by-${groupByForColumn.field}`, getColumnForGroupBy({
|
|
3438
|
+
groupByForColumn,
|
|
3442
3439
|
groupRowsBy,
|
|
3443
|
-
|
|
3440
|
+
groupIndexForColumn,
|
|
3444
3441
|
groupCount: arr.length,
|
|
3445
3442
|
groupRenderStrategy
|
|
3446
3443
|
}, toggleGroupRow, groupColumn));
|
|
@@ -3448,7 +3445,8 @@ function getColumnsWhenGrouping(params) {
|
|
|
3448
3445
|
} else if (groupRenderStrategy === "single-column") {
|
|
3449
3446
|
computedColumns.set("group-by", getSingleGroupColumn({
|
|
3450
3447
|
groupCount: groupRowsBy.length,
|
|
3451
|
-
groupRowsBy
|
|
3448
|
+
groupRowsBy,
|
|
3449
|
+
groupRenderStrategy
|
|
3452
3450
|
}, toggleGroupRow, groupColumn));
|
|
3453
3451
|
}
|
|
3454
3452
|
columns.forEach((col, colId) => {
|
|
@@ -3652,15 +3650,15 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
3652
3650
|
var VerticalScrollbarPlaceholder = React11.memo(VerticalScrollbarPlaceholderFn);
|
|
3653
3651
|
|
|
3654
3652
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
3655
|
-
var CellCls = "_1eexc2a5
|
|
3653
|
+
var CellCls = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
|
|
3656
3654
|
var HeaderCellProxy = "_12zfob10";
|
|
3657
3655
|
var HeaderCellRecipe = 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"]] });
|
|
3658
|
-
var HeaderClsRecipe = createRuntimeFn({ defaultClassName: "_12zfob12
|
|
3659
|
-
var HeaderGroupCls = "
|
|
3660
|
-
var HeaderGroup_Children = "
|
|
3661
|
-
var HeaderGroup_Header = "_12zfob1x
|
|
3656
|
+
var HeaderClsRecipe = 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"]] });
|
|
3657
|
+
var HeaderGroupCls = "_16lm1iwz _16lm1iwj";
|
|
3658
|
+
var HeaderGroup_Children = "_16lm1iwj _16lm1iw10 _16lm1iw12 _16lm1iwc";
|
|
3659
|
+
var HeaderGroup_Header = "_12zfob1x _16lm1iwj _16lm1iw10 _16lm1iw11";
|
|
3662
3660
|
var HeaderSortIconCls = "_12zfob11 _16lm1iw1";
|
|
3663
|
-
var HeaderWrapperCls = "_12zfob1v
|
|
3661
|
+
var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
|
|
3664
3662
|
|
|
3665
3663
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
3666
3664
|
var React18 = __toModule(require("react"));
|
|
@@ -3682,9 +3680,9 @@ var useInfiniteTableState = () => {
|
|
|
3682
3680
|
};
|
|
3683
3681
|
|
|
3684
3682
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
3685
|
-
var CellCls2 = "_1eexc2a5
|
|
3683
|
+
var CellCls2 = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
|
|
3686
3684
|
var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
|
|
3687
|
-
var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "_16lm1iw2
|
|
3685
|
+
var ColumnCellRecipe = 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"]] });
|
|
3688
3686
|
var columnAlignCellStyle = { center: "_1eexc2a0", start: "_1eexc2a1", end: "_1eexc2a2" };
|
|
3689
3687
|
|
|
3690
3688
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
@@ -4199,7 +4197,7 @@ var MappedItems = class extends Logger {
|
|
|
4199
4197
|
this.init();
|
|
4200
4198
|
}
|
|
4201
4199
|
renderItemAtElement(itemIndex, elementIndex, renderNode) {
|
|
4202
|
-
if (
|
|
4200
|
+
if (true) {
|
|
4203
4201
|
this.debug(`Render item ${itemIndex} at element ${elementIndex}`);
|
|
4204
4202
|
}
|
|
4205
4203
|
const currentItemIndex = this.elementIndexToItemIndex[elementIndex];
|
|
@@ -4254,7 +4252,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4254
4252
|
}
|
|
4255
4253
|
const { mappedItems } = this;
|
|
4256
4254
|
const { renderStartIndex, renderEndIndex } = range;
|
|
4257
|
-
if (
|
|
4255
|
+
if (true) {
|
|
4258
4256
|
this.debug(`Render range ${renderStartIndex}-${renderEndIndex}. Force ${force}`);
|
|
4259
4257
|
}
|
|
4260
4258
|
const renderCount = renderEndIndex === -1 ? 0 : renderEndIndex - renderStartIndex + 1;
|
|
@@ -4267,7 +4265,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4267
4265
|
delete this.updaters[elementIndex];
|
|
4268
4266
|
}
|
|
4269
4267
|
delete this.items[elementIndex];
|
|
4270
|
-
if (
|
|
4268
|
+
if (true) {
|
|
4271
4269
|
this.debug(`Discard element ${elementIndex}`);
|
|
4272
4270
|
}
|
|
4273
4271
|
});
|
|
@@ -4289,7 +4287,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4289
4287
|
}
|
|
4290
4288
|
const elementIndex = elementsOutsideItemRange.pop();
|
|
4291
4289
|
if (elementIndex == null) {
|
|
4292
|
-
if (
|
|
4290
|
+
if (true) {
|
|
4293
4291
|
this.error(`Cannot find element to render item ${i}`);
|
|
4294
4292
|
}
|
|
4295
4293
|
continue;
|
|
@@ -4311,7 +4309,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4311
4309
|
const itemIndex = this.mappedItems.getItemRenderedAtElementIndex(elementIndex);
|
|
4312
4310
|
const options = this.brain.getOptions();
|
|
4313
4311
|
if (itemIndex == null) {
|
|
4314
|
-
if (
|
|
4312
|
+
if (true) {
|
|
4315
4313
|
this.error(`Cannot find item for element ${elementIndex}`);
|
|
4316
4314
|
}
|
|
4317
4315
|
return;
|
|
@@ -4321,7 +4319,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4321
4319
|
return;
|
|
4322
4320
|
}
|
|
4323
4321
|
if (itemElement) {
|
|
4324
|
-
if (
|
|
4322
|
+
if (true) {
|
|
4325
4323
|
itemElement.dataset.elementIndex = elementIndex;
|
|
4326
4324
|
itemElement.dataset.itemIndex = itemIndex;
|
|
4327
4325
|
}
|
|
@@ -4335,6 +4333,9 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4335
4333
|
}
|
|
4336
4334
|
};
|
|
4337
4335
|
this.destroy = () => {
|
|
4336
|
+
if (true) {
|
|
4337
|
+
return;
|
|
4338
|
+
}
|
|
4338
4339
|
this.destroyed = true;
|
|
4339
4340
|
this.mappedItems.destroy();
|
|
4340
4341
|
this.itemDOMElements = [];
|
|
@@ -4394,7 +4395,7 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4394
4395
|
return;
|
|
4395
4396
|
}
|
|
4396
4397
|
this.mappedItems.renderItemAtElement(itemIndex, elementIndex, renderedNode);
|
|
4397
|
-
if (
|
|
4398
|
+
if (true) {
|
|
4398
4399
|
this.debug(`Render item ${itemIndex} at element ${elementIndex}`);
|
|
4399
4400
|
}
|
|
4400
4401
|
itemUpdater(renderedNode);
|
|
@@ -4457,7 +4458,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
4457
4458
|
const renderColumn = (0, import_react26.useCallback)(({ domRef: domRef2, itemIndex: columnIndex }) => {
|
|
4458
4459
|
const column = columns[columnIndex];
|
|
4459
4460
|
if (!column) {
|
|
4460
|
-
if (
|
|
4461
|
+
if (true) {
|
|
4461
4462
|
debug3("Cannot find column to render at ", columnIndex);
|
|
4462
4463
|
}
|
|
4463
4464
|
return null;
|
|
@@ -4890,7 +4891,7 @@ var getScrollableClassName = (scrollable) => {
|
|
|
4890
4891
|
};
|
|
4891
4892
|
|
|
4892
4893
|
// src/components/VirtualScrollContainer/index.tsx
|
|
4893
|
-
var rootClassName6 = "
|
|
4894
|
+
var rootClassName6 = "InfiniteVirtualScrollContainer";
|
|
4894
4895
|
var VirtualScrollContainer = React23.forwardRef(function VirtualScrollContainer2(props, ref) {
|
|
4895
4896
|
const {
|
|
4896
4897
|
children,
|
|
@@ -4921,8 +4922,8 @@ function SpacePlaceholderFn(props) {
|
|
|
4921
4922
|
};
|
|
4922
4923
|
return /* @__PURE__ */ React24.createElement("div", {
|
|
4923
4924
|
"data-count": count,
|
|
4924
|
-
"data-width": width,
|
|
4925
|
-
"data-height": height,
|
|
4925
|
+
"data-placeholder-width": true ? width : void 0,
|
|
4926
|
+
"data-placeholder-height": true ? height : void 0,
|
|
4926
4927
|
"data-name": "SpacePlaceholder",
|
|
4927
4928
|
style
|
|
4928
4929
|
});
|
|
@@ -4991,7 +4992,7 @@ var VirtualList = (props) => {
|
|
|
4991
4992
|
(0, import_react30.useEffect)(() => {
|
|
4992
4993
|
const removeOnRenderCount = virtualBrain.onRenderCountChange((renderCount) => {
|
|
4993
4994
|
renderCountRef.current = renderCount;
|
|
4994
|
-
if (
|
|
4995
|
+
if (true) {
|
|
4995
4996
|
debug4.extend(mainAxis)(`Render count change ${renderCount}`);
|
|
4996
4997
|
}
|
|
4997
4998
|
rerender();
|
|
@@ -5019,7 +5020,7 @@ var VirtualList = (props) => {
|
|
|
5019
5020
|
const domProps = __spreadProps(__spreadValues({}, restDOMProps), {
|
|
5020
5021
|
className: join(props.className, rootClassName7, `${rootClassName7}--${mainAxis}`, VirtualListCls, VirtualListClsOrientation[mainAxis])
|
|
5021
5022
|
});
|
|
5022
|
-
if (
|
|
5023
|
+
if (true) {
|
|
5023
5024
|
domProps["data-cmp-name"] = `VirtualList`;
|
|
5024
5025
|
}
|
|
5025
5026
|
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React25.createElement(VirtualScrollContainer, {
|
|
@@ -5251,7 +5252,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
5251
5252
|
const rows = parentNode.querySelectorAll(hoverSelector.join(","));
|
|
5252
5253
|
rows.forEach((row) => row.classList.remove(InfiniteTableRowClassName__hover, RowHoverCls));
|
|
5253
5254
|
}, [initialMouseLeave, showHoverRows]);
|
|
5254
|
-
if (rowInfo.isGroupRow
|
|
5255
|
+
if (rowInfo.isGroupRow) {
|
|
5255
5256
|
style = style || {};
|
|
5256
5257
|
style[stripVar(ThemeVars.components.Row.groupNesting)] = rowInfo.groupNesting - 1;
|
|
5257
5258
|
}
|
|
@@ -5323,7 +5324,7 @@ function InfiniteTableRowFn(props) {
|
|
|
5323
5324
|
if (renderCellRef.current !== renderCell) {
|
|
5324
5325
|
renderCellRef.current = renderCell;
|
|
5325
5326
|
}
|
|
5326
|
-
if (
|
|
5327
|
+
if (true) {
|
|
5327
5328
|
domProps["data-cmp-name"] = "ITableRow";
|
|
5328
5329
|
}
|
|
5329
5330
|
return /* @__PURE__ */ React28.createElement("div", __spreadProps(__spreadValues({}, domProps), {
|
|
@@ -5467,10 +5468,10 @@ var import_react34 = __toModule(require("react"));
|
|
|
5467
5468
|
|
|
5468
5469
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
5469
5470
|
var FooterCls = "_16lm1iw1";
|
|
5470
|
-
var InfiniteCls = "_1yeub2v0 _16lm1iw1
|
|
5471
|
+
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwj _16lm1iwz _16lm1iw0";
|
|
5471
5472
|
var InfiniteClsRecipe = 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: [] });
|
|
5472
5473
|
var InfiniteClsScrolling = "_1yeub2v1";
|
|
5473
|
-
var InfiniteClsShiftingColumns = "
|
|
5474
|
+
var InfiniteClsShiftingColumns = "_16lm1iwm";
|
|
5474
5475
|
var PinnedRowsClsVariants = { pinnedStart: "_1yeub2ve", pinnedEnd: "_1yeub2vf", overflow: "_1yeub2vg" };
|
|
5475
5476
|
var PinnedRowsContainerClsVariants = createRuntimeFn({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vh", end: "_1yeub2vi", false: "_1yeub2vj" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5476
5477
|
|
|
@@ -5591,7 +5592,7 @@ var rootClassName10 = InfiniteListRootClassName;
|
|
|
5591
5592
|
var defaultClasses = [
|
|
5592
5593
|
willChange.transform,
|
|
5593
5594
|
position.relative,
|
|
5594
|
-
|
|
5595
|
+
transform.translateZero
|
|
5595
5596
|
];
|
|
5596
5597
|
var RowListWithExternalScrolling = (props) => {
|
|
5597
5598
|
const {
|
|
@@ -5618,7 +5619,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
5618
5619
|
const onScroll = (scrollPosition) => {
|
|
5619
5620
|
const node = domRef.current;
|
|
5620
5621
|
if (node) {
|
|
5621
|
-
if (
|
|
5622
|
+
if (true) {
|
|
5622
5623
|
const { renderStartIndex, renderEndIndex } = brain.getRenderRange();
|
|
5623
5624
|
node.dataset.renderStartIndex = renderStartIndex;
|
|
5624
5625
|
node.dataset.renderEndIndex = renderEndIndex;
|
|
@@ -5640,7 +5641,7 @@ var RowListWithExternalScrolling = (props) => {
|
|
|
5640
5641
|
style,
|
|
5641
5642
|
className: join(className, rootClassName10, `${rootClassName10}--vertical`, VirtualListCls, VirtualListClsOrientation.vertical, ...defaultClasses)
|
|
5642
5643
|
};
|
|
5643
|
-
if (
|
|
5644
|
+
if (true) {
|
|
5644
5645
|
domProps["data-cmp-name"] = "RowListWithExternalScrolling";
|
|
5645
5646
|
}
|
|
5646
5647
|
return /* @__PURE__ */ React31.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React31.createElement(RawList, {
|
|
@@ -5866,7 +5867,7 @@ var VirtualBrain = class extends Logger {
|
|
|
5866
5867
|
this.availableSize = { width: 0, height: 0 };
|
|
5867
5868
|
this.setAvailableSize = (size) => {
|
|
5868
5869
|
this.availableSize = size;
|
|
5869
|
-
if (
|
|
5870
|
+
if (true) {
|
|
5870
5871
|
this.debug("New available size %d", size[this.options.mainAxis === "vertical" ? "height" : "width"]);
|
|
5871
5872
|
}
|
|
5872
5873
|
this.updateRenderCount();
|
|
@@ -5903,7 +5904,7 @@ var VirtualBrain = class extends Logger {
|
|
|
5903
5904
|
this.notifyTotalSizeChange();
|
|
5904
5905
|
return;
|
|
5905
5906
|
}
|
|
5906
|
-
if (
|
|
5907
|
+
if (true) {
|
|
5907
5908
|
this.debug("set renderCount to %d", renderCount);
|
|
5908
5909
|
}
|
|
5909
5910
|
this.renderCount = renderCount;
|
|
@@ -5977,7 +5978,7 @@ var VirtualBrain = class extends Logger {
|
|
|
5977
5978
|
return;
|
|
5978
5979
|
}
|
|
5979
5980
|
}
|
|
5980
|
-
if (
|
|
5981
|
+
if (true) {
|
|
5981
5982
|
if (itemSizeChange && countChange) {
|
|
5982
5983
|
this.debug(`Reset brain: reason itemSize changed and count changed (old ${count}, new ${newCount})`, {
|
|
5983
5984
|
oldItemSize: itemSize,
|
|
@@ -6017,7 +6018,7 @@ var VirtualBrain = class extends Logger {
|
|
|
6017
6018
|
if (cache[i] === void 0) {
|
|
6018
6019
|
ItemIndexBag.itemIndex = i;
|
|
6019
6020
|
let spanValue = itemSpan(ItemIndexBag);
|
|
6020
|
-
if (
|
|
6021
|
+
if (spanValue < 1) {
|
|
6021
6022
|
this.debug("itemSpan cannot be less than 1 - got %d for index %d", spanValue, i);
|
|
6022
6023
|
}
|
|
6023
6024
|
cache[i] = i;
|
|
@@ -6217,7 +6218,7 @@ var VirtualBrain = class extends Logger {
|
|
|
6217
6218
|
const { renderStartIndex, renderEndIndex } = this.renderRange;
|
|
6218
6219
|
if (renderEndIndex !== renderRange.renderEndIndex || renderStartIndex !== renderRange.renderStartIndex) {
|
|
6219
6220
|
this.renderRange = renderRange;
|
|
6220
|
-
if (
|
|
6221
|
+
if (true) {
|
|
6221
6222
|
this.debug("Set renderRange to %d-%d", renderRange.renderStartIndex, renderRange.renderEndIndex);
|
|
6222
6223
|
}
|
|
6223
6224
|
this.notifyRenderRangeChange();
|
|
@@ -6729,9 +6730,9 @@ var useLicense = (licenseKey) => {
|
|
|
6729
6730
|
const valid = (0, import_react42.useMemo)(() => {
|
|
6730
6731
|
let valid2 = isValidLicense(licenseKey, {
|
|
6731
6732
|
publishedAt: 1624970570587,
|
|
6732
|
-
version: "0.0.
|
|
6733
|
+
version: "0.0.4"
|
|
6733
6734
|
});
|
|
6734
|
-
if (!valid2 && isInsideSandbox) {
|
|
6735
|
+
if (!licenseKey && !valid2 && isInsideSandbox) {
|
|
6735
6736
|
return true;
|
|
6736
6737
|
}
|
|
6737
6738
|
return valid2;
|
|
@@ -6878,8 +6879,8 @@ function useDOMProps(initialDOMProps) {
|
|
|
6878
6879
|
var React35 = __toModule(require("react"));
|
|
6879
6880
|
|
|
6880
6881
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
6881
|
-
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2
|
|
6882
|
-
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2
|
|
6882
|
+
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv" };
|
|
6883
|
+
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv";
|
|
6883
6884
|
var LoadMaskTextCls = "qy58ya4";
|
|
6884
6885
|
|
|
6885
6886
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
@@ -6911,7 +6912,8 @@ var InfiniteTableRoot = getComponentStateRoot({
|
|
|
6911
6912
|
rowHeight: true,
|
|
6912
6913
|
headerHeight: true
|
|
6913
6914
|
},
|
|
6914
|
-
getParentState: () => useDataSource()
|
|
6915
|
+
getParentState: () => useDataSource(),
|
|
6916
|
+
debugName: "InfiniteTable"
|
|
6915
6917
|
});
|
|
6916
6918
|
var InfiniteTableComponent = React36.memo(function InfiniteTableComponent2() {
|
|
6917
6919
|
var _a;
|
|
@@ -6989,7 +6991,7 @@ function InfiniteTableContextProvider() {
|
|
|
6989
6991
|
const computed = useComputed();
|
|
6990
6992
|
const getComputed = useLatest(computed);
|
|
6991
6993
|
const getState = useLatest(componentState);
|
|
6992
|
-
if (
|
|
6994
|
+
if (true) {
|
|
6993
6995
|
globalThis.getState = getState;
|
|
6994
6996
|
globalThis.getComputed = getComputed;
|
|
6995
6997
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infinite-table/infinite-react",
|
|
3
3
|
"description": "Infinite Table for React",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.esm.js",
|
|
7
7
|
"typings": "index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"debug": "^4.3.1",
|
|
14
14
|
"decamelize": "^5.0.0"
|
|
15
15
|
},
|
|
16
|
-
"license": "Commercial",
|
|
16
|
+
"license": "Commercial & Open Source",
|
|
17
17
|
"//": "will be updated at build time",
|
|
18
|
-
"publishedAt":
|
|
18
|
+
"publishedAt": 1638307822158
|
|
19
19
|
}
|