@etsoo/materialui 1.1.75 → 1.1.77
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/lib/SearchBar.js +8 -2
- package/package.json +1 -1
- package/src/SearchBar.tsx +8 -2
package/lib/SearchBar.js
CHANGED
|
@@ -170,6 +170,7 @@ export function SearchBar(props) {
|
|
|
170
170
|
moreItems.push(React.createElement(React.Fragment, { key: i }, fields[i]));
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
+
const hasMoreItems = moreItems.length > 0;
|
|
173
174
|
// Handle main form
|
|
174
175
|
const handleForm = (event) => {
|
|
175
176
|
if (event.nativeEvent.cancelable && !event.nativeEvent.composed)
|
|
@@ -223,7 +224,12 @@ export function SearchBar(props) {
|
|
|
223
224
|
if (form)
|
|
224
225
|
state.form = form;
|
|
225
226
|
} },
|
|
226
|
-
React.createElement(Stack, { ref: dimensions[0][0], justifyContent: "center", alignItems: "center", direction: "row", spacing: 1, width: "100%",
|
|
227
|
+
React.createElement(Stack, { ref: dimensions[0][0], className: "SearchBarContainer", justifyContent: "center", alignItems: "center", direction: "row", spacing: 1, width: "100%", sx: {
|
|
228
|
+
scrollbarWidth: 0,
|
|
229
|
+
"-ms-overflow-style": "none",
|
|
230
|
+
"&::-webkit-scrollbar": {
|
|
231
|
+
display: "none"
|
|
232
|
+
},
|
|
227
233
|
"& > :not(style)": {
|
|
228
234
|
flexBasis: "auto",
|
|
229
235
|
flexGrow: 0,
|
|
@@ -243,7 +249,7 @@ export function SearchBar(props) {
|
|
|
243
249
|
React.createElement(IconButton, { title: labels.more, size: "medium", sx: { height: "40px" }, onClick: handleMore },
|
|
244
250
|
React.createElement(MoreHorizIcon, null)),
|
|
245
251
|
React.createElement(Button, { variant: "contained", size: "medium", ref: resetButtonRef, onClick: handleReset }, labels.reset))),
|
|
246
|
-
|
|
252
|
+
hasMoreItems && (React.createElement(Drawer, { anchor: "right", sx: { minWidth: "250px" }, ModalProps: {
|
|
247
253
|
keepMounted: true
|
|
248
254
|
}, open: open, onClose: () => updateOpen(false) },
|
|
249
255
|
React.createElement("form", { onChange: moreFormChange, ref: (form) => {
|
package/package.json
CHANGED
package/src/SearchBar.tsx
CHANGED
|
@@ -237,6 +237,7 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
237
237
|
moreItems.push(<React.Fragment key={i}>{fields[i]}</React.Fragment>);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
+
const hasMoreItems = moreItems.length > 0;
|
|
240
241
|
|
|
241
242
|
// Handle main form
|
|
242
243
|
const handleForm = (event: React.FormEvent<HTMLFormElement>) => {
|
|
@@ -306,13 +307,18 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
306
307
|
>
|
|
307
308
|
<Stack
|
|
308
309
|
ref={dimensions[0][0]}
|
|
310
|
+
className="SearchBarContainer"
|
|
309
311
|
justifyContent="center"
|
|
310
312
|
alignItems="center"
|
|
311
313
|
direction="row"
|
|
312
314
|
spacing={1}
|
|
313
315
|
width="100%"
|
|
314
|
-
overflow="hidden"
|
|
315
316
|
sx={{
|
|
317
|
+
scrollbarWidth: 0,
|
|
318
|
+
"-ms-overflow-style": "none",
|
|
319
|
+
"&::-webkit-scrollbar": {
|
|
320
|
+
display: "none"
|
|
321
|
+
},
|
|
316
322
|
"& > :not(style)": {
|
|
317
323
|
flexBasis: "auto",
|
|
318
324
|
flexGrow: 0,
|
|
@@ -351,7 +357,7 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
351
357
|
</Button>
|
|
352
358
|
</Stack>
|
|
353
359
|
</form>
|
|
354
|
-
{
|
|
360
|
+
{hasMoreItems && (
|
|
355
361
|
<Drawer
|
|
356
362
|
anchor="right"
|
|
357
363
|
sx={{ minWidth: "250px" }}
|