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