@etsoo/materialui 1.1.62 → 1.1.63
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.d.ts +4 -0
- package/lib/SearchBar.js +3 -3
- package/package.json +1 -1
- package/src/SearchBar.tsx +8 -3
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, onSubmit } = props;
|
|
55
|
+
const { className, fields, onSubmit, itemMaxWidth = 160 } = props;
|
|
56
56
|
// Labels
|
|
57
57
|
const labels = Labels.CommonPage;
|
|
58
58
|
// Spacing
|
|
@@ -226,10 +226,10 @@ export function SearchBar(props) {
|
|
|
226
226
|
React.createElement(Stack, { ref: dimensions[0][0], justifyContent: "center", alignItems: "center", direction: "row", spacing: 1, width: "100%", sx: {
|
|
227
227
|
overflowX: "hidden",
|
|
228
228
|
"& > :not(style)": {
|
|
229
|
-
flexBasis: "
|
|
229
|
+
flexBasis: "auto",
|
|
230
230
|
flexGrow: 0,
|
|
231
231
|
flexShrink: 0,
|
|
232
|
-
maxWidth:
|
|
232
|
+
maxWidth: `${itemMaxWidth}px`,
|
|
233
233
|
visibility: "hidden"
|
|
234
234
|
},
|
|
235
235
|
"& > .hiddenChild": {
|
package/package.json
CHANGED
package/src/SearchBar.tsx
CHANGED
|
@@ -14,6 +14,11 @@ export interface SearchBarProps {
|
|
|
14
14
|
*/
|
|
15
15
|
className?: string;
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Item max width
|
|
19
|
+
*/
|
|
20
|
+
itemMaxWidth?: number;
|
|
21
|
+
|
|
17
22
|
/**
|
|
18
23
|
* Fields
|
|
19
24
|
*/
|
|
@@ -77,7 +82,7 @@ const setChildState = (child: Element, enabled: boolean) => {
|
|
|
77
82
|
*/
|
|
78
83
|
export function SearchBar(props: SearchBarProps) {
|
|
79
84
|
// Destruct
|
|
80
|
-
const { className, fields, onSubmit } = props;
|
|
85
|
+
const { className, fields, onSubmit, itemMaxWidth = 160 } = props;
|
|
81
86
|
|
|
82
87
|
// Labels
|
|
83
88
|
const labels = Labels.CommonPage;
|
|
@@ -309,10 +314,10 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
309
314
|
sx={{
|
|
310
315
|
overflowX: "hidden",
|
|
311
316
|
"& > :not(style)": {
|
|
312
|
-
flexBasis: "
|
|
317
|
+
flexBasis: "auto",
|
|
313
318
|
flexGrow: 0,
|
|
314
319
|
flexShrink: 0,
|
|
315
|
-
maxWidth:
|
|
320
|
+
maxWidth: `${itemMaxWidth}px`,
|
|
316
321
|
visibility: "hidden"
|
|
317
322
|
},
|
|
318
323
|
"& > .hiddenChild": {
|