@24city/web-console 0.3.8 → 0.3.9
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/CHANGELOG.md +23 -0
- package/GUIDELINES.md +6 -4
- package/dist/chunks/{waterfall-DOeGU8Zs.js → waterfall-Cyw5kl43.js} +170 -170
- package/dist/index.js +1 -1
- package/dist/list/content-square.d.ts +5 -3
- package/dist/list/index.js +1 -1
- package/dist/styles.css +135 -94
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as a, jsxs as m, Fragment as D } from "react/jsx-runtime";
|
|
2
|
-
import { RadioGroup as Q, Radio as Z, Typography as I, Skeleton as $, Input as W, Button as
|
|
2
|
+
import { RadioGroup as Q, Radio as Z, Typography as I, Skeleton as $, Input as W, Button as v, Dropdown as S, Popover as ee, InputNumber as q } from "@douyinfe/semi-ui";
|
|
3
3
|
import { useRef as k, useLayoutEffect as O, useEffect as j, useState as A, forwardRef as H } from "react";
|
|
4
4
|
import { IconClose as G, IconSearch as z, IconTick as ae, IconChevronDown as V, IconDelete as te, IconArrowDown as re, IconUndo as le, IconRefresh as se } from "@douyinfe/semi-icons";
|
|
5
5
|
import { B as ne } from "./scale-smFifpMm.js";
|
|
@@ -26,32 +26,32 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
26
26
|
value: r,
|
|
27
27
|
onChange: (c) => n(c.target.value),
|
|
28
28
|
children: t.map((c) => {
|
|
29
|
-
const
|
|
29
|
+
const u = c.unavailable ?? c.description, o = c.value === r;
|
|
30
30
|
return /* @__PURE__ */ a(Z, { value: c.value, className: B.radio, children: /* @__PURE__ */ m("span", { className: B.card, "data-checked": o ? "true" : "false", "data-unavailable": c.unavailable ? "true" : void 0, children: [
|
|
31
31
|
/* @__PURE__ */ a(I.Text, { className: B.title, children: c.title }),
|
|
32
|
-
|
|
32
|
+
u ? /* @__PURE__ */ a(I.Text, { className: B.description, ellipsis: !0, children: u }) : null
|
|
33
33
|
] }) }, c.value || "all");
|
|
34
34
|
})
|
|
35
35
|
}
|
|
36
|
-
) }), st = ({ 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 = "
|
|
36
|
+
) }), st = ({ 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", pe = "_hiddenTitle_p43r8_28", ge = "_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", je = "_results_p43r8_408", Me = "_footer_p43r8_417", h = {
|
|
37
37
|
square: he,
|
|
38
|
-
hiddenTitle:
|
|
39
|
-
heroTitle:
|
|
38
|
+
hiddenTitle: pe,
|
|
39
|
+
heroTitle: ge,
|
|
40
40
|
heroAccent: fe,
|
|
41
41
|
searchBar: be,
|
|
42
|
-
searchBox:
|
|
43
|
-
searchInput:
|
|
42
|
+
searchBox: ve,
|
|
43
|
+
searchInput: ye,
|
|
44
44
|
searchPrefix: Ne,
|
|
45
45
|
searchButton: we,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
55
|
categories: $e,
|
|
56
56
|
panel: Fe,
|
|
57
57
|
nav: Ee,
|
|
@@ -64,18 +64,18 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
64
64
|
j(() => {
|
|
65
65
|
const n = e.current, s = r.current, c = t.current;
|
|
66
66
|
if (!n || !s || !c) return;
|
|
67
|
-
let
|
|
67
|
+
let u = 0;
|
|
68
68
|
const o = () => {
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
n.style.setProperty("--hero-progress",
|
|
72
|
-
const
|
|
73
|
-
n.dataset.stuck = Number.isFinite(
|
|
69
|
+
u = 0;
|
|
70
|
+
const i = Number.parseFloat(getComputedStyle(n).getPropertyValue("--app-header-height")) || 0, _ = s.getBoundingClientRect().top, b = _ + window.scrollY - i, g = b > 0 ? Math.min(1, Math.max(0, window.scrollY / b)) : 1;
|
|
71
|
+
n.style.setProperty("--hero-progress", g.toFixed(3));
|
|
72
|
+
const y = Number.parseFloat(getComputedStyle(c).top);
|
|
73
|
+
n.dataset.stuck = Number.isFinite(y) && _ < y - 0.5 ? "true" : "false";
|
|
74
74
|
}, l = () => {
|
|
75
|
-
|
|
75
|
+
u || (u = window.requestAnimationFrame(o));
|
|
76
76
|
};
|
|
77
77
|
return o(), window.addEventListener("scroll", l, { passive: !0 }), window.addEventListener("resize", l), () => {
|
|
78
|
-
window.removeEventListener("scroll", l), window.removeEventListener("resize", l), window.cancelAnimationFrame(
|
|
78
|
+
window.removeEventListener("scroll", l), window.removeEventListener("resize", l), window.cancelAnimationFrame(u);
|
|
79
79
|
};
|
|
80
80
|
}, [e, r, t]);
|
|
81
81
|
}, nt = ({
|
|
@@ -85,20 +85,20 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
85
85
|
onChange: n,
|
|
86
86
|
onSearch: s,
|
|
87
87
|
inputRef: c,
|
|
88
|
-
keyShortcut:
|
|
88
|
+
keyShortcut: u,
|
|
89
89
|
guide: o,
|
|
90
90
|
prefix: l,
|
|
91
|
-
modes:
|
|
91
|
+
modes: i,
|
|
92
92
|
buttonText: _
|
|
93
93
|
}) => {
|
|
94
94
|
var T;
|
|
95
|
-
const b = !t && o && o.items.length > 0,
|
|
95
|
+
const b = !t && o && o.items.length > 0, g = !!(i || _), y = /* @__PURE__ */ a(
|
|
96
96
|
W,
|
|
97
97
|
{
|
|
98
98
|
ref: c,
|
|
99
99
|
className: h.searchInput,
|
|
100
100
|
"aria-label": e,
|
|
101
|
-
"aria-keyshortcuts":
|
|
101
|
+
"aria-keyshortcuts": u,
|
|
102
102
|
showClear: !0,
|
|
103
103
|
maxLength: 80,
|
|
104
104
|
placeholder: r,
|
|
@@ -110,9 +110,9 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
110
110
|
suffix: /* @__PURE__ */ m(D, { children: [
|
|
111
111
|
b ? /* @__PURE__ */ m("span", { className: h.guide, role: "group", "aria-label": o.label, children: [
|
|
112
112
|
/* @__PURE__ */ a(I.Text, { className: h.guideLabel, children: o.label }),
|
|
113
|
-
o.items.map((f) => /* @__PURE__ */ a(
|
|
113
|
+
o.items.map((f) => /* @__PURE__ */ a(v, { theme: "light", type: "tertiary", size: "small", className: h.guideTag, onClick: () => s(f), children: f }, f)),
|
|
114
114
|
o.onClear ? /* @__PURE__ */ a(
|
|
115
|
-
|
|
115
|
+
v,
|
|
116
116
|
{
|
|
117
117
|
theme: "borderless",
|
|
118
118
|
type: "primary",
|
|
@@ -124,9 +124,9 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
124
124
|
}
|
|
125
125
|
) : null
|
|
126
126
|
] }) : null,
|
|
127
|
-
|
|
127
|
+
g && u && !t ? /* @__PURE__ */ a("span", { className: h.keycap, "aria-hidden": "true", children: u }) : null,
|
|
128
128
|
_ ? /* @__PURE__ */ a(
|
|
129
|
-
|
|
129
|
+
v,
|
|
130
130
|
{
|
|
131
131
|
theme: "solid",
|
|
132
132
|
type: "primary",
|
|
@@ -136,7 +136,7 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
136
136
|
children: _
|
|
137
137
|
}
|
|
138
138
|
) : /* @__PURE__ */ a(
|
|
139
|
-
|
|
139
|
+
v,
|
|
140
140
|
{
|
|
141
141
|
theme: "solid",
|
|
142
142
|
type: "primary",
|
|
@@ -149,27 +149,27 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
149
149
|
] })
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
|
-
if (!
|
|
153
|
-
const N =
|
|
154
|
-
return /* @__PURE__ */ m("div", { className: h.stage, "data-first-mode": N ? "true" : void 0, children: [
|
|
155
|
-
|
|
156
|
-
const
|
|
152
|
+
if (!g) return y;
|
|
153
|
+
const N = i !== void 0 && ((T = i.options[0]) == null ? void 0 : T.value) === i.value;
|
|
154
|
+
return /* @__PURE__ */ m("div", { className: h.stage, "data-modes": i ? "true" : void 0, "data-first-mode": N ? "true" : void 0, children: [
|
|
155
|
+
i ? /* @__PURE__ */ a("div", { className: h.modeTabs, role: "radiogroup", "aria-label": i.label, "data-square-modes": "", children: i.options.map((f) => {
|
|
156
|
+
const d = f.value === i.value;
|
|
157
157
|
return /* @__PURE__ */ a(
|
|
158
|
-
|
|
158
|
+
v,
|
|
159
159
|
{
|
|
160
160
|
theme: "borderless",
|
|
161
161
|
type: "tertiary",
|
|
162
162
|
role: "radio",
|
|
163
|
-
"aria-checked":
|
|
163
|
+
"aria-checked": d,
|
|
164
164
|
className: h.modeTab,
|
|
165
|
-
"data-active":
|
|
166
|
-
onClick: () =>
|
|
165
|
+
"data-active": d ? "true" : "false",
|
|
166
|
+
onClick: () => i.onChange(f.value),
|
|
167
167
|
children: f.label
|
|
168
168
|
},
|
|
169
169
|
f.value
|
|
170
170
|
);
|
|
171
171
|
}) }) : null,
|
|
172
|
-
|
|
172
|
+
y
|
|
173
173
|
] });
|
|
174
174
|
}, ct = ({ children: e }) => /* @__PURE__ */ a("span", { className: h.heroAccent, children: e }), ot = ({
|
|
175
175
|
testId: e,
|
|
@@ -178,25 +178,25 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
178
178
|
search: n,
|
|
179
179
|
categories: s,
|
|
180
180
|
filters: c,
|
|
181
|
-
toolbarLeft:
|
|
181
|
+
toolbarLeft: u,
|
|
182
182
|
toolbarRight: o,
|
|
183
183
|
conditionKey: l,
|
|
184
|
-
children:
|
|
184
|
+
children: i
|
|
185
185
|
}) => {
|
|
186
|
-
const _ = k(null), b = k(null),
|
|
187
|
-
qe(_, b,
|
|
188
|
-
const f = _.current,
|
|
189
|
-
if (!f || !
|
|
190
|
-
const C =
|
|
186
|
+
const _ = k(null), b = k(null), g = k(null), y = k(null), N = k(null);
|
|
187
|
+
qe(_, b, g), O(() => {
|
|
188
|
+
const f = _.current, d = g.current;
|
|
189
|
+
if (!f || !d) return;
|
|
190
|
+
const C = d.querySelector("[data-square-modes]") ? "true" : "false";
|
|
191
191
|
f.dataset.modes !== C && (f.dataset.modes = C);
|
|
192
192
|
});
|
|
193
193
|
const T = k(l);
|
|
194
194
|
return j(() => {
|
|
195
195
|
if (T.current === l) return;
|
|
196
196
|
T.current = l;
|
|
197
|
-
const f = N.current,
|
|
198
|
-
if (!f || !
|
|
199
|
-
const C = f.getBoundingClientRect().top -
|
|
197
|
+
const f = N.current, d = y.current;
|
|
198
|
+
if (!f || !d) return;
|
|
199
|
+
const C = f.getBoundingClientRect().top - d.getBoundingClientRect().bottom;
|
|
200
200
|
C < 0 && window.scrollBy({ top: C });
|
|
201
201
|
}, [l]), /* @__PURE__ */ m(
|
|
202
202
|
"section",
|
|
@@ -211,14 +211,14 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
211
211
|
r ? /* @__PURE__ */ a(I.Title, { heading: 1, className: t ? h.hiddenTitle : h.heroTitle, children: r }) : null,
|
|
212
212
|
t ? /* @__PURE__ */ a("div", { className: h.nav, children: t }) : null,
|
|
213
213
|
/* @__PURE__ */ a("div", { ref: b, "aria-hidden": "true" }),
|
|
214
|
-
/* @__PURE__ */ a("div", { ref:
|
|
214
|
+
/* @__PURE__ */ a("div", { ref: g, className: h.searchBar, children: /* @__PURE__ */ a("div", { className: h.searchBox, children: n }) }),
|
|
215
215
|
s ? /* @__PURE__ */ a("div", { className: h.categories, children: s }) : null,
|
|
216
216
|
c ? /* @__PURE__ */ a("div", { className: h.panel, children: c }) : null,
|
|
217
|
-
/* @__PURE__ */ m("div", { ref:
|
|
218
|
-
/* @__PURE__ */ a("div", { className: h.toolbarStart, children:
|
|
217
|
+
/* @__PURE__ */ m("div", { ref: y, className: h.filters, role: "toolbar", "aria-label": "排序与视图", children: [
|
|
218
|
+
/* @__PURE__ */ a("div", { className: h.toolbarStart, children: u }),
|
|
219
219
|
/* @__PURE__ */ a("div", { className: h.filtersGroup, children: o })
|
|
220
220
|
] }),
|
|
221
|
-
/* @__PURE__ */ a("div", { ref: N, className: h.results, children:
|
|
221
|
+
/* @__PURE__ */ a("div", { ref: N, className: h.results, children: i })
|
|
222
222
|
]
|
|
223
223
|
}
|
|
224
224
|
);
|
|
@@ -251,13 +251,13 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
251
251
|
var o;
|
|
252
252
|
const s = k(null);
|
|
253
253
|
j(() => {
|
|
254
|
-
const l = s.current,
|
|
255
|
-
!l || !
|
|
254
|
+
const l = s.current, i = l == null ? void 0 : l.querySelector('[aria-selected="true"]');
|
|
255
|
+
!l || !i || l.scrollWidth <= l.clientWidth || (l.scrollLeft = i.offsetLeft - (l.clientWidth - i.offsetWidth) / 2);
|
|
256
256
|
}, [r]);
|
|
257
|
-
const c = t.some((l) => l.value === r) ? r : (o = t[0]) == null ? void 0 : o.value,
|
|
258
|
-
var
|
|
259
|
-
const _ = t.length - 1, b = l.key === "ArrowRight" || l.key === "ArrowDown" ?
|
|
260
|
-
b < 0 || (l.preventDefault(), (
|
|
257
|
+
const c = t.some((l) => l.value === r) ? r : (o = t[0]) == null ? void 0 : o.value, u = (l, i) => {
|
|
258
|
+
var g, y;
|
|
259
|
+
const _ = t.length - 1, b = l.key === "ArrowRight" || l.key === "ArrowDown" ? i === _ ? 0 : i + 1 : l.key === "ArrowLeft" || l.key === "ArrowUp" ? i === 0 ? _ : i - 1 : l.key === "Home" ? 0 : l.key === "End" ? _ : -1;
|
|
260
|
+
b < 0 || (l.preventDefault(), (y = (g = s.current) == null ? void 0 : g.querySelectorAll('[role="tab"]')[b]) == null || y.focus());
|
|
261
261
|
};
|
|
262
262
|
return /* @__PURE__ */ a(
|
|
263
263
|
"div",
|
|
@@ -268,10 +268,10 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
268
268
|
className: x.tabs,
|
|
269
269
|
"data-dense": t.length > 4 ? "true" : void 0,
|
|
270
270
|
style: Y(t.length),
|
|
271
|
-
children: t.map((l,
|
|
271
|
+
children: t.map((l, i) => {
|
|
272
272
|
const _ = l.value === r;
|
|
273
273
|
return /* @__PURE__ */ m(
|
|
274
|
-
|
|
274
|
+
v,
|
|
275
275
|
{
|
|
276
276
|
theme: "borderless",
|
|
277
277
|
type: "tertiary",
|
|
@@ -283,7 +283,7 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
283
283
|
"data-active": _ ? "true" : "false",
|
|
284
284
|
"data-unavailable": l.unavailable ? "true" : void 0,
|
|
285
285
|
onClick: () => n(l.value),
|
|
286
|
-
onKeyDown: (b) =>
|
|
286
|
+
onKeyDown: (b) => u(b, i),
|
|
287
287
|
children: [
|
|
288
288
|
/* @__PURE__ */ a(U, { covers: l.covers }),
|
|
289
289
|
/* @__PURE__ */ m("span", { className: x.text, children: [
|
|
@@ -310,18 +310,18 @@ const ce = "_group_1f0zj_3", oe = "_loading_1f0zj_4", ie = "_skeleton_1f0zj_11",
|
|
|
310
310
|
check: la,
|
|
311
311
|
checkHidden: sa
|
|
312
312
|
}, X = H(
|
|
313
|
-
({ text: e, ariaLabel: r, active: t = !1, empty: n = !1, icon: s, arrow: c = !0, pressed:
|
|
314
|
-
|
|
313
|
+
({ text: e, ariaLabel: r, active: t = !1, empty: n = !1, icon: s, arrow: c = !0, pressed: u, onClick: o, ...l }, i) => /* @__PURE__ */ m(
|
|
314
|
+
v,
|
|
315
315
|
{
|
|
316
316
|
theme: "borderless",
|
|
317
317
|
type: "primary",
|
|
318
318
|
...l,
|
|
319
|
-
ref:
|
|
319
|
+
ref: i,
|
|
320
320
|
className: L.trigger,
|
|
321
321
|
"data-active": t ? "true" : "false",
|
|
322
322
|
"data-empty": n ? "true" : "false",
|
|
323
323
|
"aria-label": r,
|
|
324
|
-
"aria-pressed":
|
|
324
|
+
"aria-pressed": u,
|
|
325
325
|
onClick: o,
|
|
326
326
|
children: [
|
|
327
327
|
s ? /* @__PURE__ */ a("span", { className: L.prefix, children: s }) : null,
|
|
@@ -339,50 +339,50 @@ const F = "__all__", _t = ({
|
|
|
339
339
|
options: n,
|
|
340
340
|
onChange: s,
|
|
341
341
|
allLabel: c,
|
|
342
|
-
icon:
|
|
342
|
+
icon: u,
|
|
343
343
|
arrow: o = !0,
|
|
344
344
|
checkmark: l = !1,
|
|
345
|
-
position:
|
|
345
|
+
position: i = "bottomLeft",
|
|
346
346
|
disabled: _ = !1,
|
|
347
347
|
highlight: b = !0
|
|
348
348
|
}) => {
|
|
349
|
-
const [
|
|
349
|
+
const [g, y] = A(!1), N = n.find((d) => d.value === t), T = c ? [{ value: F, label: c }, ...n] : n, f = t || (c ? F : "");
|
|
350
350
|
return /* @__PURE__ */ a(
|
|
351
351
|
S,
|
|
352
352
|
{
|
|
353
353
|
trigger: _ ? "custom" : "click",
|
|
354
|
-
position:
|
|
355
|
-
visible: _ ? !1 :
|
|
356
|
-
onVisibleChange:
|
|
357
|
-
render: /* @__PURE__ */ a(S.Menu, { className: L.menu, children: T.map((
|
|
354
|
+
position: i,
|
|
355
|
+
visible: _ ? !1 : g,
|
|
356
|
+
onVisibleChange: y,
|
|
357
|
+
render: /* @__PURE__ */ a(S.Menu, { className: L.menu, children: T.map((d) => /* @__PURE__ */ m(
|
|
358
358
|
S.Item,
|
|
359
359
|
{
|
|
360
|
-
active:
|
|
360
|
+
active: d.value === f,
|
|
361
361
|
className: l ? L.checkItem : void 0,
|
|
362
362
|
onClick: () => {
|
|
363
|
-
|
|
363
|
+
y(!1), s(d.value === F ? "" : d.value);
|
|
364
364
|
},
|
|
365
365
|
children: [
|
|
366
|
-
l ? /* @__PURE__ */ a(ae, { className:
|
|
367
|
-
|
|
366
|
+
l ? /* @__PURE__ */ a(ae, { className: d.value === f ? L.check : L.checkHidden, "aria-hidden": "true" }) : null,
|
|
367
|
+
d.label
|
|
368
368
|
]
|
|
369
369
|
},
|
|
370
|
-
|
|
370
|
+
d.value
|
|
371
371
|
)) }),
|
|
372
372
|
children: /* @__PURE__ */ a(
|
|
373
373
|
X,
|
|
374
374
|
{
|
|
375
375
|
text: (N == null ? void 0 : N.label) ?? r ?? e,
|
|
376
376
|
ariaLabel: `${e}:${(N == null ? void 0 : N.label) ?? c ?? "未选择"}`,
|
|
377
|
-
active:
|
|
377
|
+
active: g,
|
|
378
378
|
empty: !N || !b,
|
|
379
|
-
icon:
|
|
379
|
+
icon: u,
|
|
380
380
|
arrow: o
|
|
381
381
|
}
|
|
382
382
|
)
|
|
383
383
|
}
|
|
384
384
|
);
|
|
385
|
-
}, 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",
|
|
385
|
+
}, 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", pa = "_clearButton_1rhpy_120", ga = "_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", p = {
|
|
386
386
|
panel: na,
|
|
387
387
|
row: ca,
|
|
388
388
|
rowLabel: oa,
|
|
@@ -392,12 +392,12 @@ const F = "__all__", _t = ({
|
|
|
392
392
|
selectedTag: _a,
|
|
393
393
|
selectedText: ma,
|
|
394
394
|
selectedRemove: ha,
|
|
395
|
-
clearButton:
|
|
396
|
-
selectText:
|
|
395
|
+
clearButton: pa,
|
|
396
|
+
selectText: ga,
|
|
397
397
|
selectTextLabel: fa,
|
|
398
398
|
selectTextArrow: ba,
|
|
399
|
-
menu:
|
|
400
|
-
rangePanel:
|
|
399
|
+
menu: va,
|
|
400
|
+
rangePanel: ya,
|
|
401
401
|
rangePresets: Na,
|
|
402
402
|
rangePreset: wa,
|
|
403
403
|
rangeCustom: Ca,
|
|
@@ -409,10 +409,10 @@ const F = "__all__", _t = ({
|
|
|
409
409
|
sortLabel: Aa,
|
|
410
410
|
sortItem: Sa,
|
|
411
411
|
sortArrow: Ia
|
|
412
|
-
}, mt = ({ children: e, ariaLabel: r = "筛选条件" }) => /* @__PURE__ */ a("div", { className:
|
|
413
|
-
/* @__PURE__ */ a("div", { className:
|
|
414
|
-
/* @__PURE__ */ a("div", { className:
|
|
415
|
-
t ? /* @__PURE__ */ a("div", { className:
|
|
412
|
+
}, mt = ({ children: e, ariaLabel: r = "筛选条件" }) => /* @__PURE__ */ a("div", { className: p.panel, role: "group", "aria-label": r, children: e }), J = ({ label: e, children: r, extra: t }) => /* @__PURE__ */ m("div", { className: p.row, role: "group", "aria-label": e, children: [
|
|
413
|
+
/* @__PURE__ */ a("div", { className: p.rowLabel, "aria-hidden": "true", children: e }),
|
|
414
|
+
/* @__PURE__ */ a("div", { className: p.rowContent, children: r }),
|
|
415
|
+
t ? /* @__PURE__ */ a("div", { className: p.rowExtra, children: t }) : null
|
|
416
416
|
] }), ht = ({ label: e, value: r, options: t, onChange: n }) => /* @__PURE__ */ a(J, { label: e, children: t.map((s) => /* @__PURE__ */ a(
|
|
417
417
|
$a,
|
|
418
418
|
{
|
|
@@ -426,51 +426,51 @@ const F = "__all__", _t = ({
|
|
|
426
426
|
active: r,
|
|
427
427
|
onClick: t
|
|
428
428
|
}) => /* @__PURE__ */ a(
|
|
429
|
-
|
|
429
|
+
v,
|
|
430
430
|
{
|
|
431
431
|
theme: "borderless",
|
|
432
432
|
type: "primary",
|
|
433
|
-
className:
|
|
433
|
+
className: p.option,
|
|
434
434
|
"data-active": r ? "true" : "false",
|
|
435
435
|
"aria-pressed": r,
|
|
436
436
|
onClick: t,
|
|
437
437
|
children: e
|
|
438
438
|
}
|
|
439
|
-
),
|
|
439
|
+
), pt = ({
|
|
440
440
|
conditions: e,
|
|
441
441
|
onClear: r
|
|
442
442
|
}) => e.length === 0 ? null : /* @__PURE__ */ m(J, { label: "已选条件", children: [
|
|
443
|
-
e.map((t) => /* @__PURE__ */ m("span", { className:
|
|
444
|
-
/* @__PURE__ */ a("span", { className:
|
|
443
|
+
e.map((t) => /* @__PURE__ */ m("span", { className: p.selectedTag, children: [
|
|
444
|
+
/* @__PURE__ */ a("span", { className: p.selectedText, children: t.label }),
|
|
445
445
|
/* @__PURE__ */ a(
|
|
446
|
-
|
|
446
|
+
v,
|
|
447
447
|
{
|
|
448
448
|
theme: "borderless",
|
|
449
449
|
type: "primary",
|
|
450
450
|
size: "small",
|
|
451
|
-
className:
|
|
451
|
+
className: p.selectedRemove,
|
|
452
452
|
icon: /* @__PURE__ */ a(G, { "aria-hidden": "true" }),
|
|
453
453
|
"aria-label": `移除 ${t.label}`,
|
|
454
454
|
onClick: t.onRemove
|
|
455
455
|
}
|
|
456
456
|
)
|
|
457
457
|
] }, t.key)),
|
|
458
|
-
/* @__PURE__ */ a(
|
|
459
|
-
] }), E = "__all__",
|
|
460
|
-
const [c,
|
|
458
|
+
/* @__PURE__ */ a(v, { theme: "borderless", type: "primary", size: "small", className: p.clearButton, icon: /* @__PURE__ */ a(te, { "aria-hidden": "true" }), onClick: r, children: "清空" })
|
|
459
|
+
] }), E = "__all__", gt = ({ placeholder: e, label: r, value: t, options: n, onChange: s }) => {
|
|
460
|
+
const [c, u] = A(!1), o = n.find((l) => l.value === t);
|
|
461
461
|
return /* @__PURE__ */ a(
|
|
462
462
|
S,
|
|
463
463
|
{
|
|
464
464
|
trigger: "click",
|
|
465
465
|
position: "bottomLeft",
|
|
466
466
|
visible: c,
|
|
467
|
-
onVisibleChange:
|
|
468
|
-
render: /* @__PURE__ */ a(S.Menu, { className:
|
|
467
|
+
onVisibleChange: u,
|
|
468
|
+
render: /* @__PURE__ */ a(S.Menu, { className: p.menu, children: [{ value: E, label: e }, ...n].map((l) => /* @__PURE__ */ a(
|
|
469
469
|
S.Item,
|
|
470
470
|
{
|
|
471
471
|
active: l.value === (t || E),
|
|
472
472
|
onClick: () => {
|
|
473
|
-
|
|
473
|
+
u(!1), s(l.value === E ? "" : l.value);
|
|
474
474
|
},
|
|
475
475
|
children: l.label
|
|
476
476
|
},
|
|
@@ -489,29 +489,29 @@ const F = "__all__", _t = ({
|
|
|
489
489
|
);
|
|
490
490
|
}, M = H(
|
|
491
491
|
({ text: e, ariaLabel: r, active: t, open: n, ...s }, c) => /* @__PURE__ */ m(
|
|
492
|
-
|
|
492
|
+
v,
|
|
493
493
|
{
|
|
494
494
|
theme: "borderless",
|
|
495
495
|
type: "primary",
|
|
496
496
|
...s,
|
|
497
497
|
ref: c,
|
|
498
|
-
className:
|
|
498
|
+
className: p.selectText,
|
|
499
499
|
"data-active": t ? "true" : "false",
|
|
500
500
|
"data-open": n ? "true" : "false",
|
|
501
501
|
"aria-label": r,
|
|
502
502
|
children: [
|
|
503
|
-
/* @__PURE__ */ a("span", { className:
|
|
504
|
-
/* @__PURE__ */ a(V, { className:
|
|
503
|
+
/* @__PURE__ */ a("span", { className: p.selectTextLabel, children: e }),
|
|
504
|
+
/* @__PURE__ */ a(V, { className: p.selectTextArrow, "aria-hidden": "true" })
|
|
505
505
|
]
|
|
506
506
|
}
|
|
507
507
|
)
|
|
508
508
|
);
|
|
509
509
|
M.displayName = "SelectTextTrigger";
|
|
510
|
-
const R = (e, r) => e.min === r.min && e.max === r.max, ft = ({ label: e, value: r, presets: t, onChange: n, limit: s, unit: c, minOnly:
|
|
511
|
-
const [l,
|
|
512
|
-
|
|
513
|
-
}, T = _.min === void 0 && _.max === void 0 || _.min !== void 0 && _.max !== void 0 && _.min > _.max, f = (
|
|
514
|
-
const C = typeof
|
|
510
|
+
const R = (e, r) => e.min === r.min && e.max === r.max, ft = ({ label: e, value: r, presets: t, onChange: n, limit: s, unit: c, minOnly: u = !1, format: o }) => {
|
|
511
|
+
const [l, i] = A(!1), [_, b] = A(r), g = r.min !== void 0 || r.max !== void 0, y = g ? o(r) : e, N = (d) => {
|
|
512
|
+
i(!1), n(d);
|
|
513
|
+
}, T = _.min === void 0 && _.max === void 0 || _.min !== void 0 && _.max !== void 0 && _.min > _.max, f = (d) => {
|
|
514
|
+
const C = typeof d == "number" ? d : typeof d == "string" && d.trim() !== "" ? Number(d) : NaN;
|
|
515
515
|
return Number.isFinite(C) ? Math.round(C) : void 0;
|
|
516
516
|
};
|
|
517
517
|
return /* @__PURE__ */ a(
|
|
@@ -520,40 +520,40 @@ const R = (e, r) => e.min === r.min && e.max === r.max, ft = ({ label: e, value:
|
|
|
520
520
|
trigger: "click",
|
|
521
521
|
position: "bottomLeft",
|
|
522
522
|
visible: l,
|
|
523
|
-
onVisibleChange: (
|
|
524
|
-
|
|
523
|
+
onVisibleChange: (d) => {
|
|
524
|
+
i(d), d && b(r);
|
|
525
525
|
},
|
|
526
|
-
content: /* @__PURE__ */ m("div", { className:
|
|
527
|
-
/* @__PURE__ */ a("div", { className:
|
|
528
|
-
|
|
526
|
+
content: /* @__PURE__ */ m("div", { className: p.rangePanel, role: "group", "aria-label": e, children: [
|
|
527
|
+
/* @__PURE__ */ a("div", { className: p.rangePresets, children: t.map((d) => /* @__PURE__ */ a(
|
|
528
|
+
v,
|
|
529
529
|
{
|
|
530
530
|
theme: "borderless",
|
|
531
531
|
type: "primary",
|
|
532
|
-
className:
|
|
533
|
-
"data-active": R(
|
|
534
|
-
"aria-pressed": R(
|
|
535
|
-
onClick: () => N(R(
|
|
536
|
-
children:
|
|
532
|
+
className: p.rangePreset,
|
|
533
|
+
"data-active": R(d, r) ? "true" : "false",
|
|
534
|
+
"aria-pressed": R(d, r),
|
|
535
|
+
onClick: () => N(R(d, r) ? {} : { min: d.min, max: d.max }),
|
|
536
|
+
children: d.label
|
|
537
537
|
},
|
|
538
|
-
|
|
538
|
+
d.label
|
|
539
539
|
)) }),
|
|
540
|
-
/* @__PURE__ */ m("div", { className:
|
|
540
|
+
/* @__PURE__ */ m("div", { className: p.rangeCustom, children: [
|
|
541
541
|
/* @__PURE__ */ a(
|
|
542
542
|
q,
|
|
543
543
|
{
|
|
544
544
|
size: "small",
|
|
545
|
-
"aria-label":
|
|
546
|
-
placeholder:
|
|
545
|
+
"aria-label": u ? `${e}不低于` : `${e}最小值`,
|
|
546
|
+
placeholder: u ? "不低于" : "最小",
|
|
547
547
|
min: 0,
|
|
548
548
|
max: s,
|
|
549
549
|
precision: 0,
|
|
550
550
|
suffix: c,
|
|
551
551
|
value: _.min,
|
|
552
|
-
onChange: (
|
|
552
|
+
onChange: (d) => b((C) => ({ ...C, min: f(d) }))
|
|
553
553
|
}
|
|
554
554
|
),
|
|
555
|
-
|
|
556
|
-
/* @__PURE__ */ a("span", { className:
|
|
555
|
+
u ? null : /* @__PURE__ */ m(D, { children: [
|
|
556
|
+
/* @__PURE__ */ a("span", { className: p.rangeDash, children: "–" }),
|
|
557
557
|
/* @__PURE__ */ a(
|
|
558
558
|
q,
|
|
559
559
|
{
|
|
@@ -565,54 +565,54 @@ const R = (e, r) => e.min === r.min && e.max === r.max, ft = ({ label: e, value:
|
|
|
565
565
|
precision: 0,
|
|
566
566
|
suffix: c,
|
|
567
567
|
value: _.max,
|
|
568
|
-
onChange: (
|
|
568
|
+
onChange: (d) => b((C) => ({ ...C, max: f(d) }))
|
|
569
569
|
}
|
|
570
570
|
)
|
|
571
571
|
] })
|
|
572
572
|
] }),
|
|
573
|
-
/* @__PURE__ */ m("div", { className:
|
|
574
|
-
/* @__PURE__ */ a(
|
|
575
|
-
/* @__PURE__ */ a(
|
|
573
|
+
/* @__PURE__ */ m("div", { className: p.rangeFooter, children: [
|
|
574
|
+
/* @__PURE__ */ a(v, { theme: "light", type: "tertiary", size: "small", disabled: !g, onClick: () => N({}), children: "清除" }),
|
|
575
|
+
/* @__PURE__ */ a(v, { theme: "solid", type: "primary", size: "small", disabled: T, onClick: () => N(_), children: "确定" })
|
|
576
576
|
] })
|
|
577
577
|
] }),
|
|
578
|
-
children: /* @__PURE__ */ a(M, { text:
|
|
578
|
+
children: /* @__PURE__ */ a(M, { text: y, ariaLabel: `${e}:${g ? y : "不限"}`, active: g, open: l })
|
|
579
579
|
}
|
|
580
580
|
);
|
|
581
|
-
}, bt = ({ label: e, value: r, options: t, onChange: n, size: s = "default" }) => /* @__PURE__ */ a("div", { className:
|
|
582
|
-
const
|
|
581
|
+
}, bt = ({ label: e, value: r, options: t, onChange: n, size: s = "default" }) => /* @__PURE__ */ a("div", { className: p.capsules, role: "radiogroup", "aria-label": e, "data-size": s, children: t.map((c) => {
|
|
582
|
+
const u = c.value === r;
|
|
583
583
|
return /* @__PURE__ */ a(
|
|
584
|
-
|
|
584
|
+
v,
|
|
585
585
|
{
|
|
586
586
|
theme: "borderless",
|
|
587
587
|
type: "primary",
|
|
588
588
|
role: "radio",
|
|
589
|
-
"aria-checked":
|
|
590
|
-
className:
|
|
591
|
-
"data-active":
|
|
589
|
+
"aria-checked": u,
|
|
590
|
+
className: p.capsule,
|
|
591
|
+
"data-active": u ? "true" : "false",
|
|
592
592
|
"data-danger": c.danger ? "true" : void 0,
|
|
593
593
|
onClick: () => n(c.value),
|
|
594
594
|
children: c.label
|
|
595
595
|
},
|
|
596
596
|
c.value
|
|
597
597
|
);
|
|
598
|
-
}) }),
|
|
599
|
-
/* @__PURE__ */ a("span", { className:
|
|
598
|
+
}) }), vt = ({ value: e, options: r, onChange: t, plain: n = [], disabled: s = !1 }) => /* @__PURE__ */ m("div", { className: p.sortBar, role: "radiogroup", "aria-label": "排序", children: [
|
|
599
|
+
/* @__PURE__ */ a("span", { className: p.sortLabel, "aria-hidden": "true", children: "排序:" }),
|
|
600
600
|
r.map((c) => {
|
|
601
|
-
const
|
|
601
|
+
const u = c.value === e;
|
|
602
602
|
return /* @__PURE__ */ m(
|
|
603
|
-
|
|
603
|
+
v,
|
|
604
604
|
{
|
|
605
605
|
theme: "borderless",
|
|
606
606
|
type: "primary",
|
|
607
607
|
role: "radio",
|
|
608
|
-
"aria-checked":
|
|
608
|
+
"aria-checked": u,
|
|
609
609
|
disabled: s,
|
|
610
|
-
className:
|
|
611
|
-
"data-active":
|
|
610
|
+
className: p.sortItem,
|
|
611
|
+
"data-active": u ? "true" : "false",
|
|
612
612
|
onClick: () => t(c.value),
|
|
613
613
|
children: [
|
|
614
614
|
c.label,
|
|
615
|
-
n.includes(c.value) ? null : /* @__PURE__ */ a(re, { className:
|
|
615
|
+
n.includes(c.value) ? null : /* @__PURE__ */ a(re, { className: p.sortArrow, "aria-hidden": "true" })
|
|
616
616
|
]
|
|
617
617
|
},
|
|
618
618
|
c.value
|
|
@@ -631,7 +631,7 @@ const R = (e, r) => e.min === r.min && e.max === r.max, ft = ({ label: e, value:
|
|
|
631
631
|
selectionCount: Wa,
|
|
632
632
|
selectionNumber: Oa,
|
|
633
633
|
tableScroll: Ha
|
|
634
|
-
},
|
|
634
|
+
}, yt = ({ search: e, filters: r, onReset: t, resetDisabled: n = !1, onRefresh: s, refreshing: c = !1, actions: u, extra: o, className: l }) => /* @__PURE__ */ m("div", { className: l ? `${w.toolbar} ${l}` : w.toolbar, children: [
|
|
635
635
|
/* @__PURE__ */ m("div", { className: w.row, role: "toolbar", "aria-label": "搜索与筛选", children: [
|
|
636
636
|
/* @__PURE__ */ m("div", { className: w.controls, children: [
|
|
637
637
|
e ? /* @__PURE__ */ a(
|
|
@@ -645,21 +645,21 @@ const R = (e, r) => e.min === r.min && e.max === r.max, ft = ({ label: e, value:
|
|
|
645
645
|
value: e.value,
|
|
646
646
|
onChange: e.onChange,
|
|
647
647
|
onEnterPress: () => {
|
|
648
|
-
var
|
|
649
|
-
return (
|
|
648
|
+
var i;
|
|
649
|
+
return (i = e.onSearch) == null ? void 0 : i.call(e, e.value);
|
|
650
650
|
},
|
|
651
651
|
onClear: () => {
|
|
652
|
-
var
|
|
653
|
-
return (
|
|
652
|
+
var i;
|
|
653
|
+
return (i = e.onSearch) == null ? void 0 : i.call(e, "");
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
656
|
) : null,
|
|
657
657
|
r ? /* @__PURE__ */ a("div", { className: w.filters, children: r }) : null,
|
|
658
|
-
t ? /* @__PURE__ */ a(
|
|
658
|
+
t ? /* @__PURE__ */ a(v, { theme: "light", type: "tertiary", icon: /* @__PURE__ */ a(le, { "aria-hidden": "true" }), disabled: n, onClick: t, children: "重置" }) : null
|
|
659
659
|
] }),
|
|
660
|
-
s ||
|
|
661
|
-
s ? /* @__PURE__ */ a(
|
|
662
|
-
|
|
660
|
+
s || u ? /* @__PURE__ */ m("div", { className: w.actions, children: [
|
|
661
|
+
s ? /* @__PURE__ */ a(v, { theme: "light", type: "tertiary", icon: /* @__PURE__ */ a(se, { "aria-hidden": "true" }), loading: c, onClick: s, children: "刷新" }) : null,
|
|
662
|
+
u
|
|
663
663
|
] }) : null
|
|
664
664
|
] }),
|
|
665
665
|
o
|
|
@@ -680,11 +680,11 @@ const R = (e, r) => e.min === r.min && e.max === r.max, ft = ({ label: e, value:
|
|
|
680
680
|
item: Ka
|
|
681
681
|
}, Ya = (e, r) => {
|
|
682
682
|
const t = Math.max(1, Math.floor(r)), n = Array.from({ length: t }, () => []), s = new Array(t).fill(0);
|
|
683
|
-
return e.forEach((c,
|
|
683
|
+
return e.forEach((c, u) => {
|
|
684
684
|
let o = 0;
|
|
685
685
|
for (let l = 1; l < t; l += 1)
|
|
686
686
|
s[l] < s[o] && (o = l);
|
|
687
|
-
n[o].push(
|
|
687
|
+
n[o].push(u), s[o] += c;
|
|
688
688
|
}), n;
|
|
689
689
|
}, Ua = 5, Xa = (e, r) => {
|
|
690
690
|
const t = e <= ne.phone ? 10 : 20, n = Math.min(Ua, Math.max(2, Math.floor((e + t) / (r + t))));
|
|
@@ -705,26 +705,26 @@ const R = (e, r) => e.min === r.min && e.max === r.max, ft = ({ label: e, value:
|
|
|
705
705
|
minColumnWidth: s = 184,
|
|
706
706
|
ariaLabel: c
|
|
707
707
|
}) => {
|
|
708
|
-
const [
|
|
708
|
+
const [u, o] = Qa(), l = Xa(o || Ja, s), i = Ya(
|
|
709
709
|
e.map((_) => t(_, l.columnWidth)),
|
|
710
710
|
l.columns
|
|
711
711
|
);
|
|
712
712
|
return /* @__PURE__ */ a(
|
|
713
713
|
"div",
|
|
714
714
|
{
|
|
715
|
-
ref:
|
|
715
|
+
ref: u,
|
|
716
716
|
className: P.waterfall,
|
|
717
717
|
role: "list",
|
|
718
718
|
"aria-label": c,
|
|
719
719
|
style: { "--waterfall-gap": `${l.gap}px` },
|
|
720
|
-
children:
|
|
720
|
+
children: i.map((_, b) => /* @__PURE__ */ a("div", { className: P.column, children: _.map((g) => /* @__PURE__ */ a("div", { role: "listitem", className: P.item, children: n(e[g]) }, r(e[g]))) }, b))
|
|
721
721
|
}
|
|
722
722
|
);
|
|
723
723
|
};
|
|
724
724
|
export {
|
|
725
725
|
Xe as C,
|
|
726
726
|
bt as F,
|
|
727
|
-
|
|
727
|
+
yt as L,
|
|
728
728
|
Ua as M,
|
|
729
729
|
Nt as S,
|
|
730
730
|
wt as T,
|
|
@@ -740,10 +740,10 @@ export {
|
|
|
740
740
|
mt as i,
|
|
741
741
|
ft as j,
|
|
742
742
|
J as k,
|
|
743
|
-
|
|
744
|
-
|
|
743
|
+
gt as l,
|
|
744
|
+
pt as m,
|
|
745
745
|
X as n,
|
|
746
|
-
|
|
746
|
+
vt as o,
|
|
747
747
|
ct as p,
|
|
748
748
|
it as q,
|
|
749
749
|
nt as r,
|