@svar-ui/react-core 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +173 -176
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -4
- package/types/index.d.ts +159 -129
package/dist/index.es.js
CHANGED
|
@@ -194,17 +194,17 @@ function at({
|
|
|
194
194
|
J(() => {
|
|
195
195
|
g.current = a;
|
|
196
196
|
}, [a]);
|
|
197
|
-
function
|
|
198
|
-
return s && (l + "").indexOf("%") > -1 ? l.replace(/(\d+)%/, (y,
|
|
197
|
+
function $(b) {
|
|
198
|
+
return s && (l + "").indexOf("%") > -1 ? l.replace(/(\d+)%/, (y, H) => (H = H * s.offsetWidth / 100 + "px", l.replace(y, H))) : l && l !== "auto" ? l : b;
|
|
199
199
|
}
|
|
200
200
|
const k = V(() => {
|
|
201
201
|
if (!x.current) return;
|
|
202
202
|
const b = We(x.current, s, t, e, n);
|
|
203
|
-
b && (d(b.x), w(b.y), v(
|
|
203
|
+
b && (d(b.x), w(b.y), v($(b.width)));
|
|
204
204
|
}, [x, s, t, e, n, l]);
|
|
205
205
|
return pe(() => {
|
|
206
|
-
const b = (
|
|
207
|
-
g.current &&
|
|
206
|
+
const b = (H) => {
|
|
207
|
+
g.current && H.target !== m.current && x.current && !x.current.contains(H.target) && g.current(H);
|
|
208
208
|
};
|
|
209
209
|
let y;
|
|
210
210
|
return requestAnimationFrame(() => {
|
|
@@ -331,13 +331,13 @@ function en({
|
|
|
331
331
|
dropdown: p = {}
|
|
332
332
|
}) {
|
|
333
333
|
const w = te(s), [h, v] = O(n), [N, f] = O(!1), x = V(
|
|
334
|
-
(
|
|
335
|
-
|
|
334
|
+
($, k) => {
|
|
335
|
+
$.stopPropagation(), v(k), f(!1), t && t({ value: k });
|
|
336
336
|
},
|
|
337
337
|
[t]
|
|
338
338
|
), m = V(
|
|
339
|
-
(
|
|
340
|
-
|
|
339
|
+
($) => {
|
|
340
|
+
$.stopPropagation(), v(""), t && t({ value: "" });
|
|
341
341
|
},
|
|
342
342
|
[t]
|
|
343
343
|
), g = V(() => {
|
|
@@ -376,15 +376,15 @@ function en({
|
|
|
376
376
|
"div",
|
|
377
377
|
{
|
|
378
378
|
className: "wx-121TgJ wx-empty",
|
|
379
|
-
onClick: (
|
|
379
|
+
onClick: ($) => x($, "")
|
|
380
380
|
}
|
|
381
381
|
),
|
|
382
|
-
e.map((
|
|
382
|
+
e.map(($, k) => /* @__PURE__ */ r(
|
|
383
383
|
"div",
|
|
384
384
|
{
|
|
385
385
|
className: "wx-121TgJ wx-color",
|
|
386
|
-
style: { backgroundColor:
|
|
387
|
-
onClick: (b) => x(b,
|
|
386
|
+
style: { backgroundColor: $ },
|
|
387
|
+
onClick: (b) => x(b, $)
|
|
388
388
|
},
|
|
389
389
|
k
|
|
390
390
|
))
|
|
@@ -404,7 +404,7 @@ function $e(e, n) {
|
|
|
404
404
|
u = h.left, d = h.top, p = c.clientX - u, w = c.clientY - d, s && n.moveBlockSlider(p, w), l && n.moveLineSlider(p);
|
|
405
405
|
}
|
|
406
406
|
function o() {
|
|
407
|
-
|
|
407
|
+
window.removeEventListener("mousemove", a), window.removeEventListener("mouseup", o);
|
|
408
408
|
}
|
|
409
409
|
return e.addEventListener("mousedown", i), {
|
|
410
410
|
destroy() {
|
|
@@ -493,7 +493,7 @@ const ce = {
|
|
|
493
493
|
}
|
|
494
494
|
}, dt = (e) => /^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e);
|
|
495
495
|
function Te(e) {
|
|
496
|
-
return e ? (e = e.toString(
|
|
496
|
+
return e ? (e = e.toString(), e.charAt(0) === "#" && (e = e.slice(1)), dt(e) ? (e.length === 3 && (e = e.slice(0, 3).split("").reduce((n, t) => n + t + t, "")), `#${e.toUpperCase()}`) : null) : null;
|
|
497
497
|
}
|
|
498
498
|
function ne() {
|
|
499
499
|
return je(_e);
|
|
@@ -505,7 +505,7 @@ function ft({
|
|
|
505
505
|
css: t = "",
|
|
506
506
|
onChange: s
|
|
507
507
|
}) {
|
|
508
|
-
const l = (X(K) || ne()).getGroup("core"), i = S(null), a = S(null), [o, c] = O(), [u, d] = O(), [p, w] = O(), [h, v] = O(), [N, f] = U(e), [x, m] = O(e), g = S(null),
|
|
508
|
+
const l = (X(K) || ne()).getGroup("core"), i = S(null), a = S(null), [o, c] = O(), [u, d] = O(), [p, w] = O(), [h, v] = O(), [N, f] = U(e), [x, m] = O(e), g = S(null), $ = S(null), k = E(() => Te(N) || "#65D3B3", [N]), b = E(
|
|
509
509
|
() => ce.hvsToHex(p || 0, 1, 1),
|
|
510
510
|
[p]
|
|
511
511
|
), y = V(
|
|
@@ -513,8 +513,8 @@ function ft({
|
|
|
513
513
|
const { width: _, height: Z } = i.current.getBoundingClientRect();
|
|
514
514
|
B < 0 ? B = 0 : B > Z && (B = Z), L < 0 ? L = 0 : L > _ && (L = _), c(B), d(L);
|
|
515
515
|
let F, j;
|
|
516
|
-
const I = _ / 100,
|
|
517
|
-
F = Math.ceil(L / I) / 100, j = Math.ceil(Math.abs(B /
|
|
516
|
+
const I = _ / 100, T = Z / 100;
|
|
517
|
+
F = Math.ceil(L / I) / 100, j = Math.ceil(Math.abs(B / T - 100)) / 100;
|
|
518
518
|
const M = ce.hvsToHex(
|
|
519
519
|
p,
|
|
520
520
|
F,
|
|
@@ -523,7 +523,7 @@ function ft({
|
|
|
523
523
|
f(M), m(M), s && s({ value: M, input: !0 });
|
|
524
524
|
},
|
|
525
525
|
[k, p, s]
|
|
526
|
-
),
|
|
526
|
+
), H = V(
|
|
527
527
|
(L) => {
|
|
528
528
|
const B = a.current.getBoundingClientRect().width;
|
|
529
529
|
L < 0 ? L = 0 : L > B && (L = B);
|
|
@@ -536,7 +536,7 @@ function ft({
|
|
|
536
536
|
},
|
|
537
537
|
[k, s]
|
|
538
538
|
);
|
|
539
|
-
g.current = y,
|
|
539
|
+
g.current = y, $.current = H;
|
|
540
540
|
const P = V((L) => {
|
|
541
541
|
const [B, _, Z] = ce.hexToHvs(L || k);
|
|
542
542
|
if (w(B), i.current) {
|
|
@@ -560,9 +560,9 @@ function ft({
|
|
|
560
560
|
(L) => {
|
|
561
561
|
const B = L.target, _ = B.getAttribute("data-slider") === Ve, Z = B.getAttribute("data-slider") === Re;
|
|
562
562
|
let F = window.getComputedStyle(B), j = parseFloat(F.left), I = parseFloat(F.top);
|
|
563
|
-
const
|
|
563
|
+
const T = L.code;
|
|
564
564
|
if (_) {
|
|
565
|
-
switch (
|
|
565
|
+
switch (T) {
|
|
566
566
|
case "ArrowLeft": {
|
|
567
567
|
j--;
|
|
568
568
|
break;
|
|
@@ -585,14 +585,14 @@ function ft({
|
|
|
585
585
|
y(j, I);
|
|
586
586
|
}
|
|
587
587
|
if (Z) {
|
|
588
|
-
if (
|
|
589
|
-
else if (
|
|
588
|
+
if (T === "ArrowLeft" || T === "ArrowDown") j--;
|
|
589
|
+
else if (T === "ArrowRight" || T === "ArrowUp") j++;
|
|
590
590
|
else return;
|
|
591
|
-
|
|
591
|
+
H(j);
|
|
592
592
|
}
|
|
593
593
|
L.preventDefault();
|
|
594
594
|
},
|
|
595
|
-
[y,
|
|
595
|
+
[y, H]
|
|
596
596
|
);
|
|
597
597
|
J(() => {
|
|
598
598
|
const L = [];
|
|
@@ -605,7 +605,7 @@ function ft({
|
|
|
605
605
|
), a.current && L.push(
|
|
606
606
|
$e(a.current, {
|
|
607
607
|
moveLineSlider: (B) => {
|
|
608
|
-
|
|
608
|
+
$.current?.(B);
|
|
609
609
|
}
|
|
610
610
|
}).destroy
|
|
611
611
|
), requestAnimationFrame(() => P()), () => {
|
|
@@ -690,8 +690,8 @@ function tn({
|
|
|
690
690
|
function x(g) {
|
|
691
691
|
if (g.input) return;
|
|
692
692
|
N(!1);
|
|
693
|
-
const
|
|
694
|
-
h(
|
|
693
|
+
const $ = g.value;
|
|
694
|
+
h($), u && u({ value: $ });
|
|
695
695
|
}
|
|
696
696
|
function m(g) {
|
|
697
697
|
g.stopPropagation(), h(""), u && u({ value: "" });
|
|
@@ -768,9 +768,8 @@ const Me = 10, xt = Xe(function({ data: n, checkboxes: t, itemTemplate: s, value
|
|
|
768
768
|
t && /* @__PURE__ */ r(
|
|
769
769
|
Ze,
|
|
770
770
|
{
|
|
771
|
-
id: n.id,
|
|
772
771
|
css: "wx-list-checkbox",
|
|
773
|
-
value: l && l.includes(n.id)
|
|
772
|
+
value: !!l && l.includes(n.id)
|
|
774
773
|
}
|
|
775
774
|
),
|
|
776
775
|
s ? oe(s, { option: n }) : n.label
|
|
@@ -818,7 +817,7 @@ function ke({
|
|
|
818
817
|
value: o,
|
|
819
818
|
...c
|
|
820
819
|
}) {
|
|
821
|
-
const u = S(), d = S(!1), p = S(wt()), [w, h] = O(null), v = S(w), [N, f] = O(0), [x, m] = O(24), g = S(!1),
|
|
820
|
+
const u = S(), d = S(!1), p = S(wt()), [w, h] = O(null), v = S(w), [N, f] = O(0), [x, m] = O(24), g = S(!1), $ = (X(K) || ne()).getGroup("core"), k = S(e);
|
|
822
821
|
J(() => {
|
|
823
822
|
k.current = e;
|
|
824
823
|
}, [e]);
|
|
@@ -830,16 +829,16 @@ function ke({
|
|
|
830
829
|
J(() => {
|
|
831
830
|
y.current = x;
|
|
832
831
|
}, [x]);
|
|
833
|
-
const
|
|
832
|
+
const H = V((M) => {
|
|
834
833
|
M && M.stopPropagation();
|
|
835
|
-
const D = k.current,
|
|
834
|
+
const D = k.current, A = b.current, ee = v.current;
|
|
836
835
|
let z;
|
|
837
836
|
const q = D[ee]?.id;
|
|
838
|
-
a ?
|
|
839
|
-
}, [a, t]), P = S(
|
|
837
|
+
a ? A && A.includes(q) ? z = A.filter((we) => we !== q) : z = [...A || [], q] : z = q, t && t({ id: z });
|
|
838
|
+
}, [a, t]), P = S(H);
|
|
840
839
|
J(() => {
|
|
841
|
-
P.current =
|
|
842
|
-
}, [
|
|
840
|
+
P.current = H;
|
|
841
|
+
}, [H]);
|
|
843
842
|
const R = V((M) => {
|
|
844
843
|
if (u.current) {
|
|
845
844
|
let D = M * y.current - u.current.clientHeight + y.current;
|
|
@@ -868,11 +867,11 @@ function ke({
|
|
|
868
867
|
l
|
|
869
868
|
);
|
|
870
869
|
}, [e, u.current, l]), J(() => {
|
|
871
|
-
const M = (
|
|
872
|
-
p.current.navigate(
|
|
873
|
-
}, D = (
|
|
870
|
+
const M = (A, ee) => {
|
|
871
|
+
p.current.navigate(A, ee), R(v.current);
|
|
872
|
+
}, D = (A, ee) => {
|
|
874
873
|
const z = v.current, q = k.current;
|
|
875
|
-
if (z !== 0 && z !== q.length - 1 && (
|
|
874
|
+
if (z !== 0 && z !== q.length - 1 && (A.key === "ArrowDown" || A.key === "ArrowUp") && A.preventDefault(), p.current.keydown(A, ee), u.current) {
|
|
876
875
|
const we = u.current.scrollTop <= v.current * y.current, Ke = u.current.scrollTop + u.current.clientHeight >= v.current * y.current + y.current;
|
|
877
876
|
we ? Ke || R(v.current) : (u.current.scrollTop = v.current * y.current, f(u.current.scrollTop));
|
|
878
877
|
}
|
|
@@ -903,10 +902,10 @@ function ke({
|
|
|
903
902
|
}, [l, e, N, x, Z]), j = E(() => {
|
|
904
903
|
if (!l) return e;
|
|
905
904
|
const { start: M, end: D } = F;
|
|
906
|
-
return e.slice(M, D).map((
|
|
907
|
-
...
|
|
905
|
+
return e.slice(M, D).map((A) => ({
|
|
906
|
+
...A
|
|
908
907
|
}));
|
|
909
|
-
}, [l, e, F]), I = F.start * x,
|
|
908
|
+
}, [l, e, F]), I = F.start * x, T = e.length * x;
|
|
910
909
|
return J(() => {
|
|
911
910
|
l && f(0);
|
|
912
911
|
}, [e, l]), J(() => {
|
|
@@ -916,14 +915,14 @@ function ke({
|
|
|
916
915
|
{
|
|
917
916
|
className: "wx-233fr7 wx-list",
|
|
918
917
|
ref: Y,
|
|
919
|
-
onClick:
|
|
918
|
+
onClick: H,
|
|
920
919
|
onMouseMove: p.current.move,
|
|
921
920
|
onScroll: _,
|
|
922
921
|
children: e.length ? l ? /* @__PURE__ */ r(
|
|
923
922
|
"div",
|
|
924
923
|
{
|
|
925
924
|
className: "wx-233fr7 wx-list-wrapper",
|
|
926
|
-
style: { height: `${
|
|
925
|
+
style: { height: `${T}px` },
|
|
927
926
|
children: /* @__PURE__ */ r(
|
|
928
927
|
"div",
|
|
929
928
|
{
|
|
@@ -955,7 +954,7 @@ function ke({
|
|
|
955
954
|
itemTemplate: n,
|
|
956
955
|
value: o
|
|
957
956
|
}
|
|
958
|
-
) : /* @__PURE__ */ r("div", { className: "wx-233fr7 wx-no-data", children:
|
|
957
|
+
) : /* @__PURE__ */ r("div", { className: "wx-233fr7 wx-no-data", children: $("No data") })
|
|
959
958
|
}
|
|
960
959
|
) }, W.current);
|
|
961
960
|
}
|
|
@@ -976,59 +975,59 @@ function nn({
|
|
|
976
975
|
onChange: h,
|
|
977
976
|
dropdown: v = {}
|
|
978
977
|
}) {
|
|
979
|
-
const N = te(n), f = S(null), x = S(null), [m, g] = U(e), [
|
|
980
|
-
if (
|
|
978
|
+
const N = te(n), f = S(null), x = S(null), [m, g] = U(e), [$, k] = O(!1), [b, y] = O(""), H = S(null), P = S(!1), R = E(() => {
|
|
979
|
+
if ($) return b;
|
|
981
980
|
if (m || m === 0) {
|
|
982
|
-
const
|
|
983
|
-
if (
|
|
981
|
+
const T = (s || t).find((M) => M.id === m);
|
|
982
|
+
if (T) return T[l];
|
|
984
983
|
}
|
|
985
984
|
return "";
|
|
986
|
-
}, [
|
|
987
|
-
(
|
|
988
|
-
), [R,
|
|
989
|
-
() => Y.findIndex((
|
|
985
|
+
}, [$, b, m, s, t, l]), Y = E(() => !R || !$ ? t : t.filter(
|
|
986
|
+
(T) => T[l].toLowerCase().includes(R.toLowerCase())
|
|
987
|
+
), [R, $, t, l]), G = V(
|
|
988
|
+
() => Y.findIndex((T) => T.id === m),
|
|
990
989
|
[Y, m]
|
|
991
|
-
), W = V((
|
|
992
|
-
f.current =
|
|
990
|
+
), W = V((T) => {
|
|
991
|
+
f.current = T.navigate, x.current = T.keydown;
|
|
993
992
|
}, []), L = V(
|
|
994
|
-
(
|
|
995
|
-
if (
|
|
996
|
-
let D = t.find((
|
|
993
|
+
(T, M) => {
|
|
994
|
+
if (T || T === 0) {
|
|
995
|
+
let D = t.find((A) => A.id === T);
|
|
997
996
|
if (k(!1), M && f.current(null), D && m !== D.id) {
|
|
998
|
-
const
|
|
999
|
-
g(
|
|
997
|
+
const A = D.id;
|
|
998
|
+
g(A), h && h({ value: A });
|
|
1000
999
|
}
|
|
1001
1000
|
}
|
|
1002
|
-
!P.current && M &&
|
|
1001
|
+
!P.current && M && H.current.focus();
|
|
1003
1002
|
},
|
|
1004
1003
|
[t, m, h]
|
|
1005
1004
|
), B = V(
|
|
1006
|
-
({ id:
|
|
1007
|
-
L(
|
|
1005
|
+
({ id: T }) => {
|
|
1006
|
+
L(T, !0);
|
|
1008
1007
|
},
|
|
1009
1008
|
[L]
|
|
1010
1009
|
), _ = V(
|
|
1011
|
-
(
|
|
1012
|
-
|
|
1010
|
+
(T) => {
|
|
1011
|
+
T && T.stopPropagation(), g(""), k(!1), h && h({ value: "" });
|
|
1013
1012
|
},
|
|
1014
1013
|
[h]
|
|
1015
1014
|
), Z = V(
|
|
1016
|
-
(
|
|
1015
|
+
(T) => {
|
|
1017
1016
|
if (!t.length) return;
|
|
1018
|
-
if (
|
|
1017
|
+
if (T === "" && d) {
|
|
1019
1018
|
_();
|
|
1020
1019
|
return;
|
|
1021
1020
|
}
|
|
1022
|
-
let M = t.find((
|
|
1021
|
+
let M = t.find((A) => A[l] === T);
|
|
1023
1022
|
M || (M = t.find(
|
|
1024
|
-
(
|
|
1023
|
+
(A) => A[l].toLowerCase().includes(T.toLowerCase())
|
|
1025
1024
|
));
|
|
1026
1025
|
const D = M ? M.id : m || t[0].id;
|
|
1027
1026
|
L(D, !1);
|
|
1028
1027
|
},
|
|
1029
1028
|
[t, l, d, m, L, _]
|
|
1030
1029
|
), F = V(() => {
|
|
1031
|
-
y(
|
|
1030
|
+
y(H.current.value), k(!0), Y.length && f.current(0);
|
|
1032
1031
|
}, [Y.length, f]), j = V(() => {
|
|
1033
1032
|
P.current = !0;
|
|
1034
1033
|
}, []), I = V(() => {
|
|
@@ -1041,7 +1040,7 @@ function nn({
|
|
|
1041
1040
|
{
|
|
1042
1041
|
className: "wx-1j11Jk wx-combo " + p,
|
|
1043
1042
|
onClick: () => f.current(G()),
|
|
1044
|
-
onKeyDown: (
|
|
1043
|
+
onKeyDown: (T) => x.current(T, G()),
|
|
1045
1044
|
title: a,
|
|
1046
1045
|
"data-tooltip-text": o,
|
|
1047
1046
|
children: [
|
|
@@ -1050,7 +1049,7 @@ function nn({
|
|
|
1050
1049
|
{
|
|
1051
1050
|
className: "wx-1j11Jk wx-input " + (u ? "wx-error" : ""),
|
|
1052
1051
|
id: N,
|
|
1053
|
-
ref:
|
|
1052
|
+
ref: H,
|
|
1054
1053
|
value: R,
|
|
1055
1054
|
disabled: c,
|
|
1056
1055
|
placeholder: i,
|
|
@@ -1060,7 +1059,7 @@ function nn({
|
|
|
1060
1059
|
}
|
|
1061
1060
|
),
|
|
1062
1061
|
d && !c && m ? /* @__PURE__ */ r("i", { className: "wx-1j11Jk wx-icon wxi-close", onClick: _ }) : /* @__PURE__ */ r("i", { className: "wx-1j11Jk wx-icon wxi-angle-down" }),
|
|
1063
|
-
!c && /* @__PURE__ */ r(ke, { items: Y, onReady: W, onSelect: B, ...v, children: ({ option:
|
|
1062
|
+
!c && /* @__PURE__ */ r(ke, { items: Y, onReady: W, onSelect: B, ...v, children: ({ option: T }) => /* @__PURE__ */ r(Q, { children: w ? w({ option: T }) : T[l] }) })
|
|
1064
1063
|
]
|
|
1065
1064
|
}
|
|
1066
1065
|
);
|
|
@@ -1085,7 +1084,7 @@ function ye({
|
|
|
1085
1084
|
const N = te(n), [f, x] = U(e), m = S(null), g = E(
|
|
1086
1085
|
() => w && p.indexOf("wx-icon-left") === -1 ? "wx-icon-right " + p : p,
|
|
1087
1086
|
[w, p]
|
|
1088
|
-
),
|
|
1087
|
+
), $ = E(
|
|
1089
1088
|
() => w && p.indexOf("wx-icon-left") !== -1,
|
|
1090
1089
|
[w, p]
|
|
1091
1090
|
);
|
|
@@ -1108,8 +1107,8 @@ function ye({
|
|
|
1108
1107
|
function y(P) {
|
|
1109
1108
|
P.stopPropagation(), x(""), v && v({ value: "" });
|
|
1110
1109
|
}
|
|
1111
|
-
let
|
|
1112
|
-
return i !== "password" && i !== "number" && (
|
|
1110
|
+
let H = i;
|
|
1111
|
+
return i !== "password" && i !== "number" && (H = "text"), J(() => {
|
|
1113
1112
|
const P = b, R = m.current;
|
|
1114
1113
|
return R.addEventListener("change", P), () => {
|
|
1115
1114
|
R && R.removeEventListener("change", P);
|
|
@@ -1129,7 +1128,7 @@ function ye({
|
|
|
1129
1128
|
readOnly: t,
|
|
1130
1129
|
disabled: o,
|
|
1131
1130
|
placeholder: a,
|
|
1132
|
-
type:
|
|
1131
|
+
type: H,
|
|
1133
1132
|
title: u,
|
|
1134
1133
|
value: f,
|
|
1135
1134
|
onInput: k
|
|
@@ -1137,7 +1136,7 @@ function ye({
|
|
|
1137
1136
|
),
|
|
1138
1137
|
h && !o && f ? /* @__PURE__ */ C(Q, { children: [
|
|
1139
1138
|
/* @__PURE__ */ r("i", { className: "wx-hQ64J4 wx-icon wxi-close", onClick: y }),
|
|
1140
|
-
|
|
1139
|
+
$ && /* @__PURE__ */ r("i", { className: `wx-hQ64J4 wx-icon ${w}` })
|
|
1141
1140
|
] }) : w ? /* @__PURE__ */ r("i", { className: `wx-hQ64J4 wx-icon ${w}` }) : null
|
|
1142
1141
|
]
|
|
1143
1142
|
}
|
|
@@ -1218,7 +1217,7 @@ function ht({
|
|
|
1218
1217
|
e.end ? d(e.end).valueOf() : 0
|
|
1219
1218
|
] : [0, 0], [t, e]), m = E(() => {
|
|
1220
1219
|
const k = h(), b = v(), y = n.getMonth();
|
|
1221
|
-
let
|
|
1220
|
+
let H = [];
|
|
1222
1221
|
for (let P = k; P <= b; P.setDate(P.getDate() + 1)) {
|
|
1223
1222
|
const R = {
|
|
1224
1223
|
day: P.getDate(),
|
|
@@ -1234,13 +1233,13 @@ function ht({
|
|
|
1234
1233
|
const G = s(P);
|
|
1235
1234
|
G && (Y += " " + G);
|
|
1236
1235
|
}
|
|
1237
|
-
|
|
1236
|
+
H.push({ ...R, css: Y });
|
|
1238
1237
|
}
|
|
1239
|
-
return
|
|
1238
|
+
return H;
|
|
1240
1239
|
}, [n, x, p, s]), g = S(null);
|
|
1241
|
-
let
|
|
1242
|
-
return
|
|
1243
|
-
Ge(g.current,
|
|
1240
|
+
let $ = S({});
|
|
1241
|
+
return $.current.click = f, J(() => {
|
|
1242
|
+
Ge(g.current, $.current);
|
|
1244
1243
|
}, []), /* @__PURE__ */ C("div", { className: `wx-398RBS wx-month ${l}`, children: [
|
|
1245
1244
|
/* @__PURE__ */ r("div", { className: "wx-398RBS wx-weekdays", children: u.map((k) => /* @__PURE__ */ r("div", { className: "wx-398RBS wx-weekday", children: k }, k)) }),
|
|
1246
1245
|
/* @__PURE__ */ r("div", { className: "wx-398RBS wx-days", ref: g, children: m.map((k) => /* @__PURE__ */ r(
|
|
@@ -1301,8 +1300,8 @@ function pt({
|
|
|
1301
1300
|
const xe = "wx-1XEF33", vt = ({ value: e, current: n, onCancel: t, onChange: s, onShift: l, part: i }) => {
|
|
1302
1301
|
const a = X(K).getRaw().calendar, [o, c] = U(n), [u, d] = U(e), p = E(() => o.getFullYear(), [o]), w = E(() => {
|
|
1303
1302
|
const { start: x, end: m } = Je(p), g = [];
|
|
1304
|
-
for (let
|
|
1305
|
-
g.push(
|
|
1303
|
+
for (let $ = x; $ <= m; ++$)
|
|
1304
|
+
g.push($);
|
|
1306
1305
|
return g;
|
|
1307
1306
|
}, [p]), h = {
|
|
1308
1307
|
click: v
|
|
@@ -1400,7 +1399,7 @@ function de({
|
|
|
1400
1399
|
}, v = () => {
|
|
1401
1400
|
d === "duodecade" ? p("year") : d === "year" && p("month");
|
|
1402
1401
|
}, N = (m) => {
|
|
1403
|
-
const { diff: g, current:
|
|
1402
|
+
const { diff: g, current: $ } = m;
|
|
1404
1403
|
if (g === 0) {
|
|
1405
1404
|
d === "month" ? p("year") : d === "year" && p("duodecade");
|
|
1406
1405
|
return;
|
|
@@ -1408,7 +1407,7 @@ function de({
|
|
|
1408
1407
|
if (g) {
|
|
1409
1408
|
const k = Ce[d];
|
|
1410
1409
|
t(g > 0 ? k.next(n) : k.prev(n));
|
|
1411
|
-
} else
|
|
1410
|
+
} else $ && t($);
|
|
1412
1411
|
o && o();
|
|
1413
1412
|
}, f = (m) => {
|
|
1414
1413
|
p("month"), c && c({ select: !0, value: m });
|
|
@@ -1522,7 +1521,7 @@ function rn({
|
|
|
1522
1521
|
}) {
|
|
1523
1522
|
const { calendar: v, formats: N } = (X(K) || ne()).getRaw(), f = i || N?.dateFormat;
|
|
1524
1523
|
let x = typeof f == "function" ? f : re(f, v);
|
|
1525
|
-
const [m, g] = O(e), [
|
|
1524
|
+
const [m, g] = O(e), [$, k] = O(!1);
|
|
1526
1525
|
J(() => {
|
|
1527
1526
|
g(e);
|
|
1528
1527
|
}, [e]);
|
|
@@ -1533,7 +1532,7 @@ function rn({
|
|
|
1533
1532
|
const Y = R === m || R && m && R.valueOf() === m.valueOf() || !R && !m;
|
|
1534
1533
|
g(R), Y || w && w({ value: R }), setTimeout(b, 1);
|
|
1535
1534
|
}
|
|
1536
|
-
const
|
|
1535
|
+
const H = E(
|
|
1537
1536
|
() => m ? x(m) : "",
|
|
1538
1537
|
[m, x]
|
|
1539
1538
|
);
|
|
@@ -1552,19 +1551,18 @@ function rn({
|
|
|
1552
1551
|
css: `wx-date-input ${o}`,
|
|
1553
1552
|
title: c,
|
|
1554
1553
|
tooltip: u,
|
|
1555
|
-
value:
|
|
1554
|
+
value: H,
|
|
1556
1555
|
id: n,
|
|
1557
1556
|
readonly: !d,
|
|
1558
1557
|
disabled: t,
|
|
1559
1558
|
error: s,
|
|
1560
1559
|
placeholder: l,
|
|
1561
|
-
onInput: b,
|
|
1562
1560
|
onChange: P,
|
|
1563
1561
|
icon: "wxi-calendar",
|
|
1564
1562
|
clear: p
|
|
1565
1563
|
}
|
|
1566
1564
|
),
|
|
1567
|
-
|
|
1565
|
+
$ && !t && /* @__PURE__ */ r(
|
|
1568
1566
|
se,
|
|
1569
1567
|
{
|
|
1570
1568
|
onCancel: b,
|
|
@@ -1616,9 +1614,9 @@ const It = ["clear", "today"], me = (e, n, t) => {
|
|
|
1616
1614
|
const m = V(
|
|
1617
1615
|
(k) => {
|
|
1618
1616
|
const b = k.value;
|
|
1619
|
-
let y = c,
|
|
1617
|
+
let y = c, H = d;
|
|
1620
1618
|
const P = b === -1;
|
|
1621
|
-
return P || (k.select ? !c || d ? (u(y = b), p(
|
|
1619
|
+
return P || (k.select ? !c || d ? (u(y = b), p(H = null)) : c > b ? (p(H = c), u(y = b)) : p(H = b) : b ? (u(y = new Date(b)), p(H = new Date(b))) : (u(y = null), p(H = null))), (P || !Array.isArray(i) || !i.includes("done")) && o && o({ start: y, end: H }), [y, H];
|
|
1622
1620
|
},
|
|
1623
1621
|
[c, d, i, o]
|
|
1624
1622
|
), g = V(
|
|
@@ -1627,7 +1625,7 @@ const It = ["clear", "today"], me = (e, n, t) => {
|
|
|
1627
1625
|
b && f(new Date(b));
|
|
1628
1626
|
},
|
|
1629
1627
|
[f, c, d]
|
|
1630
|
-
),
|
|
1628
|
+
), $ = V(
|
|
1631
1629
|
(k) => {
|
|
1632
1630
|
const [, b] = m(k);
|
|
1633
1631
|
b && x(new Date(b));
|
|
@@ -1667,7 +1665,7 @@ const It = ["clear", "today"], me = (e, n, t) => {
|
|
|
1667
1665
|
markers: l,
|
|
1668
1666
|
buttons: i,
|
|
1669
1667
|
part: "right",
|
|
1670
|
-
onChange:
|
|
1668
|
+
onChange: $,
|
|
1671
1669
|
onCurrentChange: x
|
|
1672
1670
|
}
|
|
1673
1671
|
) })
|
|
@@ -1689,9 +1687,9 @@ const It = ["clear", "today"], me = (e, n, t) => {
|
|
|
1689
1687
|
clear: h = !1,
|
|
1690
1688
|
dropdown: v
|
|
1691
1689
|
}) => {
|
|
1692
|
-
const [N, f] = U(e), { calendar: x, formats: m } = (X(K) || ne()).getRaw(), g = u || m?.dateFormat,
|
|
1690
|
+
const [N, f] = U(e), { calendar: x, formats: m } = (X(K) || ne()).getRaw(), g = u || m?.dateFormat, $ = typeof g == "function" ? g : re(g, x), [k, b] = O(!1), y = V(() => {
|
|
1693
1691
|
b(!1);
|
|
1694
|
-
}, []),
|
|
1692
|
+
}, []), H = E(() => N ? N.start ? $(N.start) + (N.end ? ` - ${$(N.end)}` : "") : $(N) : "", [N, $]), P = E(() => N && N.start || null, [N]), R = E(() => N && N.end || null, [N]), Y = V(
|
|
1695
1693
|
(W) => {
|
|
1696
1694
|
const L = W.start || W.end ? { start: W.start, end: W.end } : null;
|
|
1697
1695
|
f && f(L), (W.start && W.end || !W.start && !W.end) && (n && n({ value: L }), setTimeout(y, 1));
|
|
@@ -1704,8 +1702,8 @@ const It = ["clear", "today"], me = (e, n, t) => {
|
|
|
1704
1702
|
if (B) return;
|
|
1705
1703
|
const [_, Z] = L.split(" -").map((F, j) => {
|
|
1706
1704
|
const I = F.trim();
|
|
1707
|
-
let
|
|
1708
|
-
return isNaN(
|
|
1705
|
+
let T = typeof w == "function" ? w(I) : I ? new Date(I) : null, M = j === 0 ? P : R;
|
|
1706
|
+
return isNaN(T) ? M || null : T || null;
|
|
1709
1707
|
});
|
|
1710
1708
|
Y({ start: _, end: Z });
|
|
1711
1709
|
},
|
|
@@ -1730,7 +1728,7 @@ const It = ["clear", "today"], me = (e, n, t) => {
|
|
|
1730
1728
|
css: `wx-date-input ${a}`,
|
|
1731
1729
|
title: o,
|
|
1732
1730
|
tooltip: c,
|
|
1733
|
-
value:
|
|
1731
|
+
value: H,
|
|
1734
1732
|
id: t,
|
|
1735
1733
|
readonly: !w,
|
|
1736
1734
|
disabled: s,
|
|
@@ -1749,7 +1747,6 @@ const It = ["clear", "today"], me = (e, n, t) => {
|
|
|
1749
1747
|
children: /* @__PURE__ */ r(
|
|
1750
1748
|
Ct,
|
|
1751
1749
|
{
|
|
1752
|
-
onCancel: y,
|
|
1753
1750
|
buttons: p,
|
|
1754
1751
|
start: P,
|
|
1755
1752
|
end: R,
|
|
@@ -1827,7 +1824,7 @@ function on({
|
|
|
1827
1824
|
children: v,
|
|
1828
1825
|
dropdown: N = {}
|
|
1829
1826
|
}) {
|
|
1830
|
-
const f = te(e), x = S(null), m = S(null), [g,
|
|
1827
|
+
const f = te(e), x = S(null), m = S(null), [g, $] = U(n), [k, b] = O(""), [y, H] = O(!1), P = S(null), R = E(() => g ? (s || t).filter((F) => g.includes(F.id)) : [], [g, s, t]), Y = E(() => {
|
|
1831
1828
|
const F = t;
|
|
1832
1829
|
return k ? F.filter((j) => j[l].toLowerCase().includes(k.toLowerCase())) : F;
|
|
1833
1830
|
}, [k, t, l]), G = V((F) => {
|
|
@@ -1837,14 +1834,14 @@ function on({
|
|
|
1837
1834
|
}, [Y]), L = V(
|
|
1838
1835
|
(F) => {
|
|
1839
1836
|
const { id: j } = F;
|
|
1840
|
-
j && (
|
|
1837
|
+
j && ($(j), i || b(""), h && h({ value: j }), P.current.focus());
|
|
1841
1838
|
},
|
|
1842
1839
|
[h, i]
|
|
1843
1840
|
), B = V(
|
|
1844
1841
|
(F, j) => {
|
|
1845
1842
|
j && j.stopPropagation();
|
|
1846
|
-
const I = g.filter((
|
|
1847
|
-
|
|
1843
|
+
const I = g.filter((T) => T !== F);
|
|
1844
|
+
$(I), h && h({ value: I });
|
|
1848
1845
|
},
|
|
1849
1846
|
[g, h]
|
|
1850
1847
|
), _ = V(
|
|
@@ -1885,8 +1882,8 @@ function on({
|
|
|
1885
1882
|
onInput: W,
|
|
1886
1883
|
placeholder: a,
|
|
1887
1884
|
disabled: u,
|
|
1888
|
-
onFocus: () =>
|
|
1889
|
-
onBlur: () =>
|
|
1885
|
+
onFocus: () => H(!0),
|
|
1886
|
+
onBlur: () => H(!1),
|
|
1890
1887
|
ref: P
|
|
1891
1888
|
}
|
|
1892
1889
|
),
|
|
@@ -2093,7 +2090,7 @@ function dn({
|
|
|
2093
2090
|
function m(y) {
|
|
2094
2091
|
v.current = y.navigate, N.current = y.keydown;
|
|
2095
2092
|
}
|
|
2096
|
-
const g = E(() => f || f === 0 ? (t || n).find((y) => y.id === f) : null, [f, t, n]),
|
|
2093
|
+
const g = E(() => f || f === 0 ? (t || n).find((y) => y.id === f) : null, [f, t, n]), $ = V(
|
|
2097
2094
|
({ id: y }) => {
|
|
2098
2095
|
(y || y === 0) && (x(y), v.current(null), w && w({ value: y }));
|
|
2099
2096
|
},
|
|
@@ -2116,7 +2113,7 @@ function dn({
|
|
|
2116
2113
|
children: [
|
|
2117
2114
|
/* @__PURE__ */ r("div", { className: "wx-2YgblL wx-label", children: g ? p ? p(g) : g[c] : s ? /* @__PURE__ */ r("span", { className: "wx-2YgblL wx-placeholder", children: s }) : " " }),
|
|
2118
2115
|
u && !l && f ? /* @__PURE__ */ r("i", { className: "wx-2YgblL wx-icon wxi-close", onClick: k }) : /* @__PURE__ */ r("i", { className: "wx-2YgblL wx-icon wxi-angle-down" }),
|
|
2119
|
-
!l && /* @__PURE__ */ r(ke, { items: n, onReady: m, onSelect:
|
|
2116
|
+
!l && /* @__PURE__ */ r(ke, { items: n, onReady: m, onSelect: $, ...h, children: ({ option: y }) => p ? p(y) : y[c] })
|
|
2120
2117
|
]
|
|
2121
2118
|
}
|
|
2122
2119
|
);
|
|
@@ -2136,7 +2133,7 @@ const fn = ({
|
|
|
2136
2133
|
}, [n]), /* @__PURE__ */ r("div", { className: `wx-0hMO7P wx-segmented ${t}`, children: e.map((c) => /* @__PURE__ */ r(
|
|
2137
2134
|
"button",
|
|
2138
2135
|
{
|
|
2139
|
-
className: `wx-0hMO7P wx-segment ${c.
|
|
2136
|
+
className: `wx-0hMO7P wx-segment ${c.id === i ? "wx-selected" : ""}`,
|
|
2140
2137
|
title: c.title,
|
|
2141
2138
|
onClick: () => o(c.id),
|
|
2142
2139
|
"data-tooltip-text": c.tooltip,
|
|
@@ -2235,13 +2232,13 @@ function Fe({
|
|
|
2235
2232
|
J(() => {
|
|
2236
2233
|
v(i);
|
|
2237
2234
|
}, [i]);
|
|
2238
|
-
const
|
|
2235
|
+
const $ = S(null);
|
|
2239
2236
|
J(() => {
|
|
2240
|
-
if (
|
|
2241
|
-
return
|
|
2242
|
-
|
|
2237
|
+
if ($.current)
|
|
2238
|
+
return $.current.addEventListener("change", g), () => {
|
|
2239
|
+
$.current && $.current.removeEventListener("change", g);
|
|
2243
2240
|
};
|
|
2244
|
-
}, [
|
|
2241
|
+
}, [$, g]);
|
|
2245
2242
|
const k = { ...p && { width: p } };
|
|
2246
2243
|
return /* @__PURE__ */ C(
|
|
2247
2244
|
"div",
|
|
@@ -2265,7 +2262,7 @@ function Fe({
|
|
|
2265
2262
|
value: h,
|
|
2266
2263
|
onInput: m,
|
|
2267
2264
|
style: { background: x },
|
|
2268
|
-
ref:
|
|
2265
|
+
ref: $
|
|
2269
2266
|
}
|
|
2270
2267
|
) })
|
|
2271
2268
|
]
|
|
@@ -2314,7 +2311,7 @@ const mn = ({
|
|
|
2314
2311
|
return /* @__PURE__ */ r("div", { className: `wx-138fWJ wx-tabs wx-${t} ${s}`, children: e.map((c) => /* @__PURE__ */ C(
|
|
2315
2312
|
"button",
|
|
2316
2313
|
{
|
|
2317
|
-
className: `wx-138fWJ wx-tab ${c.
|
|
2314
|
+
className: `wx-138fWJ wx-tab ${c.id === i ? "wx-active" : ""}`,
|
|
2318
2315
|
title: c.title,
|
|
2319
2316
|
onClick: () => o(c.id),
|
|
2320
2317
|
"data-tooltip-text": c.tooltip,
|
|
@@ -2452,10 +2449,10 @@ function Pt({ notice: e = {} }) {
|
|
|
2452
2449
|
}
|
|
2453
2450
|
);
|
|
2454
2451
|
}
|
|
2455
|
-
function
|
|
2452
|
+
function At({ data: e = [] }) {
|
|
2456
2453
|
return /* @__PURE__ */ r("div", { className: "wx-3nwoO9 wx-notices", children: e.map((n) => /* @__PURE__ */ r(Pt, { notice: n }, n.id)) });
|
|
2457
2454
|
}
|
|
2458
|
-
function
|
|
2455
|
+
function Ht({
|
|
2459
2456
|
title: e = "",
|
|
2460
2457
|
buttons: n = ["cancel", "ok"],
|
|
2461
2458
|
header: t,
|
|
@@ -2531,7 +2528,7 @@ function Bt({ children: e }, n) {
|
|
|
2531
2528
|
), /* @__PURE__ */ C(Q, { children: [
|
|
2532
2529
|
e,
|
|
2533
2530
|
t && /* @__PURE__ */ r(
|
|
2534
|
-
|
|
2531
|
+
Ht,
|
|
2535
2532
|
{
|
|
2536
2533
|
title: t.title,
|
|
2537
2534
|
buttons: t.buttons,
|
|
@@ -2540,7 +2537,7 @@ function Bt({ children: e }, n) {
|
|
|
2540
2537
|
children: t.message
|
|
2541
2538
|
}
|
|
2542
2539
|
),
|
|
2543
|
-
/* @__PURE__ */ r(
|
|
2540
|
+
/* @__PURE__ */ r(At, { data: l })
|
|
2544
2541
|
] });
|
|
2545
2542
|
}
|
|
2546
2543
|
const Et = tt(Bt);
|
|
@@ -2638,9 +2635,9 @@ const Ot = ({
|
|
|
2638
2635
|
disabled: s
|
|
2639
2636
|
}
|
|
2640
2637
|
);
|
|
2641
|
-
},
|
|
2638
|
+
}, Ae = new Date(0, 0, 0, 0, 0);
|
|
2642
2639
|
function vn({
|
|
2643
|
-
value: e =
|
|
2640
|
+
value: e = Ae,
|
|
2644
2641
|
id: n,
|
|
2645
2642
|
title: t = "",
|
|
2646
2643
|
tooltip: s,
|
|
@@ -2655,7 +2652,7 @@ function vn({
|
|
|
2655
2652
|
const { calendar: w, formats: h } = (X(K) || ne()).getRaw(), v = w.clockFormat == 12, N = 23, f = 59, x = E(() => {
|
|
2656
2653
|
const D = o || h?.timeFormat;
|
|
2657
2654
|
return typeof D == "function" ? D : re(D, w);
|
|
2658
|
-
}, [o, h, w]), m = E(() => x(new Date(0, 0, 0, 1)).indexOf("01") != -1, [x]), g = (D,
|
|
2655
|
+
}, [o, h, w]), m = E(() => x(new Date(0, 0, 0, 1)).indexOf("01") != -1, [x]), g = (D, A) => (D < 10 && A ? `0${D}` : `${D}`).slice(-2), $ = (D) => g(D, !0), k = (D) => `${D}`.replace(/[^\d]/g, "") || 0, b = (D) => v && (D = D % 12, D === 0) ? "12" : g(D, m), y = V((D, A) => (D = k(D), Math.min(D, A)), []), [H, P] = O(null), R = d || Ae, Y = y(R.getHours(), N), G = y(R.getMinutes(), f), W = Y > 12, L = b(Y), B = $(G), _ = E(
|
|
2659
2656
|
() => x(new Date(0, 0, 0, Y, G)),
|
|
2660
2657
|
[Y, G, x]
|
|
2661
2658
|
), Z = V(() => {
|
|
@@ -2666,18 +2663,18 @@ function vn({
|
|
|
2666
2663
|
}, [R, W, c]), j = V(
|
|
2667
2664
|
({ value: D }) => {
|
|
2668
2665
|
if (R.getHours() === D) return;
|
|
2669
|
-
const
|
|
2670
|
-
|
|
2666
|
+
const A = new Date(R);
|
|
2667
|
+
A.setHours(D), p(A), c && c({ value: A });
|
|
2671
2668
|
},
|
|
2672
2669
|
[R, c]
|
|
2673
2670
|
), I = V(
|
|
2674
2671
|
({ value: D }) => {
|
|
2675
2672
|
if (R.getMinutes() === D) return;
|
|
2676
|
-
const
|
|
2677
|
-
|
|
2673
|
+
const A = new Date(R);
|
|
2674
|
+
A.setMinutes(D), p(A), c && c({ value: A });
|
|
2678
2675
|
},
|
|
2679
2676
|
[R, c]
|
|
2680
|
-
),
|
|
2677
|
+
), T = V(
|
|
2681
2678
|
(D) => (D = y(D, N), v && (D = D * 1, D === 12 && (D = 0), W && (D += 12)), D),
|
|
2682
2679
|
[y, v, W]
|
|
2683
2680
|
), M = V(() => {
|
|
@@ -2704,7 +2701,7 @@ function vn({
|
|
|
2704
2701
|
icon: "wxi-clock"
|
|
2705
2702
|
}
|
|
2706
2703
|
),
|
|
2707
|
-
|
|
2704
|
+
H && !i && /* @__PURE__ */ r(se, { onCancel: M, ...De(u), children: /* @__PURE__ */ C("div", { className: "wx-7f497i wx-wrapper", children: [
|
|
2708
2705
|
/* @__PURE__ */ C("div", { className: "wx-7f497i wx-timer", children: [
|
|
2709
2706
|
/* @__PURE__ */ r(
|
|
2710
2707
|
"input",
|
|
@@ -2712,8 +2709,8 @@ function vn({
|
|
|
2712
2709
|
className: "wx-7f497i wx-digit",
|
|
2713
2710
|
value: L,
|
|
2714
2711
|
onChange: (D) => {
|
|
2715
|
-
const
|
|
2716
|
-
j({ value:
|
|
2712
|
+
const A = T(D.target.value);
|
|
2713
|
+
j({ value: A });
|
|
2717
2714
|
}
|
|
2718
2715
|
}
|
|
2719
2716
|
),
|
|
@@ -2724,8 +2721,8 @@ function vn({
|
|
|
2724
2721
|
className: "wx-7f497i wx-digit",
|
|
2725
2722
|
value: B,
|
|
2726
2723
|
onChange: (D) => {
|
|
2727
|
-
const
|
|
2728
|
-
I({ value:
|
|
2724
|
+
const A = y(D.target.value, f);
|
|
2725
|
+
I({ value: A });
|
|
2729
2726
|
}
|
|
2730
2727
|
}
|
|
2731
2728
|
),
|
|
@@ -2764,7 +2761,7 @@ function vn({
|
|
|
2764
2761
|
}
|
|
2765
2762
|
);
|
|
2766
2763
|
}
|
|
2767
|
-
function
|
|
2764
|
+
function He(e) {
|
|
2768
2765
|
return e === "point" ? "point" : e.split("-")[0];
|
|
2769
2766
|
}
|
|
2770
2767
|
function Wt(e) {
|
|
@@ -2789,12 +2786,12 @@ function gn(e) {
|
|
|
2789
2786
|
} = e;
|
|
2790
2787
|
function u(I) {
|
|
2791
2788
|
if (l && I.scrollWidth <= I.clientWidth) return null;
|
|
2792
|
-
const
|
|
2793
|
-
return
|
|
2789
|
+
const T = I.getAttribute?.("data-tooltip-text");
|
|
2790
|
+
return T || null;
|
|
2794
2791
|
}
|
|
2795
|
-
const d = e.resolver || u, p = E(() =>
|
|
2792
|
+
const d = e.resolver || u, p = E(() => He(n), [n]), w = E(() => Wt(n), [n]), h = E(() => n === "point" ? "point" : `${p}-${w}`, [n, p, w]), v = S(null), N = S(!1), [f, x] = O(null), [m, g] = O(null), [$, k] = O(null), [b, y] = O(!1), H = S(m);
|
|
2796
2793
|
J(() => {
|
|
2797
|
-
|
|
2794
|
+
H.current = m;
|
|
2798
2795
|
}, [m]);
|
|
2799
2796
|
const P = E(
|
|
2800
2797
|
() => m !== null && (!!m.result || a != null),
|
|
@@ -2806,55 +2803,55 @@ function gn(e) {
|
|
|
2806
2803
|
function Y() {
|
|
2807
2804
|
return he(f, "--wx-tooltip-arrow-size", 6);
|
|
2808
2805
|
}
|
|
2809
|
-
function G(I,
|
|
2806
|
+
function G(I, T, M, D) {
|
|
2810
2807
|
if (p === "point") return "50%";
|
|
2811
|
-
const
|
|
2808
|
+
const A = D?.getBoundingClientRect() ?? { top: 0, left: 0 }, ee = I / 2;
|
|
2812
2809
|
let z, q;
|
|
2813
|
-
return p === "top" || p === "bottom" ? (q =
|
|
2810
|
+
return p === "top" || p === "bottom" ? (q = T.x - (D?.scrollLeft ?? 0) + A.left, w === "start" ? z = M.left + I + ee : w === "end" ? z = M.right - I - ee : z = M.left + M.width / 2) : (q = T.y - (D?.scrollTop ?? 0) + A.top, w === "start" ? z = M.top + I + ee : w === "end" ? z = M.bottom - I - ee : z = M.top + M.height / 2), `${z - q}px`;
|
|
2814
2811
|
}
|
|
2815
2812
|
J(() => {
|
|
2816
2813
|
if (!f || !m) return void k(null);
|
|
2817
|
-
const I = n === "point" ? R() : 0,
|
|
2814
|
+
const I = n === "point" ? R() : 0, T = We(
|
|
2818
2815
|
f,
|
|
2819
2816
|
m.anchor,
|
|
2820
2817
|
h,
|
|
2821
2818
|
m.mouseX + I,
|
|
2822
2819
|
m.mouseY + I
|
|
2823
2820
|
);
|
|
2824
|
-
if (
|
|
2825
|
-
const M = m.anchor.getBoundingClientRect(), D = Ye(f),
|
|
2821
|
+
if (T === null) return void k(null);
|
|
2822
|
+
const M = m.anchor.getBoundingClientRect(), D = Ye(f), A = He(T.at);
|
|
2826
2823
|
let ee = "50%";
|
|
2827
|
-
if (
|
|
2824
|
+
if (T && t && n !== "point") {
|
|
2828
2825
|
const q = Y();
|
|
2829
|
-
|
|
2826
|
+
A === "top" ? T.y -= q : A === "bottom" ? T.y += q : A === "left" ? T.x -= q : A === "right" && (T.x += q), ee = G(q, T, M, D);
|
|
2830
2827
|
}
|
|
2831
2828
|
const z = he(f, "--wx-tooltip-z-index", 1002);
|
|
2832
2829
|
k({
|
|
2833
|
-
x: Math.round(
|
|
2834
|
-
y: Math.round(
|
|
2835
|
-
z: Math.max(
|
|
2836
|
-
side:
|
|
2830
|
+
x: Math.round(T.x),
|
|
2831
|
+
y: Math.round(T.y),
|
|
2832
|
+
z: Math.max(T.z, z),
|
|
2833
|
+
side: A,
|
|
2837
2834
|
arrowOffset: ee
|
|
2838
2835
|
});
|
|
2839
2836
|
}, [f, m, n, t, p, w, h]);
|
|
2840
|
-
function W(I,
|
|
2837
|
+
function W(I, T) {
|
|
2841
2838
|
if (!N.current || ("ontouchstart" in window || window.navigator.maxTouchPoints > 0) && !s) return null;
|
|
2842
2839
|
for (; I && I !== v.current; I = I.parentNode) {
|
|
2843
2840
|
if (I.nodeType !== window.Node.ELEMENT_NODE) continue;
|
|
2844
|
-
const D = d(I,
|
|
2841
|
+
const D = d(I, T);
|
|
2845
2842
|
if (D != null)
|
|
2846
2843
|
return {
|
|
2847
2844
|
result: D,
|
|
2848
2845
|
anchor: I,
|
|
2849
|
-
mouseX:
|
|
2850
|
-
mouseY:
|
|
2846
|
+
mouseX: T.clientX,
|
|
2847
|
+
mouseY: T.clientY
|
|
2851
2848
|
};
|
|
2852
2849
|
}
|
|
2853
2850
|
return null;
|
|
2854
2851
|
}
|
|
2855
2852
|
const L = S(void 0), B = S(!1);
|
|
2856
|
-
function _(I
|
|
2857
|
-
clearTimeout(L.current), L.current = setTimeout(I, i
|
|
2853
|
+
function _(I) {
|
|
2854
|
+
clearTimeout(L.current), L.current = setTimeout(I, i);
|
|
2858
2855
|
}
|
|
2859
2856
|
function Z(I) {
|
|
2860
2857
|
if (I.target.closest(".wx-tooltip-area") !== v.current) {
|
|
@@ -2862,8 +2859,8 @@ function gn(e) {
|
|
|
2862
2859
|
return;
|
|
2863
2860
|
}
|
|
2864
2861
|
N.current = !0;
|
|
2865
|
-
const
|
|
2866
|
-
if (
|
|
2862
|
+
const T = H.current;
|
|
2863
|
+
if (T?.anchor?.contains(I.target)) {
|
|
2867
2864
|
clearTimeout(L.current), B.current = !1;
|
|
2868
2865
|
const M = d(I.target, I);
|
|
2869
2866
|
if (M != null) {
|
|
@@ -2876,7 +2873,7 @@ function gn(e) {
|
|
|
2876
2873
|
return;
|
|
2877
2874
|
}
|
|
2878
2875
|
}
|
|
2879
|
-
if (
|
|
2876
|
+
if (T !== null) {
|
|
2880
2877
|
const M = W(I.target, I);
|
|
2881
2878
|
M ? (clearTimeout(L.current), B.current = !1, g(M), y(!1)) : B.current || (B.current = !0, _(() => {
|
|
2882
2879
|
B.current = !1, g(null);
|
|
@@ -2905,10 +2902,10 @@ function gn(e) {
|
|
|
2905
2902
|
const j = [
|
|
2906
2903
|
"wx-tooltip",
|
|
2907
2904
|
c,
|
|
2908
|
-
t &&
|
|
2909
|
-
t &&
|
|
2910
|
-
t &&
|
|
2911
|
-
t &&
|
|
2905
|
+
t && $?.side === "top" ? "wx-arrow-top" : "",
|
|
2906
|
+
t && $?.side === "bottom" ? "wx-arrow-bottom" : "",
|
|
2907
|
+
t && $?.side === "left" ? "wx-arrow-left" : "",
|
|
2908
|
+
t && $?.side === "right" ? "wx-arrow-right" : "",
|
|
2912
2909
|
b ? "" : "wx-tooltip-transition",
|
|
2913
2910
|
"wx-aab5ZNfz"
|
|
2914
2911
|
].filter(Boolean).join(" ");
|
|
@@ -2928,10 +2925,10 @@ function gn(e) {
|
|
|
2928
2925
|
role: "tooltip",
|
|
2929
2926
|
ref: x,
|
|
2930
2927
|
style: {
|
|
2931
|
-
translate: `${
|
|
2932
|
-
zIndex:
|
|
2933
|
-
visibility:
|
|
2934
|
-
"--wx-arrow-offset":
|
|
2928
|
+
translate: `${$?.x ?? 0}px ${$?.y ?? 0}px`,
|
|
2929
|
+
zIndex: $?.z ?? 20,
|
|
2930
|
+
visibility: $ ? void 0 : "hidden",
|
|
2931
|
+
"--wx-arrow-offset": $?.arrowOffset ?? "50%"
|
|
2935
2932
|
},
|
|
2936
2933
|
children: /* @__PURE__ */ r("div", { className: "wx-tooltip-wrapper wx-aab5ZNfz", children: /* @__PURE__ */ r("div", { className: "wx-tooltip-inner wx-aab5ZNfz", children: typeof m.result == "string" ? a ? /* @__PURE__ */ r(a, { data: m.result }) : /* @__PURE__ */ r("div", { className: "wx-tooltip-text wx-aab5ZNfz", children: m.result }) : a ? /* @__PURE__ */ r(a, { ...m.result }) : /* @__PURE__ */ r("div", { className: "wx-tooltip-text wx-aab5ZNfz", children: m.result?.data }) }) })
|
|
2937
2934
|
}
|
|
@@ -2987,8 +2984,8 @@ function yn(e) {
|
|
|
2987
2984
|
fontSize: h + "px"
|
|
2988
2985
|
};
|
|
2989
2986
|
function N(f, x) {
|
|
2990
|
-
const m = x === 0 ? "0" : `${t * -0.25}px`, g = f.avatar ? "transparent" : f.color || Be,
|
|
2991
|
-
return { marginLeft: m, backgroundColor: g, color:
|
|
2987
|
+
const m = x === 0 ? "0" : `${t * -0.25}px`, g = f.avatar ? "transparent" : f.color || Be, $ = f.avatar ? "transparent" : jt(f.color || Be);
|
|
2988
|
+
return { marginLeft: m, backgroundColor: g, color: $ };
|
|
2992
2989
|
}
|
|
2993
2990
|
return /* @__PURE__ */ r("div", { className: `wx-avatar-root wx-aadkRiRf ${l}`, ref: i, children: p.length > 0 && /* @__PURE__ */ r("div", { className: "wx-avatar-stack wx-aadkRiRf", children: p.map((f, x) => /* @__PURE__ */ C(
|
|
2994
2991
|
"div",
|
|
@@ -3114,7 +3111,7 @@ export {
|
|
|
3114
3111
|
cn as Icon,
|
|
3115
3112
|
ve as Locale,
|
|
3116
3113
|
bn as Material,
|
|
3117
|
-
|
|
3114
|
+
Ht as Modal,
|
|
3118
3115
|
Nn as ModalArea,
|
|
3119
3116
|
ht as Month,
|
|
3120
3117
|
on as MultiCombo,
|