@blocklet/list 0.8.65 → 0.8.66

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 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)(_material.Box, {
66
- className: "filter-bar",
67
- display: "flex",
68
- alignItems: "center",
69
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSearch, {
70
- className: "search-container",
71
- placeholder: t('common.searchStore')
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
- mt: 0,
74
- ml: "16px",
75
- className: "filter-container",
76
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Hidden, {
77
- mdUp: true,
78
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_filter2.FilterIcon, {})
79
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_customSelect.default, {
80
- value: filters.sortBy,
81
- options: sortOptions,
82
- title: sortLocale,
83
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Sort.default, {}),
84
- onChange: v => {
85
- handleSort(v);
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;
@@ -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.8.65",
3
+ "version": "0.8.66",
4
4
  "description": "Common ux components of blocklet",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -64,5 +64,5 @@
64
64
  "eslint": "^8.16.0",
65
65
  "prettier": "^2.6.2"
66
66
  },
67
- "gitHead": "3ddb0217a07753400bdcfefd10c76f76e69a3b05"
67
+ "gitHead": "bdffbd6407f480fb2eff20a1b4e528dde9874952"
68
68
  }
package/src/base.js CHANGED
@@ -37,46 +37,48 @@ function ListBase() {
37
37
  <Aside />
38
38
  </Hidden>
39
39
  <StyledMin>
40
- <Box className="filter-bar" display="flex" alignItems="center">
41
- <StyledSearch className="search-container" placeholder={t('common.searchStore')} />
42
- <Box mt={0} ml="16px" className="filter-container">
43
- <Hidden mdUp>
44
- {/* 小屏幕下类别 */}
45
- <FilterIcon />
46
- </Hidden>
47
- {/* 排序选择器 */}
48
- <CustomSelect
49
- value={filters.sortBy}
50
- options={sortOptions}
51
- title={sortLocale}
52
- icon={<SortIcon />}
53
- onChange={(v) => {
54
- handleSort(v);
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
- </Box>
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;
@@ -30,7 +30,10 @@ const StyledAside = styled.aside`
30
30
  width: 220px;
31
31
  margin-right: ${(props) => props.theme.spacing(2)};
32
32
  height: 100%;
33
+ position: sticky;
34
+ top: 0;
33
35
  overflow-y: auto;
36
+ z-index: 999;
34
37
  `;
35
38
 
36
39
  Aside.propTypes = {};
@@ -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
  }