@blocklet/list 0.8.65 → 0.9.1
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/base.js +50 -42
- package/lib/components/aside.js +1 -1
- package/lib/components/filter/custom-chip.js +1 -0
- package/package.json +16 -16
- package/src/base.js +46 -37
- package/src/components/aside.js +3 -0
- package/src/components/filter/custom-chip.js +1 -1
package/lib/base.js
CHANGED
|
@@ -62,52 +62,54 @@ function ListBase() {
|
|
|
62
62
|
mdDown: true,
|
|
63
63
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_aside.default, {})
|
|
64
64
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledMin, {
|
|
65
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(FilterContainer, {
|
|
66
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
67
|
+
className: "filter-bar",
|
|
68
|
+
display: "flex",
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSearch, {
|
|
71
|
+
className: "search-container",
|
|
72
|
+
placeholder: t('common.searchStore')
|
|
73
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
74
|
+
mt: 0,
|
|
75
|
+
ml: "16px",
|
|
76
|
+
className: "filter-container",
|
|
77
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Hidden, {
|
|
78
|
+
mdUp: true,
|
|
79
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_filter2.FilterIcon, {})
|
|
80
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_customSelect.default, {
|
|
81
|
+
value: filters.sortBy,
|
|
82
|
+
options: sortOptions,
|
|
83
|
+
title: sortLocale,
|
|
84
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sort.default, {}),
|
|
85
|
+
onChange: v => {
|
|
86
|
+
handleSort(v);
|
|
87
|
+
}
|
|
88
|
+
})]
|
|
89
|
+
})]
|
|
72
90
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
display: "flex",
|
|
92
|
+
flexWrap: "wrap",
|
|
93
|
+
alignItems: "center",
|
|
94
|
+
mb: "16px",
|
|
95
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_filter2.CustomChip, {
|
|
96
|
+
label: developerName,
|
|
97
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Face.default, {}),
|
|
98
|
+
onDelete: () => {
|
|
99
|
+
handleDeveloper(null);
|
|
100
|
+
}
|
|
101
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_filter2.CustomChip, {
|
|
102
|
+
label: categoryLocale,
|
|
103
|
+
onDelete: () => {
|
|
104
|
+
handleCategory(null);
|
|
105
|
+
}
|
|
106
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_filter2.CustomChip, {
|
|
107
|
+
label: priceLocale,
|
|
108
|
+
onDelete: () => {
|
|
109
|
+
handlePrice(null);
|
|
86
110
|
}
|
|
87
111
|
})]
|
|
88
112
|
})]
|
|
89
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
90
|
-
display: "flex",
|
|
91
|
-
flexWrap: "wrap",
|
|
92
|
-
alignItems: "center",
|
|
93
|
-
mb: "16px",
|
|
94
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_filter2.CustomChip, {
|
|
95
|
-
label: developerName,
|
|
96
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Face.default, {}),
|
|
97
|
-
onDelete: () => {
|
|
98
|
-
handleDeveloper(null);
|
|
99
|
-
}
|
|
100
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_filter2.CustomChip, {
|
|
101
|
-
label: categoryLocale,
|
|
102
|
-
onDelete: () => {
|
|
103
|
-
handleCategory(null);
|
|
104
|
-
}
|
|
105
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_filter2.CustomChip, {
|
|
106
|
-
label: priceLocale,
|
|
107
|
-
onDelete: () => {
|
|
108
|
-
handlePrice(null);
|
|
109
|
-
}
|
|
110
|
-
})]
|
|
111
113
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
|
|
112
114
|
FallbackComponent: _ErrorBoundary.ErrorFallback,
|
|
113
115
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -134,5 +136,11 @@ const StyledSearch = (0, _styledComponents.default)(_search.default).withConfig(
|
|
|
134
136
|
displayName: "base__StyledSearch",
|
|
135
137
|
componentId: "sc-wumzlv-1"
|
|
136
138
|
})(["background-color:", ";"], props => props.theme.palette.grey[50]);
|
|
139
|
+
|
|
140
|
+
const FilterContainer = _styledComponents.default.div.withConfig({
|
|
141
|
+
displayName: "base__FilterContainer",
|
|
142
|
+
componentId: "sc-wumzlv-2"
|
|
143
|
+
})(["position:sticky;top:0;z-index:999;background-color:white;"]);
|
|
144
|
+
|
|
137
145
|
var _default = ListBase;
|
|
138
146
|
exports.default = _default;
|
package/lib/components/aside.js
CHANGED
|
@@ -50,7 +50,7 @@ function Aside() {
|
|
|
50
50
|
const StyledAside = _styledComponents.default.aside.withConfig({
|
|
51
51
|
displayName: "aside__StyledAside",
|
|
52
52
|
componentId: "sc-1wkvsv6-0"
|
|
53
|
-
})(["width:220px;margin-right:", ";height:100%;overflow-y:auto;"], props => props.theme.spacing(2));
|
|
53
|
+
})(["width:220px;margin-right:", ";height:100%;position:sticky;top:0;overflow-y:auto;z-index:999;"], props => props.theme.spacing(2));
|
|
54
54
|
|
|
55
55
|
Aside.propTypes = {};
|
|
56
56
|
Aside.defaultProps = {};
|
|
@@ -43,6 +43,7 @@ function FilterChip(_ref) {
|
|
|
43
43
|
if (!label) return null;
|
|
44
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyleDiv, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
45
45
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
46
|
+
color: "primary",
|
|
46
47
|
"data-cy": "filter-tag",
|
|
47
48
|
icon: icon,
|
|
48
49
|
label: label,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/list",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Common ux components of blocklet",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
"react": ">=18.1.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@arcblock/ux": "^2.
|
|
42
|
-
"@emotion/react": "^11.
|
|
43
|
-
"@emotion/styled": "^11.
|
|
44
|
-
"@mui/icons-material": "^5.
|
|
45
|
-
"ahooks": "^2.10.
|
|
41
|
+
"@arcblock/ux": "^2.2.0",
|
|
42
|
+
"@emotion/react": "^11.10.0",
|
|
43
|
+
"@emotion/styled": "^11.10.0",
|
|
44
|
+
"@mui/icons-material": "^5.8.4",
|
|
45
|
+
"ahooks": "^2.10.14",
|
|
46
46
|
"axios": "^0.27.2",
|
|
47
47
|
"flat": "^5.0.2",
|
|
48
48
|
"lodash": "^4.17.21",
|
|
49
|
-
"prop-types": "^15.
|
|
49
|
+
"prop-types": "^15.8.1",
|
|
50
50
|
"react-error-boundary": "^3.1.4",
|
|
51
51
|
"react-infinite-scroll-hook": "^4.0.3",
|
|
52
52
|
"styled-components": "5.3.5",
|
|
@@ -54,15 +54,15 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@arcblock/eslint-config": "0.2.2",
|
|
57
|
-
"@babel/cli": "^7.
|
|
58
|
-
"@babel/core": "^7.
|
|
59
|
-
"@babel/preset-env": "^7.
|
|
60
|
-
"@babel/preset-react": "^7.
|
|
61
|
-
"@emotion/babel-plugin": "^11.
|
|
57
|
+
"@babel/cli": "^7.18.10",
|
|
58
|
+
"@babel/core": "^7.18.10",
|
|
59
|
+
"@babel/preset-env": "^7.18.10",
|
|
60
|
+
"@babel/preset-react": "^7.18.6",
|
|
61
|
+
"@emotion/babel-plugin": "^11.10.0",
|
|
62
62
|
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
63
|
-
"babel-plugin-styled-components": "^1.
|
|
64
|
-
"eslint": "^8.
|
|
65
|
-
"prettier": "^2.
|
|
63
|
+
"babel-plugin-styled-components": "^1.13.3",
|
|
64
|
+
"eslint": "^8.21.0",
|
|
65
|
+
"prettier": "^2.7.1"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "22d308f630ec17c18162f750edaf6d71012efaac"
|
|
68
68
|
}
|
package/src/base.js
CHANGED
|
@@ -37,46 +37,48 @@ function ListBase() {
|
|
|
37
37
|
<Aside />
|
|
38
38
|
</Hidden>
|
|
39
39
|
<StyledMin>
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
40
|
+
<FilterContainer>
|
|
41
|
+
<Box className="filter-bar" display="flex" alignItems="center">
|
|
42
|
+
<StyledSearch className="search-container" placeholder={t('common.searchStore')} />
|
|
43
|
+
<Box mt={0} ml="16px" className="filter-container">
|
|
44
|
+
<Hidden mdUp>
|
|
45
|
+
{/* 小屏幕下类别 */}
|
|
46
|
+
<FilterIcon />
|
|
47
|
+
</Hidden>
|
|
48
|
+
{/* 排序选择器 */}
|
|
49
|
+
<CustomSelect
|
|
50
|
+
value={filters.sortBy}
|
|
51
|
+
options={sortOptions}
|
|
52
|
+
title={sortLocale}
|
|
53
|
+
icon={<SortIcon />}
|
|
54
|
+
onChange={(v) => {
|
|
55
|
+
handleSort(v);
|
|
56
|
+
}}
|
|
57
|
+
/>
|
|
58
|
+
</Box>
|
|
59
|
+
</Box>
|
|
60
|
+
<Box display="flex" flexWrap="wrap" alignItems="center" mb="16px">
|
|
61
|
+
<CustomChip
|
|
62
|
+
label={developerName}
|
|
63
|
+
icon={<FaceIcon />}
|
|
64
|
+
onDelete={() => {
|
|
65
|
+
handleDeveloper(null);
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
<CustomChip
|
|
69
|
+
label={categoryLocale}
|
|
70
|
+
onDelete={() => {
|
|
71
|
+
handleCategory(null);
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
<CustomChip
|
|
75
|
+
label={priceLocale}
|
|
76
|
+
onDelete={() => {
|
|
77
|
+
handlePrice(null);
|
|
55
78
|
}}
|
|
56
79
|
/>
|
|
57
80
|
</Box>
|
|
58
|
-
</
|
|
59
|
-
<Box display="flex" flexWrap="wrap" alignItems="center" mb="16px">
|
|
60
|
-
<CustomChip
|
|
61
|
-
label={developerName}
|
|
62
|
-
icon={<FaceIcon />}
|
|
63
|
-
onDelete={() => {
|
|
64
|
-
handleDeveloper(null);
|
|
65
|
-
}}
|
|
66
|
-
/>
|
|
67
|
-
<CustomChip
|
|
68
|
-
label={categoryLocale}
|
|
69
|
-
onDelete={() => {
|
|
70
|
-
handleCategory(null);
|
|
71
|
-
}}
|
|
72
|
-
/>
|
|
73
|
-
<CustomChip
|
|
74
|
-
label={priceLocale}
|
|
75
|
-
onDelete={() => {
|
|
76
|
-
handlePrice(null);
|
|
77
|
-
}}
|
|
78
|
-
/>
|
|
79
|
-
</Box>
|
|
81
|
+
</FilterContainer>
|
|
80
82
|
<ErrorBoundary FallbackComponent={ErrorFallback}>
|
|
81
83
|
<div style={{ position: 'relative', flex: 1, overflow: 'auto' }}>
|
|
82
84
|
<BlockletList blocklets={blockletList} />
|
|
@@ -137,4 +139,11 @@ const StyledSearch = styled(Search)`
|
|
|
137
139
|
background-color: ${(props) => props.theme.palette.grey[50]};
|
|
138
140
|
`;
|
|
139
141
|
|
|
142
|
+
const FilterContainer = styled.div`
|
|
143
|
+
position: sticky;
|
|
144
|
+
top: 0;
|
|
145
|
+
z-index: 999;
|
|
146
|
+
background-color: white;
|
|
147
|
+
`;
|
|
148
|
+
|
|
140
149
|
export default ListBase;
|
package/src/components/aside.js
CHANGED
|
@@ -15,7 +15,7 @@ function FilterChip({ label, icon, onDelete, ...containerProps }) {
|
|
|
15
15
|
if (!label) return null;
|
|
16
16
|
return (
|
|
17
17
|
<StyleDiv {...containerProps}>
|
|
18
|
-
<Chip data-cy="filter-tag" icon={icon} label={label} onDelete={onDelete} />
|
|
18
|
+
<Chip color="primary" data-cy="filter-tag" icon={icon} label={label} onDelete={onDelete} />
|
|
19
19
|
</StyleDiv>
|
|
20
20
|
);
|
|
21
21
|
}
|