@etsoo/materialui 1.1.58 → 1.1.59
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.
|
@@ -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, loadData, mRef, paddings = MUGlobal.pagePaddings, pullToRefresh = true, quickAction, sizeReadyMiliseconds = 0, searchBarHeight, ...rest } = props;
|
|
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 = 45.6, ...rest } = props;
|
|
26
26
|
// Labels
|
|
27
27
|
const labels = Labels.CommonPage;
|
|
28
28
|
// Refs
|
|
@@ -130,7 +130,7 @@ export function ResponsibleContainer(props) {
|
|
|
130
130
|
const searchBar = React.useMemo(() => {
|
|
131
131
|
if (!hasFields || showDataGrid == null)
|
|
132
132
|
return;
|
|
133
|
-
return (React.createElement(SearchBar, { fields: fields, onSubmit: onSubmit, className: `searchBar${showDataGrid ? "Grid" : "List"}
|
|
133
|
+
return (React.createElement(SearchBar, { fields: fields, onSubmit: onSubmit, className: `searchBar${showDataGrid ? "Grid" : "List"}` }));
|
|
134
134
|
}, [showDataGrid, hasFields, searchBarHeight]);
|
|
135
135
|
// Pull container
|
|
136
136
|
const pullContainer = showDataGrid == null
|
|
@@ -143,7 +143,7 @@ export function ResponsibleContainer(props) {
|
|
|
143
143
|
? undefined
|
|
144
144
|
: containerBoxSx(paddings, hasFields, showDataGrid) },
|
|
145
145
|
React.createElement(Stack, null,
|
|
146
|
-
React.createElement(Box, { ref: dimensions[0][0], className: "SearchBox", sx: { height: hasFields ?
|
|
146
|
+
React.createElement(Box, { ref: dimensions[0][0], className: "SearchBox", sx: { height: hasFields ? searchBarHeight : 0 } }, searchBar),
|
|
147
147
|
list),
|
|
148
148
|
pullToRefresh && pullContainer && (React.createElement(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: () => { var _a; return (_a = state.ref) === null || _a === void 0 ? void 0 : _a.reset(); }, shouldPullToRefresh: () => {
|
|
149
149
|
const container = document.querySelector(pullContainer);
|
package/lib/SearchBar.d.ts
CHANGED
package/lib/SearchBar.js
CHANGED
|
@@ -52,7 +52,7 @@ const setChildState = (child, enabled) => {
|
|
|
52
52
|
*/
|
|
53
53
|
export function SearchBar(props) {
|
|
54
54
|
// Destruct
|
|
55
|
-
const { className, fields,
|
|
55
|
+
const { className, fields, onSubmit } = props;
|
|
56
56
|
// Labels
|
|
57
57
|
const labels = Labels.CommonPage;
|
|
58
58
|
// Spacing
|
|
@@ -223,7 +223,7 @@ export function SearchBar(props) {
|
|
|
223
223
|
if (form)
|
|
224
224
|
state.form = form;
|
|
225
225
|
} },
|
|
226
|
-
React.createElement(Stack, { ref: dimensions[0][0], justifyContent: "center", alignItems: "center", direction: "row", spacing: 1,
|
|
226
|
+
React.createElement(Stack, { ref: dimensions[0][0], justifyContent: "center", alignItems: "center", direction: "row", spacing: 1, sx: {
|
|
227
227
|
"& > :not(style)": {
|
|
228
228
|
flexBasis: "auto",
|
|
229
229
|
flexGrow: 0,
|
package/package.json
CHANGED
|
@@ -184,7 +184,7 @@ export function ResponsibleContainer<
|
|
|
184
184
|
pullToRefresh = true,
|
|
185
185
|
quickAction,
|
|
186
186
|
sizeReadyMiliseconds = 0,
|
|
187
|
-
searchBarHeight,
|
|
187
|
+
searchBarHeight = 45.6,
|
|
188
188
|
...rest
|
|
189
189
|
} = props;
|
|
190
190
|
|
|
@@ -342,7 +342,6 @@ export function ResponsibleContainer<
|
|
|
342
342
|
fields={fields}
|
|
343
343
|
onSubmit={onSubmit}
|
|
344
344
|
className={`searchBar${showDataGrid ? "Grid" : "List"}`}
|
|
345
|
-
innerHeight={searchBarHeight}
|
|
346
345
|
/>
|
|
347
346
|
);
|
|
348
347
|
}, [showDataGrid, hasFields, searchBarHeight]);
|
|
@@ -368,7 +367,7 @@ export function ResponsibleContainer<
|
|
|
368
367
|
<Box
|
|
369
368
|
ref={dimensions[0][0]}
|
|
370
369
|
className="SearchBox"
|
|
371
|
-
sx={{ height: hasFields ?
|
|
370
|
+
sx={{ height: hasFields ? searchBarHeight : 0 }}
|
|
372
371
|
>
|
|
373
372
|
{searchBar}
|
|
374
373
|
</Box>
|
package/src/SearchBar.tsx
CHANGED
|
@@ -19,12 +19,6 @@ export interface SearchBarProps {
|
|
|
19
19
|
*/
|
|
20
20
|
fields: React.ReactElement[];
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* Inner height
|
|
24
|
-
* @default 40
|
|
25
|
-
*/
|
|
26
|
-
innerHeight?: number;
|
|
27
|
-
|
|
28
22
|
/**
|
|
29
23
|
* On submit callback
|
|
30
24
|
*/
|
|
@@ -83,7 +77,7 @@ const setChildState = (child: Element, enabled: boolean) => {
|
|
|
83
77
|
*/
|
|
84
78
|
export function SearchBar(props: SearchBarProps) {
|
|
85
79
|
// Destruct
|
|
86
|
-
const { className, fields,
|
|
80
|
+
const { className, fields, onSubmit } = props;
|
|
87
81
|
|
|
88
82
|
// Labels
|
|
89
83
|
const labels = Labels.CommonPage;
|
|
@@ -311,7 +305,6 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
311
305
|
alignItems="center"
|
|
312
306
|
direction="row"
|
|
313
307
|
spacing={1}
|
|
314
|
-
height={innerHeight < 1 ? undefined : innerHeight}
|
|
315
308
|
sx={{
|
|
316
309
|
"& > :not(style)": {
|
|
317
310
|
flexBasis: "auto",
|