@24city/web-console 0.3.8 → 0.3.10

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.
@@ -0,0 +1,753 @@
1
+ import { jsx as a, jsxs as m, Fragment as W } from "react/jsx-runtime";
2
+ import { RadioGroup as Q, Radio as Z, Typography as I, Skeleton as $, Input as j, Button as N, Dropdown as S, Popover as ee, InputNumber as D } from "@douyinfe/semi-ui";
3
+ import { useRef as k, useLayoutEffect as O, useEffect as M, useState as A, forwardRef as H } from "react";
4
+ import { IconClose as G, IconSearch as z, IconTick as ae, IconChevronDown as V, IconDelete as te, IconArrowDown as re, IconUndo as se, IconRefresh as le } from "@douyinfe/semi-icons";
5
+ import { B as ne } from "./scale-smFifpMm.js";
6
+ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11", de = "_radio_1f0zj_28", ue = "_card_1f0zj_62", _e = "_title_1f0zj_90", me = "_description_1f0zj_101", B = {
7
+ group: ce,
8
+ loading: oe,
9
+ skeleton: ie,
10
+ radio: de,
11
+ card: ue,
12
+ title: _e,
13
+ description: me
14
+ }, K = (e) => ({ "--choice-columns": e }), st = ({
15
+ ariaLabel: e,
16
+ value: r,
17
+ options: t,
18
+ onChange: n,
19
+ columns: l = 4
20
+ }) => /* @__PURE__ */ a("div", { role: "radiogroup", "aria-label": e, children: /* @__PURE__ */ a(
21
+ Q,
22
+ {
23
+ name: e,
24
+ className: B.group,
25
+ style: K(l),
26
+ value: r,
27
+ onChange: (c) => n(c.target.value),
28
+ children: t.map((c) => {
29
+ const u = c.unavailable ?? c.description, i = c.value === r;
30
+ return /* @__PURE__ */ a(Z, { value: c.value, className: B.radio, children: /* @__PURE__ */ m("span", { className: B.card, "data-checked": i ? "true" : "false", "data-unavailable": c.unavailable ? "true" : void 0, children: [
31
+ /* @__PURE__ */ a(I.Text, { className: B.title, children: c.title }),
32
+ u ? /* @__PURE__ */ a(I.Text, { className: B.description, ellipsis: !0, children: u }) : null
33
+ ] }) }, c.value || "all");
34
+ })
35
+ }
36
+ ) }), lt = ({ count: e, columns: r = 4 }) => /* @__PURE__ */ a("div", { className: B.loading, style: K(r), "aria-busy": "true", children: Array.from({ length: e }, (t, n) => /* @__PURE__ */ a($, { loading: !0, active: !0, className: B.skeleton, placeholder: /* @__PURE__ */ a($.Paragraph, { rows: 2 }) }, n)) }), he = "_square_p43r8_9", ge = "_hiddenTitle_p43r8_28", pe = "_heroTitle_p43r8_40", fe = "_heroAccent_p43r8_52", be = "_searchBar_p43r8_60", ve = "_searchBox_p43r8_74", ye = "_searchInput_p43r8_80", Ne = "_searchPrefix_p43r8_116", we = "_searchButton_p43r8_125", Ce = "_searchTextButton_p43r8_137", xe = "_guide_p43r8_142", Te = "_guideLabel_p43r8_150", ke = "_guideTag_p43r8_156", Le = "_guideClear_p43r8_176", Be = "_stage_p43r8_5", Ae = "_modeTabs_p43r8_190", Se = "_modeTab_p43r8_190", Ie = "_keycap_p43r8_295", $e = "_categories_p43r8_318", Fe = "_panel_p43r8_323", Ee = "_nav_p43r8_330", Re = "_filters_p43r8_373", Pe = "_toolbarStart_p43r8_393", ze = "_filtersGroup_p43r8_400", Me = "_results_p43r8_408", qe = "_footer_p43r8_417", p = {
37
+ square: he,
38
+ hiddenTitle: ge,
39
+ heroTitle: pe,
40
+ heroAccent: fe,
41
+ searchBar: be,
42
+ searchBox: ve,
43
+ searchInput: ye,
44
+ searchPrefix: Ne,
45
+ searchButton: we,
46
+ searchTextButton: Ce,
47
+ guide: xe,
48
+ guideLabel: Te,
49
+ guideTag: ke,
50
+ guideClear: Le,
51
+ stage: Be,
52
+ modeTabs: Ae,
53
+ modeTab: Se,
54
+ keycap: Ie,
55
+ categories: $e,
56
+ panel: Fe,
57
+ nav: Ee,
58
+ filters: Re,
59
+ toolbarStart: Pe,
60
+ filtersGroup: ze,
61
+ results: Me,
62
+ footer: qe
63
+ }, De = (e, r, t) => {
64
+ M(() => {
65
+ const n = e.current, l = r.current, c = t.current;
66
+ if (!n || !l || !c) return;
67
+ let u = 0;
68
+ const i = () => {
69
+ u = 0;
70
+ const _ = Number.parseFloat(getComputedStyle(n).getPropertyValue("--app-header-height")) || 0, s = l.getBoundingClientRect().top, h = s + window.scrollY - _, g = h > 0 ? Math.min(1, Math.max(0, window.scrollY / h)) : 1;
71
+ n.style.setProperty("--hero-progress", g.toFixed(3));
72
+ const b = Number.parseFloat(getComputedStyle(c).top);
73
+ n.dataset.stuck = Number.isFinite(b) && s < b - 0.5 ? "true" : "false";
74
+ }, o = () => {
75
+ u || (u = window.requestAnimationFrame(i));
76
+ };
77
+ return i(), window.addEventListener("scroll", o, { passive: !0 }), window.addEventListener("resize", o), () => {
78
+ window.removeEventListener("scroll", o), window.removeEventListener("resize", o), window.cancelAnimationFrame(u);
79
+ };
80
+ }, [e, r, t]);
81
+ }, nt = ({
82
+ ariaLabel: e,
83
+ placeholder: r,
84
+ value: t,
85
+ onChange: n,
86
+ onSearch: l,
87
+ inputRef: c,
88
+ keyShortcut: u,
89
+ guide: i,
90
+ prefix: o,
91
+ modes: _,
92
+ buttonText: s
93
+ }) => {
94
+ var C;
95
+ const h = !t && i && i.items.length > 0, g = !!(_ || s), b = /* @__PURE__ */ a(
96
+ j,
97
+ {
98
+ ref: c,
99
+ className: p.searchInput,
100
+ "aria-label": e,
101
+ "aria-keyshortcuts": u,
102
+ showClear: !0,
103
+ maxLength: 80,
104
+ placeholder: r,
105
+ value: t,
106
+ onChange: n,
107
+ onEnterPress: () => l(t),
108
+ onClear: () => l(""),
109
+ prefix: o ? /* @__PURE__ */ a("span", { className: p.searchPrefix, children: o }) : void 0,
110
+ suffix: /* @__PURE__ */ m(W, { children: [
111
+ h ? /* @__PURE__ */ m("span", { className: p.guide, role: "group", "aria-label": i.label, children: [
112
+ /* @__PURE__ */ a(I.Text, { className: p.guideLabel, children: i.label }),
113
+ i.items.map((y) => /* @__PURE__ */ a(N, { theme: "light", type: "tertiary", size: "small", className: p.guideTag, onClick: () => l(y), children: y }, y)),
114
+ i.onClear ? /* @__PURE__ */ a(
115
+ N,
116
+ {
117
+ theme: "borderless",
118
+ type: "primary",
119
+ size: "small",
120
+ className: p.guideClear,
121
+ icon: /* @__PURE__ */ a(G, { "aria-hidden": "true" }),
122
+ "aria-label": `清空${i.label}`,
123
+ onClick: i.onClear
124
+ }
125
+ ) : null
126
+ ] }) : null,
127
+ g && u && !t ? /* @__PURE__ */ a("span", { className: p.keycap, "aria-hidden": "true", children: u }) : null,
128
+ s ? /* @__PURE__ */ a(
129
+ N,
130
+ {
131
+ theme: "solid",
132
+ type: "primary",
133
+ className: p.searchTextButton,
134
+ icon: /* @__PURE__ */ a(z, { "aria-hidden": "true" }),
135
+ onClick: () => l(t),
136
+ children: s
137
+ }
138
+ ) : /* @__PURE__ */ a(
139
+ N,
140
+ {
141
+ theme: "solid",
142
+ type: "primary",
143
+ className: p.searchButton,
144
+ icon: /* @__PURE__ */ a(z, { "aria-hidden": "true" }),
145
+ "aria-label": "检索",
146
+ onClick: () => l(t)
147
+ }
148
+ )
149
+ ] })
150
+ }
151
+ );
152
+ if (!g) return b;
153
+ const v = _ !== void 0 && ((C = _.options[0]) == null ? void 0 : C.value) === _.value;
154
+ return /* @__PURE__ */ m("div", { className: p.stage, "data-modes": _ ? "true" : void 0, "data-first-mode": v ? "true" : void 0, children: [
155
+ _ ? /* @__PURE__ */ a("div", { className: p.modeTabs, role: "radiogroup", "aria-label": _.label, "data-square-modes": "", children: _.options.map((y) => {
156
+ const d = y.value === _.value;
157
+ return /* @__PURE__ */ a(
158
+ N,
159
+ {
160
+ theme: "borderless",
161
+ type: "tertiary",
162
+ role: "radio",
163
+ "aria-checked": d,
164
+ className: p.modeTab,
165
+ "data-active": d ? "true" : "false",
166
+ onClick: () => _.onChange(y.value),
167
+ children: y.label
168
+ },
169
+ y.value
170
+ );
171
+ }) }) : null,
172
+ b
173
+ ] });
174
+ }, ct = ({ children: e }) => /* @__PURE__ */ a("span", { className: p.heroAccent, children: e }), ot = ({
175
+ testId: e,
176
+ title: r,
177
+ nav: t,
178
+ search: n,
179
+ categories: l,
180
+ filters: c,
181
+ toolbarLeft: u,
182
+ toolbarRight: i,
183
+ conditionKey: o,
184
+ children: _
185
+ }) => {
186
+ const s = k(null), h = k(null), g = k(null), b = k(null), v = k(null);
187
+ De(s, h, g), O(() => {
188
+ const y = s.current, d = g.current;
189
+ if (!y || !d) return;
190
+ const x = d.querySelector("[data-square-modes]") ? "true" : "false";
191
+ y.dataset.modes !== x && (y.dataset.modes = x);
192
+ });
193
+ const C = k(o);
194
+ return M(() => {
195
+ if (C.current === o) return;
196
+ C.current = o;
197
+ const y = v.current, d = b.current;
198
+ if (!y || !d) return;
199
+ const x = y.getBoundingClientRect().top - d.getBoundingClientRect().bottom;
200
+ x < 0 && window.scrollBy({ top: x });
201
+ }, [o]), /* @__PURE__ */ m(
202
+ "section",
203
+ {
204
+ ref: s,
205
+ className: p.square,
206
+ "data-testid": e,
207
+ "data-categories": l ? "true" : "false",
208
+ "data-filters": c ? "true" : "false",
209
+ "data-nav": t ? "true" : "false",
210
+ children: [
211
+ r ? /* @__PURE__ */ a(I.Title, { heading: 1, className: t ? p.hiddenTitle : p.heroTitle, children: r }) : null,
212
+ t ? /* @__PURE__ */ a("div", { className: p.nav, children: t }) : null,
213
+ /* @__PURE__ */ a("div", { ref: h, "aria-hidden": "true" }),
214
+ /* @__PURE__ */ a("div", { ref: g, className: p.searchBar, children: /* @__PURE__ */ a("div", { className: p.searchBox, children: n }) }),
215
+ l ? /* @__PURE__ */ a("div", { className: p.categories, children: l }) : null,
216
+ c ? /* @__PURE__ */ a("div", { className: p.panel, children: c }) : null,
217
+ /* @__PURE__ */ m("div", { ref: b, className: p.filters, role: "toolbar", "aria-label": "排序与视图", children: [
218
+ /* @__PURE__ */ a("div", { className: p.toolbarStart, children: u }),
219
+ /* @__PURE__ */ a("div", { className: p.filtersGroup, children: i })
220
+ ] }),
221
+ /* @__PURE__ */ a("div", { ref: v, className: p.results, children: _ })
222
+ ]
223
+ }
224
+ );
225
+ }, it = ({ children: e, footerRef: r }) => /* @__PURE__ */ a("div", { ref: r, className: p.footer, children: e }), We = "_tabs_d9vgt_7", je = "_tab_d9vgt_7", Oe = "_fan_d9vgt_114", He = "_cover_d9vgt_122", Ge = "_coverImage_d9vgt_155", Ve = "_text_d9vgt_190", Ke = "_label_d9vgt_197", Ye = "_hint_d9vgt_222", Ue = "_skeletonLabel_d9vgt_262", T = {
226
+ tabs: We,
227
+ tab: je,
228
+ fan: Oe,
229
+ cover: He,
230
+ coverImage: Ge,
231
+ text: Ve,
232
+ label: Ke,
233
+ hint: Ye,
234
+ skeletonLabel: Ue
235
+ }, Xe = 3, Y = (e) => ({ "--cover-tab-count": e }), Je = ({ src: e }) => {
236
+ const [r, t] = A(), [n, l] = A();
237
+ return /* @__PURE__ */ a("span", { className: T.cover, "data-loaded": e && r === e ? "true" : void 0, children: e && n !== e ? /* @__PURE__ */ a(
238
+ "img",
239
+ {
240
+ className: T.coverImage,
241
+ src: e,
242
+ alt: "",
243
+ loading: "lazy",
244
+ decoding: "async",
245
+ draggable: !1,
246
+ onLoad: () => t(e),
247
+ onError: () => l(e)
248
+ }
249
+ ) : null });
250
+ }, U = ({ covers: e }) => /* @__PURE__ */ a("span", { className: T.fan, "aria-hidden": "true", children: Array.from({ length: Xe }, (r, t) => /* @__PURE__ */ a(Je, { src: e == null ? void 0 : e[t] }, t)) }), dt = ({ ariaLabel: e, value: r, options: t, onChange: n }) => {
251
+ var _;
252
+ const l = k(null);
253
+ M(() => {
254
+ const s = l.current, h = s == null ? void 0 : s.querySelector('[aria-selected="true"]');
255
+ !s || !h || s.scrollWidth <= s.clientWidth || (s.scrollLeft = h.offsetLeft - (s.clientWidth - h.offsetWidth) / 2);
256
+ }, [r]);
257
+ const c = t.some((s) => s.value === r) ? r : (_ = t[0]) == null ? void 0 : _.value, u = (s) => s.unavailable || s.description, i = t.some((s) => s.description) ? "2" : t.some((s) => s.unavailable) ? "1" : void 0, o = (s, h) => {
258
+ var v, C;
259
+ const g = t.length - 1, b = s.key === "ArrowRight" || s.key === "ArrowDown" ? h === g ? 0 : h + 1 : s.key === "ArrowLeft" || s.key === "ArrowUp" ? h === 0 ? g : h - 1 : s.key === "Home" ? 0 : s.key === "End" ? g : -1;
260
+ b < 0 || (s.preventDefault(), (C = (v = l.current) == null ? void 0 : v.querySelectorAll('[role="tab"]')[b]) == null || C.focus());
261
+ };
262
+ return /* @__PURE__ */ a(
263
+ "div",
264
+ {
265
+ ref: l,
266
+ role: "tablist",
267
+ "aria-label": e,
268
+ className: T.tabs,
269
+ "data-dense": t.length > 4 ? "true" : void 0,
270
+ "data-note-lines": i,
271
+ style: Y(t.length),
272
+ children: t.map((s, h) => {
273
+ const g = s.value === r, b = u(s);
274
+ return /* @__PURE__ */ m(
275
+ N,
276
+ {
277
+ theme: "borderless",
278
+ type: "tertiary",
279
+ role: "tab",
280
+ "aria-selected": g,
281
+ "aria-label": b ? `${s.label},${b}` : void 0,
282
+ tabIndex: s.value === c ? 0 : -1,
283
+ className: T.tab,
284
+ "data-active": g ? "true" : "false",
285
+ "data-unavailable": s.unavailable ? "true" : void 0,
286
+ onClick: () => n(s.value),
287
+ onKeyDown: (v) => o(v, h),
288
+ children: [
289
+ /* @__PURE__ */ a(U, { covers: s.covers }),
290
+ /* @__PURE__ */ m("span", { className: T.text, children: [
291
+ /* @__PURE__ */ a("span", { className: T.label, children: s.label }),
292
+ b ? /* @__PURE__ */ a("span", { className: T.hint, title: s.unavailable ? void 0 : s.description, children: b }) : null
293
+ ] })
294
+ ]
295
+ },
296
+ s.value
297
+ );
298
+ })
299
+ }
300
+ );
301
+ }, ut = ({ count: e, active: r = !0 }) => /* @__PURE__ */ a("div", { className: T.tabs, "data-dense": e > 4 ? "true" : void 0, style: Y(e), "aria-busy": r ? "true" : void 0, children: Array.from({ length: e }, (t, n) => /* @__PURE__ */ m("span", { className: T.tab, "data-skeleton": "true", children: [
302
+ /* @__PURE__ */ a(U, {}),
303
+ /* @__PURE__ */ a($, { loading: !0, active: r, placeholder: /* @__PURE__ */ a($.Title, { className: T.skeletonLabel }) })
304
+ ] }, n)) }), Qe = "_trigger_iy209_3", Ze = "_text_iy209_27", ea = "_prefix_iy209_32", aa = "_arrow_iy209_50", ta = "_menu_iy209_60", ra = "_checkItem_iy209_64", sa = "_check_iy209_64", la = "_checkHidden_iy209_75", L = {
305
+ trigger: Qe,
306
+ text: Ze,
307
+ prefix: ea,
308
+ arrow: aa,
309
+ menu: ta,
310
+ checkItem: ra,
311
+ check: sa,
312
+ checkHidden: la
313
+ }, X = H(
314
+ ({ text: e, ariaLabel: r, active: t = !1, empty: n = !1, icon: l, arrow: c = !0, pressed: u, onClick: i, ...o }, _) => /* @__PURE__ */ m(
315
+ N,
316
+ {
317
+ theme: "borderless",
318
+ type: "primary",
319
+ ...o,
320
+ ref: _,
321
+ className: L.trigger,
322
+ "data-active": t ? "true" : "false",
323
+ "data-empty": n ? "true" : "false",
324
+ "aria-label": r,
325
+ "aria-pressed": u,
326
+ onClick: i,
327
+ children: [
328
+ l ? /* @__PURE__ */ a("span", { className: L.prefix, children: l }) : null,
329
+ /* @__PURE__ */ a("span", { className: L.text, children: e }),
330
+ c ? /* @__PURE__ */ a(V, { className: L.arrow, "aria-hidden": "true" }) : null
331
+ ]
332
+ }
333
+ )
334
+ );
335
+ X.displayName = "FilterTrigger";
336
+ const F = "__all__", _t = ({
337
+ label: e,
338
+ placeholder: r,
339
+ value: t,
340
+ options: n,
341
+ onChange: l,
342
+ allLabel: c,
343
+ icon: u,
344
+ arrow: i = !0,
345
+ checkmark: o = !1,
346
+ position: _ = "bottomLeft",
347
+ disabled: s = !1,
348
+ highlight: h = !0
349
+ }) => {
350
+ const [g, b] = A(!1), v = n.find((d) => d.value === t), C = c ? [{ value: F, label: c }, ...n] : n, y = t || (c ? F : "");
351
+ return /* @__PURE__ */ a(
352
+ S,
353
+ {
354
+ trigger: s ? "custom" : "click",
355
+ position: _,
356
+ visible: s ? !1 : g,
357
+ onVisibleChange: b,
358
+ render: /* @__PURE__ */ a(S.Menu, { className: L.menu, children: C.map((d) => /* @__PURE__ */ m(
359
+ S.Item,
360
+ {
361
+ active: d.value === y,
362
+ className: o ? L.checkItem : void 0,
363
+ onClick: () => {
364
+ b(!1), l(d.value === F ? "" : d.value);
365
+ },
366
+ children: [
367
+ o ? /* @__PURE__ */ a(ae, { className: d.value === y ? L.check : L.checkHidden, "aria-hidden": "true" }) : null,
368
+ d.label
369
+ ]
370
+ },
371
+ d.value
372
+ )) }),
373
+ children: /* @__PURE__ */ a(
374
+ X,
375
+ {
376
+ text: (v == null ? void 0 : v.label) ?? r ?? e,
377
+ ariaLabel: `${e}:${(v == null ? void 0 : v.label) ?? c ?? "未选择"}`,
378
+ active: g,
379
+ empty: !v || !h,
380
+ icon: u,
381
+ arrow: i
382
+ }
383
+ )
384
+ }
385
+ );
386
+ }, na = "_panel_1rhpy_7", ca = "_row_1rhpy_18", oa = "_rowLabel_1rhpy_27", ia = "_rowContent_1rhpy_38", da = "_rowExtra_1rhpy_48", ua = "_option_1rhpy_58", _a = "_selectedTag_1rhpy_85", ma = "_selectedText_1rhpy_99", ha = "_selectedRemove_1rhpy_106", ga = "_clearButton_1rhpy_120", pa = "_selectText_1rhpy_135", fa = "_selectTextLabel_1rhpy_163", ba = "_selectTextArrow_1rhpy_170", va = "_menu_1rhpy_186", ya = "_rangePanel_1rhpy_192", Na = "_rangePresets_1rhpy_199", wa = "_rangePreset_1rhpy_199", Ca = "_rangeCustom_1rhpy_229", xa = "_rangeDash_1rhpy_237", Ta = "_rangeFooter_1rhpy_241", ka = "_capsules_1rhpy_249", La = "_capsule_1rhpy_249", Ba = "_sortBar_1rhpy_289", Aa = "_sortLabel_1rhpy_303", Sa = "_sortItem_1rhpy_311", Ia = "_sortArrow_1rhpy_334", f = {
387
+ panel: na,
388
+ row: ca,
389
+ rowLabel: oa,
390
+ rowContent: ia,
391
+ rowExtra: da,
392
+ option: ua,
393
+ selectedTag: _a,
394
+ selectedText: ma,
395
+ selectedRemove: ha,
396
+ clearButton: ga,
397
+ selectText: pa,
398
+ selectTextLabel: fa,
399
+ selectTextArrow: ba,
400
+ menu: va,
401
+ rangePanel: ya,
402
+ rangePresets: Na,
403
+ rangePreset: wa,
404
+ rangeCustom: Ca,
405
+ rangeDash: xa,
406
+ rangeFooter: Ta,
407
+ capsules: ka,
408
+ capsule: La,
409
+ sortBar: Ba,
410
+ sortLabel: Aa,
411
+ sortItem: Sa,
412
+ sortArrow: Ia
413
+ }, mt = ({ children: e, ariaLabel: r = "筛选条件" }) => /* @__PURE__ */ a("div", { className: f.panel, role: "group", "aria-label": r, children: e }), J = ({ label: e, children: r, extra: t }) => /* @__PURE__ */ m("div", { className: f.row, role: "group", "aria-label": e, children: [
414
+ /* @__PURE__ */ a("div", { className: f.rowLabel, "aria-hidden": "true", children: e }),
415
+ /* @__PURE__ */ a("div", { className: f.rowContent, children: r }),
416
+ t ? /* @__PURE__ */ a("div", { className: f.rowExtra, children: t }) : null
417
+ ] }), ht = ({ label: e, value: r, options: t, onChange: n }) => /* @__PURE__ */ a(J, { label: e, children: t.map((l) => /* @__PURE__ */ a(
418
+ $a,
419
+ {
420
+ label: l.label,
421
+ active: l.value === r,
422
+ onClick: () => n(l.value === r ? "" : l.value)
423
+ },
424
+ l.value
425
+ )) }), $a = ({
426
+ label: e,
427
+ active: r,
428
+ onClick: t
429
+ }) => /* @__PURE__ */ a(
430
+ N,
431
+ {
432
+ theme: "borderless",
433
+ type: "primary",
434
+ className: f.option,
435
+ "data-active": r ? "true" : "false",
436
+ "aria-pressed": r,
437
+ onClick: t,
438
+ children: e
439
+ }
440
+ ), gt = ({
441
+ conditions: e,
442
+ onClear: r
443
+ }) => e.length === 0 ? null : /* @__PURE__ */ m(J, { label: "已选条件", children: [
444
+ e.map((t) => /* @__PURE__ */ m("span", { className: f.selectedTag, children: [
445
+ /* @__PURE__ */ a("span", { className: f.selectedText, children: t.label }),
446
+ /* @__PURE__ */ a(
447
+ N,
448
+ {
449
+ theme: "borderless",
450
+ type: "primary",
451
+ size: "small",
452
+ className: f.selectedRemove,
453
+ icon: /* @__PURE__ */ a(G, { "aria-hidden": "true" }),
454
+ "aria-label": `移除 ${t.label}`,
455
+ onClick: t.onRemove
456
+ }
457
+ )
458
+ ] }, t.key)),
459
+ /* @__PURE__ */ a(N, { theme: "borderless", type: "primary", size: "small", className: f.clearButton, icon: /* @__PURE__ */ a(te, { "aria-hidden": "true" }), onClick: r, children: "清空" })
460
+ ] }), E = "__all__", pt = ({ placeholder: e, label: r, value: t, options: n, onChange: l }) => {
461
+ const [c, u] = A(!1), i = n.find((o) => o.value === t);
462
+ return /* @__PURE__ */ a(
463
+ S,
464
+ {
465
+ trigger: "click",
466
+ position: "bottomLeft",
467
+ visible: c,
468
+ onVisibleChange: u,
469
+ render: /* @__PURE__ */ a(S.Menu, { className: f.menu, children: [{ value: E, label: e }, ...n].map((o) => /* @__PURE__ */ a(
470
+ S.Item,
471
+ {
472
+ active: o.value === (t || E),
473
+ onClick: () => {
474
+ u(!1), l(o.value === E ? "" : o.value);
475
+ },
476
+ children: o.label
477
+ },
478
+ o.value
479
+ )) }),
480
+ children: /* @__PURE__ */ a(
481
+ q,
482
+ {
483
+ text: (i == null ? void 0 : i.label) ?? e,
484
+ ariaLabel: `${r}:${(i == null ? void 0 : i.label) ?? "不限"}`,
485
+ active: !!i,
486
+ open: c
487
+ }
488
+ )
489
+ }
490
+ );
491
+ }, q = H(
492
+ ({ text: e, ariaLabel: r, active: t, open: n, ...l }, c) => /* @__PURE__ */ m(
493
+ N,
494
+ {
495
+ theme: "borderless",
496
+ type: "primary",
497
+ ...l,
498
+ ref: c,
499
+ className: f.selectText,
500
+ "data-active": t ? "true" : "false",
501
+ "data-open": n ? "true" : "false",
502
+ "aria-label": r,
503
+ children: [
504
+ /* @__PURE__ */ a("span", { className: f.selectTextLabel, children: e }),
505
+ /* @__PURE__ */ a(V, { className: f.selectTextArrow, "aria-hidden": "true" })
506
+ ]
507
+ }
508
+ )
509
+ );
510
+ q.displayName = "SelectTextTrigger";
511
+ const R = (e, r) => e.min === r.min && e.max === r.max, ft = ({ label: e, value: r, presets: t, onChange: n, limit: l, unit: c, minOnly: u = !1, format: i }) => {
512
+ const [o, _] = A(!1), [s, h] = A(r), g = r.min !== void 0 || r.max !== void 0, b = g ? i(r) : e, v = (d) => {
513
+ _(!1), n(d);
514
+ }, C = s.min === void 0 && s.max === void 0 || s.min !== void 0 && s.max !== void 0 && s.min > s.max, y = (d) => {
515
+ const x = typeof d == "number" ? d : typeof d == "string" && d.trim() !== "" ? Number(d) : NaN;
516
+ return Number.isFinite(x) ? Math.round(x) : void 0;
517
+ };
518
+ return /* @__PURE__ */ a(
519
+ ee,
520
+ {
521
+ trigger: "click",
522
+ position: "bottomLeft",
523
+ visible: o,
524
+ onVisibleChange: (d) => {
525
+ _(d), d && h(r);
526
+ },
527
+ content: /* @__PURE__ */ m("div", { className: f.rangePanel, role: "group", "aria-label": e, children: [
528
+ /* @__PURE__ */ a("div", { className: f.rangePresets, children: t.map((d) => /* @__PURE__ */ a(
529
+ N,
530
+ {
531
+ theme: "borderless",
532
+ type: "primary",
533
+ className: f.rangePreset,
534
+ "data-active": R(d, r) ? "true" : "false",
535
+ "aria-pressed": R(d, r),
536
+ onClick: () => v(R(d, r) ? {} : { min: d.min, max: d.max }),
537
+ children: d.label
538
+ },
539
+ d.label
540
+ )) }),
541
+ /* @__PURE__ */ m("div", { className: f.rangeCustom, children: [
542
+ /* @__PURE__ */ a(
543
+ D,
544
+ {
545
+ size: "small",
546
+ "aria-label": u ? `${e}不低于` : `${e}最小值`,
547
+ placeholder: u ? "不低于" : "最小",
548
+ min: 0,
549
+ max: l,
550
+ precision: 0,
551
+ suffix: c,
552
+ value: s.min,
553
+ onChange: (d) => h((x) => ({ ...x, min: y(d) }))
554
+ }
555
+ ),
556
+ u ? null : /* @__PURE__ */ m(W, { children: [
557
+ /* @__PURE__ */ a("span", { className: f.rangeDash, children: "–" }),
558
+ /* @__PURE__ */ a(
559
+ D,
560
+ {
561
+ size: "small",
562
+ "aria-label": `${e}最大值`,
563
+ placeholder: "最大",
564
+ min: 0,
565
+ max: l,
566
+ precision: 0,
567
+ suffix: c,
568
+ value: s.max,
569
+ onChange: (d) => h((x) => ({ ...x, max: y(d) }))
570
+ }
571
+ )
572
+ ] })
573
+ ] }),
574
+ /* @__PURE__ */ m("div", { className: f.rangeFooter, children: [
575
+ /* @__PURE__ */ a(N, { theme: "light", type: "tertiary", size: "small", disabled: !g, onClick: () => v({}), children: "清除" }),
576
+ /* @__PURE__ */ a(N, { theme: "solid", type: "primary", size: "small", disabled: C, onClick: () => v(s), children: "确定" })
577
+ ] })
578
+ ] }),
579
+ children: /* @__PURE__ */ a(q, { text: b, ariaLabel: `${e}:${g ? b : "不限"}`, active: g, open: o })
580
+ }
581
+ );
582
+ }, bt = ({ label: e, value: r, options: t, onChange: n, size: l = "default" }) => /* @__PURE__ */ a("div", { className: f.capsules, role: "radiogroup", "aria-label": e, "data-size": l, children: t.map((c) => {
583
+ const u = c.value === r;
584
+ return /* @__PURE__ */ a(
585
+ N,
586
+ {
587
+ theme: "borderless",
588
+ type: "primary",
589
+ role: "radio",
590
+ "aria-checked": u,
591
+ className: f.capsule,
592
+ "data-active": u ? "true" : "false",
593
+ "data-danger": c.danger ? "true" : void 0,
594
+ onClick: () => n(c.value),
595
+ children: c.label
596
+ },
597
+ c.value
598
+ );
599
+ }) }), vt = ({ value: e, options: r, onChange: t, plain: n = [], disabled: l = !1 }) => /* @__PURE__ */ m("div", { className: f.sortBar, role: "radiogroup", "aria-label": "排序", children: [
600
+ /* @__PURE__ */ a("span", { className: f.sortLabel, "aria-hidden": "true", children: "排序:" }),
601
+ r.map((c) => {
602
+ const u = c.value === e;
603
+ return /* @__PURE__ */ m(
604
+ N,
605
+ {
606
+ theme: "borderless",
607
+ type: "primary",
608
+ role: "radio",
609
+ "aria-checked": u,
610
+ disabled: l,
611
+ className: f.sortItem,
612
+ "data-active": u ? "true" : "false",
613
+ onClick: () => t(c.value),
614
+ children: [
615
+ c.label,
616
+ n.includes(c.value) ? null : /* @__PURE__ */ a(re, { className: f.sortArrow, "aria-hidden": "true" })
617
+ ]
618
+ },
619
+ c.value
620
+ );
621
+ })
622
+ ] }), Fa = "_toolbar_o0ggg_3", Ea = "_row_o0ggg_9", Ra = "_controls_o0ggg_17", Pa = "_search_o0ggg_25", za = "_filters_o0ggg_30", Ma = "_actions_o0ggg_42", qa = "_selection_o0ggg_50", Da = "_selectionMain_o0ggg_59", Wa = "_selectionExtra_o0ggg_60", ja = "_selectionCount_o0ggg_67", Oa = "_selectionNumber_o0ggg_72", Ha = "_tableScroll_o0ggg_78", w = {
623
+ toolbar: Fa,
624
+ row: Ea,
625
+ controls: Ra,
626
+ search: Pa,
627
+ filters: za,
628
+ actions: Ma,
629
+ selection: qa,
630
+ selectionMain: Da,
631
+ selectionExtra: Wa,
632
+ selectionCount: ja,
633
+ selectionNumber: Oa,
634
+ tableScroll: Ha
635
+ }, yt = ({ search: e, filters: r, onReset: t, resetDisabled: n = !1, onRefresh: l, refreshing: c = !1, actions: u, extra: i, className: o }) => /* @__PURE__ */ m("div", { className: o ? `${w.toolbar} ${o}` : w.toolbar, children: [
636
+ /* @__PURE__ */ m("div", { className: w.row, role: "toolbar", "aria-label": "搜索与筛选", children: [
637
+ /* @__PURE__ */ m("div", { className: w.controls, children: [
638
+ e ? /* @__PURE__ */ a(
639
+ j,
640
+ {
641
+ className: w.search,
642
+ prefix: /* @__PURE__ */ a(z, { "aria-hidden": "true" }),
643
+ showClear: !0,
644
+ placeholder: e.placeholder ?? "搜索",
645
+ "aria-label": e.ariaLabel ?? e.placeholder ?? "搜索",
646
+ value: e.value,
647
+ onChange: e.onChange,
648
+ onEnterPress: () => {
649
+ var _;
650
+ return (_ = e.onSearch) == null ? void 0 : _.call(e, e.value);
651
+ },
652
+ onClear: () => {
653
+ var _;
654
+ return (_ = e.onSearch) == null ? void 0 : _.call(e, "");
655
+ }
656
+ }
657
+ ) : null,
658
+ r ? /* @__PURE__ */ a("div", { className: w.filters, children: r }) : null,
659
+ t ? /* @__PURE__ */ a(N, { theme: "light", type: "tertiary", icon: /* @__PURE__ */ a(se, { "aria-hidden": "true" }), disabled: n, onClick: t, children: "重置" }) : null
660
+ ] }),
661
+ l || u ? /* @__PURE__ */ m("div", { className: w.actions, children: [
662
+ l ? /* @__PURE__ */ a(N, { theme: "light", type: "tertiary", icon: /* @__PURE__ */ a(le, { "aria-hidden": "true" }), loading: c, onClick: l, children: "刷新" }) : null,
663
+ u
664
+ ] }) : null
665
+ ] }),
666
+ i
667
+ ] }), Nt = ({ count: e, unit: r = "项", actions: t, extra: n, className: l }) => /* @__PURE__ */ m("div", { className: l ? `${w.selection} ${l}` : w.selection, children: [
668
+ /* @__PURE__ */ m("div", { className: w.selectionMain, children: [
669
+ /* @__PURE__ */ m("span", { className: w.selectionCount, "aria-live": "polite", children: [
670
+ "已选择 ",
671
+ /* @__PURE__ */ a("span", { className: w.selectionNumber, children: e }),
672
+ " ",
673
+ r
674
+ ] }),
675
+ t
676
+ ] }),
677
+ n ? /* @__PURE__ */ a("div", { className: w.selectionExtra, children: n }) : null
678
+ ] }), wt = ({ minWidth: e, children: r, className: t }) => /* @__PURE__ */ a("div", { className: t ? `${w.tableScroll} ${t}` : w.tableScroll, children: /* @__PURE__ */ a("div", { style: { minWidth: e }, children: r }) }), Ga = "_waterfall_3uefs_3", Va = "_column_3uefs_9", Ka = "_item_3uefs_17", P = {
679
+ waterfall: Ga,
680
+ column: Va,
681
+ item: Ka
682
+ }, Ya = (e, r) => {
683
+ const t = Math.max(1, Math.floor(r)), n = Array.from({ length: t }, () => []), l = new Array(t).fill(0);
684
+ return e.forEach((c, u) => {
685
+ let i = 0;
686
+ for (let o = 1; o < t; o += 1)
687
+ l[o] < l[i] && (i = o);
688
+ n[i].push(u), l[i] += c;
689
+ }), n;
690
+ }, Ua = 5, Xa = (e, r) => {
691
+ const t = e <= ne.phone ? 10 : 20, n = Math.min(Ua, Math.max(2, Math.floor((e + t) / (r + t))));
692
+ return { columns: n, gap: t, columnWidth: (e - t * (n - 1)) / n };
693
+ }, Ja = 1100, Qa = () => {
694
+ const e = k(null), [r, t] = A(0);
695
+ return O(() => {
696
+ const n = e.current;
697
+ if (!n || (t(n.clientWidth), typeof ResizeObserver > "u")) return;
698
+ const l = new ResizeObserver(([c]) => t(Math.round(c.contentRect.width)));
699
+ return l.observe(n), () => l.disconnect();
700
+ }, []), [e, r];
701
+ }, Ct = ({
702
+ items: e,
703
+ getKey: r,
704
+ estimateHeight: t,
705
+ renderItem: n,
706
+ minColumnWidth: l = 184,
707
+ ariaLabel: c
708
+ }) => {
709
+ const [u, i] = Qa(), o = Xa(i || Ja, l), _ = Ya(
710
+ e.map((s) => t(s, o.columnWidth)),
711
+ o.columns
712
+ );
713
+ return /* @__PURE__ */ a(
714
+ "div",
715
+ {
716
+ ref: u,
717
+ className: P.waterfall,
718
+ role: "list",
719
+ "aria-label": c,
720
+ style: { "--waterfall-gap": `${o.gap}px` },
721
+ children: _.map((s, h) => /* @__PURE__ */ a("div", { className: P.column, children: s.map((g) => /* @__PURE__ */ a("div", { role: "listitem", className: P.item, children: n(e[g]) }, r(e[g]))) }, h))
722
+ }
723
+ );
724
+ };
725
+ export {
726
+ Xe as C,
727
+ bt as F,
728
+ yt as L,
729
+ Ua as M,
730
+ Nt as S,
731
+ wt as T,
732
+ Ct as W,
733
+ st as a,
734
+ lt as b,
735
+ ot as c,
736
+ dt as d,
737
+ ut as e,
738
+ _t as f,
739
+ $a as g,
740
+ ht as h,
741
+ mt as i,
742
+ ft as j,
743
+ J as k,
744
+ pt as l,
745
+ gt as m,
746
+ X as n,
747
+ vt as o,
748
+ ct as p,
749
+ it as q,
750
+ nt as r,
751
+ Ya as s,
752
+ Xa as w
753
+ };