@infinite-table/infinite-react 0.0.4 → 0.0.8
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/README.md +11 -71
- package/index.css +0 -3
- package/index.d.ts +194 -110
- package/index.esm.js +505 -268
- package/index.js +565 -328
- package/package.json +2 -2
- 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;
|
|
@@ -465,14 +477,14 @@ var require_browser = __commonJS({
|
|
|
465
477
|
} else {
|
|
466
478
|
exports.storage.removeItem("debug");
|
|
467
479
|
}
|
|
468
|
-
} catch (
|
|
480
|
+
} catch (error2) {
|
|
469
481
|
}
|
|
470
482
|
}
|
|
471
483
|
function load() {
|
|
472
484
|
let r;
|
|
473
485
|
try {
|
|
474
486
|
r = exports.storage.getItem("debug");
|
|
475
|
-
} catch (
|
|
487
|
+
} catch (error2) {
|
|
476
488
|
}
|
|
477
489
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
478
490
|
r = process.env.DEBUG;
|
|
@@ -482,7 +494,7 @@ var require_browser = __commonJS({
|
|
|
482
494
|
function localstorage() {
|
|
483
495
|
try {
|
|
484
496
|
return localStorage;
|
|
485
|
-
} catch (
|
|
497
|
+
} catch (error2) {
|
|
486
498
|
}
|
|
487
499
|
}
|
|
488
500
|
module.exports = require_common()(exports);
|
|
@@ -490,10 +502,103 @@ var require_browser = __commonJS({
|
|
|
490
502
|
formatters.j = function(v) {
|
|
491
503
|
try {
|
|
492
504
|
return JSON.stringify(v);
|
|
493
|
-
} catch (
|
|
494
|
-
return "[UnexpectedJSONParseError]: " +
|
|
505
|
+
} catch (error2) {
|
|
506
|
+
return "[UnexpectedJSONParseError]: " + error2.message;
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
});
|
|
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
|
+
}
|
|
495
586
|
}
|
|
587
|
+
return className;
|
|
496
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
|
+
}
|
|
497
602
|
}
|
|
498
603
|
});
|
|
499
604
|
|
|
@@ -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
|
});
|
|
@@ -672,6 +777,15 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
672
777
|
}
|
|
673
778
|
|
|
674
779
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
780
|
+
function toMap(mapOrObject) {
|
|
781
|
+
if (!mapOrObject) {
|
|
782
|
+
return new Map();
|
|
783
|
+
}
|
|
784
|
+
if (mapOrObject instanceof Map) {
|
|
785
|
+
return mapOrObject;
|
|
786
|
+
}
|
|
787
|
+
return new Map(Object.entries(mapOrObject));
|
|
788
|
+
}
|
|
675
789
|
function initSetupState() {
|
|
676
790
|
const columnsGeneratedForGrouping = new Map();
|
|
677
791
|
return {
|
|
@@ -701,7 +815,10 @@ function initSetupState() {
|
|
|
701
815
|
}
|
|
702
816
|
var forwardProps = () => {
|
|
703
817
|
return {
|
|
704
|
-
columns:
|
|
818
|
+
columns: (columns) => {
|
|
819
|
+
var _a;
|
|
820
|
+
return (_a = toMap(columns)) != null ? _a : new Map();
|
|
821
|
+
},
|
|
705
822
|
components: 1,
|
|
706
823
|
loadingText: 1,
|
|
707
824
|
pivotColumns: 1,
|
|
@@ -727,15 +844,16 @@ var forwardProps = () => {
|
|
|
727
844
|
pivotColumn: 1,
|
|
728
845
|
pivotRowLabelsColumn: 1,
|
|
729
846
|
pivotColumnGroups: 1,
|
|
847
|
+
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
730
848
|
activeIndex: (activeIndex) => activeIndex != null ? activeIndex : 0,
|
|
731
849
|
columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
|
|
732
850
|
columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 2e3,
|
|
733
|
-
columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth :
|
|
851
|
+
columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
|
|
734
852
|
draggableColumns: (draggableColumns) => draggableColumns != null ? draggableColumns : true,
|
|
735
853
|
sortable: (sortable) => sortable != null ? sortable : true,
|
|
736
854
|
hideEmptyGroupColumns: (hideEmptyGroupColumns) => hideEmptyGroupColumns != null ? hideEmptyGroupColumns : false,
|
|
737
855
|
pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
|
|
738
|
-
licenseKey: (licenseKey) => licenseKey ||
|
|
856
|
+
licenseKey: (licenseKey) => licenseKey || "",
|
|
739
857
|
columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
|
|
740
858
|
header: (header) => header != null ? header : true,
|
|
741
859
|
showZebraRows: (showZebraRows) => showZebraRows != null ? showZebraRows : true,
|
|
@@ -745,6 +863,14 @@ var forwardProps = () => {
|
|
|
745
863
|
headerHeight: (headerHeight) => typeof headerHeight === "number" ? headerHeight : 0,
|
|
746
864
|
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : new Map(),
|
|
747
865
|
columnPinning: (columnPinning) => columnPinning != null ? columnPinning : new Map(),
|
|
866
|
+
columnSizing: (columnSizing) => {
|
|
867
|
+
var _a;
|
|
868
|
+
return (_a = toMap(columnSizing)) != null ? _a : new Map();
|
|
869
|
+
},
|
|
870
|
+
columnTypes: (columnTypes) => {
|
|
871
|
+
var _a;
|
|
872
|
+
return (_a = toMap(columnTypes)) != null ? _a : new Map();
|
|
873
|
+
},
|
|
748
874
|
columnAggregations: (columnAggregations) => columnAggregations != null ? columnAggregations : new Map(),
|
|
749
875
|
collapsedColumnGroups: (collapsedColumnGroups) => collapsedColumnGroups != null ? collapsedColumnGroups : new Map(),
|
|
750
876
|
columnGroups: (columnGroups) => columnGroups != null ? columnGroups : new Map()
|
|
@@ -779,7 +905,7 @@ var mapPropsToState = (params) => {
|
|
|
779
905
|
return {
|
|
780
906
|
groupRenderStrategy,
|
|
781
907
|
groupRowsBy,
|
|
782
|
-
computedColumns: state.computedPivotColumns || state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy ||
|
|
908
|
+
computedColumns: state.computedPivotColumns || state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns,
|
|
783
909
|
virtualizeHeader,
|
|
784
910
|
columnGroupsDepthsMap,
|
|
785
911
|
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
|
|
@@ -919,7 +1045,7 @@ var computeFlex = (params) => {
|
|
|
919
1045
|
items.forEach((item, i) => {
|
|
920
1046
|
var _a, _b, _c, _d, _e, _f;
|
|
921
1047
|
let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
|
|
922
|
-
let minSize = (_d = (_c = item.
|
|
1048
|
+
let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
|
|
923
1049
|
if (item.size != null) {
|
|
924
1050
|
if (maxSize != null && item.size > maxSize) {
|
|
925
1051
|
item.size = maxSize;
|
|
@@ -947,7 +1073,7 @@ var computeFlex = (params) => {
|
|
|
947
1073
|
if (item.flex != null) {
|
|
948
1074
|
const approxFlexSize = sizePerFlex * item.flex;
|
|
949
1075
|
let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
|
|
950
|
-
let minSize = (_d = (_c = item.
|
|
1076
|
+
let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
|
|
951
1077
|
let constrained = false;
|
|
952
1078
|
let substractSize = 0;
|
|
953
1079
|
if (maxSize != null && approxFlexSize > maxSize) {
|
|
@@ -1082,8 +1208,52 @@ var Logger = class {
|
|
|
1082
1208
|
}
|
|
1083
1209
|
};
|
|
1084
1210
|
|
|
1211
|
+
// src/utils/getGlobal.ts
|
|
1212
|
+
function getGlobal() {
|
|
1213
|
+
return globalThis;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
// src/components/utils/getScrollbarWidth.ts
|
|
1217
|
+
var scrollbarWidth;
|
|
1218
|
+
function getScrollbarWidth() {
|
|
1219
|
+
var _a, _b;
|
|
1220
|
+
if (scrollbarWidth != null) {
|
|
1221
|
+
return scrollbarWidth;
|
|
1222
|
+
}
|
|
1223
|
+
const doc = (_a = getGlobal().document) != null ? _a : null;
|
|
1224
|
+
if (!doc) {
|
|
1225
|
+
return 0;
|
|
1226
|
+
}
|
|
1227
|
+
const outer = doc.createElement("div");
|
|
1228
|
+
outer.style.visibility = "hidden";
|
|
1229
|
+
outer.style.overflow = "scroll";
|
|
1230
|
+
doc.body.appendChild(outer);
|
|
1231
|
+
const inner = doc.createElement("div");
|
|
1232
|
+
outer.appendChild(inner);
|
|
1233
|
+
scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
|
|
1234
|
+
(_b = outer.parentNode) == null ? void 0 : _b.removeChild(outer);
|
|
1235
|
+
return scrollbarWidth;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
// src/components/InfiniteTable/utils/getColumnComputedType.ts
|
|
1239
|
+
var emptyType = Object.freeze({});
|
|
1240
|
+
function getColumnComputedType(column, columnTypes) {
|
|
1241
|
+
const defaultType = columnTypes.get("default") || emptyType;
|
|
1242
|
+
if (column.type === void 0) {
|
|
1243
|
+
return defaultType;
|
|
1244
|
+
}
|
|
1245
|
+
if (column.type === null) {
|
|
1246
|
+
return emptyType;
|
|
1247
|
+
}
|
|
1248
|
+
if (typeof column.type === "string") {
|
|
1249
|
+
const type = columnTypes.get(column.type) || emptyType;
|
|
1250
|
+
return type;
|
|
1251
|
+
}
|
|
1252
|
+
return column.type.reduce((acc, columnType) => Object.assign(acc, columnTypes.get(columnType)), {});
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1085
1255
|
// src/components/InfiniteTable/utils/getComputedVisibleColumns.ts
|
|
1086
|
-
var
|
|
1256
|
+
var logError = err("getComputedVisibleColumns");
|
|
1087
1257
|
var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId) => {
|
|
1088
1258
|
return !columnVisibility.has(colId) || columnVisibility.get(colId) !== false;
|
|
1089
1259
|
};
|
|
@@ -1104,22 +1274,26 @@ var getComputedVisibleColumns = ({
|
|
|
1104
1274
|
sortInfo,
|
|
1105
1275
|
setSortInfo,
|
|
1106
1276
|
multiSort,
|
|
1277
|
+
viewportReservedWidth,
|
|
1107
1278
|
draggableColumns,
|
|
1108
1279
|
columnOrder,
|
|
1109
1280
|
columnPinning,
|
|
1281
|
+
columnSizing,
|
|
1282
|
+
columnTypes,
|
|
1110
1283
|
columnVisibility,
|
|
1111
1284
|
columnVisibilityAssumeVisible
|
|
1112
1285
|
}) => {
|
|
1113
1286
|
let computedOffset = 0;
|
|
1114
1287
|
const normalizedColumnOrder = adjustColumnOrderForPinning(columnOrder === true ? [...columns.keys()] : columnOrder, columnPinning);
|
|
1115
|
-
const visibleColumnOrder = normalizedColumnOrder.filter(
|
|
1116
|
-
|
|
1117
|
-
let col = columns.get(columnId);
|
|
1288
|
+
const visibleColumnOrder = normalizedColumnOrder.filter((colId) => {
|
|
1289
|
+
let col = columns.get(colId);
|
|
1118
1290
|
if (!col) {
|
|
1119
|
-
|
|
1291
|
+
logError(`Column with id "${colId}" specified in columnOrder array cannot be found in the columns map.`);
|
|
1292
|
+
return false;
|
|
1120
1293
|
}
|
|
1121
|
-
return
|
|
1122
|
-
})
|
|
1294
|
+
return isColumnVisible(columnVisibility, columnVisibilityAssumeVisible, colId);
|
|
1295
|
+
});
|
|
1296
|
+
const columnsArray = visibleColumnOrder.map((columnId) => columns.get(columnId)).filter(Boolean);
|
|
1123
1297
|
const sortedMap = (sortInfo != null ? sortInfo : []).reduce((acc, info, index) => {
|
|
1124
1298
|
if (info.id) {
|
|
1125
1299
|
acc[info.id] = { sortInfo: info, index };
|
|
@@ -1133,20 +1307,39 @@ var getComputedVisibleColumns = ({
|
|
|
1133
1307
|
return acc;
|
|
1134
1308
|
}, {});
|
|
1135
1309
|
const flexResult = computeFlex({
|
|
1136
|
-
availableSize: bodySize.width,
|
|
1310
|
+
availableSize: Math.max(bodySize.width - (viewportReservedWidth != null ? viewportReservedWidth : 0) - getScrollbarWidth(), 0),
|
|
1137
1311
|
maxSize: columnMaxWidth,
|
|
1138
1312
|
minSize: columnMinWidth,
|
|
1139
|
-
items:
|
|
1140
|
-
var _a, _b;
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1313
|
+
items: visibleColumnOrder.map((colId) => {
|
|
1314
|
+
var _a, _b, _c, _d;
|
|
1315
|
+
const column = columns.get(colId);
|
|
1316
|
+
const colType = getColumnComputedType(column, columnTypes);
|
|
1317
|
+
const colTypeSizing = {
|
|
1318
|
+
minWidth: colType == null ? void 0 : colType.minWidth,
|
|
1319
|
+
maxWidth: colType == null ? void 0 : colType.maxWidth,
|
|
1320
|
+
width: colType == null ? void 0 : colType.width,
|
|
1321
|
+
flex: colType == null ? void 0 : colType.flex
|
|
1322
|
+
};
|
|
1323
|
+
let colSizing = columnSizing.get(colId) || {};
|
|
1324
|
+
if (colSizing.width != null) {
|
|
1325
|
+
delete colTypeSizing.flex;
|
|
1326
|
+
}
|
|
1327
|
+
if (colSizing.flex != null) {
|
|
1328
|
+
delete colTypeSizing.width;
|
|
1329
|
+
}
|
|
1330
|
+
colSizing = Object.assign(colTypeSizing, colSizing);
|
|
1331
|
+
let colFlex = (_a = colSizing.flex) != null ? _a : void 0;
|
|
1332
|
+
const colMinWidth = (_b = colSizing.minWidth) != null ? _b : columnMinWidth;
|
|
1333
|
+
const colMaxWidth = (_c = colSizing.maxWidth) != null ? _c : columnMaxWidth;
|
|
1334
|
+
let size = colFlex != void 0 ? void 0 : (_d = colSizing.width) != null ? _d : columnDefaultWidth;
|
|
1335
|
+
if (!size && colFlex == void 0) {
|
|
1336
|
+
size = colMinWidth;
|
|
1144
1337
|
}
|
|
1145
1338
|
return {
|
|
1146
1339
|
size,
|
|
1147
|
-
flex:
|
|
1148
|
-
minSize:
|
|
1149
|
-
maxSize:
|
|
1340
|
+
flex: colFlex,
|
|
1341
|
+
minSize: colMinWidth,
|
|
1342
|
+
maxSize: colMaxWidth
|
|
1150
1343
|
};
|
|
1151
1344
|
})
|
|
1152
1345
|
});
|
|
@@ -1181,6 +1374,7 @@ var getComputedVisibleColumns = ({
|
|
|
1181
1374
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1182
1375
|
const id = visibleColumnOrder[i];
|
|
1183
1376
|
const nextColumnId = visibleColumnOrder[i + 1];
|
|
1377
|
+
const colType = getColumnComputedType(c, columnTypes);
|
|
1184
1378
|
const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
|
|
1185
1379
|
const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
|
|
1186
1380
|
const computedSorted = !!computedSortInfo;
|
|
@@ -1236,8 +1430,10 @@ var getComputedVisibleColumns = ({
|
|
|
1236
1430
|
const computedFirstInCategory = computedPinned !== prevPinned;
|
|
1237
1431
|
const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
|
|
1238
1432
|
const result2 = __spreadProps(__spreadValues({
|
|
1239
|
-
align:
|
|
1240
|
-
verticalAlign:
|
|
1433
|
+
align: colType.align,
|
|
1434
|
+
verticalAlign: colType.verticalAlign,
|
|
1435
|
+
renderValue: colType.renderValue,
|
|
1436
|
+
render: colType.render
|
|
1241
1437
|
}, c), {
|
|
1242
1438
|
computedWidth,
|
|
1243
1439
|
computedAbsoluteOffset,
|
|
@@ -1399,11 +1595,16 @@ var useComputedVisibleColumns = ({
|
|
|
1399
1595
|
setSortInfo,
|
|
1400
1596
|
columnOrder,
|
|
1401
1597
|
columnPinning,
|
|
1598
|
+
columnTypes,
|
|
1402
1599
|
pinnedEndMaxWidth,
|
|
1403
1600
|
pinnedStartMaxWidth,
|
|
1601
|
+
viewportReservedWidth,
|
|
1404
1602
|
columnVisibility,
|
|
1405
|
-
columnVisibilityAssumeVisible
|
|
1603
|
+
columnVisibilityAssumeVisible,
|
|
1604
|
+
columnSizing
|
|
1406
1605
|
}) => {
|
|
1606
|
+
const columnsSizingRenderId = useRerenderOnKeyChange(columnSizing);
|
|
1607
|
+
const columnTypesRenderId = useRerenderOnKeyChange(columnTypes);
|
|
1407
1608
|
const columnsRenderId = useRerenderOnKeyChange(columns);
|
|
1408
1609
|
const visibilityRenderId = useRerenderOnKeyChange(columnVisibility);
|
|
1409
1610
|
const pinningRenderId = useRerenderOnKeyChange(columnPinning);
|
|
@@ -1429,6 +1630,7 @@ var useComputedVisibleColumns = ({
|
|
|
1429
1630
|
columnMinWidth,
|
|
1430
1631
|
columnMaxWidth,
|
|
1431
1632
|
columnDefaultWidth,
|
|
1633
|
+
viewportReservedWidth,
|
|
1432
1634
|
sortable,
|
|
1433
1635
|
sortInfo,
|
|
1434
1636
|
setSortInfo,
|
|
@@ -1438,6 +1640,8 @@ var useComputedVisibleColumns = ({
|
|
|
1438
1640
|
draggableColumns,
|
|
1439
1641
|
columnOrder,
|
|
1440
1642
|
columnPinning,
|
|
1643
|
+
columnSizing,
|
|
1644
|
+
columnTypes,
|
|
1441
1645
|
columnVisibility,
|
|
1442
1646
|
columnVisibilityAssumeVisible: columnVisibilityAssumeVisible != null ? columnVisibilityAssumeVisible : true
|
|
1443
1647
|
});
|
|
@@ -1459,7 +1663,9 @@ var useComputedVisibleColumns = ({
|
|
|
1459
1663
|
columnPinning,
|
|
1460
1664
|
columnsRenderId,
|
|
1461
1665
|
visibilityRenderId,
|
|
1462
|
-
|
|
1666
|
+
columnsSizingRenderId,
|
|
1667
|
+
pinningRenderId,
|
|
1668
|
+
columnTypesRenderId
|
|
1463
1669
|
]);
|
|
1464
1670
|
const result = {
|
|
1465
1671
|
columns,
|
|
@@ -1967,43 +2173,10 @@ function ExpanderIcon(props) {
|
|
|
1967
2173
|
}));
|
|
1968
2174
|
}
|
|
1969
2175
|
|
|
1970
|
-
// node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
|
|
1971
|
-
var shouldApplyCompound = (compoundCheck, selections) => {
|
|
1972
|
-
for (const key of Object.keys(compoundCheck)) {
|
|
1973
|
-
if (compoundCheck[key] !== selections[key]) {
|
|
1974
|
-
return false;
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
return true;
|
|
1978
|
-
};
|
|
1979
|
-
var createRuntimeFn = (config) => (options) => {
|
|
1980
|
-
let className = config.defaultClassName;
|
|
1981
|
-
const selections = {
|
|
1982
|
-
...config.defaultVariants,
|
|
1983
|
-
...options
|
|
1984
|
-
};
|
|
1985
|
-
for (const variantName in selections) {
|
|
1986
|
-
var _selections$variantNa;
|
|
1987
|
-
const variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
1988
|
-
if (variantSelection != null) {
|
|
1989
|
-
let selection = variantSelection;
|
|
1990
|
-
if (typeof selection === "boolean") {
|
|
1991
|
-
selection = selection === true ? "true" : "false";
|
|
1992
|
-
}
|
|
1993
|
-
className += " " + config.variantClassNames[variantName][selection];
|
|
1994
|
-
}
|
|
1995
|
-
}
|
|
1996
|
-
for (const [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
1997
|
-
if (shouldApplyCompound(compoundCheck, selections)) {
|
|
1998
|
-
className += " " + compoundClassName;
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
|
-
return className;
|
|
2002
|
-
};
|
|
2003
|
-
|
|
2004
2176
|
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
2177
|
+
var import_createRuntimeFn = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
2005
2178
|
var GroupRowExpanderCls = "_7pupv0b";
|
|
2006
|
-
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: [] });
|
|
2179
|
+
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: [] });
|
|
2007
2180
|
var RowHoverCls = "_7pupv01";
|
|
2008
2181
|
|
|
2009
2182
|
// src/components/InfiniteTable/state/getComputedPivotColumnsFromDataSourcePivotColumns.tsx
|
|
@@ -2025,48 +2198,51 @@ function getComputedPivotColumnsFromDataSourcePivotColumns(pivotColumns, params)
|
|
|
2025
2198
|
return;
|
|
2026
2199
|
}
|
|
2027
2200
|
let column = __spreadValues({}, col);
|
|
2028
|
-
if (pivotColumn) {
|
|
2029
|
-
if (typeof pivotColumn === "function") {
|
|
2030
|
-
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
2031
|
-
column,
|
|
2032
|
-
pivotBy,
|
|
2033
|
-
groupRowsBy
|
|
2034
|
-
}));
|
|
2035
|
-
} else {
|
|
2036
|
-
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
2037
|
-
}
|
|
2038
|
-
}
|
|
2039
2201
|
const isPivotRowLabelsColumn = !column.pivotColumn && !column.pivotTotalColumn;
|
|
2040
|
-
if (
|
|
2041
|
-
if (
|
|
2042
|
-
|
|
2043
|
-
column,
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2202
|
+
if (!isPivotRowLabelsColumn) {
|
|
2203
|
+
if (pivotColumn) {
|
|
2204
|
+
if (typeof pivotColumn === "function") {
|
|
2205
|
+
column = __spreadValues(__spreadValues({}, column), pivotColumn({
|
|
2206
|
+
column,
|
|
2207
|
+
pivotBy,
|
|
2208
|
+
groupRowsBy
|
|
2209
|
+
}));
|
|
2210
|
+
} else {
|
|
2211
|
+
column = __spreadValues(__spreadValues({}, column), pivotColumn);
|
|
2212
|
+
}
|
|
2049
2213
|
}
|
|
2050
|
-
}
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2214
|
+
} else {
|
|
2215
|
+
if (pivotRowLabelsColumn) {
|
|
2216
|
+
if (typeof pivotRowLabelsColumn === "function") {
|
|
2217
|
+
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn({
|
|
2218
|
+
column,
|
|
2219
|
+
pivotBy,
|
|
2220
|
+
groupRowsBy
|
|
2221
|
+
}));
|
|
2222
|
+
} else {
|
|
2223
|
+
column = __spreadValues(__spreadValues({}, column), pivotRowLabelsColumn);
|
|
2057
2224
|
}
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2225
|
+
}
|
|
2226
|
+
if (!column.render) {
|
|
2227
|
+
column.render = (renderOptions) => {
|
|
2228
|
+
var _a;
|
|
2229
|
+
let { value, rowInfo, column: column2, groupRowsBy: groupRowsBy2 } = renderOptions;
|
|
2230
|
+
if (column2.renderValue) {
|
|
2231
|
+
value = column2.renderValue(renderOptions);
|
|
2065
2232
|
}
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2233
|
+
const showExpanderIcon = (((_a = rowInfo.groupKeys) == null ? void 0 : _a.length) || 0) < groupRowsBy2.length;
|
|
2234
|
+
return /* @__PURE__ */ createElement4("div", {
|
|
2235
|
+
className: join(display.flex, alignItems.center, GroupRowExpanderCls)
|
|
2236
|
+
}, showExpanderIcon ? /* @__PURE__ */ createElement4(ExpanderIcon, {
|
|
2237
|
+
expanded: !rowInfo.collapsed,
|
|
2238
|
+
onChange: () => {
|
|
2239
|
+
toggleGroupRow(rowInfo.groupKeys);
|
|
2240
|
+
}
|
|
2241
|
+
}) : null, /* @__PURE__ */ createElement4("div", {
|
|
2242
|
+
className: cssEllipsisClassName
|
|
2243
|
+
}, value != null ? value : null));
|
|
2244
|
+
};
|
|
2245
|
+
}
|
|
2070
2246
|
}
|
|
2071
2247
|
if (!column.render && column.renderValue) {
|
|
2072
2248
|
column.render = (renderOptions) => {
|
|
@@ -2685,78 +2861,6 @@ function mapPropsToState2(params) {
|
|
|
2685
2861
|
};
|
|
2686
2862
|
}
|
|
2687
2863
|
|
|
2688
|
-
// src/utils/multisort/sortTypes.ts
|
|
2689
|
-
var sortTypes = {
|
|
2690
|
-
number: function(first, second) {
|
|
2691
|
-
return first - second;
|
|
2692
|
-
},
|
|
2693
|
-
string: function(first, second) {
|
|
2694
|
-
first = `${first}`;
|
|
2695
|
-
second = `${second}`;
|
|
2696
|
-
return first.localeCompare(second);
|
|
2697
|
-
}
|
|
2698
|
-
};
|
|
2699
|
-
var sortTypes_default = sortTypes;
|
|
2700
|
-
|
|
2701
|
-
// src/utils/multisort/index.ts
|
|
2702
|
-
var multisort = (sortInfo, array, get) => {
|
|
2703
|
-
array.sort(getMultisortFunction(sortInfo, get));
|
|
2704
|
-
return array;
|
|
2705
|
-
};
|
|
2706
|
-
multisort.knownTypes = sortTypes_default;
|
|
2707
|
-
var getSingleSortFunction = (info) => {
|
|
2708
|
-
if (!info) {
|
|
2709
|
-
return;
|
|
2710
|
-
}
|
|
2711
|
-
const field = info.field;
|
|
2712
|
-
var dir = info.dir < 0 ? -1 : info.dir > 0 ? 1 : 0;
|
|
2713
|
-
if (!dir) {
|
|
2714
|
-
return;
|
|
2715
|
-
}
|
|
2716
|
-
let fn = info.fn;
|
|
2717
|
-
if (!fn && info.type) {
|
|
2718
|
-
fn = multisort.knownTypes[info.type];
|
|
2719
|
-
if (!fn) {
|
|
2720
|
-
console.warn(`Unknown sort type "${info.type}" - please pass one of ${Object.keys(multisort.knownTypes).join(", ")}`);
|
|
2721
|
-
}
|
|
2722
|
-
}
|
|
2723
|
-
if (!fn) {
|
|
2724
|
-
fn = sortTypes_default.string;
|
|
2725
|
-
}
|
|
2726
|
-
return (first, second) => {
|
|
2727
|
-
const a = field ? first[field] : first;
|
|
2728
|
-
const b = field ? second[field] : second;
|
|
2729
|
-
return dir * fn(a, b);
|
|
2730
|
-
};
|
|
2731
|
-
};
|
|
2732
|
-
var getSortFunctions = (sortInfo) => {
|
|
2733
|
-
return sortInfo.map(getSingleSortFunction).filter((fn) => fn instanceof Function);
|
|
2734
|
-
};
|
|
2735
|
-
var getMultisortFunction = (sortInfo, get) => {
|
|
2736
|
-
const fns = getSortFunctions(sortInfo);
|
|
2737
|
-
return (first, second) => {
|
|
2738
|
-
if (get) {
|
|
2739
|
-
first = get(first);
|
|
2740
|
-
second = get(second);
|
|
2741
|
-
}
|
|
2742
|
-
let result = 0;
|
|
2743
|
-
let i = 0;
|
|
2744
|
-
let fn;
|
|
2745
|
-
const len = fns.length;
|
|
2746
|
-
for (; i < len; i++) {
|
|
2747
|
-
fn = fns[i];
|
|
2748
|
-
if (!fn) {
|
|
2749
|
-
continue;
|
|
2750
|
-
}
|
|
2751
|
-
result = fn(first, second);
|
|
2752
|
-
if (result !== 0) {
|
|
2753
|
-
return result;
|
|
2754
|
-
}
|
|
2755
|
-
}
|
|
2756
|
-
return result;
|
|
2757
|
-
};
|
|
2758
|
-
};
|
|
2759
|
-
|
|
2760
2864
|
// src/utils/groupAndPivot/index.ts
|
|
2761
2865
|
function DEFAULT_TO_KEY(value) {
|
|
2762
2866
|
return value;
|
|
@@ -2986,6 +3090,82 @@ function enhancedFlatten(param) {
|
|
|
2986
3090
|
data: result
|
|
2987
3091
|
};
|
|
2988
3092
|
}
|
|
3093
|
+
|
|
3094
|
+
// src/utils/multisort/sortTypes.ts
|
|
3095
|
+
var numberComparator = function(first, second) {
|
|
3096
|
+
return first - second;
|
|
3097
|
+
};
|
|
3098
|
+
var stringComparator = function(first, second) {
|
|
3099
|
+
first = `${first}`;
|
|
3100
|
+
second = `${second}`;
|
|
3101
|
+
return first.localeCompare(second);
|
|
3102
|
+
};
|
|
3103
|
+
var sortTypes = {
|
|
3104
|
+
number: numberComparator,
|
|
3105
|
+
string: stringComparator
|
|
3106
|
+
};
|
|
3107
|
+
var sortTypes_default = sortTypes;
|
|
3108
|
+
|
|
3109
|
+
// src/utils/multisort/index.ts
|
|
3110
|
+
var multisort = (sortInfo, array, get) => {
|
|
3111
|
+
array.sort(getMultisortFunction(sortInfo, get));
|
|
3112
|
+
return array;
|
|
3113
|
+
};
|
|
3114
|
+
multisort.knownTypes = sortTypes_default;
|
|
3115
|
+
var getSingleSortFunction = (info) => {
|
|
3116
|
+
if (!info) {
|
|
3117
|
+
return;
|
|
3118
|
+
}
|
|
3119
|
+
const field = info.field;
|
|
3120
|
+
var dir = info.dir < 0 ? -1 : info.dir > 0 ? 1 : 0;
|
|
3121
|
+
if (!dir) {
|
|
3122
|
+
return;
|
|
3123
|
+
}
|
|
3124
|
+
let fn = info.fn;
|
|
3125
|
+
if (!fn && info.type) {
|
|
3126
|
+
fn = multisort.knownTypes[info.type];
|
|
3127
|
+
if (!fn) {
|
|
3128
|
+
console.warn(`Unknown sort type "${info.type}" - please pass one of ${Object.keys(multisort.knownTypes).join(", ")}`);
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
if (!fn) {
|
|
3132
|
+
fn = sortTypes_default.string;
|
|
3133
|
+
}
|
|
3134
|
+
return (first, second) => {
|
|
3135
|
+
const a = field ? first[field] : first;
|
|
3136
|
+
const b = field ? second[field] : second;
|
|
3137
|
+
return dir * fn(a, b);
|
|
3138
|
+
};
|
|
3139
|
+
};
|
|
3140
|
+
var getSortFunctions = (sortInfo) => {
|
|
3141
|
+
return sortInfo.map(getSingleSortFunction).filter((fn) => fn instanceof Function);
|
|
3142
|
+
};
|
|
3143
|
+
var getMultisortFunction = (sortInfo, get) => {
|
|
3144
|
+
const fns = getSortFunctions(sortInfo);
|
|
3145
|
+
return (first, second) => {
|
|
3146
|
+
if (get) {
|
|
3147
|
+
first = get(first);
|
|
3148
|
+
second = get(second);
|
|
3149
|
+
}
|
|
3150
|
+
let result = 0;
|
|
3151
|
+
let i = 0;
|
|
3152
|
+
let fn;
|
|
3153
|
+
const len = fns.length;
|
|
3154
|
+
for (; i < len; i++) {
|
|
3155
|
+
fn = fns[i];
|
|
3156
|
+
if (!fn) {
|
|
3157
|
+
continue;
|
|
3158
|
+
}
|
|
3159
|
+
result = fn(first, second);
|
|
3160
|
+
if (result !== 0) {
|
|
3161
|
+
return result;
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
return result;
|
|
3165
|
+
};
|
|
3166
|
+
};
|
|
3167
|
+
|
|
3168
|
+
// src/utils/groupAndPivot/getPivotColumnsAndColumnGroups.ts
|
|
2989
3169
|
function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPosition) {
|
|
2990
3170
|
const pivotLength = pivotBy.length;
|
|
2991
3171
|
const columns = new Map([
|
|
@@ -3010,10 +3190,14 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
|
|
|
3010
3190
|
if (keys.length === pivotLength) {
|
|
3011
3191
|
const parentKeys = keys.slice(0, -1);
|
|
3012
3192
|
let columnGroupId = parentKeys.join("/");
|
|
3013
|
-
|
|
3193
|
+
const pivotByForColumn = pivotBy[keys.length - 1];
|
|
3194
|
+
let computedPivotColumn = __spreadValues({
|
|
3014
3195
|
pivotBy,
|
|
3015
3196
|
pivotColumn: true,
|
|
3016
3197
|
pivotGroupKeys: keys,
|
|
3198
|
+
pivotGroupKeyForColumn: keys[keys.length - 1],
|
|
3199
|
+
pivotIndexForColumn: keys.length - 1,
|
|
3200
|
+
pivotByForColumn,
|
|
3017
3201
|
sortable: false,
|
|
3018
3202
|
columnGroup: parentKeys.length ? `${columnGroupId}` : void 0,
|
|
3019
3203
|
header: keys[keys.length - 1],
|
|
@@ -3022,7 +3206,15 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
|
|
|
3022
3206
|
const value = (_c = (_b = (_a = rowInfo.pivotValuesMap) == null ? void 0 : _a.get(keys)) == null ? void 0 : _b.reducerResults[0]) != null ? _c : null;
|
|
3023
3207
|
return value;
|
|
3024
3208
|
}
|
|
3025
|
-
});
|
|
3209
|
+
}, pivotByForColumn.column);
|
|
3210
|
+
if (pivotByForColumn.column) {
|
|
3211
|
+
if (typeof pivotByForColumn.column === "function") {
|
|
3212
|
+
Object.assign(computedPivotColumn, pivotByForColumn.column({ column: computedPivotColumn }));
|
|
3213
|
+
} else {
|
|
3214
|
+
Object.assign(computedPivotColumn, pivotByForColumn.column);
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
columns.set(`${keys.join("/")}`, computedPivotColumn);
|
|
3026
3218
|
} else {
|
|
3027
3219
|
const colGroupId = keys.join("/");
|
|
3028
3220
|
const parentKeys = keys.slice(0, -1);
|
|
@@ -3031,11 +3223,15 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
|
|
|
3031
3223
|
header: keys.join(" >> ")
|
|
3032
3224
|
});
|
|
3033
3225
|
if (pivotTotalColumnPosition !== false) {
|
|
3034
|
-
|
|
3226
|
+
const pivotByForColumn = pivotBy[keys.length - 1];
|
|
3227
|
+
let computedPivotColumn = __spreadValues({
|
|
3035
3228
|
columnGroup: parentKeys.length ? parentKeys.join("/") : void 0,
|
|
3036
3229
|
header: `${keys.join("/")} total `,
|
|
3037
3230
|
pivotTotalColumn: true,
|
|
3038
3231
|
pivotGroupKeys: keys,
|
|
3232
|
+
pivotGroupKeyForColumn: keys[keys.length - 1],
|
|
3233
|
+
pivotByForColumn,
|
|
3234
|
+
pivotIndexForColumn: keys.length - 1,
|
|
3039
3235
|
pivotBy,
|
|
3040
3236
|
sortable: false,
|
|
3041
3237
|
valueGetter: ({ rowInfo }) => {
|
|
@@ -3043,7 +3239,15 @@ function getPivotColumnsAndColumnGroups(deepMap, pivotBy, pivotTotalColumnPositi
|
|
|
3043
3239
|
const value = (_c = (_b = (_a = rowInfo.pivotValuesMap) == null ? void 0 : _a.get(keys)) == null ? void 0 : _b.reducerResults[0]) != null ? _c : null;
|
|
3044
3240
|
return value;
|
|
3045
3241
|
}
|
|
3046
|
-
});
|
|
3242
|
+
}, pivotByForColumn.column);
|
|
3243
|
+
if (pivotByForColumn.column) {
|
|
3244
|
+
if (typeof pivotByForColumn.column === "function") {
|
|
3245
|
+
Object.assign(computedPivotColumn, pivotByForColumn.column({ column: computedPivotColumn }));
|
|
3246
|
+
} else {
|
|
3247
|
+
Object.assign(computedPivotColumn, pivotByForColumn.column);
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
columns.set(`${keys.join("/")}-total`, computedPivotColumn);
|
|
3047
3251
|
}
|
|
3048
3252
|
}
|
|
3049
3253
|
if (pivotTotalColumnPosition === "start" || pivotTotalColumnPosition === false) {
|
|
@@ -3453,25 +3657,27 @@ function getColumnsWhenGrouping(params) {
|
|
|
3453
3657
|
const computedColumns = new Map();
|
|
3454
3658
|
if (groupRenderStrategy === "multi-column") {
|
|
3455
3659
|
groupRowsBy.forEach((groupByForColumn, groupIndexForColumn, arr) => {
|
|
3456
|
-
|
|
3660
|
+
const generatedGroupColumn = getColumnForGroupBy({
|
|
3457
3661
|
groupByForColumn,
|
|
3458
3662
|
groupRowsBy,
|
|
3459
3663
|
groupIndexForColumn,
|
|
3460
3664
|
groupCount: arr.length,
|
|
3461
3665
|
groupRenderStrategy
|
|
3462
|
-
}, toggleGroupRow, groupColumn)
|
|
3666
|
+
}, toggleGroupRow, groupColumn);
|
|
3667
|
+
computedColumns.set(generatedGroupColumn.id || `group-by-${groupByForColumn.field}`, generatedGroupColumn);
|
|
3463
3668
|
});
|
|
3464
3669
|
} else if (groupRenderStrategy === "single-column") {
|
|
3465
|
-
|
|
3670
|
+
const singleGroupColumn = getSingleGroupColumn({
|
|
3466
3671
|
groupCount: groupRowsBy.length,
|
|
3467
3672
|
groupRowsBy,
|
|
3468
3673
|
groupRenderStrategy
|
|
3469
|
-
}, toggleGroupRow, groupColumn)
|
|
3674
|
+
}, toggleGroupRow, groupColumn);
|
|
3675
|
+
computedColumns.set(singleGroupColumn.id || "group-by", singleGroupColumn);
|
|
3470
3676
|
}
|
|
3471
3677
|
columns.forEach((col, colId) => {
|
|
3472
3678
|
computedColumns.set(colId, col);
|
|
3473
3679
|
});
|
|
3474
|
-
return computedColumns;
|
|
3680
|
+
return computedColumns.size ? computedColumns : void 0;
|
|
3475
3681
|
}
|
|
3476
3682
|
|
|
3477
3683
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
@@ -3482,7 +3688,14 @@ function useComputed() {
|
|
|
3482
3688
|
componentActions: dataSourceActions,
|
|
3483
3689
|
componentState: dataSourceState
|
|
3484
3690
|
} = useDataSourceContextValue();
|
|
3485
|
-
const {
|
|
3691
|
+
const {
|
|
3692
|
+
columnOrder,
|
|
3693
|
+
columnVisibility,
|
|
3694
|
+
columnPinning,
|
|
3695
|
+
columnSizing,
|
|
3696
|
+
columnTypes,
|
|
3697
|
+
bodySize
|
|
3698
|
+
} = componentState;
|
|
3486
3699
|
useState4(() => {
|
|
3487
3700
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
3488
3701
|
if (rowHeight) {
|
|
@@ -3527,6 +3740,7 @@ function useComputed() {
|
|
|
3527
3740
|
pinnedStartMaxWidth: componentState.pinnedStartMaxWidth,
|
|
3528
3741
|
pinnedEndMaxWidth: componentState.pinnedEndMaxWidth,
|
|
3529
3742
|
bodySize,
|
|
3743
|
+
viewportReservedWidth: componentState.viewportReservedWidth,
|
|
3530
3744
|
sortable: componentState.sortable,
|
|
3531
3745
|
draggableColumns: componentState.draggableColumns,
|
|
3532
3746
|
sortInfo: (_a = dataSourceState.sortInfo) != null ? _a : void 0,
|
|
@@ -3535,7 +3749,9 @@ function useComputed() {
|
|
|
3535
3749
|
columnOrder,
|
|
3536
3750
|
columnVisibility,
|
|
3537
3751
|
columnVisibilityAssumeVisible: true,
|
|
3538
|
-
columnPinning
|
|
3752
|
+
columnPinning,
|
|
3753
|
+
columnSizing,
|
|
3754
|
+
columnTypes
|
|
3539
3755
|
});
|
|
3540
3756
|
const unpinnedColumnWidths = computedUnpinnedColumns.map((c) => c.computedWidth);
|
|
3541
3757
|
let sortedUnpinnedColumnWidths = [...unpinnedColumnWidths].sort(sortAscending);
|
|
@@ -3611,33 +3827,6 @@ import {
|
|
|
3611
3827
|
createElement as createElement19
|
|
3612
3828
|
} from "react";
|
|
3613
3829
|
|
|
3614
|
-
// src/utils/getGlobal.ts
|
|
3615
|
-
function getGlobal() {
|
|
3616
|
-
return globalThis;
|
|
3617
|
-
}
|
|
3618
|
-
|
|
3619
|
-
// src/components/utils/getScrollbarWidth.ts
|
|
3620
|
-
var scrollbarWidth;
|
|
3621
|
-
function getScrollbarWidth() {
|
|
3622
|
-
var _a, _b;
|
|
3623
|
-
if (scrollbarWidth != null) {
|
|
3624
|
-
return scrollbarWidth;
|
|
3625
|
-
}
|
|
3626
|
-
const doc = (_a = getGlobal().document) != null ? _a : null;
|
|
3627
|
-
if (!doc) {
|
|
3628
|
-
return 0;
|
|
3629
|
-
}
|
|
3630
|
-
const outer = doc.createElement("div");
|
|
3631
|
-
outer.style.visibility = "hidden";
|
|
3632
|
-
outer.style.overflow = "scroll";
|
|
3633
|
-
doc.body.appendChild(outer);
|
|
3634
|
-
const inner = doc.createElement("div");
|
|
3635
|
-
outer.appendChild(inner);
|
|
3636
|
-
scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
|
|
3637
|
-
(_b = outer.parentNode) == null ? void 0 : _b.removeChild(outer);
|
|
3638
|
-
return scrollbarWidth;
|
|
3639
|
-
}
|
|
3640
|
-
|
|
3641
3830
|
// src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
|
|
3642
3831
|
import {
|
|
3643
3832
|
createElement as createElement8,
|
|
@@ -3677,10 +3866,11 @@ function VerticalScrollbarPlaceholderFn(props) {
|
|
|
3677
3866
|
var VerticalScrollbarPlaceholder = memo2(VerticalScrollbarPlaceholderFn);
|
|
3678
3867
|
|
|
3679
3868
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
3869
|
+
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
3680
3870
|
var CellCls = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
|
|
3681
3871
|
var HeaderCellProxy = "_12zfob10";
|
|
3682
|
-
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"]] });
|
|
3683
|
-
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"]] });
|
|
3872
|
+
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"]] });
|
|
3873
|
+
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"]] });
|
|
3684
3874
|
var HeaderGroupCls = "_16lm1iwz _16lm1iwj";
|
|
3685
3875
|
var HeaderGroup_Children = "_16lm1iwj _16lm1iw10 _16lm1iw12 _16lm1iwc";
|
|
3686
3876
|
var HeaderGroup_Header = "_12zfob1x _16lm1iwj _16lm1iw10 _16lm1iw11";
|
|
@@ -3716,9 +3906,10 @@ var useInfiniteTableState = () => {
|
|
|
3716
3906
|
};
|
|
3717
3907
|
|
|
3718
3908
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
3909
|
+
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
3719
3910
|
var CellCls2 = "_1eexc2a5 _16lm1iwj _16lm1iw10 _16lm1iw11 _16lm1iw2 _16lm1iw19 _16lm1iw1a";
|
|
3720
3911
|
var CellClsVariants = { shifting: "_1eexc2a3", dragging: "_1eexc2a4" };
|
|
3721
|
-
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"]] });
|
|
3912
|
+
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"]] });
|
|
3722
3913
|
var columnAlignCellStyle = { center: "_1eexc2a0", start: "_1eexc2a1", end: "_1eexc2a2" };
|
|
3723
3914
|
|
|
3724
3915
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
@@ -4141,7 +4332,29 @@ import {
|
|
|
4141
4332
|
createElement as createElement14,
|
|
4142
4333
|
memo as memo5
|
|
4143
4334
|
} from "react";
|
|
4144
|
-
import {
|
|
4335
|
+
import { useEffect as useEffect11 } from "react";
|
|
4336
|
+
|
|
4337
|
+
// src/components/RawList/AvoidReactDiff.tsx
|
|
4338
|
+
import {
|
|
4339
|
+
Fragment as Fragment3,
|
|
4340
|
+
createElement as createElement12,
|
|
4341
|
+
memo as memo4
|
|
4342
|
+
} from "react";
|
|
4343
|
+
import { useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
|
|
4344
|
+
function AvoidReactDiffFn(props) {
|
|
4345
|
+
const [children, setChildren] = useState7(props.updater.get());
|
|
4346
|
+
useLayoutEffect4(() => {
|
|
4347
|
+
const remove = props.updater.onChange((children2) => {
|
|
4348
|
+
setChildren(children2);
|
|
4349
|
+
});
|
|
4350
|
+
return remove;
|
|
4351
|
+
}, [props.updater]);
|
|
4352
|
+
return /* @__PURE__ */ createElement12(Fragment3, null, children);
|
|
4353
|
+
}
|
|
4354
|
+
var AvoidReactDiff = memo4(AvoidReactDiffFn);
|
|
4355
|
+
|
|
4356
|
+
// src/components/RawList/useVirtualRenderer.ts
|
|
4357
|
+
import { useMemo as useMemo7 } from "react";
|
|
4145
4358
|
|
|
4146
4359
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
4147
4360
|
import {
|
|
@@ -4241,6 +4454,9 @@ var MappedItems = class extends Logger {
|
|
|
4241
4454
|
this.itemIndexToElementIndex = {};
|
|
4242
4455
|
this.renderedElements = {};
|
|
4243
4456
|
}
|
|
4457
|
+
reset() {
|
|
4458
|
+
this.init();
|
|
4459
|
+
}
|
|
4244
4460
|
destroy() {
|
|
4245
4461
|
this.init();
|
|
4246
4462
|
}
|
|
@@ -4260,25 +4476,6 @@ var MappedItems = class extends Logger {
|
|
|
4260
4476
|
}
|
|
4261
4477
|
};
|
|
4262
4478
|
|
|
4263
|
-
// src/components/RawList/AvoidReactDiff.tsx
|
|
4264
|
-
import {
|
|
4265
|
-
Fragment as Fragment3,
|
|
4266
|
-
createElement as createElement12,
|
|
4267
|
-
memo as memo4
|
|
4268
|
-
} from "react";
|
|
4269
|
-
import { useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
|
|
4270
|
-
function AvoidReactDiffFn(props) {
|
|
4271
|
-
const [children, setChildren] = useState7(props.updater.get());
|
|
4272
|
-
useLayoutEffect4(() => {
|
|
4273
|
-
const remove = props.updater.onChange((children2) => {
|
|
4274
|
-
setChildren(children2);
|
|
4275
|
-
});
|
|
4276
|
-
return remove;
|
|
4277
|
-
}, [props.updater]);
|
|
4278
|
-
return /* @__PURE__ */ createElement12(Fragment3, null, children);
|
|
4279
|
-
}
|
|
4280
|
-
var AvoidReactDiff = memo4(AvoidReactDiffFn);
|
|
4281
|
-
|
|
4282
4479
|
// src/components/RawList/ReactVirtualRenderer.tsx
|
|
4283
4480
|
var ITEM_POSITION_WITH_TRANSFORM = true;
|
|
4284
4481
|
var ReactVirtualRenderer = class extends Logger {
|
|
@@ -4385,17 +4582,12 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4385
4582
|
}
|
|
4386
4583
|
};
|
|
4387
4584
|
this.destroy = () => {
|
|
4388
|
-
if (true) {
|
|
4389
|
-
return;
|
|
4390
|
-
}
|
|
4391
4585
|
this.destroyed = true;
|
|
4392
|
-
this.
|
|
4393
|
-
this.itemDOMElements = [];
|
|
4394
|
-
this.itemDOMRefs = [];
|
|
4395
|
-
this.updaters = [];
|
|
4586
|
+
this.reset();
|
|
4396
4587
|
this.onRender = null;
|
|
4397
4588
|
this.renderItem = null;
|
|
4398
4589
|
this.brain = null;
|
|
4590
|
+
this.mappedItems = null;
|
|
4399
4591
|
};
|
|
4400
4592
|
if (onRender) {
|
|
4401
4593
|
this.onRender = onRender;
|
|
@@ -4453,18 +4645,43 @@ var ReactVirtualRenderer = class extends Logger {
|
|
|
4453
4645
|
itemUpdater(renderedNode);
|
|
4454
4646
|
this.updateElementPosition(elementIndex);
|
|
4455
4647
|
}
|
|
4648
|
+
reset() {
|
|
4649
|
+
this.itemDOMElements = {};
|
|
4650
|
+
this.itemDOMRefs = {};
|
|
4651
|
+
this.updaters = {};
|
|
4652
|
+
this.items = [];
|
|
4653
|
+
this.mappedItems.reset();
|
|
4654
|
+
}
|
|
4456
4655
|
};
|
|
4457
4656
|
|
|
4657
|
+
// src/components/RawList/useVirtualRenderer.ts
|
|
4658
|
+
function createRenderer(brain) {
|
|
4659
|
+
const renderer = new ReactVirtualRenderer(brain, {});
|
|
4660
|
+
const onRenderUpdater = buildSubscriptionCallback();
|
|
4661
|
+
brain.onDestroy(() => {
|
|
4662
|
+
renderer.destroy();
|
|
4663
|
+
onRenderUpdater.destroy();
|
|
4664
|
+
});
|
|
4665
|
+
return {
|
|
4666
|
+
renderer,
|
|
4667
|
+
onRenderUpdater
|
|
4668
|
+
};
|
|
4669
|
+
}
|
|
4670
|
+
function useVirtualRenderer({
|
|
4671
|
+
brain
|
|
4672
|
+
}) {
|
|
4673
|
+
return useMemo7(() => {
|
|
4674
|
+
return createRenderer(brain);
|
|
4675
|
+
}, [brain]);
|
|
4676
|
+
}
|
|
4677
|
+
|
|
4458
4678
|
// src/components/RawList/index.tsx
|
|
4459
4679
|
function RawListFn(props) {
|
|
4460
4680
|
const { renderItem, brain, debugChannel } = props;
|
|
4461
|
-
const { onRenderUpdater, renderer } =
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
});
|
|
4466
|
-
return { onRenderUpdater: onRenderUpdater2, renderer: renderer2 };
|
|
4467
|
-
}, []);
|
|
4681
|
+
const { onRenderUpdater, renderer } = useVirtualRenderer({
|
|
4682
|
+
brain,
|
|
4683
|
+
debugChannel
|
|
4684
|
+
});
|
|
4468
4685
|
const getRenderItem = useLatest(renderItem);
|
|
4469
4686
|
useEffect11(() => {
|
|
4470
4687
|
const renderRange = brain.getRenderRange();
|
|
@@ -4473,7 +4690,7 @@ function RawListFn(props) {
|
|
|
4473
4690
|
force: true,
|
|
4474
4691
|
onRender: onRenderUpdater
|
|
4475
4692
|
});
|
|
4476
|
-
}, [renderItem, onRenderUpdater]);
|
|
4693
|
+
}, [brain, renderItem, onRenderUpdater]);
|
|
4477
4694
|
useEffect11(() => {
|
|
4478
4695
|
const remove = brain.onRenderRangeChange((renderRange) => {
|
|
4479
4696
|
renderer.renderRange(renderRange, {
|
|
@@ -4484,12 +4701,6 @@ function RawListFn(props) {
|
|
|
4484
4701
|
});
|
|
4485
4702
|
return remove;
|
|
4486
4703
|
}, [brain, onRenderUpdater]);
|
|
4487
|
-
useEffect11(() => {
|
|
4488
|
-
return () => {
|
|
4489
|
-
renderer.destroy();
|
|
4490
|
-
onRenderUpdater.destroy();
|
|
4491
|
-
};
|
|
4492
|
-
}, [renderer, onRenderUpdater]);
|
|
4493
4704
|
return /* @__PURE__ */ createElement14(AvoidReactDiff, {
|
|
4494
4705
|
updater: onRenderUpdater
|
|
4495
4706
|
});
|
|
@@ -5109,7 +5320,7 @@ var VirtualList = (props) => {
|
|
|
5109
5320
|
brain: virtualBrain,
|
|
5110
5321
|
renderItem,
|
|
5111
5322
|
repaintId,
|
|
5112
|
-
debugChannel: "VirtualList"
|
|
5323
|
+
debugChannel: "VirtualList-" + mainAxis
|
|
5113
5324
|
})), children, /* @__PURE__ */ createElement22(SpacePlaceholder, {
|
|
5114
5325
|
count,
|
|
5115
5326
|
width,
|
|
@@ -5555,13 +5766,14 @@ function useUnpinnedRendering(params) {
|
|
|
5555
5766
|
import { useCallback as useCallback13, useEffect as useEffect16, useRef as useRef13 } from "react";
|
|
5556
5767
|
|
|
5557
5768
|
// src/components/InfiniteTable/InfiniteCls.css.ts
|
|
5769
|
+
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5558
5770
|
var FooterCls = "_16lm1iw1";
|
|
5559
5771
|
var InfiniteCls = "_1yeub2v0 _16lm1iw1 _16lm1iwj _16lm1iwz _16lm1iw0";
|
|
5560
|
-
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: [] });
|
|
5772
|
+
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: [] });
|
|
5561
5773
|
var InfiniteClsScrolling = "_1yeub2v1";
|
|
5562
5774
|
var InfiniteClsShiftingColumns = "_16lm1iwm";
|
|
5563
5775
|
var PinnedRowsClsVariants = { pinnedStart: "_1yeub2ve", pinnedEnd: "_1yeub2vf", overflow: "_1yeub2vg" };
|
|
5564
|
-
var PinnedRowsContainerClsVariants = createRuntimeFn({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vh", end: "_1yeub2vi", false: "_1yeub2vj" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5776
|
+
var PinnedRowsContainerClsVariants = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "", variantClassNames: { pinned: { start: "_1yeub2vh", end: "_1yeub2vi", false: "_1yeub2vj" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5565
5777
|
|
|
5566
5778
|
// src/components/InfiniteTable/hooks/useOnContainerScroll.ts
|
|
5567
5779
|
var DELAY = 200;
|
|
@@ -5947,11 +6159,13 @@ var VirtualBrain = class extends Logger {
|
|
|
5947
6159
|
super(`VirtualBrain:${options.mainAxis}`);
|
|
5948
6160
|
this.scrollPosition = initialScrollPosition2;
|
|
5949
6161
|
this.scrollPositionOnMainAxis = 0;
|
|
6162
|
+
this.destroyed = false;
|
|
5950
6163
|
this.totalSize = 0;
|
|
5951
6164
|
this.onScrollFns = [];
|
|
5952
6165
|
this.onTotalSizeChangeFns = [];
|
|
5953
6166
|
this.onRenderCountChangeFns = [];
|
|
5954
6167
|
this.onRenderRangeChangeFns = [];
|
|
6168
|
+
this.onDestroyFns = [];
|
|
5955
6169
|
this.renderCount = 0;
|
|
5956
6170
|
this.renderRange = {
|
|
5957
6171
|
renderStartIndex: -1,
|
|
@@ -6048,6 +6262,12 @@ var VirtualBrain = class extends Logger {
|
|
|
6048
6262
|
this.onRenderRangeChangeFns = this.onRenderRangeChangeFns.filter((f) => f !== fn);
|
|
6049
6263
|
};
|
|
6050
6264
|
};
|
|
6265
|
+
this.onDestroy = (fn) => {
|
|
6266
|
+
this.onDestroyFns.push(fn);
|
|
6267
|
+
return () => {
|
|
6268
|
+
this.onDestroyFns = this.onDestroyFns.filter((f) => f !== fn);
|
|
6269
|
+
};
|
|
6270
|
+
};
|
|
6051
6271
|
this.update = (newCount, newItemSize, newItemSpan) => {
|
|
6052
6272
|
const { itemSize, count, itemSpan } = this.options;
|
|
6053
6273
|
const countChange = count !== newCount;
|
|
@@ -6244,7 +6464,13 @@ var VirtualBrain = class extends Logger {
|
|
|
6244
6464
|
return result;
|
|
6245
6465
|
};
|
|
6246
6466
|
this.destroy = () => {
|
|
6467
|
+
if (this.destroyed) {
|
|
6468
|
+
return;
|
|
6469
|
+
}
|
|
6470
|
+
this.notifyDestroy();
|
|
6247
6471
|
this.reset();
|
|
6472
|
+
this.destroyed = true;
|
|
6473
|
+
this.onDestroyFns = [];
|
|
6248
6474
|
this.onScrollFns = [];
|
|
6249
6475
|
this.onTotalSizeChangeFns = [];
|
|
6250
6476
|
this.onRenderCountChangeFns = [];
|
|
@@ -6280,6 +6506,12 @@ var VirtualBrain = class extends Logger {
|
|
|
6280
6506
|
fns[i](scrollPosition);
|
|
6281
6507
|
}
|
|
6282
6508
|
}
|
|
6509
|
+
notifyDestroy() {
|
|
6510
|
+
const fns = this.onDestroyFns;
|
|
6511
|
+
for (let i = 0, len = fns.length; i < len; i++) {
|
|
6512
|
+
fns[i]();
|
|
6513
|
+
}
|
|
6514
|
+
}
|
|
6283
6515
|
notifyTotalSizeChange() {
|
|
6284
6516
|
const totalSize = this.getTotalSize();
|
|
6285
6517
|
const fns = this.onTotalSizeChangeFns;
|
|
@@ -6390,9 +6622,14 @@ function useYourBrain(param) {
|
|
|
6390
6622
|
});
|
|
6391
6623
|
return brain;
|
|
6392
6624
|
});
|
|
6625
|
+
useEffect19(() => {
|
|
6626
|
+
return () => {
|
|
6627
|
+
horizontalVirtualBrain.destroy();
|
|
6628
|
+
verticalVirtualBrain.destroy();
|
|
6629
|
+
};
|
|
6630
|
+
}, []);
|
|
6393
6631
|
horizontalVirtualBrain.update(computedUnpinnedColumns.length, columnSize);
|
|
6394
6632
|
verticalVirtualBrain.update(dataArray.length, rowHeight, rowSpan);
|
|
6395
|
-
globalThis.verticalVirtualBrain = verticalVirtualBrain;
|
|
6396
6633
|
useEffect19(() => {
|
|
6397
6634
|
verticalVirtualBrain.setAvailableSize({
|
|
6398
6635
|
height: bodySize.height,
|
|
@@ -6824,11 +7061,11 @@ var SANDBOX_REGEX = /(https):\/\/\d+\-\d+\-\d\-(sandpack\.codesandbox\.io)/g;
|
|
|
6824
7061
|
var origin = typeof window !== "undefined" ? window.location.origin : "";
|
|
6825
7062
|
var [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
|
|
6826
7063
|
var isInsideSandbox = protocol === "https" && sandboxUrl === "sandpack.codesandbox.io";
|
|
6827
|
-
var useLicense = (licenseKey) => {
|
|
7064
|
+
var useLicense = (licenseKey = "") => {
|
|
6828
7065
|
const valid = useMemo11(() => {
|
|
6829
7066
|
let valid2 = isValidLicense(licenseKey, {
|
|
6830
7067
|
publishedAt: 1624970570587,
|
|
6831
|
-
version: "0.0.
|
|
7068
|
+
version: "0.0.8"
|
|
6832
7069
|
});
|
|
6833
7070
|
if (!licenseKey && !valid2 && isInsideSandbox) {
|
|
6834
7071
|
return true;
|
|
@@ -6845,7 +7082,7 @@ import {
|
|
|
6845
7082
|
useLayoutEffect as useLayoutEffect5
|
|
6846
7083
|
} from "react";
|
|
6847
7084
|
import { useRef as useRef17 } from "react";
|
|
6848
|
-
var
|
|
7085
|
+
var error = err("CSSVariableWatch");
|
|
6849
7086
|
var debug5 = dbg("CSSVariableWatch");
|
|
6850
7087
|
var WRAPPER_STYLE = {
|
|
6851
7088
|
position: "absolute",
|
|
@@ -6872,7 +7109,7 @@ var useCSSVariableWatch = (params) => {
|
|
|
6872
7109
|
debug5(`Variable ${params.varName} found and equals ${value}.`);
|
|
6873
7110
|
params.onChange(value);
|
|
6874
7111
|
} else {
|
|
6875
|
-
|
|
7112
|
+
error(`Specified variable ${params.varName} not found or does not have a numeric value.`);
|
|
6876
7113
|
}
|
|
6877
7114
|
}, []);
|
|
6878
7115
|
};
|