@svar-ui/react-core 2.4.3 → 2.5.0
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/README.md +13 -6
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +1700 -1424
- package/dist/index.es.js.map +1 -1
- package/dist-full/index.css +1 -1
- package/package.json +2 -2
- package/types/index.d.ts +56 -17
package/dist/index.es.js
CHANGED
|
@@ -1,184 +1,301 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useWritableProp as
|
|
4
|
-
import { uid as
|
|
5
|
-
import { locale as
|
|
6
|
-
import {
|
|
7
|
-
import { en as
|
|
8
|
-
import {
|
|
9
|
-
const
|
|
1
|
+
import { jsx as l, jsxs as R, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as fe, useContext as K, useState as B, useCallback as D, useRef as S, useEffect as W, useMemo as A, useLayoutEffect as me, memo as Ue, useId as _e, forwardRef as Qe, useImperativeHandle as qe } from "react";
|
|
3
|
+
import { useWritableProp as J, snippet as ae, useHotkeys as Ke } from "@svar-ui/lib-react";
|
|
4
|
+
import { uid as oe, env as pe, calculatePosition as Ze, getAbsParent as ze, clickOutside as ve, locale as Ae, locateID as Xe, getDuodecade as Be, dateToString as ne, delegateClick as Ee, setEnv as et } from "@svar-ui/lib-dom";
|
|
5
|
+
import { locale as bn } from "@svar-ui/lib-dom";
|
|
6
|
+
import { createPortal as tt } from "react-dom";
|
|
7
|
+
import { en as We } from "@svar-ui/core-locales";
|
|
8
|
+
import { en as Vn } from "@svar-ui/core-locales";
|
|
9
|
+
const ie = fe(""), Oe = fe({}), q = fe(null), ue = fe(null), Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10
10
|
__proto__: null,
|
|
11
|
-
fieldId:
|
|
12
|
-
helpers:
|
|
13
|
-
i18n:
|
|
14
|
-
theme:
|
|
11
|
+
fieldId: ue,
|
|
12
|
+
helpers: Oe,
|
|
13
|
+
i18n: q,
|
|
14
|
+
theme: ie
|
|
15
15
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
16
16
|
function z(e) {
|
|
17
|
-
const n =
|
|
17
|
+
const n = K(ue), [t] = B(() => e || n || oe());
|
|
18
18
|
return t;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function _t({
|
|
21
21
|
value: e = "",
|
|
22
22
|
id: n,
|
|
23
23
|
placeholder: t = "",
|
|
24
|
-
title:
|
|
24
|
+
title: s = "",
|
|
25
25
|
disabled: r = !1,
|
|
26
|
-
error:
|
|
27
|
-
readonly:
|
|
28
|
-
onChange:
|
|
26
|
+
error: u = !1,
|
|
27
|
+
readonly: i = !1,
|
|
28
|
+
onChange: c
|
|
29
29
|
}) {
|
|
30
|
-
const a = z(n), [
|
|
31
|
-
(
|
|
32
|
-
const
|
|
33
|
-
w
|
|
30
|
+
const a = z(n), [o, f] = J(e), d = D(
|
|
31
|
+
(x) => {
|
|
32
|
+
const w = x.target.value;
|
|
33
|
+
f(w), c && c({ value: w, input: !0 });
|
|
34
34
|
},
|
|
35
|
-
[
|
|
36
|
-
),
|
|
37
|
-
(
|
|
38
|
-
const
|
|
39
|
-
w
|
|
35
|
+
[c]
|
|
36
|
+
), p = D(
|
|
37
|
+
(x) => {
|
|
38
|
+
const w = x.target.value;
|
|
39
|
+
f(w), c && c({ value: w });
|
|
40
40
|
},
|
|
41
|
-
[
|
|
42
|
-
),
|
|
43
|
-
return
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
|
|
41
|
+
[c]
|
|
42
|
+
), v = S(null);
|
|
43
|
+
return W(() => {
|
|
44
|
+
const x = p, w = v.current;
|
|
45
|
+
return w.addEventListener("change", x), () => {
|
|
46
|
+
w && w.removeEventListener("change", x);
|
|
47
47
|
};
|
|
48
|
-
}, [
|
|
48
|
+
}, [p]), /* @__PURE__ */ l(
|
|
49
49
|
"textarea",
|
|
50
50
|
{
|
|
51
|
-
className: `wx-3yFVAC wx-textarea ${
|
|
51
|
+
className: `wx-3yFVAC wx-textarea ${u ? "wx-error" : ""}`,
|
|
52
52
|
id: a,
|
|
53
53
|
disabled: r,
|
|
54
54
|
placeholder: t,
|
|
55
|
-
readOnly:
|
|
56
|
-
title:
|
|
57
|
-
value:
|
|
58
|
-
onInput:
|
|
59
|
-
ref:
|
|
55
|
+
readOnly: i,
|
|
56
|
+
title: s,
|
|
57
|
+
value: o,
|
|
58
|
+
onInput: d,
|
|
59
|
+
ref: v
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function re({
|
|
64
64
|
type: e = "",
|
|
65
65
|
css: n = "",
|
|
66
66
|
icon: t = "",
|
|
67
|
-
disabled:
|
|
67
|
+
disabled: s = !1,
|
|
68
68
|
title: r = "",
|
|
69
|
-
text:
|
|
70
|
-
children:
|
|
71
|
-
onClick:
|
|
69
|
+
text: u = "",
|
|
70
|
+
children: i,
|
|
71
|
+
onClick: c
|
|
72
72
|
}) {
|
|
73
|
-
const a =
|
|
74
|
-
let
|
|
75
|
-
return n + (n ? " " : "") +
|
|
76
|
-
}, [e, n]),
|
|
77
|
-
|
|
73
|
+
const a = A(() => {
|
|
74
|
+
let f = e ? e.split(" ").filter((d) => d !== "").map((d) => "wx-" + d).join(" ") : "";
|
|
75
|
+
return n + (n ? " " : "") + f;
|
|
76
|
+
}, [e, n]), o = (f) => {
|
|
77
|
+
c && c(f);
|
|
78
78
|
};
|
|
79
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ R(
|
|
80
80
|
"button",
|
|
81
81
|
{
|
|
82
82
|
title: r,
|
|
83
|
-
className: `wx-2ZWgb4 wx-button ${a} ${t && !
|
|
84
|
-
disabled:
|
|
85
|
-
onClick:
|
|
83
|
+
className: `wx-2ZWgb4 wx-button ${a} ${t && !i ? "wx-icon" : ""}`,
|
|
84
|
+
disabled: s,
|
|
85
|
+
onClick: o,
|
|
86
86
|
children: [
|
|
87
87
|
t && /* @__PURE__ */ l("i", { className: "wx-2ZWgb4 " + t }),
|
|
88
|
-
|
|
88
|
+
i || u || " "
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function Ye({
|
|
94
94
|
id: e,
|
|
95
95
|
label: n = "",
|
|
96
96
|
inputValue: t = "",
|
|
97
|
-
value:
|
|
97
|
+
value: s = !1,
|
|
98
98
|
onChange: r,
|
|
99
|
-
disabled:
|
|
99
|
+
disabled: u = !1,
|
|
100
|
+
style: i
|
|
100
101
|
}) {
|
|
101
|
-
const
|
|
102
|
-
return /* @__PURE__ */
|
|
102
|
+
const c = z(e), [a, o] = J(s);
|
|
103
|
+
return /* @__PURE__ */ R("div", { style: i, className: "wx-2IvefP wx-checkbox", children: [
|
|
103
104
|
/* @__PURE__ */ l(
|
|
104
105
|
"input",
|
|
105
106
|
{
|
|
106
107
|
type: "checkbox",
|
|
107
|
-
id:
|
|
108
|
-
disabled:
|
|
108
|
+
id: c,
|
|
109
|
+
disabled: u,
|
|
109
110
|
className: "wx-2IvefP wx-check",
|
|
110
|
-
checked:
|
|
111
|
+
checked: a,
|
|
111
112
|
value: t,
|
|
112
|
-
onChange: ({ target:
|
|
113
|
-
const
|
|
114
|
-
|
|
113
|
+
onChange: ({ target: d }) => {
|
|
114
|
+
const p = d.checked;
|
|
115
|
+
o(p), r && r({ value: p, inputValue: t });
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ R("label", { htmlFor: c, className: "wx-2IvefP wx-label", children: [
|
|
119
120
|
/* @__PURE__ */ l("span", { className: "wx-2IvefP wx-before" }),
|
|
120
121
|
n && /* @__PURE__ */ l("span", { className: "wx-2IvefP wx-after", children: n })
|
|
121
122
|
] })
|
|
122
123
|
] });
|
|
123
124
|
}
|
|
124
|
-
function
|
|
125
|
+
function Qt({
|
|
125
126
|
options: e = [],
|
|
126
127
|
value: n = [],
|
|
127
128
|
type: t = "",
|
|
128
|
-
onChange:
|
|
129
|
+
onChange: s
|
|
129
130
|
}) {
|
|
130
|
-
const r =
|
|
131
|
-
(
|
|
132
|
-
let
|
|
133
|
-
|
|
131
|
+
const r = D(
|
|
132
|
+
(u) => {
|
|
133
|
+
let i;
|
|
134
|
+
u.value ? i = [...n, u.inputValue] : i = n.filter((c) => c !== u.inputValue), s && s({ value: i });
|
|
134
135
|
},
|
|
135
|
-
[n,
|
|
136
|
+
[n, s]
|
|
136
137
|
);
|
|
137
|
-
return /* @__PURE__ */ l(
|
|
138
|
-
|
|
138
|
+
return /* @__PURE__ */ l(ue.Provider, { value: null, children: /* @__PURE__ */ l("div", { className: `wx-q8xwRD wx-checkboxgroup ${t && `wx-${t}`}`, children: e.map((u) => /* @__PURE__ */ l("div", { className: "wx-q8xwRD wx-item", children: /* @__PURE__ */ l(
|
|
139
|
+
Ye,
|
|
139
140
|
{
|
|
140
|
-
label:
|
|
141
|
-
inputValue:
|
|
142
|
-
value: n.includes(
|
|
141
|
+
label: u.label,
|
|
142
|
+
inputValue: u.id,
|
|
143
|
+
value: n.includes(u.id),
|
|
143
144
|
onChange: r
|
|
144
145
|
}
|
|
145
|
-
) },
|
|
146
|
+
) }, u.id)) }) });
|
|
147
|
+
}
|
|
148
|
+
function nt({ theme: e = "", target: n, children: t }) {
|
|
149
|
+
const s = S(null), r = S(null), [u, i] = B(null);
|
|
150
|
+
s.current || (s.current = document.createElement("div"));
|
|
151
|
+
const c = K(ie);
|
|
152
|
+
return W(() => {
|
|
153
|
+
i(
|
|
154
|
+
n || rt(r.current) || pe.getTopNode(r.current)
|
|
155
|
+
);
|
|
156
|
+
}, [r.current]), /* @__PURE__ */ R(_, { children: [
|
|
157
|
+
/* @__PURE__ */ l("span", { ref: r, style: { display: "none" } }),
|
|
158
|
+
r.current && u ? tt(
|
|
159
|
+
/* @__PURE__ */ l(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
className: `wx-3ZWsT0 wx-${e || c}-theme`,
|
|
163
|
+
children: t
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
u
|
|
167
|
+
) : null
|
|
168
|
+
] });
|
|
169
|
+
}
|
|
170
|
+
function rt(e) {
|
|
171
|
+
const n = pe.getTopNode(e);
|
|
172
|
+
for (; e && e !== n && !e.getAttribute("data-wx-portal-root"); )
|
|
173
|
+
e = e.parentNode;
|
|
174
|
+
return e;
|
|
175
|
+
}
|
|
176
|
+
function lt({
|
|
177
|
+
left: e = 0,
|
|
178
|
+
top: n = 0,
|
|
179
|
+
at: t = "bottom",
|
|
180
|
+
parent: s = null,
|
|
181
|
+
width: r = "auto",
|
|
182
|
+
css: u = "",
|
|
183
|
+
onCancel: i,
|
|
184
|
+
children: c,
|
|
185
|
+
trackScroll: a = !1
|
|
186
|
+
}) {
|
|
187
|
+
const [o, f] = B(0), [d, p] = B(0), [v, x] = B("auto"), [w, h] = B(!1), m = S(null), g = S(null);
|
|
188
|
+
function T(N) {
|
|
189
|
+
return s && (r + "").indexOf("%") > -1 ? r.replace(/(\d+)%/, (k, M) => (M = M * s.offsetWidth / 100 + "px", r.replace(k, M))) : r && r !== "auto" ? r : N;
|
|
190
|
+
}
|
|
191
|
+
const b = D(() => {
|
|
192
|
+
if (!m.current) return;
|
|
193
|
+
const N = Ze(m.current, s, t, e, n);
|
|
194
|
+
N && (f(N.x), p(N.y), x(T(N.width)));
|
|
195
|
+
}, [m, s, t, e, n, r]);
|
|
196
|
+
return me(() => {
|
|
197
|
+
const N = (k) => {
|
|
198
|
+
i && k.target !== g.current && m.current && !m.current.contains(k.target) && i(k);
|
|
199
|
+
};
|
|
200
|
+
return requestAnimationFrame(() => {
|
|
201
|
+
b(), h(!0), a && m.current && (g.current = ze(m.current), g.current && g.current.addEventListener("scroll", N, !0));
|
|
202
|
+
}), () => {
|
|
203
|
+
a && g.current && g.current.removeEventListener("scroll", N, !0);
|
|
204
|
+
};
|
|
205
|
+
}, []), me(() => {
|
|
206
|
+
b();
|
|
207
|
+
}, [s, t, e, n]), W(() => {
|
|
208
|
+
const N = (k) => {
|
|
209
|
+
i && i(k);
|
|
210
|
+
};
|
|
211
|
+
if (m.current)
|
|
212
|
+
return ve(m.current, N).destroy;
|
|
213
|
+
}, [i]), /* @__PURE__ */ l(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
ref: m,
|
|
217
|
+
className: ["wx-37M6Fj", "wx-popup", u].filter(Boolean).join(" "),
|
|
218
|
+
style: {
|
|
219
|
+
position: "absolute",
|
|
220
|
+
visibility: w ? "visible" : "hidden",
|
|
221
|
+
top: d + "px",
|
|
222
|
+
left: o + "px",
|
|
223
|
+
width: v
|
|
224
|
+
},
|
|
225
|
+
children: c
|
|
226
|
+
}
|
|
227
|
+
);
|
|
146
228
|
}
|
|
147
|
-
function
|
|
229
|
+
function ct({
|
|
148
230
|
position: e = "bottom",
|
|
149
231
|
align: n = "start",
|
|
150
232
|
autoFit: t = !0,
|
|
151
|
-
onCancel:
|
|
233
|
+
onCancel: s = null,
|
|
152
234
|
width: r = "100%",
|
|
235
|
+
css: u = "",
|
|
153
236
|
children: i
|
|
154
237
|
}) {
|
|
155
|
-
const
|
|
156
|
-
return
|
|
238
|
+
const c = S(null), [a, o] = B(e), [f, d] = B(n);
|
|
239
|
+
return W(() => {
|
|
157
240
|
if (t) {
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
|
|
241
|
+
const p = c.current;
|
|
242
|
+
if (p) {
|
|
243
|
+
const v = p.getBoundingClientRect(), x = document.body.getBoundingClientRect();
|
|
244
|
+
v.right >= x.right && d("end"), v.bottom >= x.bottom && o("top");
|
|
162
245
|
}
|
|
163
246
|
}
|
|
164
|
-
}, [
|
|
165
|
-
if (
|
|
166
|
-
const
|
|
167
|
-
|
|
247
|
+
}, []), W(() => {
|
|
248
|
+
if (c.current) {
|
|
249
|
+
const p = (v) => {
|
|
250
|
+
s && s(v);
|
|
168
251
|
};
|
|
169
|
-
return
|
|
252
|
+
return ve(c.current, p).destroy;
|
|
170
253
|
}
|
|
171
|
-
}, [
|
|
254
|
+
}, [s]), /* @__PURE__ */ l(
|
|
172
255
|
"div",
|
|
173
256
|
{
|
|
174
|
-
ref:
|
|
175
|
-
className:
|
|
257
|
+
ref: c,
|
|
258
|
+
className: [
|
|
259
|
+
"wx-dropdown",
|
|
260
|
+
`wx-${a}-${f}`,
|
|
261
|
+
u || "",
|
|
262
|
+
"wx-aaaVytZW"
|
|
263
|
+
].filter(Boolean).join(" "),
|
|
176
264
|
style: { width: r },
|
|
177
265
|
children: i
|
|
178
266
|
}
|
|
179
267
|
);
|
|
180
268
|
}
|
|
181
|
-
|
|
269
|
+
function le({
|
|
270
|
+
position: e = "bottom",
|
|
271
|
+
align: n = "start",
|
|
272
|
+
autoFit: t = !0,
|
|
273
|
+
inline: s = !1,
|
|
274
|
+
onCancel: r,
|
|
275
|
+
width: u = "100%",
|
|
276
|
+
children: i,
|
|
277
|
+
...c
|
|
278
|
+
}) {
|
|
279
|
+
const [a, o] = B(void 0), f = S(null), d = A(() => `${e}-${n}`, [e, n]);
|
|
280
|
+
return me(() => {
|
|
281
|
+
f.current && o(f.current.parentNode);
|
|
282
|
+
}, []), /* @__PURE__ */ R(_, { children: [
|
|
283
|
+
a && (s ? /* @__PURE__ */ l(
|
|
284
|
+
ct,
|
|
285
|
+
{
|
|
286
|
+
onCancel: r,
|
|
287
|
+
position: e,
|
|
288
|
+
align: n,
|
|
289
|
+
autoFit: t,
|
|
290
|
+
width: u,
|
|
291
|
+
...c,
|
|
292
|
+
children: i
|
|
293
|
+
}
|
|
294
|
+
) : /* @__PURE__ */ l(nt, { children: /* @__PURE__ */ l(lt, { parent: a, at: d, onCancel: r, width: u, ...c, children: i }) })),
|
|
295
|
+
/* @__PURE__ */ l("span", { ref: f, className: "wx-portal-node wx-32GZ52" })
|
|
296
|
+
] });
|
|
297
|
+
}
|
|
298
|
+
const st = [
|
|
182
299
|
"#00a037",
|
|
183
300
|
"#37a9ef",
|
|
184
301
|
"#f5a623",
|
|
@@ -187,92 +304,93 @@ const Oe = [
|
|
|
187
304
|
"#000000",
|
|
188
305
|
"#ffffff"
|
|
189
306
|
];
|
|
190
|
-
function
|
|
191
|
-
colors: e =
|
|
307
|
+
function qt({
|
|
308
|
+
colors: e = st,
|
|
192
309
|
value: n = "",
|
|
193
310
|
onChange: t,
|
|
194
|
-
id:
|
|
311
|
+
id: s,
|
|
195
312
|
clear: r = !1,
|
|
196
|
-
placeholder:
|
|
197
|
-
title:
|
|
198
|
-
disabled:
|
|
199
|
-
error: a = !1
|
|
313
|
+
placeholder: u = "",
|
|
314
|
+
title: i = "",
|
|
315
|
+
disabled: c = !1,
|
|
316
|
+
error: a = !1,
|
|
317
|
+
dropdown: o = {}
|
|
200
318
|
}) {
|
|
201
|
-
const
|
|
202
|
-
(
|
|
203
|
-
|
|
319
|
+
const f = z(s), [d, p] = B(n), [v, x] = B(!1), w = D(
|
|
320
|
+
(g, T) => {
|
|
321
|
+
g.stopPropagation(), p(T), x(!1), t && t({ value: T });
|
|
204
322
|
},
|
|
205
323
|
[t]
|
|
206
|
-
),
|
|
207
|
-
(
|
|
208
|
-
|
|
324
|
+
), h = D(
|
|
325
|
+
(g) => {
|
|
326
|
+
g.stopPropagation(), p(""), t && t({ value: "" });
|
|
209
327
|
},
|
|
210
328
|
[t]
|
|
211
|
-
),
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
}, [
|
|
215
|
-
return /* @__PURE__ */
|
|
329
|
+
), m = D(() => {
|
|
330
|
+
if (c) return !1;
|
|
331
|
+
x(!0);
|
|
332
|
+
}, [c]);
|
|
333
|
+
return /* @__PURE__ */ R("div", { className: "wx-121TgJ wx-colorselect", onClick: m, children: [
|
|
216
334
|
/* @__PURE__ */ l(
|
|
217
335
|
"input",
|
|
218
336
|
{
|
|
219
|
-
className: "wx-121TgJ wx-input" + (a ? " wx-error" : "") + (
|
|
220
|
-
title:
|
|
221
|
-
value:
|
|
337
|
+
className: "wx-121TgJ wx-input" + (a ? " wx-error" : "") + (v ? " wx-focus" : ""),
|
|
338
|
+
title: i,
|
|
339
|
+
value: d,
|
|
222
340
|
readOnly: !0,
|
|
223
|
-
id:
|
|
224
|
-
placeholder:
|
|
225
|
-
disabled:
|
|
341
|
+
id: f,
|
|
342
|
+
placeholder: u,
|
|
343
|
+
disabled: c
|
|
226
344
|
}
|
|
227
345
|
),
|
|
228
|
-
r &&
|
|
229
|
-
|
|
346
|
+
r && d && !c && /* @__PURE__ */ l("i", { className: "wx-121TgJ wx-clear wxi-close", onClick: h }),
|
|
347
|
+
d ? /* @__PURE__ */ l(
|
|
230
348
|
"div",
|
|
231
349
|
{
|
|
232
350
|
className: "wx-121TgJ wx-color wx-selected",
|
|
233
|
-
style: { backgroundColor:
|
|
351
|
+
style: { backgroundColor: d || "#00a037" }
|
|
234
352
|
}
|
|
235
353
|
) : /* @__PURE__ */ l("div", { className: "wx-121TgJ wx-empty wx-selected" }),
|
|
236
|
-
|
|
354
|
+
v && /* @__PURE__ */ l(le, { onCancel: () => x(!1), ...o, children: /* @__PURE__ */ R("div", { className: "wx-121TgJ wx-colors", children: [
|
|
237
355
|
/* @__PURE__ */ l(
|
|
238
356
|
"div",
|
|
239
357
|
{
|
|
240
358
|
className: "wx-121TgJ wx-empty",
|
|
241
|
-
onClick: (
|
|
359
|
+
onClick: (g) => w(g, "")
|
|
242
360
|
}
|
|
243
361
|
),
|
|
244
|
-
e.map((
|
|
362
|
+
e.map((g, T) => /* @__PURE__ */ l(
|
|
245
363
|
"div",
|
|
246
364
|
{
|
|
247
365
|
className: "wx-121TgJ wx-color",
|
|
248
|
-
style: { backgroundColor:
|
|
249
|
-
onClick: (
|
|
366
|
+
style: { backgroundColor: g },
|
|
367
|
+
onClick: (b) => w(b, g)
|
|
250
368
|
},
|
|
251
|
-
|
|
369
|
+
T
|
|
252
370
|
))
|
|
253
371
|
] }) })
|
|
254
372
|
] });
|
|
255
373
|
}
|
|
256
|
-
function
|
|
257
|
-
const t = e.firstChild, { moveBlockSlider:
|
|
258
|
-
function
|
|
259
|
-
|
|
374
|
+
function be(e, n) {
|
|
375
|
+
const t = e.firstChild, { moveBlockSlider: s, moveLineSlider: r } = n || {};
|
|
376
|
+
function u(a) {
|
|
377
|
+
i(a), t.focus(), window.addEventListener("mousemove", i), window.addEventListener("mouseup", c);
|
|
260
378
|
}
|
|
261
|
-
function
|
|
262
|
-
let
|
|
263
|
-
const
|
|
264
|
-
|
|
379
|
+
function i(a) {
|
|
380
|
+
let o, f, d, p;
|
|
381
|
+
const v = e.getBoundingClientRect();
|
|
382
|
+
o = v.left, f = v.top, d = a.clientX - o, p = a.clientY - f, s && n.moveBlockSlider(d, p), r && n.moveLineSlider(d);
|
|
265
383
|
}
|
|
266
|
-
function
|
|
267
|
-
t.blur(), window.removeEventListener("mousemove",
|
|
384
|
+
function c() {
|
|
385
|
+
t.blur(), window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", c);
|
|
268
386
|
}
|
|
269
|
-
return e.addEventListener("mousedown",
|
|
387
|
+
return e.addEventListener("mousedown", u), {
|
|
270
388
|
destroy() {
|
|
271
|
-
e.removeEventListener("mousedown",
|
|
389
|
+
e.removeEventListener("mousedown", u);
|
|
272
390
|
}
|
|
273
391
|
};
|
|
274
392
|
}
|
|
275
|
-
const
|
|
393
|
+
const se = {
|
|
276
394
|
_toHex: [
|
|
277
395
|
"0",
|
|
278
396
|
"1",
|
|
@@ -310,832 +428,993 @@ const q = {
|
|
|
310
428
|
hexToRgb(e) {
|
|
311
429
|
e = e.charAt(0) === "#" ? e.slice(1) : e;
|
|
312
430
|
const n = e.match(/.{1,2}/g);
|
|
313
|
-
let [t,
|
|
314
|
-
return t = this.hexToDec(t),
|
|
431
|
+
let [t, s, r] = n;
|
|
432
|
+
return t = this.hexToDec(t), s = this.hexToDec(s), r = this.hexToDec(r), [t, s, r];
|
|
315
433
|
},
|
|
316
434
|
hsvToRgb(e, n, t) {
|
|
317
|
-
let
|
|
318
|
-
switch (
|
|
435
|
+
let s, r, u, i, c, a, o, f;
|
|
436
|
+
switch (s = Math.floor(e / 60) % 6, r = e / 60 - s, u = t * (1 - n), i = t * (1 - r * n), c = t * (1 - (1 - r) * n), a = 0, o = 0, f = 0, s) {
|
|
319
437
|
case 0:
|
|
320
|
-
a = t,
|
|
438
|
+
a = t, o = c, f = u;
|
|
321
439
|
break;
|
|
322
440
|
case 1:
|
|
323
|
-
a =
|
|
441
|
+
a = i, o = t, f = u;
|
|
324
442
|
break;
|
|
325
443
|
case 2:
|
|
326
|
-
a =
|
|
444
|
+
a = u, o = t, f = c;
|
|
327
445
|
break;
|
|
328
446
|
case 3:
|
|
329
|
-
a =
|
|
447
|
+
a = u, o = i, f = t;
|
|
330
448
|
break;
|
|
331
449
|
case 4:
|
|
332
|
-
a =
|
|
450
|
+
a = c, o = u, f = t;
|
|
333
451
|
break;
|
|
334
452
|
case 5:
|
|
335
|
-
a = t,
|
|
453
|
+
a = t, o = u, f = i;
|
|
336
454
|
break;
|
|
337
455
|
}
|
|
338
|
-
return a = Math.floor(a * 255),
|
|
456
|
+
return a = Math.floor(a * 255), o = Math.floor(o * 255), f = Math.floor(f * 255), [a, o, f];
|
|
339
457
|
},
|
|
340
458
|
rgbToHsv(e, n, t) {
|
|
341
|
-
let
|
|
459
|
+
let s, r, u;
|
|
342
460
|
e /= 255, n /= 255, t /= 255;
|
|
343
|
-
let
|
|
344
|
-
return r = 0,
|
|
461
|
+
let i = Math.min(e, n, t), c = Math.max(e, n, t);
|
|
462
|
+
return r = 0, s = c === 0 ? 0 : 1 - i / c, u = c, c === i ? r = 0 : c === e && n >= t ? r = 60 * (n - t) / (c - i) + 0 : c === e && n < t ? r = 60 * (n - t) / (c - i) + 360 : c === n ? r = 60 * (t - e) / (c - i) + 120 : c === t && (r = 60 * (e - n) / (c - i) + 240), [r, s, u];
|
|
345
463
|
},
|
|
346
464
|
hexToHvs(e) {
|
|
347
465
|
const n = this.hexToRgb(e);
|
|
348
466
|
return this.rgbToHsv(...n);
|
|
349
467
|
},
|
|
350
468
|
hvsToHex(e, n, t) {
|
|
351
|
-
const
|
|
352
|
-
return "#" + this.rgbToHex(
|
|
469
|
+
const s = this.hsvToRgb(e, n, t);
|
|
470
|
+
return "#" + this.rgbToHex(s).toUpperCase();
|
|
353
471
|
}
|
|
354
|
-
},
|
|
355
|
-
function
|
|
356
|
-
return e ? (e = e.toString(16), e.charAt(0) === "#" && (e = e.slice(1)),
|
|
472
|
+
}, at = (e) => /^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e);
|
|
473
|
+
function De(e) {
|
|
474
|
+
return e ? (e = e.toString(16), e.charAt(0) === "#" && (e = e.slice(1)), at(e) ? (e.length === 3 && (e = e.slice(0, 3).split("").reduce((n, t) => n + t + t, "")), `#${e.toUpperCase()}`) : null) : null;
|
|
357
475
|
}
|
|
358
|
-
function
|
|
359
|
-
return
|
|
476
|
+
function X() {
|
|
477
|
+
return Ae(We);
|
|
360
478
|
}
|
|
361
|
-
const
|
|
362
|
-
function
|
|
479
|
+
const Ve = "Block", Te = "Line";
|
|
480
|
+
function ot({
|
|
363
481
|
value: e = "#65D3B3",
|
|
364
482
|
button: n = !1,
|
|
365
483
|
onChange: t
|
|
366
484
|
}) {
|
|
367
|
-
const
|
|
368
|
-
() =>
|
|
369
|
-
[
|
|
370
|
-
),
|
|
371
|
-
(
|
|
372
|
-
const { width:
|
|
373
|
-
|
|
374
|
-
let
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
I
|
|
485
|
+
const s = (K(q) || X()).getGroup("core"), r = S(null), u = S(null), [i, c] = B(), [a, o] = B(), [f, d] = B(), [p, v] = B(), [x, w] = J(e), [h, m] = B(e), g = S(null), T = S(null), b = A(() => De(x) || "#65D3B3", [x]), N = A(
|
|
486
|
+
() => se.hvsToHex(f || 0, 1, 1),
|
|
487
|
+
[f]
|
|
488
|
+
), k = D(
|
|
489
|
+
(L, P) => {
|
|
490
|
+
const { width: C, height: O } = r.current.getBoundingClientRect();
|
|
491
|
+
P < 0 ? P = 0 : P > O && (P = O), L < 0 ? L = 0 : L > C && (L = C), c(P), o(L);
|
|
492
|
+
let U, Y;
|
|
493
|
+
const I = C / 100, G = O / 100;
|
|
494
|
+
U = Math.ceil(L / I) / 100, Y = Math.ceil(Math.abs(P / G - 100)) / 100;
|
|
495
|
+
const Q = se.hvsToHex(
|
|
496
|
+
f,
|
|
497
|
+
U,
|
|
498
|
+
Y
|
|
382
499
|
);
|
|
383
|
-
|
|
500
|
+
w(Q), m(Q), t && t({ value: Q, input: !0 });
|
|
384
501
|
},
|
|
385
|
-
[
|
|
386
|
-
),
|
|
387
|
-
(
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
let
|
|
393
|
-
[,
|
|
394
|
-
const
|
|
395
|
-
|
|
502
|
+
[b, f, t]
|
|
503
|
+
), M = D(
|
|
504
|
+
(L) => {
|
|
505
|
+
const P = u.current.getBoundingClientRect().width;
|
|
506
|
+
L < 0 ? L = 0 : L > P && (L = P);
|
|
507
|
+
const C = Math.round(L * 359 / P), O = Math.max(Math.min(C, 359), 0);
|
|
508
|
+
d(O), v(L);
|
|
509
|
+
let U, Y;
|
|
510
|
+
[, U, Y] = se.hexToHvs(b);
|
|
511
|
+
const I = se.hvsToHex(O, U, Y);
|
|
512
|
+
w(I), m(I), t && t({ value: I, input: !0 });
|
|
396
513
|
},
|
|
397
|
-
[
|
|
398
|
-
)
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
514
|
+
[b, t]
|
|
515
|
+
);
|
|
516
|
+
g.current = k, T.current = M;
|
|
517
|
+
const $ = D((L) => {
|
|
518
|
+
const [P, C, O] = se.hexToHvs(L || b);
|
|
519
|
+
if (d(P), r.current) {
|
|
520
|
+
const { width: U, height: Y } = r.current.getBoundingClientRect();
|
|
521
|
+
u.current && v(
|
|
522
|
+
P * u.current.getBoundingClientRect().width / 359
|
|
523
|
+
), o(C * U), c(Math.abs(Y * (O - 1)));
|
|
405
524
|
}
|
|
406
|
-
}, [
|
|
407
|
-
({ target:
|
|
408
|
-
const
|
|
409
|
-
|
|
525
|
+
}, [b]), V = D(
|
|
526
|
+
({ target: L }) => {
|
|
527
|
+
const P = De(L.value);
|
|
528
|
+
m(L.value), P && (w(P), t && t({ value: P, input: !0 }), $(P));
|
|
410
529
|
},
|
|
411
|
-
[t,
|
|
412
|
-
),
|
|
413
|
-
(
|
|
414
|
-
|
|
530
|
+
[t, $]
|
|
531
|
+
), F = D(
|
|
532
|
+
(L) => {
|
|
533
|
+
L.stopPropagation(), t && t({ value: b });
|
|
415
534
|
},
|
|
416
|
-
[
|
|
417
|
-
),
|
|
418
|
-
(
|
|
419
|
-
const
|
|
420
|
-
let
|
|
421
|
-
const
|
|
422
|
-
if (
|
|
423
|
-
switch (
|
|
535
|
+
[b, t]
|
|
536
|
+
), j = D(
|
|
537
|
+
(L) => {
|
|
538
|
+
const P = L.target, C = P.getAttribute("data-slider") === Ve, O = P.getAttribute("data-slider") === Te;
|
|
539
|
+
let U = window.getComputedStyle(P), Y = parseFloat(U.left), I = parseFloat(U.top);
|
|
540
|
+
const G = L.code;
|
|
541
|
+
if (C) {
|
|
542
|
+
switch (G) {
|
|
424
543
|
case "ArrowLeft": {
|
|
425
|
-
|
|
544
|
+
Y--;
|
|
426
545
|
break;
|
|
427
546
|
}
|
|
428
547
|
case "ArrowRight": {
|
|
429
|
-
|
|
548
|
+
Y++;
|
|
430
549
|
break;
|
|
431
550
|
}
|
|
432
551
|
case "ArrowDown": {
|
|
433
|
-
|
|
552
|
+
I++;
|
|
434
553
|
break;
|
|
435
554
|
}
|
|
436
555
|
case "ArrowUp": {
|
|
437
|
-
|
|
556
|
+
I--;
|
|
438
557
|
break;
|
|
439
558
|
}
|
|
440
559
|
default:
|
|
441
560
|
return;
|
|
442
561
|
}
|
|
443
|
-
|
|
562
|
+
k(Y, I);
|
|
444
563
|
}
|
|
445
|
-
if (
|
|
446
|
-
if (
|
|
447
|
-
else if (
|
|
564
|
+
if (O) {
|
|
565
|
+
if (G === "ArrowLeft" || G === "ArrowDown") Y--;
|
|
566
|
+
else if (G === "ArrowRight" || G === "ArrowUp") Y++;
|
|
448
567
|
else return;
|
|
449
|
-
|
|
568
|
+
M(Y);
|
|
450
569
|
}
|
|
451
|
-
|
|
570
|
+
L.preventDefault();
|
|
452
571
|
},
|
|
453
|
-
[
|
|
572
|
+
[k, M]
|
|
454
573
|
);
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
574
|
+
W(() => {
|
|
575
|
+
const L = [];
|
|
576
|
+
return r.current && L.push(
|
|
577
|
+
be(r.current, {
|
|
578
|
+
moveBlockSlider: (P, C) => {
|
|
579
|
+
g.current?.(P, C);
|
|
580
|
+
}
|
|
581
|
+
}).destroy
|
|
582
|
+
), u.current && L.push(
|
|
583
|
+
be(u.current, {
|
|
584
|
+
moveLineSlider: (P) => {
|
|
585
|
+
T.current?.(P);
|
|
586
|
+
}
|
|
587
|
+
}).destroy
|
|
588
|
+
), requestAnimationFrame(() => $()), () => {
|
|
589
|
+
L.forEach((P) => P());
|
|
590
|
+
};
|
|
591
|
+
}, []);
|
|
592
|
+
const H = "wx-1yoKzq";
|
|
593
|
+
return /* @__PURE__ */ R("div", { className: H + " wx-colorboard", children: [
|
|
468
594
|
/* @__PURE__ */ l(
|
|
469
595
|
"div",
|
|
470
596
|
{
|
|
471
|
-
className:
|
|
472
|
-
style: { background:
|
|
597
|
+
className: H + " wx-color-block",
|
|
598
|
+
style: { background: N },
|
|
473
599
|
ref: r,
|
|
474
600
|
children: /* @__PURE__ */ l(
|
|
475
601
|
"div",
|
|
476
602
|
{
|
|
477
|
-
className:
|
|
603
|
+
className: H + " wx-color-block-slider wx-slider",
|
|
478
604
|
style: {
|
|
479
|
-
background:
|
|
480
|
-
top:
|
|
605
|
+
background: b,
|
|
606
|
+
top: i + "px",
|
|
481
607
|
left: a + "px"
|
|
482
608
|
},
|
|
483
609
|
tabIndex: 0,
|
|
484
|
-
"data-slider":
|
|
485
|
-
onKeyDown:
|
|
610
|
+
"data-slider": Ve,
|
|
611
|
+
onKeyDown: j
|
|
486
612
|
}
|
|
487
613
|
)
|
|
488
614
|
}
|
|
489
615
|
),
|
|
490
|
-
/* @__PURE__ */ l("div", { className:
|
|
616
|
+
/* @__PURE__ */ l("div", { className: H + " wx-color-line", ref: u, children: /* @__PURE__ */ l(
|
|
491
617
|
"div",
|
|
492
618
|
{
|
|
493
|
-
className:
|
|
494
|
-
style: { background:
|
|
619
|
+
className: H + " wx-color-line-slider wx-slider",
|
|
620
|
+
style: { background: N, left: p + "px" },
|
|
495
621
|
tabIndex: 0,
|
|
496
|
-
"data-slider":
|
|
497
|
-
onKeyDown:
|
|
622
|
+
"data-slider": Te,
|
|
623
|
+
onKeyDown: j
|
|
498
624
|
}
|
|
499
625
|
) }),
|
|
500
|
-
/* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ R("div", { className: H + " wx-color-controls", children: [
|
|
501
627
|
/* @__PURE__ */ l(
|
|
502
628
|
"div",
|
|
503
629
|
{
|
|
504
|
-
className:
|
|
505
|
-
style: { background:
|
|
630
|
+
className: H + " wx-color",
|
|
631
|
+
style: { background: b }
|
|
506
632
|
}
|
|
507
633
|
),
|
|
508
634
|
/* @__PURE__ */ l(
|
|
509
635
|
"input",
|
|
510
636
|
{
|
|
511
637
|
type: "text",
|
|
512
|
-
className:
|
|
513
|
-
value:
|
|
514
|
-
onChange:
|
|
638
|
+
className: H + " wx-text",
|
|
639
|
+
value: h,
|
|
640
|
+
onChange: V
|
|
515
641
|
}
|
|
516
642
|
)
|
|
517
643
|
] }),
|
|
518
|
-
n && /* @__PURE__ */ l(
|
|
644
|
+
n && /* @__PURE__ */ l(re, { onClick: F, type: "secondary", children: s("select") })
|
|
519
645
|
] });
|
|
520
646
|
}
|
|
521
|
-
function
|
|
647
|
+
function Kt({
|
|
522
648
|
value: e = "",
|
|
523
649
|
id: n,
|
|
524
650
|
placeholder: t = "",
|
|
525
|
-
title:
|
|
651
|
+
title: s = "",
|
|
526
652
|
disabled: r = !1,
|
|
527
|
-
error:
|
|
528
|
-
clear:
|
|
529
|
-
onChange:
|
|
653
|
+
error: u = !1,
|
|
654
|
+
clear: i = !1,
|
|
655
|
+
onChange: c,
|
|
656
|
+
dropdown: a = {}
|
|
530
657
|
}) {
|
|
531
|
-
const
|
|
532
|
-
let [
|
|
533
|
-
const [
|
|
534
|
-
function
|
|
658
|
+
const o = z(n);
|
|
659
|
+
let [f, d] = J(e);
|
|
660
|
+
const [p, v] = B(!1);
|
|
661
|
+
function x() {
|
|
535
662
|
if (r) return !1;
|
|
536
|
-
|
|
663
|
+
v(!0);
|
|
537
664
|
}
|
|
538
|
-
function
|
|
539
|
-
if (
|
|
540
|
-
|
|
541
|
-
const
|
|
542
|
-
|
|
665
|
+
function w(m) {
|
|
666
|
+
if (m.input) return;
|
|
667
|
+
v(!1);
|
|
668
|
+
const g = m.value;
|
|
669
|
+
d(g), c && c({ value: g });
|
|
543
670
|
}
|
|
544
|
-
function
|
|
545
|
-
|
|
671
|
+
function h(m) {
|
|
672
|
+
m.stopPropagation(), d(""), c && c({ value: "" });
|
|
546
673
|
}
|
|
547
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ R("div", { className: "wx-mmT8WH wx-colorpicker", onClick: x, children: [
|
|
548
675
|
/* @__PURE__ */ l(
|
|
549
676
|
"input",
|
|
550
677
|
{
|
|
551
|
-
className: "wx-mmT8WH wx-input" + (
|
|
552
|
-
title:
|
|
553
|
-
value:
|
|
678
|
+
className: "wx-mmT8WH wx-input" + (u ? " wx-error" : "") + (p ? " wx-focus" : ""),
|
|
679
|
+
title: s,
|
|
680
|
+
value: f,
|
|
554
681
|
readOnly: !0,
|
|
555
|
-
id:
|
|
682
|
+
id: o,
|
|
556
683
|
placeholder: t,
|
|
557
684
|
disabled: r
|
|
558
685
|
}
|
|
559
686
|
),
|
|
560
|
-
/* @__PURE__ */ l("div", { className: "wx-mmT8WH wx-color", style: { background:
|
|
561
|
-
|
|
562
|
-
|
|
687
|
+
/* @__PURE__ */ l("div", { className: "wx-mmT8WH wx-color", style: { background: f } }),
|
|
688
|
+
i && !r && f && /* @__PURE__ */ l("i", { className: "wx-mmT8WH wxi-close", onClick: h }),
|
|
689
|
+
p && /* @__PURE__ */ l(le, { onCancel: () => v(!1), ...a, children: /* @__PURE__ */ l(ot, { value: f, button: "true", onChange: w }) })
|
|
563
690
|
] });
|
|
564
691
|
}
|
|
565
|
-
function
|
|
566
|
-
let e = null, n = !1, t,
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
},
|
|
570
|
-
e =
|
|
571
|
-
},
|
|
572
|
-
if (
|
|
573
|
-
const
|
|
574
|
-
|
|
692
|
+
function it() {
|
|
693
|
+
let e = null, n = !1, t = !1, s, r, u, i;
|
|
694
|
+
const c = (v, x, w, h, m) => {
|
|
695
|
+
s = v, r = x, u = w, i = h, t = m;
|
|
696
|
+
}, a = (v) => {
|
|
697
|
+
e = v, n = e !== null, u(e);
|
|
698
|
+
}, o = (v, x) => {
|
|
699
|
+
if (!t && v !== null && s) {
|
|
700
|
+
const w = s.querySelectorAll(".wx-list > .wx-item")[v];
|
|
701
|
+
w && (w.scrollIntoView({ block: "nearest" }), x && x.preventDefault());
|
|
575
702
|
}
|
|
576
|
-
},
|
|
577
|
-
const
|
|
578
|
-
|
|
703
|
+
}, f = (v, x) => {
|
|
704
|
+
const w = v === null ? null : Math.max(0, Math.min(e + v, r.length - 1));
|
|
705
|
+
w !== e && (a(w), s ? o(w, x) : requestAnimationFrame(() => o(w, x)));
|
|
579
706
|
};
|
|
580
|
-
return { move: (
|
|
581
|
-
const
|
|
582
|
-
|
|
583
|
-
}, keydown: (
|
|
584
|
-
switch (
|
|
707
|
+
return { move: (v) => {
|
|
708
|
+
const x = Xe(v), w = r.findIndex((h) => h.id === x);
|
|
709
|
+
w !== e && a(w);
|
|
710
|
+
}, keydown: (v, x) => {
|
|
711
|
+
switch (v.code) {
|
|
585
712
|
case "Enter":
|
|
586
|
-
n ? i() :
|
|
713
|
+
n ? i() : a(0);
|
|
587
714
|
break;
|
|
588
715
|
case "Space":
|
|
589
|
-
n ||
|
|
716
|
+
n || a(0);
|
|
590
717
|
break;
|
|
591
718
|
case "Escape":
|
|
592
|
-
|
|
719
|
+
u(e = null);
|
|
593
720
|
break;
|
|
594
721
|
case "Tab":
|
|
595
|
-
|
|
722
|
+
u(e = null);
|
|
596
723
|
break;
|
|
597
724
|
case "ArrowDown":
|
|
598
|
-
|
|
725
|
+
f(n ? 1 : x || 0, v);
|
|
599
726
|
break;
|
|
600
727
|
case "ArrowUp":
|
|
601
|
-
|
|
728
|
+
f(n ? -1 : x || 0, v);
|
|
602
729
|
break;
|
|
603
730
|
}
|
|
604
|
-
}, init:
|
|
731
|
+
}, init: c, navigate: f };
|
|
732
|
+
}
|
|
733
|
+
const Re = 10, ut = Ue(function({ data: n, checkboxes: t, children: s, value: r }) {
|
|
734
|
+
return /* @__PURE__ */ R(_, { children: [
|
|
735
|
+
t && /* @__PURE__ */ l(
|
|
736
|
+
Ye,
|
|
737
|
+
{
|
|
738
|
+
id: n.id,
|
|
739
|
+
style: { marginRight: "8px", pointerEvents: "none" },
|
|
740
|
+
value: r && r.includes(n.id)
|
|
741
|
+
}
|
|
742
|
+
),
|
|
743
|
+
s ? ae(s, { option: n }) : n.label
|
|
744
|
+
] });
|
|
745
|
+
});
|
|
746
|
+
function $e({
|
|
747
|
+
visibleItems: e,
|
|
748
|
+
visibleRange: n,
|
|
749
|
+
navIndex: t,
|
|
750
|
+
checkboxes: s,
|
|
751
|
+
children: r,
|
|
752
|
+
value: u,
|
|
753
|
+
measureRefCallback: i
|
|
754
|
+
}) {
|
|
755
|
+
return e.map((c, a) => {
|
|
756
|
+
const o = n.start + a;
|
|
757
|
+
return /* @__PURE__ */ l(
|
|
758
|
+
"div",
|
|
759
|
+
{
|
|
760
|
+
ref: a === 0 ? i : void 0,
|
|
761
|
+
className: `wx-233fr7 wx-item ${o === t ? "wx-focus" : ""}`,
|
|
762
|
+
"data-id": c.id,
|
|
763
|
+
children: /* @__PURE__ */ l(
|
|
764
|
+
ut,
|
|
765
|
+
{
|
|
766
|
+
data: c,
|
|
767
|
+
checkboxes: s,
|
|
768
|
+
children: r,
|
|
769
|
+
value: u
|
|
770
|
+
}
|
|
771
|
+
)
|
|
772
|
+
},
|
|
773
|
+
c.id
|
|
774
|
+
);
|
|
775
|
+
});
|
|
605
776
|
}
|
|
606
|
-
function
|
|
777
|
+
function ge({
|
|
607
778
|
items: e = [],
|
|
608
779
|
children: n,
|
|
609
780
|
onSelect: t,
|
|
610
|
-
onReady:
|
|
781
|
+
onReady: s,
|
|
782
|
+
virtualized: r = !1,
|
|
783
|
+
checkboxes: u,
|
|
784
|
+
multiselect: i,
|
|
785
|
+
value: c,
|
|
786
|
+
...a
|
|
611
787
|
}) {
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
788
|
+
const o = S(), f = S(!1), d = S(it()), [p, v] = B(null), x = S(p), [w, h] = B(0), [m, g] = B(24), T = S(!1), b = (K(q) || X()).getGroup("core"), N = S(e);
|
|
789
|
+
W(() => {
|
|
790
|
+
N.current = e;
|
|
791
|
+
}, [e]);
|
|
792
|
+
const k = S(c);
|
|
793
|
+
W(() => {
|
|
794
|
+
k.current = c;
|
|
795
|
+
}, [c]);
|
|
796
|
+
const M = S(0);
|
|
797
|
+
W(() => {
|
|
798
|
+
M.current = m;
|
|
799
|
+
}, [m]);
|
|
800
|
+
const $ = D((y) => {
|
|
801
|
+
y && y.stopPropagation();
|
|
802
|
+
const E = N.current, Z = k.current, ce = x.current;
|
|
803
|
+
let ee;
|
|
804
|
+
const te = E[ce]?.id;
|
|
805
|
+
i ? Z && Z.includes(te) ? ee = Z.filter((we) => we !== te) : ee = [...Z || [], te] : ee = te, t && t({ id: ee });
|
|
806
|
+
}, [i, t]), V = S($);
|
|
807
|
+
W(() => {
|
|
808
|
+
V.current = $;
|
|
809
|
+
}, [$]);
|
|
810
|
+
const F = D((y) => {
|
|
811
|
+
if (o.current) {
|
|
812
|
+
let E = y * M.current - o.current.clientHeight + M.current;
|
|
813
|
+
h(E), o.current.scrollTop = E;
|
|
814
|
+
}
|
|
815
|
+
}, [M.current]), j = D(
|
|
816
|
+
(y) => {
|
|
817
|
+
o.current = y, r && (y && !f.current && x.current !== null && requestAnimationFrame(() => {
|
|
818
|
+
o.current && (F(x.current), f.current = !0);
|
|
819
|
+
}), y || (f.current = !1));
|
|
820
|
+
},
|
|
821
|
+
[F]
|
|
822
|
+
), H = D((y) => {
|
|
823
|
+
if (!y || T.current) return;
|
|
824
|
+
const E = y.getBoundingClientRect().height;
|
|
825
|
+
E && (g(E), M.current = E, T.current = !0);
|
|
826
|
+
}, []);
|
|
827
|
+
W(() => {
|
|
828
|
+
d.current.init(
|
|
829
|
+
o.current,
|
|
618
830
|
e,
|
|
619
|
-
(
|
|
620
|
-
|
|
831
|
+
(y) => {
|
|
832
|
+
v(y), x.current = y;
|
|
621
833
|
},
|
|
622
|
-
|
|
834
|
+
(y) => V.current(y),
|
|
835
|
+
r
|
|
623
836
|
);
|
|
624
|
-
}, [e,
|
|
625
|
-
|
|
837
|
+
}, [e, o.current, r]), W(() => {
|
|
838
|
+
const y = (Z, ce) => {
|
|
839
|
+
d.current.navigate(Z, ce), F(x.current);
|
|
840
|
+
}, E = (Z, ce) => {
|
|
841
|
+
const ee = x.current, te = N.current;
|
|
842
|
+
if (ee !== 0 && ee !== te.length - 1 && (Z.key === "ArrowDown" || Z.key === "ArrowUp") && Z.preventDefault(), d.current.keydown(Z, ce), o.current) {
|
|
843
|
+
const we = o.current.scrollTop <= x.current * M.current, Ge = o.current.scrollTop + o.current.clientHeight >= x.current * M.current + M.current;
|
|
844
|
+
we ? Ge || F(x.current) : (o.current.scrollTop = x.current * M.current, h(o.current.scrollTop));
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
s && s({
|
|
848
|
+
navigate: r ? y : d.current.navigate,
|
|
849
|
+
keydown: r ? E : d.current.keydown,
|
|
850
|
+
move: d.current.move
|
|
851
|
+
});
|
|
626
852
|
}, []);
|
|
627
|
-
const
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
853
|
+
const L = S(0), P = S(e);
|
|
854
|
+
P.current !== e && (P.current = e, L.current += 1);
|
|
855
|
+
const C = D(() => {
|
|
856
|
+
d.current.navigate(null);
|
|
857
|
+
}, [d]), O = D((y) => {
|
|
858
|
+
r && h(y.target.scrollTop);
|
|
859
|
+
}, [r]), U = A(
|
|
860
|
+
() => Math.ceil((o.current?.clientHeight || 0) / m),
|
|
861
|
+
[m, w]
|
|
862
|
+
), Y = A(() => {
|
|
863
|
+
if (!r) return { start: 0, end: e.length };
|
|
864
|
+
if (!e.length) return { start: 0, end: 0 };
|
|
865
|
+
const y = Math.floor(w / m), E = y + U;
|
|
866
|
+
return {
|
|
867
|
+
start: Math.max(0, y - Re),
|
|
868
|
+
end: Math.min(e.length, E + Re)
|
|
869
|
+
};
|
|
870
|
+
}, [r, e, w, m, U]), I = A(() => {
|
|
871
|
+
if (!r) return e;
|
|
872
|
+
const { start: y, end: E } = Y;
|
|
873
|
+
return e.slice(y, E).map((Z) => ({
|
|
874
|
+
...Z
|
|
875
|
+
}));
|
|
876
|
+
}, [r, e, Y]), G = Y.start * m, Q = e.length * m;
|
|
877
|
+
return W(() => {
|
|
878
|
+
p === null && (f.current = !1);
|
|
879
|
+
}, [p]), p === null ? null : /* @__PURE__ */ l(le, { onCancel: C, ...a, children: /* @__PURE__ */ l(
|
|
631
880
|
"div",
|
|
632
881
|
{
|
|
633
882
|
className: "wx-233fr7 wx-list",
|
|
634
|
-
ref:
|
|
635
|
-
onClick:
|
|
636
|
-
onMouseMove:
|
|
637
|
-
|
|
883
|
+
ref: j,
|
|
884
|
+
onClick: $,
|
|
885
|
+
onMouseMove: d.current.move,
|
|
886
|
+
onScroll: O,
|
|
887
|
+
children: e.length ? r ? /* @__PURE__ */ l(
|
|
638
888
|
"div",
|
|
639
889
|
{
|
|
640
|
-
className:
|
|
641
|
-
|
|
642
|
-
children:
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
890
|
+
className: "wx-233fr7 wx-list-wrapper",
|
|
891
|
+
style: { height: `${Q}px` },
|
|
892
|
+
children: /* @__PURE__ */ l(
|
|
893
|
+
"div",
|
|
894
|
+
{
|
|
895
|
+
className: "wx-233fr7 wx-list-content",
|
|
896
|
+
style: { transform: `translateY(${G}px)` },
|
|
897
|
+
children: /* @__PURE__ */ l(
|
|
898
|
+
$e,
|
|
899
|
+
{
|
|
900
|
+
visibleRange: Y,
|
|
901
|
+
visibleItems: I,
|
|
902
|
+
navIndex: p,
|
|
903
|
+
measureRefCallback: H,
|
|
904
|
+
checkboxes: u,
|
|
905
|
+
children: n,
|
|
906
|
+
value: c
|
|
907
|
+
}
|
|
908
|
+
)
|
|
909
|
+
}
|
|
910
|
+
)
|
|
911
|
+
}
|
|
912
|
+
) : /* @__PURE__ */ l(
|
|
913
|
+
$e,
|
|
914
|
+
{
|
|
915
|
+
visibleRange: Y,
|
|
916
|
+
visibleItems: I,
|
|
917
|
+
navIndex: p,
|
|
918
|
+
measureRefCallback: H,
|
|
919
|
+
checkboxes: u,
|
|
920
|
+
children: n,
|
|
921
|
+
value: c
|
|
922
|
+
}
|
|
923
|
+
) : /* @__PURE__ */ l("div", { className: "wx-233fr7 wx-no-data", children: b("No data") })
|
|
646
924
|
}
|
|
647
|
-
) });
|
|
925
|
+
) }, L.current);
|
|
648
926
|
}
|
|
649
|
-
function
|
|
927
|
+
function Zt({
|
|
650
928
|
value: e = "",
|
|
651
929
|
id: n,
|
|
652
930
|
options: t = [],
|
|
653
|
-
textOptions:
|
|
931
|
+
textOptions: s = null,
|
|
654
932
|
textField: r = "label",
|
|
655
|
-
placeholder:
|
|
656
|
-
title:
|
|
657
|
-
disabled:
|
|
933
|
+
placeholder: u = "",
|
|
934
|
+
title: i = "",
|
|
935
|
+
disabled: c = !1,
|
|
658
936
|
error: a = !1,
|
|
659
|
-
clear:
|
|
660
|
-
children:
|
|
661
|
-
onChange:
|
|
937
|
+
clear: o = !1,
|
|
938
|
+
children: f,
|
|
939
|
+
onChange: d,
|
|
940
|
+
dropdown: p = {}
|
|
662
941
|
}) {
|
|
663
|
-
const
|
|
664
|
-
if (
|
|
665
|
-
if (
|
|
666
|
-
const
|
|
667
|
-
if (
|
|
942
|
+
const v = z(n), x = S(null), w = S(null), [h, m] = J(e), [g, T] = B(!1), [b, N] = B(""), k = S(null), M = S(!1), $ = A(() => {
|
|
943
|
+
if (g) return b;
|
|
944
|
+
if (h || h === 0) {
|
|
945
|
+
const I = (s || t).find((G) => G.id === h);
|
|
946
|
+
if (I) return I[r];
|
|
668
947
|
}
|
|
669
948
|
return "";
|
|
670
|
-
}, [
|
|
671
|
-
(
|
|
672
|
-
), [
|
|
673
|
-
() =>
|
|
674
|
-
[
|
|
675
|
-
),
|
|
676
|
-
|
|
677
|
-
}, []),
|
|
678
|
-
(
|
|
679
|
-
if (
|
|
680
|
-
let
|
|
681
|
-
if (
|
|
682
|
-
const
|
|
683
|
-
|
|
949
|
+
}, [g, b, h, s, t, r]), V = A(() => !$ || !g ? t : t.filter(
|
|
950
|
+
(I) => I[r].toLowerCase().includes($.toLowerCase())
|
|
951
|
+
), [$, g, t, r]), F = D(
|
|
952
|
+
() => V.findIndex((I) => I.id === h),
|
|
953
|
+
[V, h]
|
|
954
|
+
), j = D((I) => {
|
|
955
|
+
x.current = I.navigate, w.current = I.keydown;
|
|
956
|
+
}, []), H = D(
|
|
957
|
+
(I, G) => {
|
|
958
|
+
if (I || I === 0) {
|
|
959
|
+
let Q = t.find((y) => y.id === I);
|
|
960
|
+
if (T(!1), G && x.current(null), Q && h !== Q.id) {
|
|
961
|
+
const y = Q.id;
|
|
962
|
+
m(y), d && d({ value: y });
|
|
684
963
|
}
|
|
685
964
|
}
|
|
686
|
-
!M.current &&
|
|
965
|
+
!M.current && G && k.current.focus();
|
|
687
966
|
},
|
|
688
|
-
[t,
|
|
689
|
-
),
|
|
690
|
-
({ id:
|
|
691
|
-
|
|
967
|
+
[t, h, d]
|
|
968
|
+
), L = D(
|
|
969
|
+
({ id: I }) => {
|
|
970
|
+
H(I, !0);
|
|
692
971
|
},
|
|
693
|
-
[
|
|
694
|
-
),
|
|
695
|
-
(
|
|
696
|
-
|
|
972
|
+
[H]
|
|
973
|
+
), P = D(
|
|
974
|
+
(I) => {
|
|
975
|
+
I && I.stopPropagation(), m(""), T(!1), d && d({ value: "" });
|
|
697
976
|
},
|
|
698
|
-
[
|
|
699
|
-
),
|
|
700
|
-
(
|
|
977
|
+
[d]
|
|
978
|
+
), C = D(
|
|
979
|
+
(I) => {
|
|
701
980
|
if (!t.length) return;
|
|
702
|
-
if (
|
|
703
|
-
|
|
981
|
+
if (I === "" && o) {
|
|
982
|
+
P();
|
|
704
983
|
return;
|
|
705
984
|
}
|
|
706
|
-
let
|
|
707
|
-
|
|
708
|
-
(
|
|
985
|
+
let G = t.find((y) => y[r] === I);
|
|
986
|
+
G || (G = t.find(
|
|
987
|
+
(y) => y[r].toLowerCase().includes(I.toLowerCase())
|
|
709
988
|
));
|
|
710
|
-
const
|
|
711
|
-
|
|
989
|
+
const Q = G ? G.id : h || t[0].id;
|
|
990
|
+
H(Q, !1);
|
|
712
991
|
},
|
|
713
|
-
[t, r,
|
|
714
|
-
), O =
|
|
715
|
-
|
|
716
|
-
}, [
|
|
992
|
+
[t, r, o, h, H, P]
|
|
993
|
+
), O = D(() => {
|
|
994
|
+
N(k.current.value), T(!0), V.length && x.current(0);
|
|
995
|
+
}, [V.length, x]), U = D(() => {
|
|
717
996
|
M.current = !0;
|
|
718
|
-
}, []),
|
|
997
|
+
}, []), Y = D(() => {
|
|
719
998
|
M.current = !1, setTimeout(() => {
|
|
720
|
-
M.current ||
|
|
999
|
+
M.current || C($);
|
|
721
1000
|
}, 200);
|
|
722
|
-
}, [
|
|
723
|
-
return /* @__PURE__ */
|
|
1001
|
+
}, [C, $]);
|
|
1002
|
+
return /* @__PURE__ */ R(
|
|
724
1003
|
"div",
|
|
725
1004
|
{
|
|
726
1005
|
className: "wx-1j11Jk wx-combo",
|
|
727
|
-
onClick: () =>
|
|
728
|
-
onKeyDown: (
|
|
729
|
-
title:
|
|
1006
|
+
onClick: () => x.current(F()),
|
|
1007
|
+
onKeyDown: (I) => w.current(I, F()),
|
|
1008
|
+
title: i,
|
|
730
1009
|
children: [
|
|
731
1010
|
/* @__PURE__ */ l(
|
|
732
1011
|
"input",
|
|
733
1012
|
{
|
|
734
1013
|
className: "wx-1j11Jk wx-input " + (a ? "wx-error" : ""),
|
|
735
|
-
id:
|
|
736
|
-
ref:
|
|
737
|
-
value:
|
|
738
|
-
disabled:
|
|
739
|
-
placeholder:
|
|
740
|
-
onFocus:
|
|
741
|
-
onBlur:
|
|
1014
|
+
id: v,
|
|
1015
|
+
ref: k,
|
|
1016
|
+
value: $,
|
|
1017
|
+
disabled: c,
|
|
1018
|
+
placeholder: u,
|
|
1019
|
+
onFocus: U,
|
|
1020
|
+
onBlur: Y,
|
|
742
1021
|
onInput: O
|
|
743
1022
|
}
|
|
744
1023
|
),
|
|
745
|
-
|
|
746
|
-
!
|
|
1024
|
+
o && !c && h ? /* @__PURE__ */ l("i", { className: "wx-1j11Jk wx-icon wxi-close", onClick: P }) : /* @__PURE__ */ l("i", { className: "wx-1j11Jk wx-icon wxi-angle-down" }),
|
|
1025
|
+
!c && /* @__PURE__ */ l(ge, { items: V, onReady: j, onSelect: L, ...p, children: ({ option: I }) => /* @__PURE__ */ l(_, { children: f ? f({ option: I }) : I[r] }) })
|
|
747
1026
|
]
|
|
748
1027
|
}
|
|
749
1028
|
);
|
|
750
1029
|
}
|
|
751
|
-
function
|
|
1030
|
+
function Ne({
|
|
752
1031
|
value: e = "",
|
|
753
1032
|
id: n,
|
|
754
1033
|
readonly: t = !1,
|
|
755
|
-
focus:
|
|
1034
|
+
focus: s = !1,
|
|
756
1035
|
select: r = !1,
|
|
757
|
-
type:
|
|
758
|
-
placeholder:
|
|
759
|
-
disabled:
|
|
1036
|
+
type: u = "text",
|
|
1037
|
+
placeholder: i = "",
|
|
1038
|
+
disabled: c = !1,
|
|
760
1039
|
error: a = !1,
|
|
761
|
-
inputStyle:
|
|
762
|
-
title:
|
|
763
|
-
css:
|
|
764
|
-
icon:
|
|
765
|
-
clear:
|
|
766
|
-
onChange:
|
|
1040
|
+
inputStyle: o = {},
|
|
1041
|
+
title: f = "",
|
|
1042
|
+
css: d = "",
|
|
1043
|
+
icon: p = "",
|
|
1044
|
+
clear: v = !1,
|
|
1045
|
+
onChange: x
|
|
767
1046
|
}) {
|
|
768
|
-
const
|
|
769
|
-
() =>
|
|
770
|
-
[
|
|
771
|
-
),
|
|
772
|
-
() =>
|
|
773
|
-
[
|
|
1047
|
+
const w = z(n), [h, m] = J(e), g = S(null), T = A(
|
|
1048
|
+
() => p && d.indexOf("wx-icon-left") === -1 ? "wx-icon-right " + d : d,
|
|
1049
|
+
[p, d]
|
|
1050
|
+
), b = A(
|
|
1051
|
+
() => p && d.indexOf("wx-icon-left") !== -1,
|
|
1052
|
+
[p, d]
|
|
774
1053
|
);
|
|
775
|
-
|
|
776
|
-
const
|
|
777
|
-
|
|
1054
|
+
W(() => {
|
|
1055
|
+
const V = setTimeout(() => {
|
|
1056
|
+
s && g.current && g.current.focus(), r && g.current && g.current.select();
|
|
778
1057
|
}, 1);
|
|
779
|
-
return () => clearTimeout(
|
|
780
|
-
}, [
|
|
781
|
-
const
|
|
782
|
-
(
|
|
783
|
-
const
|
|
784
|
-
|
|
1058
|
+
return () => clearTimeout(V);
|
|
1059
|
+
}, [s, r]);
|
|
1060
|
+
const N = D(
|
|
1061
|
+
(V) => {
|
|
1062
|
+
const F = V.target.value;
|
|
1063
|
+
m(F), x && x({ value: F, input: !0 });
|
|
785
1064
|
},
|
|
786
|
-
[
|
|
787
|
-
),
|
|
788
|
-
(
|
|
789
|
-
[
|
|
1065
|
+
[x]
|
|
1066
|
+
), k = D(
|
|
1067
|
+
(V) => x && x({ value: V.target.value }),
|
|
1068
|
+
[x]
|
|
790
1069
|
);
|
|
791
|
-
function
|
|
792
|
-
|
|
1070
|
+
function M(V) {
|
|
1071
|
+
V.stopPropagation(), m(""), x && x({ value: "" });
|
|
793
1072
|
}
|
|
794
|
-
let
|
|
795
|
-
return
|
|
796
|
-
const
|
|
797
|
-
return
|
|
798
|
-
|
|
1073
|
+
let $ = u;
|
|
1074
|
+
return u !== "password" && u !== "number" && ($ = "text"), W(() => {
|
|
1075
|
+
const V = k, F = g.current;
|
|
1076
|
+
return F.addEventListener("change", V), () => {
|
|
1077
|
+
F && F.removeEventListener("change", V);
|
|
799
1078
|
};
|
|
800
|
-
}, [
|
|
1079
|
+
}, [k]), /* @__PURE__ */ R(
|
|
801
1080
|
"div",
|
|
802
1081
|
{
|
|
803
|
-
className: `wx-hQ64J4 wx-text ${
|
|
1082
|
+
className: `wx-hQ64J4 wx-text ${T} ${a ? "wx-error" : ""} ${c ? "wx-disabled" : ""} ${v ? "wx-clear" : ""}`,
|
|
804
1083
|
children: [
|
|
805
1084
|
/* @__PURE__ */ l(
|
|
806
1085
|
"input",
|
|
807
1086
|
{
|
|
808
1087
|
className: "wx-hQ64J4 wx-input",
|
|
809
|
-
ref:
|
|
810
|
-
id:
|
|
1088
|
+
ref: g,
|
|
1089
|
+
id: w,
|
|
811
1090
|
readOnly: t,
|
|
812
|
-
disabled:
|
|
813
|
-
placeholder:
|
|
814
|
-
type:
|
|
815
|
-
style:
|
|
816
|
-
title:
|
|
1091
|
+
disabled: c,
|
|
1092
|
+
placeholder: i,
|
|
1093
|
+
type: $,
|
|
1094
|
+
style: o,
|
|
1095
|
+
title: f,
|
|
817
1096
|
value: h,
|
|
818
|
-
onInput:
|
|
1097
|
+
onInput: N
|
|
819
1098
|
}
|
|
820
1099
|
),
|
|
821
|
-
|
|
822
|
-
/* @__PURE__ */ l("i", { className: "wx-hQ64J4 wx-icon wxi-close", onClick:
|
|
823
|
-
|
|
824
|
-
] }) :
|
|
1100
|
+
v && !c && h ? /* @__PURE__ */ R(_, { children: [
|
|
1101
|
+
/* @__PURE__ */ l("i", { className: "wx-hQ64J4 wx-icon wxi-close", onClick: M }),
|
|
1102
|
+
b && /* @__PURE__ */ l("i", { className: `wx-hQ64J4 wx-icon ${p}` })
|
|
1103
|
+
] }) : p ? /* @__PURE__ */ l("i", { className: `wx-hQ64J4 wx-icon ${p}` }) : null
|
|
825
1104
|
]
|
|
826
1105
|
}
|
|
827
1106
|
);
|
|
828
1107
|
}
|
|
829
|
-
function
|
|
830
|
-
const { calendar: r, formats:
|
|
1108
|
+
function dt({ date: e, type: n, part: t, onShift: s }) {
|
|
1109
|
+
const { calendar: r, formats: u } = K(q).getRaw(), i = e.getFullYear(), c = A(() => {
|
|
831
1110
|
switch (n) {
|
|
832
1111
|
case "month":
|
|
833
|
-
return
|
|
1112
|
+
return ne(u.monthYearFormat, r)(e);
|
|
834
1113
|
case "year":
|
|
835
|
-
return
|
|
1114
|
+
return ne(u.yearFormat, r)(e);
|
|
836
1115
|
case "duodecade": {
|
|
837
|
-
const { start:
|
|
838
|
-
return `${
|
|
1116
|
+
const { start: o, end: f } = Be(i), d = ne(u.yearFormat, r);
|
|
1117
|
+
return `${d(new Date(o, 0, 1))} - ${d(new Date(f, 11, 31))}`;
|
|
839
1118
|
}
|
|
840
1119
|
default:
|
|
841
1120
|
return "";
|
|
842
1121
|
}
|
|
843
|
-
}, [e, n,
|
|
1122
|
+
}, [e, n, i, r, u]);
|
|
844
1123
|
function a() {
|
|
845
|
-
|
|
1124
|
+
s && s({ diff: 0, type: n });
|
|
846
1125
|
}
|
|
847
|
-
return /* @__PURE__ */
|
|
1126
|
+
return /* @__PURE__ */ R("div", { className: "wx-8HQVQV wx-header", children: [
|
|
848
1127
|
t !== "right" ? /* @__PURE__ */ l(
|
|
849
1128
|
"i",
|
|
850
1129
|
{
|
|
851
1130
|
className: "wx-8HQVQV wx-pager wxi-angle-left",
|
|
852
|
-
onClick: () =>
|
|
1131
|
+
onClick: () => s && s({ diff: -1, type: n })
|
|
853
1132
|
}
|
|
854
1133
|
) : /* @__PURE__ */ l("span", { className: "wx-8HQVQV wx-spacer" }),
|
|
855
|
-
/* @__PURE__ */ l("span", { className: "wx-8HQVQV wx-label", onClick: a, children:
|
|
1134
|
+
/* @__PURE__ */ l("span", { className: "wx-8HQVQV wx-label", onClick: a, children: c }),
|
|
856
1135
|
t !== "left" ? /* @__PURE__ */ l(
|
|
857
1136
|
"i",
|
|
858
1137
|
{
|
|
859
1138
|
className: "wx-8HQVQV wx-pager wxi-angle-right",
|
|
860
|
-
onClick: () =>
|
|
1139
|
+
onClick: () => s && s({ diff: 1, type: n })
|
|
861
1140
|
}
|
|
862
1141
|
) : /* @__PURE__ */ l("span", { className: "wx-8HQVQV wx-spacer" })
|
|
863
1142
|
] });
|
|
864
1143
|
}
|
|
865
|
-
function
|
|
1144
|
+
function ke({ onClick: e, children: n }) {
|
|
866
1145
|
return /* @__PURE__ */ l("button", { className: "wx-3s8W4d wx-button", onClick: e, children: n });
|
|
867
1146
|
}
|
|
868
|
-
function
|
|
1147
|
+
function ft({
|
|
869
1148
|
value: e,
|
|
870
1149
|
current: n,
|
|
871
1150
|
part: t = "",
|
|
872
|
-
markers:
|
|
1151
|
+
markers: s = null,
|
|
873
1152
|
onCancel: r,
|
|
874
|
-
onChange:
|
|
1153
|
+
onChange: u
|
|
875
1154
|
}) {
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1155
|
+
const i = (K(q) || X()).getRaw().calendar, c = (i.weekStart || 7) % 7, a = i.dayShort.slice(c).concat(i.dayShort.slice(0, c)), o = (b, N, k) => new Date(
|
|
1156
|
+
b.getFullYear(),
|
|
1157
|
+
b.getMonth() + (N || 0),
|
|
1158
|
+
b.getDate() + (k || 0)
|
|
880
1159
|
);
|
|
881
|
-
let
|
|
882
|
-
function
|
|
883
|
-
const
|
|
884
|
-
return
|
|
1160
|
+
let f = t !== "normal";
|
|
1161
|
+
function d(b) {
|
|
1162
|
+
const N = b.getDay();
|
|
1163
|
+
return N === 0 || N === 6;
|
|
885
1164
|
}
|
|
886
|
-
function
|
|
887
|
-
const
|
|
888
|
-
return
|
|
1165
|
+
function p() {
|
|
1166
|
+
const b = o(n, 0, 1 - n.getDate());
|
|
1167
|
+
return b.setDate(b.getDate() - (b.getDay() - (c - 7)) % 7), b;
|
|
889
1168
|
}
|
|
890
|
-
function
|
|
891
|
-
const
|
|
892
|
-
return
|
|
1169
|
+
function v() {
|
|
1170
|
+
const b = o(n, 1, -n.getDate());
|
|
1171
|
+
return b.setDate(b.getDate() + (6 - b.getDay() + c) % 7), b;
|
|
893
1172
|
}
|
|
894
|
-
const
|
|
895
|
-
function
|
|
896
|
-
|
|
1173
|
+
const x = S(0);
|
|
1174
|
+
function w(b, N) {
|
|
1175
|
+
N.timeStamp !== x.current && (x.current = N.timeStamp, N.stopPropagation(), u && u(new Date(b)), r && r());
|
|
897
1176
|
}
|
|
898
|
-
const h =
|
|
899
|
-
e.start ?
|
|
900
|
-
e.end ?
|
|
901
|
-
] : [0, 0], [t, e]),
|
|
902
|
-
const
|
|
903
|
-
let
|
|
904
|
-
for (let
|
|
905
|
-
const
|
|
906
|
-
day:
|
|
907
|
-
in:
|
|
908
|
-
date:
|
|
1177
|
+
const h = A(() => t == "normal" ? [e ? o(e).valueOf() : 0] : e ? [
|
|
1178
|
+
e.start ? o(e.start).valueOf() : 0,
|
|
1179
|
+
e.end ? o(e.end).valueOf() : 0
|
|
1180
|
+
] : [0, 0], [t, e]), m = A(() => {
|
|
1181
|
+
const b = p(), N = v(), k = n.getMonth();
|
|
1182
|
+
let M = [];
|
|
1183
|
+
for (let $ = b; $ <= N; $.setDate($.getDate() + 1)) {
|
|
1184
|
+
const V = {
|
|
1185
|
+
day: $.getDate(),
|
|
1186
|
+
in: $.getMonth() === k,
|
|
1187
|
+
date: $.valueOf()
|
|
909
1188
|
};
|
|
910
|
-
let
|
|
911
|
-
if (
|
|
912
|
-
const
|
|
913
|
-
|
|
1189
|
+
let F = "";
|
|
1190
|
+
if (F += V.in ? "" : " wx-inactive", F += h.indexOf(V.date) > -1 ? " wx-selected" : "", f) {
|
|
1191
|
+
const j = V.date == h[0], H = V.date == h[1];
|
|
1192
|
+
j && !H ? F += " wx-left" : H && !j && (F += " wx-right"), V.date > h[0] && V.date < h[1] && (F += " wx-inrange");
|
|
914
1193
|
}
|
|
915
|
-
if (
|
|
916
|
-
const
|
|
917
|
-
|
|
1194
|
+
if (F += d($) ? " wx-weekend" : "", s) {
|
|
1195
|
+
const j = s($);
|
|
1196
|
+
j && (F += " " + j);
|
|
918
1197
|
}
|
|
919
|
-
|
|
1198
|
+
M.push({ ...V, css: F });
|
|
920
1199
|
}
|
|
921
|
-
return
|
|
922
|
-
}, [n, h,
|
|
923
|
-
let
|
|
924
|
-
return
|
|
925
|
-
|
|
926
|
-
}, []), /* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */ l("div", { className: "wx-398RBS wx-weekdays", children: a.map((
|
|
928
|
-
/* @__PURE__ */ l("div", { className: "wx-398RBS wx-days", ref:
|
|
1200
|
+
return M;
|
|
1201
|
+
}, [n, h, f, s]), g = S(null);
|
|
1202
|
+
let T = S({});
|
|
1203
|
+
return T.current.click = w, W(() => {
|
|
1204
|
+
Ee(g.current, T.current);
|
|
1205
|
+
}, []), /* @__PURE__ */ R("div", { children: [
|
|
1206
|
+
/* @__PURE__ */ l("div", { className: "wx-398RBS wx-weekdays", children: a.map((b) => /* @__PURE__ */ l("div", { className: "wx-398RBS wx-weekday", children: b }, b)) }),
|
|
1207
|
+
/* @__PURE__ */ l("div", { className: "wx-398RBS wx-days", ref: g, children: m.map((b) => /* @__PURE__ */ l(
|
|
929
1208
|
"div",
|
|
930
1209
|
{
|
|
931
|
-
className: `wx-398RBS wx-day ${
|
|
932
|
-
"data-id":
|
|
933
|
-
children:
|
|
1210
|
+
className: `wx-398RBS wx-day ${b.css} ${b.in ? "" : "wx-out"}`,
|
|
1211
|
+
"data-id": b.date,
|
|
1212
|
+
children: b.day
|
|
934
1213
|
},
|
|
935
|
-
|
|
1214
|
+
b.date
|
|
936
1215
|
)) })
|
|
937
1216
|
] });
|
|
938
1217
|
}
|
|
939
|
-
function
|
|
1218
|
+
function wt({
|
|
940
1219
|
value: e,
|
|
941
1220
|
current: n,
|
|
942
1221
|
part: t,
|
|
943
|
-
onCancel:
|
|
1222
|
+
onCancel: s,
|
|
944
1223
|
onChange: r,
|
|
945
|
-
onShift:
|
|
1224
|
+
onShift: u
|
|
946
1225
|
}) {
|
|
947
|
-
const
|
|
948
|
-
(
|
|
949
|
-
if (
|
|
950
|
-
|
|
951
|
-
const
|
|
952
|
-
|
|
1226
|
+
const i = S(/* @__PURE__ */ new Date()), [c, a] = J(e || i.current), [o, f] = J(n || i.current), d = K(q).getRaw().calendar, p = d.monthShort || [], v = A(() => o.getMonth(), [o]), x = D(
|
|
1227
|
+
(m, g) => {
|
|
1228
|
+
if (m != null) {
|
|
1229
|
+
g.stopPropagation();
|
|
1230
|
+
const T = new Date(o);
|
|
1231
|
+
T.setMonth(m), f(T), u && u({ current: T });
|
|
953
1232
|
}
|
|
954
|
-
t === "normal" &&
|
|
1233
|
+
t === "normal" && a(new Date(o)), s && s();
|
|
955
1234
|
},
|
|
956
|
-
[
|
|
957
|
-
),
|
|
958
|
-
const
|
|
959
|
-
|
|
960
|
-
}, [
|
|
961
|
-
(
|
|
962
|
-
const
|
|
963
|
-
if (
|
|
964
|
-
const
|
|
965
|
-
|
|
1235
|
+
[o, t, u, s]
|
|
1236
|
+
), w = D(() => {
|
|
1237
|
+
const m = new Date(je(c, t) || o);
|
|
1238
|
+
m.setMonth(o.getMonth()), m.setFullYear(o.getFullYear()), r && r(m);
|
|
1239
|
+
}, [c, o, t, r]), h = D(
|
|
1240
|
+
(m) => {
|
|
1241
|
+
const g = m.target.closest("[data-id]");
|
|
1242
|
+
if (g) {
|
|
1243
|
+
const T = parseInt(g.getAttribute("data-id"), 10);
|
|
1244
|
+
x(T, m);
|
|
966
1245
|
}
|
|
967
1246
|
},
|
|
968
|
-
[
|
|
1247
|
+
[x]
|
|
969
1248
|
);
|
|
970
|
-
return /* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */ l("div", { className: "wx-34U8T8 wx-months", onClick:
|
|
1249
|
+
return /* @__PURE__ */ R(_, { children: [
|
|
1250
|
+
/* @__PURE__ */ l("div", { className: "wx-34U8T8 wx-months", onClick: h, children: p.map((m, g) => /* @__PURE__ */ l(
|
|
972
1251
|
"div",
|
|
973
1252
|
{
|
|
974
|
-
className: "wx-34U8T8 wx-month" + (
|
|
975
|
-
"data-id":
|
|
976
|
-
children:
|
|
1253
|
+
className: "wx-34U8T8 wx-month" + (v === g ? " wx-current" : ""),
|
|
1254
|
+
"data-id": g,
|
|
1255
|
+
children: m
|
|
977
1256
|
},
|
|
978
|
-
|
|
1257
|
+
g
|
|
979
1258
|
)) }),
|
|
980
|
-
/* @__PURE__ */ l("div", { className: "wx-34U8T8 wx-buttons", children: /* @__PURE__ */ l(
|
|
1259
|
+
/* @__PURE__ */ l("div", { className: "wx-34U8T8 wx-buttons", children: /* @__PURE__ */ l(ke, { onClick: w, children: d.done }) })
|
|
981
1260
|
] });
|
|
982
1261
|
}
|
|
983
|
-
const
|
|
984
|
-
const
|
|
985
|
-
const { start:
|
|
986
|
-
for (let
|
|
987
|
-
|
|
988
|
-
return
|
|
989
|
-
}, [
|
|
990
|
-
click:
|
|
1262
|
+
const xe = "wx-1XEF33", xt = ({ value: e, current: n, onCancel: t, onChange: s, onShift: r, part: u }) => {
|
|
1263
|
+
const i = K(q).getRaw().calendar, [c, a] = J(n), [o, f] = J(e), d = A(() => c.getFullYear(), [c]), p = A(() => {
|
|
1264
|
+
const { start: m, end: g } = Be(d), T = [];
|
|
1265
|
+
for (let b = m; b <= g; ++b)
|
|
1266
|
+
T.push(b);
|
|
1267
|
+
return T;
|
|
1268
|
+
}, [d]), v = {
|
|
1269
|
+
click: x
|
|
991
1270
|
};
|
|
992
|
-
function
|
|
993
|
-
if (
|
|
994
|
-
|
|
995
|
-
const
|
|
996
|
-
|
|
1271
|
+
function x(m, g) {
|
|
1272
|
+
if (m) {
|
|
1273
|
+
g.stopPropagation();
|
|
1274
|
+
const T = new Date(c);
|
|
1275
|
+
T.setFullYear(m), a(T), r && r({ current: T });
|
|
997
1276
|
}
|
|
998
|
-
|
|
1277
|
+
u === "normal" && f(new Date(c)), t && t();
|
|
999
1278
|
}
|
|
1000
|
-
function
|
|
1001
|
-
const
|
|
1002
|
-
|
|
1279
|
+
function w() {
|
|
1280
|
+
const m = new Date(je(o, u) || c);
|
|
1281
|
+
m.setFullYear(c.getFullYear()), s && s(m);
|
|
1003
1282
|
}
|
|
1004
|
-
const h =
|
|
1005
|
-
return
|
|
1006
|
-
h.current &&
|
|
1007
|
-
}, []), /* @__PURE__ */
|
|
1008
|
-
/* @__PURE__ */ l("div", { className:
|
|
1283
|
+
const h = S(null);
|
|
1284
|
+
return W(() => {
|
|
1285
|
+
h.current && Ee(h.current, v);
|
|
1286
|
+
}, []), /* @__PURE__ */ R(_, { children: [
|
|
1287
|
+
/* @__PURE__ */ l("div", { className: xe + " wx-years", ref: h, children: p.map((m, g) => /* @__PURE__ */ l(
|
|
1009
1288
|
"div",
|
|
1010
1289
|
{
|
|
1011
|
-
className:
|
|
1012
|
-
"data-id":
|
|
1013
|
-
children:
|
|
1290
|
+
className: xe + ` wx-year ${d == m ? "wx-current" : ""} ${g === 0 ? "wx-prev-decade" : ""} ${g === 11 ? "wx-next-decade" : ""}`,
|
|
1291
|
+
"data-id": m,
|
|
1292
|
+
children: m
|
|
1014
1293
|
},
|
|
1015
|
-
|
|
1294
|
+
g
|
|
1016
1295
|
)) }),
|
|
1017
|
-
/* @__PURE__ */ l("div", { className:
|
|
1296
|
+
/* @__PURE__ */ l("div", { className: xe + " wx-buttons", children: /* @__PURE__ */ l(ke, { onClick: w, children: i.done }) })
|
|
1018
1297
|
] });
|
|
1019
|
-
},
|
|
1298
|
+
}, Me = {
|
|
1020
1299
|
month: {
|
|
1021
|
-
component:
|
|
1022
|
-
next:
|
|
1023
|
-
prev:
|
|
1300
|
+
component: ft,
|
|
1301
|
+
next: ht,
|
|
1302
|
+
prev: mt
|
|
1024
1303
|
},
|
|
1025
1304
|
year: {
|
|
1026
|
-
component:
|
|
1027
|
-
next:
|
|
1028
|
-
prev:
|
|
1305
|
+
component: wt,
|
|
1306
|
+
next: vt,
|
|
1307
|
+
prev: pt
|
|
1029
1308
|
},
|
|
1030
1309
|
duodecade: {
|
|
1031
|
-
component:
|
|
1032
|
-
next:
|
|
1033
|
-
prev:
|
|
1310
|
+
component: xt,
|
|
1311
|
+
next: Nt,
|
|
1312
|
+
prev: gt
|
|
1034
1313
|
}
|
|
1035
1314
|
};
|
|
1036
|
-
function
|
|
1315
|
+
function mt(e) {
|
|
1037
1316
|
return e = new Date(e), e.setMonth(e.getMonth() - 1), e;
|
|
1038
1317
|
}
|
|
1039
|
-
function
|
|
1318
|
+
function ht(e) {
|
|
1040
1319
|
return e = new Date(e), e.setMonth(e.getMonth() + 1), e;
|
|
1041
1320
|
}
|
|
1042
|
-
function
|
|
1321
|
+
function pt(e) {
|
|
1043
1322
|
return e = new Date(e), e.setFullYear(e.getFullYear() - 1), e;
|
|
1044
1323
|
}
|
|
1045
|
-
function
|
|
1324
|
+
function vt(e) {
|
|
1046
1325
|
return e = new Date(e), e.setFullYear(e.getFullYear() + 1), e;
|
|
1047
1326
|
}
|
|
1048
|
-
function
|
|
1327
|
+
function gt(e) {
|
|
1049
1328
|
return e = new Date(e), e.setFullYear(e.getFullYear() - 10), e;
|
|
1050
1329
|
}
|
|
1051
|
-
function
|
|
1330
|
+
function Nt(e) {
|
|
1052
1331
|
return e = new Date(e), e.setFullYear(e.getFullYear() + 10), e;
|
|
1053
1332
|
}
|
|
1054
|
-
function
|
|
1333
|
+
function je(e, n) {
|
|
1055
1334
|
let t;
|
|
1056
1335
|
if (n === "normal") t = e;
|
|
1057
1336
|
else {
|
|
1058
|
-
const { start:
|
|
1059
|
-
n === "left" ? t =
|
|
1337
|
+
const { start: s, end: r } = e;
|
|
1338
|
+
n === "left" ? t = s : n == "right" ? t = r : t = s && r;
|
|
1060
1339
|
}
|
|
1061
1340
|
return t;
|
|
1062
1341
|
}
|
|
1063
|
-
const
|
|
1064
|
-
function
|
|
1342
|
+
const kt = ["clear", "today"];
|
|
1343
|
+
function yt(e) {
|
|
1065
1344
|
if (e === "done") return -1;
|
|
1066
1345
|
if (e === "clear") return null;
|
|
1067
1346
|
if (e === "today") return /* @__PURE__ */ new Date();
|
|
1068
1347
|
}
|
|
1069
|
-
function
|
|
1348
|
+
function de({
|
|
1070
1349
|
value: e,
|
|
1071
1350
|
current: n,
|
|
1072
1351
|
onCurrentChange: t,
|
|
1073
|
-
part:
|
|
1352
|
+
part: s = "normal",
|
|
1074
1353
|
markers: r = null,
|
|
1075
|
-
buttons:
|
|
1076
|
-
onShift:
|
|
1077
|
-
onChange:
|
|
1354
|
+
buttons: u,
|
|
1355
|
+
onShift: i,
|
|
1356
|
+
onChange: c
|
|
1078
1357
|
}) {
|
|
1079
|
-
const a =
|
|
1080
|
-
|
|
1081
|
-
},
|
|
1082
|
-
|
|
1083
|
-
},
|
|
1084
|
-
const { diff:
|
|
1085
|
-
if (
|
|
1086
|
-
|
|
1358
|
+
const a = K(q).getGroup("calendar"), [o, f] = B("month"), d = Array.isArray(u) ? u : u ? kt : [], p = (m, g) => {
|
|
1359
|
+
m.preventDefault(), c && c({ value: g });
|
|
1360
|
+
}, v = () => {
|
|
1361
|
+
o === "duodecade" ? f("year") : o === "year" && f("month");
|
|
1362
|
+
}, x = (m) => {
|
|
1363
|
+
const { diff: g, current: T } = m;
|
|
1364
|
+
if (g === 0) {
|
|
1365
|
+
o === "month" ? f("year") : o === "year" && f("duodecade");
|
|
1087
1366
|
return;
|
|
1088
1367
|
}
|
|
1089
|
-
if (
|
|
1090
|
-
const
|
|
1091
|
-
t(
|
|
1092
|
-
} else
|
|
1093
|
-
|
|
1094
|
-
},
|
|
1095
|
-
|
|
1096
|
-
}, h =
|
|
1368
|
+
if (g) {
|
|
1369
|
+
const b = Me[o];
|
|
1370
|
+
t(g > 0 ? b.next(n) : b.prev(n));
|
|
1371
|
+
} else T && t(T);
|
|
1372
|
+
i && i();
|
|
1373
|
+
}, w = (m) => {
|
|
1374
|
+
f("month"), c && c({ select: !0, value: m });
|
|
1375
|
+
}, h = A(() => Me[o].component, [o]);
|
|
1097
1376
|
return /* @__PURE__ */ l(
|
|
1098
1377
|
"div",
|
|
1099
1378
|
{
|
|
1100
|
-
className: `wx-2Gr4AS wx-calendar ${
|
|
1101
|
-
children: /* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */ l(
|
|
1103
|
-
/* @__PURE__ */
|
|
1379
|
+
className: `wx-2Gr4AS wx-calendar ${s !== "normal" && s !== "both" ? "wx-part" : ""}`,
|
|
1380
|
+
children: /* @__PURE__ */ R("div", { className: "wx-2Gr4AS wx-wrap", children: [
|
|
1381
|
+
/* @__PURE__ */ l(dt, { date: n, part: s, type: o, onShift: x }),
|
|
1382
|
+
/* @__PURE__ */ R("div", { children: [
|
|
1104
1383
|
/* @__PURE__ */ l(
|
|
1105
1384
|
h,
|
|
1106
1385
|
{
|
|
1107
1386
|
value: e,
|
|
1108
1387
|
current: n,
|
|
1109
1388
|
onCurrentChange: t,
|
|
1110
|
-
part:
|
|
1389
|
+
part: s,
|
|
1111
1390
|
markers: r,
|
|
1112
|
-
onCancel:
|
|
1113
|
-
onChange:
|
|
1114
|
-
onShift:
|
|
1391
|
+
onCancel: v,
|
|
1392
|
+
onChange: w,
|
|
1393
|
+
onShift: x
|
|
1115
1394
|
}
|
|
1116
1395
|
),
|
|
1117
|
-
|
|
1118
|
-
|
|
1396
|
+
o === "month" && d.length > 0 && /* @__PURE__ */ l("div", { className: "wx-2Gr4AS wx-buttons", children: d.map((m) => /* @__PURE__ */ l("div", { className: "wx-2Gr4AS wx-button-item", children: /* @__PURE__ */ l(
|
|
1397
|
+
ke,
|
|
1119
1398
|
{
|
|
1120
|
-
onClick: (
|
|
1121
|
-
children: a(
|
|
1399
|
+
onClick: (g) => p(g, yt(m)),
|
|
1400
|
+
children: a(m)
|
|
1122
1401
|
}
|
|
1123
|
-
) },
|
|
1402
|
+
) }, m)) })
|
|
1124
1403
|
] })
|
|
1125
1404
|
] })
|
|
1126
1405
|
}
|
|
1127
1406
|
);
|
|
1128
1407
|
}
|
|
1129
|
-
function
|
|
1130
|
-
let { words: n = null, optional: t = !1, children:
|
|
1131
|
-
const
|
|
1132
|
-
let
|
|
1133
|
-
return (!
|
|
1408
|
+
function he(e) {
|
|
1409
|
+
let { words: n = null, optional: t = !1, children: s } = e, r = K(q);
|
|
1410
|
+
const u = A(() => {
|
|
1411
|
+
let i = r;
|
|
1412
|
+
return (!i || !i.extend) && (i = Ae(We)), n !== null && (i = i.extend(n, t)), i;
|
|
1134
1413
|
}, [n, t, r]);
|
|
1135
|
-
return /* @__PURE__ */ l(
|
|
1414
|
+
return /* @__PURE__ */ l(q.Provider, { value: u, children: s });
|
|
1136
1415
|
}
|
|
1137
|
-
function
|
|
1138
|
-
if (!e ||
|
|
1416
|
+
function Ie(e, n, t, s) {
|
|
1417
|
+
if (!e || s) {
|
|
1139
1418
|
const r = n ? new Date(n) : /* @__PURE__ */ new Date();
|
|
1140
1419
|
r.setDate(1), t(r);
|
|
1141
1420
|
} else if (e.getDate() !== 1) {
|
|
@@ -1143,283 +1422,280 @@ function Ne(e, n, t, c) {
|
|
|
1143
1422
|
r.setDate(1), t(r);
|
|
1144
1423
|
}
|
|
1145
1424
|
}
|
|
1146
|
-
const
|
|
1147
|
-
function
|
|
1425
|
+
const bt = ["clear", "today"];
|
|
1426
|
+
function Dt({
|
|
1148
1427
|
value: e,
|
|
1149
1428
|
current: n,
|
|
1150
1429
|
markers: t = null,
|
|
1151
|
-
buttons:
|
|
1430
|
+
buttons: s = bt,
|
|
1152
1431
|
onChange: r
|
|
1153
1432
|
}) {
|
|
1154
|
-
const [
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
}, [
|
|
1158
|
-
const
|
|
1159
|
-
(
|
|
1160
|
-
const
|
|
1161
|
-
|
|
1433
|
+
const [u, i] = J(e), [c, a] = J(n);
|
|
1434
|
+
W(() => {
|
|
1435
|
+
Ie(c, u, a, !1);
|
|
1436
|
+
}, [u, c]);
|
|
1437
|
+
const o = D(
|
|
1438
|
+
(d) => {
|
|
1439
|
+
const p = d.value;
|
|
1440
|
+
p ? (i(new Date(p)), Ie(c, new Date(p), a, !0)) : i(null), r && r({ value: p ? new Date(p) : null });
|
|
1162
1441
|
},
|
|
1163
|
-
[r,
|
|
1164
|
-
),
|
|
1165
|
-
(
|
|
1166
|
-
a(
|
|
1442
|
+
[r, c]
|
|
1443
|
+
), f = D(
|
|
1444
|
+
(d) => {
|
|
1445
|
+
a(d);
|
|
1167
1446
|
},
|
|
1168
1447
|
[a]
|
|
1169
1448
|
);
|
|
1170
|
-
return
|
|
1171
|
-
|
|
1449
|
+
return c ? /* @__PURE__ */ l(he, { children: /* @__PURE__ */ l(
|
|
1450
|
+
de,
|
|
1172
1451
|
{
|
|
1173
|
-
value:
|
|
1174
|
-
current:
|
|
1452
|
+
value: u,
|
|
1453
|
+
current: c,
|
|
1175
1454
|
markers: t,
|
|
1176
|
-
buttons:
|
|
1177
|
-
onChange:
|
|
1178
|
-
onCurrentChange:
|
|
1455
|
+
buttons: s,
|
|
1456
|
+
onChange: o,
|
|
1457
|
+
onCurrentChange: f
|
|
1179
1458
|
}
|
|
1180
1459
|
) }) : null;
|
|
1181
1460
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1461
|
+
function ye(e) {
|
|
1462
|
+
return e || (e = {}), e.width || (e.width = "unset"), e;
|
|
1463
|
+
}
|
|
1464
|
+
const Vt = ["clear", "today"];
|
|
1465
|
+
function zt({
|
|
1184
1466
|
value: e,
|
|
1185
1467
|
id: n,
|
|
1186
1468
|
disabled: t = !1,
|
|
1187
|
-
error:
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
onChange: m
|
|
1469
|
+
error: s = !1,
|
|
1470
|
+
placeholder: r = "",
|
|
1471
|
+
format: u = "",
|
|
1472
|
+
buttons: i = Vt,
|
|
1473
|
+
css: c = "",
|
|
1474
|
+
title: a = "",
|
|
1475
|
+
editable: o = !1,
|
|
1476
|
+
clear: f = !1,
|
|
1477
|
+
onChange: d,
|
|
1478
|
+
dropdown: p = {}
|
|
1198
1479
|
}) {
|
|
1199
|
-
const { calendar:
|
|
1200
|
-
let
|
|
1201
|
-
const [
|
|
1202
|
-
|
|
1203
|
-
|
|
1480
|
+
const { calendar: v, formats: x } = (K(q) || X()).getRaw(), w = u || x?.dateFormat;
|
|
1481
|
+
let h = typeof w == "function" ? w : ne(w, v);
|
|
1482
|
+
const [m, g] = B(e), [T, b] = B(!1);
|
|
1483
|
+
W(() => {
|
|
1484
|
+
g(e);
|
|
1204
1485
|
}, [e]);
|
|
1205
|
-
function
|
|
1206
|
-
|
|
1486
|
+
function N() {
|
|
1487
|
+
b(!1);
|
|
1207
1488
|
}
|
|
1208
|
-
function
|
|
1209
|
-
const F =
|
|
1210
|
-
|
|
1489
|
+
function k(V) {
|
|
1490
|
+
const F = V === m || V && m && V.valueOf() === m.valueOf() || !V && !m;
|
|
1491
|
+
g(V), F || d && d({ value: V }), setTimeout(N, 1);
|
|
1211
1492
|
}
|
|
1212
|
-
const
|
|
1213
|
-
() =>
|
|
1214
|
-
[
|
|
1493
|
+
const M = A(
|
|
1494
|
+
() => m ? h(m) : "",
|
|
1495
|
+
[m, h]
|
|
1215
1496
|
);
|
|
1216
|
-
function
|
|
1217
|
-
if (!
|
|
1218
|
-
let
|
|
1219
|
-
|
|
1497
|
+
function $({ value: V, input: F }) {
|
|
1498
|
+
if (!o && !f || F) return;
|
|
1499
|
+
let j = typeof o == "function" ? o(V) : V ? new Date(V) : null;
|
|
1500
|
+
j = isNaN(j) ? m || null : j || null, k(j);
|
|
1220
1501
|
}
|
|
1221
|
-
return
|
|
1222
|
-
const
|
|
1223
|
-
return window.addEventListener("scroll",
|
|
1224
|
-
}, []), /* @__PURE__ */
|
|
1502
|
+
return W(() => {
|
|
1503
|
+
const V = N;
|
|
1504
|
+
return window.addEventListener("scroll", V), () => window.removeEventListener("scroll", V);
|
|
1505
|
+
}, []), /* @__PURE__ */ R("div", { className: "wx-1lKOFG wx-datepicker", onClick: () => b(!0), children: [
|
|
1225
1506
|
/* @__PURE__ */ l(
|
|
1226
|
-
|
|
1507
|
+
Ne,
|
|
1227
1508
|
{
|
|
1228
|
-
css:
|
|
1229
|
-
title:
|
|
1230
|
-
value:
|
|
1509
|
+
css: c,
|
|
1510
|
+
title: a,
|
|
1511
|
+
value: M,
|
|
1231
1512
|
id: n,
|
|
1232
|
-
readonly: !
|
|
1513
|
+
readonly: !o,
|
|
1233
1514
|
disabled: t,
|
|
1234
|
-
error:
|
|
1235
|
-
placeholder:
|
|
1236
|
-
onInput:
|
|
1237
|
-
onChange:
|
|
1515
|
+
error: s,
|
|
1516
|
+
placeholder: r,
|
|
1517
|
+
onInput: N,
|
|
1518
|
+
onChange: $,
|
|
1238
1519
|
icon: "wxi-calendar",
|
|
1239
1520
|
inputStyle: {
|
|
1240
1521
|
cursor: "pointer",
|
|
1241
1522
|
width: "100%",
|
|
1242
1523
|
paddingRight: "calc(var(--wx-input-icon-size) + var(--wx-input-icon-indent) * 2)"
|
|
1243
1524
|
},
|
|
1244
|
-
clear:
|
|
1525
|
+
clear: f
|
|
1245
1526
|
}
|
|
1246
1527
|
),
|
|
1247
|
-
|
|
1248
|
-
|
|
1528
|
+
T && !t && /* @__PURE__ */ l(
|
|
1529
|
+
le,
|
|
1249
1530
|
{
|
|
1250
|
-
onCancel:
|
|
1251
|
-
|
|
1252
|
-
align: i,
|
|
1253
|
-
autoFit: !!i,
|
|
1531
|
+
onCancel: N,
|
|
1532
|
+
...ye(p),
|
|
1254
1533
|
children: /* @__PURE__ */ l(
|
|
1255
|
-
|
|
1534
|
+
Dt,
|
|
1256
1535
|
{
|
|
1257
|
-
buttons:
|
|
1258
|
-
value:
|
|
1259
|
-
onChange: (
|
|
1536
|
+
buttons: i,
|
|
1537
|
+
value: m,
|
|
1538
|
+
onChange: (V) => k(V.value)
|
|
1260
1539
|
}
|
|
1261
1540
|
)
|
|
1262
1541
|
}
|
|
1263
1542
|
)
|
|
1264
1543
|
] });
|
|
1265
1544
|
}
|
|
1266
|
-
const
|
|
1545
|
+
const Tt = ["clear", "today"], Rt = ({
|
|
1267
1546
|
start: e,
|
|
1268
1547
|
end: n,
|
|
1269
1548
|
current: t,
|
|
1270
|
-
months:
|
|
1549
|
+
months: s = 2,
|
|
1271
1550
|
markers: r = null,
|
|
1272
|
-
buttons:
|
|
1273
|
-
onChange:
|
|
1551
|
+
buttons: u = Tt,
|
|
1552
|
+
onChange: i
|
|
1274
1553
|
}) => {
|
|
1275
|
-
const [
|
|
1276
|
-
const
|
|
1277
|
-
return
|
|
1278
|
-
}, []), h =
|
|
1279
|
-
(
|
|
1280
|
-
|
|
1281
|
-
const
|
|
1282
|
-
return
|
|
1554
|
+
const [c, a] = J(e), [o, f] = J(n), [d, p] = B(), [v, x] = B(), w = D((N, k, M) => {
|
|
1555
|
+
const $ = new Date(N);
|
|
1556
|
+
return $.setMonth($.getMonth() + k), M && $.valueOf() === M.valueOf() ? M : $;
|
|
1557
|
+
}, []), h = D(
|
|
1558
|
+
(N) => {
|
|
1559
|
+
p(() => {
|
|
1560
|
+
const k = new Date(N);
|
|
1561
|
+
return k.setDate(1), x(w(k, 1)), k;
|
|
1283
1562
|
});
|
|
1284
1563
|
},
|
|
1285
|
-
[
|
|
1286
|
-
),
|
|
1287
|
-
(
|
|
1288
|
-
|
|
1289
|
-
const
|
|
1290
|
-
return
|
|
1564
|
+
[w]
|
|
1565
|
+
), m = D(
|
|
1566
|
+
(N) => {
|
|
1567
|
+
x(() => {
|
|
1568
|
+
const k = new Date(N);
|
|
1569
|
+
return k.setDate(1), p(w(k, -1)), k;
|
|
1291
1570
|
});
|
|
1292
1571
|
},
|
|
1293
|
-
[
|
|
1572
|
+
[w]
|
|
1294
1573
|
);
|
|
1295
|
-
|
|
1296
|
-
const
|
|
1297
|
-
|
|
1298
|
-
}, [
|
|
1299
|
-
const
|
|
1300
|
-
(
|
|
1301
|
-
const
|
|
1302
|
-
let
|
|
1303
|
-
const
|
|
1304
|
-
return
|
|
1574
|
+
W(() => {
|
|
1575
|
+
const N = c;
|
|
1576
|
+
d || h(N ? new Date(N) : t || /* @__PURE__ */ new Date());
|
|
1577
|
+
}, [c, t, d, h]);
|
|
1578
|
+
const g = D(
|
|
1579
|
+
(N) => {
|
|
1580
|
+
const k = N.value;
|
|
1581
|
+
let M = c, $ = o;
|
|
1582
|
+
const V = k === -1;
|
|
1583
|
+
return V || (N.select ? !c || o ? (a(M = k), f($ = null)) : c > k ? (f($ = c), a(M = k)) : f($ = k) : k ? (a(M = new Date(k)), f($ = new Date(k))) : (a(M = null), f($ = null))), (V || !u.includes("done")) && i && i({ start: M, end: $ }), [M, $];
|
|
1305
1584
|
},
|
|
1306
|
-
[
|
|
1307
|
-
),
|
|
1308
|
-
(
|
|
1309
|
-
const [
|
|
1310
|
-
|
|
1585
|
+
[c, o, u, i]
|
|
1586
|
+
), T = D(
|
|
1587
|
+
(N) => {
|
|
1588
|
+
const [k] = g(N);
|
|
1589
|
+
k && h(new Date(k));
|
|
1311
1590
|
},
|
|
1312
|
-
[h,
|
|
1313
|
-
),
|
|
1314
|
-
(
|
|
1315
|
-
const [,
|
|
1316
|
-
|
|
1591
|
+
[h, c, o]
|
|
1592
|
+
), b = D(
|
|
1593
|
+
(N) => {
|
|
1594
|
+
const [, k] = g(N);
|
|
1595
|
+
k && m(new Date(k));
|
|
1317
1596
|
},
|
|
1318
|
-
[
|
|
1597
|
+
[m, c, o]
|
|
1319
1598
|
);
|
|
1320
|
-
return !
|
|
1321
|
-
|
|
1599
|
+
return !d || !v ? null : s === 1 ? /* @__PURE__ */ l(he, { children: /* @__PURE__ */ l(
|
|
1600
|
+
de,
|
|
1322
1601
|
{
|
|
1323
|
-
value: { start:
|
|
1324
|
-
current:
|
|
1325
|
-
setCurrent: h,
|
|
1602
|
+
value: { start: c, end: o },
|
|
1603
|
+
current: d,
|
|
1326
1604
|
markers: r,
|
|
1327
|
-
buttons:
|
|
1605
|
+
buttons: u,
|
|
1328
1606
|
part: "both",
|
|
1329
|
-
onChange:
|
|
1607
|
+
onChange: T,
|
|
1608
|
+
onCurrentChange: h
|
|
1330
1609
|
}
|
|
1331
|
-
) }) : /* @__PURE__ */ l(
|
|
1610
|
+
) }) : /* @__PURE__ */ l(he, { children: /* @__PURE__ */ R("div", { className: "wx-p2jCaW wx-rangecalendar", children: [
|
|
1332
1611
|
/* @__PURE__ */ l("div", { className: "wx-p2jCaW wx-half", children: /* @__PURE__ */ l(
|
|
1333
|
-
|
|
1612
|
+
de,
|
|
1334
1613
|
{
|
|
1335
|
-
value: { start:
|
|
1336
|
-
current:
|
|
1337
|
-
setCurrent: h,
|
|
1614
|
+
value: { start: c, end: o },
|
|
1615
|
+
current: d,
|
|
1338
1616
|
markers: r,
|
|
1339
1617
|
buttons: !1,
|
|
1340
1618
|
part: "left",
|
|
1341
|
-
onChange:
|
|
1342
|
-
onCurrentChange:
|
|
1619
|
+
onChange: T,
|
|
1620
|
+
onCurrentChange: h
|
|
1343
1621
|
}
|
|
1344
1622
|
) }),
|
|
1345
1623
|
/* @__PURE__ */ l("div", { className: "wx-p2jCaW wx-half", children: /* @__PURE__ */ l(
|
|
1346
|
-
|
|
1624
|
+
de,
|
|
1347
1625
|
{
|
|
1348
|
-
value: { start:
|
|
1349
|
-
current:
|
|
1350
|
-
setCurrent: v,
|
|
1626
|
+
value: { start: c, end: o },
|
|
1627
|
+
current: v,
|
|
1351
1628
|
markers: r,
|
|
1352
|
-
buttons:
|
|
1629
|
+
buttons: u,
|
|
1353
1630
|
part: "right",
|
|
1354
|
-
onChange:
|
|
1355
|
-
onCurrentChange:
|
|
1631
|
+
onChange: b,
|
|
1632
|
+
onCurrentChange: m
|
|
1356
1633
|
}
|
|
1357
1634
|
) })
|
|
1358
1635
|
] }) });
|
|
1359
|
-
},
|
|
1636
|
+
}, $t = ["clear", "today"], Xt = ({
|
|
1360
1637
|
value: e,
|
|
1361
1638
|
onChange: n,
|
|
1362
1639
|
id: t,
|
|
1363
|
-
disabled:
|
|
1640
|
+
disabled: s = !1,
|
|
1364
1641
|
error: r = !1,
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
clear: p = !1
|
|
1642
|
+
placeholder: u = "",
|
|
1643
|
+
css: i = "",
|
|
1644
|
+
title: c = "",
|
|
1645
|
+
format: a = "",
|
|
1646
|
+
months: o = 2,
|
|
1647
|
+
buttons: f = $t,
|
|
1648
|
+
editable: d = !1,
|
|
1649
|
+
clear: p = !1,
|
|
1650
|
+
dropdown: v
|
|
1375
1651
|
}) => {
|
|
1376
|
-
const [
|
|
1377
|
-
|
|
1378
|
-
}, []),
|
|
1379
|
-
(
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1652
|
+
const [x, w] = J(e), { calendar: h, formats: m } = (K(q) || X()).getRaw(), g = a || m?.dateFormat, T = typeof g == "function" ? g : ne(g, h), [b, N] = B(!1), k = D(() => {
|
|
1653
|
+
N(!1);
|
|
1654
|
+
}, []), M = A(() => x ? x.start ? T(x.start) + (x.end ? ` - ${T(x.end)}` : "") : T(x) : "", [x, T]), $ = A(() => x && x.start || null, [x]), V = A(() => x && x.end || null, [x]), F = D(
|
|
1655
|
+
(H) => {
|
|
1656
|
+
const L = H.start || H.end ? { start: H.start, end: H.end } : null;
|
|
1657
|
+
w && w(L), (H.start && H.end || !H.start && !H.end) && (n && n({ value: L }), setTimeout(k, 1));
|
|
1382
1658
|
},
|
|
1383
|
-
[n,
|
|
1384
|
-
),
|
|
1385
|
-
(
|
|
1386
|
-
if (!
|
|
1387
|
-
const { value:
|
|
1388
|
-
if (
|
|
1389
|
-
const [
|
|
1390
|
-
const
|
|
1391
|
-
let
|
|
1392
|
-
return isNaN(
|
|
1659
|
+
[n, k, w]
|
|
1660
|
+
), j = D(
|
|
1661
|
+
(H) => {
|
|
1662
|
+
if (!d && !p) return;
|
|
1663
|
+
const { value: L, input: P } = H;
|
|
1664
|
+
if (P) return;
|
|
1665
|
+
const [C, O] = L.split(" -").map((U, Y) => {
|
|
1666
|
+
const I = U.trim();
|
|
1667
|
+
let G = typeof d == "function" ? d(I) : I ? new Date(I) : null, Q = Y === 0 ? $ : V;
|
|
1668
|
+
return isNaN(G) ? Q || null : G || null;
|
|
1393
1669
|
});
|
|
1394
|
-
F({ start:
|
|
1670
|
+
F({ start: C, end: O });
|
|
1395
1671
|
},
|
|
1396
|
-
[
|
|
1672
|
+
[d, p, $, V, F]
|
|
1397
1673
|
);
|
|
1398
|
-
return
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1674
|
+
return W(() => {
|
|
1675
|
+
const H = () => {
|
|
1676
|
+
k();
|
|
1401
1677
|
};
|
|
1402
|
-
return window.addEventListener("scroll",
|
|
1403
|
-
window.removeEventListener("scroll",
|
|
1678
|
+
return window.addEventListener("scroll", H), () => {
|
|
1679
|
+
window.removeEventListener("scroll", H);
|
|
1404
1680
|
};
|
|
1405
|
-
}, [
|
|
1681
|
+
}, [k]), /* @__PURE__ */ R(
|
|
1406
1682
|
"div",
|
|
1407
1683
|
{
|
|
1408
|
-
className: `wx-1b0WDQ wx-daterangepicker ${
|
|
1409
|
-
onClick: () =>
|
|
1684
|
+
className: `wx-1b0WDQ wx-daterangepicker ${s ? "wx-disabled" : ""} ${r ? "wx-error" : ""}`,
|
|
1685
|
+
onClick: () => N(!0),
|
|
1410
1686
|
children: [
|
|
1411
1687
|
/* @__PURE__ */ l(
|
|
1412
|
-
|
|
1688
|
+
Ne,
|
|
1413
1689
|
{
|
|
1414
|
-
css:
|
|
1415
|
-
title:
|
|
1416
|
-
value:
|
|
1690
|
+
css: i,
|
|
1691
|
+
title: c,
|
|
1692
|
+
value: M,
|
|
1417
1693
|
id: t,
|
|
1418
|
-
readonly: !
|
|
1419
|
-
disabled:
|
|
1420
|
-
placeholder:
|
|
1694
|
+
readonly: !d,
|
|
1695
|
+
disabled: s,
|
|
1696
|
+
placeholder: u,
|
|
1421
1697
|
error: r,
|
|
1422
|
-
onChange:
|
|
1698
|
+
onChange: j,
|
|
1423
1699
|
icon: "wxi-calendar",
|
|
1424
1700
|
inputStyle: {
|
|
1425
1701
|
cursor: "pointer",
|
|
@@ -1429,21 +1705,19 @@ const st = ["clear", "today"], ct = ({
|
|
|
1429
1705
|
clear: p
|
|
1430
1706
|
}
|
|
1431
1707
|
),
|
|
1432
|
-
|
|
1433
|
-
|
|
1708
|
+
b && !s && /* @__PURE__ */ l(
|
|
1709
|
+
le,
|
|
1434
1710
|
{
|
|
1435
|
-
onCancel:
|
|
1436
|
-
|
|
1437
|
-
align: o,
|
|
1438
|
-
autoFit: !!o,
|
|
1711
|
+
onCancel: k,
|
|
1712
|
+
...ye(v),
|
|
1439
1713
|
children: /* @__PURE__ */ l(
|
|
1440
|
-
|
|
1714
|
+
Rt,
|
|
1441
1715
|
{
|
|
1442
|
-
onCancel:
|
|
1443
|
-
buttons:
|
|
1444
|
-
start:
|
|
1445
|
-
end:
|
|
1446
|
-
months:
|
|
1716
|
+
onCancel: k,
|
|
1717
|
+
buttons: f,
|
|
1718
|
+
start: $,
|
|
1719
|
+
end: V,
|
|
1720
|
+
months: o,
|
|
1447
1721
|
onChange: F
|
|
1448
1722
|
}
|
|
1449
1723
|
)
|
|
@@ -1453,38 +1727,38 @@ const st = ["clear", "today"], ct = ({
|
|
|
1453
1727
|
}
|
|
1454
1728
|
);
|
|
1455
1729
|
};
|
|
1456
|
-
function
|
|
1730
|
+
function en({
|
|
1457
1731
|
hotkey: e = null,
|
|
1458
1732
|
toggleButton: n,
|
|
1459
1733
|
children: t
|
|
1460
1734
|
}) {
|
|
1461
|
-
const
|
|
1735
|
+
const s = S(null), [r, u] = B(!1), i = A(
|
|
1462
1736
|
() => `wxi-${r ? "collapse" : "expand"}`,
|
|
1463
1737
|
[r]
|
|
1464
|
-
),
|
|
1465
|
-
return
|
|
1466
|
-
const a =
|
|
1467
|
-
!r && a ? a.requestFullscreen() : r && document.exitFullscreen(),
|
|
1468
|
-
},
|
|
1738
|
+
), c = S(null);
|
|
1739
|
+
return c.current = () => {
|
|
1740
|
+
const a = s.current;
|
|
1741
|
+
!r && a ? a.requestFullscreen() : r && document.exitFullscreen(), u((o) => !o);
|
|
1742
|
+
}, Ke({ [e]: () => c.current() }, s), W(() => {
|
|
1469
1743
|
const a = () => {
|
|
1470
|
-
|
|
1744
|
+
u(document.fullscreenElement === s.current);
|
|
1471
1745
|
};
|
|
1472
1746
|
return document.addEventListener("fullscreenchange", a), () => {
|
|
1473
1747
|
document.removeEventListener("fullscreenchange", a);
|
|
1474
1748
|
};
|
|
1475
|
-
}, []), /* @__PURE__ */
|
|
1749
|
+
}, []), /* @__PURE__ */ R("div", { className: "wx-13aa5W wx-fullscreen", ref: s, tabIndex: -1, children: [
|
|
1476
1750
|
t,
|
|
1477
|
-
n ? n(
|
|
1751
|
+
n ? n(c.current, r) : /* @__PURE__ */ l(re, { css: "wx-13aa5W wx-fullscreen-button", onClick: c.current, children: /* @__PURE__ */ l("i", { className: `wx-13aa5W ${i} wx-fullscreen-icon`, children: " " }) })
|
|
1478
1752
|
] });
|
|
1479
1753
|
}
|
|
1480
|
-
function
|
|
1754
|
+
function tn({ css: e = "", title: n = "", children: t, onClick: s }) {
|
|
1481
1755
|
return t ? /* @__PURE__ */ l(
|
|
1482
1756
|
"i",
|
|
1483
1757
|
{
|
|
1484
1758
|
title: n,
|
|
1485
1759
|
role: "img",
|
|
1486
1760
|
className: `wx-mdnST1 wx-icon ${e}`,
|
|
1487
|
-
onClick:
|
|
1761
|
+
onClick: s,
|
|
1488
1762
|
children: t
|
|
1489
1763
|
}
|
|
1490
1764
|
) : /* @__PURE__ */ l(
|
|
@@ -1492,186 +1766,147 @@ function Lt({ css: e = "", title: n = "", children: t, onClick: c }) {
|
|
|
1492
1766
|
{
|
|
1493
1767
|
title: n,
|
|
1494
1768
|
className: `wx-mdnST1 wx-icon ${e}`,
|
|
1495
|
-
onClick:
|
|
1769
|
+
onClick: s
|
|
1496
1770
|
}
|
|
1497
1771
|
);
|
|
1498
1772
|
}
|
|
1499
|
-
const
|
|
1500
|
-
function
|
|
1773
|
+
const Mt = [];
|
|
1774
|
+
function nn({
|
|
1501
1775
|
id: e,
|
|
1502
|
-
value: n =
|
|
1776
|
+
value: n = Mt,
|
|
1503
1777
|
options: t = [],
|
|
1504
|
-
textOptions:
|
|
1778
|
+
textOptions: s = null,
|
|
1505
1779
|
textField: r = "label",
|
|
1506
|
-
placeholder:
|
|
1507
|
-
title:
|
|
1508
|
-
disabled:
|
|
1780
|
+
placeholder: u = "",
|
|
1781
|
+
title: i = "",
|
|
1782
|
+
disabled: c = !1,
|
|
1509
1783
|
error: a = !1,
|
|
1510
|
-
checkboxes:
|
|
1511
|
-
onChange:
|
|
1512
|
-
children:
|
|
1784
|
+
checkboxes: o = !1,
|
|
1785
|
+
onChange: f,
|
|
1786
|
+
children: d,
|
|
1787
|
+
dropdown: p = {}
|
|
1513
1788
|
}) {
|
|
1514
|
-
const
|
|
1515
|
-
const
|
|
1516
|
-
return
|
|
1517
|
-
}, [
|
|
1518
|
-
|
|
1519
|
-
}, []),
|
|
1520
|
-
|
|
1521
|
-
}, [
|
|
1522
|
-
(
|
|
1523
|
-
const { id: O } =
|
|
1524
|
-
|
|
1525
|
-
let Y;
|
|
1526
|
-
d ? d.includes(O) ? Y = d.filter((_) => _ !== O) : Y = [...d, O] : Y = [O], h(Y), w && w({ value: Y }), T.current.focus();
|
|
1527
|
-
}
|
|
1789
|
+
const v = z(e), x = S(null), w = S(null), [h, m] = J(n), [g, T] = B(""), [b, N] = B(!1), k = S(null), M = A(() => h ? (s || t).filter((C) => h.includes(C.id)) : [], [h, s, t]), $ = A(() => {
|
|
1790
|
+
const C = t;
|
|
1791
|
+
return g ? C.filter((O) => O[r].toLowerCase().includes(g.toLowerCase())) : C;
|
|
1792
|
+
}, [g, t, r]), V = D((C) => {
|
|
1793
|
+
x.current = C.navigate, w.current = C.keydown;
|
|
1794
|
+
}, []), F = D(() => {
|
|
1795
|
+
$.length ? x.current(0) : x.current(null);
|
|
1796
|
+
}, [$]), j = D(
|
|
1797
|
+
(C) => {
|
|
1798
|
+
const { id: O } = C;
|
|
1799
|
+
O && (m(O), f && f({ value: O }), k.current.focus());
|
|
1528
1800
|
},
|
|
1529
|
-
[
|
|
1530
|
-
),
|
|
1531
|
-
(
|
|
1801
|
+
[f]
|
|
1802
|
+
), H = D(
|
|
1803
|
+
(C, O) => {
|
|
1532
1804
|
O && O.stopPropagation();
|
|
1533
|
-
const
|
|
1534
|
-
|
|
1805
|
+
const U = h.filter((Y) => Y !== C);
|
|
1806
|
+
m(U), f && f({ value: U });
|
|
1535
1807
|
},
|
|
1536
|
-
[
|
|
1537
|
-
),
|
|
1538
|
-
() =>
|
|
1539
|
-
[
|
|
1540
|
-
),
|
|
1541
|
-
|
|
1542
|
-
}, [
|
|
1543
|
-
return /* @__PURE__ */
|
|
1808
|
+
[h, f]
|
|
1809
|
+
), L = D(
|
|
1810
|
+
() => h && h.length ? $.findIndex((C) => C.id === h[0]) : 0,
|
|
1811
|
+
[h, $]
|
|
1812
|
+
), P = D(() => {
|
|
1813
|
+
c || (k.current.focus(), x.current(L()));
|
|
1814
|
+
}, [c, L]);
|
|
1815
|
+
return /* @__PURE__ */ R(
|
|
1544
1816
|
"div",
|
|
1545
1817
|
{
|
|
1546
|
-
title:
|
|
1547
|
-
className: `wx-12Wj21 wx-multicombo ${a ? "wx-error" : ""} ${
|
|
1548
|
-
onClick:
|
|
1549
|
-
onKeyDown: (
|
|
1818
|
+
title: i,
|
|
1819
|
+
className: `wx-12Wj21 wx-multicombo ${a ? "wx-error" : ""} ${c ? "wx-disabled" : ""} ${M.length ? "wx-not-empty" : ""} ${b && !c ? "wx-focus" : ""}`,
|
|
1820
|
+
onClick: P,
|
|
1821
|
+
onKeyDown: (C) => w.current(C, L()),
|
|
1550
1822
|
children: [
|
|
1551
|
-
/* @__PURE__ */
|
|
1552
|
-
/* @__PURE__ */ l("div", { className: "wx-12Wj21 wx-tags", children: M.map((
|
|
1553
|
-
|
|
1554
|
-
!
|
|
1823
|
+
/* @__PURE__ */ R("div", { className: "wx-12Wj21 wx-wrapper", children: [
|
|
1824
|
+
/* @__PURE__ */ l("div", { className: "wx-12Wj21 wx-tags", children: M.map((C) => /* @__PURE__ */ R("div", { className: "wx-12Wj21 wx-tag", children: [
|
|
1825
|
+
d ? ae(d, { option: C }) : C[r],
|
|
1826
|
+
!c && /* @__PURE__ */ l(
|
|
1555
1827
|
"i",
|
|
1556
1828
|
{
|
|
1557
1829
|
className: "wx-12Wj21 wx-icon wxi-close",
|
|
1558
|
-
onClick: (O) =>
|
|
1830
|
+
onClick: (O) => H(C.id, O)
|
|
1559
1831
|
}
|
|
1560
1832
|
)
|
|
1561
|
-
] },
|
|
1562
|
-
/* @__PURE__ */
|
|
1833
|
+
] }, C.id)) }),
|
|
1834
|
+
/* @__PURE__ */ R("div", { className: "wx-12Wj21 wx-select", children: [
|
|
1563
1835
|
/* @__PURE__ */ l(
|
|
1564
1836
|
"input",
|
|
1565
1837
|
{
|
|
1566
1838
|
className: "wx-12Wj21 wx-input",
|
|
1567
|
-
id:
|
|
1839
|
+
id: v,
|
|
1568
1840
|
type: "text",
|
|
1569
|
-
value:
|
|
1570
|
-
onChange: (
|
|
1571
|
-
onInput:
|
|
1572
|
-
placeholder:
|
|
1573
|
-
disabled:
|
|
1574
|
-
onFocus: () =>
|
|
1575
|
-
onBlur: () =>
|
|
1576
|
-
ref:
|
|
1841
|
+
value: g,
|
|
1842
|
+
onChange: (C) => T(C.target.value),
|
|
1843
|
+
onInput: F,
|
|
1844
|
+
placeholder: u,
|
|
1845
|
+
disabled: c,
|
|
1846
|
+
onFocus: () => N(!0),
|
|
1847
|
+
onBlur: () => N(!1),
|
|
1848
|
+
ref: k
|
|
1577
1849
|
}
|
|
1578
1850
|
),
|
|
1579
1851
|
/* @__PURE__ */ l("i", { className: "wx-12Wj21 wx-icon wxi-angle-down" })
|
|
1580
1852
|
] })
|
|
1581
1853
|
] }),
|
|
1582
|
-
!
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1854
|
+
!c && /* @__PURE__ */ l(
|
|
1855
|
+
ge,
|
|
1856
|
+
{
|
|
1857
|
+
items: $,
|
|
1858
|
+
multiselect: !0,
|
|
1859
|
+
onReady: V,
|
|
1860
|
+
onSelect: j,
|
|
1861
|
+
checkboxes: o,
|
|
1862
|
+
value: h,
|
|
1863
|
+
...p,
|
|
1864
|
+
children: ({ option: C }) => /* @__PURE__ */ l(_, { children: d ? ae(d, { option: C }) : C[r] })
|
|
1865
|
+
}
|
|
1866
|
+
)
|
|
1593
1867
|
]
|
|
1594
1868
|
}
|
|
1595
1869
|
);
|
|
1596
1870
|
}
|
|
1597
|
-
|
|
1598
|
-
left: e = 0,
|
|
1599
|
-
top: n = 0,
|
|
1600
|
-
at: t = "bottom",
|
|
1601
|
-
parent: c = null,
|
|
1602
|
-
onCancel: r,
|
|
1603
|
-
children: i
|
|
1604
|
-
}) {
|
|
1605
|
-
const [o, s] = P(0), [a, u] = P(0), [w, f] = P("auto"), [x, m] = P(!1), p = H(null), d = y(() => {
|
|
1606
|
-
if (!p.current) return;
|
|
1607
|
-
const h = Be(p.current, c, t, e, n);
|
|
1608
|
-
h && (s(h.x), u(h.y), f(h.width), m(!0));
|
|
1609
|
-
}, [p, c, t, e, n]);
|
|
1610
|
-
return B(() => {
|
|
1611
|
-
requestAnimationFrame(d);
|
|
1612
|
-
}, []), B(() => {
|
|
1613
|
-
d(c);
|
|
1614
|
-
}, [c, t, e, n]), B(() => {
|
|
1615
|
-
const h = (v) => {
|
|
1616
|
-
r && r(v);
|
|
1617
|
-
};
|
|
1618
|
-
if (p.current)
|
|
1619
|
-
return de(p.current, h).destroy;
|
|
1620
|
-
}, [r]), /* @__PURE__ */ l(
|
|
1621
|
-
"div",
|
|
1622
|
-
{
|
|
1623
|
-
ref: p,
|
|
1624
|
-
className: "wx-37M6Fj wx-popup",
|
|
1625
|
-
style: {
|
|
1626
|
-
position: "absolute",
|
|
1627
|
-
visibility: x ? "visible" : "hidden",
|
|
1628
|
-
top: a + "px",
|
|
1629
|
-
left: o + "px",
|
|
1630
|
-
width: w
|
|
1631
|
-
},
|
|
1632
|
-
children: i
|
|
1633
|
-
}
|
|
1634
|
-
);
|
|
1635
|
-
}
|
|
1636
|
-
const Ht = ({
|
|
1871
|
+
const rn = ({
|
|
1637
1872
|
total: e = 0,
|
|
1638
1873
|
pageSize: n = 20,
|
|
1639
1874
|
value: t = 1,
|
|
1640
|
-
onChange:
|
|
1875
|
+
onChange: s
|
|
1641
1876
|
}) => {
|
|
1642
|
-
const [r,
|
|
1643
|
-
Number.isNaN(
|
|
1644
|
-
|
|
1645
|
-
value:
|
|
1646
|
-
from: (
|
|
1647
|
-
to: Math.min(
|
|
1877
|
+
const [r, u] = J(n), [i, c] = J(t), a = (K(q) || X()).getGroup("core"), o = Math.ceil(e / r), f = (i - 1) * r, d = Math.min(i * r, e), p = (w, h) => {
|
|
1878
|
+
Number.isNaN(w) || (h || c(w), w = Math.max(1, Math.min(w, o)), h && c(w), w !== i && setTimeout(() => {
|
|
1879
|
+
s && s({
|
|
1880
|
+
value: w,
|
|
1881
|
+
from: (w - 1) * r,
|
|
1882
|
+
to: Math.min(w * r, e),
|
|
1648
1883
|
pageSize: r
|
|
1649
1884
|
});
|
|
1650
1885
|
}));
|
|
1651
1886
|
};
|
|
1652
|
-
function
|
|
1653
|
-
switch (
|
|
1887
|
+
function v(w) {
|
|
1888
|
+
switch (w) {
|
|
1654
1889
|
case "first":
|
|
1655
|
-
|
|
1890
|
+
p(1);
|
|
1656
1891
|
break;
|
|
1657
1892
|
case "prev":
|
|
1658
|
-
|
|
1893
|
+
p(i - 1);
|
|
1659
1894
|
break;
|
|
1660
1895
|
case "next":
|
|
1661
|
-
|
|
1896
|
+
p(i + 1);
|
|
1662
1897
|
break;
|
|
1663
1898
|
case "last":
|
|
1664
|
-
|
|
1899
|
+
p(o);
|
|
1665
1900
|
break;
|
|
1666
1901
|
}
|
|
1667
1902
|
}
|
|
1668
|
-
const
|
|
1669
|
-
const h =
|
|
1670
|
-
Number.isNaN(h) || (
|
|
1903
|
+
const x = (w) => {
|
|
1904
|
+
const h = w.target.value * 1;
|
|
1905
|
+
Number.isNaN(h) || (u(h), s && s({ value: i, from: f, to: d, pageSize: h }));
|
|
1671
1906
|
};
|
|
1672
|
-
return /* @__PURE__ */
|
|
1673
|
-
/* @__PURE__ */
|
|
1674
|
-
/* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ R("div", { className: "wx-35Np0p wx-pager", children: [
|
|
1908
|
+
/* @__PURE__ */ R("div", { className: "wx-35Np0p wx-left", children: [
|
|
1909
|
+
/* @__PURE__ */ R("span", { children: [
|
|
1675
1910
|
a("Rows per page"),
|
|
1676
1911
|
": "
|
|
1677
1912
|
] }),
|
|
@@ -1682,180 +1917,181 @@ const Ht = ({
|
|
|
1682
1917
|
min: 1,
|
|
1683
1918
|
className: "wx-35Np0p wx-input",
|
|
1684
1919
|
value: r,
|
|
1685
|
-
onChange:
|
|
1920
|
+
onChange: x
|
|
1686
1921
|
}
|
|
1687
1922
|
)
|
|
1688
1923
|
] }),
|
|
1689
|
-
/* @__PURE__ */
|
|
1924
|
+
/* @__PURE__ */ R("div", { className: "wx-35Np0p wx-center", children: [
|
|
1690
1925
|
/* @__PURE__ */ l(
|
|
1691
1926
|
"i",
|
|
1692
1927
|
{
|
|
1693
|
-
className: "wx-35Np0p wx-icon wxi-angle-dbl-left" + (
|
|
1694
|
-
onClick: () =>
|
|
1928
|
+
className: "wx-35Np0p wx-icon wxi-angle-dbl-left" + (i === 1 ? " wx-disabled" : ""),
|
|
1929
|
+
onClick: () => v("first")
|
|
1695
1930
|
}
|
|
1696
1931
|
),
|
|
1697
1932
|
/* @__PURE__ */ l(
|
|
1698
1933
|
"i",
|
|
1699
1934
|
{
|
|
1700
|
-
className: "wx-35Np0p wx-icon wxi-angle-left" + (
|
|
1701
|
-
onClick: () =>
|
|
1935
|
+
className: "wx-35Np0p wx-icon wxi-angle-left" + (i === 1 ? " wx-disabled" : ""),
|
|
1936
|
+
onClick: () => v("prev")
|
|
1702
1937
|
}
|
|
1703
1938
|
),
|
|
1704
1939
|
/* @__PURE__ */ l(
|
|
1705
1940
|
"input",
|
|
1706
1941
|
{
|
|
1707
1942
|
type: "text",
|
|
1708
|
-
value:
|
|
1943
|
+
value: i,
|
|
1709
1944
|
className: "wx-35Np0p wx-input",
|
|
1710
|
-
onChange: (
|
|
1711
|
-
onBlur: (
|
|
1945
|
+
onChange: (w) => p(w.target.value * 1),
|
|
1946
|
+
onBlur: (w) => p(w.target.value * 1, !0)
|
|
1712
1947
|
}
|
|
1713
1948
|
),
|
|
1714
1949
|
/* @__PURE__ */ l(
|
|
1715
1950
|
"i",
|
|
1716
1951
|
{
|
|
1717
|
-
className: "wx-35Np0p wx-icon wxi-angle-right" + (
|
|
1718
|
-
onClick: () =>
|
|
1952
|
+
className: "wx-35Np0p wx-icon wxi-angle-right" + (i === o ? " wx-disabled" : ""),
|
|
1953
|
+
onClick: () => v("next")
|
|
1719
1954
|
}
|
|
1720
1955
|
),
|
|
1721
1956
|
/* @__PURE__ */ l(
|
|
1722
1957
|
"i",
|
|
1723
1958
|
{
|
|
1724
|
-
className: "wx-35Np0p wx-icon wxi-angle-dbl-right" + (
|
|
1725
|
-
onClick: () =>
|
|
1959
|
+
className: "wx-35Np0p wx-icon wxi-angle-dbl-right" + (i === o ? " wx-disabled" : ""),
|
|
1960
|
+
onClick: () => v("last")
|
|
1726
1961
|
}
|
|
1727
1962
|
)
|
|
1728
1963
|
] }),
|
|
1729
|
-
/* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ R("div", { className: "wx-35Np0p wx-right", children: [
|
|
1730
1965
|
a("Total pages"),
|
|
1731
1966
|
": ",
|
|
1732
|
-
|
|
1967
|
+
o
|
|
1733
1968
|
] })
|
|
1734
1969
|
] });
|
|
1735
1970
|
};
|
|
1736
|
-
function
|
|
1971
|
+
function It({
|
|
1737
1972
|
id: e,
|
|
1738
1973
|
label: n = "",
|
|
1739
1974
|
value: t,
|
|
1740
|
-
name:
|
|
1975
|
+
name: s = "",
|
|
1741
1976
|
inputValue: r = "",
|
|
1742
|
-
disabled:
|
|
1743
|
-
onChange:
|
|
1977
|
+
disabled: u = !1,
|
|
1978
|
+
onChange: i
|
|
1744
1979
|
}) {
|
|
1745
|
-
const
|
|
1746
|
-
function
|
|
1747
|
-
const
|
|
1748
|
-
|
|
1980
|
+
const c = _e(), a = z(e) || c, [o, f] = B(!1), d = t !== void 0, p = d ? t : o;
|
|
1981
|
+
function v(x) {
|
|
1982
|
+
const w = x.target.checked;
|
|
1983
|
+
d || f(w), w && i && i({ value: !0, inputValue: r });
|
|
1749
1984
|
}
|
|
1750
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ R("div", { className: "wx-3lDF1s wx-radio", children: [
|
|
1751
1986
|
/* @__PURE__ */ l(
|
|
1752
1987
|
"input",
|
|
1753
1988
|
{
|
|
1754
1989
|
type: "radio",
|
|
1755
1990
|
className: "wx-3lDF1s wx-input",
|
|
1756
1991
|
id: a,
|
|
1757
|
-
disabled:
|
|
1758
|
-
name:
|
|
1992
|
+
disabled: u,
|
|
1993
|
+
name: s,
|
|
1759
1994
|
value: r,
|
|
1760
|
-
checked:
|
|
1761
|
-
onChange:
|
|
1995
|
+
checked: p,
|
|
1996
|
+
onChange: v
|
|
1762
1997
|
}
|
|
1763
1998
|
),
|
|
1764
|
-
/* @__PURE__ */
|
|
1999
|
+
/* @__PURE__ */ R("label", { htmlFor: a, className: "wx-3lDF1s wx-label", children: [
|
|
1765
2000
|
/* @__PURE__ */ l("span", { className: "wx-3lDF1s wx-circle" }),
|
|
1766
2001
|
n && /* @__PURE__ */ l("span", { className: "wx-3lDF1s wx-radio-text", children: n })
|
|
1767
2002
|
] })
|
|
1768
2003
|
] });
|
|
1769
2004
|
}
|
|
1770
|
-
function
|
|
2005
|
+
function ln({
|
|
1771
2006
|
options: e = [{}],
|
|
1772
2007
|
value: n = "",
|
|
1773
2008
|
onChange: t,
|
|
1774
|
-
type:
|
|
2009
|
+
type: s = ""
|
|
1775
2010
|
}) {
|
|
1776
|
-
const r =
|
|
1777
|
-
|
|
1778
|
-
|
|
2011
|
+
const r = oe(), [u, i] = B(n);
|
|
2012
|
+
W(() => {
|
|
2013
|
+
i(n);
|
|
1779
2014
|
}, [n]);
|
|
1780
|
-
function
|
|
1781
|
-
const
|
|
1782
|
-
o
|
|
2015
|
+
function c(a) {
|
|
2016
|
+
const o = a.inputValue;
|
|
2017
|
+
i(o), t && t({ value: o });
|
|
1783
2018
|
}
|
|
1784
|
-
return /* @__PURE__ */ l(
|
|
1785
|
-
|
|
2019
|
+
return /* @__PURE__ */ l(ue.Provider, { value: null, children: /* @__PURE__ */ l("div", { className: `wx-38w70j wx-radiogroup ${s && `wx-${s}`}`, children: e.map((a) => /* @__PURE__ */ l("div", { className: "wx-38w70j wx-item", children: /* @__PURE__ */ l(
|
|
2020
|
+
It,
|
|
1786
2021
|
{
|
|
1787
2022
|
label: a.label,
|
|
1788
2023
|
inputValue: a.id,
|
|
1789
|
-
value:
|
|
2024
|
+
value: u === a.id,
|
|
1790
2025
|
name: r,
|
|
1791
|
-
onChange:
|
|
2026
|
+
onChange: c
|
|
1792
2027
|
}
|
|
1793
2028
|
) }, a.id)) }) });
|
|
1794
2029
|
}
|
|
1795
|
-
function
|
|
2030
|
+
function cn({
|
|
1796
2031
|
value: e = "",
|
|
1797
2032
|
options: n = [],
|
|
1798
2033
|
textOptions: t = null,
|
|
1799
|
-
placeholder:
|
|
2034
|
+
placeholder: s = "",
|
|
1800
2035
|
disabled: r = !1,
|
|
1801
|
-
error:
|
|
1802
|
-
title:
|
|
1803
|
-
textField:
|
|
2036
|
+
error: u = !1,
|
|
2037
|
+
title: i = "",
|
|
2038
|
+
textField: c = "label",
|
|
1804
2039
|
clear: a = !1,
|
|
1805
|
-
children:
|
|
1806
|
-
onChange:
|
|
2040
|
+
children: o,
|
|
2041
|
+
onChange: f,
|
|
2042
|
+
dropdown: d = {}
|
|
1807
2043
|
}) {
|
|
1808
|
-
const
|
|
1809
|
-
let [
|
|
1810
|
-
function
|
|
1811
|
-
|
|
2044
|
+
const p = S(null), v = S(null);
|
|
2045
|
+
let [x, w] = J(e);
|
|
2046
|
+
function h(N) {
|
|
2047
|
+
p.current = N.navigate, v.current = N.keydown;
|
|
1812
2048
|
}
|
|
1813
|
-
const
|
|
1814
|
-
({ id:
|
|
1815
|
-
(
|
|
2049
|
+
const m = A(() => x || x === 0 ? (t || n).find((N) => N.id === x) : null, [x, t, n]), g = D(
|
|
2050
|
+
({ id: N }) => {
|
|
2051
|
+
(N || N === 0) && (w(N), p.current(null), f && f({ value: N }));
|
|
1816
2052
|
},
|
|
1817
|
-
[
|
|
1818
|
-
),
|
|
1819
|
-
(
|
|
1820
|
-
|
|
2053
|
+
[w, f]
|
|
2054
|
+
), T = D(
|
|
2055
|
+
(N) => {
|
|
2056
|
+
N.stopPropagation(), w(""), f && f({ value: "" });
|
|
1821
2057
|
},
|
|
1822
|
-
[
|
|
1823
|
-
),
|
|
1824
|
-
return /* @__PURE__ */
|
|
2058
|
+
[w, f]
|
|
2059
|
+
), b = D(() => n.findIndex((N) => N.id === x), [n, x]);
|
|
2060
|
+
return /* @__PURE__ */ R(
|
|
1825
2061
|
"div",
|
|
1826
2062
|
{
|
|
1827
|
-
className: `wx-2YgblL wx-richselect ${
|
|
1828
|
-
title:
|
|
1829
|
-
onClick: () =>
|
|
1830
|
-
onKeyDown: (
|
|
2063
|
+
className: `wx-2YgblL wx-richselect ${u ? "wx-2YgblL wx-error" : ""} ${r ? "wx-2YgblL wx-disabled" : ""} ${o ? "" : "wx-2YgblL wx-nowrap"}`,
|
|
2064
|
+
title: i,
|
|
2065
|
+
onClick: () => p.current(b()),
|
|
2066
|
+
onKeyDown: (N) => v.current(N, b()),
|
|
1831
2067
|
tabIndex: 0,
|
|
1832
2068
|
children: [
|
|
1833
|
-
/* @__PURE__ */ l("div", { className: "wx-2YgblL wx-label", children:
|
|
1834
|
-
a && !r &&
|
|
1835
|
-
!r && /* @__PURE__ */ l(
|
|
2069
|
+
/* @__PURE__ */ l("div", { className: "wx-2YgblL wx-label", children: m ? o ? o(m) : m[c] : s ? /* @__PURE__ */ l("span", { className: "wx-2YgblL wx-placeholder", children: s }) : " " }),
|
|
2070
|
+
a && !r && x ? /* @__PURE__ */ l("i", { className: "wx-2YgblL wx-icon wxi-close", onClick: T }) : /* @__PURE__ */ l("i", { className: "wx-2YgblL wx-icon wxi-angle-down" }),
|
|
2071
|
+
!r && /* @__PURE__ */ l(ge, { items: n, onReady: h, onSelect: g, ...d, children: ({ option: N }) => o ? o(N) : N[c] })
|
|
1836
2072
|
]
|
|
1837
2073
|
}
|
|
1838
2074
|
);
|
|
1839
2075
|
}
|
|
1840
|
-
const
|
|
2076
|
+
const sn = ({
|
|
1841
2077
|
options: e = [],
|
|
1842
2078
|
value: n = "",
|
|
1843
2079
|
css: t = "",
|
|
1844
|
-
children:
|
|
2080
|
+
children: s,
|
|
1845
2081
|
onChange: r
|
|
1846
2082
|
}) => {
|
|
1847
|
-
const [
|
|
1848
|
-
|
|
2083
|
+
const [u, i] = B(n), c = (a) => {
|
|
2084
|
+
i(a), r && r({ value: a });
|
|
1849
2085
|
};
|
|
1850
|
-
return
|
|
1851
|
-
|
|
2086
|
+
return W(() => {
|
|
2087
|
+
i(n);
|
|
1852
2088
|
}, [n]), /* @__PURE__ */ l("div", { className: `wx-0hMO7P wx-segmented ${t}`, children: e.map((a) => /* @__PURE__ */ l(
|
|
1853
2089
|
"button",
|
|
1854
2090
|
{
|
|
1855
|
-
className: `wx-0hMO7P wx-segment ${a.css} ${a.id ===
|
|
2091
|
+
className: `wx-0hMO7P wx-segment ${a.css} ${a.id === u ? "wx-selected" : ""}`,
|
|
1856
2092
|
title: a.title,
|
|
1857
|
-
onClick: () =>
|
|
1858
|
-
children:
|
|
2093
|
+
onClick: () => c(a.id),
|
|
2094
|
+
children: s ? ae(s, { option: a }) : /* @__PURE__ */ R(_, { children: [
|
|
1859
2095
|
a.icon && /* @__PURE__ */ l(
|
|
1860
2096
|
"i",
|
|
1861
2097
|
{
|
|
@@ -1868,124 +2104,127 @@ const At = ({
|
|
|
1868
2104
|
a.id
|
|
1869
2105
|
)) });
|
|
1870
2106
|
};
|
|
1871
|
-
function
|
|
2107
|
+
function an({
|
|
1872
2108
|
value: e,
|
|
1873
2109
|
options: n = [],
|
|
1874
2110
|
placeholder: t = "",
|
|
1875
|
-
title:
|
|
2111
|
+
title: s = "",
|
|
1876
2112
|
disabled: r = !1,
|
|
1877
|
-
error:
|
|
1878
|
-
textField:
|
|
1879
|
-
clear:
|
|
2113
|
+
error: u = !1,
|
|
2114
|
+
textField: i = "label",
|
|
2115
|
+
clear: c = !1,
|
|
1880
2116
|
id: a,
|
|
1881
|
-
onChange:
|
|
2117
|
+
onChange: o
|
|
1882
2118
|
}) {
|
|
1883
|
-
const
|
|
1884
|
-
(
|
|
1885
|
-
const h =
|
|
1886
|
-
|
|
2119
|
+
const f = z(a), [d, p] = B(e || ""), v = D(
|
|
2120
|
+
(w) => {
|
|
2121
|
+
const h = w.target.value;
|
|
2122
|
+
p(h), o && o({ value: h });
|
|
1887
2123
|
},
|
|
1888
|
-
[
|
|
1889
|
-
),
|
|
1890
|
-
|
|
1891
|
-
}, [
|
|
1892
|
-
return /* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
2124
|
+
[o]
|
|
2125
|
+
), x = D(() => {
|
|
2126
|
+
p(""), o && o({ value: "" });
|
|
2127
|
+
}, [o]);
|
|
2128
|
+
return /* @__PURE__ */ R("div", { className: "wx-2yx1Fo wx-select-box", children: [
|
|
2129
|
+
/* @__PURE__ */ R(
|
|
1894
2130
|
"select",
|
|
1895
2131
|
{
|
|
1896
|
-
id:
|
|
1897
|
-
value:
|
|
2132
|
+
id: f,
|
|
2133
|
+
value: d,
|
|
1898
2134
|
disabled: r,
|
|
1899
|
-
className: `wx-2yx1Fo wx-select ${
|
|
1900
|
-
title:
|
|
1901
|
-
onChange:
|
|
2135
|
+
className: `wx-2yx1Fo wx-select ${u ? "wx-2yx1Fo wx-error" : ""}`,
|
|
2136
|
+
title: s,
|
|
2137
|
+
onChange: v,
|
|
1902
2138
|
children: [
|
|
1903
2139
|
/* @__PURE__ */ l("option", { value: "", children: t }),
|
|
1904
|
-
n.map((
|
|
2140
|
+
n.map((w) => /* @__PURE__ */ l("option", { value: w.id, children: w[i] }, w.id))
|
|
1905
2141
|
]
|
|
1906
2142
|
}
|
|
1907
2143
|
),
|
|
1908
|
-
|
|
2144
|
+
c && !r && d ? /* @__PURE__ */ l("i", { className: "wx-2yx1Fo wx-icon wxi-close", onClick: x }) : /* @__PURE__ */ l("i", { className: "wx-2yx1Fo wx-icon wxi-angle-down" })
|
|
1909
2145
|
] });
|
|
1910
2146
|
}
|
|
1911
|
-
function
|
|
2147
|
+
function Ce({
|
|
1912
2148
|
id: e,
|
|
1913
2149
|
label: n = "",
|
|
1914
2150
|
css: t = "",
|
|
1915
|
-
min:
|
|
2151
|
+
min: s = 0,
|
|
1916
2152
|
max: r = 100,
|
|
1917
|
-
value:
|
|
1918
|
-
step:
|
|
1919
|
-
title:
|
|
2153
|
+
value: u = 0,
|
|
2154
|
+
step: i = 1,
|
|
2155
|
+
title: c = "",
|
|
1920
2156
|
disabled: a = !1,
|
|
1921
|
-
onChange:
|
|
2157
|
+
onChange: o,
|
|
2158
|
+
width: f = ""
|
|
1922
2159
|
}) {
|
|
1923
|
-
const
|
|
1924
|
-
() => (
|
|
1925
|
-
[
|
|
1926
|
-
),
|
|
1927
|
-
function
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1930
|
-
value:
|
|
1931
|
-
previous:
|
|
2160
|
+
const d = z(e), [p, v] = J(u), x = S({ value: p, input: p }), w = A(
|
|
2161
|
+
() => (p - s) / (r - s) * 100 + "%",
|
|
2162
|
+
[p, s, r]
|
|
2163
|
+
), h = A(() => a ? "" : `linear-gradient(90deg, var(--wx-slider-primary) 0% ${w}, var(--wx-slider-background) ${w} 100%)`, [a, w]);
|
|
2164
|
+
function m({ target: N }) {
|
|
2165
|
+
const k = N.value * 1;
|
|
2166
|
+
v(k), o && o({
|
|
2167
|
+
value: k,
|
|
2168
|
+
previous: x.current.input,
|
|
1932
2169
|
input: !0
|
|
1933
|
-
}),
|
|
2170
|
+
}), x.current.input = k;
|
|
1934
2171
|
}
|
|
1935
|
-
function
|
|
1936
|
-
const
|
|
1937
|
-
|
|
2172
|
+
function g({ target: N }) {
|
|
2173
|
+
const k = N.value * 1;
|
|
2174
|
+
v(k), o && o({ value: k, previous: x.current.value }), x.current.value = k;
|
|
1938
2175
|
}
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
}, [
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1944
|
-
if (
|
|
1945
|
-
return
|
|
1946
|
-
|
|
2176
|
+
W(() => {
|
|
2177
|
+
v(u);
|
|
2178
|
+
}, [u]);
|
|
2179
|
+
const T = S(null);
|
|
2180
|
+
W(() => {
|
|
2181
|
+
if (T.current)
|
|
2182
|
+
return T.current.addEventListener("change", g), () => {
|
|
2183
|
+
T.current && T.current.removeEventListener("change", g);
|
|
1947
2184
|
};
|
|
1948
|
-
}, [
|
|
1949
|
-
|
|
2185
|
+
}, [T, g]);
|
|
2186
|
+
const b = { ...f && { width: f } };
|
|
2187
|
+
return /* @__PURE__ */ R("div", { className: `wx-2EDJ8G wx-slider ${t}`, style: b, title: c, children: [
|
|
2188
|
+
n && /* @__PURE__ */ l("label", { className: "wx-2EDJ8G wx-label", htmlFor: d, children: n }),
|
|
1950
2189
|
/* @__PURE__ */ l("div", { className: "wx-2EDJ8G wx-inner", children: /* @__PURE__ */ l(
|
|
1951
2190
|
"input",
|
|
1952
2191
|
{
|
|
1953
|
-
id:
|
|
2192
|
+
id: d,
|
|
1954
2193
|
className: "wx-2EDJ8G wx-input",
|
|
1955
2194
|
type: "range",
|
|
1956
|
-
min:
|
|
2195
|
+
min: s,
|
|
1957
2196
|
max: r,
|
|
1958
|
-
step:
|
|
2197
|
+
step: i,
|
|
1959
2198
|
disabled: a,
|
|
1960
|
-
value:
|
|
1961
|
-
onInput:
|
|
1962
|
-
style: { background:
|
|
1963
|
-
ref:
|
|
2199
|
+
value: p,
|
|
2200
|
+
onInput: m,
|
|
2201
|
+
style: { background: h },
|
|
2202
|
+
ref: T
|
|
1964
2203
|
}
|
|
1965
2204
|
) })
|
|
1966
2205
|
] });
|
|
1967
2206
|
}
|
|
1968
|
-
function
|
|
2207
|
+
function on({
|
|
1969
2208
|
id: e,
|
|
1970
2209
|
value: n = !1,
|
|
1971
2210
|
disabled: t = !1,
|
|
1972
|
-
onChange:
|
|
2211
|
+
onChange: s
|
|
1973
2212
|
}) {
|
|
1974
|
-
const r = z(e), [
|
|
2213
|
+
const r = z(e), [u, i] = J(n), c = D(
|
|
1975
2214
|
(a) => {
|
|
1976
|
-
const
|
|
1977
|
-
o
|
|
2215
|
+
const o = a.target.checked;
|
|
2216
|
+
i(o), s && s({ value: o });
|
|
1978
2217
|
},
|
|
1979
|
-
[
|
|
2218
|
+
[s]
|
|
1980
2219
|
);
|
|
1981
|
-
return /* @__PURE__ */
|
|
2220
|
+
return /* @__PURE__ */ R("label", { className: "wx-2dAR5c wx-switch", children: [
|
|
1982
2221
|
/* @__PURE__ */ l(
|
|
1983
2222
|
"input",
|
|
1984
2223
|
{
|
|
1985
2224
|
className: "wx-2dAR5c wx-input",
|
|
1986
2225
|
type: "checkbox",
|
|
1987
|
-
checked:
|
|
1988
|
-
onChange:
|
|
2226
|
+
checked: u,
|
|
2227
|
+
onChange: c,
|
|
1989
2228
|
disabled: t,
|
|
1990
2229
|
id: r
|
|
1991
2230
|
}
|
|
@@ -1993,22 +2232,22 @@ function Wt({
|
|
|
1993
2232
|
/* @__PURE__ */ l("span", { className: "wx-2dAR5c wx-box" })
|
|
1994
2233
|
] });
|
|
1995
2234
|
}
|
|
1996
|
-
const
|
|
2235
|
+
const un = ({
|
|
1997
2236
|
options: e = [],
|
|
1998
2237
|
value: n = "",
|
|
1999
2238
|
type: t = "top",
|
|
2000
|
-
css:
|
|
2239
|
+
css: s = "",
|
|
2001
2240
|
onChange: r
|
|
2002
2241
|
}) => {
|
|
2003
|
-
const [
|
|
2004
|
-
|
|
2242
|
+
const [u, i] = J(n), c = (a) => {
|
|
2243
|
+
i(a), r && r({ value: a });
|
|
2005
2244
|
};
|
|
2006
|
-
return /* @__PURE__ */ l("div", { className: `wx-138fWJ wx-tabs wx-${t} ${
|
|
2245
|
+
return /* @__PURE__ */ l("div", { className: `wx-138fWJ wx-tabs wx-${t} ${s}`, children: e.map((a) => /* @__PURE__ */ R(
|
|
2007
2246
|
"button",
|
|
2008
2247
|
{
|
|
2009
|
-
className: `wx-138fWJ wx-tab ${a.css} ${a.id ===
|
|
2248
|
+
className: `wx-138fWJ wx-tab ${a.css} ${a.id === u ? "wx-active" : ""}`,
|
|
2010
2249
|
title: a.title,
|
|
2011
|
-
onClick: () =>
|
|
2250
|
+
onClick: () => c(a.id),
|
|
2012
2251
|
children: [
|
|
2013
2252
|
a.icon && /* @__PURE__ */ l(
|
|
2014
2253
|
"i",
|
|
@@ -2021,49 +2260,49 @@ const Yt = ({
|
|
|
2021
2260
|
},
|
|
2022
2261
|
a.id
|
|
2023
2262
|
)) });
|
|
2024
|
-
},
|
|
2263
|
+
}, dn = ({
|
|
2025
2264
|
id: e,
|
|
2026
2265
|
value: n = 0,
|
|
2027
2266
|
step: t = 1,
|
|
2028
|
-
min:
|
|
2267
|
+
min: s = 0,
|
|
2029
2268
|
max: r = 1 / 0,
|
|
2030
|
-
error:
|
|
2031
|
-
disabled:
|
|
2032
|
-
readonly:
|
|
2269
|
+
error: u = !1,
|
|
2270
|
+
disabled: i = !1,
|
|
2271
|
+
readonly: c = !1,
|
|
2033
2272
|
onChange: a
|
|
2034
2273
|
}) => {
|
|
2035
|
-
const
|
|
2036
|
-
if (
|
|
2037
|
-
const h =
|
|
2038
|
-
|
|
2039
|
-
}, [
|
|
2040
|
-
if (
|
|
2041
|
-
const h =
|
|
2042
|
-
|
|
2043
|
-
}, [
|
|
2044
|
-
if (!
|
|
2045
|
-
const h = Math.round(Math.min(r, Math.max(
|
|
2046
|
-
|
|
2274
|
+
const o = z(e), [f, d] = J(n), p = D(() => {
|
|
2275
|
+
if (c || f <= s) return;
|
|
2276
|
+
const h = f - t;
|
|
2277
|
+
d(h), a && a({ value: h });
|
|
2278
|
+
}, [f, c, s, t, a]), v = D(() => {
|
|
2279
|
+
if (c || f >= r) return;
|
|
2280
|
+
const h = f + t;
|
|
2281
|
+
d(h), a && a({ value: h });
|
|
2282
|
+
}, [f, c, r, t, a]), x = D(() => {
|
|
2283
|
+
if (!c) {
|
|
2284
|
+
const h = Math.round(Math.min(r, Math.max(f, s)) / t) * t, m = isNaN(h) ? Math.max(s, 0) : h;
|
|
2285
|
+
d(m), a && a({ value: m });
|
|
2047
2286
|
}
|
|
2048
|
-
}, [
|
|
2287
|
+
}, [c, f, r, s, t, a]), w = D(
|
|
2049
2288
|
(h) => {
|
|
2050
|
-
const
|
|
2051
|
-
|
|
2289
|
+
const m = h.target.value * 1;
|
|
2290
|
+
d(m), a && a({ value: m, input: !0 });
|
|
2052
2291
|
},
|
|
2053
2292
|
[a]
|
|
2054
2293
|
);
|
|
2055
|
-
return /* @__PURE__ */
|
|
2294
|
+
return /* @__PURE__ */ R(
|
|
2056
2295
|
"div",
|
|
2057
2296
|
{
|
|
2058
|
-
className: `wx-22t21n wx-counter ${
|
|
2297
|
+
className: `wx-22t21n wx-counter ${i ? "wx-disabled" : ""} ${c ? "wx-readonly" : ""} ${u ? "wx-error" : ""}`,
|
|
2059
2298
|
children: [
|
|
2060
2299
|
/* @__PURE__ */ l(
|
|
2061
2300
|
"button",
|
|
2062
2301
|
{
|
|
2063
2302
|
"aria-label": "-",
|
|
2064
2303
|
className: "wx-22t21n wx-btn wx-btn-dec",
|
|
2065
|
-
disabled:
|
|
2066
|
-
onClick:
|
|
2304
|
+
disabled: i,
|
|
2305
|
+
onClick: p,
|
|
2067
2306
|
children: /* @__PURE__ */ l(
|
|
2068
2307
|
"svg",
|
|
2069
2308
|
{
|
|
@@ -2081,15 +2320,15 @@ const Yt = ({
|
|
|
2081
2320
|
/* @__PURE__ */ l(
|
|
2082
2321
|
"input",
|
|
2083
2322
|
{
|
|
2084
|
-
id:
|
|
2323
|
+
id: o,
|
|
2085
2324
|
type: "text",
|
|
2086
2325
|
className: "wx-22t21n wx-input",
|
|
2087
|
-
disabled:
|
|
2088
|
-
readOnly:
|
|
2326
|
+
disabled: i,
|
|
2327
|
+
readOnly: c,
|
|
2089
2328
|
required: !0,
|
|
2090
|
-
value:
|
|
2091
|
-
onBlur:
|
|
2092
|
-
onInput:
|
|
2329
|
+
value: f,
|
|
2330
|
+
onBlur: x,
|
|
2331
|
+
onInput: w
|
|
2093
2332
|
}
|
|
2094
2333
|
),
|
|
2095
2334
|
/* @__PURE__ */ l(
|
|
@@ -2097,8 +2336,8 @@ const Yt = ({
|
|
|
2097
2336
|
{
|
|
2098
2337
|
"aria-label": "-",
|
|
2099
2338
|
className: "wx-22t21n wx-btn wx-btn-inc",
|
|
2100
|
-
disabled:
|
|
2101
|
-
onClick:
|
|
2339
|
+
disabled: i,
|
|
2340
|
+
onClick: v,
|
|
2102
2341
|
children: /* @__PURE__ */ l(
|
|
2103
2342
|
"svg",
|
|
2104
2343
|
{
|
|
@@ -2123,11 +2362,11 @@ const Yt = ({
|
|
|
2123
2362
|
}
|
|
2124
2363
|
);
|
|
2125
2364
|
};
|
|
2126
|
-
function
|
|
2365
|
+
function Ct({ notice: e = {} }) {
|
|
2127
2366
|
function n() {
|
|
2128
2367
|
e.remove && e.remove();
|
|
2129
2368
|
}
|
|
2130
|
-
return /* @__PURE__ */
|
|
2369
|
+
return /* @__PURE__ */ R(
|
|
2131
2370
|
"div",
|
|
2132
2371
|
{
|
|
2133
2372
|
className: `wx-11sNg5 wx-notice wx-${e.type ? e.type : ""}`,
|
|
@@ -2140,38 +2379,38 @@ function ut({ notice: e = {} }) {
|
|
|
2140
2379
|
}
|
|
2141
2380
|
);
|
|
2142
2381
|
}
|
|
2143
|
-
function
|
|
2144
|
-
return /* @__PURE__ */ l("div", { className: "wx-3nwoO9 wx-notices", children: e.map((n) => /* @__PURE__ */ l(
|
|
2382
|
+
function St({ data: e = [] }) {
|
|
2383
|
+
return /* @__PURE__ */ l("div", { className: "wx-3nwoO9 wx-notices", children: e.map((n) => /* @__PURE__ */ l(Ct, { notice: n }, n.id)) });
|
|
2145
2384
|
}
|
|
2146
|
-
function
|
|
2385
|
+
function Lt({
|
|
2147
2386
|
title: e = "",
|
|
2148
2387
|
buttons: n = ["cancel", "ok"],
|
|
2149
2388
|
header: t,
|
|
2150
|
-
children:
|
|
2389
|
+
children: s,
|
|
2151
2390
|
footer: r,
|
|
2152
|
-
onConfirm:
|
|
2153
|
-
onCancel:
|
|
2391
|
+
onConfirm: u,
|
|
2392
|
+
onCancel: i
|
|
2154
2393
|
}) {
|
|
2155
|
-
const
|
|
2156
|
-
|
|
2394
|
+
const c = (K(q) || X()).getGroup("core"), a = S(null);
|
|
2395
|
+
W(() => {
|
|
2157
2396
|
a.current?.focus();
|
|
2158
2397
|
}, []);
|
|
2159
|
-
function
|
|
2160
|
-
switch (
|
|
2398
|
+
function o(d) {
|
|
2399
|
+
switch (d.code) {
|
|
2161
2400
|
case "Enter": {
|
|
2162
|
-
const
|
|
2163
|
-
if (
|
|
2164
|
-
|
|
2401
|
+
const p = d.target.tagName;
|
|
2402
|
+
if (p === "TEXTAREA" || p === "BUTTON") return;
|
|
2403
|
+
u && u({ event: d });
|
|
2165
2404
|
break;
|
|
2166
2405
|
}
|
|
2167
2406
|
case "Escape":
|
|
2168
|
-
|
|
2407
|
+
i && i({ event: d });
|
|
2169
2408
|
break;
|
|
2170
2409
|
}
|
|
2171
2410
|
}
|
|
2172
|
-
function
|
|
2173
|
-
const
|
|
2174
|
-
|
|
2411
|
+
function f(d, p) {
|
|
2412
|
+
const v = { event: d, button: p };
|
|
2413
|
+
p === "cancel" ? i && i(v) : u && u(v);
|
|
2175
2414
|
}
|
|
2176
2415
|
return /* @__PURE__ */ l(
|
|
2177
2416
|
"div",
|
|
@@ -2179,46 +2418,46 @@ function wt({
|
|
|
2179
2418
|
className: "wx-1FxkZa wx-modal",
|
|
2180
2419
|
ref: a,
|
|
2181
2420
|
tabIndex: 0,
|
|
2182
|
-
onKeyDown:
|
|
2183
|
-
children: /* @__PURE__ */
|
|
2421
|
+
onKeyDown: o,
|
|
2422
|
+
children: /* @__PURE__ */ R("div", { className: "wx-1FxkZa wx-window", children: [
|
|
2184
2423
|
t || (e ? /* @__PURE__ */ l("div", { className: "wx-1FxkZa wx-header", children: e }) : null),
|
|
2185
|
-
/* @__PURE__ */ l("div", { children:
|
|
2186
|
-
r || n && /* @__PURE__ */ l("div", { className: "wx-1FxkZa wx-buttons", children: n.map((
|
|
2187
|
-
|
|
2424
|
+
/* @__PURE__ */ l("div", { children: s }),
|
|
2425
|
+
r || n && /* @__PURE__ */ l("div", { className: "wx-1FxkZa wx-buttons", children: n.map((d) => /* @__PURE__ */ l("div", { className: "wx-1FxkZa wx-button", children: /* @__PURE__ */ l(
|
|
2426
|
+
re,
|
|
2188
2427
|
{
|
|
2189
|
-
type: `block ${
|
|
2190
|
-
onClick: (
|
|
2191
|
-
children:
|
|
2428
|
+
type: `block ${d === "ok" ? "primary" : "secondary"}`,
|
|
2429
|
+
onClick: (p) => f(p, d),
|
|
2430
|
+
children: c(d)
|
|
2192
2431
|
}
|
|
2193
|
-
) },
|
|
2432
|
+
) }, d)) })
|
|
2194
2433
|
] })
|
|
2195
2434
|
}
|
|
2196
2435
|
);
|
|
2197
2436
|
}
|
|
2198
|
-
function
|
|
2199
|
-
const [t,
|
|
2200
|
-
return
|
|
2437
|
+
function Ft({ children: e }, n) {
|
|
2438
|
+
const [t, s] = B(null), [r, u] = B([]);
|
|
2439
|
+
return qe(
|
|
2201
2440
|
n,
|
|
2202
2441
|
() => ({
|
|
2203
|
-
showModal: (
|
|
2204
|
-
const
|
|
2205
|
-
return c
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
},
|
|
2209
|
-
|
|
2442
|
+
showModal: (i) => {
|
|
2443
|
+
const c = { ...i };
|
|
2444
|
+
return s(c), new Promise((a, o) => {
|
|
2445
|
+
c.resolve = (f) => {
|
|
2446
|
+
s(null), a(f);
|
|
2447
|
+
}, c.reject = (f) => {
|
|
2448
|
+
s(null), o(f);
|
|
2210
2449
|
};
|
|
2211
2450
|
});
|
|
2212
2451
|
},
|
|
2213
|
-
showNotice: (
|
|
2214
|
-
|
|
2452
|
+
showNotice: (i) => {
|
|
2453
|
+
i = { ...i }, i.id = i.id || oe(), i.remove = () => u((c) => c.filter((a) => a.id !== i.id)), i.expire != -1 && setTimeout(i.remove, i.expire || 5100), u((c) => [...c, i]);
|
|
2215
2454
|
}
|
|
2216
2455
|
}),
|
|
2217
2456
|
[]
|
|
2218
|
-
), /* @__PURE__ */
|
|
2457
|
+
), /* @__PURE__ */ R(_, { children: [
|
|
2219
2458
|
e,
|
|
2220
2459
|
t && /* @__PURE__ */ l(
|
|
2221
|
-
|
|
2460
|
+
Lt,
|
|
2222
2461
|
{
|
|
2223
2462
|
title: t.title,
|
|
2224
2463
|
buttons: t.buttons,
|
|
@@ -2227,161 +2466,160 @@ function ft({ children: e }, n) {
|
|
|
2227
2466
|
children: t.message
|
|
2228
2467
|
}
|
|
2229
2468
|
),
|
|
2230
|
-
/* @__PURE__ */ l(
|
|
2469
|
+
/* @__PURE__ */ l(St, { data: r })
|
|
2231
2470
|
] });
|
|
2232
2471
|
}
|
|
2233
|
-
const
|
|
2234
|
-
function
|
|
2235
|
-
let { children: n } = e, t =
|
|
2236
|
-
const
|
|
2472
|
+
const Ht = Qe(Ft);
|
|
2473
|
+
function fn(e) {
|
|
2474
|
+
let { children: n } = e, t = S();
|
|
2475
|
+
const s = A(() => ({
|
|
2237
2476
|
showNotice: (r) => t.current.showNotice(r),
|
|
2238
2477
|
showModal: (r) => t.current.showModal(r)
|
|
2239
2478
|
}), []);
|
|
2240
|
-
return /* @__PURE__ */ l(
|
|
2479
|
+
return /* @__PURE__ */ l(Oe.Provider, { value: s, children: /* @__PURE__ */ l(Ht, { ref: t, children: n }) });
|
|
2241
2480
|
}
|
|
2242
|
-
function
|
|
2481
|
+
function Se({
|
|
2243
2482
|
label: e = "",
|
|
2244
2483
|
position: n = "",
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
children:
|
|
2484
|
+
error: t = !1,
|
|
2485
|
+
type: s = "",
|
|
2486
|
+
required: r = !1,
|
|
2487
|
+
id: u,
|
|
2488
|
+
children: i,
|
|
2489
|
+
width: c = ""
|
|
2250
2490
|
}) {
|
|
2251
|
-
const
|
|
2252
|
-
|
|
2253
|
-
const u = le();
|
|
2254
|
-
return s.current = u, u;
|
|
2255
|
-
}, []);
|
|
2256
|
-
return /* @__PURE__ */ l(se.Provider, { value: a, children: /* @__PURE__ */ $(
|
|
2491
|
+
const a = A(() => u === void 0 ? oe() : u, [u]), o = { ...c && { width: c } };
|
|
2492
|
+
return /* @__PURE__ */ l(ue.Provider, { value: a, children: /* @__PURE__ */ R(
|
|
2257
2493
|
"div",
|
|
2258
2494
|
{
|
|
2259
|
-
|
|
2495
|
+
style: o,
|
|
2496
|
+
className: `wx-2oVUvC wx-field wx-${n} ${t ? "wx-error" : ""} ${r ? "wx-required" : ""}`.trim(),
|
|
2260
2497
|
children: [
|
|
2261
|
-
e && /* @__PURE__ */ l("label", { className: "wx-2oVUvC wx-label", htmlFor:
|
|
2262
|
-
/* @__PURE__ */ l("div", { className: `wx-2oVUvC wx-field-control wx-${
|
|
2498
|
+
e && (a ? /* @__PURE__ */ l("label", { className: "wx-2oVUvC wx-label", htmlFor: a, children: e }) : /* @__PURE__ */ l("div", { className: "wx-2oVUvC wx-label", children: e })),
|
|
2499
|
+
/* @__PURE__ */ l("div", { className: `wx-2oVUvC wx-field-control wx-${s}`, children: i })
|
|
2263
2500
|
]
|
|
2264
2501
|
}
|
|
2265
2502
|
) });
|
|
2266
2503
|
}
|
|
2267
|
-
const
|
|
2504
|
+
const Pt = ({
|
|
2268
2505
|
value: e = !1,
|
|
2269
2506
|
type: n = "",
|
|
2270
2507
|
icon: t = "",
|
|
2271
|
-
disabled:
|
|
2508
|
+
disabled: s = !1,
|
|
2272
2509
|
iconActive: r = "",
|
|
2273
|
-
onClick:
|
|
2274
|
-
title:
|
|
2275
|
-
css:
|
|
2510
|
+
onClick: u,
|
|
2511
|
+
title: i = "",
|
|
2512
|
+
css: c = "",
|
|
2276
2513
|
text: a = "",
|
|
2277
|
-
textActive:
|
|
2278
|
-
children:
|
|
2279
|
-
active:
|
|
2280
|
-
onChange:
|
|
2514
|
+
textActive: o = "",
|
|
2515
|
+
children: f,
|
|
2516
|
+
active: d,
|
|
2517
|
+
onChange: p
|
|
2281
2518
|
}) => {
|
|
2282
|
-
const [
|
|
2283
|
-
(
|
|
2284
|
-
let
|
|
2285
|
-
|
|
2519
|
+
const [v, x] = J(e), w = A(() => (v ? "pressed" : "") + (n ? " " + n : ""), [v, n]), h = D(
|
|
2520
|
+
(m) => {
|
|
2521
|
+
let g = !v;
|
|
2522
|
+
u && u(m), m.defaultPrevented || (x(g), p && p({ value: g }));
|
|
2286
2523
|
},
|
|
2287
|
-
[
|
|
2524
|
+
[v, u, p]
|
|
2288
2525
|
);
|
|
2289
|
-
return
|
|
2290
|
-
|
|
2526
|
+
return v && d ? /* @__PURE__ */ l(
|
|
2527
|
+
re,
|
|
2291
2528
|
{
|
|
2292
|
-
title:
|
|
2293
|
-
text:
|
|
2294
|
-
css:
|
|
2295
|
-
type:
|
|
2296
|
-
icon:
|
|
2529
|
+
title: i,
|
|
2530
|
+
text: v && o || a,
|
|
2531
|
+
css: c,
|
|
2532
|
+
type: w,
|
|
2533
|
+
icon: v && r || t,
|
|
2297
2534
|
onClick: h,
|
|
2298
|
-
disabled:
|
|
2299
|
-
children:
|
|
2535
|
+
disabled: s,
|
|
2536
|
+
children: ae(d, { value: v })
|
|
2300
2537
|
}
|
|
2301
|
-
) :
|
|
2302
|
-
|
|
2538
|
+
) : f ? /* @__PURE__ */ l(
|
|
2539
|
+
re,
|
|
2303
2540
|
{
|
|
2304
|
-
title:
|
|
2305
|
-
text:
|
|
2306
|
-
css:
|
|
2307
|
-
type:
|
|
2308
|
-
icon:
|
|
2541
|
+
title: i,
|
|
2542
|
+
text: v && o || a,
|
|
2543
|
+
css: c,
|
|
2544
|
+
type: w,
|
|
2545
|
+
icon: v && r || t,
|
|
2309
2546
|
onClick: h,
|
|
2310
|
-
disabled:
|
|
2311
|
-
children:
|
|
2547
|
+
disabled: s,
|
|
2548
|
+
children: f
|
|
2312
2549
|
}
|
|
2313
2550
|
) : /* @__PURE__ */ l(
|
|
2314
|
-
|
|
2551
|
+
re,
|
|
2315
2552
|
{
|
|
2316
|
-
title:
|
|
2317
|
-
text:
|
|
2318
|
-
css:
|
|
2319
|
-
type:
|
|
2320
|
-
icon:
|
|
2553
|
+
title: i,
|
|
2554
|
+
text: v && o || a,
|
|
2555
|
+
css: c,
|
|
2556
|
+
type: w,
|
|
2557
|
+
icon: v && r || t,
|
|
2321
2558
|
onClick: h,
|
|
2322
|
-
disabled:
|
|
2559
|
+
disabled: s
|
|
2323
2560
|
}
|
|
2324
2561
|
);
|
|
2325
|
-
},
|
|
2326
|
-
function
|
|
2327
|
-
value: e =
|
|
2562
|
+
}, Le = new Date(0, 0, 0, 0, 0);
|
|
2563
|
+
function wn({
|
|
2564
|
+
value: e = Le,
|
|
2328
2565
|
id: n,
|
|
2329
2566
|
title: t = "",
|
|
2330
|
-
css:
|
|
2567
|
+
css: s = "",
|
|
2331
2568
|
disabled: r = !1,
|
|
2332
|
-
error:
|
|
2333
|
-
format:
|
|
2334
|
-
onChange:
|
|
2569
|
+
error: u = !1,
|
|
2570
|
+
format: i = "",
|
|
2571
|
+
onChange: c,
|
|
2572
|
+
dropdown: a
|
|
2335
2573
|
}) {
|
|
2336
|
-
let [
|
|
2337
|
-
const { calendar:
|
|
2338
|
-
const
|
|
2339
|
-
return typeof
|
|
2340
|
-
}, [
|
|
2341
|
-
() =>
|
|
2342
|
-
[
|
|
2343
|
-
), O =
|
|
2344
|
-
|
|
2345
|
-
}, []),
|
|
2346
|
-
const
|
|
2347
|
-
|
|
2348
|
-
}, [
|
|
2349
|
-
({ value:
|
|
2350
|
-
if (
|
|
2351
|
-
const
|
|
2352
|
-
|
|
2574
|
+
let [o, f] = J(e);
|
|
2575
|
+
const { calendar: d, formats: p } = (K(q) || X()).getRaw(), v = d.clockFormat == 12, x = 23, w = 59, h = A(() => {
|
|
2576
|
+
const y = i || p?.timeFormat;
|
|
2577
|
+
return typeof y == "function" ? y : ne(y, d);
|
|
2578
|
+
}, [i, p, d]), m = A(() => h(new Date(0, 0, 0, 1)).indexOf("01") != -1, [h]), g = (y, E) => (y < 10 && E ? `0${y}` : `${y}`).slice(-2), T = (y) => g(y, !0), b = (y) => `${y}`.replace(/[^\d]/g, "") || 0, N = (y) => v && (y = y % 12, y === 0) ? "12" : g(y, m), k = D((y, E) => (y = b(y), Math.min(y, E)), []), [M, $] = B(null), V = o || Le, F = k(V.getHours(), x), j = k(V.getMinutes(), w), H = F > 12, L = N(F), P = T(j), C = A(
|
|
2579
|
+
() => h(new Date(0, 0, 0, F, j)),
|
|
2580
|
+
[F, j, h]
|
|
2581
|
+
), O = D(() => {
|
|
2582
|
+
$(!0);
|
|
2583
|
+
}, []), U = D(() => {
|
|
2584
|
+
const y = new Date(V);
|
|
2585
|
+
y.setHours(y.getHours() + (H ? -12 : 12)), f(y), c && c({ value: y });
|
|
2586
|
+
}, [V, H, c]), Y = D(
|
|
2587
|
+
({ value: y }) => {
|
|
2588
|
+
if (V.getHours() === y) return;
|
|
2589
|
+
const E = new Date(V);
|
|
2590
|
+
E.setHours(y), f(E), c && c({ value: E });
|
|
2353
2591
|
},
|
|
2354
|
-
[
|
|
2355
|
-
),
|
|
2356
|
-
({ value:
|
|
2357
|
-
if (
|
|
2358
|
-
const
|
|
2359
|
-
|
|
2592
|
+
[V, c]
|
|
2593
|
+
), I = D(
|
|
2594
|
+
({ value: y }) => {
|
|
2595
|
+
if (V.getMinutes() === y) return;
|
|
2596
|
+
const E = new Date(V);
|
|
2597
|
+
E.setMinutes(y), f(E), c && c({ value: E });
|
|
2360
2598
|
},
|
|
2361
|
-
[
|
|
2362
|
-
),
|
|
2363
|
-
(
|
|
2364
|
-
[
|
|
2365
|
-
),
|
|
2366
|
-
|
|
2599
|
+
[V, c]
|
|
2600
|
+
), G = D(
|
|
2601
|
+
(y) => (y = k(y, x), v && (y = y * 1, y === 12 && (y = 0), H && (y += 12)), y),
|
|
2602
|
+
[k, v, H]
|
|
2603
|
+
), Q = D(() => {
|
|
2604
|
+
$(null);
|
|
2367
2605
|
}, []);
|
|
2368
|
-
return /* @__PURE__ */
|
|
2606
|
+
return /* @__PURE__ */ R(
|
|
2369
2607
|
"div",
|
|
2370
2608
|
{
|
|
2371
|
-
className: `wx-7f497i wx-timepicker ${
|
|
2609
|
+
className: `wx-7f497i wx-timepicker ${u ? "wx-7f497i wx-error" : ""} ${r ? "wx-7f497i wx-disabled" : ""}`,
|
|
2372
2610
|
onClick: r ? void 0 : O,
|
|
2373
2611
|
style: { cursor: r ? "default" : "pointer" },
|
|
2374
2612
|
children: [
|
|
2375
2613
|
/* @__PURE__ */ l(
|
|
2376
|
-
|
|
2614
|
+
Ne,
|
|
2377
2615
|
{
|
|
2378
2616
|
id: n,
|
|
2379
|
-
css:
|
|
2617
|
+
css: s,
|
|
2380
2618
|
title: t,
|
|
2381
|
-
value:
|
|
2619
|
+
value: C,
|
|
2382
2620
|
readonly: !0,
|
|
2383
2621
|
disabled: r,
|
|
2384
|
-
error:
|
|
2622
|
+
error: u,
|
|
2385
2623
|
icon: "wxi-clock",
|
|
2386
2624
|
inputStyle: {
|
|
2387
2625
|
cursor: "pointer",
|
|
@@ -2390,16 +2628,16 @@ function Gt({
|
|
|
2390
2628
|
}
|
|
2391
2629
|
}
|
|
2392
2630
|
),
|
|
2393
|
-
M && !r && /* @__PURE__ */ l(
|
|
2394
|
-
/* @__PURE__ */
|
|
2631
|
+
M && !r && /* @__PURE__ */ l(le, { onCancel: Q, ...ye(a), children: /* @__PURE__ */ R("div", { className: "wx-7f497i wx-wrapper", children: [
|
|
2632
|
+
/* @__PURE__ */ R("div", { className: "wx-7f497i wx-timer", children: [
|
|
2395
2633
|
/* @__PURE__ */ l(
|
|
2396
2634
|
"input",
|
|
2397
2635
|
{
|
|
2398
2636
|
className: "wx-7f497i wx-digit",
|
|
2399
|
-
value:
|
|
2400
|
-
onChange: (
|
|
2401
|
-
const
|
|
2402
|
-
|
|
2637
|
+
value: L,
|
|
2638
|
+
onChange: (y) => {
|
|
2639
|
+
const E = G(y.target.value);
|
|
2640
|
+
Y({ value: E });
|
|
2403
2641
|
}
|
|
2404
2642
|
}
|
|
2405
2643
|
),
|
|
@@ -2408,39 +2646,41 @@ function Gt({
|
|
|
2408
2646
|
"input",
|
|
2409
2647
|
{
|
|
2410
2648
|
className: "wx-7f497i wx-digit",
|
|
2411
|
-
value:
|
|
2412
|
-
onChange: (
|
|
2413
|
-
const
|
|
2414
|
-
|
|
2649
|
+
value: P,
|
|
2650
|
+
onChange: (y) => {
|
|
2651
|
+
const E = k(y.target.value, w);
|
|
2652
|
+
I({ value: E });
|
|
2415
2653
|
}
|
|
2416
2654
|
}
|
|
2417
2655
|
),
|
|
2418
|
-
|
|
2419
|
-
|
|
2656
|
+
v && /* @__PURE__ */ l(
|
|
2657
|
+
Pt,
|
|
2420
2658
|
{
|
|
2421
|
-
value:
|
|
2422
|
-
onClick:
|
|
2659
|
+
value: H,
|
|
2660
|
+
onClick: U,
|
|
2423
2661
|
active: () => /* @__PURE__ */ l("span", { children: "pm" }),
|
|
2424
2662
|
children: /* @__PURE__ */ l("span", { children: "am" })
|
|
2425
2663
|
}
|
|
2426
2664
|
)
|
|
2427
2665
|
] }),
|
|
2428
|
-
/* @__PURE__ */ l(
|
|
2429
|
-
|
|
2666
|
+
/* @__PURE__ */ l(Se, { width: "unset", children: /* @__PURE__ */ l(
|
|
2667
|
+
Ce,
|
|
2430
2668
|
{
|
|
2431
|
-
label:
|
|
2432
|
-
value:
|
|
2433
|
-
|
|
2434
|
-
|
|
2669
|
+
label: d.hours,
|
|
2670
|
+
value: F,
|
|
2671
|
+
width: "unset",
|
|
2672
|
+
onChange: Y,
|
|
2673
|
+
max: x
|
|
2435
2674
|
}
|
|
2436
2675
|
) }),
|
|
2437
|
-
/* @__PURE__ */ l(
|
|
2438
|
-
|
|
2676
|
+
/* @__PURE__ */ l(Se, { width: "unset", children: /* @__PURE__ */ l(
|
|
2677
|
+
Ce,
|
|
2439
2678
|
{
|
|
2440
|
-
label:
|
|
2441
|
-
value:
|
|
2442
|
-
|
|
2443
|
-
|
|
2679
|
+
label: d.minutes,
|
|
2680
|
+
value: j,
|
|
2681
|
+
width: "unset",
|
|
2682
|
+
onChange: I,
|
|
2683
|
+
max: w
|
|
2444
2684
|
}
|
|
2445
2685
|
) })
|
|
2446
2686
|
] }) })
|
|
@@ -2448,49 +2688,84 @@ function Gt({
|
|
|
2448
2688
|
}
|
|
2449
2689
|
);
|
|
2450
2690
|
}
|
|
2451
|
-
function
|
|
2691
|
+
function xn({ children: e }) {
|
|
2452
2692
|
return /* @__PURE__ */ l("div", { className: "wx-KgpO9N wx-modal", children: /* @__PURE__ */ l("div", { className: "wx-KgpO9N wx-window", children: e }) });
|
|
2453
2693
|
}
|
|
2454
|
-
function
|
|
2455
|
-
const
|
|
2456
|
-
return
|
|
2457
|
-
}
|
|
2458
|
-
function Ut({ theme: e = "", target: n, children: t }) {
|
|
2459
|
-
const c = H(null), r = H(null), [i, o] = P(null);
|
|
2460
|
-
c.current || (c.current = document.createElement("div"));
|
|
2461
|
-
const s = Q(re);
|
|
2462
|
-
return B(() => {
|
|
2463
|
-
o(
|
|
2464
|
-
n || ht(r.current) || oe.getTopNode(r.current)
|
|
2465
|
-
);
|
|
2466
|
-
}, [r.current]), /* @__PURE__ */ $(J, { children: [
|
|
2467
|
-
/* @__PURE__ */ l("span", { ref: r, style: { display: "none" } }),
|
|
2468
|
-
r.current && i ? Ae(
|
|
2469
|
-
/* @__PURE__ */ l(
|
|
2470
|
-
"div",
|
|
2471
|
-
{
|
|
2472
|
-
className: `wx-3ZWsT0 wx-${e || s}-theme`,
|
|
2473
|
-
children: t
|
|
2474
|
-
}
|
|
2475
|
-
),
|
|
2476
|
-
i
|
|
2477
|
-
) : null
|
|
2478
|
-
] });
|
|
2694
|
+
function mn({ position: e = "right", children: n, onCancel: t }) {
|
|
2695
|
+
const s = S(null);
|
|
2696
|
+
return W(() => ve(s.current, t).destroy, []), /* @__PURE__ */ l("div", { ref: s, className: `wx-2L733M wx-sidearea wx-pos-${e}`, children: n });
|
|
2479
2697
|
}
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
return
|
|
2698
|
+
const Fe = "#dfe2e6", He = "#2c2f3c", At = 0.75;
|
|
2699
|
+
function Pe(e) {
|
|
2700
|
+
if (e = e?.trim() || "", !e) return "";
|
|
2701
|
+
const n = e.split(/\s+/);
|
|
2702
|
+
return (n[0][0] + (n[1]?.[0] || "")).toUpperCase().slice(0, 2);
|
|
2703
|
+
}
|
|
2704
|
+
function Bt(e) {
|
|
2705
|
+
let n = e.replace("#", "");
|
|
2706
|
+
if (n.length === 3 && (n = n[0] + n[0] + n[1] + n[1] + n[2] + n[2]), n.length !== 6) return He;
|
|
2707
|
+
const t = parseInt(n.slice(0, 2), 16) / 255, s = parseInt(n.slice(2, 4), 16) / 255, r = parseInt(n.slice(4, 6), 16) / 255;
|
|
2708
|
+
return 0.299 * t + 0.587 * s + 0.114 * r > 0.5 ? He : "#ffffff";
|
|
2709
|
+
}
|
|
2710
|
+
function hn(e) {
|
|
2711
|
+
const { value: n, size: t = 32, limit: s } = e, r = S(null), [u, i] = B(null), c = A(() => n ? Array.isArray(n) ? n : [n] : [], [n]), a = A(() => {
|
|
2712
|
+
if (u == null || u <= 0)
|
|
2713
|
+
return null;
|
|
2714
|
+
const w = 1 + (u / t - 1) / At;
|
|
2715
|
+
return Math.max(1, Math.floor(w));
|
|
2716
|
+
}, [u, t]), o = A(() => {
|
|
2717
|
+
const w = s != null ? Math.min(c.length, s) : c.length;
|
|
2718
|
+
return a != null ? Math.min(w, a) : w;
|
|
2719
|
+
}, [c, s, a]), f = A(() => c.slice(0, o), [c, o]), d = A(() => Math.max(0, c.length - o), [c, o]);
|
|
2720
|
+
W(() => {
|
|
2721
|
+
const w = r.current;
|
|
2722
|
+
if (!w) return;
|
|
2723
|
+
const h = new ResizeObserver((m) => {
|
|
2724
|
+
const g = m[0];
|
|
2725
|
+
g && i(g.contentRect.width);
|
|
2726
|
+
});
|
|
2727
|
+
return h.observe(w), () => h.disconnect();
|
|
2728
|
+
}, []);
|
|
2729
|
+
const p = Math.round(t * 0.4), v = {
|
|
2730
|
+
width: t + "px",
|
|
2731
|
+
height: t + "px",
|
|
2732
|
+
minWidth: t + "px",
|
|
2733
|
+
minHeight: t + "px",
|
|
2734
|
+
fontSize: p + "px"
|
|
2735
|
+
};
|
|
2736
|
+
function x(w, h) {
|
|
2737
|
+
const m = h === 0 ? "0" : `${t * -0.25}px`, g = w.avatar ? "transparent" : w.color || Fe, T = w.avatar ? "transparent" : Bt(w.color || Fe);
|
|
2738
|
+
return { marginLeft: m, backgroundColor: g, color: T };
|
|
2739
|
+
}
|
|
2740
|
+
return /* @__PURE__ */ l("div", { className: "wx-avatar-root wx-aadkRiRf", ref: r, children: f.length > 0 && /* @__PURE__ */ l("div", { className: "wx-avatar-stack wx-aadkRiRf", children: f.map((w, h) => /* @__PURE__ */ R(
|
|
2741
|
+
"div",
|
|
2742
|
+
{
|
|
2743
|
+
className: [
|
|
2744
|
+
"wx-avatar",
|
|
2745
|
+
"wx-avatar-item",
|
|
2746
|
+
h === f.length - 1 && d > 0 ? "wx-avatar-overflow" : "",
|
|
2747
|
+
"wx-aadkRiRf"
|
|
2748
|
+
].filter(Boolean).join(" "),
|
|
2749
|
+
style: { ...v, ...x(w, h) },
|
|
2750
|
+
children: [
|
|
2751
|
+
w.avatar ? /* @__PURE__ */ l("img", { src: w.avatar, alt: "", loading: "lazy" }) : Pe(w.name) ? /* @__PURE__ */ l("span", { className: "wx-aadkRiRf", children: Pe(w.name) }) : null,
|
|
2752
|
+
h === f.length - 1 && d > 0 && /* @__PURE__ */ R("span", { className: "wx-avatar-overflow-badge wx-aadkRiRf", children: [
|
|
2753
|
+
"+",
|
|
2754
|
+
d
|
|
2755
|
+
] })
|
|
2756
|
+
]
|
|
2757
|
+
},
|
|
2758
|
+
w.id
|
|
2759
|
+
)) }) });
|
|
2485
2760
|
}
|
|
2486
|
-
function
|
|
2487
|
-
return /* @__PURE__ */ l(
|
|
2761
|
+
function Et() {
|
|
2762
|
+
return /* @__PURE__ */ l(_, {});
|
|
2488
2763
|
}
|
|
2489
|
-
function
|
|
2764
|
+
function pn(e) {
|
|
2490
2765
|
const { fonts: n = !0, children: t } = e;
|
|
2491
|
-
return /* @__PURE__ */ l(
|
|
2766
|
+
return /* @__PURE__ */ l(ie.Provider, { value: "material", children: /* @__PURE__ */ R(_, { children: [
|
|
2492
2767
|
t && /* @__PURE__ */ l("div", { className: "wx-theme wx-material-theme", children: t }),
|
|
2493
|
-
n && /* @__PURE__ */
|
|
2768
|
+
n && /* @__PURE__ */ R(_, { children: [
|
|
2494
2769
|
/* @__PURE__ */ l(
|
|
2495
2770
|
"link",
|
|
2496
2771
|
{
|
|
@@ -2499,7 +2774,7 @@ function zt(e) {
|
|
|
2499
2774
|
crossOrigin: "true"
|
|
2500
2775
|
}
|
|
2501
2776
|
),
|
|
2502
|
-
/* @__PURE__ */ l(
|
|
2777
|
+
/* @__PURE__ */ l(Et, {}),
|
|
2503
2778
|
/* @__PURE__ */ l(
|
|
2504
2779
|
"link",
|
|
2505
2780
|
{
|
|
@@ -2510,14 +2785,14 @@ function zt(e) {
|
|
|
2510
2785
|
] })
|
|
2511
2786
|
] }) });
|
|
2512
2787
|
}
|
|
2513
|
-
function
|
|
2514
|
-
return /* @__PURE__ */ l(
|
|
2788
|
+
function Je() {
|
|
2789
|
+
return /* @__PURE__ */ l(_, {});
|
|
2515
2790
|
}
|
|
2516
|
-
function
|
|
2791
|
+
function vn(e) {
|
|
2517
2792
|
const { fonts: n = !0, children: t } = e;
|
|
2518
|
-
return /* @__PURE__ */ l(
|
|
2793
|
+
return /* @__PURE__ */ l(ie.Provider, { value: "willow", children: /* @__PURE__ */ R(_, { children: [
|
|
2519
2794
|
t && t && /* @__PURE__ */ l("div", { className: "wx-theme wx-willow-theme", children: t }),
|
|
2520
|
-
n && /* @__PURE__ */
|
|
2795
|
+
n && /* @__PURE__ */ R(_, { children: [
|
|
2521
2796
|
/* @__PURE__ */ l(
|
|
2522
2797
|
"link",
|
|
2523
2798
|
{
|
|
@@ -2526,7 +2801,7 @@ function Kt(e) {
|
|
|
2526
2801
|
crossOrigin: "true"
|
|
2527
2802
|
}
|
|
2528
2803
|
),
|
|
2529
|
-
/* @__PURE__ */ l(
|
|
2804
|
+
/* @__PURE__ */ l(Je, {}),
|
|
2530
2805
|
/* @__PURE__ */ l(
|
|
2531
2806
|
"link",
|
|
2532
2807
|
{
|
|
@@ -2537,11 +2812,11 @@ function Kt(e) {
|
|
|
2537
2812
|
] })
|
|
2538
2813
|
] }) });
|
|
2539
2814
|
}
|
|
2540
|
-
function
|
|
2815
|
+
function gn(e) {
|
|
2541
2816
|
const { fonts: n = !0, children: t } = e;
|
|
2542
|
-
return /* @__PURE__ */ l(
|
|
2817
|
+
return /* @__PURE__ */ l(ie.Provider, { value: "willow-dark", children: /* @__PURE__ */ R(_, { children: [
|
|
2543
2818
|
t && t && /* @__PURE__ */ l("div", { className: "wx-theme wx-willow-dark-theme", children: t }),
|
|
2544
|
-
n && /* @__PURE__ */
|
|
2819
|
+
n && /* @__PURE__ */ R(_, { children: [
|
|
2545
2820
|
/* @__PURE__ */ l(
|
|
2546
2821
|
"link",
|
|
2547
2822
|
{
|
|
@@ -2550,7 +2825,7 @@ function Zt(e) {
|
|
|
2550
2825
|
crossOrigin: "true"
|
|
2551
2826
|
}
|
|
2552
2827
|
),
|
|
2553
|
-
/* @__PURE__ */ l(
|
|
2828
|
+
/* @__PURE__ */ l(Je, {}),
|
|
2554
2829
|
/* @__PURE__ */ l(
|
|
2555
2830
|
"link",
|
|
2556
2831
|
{
|
|
@@ -2561,57 +2836,58 @@ function Zt(e) {
|
|
|
2561
2836
|
] })
|
|
2562
2837
|
] }) });
|
|
2563
2838
|
}
|
|
2564
|
-
function
|
|
2565
|
-
const n =
|
|
2839
|
+
function Nn(e) {
|
|
2840
|
+
const n = oe();
|
|
2566
2841
|
e.setAttribute("data-wx-portal-root", n);
|
|
2567
2842
|
}
|
|
2568
|
-
|
|
2843
|
+
et(pe);
|
|
2569
2844
|
export {
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2845
|
+
hn as Avatar,
|
|
2846
|
+
re as Button,
|
|
2847
|
+
Dt as Calendar,
|
|
2848
|
+
Ye as Checkbox,
|
|
2849
|
+
Qt as CheckboxGroup,
|
|
2850
|
+
ot as ColorBoard,
|
|
2851
|
+
Kt as ColorPicker,
|
|
2852
|
+
qt as ColorSelect,
|
|
2853
|
+
Zt as Combo,
|
|
2854
|
+
dn as Counter,
|
|
2855
|
+
zt as DatePicker,
|
|
2856
|
+
Xt as DateRangePicker,
|
|
2857
|
+
le as Dropdown,
|
|
2858
|
+
Se as Field,
|
|
2859
|
+
en as Fullscreen,
|
|
2860
|
+
fn as Globals,
|
|
2861
|
+
tn as Icon,
|
|
2862
|
+
he as Locale,
|
|
2863
|
+
pn as Material,
|
|
2864
|
+
Lt as Modal,
|
|
2865
|
+
xn as ModalArea,
|
|
2866
|
+
ft as Month,
|
|
2867
|
+
nn as MultiCombo,
|
|
2868
|
+
rn as Pager,
|
|
2869
|
+
lt as Popup,
|
|
2870
|
+
nt as Portal,
|
|
2871
|
+
It as RadioButton,
|
|
2872
|
+
ln as RadioButtonGroup,
|
|
2873
|
+
Rt as RangeCalendar,
|
|
2874
|
+
cn as RichSelect,
|
|
2875
|
+
sn as Segmented,
|
|
2876
|
+
an as Select,
|
|
2877
|
+
mn as SideArea,
|
|
2878
|
+
Ce as Slider,
|
|
2879
|
+
ge as SuggestDropdown,
|
|
2880
|
+
on as Switch,
|
|
2881
|
+
un as Tabs,
|
|
2882
|
+
Ne as Text,
|
|
2883
|
+
_t as TextArea,
|
|
2884
|
+
wn as TimePicker,
|
|
2885
|
+
Pt as TwoState,
|
|
2886
|
+
vn as Willow,
|
|
2887
|
+
gn as WillowDark,
|
|
2888
|
+
Ut as context,
|
|
2889
|
+
Vn as en,
|
|
2890
|
+
bn as locale,
|
|
2891
|
+
Nn as popupContainer
|
|
2616
2892
|
};
|
|
2617
2893
|
//# sourceMappingURL=index.es.js.map
|