@24city/web-console 0.3.6 → 0.3.8

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/GUIDELINES.md +29 -2
  3. package/README.md +3 -3
  4. package/dist/account/account-api.d.ts +7 -0
  5. package/dist/account/index.d.ts +1 -0
  6. package/dist/account/index.js +60 -59
  7. package/dist/account/use-show-once.d.ts +26 -0
  8. package/dist/chunks/{auth-provider-CqiyTeOt.js → auth-provider-7FOj7Y84.js} +1 -1
  9. package/dist/chunks/{console-layout-Os4sQzMP.js → console-layout-B4OlW1IZ.js} +1 -1
  10. package/dist/chunks/logout-signal-CLdquzzn.js +378 -0
  11. package/dist/chunks/{stale-build-DG-Tb2RA.js → stale-build-DwUlkKYm.js} +2 -2
  12. package/dist/chunks/text-link-WWzQqJ14.js +196 -0
  13. package/dist/chunks/use-show-once-Bz1ojVqb.js +768 -0
  14. package/dist/chunks/{wallet-badge-Dt8fv-Du.js → wallet-badge-COpdEDYI.js} +1 -1
  15. package/dist/chunks/waterfall-DOeGU8Zs.js +752 -0
  16. package/dist/index.js +197 -192
  17. package/dist/layout/index.js +1 -1
  18. package/dist/list/content-square.d.ts +36 -7
  19. package/dist/list/cover-tabs.d.ts +36 -0
  20. package/dist/list/filter-panel.d.ts +8 -5
  21. package/dist/list/index.d.ts +1 -0
  22. package/dist/list/index.js +26 -23
  23. package/dist/page/guide-modal.d.ts +37 -0
  24. package/dist/page/index.d.ts +1 -0
  25. package/dist/page/index.js +22 -21
  26. package/dist/runtime/index.js +2 -2
  27. package/dist/styles.css +820 -157
  28. package/dist/testing/fixtures.js +33 -27
  29. package/package.json +1 -1
  30. package/dist/chunks/logout-signal-CiD_zY5M.js +0 -365
  31. package/dist/chunks/text-link-Bb5f1eLW.js +0 -106
  32. package/dist/chunks/upgrade-modal-DyPkV9OB.js +0 -713
  33. package/dist/chunks/waterfall-ZMzEjGwK.js +0 -614
