@infinite-table/infinite-react 0.0.7 → 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.d.ts +85 -40
- package/index.esm.js +164 -76
- package/index.js +164 -76
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -477,14 +477,14 @@ var require_browser = __commonJS({
|
|
|
477
477
|
} else {
|
|
478
478
|
exports.storage.removeItem("debug");
|
|
479
479
|
}
|
|
480
|
-
} catch (
|
|
480
|
+
} catch (error2) {
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
function load() {
|
|
484
484
|
let r;
|
|
485
485
|
try {
|
|
486
486
|
r = exports.storage.getItem("debug");
|
|
487
|
-
} catch (
|
|
487
|
+
} catch (error2) {
|
|
488
488
|
}
|
|
489
489
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
490
490
|
r = process.env.DEBUG;
|
|
@@ -494,7 +494,7 @@ var require_browser = __commonJS({
|
|
|
494
494
|
function localstorage() {
|
|
495
495
|
try {
|
|
496
496
|
return localStorage;
|
|
497
|
-
} catch (
|
|
497
|
+
} catch (error2) {
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
module.exports = require_common()(exports);
|
|
@@ -502,8 +502,8 @@ var require_browser = __commonJS({
|
|
|
502
502
|
formatters.j = function(v) {
|
|
503
503
|
try {
|
|
504
504
|
return JSON.stringify(v);
|
|
505
|
-
} catch (
|
|
506
|
-
return "[UnexpectedJSONParseError]: " +
|
|
505
|
+
} catch (error2) {
|
|
506
|
+
return "[UnexpectedJSONParseError]: " + error2.message;
|
|
507
507
|
}
|
|
508
508
|
};
|
|
509
509
|
}
|
|
@@ -777,6 +777,15 @@ function computeColumnGroupsDepths(columnGroups) {
|
|
|
777
777
|
}
|
|
778
778
|
|
|
779
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
|
+
}
|
|
780
789
|
function initSetupState() {
|
|
781
790
|
const columnsGeneratedForGrouping = new Map();
|
|
782
791
|
return {
|
|
@@ -806,7 +815,10 @@ function initSetupState() {
|
|
|
806
815
|
}
|
|
807
816
|
var forwardProps = () => {
|
|
808
817
|
return {
|
|
809
|
-
columns:
|
|
818
|
+
columns: (columns) => {
|
|
819
|
+
var _a;
|
|
820
|
+
return (_a = toMap(columns)) != null ? _a : new Map();
|
|
821
|
+
},
|
|
810
822
|
components: 1,
|
|
811
823
|
loadingText: 1,
|
|
812
824
|
pivotColumns: 1,
|
|
@@ -832,15 +844,16 @@ var forwardProps = () => {
|
|
|
832
844
|
pivotColumn: 1,
|
|
833
845
|
pivotRowLabelsColumn: 1,
|
|
834
846
|
pivotColumnGroups: 1,
|
|
847
|
+
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
835
848
|
activeIndex: (activeIndex) => activeIndex != null ? activeIndex : 0,
|
|
836
849
|
columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
|
|
837
850
|
columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 2e3,
|
|
838
|
-
columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth :
|
|
851
|
+
columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
|
|
839
852
|
draggableColumns: (draggableColumns) => draggableColumns != null ? draggableColumns : true,
|
|
840
853
|
sortable: (sortable) => sortable != null ? sortable : true,
|
|
841
854
|
hideEmptyGroupColumns: (hideEmptyGroupColumns) => hideEmptyGroupColumns != null ? hideEmptyGroupColumns : false,
|
|
842
855
|
pivotTotalColumnPosition: (pivotTotalColumnPosition) => pivotTotalColumnPosition != null ? pivotTotalColumnPosition : "end",
|
|
843
|
-
licenseKey: (licenseKey) => licenseKey ||
|
|
856
|
+
licenseKey: (licenseKey) => licenseKey || "",
|
|
844
857
|
columnOrder: (columnOrder) => columnOrder != null ? columnOrder : true,
|
|
845
858
|
header: (header) => header != null ? header : true,
|
|
846
859
|
showZebraRows: (showZebraRows) => showZebraRows != null ? showZebraRows : true,
|
|
@@ -850,6 +863,14 @@ var forwardProps = () => {
|
|
|
850
863
|
headerHeight: (headerHeight) => typeof headerHeight === "number" ? headerHeight : 0,
|
|
851
864
|
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : new Map(),
|
|
852
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
|
+
},
|
|
853
874
|
columnAggregations: (columnAggregations) => columnAggregations != null ? columnAggregations : new Map(),
|
|
854
875
|
collapsedColumnGroups: (collapsedColumnGroups) => collapsedColumnGroups != null ? collapsedColumnGroups : new Map(),
|
|
855
876
|
columnGroups: (columnGroups) => columnGroups != null ? columnGroups : new Map()
|
|
@@ -884,7 +905,7 @@ var mapPropsToState = (params) => {
|
|
|
884
905
|
return {
|
|
885
906
|
groupRenderStrategy,
|
|
886
907
|
groupRowsBy,
|
|
887
|
-
computedColumns: state.computedPivotColumns || state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy ||
|
|
908
|
+
computedColumns: state.computedPivotColumns || state.columnsWhenGrouping || state.columnsWhenInlineGroupRenderStrategy || state.columns,
|
|
888
909
|
virtualizeHeader,
|
|
889
910
|
columnGroupsDepthsMap,
|
|
890
911
|
columnGroupsMaxDepth: columnGroupsDepthsMap != state.columnGroupsDepthsMap ? Math.max(...columnGroupsDepthsMap.values(), 0) : state.columnGroupsMaxDepth,
|
|
@@ -1024,7 +1045,7 @@ var computeFlex = (params) => {
|
|
|
1024
1045
|
items.forEach((item, i) => {
|
|
1025
1046
|
var _a, _b, _c, _d, _e, _f;
|
|
1026
1047
|
let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
|
|
1027
|
-
let minSize = (_d = (_c = item.
|
|
1048
|
+
let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
|
|
1028
1049
|
if (item.size != null) {
|
|
1029
1050
|
if (maxSize != null && item.size > maxSize) {
|
|
1030
1051
|
item.size = maxSize;
|
|
@@ -1052,7 +1073,7 @@ var computeFlex = (params) => {
|
|
|
1052
1073
|
if (item.flex != null) {
|
|
1053
1074
|
const approxFlexSize = sizePerFlex * item.flex;
|
|
1054
1075
|
let maxSize = (_b = (_a = item.maxSize) != null ? _a : defaultMaxSize) != null ? _b : void 0;
|
|
1055
|
-
let minSize = (_d = (_c = item.
|
|
1076
|
+
let minSize = (_d = (_c = item.minSize) != null ? _c : defaultMinSize) != null ? _d : void 0;
|
|
1056
1077
|
let constrained = false;
|
|
1057
1078
|
let substractSize = 0;
|
|
1058
1079
|
if (maxSize != null && approxFlexSize > maxSize) {
|
|
@@ -1187,8 +1208,52 @@ var Logger = class {
|
|
|
1187
1208
|
}
|
|
1188
1209
|
};
|
|
1189
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
|
+
|
|
1190
1255
|
// src/components/InfiniteTable/utils/getComputedVisibleColumns.ts
|
|
1191
|
-
var
|
|
1256
|
+
var logError = err("getComputedVisibleColumns");
|
|
1192
1257
|
var isColumnVisible = (columnVisibility, _columnVisibilityAssumeVisible, colId) => {
|
|
1193
1258
|
return !columnVisibility.has(colId) || columnVisibility.get(colId) !== false;
|
|
1194
1259
|
};
|
|
@@ -1209,22 +1274,26 @@ var getComputedVisibleColumns = ({
|
|
|
1209
1274
|
sortInfo,
|
|
1210
1275
|
setSortInfo,
|
|
1211
1276
|
multiSort,
|
|
1277
|
+
viewportReservedWidth,
|
|
1212
1278
|
draggableColumns,
|
|
1213
1279
|
columnOrder,
|
|
1214
1280
|
columnPinning,
|
|
1281
|
+
columnSizing,
|
|
1282
|
+
columnTypes,
|
|
1215
1283
|
columnVisibility,
|
|
1216
1284
|
columnVisibilityAssumeVisible
|
|
1217
1285
|
}) => {
|
|
1218
1286
|
let computedOffset = 0;
|
|
1219
1287
|
const normalizedColumnOrder = adjustColumnOrderForPinning(columnOrder === true ? [...columns.keys()] : columnOrder, columnPinning);
|
|
1220
|
-
const visibleColumnOrder = normalizedColumnOrder.filter(
|
|
1221
|
-
|
|
1222
|
-
let col = columns.get(columnId);
|
|
1288
|
+
const visibleColumnOrder = normalizedColumnOrder.filter((colId) => {
|
|
1289
|
+
let col = columns.get(colId);
|
|
1223
1290
|
if (!col) {
|
|
1224
|
-
|
|
1291
|
+
logError(`Column with id "${colId}" specified in columnOrder array cannot be found in the columns map.`);
|
|
1292
|
+
return false;
|
|
1225
1293
|
}
|
|
1226
|
-
return
|
|
1227
|
-
})
|
|
1294
|
+
return isColumnVisible(columnVisibility, columnVisibilityAssumeVisible, colId);
|
|
1295
|
+
});
|
|
1296
|
+
const columnsArray = visibleColumnOrder.map((columnId) => columns.get(columnId)).filter(Boolean);
|
|
1228
1297
|
const sortedMap = (sortInfo != null ? sortInfo : []).reduce((acc, info, index) => {
|
|
1229
1298
|
if (info.id) {
|
|
1230
1299
|
acc[info.id] = { sortInfo: info, index };
|
|
@@ -1238,20 +1307,39 @@ var getComputedVisibleColumns = ({
|
|
|
1238
1307
|
return acc;
|
|
1239
1308
|
}, {});
|
|
1240
1309
|
const flexResult = computeFlex({
|
|
1241
|
-
availableSize: bodySize.width,
|
|
1310
|
+
availableSize: Math.max(bodySize.width - (viewportReservedWidth != null ? viewportReservedWidth : 0) - getScrollbarWidth(), 0),
|
|
1242
1311
|
maxSize: columnMaxWidth,
|
|
1243
1312
|
minSize: columnMinWidth,
|
|
1244
|
-
items:
|
|
1245
|
-
var _a, _b;
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
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;
|
|
1249
1337
|
}
|
|
1250
1338
|
return {
|
|
1251
1339
|
size,
|
|
1252
|
-
flex:
|
|
1253
|
-
minSize:
|
|
1254
|
-
maxSize:
|
|
1340
|
+
flex: colFlex,
|
|
1341
|
+
minSize: colMinWidth,
|
|
1342
|
+
maxSize: colMaxWidth
|
|
1255
1343
|
};
|
|
1256
1344
|
})
|
|
1257
1345
|
});
|
|
@@ -1286,6 +1374,7 @@ var getComputedVisibleColumns = ({
|
|
|
1286
1374
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1287
1375
|
const id = visibleColumnOrder[i];
|
|
1288
1376
|
const nextColumnId = visibleColumnOrder[i + 1];
|
|
1377
|
+
const colType = getColumnComputedType(c, columnTypes);
|
|
1289
1378
|
const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
|
|
1290
1379
|
const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
|
|
1291
1380
|
const computedSorted = !!computedSortInfo;
|
|
@@ -1341,8 +1430,10 @@ var getComputedVisibleColumns = ({
|
|
|
1341
1430
|
const computedFirstInCategory = computedPinned !== prevPinned;
|
|
1342
1431
|
const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
|
|
1343
1432
|
const result2 = __spreadProps(__spreadValues({
|
|
1344
|
-
align:
|
|
1345
|
-
verticalAlign:
|
|
1433
|
+
align: colType.align,
|
|
1434
|
+
verticalAlign: colType.verticalAlign,
|
|
1435
|
+
renderValue: colType.renderValue,
|
|
1436
|
+
render: colType.render
|
|
1346
1437
|
}, c), {
|
|
1347
1438
|
computedWidth,
|
|
1348
1439
|
computedAbsoluteOffset,
|
|
@@ -1504,11 +1595,16 @@ var useComputedVisibleColumns = ({
|
|
|
1504
1595
|
setSortInfo,
|
|
1505
1596
|
columnOrder,
|
|
1506
1597
|
columnPinning,
|
|
1598
|
+
columnTypes,
|
|
1507
1599
|
pinnedEndMaxWidth,
|
|
1508
1600
|
pinnedStartMaxWidth,
|
|
1601
|
+
viewportReservedWidth,
|
|
1509
1602
|
columnVisibility,
|
|
1510
|
-
columnVisibilityAssumeVisible
|
|
1603
|
+
columnVisibilityAssumeVisible,
|
|
1604
|
+
columnSizing
|
|
1511
1605
|
}) => {
|
|
1606
|
+
const columnsSizingRenderId = useRerenderOnKeyChange(columnSizing);
|
|
1607
|
+
const columnTypesRenderId = useRerenderOnKeyChange(columnTypes);
|
|
1512
1608
|
const columnsRenderId = useRerenderOnKeyChange(columns);
|
|
1513
1609
|
const visibilityRenderId = useRerenderOnKeyChange(columnVisibility);
|
|
1514
1610
|
const pinningRenderId = useRerenderOnKeyChange(columnPinning);
|
|
@@ -1534,6 +1630,7 @@ var useComputedVisibleColumns = ({
|
|
|
1534
1630
|
columnMinWidth,
|
|
1535
1631
|
columnMaxWidth,
|
|
1536
1632
|
columnDefaultWidth,
|
|
1633
|
+
viewportReservedWidth,
|
|
1537
1634
|
sortable,
|
|
1538
1635
|
sortInfo,
|
|
1539
1636
|
setSortInfo,
|
|
@@ -1543,6 +1640,8 @@ var useComputedVisibleColumns = ({
|
|
|
1543
1640
|
draggableColumns,
|
|
1544
1641
|
columnOrder,
|
|
1545
1642
|
columnPinning,
|
|
1643
|
+
columnSizing,
|
|
1644
|
+
columnTypes,
|
|
1546
1645
|
columnVisibility,
|
|
1547
1646
|
columnVisibilityAssumeVisible: columnVisibilityAssumeVisible != null ? columnVisibilityAssumeVisible : true
|
|
1548
1647
|
});
|
|
@@ -1564,7 +1663,9 @@ var useComputedVisibleColumns = ({
|
|
|
1564
1663
|
columnPinning,
|
|
1565
1664
|
columnsRenderId,
|
|
1566
1665
|
visibilityRenderId,
|
|
1567
|
-
|
|
1666
|
+
columnsSizingRenderId,
|
|
1667
|
+
pinningRenderId,
|
|
1668
|
+
columnTypesRenderId
|
|
1568
1669
|
]);
|
|
1569
1670
|
const result = {
|
|
1570
1671
|
columns,
|
|
@@ -2991,15 +3092,17 @@ function enhancedFlatten(param) {
|
|
|
2991
3092
|
}
|
|
2992
3093
|
|
|
2993
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
|
+
};
|
|
2994
3103
|
var sortTypes = {
|
|
2995
|
-
number:
|
|
2996
|
-
|
|
2997
|
-
},
|
|
2998
|
-
string: function(first, second) {
|
|
2999
|
-
first = `${first}`;
|
|
3000
|
-
second = `${second}`;
|
|
3001
|
-
return first.localeCompare(second);
|
|
3002
|
-
}
|
|
3104
|
+
number: numberComparator,
|
|
3105
|
+
string: stringComparator
|
|
3003
3106
|
};
|
|
3004
3107
|
var sortTypes_default = sortTypes;
|
|
3005
3108
|
|
|
@@ -3554,20 +3657,22 @@ function getColumnsWhenGrouping(params) {
|
|
|
3554
3657
|
const computedColumns = new Map();
|
|
3555
3658
|
if (groupRenderStrategy === "multi-column") {
|
|
3556
3659
|
groupRowsBy.forEach((groupByForColumn, groupIndexForColumn, arr) => {
|
|
3557
|
-
|
|
3660
|
+
const generatedGroupColumn = getColumnForGroupBy({
|
|
3558
3661
|
groupByForColumn,
|
|
3559
3662
|
groupRowsBy,
|
|
3560
3663
|
groupIndexForColumn,
|
|
3561
3664
|
groupCount: arr.length,
|
|
3562
3665
|
groupRenderStrategy
|
|
3563
|
-
}, toggleGroupRow, groupColumn)
|
|
3666
|
+
}, toggleGroupRow, groupColumn);
|
|
3667
|
+
computedColumns.set(generatedGroupColumn.id || `group-by-${groupByForColumn.field}`, generatedGroupColumn);
|
|
3564
3668
|
});
|
|
3565
3669
|
} else if (groupRenderStrategy === "single-column") {
|
|
3566
|
-
|
|
3670
|
+
const singleGroupColumn = getSingleGroupColumn({
|
|
3567
3671
|
groupCount: groupRowsBy.length,
|
|
3568
3672
|
groupRowsBy,
|
|
3569
3673
|
groupRenderStrategy
|
|
3570
|
-
}, toggleGroupRow, groupColumn)
|
|
3674
|
+
}, toggleGroupRow, groupColumn);
|
|
3675
|
+
computedColumns.set(singleGroupColumn.id || "group-by", singleGroupColumn);
|
|
3571
3676
|
}
|
|
3572
3677
|
columns.forEach((col, colId) => {
|
|
3573
3678
|
computedColumns.set(colId, col);
|
|
@@ -3583,7 +3688,14 @@ function useComputed() {
|
|
|
3583
3688
|
componentActions: dataSourceActions,
|
|
3584
3689
|
componentState: dataSourceState
|
|
3585
3690
|
} = useDataSourceContextValue();
|
|
3586
|
-
const {
|
|
3691
|
+
const {
|
|
3692
|
+
columnOrder,
|
|
3693
|
+
columnVisibility,
|
|
3694
|
+
columnPinning,
|
|
3695
|
+
columnSizing,
|
|
3696
|
+
columnTypes,
|
|
3697
|
+
bodySize
|
|
3698
|
+
} = componentState;
|
|
3587
3699
|
useState4(() => {
|
|
3588
3700
|
componentState.onRowHeightCSSVarChange.onChange((rowHeight) => {
|
|
3589
3701
|
if (rowHeight) {
|
|
@@ -3628,6 +3740,7 @@ function useComputed() {
|
|
|
3628
3740
|
pinnedStartMaxWidth: componentState.pinnedStartMaxWidth,
|
|
3629
3741
|
pinnedEndMaxWidth: componentState.pinnedEndMaxWidth,
|
|
3630
3742
|
bodySize,
|
|
3743
|
+
viewportReservedWidth: componentState.viewportReservedWidth,
|
|
3631
3744
|
sortable: componentState.sortable,
|
|
3632
3745
|
draggableColumns: componentState.draggableColumns,
|
|
3633
3746
|
sortInfo: (_a = dataSourceState.sortInfo) != null ? _a : void 0,
|
|
@@ -3636,7 +3749,9 @@ function useComputed() {
|
|
|
3636
3749
|
columnOrder,
|
|
3637
3750
|
columnVisibility,
|
|
3638
3751
|
columnVisibilityAssumeVisible: true,
|
|
3639
|
-
columnPinning
|
|
3752
|
+
columnPinning,
|
|
3753
|
+
columnSizing,
|
|
3754
|
+
columnTypes
|
|
3640
3755
|
});
|
|
3641
3756
|
const unpinnedColumnWidths = computedUnpinnedColumns.map((c) => c.computedWidth);
|
|
3642
3757
|
let sortedUnpinnedColumnWidths = [...unpinnedColumnWidths].sort(sortAscending);
|
|
@@ -3712,33 +3827,6 @@ import {
|
|
|
3712
3827
|
createElement as createElement19
|
|
3713
3828
|
} from "react";
|
|
3714
3829
|
|
|
3715
|
-
// src/utils/getGlobal.ts
|
|
3716
|
-
function getGlobal() {
|
|
3717
|
-
return globalThis;
|
|
3718
|
-
}
|
|
3719
|
-
|
|
3720
|
-
// src/components/utils/getScrollbarWidth.ts
|
|
3721
|
-
var scrollbarWidth;
|
|
3722
|
-
function getScrollbarWidth() {
|
|
3723
|
-
var _a, _b;
|
|
3724
|
-
if (scrollbarWidth != null) {
|
|
3725
|
-
return scrollbarWidth;
|
|
3726
|
-
}
|
|
3727
|
-
const doc = (_a = getGlobal().document) != null ? _a : null;
|
|
3728
|
-
if (!doc) {
|
|
3729
|
-
return 0;
|
|
3730
|
-
}
|
|
3731
|
-
const outer = doc.createElement("div");
|
|
3732
|
-
outer.style.visibility = "hidden";
|
|
3733
|
-
outer.style.overflow = "scroll";
|
|
3734
|
-
doc.body.appendChild(outer);
|
|
3735
|
-
const inner = doc.createElement("div");
|
|
3736
|
-
outer.appendChild(inner);
|
|
3737
|
-
scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
|
|
3738
|
-
(_b = outer.parentNode) == null ? void 0 : _b.removeChild(outer);
|
|
3739
|
-
return scrollbarWidth;
|
|
3740
|
-
}
|
|
3741
|
-
|
|
3742
3830
|
// src/components/InfiniteTable/components/ScrollbarPlaceholder.tsx
|
|
3743
3831
|
import {
|
|
3744
3832
|
createElement as createElement8,
|
|
@@ -6973,11 +7061,11 @@ var SANDBOX_REGEX = /(https):\/\/\d+\-\d+\-\d\-(sandpack\.codesandbox\.io)/g;
|
|
|
6973
7061
|
var origin = typeof window !== "undefined" ? window.location.origin : "";
|
|
6974
7062
|
var [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
|
|
6975
7063
|
var isInsideSandbox = protocol === "https" && sandboxUrl === "sandpack.codesandbox.io";
|
|
6976
|
-
var useLicense = (licenseKey) => {
|
|
7064
|
+
var useLicense = (licenseKey = "") => {
|
|
6977
7065
|
const valid = useMemo11(() => {
|
|
6978
7066
|
let valid2 = isValidLicense(licenseKey, {
|
|
6979
7067
|
publishedAt: 1624970570587,
|
|
6980
|
-
version: "0.0.
|
|
7068
|
+
version: "0.0.8"
|
|
6981
7069
|
});
|
|
6982
7070
|
if (!licenseKey && !valid2 && isInsideSandbox) {
|
|
6983
7071
|
return true;
|
|
@@ -6994,7 +7082,7 @@ import {
|
|
|
6994
7082
|
useLayoutEffect as useLayoutEffect5
|
|
6995
7083
|
} from "react";
|
|
6996
7084
|
import { useRef as useRef17 } from "react";
|
|
6997
|
-
var
|
|
7085
|
+
var error = err("CSSVariableWatch");
|
|
6998
7086
|
var debug5 = dbg("CSSVariableWatch");
|
|
6999
7087
|
var WRAPPER_STYLE = {
|
|
7000
7088
|
position: "absolute",
|
|
@@ -7021,7 +7109,7 @@ var useCSSVariableWatch = (params) => {
|
|
|
7021
7109
|
debug5(`Variable ${params.varName} found and equals ${value}.`);
|
|
7022
7110
|
params.onChange(value);
|
|
7023
7111
|
} else {
|
|
7024
|
-
|
|
7112
|
+
error(`Specified variable ${params.varName} not found or does not have a numeric value.`);
|
|
7025
7113
|
}
|
|
7026
7114
|
}, []);
|
|
7027
7115
|
};
|