bj-web-components 0.2.4 → 0.2.5
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/BInputNumber-DBhnkgUy.js +1 -0
- package/dist/{BInputNumber-Bdu3RH2L.mjs → BInputNumber-DRQMC_Un.mjs} +667 -649
- 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
- package/dist/BInputNumber-BsyBGOqE.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t, jsxs as l, Fragment as ht } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as H, useCallback as ct, useLayoutEffect as vt, forwardRef as It, useRef as R, useEffect as ot, useMemo as dt } from "react";
|
|
3
3
|
import { createPortal as Mt } from "react-dom";
|
|
4
4
|
const oe = ({ type: n, style: e, onClick: i, className: c, ...u }) => {
|
|
5
5
|
const s = c ? `bu-icon ${c}` : "bu-icon";
|
|
@@ -8,27 +8,27 @@ const oe = ({ type: n, style: e, onClick: i, className: c, ...u }) => {
|
|
|
8
8
|
oe.displayName = "BuIcon";
|
|
9
9
|
const ce = ["top", "right", "bottom", "left"];
|
|
10
10
|
function Kt(n) {
|
|
11
|
-
const [e, i] =
|
|
11
|
+
const [e, i] = H("top"), [c, u] = H(null), s = ct((r) => {
|
|
12
12
|
u(r);
|
|
13
13
|
}, []);
|
|
14
|
-
return
|
|
14
|
+
return vt(() => {
|
|
15
15
|
if (n !== "auto" || !c) return;
|
|
16
16
|
const r = c.parentElement;
|
|
17
17
|
if (!r) return;
|
|
18
|
-
const p = r.getBoundingClientRect(),
|
|
18
|
+
const p = r.getBoundingClientRect(), f = c.offsetWidth, g = c.offsetHeight, h = 12, a = {
|
|
19
19
|
top: p.top,
|
|
20
20
|
right: window.innerWidth - p.right,
|
|
21
21
|
bottom: window.innerHeight - p.bottom,
|
|
22
22
|
left: p.left
|
|
23
|
-
},
|
|
24
|
-
top:
|
|
25
|
-
right:
|
|
26
|
-
bottom:
|
|
27
|
-
left:
|
|
23
|
+
}, y = {
|
|
24
|
+
top: g + h,
|
|
25
|
+
right: f + h,
|
|
26
|
+
bottom: g + h,
|
|
27
|
+
left: f + h
|
|
28
28
|
};
|
|
29
|
-
for (const
|
|
30
|
-
if (a[
|
|
31
|
-
i(
|
|
29
|
+
for (const b of ce)
|
|
30
|
+
if (a[b] >= y[b]) {
|
|
31
|
+
i(b);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
i("top");
|
|
@@ -44,9 +44,9 @@ function Te({
|
|
|
44
44
|
className: r,
|
|
45
45
|
style: p
|
|
46
46
|
}) {
|
|
47
|
-
const [
|
|
48
|
-
return /* @__PURE__ */ l("div", { ref:
|
|
49
|
-
/* @__PURE__ */ t("div", { className: `tooltip-arrow tooltip-arrow--${
|
|
47
|
+
const [f, g] = Kt(n), h = ["tooltip-popup", `tooltip-popup--${f}`, r].filter(Boolean).join(" ");
|
|
48
|
+
return /* @__PURE__ */ l("div", { ref: g, className: h, style: p, children: [
|
|
49
|
+
/* @__PURE__ */ t("div", { className: `tooltip-arrow tooltip-arrow--${f}` }),
|
|
50
50
|
/* @__PURE__ */ t("p", { className: "tooltip-confirm__title", children: e }),
|
|
51
51
|
/* @__PURE__ */ l("div", { className: "tooltip-confirm__actions", children: [
|
|
52
52
|
/* @__PURE__ */ t("button", { className: "tooltip-confirm__cancel", onClick: s, children: c }),
|
|
@@ -61,8 +61,8 @@ function Ue({
|
|
|
61
61
|
className: c,
|
|
62
62
|
style: u
|
|
63
63
|
}) {
|
|
64
|
-
const [s, r] = Kt(n), p = Math.min(100, Math.max(0, Math.round(i))),
|
|
65
|
-
return /* @__PURE__ */ l("div", { ref: r, className:
|
|
64
|
+
const [s, r] = Kt(n), p = Math.min(100, Math.max(0, Math.round(i))), f = ["tooltip-popup", `tooltip-popup--${s}`, c].filter(Boolean).join(" ");
|
|
65
|
+
return /* @__PURE__ */ l("div", { ref: r, className: f, style: u, children: [
|
|
66
66
|
/* @__PURE__ */ t("div", { className: `tooltip-arrow tooltip-arrow--${s}` }),
|
|
67
67
|
/* @__PURE__ */ l("div", { className: "tooltip-progress", children: [
|
|
68
68
|
/* @__PURE__ */ l("div", { className: "tooltip-progress__header", children: [
|
|
@@ -96,17 +96,17 @@ function le({
|
|
|
96
96
|
`tooltip-popup--${s}`,
|
|
97
97
|
i !== "default" ? `tooltip-popup--${i}` : "",
|
|
98
98
|
c
|
|
99
|
-
].filter(Boolean).join(" "),
|
|
99
|
+
].filter(Boolean).join(" "), f = [
|
|
100
100
|
"tooltip-arrow",
|
|
101
101
|
`tooltip-arrow--${s}`,
|
|
102
102
|
i === "tinted" ? "tooltip-arrow--tinted-bg" : ""
|
|
103
103
|
].filter(Boolean).join(" ");
|
|
104
104
|
return /* @__PURE__ */ l("div", { ref: r, className: p, style: u, children: [
|
|
105
|
-
/* @__PURE__ */ t("div", { className:
|
|
105
|
+
/* @__PURE__ */ t("div", { className: f }),
|
|
106
106
|
/* @__PURE__ */ t("p", { className: "bu-tooltip-content__text", children: e })
|
|
107
107
|
] });
|
|
108
108
|
}
|
|
109
|
-
const Ht =
|
|
109
|
+
const Ht = It(
|
|
110
110
|
({ children: n, style: e, className: i }, c) => {
|
|
111
111
|
const u = ["tooltip-wrapper", i].filter(Boolean).join(" ");
|
|
112
112
|
return /* @__PURE__ */ t("div", { ref: c, className: u, style: e, children: n });
|
|
@@ -138,7 +138,7 @@ function Ae() {
|
|
|
138
138
|
function ge(n, e) {
|
|
139
139
|
return (typeof n.label == "string" ? n.label : n.value).toLowerCase().includes(e.toLowerCase());
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function fe({ text: n, keyword: e }) {
|
|
142
142
|
if (!e) return /* @__PURE__ */ t(ht, { children: n });
|
|
143
143
|
const i = n.toLowerCase().indexOf(e.toLowerCase());
|
|
144
144
|
if (i === -1) return /* @__PURE__ */ t(ht, { children: n });
|
|
@@ -158,77 +158,77 @@ function Ye({
|
|
|
158
158
|
onLangChange: s,
|
|
159
159
|
showBody: r = !0,
|
|
160
160
|
error: p = !1,
|
|
161
|
-
onDelete:
|
|
162
|
-
onPreviewImage:
|
|
163
|
-
onDeleteImage:
|
|
161
|
+
onDelete: f,
|
|
162
|
+
onPreviewImage: g,
|
|
163
|
+
onDeleteImage: h,
|
|
164
164
|
onUpload: a,
|
|
165
|
-
onAssociate:
|
|
166
|
-
images:
|
|
167
|
-
labels:
|
|
168
|
-
inputEvents:
|
|
169
|
-
className:
|
|
170
|
-
style:
|
|
171
|
-
options:
|
|
172
|
-
optionFilterProp:
|
|
173
|
-
onSelect:
|
|
174
|
-
onSearch:
|
|
175
|
-
open:
|
|
176
|
-
onDropdownVisibleChange:
|
|
165
|
+
onAssociate: y,
|
|
166
|
+
images: b,
|
|
167
|
+
labels: I,
|
|
168
|
+
inputEvents: G,
|
|
169
|
+
className: q,
|
|
170
|
+
style: X,
|
|
171
|
+
options: S,
|
|
172
|
+
optionFilterProp: N,
|
|
173
|
+
onSelect: k,
|
|
174
|
+
onSearch: P,
|
|
175
|
+
open: T,
|
|
176
|
+
onDropdownVisibleChange: D
|
|
177
177
|
}) {
|
|
178
|
-
const
|
|
179
|
-
(o) =>
|
|
180
|
-
) :
|
|
178
|
+
const W = (I == null ? void 0 : I.namePlaceholder) ?? "请填写产品名称", U = (I == null ? void 0 : I.uploadLocal) ?? "本地上传", V = (I == null ? void 0 : I.associateImage) ?? "关联图片", _ = R(null), $ = R(null), Z = R(null), w = R(null), [v, C] = H([]), [E, j] = H(!1), [L, M] = H(!1), [et, O] = H(!1), F = Array.isArray(S) && S.length > 0, nt = T !== void 0 ? T : F && L, st = F ? e ? S.filter(
|
|
179
|
+
(o) => N ? N(o, e) : ge(o, e)
|
|
180
|
+
) : S : [];
|
|
181
181
|
ot(() => {
|
|
182
|
-
if (!
|
|
183
|
-
function o(
|
|
184
|
-
|
|
182
|
+
if (!E) return;
|
|
183
|
+
function o(m) {
|
|
184
|
+
$.current && !$.current.contains(m.target) && j(!1);
|
|
185
185
|
}
|
|
186
186
|
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
187
|
-
}, [
|
|
188
|
-
if (!
|
|
189
|
-
function o(
|
|
190
|
-
var
|
|
191
|
-
const
|
|
192
|
-
(
|
|
187
|
+
}, [E]), ot(() => {
|
|
188
|
+
if (!nt) return;
|
|
189
|
+
function o(m) {
|
|
190
|
+
var Y, tt;
|
|
191
|
+
const K = m.target;
|
|
192
|
+
(Y = Z.current) != null && Y.contains(K) || (tt = w.current) != null && tt.contains(K) || (M(!1), D == null || D(!1));
|
|
193
193
|
}
|
|
194
194
|
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
195
|
-
}, [
|
|
196
|
-
const
|
|
197
|
-
async function
|
|
198
|
-
var
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
201
|
-
o.target.value = "",
|
|
195
|
+
}, [nt, D]);
|
|
196
|
+
const x = b ?? v;
|
|
197
|
+
async function it(o) {
|
|
198
|
+
var K;
|
|
199
|
+
const m = (K = o.target.files) == null ? void 0 : K[0];
|
|
200
|
+
if (m) {
|
|
201
|
+
o.target.value = "", j(!1), O(!0);
|
|
202
202
|
try {
|
|
203
203
|
if (a) {
|
|
204
|
-
const
|
|
205
|
-
|
|
204
|
+
const Y = await a(m);
|
|
205
|
+
Y && b === void 0 && C((tt) => [...tt, Y]);
|
|
206
206
|
} else {
|
|
207
|
-
const
|
|
208
|
-
|
|
207
|
+
const Y = URL.createObjectURL(m);
|
|
208
|
+
C((tt) => [...tt, Y]);
|
|
209
209
|
}
|
|
210
210
|
} finally {
|
|
211
|
-
|
|
211
|
+
O(!1);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
function lt() {
|
|
216
216
|
var o;
|
|
217
|
-
(o =
|
|
217
|
+
(o = _.current) == null || o.click();
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
|
|
219
|
+
function A() {
|
|
220
|
+
j(!1), y == null || y();
|
|
221
221
|
}
|
|
222
|
-
const
|
|
222
|
+
const J = [
|
|
223
223
|
"sku-input-card",
|
|
224
224
|
p && "sku-input-card--error",
|
|
225
|
-
|
|
226
|
-
].filter(Boolean).join(" "),
|
|
225
|
+
q
|
|
226
|
+
].filter(Boolean).join(" "), Q = [
|
|
227
227
|
"sku-input-card__name-input",
|
|
228
228
|
c === "bilingual" && "sku-input-card__name-input--with-toggle",
|
|
229
229
|
p && "sku-input-card__name-input--error"
|
|
230
230
|
].filter(Boolean).join(" ");
|
|
231
|
-
return /* @__PURE__ */ l("div", { className:
|
|
231
|
+
return /* @__PURE__ */ l("div", { className: J, style: X, children: [
|
|
232
232
|
/* @__PURE__ */ t("span", { className: "sku-input-card__drag", id: n, children: /* @__PURE__ */ t(ue, {}) }),
|
|
233
233
|
/* @__PURE__ */ l("div", { className: "sku-input-card__main", children: [
|
|
234
234
|
/* @__PURE__ */ l("div", { className: "sku-input-card__header", children: [
|
|
@@ -236,23 +236,23 @@ function Ye({
|
|
|
236
236
|
/* @__PURE__ */ t(
|
|
237
237
|
"input",
|
|
238
238
|
{
|
|
239
|
-
className:
|
|
239
|
+
className: Q,
|
|
240
240
|
value: e,
|
|
241
241
|
onChange: (o) => {
|
|
242
|
-
i == null || i(o.target.value),
|
|
242
|
+
i == null || i(o.target.value), P == null || P(o.target.value);
|
|
243
243
|
},
|
|
244
244
|
onFocus: () => {
|
|
245
|
-
|
|
245
|
+
F && T === void 0 && (M(!0), D == null || D(!0));
|
|
246
246
|
},
|
|
247
|
-
placeholder:
|
|
248
|
-
...
|
|
247
|
+
placeholder: W,
|
|
248
|
+
...G
|
|
249
249
|
}
|
|
250
250
|
),
|
|
251
|
-
|
|
251
|
+
nt && st.length > 0 && /* 绝对定位锚定在 name-wrap(position: relative)下方,随输入框跟随滚动/视口变化。
|
|
252
252
|
不再用 portal + position:fixed + getBoundingClientRect 定位:iOS 软键盘弹出时
|
|
253
253
|
fixed 与 getBoundingClientRect 的视口基准不一致,会导致下拉框位置偏移。 */
|
|
254
|
-
/* @__PURE__ */ t("div", { className: "sku-input-card__dropdown", ref:
|
|
255
|
-
const
|
|
254
|
+
/* @__PURE__ */ t("div", { className: "sku-input-card__dropdown", ref: Z, children: /* @__PURE__ */ t("div", { className: "sku-input-card__dropdown-list", children: st.map((o) => {
|
|
255
|
+
const m = typeof o.label == "string" ? o.label : o.value;
|
|
256
256
|
return /* @__PURE__ */ t(
|
|
257
257
|
"div",
|
|
258
258
|
{
|
|
@@ -261,10 +261,10 @@ function Ye({
|
|
|
261
261
|
o.disabled && "sku-input-card__dropdown-item--disabled",
|
|
262
262
|
o.value === e && "sku-input-card__dropdown-item--selected"
|
|
263
263
|
].filter(Boolean).join(" "),
|
|
264
|
-
onMouseDown: (
|
|
265
|
-
|
|
264
|
+
onMouseDown: (K) => {
|
|
265
|
+
K.preventDefault(), !o.disabled && (i == null || i(o.value), k == null || k(o.value, o), M(!1), D == null || D(!1));
|
|
266
266
|
},
|
|
267
|
-
children: /* @__PURE__ */ t(
|
|
267
|
+
children: /* @__PURE__ */ t(fe, { text: m, keyword: e })
|
|
268
268
|
},
|
|
269
269
|
o.value
|
|
270
270
|
);
|
|
@@ -288,29 +288,29 @@ function Ye({
|
|
|
288
288
|
)
|
|
289
289
|
] })
|
|
290
290
|
] }),
|
|
291
|
-
/* @__PURE__ */ t("button", { className: "sku-input-card__delete", onClick:
|
|
291
|
+
/* @__PURE__ */ t("button", { className: "sku-input-card__delete", onClick: f, children: /* @__PURE__ */ t(pe, {}) })
|
|
292
292
|
] }),
|
|
293
293
|
r && /* @__PURE__ */ l("div", { className: "sku-input-card__body", children: [
|
|
294
294
|
/* @__PURE__ */ t(
|
|
295
295
|
"input",
|
|
296
296
|
{
|
|
297
|
-
ref:
|
|
297
|
+
ref: _,
|
|
298
298
|
type: "file",
|
|
299
299
|
accept: "image/jpeg,image/png,image/webp",
|
|
300
300
|
className: "sku-input-card__file-input",
|
|
301
|
-
onChange:
|
|
301
|
+
onChange: it
|
|
302
302
|
}
|
|
303
303
|
),
|
|
304
|
-
|
|
304
|
+
et ? /* @__PURE__ */ t("div", { className: "sku-input-card__loading", children: /* @__PURE__ */ t("img", { src: ae, alt: "上传中", className: "sku-input-card__loading-img" }) }) : x[0] ? (
|
|
305
305
|
/* Single image preview */
|
|
306
306
|
/* @__PURE__ */ l("div", { className: "sku-input-card__image-item", children: [
|
|
307
|
-
/* @__PURE__ */ t("img", { src:
|
|
307
|
+
/* @__PURE__ */ t("img", { src: x[0], alt: "图片", className: "sku-input-card__image-thumb" }),
|
|
308
308
|
/* @__PURE__ */ l("div", { className: "sku-input-card__image-overlay", children: [
|
|
309
309
|
/* @__PURE__ */ t(
|
|
310
310
|
"button",
|
|
311
311
|
{
|
|
312
312
|
className: "sku-input-card__image-action-btn",
|
|
313
|
-
onClick: () =>
|
|
313
|
+
onClick: () => g == null ? void 0 : g(x[0]),
|
|
314
314
|
children: /* @__PURE__ */ t(he, {})
|
|
315
315
|
}
|
|
316
316
|
),
|
|
@@ -318,17 +318,17 @@ function Ye({
|
|
|
318
318
|
"button",
|
|
319
319
|
{
|
|
320
320
|
className: "sku-input-card__image-action-btn",
|
|
321
|
-
onClick: () =>
|
|
321
|
+
onClick: () => h == null ? void 0 : h(x[0]),
|
|
322
322
|
children: /* @__PURE__ */ t(Ae, {})
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
] })
|
|
326
326
|
] })
|
|
327
|
-
) :
|
|
327
|
+
) : E ? (
|
|
328
328
|
/* Upload options — local upload / associate image */
|
|
329
|
-
/* @__PURE__ */ t("div", { className: "sku-input-card__upload-options", children: /* @__PURE__ */ l("div", { ref:
|
|
330
|
-
/* @__PURE__ */ t("button", { className: "sku-input-card__upload-opt-btn", onClick: lt, children:
|
|
331
|
-
/* @__PURE__ */ t("button", { className: "sku-input-card__upload-opt-btn", onClick:
|
|
329
|
+
/* @__PURE__ */ t("div", { className: "sku-input-card__upload-options", children: /* @__PURE__ */ l("div", { ref: $, className: "sku-input-card__upload-options-box", children: [
|
|
330
|
+
/* @__PURE__ */ t("button", { className: "sku-input-card__upload-opt-btn", onClick: lt, children: U }),
|
|
331
|
+
/* @__PURE__ */ t("button", { className: "sku-input-card__upload-opt-btn", onClick: A, children: V })
|
|
332
332
|
] }) })
|
|
333
333
|
) : (
|
|
334
334
|
/* Large add button — fills the body */
|
|
@@ -336,7 +336,7 @@ function Ye({
|
|
|
336
336
|
"button",
|
|
337
337
|
{
|
|
338
338
|
className: "sku-input-card__add-btn",
|
|
339
|
-
onClick: () =>
|
|
339
|
+
onClick: () => j(!0),
|
|
340
340
|
children: /* @__PURE__ */ t(de, {})
|
|
341
341
|
}
|
|
342
342
|
)
|
|
@@ -345,7 +345,7 @@ function Ye({
|
|
|
345
345
|
] })
|
|
346
346
|
] });
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function Ce() {
|
|
349
349
|
return /* @__PURE__ */ t("svg", { width: "8", height: "4.5", viewBox: "315 270 365 185", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
350
350
|
"path",
|
|
351
351
|
{
|
|
@@ -369,7 +369,7 @@ function ye() {
|
|
|
369
369
|
/* @__PURE__ */ t("path", { d: "M5 8h6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
370
370
|
] });
|
|
371
371
|
}
|
|
372
|
-
const qe =
|
|
372
|
+
const qe = It(
|
|
373
373
|
function({
|
|
374
374
|
type: e = "input",
|
|
375
375
|
mode: i = "single",
|
|
@@ -378,75 +378,75 @@ const qe = vt(
|
|
|
378
378
|
value: s = "",
|
|
379
379
|
onChange: r,
|
|
380
380
|
label: p,
|
|
381
|
-
required:
|
|
382
|
-
placeholder:
|
|
383
|
-
maxLength:
|
|
381
|
+
required: f,
|
|
382
|
+
placeholder: g,
|
|
383
|
+
maxLength: h,
|
|
384
384
|
showCount: a,
|
|
385
|
-
error:
|
|
386
|
-
errorMessage:
|
|
387
|
-
disabled:
|
|
388
|
-
leftIcon:
|
|
389
|
-
rightIcon:
|
|
390
|
-
langToggle:
|
|
391
|
-
translating:
|
|
392
|
-
translated:
|
|
393
|
-
onBlur:
|
|
394
|
-
min:
|
|
395
|
-
max:
|
|
396
|
-
step:
|
|
397
|
-
labels:
|
|
398
|
-
id:
|
|
399
|
-
className:
|
|
400
|
-
style:
|
|
401
|
-
},
|
|
402
|
-
|
|
403
|
-
function
|
|
404
|
-
let
|
|
405
|
-
|
|
385
|
+
error: y = !1,
|
|
386
|
+
errorMessage: b,
|
|
387
|
+
disabled: I,
|
|
388
|
+
leftIcon: G,
|
|
389
|
+
rightIcon: q,
|
|
390
|
+
langToggle: X,
|
|
391
|
+
translating: S = !1,
|
|
392
|
+
translated: N = !1,
|
|
393
|
+
onBlur: k,
|
|
394
|
+
min: P,
|
|
395
|
+
max: T,
|
|
396
|
+
step: D = 1,
|
|
397
|
+
labels: W,
|
|
398
|
+
id: U,
|
|
399
|
+
className: V,
|
|
400
|
+
style: _
|
|
401
|
+
}, $) {
|
|
402
|
+
W == null || W.zh, W == null || W.en;
|
|
403
|
+
function Z(M) {
|
|
404
|
+
let O = (parseFloat(s) || 0) + M;
|
|
405
|
+
P !== void 0 && (O = Math.max(P, O)), T !== void 0 && (O = Math.min(T, O)), r == null || r(String(O));
|
|
406
406
|
}
|
|
407
|
-
const w = e === "textarea" && !!a,
|
|
407
|
+
const w = e === "textarea" && !!a, v = w || i === "bilingual" || S || N, C = h ? `${s.length}/${h}` : `${s.length}`, E = y && !!b && s.length > 0, j = [
|
|
408
408
|
"bu-input__box",
|
|
409
409
|
(e === "input" || e === "number") && "bu-input__box--single",
|
|
410
410
|
e === "number" && "bu-input__box--number",
|
|
411
411
|
e === "textarea" && "bu-input__box--textarea",
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
!!
|
|
415
|
-
!!
|
|
416
|
-
].filter(Boolean).join(" "),
|
|
417
|
-
return /* @__PURE__ */ l("div", { className: ["bu-input",
|
|
418
|
-
p && /* @__PURE__ */ l("label", { className: "bu-input__label", htmlFor:
|
|
419
|
-
|
|
412
|
+
y && "bu-input__box--error",
|
|
413
|
+
I && "bu-input__box--disabled",
|
|
414
|
+
!!G && "bu-input__box--has-left",
|
|
415
|
+
!!q && "bu-input__box--has-right"
|
|
416
|
+
].filter(Boolean).join(" "), L = `bu-input__field bu-input__field--${e}`;
|
|
417
|
+
return /* @__PURE__ */ l("div", { className: ["bu-input", V].filter(Boolean).join(" "), style: _, children: [
|
|
418
|
+
p && /* @__PURE__ */ l("label", { className: "bu-input__label", htmlFor: U, children: [
|
|
419
|
+
f && /* @__PURE__ */ t("span", { className: "bu-input__required", children: "*" }),
|
|
420
420
|
p
|
|
421
421
|
] }),
|
|
422
422
|
/* @__PURE__ */ l("div", { className: "bu-input__row", children: [
|
|
423
|
-
|
|
424
|
-
/* @__PURE__ */ l("div", { className:
|
|
423
|
+
G && /* @__PURE__ */ t("span", { className: "bu-input__icon bu-input__icon--left", children: G }),
|
|
424
|
+
/* @__PURE__ */ l("div", { className: j, children: [
|
|
425
425
|
e === "textarea" ? /* @__PURE__ */ t(
|
|
426
426
|
"textarea",
|
|
427
427
|
{
|
|
428
|
-
ref:
|
|
429
|
-
id:
|
|
430
|
-
className:
|
|
428
|
+
ref: $,
|
|
429
|
+
id: U,
|
|
430
|
+
className: L,
|
|
431
431
|
value: s,
|
|
432
|
-
onChange: (
|
|
433
|
-
onBlur:
|
|
434
|
-
placeholder:
|
|
435
|
-
maxLength:
|
|
436
|
-
disabled:
|
|
432
|
+
onChange: (M) => r == null ? void 0 : r(M.target.value),
|
|
433
|
+
onBlur: k,
|
|
434
|
+
placeholder: g,
|
|
435
|
+
maxLength: h,
|
|
436
|
+
disabled: I
|
|
437
437
|
}
|
|
438
438
|
) : e === "number" ? /* @__PURE__ */ l(ht, { children: [
|
|
439
439
|
/* @__PURE__ */ t(
|
|
440
440
|
"input",
|
|
441
441
|
{
|
|
442
|
-
ref:
|
|
443
|
-
id:
|
|
444
|
-
className:
|
|
442
|
+
ref: $,
|
|
443
|
+
id: U,
|
|
444
|
+
className: L,
|
|
445
445
|
value: s,
|
|
446
|
-
onChange: (
|
|
447
|
-
onBlur:
|
|
448
|
-
placeholder:
|
|
449
|
-
disabled:
|
|
446
|
+
onChange: (M) => r == null ? void 0 : r(M.target.value),
|
|
447
|
+
onBlur: k,
|
|
448
|
+
placeholder: g,
|
|
449
|
+
disabled: I,
|
|
450
450
|
inputMode: "numeric"
|
|
451
451
|
}
|
|
452
452
|
),
|
|
@@ -456,11 +456,11 @@ const qe = vt(
|
|
|
456
456
|
{
|
|
457
457
|
type: "button",
|
|
458
458
|
className: "bu-input__stepper-btn bu-input__stepper-btn--up",
|
|
459
|
-
onMouseDown: (
|
|
460
|
-
onClick: () =>
|
|
461
|
-
disabled:
|
|
459
|
+
onMouseDown: (M) => M.preventDefault(),
|
|
460
|
+
onClick: () => Z(D),
|
|
461
|
+
disabled: I || T !== void 0 && parseFloat(s || "0") >= T,
|
|
462
462
|
tabIndex: -1,
|
|
463
|
-
children: /* @__PURE__ */ t(
|
|
463
|
+
children: /* @__PURE__ */ t(Ce, {})
|
|
464
464
|
}
|
|
465
465
|
),
|
|
466
466
|
/* @__PURE__ */ t(
|
|
@@ -468,9 +468,9 @@ const qe = vt(
|
|
|
468
468
|
{
|
|
469
469
|
type: "button",
|
|
470
470
|
className: "bu-input__stepper-btn bu-input__stepper-btn--down",
|
|
471
|
-
onMouseDown: (
|
|
472
|
-
onClick: () =>
|
|
473
|
-
disabled:
|
|
471
|
+
onMouseDown: (M) => M.preventDefault(),
|
|
472
|
+
onClick: () => Z(-D),
|
|
473
|
+
disabled: I || P !== void 0 && parseFloat(s || "0") <= P,
|
|
474
474
|
tabIndex: -1,
|
|
475
475
|
children: /* @__PURE__ */ t(we, {})
|
|
476
476
|
}
|
|
@@ -479,35 +479,35 @@ const qe = vt(
|
|
|
479
479
|
] }) : /* @__PURE__ */ t(
|
|
480
480
|
"input",
|
|
481
481
|
{
|
|
482
|
-
ref:
|
|
483
|
-
id:
|
|
484
|
-
className:
|
|
482
|
+
ref: $,
|
|
483
|
+
id: U,
|
|
484
|
+
className: L,
|
|
485
485
|
value: s,
|
|
486
|
-
onChange: (
|
|
487
|
-
onBlur:
|
|
488
|
-
placeholder:
|
|
489
|
-
maxLength:
|
|
490
|
-
disabled:
|
|
486
|
+
onChange: (M) => r == null ? void 0 : r(M.target.value),
|
|
487
|
+
onBlur: k,
|
|
488
|
+
placeholder: g,
|
|
489
|
+
maxLength: h,
|
|
490
|
+
disabled: I
|
|
491
491
|
}
|
|
492
492
|
),
|
|
493
|
-
|
|
494
|
-
w && /* @__PURE__ */ t("span", { className: "bu-input__count", children:
|
|
495
|
-
|
|
493
|
+
v && /* @__PURE__ */ l("div", { className: `bu-input__footer${e === "textarea" ? " bu-input__footer--bottom" : ""}`, children: [
|
|
494
|
+
w && /* @__PURE__ */ t("span", { className: "bu-input__count", children: C }),
|
|
495
|
+
S && /* @__PURE__ */ l("span", { className: "bu-input__translating", children: [
|
|
496
496
|
/* @__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" }) }),
|
|
497
497
|
"翻译中…"
|
|
498
498
|
] }),
|
|
499
|
-
|
|
499
|
+
N && !S && /* @__PURE__ */ l("span", { className: "bu-input__translated", children: [
|
|
500
500
|
/* @__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" }) }),
|
|
501
501
|
"翻译完成"
|
|
502
502
|
] }),
|
|
503
|
-
i === "bilingual" && !
|
|
503
|
+
i === "bilingual" && !S && !N && (X ?? /* @__PURE__ */ t("div", { className: "bu-input__lang-toggle" }))
|
|
504
504
|
] })
|
|
505
505
|
] }),
|
|
506
|
-
|
|
506
|
+
q && /* @__PURE__ */ t("span", { className: "bu-input__icon bu-input__icon--right", children: q })
|
|
507
507
|
] }),
|
|
508
|
-
|
|
508
|
+
E && /* @__PURE__ */ l("div", { className: "bu-input__error-msg", children: [
|
|
509
509
|
/* @__PURE__ */ t(ye, {}),
|
|
510
|
-
|
|
510
|
+
b
|
|
511
511
|
] })
|
|
512
512
|
] });
|
|
513
513
|
}
|
|
@@ -515,7 +515,7 @@ const qe = vt(
|
|
|
515
515
|
function ve() {
|
|
516
516
|
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" }) });
|
|
517
517
|
}
|
|
518
|
-
const Fe =
|
|
518
|
+
const Fe = It(
|
|
519
519
|
function({
|
|
520
520
|
mode: e = "single",
|
|
521
521
|
activeLang: i = "zh",
|
|
@@ -524,45 +524,45 @@ const Fe = vt(
|
|
|
524
524
|
onChange: s,
|
|
525
525
|
placeholder: r,
|
|
526
526
|
maxLength: p,
|
|
527
|
-
error:
|
|
528
|
-
disabled:
|
|
529
|
-
onDelete:
|
|
527
|
+
error: f = !1,
|
|
528
|
+
disabled: g,
|
|
529
|
+
onDelete: h,
|
|
530
530
|
labels: a,
|
|
531
|
-
id:
|
|
532
|
-
className:
|
|
533
|
-
style:
|
|
534
|
-
},
|
|
535
|
-
const
|
|
531
|
+
id: y,
|
|
532
|
+
className: b,
|
|
533
|
+
style: I
|
|
534
|
+
}, G) {
|
|
535
|
+
const q = (a == null ? void 0 : a.zh) ?? "中文", X = (a == null ? void 0 : a.en) ?? "EN", S = e === "bilingual", N = !!h, k = [
|
|
536
536
|
"bu-eib__box",
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
!
|
|
540
|
-
|
|
541
|
-
|
|
537
|
+
S && N && "bu-eib__box--actions-both",
|
|
538
|
+
S && !N && "bu-eib__box--actions-toggle",
|
|
539
|
+
!S && N && "bu-eib__box--actions-delete",
|
|
540
|
+
f && "bu-eib__box--error",
|
|
541
|
+
g && "bu-eib__box--disabled"
|
|
542
542
|
].filter(Boolean).join(" ");
|
|
543
|
-
return /* @__PURE__ */ t("div", { className: ["bu-eib",
|
|
543
|
+
return /* @__PURE__ */ t("div", { className: ["bu-eib", b].filter(Boolean).join(" "), style: I, children: /* @__PURE__ */ l("div", { className: k, children: [
|
|
544
544
|
/* @__PURE__ */ t(
|
|
545
545
|
"input",
|
|
546
546
|
{
|
|
547
|
-
ref:
|
|
548
|
-
id:
|
|
547
|
+
ref: G,
|
|
548
|
+
id: y,
|
|
549
549
|
className: "bu-eib__field",
|
|
550
550
|
value: u,
|
|
551
|
-
onChange: (
|
|
551
|
+
onChange: (P) => s == null ? void 0 : s(P.target.value),
|
|
552
552
|
placeholder: r,
|
|
553
553
|
maxLength: p,
|
|
554
|
-
disabled:
|
|
554
|
+
disabled: g
|
|
555
555
|
}
|
|
556
556
|
),
|
|
557
|
-
(
|
|
558
|
-
|
|
557
|
+
(S || N) && /* @__PURE__ */ l("div", { className: "bu-eib__actions", children: [
|
|
558
|
+
S && /* @__PURE__ */ l("div", { className: "bu-eib__lang-toggle", children: [
|
|
559
559
|
/* @__PURE__ */ t(
|
|
560
560
|
"button",
|
|
561
561
|
{
|
|
562
562
|
type: "button",
|
|
563
563
|
className: `bu-eib__lang-btn${i === "zh" ? " bu-eib__lang-btn--active" : ""}`,
|
|
564
564
|
onClick: () => c == null ? void 0 : c("zh"),
|
|
565
|
-
children:
|
|
565
|
+
children: q
|
|
566
566
|
}
|
|
567
567
|
),
|
|
568
568
|
/* @__PURE__ */ t(
|
|
@@ -571,11 +571,11 @@ const Fe = vt(
|
|
|
571
571
|
type: "button",
|
|
572
572
|
className: `bu-eib__lang-btn${i === "en" ? " bu-eib__lang-btn--active" : ""}`,
|
|
573
573
|
onClick: () => c == null ? void 0 : c("en"),
|
|
574
|
-
children:
|
|
574
|
+
children: X
|
|
575
575
|
}
|
|
576
576
|
)
|
|
577
577
|
] }),
|
|
578
|
-
|
|
578
|
+
N && /* @__PURE__ */ t("button", { type: "button", className: "bu-eib__delete", onClick: h, children: /* @__PURE__ */ t(ve, {}) })
|
|
579
579
|
] })
|
|
580
580
|
] }) });
|
|
581
581
|
}
|
|
@@ -589,64 +589,64 @@ function We({
|
|
|
589
589
|
cancelText: s = "取消",
|
|
590
590
|
onOk: r,
|
|
591
591
|
onCancel: p,
|
|
592
|
-
onClose:
|
|
593
|
-
activeLang:
|
|
594
|
-
onLangChange:
|
|
592
|
+
onClose: f,
|
|
593
|
+
activeLang: g = "zh",
|
|
594
|
+
onLangChange: h,
|
|
595
595
|
labels: a,
|
|
596
|
-
hint:
|
|
597
|
-
confirmLoading:
|
|
598
|
-
width:
|
|
599
|
-
className:
|
|
600
|
-
style:
|
|
596
|
+
hint: y,
|
|
597
|
+
confirmLoading: b = !1,
|
|
598
|
+
width: I,
|
|
599
|
+
className: G,
|
|
600
|
+
style: q
|
|
601
601
|
}) {
|
|
602
|
-
const
|
|
602
|
+
const X = (a == null ? void 0 : a.zh) ?? "中文", S = (a == null ? void 0 : a.en) ?? "EN";
|
|
603
603
|
if (!n) return null;
|
|
604
|
-
const
|
|
605
|
-
return /* @__PURE__ */ t("div", { className: ["bu-modal__overlay",
|
|
604
|
+
const N = i === "bilingual", k = i === "single", P = I != null ? { width: I, ...q } : q;
|
|
605
|
+
return /* @__PURE__ */ t("div", { className: ["bu-modal__overlay", G].filter(Boolean).join(" "), onClick: f, children: /* @__PURE__ */ l(
|
|
606
606
|
"div",
|
|
607
607
|
{
|
|
608
608
|
className: "bu-modal__container",
|
|
609
|
-
style:
|
|
610
|
-
onClick: (
|
|
609
|
+
style: P,
|
|
610
|
+
onClick: (T) => T.stopPropagation(),
|
|
611
611
|
children: [
|
|
612
612
|
/* @__PURE__ */ l("div", { className: "bu-modal__header", children: [
|
|
613
613
|
/* @__PURE__ */ t("p", { className: "bu-modal__title", children: e }),
|
|
614
|
-
|
|
614
|
+
N && /* @__PURE__ */ l("div", { className: "bu-modal__lang-toggle", children: [
|
|
615
615
|
/* @__PURE__ */ t(
|
|
616
616
|
"button",
|
|
617
617
|
{
|
|
618
618
|
type: "button",
|
|
619
|
-
className: `bu-modal__lang-btn${
|
|
620
|
-
onClick: () =>
|
|
621
|
-
children:
|
|
619
|
+
className: `bu-modal__lang-btn${g === "zh" ? " bu-modal__lang-btn--active" : ""}`,
|
|
620
|
+
onClick: () => h == null ? void 0 : h("zh"),
|
|
621
|
+
children: X
|
|
622
622
|
}
|
|
623
623
|
),
|
|
624
624
|
/* @__PURE__ */ t(
|
|
625
625
|
"button",
|
|
626
626
|
{
|
|
627
627
|
type: "button",
|
|
628
|
-
className: `bu-modal__lang-btn${
|
|
629
|
-
onClick: () =>
|
|
630
|
-
children:
|
|
628
|
+
className: `bu-modal__lang-btn${g === "en" ? " bu-modal__lang-btn--active" : ""}`,
|
|
629
|
+
onClick: () => h == null ? void 0 : h("en"),
|
|
630
|
+
children: S
|
|
631
631
|
}
|
|
632
632
|
)
|
|
633
633
|
] }),
|
|
634
|
-
/* @__PURE__ */ t("button", { type: "button", className: "bu-modal__close", onClick:
|
|
634
|
+
/* @__PURE__ */ t("button", { type: "button", className: "bu-modal__close", onClick: f, 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" }) }) })
|
|
635
635
|
] }),
|
|
636
636
|
/* @__PURE__ */ t("div", { className: "bu-modal__body", children: c }),
|
|
637
637
|
/* @__PURE__ */ l("div", { className: "bu-modal__footer", children: [
|
|
638
|
-
|
|
638
|
+
y && /* @__PURE__ */ t("p", { className: "bu-modal__hint", children: y }),
|
|
639
639
|
/* @__PURE__ */ l("div", { className: "bu-modal__btn-row", children: [
|
|
640
|
-
!
|
|
640
|
+
!k && /* @__PURE__ */ t("button", { type: "button", className: "bu-modal__btn-cancel", onClick: p ?? f, children: s }),
|
|
641
641
|
/* @__PURE__ */ l(
|
|
642
642
|
"button",
|
|
643
643
|
{
|
|
644
644
|
type: "button",
|
|
645
|
-
className: ["bu-modal__btn-ok",
|
|
646
|
-
disabled:
|
|
647
|
-
onClick:
|
|
645
|
+
className: ["bu-modal__btn-ok", b ? "bu-modal__btn-ok--loading" : ""].filter(Boolean).join(" "),
|
|
646
|
+
disabled: b,
|
|
647
|
+
onClick: b ? void 0 : r,
|
|
648
648
|
children: [
|
|
649
|
-
|
|
649
|
+
b && /* @__PURE__ */ t("span", { className: "bu-modal__btn-ok-spinner" }),
|
|
650
650
|
u
|
|
651
651
|
]
|
|
652
652
|
}
|
|
@@ -670,97 +670,97 @@ function Ze({
|
|
|
670
670
|
onManageField: s,
|
|
671
671
|
multiple: r = !0,
|
|
672
672
|
showSearch: p = !0,
|
|
673
|
-
showSort:
|
|
674
|
-
addButtonText:
|
|
675
|
-
onAdd:
|
|
673
|
+
showSort: f = !0,
|
|
674
|
+
addButtonText: g,
|
|
675
|
+
onAdd: h,
|
|
676
676
|
labels: a,
|
|
677
|
-
className:
|
|
678
|
-
style:
|
|
679
|
-
getPopupContainer:
|
|
677
|
+
className: y,
|
|
678
|
+
style: b,
|
|
679
|
+
getPopupContainer: I
|
|
680
680
|
}) {
|
|
681
|
-
const
|
|
682
|
-
if (!
|
|
683
|
-
const o =
|
|
684
|
-
|
|
681
|
+
const G = (a == null ? void 0 : a.searchPlaceholder) ?? "搜索", q = (a == null ? void 0 : a.sortDefault) ?? "默认顺序", X = (a == null ? void 0 : a.sortAsc) ?? "名称A-Z", S = (a == null ? void 0 : a.sortDesc) ?? "名称Z-A", N = (a == null ? void 0 : a.noMatchText) ?? "暂无选项", k = (a == null ? void 0 : a.manageFieldPre) ?? "请前往", P = (a == null ? void 0 : a.manageFieldLink) ?? "管理字段", T = (a == null ? void 0 : a.manageFieldPost) ?? "添加", [D, W] = H(!1), [U, V] = H(""), [_, $] = H("none"), [Z, w] = H(!1), v = R(null), C = R(null), E = R(null), [j, L] = H({ top: 0, left: 0, width: 0 }), M = ct(() => {
|
|
682
|
+
if (!v.current) return;
|
|
683
|
+
const o = v.current.getBoundingClientRect();
|
|
684
|
+
L({
|
|
685
685
|
top: o.bottom + 4,
|
|
686
686
|
left: o.left,
|
|
687
687
|
width: o.width
|
|
688
688
|
});
|
|
689
689
|
}, []);
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
}, [
|
|
693
|
-
if (!
|
|
694
|
-
const o = (
|
|
695
|
-
var
|
|
696
|
-
const
|
|
697
|
-
(
|
|
690
|
+
vt(() => {
|
|
691
|
+
D && M();
|
|
692
|
+
}, [D, M]), ot(() => {
|
|
693
|
+
if (!D) return;
|
|
694
|
+
const o = (m) => {
|
|
695
|
+
var Y, tt;
|
|
696
|
+
const K = m.target;
|
|
697
|
+
(Y = E.current) != null && Y.contains(K) || (tt = v.current) != null && tt.contains(K) || it();
|
|
698
698
|
};
|
|
699
|
-
return document.addEventListener("mousedown", o), window.addEventListener("scroll",
|
|
700
|
-
document.removeEventListener("mousedown", o), window.removeEventListener("scroll",
|
|
699
|
+
return document.addEventListener("mousedown", o), window.addEventListener("scroll", M, !0), window.addEventListener("resize", M), () => {
|
|
700
|
+
document.removeEventListener("mousedown", o), window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M);
|
|
701
701
|
};
|
|
702
|
-
}, [
|
|
703
|
-
if (!
|
|
704
|
-
const o = (
|
|
705
|
-
|
|
702
|
+
}, [D, M]), ot(() => {
|
|
703
|
+
if (!Z) return;
|
|
704
|
+
const o = (m) => {
|
|
705
|
+
C.current && !C.current.contains(m.target) && w(!1);
|
|
706
706
|
};
|
|
707
707
|
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
708
|
-
}, [
|
|
709
|
-
const
|
|
710
|
-
onMouseDown: (
|
|
711
|
-
const
|
|
712
|
-
|
|
708
|
+
}, [Z]);
|
|
709
|
+
const et = R(null), O = R(null), F = R({ dragging: !1, startX: 0, scrollLeft: 0, target: null }), nt = ct((o) => ({
|
|
710
|
+
onMouseDown: (m) => {
|
|
711
|
+
const K = o.current;
|
|
712
|
+
K && (F.current = { dragging: !0, startX: m.clientX, scrollLeft: K.scrollLeft, target: K });
|
|
713
713
|
},
|
|
714
|
-
onMouseMove: (
|
|
715
|
-
const { dragging:
|
|
716
|
-
!
|
|
714
|
+
onMouseMove: (m) => {
|
|
715
|
+
const { dragging: K, startX: Y, scrollLeft: tt, target: At } = F.current;
|
|
716
|
+
!K || !At || (m.preventDefault(), At.scrollLeft = tt - (m.clientX - Y));
|
|
717
717
|
},
|
|
718
718
|
onMouseUp: () => {
|
|
719
|
-
|
|
719
|
+
F.current.dragging = !1;
|
|
720
720
|
},
|
|
721
721
|
onMouseLeave: () => {
|
|
722
|
-
|
|
722
|
+
F.current.dragging = !1;
|
|
723
723
|
}
|
|
724
724
|
}), []);
|
|
725
725
|
function st(o) {
|
|
726
726
|
if (!r) {
|
|
727
|
-
i == null || i(e.includes(o) ? [] : [o]), e.includes(o) ||
|
|
727
|
+
i == null || i(e.includes(o) ? [] : [o]), e.includes(o) || it();
|
|
728
728
|
return;
|
|
729
729
|
}
|
|
730
|
-
const
|
|
731
|
-
i == null || i(
|
|
730
|
+
const m = e.includes(o) ? e.filter((K) => K !== o) : [...e, o];
|
|
731
|
+
i == null || i(m);
|
|
732
732
|
}
|
|
733
|
-
function
|
|
734
|
-
i == null || i(e.filter((
|
|
733
|
+
function x(o) {
|
|
734
|
+
i == null || i(e.filter((m) => m !== o));
|
|
735
735
|
}
|
|
736
|
-
function
|
|
737
|
-
|
|
736
|
+
function it() {
|
|
737
|
+
W(!1), V(""), $("none");
|
|
738
738
|
}
|
|
739
739
|
function lt(o) {
|
|
740
|
-
|
|
740
|
+
$(o), w(!1);
|
|
741
741
|
}
|
|
742
|
-
const
|
|
743
|
-
let o = n.filter((
|
|
744
|
-
const
|
|
745
|
-
return
|
|
746
|
-
}, [n,
|
|
747
|
-
return /* @__PURE__ */ l("div", { ref:
|
|
748
|
-
!
|
|
749
|
-
|
|
742
|
+
const A = dt(() => {
|
|
743
|
+
let o = n.filter((K) => (K.searchText ?? (typeof K.label == "string" ? K.label : "")).toLowerCase().includes(U.toLowerCase()));
|
|
744
|
+
const m = (K) => K.searchText ?? (typeof K.label == "string" ? K.label : "");
|
|
745
|
+
return _ === "asc" && (o = [...o].sort((K, Y) => m(K).localeCompare(m(Y)))), _ === "desc" && (o = [...o].sort((K, Y) => m(Y).localeCompare(m(K)))), o;
|
|
746
|
+
}, [n, U, _]), J = n.filter((o) => e.includes(o.value)), Q = n.length > 0;
|
|
747
|
+
return /* @__PURE__ */ l("div", { ref: v, className: ["bu-pf", y].filter(Boolean).join(" "), style: b, children: [
|
|
748
|
+
!D && /* @__PURE__ */ l("div", { className: `bu-pf__trigger${J.length > 0 ? " bu-pf__trigger--selected" : ""}`, onClick: () => W(!0), children: [
|
|
749
|
+
J.length > 0 ? /* @__PURE__ */ t(
|
|
750
750
|
"div",
|
|
751
751
|
{
|
|
752
752
|
className: "bu-pf__trigger-tags",
|
|
753
|
-
ref:
|
|
754
|
-
...
|
|
755
|
-
children:
|
|
753
|
+
ref: O,
|
|
754
|
+
...nt(O),
|
|
755
|
+
children: J.map((o) => /* @__PURE__ */ l("span", { className: `bu-pf__tag${r ? "" : " bu-pf__tag--single"}`, children: [
|
|
756
756
|
/* @__PURE__ */ t("span", { className: "bu-pf__tag-text", children: o.label }),
|
|
757
757
|
/* @__PURE__ */ t(
|
|
758
758
|
"button",
|
|
759
759
|
{
|
|
760
760
|
type: "button",
|
|
761
761
|
className: "bu-pf__tag-close",
|
|
762
|
-
onClick: (
|
|
763
|
-
|
|
762
|
+
onClick: (m) => {
|
|
763
|
+
m.stopPropagation(), x(o.value);
|
|
764
764
|
},
|
|
765
765
|
children: /* @__PURE__ */ t(Lt, { size: 12 })
|
|
766
766
|
}
|
|
@@ -770,83 +770,83 @@ function Ze({
|
|
|
770
770
|
) : /* @__PURE__ */ t("span", { className: "bu-pf__placeholder", children: c }),
|
|
771
771
|
/* @__PURE__ */ t("span", { className: "bu-pf__arrow", children: /* @__PURE__ */ t("img", { src: Dt, width: 24, height: 24, alt: "" }) })
|
|
772
772
|
] }),
|
|
773
|
-
|
|
773
|
+
D && /* @__PURE__ */ l(ht, { children: [
|
|
774
774
|
/* @__PURE__ */ t("div", { className: "bu-pf__panel", children: /* @__PURE__ */ l("div", { className: "bu-pf__header", children: [
|
|
775
775
|
/* @__PURE__ */ t(
|
|
776
776
|
"div",
|
|
777
777
|
{
|
|
778
778
|
className: "bu-pf__tags",
|
|
779
|
-
ref:
|
|
780
|
-
...et
|
|
781
|
-
children:
|
|
779
|
+
ref: et,
|
|
780
|
+
...nt(et),
|
|
781
|
+
children: J.length > 0 ? J.map((o) => /* @__PURE__ */ l("span", { className: `bu-pf__tag${r ? "" : " bu-pf__tag--single"}`, children: [
|
|
782
782
|
/* @__PURE__ */ t("span", { className: "bu-pf__tag-text", children: o.label }),
|
|
783
783
|
/* @__PURE__ */ t(
|
|
784
784
|
"button",
|
|
785
785
|
{
|
|
786
786
|
type: "button",
|
|
787
787
|
className: "bu-pf__tag-close",
|
|
788
|
-
onClick: () =>
|
|
788
|
+
onClick: () => x(o.value),
|
|
789
789
|
children: /* @__PURE__ */ t(Lt, { size: 12 })
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] }, o.value)) : /* @__PURE__ */ t("span", { className: "bu-pf__placeholder-inline", children: c })
|
|
793
793
|
}
|
|
794
794
|
),
|
|
795
|
-
/* @__PURE__ */ t("button", { type: "button", className: "bu-pf__close", onClick:
|
|
795
|
+
/* @__PURE__ */ t("button", { type: "button", className: "bu-pf__close", onClick: it, children: /* @__PURE__ */ t("img", { src: Dt, width: 24, height: 24, alt: "" }) })
|
|
796
796
|
] }) }),
|
|
797
797
|
Mt(
|
|
798
|
-
/* @__PURE__ */ t("div", { ref:
|
|
799
|
-
(p ||
|
|
798
|
+
/* @__PURE__ */ t("div", { ref: E, className: "bu-pf__portal", style: { position: "fixed", top: j.top, left: j.left, width: j.width, zIndex: 1050 }, children: /* @__PURE__ */ l("div", { className: "bu-pf__dropdown", children: [
|
|
799
|
+
(p || f) && /* @__PURE__ */ l("div", { className: "bu-pf__toolbar", children: [
|
|
800
800
|
p && /* @__PURE__ */ l("div", { className: "bu-pf__search", children: [
|
|
801
801
|
/* @__PURE__ */ t("span", { className: "bu-pf__search-icon", children: /* @__PURE__ */ t("img", { src: be, width: 20, height: 20, alt: "" }) }),
|
|
802
802
|
/* @__PURE__ */ t(
|
|
803
803
|
"input",
|
|
804
804
|
{
|
|
805
805
|
className: "bu-pf__search-input",
|
|
806
|
-
placeholder:
|
|
807
|
-
value:
|
|
808
|
-
onChange: (o) =>
|
|
806
|
+
placeholder: G,
|
|
807
|
+
value: U,
|
|
808
|
+
onChange: (o) => V(o.target.value)
|
|
809
809
|
}
|
|
810
810
|
)
|
|
811
811
|
] }),
|
|
812
|
-
|
|
812
|
+
f && /* @__PURE__ */ l("div", { ref: C, className: "bu-pf__sort-wrap", children: [
|
|
813
813
|
/* @__PURE__ */ t(
|
|
814
814
|
"button",
|
|
815
815
|
{
|
|
816
816
|
type: "button",
|
|
817
|
-
className: `bu-pf__sort-btn${
|
|
817
|
+
className: `bu-pf__sort-btn${_ !== "none" ? " bu-pf__sort-btn--active" : ""}`,
|
|
818
818
|
onClick: () => w((o) => !o),
|
|
819
819
|
children: /* @__PURE__ */ t("img", { src: me, width: 24, height: 24, alt: "" })
|
|
820
820
|
}
|
|
821
821
|
),
|
|
822
|
-
|
|
823
|
-
{ key: "none", label:
|
|
824
|
-
{ key: "asc", label:
|
|
825
|
-
{ key: "desc", label:
|
|
826
|
-
].map(({ key: o, label:
|
|
822
|
+
Z && /* @__PURE__ */ t("div", { className: "bu-pf__sort-dropdown", children: [
|
|
823
|
+
{ key: "none", label: q },
|
|
824
|
+
{ key: "asc", label: X },
|
|
825
|
+
{ key: "desc", label: S }
|
|
826
|
+
].map(({ key: o, label: m }) => /* @__PURE__ */ t(
|
|
827
827
|
"div",
|
|
828
828
|
{
|
|
829
|
-
className: `bu-pf__sort-option${
|
|
829
|
+
className: `bu-pf__sort-option${_ === o ? " bu-pf__sort-option--active" : ""}`,
|
|
830
830
|
onClick: () => lt(o),
|
|
831
|
-
children:
|
|
831
|
+
children: m
|
|
832
832
|
},
|
|
833
833
|
o
|
|
834
834
|
)) })
|
|
835
835
|
] })
|
|
836
836
|
] }),
|
|
837
|
-
/* @__PURE__ */ t("div", { className: "bu-pf__list", children:
|
|
838
|
-
const
|
|
837
|
+
/* @__PURE__ */ t("div", { className: "bu-pf__list", children: Q && A.length > 0 ? A.map((o) => {
|
|
838
|
+
const m = e.includes(o.value);
|
|
839
839
|
return /* @__PURE__ */ l(
|
|
840
840
|
"div",
|
|
841
841
|
{
|
|
842
|
-
className: `bu-pf__option${r ? " bu-pf__option--multiple" : ""}${
|
|
842
|
+
className: `bu-pf__option${r ? " bu-pf__option--multiple" : ""}${m && !r ? " bu-pf__option--selected" : ""}`,
|
|
843
843
|
onClick: () => st(o.value),
|
|
844
844
|
children: [
|
|
845
845
|
r && /* @__PURE__ */ t(
|
|
846
846
|
"img",
|
|
847
847
|
{
|
|
848
848
|
className: "bu-pf__checkbox-img",
|
|
849
|
-
src:
|
|
849
|
+
src: m ? Me : Ee,
|
|
850
850
|
alt: ""
|
|
851
851
|
}
|
|
852
852
|
),
|
|
@@ -856,17 +856,17 @@ function Ze({
|
|
|
856
856
|
o.value
|
|
857
857
|
);
|
|
858
858
|
}) : /* @__PURE__ */ l("div", { className: "bu-pf__no-match", children: [
|
|
859
|
-
/* @__PURE__ */ t("img", { className: "bu-pf__no-match-img", src: Ie, alt:
|
|
860
|
-
/* @__PURE__ */ t("p", { className: "bu-pf__no-match-text", children:
|
|
859
|
+
/* @__PURE__ */ t("img", { className: "bu-pf__no-match-img", src: Ie, alt: Q ? N : u }),
|
|
860
|
+
/* @__PURE__ */ t("p", { className: "bu-pf__no-match-text", children: Q ? N : u }),
|
|
861
861
|
/* @__PURE__ */ l("p", { className: "bu-pf__no-match-hint", children: [
|
|
862
|
-
|
|
863
|
-
/* @__PURE__ */ t("button", { type: "button", className: "bu-pf__manage-btn", onClick: s, children:
|
|
864
|
-
|
|
862
|
+
k,
|
|
863
|
+
/* @__PURE__ */ t("button", { type: "button", className: "bu-pf__manage-btn", onClick: s, children: P }),
|
|
864
|
+
T
|
|
865
865
|
] })
|
|
866
866
|
] }) }),
|
|
867
|
-
|
|
867
|
+
g && /* @__PURE__ */ t("div", { className: "bu-pf__add-row", onClick: h, children: g })
|
|
868
868
|
] }) }),
|
|
869
|
-
(
|
|
869
|
+
(I == null ? void 0 : I()) ?? document.body
|
|
870
870
|
)
|
|
871
871
|
] })
|
|
872
872
|
] });
|
|
@@ -878,33 +878,33 @@ function St({
|
|
|
878
878
|
placement: c = "top",
|
|
879
879
|
getPopupContainer: u
|
|
880
880
|
}) {
|
|
881
|
-
const [s, r] =
|
|
881
|
+
const [s, r] = H(!1), p = R(null), f = R(null), [g, h] = H(null);
|
|
882
882
|
function a() {
|
|
883
|
-
var
|
|
884
|
-
const
|
|
885
|
-
|
|
883
|
+
var b;
|
|
884
|
+
const y = f.current;
|
|
885
|
+
y && y.scrollWidth > y.offsetWidth && (h(((b = p.current) == null ? void 0 : b.getBoundingClientRect()) ?? null), r(!0));
|
|
886
886
|
}
|
|
887
887
|
return /* @__PURE__ */ l(Ht, { ref: p, style: i, children: [
|
|
888
888
|
/* @__PURE__ */ t(
|
|
889
889
|
"span",
|
|
890
890
|
{
|
|
891
|
-
ref:
|
|
891
|
+
ref: f,
|
|
892
892
|
className: e,
|
|
893
893
|
onMouseEnter: a,
|
|
894
894
|
onMouseLeave: () => r(!1),
|
|
895
895
|
children: n
|
|
896
896
|
}
|
|
897
897
|
),
|
|
898
|
-
s &&
|
|
898
|
+
s && g && Mt(
|
|
899
899
|
/* @__PURE__ */ t(
|
|
900
900
|
"span",
|
|
901
901
|
{
|
|
902
902
|
style: {
|
|
903
903
|
position: "fixed",
|
|
904
|
-
top:
|
|
905
|
-
left:
|
|
906
|
-
width:
|
|
907
|
-
height:
|
|
904
|
+
top: g.top,
|
|
905
|
+
left: g.left,
|
|
906
|
+
width: g.width,
|
|
907
|
+
height: g.height,
|
|
908
908
|
display: "block",
|
|
909
909
|
pointerEvents: "none",
|
|
910
910
|
zIndex: 9999999999
|
|
@@ -917,7 +917,7 @@ function St({
|
|
|
917
917
|
] });
|
|
918
918
|
}
|
|
919
919
|
function Ke() {
|
|
920
|
-
return /* @__PURE__ */ t("svg", {
|
|
920
|
+
return /* @__PURE__ */ t("svg", { 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" }) });
|
|
921
921
|
}
|
|
922
922
|
function ze() {
|
|
923
923
|
return (
|
|
@@ -959,69 +959,86 @@ function Xe({
|
|
|
959
959
|
maxVisible: s = 6,
|
|
960
960
|
className: r,
|
|
961
961
|
style: p,
|
|
962
|
-
getPopupContainer:
|
|
963
|
-
dropdownStyle:
|
|
962
|
+
getPopupContainer: f,
|
|
963
|
+
dropdownStyle: g
|
|
964
964
|
}) {
|
|
965
|
-
const [
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
965
|
+
const [h, a] = H(!1), [y, b] = H(e), I = R(null), G = R(null), q = R(null), X = R(!1), [S, N] = H({}), [k, P] = H(), T = ct(() => {
|
|
966
|
+
var et;
|
|
967
|
+
if (!I.current) return;
|
|
968
|
+
const w = I.current.getBoundingClientRect();
|
|
969
|
+
let v = 0, C = I.current.parentElement;
|
|
970
|
+
for (; C && C !== document.documentElement; ) {
|
|
971
|
+
const O = parseInt(window.getComputedStyle(C).zIndex, 10);
|
|
972
|
+
if (!isNaN(O) && O > v && (v = O), C.parentElement)
|
|
973
|
+
for (const F of C.parentElement.children) {
|
|
974
|
+
if (F === C || !(F instanceof HTMLElement)) continue;
|
|
975
|
+
const nt = parseInt(window.getComputedStyle(F).zIndex, 10);
|
|
976
|
+
!isNaN(nt) && nt > v && (v = nt);
|
|
976
977
|
}
|
|
977
|
-
|
|
978
|
+
C = C.parentElement;
|
|
978
979
|
}
|
|
979
|
-
|
|
980
|
+
const E = ((et = q.current) == null ? void 0 : et.offsetHeight) ?? 0, j = window.innerHeight - w.bottom, L = w.top, M = E > 0 && j < E + 4 && L > j;
|
|
981
|
+
N({
|
|
980
982
|
position: "fixed",
|
|
981
|
-
top:
|
|
982
|
-
left:
|
|
983
|
-
zIndex:
|
|
984
|
-
...
|
|
983
|
+
top: M ? w.top - E - 4 : w.bottom + 4,
|
|
984
|
+
left: w.left,
|
|
985
|
+
zIndex: v > 0 ? v + 10 : 1100,
|
|
986
|
+
...g
|
|
985
987
|
});
|
|
986
|
-
}, [
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
}, [
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
988
|
+
}, [g]);
|
|
989
|
+
vt(() => {
|
|
990
|
+
h && T();
|
|
991
|
+
}, [h, y, T]), vt(() => {
|
|
992
|
+
const w = h && !X.current;
|
|
993
|
+
if (X.current = h, !h || !q.current) return;
|
|
994
|
+
const v = q.current.querySelectorAll(".bu-category-dropdown__col");
|
|
995
|
+
v.forEach((j) => {
|
|
996
|
+
j.style.width = "";
|
|
997
|
+
});
|
|
998
|
+
let C = 0;
|
|
999
|
+
v.forEach((j) => {
|
|
1000
|
+
j.offsetWidth > C && (C = j.offsetWidth);
|
|
1001
|
+
});
|
|
1002
|
+
const E = w ? C : Math.max(k ?? 0, C);
|
|
1003
|
+
v.forEach((j) => {
|
|
1004
|
+
j.style.width = E ? `${E}px` : "";
|
|
1005
|
+
}), E !== k && P(E || void 0);
|
|
1006
|
+
}, [h, y]), ot(() => {
|
|
1007
|
+
if (!h) return;
|
|
1008
|
+
function w(C) {
|
|
1009
|
+
var j, L;
|
|
1010
|
+
const E = C.target;
|
|
1011
|
+
(j = I.current) != null && j.contains(E) || (L = G.current) != null && L.contains(E) || a(!1);
|
|
995
1012
|
}
|
|
996
|
-
function
|
|
1013
|
+
function v() {
|
|
997
1014
|
a(!1);
|
|
998
1015
|
}
|
|
999
|
-
return document.addEventListener("mousedown",
|
|
1000
|
-
document.removeEventListener("mousedown",
|
|
1016
|
+
return document.addEventListener("mousedown", w), document.addEventListener("scroll", v, !0), window.addEventListener("resize", T), () => {
|
|
1017
|
+
document.removeEventListener("mousedown", w), document.removeEventListener("scroll", v, !0), window.removeEventListener("resize", T);
|
|
1001
1018
|
};
|
|
1002
|
-
}, [
|
|
1003
|
-
const
|
|
1004
|
-
function
|
|
1005
|
-
var
|
|
1006
|
-
if (
|
|
1007
|
-
const
|
|
1008
|
-
if (
|
|
1009
|
-
const
|
|
1010
|
-
i == null || i(
|
|
1019
|
+
}, [h, T]);
|
|
1020
|
+
const D = xt(n, e), W = D.length > 0, U = W ? D.map((w) => w.label).join(" / ") : null, V = je(n, y);
|
|
1021
|
+
function _(w, v) {
|
|
1022
|
+
var E;
|
|
1023
|
+
if (v.disabled) return;
|
|
1024
|
+
const C = y.slice(0, w + 1);
|
|
1025
|
+
if (C[w] = v.value, b(C), !((E = v.children) != null && E.length)) {
|
|
1026
|
+
const j = xt(n, C);
|
|
1027
|
+
i == null || i(C, j), a(!1);
|
|
1011
1028
|
}
|
|
1012
1029
|
}
|
|
1013
|
-
function
|
|
1014
|
-
|
|
1030
|
+
function $() {
|
|
1031
|
+
b(e), a(!0);
|
|
1015
1032
|
}
|
|
1016
|
-
const
|
|
1033
|
+
const Z = [
|
|
1017
1034
|
"bu-category-dropdown__trigger",
|
|
1018
|
-
|
|
1019
|
-
|
|
1035
|
+
h ? "bu-category-dropdown__trigger--open" : "",
|
|
1036
|
+
W ? "bu-category-dropdown__trigger--has-value" : ""
|
|
1020
1037
|
].filter(Boolean).join(" ");
|
|
1021
1038
|
return /* @__PURE__ */ l(
|
|
1022
1039
|
"div",
|
|
1023
1040
|
{
|
|
1024
|
-
ref:
|
|
1041
|
+
ref: I,
|
|
1025
1042
|
className: `bu-category-dropdown${r ? ` ${r}` : ""}`,
|
|
1026
1043
|
style: p,
|
|
1027
1044
|
children: [
|
|
@@ -1029,73 +1046,74 @@ function Xe({
|
|
|
1029
1046
|
"button",
|
|
1030
1047
|
{
|
|
1031
1048
|
type: "button",
|
|
1032
|
-
className:
|
|
1049
|
+
className: Z,
|
|
1033
1050
|
disabled: u,
|
|
1034
|
-
onClick: () =>
|
|
1051
|
+
onClick: () => h ? a(!1) : $(),
|
|
1035
1052
|
children: [
|
|
1036
1053
|
/* @__PURE__ */ t(
|
|
1037
1054
|
St,
|
|
1038
1055
|
{
|
|
1039
|
-
text:
|
|
1040
|
-
spanClassName: `bu-category-dropdown__trigger-label${
|
|
1056
|
+
text: U ?? c,
|
|
1057
|
+
spanClassName: `bu-category-dropdown__trigger-label${W ? "" : " bu-category-dropdown__trigger-label--placeholder"}`,
|
|
1041
1058
|
wrapperStyle: { flex: 1, minWidth: 0, display: "block" },
|
|
1042
|
-
getPopupContainer:
|
|
1059
|
+
getPopupContainer: f
|
|
1043
1060
|
}
|
|
1044
1061
|
),
|
|
1045
|
-
/* @__PURE__ */ t("span", { className: `bu-category-dropdown__trigger-chevron${
|
|
1062
|
+
/* @__PURE__ */ t("span", { className: `bu-category-dropdown__trigger-chevron${h ? " bu-category-dropdown__trigger-chevron--open" : ""}`, children: /* @__PURE__ */ t(Ke, {}) })
|
|
1046
1063
|
]
|
|
1047
1064
|
}
|
|
1048
1065
|
),
|
|
1049
|
-
|
|
1050
|
-
/* @__PURE__ */ t("div", { ref:
|
|
1051
|
-
const
|
|
1066
|
+
h && Mt(
|
|
1067
|
+
/* @__PURE__ */ t("div", { ref: G, style: S, className: "bu-category-dropdown__portal", children: /* @__PURE__ */ t("div", { className: "bu-category-dropdown__panel", ref: q, children: V.map((w, v) => {
|
|
1068
|
+
const C = w.length > s, E = v === V.length - 1, j = [
|
|
1052
1069
|
"bu-category-dropdown__col",
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1070
|
+
v > 0 ? "bu-category-dropdown__col--indent" : "",
|
|
1071
|
+
C ? "bu-category-dropdown__col--scrollable" : "",
|
|
1072
|
+
E && v > 0 ? "bu-category-dropdown__col--last" : ""
|
|
1056
1073
|
].filter(Boolean).join(" ");
|
|
1057
1074
|
return /* @__PURE__ */ l("div", { style: { display: "contents" }, children: [
|
|
1058
|
-
|
|
1075
|
+
v > 0 && /* @__PURE__ */ t("div", { className: "bu-category-dropdown__divider" }),
|
|
1059
1076
|
/* @__PURE__ */ t(
|
|
1060
1077
|
"div",
|
|
1061
1078
|
{
|
|
1062
|
-
className:
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1079
|
+
className: j,
|
|
1080
|
+
style: k ? { width: k } : void 0,
|
|
1081
|
+
onMouseEnter: C ? (L) => L.currentTarget.classList.add("bu-category-dropdown__col--scrollbar-visible") : void 0,
|
|
1082
|
+
onMouseLeave: C ? (L) => L.currentTarget.classList.remove("bu-category-dropdown__col--scrollbar-visible") : void 0,
|
|
1083
|
+
children: w.map((L) => {
|
|
1084
|
+
var F;
|
|
1085
|
+
const M = y[v] === L.value, et = !!((F = L.children) != null && F.length), O = [
|
|
1068
1086
|
"bu-category-dropdown__item",
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1087
|
+
M && et ? "bu-category-dropdown__item--selected-branch" : "",
|
|
1088
|
+
M && !et ? "bu-category-dropdown__item--selected-leaf" : "",
|
|
1089
|
+
L.disabled ? "bu-category-dropdown__item--disabled" : ""
|
|
1072
1090
|
].filter(Boolean).join(" ");
|
|
1073
1091
|
return /* @__PURE__ */ l(
|
|
1074
1092
|
"button",
|
|
1075
1093
|
{
|
|
1076
1094
|
type: "button",
|
|
1077
|
-
className:
|
|
1078
|
-
disabled:
|
|
1079
|
-
onClick: () =>
|
|
1095
|
+
className: O,
|
|
1096
|
+
disabled: L.disabled,
|
|
1097
|
+
onClick: () => _(v, L),
|
|
1080
1098
|
children: [
|
|
1081
1099
|
/* @__PURE__ */ t(
|
|
1082
1100
|
St,
|
|
1083
1101
|
{
|
|
1084
|
-
text:
|
|
1102
|
+
text: L.label,
|
|
1085
1103
|
spanClassName: "bu-category-dropdown__item-label",
|
|
1086
1104
|
wrapperStyle: { flex: 1, minWidth: 0, display: "block" },
|
|
1087
|
-
getPopupContainer:
|
|
1105
|
+
getPopupContainer: f
|
|
1088
1106
|
}
|
|
1089
1107
|
),
|
|
1090
|
-
|
|
1108
|
+
M && et && /* @__PURE__ */ t("span", { className: "bu-category-dropdown__item-arrow", children: /* @__PURE__ */ t(ze, {}) })
|
|
1091
1109
|
]
|
|
1092
1110
|
},
|
|
1093
|
-
|
|
1111
|
+
L.value
|
|
1094
1112
|
);
|
|
1095
1113
|
})
|
|
1096
1114
|
}
|
|
1097
1115
|
)
|
|
1098
|
-
] },
|
|
1116
|
+
] }, v);
|
|
1099
1117
|
}) }) }),
|
|
1100
1118
|
document.body
|
|
1101
1119
|
)
|
|
@@ -1112,97 +1130,97 @@ const Ve = (n) => {
|
|
|
1112
1130
|
total: s = 0,
|
|
1113
1131
|
onChange: r,
|
|
1114
1132
|
onShowSizeChange: p,
|
|
1115
|
-
showSizeChanger:
|
|
1116
|
-
showQuickJumper:
|
|
1117
|
-
pageSizeOptions:
|
|
1133
|
+
showSizeChanger: f = !1,
|
|
1134
|
+
showQuickJumper: g = !1,
|
|
1135
|
+
pageSizeOptions: h = [10, 20, 50, 100],
|
|
1118
1136
|
disabled: a = !1,
|
|
1119
|
-
hideOnSinglePage:
|
|
1120
|
-
showTotal:
|
|
1121
|
-
size:
|
|
1122
|
-
align:
|
|
1123
|
-
simple:
|
|
1124
|
-
popupPlacement:
|
|
1125
|
-
t:
|
|
1126
|
-
className:
|
|
1127
|
-
style:
|
|
1128
|
-
} = n, [
|
|
1129
|
-
if (
|
|
1137
|
+
hideOnSinglePage: y = !1,
|
|
1138
|
+
showTotal: b,
|
|
1139
|
+
size: I = "medium",
|
|
1140
|
+
align: G = "start",
|
|
1141
|
+
simple: q = !1,
|
|
1142
|
+
popupPlacement: X,
|
|
1143
|
+
t: S = (A) => A,
|
|
1144
|
+
className: N,
|
|
1145
|
+
style: k
|
|
1146
|
+
} = n, [P, T] = H(i), [D, W] = H(u), [U, V] = H(!1), [_, $] = H("bottom"), Z = R(null), w = e ?? P, v = c ?? D, C = Math.ceil(s / v);
|
|
1147
|
+
if (y && C <= 1)
|
|
1130
1148
|
return null;
|
|
1131
|
-
const
|
|
1132
|
-
a ||
|
|
1133
|
-
},
|
|
1134
|
-
const
|
|
1135
|
-
c === void 0 && (
|
|
1136
|
-
},
|
|
1149
|
+
const E = (A) => {
|
|
1150
|
+
a || A < 1 || A > C || A === w || (e === void 0 && T(A), r == null || r(A, v));
|
|
1151
|
+
}, j = (A) => {
|
|
1152
|
+
const J = Math.ceil(s / A), Q = Math.min(w, J) || 1;
|
|
1153
|
+
c === void 0 && (W(A), e === void 0 && T(Q)), p == null || p(Q, A), r == null || r(Q, A);
|
|
1154
|
+
}, L = () => {
|
|
1137
1155
|
if (!a) {
|
|
1138
|
-
if (
|
|
1139
|
-
|
|
1156
|
+
if (U) {
|
|
1157
|
+
V(!1);
|
|
1140
1158
|
return;
|
|
1141
1159
|
}
|
|
1142
|
-
if (
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1160
|
+
if (X === void 0 && Z.current) {
|
|
1161
|
+
const A = Z.current.getBoundingClientRect(), J = h.length * 40 + 8, Q = window.innerHeight - A.bottom, o = A.top;
|
|
1162
|
+
$(Q < J && o >= J ? "top" : "bottom");
|
|
1145
1163
|
}
|
|
1146
|
-
|
|
1164
|
+
V(!0);
|
|
1147
1165
|
}
|
|
1148
|
-
},
|
|
1149
|
-
|
|
1166
|
+
}, M = (A) => {
|
|
1167
|
+
j(A), V(!1);
|
|
1150
1168
|
};
|
|
1151
1169
|
ot(() => {
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1170
|
+
const A = (J) => {
|
|
1171
|
+
Z.current && !Z.current.contains(J.target) && V(!1);
|
|
1154
1172
|
};
|
|
1155
|
-
if (
|
|
1156
|
-
return document.addEventListener("mousedown",
|
|
1157
|
-
document.removeEventListener("mousedown",
|
|
1173
|
+
if (U)
|
|
1174
|
+
return document.addEventListener("mousedown", A), () => {
|
|
1175
|
+
document.removeEventListener("mousedown", A);
|
|
1158
1176
|
};
|
|
1159
|
-
}, [
|
|
1160
|
-
const
|
|
1161
|
-
const
|
|
1162
|
-
!isNaN(
|
|
1163
|
-
},
|
|
1164
|
-
const
|
|
1165
|
-
if (
|
|
1166
|
-
for (let
|
|
1167
|
-
|
|
1177
|
+
}, [U]);
|
|
1178
|
+
const et = (A) => {
|
|
1179
|
+
const J = parseInt(A.target.value);
|
|
1180
|
+
!isNaN(J) && J >= 1 && J <= C && E(J);
|
|
1181
|
+
}, O = dt(() => {
|
|
1182
|
+
const A = [];
|
|
1183
|
+
if (C <= 7)
|
|
1184
|
+
for (let Q = 1; Q <= C; Q++)
|
|
1185
|
+
A.push(Q);
|
|
1168
1186
|
else if (w <= 4) {
|
|
1169
|
-
for (let
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
} else if (w >=
|
|
1173
|
-
|
|
1174
|
-
for (let
|
|
1175
|
-
|
|
1187
|
+
for (let Q = 1; Q <= 5; Q++)
|
|
1188
|
+
A.push(Q);
|
|
1189
|
+
A.push("..."), A.push(C);
|
|
1190
|
+
} else if (w >= C - 3) {
|
|
1191
|
+
A.push(1), A.push("...");
|
|
1192
|
+
for (let Q = C - 4; Q <= C; Q++)
|
|
1193
|
+
A.push(Q);
|
|
1176
1194
|
} else {
|
|
1177
|
-
|
|
1178
|
-
for (let
|
|
1179
|
-
|
|
1180
|
-
|
|
1195
|
+
A.push(1), A.push("...");
|
|
1196
|
+
for (let Q = w - 1; Q <= w + 1; Q++)
|
|
1197
|
+
A.push(Q);
|
|
1198
|
+
A.push("..."), A.push(C);
|
|
1181
1199
|
}
|
|
1182
|
-
return
|
|
1183
|
-
}, [w,
|
|
1200
|
+
return A;
|
|
1201
|
+
}, [w, C]), F = (w - 1) * v + 1, nt = Math.min(w * v, s), st = `pagination-${I}`, x = `pagination-${G}`, it = a ? "pagination-disabled" : "", lt = (A, J) => A === "..." ? /* @__PURE__ */ t("span", { className: "pagination-item pagination-ellipsis", children: "..." }, `ellipsis-${J}`) : /* @__PURE__ */ t(
|
|
1184
1202
|
"button",
|
|
1185
1203
|
{
|
|
1186
1204
|
type: "button",
|
|
1187
|
-
className: `pagination-item ${
|
|
1188
|
-
onClick: () =>
|
|
1205
|
+
className: `pagination-item ${A === w ? "pagination-item-active" : ""}`,
|
|
1206
|
+
onClick: () => E(A),
|
|
1189
1207
|
disabled: a,
|
|
1190
|
-
children:
|
|
1208
|
+
children: A
|
|
1191
1209
|
},
|
|
1192
|
-
|
|
1210
|
+
A
|
|
1193
1211
|
);
|
|
1194
|
-
return
|
|
1212
|
+
return q ? /* @__PURE__ */ t(
|
|
1195
1213
|
"div",
|
|
1196
1214
|
{
|
|
1197
|
-
className: `pagination pagination-simple ${
|
|
1198
|
-
style:
|
|
1215
|
+
className: `pagination pagination-simple ${it} ${N || ""}`,
|
|
1216
|
+
style: k,
|
|
1199
1217
|
children: /* @__PURE__ */ l("div", { className: "pagination-simple-list", children: [
|
|
1200
1218
|
/* @__PURE__ */ t(
|
|
1201
1219
|
"button",
|
|
1202
1220
|
{
|
|
1203
1221
|
type: "button",
|
|
1204
1222
|
className: "pagination-simple-item pagination-simple-prev",
|
|
1205
|
-
onClick: () =>
|
|
1223
|
+
onClick: () => E(w - 1),
|
|
1206
1224
|
disabled: a || w === 1,
|
|
1207
1225
|
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" }) })
|
|
1208
1226
|
}
|
|
@@ -1210,15 +1228,15 @@ const Ve = (n) => {
|
|
|
1210
1228
|
/* @__PURE__ */ l("span", { className: "pagination-simple-text", children: [
|
|
1211
1229
|
w,
|
|
1212
1230
|
" / ",
|
|
1213
|
-
|
|
1231
|
+
C || 0
|
|
1214
1232
|
] }),
|
|
1215
1233
|
/* @__PURE__ */ t(
|
|
1216
1234
|
"button",
|
|
1217
1235
|
{
|
|
1218
1236
|
type: "button",
|
|
1219
1237
|
className: "pagination-simple-item pagination-simple-next",
|
|
1220
|
-
onClick: () =>
|
|
1221
|
-
disabled: a || w ===
|
|
1238
|
+
onClick: () => E(w + 1),
|
|
1239
|
+
disabled: a || w === C,
|
|
1222
1240
|
children: /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ t("path", { d: "M4 2L8 6L4 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
1223
1241
|
}
|
|
1224
1242
|
)
|
|
@@ -1227,17 +1245,17 @@ const Ve = (n) => {
|
|
|
1227
1245
|
) : /* @__PURE__ */ l(
|
|
1228
1246
|
"div",
|
|
1229
1247
|
{
|
|
1230
|
-
className: `pagination ${st} ${
|
|
1231
|
-
style:
|
|
1248
|
+
className: `pagination ${st} ${x} ${it} ${N || ""}`,
|
|
1249
|
+
style: k,
|
|
1232
1250
|
children: [
|
|
1233
|
-
|
|
1251
|
+
b && /* @__PURE__ */ t("div", { className: "pagination-total", children: b(s, [F, nt]) }),
|
|
1234
1252
|
/* @__PURE__ */ l("div", { className: "pagination-list", children: [
|
|
1235
1253
|
/* @__PURE__ */ t(
|
|
1236
1254
|
"button",
|
|
1237
1255
|
{
|
|
1238
1256
|
type: "button",
|
|
1239
1257
|
className: "pagination-item pagination-prev",
|
|
1240
|
-
onClick: () =>
|
|
1258
|
+
onClick: () => E(w - 1),
|
|
1241
1259
|
disabled: a || w === 1,
|
|
1242
1260
|
children: /* @__PURE__ */ l("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1243
1261
|
/* @__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: "#333333" }),
|
|
@@ -1245,14 +1263,14 @@ const Ve = (n) => {
|
|
|
1245
1263
|
] })
|
|
1246
1264
|
}
|
|
1247
1265
|
),
|
|
1248
|
-
|
|
1266
|
+
O.map((A, J) => lt(A, J)),
|
|
1249
1267
|
/* @__PURE__ */ t(
|
|
1250
1268
|
"button",
|
|
1251
1269
|
{
|
|
1252
1270
|
type: "button",
|
|
1253
1271
|
className: "pagination-item pagination-next",
|
|
1254
|
-
onClick: () =>
|
|
1255
|
-
disabled: a || w ===
|
|
1272
|
+
onClick: () => E(w + 1),
|
|
1273
|
+
disabled: a || w === C,
|
|
1256
1274
|
children: /* @__PURE__ */ l("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1257
1275
|
/* @__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" }),
|
|
1258
1276
|
/* @__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" })
|
|
@@ -1260,54 +1278,54 @@ const Ve = (n) => {
|
|
|
1260
1278
|
}
|
|
1261
1279
|
)
|
|
1262
1280
|
] }),
|
|
1263
|
-
|
|
1281
|
+
f && /* @__PURE__ */ l("div", { className: "pagination-sizer", ref: Z, children: [
|
|
1264
1282
|
/* @__PURE__ */ l(
|
|
1265
1283
|
"button",
|
|
1266
1284
|
{
|
|
1267
1285
|
type: "button",
|
|
1268
1286
|
className: "pagination-sizer-select",
|
|
1269
|
-
onClick:
|
|
1287
|
+
onClick: L,
|
|
1270
1288
|
disabled: a,
|
|
1271
1289
|
children: [
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
/* @__PURE__ */ l("svg", { className: `pagination-sizer-icon${
|
|
1290
|
+
v,
|
|
1291
|
+
S("条每页"),
|
|
1292
|
+
/* @__PURE__ */ l("svg", { className: `pagination-sizer-icon${U ? " pagination-sizer-icon-open" : ""}`, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1275
1293
|
/* @__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" }),
|
|
1276
1294
|
/* @__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", fillOpacity: "0.2" })
|
|
1277
1295
|
] })
|
|
1278
1296
|
]
|
|
1279
1297
|
}
|
|
1280
1298
|
),
|
|
1281
|
-
|
|
1299
|
+
U && /* @__PURE__ */ t("div", { className: `pagination-sizer-dropdown pagination-sizer-dropdown-${X ?? _}`, children: h.map((A) => /* @__PURE__ */ l(
|
|
1282
1300
|
"button",
|
|
1283
1301
|
{
|
|
1284
1302
|
type: "button",
|
|
1285
1303
|
className: "pagination-sizer-option",
|
|
1286
|
-
onClick: () =>
|
|
1287
|
-
"data-selected":
|
|
1304
|
+
onClick: () => M(A),
|
|
1305
|
+
"data-selected": A === v,
|
|
1288
1306
|
children: [
|
|
1289
|
-
|
|
1290
|
-
|
|
1307
|
+
A,
|
|
1308
|
+
S("条/页")
|
|
1291
1309
|
]
|
|
1292
1310
|
},
|
|
1293
|
-
|
|
1311
|
+
A
|
|
1294
1312
|
)) })
|
|
1295
1313
|
] }),
|
|
1296
|
-
|
|
1297
|
-
/* @__PURE__ */ t("span", { children:
|
|
1314
|
+
g && /* @__PURE__ */ l("div", { className: "pagination-jumper", children: [
|
|
1315
|
+
/* @__PURE__ */ t("span", { children: S("跳至") }),
|
|
1298
1316
|
/* @__PURE__ */ t(
|
|
1299
1317
|
"input",
|
|
1300
1318
|
{
|
|
1301
1319
|
type: "number",
|
|
1302
1320
|
className: "pagination-jumper-input",
|
|
1303
1321
|
min: 1,
|
|
1304
|
-
max:
|
|
1305
|
-
onChange:
|
|
1322
|
+
max: C,
|
|
1323
|
+
onChange: et,
|
|
1306
1324
|
disabled: a,
|
|
1307
1325
|
placeholder: ""
|
|
1308
1326
|
}
|
|
1309
1327
|
),
|
|
1310
|
-
/* @__PURE__ */ t("span", { children:
|
|
1328
|
+
/* @__PURE__ */ t("span", { children: S("页") })
|
|
1311
1329
|
] })
|
|
1312
1330
|
]
|
|
1313
1331
|
}
|
|
@@ -1370,17 +1388,17 @@ function Pt() {
|
|
|
1370
1388
|
] });
|
|
1371
1389
|
}
|
|
1372
1390
|
function Tt({ fileName: n, onRename: e }) {
|
|
1373
|
-
const [i, c] =
|
|
1391
|
+
const [i, c] = H(!1), [u, s] = H(n), r = R(null);
|
|
1374
1392
|
ot(() => {
|
|
1375
|
-
var
|
|
1376
|
-
i && (s(n), (
|
|
1393
|
+
var y, b;
|
|
1394
|
+
i && (s(n), (y = r.current) == null || y.focus(), (b = r.current) == null || b.select());
|
|
1377
1395
|
}, [i, n]);
|
|
1378
1396
|
const p = async () => {
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1381
|
-
},
|
|
1382
|
-
|
|
1383
|
-
},
|
|
1397
|
+
const y = u.trim();
|
|
1398
|
+
y && y !== n && await (e == null ? void 0 : e(y)), c(!1);
|
|
1399
|
+
}, f = () => c(!1), g = (y) => {
|
|
1400
|
+
y.key === "Enter" && !y.shiftKey && (y.preventDefault(), p()), y.key === "Escape" && f();
|
|
1401
|
+
}, h = () => {
|
|
1384
1402
|
p();
|
|
1385
1403
|
}, a = () => {
|
|
1386
1404
|
e && c(!0);
|
|
@@ -1391,9 +1409,9 @@ function Tt({ fileName: n, onRename: e }) {
|
|
|
1391
1409
|
ref: r,
|
|
1392
1410
|
className: "file-card__edit-input",
|
|
1393
1411
|
value: u,
|
|
1394
|
-
onChange: (
|
|
1395
|
-
onKeyDown:
|
|
1396
|
-
onBlur:
|
|
1412
|
+
onChange: (y) => s(y.target.value),
|
|
1413
|
+
onKeyDown: g,
|
|
1414
|
+
onBlur: h,
|
|
1397
1415
|
rows: 2,
|
|
1398
1416
|
style: { height: "42px" }
|
|
1399
1417
|
}
|
|
@@ -1419,11 +1437,11 @@ function ke({ fileName: n, fileType: e, fileUrl: i, onDelete: c, onRename: u, on
|
|
|
1419
1437
|
return /* @__PURE__ */ l("div", { className: `file-card file-card--other ${r || ""}`, style: p, children: [
|
|
1420
1438
|
/* @__PURE__ */ l("div", { className: "file-card__other-preview", onClick: s, children: [
|
|
1421
1439
|
(s || c) && /* @__PURE__ */ l("div", { className: "file-card__overlay", children: [
|
|
1422
|
-
s && /* @__PURE__ */ t("button", { className: "file-card__overlay-btn", onClick: (
|
|
1423
|
-
|
|
1440
|
+
s && /* @__PURE__ */ t("button", { className: "file-card__overlay-btn", onClick: (f) => {
|
|
1441
|
+
f.stopPropagation(), s();
|
|
1424
1442
|
}, children: /* @__PURE__ */ t(Gt, {}) }),
|
|
1425
|
-
c && /* @__PURE__ */ t("button", { className: "file-card__overlay-btn", onClick: (
|
|
1426
|
-
|
|
1443
|
+
c && /* @__PURE__ */ t("button", { className: "file-card__overlay-btn", onClick: (f) => {
|
|
1444
|
+
f.stopPropagation(), c();
|
|
1427
1445
|
}, children: /* @__PURE__ */ t(Pt, {}) })
|
|
1428
1446
|
] }),
|
|
1429
1447
|
/* @__PURE__ */ t(Ne, { fileType: e, fileUrl: i, fileName: n })
|
|
@@ -1443,35 +1461,35 @@ const De = ({
|
|
|
1443
1461
|
checkedChildren: s,
|
|
1444
1462
|
unCheckedChildren: r,
|
|
1445
1463
|
theme: p = "light",
|
|
1446
|
-
activeColor:
|
|
1447
|
-
inactiveColor:
|
|
1448
|
-
className:
|
|
1464
|
+
activeColor: f,
|
|
1465
|
+
inactiveColor: g,
|
|
1466
|
+
className: h,
|
|
1449
1467
|
style: a
|
|
1450
1468
|
}) => {
|
|
1451
|
-
const
|
|
1469
|
+
const y = n !== void 0, [b, I] = H(e), G = y ? n : b, q = ct(() => {
|
|
1452
1470
|
if (c || u) return;
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
}, [
|
|
1471
|
+
const P = !G;
|
|
1472
|
+
y || I(P), i == null || i(P);
|
|
1473
|
+
}, [G, c, u, y, i]), N = G ? f ?? (p === "dark" ? "var(--bu-switch-dark-on)" : "var(--bu-switch-light-on)") : g ?? (p === "dark" ? "var(--bu-switch-dark-off)" : "var(--bu-switch-light-off)"), k = [
|
|
1456
1474
|
"bu-switch",
|
|
1457
|
-
|
|
1475
|
+
G && "bu-switch--checked",
|
|
1458
1476
|
c && "bu-switch--disabled",
|
|
1459
1477
|
u && "bu-switch--loading",
|
|
1460
|
-
|
|
1478
|
+
h
|
|
1461
1479
|
].filter(Boolean).join(" ");
|
|
1462
1480
|
return /* @__PURE__ */ t(
|
|
1463
1481
|
"button",
|
|
1464
1482
|
{
|
|
1465
1483
|
type: "button",
|
|
1466
1484
|
role: "switch",
|
|
1467
|
-
"aria-checked":
|
|
1485
|
+
"aria-checked": G,
|
|
1468
1486
|
"aria-disabled": c,
|
|
1469
|
-
className:
|
|
1487
|
+
className: k,
|
|
1470
1488
|
style: {
|
|
1471
|
-
"--bu-switch-track-bg":
|
|
1489
|
+
"--bu-switch-track-bg": N,
|
|
1472
1490
|
...a
|
|
1473
1491
|
},
|
|
1474
|
-
onClick:
|
|
1492
|
+
onClick: q,
|
|
1475
1493
|
children: /* @__PURE__ */ l("span", { className: "bu-switch__track", children: [
|
|
1476
1494
|
r != null && /* @__PURE__ */ t("span", { className: "bu-switch__label bu-switch__label--left", children: r }),
|
|
1477
1495
|
/* @__PURE__ */ t("span", { className: "bu-switch__thumb", children: u && /* @__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(
|
|
@@ -1490,7 +1508,7 @@ const De = ({
|
|
|
1490
1508
|
};
|
|
1491
1509
|
De.displayName = "BuSwitch";
|
|
1492
1510
|
function Le(n, e) {
|
|
1493
|
-
const i =
|
|
1511
|
+
const i = R(null);
|
|
1494
1512
|
function c() {
|
|
1495
1513
|
if (n)
|
|
1496
1514
|
try {
|
|
@@ -1508,24 +1526,24 @@ function Le(n, e) {
|
|
|
1508
1526
|
function u() {
|
|
1509
1527
|
if (!(!n || !i.current || !e))
|
|
1510
1528
|
try {
|
|
1511
|
-
const { value: s } = n, { beforeTxt: r, afterTxt: p, start:
|
|
1512
|
-
let
|
|
1529
|
+
const { value: s } = n, { beforeTxt: r, afterTxt: p, start: f } = i.current;
|
|
1530
|
+
let g = s.length;
|
|
1513
1531
|
if (s.startsWith(r))
|
|
1514
|
-
|
|
1532
|
+
g = r.length;
|
|
1515
1533
|
else if (s.endsWith(p))
|
|
1516
|
-
|
|
1534
|
+
g = s.length - p.length;
|
|
1517
1535
|
else {
|
|
1518
|
-
const
|
|
1519
|
-
a !== -1 && (
|
|
1536
|
+
const h = r[f - 1], a = s.indexOf(h, f - 1);
|
|
1537
|
+
a !== -1 && (g = a + 1);
|
|
1520
1538
|
}
|
|
1521
|
-
n.setSelectionRange(
|
|
1539
|
+
n.setSelectionRange(g, g);
|
|
1522
1540
|
} catch {
|
|
1523
1541
|
}
|
|
1524
1542
|
}
|
|
1525
1543
|
return [c, u];
|
|
1526
1544
|
}
|
|
1527
1545
|
function Se() {
|
|
1528
|
-
const n =
|
|
1546
|
+
const n = R(0), e = () => cancelAnimationFrame(n.current);
|
|
1529
1547
|
return ot(() => e, []), (i) => {
|
|
1530
1548
|
e(), n.current = requestAnimationFrame(i);
|
|
1531
1549
|
};
|
|
@@ -1541,17 +1559,17 @@ function Jt({ className: n }) {
|
|
|
1541
1559
|
) });
|
|
1542
1560
|
}
|
|
1543
1561
|
function Re({ icon: n, upDisabled: e, downDisabled: i, onStep: c }) {
|
|
1544
|
-
const u =
|
|
1562
|
+
const u = R(void 0), s = R(c);
|
|
1545
1563
|
s.current = c;
|
|
1546
|
-
const r = () => clearTimeout(u.current), p = (
|
|
1547
|
-
|
|
1564
|
+
const r = () => clearTimeout(u.current), p = (g, h) => {
|
|
1565
|
+
g.preventDefault(), r(), s.current(h);
|
|
1548
1566
|
function a() {
|
|
1549
|
-
s.current(
|
|
1567
|
+
s.current(h), u.current = setTimeout(a, Je);
|
|
1550
1568
|
}
|
|
1551
1569
|
u.current = setTimeout(a, xe);
|
|
1552
1570
|
};
|
|
1553
1571
|
ot(() => r, []);
|
|
1554
|
-
const
|
|
1572
|
+
const f = {
|
|
1555
1573
|
unselectable: "on",
|
|
1556
1574
|
role: "button",
|
|
1557
1575
|
onMouseUp: r,
|
|
@@ -1565,21 +1583,21 @@ function Re({ icon: n, upDisabled: e, downDisabled: i, onStep: c }) {
|
|
|
1565
1583
|
/* @__PURE__ */ t(
|
|
1566
1584
|
"span",
|
|
1567
1585
|
{
|
|
1568
|
-
...
|
|
1586
|
+
...f,
|
|
1569
1587
|
"aria-label": "Increase Value",
|
|
1570
1588
|
"aria-disabled": e,
|
|
1571
1589
|
className: e ? "bj-input-number__handler bj-input-number__handler--up bj-input-number__handler--disabled" : "bj-input-number__handler bj-input-number__handler--up",
|
|
1572
|
-
onMouseDown: (
|
|
1590
|
+
onMouseDown: (g) => p(g, !0)
|
|
1573
1591
|
}
|
|
1574
1592
|
),
|
|
1575
1593
|
/* @__PURE__ */ t(
|
|
1576
1594
|
"span",
|
|
1577
1595
|
{
|
|
1578
|
-
...
|
|
1596
|
+
...f,
|
|
1579
1597
|
"aria-label": "Decrease Value",
|
|
1580
1598
|
"aria-disabled": i,
|
|
1581
1599
|
className: i ? "bj-input-number__handler bj-input-number__handler--down bj-input-number__handler--disabled" : "bj-input-number__handler bj-input-number__handler--down",
|
|
1582
|
-
onMouseDown: (
|
|
1600
|
+
onMouseDown: (g) => p(g, !1)
|
|
1583
1601
|
}
|
|
1584
1602
|
),
|
|
1585
1603
|
n || /* @__PURE__ */ l(ht, { children: [
|
|
@@ -1611,7 +1629,7 @@ function Ut(n) {
|
|
|
1611
1629
|
const e = String(n);
|
|
1612
1630
|
return !Number.isNaN(Number(e)) && e.includes("e");
|
|
1613
1631
|
}
|
|
1614
|
-
function
|
|
1632
|
+
function ft(n) {
|
|
1615
1633
|
const e = String(n);
|
|
1616
1634
|
if (Ut(n)) {
|
|
1617
1635
|
const [, i = "0"] = e.toLowerCase().split("e");
|
|
@@ -1621,7 +1639,7 @@ function Ct(n) {
|
|
|
1621
1639
|
}
|
|
1622
1640
|
function Yt(n) {
|
|
1623
1641
|
const e = String(n);
|
|
1624
|
-
return Ut(n) ? n > Number.MAX_SAFE_INTEGER ? String(Number.MAX_SAFE_INTEGER) : n < Number.MIN_SAFE_INTEGER ? String(Number.MIN_SAFE_INTEGER) : gt(n.toFixed(
|
|
1642
|
+
return Ut(n) ? n > Number.MAX_SAFE_INTEGER ? String(Number.MAX_SAFE_INTEGER) : n < Number.MIN_SAFE_INTEGER ? String(Number.MIN_SAFE_INTEGER) : gt(n.toFixed(ft(n))).fullStr : gt(e).fullStr;
|
|
1625
1643
|
}
|
|
1626
1644
|
function qt(n) {
|
|
1627
1645
|
if (typeof n == "number")
|
|
@@ -1650,7 +1668,7 @@ class ut {
|
|
|
1650
1668
|
const c = this.number + i;
|
|
1651
1669
|
if (c > Number.MAX_SAFE_INTEGER) return new ut(Number.MAX_SAFE_INTEGER);
|
|
1652
1670
|
if (c < Number.MIN_SAFE_INTEGER) return new ut(Number.MIN_SAFE_INTEGER);
|
|
1653
|
-
const u = Math.max(
|
|
1671
|
+
const u = Math.max(ft(this.number), ft(i));
|
|
1654
1672
|
return new ut(c.toFixed(u));
|
|
1655
1673
|
}
|
|
1656
1674
|
isEmpty() {
|
|
@@ -1675,23 +1693,23 @@ class ut {
|
|
|
1675
1693
|
return e ? this.isInvalidate() ? "" : Yt(this.number) : this.origin;
|
|
1676
1694
|
}
|
|
1677
1695
|
}
|
|
1678
|
-
function
|
|
1696
|
+
function rt(n) {
|
|
1679
1697
|
return new ut(n);
|
|
1680
1698
|
}
|
|
1681
1699
|
function yt(n, e, i, c = !1) {
|
|
1682
1700
|
if (n === "") return "";
|
|
1683
|
-
const { negativeStr: u, integerStr: s, decimalStr: r } = gt(n), p = `${e}${r}`,
|
|
1701
|
+
const { negativeStr: u, integerStr: s, decimalStr: r } = gt(n), p = `${e}${r}`, f = `${u}${s}`;
|
|
1684
1702
|
if (i !== void 0 && i >= 0) {
|
|
1685
|
-
const
|
|
1686
|
-
if (
|
|
1687
|
-
const
|
|
1688
|
-
`${u}0.${"0".repeat(i)}${10 -
|
|
1703
|
+
const g = Number(r[i]);
|
|
1704
|
+
if (g >= 5 && !c) {
|
|
1705
|
+
const h = rt(n).add(
|
|
1706
|
+
`${u}0.${"0".repeat(i)}${10 - g}`
|
|
1689
1707
|
);
|
|
1690
|
-
return yt(
|
|
1708
|
+
return yt(h.toString(), e, i, c);
|
|
1691
1709
|
}
|
|
1692
|
-
return i === 0 ?
|
|
1710
|
+
return i === 0 ? f : `${f}${e}${r.padEnd(i, "0").slice(0, i)}`;
|
|
1693
1711
|
}
|
|
1694
|
-
return p === ".0" ?
|
|
1712
|
+
return p === ".0" ? f : `${f}${p}`;
|
|
1695
1713
|
}
|
|
1696
1714
|
function Rt(n) {
|
|
1697
1715
|
const e = typeof n == "number" ? Yt(n) : gt(String(n)).fullStr;
|
|
@@ -1699,10 +1717,10 @@ function Rt(n) {
|
|
|
1699
1717
|
}
|
|
1700
1718
|
function Ot(n) {
|
|
1701
1719
|
if (n == null) return null;
|
|
1702
|
-
const e =
|
|
1720
|
+
const e = rt(n);
|
|
1703
1721
|
return e.isInvalidate() ? null : e;
|
|
1704
1722
|
}
|
|
1705
|
-
const $e =
|
|
1723
|
+
const $e = It(function({
|
|
1706
1724
|
value: e,
|
|
1707
1725
|
defaultValue: i,
|
|
1708
1726
|
onChange: c,
|
|
@@ -1710,183 +1728,183 @@ const $e = vt(function({
|
|
|
1710
1728
|
max: s,
|
|
1711
1729
|
step: r = 1,
|
|
1712
1730
|
precision: p,
|
|
1713
|
-
disabled:
|
|
1714
|
-
readOnly:
|
|
1715
|
-
placeholder:
|
|
1731
|
+
disabled: f = !1,
|
|
1732
|
+
readOnly: g = !1,
|
|
1733
|
+
placeholder: h,
|
|
1716
1734
|
autoFocus: a,
|
|
1717
|
-
size:
|
|
1718
|
-
status:
|
|
1719
|
-
bordered:
|
|
1720
|
-
controls:
|
|
1721
|
-
keyboard:
|
|
1722
|
-
changeOnWheel:
|
|
1723
|
-
changeOnBlur:
|
|
1724
|
-
addonBefore:
|
|
1725
|
-
addonAfter:
|
|
1726
|
-
prefix:
|
|
1727
|
-
suffix:
|
|
1728
|
-
formatter:
|
|
1729
|
-
parser:
|
|
1730
|
-
decimalSeparator:
|
|
1731
|
-
onStep:
|
|
1732
|
-
onPressEnter:
|
|
1733
|
-
onFocus:
|
|
1734
|
-
onBlur:
|
|
1735
|
+
size: y = "middle",
|
|
1736
|
+
status: b,
|
|
1737
|
+
bordered: I = !0,
|
|
1738
|
+
controls: G = !0,
|
|
1739
|
+
keyboard: q = !0,
|
|
1740
|
+
changeOnWheel: X = !1,
|
|
1741
|
+
changeOnBlur: S = !0,
|
|
1742
|
+
addonBefore: N,
|
|
1743
|
+
addonAfter: k,
|
|
1744
|
+
prefix: P,
|
|
1745
|
+
suffix: T,
|
|
1746
|
+
formatter: D,
|
|
1747
|
+
parser: W,
|
|
1748
|
+
decimalSeparator: U,
|
|
1749
|
+
onStep: V,
|
|
1750
|
+
onPressEnter: _,
|
|
1751
|
+
onFocus: $,
|
|
1752
|
+
onBlur: Z,
|
|
1735
1753
|
id: w,
|
|
1736
|
-
name:
|
|
1737
|
-
className:
|
|
1738
|
-
style:
|
|
1739
|
-
},
|
|
1740
|
-
const
|
|
1741
|
-
e === void 0 &&
|
|
1742
|
-
},
|
|
1743
|
-
(d,
|
|
1744
|
-
if (!
|
|
1745
|
-
return p !== void 0 && p >= 0 ? p : Math.max(
|
|
1754
|
+
name: v,
|
|
1755
|
+
className: C,
|
|
1756
|
+
style: E
|
|
1757
|
+
}, j) {
|
|
1758
|
+
const L = R(null), [M, et] = H(!1), O = R(!1), F = R(!1), nt = R(!1), st = R(""), [x, it] = H(() => rt(e ?? i)), lt = (d) => {
|
|
1759
|
+
e === void 0 && it(d);
|
|
1760
|
+
}, A = ct(
|
|
1761
|
+
(d, z) => {
|
|
1762
|
+
if (!z)
|
|
1763
|
+
return p !== void 0 && p >= 0 ? p : Math.max(ft(d), ft(r));
|
|
1746
1764
|
},
|
|
1747
1765
|
[p, r]
|
|
1748
|
-
),
|
|
1766
|
+
), J = ct(
|
|
1749
1767
|
(d) => {
|
|
1750
|
-
if (
|
|
1751
|
-
let K = d;
|
|
1752
|
-
return T && (K = K.replace(T, ".")), K.replace(/[^\w.-]+/g, "");
|
|
1753
|
-
},
|
|
1754
|
-
[Z, T]
|
|
1755
|
-
), k = ct(
|
|
1756
|
-
(d, K) => {
|
|
1757
|
-
if (L) return L(d, { userTyping: !!K, input: st.current });
|
|
1768
|
+
if (W) return W(d);
|
|
1758
1769
|
let z = d;
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1770
|
+
return U && (z = z.replace(U, ".")), z.replace(/[^\w.-]+/g, "");
|
|
1771
|
+
},
|
|
1772
|
+
[W, U]
|
|
1773
|
+
), Q = ct(
|
|
1774
|
+
(d, z) => {
|
|
1775
|
+
if (D) return D(d, { userTyping: !!z, input: st.current });
|
|
1776
|
+
let B = d;
|
|
1777
|
+
if (!z) {
|
|
1778
|
+
const at = A(B, z);
|
|
1779
|
+
qt(B) && (U || (at ?? -1) >= 0) && (B = yt(B, U || ".", at));
|
|
1762
1780
|
}
|
|
1763
|
-
return
|
|
1781
|
+
return B;
|
|
1764
1782
|
},
|
|
1765
|
-
[
|
|
1766
|
-
), [o,
|
|
1783
|
+
[D, A, U]
|
|
1784
|
+
), [o, m] = H(() => {
|
|
1767
1785
|
const d = i ?? e;
|
|
1768
|
-
return
|
|
1786
|
+
return x.isInvalidate() && ["string", "number"].includes(typeof d) ? d == null || Number.isNaN(d) ? "" : String(d) : Q(x.toString(), !1);
|
|
1769
1787
|
});
|
|
1770
1788
|
st.current = o;
|
|
1771
|
-
const
|
|
1772
|
-
|
|
1773
|
-
|
|
1789
|
+
const K = (d, z) => {
|
|
1790
|
+
m(
|
|
1791
|
+
Q(d.isInvalidate() ? d.toString(!1) : d.toString(!z), z)
|
|
1774
1792
|
);
|
|
1775
|
-
},
|
|
1776
|
-
let
|
|
1777
|
-
if (!
|
|
1778
|
-
const pt =
|
|
1779
|
-
return wt !== void 0 && wt >= 0 && (
|
|
1793
|
+
}, Y = dt(() => Ot(s), [s]), tt = dt(() => Ot(u), [u]), At = dt(() => !Y || x.isInvalidate() ? !1 : Y.lessEquals(x), [Y, x]), zt = dt(() => !tt || x.isInvalidate() ? !1 : x.lessEquals(tt), [tt, x]), [Ft] = Le(L.current, M), jt = (d) => Y && !d.lessEquals(Y) ? Y : tt && !tt.lessEquals(d) ? tt : null, mt = (d) => !jt(d), Ct = (d, z) => {
|
|
1794
|
+
let B = d, at = mt(B) || B.isEmpty();
|
|
1795
|
+
if (!B.isEmpty() && !z && (B = jt(B) || B, at = !0), !g && !f && at) {
|
|
1796
|
+
const pt = B.toString(), wt = A(pt, z);
|
|
1797
|
+
return wt !== void 0 && wt >= 0 && (B = rt(yt(pt, ".", wt)), mt(B) || (B = rt(yt(pt, ".", wt, !0)))), B.equals(x) || (lt(B), c == null || c(B.isEmpty() ? null : B.toNumber()), e === void 0 && K(B, z)), B;
|
|
1780
1798
|
}
|
|
1781
|
-
return
|
|
1782
|
-
}, Wt = Se(),
|
|
1783
|
-
if (Ft(), st.current = d,
|
|
1784
|
-
const
|
|
1785
|
-
|
|
1799
|
+
return x;
|
|
1800
|
+
}, Wt = Se(), bt = (d) => {
|
|
1801
|
+
if (Ft(), st.current = d, m(d), !F.current) {
|
|
1802
|
+
const z = J(d), B = rt(z);
|
|
1803
|
+
B.isNaN() || Ct(B, !0);
|
|
1786
1804
|
}
|
|
1787
1805
|
Wt(() => {
|
|
1788
|
-
const
|
|
1789
|
-
|
|
1806
|
+
const z = W ? d : d.replace(/。/g, ".");
|
|
1807
|
+
z !== d && bt(z);
|
|
1790
1808
|
});
|
|
1791
1809
|
}, Zt = () => {
|
|
1792
|
-
|
|
1810
|
+
F.current = !0;
|
|
1793
1811
|
}, Xt = (d) => {
|
|
1794
|
-
|
|
1795
|
-
}, Vt = (d) =>
|
|
1812
|
+
F.current = !1, bt(d.target.value);
|
|
1813
|
+
}, Vt = (d) => bt(d.target.value), Et = (d) => {
|
|
1796
1814
|
var pt;
|
|
1797
1815
|
if (d && At || !d && zt) return;
|
|
1798
|
-
|
|
1799
|
-
let
|
|
1800
|
-
d || (
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1816
|
+
O.current = !1;
|
|
1817
|
+
let z = rt(nt.current ? Rt(r) : r);
|
|
1818
|
+
d || (z = z.negate());
|
|
1819
|
+
const B = (x.isInvalidate() ? rt(0) : x).add(z.toString()), at = Ct(B, !1);
|
|
1820
|
+
V == null || V(at.toNumber(), { offset: nt.current ? Rt(r) : r, type: d ? "up" : "down" }), (pt = L.current) == null || pt.focus();
|
|
1803
1821
|
}, Bt = (d) => {
|
|
1804
|
-
const
|
|
1805
|
-
let
|
|
1806
|
-
|
|
1822
|
+
const z = rt(J(o));
|
|
1823
|
+
let B;
|
|
1824
|
+
z.isNaN() ? B = Ct(x, d) : B = Ct(z, d), e !== void 0 ? K(x, !1) : B.isNaN() || K(B, !1);
|
|
1807
1825
|
}, _t = (d) => {
|
|
1808
|
-
const { key:
|
|
1809
|
-
|
|
1826
|
+
const { key: z, shiftKey: B } = d;
|
|
1827
|
+
O.current = !0, nt.current = B, z === "Enter" && (F.current || (O.current = !1), Bt(!1), _ == null || _(d)), q && !F.current && (z === "ArrowUp" || z === "ArrowDown") && (Et(z === "ArrowUp"), d.preventDefault());
|
|
1810
1828
|
}, $t = () => {
|
|
1811
|
-
|
|
1829
|
+
O.current = !1, nt.current = !1;
|
|
1812
1830
|
}, te = (d) => {
|
|
1813
|
-
|
|
1831
|
+
et(!0), $ == null || $(d);
|
|
1814
1832
|
}, ee = (d) => {
|
|
1815
|
-
|
|
1816
|
-
}, Nt =
|
|
1833
|
+
S && Bt(!1), et(!1), O.current = !1, Z == null || Z(d);
|
|
1834
|
+
}, Nt = R(e);
|
|
1817
1835
|
if (Nt.current !== e) {
|
|
1818
1836
|
Nt.current = e;
|
|
1819
|
-
const d =
|
|
1820
|
-
if (!d.equals(
|
|
1821
|
-
|
|
1822
|
-
const
|
|
1823
|
-
(!d.equals(
|
|
1837
|
+
const d = rt(e);
|
|
1838
|
+
if (!d.equals(x)) {
|
|
1839
|
+
it(d);
|
|
1840
|
+
const z = rt(J(o));
|
|
1841
|
+
(!d.equals(z) || !O.current || D) && K(d, O.current);
|
|
1824
1842
|
}
|
|
1825
1843
|
}
|
|
1826
1844
|
const ne = (d) => {
|
|
1827
|
-
|
|
1828
|
-
}, Qt = !!
|
|
1845
|
+
L.current = d, typeof j == "function" ? j(d) : j && (j.current = d);
|
|
1846
|
+
}, Qt = !!G, ie = typeof G == "object" ? G.icon : void 0, re = !x.isInvalidate() && !mt(x), se = [
|
|
1829
1847
|
"bj-input-number",
|
|
1830
|
-
`bj-input-number--${
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
!
|
|
1835
|
-
|
|
1848
|
+
`bj-input-number--${y}`,
|
|
1849
|
+
M && "bj-input-number--focused",
|
|
1850
|
+
f && "bj-input-number--disabled",
|
|
1851
|
+
g && "bj-input-number--readonly",
|
|
1852
|
+
!I && "bj-input-number--borderless",
|
|
1853
|
+
b && `bj-input-number--${b}`,
|
|
1836
1854
|
re && "bj-input-number--out-of-range",
|
|
1837
1855
|
Qt && "bj-input-number--with-controls",
|
|
1838
|
-
|
|
1839
|
-
|
|
1856
|
+
N && "bj-input-number--group-left",
|
|
1857
|
+
k && "bj-input-number--group-right"
|
|
1840
1858
|
].filter(Boolean).join(" "), kt = /* @__PURE__ */ l(
|
|
1841
1859
|
"div",
|
|
1842
1860
|
{
|
|
1843
|
-
className: [se, !(
|
|
1844
|
-
style:
|
|
1861
|
+
className: [se, !(N || k || P || T) && C].filter(Boolean).join(" "),
|
|
1862
|
+
style: N || k || P || T ? void 0 : E,
|
|
1845
1863
|
onKeyDown: _t,
|
|
1846
1864
|
onKeyUp: $t,
|
|
1847
1865
|
children: [
|
|
1848
|
-
|
|
1866
|
+
P && /* @__PURE__ */ t("span", { className: "bj-input-number__prefix", children: P }),
|
|
1849
1867
|
/* @__PURE__ */ t("div", { className: "bj-input-number__input-wrap", children: /* @__PURE__ */ t(
|
|
1850
1868
|
"input",
|
|
1851
1869
|
{
|
|
1852
1870
|
ref: ne,
|
|
1853
1871
|
id: w,
|
|
1854
|
-
name:
|
|
1872
|
+
name: v,
|
|
1855
1873
|
className: "bj-input-number__input",
|
|
1856
1874
|
autoComplete: "off",
|
|
1857
1875
|
role: "spinbutton",
|
|
1858
1876
|
"aria-valuemin": u,
|
|
1859
1877
|
"aria-valuemax": s,
|
|
1860
|
-
"aria-valuenow":
|
|
1878
|
+
"aria-valuenow": x.isInvalidate() ? void 0 : x.toNumber(),
|
|
1861
1879
|
value: o,
|
|
1862
|
-
placeholder:
|
|
1863
|
-
disabled:
|
|
1864
|
-
readOnly:
|
|
1880
|
+
placeholder: h,
|
|
1881
|
+
disabled: f,
|
|
1882
|
+
readOnly: g,
|
|
1865
1883
|
autoFocus: a,
|
|
1866
1884
|
onChange: Vt,
|
|
1867
1885
|
onFocus: te,
|
|
1868
1886
|
onBlur: ee,
|
|
1869
1887
|
onCompositionStart: Zt,
|
|
1870
1888
|
onCompositionEnd: Xt,
|
|
1871
|
-
onWheel:
|
|
1872
|
-
|
|
1889
|
+
onWheel: X ? (d) => {
|
|
1890
|
+
M && Et(d.deltaY < 0);
|
|
1873
1891
|
} : void 0
|
|
1874
1892
|
}
|
|
1875
1893
|
) }),
|
|
1876
|
-
|
|
1877
|
-
Qt && /* @__PURE__ */ t(Re, { icon: ie, upDisabled: At, downDisabled: zt, onStep:
|
|
1894
|
+
T && /* @__PURE__ */ t("span", { className: "bj-input-number__suffix", children: T }),
|
|
1895
|
+
Qt && /* @__PURE__ */ t(Re, { icon: ie, upDisabled: At, downDisabled: zt, onStep: Et })
|
|
1878
1896
|
]
|
|
1879
1897
|
}
|
|
1880
1898
|
);
|
|
1881
|
-
return !
|
|
1899
|
+
return !N && !k ? kt : /* @__PURE__ */ l(
|
|
1882
1900
|
"div",
|
|
1883
1901
|
{
|
|
1884
|
-
className: ["bj-input-number-group", `bj-input-number-group--${
|
|
1885
|
-
style:
|
|
1902
|
+
className: ["bj-input-number-group", `bj-input-number-group--${y}`, C].filter(Boolean).join(" "),
|
|
1903
|
+
style: E,
|
|
1886
1904
|
children: [
|
|
1887
|
-
|
|
1905
|
+
N && /* @__PURE__ */ t("div", { className: "bj-input-number-group__addon", children: N }),
|
|
1888
1906
|
kt,
|
|
1889
|
-
|
|
1907
|
+
k && /* @__PURE__ */ t("div", { className: "bj-input-number-group__addon", children: k })
|
|
1890
1908
|
]
|
|
1891
1909
|
}
|
|
1892
1910
|
);
|