@@ -1,614 +0,0 @@
1
- import { jsx as a, jsxs as u, Fragment as P } from "react/jsx-runtime";
2
- import { RadioGroup as K, Radio as U, Typography as $, Skeleton as z, Input as D, Button as f, Dropdown as B, Popover as X, InputNumber as M } from "@douyinfe/semi-ui";
3
- import { useRef as L, useEffect as j, useState as S, forwardRef as q, useLayoutEffect as J } from "react";
4
- import { IconClose as W, IconSearch as O, IconTick as Q, IconChevronDown as G, IconDelete as Z, IconArrowDown as ee, IconUndo as ae, IconRefresh as te } from "@douyinfe/semi-icons";
5
- import { B as se } from "./scale-smFifpMm.js";
6
- const le = "_group_1f0zj_3", re = "_loading_1f0zj_4", ne = "_skeleton_1f0zj_11", oe = "_radio_1f0zj_28", ce = "_card_1f0zj_62", ie = "_title_1f0zj_90", de = "_description_1f0zj_101", C = {
7
- group: le,
8
- loading: re,
9
- skeleton: ne,
10
- radio: oe,
11
- card: ce,
12
- title: ie,
13
- description: de
14
- }, H = (e) => ({ "--choice-columns": e }), Da = ({
15
- ariaLabel: e,
16
- value: t,
17
- options: s,
18
- onChange: n,
19
- columns: l = 4
20
- }) => /* @__PURE__ */ a("div", { role: "radiogroup", "aria-label": e, children: /* @__PURE__ */ a(
21
- K,
22
- {
23
- name: e,
24
- className: C.group,
25
- style: H(l),
26
- value: t,
27
- onChange: (r) => n(r.target.value),
28
- children: s.map((r) => {
29
- const c = r.unavailable ?? r.description, o = r.value === t;
30
- return /* @__PURE__ */ a(U, { value: r.value, className: C.radio, children: /* @__PURE__ */ u("span", { className: C.card, "data-checked": o ? "true" : "false", "data-unavailable": r.unavailable ? "true" : void 0, children: [
31
- /* @__PURE__ */ a($.Text, { className: C.title, children: r.title }),
32
- c ? /* @__PURE__ */ a($.Text, { className: C.description, ellipsis: !0, children: c }) : null
33
- ] }) }, r.value || "all");
34
- })
35
- }
36
- ) }), ja = ({ count: e, columns: t = 4 }) => /* @__PURE__ */ a("div", { className: C.loading, style: H(t), "aria-busy": "true", children: Array.from({ length: e }, (s, n) => /* @__PURE__ */ a(z, { loading: !0, active: !0, className: C.skeleton, placeholder: /* @__PURE__ */ a(z.Paragraph, { rows: 2 }) }, n)) }), _e = "_square_13gth_7", ue = "_heroTitle_13gth_18", me = "_heroAccent_13gth_30", he = "_searchBar_13gth_35", pe = "_searchBox_13gth_49", ge = "_searchInput_13gth_55", fe = "_searchPrefix_13gth_91", ve = "_searchButton_13gth_100", be = "_guide_13gth_108", Ne = "_guideLabel_13gth_116", ye = "_guideTag_13gth_122", we = "_guideClear_13gth_142", xe = "_categories_13gth_147", Ce = "_panel_13gth_152", Te = "_filters_13gth_157", ke = "_toolbarStart_13gth_172", Le = "_filtersGroup_13gth_179", Be = "_results_13gth_187", Se = "_footer_13gth_196", p = {
37
- square: _e,
38
- heroTitle: ue,
39
- heroAccent: me,
40
- searchBar: he,
41
- searchBox: pe,
42
- searchInput: ge,
43
- searchPrefix: fe,
44
- searchButton: ve,
45
- guide: be,
46
- guideLabel: Ne,
47
- guideTag: ye,
48
- guideClear: we,
49
- categories: xe,
50
- panel: Ce,
51
- filters: Te,
52
- toolbarStart: ke,
53
- filtersGroup: Le,
54
- results: Be,
55
- footer: Se
56
- }, $e = (e, t) => {
57
- j(() => {
58
- const s = e.current, n = t.current;
59
- if (!s || !n) return;
60
- let l = 0;
61
- const r = () => {
62
- l = 0;
63
- const o = Number.parseFloat(getComputedStyle(s).getPropertyValue("--app-header-height")) || 0, i = n.getBoundingClientRect().top + window.scrollY - o, h = i > 0 ? Math.min(1, Math.max(0, window.scrollY / i)) : 1;
64
- s.style.setProperty("--hero-progress", h.toFixed(3));
65
- }, c = () => {
66
- l || (l = window.requestAnimationFrame(r));
67
- };
68
- return r(), window.addEventListener("scroll", c, { passive: !0 }), window.addEventListener("resize", c), () => {
69
- window.removeEventListener("scroll", c), window.removeEventListener("resize", c), window.cancelAnimationFrame(l);
70
- };
71
- }, [e, t]);
72
- }, qa = ({
73
- ariaLabel: e,
74
- placeholder: t,
75
- value: s,
76
- onChange: n,
77
- onSearch: l,
78
- inputRef: r,
79
- keyShortcut: c,
80
- guide: o,
81
- prefix: i
82
- }) => {
83
- const h = !s && o && o.items.length > 0;
84
- return /* @__PURE__ */ a(
85
- D,
86
- {
87
- ref: r,
88
- className: p.searchInput,
89
- "aria-label": e,
90
- "aria-keyshortcuts": c,
91
- showClear: !0,
92
- maxLength: 80,
93
- placeholder: t,
94
- value: s,
95
- onChange: n,
96
- onEnterPress: () => l(s),
97
- onClear: () => l(""),
98
- prefix: i ? /* @__PURE__ */ a("span", { className: p.searchPrefix, children: i }) : void 0,
99
- suffix: /* @__PURE__ */ u(P, { children: [
100
- h ? /* @__PURE__ */ u("span", { className: p.guide, role: "group", "aria-label": o.label, children: [
101
- /* @__PURE__ */ a($.Text, { className: p.guideLabel, children: o.label }),
102
- o.items.map((m) => /* @__PURE__ */ a(f, { theme: "light", type: "tertiary", size: "small", className: p.guideTag, onClick: () => l(m), children: m }, m)),
103
- o.onClear ? /* @__PURE__ */ a(
104
- f,
105
- {
106
- theme: "borderless",
107
- type: "primary",
108
- size: "small",
109
- className: p.guideClear,
110
- icon: /* @__PURE__ */ a(W, { "aria-hidden": "true" }),
111
- "aria-label": `清空${o.label}`,
112
- onClick: o.onClear
113
- }
114
- ) : null
115
- ] }) : null,
116
- /* @__PURE__ */ a(
117
- f,
118
- {
119
- theme: "solid",
120
- type: "primary",
121
- className: p.searchButton,
122
- icon: /* @__PURE__ */ a(O, { "aria-hidden": "true" }),
123
- "aria-label": "检索",
124
- onClick: () => l(s)
125
- }
126
- )
127
- ] })
128
- }
129
- );
130
- }, Wa = ({ children: e }) => /* @__PURE__ */ a("span", { className: p.heroAccent, children: e }), Oa = ({
131
- testId: e,
132
- title: t,
133
- search: s,
134
- categories: n,
135
- filters: l,
136
- toolbarLeft: r,
137
- toolbarRight: c,
138
- conditionKey: o,
139
- children: i
140
- }) => {
141
- const h = L(null), m = L(null), N = L(null), b = L(null);
142
- $e(h, m);
143
- const y = L(o);
144
- return j(() => {
145
- if (y.current === o) return;
146
- y.current = o;
147
- const v = b.current, T = N.current;
148
- if (!v || !T) return;
149
- const w = v.getBoundingClientRect().top - T.getBoundingClientRect().bottom;
150
- w < 0 && window.scrollBy({ top: w });
151
- }, [o]), /* @__PURE__ */ u("section", { ref: h, className: p.square, "data-testid": e, "data-categories": n ? "true" : "false", children: [
152
- /* @__PURE__ */ a($.Title, { heading: 1, className: p.heroTitle, children: t }),
153
- /* @__PURE__ */ a("div", { ref: m, "aria-hidden": "true" }),
154
- /* @__PURE__ */ a("div", { className: p.searchBar, children: /* @__PURE__ */ a("div", { className: p.searchBox, children: s }) }),
155
- n ? /* @__PURE__ */ a("div", { className: p.categories, children: n }) : null,
156
- l ? /* @__PURE__ */ a("div", { className: p.panel, children: l }) : null,
157
- /* @__PURE__ */ u("div", { ref: N, className: p.filters, role: "toolbar", "aria-label": "排序与视图", children: [
158
- /* @__PURE__ */ a("div", { className: p.toolbarStart, children: r }),
159
- /* @__PURE__ */ a("div", { className: p.filtersGroup, children: c })
160
- ] }),
161
- /* @__PURE__ */ a("div", { ref: b, className: p.results, children: i })
162
- ] });
163
- }, Ga = ({ children: e, footerRef: t }) => /* @__PURE__ */ a("div", { ref: t, className: p.footer, children: e }), Ae = "_trigger_iy209_3", Ie = "_text_iy209_27", Ee = "_prefix_iy209_32", Fe = "_arrow_iy209_50", Pe = "_menu_iy209_60", Re = "_checkItem_iy209_64", ze = "_check_iy209_64", Me = "_checkHidden_iy209_75", x = {
164
- trigger: Ae,
165
- text: Ie,
166
- prefix: Ee,
167
- arrow: Fe,
168
- menu: Pe,
169
- checkItem: Re,
170
- check: ze,
171
- checkHidden: Me
172
- }, V = q(
173
- ({ text: e, ariaLabel: t, active: s = !1, empty: n = !1, icon: l, arrow: r = !0, pressed: c, onClick: o, ...i }, h) => /* @__PURE__ */ u(
174
- f,
175
- {
176
- theme: "borderless",
177
- type: "primary",
178
- ...i,
179
- ref: h,
180
- className: x.trigger,
181
- "data-active": s ? "true" : "false",
182
- "data-empty": n ? "true" : "false",
183
- "aria-label": t,
184
- "aria-pressed": c,
185
- onClick: o,
186
- children: [
187
- l ? /* @__PURE__ */ a("span", { className: x.prefix, children: l }) : null,
188
- /* @__PURE__ */ a("span", { className: x.text, children: e }),
189
- r ? /* @__PURE__ */ a(G, { className: x.arrow, "aria-hidden": "true" }) : null
190
- ]
191
- }
192
- )
193
- );
194
- V.displayName = "FilterTrigger";
195
- const A = "__all__", Ha = ({
196
- label: e,
197
- placeholder: t,
198
- value: s,
199
- options: n,
200
- onChange: l,
201
- allLabel: r,
202
- icon: c,
203
- arrow: o = !0,
204
- checkmark: i = !1,
205
- position: h = "bottomLeft",
206
- disabled: m = !1,
207
- highlight: N = !0
208
- }) => {
209
- const [b, y] = S(!1), v = n.find((d) => d.value === s), T = r ? [{ value: A, label: r }, ...n] : n, w = s || (r ? A : "");
210
- return /* @__PURE__ */ a(
211
- B,
212
- {
213
- trigger: m ? "custom" : "click",
214
- position: h,
215
- visible: m ? !1 : b,
216
- onVisibleChange: y,
217
- render: /* @__PURE__ */ a(B.Menu, { className: x.menu, children: T.map((d) => /* @__PURE__ */ u(
218
- B.Item,
219
- {
220
- active: d.value === w,
221
- className: i ? x.checkItem : void 0,
222
- onClick: () => {
223
- y(!1), l(d.value === A ? "" : d.value);
224
- },
225
- children: [
226
- i ? /* @__PURE__ */ a(Q, { className: d.value === w ? x.check : x.checkHidden, "aria-hidden": "true" }) : null,
227
- d.label
228
- ]
229
- },
230
- d.value
231
- )) }),
232
- children: /* @__PURE__ */ a(
233
- V,
234
- {
235
- text: (v == null ? void 0 : v.label) ?? t ?? e,
236
- ariaLabel: `${e}:${(v == null ? void 0 : v.label) ?? r ?? "未选择"}`,
237
- active: b,
238
- empty: !v || !N,
239
- icon: c,
240
- arrow: o
241
- }
242
- )
243
- }
244
- );
245
- }, De = "_panel_12ppi_6", je = "_row_12ppi_17", qe = "_rowLabel_12ppi_32", We = "_colon_12ppi_47", Oe = "_rowContent_12ppi_51", Ge = "_rowExtra_12ppi_61", He = "_option_12ppi_71", Ve = "_selectedEmpty_12ppi_103", Ye = "_selectedTag_12ppi_109", Ke = "_selectedText_12ppi_124", Ue = "_selectedRemove_12ppi_131", Xe = "_clearButton_12ppi_145", Je = "_selectText_12ppi_160", Qe = "_selectTextLabel_12ppi_188", Ze = "_selectTextArrow_12ppi_195", ea = "_menu_12ppi_211", aa = "_rangePanel_12ppi_217", ta = "_rangePresets_12ppi_224", sa = "_rangePreset_12ppi_224", la = "_rangeCustom_12ppi_254", ra = "_rangeDash_12ppi_262", na = "_rangeFooter_12ppi_266", oa = "_capsules_12ppi_274", ca = "_capsule_12ppi_274", ia = "_sortBar_12ppi_314", da = "_sortLabel_12ppi_328", _a = "_sortItem_12ppi_336", ua = "_sortArrow_12ppi_359", _ = {
246
- panel: De,
247
- row: je,
248
- rowLabel: qe,
249
- colon: We,
250
- rowContent: Oe,
251
- rowExtra: Ge,
252
- option: He,
253
- selectedEmpty: Ve,
254
- selectedTag: Ye,
255
- selectedText: Ke,
256
- selectedRemove: Ue,
257
- clearButton: Xe,
258
- selectText: Je,
259
- selectTextLabel: Qe,
260
- selectTextArrow: Ze,
261
- menu: ea,
262
- rangePanel: aa,
263
- rangePresets: ta,
264
- rangePreset: sa,
265
- rangeCustom: la,
266
- rangeDash: ra,
267
- rangeFooter: na,
268
- capsules: oa,
269
- capsule: ca,
270
- sortBar: ia,
271
- sortLabel: da,
272
- sortItem: _a,
273
- sortArrow: ua
274
- }, Va = ({ children: e, ariaLabel: t = "筛选条件" }) => /* @__PURE__ */ a("div", { className: _.panel, role: "group", "aria-label": t, children: e }), Y = ({ label: e, children: t, extra: s }) => /* @__PURE__ */ u("div", { className: _.row, role: "group", "aria-label": e, children: [
275
- /* @__PURE__ */ u("div", { className: _.rowLabel, "aria-hidden": "true", children: [
276
- e,
277
- /* @__PURE__ */ a("span", { className: _.colon, children: ":" })
278
- ] }),
279
- /* @__PURE__ */ a("div", { className: _.rowContent, children: t }),
280
- s ? /* @__PURE__ */ a("div", { className: _.rowExtra, children: s }) : null
281
- ] }), Ya = ({ label: e, value: t, options: s, onChange: n }) => /* @__PURE__ */ a(Y, { label: e, children: s.map((l) => /* @__PURE__ */ a(
282
- ma,
283
- {
284
- label: l.label,
285
- active: l.value === t,
286
- onClick: () => n(l.value === t ? "" : l.value)
287
- },
288
- l.value
289
- )) }), ma = ({
290
- label: e,
291
- active: t,
292
- onClick: s
293
- }) => /* @__PURE__ */ a(
294
- f,
295
- {
296
- theme: "borderless",
297
- type: "primary",
298
- className: _.option,
299
- "data-active": t ? "true" : "false",
300
- "aria-pressed": t,
301
- onClick: s,
302
- children: e
303
- }
304
- ), Ka = ({
305
- conditions: e,
306
- onClear: t
307
- }) => /* @__PURE__ */ a(Y, { label: "已选条件", children: e.length === 0 ? /* @__PURE__ */ a("span", { className: _.selectedEmpty, children: "未选择,点选下方条件即可筛选" }) : /* @__PURE__ */ u(P, { children: [
308
- e.map((s) => /* @__PURE__ */ u("span", { className: _.selectedTag, children: [
309
- /* @__PURE__ */ a("span", { className: _.selectedText, children: s.label }),
310
- /* @__PURE__ */ a(
311
- f,
312
- {
313
- theme: "borderless",
314
- type: "primary",
315
- size: "small",
316
- className: _.selectedRemove,
317
- icon: /* @__PURE__ */ a(W, { "aria-hidden": "true" }),
318
- "aria-label": `移除 ${s.label}`,
319
- onClick: s.onRemove
320
- }
321
- )
322
- ] }, s.key)),
323
- /* @__PURE__ */ a(f, { theme: "borderless", type: "primary", size: "small", className: _.clearButton, icon: /* @__PURE__ */ a(Z, { "aria-hidden": "true" }), onClick: t, children: "清空" })
324
- ] }) }), I = "__all__", Ua = ({ placeholder: e, label: t, value: s, options: n, onChange: l }) => {
325
- const [r, c] = S(!1), o = n.find((i) => i.value === s);
326
- return /* @__PURE__ */ a(
327
- B,
328
- {
329
- trigger: "click",
330
- position: "bottomLeft",
331
- visible: r,
332
- onVisibleChange: c,
333
- render: /* @__PURE__ */ a(B.Menu, { className: _.menu, children: [{ value: I, label: e }, ...n].map((i) => /* @__PURE__ */ a(
334
- B.Item,
335
- {
336
- active: i.value === (s || I),
337
- onClick: () => {
338
- c(!1), l(i.value === I ? "" : i.value);
339
- },
340
- children: i.label
341
- },
342
- i.value
343
- )) }),
344
- children: /* @__PURE__ */ a(
345
- R,
346
- {
347
- text: (o == null ? void 0 : o.label) ?? e,
348
- ariaLabel: `${t}:${(o == null ? void 0 : o.label) ?? "不限"}`,
349
- active: !!o,
350
- open: r
351
- }
352
- )
353
- }
354
- );
355
- }, R = q(
356
- ({ text: e, ariaLabel: t, active: s, open: n, ...l }, r) => /* @__PURE__ */ u(
357
- f,
358
- {
359
- theme: "borderless",
360
- type: "primary",
361
- ...l,
362
- ref: r,
363
- className: _.selectText,
364
- "data-active": s ? "true" : "false",
365
- "data-open": n ? "true" : "false",
366
- "aria-label": t,
367
- children: [
368
- /* @__PURE__ */ a("span", { className: _.selectTextLabel, children: e }),
369
- /* @__PURE__ */ a(G, { className: _.selectTextArrow, "aria-hidden": "true" })
370
- ]
371
- }
372
- )
373
- );
374
- R.displayName = "SelectTextTrigger";
375
- const E = (e, t) => e.min === t.min && e.max === t.max, Xa = ({ label: e, value: t, presets: s, onChange: n, limit: l, unit: r, minOnly: c = !1, format: o }) => {
376
- const [i, h] = S(!1), [m, N] = S(t), b = t.min !== void 0 || t.max !== void 0, y = b ? o(t) : e, v = (d) => {
377
- h(!1), n(d);
378
- }, T = m.min === void 0 && m.max === void 0 || m.min !== void 0 && m.max !== void 0 && m.min > m.max, w = (d) => {
379
- const k = typeof d == "number" ? d : typeof d == "string" && d.trim() !== "" ? Number(d) : NaN;
380
- return Number.isFinite(k) ? Math.round(k) : void 0;
381
- };
382
- return /* @__PURE__ */ a(
383
- X,
384
- {
385
- trigger: "click",
386
- position: "bottomLeft",
387
- visible: i,
388
- onVisibleChange: (d) => {
389
- h(d), d && N(t);
390
- },
391
- content: /* @__PURE__ */ u("div", { className: _.rangePanel, role: "group", "aria-label": e, children: [
392
- /* @__PURE__ */ a("div", { className: _.rangePresets, children: s.map((d) => /* @__PURE__ */ a(
393
- f,
394
- {
395
- theme: "borderless",
396
- type: "primary",
397
- className: _.rangePreset,
398
- "data-active": E(d, t) ? "true" : "false",
399
- "aria-pressed": E(d, t),
400
- onClick: () => v(E(d, t) ? {} : { min: d.min, max: d.max }),
401
- children: d.label
402
- },
403
- d.label
404
- )) }),
405
- /* @__PURE__ */ u("div", { className: _.rangeCustom, children: [
406
- /* @__PURE__ */ a(
407
- M,
408
- {
409
- size: "small",
410
- "aria-label": c ? `${e}不低于` : `${e}最小值`,
411
- placeholder: c ? "不低于" : "最小",
412
- min: 0,
413
- max: l,
414
- precision: 0,
415
- suffix: r,
416
- value: m.min,
417
- onChange: (d) => N((k) => ({ ...k, min: w(d) }))
418
- }
419
- ),
420
- c ? null : /* @__PURE__ */ u(P, { children: [
421
- /* @__PURE__ */ a("span", { className: _.rangeDash, children: "–" }),
422
- /* @__PURE__ */ a(
423
- M,
424
- {
425
- size: "small",
426
- "aria-label": `${e}最大值`,
427
- placeholder: "最大",
428
- min: 0,
429
- max: l,
430
- precision: 0,
431
- suffix: r,
432
- value: m.max,
433
- onChange: (d) => N((k) => ({ ...k, max: w(d) }))
434
- }
435
- )
436
- ] })
437
- ] }),
438
- /* @__PURE__ */ u("div", { className: _.rangeFooter, children: [
439
- /* @__PURE__ */ a(f, { theme: "light", type: "tertiary", size: "small", disabled: !b, onClick: () => v({}), children: "清除" }),
440
- /* @__PURE__ */ a(f, { theme: "solid", type: "primary", size: "small", disabled: T, onClick: () => v(m), children: "确定" })
441
- ] })
442
- ] }),
443
- children: /* @__PURE__ */ a(R, { text: y, ariaLabel: `${e}:${b ? y : "不限"}`, active: b, open: i })
444
- }
445
- );
446
- }, Ja = ({ label: e, value: t, options: s, onChange: n, size: l = "default" }) => /* @__PURE__ */ a("div", { className: _.capsules, role: "radiogroup", "aria-label": e, "data-size": l, children: s.map((r) => {
447
- const c = r.value === t;
448
- return /* @__PURE__ */ a(
449
- f,
450
- {
451
- theme: "borderless",
452
- type: "primary",
453
- role: "radio",
454
- "aria-checked": c,
455
- className: _.capsule,
456
- "data-active": c ? "true" : "false",
457
- "data-danger": r.danger ? "true" : void 0,
458
- onClick: () => n(r.value),
459
- children: r.label
460
- },
461
- r.value
462
- );
463
- }) }), Qa = ({ value: e, options: t, onChange: s, plain: n = [], disabled: l = !1 }) => /* @__PURE__ */ u("div", { className: _.sortBar, role: "radiogroup", "aria-label": "排序", children: [
464
- /* @__PURE__ */ a("span", { className: _.sortLabel, "aria-hidden": "true", children: "排序:" }),
465
- t.map((r) => {
466
- const c = r.value === e;
467
- return /* @__PURE__ */ u(
468
- f,
469
- {
470
- theme: "borderless",
471
- type: "primary",
472
- role: "radio",
473
- "aria-checked": c,
474
- disabled: l,
475
- className: _.sortItem,
476
- "data-active": c ? "true" : "false",
477
- onClick: () => s(r.value),
478
- children: [
479
- r.label,
480
- n.includes(r.value) ? null : /* @__PURE__ */ a(ee, { className: _.sortArrow, "aria-hidden": "true" })
481
- ]
482
- },
483
- r.value
484
- );
485
- })
486
- ] }), ha = "_toolbar_o0ggg_3", pa = "_row_o0ggg_9", ga = "_controls_o0ggg_17", fa = "_search_o0ggg_25", va = "_filters_o0ggg_30", ba = "_actions_o0ggg_42", Na = "_selection_o0ggg_50", ya = "_selectionMain_o0ggg_59", wa = "_selectionExtra_o0ggg_60", xa = "_selectionCount_o0ggg_67", Ca = "_selectionNumber_o0ggg_72", Ta = "_tableScroll_o0ggg_78", g = {
487
- toolbar: ha,
488
- row: pa,
489
- controls: ga,
490
- search: fa,
491
- filters: va,
492
- actions: ba,
493
- selection: Na,
494
- selectionMain: ya,
495
- selectionExtra: wa,
496
- selectionCount: xa,
497
- selectionNumber: Ca,
498
- tableScroll: Ta
499
- }, Za = ({ search: e, filters: t, onReset: s, resetDisabled: n = !1, onRefresh: l, refreshing: r = !1, actions: c, extra: o, className: i }) => /* @__PURE__ */ u("div", { className: i ? `${g.toolbar} ${i}` : g.toolbar, children: [
500
- /* @__PURE__ */ u("div", { className: g.row, role: "toolbar", "aria-label": "搜索与筛选", children: [
501
- /* @__PURE__ */ u("div", { className: g.controls, children: [
502
- e ? /* @__PURE__ */ a(
503
- D,
504
- {
505
- className: g.search,
506
- prefix: /* @__PURE__ */ a(O, { "aria-hidden": "true" }),
507
- showClear: !0,
508
- placeholder: e.placeholder ?? "搜索",
509
- "aria-label": e.ariaLabel ?? e.placeholder ?? "搜索",
510
- value: e.value,
511
- onChange: e.onChange,
512
- onEnterPress: () => {
513
- var h;
514
- return (h = e.onSearch) == null ? void 0 : h.call(e, e.value);
515
- },
516
- onClear: () => {
517
- var h;
518
- return (h = e.onSearch) == null ? void 0 : h.call(e, "");
519
- }
520
- }
521
- ) : null,
522
- t ? /* @__PURE__ */ a("div", { className: g.filters, children: t }) : null,
523
- s ? /* @__PURE__ */ a(f, { theme: "light", type: "tertiary", icon: /* @__PURE__ */ a(ae, { "aria-hidden": "true" }), disabled: n, onClick: s, children: "重置" }) : null
524
- ] }),
525
- l || c ? /* @__PURE__ */ u("div", { className: g.actions, children: [
526
- l ? /* @__PURE__ */ a(f, { theme: "light", type: "tertiary", icon: /* @__PURE__ */ a(te, { "aria-hidden": "true" }), loading: r, onClick: l, children: "刷新" }) : null,
527
- c
528
- ] }) : null
529
- ] }),
530
- o
531
- ] }), et = ({ count: e, unit: t = "项", actions: s, extra: n, className: l }) => /* @__PURE__ */ u("div", { className: l ? `${g.selection} ${l}` : g.selection, children: [
532
- /* @__PURE__ */ u("div", { className: g.selectionMain, children: [
533
- /* @__PURE__ */ u("span", { className: g.selectionCount, "aria-live": "polite", children: [
534
- "已选择 ",
535
- /* @__PURE__ */ a("span", { className: g.selectionNumber, children: e }),
536
- " ",
537
- t
538
- ] }),
539
- s
540
- ] }),
541
- n ? /* @__PURE__ */ a("div", { className: g.selectionExtra, children: n }) : null
542
- ] }), at = ({ minWidth: e, children: t, className: s }) => /* @__PURE__ */ a("div", { className: s ? `${g.tableScroll} ${s}` : g.tableScroll, children: /* @__PURE__ */ a("div", { style: { minWidth: e }, children: t }) }), ka = "_waterfall_3uefs_3", La = "_column_3uefs_9", Ba = "_item_3uefs_17", F = {
543
- waterfall: ka,
544
- column: La,
545
- item: Ba
546
- }, Sa = (e, t) => {
547
- const s = Math.max(1, Math.floor(t)), n = Array.from({ length: s }, () => []), l = new Array(s).fill(0);
548
- return e.forEach((r, c) => {
549
- let o = 0;
550
- for (let i = 1; i < s; i += 1)
551
- l[i] < l[o] && (o = i);
552
- n[o].push(c), l[o] += r;
553
- }), n;
554
- }, $a = 5, Aa = (e, t) => {
555
- const s = e <= se.phone ? 10 : 20, n = Math.min($a, Math.max(2, Math.floor((e + s) / (t + s))));
556
- return { columns: n, gap: s, columnWidth: (e - s * (n - 1)) / n };
557
- }, Ia = 1100, Ea = () => {
558
- const e = L(null), [t, s] = S(0);
559
- return J(() => {
560
- const n = e.current;
561
- if (!n || (s(n.clientWidth), typeof ResizeObserver > "u")) return;
562
- const l = new ResizeObserver(([r]) => s(Math.round(r.contentRect.width)));
563
- return l.observe(n), () => l.disconnect();
564
- }, []), [e, t];
565
- }, tt = ({
566
- items: e,
567
- getKey: t,
568
- estimateHeight: s,
569
- renderItem: n,
570
- minColumnWidth: l = 184,
571
- ariaLabel: r
572
- }) => {
573
- const [c, o] = Ea(), i = Aa(o || Ia, l), h = Sa(
574
- e.map((m) => s(m, i.columnWidth)),
575
- i.columns
576
- );
577
- return /* @__PURE__ */ a(
578
- "div",
579
- {
580
- ref: c,
581
- className: F.waterfall,
582
- role: "list",
583
- "aria-label": r,
584
- style: { "--waterfall-gap": `${i.gap}px` },
585
- children: h.map((m, N) => /* @__PURE__ */ a("div", { className: F.column, children: m.map((b) => /* @__PURE__ */ a("div", { role: "listitem", className: F.item, children: n(e[b]) }, t(e[b]))) }, N))
586
- }
587
- );
588
- };
589
- export {
590
- Da as C,
591
- Ja as F,
592
- Za as L,
593
- $a as M,
594
- et as S,
595
- at as T,
596
- tt as W,
597
- ja as a,
598
- Oa as b,
599
- Ha as c,
600
- ma as d,
601
- Ya as e,
602
- Va as f,
603
- Xa as g,
604
- Y as h,
605
- Ua as i,
606
- Ka as j,
607
- V as k,
608
- Qa as l,
609
- Wa as m,
610
- Ga as n,
611
- qa as o,
612
- Sa as p,
613
- Aa as w
614
- };