@infinite-table/infinite-react 0.2.11 → 0.2.12
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.d.ts +16 -2
- package/index.esm.js +17 -16
- package/index.js +17 -16
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import * as _vanilla_extract_private from '@vanilla-extract/private';
|
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import { CSSProperties, MutableRefObject } from 'react';
|
|
4
4
|
|
|
5
|
+
declare function debounce(fn: Function, { wait }: {
|
|
6
|
+
wait: number;
|
|
7
|
+
}): (...args: any[]) => void;
|
|
8
|
+
|
|
5
9
|
interface ScrollPosition {
|
|
6
10
|
scrollTop: number;
|
|
7
11
|
scrollLeft: number;
|
|
@@ -466,6 +470,9 @@ declare type InfiniteTableColumnVerticalAlign = 'start' | 'center' | 'end';
|
|
|
466
470
|
declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
|
|
467
471
|
declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
|
|
468
472
|
declare type InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<T> = RequireAtLeastOne<{
|
|
473
|
+
/**
|
|
474
|
+
* Determines the field property of the column.
|
|
475
|
+
*/
|
|
469
476
|
field?: keyof T;
|
|
470
477
|
render?: InfiniteTableColumnRenderFunction<T>;
|
|
471
478
|
renderValue?: InfiniteTableColumnRenderFunction<T>;
|
|
@@ -520,7 +527,14 @@ declare type InfiniteTableBaseColumn<T> = {
|
|
|
520
527
|
minWidth?: number;
|
|
521
528
|
maxWidth?: number;
|
|
522
529
|
};
|
|
523
|
-
|
|
530
|
+
/**
|
|
531
|
+
* Defines a column in the table.
|
|
532
|
+
*
|
|
533
|
+
* @typeParam DATA_TYPE The type of the data in the table.
|
|
534
|
+
*
|
|
535
|
+
* Can be bound to a field which is a `keyof DATA_TYPE`.
|
|
536
|
+
*/
|
|
537
|
+
declare type InfiniteTableColumn<DATA_TYPE> = {} & InfiniteTableBaseColumn<DATA_TYPE> & InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<DATA_TYPE>;
|
|
524
538
|
declare type InfiniteTableGeneratedGroupColumn<T> = InfiniteTableColumn<T> & {
|
|
525
539
|
groupByField: string | string[];
|
|
526
540
|
id?: string;
|
|
@@ -1054,4 +1068,4 @@ declare function interceptMap<K, V>(map: Map<K, V>, fns: InterceptedMapFns<K, V>
|
|
|
1054
1068
|
|
|
1055
1069
|
declare function useEffectWithChanges(fn: (changes: Record<string, any>, prevValues: Record<string, any>) => void | (() => void), deps: Record<string, any>): void;
|
|
1056
1070
|
|
|
1057
|
-
export { DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceExpandedAndCollapsedGroupRows, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropGroupBy, DataSourcePropLivePaginationCursor, DataSourcePropPivotBy, DataSourceProps, DataSourceReducer, DataSourceRemoteData, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, GroupRowsState, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTableImperativeApi, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTablePropComponents, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyGroupRowInfo, Scrollbars, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges };
|
|
1071
|
+
export { DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceExpandedAndCollapsedGroupRows, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropGroupBy, DataSourcePropLivePaginationCursor, DataSourcePropPivotBy, DataSourceProps, DataSourceReducer, DataSourceRemoteData, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, GroupRowsState, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderParam, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTableImperativeApi, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTablePropComponents, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyGroupRowInfo, Scrollbars, debounce, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges };
|
package/index.esm.js
CHANGED
|
@@ -616,6 +616,20 @@ var require_vanilla_extract_recipes_createRuntimeFn_cjs = __commonJS({
|
|
|
616
616
|
}
|
|
617
617
|
});
|
|
618
618
|
|
|
619
|
+
// src/components/utils/debounce.ts
|
|
620
|
+
function debounce(fn, { wait }) {
|
|
621
|
+
let timeout = null;
|
|
622
|
+
return function(...args) {
|
|
623
|
+
const context = this;
|
|
624
|
+
if (timeout !== null) {
|
|
625
|
+
clearTimeout(timeout);
|
|
626
|
+
}
|
|
627
|
+
timeout = setTimeout(() => {
|
|
628
|
+
fn.apply(context, args);
|
|
629
|
+
}, wait);
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
|
|
619
633
|
// src/components/InfiniteTable/index.tsx
|
|
620
634
|
import {
|
|
621
635
|
StrictMode,
|
|
@@ -1731,7 +1745,6 @@ var getComputedVisibleColumns = ({
|
|
|
1731
1745
|
}
|
|
1732
1746
|
return acc;
|
|
1733
1747
|
}, {});
|
|
1734
|
-
console.log(columnSizing, "columnSizing");
|
|
1735
1748
|
const flexResult = computeFlex({
|
|
1736
1749
|
availableSize: Math.max(bodySize.width - (viewportReservedWidth != null ? viewportReservedWidth : 0) - getScrollbarWidth(), 0),
|
|
1737
1750
|
maxSize: columnMaxWidth,
|
|
@@ -2100,6 +2113,7 @@ var useComputedVisibleColumns = ({
|
|
|
2100
2113
|
pinnedEndMaxWidth,
|
|
2101
2114
|
pinnedStartMaxWidth,
|
|
2102
2115
|
columnSizing,
|
|
2116
|
+
columnTypes,
|
|
2103
2117
|
columnPinning,
|
|
2104
2118
|
columnsRenderId,
|
|
2105
2119
|
pinningRenderId
|
|
@@ -3476,20 +3490,6 @@ function useEffectWithChanges(fn, deps) {
|
|
|
3476
3490
|
}, useEffectDeps);
|
|
3477
3491
|
}
|
|
3478
3492
|
|
|
3479
|
-
// src/components/utils/debounce.ts
|
|
3480
|
-
function debounce(fn, { wait }) {
|
|
3481
|
-
let timeout = null;
|
|
3482
|
-
return function(...args) {
|
|
3483
|
-
const context = this;
|
|
3484
|
-
if (timeout !== null) {
|
|
3485
|
-
clearTimeout(timeout);
|
|
3486
|
-
}
|
|
3487
|
-
timeout = setTimeout(() => {
|
|
3488
|
-
fn.apply(context, args);
|
|
3489
|
-
}, wait);
|
|
3490
|
-
};
|
|
3491
|
-
}
|
|
3492
|
-
|
|
3493
3493
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
3494
3494
|
var getRafPromise = () => new Promise((resolve) => {
|
|
3495
3495
|
requestAnimationFrame(resolve);
|
|
@@ -7861,7 +7861,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
7861
7861
|
const valid = useMemo12(() => {
|
|
7862
7862
|
let valid2 = isValidLicense(licenseKey, {
|
|
7863
7863
|
publishedAt: 1624970570587,
|
|
7864
|
-
version: "0.2.
|
|
7864
|
+
version: "0.2.12"
|
|
7865
7865
|
});
|
|
7866
7866
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
7867
7867
|
return true;
|
|
@@ -8350,6 +8350,7 @@ export {
|
|
|
8350
8350
|
InfiniteTable,
|
|
8351
8351
|
InfiniteTableClassName,
|
|
8352
8352
|
InfiniteTableComponent,
|
|
8353
|
+
debounce,
|
|
8353
8354
|
flatten,
|
|
8354
8355
|
getComponentStateRoot,
|
|
8355
8356
|
group,
|
package/index.js
CHANGED
|
@@ -629,6 +629,7 @@ __export(exports, {
|
|
|
629
629
|
InfiniteTable: () => InfiniteTable,
|
|
630
630
|
InfiniteTableClassName: () => InfiniteTableClassName,
|
|
631
631
|
InfiniteTableComponent: () => InfiniteTableComponent,
|
|
632
|
+
debounce: () => debounce,
|
|
632
633
|
flatten: () => flatten,
|
|
633
634
|
getComponentStateRoot: () => getComponentStateRoot,
|
|
634
635
|
group: () => group,
|
|
@@ -639,6 +640,20 @@ __export(exports, {
|
|
|
639
640
|
useEffectWithChanges: () => useEffectWithChanges
|
|
640
641
|
});
|
|
641
642
|
|
|
643
|
+
// src/components/utils/debounce.ts
|
|
644
|
+
function debounce(fn, { wait }) {
|
|
645
|
+
let timeout = null;
|
|
646
|
+
return function(...args) {
|
|
647
|
+
const context = this;
|
|
648
|
+
if (timeout !== null) {
|
|
649
|
+
clearTimeout(timeout);
|
|
650
|
+
}
|
|
651
|
+
timeout = setTimeout(() => {
|
|
652
|
+
fn.apply(context, args);
|
|
653
|
+
}, wait);
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
|
|
642
657
|
// src/components/InfiniteTable/index.tsx
|
|
643
658
|
var React34 = __toModule(require("react"));
|
|
644
659
|
|
|
@@ -1740,7 +1755,6 @@ var getComputedVisibleColumns = ({
|
|
|
1740
1755
|
}
|
|
1741
1756
|
return acc;
|
|
1742
1757
|
}, {});
|
|
1743
|
-
console.log(columnSizing, "columnSizing");
|
|
1744
1758
|
const flexResult = computeFlex({
|
|
1745
1759
|
availableSize: Math.max(bodySize.width - (viewportReservedWidth != null ? viewportReservedWidth : 0) - getScrollbarWidth(), 0),
|
|
1746
1760
|
maxSize: columnMaxWidth,
|
|
@@ -2109,6 +2123,7 @@ var useComputedVisibleColumns = ({
|
|
|
2109
2123
|
pinnedEndMaxWidth,
|
|
2110
2124
|
pinnedStartMaxWidth,
|
|
2111
2125
|
columnSizing,
|
|
2126
|
+
columnTypes,
|
|
2112
2127
|
columnPinning,
|
|
2113
2128
|
columnsRenderId,
|
|
2114
2129
|
pinningRenderId
|
|
@@ -3462,20 +3477,6 @@ function useEffectWithChanges(fn, deps) {
|
|
|
3462
3477
|
}, useEffectDeps);
|
|
3463
3478
|
}
|
|
3464
3479
|
|
|
3465
|
-
// src/components/utils/debounce.ts
|
|
3466
|
-
function debounce(fn, { wait }) {
|
|
3467
|
-
let timeout = null;
|
|
3468
|
-
return function(...args) {
|
|
3469
|
-
const context = this;
|
|
3470
|
-
if (timeout !== null) {
|
|
3471
|
-
clearTimeout(timeout);
|
|
3472
|
-
}
|
|
3473
|
-
timeout = setTimeout(() => {
|
|
3474
|
-
fn.apply(context, args);
|
|
3475
|
-
}, wait);
|
|
3476
|
-
};
|
|
3477
|
-
}
|
|
3478
|
-
|
|
3479
3480
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
3480
3481
|
var getRafPromise = () => new Promise((resolve) => {
|
|
3481
3482
|
requestAnimationFrame(resolve);
|
|
@@ -7768,7 +7769,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
7768
7769
|
const valid = (0, import_react42.useMemo)(() => {
|
|
7769
7770
|
let valid2 = isValidLicense(licenseKey, {
|
|
7770
7771
|
publishedAt: 1624970570587,
|
|
7771
|
-
version: "0.2.
|
|
7772
|
+
version: "0.2.12"
|
|
7772
7773
|
});
|
|
7773
7774
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
7774
7775
|
return true;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infinite-table/infinite-react",
|
|
3
3
|
"description": "Infinite Table for React",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.12",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.esm.js",
|
|
7
7
|
"typings": "index.d.ts",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "Commercial & Open Source",
|
|
16
16
|
"//": "will be updated at build time",
|
|
17
|
-
"publishedAt":
|
|
17
|
+
"publishedAt": 1646828095950
|
|
18
18
|
}
|