@blocklet/list 0.8.16 → 0.8.17
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/components/search.js
CHANGED
|
@@ -61,6 +61,9 @@ const Search = _ref => {
|
|
|
61
61
|
handleKeyword();
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
+
(0, _react.useEffect)(() => {
|
|
65
|
+
setSearchStr(filters.keyword || '');
|
|
66
|
+
}, [filters.keyword]);
|
|
64
67
|
return /*#__PURE__*/_react.default.createElement(StyledSearch, Object.assign({
|
|
65
68
|
inputProps: {
|
|
66
69
|
'data-cy': 'search-blocklet'
|
|
@@ -74,9 +77,9 @@ const Search = _ref => {
|
|
|
74
77
|
title: placeholder,
|
|
75
78
|
"data-cy": "search",
|
|
76
79
|
endAdornment: searchStr && /*#__PURE__*/_react.default.createElement(_material.InputAdornment, {
|
|
80
|
+
"data-cy": "search-delete",
|
|
77
81
|
position: "end"
|
|
78
82
|
}, /*#__PURE__*/_react.default.createElement(StyledCloseIcon, {
|
|
79
|
-
"data-cy": "search-delete",
|
|
80
83
|
onClick: handleClose
|
|
81
84
|
}))
|
|
82
85
|
}, rest));
|
package/lib/contexts/filter.js
CHANGED
|
@@ -242,9 +242,10 @@ function FilterProvider(_ref) {
|
|
|
242
242
|
if (!hasDeveloperFilter) {
|
|
243
243
|
fetchCategories();
|
|
244
244
|
}
|
|
245
|
-
}, [
|
|
245
|
+
}, [hasDeveloperFilter]);
|
|
246
246
|
(0, _react.useEffect)(() => {
|
|
247
247
|
fetchBlocklets();
|
|
248
|
+
fetchCategories();
|
|
248
249
|
}, [endpoint]);
|
|
249
250
|
return /*#__PURE__*/_react.default.createElement(Provider, {
|
|
250
251
|
value: filterStore
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/list",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.17",
|
|
4
4
|
"description": "Common ux components of blocklet",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react": ">=18.1.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@arcblock/ux": "^2.1.
|
|
40
|
+
"@arcblock/ux": "^2.1.4",
|
|
41
41
|
"@emotion/react": "^11.9.0",
|
|
42
42
|
"@emotion/styled": "^11.8.1",
|
|
43
43
|
"@mui/icons-material": "^5.6.2",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
59
59
|
"babel-plugin-styled-components": "^1.10.7"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "660a066ab7efb6b77e9a50f0f6e2a8928760409e"
|
|
62
62
|
}
|
package/src/components/search.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import SearchIcon from '@mui/icons-material/Search';
|
|
4
4
|
import CloseIcon from '@mui/icons-material/Close';
|
|
@@ -22,6 +22,10 @@ const Search = ({ placeholder, ...rest }) => {
|
|
|
22
22
|
setSearchStr('');
|
|
23
23
|
handleKeyword();
|
|
24
24
|
};
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setSearchStr(filters.keyword || '');
|
|
27
|
+
}, [filters.keyword]);
|
|
28
|
+
|
|
25
29
|
return (
|
|
26
30
|
<StyledSearch
|
|
27
31
|
inputProps={{
|
|
@@ -39,8 +43,8 @@ const Search = ({ placeholder, ...rest }) => {
|
|
|
39
43
|
data-cy="search"
|
|
40
44
|
endAdornment={
|
|
41
45
|
searchStr && (
|
|
42
|
-
<InputAdornment position="end">
|
|
43
|
-
<StyledCloseIcon
|
|
46
|
+
<InputAdornment data-cy="search-delete" position="end">
|
|
47
|
+
<StyledCloseIcon onClick={handleClose} />
|
|
44
48
|
</InputAdornment>
|
|
45
49
|
)
|
|
46
50
|
}
|
package/src/contexts/filter.js
CHANGED
|
@@ -169,10 +169,11 @@ function FilterProvider({
|
|
|
169
169
|
if (!hasDeveloperFilter) {
|
|
170
170
|
fetchCategories();
|
|
171
171
|
}
|
|
172
|
-
}, [
|
|
172
|
+
}, [hasDeveloperFilter]);
|
|
173
173
|
|
|
174
174
|
useEffect(() => {
|
|
175
175
|
fetchBlocklets();
|
|
176
|
+
fetchCategories();
|
|
176
177
|
}, [endpoint]);
|
|
177
178
|
|
|
178
179
|
return <Provider value={filterStore}>{children}</Provider>;
|