bj-web-components 0.2.1 → 0.2.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/{Switch-CibFpicp.mjs → Switch-BijGI_2X.mjs} +244 -238
- package/dist/{Switch-CZg2Eeb6.js → Switch-CoCXejMA.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/web.js +1 -1
- package/dist/web.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as rt } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useCallback as ot, useLayoutEffect as st, forwardRef as ct, useRef as Y, useEffect as et, useMemo as Ct } from "react";
|
|
3
3
|
import { createPortal as lt } from "react-dom";
|
|
4
4
|
const It = ["top", "right", "bottom", "left"];
|
|
5
5
|
function at(o) {
|
|
6
|
-
const [i,
|
|
6
|
+
const [i, r] = x("top"), [a, p] = x(null), l = ot((s) => {
|
|
7
7
|
p(s);
|
|
8
8
|
}, []);
|
|
9
9
|
return st(() => {
|
|
@@ -23,16 +23,16 @@ function at(o) {
|
|
|
23
23
|
};
|
|
24
24
|
for (const y of It)
|
|
25
25
|
if (c[y] >= g[y]) {
|
|
26
|
-
|
|
26
|
+
r(y);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
r("top");
|
|
30
30
|
}, [o, a]), [o === "auto" ? i : o, l];
|
|
31
31
|
}
|
|
32
32
|
function Xt({
|
|
33
33
|
placement: o = "top",
|
|
34
34
|
title: i = "是否使用当前自动翻译的英文?",
|
|
35
|
-
okText:
|
|
35
|
+
okText: r = "使用",
|
|
36
36
|
cancelText: a = "我去改改",
|
|
37
37
|
onOk: p,
|
|
38
38
|
onCancel: l,
|
|
@@ -40,29 +40,29 @@ function Xt({
|
|
|
40
40
|
style: h
|
|
41
41
|
}) {
|
|
42
42
|
const [w, A] = at(o), C = ["tooltip-popup", `tooltip-popup--${w}`, s].filter(Boolean).join(" ");
|
|
43
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ n("div", { ref: A, className: C, style: h, children: [
|
|
44
44
|
/* @__PURE__ */ t("div", { className: `tooltip-arrow tooltip-arrow--${w}` }),
|
|
45
45
|
/* @__PURE__ */ t("p", { className: "tooltip-confirm__title", children: i }),
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ n("div", { className: "tooltip-confirm__actions", children: [
|
|
47
47
|
/* @__PURE__ */ t("button", { className: "tooltip-confirm__cancel", onClick: l, children: a }),
|
|
48
|
-
/* @__PURE__ */ t("button", { className: "tooltip-confirm__ok", onClick: p, children:
|
|
48
|
+
/* @__PURE__ */ t("button", { className: "tooltip-confirm__ok", onClick: p, children: r })
|
|
49
49
|
] })
|
|
50
50
|
] });
|
|
51
51
|
}
|
|
52
52
|
function Vt({
|
|
53
53
|
placement: o = "top",
|
|
54
54
|
title: i = "正在翻译私域数据...",
|
|
55
|
-
progress:
|
|
55
|
+
progress: r = 0,
|
|
56
56
|
className: a,
|
|
57
57
|
style: p
|
|
58
58
|
}) {
|
|
59
|
-
const [l, s] = at(o), h = Math.min(100, Math.max(0, Math.round(
|
|
60
|
-
return /* @__PURE__ */
|
|
59
|
+
const [l, s] = at(o), h = Math.min(100, Math.max(0, Math.round(r))), w = ["tooltip-popup", `tooltip-popup--${l}`, a].filter(Boolean).join(" ");
|
|
60
|
+
return /* @__PURE__ */ n("div", { ref: s, className: w, style: p, children: [
|
|
61
61
|
/* @__PURE__ */ t("div", { className: `tooltip-arrow tooltip-arrow--${l}` }),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ n("div", { className: "tooltip-progress", children: [
|
|
63
|
+
/* @__PURE__ */ n("div", { className: "tooltip-progress__header", children: [
|
|
64
64
|
/* @__PURE__ */ t("span", { className: "tooltip-progress__title", children: i }),
|
|
65
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ n("span", { className: "tooltip-progress__percent", children: [
|
|
66
66
|
h,
|
|
67
67
|
"%"
|
|
68
68
|
] })
|
|
@@ -81,28 +81,28 @@ function Vt({
|
|
|
81
81
|
function ft({
|
|
82
82
|
placement: o = "top",
|
|
83
83
|
content: i = "这里是提示内容,可以包含更多详细信息。",
|
|
84
|
-
variant:
|
|
84
|
+
variant: r = "default",
|
|
85
85
|
className: a,
|
|
86
86
|
style: p
|
|
87
87
|
}) {
|
|
88
88
|
const [l, s] = at(o), h = [
|
|
89
89
|
"tooltip-popup",
|
|
90
90
|
`tooltip-popup--${l}`,
|
|
91
|
-
|
|
91
|
+
r !== "default" ? `tooltip-popup--${r}` : "",
|
|
92
92
|
a
|
|
93
93
|
].filter(Boolean).join(" "), w = [
|
|
94
94
|
"tooltip-arrow",
|
|
95
95
|
`tooltip-arrow--${l}`,
|
|
96
|
-
|
|
96
|
+
r === "tinted" ? "tooltip-arrow--tinted-bg" : ""
|
|
97
97
|
].filter(Boolean).join(" ");
|
|
98
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ n("div", { ref: s, className: h, style: p, children: [
|
|
99
99
|
/* @__PURE__ */ t("div", { className: w }),
|
|
100
100
|
/* @__PURE__ */ t("p", { className: "tooltip-content__text", children: i })
|
|
101
101
|
] });
|
|
102
102
|
}
|
|
103
103
|
const gt = ct(
|
|
104
|
-
({ children: o, style: i, className:
|
|
105
|
-
const p = ["tooltip-wrapper",
|
|
104
|
+
({ children: o, style: i, className: r }, a) => {
|
|
105
|
+
const p = ["tooltip-wrapper", r].filter(Boolean).join(" ");
|
|
106
106
|
return /* @__PURE__ */ t("div", { ref: a, className: p, style: i, children: o });
|
|
107
107
|
}
|
|
108
108
|
);
|
|
@@ -118,7 +118,7 @@ function Kt() {
|
|
|
118
118
|
return /* @__PURE__ */ t("svg", { width: "24", height: "24", viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M515.512889 227.555556a21.070222 21.070222 0 0 1 21.070222 21.070222v245.816889h238.791111a21.070222 21.070222 0 0 1 0 42.140444h-238.791111v238.791111a21.070222 21.070222 0 0 1-42.140444 0v-238.791111H248.625778a21.070222 21.070222 0 0 1 0-42.140444h245.816889V248.625778A21.070222 21.070222 0 0 1 515.512889 227.555556z", fill: "currentColor" }) });
|
|
119
119
|
}
|
|
120
120
|
function zt() {
|
|
121
|
-
return /* @__PURE__ */
|
|
121
|
+
return /* @__PURE__ */ n("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
122
122
|
/* @__PURE__ */ t("path", { d: "M8.68576 19.3333C9.0645 19.3333 9.37153 19.6404 9.37153 20.0191V22.1714C9.37153 22.4239 9.5761 22.6285 9.82856 22.6285H11.9809C12.3596 22.6285 12.6667 22.9355 12.6667 23.3142C12.6667 23.693 12.3596 24 11.9809 24H9.82856L9.73438 23.9976C8.79946 23.9502 8.04983 23.2005 8.00239 22.2656L8 22.1714V20.0191C8 19.6404 8.30703 19.3333 8.68576 19.3333Z", fill: "currentColor" }),
|
|
123
123
|
/* @__PURE__ */ t("path", { d: "M23.3142 19.3333C23.693 19.3333 24 19.6404 24 20.0191V22.1714C24 23.1497 23.2317 23.9486 22.2656 23.9976L22.1714 24H20.0191C19.6404 24 19.3333 23.693 19.3333 23.3142C19.3333 22.9355 19.6404 22.6285 20.0191 22.6285H22.1714C22.4239 22.6285 22.6285 22.4239 22.6285 22.1714V20.0191C22.6285 19.6404 22.9355 19.3333 23.3142 19.3333Z", fill: "currentColor" }),
|
|
124
124
|
/* @__PURE__ */ t("path", { d: "M15.5573 11.2413C17.8315 11.2989 19.6575 13.1607 19.6576 15.4488L19.656 15.5573C19.6337 16.4372 19.3411 17.2497 18.8585 17.9156L20.5647 19.6217C20.825 19.8821 20.825 20.3043 20.5647 20.5647C20.3043 20.825 19.8823 20.825 19.622 20.5647L17.9156 18.8585C17.2224 19.3609 16.3703 19.6575 15.4488 19.6576L15.3401 19.656C13.102 19.5993 11.298 17.7954 11.2413 15.5573L11.24 15.4488C11.24 13.1244 13.1244 11.24 15.4488 11.24L15.5573 11.2413ZM15.4488 12.5734C13.8608 12.5734 12.5734 13.8608 12.5734 15.4488C12.5734 17.0368 13.8608 18.3242 15.4488 18.3242C17.0368 18.3242 18.3242 17.0368 18.3242 15.4488C18.3242 13.8608 17.0368 12.5734 15.4488 12.5734Z", fill: "currentColor" }),
|
|
@@ -134,10 +134,10 @@ function jt(o, i) {
|
|
|
134
134
|
}
|
|
135
135
|
function bt({ text: o, keyword: i }) {
|
|
136
136
|
if (!i) return /* @__PURE__ */ t(rt, { children: o });
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
139
|
-
const a = o.slice(0,
|
|
140
|
-
return /* @__PURE__ */
|
|
137
|
+
const r = o.toLowerCase().indexOf(i.toLowerCase());
|
|
138
|
+
if (r === -1) return /* @__PURE__ */ t(rt, { children: o });
|
|
139
|
+
const a = o.slice(0, r), p = o.slice(r, r + i.length), l = o.slice(r + i.length);
|
|
140
|
+
return /* @__PURE__ */ n(rt, { children: [
|
|
141
141
|
a,
|
|
142
142
|
/* @__PURE__ */ t("span", { className: "sku-input-card__dropdown-highlight", children: p }),
|
|
143
143
|
l
|
|
@@ -146,7 +146,7 @@ function bt({ text: o, keyword: i }) {
|
|
|
146
146
|
function _t({
|
|
147
147
|
id: o,
|
|
148
148
|
name: i = "",
|
|
149
|
-
onNameChange:
|
|
149
|
+
onNameChange: r,
|
|
150
150
|
mode: a = "single",
|
|
151
151
|
activeLang: p = "zh",
|
|
152
152
|
onLangChange: l,
|
|
@@ -161,21 +161,21 @@ function _t({
|
|
|
161
161
|
labels: f,
|
|
162
162
|
inputEvents: S,
|
|
163
163
|
className: H,
|
|
164
|
-
style:
|
|
164
|
+
style: N,
|
|
165
165
|
options: K,
|
|
166
166
|
optionFilterProp: j,
|
|
167
|
-
onSelect:
|
|
168
|
-
onSearch:
|
|
167
|
+
onSelect: O,
|
|
168
|
+
onSearch: J,
|
|
169
169
|
open: G,
|
|
170
|
-
onDropdownVisibleChange:
|
|
170
|
+
onDropdownVisibleChange: k
|
|
171
171
|
}) {
|
|
172
|
-
const T = (f == null ? void 0 : f.namePlaceholder) ?? "请填写产品名称", E = (f == null ? void 0 : f.uploadLocal) ?? "本地上传", I = (f == null ? void 0 : f.associateImage) ?? "关联图片", m = Y(null),
|
|
172
|
+
const T = (f == null ? void 0 : f.namePlaceholder) ?? "请填写产品名称", E = (f == null ? void 0 : f.uploadLocal) ?? "本地上传", I = (f == null ? void 0 : f.associateImage) ?? "关联图片", m = Y(null), L = Y(null), b = Y(null), d = Y(null), [R, z] = x([]), [P, q] = x(!1), [X, Q] = x(!1), [tt, F] = x(!1), Z = Array.isArray(K) && K.length > 0, _ = G !== void 0 ? G : Z && X, it = Z ? i ? K.filter(
|
|
173
173
|
(e) => j ? j(e, i) : jt(e, i)
|
|
174
174
|
) : K : [];
|
|
175
175
|
et(() => {
|
|
176
176
|
if (!P) return;
|
|
177
177
|
function e(v) {
|
|
178
|
-
|
|
178
|
+
L.current && !L.current.contains(v.target) && q(!1);
|
|
179
179
|
}
|
|
180
180
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
181
181
|
}, [P]), et(() => {
|
|
@@ -183,10 +183,10 @@ function _t({
|
|
|
183
183
|
function e(v) {
|
|
184
184
|
var U, W;
|
|
185
185
|
const M = v.target;
|
|
186
|
-
(U = b.current) != null && U.contains(M) || (W = d.current) != null && W.contains(M) || (
|
|
186
|
+
(U = b.current) != null && U.contains(M) || (W = d.current) != null && W.contains(M) || (Q(!1), k == null || k(!1));
|
|
187
187
|
}
|
|
188
188
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
189
|
-
}, [_,
|
|
189
|
+
}, [_, k]);
|
|
190
190
|
const V = y ?? R;
|
|
191
191
|
async function $(e) {
|
|
192
192
|
var M;
|
|
@@ -213,7 +213,7 @@ function _t({
|
|
|
213
213
|
function u() {
|
|
214
214
|
q(!1), g == null || g();
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const D = [
|
|
217
217
|
"sku-input-card",
|
|
218
218
|
h && "sku-input-card--error",
|
|
219
219
|
H
|
|
@@ -222,21 +222,21 @@ function _t({
|
|
|
222
222
|
a === "bilingual" && "sku-input-card__name-input--with-toggle",
|
|
223
223
|
h && "sku-input-card__name-input--error"
|
|
224
224
|
].filter(Boolean).join(" ");
|
|
225
|
-
return /* @__PURE__ */
|
|
225
|
+
return /* @__PURE__ */ n("div", { className: D, style: N, children: [
|
|
226
226
|
/* @__PURE__ */ t("span", { className: "sku-input-card__drag", id: o, children: /* @__PURE__ */ t(Mt, {}) }),
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ n("div", { className: "sku-input-card__main", children: [
|
|
228
|
+
/* @__PURE__ */ n("div", { className: "sku-input-card__header", children: [
|
|
229
|
+
/* @__PURE__ */ n("div", { className: "sku-input-card__name-wrap", ref: d, children: [
|
|
230
230
|
/* @__PURE__ */ t(
|
|
231
231
|
"input",
|
|
232
232
|
{
|
|
233
233
|
className: B,
|
|
234
234
|
value: i,
|
|
235
235
|
onChange: (e) => {
|
|
236
|
-
|
|
236
|
+
r == null || r(e.target.value), J == null || J(e.target.value);
|
|
237
237
|
},
|
|
238
238
|
onFocus: () => {
|
|
239
|
-
Z && G === void 0 && (
|
|
239
|
+
Z && G === void 0 && (Q(!0), k == null || k(!0));
|
|
240
240
|
},
|
|
241
241
|
placeholder: T,
|
|
242
242
|
...S
|
|
@@ -256,14 +256,14 @@ function _t({
|
|
|
256
256
|
e.value === i && "sku-input-card__dropdown-item--selected"
|
|
257
257
|
].filter(Boolean).join(" "),
|
|
258
258
|
onMouseDown: (M) => {
|
|
259
|
-
M.preventDefault(), !e.disabled && (
|
|
259
|
+
M.preventDefault(), !e.disabled && (r == null || r(e.value), O == null || O(e.value, e), Q(!1), k == null || k(!1));
|
|
260
260
|
},
|
|
261
261
|
children: /* @__PURE__ */ t(bt, { text: v, keyword: i })
|
|
262
262
|
},
|
|
263
263
|
e.value
|
|
264
264
|
);
|
|
265
265
|
}) }) }),
|
|
266
|
-
a === "bilingual" && /* @__PURE__ */
|
|
266
|
+
a === "bilingual" && /* @__PURE__ */ n("div", { className: "sku-input-card__lang-toggle", children: [
|
|
267
267
|
/* @__PURE__ */ t(
|
|
268
268
|
"button",
|
|
269
269
|
{
|
|
@@ -284,7 +284,7 @@ function _t({
|
|
|
284
284
|
] }),
|
|
285
285
|
/* @__PURE__ */ t("button", { className: "sku-input-card__delete", onClick: w, children: /* @__PURE__ */ t(Et, {}) })
|
|
286
286
|
] }),
|
|
287
|
-
s && /* @__PURE__ */
|
|
287
|
+
s && /* @__PURE__ */ n("div", { className: "sku-input-card__body", children: [
|
|
288
288
|
/* @__PURE__ */ t(
|
|
289
289
|
"input",
|
|
290
290
|
{
|
|
@@ -297,9 +297,9 @@ function _t({
|
|
|
297
297
|
),
|
|
298
298
|
tt ? /* @__PURE__ */ t("div", { className: "sku-input-card__loading", children: /* @__PURE__ */ t("img", { src: mt, alt: "上传中", className: "sku-input-card__loading-img" }) }) : V[0] ? (
|
|
299
299
|
/* Single image preview */
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ n("div", { className: "sku-input-card__image-item", children: [
|
|
301
301
|
/* @__PURE__ */ t("img", { src: V[0], alt: "图片", className: "sku-input-card__image-thumb" }),
|
|
302
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ n("div", { className: "sku-input-card__image-overlay", children: [
|
|
303
303
|
/* @__PURE__ */ t(
|
|
304
304
|
"button",
|
|
305
305
|
{
|
|
@@ -320,7 +320,7 @@ function _t({
|
|
|
320
320
|
] })
|
|
321
321
|
) : P ? (
|
|
322
322
|
/* Upload options — local upload / associate image */
|
|
323
|
-
/* @__PURE__ */ t("div", { className: "sku-input-card__upload-options", children: /* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ t("div", { className: "sku-input-card__upload-options", children: /* @__PURE__ */ n("div", { ref: L, className: "sku-input-card__upload-options-box", children: [
|
|
324
324
|
/* @__PURE__ */ t("button", { className: "sku-input-card__upload-opt-btn", onClick: nt, children: E }),
|
|
325
325
|
/* @__PURE__ */ t("button", { className: "sku-input-card__upload-opt-btn", onClick: u, children: I })
|
|
326
326
|
] }) })
|
|
@@ -339,7 +339,7 @@ function _t({
|
|
|
339
339
|
] })
|
|
340
340
|
] });
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function Qt() {
|
|
343
343
|
return /* @__PURE__ */ t("svg", { width: "8", height: "4.5", viewBox: "315 270 365 185", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
344
344
|
"path",
|
|
345
345
|
{
|
|
@@ -348,7 +348,7 @@ function kt() {
|
|
|
348
348
|
}
|
|
349
349
|
) });
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function kt() {
|
|
352
352
|
return /* @__PURE__ */ t("svg", { width: "8", height: "4.5", viewBox: "315 565 365 215", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
353
353
|
"path",
|
|
354
354
|
{
|
|
@@ -357,8 +357,8 @@ function Qt() {
|
|
|
357
357
|
}
|
|
358
358
|
) });
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
return /* @__PURE__ */
|
|
360
|
+
function Lt() {
|
|
361
|
+
return /* @__PURE__ */ n("svg", { className: "bu-input__error-icon", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
362
362
|
/* @__PURE__ */ t("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
363
363
|
/* @__PURE__ */ t("path", { d: "M5 8h6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
364
364
|
] });
|
|
@@ -366,7 +366,7 @@ function Dt() {
|
|
|
366
366
|
const $t = ct(
|
|
367
367
|
function({
|
|
368
368
|
type: i = "input",
|
|
369
|
-
mode:
|
|
369
|
+
mode: r = "single",
|
|
370
370
|
activeLang: a = "zh",
|
|
371
371
|
onLangChange: p,
|
|
372
372
|
value: l = "",
|
|
@@ -381,24 +381,24 @@ const $t = ct(
|
|
|
381
381
|
disabled: f,
|
|
382
382
|
leftIcon: S,
|
|
383
383
|
rightIcon: H,
|
|
384
|
-
langToggle:
|
|
384
|
+
langToggle: N,
|
|
385
385
|
translating: K = !1,
|
|
386
386
|
translated: j = !1,
|
|
387
|
-
onBlur:
|
|
388
|
-
min:
|
|
387
|
+
onBlur: O,
|
|
388
|
+
min: J,
|
|
389
389
|
max: G,
|
|
390
|
-
step:
|
|
390
|
+
step: k = 1,
|
|
391
391
|
labels: T,
|
|
392
392
|
id: E,
|
|
393
393
|
className: I,
|
|
394
394
|
style: m
|
|
395
|
-
},
|
|
395
|
+
}, L) {
|
|
396
396
|
T == null || T.zh, T == null || T.en;
|
|
397
|
-
function b(
|
|
398
|
-
let F = (parseFloat(l) || 0) +
|
|
399
|
-
|
|
397
|
+
function b(Q) {
|
|
398
|
+
let F = (parseFloat(l) || 0) + Q;
|
|
399
|
+
J !== void 0 && (F = Math.max(J, F)), G !== void 0 && (F = Math.min(G, F)), s == null || s(String(F));
|
|
400
400
|
}
|
|
401
|
-
const d = i === "textarea" && !!c, R = d ||
|
|
401
|
+
const d = i === "textarea" && !!c, R = d || r === "bilingual" || K || j, z = C ? `${l.length}/${C}` : `${l.length}`, P = g && !!y && l.length > 0, q = [
|
|
402
402
|
"bu-input__box",
|
|
403
403
|
(i === "input" || i === "number") && "bu-input__box--single",
|
|
404
404
|
i === "number" && "bu-input__box--number",
|
|
@@ -408,53 +408,53 @@ const $t = ct(
|
|
|
408
408
|
!!S && "bu-input__box--has-left",
|
|
409
409
|
!!H && "bu-input__box--has-right"
|
|
410
410
|
].filter(Boolean).join(" "), X = `bu-input__field bu-input__field--${i}`;
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
h && /* @__PURE__ */
|
|
411
|
+
return /* @__PURE__ */ n("div", { className: ["bu-input", I].filter(Boolean).join(" "), style: m, children: [
|
|
412
|
+
h && /* @__PURE__ */ n("label", { className: "bu-input__label", htmlFor: E, children: [
|
|
413
413
|
w && /* @__PURE__ */ t("span", { className: "bu-input__required", children: "*" }),
|
|
414
414
|
h
|
|
415
415
|
] }),
|
|
416
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ n("div", { className: "bu-input__row", children: [
|
|
417
417
|
S && /* @__PURE__ */ t("span", { className: "bu-input__icon bu-input__icon--left", children: S }),
|
|
418
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ n("div", { className: q, children: [
|
|
419
419
|
i === "textarea" ? /* @__PURE__ */ t(
|
|
420
420
|
"textarea",
|
|
421
421
|
{
|
|
422
|
-
ref:
|
|
422
|
+
ref: L,
|
|
423
423
|
id: E,
|
|
424
424
|
className: X,
|
|
425
425
|
value: l,
|
|
426
|
-
onChange: (
|
|
427
|
-
onBlur:
|
|
426
|
+
onChange: (Q) => s == null ? void 0 : s(Q.target.value),
|
|
427
|
+
onBlur: O,
|
|
428
428
|
placeholder: A,
|
|
429
429
|
maxLength: C,
|
|
430
430
|
disabled: f
|
|
431
431
|
}
|
|
432
|
-
) : i === "number" ? /* @__PURE__ */
|
|
432
|
+
) : i === "number" ? /* @__PURE__ */ n(rt, { children: [
|
|
433
433
|
/* @__PURE__ */ t(
|
|
434
434
|
"input",
|
|
435
435
|
{
|
|
436
|
-
ref:
|
|
436
|
+
ref: L,
|
|
437
437
|
id: E,
|
|
438
438
|
className: X,
|
|
439
439
|
value: l,
|
|
440
|
-
onChange: (
|
|
441
|
-
onBlur:
|
|
440
|
+
onChange: (Q) => s == null ? void 0 : s(Q.target.value),
|
|
441
|
+
onBlur: O,
|
|
442
442
|
placeholder: A,
|
|
443
443
|
disabled: f,
|
|
444
444
|
inputMode: "numeric"
|
|
445
445
|
}
|
|
446
446
|
),
|
|
447
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ n("div", { className: "bu-input__stepper", children: [
|
|
448
448
|
/* @__PURE__ */ t(
|
|
449
449
|
"button",
|
|
450
450
|
{
|
|
451
451
|
type: "button",
|
|
452
452
|
className: "bu-input__stepper-btn bu-input__stepper-btn--up",
|
|
453
|
-
onMouseDown: (
|
|
454
|
-
onClick: () => b(
|
|
453
|
+
onMouseDown: (Q) => Q.preventDefault(),
|
|
454
|
+
onClick: () => b(k),
|
|
455
455
|
disabled: f || G !== void 0 && parseFloat(l || "0") >= G,
|
|
456
456
|
tabIndex: -1,
|
|
457
|
-
children: /* @__PURE__ */ t(
|
|
457
|
+
children: /* @__PURE__ */ t(Qt, {})
|
|
458
458
|
}
|
|
459
459
|
),
|
|
460
460
|
/* @__PURE__ */ t(
|
|
@@ -462,57 +462,57 @@ const $t = ct(
|
|
|
462
462
|
{
|
|
463
463
|
type: "button",
|
|
464
464
|
className: "bu-input__stepper-btn bu-input__stepper-btn--down",
|
|
465
|
-
onMouseDown: (
|
|
466
|
-
onClick: () => b(-
|
|
467
|
-
disabled: f ||
|
|
465
|
+
onMouseDown: (Q) => Q.preventDefault(),
|
|
466
|
+
onClick: () => b(-k),
|
|
467
|
+
disabled: f || J !== void 0 && parseFloat(l || "0") <= J,
|
|
468
468
|
tabIndex: -1,
|
|
469
|
-
children: /* @__PURE__ */ t(
|
|
469
|
+
children: /* @__PURE__ */ t(kt, {})
|
|
470
470
|
}
|
|
471
471
|
)
|
|
472
472
|
] })
|
|
473
473
|
] }) : /* @__PURE__ */ t(
|
|
474
474
|
"input",
|
|
475
475
|
{
|
|
476
|
-
ref:
|
|
476
|
+
ref: L,
|
|
477
477
|
id: E,
|
|
478
478
|
className: X,
|
|
479
479
|
value: l,
|
|
480
|
-
onChange: (
|
|
481
|
-
onBlur:
|
|
480
|
+
onChange: (Q) => s == null ? void 0 : s(Q.target.value),
|
|
481
|
+
onBlur: O,
|
|
482
482
|
placeholder: A,
|
|
483
483
|
maxLength: C,
|
|
484
484
|
disabled: f
|
|
485
485
|
}
|
|
486
486
|
),
|
|
487
|
-
R && /* @__PURE__ */
|
|
487
|
+
R && /* @__PURE__ */ n("div", { className: `bu-input__footer${i === "textarea" ? " bu-input__footer--bottom" : ""}`, children: [
|
|
488
488
|
d && /* @__PURE__ */ t("span", { className: "bu-input__count", children: z }),
|
|
489
|
-
K && /* @__PURE__ */
|
|
489
|
+
K && /* @__PURE__ */ n("span", { className: "bu-input__translating", children: [
|
|
490
490
|
/* @__PURE__ */ t("svg", { className: "bu-input__translating-icon", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeDasharray: "14 42" }) }),
|
|
491
491
|
"翻译中…"
|
|
492
492
|
] }),
|
|
493
|
-
j && !K && /* @__PURE__ */
|
|
493
|
+
j && !K && /* @__PURE__ */ n("span", { className: "bu-input__translated", children: [
|
|
494
494
|
/* @__PURE__ */ t("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M3 8l3.5 3.5L13 4.5", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
495
495
|
"翻译完成"
|
|
496
496
|
] }),
|
|
497
|
-
|
|
497
|
+
r === "bilingual" && !K && !j && (N ?? /* @__PURE__ */ t("div", { className: "bu-input__lang-toggle" }))
|
|
498
498
|
] })
|
|
499
499
|
] }),
|
|
500
500
|
H && /* @__PURE__ */ t("span", { className: "bu-input__icon bu-input__icon--right", children: H })
|
|
501
501
|
] }),
|
|
502
|
-
P && /* @__PURE__ */
|
|
503
|
-
/* @__PURE__ */ t(
|
|
502
|
+
P && /* @__PURE__ */ n("div", { className: "bu-input__error-msg", children: [
|
|
503
|
+
/* @__PURE__ */ t(Lt, {}),
|
|
504
504
|
y
|
|
505
505
|
] })
|
|
506
506
|
] });
|
|
507
507
|
}
|
|
508
508
|
);
|
|
509
|
-
function
|
|
509
|
+
function Dt() {
|
|
510
510
|
return /* @__PURE__ */ t("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M14.1667 5.3335C15.1792 5.3335 16 6.15431 16 7.16683V8.00016H19C19.2761 8.00016 19.5 8.22402 19.5 8.50016C19.5 8.7763 19.2761 9.00016 19 9.00016H17.3333V16.8335C17.3333 17.846 16.5125 18.6668 15.5 18.6668H8.5C7.48748 18.6668 6.66667 17.846 6.66667 16.8335V9.00016H5C4.72386 9.00016 4.5 8.7763 4.5 8.50016C4.5 8.22402 4.72386 8.00016 5 8.00016H8V7.16683C8 6.15431 8.82081 5.3335 9.83333 5.3335H14.1667ZM7.66667 16.8335C7.66667 17.2937 8.03976 17.6668 8.5 17.6668H15.5C15.9602 17.6668 16.3333 17.2937 16.3333 16.8335V9.00016H7.66667V16.8335ZM10.5 11.3335C10.7761 11.3335 11 11.5574 11 11.8335V15.0002C11 15.2763 10.7761 15.5002 10.5 15.5002C10.2239 15.5002 10 15.2763 10 15.0002V11.8335C10 11.5574 10.2239 11.3335 10.5 11.3335ZM13.5 11.3335C13.7761 11.3335 14 11.5574 14 11.8335V15.0002C14 15.2763 13.7761 15.5002 13.5 15.5002C13.2239 15.5002 13 15.2763 13 15.0002V11.8335C13 11.5574 13.2239 11.3335 13.5 11.3335ZM9.83333 6.3335C9.3731 6.3335 9 6.70659 9 7.16683V8.00016H15V7.16683C15 6.70659 14.6269 6.3335 14.1667 6.3335H9.83333Z", fill: "currentColor" }) });
|
|
511
511
|
}
|
|
512
512
|
const te = ct(
|
|
513
513
|
function({
|
|
514
514
|
mode: i = "single",
|
|
515
|
-
activeLang:
|
|
515
|
+
activeLang: r = "zh",
|
|
516
516
|
onLangChange: a,
|
|
517
517
|
value: p = "",
|
|
518
518
|
onChange: l,
|
|
@@ -526,7 +526,7 @@ const te = ct(
|
|
|
526
526
|
className: y,
|
|
527
527
|
style: f
|
|
528
528
|
}, S) {
|
|
529
|
-
const H = (c == null ? void 0 : c.zh) ?? "中文",
|
|
529
|
+
const H = (c == null ? void 0 : c.zh) ?? "中文", N = (c == null ? void 0 : c.en) ?? "EN", K = i === "bilingual", j = !!C, O = [
|
|
530
530
|
"bu-eib__box",
|
|
531
531
|
K && j && "bu-eib__box--actions-both",
|
|
532
532
|
K && !j && "bu-eib__box--actions-toggle",
|
|
@@ -534,7 +534,7 @@ const te = ct(
|
|
|
534
534
|
w && "bu-eib__box--error",
|
|
535
535
|
A && "bu-eib__box--disabled"
|
|
536
536
|
].filter(Boolean).join(" ");
|
|
537
|
-
return /* @__PURE__ */ t("div", { className: ["bu-eib", y].filter(Boolean).join(" "), style: f, children: /* @__PURE__ */
|
|
537
|
+
return /* @__PURE__ */ t("div", { className: ["bu-eib", y].filter(Boolean).join(" "), style: f, children: /* @__PURE__ */ n("div", { className: O, children: [
|
|
538
538
|
/* @__PURE__ */ t(
|
|
539
539
|
"input",
|
|
540
540
|
{
|
|
@@ -542,19 +542,19 @@ const te = ct(
|
|
|
542
542
|
id: g,
|
|
543
543
|
className: "bu-eib__field",
|
|
544
544
|
value: p,
|
|
545
|
-
onChange: (
|
|
545
|
+
onChange: (J) => l == null ? void 0 : l(J.target.value),
|
|
546
546
|
placeholder: s,
|
|
547
547
|
maxLength: h,
|
|
548
548
|
disabled: A
|
|
549
549
|
}
|
|
550
550
|
),
|
|
551
|
-
(K || j) && /* @__PURE__ */
|
|
552
|
-
K && /* @__PURE__ */
|
|
551
|
+
(K || j) && /* @__PURE__ */ n("div", { className: "bu-eib__actions", children: [
|
|
552
|
+
K && /* @__PURE__ */ n("div", { className: "bu-eib__lang-toggle", children: [
|
|
553
553
|
/* @__PURE__ */ t(
|
|
554
554
|
"button",
|
|
555
555
|
{
|
|
556
556
|
type: "button",
|
|
557
|
-
className: `bu-eib__lang-btn${
|
|
557
|
+
className: `bu-eib__lang-btn${r === "zh" ? " bu-eib__lang-btn--active" : ""}`,
|
|
558
558
|
onClick: () => a == null ? void 0 : a("zh"),
|
|
559
559
|
children: H
|
|
560
560
|
}
|
|
@@ -563,13 +563,13 @@ const te = ct(
|
|
|
563
563
|
"button",
|
|
564
564
|
{
|
|
565
565
|
type: "button",
|
|
566
|
-
className: `bu-eib__lang-btn${
|
|
566
|
+
className: `bu-eib__lang-btn${r === "en" ? " bu-eib__lang-btn--active" : ""}`,
|
|
567
567
|
onClick: () => a == null ? void 0 : a("en"),
|
|
568
|
-
children:
|
|
568
|
+
children: N
|
|
569
569
|
}
|
|
570
570
|
)
|
|
571
571
|
] }),
|
|
572
|
-
j && /* @__PURE__ */ t("button", { type: "button", className: "bu-eib__delete", onClick: C, children: /* @__PURE__ */ t(
|
|
572
|
+
j && /* @__PURE__ */ t("button", { type: "button", className: "bu-eib__delete", onClick: C, children: /* @__PURE__ */ t(Dt, {}) })
|
|
573
573
|
] })
|
|
574
574
|
] }) });
|
|
575
575
|
}
|
|
@@ -577,7 +577,7 @@ const te = ct(
|
|
|
577
577
|
function ee({
|
|
578
578
|
open: o = !1,
|
|
579
579
|
title: i = "标题",
|
|
580
|
-
mode:
|
|
580
|
+
mode: r = "standard",
|
|
581
581
|
children: a,
|
|
582
582
|
okText: p = "确认",
|
|
583
583
|
cancelText: l = "取消",
|
|
@@ -593,26 +593,26 @@ function ee({
|
|
|
593
593
|
className: S,
|
|
594
594
|
style: H
|
|
595
595
|
}) {
|
|
596
|
-
const
|
|
596
|
+
const N = (c == null ? void 0 : c.zh) ?? "中文", K = (c == null ? void 0 : c.en) ?? "EN";
|
|
597
597
|
if (!o) return null;
|
|
598
|
-
const j =
|
|
599
|
-
return /* @__PURE__ */ t("div", { className: ["bu-modal__overlay", S].filter(Boolean).join(" "), onClick: w, children: /* @__PURE__ */
|
|
598
|
+
const j = r === "bilingual", O = r === "single", J = f != null ? { width: f, ...H } : H;
|
|
599
|
+
return /* @__PURE__ */ t("div", { className: ["bu-modal__overlay", S].filter(Boolean).join(" "), onClick: w, children: /* @__PURE__ */ n(
|
|
600
600
|
"div",
|
|
601
601
|
{
|
|
602
602
|
className: "bu-modal__container",
|
|
603
|
-
style:
|
|
603
|
+
style: J,
|
|
604
604
|
onClick: (G) => G.stopPropagation(),
|
|
605
605
|
children: [
|
|
606
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ n("div", { className: "bu-modal__header", children: [
|
|
607
607
|
/* @__PURE__ */ t("p", { className: "bu-modal__title", children: i }),
|
|
608
|
-
j && /* @__PURE__ */
|
|
608
|
+
j && /* @__PURE__ */ n("div", { className: "bu-modal__lang-toggle", children: [
|
|
609
609
|
/* @__PURE__ */ t(
|
|
610
610
|
"button",
|
|
611
611
|
{
|
|
612
612
|
type: "button",
|
|
613
613
|
className: `bu-modal__lang-btn${A === "zh" ? " bu-modal__lang-btn--active" : ""}`,
|
|
614
614
|
onClick: () => C == null ? void 0 : C("zh"),
|
|
615
|
-
children:
|
|
615
|
+
children: N
|
|
616
616
|
}
|
|
617
617
|
),
|
|
618
618
|
/* @__PURE__ */ t(
|
|
@@ -628,11 +628,11 @@ function ee({
|
|
|
628
628
|
/* @__PURE__ */ t("button", { type: "button", className: "bu-modal__close", onClick: w, children: /* @__PURE__ */ t("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M16.5613 6.73027C16.7558 6.53571 17.0723 6.53442 17.2684 6.72736C17.4644 6.92032 17.4657 7.23444 17.2713 7.42901L12.7036 12.0002L17.2713 16.5714C17.4657 16.766 17.4644 17.0801 17.2684 17.273C17.0723 17.4659 16.7558 17.4646 16.5613 17.2701L11.9996 12.7047L7.43794 17.2701C7.24352 17.4647 6.92699 17.4659 6.73091 17.273C6.53485 17.0801 6.53355 16.7659 6.72798 16.5714L11.2955 12.0002L6.72798 7.42901C6.53355 7.23442 6.53485 6.92032 6.73091 6.72736C6.92698 6.53442 7.2435 6.53571 7.43794 6.73027L11.9996 11.2955L16.5613 6.73027Z", fill: "currentColor" }) }) })
|
|
629
629
|
] }),
|
|
630
630
|
/* @__PURE__ */ t("div", { className: "bu-modal__body", children: a }),
|
|
631
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ n("div", { className: "bu-modal__footer", children: [
|
|
632
632
|
g && /* @__PURE__ */ t("p", { className: "bu-modal__hint", children: g }),
|
|
633
|
-
/* @__PURE__ */
|
|
634
|
-
!
|
|
635
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ n("div", { className: "bu-modal__btn-row", children: [
|
|
634
|
+
!O && /* @__PURE__ */ t("button", { type: "button", className: "bu-modal__btn-cancel", onClick: h ?? w, children: l }),
|
|
635
|
+
/* @__PURE__ */ n(
|
|
636
636
|
"button",
|
|
637
637
|
{
|
|
638
638
|
type: "button",
|
|
@@ -651,14 +651,14 @@ function ee({
|
|
|
651
651
|
}
|
|
652
652
|
) });
|
|
653
653
|
}
|
|
654
|
-
const
|
|
654
|
+
const xt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAABsdJREFUeAHtXF1oU1cc/9/kNk1LliX9SGvb1DSiJaUgbVEmE+ab7mEvPkntsHsShTLGQJAqIsKwQ9iKguDDthcZ4otPuifJGCsyGIKlo1unDf1urGmpGtskvdnvf5J0aWl1896cajw/uNybcz/OPb/z+3+cc+8NkYKCgoKCgoKCgoKCgsJbBo3eLeTam+7u7nZWVVW1HTp0aF80Gm1Np9MOTdPiFRUVf969e/fXwcHB+3fu3FnOOy/9sgsWO7idNiwrvb29H5w8efJKWVlZ+9LSkjYzM0O6rq8emEqlqLa2lkpLS2l+fn7wwYMHPYcPH/45e36a1hH5LhDIDTdOnz5d3dPTc99ms9VPTk4aUJvtFecJotxut4Zl8tq1a/vOnDkzjiI7lpXcQcVOoCBvZGTkYHV19U9Yr9jtdi77X+1eAYLBoH12dvZIS0vLDcojsZgJFH4rEol87HA4bk9PT6egOp1eE4ZhpOrq6vRYLPZZa2vrD7nrv0rGbzVOnDjh93q9t6empkyRx4Dp69wJ9fX131++fLmJsuIrVgUKdYC4P7A0o/GWCYXNGUp8AiJruJ6iVWBfX18I/i4E7iwVCftQLL6LFy/u5t/FSmAaTr8b6uPtNQTClFlFa34nk0lCSiMW5IOr+/g37+Nj8i8BU6adO3d+zvUUyoQ3TTxlARH33vPnz/fC+a9pI+d5lZWVhGAg8r/l5WUKNDXRey4XQVo0+ugRvXjxQhwbCoXo6dOnNDo6SghE+ZfhDhr0eDy7TTnWTSBSh1OnTr3X1dUVWFhYKEGPGyQRSFlmQFT1evJYSUwgGi8IYSWx4jhpLi8vz9w83CUrr729XZQj4RZkx+PxfCVqaNP7vGE1gYI89OCnqGw/yItv27bNsNCH/7ebsNkWxsfHHUxOvvmx2pCCiO2GhgZCXicIhU9bPYaPZ2UuLi6Sz+cTZevIE9tzc3OPedtqAg0MjT6B7DvgOyYp01MkGyBwuaSkZDiRSDTkNxxlhFGIII3LWWG8jsBEec0djXPEccgfhfJy5pwPPhZDvLCoiyzEuXPnbDU1NQdBXoy2MEWC6Za5XK5fsp236ou54awmJonVmAsQTCiX5QcRJpGPXa9ibBuNjY1069atfv5pqQIhay9uhu96U/IKbc4gT6xhhjH4r79B0o715rcRNirfqIw7BW28d/369QlRD1kI9OBLIy9zF48vUcooUP6Ei7rLnbi+wY3EbFXVFfjCb6Amvi/TFoHOWEFwsXd2dn5EWX9fiCi8IVgXjyJRUW2hNMjim8E62OhjpTNpLgSxrzDf12tS+WmQZ7S1tdnPnj274+bNmynKNImkEKjrNopMzJHusGWrLQxyHE3NxKixwccqhCXrj9msTRDId6x1dHSkLly4EMAIZDJ/pxQCuQGJREoQKQOJVEYg8GErcCtteb4MMSGtcQ4IReXczUamLfbhPK25udk2NDR0Ax1xhP41nlVXVaRDuUyzoLpFRNK9rD52/oi82vbt26cGBga+RSQd8/v9/FvMQPN+XgcCAcI+ramp6fHExMTXx44d8+zZs4fJ42SR1bjGz0vzgVsFpCceKG4EEfl3Jg8B5UsuP378+BcHDhxwwkfuQMJcd/ToUe+lS5eeIOhEMWk6ev78+WfZS+REtmFCW9QEwkwrMfXUBwUa8IduFPkwR+i9evXqPO8Ph8NLWA3x0t/fv9llXuq1i5pAJg6m6cmNhrKR2do6SMEUFIEmoQg0CUWgSSgCTaJICZQ3AS6FQB4J6Fhk9RYe4ZIsyBkLY/6q1ldBkakoOQo8Hk6groCYSJCjQjkEYnE6bbQrUEuxxWcglKzXfnbGxeN2Eb9sZUiyYnnzgdkGVXncVEjwzI8h8Rmg9KGcYUh9wllwqDTGJKQpMDMhLKe/ZKpcEoGZ561LCaPgFMIDkhMzzrJmv+U8E0Fb/hqL4pmIXvgcF3Wl0FEtu+qkpDJSCOTHjA11VeKRJhX6NQ/U5axwFFceyCh3OsiFZ7ZyYBRfHsgothSGoaKwSagobBIqCpuEisImoaKwSagobBJqMsEkFIEmoQg0CUWgSSgCTUIRaBKKQJN45wjEmNzSD4AsJdDtdq/5XPRNQzKZtDkcDktv0GoCF+x2u4YRxxvHIjrWKC0tTede77UKln/PNjw8/KHf7++KxWLTVn8t/rpg8rxeb/3s7Ox3wWDwN7IQVjdQfP708OHD/bjRzlQqleTXLbZqDJz9vEErKSnR0LE/hkKhAbL4Y/BCKESQyF9ujo2NVfJ/DOi6viUmjQ7UuG6QFwuHw/xGzpZ/Sa+goKCgoKCgoKCgAPwDQUTojmlZbmUAAAAASUVORK5CYII=", pt = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1868%2013.4098C17.3821%2013.6051%2017.3821%2013.9216%2017.1868%2014.1169C16.9915%2014.3121%2016.675%2014.3121%2016.4798%2014.1169L11.8362%209.47332L7.27307%2014.1139C7.07945%2014.3108%206.76292%2014.3134%206.56604%2014.1198C6.36918%2013.9262%206.36658%2013.6097%206.56018%2013.4128L11.2412%208.65252C11.5658%208.32242%2012.0972%208.32011%2012.4246%208.64748L17.1868%2013.4098Z'%20fill='%23333333'/%3e%3cpath%20d='M17.1868%2013.4098C17.3821%2013.6051%2017.3821%2013.9216%2017.1868%2014.1169C16.9915%2014.3121%2016.675%2014.3121%2016.4798%2014.1169L11.8362%209.47332L7.27307%2014.1139C7.07945%2014.3108%206.76292%2014.3134%206.56604%2014.1198C6.36918%2013.9262%206.36658%2013.6097%206.56018%2013.4128L11.2412%208.65252C11.5658%208.32242%2012.0972%208.32011%2012.4246%208.64748L17.1868%2013.4098Z'%20fill='black'%20fill-opacity='0.2'/%3e%3c/svg%3e", Jt = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.3576%2017.528C10.3576%2017.7887%2010.1444%2018%209.88136%2018C9.61835%2018%209.40513%2017.7887%209.40513%2017.528V7.58313L6.67551%2010.8295C6.50712%2011.0297%206.20676%2011.0568%206.00473%2010.8899C5.80272%2010.723%205.77545%2010.4254%205.9438%2010.2251L9.23476%206.31136C9.61494%205.85923%2010.3575%206.12565%2010.3576%206.71418V17.528ZM17.9981%2013.1613C18.1989%2013.3296%2018.2239%2013.6275%2018.0541%2013.8265L14.683%2017.7758C14.3009%2018.2233%2013.5632%2017.9556%2013.5632%2017.3694V6.47196C13.5632%206.21131%2013.7765%206.00001%2014.0395%206C14.3025%206%2014.5157%206.2113%2014.5157%206.47196V16.5101L17.327%2013.2169C17.4969%2013.0179%2017.7973%2012.993%2017.9981%2013.1613Z'%20fill='%23333333'/%3e%3cpath%20d='M10.3576%2017.528C10.3576%2017.7887%2010.1444%2018%209.88136%2018C9.61835%2018%209.40513%2017.7887%209.40513%2017.528V7.58313L6.67551%2010.8295C6.50712%2011.0297%206.20676%2011.0568%206.00473%2010.8899C5.80272%2010.723%205.77545%2010.4254%205.9438%2010.2251L9.23476%206.31136C9.61494%205.85923%2010.3575%206.12565%2010.3576%206.71418V17.528ZM17.9981%2013.1613C18.1989%2013.3296%2018.2239%2013.6275%2018.0541%2013.8265L14.683%2017.7758C14.3009%2018.2233%2013.5632%2017.9556%2013.5632%2017.3694V6.47196C13.5632%206.21131%2013.7765%206.00001%2014.0395%206C14.3025%206%2014.5157%206.2113%2014.5157%206.47196V16.5101L17.327%2013.2169C17.4969%2013.0179%2017.7973%2012.993%2017.9981%2013.1613Z'%20fill='black'%20fill-opacity='0.2'/%3e%3c/svg%3e", St = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.38154%204.67725C11.9512%204.67725%2014.0343%206.76037%2014.0343%209.33002C14.0343%2010.5162%2013.5901%2011.5984%2012.8595%2012.4202L15.1454%2014.6078C15.3102%2014.7684%2015.3136%2015.0322%2015.153%2015.197C14.9924%2015.3618%2014.7286%2015.3652%2014.5638%2015.2046L12.2521%2012.9919C11.4614%2013.6126%2010.4647%2013.9828%209.38154%2013.9828C6.81188%2013.9828%204.72876%2011.8997%204.72876%209.33002C4.72876%206.76037%206.81188%204.67725%209.38154%204.67725ZM9.38154%205.51058C7.27212%205.51058%205.56209%207.2206%205.56209%209.33002C5.56209%2011.4394%207.27212%2013.1495%209.38154%2013.1495C11.491%2013.1495%2013.201%2011.4394%2013.201%209.33002C13.201%207.2206%2011.491%205.51058%209.38154%205.51058Z'%20fill='%23666666'/%3e%3c/svg%3e", Ot = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%200.5H12C13.933%200.5%2015.5%202.067%2015.5%204V12C15.5%2013.933%2013.933%2015.5%2012%2015.5H4C2.067%2015.5%200.5%2013.933%200.5%2012V4C0.5%202.067%202.067%200.5%204%200.5Z'%20fill='white'%20fill-opacity='0.2'%20stroke='%23DBDBDB'/%3e%3c/svg%3e", Nt = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%204C0%201.79086%201.79086%200%204%200H12C14.2091%200%2016%201.79086%2016%204V12C16%2014.2091%2014.2091%2016%2012%2016H4C1.79086%2016%200%2014.2091%200%2012V4Z'%20fill='white'%20fill-opacity='0.2'/%3e%3cpath%20d='M4%200.5H12C13.933%200.5%2015.5%202.067%2015.5%204V12C15.5%2013.933%2013.933%2015.5%2012%2015.5H4C2.067%2015.5%200.5%2013.933%200.5%2012V4C0.5%202.067%202.067%200.5%204%200.5Z'%20stroke='%23DBDBDB'/%3e%3cpath%20d='M11.2976%204.51378C11.4%204.3608%2011.607%204.31982%2011.76%204.4222C11.913%204.52459%2011.954%204.73167%2011.8516%204.88466L7.46663%2011.437C7.30081%2011.6847%206.94289%2011.7021%206.75374%2011.4717L4.1677%208.32097C4.05092%208.17866%204.07163%207.96857%204.21392%207.85178C4.35622%207.73501%204.56632%207.75571%204.6831%207.89801L7.07905%2010.8173L11.2976%204.51378Z'%20fill='%23333333'/%3e%3c/svg%3e";
|
|
655
655
|
function dt({ size: o = 20 }) {
|
|
656
656
|
return /* @__PURE__ */ t("svg", { width: o, height: o, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M16.5613 6.73027C16.7558 6.53571 17.0723 6.53442 17.2684 6.72736C17.4644 6.92032 17.4657 7.23444 17.2713 7.42901L12.7036 12.0002L17.2713 16.5714C17.4657 16.766 17.4644 17.0801 17.2684 17.273C17.0723 17.4659 16.7558 17.4646 16.5613 17.2701L11.9996 12.7047L7.43794 17.2701C7.24352 17.4647 6.92699 17.4659 6.73091 17.273C6.53485 17.0801 6.53355 16.7659 6.72798 16.5714L11.2955 12.0002L6.72798 7.42901C6.53355 7.23442 6.53485 6.92032 6.73091 6.72736C6.92698 6.53442 7.2435 6.53571 7.43794 6.73027L11.9996 11.2955L16.5613 6.73027Z", fill: "currentColor" }) });
|
|
657
657
|
}
|
|
658
658
|
function ie({
|
|
659
659
|
options: o = [],
|
|
660
660
|
value: i = [],
|
|
661
|
-
onChange:
|
|
661
|
+
onChange: r,
|
|
662
662
|
placeholder: a = "请选择",
|
|
663
663
|
emptyText: p = "暂无产品数据",
|
|
664
664
|
onManageField: l,
|
|
@@ -672,7 +672,7 @@ function ie({
|
|
|
672
672
|
style: y,
|
|
673
673
|
getPopupContainer: f
|
|
674
674
|
}) {
|
|
675
|
-
const S = (c == null ? void 0 : c.searchPlaceholder) ?? "搜索", H = (c == null ? void 0 : c.sortDefault) ?? "默认顺序",
|
|
675
|
+
const S = (c == null ? void 0 : c.searchPlaceholder) ?? "搜索", H = (c == null ? void 0 : c.sortDefault) ?? "默认顺序", N = (c == null ? void 0 : c.sortAsc) ?? "名称A-Z", K = (c == null ? void 0 : c.sortDesc) ?? "名称Z-A", j = (c == null ? void 0 : c.noMatchText) ?? "暂无选项", O = (c == null ? void 0 : c.manageFieldPre) ?? "请前往", J = (c == null ? void 0 : c.manageFieldLink) ?? "管理字段", G = (c == null ? void 0 : c.manageFieldPost) ?? "添加", [k, T] = x(!1), [E, I] = x(""), [m, L] = x("none"), [b, d] = x(!1), R = Y(null), z = Y(null), P = Y(null), [q, X] = x({ top: 0, left: 0, width: 0 }), Q = ot(() => {
|
|
676
676
|
if (!R.current) return;
|
|
677
677
|
const e = R.current.getBoundingClientRect();
|
|
678
678
|
X({
|
|
@@ -682,18 +682,18 @@ function ie({
|
|
|
682
682
|
});
|
|
683
683
|
}, []);
|
|
684
684
|
st(() => {
|
|
685
|
-
|
|
686
|
-
}, [
|
|
687
|
-
if (!
|
|
685
|
+
k && Q();
|
|
686
|
+
}, [k, Q]), et(() => {
|
|
687
|
+
if (!k) return;
|
|
688
688
|
const e = (v) => {
|
|
689
689
|
var U, W;
|
|
690
690
|
const M = v.target;
|
|
691
691
|
(U = P.current) != null && U.contains(M) || (W = R.current) != null && W.contains(M) || $();
|
|
692
692
|
};
|
|
693
|
-
return document.addEventListener("mousedown", e), window.addEventListener("scroll",
|
|
694
|
-
document.removeEventListener("mousedown", e), window.removeEventListener("scroll",
|
|
693
|
+
return document.addEventListener("mousedown", e), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), () => {
|
|
694
|
+
document.removeEventListener("mousedown", e), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
|
|
695
695
|
};
|
|
696
|
-
}, [
|
|
696
|
+
}, [k, Q]), et(() => {
|
|
697
697
|
if (!b) return;
|
|
698
698
|
const e = (v) => {
|
|
699
699
|
z.current && !z.current.contains(v.target) && d(!1);
|
|
@@ -718,35 +718,35 @@ function ie({
|
|
|
718
718
|
}), []);
|
|
719
719
|
function it(e) {
|
|
720
720
|
if (!s) {
|
|
721
|
-
|
|
721
|
+
r == null || r(i.includes(e) ? [] : [e]), i.includes(e) || $();
|
|
722
722
|
return;
|
|
723
723
|
}
|
|
724
724
|
const v = i.includes(e) ? i.filter((M) => M !== e) : [...i, e];
|
|
725
|
-
|
|
725
|
+
r == null || r(v);
|
|
726
726
|
}
|
|
727
727
|
function V(e) {
|
|
728
|
-
|
|
728
|
+
r == null || r(i.filter((v) => v !== e));
|
|
729
729
|
}
|
|
730
730
|
function $() {
|
|
731
|
-
T(!1), I(""),
|
|
731
|
+
T(!1), I(""), L("none");
|
|
732
732
|
}
|
|
733
733
|
function nt(e) {
|
|
734
|
-
|
|
734
|
+
L(e), d(!1);
|
|
735
735
|
}
|
|
736
736
|
const u = Ct(() => {
|
|
737
737
|
let e = o.filter((M) => (M.searchText ?? (typeof M.label == "string" ? M.label : "")).toLowerCase().includes(E.toLowerCase()));
|
|
738
738
|
const v = (M) => M.searchText ?? (typeof M.label == "string" ? M.label : "");
|
|
739
739
|
return m === "asc" && (e = [...e].sort((M, U) => v(M).localeCompare(v(U)))), m === "desc" && (e = [...e].sort((M, U) => v(U).localeCompare(v(M)))), e;
|
|
740
|
-
}, [o, E, m]),
|
|
741
|
-
return /* @__PURE__ */
|
|
742
|
-
!
|
|
743
|
-
|
|
740
|
+
}, [o, E, m]), D = o.filter((e) => i.includes(e.value)), B = o.length > 0;
|
|
741
|
+
return /* @__PURE__ */ n("div", { ref: R, className: ["bu-pf", g].filter(Boolean).join(" "), style: y, children: [
|
|
742
|
+
!k && /* @__PURE__ */ n("div", { className: `bu-pf__trigger${D.length > 0 ? " bu-pf__trigger--selected" : ""}`, onClick: () => T(!0), children: [
|
|
743
|
+
D.length > 0 ? /* @__PURE__ */ t(
|
|
744
744
|
"div",
|
|
745
745
|
{
|
|
746
746
|
className: "bu-pf__trigger-tags",
|
|
747
747
|
ref: F,
|
|
748
748
|
..._(F),
|
|
749
|
-
children:
|
|
749
|
+
children: D.map((e) => /* @__PURE__ */ n("span", { className: `bu-pf__tag${s ? "" : " bu-pf__tag--single"}`, children: [
|
|
750
750
|
/* @__PURE__ */ t("span", { className: "bu-pf__tag-text", children: e.label }),
|
|
751
751
|
/* @__PURE__ */ t(
|
|
752
752
|
"button",
|
|
@@ -764,15 +764,15 @@ function ie({
|
|
|
764
764
|
) : /* @__PURE__ */ t("span", { className: "bu-pf__placeholder", children: a }),
|
|
765
765
|
/* @__PURE__ */ t("span", { className: "bu-pf__arrow", children: /* @__PURE__ */ t("img", { src: pt, width: 24, height: 24, alt: "" }) })
|
|
766
766
|
] }),
|
|
767
|
-
|
|
768
|
-
/* @__PURE__ */ t("div", { className: "bu-pf__panel", children: /* @__PURE__ */
|
|
767
|
+
k && /* @__PURE__ */ n(rt, { children: [
|
|
768
|
+
/* @__PURE__ */ t("div", { className: "bu-pf__panel", children: /* @__PURE__ */ n("div", { className: "bu-pf__header", children: [
|
|
769
769
|
/* @__PURE__ */ t(
|
|
770
770
|
"div",
|
|
771
771
|
{
|
|
772
772
|
className: "bu-pf__tags",
|
|
773
773
|
ref: tt,
|
|
774
774
|
..._(tt),
|
|
775
|
-
children:
|
|
775
|
+
children: D.length > 0 ? D.map((e) => /* @__PURE__ */ n("span", { className: `bu-pf__tag${s ? "" : " bu-pf__tag--single"}`, children: [
|
|
776
776
|
/* @__PURE__ */ t("span", { className: "bu-pf__tag-text", children: e.label }),
|
|
777
777
|
/* @__PURE__ */ t(
|
|
778
778
|
"button",
|
|
@@ -789,9 +789,9 @@ function ie({
|
|
|
789
789
|
/* @__PURE__ */ t("button", { type: "button", className: "bu-pf__close", onClick: $, children: /* @__PURE__ */ t("img", { src: pt, width: 24, height: 24, alt: "" }) })
|
|
790
790
|
] }) }),
|
|
791
791
|
lt(
|
|
792
|
-
/* @__PURE__ */ t("div", { ref: P, className: "bu-pf__portal", style: { position: "fixed", top: q.top, left: q.left, width: q.width, zIndex: 1050 }, children: /* @__PURE__ */
|
|
793
|
-
(h || w) && /* @__PURE__ */
|
|
794
|
-
h && /* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ t("div", { ref: P, className: "bu-pf__portal", style: { position: "fixed", top: q.top, left: q.left, width: q.width, zIndex: 1050 }, children: /* @__PURE__ */ n("div", { className: "bu-pf__dropdown", children: [
|
|
793
|
+
(h || w) && /* @__PURE__ */ n("div", { className: "bu-pf__toolbar", children: [
|
|
794
|
+
h && /* @__PURE__ */ n("div", { className: "bu-pf__search", children: [
|
|
795
795
|
/* @__PURE__ */ t("span", { className: "bu-pf__search-icon", children: /* @__PURE__ */ t("img", { src: St, width: 20, height: 20, alt: "" }) }),
|
|
796
796
|
/* @__PURE__ */ t(
|
|
797
797
|
"input",
|
|
@@ -803,19 +803,19 @@ function ie({
|
|
|
803
803
|
}
|
|
804
804
|
)
|
|
805
805
|
] }),
|
|
806
|
-
w && /* @__PURE__ */
|
|
806
|
+
w && /* @__PURE__ */ n("div", { ref: z, className: "bu-pf__sort-wrap", children: [
|
|
807
807
|
/* @__PURE__ */ t(
|
|
808
808
|
"button",
|
|
809
809
|
{
|
|
810
810
|
type: "button",
|
|
811
811
|
className: `bu-pf__sort-btn${m !== "none" ? " bu-pf__sort-btn--active" : ""}`,
|
|
812
812
|
onClick: () => d((e) => !e),
|
|
813
|
-
children: /* @__PURE__ */ t("img", { src:
|
|
813
|
+
children: /* @__PURE__ */ t("img", { src: Jt, width: 24, height: 24, alt: "" })
|
|
814
814
|
}
|
|
815
815
|
),
|
|
816
816
|
b && /* @__PURE__ */ t("div", { className: "bu-pf__sort-dropdown", children: [
|
|
817
817
|
{ key: "none", label: H },
|
|
818
|
-
{ key: "asc", label:
|
|
818
|
+
{ key: "asc", label: N },
|
|
819
819
|
{ key: "desc", label: K }
|
|
820
820
|
].map(({ key: e, label: v }) => /* @__PURE__ */ t(
|
|
821
821
|
"div",
|
|
@@ -830,7 +830,7 @@ function ie({
|
|
|
830
830
|
] }),
|
|
831
831
|
/* @__PURE__ */ t("div", { className: "bu-pf__list", children: B && u.length > 0 ? u.map((e) => {
|
|
832
832
|
const v = i.includes(e.value);
|
|
833
|
-
return /* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ n(
|
|
834
834
|
"div",
|
|
835
835
|
{
|
|
836
836
|
className: `bu-pf__option${s ? " bu-pf__option--multiple" : ""}${v && !s ? " bu-pf__option--selected" : ""}`,
|
|
@@ -840,7 +840,7 @@ function ie({
|
|
|
840
840
|
"img",
|
|
841
841
|
{
|
|
842
842
|
className: "bu-pf__checkbox-img",
|
|
843
|
-
src: v ?
|
|
843
|
+
src: v ? Nt : Ot,
|
|
844
844
|
alt: ""
|
|
845
845
|
}
|
|
846
846
|
),
|
|
@@ -849,12 +849,12 @@ function ie({
|
|
|
849
849
|
},
|
|
850
850
|
e.value
|
|
851
851
|
);
|
|
852
|
-
}) : /* @__PURE__ */
|
|
853
|
-
/* @__PURE__ */ t("img", { className: "bu-pf__no-match-img", src:
|
|
852
|
+
}) : /* @__PURE__ */ n("div", { className: "bu-pf__no-match", children: [
|
|
853
|
+
/* @__PURE__ */ t("img", { className: "bu-pf__no-match-img", src: xt, alt: B ? j : p }),
|
|
854
854
|
/* @__PURE__ */ t("p", { className: "bu-pf__no-match-text", children: B ? j : p }),
|
|
855
|
-
/* @__PURE__ */
|
|
856
|
-
|
|
857
|
-
/* @__PURE__ */ t("button", { type: "button", className: "bu-pf__manage-btn", onClick: l, children:
|
|
855
|
+
/* @__PURE__ */ n("p", { className: "bu-pf__no-match-hint", children: [
|
|
856
|
+
O,
|
|
857
|
+
/* @__PURE__ */ t("button", { type: "button", className: "bu-pf__manage-btn", onClick: l, children: J }),
|
|
858
858
|
G
|
|
859
859
|
] })
|
|
860
860
|
] }) }),
|
|
@@ -868,17 +868,17 @@ function ie({
|
|
|
868
868
|
function ht({
|
|
869
869
|
text: o,
|
|
870
870
|
spanClassName: i,
|
|
871
|
-
wrapperStyle:
|
|
871
|
+
wrapperStyle: r,
|
|
872
872
|
placement: a = "top",
|
|
873
873
|
getPopupContainer: p
|
|
874
874
|
}) {
|
|
875
|
-
const [l, s] =
|
|
875
|
+
const [l, s] = x(!1), h = Y(null), w = Y(null), [A, C] = x(null);
|
|
876
876
|
function c() {
|
|
877
877
|
var y;
|
|
878
878
|
const g = w.current;
|
|
879
879
|
g && g.scrollWidth > g.offsetWidth && (C(((y = h.current) == null ? void 0 : y.getBoundingClientRect()) ?? null), s(!0));
|
|
880
880
|
}
|
|
881
|
-
return /* @__PURE__ */
|
|
881
|
+
return /* @__PURE__ */ n(gt, { ref: h, style: r, children: [
|
|
882
882
|
/* @__PURE__ */ t(
|
|
883
883
|
"span",
|
|
884
884
|
{
|
|
@@ -911,38 +911,38 @@ function ht({
|
|
|
911
911
|
] });
|
|
912
912
|
}
|
|
913
913
|
function Rt() {
|
|
914
|
-
return /* @__PURE__ */ t("svg", { width: "
|
|
914
|
+
return /* @__PURE__ */ t("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M5.57345 8.828C5.41074 8.66528 5.41074 8.40152 5.57345 8.2388C5.73617 8.07608 5.99993 8.07608 6.16265 8.2388L10.0323 12.1084L13.8349 8.24124C13.9963 8.0772 14.26 8.07503 14.4241 8.23636C14.5881 8.39771 14.5903 8.66149 14.429 8.82555L10.5282 12.7924C10.2576 13.0675 9.81477 13.0694 9.54196 12.7966L5.57345 8.828Z", fill: "#333333" }) });
|
|
915
915
|
}
|
|
916
916
|
function Ht() {
|
|
917
917
|
return /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M6 3.5L10.5 8L6 12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
918
918
|
}
|
|
919
919
|
function Gt(o, i) {
|
|
920
920
|
var p;
|
|
921
|
-
const
|
|
921
|
+
const r = [o];
|
|
922
922
|
let a = o;
|
|
923
923
|
for (let l = 0; l < i.length; l++) {
|
|
924
924
|
const s = a.find((h) => h.value === i[l]);
|
|
925
925
|
if ((p = s == null ? void 0 : s.children) != null && p.length)
|
|
926
|
-
|
|
926
|
+
r.push(s.children), a = s.children;
|
|
927
927
|
else
|
|
928
928
|
break;
|
|
929
929
|
}
|
|
930
|
-
return
|
|
930
|
+
return r;
|
|
931
931
|
}
|
|
932
932
|
function At(o, i) {
|
|
933
|
-
const
|
|
933
|
+
const r = [];
|
|
934
934
|
let a = o;
|
|
935
935
|
for (const p of i) {
|
|
936
936
|
const l = a.find((s) => s.value === p);
|
|
937
937
|
if (!l) break;
|
|
938
|
-
|
|
938
|
+
r.push(l), a = l.children ?? [];
|
|
939
939
|
}
|
|
940
|
-
return
|
|
940
|
+
return r;
|
|
941
941
|
}
|
|
942
942
|
function ne({
|
|
943
943
|
data: o,
|
|
944
944
|
value: i = [],
|
|
945
|
-
onChange:
|
|
945
|
+
onChange: r,
|
|
946
946
|
placeholder: a = "请选择分类",
|
|
947
947
|
disabled: p = !1,
|
|
948
948
|
maxVisible: l = 6,
|
|
@@ -950,13 +950,13 @@ function ne({
|
|
|
950
950
|
style: h,
|
|
951
951
|
getPopupContainer: w
|
|
952
952
|
}) {
|
|
953
|
-
const [A, C] =
|
|
953
|
+
const [A, C] = x(!1), [c, g] = x(i), y = Y(null), f = Y(null), [S, H] = x({}), N = ot(() => {
|
|
954
954
|
if (!y.current) return;
|
|
955
955
|
const E = y.current.getBoundingClientRect();
|
|
956
956
|
let I = 0, m = y.current.parentElement;
|
|
957
957
|
for (; m && m !== document.documentElement; ) {
|
|
958
|
-
const
|
|
959
|
-
if (!isNaN(
|
|
958
|
+
const L = parseInt(window.getComputedStyle(m).zIndex, 10);
|
|
959
|
+
if (!isNaN(L) && L > I && (I = L), m.parentElement)
|
|
960
960
|
for (const b of m.parentElement.children) {
|
|
961
961
|
if (b === m || !(b instanceof HTMLElement)) continue;
|
|
962
962
|
const d = parseInt(window.getComputedStyle(b).zIndex, 10);
|
|
@@ -972,32 +972,32 @@ function ne({
|
|
|
972
972
|
});
|
|
973
973
|
}, []);
|
|
974
974
|
st(() => {
|
|
975
|
-
A &&
|
|
976
|
-
}, [A, c,
|
|
975
|
+
A && N();
|
|
976
|
+
}, [A, c, N]), et(() => {
|
|
977
977
|
if (!A) return;
|
|
978
978
|
function E(m) {
|
|
979
979
|
var b, d;
|
|
980
|
-
const
|
|
981
|
-
(b = y.current) != null && b.contains(
|
|
980
|
+
const L = m.target;
|
|
981
|
+
(b = y.current) != null && b.contains(L) || (d = f.current) != null && d.contains(L) || C(!1);
|
|
982
982
|
}
|
|
983
983
|
function I() {
|
|
984
984
|
C(!1);
|
|
985
985
|
}
|
|
986
|
-
return document.addEventListener("mousedown", E), document.addEventListener("scroll", I, !0), window.addEventListener("resize",
|
|
987
|
-
document.removeEventListener("mousedown", E), document.removeEventListener("scroll", I, !0), window.removeEventListener("resize",
|
|
986
|
+
return document.addEventListener("mousedown", E), document.addEventListener("scroll", I, !0), window.addEventListener("resize", N), () => {
|
|
987
|
+
document.removeEventListener("mousedown", E), document.removeEventListener("scroll", I, !0), window.removeEventListener("resize", N);
|
|
988
988
|
};
|
|
989
|
-
}, [A,
|
|
990
|
-
const K = At(o, i), j = K.length > 0,
|
|
989
|
+
}, [A, N]);
|
|
990
|
+
const K = At(o, i), j = K.length > 0, O = j ? K.map((E) => E.label).join(" / ") : null, J = Gt(o, c);
|
|
991
991
|
function G(E, I) {
|
|
992
|
-
var
|
|
992
|
+
var L;
|
|
993
993
|
if (I.disabled) return;
|
|
994
994
|
const m = c.slice(0, E + 1);
|
|
995
|
-
if (m[E] = I.value, g(m), !((
|
|
995
|
+
if (m[E] = I.value, g(m), !((L = I.children) != null && L.length)) {
|
|
996
996
|
const b = At(o, m);
|
|
997
|
-
|
|
997
|
+
r == null || r(m, b), C(!1);
|
|
998
998
|
}
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function k() {
|
|
1001
1001
|
g(i), C(!0);
|
|
1002
1002
|
}
|
|
1003
1003
|
const T = [
|
|
@@ -1005,25 +1005,25 @@ function ne({
|
|
|
1005
1005
|
A ? "bu-category-dropdown__trigger--open" : "",
|
|
1006
1006
|
j ? "bu-category-dropdown__trigger--has-value" : ""
|
|
1007
1007
|
].filter(Boolean).join(" ");
|
|
1008
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ n(
|
|
1009
1009
|
"div",
|
|
1010
1010
|
{
|
|
1011
1011
|
ref: y,
|
|
1012
1012
|
className: `bu-category-dropdown${s ? ` ${s}` : ""}`,
|
|
1013
1013
|
style: h,
|
|
1014
1014
|
children: [
|
|
1015
|
-
/* @__PURE__ */
|
|
1015
|
+
/* @__PURE__ */ n(
|
|
1016
1016
|
"button",
|
|
1017
1017
|
{
|
|
1018
1018
|
type: "button",
|
|
1019
1019
|
className: T,
|
|
1020
1020
|
disabled: p,
|
|
1021
|
-
onClick: () => A ? C(!1) :
|
|
1021
|
+
onClick: () => A ? C(!1) : k(),
|
|
1022
1022
|
children: [
|
|
1023
1023
|
/* @__PURE__ */ t(
|
|
1024
1024
|
ht,
|
|
1025
1025
|
{
|
|
1026
|
-
text:
|
|
1026
|
+
text: O ?? a,
|
|
1027
1027
|
spanClassName: `bu-category-dropdown__trigger-label${j ? "" : " bu-category-dropdown__trigger-label--placeholder"}`,
|
|
1028
1028
|
wrapperStyle: { flex: 1, minWidth: 0, display: "block" },
|
|
1029
1029
|
getPopupContainer: w
|
|
@@ -1034,14 +1034,14 @@ function ne({
|
|
|
1034
1034
|
}
|
|
1035
1035
|
),
|
|
1036
1036
|
A && lt(
|
|
1037
|
-
/* @__PURE__ */ t("div", { ref: f, style: S, className: "bu-category-dropdown__portal", children: /* @__PURE__ */ t("div", { className: "bu-category-dropdown__panel", children:
|
|
1038
|
-
const m = E.length > l,
|
|
1037
|
+
/* @__PURE__ */ t("div", { ref: f, style: S, className: "bu-category-dropdown__portal", children: /* @__PURE__ */ t("div", { className: "bu-category-dropdown__panel", children: J.map((E, I) => {
|
|
1038
|
+
const m = E.length > l, L = I === J.length - 1, b = [
|
|
1039
1039
|
"bu-category-dropdown__col",
|
|
1040
1040
|
I > 0 ? "bu-category-dropdown__col--indent" : "",
|
|
1041
1041
|
m ? "bu-category-dropdown__col--scrollable" : "",
|
|
1042
|
-
|
|
1042
|
+
L && I > 0 ? "bu-category-dropdown__col--last" : ""
|
|
1043
1043
|
].filter(Boolean).join(" ");
|
|
1044
|
-
return /* @__PURE__ */
|
|
1044
|
+
return /* @__PURE__ */ n("div", { style: { display: "contents" }, children: [
|
|
1045
1045
|
I > 0 && /* @__PURE__ */ t("div", { className: "bu-category-dropdown__divider" }),
|
|
1046
1046
|
/* @__PURE__ */ t("div", { className: b, children: E.map((d) => {
|
|
1047
1047
|
var q;
|
|
@@ -1051,7 +1051,7 @@ function ne({
|
|
|
1051
1051
|
R && !z ? "bu-category-dropdown__item--selected-leaf" : "",
|
|
1052
1052
|
d.disabled ? "bu-category-dropdown__item--disabled" : ""
|
|
1053
1053
|
].filter(Boolean).join(" ");
|
|
1054
|
-
return /* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ n(
|
|
1055
1055
|
"button",
|
|
1056
1056
|
{
|
|
1057
1057
|
type: "button",
|
|
@@ -1085,7 +1085,7 @@ function ne({
|
|
|
1085
1085
|
const re = (o) => {
|
|
1086
1086
|
const {
|
|
1087
1087
|
current: i,
|
|
1088
|
-
defaultCurrent:
|
|
1088
|
+
defaultCurrent: r = 1,
|
|
1089
1089
|
pageSize: a,
|
|
1090
1090
|
defaultPageSize: p = 10,
|
|
1091
1091
|
total: l = 0,
|
|
@@ -1100,17 +1100,17 @@ const re = (o) => {
|
|
|
1100
1100
|
size: f = "medium",
|
|
1101
1101
|
align: S = "start",
|
|
1102
1102
|
simple: H = !1,
|
|
1103
|
-
popupPlacement:
|
|
1103
|
+
popupPlacement: N,
|
|
1104
1104
|
t: K = (u) => u,
|
|
1105
1105
|
className: j,
|
|
1106
|
-
style:
|
|
1107
|
-
} = o, [
|
|
1106
|
+
style: O
|
|
1107
|
+
} = o, [J, G] = x(r), [k, T] = x(p), [E, I] = x(!1), [m, L] = x("bottom"), b = Y(null), d = i ?? J, R = a ?? k, z = Math.ceil(l / R);
|
|
1108
1108
|
if (g && z <= 1)
|
|
1109
1109
|
return null;
|
|
1110
1110
|
const P = (u) => {
|
|
1111
1111
|
c || u < 1 || u > z || u === d || (i === void 0 && G(u), s == null || s(u, R));
|
|
1112
1112
|
}, q = (u) => {
|
|
1113
|
-
const
|
|
1113
|
+
const D = Math.ceil(l / u), B = Math.min(d, D) || 1;
|
|
1114
1114
|
a === void 0 && (T(u), i === void 0 && G(B)), h == null || h(B, u), s == null || s(B, u);
|
|
1115
1115
|
}, X = () => {
|
|
1116
1116
|
if (!c) {
|
|
@@ -1118,18 +1118,18 @@ const re = (o) => {
|
|
|
1118
1118
|
I(!1);
|
|
1119
1119
|
return;
|
|
1120
1120
|
}
|
|
1121
|
-
if (
|
|
1122
|
-
const u = b.current.getBoundingClientRect(),
|
|
1123
|
-
|
|
1121
|
+
if (N === void 0 && b.current) {
|
|
1122
|
+
const u = b.current.getBoundingClientRect(), D = C.length * 40 + 8, B = window.innerHeight - u.bottom, e = u.top;
|
|
1123
|
+
L(B < D && e >= D ? "top" : "bottom");
|
|
1124
1124
|
}
|
|
1125
1125
|
I(!0);
|
|
1126
1126
|
}
|
|
1127
|
-
},
|
|
1127
|
+
}, Q = (u) => {
|
|
1128
1128
|
q(u), I(!1);
|
|
1129
1129
|
};
|
|
1130
1130
|
et(() => {
|
|
1131
|
-
const u = (
|
|
1132
|
-
b.current && !b.current.contains(
|
|
1131
|
+
const u = (D) => {
|
|
1132
|
+
b.current && !b.current.contains(D.target) && I(!1);
|
|
1133
1133
|
};
|
|
1134
1134
|
if (E)
|
|
1135
1135
|
return document.addEventListener("mousedown", u), () => {
|
|
@@ -1137,8 +1137,8 @@ const re = (o) => {
|
|
|
1137
1137
|
};
|
|
1138
1138
|
}, [E]);
|
|
1139
1139
|
const tt = (u) => {
|
|
1140
|
-
const
|
|
1141
|
-
!isNaN(
|
|
1140
|
+
const D = parseInt(u.target.value);
|
|
1141
|
+
!isNaN(D) && D >= 1 && D <= z && P(D);
|
|
1142
1142
|
}, F = Ct(() => {
|
|
1143
1143
|
const u = [];
|
|
1144
1144
|
if (z <= 7)
|
|
@@ -1159,7 +1159,7 @@ const re = (o) => {
|
|
|
1159
1159
|
u.push("..."), u.push(z);
|
|
1160
1160
|
}
|
|
1161
1161
|
return u;
|
|
1162
|
-
}, [d, z]), Z = (d - 1) * R + 1, _ = Math.min(d * R, l), it = `pagination-${f}`, V = `pagination-${S}`, $ = c ? "pagination-disabled" : "", nt = (u,
|
|
1162
|
+
}, [d, z]), Z = (d - 1) * R + 1, _ = Math.min(d * R, l), it = `pagination-${f}`, V = `pagination-${S}`, $ = c ? "pagination-disabled" : "", nt = (u, D) => u === "..." ? /* @__PURE__ */ t("span", { className: "pagination-item pagination-ellipsis", children: "..." }, `ellipsis-${D}`) : /* @__PURE__ */ t(
|
|
1163
1163
|
"button",
|
|
1164
1164
|
{
|
|
1165
1165
|
type: "button",
|
|
@@ -1174,8 +1174,8 @@ const re = (o) => {
|
|
|
1174
1174
|
"div",
|
|
1175
1175
|
{
|
|
1176
1176
|
className: `pagination pagination-simple ${$} ${j || ""}`,
|
|
1177
|
-
style:
|
|
1178
|
-
children: /* @__PURE__ */
|
|
1177
|
+
style: O,
|
|
1178
|
+
children: /* @__PURE__ */ n("div", { className: "pagination-simple-list", children: [
|
|
1179
1179
|
/* @__PURE__ */ t(
|
|
1180
1180
|
"button",
|
|
1181
1181
|
{
|
|
@@ -1186,7 +1186,7 @@ const re = (o) => {
|
|
|
1186
1186
|
children: /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ t("path", { d: "M8 2L4 6L8 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
1187
1187
|
}
|
|
1188
1188
|
),
|
|
1189
|
-
/* @__PURE__ */
|
|
1189
|
+
/* @__PURE__ */ n("span", { className: "pagination-simple-text", children: [
|
|
1190
1190
|
d,
|
|
1191
1191
|
" / ",
|
|
1192
1192
|
z || 0
|
|
@@ -1203,14 +1203,14 @@ const re = (o) => {
|
|
|
1203
1203
|
)
|
|
1204
1204
|
] })
|
|
1205
1205
|
}
|
|
1206
|
-
) : /* @__PURE__ */
|
|
1206
|
+
) : /* @__PURE__ */ n(
|
|
1207
1207
|
"div",
|
|
1208
1208
|
{
|
|
1209
1209
|
className: `pagination ${it} ${V} ${$} ${j || ""}`,
|
|
1210
|
-
style:
|
|
1210
|
+
style: O,
|
|
1211
1211
|
children: [
|
|
1212
1212
|
y && /* @__PURE__ */ t("div", { className: "pagination-total", children: y(l, [Z, _]) }),
|
|
1213
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ n("div", { className: "pagination-list", children: [
|
|
1214
1214
|
/* @__PURE__ */ t(
|
|
1215
1215
|
"button",
|
|
1216
1216
|
{
|
|
@@ -1218,10 +1218,10 @@ const re = (o) => {
|
|
|
1218
1218
|
className: "pagination-item pagination-prev",
|
|
1219
1219
|
onClick: () => P(d - 1),
|
|
1220
1220
|
disabled: c || d === 1,
|
|
1221
|
-
children: /* @__PURE__ */ t("svg", { width: "
|
|
1221
|
+
children: /* @__PURE__ */ t("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t("path", { d: "M11.1749 5.57516C11.3377 5.41245 11.6014 5.41245 11.7641 5.57516C11.9268 5.73788 11.9268 6.00164 11.7641 6.16436L7.8945 10.034L11.7617 13.8366C11.9257 13.998 11.9279 14.2617 11.7666 14.4258C11.6052 14.5899 11.3414 14.592 11.1774 14.4307L7.2105 10.5299C6.93541 10.2594 6.93349 9.81648 7.20629 9.54367L11.1749 5.57516Z", fill: "#CCCCCC" }) })
|
|
1222
1222
|
}
|
|
1223
1223
|
),
|
|
1224
|
-
F.map((u,
|
|
1224
|
+
F.map((u, D) => nt(u, D)),
|
|
1225
1225
|
/* @__PURE__ */ t(
|
|
1226
1226
|
"button",
|
|
1227
1227
|
{
|
|
@@ -1229,12 +1229,15 @@ const re = (o) => {
|
|
|
1229
1229
|
className: "pagination-item pagination-next",
|
|
1230
1230
|
onClick: () => P(d + 1),
|
|
1231
1231
|
disabled: c || d === z,
|
|
1232
|
-
children: /* @__PURE__ */
|
|
1232
|
+
children: /* @__PURE__ */ n("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1233
|
+
/* @__PURE__ */ t("path", { d: "M8.82507 5.57516C8.66235 5.41245 8.39859 5.41245 8.23587 5.57516C8.07315 5.73788 8.07315 6.00164 8.23587 6.16436L12.1055 10.034L8.23831 13.8366C8.07427 13.998 8.0721 14.2617 8.23343 14.4258C8.39478 14.5899 8.65856 14.592 8.82262 14.4307L12.7895 10.5299C13.0646 10.2594 13.0665 9.81648 12.7937 9.54367L8.82507 5.57516Z", fill: "#333333" }),
|
|
1234
|
+
/* @__PURE__ */ t("path", { d: "M8.82507 5.57516C8.66235 5.41245 8.39859 5.41245 8.23587 5.57516C8.07315 5.73788 8.07315 6.00164 8.23587 6.16436L12.1055 10.034L8.23831 13.8366C8.07427 13.998 8.0721 14.2617 8.23343 14.4258C8.39478 14.5899 8.65856 14.592 8.82262 14.4307L12.7895 10.5299C13.0646 10.2594 13.0665 9.81648 12.7937 9.54367L8.82507 5.57516Z", fill: "black", "fill-opacity": "0.2" })
|
|
1235
|
+
] })
|
|
1233
1236
|
}
|
|
1234
1237
|
)
|
|
1235
1238
|
] }),
|
|
1236
|
-
w && /* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1239
|
+
w && /* @__PURE__ */ n("div", { className: "pagination-sizer", ref: b, children: [
|
|
1240
|
+
/* @__PURE__ */ n(
|
|
1238
1241
|
"button",
|
|
1239
1242
|
{
|
|
1240
1243
|
type: "button",
|
|
@@ -1247,13 +1250,16 @@ const re = (o) => {
|
|
|
1247
1250
|
]
|
|
1248
1251
|
}
|
|
1249
1252
|
),
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
|
|
1253
|
+
/* @__PURE__ */ n("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1254
|
+
/* @__PURE__ */ t("path", { d: "M5.57321 8.828C5.41049 8.66528 5.41049 8.40152 5.57321 8.2388C5.73593 8.07608 5.99969 8.07608 6.1624 8.2388L10.032 12.1084L13.8347 8.24124C13.996 8.0772 14.2598 8.07503 14.4239 8.23636C14.5879 8.39771 14.5901 8.66149 14.4287 8.82555L10.5279 12.7924C10.2574 13.0675 9.81452 13.0694 9.54172 12.7966L5.57321 8.828Z", fill: "#333333" }),
|
|
1255
|
+
/* @__PURE__ */ t("path", { d: "M5.57321 8.828C5.41049 8.66528 5.41049 8.40152 5.57321 8.2388C5.73593 8.07608 5.99969 8.07608 6.1624 8.2388L10.032 12.1084L13.8347 8.24124C13.996 8.0772 14.2598 8.07503 14.4239 8.23636C14.5879 8.39771 14.5901 8.66149 14.4287 8.82555L10.5279 12.7924C10.2574 13.0675 9.81452 13.0694 9.54172 12.7966L5.57321 8.828Z", fill: "black", "fill-opacity": "0.2" })
|
|
1256
|
+
] }),
|
|
1257
|
+
E && /* @__PURE__ */ t("div", { className: `pagination-sizer-dropdown pagination-sizer-dropdown-${N ?? m}`, children: C.map((u) => /* @__PURE__ */ n(
|
|
1252
1258
|
"button",
|
|
1253
1259
|
{
|
|
1254
1260
|
type: "button",
|
|
1255
1261
|
className: "pagination-sizer-option",
|
|
1256
|
-
onClick: () =>
|
|
1262
|
+
onClick: () => Q(u),
|
|
1257
1263
|
"data-selected": u === R,
|
|
1258
1264
|
children: [
|
|
1259
1265
|
u,
|
|
@@ -1263,7 +1269,7 @@ const re = (o) => {
|
|
|
1263
1269
|
u
|
|
1264
1270
|
)) })
|
|
1265
1271
|
] }),
|
|
1266
|
-
A && /* @__PURE__ */
|
|
1272
|
+
A && /* @__PURE__ */ n("div", { className: "pagination-jumper", children: [
|
|
1267
1273
|
/* @__PURE__ */ t("span", { children: K("跳至") }),
|
|
1268
1274
|
/* @__PURE__ */ t(
|
|
1269
1275
|
"input",
|
|
@@ -1296,11 +1302,11 @@ const re = (o) => {
|
|
|
1296
1302
|
txt: { color: "#8C8C8C", label: "TXT" },
|
|
1297
1303
|
other: { color: "#1677FF", label: "FILE" }
|
|
1298
1304
|
};
|
|
1299
|
-
function Ut({ fileType: o, fileUrl: i, fileName:
|
|
1305
|
+
function Ut({ fileType: o, fileUrl: i, fileName: r }) {
|
|
1300
1306
|
if (o === "image" && i)
|
|
1301
|
-
return /* @__PURE__ */ t("img", { src: i, alt:
|
|
1307
|
+
return /* @__PURE__ */ t("img", { src: i, alt: r, className: "file-card__image-thumb" });
|
|
1302
1308
|
const { color: a, label: p } = Pt[o];
|
|
1303
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ n("svg", { width: "88", height: "88", viewBox: "0 0 88 88", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1304
1310
|
/* @__PURE__ */ t("rect", { x: "14", y: "8", width: "50", height: "62", rx: "4", fill: "#F5F5F5" }),
|
|
1305
1311
|
/* @__PURE__ */ t("path", { d: "M50 8L64 22H50V8Z", fill: "#E2E2E2" }),
|
|
1306
1312
|
/* @__PURE__ */ t("rect", { x: "20", y: "30", width: "30", height: "4", rx: "2", fill: "#E2E2E2" }),
|
|
@@ -1326,13 +1332,13 @@ function Ut({ fileType: o, fileUrl: i, fileName: n }) {
|
|
|
1326
1332
|
] });
|
|
1327
1333
|
}
|
|
1328
1334
|
function wt() {
|
|
1329
|
-
return /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: [
|
|
1330
1336
|
/* @__PURE__ */ t("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1331
1337
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "3", stroke: "currentColor", strokeWidth: "2" })
|
|
1332
1338
|
] });
|
|
1333
1339
|
}
|
|
1334
1340
|
function yt() {
|
|
1335
|
-
return /* @__PURE__ */
|
|
1341
|
+
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: [
|
|
1336
1342
|
/* @__PURE__ */ t("polyline", { points: "3,6 5,6 21,6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1337
1343
|
/* @__PURE__ */ t("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1338
1344
|
/* @__PURE__ */ t("path", { d: "M10 11v6M14 11v6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
@@ -1340,11 +1346,11 @@ function yt() {
|
|
|
1340
1346
|
] });
|
|
1341
1347
|
}
|
|
1342
1348
|
function vt({ fileName: o, onRename: i }) {
|
|
1343
|
-
const [
|
|
1349
|
+
const [r, a] = x(!1), [p, l] = x(o), s = Y(null);
|
|
1344
1350
|
et(() => {
|
|
1345
1351
|
var g, y;
|
|
1346
|
-
|
|
1347
|
-
}, [
|
|
1352
|
+
r && (l(o), (g = s.current) == null || g.focus(), (y = s.current) == null || y.select());
|
|
1353
|
+
}, [r, o]);
|
|
1348
1354
|
const h = async () => {
|
|
1349
1355
|
const g = p.trim();
|
|
1350
1356
|
g && g !== o && await (i == null ? void 0 : i(g)), a(!1);
|
|
@@ -1355,7 +1361,7 @@ function vt({ fileName: o, onRename: i }) {
|
|
|
1355
1361
|
}, c = () => {
|
|
1356
1362
|
i && a(!0);
|
|
1357
1363
|
};
|
|
1358
|
-
return
|
|
1364
|
+
return r ? /* @__PURE__ */ t("div", { className: "file-card__name-area file-card__name-area--editing", children: /* @__PURE__ */ t(
|
|
1359
1365
|
"textarea",
|
|
1360
1366
|
{
|
|
1361
1367
|
ref: s,
|
|
@@ -1369,10 +1375,10 @@ function vt({ fileName: o, onRename: i }) {
|
|
|
1369
1375
|
}
|
|
1370
1376
|
) }) : /* @__PURE__ */ t("div", { className: "file-card__name-area", onDoubleClick: c, children: /* @__PURE__ */ t("span", { className: "file-card__filename", title: o, children: o }) });
|
|
1371
1377
|
}
|
|
1372
|
-
function Yt({ fileName: o, onDelete: i, onRename:
|
|
1373
|
-
return /* @__PURE__ */
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
(a || i) && /* @__PURE__ */
|
|
1378
|
+
function Yt({ fileName: o, onDelete: i, onRename: r, onPreview: a, className: p, style: l }) {
|
|
1379
|
+
return /* @__PURE__ */ n("div", { className: `file-card file-card--pdf ${p || ""}`, style: l, children: [
|
|
1380
|
+
/* @__PURE__ */ n("div", { className: "file-card__pdf-preview", onClick: a, children: [
|
|
1381
|
+
(a || i) && /* @__PURE__ */ n("div", { className: "file-card__overlay", children: [
|
|
1376
1382
|
a && /* @__PURE__ */ t("button", { className: "file-card__overlay-btn", onClick: (s) => {
|
|
1377
1383
|
s.stopPropagation(), a();
|
|
1378
1384
|
}, children: /* @__PURE__ */ t(wt, {}) }),
|
|
@@ -1382,13 +1388,13 @@ function Yt({ fileName: o, onDelete: i, onRename: n, onPreview: a, className: p,
|
|
|
1382
1388
|
] }),
|
|
1383
1389
|
/* @__PURE__ */ t("div", { className: "file-card__pdf-label", children: /* @__PURE__ */ t("span", { children: "PDF" }) })
|
|
1384
1390
|
] }),
|
|
1385
|
-
/* @__PURE__ */ t(vt, { fileName: o, onRename:
|
|
1391
|
+
/* @__PURE__ */ t(vt, { fileName: o, onRename: r })
|
|
1386
1392
|
] });
|
|
1387
1393
|
}
|
|
1388
|
-
function Tt({ fileName: o, fileType: i, fileUrl:
|
|
1389
|
-
return /* @__PURE__ */
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
(l || a) && /* @__PURE__ */
|
|
1394
|
+
function Tt({ fileName: o, fileType: i, fileUrl: r, onDelete: a, onRename: p, onPreview: l, className: s, style: h }) {
|
|
1395
|
+
return /* @__PURE__ */ n("div", { className: `file-card file-card--other ${s || ""}`, style: h, children: [
|
|
1396
|
+
/* @__PURE__ */ n("div", { className: "file-card__other-preview", onClick: l, children: [
|
|
1397
|
+
(l || a) && /* @__PURE__ */ n("div", { className: "file-card__overlay", children: [
|
|
1392
1398
|
l && /* @__PURE__ */ t("button", { className: "file-card__overlay-btn", onClick: (w) => {
|
|
1393
1399
|
w.stopPropagation(), l();
|
|
1394
1400
|
}, children: /* @__PURE__ */ t(wt, {}) }),
|
|
@@ -1396,7 +1402,7 @@ function Tt({ fileName: o, fileType: i, fileUrl: n, onDelete: a, onRename: p, on
|
|
|
1396
1402
|
w.stopPropagation(), a();
|
|
1397
1403
|
}, children: /* @__PURE__ */ t(yt, {}) })
|
|
1398
1404
|
] }),
|
|
1399
|
-
/* @__PURE__ */ t(Ut, { fileType: i, fileUrl:
|
|
1405
|
+
/* @__PURE__ */ t(Ut, { fileType: i, fileUrl: r, fileName: o })
|
|
1400
1406
|
] }),
|
|
1401
1407
|
/* @__PURE__ */ t(vt, { fileName: o, onRename: p })
|
|
1402
1408
|
] });
|
|
@@ -1407,7 +1413,7 @@ function oe(o) {
|
|
|
1407
1413
|
const qt = ({
|
|
1408
1414
|
checked: o,
|
|
1409
1415
|
defaultChecked: i = !1,
|
|
1410
|
-
onChange:
|
|
1416
|
+
onChange: r,
|
|
1411
1417
|
disabled: a = !1,
|
|
1412
1418
|
loading: p = !1,
|
|
1413
1419
|
checkedChildren: l,
|
|
@@ -1418,11 +1424,11 @@ const qt = ({
|
|
|
1418
1424
|
className: C,
|
|
1419
1425
|
style: c
|
|
1420
1426
|
}) => {
|
|
1421
|
-
const g = o !== void 0, [y, f] =
|
|
1427
|
+
const g = o !== void 0, [y, f] = x(i), S = g ? o : y, H = ot(() => {
|
|
1422
1428
|
if (a || p) return;
|
|
1423
|
-
const
|
|
1424
|
-
g || f(
|
|
1425
|
-
}, [S, a, p, g,
|
|
1429
|
+
const J = !S;
|
|
1430
|
+
g || f(J), r == null || r(J);
|
|
1431
|
+
}, [S, a, p, g, r]), j = S ? w ?? (h === "dark" ? "var(--bu-switch-dark-on)" : "var(--bu-switch-light-on)") : A ?? (h === "dark" ? "var(--bu-switch-dark-off)" : "var(--bu-switch-light-off)"), O = [
|
|
1426
1432
|
"bu-switch",
|
|
1427
1433
|
S && "bu-switch--checked",
|
|
1428
1434
|
a && "bu-switch--disabled",
|
|
@@ -1436,13 +1442,13 @@ const qt = ({
|
|
|
1436
1442
|
role: "switch",
|
|
1437
1443
|
"aria-checked": S,
|
|
1438
1444
|
"aria-disabled": a,
|
|
1439
|
-
className:
|
|
1445
|
+
className: O,
|
|
1440
1446
|
style: {
|
|
1441
1447
|
"--bu-switch-track-bg": j,
|
|
1442
1448
|
...c
|
|
1443
1449
|
},
|
|
1444
1450
|
onClick: H,
|
|
1445
|
-
children: /* @__PURE__ */
|
|
1451
|
+
children: /* @__PURE__ */ n("span", { className: "bu-switch__track", children: [
|
|
1446
1452
|
s != null && /* @__PURE__ */ t("span", { className: "bu-switch__label bu-switch__label--left", children: s }),
|
|
1447
1453
|
/* @__PURE__ */ t("span", { className: "bu-switch__thumb", children: p && /* @__PURE__ */ t("span", { className: "bu-switch__loading-icon", children: /* @__PURE__ */ t("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
1448
1454
|
"path",
|