@svar-ui/react-core 2.4.3 → 2.5.1

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