@blocklet/list 0.8.57 → 0.8.60
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 +10 -3
- package/lib/components/aside.js +1 -1
- package/lib/components/list/index.js +4 -3
- package/package.json +3 -3
- package/src/base.js +6 -3
- package/src/components/aside.js +1 -0
- package/src/components/list/index.js +3 -4
package/lib/base.js
CHANGED
|
@@ -110,8 +110,15 @@ function ListBase() {
|
|
|
110
110
|
})]
|
|
111
111
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
|
|
112
112
|
FallbackComponent: _ErrorBoundary.ErrorFallback,
|
|
113
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
114
|
-
|
|
113
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
114
|
+
style: {
|
|
115
|
+
position: 'relative',
|
|
116
|
+
flex: 1,
|
|
117
|
+
overflow: 'auto'
|
|
118
|
+
},
|
|
119
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_list.default, {
|
|
120
|
+
blocklets: finalBlockletList
|
|
121
|
+
})
|
|
115
122
|
})
|
|
116
123
|
})]
|
|
117
124
|
})]
|
|
@@ -121,7 +128,7 @@ function ListBase() {
|
|
|
121
128
|
const StyledMin = _styledComponents.default.main.withConfig({
|
|
122
129
|
displayName: "base__StyledMin",
|
|
123
130
|
componentId: "sc-wumzlv-0"
|
|
124
|
-
})(["flex:1;width:100%;
|
|
131
|
+
})(["display:flex;flex-direction:column;flex:1;width:100%;height:100%;.filter-bar{justify-content:space-between;margin-bottom:", ";}.sort-button{white-space:nowrap;}.search-container{flex:2;margin-left:0px;}.filter-container{flex:1;display:flex;justify-content:flex-end;}@media (max-width:", "px){.search-container{width:100%;margin-bottom:", ";}.filter-container{margin-left:0;display:flex;justify-content:flex-start;}.filter-bar{display:flex;flex-direction:column;align-items:flex-start;}}@media (max-width:", "px){.sort-button{font-size:12px;}}"], props => props.theme.spacing(2), props => props.theme.breakpoints.values.md, props => props.theme.spacing(2), props => props.theme.breakpoints.values.md);
|
|
125
132
|
|
|
126
133
|
const StyledSearch = (0, _styledComponents.default)(_search.default).withConfig({
|
|
127
134
|
displayName: "base__StyledSearch",
|
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%;"], props => props.theme.spacing(2));
|
|
53
|
+
})(["width:220px;margin-right:", ";height:100%;overflow-y:auto;"], props => props.theme.spacing(2));
|
|
54
54
|
|
|
55
55
|
Aside.propTypes = {};
|
|
56
56
|
Aside.defaultProps = {};
|
|
@@ -66,8 +66,7 @@ function BlockletList(_ref) {
|
|
|
66
66
|
const [sentryRef] = (0, _reactInfiniteScrollHook.default)({
|
|
67
67
|
loading: loadings.fetchBlockletsLoading,
|
|
68
68
|
hasNextPage,
|
|
69
|
-
onLoadMore: loadMore
|
|
70
|
-
rootMargin: '0px 0px 400px 0px'
|
|
69
|
+
onLoadMore: loadMore
|
|
71
70
|
});
|
|
72
71
|
|
|
73
72
|
if (errors.fetchBlockletsError) {
|
|
@@ -78,6 +77,7 @@ function BlockletList(_ref) {
|
|
|
78
77
|
|
|
79
78
|
if (loadings.fetchBlockletsLoading) {
|
|
80
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
80
|
+
height: 60,
|
|
81
81
|
display: "flex",
|
|
82
82
|
alignItems: "center",
|
|
83
83
|
justifyContent: "center",
|
|
@@ -150,6 +150,7 @@ function BlockletList(_ref) {
|
|
|
150
150
|
xs: 12,
|
|
151
151
|
ref: sentryRef,
|
|
152
152
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
153
|
+
height: 60,
|
|
153
154
|
display: "flex",
|
|
154
155
|
justifyContent: "center",
|
|
155
156
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {})
|
|
@@ -165,7 +166,7 @@ BlockletList.defaultProps = {};
|
|
|
165
166
|
const StyledGrid = (0, _styledComponents.default)(_Grid.default).withConfig({
|
|
166
167
|
displayName: "list__StyledGrid",
|
|
167
168
|
componentId: "sc-1guvpon-0"
|
|
168
|
-
})(["&.MuiGrid-root{width:
|
|
169
|
+
})(["&.MuiGrid-root{width:100%;margin:0 -16px;}"]);
|
|
169
170
|
const StyledGridItem = /*#__PURE__*/(0, _react.memo)((0, _styledComponents.default)(_Grid.default).withConfig({
|
|
170
171
|
displayName: "list__StyledGridItem",
|
|
171
172
|
componentId: "sc-1guvpon-1"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/list",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.60",
|
|
4
4
|
"description": "Common ux components of blocklet",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react": ">=18.1.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@arcblock/ux": "^2.1.
|
|
41
|
+
"@arcblock/ux": "^2.1.55",
|
|
42
42
|
"@emotion/react": "^11.9.0",
|
|
43
43
|
"@emotion/styled": "^11.8.1",
|
|
44
44
|
"@mui/icons-material": "^5.6.2",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"eslint": "^8.16.0",
|
|
65
65
|
"prettier": "^2.6.2"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "fa4cbebefae7f50fecacc507bbfa60072957b3dd"
|
|
68
68
|
}
|
package/src/base.js
CHANGED
|
@@ -26,7 +26,6 @@ function ListBase() {
|
|
|
26
26
|
getCategoryLocale,
|
|
27
27
|
priceOptions,
|
|
28
28
|
} = useFilterContext();
|
|
29
|
-
|
|
30
29
|
const sortOptions = getSortOptions(t);
|
|
31
30
|
const sortLocale = sortOptions.find((f) => f.value === filters.sortBy)?.name || t('sort.sort');
|
|
32
31
|
const categoryLocale = getCategoryLocale(filters.category);
|
|
@@ -79,7 +78,9 @@ function ListBase() {
|
|
|
79
78
|
/>
|
|
80
79
|
</Box>
|
|
81
80
|
<ErrorBoundary FallbackComponent={ErrorFallback}>
|
|
82
|
-
<
|
|
81
|
+
<div style={{ position: 'relative', flex: 1, overflow: 'auto' }}>
|
|
82
|
+
<BlockletList blocklets={finalBlockletList} />
|
|
83
|
+
</div>
|
|
83
84
|
</ErrorBoundary>
|
|
84
85
|
</StyledMin>
|
|
85
86
|
</Box>
|
|
@@ -87,9 +88,11 @@ function ListBase() {
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
const StyledMin = styled.main`
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
90
93
|
flex: 1;
|
|
91
94
|
width: 100%;
|
|
92
|
-
|
|
95
|
+
height: 100%;
|
|
93
96
|
.filter-bar {
|
|
94
97
|
justify-content: space-between;
|
|
95
98
|
margin-bottom: ${(props) => props.theme.spacing(2)};
|
package/src/components/aside.js
CHANGED
|
@@ -32,7 +32,6 @@ export default function BlockletList({ blocklets, ...rest }) {
|
|
|
32
32
|
loading: loadings.fetchBlockletsLoading,
|
|
33
33
|
hasNextPage,
|
|
34
34
|
onLoadMore: loadMore,
|
|
35
|
-
rootMargin: '0px 0px 400px 0px',
|
|
36
35
|
});
|
|
37
36
|
|
|
38
37
|
if (errors.fetchBlockletsError) {
|
|
@@ -44,7 +43,7 @@ export default function BlockletList({ blocklets, ...rest }) {
|
|
|
44
43
|
}
|
|
45
44
|
if (loadings.fetchBlockletsLoading) {
|
|
46
45
|
return (
|
|
47
|
-
<Box display="flex" alignItems="center" justifyContent="center">
|
|
46
|
+
<Box height={60} display="flex" alignItems="center" justifyContent="center">
|
|
48
47
|
<CircularProgress />
|
|
49
48
|
</Box>
|
|
50
49
|
);
|
|
@@ -107,7 +106,7 @@ export default function BlockletList({ blocklets, ...rest }) {
|
|
|
107
106
|
))}
|
|
108
107
|
{hasNextPage && (
|
|
109
108
|
<StyledGridItem item md={12} sm={12} xs={12} ref={sentryRef}>
|
|
110
|
-
<Box display="flex" justifyContent="center">
|
|
109
|
+
<Box height={60} display="flex" justifyContent="center">
|
|
111
110
|
<CircularProgress />
|
|
112
111
|
</Box>
|
|
113
112
|
</StyledGridItem>
|
|
@@ -124,7 +123,7 @@ BlockletList.defaultProps = {};
|
|
|
124
123
|
|
|
125
124
|
const StyledGrid = styled(Grid)`
|
|
126
125
|
&.MuiGrid-root {
|
|
127
|
-
width:
|
|
126
|
+
width: 100%;
|
|
128
127
|
margin: 0 -16px;
|
|
129
128
|
}
|
|
130
129
|
`;
|