@etsoo/materialui 1.1.58 → 1.1.60

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"}`, innerHeight: searchBarHeight }));
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 ? 40 : 0 } }, searchBar),
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);
@@ -11,11 +11,6 @@ export interface SearchBarProps {
11
11
  * Fields
12
12
  */
13
13
  fields: React.ReactElement[];
14
- /**
15
- * Inner height
16
- * @default 40
17
- */
18
- innerHeight?: number;
19
14
  /**
20
15
  * On submit callback
21
16
  */
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, innerHeight = 45.6, onSubmit } = props;
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, height: innerHeight < 1 ? undefined : innerHeight, sx: {
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,
@@ -243,8 +243,8 @@ export function SearchBar(props) {
243
243
  React.createElement(IconButton, { "aria-label": "delete", size: "medium", onClick: handleMore },
244
244
  React.createElement(MoreHorizIcon, null)),
245
245
  React.createElement(Button, { variant: "contained", size: "medium", ref: resetButtonRef, onClick: handleReset }, labels.reset))),
246
- index != null && index < fields.length && (React.createElement(Drawer, { anchor: "right", sx: { minWidth: "250px" }, ModalProps: {
247
- keepMounted: true // Better open performance on mobile.
246
+ index != null && index < fields.length && open && (React.createElement(Drawer, { anchor: "right", sx: { minWidth: "250px" }, ModalProps: {
247
+ keepMounted: false
248
248
  }, open: open, onClose: () => updateOpen(false) },
249
249
  React.createElement("form", { onChange: moreFormChange, ref: (form) => {
250
250
  if (form)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.1.58",
3
+ "version": "1.1.60",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -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 ? 40 : 0 }}
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, innerHeight = 45.6, onSubmit } = props;
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",
@@ -346,12 +339,12 @@ export function SearchBar(props: SearchBarProps) {
346
339
  </Button>
347
340
  </Stack>
348
341
  </form>
349
- {index != null && index < fields.length && (
342
+ {index != null && index < fields.length && open && (
350
343
  <Drawer
351
344
  anchor="right"
352
345
  sx={{ minWidth: "250px" }}
353
346
  ModalProps={{
354
- keepMounted: true // Better open performance on mobile.
347
+ keepMounted: false
355
348
  }}
356
349
  open={open}
357
350
  onClose={() => updateOpen(false)}