@blocklet/list 0.12.102 → 0.12.104
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/index.es.js +213 -212
- package/package.json +6 -6
package/lib/index.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as t, jsxs as g, Fragment as
|
|
2
|
-
import { styled as T, useTheme as
|
|
1
|
+
import { jsx as t, jsxs as g, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import { styled as T, useTheme as se } from "@arcblock/ux/lib/Theme";
|
|
3
3
|
import { Global as Se, css as Ce } from "@emotion/react";
|
|
4
4
|
import Oe from "@mui/icons-material/Sort";
|
|
5
|
-
import { Button as Fe, CircularProgress as
|
|
5
|
+
import { Button as Fe, CircularProgress as le, MenuList as Ae, useMediaQuery as ve, SvgIcon as Me, Popper as Ee, Grow as qe, Paper as je, ClickAwayListener as Ue, MenuItem as We, Chip as Pe, Box as D, Unstable_Grid2 as oe, OutlinedInput as Ge, InputAdornment as be, Typography as Te, Hidden as we, Stack as Ke } from "@mui/material";
|
|
6
6
|
import He from "@mui/icons-material/Face";
|
|
7
7
|
import { ErrorBoundary as Qe } from "react-error-boundary";
|
|
8
8
|
import { ErrorFallback as Re } from "@arcblock/ux/lib/ErrorBoundary";
|
|
9
|
-
import { createContext as Ve, useMemo as
|
|
9
|
+
import { createContext as Ve, useMemo as H, useState as M, useCallback as ae, useEffect as U, useContext as Je, forwardRef as Xe, useRef as Q, createElement as Ye, Fragment as Ze } from "react";
|
|
10
10
|
import { useReactive as Be, useInfiniteScroll as et, useRequest as tt, useSize as rt, useDebounceFn as ot, useMemoizedFn as nt, useCreation as lt, useMount as at } from "ahooks";
|
|
11
11
|
import { joinURL as it, parseQuery as st } from "ufo";
|
|
12
12
|
import o from "prop-types";
|
|
13
13
|
import ct from "lodash/orderBy";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import ut from "axios";
|
|
15
|
+
import pt from "json-stable-stringify";
|
|
16
16
|
import "lodash/cloneDeep";
|
|
17
17
|
import dt from "color";
|
|
18
18
|
import xe from "flat";
|
|
@@ -29,8 +29,8 @@ import kt from "@mui/icons-material/Search";
|
|
|
29
29
|
import St from "@mui/icons-material/Close";
|
|
30
30
|
import { createRoot as Ct } from "react-dom/client";
|
|
31
31
|
import { autocomplete as vt } from "@algolia/autocomplete-js";
|
|
32
|
-
import { useHotkeys as
|
|
33
|
-
import
|
|
32
|
+
import { useHotkeys as Pt } from "react-hotkeys-hook";
|
|
33
|
+
import Tt from "@arcblock/ux/lib/Switch";
|
|
34
34
|
import "@algolia/autocomplete-theme-classic/dist/theme.css";
|
|
35
35
|
const Rt = (e) => [
|
|
36
36
|
{
|
|
@@ -142,7 +142,7 @@ const Nt = _t((e) => Promise.resolve(e), 300), Lt = {
|
|
|
142
142
|
autocomplete: {
|
|
143
143
|
expandResult: "显示 {number} 条 “{name}” 的搜索结果 "
|
|
144
144
|
}
|
|
145
|
-
},
|
|
145
|
+
}, ne = {
|
|
146
146
|
en: xe(Lt),
|
|
147
147
|
zh: xe(Ot)
|
|
148
148
|
}, Ie = {
|
|
@@ -196,7 +196,7 @@ const Nt = _t((e) => Promise.resolve(e), 300), Lt = {
|
|
|
196
196
|
categoriesPath: "/api/blocklets/categories",
|
|
197
197
|
cacheSize: 100
|
|
198
198
|
}, De = Ve({}), { Provider: Ft, Consumer: Dr } = De;
|
|
199
|
-
function
|
|
199
|
+
function ce({
|
|
200
200
|
filters: e,
|
|
201
201
|
children: n,
|
|
202
202
|
endpoint: r,
|
|
@@ -205,99 +205,100 @@ function se({
|
|
|
205
205
|
onFilterChange: c,
|
|
206
206
|
onSearchSelect: x,
|
|
207
207
|
extraFilter: y,
|
|
208
|
-
wrapChildren:
|
|
208
|
+
wrapChildren: u,
|
|
209
209
|
baseSearch: b,
|
|
210
|
-
serverVersion:
|
|
210
|
+
serverVersion: p,
|
|
211
211
|
storeVersion: S,
|
|
212
212
|
fetchCategoryDelay: v,
|
|
213
213
|
showResourcesSwitch: C,
|
|
214
|
-
showCategory:
|
|
215
|
-
tagFilters:
|
|
214
|
+
showCategory: R,
|
|
215
|
+
tagFilters: B
|
|
216
216
|
}) {
|
|
217
217
|
const i = {};
|
|
218
|
-
|
|
219
|
-
const h =
|
|
218
|
+
p && (i["x-blocklet-server-version"] = p), S && (i["x-blocklet-store-version"] = S);
|
|
219
|
+
const h = H(() => ut.create({
|
|
220
220
|
baseURL: r,
|
|
221
221
|
headers: i
|
|
222
|
-
}), [r]), d =
|
|
222
|
+
}), [r]), d = H(() => ({
|
|
223
223
|
sortBy: "popularity",
|
|
224
224
|
sortDirection: "desc",
|
|
225
225
|
...e
|
|
226
|
-
}), [e]), k = d.category,
|
|
226
|
+
}), [e]), k = d.category, P = Be({
|
|
227
227
|
currentPage: _.currentPage,
|
|
228
228
|
pageSize: zt() ? _.mobilePageSize : _.pageSize,
|
|
229
229
|
defaultCurrentPage: _.defaultCurrentPage
|
|
230
|
-
}), [w, L] =
|
|
231
|
-
data:
|
|
232
|
-
loading:
|
|
233
|
-
loadMore:
|
|
230
|
+
}), [w, L] = M(null), {
|
|
231
|
+
data: E = { list: [], total: 0 },
|
|
232
|
+
loading: te,
|
|
233
|
+
loadMore: re,
|
|
234
234
|
loadingMore: O
|
|
235
235
|
} = et(
|
|
236
|
-
async () => {
|
|
237
|
-
|
|
236
|
+
async (a) => {
|
|
237
|
+
a || (P.currentPage = P.defaultCurrentPage);
|
|
238
|
+
const { currentPage: f, pageSize: $ } = P, A = {
|
|
238
239
|
...d,
|
|
239
240
|
sortBy: _[d.sortBy],
|
|
240
|
-
page:
|
|
241
|
-
pageSize:
|
|
241
|
+
page: f,
|
|
242
|
+
pageSize: $
|
|
242
243
|
};
|
|
243
244
|
L(null);
|
|
244
|
-
const { data:
|
|
245
|
-
params:
|
|
245
|
+
const { data: z = {} } = await h.get(_.blockletsPath, {
|
|
246
|
+
params: A
|
|
246
247
|
});
|
|
247
|
-
return
|
|
248
|
-
page:
|
|
249
|
-
pageSize:
|
|
250
|
-
list: (
|
|
251
|
-
total: (
|
|
248
|
+
return P.currentPage++, {
|
|
249
|
+
page: f,
|
|
250
|
+
pageSize: $,
|
|
251
|
+
list: (z == null ? void 0 : z.dataList) || [],
|
|
252
|
+
total: (z == null ? void 0 : z.total) || 0
|
|
252
253
|
};
|
|
253
254
|
},
|
|
254
255
|
{
|
|
255
256
|
isNoMore: (a) => a ? a.page * a.pageSize >= a.total : !1,
|
|
256
|
-
reloadDeps: [r,
|
|
257
|
+
reloadDeps: [r, pt(e)],
|
|
257
258
|
onError: (a) => {
|
|
258
259
|
L(a);
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
262
|
), {
|
|
262
263
|
data: F = [],
|
|
263
|
-
error:
|
|
264
|
-
loading:
|
|
265
|
-
run:
|
|
264
|
+
error: G,
|
|
265
|
+
loading: J,
|
|
266
|
+
run: X
|
|
266
267
|
} = tt(
|
|
267
268
|
async () => {
|
|
268
269
|
const { data: a } = await h.get(_.categoriesPath);
|
|
269
270
|
return Array.isArray(a) ? a : [];
|
|
270
271
|
},
|
|
271
272
|
{ manual: !0 }
|
|
272
|
-
), m =
|
|
273
|
+
), m = H(() => ct(F || [], [(f) => f.name], ["asc"]), [F]), q = ae(
|
|
273
274
|
(a, f) => {
|
|
274
|
-
const
|
|
275
|
-
return It(
|
|
275
|
+
const $ = ne[l] ? ne[l][a] : ne.en[a];
|
|
276
|
+
return It($, f);
|
|
276
277
|
},
|
|
277
278
|
[l]
|
|
278
|
-
),
|
|
279
|
-
let a =
|
|
279
|
+
), I = H(() => {
|
|
280
|
+
let a = E.list || [];
|
|
280
281
|
return a = y(a), a;
|
|
281
|
-
}, [
|
|
282
|
-
errors: { fetchBlockletsError: w, fetchCategoriesError:
|
|
283
|
-
loadings: { fetchBlockletsLoading:
|
|
282
|
+
}, [E, y]), K = H(() => $t(m, l), [m, l]), Y = Bt(q), Le = {
|
|
283
|
+
errors: { fetchBlockletsError: w, fetchCategoriesError: G },
|
|
284
|
+
loadings: { fetchBlockletsLoading: te, fetchCategoriesLoading: J, loadingMore: O },
|
|
284
285
|
endpoint: r,
|
|
285
|
-
blockletList:
|
|
286
|
-
wrapChildren:
|
|
287
|
-
t:
|
|
286
|
+
blockletList: I,
|
|
287
|
+
wrapChildren: u,
|
|
288
|
+
t: q,
|
|
288
289
|
filters: d,
|
|
289
290
|
selectedCategory: k,
|
|
290
291
|
categoryList: m,
|
|
291
292
|
blockletRender: s,
|
|
292
293
|
locale: l,
|
|
293
|
-
categoryOptions:
|
|
294
|
-
priceOptions:
|
|
294
|
+
categoryOptions: K,
|
|
295
|
+
priceOptions: Y,
|
|
295
296
|
storeApi: h,
|
|
296
297
|
baseSearch: b,
|
|
297
298
|
showResourcesSwitch: C,
|
|
298
|
-
showCategory:
|
|
299
|
-
tagFilters:
|
|
300
|
-
hasNextPage:
|
|
299
|
+
showCategory: R,
|
|
300
|
+
tagFilters: B,
|
|
301
|
+
hasNextPage: P.pageSize * P.currentPage < E.total,
|
|
301
302
|
onFilterChange: c,
|
|
302
303
|
handleSort: (a) => {
|
|
303
304
|
const f = {
|
|
@@ -321,8 +322,8 @@ function se({
|
|
|
321
322
|
handleCategory: (a) => {
|
|
322
323
|
let f = a;
|
|
323
324
|
(a === "all" || a === d.category) && (f = void 0);
|
|
324
|
-
const
|
|
325
|
-
c(
|
|
325
|
+
const $ = { ...d, category: f };
|
|
326
|
+
c($);
|
|
326
327
|
},
|
|
327
328
|
handleDeveloper: (a) => {
|
|
328
329
|
const f = { ...d, owner: a || void 0 };
|
|
@@ -336,84 +337,84 @@ function se({
|
|
|
336
337
|
const a = { ...d };
|
|
337
338
|
c(a);
|
|
338
339
|
},
|
|
339
|
-
loadMore:
|
|
340
|
+
loadMore: re,
|
|
340
341
|
getCategoryLocale: (a) => {
|
|
341
342
|
if (!a)
|
|
342
343
|
return null;
|
|
343
344
|
let f = null;
|
|
344
|
-
const
|
|
345
|
-
return
|
|
345
|
+
const $ = F.find((A) => A._id === a);
|
|
346
|
+
return $ && (f = $.locales[l]), f;
|
|
346
347
|
},
|
|
347
348
|
get developerName() {
|
|
348
|
-
var f,
|
|
349
|
-
return ((
|
|
350
|
-
var
|
|
351
|
-
return ((
|
|
352
|
-
})) == null ? void 0 : f.owner) == null ? void 0 :
|
|
349
|
+
var f, $;
|
|
350
|
+
return (($ = (f = I.find((A) => {
|
|
351
|
+
var z;
|
|
352
|
+
return ((z = A == null ? void 0 : A.owner) == null ? void 0 : z.did) === d.owner;
|
|
353
|
+
})) == null ? void 0 : f.owner) == null ? void 0 : $.name) || "";
|
|
353
354
|
},
|
|
354
355
|
handleSearchSelect: x
|
|
355
356
|
};
|
|
356
|
-
return
|
|
357
|
+
return U(() => {
|
|
357
358
|
setTimeout(() => {
|
|
358
|
-
|
|
359
|
+
X();
|
|
359
360
|
}, v || 0);
|
|
360
361
|
}, [r]), /* @__PURE__ */ t(Ft, { value: Le, children: n });
|
|
361
362
|
}
|
|
362
|
-
|
|
363
|
+
ce.propTypes = {
|
|
363
364
|
...Ie,
|
|
364
365
|
children: o.any.isRequired
|
|
365
366
|
};
|
|
366
|
-
|
|
367
|
+
ce.defaultProps = ze;
|
|
367
368
|
function N() {
|
|
368
369
|
const e = Je(De);
|
|
369
370
|
return e || {};
|
|
370
371
|
}
|
|
371
372
|
const At = T(Fe)`
|
|
372
373
|
border-radius: 4px;
|
|
373
|
-
`,
|
|
374
|
+
`, ue = Xe(({ children: e, rounded: n, loading: r, disabled: l, ...s }, c) => /* @__PURE__ */ t(
|
|
374
375
|
At,
|
|
375
376
|
{
|
|
376
377
|
ref: c,
|
|
377
378
|
disableElevation: !0,
|
|
378
379
|
disabled: l || r,
|
|
379
380
|
...s,
|
|
380
|
-
startIcon: r && /* @__PURE__ */ t(
|
|
381
|
+
startIcon: r && /* @__PURE__ */ t(le, { size: "1em" }),
|
|
381
382
|
children: e
|
|
382
383
|
}
|
|
383
384
|
));
|
|
384
|
-
|
|
385
|
+
ue.propTypes = {
|
|
385
386
|
children: o.any,
|
|
386
387
|
rounded: o.bool,
|
|
387
388
|
loading: o.bool,
|
|
388
389
|
disabled: o.bool
|
|
389
390
|
};
|
|
390
|
-
|
|
391
|
+
ue.defaultProps = {
|
|
391
392
|
children: null,
|
|
392
393
|
rounded: !1,
|
|
393
394
|
loading: !1,
|
|
394
395
|
disabled: !1
|
|
395
396
|
};
|
|
396
397
|
function pe({ title: e, value: n, icon: r, prepend: l, options: s, onChange: c, itemRender: x, ...y }) {
|
|
397
|
-
const
|
|
398
|
-
|
|
398
|
+
const u = Q(null), b = se(), [p, S] = M(!1), [v, C] = M(n !== null ? n : ""), R = ve(b.breakpoints.down("sm"));
|
|
399
|
+
U(() => {
|
|
399
400
|
C(n !== null ? n : "");
|
|
400
401
|
}, [n]);
|
|
401
|
-
const
|
|
402
|
+
const B = ae(() => {
|
|
402
403
|
S(!1);
|
|
403
|
-
}, []), i =
|
|
404
|
+
}, []), i = ae(() => {
|
|
404
405
|
S(!0);
|
|
405
406
|
}, []);
|
|
406
407
|
function h(k) {
|
|
407
|
-
C(k.value), c(k.value),
|
|
408
|
+
C(k.value), c(k.value), R && B();
|
|
408
409
|
}
|
|
409
410
|
function d(k) {
|
|
410
411
|
return k === v;
|
|
411
412
|
}
|
|
412
|
-
return /* @__PURE__ */ g(
|
|
413
|
+
return /* @__PURE__ */ g(ie, { children: [
|
|
413
414
|
/* @__PURE__ */ g(
|
|
414
415
|
Mt,
|
|
415
416
|
{
|
|
416
|
-
ref:
|
|
417
|
+
ref: u,
|
|
417
418
|
onClick: i,
|
|
418
419
|
variant: "outlined",
|
|
419
420
|
size: "small",
|
|
@@ -427,7 +428,7 @@ function pe({ title: e, value: n, icon: r, prepend: l, options: s, onChange: c,
|
|
|
427
428
|
]
|
|
428
429
|
}
|
|
429
430
|
),
|
|
430
|
-
/* @__PURE__ */ t(Ee, { open:
|
|
431
|
+
/* @__PURE__ */ t(Ee, { open: p, anchorEl: u.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: k, placement: P }) => /* @__PURE__ */ t(qe, { ...k, sx: { transformOrigin: P === "bottom" ? "center top" : "center bottom" }, children: /* @__PURE__ */ t(je, { children: /* @__PURE__ */ t(Ue, { onClickAway: B, children: /* @__PURE__ */ g(Et, { autoFocusItem: p, onMouseEnter: i, onMouseLeave: B, children: [
|
|
431
432
|
l,
|
|
432
433
|
s.map((w) => x ? x(w) : /* @__PURE__ */ t(
|
|
433
434
|
We,
|
|
@@ -461,7 +462,7 @@ pe.defaultProps = {
|
|
|
461
462
|
onChange: () => {
|
|
462
463
|
}
|
|
463
464
|
};
|
|
464
|
-
const Mt = T(
|
|
465
|
+
const Mt = T(ue)`
|
|
465
466
|
border: 1px solid #f0f0f0;
|
|
466
467
|
padding: 6px 8px 6px 12px;
|
|
467
468
|
font-weight: ${(e) => e.theme.typography.fontWeightBold};
|
|
@@ -509,7 +510,7 @@ const Mt = T(ce)`
|
|
|
509
510
|
}
|
|
510
511
|
}
|
|
511
512
|
`;
|
|
512
|
-
function
|
|
513
|
+
function W({ options: e, onChange: n, title: r, value: l }) {
|
|
513
514
|
return /* @__PURE__ */ g(qt, { children: [
|
|
514
515
|
/* @__PURE__ */ t("div", { className: "title", children: r }),
|
|
515
516
|
/* @__PURE__ */ t("div", { className: "list", children: e.map((s) => /* @__PURE__ */ t(
|
|
@@ -553,41 +554,41 @@ const qt = T("div")`
|
|
|
553
554
|
font-weight: bold;
|
|
554
555
|
}
|
|
555
556
|
`;
|
|
556
|
-
|
|
557
|
+
W.propTypes = {
|
|
557
558
|
title: o.string.isRequired,
|
|
558
559
|
options: o.array.isRequired,
|
|
559
560
|
onChange: o.func.isRequired,
|
|
560
561
|
value: o.oneOfType([o.string, o.number])
|
|
561
562
|
};
|
|
562
|
-
|
|
563
|
+
W.defaultProps = {
|
|
563
564
|
value: null
|
|
564
565
|
};
|
|
565
|
-
function
|
|
566
|
-
const { selectedCategory: e, handleCategory: n, t: r, handlePrice: l, filters: s, categoryOptions: c, priceOptions: x } = N(), [y,
|
|
567
|
-
|
|
566
|
+
function de() {
|
|
567
|
+
const { selectedCategory: e, handleCategory: n, t: r, handlePrice: l, filters: s, categoryOptions: c, priceOptions: x } = N(), [y, u] = M(!1), b = (p, S) => {
|
|
568
|
+
p === "category" && n(S), p === "price" && l(S), u(!1);
|
|
568
569
|
};
|
|
569
570
|
return /* @__PURE__ */ g(jt, { children: [
|
|
570
|
-
/* @__PURE__ */ t(yt, { variant: "outlined", className: "filter-button", onClick: () =>
|
|
571
|
-
/* @__PURE__ */ g(gt, { fullWidth: !0, title: "", open: y, onClose: () =>
|
|
571
|
+
/* @__PURE__ */ t(yt, { variant: "outlined", className: "filter-button", onClick: () => u(!0), children: /* @__PURE__ */ t(ft, { className: "filter-icon", fontSize: "small" }) }),
|
|
572
|
+
/* @__PURE__ */ g(gt, { fullWidth: !0, title: "", open: y, onClose: () => u(!1), children: [
|
|
572
573
|
/* @__PURE__ */ t(
|
|
573
|
-
|
|
574
|
+
W,
|
|
574
575
|
{
|
|
575
576
|
title: r("common.price"),
|
|
576
577
|
options: x,
|
|
577
578
|
value: s.price,
|
|
578
|
-
onChange: (
|
|
579
|
-
b("price",
|
|
579
|
+
onChange: (p) => {
|
|
580
|
+
b("price", p);
|
|
580
581
|
}
|
|
581
582
|
}
|
|
582
583
|
),
|
|
583
584
|
c.length > 0 && /* @__PURE__ */ t("div", { style: { marginTop: "16px" }, children: /* @__PURE__ */ t(
|
|
584
|
-
|
|
585
|
+
W,
|
|
585
586
|
{
|
|
586
587
|
title: r("common.category"),
|
|
587
588
|
options: c,
|
|
588
589
|
value: e,
|
|
589
|
-
onChange: (
|
|
590
|
-
b("category",
|
|
590
|
+
onChange: (p) => {
|
|
591
|
+
b("category", p);
|
|
591
592
|
}
|
|
592
593
|
}
|
|
593
594
|
) })
|
|
@@ -605,8 +606,8 @@ const jt = T("div")`
|
|
|
605
606
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
606
607
|
}
|
|
607
608
|
`;
|
|
608
|
-
|
|
609
|
-
|
|
609
|
+
de.propTypes = {};
|
|
610
|
+
de.defaultProps = {};
|
|
610
611
|
const Ut = T("div")`
|
|
611
612
|
.MuiChip-root {
|
|
612
613
|
border-radius: 4px;
|
|
@@ -616,15 +617,15 @@ const Ut = T("div")`
|
|
|
616
617
|
padding: 4px 0;
|
|
617
618
|
}
|
|
618
619
|
`;
|
|
619
|
-
function
|
|
620
|
-
return e ? /* @__PURE__ */ t(Ut, { ...l, children: /* @__PURE__ */ t(
|
|
620
|
+
function j({ label: e, icon: n, onDelete: r, ...l }) {
|
|
621
|
+
return e ? /* @__PURE__ */ t(Ut, { ...l, children: /* @__PURE__ */ t(Pe, { color: "primary", "data-cy": "filter-tag", icon: n, label: e, onDelete: r }) }) : null;
|
|
621
622
|
}
|
|
622
|
-
|
|
623
|
+
j.propTypes = {
|
|
623
624
|
label: o.string,
|
|
624
625
|
onDelete: o.func,
|
|
625
626
|
icon: o.element
|
|
626
627
|
};
|
|
627
|
-
|
|
628
|
+
j.defaultProps = {
|
|
628
629
|
onDelete: null,
|
|
629
630
|
icon: null,
|
|
630
631
|
label: null
|
|
@@ -633,7 +634,7 @@ function ke() {
|
|
|
633
634
|
const { t: e } = N();
|
|
634
635
|
return /* @__PURE__ */ t($e, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
|
|
635
636
|
}
|
|
636
|
-
function
|
|
637
|
+
function V({ filterTip: e, keywordTip: n }) {
|
|
637
638
|
const { t: r, locale: l } = N(), s = () => l === "zh" ? "、" : " , ";
|
|
638
639
|
return /* @__PURE__ */ g(xt, { className: "tips", children: [
|
|
639
640
|
/* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children: r("blocklet.emptyTip") }),
|
|
@@ -642,15 +643,15 @@ function Q({ filterTip: e, keywordTip: n }) {
|
|
|
642
643
|
n && /* @__PURE__ */ t("span", { children: r("blocklet.keywordTip") })
|
|
643
644
|
] });
|
|
644
645
|
}
|
|
645
|
-
|
|
646
|
+
V.propTypes = {
|
|
646
647
|
filterTip: o.bool,
|
|
647
648
|
keywordTip: o.bool
|
|
648
649
|
};
|
|
649
|
-
|
|
650
|
+
V.defaultProps = {
|
|
650
651
|
filterTip: !1,
|
|
651
652
|
keywordTip: !1
|
|
652
653
|
};
|
|
653
|
-
function
|
|
654
|
+
function ee({ primaryStart: e, primaryEnd: n, filter: r }) {
|
|
654
655
|
return /* @__PURE__ */ g($e, { variant: "subtitle2", children: [
|
|
655
656
|
/* @__PURE__ */ t("span", { children: e }),
|
|
656
657
|
/* @__PURE__ */ g("span", { className: "primary", children: [
|
|
@@ -664,7 +665,7 @@ function Z({ primaryStart: e, primaryEnd: n, filter: r }) {
|
|
|
664
665
|
] })
|
|
665
666
|
] });
|
|
666
667
|
}
|
|
667
|
-
|
|
668
|
+
ee.propTypes = {
|
|
668
669
|
primaryStart: o.string.isRequired,
|
|
669
670
|
primaryEnd: o.string.isRequired,
|
|
670
671
|
filter: o.string.isRequired
|
|
@@ -673,15 +674,15 @@ function Wt(e) {
|
|
|
673
674
|
return e ? e.width > 900 ? 12 : e.width > 600 ? 8 : 4 : 0;
|
|
674
675
|
}
|
|
675
676
|
function _e({ children: e }) {
|
|
676
|
-
const n =
|
|
677
|
-
return
|
|
677
|
+
const n = Q(null), [r, l] = M(null), s = rt(r);
|
|
678
|
+
return U(() => {
|
|
678
679
|
r || l(n.current);
|
|
679
680
|
}, [r]), e(n, Wt(s));
|
|
680
681
|
}
|
|
681
682
|
_e.propTypes = {
|
|
682
683
|
children: o.func.isRequired
|
|
683
684
|
};
|
|
684
|
-
function
|
|
685
|
+
function me({ blocklets: e, ...n }) {
|
|
685
686
|
const {
|
|
686
687
|
blockletRender: r,
|
|
687
688
|
errors: l,
|
|
@@ -689,14 +690,14 @@ function de({ blocklets: e, ...n }) {
|
|
|
689
690
|
selectedCategory: c,
|
|
690
691
|
getCategoryLocale: x,
|
|
691
692
|
filters: y,
|
|
692
|
-
t:
|
|
693
|
+
t: u,
|
|
693
694
|
hasNextPage: b,
|
|
694
|
-
loadMore:
|
|
695
|
+
loadMore: p,
|
|
695
696
|
endpoint: S
|
|
696
697
|
} = N(), v = !!c || !!y.price, [C] = wt({
|
|
697
698
|
loading: s.fetchBlockletsLoading || s.loadingMore,
|
|
698
699
|
hasNextPage: b,
|
|
699
|
-
onLoadMore:
|
|
700
|
+
onLoadMore: p
|
|
700
701
|
});
|
|
701
702
|
if (l.fetchBlockletsError)
|
|
702
703
|
return /* @__PURE__ */ t(
|
|
@@ -706,69 +707,69 @@ function de({ blocklets: e, ...n }) {
|
|
|
706
707
|
}
|
|
707
708
|
);
|
|
708
709
|
if (s.fetchBlockletsLoading)
|
|
709
|
-
return /* @__PURE__ */ t(D, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ t(
|
|
710
|
+
return /* @__PURE__ */ t(D, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ t(le, {}) });
|
|
710
711
|
if (y.keyword && v && e.length === 0)
|
|
711
|
-
return /* @__PURE__ */ g(
|
|
712
|
+
return /* @__PURE__ */ g(Z, { children: [
|
|
712
713
|
/* @__PURE__ */ t(
|
|
713
|
-
|
|
714
|
+
ee,
|
|
714
715
|
{
|
|
715
|
-
primaryStart:
|
|
716
|
-
primaryEnd:
|
|
716
|
+
primaryStart: u("blocklet.noBlockletPart1"),
|
|
717
|
+
primaryEnd: u("blocklet.noBlockletPart2"),
|
|
717
718
|
filter: y.keyword
|
|
718
719
|
}
|
|
719
720
|
),
|
|
720
|
-
/* @__PURE__ */ t(
|
|
721
|
+
/* @__PURE__ */ t(V, { keywordTip: !0, filterTip: !0 })
|
|
721
722
|
] });
|
|
722
723
|
if (y.keyword && e.length === 0)
|
|
723
|
-
return /* @__PURE__ */ g(
|
|
724
|
+
return /* @__PURE__ */ g(Z, { children: [
|
|
724
725
|
/* @__PURE__ */ t(
|
|
725
|
-
|
|
726
|
+
ee,
|
|
726
727
|
{
|
|
727
|
-
primaryStart:
|
|
728
|
-
primaryEnd:
|
|
728
|
+
primaryStart: u("blocklet.noBlockletPart1"),
|
|
729
|
+
primaryEnd: u("blocklet.noBlockletPart2"),
|
|
729
730
|
filter: y.keyword
|
|
730
731
|
}
|
|
731
732
|
),
|
|
732
|
-
/* @__PURE__ */ t(
|
|
733
|
+
/* @__PURE__ */ t(V, { keywordTip: !0 })
|
|
733
734
|
] });
|
|
734
735
|
if (v && e.length === 0) {
|
|
735
|
-
const
|
|
736
|
-
return /* @__PURE__ */ g(
|
|
737
|
-
|
|
738
|
-
|
|
736
|
+
const R = x(c);
|
|
737
|
+
return /* @__PURE__ */ g(Z, { children: [
|
|
738
|
+
R ? /* @__PURE__ */ t(
|
|
739
|
+
ee,
|
|
739
740
|
{
|
|
740
|
-
primaryStart:
|
|
741
|
-
primaryEnd:
|
|
742
|
-
filter:
|
|
741
|
+
primaryStart: u("blocklet.noCategoryResults1"),
|
|
742
|
+
primaryEnd: u("blocklet.noCategoryResults2"),
|
|
743
|
+
filter: R
|
|
743
744
|
}
|
|
744
745
|
) : /* @__PURE__ */ t(ke, {}),
|
|
745
|
-
/* @__PURE__ */ t(
|
|
746
|
+
/* @__PURE__ */ t(V, { filterTip: !0 })
|
|
746
747
|
] });
|
|
747
748
|
}
|
|
748
|
-
return e.length === 0 ? /* @__PURE__ */ t(
|
|
749
|
-
|
|
749
|
+
return e.length === 0 ? /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(ke, {}) }) : /* @__PURE__ */ t(_e, { children: (R, B) => /* @__PURE__ */ g(
|
|
750
|
+
oe,
|
|
750
751
|
{
|
|
751
752
|
...n,
|
|
752
753
|
container: !0,
|
|
753
754
|
spacing: 2,
|
|
754
|
-
columns:
|
|
755
|
+
columns: B,
|
|
755
756
|
disableEqualOverflow: !0,
|
|
756
|
-
ref:
|
|
757
|
+
ref: R,
|
|
757
758
|
sx: {
|
|
758
|
-
opacity: () =>
|
|
759
|
+
opacity: () => B > 0 ? 1 : 0
|
|
759
760
|
},
|
|
760
761
|
children: [
|
|
761
|
-
e.map((i) => /* @__PURE__ */ t(
|
|
762
|
-
b && /* @__PURE__ */ t(
|
|
762
|
+
e.map((i) => /* @__PURE__ */ t(oe, { xs: 4, "data-blocklet-did": i.did, children: r({ blocklet: i, blocklets: e }) }, i.did)),
|
|
763
|
+
b && /* @__PURE__ */ t(oe, { xs: 12, ref: C, children: /* @__PURE__ */ t(D, { height: 60, display: "flex", justifyContent: "center", children: /* @__PURE__ */ t(le, {}) }) })
|
|
763
764
|
]
|
|
764
765
|
}
|
|
765
766
|
) });
|
|
766
767
|
}
|
|
767
|
-
|
|
768
|
+
me.propTypes = {
|
|
768
769
|
blocklets: o.array.isRequired
|
|
769
770
|
};
|
|
770
|
-
|
|
771
|
-
const
|
|
771
|
+
me.defaultProps = {};
|
|
772
|
+
const Z = T(bt)`
|
|
772
773
|
text-align: center;
|
|
773
774
|
.primary {
|
|
774
775
|
color: ${(e) => e.theme.palette.primary.main};
|
|
@@ -777,12 +778,12 @@ const Y = T(bt)`
|
|
|
777
778
|
margin-top: ${(e) => e.theme.spacing(1)};
|
|
778
779
|
}
|
|
779
780
|
`;
|
|
780
|
-
function
|
|
781
|
+
function he() {
|
|
781
782
|
const { selectedCategory: e, handleCategory: n, t: r, handlePrice: l, filters: s, categoryOptions: c, priceOptions: x } = N();
|
|
782
783
|
return /* @__PURE__ */ g(Gt, { children: [
|
|
783
|
-
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
784
|
+
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(W, { title: r("common.price"), options: x, value: s.price, onChange: l }) }),
|
|
784
785
|
c.length > 0 && /* @__PURE__ */ t("div", { style: { marginTop: "16px" }, children: /* @__PURE__ */ t(
|
|
785
|
-
|
|
786
|
+
W,
|
|
786
787
|
{
|
|
787
788
|
title: r("common.category"),
|
|
788
789
|
options: c,
|
|
@@ -801,16 +802,16 @@ const Gt = T("aside")`
|
|
|
801
802
|
overflow-y: auto;
|
|
802
803
|
z-index: auto;
|
|
803
804
|
`;
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
function
|
|
807
|
-
const { filters: r, handleKeyword: l } = N(), [s, c] =
|
|
808
|
-
const { value:
|
|
809
|
-
c(
|
|
810
|
-
},
|
|
805
|
+
he.propTypes = {};
|
|
806
|
+
he.defaultProps = {};
|
|
807
|
+
function fe({ placeholder: e, ...n }) {
|
|
808
|
+
const { filters: r, handleKeyword: l } = N(), [s, c] = M(r.keyword || ""), x = ot(l, { wait: 300 }), y = (b) => {
|
|
809
|
+
const { value: p } = b.target;
|
|
810
|
+
c(p), x.run(p);
|
|
811
|
+
}, u = () => {
|
|
811
812
|
c(""), l();
|
|
812
813
|
};
|
|
813
|
-
return
|
|
814
|
+
return U(() => {
|
|
814
815
|
c(r.keyword || "");
|
|
815
816
|
}, [r.keyword]), /* @__PURE__ */ t(
|
|
816
817
|
Kt,
|
|
@@ -824,15 +825,15 @@ function he({ placeholder: e, ...n }) {
|
|
|
824
825
|
value: s,
|
|
825
826
|
title: e,
|
|
826
827
|
"data-cy": "search",
|
|
827
|
-
endAdornment: s && /* @__PURE__ */ t(be, { position: "end", children: /* @__PURE__ */ t(Qt, { "data-cy": "search-delete", onClick:
|
|
828
|
+
endAdornment: s && /* @__PURE__ */ t(be, { position: "end", children: /* @__PURE__ */ t(Qt, { "data-cy": "search-delete", onClick: u }) }),
|
|
828
829
|
...n
|
|
829
830
|
}
|
|
830
831
|
);
|
|
831
832
|
}
|
|
832
|
-
|
|
833
|
+
fe.propTypes = {
|
|
833
834
|
placeholder: o.string
|
|
834
835
|
};
|
|
835
|
-
|
|
836
|
+
fe.defaultProps = {
|
|
836
837
|
placeholder: "Type to search..."
|
|
837
838
|
};
|
|
838
839
|
const Kt = T(Ge)`
|
|
@@ -863,8 +864,8 @@ const Kt = T(Ge)`
|
|
|
863
864
|
font-size: 16px;
|
|
864
865
|
cursor: pointer;
|
|
865
866
|
`;
|
|
866
|
-
function
|
|
867
|
-
const r =
|
|
867
|
+
function ge({ onSelect: e, wrapChildren: n }) {
|
|
868
|
+
const r = Q(null), l = Q(null), s = Q(null), { storeApi: c, blockletRender: x, filters: y, endpoint: u, handleKeyword: b, t: p } = N(), S = async (i) => {
|
|
868
869
|
const { data: h } = await c.get(_.blockletsPath, { params: i }), d = h.dataList || [];
|
|
869
870
|
return d.length > 0 && d.unshift({ type: "more-result", total: h.total || 0 }), d;
|
|
870
871
|
}, v = (i) => {
|
|
@@ -874,18 +875,18 @@ function fe({ onSelect: e, wrapChildren: n }) {
|
|
|
874
875
|
const i = r.current.querySelector("input.bl-autocomplete-input");
|
|
875
876
|
i && i.focus();
|
|
876
877
|
});
|
|
877
|
-
},
|
|
878
|
+
}, R = (i) => {
|
|
878
879
|
i.setIsOpen(!1), C();
|
|
879
|
-
},
|
|
880
|
+
}, B = ({ prevState: i, state: h }) => {
|
|
880
881
|
i.query !== h.query && (h.query || b());
|
|
881
882
|
};
|
|
882
|
-
return
|
|
883
|
+
return Pt(
|
|
883
884
|
"ctrl + k, command + k",
|
|
884
885
|
(i) => (i.stopPropagation(), i.preventDefault(), C(), !1),
|
|
885
886
|
{ enableOnTags: ["INPUT"] }
|
|
886
|
-
),
|
|
887
|
+
), U(() => {
|
|
887
888
|
C();
|
|
888
|
-
}, [
|
|
889
|
+
}, [u]), U(() => {
|
|
889
890
|
if (!r.current)
|
|
890
891
|
return;
|
|
891
892
|
const i = vt({
|
|
@@ -908,24 +909,24 @@ function fe({ onSelect: e, wrapChildren: n }) {
|
|
|
908
909
|
detachedContainer: "bl-autocomplete-detached-container"
|
|
909
910
|
},
|
|
910
911
|
translations: {
|
|
911
|
-
clearButtonTitle:
|
|
912
|
-
detachedCancelButtonText:
|
|
913
|
-
submitButtonTitle:
|
|
914
|
-
detachedSearchButtonTitle:
|
|
912
|
+
clearButtonTitle: p("common.clear"),
|
|
913
|
+
detachedCancelButtonText: p("common.cancel"),
|
|
914
|
+
submitButtonTitle: p("common.search"),
|
|
915
|
+
detachedSearchButtonTitle: p("common.search")
|
|
915
916
|
},
|
|
916
|
-
placeholder:
|
|
917
|
+
placeholder: p("common.searchStore"),
|
|
917
918
|
initialState: {
|
|
918
919
|
query: y.keyword
|
|
919
920
|
},
|
|
920
921
|
onStateChange(h) {
|
|
921
|
-
|
|
922
|
+
B(h);
|
|
922
923
|
},
|
|
923
924
|
onSubmit: v,
|
|
924
925
|
onReset(h) {
|
|
925
|
-
|
|
926
|
+
R(h);
|
|
926
927
|
},
|
|
927
928
|
getSources({ query: h, state: d, ...k }) {
|
|
928
|
-
const
|
|
929
|
+
const P = {
|
|
929
930
|
...y,
|
|
930
931
|
sortBy: _[y.sortBy],
|
|
931
932
|
page: 1,
|
|
@@ -936,7 +937,7 @@ function fe({ onSelect: e, wrapChildren: n }) {
|
|
|
936
937
|
{
|
|
937
938
|
sourceId: "blocklets",
|
|
938
939
|
getItems() {
|
|
939
|
-
return S(
|
|
940
|
+
return S(P);
|
|
940
941
|
},
|
|
941
942
|
// 选中后填充 搜索框中值
|
|
942
943
|
getItemInputValue({ item: w }) {
|
|
@@ -946,16 +947,16 @@ function fe({ onSelect: e, wrapChildren: n }) {
|
|
|
946
947
|
onSelect({ event: w, item: L }) {
|
|
947
948
|
return L.type === "more-result" ? (k.setIsOpen(!1), b(h)) : w.type === "keydown" ? b(L.title) : e({
|
|
948
949
|
blocklet: L,
|
|
949
|
-
detailUrl: it(
|
|
950
|
-
storeUrl:
|
|
950
|
+
detailUrl: it(u, `/blocklets/${L.did}`),
|
|
951
|
+
storeUrl: u
|
|
951
952
|
});
|
|
952
953
|
},
|
|
953
954
|
templates: {
|
|
954
955
|
item({ item: w }) {
|
|
955
|
-
return w.type === "more-result" ? /* @__PURE__ */ t("div", { children:
|
|
956
|
+
return w.type === "more-result" ? /* @__PURE__ */ t("div", { children: p("autocomplete.expandResult", { name: h, number: w.total.toLocaleString() }) }) : x({ blocklet: w, autocompleteSetters: k });
|
|
956
957
|
},
|
|
957
958
|
noResults() {
|
|
958
|
-
return
|
|
959
|
+
return p("blocklet.noResults");
|
|
959
960
|
}
|
|
960
961
|
}
|
|
961
962
|
}
|
|
@@ -965,7 +966,7 @@ function fe({ onSelect: e, wrapChildren: n }) {
|
|
|
965
966
|
return () => {
|
|
966
967
|
i.destroy();
|
|
967
968
|
};
|
|
968
|
-
}, [y, x]), /* @__PURE__ */ g(
|
|
969
|
+
}, [y, x]), /* @__PURE__ */ g(ie, { children: [
|
|
969
970
|
/* @__PURE__ */ t(
|
|
970
971
|
Se,
|
|
971
972
|
{
|
|
@@ -981,34 +982,34 @@ function fe({ onSelect: e, wrapChildren: n }) {
|
|
|
981
982
|
/* @__PURE__ */ t("div", { className: "bl-search-container", ref: r })
|
|
982
983
|
] });
|
|
983
984
|
}
|
|
984
|
-
|
|
985
|
+
ge.propTypes = {
|
|
985
986
|
onSelect: o.func.isRequired,
|
|
986
987
|
wrapChildren: o.func
|
|
987
988
|
};
|
|
988
|
-
|
|
989
|
+
ge.defaultProps = {
|
|
989
990
|
wrapChildren: (e) => e
|
|
990
991
|
};
|
|
991
|
-
function
|
|
992
|
+
function ye({ t: e }) {
|
|
992
993
|
const { filters: n, handleSwitchShowResources: r } = N(), l = () => {
|
|
993
994
|
n.showResources = !n.showResources, r();
|
|
994
995
|
};
|
|
995
996
|
return /* @__PURE__ */ t(
|
|
996
|
-
|
|
997
|
+
Tt,
|
|
997
998
|
{
|
|
998
999
|
checked: n.showResources,
|
|
999
1000
|
onChange: l,
|
|
1000
1001
|
labelProps: {
|
|
1001
|
-
label: /* @__PURE__ */ t(
|
|
1002
|
+
label: /* @__PURE__ */ t(Te, { marginLeft: "8px", fontSize: "small", children: /* @__PURE__ */ t("span", { children: e("common.showResources") }) })
|
|
1002
1003
|
}
|
|
1003
1004
|
}
|
|
1004
1005
|
);
|
|
1005
1006
|
}
|
|
1006
|
-
|
|
1007
|
+
ye.propTypes = {
|
|
1007
1008
|
t: o.func.isRequired
|
|
1008
1009
|
};
|
|
1009
|
-
|
|
1010
|
+
ye.defaultProps = {};
|
|
1010
1011
|
function Vt() {
|
|
1011
|
-
var
|
|
1012
|
+
var J, X;
|
|
1012
1013
|
const {
|
|
1013
1014
|
handleDeveloper: e,
|
|
1014
1015
|
blockletList: n,
|
|
@@ -1018,30 +1019,30 @@ function Vt() {
|
|
|
1018
1019
|
handleCategory: c,
|
|
1019
1020
|
handlePrice: x,
|
|
1020
1021
|
handleSearchSelect: y,
|
|
1021
|
-
t:
|
|
1022
|
+
t: u,
|
|
1022
1023
|
getCategoryLocale: b,
|
|
1023
|
-
priceOptions:
|
|
1024
|
+
priceOptions: p,
|
|
1024
1025
|
wrapChildren: S,
|
|
1025
1026
|
showResourcesSwitch: v,
|
|
1026
1027
|
showCategory: C,
|
|
1027
|
-
baseSearch:
|
|
1028
|
-
onFilterChange:
|
|
1028
|
+
baseSearch: R,
|
|
1029
|
+
onFilterChange: B,
|
|
1029
1030
|
tagFilters: i
|
|
1030
|
-
} = N(), h = Rt(
|
|
1031
|
+
} = N(), h = Rt(u), d = ((J = h.find((m) => m.value === r.sortBy)) == null ? void 0 : J.name) || u("sort.sort"), k = b(r.category), { resourceType: P } = r || {}, w = (X = p.find((m) => m.value === r.price)) == null ? void 0 : X.name, [L, E] = M(!1), te = se(), re = ve(() => te.breakpoints.down("md")), O = Be({
|
|
1031
1032
|
chooseTagId: ""
|
|
1032
1033
|
}), F = nt((m) => {
|
|
1033
|
-
O.chooseTagId = m.id, ["category", "resourceType", "resourceDid"].forEach((
|
|
1034
|
-
typeof m.params[
|
|
1035
|
-
}),
|
|
1036
|
-
}),
|
|
1034
|
+
O.chooseTagId = m.id, ["category", "resourceType", "resourceDid"].forEach((I) => {
|
|
1035
|
+
typeof m.params[I] > "u" ? delete r[I] : r[I] = m.params[I];
|
|
1036
|
+
}), B(r);
|
|
1037
|
+
}), G = lt(() => i.find((m) => m.id === O.chooseTagId), [O.chooseTagId]);
|
|
1037
1038
|
return at(() => {
|
|
1038
|
-
const m = st(window.location.search),
|
|
1039
|
-
const
|
|
1040
|
-
return
|
|
1039
|
+
const m = st(window.location.search), q = i.find((I) => {
|
|
1040
|
+
const K = I.params;
|
|
1041
|
+
return K ? Object.keys(K).every((Y) => m[Y] === K[Y]) : !1;
|
|
1041
1042
|
});
|
|
1042
|
-
|
|
1043
|
+
q ? F(q) : i.length > 0 && F(i[0]);
|
|
1043
1044
|
}), /* @__PURE__ */ g(D, { display: "flex", alignItems: "flex-start", height: "100%", children: [
|
|
1044
|
-
C ? /* @__PURE__ */ t(we, { mdDown: !0, children: /* @__PURE__ */ t(
|
|
1045
|
+
C ? /* @__PURE__ */ t(we, { mdDown: !0, children: /* @__PURE__ */ t(he, {}) }) : null,
|
|
1045
1046
|
/* @__PURE__ */ g(Jt, { children: [
|
|
1046
1047
|
/* @__PURE__ */ g(Xt, { children: [
|
|
1047
1048
|
/* @__PURE__ */ g(
|
|
@@ -1061,7 +1062,7 @@ function Vt() {
|
|
|
1061
1062
|
gap: 1
|
|
1062
1063
|
},
|
|
1063
1064
|
children: [
|
|
1064
|
-
C ? /* @__PURE__ */ t(we, { mdUp: !0, children: /* @__PURE__ */ t(
|
|
1065
|
+
C ? /* @__PURE__ */ t(we, { mdUp: !0, children: /* @__PURE__ */ t(de, {}) }) : null,
|
|
1065
1066
|
/* @__PURE__ */ t(
|
|
1066
1067
|
"form",
|
|
1067
1068
|
{
|
|
@@ -1074,16 +1075,16 @@ function Vt() {
|
|
|
1074
1075
|
m.preventDefault(), m.stopPropagation();
|
|
1075
1076
|
},
|
|
1076
1077
|
onFocus: () => {
|
|
1077
|
-
|
|
1078
|
+
E(!0);
|
|
1078
1079
|
},
|
|
1079
1080
|
onBlur: () => {
|
|
1080
|
-
|
|
1081
|
+
E(!1);
|
|
1081
1082
|
},
|
|
1082
|
-
children:
|
|
1083
|
+
children: R ? /* @__PURE__ */ t(fe, { className: "bl-search-container", placeholder: u("common.searchStore") }) : /* @__PURE__ */ t(ge, { onSelect: y, wrapChildren: S })
|
|
1083
1084
|
}
|
|
1084
1085
|
),
|
|
1085
1086
|
/* @__PURE__ */ g(D, { className: "filter-container", display: "flex", alignItems: "center", children: [
|
|
1086
|
-
!
|
|
1087
|
+
!re && v && /* @__PURE__ */ t(D, { ml: 1, mr: 1, children: /* @__PURE__ */ t(ye, { t: u }) }),
|
|
1087
1088
|
/* @__PURE__ */ t(
|
|
1088
1089
|
pe,
|
|
1089
1090
|
{
|
|
@@ -1102,7 +1103,7 @@ function Vt() {
|
|
|
1102
1103
|
),
|
|
1103
1104
|
C ? /* @__PURE__ */ g(D, { display: "flex", flexWrap: "wrap", alignItems: "center", mb: "16px", children: [
|
|
1104
1105
|
/* @__PURE__ */ t(
|
|
1105
|
-
|
|
1106
|
+
j,
|
|
1106
1107
|
{
|
|
1107
1108
|
label: l,
|
|
1108
1109
|
icon: /* @__PURE__ */ t(He, {}),
|
|
@@ -1112,7 +1113,7 @@ function Vt() {
|
|
|
1112
1113
|
}
|
|
1113
1114
|
),
|
|
1114
1115
|
/* @__PURE__ */ t(
|
|
1115
|
-
|
|
1116
|
+
j,
|
|
1116
1117
|
{
|
|
1117
1118
|
label: k,
|
|
1118
1119
|
onDelete: () => {
|
|
@@ -1121,7 +1122,7 @@ function Vt() {
|
|
|
1121
1122
|
}
|
|
1122
1123
|
),
|
|
1123
1124
|
/* @__PURE__ */ t(
|
|
1124
|
-
|
|
1125
|
+
j,
|
|
1125
1126
|
{
|
|
1126
1127
|
label: w,
|
|
1127
1128
|
onDelete: () => {
|
|
@@ -1129,13 +1130,13 @@ function Vt() {
|
|
|
1129
1130
|
}
|
|
1130
1131
|
}
|
|
1131
1132
|
),
|
|
1132
|
-
|
|
1133
|
+
P && /* @__PURE__ */ t(j, { label: `${u("common.resourceType")}: ${P}` })
|
|
1133
1134
|
] }) : null
|
|
1134
1135
|
] }),
|
|
1135
1136
|
/* @__PURE__ */ t(Qe, { FallbackComponent: Re, children: /* @__PURE__ */ g(D, { sx: { position: "relative", flex: 1, overflow: "auto" }, children: [
|
|
1136
|
-
(i == null ? void 0 : i.length) > 0 ? /* @__PURE__ */ g(
|
|
1137
|
+
(i == null ? void 0 : i.length) > 0 ? /* @__PURE__ */ g(ie, { children: [
|
|
1137
1138
|
/* @__PURE__ */ t(Ke, { my: 1, direction: "row", spacing: 1.5, useFlexGap: !0, flexWrap: "wrap", justifyContent: "flex-start", children: i.map((m) => /* @__PURE__ */ t(
|
|
1138
|
-
|
|
1139
|
+
Pe,
|
|
1139
1140
|
{
|
|
1140
1141
|
label: m.title,
|
|
1141
1142
|
size: "small",
|
|
@@ -1145,9 +1146,9 @@ function Vt() {
|
|
|
1145
1146
|
},
|
|
1146
1147
|
m.id
|
|
1147
1148
|
)) }),
|
|
1148
|
-
|
|
1149
|
+
G ? /* @__PURE__ */ t(D, { mb: 2, children: G.description ? /* @__PURE__ */ t(Te, { variant: "body1", children: G.description }) : null }) : null
|
|
1149
1150
|
] }) : null,
|
|
1150
|
-
/* @__PURE__ */ t(
|
|
1151
|
+
/* @__PURE__ */ t(me, { blocklets: n })
|
|
1151
1152
|
] }) })
|
|
1152
1153
|
] })
|
|
1153
1154
|
] });
|
|
@@ -1197,7 +1198,7 @@ const Jt = T("main")`
|
|
|
1197
1198
|
background-color: white;
|
|
1198
1199
|
`;
|
|
1199
1200
|
function Ne(e) {
|
|
1200
|
-
const n =
|
|
1201
|
+
const n = se(), r = Dt(n.palette.primary.main), l = {
|
|
1201
1202
|
autocomplete: Ce`
|
|
1202
1203
|
:root {
|
|
1203
1204
|
--aa-detached-media-query: (max-width: ${n.breakpoints.values.md}px) !important;
|
|
@@ -1236,7 +1237,7 @@ function Ne(e) {
|
|
|
1236
1237
|
}
|
|
1237
1238
|
`
|
|
1238
1239
|
};
|
|
1239
|
-
return /* @__PURE__ */ g(
|
|
1240
|
+
return /* @__PURE__ */ g(ce, { ...e, children: [
|
|
1240
1241
|
/* @__PURE__ */ t(Se, { styles: l.autocomplete }),
|
|
1241
1242
|
/* @__PURE__ */ t(Vt, {})
|
|
1242
1243
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/list",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.104",
|
|
4
4
|
"description": "Common ux components of blocklet",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@algolia/autocomplete-js": "^1.17.0",
|
|
54
54
|
"@algolia/autocomplete-theme-classic": "^1.17.0",
|
|
55
|
-
"@arcblock/ux": "^2.9.
|
|
56
|
-
"@blocklet/util": "0.12.
|
|
55
|
+
"@arcblock/ux": "^2.9.89",
|
|
56
|
+
"@blocklet/util": "0.12.104",
|
|
57
57
|
"@emotion/react": "^11.10.0",
|
|
58
58
|
"@emotion/styled": "^11.10.0",
|
|
59
59
|
"@mui/icons-material": "^5.15.12",
|
|
@@ -78,11 +78,11 @@
|
|
|
78
78
|
"@emotion/babel-plugin": "^11.10.0",
|
|
79
79
|
"@storybook/jest": "^0.0.10",
|
|
80
80
|
"@storybook/testing-library": "^0.0.13",
|
|
81
|
-
"@vitejs/plugin-react": "^4.
|
|
81
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
82
82
|
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
83
83
|
"eslint": "^8.22.0",
|
|
84
84
|
"prettier": "^2.7.1",
|
|
85
|
-
"vite": "^5.2.
|
|
85
|
+
"vite": "^5.2.12"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "1cc898a367a9e99b0593872807597fbfe336c46f"
|
|
88
88
|
}
|