@faststore/ui 1.5.9 → 1.5.13
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/CHANGELOG.md +44 -0
- package/dist/molecules/SearchInput/SearchInput.d.ts +5 -1
- package/dist/ui.cjs.development.js +11 -6
- package/dist/ui.cjs.development.js.map +1 -1
- package/dist/ui.cjs.production.min.js +1 -1
- package/dist/ui.cjs.production.min.js.map +1 -1
- package/dist/ui.esm.js +12 -7
- package/dist/ui.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/molecules/SearchInput/SearchInput.tsx +18 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,50 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.5.13 (2022-02-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Ajust SearchInput reference ([#1153](https://github.com/vtex/faststore/issues/1153)) ([c2ee199](https://github.com/vtex/faststore/commit/c2ee199402bc4e9d5846dc50778778e940ac7124))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 1.5.12 (2022-02-21)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* allCollections query pagination and pagetype timeout errors ([#1140](https://github.com/vtex/faststore/issues/1140)) ([0150222](https://github.com/vtex/faststore/commit/01502220fb903c62f0b33b9a703fb45daafae141))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 1.5.11 (2022-02-18)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **gatsby-plugin-nginx:** remove trailing slash from incoming requests ([#1145](https://github.com/vtex/faststore/issues/1145)) ([db6f1e1](https://github.com/vtex/faststore/commit/db6f1e173ec43747bf9cfa244b81d86db8a25ce3))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## 1.5.10 (2022-02-17)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* **api:** Add additional property ([#1107](https://github.com/vtex/faststore/issues/1107)) ([bbcfc4a](https://github.com/vtex/faststore/commit/bbcfc4af68148adb54d66a3f1d28a9817ad2956c))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
6
50
|
## 1.5.9 (2022-02-16)
|
|
7
51
|
|
|
8
52
|
**Note:** Version bump only for package @faststore/ui
|
|
@@ -20,5 +20,9 @@ export interface SearchInputProps extends InputProps {
|
|
|
20
20
|
*/
|
|
21
21
|
testId?: string;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
export interface SearchInputRef {
|
|
24
|
+
inputRef?: HTMLInputElement | null;
|
|
25
|
+
formRef?: HTMLFormElement | null;
|
|
26
|
+
}
|
|
27
|
+
declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<SearchInputRef | null>>;
|
|
24
28
|
export default SearchInput;
|
|
@@ -401,26 +401,31 @@ const SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput({
|
|
|
401
401
|
testId = 'store-search-input',
|
|
402
402
|
...otherProps
|
|
403
403
|
}, ref) {
|
|
404
|
-
const
|
|
404
|
+
const inputRef = React.useRef(null);
|
|
405
|
+
const formRef = React.useRef(null);
|
|
405
406
|
|
|
406
407
|
const handleSubmit = event => {
|
|
407
|
-
var
|
|
408
|
+
var _inputRef$current;
|
|
408
409
|
|
|
409
410
|
event.preventDefault();
|
|
410
411
|
|
|
411
|
-
if (((
|
|
412
|
-
onSubmit(
|
|
412
|
+
if (((_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.value) !== '') {
|
|
413
|
+
onSubmit(inputRef.current.value);
|
|
413
414
|
}
|
|
414
415
|
};
|
|
415
416
|
|
|
417
|
+
React.useImperativeHandle(ref, () => ({
|
|
418
|
+
inputRef: inputRef.current,
|
|
419
|
+
formRef: formRef.current
|
|
420
|
+
}));
|
|
416
421
|
return React__default.createElement(Form, {
|
|
417
|
-
ref:
|
|
422
|
+
ref: formRef,
|
|
418
423
|
"data-store-search-input": true,
|
|
419
424
|
"data-testid": testId,
|
|
420
425
|
onSubmit: handleSubmit,
|
|
421
426
|
role: "search"
|
|
422
427
|
}, React__default.createElement(Input, Object.assign({
|
|
423
|
-
ref:
|
|
428
|
+
ref: inputRef,
|
|
424
429
|
"aria-label": ariaLabel
|
|
425
430
|
}, otherProps)), React__default.createElement(Button, {
|
|
426
431
|
type: "submit",
|