@etsoo/materialui 1.4.83 → 1.4.85
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/cjs/SearchBar.d.ts +1 -0
- package/lib/cjs/SearchBar.js +2 -2
- package/lib/mjs/SearchBar.d.ts +1 -0
- package/lib/mjs/SearchBar.js +3 -3
- package/package.json +1 -1
- package/src/SearchBar.tsx +11 -13
package/lib/cjs/SearchBar.d.ts
CHANGED
package/lib/cjs/SearchBar.js
CHANGED
|
@@ -70,6 +70,7 @@ function checkFormEvent(event) {
|
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Search bar
|
|
73
|
+
* Make sure its container's width is fixed, not fluid, like "<Container fixed><SearchBar ../></Container>"
|
|
73
74
|
* @param props Props
|
|
74
75
|
* @returns Component
|
|
75
76
|
*/
|
|
@@ -154,7 +155,6 @@ function SearchBar(props) {
|
|
|
154
155
|
}
|
|
155
156
|
else {
|
|
156
157
|
const childD = child.getBoundingClientRect();
|
|
157
|
-
console.log("SearchBar", child.querySelector("input")?.name, childD.width, childD.height, child.clientWidth, child.computedStyleMap().get("width"));
|
|
158
158
|
childWidth = childD.width + itemGap;
|
|
159
159
|
child.setAttribute(cachedWidthName, childWidth.toString());
|
|
160
160
|
}
|
|
@@ -240,7 +240,7 @@ function SearchBar(props) {
|
|
|
240
240
|
};
|
|
241
241
|
}, [className]);
|
|
242
242
|
// Layout
|
|
243
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
243
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Container, { fixed: true, children: [(0, jsx_runtime_1.jsx)("form", { id: "SearchBarForm", className: className, onChange: handleForm, ref: (form) => {
|
|
244
244
|
if (form)
|
|
245
245
|
state.form = form;
|
|
246
246
|
}, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { ref: dimensions[0][0], className: "SearchBarContainer", justifyContent: "center", alignItems: "center", direction: "row", spacing: `${itemGap}px`, width: "100%", overflow: "hidden", paddingTop: "6px", sx: {
|
package/lib/mjs/SearchBar.d.ts
CHANGED
package/lib/mjs/SearchBar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Drawer, IconButton, Stack, Toolbar } from "@mui/material";
|
|
2
|
+
import { Button, Container, Drawer, IconButton, Stack, Toolbar } from "@mui/material";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
|
|
5
5
|
import { DomUtils, NumberUtils } from "@etsoo/shared";
|
|
@@ -64,6 +64,7 @@ function checkFormEvent(event) {
|
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* Search bar
|
|
67
|
+
* Make sure its container's width is fixed, not fluid, like "<Container fixed><SearchBar ../></Container>"
|
|
67
68
|
* @param props Props
|
|
68
69
|
* @returns Component
|
|
69
70
|
*/
|
|
@@ -148,7 +149,6 @@ export function SearchBar(props) {
|
|
|
148
149
|
}
|
|
149
150
|
else {
|
|
150
151
|
const childD = child.getBoundingClientRect();
|
|
151
|
-
console.log("SearchBar", child.querySelector("input")?.name, childD.width, childD.height, child.clientWidth, child.computedStyleMap().get("width"));
|
|
152
152
|
childWidth = childD.width + itemGap;
|
|
153
153
|
child.setAttribute(cachedWidthName, childWidth.toString());
|
|
154
154
|
}
|
|
@@ -234,7 +234,7 @@ export function SearchBar(props) {
|
|
|
234
234
|
};
|
|
235
235
|
}, [className]);
|
|
236
236
|
// Layout
|
|
237
|
-
return (_jsxs(
|
|
237
|
+
return (_jsxs(Container, { fixed: true, children: [_jsx("form", { id: "SearchBarForm", className: className, onChange: handleForm, ref: (form) => {
|
|
238
238
|
if (form)
|
|
239
239
|
state.form = form;
|
|
240
240
|
}, children: _jsxs(Stack, { ref: dimensions[0][0], className: "SearchBarContainer", justifyContent: "center", alignItems: "center", direction: "row", spacing: `${itemGap}px`, width: "100%", overflow: "hidden", paddingTop: "6px", sx: {
|
package/package.json
CHANGED
package/src/SearchBar.tsx
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Container,
|
|
4
|
+
Drawer,
|
|
5
|
+
IconButton,
|
|
6
|
+
Stack,
|
|
7
|
+
Toolbar
|
|
8
|
+
} from "@mui/material";
|
|
2
9
|
import React from "react";
|
|
3
10
|
import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
|
|
4
11
|
import { DomUtils, NumberUtils } from "@etsoo/shared";
|
|
@@ -107,6 +114,7 @@ function checkFormEvent(event: React.FormEvent<HTMLFormElement>) {
|
|
|
107
114
|
|
|
108
115
|
/**
|
|
109
116
|
* Search bar
|
|
117
|
+
* Make sure its container's width is fixed, not fluid, like "<Container fixed><SearchBar ../></Container>"
|
|
110
118
|
* @param props Props
|
|
111
119
|
* @returns Component
|
|
112
120
|
*/
|
|
@@ -228,16 +236,6 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
228
236
|
childWidth = Number.parseFloat(cachedWidth);
|
|
229
237
|
} else {
|
|
230
238
|
const childD = child.getBoundingClientRect();
|
|
231
|
-
|
|
232
|
-
console.log(
|
|
233
|
-
"SearchBar",
|
|
234
|
-
child.querySelector("input")?.name,
|
|
235
|
-
childD.width,
|
|
236
|
-
childD.height,
|
|
237
|
-
child.clientWidth,
|
|
238
|
-
child.computedStyleMap().get("width")
|
|
239
|
-
);
|
|
240
|
-
|
|
241
239
|
childWidth = childD.width + itemGap;
|
|
242
240
|
child.setAttribute(cachedWidthName, childWidth.toString());
|
|
243
241
|
}
|
|
@@ -339,7 +337,7 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
339
337
|
|
|
340
338
|
// Layout
|
|
341
339
|
return (
|
|
342
|
-
<
|
|
340
|
+
<Container fixed>
|
|
343
341
|
<form
|
|
344
342
|
id="SearchBarForm"
|
|
345
343
|
className={className}
|
|
@@ -432,6 +430,6 @@ export function SearchBar(props: SearchBarProps) {
|
|
|
432
430
|
</form>
|
|
433
431
|
</Drawer>
|
|
434
432
|
)}
|
|
435
|
-
</
|
|
433
|
+
</Container>
|
|
436
434
|
);
|
|
437
435
|
}
|