@q1travel/design-system 0.3.0 → 0.3.2
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/dist-pkg/design-system.d.ts +2 -2
- package/dist-pkg/design-system.js +629 -627
- package/dist-pkg/style.css +74 -76
- package/dist-pkg/tokens.css +403 -0
- package/package.json +4 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as i, jsx as e, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
const
|
|
5
|
-
var
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ie, createElement as pe, createContext as Se, useContext as Te, useState as E, useRef as I, useCallback as ee, useEffect as L, useLayoutEffect as V, useMemo as _e, useId as W, isValidElement as we, Fragment as ve, cloneElement as Ze } from "react";
|
|
3
|
+
import { createPortal as Qe } from "react-dom";
|
|
4
|
+
const Je = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Ae = (...t) => t.filter((n, r, a) => !!n && n.trim() !== "" && a.indexOf(n) === r).join(" ").trim();
|
|
5
|
+
var et = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: 24,
|
|
8
8
|
height: 24,
|
|
@@ -13,7 +13,7 @@ var Qe = {
|
|
|
13
13
|
strokeLinecap: "round",
|
|
14
14
|
strokeLinejoin: "round"
|
|
15
15
|
};
|
|
16
|
-
const
|
|
16
|
+
const tt = Ie(
|
|
17
17
|
({
|
|
18
18
|
color: t = "currentColor",
|
|
19
19
|
size: n = 24,
|
|
@@ -23,98 +23,98 @@ const Je = Ee(
|
|
|
23
23
|
children: s,
|
|
24
24
|
iconNode: o,
|
|
25
25
|
...u
|
|
26
|
-
}, c) =>
|
|
26
|
+
}, c) => pe(
|
|
27
27
|
"svg",
|
|
28
28
|
{
|
|
29
29
|
ref: c,
|
|
30
|
-
...
|
|
30
|
+
...et,
|
|
31
31
|
width: n,
|
|
32
32
|
height: n,
|
|
33
33
|
stroke: t,
|
|
34
34
|
strokeWidth: a ? Number(r) * 24 / Number(n) : r,
|
|
35
|
-
className:
|
|
35
|
+
className: Ae("lucide", l),
|
|
36
36
|
...u
|
|
37
37
|
},
|
|
38
38
|
[
|
|
39
|
-
...o.map(([_, d]) =>
|
|
39
|
+
...o.map(([_, d]) => pe(_, d)),
|
|
40
40
|
...Array.isArray(s) ? s : [s]
|
|
41
41
|
]
|
|
42
42
|
)
|
|
43
43
|
);
|
|
44
|
-
const
|
|
45
|
-
const r =
|
|
46
|
-
({ className: a, ...l }, s) =>
|
|
44
|
+
const A = (t, n) => {
|
|
45
|
+
const r = Ie(
|
|
46
|
+
({ className: a, ...l }, s) => pe(tt, {
|
|
47
47
|
ref: s,
|
|
48
48
|
iconNode: n,
|
|
49
|
-
className:
|
|
49
|
+
className: Ae(`lucide-${Je(t)}`, a),
|
|
50
50
|
...l
|
|
51
51
|
})
|
|
52
52
|
);
|
|
53
53
|
return r.displayName = `${t}`, r;
|
|
54
54
|
};
|
|
55
|
-
const
|
|
55
|
+
const nt = A("ArrowLeft", [
|
|
56
56
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
57
57
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
58
58
|
]);
|
|
59
|
-
const
|
|
59
|
+
const qe = A("ArrowRight", [
|
|
60
60
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
61
61
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
62
62
|
]);
|
|
63
|
-
const
|
|
63
|
+
const at = A("Calendar", [
|
|
64
64
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
65
65
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
66
66
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
67
67
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
68
68
|
]);
|
|
69
|
-
const
|
|
70
|
-
const
|
|
69
|
+
const B = A("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
|
|
70
|
+
const P = A("ChevronDown", [
|
|
71
71
|
["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
|
|
72
72
|
]);
|
|
73
|
-
const
|
|
73
|
+
const be = A("ChevronLeft", [
|
|
74
74
|
["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
|
|
75
75
|
]);
|
|
76
|
-
const
|
|
76
|
+
const H = A("ChevronRight", [
|
|
77
77
|
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
78
78
|
]);
|
|
79
|
-
const ze =
|
|
80
|
-
const
|
|
79
|
+
const ze = A("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
|
|
80
|
+
const ye = A("CircleAlert", [
|
|
81
81
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
82
82
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
83
83
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
84
84
|
]);
|
|
85
|
-
const We =
|
|
85
|
+
const We = A("CircleCheck", [
|
|
86
86
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
87
87
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
88
88
|
]);
|
|
89
|
-
const
|
|
89
|
+
const Le = A("CircleX", [
|
|
90
90
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
91
91
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
92
92
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
93
93
|
]);
|
|
94
|
-
const
|
|
94
|
+
const rt = A("Clock", [
|
|
95
95
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
96
96
|
["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
|
|
97
97
|
]);
|
|
98
|
-
const
|
|
98
|
+
const te = A("Copy", [
|
|
99
99
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
100
100
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
101
101
|
]);
|
|
102
|
-
const
|
|
102
|
+
const Re = A("Ellipsis", [
|
|
103
103
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
104
104
|
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
105
105
|
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
106
106
|
]);
|
|
107
|
-
const
|
|
107
|
+
const xe = A("FileCode", [
|
|
108
108
|
["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }],
|
|
109
109
|
["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }],
|
|
110
110
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
111
111
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z", key: "1mlx9k" }]
|
|
112
112
|
]);
|
|
113
|
-
const
|
|
113
|
+
const lt = A("File", [
|
|
114
114
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
115
115
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
|
|
116
116
|
]);
|
|
117
|
-
const
|
|
117
|
+
const st = A("FolderOpen", [
|
|
118
118
|
[
|
|
119
119
|
"path",
|
|
120
120
|
{
|
|
@@ -123,7 +123,7 @@ const rt = T("FolderOpen", [
|
|
|
123
123
|
}
|
|
124
124
|
]
|
|
125
125
|
]);
|
|
126
|
-
const
|
|
126
|
+
const ot = A("Folder", [
|
|
127
127
|
[
|
|
128
128
|
"path",
|
|
129
129
|
{
|
|
@@ -132,13 +132,13 @@ const lt = T("Folder", [
|
|
|
132
132
|
}
|
|
133
133
|
]
|
|
134
134
|
]);
|
|
135
|
-
const
|
|
135
|
+
const it = A("Frown", [
|
|
136
136
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
137
137
|
["path", { d: "M16 16s-1.5-2-4-2-4 2-4 2", key: "epbg0q" }],
|
|
138
138
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
139
139
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
140
140
|
]);
|
|
141
|
-
const
|
|
141
|
+
const ct = A("Heart", [
|
|
142
142
|
[
|
|
143
143
|
"path",
|
|
144
144
|
{
|
|
@@ -147,41 +147,41 @@ const ot = T("Heart", [
|
|
|
147
147
|
}
|
|
148
148
|
]
|
|
149
149
|
]);
|
|
150
|
-
const
|
|
150
|
+
const le = A("Info", [
|
|
151
151
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
152
152
|
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
153
153
|
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
154
154
|
]);
|
|
155
|
-
const
|
|
155
|
+
const oe = A("LoaderCircle", [
|
|
156
156
|
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
157
157
|
]);
|
|
158
|
-
const
|
|
158
|
+
const dt = A("Lock", [
|
|
159
159
|
["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
|
|
160
160
|
["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
|
|
161
161
|
]);
|
|
162
|
-
const
|
|
162
|
+
const ut = A("Meh", [
|
|
163
163
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
164
164
|
["line", { x1: "8", x2: "16", y1: "15", y2: "15", key: "1xb1d9" }],
|
|
165
165
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
166
166
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
167
167
|
]);
|
|
168
|
-
const
|
|
168
|
+
const mt = A("Monitor", [
|
|
169
169
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
170
170
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
171
171
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
172
172
|
]);
|
|
173
|
-
const
|
|
173
|
+
const ht = A("Moon", [
|
|
174
174
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
175
175
|
]);
|
|
176
|
-
const
|
|
176
|
+
const pt = A("RotateCw", [
|
|
177
177
|
["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
|
|
178
178
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }]
|
|
179
179
|
]);
|
|
180
|
-
const
|
|
180
|
+
const se = A("Search", [
|
|
181
181
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
182
182
|
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
|
183
183
|
]);
|
|
184
|
-
const
|
|
184
|
+
const ft = A("ShieldCheck", [
|
|
185
185
|
[
|
|
186
186
|
"path",
|
|
187
187
|
{
|
|
@@ -191,13 +191,13 @@ const ht = T("ShieldCheck", [
|
|
|
191
191
|
],
|
|
192
192
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
193
193
|
]);
|
|
194
|
-
const
|
|
194
|
+
const _t = A("Smile", [
|
|
195
195
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
196
196
|
["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
|
|
197
197
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
198
198
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
199
199
|
]);
|
|
200
|
-
const
|
|
200
|
+
const bt = A("Sun", [
|
|
201
201
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
202
202
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
203
203
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -208,7 +208,7 @@ const ft = T("Sun", [
|
|
|
208
208
|
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
|
|
209
209
|
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
210
210
|
]);
|
|
211
|
-
const
|
|
211
|
+
const ie = A("TriangleAlert", [
|
|
212
212
|
[
|
|
213
213
|
"path",
|
|
214
214
|
{
|
|
@@ -219,25 +219,25 @@ const oe = T("TriangleAlert", [
|
|
|
219
219
|
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
220
220
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
221
221
|
]);
|
|
222
|
-
const
|
|
222
|
+
const j = A("X", [
|
|
223
223
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
224
224
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
225
|
-
]),
|
|
225
|
+
]), yt = {
|
|
226
226
|
success: We,
|
|
227
|
-
warning:
|
|
228
|
-
error:
|
|
229
|
-
},
|
|
230
|
-
function
|
|
231
|
-
const t =
|
|
227
|
+
warning: ie,
|
|
228
|
+
error: Le
|
|
229
|
+
}, Fe = Se(null);
|
|
230
|
+
function gt() {
|
|
231
|
+
const t = Te(Fe);
|
|
232
232
|
if (!t)
|
|
233
233
|
throw new Error("useToast 必须在 ToastProvider 内使用");
|
|
234
234
|
return t;
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
const [n, r] = E([]), a = I(0), l = I(/* @__PURE__ */ new Map()), s = I(!1), o = I(null), [u, c] = E(!1), _ =
|
|
236
|
+
function an({ children: t }) {
|
|
237
|
+
const [n, r] = E([]), a = I(0), l = I(/* @__PURE__ */ new Map()), s = I(!1), o = I(null), [u, c] = E(!1), _ = ee((y) => {
|
|
238
238
|
const k = l.current.get(y);
|
|
239
239
|
k && (window.clearTimeout(k.handle), l.current.delete(y)), r((f) => f.filter((N) => N.id !== y));
|
|
240
|
-
}, []), d =
|
|
240
|
+
}, []), d = ee(
|
|
241
241
|
({ tone: y = "default", title: k, description: f, actionLabel: N, preserve: v, duration: D = 4e3 }) => {
|
|
242
242
|
const C = a.current += 1;
|
|
243
243
|
if (r((h) => [...h, { id: C, tone: y, title: k, description: f, actionLabel: N, preserve: v }]), !v) {
|
|
@@ -263,15 +263,15 @@ function tn({ children: t }) {
|
|
|
263
263
|
k.start = y, k.handle = window.setTimeout(() => _(f), k.remaining);
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
|
-
|
|
266
|
+
L(
|
|
267
267
|
() => () => {
|
|
268
268
|
l.current.forEach((y) => window.clearTimeout(y.handle));
|
|
269
269
|
},
|
|
270
270
|
[]
|
|
271
|
-
),
|
|
271
|
+
), V(() => {
|
|
272
272
|
const y = o.current;
|
|
273
273
|
if (!y) return;
|
|
274
|
-
const k = [...y.querySelectorAll(".toast")], f = 12, N = 14;
|
|
274
|
+
const k = [...y.querySelectorAll(".q1-toast")], f = 12, N = 14;
|
|
275
275
|
let v = 0, D = 0;
|
|
276
276
|
for (let x = k.length - 1; x >= 0; x -= 1) {
|
|
277
277
|
const g = k[x], w = k.length - 1 - x;
|
|
@@ -280,14 +280,14 @@ function tn({ children: t }) {
|
|
|
280
280
|
const C = D + Math.min(k.length - 1, 2) * N, h = k.length === 0 ? 0 : u ? Math.max(v - f, 0) : C;
|
|
281
281
|
y.style.setProperty("--toast-stack-h", `${h}px`);
|
|
282
282
|
}, [n, u]);
|
|
283
|
-
const m =
|
|
284
|
-
return /* @__PURE__ */ i(
|
|
283
|
+
const m = _e(() => ({ push: d, dismiss: _ }), [d, _]);
|
|
284
|
+
return /* @__PURE__ */ i(Fe.Provider, { value: m, children: [
|
|
285
285
|
t,
|
|
286
286
|
/* @__PURE__ */ e(
|
|
287
287
|
"div",
|
|
288
288
|
{
|
|
289
289
|
ref: o,
|
|
290
|
-
className: "toast-region",
|
|
290
|
+
className: "q1-toast-region",
|
|
291
291
|
role: "region",
|
|
292
292
|
"aria-live": "polite",
|
|
293
293
|
"aria-label": "通知",
|
|
@@ -305,22 +305,22 @@ function tn({ children: t }) {
|
|
|
305
305
|
y.currentTarget.contains(y.relatedTarget) || (c(!1), p());
|
|
306
306
|
},
|
|
307
307
|
children: n.map((y) => {
|
|
308
|
-
const k = y.tone === "default" ? null :
|
|
309
|
-
return /* @__PURE__ */ i("div", { className: `toast toast--${y.tone}`, "aria-atomic": "true", children: [
|
|
310
|
-
k ? /* @__PURE__ */ e(k, { className: "toast__icon", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null,
|
|
311
|
-
/* @__PURE__ */ i("div", { className: "toast__body", children: [
|
|
312
|
-
/* @__PURE__ */ e("p", { className: "toast__title", children: y.title }),
|
|
313
|
-
y.description ? /* @__PURE__ */ e("p", { className: "toast__description", children: y.description }) : null
|
|
308
|
+
const k = y.tone === "default" ? null : yt[y.tone];
|
|
309
|
+
return /* @__PURE__ */ i("div", { className: `q1-toast q1-toast--${y.tone}`, "aria-atomic": "true", children: [
|
|
310
|
+
k ? /* @__PURE__ */ e(k, { className: "q1-toast__icon", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null,
|
|
311
|
+
/* @__PURE__ */ i("div", { className: "q1-toast__body", children: [
|
|
312
|
+
/* @__PURE__ */ e("p", { className: "q1-toast__title", children: y.title }),
|
|
313
|
+
y.description ? /* @__PURE__ */ e("p", { className: "q1-toast__description", children: y.description }) : null
|
|
314
314
|
] }),
|
|
315
|
-
y.actionLabel ? /* @__PURE__ */ e("button", { type: "button", className: "toast__action", onClick: () => _(y.id), children: y.actionLabel }) : null,
|
|
316
|
-
/* @__PURE__ */ e("button", { type: "button", className: "toast__close", "aria-label": "关闭", onClick: () => _(y.id), children: /* @__PURE__ */ e(
|
|
315
|
+
y.actionLabel ? /* @__PURE__ */ e("button", { type: "button", className: "q1-toast__action", onClick: () => _(y.id), children: y.actionLabel }) : null,
|
|
316
|
+
/* @__PURE__ */ e("button", { type: "button", className: "q1-toast__close", "aria-label": "关闭", onClick: () => _(y.id), children: /* @__PURE__ */ e(j, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })
|
|
317
317
|
] }, y.id);
|
|
318
318
|
})
|
|
319
319
|
}
|
|
320
320
|
)
|
|
321
321
|
] });
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function Nt(t) {
|
|
324
324
|
const n = document.createElement("textarea");
|
|
325
325
|
n.value = t, n.setAttribute("readonly", ""), n.style.position = "fixed", n.style.top = "0", n.style.left = "0", n.style.width = "1px", n.style.height = "1px", n.style.opacity = "0";
|
|
326
326
|
try {
|
|
@@ -329,38 +329,38 @@ function yt(t) {
|
|
|
329
329
|
n.remove();
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
async function
|
|
332
|
+
async function Ke(t) {
|
|
333
333
|
try {
|
|
334
334
|
await navigator.clipboard.writeText(t);
|
|
335
335
|
return;
|
|
336
336
|
} catch {
|
|
337
|
-
if (!
|
|
337
|
+
if (!Nt(t))
|
|
338
338
|
throw new Error("clipboard write failed");
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
const [t, n] = E(!1), r = I(void 0), { push: a } =
|
|
341
|
+
function ce() {
|
|
342
|
+
const [t, n] = E(!1), r = I(void 0), { push: a } = gt(), l = ee(
|
|
343
343
|
async (o, u = "已复制到剪贴板") => {
|
|
344
344
|
try {
|
|
345
|
-
await
|
|
345
|
+
await Ke(o), n(!0), r.current && clearTimeout(r.current), r.current = setTimeout(() => n(!1), 1500), a({ title: u });
|
|
346
346
|
} catch {
|
|
347
347
|
a({ tone: "error", title: "无法复制到剪贴板。请重试。" });
|
|
348
348
|
}
|
|
349
349
|
},
|
|
350
350
|
[a]
|
|
351
|
-
), s =
|
|
351
|
+
), s = ee(() => {
|
|
352
352
|
r.current && clearTimeout(r.current), n(!1);
|
|
353
353
|
}, []);
|
|
354
354
|
return { copied: t, copy: l, reset: s };
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function rn({
|
|
357
357
|
value: t,
|
|
358
358
|
label: n,
|
|
359
359
|
successMessage: r,
|
|
360
360
|
size: a = 16,
|
|
361
361
|
className: l
|
|
362
362
|
}) {
|
|
363
|
-
const { copied: s, copy: o } =
|
|
363
|
+
const { copied: s, copy: o } = ce();
|
|
364
364
|
return /* @__PURE__ */ e(
|
|
365
365
|
"button",
|
|
366
366
|
{
|
|
@@ -368,19 +368,22 @@ function nn({
|
|
|
368
368
|
className: l ? `copy-button ${l}` : "copy-button",
|
|
369
369
|
"aria-label": n,
|
|
370
370
|
onClick: () => o(t, r),
|
|
371
|
-
children: s ? /* @__PURE__ */ e(
|
|
371
|
+
children: s ? /* @__PURE__ */ e(B, { size: a, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(te, { size: a, strokeWidth: 2, "aria-hidden": "true" })
|
|
372
372
|
}
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function kt({
|
|
376
376
|
className: t,
|
|
377
377
|
label: n,
|
|
378
378
|
onClick: r
|
|
379
379
|
}) {
|
|
380
|
-
return /* @__PURE__ */ e("button", { type: "button", className: t, "aria-label": n, onClick: r, children: /* @__PURE__ */ e(
|
|
380
|
+
return /* @__PURE__ */ e("button", { type: "button", className: t, "aria-label": n, onClick: r, children: /* @__PURE__ */ e(j, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) });
|
|
381
|
+
}
|
|
382
|
+
function T(...t) {
|
|
383
|
+
return t.filter(Boolean).join(" ");
|
|
381
384
|
}
|
|
382
|
-
function
|
|
383
|
-
return
|
|
385
|
+
function wt({ variant: t, size: n, iconOnly: r, circle: a, rounded: l, loading: s, className: o }) {
|
|
386
|
+
return T(
|
|
384
387
|
"button",
|
|
385
388
|
t ? `button--${t}` : "",
|
|
386
389
|
n && n !== "md" ? `button--${n}` : "",
|
|
@@ -390,9 +393,9 @@ function Nt({ variant: t, size: n, iconOnly: r, circle: a, rounded: l, loading:
|
|
|
390
393
|
l && !a ? "button--rounded" : "",
|
|
391
394
|
s ? "button--loading" : "",
|
|
392
395
|
o
|
|
393
|
-
|
|
396
|
+
);
|
|
394
397
|
}
|
|
395
|
-
function
|
|
398
|
+
function ln(t) {
|
|
396
399
|
const {
|
|
397
400
|
loading: n,
|
|
398
401
|
disabled: r,
|
|
@@ -408,8 +411,8 @@ function an(t) {
|
|
|
408
411
|
onBlur: p,
|
|
409
412
|
onKeyDown: m,
|
|
410
413
|
ref: y
|
|
411
|
-
} = t, k =
|
|
412
|
-
n ? /* @__PURE__ */ e(
|
|
414
|
+
} = t, k = wt(t), f = /* @__PURE__ */ i(K, { children: [
|
|
415
|
+
n ? /* @__PURE__ */ e(oe, { className: "button__spinner", size: 14, strokeWidth: 1.8, "aria-hidden": "true" }) : null,
|
|
413
416
|
o,
|
|
414
417
|
s ? /* @__PURE__ */ e("kbd", { className: "button__shortcut", "aria-hidden": "true", children: s }) : null
|
|
415
418
|
] });
|
|
@@ -448,10 +451,10 @@ function an(t) {
|
|
|
448
451
|
}
|
|
449
452
|
);
|
|
450
453
|
}
|
|
451
|
-
function
|
|
454
|
+
function ne(t, n) {
|
|
452
455
|
return `${t}-${n ? "message" : "description"}`;
|
|
453
456
|
}
|
|
454
|
-
function
|
|
457
|
+
function ge({
|
|
455
458
|
controlId: t,
|
|
456
459
|
label: n,
|
|
457
460
|
description: r,
|
|
@@ -459,14 +462,14 @@ function ye({
|
|
|
459
462
|
wide: l,
|
|
460
463
|
children: s
|
|
461
464
|
}) {
|
|
462
|
-
const o =
|
|
465
|
+
const o = T("form-field", l ? "form-field--wide" : "", a ? "form-field--error" : ""), u = ne(t, !!a);
|
|
463
466
|
return /* @__PURE__ */ i("label", { className: o, htmlFor: t, children: [
|
|
464
467
|
/* @__PURE__ */ e("span", { className: "form-field__label", children: n }),
|
|
465
468
|
s,
|
|
466
469
|
a ? /* @__PURE__ */ e("span", { className: "form-field__message", id: u, children: a }) : r ? /* @__PURE__ */ e("span", { className: "form-field__description", id: u, children: r }) : null
|
|
467
470
|
] });
|
|
468
471
|
}
|
|
469
|
-
function
|
|
472
|
+
function sn({
|
|
470
473
|
id: t,
|
|
471
474
|
label: n,
|
|
472
475
|
description: r,
|
|
@@ -481,17 +484,17 @@ function rn({
|
|
|
481
484
|
className: b,
|
|
482
485
|
...p
|
|
483
486
|
}) {
|
|
484
|
-
const m =
|
|
487
|
+
const m = T("form-control", d !== "md" ? `form-control--${d}` : "", b ?? ""), y = T("input-control", c ? "input-control--rounded" : ""), k = /* @__PURE__ */ e(
|
|
485
488
|
"input",
|
|
486
489
|
{
|
|
487
490
|
id: t,
|
|
488
491
|
className: m,
|
|
489
|
-
"aria-describedby": r || a ?
|
|
492
|
+
"aria-describedby": r || a ? ne(t, !!a) : void 0,
|
|
490
493
|
"aria-invalid": a ? !0 : void 0,
|
|
491
494
|
...p
|
|
492
495
|
}
|
|
493
496
|
);
|
|
494
|
-
return /* @__PURE__ */ e(
|
|
497
|
+
return /* @__PURE__ */ e(ge, { controlId: t, label: n, description: r, error: a, wide: _, children: l || s || c ? /* @__PURE__ */ i("span", { className: y, children: [
|
|
495
498
|
l ? /* @__PURE__ */ e(
|
|
496
499
|
"span",
|
|
497
500
|
{
|
|
@@ -511,7 +514,7 @@ function rn({
|
|
|
511
514
|
) : null
|
|
512
515
|
] }) : k });
|
|
513
516
|
}
|
|
514
|
-
function
|
|
517
|
+
function Pe(t = "", n) {
|
|
515
518
|
const [r, a] = E(t), l = I(null), s = () => {
|
|
516
519
|
a(""), l.current?.focus(), n?.();
|
|
517
520
|
};
|
|
@@ -519,7 +522,7 @@ function Ke(t = "", n) {
|
|
|
519
522
|
u.nativeEvent.isComposing || u.key === "Escape" && r && (u.preventDefault(), s());
|
|
520
523
|
} };
|
|
521
524
|
}
|
|
522
|
-
function
|
|
525
|
+
function on({
|
|
523
526
|
id: t,
|
|
524
527
|
placeholder: n,
|
|
525
528
|
defaultValue: r = "",
|
|
@@ -528,7 +531,7 @@ function ln({
|
|
|
528
531
|
onClear: s,
|
|
529
532
|
ariaLabel: o
|
|
530
533
|
}) {
|
|
531
|
-
const { value: u, setValue: c, inputRef: _, clear: d, onKeyDown: b } =
|
|
534
|
+
const { value: u, setValue: c, inputRef: _, clear: d, onKeyDown: b } = Pe(r, s);
|
|
532
535
|
return /* @__PURE__ */ i("div", { className: "clearable", children: [
|
|
533
536
|
/* @__PURE__ */ e(
|
|
534
537
|
"input",
|
|
@@ -545,13 +548,13 @@ function ln({
|
|
|
545
548
|
onKeyDown: b
|
|
546
549
|
}
|
|
547
550
|
),
|
|
548
|
-
u && !a ? /* @__PURE__ */ e(
|
|
549
|
-
/* @__PURE__ */ e("kbd", { className: "kbd kbd--small", children: "Esc" }),
|
|
550
|
-
/* @__PURE__ */ e("kbd", { className: "kbd kbd--small", children: "⌘K" })
|
|
551
|
+
u && !a ? /* @__PURE__ */ e(kt, { className: "clearable__clear", label: "清除", onClick: d }) : l ? /* @__PURE__ */ i("span", { className: "clearable__hint", "aria-hidden": "true", children: [
|
|
552
|
+
/* @__PURE__ */ e("kbd", { className: "q1-kbd q1-kbd--small", children: "Esc" }),
|
|
553
|
+
/* @__PURE__ */ e("kbd", { className: "q1-kbd q1-kbd--small", children: "⌘K" })
|
|
551
554
|
] }) : null
|
|
552
555
|
] });
|
|
553
556
|
}
|
|
554
|
-
function
|
|
557
|
+
function cn({
|
|
555
558
|
id: t,
|
|
556
559
|
ariaLabel: n,
|
|
557
560
|
placeholder: r,
|
|
@@ -561,9 +564,9 @@ function sn({
|
|
|
561
564
|
kbdHint: o,
|
|
562
565
|
icon: u
|
|
563
566
|
}) {
|
|
564
|
-
const { value: c, setValue: _, inputRef: d, clear: b, onKeyDown: p } =
|
|
567
|
+
const { value: c, setValue: _, inputRef: d, clear: b, onKeyDown: p } = Pe(a);
|
|
565
568
|
return /* @__PURE__ */ i("div", { className: "search-input", "aria-busy": s || void 0, children: [
|
|
566
|
-
/* @__PURE__ */ e("span", { className: "search-input__icon", "aria-hidden": "true", children: s ? /* @__PURE__ */ e(
|
|
569
|
+
/* @__PURE__ */ e("span", { className: "search-input__icon", "aria-hidden": "true", children: s ? /* @__PURE__ */ e(oe, { className: "search-input__spinner", size: 16, strokeWidth: 2 }) : u ?? /* @__PURE__ */ e(se, { size: 16, strokeWidth: 2 }) }),
|
|
567
570
|
/* @__PURE__ */ e(
|
|
568
571
|
"input",
|
|
569
572
|
{
|
|
@@ -581,14 +584,14 @@ function sn({
|
|
|
581
584
|
onKeyDown: p
|
|
582
585
|
}
|
|
583
586
|
),
|
|
584
|
-
s ? /* @__PURE__ */ e("span", { className: "sr-only", children: "加载中…" }) : null,
|
|
585
|
-
c && !l ? /* @__PURE__ */ e("button", { type: "button", className: "search-input__esc", "aria-label": "清除搜索", onClick: b, children: /* @__PURE__ */ e("kbd", { className: "kbd kbd--small", "aria-hidden": "true", children: "Esc" }) }) : o && !l ? /* @__PURE__ */ i("span", { className: "search-input__hint", "aria-hidden": "true", children: [
|
|
586
|
-
/* @__PURE__ */ e("kbd", { className: "kbd kbd--small", children: "⌘" }),
|
|
587
|
-
/* @__PURE__ */ e("kbd", { className: "kbd kbd--small", children: "K" })
|
|
587
|
+
s ? /* @__PURE__ */ e("span", { className: "q1-sr-only", children: "加载中…" }) : null,
|
|
588
|
+
c && !l ? /* @__PURE__ */ e("button", { type: "button", className: "search-input__esc", "aria-label": "清除搜索", onClick: b, children: /* @__PURE__ */ e("kbd", { className: "q1-kbd q1-kbd--small", "aria-hidden": "true", children: "Esc" }) }) : o && !l ? /* @__PURE__ */ i("span", { className: "search-input__hint", "aria-hidden": "true", children: [
|
|
589
|
+
/* @__PURE__ */ e("kbd", { className: "q1-kbd q1-kbd--small", children: "⌘" }),
|
|
590
|
+
/* @__PURE__ */ e("kbd", { className: "q1-kbd q1-kbd--small", children: "K" })
|
|
588
591
|
] }) : null
|
|
589
592
|
] });
|
|
590
593
|
}
|
|
591
|
-
function
|
|
594
|
+
function dn({
|
|
592
595
|
id: t,
|
|
593
596
|
label: n,
|
|
594
597
|
description: r,
|
|
@@ -598,24 +601,24 @@ function on({
|
|
|
598
601
|
className: o,
|
|
599
602
|
...u
|
|
600
603
|
}) {
|
|
601
|
-
const c =
|
|
604
|
+
const c = T(
|
|
602
605
|
"form-control",
|
|
603
606
|
"form-control--textarea",
|
|
604
607
|
s !== "md" ? `form-control--${s}` : "",
|
|
605
608
|
o ?? ""
|
|
606
|
-
|
|
607
|
-
return /* @__PURE__ */ e(
|
|
609
|
+
);
|
|
610
|
+
return /* @__PURE__ */ e(ge, { controlId: t, label: n, description: r, error: a, wide: l, children: /* @__PURE__ */ e(
|
|
608
611
|
"textarea",
|
|
609
612
|
{
|
|
610
613
|
id: t,
|
|
611
614
|
className: c,
|
|
612
|
-
"aria-describedby": r || a ?
|
|
615
|
+
"aria-describedby": r || a ? ne(t, !!a) : void 0,
|
|
613
616
|
"aria-invalid": a ? !0 : void 0,
|
|
614
617
|
...u
|
|
615
618
|
}
|
|
616
619
|
) });
|
|
617
620
|
}
|
|
618
|
-
function
|
|
621
|
+
function un({
|
|
619
622
|
id: t,
|
|
620
623
|
label: n,
|
|
621
624
|
description: r,
|
|
@@ -628,34 +631,34 @@ function cn({
|
|
|
628
631
|
children: _,
|
|
629
632
|
...d
|
|
630
633
|
}) {
|
|
631
|
-
const b =
|
|
634
|
+
const b = T(
|
|
632
635
|
"form-control",
|
|
633
636
|
"form-control--select",
|
|
634
637
|
s !== "md" ? `form-control--${s}` : "",
|
|
635
638
|
c ?? ""
|
|
636
|
-
|
|
639
|
+
), p = T(
|
|
637
640
|
"select-control",
|
|
638
641
|
o ? "select-control--prefixed" : "",
|
|
639
642
|
u ? "select-control--suffixed" : ""
|
|
640
|
-
|
|
641
|
-
return /* @__PURE__ */ e(
|
|
643
|
+
);
|
|
644
|
+
return /* @__PURE__ */ e(ge, { controlId: t, label: n, description: r, error: a, wide: l, children: /* @__PURE__ */ i("span", { className: p, children: [
|
|
642
645
|
o ? /* @__PURE__ */ e("span", { className: "select-control__prefix", "aria-hidden": "true", children: o }) : null,
|
|
643
646
|
/* @__PURE__ */ e(
|
|
644
647
|
"select",
|
|
645
648
|
{
|
|
646
649
|
id: t,
|
|
647
650
|
className: b,
|
|
648
|
-
"aria-describedby": r || a ?
|
|
651
|
+
"aria-describedby": r || a ? ne(t, !!a) : void 0,
|
|
649
652
|
"aria-invalid": a ? !0 : void 0,
|
|
650
653
|
...d,
|
|
651
654
|
children: _
|
|
652
655
|
}
|
|
653
656
|
),
|
|
654
657
|
u ? /* @__PURE__ */ e("span", { className: "select-control__suffix", "aria-hidden": "true", children: u }) : null,
|
|
655
|
-
/* @__PURE__ */ e("span", { className: "select-control__chevron", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
658
|
+
/* @__PURE__ */ e("span", { className: "select-control__chevron", "aria-hidden": "true", children: /* @__PURE__ */ e(P, { size: s === "xs" ? 12 : 16, strokeWidth: 1.8 }) })
|
|
656
659
|
] }) });
|
|
657
660
|
}
|
|
658
|
-
function
|
|
661
|
+
function Oe({
|
|
659
662
|
id: t,
|
|
660
663
|
label: n,
|
|
661
664
|
description: r,
|
|
@@ -664,8 +667,8 @@ function Pe({
|
|
|
664
667
|
type: s,
|
|
665
668
|
...o
|
|
666
669
|
}) {
|
|
667
|
-
const u = s === "radio", c = !u && (r || a) ?
|
|
668
|
-
return
|
|
670
|
+
const u = s === "radio", c = !u && (r || a) ? ne(t, !!a) : void 0, _ = u ? "control-option__visual control-option__visual--radio" : "control-option__visual", d = I(null);
|
|
671
|
+
return L(() => {
|
|
669
672
|
d.current && (d.current.indeterminate = !u && !!l);
|
|
670
673
|
}, [l, u]), /* @__PURE__ */ i("label", { className: a ? "control-option control-option--error" : "control-option", htmlFor: t, children: [
|
|
671
674
|
/* @__PURE__ */ e("input", { ref: d, id: t, type: s, "aria-describedby": c, "aria-invalid": a ? !0 : void 0, ...o }),
|
|
@@ -676,29 +679,29 @@ function Pe({
|
|
|
676
679
|
] })
|
|
677
680
|
] });
|
|
678
681
|
}
|
|
679
|
-
function
|
|
680
|
-
return /* @__PURE__ */ e(
|
|
682
|
+
function mn(t) {
|
|
683
|
+
return /* @__PURE__ */ e(Oe, { type: "checkbox", ...t });
|
|
681
684
|
}
|
|
682
|
-
function
|
|
683
|
-
return /* @__PURE__ */ e(
|
|
685
|
+
function hn(t) {
|
|
686
|
+
return /* @__PURE__ */ e(Oe, { type: "radio", ...t });
|
|
684
687
|
}
|
|
685
|
-
function
|
|
688
|
+
function pn({ id: t, ...n }) {
|
|
686
689
|
return {
|
|
687
690
|
component: /* @__PURE__ */ e("input", { id: t, type: "radio", ...n })
|
|
688
691
|
};
|
|
689
692
|
}
|
|
690
|
-
function
|
|
691
|
-
return /* @__PURE__ */ i("label", { className:
|
|
693
|
+
function fn({ type: t, label: n, description: r, extra: a, className: l, ...s }) {
|
|
694
|
+
return /* @__PURE__ */ i("label", { className: T("choicebox", `choicebox--${t}`, l), children: [
|
|
692
695
|
/* @__PURE__ */ e("input", { type: t, className: "choicebox__input", ...s }),
|
|
693
696
|
/* @__PURE__ */ i("span", { className: "choicebox__body", children: [
|
|
694
697
|
/* @__PURE__ */ e("span", { className: "choicebox__title", children: n }),
|
|
695
698
|
r ? /* @__PURE__ */ e("span", { className: "choicebox__description", children: r }) : null,
|
|
696
699
|
a ? /* @__PURE__ */ e("span", { className: "choicebox__extra", children: a }) : null
|
|
697
700
|
] }),
|
|
698
|
-
/* @__PURE__ */ e("span", { className: "choicebox__indicator", "aria-hidden": "true", children: t === "checkbox" ? /* @__PURE__ */ e(
|
|
701
|
+
/* @__PURE__ */ e("span", { className: "choicebox__indicator", "aria-hidden": "true", children: t === "checkbox" ? /* @__PURE__ */ e(B, { className: "choicebox__check", size: 12, strokeWidth: 3 }) : null })
|
|
699
702
|
] });
|
|
700
703
|
}
|
|
701
|
-
function
|
|
704
|
+
function _n({
|
|
702
705
|
options: t,
|
|
703
706
|
placeholder: n,
|
|
704
707
|
emptyLabel: r = "选项",
|
|
@@ -709,10 +712,10 @@ function pn({
|
|
|
709
712
|
inputId: u
|
|
710
713
|
}) {
|
|
711
714
|
const [c, _] = E(""), [d, b] = E(!1), [p, m] = E(!1), [y, k] = E(0), f = I(null), N = I(null), v = W(), D = `${v}-list`, C = `${v}-err`, h = d ? t : t.filter(($) => $.value.toLowerCase().includes(c.toLowerCase())), x = p && h[y] ? `${v}-opt-${y}` : void 0;
|
|
712
|
-
|
|
715
|
+
L(() => {
|
|
713
716
|
if (!p) return;
|
|
714
|
-
function $(
|
|
715
|
-
f.current && !f.current.contains(
|
|
717
|
+
function $(q) {
|
|
718
|
+
f.current && !f.current.contains(q.target) && m(!1);
|
|
716
719
|
}
|
|
717
720
|
return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
|
|
718
721
|
}, [p]);
|
|
@@ -723,17 +726,17 @@ function pn({
|
|
|
723
726
|
_(""), b(!1), m(!1), N.current?.focus();
|
|
724
727
|
}
|
|
725
728
|
function M($) {
|
|
726
|
-
$.nativeEvent.isComposing || ($.key === "ArrowDown" ? ($.preventDefault(), p ? k((
|
|
729
|
+
$.nativeEvent.isComposing || ($.key === "ArrowDown" ? ($.preventDefault(), p ? k((q) => Math.max(Math.min(q + 1, h.length - 1), 0)) : m(!0)) : $.key === "ArrowUp" ? ($.preventDefault(), k((q) => Math.max(q - 1, 0))) : $.key === "Home" && p ? ($.preventDefault(), k(0)) : $.key === "End" && p ? ($.preventDefault(), k(Math.max(h.length - 1, 0))) : $.key === "Enter" && p && h[y] ? ($.preventDefault(), g(h[y])) : $.key === "Escape" && (p ? ($.preventDefault(), m(!1)) : o && c && w()));
|
|
727
730
|
}
|
|
728
|
-
const S =
|
|
731
|
+
const S = T(
|
|
729
732
|
"combobox",
|
|
730
733
|
a !== "md" ? `combobox--${a}` : "",
|
|
731
734
|
s ? "combobox--error" : "",
|
|
732
735
|
l ? "combobox--disabled" : ""
|
|
733
|
-
|
|
736
|
+
);
|
|
734
737
|
return /* @__PURE__ */ i("div", { className: S, ref: f, children: [
|
|
735
738
|
/* @__PURE__ */ i("div", { className: "combobox__control", children: [
|
|
736
|
-
/* @__PURE__ */ e(
|
|
739
|
+
/* @__PURE__ */ e(se, { className: "combobox__leading", size: 16, strokeWidth: 2, "aria-hidden": "true" }),
|
|
737
740
|
/* @__PURE__ */ e(
|
|
738
741
|
"input",
|
|
739
742
|
{
|
|
@@ -759,18 +762,18 @@ function pn({
|
|
|
759
762
|
onKeyDown: M
|
|
760
763
|
}
|
|
761
764
|
),
|
|
762
|
-
o && c && !l ? /* @__PURE__ */ e("button", { type: "button", className: "combobox__clear", "aria-label": "清除选择", onClick: w, children: /* @__PURE__ */ e(
|
|
765
|
+
o && c && !l ? /* @__PURE__ */ e("button", { type: "button", className: "combobox__clear", "aria-label": "清除选择", onClick: w, children: /* @__PURE__ */ e(j, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) }) : null
|
|
763
766
|
] }),
|
|
764
|
-
p ? /* @__PURE__ */ e("ul", { className: "combobox__listbox", id: D, role: "listbox", "aria-label": n, children: h.length === 0 ? /* @__PURE__ */ e("li", { className: "combobox__empty", role: "presentation", children: `没有匹配「${c}」的${r}` }) : h.map(($,
|
|
767
|
+
p ? /* @__PURE__ */ e("ul", { className: "combobox__listbox", id: D, role: "listbox", "aria-label": n, children: h.length === 0 ? /* @__PURE__ */ e("li", { className: "combobox__empty", role: "presentation", children: `没有匹配「${c}」的${r}` }) : h.map(($, q) => /* @__PURE__ */ i(
|
|
765
768
|
"li",
|
|
766
769
|
{
|
|
767
|
-
id: `${v}-opt-${
|
|
770
|
+
id: `${v}-opt-${q}`,
|
|
768
771
|
role: "option",
|
|
769
772
|
"aria-selected": d && c === $.value,
|
|
770
|
-
className: `combobox__option${
|
|
771
|
-
onMouseEnter: () => k(
|
|
772
|
-
onMouseDown: (
|
|
773
|
-
|
|
773
|
+
className: `combobox__option${q === y ? " combobox__option--active" : ""}`,
|
|
774
|
+
onMouseEnter: () => k(q),
|
|
775
|
+
onMouseDown: (R) => {
|
|
776
|
+
R.preventDefault(), g($);
|
|
774
777
|
},
|
|
775
778
|
children: [
|
|
776
779
|
$.prefix ? /* @__PURE__ */ e("span", { className: "combobox__option-prefix", "aria-hidden": "true", children: $.prefix }) : null,
|
|
@@ -783,7 +786,7 @@ function pn({
|
|
|
783
786
|
s ? /* @__PURE__ */ e("p", { className: "combobox__error-text", id: C, children: s }) : null
|
|
784
787
|
] });
|
|
785
788
|
}
|
|
786
|
-
function
|
|
789
|
+
function bn({
|
|
787
790
|
options: t,
|
|
788
791
|
ariaLabel: n,
|
|
789
792
|
name: r,
|
|
@@ -795,17 +798,13 @@ function fn({
|
|
|
795
798
|
}) {
|
|
796
799
|
const c = W();
|
|
797
800
|
if (t.length === 0) return null;
|
|
798
|
-
const _ = r ?? c, d = t.find((p) => p.value === a && !p.disabled) ?? t.find((p) => !p.disabled) ?? t[0], b =
|
|
799
|
-
"switch-control",
|
|
800
|
-
`switch-control--${s}`,
|
|
801
|
-
o ? "switch-control--full" : ""
|
|
802
|
-
].filter(Boolean).join(" ");
|
|
801
|
+
const _ = r ?? c, d = t.find((p) => p.value === a && !p.disabled) ?? t.find((p) => !p.disabled) ?? t[0], b = T("switch-control", `switch-control--${s}`, o ? "switch-control--full" : "");
|
|
803
802
|
return /* @__PURE__ */ e("div", { className: b, role: "radiogroup", "aria-label": n, children: t.map((p) => /* @__PURE__ */ i("label", { className: "switch-control__option", title: p.tooltip, children: [
|
|
804
803
|
/* @__PURE__ */ e(
|
|
805
804
|
"input",
|
|
806
805
|
{
|
|
807
806
|
type: "radio",
|
|
808
|
-
className: "sr-only",
|
|
807
|
+
className: "q1-sr-only",
|
|
809
808
|
name: _,
|
|
810
809
|
value: p.value,
|
|
811
810
|
defaultChecked: p.value === d.value,
|
|
@@ -814,10 +813,10 @@ function fn({
|
|
|
814
813
|
}
|
|
815
814
|
),
|
|
816
815
|
p.icon ? /* @__PURE__ */ e("span", { className: "switch-control__icon", "aria-hidden": "true", children: p.icon }) : null,
|
|
817
|
-
/* @__PURE__ */ e("span", { className: u ? "sr-only" : void 0, children: p.label })
|
|
816
|
+
/* @__PURE__ */ e("span", { className: u ? "q1-sr-only" : void 0, children: p.label })
|
|
818
817
|
] }, p.value)) });
|
|
819
818
|
}
|
|
820
|
-
function
|
|
819
|
+
function yn({
|
|
821
820
|
defaultOn: t = !1,
|
|
822
821
|
disabled: n,
|
|
823
822
|
size: r = "md",
|
|
@@ -850,19 +849,19 @@ function _n({
|
|
|
850
849
|
}
|
|
851
850
|
);
|
|
852
851
|
}
|
|
853
|
-
function
|
|
854
|
-
return /* @__PURE__ */ e(
|
|
852
|
+
function Be({ tokens: t }) {
|
|
853
|
+
return /* @__PURE__ */ e(K, { children: t.map(
|
|
855
854
|
(n, r) => n.type ? /* @__PURE__ */ e("span", { className: `tok-${n.type}`, children: n.text }, r) : /* @__PURE__ */ e("span", { children: n.text }, r)
|
|
856
855
|
) });
|
|
857
856
|
}
|
|
858
|
-
function
|
|
859
|
-
return /* @__PURE__ */ e("pre", { className: "code-block", "aria-label": n, children: /* @__PURE__ */ e("code", { children: t.map((r, a) => /* @__PURE__ */ e("span", { className: "code-line", children: /* @__PURE__ */ e(
|
|
857
|
+
function gn({ lines: t, ariaLabel: n }) {
|
|
858
|
+
return /* @__PURE__ */ e("pre", { className: "code-block", "aria-label": n, children: /* @__PURE__ */ e("code", { children: t.map((r, a) => /* @__PURE__ */ e("span", { className: "code-line", children: /* @__PURE__ */ e(Be, { tokens: r }) }, a)) }) });
|
|
860
859
|
}
|
|
861
|
-
function
|
|
860
|
+
function Nn({ children: t }) {
|
|
862
861
|
return /* @__PURE__ */ e("code", { className: "code-inline", children: t });
|
|
863
862
|
}
|
|
864
|
-
function
|
|
865
|
-
const { lineNumbers: n = !0 } = t, { copied: r, copy: a, reset: l } =
|
|
863
|
+
function kn(t) {
|
|
864
|
+
const { lineNumbers: n = !0 } = t, { copied: r, copy: a, reset: l } = ce(), [s, o] = E(0), u = t.tabs ? t.tabs[s] ?? t.tabs[0] : void 0, c = u ? u.lines : t.lines ?? [], _ = u ? u.filename : t.filename, d = c.map((p) => p.tokens.map((m) => m.text).join("")).join(`
|
|
866
865
|
`);
|
|
867
866
|
let b = 0;
|
|
868
867
|
return /* @__PURE__ */ i("div", { className: "codeblock", children: [
|
|
@@ -881,7 +880,7 @@ function gn(t) {
|
|
|
881
880
|
},
|
|
882
881
|
p.label
|
|
883
882
|
)) }) : _ ? /* @__PURE__ */ i("span", { className: "codeblock__filename", children: [
|
|
884
|
-
/* @__PURE__ */ e(
|
|
883
|
+
/* @__PURE__ */ e(xe, { size: 14, strokeWidth: 2, "aria-hidden": "true" }),
|
|
885
884
|
_
|
|
886
885
|
] }) : /* @__PURE__ */ e("span", {}),
|
|
887
886
|
/* @__PURE__ */ e(
|
|
@@ -891,12 +890,12 @@ function gn(t) {
|
|
|
891
890
|
className: "codeblock__copy",
|
|
892
891
|
"aria-label": "复制代码",
|
|
893
892
|
onClick: () => a(d, "已复制代码"),
|
|
894
|
-
children: r ? /* @__PURE__ */ e(
|
|
893
|
+
children: r ? /* @__PURE__ */ e(B, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(te, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
|
|
895
894
|
}
|
|
896
895
|
)
|
|
897
896
|
] }),
|
|
898
897
|
u?.filename ? /* @__PURE__ */ i("div", { className: "codeblock__tabfile", children: [
|
|
899
|
-
/* @__PURE__ */ e(
|
|
898
|
+
/* @__PURE__ */ e(xe, { size: 14, strokeWidth: 2, "aria-hidden": "true" }),
|
|
900
899
|
u.filename
|
|
901
900
|
] }) : null,
|
|
902
901
|
/* @__PURE__ */ e("pre", { className: "codeblock__pre", children: /* @__PURE__ */ e("code", { children: c.map((p, m) => {
|
|
@@ -908,7 +907,7 @@ function gn(t) {
|
|
|
908
907
|
className: `codeblock__line${p.state ? ` codeblock__line--${p.state}` : ""}`,
|
|
909
908
|
children: [
|
|
910
909
|
n ? /* @__PURE__ */ e("span", { className: "codeblock__ln", "aria-hidden": "true", children: y }) : null,
|
|
911
|
-
/* @__PURE__ */ e("span", { className: "codeblock__code", children: /* @__PURE__ */ e(
|
|
910
|
+
/* @__PURE__ */ e("span", { className: "codeblock__code", children: /* @__PURE__ */ e(Be, { tokens: p.tokens }) })
|
|
912
911
|
]
|
|
913
912
|
},
|
|
914
913
|
m
|
|
@@ -916,7 +915,7 @@ function gn(t) {
|
|
|
916
915
|
}) }) })
|
|
917
916
|
] });
|
|
918
917
|
}
|
|
919
|
-
function
|
|
918
|
+
function wn({
|
|
920
919
|
tabs: t,
|
|
921
920
|
ariaLabel: n,
|
|
922
921
|
variant: r = "default"
|
|
@@ -982,7 +981,7 @@ function Nn({
|
|
|
982
981
|
);
|
|
983
982
|
return d.tooltip ? /* @__PURE__ */ i("span", { className: "tabs-control__tab-wrapper", title: d.tooltip, children: [
|
|
984
983
|
p,
|
|
985
|
-
/* @__PURE__ */ e("span", { id: b, className: "sr-only", children: d.tooltip })
|
|
984
|
+
/* @__PURE__ */ e("span", { id: b, className: "q1-sr-only", children: d.tooltip })
|
|
986
985
|
] }, d.id) : p;
|
|
987
986
|
})
|
|
988
987
|
}
|
|
@@ -999,19 +998,19 @@ function Nn({
|
|
|
999
998
|
) : null
|
|
1000
999
|
] });
|
|
1001
1000
|
}
|
|
1002
|
-
const
|
|
1003
|
-
function
|
|
1001
|
+
const He = Se(null);
|
|
1002
|
+
function vn({ multiple: t, children: n }) {
|
|
1004
1003
|
const [r, a] = E(null);
|
|
1005
|
-
return /* @__PURE__ */ e("div", { className: "collapse-group", children: /* @__PURE__ */ e(
|
|
1004
|
+
return /* @__PURE__ */ e("div", { className: "collapse-group", children: /* @__PURE__ */ e(He.Provider, { value: t ? null : { openId: r, setOpenId: a }, children: n }) });
|
|
1006
1005
|
}
|
|
1007
|
-
function
|
|
1006
|
+
function xn({
|
|
1008
1007
|
title: t,
|
|
1009
1008
|
defaultOpen: n,
|
|
1010
1009
|
small: r,
|
|
1011
1010
|
children: a
|
|
1012
1011
|
}) {
|
|
1013
|
-
const l =
|
|
1014
|
-
|
|
1012
|
+
const l = Te(He), s = W(), [o, u] = E(n ?? !1);
|
|
1013
|
+
V(() => {
|
|
1015
1014
|
l && n && l.setOpenId(s);
|
|
1016
1015
|
}, []);
|
|
1017
1016
|
const c = l ? l.openId === s : o, _ = typeof t == "function" ? t(c) : t;
|
|
@@ -1028,15 +1027,15 @@ function wn({
|
|
|
1028
1027
|
},
|
|
1029
1028
|
children: [
|
|
1030
1029
|
/* @__PURE__ */ e("span", { className: "collapse__title", children: _ }),
|
|
1031
|
-
/* @__PURE__ */ e(
|
|
1030
|
+
/* @__PURE__ */ e(H, { className: "collapse__chevron", size: 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
1032
1031
|
]
|
|
1033
1032
|
}
|
|
1034
1033
|
),
|
|
1035
1034
|
/* @__PURE__ */ e("div", { className: `collapse__panel${c ? " collapse__panel--open" : ""}`, id: s, children: /* @__PURE__ */ e("div", { className: "collapse__content", children: a }) })
|
|
1036
1035
|
] });
|
|
1037
1036
|
}
|
|
1038
|
-
function
|
|
1039
|
-
const [a, l] = E(!1), [s, o] = E(""), [u, c] = E(0), _ = I(null), d = I(null), b = I(null), p = I(null), m =
|
|
1037
|
+
function Cn({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r }) {
|
|
1038
|
+
const [a, l] = E(!1), [s, o] = E(""), [u, c] = E(0), _ = I(null), d = I(null), b = I(null), p = I(null), m = _e(() => {
|
|
1040
1039
|
const f = s.trim().toLowerCase();
|
|
1041
1040
|
let N = 0;
|
|
1042
1041
|
return t.map((v) => ({
|
|
@@ -1044,7 +1043,7 @@ function vn({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r })
|
|
|
1044
1043
|
items: v.items.filter((D) => f.length === 0 || D.label.toLowerCase().includes(f)).map((D) => ({ item: D, flatIndex: N++ }))
|
|
1045
1044
|
})).filter((v) => v.items.length > 0);
|
|
1046
1045
|
}, [t, s]), y = m.reduce((f, N) => f + N.items.length, 0);
|
|
1047
|
-
|
|
1046
|
+
L(() => {
|
|
1048
1047
|
if (!a) return;
|
|
1049
1048
|
o(""), c(0);
|
|
1050
1049
|
const f = document.activeElement;
|
|
@@ -1055,7 +1054,7 @@ function vn({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r })
|
|
|
1055
1054
|
const v = p.current;
|
|
1056
1055
|
(v && document.contains(v) ? v : _.current)?.focus();
|
|
1057
1056
|
};
|
|
1058
|
-
}, [a]),
|
|
1057
|
+
}, [a]), L(() => {
|
|
1059
1058
|
if (!r) return;
|
|
1060
1059
|
function f(N) {
|
|
1061
1060
|
N.repeat || (N.metaKey || N.ctrlKey) && N.key.toLowerCase() === "k" && (N.preventDefault(), l((v) => !v));
|
|
@@ -1082,7 +1081,7 @@ function vn({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r })
|
|
|
1082
1081
|
}
|
|
1083
1082
|
return /* @__PURE__ */ i("div", { className: "command-palette-wrap", children: [
|
|
1084
1083
|
/* @__PURE__ */ i("button", { ref: _, type: "button", className: "command-palette__trigger", onClick: () => l(!0), children: [
|
|
1085
|
-
/* @__PURE__ */ e(
|
|
1084
|
+
/* @__PURE__ */ e(se, { size: 16, strokeWidth: 2, "aria-hidden": "true" }),
|
|
1086
1085
|
n,
|
|
1087
1086
|
/* @__PURE__ */ e("kbd", { className: "command-palette__hint", children: "⌘K" })
|
|
1088
1087
|
] }),
|
|
@@ -1099,7 +1098,7 @@ function vn({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r })
|
|
|
1099
1098
|
),
|
|
1100
1099
|
/* @__PURE__ */ i("div", { className: "command-palette__panel", ref: d, children: [
|
|
1101
1100
|
/* @__PURE__ */ i("div", { className: "command-palette__search", children: [
|
|
1102
|
-
/* @__PURE__ */ e(
|
|
1101
|
+
/* @__PURE__ */ e(se, { size: 18, strokeWidth: 2, "aria-hidden": "true" }),
|
|
1103
1102
|
/* @__PURE__ */ e(
|
|
1104
1103
|
"input",
|
|
1105
1104
|
{
|
|
@@ -1115,7 +1114,7 @@ function vn({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r })
|
|
|
1115
1114
|
),
|
|
1116
1115
|
/* @__PURE__ */ e("kbd", { children: "Esc" })
|
|
1117
1116
|
] }),
|
|
1118
|
-
/* @__PURE__ */ i("p", { className: "sr-only", "aria-live": "polite", children: [
|
|
1117
|
+
/* @__PURE__ */ i("p", { className: "q1-sr-only", "aria-live": "polite", children: [
|
|
1119
1118
|
y,
|
|
1120
1119
|
" 个结果"
|
|
1121
1120
|
] }),
|
|
@@ -1134,7 +1133,7 @@ function vn({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r })
|
|
|
1134
1133
|
onMouseEnter: () => c(D),
|
|
1135
1134
|
onClick: () => l(!1),
|
|
1136
1135
|
children: [
|
|
1137
|
-
/* @__PURE__ */ e(
|
|
1136
|
+
/* @__PURE__ */ e(qe, { size: 15, strokeWidth: 2, "aria-hidden": "true" }),
|
|
1138
1137
|
/* @__PURE__ */ e("span", { className: "command-palette__entry-label", children: v.label }),
|
|
1139
1138
|
v.suffix ? /* @__PURE__ */ e("span", { className: "command-palette__suffix", "aria-hidden": "true", children: v.suffix }) : null,
|
|
1140
1139
|
v.keybind ? /* @__PURE__ */ e("kbd", { className: "command-palette__kbd", children: v.keybind }) : null
|
|
@@ -1148,7 +1147,7 @@ function vn({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r })
|
|
|
1148
1147
|
] }) : null
|
|
1149
1148
|
] });
|
|
1150
1149
|
}
|
|
1151
|
-
function
|
|
1150
|
+
function $n({
|
|
1152
1151
|
open: t,
|
|
1153
1152
|
onClose: n,
|
|
1154
1153
|
title: r,
|
|
@@ -1161,7 +1160,7 @@ function xn({
|
|
|
1161
1160
|
onConfirm: _
|
|
1162
1161
|
}) {
|
|
1163
1162
|
const [d, b] = E(""), [p, m] = E(null), y = I(null), k = I(null), f = W(), N = W(), v = d === o && !c;
|
|
1164
|
-
if (
|
|
1163
|
+
if (L(() => {
|
|
1165
1164
|
if (!t) return;
|
|
1166
1165
|
b(""), m(null);
|
|
1167
1166
|
const h = document.body.style.overflow;
|
|
@@ -1173,7 +1172,7 @@ function xn({
|
|
|
1173
1172
|
return () => {
|
|
1174
1173
|
window.clearTimeout(x), document.body.style.overflow = h;
|
|
1175
1174
|
};
|
|
1176
|
-
}, [t]),
|
|
1175
|
+
}, [t]), V(() => {
|
|
1177
1176
|
t && c && y.current && !y.current.contains(document.activeElement) && y.current.focus();
|
|
1178
1177
|
}, [t, c]), !t) return null;
|
|
1179
1178
|
function D() {
|
|
@@ -1220,7 +1219,7 @@ function xn({
|
|
|
1220
1219
|
children: [
|
|
1221
1220
|
/* @__PURE__ */ i("header", { className: "modal__header", children: [
|
|
1222
1221
|
/* @__PURE__ */ e("h2", { className: "modal__title", id: f, children: r }),
|
|
1223
|
-
/* @__PURE__ */ e("button", { type: "button", className: "modal__close", "aria-label": "关闭", disabled: c, onClick: n, children: /* @__PURE__ */ e(
|
|
1222
|
+
/* @__PURE__ */ e("button", { type: "button", className: "modal__close", "aria-label": "关闭", disabled: c, onClick: n, children: /* @__PURE__ */ e(j, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })
|
|
1224
1223
|
] }),
|
|
1225
1224
|
/* @__PURE__ */ i("div", { className: "modal__body", children: [
|
|
1226
1225
|
/* @__PURE__ */ e("p", { children: a }),
|
|
@@ -1262,14 +1261,14 @@ function xn({
|
|
|
1262
1261
|
"aria-busy": c || void 0,
|
|
1263
1262
|
onClick: D,
|
|
1264
1263
|
children: [
|
|
1265
|
-
c ? /* @__PURE__ */ e(
|
|
1264
|
+
c ? /* @__PURE__ */ e(oe, { className: "destructive-modal__spinner", size: 14, strokeWidth: 2, "aria-hidden": "true" }) : null,
|
|
1266
1265
|
l
|
|
1267
1266
|
]
|
|
1268
1267
|
}
|
|
1269
1268
|
)
|
|
1270
1269
|
] }),
|
|
1271
1270
|
u ? /* @__PURE__ */ i("div", { className: "destructive-modal__band", children: [
|
|
1272
|
-
/* @__PURE__ */ e(
|
|
1271
|
+
/* @__PURE__ */ e(ie, { size: 15, strokeWidth: 2, "aria-hidden": "true" }),
|
|
1273
1272
|
/* @__PURE__ */ e("span", { children: u })
|
|
1274
1273
|
] }) : null
|
|
1275
1274
|
]
|
|
@@ -1277,7 +1276,7 @@ function xn({
|
|
|
1277
1276
|
)
|
|
1278
1277
|
] });
|
|
1279
1278
|
}
|
|
1280
|
-
function
|
|
1279
|
+
function Dn({
|
|
1281
1280
|
open: t,
|
|
1282
1281
|
onClose: n,
|
|
1283
1282
|
title: r,
|
|
@@ -1286,7 +1285,7 @@ function Cn({
|
|
|
1286
1285
|
height: s
|
|
1287
1286
|
}) {
|
|
1288
1287
|
const o = I(null), u = W(), [c, _] = E(0), d = I(null), b = I(!1);
|
|
1289
|
-
if (
|
|
1288
|
+
if (L(() => {
|
|
1290
1289
|
if (!t) return;
|
|
1291
1290
|
const N = document.body.style.overflow;
|
|
1292
1291
|
document.body.style.overflow = "hidden";
|
|
@@ -1363,7 +1362,7 @@ function Cn({
|
|
|
1363
1362
|
)
|
|
1364
1363
|
] });
|
|
1365
1364
|
}
|
|
1366
|
-
function
|
|
1365
|
+
function Mn({
|
|
1367
1366
|
icon: t,
|
|
1368
1367
|
title: n,
|
|
1369
1368
|
description: r,
|
|
@@ -1377,7 +1376,7 @@ function $n({
|
|
|
1377
1376
|
a ? /* @__PURE__ */ e("div", { className: "empty-state__actions", children: a }) : null
|
|
1378
1377
|
] });
|
|
1379
1378
|
}
|
|
1380
|
-
function
|
|
1379
|
+
function En({
|
|
1381
1380
|
leading: t,
|
|
1382
1381
|
title: n,
|
|
1383
1382
|
subtitle: r,
|
|
@@ -1394,40 +1393,40 @@ function Dn({
|
|
|
1394
1393
|
a ? /* @__PURE__ */ e("div", { className: "entity__trailing", children: a }) : null
|
|
1395
1394
|
] });
|
|
1396
1395
|
}
|
|
1397
|
-
function
|
|
1396
|
+
function In({
|
|
1398
1397
|
label: t,
|
|
1399
1398
|
size: n = "md",
|
|
1400
1399
|
action: r,
|
|
1401
1400
|
children: a
|
|
1402
1401
|
}) {
|
|
1403
1402
|
return /* @__PURE__ */ i("div", { className: `error-msg error-msg--${n}`, children: [
|
|
1404
|
-
/* @__PURE__ */ e(
|
|
1403
|
+
/* @__PURE__ */ e(ye, { className: "error-msg__icon", size: 16, strokeWidth: 2, "aria-hidden": "true" }),
|
|
1405
1404
|
/* @__PURE__ */ i("span", { className: "error-msg__text", children: [
|
|
1406
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "错误:" }),
|
|
1405
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", children: "错误:" }),
|
|
1407
1406
|
t ? /* @__PURE__ */ e("strong", { className: "error-msg__label", children: t }) : null,
|
|
1408
1407
|
a,
|
|
1409
1408
|
r ? /* @__PURE__ */ e("span", { className: "error-msg__action", children: r }) : null
|
|
1410
1409
|
] })
|
|
1411
1410
|
] });
|
|
1412
1411
|
}
|
|
1413
|
-
function
|
|
1412
|
+
function Sn({ title: t, message: n, action: r }) {
|
|
1414
1413
|
return /* @__PURE__ */ i("div", { className: "error-card", children: [
|
|
1415
|
-
/* @__PURE__ */ e(
|
|
1414
|
+
/* @__PURE__ */ e(ye, { className: "error-card__icon", size: 20, strokeWidth: 2, "aria-hidden": "true" }),
|
|
1416
1415
|
/* @__PURE__ */ i("p", { className: "error-card__title", children: [
|
|
1417
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "错误:" }),
|
|
1416
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", children: "错误:" }),
|
|
1418
1417
|
t
|
|
1419
1418
|
] }),
|
|
1420
1419
|
n ? /* @__PURE__ */ e("p", { className: "error-card__message", children: n }) : null,
|
|
1421
1420
|
r ? /* @__PURE__ */ e("div", { className: "error-card__actions", children: r }) : null
|
|
1422
1421
|
] });
|
|
1423
1422
|
}
|
|
1424
|
-
const
|
|
1425
|
-
{ value: "bad", label: "不太清楚", Icon:
|
|
1426
|
-
{ value: "ok", label: "还可以", Icon:
|
|
1427
|
-
{ value: "good", label: "不错", Icon:
|
|
1428
|
-
{ value: "love", label: "喜欢", Icon:
|
|
1423
|
+
const J = [
|
|
1424
|
+
{ value: "bad", label: "不太清楚", Icon: it },
|
|
1425
|
+
{ value: "ok", label: "还可以", Icon: ut },
|
|
1426
|
+
{ value: "good", label: "不错", Icon: _t },
|
|
1427
|
+
{ value: "love", label: "喜欢", Icon: ct }
|
|
1429
1428
|
];
|
|
1430
|
-
function
|
|
1429
|
+
function Tn({
|
|
1431
1430
|
label: t = "反馈",
|
|
1432
1431
|
prompt: n = "这次体验怎么样?",
|
|
1433
1432
|
placeholder: r = "你的反馈…",
|
|
@@ -1441,7 +1440,7 @@ function In({
|
|
|
1441
1440
|
function f(g) {
|
|
1442
1441
|
g.preventDefault(), d(!0), a || (o(!1), b.current?.focus());
|
|
1443
1442
|
}
|
|
1444
|
-
const N =
|
|
1443
|
+
const N = J.findIndex((g) => g.value === u), v = N === -1 ? 0 : N;
|
|
1445
1444
|
function D(g) {
|
|
1446
1445
|
c(g), d(!1);
|
|
1447
1446
|
}
|
|
@@ -1449,8 +1448,8 @@ function In({
|
|
|
1449
1448
|
const M = g.key === "ArrowRight" || g.key === "ArrowDown", S = g.key === "ArrowLeft" || g.key === "ArrowUp";
|
|
1450
1449
|
if (!M && !S) return;
|
|
1451
1450
|
g.preventDefault();
|
|
1452
|
-
const $ = (w + (M ? 1 :
|
|
1453
|
-
D(
|
|
1451
|
+
const $ = (w + (M ? 1 : J.length - 1)) % J.length;
|
|
1452
|
+
D(J[$].value), p.current[$]?.focus();
|
|
1454
1453
|
}
|
|
1455
1454
|
const h = /* @__PURE__ */ i(
|
|
1456
1455
|
"form",
|
|
@@ -1464,7 +1463,7 @@ function In({
|
|
|
1464
1463
|
children: [
|
|
1465
1464
|
/* @__PURE__ */ i("div", { className: "feedback__head", children: [
|
|
1466
1465
|
/* @__PURE__ */ e("span", { className: "feedback__prompt", id: y, children: n }),
|
|
1467
|
-
/* @__PURE__ */ e("div", { className: "feedback__emotions", role: "radiogroup", "aria-labelledby": y, children:
|
|
1466
|
+
/* @__PURE__ */ e("div", { className: "feedback__emotions", role: "radiogroup", "aria-labelledby": y, children: J.map(({ value: g, label: w, Icon: M }, S) => /* @__PURE__ */ e(
|
|
1468
1467
|
"button",
|
|
1469
1468
|
{
|
|
1470
1469
|
ref: ($) => {
|
|
@@ -1484,14 +1483,14 @@ function In({
|
|
|
1484
1483
|
)) })
|
|
1485
1484
|
] }),
|
|
1486
1485
|
l ? /* @__PURE__ */ i("label", { className: "feedback__field", children: [
|
|
1487
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "反馈主题" }),
|
|
1486
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", children: "反馈主题" }),
|
|
1488
1487
|
/* @__PURE__ */ i("select", { className: "feedback__select", defaultValue: "", children: [
|
|
1489
1488
|
/* @__PURE__ */ e("option", { value: "", disabled: !0, children: "选择主题…" }),
|
|
1490
1489
|
l.map((g) => /* @__PURE__ */ e("option", { value: g, children: g }, g))
|
|
1491
1490
|
] })
|
|
1492
1491
|
] }) : null,
|
|
1493
1492
|
/* @__PURE__ */ i("label", { className: "feedback__field", children: [
|
|
1494
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "反馈内容" }),
|
|
1493
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", children: "反馈内容" }),
|
|
1495
1494
|
/* @__PURE__ */ e("textarea", { className: "feedback__textarea", rows: 3, placeholder: r, onChange: () => d(!1) })
|
|
1496
1495
|
] }),
|
|
1497
1496
|
/* @__PURE__ */ i("div", { className: "feedback__footer", children: [
|
|
@@ -1500,7 +1499,7 @@ function In({
|
|
|
1500
1499
|
] })
|
|
1501
1500
|
]
|
|
1502
1501
|
}
|
|
1503
|
-
), x = /* @__PURE__ */ e("span", { className: "sr-only", role: "status", "aria-live": "polite", children: _ ? "已收到反馈" : "" });
|
|
1502
|
+
), x = /* @__PURE__ */ e("span", { className: "q1-sr-only", role: "status", "aria-live": "polite", children: _ ? "已收到反馈" : "" });
|
|
1504
1503
|
return a ? /* @__PURE__ */ i("div", { className: "feedback feedback--inline", children: [
|
|
1505
1504
|
h,
|
|
1506
1505
|
x
|
|
@@ -1523,7 +1522,7 @@ function In({
|
|
|
1523
1522
|
x
|
|
1524
1523
|
] });
|
|
1525
1524
|
}
|
|
1526
|
-
function
|
|
1525
|
+
function An({
|
|
1527
1526
|
title: t,
|
|
1528
1527
|
subtitle: n,
|
|
1529
1528
|
tone: r,
|
|
@@ -1532,7 +1531,7 @@ function Sn({
|
|
|
1532
1531
|
disabled: s,
|
|
1533
1532
|
children: o
|
|
1534
1533
|
}) {
|
|
1535
|
-
const u =
|
|
1534
|
+
const u = T("fieldset", r ? `fieldset--${r}` : "");
|
|
1536
1535
|
return /* @__PURE__ */ i("fieldset", { className: u, disabled: s, children: [
|
|
1537
1536
|
t ? /* @__PURE__ */ e("legend", { className: "fieldset__title", children: t }) : null,
|
|
1538
1537
|
/* @__PURE__ */ e("p", { className: "fieldset__subtitle", children: n }),
|
|
@@ -1543,21 +1542,21 @@ function Sn({
|
|
|
1543
1542
|
] }) : null
|
|
1544
1543
|
] });
|
|
1545
1544
|
}
|
|
1546
|
-
function
|
|
1545
|
+
function je(t, n, r, a, l) {
|
|
1547
1546
|
const s = t.length;
|
|
1548
1547
|
t.forEach((o, u) => {
|
|
1549
1548
|
const c = `${r}/${o.name}`, _ = o.type === "folder" && (o.children?.length ?? 0) > 0;
|
|
1550
|
-
l.push({ path: c, name: o.name, type: o.type, level: n, parentPath: r, hasChildren: _, setsize: s, posinset: u + 1 }), o.type === "folder" && a.has(c) && o.children &&
|
|
1549
|
+
l.push({ path: c, name: o.name, type: o.type, level: n, parentPath: r, hasChildren: _, setsize: s, posinset: u + 1 }), o.type === "folder" && a.has(c) && o.children && je(o.children, n + 1, c, a, l);
|
|
1551
1550
|
});
|
|
1552
1551
|
}
|
|
1553
|
-
function
|
|
1552
|
+
function qn({
|
|
1554
1553
|
nodes: t,
|
|
1555
1554
|
label: n = "项目目录",
|
|
1556
1555
|
defaultExpanded: r = []
|
|
1557
1556
|
}) {
|
|
1558
|
-
const [a, l] = E(() => new Set(r)), [s, o] = E(() => t.length ? `/${t[0].name}` : ""), u = I(/* @__PURE__ */ new Map()), c =
|
|
1557
|
+
const [a, l] = E(() => new Set(r)), [s, o] = E(() => t.length ? `/${t[0].name}` : ""), u = I(/* @__PURE__ */ new Map()), c = _e(() => {
|
|
1559
1558
|
const m = [];
|
|
1560
|
-
return
|
|
1559
|
+
return je(t, 1, "", a, m), m;
|
|
1561
1560
|
}, [t, a]), _ = c.some((m) => m.path === s) ? s : c[0]?.path ?? "";
|
|
1562
1561
|
function d(m) {
|
|
1563
1562
|
o(m), window.requestAnimationFrame(() => u.current.get(m)?.focus());
|
|
@@ -1575,7 +1574,7 @@ function Tn({
|
|
|
1575
1574
|
m.key === "ArrowDown" ? (m.preventDefault(), y < c.length - 1 && d(c[y + 1].path)) : m.key === "ArrowUp" ? (m.preventDefault(), y > 0 && d(c[y - 1].path)) : m.key === "ArrowRight" ? (m.preventDefault(), k.hasChildren && !a.has(k.path) ? b(k.path, !0) : k.hasChildren && y < c.length - 1 && d(c[y + 1].path)) : m.key === "ArrowLeft" ? (m.preventDefault(), k.hasChildren && a.has(k.path) ? b(k.path, !1) : k.parentPath && d(k.parentPath)) : m.key === "Home" ? (m.preventDefault(), d(c[0].path)) : m.key === "End" ? (m.preventDefault(), d(c[c.length - 1].path)) : (m.key === "Enter" || m.key === " ") && (m.preventDefault(), k.hasChildren && b(k.path));
|
|
1576
1575
|
}
|
|
1577
1576
|
return /* @__PURE__ */ e("ul", { className: "file-tree", role: "tree", "aria-label": n, onKeyDown: p, children: c.map((m) => {
|
|
1578
|
-
const y = a.has(m.path), k = y ?
|
|
1577
|
+
const y = a.has(m.path), k = y ? st : ot;
|
|
1579
1578
|
return /* @__PURE__ */ e(
|
|
1580
1579
|
"li",
|
|
1581
1580
|
{
|
|
@@ -1595,8 +1594,8 @@ function Tn({
|
|
|
1595
1594
|
f.stopPropagation(), o(m.path), m.hasChildren && b(m.path);
|
|
1596
1595
|
},
|
|
1597
1596
|
children: /* @__PURE__ */ i("span", { className: "file-tree__row", children: [
|
|
1598
|
-
m.hasChildren ? /* @__PURE__ */ e(
|
|
1599
|
-
m.type === "folder" ? /* @__PURE__ */ e(k, { className: "file-tree__icon", size: 15, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(
|
|
1597
|
+
m.hasChildren ? /* @__PURE__ */ e(H, { className: `file-tree__chevron${y ? " file-tree__chevron--open" : ""}`, size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e("span", { className: "file-tree__chevron-spacer", "aria-hidden": "true" }),
|
|
1598
|
+
m.type === "folder" ? /* @__PURE__ */ e(k, { className: "file-tree__icon", size: 15, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(lt, { className: "file-tree__icon", size: 15, strokeWidth: 2, "aria-hidden": "true" }),
|
|
1600
1599
|
/* @__PURE__ */ e("span", { className: "file-tree__name", children: m.name })
|
|
1601
1600
|
] })
|
|
1602
1601
|
},
|
|
@@ -1604,28 +1603,28 @@ function Tn({
|
|
|
1604
1603
|
);
|
|
1605
1604
|
}) });
|
|
1606
1605
|
}
|
|
1607
|
-
function
|
|
1606
|
+
function zn({
|
|
1608
1607
|
orientation: t = "horizontal",
|
|
1609
1608
|
decorative: n = !0,
|
|
1610
1609
|
className: r
|
|
1611
1610
|
}) {
|
|
1612
|
-
const a =
|
|
1611
|
+
const a = T("separator", `separator--${t}`, r ?? "");
|
|
1613
1612
|
return n ? /* @__PURE__ */ e("div", { className: a, "aria-hidden": "true" }) : /* @__PURE__ */ e("div", { className: a, role: "separator", "aria-orientation": t });
|
|
1614
1613
|
}
|
|
1615
|
-
function
|
|
1614
|
+
function Wn({
|
|
1616
1615
|
htmlFor: t,
|
|
1617
1616
|
required: n,
|
|
1618
1617
|
children: r
|
|
1619
1618
|
}) {
|
|
1620
1619
|
return /* @__PURE__ */ i("label", { className: "label", htmlFor: t, children: [
|
|
1621
1620
|
r,
|
|
1622
|
-
n ? /* @__PURE__ */ i(
|
|
1621
|
+
n ? /* @__PURE__ */ i(K, { children: [
|
|
1623
1622
|
/* @__PURE__ */ e("span", { className: "label__required", "aria-hidden": "true", children: "*" }),
|
|
1624
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "(必填)" })
|
|
1623
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", children: "(必填)" })
|
|
1625
1624
|
] }) : null
|
|
1626
1625
|
] });
|
|
1627
1626
|
}
|
|
1628
|
-
function
|
|
1627
|
+
function Ne({
|
|
1629
1628
|
focusableIndices: t,
|
|
1630
1629
|
getText: n,
|
|
1631
1630
|
onClose: r
|
|
@@ -1659,13 +1658,13 @@ function ge({
|
|
|
1659
1658
|
}
|
|
1660
1659
|
return { itemRefs: s, focusItem: u, reset: c, onMenuKeyDown: _ };
|
|
1661
1660
|
}
|
|
1662
|
-
const
|
|
1663
|
-
function
|
|
1661
|
+
const vt = (t) => t.type === "item" && !t.disabled || t.type === "link";
|
|
1662
|
+
function Ln({
|
|
1664
1663
|
label: t,
|
|
1665
1664
|
entries: n,
|
|
1666
1665
|
children: r
|
|
1667
1666
|
}) {
|
|
1668
|
-
const [a, l] = E(null), s = I(null), o = I(null), u = I(0), c = W(), _ = a !== null, d = n.flatMap((h, x) =>
|
|
1667
|
+
const [a, l] = E(null), s = I(null), o = I(null), u = I(0), c = W(), _ = a !== null, d = n.flatMap((h, x) => vt(h) ? [x] : []), { itemRefs: b, focusItem: p, reset: m, onMenuKeyDown: y } = Ne({
|
|
1669
1668
|
focusableIndices: d,
|
|
1670
1669
|
getText: (h) => {
|
|
1671
1670
|
const x = n[h];
|
|
@@ -1679,12 +1678,12 @@ function Wn({
|
|
|
1679
1678
|
function f(h = !0) {
|
|
1680
1679
|
l(null), m(), h && s.current?.focus();
|
|
1681
1680
|
}
|
|
1682
|
-
|
|
1681
|
+
V(() => {
|
|
1683
1682
|
if (!a || !o.current) return;
|
|
1684
1683
|
const h = o.current.getBoundingClientRect();
|
|
1685
1684
|
let { x, y: g } = a;
|
|
1686
1685
|
x + h.width > window.innerWidth - 8 && (x = Math.max(8, x - h.width)), g + h.height > window.innerHeight - 8 && (g = Math.max(8, g - h.height)), (x !== a.x || g !== a.y) && l({ x, y: g });
|
|
1687
|
-
}, [a]),
|
|
1686
|
+
}, [a]), L(() => {
|
|
1688
1687
|
if (!_) return;
|
|
1689
1688
|
function h(x) {
|
|
1690
1689
|
o.current && !o.current.contains(x.target) && f(!1);
|
|
@@ -1710,7 +1709,7 @@ function Wn({
|
|
|
1710
1709
|
function C() {
|
|
1711
1710
|
window.clearTimeout(u.current);
|
|
1712
1711
|
}
|
|
1713
|
-
return /* @__PURE__ */ i(
|
|
1712
|
+
return /* @__PURE__ */ i(K, { children: [
|
|
1714
1713
|
/* @__PURE__ */ e(
|
|
1715
1714
|
"div",
|
|
1716
1715
|
{
|
|
@@ -1782,13 +1781,13 @@ function Wn({
|
|
|
1782
1781
|
) : null
|
|
1783
1782
|
] });
|
|
1784
1783
|
}
|
|
1785
|
-
function
|
|
1784
|
+
function Rn({
|
|
1786
1785
|
entries: t,
|
|
1787
1786
|
size: n = "md",
|
|
1788
1787
|
disabled: r,
|
|
1789
1788
|
align: a = "end"
|
|
1790
1789
|
}) {
|
|
1791
|
-
const [l, s] = E(!1), o = I(null), u = W(), c = t.flatMap((f, N) => f.disabled ? [] : [N]), { itemRefs: _, focusItem: d, reset: b, onMenuKeyDown: p } =
|
|
1790
|
+
const [l, s] = E(!1), o = I(null), u = W(), c = t.flatMap((f, N) => f.disabled ? [] : [N]), { itemRefs: _, focusItem: d, reset: b, onMenuKeyDown: p } = Ne({
|
|
1792
1791
|
focusableIndices: c,
|
|
1793
1792
|
getText: (f) => t[f].label,
|
|
1794
1793
|
onClose: () => y()
|
|
@@ -1801,7 +1800,7 @@ function Bn({
|
|
|
1801
1800
|
function y(f = !0) {
|
|
1802
1801
|
s(!1), b(), f && o.current?.focus();
|
|
1803
1802
|
}
|
|
1804
|
-
|
|
1803
|
+
L(() => {
|
|
1805
1804
|
if (!l) return;
|
|
1806
1805
|
function f(N) {
|
|
1807
1806
|
const v = o.current?.closest(".dots-menu");
|
|
@@ -1826,7 +1825,7 @@ function Bn({
|
|
|
1826
1825
|
disabled: r,
|
|
1827
1826
|
onClick: () => l ? y() : m("first"),
|
|
1828
1827
|
onKeyDown: k,
|
|
1829
|
-
children: /* @__PURE__ */ e(
|
|
1828
|
+
children: /* @__PURE__ */ e(Re, { size: n === "sm" ? 14 : n === "lg" ? 20 : 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
1830
1829
|
}
|
|
1831
1830
|
),
|
|
1832
1831
|
l ? /* @__PURE__ */ e(
|
|
@@ -1858,14 +1857,14 @@ function Bn({
|
|
|
1858
1857
|
) : null
|
|
1859
1858
|
] });
|
|
1860
1859
|
}
|
|
1861
|
-
function
|
|
1860
|
+
function Fn({
|
|
1862
1861
|
tone: t,
|
|
1863
1862
|
label: n,
|
|
1864
1863
|
animated: r = !1,
|
|
1865
1864
|
showLabel: a = !1,
|
|
1866
1865
|
titlePrefix: l
|
|
1867
1866
|
}) {
|
|
1868
|
-
const s =
|
|
1867
|
+
const s = T("status-dot", `status-dot--${t}`, r ? "status-dot--animated" : "");
|
|
1869
1868
|
if (a)
|
|
1870
1869
|
return /* @__PURE__ */ i("span", { className: "status-dot-item", children: [
|
|
1871
1870
|
/* @__PURE__ */ e("span", { className: s, "aria-hidden": "true" }),
|
|
@@ -1874,7 +1873,7 @@ function Ln({
|
|
|
1874
1873
|
const o = l ? `${l}:${n}` : n;
|
|
1875
1874
|
return /* @__PURE__ */ e("span", { className: s, role: "img", "aria-label": o, title: o });
|
|
1876
1875
|
}
|
|
1877
|
-
function
|
|
1876
|
+
function Kn({
|
|
1878
1877
|
tone: t = "neutral",
|
|
1879
1878
|
subtle: n = !1,
|
|
1880
1879
|
inverted: r = !1,
|
|
@@ -1886,41 +1885,41 @@ function Rn({
|
|
|
1886
1885
|
children: c,
|
|
1887
1886
|
..._
|
|
1888
1887
|
}) {
|
|
1889
|
-
const d =
|
|
1888
|
+
const d = T(
|
|
1890
1889
|
"badge",
|
|
1891
1890
|
r ? "badge--inverted" : `badge--${t}${n ? "-subtle" : ""}`,
|
|
1892
1891
|
a === "md" ? "" : `badge--${a}`,
|
|
1893
1892
|
s ? "badge--count" : "",
|
|
1894
1893
|
u
|
|
1895
|
-
|
|
1894
|
+
), p = l != null && (c == null || c === "") ? { role: "img", "aria-label": o } : {};
|
|
1896
1895
|
return /* @__PURE__ */ i("span", { className: d, title: o, ...p, ..._, children: [
|
|
1897
1896
|
l ? /* @__PURE__ */ e("span", { className: "badge__icon", "aria-hidden": "true", children: l }) : null,
|
|
1898
1897
|
c
|
|
1899
1898
|
] });
|
|
1900
1899
|
}
|
|
1901
|
-
function
|
|
1902
|
-
const u =
|
|
1900
|
+
function Pn({ href: t, size: n = "md", icon: r, title: a, className: l, children: s, ...o }) {
|
|
1901
|
+
const u = T("badge", "badge--pill", n === "md" ? "" : `badge--${n}`, l), _ = r != null && (s == null || s === "") ? { "aria-label": a } : {};
|
|
1903
1902
|
return /* @__PURE__ */ i("a", { className: u, href: t, title: a, ..._, ...o, children: [
|
|
1904
1903
|
r ? /* @__PURE__ */ e("span", { className: "badge__icon", "aria-hidden": "true", children: r }) : null,
|
|
1905
1904
|
s
|
|
1906
1905
|
] });
|
|
1907
1906
|
}
|
|
1908
|
-
function
|
|
1909
|
-
const _ = r === void 0 && !o, d =
|
|
1907
|
+
function On({ title: t, children: n, tone: r, icon: a, action: l, onDismiss: s, progress: o, className: u, ...c }) {
|
|
1908
|
+
const _ = r === void 0 && !o, d = T(
|
|
1910
1909
|
"banner",
|
|
1911
1910
|
_ ? "banner--announcement" : r === "neutral" ? "" : `banner--${r}`,
|
|
1912
1911
|
o ? "banner--progress" : "",
|
|
1913
1912
|
u
|
|
1914
|
-
|
|
1913
|
+
), b = /* @__PURE__ */ i("p", { className: "banner__content", children: [
|
|
1915
1914
|
/* @__PURE__ */ e("span", { className: "banner__title", children: t }),
|
|
1916
|
-
n != null ? /* @__PURE__ */ i(
|
|
1915
|
+
n != null ? /* @__PURE__ */ i(K, { children: [
|
|
1917
1916
|
" — ",
|
|
1918
1917
|
n
|
|
1919
1918
|
] }) : null
|
|
1920
1919
|
] }), p = l ? _ ? /* @__PURE__ */ e("a", { className: "banner__cta", href: l.href, children: l.label }) : /* @__PURE__ */ i("a", { className: "banner__action", href: l.href, children: [
|
|
1921
1920
|
l.label,
|
|
1922
|
-
/* @__PURE__ */ e(
|
|
1923
|
-
] }) : null, m = !_ && s ? /* @__PURE__ */ e("button", { className: "banner__close", type: "button", "aria-label": "关闭横幅", onClick: s, children: /* @__PURE__ */ e(
|
|
1921
|
+
/* @__PURE__ */ e(H, { "aria-hidden": "true", size: 16, strokeWidth: 2 })
|
|
1922
|
+
] }) : null, m = !_ && s ? /* @__PURE__ */ e("button", { className: "banner__close", type: "button", "aria-label": "关闭横幅", onClick: s, children: /* @__PURE__ */ e(j, { "aria-hidden": "true", size: 16, strokeWidth: 2 }) }) : null;
|
|
1924
1923
|
if (o) {
|
|
1925
1924
|
const y = Number.isFinite(o.value) ? Math.min(100, Math.max(0, o.value)) : 0;
|
|
1926
1925
|
return /* @__PURE__ */ i("div", { className: d, ...c, children: [
|
|
@@ -1955,22 +1954,22 @@ function Kn({ title: t, children: n, tone: r, icon: a, action: l, onDismiss: s,
|
|
|
1955
1954
|
] }) : p ?? m
|
|
1956
1955
|
] });
|
|
1957
1956
|
}
|
|
1958
|
-
function
|
|
1959
|
-
return
|
|
1960
|
-
"card",
|
|
1961
|
-
t ? "card--hover" : "",
|
|
1962
|
-
n ? "card--secondary" : "",
|
|
1963
|
-
r ? "card--divided" : "",
|
|
1957
|
+
function xt({ hover: t, secondary: n, divided: r, direction: a, shadow: l, bordered: s, className: o }) {
|
|
1958
|
+
return T(
|
|
1959
|
+
"q1-card",
|
|
1960
|
+
t ? "q1-card--hover" : "",
|
|
1961
|
+
n ? "q1-card--secondary" : "",
|
|
1962
|
+
r ? "q1-card--divided" : "",
|
|
1964
1963
|
// 横向与分隔线正交:row 只管横向铺开;分隔线由 divided 决定,两者组合才在段间画左向线。
|
|
1965
|
-
a === "row" ? "card--row" : "",
|
|
1966
|
-
l ? "card--shadow" : "",
|
|
1964
|
+
a === "row" ? "q1-card--row" : "",
|
|
1965
|
+
l ? "q1-card--shadow" : "",
|
|
1967
1966
|
// bordered 默认 true;显式 false 才降级为无框(用 === false 而非 !bordered,让 undefined 保持有框)。
|
|
1968
|
-
s === !1 ? "card--borderless" : "",
|
|
1967
|
+
s === !1 ? "q1-card--borderless" : "",
|
|
1969
1968
|
o
|
|
1970
|
-
|
|
1969
|
+
);
|
|
1971
1970
|
}
|
|
1972
|
-
function
|
|
1973
|
-
const n =
|
|
1971
|
+
function Bn(t) {
|
|
1972
|
+
const n = xt(t);
|
|
1974
1973
|
if (t.href !== void 0) {
|
|
1975
1974
|
const {
|
|
1976
1975
|
hover: p,
|
|
@@ -1999,7 +1998,7 @@ function Pn(t) {
|
|
|
1999
1998
|
} = t;
|
|
2000
1999
|
return /* @__PURE__ */ e("div", { className: n, ...b, children: d });
|
|
2001
2000
|
}
|
|
2002
|
-
function
|
|
2001
|
+
function Ct({
|
|
2003
2002
|
content: t,
|
|
2004
2003
|
placement: n = "top",
|
|
2005
2004
|
delay: r = 150,
|
|
@@ -2014,23 +2013,23 @@ function vt({
|
|
|
2014
2013
|
left: 0,
|
|
2015
2014
|
top: 0,
|
|
2016
2015
|
caret: 0
|
|
2017
|
-
}), p = I(null), m = I(null), y = I(null), k = W(), f =
|
|
2016
|
+
}), p = I(null), m = I(null), y = I(null), k = W(), f = ee(() => {
|
|
2018
2017
|
const g = m.current, w = y.current;
|
|
2019
2018
|
if (!g || !w) return;
|
|
2020
|
-
const M = 8, S = 8, $ = g.getBoundingClientRect(),
|
|
2021
|
-
let
|
|
2022
|
-
n === "top" && $.top - S -
|
|
2023
|
-
let
|
|
2024
|
-
|
|
2025
|
-
const
|
|
2026
|
-
b({ p:
|
|
2019
|
+
const M = 8, S = 8, $ = g.getBoundingClientRect(), q = w.offsetWidth, R = w.offsetHeight, X = document.documentElement.clientWidth, Z = document.documentElement.clientHeight, Q = $.left + $.width / 2, ke = $.top + $.height / 2;
|
|
2020
|
+
let F = n;
|
|
2021
|
+
n === "top" && $.top - S - R < M && $.bottom + S + R <= Z - M ? F = "bottom" : n === "bottom" && $.bottom + S + R > Z - M && $.top - S - R >= M ? F = "top" : n === "left" && $.left - S - q < M && $.right + S + q <= X - M ? F = "right" : n === "right" && $.right + S + q > X - M && $.left - S - q >= M && (F = "left");
|
|
2022
|
+
let U, Y;
|
|
2023
|
+
F === "top" || F === "bottom" ? (U = s === "start" ? $.left : s === "end" ? $.right - q : Q - q / 2, Y = F === "top" ? $.top - S - R : $.bottom + S) : (Y = s === "start" ? $.top : s === "end" ? $.bottom - R : ke - R / 2, U = F === "left" ? $.left - S - q : $.right + S), U = Math.max(M, Math.min(U, X - M - q)), Y = Math.max(M, Math.min(Y, Z - M - R));
|
|
2024
|
+
const Xe = F === "top" || F === "bottom" ? Math.max(12, Math.min(q - 12, Q - U)) : Math.max(12, Math.min(R - 12, ke - Y));
|
|
2025
|
+
b({ p: F, left: U, top: Y, caret: Xe });
|
|
2027
2026
|
}, [n, s]);
|
|
2028
|
-
|
|
2027
|
+
V(() => {
|
|
2029
2028
|
if (c)
|
|
2030
2029
|
return f(), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
|
|
2031
2030
|
window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
|
|
2032
2031
|
};
|
|
2033
|
-
}, [c, f]),
|
|
2032
|
+
}, [c, f]), L(
|
|
2034
2033
|
() => () => {
|
|
2035
2034
|
p.current && clearTimeout(p.current);
|
|
2036
2035
|
},
|
|
@@ -2046,20 +2045,20 @@ function vt({
|
|
|
2046
2045
|
left: d.left,
|
|
2047
2046
|
top: d.top,
|
|
2048
2047
|
"--tt-caret": `${d.caret}px`
|
|
2049
|
-
}, C =
|
|
2050
|
-
"tooltip__bubble",
|
|
2051
|
-
`tooltip__bubble--${d.p}`,
|
|
2052
|
-
c ? "tooltip__bubble--open" : "",
|
|
2053
|
-
o ? "" : "tooltip__bubble--no-tip",
|
|
2054
|
-
u ? "tooltip__bubble--center" : ""
|
|
2055
|
-
|
|
2048
|
+
}, C = T(
|
|
2049
|
+
"q1-tooltip__bubble",
|
|
2050
|
+
`q1-tooltip__bubble--${d.p}`,
|
|
2051
|
+
c ? "q1-tooltip__bubble--open" : "",
|
|
2052
|
+
o ? "" : "q1-tooltip__bubble--no-tip",
|
|
2053
|
+
u ? "q1-tooltip__bubble--center" : ""
|
|
2054
|
+
);
|
|
2056
2055
|
function h(g) {
|
|
2057
2056
|
g.key === "Escape" && v();
|
|
2058
2057
|
}
|
|
2059
|
-
l && (!
|
|
2058
|
+
l && (!we(l) || l.type === ve) && console.warn(
|
|
2060
2059
|
`Tooltip:children 必须是单个合法元素/组件(不能是纯文本、Fragment 或多个子节点),已回退为默认触发器${a ? `(文案:"${a}")` : "——但没有传 triggerLabel,会渲染成一个看不出用途的空文案按钮"}。`
|
|
2061
2060
|
);
|
|
2062
|
-
const x = l &&
|
|
2061
|
+
const x = l && we(l) && l.type !== ve ? Ze(l, {
|
|
2063
2062
|
"aria-describedby": k,
|
|
2064
2063
|
onFocus: (g) => {
|
|
2065
2064
|
l.props.onFocus?.(g), N();
|
|
@@ -2074,7 +2073,7 @@ function vt({
|
|
|
2074
2073
|
"button",
|
|
2075
2074
|
{
|
|
2076
2075
|
type: "button",
|
|
2077
|
-
className: "tooltip__trigger",
|
|
2076
|
+
className: "q1-tooltip__trigger",
|
|
2078
2077
|
"aria-describedby": k,
|
|
2079
2078
|
onFocus: N,
|
|
2080
2079
|
onBlur: v,
|
|
@@ -2082,31 +2081,31 @@ function vt({
|
|
|
2082
2081
|
children: a
|
|
2083
2082
|
}
|
|
2084
2083
|
);
|
|
2085
|
-
return /* @__PURE__ */ i("span", { ref: m, className: "tooltip", onMouseEnter: N, onMouseLeave: v, children: [
|
|
2084
|
+
return /* @__PURE__ */ i("span", { ref: m, className: "q1-tooltip", onMouseEnter: N, onMouseLeave: v, children: [
|
|
2086
2085
|
x,
|
|
2087
|
-
|
|
2086
|
+
Qe(
|
|
2088
2087
|
/* @__PURE__ */ e("span", { ref: y, role: "tooltip", id: k, className: C, style: D, children: t }),
|
|
2089
2088
|
document.body
|
|
2090
2089
|
)
|
|
2091
2090
|
] });
|
|
2092
2091
|
}
|
|
2093
|
-
function
|
|
2092
|
+
function Hn({
|
|
2094
2093
|
title: t,
|
|
2095
2094
|
tooltip: n,
|
|
2096
2095
|
align: r,
|
|
2097
2096
|
ellipsis: a,
|
|
2098
2097
|
children: l
|
|
2099
2098
|
}) {
|
|
2100
|
-
const s =
|
|
2099
|
+
const s = T("description", r === "right" ? "description--right" : "");
|
|
2101
2100
|
return /* @__PURE__ */ i("dl", { className: s, children: [
|
|
2102
2101
|
/* @__PURE__ */ i("dt", { className: "description__title", children: [
|
|
2103
2102
|
t,
|
|
2104
|
-
n ? /* @__PURE__ */ e(
|
|
2103
|
+
n ? /* @__PURE__ */ e(Ct, { content: n, placement: "top", children: /* @__PURE__ */ e("button", { type: "button", className: "description__hint", "aria-label": `${t}说明`, children: /* @__PURE__ */ e(le, { size: 13, strokeWidth: 2, "aria-hidden": "true" }) }) }) : null
|
|
2105
2104
|
] }),
|
|
2106
2105
|
/* @__PURE__ */ e("dd", { className: `description__value${a ? " description__value--ellipsis" : ""}`, children: l })
|
|
2107
2106
|
] });
|
|
2108
2107
|
}
|
|
2109
|
-
function
|
|
2108
|
+
function jn({
|
|
2110
2109
|
name: t,
|
|
2111
2110
|
identity: n,
|
|
2112
2111
|
rows: r,
|
|
@@ -2115,12 +2114,12 @@ function On({
|
|
|
2115
2114
|
align: s = "start",
|
|
2116
2115
|
children: o
|
|
2117
2116
|
}) {
|
|
2118
|
-
const [u, c] = E(!1), _ =
|
|
2117
|
+
const [u, c] = E(!1), _ = T(
|
|
2119
2118
|
"context-card-wrap",
|
|
2120
2119
|
`context-card-wrap--${l}`,
|
|
2121
2120
|
s !== "start" ? `context-card-wrap--align-${s}` : "",
|
|
2122
2121
|
u ? "context-card-wrap--dismissed" : ""
|
|
2123
|
-
|
|
2122
|
+
);
|
|
2124
2123
|
return /* @__PURE__ */ i(
|
|
2125
2124
|
"span",
|
|
2126
2125
|
{
|
|
@@ -2155,7 +2154,7 @@ function On({
|
|
|
2155
2154
|
}
|
|
2156
2155
|
);
|
|
2157
2156
|
}
|
|
2158
|
-
function
|
|
2157
|
+
function Un({
|
|
2159
2158
|
title: t,
|
|
2160
2159
|
variant: n = "stripe",
|
|
2161
2160
|
color: r,
|
|
@@ -2169,7 +2168,7 @@ function qn({
|
|
|
2169
2168
|
style: d,
|
|
2170
2169
|
...b
|
|
2171
2170
|
}) {
|
|
2172
|
-
const p =
|
|
2171
|
+
const p = T("book", `book--${n}`, u ? "book--textured" : "", _), m = typeof c == "number" ? Number.isFinite(c) && c > 0 ? `${c}px` : void 0 : c, y = {
|
|
2173
2172
|
...d,
|
|
2174
2173
|
...r ? { "--book-cover": r } : null,
|
|
2175
2174
|
...a ? { "--book-band": a } : null,
|
|
@@ -2190,73 +2189,73 @@ function qn({
|
|
|
2190
2189
|
/* @__PURE__ */ e("span", { className: "book__pages", "aria-hidden": "true" })
|
|
2191
2190
|
] }) });
|
|
2192
2191
|
}
|
|
2193
|
-
function
|
|
2194
|
-
return /* @__PURE__ */ i("span", { className:
|
|
2192
|
+
function $t({ className: t } = {}) {
|
|
2193
|
+
return /* @__PURE__ */ i("span", { className: T("browser__dots", t), "aria-hidden": "true", children: [
|
|
2195
2194
|
/* @__PURE__ */ e("span", { className: "browser__dot browser__dot--close" }),
|
|
2196
2195
|
/* @__PURE__ */ e("span", { className: "browser__dot browser__dot--minimize" }),
|
|
2197
2196
|
/* @__PURE__ */ e("span", { className: "browser__dot browser__dot--expand" })
|
|
2198
2197
|
] });
|
|
2199
2198
|
}
|
|
2200
|
-
function
|
|
2201
|
-
return /* @__PURE__ */ i("span", { className:
|
|
2202
|
-
/* @__PURE__ */ e(
|
|
2203
|
-
/* @__PURE__ */ e(
|
|
2204
|
-
/* @__PURE__ */ e(
|
|
2199
|
+
function Dt({ className: t } = {}) {
|
|
2200
|
+
return /* @__PURE__ */ i("span", { className: T("browser__controls", t), "aria-hidden": "true", children: [
|
|
2201
|
+
/* @__PURE__ */ e(nt, { size: 14, strokeWidth: 2 }),
|
|
2202
|
+
/* @__PURE__ */ e(qe, { size: 14, strokeWidth: 2 }),
|
|
2203
|
+
/* @__PURE__ */ e(pt, { size: 14, strokeWidth: 2 })
|
|
2205
2204
|
] });
|
|
2206
2205
|
}
|
|
2207
|
-
function
|
|
2206
|
+
function Mt({ address: t, className: n }) {
|
|
2208
2207
|
const r = t.lastIndexOf("/"), a = r > 0 ? t.slice(0, r) : t, l = r > 0 ? t.slice(r) : "", [s, o] = E(!1), u = I(void 0);
|
|
2209
|
-
|
|
2208
|
+
L(() => () => clearTimeout(u.current), []);
|
|
2210
2209
|
const c = async () => {
|
|
2211
2210
|
try {
|
|
2212
|
-
await
|
|
2211
|
+
await Ke(t), o(!0), clearTimeout(u.current), u.current = setTimeout(() => o(!1), 1500);
|
|
2213
2212
|
} catch {
|
|
2214
2213
|
}
|
|
2215
2214
|
};
|
|
2216
|
-
return /* @__PURE__ */ i("span", { className:
|
|
2215
|
+
return /* @__PURE__ */ i("span", { className: T("browser__address", n), children: [
|
|
2217
2216
|
/* @__PURE__ */ i("span", { className: "browser__url", title: t, children: [
|
|
2218
2217
|
/* @__PURE__ */ e("span", { className: "browser__url-head", children: a }),
|
|
2219
2218
|
l ? /* @__PURE__ */ e("span", { className: "browser__url-tail", children: l }) : null
|
|
2220
2219
|
] }),
|
|
2221
|
-
/* @__PURE__ */ e("button", { type: "button", className: "browser__address-copy", onClick: c, "aria-label": "复制网址", children: s ? /* @__PURE__ */ e(
|
|
2222
|
-
/* @__PURE__ */ e("span", { className: "sr-only", role: "status", "aria-live": "polite", children: s ? "已复制网址" : "" })
|
|
2220
|
+
/* @__PURE__ */ e("button", { type: "button", className: "browser__address-copy", onClick: c, "aria-label": "复制网址", children: s ? /* @__PURE__ */ e(B, { className: "browser__address-icon", size: 12, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(te, { className: "browser__address-icon", size: 12, strokeWidth: 2, "aria-hidden": "true" }) }),
|
|
2221
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", role: "status", "aria-live": "polite", children: s ? "已复制网址" : "" })
|
|
2223
2222
|
] });
|
|
2224
2223
|
}
|
|
2225
|
-
function
|
|
2226
|
-
return /* @__PURE__ */ e("div", { className:
|
|
2224
|
+
function Et({ tabs: t, className: n }) {
|
|
2225
|
+
return /* @__PURE__ */ e("div", { className: T("browser__tabs", n), "aria-hidden": "true", children: t.map((r, a) => (
|
|
2227
2226
|
// key 带 index:label 是装饰文案不保证唯一,纯 label 做 key 在同名标签时会撞车。
|
|
2228
2227
|
/* @__PURE__ */ e("span", { className: `browser__tab${r.isActive ? " browser__tab--active" : ""}`, children: r.label }, `${r.label}-${a}`)
|
|
2229
2228
|
)) });
|
|
2230
2229
|
}
|
|
2231
|
-
function
|
|
2232
|
-
return /* @__PURE__ */ i("div", { className:
|
|
2230
|
+
function Yn({ address: t, variant: n = "dark", tabs: r, children: a, className: l, ...s }) {
|
|
2231
|
+
return /* @__PURE__ */ i("div", { className: T("browser", `browser--${n}`, l), ...s, children: [
|
|
2233
2232
|
/* @__PURE__ */ i("div", { className: "browser__chrome", children: [
|
|
2234
|
-
r ? /* @__PURE__ */ e(
|
|
2233
|
+
r ? /* @__PURE__ */ e(Et, { tabs: r }) : null,
|
|
2235
2234
|
/* @__PURE__ */ i("div", { className: "browser__bar", children: [
|
|
2236
2235
|
/* @__PURE__ */ i("div", { className: "browser__zone browser__zone--start", children: [
|
|
2237
|
-
/* @__PURE__ */ e(
|
|
2238
|
-
/* @__PURE__ */ e(
|
|
2236
|
+
/* @__PURE__ */ e($t, {}),
|
|
2237
|
+
/* @__PURE__ */ e(Dt, {})
|
|
2239
2238
|
] }),
|
|
2240
|
-
/* @__PURE__ */ e("div", { className: "browser__zone browser__zone--center", children: /* @__PURE__ */ e(
|
|
2239
|
+
/* @__PURE__ */ e("div", { className: "browser__zone browser__zone--center", children: /* @__PURE__ */ e(Mt, { address: t }) })
|
|
2241
2240
|
] })
|
|
2242
2241
|
] }),
|
|
2243
2242
|
/* @__PURE__ */ e("div", { className: "browser__body", children: a })
|
|
2244
2243
|
] });
|
|
2245
2244
|
}
|
|
2246
|
-
function
|
|
2245
|
+
function Gn() {
|
|
2247
2246
|
return /* @__PURE__ */ i("div", { className: "browser__placeholder", "aria-hidden": "true", children: [
|
|
2248
2247
|
/* @__PURE__ */ e("span", { className: "browser__skeleton-line browser__skeleton-line--medium" }),
|
|
2249
2248
|
/* @__PURE__ */ e("span", { className: "browser__skeleton-line browser__skeleton-line--short" }),
|
|
2250
2249
|
/* @__PURE__ */ e("span", { className: "browser__skeleton-line" })
|
|
2251
2250
|
] });
|
|
2252
2251
|
}
|
|
2253
|
-
const
|
|
2252
|
+
const Ue = (t) => t !== void 0 && Number.isFinite(t) && t > 0 ? t : void 0, Ye = (t) => t === void 0 ? void 0 : { "--q1-avatar-size": `${t}px` }, It = (t) => {
|
|
2254
2253
|
const n = t.trim();
|
|
2255
2254
|
return n ? new RegExp("\\p{Script=Han}", "u").test(n[0]) ? n[0] : n.split(/\s+/).slice(0, 2).map((r) => r[0]).join("").toUpperCase() : "";
|
|
2256
2255
|
};
|
|
2257
|
-
function
|
|
2258
|
-
const [_, d] = E(null), b =
|
|
2259
|
-
return /* @__PURE__ */ i("span", { className:
|
|
2256
|
+
function St({ title: t, src: n, letter: r, glyph: a, placeholder: l = !1, icon: s, iconColor: o, size: u, className: c }) {
|
|
2257
|
+
const [_, d] = E(null), b = Ue(u), p = !!n && _ !== n, m = t.trim() || "头像", y = r ? { variant: "avatar--letter", node: r } : a ? { variant: "avatar--glyph", node: a } : { variant: "avatar--letter", node: It(t) }, k = l ? "avatar--placeholder" : p ? "avatar--image" : y.variant, f = l ? { "aria-hidden": !0 } : p ? {} : { role: "img", "aria-label": m };
|
|
2258
|
+
return /* @__PURE__ */ i("span", { className: T("avatar", k, c), style: Ye(b), ...f, children: [
|
|
2260
2259
|
p ? /* @__PURE__ */ e(
|
|
2261
2260
|
"img",
|
|
2262
2261
|
{
|
|
@@ -2279,7 +2278,7 @@ function Et({ title: t, src: n, letter: r, glyph: a, placeholder: l = !1, icon:
|
|
|
2279
2278
|
) : null
|
|
2280
2279
|
] });
|
|
2281
2280
|
}
|
|
2282
|
-
function
|
|
2281
|
+
function Vn({
|
|
2283
2282
|
members: t,
|
|
2284
2283
|
label: n,
|
|
2285
2284
|
size: r,
|
|
@@ -2288,11 +2287,11 @@ function Yn({
|
|
|
2288
2287
|
reverse: s = !1,
|
|
2289
2288
|
className: o
|
|
2290
2289
|
}) {
|
|
2291
|
-
const u =
|
|
2292
|
-
return /* @__PURE__ */ i("span", { className:
|
|
2290
|
+
const u = Ue(r), c = u ?? 32, _ = a !== void 0 && Number.isFinite(a) && a >= 0 ? Math.floor(a) : void 0, d = _ !== void 0 && t.length > _ ? t.slice(0, _) : t, b = t.length - d.length, p = d.length + (b > 0 ? 1 : 0), m = l !== "auto" && Number.isFinite(l) ? Math.max(0, l) : Math.round(c * 0.3), y = { ...Ye(u), "--q1-avatar-overlap": `${m}px` }, k = (N) => s ? void 0 : p - 1 - N, f = n ? { role: "group", "aria-label": n } : {};
|
|
2291
|
+
return /* @__PURE__ */ i("span", { className: T("avatar-group", o), style: y, ...f, children: [
|
|
2293
2292
|
d.map((N, v) => (
|
|
2294
2293
|
// 成员不再 aria-hidden——每个 Avatar 自带 aria-label(名字),读屏逐个念。
|
|
2295
|
-
/* @__PURE__ */ e("span", { className: "avatar-group__item", style: { zIndex: k(v) }, children: /* @__PURE__ */ e(
|
|
2294
|
+
/* @__PURE__ */ e("span", { className: "avatar-group__item", style: { zIndex: k(v) }, children: /* @__PURE__ */ e(St, { ...N, size: u }) }, `${N.title}-${v}`)
|
|
2296
2295
|
)),
|
|
2297
2296
|
b > 0 ? (
|
|
2298
2297
|
// +N 独立可访问名「还有 N 位成员」,不再 aria-hidden。
|
|
@@ -2312,26 +2311,26 @@ function Yn({
|
|
|
2312
2311
|
) : null
|
|
2313
2312
|
] });
|
|
2314
2313
|
}
|
|
2315
|
-
function
|
|
2314
|
+
function Xn({
|
|
2316
2315
|
shape: t = "rounded",
|
|
2317
2316
|
animated: n = !0,
|
|
2318
2317
|
show: r = !1,
|
|
2319
2318
|
className: a,
|
|
2320
2319
|
children: l
|
|
2321
2320
|
}) {
|
|
2322
|
-
if (l && r) return /* @__PURE__ */ e(
|
|
2323
|
-
const s =
|
|
2321
|
+
if (l && r) return /* @__PURE__ */ e(K, { children: l });
|
|
2322
|
+
const s = T(
|
|
2324
2323
|
"skeleton",
|
|
2325
2324
|
`skeleton--${t}`,
|
|
2326
2325
|
n ? "" : "skeleton--static",
|
|
2327
2326
|
l ? "skeleton--wrap" : "",
|
|
2328
2327
|
a ?? ""
|
|
2329
|
-
|
|
2328
|
+
);
|
|
2330
2329
|
return l ? /* @__PURE__ */ e("span", { className: s, "aria-hidden": "true", children: /* @__PURE__ */ e("span", { className: "skeleton__content", children: l }) }) : /* @__PURE__ */ e("span", { className: s, "aria-hidden": "true" });
|
|
2331
2330
|
}
|
|
2332
|
-
const
|
|
2333
|
-
function
|
|
2334
|
-
const r = typeof n == "number" ? n :
|
|
2331
|
+
const Tt = { sm: 2, md: 3, lg: 4 };
|
|
2332
|
+
function Zn({ label: t, size: n = "md" }) {
|
|
2333
|
+
const r = typeof n == "number" ? n : Tt[n], a = { width: r, height: r };
|
|
2335
2334
|
return /* @__PURE__ */ i("span", { className: "loading-dots-wrap", "aria-live": "polite", children: [
|
|
2336
2335
|
t ? /* @__PURE__ */ e("span", { className: "loading-dots__label", children: t }) : null,
|
|
2337
2336
|
/* @__PURE__ */ i("span", { className: "loading-dots", "aria-hidden": "true", children: [
|
|
@@ -2341,17 +2340,17 @@ function Vn({ label: t, size: n = "md" }) {
|
|
|
2341
2340
|
] })
|
|
2342
2341
|
] });
|
|
2343
2342
|
}
|
|
2344
|
-
function
|
|
2343
|
+
function Qn({ text: t, tailLength: n = 8, mono: r = !1 }) {
|
|
2345
2344
|
const a = Math.max(0, t.length - n), l = t.slice(0, a), s = t.slice(a);
|
|
2346
2345
|
return /* @__PURE__ */ i("span", { className: `middle-truncate${r ? " middle-truncate--mono" : ""}`, title: t, "aria-label": t, children: [
|
|
2347
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: t }),
|
|
2346
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", children: t }),
|
|
2348
2347
|
/* @__PURE__ */ i("span", { className: "middle-truncate__visual", "aria-hidden": "true", children: [
|
|
2349
2348
|
/* @__PURE__ */ e("span", { className: "middle-truncate__head", children: l }),
|
|
2350
2349
|
/* @__PURE__ */ e("span", { className: "middle-truncate__tail", children: s })
|
|
2351
2350
|
] })
|
|
2352
2351
|
] });
|
|
2353
2352
|
}
|
|
2354
|
-
function
|
|
2353
|
+
function Jn({ screenLabel: t }) {
|
|
2355
2354
|
return /* @__PURE__ */ i("div", { className: "phone", children: [
|
|
2356
2355
|
/* @__PURE__ */ e("span", { className: "phone__island", "aria-hidden": "true" }),
|
|
2357
2356
|
/* @__PURE__ */ e("span", { className: "phone__btn phone__btn--mute", "aria-hidden": "true" }),
|
|
@@ -2388,27 +2387,27 @@ function Zn({ screenLabel: t }) {
|
|
|
2388
2387
|
] })
|
|
2389
2388
|
] });
|
|
2390
2389
|
}
|
|
2391
|
-
const
|
|
2392
|
-
default:
|
|
2393
|
-
success:
|
|
2394
|
-
warning:
|
|
2395
|
-
error:
|
|
2390
|
+
const At = {
|
|
2391
|
+
default: le,
|
|
2392
|
+
success: ft,
|
|
2393
|
+
warning: ie,
|
|
2394
|
+
error: ye
|
|
2396
2395
|
};
|
|
2397
|
-
function
|
|
2398
|
-
const a =
|
|
2396
|
+
function ea({ variant: t = "default", message: n, cta: r }) {
|
|
2397
|
+
const a = At[t];
|
|
2399
2398
|
return /* @__PURE__ */ i("div", { className: `project-banner project-banner--${t}`, role: "status", children: [
|
|
2400
2399
|
/* @__PURE__ */ e(a, { className: "project-banner__icon", size: 15, strokeWidth: 2, "aria-hidden": "true" }),
|
|
2401
2400
|
/* @__PURE__ */ e("span", { className: "project-banner__message", children: n }),
|
|
2402
2401
|
/* @__PURE__ */ e("button", { type: "button", className: "project-banner__cta", children: r })
|
|
2403
2402
|
] });
|
|
2404
2403
|
}
|
|
2405
|
-
function
|
|
2404
|
+
function ta({
|
|
2406
2405
|
text: t,
|
|
2407
2406
|
copyValue: n,
|
|
2408
2407
|
successMessage: r,
|
|
2409
2408
|
size: a = "default"
|
|
2410
2409
|
}) {
|
|
2411
|
-
const { copied: l, copy: s } =
|
|
2410
|
+
const { copied: l, copy: s } = ce(), o = n ?? t;
|
|
2412
2411
|
return /* @__PURE__ */ i("span", { className: `twc twc--${a}`, children: [
|
|
2413
2412
|
/* @__PURE__ */ e("span", { className: "twc__text", children: t }),
|
|
2414
2413
|
/* @__PURE__ */ e(
|
|
@@ -2418,12 +2417,12 @@ function Jn({
|
|
|
2418
2417
|
className: "twc__copy",
|
|
2419
2418
|
"aria-label": `复制${t}`,
|
|
2420
2419
|
onClick: () => s(o, r),
|
|
2421
|
-
children: l ? /* @__PURE__ */ e(
|
|
2420
|
+
children: l ? /* @__PURE__ */ e(B, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(te, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
|
|
2422
2421
|
}
|
|
2423
2422
|
)
|
|
2424
2423
|
] });
|
|
2425
2424
|
}
|
|
2426
|
-
function
|
|
2425
|
+
function na({
|
|
2427
2426
|
text: t,
|
|
2428
2427
|
prompt: n = !0,
|
|
2429
2428
|
inverted: r = !1,
|
|
@@ -2431,7 +2430,7 @@ function ea({
|
|
|
2431
2430
|
copyText: l,
|
|
2432
2431
|
onCopy: s
|
|
2433
2432
|
}) {
|
|
2434
|
-
const { copied: o, copy: u } =
|
|
2433
|
+
const { copied: o, copy: u } = ce(), c = Array.isArray(t) ? t : [t], _ = T("snippet", r ? "snippet--inverted" : "", a ? `snippet--${a}` : "");
|
|
2435
2434
|
return /* @__PURE__ */ i("div", { className: _, children: [
|
|
2436
2435
|
/* @__PURE__ */ e("code", { className: "snippet__code", children: c.map((d, b) => /* @__PURE__ */ i("span", { className: "snippet__line", children: [
|
|
2437
2436
|
n ? /* @__PURE__ */ i("span", { className: "snippet__prompt", "aria-hidden": "true", children: [
|
|
@@ -2450,31 +2449,31 @@ function ea({
|
|
|
2450
2449
|
u(l ?? c.join(`
|
|
2451
2450
|
`), "已复制命令"), s?.();
|
|
2452
2451
|
},
|
|
2453
|
-
children: o ? /* @__PURE__ */ e(
|
|
2452
|
+
children: o ? /* @__PURE__ */ e(B, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(te, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
|
|
2454
2453
|
}
|
|
2455
2454
|
)
|
|
2456
2455
|
] });
|
|
2457
2456
|
}
|
|
2458
|
-
function
|
|
2457
|
+
function qt(t, n) {
|
|
2459
2458
|
return t >= 95 ? "danger" : t >= 80 ? "warning" : "success";
|
|
2460
2459
|
}
|
|
2461
|
-
const
|
|
2460
|
+
const zt = {
|
|
2462
2461
|
xs: { boxPx: 20, radius: 42.5, strokeWidth: 15, valueFontSize: null },
|
|
2463
2462
|
sm: { boxPx: 32, radius: 45, strokeWidth: 10, valueFontSize: 11 },
|
|
2464
2463
|
md: { boxPx: 64, radius: 45, strokeWidth: 10, valueFontSize: 18 },
|
|
2465
2464
|
lg: { boxPx: 128, radius: 45, strokeWidth: 10, valueFontSize: 32 }
|
|
2466
|
-
},
|
|
2467
|
-
function
|
|
2468
|
-
const a = Math.min(
|
|
2465
|
+
}, Wt = 10, Ce = { success: 80, warning: 50 };
|
|
2466
|
+
function Lt(t, n, r) {
|
|
2467
|
+
const a = Math.min(Wt, t, 100 - t);
|
|
2469
2468
|
if (a <= 0) return 0;
|
|
2470
2469
|
if (!(100 - t - a <= 0)) return a;
|
|
2471
2470
|
const s = n / r * 100;
|
|
2472
2471
|
return a < s ? 0 : a;
|
|
2473
2472
|
}
|
|
2474
|
-
function
|
|
2475
|
-
return r || (n === "health" ? t >=
|
|
2473
|
+
function Rt(t, n, r) {
|
|
2474
|
+
return r || (n === "health" ? t >= Ce.success ? "success" : t >= Ce.warning ? "warning" : "danger" : qt(t));
|
|
2476
2475
|
}
|
|
2477
|
-
function
|
|
2476
|
+
function aa({
|
|
2478
2477
|
value: t,
|
|
2479
2478
|
size: n = "md",
|
|
2480
2479
|
showValue: r = !1,
|
|
@@ -2483,7 +2482,7 @@ function ta({
|
|
|
2483
2482
|
label: s,
|
|
2484
2483
|
indeterminate: o = !1
|
|
2485
2484
|
}) {
|
|
2486
|
-
const { boxPx: u, radius: c, strokeWidth: _, valueFontSize: d } =
|
|
2485
|
+
const { boxPx: u, radius: c, strokeWidth: _, valueFontSize: d } = zt[n], b = 2 * Math.PI * c, p = Math.min(100, Math.max(0, t ?? 0)), m = 50, y = o ? 25 : p, k = o ? 0 : Lt(p, _, b), f = o ? 0 : Math.max(0, 100 - p - k), N = -90 + (y + k / 2) / 100 * 360, v = o ? "primary" : Rt(p, l, a);
|
|
2487
2486
|
return /* @__PURE__ */ i(
|
|
2488
2487
|
"span",
|
|
2489
2488
|
{
|
|
@@ -2529,7 +2528,7 @@ function ta({
|
|
|
2529
2528
|
}
|
|
2530
2529
|
);
|
|
2531
2530
|
}
|
|
2532
|
-
function
|
|
2531
|
+
function ra({
|
|
2533
2532
|
value: t,
|
|
2534
2533
|
max: n = 100,
|
|
2535
2534
|
tone: r = "neutral",
|
|
@@ -2556,7 +2555,7 @@ function na({
|
|
|
2556
2555
|
return /* @__PURE__ */ i("span", { className: "progress__stop", style: { left: `calc(${_}% - 7px)` }, children: [
|
|
2557
2556
|
/* @__PURE__ */ e("span", { className: "progress__stop-line progress__stop-line--tick" }),
|
|
2558
2557
|
/* @__PURE__ */ e("span", { className: "progress__stop-line progress__stop-line--cut" }),
|
|
2559
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: d }),
|
|
2558
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", children: d }),
|
|
2560
2559
|
/* @__PURE__ */ e("span", { className: "progress__stop-tip", "aria-hidden": "true", children: d })
|
|
2561
2560
|
] }, _);
|
|
2562
2561
|
})
|
|
@@ -2564,14 +2563,14 @@ function na({
|
|
|
2564
2563
|
}
|
|
2565
2564
|
);
|
|
2566
2565
|
}
|
|
2567
|
-
const
|
|
2568
|
-
info:
|
|
2566
|
+
const Ft = {
|
|
2567
|
+
info: le,
|
|
2569
2568
|
success: We,
|
|
2570
|
-
warning:
|
|
2571
|
-
error:
|
|
2572
|
-
secondary:
|
|
2569
|
+
warning: ie,
|
|
2570
|
+
error: Le,
|
|
2571
|
+
secondary: le
|
|
2573
2572
|
};
|
|
2574
|
-
function
|
|
2573
|
+
function la({
|
|
2575
2574
|
tone: t = "info",
|
|
2576
2575
|
size: n = "default",
|
|
2577
2576
|
filled: r = !1,
|
|
@@ -2580,13 +2579,13 @@ function aa({
|
|
|
2580
2579
|
action: s,
|
|
2581
2580
|
children: o
|
|
2582
2581
|
}) {
|
|
2583
|
-
const u =
|
|
2582
|
+
const u = Ft[t], c = T(
|
|
2584
2583
|
"note",
|
|
2585
2584
|
`note--${t}`,
|
|
2586
2585
|
`note--${n}`,
|
|
2587
2586
|
r ? "note--filled" : "",
|
|
2588
2587
|
a ? "note--disabled" : ""
|
|
2589
|
-
|
|
2588
|
+
);
|
|
2590
2589
|
return /* @__PURE__ */ i("div", { className: c, role: "note", children: [
|
|
2591
2590
|
/* @__PURE__ */ e(u, { className: "note__icon", size: 16, strokeWidth: 2, "aria-hidden": "true" }),
|
|
2592
2591
|
/* @__PURE__ */ i("p", { className: "note__body", children: [
|
|
@@ -2596,7 +2595,7 @@ function aa({
|
|
|
2596
2595
|
s ? /* @__PURE__ */ e("button", { type: "button", className: "note__action", disabled: a, children: s }) : null
|
|
2597
2596
|
] });
|
|
2598
2597
|
}
|
|
2599
|
-
function
|
|
2598
|
+
function sa({ previous: t, next: n }) {
|
|
2600
2599
|
const r = (a) => a.preventDefault();
|
|
2601
2600
|
return /* @__PURE__ */ i("nav", { className: "pagination", "aria-label": "分页导航", children: [
|
|
2602
2601
|
t ? /* @__PURE__ */ i(
|
|
@@ -2610,7 +2609,7 @@ function ra({ previous: t, next: n }) {
|
|
|
2610
2609
|
/* @__PURE__ */ e("span", { className: "pagination__label", children: "上一页" }),
|
|
2611
2610
|
/* @__PURE__ */ i("span", { className: "pagination__title-frame", children: [
|
|
2612
2611
|
/* @__PURE__ */ e("span", { className: "pagination__title", children: t.title }),
|
|
2613
|
-
/* @__PURE__ */ e("span", { className: "pagination__chevron-slot", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
2612
|
+
/* @__PURE__ */ e("span", { className: "pagination__chevron-slot", "aria-hidden": "true", children: /* @__PURE__ */ e(be, { className: "pagination__chevron", size: 20, strokeWidth: 2 }) })
|
|
2614
2613
|
] })
|
|
2615
2614
|
]
|
|
2616
2615
|
}
|
|
@@ -2626,14 +2625,14 @@ function ra({ previous: t, next: n }) {
|
|
|
2626
2625
|
/* @__PURE__ */ e("span", { className: "pagination__label", children: "下一页" }),
|
|
2627
2626
|
/* @__PURE__ */ i("span", { className: "pagination__title-frame", children: [
|
|
2628
2627
|
/* @__PURE__ */ e("span", { className: "pagination__title", children: n.title }),
|
|
2629
|
-
/* @__PURE__ */ e("span", { className: "pagination__chevron-slot", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
2628
|
+
/* @__PURE__ */ e("span", { className: "pagination__chevron-slot", "aria-hidden": "true", children: /* @__PURE__ */ e(H, { className: "pagination__chevron", size: 20, strokeWidth: 2 }) })
|
|
2630
2629
|
] })
|
|
2631
2630
|
]
|
|
2632
2631
|
}
|
|
2633
2632
|
) : /* @__PURE__ */ e("span", { className: "pagination__slot" })
|
|
2634
2633
|
] });
|
|
2635
2634
|
}
|
|
2636
|
-
function
|
|
2635
|
+
function oa({
|
|
2637
2636
|
items: t,
|
|
2638
2637
|
initial: n = 4,
|
|
2639
2638
|
noBorder: r,
|
|
@@ -2652,13 +2651,13 @@ function la({
|
|
|
2652
2651
|
onClick: () => s((_) => !_),
|
|
2653
2652
|
children: [
|
|
2654
2653
|
l ? "收起" : `显示更多 ${c} 项`,
|
|
2655
|
-
l ? /* @__PURE__ */ e(ze, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(
|
|
2654
|
+
l ? /* @__PURE__ */ e(ze, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(P, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
|
|
2656
2655
|
]
|
|
2657
2656
|
}
|
|
2658
2657
|
) }) : null
|
|
2659
2658
|
] });
|
|
2660
2659
|
}
|
|
2661
|
-
function
|
|
2660
|
+
function ia({
|
|
2662
2661
|
loading: t,
|
|
2663
2662
|
noGap: n,
|
|
2664
2663
|
noBorderRadius: r,
|
|
@@ -2669,35 +2668,35 @@ function sa({
|
|
|
2669
2668
|
"button",
|
|
2670
2669
|
{
|
|
2671
2670
|
type: "button",
|
|
2672
|
-
className:
|
|
2671
|
+
className: T(
|
|
2673
2672
|
"load-more-btn",
|
|
2674
2673
|
n ? "load-more-btn--no-gap" : "",
|
|
2675
2674
|
r ? "load-more-btn--no-border-radius" : ""
|
|
2676
|
-
|
|
2675
|
+
),
|
|
2677
2676
|
"aria-busy": t || void 0,
|
|
2678
2677
|
disabled: t,
|
|
2679
2678
|
onClick: a,
|
|
2680
2679
|
children: [
|
|
2681
|
-
t ? /* @__PURE__ */ e(
|
|
2680
|
+
t ? /* @__PURE__ */ e(oe, { className: "load-more-btn__spinner", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null,
|
|
2682
2681
|
l
|
|
2683
2682
|
]
|
|
2684
2683
|
}
|
|
2685
2684
|
);
|
|
2686
2685
|
}
|
|
2687
|
-
function
|
|
2686
|
+
function Kt(t) {
|
|
2688
2687
|
const n = t.match(/([+-])(\d{2}):?(\d{2})$/);
|
|
2689
2688
|
if (!n) return "UTC";
|
|
2690
2689
|
const r = String(Number(n[2]));
|
|
2691
2690
|
return `GMT${n[1]}${r}${n[3] !== "00" ? `:${n[3]}` : ""}`;
|
|
2692
2691
|
}
|
|
2693
|
-
function
|
|
2692
|
+
function ca({
|
|
2694
2693
|
relative: t,
|
|
2695
2694
|
relativeLong: n,
|
|
2696
2695
|
iso: r,
|
|
2697
2696
|
local: a,
|
|
2698
2697
|
utc: l
|
|
2699
2698
|
}) {
|
|
2700
|
-
const s =
|
|
2699
|
+
const s = Kt(r);
|
|
2701
2700
|
return /* @__PURE__ */ i("span", { className: "rtc-wrap", children: [
|
|
2702
2701
|
/* @__PURE__ */ e("time", { className: "rtc-trigger", dateTime: r, tabIndex: 0, children: t }),
|
|
2703
2702
|
/* @__PURE__ */ i("span", { className: "rtc-card", role: "group", "aria-label": `${n},UTC ${l},${s} ${a}`, children: [
|
|
@@ -2713,13 +2712,13 @@ function oa({
|
|
|
2713
2712
|
] })
|
|
2714
2713
|
] });
|
|
2715
2714
|
}
|
|
2716
|
-
const
|
|
2717
|
-
function
|
|
2715
|
+
const Pt = { sm: 10, md: 12, lg: 15, xl: 15 };
|
|
2716
|
+
function da({
|
|
2718
2717
|
size: t = "md",
|
|
2719
2718
|
tone: n = "default",
|
|
2720
2719
|
label: r = "加载中…"
|
|
2721
2720
|
}) {
|
|
2722
|
-
const a =
|
|
2721
|
+
const a = T("spinner", `spinner--${t}`, n !== "default" ? `spinner--${n}` : ""), l = Pt[t];
|
|
2723
2722
|
return /* @__PURE__ */ i("span", { className: a, role: "status", children: [
|
|
2724
2723
|
Array.from({ length: l }, (s, o) => /* @__PURE__ */ e(
|
|
2725
2724
|
"span",
|
|
@@ -2733,18 +2732,21 @@ function ia({
|
|
|
2733
2732
|
},
|
|
2734
2733
|
o
|
|
2735
2734
|
)),
|
|
2736
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: r })
|
|
2735
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", children: r })
|
|
2737
2736
|
] });
|
|
2738
2737
|
}
|
|
2739
|
-
|
|
2740
|
-
|
|
2738
|
+
function Ge() {
|
|
2739
|
+
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2740
|
+
}
|
|
2741
|
+
const $e = "/video-sample.mp4", Ot = "/video-poster.jpg", Bt = Ge();
|
|
2742
|
+
function ua({ controls: t = !0, loop: n = !0 }) {
|
|
2741
2743
|
const r = !t;
|
|
2742
2744
|
return /* @__PURE__ */ i(
|
|
2743
2745
|
"video",
|
|
2744
2746
|
{
|
|
2745
2747
|
className: "ds-video",
|
|
2746
|
-
src:
|
|
2747
|
-
poster:
|
|
2748
|
+
src: $e,
|
|
2749
|
+
poster: Ot,
|
|
2748
2750
|
width: 1280,
|
|
2749
2751
|
height: 720,
|
|
2750
2752
|
controls: t,
|
|
@@ -2752,18 +2754,18 @@ function ca({ controls: t = !0, loop: n = !0 }) {
|
|
|
2752
2754
|
muted: !0,
|
|
2753
2755
|
playsInline: !0,
|
|
2754
2756
|
preload: r ? "auto" : "none",
|
|
2755
|
-
autoPlay: r && !
|
|
2757
|
+
autoPlay: r && !Bt,
|
|
2756
2758
|
...r ? { "aria-hidden": !0 } : { "aria-label": "产品演示视频" },
|
|
2757
2759
|
children: [
|
|
2758
2760
|
"您的浏览器不支持内嵌视频,",
|
|
2759
|
-
/* @__PURE__ */ e("a", { href:
|
|
2761
|
+
/* @__PURE__ */ e("a", { href: $e, children: "下载视频" }),
|
|
2760
2762
|
"。"
|
|
2761
2763
|
]
|
|
2762
2764
|
}
|
|
2763
2765
|
);
|
|
2764
2766
|
}
|
|
2765
|
-
const
|
|
2766
|
-
function
|
|
2767
|
+
const De = typeof navigator < "u" && /mac/i.test(navigator.platform);
|
|
2768
|
+
function ma({
|
|
2767
2769
|
meta: t,
|
|
2768
2770
|
shift: n,
|
|
2769
2771
|
alt: r,
|
|
@@ -2771,53 +2773,53 @@ function da({
|
|
|
2771
2773
|
small: l,
|
|
2772
2774
|
children: s
|
|
2773
2775
|
}) {
|
|
2774
|
-
return /* @__PURE__ */ i("kbd", { className: `kbd${l ? " kbd--small" : ""}`, children: [
|
|
2775
|
-
t ?
|
|
2776
|
-
t &&
|
|
2776
|
+
return /* @__PURE__ */ i("kbd", { className: `q1-kbd${l ? " q1-kbd--small" : ""}`, children: [
|
|
2777
|
+
t ? De ? "⌘" : /* @__PURE__ */ e("span", { "aria-label": "Control", children: "Ctrl" }) : null,
|
|
2778
|
+
t && !De && !!(n || r || a || s) ? /* @__PURE__ */ e("span", { "aria-hidden": "true", children: "+" }) : null,
|
|
2777
2779
|
n ? "⇧" : null,
|
|
2778
2780
|
r ? "⌥" : null,
|
|
2779
2781
|
a ? "⌃" : null,
|
|
2780
2782
|
s
|
|
2781
2783
|
] });
|
|
2782
2784
|
}
|
|
2783
|
-
const
|
|
2784
|
-
function
|
|
2785
|
-
const t = window.localStorage.getItem(
|
|
2785
|
+
const Ve = "q1travel-design-system-theme", de = "q1travel-theme-change";
|
|
2786
|
+
function Me() {
|
|
2787
|
+
const t = window.localStorage.getItem(Ve);
|
|
2786
2788
|
return t === "light" || t === "dark" || t === "system" ? t : "system";
|
|
2787
2789
|
}
|
|
2788
|
-
function
|
|
2790
|
+
function ue(t) {
|
|
2789
2791
|
const n = document.documentElement, r = t === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : t;
|
|
2790
2792
|
n.dataset.themeMode = t, n.dataset.theme = r;
|
|
2791
2793
|
const a = document.querySelector("#q1-theme-color"), l = r === "dark" ? a?.dataset.dark : a?.dataset.light;
|
|
2792
2794
|
a && l && a.setAttribute("content", l);
|
|
2793
2795
|
}
|
|
2794
|
-
function
|
|
2795
|
-
const [t, n] = E(
|
|
2796
|
-
return
|
|
2797
|
-
|
|
2798
|
-
const a = window.matchMedia("(prefers-color-scheme: dark)"), l = () => t === "system" &&
|
|
2799
|
-
return a.addEventListener("change", l), window.addEventListener(
|
|
2800
|
-
a.removeEventListener("change", l), window.removeEventListener(
|
|
2796
|
+
function Ht() {
|
|
2797
|
+
const [t, n] = E(Me);
|
|
2798
|
+
return L(() => {
|
|
2799
|
+
ue(t);
|
|
2800
|
+
const a = window.matchMedia("(prefers-color-scheme: dark)"), l = () => t === "system" && ue("system"), s = () => n(Me());
|
|
2801
|
+
return a.addEventListener("change", l), window.addEventListener(de, s), window.addEventListener("storage", s), () => {
|
|
2802
|
+
a.removeEventListener("change", l), window.removeEventListener(de, s), window.removeEventListener("storage", s);
|
|
2801
2803
|
};
|
|
2802
2804
|
}, [t]), [t, (a) => {
|
|
2803
|
-
window.localStorage.setItem(
|
|
2805
|
+
window.localStorage.setItem(Ve, a), ue(a), n(a), window.dispatchEvent(new Event(de));
|
|
2804
2806
|
}];
|
|
2805
2807
|
}
|
|
2806
|
-
const
|
|
2807
|
-
{ mode: "system", label: "系统", Icon:
|
|
2808
|
-
{ mode: "light", label: "浅色", Icon:
|
|
2809
|
-
{ mode: "dark", label: "深色", Icon:
|
|
2808
|
+
const jt = [
|
|
2809
|
+
{ mode: "system", label: "系统", Icon: mt },
|
|
2810
|
+
{ mode: "light", label: "浅色", Icon: bt },
|
|
2811
|
+
{ mode: "dark", label: "深色", Icon: ht }
|
|
2810
2812
|
];
|
|
2811
|
-
function
|
|
2812
|
-
const r = W(), [a, l] =
|
|
2813
|
+
function ha({ small: t, disabled: n }) {
|
|
2814
|
+
const r = W(), [a, l] = Ht();
|
|
2813
2815
|
return /* @__PURE__ */ i(
|
|
2814
2816
|
"fieldset",
|
|
2815
2817
|
{
|
|
2816
2818
|
className: `theme-switcher${t ? " theme-switcher--small" : ""}`,
|
|
2817
2819
|
disabled: n,
|
|
2818
2820
|
children: [
|
|
2819
|
-
/* @__PURE__ */ e("legend", { className: "sr-only", children: "选择显示主题" }),
|
|
2820
|
-
|
|
2821
|
+
/* @__PURE__ */ e("legend", { className: "q1-sr-only", children: "选择显示主题" }),
|
|
2822
|
+
jt.map(({ mode: s, label: o, Icon: u }) => /* @__PURE__ */ i("label", { className: "theme-switcher__option", children: [
|
|
2821
2823
|
/* @__PURE__ */ e(
|
|
2822
2824
|
"input",
|
|
2823
2825
|
{
|
|
@@ -2826,24 +2828,24 @@ function ua({ small: t, disabled: n }) {
|
|
|
2826
2828
|
value: s,
|
|
2827
2829
|
checked: a === s,
|
|
2828
2830
|
onChange: () => l(s),
|
|
2829
|
-
className: "sr-only"
|
|
2831
|
+
className: "q1-sr-only"
|
|
2830
2832
|
}
|
|
2831
2833
|
),
|
|
2832
2834
|
/* @__PURE__ */ e(u, { size: t ? 14 : 16, strokeWidth: 2, "aria-hidden": "true" }),
|
|
2833
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: o })
|
|
2835
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", children: o })
|
|
2834
2836
|
] }, s))
|
|
2835
2837
|
]
|
|
2836
2838
|
}
|
|
2837
2839
|
);
|
|
2838
2840
|
}
|
|
2839
|
-
function
|
|
2841
|
+
function pa({
|
|
2840
2842
|
axis: t,
|
|
2841
2843
|
label: n,
|
|
2842
2844
|
children: r
|
|
2843
2845
|
}) {
|
|
2844
2846
|
return /* @__PURE__ */ e("div", { className: `scroller scroller--${t}`, children: /* @__PURE__ */ e("div", { className: "scroller__viewport", tabIndex: 0, role: "group", "aria-label": n, children: r }) });
|
|
2845
2847
|
}
|
|
2846
|
-
function
|
|
2848
|
+
function fa({
|
|
2847
2849
|
axis: t = "horizontal",
|
|
2848
2850
|
contentName: n,
|
|
2849
2851
|
label: r,
|
|
@@ -2855,7 +2857,7 @@ function ha({
|
|
|
2855
2857
|
if (!c) return;
|
|
2856
2858
|
const _ = Array.from(c.children), d = s ? c.scrollLeft : c.scrollTop, b = s ? c.clientWidth : c.clientHeight, p = d + (u === 1 ? b : 0), m = (D) => s ? D.offsetLeft : D.offsetTop, y = (D) => s ? D.offsetLeft + D.offsetWidth : D.offsetTop + D.offsetHeight, k = u === 1 ? _.find((D) => y(D) > p + 1) : [..._].reverse().find((D) => m(D) < d - 1);
|
|
2857
2859
|
if (!k) return;
|
|
2858
|
-
const f =
|
|
2860
|
+
const f = Ge() ? "auto" : "smooth";
|
|
2859
2861
|
if (s) {
|
|
2860
2862
|
k.scrollIntoView({ behavior: f, inline: "start", block: "nearest" });
|
|
2861
2863
|
return;
|
|
@@ -2871,7 +2873,7 @@ function ha({
|
|
|
2871
2873
|
className: "scroller-buttons__control",
|
|
2872
2874
|
"aria-label": `${s ? "向左滚动" : "向上滚动"}${n}`,
|
|
2873
2875
|
onClick: () => o(-1),
|
|
2874
|
-
children: s ? /* @__PURE__ */ e(
|
|
2876
|
+
children: s ? /* @__PURE__ */ e(be, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(ze, { size: 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
2875
2877
|
}
|
|
2876
2878
|
),
|
|
2877
2879
|
/* @__PURE__ */ e("div", { className: `scroller scroller--${t} scroller--flush`, children: /* @__PURE__ */ e("div", { className: "scroller__viewport", ref: l, tabIndex: 0, role: "group", "aria-label": r, children: a }) }),
|
|
@@ -2882,12 +2884,12 @@ function ha({
|
|
|
2882
2884
|
className: "scroller-buttons__control",
|
|
2883
2885
|
"aria-label": `${s ? "向右滚动" : "向下滚动"}${n}`,
|
|
2884
2886
|
onClick: () => o(1),
|
|
2885
|
-
children: s ? /* @__PURE__ */ e(
|
|
2887
|
+
children: s ? /* @__PURE__ */ e(H, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(P, { size: 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
2886
2888
|
}
|
|
2887
2889
|
)
|
|
2888
2890
|
] });
|
|
2889
2891
|
}
|
|
2890
|
-
function
|
|
2892
|
+
function _a({ label: t, unit: n, min: r = 0, max: a = 100, step: l = 1, defaultValue: s }) {
|
|
2891
2893
|
const [o, u] = E(s), c = W(), _ = (o - r) / (a - r) * 100;
|
|
2892
2894
|
return /* @__PURE__ */ i("div", { className: "slider-field", children: [
|
|
2893
2895
|
/* @__PURE__ */ i("div", { className: "slider-field__head", children: [
|
|
@@ -2913,10 +2915,10 @@ function pa({ label: t, unit: n, min: r = 0, max: a = 100, step: l = 1, defaultV
|
|
|
2913
2915
|
)
|
|
2914
2916
|
] });
|
|
2915
2917
|
}
|
|
2916
|
-
function
|
|
2918
|
+
function ba({ min: t = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh: l, disabled: s }) {
|
|
2917
2919
|
const [o, u] = E(a), [c, _] = E(l), d = W(), b = W(), p = (o - t) / (n - t) * 100, m = (c - t) / (n - t) * 100, y = (f) => u(Math.min(f, c)), k = (f) => _(Math.max(f, o));
|
|
2918
2920
|
return /* @__PURE__ */ i("div", { className: `range-slider${s ? " range-slider--disabled" : ""}`, children: [
|
|
2919
|
-
/* @__PURE__ */ e("label", { className: "sr-only", htmlFor: d, children: "区间下限" }),
|
|
2921
|
+
/* @__PURE__ */ e("label", { className: "q1-sr-only", htmlFor: d, children: "区间下限" }),
|
|
2920
2922
|
/* @__PURE__ */ e(
|
|
2921
2923
|
"input",
|
|
2922
2924
|
{
|
|
@@ -2963,7 +2965,7 @@ function fa({ min: t = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh:
|
|
|
2963
2965
|
}
|
|
2964
2966
|
)
|
|
2965
2967
|
] }),
|
|
2966
|
-
/* @__PURE__ */ e("label", { className: "sr-only", htmlFor: b, children: "区间上限" }),
|
|
2968
|
+
/* @__PURE__ */ e("label", { className: "q1-sr-only", htmlFor: b, children: "区间上限" }),
|
|
2967
2969
|
/* @__PURE__ */ e(
|
|
2968
2970
|
"input",
|
|
2969
2971
|
{
|
|
@@ -2980,33 +2982,33 @@ function fa({ min: t = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh:
|
|
|
2980
2982
|
)
|
|
2981
2983
|
] });
|
|
2982
2984
|
}
|
|
2983
|
-
function
|
|
2984
|
-
const n = /* @__PURE__ */ i(
|
|
2985
|
+
function ae({ crumb: t }) {
|
|
2986
|
+
const n = /* @__PURE__ */ i(K, { children: [
|
|
2985
2987
|
t.icon ? /* @__PURE__ */ e("span", { className: "breadcrumb__icon", "aria-hidden": "true", children: t.icon }) : null,
|
|
2986
2988
|
t.label
|
|
2987
2989
|
] });
|
|
2988
2990
|
return t.isCurrent ? /* @__PURE__ */ e("span", { className: "breadcrumb__link breadcrumb__link--current", "aria-current": "page", children: n }) : t.isDisabled ? /* @__PURE__ */ e("span", { className: "breadcrumb__link breadcrumb__link--disabled", "aria-disabled": "true", children: n }) : /* @__PURE__ */ e("a", { className: "breadcrumb__link", href: t.href ?? "#breadcrumb", children: n });
|
|
2989
2991
|
}
|
|
2990
|
-
function
|
|
2991
|
-
return /* @__PURE__ */ e(
|
|
2992
|
+
function re() {
|
|
2993
|
+
return /* @__PURE__ */ e(H, { className: "breadcrumb__separator", "aria-hidden": "true", size: 16, strokeWidth: 2 });
|
|
2992
2994
|
}
|
|
2993
|
-
function
|
|
2995
|
+
function ya({
|
|
2994
2996
|
items: t,
|
|
2995
2997
|
label: n,
|
|
2996
2998
|
type: r = "text"
|
|
2997
2999
|
}) {
|
|
2998
3000
|
const a = r === "menu";
|
|
2999
|
-
return /* @__PURE__ */ e("nav", { className:
|
|
3000
|
-
/* @__PURE__ */ e(
|
|
3001
|
-
!a && s < t.length - 1 ? /* @__PURE__ */ e(
|
|
3001
|
+
return /* @__PURE__ */ e("nav", { className: T("breadcrumb", a ? "breadcrumb--menu" : ""), "aria-label": n, children: /* @__PURE__ */ e("ol", { className: "breadcrumb__list", children: t.map((l, s) => /* @__PURE__ */ i("li", { className: "breadcrumb__item", children: [
|
|
3002
|
+
/* @__PURE__ */ e(ae, { crumb: l }),
|
|
3003
|
+
!a && s < t.length - 1 ? /* @__PURE__ */ e(re, {}) : null
|
|
3002
3004
|
] }, l.label)) }) });
|
|
3003
3005
|
}
|
|
3004
|
-
function
|
|
3006
|
+
function ga({ items: t, label: n }) {
|
|
3005
3007
|
const [r, a] = E(!1), l = t[0], s = t[t.length - 1], o = t.slice(1, -1);
|
|
3006
3008
|
return /* @__PURE__ */ e("nav", { className: "breadcrumb", "aria-label": n, "data-expanded": r ? "true" : "false", children: /* @__PURE__ */ i("ol", { className: "breadcrumb__list", children: [
|
|
3007
3009
|
/* @__PURE__ */ i("li", { className: "breadcrumb__item", children: [
|
|
3008
|
-
/* @__PURE__ */ e(
|
|
3009
|
-
/* @__PURE__ */ e(
|
|
3010
|
+
/* @__PURE__ */ e(ae, { crumb: l }),
|
|
3011
|
+
/* @__PURE__ */ e(re, {})
|
|
3010
3012
|
] }),
|
|
3011
3013
|
/* @__PURE__ */ i("li", { className: "breadcrumb__item breadcrumb__item--toggle", children: [
|
|
3012
3014
|
/* @__PURE__ */ e(
|
|
@@ -3017,21 +3019,21 @@ function ba({ items: t, label: n }) {
|
|
|
3017
3019
|
"aria-expanded": r,
|
|
3018
3020
|
"aria-label": r ? "收起中间层级" : "展开折叠的中间层级",
|
|
3019
3021
|
onClick: () => a((u) => !u),
|
|
3020
|
-
children: /* @__PURE__ */ e(
|
|
3022
|
+
children: /* @__PURE__ */ e(Re, { "aria-hidden": "true", size: 16, strokeWidth: 2 })
|
|
3021
3023
|
}
|
|
3022
3024
|
),
|
|
3023
|
-
/* @__PURE__ */ e(
|
|
3025
|
+
/* @__PURE__ */ e(re, {})
|
|
3024
3026
|
] }),
|
|
3025
3027
|
o.map((u) => /* @__PURE__ */ i("li", { className: "breadcrumb__item breadcrumb__item--middle", children: [
|
|
3026
|
-
/* @__PURE__ */ e(
|
|
3027
|
-
/* @__PURE__ */ e(
|
|
3028
|
+
/* @__PURE__ */ e(ae, { crumb: u }),
|
|
3029
|
+
/* @__PURE__ */ e(re, {})
|
|
3028
3030
|
] }, u.label)),
|
|
3029
|
-
/* @__PURE__ */ e("li", { className: "breadcrumb__item", children: /* @__PURE__ */ e(
|
|
3031
|
+
/* @__PURE__ */ e("li", { className: "breadcrumb__item", children: /* @__PURE__ */ e(ae, { crumb: s }) })
|
|
3030
3032
|
] }) });
|
|
3031
3033
|
}
|
|
3032
|
-
function
|
|
3034
|
+
function Na({ open: t, onClose: n, title: r, side: a = "right", children: l, footer: s }) {
|
|
3033
3035
|
const o = I(null), u = W();
|
|
3034
|
-
if (
|
|
3036
|
+
if (L(() => {
|
|
3035
3037
|
if (!t) return;
|
|
3036
3038
|
const _ = window.setTimeout(
|
|
3037
3039
|
() => o.current?.querySelector("button, input, [tabindex]")?.focus(),
|
|
@@ -3051,7 +3053,7 @@ function ya({ open: t, onClose: n, title: r, side: a = "right", children: l, foo
|
|
|
3051
3053
|
_.shiftKey && document.activeElement === b ? (_.preventDefault(), p.focus()) : !_.shiftKey && document.activeElement === p && (_.preventDefault(), b.focus());
|
|
3052
3054
|
}
|
|
3053
3055
|
}
|
|
3054
|
-
return /* @__PURE__ */ i(
|
|
3056
|
+
return /* @__PURE__ */ i(K, { children: [
|
|
3055
3057
|
/* @__PURE__ */ e("div", { className: "sheet__backdrop", "aria-hidden": "true", onMouseDown: (_) => _.preventDefault() }),
|
|
3056
3058
|
/* @__PURE__ */ i(
|
|
3057
3059
|
"div",
|
|
@@ -3065,7 +3067,7 @@ function ya({ open: t, onClose: n, title: r, side: a = "right", children: l, foo
|
|
|
3065
3067
|
children: [
|
|
3066
3068
|
/* @__PURE__ */ i("header", { className: "sheet__header", children: [
|
|
3067
3069
|
/* @__PURE__ */ e("h2", { className: "sheet__title", id: u, children: r }),
|
|
3068
|
-
/* @__PURE__ */ e("button", { type: "button", className: "sheet__close", "aria-label": "关闭", onClick: n, children: /* @__PURE__ */ e(
|
|
3070
|
+
/* @__PURE__ */ e("button", { type: "button", className: "sheet__close", "aria-label": "关闭", onClick: n, children: /* @__PURE__ */ e(j, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })
|
|
3069
3071
|
] }),
|
|
3070
3072
|
/* @__PURE__ */ e("div", { className: "sheet__body", children: l }),
|
|
3071
3073
|
s ? /* @__PURE__ */ e("footer", { className: "sheet__footer", children: s }) : null
|
|
@@ -3074,7 +3076,7 @@ function ya({ open: t, onClose: n, title: r, side: a = "right", children: l, foo
|
|
|
3074
3076
|
)
|
|
3075
3077
|
] });
|
|
3076
3078
|
}
|
|
3077
|
-
function
|
|
3079
|
+
function ka({ label: t, entries: n, variant: r = "default", size: a = "md", align: l = "start", menuButtonLabel: s, icon: o }) {
|
|
3078
3080
|
const [u, c] = E(!1), [_, d] = E(-1), b = I(null), p = I([]), m = I({ buffer: "", timer: 0 }), y = W(), k = n.map((h, x) => x);
|
|
3079
3081
|
function f(h) {
|
|
3080
3082
|
d(h), p.current[h]?.focus();
|
|
@@ -3087,7 +3089,7 @@ function ga({ label: t, entries: n, variant: r = "default", size: a = "md", alig
|
|
|
3087
3089
|
function v(h = !0) {
|
|
3088
3090
|
c(!1), d(-1), h && b.current?.focus();
|
|
3089
3091
|
}
|
|
3090
|
-
|
|
3092
|
+
L(() => {
|
|
3091
3093
|
if (!u) return;
|
|
3092
3094
|
function h(x) {
|
|
3093
3095
|
const g = b.current?.closest(".split-button");
|
|
@@ -3133,7 +3135,7 @@ function ga({ label: t, entries: n, variant: r = "default", size: a = "md", alig
|
|
|
3133
3135
|
"aria-controls": u ? y : void 0,
|
|
3134
3136
|
onClick: () => u ? v() : N("first"),
|
|
3135
3137
|
onKeyDown: D,
|
|
3136
|
-
children: /* @__PURE__ */ e(
|
|
3138
|
+
children: /* @__PURE__ */ e(P, { size: a === "sm" ? 14 : 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
3137
3139
|
}
|
|
3138
3140
|
),
|
|
3139
3141
|
u ? /* @__PURE__ */ e(
|
|
@@ -3166,13 +3168,13 @@ function ga({ label: t, entries: n, variant: r = "default", size: a = "md", alig
|
|
|
3166
3168
|
) : null
|
|
3167
3169
|
] });
|
|
3168
3170
|
}
|
|
3169
|
-
const
|
|
3170
|
-
function
|
|
3171
|
+
const Ut = (t) => t.type === "item" && !t.disabled && !t.locked || t.type === "link";
|
|
3172
|
+
function wa({ label: t, entries: n, withChevron: r, align: a = "start", triggerContent: l }) {
|
|
3171
3173
|
const [s, o] = E(!1), [u, c] = E({
|
|
3172
3174
|
align: a,
|
|
3173
3175
|
side: "bottom"
|
|
3174
3176
|
}), _ = I(null), d = I(null), b = W();
|
|
3175
|
-
|
|
3177
|
+
V(() => {
|
|
3176
3178
|
if (!s) return;
|
|
3177
3179
|
function C() {
|
|
3178
3180
|
const g = _.current, w = d.current;
|
|
@@ -3180,8 +3182,8 @@ function Na({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
3180
3182
|
const M = g.getBoundingClientRect(), S = w.getBoundingClientRect();
|
|
3181
3183
|
let $ = a;
|
|
3182
3184
|
a === "start" && M.left + S.width > window.innerWidth ? $ = "end" : a === "end" && M.right - S.width < 0 && ($ = "start");
|
|
3183
|
-
const
|
|
3184
|
-
c({ align: $, side:
|
|
3185
|
+
const q = M.bottom + S.height > window.innerHeight ? "top" : "bottom";
|
|
3186
|
+
c({ align: $, side: q });
|
|
3185
3187
|
}
|
|
3186
3188
|
let h = 0;
|
|
3187
3189
|
function x() {
|
|
@@ -3193,7 +3195,7 @@ function Na({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
3193
3195
|
window.removeEventListener("resize", x), h && window.cancelAnimationFrame(h);
|
|
3194
3196
|
};
|
|
3195
3197
|
}, [s, a]);
|
|
3196
|
-
const p = n.flatMap((C, h) =>
|
|
3198
|
+
const p = n.flatMap((C, h) => Ut(C) ? [h] : []), { itemRefs: m, focusItem: y, reset: k, onMenuKeyDown: f } = Ne({
|
|
3197
3199
|
focusableIndices: p,
|
|
3198
3200
|
getText: (C) => {
|
|
3199
3201
|
const h = n[C];
|
|
@@ -3209,7 +3211,7 @@ function Na({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
3209
3211
|
function v(C = !0) {
|
|
3210
3212
|
o(!1), k(), c({ align: a, side: "bottom" }), C && _.current?.focus();
|
|
3211
3213
|
}
|
|
3212
|
-
|
|
3214
|
+
L(() => {
|
|
3213
3215
|
if (!s) return;
|
|
3214
3216
|
function C(h) {
|
|
3215
3217
|
const x = m.current[0]?.closest(".menu");
|
|
@@ -3235,7 +3237,7 @@ function Na({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
3235
3237
|
onKeyDown: D,
|
|
3236
3238
|
children: [
|
|
3237
3239
|
l ?? t,
|
|
3238
|
-
r ? /* @__PURE__ */ e(
|
|
3240
|
+
r ? /* @__PURE__ */ e(P, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null
|
|
3239
3241
|
]
|
|
3240
3242
|
}
|
|
3241
3243
|
),
|
|
@@ -3275,7 +3277,7 @@ function Na({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
3275
3277
|
},
|
|
3276
3278
|
C.label
|
|
3277
3279
|
);
|
|
3278
|
-
const x = !C.disabled && !C.locked, g = C.suffix ?? (C.locked ? /* @__PURE__ */ e(
|
|
3280
|
+
const x = !C.disabled && !C.locked, g = C.suffix ?? (C.locked ? /* @__PURE__ */ e(dt, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null);
|
|
3279
3281
|
return /* @__PURE__ */ i(
|
|
3280
3282
|
"button",
|
|
3281
3283
|
{
|
|
@@ -3302,7 +3304,7 @@ function Na({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
3302
3304
|
) : null
|
|
3303
3305
|
] });
|
|
3304
3306
|
}
|
|
3305
|
-
function
|
|
3307
|
+
function va({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }) {
|
|
3306
3308
|
const [l, s] = E(!1), [o, u] = E(n), [c, _] = E({ row: 0, col: 0 }), d = I(null), b = I(null), p = I([]);
|
|
3307
3309
|
function m(w) {
|
|
3308
3310
|
u(w), a?.(w);
|
|
@@ -3329,7 +3331,7 @@ function ka({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
3329
3331
|
function h(w = !0) {
|
|
3330
3332
|
s(!1), w && b.current?.focus();
|
|
3331
3333
|
}
|
|
3332
|
-
|
|
3334
|
+
L(() => {
|
|
3333
3335
|
if (!l) return;
|
|
3334
3336
|
function w(M) {
|
|
3335
3337
|
d.current && !d.current.contains(M.target) && h(!1);
|
|
@@ -3353,7 +3355,7 @@ function ka({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
3353
3355
|
onClick: () => l ? h() : C(),
|
|
3354
3356
|
children: [
|
|
3355
3357
|
/* @__PURE__ */ e("span", { className: o.length === 0 ? "multi-select__placeholder" : void 0, children: g }),
|
|
3356
|
-
/* @__PURE__ */ e(
|
|
3358
|
+
/* @__PURE__ */ e(P, { size: 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
3357
3359
|
]
|
|
3358
3360
|
}
|
|
3359
3361
|
),
|
|
@@ -3381,8 +3383,8 @@ function ka({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
3381
3383
|
/* @__PURE__ */ i(
|
|
3382
3384
|
"button",
|
|
3383
3385
|
{
|
|
3384
|
-
ref: (
|
|
3385
|
-
|
|
3386
|
+
ref: (q) => {
|
|
3387
|
+
q && (p.current[M][0] = q);
|
|
3386
3388
|
},
|
|
3387
3389
|
type: "button",
|
|
3388
3390
|
role: "option",
|
|
@@ -3393,7 +3395,7 @@ function ka({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
3393
3395
|
onFocus: () => _({ row: M, col: 0 }),
|
|
3394
3396
|
onClick: () => k(w),
|
|
3395
3397
|
children: [
|
|
3396
|
-
/* @__PURE__ */ e("span", { className: `multi-select__check${S ? " multi-select__check--on" : ""}`, "aria-hidden": "true", children: S ? /* @__PURE__ */ e(
|
|
3398
|
+
/* @__PURE__ */ e("span", { className: `multi-select__check${S ? " multi-select__check--on" : ""}`, "aria-hidden": "true", children: S ? /* @__PURE__ */ e(B, { size: 12, strokeWidth: 3 }) : null }),
|
|
3397
3399
|
/* @__PURE__ */ e("span", { className: "multi-select__option-label", children: w })
|
|
3398
3400
|
]
|
|
3399
3401
|
}
|
|
@@ -3401,8 +3403,8 @@ function ka({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
3401
3403
|
/* @__PURE__ */ e(
|
|
3402
3404
|
"button",
|
|
3403
3405
|
{
|
|
3404
|
-
ref: (
|
|
3405
|
-
|
|
3406
|
+
ref: (q) => {
|
|
3407
|
+
q && (p.current[M][1] = q);
|
|
3406
3408
|
},
|
|
3407
3409
|
type: "button",
|
|
3408
3410
|
"aria-label": `${$.label}:${w}`,
|
|
@@ -3418,9 +3420,9 @@ function ka({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
3418
3420
|
] }) : null
|
|
3419
3421
|
] });
|
|
3420
3422
|
}
|
|
3421
|
-
function
|
|
3423
|
+
function xa({ open: t, onClose: n, title: r, children: a, footer: l, initialFocusRef: s, dismissable: o = !0, sticky: u = !1 }) {
|
|
3422
3424
|
const c = I(null), _ = W();
|
|
3423
|
-
if (
|
|
3425
|
+
if (L(() => {
|
|
3424
3426
|
if (!t) return;
|
|
3425
3427
|
const b = document.body.style.overflow;
|
|
3426
3428
|
document.body.style.overflow = "hidden";
|
|
@@ -3430,7 +3432,7 @@ function wa({ open: t, onClose: n, title: r, children: a, footer: l, initialFocu
|
|
|
3430
3432
|
return () => {
|
|
3431
3433
|
window.clearTimeout(p), document.body.style.overflow = b;
|
|
3432
3434
|
};
|
|
3433
|
-
}, [t, s]),
|
|
3435
|
+
}, [t, s]), L(() => {
|
|
3434
3436
|
if (!t || !o) return;
|
|
3435
3437
|
function b(p) {
|
|
3436
3438
|
p.key === "Escape" && (c.current?.contains(document.activeElement) || (p.preventDefault(), n()));
|
|
@@ -3443,7 +3445,7 @@ function wa({ open: t, onClose: n, title: r, children: a, footer: l, initialFocu
|
|
|
3443
3445
|
else if (b.key === "Tab") {
|
|
3444
3446
|
const p = 'button:not([disabled]), input:not([disabled]), [tabindex="0"]', m = Array.from(c.current?.querySelectorAll(p) ?? []);
|
|
3445
3447
|
if (m.length === 0) return;
|
|
3446
|
-
const y = m[0], k = m[m.length - 1], f = document.querySelector(".toast-region")?.lastElementChild, N = Array.from(f?.querySelectorAll(p) ?? []);
|
|
3448
|
+
const y = m[0], k = m[m.length - 1], f = document.querySelector(".q1-toast-region")?.lastElementChild, N = Array.from(f?.querySelectorAll(p) ?? []);
|
|
3447
3449
|
b.shiftKey && document.activeElement === y ? (b.preventDefault(), (N.length > 0 ? N[N.length - 1] : k).focus()) : !b.shiftKey && document.activeElement === k && (b.preventDefault(), (N.length > 0 ? N[0] : y).focus());
|
|
3448
3450
|
}
|
|
3449
3451
|
}
|
|
@@ -3475,43 +3477,43 @@ function wa({ open: t, onClose: n, title: r, children: a, footer: l, initialFocu
|
|
|
3475
3477
|
)
|
|
3476
3478
|
] });
|
|
3477
3479
|
}
|
|
3478
|
-
function
|
|
3480
|
+
function Ca({ children: t }) {
|
|
3479
3481
|
return /* @__PURE__ */ e("div", { className: "modal__inset", children: t });
|
|
3480
3482
|
}
|
|
3481
|
-
const
|
|
3483
|
+
const Yt = ["日", "一", "二", "三", "四", "五", "六"];
|
|
3482
3484
|
function z(t) {
|
|
3483
3485
|
const n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
|
|
3484
3486
|
return `${t.getFullYear()}-${n}-${r}`;
|
|
3485
3487
|
}
|
|
3486
|
-
function
|
|
3488
|
+
function O(t, n) {
|
|
3487
3489
|
return new Date(t.getFullYear(), t.getMonth(), t.getDate() + n);
|
|
3488
3490
|
}
|
|
3489
|
-
function
|
|
3491
|
+
function me(t, n) {
|
|
3490
3492
|
return new Date(t.getFullYear(), t.getMonth() + n, 1);
|
|
3491
3493
|
}
|
|
3492
|
-
function
|
|
3494
|
+
function fe(t) {
|
|
3493
3495
|
return new Date(t.getFullYear(), t.getMonth(), 1);
|
|
3494
3496
|
}
|
|
3495
|
-
function
|
|
3497
|
+
function G(t, n) {
|
|
3496
3498
|
return !!t && !!n && z(t) === z(n);
|
|
3497
3499
|
}
|
|
3498
|
-
function
|
|
3500
|
+
function Gt(t, n) {
|
|
3499
3501
|
return Math.round((n.getTime() - t.getTime()) / 864e5) + 1;
|
|
3500
3502
|
}
|
|
3501
|
-
function
|
|
3502
|
-
const n =
|
|
3503
|
+
function Vt(t) {
|
|
3504
|
+
const n = fe(t), r = O(n, -n.getDay());
|
|
3503
3505
|
return Array.from({ length: 42 }, (a, l) => {
|
|
3504
|
-
const s =
|
|
3506
|
+
const s = O(r, l);
|
|
3505
3507
|
return { date: s, inMonth: s.getMonth() === n.getMonth() };
|
|
3506
3508
|
});
|
|
3507
3509
|
}
|
|
3508
|
-
function
|
|
3510
|
+
function he(t, n, r) {
|
|
3509
3511
|
return !!(n && z(t) < z(n) || r && z(t) > z(r));
|
|
3510
3512
|
}
|
|
3511
|
-
function
|
|
3513
|
+
function Ee(t, n, r) {
|
|
3512
3514
|
return n && z(t) < z(n) ? n : r && z(t) > z(r) ? r : t;
|
|
3513
3515
|
}
|
|
3514
|
-
function
|
|
3516
|
+
function Xt({
|
|
3515
3517
|
value: t,
|
|
3516
3518
|
onChange: n,
|
|
3517
3519
|
size: r = "large",
|
|
@@ -3520,9 +3522,9 @@ function Gt({
|
|
|
3520
3522
|
today: s = /* @__PURE__ */ new Date()
|
|
3521
3523
|
}) {
|
|
3522
3524
|
const [o, u] = E(
|
|
3523
|
-
() =>
|
|
3524
|
-
), [c, _] = E(null), [d, b] = E(() =>
|
|
3525
|
-
|
|
3525
|
+
() => fe(Ee(t.start ?? s, a, l))
|
|
3526
|
+
), [c, _] = E(null), [d, b] = E(() => Ee(t.start ?? s, a, l)), [p, m] = E(""), y = I(/* @__PURE__ */ new Map()), k = I(null), f = Vt(o);
|
|
3527
|
+
L(() => {
|
|
3526
3528
|
if (!k.current) return;
|
|
3527
3529
|
const g = y.current.get(k.current);
|
|
3528
3530
|
k.current = null, g?.focus();
|
|
@@ -3534,41 +3536,41 @@ function Gt({
|
|
|
3534
3536
|
return;
|
|
3535
3537
|
}
|
|
3536
3538
|
const [w, M] = z(g) < z(t.start) ? [g, t.start] : [t.start, g];
|
|
3537
|
-
n({ start: w, end: M }), m(`已选择 ${z(w)} 至 ${z(M)},共 ${
|
|
3539
|
+
n({ start: w, end: M }), m(`已选择 ${z(w)} 至 ${z(M)},共 ${Gt(w, M)} 天`);
|
|
3538
3540
|
}
|
|
3539
3541
|
function D(g) {
|
|
3540
|
-
|
|
3542
|
+
he(g, a, l) || ((g.getMonth() !== o.getMonth() || g.getFullYear() !== o.getFullYear()) && u(fe(g)), b(g), k.current = z(g));
|
|
3541
3543
|
}
|
|
3542
3544
|
function C(g) {
|
|
3543
3545
|
let w = null;
|
|
3544
3546
|
switch (g.key) {
|
|
3545
3547
|
case "ArrowLeft":
|
|
3546
|
-
w =
|
|
3548
|
+
w = O(d, g.shiftKey ? -7 : -1);
|
|
3547
3549
|
break;
|
|
3548
3550
|
case "ArrowRight":
|
|
3549
|
-
w =
|
|
3551
|
+
w = O(d, g.shiftKey ? 7 : 1);
|
|
3550
3552
|
break;
|
|
3551
3553
|
case "ArrowUp":
|
|
3552
|
-
w =
|
|
3554
|
+
w = O(d, -7);
|
|
3553
3555
|
break;
|
|
3554
3556
|
case "ArrowDown":
|
|
3555
|
-
w =
|
|
3557
|
+
w = O(d, 7);
|
|
3556
3558
|
break;
|
|
3557
3559
|
case "Home":
|
|
3558
|
-
w =
|
|
3560
|
+
w = O(d, -d.getDay());
|
|
3559
3561
|
break;
|
|
3560
3562
|
case "End":
|
|
3561
|
-
w =
|
|
3563
|
+
w = O(d, 6 - d.getDay());
|
|
3562
3564
|
break;
|
|
3563
3565
|
case "PageUp":
|
|
3564
|
-
w =
|
|
3566
|
+
w = me(d, -1);
|
|
3565
3567
|
break;
|
|
3566
3568
|
case "PageDown":
|
|
3567
|
-
w =
|
|
3569
|
+
w = me(d, 1);
|
|
3568
3570
|
break;
|
|
3569
3571
|
case "Enter":
|
|
3570
3572
|
case " ":
|
|
3571
|
-
g.preventDefault(),
|
|
3573
|
+
g.preventDefault(), he(d, a, l) || v(d);
|
|
3572
3574
|
return;
|
|
3573
3575
|
default:
|
|
3574
3576
|
return;
|
|
@@ -3576,7 +3578,7 @@ function Gt({
|
|
|
3576
3578
|
g.preventDefault(), w && D(w);
|
|
3577
3579
|
}
|
|
3578
3580
|
function h(g) {
|
|
3579
|
-
const w =
|
|
3581
|
+
const w = me(o, g);
|
|
3580
3582
|
u(w), b(w);
|
|
3581
3583
|
}
|
|
3582
3584
|
const x = `${o.getFullYear()} 年 ${o.getMonth() + 1} 月`;
|
|
@@ -3591,7 +3593,7 @@ function Gt({
|
|
|
3591
3593
|
className: "calendar__nav-btn",
|
|
3592
3594
|
"aria-label": "上一月",
|
|
3593
3595
|
onClick: () => h(-1),
|
|
3594
|
-
children: /* @__PURE__ */ e(
|
|
3596
|
+
children: /* @__PURE__ */ e(be, { size: 16, strokeWidth: 2 })
|
|
3595
3597
|
}
|
|
3596
3598
|
),
|
|
3597
3599
|
/* @__PURE__ */ e(
|
|
@@ -3601,38 +3603,38 @@ function Gt({
|
|
|
3601
3603
|
className: "calendar__nav-btn",
|
|
3602
3604
|
"aria-label": "下一月",
|
|
3603
3605
|
onClick: () => h(1),
|
|
3604
|
-
children: /* @__PURE__ */ e(
|
|
3606
|
+
children: /* @__PURE__ */ e(H, { size: 16, strokeWidth: 2 })
|
|
3605
3607
|
}
|
|
3606
3608
|
)
|
|
3607
3609
|
] })
|
|
3608
3610
|
] }),
|
|
3609
|
-
/* @__PURE__ */ e("div", { className: "calendar__weekdays", "aria-hidden": "true", children:
|
|
3611
|
+
/* @__PURE__ */ e("div", { className: "calendar__weekdays", "aria-hidden": "true", children: Yt.map((g, w) => /* @__PURE__ */ e("span", { className: "calendar__weekday", children: g }, `${g}-${w}`)) }),
|
|
3610
3612
|
/* @__PURE__ */ e("div", { className: "calendar__grid", role: "grid", "aria-label": x, onKeyDown: C, children: f.map(({ date: g, inMonth: w }) => {
|
|
3611
|
-
const M = !w ||
|
|
3613
|
+
const M = !w || he(g, a, l), S = G(g, N.start), $ = G(g, N.end), q = !!N.start && !!N.end && !G(N.start, N.end), R = q && z(g) > z(N.start) && z(g) < z(N.end), X = T(
|
|
3612
3614
|
"calendar__cell",
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3615
|
+
R ? "calendar__cell--in-range" : "",
|
|
3616
|
+
q && S ? "calendar__cell--range-start" : "",
|
|
3617
|
+
q && $ ? "calendar__cell--range-end" : ""
|
|
3618
|
+
), Z = T(
|
|
3617
3619
|
"calendar__day",
|
|
3618
3620
|
w ? "" : "calendar__day--outside",
|
|
3619
3621
|
S && N.start ? "calendar__day--start" : "",
|
|
3620
|
-
$ &&
|
|
3621
|
-
w && !M &&
|
|
3622
|
-
|
|
3623
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3622
|
+
$ && q ? "calendar__day--end" : "",
|
|
3623
|
+
w && !M && G(g, s) ? "calendar__day--today" : ""
|
|
3624
|
+
);
|
|
3625
|
+
return /* @__PURE__ */ e("div", { className: X, role: "gridcell", children: /* @__PURE__ */ e(
|
|
3624
3626
|
"button",
|
|
3625
3627
|
{
|
|
3626
3628
|
type: "button",
|
|
3627
|
-
ref: (
|
|
3628
|
-
|
|
3629
|
+
ref: (Q) => {
|
|
3630
|
+
Q ? y.current.set(z(g), Q) : y.current.delete(z(g));
|
|
3629
3631
|
},
|
|
3630
|
-
className:
|
|
3631
|
-
tabIndex: w && !M &&
|
|
3632
|
+
className: Z,
|
|
3633
|
+
tabIndex: w && !M && G(g, d) ? 0 : -1,
|
|
3632
3634
|
disabled: M,
|
|
3633
3635
|
"aria-disabled": M || void 0,
|
|
3634
3636
|
"aria-selected": (S || $) && N.start ? !0 : void 0,
|
|
3635
|
-
"aria-current": w &&
|
|
3637
|
+
"aria-current": w && G(g, s) ? "date" : void 0,
|
|
3636
3638
|
onClick: () => !M && v(g),
|
|
3637
3639
|
onMouseEnter: () => _(g),
|
|
3638
3640
|
onMouseLeave: () => _(null),
|
|
@@ -3641,10 +3643,10 @@ function Gt({
|
|
|
3641
3643
|
}
|
|
3642
3644
|
) }, z(g));
|
|
3643
3645
|
}) }),
|
|
3644
|
-
/* @__PURE__ */ e("span", { className: "sr-only", "aria-live": "polite", children: p })
|
|
3646
|
+
/* @__PURE__ */ e("span", { className: "q1-sr-only", "aria-live": "polite", children: p })
|
|
3645
3647
|
] });
|
|
3646
3648
|
}
|
|
3647
|
-
function
|
|
3649
|
+
function Zt({
|
|
3648
3650
|
value: t,
|
|
3649
3651
|
withTime: n,
|
|
3650
3652
|
onApply: r,
|
|
@@ -3671,11 +3673,11 @@ function Vt({
|
|
|
3671
3673
|
] }),
|
|
3672
3674
|
a ? /* @__PURE__ */ e("span", { className: "cal-inputs__tz cal-inputs__tz--pinned", children: a }) : /* @__PURE__ */ i("button", { type: "button", className: "cal-inputs__tz", children: [
|
|
3673
3675
|
"本地 (Asia/Shanghai)",
|
|
3674
|
-
/* @__PURE__ */ e(
|
|
3676
|
+
/* @__PURE__ */ e(P, { size: 13, strokeWidth: 2 })
|
|
3675
3677
|
] })
|
|
3676
3678
|
] });
|
|
3677
3679
|
}
|
|
3678
|
-
function
|
|
3680
|
+
function $a({
|
|
3679
3681
|
layout: t = "vertical",
|
|
3680
3682
|
trigger: n = "default",
|
|
3681
3683
|
size: r = "large",
|
|
@@ -3687,7 +3689,7 @@ function xa({
|
|
|
3687
3689
|
onChange: c
|
|
3688
3690
|
}) {
|
|
3689
3691
|
const [_, d] = E(!1), b = I(null), p = I(null);
|
|
3690
|
-
|
|
3692
|
+
L(() => {
|
|
3691
3693
|
if (!_) return;
|
|
3692
3694
|
const N = b.current?.querySelector(".cal-popover"), v = () => N ? [
|
|
3693
3695
|
...N.querySelectorAll(
|
|
@@ -3714,8 +3716,8 @@ function xa({
|
|
|
3714
3716
|
document.removeEventListener("mousedown", C), document.removeEventListener("keydown", h);
|
|
3715
3717
|
};
|
|
3716
3718
|
}, [_]);
|
|
3717
|
-
const m = !!u.start && !!u.end, y = m ? `${z(u.start)} ~ ${z(u.end)}` : "选择日期区间", k = /* @__PURE__ */ e(
|
|
3718
|
-
|
|
3719
|
+
const m = !!u.start && !!u.end, y = m ? `${z(u.start)} ~ ${z(u.end)}` : "选择日期区间", k = /* @__PURE__ */ e(Xt, { value: u, onChange: c, size: r, minValue: a, maxValue: l, today: o }), f = /* @__PURE__ */ e(
|
|
3720
|
+
Zt,
|
|
3719
3721
|
{
|
|
3720
3722
|
value: u,
|
|
3721
3723
|
withTime: t === "vertical",
|
|
@@ -3729,11 +3731,11 @@ function xa({
|
|
|
3729
3731
|
/* @__PURE__ */ i(
|
|
3730
3732
|
"span",
|
|
3731
3733
|
{
|
|
3732
|
-
className:
|
|
3734
|
+
className: T(
|
|
3733
3735
|
"cal-field__control",
|
|
3734
3736
|
`cal-field__control--${n}`,
|
|
3735
3737
|
m ? "cal-field__control--filled" : ""
|
|
3736
|
-
|
|
3738
|
+
),
|
|
3737
3739
|
children: [
|
|
3738
3740
|
/* @__PURE__ */ i(
|
|
3739
3741
|
"button",
|
|
@@ -3745,7 +3747,7 @@ function xa({
|
|
|
3745
3747
|
"aria-expanded": _,
|
|
3746
3748
|
onClick: () => d((N) => !N),
|
|
3747
3749
|
children: [
|
|
3748
|
-
/* @__PURE__ */ e(
|
|
3750
|
+
/* @__PURE__ */ e(at, { size: 15, strokeWidth: 2, "aria-hidden": "true" }),
|
|
3749
3751
|
/* @__PURE__ */ e("span", { className: "cal-field__label", children: y })
|
|
3750
3752
|
]
|
|
3751
3753
|
}
|
|
@@ -3757,7 +3759,7 @@ function xa({
|
|
|
3757
3759
|
className: "cal-field__caret",
|
|
3758
3760
|
"aria-label": "展开日历",
|
|
3759
3761
|
onClick: () => d((N) => !N),
|
|
3760
|
-
children: /* @__PURE__ */ e(
|
|
3762
|
+
children: /* @__PURE__ */ e(P, { size: 15, strokeWidth: 2 })
|
|
3761
3763
|
}
|
|
3762
3764
|
) : m ? /* @__PURE__ */ e(
|
|
3763
3765
|
"button",
|
|
@@ -3766,7 +3768,7 @@ function xa({
|
|
|
3766
3768
|
className: "cal-field__clear",
|
|
3767
3769
|
"aria-label": "清除已选区间",
|
|
3768
3770
|
onClick: () => c({ start: null, end: null }),
|
|
3769
|
-
children: /* @__PURE__ */ e(
|
|
3771
|
+
children: /* @__PURE__ */ e(j, { size: 14, strokeWidth: 2 })
|
|
3770
3772
|
}
|
|
3771
3773
|
) : null
|
|
3772
3774
|
]
|
|
@@ -3779,10 +3781,10 @@ function xa({
|
|
|
3779
3781
|
role: "dialog",
|
|
3780
3782
|
"aria-modal": "true",
|
|
3781
3783
|
"aria-label": "选择日期区间",
|
|
3782
|
-
children: t === "horizontal" ? /* @__PURE__ */ i(
|
|
3784
|
+
children: t === "horizontal" ? /* @__PURE__ */ i(K, { children: [
|
|
3783
3785
|
k,
|
|
3784
3786
|
f
|
|
3785
|
-
] }) : /* @__PURE__ */ i(
|
|
3787
|
+
] }) : /* @__PURE__ */ i(K, { children: [
|
|
3786
3788
|
f,
|
|
3787
3789
|
k
|
|
3788
3790
|
] })
|
|
@@ -3790,14 +3792,14 @@ function xa({
|
|
|
3790
3792
|
) : null
|
|
3791
3793
|
] });
|
|
3792
3794
|
}
|
|
3793
|
-
const
|
|
3794
|
-
function
|
|
3795
|
+
const Qt = ["45m", "12 小时", "10d", "2 周", "上个月", "昨天", "今天"], Jt = ["6/1", "6/1 - 6/2", "6月1日", "6月1日 - 6月2日"];
|
|
3796
|
+
function Da({
|
|
3795
3797
|
presets: t,
|
|
3796
3798
|
activeLabel: n,
|
|
3797
3799
|
onPick: r
|
|
3798
3800
|
}) {
|
|
3799
3801
|
const [a, l] = E(!1), s = I(null);
|
|
3800
|
-
return
|
|
3802
|
+
return L(() => {
|
|
3801
3803
|
if (!a) return;
|
|
3802
3804
|
function o(u) {
|
|
3803
3805
|
s.current && !s.current.contains(u.target) && l(!1);
|
|
@@ -3813,9 +3815,9 @@ function Ca({
|
|
|
3813
3815
|
"aria-expanded": a,
|
|
3814
3816
|
onClick: () => l((o) => !o),
|
|
3815
3817
|
children: [
|
|
3816
|
-
/* @__PURE__ */ e(
|
|
3818
|
+
/* @__PURE__ */ e(rt, { size: 15, strokeWidth: 2, "aria-hidden": "true" }),
|
|
3817
3819
|
/* @__PURE__ */ e("span", { className: "cal-period__label", children: n ?? "选择周期" }),
|
|
3818
|
-
/* @__PURE__ */ e(
|
|
3820
|
+
/* @__PURE__ */ e(P, { size: 15, strokeWidth: 2, "aria-hidden": "true" })
|
|
3819
3821
|
]
|
|
3820
3822
|
}
|
|
3821
3823
|
),
|
|
@@ -3833,105 +3835,105 @@ function Ca({
|
|
|
3833
3835
|
) }, o.label)) }),
|
|
3834
3836
|
/* @__PURE__ */ i("div", { className: "cal-period__hints", "aria-hidden": "true", children: [
|
|
3835
3837
|
/* @__PURE__ */ e("p", { className: "cal-period__hint-title", children: "输入相对时间" }),
|
|
3836
|
-
/* @__PURE__ */ e("div", { className: "cal-period__chips", children:
|
|
3838
|
+
/* @__PURE__ */ e("div", { className: "cal-period__chips", children: Qt.map((o) => /* @__PURE__ */ e("span", { className: "cal-period__chip", children: o }, o)) }),
|
|
3837
3839
|
/* @__PURE__ */ e("p", { className: "cal-period__hint-title", children: "输入固定时间" }),
|
|
3838
|
-
/* @__PURE__ */ e("div", { className: "cal-period__chips", children:
|
|
3840
|
+
/* @__PURE__ */ e("div", { className: "cal-period__chips", children: Jt.map((o) => /* @__PURE__ */ e("span", { className: "cal-period__chip", children: o }, o)) })
|
|
3839
3841
|
] })
|
|
3840
3842
|
] }) : null
|
|
3841
3843
|
] });
|
|
3842
3844
|
}
|
|
3843
3845
|
export {
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3846
|
+
St as Avatar,
|
|
3847
|
+
Vn as AvatarGroup,
|
|
3848
|
+
Kn as Badge,
|
|
3849
|
+
On as Banner,
|
|
3850
|
+
Un as Book,
|
|
3851
|
+
ya as Breadcrumb,
|
|
3852
|
+
Yn as Browser,
|
|
3853
|
+
Mt as BrowserAddress,
|
|
3854
|
+
Dt as BrowserControls,
|
|
3855
|
+
$t as BrowserDots,
|
|
3856
|
+
Gn as BrowserPlaceholder,
|
|
3857
|
+
Et as BrowserTabs,
|
|
3858
|
+
ln as Button,
|
|
3859
|
+
Xt as CalendarGrid,
|
|
3860
|
+
Bn as Card,
|
|
3861
|
+
mn as Checkbox,
|
|
3862
|
+
fn as Choicebox,
|
|
3863
|
+
kt as ClearButton,
|
|
3864
|
+
on as ClearableInput,
|
|
3865
|
+
gn as Code,
|
|
3866
|
+
kn as CodeBlock,
|
|
3867
|
+
Nn as CodeInline,
|
|
3868
|
+
Be as CodeTokens,
|
|
3869
|
+
xn as Collapse,
|
|
3870
|
+
vn as CollapseGroup,
|
|
3871
|
+
ga as CollapsibleBreadcrumb,
|
|
3872
|
+
_n as Combobox,
|
|
3873
|
+
Cn as CommandMenu,
|
|
3874
|
+
jn as ContextCard,
|
|
3875
|
+
Ln as ContextMenu,
|
|
3876
|
+
Oe as ControlOption,
|
|
3877
|
+
rn as CopyButton,
|
|
3878
|
+
Hn as Description,
|
|
3879
|
+
$n as DestructiveActionModal,
|
|
3880
|
+
Rn as DotsMenu,
|
|
3881
|
+
Dn as Drawer,
|
|
3882
|
+
Mn as EmptyState,
|
|
3883
|
+
En as Entity,
|
|
3884
|
+
Sn as ErrorCard,
|
|
3885
|
+
In as ErrorMessage,
|
|
3886
|
+
Tn as Feedback,
|
|
3887
|
+
An as Fieldset,
|
|
3888
|
+
qn as FileTree,
|
|
3889
|
+
ge as FormField,
|
|
3890
|
+
aa as Gauge,
|
|
3891
|
+
sn as Input,
|
|
3892
|
+
ma as Kbd,
|
|
3893
|
+
Wn as Label,
|
|
3894
|
+
ia as LoadMoreButton,
|
|
3895
|
+
Zn as LoadingDots,
|
|
3896
|
+
wa as Menu,
|
|
3897
|
+
Qn as MiddleTruncate,
|
|
3898
|
+
xa as Modal,
|
|
3899
|
+
Ca as ModalInset,
|
|
3900
|
+
va as MultiSelect,
|
|
3901
|
+
la as Note,
|
|
3902
|
+
sa as Pagination,
|
|
3903
|
+
Da as PeriodCombobox,
|
|
3904
|
+
Jn as Phone,
|
|
3905
|
+
Pn as Pill,
|
|
3906
|
+
ra as Progress,
|
|
3907
|
+
ea as ProjectBanner,
|
|
3908
|
+
hn as Radio,
|
|
3909
|
+
$a as RangeField,
|
|
3910
|
+
Zt as RangeInputs,
|
|
3911
|
+
ba as RangeSlider,
|
|
3912
|
+
ca as RelativeTimeCard,
|
|
3913
|
+
pa as Scroller,
|
|
3914
|
+
fa as ScrollerWithButtons,
|
|
3915
|
+
cn as SearchInput,
|
|
3916
|
+
un as Select,
|
|
3917
|
+
zn as Separator,
|
|
3918
|
+
Na as Sheet,
|
|
3919
|
+
oa as ShowMore,
|
|
3920
|
+
Xn as Skeleton,
|
|
3921
|
+
_a as Slider,
|
|
3922
|
+
na as Snippet,
|
|
3923
|
+
da as Spinner,
|
|
3924
|
+
ka as SplitButton,
|
|
3925
|
+
Fn as StatusDot,
|
|
3926
|
+
bn as Switch,
|
|
3927
|
+
wn as Tabs,
|
|
3928
|
+
ta as TextWithCopyButton,
|
|
3929
|
+
dn as Textarea,
|
|
3930
|
+
ha as ThemeSwitcher,
|
|
3931
|
+
an as ToastProvider,
|
|
3932
|
+
yn as Toggle,
|
|
3933
|
+
Ct as Tooltip,
|
|
3934
|
+
ua as Video,
|
|
3935
|
+
O as addDays,
|
|
3936
|
+
ce as useCopy,
|
|
3937
|
+
pn as useRadio,
|
|
3938
|
+
gt as useToast
|
|
3937
3939
|
};
|