es-grid-template 1.8.65 → 1.8.67
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/es/grid-component/TempTable.d.ts +2 -2
- package/es/grid-component/TempTable.js +3 -3
- package/es/grid-component/hooks/constant.d.ts +1 -0
- package/es/grid-component/hooks/constant.js +2 -1
- package/es/grid-component/hooks/index.js +0 -1
- package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/es/grid-component/hooks/useLazyKVMap.js +0 -4
- package/es/grid-component/hooks/utils.d.ts +3 -4
- package/es/grid-component/hooks/utils.js +2 -1
- package/es/grid-component/styles.scss +1394 -1394
- package/es/grid-component/type.d.ts +0 -414
- package/es/grid-component/type.js +490 -1
- package/es/table-component/TableContainerEdit.js +2 -127
- package/es/table-component/body/TableBodyCellEdit.js +2 -9
- package/es/table-component/header/TableHeadCell.js +1 -10
- package/es/table-component/header/TableHeadCell2.js +1 -1
- package/es/table-component/type.d.ts +3 -1
- package/es/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
- package/es/table-virtuoso/InternalTable.js +6 -28
- package/es/table-virtuoso/body/TableBodyCell.js +0 -9
- package/es/table-virtuoso/body/TableBodyRow.js +0 -4
- package/es/table-virtuoso/style.js +2 -1
- package/es/table-virtuoso/style.scss +2 -1
- package/es/table-virtuoso/table/Grid.js +0 -4
- package/es/table-virtuoso/table/TableContainer.js +31 -44
- package/es/table-virtuoso/table/TableWrapper.d.ts +2 -0
- package/es/table-virtuoso/table/TableWrapper.js +5 -2
- package/lib/grid-component/TempTable.d.ts +2 -2
- package/lib/grid-component/TempTable.js +3 -5
- package/lib/grid-component/hooks/constant.d.ts +1 -0
- package/lib/grid-component/hooks/constant.js +3 -2
- package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/lib/grid-component/hooks/useLazyKVMap.js +0 -3
- package/lib/grid-component/hooks/utils.d.ts +3 -4
- package/lib/grid-component/hooks/utils.js +3 -0
- package/lib/grid-component/styles.scss +1394 -1394
- package/lib/grid-component/type.d.ts +0 -414
- package/lib/grid-component/type.js +490 -4
- package/lib/table-component/TableContainerEdit.js +1 -126
- package/lib/table-component/body/TableBodyCellEdit.js +5 -11
- package/lib/table-component/header/TableHeadCell.js +4 -13
- package/lib/table-component/header/TableHeadCell2.js +4 -4
- package/lib/table-component/type.d.ts +3 -1
- package/lib/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
- package/lib/table-virtuoso/InternalTable.js +6 -28
- package/lib/table-virtuoso/body/TableBodyCell.js +0 -9
- package/lib/table-virtuoso/body/TableBodyRow.js +0 -5
- package/lib/table-virtuoso/style.js +2 -1
- package/lib/table-virtuoso/style.scss +2 -1
- package/lib/table-virtuoso/table/Grid.js +0 -4
- package/lib/table-virtuoso/table/TableContainer.js +29 -42
- package/lib/table-virtuoso/table/TableWrapper.d.ts +2 -0
- package/lib/table-virtuoso/table/TableWrapper.js +4 -2
- package/package.json +1 -1
- package/es/grid-component/AdvanceFilter.d.ts +0 -14
- package/es/grid-component/AdvanceFilter.js +0 -454
- package/es/grid-component/CheckboxFilter.d.ts +0 -20
- package/es/grid-component/CheckboxFilter.js +0 -244
- package/es/grid-component/CheckboxFilter2.d.ts +0 -20
- package/es/grid-component/CheckboxFilter2.js +0 -244
- package/es/grid-component/ColumnsChoose.d.ts +0 -10
- package/es/grid-component/ColumnsChoose.js +0 -230
- package/es/grid-component/ColumnsGroup/ColumnsGroup.d.ts +0 -12
- package/es/grid-component/ColumnsGroup/ColumnsGroup.js +0 -232
- package/es/grid-component/ColumnsGroup/index.d.ts +0 -1
- package/es/grid-component/ColumnsGroup/index.js +0 -1
- package/es/grid-component/Command.d.ts +0 -8
- package/es/grid-component/Command.js +0 -80
- package/es/grid-component/ContextMenu.d.ts +0 -20
- package/es/grid-component/ContextMenu.js +0 -130
- package/es/grid-component/EditForm/EditForm.d.ts +0 -27
- package/es/grid-component/EditForm/EditForm.js +0 -394
- package/es/grid-component/EditForm/index.d.ts +0 -1
- package/es/grid-component/EditForm/index.js +0 -1
- package/es/grid-component/EditableCell.d.ts +0 -20
- package/es/grid-component/EditableCell.js +0 -1030
- package/es/grid-component/FilterSearch.d.ts +0 -12
- package/es/grid-component/FilterSearch.js +0 -33
- package/es/grid-component/GridStyle.d.ts +0 -8
- package/es/grid-component/GridStyle.js +0 -5
- package/es/grid-component/TableGrid.d.ts +0 -21
- package/es/grid-component/TableGrid.js +0 -493
- package/es/grid-component/async-select/index.d.ts +0 -11
- package/es/grid-component/async-select/index.js +0 -38
- package/es/grid-component/async-table-select/index.d.ts +0 -11
- package/es/grid-component/async-table-select/index.js +0 -40
- package/es/grid-component/checkbox-control/index.d.ts +0 -13
- package/es/grid-component/checkbox-control/index.js +0 -40
- package/es/grid-component/hooks/columns/index.d.ts +0 -10
- package/es/grid-component/hooks/columns/index.js +0 -503
- package/es/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
- package/es/grid-component/hooks/content/ControlCheckbox.js +0 -87
- package/es/grid-component/hooks/content/HeaderContent.d.ts +0 -14
- package/es/grid-component/hooks/content/HeaderContent.js +0 -44
- package/es/grid-component/hooks/content/TooltipContent.d.ts +0 -13
- package/es/grid-component/hooks/content/TooltipContent.js +0 -74
- package/es/grid-component/hooks/useColumns.d.ts +0 -19
- package/es/grid-component/hooks/useColumns.js +0 -317
- package/es/grid-component/number/index.d.ts +0 -10
- package/es/grid-component/number/index.js +0 -39
- package/es/grid-component/number-range/index.d.ts +0 -11
- package/es/grid-component/number-range/index.js +0 -63
- package/es/grid-component/useContext.d.ts +0 -34
- package/es/grid-component/useContext.js +0 -8
- package/es/table-component/hook/constant.d.ts +0 -73
- package/es/table-component/hook/constant.js +0 -240
- package/es/table-virtuoso/body/TableBody.d.ts +0 -14
- package/es/table-virtuoso/body/TableBody.js +0 -84
- package/lib/grid-component/AdvanceFilter.d.ts +0 -14
- package/lib/grid-component/AdvanceFilter.js +0 -463
- package/lib/grid-component/CheckboxFilter.d.ts +0 -20
- package/lib/grid-component/CheckboxFilter.js +0 -253
- package/lib/grid-component/CheckboxFilter2.d.ts +0 -20
- package/lib/grid-component/CheckboxFilter2.js +0 -253
- package/lib/grid-component/ColumnsChoose.d.ts +0 -10
- package/lib/grid-component/ColumnsChoose.js +0 -240
- package/lib/grid-component/ColumnsGroup/ColumnsGroup.d.ts +0 -12
- package/lib/grid-component/ColumnsGroup/ColumnsGroup.js +0 -243
- package/lib/grid-component/ColumnsGroup/index.d.ts +0 -1
- package/lib/grid-component/ColumnsGroup/index.js +0 -16
- package/lib/grid-component/Command.d.ts +0 -8
- package/lib/grid-component/Command.js +0 -88
- package/lib/grid-component/ContextMenu.d.ts +0 -20
- package/lib/grid-component/ContextMenu.js +0 -140
- package/lib/grid-component/EditForm/EditForm.d.ts +0 -27
- package/lib/grid-component/EditForm/EditForm.js +0 -404
- package/lib/grid-component/EditForm/index.d.ts +0 -1
- package/lib/grid-component/EditForm/index.js +0 -16
- package/lib/grid-component/EditableCell.d.ts +0 -20
- package/lib/grid-component/EditableCell.js +0 -1032
- package/lib/grid-component/FilterSearch.d.ts +0 -12
- package/lib/grid-component/FilterSearch.js +0 -42
- package/lib/grid-component/GridStyle.d.ts +0 -8
- package/lib/grid-component/GridStyle.js +0 -12
- package/lib/grid-component/TableGrid.d.ts +0 -21
- package/lib/grid-component/TableGrid.js +0 -493
- package/lib/grid-component/async-select/index.d.ts +0 -11
- package/lib/grid-component/async-select/index.js +0 -47
- package/lib/grid-component/async-table-select/index.d.ts +0 -11
- package/lib/grid-component/async-table-select/index.js +0 -49
- package/lib/grid-component/checkbox-control/index.d.ts +0 -13
- package/lib/grid-component/checkbox-control/index.js +0 -48
- package/lib/grid-component/hooks/columns/index.d.ts +0 -10
- package/lib/grid-component/hooks/columns/index.js +0 -518
- package/lib/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
- package/lib/grid-component/hooks/content/ControlCheckbox.js +0 -95
- package/lib/grid-component/hooks/content/HeaderContent.d.ts +0 -14
- package/lib/grid-component/hooks/content/HeaderContent.js +0 -53
- package/lib/grid-component/hooks/content/TooltipContent.d.ts +0 -13
- package/lib/grid-component/hooks/content/TooltipContent.js +0 -81
- package/lib/grid-component/hooks/useColumns.d.ts +0 -19
- package/lib/grid-component/hooks/useColumns.js +0 -328
- package/lib/grid-component/number/index.d.ts +0 -10
- package/lib/grid-component/number/index.js +0 -47
- package/lib/grid-component/number-range/index.d.ts +0 -11
- package/lib/grid-component/number-range/index.js +0 -71
- package/lib/grid-component/useContext.d.ts +0 -34
- package/lib/grid-component/useContext.js +0 -13
- package/lib/table-component/hook/constant.d.ts +0 -73
- package/lib/table-component/hook/constant.js +0 -247
- package/lib/table-virtuoso/body/TableBody.d.ts +0 -14
- package/lib/table-virtuoso/body/TableBody.js +0 -95
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export declare const defaultWidth: number;
|
|
2
|
-
export declare const defaultRowHeight: number;
|
|
3
|
-
export type IOperator = {
|
|
4
|
-
value: string;
|
|
5
|
-
label: string;
|
|
6
|
-
key: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const numberOperator: IOperator[];
|
|
9
|
-
export declare const stringOperator: IOperator[];
|
|
10
|
-
export declare const dateOperator: IOperator[];
|
|
11
|
-
export declare const dateTimeOperator: IOperator[];
|
|
12
|
-
export declare const booleanOperator: IOperator[];
|
|
13
|
-
export declare const translateOption: (options: IOperator[], t: any) => any[];
|
|
14
|
-
export declare const transferFontSize: any;
|
|
15
|
-
export declare const defaultDateFormat = "d/m/Y";
|
|
16
|
-
export declare const defaultDateTimeFormat = "d/m/Y H:i";
|
|
17
|
-
export declare const defaultTimeFormat = "H:i";
|
|
18
|
-
export declare const defaultPageSizes: number[];
|
|
19
|
-
export declare const alignToFlex: any;
|
|
20
|
-
export declare const optionsSize: {
|
|
21
|
-
label: string;
|
|
22
|
-
value: string;
|
|
23
|
-
width: number;
|
|
24
|
-
height: number;
|
|
25
|
-
}[];
|
|
26
|
-
export declare const paperSize: {
|
|
27
|
-
a4: {
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
};
|
|
31
|
-
a3: {
|
|
32
|
-
width: number;
|
|
33
|
-
height: number;
|
|
34
|
-
};
|
|
35
|
-
letter: {
|
|
36
|
-
width: number;
|
|
37
|
-
height: number;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export declare const optionFont: {
|
|
41
|
-
value: string;
|
|
42
|
-
label: string;
|
|
43
|
-
}[];
|
|
44
|
-
export declare const optionsPaperOrientation: any[];
|
|
45
|
-
export declare const optionFontSize: {
|
|
46
|
-
value: number;
|
|
47
|
-
label: string;
|
|
48
|
-
}[];
|
|
49
|
-
/**
|
|
50
|
-
* Sort order for BaseTable
|
|
51
|
-
*/
|
|
52
|
-
declare const SortOrder: {
|
|
53
|
-
/**
|
|
54
|
-
* Sort data in ascending order
|
|
55
|
-
*/
|
|
56
|
-
ascend: string;
|
|
57
|
-
/**
|
|
58
|
-
* Sort data in descending order
|
|
59
|
-
*/
|
|
60
|
-
descend: string;
|
|
61
|
-
};
|
|
62
|
-
export default SortOrder;
|
|
63
|
-
export declare const valueToBoolean: {
|
|
64
|
-
true: boolean;
|
|
65
|
-
false: boolean;
|
|
66
|
-
1: boolean;
|
|
67
|
-
0: boolean;
|
|
68
|
-
};
|
|
69
|
-
export declare const booleanToValue: {
|
|
70
|
-
true: number;
|
|
71
|
-
false: number;
|
|
72
|
-
};
|
|
73
|
-
export declare const nonActionColumn: string[];
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
export const defaultWidth = 100;
|
|
2
|
-
export const defaultRowHeight = 35;
|
|
3
|
-
export const numberOperator = [{
|
|
4
|
-
value: 'equal',
|
|
5
|
-
label: 'Equal',
|
|
6
|
-
key: '=='
|
|
7
|
-
}, {
|
|
8
|
-
value: 'greaterthan',
|
|
9
|
-
label: 'Greater than',
|
|
10
|
-
key: '>'
|
|
11
|
-
}, {
|
|
12
|
-
value: 'greaterthanorequal',
|
|
13
|
-
label: 'Greater than or equal',
|
|
14
|
-
key: '>='
|
|
15
|
-
}, {
|
|
16
|
-
value: 'lessthan',
|
|
17
|
-
label: 'Less than',
|
|
18
|
-
key: '<'
|
|
19
|
-
}, {
|
|
20
|
-
value: 'lessthanorequal',
|
|
21
|
-
label: 'Less than or equal',
|
|
22
|
-
key: '<='
|
|
23
|
-
}, {
|
|
24
|
-
value: 'notequal',
|
|
25
|
-
label: 'Not equal',
|
|
26
|
-
key: '!='
|
|
27
|
-
}];
|
|
28
|
-
export const stringOperator = [{
|
|
29
|
-
value: 'startswith',
|
|
30
|
-
key: '_=',
|
|
31
|
-
label: 'Starts with'
|
|
32
|
-
}, {
|
|
33
|
-
value: 'endswith',
|
|
34
|
-
key: '|=',
|
|
35
|
-
label: 'Ends with'
|
|
36
|
-
}, {
|
|
37
|
-
value: 'contains',
|
|
38
|
-
key: '~=',
|
|
39
|
-
label: 'Contains'
|
|
40
|
-
}, {
|
|
41
|
-
value: 'equal',
|
|
42
|
-
key: '==',
|
|
43
|
-
label: 'Equal'
|
|
44
|
-
}, {
|
|
45
|
-
value: 'notequal',
|
|
46
|
-
key: '!=',
|
|
47
|
-
label: 'Not equal'
|
|
48
|
-
}];
|
|
49
|
-
export const dateOperator = [{
|
|
50
|
-
value: 'equal',
|
|
51
|
-
key: '==',
|
|
52
|
-
label: 'Equal'
|
|
53
|
-
}, {
|
|
54
|
-
value: 'notequal',
|
|
55
|
-
key: '!=',
|
|
56
|
-
label: 'Not equal'
|
|
57
|
-
}, {
|
|
58
|
-
value: 'greaterthan',
|
|
59
|
-
key: '>',
|
|
60
|
-
label: 'Greater than'
|
|
61
|
-
}, {
|
|
62
|
-
value: 'lessthan',
|
|
63
|
-
key: '<',
|
|
64
|
-
label: 'Less than'
|
|
65
|
-
}];
|
|
66
|
-
export const dateTimeOperator = [{
|
|
67
|
-
value: 'equal',
|
|
68
|
-
key: '==',
|
|
69
|
-
label: 'Equal'
|
|
70
|
-
}, {
|
|
71
|
-
value: 'notequal',
|
|
72
|
-
key: '!=',
|
|
73
|
-
label: 'Not equal'
|
|
74
|
-
}, {
|
|
75
|
-
value: 'greaterthan',
|
|
76
|
-
key: '>',
|
|
77
|
-
label: 'Greater than'
|
|
78
|
-
}, {
|
|
79
|
-
value: 'lessthan',
|
|
80
|
-
key: '<',
|
|
81
|
-
label: 'Less than'
|
|
82
|
-
}];
|
|
83
|
-
export const booleanOperator = [{
|
|
84
|
-
value: 'equal',
|
|
85
|
-
key: '==',
|
|
86
|
-
label: 'Equal'
|
|
87
|
-
}, {
|
|
88
|
-
value: 'notequal',
|
|
89
|
-
key: '!=',
|
|
90
|
-
label: 'Not equal'
|
|
91
|
-
}];
|
|
92
|
-
export const translateOption = (options, t) => {
|
|
93
|
-
if (!t) {
|
|
94
|
-
return options;
|
|
95
|
-
}
|
|
96
|
-
return options.map(it => ({
|
|
97
|
-
...it,
|
|
98
|
-
label: t(it.label)
|
|
99
|
-
}));
|
|
100
|
-
};
|
|
101
|
-
export const transferFontSize = {
|
|
102
|
-
6: 8,
|
|
103
|
-
7: 9,
|
|
104
|
-
8: 11,
|
|
105
|
-
9: 12,
|
|
106
|
-
10: 13,
|
|
107
|
-
11: 15,
|
|
108
|
-
12: 16,
|
|
109
|
-
13: 17,
|
|
110
|
-
14: 19,
|
|
111
|
-
15: 20,
|
|
112
|
-
16: 21,
|
|
113
|
-
17: 23,
|
|
114
|
-
18: 24,
|
|
115
|
-
19: 25,
|
|
116
|
-
20: 27,
|
|
117
|
-
21: 28,
|
|
118
|
-
22: 29,
|
|
119
|
-
24: 32,
|
|
120
|
-
26: 35,
|
|
121
|
-
27: 36,
|
|
122
|
-
28: 37
|
|
123
|
-
};
|
|
124
|
-
export const defaultDateFormat = 'd/m/Y';
|
|
125
|
-
export const defaultDateTimeFormat = 'd/m/Y H:i';
|
|
126
|
-
export const defaultTimeFormat = 'H:i';
|
|
127
|
-
export const defaultPageSizes = [20, 30, 50, 100];
|
|
128
|
-
export const alignToFlex = {
|
|
129
|
-
center: 'center',
|
|
130
|
-
left: 'start',
|
|
131
|
-
right: 'end'
|
|
132
|
-
};
|
|
133
|
-
export const optionsSize = [{
|
|
134
|
-
label: 'letter',
|
|
135
|
-
value: 'letter',
|
|
136
|
-
width: 21.59,
|
|
137
|
-
height: 27.94
|
|
138
|
-
}, {
|
|
139
|
-
label: 'A3',
|
|
140
|
-
value: 'a3',
|
|
141
|
-
width: 27.94,
|
|
142
|
-
height: 42
|
|
143
|
-
}, {
|
|
144
|
-
label: 'A4',
|
|
145
|
-
value: 'a4',
|
|
146
|
-
width: 21,
|
|
147
|
-
height: 29.7
|
|
148
|
-
}];
|
|
149
|
-
export const paperSize = {
|
|
150
|
-
a4: {
|
|
151
|
-
width: 21,
|
|
152
|
-
height: 29.7
|
|
153
|
-
},
|
|
154
|
-
a3: {
|
|
155
|
-
width: 27.94,
|
|
156
|
-
height: 42
|
|
157
|
-
},
|
|
158
|
-
letter: {
|
|
159
|
-
width: 21.59,
|
|
160
|
-
height: 27.94
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
export const optionFont = [{
|
|
164
|
-
value: 'Times New Roman',
|
|
165
|
-
label: 'Times New Roman'
|
|
166
|
-
}, {
|
|
167
|
-
value: 'Calibri',
|
|
168
|
-
label: 'Calibri (Body)'
|
|
169
|
-
}];
|
|
170
|
-
// portrait' | 'landscape'
|
|
171
|
-
export const optionsPaperOrientation = [{
|
|
172
|
-
value: 'portrait',
|
|
173
|
-
label: 'portrait'
|
|
174
|
-
}, {
|
|
175
|
-
value: 'landscape',
|
|
176
|
-
label: 'landscape'
|
|
177
|
-
}];
|
|
178
|
-
export const optionFontSize = [{
|
|
179
|
-
value: 8,
|
|
180
|
-
label: '8'
|
|
181
|
-
}, {
|
|
182
|
-
value: 9,
|
|
183
|
-
label: '9'
|
|
184
|
-
}, {
|
|
185
|
-
value: 10,
|
|
186
|
-
label: '10'
|
|
187
|
-
}, {
|
|
188
|
-
value: 11,
|
|
189
|
-
label: '11'
|
|
190
|
-
}, {
|
|
191
|
-
value: 12,
|
|
192
|
-
label: '12'
|
|
193
|
-
}, {
|
|
194
|
-
value: 13,
|
|
195
|
-
label: '13'
|
|
196
|
-
}, {
|
|
197
|
-
value: 14,
|
|
198
|
-
label: '14'
|
|
199
|
-
}, {
|
|
200
|
-
value: 16,
|
|
201
|
-
label: '16'
|
|
202
|
-
}, {
|
|
203
|
-
value: 18,
|
|
204
|
-
label: '18'
|
|
205
|
-
}, {
|
|
206
|
-
value: 24,
|
|
207
|
-
label: '24'
|
|
208
|
-
}, {
|
|
209
|
-
value: 36,
|
|
210
|
-
label: '36'
|
|
211
|
-
}, {
|
|
212
|
-
value: 48,
|
|
213
|
-
label: '48'
|
|
214
|
-
}];
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Sort order for BaseTable
|
|
218
|
-
*/
|
|
219
|
-
const SortOrder = {
|
|
220
|
-
/**
|
|
221
|
-
* Sort data in ascending order
|
|
222
|
-
*/
|
|
223
|
-
ascend: 'Ascending',
|
|
224
|
-
/**
|
|
225
|
-
* Sort data in descending order
|
|
226
|
-
*/
|
|
227
|
-
descend: 'Descending'
|
|
228
|
-
};
|
|
229
|
-
export default SortOrder;
|
|
230
|
-
export const valueToBoolean = {
|
|
231
|
-
true: true,
|
|
232
|
-
false: false,
|
|
233
|
-
1: true,
|
|
234
|
-
0: false
|
|
235
|
-
};
|
|
236
|
-
export const booleanToValue = {
|
|
237
|
-
true: 1,
|
|
238
|
-
false: 0
|
|
239
|
-
};
|
|
240
|
-
export const nonActionColumn = ['#', 'command', 'selection_column'];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Table } from "@tanstack/react-table";
|
|
2
|
-
import type { CommandClick } from "../../table-component/type";
|
|
3
|
-
import React from "react";
|
|
4
|
-
interface TableBodyProps<T> {
|
|
5
|
-
table: Table<T>;
|
|
6
|
-
tableContainerRef: React.RefObject<HTMLDivElement>;
|
|
7
|
-
commandClick?: (args: CommandClick<T>) => void;
|
|
8
|
-
editAble?: boolean;
|
|
9
|
-
tableId: string;
|
|
10
|
-
showEmptyText?: boolean;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}
|
|
13
|
-
declare const TableBody: <RecordType extends object>({ columnVirtualizer, table, tableContainerRef, virtualPaddingLeft, virtualPaddingRight, fixedLeftColumns, fixedRightColumns, tableId, showEmptyText, ...rest }: TableBodyProps<RecordType>) => React.JSX.Element;
|
|
14
|
-
export default TableBody;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import TableBodyRow from "./TableBodyRow";
|
|
3
|
-
// import type { Virtualizer } from "@tanstack/react-virtual";
|
|
4
|
-
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
5
|
-
// import type { Dispatch, SetStateAction } from "react";
|
|
6
|
-
import React, { Fragment } from "react";
|
|
7
|
-
import { TableContext } from "../useContext";
|
|
8
|
-
import { Empty } from "rc-master-ui";
|
|
9
|
-
const TableBody = ({
|
|
10
|
-
columnVirtualizer,
|
|
11
|
-
table,
|
|
12
|
-
tableContainerRef,
|
|
13
|
-
virtualPaddingLeft,
|
|
14
|
-
virtualPaddingRight,
|
|
15
|
-
fixedLeftColumns,
|
|
16
|
-
fixedRightColumns,
|
|
17
|
-
tableId,
|
|
18
|
-
showEmptyText,
|
|
19
|
-
...rest
|
|
20
|
-
}) => {
|
|
21
|
-
const {
|
|
22
|
-
rows
|
|
23
|
-
} = table.getRowModel();
|
|
24
|
-
const {
|
|
25
|
-
editingKey,
|
|
26
|
-
prefix,
|
|
27
|
-
locale
|
|
28
|
-
} = React.useContext(TableContext);
|
|
29
|
-
|
|
30
|
-
//dynamic row height virtualization - alternatively you could use a simpler fixed row height strategy without the need for `measureElement`
|
|
31
|
-
const rowVirtualizer = useVirtualizer({
|
|
32
|
-
count: rows.length,
|
|
33
|
-
estimateSize: () => 36,
|
|
34
|
-
//estimate row height for accurate scrollbar dragging
|
|
35
|
-
getScrollElement: () => tableContainerRef.current,
|
|
36
|
-
//measure dynamic row height, except in firefox because it measures table border height incorrectly
|
|
37
|
-
measureElement: typeof window !== 'undefined' && navigator.userAgent.indexOf('Firefox') === -1 ? element => element?.getBoundingClientRect().height : undefined,
|
|
38
|
-
overscan: 1
|
|
39
|
-
});
|
|
40
|
-
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
41
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: `${prefix}-grid-tbody`,
|
|
43
|
-
style: {
|
|
44
|
-
display: 'grid',
|
|
45
|
-
// height: `${rowVirtualizer.getTotalSize()}px`, //tells scrollbar how big the table is
|
|
46
|
-
height: showEmptyText && rows.length === 0 ? `140px` : `${rowVirtualizer.getTotalSize()}px`,
|
|
47
|
-
//tells scrollbar how big the table is
|
|
48
|
-
position: 'relative' //needed for absolute positioning of rows
|
|
49
|
-
}
|
|
50
|
-
}, showEmptyText && rows.length === 0 ? /*#__PURE__*/React.createElement("tr", {
|
|
51
|
-
style: {
|
|
52
|
-
// transform: `translateY(${virtualRow.start}px)`, //this should always be a `style` as it changes on scroll
|
|
53
|
-
}
|
|
54
|
-
}, /*#__PURE__*/React.createElement("td", {
|
|
55
|
-
// colSpan={30}
|
|
56
|
-
style: {
|
|
57
|
-
position: "sticky",
|
|
58
|
-
left: 0,
|
|
59
|
-
width: tableContainerRef.current?.clientWidth,
|
|
60
|
-
overflow: 'hidden'
|
|
61
|
-
}
|
|
62
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Empty, {
|
|
63
|
-
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
64
|
-
description: locale?.emptyText
|
|
65
|
-
})))) : /*#__PURE__*/React.createElement(Fragment, null, virtualRows.map(virtualRow => {
|
|
66
|
-
const row = rows[virtualRow.index];
|
|
67
|
-
const isEditing = row.id === editingKey;
|
|
68
|
-
return /*#__PURE__*/React.createElement(TableBodyRow, _extends({}, rest, {
|
|
69
|
-
table: table,
|
|
70
|
-
tableId: tableId,
|
|
71
|
-
key: row.id,
|
|
72
|
-
row: row,
|
|
73
|
-
columnVirtualizer: columnVirtualizer,
|
|
74
|
-
rowVirtualizer: rowVirtualizer,
|
|
75
|
-
virtualPaddingLeft: virtualPaddingLeft,
|
|
76
|
-
virtualPaddingRight: virtualPaddingRight,
|
|
77
|
-
virtualRow: virtualRow,
|
|
78
|
-
fixedLeftColumns: fixedLeftColumns,
|
|
79
|
-
fixedRightColumns: fixedRightColumns,
|
|
80
|
-
isEditing: isEditing
|
|
81
|
-
}));
|
|
82
|
-
})));
|
|
83
|
-
};
|
|
84
|
-
export default TableBody;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { IFormat } from "./type";
|
|
3
|
-
type Props = {
|
|
4
|
-
columns: any[];
|
|
5
|
-
dataSourceFilter?: any[];
|
|
6
|
-
onFilter?: (query: any, col?: any[]) => void;
|
|
7
|
-
mode?: 'sidebar' | 'dropdown';
|
|
8
|
-
defaultFilter?: any[];
|
|
9
|
-
leftFilterWidth?: number;
|
|
10
|
-
format?: IFormat;
|
|
11
|
-
t?: any;
|
|
12
|
-
};
|
|
13
|
-
declare const AdvanceFilter: (props: Props) => React.JSX.Element;
|
|
14
|
-
export default AdvanceFilter;
|