@synerise/ds-search-bar 0.6.77 → 0.6.79
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 +19 -0
- package/dist/SearchBar.d.ts +2 -2
- package/dist/SearchBar.js +30 -21
- package/package.json +8 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
## [0.6.79](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search-bar@0.6.78...@synerise/ds-search-bar@0.6.79) (2024-07-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fixed missing dependencies ([f718fb7](https://github.com/Synerise/synerise-design/commit/f718fb7e954a19857ea4b6bbd417e3fe290fd2dc))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.6.78](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search-bar@0.6.77...@synerise/ds-search-bar@0.6.78) (2024-07-02)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-search-bar
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.6.77](https://github.com/Synerise/synerise-design/compare/@synerise/ds-search-bar@0.6.76...@synerise/ds-search-bar@0.6.77) (2024-06-27)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-search-bar
|
package/dist/SearchBar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { SearchBarProps } from './SearchBar.types';
|
|
3
|
-
declare const SearchBar: React.
|
|
3
|
+
declare const SearchBar: ({ value, className, onSearchChange, onClearInput, placeholder, iconLeft, autofocus, clearTooltip, disabled, borderRadius, handleInputRef, autofocusDelay, }: SearchBarProps) => React.JSX.Element;
|
|
4
4
|
export default SearchBar;
|
package/dist/SearchBar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import Icon, { Close3M } from '@synerise/ds-icon';
|
|
3
3
|
import { theme } from '@synerise/ds-core';
|
|
4
4
|
import Tooltip from '@synerise/ds-tooltip';
|
|
@@ -22,33 +22,42 @@ var SearchBar = function SearchBar(_ref) {
|
|
|
22
22
|
handleInputRef = _ref.handleInputRef,
|
|
23
23
|
autofocusDelay = _ref.autofocusDelay;
|
|
24
24
|
|
|
25
|
-
var
|
|
26
|
-
isFocused =
|
|
27
|
-
setFocus =
|
|
25
|
+
var _useState = useState(false),
|
|
26
|
+
isFocused = _useState[0],
|
|
27
|
+
setFocus = _useState[1];
|
|
28
28
|
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
var _useState2 = useState(),
|
|
30
|
+
input = _useState2[0],
|
|
31
|
+
setInput = _useState2[1];
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
var handleRef = function handleRef(ref) {
|
|
34
|
+
// eslint-disable-next-line no-unused-expressions
|
|
35
|
+
handleInputRef == null || handleInputRef(ref);
|
|
36
|
+
if (ref.current) setInput(ref.current);
|
|
37
|
+
};
|
|
36
38
|
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
if (input) {
|
|
37
41
|
if (autofocus) {
|
|
38
42
|
if (autofocusDelay) {
|
|
39
|
-
setTimeout(function () {
|
|
40
|
-
|
|
43
|
+
var timeout = setTimeout(function () {
|
|
44
|
+
input.focus({
|
|
41
45
|
preventScroll: true
|
|
42
46
|
});
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
47
|
+
}, autofocusDelay);
|
|
48
|
+
return function () {
|
|
49
|
+
clearTimeout(timeout);
|
|
50
|
+
};
|
|
48
51
|
}
|
|
52
|
+
|
|
53
|
+
input.focus({
|
|
54
|
+
preventScroll: true
|
|
55
|
+
});
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
|
-
|
|
58
|
+
|
|
59
|
+
return undefined;
|
|
60
|
+
}, [autofocus, autofocusDelay, input]);
|
|
52
61
|
return /*#__PURE__*/React.createElement(S.SearchBarWrapper, {
|
|
53
62
|
iconLeft: iconLeft,
|
|
54
63
|
isEmpty: !value,
|
|
@@ -66,8 +75,8 @@ var SearchBar = function SearchBar(_ref) {
|
|
|
66
75
|
color: theme.palette['grey-500'],
|
|
67
76
|
size: 18
|
|
68
77
|
})), /*#__PURE__*/React.createElement(S.SearchBar, {
|
|
69
|
-
onChange: function onChange(
|
|
70
|
-
return onSearchChange(
|
|
78
|
+
onChange: function onChange(event) {
|
|
79
|
+
return onSearchChange(event.currentTarget.value);
|
|
71
80
|
},
|
|
72
81
|
onFocus: function onFocus() {
|
|
73
82
|
return setFocus(true);
|
|
@@ -79,7 +88,7 @@ var SearchBar = function SearchBar(_ref) {
|
|
|
79
88
|
value: value,
|
|
80
89
|
className: className,
|
|
81
90
|
resetMargin: true,
|
|
82
|
-
handleInputRef:
|
|
91
|
+
handleInputRef: handleRef,
|
|
83
92
|
disabled: disabled,
|
|
84
93
|
autoComplete: "off"
|
|
85
94
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-search-bar",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.79",
|
|
4
4
|
"description": "SearchBar UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -33,20 +33,16 @@
|
|
|
33
33
|
],
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@synerise/ds-icon": "^0.
|
|
37
|
-
"@synerise/ds-input": "^0.
|
|
38
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
39
|
-
"@synerise/ds-utils": "^0.
|
|
36
|
+
"@synerise/ds-icon": "^0.64.0",
|
|
37
|
+
"@synerise/ds-input": "^0.23.1",
|
|
38
|
+
"@synerise/ds-tooltip": "^0.14.32",
|
|
39
|
+
"@synerise/ds-utils": "^0.28.0",
|
|
40
|
+
"react-intl": "^3.12.0"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
42
43
|
"@synerise/ds-core": "*",
|
|
43
|
-
"react": ">=16.9.0
|
|
44
|
+
"react": ">=16.9.0 <= 17.0.2",
|
|
44
45
|
"styled-components": "5.0.1"
|
|
45
46
|
},
|
|
46
|
-
"
|
|
47
|
-
"@testing-library/dom": "^7.0.2",
|
|
48
|
-
"@testing-library/jest-dom": "5.1.1",
|
|
49
|
-
"@testing-library/react": "10.0.1"
|
|
50
|
-
},
|
|
51
|
-
"gitHead": "587eb113074985ae21e4f0c25ec33c3e3e2e072b"
|
|
47
|
+
"gitHead": "6e5e5202d6c6f1c2caf6bfef799009813b437b3d"
|
|
52
48
|
}
|