@etsoo/materialui 1.1.56 → 1.1.57
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.
|
@@ -13,11 +13,7 @@ export type ResponsibleContainerProps<T extends object, F extends DataTypes.Basi
|
|
|
13
13
|
* Height will be deducted
|
|
14
14
|
* @param height Current calcuated height
|
|
15
15
|
*/
|
|
16
|
-
adjustHeight?: (height: number) => number;
|
|
17
|
-
/**
|
|
18
|
-
* Top height
|
|
19
|
-
*/
|
|
20
|
-
topHeight?: number;
|
|
16
|
+
adjustHeight?: (height: number, rect: DOMRect) => number;
|
|
21
17
|
/**
|
|
22
18
|
* Columns
|
|
23
19
|
*/
|
|
@@ -22,7 +22,7 @@ function defaultContainerBoxSx(paddings, hasField, _dataGrid) {
|
|
|
22
22
|
*/
|
|
23
23
|
export function ResponsibleContainer(props) {
|
|
24
24
|
// Destruct
|
|
25
|
-
const { adjustHeight, columns, containerBoxSx = defaultContainerBoxSx, dataGridMinWidth = Math.max(576, DataGridExCalColumns(columns).total), elementReady, fields, fieldTemplate, height,
|
|
25
|
+
const { adjustHeight, columns, containerBoxSx = defaultContainerBoxSx, dataGridMinWidth = Math.max(576, DataGridExCalColumns(columns).total), elementReady, fields, fieldTemplate, height, loadData, mRef, paddings = MUGlobal.pagePaddings, pullToRefresh = true, quickAction, sizeReadyMiliseconds = 0, searchBarHeight, ...rest } = props;
|
|
26
26
|
// Labels
|
|
27
27
|
const labels = Labels.CommonPage;
|
|
28
28
|
// Refs
|
|
@@ -89,15 +89,13 @@ export function ResponsibleContainer(props) {
|
|
|
89
89
|
else {
|
|
90
90
|
// Auto calculation
|
|
91
91
|
heightLocal =
|
|
92
|
-
document.documentElement.clientHeight -
|
|
93
|
-
(topHeight !== null && topHeight !== void 0 ? topHeight : Math.round(rect.bottom + 1));
|
|
92
|
+
document.documentElement.clientHeight - Math.round(rect.bottom + 1);
|
|
94
93
|
const style = window.getComputedStyle(dimensions[0][1]);
|
|
95
94
|
const boxMargin = parseFloat(style.marginBottom);
|
|
96
95
|
if (!isNaN(boxMargin))
|
|
97
96
|
heightLocal -= 3 * boxMargin; // 1 - Box, 2 - Page bottom
|
|
98
|
-
if (adjustHeight != null)
|
|
99
|
-
heightLocal -= adjustHeight(heightLocal);
|
|
100
|
-
}
|
|
97
|
+
if (adjustHeight != null)
|
|
98
|
+
heightLocal -= adjustHeight(heightLocal, rect);
|
|
101
99
|
}
|
|
102
100
|
if (showDataGrid) {
|
|
103
101
|
// Delete
|
package/package.json
CHANGED
|
@@ -42,12 +42,7 @@ export type ResponsibleContainerProps<
|
|
|
42
42
|
* Height will be deducted
|
|
43
43
|
* @param height Current calcuated height
|
|
44
44
|
*/
|
|
45
|
-
adjustHeight?: (height: number) => number;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Top height
|
|
49
|
-
*/
|
|
50
|
-
topHeight?: number;
|
|
45
|
+
adjustHeight?: (height: number, rect: DOMRect) => number;
|
|
51
46
|
|
|
52
47
|
/**
|
|
53
48
|
* Columns
|
|
@@ -182,7 +177,6 @@ export function ResponsibleContainer<
|
|
|
182
177
|
fields,
|
|
183
178
|
fieldTemplate,
|
|
184
179
|
height,
|
|
185
|
-
topHeight,
|
|
186
180
|
loadData,
|
|
187
181
|
mRef,
|
|
188
182
|
paddings = MUGlobal.pagePaddings,
|
|
@@ -277,16 +271,13 @@ export function ResponsibleContainer<
|
|
|
277
271
|
} else {
|
|
278
272
|
// Auto calculation
|
|
279
273
|
heightLocal =
|
|
280
|
-
document.documentElement.clientHeight -
|
|
281
|
-
(topHeight ?? Math.round(rect.bottom + 1));
|
|
274
|
+
document.documentElement.clientHeight - Math.round(rect.bottom + 1);
|
|
282
275
|
|
|
283
276
|
const style = window.getComputedStyle(dimensions[0][1]!);
|
|
284
277
|
const boxMargin = parseFloat(style.marginBottom);
|
|
285
278
|
if (!isNaN(boxMargin)) heightLocal -= 3 * boxMargin; // 1 - Box, 2 - Page bottom
|
|
286
279
|
|
|
287
|
-
if (adjustHeight != null)
|
|
288
|
-
heightLocal -= adjustHeight(heightLocal);
|
|
289
|
-
}
|
|
280
|
+
if (adjustHeight != null) heightLocal -= adjustHeight(heightLocal, rect);
|
|
290
281
|
}
|
|
291
282
|
|
|
292
283
|
if (showDataGrid) {
|