@svar-ui/react-core 2.4.3 → 2.5.0

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