@infinite-table/infinite-react 0.3.0-canary.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +47 -41
- package/index.d.ts +414 -274
- package/index.esm.css +47 -41
- package/index.esm.js +684 -363
- package/index.js +684 -365
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -6,32 +6,6 @@ declare function debounce(fn: Function, { wait }: {
|
|
|
6
6
|
wait: number;
|
|
7
7
|
}): (...args: any[]) => void;
|
|
8
8
|
|
|
9
|
-
declare type Renderable = React$1.ReactNode | JSX.Element;
|
|
10
|
-
|
|
11
|
-
declare type SortDir = 1 | -1;
|
|
12
|
-
declare type MultisortInfo<T> = {
|
|
13
|
-
/**
|
|
14
|
-
* The sorting direction
|
|
15
|
-
*/
|
|
16
|
-
dir: SortDir;
|
|
17
|
-
/**
|
|
18
|
-
* a property whose value to use for sorting on the array items
|
|
19
|
-
*/
|
|
20
|
-
field?: keyof T;
|
|
21
|
-
/**
|
|
22
|
-
* for now 'string' and 'number' are known types, meaning they have
|
|
23
|
-
* sort functions already implemented
|
|
24
|
-
*/
|
|
25
|
-
type?: string;
|
|
26
|
-
fn?: (a: any, b: any) => number;
|
|
27
|
-
};
|
|
28
|
-
declare const multisort: {
|
|
29
|
-
<T>(sortInfo: MultisortInfo<T>[], array: T[], get?: ((item: any) => T) | undefined): T[];
|
|
30
|
-
knownTypes: {
|
|
31
|
-
[key: string]: (first: any, second: any) => number;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
9
|
declare type VoidFn$1 = () => void;
|
|
36
10
|
declare type Pair<KeyType, ValueType> = {
|
|
37
11
|
value?: ValueType;
|
|
@@ -47,6 +21,9 @@ declare class DeepMap<KeyType, ValueType> {
|
|
|
47
21
|
static clone<KeyType, ValueType>(map: DeepMap<KeyType, ValueType>): DeepMap<KeyType, ValueType>;
|
|
48
22
|
constructor(initial?: [KeyType[], ValueType][]);
|
|
49
23
|
getValuesStartingWith(keys: KeyType[]): ValueType[];
|
|
24
|
+
getKeysStartingWith(keys: KeyType[]): KeyType[][];
|
|
25
|
+
private getStartingWith;
|
|
26
|
+
getDirectChildrenSizeFor(keys: KeyType[]): number;
|
|
50
27
|
set(keys: KeyType[] & {
|
|
51
28
|
length: Omit<number, 0>;
|
|
52
29
|
}, value: ValueType): this;
|
|
@@ -69,60 +46,29 @@ declare class DeepMap<KeyType, ValueType> {
|
|
|
69
46
|
private sortedIterator;
|
|
70
47
|
}
|
|
71
48
|
|
|
72
|
-
declare
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
scrollTop: number;
|
|
96
|
-
scrollLeft: number;
|
|
97
|
-
}
|
|
98
|
-
declare type OnScrollFn = (scrollPosition: ScrollPosition) => void;
|
|
99
|
-
|
|
100
|
-
interface Size {
|
|
101
|
-
width: number;
|
|
102
|
-
height: number;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
declare type VoidFn = () => void;
|
|
106
|
-
|
|
107
|
-
declare type SubscriptionCallbackOnChangeFn<T> = (node: T | null) => void;
|
|
108
|
-
interface SubscriptionCallback<T> {
|
|
109
|
-
(node: T): void;
|
|
110
|
-
get: () => T | null;
|
|
111
|
-
destroy: VoidFn;
|
|
112
|
-
onChange: (fn: SubscriptionCallbackOnChangeFn<T>) => VoidFn;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
declare class ScrollListener {
|
|
116
|
-
private scrollPosition;
|
|
117
|
-
private onScrollFns;
|
|
118
|
-
getScrollPosition: () => ScrollPosition;
|
|
119
|
-
onScroll: (fn: OnScrollFn) => () => void;
|
|
120
|
-
setScrollPosition: (scrollPosition: ScrollPosition) => void;
|
|
121
|
-
private notifyScrollChange;
|
|
122
|
-
destroy: () => void;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
declare type NonUndefined<T> = T extends undefined ? never : T;
|
|
49
|
+
declare type SortDir = 1 | -1;
|
|
50
|
+
declare type MultisortInfo<T> = {
|
|
51
|
+
/**
|
|
52
|
+
* The sorting direction
|
|
53
|
+
*/
|
|
54
|
+
dir: SortDir;
|
|
55
|
+
/**
|
|
56
|
+
* a property whose value to use for sorting on the array items
|
|
57
|
+
*/
|
|
58
|
+
field?: keyof T;
|
|
59
|
+
/**
|
|
60
|
+
* for now 'string' and 'number' are known types, meaning they have
|
|
61
|
+
* sort functions already implemented
|
|
62
|
+
*/
|
|
63
|
+
type?: string;
|
|
64
|
+
fn?: (a: any, b: any) => number;
|
|
65
|
+
};
|
|
66
|
+
declare const multisort: {
|
|
67
|
+
<T>(sortInfo: MultisortInfo<T>[], array: T[], get?: ((item: any) => T) | undefined): T[];
|
|
68
|
+
knownTypes: {
|
|
69
|
+
[key: string]: (first: any, second: any) => number;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
126
72
|
|
|
127
73
|
declare type ComponentStateContext<T_STATE, T_ACTIONS> = {
|
|
128
74
|
getComponentState: () => T_STATE;
|
|
@@ -140,6 +86,23 @@ declare type ComponentInterceptedActions<T_STATE> = {
|
|
|
140
86
|
};
|
|
141
87
|
declare type ComponentStateActions<T_STATE> = ComponentStateGeneratedActions<T_STATE>;
|
|
142
88
|
|
|
89
|
+
declare enum InfiniteTableActionType {
|
|
90
|
+
SET_COLUMN_SIZE = 0,
|
|
91
|
+
SET_SCROLL_POSITION = 1,
|
|
92
|
+
SET_BODY_SIZE = 2,
|
|
93
|
+
SET_COLUMN_ORDER = 3,
|
|
94
|
+
SET_COLUMN_VISIBILITY = 4,
|
|
95
|
+
SET_COLUMN_SHIFTS = 5,
|
|
96
|
+
SET_COLUMN_PINNING = 6,
|
|
97
|
+
SET_COLUMN_AGGREGATIONS = 7,
|
|
98
|
+
SET_DRAGGING_COLUMN_ID = 8
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare type InfiniteTableAction = {
|
|
102
|
+
type: InfiniteTableActionType;
|
|
103
|
+
payload?: any;
|
|
104
|
+
};
|
|
105
|
+
|
|
143
106
|
interface LogFn {
|
|
144
107
|
(...args: any[]): LogFn;
|
|
145
108
|
extend: (channelName: string) => LogFn;
|
|
@@ -150,6 +113,19 @@ declare class Logger {
|
|
|
150
113
|
constructor(channelName: string);
|
|
151
114
|
}
|
|
152
115
|
|
|
116
|
+
interface ScrollPosition {
|
|
117
|
+
scrollTop: number;
|
|
118
|
+
scrollLeft: number;
|
|
119
|
+
}
|
|
120
|
+
declare type OnScrollFn = (scrollPosition: ScrollPosition) => void;
|
|
121
|
+
|
|
122
|
+
interface Size {
|
|
123
|
+
width: number;
|
|
124
|
+
height: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
declare type VoidFn = () => void;
|
|
128
|
+
|
|
153
129
|
declare type FixedPosition = false | 'start' | 'end';
|
|
154
130
|
declare type SpanFunction = ({ rowIndex, colIndex, }: {
|
|
155
131
|
rowIndex: number;
|
|
@@ -398,6 +374,28 @@ declare class MatrixBrain extends Logger {
|
|
|
398
374
|
destroy: () => void;
|
|
399
375
|
}
|
|
400
376
|
|
|
377
|
+
declare type Renderable = React$1.ReactNode | JSX.Element;
|
|
378
|
+
|
|
379
|
+
declare type SubscriptionCallbackOnChangeFn<T> = (node: T | null) => void;
|
|
380
|
+
interface SubscriptionCallback<T> {
|
|
381
|
+
(node: T, callback?: () => void): void;
|
|
382
|
+
get: () => T | null;
|
|
383
|
+
destroy: VoidFn;
|
|
384
|
+
onChange: (fn: SubscriptionCallbackOnChangeFn<T>) => VoidFn;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
declare class ScrollListener {
|
|
388
|
+
private scrollPosition;
|
|
389
|
+
private onScrollFns;
|
|
390
|
+
getScrollPosition: () => ScrollPosition;
|
|
391
|
+
onScroll: (fn: OnScrollFn) => () => void;
|
|
392
|
+
setScrollPosition: (scrollPosition: ScrollPosition) => void;
|
|
393
|
+
private notifyScrollChange;
|
|
394
|
+
destroy: () => void;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
declare type NonUndefined<T> = T extends undefined ? never : T;
|
|
398
|
+
|
|
401
399
|
interface InfiniteTableSetupState<T> {
|
|
402
400
|
propsCache: Map<keyof InfiniteTableProps<T>, WeakMap<any, any>>;
|
|
403
401
|
columnsWhenInlineGroupRenderStrategy?: Map<string, InfiniteTableColumn<T>>;
|
|
@@ -496,63 +494,10 @@ declare type InfiniteTableActions<T> = ComponentStateActions<InfiniteTableState<
|
|
|
496
494
|
interface InfiniteTableState<T> extends InfiniteTableMappedState<T>, InfiniteTableDerivedState<T>, InfiniteTableSetupState<T> {
|
|
497
495
|
}
|
|
498
496
|
|
|
499
|
-
declare enum InfiniteTableActionType {
|
|
500
|
-
SET_COLUMN_SIZE = 0,
|
|
501
|
-
SET_SCROLL_POSITION = 1,
|
|
502
|
-
SET_BODY_SIZE = 2,
|
|
503
|
-
SET_COLUMN_ORDER = 3,
|
|
504
|
-
SET_COLUMN_VISIBILITY = 4,
|
|
505
|
-
SET_COLUMN_SHIFTS = 5,
|
|
506
|
-
SET_COLUMN_PINNING = 6,
|
|
507
|
-
SET_COLUMN_AGGREGATIONS = 7,
|
|
508
|
-
SET_DRAGGING_COLUMN_ID = 8
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
declare type InfiniteTableAction = {
|
|
512
|
-
type: InfiniteTableActionType;
|
|
513
|
-
payload?: any;
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
interface InfiniteTableComputedValues<T> {
|
|
517
|
-
scrollbars: {
|
|
518
|
-
vertical: boolean;
|
|
519
|
-
horizontal: boolean;
|
|
520
|
-
};
|
|
521
|
-
rowspan?: MatrixBrainOptions['rowspan'];
|
|
522
|
-
computedPinnedStartOverflow: boolean;
|
|
523
|
-
computedPinnedEndOverflow: boolean;
|
|
524
|
-
computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
|
|
525
|
-
computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
|
|
526
|
-
computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
|
|
527
|
-
computedVisibleColumns: InfiniteTableComputedColumn<T>[];
|
|
528
|
-
computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
|
|
529
|
-
computedColumnVisibility: InfiniteTablePropColumnVisibility;
|
|
530
|
-
computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
|
|
531
|
-
computedPinnedStartColumnsWidth: number;
|
|
532
|
-
computedPinnedStartWidth: number;
|
|
533
|
-
computedPinnedEndColumnsWidth: number;
|
|
534
|
-
computedPinnedEndWidth: number;
|
|
535
|
-
computedUnpinnedColumnsWidth: number;
|
|
536
|
-
computedUnpinnedOffset: number;
|
|
537
|
-
computedPinnedEndOffset: number;
|
|
538
|
-
computedRemainingSpace: number;
|
|
539
|
-
toggleGroupRow: (groupKeys: any[]) => void;
|
|
540
|
-
columnSize: (colIndex: number) => number;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
interface InfiniteTableContextValue<T> {
|
|
544
|
-
componentState: InfiniteTableState<T>;
|
|
545
|
-
componentActions: InfiniteTableActions<T>;
|
|
546
|
-
computed: InfiniteTableComputedValues<T>;
|
|
547
|
-
getComputed: () => InfiniteTableComputedValues<T>;
|
|
548
|
-
getState: () => InfiniteTableState<T>;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
497
|
declare type LoadMaskProps = {
|
|
552
498
|
visible: boolean;
|
|
553
499
|
children: Renderable;
|
|
554
500
|
};
|
|
555
|
-
|
|
556
501
|
declare type InfiniteTablePropColumnOrderNormalized = string[];
|
|
557
502
|
declare type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormalized | true;
|
|
558
503
|
declare type InfiniteTablePropColumnVisibility = Record<string, false>;
|
|
@@ -563,13 +508,7 @@ declare type InfiniteTablePropColumnPinning = InfiniteTablePropColumnPinningReco
|
|
|
563
508
|
declare type InfiniteTableRowStyleFnParams<T> = {
|
|
564
509
|
rowIndex: number;
|
|
565
510
|
groupBy?: (keyof T)[];
|
|
566
|
-
} &
|
|
567
|
-
data: T;
|
|
568
|
-
rowInfo: InfiniteTableRowInfoNormal<T>;
|
|
569
|
-
} | {
|
|
570
|
-
data: Partial<T> | null;
|
|
571
|
-
rowInfo: InfiniteTableRowInfoGroup<T>;
|
|
572
|
-
});
|
|
511
|
+
} & InfiniteTableRowInfoDataDiscriminator<T>;
|
|
573
512
|
declare type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => undefined | React$1.CSSProperties;
|
|
574
513
|
declare type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => string | undefined;
|
|
575
514
|
declare type InfiniteTablePropRowStyle<T> = React$1.CSSProperties | InfiniteTableRowStyleFn<T>;
|
|
@@ -755,101 +694,40 @@ declare type Scrollbars = {
|
|
|
755
694
|
horizontal: boolean;
|
|
756
695
|
};
|
|
757
696
|
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
rootGroupBy?: (keyof T)[];
|
|
793
|
-
pivotValuesMap?: PivotValuesDeepMap<T, any>;
|
|
794
|
-
reducerResults?: Record<string, AggregationReducerResult>;
|
|
795
|
-
};
|
|
796
|
-
declare type InfiniteTableEnhancedGroupInfo<T> = InfiniteTableRowInfo<T> & {
|
|
797
|
-
data: Partial<T> | null;
|
|
798
|
-
groupData: T[];
|
|
799
|
-
flatRowInfoList: (InfiniteTableRowInfo<T> | InfiniteTableEnhancedGroupInfo<T>)[];
|
|
800
|
-
value: any;
|
|
801
|
-
isGroupRow: true;
|
|
802
|
-
collapsedChildrenCount: number;
|
|
803
|
-
collapsedGroupsCount: number;
|
|
804
|
-
groupNesting: number;
|
|
805
|
-
groupKeys?: any[];
|
|
806
|
-
groupCount: number;
|
|
807
|
-
groupBy: (keyof T)[];
|
|
808
|
-
rootGroupBy: (keyof T)[];
|
|
809
|
-
pivotValuesMap?: PivotValuesDeepMap<T, any>;
|
|
810
|
-
};
|
|
811
|
-
declare type GroupKeyType<T extends any = any> = T;
|
|
812
|
-
declare type PivotReducerResults<T = any> = Record<string, AggregationReducerResult<T>>;
|
|
813
|
-
declare type PivotGroupValueType<DataType, KeyType> = {
|
|
814
|
-
reducerResults: PivotReducerResults<KeyType>;
|
|
815
|
-
items: DataType[];
|
|
816
|
-
};
|
|
817
|
-
declare type PivotValuesDeepMap<DataType, KeyType> = DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
|
|
818
|
-
declare type DeepMapGroupValueType<DataType, KeyType> = {
|
|
819
|
-
items: DataType[];
|
|
820
|
-
commonData?: Partial<DataType>;
|
|
821
|
-
reducerResults: Record<string, AggregationReducerResult>;
|
|
822
|
-
pivotDeepMap?: DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
|
|
823
|
-
};
|
|
824
|
-
declare type GroupBy<DataType, KeyType> = {
|
|
825
|
-
field: keyof DataType;
|
|
826
|
-
toKey?: (value: any, data: DataType) => GroupKeyType<KeyType>;
|
|
827
|
-
column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
|
|
828
|
-
};
|
|
829
|
-
declare type PivotBy<DataType, KeyType> = Omit<GroupBy<DataType, KeyType>, 'column'> & {
|
|
830
|
-
column?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<DataType>>> | (({ column, }: {
|
|
831
|
-
column: InfiniteTablePivotFinalColumnVariant<DataType, KeyType>;
|
|
832
|
-
}) => Partial<InfiniteTablePivotColumn<DataType>>);
|
|
833
|
-
columnGroup?: InfiniteTableColumnGroup | (({ columnGroup, }: {
|
|
834
|
-
columnGroup: InfiniteTablePivotFinalColumnGroup<DataType, KeyType>;
|
|
835
|
-
}) => ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnGroup<DataType>>>);
|
|
836
|
-
};
|
|
837
|
-
declare type GroupParams<DataType, KeyType> = {
|
|
838
|
-
groupBy: GroupBy<DataType, KeyType>[];
|
|
839
|
-
defaultToKey?: (value: any, item: DataType) => GroupKeyType<KeyType>;
|
|
840
|
-
pivot?: PivotBy<DataType, KeyType>[];
|
|
841
|
-
reducers?: Record<string, DataSourceAggregationReducer<DataType, any>>;
|
|
842
|
-
};
|
|
843
|
-
declare type DataGroupResult<DataType, KeyType extends any> = {
|
|
844
|
-
deepMap: DeepMap<GroupKeyType<KeyType>, DeepMapGroupValueType<DataType, KeyType>>;
|
|
845
|
-
groupParams: GroupParams<DataType, KeyType>;
|
|
846
|
-
initialData: DataType[];
|
|
847
|
-
reducerResults?: Record<string, AggregationReducerResult>;
|
|
848
|
-
topLevelPivotColumns?: DeepMap<GroupKeyType<KeyType>, boolean>;
|
|
849
|
-
pivot?: PivotBy<DataType, KeyType>[];
|
|
850
|
-
};
|
|
851
|
-
declare function group<DataType, KeyType = any>(groupParams: GroupParams<DataType, KeyType>, data: DataType[]): DataGroupResult<DataType, KeyType>;
|
|
852
|
-
declare function flatten<DataType, KeyType extends any>(groupResult: DataGroupResult<DataType, KeyType>): DataType[];
|
|
697
|
+
interface InfiniteTableComputedValues<T> {
|
|
698
|
+
scrollbars: {
|
|
699
|
+
vertical: boolean;
|
|
700
|
+
horizontal: boolean;
|
|
701
|
+
};
|
|
702
|
+
rowspan?: MatrixBrainOptions['rowspan'];
|
|
703
|
+
computedPinnedStartOverflow: boolean;
|
|
704
|
+
computedPinnedEndOverflow: boolean;
|
|
705
|
+
computedPinnedStartColumns: InfiniteTableComputedColumn<T>[];
|
|
706
|
+
computedPinnedEndColumns: InfiniteTableComputedColumn<T>[];
|
|
707
|
+
computedUnpinnedColumns: InfiniteTableComputedColumn<T>[];
|
|
708
|
+
computedVisibleColumns: InfiniteTableComputedColumn<T>[];
|
|
709
|
+
computedVisibleColumnsMap: Map<string, InfiniteTableComputedColumn<T>>;
|
|
710
|
+
computedColumnVisibility: InfiniteTablePropColumnVisibility;
|
|
711
|
+
computedColumnOrder: InfiniteTablePropColumnOrderNormalized;
|
|
712
|
+
computedPinnedStartColumnsWidth: number;
|
|
713
|
+
computedPinnedStartWidth: number;
|
|
714
|
+
computedPinnedEndColumnsWidth: number;
|
|
715
|
+
computedPinnedEndWidth: number;
|
|
716
|
+
computedUnpinnedColumnsWidth: number;
|
|
717
|
+
computedUnpinnedOffset: number;
|
|
718
|
+
computedPinnedEndOffset: number;
|
|
719
|
+
computedRemainingSpace: number;
|
|
720
|
+
toggleGroupRow: (groupKeys: any[]) => void;
|
|
721
|
+
columnSize: (colIndex: number) => number;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
interface InfiniteTableContextValue<T> {
|
|
725
|
+
componentState: InfiniteTableState<T>;
|
|
726
|
+
componentActions: InfiniteTableActions<T>;
|
|
727
|
+
computed: InfiniteTableComputedValues<T>;
|
|
728
|
+
getComputed: () => InfiniteTableComputedValues<T>;
|
|
729
|
+
getState: () => InfiniteTableState<T>;
|
|
730
|
+
}
|
|
853
731
|
|
|
854
732
|
declare type RenderRange = {
|
|
855
733
|
renderStartIndex: number;
|
|
@@ -861,6 +739,7 @@ interface DataSourceDataParams<T> {
|
|
|
861
739
|
sortInfo?: DataSourceSortInfo<T>;
|
|
862
740
|
groupBy?: DataSourcePropGroupBy<T>;
|
|
863
741
|
pivotBy?: DataSourcePropPivotBy<T>;
|
|
742
|
+
groupRowsState?: DataSourcePropGroupRowsStateObject<any>;
|
|
864
743
|
lazyLoadBatchSize?: number;
|
|
865
744
|
lazyLoadStartIndex?: number;
|
|
866
745
|
groupKeys?: any[];
|
|
@@ -879,7 +758,7 @@ declare type DataSourceGroupBy<T> = GroupBy<T, any>;
|
|
|
879
758
|
declare type DataSourcePivotBy<T> = PivotBy<T, any>;
|
|
880
759
|
declare type DataSourceSortInfo<T> = null | DataSourceSingleSortInfo<T> | DataSourceSingleSortInfo<T>[];
|
|
881
760
|
declare type DataSourceRemoteData<T> = {
|
|
882
|
-
data: T[];
|
|
761
|
+
data: T[] | LazyGroupDataItem<T>[];
|
|
883
762
|
mappings?: DataSourceMappings;
|
|
884
763
|
cache?: boolean;
|
|
885
764
|
totalCount?: number;
|
|
@@ -887,7 +766,7 @@ declare type DataSourceRemoteData<T> = {
|
|
|
887
766
|
};
|
|
888
767
|
declare type DataSourceData<T> = T[] | DataSourceRemoteData<T> | Promise<T[] | DataSourceRemoteData<T>> | ((dataInfo: DataSourceDataParams<T>) => T[] | Promise<T[] | DataSourceRemoteData<T>>);
|
|
889
768
|
declare type DataSourceGroupRowsList<KeyType> = true | KeyType[][];
|
|
890
|
-
declare type
|
|
769
|
+
declare type DataSourcePropGroupRowsStateObject<KeyType> = {
|
|
891
770
|
expandedRows: DataSourceGroupRowsList<KeyType>;
|
|
892
771
|
collapsedRows: DataSourceGroupRowsList<KeyType>;
|
|
893
772
|
};
|
|
@@ -901,7 +780,7 @@ interface DataSourceMappedState<T> {
|
|
|
901
780
|
data: DataSourceProps<T>['data'];
|
|
902
781
|
primaryKey: DataSourceProps<T>['primaryKey'];
|
|
903
782
|
groupBy: NonUndefined<DataSourceProps<T>['groupBy']>;
|
|
904
|
-
groupRowsState:
|
|
783
|
+
groupRowsState: GroupRowsState<T>;
|
|
905
784
|
pivotBy: DataSourceProps<T>['pivotBy'];
|
|
906
785
|
loading: NonUndefined<DataSourceProps<T>['loading']>;
|
|
907
786
|
collapseGroupRowsOnDataFunctionChange: NonUndefined<DataSourceProps<T>['collapseGroupRowsOnDataFunctionChange']>;
|
|
@@ -926,18 +805,26 @@ declare type LazyGroupDataItem<DataType> = {
|
|
|
926
805
|
data: Partial<DataType>;
|
|
927
806
|
keys: any[];
|
|
928
807
|
aggregations?: Record<string, any>;
|
|
808
|
+
dataset?: DataSourceRemoteData<DataType>;
|
|
929
809
|
pivot?: {
|
|
930
810
|
values: Record<string, any>;
|
|
931
811
|
totals?: Record<string, any>;
|
|
932
812
|
};
|
|
933
813
|
};
|
|
934
|
-
declare type
|
|
935
|
-
|
|
814
|
+
declare type LazyRowInfoGroup<DataType> = {
|
|
815
|
+
/**
|
|
816
|
+
* Those are direct children of the current lazy group row
|
|
817
|
+
*/
|
|
818
|
+
children: LazyGroupDataItem<DataType>[];
|
|
819
|
+
childrenLoading: boolean;
|
|
820
|
+
childrenAvailable: boolean;
|
|
821
|
+
cache: boolean;
|
|
936
822
|
totalCount: number;
|
|
937
|
-
|
|
823
|
+
error?: string;
|
|
938
824
|
};
|
|
939
|
-
declare type LazyGroupDataDeepMap<DataType, KeyType = string> = DeepMap<KeyType,
|
|
825
|
+
declare type LazyGroupDataDeepMap<DataType, KeyType = string> = DeepMap<KeyType, LazyRowInfoGroup<DataType>>;
|
|
940
826
|
interface DataSourceSetupState<T> {
|
|
827
|
+
lazyLoadCacheOfLoadedBatches: DeepMap<string, true>;
|
|
941
828
|
pivotMappings?: DataSourceMappings;
|
|
942
829
|
propsCache: Map<keyof DataSourceProps<T>, WeakMap<any, any>>;
|
|
943
830
|
showSeparatePivotColumnForSingleAggregation: boolean;
|
|
@@ -955,7 +842,7 @@ interface DataSourceSetupState<T> {
|
|
|
955
842
|
groupDeepMap?: DeepMap<GroupKeyType, DeepMapGroupValueType<T, any>>;
|
|
956
843
|
pivotTotalColumnPosition: InfiniteTablePropPivotTotalColumnPosition;
|
|
957
844
|
pivotGrandTotalColumnPosition: InfiniteTablePropPivotGrandTotalColumnPosition;
|
|
958
|
-
cursorId: number |
|
|
845
|
+
cursorId: number | symbol | DataSourceLivePaginationCursorValue;
|
|
959
846
|
updatedAt: number;
|
|
960
847
|
reducedAt: number;
|
|
961
848
|
groupedAt: number;
|
|
@@ -986,8 +873,8 @@ declare type DataSourceProps<T> = {
|
|
|
986
873
|
groupBy?: DataSourcePropGroupBy<T>;
|
|
987
874
|
defaultGroupBy?: DataSourcePropGroupBy<T>;
|
|
988
875
|
onGroupByChange?: (groupBy: DataSourcePropGroupBy<T>) => void;
|
|
989
|
-
groupRowsState?: GroupRowsState
|
|
990
|
-
defaultGroupRowsState?: GroupRowsState
|
|
876
|
+
groupRowsState?: GroupRowsState | DataSourcePropGroupRowsStateObject<any>;
|
|
877
|
+
defaultGroupRowsState?: GroupRowsState | DataSourcePropGroupRowsStateObject<keyof T>;
|
|
991
878
|
onGroupRowsStateChange?: (groupRowsState: GroupRowsState) => void;
|
|
992
879
|
collapseGroupRowsOnDataFunctionChange?: boolean;
|
|
993
880
|
sortInfo?: DataSourceSortInfo<T>;
|
|
@@ -1031,9 +918,270 @@ interface DataSourceReducer<T> {
|
|
|
1031
918
|
(state: DataSourceState<T>, action: DataSourceAction<any>): DataSourceState<T>;
|
|
1032
919
|
}
|
|
1033
920
|
|
|
1034
|
-
declare
|
|
1035
|
-
|
|
1036
|
-
|
|
921
|
+
declare class GroupRowsState<KeyType extends any = any> {
|
|
922
|
+
private expandedMap?;
|
|
923
|
+
private collapsedMap?;
|
|
924
|
+
private collapsedAll;
|
|
925
|
+
private expandedAll;
|
|
926
|
+
private initialState;
|
|
927
|
+
constructor(state: DataSourcePropGroupRowsStateObject<KeyType> | GroupRowsState<KeyType>);
|
|
928
|
+
getState(): DataSourcePropGroupRowsStateObject<KeyType>;
|
|
929
|
+
destroy(): void;
|
|
930
|
+
private update;
|
|
931
|
+
areAllCollapsed(): boolean;
|
|
932
|
+
areAllExpanded(): boolean;
|
|
933
|
+
collapseAll(): void;
|
|
934
|
+
expandAll(): void;
|
|
935
|
+
isGroupRowExpanded(keys: KeyType[]): boolean | undefined;
|
|
936
|
+
isGroupRowCollapsed(keys: KeyType[]): boolean;
|
|
937
|
+
setGroupRowExpanded(keys: KeyType[], shouldExpand: boolean): void;
|
|
938
|
+
collapseGroupRow(keys: KeyType[]): void;
|
|
939
|
+
expandGroupRow(keys: KeyType[]): void;
|
|
940
|
+
toggleGroupRow(keys: KeyType[]): void;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
declare type AggregationReducer<T, AggregationResultType = any> = DataSourceAggregationReducer<T, AggregationResultType> & {
|
|
944
|
+
id: string;
|
|
945
|
+
};
|
|
946
|
+
declare type AggregationReducerResult<AggregationResultType extends any = any> = {
|
|
947
|
+
value: AggregationResultType;
|
|
948
|
+
id: string;
|
|
949
|
+
};
|
|
950
|
+
/**
|
|
951
|
+
* InfiniteTableRowInfo can have different object shape depending on the presence or absence of grouping.
|
|
952
|
+
*
|
|
953
|
+
* You can use `dataSourceHasGrouping: boolean` as a discriminator to determine the shape of the object, to know
|
|
954
|
+
* if the dataSource had grouping or not. Furthermore, for when the dataSource has grouping,
|
|
955
|
+
* you can use `isGroupRow: boolean` to discriminate between group rows vs normal rows.
|
|
956
|
+
*
|
|
957
|
+
*/
|
|
958
|
+
declare type InfiniteTableRowInfo<T> = InfiniteTable_HasGrouping_RowInfoNormal<T> | InfiniteTable_HasGrouping_RowInfoGroup<T> | InfiniteTable_NoGrouping_RowInfoNormal<T>;
|
|
959
|
+
declare type InfiniteTableRowInfoDataDiscriminator<T> = {
|
|
960
|
+
data: T;
|
|
961
|
+
isGroupRow: false;
|
|
962
|
+
rowInfo: InfiniteTable_NoGrouping_RowInfoNormal<T> | InfiniteTable_HasGrouping_RowInfoNormal<T>;
|
|
963
|
+
} | {
|
|
964
|
+
data: Partial<T> | null;
|
|
965
|
+
rowInfo: InfiniteTable_HasGrouping_RowInfoGroup<T>;
|
|
966
|
+
isGroupRow: true;
|
|
967
|
+
};
|
|
968
|
+
/**
|
|
969
|
+
* This is the base row info for all scenarios - things every
|
|
970
|
+
* rowInfo is guaranteed to have (be it group or normal row, or dataSource with or without grouping)
|
|
971
|
+
*
|
|
972
|
+
*/
|
|
973
|
+
declare type InfiniteTable_RowInfoBase<_T> = {
|
|
974
|
+
id: any;
|
|
975
|
+
value?: any;
|
|
976
|
+
indexInAll: number;
|
|
977
|
+
indexInGroup: number;
|
|
978
|
+
};
|
|
979
|
+
declare type InfiniteTable_HasGrouping_RowInfoNormal<T> = {
|
|
980
|
+
dataSourceHasGrouping: true;
|
|
981
|
+
data: T;
|
|
982
|
+
isGroupRow: false;
|
|
983
|
+
} & InfiniteTable_HasGrouping_RowInfoBase<T> & InfiniteTable_RowInfoBase<T>;
|
|
984
|
+
declare type InfiniteTable_HasGrouping_RowInfoGroup<T> = {
|
|
985
|
+
dataSourceHasGrouping: true;
|
|
986
|
+
data: Partial<T> | null;
|
|
987
|
+
isGroupRow: true;
|
|
988
|
+
/**
|
|
989
|
+
* This array contains all the (uncollapsed, so visible) row infos under this group, at any level of nesting,
|
|
990
|
+
* in the order in which they are visible in the table
|
|
991
|
+
*/
|
|
992
|
+
deepRowInfoArray: (InfiniteTable_HasGrouping_RowInfoNormal<T> | InfiniteTable_HasGrouping_RowInfoGroup<T>)[];
|
|
993
|
+
reducerResults?: Record<string, AggregationReducerResult>;
|
|
994
|
+
/**
|
|
995
|
+
* The count of all leaf nodes (normal rows) that are inside this group.
|
|
996
|
+
* This count is the same as the length of the groupData array property.
|
|
997
|
+
*/
|
|
998
|
+
groupCount: number;
|
|
999
|
+
/**
|
|
1000
|
+
* The array of all leaf nodes (normal rows) that are inside this group.
|
|
1001
|
+
*/
|
|
1002
|
+
groupData: T[];
|
|
1003
|
+
/**
|
|
1004
|
+
* The count of all leaf nodes (normal rows) inside the group that are not being visible
|
|
1005
|
+
* due to collapsing (either the current row is collapsed or any of its children)
|
|
1006
|
+
*/
|
|
1007
|
+
collapsedChildrenCount: number;
|
|
1008
|
+
collapsedGroupsCount: number;
|
|
1009
|
+
/**
|
|
1010
|
+
* The count of the direct children of the current group. Direct children can be either normal rows or groups.
|
|
1011
|
+
*/
|
|
1012
|
+
directChildrenCount: number;
|
|
1013
|
+
directChildrenLoadedCount: number;
|
|
1014
|
+
/**
|
|
1015
|
+
*
|
|
1016
|
+
* A DeepMap of pivot values.
|
|
1017
|
+
*
|
|
1018
|
+
* For each pivot reducer result, it contains all the items that make up the pivot value.
|
|
1019
|
+
*
|
|
1020
|
+
*/
|
|
1021
|
+
pivotValuesMap?: PivotValuesDeepMap<T, any>;
|
|
1022
|
+
/**
|
|
1023
|
+
* For non-lazy grouping, this is always true.
|
|
1024
|
+
* For lazy/batched grouping, this is true if the group has been expanded at least once (and if the remote call has been configured with cache: true),
|
|
1025
|
+
* since if the remote call is not cached, collapsing the row group should lose all the data that was loaded for it, and it's as if it was never loaded, so in that case, childrenAvailable is false.
|
|
1026
|
+
*
|
|
1027
|
+
* NOTE: if this is true, it doesn't mean that (all or some of) the children have been loaded, it only means that at least some children have been requested.
|
|
1028
|
+
*
|
|
1029
|
+
* Use directChildrenCount and directChildrenLoadedCount to know if all the children have been loaded or not.
|
|
1030
|
+
*/
|
|
1031
|
+
childrenAvailable: boolean;
|
|
1032
|
+
/**
|
|
1033
|
+
* Boolean flag that will be true while lazy loading direct children of the current row group.
|
|
1034
|
+
*
|
|
1035
|
+
* NOTE: with batched loading, if the user is no longer scrolling, after everything
|
|
1036
|
+
* in the viewport has loaded (and thus for example a certain row group had childrenLoading: true)
|
|
1037
|
+
* if no new batches are being loaded, childrenLoading will be false again, even though
|
|
1038
|
+
* the current row group still has children that are not loaded yet.
|
|
1039
|
+
* Use directChildrenLoadedCount and directChildrenCount to know if all the children have been loaded or not.
|
|
1040
|
+
*/
|
|
1041
|
+
childrenLoading: boolean;
|
|
1042
|
+
} & InfiniteTable_HasGrouping_RowInfoBase<T> & InfiniteTable_RowInfoBase<T>;
|
|
1043
|
+
declare type InfiniteTable_NoGrouping_RowInfoNormal<T> = {
|
|
1044
|
+
dataSourceHasGrouping: false;
|
|
1045
|
+
data: T;
|
|
1046
|
+
isGroupRow: false;
|
|
1047
|
+
selfLoaded: boolean;
|
|
1048
|
+
} & InfiniteTable_RowInfoBase<T>;
|
|
1049
|
+
declare type InfiniteTable_HasGrouping_RowInfoBase<T> = {
|
|
1050
|
+
/**
|
|
1051
|
+
* Available on all rowInfo objects when the datasource is grouped, otherwise, it will be undefined.
|
|
1052
|
+
*
|
|
1053
|
+
* For group rows, the group keys will have all the keys starting from the topmost parent
|
|
1054
|
+
* down to the current group row (including the group row).
|
|
1055
|
+
* For normal rows, the group keys will have all the keys starting from the topmost parent
|
|
1056
|
+
* down to the last group row in the hierarchy (the direct parent of the current row).
|
|
1057
|
+
*
|
|
1058
|
+
* Example: People grouped by country and city
|
|
1059
|
+
*
|
|
1060
|
+
* Italy - country - groupKeys: ['Italy']
|
|
1061
|
+
* Rome - city - groupKeys: ['Italy', 'Rome']
|
|
1062
|
+
* Marco - person - groupKeys: ['Italy', 'Rome']
|
|
1063
|
+
* Luca - person - groupKeys: ['Italy', 'Rome']
|
|
1064
|
+
* Giuseppe - person - groupKeys: ['Italy', 'Rome']
|
|
1065
|
+
*
|
|
1066
|
+
*/
|
|
1067
|
+
groupKeys: any[];
|
|
1068
|
+
/**
|
|
1069
|
+
* Available on all rowInfo objects when the datasource is grouped, otherwise, it will be undefined.
|
|
1070
|
+
*
|
|
1071
|
+
* Has the same structure as groupKeys, but it will contain the fields used to group the rows.
|
|
1072
|
+
*
|
|
1073
|
+
* Example: People grouped by country and city
|
|
1074
|
+
*
|
|
1075
|
+
* Italy - country - groupKeys: ['country']
|
|
1076
|
+
* Rome - city - groupKeys: ['country', 'city']
|
|
1077
|
+
* Marco - person - groupKeys: ['country', 'city']
|
|
1078
|
+
* Luca - person - groupKeys: ['country', 'city']
|
|
1079
|
+
* Giuseppe - person - groupKeys: ['country', 'city']
|
|
1080
|
+
*/
|
|
1081
|
+
groupBy: (keyof T)[];
|
|
1082
|
+
/**
|
|
1083
|
+
* The groupBy value of the DataSource component, mapped to the groupBy.field
|
|
1084
|
+
*/
|
|
1085
|
+
rootGroupBy: (keyof T)[];
|
|
1086
|
+
/**
|
|
1087
|
+
* Available on all rowInfo objects when the datasource is grouped.
|
|
1088
|
+
*
|
|
1089
|
+
* Italy - country - parent mapped to their ids will be: [] // rowInfo.parents.map((p: any) => p.id)
|
|
1090
|
+
* Rome - city - parent mapped to their ids will be: ['Italy']
|
|
1091
|
+
* Marco - person - parent mapped to their ids will be: ['Italy','Italy,Rome']
|
|
1092
|
+
* Luca - person - parent mapped to their ids will be: ['Italy','Italy,Rome']
|
|
1093
|
+
* Giuseppe - person - parent mapped to their ids will be: ['Italy','Italy,Rome']
|
|
1094
|
+
* USA - country - parent mapped to their ids will be: []
|
|
1095
|
+
* LA - city - parent mapped to their ids will be: ['USA']
|
|
1096
|
+
* Bob - person - parent mapped to their ids will be: ['USA','USA,LA']
|
|
1097
|
+
*/
|
|
1098
|
+
parents: InfiniteTable_HasGrouping_RowInfoGroup<T>[];
|
|
1099
|
+
/**
|
|
1100
|
+
* Available when the datasource is grouped, this will be set for both group and normal rows.
|
|
1101
|
+
* Italy - country - indexInParentGroups: [0]
|
|
1102
|
+
* Rome - city - indexInParentGroups: [0,0]
|
|
1103
|
+
* Marco - person - indexInParentGroups: [0,0,0]
|
|
1104
|
+
* Luca - person - indexInParentGroups: [0,0,1]
|
|
1105
|
+
* Giuseppe - person - indexInParentGroups: [0,0,2]
|
|
1106
|
+
* USA - country - indexInParentGroups: [1]
|
|
1107
|
+
* LA - city - indexInParentGroups: [1,0]
|
|
1108
|
+
* Bob - person - indexInParentGroups: [1,0,2]
|
|
1109
|
+
*/
|
|
1110
|
+
indexInParentGroups: number[];
|
|
1111
|
+
/**
|
|
1112
|
+
* Available on all rowInfo objects when the datasource is grouped.
|
|
1113
|
+
*
|
|
1114
|
+
* For every rowInfo object, it counts the number of leaf/normal rows that the group contains.
|
|
1115
|
+
* For normal rows, the groupCount represents the groupCount of the direct parent.
|
|
1116
|
+
*
|
|
1117
|
+
* Italy - country - groupCount: 3
|
|
1118
|
+
* Rome - city - groupCount: 2
|
|
1119
|
+
* Marco - person - groupCount: 2
|
|
1120
|
+
* Luca - person - groupCount: 2
|
|
1121
|
+
* Napoli - city - groupCount: 1
|
|
1122
|
+
* Giuseppe - person - groupCount: 1
|
|
1123
|
+
* USA - country - groupCount: 1
|
|
1124
|
+
* LA - city - groupCount: 1
|
|
1125
|
+
* Bob - person - groupCount: 1
|
|
1126
|
+
*/
|
|
1127
|
+
groupCount: number;
|
|
1128
|
+
groupNesting: number;
|
|
1129
|
+
collapsed: boolean;
|
|
1130
|
+
/**
|
|
1131
|
+
* This is false only when the DataSource is configured with lazy batching and the current
|
|
1132
|
+
* row has not been loaded yet. It has nothing to do with children, only with self.
|
|
1133
|
+
*/
|
|
1134
|
+
selfLoaded: boolean;
|
|
1135
|
+
};
|
|
1136
|
+
declare type GroupKeyType<T extends any = any> = T;
|
|
1137
|
+
declare type PivotReducerResults<T = any> = Record<string, AggregationReducerResult<T>>;
|
|
1138
|
+
declare type PivotGroupValueType<DataType, KeyType> = {
|
|
1139
|
+
reducerResults: PivotReducerResults<KeyType>;
|
|
1140
|
+
items: DataType[];
|
|
1141
|
+
};
|
|
1142
|
+
declare type PivotValuesDeepMap<DataType, KeyType> = DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
|
|
1143
|
+
declare type DeepMapGroupValueType<DataType, KeyType> = {
|
|
1144
|
+
/**
|
|
1145
|
+
* These are leaf items. This array may be empty when there is batched lazy loading
|
|
1146
|
+
*/
|
|
1147
|
+
items: DataType[];
|
|
1148
|
+
commonData?: Partial<DataType>;
|
|
1149
|
+
childrenLoading: boolean;
|
|
1150
|
+
childrenAvailable: boolean;
|
|
1151
|
+
cache: boolean;
|
|
1152
|
+
error?: string;
|
|
1153
|
+
reducerResults: Record<string, AggregationReducerResult>;
|
|
1154
|
+
pivotDeepMap?: DeepMap<GroupKeyType<KeyType>, PivotGroupValueType<DataType, KeyType>>;
|
|
1155
|
+
};
|
|
1156
|
+
declare type GroupBy<DataType, KeyType> = {
|
|
1157
|
+
field: keyof DataType;
|
|
1158
|
+
toKey?: (value: any, data: DataType) => GroupKeyType<KeyType>;
|
|
1159
|
+
column?: Partial<InfiniteTableGroupColumnBase<DataType>>;
|
|
1160
|
+
};
|
|
1161
|
+
declare type PivotBy<DataType, KeyType> = Omit<GroupBy<DataType, KeyType>, 'column'> & {
|
|
1162
|
+
column?: ColumnTypeWithInherit<Partial<InfiniteTableColumn<DataType>>> | (({ column, }: {
|
|
1163
|
+
column: InfiniteTablePivotFinalColumnVariant<DataType, KeyType>;
|
|
1164
|
+
}) => Partial<InfiniteTablePivotColumn<DataType>>);
|
|
1165
|
+
columnGroup?: InfiniteTableColumnGroup | (({ columnGroup, }: {
|
|
1166
|
+
columnGroup: InfiniteTablePivotFinalColumnGroup<DataType, KeyType>;
|
|
1167
|
+
}) => ColumnTypeWithInherit<Partial<InfiniteTablePivotFinalColumnGroup<DataType>>>);
|
|
1168
|
+
};
|
|
1169
|
+
declare type GroupParams<DataType, KeyType> = {
|
|
1170
|
+
groupBy: GroupBy<DataType, KeyType>[];
|
|
1171
|
+
defaultToKey?: (value: any, item: DataType) => GroupKeyType<KeyType>;
|
|
1172
|
+
pivot?: PivotBy<DataType, KeyType>[];
|
|
1173
|
+
reducers?: Record<string, DataSourceAggregationReducer<DataType, any>>;
|
|
1174
|
+
};
|
|
1175
|
+
declare type DataGroupResult<DataType, KeyType extends any> = {
|
|
1176
|
+
deepMap: DeepMap<GroupKeyType<KeyType>, DeepMapGroupValueType<DataType, KeyType>>;
|
|
1177
|
+
groupParams: GroupParams<DataType, KeyType>;
|
|
1178
|
+
initialData: DataType[];
|
|
1179
|
+
reducerResults?: Record<string, AggregationReducerResult>;
|
|
1180
|
+
topLevelPivotColumns?: DeepMap<GroupKeyType<KeyType>, boolean>;
|
|
1181
|
+
pivot?: PivotBy<DataType, KeyType>[];
|
|
1182
|
+
};
|
|
1183
|
+
declare function group<DataType, KeyType = any>(groupParams: GroupParams<DataType, KeyType>, data: DataType[]): DataGroupResult<DataType, KeyType>;
|
|
1184
|
+
declare function flatten<DataType, KeyType extends any>(groupResult: DataGroupResult<DataType, KeyType>): DataType[];
|
|
1037
1185
|
|
|
1038
1186
|
declare type InfiniteTableCellProps<T> = {
|
|
1039
1187
|
column: InfiniteTableComputedColumn<T>;
|
|
@@ -1051,6 +1199,10 @@ declare type InfiniteTableCellProps<T> = {
|
|
|
1051
1199
|
cellType: 'body' | 'header';
|
|
1052
1200
|
};
|
|
1053
1201
|
|
|
1202
|
+
declare type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
1203
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
1204
|
+
}[Keys];
|
|
1205
|
+
|
|
1054
1206
|
declare type InfiniteTableToggleGroupRowFn = (groupKeys: any[]) => void;
|
|
1055
1207
|
declare type InfiniteTableColumnHeaderParams<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
1056
1208
|
domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
|
|
@@ -1058,7 +1210,7 @@ declare type InfiniteTableColumnHeaderParams<DATA_TYPE, COL_TYPE = InfiniteTable
|
|
|
1058
1210
|
column: COL_TYPE;
|
|
1059
1211
|
columnSortInfo: DataSourceSingleSortInfo<DATA_TYPE> | null;
|
|
1060
1212
|
};
|
|
1061
|
-
declare type
|
|
1213
|
+
declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
1062
1214
|
domRef: InfiniteTableCellProps<DATA_TYPE>['domRef'];
|
|
1063
1215
|
value: string | number | Renderable;
|
|
1064
1216
|
groupRowInfo: InfiniteTableRowInfo<DATA_TYPE> | null;
|
|
@@ -1068,19 +1220,19 @@ declare type InfiniteTableColumnRenderParams<DATA_TYPE, COL_TYPE = InfiniteTable
|
|
|
1068
1220
|
toggleGroupRow: InfiniteTableToggleGroupRowFn;
|
|
1069
1221
|
groupBy: DataSourceState<DATA_TYPE>['groupBy'];
|
|
1070
1222
|
pivotBy?: DataSourceState<DATA_TYPE>['pivotBy'];
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1223
|
+
};
|
|
1224
|
+
declare type InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & InfiniteTableRowInfoDataDiscriminator<DATA_TYPE>;
|
|
1225
|
+
declare type InfiniteTableGroupColumnRenderParams<DATA_TYPE, COL_TYPE> = InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE> & {
|
|
1226
|
+
rowInfo: InfiniteTable_HasGrouping_RowInfoGroup<DATA_TYPE>;
|
|
1227
|
+
isGroupRow: true;
|
|
1076
1228
|
data: Partial<DATA_TYPE> | null;
|
|
1077
|
-
}
|
|
1078
|
-
declare type InfiniteTableColumnCellContextType<DATA_TYPE> =
|
|
1079
|
-
declare type InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> =
|
|
1229
|
+
};
|
|
1230
|
+
declare type InfiniteTableColumnCellContextType<DATA_TYPE> = InfiniteTableColumnRenderParam<DATA_TYPE> & {};
|
|
1231
|
+
declare type InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableGroupColumnRenderParams<DATA_TYPE, COL_TYPE> & {
|
|
1080
1232
|
collapsed: boolean;
|
|
1081
1233
|
groupIcon: Renderable;
|
|
1082
1234
|
};
|
|
1083
|
-
declare type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> =
|
|
1235
|
+
declare type InfiniteTableColumnRenderValueParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>;
|
|
1084
1236
|
declare type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = {
|
|
1085
1237
|
rowInfo: InfiniteTableRowInfo<DATA_TYPE>;
|
|
1086
1238
|
data: DATA_TYPE | Partial<DATA_TYPE> | null;
|
|
@@ -1088,7 +1240,7 @@ declare type InfiniteTableColumnRowspanParam<DATA_TYPE, COL_TYPE = InfiniteTable
|
|
|
1088
1240
|
rowIndex: number;
|
|
1089
1241
|
column: COL_TYPE;
|
|
1090
1242
|
};
|
|
1091
|
-
declare type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (
|
|
1243
|
+
declare type InfiniteTableColumnRenderFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (renderParams: InfiniteTableColumnRenderParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
|
|
1092
1244
|
declare type InfiniteTableGroupColumnRenderIconFunction<DATA_TYPE, COL_TYPE = InfiniteTableComputedColumn<DATA_TYPE>> = (param: InfiniteTableGroupColumnRenderIconParam<DATA_TYPE, COL_TYPE>) => Renderable | null;
|
|
1093
1245
|
declare type InfiniteTableColumnHeaderRenderFunction<T> = ({ columnSortInfo, column, }: InfiniteTableColumnHeaderParams<T>) => Renderable;
|
|
1094
1246
|
declare type InfiniteTableColumnAlign = 'start' | 'center' | 'end';
|
|
@@ -1107,24 +1259,12 @@ declare type InfiniteTableColumnWithRenderOrRenderValueOrFieldOrValueGetter<T> =
|
|
|
1107
1259
|
declare type InfiniteTableColumnStyleFnParams<T> = {
|
|
1108
1260
|
value: Renderable;
|
|
1109
1261
|
column: InfiniteTableColumn<T>;
|
|
1110
|
-
} &
|
|
1111
|
-
data: T;
|
|
1112
|
-
rowInfo: InfiniteTableRowInfoNormal<T>;
|
|
1113
|
-
} | {
|
|
1114
|
-
data: Partial<T> | null;
|
|
1115
|
-
rowInfo: InfiniteTableRowInfoGroup<T>;
|
|
1116
|
-
});
|
|
1262
|
+
} & InfiniteTableRowInfoDataDiscriminator<T>;
|
|
1117
1263
|
declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React.CSSProperties;
|
|
1118
1264
|
declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
|
|
1119
1265
|
declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
|
|
1120
1266
|
declare type InfiniteTableColumnClassName<T> = string | InfiniteTableColumnClassNameFn<T>;
|
|
1121
|
-
declare type InfiniteTableColumnValueGetterParams<T> =
|
|
1122
|
-
data: T;
|
|
1123
|
-
rowInfo: InfiniteTableRowInfoNormal<T>;
|
|
1124
|
-
} | {
|
|
1125
|
-
data: Partial<T> | null;
|
|
1126
|
-
rowInfo: InfiniteTableRowInfoGroup<T>;
|
|
1127
|
-
};
|
|
1267
|
+
declare type InfiniteTableColumnValueGetterParams<T> = InfiniteTableRowInfoDataDiscriminator<T>;
|
|
1128
1268
|
declare type InfiniteTableColumnValueGetter<T, VALUE_GETTER_TYPE = string | number | boolean | null | undefined> = (params: InfiniteTableColumnValueGetterParams<T>) => VALUE_GETTER_TYPE;
|
|
1129
1269
|
declare type InfiniteTableColumnRowspanFn<T> = (params: InfiniteTableColumnRowspanParam<T>) => number;
|
|
1130
1270
|
declare type InfiniteTableColumnComparer<T> = (a: T, b: T) => number;
|
|
@@ -1284,4 +1424,4 @@ declare function interceptMap<K, V>(map: Map<K, V>, fns: InterceptedMapFns<K, V>
|
|
|
1284
1424
|
|
|
1285
1425
|
declare function useEffectWithChanges<T>(fn: (changes: Record<keyof T, any>, prevValues: Record<string, any>) => void | (() => void), deps: Record<keyof T, any>): void;
|
|
1286
1426
|
|
|
1287
|
-
export { ColumnTypeWithInherit, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState,
|
|
1427
|
+
export { ColumnTypeWithInherit, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropGroupBy, DataSourcePropGroupRowsStateObject, 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, InfiniteTableGroupColumnRenderIconFunction, InfiniteTableImperativeApi, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropColumnsMap, InfiniteTablePropComponents, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyRowInfoGroup, Scrollbars, debounce, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges, useInfiniteColumnCell, useInfiniteHeaderCell };
|