@infinite-table/infinite-react 0.0.3 → 0.0.7
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 -40
- package/index.d.ts +125 -85
- package/index.esm.css +43 -37
- package/index.esm.js +381 -240
- package/index.js +441 -300
- package/package.json +3 -3
- package/tmp.css.map +0 -1
package/index.esm.js
CHANGED
|
@@ -211,6 +211,8 @@ var require_common = __commonJS({
|
|
|
211
211
|
function createDebug(namespace) {
|
|
212
212
|
let prevTime;
|
|
213
213
|
let enableOverride = null;
|
|
214
|
+
let namespacesCache;
|
|
215
|
+
let enabledCache;
|
|
214
216
|
function debug6(...args) {
|
|
215
217
|
if (!debug6.enabled) {
|
|
216
218
|
return;
|
|
@@ -253,7 +255,16 @@ var require_common = __commonJS({
|
|
|
253
255
|
Object.defineProperty(debug6, "enabled", {
|
|
254
256
|
enumerable: true,
|
|
255
257
|
configurable: false,
|
|
256
|
-
get: () =>
|
|
258
|
+
get: () => {
|
|
259
|
+
if (enableOverride !== null) {
|
|
260
|
+
return enableOverride;
|
|
261
|
+
}
|
|
262
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
263
|
+
namespacesCache = createDebug.namespaces;
|
|
264
|
+
enabledCache = createDebug.enabled(namespace);
|
|
265
|
+
}
|
|
266
|
+
return enabledCache;
|
|
267
|
+
},
|
|
257
268
|
set: (v) => {
|
|
258
269
|
enableOverride = v;
|
|
259
270
|
}
|
|
@@ -270,6 +281,7 @@ var require_common = __commonJS({
|
|
|
270
281
|
}
|
|
271
282
|
function enable(namespaces) {
|
|
272
283
|
createDebug.save(namespaces);
|
|
284
|
+
createDebug.namespaces = namespaces;
|
|
273
285
|
createDebug.names = [];
|
|
274
286
|
createDebug.skips = [];
|
|
275
287
|
let i;
|
|
@@ -497,6 +509,99 @@ var require_browser = __commonJS({
|
|
|
497
509
|
}
|
|
498
510
|
});
|
|
499
511
|
|
|
512
|
+
// node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.dev.js
|
|
513
|
+
var require_vanilla_extract_recipes_createRuntimeFn_cjs_dev = __commonJS({
|
|
514
|
+
"node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.dev.js"(exports) {
|
|
515
|
+
"use strict";
|
|
516
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
517
|
+
function _defineProperty(obj, key, value) {
|
|
518
|
+
if (key in obj) {
|
|
519
|
+
Object.defineProperty(obj, key, {
|
|
520
|
+
value,
|
|
521
|
+
enumerable: true,
|
|
522
|
+
configurable: true,
|
|
523
|
+
writable: true
|
|
524
|
+
});
|
|
525
|
+
} else {
|
|
526
|
+
obj[key] = value;
|
|
527
|
+
}
|
|
528
|
+
return obj;
|
|
529
|
+
}
|
|
530
|
+
function ownKeys(object, enumerableOnly) {
|
|
531
|
+
var keys = Object.keys(object);
|
|
532
|
+
if (Object.getOwnPropertySymbols) {
|
|
533
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
534
|
+
if (enumerableOnly) {
|
|
535
|
+
symbols = symbols.filter(function(sym) {
|
|
536
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
keys.push.apply(keys, symbols);
|
|
540
|
+
}
|
|
541
|
+
return keys;
|
|
542
|
+
}
|
|
543
|
+
function _objectSpread2(target) {
|
|
544
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
545
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
546
|
+
if (i % 2) {
|
|
547
|
+
ownKeys(Object(source), true).forEach(function(key) {
|
|
548
|
+
_defineProperty(target, key, source[key]);
|
|
549
|
+
});
|
|
550
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
551
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
552
|
+
} else {
|
|
553
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
554
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
return target;
|
|
559
|
+
}
|
|
560
|
+
var shouldApplyCompound = (compoundCheck, selections) => {
|
|
561
|
+
for (var key of Object.keys(compoundCheck)) {
|
|
562
|
+
if (compoundCheck[key] !== selections[key]) {
|
|
563
|
+
return false;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return true;
|
|
567
|
+
};
|
|
568
|
+
var createRuntimeFn = (config) => (options) => {
|
|
569
|
+
var className = config.defaultClassName;
|
|
570
|
+
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
571
|
+
for (var variantName in selections) {
|
|
572
|
+
var _selections$variantNa;
|
|
573
|
+
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
574
|
+
if (variantSelection != null) {
|
|
575
|
+
var selection = variantSelection;
|
|
576
|
+
if (typeof selection === "boolean") {
|
|
577
|
+
selection = selection === true ? "true" : "false";
|
|
578
|
+
}
|
|
579
|
+
className += " " + config.variantClassNames[variantName][selection];
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
583
|
+
if (shouldApplyCompound(compoundCheck, selections)) {
|
|
584
|
+
className += " " + compoundClassName;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
return className;
|
|
588
|
+
};
|
|
589
|
+
exports.createRuntimeFn = createRuntimeFn;
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
// node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.js
|
|
594
|
+
var require_vanilla_extract_recipes_createRuntimeFn_cjs = __commonJS({
|
|
595
|
+
"node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.cjs.js"(exports, module) {
|
|
596
|
+
"use strict";
|
|
597
|
+
if (false) {
|
|
598
|
+
module.exports = null;
|
|
599
|
+
} else {
|
|
600
|
+
module.exports = require_vanilla_extract_recipes_createRuntimeFn_cjs_dev();
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
|
|
500
605
|
// node_modules/binary-search/index.js
|
|
501
606
|
var require_binary_search = __commonJS({
|
|
502
607
|
"node_modules/binary-search/index.js"(exports, module) {
|
|
@@ -558,7 +663,7 @@ var require_decamelize = __commonJS({
|
|
|
558
663
|
if (preserveConsecutiveUppercase) {
|
|
559
664
|
return handlePreserveConsecutiveUppercase(decamelized, separator);
|
|
560
665
|
}
|
|
561
|
-
return decamelized.replace(/(\p{Uppercase_Letter}
|
|
666
|
+
return decamelized.replace(/(\p{Uppercase_Letter})(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu, replacement).toLowerCase();
|
|
562
667
|
};
|
|
563
668
|
}
|
|
564
669
|
});
|
|
@@ -1919,31 +2024,28 @@ import {
|
|
|
1919
2024
|
import { useState as useState3 } from "react";
|
|
1920
2025
|
|
|
1921
2026
|
// src/components/InfiniteTable/utilities.css.ts
|
|
1922
|
-
var alignItems = { center: "
|
|
1923
|
-
var cssEllipsisClassName = "
|
|
1924
|
-
var cursor = { pointer: "
|
|
1925
|
-
var display = { flex: "
|
|
2027
|
+
var alignItems = { center: "_16lm1iw11", stretch: "_16lm1iw12" };
|
|
2028
|
+
var cssEllipsisClassName = "_16lm1iw1a _16lm1iw1b _16lm1iw16";
|
|
2029
|
+
var cursor = { pointer: "_16lm1iwb" };
|
|
2030
|
+
var display = { flex: "_16lm1iwj", block: "_16lm1iwk", inlineBlock: "_16lm1iwl" };
|
|
1926
2031
|
var fill = { currentColor: "_16lm1iw5", accentColor: "_16lm1iw6" };
|
|
1927
|
-
var flex = { "1": "
|
|
1928
|
-
var flexFlow = { column: "
|
|
1929
|
-
var justifyContent = { center: "
|
|
1930
|
-
var left = { "0": "
|
|
2032
|
+
var flex = { "1": "_16lm1iwc", none: "_16lm1iwd" };
|
|
2033
|
+
var flexFlow = { column: "_16lm1iwz", row: "_16lm1iw10" };
|
|
2034
|
+
var justifyContent = { center: "_16lm1iw13", start: "_16lm1iw14", end: "_16lm1iw15" };
|
|
2035
|
+
var left = { "0": "_16lm1iwt", "100%": "_16lm1iwu" };
|
|
1931
2036
|
var position = { relative: "_16lm1iw1", absolute: "_16lm1iw2", sticky: "_16lm1iw3", fixed: "_16lm1iw4" };
|
|
1932
|
-
var top = { "0": "
|
|
2037
|
+
var top = { "0": "_16lm1iwr", "100%": "_16lm1iws" };
|
|
2038
|
+
var transform = { translateZero: "_16lm1iw9", rotate90: "_16lm1iwa" };
|
|
1933
2039
|
var transformTranslateZero = "_16lm1iw8";
|
|
1934
|
-
var userSelect = { none: "
|
|
1935
|
-
var willChange = { transform: "
|
|
1936
|
-
var zIndex = { "1": "
|
|
2040
|
+
var userSelect = { none: "_16lm1iwm" };
|
|
2041
|
+
var willChange = { transform: "_16lm1iw19" };
|
|
2042
|
+
var zIndex = { "1": "_16lm1iwe", "10": "_16lm1iwf", "1000": "_16lm1iwg", "10000": "_16lm1iwh", "100000": "_16lm1iwi" };
|
|
1937
2043
|
|
|
1938
2044
|
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
1939
2045
|
function ExpanderIcon(props) {
|
|
1940
2046
|
var _a;
|
|
1941
2047
|
const { size = 24 } = props;
|
|
1942
|
-
const style = __spreadValues({}, props.style);
|
|
1943
2048
|
const [expanded, setExpanded] = useState3((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
1944
|
-
if (expanded) {
|
|
1945
|
-
style.transform = `rotate(90deg)`;
|
|
1946
|
-
}
|
|
1947
2049
|
const onClick = () => {
|
|
1948
2050
|
var _a2;
|
|
1949
2051
|
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
@@ -1962,14 +2064,20 @@ function ExpanderIcon(props) {
|
|
|
1962
2064
|
height: `${size}px`,
|
|
1963
2065
|
viewBox: "0 0 24 24",
|
|
1964
2066
|
width: `${size}px`,
|
|
1965
|
-
style,
|
|
2067
|
+
style: props.style,
|
|
1966
2068
|
onClick,
|
|
1967
|
-
className: join(props.className, fill.
|
|
2069
|
+
className: join(props.className, fill.accentColor, flex.none, cursor.pointer, expanded ? fill.accentColor : "", expanded ? transform.rotate90 : "", "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`)
|
|
1968
2070
|
}, /* @__PURE__ */ createElement3("path", {
|
|
1969
2071
|
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
1970
2072
|
}));
|
|
1971
2073
|
}
|
|
1972
2074
|
|
|
2075
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
2076
|
+
var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
2077
|
+
var GroupRowExpanderCls = "_7pupv0b";
|
|
2078
|
+
var RowClsRecipe = (0, import_createRuntimeFn.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: [] });
|
|
2079
|
+
var RowHoverCls = "_7pupv01";
|
|
2080
|
+
|
|
1973
2081
|
// src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
|
|
1974
2082
|
function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params) {
|
|
1975
2083
|
if (!pivotColumns) {
|
|
@@ -1989,51 +2097,51 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
|
|
|
1989
2097
|
return;
|
|
1990
2098
|
}
|
|
1991
2099
|
let column = __spreadValues({}, col);
|
|
1992
|
-
if (pivotColumn) {
|
|
1993
|
-
if (typeof pivotColumn === "function") {
|
|
1994
|
-
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
1995
|
-
column,
|
|
1996
|
-
pivotBy,
|
|
1997
|
-
groupRowsBy
|
|
1998
|
-
}));
|
|
1999
|
-
} else {
|
|
2000
|
-
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
2100
|
const isPivotRowLabelsColumn = !column.pivotColumn && !column.pivotTotalColumn;
|
|
2004
|
-
if (
|
|
2005
|
-
if (
|
|
2006
|
-
|
|
2007
|
-
column,
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2101
|
+
if (!isPivotRowLabelsColumn) {
|
|
2102
|
+
if (pivotColumn) {
|
|
2103
|
+
if (typeof pivotColumn === "function") {
|
|
2104
|
+
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
2105
|
+
column,
|
|
2106
|
+
pivotBy,
|
|
2107
|
+
groupRowsBy
|
|
2108
|
+
}));
|
|
2109
|
+
} else {
|
|
2110
|
+
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
2111
|
+
}
|
|
2013
2112
|
}
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2113
|
+
} else {
|
|
2114
|
+
if (pivotRowLabelsColumn) {
|
|
2115
|
+
if (typeof pivotRowLabelsColumn === "function") {
|
|
2116
|
+
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn({
|
|
2117
|
+
column,
|
|
2118
|
+
pivotBy,
|
|
2119
|
+
groupRowsBy
|
|
2120
|
+
}));
|
|
2121
|
+
} else {
|
|
2122
|
+
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn);
|
|
2021
2123
|
}
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
expanded: !rowInfo.collapsed,
|
|
2030
|
-
onChange: () => {
|
|
2031
|
-
toggleGroupRow(rowInfo.groupKeys);
|
|
2124
|
+
}
|
|
2125
|
+
if (!column.render) {
|
|
2126
|
+
column.render = (renderOptions) => {
|
|
2127
|
+
var _a;
|
|
2128
|
+
let { value, rowInfo, column: column2, groupRowsBy: groupRowsBy2 } = renderOptions;
|
|
2129
|
+
if (column2.renderValue) {
|
|
2130
|
+
value = column2.renderValue(renderOptions);
|
|
2032
2131
|
}
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2132
|
+
const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < groupRowsBy2.length;
|
|
2133
|
+
return /* @__PURE__ */ createElement4("div", {
|
|
2134
|
+
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2135
|
+
}, showExpanderIcon ? /* @__PURE__ */ createElement4(ExpanderIcon, {
|
|
2136
|
+
expanded: !rowInfo.collapsed,
|
|
2137
|
+
onChange: () => {
|
|
2138
|
+
toggleGroupRow(rowInfo.groupKeys);
|
|
2139
|
+
}
|
|
2140
|
+
}) : null, /* @__PURE__ */ createElement4("div", {
|
|
2141
|
+
className: cssEllipsisClassName
|
|
2142
|
+
}, value != null ? value : null));
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
2037
2145
|
}
|
|
2038
2146
|
if (!column.render && column.renderValue) {
|
|
2039
2147
|
column.render = (renderOptions) => {
|
|
@@ -2049,47 +2157,6 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
|
|
|
2049
2157
|
import {
|
|
2050
2158
|
createElement as createElement5
|
|
2051
2159
|
} from "react";
|
|
2052
|
-
|
|
2053
|
-
// node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
|
|
2054
|
-
var shouldApplyCompound = (compoundCheck, selections) => {
|
|
2055
|
-
for (const key of Object.keys(compoundCheck)) {
|
|
2056
|
-
if (compoundCheck[key] !== selections[key]) {
|
|
2057
|
-
return false;
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
return true;
|
|
2061
|
-
};
|
|
2062
|
-
var createRuntimeFn = (config) => (options) => {
|
|
2063
|
-
let className = config.defaultClassName;
|
|
2064
|
-
const selections = {
|
|
2065
|
-
...config.defaultVariants,
|
|
2066
|
-
...options
|
|
2067
|
-
};
|
|
2068
|
-
for (const variantName in selections) {
|
|
2069
|
-
var _selections$variantNa;
|
|
2070
|
-
const variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
2071
|
-
if (variantSelection != null) {
|
|
2072
|
-
let selection = variantSelection;
|
|
2073
|
-
if (typeof selection === "boolean") {
|
|
2074
|
-
selection = selection === true ? "true" : "false";
|
|
2075
|
-
}
|
|
2076
|
-
className += " " + config.variantClassNames[variantName][selection];
|
|
2077
|
-
}
|
|
2078
|
-
}
|
|
2079
|
-
for (const [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
2080
|
-
if (shouldApplyCompound(compoundCheck, selections)) {
|
|
2081
|
-
className += " " + compoundClassName;
|
|
2082
|
-
}
|
|
2083
|
-
}
|
|
2084
|
-
return className;
|
|
2085
|
-
};
|
|
2086
|
-
|
|
2087
|
-
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
2088
|
-
var GroupRowExpanderCls = "_7pupv0b";
|
|
2089
|
-
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: [] });
|
|
2090
|
-
var RowHoverCls = "_7pupv01";
|
|
2091
|
-
|
|
2092
|
-
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
2093
2160
|
function getGroupColumnRender({
|
|
2094
2161
|
groupIndexForColumn,
|
|
2095
2162
|
groupRenderStrategy,
|
|
@@ -2693,78 +2760,6 @@ function mapPropsToState2(params) {
|
|
|
2693
2760
|
};
|
|
2694
2761
|
}
|
|
2695
2762
|
|
|
2696
|
-
// src/utils/multisort/sortTypes.ts
|
|
2697
|
-
var sortTypes = {
|
|
2698
|
-
number: function(first, second) {
|
|
2699
|
-
return first - second;
|
|
2700
|
-
},
|
|
2701
|
-
string: function(first, second) {
|
|
2702
|
-
first = `${first}`;
|
|
2703
|
-
second = `${second}`;
|
|
2704
|
-
return first.localeCompare(second);
|
|
2705
|
-
}
|
|
2706
|
-
};
|
|
2707
|
-
var sortTypes_default = sortTypes;
|
|
2708
|
-
|
|
2709
|
-
// src/utils/multisort/index.ts
|
|
2710
|
-
var multisort = (sortInfo, array, get) => {
|
|
2711
|
-
array.sort(getMultisortFunction(sortInfo, get));
|
|
2712
|
-
return array;
|
|
2713
|
-
};
|
|
2714
|
-
multisort.knownTypes = sortTypes_default;
|
|
2715
|
-
var getSingleSortFunction = (info) => {
|
|
2716
|
-
if (!info) {
|
|
2717
|
-
return;
|
|
2718
|
-
}
|
|
2719
|
-
const field = info.field;
|
|
2720
|
-
var dir = info.dir < 0 ? -1 : info.dir > 0 ? 1 : 0;
|
|
2721
|
-
if (!dir) {
|
|
2722
|
-
return;
|
|
2723
|
-
}
|
|
2724
|
-
let fn = info.fn;
|
|
2725
|
-
if (!fn && info.type) {
|
|
2726
|
-
fn = multisort.knownTypes[info.type];
|
|
2727
|
-
if (!fn) {
|
|
2728
|
-
console.warn(`Unknown sort type "${info.type}" - please pass one of ${Object.keys(multisort.knownTypes).join(", ")}`);
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2731
|
-
if (!fn) {
|
|
2732
|
-
fn = sortTypes_default.string;
|
|
2733
|
-
}
|
|
2734
|
-
return (first, second) => {
|
|
2735
|
-
const a = field ? first[field] : first;
|
|
2736
|
-
const b = field ? second[field] : second;
|
|
2737
|
-
return dir * fn(a, b);
|
|
2738
|
-
};
|
|
2739
|
-
};
|
|
2740
|
-
var getSortFunctions = (sortInfo) => {
|
|
2741
|
-
return sortInfo.map(getSingleSortFunction).filter((fn) => fn instanceof Function);
|
|
2742
|
-
};
|
|
2743
|
-
var getMultisortFunction = (sortInfo, get) => {
|
|
2744
|
-
const fns = getSortFunctions(sortInfo);
|
|
2745
|
-
return (first, second) => {
|
|
2746
|
-
if (get) {
|
|
2747
|
-
first = get(first);
|
|
2748
|
-
second = get(second);
|
|
2749
|
-
}
|
|
2750
|
-
let result = 0;
|
|
2751
|
-
let i = 0;
|
|
2752
|
-
let fn;
|
|
2753
|
-
const len = fns.length;
|
|
2754
|
-
for (; i < len; i++) {
|
|
2755
|
-
fn = fns[i];
|
|
2756
|
-
if (!fn) {
|
|
2757
|
-
continue;
|
|
2758
|
-
}
|
|
2759
|
-
result = fn(first, second);
|
|
2760
|
-
if (result !== 0) {
|
|
2761
|
-
return result;
|
|
2762
|
-
}
|
|
2763
|
-
}
|
|
2764
|
-
return result;
|
|
2765
|
-
};
|
|
2766
|
-
};
|
|
2767
|
-
|
|
2768
2763
|
// src/utils/groupAndPivot/index.ts
|
|
2769
2764
|
function DEFAULT_TO_KEY(value) {
|
|
2770
2765
|
return value;
|
|
@@ -2994,6 +2989,80 @@ function enhancedFlatten(param) {
|
|
|
2994
2989
|
data: result
|
|
2995
2990
|
};
|
|
2996
2991
|
}
|
|
2992
|
+
|
|
2993
|
+
// src/utils/multisort/sortTypes.ts
|
|
2994
|
+
var sortTypes = {
|
|
2995
|
+
number: function(first, second) {
|
|
2996
|
+
return first - second;
|
|
2997
|
+
},
|
|
2998
|
+
string: function(first, second) {
|
|
2999
|
+
first = `${first}`;
|
|
3000
|
+
second = `${second}`;
|
|
3001
|
+
return first.localeCompare(second);
|
|
3002
|
+
}
|
|
3003
|
+
};
|
|
3004
|
+
var sortTypes_default = sortTypes;
|
|
3005
|
+
|
|
3006
|
+
// src/utils/multisort/index.ts
|
|
3007
|
+
var multisort = (sortInfo, array, get) => {
|
|
3008
|
+
array.sort(getMultisortFunction(sortInfo, get));
|
|
3009
|
+
return array;
|
|
3010
|
+
};
|
|
3011
|
+
multisort.knownTypes = sortTypes_default;
|
|
3012
|
+
var getSingleSortFunction = (info) => {
|
|
3013
|
+
if (!info) {
|
|
3014
|
+
return;
|
|
3015
|
+
}
|
|
3016
|
+
const field = info.field;
|
|
3017
|
+
var dir = info.dir < 0 ? -1 : info.dir > 0 ? 1 : 0;
|
|
3018
|
+
if (!dir) {
|
|
3019
|
+
return;
|
|
3020
|
+
}
|
|
3021
|
+
let fn = info.fn;
|
|
3022
|
+
if (!fn && info.type) {
|
|
3023
|
+
fn = multisort.knownTypes[info.type];
|
|
3024
|
+
if (!fn) {
|
|
3025
|
+
console.warn(`Unknown sort type "${info.type}" - please pass one of ${Object.keys(multisort.knownTypes).join(", ")}`);
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
if (!fn) {
|
|
3029
|
+
fn = sortTypes_default.string;
|
|
3030
|
+
}
|
|
3031
|
+
return (first, second) => {
|
|
3032
|
+
const a = field ? first[field] : first;
|
|
3033
|
+
const b = field ? second[field] : second;
|
|
3034
|
+
return dir * fn(a, b);
|
|
3035
|
+
};
|
|
3036
|
+
};
|
|
3037
|
+
var getSortFunctions = (sortInfo) => {
|
|
3038
|
+
return sortInfo.map(getSingleSortFunction).filter((fn) => fn instanceof Function);
|
|
3039
|
+
};
|
|
3040
|
+
var getMultisortFunction = (sortInfo, get) => {
|
|
3041
|
+
const fns = getSortFunctions(sortInfo);
|
|
3042
|
+
return (first, second) => {
|
|
3043
|
+
if (get) {
|
|
3044
|
+
first = get(first);
|
|
3045
|
+
second = get(second);
|
|
3046
|
+
}
|
|
3047
|
+
let result = 0;
|
|
3048
|
+
let i = 0;
|
|
3049
|
+
let fn;
|
|
3050
|
+
const len = fns.length;
|
|
3051
|
+
for (; i < len; i++) {
|
|
3052
|
+
fn = fns[i];
|
|
3053
|
+
if (!fn) {
|
|
3054
|
+
continue;
|
|
3055
|
+
}
|
|
3056
|
+
result = fn(first, second);
|
|
3057
|
+
if (result !== 0) {
|
|
3058
|
+
return result;
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
return result;
|
|
3062
|
+
};
|
|
3063
|
+
};
|
|
3064
|
+
|
|
3065
|
+
// src/utils/groupAndPivot/getPivotColumnsAndColumnGroups.ts
|
|
2997
3066
|
function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPosition) {
|
|
2998
3067
|
const pivotLength = pivotBy.length;
|
|
2999
3068
|
const columns = new Map([
|
|
@@ -3018,10 +3087,14 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
|
|
|
3018
3087
|
if (keys.length === pivotLength) {
|
|
3019
3088
|
const parentKeys = keys.slice(0, -1);
|
|
3020
3089
|
let columnGroupId = parentKeys.join("/");
|
|
3021
|
-
|
|
3090
|
+
const pivotByForColumn = pivotBy[keys.length - 1];
|
|
3091
|
+
let computedPivotColumn = __spreadValues({
|
|
3022
3092
|
pivotBy,
|
|
3023
3093
|
pivotColumn: true,
|
|
3024
3094
|
pivotGroupKeys: keys,
|
|
3095
|
+
pivotGroupKeyForColumn: keys[keys.length - 1],
|
|
3096
|
+
pivotIndexForColumn: keys.length - 1,
|
|
3097
|
+
pivotByForColumn,
|
|
3025
3098
|
sortable: false,
|
|
3026
3099
|
columnGroup: parentKeys.length ? `${columnGroupId}` : void 0,
|
|
3027
3100
|
header: keys[keys.length - 1],
|
|
@@ -3030,7 +3103,15 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
|
|
|
3030
3103
|
const value = (_c = (_b = (_a = rowInfo.pivotValuesMap) == null ? void 0 : _a.get(keys)) == null ? void 0 : _b.reducerResults[0]) != null ? _c : null;
|
|
3031
3104
|
return value;
|
|
3032
3105
|
}
|
|
3033
|
-
});
|
|
3106
|
+
}, pivotByForColumn.column);
|
|
3107
|
+
if (pivotByForColumn.column) {
|
|
3108
|
+
if (typeof pivotByForColumn.column === "function") {
|
|
3109
|
+
Object.assign(computedPivotColumn, pivotByForColumn.column({ column: computedPivotColumn }));
|
|
3110
|
+
} else {
|
|
3111
|
+
Object.assign(computedPivotColumn, pivotByForColumn.column);
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
columns.set(`${keys.join("/")}`, computedPivotColumn);
|
|
3034
3115
|
} else {
|
|
3035
3116
|
const colGroupId = keys.join("/");
|
|
3036
3117
|
const parentKeys = keys.slice(0, -1);
|
|
@@ -3039,11 +3120,15 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
|
|
|
3039
3120
|
header: keys.join(" >> ")
|
|
3040
3121
|
});
|
|
3041
3122
|
if (pivotTotalColumnPosition !== false) {
|
|
3042
|
-
|
|
3123
|
+
const pivotByForColumn = pivotBy[keys.length - 1];
|
|
3124
|
+
let computedPivotColumn = __spreadValues({
|
|
3043
3125
|
columnGroup: parentKeys.length ? parentKeys.join("/") : void 0,
|
|
3044
3126
|
header: `${keys.join("/")} total `,
|
|
3045
3127
|
pivotTotalColumn: true,
|
|
3046
3128
|
pivotGroupKeys: keys,
|
|
3129
|
+
pivotGroupKeyForColumn: keys[keys.length - 1],
|
|
3130
|
+
pivotByForColumn,
|
|
3131
|
+
pivotIndexForColumn: keys.length - 1,
|
|
3047
3132
|
pivotBy,
|
|
3048
3133
|
sortable: false,
|
|
3049
3134
|
valueGetter: ({ rowInfo }) => {
|
|
@@ -3051,7 +3136,15 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
|
|
|
3051
3136
|
const value = (_c = (_b = (_a = rowInfo.pivotValuesMap) == null ? void 0 : _a.get(keys)) == null ? void 0 : _b.reducerResults[0]) != null ? _c : null;
|
|
3052
3137
|
return value;
|
|
3053
3138
|
}
|
|
3054
|
-
});
|
|
3139
|
+
}, pivotByForColumn.column);
|
|
3140
|
+
if (pivotByForColumn.column) {
|
|
3141
|
+
if (typeof pivotByForColumn.column === "function") {
|
|
3142
|
+
Object.assign(computedPivotColumn, pivotByForColumn.column({ column: computedPivotColumn }));
|
|
3143
|
+
} else {
|
|
3144
|
+
Object.assign(computedPivotColumn, pivotByForColumn.column);
|
|
3145
|
+
}
|
|
3146
|
+
}
|
|
3147
|
+
columns.set(`${keys.join("/")}-total`, computedPivotColumn);
|
|
3055
3148
|
}
|
|
3056
3149
|
}
|
|
3057
3150
|
if (pivotTotalColumnPosition === "start" || pivotTotalColumnPosition === false) {
|
|
@@ -3479,7 +3572,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
3479
3572
|
columns.forEach((col, colId) => {
|
|
3480
3573
|
computedColumns.set(colId, col);
|
|
3481
3574
|
});
|
|
3482
|
-
return computedColumns;
|
|
3575
|
+
return computedColumns.size ? computedColumns : void 0;
|
|
3483
3576
|
}
|
|
3484
3577
|
|
|
3485
3578
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
@@ -3685,15 +3778,16 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
3685
3778
|
var VerticalScrollbarPlaceholder = memo2(VerticalScrollbarPlaceholderFn);
|
|
3686
3779
|
|
|
3687
3780
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
3688
|
-
var
|
|
3781
|
+
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
3782
|
+
var CellCls = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
|
|
3689
3783
|
var HeaderCellProxy = "_12zfob10";
|
|
3690
|
-
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"]] });
|
|
3691
|
-
var HeaderClsRecipe = createRuntimeFn({ defaultClassName: "_12zfob12
|
|
3692
|
-
var HeaderGroupCls = "
|
|
3693
|
-
var HeaderGroup_Children = "
|
|
3694
|
-
var HeaderGroup_Header = "_12zfob1x
|
|
3784
|
+
var HeaderCellRecipe = (0, import_createRuntimeFn2.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"]] });
|
|
3785
|
+
var HeaderClsRecipe = (0, import_createRuntimeFn2.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"]] });
|
|
3786
|
+
var HeaderGroupCls = "_16lm1iwz _16lm1iwj";
|
|
3787
|
+
var HeaderGroup_Children = "_16lm1iwj _16lm1iw10 _16lm1iw12 _16lm1iwc";
|
|
3788
|
+
var HeaderGroup_Header = "_12zfob1x _16lm1iwj _16lm1iw10 _16lm1iw11";
|
|
3695
3789
|
var HeaderSortIconCls = "_12zfob11 _16lm1iw1";
|
|
3696
|
-
var HeaderWrapperCls = "_12zfob1v
|
|
3790
|
+
var HeaderWrapperCls = "_12zfob1v _16lm1iw16 _16lm1iw1 _16lm1iwj _16lm1iw10";
|
|
3697
3791
|
|
|
3698
3792
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
3699
3793
|
import {
|
|
@@ -3724,9 +3818,10 @@ var useInfiniteTableState = () => {
|
|
|
3724
3818
|
};
|
|
3725
3819
|
|
|
3726
3820
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
3727
|
-
var
|
|
3821
|
+
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
3822
|
+
var CellCls2 = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
|
|
3728
3823
|
var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
|
|
3729
|
-
var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "_16lm1iw2
|
|
3824
|
+
var ColumnCellRecipe = (0, import_createRuntimeFn3.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"]] });
|
|
3730
3825
|
var columnAlignCellStyle = { center: "_1eexc2a0", start: "_1eexc2a1", end: "_1eexc2a2" };
|
|
3731
3826
|
|
|
3732
3827
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
@@ -4149,7 +4244,29 @@ import {
|
|
|
4149
4244
|
createElement as createElement14,
|
|
4150
4245
|
memo as memo5
|
|
4151
4246
|
} from "react";
|
|
4152
|
-
import {
|
|
4247
|
+
import { useEffect as useEffect11 } from "react";
|
|
4248
|
+
|
|
4249
|
+
// src/components/RawList/AvoidReactDiff.tsx
|
|
4250
|
+
import {
|
|
4251
|
+
Fragment as Fragment3,
|
|
4252
|
+
createElement as createElement12,
|
|
4253
|
+
memo as memo4
|
|
4254
|
+
} from "react";
|
|
4255
|
+
import { useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
|
|
4256
|
+
function AvoidReactDiffFn(props) {
|
|
4257
|
+
const [children, setChildren] = useState7(props.updater.get());
|
|
4258
|
+
useLayoutEffect4(() => {
|
|
4259
|
+
const remove = props.updater.onChange((children2) => {
|
|
4260
|
+
setChildren(children2);
|
|
4261
|
+
});
|
|
4262
|
+
return remove;
|
|
4263
|
+
}, [props.updater]);
|
|
4264
|
+
return /* @__PURE__ */ createElement12(Fragment3, null, children);
|
|
4265
|
+
}
|
|
4266
|
+
var AvoidReactDiff = memo4(AvoidReactDiffFn);
|
|
4267
|
+
|
|
4268
|
+
// src/components/RawList/useVirtualRenderer.ts
|
|
4269
|
+
import { useMemo as useMemo7 } from "react";
|
|
4153
4270
|
|
|
4154
4271
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
4155
4272
|
import {
|
|
@@ -4249,6 +4366,9 @@ var MappedItems = class extends Logger {
|
|
|
4249
4366
|
this.itemIndexToElementIndex = {};
|
|
4250
4367
|
this.renderedElements = {};
|
|
4251
4368
|
}
|
|
4369
|
+
reset() {
|
|
4370
|
+
this.init();
|
|
4371
|
+
}
|
|
4252
4372
|
destroy() {
|
|
4253
4373
|
this.init();
|
|
4254
4374
|
}
|
|
@@ -4268,25 +4388,6 @@ var MappedItems = class extends Logger {
|
|
|
4268
4388
|
}
|
|
4269
4389
|
};
|
|
4270
4390
|
|
|
4271
|
-
// src/components/RawList/AvoidReactDiff.tsx
|
|
4272
|
-
import {
|
|
4273
|
-
Fragment as Fragment3,
|
|
4274
|
-
createElement as createElement12,
|
|
4275
|
-
memo as memo4
|
|
4276
|
-
} from "react";
|
|
4277
|
-
import { useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
|
|
4278
|
-
function AvoidReactDiffFn(props) {
|
|
4279
|
-
const [children, setChildren] = useState7(props.updater.get());
|
|
4280
|
-
useLayoutEffect4(() => {
|
|
4281
|
-
const remove = props.updater.onChange((children2) => {
|
|
4282
|
-
setChildren(children2);
|
|
4283
|
-
});
|
|
4284
|
-
return remove;
|
|
4285
|
-
}, [props.updater]);
|
|
4286
|
-
return /* @__PURE__ */ createElement12(Fragment3, null, children);
|
|
4287
|
-
}
|
|
4288
|
-
var AvoidReactDiff = memo4(AvoidReactDiffFn);
|
|
4289
|
-
|
|
4290
4391
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
4291
4392
|
var ITEM_POSITION_WITH_TRANSFORM = true;
|
|
4292
4393
|
var ReactVirtualRenderer = class extends Logger {
|
|
@@ -4393,17 +4494,12 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4393
4494
|
}
|
|
4394
4495
|
};
|
|
4395
4496
|
this.destroy = () => {
|
|
4396
|
-
if (true) {
|
|
4397
|
-
return;
|
|
4398
|
-
}
|
|
4399
4497
|
this.destroyed = true;
|
|
4400
|
-
this.
|
|
4401
|
-
this.itemDOMElements = [];
|
|
4402
|
-
this.itemDOMRefs = [];
|
|
4403
|
-
this.updaters = [];
|
|
4498
|
+
this.reset();
|
|
4404
4499
|
this.onRender = null;
|
|
4405
4500
|
this.renderItem = null;
|
|
4406
4501
|
this.brain = null;
|
|
4502
|
+
this.mappedItems = null;
|
|
4407
4503
|
};
|
|
4408
4504
|
if (onRender) {
|
|
4409
4505
|
this.onRender = onRender;
|
|
@@ -4461,18 +4557,43 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4461
4557
|
itemUpdater(renderedNode);
|
|
4462
4558
|
this.updateElementPosition(elementIndex);
|
|
4463
4559
|
}
|
|
4560
|
+
reset() {
|
|
4561
|
+
this.itemDOMElements = {};
|
|
4562
|
+
this.itemDOMRefs = {};
|
|
4563
|
+
this.updaters = {};
|
|
4564
|
+
this.items = [];
|
|
4565
|
+
this.mappedItems.reset();
|
|
4566
|
+
}
|
|
4464
4567
|
};
|
|
4465
4568
|
|
|
4569
|
+
// src/components/RawList/useVirtualRenderer.ts
|
|
4570
|
+
function createRenderer(brain) {
|
|
4571
|
+
const renderer = new ReactVirtualRenderer(brain, {});
|
|
4572
|
+
const onRenderUpdater = buildSubscriptionCallback();
|
|
4573
|
+
brain.onDestroy(() => {
|
|
4574
|
+
renderer.destroy();
|
|
4575
|
+
onRenderUpdater.destroy();
|
|
4576
|
+
});
|
|
4577
|
+
return {
|
|
4578
|
+
renderer,
|
|
4579
|
+
onRenderUpdater
|
|
4580
|
+
};
|
|
4581
|
+
}
|
|
4582
|
+
function useVirtualRenderer({
|
|
4583
|
+
brain
|
|
4584
|
+
}) {
|
|
4585
|
+
return useMemo7(() => {
|
|
4586
|
+
return createRenderer(brain);
|
|
4587
|
+
}, [brain]);
|
|
4588
|
+
}
|
|
4589
|
+
|
|
4466
4590
|
// src/components/RawList/index.tsx
|
|
4467
4591
|
function RawListFn(props) {
|
|
4468
4592
|
const { renderItem, brain, debugChannel } = props;
|
|
4469
|
-
const { onRenderUpdater, renderer } =
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
});
|
|
4474
|
-
return { onRenderUpdater: onRenderUpdater2, renderer: renderer2 };
|
|
4475
|
-
}, []);
|
|
4593
|
+
const { onRenderUpdater, renderer } = useVirtualRenderer({
|
|
4594
|
+
brain,
|
|
4595
|
+
debugChannel
|
|
4596
|
+
});
|
|
4476
4597
|
const getRenderItem = useLatest(renderItem);
|
|
4477
4598
|
useEffect11(() => {
|
|
4478
4599
|
const renderRange = brain.getRenderRange();
|
|
@@ -4481,7 +4602,7 @@ function RawListFn(props) {
|
|
|
4481
4602
|
force: true,
|
|
4482
4603
|
onRender: onRenderUpdater
|
|
4483
4604
|
});
|
|
4484
|
-
}, [renderItem, onRenderUpdater]);
|
|
4605
|
+
}, [brain, renderItem, onRenderUpdater]);
|
|
4485
4606
|
useEffect11(() => {
|
|
4486
4607
|
const remove = brain.onRenderRangeChange((renderRange) => {
|
|
4487
4608
|
renderer.renderRange(renderRange, {
|
|
@@ -4492,12 +4613,6 @@ function RawListFn(props) {
|
|
|
4492
4613
|
});
|
|
4493
4614
|
return remove;
|
|
4494
4615
|
}, [brain, onRenderUpdater]);
|
|
4495
|
-
useEffect11(() => {
|
|
4496
|
-
return () => {
|
|
4497
|
-
renderer.destroy();
|
|
4498
|
-
onRenderUpdater.destroy();
|
|
4499
|
-
};
|
|
4500
|
-
}, [renderer, onRenderUpdater]);
|
|
4501
4616
|
return /* @__PURE__ */ createElement14(AvoidReactDiff, {
|
|
4502
4617
|
updater: onRenderUpdater
|
|
4503
4618
|
});
|
|
@@ -5117,7 +5232,7 @@ var VirtualList = (props) => {
|
|
|
5117
5232
|
brain: virtualBrain,
|
|
5118
5233
|
renderItem,
|
|
5119
5234
|
repaintId,
|
|
5120
|
-
debugChannel: "VirtualList"
|
|
5235
|
+
debugChannel: "VirtualList-" + mainAxis
|
|
5121
5236
|
})), children, /* @__PURE__ */ createElement22(SpacePlaceholder, {
|
|
5122
5237
|
count,
|
|
5123
5238
|
width,
|
|
@@ -5345,7 +5460,7 @@ function useRowDOMProps(props, rowProps, rowStyle, rowClassName, groupRenderStra
|
|
|
5345
5460
|
const rows = parentNode.querySelectorAll(hoverSelector.join(","));
|
|
5346
5461
|
rows.forEach((row) => row.classList.remove(InfiniteTableRowClassName__hover, RowHoverCls));
|
|
5347
5462
|
}, [initialMouseLeave, showHoverRows]);
|
|
5348
|
-
if (rowInfo.isGroupRow
|
|
5463
|
+
if (rowInfo.isGroupRow) {
|
|
5349
5464
|
style = style || {};
|
|
5350
5465
|
style[stripVar(ThemeVars.components.Row.groupNesting)] = rowInfo.groupNesting - 1;
|
|
5351
5466
|
}
|
|
@@ -5563,13 +5678,14 @@ function useUnpinnedRendering(params) {
|
|
|
5563
5678
|
import { useCallback as useCallback13, useEffect as useEffect16, useRef as useRef13 } from "react";
|
|
5564
5679
|
|
|
5565
5680
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
5681
|
+
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5566
5682
|
var FooterCls = "_16lm1iw1";
|
|
5567
|
-
var InfiniteCls = "_1yeub2v0 _16lm1iw1
|
|
5568
|
-
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: [] });
|
|
5683
|
+
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwj _16lm1iwz _16lm1iw0";
|
|
5684
|
+
var InfiniteClsRecipe = (0, import_createRuntimeFn4.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: [] });
|
|
5569
5685
|
var InfiniteClsScrolling = "_1yeub2v1";
|
|
5570
|
-
var InfiniteClsShiftingColumns = "
|
|
5686
|
+
var InfiniteClsShiftingColumns = "_16lm1iwm";
|
|
5571
5687
|
var PinnedRowsClsVariants = { pinnedStart: "_1yeub2ve", pinnedEnd: "_1yeub2vf", overflow: "_1yeub2vg" };
|
|
5572
|
-
var PinnedRowsContainerClsVariants = createRuntimeFn({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vh", end: "_1yeub2vi", false: "_1yeub2vj" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5688
|
+
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vh", end: "_1yeub2vi", false: "_1yeub2vj" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5573
5689
|
|
|
5574
5690
|
// src/components/InfiniteTable/hooks/useOnContainerScroll.ts
|
|
5575
5691
|
var DELAY = 200;
|
|
@@ -5693,7 +5809,7 @@ var rootClassName10 = InfiniteListRootClassName;
|
|
|
5693
5809
|
var defaultClasses = [
|
|
5694
5810
|
willChange.transform,
|
|
5695
5811
|
position.relative,
|
|
5696
|
-
|
|
5812
|
+
transform.translateZero
|
|
5697
5813
|
];
|
|
5698
5814
|
var RowListWithExternalScrolling = (props) => {
|
|
5699
5815
|
const {
|
|
@@ -5955,11 +6071,13 @@ var VirtualBrain = class extends Logger {
|
|
|
5955
6071
|
super(`VirtualBrain:${options.mainAxis}`);
|
|
5956
6072
|
this.scrollPosition = initialScrollPosition2;
|
|
5957
6073
|
this.scrollPositionOnMainAxis = 0;
|
|
6074
|
+
this.destroyed = false;
|
|
5958
6075
|
this.totalSize = 0;
|
|
5959
6076
|
this.onScrollFns = [];
|
|
5960
6077
|
this.onTotalSizeChangeFns = [];
|
|
5961
6078
|
this.onRenderCountChangeFns = [];
|
|
5962
6079
|
this.onRenderRangeChangeFns = [];
|
|
6080
|
+
this.onDestroyFns = [];
|
|
5963
6081
|
this.renderCount = 0;
|
|
5964
6082
|
this.renderRange = {
|
|
5965
6083
|
renderStartIndex: -1,
|
|
@@ -6056,6 +6174,12 @@ var VirtualBrain = class extends Logger {
|
|
|
6056
6174
|
this.onRenderRangeChangeFns = this.onRenderRangeChangeFns.filter((f) => f !== fn);
|
|
6057
6175
|
};
|
|
6058
6176
|
};
|
|
6177
|
+
this.onDestroy = (fn) => {
|
|
6178
|
+
this.onDestroyFns.push(fn);
|
|
6179
|
+
return () => {
|
|
6180
|
+
this.onDestroyFns = this.onDestroyFns.filter((f) => f !== fn);
|
|
6181
|
+
};
|
|
6182
|
+
};
|
|
6059
6183
|
this.update = (newCount, newItemSize, newItemSpan) => {
|
|
6060
6184
|
const { itemSize, count, itemSpan } = this.options;
|
|
6061
6185
|
const countChange = count !== newCount;
|
|
@@ -6252,7 +6376,13 @@ var VirtualBrain = class extends Logger {
|
|
|
6252
6376
|
return result;
|
|
6253
6377
|
};
|
|
6254
6378
|
this.destroy = () => {
|
|
6379
|
+
if (this.destroyed) {
|
|
6380
|
+
return;
|
|
6381
|
+
}
|
|
6382
|
+
this.notifyDestroy();
|
|
6255
6383
|
this.reset();
|
|
6384
|
+
this.destroyed = true;
|
|
6385
|
+
this.onDestroyFns = [];
|
|
6256
6386
|
this.onScrollFns = [];
|
|
6257
6387
|
this.onTotalSizeChangeFns = [];
|
|
6258
6388
|
this.onRenderCountChangeFns = [];
|
|
@@ -6288,6 +6418,12 @@ var VirtualBrain = class extends Logger {
|
|
|
6288
6418
|
fns[i](scrollPosition);
|
|
6289
6419
|
}
|
|
6290
6420
|
}
|
|
6421
|
+
notifyDestroy() {
|
|
6422
|
+
const fns = this.onDestroyFns;
|
|
6423
|
+
for (let i = 0, len = fns.length; i < len; i++) {
|
|
6424
|
+
fns[i]();
|
|
6425
|
+
}
|
|
6426
|
+
}
|
|
6291
6427
|
notifyTotalSizeChange() {
|
|
6292
6428
|
const totalSize = this.getTotalSize();
|
|
6293
6429
|
const fns = this.onTotalSizeChangeFns;
|
|
@@ -6398,9 +6534,14 @@ function useYourBrain(param) {
|
|
|
6398
6534
|
});
|
|
6399
6535
|
return brain;
|
|
6400
6536
|
});
|
|
6537
|
+
useEffect19(() => {
|
|
6538
|
+
return () => {
|
|
6539
|
+
horizontalVirtualBrain.destroy();
|
|
6540
|
+
verticalVirtualBrain.destroy();
|
|
6541
|
+
};
|
|
6542
|
+
}, []);
|
|
6401
6543
|
horizontalVirtualBrain.update(computedUnpinnedColumns.length, columnSize);
|
|
6402
6544
|
verticalVirtualBrain.update(dataArray.length, rowHeight, rowSpan);
|
|
6403
|
-
globalThis.verticalVirtualBrain = verticalVirtualBrain;
|
|
6404
6545
|
useEffect19(() => {
|
|
6405
6546
|
verticalVirtualBrain.setAvailableSize({
|
|
6406
6547
|
height: bodySize.height,
|
|
@@ -6836,7 +6977,7 @@ var useLicense = (licenseKey) => {
|
|
|
6836
6977
|
const valid = useMemo11(() => {
|
|
6837
6978
|
let valid2 = isValidLicense(licenseKey, {
|
|
6838
6979
|
publishedAt: 1624970570587,
|
|
6839
|
-
version: "0.0.
|
|
6980
|
+
version: "0.0.7"
|
|
6840
6981
|
});
|
|
6841
6982
|
if (!licenseKey && !valid2 && isInsideSandbox) {
|
|
6842
6983
|
return true;
|
|
@@ -6992,8 +7133,8 @@ import {
|
|
|
6992
7133
|
} from "react";
|
|
6993
7134
|
|
|
6994
7135
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
6995
|
-
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2
|
|
6996
|
-
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2
|
|
7136
|
+
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv" };
|
|
7137
|
+
var LoadMaskOverlayCls = "qy58ya3 _16lm1iw2 _16lm1iwr _16lm1iwt _16lm1iwx _16lm1iwv";
|
|
6997
7138
|
var LoadMaskTextCls = "qy58ya4";
|
|
6998
7139
|
|
|
6999
7140
|
// src/components/InfiniteTable/components/LoadMask.tsx
|