@blocklet/list 0.12.76 → 0.12.77
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/assets/locale.js +8 -2
- package/lib/components/autocomplete/index.js +19 -4
- package/lib/index.es.js +190 -162
- package/package.json +5 -5
package/lib/assets/locale.js
CHANGED
|
@@ -11,7 +11,10 @@ const en = {
|
|
|
11
11
|
searchStore: 'Search the store',
|
|
12
12
|
price: 'Price',
|
|
13
13
|
category: 'Category',
|
|
14
|
-
resourceType: 'Resource Type'
|
|
14
|
+
resourceType: 'Resource Type',
|
|
15
|
+
clear: 'Clear',
|
|
16
|
+
cancel: 'Cancel',
|
|
17
|
+
search: 'Search'
|
|
15
18
|
},
|
|
16
19
|
sort: {
|
|
17
20
|
sort: 'Sort',
|
|
@@ -47,7 +50,10 @@ const zh = {
|
|
|
47
50
|
searchStore: '搜索商店内应用',
|
|
48
51
|
price: '价格',
|
|
49
52
|
category: '类别',
|
|
50
|
-
resourceType: '资源类型'
|
|
53
|
+
resourceType: '资源类型',
|
|
54
|
+
clear: '清除',
|
|
55
|
+
cancel: '取消',
|
|
56
|
+
search: '搜索'
|
|
51
57
|
},
|
|
52
58
|
sort: {
|
|
53
59
|
sort: '排序',
|
|
@@ -9,13 +9,16 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _client = require("react-dom/client");
|
|
10
10
|
var _autocompleteJs = require("@algolia/autocomplete-js");
|
|
11
11
|
var _reactHotkeysHook = require("react-hotkeys-hook");
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
12
13
|
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
13
14
|
var _constant = _interopRequireDefault(require("../../libs/constant"));
|
|
14
15
|
var _utils = require("../../libs/utils");
|
|
15
16
|
var _filter = require("../../contexts/filter");
|
|
16
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
var _templateObject;
|
|
17
19
|
const _excluded = ["query", "state"];
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
22
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
23
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
24
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -127,7 +130,15 @@ function Autocomplete(_ref) {
|
|
|
127
130
|
label: 'bl-autocomplete-label',
|
|
128
131
|
form: 'bl-autocomplete-form',
|
|
129
132
|
input: 'bl-autocomplete-input',
|
|
130
|
-
clearButton: 'bl-autocomplete-clear'
|
|
133
|
+
clearButton: 'bl-autocomplete-clear',
|
|
134
|
+
detachedCancelButton: 'bl-autocomplete-detached-cancel',
|
|
135
|
+
detachedContainer: 'bl-autocomplete-detached-container'
|
|
136
|
+
},
|
|
137
|
+
translations: {
|
|
138
|
+
clearButtonTitle: t('common.clear'),
|
|
139
|
+
detachedCancelButtonText: t('common.cancel'),
|
|
140
|
+
submitButtonTitle: t('common.search'),
|
|
141
|
+
detachedSearchButtonTitle: t('common.search')
|
|
131
142
|
},
|
|
132
143
|
placeholder: t('common.searchStore'),
|
|
133
144
|
initialState: {
|
|
@@ -216,9 +227,13 @@ function Autocomplete(_ref) {
|
|
|
216
227
|
};
|
|
217
228
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
218
229
|
}, [filters, blockletRender]);
|
|
219
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
220
|
-
|
|
221
|
-
|
|
230
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
231
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Global, {
|
|
232
|
+
styles: (0, _react2.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .bl-autocomplete-detached-container {\n .bl-autocomplete-detached-cancel {\n white-space: nowrap;\n }\n }\n "])))
|
|
233
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
234
|
+
className: "bl-search-container",
|
|
235
|
+
ref: containerRef
|
|
236
|
+
})]
|
|
222
237
|
});
|
|
223
238
|
}
|
|
224
239
|
Autocomplete.propTypes = {
|
package/lib/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as f, Fragment as pe } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme as de } from "@mui/material/styles";
|
|
3
|
+
import { Global as ue, css as me } from "@emotion/react";
|
|
4
4
|
import { styled as C } from "@arcblock/ux/lib/Theme";
|
|
5
5
|
import $e from "@mui/icons-material/Sort";
|
|
6
|
-
import { Button as Re, CircularProgress as W, MenuList as ze, useMediaQuery as Ie, SvgIcon as _e, Popper as De, Grow as Ne, Paper as Ae, ClickAwayListener as Le, MenuItem as Me, Chip as Oe, Grid as
|
|
6
|
+
import { Button as Re, CircularProgress as W, MenuList as ze, useMediaQuery as Ie, SvgIcon as _e, Popper as De, Grow as Ne, Paper as Ae, ClickAwayListener as Le, MenuItem as Me, Chip as Oe, Grid as he, Box as D, OutlinedInput as Fe, InputAdornment as le, Hidden as ae } from "@mui/material";
|
|
7
7
|
import Ee from "@mui/icons-material/Face";
|
|
8
8
|
import { ErrorBoundary as qe } from "react-error-boundary";
|
|
9
|
-
import { ErrorFallback as
|
|
9
|
+
import { ErrorFallback as fe } from "@arcblock/ux/lib/ErrorBoundary";
|
|
10
10
|
import { createContext as je, useMemo as L, useState as F, useCallback as H, useEffect as E, useContext as Ge, forwardRef as Ue, useRef as M, memo as Ke, createElement as We, Fragment as He } from "react";
|
|
11
11
|
import o from "prop-types";
|
|
12
12
|
import { useReactive as Ve, useInfiniteScroll as Qe, useRequest as Je, useSize as Xe, useCreation as Ye, useDebounceFn as Ze } from "ahooks";
|
|
@@ -23,12 +23,12 @@ import it from "@arcblock/ux/lib/Dialog";
|
|
|
23
23
|
import st from "@mui/material/Button";
|
|
24
24
|
import ct from "@arcblock/ux/lib/Empty";
|
|
25
25
|
import pt from "react-infinite-scroll-hook";
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
26
|
+
import dt from "@mui/material/Box";
|
|
27
|
+
import ge from "@mui/material/Typography";
|
|
28
|
+
import ut from "@mui/icons-material/Search";
|
|
29
29
|
import mt from "@mui/icons-material/Close";
|
|
30
|
-
import { createRoot as
|
|
31
|
-
import { autocomplete as
|
|
30
|
+
import { createRoot as ht } from "react-dom/client";
|
|
31
|
+
import { autocomplete as ft } from "@algolia/autocomplete-js";
|
|
32
32
|
import { useHotkeys as gt } from "react-hotkeys-hook";
|
|
33
33
|
import yt from "url-join";
|
|
34
34
|
import "@algolia/autocomplete-theme-classic/dist/theme.css";
|
|
@@ -55,7 +55,7 @@ const bt = (e) => [
|
|
|
55
55
|
], kt = (e = [], n = "en") => e.map((r) => ({ name: r.locales[n] || `Category.${n}`, value: r._id })), wt = (e, n) => (
|
|
56
56
|
// eslint-disable-next-line no-prototype-builtins
|
|
57
57
|
e.replace(/{(\w*)}/g, (r, l) => n.hasOwnProperty(l) ? n[l] : "")
|
|
58
|
-
),
|
|
58
|
+
), St = () => window.innerWidth <= 600, vt = (e, n) => {
|
|
59
59
|
const r = (e + n) / n;
|
|
60
60
|
return r > 1 ? r.toFixed() : 1;
|
|
61
61
|
}, Ct = (e) => ot(e).rgb().object();
|
|
@@ -72,7 +72,10 @@ const Tt = Pt((e) => Promise.resolve(e), 300), Bt = {
|
|
|
72
72
|
searchStore: "Search the store",
|
|
73
73
|
price: "Price",
|
|
74
74
|
category: "Category",
|
|
75
|
-
resourceType: "Resource Type"
|
|
75
|
+
resourceType: "Resource Type",
|
|
76
|
+
clear: "Clear",
|
|
77
|
+
cancel: "Cancel",
|
|
78
|
+
search: "Search"
|
|
76
79
|
},
|
|
77
80
|
sort: {
|
|
78
81
|
sort: "Sort",
|
|
@@ -107,7 +110,10 @@ const Tt = Pt((e) => Promise.resolve(e), 300), Bt = {
|
|
|
107
110
|
searchStore: "搜索商店内应用",
|
|
108
111
|
price: "价格",
|
|
109
112
|
category: "类别",
|
|
110
|
-
resourceType: "资源类型"
|
|
113
|
+
resourceType: "资源类型",
|
|
114
|
+
clear: "清除",
|
|
115
|
+
cancel: "取消",
|
|
116
|
+
search: "搜索"
|
|
111
117
|
},
|
|
112
118
|
sort: {
|
|
113
119
|
sort: "排序",
|
|
@@ -140,7 +146,7 @@ const Tt = Pt((e) => Promise.resolve(e), 300), Bt = {
|
|
|
140
146
|
}, K = {
|
|
141
147
|
en: ie(Bt),
|
|
142
148
|
zh: ie($t)
|
|
143
|
-
},
|
|
149
|
+
}, ye = {
|
|
144
150
|
filters: o.shape({
|
|
145
151
|
keyword: o.string,
|
|
146
152
|
sortBy: o.string,
|
|
@@ -160,7 +166,7 @@ const Tt = Pt((e) => Promise.resolve(e), 300), Bt = {
|
|
|
160
166
|
baseSearch: o.bool,
|
|
161
167
|
// sometimes blocklet list can be rendered only before the category is fetched
|
|
162
168
|
fetchCategoryDelay: o.number
|
|
163
|
-
},
|
|
169
|
+
}, be = {
|
|
164
170
|
locale: "zh",
|
|
165
171
|
filters: {},
|
|
166
172
|
onFilterChange: () => {
|
|
@@ -183,7 +189,7 @@ const Tt = Pt((e) => Promise.resolve(e), 300), Bt = {
|
|
|
183
189
|
blockletsPath: "/api/v2/blocklets.json",
|
|
184
190
|
categoriesPath: "/api/blocklets/categories",
|
|
185
191
|
cacheSize: 100
|
|
186
|
-
},
|
|
192
|
+
}, xe = je({}), { Provider: Rt, Consumer: Cr } = xe;
|
|
187
193
|
function V({
|
|
188
194
|
filters: e,
|
|
189
195
|
children: n,
|
|
@@ -193,40 +199,40 @@ function V({
|
|
|
193
199
|
onFilterChange: c,
|
|
194
200
|
onSearchSelect: k,
|
|
195
201
|
extraFilter: g,
|
|
196
|
-
wrapChildren:
|
|
202
|
+
wrapChildren: d,
|
|
197
203
|
baseSearch: y,
|
|
198
|
-
serverVersion:
|
|
204
|
+
serverVersion: p,
|
|
199
205
|
storeVersion: P,
|
|
200
206
|
fetchCategoryDelay: B
|
|
201
207
|
}) {
|
|
202
208
|
const b = {};
|
|
203
|
-
|
|
209
|
+
p && (b["x-blocklet-server-version"] = p), P && (b["x-blocklet-store-version"] = P);
|
|
204
210
|
const $ = L(() => tt.create({
|
|
205
211
|
baseURL: r,
|
|
206
212
|
headers: b
|
|
207
|
-
}), [r]),
|
|
213
|
+
}), [r]), m = L(() => ({ sortBy: "popularity", sortDirection: "desc", ...e }), [e]), u = m.category, s = Ve({
|
|
208
214
|
currentPage: R.currentPage,
|
|
209
|
-
pageSize:
|
|
215
|
+
pageSize: St() ? R.mobilePageSize : R.pageSize,
|
|
210
216
|
defaultCurrentPage: R.defaultCurrentPage
|
|
211
|
-
}), [
|
|
217
|
+
}), [v, x] = F(null), {
|
|
212
218
|
data: T = { list: [], total: 0 },
|
|
213
219
|
loading: w,
|
|
214
220
|
loadMore: _,
|
|
215
|
-
loadingMore:
|
|
221
|
+
loadingMore: we
|
|
216
222
|
} = Qe(
|
|
217
223
|
async (a) => {
|
|
218
224
|
var z;
|
|
219
|
-
const
|
|
220
|
-
...
|
|
221
|
-
sortBy: R[
|
|
222
|
-
page:
|
|
225
|
+
const h = {
|
|
226
|
+
...m,
|
|
227
|
+
sortBy: R[m.sortBy],
|
|
228
|
+
page: vt(((z = a == null ? void 0 : a.list) == null ? void 0 : z.length) || 0, s.pageSize),
|
|
223
229
|
pageSize: s.pageSize
|
|
224
230
|
};
|
|
225
231
|
x(null);
|
|
226
|
-
const { data:
|
|
227
|
-
params:
|
|
232
|
+
const { data: S = {} } = await $.get(R.blockletsPath, {
|
|
233
|
+
params: h
|
|
228
234
|
});
|
|
229
|
-
return { list: (
|
|
235
|
+
return { list: (S == null ? void 0 : S.dataList) || [], total: (S == null ? void 0 : S.total) || 0 };
|
|
230
236
|
},
|
|
231
237
|
{
|
|
232
238
|
isNoMore: (a) => a ? a.list.length >= a.total : !1,
|
|
@@ -237,73 +243,73 @@ function V({
|
|
|
237
243
|
}
|
|
238
244
|
), {
|
|
239
245
|
data: G = [],
|
|
240
|
-
error:
|
|
241
|
-
loading:
|
|
242
|
-
run:
|
|
246
|
+
error: Se,
|
|
247
|
+
loading: ve,
|
|
248
|
+
run: Ce
|
|
243
249
|
} = Je(
|
|
244
250
|
async () => {
|
|
245
251
|
const { data: a } = await $.get(R.categoriesPath);
|
|
246
252
|
return Array.isArray(a) ? a : [];
|
|
247
253
|
},
|
|
248
254
|
{ manual: !0 }
|
|
249
|
-
), U = L(() => et(G || [], [(
|
|
250
|
-
(a,
|
|
251
|
-
const
|
|
252
|
-
return wt(
|
|
255
|
+
), U = L(() => et(G || [], [(h) => h.name], ["asc"]), [G]), re = H(
|
|
256
|
+
(a, h) => {
|
|
257
|
+
const S = K[l] ? K[l][a] : K.en[a];
|
|
258
|
+
return wt(S, h);
|
|
253
259
|
},
|
|
254
260
|
[l]
|
|
255
261
|
), oe = L(() => {
|
|
256
262
|
let a = T.list || [];
|
|
257
263
|
return a = g(a), a;
|
|
258
|
-
}, [T, g]),
|
|
259
|
-
errors: { fetchBlockletsError:
|
|
260
|
-
loadings: { fetchBlockletsLoading: w, fetchCategoriesLoading:
|
|
264
|
+
}, [T, g]), Pe = L(() => kt(U, l), [U, l]), Te = xt(re), Be = {
|
|
265
|
+
errors: { fetchBlockletsError: v, fetchCategoriesError: Se },
|
|
266
|
+
loadings: { fetchBlockletsLoading: w, fetchCategoriesLoading: ve, loadingMore: we },
|
|
261
267
|
endpoint: r,
|
|
262
268
|
blockletList: oe,
|
|
263
|
-
wrapChildren:
|
|
269
|
+
wrapChildren: d,
|
|
264
270
|
t: re,
|
|
265
|
-
filters:
|
|
271
|
+
filters: m,
|
|
266
272
|
selectedCategory: u,
|
|
267
273
|
categoryList: U,
|
|
268
274
|
blockletRender: i,
|
|
269
275
|
locale: l,
|
|
270
|
-
categoryOptions:
|
|
271
|
-
priceOptions:
|
|
276
|
+
categoryOptions: Pe,
|
|
277
|
+
priceOptions: Te,
|
|
272
278
|
storeApi: $,
|
|
273
279
|
baseSearch: y,
|
|
274
280
|
hasNextPage: T.list.length < T.total,
|
|
275
281
|
handleSort: (a) => {
|
|
276
|
-
const
|
|
277
|
-
...
|
|
282
|
+
const h = {
|
|
283
|
+
...m,
|
|
278
284
|
sortBy: a,
|
|
279
285
|
sortDirection: a === "nameAsc" ? "asc" : "desc"
|
|
280
286
|
};
|
|
281
|
-
c(
|
|
287
|
+
c(h);
|
|
282
288
|
},
|
|
283
289
|
handleKeyword: (a) => {
|
|
284
|
-
const
|
|
285
|
-
c(
|
|
290
|
+
const h = { ...m, keyword: a || void 0 };
|
|
291
|
+
c(h);
|
|
286
292
|
},
|
|
287
293
|
handlePrice: (a) => {
|
|
288
|
-
const
|
|
289
|
-
...
|
|
290
|
-
price: a ===
|
|
294
|
+
const h = {
|
|
295
|
+
...m,
|
|
296
|
+
price: a === m.price ? void 0 : a
|
|
291
297
|
};
|
|
292
|
-
c(
|
|
298
|
+
c(h);
|
|
293
299
|
},
|
|
294
300
|
handleCategory: (a) => {
|
|
295
|
-
let
|
|
296
|
-
(a === "all" || a ===
|
|
297
|
-
const
|
|
298
|
-
c(
|
|
301
|
+
let h = a;
|
|
302
|
+
(a === "all" || a === m.category) && (h = void 0);
|
|
303
|
+
const S = { ...m, category: h };
|
|
304
|
+
c(S);
|
|
299
305
|
},
|
|
300
306
|
handleDeveloper: (a) => {
|
|
301
|
-
const
|
|
302
|
-
c(
|
|
307
|
+
const h = { ...m, owner: a || void 0 };
|
|
308
|
+
c(h);
|
|
303
309
|
},
|
|
304
310
|
handlePage: (a) => {
|
|
305
|
-
const
|
|
306
|
-
c(
|
|
311
|
+
const h = { ...m, currentPage: a };
|
|
312
|
+
c(h);
|
|
307
313
|
},
|
|
308
314
|
loadMore: () => {
|
|
309
315
|
_();
|
|
@@ -311,32 +317,32 @@ function V({
|
|
|
311
317
|
getCategoryLocale: (a) => {
|
|
312
318
|
if (!a)
|
|
313
319
|
return null;
|
|
314
|
-
let
|
|
315
|
-
const
|
|
316
|
-
return
|
|
320
|
+
let h = null;
|
|
321
|
+
const S = G.find((z) => z._id === a);
|
|
322
|
+
return S && (h = S.locales[l]), h;
|
|
317
323
|
},
|
|
318
324
|
get developerName() {
|
|
319
|
-
var
|
|
320
|
-
return ((
|
|
325
|
+
var h, S;
|
|
326
|
+
return ((S = (h = oe.find((z) => {
|
|
321
327
|
var ne;
|
|
322
|
-
return ((ne = z == null ? void 0 : z.owner) == null ? void 0 : ne.did) ===
|
|
323
|
-
})) == null ? void 0 :
|
|
328
|
+
return ((ne = z == null ? void 0 : z.owner) == null ? void 0 : ne.did) === m.owner;
|
|
329
|
+
})) == null ? void 0 : h.owner) == null ? void 0 : S.name) || "";
|
|
324
330
|
},
|
|
325
331
|
handleSearchSelect: k
|
|
326
332
|
};
|
|
327
333
|
return E(() => {
|
|
328
334
|
setTimeout(() => {
|
|
329
|
-
|
|
335
|
+
Ce();
|
|
330
336
|
}, B || 0);
|
|
331
|
-
}, [r]), /* @__PURE__ */ t(Rt, { value:
|
|
337
|
+
}, [r]), /* @__PURE__ */ t(Rt, { value: Be, children: n });
|
|
332
338
|
}
|
|
333
339
|
V.propTypes = {
|
|
334
|
-
...
|
|
340
|
+
...ye,
|
|
335
341
|
children: o.any.isRequired
|
|
336
342
|
};
|
|
337
|
-
V.defaultProps =
|
|
343
|
+
V.defaultProps = be;
|
|
338
344
|
function I() {
|
|
339
|
-
const e = Ge(
|
|
345
|
+
const e = Ge(xe);
|
|
340
346
|
return e || {};
|
|
341
347
|
}
|
|
342
348
|
const zt = C(Re)`
|
|
@@ -365,26 +371,26 @@ Q.defaultProps = {
|
|
|
365
371
|
disabled: !1
|
|
366
372
|
};
|
|
367
373
|
function J({ title: e, value: n, icon: r, prepend: l, options: i, onChange: c, itemRender: k, ...g }) {
|
|
368
|
-
const
|
|
374
|
+
const d = M(null), y = de(), [p, P] = F(!1), [B, b] = F(n !== null ? n : ""), $ = Ie(y.breakpoints.down("sm"));
|
|
369
375
|
E(() => {
|
|
370
376
|
b(n !== null ? n : "");
|
|
371
377
|
}, [n]);
|
|
372
|
-
const
|
|
378
|
+
const m = H(() => {
|
|
373
379
|
P(!1);
|
|
374
380
|
}, []), u = H(() => {
|
|
375
381
|
P(!0);
|
|
376
382
|
}, []);
|
|
377
383
|
function s(x) {
|
|
378
|
-
b(x.value), c(x.value), $ &&
|
|
384
|
+
b(x.value), c(x.value), $ && m();
|
|
379
385
|
}
|
|
380
|
-
function
|
|
386
|
+
function v(x) {
|
|
381
387
|
return x === B;
|
|
382
388
|
}
|
|
383
|
-
return /* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ f(pe, { children: [
|
|
390
|
+
/* @__PURE__ */ f(
|
|
385
391
|
It,
|
|
386
392
|
{
|
|
387
|
-
ref:
|
|
393
|
+
ref: d,
|
|
388
394
|
onClick: u,
|
|
389
395
|
variant: "outlined",
|
|
390
396
|
size: "small",
|
|
@@ -397,12 +403,12 @@ function J({ title: e, value: n, icon: r, prepend: l, options: i, onChange: c, i
|
|
|
397
403
|
]
|
|
398
404
|
}
|
|
399
405
|
),
|
|
400
|
-
/* @__PURE__ */ t(De, { open:
|
|
406
|
+
/* @__PURE__ */ t(De, { open: p, anchorEl: d.current, transition: !0, style: { zIndex: "9999" }, children: ({ TransitionProps: x, placement: T }) => /* @__PURE__ */ t(
|
|
401
407
|
Ne,
|
|
402
408
|
{
|
|
403
409
|
...x,
|
|
404
410
|
style: { transformOrigin: T === "bottom" ? "center top" : "center bottom" },
|
|
405
|
-
children: /* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(Le, { onClickAway:
|
|
411
|
+
children: /* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(Le, { onClickAway: m, children: /* @__PURE__ */ f(_t, { autoFocusItem: p, onMouseEnter: u, onMouseLeave: m, children: [
|
|
406
412
|
l,
|
|
407
413
|
i.map((w) => k ? k(w) : /* @__PURE__ */ t(
|
|
408
414
|
Me,
|
|
@@ -410,7 +416,7 @@ function J({ title: e, value: n, icon: r, prepend: l, options: i, onChange: c, i
|
|
|
410
416
|
onClick: () => s(w),
|
|
411
417
|
className: [
|
|
412
418
|
"my-select__option",
|
|
413
|
-
|
|
419
|
+
v(w.value) ? "my-select__option--active" : ""
|
|
414
420
|
].join(" "),
|
|
415
421
|
children: w.name
|
|
416
422
|
},
|
|
@@ -488,7 +494,7 @@ const It = C(Q)`
|
|
|
488
494
|
}
|
|
489
495
|
`;
|
|
490
496
|
function A({ options: e, onChange: n, title: r, value: l }) {
|
|
491
|
-
return /* @__PURE__ */
|
|
497
|
+
return /* @__PURE__ */ f(Dt, { children: [
|
|
492
498
|
/* @__PURE__ */ t("div", { className: "title", children: r }),
|
|
493
499
|
/* @__PURE__ */ t("div", { className: "list", children: e.map((i) => /* @__PURE__ */ t(
|
|
494
500
|
"div",
|
|
@@ -541,20 +547,20 @@ A.defaultProps = {
|
|
|
541
547
|
value: null
|
|
542
548
|
};
|
|
543
549
|
function X() {
|
|
544
|
-
const { selectedCategory: e, handleCategory: n, t: r, handlePrice: l, filters: i, categoryOptions: c, priceOptions: k } = I(), [g,
|
|
545
|
-
|
|
550
|
+
const { selectedCategory: e, handleCategory: n, t: r, handlePrice: l, filters: i, categoryOptions: c, priceOptions: k } = I(), [g, d] = F(!1), y = (p, P) => {
|
|
551
|
+
p === "category" && n(P), p === "price" && l(P), d(!1);
|
|
546
552
|
};
|
|
547
|
-
return /* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */ t(st, { variant: "outlined", className: "filter-button", onClick: () =>
|
|
549
|
-
/* @__PURE__ */
|
|
553
|
+
return /* @__PURE__ */ f(Nt, { children: [
|
|
554
|
+
/* @__PURE__ */ t(st, { variant: "outlined", className: "filter-button", onClick: () => d(!0), children: /* @__PURE__ */ t(at, { className: "filter-icon", fontSize: "small" }) }),
|
|
555
|
+
/* @__PURE__ */ f(it, { fullWidth: !0, title: "", open: g, onClose: () => d(!1), children: [
|
|
550
556
|
/* @__PURE__ */ t(
|
|
551
557
|
A,
|
|
552
558
|
{
|
|
553
559
|
title: r("common.price"),
|
|
554
560
|
options: k,
|
|
555
561
|
value: i.price,
|
|
556
|
-
onChange: (
|
|
557
|
-
y("price",
|
|
562
|
+
onChange: (p) => {
|
|
563
|
+
y("price", p);
|
|
558
564
|
}
|
|
559
565
|
}
|
|
560
566
|
),
|
|
@@ -564,8 +570,8 @@ function X() {
|
|
|
564
570
|
title: r("common.category"),
|
|
565
571
|
options: c,
|
|
566
572
|
value: e,
|
|
567
|
-
onChange: (
|
|
568
|
-
y("category",
|
|
573
|
+
onChange: (p) => {
|
|
574
|
+
y("category", p);
|
|
569
575
|
}
|
|
570
576
|
}
|
|
571
577
|
) })
|
|
@@ -610,11 +616,11 @@ N.defaultProps = {
|
|
|
610
616
|
};
|
|
611
617
|
function se() {
|
|
612
618
|
const { t: e } = I();
|
|
613
|
-
return /* @__PURE__ */ t(
|
|
619
|
+
return /* @__PURE__ */ t(ge, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
|
|
614
620
|
}
|
|
615
621
|
function O({ filterTip: e, keywordTip: n }) {
|
|
616
622
|
const { t: r, locale: l } = I(), i = () => l === "zh" ? "、" : " , ";
|
|
617
|
-
return /* @__PURE__ */
|
|
623
|
+
return /* @__PURE__ */ f(dt, { className: "tips", children: [
|
|
618
624
|
/* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children: r("blocklet.emptyTip") }),
|
|
619
625
|
e && /* @__PURE__ */ t("span", { children: r("blocklet.filterTip") }),
|
|
620
626
|
e && n && i(),
|
|
@@ -630,14 +636,14 @@ O.defaultProps = {
|
|
|
630
636
|
keywordTip: !1
|
|
631
637
|
};
|
|
632
638
|
function j({ primaryStart: e, primaryEnd: n, filter: r }) {
|
|
633
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ f(ge, { variant: "subtitle2", children: [
|
|
634
640
|
/* @__PURE__ */ t("span", { children: e }),
|
|
635
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ f("span", { className: "primary", children: [
|
|
636
642
|
" ",
|
|
637
643
|
r,
|
|
638
644
|
" "
|
|
639
645
|
] }),
|
|
640
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ f("span", { children: [
|
|
641
647
|
n,
|
|
642
648
|
" "
|
|
643
649
|
] })
|
|
@@ -656,63 +662,63 @@ function Y({ blocklets: e, ...n }) {
|
|
|
656
662
|
selectedCategory: c,
|
|
657
663
|
getCategoryLocale: k,
|
|
658
664
|
filters: g,
|
|
659
|
-
t:
|
|
665
|
+
t: d,
|
|
660
666
|
hasNextPage: y,
|
|
661
|
-
loadMore:
|
|
667
|
+
loadMore: p,
|
|
662
668
|
endpoint: P
|
|
663
|
-
} = I(), B = M(null), b = Xe(B.current), $ = Ye(() => b ? b.width > 900 ? 12 : b.width > 600 ? 8 : 4 : 0, [b]),
|
|
669
|
+
} = I(), B = M(null), b = Xe(B.current), $ = Ye(() => b ? b.width > 900 ? 12 : b.width > 600 ? 8 : 4 : 0, [b]), m = !!c || !!g.price, [u] = pt({
|
|
664
670
|
loading: i.fetchBlockletsLoading || i.loadingMore,
|
|
665
671
|
hasNextPage: y,
|
|
666
|
-
onLoadMore:
|
|
672
|
+
onLoadMore: p
|
|
667
673
|
});
|
|
668
674
|
if (l.fetchBlockletsError)
|
|
669
675
|
return /* @__PURE__ */ t(
|
|
670
|
-
|
|
676
|
+
fe,
|
|
671
677
|
{
|
|
672
678
|
error: new Error(`Failed to fetch blocklets from ${P}: ${l.fetchBlockletsError.message}`)
|
|
673
679
|
}
|
|
674
680
|
);
|
|
675
681
|
if (i.fetchBlockletsLoading)
|
|
676
682
|
return /* @__PURE__ */ t(D, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ t(W, {}) });
|
|
677
|
-
if (g.keyword &&
|
|
678
|
-
return /* @__PURE__ */
|
|
683
|
+
if (g.keyword && m && e.length === 0)
|
|
684
|
+
return /* @__PURE__ */ f(q, { children: [
|
|
679
685
|
/* @__PURE__ */ t(
|
|
680
686
|
j,
|
|
681
687
|
{
|
|
682
|
-
primaryStart:
|
|
683
|
-
primaryEnd:
|
|
688
|
+
primaryStart: d("blocklet.noBlockletPart1"),
|
|
689
|
+
primaryEnd: d("blocklet.noBlockletPart2"),
|
|
684
690
|
filter: g.keyword
|
|
685
691
|
}
|
|
686
692
|
),
|
|
687
693
|
/* @__PURE__ */ t(O, { keywordTip: !0, filterTip: !0 })
|
|
688
694
|
] });
|
|
689
695
|
if (g.keyword && e.length === 0)
|
|
690
|
-
return /* @__PURE__ */
|
|
696
|
+
return /* @__PURE__ */ f(q, { children: [
|
|
691
697
|
/* @__PURE__ */ t(
|
|
692
698
|
j,
|
|
693
699
|
{
|
|
694
|
-
primaryStart:
|
|
695
|
-
primaryEnd:
|
|
700
|
+
primaryStart: d("blocklet.noBlockletPart1"),
|
|
701
|
+
primaryEnd: d("blocklet.noBlockletPart2"),
|
|
696
702
|
filter: g.keyword
|
|
697
703
|
}
|
|
698
704
|
),
|
|
699
705
|
/* @__PURE__ */ t(O, { keywordTip: !0 })
|
|
700
706
|
] });
|
|
701
|
-
if (
|
|
707
|
+
if (m && e.length === 0) {
|
|
702
708
|
const s = k(c);
|
|
703
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ f(q, { children: [
|
|
704
710
|
s ? /* @__PURE__ */ t(
|
|
705
711
|
j,
|
|
706
712
|
{
|
|
707
|
-
primaryStart:
|
|
708
|
-
primaryEnd:
|
|
713
|
+
primaryStart: d("blocklet.noCategoryResults1"),
|
|
714
|
+
primaryEnd: d("blocklet.noCategoryResults2"),
|
|
709
715
|
filter: s
|
|
710
716
|
}
|
|
711
717
|
) : /* @__PURE__ */ t(se, {}),
|
|
712
718
|
/* @__PURE__ */ t(O, { filterTip: !0 })
|
|
713
719
|
] });
|
|
714
720
|
}
|
|
715
|
-
return e.length === 0 ? /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(se, {}) }) : /* @__PURE__ */
|
|
721
|
+
return e.length === 0 ? /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(se, {}) }) : /* @__PURE__ */ f(Lt, { container: !0, ...n, columns: $, ref: B, children: [
|
|
716
722
|
e.map((s) => /* @__PURE__ */ t(ce, { item: !0, xs: 4, "data-blocklet-did": s.did, children: r({ blocklet: s, blocklets: e }) }, s.did)),
|
|
717
723
|
y && /* @__PURE__ */ t(ce, { item: !0, xs: 12, ref: u, children: /* @__PURE__ */ t(D, { height: 60, display: "flex", justifyContent: "center", children: /* @__PURE__ */ t(W, {}) }) })
|
|
718
724
|
] });
|
|
@@ -721,13 +727,13 @@ Y.propTypes = {
|
|
|
721
727
|
blocklets: o.array.isRequired
|
|
722
728
|
};
|
|
723
729
|
Y.defaultProps = {};
|
|
724
|
-
const Lt = C(
|
|
730
|
+
const Lt = C(he)`
|
|
725
731
|
opacity: ${(e) => e.columns > 0 ? 1 : 0};
|
|
726
732
|
&.MuiGrid-root {
|
|
727
733
|
width: 100%;
|
|
728
734
|
margin: 0 -16px;
|
|
729
735
|
}
|
|
730
|
-
`, ce = Ke(C(
|
|
736
|
+
`, ce = Ke(C(he)`
|
|
731
737
|
@media (max-width: ${(e) => e.theme.breakpoints.values.sm}px) {
|
|
732
738
|
&.MuiGrid-item {
|
|
733
739
|
padding-bottom: 0px;
|
|
@@ -749,7 +755,7 @@ const Lt = C(ue)`
|
|
|
749
755
|
`;
|
|
750
756
|
function Z() {
|
|
751
757
|
const { selectedCategory: e, handleCategory: n, t: r, handlePrice: l, filters: i, categoryOptions: c, priceOptions: k } = I();
|
|
752
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ f(Mt, { children: [
|
|
753
759
|
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(A, { title: r("common.price"), options: k, value: i.price, onChange: l }) }),
|
|
754
760
|
c.length > 0 && /* @__PURE__ */ t("div", { style: { marginTop: "16px" }, children: /* @__PURE__ */ t(
|
|
755
761
|
A,
|
|
@@ -775,9 +781,9 @@ Z.propTypes = {};
|
|
|
775
781
|
Z.defaultProps = {};
|
|
776
782
|
function ee({ placeholder: e, ...n }) {
|
|
777
783
|
const { filters: r, handleKeyword: l } = I(), [i, c] = F(r.keyword || ""), k = Ze(l, { wait: 300 }), g = (y) => {
|
|
778
|
-
const { value:
|
|
779
|
-
c(
|
|
780
|
-
},
|
|
784
|
+
const { value: p } = y.target;
|
|
785
|
+
c(p), k.run(p);
|
|
786
|
+
}, d = () => {
|
|
781
787
|
c(""), l();
|
|
782
788
|
};
|
|
783
789
|
return E(() => {
|
|
@@ -794,7 +800,7 @@ function ee({ placeholder: e, ...n }) {
|
|
|
794
800
|
value: i,
|
|
795
801
|
title: e,
|
|
796
802
|
"data-cy": "search",
|
|
797
|
-
endAdornment: i && /* @__PURE__ */ t(le, { position: "end", children: /* @__PURE__ */ t(Et, { "data-cy": "search-delete", onClick:
|
|
803
|
+
endAdornment: i && /* @__PURE__ */ t(le, { position: "end", children: /* @__PURE__ */ t(Et, { "data-cy": "search-delete", onClick: d }) }),
|
|
798
804
|
...n
|
|
799
805
|
}
|
|
800
806
|
);
|
|
@@ -821,7 +827,7 @@ const Ot = C(Fe)`
|
|
|
821
827
|
color: transparent;
|
|
822
828
|
}
|
|
823
829
|
}
|
|
824
|
-
`, Ft = C(
|
|
830
|
+
`, Ft = C(ut)`
|
|
825
831
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
826
832
|
font-size: 28px;
|
|
827
833
|
@media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
|
|
@@ -833,9 +839,9 @@ const Ot = C(Fe)`
|
|
|
833
839
|
cursor: pointer;
|
|
834
840
|
`;
|
|
835
841
|
function te({ onSelect: e, wrapChildren: n }) {
|
|
836
|
-
const r = M(null), l = M(null), i = M(null), { storeApi: c, blockletRender: k, filters: g, endpoint:
|
|
837
|
-
const { data: s } = await c.get(R.blockletsPath, { params: u }),
|
|
838
|
-
return
|
|
842
|
+
const r = M(null), l = M(null), i = M(null), { storeApi: c, blockletRender: k, filters: g, endpoint: d, handleKeyword: y, t: p } = I(), P = async (u) => {
|
|
843
|
+
const { data: s } = await c.get(R.blockletsPath, { params: u }), v = s.dataList || [];
|
|
844
|
+
return v.length > 0 && v.unshift({ type: "more-result", total: s.total || 0 }), v;
|
|
839
845
|
}, B = (u) => {
|
|
840
846
|
y(u.state.query), u.setIsOpen(!1);
|
|
841
847
|
}, b = () => {
|
|
@@ -845,7 +851,7 @@ function te({ onSelect: e, wrapChildren: n }) {
|
|
|
845
851
|
});
|
|
846
852
|
}, $ = (u) => {
|
|
847
853
|
u.setIsOpen(!1), b();
|
|
848
|
-
},
|
|
854
|
+
}, m = ({ prevState: u, state: s }) => {
|
|
849
855
|
u.query !== s.query && (s.query || y());
|
|
850
856
|
};
|
|
851
857
|
return gt(
|
|
@@ -854,16 +860,16 @@ function te({ onSelect: e, wrapChildren: n }) {
|
|
|
854
860
|
{ enableOnTags: ["INPUT"] }
|
|
855
861
|
), E(() => {
|
|
856
862
|
b();
|
|
857
|
-
}, [
|
|
863
|
+
}, [d]), E(() => {
|
|
858
864
|
if (!r.current)
|
|
859
865
|
return;
|
|
860
|
-
const u =
|
|
866
|
+
const u = ft({
|
|
861
867
|
container: r.current,
|
|
862
868
|
renderer: { createElement: We, Fragment: He, render: () => {
|
|
863
869
|
} },
|
|
864
|
-
render({ children: s },
|
|
870
|
+
render({ children: s }, v) {
|
|
865
871
|
var x;
|
|
866
|
-
(!l.current || i.current !==
|
|
872
|
+
(!l.current || i.current !== v) && (i.current = v, (x = l.current) == null || x.unmount(), l.current = ht(v)), l.current.render(n(s));
|
|
867
873
|
},
|
|
868
874
|
autoFocus: !0,
|
|
869
875
|
openOnFocus: !1,
|
|
@@ -872,20 +878,28 @@ function te({ onSelect: e, wrapChildren: n }) {
|
|
|
872
878
|
label: "bl-autocomplete-label",
|
|
873
879
|
form: "bl-autocomplete-form",
|
|
874
880
|
input: "bl-autocomplete-input",
|
|
875
|
-
clearButton: "bl-autocomplete-clear"
|
|
881
|
+
clearButton: "bl-autocomplete-clear",
|
|
882
|
+
detachedCancelButton: "bl-autocomplete-detached-cancel",
|
|
883
|
+
detachedContainer: "bl-autocomplete-detached-container"
|
|
876
884
|
},
|
|
877
|
-
|
|
885
|
+
translations: {
|
|
886
|
+
clearButtonTitle: p("common.clear"),
|
|
887
|
+
detachedCancelButtonText: p("common.cancel"),
|
|
888
|
+
submitButtonTitle: p("common.search"),
|
|
889
|
+
detachedSearchButtonTitle: p("common.search")
|
|
890
|
+
},
|
|
891
|
+
placeholder: p("common.searchStore"),
|
|
878
892
|
initialState: {
|
|
879
893
|
query: g.keyword
|
|
880
894
|
},
|
|
881
895
|
onStateChange(s) {
|
|
882
|
-
|
|
896
|
+
m(s);
|
|
883
897
|
},
|
|
884
898
|
onSubmit: B,
|
|
885
899
|
onReset(s) {
|
|
886
900
|
$(s);
|
|
887
901
|
},
|
|
888
|
-
getSources({ query: s, state:
|
|
902
|
+
getSources({ query: s, state: v, ...x }) {
|
|
889
903
|
const T = {
|
|
890
904
|
...g,
|
|
891
905
|
sortBy: R[g.sortBy],
|
|
@@ -907,16 +921,16 @@ function te({ onSelect: e, wrapChildren: n }) {
|
|
|
907
921
|
onSelect({ event: w, item: _ }) {
|
|
908
922
|
return _.type === "more-result" ? (x.setIsOpen(!1), y(s)) : w.type === "keydown" ? y(_.title) : e({
|
|
909
923
|
blocklet: _,
|
|
910
|
-
detailUrl: yt(
|
|
911
|
-
storeUrl:
|
|
924
|
+
detailUrl: yt(d, `/blocklets/${_.did}`),
|
|
925
|
+
storeUrl: d
|
|
912
926
|
});
|
|
913
927
|
},
|
|
914
928
|
templates: {
|
|
915
929
|
item({ item: w }) {
|
|
916
|
-
return w.type === "more-result" ? /* @__PURE__ */ t("div", { children:
|
|
930
|
+
return w.type === "more-result" ? /* @__PURE__ */ t("div", { children: p("autocomplete.expandResult", { name: s, number: w.total.toLocaleString() }) }) : k({ blocklet: w, autocompleteSetters: x });
|
|
917
931
|
},
|
|
918
932
|
noResults() {
|
|
919
|
-
return
|
|
933
|
+
return p("blocklet.noResults");
|
|
920
934
|
}
|
|
921
935
|
}
|
|
922
936
|
}
|
|
@@ -926,7 +940,21 @@ function te({ onSelect: e, wrapChildren: n }) {
|
|
|
926
940
|
return () => {
|
|
927
941
|
u.destroy();
|
|
928
942
|
};
|
|
929
|
-
}, [g, k]), /* @__PURE__ */
|
|
943
|
+
}, [g, k]), /* @__PURE__ */ f(pe, { children: [
|
|
944
|
+
/* @__PURE__ */ t(
|
|
945
|
+
ue,
|
|
946
|
+
{
|
|
947
|
+
styles: me`
|
|
948
|
+
.bl-autocomplete-detached-container {
|
|
949
|
+
.bl-autocomplete-detached-cancel {
|
|
950
|
+
white-space: nowrap;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
`
|
|
954
|
+
}
|
|
955
|
+
),
|
|
956
|
+
/* @__PURE__ */ t("div", { className: "bl-search-container", ref: r })
|
|
957
|
+
] });
|
|
930
958
|
}
|
|
931
959
|
te.propTypes = {
|
|
932
960
|
onSelect: o.func.isRequired,
|
|
@@ -936,7 +964,7 @@ te.defaultProps = {
|
|
|
936
964
|
wrapChildren: (e) => e
|
|
937
965
|
};
|
|
938
966
|
function qt() {
|
|
939
|
-
var
|
|
967
|
+
var v, x;
|
|
940
968
|
const {
|
|
941
969
|
handleDeveloper: e,
|
|
942
970
|
blockletList: n,
|
|
@@ -946,19 +974,19 @@ function qt() {
|
|
|
946
974
|
handleCategory: c,
|
|
947
975
|
handlePrice: k,
|
|
948
976
|
handleSearchSelect: g,
|
|
949
|
-
t:
|
|
977
|
+
t: d,
|
|
950
978
|
getCategoryLocale: y,
|
|
951
|
-
priceOptions:
|
|
979
|
+
priceOptions: p,
|
|
952
980
|
wrapChildren: P,
|
|
953
981
|
baseSearch: B
|
|
954
|
-
} = I(), b = bt(
|
|
955
|
-
return /* @__PURE__ */
|
|
982
|
+
} = I(), b = bt(d), $ = ((v = b.find((T) => T.value === r.sortBy)) == null ? void 0 : v.name) || d("sort.sort"), m = y(r.category), { resourceType: u } = r || {}, s = (x = p.find((T) => T.value === r.price)) == null ? void 0 : x.name;
|
|
983
|
+
return /* @__PURE__ */ f(D, { display: "flex", alignItems: "flex-start", height: "100%", children: [
|
|
956
984
|
/* @__PURE__ */ t(ae, { mdDown: !0, children: /* @__PURE__ */ t(Z, {}) }),
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
B ? /* @__PURE__ */ t(ee, { className: "bl-search-container", placeholder:
|
|
961
|
-
/* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ f(jt, { children: [
|
|
986
|
+
/* @__PURE__ */ f(Gt, { children: [
|
|
987
|
+
/* @__PURE__ */ f(D, { className: "filter-bar", display: "flex", alignItems: "center", children: [
|
|
988
|
+
B ? /* @__PURE__ */ t(ee, { className: "bl-search-container", placeholder: d("common.searchStore") }) : /* @__PURE__ */ t(te, { onSelect: g, wrapChildren: P }),
|
|
989
|
+
/* @__PURE__ */ f(D, { mt: 0, ml: "16px", className: "filter-container", children: [
|
|
962
990
|
/* @__PURE__ */ t(ae, { mdUp: !0, children: /* @__PURE__ */ t(X, {}) }),
|
|
963
991
|
/* @__PURE__ */ t(
|
|
964
992
|
J,
|
|
@@ -974,7 +1002,7 @@ function qt() {
|
|
|
974
1002
|
)
|
|
975
1003
|
] })
|
|
976
1004
|
] }),
|
|
977
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ f(D, { display: "flex", flexWrap: "wrap", alignItems: "center", mb: "16px", children: [
|
|
978
1006
|
/* @__PURE__ */ t(
|
|
979
1007
|
N,
|
|
980
1008
|
{
|
|
@@ -988,7 +1016,7 @@ function qt() {
|
|
|
988
1016
|
/* @__PURE__ */ t(
|
|
989
1017
|
N,
|
|
990
1018
|
{
|
|
991
|
-
label:
|
|
1019
|
+
label: m,
|
|
992
1020
|
onDelete: () => {
|
|
993
1021
|
c(null);
|
|
994
1022
|
}
|
|
@@ -1003,10 +1031,10 @@ function qt() {
|
|
|
1003
1031
|
}
|
|
1004
1032
|
}
|
|
1005
1033
|
),
|
|
1006
|
-
u && /* @__PURE__ */ t(N, { label: `${
|
|
1034
|
+
u && /* @__PURE__ */ t(N, { label: `${d("common.resourceType")}: ${u}` })
|
|
1007
1035
|
] })
|
|
1008
1036
|
] }),
|
|
1009
|
-
/* @__PURE__ */ t(qe, { FallbackComponent:
|
|
1037
|
+
/* @__PURE__ */ t(qe, { FallbackComponent: fe, children: /* @__PURE__ */ t("div", { style: { position: "relative", flex: 1, overflow: "auto" }, children: /* @__PURE__ */ t(Y, { blocklets: n }) }) })
|
|
1010
1038
|
] })
|
|
1011
1039
|
] });
|
|
1012
1040
|
}
|
|
@@ -1060,9 +1088,9 @@ const jt = C("main")`
|
|
|
1060
1088
|
z-index: 9;
|
|
1061
1089
|
background-color: white;
|
|
1062
1090
|
`;
|
|
1063
|
-
function
|
|
1064
|
-
const n =
|
|
1065
|
-
autocomplete:
|
|
1091
|
+
function ke(e) {
|
|
1092
|
+
const n = de(), r = Ct(n.palette.primary.main), l = {
|
|
1093
|
+
autocomplete: me`
|
|
1066
1094
|
:root {
|
|
1067
1095
|
--aa-detached-media-query: (max-width: ${n.breakpoints.values.md}px) !important;
|
|
1068
1096
|
--aa-detached-modal-media-query: (min-width: ${n.breakpoints.values.md}px) !important;
|
|
@@ -1100,13 +1128,13 @@ function ye(e) {
|
|
|
1100
1128
|
}
|
|
1101
1129
|
`
|
|
1102
1130
|
};
|
|
1103
|
-
return /* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */ t(
|
|
1131
|
+
return /* @__PURE__ */ f(V, { ...e, children: [
|
|
1132
|
+
/* @__PURE__ */ t(ue, { styles: l.autocomplete }),
|
|
1105
1133
|
/* @__PURE__ */ t(qt, {})
|
|
1106
1134
|
] });
|
|
1107
1135
|
}
|
|
1108
|
-
|
|
1109
|
-
|
|
1136
|
+
ke.propTypes = ye;
|
|
1137
|
+
ke.defaultProps = be;
|
|
1110
1138
|
export {
|
|
1111
|
-
|
|
1139
|
+
ke as default
|
|
1112
1140
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/list",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.77",
|
|
4
4
|
"description": "Common ux components of blocklet",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"react-dom": ">=18.2.0"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@algolia/autocomplete-js": "^1.
|
|
54
|
-
"@algolia/autocomplete-theme-classic": "^1.
|
|
55
|
-
"@arcblock/ux": "^2.9.
|
|
53
|
+
"@algolia/autocomplete-js": "^1.17.0",
|
|
54
|
+
"@algolia/autocomplete-theme-classic": "^1.17.0",
|
|
55
|
+
"@arcblock/ux": "^2.9.56",
|
|
56
56
|
"@emotion/react": "^11.10.0",
|
|
57
57
|
"@emotion/styled": "^11.10.0",
|
|
58
58
|
"@mui/icons-material": "^5.15.12",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"prettier": "^2.7.1",
|
|
84
84
|
"vite": "^5.0.12"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "5f781cbe2f464c95382e370ed3713bb9531f4068"
|
|
87
87
|
}
|