@idds/react 1.6.20 → 1.6.22
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/AGENT.md +444 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.es.js +950 -949
- package/dist/types/components/Modal.d.ts +3 -1
- package/dist/types/components/Modal.d.ts.map +1 -1
- package/package.json +6 -4
package/dist/index.es.js
CHANGED
|
@@ -609,7 +609,7 @@ function Er(e) {
|
|
|
609
609
|
children: l
|
|
610
610
|
} = e, c = t || a || !1, b = le(/* @__PURE__ */ new Map()), [h, u] = Z(
|
|
611
611
|
r !== void 0 ? [r] : []
|
|
612
|
-
), [
|
|
612
|
+
), [N, m] = Z(0), p = le(h);
|
|
613
613
|
p.current = h;
|
|
614
614
|
const I = me(
|
|
615
615
|
(k, _) => {
|
|
@@ -620,7 +620,7 @@ function Er(e) {
|
|
|
620
620
|
), E = me((k) => {
|
|
621
621
|
const _ = b.current.get(k);
|
|
622
622
|
if (_ !== void 0) {
|
|
623
|
-
b.current.delete(k), u(($) => $.filter((
|
|
623
|
+
b.current.delete(k), u(($) => $.filter((P) => P !== _).map((P) => P > _ ? P - 1 : P));
|
|
624
624
|
const f = /* @__PURE__ */ new Map();
|
|
625
625
|
let T = 0;
|
|
626
626
|
b.current.forEach(($, Y) => {
|
|
@@ -635,7 +635,7 @@ function Er(e) {
|
|
|
635
635
|
});
|
|
636
636
|
},
|
|
637
637
|
[c, i]
|
|
638
|
-
), F = me((k) => p.current.includes(k), []),
|
|
638
|
+
), F = me((k) => p.current.includes(k), []), C = Fe(
|
|
639
639
|
() => ({
|
|
640
640
|
multiple: c,
|
|
641
641
|
multipleOpen: c,
|
|
@@ -643,7 +643,7 @@ function Er(e) {
|
|
|
643
643
|
unregisterItem: E,
|
|
644
644
|
handleItemToggle: A,
|
|
645
645
|
isItemOpen: F,
|
|
646
|
-
version:
|
|
646
|
+
version: N
|
|
647
647
|
// Include version untuk trigger re-render
|
|
648
648
|
}),
|
|
649
649
|
[
|
|
@@ -652,10 +652,10 @@ function Er(e) {
|
|
|
652
652
|
E,
|
|
653
653
|
A,
|
|
654
654
|
F,
|
|
655
|
-
|
|
655
|
+
N
|
|
656
656
|
]
|
|
657
657
|
);
|
|
658
|
-
return /* @__PURE__ */ n(_a.Provider, { value:
|
|
658
|
+
return /* @__PURE__ */ n(_a.Provider, { value: C, children: /* @__PURE__ */ n("div", { className: S("ina-accordion-group", s), children: l }) });
|
|
659
659
|
}
|
|
660
660
|
function Ar(e) {
|
|
661
661
|
const {
|
|
@@ -666,22 +666,22 @@ function Ar(e) {
|
|
|
666
666
|
onToggle: s,
|
|
667
667
|
disabled: l = !1,
|
|
668
668
|
className: c
|
|
669
|
-
} = e, [b, h] = Z(r), u = ja(),
|
|
669
|
+
} = e, [b, h] = Z(r), u = ja(), N = ma().replace(/:/g, "-"), m = le(`accordion-${N}`), [p, I] = Z(-1), E = le(r);
|
|
670
670
|
E.current = r;
|
|
671
671
|
const { registerItem: A, unregisterItem: F } = u || {};
|
|
672
672
|
oe(() => {
|
|
673
673
|
if (A) {
|
|
674
|
-
const
|
|
675
|
-
I(
|
|
674
|
+
const P = A(m.current, E.current);
|
|
675
|
+
I(P);
|
|
676
676
|
}
|
|
677
677
|
return () => {
|
|
678
678
|
F && (F(m.current), I(-1));
|
|
679
679
|
};
|
|
680
680
|
}, [A, F]);
|
|
681
|
-
const
|
|
681
|
+
const C = u !== null, k = i !== void 0 || C, _ = Fe(() => C && p >= 0 && u ? u.isItemOpen(p) : i !== void 0 ? i : b, [C, p, u, i, b]), f = Fe(() => `accordion-header-${m.current}`, []), T = Fe(() => `accordion-content-${m.current}`, []), $ = () => {
|
|
682
682
|
if (l) return;
|
|
683
|
-
const
|
|
684
|
-
|
|
683
|
+
const P = !_;
|
|
684
|
+
C && p >= 0 && u ? u.handleItemToggle(p, P) : k || h(P), s == null || s(P);
|
|
685
685
|
}, Y = S("ina-accordion", c, {
|
|
686
686
|
"ina-accordion--disabled": l,
|
|
687
687
|
"ina-accordion--open": _
|
|
@@ -693,22 +693,22 @@ function Ar(e) {
|
|
|
693
693
|
type: "button",
|
|
694
694
|
id: f,
|
|
695
695
|
onClick: $,
|
|
696
|
-
onKeyDown: (
|
|
696
|
+
onKeyDown: (P) => {
|
|
697
697
|
var V;
|
|
698
|
-
if (
|
|
699
|
-
|
|
700
|
-
const
|
|
698
|
+
if (P.key === "ArrowDown" || P.key === "ArrowUp") {
|
|
699
|
+
P.preventDefault();
|
|
700
|
+
const H = P.currentTarget.closest(".ina-accordion");
|
|
701
|
+
if (!H) return;
|
|
702
|
+
const G = H.closest(".ina-accordion-group") || H.parentElement;
|
|
701
703
|
if (!G) return;
|
|
702
|
-
const
|
|
703
|
-
|
|
704
|
-
const W = Array.from(
|
|
705
|
-
O.querySelectorAll(
|
|
704
|
+
const K = Array.from(
|
|
705
|
+
G.querySelectorAll(
|
|
706
706
|
".ina-accordion__toggle:not([disabled])"
|
|
707
707
|
)
|
|
708
|
-
), ae =
|
|
708
|
+
), ae = K.indexOf(P.currentTarget);
|
|
709
709
|
if (ae > -1) {
|
|
710
|
-
const
|
|
711
|
-
(V =
|
|
710
|
+
const ce = P.key === "ArrowDown" ? (ae + 1) % K.length : (ae - 1 + K.length) % K.length;
|
|
711
|
+
(V = K[ce]) == null || V.focus();
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
714
|
},
|
|
@@ -782,7 +782,7 @@ function Sr({
|
|
|
782
782
|
onToggle: i,
|
|
783
783
|
className: s = ""
|
|
784
784
|
}) {
|
|
785
|
-
const [l, c] = Z(r), b = t !== void 0, h = b ? t : l, u = le(null), [
|
|
785
|
+
const [l, c] = Z(r), b = t !== void 0, h = b ? t : l, u = le(null), [N, m] = Z("0px");
|
|
786
786
|
oe(() => {
|
|
787
787
|
const E = u.current;
|
|
788
788
|
if (E)
|
|
@@ -821,7 +821,7 @@ function Sr({
|
|
|
821
821
|
ref: u,
|
|
822
822
|
className: "ina-accordion-card__content",
|
|
823
823
|
style: {
|
|
824
|
-
height:
|
|
824
|
+
height: N
|
|
825
825
|
},
|
|
826
826
|
onTransitionEnd: p,
|
|
827
827
|
children: /* @__PURE__ */ n("div", { className: "ina-accordion-card__content-body", children: a })
|
|
@@ -841,17 +841,17 @@ const Ya = ha(
|
|
|
841
841
|
width: c = "auto",
|
|
842
842
|
disabled: b = !1
|
|
843
843
|
}, h) => {
|
|
844
|
-
const [u,
|
|
844
|
+
const [u, N] = Z(!1), m = le(null), p = le(null);
|
|
845
845
|
va(h, () => ({
|
|
846
|
-
open: () =>
|
|
847
|
-
close: () =>
|
|
848
|
-
toggle: () =>
|
|
846
|
+
open: () => N(!0),
|
|
847
|
+
close: () => N(!1),
|
|
848
|
+
toggle: () => N((C) => !C)
|
|
849
849
|
})), oe(() => {
|
|
850
|
-
const
|
|
851
|
-
m.current && !m.current.contains(k.target) && p.current && !p.current.contains(k.target) &&
|
|
850
|
+
const C = (k) => {
|
|
851
|
+
m.current && !m.current.contains(k.target) && p.current && !p.current.contains(k.target) && N(!1);
|
|
852
852
|
};
|
|
853
|
-
return document.addEventListener("mousedown",
|
|
854
|
-
document.removeEventListener("mousedown",
|
|
853
|
+
return document.addEventListener("mousedown", C), () => {
|
|
854
|
+
document.removeEventListener("mousedown", C);
|
|
855
855
|
};
|
|
856
856
|
}, []);
|
|
857
857
|
const I = S(
|
|
@@ -867,9 +867,9 @@ const Ya = ha(
|
|
|
867
867
|
`ina-action-dropdown__menu--width-${c}`,
|
|
868
868
|
u && "ina-action-dropdown__menu--visible",
|
|
869
869
|
s
|
|
870
|
-
), F = (
|
|
870
|
+
), F = (C) => {
|
|
871
871
|
var k;
|
|
872
|
-
|
|
872
|
+
C.disabled || ((k = C.onClick) == null || k.call(C), N(!1));
|
|
873
873
|
};
|
|
874
874
|
return /* @__PURE__ */ w(
|
|
875
875
|
"div",
|
|
@@ -883,7 +883,7 @@ const Ya = ha(
|
|
|
883
883
|
ref: m,
|
|
884
884
|
type: "button",
|
|
885
885
|
className: E,
|
|
886
|
-
onClick: () => !b &&
|
|
886
|
+
onClick: () => !b && N(!u),
|
|
887
887
|
disabled: b,
|
|
888
888
|
children: [
|
|
889
889
|
r && /* @__PURE__ */ n("span", { className: "ina-action-dropdown__icon", children: r }),
|
|
@@ -891,20 +891,20 @@ const Ya = ha(
|
|
|
891
891
|
]
|
|
892
892
|
}
|
|
893
893
|
),
|
|
894
|
-
/* @__PURE__ */ n("div", { className: A, children: /* @__PURE__ */ n("ul", { className: "ina-action-dropdown__list", children: a.map((
|
|
894
|
+
/* @__PURE__ */ n("div", { className: A, children: /* @__PURE__ */ n("ul", { className: "ina-action-dropdown__list", children: a.map((C, k) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ w(
|
|
895
895
|
"button",
|
|
896
896
|
{
|
|
897
897
|
type: "button",
|
|
898
898
|
className: S(
|
|
899
899
|
"ina-action-dropdown__item",
|
|
900
|
-
|
|
901
|
-
|
|
900
|
+
C.type && `ina-action-dropdown__item--${C.type}`,
|
|
901
|
+
C.disabled && "ina-action-dropdown__item--disabled"
|
|
902
902
|
),
|
|
903
|
-
onClick: () => F(
|
|
904
|
-
disabled:
|
|
903
|
+
onClick: () => F(C),
|
|
904
|
+
disabled: C.disabled,
|
|
905
905
|
children: [
|
|
906
|
-
|
|
907
|
-
|
|
906
|
+
C.icon && /* @__PURE__ */ n("span", { className: "ina-action-dropdown__item-icon", children: C.icon }),
|
|
907
|
+
C.label
|
|
908
908
|
]
|
|
909
909
|
}
|
|
910
910
|
) }, k)) }) })
|
|
@@ -1056,7 +1056,7 @@ function Vr(e) {
|
|
|
1056
1056
|
success: /* @__PURE__ */ n(at, { size: 20 }),
|
|
1057
1057
|
caution: /* @__PURE__ */ n(qa, { size: 20 }),
|
|
1058
1058
|
critical: /* @__PURE__ */ n(ka, { size: 20 })
|
|
1059
|
-
}[a],
|
|
1059
|
+
}[a], N = u !== null, m = S(
|
|
1060
1060
|
"ina-alert",
|
|
1061
1061
|
`ina-alert--${a}`,
|
|
1062
1062
|
{
|
|
@@ -1065,7 +1065,7 @@ function Vr(e) {
|
|
|
1065
1065
|
b
|
|
1066
1066
|
);
|
|
1067
1067
|
return /* @__PURE__ */ w("div", { className: m, role: "alert", children: [
|
|
1068
|
-
|
|
1068
|
+
N && /* @__PURE__ */ n("div", { className: "ina-alert__icon", children: u }),
|
|
1069
1069
|
/* @__PURE__ */ n("div", { className: "ina-alert__content", children: /* @__PURE__ */ w("div", { className: "ina-alert__text-section", children: [
|
|
1070
1070
|
t && /* @__PURE__ */ n("div", { className: "ina-alert__title", children: t }),
|
|
1071
1071
|
r && /* @__PURE__ */ n("div", { className: "ina-alert__description", children: r })
|
|
@@ -1210,14 +1210,14 @@ function $r({
|
|
|
1210
1210
|
showButton: b = !1,
|
|
1211
1211
|
buttonText: h,
|
|
1212
1212
|
buttonHierarchy: u = "primary",
|
|
1213
|
-
onButtonClick:
|
|
1213
|
+
onButtonClick: N,
|
|
1214
1214
|
showHeader: m = !0,
|
|
1215
1215
|
hoverable: p = !1,
|
|
1216
1216
|
clickable: I = !1,
|
|
1217
1217
|
className: E = "",
|
|
1218
1218
|
children: A
|
|
1219
1219
|
}) {
|
|
1220
|
-
const
|
|
1220
|
+
const C = (() => {
|
|
1221
1221
|
if (a)
|
|
1222
1222
|
return a;
|
|
1223
1223
|
switch (e) {
|
|
@@ -1233,7 +1233,7 @@ function $r({
|
|
|
1233
1233
|
})(), k = S(
|
|
1234
1234
|
"ina-card",
|
|
1235
1235
|
`ina-card--variant-${e}`,
|
|
1236
|
-
`ina-card--media-${
|
|
1236
|
+
`ina-card--media-${C}`,
|
|
1237
1237
|
{
|
|
1238
1238
|
"ina-card--hoverable": p,
|
|
1239
1239
|
"ina-card--clickable": I,
|
|
@@ -1242,9 +1242,9 @@ function $r({
|
|
|
1242
1242
|
E
|
|
1243
1243
|
), _ = () => /* @__PURE__ */ n("div", { className: "ina-card__media", children: l ? /* @__PURE__ */ n("img", { src: l, alt: c || "Card media" }) : null });
|
|
1244
1244
|
return /* @__PURE__ */ w("div", { className: k, children: [
|
|
1245
|
-
e === "basic" &&
|
|
1245
|
+
e === "basic" && C === "top" && _(),
|
|
1246
1246
|
e === "overlay" && _(),
|
|
1247
|
-
e === "horizontal" &&
|
|
1247
|
+
e === "horizontal" && C === "left" && _(),
|
|
1248
1248
|
/* @__PURE__ */ w("div", { className: "ina-card__content", children: [
|
|
1249
1249
|
t && /* @__PURE__ */ n("div", { className: "ina-card__avatar", children: /* @__PURE__ */ n("img", { src: t, alt: r || "Avatar" }) }),
|
|
1250
1250
|
(i || s) && /* @__PURE__ */ w("div", { children: [
|
|
@@ -1257,13 +1257,13 @@ function $r({
|
|
|
1257
1257
|
{
|
|
1258
1258
|
hierarchy: u,
|
|
1259
1259
|
size: "md",
|
|
1260
|
-
onClick:
|
|
1260
|
+
onClick: N,
|
|
1261
1261
|
children: h
|
|
1262
1262
|
}
|
|
1263
1263
|
) })
|
|
1264
1264
|
] }),
|
|
1265
|
-
e === "basic" &&
|
|
1266
|
-
e === "horizontal" &&
|
|
1265
|
+
e === "basic" && C === "bottom" && _(),
|
|
1266
|
+
e === "horizontal" && C === "right" && _()
|
|
1267
1267
|
] });
|
|
1268
1268
|
}
|
|
1269
1269
|
const Za = ({
|
|
@@ -1391,7 +1391,7 @@ function zr({
|
|
|
1391
1391
|
r
|
|
1392
1392
|
),
|
|
1393
1393
|
children: e.map((c, b) => {
|
|
1394
|
-
const h = b < a, u = b === a,
|
|
1394
|
+
const h = b < a, u = b === a, N = c.disabled, m = s.includes(b);
|
|
1395
1395
|
return /* @__PURE__ */ w(Wa, { children: [
|
|
1396
1396
|
/* @__PURE__ */ w(
|
|
1397
1397
|
"div",
|
|
@@ -1400,10 +1400,10 @@ function zr({
|
|
|
1400
1400
|
"ina-stepper__item--completed": h && !m,
|
|
1401
1401
|
"ina-stepper__item--active": u && !m,
|
|
1402
1402
|
"ina-stepper__item--error": m,
|
|
1403
|
-
"ina-stepper__item--disabled":
|
|
1404
|
-
"ina-stepper__item--clickable": i && !
|
|
1403
|
+
"ina-stepper__item--disabled": N,
|
|
1404
|
+
"ina-stepper__item--clickable": i && !N
|
|
1405
1405
|
}),
|
|
1406
|
-
onClick: () => !
|
|
1406
|
+
onClick: () => !N && (i == null ? void 0 : i(b)),
|
|
1407
1407
|
children: [
|
|
1408
1408
|
/* @__PURE__ */ n("div", { className: "ina-stepper__icon-wrapper", children: h ? /* @__PURE__ */ w(
|
|
1409
1409
|
"svg",
|
|
@@ -1450,7 +1450,7 @@ function Br({
|
|
|
1450
1450
|
className: s = "",
|
|
1451
1451
|
name: l
|
|
1452
1452
|
}) {
|
|
1453
|
-
const c = a !== void 0, [b, h] = ge.useState(t), u = le([]),
|
|
1453
|
+
const c = a !== void 0, [b, h] = ge.useState(t), u = le([]), N = c ? a : b, m = (I, E) => {
|
|
1454
1454
|
i || E || (c || h(I), r && r(I));
|
|
1455
1455
|
}, p = S(
|
|
1456
1456
|
"ina-button-group",
|
|
@@ -1460,7 +1460,7 @@ function Br({
|
|
|
1460
1460
|
s
|
|
1461
1461
|
);
|
|
1462
1462
|
return /* @__PURE__ */ n("div", { className: p, role: "group", "aria-label": "Button group", children: e.map((I, E) => {
|
|
1463
|
-
const A =
|
|
1463
|
+
const A = N === I.value, F = i || I.disabled, C = S("ina-button-group__button", {
|
|
1464
1464
|
"ina-button-group__button--selected": A,
|
|
1465
1465
|
"ina-button-group__button--disabled": F
|
|
1466
1466
|
});
|
|
@@ -1469,7 +1469,7 @@ function Br({
|
|
|
1469
1469
|
{
|
|
1470
1470
|
ref: (k) => u.current[E] = k,
|
|
1471
1471
|
type: "button",
|
|
1472
|
-
className:
|
|
1472
|
+
className: C,
|
|
1473
1473
|
disabled: F,
|
|
1474
1474
|
tabIndex: A ? 0 : -1,
|
|
1475
1475
|
onClick: () => m(I.value, I.disabled),
|
|
@@ -1507,7 +1507,7 @@ function Pr({
|
|
|
1507
1507
|
trackColor: i = "#EAECF0",
|
|
1508
1508
|
className: s
|
|
1509
1509
|
}) {
|
|
1510
|
-
const l = Math.min(100, Math.max(0, e)), c = r.startsWith("#"), b = a / 2, h = (a - t) / 2, u = 2 * Math.PI * h,
|
|
1510
|
+
const l = Math.min(100, Math.max(0, e)), c = r.startsWith("#"), b = a / 2, h = (a - t) / 2, u = 2 * Math.PI * h, N = u - l / 100 * u, m = S(
|
|
1511
1511
|
"ina-circle-progress-bar",
|
|
1512
1512
|
!c && `ina-circle-progress-bar--${r}`,
|
|
1513
1513
|
s
|
|
@@ -1545,7 +1545,7 @@ function Pr({
|
|
|
1545
1545
|
r: h,
|
|
1546
1546
|
strokeWidth: t,
|
|
1547
1547
|
strokeDasharray: u,
|
|
1548
|
-
strokeDashoffset:
|
|
1548
|
+
strokeDashoffset: N
|
|
1549
1549
|
}
|
|
1550
1550
|
)
|
|
1551
1551
|
]
|
|
@@ -1584,7 +1584,7 @@ function Wt({
|
|
|
1584
1584
|
invalid: h = !1,
|
|
1585
1585
|
...u
|
|
1586
1586
|
}) {
|
|
1587
|
-
const
|
|
1587
|
+
const N = le(null), m = b || N;
|
|
1588
1588
|
oe(() => {
|
|
1589
1589
|
m.current && (m.current.indeterminate = i);
|
|
1590
1590
|
}, [i, m]);
|
|
@@ -1634,82 +1634,82 @@ function Hr({
|
|
|
1634
1634
|
customizationComponent: b,
|
|
1635
1635
|
className: h = ""
|
|
1636
1636
|
}) {
|
|
1637
|
-
const u = Array.isArray(a) ? a : a ? [a] : [],
|
|
1638
|
-
(V) => !e.some((
|
|
1639
|
-
), m =
|
|
1637
|
+
const u = Array.isArray(a) ? a : a ? [a] : [], N = u.filter(
|
|
1638
|
+
(V) => !e.some((H) => H.value === V) && V !== ""
|
|
1639
|
+
), m = N.length > 0, p = N[N.length - 1] || "", [I, E] = Z(!1), [A, F] = Z(p), C = () => {
|
|
1640
1640
|
if (u.length > 0) {
|
|
1641
1641
|
if (m && l)
|
|
1642
1642
|
return e.length;
|
|
1643
1643
|
const V = e.findIndex(
|
|
1644
|
-
(
|
|
1644
|
+
(H) => H.value === u[0]
|
|
1645
1645
|
);
|
|
1646
1646
|
if (V !== -1) return V;
|
|
1647
1647
|
}
|
|
1648
1648
|
return 0;
|
|
1649
|
-
}, [k, _] = Z(
|
|
1649
|
+
}, [k, _] = Z(C()), f = le([]);
|
|
1650
1650
|
oe(() => {
|
|
1651
|
-
_(
|
|
1651
|
+
_(C());
|
|
1652
1652
|
}, [a, e, m]), oe(() => {
|
|
1653
1653
|
m ? F(p) : (E(!1), F(""));
|
|
1654
1654
|
}, [a, m]);
|
|
1655
1655
|
const T = (V) => {
|
|
1656
1656
|
if (V)
|
|
1657
1657
|
if (t) {
|
|
1658
|
-
let
|
|
1659
|
-
u.includes(V) ?
|
|
1658
|
+
let H;
|
|
1659
|
+
u.includes(V) ? H = u.filter((G) => G !== V) : H = [...u, V], s == null || s(H);
|
|
1660
1660
|
} else
|
|
1661
1661
|
u.includes(V) ? s == null || s("") : s == null || s(V);
|
|
1662
1662
|
}, $ = () => {
|
|
1663
1663
|
const V = A.trim();
|
|
1664
1664
|
if (t) {
|
|
1665
|
-
let
|
|
1666
|
-
m && p && (
|
|
1665
|
+
let H = [...u];
|
|
1666
|
+
m && p && (H = H.filter((G) => G !== p)), V && (H.includes(V) || H.push(V)), s == null || s(H);
|
|
1667
1667
|
} else
|
|
1668
1668
|
s == null || s(V);
|
|
1669
1669
|
E(!1);
|
|
1670
|
-
}, Y = l ? [...e, { label: c, value: c }] : e,
|
|
1671
|
-
return /* @__PURE__ */ w("div", { className:
|
|
1672
|
-
/* @__PURE__ */ n("div", { className: "ina-chip__list", children: Y.map((V,
|
|
1673
|
-
const
|
|
1670
|
+
}, Y = l ? [...e, { label: c, value: c }] : e, P = S("ina-chip", h);
|
|
1671
|
+
return /* @__PURE__ */ w("div", { className: P, children: [
|
|
1672
|
+
/* @__PURE__ */ n("div", { className: "ina-chip__list", children: Y.map((V, H) => {
|
|
1673
|
+
const G = l && V.value === c, K = G ? m : u.includes(V.value);
|
|
1674
1674
|
return /* @__PURE__ */ n(
|
|
1675
1675
|
"button",
|
|
1676
1676
|
{
|
|
1677
|
-
ref: (ae) => f.current[
|
|
1677
|
+
ref: (ae) => f.current[H] = ae,
|
|
1678
1678
|
type: "button",
|
|
1679
|
-
tabIndex:
|
|
1679
|
+
tabIndex: H === k && !V.disabled ? 0 : -1,
|
|
1680
1680
|
disabled: V.disabled,
|
|
1681
1681
|
onClick: () => {
|
|
1682
|
-
V.disabled || (_(
|
|
1682
|
+
V.disabled || (_(H), G ? (E(!0), F(!t && !m ? "" : p)) : T(V.value));
|
|
1683
1683
|
},
|
|
1684
1684
|
onKeyDown: (ae) => {
|
|
1685
|
-
var
|
|
1685
|
+
var ce, te, X, O, W;
|
|
1686
1686
|
if (!V.disabled) {
|
|
1687
1687
|
if (ae.key === "ArrowRight" || ae.key === "ArrowDown") {
|
|
1688
1688
|
ae.preventDefault();
|
|
1689
|
-
let
|
|
1690
|
-
for (; (
|
|
1691
|
-
|
|
1692
|
-
_(
|
|
1689
|
+
let B = (H + 1) % Y.length;
|
|
1690
|
+
for (; (ce = Y[B]) != null && ce.disabled && B !== H; )
|
|
1691
|
+
B = (B + 1) % Y.length;
|
|
1692
|
+
_(B), (te = f.current[B]) == null || te.focus();
|
|
1693
1693
|
} else if (ae.key === "ArrowLeft" || ae.key === "ArrowUp") {
|
|
1694
1694
|
ae.preventDefault();
|
|
1695
|
-
let
|
|
1696
|
-
for (; (X = Y[
|
|
1697
|
-
|
|
1698
|
-
_(
|
|
1695
|
+
let B = (H - 1 + Y.length) % Y.length;
|
|
1696
|
+
for (; (X = Y[B]) != null && X.disabled && B !== H; )
|
|
1697
|
+
B = (B - 1 + Y.length) % Y.length;
|
|
1698
|
+
_(B), (O = f.current[B]) == null || O.focus();
|
|
1699
1699
|
}
|
|
1700
|
-
ae.key === " " && (ae.preventDefault(), (
|
|
1700
|
+
ae.key === " " && (ae.preventDefault(), (W = f.current[H]) == null || W.click());
|
|
1701
1701
|
}
|
|
1702
1702
|
},
|
|
1703
1703
|
className: S(
|
|
1704
1704
|
"ina-chip__item",
|
|
1705
1705
|
`ina-chip__item--size-${r}`,
|
|
1706
1706
|
`ina-chip__item--variant-${i}`,
|
|
1707
|
-
|
|
1707
|
+
K && "ina-chip__item--selected",
|
|
1708
1708
|
V.disabled && "ina-chip__item--disabled"
|
|
1709
1709
|
),
|
|
1710
1710
|
children: V.label
|
|
1711
1711
|
},
|
|
1712
|
-
`${V.label}-${
|
|
1712
|
+
`${V.label}-${H}`
|
|
1713
1713
|
);
|
|
1714
1714
|
}) }),
|
|
1715
1715
|
l && I && /* @__PURE__ */ n("div", { className: "ina-chip__custom-field", children: b ?? /* @__PURE__ */ w("div", { className: "ina-chip__input-wrapper", children: [
|
|
@@ -1832,9 +1832,9 @@ function Gr({
|
|
|
1832
1832
|
triggerClassName: b = "",
|
|
1833
1833
|
disabled: h = !1
|
|
1834
1834
|
}) {
|
|
1835
|
-
const [u,
|
|
1836
|
-
m ||
|
|
1837
|
-
},
|
|
1835
|
+
const [u, N] = Z(r), m = t !== void 0, p = m ? t : u, I = le(null), E = le(null), A = le(null), F = (f) => {
|
|
1836
|
+
m || N(f), i == null || i(f);
|
|
1837
|
+
}, C = (f) => {
|
|
1838
1838
|
f.stopPropagation(), !h && F(!p);
|
|
1839
1839
|
}, k = (f) => {
|
|
1840
1840
|
h || (f.key === "Enter" || f.key === " ") && (f.preventDefault(), F(!p));
|
|
@@ -1856,7 +1856,7 @@ function Gr({
|
|
|
1856
1856
|
{
|
|
1857
1857
|
ref: E,
|
|
1858
1858
|
className: S("ina-basic-dropdown__trigger", b),
|
|
1859
|
-
onClick:
|
|
1859
|
+
onClick: C,
|
|
1860
1860
|
tabIndex: _ ? -1 : 0,
|
|
1861
1861
|
role: _ ? void 0 : "button",
|
|
1862
1862
|
"aria-haspopup": _ ? void 0 : "true",
|
|
@@ -2383,52 +2383,52 @@ function Wr({
|
|
|
2383
2383
|
validateMagicNumber: h = !0,
|
|
2384
2384
|
// Default: true sesuai rekomendasi OWASP
|
|
2385
2385
|
disabled: u = !1,
|
|
2386
|
-
className:
|
|
2386
|
+
className: N = "",
|
|
2387
2387
|
onChange: m,
|
|
2388
2388
|
onRemove: p,
|
|
2389
2389
|
...I
|
|
2390
2390
|
}) {
|
|
2391
|
-
const E = le(null), [A, F] = Z([]), [
|
|
2392
|
-
var
|
|
2393
|
-
u || (
|
|
2394
|
-
}, [u]),
|
|
2395
|
-
async (
|
|
2396
|
-
const
|
|
2391
|
+
const E = le(null), [A, F] = Z([]), [C, k] = Z(!1), [_, f] = Z([]), [T, $] = Z(!1), Y = me(() => {
|
|
2392
|
+
var O;
|
|
2393
|
+
u || (O = E.current) == null || O.click();
|
|
2394
|
+
}, [u]), P = me(
|
|
2395
|
+
async (O) => {
|
|
2396
|
+
const W = [], B = [], se = [];
|
|
2397
2397
|
if (i && c) {
|
|
2398
2398
|
const j = A.length;
|
|
2399
|
-
if (j +
|
|
2399
|
+
if (j + O.length > c) {
|
|
2400
2400
|
const Q = c - j;
|
|
2401
2401
|
if (Q <= 0) {
|
|
2402
2402
|
se.push({
|
|
2403
2403
|
isValid: !1,
|
|
2404
2404
|
error: `Maksimal ${c} file yang dapat diupload`,
|
|
2405
|
-
file:
|
|
2405
|
+
file: O[0]
|
|
2406
2406
|
}), f(se), m == null || m([], se);
|
|
2407
2407
|
return;
|
|
2408
2408
|
}
|
|
2409
|
-
|
|
2409
|
+
O = O.slice(0, Q);
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
2412
|
if (i && b) {
|
|
2413
|
-
const j = A.reduce((
|
|
2413
|
+
const j = A.reduce((de, _e) => de + _e.file.size, 0), Q = O.reduce((de, _e) => de + _e.size, 0), ee = b * 1024 * 1024;
|
|
2414
2414
|
if (j + Q > ee) {
|
|
2415
2415
|
se.push({
|
|
2416
2416
|
isValid: !1,
|
|
2417
2417
|
error: `Ukuran total file maksimal ${b} MB`,
|
|
2418
|
-
file:
|
|
2418
|
+
file: O[0]
|
|
2419
2419
|
}), f(se), m == null || m([], se);
|
|
2420
2420
|
return;
|
|
2421
2421
|
}
|
|
2422
2422
|
}
|
|
2423
|
-
for (const j of
|
|
2423
|
+
for (const j of O) {
|
|
2424
2424
|
if (l && l.length > 0) {
|
|
2425
|
-
const ee = j.name.toLowerCase(),
|
|
2426
|
-
if (!l.includes(
|
|
2425
|
+
const ee = j.name.toLowerCase(), de = ee.substring(ee.lastIndexOf(".") + 1);
|
|
2426
|
+
if (!l.includes(de.toLowerCase())) {
|
|
2427
2427
|
se.push({
|
|
2428
2428
|
isValid: !1,
|
|
2429
2429
|
error: `Ekstensi file harus: ${l.join(", ")}`,
|
|
2430
2430
|
file: j
|
|
2431
|
-
}),
|
|
2431
|
+
}), W.push({
|
|
2432
2432
|
isValid: !1,
|
|
2433
2433
|
error: `Ekstensi file harus: ${l.join(", ")}`,
|
|
2434
2434
|
file: j
|
|
@@ -2442,7 +2442,7 @@ function Wr({
|
|
|
2442
2442
|
validateExtension: !0
|
|
2443
2443
|
});
|
|
2444
2444
|
if (!Q.isValid) {
|
|
2445
|
-
se.push(Q),
|
|
2445
|
+
se.push(Q), W.push(Q);
|
|
2446
2446
|
continue;
|
|
2447
2447
|
}
|
|
2448
2448
|
if (h && j.type) {
|
|
@@ -2455,7 +2455,7 @@ function Wr({
|
|
|
2455
2455
|
isValid: !1,
|
|
2456
2456
|
error: ee.error || "File signature tidak valid",
|
|
2457
2457
|
file: j
|
|
2458
|
-
}),
|
|
2458
|
+
}), W.push({
|
|
2459
2459
|
isValid: !1,
|
|
2460
2460
|
error: ee.error || "File signature tidak valid",
|
|
2461
2461
|
file: j
|
|
@@ -2463,16 +2463,16 @@ function Wr({
|
|
|
2463
2463
|
continue;
|
|
2464
2464
|
}
|
|
2465
2465
|
}
|
|
2466
|
-
|
|
2466
|
+
B.push({
|
|
2467
2467
|
file: j,
|
|
2468
2468
|
status: "idle"
|
|
2469
|
-
}),
|
|
2469
|
+
}), W.push({
|
|
2470
2470
|
isValid: !0,
|
|
2471
2471
|
file: j
|
|
2472
2472
|
});
|
|
2473
2473
|
}
|
|
2474
|
-
F(i ? (j) => [...j, ...
|
|
2475
|
-
const q = i ? [...A, ...
|
|
2474
|
+
F(i ? (j) => [...j, ...B] : B.slice(0, 1)), f(se);
|
|
2475
|
+
const q = i ? [...A, ...B].map((j) => j.file) : B.map((j) => j.file);
|
|
2476
2476
|
m == null || m(q, se);
|
|
2477
2477
|
},
|
|
2478
2478
|
[
|
|
@@ -2487,49 +2487,49 @@ function Wr({
|
|
|
2487
2487
|
h
|
|
2488
2488
|
]
|
|
2489
2489
|
), V = me(
|
|
2490
|
-
async (
|
|
2491
|
-
const
|
|
2492
|
-
await
|
|
2490
|
+
async (O) => {
|
|
2491
|
+
const W = Array.from(O.target.files || []);
|
|
2492
|
+
await P(W), E.current && (E.current.value = "");
|
|
2493
2493
|
},
|
|
2494
|
-
[
|
|
2495
|
-
),
|
|
2496
|
-
(
|
|
2497
|
-
|
|
2494
|
+
[P]
|
|
2495
|
+
), H = me(
|
|
2496
|
+
(O) => {
|
|
2497
|
+
O.preventDefault(), O.stopPropagation(), u || k(!0);
|
|
2498
2498
|
},
|
|
2499
2499
|
[u]
|
|
2500
|
-
),
|
|
2501
|
-
|
|
2502
|
-
}, []),
|
|
2503
|
-
async (
|
|
2504
|
-
var
|
|
2505
|
-
if (
|
|
2506
|
-
const
|
|
2507
|
-
await
|
|
2500
|
+
), G = me((O) => {
|
|
2501
|
+
O.preventDefault(), O.stopPropagation(), k(!1);
|
|
2502
|
+
}, []), K = me(
|
|
2503
|
+
async (O) => {
|
|
2504
|
+
var B;
|
|
2505
|
+
if (O.preventDefault(), O.stopPropagation(), k(!1), u) return;
|
|
2506
|
+
const W = Array.from(((B = O.dataTransfer) == null ? void 0 : B.files) || []);
|
|
2507
|
+
await P(W);
|
|
2508
2508
|
},
|
|
2509
|
-
[u,
|
|
2509
|
+
[u, P]
|
|
2510
2510
|
), ae = me(
|
|
2511
|
-
(
|
|
2511
|
+
(O) => {
|
|
2512
2512
|
if (u) return;
|
|
2513
|
-
const
|
|
2514
|
-
F(
|
|
2515
|
-
|
|
2513
|
+
const W = A[O], B = A.filter((se, q) => q !== O);
|
|
2514
|
+
F(B), p == null || p(W.file, O), m == null || m(
|
|
2515
|
+
B.map((se) => se.file),
|
|
2516
2516
|
_
|
|
2517
2517
|
);
|
|
2518
2518
|
},
|
|
2519
2519
|
[u, A, _, p, m]
|
|
2520
|
-
),
|
|
2521
|
-
(
|
|
2520
|
+
), ce = me(
|
|
2521
|
+
(O, W, B, se) => {
|
|
2522
2522
|
F(
|
|
2523
2523
|
(q) => q.map(
|
|
2524
|
-
(j, Q) => Q ===
|
|
2524
|
+
(j, Q) => Q === O ? { ...j, status: W, error: B, progress: se } : j
|
|
2525
2525
|
)
|
|
2526
2526
|
);
|
|
2527
2527
|
},
|
|
2528
2528
|
[]
|
|
2529
|
-
), te = S("ina-file-upload",
|
|
2529
|
+
), te = S("ina-file-upload", N, {
|
|
2530
2530
|
"ina-file-upload--disabled": u
|
|
2531
2531
|
}), X = S("ina-file-upload__dropzone", {
|
|
2532
|
-
"ina-file-upload__dropzone--drag-over":
|
|
2532
|
+
"ina-file-upload__dropzone--drag-over": C,
|
|
2533
2533
|
"ina-file-upload__dropzone--disabled": u
|
|
2534
2534
|
});
|
|
2535
2535
|
return /* @__PURE__ */ w("div", { className: te, children: [
|
|
@@ -2539,9 +2539,9 @@ function Wr({
|
|
|
2539
2539
|
{
|
|
2540
2540
|
className: X,
|
|
2541
2541
|
onClick: Y,
|
|
2542
|
-
onDragOver:
|
|
2543
|
-
onDragLeave:
|
|
2544
|
-
onDrop:
|
|
2542
|
+
onDragOver: H,
|
|
2543
|
+
onDragLeave: G,
|
|
2544
|
+
onDrop: K,
|
|
2545
2545
|
children: [
|
|
2546
2546
|
/* @__PURE__ */ n(
|
|
2547
2547
|
"input",
|
|
@@ -2552,7 +2552,7 @@ function Wr({
|
|
|
2552
2552
|
accept: r,
|
|
2553
2553
|
multiple: i,
|
|
2554
2554
|
disabled: u,
|
|
2555
|
-
className: S("ina-file-upload__input",
|
|
2555
|
+
className: S("ina-file-upload__input", N),
|
|
2556
2556
|
onChange: V
|
|
2557
2557
|
}
|
|
2558
2558
|
),
|
|
@@ -2568,8 +2568,8 @@ function Wr({
|
|
|
2568
2568
|
type: "button",
|
|
2569
2569
|
className: "ina-file-upload__button",
|
|
2570
2570
|
disabled: u,
|
|
2571
|
-
onClick: (
|
|
2572
|
-
|
|
2571
|
+
onClick: (O) => {
|
|
2572
|
+
O.stopPropagation(), Y();
|
|
2573
2573
|
},
|
|
2574
2574
|
children: "Pilih File"
|
|
2575
2575
|
}
|
|
@@ -2579,45 +2579,45 @@ function Wr({
|
|
|
2579
2579
|
}
|
|
2580
2580
|
),
|
|
2581
2581
|
A.length > 0 && /* @__PURE__ */ w(Ye, { children: [
|
|
2582
|
-
/* @__PURE__ */ n("div", { className: "ina-file-upload__files", children: (i && A.length > 5 && !T ? A.slice(0, 5) : A).map((
|
|
2583
|
-
const
|
|
2584
|
-
(
|
|
2582
|
+
/* @__PURE__ */ n("div", { className: "ina-file-upload__files", children: (i && A.length > 5 && !T ? A.slice(0, 5) : A).map((O) => {
|
|
2583
|
+
const W = A.findIndex(
|
|
2584
|
+
(B) => B.file.name === O.file.name && B.file.size === O.file.size && B.status === O.status
|
|
2585
2585
|
);
|
|
2586
2586
|
return /* @__PURE__ */ w(
|
|
2587
2587
|
"div",
|
|
2588
2588
|
{
|
|
2589
2589
|
className: S("ina-file-upload__file", {
|
|
2590
|
-
"ina-file-upload__file--error":
|
|
2591
|
-
"ina-file-upload__file--success":
|
|
2592
|
-
"ina-file-upload__file--uploading":
|
|
2590
|
+
"ina-file-upload__file--error": O.status === "error",
|
|
2591
|
+
"ina-file-upload__file--success": O.status === "success",
|
|
2592
|
+
"ina-file-upload__file--uploading": O.status === "uploading"
|
|
2593
2593
|
}),
|
|
2594
2594
|
children: [
|
|
2595
2595
|
/* @__PURE__ */ w("div", { className: "ina-file-upload__file-indicator", children: [
|
|
2596
|
-
|
|
2596
|
+
O.status === "uploading" && /* @__PURE__ */ n("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--uploading", children: /* @__PURE__ */ n(
|
|
2597
2597
|
xt,
|
|
2598
2598
|
{
|
|
2599
2599
|
size: 20,
|
|
2600
2600
|
className: "ina-file-upload__file-icon--spinning"
|
|
2601
2601
|
}
|
|
2602
2602
|
) }),
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2603
|
+
O.status === "success" && /* @__PURE__ */ n("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--success", children: /* @__PURE__ */ n(Dt, { size: 20, stroke: "2" }) }),
|
|
2604
|
+
O.status === "error" && /* @__PURE__ */ n("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--error", children: /* @__PURE__ */ n(dn, { size: 20, stroke: "2" }) }),
|
|
2605
|
+
O.status === "idle" && /* @__PURE__ */ n("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--success", children: /* @__PURE__ */ n(Dt, { size: 20, stroke: "2" }) })
|
|
2606
2606
|
] }),
|
|
2607
2607
|
/* @__PURE__ */ w("div", { className: "ina-file-upload__file-info", children: [
|
|
2608
|
-
/* @__PURE__ */ n("div", { className: "ina-file-upload__file-name", children: dt(
|
|
2609
|
-
/* @__PURE__ */ n("div", { className: "ina-file-upload__file-size", children: an(
|
|
2610
|
-
|
|
2608
|
+
/* @__PURE__ */ n("div", { className: "ina-file-upload__file-name", children: dt(O.file.name) }),
|
|
2609
|
+
/* @__PURE__ */ n("div", { className: "ina-file-upload__file-size", children: an(O.file.size) }),
|
|
2610
|
+
O.error && /* @__PURE__ */ n("div", { className: "ina-file-upload__file-error", children: O.error })
|
|
2611
2611
|
] }),
|
|
2612
2612
|
/* @__PURE__ */ w("div", { className: "ina-file-upload__file-actions", children: [
|
|
2613
|
-
|
|
2613
|
+
O.status === "error" && /* @__PURE__ */ w(Ye, { children: [
|
|
2614
2614
|
/* @__PURE__ */ n(
|
|
2615
2615
|
"button",
|
|
2616
2616
|
{
|
|
2617
2617
|
type: "button",
|
|
2618
2618
|
className: "ina-file-upload__file-retry",
|
|
2619
2619
|
onClick: () => {
|
|
2620
|
-
|
|
2620
|
+
ce(W, "idle");
|
|
2621
2621
|
},
|
|
2622
2622
|
title: "Coba lagi",
|
|
2623
2623
|
children: /* @__PURE__ */ n(xt, { size: 20 })
|
|
@@ -2628,38 +2628,38 @@ function Wr({
|
|
|
2628
2628
|
{
|
|
2629
2629
|
type: "button",
|
|
2630
2630
|
className: "ina-file-upload__file-remove",
|
|
2631
|
-
onClick: () => ae(
|
|
2631
|
+
onClick: () => ae(W),
|
|
2632
2632
|
title: "Hapus file",
|
|
2633
2633
|
children: /* @__PURE__ */ n(ot, { size: 20 })
|
|
2634
2634
|
}
|
|
2635
2635
|
)
|
|
2636
2636
|
] }),
|
|
2637
|
-
|
|
2637
|
+
O.status === "uploading" && /* @__PURE__ */ n(
|
|
2638
2638
|
"button",
|
|
2639
2639
|
{
|
|
2640
2640
|
type: "button",
|
|
2641
2641
|
className: "ina-file-upload__file-remove",
|
|
2642
|
-
onClick: () => ae(
|
|
2642
|
+
onClick: () => ae(W),
|
|
2643
2643
|
title: "Batalkan upload",
|
|
2644
2644
|
children: /* @__PURE__ */ n(Te, { size: 20 })
|
|
2645
2645
|
}
|
|
2646
2646
|
),
|
|
2647
|
-
|
|
2647
|
+
O.status === "success" && /* @__PURE__ */ n(
|
|
2648
2648
|
"button",
|
|
2649
2649
|
{
|
|
2650
2650
|
type: "button",
|
|
2651
2651
|
className: "ina-file-upload__file-remove",
|
|
2652
|
-
onClick: () => ae(
|
|
2652
|
+
onClick: () => ae(W),
|
|
2653
2653
|
title: "Hapus file",
|
|
2654
2654
|
children: /* @__PURE__ */ n(ot, { size: 20 })
|
|
2655
2655
|
}
|
|
2656
2656
|
),
|
|
2657
|
-
|
|
2657
|
+
O.status === "idle" && /* @__PURE__ */ n(
|
|
2658
2658
|
"button",
|
|
2659
2659
|
{
|
|
2660
2660
|
type: "button",
|
|
2661
2661
|
className: "ina-file-upload__file-remove",
|
|
2662
|
-
onClick: () => ae(
|
|
2662
|
+
onClick: () => ae(W),
|
|
2663
2663
|
title: "Hapus file",
|
|
2664
2664
|
children: /* @__PURE__ */ n(ot, { size: 20 })
|
|
2665
2665
|
}
|
|
@@ -2667,7 +2667,7 @@ function Wr({
|
|
|
2667
2667
|
] })
|
|
2668
2668
|
]
|
|
2669
2669
|
},
|
|
2670
|
-
`${
|
|
2670
|
+
`${O.file.name}-${W}`
|
|
2671
2671
|
);
|
|
2672
2672
|
}) }),
|
|
2673
2673
|
i && A.length > 5 && /* @__PURE__ */ w(
|
|
@@ -2705,11 +2705,11 @@ function Wr({
|
|
|
2705
2705
|
}
|
|
2706
2706
|
)
|
|
2707
2707
|
] }),
|
|
2708
|
-
_.length > 0 && /* @__PURE__ */ n("div", { className: "ina-file-upload__errors", children: _.map((
|
|
2709
|
-
dt(
|
|
2708
|
+
_.length > 0 && /* @__PURE__ */ n("div", { className: "ina-file-upload__errors", children: _.map((O, W) => /* @__PURE__ */ w("div", { className: "ina-file-upload__error-message", children: [
|
|
2709
|
+
dt(O.file.name),
|
|
2710
2710
|
": ",
|
|
2711
|
-
|
|
2712
|
-
] },
|
|
2711
|
+
O.error
|
|
2712
|
+
] }, W)) })
|
|
2713
2713
|
] });
|
|
2714
2714
|
}
|
|
2715
2715
|
const un = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
@@ -2788,39 +2788,39 @@ function jr({
|
|
|
2788
2788
|
progress: b,
|
|
2789
2789
|
status: h,
|
|
2790
2790
|
onChange: u,
|
|
2791
|
-
onRemove:
|
|
2791
|
+
onRemove: N,
|
|
2792
2792
|
...m
|
|
2793
2793
|
}) {
|
|
2794
|
-
const p = le(null), [I, E] = Z(null), [A, F] = Z(0), [
|
|
2795
|
-
var
|
|
2796
|
-
l || I || (
|
|
2797
|
-
}, [l, I]),
|
|
2798
|
-
async (
|
|
2794
|
+
const p = le(null), [I, E] = Z(null), [A, F] = Z(0), [C, k] = Z("idle"), [_, f] = Z(!1), T = b !== void 0 ? b : A, $ = h !== void 0 ? h : C, Y = me(() => {
|
|
2795
|
+
var W;
|
|
2796
|
+
l || I || (W = p.current) == null || W.click();
|
|
2797
|
+
}, [l, I]), P = me(
|
|
2798
|
+
async (W) => {
|
|
2799
2799
|
var j;
|
|
2800
|
-
const
|
|
2801
|
-
if (!
|
|
2802
|
-
if (dt(
|
|
2800
|
+
const B = (j = W.target.files) == null ? void 0 : j[0];
|
|
2801
|
+
if (!B) return;
|
|
2802
|
+
if (dt(B.name) !== B.name) {
|
|
2803
2803
|
const Q = {
|
|
2804
2804
|
isValid: !1,
|
|
2805
2805
|
error: "Nama file mengandung karakter yang tidak diizinkan",
|
|
2806
|
-
file:
|
|
2806
|
+
file: B
|
|
2807
2807
|
};
|
|
2808
2808
|
E(null), k("error"), u == null || u(null, Q), p.current && (p.current.value = "");
|
|
2809
2809
|
return;
|
|
2810
2810
|
}
|
|
2811
2811
|
if (i && i.length > 0) {
|
|
2812
|
-
const Q =
|
|
2812
|
+
const Q = B.name.toLowerCase(), ee = Q.substring(Q.lastIndexOf(".") + 1);
|
|
2813
2813
|
if (!i.includes(ee.toLowerCase())) {
|
|
2814
|
-
const
|
|
2814
|
+
const de = {
|
|
2815
2815
|
isValid: !1,
|
|
2816
2816
|
error: `Ekstensi file harus: ${i.join(", ")}`,
|
|
2817
|
-
file:
|
|
2817
|
+
file: B
|
|
2818
2818
|
};
|
|
2819
|
-
E(null), k("error"), u == null || u(null,
|
|
2819
|
+
E(null), k("error"), u == null || u(null, de), p.current && (p.current.value = "");
|
|
2820
2820
|
return;
|
|
2821
2821
|
}
|
|
2822
2822
|
}
|
|
2823
|
-
const q = Ct(
|
|
2823
|
+
const q = Ct(B, {
|
|
2824
2824
|
allowedTypes: t || void 0,
|
|
2825
2825
|
maxSize: r || void 0,
|
|
2826
2826
|
validateExtension: !0
|
|
@@ -2829,70 +2829,70 @@ function jr({
|
|
|
2829
2829
|
E(null), k("error"), u == null || u(null, q), p.current && (p.current.value = "");
|
|
2830
2830
|
return;
|
|
2831
2831
|
}
|
|
2832
|
-
if (s &&
|
|
2832
|
+
if (s && B.type) {
|
|
2833
2833
|
const Q = await Mt(
|
|
2834
|
-
|
|
2835
|
-
|
|
2834
|
+
B,
|
|
2835
|
+
B.type
|
|
2836
2836
|
);
|
|
2837
2837
|
if (!Q.isValid) {
|
|
2838
2838
|
const ee = {
|
|
2839
2839
|
isValid: !1,
|
|
2840
2840
|
error: Q.error || "File signature tidak valid",
|
|
2841
|
-
file:
|
|
2841
|
+
file: B
|
|
2842
2842
|
};
|
|
2843
2843
|
E(null), k("error"), u == null || u(null, ee), p.current && (p.current.value = "");
|
|
2844
2844
|
return;
|
|
2845
2845
|
}
|
|
2846
2846
|
}
|
|
2847
|
-
E(
|
|
2847
|
+
E(B), k("success"), u == null || u(B, null), p.current && (p.current.value = "");
|
|
2848
2848
|
},
|
|
2849
2849
|
[t, r, i, s, u]
|
|
2850
2850
|
), V = me(() => {
|
|
2851
|
-
E(null), F(0), k("idle"), f(!1), p.current && (p.current.value = ""),
|
|
2852
|
-
}, [
|
|
2851
|
+
E(null), F(0), k("idle"), f(!1), p.current && (p.current.value = ""), N == null || N(), u == null || u(null, null);
|
|
2852
|
+
}, [N, u]), H = me(() => {
|
|
2853
2853
|
l || I || Y();
|
|
2854
|
-
}, [l, I, Y]),
|
|
2854
|
+
}, [l, I, Y]), G = me(() => {
|
|
2855
2855
|
l || I || f(!0);
|
|
2856
|
-
}, [l, I]),
|
|
2856
|
+
}, [l, I]), K = me(() => {
|
|
2857
2857
|
f(!1);
|
|
2858
2858
|
}, []), ae = me(
|
|
2859
|
-
(
|
|
2860
|
-
l || I || (
|
|
2859
|
+
(W) => {
|
|
2860
|
+
l || I || (W.preventDefault(), W.stopPropagation(), f(!0));
|
|
2861
2861
|
},
|
|
2862
2862
|
[l, I]
|
|
2863
|
-
),
|
|
2864
|
-
(
|
|
2865
|
-
l || I || (
|
|
2863
|
+
), ce = me(
|
|
2864
|
+
(W) => {
|
|
2865
|
+
l || I || (W.preventDefault(), W.stopPropagation(), f(!1));
|
|
2866
2866
|
},
|
|
2867
2867
|
[l, I]
|
|
2868
2868
|
), te = me(
|
|
2869
|
-
async (
|
|
2869
|
+
async (W) => {
|
|
2870
2870
|
if (l || I) return;
|
|
2871
|
-
|
|
2872
|
-
const
|
|
2873
|
-
if (!
|
|
2874
|
-
if (dt(
|
|
2871
|
+
W.preventDefault(), W.stopPropagation(), f(!1);
|
|
2872
|
+
const B = W.dataTransfer.files[0];
|
|
2873
|
+
if (!B) return;
|
|
2874
|
+
if (dt(B.name) !== B.name) {
|
|
2875
2875
|
const j = {
|
|
2876
2876
|
isValid: !1,
|
|
2877
2877
|
error: "Nama file mengandung karakter yang tidak diizinkan",
|
|
2878
|
-
file:
|
|
2878
|
+
file: B
|
|
2879
2879
|
};
|
|
2880
2880
|
E(null), k("error"), u == null || u(null, j);
|
|
2881
2881
|
return;
|
|
2882
2882
|
}
|
|
2883
2883
|
if (i && i.length > 0) {
|
|
2884
|
-
const j =
|
|
2884
|
+
const j = B.name.toLowerCase(), Q = j.substring(j.lastIndexOf(".") + 1);
|
|
2885
2885
|
if (!i.includes(Q.toLowerCase())) {
|
|
2886
2886
|
const ee = {
|
|
2887
2887
|
isValid: !1,
|
|
2888
2888
|
error: `Ekstensi file harus: ${i.join(", ")}`,
|
|
2889
|
-
file:
|
|
2889
|
+
file: B
|
|
2890
2890
|
};
|
|
2891
2891
|
E(null), k("error"), u == null || u(null, ee);
|
|
2892
2892
|
return;
|
|
2893
2893
|
}
|
|
2894
2894
|
}
|
|
2895
|
-
const q = Ct(
|
|
2895
|
+
const q = Ct(B, {
|
|
2896
2896
|
allowedTypes: t || void 0,
|
|
2897
2897
|
maxSize: r || void 0,
|
|
2898
2898
|
validateExtension: !0
|
|
@@ -2901,22 +2901,22 @@ function jr({
|
|
|
2901
2901
|
E(null), k("error"), u == null || u(null, q);
|
|
2902
2902
|
return;
|
|
2903
2903
|
}
|
|
2904
|
-
if (s &&
|
|
2904
|
+
if (s && B.type) {
|
|
2905
2905
|
const j = await Mt(
|
|
2906
|
-
|
|
2907
|
-
|
|
2906
|
+
B,
|
|
2907
|
+
B.type
|
|
2908
2908
|
);
|
|
2909
2909
|
if (!j.isValid) {
|
|
2910
2910
|
const Q = {
|
|
2911
2911
|
isValid: !1,
|
|
2912
2912
|
error: j.error || "File signature tidak valid",
|
|
2913
|
-
file:
|
|
2913
|
+
file: B
|
|
2914
2914
|
};
|
|
2915
2915
|
E(null), k("error"), u == null || u(null, Q);
|
|
2916
2916
|
return;
|
|
2917
2917
|
}
|
|
2918
2918
|
}
|
|
2919
|
-
E(
|
|
2919
|
+
E(B), k("success"), u == null || u(B, null);
|
|
2920
2920
|
},
|
|
2921
2921
|
[
|
|
2922
2922
|
l,
|
|
@@ -2929,9 +2929,9 @@ function jr({
|
|
|
2929
2929
|
]
|
|
2930
2930
|
), X = () => {
|
|
2931
2931
|
if (!I) return null;
|
|
2932
|
-
const
|
|
2933
|
-
return
|
|
2934
|
-
},
|
|
2932
|
+
const W = I.type, B = I.name.toLowerCase();
|
|
2933
|
+
return W === "application/pdf" || B.endsWith(".pdf") ? /* @__PURE__ */ n(fn, { size: 16 }) : W.startsWith("image/") ? /* @__PURE__ */ n(pn, { size: 16 }) : /* @__PURE__ */ n(un, { size: 16 });
|
|
2934
|
+
}, O = S("ina-single-file-upload__container", {
|
|
2935
2935
|
"ina-single-file-upload__container--active": _ && !l && !I,
|
|
2936
2936
|
"ina-single-file-upload__container--disabled": l
|
|
2937
2937
|
});
|
|
@@ -2945,18 +2945,18 @@ function jr({
|
|
|
2945
2945
|
accept: t,
|
|
2946
2946
|
disabled: l,
|
|
2947
2947
|
className: S("ina-single-file-upload__input", c),
|
|
2948
|
-
onChange:
|
|
2948
|
+
onChange: P
|
|
2949
2949
|
}
|
|
2950
2950
|
),
|
|
2951
2951
|
/* @__PURE__ */ w(
|
|
2952
2952
|
"div",
|
|
2953
2953
|
{
|
|
2954
|
-
className:
|
|
2955
|
-
onClick:
|
|
2956
|
-
onFocus:
|
|
2957
|
-
onBlur:
|
|
2954
|
+
className: O,
|
|
2955
|
+
onClick: H,
|
|
2956
|
+
onFocus: G,
|
|
2957
|
+
onBlur: K,
|
|
2958
2958
|
onDragOver: ae,
|
|
2959
|
-
onDragLeave:
|
|
2959
|
+
onDragLeave: ce,
|
|
2960
2960
|
onDrop: te,
|
|
2961
2961
|
tabIndex: l || I ? -1 : 0,
|
|
2962
2962
|
role: "button",
|
|
@@ -2997,8 +2997,8 @@ function jr({
|
|
|
2997
2997
|
{
|
|
2998
2998
|
type: "button",
|
|
2999
2999
|
className: "ina-single-file-upload__delete-button",
|
|
3000
|
-
onClick: (
|
|
3001
|
-
|
|
3000
|
+
onClick: (W) => {
|
|
3001
|
+
W.stopPropagation(), V();
|
|
3002
3002
|
},
|
|
3003
3003
|
"aria-label": "Remove file",
|
|
3004
3004
|
children: /* @__PURE__ */ n(ot, { size: 18 })
|
|
@@ -3103,58 +3103,58 @@ const mn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
3103
3103
|
}
|
|
3104
3104
|
);
|
|
3105
3105
|
function hn(e, a, t, r) {
|
|
3106
|
-
var i = this, s = le(null), l = le(0), c = le(0), b = le(null), h = le([]), u = le(),
|
|
3106
|
+
var i = this, s = le(null), l = le(0), c = le(0), b = le(null), h = le([]), u = le(), N = le(), m = le(e), p = le(!0), I = le(), E = le();
|
|
3107
3107
|
m.current = e;
|
|
3108
3108
|
var A = typeof window < "u", F = !a && a !== 0 && A;
|
|
3109
3109
|
if (typeof e != "function") throw new TypeError("Expected a function");
|
|
3110
3110
|
a = +a || 0;
|
|
3111
|
-
var
|
|
3112
|
-
var
|
|
3113
|
-
var X = h.current,
|
|
3114
|
-
return h.current = u.current = null, l.current = te, c.current = c.current || te,
|
|
3111
|
+
var C = !!(t = t || {}).leading, k = !("trailing" in t) || !!t.trailing, _ = !!t.flushOnExit && k, f = "maxWait" in t, T = "debounceOnServer" in t && !!t.debounceOnServer, $ = f ? Math.max(+t.maxWait || 0, a) : null, Y = Fe(function() {
|
|
3112
|
+
var P = function(te) {
|
|
3113
|
+
var X = h.current, O = u.current;
|
|
3114
|
+
return h.current = u.current = null, l.current = te, c.current = c.current || te, N.current = m.current.apply(O, X);
|
|
3115
3115
|
}, V = function(te, X) {
|
|
3116
3116
|
F && cancelAnimationFrame(b.current), b.current = F ? requestAnimationFrame(te) : setTimeout(te, X);
|
|
3117
|
-
},
|
|
3117
|
+
}, H = function(te) {
|
|
3118
3118
|
if (!p.current) return !1;
|
|
3119
3119
|
var X = te - s.current;
|
|
3120
3120
|
return !s.current || X >= a || X < 0 || f && te - l.current >= $;
|
|
3121
|
-
},
|
|
3122
|
-
return b.current = null, k && h.current ?
|
|
3123
|
-
},
|
|
3121
|
+
}, G = function(te) {
|
|
3122
|
+
return b.current = null, k && h.current ? P(te) : (h.current = u.current = null, N.current);
|
|
3123
|
+
}, K = function te() {
|
|
3124
3124
|
var X = Date.now();
|
|
3125
|
-
if (
|
|
3125
|
+
if (C && c.current === l.current && ae(), H(X)) return G(X);
|
|
3126
3126
|
if (p.current) {
|
|
3127
|
-
var
|
|
3128
|
-
V(te,
|
|
3127
|
+
var O = a - (X - s.current), W = f ? Math.min(O, $ - (X - l.current)) : O;
|
|
3128
|
+
V(te, W);
|
|
3129
3129
|
}
|
|
3130
3130
|
}, ae = function() {
|
|
3131
3131
|
r && r({});
|
|
3132
|
-
},
|
|
3132
|
+
}, ce = function() {
|
|
3133
3133
|
if (A || T) {
|
|
3134
|
-
var te, X = Date.now(),
|
|
3134
|
+
var te, X = Date.now(), O = H(X);
|
|
3135
3135
|
if (h.current = [].slice.call(arguments), u.current = i, s.current = X, _ && !I.current && (I.current = function() {
|
|
3136
|
-
var
|
|
3137
|
-
((
|
|
3138
|
-
}, (te = global.document) == null || te.addEventListener == null || te.addEventListener("visibilitychange", I.current)),
|
|
3139
|
-
if (!b.current && p.current) return l.current = s.current, V(
|
|
3140
|
-
if (f) return V(
|
|
3136
|
+
var W;
|
|
3137
|
+
((W = global.document) == null ? void 0 : W.visibilityState) === "hidden" && E.current.flush();
|
|
3138
|
+
}, (te = global.document) == null || te.addEventListener == null || te.addEventListener("visibilitychange", I.current)), O) {
|
|
3139
|
+
if (!b.current && p.current) return l.current = s.current, V(K, a), C ? P(s.current) : N.current;
|
|
3140
|
+
if (f) return V(K, a), P(s.current);
|
|
3141
3141
|
}
|
|
3142
|
-
return b.current || V(
|
|
3142
|
+
return b.current || V(K, a), N.current;
|
|
3143
3143
|
}
|
|
3144
3144
|
};
|
|
3145
|
-
return
|
|
3145
|
+
return ce.cancel = function() {
|
|
3146
3146
|
var te = b.current;
|
|
3147
3147
|
te && (F ? cancelAnimationFrame(b.current) : clearTimeout(b.current)), l.current = 0, h.current = s.current = u.current = b.current = null, te && r && r({});
|
|
3148
|
-
},
|
|
3148
|
+
}, ce.isPending = function() {
|
|
3149
3149
|
return !!b.current;
|
|
3150
|
-
},
|
|
3151
|
-
return b.current ?
|
|
3152
|
-
},
|
|
3153
|
-
}, [
|
|
3150
|
+
}, ce.flush = function() {
|
|
3151
|
+
return b.current ? G(Date.now()) : N.current;
|
|
3152
|
+
}, ce;
|
|
3153
|
+
}, [C, f, a, $, k, _, F, A, T, r]);
|
|
3154
3154
|
return E.current = Y, oe(function() {
|
|
3155
3155
|
return p.current = !0, function() {
|
|
3156
|
-
var
|
|
3157
|
-
_ && E.current.flush(), I.current && ((
|
|
3156
|
+
var P;
|
|
3157
|
+
_ && E.current.flush(), I.current && ((P = global.document) == null || P.removeEventListener == null || P.removeEventListener("visibilitychange", I.current), I.current = null), p.current = !1;
|
|
3158
3158
|
};
|
|
3159
3159
|
}, [_]), Y;
|
|
3160
3160
|
}
|
|
@@ -3223,14 +3223,14 @@ function es({
|
|
|
3223
3223
|
debounce: b = 0,
|
|
3224
3224
|
disabled: h = !1
|
|
3225
3225
|
}) {
|
|
3226
|
-
const [u,
|
|
3227
|
-
const { value: k } =
|
|
3228
|
-
gn(k) || k === "" ?
|
|
3226
|
+
const [u, N] = Z(t), [m] = ht(u, b), p = (C) => {
|
|
3227
|
+
const { value: k } = C.target;
|
|
3228
|
+
gn(k) || k === "" ? N(k) : C.preventDefault();
|
|
3229
3229
|
};
|
|
3230
3230
|
oe(() => {
|
|
3231
3231
|
i && i(m);
|
|
3232
3232
|
}, [m, i]), oe(() => {
|
|
3233
|
-
|
|
3233
|
+
N(t || "");
|
|
3234
3234
|
}, [t]);
|
|
3235
3235
|
const I = le(null), E = S("ina-input-search"), A = S(
|
|
3236
3236
|
"ina-input-search__wrapper",
|
|
@@ -3278,7 +3278,7 @@ function es({
|
|
|
3278
3278
|
{
|
|
3279
3279
|
className: F,
|
|
3280
3280
|
onClick: () => {
|
|
3281
|
-
|
|
3281
|
+
N(""), I.current && I.current.focus();
|
|
3282
3282
|
},
|
|
3283
3283
|
children: /* @__PURE__ */ n(Te, { size: 20 })
|
|
3284
3284
|
}
|
|
@@ -3296,76 +3296,77 @@ function yn({
|
|
|
3296
3296
|
dialogClassname: l,
|
|
3297
3297
|
size: c = "",
|
|
3298
3298
|
paddingBody: b = "16px 24px",
|
|
3299
|
-
closeLabel: h = "Tutup dialog"
|
|
3299
|
+
closeLabel: h = "Tutup dialog",
|
|
3300
|
+
hideHeader: u = !1
|
|
3300
3301
|
}) {
|
|
3301
|
-
const [
|
|
3302
|
-
if (oe(() =>
|
|
3302
|
+
const [N, m] = Z(!1), [p, I] = Z(!1), [E, A] = Z(!1), F = le(null), C = le(`modal-title-${Math.random().toString(36).slice(2)}`), k = le(null), _ = le(!1);
|
|
3303
|
+
if (oe(() => m(!0), []), oe(() => {
|
|
3303
3304
|
if (e)
|
|
3304
|
-
|
|
3305
|
+
I(!0), k.current = document.activeElement, requestAnimationFrame(() => {
|
|
3305
3306
|
requestAnimationFrame(() => {
|
|
3306
|
-
|
|
3307
|
+
A(!0);
|
|
3307
3308
|
});
|
|
3308
3309
|
});
|
|
3309
3310
|
else {
|
|
3310
|
-
|
|
3311
|
-
const
|
|
3312
|
-
|
|
3311
|
+
A(!1), k.current && (k.current.focus(), k.current = null);
|
|
3312
|
+
const V = setTimeout(() => {
|
|
3313
|
+
I(!1);
|
|
3313
3314
|
}, 300);
|
|
3314
|
-
return () => clearTimeout(
|
|
3315
|
+
return () => clearTimeout(V);
|
|
3315
3316
|
}
|
|
3316
3317
|
}, [e]), oe(() => {
|
|
3317
|
-
if (
|
|
3318
|
-
const
|
|
3318
|
+
if (N && p) {
|
|
3319
|
+
const V = document.documentElement.style.overflow;
|
|
3319
3320
|
return document.documentElement.style.overflow = "hidden", () => {
|
|
3320
|
-
document.documentElement.style.overflow =
|
|
3321
|
+
document.documentElement.style.overflow = V;
|
|
3321
3322
|
};
|
|
3322
3323
|
}
|
|
3323
|
-
}, [
|
|
3324
|
-
if (!
|
|
3325
|
-
const
|
|
3326
|
-
if (
|
|
3324
|
+
}, [p, N]), oe(() => {
|
|
3325
|
+
if (!p || !N) return;
|
|
3326
|
+
const V = (H) => {
|
|
3327
|
+
if (H.key === "Escape" && E) {
|
|
3327
3328
|
a();
|
|
3328
3329
|
return;
|
|
3329
3330
|
}
|
|
3330
|
-
if (
|
|
3331
|
+
if (H.key === "Tab" && E) {
|
|
3331
3332
|
const G = document.querySelector(".ina-modal__dialog");
|
|
3332
3333
|
if (!G) return;
|
|
3333
|
-
const
|
|
3334
|
+
const K = G.querySelectorAll(
|
|
3334
3335
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
3335
3336
|
);
|
|
3336
|
-
if (
|
|
3337
|
-
const
|
|
3338
|
-
|
|
3337
|
+
if (K.length === 0) return;
|
|
3338
|
+
const ae = K[0], ce = K[K.length - 1];
|
|
3339
|
+
H.shiftKey ? document.activeElement === ae && (H.preventDefault(), ce.focus()) : document.activeElement === ce && (H.preventDefault(), ae.focus());
|
|
3339
3340
|
}
|
|
3340
3341
|
};
|
|
3341
|
-
return document.addEventListener("keydown",
|
|
3342
|
-
}, [
|
|
3343
|
-
if (
|
|
3344
|
-
const
|
|
3345
|
-
var
|
|
3346
|
-
(
|
|
3342
|
+
return document.addEventListener("keydown", V), () => document.removeEventListener("keydown", V);
|
|
3343
|
+
}, [p, E, N, a]), oe(() => {
|
|
3344
|
+
if (E && !_.current) {
|
|
3345
|
+
const V = setTimeout(() => {
|
|
3346
|
+
var H;
|
|
3347
|
+
(H = F.current) == null || H.focus(), _.current = !0;
|
|
3347
3348
|
}, 50);
|
|
3348
|
-
return () => clearTimeout(
|
|
3349
|
+
return () => clearTimeout(V);
|
|
3349
3350
|
}
|
|
3350
|
-
e || (
|
|
3351
|
-
}, [
|
|
3352
|
-
const
|
|
3351
|
+
e || (_.current = !1);
|
|
3352
|
+
}, [E, e]), !p || !N) return null;
|
|
3353
|
+
const f = s ?? document.body, T = S(
|
|
3353
3354
|
"ina-modal",
|
|
3354
|
-
|
|
3355
|
-
),
|
|
3355
|
+
E ? "ina-modal--enter-active" : "ina-modal--enter"
|
|
3356
|
+
), $ = S(
|
|
3356
3357
|
"ina-modal__dialog",
|
|
3357
3358
|
c && `ina-modal__dialog--size-${c}`,
|
|
3358
3359
|
l
|
|
3359
|
-
),
|
|
3360
|
+
), Y = S(
|
|
3360
3361
|
"ina-modal__header",
|
|
3361
3362
|
t ? "ina-modal__header--with-title" : "ina-modal__header--no-border"
|
|
3362
|
-
),
|
|
3363
|
+
), P = /* @__PURE__ */ w(
|
|
3363
3364
|
"div",
|
|
3364
3365
|
{
|
|
3365
|
-
className:
|
|
3366
|
+
className: T,
|
|
3366
3367
|
role: "dialog",
|
|
3367
3368
|
"aria-modal": "true",
|
|
3368
|
-
"aria-labelledby": t && typeof t == "string" ?
|
|
3369
|
+
"aria-labelledby": t && typeof t == "string" ? C.current : void 0,
|
|
3369
3370
|
children: [
|
|
3370
3371
|
/* @__PURE__ */ n(
|
|
3371
3372
|
"div",
|
|
@@ -3379,16 +3380,16 @@ function yn({
|
|
|
3379
3380
|
/* @__PURE__ */ n("div", { className: "ina-modal__container", children: /* @__PURE__ */ w(
|
|
3380
3381
|
"div",
|
|
3381
3382
|
{
|
|
3382
|
-
className:
|
|
3383
|
-
onClick: (
|
|
3383
|
+
className: $,
|
|
3384
|
+
onClick: (V) => V.stopPropagation(),
|
|
3384
3385
|
tabIndex: -1,
|
|
3385
3386
|
children: [
|
|
3386
|
-
/* @__PURE__ */ w("div", { className:
|
|
3387
|
-
t && /* @__PURE__ */ n("div", { className: "ina-modal__title", children: typeof t == "string" ? /* @__PURE__ */ n("h2", { id:
|
|
3387
|
+
!u && /* @__PURE__ */ w("div", { className: Y, children: [
|
|
3388
|
+
t && /* @__PURE__ */ n("div", { className: "ina-modal__title", children: typeof t == "string" ? /* @__PURE__ */ n("h2", { id: C.current, children: t }) : t }),
|
|
3388
3389
|
/* @__PURE__ */ n(
|
|
3389
3390
|
"button",
|
|
3390
3391
|
{
|
|
3391
|
-
ref:
|
|
3392
|
+
ref: F,
|
|
3392
3393
|
onClick: a,
|
|
3393
3394
|
"aria-label": h,
|
|
3394
3395
|
className: "ina-modal__close-button",
|
|
@@ -3403,7 +3404,7 @@ function yn({
|
|
|
3403
3404
|
]
|
|
3404
3405
|
}
|
|
3405
3406
|
);
|
|
3406
|
-
return Lt(
|
|
3407
|
+
return Lt(P, f);
|
|
3407
3408
|
}
|
|
3408
3409
|
const ut = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
3409
3410
|
"svg",
|
|
@@ -3474,13 +3475,13 @@ function wn({
|
|
|
3474
3475
|
className: b,
|
|
3475
3476
|
...h
|
|
3476
3477
|
}) {
|
|
3477
|
-
const [u,
|
|
3478
|
+
const [u, N] = Z(e.toString());
|
|
3478
3479
|
oe(() => {
|
|
3479
|
-
|
|
3480
|
+
N(e.toString());
|
|
3480
3481
|
}, [e]);
|
|
3481
3482
|
const m = () => {
|
|
3482
3483
|
let f = parseInt(u, 10);
|
|
3483
|
-
isNaN(f) || f < 1 ? f = 1 : f > a && (f = a),
|
|
3484
|
+
isNaN(f) || f < 1 ? f = 1 : f > a && (f = a), N(f.toString()), f !== e && !l && i(f);
|
|
3484
3485
|
};
|
|
3485
3486
|
if (a <= 0) return null;
|
|
3486
3487
|
function p() {
|
|
@@ -3516,7 +3517,7 @@ function wn({
|
|
|
3516
3517
|
f.preventDefault(), !l && e > 1 && i(e - 1);
|
|
3517
3518
|
}, F = (f) => {
|
|
3518
3519
|
f.preventDefault(), !l && e < a && i(e + 1);
|
|
3519
|
-
},
|
|
3520
|
+
}, C = (f) => {
|
|
3520
3521
|
f.preventDefault(), !l && e < a && i(a);
|
|
3521
3522
|
}, k = (f) => {
|
|
3522
3523
|
const T = parseInt(f.target.value, 10);
|
|
@@ -3536,7 +3537,7 @@ function wn({
|
|
|
3536
3537
|
min: 1,
|
|
3537
3538
|
max: a,
|
|
3538
3539
|
value: u,
|
|
3539
|
-
onChange: (f) =>
|
|
3540
|
+
onChange: (f) => N(f.target.value),
|
|
3540
3541
|
onBlur: m,
|
|
3541
3542
|
onKeyDown: (f) => {
|
|
3542
3543
|
f.key === "Enter" && m();
|
|
@@ -3571,8 +3572,8 @@ function wn({
|
|
|
3571
3572
|
);
|
|
3572
3573
|
if (Y >= 0) {
|
|
3573
3574
|
f.preventDefault();
|
|
3574
|
-
const
|
|
3575
|
-
(T = $[
|
|
3575
|
+
const P = f.key === "ArrowRight" ? (Y + 1) % $.length : (Y - 1 + $.length) % $.length;
|
|
3576
|
+
(T = $[P]) == null || T.focus();
|
|
3576
3577
|
}
|
|
3577
3578
|
} else if (f.key === "Enter" || f.key === " ") {
|
|
3578
3579
|
const $ = document.activeElement;
|
|
@@ -3623,7 +3624,7 @@ function wn({
|
|
|
3623
3624
|
/* @__PURE__ */ n(
|
|
3624
3625
|
"button",
|
|
3625
3626
|
{
|
|
3626
|
-
onClick:
|
|
3627
|
+
onClick: C,
|
|
3627
3628
|
disabled: l || e === a,
|
|
3628
3629
|
className: S(
|
|
3629
3630
|
"ina-pagination__nav-button",
|
|
@@ -3811,33 +3812,33 @@ function as({
|
|
|
3811
3812
|
statusMessage: b,
|
|
3812
3813
|
size: h = "md",
|
|
3813
3814
|
maxLength: u,
|
|
3814
|
-
showCharCount:
|
|
3815
|
+
showCharCount: N = !1,
|
|
3815
3816
|
placeholder: m,
|
|
3816
3817
|
disabled: p = !1,
|
|
3817
3818
|
className: I = "",
|
|
3818
3819
|
onBlur: E,
|
|
3819
3820
|
...A
|
|
3820
3821
|
}) {
|
|
3821
|
-
const [F,
|
|
3822
|
+
const [F, C] = Z(e), [k, _] = Z(!1), [f] = ht(F, t), T = le(!0);
|
|
3822
3823
|
oe(() => {
|
|
3823
|
-
|
|
3824
|
+
C(e);
|
|
3824
3825
|
}, [e]), oe(() => {
|
|
3825
3826
|
T.current ? T.current = !1 : t > 0 && r && r(f);
|
|
3826
3827
|
}, [f, t, r]);
|
|
3827
|
-
const $ = (
|
|
3828
|
-
const ae =
|
|
3829
|
-
u != null && ae.length > u || (
|
|
3830
|
-
}, Y = (
|
|
3831
|
-
E == null || E(
|
|
3832
|
-
},
|
|
3833
|
-
|
|
3834
|
-
}, V = c !== "neutral" && b != null ? b : l,
|
|
3828
|
+
const $ = (K) => {
|
|
3829
|
+
const ae = K.target.value;
|
|
3830
|
+
u != null && ae.length > u || (C(ae), a(ae));
|
|
3831
|
+
}, Y = (K) => {
|
|
3832
|
+
E == null || E(K);
|
|
3833
|
+
}, P = () => {
|
|
3834
|
+
C(""), a(""), r && r("");
|
|
3835
|
+
}, V = c !== "neutral" && b != null ? b : l, H = (A == null ? void 0 : A.id) || (A == null ? void 0 : A.name) || String(s).toLowerCase(), G = `${H}-status`;
|
|
3835
3836
|
return /* @__PURE__ */ w("div", { className: S("ina-password-input", I), children: [
|
|
3836
3837
|
s && /* @__PURE__ */ w(
|
|
3837
3838
|
"label",
|
|
3838
3839
|
{
|
|
3839
3840
|
className: "ina-password-input__label",
|
|
3840
|
-
htmlFor: String(
|
|
3841
|
+
htmlFor: String(H),
|
|
3841
3842
|
children: [
|
|
3842
3843
|
s,
|
|
3843
3844
|
A.required && /* @__PURE__ */ n("span", { className: "ina-text-field__required", children: "*" })
|
|
@@ -3859,7 +3860,7 @@ function as({
|
|
|
3859
3860
|
"input",
|
|
3860
3861
|
{
|
|
3861
3862
|
...A,
|
|
3862
|
-
id: String(
|
|
3863
|
+
id: String(H),
|
|
3863
3864
|
type: k ? "text" : "password",
|
|
3864
3865
|
className: "ina-password-input__input",
|
|
3865
3866
|
value: F,
|
|
@@ -3868,7 +3869,7 @@ function as({
|
|
|
3868
3869
|
placeholder: m,
|
|
3869
3870
|
disabled: p,
|
|
3870
3871
|
maxLength: u,
|
|
3871
|
-
"aria-describedby": V ?
|
|
3872
|
+
"aria-describedby": V ? G : void 0
|
|
3872
3873
|
}
|
|
3873
3874
|
),
|
|
3874
3875
|
F !== "" && /* @__PURE__ */ n(
|
|
@@ -3876,9 +3877,9 @@ function as({
|
|
|
3876
3877
|
{
|
|
3877
3878
|
type: "button",
|
|
3878
3879
|
className: "ina-password-input__clear-button",
|
|
3879
|
-
onClick:
|
|
3880
|
-
onKeyDown: (
|
|
3881
|
-
(
|
|
3880
|
+
onClick: P,
|
|
3881
|
+
onKeyDown: (K) => {
|
|
3882
|
+
(K.key === "Enter" || K.key === " ") && (K.preventDefault(), P());
|
|
3882
3883
|
},
|
|
3883
3884
|
"aria-label": "Hapus input",
|
|
3884
3885
|
children: /* @__PURE__ */ n(Te, { size: 16 })
|
|
@@ -3889,9 +3890,9 @@ function as({
|
|
|
3889
3890
|
{
|
|
3890
3891
|
type: "button",
|
|
3891
3892
|
className: "ina-password-input__toggle-button",
|
|
3892
|
-
onClick: () => _((
|
|
3893
|
-
onKeyDown: (
|
|
3894
|
-
(
|
|
3893
|
+
onClick: () => _((K) => !K),
|
|
3894
|
+
onKeyDown: (K) => {
|
|
3895
|
+
(K.key === "Enter" || K.key === " ") && (K.preventDefault(), _((ae) => !ae));
|
|
3895
3896
|
},
|
|
3896
3897
|
"aria-label": k ? "Sembunyikan password" : "Tampilkan password",
|
|
3897
3898
|
children: k ? /* @__PURE__ */ n(Mn, { size: 20 }) : /* @__PURE__ */ n(Cn, { size: 20 })
|
|
@@ -3900,7 +3901,7 @@ function as({
|
|
|
3900
3901
|
]
|
|
3901
3902
|
}
|
|
3902
3903
|
),
|
|
3903
|
-
V && /* @__PURE__ */ w("div", { id:
|
|
3904
|
+
V && /* @__PURE__ */ w("div", { id: G, className: "ina-password-input__status-area", children: [
|
|
3904
3905
|
/* @__PURE__ */ n(
|
|
3905
3906
|
"div",
|
|
3906
3907
|
{
|
|
@@ -3911,7 +3912,7 @@ function as({
|
|
|
3911
3912
|
children: V
|
|
3912
3913
|
}
|
|
3913
3914
|
),
|
|
3914
|
-
|
|
3915
|
+
N && u != null && /* @__PURE__ */ w("div", { className: "ina-password-input__character-count", children: [
|
|
3915
3916
|
F.length,
|
|
3916
3917
|
"/",
|
|
3917
3918
|
u
|
|
@@ -4487,7 +4488,7 @@ function rs({
|
|
|
4487
4488
|
helperText: b,
|
|
4488
4489
|
disabled: h = !1,
|
|
4489
4490
|
readonly: u = !1,
|
|
4490
|
-
required:
|
|
4491
|
+
required: N = !1,
|
|
4491
4492
|
defaultCountry: m = "ID",
|
|
4492
4493
|
countries: p = xn,
|
|
4493
4494
|
allowClear: I = !0,
|
|
@@ -4495,23 +4496,23 @@ function rs({
|
|
|
4495
4496
|
id: A,
|
|
4496
4497
|
...F
|
|
4497
4498
|
}) {
|
|
4498
|
-
const
|
|
4499
|
+
const C = Fe(() => A || `phone-input-${Math.random().toString(36).substr(2, 9)}`, [A]), [k, _] = Z(a), [f, T] = Z(!1), [$, Y] = Z(""), [P, V] = Z(
|
|
4499
4500
|
p.find((ee) => ee.code === m) || p[0]
|
|
4500
|
-
),
|
|
4501
|
-
const
|
|
4502
|
-
return
|
|
4501
|
+
), H = le(null), G = le(null), K = le(null), ae = Fe(() => `${C}-helper`, [C]), ce = (ee) => {
|
|
4502
|
+
const de = ee.replace(/\D/g, "");
|
|
4503
|
+
return de.length > 7 ? de.replace(/^(\d{3})(\d{4})(.*)/, "$1-$2-$3") : de.length > 3 ? de.replace(/^(\d{3})(.*)/, "$1-$2") : de;
|
|
4503
4504
|
};
|
|
4504
4505
|
oe(() => {
|
|
4505
4506
|
if (!a) {
|
|
4506
4507
|
_("");
|
|
4507
4508
|
return;
|
|
4508
4509
|
}
|
|
4509
|
-
const ee =
|
|
4510
|
-
let
|
|
4511
|
-
a.startsWith(ee) && (
|
|
4512
|
-
}, [a,
|
|
4513
|
-
const ee = (
|
|
4514
|
-
|
|
4510
|
+
const ee = P.dialCode;
|
|
4511
|
+
let de = a;
|
|
4512
|
+
a.startsWith(ee) && (de = a.substring(ee.length)), _(ce(de));
|
|
4513
|
+
}, [a, P.dialCode]), oe(() => {
|
|
4514
|
+
const ee = (de) => {
|
|
4515
|
+
K.current && !K.current.contains(de.target) && T(!1);
|
|
4515
4516
|
};
|
|
4516
4517
|
return document.addEventListener("mousedown", ee), () => {
|
|
4517
4518
|
document.removeEventListener("mousedown", ee);
|
|
@@ -4521,37 +4522,37 @@ function rs({
|
|
|
4521
4522
|
if (!$) return p;
|
|
4522
4523
|
const ee = $.toLowerCase();
|
|
4523
4524
|
return p.filter(
|
|
4524
|
-
(
|
|
4525
|
+
(de) => de.name.toLowerCase().includes(ee) || de.dialCode.includes(ee) || de.code.toLowerCase().includes(ee)
|
|
4525
4526
|
);
|
|
4526
4527
|
}, [p, $]), X = () => {
|
|
4527
4528
|
h || u || T((ee) => {
|
|
4528
|
-
const
|
|
4529
|
-
return
|
|
4529
|
+
const de = !ee;
|
|
4530
|
+
return de && (Y(""), setTimeout(() => {
|
|
4530
4531
|
var _e;
|
|
4531
|
-
(_e =
|
|
4532
|
-
}, 0)),
|
|
4532
|
+
(_e = G.current) == null || _e.focus();
|
|
4533
|
+
}, 0)), de;
|
|
4533
4534
|
});
|
|
4534
|
-
},
|
|
4535
|
+
}, O = (ee) => {
|
|
4535
4536
|
if (V(ee), T(!1), k) {
|
|
4536
|
-
const
|
|
4537
|
+
const de = k.replace(/\D/g, ""), _e = de.startsWith("0") ? de.substring(1) : de;
|
|
4537
4538
|
t == null || t(`${ee.dialCode}${_e}`);
|
|
4538
4539
|
}
|
|
4539
4540
|
setTimeout(() => {
|
|
4540
|
-
var
|
|
4541
|
-
(
|
|
4541
|
+
var de;
|
|
4542
|
+
(de = H.current) == null || de.focus();
|
|
4542
4543
|
}, 0);
|
|
4543
|
-
},
|
|
4544
|
-
const _e = ee.target.value.replace(/\D/g, ""), ie =
|
|
4544
|
+
}, W = (ee) => {
|
|
4545
|
+
const _e = ee.target.value.replace(/\D/g, ""), ie = ce(_e);
|
|
4545
4546
|
_(ie);
|
|
4546
4547
|
let J = _e;
|
|
4547
|
-
J.startsWith("0") && (J = J.substring(1)), t == null || t(`${
|
|
4548
|
-
},
|
|
4548
|
+
J.startsWith("0") && (J = J.substring(1)), t == null || t(`${P.dialCode}${J}`), r == null || r(ee);
|
|
4549
|
+
}, B = S(
|
|
4549
4550
|
"ina-phone-input",
|
|
4550
4551
|
h && "ina-phone-input--disabled",
|
|
4551
4552
|
E
|
|
4552
4553
|
), se = () => {
|
|
4553
4554
|
var ee;
|
|
4554
|
-
_(""), t == null || t(`${
|
|
4555
|
+
_(""), t == null || t(`${P.dialCode}`), (ee = H.current) == null || ee.focus();
|
|
4555
4556
|
}, q = S(
|
|
4556
4557
|
"ina-phone-input__wrapper",
|
|
4557
4558
|
`ina-phone-input__wrapper--size-${s}`,
|
|
@@ -4562,13 +4563,13 @@ function rs({
|
|
|
4562
4563
|
l === "error" && "ina-phone-input__helper-text--error",
|
|
4563
4564
|
l === "warning" && "ina-phone-input__helper-text--warning"
|
|
4564
4565
|
), Q = l !== "neutral" && c ? c : c || b;
|
|
4565
|
-
return /* @__PURE__ */ w("div", { className:
|
|
4566
|
-
e && /* @__PURE__ */ w("label", { htmlFor:
|
|
4566
|
+
return /* @__PURE__ */ w("div", { className: B, children: [
|
|
4567
|
+
e && /* @__PURE__ */ w("label", { htmlFor: C, className: "ina-phone-input__label", children: [
|
|
4567
4568
|
e,
|
|
4568
|
-
|
|
4569
|
+
N && /* @__PURE__ */ n("span", { className: "ina-text-field__required", children: "*" })
|
|
4569
4570
|
] }),
|
|
4570
4571
|
/* @__PURE__ */ w("div", { className: q, children: [
|
|
4571
|
-
/* @__PURE__ */ w("div", { className: "ina-phone-input__country-selector", ref:
|
|
4572
|
+
/* @__PURE__ */ w("div", { className: "ina-phone-input__country-selector", ref: K, children: [
|
|
4572
4573
|
/* @__PURE__ */ w(
|
|
4573
4574
|
"button",
|
|
4574
4575
|
{
|
|
@@ -4583,14 +4584,14 @@ function rs({
|
|
|
4583
4584
|
/* @__PURE__ */ n(
|
|
4584
4585
|
qt,
|
|
4585
4586
|
{
|
|
4586
|
-
code:
|
|
4587
|
-
alt:
|
|
4587
|
+
code: P == null ? void 0 : P.code,
|
|
4588
|
+
alt: P.name,
|
|
4588
4589
|
className: "ina-phone-input__country-flag-img",
|
|
4589
4590
|
width: "20",
|
|
4590
4591
|
height: "15"
|
|
4591
4592
|
}
|
|
4592
4593
|
),
|
|
4593
|
-
/* @__PURE__ */ n("span", { className: "ina-phone-input__country-code", children:
|
|
4594
|
+
/* @__PURE__ */ n("span", { className: "ina-phone-input__country-code", children: P.dialCode }),
|
|
4594
4595
|
/* @__PURE__ */ n(
|
|
4595
4596
|
"svg",
|
|
4596
4597
|
{
|
|
@@ -4622,7 +4623,7 @@ function rs({
|
|
|
4622
4623
|
/* @__PURE__ */ n("div", { className: "ina-phone-input__country-search", children: /* @__PURE__ */ n(
|
|
4623
4624
|
"input",
|
|
4624
4625
|
{
|
|
4625
|
-
ref:
|
|
4626
|
+
ref: G,
|
|
4626
4627
|
value: $,
|
|
4627
4628
|
onChange: (ee) => Y(ee.target.value),
|
|
4628
4629
|
type: "text",
|
|
@@ -4635,12 +4636,12 @@ function rs({
|
|
|
4635
4636
|
{
|
|
4636
4637
|
type: "button",
|
|
4637
4638
|
role: "option",
|
|
4638
|
-
"aria-selected": ee.code ===
|
|
4639
|
+
"aria-selected": ee.code === P.code,
|
|
4639
4640
|
className: S(
|
|
4640
4641
|
"ina-phone-input__country-option",
|
|
4641
|
-
ee.code ===
|
|
4642
|
+
ee.code === P.code && "ina-phone-input__country-option--selected"
|
|
4642
4643
|
),
|
|
4643
|
-
onClick: () =>
|
|
4644
|
+
onClick: () => O(ee),
|
|
4644
4645
|
children: [
|
|
4645
4646
|
/* @__PURE__ */ n(
|
|
4646
4647
|
qt,
|
|
@@ -4670,15 +4671,15 @@ function rs({
|
|
|
4670
4671
|
"input",
|
|
4671
4672
|
{
|
|
4672
4673
|
...F,
|
|
4673
|
-
id:
|
|
4674
|
-
ref:
|
|
4674
|
+
id: C,
|
|
4675
|
+
ref: H,
|
|
4675
4676
|
value: k,
|
|
4676
4677
|
type: "tel",
|
|
4677
4678
|
placeholder: i,
|
|
4678
4679
|
disabled: h,
|
|
4679
4680
|
readOnly: u,
|
|
4680
4681
|
className: "ina-phone-input__input",
|
|
4681
|
-
onChange:
|
|
4682
|
+
onChange: W,
|
|
4682
4683
|
"aria-describedby": Q ? ae : void 0
|
|
4683
4684
|
}
|
|
4684
4685
|
),
|
|
@@ -4711,14 +4712,14 @@ function ss({
|
|
|
4711
4712
|
error: b = !1,
|
|
4712
4713
|
helperText: h,
|
|
4713
4714
|
className: u = "",
|
|
4714
|
-
...
|
|
4715
|
+
...N
|
|
4715
4716
|
}) {
|
|
4716
4717
|
return /* @__PURE__ */ w(
|
|
4717
4718
|
"fieldset",
|
|
4718
4719
|
{
|
|
4719
4720
|
className: `ina-radio-input ina-radio-input--size-${s} ina-radio-input--orientation-${l} ${b ? "ina-radio-input--error" : ""} ${u}`,
|
|
4720
4721
|
disabled: i,
|
|
4721
|
-
...
|
|
4722
|
+
...N,
|
|
4722
4723
|
children: [
|
|
4723
4724
|
/* @__PURE__ */ w("div", { className: "ina-radio-input__group", children: [
|
|
4724
4725
|
/* @__PURE__ */ n(
|
|
@@ -4786,7 +4787,7 @@ const is = ({
|
|
|
4786
4787
|
indicator: b = "check",
|
|
4787
4788
|
multiple: h = !1,
|
|
4788
4789
|
className: u = "",
|
|
4789
|
-
onClose:
|
|
4790
|
+
onClose: N,
|
|
4790
4791
|
prefixNode: m,
|
|
4791
4792
|
width: p = "100%",
|
|
4792
4793
|
panelWidth: I,
|
|
@@ -4794,37 +4795,37 @@ const is = ({
|
|
|
4794
4795
|
// default 600px
|
|
4795
4796
|
hasMore: A = !1,
|
|
4796
4797
|
loading: F = !1,
|
|
4797
|
-
currentPage:
|
|
4798
|
+
currentPage: C = 1,
|
|
4798
4799
|
onLoadMore: k,
|
|
4799
4800
|
onSearch: _,
|
|
4800
4801
|
searchDebounceMs: f = 300,
|
|
4801
4802
|
renderSelectedPreview: T,
|
|
4802
4803
|
onRemoveSelected: $,
|
|
4803
4804
|
searchValue: Y,
|
|
4804
|
-
onSearchChange:
|
|
4805
|
+
onSearchChange: P,
|
|
4805
4806
|
disabled: V = !1,
|
|
4806
|
-
showPreviewValue:
|
|
4807
|
-
searchable:
|
|
4808
|
-
onSelectedRawChange:
|
|
4807
|
+
showPreviewValue: H = !0,
|
|
4808
|
+
searchable: G = !0,
|
|
4809
|
+
onSelectedRawChange: K,
|
|
4809
4810
|
label: ae,
|
|
4810
|
-
required:
|
|
4811
|
+
required: ce,
|
|
4811
4812
|
selectionTitle: te,
|
|
4812
4813
|
mandatorySelected: X = !1
|
|
4813
4814
|
}) => {
|
|
4814
4815
|
var x;
|
|
4815
|
-
const [
|
|
4816
|
+
const [O, W] = Z(!1), [B, se] = Z(""), [q, j] = Z(-1), Q = le(null), ee = le(null), de = le([]), _e = le(null), ie = le(/* @__PURE__ */ new Map()), J = Y !== void 0, he = J ? Y : B;
|
|
4816
4817
|
oe(() => (_e.current && clearTimeout(_e.current), _ && he !== "" ? _e.current = setTimeout(() => {
|
|
4817
4818
|
_(he);
|
|
4818
4819
|
}, f) : _ && he === "" && _(""), () => {
|
|
4819
4820
|
_e.current && clearTimeout(_e.current);
|
|
4820
4821
|
}), [he, _, f]), oe(() => {
|
|
4821
|
-
J && Y !==
|
|
4822
|
-
}, [Y, J,
|
|
4822
|
+
J && Y !== B && se(Y);
|
|
4823
|
+
}, [Y, J, B]), oe(() => {
|
|
4823
4824
|
const v = (g) => {
|
|
4824
|
-
Q.current && !Q.current.contains(g.target) && (
|
|
4825
|
+
Q.current && !Q.current.contains(g.target) && (W(!1), j(-1), N == null || N());
|
|
4825
4826
|
};
|
|
4826
4827
|
return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
4827
|
-
}, [
|
|
4828
|
+
}, [N, J, P]), oe(() => () => {
|
|
4828
4829
|
_e.current && clearTimeout(_e.current);
|
|
4829
4830
|
}, []);
|
|
4830
4831
|
const fe = h && Array.isArray(a) ? a : [], pe = h ? null : a, Ce = (v) => {
|
|
@@ -4837,7 +4838,7 @@ const is = ({
|
|
|
4837
4838
|
return g !== null ? { label: g, value: v } : e.find((re) => re.value === v) || null;
|
|
4838
4839
|
};
|
|
4839
4840
|
oe(() => {
|
|
4840
|
-
if (
|
|
4841
|
+
if (K) {
|
|
4841
4842
|
let v = null;
|
|
4842
4843
|
if (h) {
|
|
4843
4844
|
if (fe.length > 0) {
|
|
@@ -4846,7 +4847,7 @@ const is = ({
|
|
|
4846
4847
|
}
|
|
4847
4848
|
} else
|
|
4848
4849
|
pe != null && pe !== "" && (v = be(pe));
|
|
4849
|
-
|
|
4850
|
+
K(v);
|
|
4850
4851
|
}
|
|
4851
4852
|
}, [a, h, e]), oe(() => {
|
|
4852
4853
|
const v = ie.current;
|
|
@@ -4883,21 +4884,21 @@ const is = ({
|
|
|
4883
4884
|
}
|
|
4884
4885
|
else
|
|
4885
4886
|
we = Ce(pe) || r;
|
|
4886
|
-
const ke = _ ? e :
|
|
4887
|
+
const ke = _ ? e : G ? e.filter(
|
|
4887
4888
|
(v) => v.label.toLowerCase().includes(he.toLowerCase())
|
|
4888
4889
|
) : e;
|
|
4889
4890
|
oe(() => {
|
|
4890
4891
|
j(-1);
|
|
4891
4892
|
}, [ke]), oe(() => {
|
|
4892
4893
|
var v;
|
|
4893
|
-
|
|
4894
|
+
O && q >= 0 && de.current[q] && ((v = de.current[q]) == null || v.scrollIntoView({
|
|
4894
4895
|
block: "nearest",
|
|
4895
4896
|
inline: "nearest"
|
|
4896
4897
|
}));
|
|
4897
|
-
}, [q,
|
|
4898
|
+
}, [q, O]);
|
|
4898
4899
|
const Ne = (v) => {
|
|
4899
4900
|
const g = v.target.value;
|
|
4900
|
-
J ?
|
|
4901
|
+
J ? P == null || P(g) : se(g);
|
|
4901
4902
|
}, Ve = (v) => {
|
|
4902
4903
|
if (ie.current.delete(v), $)
|
|
4903
4904
|
$(v);
|
|
@@ -4927,8 +4928,8 @@ const is = ({
|
|
|
4927
4928
|
"button",
|
|
4928
4929
|
{
|
|
4929
4930
|
type: "button",
|
|
4930
|
-
onClick: (
|
|
4931
|
-
|
|
4931
|
+
onClick: (ue) => {
|
|
4932
|
+
ue.stopPropagation(), Ve(v);
|
|
4932
4933
|
},
|
|
4933
4934
|
className: "ina-select-dropdown__preview-remove ina-select-dropdown__preview-remove--multiple",
|
|
4934
4935
|
"aria-label": `Remove ${re}`,
|
|
@@ -4978,21 +4979,21 @@ const is = ({
|
|
|
4978
4979
|
// Note: You might want to add props for status (error, warning, etc) if needed
|
|
4979
4980
|
V && "ina-select-dropdown__trigger--disabled",
|
|
4980
4981
|
s
|
|
4981
|
-
),
|
|
4982
|
+
), M = S(
|
|
4982
4983
|
"ina-select-dropdown__trigger-icon",
|
|
4983
4984
|
V && "ina-select-dropdown__trigger-icon--disabled"
|
|
4984
|
-
), R = () => h ||
|
|
4985
|
+
), R = () => h || O ? he : pe != null && pe !== "" && Ce(pe) || "", L = () => {
|
|
4985
4986
|
var g;
|
|
4986
|
-
!
|
|
4987
|
+
!O && !V && W(!0);
|
|
4987
4988
|
const v = (g = Q.current) == null ? void 0 : g.querySelector("input");
|
|
4988
4989
|
v && v.focus();
|
|
4989
4990
|
}, z = (v) => {
|
|
4990
|
-
|
|
4991
|
+
O || W(!0), Ne(v);
|
|
4991
4992
|
}, d = (v) => {
|
|
4992
4993
|
var g, U;
|
|
4993
4994
|
if (!(V || v.disabled))
|
|
4994
4995
|
if (h) {
|
|
4995
|
-
const re = Array.isArray(a) ? [...a] : [],
|
|
4996
|
+
const re = Array.isArray(a) ? [...a] : [], ue = re.includes(v.value) ? re.filter((De) => De !== v.value) : [...re, v.value];
|
|
4996
4997
|
if (re.includes(v.value)) {
|
|
4997
4998
|
if (X && fe.length <= 1) {
|
|
4998
4999
|
const De = (g = Q.current) == null ? void 0 : g.querySelector("input");
|
|
@@ -5002,24 +5003,24 @@ const is = ({
|
|
|
5002
5003
|
ie.current.delete(v.value);
|
|
5003
5004
|
} else
|
|
5004
5005
|
ie.current.set(v.value, v.label);
|
|
5005
|
-
t(
|
|
5006
|
+
t(ue);
|
|
5006
5007
|
const ye = (U = Q.current) == null ? void 0 : U.querySelector("input");
|
|
5007
5008
|
ye && ye.focus();
|
|
5008
5009
|
} else {
|
|
5009
5010
|
if (v.value === pe) {
|
|
5010
5011
|
if (X) {
|
|
5011
|
-
|
|
5012
|
+
W(!1), j(-1);
|
|
5012
5013
|
return;
|
|
5013
5014
|
}
|
|
5014
5015
|
ie.current.delete(v.value), t(null, v);
|
|
5015
5016
|
} else
|
|
5016
5017
|
ie.current.set(v.value, v.label), t(v.value, v);
|
|
5017
|
-
|
|
5018
|
+
W(!1), j(-1), J ? P == null || P("") : se(""), N == null || N();
|
|
5018
5019
|
}
|
|
5019
5020
|
}, D = (v) => {
|
|
5020
|
-
v.key === "ArrowDown" ? (v.preventDefault(),
|
|
5021
|
+
v.key === "ArrowDown" ? (v.preventDefault(), O ? j(
|
|
5021
5022
|
(g) => g < ke.length - 1 ? g + 1 : g
|
|
5022
|
-
) : (
|
|
5023
|
+
) : (W(!0), j(0))) : v.key === "ArrowUp" ? (v.preventDefault(), j((g) => g > 0 ? g - 1 : g)) : v.key === "Enter" ? (v.preventDefault(), O && q >= 0 && q < ke.length && d(ke[q])) : v.key === "Escape" && (v.preventDefault(), W(!1), j(-1));
|
|
5023
5024
|
};
|
|
5024
5025
|
return /* @__PURE__ */ w(
|
|
5025
5026
|
"div",
|
|
@@ -5030,7 +5031,7 @@ const is = ({
|
|
|
5030
5031
|
children: [
|
|
5031
5032
|
ae && /* @__PURE__ */ w("label", { className: "ina-select-dropdown__label", children: [
|
|
5032
5033
|
ae,
|
|
5033
|
-
|
|
5034
|
+
ce && /* @__PURE__ */ n("span", { className: "ina-select-dropdown__required", children: "*" })
|
|
5034
5035
|
] }),
|
|
5035
5036
|
/* @__PURE__ */ w(
|
|
5036
5037
|
"div",
|
|
@@ -5038,11 +5039,11 @@ const is = ({
|
|
|
5038
5039
|
onClick: L,
|
|
5039
5040
|
className: y,
|
|
5040
5041
|
role: "combobox",
|
|
5041
|
-
"aria-expanded":
|
|
5042
|
+
"aria-expanded": O,
|
|
5042
5043
|
"aria-haspopup": "listbox",
|
|
5043
5044
|
children: [
|
|
5044
5045
|
m && /* @__PURE__ */ n("div", { className: "ina-select-dropdown__trigger-prefix", children: m }),
|
|
5045
|
-
|
|
5046
|
+
G && !V ? /* @__PURE__ */ n(
|
|
5046
5047
|
"input",
|
|
5047
5048
|
{
|
|
5048
5049
|
type: "text",
|
|
@@ -5056,7 +5057,7 @@ const is = ({
|
|
|
5056
5057
|
onKeyDown: D,
|
|
5057
5058
|
disabled: V,
|
|
5058
5059
|
"aria-autocomplete": "list",
|
|
5059
|
-
"aria-activedescendant":
|
|
5060
|
+
"aria-activedescendant": O && q >= 0 ? `option-${(x = ke[q]) == null ? void 0 : x.value}` : void 0
|
|
5060
5061
|
}
|
|
5061
5062
|
) : /* @__PURE__ */ n(
|
|
5062
5063
|
"span",
|
|
@@ -5070,23 +5071,23 @@ const is = ({
|
|
|
5070
5071
|
children: we
|
|
5071
5072
|
}
|
|
5072
5073
|
),
|
|
5073
|
-
|
|
5074
|
+
O ? /* @__PURE__ */ n(
|
|
5074
5075
|
ba,
|
|
5075
5076
|
{
|
|
5076
5077
|
size: i === "sm" ? 16 : 20,
|
|
5077
|
-
className:
|
|
5078
|
+
className: M
|
|
5078
5079
|
}
|
|
5079
5080
|
) : /* @__PURE__ */ n(
|
|
5080
5081
|
Na,
|
|
5081
5082
|
{
|
|
5082
5083
|
size: i === "sm" ? 16 : 20,
|
|
5083
|
-
className:
|
|
5084
|
+
className: M
|
|
5084
5085
|
}
|
|
5085
5086
|
)
|
|
5086
5087
|
]
|
|
5087
5088
|
}
|
|
5088
5089
|
),
|
|
5089
|
-
|
|
5090
|
+
O && !V && /* @__PURE__ */ w(
|
|
5090
5091
|
"div",
|
|
5091
5092
|
{
|
|
5092
5093
|
className: S("ina-select-dropdown__panel", l),
|
|
@@ -5096,7 +5097,7 @@ const is = ({
|
|
|
5096
5097
|
maxHeight: wt(E)
|
|
5097
5098
|
},
|
|
5098
5099
|
children: [
|
|
5099
|
-
|
|
5100
|
+
H && Ie() !== null && /* @__PURE__ */ n("div", { className: "ina-select-dropdown__preview", children: Ie() }),
|
|
5100
5101
|
/* @__PURE__ */ w(
|
|
5101
5102
|
"div",
|
|
5102
5103
|
{
|
|
@@ -5104,14 +5105,14 @@ const is = ({
|
|
|
5104
5105
|
className: "ina-select-dropdown__options",
|
|
5105
5106
|
onScroll: (v) => {
|
|
5106
5107
|
const g = v.currentTarget;
|
|
5107
|
-
g.scrollHeight - g.scrollTop - g.clientHeight < 50 && !F && A && k && !V && k(
|
|
5108
|
+
g.scrollHeight - g.scrollTop - g.clientHeight < 50 && !F && A && k && !V && k(C + 1);
|
|
5108
5109
|
},
|
|
5109
5110
|
children: [
|
|
5110
5111
|
te && /* @__PURE__ */ n("div", { className: "ina-select-dropdown__selection-title", children: te }),
|
|
5111
5112
|
ke.map((v, g) => {
|
|
5112
5113
|
const U = h ? fe.includes(v.value) : v.value === pe, re = c ? c(v) : /* @__PURE__ */ n("span", { className: "ina-select-dropdown__option-label", children: v.label });
|
|
5113
|
-
let
|
|
5114
|
-
return h ?
|
|
5114
|
+
let ue = null;
|
|
5115
|
+
return h ? ue = /* @__PURE__ */ n(
|
|
5115
5116
|
"div",
|
|
5116
5117
|
{
|
|
5117
5118
|
className: S(
|
|
@@ -5120,13 +5121,13 @@ const is = ({
|
|
|
5120
5121
|
),
|
|
5121
5122
|
children: U && /* @__PURE__ */ n(at, { size: 14 })
|
|
5122
5123
|
}
|
|
5123
|
-
) : b === "check" ?
|
|
5124
|
+
) : b === "check" ? ue = U ? /* @__PURE__ */ n(
|
|
5124
5125
|
at,
|
|
5125
5126
|
{
|
|
5126
5127
|
size: 16,
|
|
5127
5128
|
className: "ina-select-dropdown__option-check-icon"
|
|
5128
5129
|
}
|
|
5129
|
-
) : null : b === "radio" && (
|
|
5130
|
+
) : null : b === "radio" && (ue = /* @__PURE__ */ n(
|
|
5130
5131
|
"div",
|
|
5131
5132
|
{
|
|
5132
5133
|
className: S(
|
|
@@ -5139,7 +5140,7 @@ const is = ({
|
|
|
5139
5140
|
"button",
|
|
5140
5141
|
{
|
|
5141
5142
|
ref: (ye) => {
|
|
5142
|
-
|
|
5143
|
+
de.current[g] = ye;
|
|
5143
5144
|
},
|
|
5144
5145
|
id: `option-${v.value}`,
|
|
5145
5146
|
type: "button",
|
|
@@ -5156,7 +5157,7 @@ const is = ({
|
|
|
5156
5157
|
),
|
|
5157
5158
|
children: [
|
|
5158
5159
|
/* @__PURE__ */ n("div", { className: "ina-select-dropdown__option-content", children: re }),
|
|
5159
|
-
|
|
5160
|
+
ue && /* @__PURE__ */ n("div", { className: "ina-select-dropdown__option-check-indicator", children: ue })
|
|
5160
5161
|
]
|
|
5161
5162
|
},
|
|
5162
5163
|
`${v.value}-${g}`
|
|
@@ -5201,7 +5202,7 @@ function ls({
|
|
|
5201
5202
|
document.body.style.overflow = "";
|
|
5202
5203
|
};
|
|
5203
5204
|
}, [e, h]), !e || !h) return null;
|
|
5204
|
-
const
|
|
5205
|
+
const N = S(
|
|
5205
5206
|
"ina-drawer",
|
|
5206
5207
|
`ina-drawer--position-${t}`,
|
|
5207
5208
|
i
|
|
@@ -5249,7 +5250,7 @@ function ls({
|
|
|
5249
5250
|
return Lt(/* @__PURE__ */ w(
|
|
5250
5251
|
"div",
|
|
5251
5252
|
{
|
|
5252
|
-
className:
|
|
5253
|
+
className: N,
|
|
5253
5254
|
onClick: () => r && a(),
|
|
5254
5255
|
children: [
|
|
5255
5256
|
/* @__PURE__ */ n("div", { className: "ina-drawer__backdrop" }),
|
|
@@ -5372,54 +5373,54 @@ function En({
|
|
|
5372
5373
|
helperText: b,
|
|
5373
5374
|
status: h = "neutral",
|
|
5374
5375
|
statusMessage: u,
|
|
5375
|
-
size:
|
|
5376
|
+
size: N = "md",
|
|
5376
5377
|
maxLength: m,
|
|
5377
5378
|
showCharCount: p = !1,
|
|
5378
5379
|
showClearButton: I = !0,
|
|
5379
5380
|
onClear: E,
|
|
5380
5381
|
placeholder: A,
|
|
5381
5382
|
disabled: F = !1,
|
|
5382
|
-
className:
|
|
5383
|
+
className: C = "",
|
|
5383
5384
|
securityConfig: k = Da,
|
|
5384
5385
|
onBlur: _,
|
|
5385
5386
|
...f
|
|
5386
5387
|
}) {
|
|
5387
|
-
const T = () => k != null && k.enableXssProtection ? Xe(e).sanitized : e, [$, Y] = Z(T()), [
|
|
5388
|
+
const T = () => k != null && k.enableXssProtection ? Xe(e).sanitized : e, [$, Y] = Z(T()), [P] = ht($, r), V = le(!0);
|
|
5388
5389
|
oe(() => {
|
|
5389
|
-
let
|
|
5390
|
+
let W = e;
|
|
5390
5391
|
if (k != null && k.enableXssProtection) {
|
|
5391
|
-
const
|
|
5392
|
-
|
|
5392
|
+
const B = Xe(e);
|
|
5393
|
+
B.isValid || (k.logViolations && console.warn(
|
|
5393
5394
|
"TextField security violation on value change:",
|
|
5394
|
-
|
|
5395
|
-
), k.onSecurityViolation && k.onSecurityViolation(
|
|
5395
|
+
B.threats
|
|
5396
|
+
), k.onSecurityViolation && k.onSecurityViolation(B.threats, e), W = B.sanitized);
|
|
5396
5397
|
}
|
|
5397
|
-
Y(
|
|
5398
|
+
Y(W);
|
|
5398
5399
|
}, [e, k]), oe(() => {
|
|
5399
|
-
V.current ? V.current = !1 : r > 0 && i && i(
|
|
5400
|
-
}, [
|
|
5401
|
-
const
|
|
5402
|
-
let
|
|
5403
|
-
if (!(m != null &&
|
|
5400
|
+
V.current ? V.current = !1 : r > 0 && i && i(P);
|
|
5401
|
+
}, [P, r, i]);
|
|
5402
|
+
const H = (W) => {
|
|
5403
|
+
let B = W.target.value;
|
|
5404
|
+
if (!(m != null && B.length > m)) {
|
|
5404
5405
|
if (k != null && k.enableXssProtection) {
|
|
5405
|
-
const se = Xe(
|
|
5406
|
-
se.isValid || (k.logViolations && console.warn("TextField security violation:", se.threats), k.onSecurityViolation && k.onSecurityViolation(se.threats,
|
|
5406
|
+
const se = Xe(B);
|
|
5407
|
+
se.isValid || (k.logViolations && console.warn("TextField security violation:", se.threats), k.onSecurityViolation && k.onSecurityViolation(se.threats, B), B = se.sanitized);
|
|
5407
5408
|
}
|
|
5408
|
-
Y(
|
|
5409
|
+
Y(B), a(B), t == null || t(W);
|
|
5409
5410
|
}
|
|
5410
|
-
},
|
|
5411
|
-
_ == null || _(
|
|
5412
|
-
},
|
|
5411
|
+
}, G = (W) => {
|
|
5412
|
+
_ == null || _(W);
|
|
5413
|
+
}, K = () => {
|
|
5413
5414
|
Y(""), a(""), i && i(""), E == null || E();
|
|
5414
5415
|
}, ae = S(
|
|
5415
5416
|
"ina-text-field__wrapper",
|
|
5416
|
-
`ina-text-field__wrapper--size-${
|
|
5417
|
+
`ina-text-field__wrapper--size-${N}`,
|
|
5417
5418
|
`ina-text-field__wrapper--status-${h}`,
|
|
5418
5419
|
F && "ina-text-field__wrapper--disabled"
|
|
5419
|
-
),
|
|
5420
|
+
), ce = S(
|
|
5420
5421
|
"ina-text-field__helper-text",
|
|
5421
5422
|
`ina-text-field__helper-text--${h}`
|
|
5422
|
-
), te = h !== "neutral" && u != null ? u : b, X = (f == null ? void 0 : f.id) || (f == null ? void 0 : f.name) || String(c).toLowerCase(),
|
|
5423
|
+
), te = h !== "neutral" && u != null ? u : b, X = (f == null ? void 0 : f.id) || (f == null ? void 0 : f.name) || String(c).toLowerCase(), O = `${X}-status`;
|
|
5423
5424
|
return /* @__PURE__ */ w("div", { className: "ina-text-field", children: [
|
|
5424
5425
|
c && /* @__PURE__ */ w(
|
|
5425
5426
|
"label",
|
|
@@ -5440,14 +5441,14 @@ function En({
|
|
|
5440
5441
|
...f,
|
|
5441
5442
|
id: String(X),
|
|
5442
5443
|
type: f.type ?? "text",
|
|
5443
|
-
className: S("ina-text-field__input",
|
|
5444
|
+
className: S("ina-text-field__input", C),
|
|
5444
5445
|
value: $,
|
|
5445
|
-
onChange:
|
|
5446
|
-
onBlur:
|
|
5446
|
+
onChange: H,
|
|
5447
|
+
onBlur: G,
|
|
5447
5448
|
placeholder: A,
|
|
5448
5449
|
disabled: F,
|
|
5449
5450
|
maxLength: m,
|
|
5450
|
-
"aria-describedby": te ?
|
|
5451
|
+
"aria-describedby": te ? O : void 0
|
|
5451
5452
|
}
|
|
5452
5453
|
),
|
|
5453
5454
|
I && $ !== "" && !F && /* @__PURE__ */ n(
|
|
@@ -5455,9 +5456,9 @@ function En({
|
|
|
5455
5456
|
{
|
|
5456
5457
|
type: "button",
|
|
5457
5458
|
className: "ina-text-field__clear-button",
|
|
5458
|
-
onClick:
|
|
5459
|
-
onKeyDown: (
|
|
5460
|
-
(
|
|
5459
|
+
onClick: K,
|
|
5460
|
+
onKeyDown: (W) => {
|
|
5461
|
+
(W.key === "Enter" || W.key === " ") && (W.preventDefault(), K());
|
|
5461
5462
|
},
|
|
5462
5463
|
"aria-label": "Hapus input",
|
|
5463
5464
|
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-text-field__clear-icon" })
|
|
@@ -5466,7 +5467,7 @@ function En({
|
|
|
5466
5467
|
l && /* @__PURE__ */ n("div", { className: "ina-text-field__suffix-icon", children: l })
|
|
5467
5468
|
] }),
|
|
5468
5469
|
/* @__PURE__ */ w("div", { className: "ina-text-field__bottom-area", children: [
|
|
5469
|
-
te && /* @__PURE__ */ n("div", { id:
|
|
5470
|
+
te && /* @__PURE__ */ n("div", { id: O, className: ce, children: te }),
|
|
5470
5471
|
p && m != null && /* @__PURE__ */ w("div", { className: "ina-text-field__char-count", children: [
|
|
5471
5472
|
$.length,
|
|
5472
5473
|
"/",
|
|
@@ -5529,45 +5530,45 @@ function ds({
|
|
|
5529
5530
|
searchPlaceholder: b = c || "Input pencarian",
|
|
5530
5531
|
buttonSearchLabel: h = "Cari",
|
|
5531
5532
|
className: u = "",
|
|
5532
|
-
selectable:
|
|
5533
|
+
selectable: N = !1,
|
|
5533
5534
|
onSelectionChange: m,
|
|
5534
5535
|
editableColumns: p = [],
|
|
5535
5536
|
onRowUpdate: I,
|
|
5536
5537
|
rowKey: E = "id",
|
|
5537
5538
|
showSearch: A = !1,
|
|
5538
5539
|
rowClickable: F = !1,
|
|
5539
|
-
onRowClick:
|
|
5540
|
+
onRowClick: C,
|
|
5540
5541
|
lastColumnSticky: k = !1,
|
|
5541
5542
|
renderSortIndicator: _,
|
|
5542
5543
|
emptyState: f = "No data found",
|
|
5543
5544
|
showPagination: T = !0
|
|
5544
5545
|
}) {
|
|
5545
|
-
const [$, Y] = Z([]), [
|
|
5546
|
+
const [$, Y] = Z([]), [P, V] = Z(0), [H, G] = Z(!1), K = le(null), ae = ma(), [ce, te] = Z(t), [X, O] = Z(r), [W, B] = Z(s), [se, q] = Z(
|
|
5546
5547
|
l
|
|
5547
|
-
), [j, Q] = Z(""), [ee,
|
|
5548
|
+
), [j, Q] = Z(""), [ee, de] = Z(""), [_e, ie] = Z({}), J = Object.values(_e).every(Boolean), he = Object.values(_e).some(Boolean), [ve, fe] = Z({}), [pe, Ce] = Z(null), be = Math.ceil(P / X);
|
|
5548
5549
|
oe(() => {
|
|
5549
5550
|
const g = new AbortController(), U = g.signal;
|
|
5550
5551
|
async function re() {
|
|
5551
|
-
|
|
5552
|
+
G(!0);
|
|
5552
5553
|
try {
|
|
5553
|
-
const
|
|
5554
|
-
page:
|
|
5554
|
+
const ue = await a({
|
|
5555
|
+
page: ce,
|
|
5555
5556
|
pageSize: X,
|
|
5556
|
-
sortField:
|
|
5557
|
+
sortField: W,
|
|
5557
5558
|
sortOrder: se,
|
|
5558
5559
|
searchTerm: j
|
|
5559
5560
|
});
|
|
5560
|
-
U.aborted || (Y(
|
|
5561
|
-
} catch (
|
|
5562
|
-
U.aborted || console.error(
|
|
5561
|
+
U.aborted || (Y(ue.data), V(ue.total), ie({}), fe({}), Ce(null));
|
|
5562
|
+
} catch (ue) {
|
|
5563
|
+
U.aborted || console.error(ue);
|
|
5563
5564
|
} finally {
|
|
5564
|
-
U.aborted ||
|
|
5565
|
+
U.aborted || G(!1);
|
|
5565
5566
|
}
|
|
5566
5567
|
}
|
|
5567
5568
|
return re(), () => {
|
|
5568
5569
|
g.abort();
|
|
5569
5570
|
};
|
|
5570
|
-
}, [
|
|
5571
|
+
}, [ce, X, W, se, j, a]), oe(() => {
|
|
5571
5572
|
te(t);
|
|
5572
5573
|
}, [t]);
|
|
5573
5574
|
const we = () => {
|
|
@@ -5578,17 +5579,17 @@ function ds({
|
|
|
5578
5579
|
}, ke = (g) => {
|
|
5579
5580
|
ie((U) => {
|
|
5580
5581
|
const re = { ...U, [g]: !U[g] };
|
|
5581
|
-
return m == null || m($.filter((
|
|
5582
|
+
return m == null || m($.filter((ue) => re[ue[E]]).map((ue) => ue)), re;
|
|
5582
5583
|
});
|
|
5583
|
-
}, Ne = (g, U, re,
|
|
5584
|
-
|
|
5584
|
+
}, Ne = (g, U, re, ue) => {
|
|
5585
|
+
ue.stopPropagation(), fe((ye) => ({
|
|
5585
5586
|
...ye,
|
|
5586
5587
|
[g]: { ...U }
|
|
5587
5588
|
})), Ce({ rowKey: g, accessor: re });
|
|
5588
5589
|
}, Ve = (g) => {
|
|
5589
5590
|
fe((U) => {
|
|
5590
|
-
const { [g]: re, ...
|
|
5591
|
-
return I == null || I(U[g]), Ce(null),
|
|
5591
|
+
const { [g]: re, ...ue } = U;
|
|
5592
|
+
return I == null || I(U[g]), Ce(null), ue;
|
|
5592
5593
|
});
|
|
5593
5594
|
}, Ie = (g) => {
|
|
5594
5595
|
fe((U) => {
|
|
@@ -5596,19 +5597,19 @@ function ds({
|
|
|
5596
5597
|
return delete re[g], re;
|
|
5597
5598
|
}), Ce(null);
|
|
5598
5599
|
}, o = (g, U) => {
|
|
5599
|
-
g.sortable && (
|
|
5600
|
-
}, y = (g) =>
|
|
5600
|
+
g.sortable && (W === g.accessor && se === U ? (B(null), q(null)) : (B(g.accessor), q(U)), te(1));
|
|
5601
|
+
}, y = (g) => de(g), M = (g) => {
|
|
5601
5602
|
g.key === "Enter" && (g.preventDefault(), te(1), Q(ee.trim()));
|
|
5602
5603
|
}, R = () => {
|
|
5603
5604
|
te(1), Q(ee.trim());
|
|
5604
5605
|
}, L = (g, U) => {
|
|
5605
5606
|
U.target.closest(
|
|
5606
5607
|
'button, [role="button"], .ina-button, [data-action]'
|
|
5607
|
-
) || F &&
|
|
5608
|
+
) || F && C && C(g);
|
|
5608
5609
|
};
|
|
5609
5610
|
oe(() => {
|
|
5610
5611
|
const g = (U) => {
|
|
5611
|
-
|
|
5612
|
+
K.current && !K.current.contains(U.target) && Ce(null);
|
|
5612
5613
|
};
|
|
5613
5614
|
return document.addEventListener("mousedown", g), () => {
|
|
5614
5615
|
document.removeEventListener("mousedown", g);
|
|
@@ -5621,7 +5622,7 @@ function ds({
|
|
|
5621
5622
|
!A && "ina-table__search--hidden"
|
|
5622
5623
|
), D = S(
|
|
5623
5624
|
"ina-table__container",
|
|
5624
|
-
|
|
5625
|
+
H && "ina-table--loading"
|
|
5625
5626
|
), x = S("ina-table__header"), v = S("ina-table__body");
|
|
5626
5627
|
return /* @__PURE__ */ w("div", { className: z, children: [
|
|
5627
5628
|
A && /* @__PURE__ */ n("div", { className: d, children: /* @__PURE__ */ w("div", { className: "ina-table__search-controls", children: [
|
|
@@ -5630,25 +5631,25 @@ function ds({
|
|
|
5630
5631
|
{
|
|
5631
5632
|
value: ee,
|
|
5632
5633
|
onChange: y,
|
|
5633
|
-
onKeyDown:
|
|
5634
|
+
onKeyDown: M,
|
|
5634
5635
|
placeholder: b,
|
|
5635
|
-
disabled:
|
|
5636
|
+
disabled: H
|
|
5636
5637
|
}
|
|
5637
5638
|
),
|
|
5638
|
-
/* @__PURE__ */ n(ct, { onClick: R, disabled:
|
|
5639
|
+
/* @__PURE__ */ n(ct, { onClick: R, disabled: H, children: h })
|
|
5639
5640
|
] }) }),
|
|
5640
5641
|
/* @__PURE__ */ n(
|
|
5641
5642
|
Nn,
|
|
5642
5643
|
{
|
|
5643
|
-
visible:
|
|
5644
|
-
loading:
|
|
5644
|
+
visible: H,
|
|
5645
|
+
loading: H,
|
|
5645
5646
|
variant: "primary",
|
|
5646
5647
|
className: "ina-table__progress-bar"
|
|
5647
5648
|
}
|
|
5648
5649
|
),
|
|
5649
|
-
/* @__PURE__ */ w("table", { ref:
|
|
5650
|
+
/* @__PURE__ */ w("table", { ref: K, className: D, children: [
|
|
5650
5651
|
/* @__PURE__ */ n("thead", { className: x, children: /* @__PURE__ */ w("tr", { children: [
|
|
5651
|
-
|
|
5652
|
+
N && /* @__PURE__ */ n("th", { className: "ina-table__header-cell", children: /* @__PURE__ */ n(
|
|
5652
5653
|
Wt,
|
|
5653
5654
|
{
|
|
5654
5655
|
id: `${ae}-select-all`,
|
|
@@ -5659,7 +5660,7 @@ function ds({
|
|
|
5659
5660
|
}
|
|
5660
5661
|
) }),
|
|
5661
5662
|
e.map((g, U) => {
|
|
5662
|
-
const re =
|
|
5663
|
+
const re = W === g.accessor;
|
|
5663
5664
|
return /* @__PURE__ */ n(
|
|
5664
5665
|
"th",
|
|
5665
5666
|
{
|
|
@@ -5677,7 +5678,7 @@ function ds({
|
|
|
5677
5678
|
index: U,
|
|
5678
5679
|
isSorted: re,
|
|
5679
5680
|
sortOrder: se,
|
|
5680
|
-
handleSort: (
|
|
5681
|
+
handleSort: (ue) => o(g, ue)
|
|
5681
5682
|
}) : /* @__PURE__ */ w("div", { className: "ina-table__sort-icon", children: [
|
|
5682
5683
|
/* @__PURE__ */ n(
|
|
5683
5684
|
"div",
|
|
@@ -5725,10 +5726,10 @@ function ds({
|
|
|
5725
5726
|
);
|
|
5726
5727
|
})
|
|
5727
5728
|
] }) }),
|
|
5728
|
-
/* @__PURE__ */ n("tbody", { className: v, children: !
|
|
5729
|
+
/* @__PURE__ */ n("tbody", { className: v, children: !H && $.length === 0 ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n(
|
|
5729
5730
|
"td",
|
|
5730
5731
|
{
|
|
5731
|
-
colSpan:
|
|
5732
|
+
colSpan: N ? e.length + 1 : e.length,
|
|
5732
5733
|
className: "ina-table__empty-cell",
|
|
5733
5734
|
children: f
|
|
5734
5735
|
}
|
|
@@ -5739,12 +5740,12 @@ function ds({
|
|
|
5739
5740
|
{
|
|
5740
5741
|
className: S(
|
|
5741
5742
|
"ina-table__row",
|
|
5742
|
-
|
|
5743
|
+
H && "ina-table__row--loading",
|
|
5743
5744
|
F && "ina-table__row--clickable"
|
|
5744
5745
|
),
|
|
5745
|
-
onClick: (
|
|
5746
|
+
onClick: (ue) => L(g, ue),
|
|
5746
5747
|
children: [
|
|
5747
|
-
|
|
5748
|
+
N && /* @__PURE__ */ n("td", { className: "ina-table__cell", children: /* @__PURE__ */ n(
|
|
5748
5749
|
Wt,
|
|
5749
5750
|
{
|
|
5750
5751
|
id: `${ae}-select-${re}`,
|
|
@@ -5753,28 +5754,28 @@ function ds({
|
|
|
5753
5754
|
onChange: () => ke(re)
|
|
5754
5755
|
}
|
|
5755
5756
|
) }),
|
|
5756
|
-
e.map((
|
|
5757
|
+
e.map((ue, ye) => {
|
|
5757
5758
|
const De = p.find(
|
|
5758
|
-
(yt) => yt.accessor ===
|
|
5759
|
-
), je = !!De, it = je && (De != null && De.disabled) ? typeof De.disabled == "function" ? De.disabled(g) : De.disabled : !1, lt = (pe == null ? void 0 : pe.rowKey) === re && pe.accessor ===
|
|
5759
|
+
(yt) => yt.accessor === ue.accessor
|
|
5760
|
+
), je = !!De, it = je && (De != null && De.disabled) ? typeof De.disabled == "function" ? De.disabled(g) : De.disabled : !1, lt = (pe == null ? void 0 : pe.rowKey) === re && pe.accessor === ue.accessor;
|
|
5760
5761
|
if (je && !it) {
|
|
5761
5762
|
const { editor: yt } = De, Ka = ve[re] ?? g;
|
|
5762
5763
|
return /* @__PURE__ */ n(
|
|
5763
5764
|
"td",
|
|
5764
5765
|
{
|
|
5765
5766
|
tabIndex: 0,
|
|
5766
|
-
className: S("ina-table__cell",
|
|
5767
|
-
style:
|
|
5767
|
+
className: S("ina-table__cell", ue.className),
|
|
5768
|
+
style: ue.width ? { width: ue.width } : void 0,
|
|
5768
5769
|
children: lt ? /* @__PURE__ */ n(
|
|
5769
5770
|
yt,
|
|
5770
5771
|
{
|
|
5771
5772
|
row: g,
|
|
5772
|
-
value: Ka[
|
|
5773
|
+
value: Ka[ue.accessor],
|
|
5773
5774
|
onChange: (_t) => fe((Kt) => ({
|
|
5774
5775
|
...Kt,
|
|
5775
5776
|
[re]: {
|
|
5776
5777
|
...Kt[re],
|
|
5777
|
-
[
|
|
5778
|
+
[ue.accessor]: _t
|
|
5778
5779
|
}
|
|
5779
5780
|
})),
|
|
5780
5781
|
onCommit: () => Ve(re),
|
|
@@ -5784,22 +5785,22 @@ function ds({
|
|
|
5784
5785
|
"div",
|
|
5785
5786
|
{
|
|
5786
5787
|
className: "ina-table__cell--editable",
|
|
5787
|
-
onClick: (_t) => Ne(re, g,
|
|
5788
|
-
children:
|
|
5788
|
+
onClick: (_t) => Ne(re, g, ue.accessor, _t),
|
|
5789
|
+
children: ue.render ? ue.render(g) : g[ue.accessor]
|
|
5789
5790
|
}
|
|
5790
5791
|
)
|
|
5791
5792
|
},
|
|
5792
|
-
`${re}-${
|
|
5793
|
+
`${re}-${ue.accessor}-${ye}`
|
|
5793
5794
|
);
|
|
5794
5795
|
}
|
|
5795
5796
|
return /* @__PURE__ */ n(
|
|
5796
5797
|
"td",
|
|
5797
5798
|
{
|
|
5798
|
-
className: S("ina-table__cell",
|
|
5799
|
-
style:
|
|
5800
|
-
children:
|
|
5799
|
+
className: S("ina-table__cell", ue.className),
|
|
5800
|
+
style: ue.width ? { width: ue.width } : void 0,
|
|
5801
|
+
children: ue.render ? ue.render(g) : g[ue.accessor]
|
|
5801
5802
|
},
|
|
5802
|
-
`${re}-${
|
|
5803
|
+
`${re}-${ue.accessor}-${ye}`
|
|
5803
5804
|
);
|
|
5804
5805
|
})
|
|
5805
5806
|
]
|
|
@@ -5811,15 +5812,15 @@ function ds({
|
|
|
5811
5812
|
T && /* @__PURE__ */ n("div", { className: "ina-table__pagination", children: /* @__PURE__ */ n(
|
|
5812
5813
|
wn,
|
|
5813
5814
|
{
|
|
5814
|
-
currentPage:
|
|
5815
|
+
currentPage: ce,
|
|
5815
5816
|
totalPages: be,
|
|
5816
5817
|
pageSize: X,
|
|
5817
5818
|
pageSizeOptions: i,
|
|
5818
5819
|
onPageChange: te,
|
|
5819
5820
|
onPageSizeChange: (g) => {
|
|
5820
|
-
|
|
5821
|
+
O(g), te(1);
|
|
5821
5822
|
},
|
|
5822
|
-
disabled:
|
|
5823
|
+
disabled: H || P === 0,
|
|
5823
5824
|
fullWidth: !0
|
|
5824
5825
|
}
|
|
5825
5826
|
) })
|
|
@@ -5837,65 +5838,65 @@ function us({
|
|
|
5837
5838
|
status: b = "neutral",
|
|
5838
5839
|
statusMessage: h,
|
|
5839
5840
|
maxLength: u,
|
|
5840
|
-
showCharCount:
|
|
5841
|
+
showCharCount: N = !1,
|
|
5841
5842
|
showClearButton: m = !0,
|
|
5842
5843
|
minRows: p = 3,
|
|
5843
5844
|
maxRows: I,
|
|
5844
5845
|
placeholder: E,
|
|
5845
5846
|
disabled: A = !1,
|
|
5846
5847
|
className: F = "",
|
|
5847
|
-
securityConfig:
|
|
5848
|
+
securityConfig: C = Da,
|
|
5848
5849
|
onBlur: k,
|
|
5849
5850
|
..._
|
|
5850
5851
|
}) {
|
|
5851
|
-
const f = () =>
|
|
5852
|
+
const f = () => C != null && C.enableXssProtection ? Xe(e).sanitized : e, [T, $] = Z(f()), [Y] = ht(T, t), P = le(!0), V = le(null), [H, G] = Z(p);
|
|
5852
5853
|
oe(() => {
|
|
5853
5854
|
let q = e;
|
|
5854
|
-
if (
|
|
5855
|
+
if (C != null && C.enableXssProtection) {
|
|
5855
5856
|
const j = Xe(e);
|
|
5856
|
-
j.isValid || (
|
|
5857
|
+
j.isValid || (C.logViolations && console.warn(
|
|
5857
5858
|
"TextArea security violation on value change:",
|
|
5858
5859
|
j.threats
|
|
5859
|
-
),
|
|
5860
|
+
), C.onSecurityViolation && C.onSecurityViolation(j.threats, e), q = j.sanitized);
|
|
5860
5861
|
}
|
|
5861
5862
|
$(q);
|
|
5862
|
-
}, [e,
|
|
5863
|
-
|
|
5863
|
+
}, [e, C]), oe(() => {
|
|
5864
|
+
P.current ? P.current = !1 : t > 0 && r && r(Y);
|
|
5864
5865
|
}, [Y, t, r]), oe(() => {
|
|
5865
5866
|
const q = V.current;
|
|
5866
5867
|
if (!q) return;
|
|
5867
5868
|
q.rows = p;
|
|
5868
5869
|
const j = parseInt(getComputedStyle(q).lineHeight || "0", 10), Q = q.scrollHeight;
|
|
5869
5870
|
let ee = Math.floor(Q / j);
|
|
5870
|
-
I && (ee = Math.min(ee, I)),
|
|
5871
|
+
I && (ee = Math.min(ee, I)), G(Math.max(ee, p));
|
|
5871
5872
|
}, [T, p, I]);
|
|
5872
|
-
const
|
|
5873
|
+
const K = (q) => {
|
|
5873
5874
|
let j = q.target.value;
|
|
5874
5875
|
if (!(u != null && j.length > u)) {
|
|
5875
|
-
if (
|
|
5876
|
+
if (C != null && C.enableXssProtection) {
|
|
5876
5877
|
const Q = Xe(j);
|
|
5877
|
-
Q.isValid || (
|
|
5878
|
+
Q.isValid || (C.logViolations && console.warn("TextArea security violation:", Q.threats), C.onSecurityViolation && C.onSecurityViolation(Q.threats, j), j = Q.sanitized);
|
|
5878
5879
|
}
|
|
5879
5880
|
$(j), a(j);
|
|
5880
5881
|
}
|
|
5881
5882
|
}, ae = (q) => {
|
|
5882
5883
|
k == null || k(q);
|
|
5883
|
-
},
|
|
5884
|
+
}, ce = () => {
|
|
5884
5885
|
$(""), a(""), r && r("");
|
|
5885
5886
|
}, te = S("ina-text-area", F), X = S(
|
|
5886
5887
|
"ina-text-area__wrapper",
|
|
5887
5888
|
`ina-text-area__wrapper--status-${b}`,
|
|
5888
5889
|
A && "ina-text-area__wrapper--disabled"
|
|
5889
|
-
),
|
|
5890
|
+
), O = S(
|
|
5890
5891
|
"ina-text-area__helper-text",
|
|
5891
5892
|
`ina-text-area__helper-text--${b}`
|
|
5892
|
-
),
|
|
5893
|
+
), W = b !== "neutral" && h != null ? h : c, B = (_ == null ? void 0 : _.id) || (_ == null ? void 0 : _.name) || String(l).toLowerCase(), se = `${B}-status`;
|
|
5893
5894
|
return /* @__PURE__ */ w("div", { className: te, children: [
|
|
5894
5895
|
l && /* @__PURE__ */ w(
|
|
5895
5896
|
"label",
|
|
5896
5897
|
{
|
|
5897
5898
|
className: "ina-text-area__label",
|
|
5898
|
-
htmlFor: String(
|
|
5899
|
+
htmlFor: String(B),
|
|
5899
5900
|
children: [
|
|
5900
5901
|
l,
|
|
5901
5902
|
_.required && /* @__PURE__ */ n("span", { className: "ina-text-field__required", children: "*" })
|
|
@@ -5908,17 +5909,17 @@ function us({
|
|
|
5908
5909
|
"textarea",
|
|
5909
5910
|
{
|
|
5910
5911
|
..._,
|
|
5911
|
-
id: String(
|
|
5912
|
+
id: String(B),
|
|
5912
5913
|
ref: V,
|
|
5913
|
-
rows:
|
|
5914
|
+
rows: H,
|
|
5914
5915
|
className: "ina-text-area__input",
|
|
5915
5916
|
value: T,
|
|
5916
|
-
onChange:
|
|
5917
|
+
onChange: K,
|
|
5917
5918
|
onBlur: ae,
|
|
5918
5919
|
placeholder: E,
|
|
5919
5920
|
disabled: A,
|
|
5920
5921
|
maxLength: u,
|
|
5921
|
-
"aria-describedby":
|
|
5922
|
+
"aria-describedby": W ? se : void 0
|
|
5922
5923
|
}
|
|
5923
5924
|
),
|
|
5924
5925
|
m && T !== "" && !A && /* @__PURE__ */ n(
|
|
@@ -5926,9 +5927,9 @@ function us({
|
|
|
5926
5927
|
{
|
|
5927
5928
|
type: "button",
|
|
5928
5929
|
className: "ina-text-area__clear-button",
|
|
5929
|
-
onClick:
|
|
5930
|
+
onClick: ce,
|
|
5930
5931
|
onKeyDown: (q) => {
|
|
5931
|
-
(q.key === "Enter" || q.key === " ") && (q.preventDefault(),
|
|
5932
|
+
(q.key === "Enter" || q.key === " ") && (q.preventDefault(), ce());
|
|
5932
5933
|
},
|
|
5933
5934
|
"aria-label": "Hapus input",
|
|
5934
5935
|
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-text-area__clear-icon" })
|
|
@@ -5936,8 +5937,8 @@ function us({
|
|
|
5936
5937
|
),
|
|
5937
5938
|
s && /* @__PURE__ */ n("div", { className: "ina-text-area__suffix-icon", children: s })
|
|
5938
5939
|
] }),
|
|
5939
|
-
|
|
5940
|
-
|
|
5940
|
+
W && /* @__PURE__ */ n("div", { id: se, className: O, children: W }),
|
|
5941
|
+
N && u != null && /* @__PURE__ */ w("div", { className: "ina-text-area__char-count", children: [
|
|
5941
5942
|
T.length,
|
|
5942
5943
|
"/",
|
|
5943
5944
|
u
|
|
@@ -5956,38 +5957,38 @@ function fs({
|
|
|
5956
5957
|
readonly: b = !1,
|
|
5957
5958
|
className: h = "",
|
|
5958
5959
|
onComplete: u,
|
|
5959
|
-
autoFocus:
|
|
5960
|
+
autoFocus: N = !1
|
|
5960
5961
|
}) {
|
|
5961
5962
|
const m = le([]);
|
|
5962
5963
|
oe(() => {
|
|
5963
5964
|
m.current = m.current.slice(0, t);
|
|
5964
5965
|
}, [t]), oe(() => {
|
|
5965
|
-
|
|
5966
|
-
}, [
|
|
5967
|
-
const
|
|
5968
|
-
if (
|
|
5969
|
-
const k =
|
|
5966
|
+
N && m.current[0] && !c && !b && m.current[0].focus();
|
|
5967
|
+
}, [N, c, b]), oe(() => {
|
|
5968
|
+
const C = e || "";
|
|
5969
|
+
if (C.length < t && C.length > 0) {
|
|
5970
|
+
const k = C.length;
|
|
5970
5971
|
m.current[k] && !c && !b && m.current[k].focus();
|
|
5971
5972
|
}
|
|
5972
5973
|
}, [e, t, c, b]), oe(() => {
|
|
5973
5974
|
e && e.length === t && u && u(e);
|
|
5974
5975
|
}, [e, t, u]);
|
|
5975
|
-
const p = (
|
|
5976
|
+
const p = (C, k) => {
|
|
5976
5977
|
const _ = k.target.value;
|
|
5977
5978
|
if (_ && !/^\d$/.test(_))
|
|
5978
5979
|
return;
|
|
5979
5980
|
const f = e.split("");
|
|
5980
|
-
f[
|
|
5981
|
+
f[C] = _;
|
|
5981
5982
|
const T = f.join("").slice(0, t);
|
|
5982
|
-
if (a(T), _ &&
|
|
5983
|
-
const $ =
|
|
5983
|
+
if (a(T), _ && C < t - 1) {
|
|
5984
|
+
const $ = C + 1;
|
|
5984
5985
|
m.current[$] && m.current[$].focus();
|
|
5985
5986
|
}
|
|
5986
|
-
}, I = (
|
|
5987
|
+
}, I = (C, k) => {
|
|
5987
5988
|
var _, f;
|
|
5988
5989
|
if (k.key === "Backspace")
|
|
5989
|
-
if (!(e || "")[
|
|
5990
|
-
const $ =
|
|
5990
|
+
if (!(e || "")[C] && C > 0) {
|
|
5991
|
+
const $ = C - 1;
|
|
5991
5992
|
if (m.current[$]) {
|
|
5992
5993
|
m.current[$].focus();
|
|
5993
5994
|
const Y = e.split("");
|
|
@@ -5995,9 +5996,9 @@ function fs({
|
|
|
5995
5996
|
}
|
|
5996
5997
|
} else {
|
|
5997
5998
|
const $ = e.split("");
|
|
5998
|
-
$[
|
|
5999
|
+
$[C] = "", a($.join(""));
|
|
5999
6000
|
}
|
|
6000
|
-
k.key === "ArrowLeft" &&
|
|
6001
|
+
k.key === "ArrowLeft" && C > 0 && (k.preventDefault(), (_ = m.current[C - 1]) == null || _.focus()), k.key === "ArrowRight" && C < t - 1 && (k.preventDefault(), (f = m.current[C + 1]) == null || f.focus()), (k.ctrlKey || k.metaKey) && k.key === "v" && (k.preventDefault(), navigator.clipboard.readText().then((T) => {
|
|
6001
6002
|
const $ = T.replace(/\D/g, "").slice(0, t);
|
|
6002
6003
|
if ($) {
|
|
6003
6004
|
a($);
|
|
@@ -6005,12 +6006,12 @@ function fs({
|
|
|
6005
6006
|
m.current[Y] && m.current[Y].focus();
|
|
6006
6007
|
}
|
|
6007
6008
|
}));
|
|
6008
|
-
}, E = (
|
|
6009
|
-
m.current[
|
|
6009
|
+
}, E = (C) => {
|
|
6010
|
+
m.current[C] && m.current[C].select();
|
|
6010
6011
|
}, A = () => {
|
|
6011
|
-
}, F = (
|
|
6012
|
-
|
|
6013
|
-
const _ =
|
|
6012
|
+
}, F = (C) => {
|
|
6013
|
+
C.preventDefault();
|
|
6014
|
+
const _ = C.clipboardData.getData("text").replace(/\D/g, "").slice(0, t);
|
|
6014
6015
|
if (_) {
|
|
6015
6016
|
a(_);
|
|
6016
6017
|
const f = Math.min(_.length - 1, t - 1);
|
|
@@ -6022,7 +6023,7 @@ function fs({
|
|
|
6022
6023
|
return /* @__PURE__ */ w("div", { className: S("ina-one-time-password", h), children: [
|
|
6023
6024
|
r && /* @__PURE__ */ n("div", { className: "ina-one-time-password__title", children: r }),
|
|
6024
6025
|
i && /* @__PURE__ */ n("div", { className: "ina-one-time-password__description", children: i }),
|
|
6025
|
-
/* @__PURE__ */ n("div", { className: "ina-one-time-password__container", children: Array.from({ length: t }).map((
|
|
6026
|
+
/* @__PURE__ */ n("div", { className: "ina-one-time-password__container", children: Array.from({ length: t }).map((C, k) => {
|
|
6026
6027
|
const _ = e[k] || "";
|
|
6027
6028
|
return /* @__PURE__ */ n(
|
|
6028
6029
|
"input",
|
|
@@ -6094,25 +6095,25 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6094
6095
|
status: b = "neutral",
|
|
6095
6096
|
value: h,
|
|
6096
6097
|
onChange: u,
|
|
6097
|
-
onOpenChange:
|
|
6098
|
+
onOpenChange: N,
|
|
6098
6099
|
className: m = "",
|
|
6099
6100
|
use12Hours: p = !1,
|
|
6100
6101
|
showSecond: I = !1,
|
|
6101
6102
|
allowClear: E = !0,
|
|
6102
6103
|
prefixIcon: A,
|
|
6103
6104
|
suffixIcon: F,
|
|
6104
|
-
disabledBackTime:
|
|
6105
|
+
disabledBackTime: C = !1,
|
|
6105
6106
|
disabledTimeBefore: k,
|
|
6106
6107
|
disabledTimeAfter: _,
|
|
6107
6108
|
showNowButton: f = !1,
|
|
6108
6109
|
label: T,
|
|
6109
6110
|
required: $,
|
|
6110
6111
|
...Y
|
|
6111
|
-
},
|
|
6112
|
-
const [V,
|
|
6112
|
+
}, P) => {
|
|
6113
|
+
const [V, H] = Z(!1), [G, K] = Z(
|
|
6113
6114
|
e || h || ""
|
|
6114
|
-
), [ae,
|
|
6115
|
-
va(
|
|
6115
|
+
), [ae, ce] = Z(null), [te, X] = Z(null), [O, W] = Z(!1), B = le(null), se = le(null), q = le(null);
|
|
6116
|
+
va(P, () => ({
|
|
6116
6117
|
focus: () => {
|
|
6117
6118
|
var o;
|
|
6118
6119
|
return (o = se.current) == null ? void 0 : o.focus();
|
|
@@ -6124,33 +6125,33 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6124
6125
|
}));
|
|
6125
6126
|
const j = (o) => {
|
|
6126
6127
|
if (!o) return { hours: 0, minutes: 0, seconds: 0, period: "AM" };
|
|
6127
|
-
const y = o.split(":"),
|
|
6128
|
+
const y = o.split(":"), M = y[0], R = parseInt(y[1] || "0", 10), L = parseInt(y[2] || "0", 10);
|
|
6128
6129
|
if (p) {
|
|
6129
|
-
const z = o.includes("AM") ? "AM" : "PM", d = parseInt(
|
|
6130
|
+
const z = o.includes("AM") ? "AM" : "PM", d = parseInt(M.replace(/[^\d]/g, ""), 10);
|
|
6130
6131
|
return { hours: d === 12 ? 0 : d, minutes: R, seconds: L, period: z };
|
|
6131
6132
|
} else
|
|
6132
|
-
return { hours: parseInt(
|
|
6133
|
-
}, Q = (o, y,
|
|
6133
|
+
return { hours: parseInt(M, 10), minutes: R, seconds: L, period: "AM" };
|
|
6134
|
+
}, Q = (o, y, M, R) => {
|
|
6134
6135
|
let L = o;
|
|
6135
6136
|
p && (R === "PM" && o > 0 && (L = o + 12), L = L || 12);
|
|
6136
6137
|
const z = L.toString().padStart(2, "0"), d = y.toString().padStart(2, "0");
|
|
6137
6138
|
if (I) {
|
|
6138
|
-
const D =
|
|
6139
|
+
const D = M.toString().padStart(2, "0");
|
|
6139
6140
|
return p ? `${o}:${d}:${D} ${R}` : `${z}:${d}:${D}`;
|
|
6140
6141
|
}
|
|
6141
6142
|
return p ? `${o}:${d} ${R}` : `${z}:${d}`;
|
|
6142
6143
|
}, ee = (o) => {
|
|
6143
6144
|
if (!o) return 0;
|
|
6144
|
-
const y = o.split(":"),
|
|
6145
|
+
const y = o.split(":"), M = parseInt(y[0] || "0", 10), R = parseInt(y[1] || "0", 10);
|
|
6145
6146
|
if (p && o.includes(" ")) {
|
|
6146
6147
|
const L = o.split(" ")[1];
|
|
6147
|
-
let z =
|
|
6148
|
-
return L === "PM" &&
|
|
6148
|
+
let z = M;
|
|
6149
|
+
return L === "PM" && M !== 12 ? z = M + 12 : L === "AM" && M === 12 && (z = 0), z * 60 + R;
|
|
6149
6150
|
}
|
|
6150
|
-
return
|
|
6151
|
-
},
|
|
6152
|
-
const z = Q(o, y,
|
|
6153
|
-
if (
|
|
6151
|
+
return M * 60 + R;
|
|
6152
|
+
}, de = (o, y, M, R, L = {}) => {
|
|
6153
|
+
const z = Q(o, y, M, R), d = ee(z);
|
|
6154
|
+
if (C && !L.ignoreBefore) {
|
|
6154
6155
|
const D = /* @__PURE__ */ new Date(), x = D.getHours() * 60 + D.getMinutes();
|
|
6155
6156
|
if (d < x)
|
|
6156
6157
|
return !0;
|
|
@@ -6170,33 +6171,33 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6170
6171
|
const y = [];
|
|
6171
6172
|
switch (o === "hour" ? p ? 12 : 24 : 60) {
|
|
6172
6173
|
case 12:
|
|
6173
|
-
for (let
|
|
6174
|
-
y.push(
|
|
6174
|
+
for (let M = o === "hour" ? 1 : 0; M <= (o === "hour" ? 12 : 59); M += o === "hour" ? r : o === "minute" ? i : 1)
|
|
6175
|
+
y.push(M);
|
|
6175
6176
|
break;
|
|
6176
6177
|
case 24:
|
|
6177
|
-
for (let
|
|
6178
|
-
y.push(
|
|
6178
|
+
for (let M = 0; M <= 23; M += r)
|
|
6179
|
+
y.push(M);
|
|
6179
6180
|
break;
|
|
6180
6181
|
case 60:
|
|
6181
|
-
for (let
|
|
6182
|
-
y.push(
|
|
6182
|
+
for (let M = 0; M <= 59; M += o === "minute" ? i : s)
|
|
6183
|
+
y.push(M);
|
|
6183
6184
|
break;
|
|
6184
6185
|
}
|
|
6185
6186
|
return y;
|
|
6186
|
-
}, ie = j(
|
|
6187
|
-
a || V || (
|
|
6187
|
+
}, ie = j(G || ""), J = _e("hour"), he = _e("minute"), ve = _e("second"), fe = () => {
|
|
6188
|
+
a || V || (H(!0), W(!0), N == null || N(!0), setTimeout(() => {
|
|
6188
6189
|
var o;
|
|
6189
6190
|
return (o = se.current) == null ? void 0 : o.focus();
|
|
6190
6191
|
}, 0));
|
|
6191
6192
|
}, pe = () => {
|
|
6192
|
-
|
|
6193
|
+
H(!1), W(!1), ce(null), X(null), N == null || N(!1);
|
|
6193
6194
|
}, Ce = () => {
|
|
6194
6195
|
a || (V ? pe() : fe());
|
|
6195
6196
|
}, be = (o, y) => {
|
|
6196
|
-
let
|
|
6197
|
+
let M = ie.hours, R = ie.minutes, L = ie.seconds, z = ie.period;
|
|
6197
6198
|
switch (o) {
|
|
6198
6199
|
case "hour":
|
|
6199
|
-
|
|
6200
|
+
M = p && y === 12 ? 0 : y;
|
|
6200
6201
|
break;
|
|
6201
6202
|
case "minute":
|
|
6202
6203
|
R = y;
|
|
@@ -6209,36 +6210,36 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6209
6210
|
break;
|
|
6210
6211
|
}
|
|
6211
6212
|
const d = Q(
|
|
6212
|
-
|
|
6213
|
+
M,
|
|
6213
6214
|
R,
|
|
6214
6215
|
L,
|
|
6215
6216
|
p ? z : void 0
|
|
6216
6217
|
);
|
|
6217
|
-
|
|
6218
|
+
K(d), u == null || u(d);
|
|
6218
6219
|
}, we = (o) => {
|
|
6219
6220
|
let y = o.target.value;
|
|
6220
|
-
const
|
|
6221
|
-
y = (y.match(
|
|
6221
|
+
const M = p ? /[0-9: apm]/gi : /[0-9:]/g;
|
|
6222
|
+
y = (y.match(M) || []).join("");
|
|
6222
6223
|
let R = y.replace(/[^0-9]/g, ""), L = "";
|
|
6223
6224
|
if (R.length > 0 && (L += R.slice(0, 2), R.length > 2 && (L += ":" + R.slice(2, 4), I && R.length > 4 && (L += ":" + R.slice(4, 6)))), p) {
|
|
6224
6225
|
const d = y.match(/(am|pm)/i);
|
|
6225
6226
|
d ? L += " " + d[0].toUpperCase() : y.includes(" ") && (L += " ");
|
|
6226
6227
|
}
|
|
6227
6228
|
let z = 5;
|
|
6228
|
-
I && (z = 8), p && (z += 3), L = L.slice(0, z), o.target.value = L,
|
|
6229
|
+
I && (z = 8), p && (z += 3), L = L.slice(0, z), o.target.value = L, K(L), u == null || u(L);
|
|
6229
6230
|
}, ke = () => {
|
|
6230
|
-
|
|
6231
|
+
K(""), u == null || u("");
|
|
6231
6232
|
};
|
|
6232
6233
|
oe(() => {
|
|
6233
|
-
h !== void 0 && h !==
|
|
6234
|
+
h !== void 0 && h !== G && K(h);
|
|
6234
6235
|
}, [h]), oe(() => {
|
|
6235
6236
|
const o = (y) => {
|
|
6236
|
-
|
|
6237
|
+
B.current && !B.current.contains(y.target) && pe();
|
|
6237
6238
|
};
|
|
6238
6239
|
if (V)
|
|
6239
6240
|
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
6240
6241
|
}, [V]);
|
|
6241
|
-
const Ne = (o, y,
|
|
6242
|
+
const Ne = (o, y, M) => /* @__PURE__ */ n(
|
|
6242
6243
|
"div",
|
|
6243
6244
|
{
|
|
6244
6245
|
className: S(
|
|
@@ -6251,18 +6252,18 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6251
6252
|
{
|
|
6252
6253
|
className: "ina-time-picker__column-content",
|
|
6253
6254
|
onMouseLeave: () => {
|
|
6254
|
-
|
|
6255
|
+
ce(null), X(null);
|
|
6255
6256
|
},
|
|
6256
6257
|
children: y.map((R) => {
|
|
6257
6258
|
let L = !1;
|
|
6258
6259
|
if (o === "hour") {
|
|
6259
|
-
const D = p && R === 12 ? 0 : R, x =
|
|
6260
|
+
const D = p && R === 12 ? 0 : R, x = de(
|
|
6260
6261
|
D,
|
|
6261
6262
|
59,
|
|
6262
6263
|
59,
|
|
6263
6264
|
p ? ie.period : void 0,
|
|
6264
6265
|
{ ignoreAfter: !0 }
|
|
6265
|
-
), v =
|
|
6266
|
+
), v = de(
|
|
6266
6267
|
D,
|
|
6267
6268
|
0,
|
|
6268
6269
|
0,
|
|
@@ -6270,23 +6271,23 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6270
6271
|
{ ignoreBefore: !0 }
|
|
6271
6272
|
);
|
|
6272
6273
|
L = x || v;
|
|
6273
|
-
} else o === "minute" ? L =
|
|
6274
|
+
} else o === "minute" ? L = de(
|
|
6274
6275
|
ie.hours,
|
|
6275
6276
|
R,
|
|
6276
6277
|
ie.seconds,
|
|
6277
6278
|
p ? ie.period : void 0
|
|
6278
|
-
) : o === "second" ? L =
|
|
6279
|
+
) : o === "second" ? L = de(
|
|
6279
6280
|
ie.hours,
|
|
6280
6281
|
ie.minutes,
|
|
6281
6282
|
R,
|
|
6282
6283
|
p ? ie.period : void 0
|
|
6283
|
-
) : o === "period" && (L =
|
|
6284
|
+
) : o === "period" && (L = de(
|
|
6284
6285
|
ie.hours,
|
|
6285
6286
|
ie.minutes,
|
|
6286
6287
|
ie.seconds,
|
|
6287
6288
|
R
|
|
6288
6289
|
));
|
|
6289
|
-
const z = R ===
|
|
6290
|
+
const z = R === M, d = z || !y.includes(M) && R === y[0];
|
|
6290
6291
|
return /* @__PURE__ */ n(
|
|
6291
6292
|
"div",
|
|
6292
6293
|
{
|
|
@@ -6316,7 +6317,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6316
6317
|
}
|
|
6317
6318
|
},
|
|
6318
6319
|
onMouseEnter: () => {
|
|
6319
|
-
L || (
|
|
6320
|
+
L || (ce(o), X(R));
|
|
6320
6321
|
},
|
|
6321
6322
|
children: R.toString().padStart(2, "0")
|
|
6322
6323
|
},
|
|
@@ -6339,7 +6340,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6339
6340
|
"ina-time-picker__input--with-prefix",
|
|
6340
6341
|
(F || E) && "ina-time-picker__input--with-suffix"
|
|
6341
6342
|
);
|
|
6342
|
-
return /* @__PURE__ */ w("div", { ref:
|
|
6343
|
+
return /* @__PURE__ */ w("div", { ref: B, className: Ve, children: [
|
|
6343
6344
|
T && /* @__PURE__ */ w("label", { className: "ina-time-picker__label", children: [
|
|
6344
6345
|
T,
|
|
6345
6346
|
$ && /* @__PURE__ */ n("span", { className: "ina-time-picker__required", children: "*" })
|
|
@@ -6367,23 +6368,23 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6367
6368
|
ref: se,
|
|
6368
6369
|
type: "text",
|
|
6369
6370
|
className: Ie,
|
|
6370
|
-
value:
|
|
6371
|
+
value: G,
|
|
6371
6372
|
onChange: we,
|
|
6372
6373
|
onClick: (o) => {
|
|
6373
6374
|
o.stopPropagation(), fe();
|
|
6374
6375
|
},
|
|
6375
6376
|
onFocus: () => {
|
|
6376
|
-
|
|
6377
|
+
O || fe(), W(!1);
|
|
6377
6378
|
},
|
|
6378
6379
|
placeholder: l,
|
|
6379
6380
|
disabled: a,
|
|
6380
6381
|
onKeyDown: (o) => {
|
|
6381
|
-
o.key === "Enter" ? (o.preventDefault(),
|
|
6382
|
+
o.key === "Enter" ? (o.preventDefault(), G ? pe() : Ce()) : o.key === "Escape" && V && pe();
|
|
6382
6383
|
},
|
|
6383
6384
|
...Y
|
|
6384
6385
|
}
|
|
6385
6386
|
),
|
|
6386
|
-
E &&
|
|
6387
|
+
E && G && !a && /* @__PURE__ */ n(
|
|
6387
6388
|
"button",
|
|
6388
6389
|
{
|
|
6389
6390
|
type: "button",
|
|
@@ -6403,7 +6404,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6403
6404
|
{
|
|
6404
6405
|
className: "ina-time-picker__suffix-icon",
|
|
6405
6406
|
style: {
|
|
6406
|
-
visibility: E &&
|
|
6407
|
+
visibility: E && G && !a ? "hidden" : "visible"
|
|
6407
6408
|
},
|
|
6408
6409
|
children: F
|
|
6409
6410
|
}
|
|
@@ -6433,7 +6434,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6433
6434
|
{
|
|
6434
6435
|
className: "ina-time-picker__column-content",
|
|
6435
6436
|
onMouseLeave: () => {
|
|
6436
|
-
|
|
6437
|
+
ce(null), X(null);
|
|
6437
6438
|
},
|
|
6438
6439
|
children: ["AM", "PM"].map((o) => /* @__PURE__ */ n(
|
|
6439
6440
|
"div",
|
|
@@ -6444,7 +6445,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6444
6445
|
),
|
|
6445
6446
|
onClick: () => be("period", o),
|
|
6446
6447
|
onMouseEnter: () => {
|
|
6447
|
-
|
|
6448
|
+
ce("period"), X(o);
|
|
6448
6449
|
},
|
|
6449
6450
|
children: o
|
|
6450
6451
|
},
|
|
@@ -6467,13 +6468,13 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6467
6468
|
o.getMinutes(),
|
|
6468
6469
|
I ? o.getSeconds() : 0,
|
|
6469
6470
|
p ? o.getHours() >= 12 ? "PM" : "AM" : void 0
|
|
6470
|
-
),
|
|
6471
|
-
|
|
6471
|
+
), M = o.getHours() % 12 || 12, R = p ? Q(
|
|
6472
|
+
M,
|
|
6472
6473
|
o.getMinutes(),
|
|
6473
6474
|
I ? o.getSeconds() : 0,
|
|
6474
6475
|
o.getHours() >= 12 ? "PM" : "AM"
|
|
6475
6476
|
) : y;
|
|
6476
|
-
|
|
6477
|
+
K(R), u == null || u(R), pe();
|
|
6477
6478
|
},
|
|
6478
6479
|
children: "Sekarang"
|
|
6479
6480
|
}
|
|
@@ -6524,9 +6525,9 @@ function $n({
|
|
|
6524
6525
|
position: b = "top-right",
|
|
6525
6526
|
className: h = ""
|
|
6526
6527
|
}) {
|
|
6527
|
-
const [u,
|
|
6528
|
+
const [u, N] = Z(!1), [m, p] = Z(!1), [I, E] = Z(!1), A = le(), F = le(null), C = Ln[s];
|
|
6528
6529
|
oe(() => {
|
|
6529
|
-
|
|
6530
|
+
N(!0);
|
|
6530
6531
|
}, []), oe(() => {
|
|
6531
6532
|
if (u)
|
|
6532
6533
|
return F.current = Fn(b), () => {
|
|
@@ -6550,7 +6551,7 @@ function $n({
|
|
|
6550
6551
|
h
|
|
6551
6552
|
);
|
|
6552
6553
|
return Lt(/* @__PURE__ */ n("div", { className: "ina-toast-item", children: /* @__PURE__ */ w("div", { className: _, children: [
|
|
6553
|
-
/* @__PURE__ */ n("div", { className: "ina-toast__icon", children:
|
|
6554
|
+
/* @__PURE__ */ n("div", { className: "ina-toast__icon", children: C }),
|
|
6554
6555
|
/* @__PURE__ */ w("div", { className: "ina-toast__content", children: [
|
|
6555
6556
|
/* @__PURE__ */ w("div", { className: "ina-toast__text-area", children: [
|
|
6556
6557
|
/* @__PURE__ */ n("p", { className: "ina-toast__title", children: t }),
|
|
@@ -6581,7 +6582,7 @@ function ps({
|
|
|
6581
6582
|
onClose: b,
|
|
6582
6583
|
onNext: h,
|
|
6583
6584
|
customContent: u = !1,
|
|
6584
|
-
className:
|
|
6585
|
+
className: N = ""
|
|
6585
6586
|
}) {
|
|
6586
6587
|
const [m, p] = Z(!1), I = () => {
|
|
6587
6588
|
p(!0), b && b();
|
|
@@ -6592,11 +6593,11 @@ function ps({
|
|
|
6592
6593
|
}, F = S(
|
|
6593
6594
|
"ina-tooltip",
|
|
6594
6595
|
`ina-tooltip--placement-${l}`,
|
|
6595
|
-
|
|
6596
|
+
N,
|
|
6596
6597
|
{
|
|
6597
6598
|
"ina-tooltip--closed": m
|
|
6598
6599
|
}
|
|
6599
|
-
),
|
|
6600
|
+
), C = S("ina-tooltip__content", {
|
|
6600
6601
|
"ina-tooltip__content--show-arrow": c,
|
|
6601
6602
|
"ina-tooltip--variant-basic": s === "basic",
|
|
6602
6603
|
"ina-tooltip--variant-light": s === "light",
|
|
@@ -6605,7 +6606,7 @@ function ps({
|
|
|
6605
6606
|
});
|
|
6606
6607
|
return /* @__PURE__ */ w("div", { className: F, onMouseEnter: A, children: [
|
|
6607
6608
|
i,
|
|
6608
|
-
/* @__PURE__ */ n("div", { className:
|
|
6609
|
+
/* @__PURE__ */ n("div", { className: C, role: "tooltip", children: u && r ? r : s === "basic" ? /* @__PURE__ */ n("div", { className: "ina-tooltip__bubble ina-tooltip__bubble--basic", children: e }) : /* @__PURE__ */ w("div", { className: `ina-tooltip__card ina-tooltip__card--${s}`, children: [
|
|
6609
6610
|
b && /* @__PURE__ */ n(
|
|
6610
6611
|
"button",
|
|
6611
6612
|
{
|
|
@@ -6783,19 +6784,19 @@ const Ea = Tt({
|
|
|
6783
6784
|
const [a, t] = Z(null), [r, i] = Z(null), s = (c) => {
|
|
6784
6785
|
r && r.resolve(c), t(null), i(null);
|
|
6785
6786
|
}, l = (c) => new Promise((b) => {
|
|
6786
|
-
const h = "ina-modal-confirmation__cancel", u = "ina-modal-confirmation__confirm",
|
|
6787
|
+
const h = "ina-modal-confirmation__cancel", u = "ina-modal-confirmation__confirm", N = c.cancelText ?? "Batal", m = c.confirmText ?? "Ya";
|
|
6787
6788
|
t({
|
|
6788
6789
|
title: c.title ?? "Confirmation",
|
|
6789
6790
|
message: c.message,
|
|
6790
6791
|
confirmText: m,
|
|
6791
|
-
cancelText:
|
|
6792
|
+
cancelText: N,
|
|
6792
6793
|
cancelClassName: c.cancelClassName ?? h,
|
|
6793
6794
|
confirmClassName: c.confirmClassName ?? u,
|
|
6794
6795
|
dialogClassname: c.dialogClassname ?? "ina-modal-confirmation",
|
|
6795
6796
|
footerActions: c.footerActions ?? ((p) => Bn(
|
|
6796
6797
|
c.cancelClassName ?? h,
|
|
6797
6798
|
c.confirmClassName ?? u,
|
|
6798
|
-
|
|
6799
|
+
N,
|
|
6799
6800
|
m,
|
|
6800
6801
|
p
|
|
6801
6802
|
))
|
|
@@ -6973,7 +6974,7 @@ function Ue(e, a, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
6973
6974
|
return !0;
|
|
6974
6975
|
}
|
|
6975
6976
|
function Un(e) {
|
|
6976
|
-
const a = Bt(), { control: t = a, name: r, defaultValue: i, disabled: s, exact: l, compute: c } = e || {}, b = ge.useRef(i), h = ge.useRef(c), u = ge.useRef(void 0),
|
|
6977
|
+
const a = Bt(), { control: t = a, name: r, defaultValue: i, disabled: s, exact: l, compute: c } = e || {}, b = ge.useRef(i), h = ge.useRef(c), u = ge.useRef(void 0), N = ge.useRef(t), m = ge.useRef(r);
|
|
6977
6978
|
h.current = c;
|
|
6978
6979
|
const [p, I] = ge.useState(() => {
|
|
6979
6980
|
const _ = t._getWatch(r, b.current);
|
|
@@ -6991,7 +6992,7 @@ function Un(e) {
|
|
|
6991
6992
|
I(f);
|
|
6992
6993
|
}
|
|
6993
6994
|
}, [t._formValues, t._names, s, r]);
|
|
6994
|
-
Pt(() => ((
|
|
6995
|
+
Pt(() => ((N.current !== t || !Ue(m.current, r)) && (N.current = t, m.current = r, A()), t._subscribe({
|
|
6995
6996
|
name: r,
|
|
6996
6997
|
formState: {
|
|
6997
6998
|
values: !0
|
|
@@ -7001,12 +7002,12 @@ function Un(e) {
|
|
|
7001
7002
|
A(_.values);
|
|
7002
7003
|
}
|
|
7003
7004
|
})), [t, l, r, A]), ge.useEffect(() => t._removeUnmounted());
|
|
7004
|
-
const F =
|
|
7005
|
+
const F = N.current !== t, C = m.current, k = ge.useMemo(() => {
|
|
7005
7006
|
if (s)
|
|
7006
7007
|
return null;
|
|
7007
|
-
const _ = !F && !Ue(
|
|
7008
|
+
const _ = !F && !Ue(C, r);
|
|
7008
7009
|
return F || _ ? E() : null;
|
|
7009
|
-
}, [s, F, r,
|
|
7010
|
+
}, [s, F, r, C, E]);
|
|
7010
7011
|
return k !== null ? k : p;
|
|
7011
7012
|
}
|
|
7012
7013
|
function Gn(e) {
|
|
@@ -7015,7 +7016,7 @@ function Gn(e) {
|
|
|
7015
7016
|
name: t,
|
|
7016
7017
|
defaultValue: h,
|
|
7017
7018
|
exact: c
|
|
7018
|
-
}),
|
|
7019
|
+
}), N = On({
|
|
7019
7020
|
control: i,
|
|
7020
7021
|
name: t,
|
|
7021
7022
|
exact: c
|
|
@@ -7028,25 +7029,25 @@ function Gn(e) {
|
|
|
7028
7029
|
const E = ge.useMemo(() => Object.defineProperties({}, {
|
|
7029
7030
|
invalid: {
|
|
7030
7031
|
enumerable: !0,
|
|
7031
|
-
get: () => !!ne(
|
|
7032
|
+
get: () => !!ne(N.errors, t)
|
|
7032
7033
|
},
|
|
7033
7034
|
isDirty: {
|
|
7034
7035
|
enumerable: !0,
|
|
7035
|
-
get: () => !!ne(
|
|
7036
|
+
get: () => !!ne(N.dirtyFields, t)
|
|
7036
7037
|
},
|
|
7037
7038
|
isTouched: {
|
|
7038
7039
|
enumerable: !0,
|
|
7039
|
-
get: () => !!ne(
|
|
7040
|
+
get: () => !!ne(N.touchedFields, t)
|
|
7040
7041
|
},
|
|
7041
7042
|
isValidating: {
|
|
7042
7043
|
enumerable: !0,
|
|
7043
|
-
get: () => !!ne(
|
|
7044
|
+
get: () => !!ne(N.validatingFields, t)
|
|
7044
7045
|
},
|
|
7045
7046
|
error: {
|
|
7046
7047
|
enumerable: !0,
|
|
7047
|
-
get: () => ne(
|
|
7048
|
+
get: () => ne(N.errors, t)
|
|
7048
7049
|
}
|
|
7049
|
-
}), [
|
|
7050
|
+
}), [N, t]), A = ge.useCallback((_) => I.current.onChange({
|
|
7050
7051
|
target: {
|
|
7051
7052
|
value: Va(_),
|
|
7052
7053
|
name: t
|
|
@@ -7058,7 +7059,7 @@ function Gn(e) {
|
|
|
7058
7059
|
name: t
|
|
7059
7060
|
},
|
|
7060
7061
|
type: ft.BLUR
|
|
7061
|
-
}), [t, i._formValues]),
|
|
7062
|
+
}), [t, i._formValues]), C = ge.useCallback((_) => {
|
|
7062
7063
|
const f = ne(i._fields, t);
|
|
7063
7064
|
f && f._f && _ && (f._f.ref = {
|
|
7064
7065
|
focus: () => Re(_.focus) && _.focus(),
|
|
@@ -7069,11 +7070,11 @@ function Gn(e) {
|
|
|
7069
7070
|
}, [i._fields, t]), k = ge.useMemo(() => ({
|
|
7070
7071
|
name: t,
|
|
7071
7072
|
value: u,
|
|
7072
|
-
...Pe(r) ||
|
|
7073
|
+
...Pe(r) || N.disabled ? { disabled: N.disabled || r } : {},
|
|
7073
7074
|
onChange: A,
|
|
7074
7075
|
onBlur: F,
|
|
7075
|
-
ref:
|
|
7076
|
-
}), [t, r,
|
|
7076
|
+
ref: C
|
|
7077
|
+
}), [t, r, N.disabled, A, F, C, u]);
|
|
7077
7078
|
return ge.useEffect(() => {
|
|
7078
7079
|
const _ = i._options.shouldUnregister || s, f = p.current;
|
|
7079
7080
|
f && f !== t && !b && i.unregister(f), i.register(t, {
|
|
@@ -7081,8 +7082,8 @@ function Gn(e) {
|
|
|
7081
7082
|
...Pe(m.current.disabled) ? { disabled: m.current.disabled } : {}
|
|
7082
7083
|
});
|
|
7083
7084
|
const T = ($, Y) => {
|
|
7084
|
-
const
|
|
7085
|
-
|
|
7085
|
+
const P = ne(i._fields, $);
|
|
7086
|
+
P && P._f && (P._f.mount = Y);
|
|
7086
7087
|
};
|
|
7087
7088
|
if (T(t, !0), _) {
|
|
7088
7089
|
const $ = Ee(ne(i._options.defaultValues, t, m.current.defaultValue));
|
|
@@ -7098,14 +7099,14 @@ function Gn(e) {
|
|
|
7098
7099
|
});
|
|
7099
7100
|
}, [r, t, i]), ge.useMemo(() => ({
|
|
7100
7101
|
field: k,
|
|
7101
|
-
formState:
|
|
7102
|
+
formState: N,
|
|
7102
7103
|
fieldState: E
|
|
7103
|
-
}), [k,
|
|
7104
|
+
}), [k, N, E]);
|
|
7104
7105
|
}
|
|
7105
7106
|
const Kn = (e) => e.render(Gn(e)), Fa = ge.createContext(null);
|
|
7106
7107
|
Fa.displayName = "HookFormContext";
|
|
7107
7108
|
const Wn = (e) => {
|
|
7108
|
-
const { children: a, watch: t, getValues: r, getFieldState: i, setError: s, clearErrors: l, setValue: c, trigger: b, formState: h, resetField: u, reset:
|
|
7109
|
+
const { children: a, watch: t, getValues: r, getFieldState: i, setError: s, clearErrors: l, setValue: c, trigger: b, formState: h, resetField: u, reset: N, handleSubmit: m, unregister: p, control: I, register: E, setFocus: A, subscribe: F } = e;
|
|
7109
7110
|
return ge.createElement(
|
|
7110
7111
|
Fa.Provider,
|
|
7111
7112
|
{ value: ge.useMemo(() => ({
|
|
@@ -7118,7 +7119,7 @@ const Wn = (e) => {
|
|
|
7118
7119
|
trigger: b,
|
|
7119
7120
|
formState: h,
|
|
7120
7121
|
resetField: u,
|
|
7121
|
-
reset:
|
|
7122
|
+
reset: N,
|
|
7122
7123
|
handleSubmit: m,
|
|
7123
7124
|
unregister: p,
|
|
7124
7125
|
control: I,
|
|
@@ -7133,7 +7134,7 @@ const Wn = (e) => {
|
|
|
7133
7134
|
r,
|
|
7134
7135
|
m,
|
|
7135
7136
|
E,
|
|
7136
|
-
|
|
7137
|
+
N,
|
|
7137
7138
|
u,
|
|
7138
7139
|
s,
|
|
7139
7140
|
A,
|
|
@@ -7351,80 +7352,80 @@ var Je = (e) => Se(e) && !mt(e) ? e : {
|
|
|
7351
7352
|
value: e,
|
|
7352
7353
|
message: ""
|
|
7353
7354
|
}, oa = async (e, a, t, r, i, s) => {
|
|
7354
|
-
const { ref: l, refs: c, required: b, maxLength: h, minLength: u, min:
|
|
7355
|
+
const { ref: l, refs: c, required: b, maxLength: h, minLength: u, min: N, max: m, pattern: p, validate: I, name: E, valueAsNumber: A, mount: F } = e._f, C = ne(t, E);
|
|
7355
7356
|
if (!F || a.has(E))
|
|
7356
7357
|
return {};
|
|
7357
|
-
const k = c ? c[0] : l, _ = (
|
|
7358
|
-
i && k.reportValidity && (k.setCustomValidity(Pe(
|
|
7359
|
-
}, f = {}, T = Ot(l), $ = st(l), Y = T || $,
|
|
7360
|
-
const X =
|
|
7358
|
+
const k = c ? c[0] : l, _ = (G) => {
|
|
7359
|
+
i && k.reportValidity && (k.setCustomValidity(Pe(G) ? "" : G || ""), k.reportValidity());
|
|
7360
|
+
}, f = {}, T = Ot(l), $ = st(l), Y = T || $, P = (A || Ht(l)) && xe(l.value) && xe(C) || pt(l) && l.value === "" || C === "" || Array.isArray(C) && !C.length, V = jn.bind(null, E, r, f), H = (G, K, ae, ce = We.maxLength, te = We.minLength) => {
|
|
7361
|
+
const X = G ? K : ae;
|
|
7361
7362
|
f[E] = {
|
|
7362
|
-
type:
|
|
7363
|
+
type: G ? ce : te,
|
|
7363
7364
|
message: X,
|
|
7364
7365
|
ref: l,
|
|
7365
|
-
...V(
|
|
7366
|
+
...V(G ? ce : te, X)
|
|
7366
7367
|
};
|
|
7367
7368
|
};
|
|
7368
|
-
if (s ? !Array.isArray(
|
|
7369
|
-
const { value:
|
|
7370
|
-
if (
|
|
7369
|
+
if (s ? !Array.isArray(C) || !C.length : b && (!Y && (P || Be(C)) || Pe(C) && !C || $ && !Ba(c).isValid || T && !Ha(c).isValid)) {
|
|
7370
|
+
const { value: G, message: K } = He(b) ? { value: !!b, message: b } : Je(b);
|
|
7371
|
+
if (G && (f[E] = {
|
|
7371
7372
|
type: We.required,
|
|
7372
|
-
message:
|
|
7373
|
+
message: K,
|
|
7373
7374
|
ref: k,
|
|
7374
|
-
...V(We.required,
|
|
7375
|
+
...V(We.required, K)
|
|
7375
7376
|
}, !r))
|
|
7376
|
-
return _(
|
|
7377
|
+
return _(K), f;
|
|
7377
7378
|
}
|
|
7378
|
-
if (!
|
|
7379
|
-
let
|
|
7380
|
-
const ae = Je(m),
|
|
7381
|
-
if (!Be(
|
|
7382
|
-
const te = l.valueAsNumber ||
|
|
7383
|
-
Be(ae.value) || (
|
|
7379
|
+
if (!P && (!Be(N) || !Be(m))) {
|
|
7380
|
+
let G, K;
|
|
7381
|
+
const ae = Je(m), ce = Je(N);
|
|
7382
|
+
if (!Be(C) && !isNaN(C)) {
|
|
7383
|
+
const te = l.valueAsNumber || C && +C;
|
|
7384
|
+
Be(ae.value) || (G = te > ae.value), Be(ce.value) || (K = te < ce.value);
|
|
7384
7385
|
} else {
|
|
7385
|
-
const te = l.valueAsDate || new Date(
|
|
7386
|
-
He(ae.value) &&
|
|
7386
|
+
const te = l.valueAsDate || new Date(C), X = (B) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + B), O = l.type == "time", W = l.type == "week";
|
|
7387
|
+
He(ae.value) && C && (G = O ? X(C) > X(ae.value) : W ? C > ae.value : te > new Date(ae.value)), He(ce.value) && C && (K = O ? X(C) < X(ce.value) : W ? C < ce.value : te < new Date(ce.value));
|
|
7387
7388
|
}
|
|
7388
|
-
if ((
|
|
7389
|
+
if ((G || K) && (H(!!G, ae.message, ce.message, We.max, We.min), !r))
|
|
7389
7390
|
return _(f[E].message), f;
|
|
7390
7391
|
}
|
|
7391
|
-
if ((h || u) && !
|
|
7392
|
-
const
|
|
7393
|
-
if ((ae ||
|
|
7392
|
+
if ((h || u) && !P && (He(C) || s && Array.isArray(C))) {
|
|
7393
|
+
const G = Je(h), K = Je(u), ae = !Be(G.value) && C.length > +G.value, ce = !Be(K.value) && C.length < +K.value;
|
|
7394
|
+
if ((ae || ce) && (H(ae, G.message, K.message), !r))
|
|
7394
7395
|
return _(f[E].message), f;
|
|
7395
7396
|
}
|
|
7396
|
-
if (p && !
|
|
7397
|
-
const { value:
|
|
7398
|
-
if (mt(
|
|
7397
|
+
if (p && !P && He(C)) {
|
|
7398
|
+
const { value: G, message: K } = Je(p);
|
|
7399
|
+
if (mt(G) && !C.match(G) && (f[E] = {
|
|
7399
7400
|
type: We.pattern,
|
|
7400
|
-
message:
|
|
7401
|
+
message: K,
|
|
7401
7402
|
ref: l,
|
|
7402
|
-
...V(We.pattern,
|
|
7403
|
+
...V(We.pattern, K)
|
|
7403
7404
|
}, !r))
|
|
7404
|
-
return _(
|
|
7405
|
+
return _(K), f;
|
|
7405
7406
|
}
|
|
7406
7407
|
if (I) {
|
|
7407
7408
|
if (Re(I)) {
|
|
7408
|
-
const
|
|
7409
|
-
if (
|
|
7410
|
-
...
|
|
7411
|
-
...V(We.validate,
|
|
7409
|
+
const G = await I(C, t), K = la(G, k);
|
|
7410
|
+
if (K && (f[E] = {
|
|
7411
|
+
...K,
|
|
7412
|
+
...V(We.validate, K.message)
|
|
7412
7413
|
}, !r))
|
|
7413
|
-
return _(
|
|
7414
|
+
return _(K.message), f;
|
|
7414
7415
|
} else if (Se(I)) {
|
|
7415
|
-
let
|
|
7416
|
-
for (const
|
|
7417
|
-
if (!$e(
|
|
7416
|
+
let G = {};
|
|
7417
|
+
for (const K in I) {
|
|
7418
|
+
if (!$e(G) && !r)
|
|
7418
7419
|
break;
|
|
7419
|
-
const ae = la(await I[
|
|
7420
|
-
ae && (
|
|
7420
|
+
const ae = la(await I[K](C, t), k, K);
|
|
7421
|
+
ae && (G = {
|
|
7421
7422
|
...ae,
|
|
7422
|
-
...V(
|
|
7423
|
-
}, _(ae.message), r && (f[E] =
|
|
7423
|
+
...V(K, ae.message)
|
|
7424
|
+
}, _(ae.message), r && (f[E] = G));
|
|
7424
7425
|
}
|
|
7425
|
-
if (!$e(
|
|
7426
|
+
if (!$e(G) && (f[E] = {
|
|
7426
7427
|
ref: k,
|
|
7427
|
-
...
|
|
7428
|
+
...G
|
|
7428
7429
|
}, !r))
|
|
7429
7430
|
return f;
|
|
7430
7431
|
}
|
|
@@ -7475,11 +7476,11 @@ function lr(e = {}) {
|
|
|
7475
7476
|
isValidating: !1,
|
|
7476
7477
|
isValid: !1,
|
|
7477
7478
|
errors: !1
|
|
7478
|
-
},
|
|
7479
|
+
}, N = {
|
|
7479
7480
|
...u
|
|
7480
7481
|
};
|
|
7481
7482
|
let m = {
|
|
7482
|
-
...
|
|
7483
|
+
...N
|
|
7483
7484
|
};
|
|
7484
7485
|
const p = {
|
|
7485
7486
|
array: Xt(),
|
|
@@ -7487,36 +7488,36 @@ function lr(e = {}) {
|
|
|
7487
7488
|
}, I = a.criteriaMode === Oe.all, E = (o) => (y) => {
|
|
7488
7489
|
clearTimeout(h), h = setTimeout(o, y);
|
|
7489
7490
|
}, A = async (o) => {
|
|
7490
|
-
if (!l.keepIsValid && !a.disabled && (
|
|
7491
|
+
if (!l.keepIsValid && !a.disabled && (N.isValid || m.isValid || o)) {
|
|
7491
7492
|
let y;
|
|
7492
7493
|
a.resolver ? (y = $e((await Y()).errors), F()) : y = await V(r, !0), y !== t.isValid && p.state.next({
|
|
7493
7494
|
isValid: y
|
|
7494
7495
|
});
|
|
7495
7496
|
}
|
|
7496
7497
|
}, F = (o, y) => {
|
|
7497
|
-
!a.disabled && (
|
|
7498
|
-
|
|
7498
|
+
!a.disabled && (N.isValidating || N.validatingFields || m.isValidating || m.validatingFields) && ((o || Array.from(c.mount)).forEach((M) => {
|
|
7499
|
+
M && (y ? Me(t.validatingFields, M, y) : Ae(t.validatingFields, M));
|
|
7499
7500
|
}), p.state.next({
|
|
7500
7501
|
validatingFields: t.validatingFields,
|
|
7501
7502
|
isValidating: !$e(t.validatingFields)
|
|
7502
7503
|
}));
|
|
7503
|
-
},
|
|
7504
|
-
if (R &&
|
|
7504
|
+
}, C = (o, y = [], M, R, L = !0, z = !0) => {
|
|
7505
|
+
if (R && M && !a.disabled) {
|
|
7505
7506
|
if (l.action = !0, z && Array.isArray(ne(r, o))) {
|
|
7506
|
-
const d =
|
|
7507
|
+
const d = M(ne(r, o), R.argA, R.argB);
|
|
7507
7508
|
L && Me(r, o, d);
|
|
7508
7509
|
}
|
|
7509
7510
|
if (z && Array.isArray(ne(t.errors, o))) {
|
|
7510
|
-
const d =
|
|
7511
|
+
const d = M(ne(t.errors, o), R.argA, R.argB);
|
|
7511
7512
|
L && Me(t.errors, o, d), rr(t.errors, o);
|
|
7512
7513
|
}
|
|
7513
|
-
if ((
|
|
7514
|
-
const d =
|
|
7514
|
+
if ((N.touchedFields || m.touchedFields) && z && Array.isArray(ne(t.touchedFields, o))) {
|
|
7515
|
+
const d = M(ne(t.touchedFields, o), R.argA, R.argB);
|
|
7515
7516
|
L && Me(t.touchedFields, o, d);
|
|
7516
7517
|
}
|
|
7517
|
-
(
|
|
7518
|
+
(N.dirtyFields || m.dirtyFields) && (t.dirtyFields = Ze(i, s)), p.state.next({
|
|
7518
7519
|
name: o,
|
|
7519
|
-
isDirty:
|
|
7520
|
+
isDirty: G(o, y),
|
|
7520
7521
|
dirtyFields: t.dirtyFields,
|
|
7521
7522
|
errors: t.errors,
|
|
7522
7523
|
isValid: t.isValid
|
|
@@ -7532,33 +7533,33 @@ function lr(e = {}) {
|
|
|
7532
7533
|
errors: t.errors,
|
|
7533
7534
|
isValid: !1
|
|
7534
7535
|
});
|
|
7535
|
-
}, f = (o, y,
|
|
7536
|
+
}, f = (o, y, M, R) => {
|
|
7536
7537
|
const L = ne(r, o);
|
|
7537
7538
|
if (L) {
|
|
7538
|
-
const z = ne(s, o, xe(
|
|
7539
|
-
xe(z) || R && R.defaultChecked || y ? Me(s, o, y ? z : aa(L._f)) :
|
|
7539
|
+
const z = ne(s, o, xe(M) ? ne(i, o) : M);
|
|
7540
|
+
xe(z) || R && R.defaultChecked || y ? Me(s, o, y ? z : aa(L._f)) : ce(o, z), l.mount && !l.action && A();
|
|
7540
7541
|
}
|
|
7541
|
-
}, T = (o, y,
|
|
7542
|
+
}, T = (o, y, M, R, L) => {
|
|
7542
7543
|
let z = !1, d = !1;
|
|
7543
7544
|
const D = {
|
|
7544
7545
|
name: o
|
|
7545
7546
|
};
|
|
7546
7547
|
if (!a.disabled) {
|
|
7547
|
-
if (!
|
|
7548
|
-
(
|
|
7548
|
+
if (!M || R) {
|
|
7549
|
+
(N.isDirty || m.isDirty) && (d = t.isDirty, t.isDirty = D.isDirty = G(), z = d !== D.isDirty);
|
|
7549
7550
|
const x = Ue(ne(i, o), y);
|
|
7550
|
-
d = !!ne(t.dirtyFields, o), x ? Ae(t.dirtyFields, o) : Me(t.dirtyFields, o, !0), D.dirtyFields = t.dirtyFields, z = z || (
|
|
7551
|
+
d = !!ne(t.dirtyFields, o), x ? Ae(t.dirtyFields, o) : Me(t.dirtyFields, o, !0), D.dirtyFields = t.dirtyFields, z = z || (N.dirtyFields || m.dirtyFields) && d !== !x;
|
|
7551
7552
|
}
|
|
7552
|
-
if (
|
|
7553
|
+
if (M) {
|
|
7553
7554
|
const x = ne(t.touchedFields, o);
|
|
7554
|
-
x || (Me(t.touchedFields, o,
|
|
7555
|
+
x || (Me(t.touchedFields, o, M), D.touchedFields = t.touchedFields, z = z || (N.touchedFields || m.touchedFields) && x !== M);
|
|
7555
7556
|
}
|
|
7556
7557
|
z && L && p.state.next(D);
|
|
7557
7558
|
}
|
|
7558
7559
|
return z ? D : {};
|
|
7559
|
-
}, $ = (o, y,
|
|
7560
|
-
const L = ne(t.errors, o), z = (
|
|
7561
|
-
if (a.delayError &&
|
|
7560
|
+
}, $ = (o, y, M, R) => {
|
|
7561
|
+
const L = ne(t.errors, o), z = (N.isValid || m.isValid) && Pe(y) && t.isValid !== y;
|
|
7562
|
+
if (a.delayError && M ? (b = E(() => k(o, M)), b(a.delayError)) : (clearTimeout(h), b = null, M ? Me(t.errors, o, M) : Ae(t.errors, o)), (M ? !Ue(L, M) : L) || !$e(R) || z) {
|
|
7562
7563
|
const d = {
|
|
7563
7564
|
...R,
|
|
7564
7565
|
...z && Pe(y) ? { isValid: y } : {},
|
|
@@ -7570,17 +7571,17 @@ function lr(e = {}) {
|
|
|
7570
7571
|
...d
|
|
7571
7572
|
}, p.state.next(d);
|
|
7572
7573
|
}
|
|
7573
|
-
}, Y = async (o) => (F(o, !0), await a.resolver(s, a.context, Xn(o || c.mount, r, a.criteriaMode, a.shouldUseNativeValidation))),
|
|
7574
|
+
}, Y = async (o) => (F(o, !0), await a.resolver(s, a.context, Xn(o || c.mount, r, a.criteriaMode, a.shouldUseNativeValidation))), P = async (o) => {
|
|
7574
7575
|
const { errors: y } = await Y(o);
|
|
7575
7576
|
if (F(o), o)
|
|
7576
|
-
for (const
|
|
7577
|
-
const R = ne(y,
|
|
7578
|
-
R ? Me(t.errors,
|
|
7577
|
+
for (const M of o) {
|
|
7578
|
+
const R = ne(y, M);
|
|
7579
|
+
R ? Me(t.errors, M, R) : Ae(t.errors, M);
|
|
7579
7580
|
}
|
|
7580
7581
|
else
|
|
7581
7582
|
t.errors = y;
|
|
7582
7583
|
return y;
|
|
7583
|
-
}, V = async (o, y,
|
|
7584
|
+
}, V = async (o, y, M = {
|
|
7584
7585
|
valid: !0
|
|
7585
7586
|
}) => {
|
|
7586
7587
|
for (const R in o) {
|
|
@@ -7589,25 +7590,25 @@ function lr(e = {}) {
|
|
|
7589
7590
|
const { _f: z, ...d } = L;
|
|
7590
7591
|
if (z) {
|
|
7591
7592
|
const D = c.array.has(z.name), x = L._f && Qn(L._f);
|
|
7592
|
-
x &&
|
|
7593
|
+
x && N.validatingFields && F([z.name], !0);
|
|
7593
7594
|
const v = await oa(L, c.disabled, s, I, a.shouldUseNativeValidation && !y, D);
|
|
7594
|
-
if (x &&
|
|
7595
|
+
if (x && N.validatingFields && F([z.name]), v[z.name] && (M.valid = !1, y || e.shouldUseNativeValidation))
|
|
7595
7596
|
break;
|
|
7596
7597
|
!y && (ne(v, z.name) ? D ? sr(t.errors, v, z.name) : Me(t.errors, z.name, v[z.name]) : Ae(t.errors, z.name));
|
|
7597
7598
|
}
|
|
7598
|
-
!$e(d) && await V(d, y,
|
|
7599
|
+
!$e(d) && await V(d, y, M);
|
|
7599
7600
|
}
|
|
7600
7601
|
}
|
|
7601
|
-
return
|
|
7602
|
-
},
|
|
7602
|
+
return M.valid;
|
|
7603
|
+
}, H = () => {
|
|
7603
7604
|
for (const o of c.unMount) {
|
|
7604
7605
|
const y = ne(r, o);
|
|
7605
|
-
y && (y._f.refs ? y._f.refs.every((
|
|
7606
|
+
y && (y._f.refs ? y._f.refs.every((M) => !kt(M)) : !kt(y._f.ref)) && ie(o);
|
|
7606
7607
|
}
|
|
7607
7608
|
c.unMount = /* @__PURE__ */ new Set();
|
|
7608
|
-
},
|
|
7609
|
+
}, G = (o, y) => !a.disabled && (o && y && Me(s, o, y), !Ue(se(), i)), K = (o, y, M) => It(o, c, {
|
|
7609
7610
|
...l.mount ? s : xe(y) ? i : He(o) ? { [o]: y } : y
|
|
7610
|
-
},
|
|
7611
|
+
}, M, y), ae = (o) => $t(ne(l.mount ? s : i, o, a.shouldUnregister ? ne(i, o, []) : [])), ce = (o, y, M = {}) => {
|
|
7611
7612
|
const R = ne(r, o);
|
|
7612
7613
|
let L = y;
|
|
7613
7614
|
if (R) {
|
|
@@ -7619,24 +7620,24 @@ function lr(e = {}) {
|
|
|
7619
7620
|
values: Ee(s)
|
|
7620
7621
|
})));
|
|
7621
7622
|
}
|
|
7622
|
-
(
|
|
7623
|
-
}, te = (o, y,
|
|
7623
|
+
(M.shouldDirty || M.shouldTouch) && T(o, L, M.shouldTouch, M.shouldDirty, !0), M.shouldValidate && B(o);
|
|
7624
|
+
}, te = (o, y, M) => {
|
|
7624
7625
|
for (const R in y) {
|
|
7625
7626
|
if (!y.hasOwnProperty(R))
|
|
7626
7627
|
return;
|
|
7627
7628
|
const L = y[R], z = o + "." + R, d = ne(r, z);
|
|
7628
|
-
(c.array.has(o) || Se(L) || d && !d._f) && !qe(L) ? te(z, L,
|
|
7629
|
+
(c.array.has(o) || Se(L) || d && !d._f) && !qe(L) ? te(z, L, M) : ce(z, L, M);
|
|
7629
7630
|
}
|
|
7630
|
-
}, X = (o, y,
|
|
7631
|
+
}, X = (o, y, M = {}) => {
|
|
7631
7632
|
const R = ne(r, o), L = c.array.has(o), z = Ee(y);
|
|
7632
7633
|
Me(s, o, z), L ? (p.array.next({
|
|
7633
7634
|
name: o,
|
|
7634
7635
|
values: Ee(s)
|
|
7635
|
-
}), (
|
|
7636
|
+
}), (N.isDirty || N.dirtyFields || m.isDirty || m.dirtyFields) && M.shouldDirty && p.state.next({
|
|
7636
7637
|
name: o,
|
|
7637
7638
|
dirtyFields: Ze(i, s),
|
|
7638
|
-
isDirty:
|
|
7639
|
-
})) : R && !R._f && !Be(z) ? te(o, z,
|
|
7639
|
+
isDirty: G(o, z)
|
|
7640
|
+
})) : R && !R._f && !Be(z) ? te(o, z, M) : ce(o, z, M), sa(o, c) ? p.state.next({
|
|
7640
7641
|
...t,
|
|
7641
7642
|
name: o,
|
|
7642
7643
|
values: Ee(s)
|
|
@@ -7644,57 +7645,57 @@ function lr(e = {}) {
|
|
|
7644
7645
|
name: l.mount ? o : void 0,
|
|
7645
7646
|
values: Ee(s)
|
|
7646
7647
|
});
|
|
7647
|
-
},
|
|
7648
|
+
}, O = async (o) => {
|
|
7648
7649
|
l.mount = !0;
|
|
7649
7650
|
const y = o.target;
|
|
7650
|
-
let
|
|
7651
|
-
const L = ne(r,
|
|
7652
|
-
R = Number.isNaN(x) || qe(x) && isNaN(x.getTime()) || Ue(x, ne(s,
|
|
7651
|
+
let M = y.name, R = !0;
|
|
7652
|
+
const L = ne(r, M), z = (x) => {
|
|
7653
|
+
R = Number.isNaN(x) || qe(x) && isNaN(x.getTime()) || Ue(x, ne(s, M, x));
|
|
7653
7654
|
}, d = na(a.mode), D = na(a.reValidateMode);
|
|
7654
7655
|
if (L) {
|
|
7655
7656
|
let x, v;
|
|
7656
|
-
const g = y.type ? aa(L._f) : Va(o), U = o.type === ft.BLUR || o.type === ft.FOCUS_OUT, re = !er(L._f) && !a.resolver && !ne(t.errors,
|
|
7657
|
-
Me(s,
|
|
7658
|
-
const ye = T(
|
|
7657
|
+
const g = y.type ? aa(L._f) : Va(o), U = o.type === ft.BLUR || o.type === ft.FOCUS_OUT, re = !er(L._f) && !a.resolver && !ne(t.errors, M) && !L._f.deps || nr(U, ne(t.touchedFields, M), t.isSubmitted, D, d), ue = sa(M, c, U);
|
|
7658
|
+
Me(s, M, g), U ? (!y || !y.readOnly) && (L._f.onBlur && L._f.onBlur(o), b && b(0)) : L._f.onChange && L._f.onChange(o);
|
|
7659
|
+
const ye = T(M, g, U), De = !$e(ye) || ue;
|
|
7659
7660
|
if (!U && p.state.next({
|
|
7660
|
-
name:
|
|
7661
|
+
name: M,
|
|
7661
7662
|
type: o.type,
|
|
7662
7663
|
values: Ee(s)
|
|
7663
7664
|
}), re)
|
|
7664
|
-
return (
|
|
7665
|
-
if (!U &&
|
|
7666
|
-
const { errors: je } = await Y([
|
|
7667
|
-
if (F([
|
|
7668
|
-
const it = ia(t.errors, r,
|
|
7669
|
-
x = lt.error,
|
|
7665
|
+
return (N.isValid || m.isValid) && (a.mode === "onBlur" ? U && A() : U || A()), De && p.state.next({ name: M, ...ue ? {} : ye });
|
|
7666
|
+
if (!U && ue && p.state.next({ ...t }), a.resolver) {
|
|
7667
|
+
const { errors: je } = await Y([M]);
|
|
7668
|
+
if (F([M]), z(g), R) {
|
|
7669
|
+
const it = ia(t.errors, r, M), lt = ia(je, r, it.name || M);
|
|
7670
|
+
x = lt.error, M = lt.name, v = $e(je);
|
|
7670
7671
|
}
|
|
7671
7672
|
} else
|
|
7672
|
-
F([
|
|
7673
|
-
R && (L._f.deps && (!Array.isArray(L._f.deps) || L._f.deps.length > 0) &&
|
|
7673
|
+
F([M], !0), x = (await oa(L, c.disabled, s, I, a.shouldUseNativeValidation))[M], F([M]), z(g), R && (x ? v = !1 : (N.isValid || m.isValid) && (v = await V(r, !0)));
|
|
7674
|
+
R && (L._f.deps && (!Array.isArray(L._f.deps) || L._f.deps.length > 0) && B(L._f.deps), $(M, v, x, ye));
|
|
7674
7675
|
}
|
|
7675
|
-
},
|
|
7676
|
+
}, W = (o, y) => {
|
|
7676
7677
|
if (ne(t.errors, y) && o.focus)
|
|
7677
7678
|
return o.focus(), 1;
|
|
7678
|
-
},
|
|
7679
|
-
let
|
|
7679
|
+
}, B = async (o, y = {}) => {
|
|
7680
|
+
let M, R;
|
|
7680
7681
|
const L = et(o);
|
|
7681
7682
|
if (a.resolver) {
|
|
7682
|
-
const z = await
|
|
7683
|
-
|
|
7683
|
+
const z = await P(xe(o) ? o : L);
|
|
7684
|
+
M = $e(z), R = o ? !L.some((d) => ne(z, d)) : M;
|
|
7684
7685
|
} else o ? (R = (await Promise.all(L.map(async (z) => {
|
|
7685
7686
|
const d = ne(r, z);
|
|
7686
7687
|
return await V(d && d._f ? { [z]: d } : d);
|
|
7687
|
-
}))).every(Boolean), !(!R && !t.isValid) && A()) : R =
|
|
7688
|
+
}))).every(Boolean), !(!R && !t.isValid) && A()) : R = M = await V(r);
|
|
7688
7689
|
return p.state.next({
|
|
7689
|
-
...!He(o) || (
|
|
7690
|
-
...a.resolver || !o ? { isValid:
|
|
7690
|
+
...!He(o) || (N.isValid || m.isValid) && M !== t.isValid ? {} : { name: o },
|
|
7691
|
+
...a.resolver || !o ? { isValid: M } : {},
|
|
7691
7692
|
errors: t.errors
|
|
7692
|
-
}), y.shouldFocus && !R && tt(r,
|
|
7693
|
+
}), y.shouldFocus && !R && tt(r, W, o ? L : c.mount), R;
|
|
7693
7694
|
}, se = (o, y) => {
|
|
7694
|
-
let
|
|
7695
|
+
let M = {
|
|
7695
7696
|
...l.mount ? s : i
|
|
7696
7697
|
};
|
|
7697
|
-
return y && (
|
|
7698
|
+
return y && (M = $a(y.dirtyFields ? t.dirtyFields : t.touchedFields, M)), xe(o) ? M : He(o) ? ne(M, o) : o.map((R) => ne(M, R));
|
|
7698
7699
|
}, q = (o, y) => ({
|
|
7699
7700
|
invalid: !!ne((y || t).errors, o),
|
|
7700
7701
|
isDirty: !!ne((y || t).dirtyFields, o),
|
|
@@ -7705,7 +7706,7 @@ function lr(e = {}) {
|
|
|
7705
7706
|
o && et(o).forEach((y) => Ae(t.errors, y)), p.state.next({
|
|
7706
7707
|
errors: o ? t.errors : {}
|
|
7707
7708
|
});
|
|
7708
|
-
}, Q = (o, y,
|
|
7709
|
+
}, Q = (o, y, M) => {
|
|
7709
7710
|
const R = (ne(r, o, { _f: {} })._f || {}).ref, L = ne(t.errors, o) || {}, { ref: z, message: d, type: D, ...x } = L;
|
|
7710
7711
|
Me(t.errors, o, {
|
|
7711
7712
|
...x,
|
|
@@ -7715,12 +7716,12 @@ function lr(e = {}) {
|
|
|
7715
7716
|
name: o,
|
|
7716
7717
|
errors: t.errors,
|
|
7717
7718
|
isValid: !1
|
|
7718
|
-
}),
|
|
7719
|
+
}), M && M.shouldFocus && R && R.focus && R.focus();
|
|
7719
7720
|
}, ee = (o, y) => Re(o) ? p.state.subscribe({
|
|
7720
|
-
next: (
|
|
7721
|
-
}) :
|
|
7721
|
+
next: (M) => "values" in M && o(K(void 0, y), M)
|
|
7722
|
+
}) : K(o, y, !0), de = (o) => p.state.subscribe({
|
|
7722
7723
|
next: (y) => {
|
|
7723
|
-
ar(o.name, y.name, o.exact) && tr(y, o.formState ||
|
|
7724
|
+
ar(o.name, y.name, o.exact) && tr(y, o.formState || N, Ne, o.reRenderRoot) && o.callback({
|
|
7724
7725
|
values: { ...s },
|
|
7725
7726
|
...t,
|
|
7726
7727
|
...y,
|
|
@@ -7730,20 +7731,20 @@ function lr(e = {}) {
|
|
|
7730
7731
|
}).unsubscribe, _e = (o) => (l.mount = !0, m = {
|
|
7731
7732
|
...m,
|
|
7732
7733
|
...o.formState
|
|
7733
|
-
},
|
|
7734
|
+
}, de({
|
|
7734
7735
|
...o,
|
|
7735
7736
|
formState: {
|
|
7736
7737
|
...u,
|
|
7737
7738
|
...o.formState
|
|
7738
7739
|
}
|
|
7739
7740
|
})), ie = (o, y = {}) => {
|
|
7740
|
-
for (const
|
|
7741
|
-
c.mount.delete(
|
|
7741
|
+
for (const M of o ? et(o) : c.mount)
|
|
7742
|
+
c.mount.delete(M), c.array.delete(M), y.keepValue || (Ae(r, M), Ae(s, M)), !y.keepError && Ae(t.errors, M), !y.keepDirty && Ae(t.dirtyFields, M), !y.keepTouched && Ae(t.touchedFields, M), !y.keepIsValidating && Ae(t.validatingFields, M), !a.shouldUnregister && !y.keepDefaultValue && Ae(i, M);
|
|
7742
7743
|
p.state.next({
|
|
7743
7744
|
values: Ee(s)
|
|
7744
7745
|
}), p.state.next({
|
|
7745
7746
|
...t,
|
|
7746
|
-
...y.keepDirty ? { isDirty:
|
|
7747
|
+
...y.keepDirty ? { isDirty: G() } : {}
|
|
7747
7748
|
}), !y.keepIsValid && A();
|
|
7748
7749
|
}, J = ({ disabled: o, name: y }) => {
|
|
7749
7750
|
if (Pe(o) && l.mount || o || c.disabled.has(y)) {
|
|
@@ -7751,17 +7752,17 @@ function lr(e = {}) {
|
|
|
7751
7752
|
o ? c.disabled.add(y) : c.disabled.delete(y), L && l.mount && !l.action && A();
|
|
7752
7753
|
}
|
|
7753
7754
|
}, he = (o, y = {}) => {
|
|
7754
|
-
let
|
|
7755
|
+
let M = ne(r, o);
|
|
7755
7756
|
const R = Pe(y.disabled) || Pe(a.disabled);
|
|
7756
7757
|
return Me(r, o, {
|
|
7757
|
-
...
|
|
7758
|
+
...M || {},
|
|
7758
7759
|
_f: {
|
|
7759
|
-
...
|
|
7760
|
+
...M && M._f ? M._f : { ref: { name: o } },
|
|
7760
7761
|
name: o,
|
|
7761
7762
|
mount: !0,
|
|
7762
7763
|
...y
|
|
7763
7764
|
}
|
|
7764
|
-
}), c.mount.add(o),
|
|
7765
|
+
}), c.mount.add(o), M ? J({
|
|
7765
7766
|
disabled: Pe(y.disabled) ? y.disabled : a.disabled,
|
|
7766
7767
|
name: o
|
|
7767
7768
|
}) : f(o, !0, y.value), {
|
|
@@ -7775,17 +7776,17 @@ function lr(e = {}) {
|
|
|
7775
7776
|
pattern: Qe(y.pattern)
|
|
7776
7777
|
} : {},
|
|
7777
7778
|
name: o,
|
|
7778
|
-
onChange:
|
|
7779
|
-
onBlur:
|
|
7779
|
+
onChange: O,
|
|
7780
|
+
onBlur: O,
|
|
7780
7781
|
ref: (L) => {
|
|
7781
7782
|
if (L) {
|
|
7782
|
-
he(o, y),
|
|
7783
|
-
const z = xe(L.value) && L.querySelectorAll && L.querySelectorAll("input,select,textarea")[0] || L, d = Yn(z), D =
|
|
7784
|
-
if (d ? D.find((x) => x === z) : z ===
|
|
7783
|
+
he(o, y), M = ne(r, o);
|
|
7784
|
+
const z = xe(L.value) && L.querySelectorAll && L.querySelectorAll("input,select,textarea")[0] || L, d = Yn(z), D = M._f.refs || [];
|
|
7785
|
+
if (d ? D.find((x) => x === z) : z === M._f.ref)
|
|
7785
7786
|
return;
|
|
7786
7787
|
Me(r, o, {
|
|
7787
7788
|
_f: {
|
|
7788
|
-
...
|
|
7789
|
+
...M._f,
|
|
7789
7790
|
...d ? {
|
|
7790
7791
|
refs: [
|
|
7791
7792
|
...D.filter(kt),
|
|
@@ -7797,19 +7798,19 @@ function lr(e = {}) {
|
|
|
7797
7798
|
}
|
|
7798
7799
|
}), f(o, !1, void 0, z);
|
|
7799
7800
|
} else
|
|
7800
|
-
|
|
7801
|
+
M = ne(r, o, {}), M._f && (M._f.mount = !1), (a.shouldUnregister || y.shouldUnregister) && !(Ta(c.array, o) && l.action) && c.unMount.add(o);
|
|
7801
7802
|
}
|
|
7802
7803
|
};
|
|
7803
|
-
}, ve = () => a.shouldFocusError && tt(r,
|
|
7804
|
-
Pe(o) && (p.state.next({ disabled: o }), tt(r, (y,
|
|
7805
|
-
const R = ne(r,
|
|
7804
|
+
}, ve = () => a.shouldFocusError && tt(r, W, c.mount), fe = (o) => {
|
|
7805
|
+
Pe(o) && (p.state.next({ disabled: o }), tt(r, (y, M) => {
|
|
7806
|
+
const R = ne(r, M);
|
|
7806
7807
|
R && (y.disabled = R._f.disabled || o, Array.isArray(R._f.refs) && R._f.refs.forEach((L) => {
|
|
7807
7808
|
L.disabled = R._f.disabled || o;
|
|
7808
7809
|
}));
|
|
7809
7810
|
}, 0, !1));
|
|
7810
|
-
}, pe = (o, y) => async (
|
|
7811
|
+
}, pe = (o, y) => async (M) => {
|
|
7811
7812
|
let R;
|
|
7812
|
-
|
|
7813
|
+
M && (M.preventDefault && M.preventDefault(), M.persist && M.persist());
|
|
7813
7814
|
let L = Ee(s);
|
|
7814
7815
|
if (p.state.next({
|
|
7815
7816
|
isSubmitting: !0
|
|
@@ -7826,12 +7827,12 @@ function lr(e = {}) {
|
|
|
7826
7827
|
errors: {}
|
|
7827
7828
|
});
|
|
7828
7829
|
try {
|
|
7829
|
-
await o(L,
|
|
7830
|
+
await o(L, M);
|
|
7830
7831
|
} catch (z) {
|
|
7831
7832
|
R = z;
|
|
7832
7833
|
}
|
|
7833
7834
|
} else
|
|
7834
|
-
y && await y({ ...t.errors },
|
|
7835
|
+
y && await y({ ...t.errors }, M), ve(), setTimeout(ve);
|
|
7835
7836
|
if (p.state.next({
|
|
7836
7837
|
isSubmitted: !0,
|
|
7837
7838
|
isSubmitting: !1,
|
|
@@ -7841,10 +7842,10 @@ function lr(e = {}) {
|
|
|
7841
7842
|
}), R)
|
|
7842
7843
|
throw R;
|
|
7843
7844
|
}, Ce = (o, y = {}) => {
|
|
7844
|
-
ne(r, o) && (xe(y.defaultValue) ? X(o, Ee(ne(i, o))) : (X(o, y.defaultValue), Me(i, o, Ee(y.defaultValue))), y.keepTouched || Ae(t.touchedFields, o), y.keepDirty || (Ae(t.dirtyFields, o), t.isDirty = y.defaultValue ?
|
|
7845
|
+
ne(r, o) && (xe(y.defaultValue) ? X(o, Ee(ne(i, o))) : (X(o, y.defaultValue), Me(i, o, Ee(y.defaultValue))), y.keepTouched || Ae(t.touchedFields, o), y.keepDirty || (Ae(t.dirtyFields, o), t.isDirty = y.defaultValue ? G(o, Ee(ne(i, o))) : G()), y.keepError || (Ae(t.errors, o), N.isValid && A()), p.state.next({ ...t }));
|
|
7845
7846
|
}, be = (o, y = {}) => {
|
|
7846
|
-
const
|
|
7847
|
-
if (y.keepDefaultValues || (i =
|
|
7847
|
+
const M = o ? Ee(o) : i, R = Ee(M), L = $e(o), z = L ? i : R;
|
|
7848
|
+
if (y.keepDefaultValues || (i = M), !y.keepValues) {
|
|
7848
7849
|
if (y.keepDirtyValues) {
|
|
7849
7850
|
const d = /* @__PURE__ */ new Set([
|
|
7850
7851
|
...c.mount,
|
|
@@ -7889,7 +7890,7 @@ function lr(e = {}) {
|
|
|
7889
7890
|
watch: /* @__PURE__ */ new Set(),
|
|
7890
7891
|
watchAll: !1,
|
|
7891
7892
|
focus: ""
|
|
7892
|
-
}, l.mount = !
|
|
7893
|
+
}, l.mount = !N.isValid || !!y.keepIsValid || !!y.keepDirtyValues || !a.shouldUnregister && !$e(z), l.watch = !!a.shouldUnregister, l.keepIsValid = !!y.keepIsValid, l.action = !1, y.keepErrors || (t.errors = {}), p.state.next({
|
|
7893
7894
|
submitCount: y.keepSubmitCount ? t.submitCount : 0,
|
|
7894
7895
|
isDirty: L ? !1 : y.keepDirty ? t.isDirty : !!(y.keepDefaultValues && !Ue(o, i)),
|
|
7895
7896
|
isSubmitted: y.keepIsSubmitted ? t.isSubmitted : !1,
|
|
@@ -7901,7 +7902,7 @@ function lr(e = {}) {
|
|
|
7901
7902
|
defaultValues: i
|
|
7902
7903
|
});
|
|
7903
7904
|
}, we = (o, y) => be(Re(o) ? o(s) : o, { ...a.resetOptions, ...y }), ke = (o, y = {}) => {
|
|
7904
|
-
const
|
|
7905
|
+
const M = ne(r, o), R = M && M._f;
|
|
7905
7906
|
if (R) {
|
|
7906
7907
|
const L = R.refs ? R.refs[0] : R.ref;
|
|
7907
7908
|
L.focus && setTimeout(() => {
|
|
@@ -7920,14 +7921,14 @@ function lr(e = {}) {
|
|
|
7920
7921
|
getFieldState: q,
|
|
7921
7922
|
handleSubmit: pe,
|
|
7922
7923
|
setError: Q,
|
|
7923
|
-
_subscribe:
|
|
7924
|
+
_subscribe: de,
|
|
7924
7925
|
_runSchema: Y,
|
|
7925
7926
|
_updateIsValidating: F,
|
|
7926
7927
|
_focusError: ve,
|
|
7927
|
-
_getWatch:
|
|
7928
|
-
_getDirty:
|
|
7928
|
+
_getWatch: K,
|
|
7929
|
+
_getDirty: G,
|
|
7929
7930
|
_setValid: A,
|
|
7930
|
-
_setFieldArray:
|
|
7931
|
+
_setFieldArray: C,
|
|
7931
7932
|
_setDisabledField: J,
|
|
7932
7933
|
_setErrors: _,
|
|
7933
7934
|
_getFieldArray: ae,
|
|
@@ -7937,10 +7938,10 @@ function lr(e = {}) {
|
|
|
7937
7938
|
isLoading: !1
|
|
7938
7939
|
});
|
|
7939
7940
|
}),
|
|
7940
|
-
_removeUnmounted:
|
|
7941
|
+
_removeUnmounted: H,
|
|
7941
7942
|
_disableForm: fe,
|
|
7942
7943
|
_subjects: p,
|
|
7943
|
-
_proxyFormState:
|
|
7944
|
+
_proxyFormState: N,
|
|
7944
7945
|
get _fields() {
|
|
7945
7946
|
return r;
|
|
7946
7947
|
},
|
|
@@ -7976,7 +7977,7 @@ function lr(e = {}) {
|
|
|
7976
7977
|
}
|
|
7977
7978
|
},
|
|
7978
7979
|
subscribe: _e,
|
|
7979
|
-
trigger:
|
|
7980
|
+
trigger: B,
|
|
7980
7981
|
register: he,
|
|
7981
7982
|
handleSubmit: pe,
|
|
7982
7983
|
watch: ee,
|
|
@@ -8116,14 +8117,14 @@ function ca({
|
|
|
8116
8117
|
readonly: b = !1,
|
|
8117
8118
|
open: h = !1,
|
|
8118
8119
|
onOpenChange: u,
|
|
8119
|
-
disabledBackYear:
|
|
8120
|
+
disabledBackYear: N = !1,
|
|
8120
8121
|
disabledFutureYear: m = !1,
|
|
8121
8122
|
disabledYearBefore: p,
|
|
8122
8123
|
disabledYearAfter: I,
|
|
8123
8124
|
showIcon: E = !1,
|
|
8124
8125
|
showClearButton: A = !1,
|
|
8125
8126
|
onClear: F,
|
|
8126
|
-
size:
|
|
8127
|
+
size: C = "md"
|
|
8127
8128
|
}) {
|
|
8128
8129
|
const k = Fe(() => {
|
|
8129
8130
|
const J = e ?? a ?? (/* @__PURE__ */ new Date()).getFullYear();
|
|
@@ -8138,10 +8139,10 @@ function ca({
|
|
|
8138
8139
|
};
|
|
8139
8140
|
return J(), window.addEventListener("resize", J), () => window.removeEventListener("resize", J);
|
|
8140
8141
|
}, [s]);
|
|
8141
|
-
const T = Fe(() => Math.floor(k / _) * _, [k, _]), [$, Y] = Z(h), [
|
|
8142
|
+
const T = Fe(() => Math.floor(k / _) * _, [k, _]), [$, Y] = Z(h), [P, V] = Z(null), [H, G] = Z(!1), [K, ae] = Z({}), ce = le(null), te = le(null), X = le(null), O = me(
|
|
8142
8143
|
(J) => {
|
|
8143
8144
|
const he = (/* @__PURE__ */ new Date()).getFullYear();
|
|
8144
|
-
if (
|
|
8145
|
+
if (N && J < he || m && J > he)
|
|
8145
8146
|
return !0;
|
|
8146
8147
|
if (p !== void 0) {
|
|
8147
8148
|
const ve = typeof p == "string" ? parseInt(p, 10) : p;
|
|
@@ -8156,17 +8157,17 @@ function ca({
|
|
|
8156
8157
|
return !1;
|
|
8157
8158
|
},
|
|
8158
8159
|
[
|
|
8159
|
-
|
|
8160
|
+
N,
|
|
8160
8161
|
m,
|
|
8161
8162
|
p,
|
|
8162
8163
|
I
|
|
8163
8164
|
]
|
|
8164
|
-
),
|
|
8165
|
+
), W = Fe(() => {
|
|
8165
8166
|
const J = [], he = T, ve = Math.min(T + _ - 1, i);
|
|
8166
8167
|
for (let fe = he; fe <= ve; fe++)
|
|
8167
8168
|
fe >= r && J.push(fe);
|
|
8168
8169
|
return J;
|
|
8169
|
-
}, [T, _, r, i]),
|
|
8170
|
+
}, [T, _, r, i]), B = me(
|
|
8170
8171
|
(J) => {
|
|
8171
8172
|
const he = J === "prev" ? Math.max(T - _, r) : Math.min(
|
|
8172
8173
|
T + _,
|
|
@@ -8200,12 +8201,12 @@ function ca({
|
|
|
8200
8201
|
let Ne, Ve, Ie = !1;
|
|
8201
8202
|
Ie = we > ke, Ie ? (Ve = 0, Ne = void 0) : (Ne = 0, Ve = void 0);
|
|
8202
8203
|
const o = Ce - ve.bottom, y = ve.top;
|
|
8203
|
-
let
|
|
8204
|
-
o < fe.height && y > o ? (R = ve.height + 4,
|
|
8204
|
+
let M, R, L = "400px";
|
|
8205
|
+
o < fe.height && y > o ? (R = ve.height + 4, M = void 0, L = `${Math.min(y - 10, 400)}px`) : (M = ve.height + 4, R = void 0, L = `${Math.min(o - 10, 400)}px`);
|
|
8205
8206
|
const z = `${Math.min(we, pe - 16)}px`;
|
|
8206
8207
|
ae({
|
|
8207
8208
|
position: "absolute",
|
|
8208
|
-
top:
|
|
8209
|
+
top: M !== void 0 ? `${M}px` : void 0,
|
|
8209
8210
|
bottom: R !== void 0 ? `${R}px` : void 0,
|
|
8210
8211
|
left: Ne !== void 0 ? `${Ne}px` : void 0,
|
|
8211
8212
|
right: Ve !== void 0 ? `${Ve}px` : void 0,
|
|
@@ -8213,7 +8214,7 @@ function ca({
|
|
|
8213
8214
|
maxHeight: L,
|
|
8214
8215
|
zIndex: 10006
|
|
8215
8216
|
// Higher than MonthPicker panel (10005) and DatePicker panel (10004)
|
|
8216
|
-
}),
|
|
8217
|
+
}), G(Ie);
|
|
8217
8218
|
};
|
|
8218
8219
|
requestAnimationFrame(() => {
|
|
8219
8220
|
setTimeout(J, 0);
|
|
@@ -8225,10 +8226,10 @@ function ca({
|
|
|
8225
8226
|
window.removeEventListener("resize", he), window.removeEventListener("scroll", he, !0);
|
|
8226
8227
|
};
|
|
8227
8228
|
} else
|
|
8228
|
-
|
|
8229
|
+
G(!1), ae({});
|
|
8229
8230
|
}, [$]), oe(() => {
|
|
8230
8231
|
const J = (he) => {
|
|
8231
|
-
|
|
8232
|
+
ce.current && !ce.current.contains(he.target) && j();
|
|
8232
8233
|
};
|
|
8233
8234
|
if ($)
|
|
8234
8235
|
return document.addEventListener("mousedown", J), () => document.removeEventListener("mousedown", J);
|
|
@@ -8236,9 +8237,9 @@ function ca({
|
|
|
8236
8237
|
const ee = `${T} - ${Math.min(
|
|
8237
8238
|
T + _ - 1,
|
|
8238
8239
|
i
|
|
8239
|
-
)}`,
|
|
8240
|
+
)}`, de = S("ina-year-picker", l), _e = S(
|
|
8240
8241
|
"ina-year-picker__trigger",
|
|
8241
|
-
`ina-year-picker__trigger--size-${
|
|
8242
|
+
`ina-year-picker__trigger--size-${C}`,
|
|
8242
8243
|
c && "ina-year-picker__trigger--disabled",
|
|
8243
8244
|
b && "ina-year-picker__trigger--readonly"
|
|
8244
8245
|
), ie = S(
|
|
@@ -8247,7 +8248,7 @@ function ca({
|
|
|
8247
8248
|
);
|
|
8248
8249
|
return oe(() => {
|
|
8249
8250
|
Y(h);
|
|
8250
|
-
}, [h]), /* @__PURE__ */ w("div", { ref:
|
|
8251
|
+
}, [h]), /* @__PURE__ */ w("div", { ref: ce, className: de, children: [
|
|
8251
8252
|
/* @__PURE__ */ w(
|
|
8252
8253
|
"button",
|
|
8253
8254
|
{
|
|
@@ -8308,18 +8309,18 @@ function ca({
|
|
|
8308
8309
|
ref: X,
|
|
8309
8310
|
className: S(
|
|
8310
8311
|
ie,
|
|
8311
|
-
|
|
8312
|
+
H && "ina-year-picker__panel--right-aligned"
|
|
8312
8313
|
),
|
|
8313
|
-
style:
|
|
8314
|
+
style: K,
|
|
8314
8315
|
children: [
|
|
8315
8316
|
/* @__PURE__ */ w("div", { className: "ina-year-picker__header", children: [
|
|
8316
8317
|
/* @__PURE__ */ n(
|
|
8317
8318
|
"button",
|
|
8318
8319
|
{
|
|
8319
8320
|
type: "button",
|
|
8320
|
-
onClick: () =>
|
|
8321
|
+
onClick: () => B("prev"),
|
|
8321
8322
|
onKeyDown: (J) => {
|
|
8322
|
-
(J.key === "Enter" || J.key === " ") && (J.preventDefault(),
|
|
8323
|
+
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), B("prev"));
|
|
8323
8324
|
},
|
|
8324
8325
|
className: "ina-year-picker__nav-button",
|
|
8325
8326
|
disabled: T <= r,
|
|
@@ -8338,9 +8339,9 @@ function ca({
|
|
|
8338
8339
|
"button",
|
|
8339
8340
|
{
|
|
8340
8341
|
type: "button",
|
|
8341
|
-
onClick: () =>
|
|
8342
|
+
onClick: () => B("next"),
|
|
8342
8343
|
onKeyDown: (J) => {
|
|
8343
|
-
(J.key === "Enter" || J.key === " ") && (J.preventDefault(),
|
|
8344
|
+
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), B("next"));
|
|
8344
8345
|
},
|
|
8345
8346
|
className: "ina-year-picker__nav-button",
|
|
8346
8347
|
disabled: T + _ > i,
|
|
@@ -8355,8 +8356,8 @@ function ca({
|
|
|
8355
8356
|
}
|
|
8356
8357
|
)
|
|
8357
8358
|
] }),
|
|
8358
|
-
/* @__PURE__ */ n("div", { className: "ina-year-picker__grid", children:
|
|
8359
|
-
const ve = J === k, fe = J ===
|
|
8359
|
+
/* @__PURE__ */ n("div", { className: "ina-year-picker__grid", children: W.map((J, he) => {
|
|
8360
|
+
const ve = J === k, fe = J === P, pe = O(J), Ce = ve || !W.includes(k) && he === 0;
|
|
8360
8361
|
return /* @__PURE__ */ n(
|
|
8361
8362
|
"button",
|
|
8362
8363
|
{
|
|
@@ -8424,7 +8425,7 @@ function da({
|
|
|
8424
8425
|
locale: b = "id",
|
|
8425
8426
|
disabledBackMonth: h = !1,
|
|
8426
8427
|
disabledFutureMonth: u = !1,
|
|
8427
|
-
disabledMonthBefore:
|
|
8428
|
+
disabledMonthBefore: N,
|
|
8428
8429
|
disabledMonthAfter: m,
|
|
8429
8430
|
showIcon: p = !1,
|
|
8430
8431
|
showClearButton: I = !1,
|
|
@@ -8457,21 +8458,21 @@ function da({
|
|
|
8457
8458
|
"Oct",
|
|
8458
8459
|
"Nov",
|
|
8459
8460
|
"Dec"
|
|
8460
|
-
], [b]),
|
|
8461
|
+
], [b]), C = Fe(() => {
|
|
8461
8462
|
const q = e ?? a ?? (/* @__PURE__ */ new Date()).getMonth();
|
|
8462
8463
|
return q == null || isNaN(q) ? (/* @__PURE__ */ new Date()).getMonth() : q;
|
|
8463
|
-
}, [e, a]), [k, _] = Z(l), [f, T] = Z(null), [$, Y] = Z(!1), [
|
|
8464
|
+
}, [e, a]), [k, _] = Z(l), [f, T] = Z(null), [$, Y] = Z(!1), [P, V] = Z({}), H = le(null), G = le(null), K = le(null), ae = me(
|
|
8464
8465
|
(q) => {
|
|
8465
8466
|
const j = (/* @__PURE__ */ new Date()).getMonth();
|
|
8466
|
-
return !!(h && q < j || u && q > j ||
|
|
8467
|
+
return !!(h && q < j || u && q > j || N !== void 0 && q < N || m !== void 0 && q > m);
|
|
8467
8468
|
},
|
|
8468
8469
|
[
|
|
8469
8470
|
h,
|
|
8470
8471
|
u,
|
|
8471
|
-
|
|
8472
|
+
N,
|
|
8472
8473
|
m
|
|
8473
8474
|
]
|
|
8474
|
-
),
|
|
8475
|
+
), ce = me(
|
|
8475
8476
|
(q) => {
|
|
8476
8477
|
t == null || t(q), _(!1), c == null || c(!1);
|
|
8477
8478
|
},
|
|
@@ -8482,23 +8483,23 @@ function da({
|
|
|
8482
8483
|
_(q), c == null || c(q);
|
|
8483
8484
|
}, [i, k, c]), X = me(() => {
|
|
8484
8485
|
_(!1), c == null || c(!1);
|
|
8485
|
-
}, [c]),
|
|
8486
|
+
}, [c]), O = me(
|
|
8486
8487
|
(q) => {
|
|
8487
8488
|
q.stopPropagation(), E ? E() : t == null || t((/* @__PURE__ */ new Date()).getMonth());
|
|
8488
8489
|
},
|
|
8489
8490
|
[E, t]
|
|
8490
8491
|
);
|
|
8491
8492
|
oe(() => {
|
|
8492
|
-
if (k &&
|
|
8493
|
+
if (k && G.current) {
|
|
8493
8494
|
const q = () => {
|
|
8494
|
-
if (!
|
|
8495
|
-
const Q =
|
|
8495
|
+
if (!G.current || !K.current) return;
|
|
8496
|
+
const Q = G.current.getBoundingClientRect(), ee = K.current.getBoundingClientRect(), de = window.innerWidth, _e = window.innerHeight, J = ee.width || 240, he = de - Q.right;
|
|
8496
8497
|
let ve, fe, pe = !1;
|
|
8497
8498
|
pe = J > he, pe ? (fe = 0, ve = void 0) : (ve = 0, fe = void 0);
|
|
8498
8499
|
const Ce = _e - Q.bottom, be = Q.top;
|
|
8499
8500
|
let we, ke, Ne = "300px";
|
|
8500
8501
|
Ce < ee.height && be > Ce ? (ke = Q.height + 4, we = void 0, Ne = `${Math.min(be - 10, 300)}px`) : (we = Q.height + 4, ke = void 0, Ne = `${Math.min(Ce - 10, 300)}px`);
|
|
8501
|
-
const Ve = `${Math.min(J,
|
|
8502
|
+
const Ve = `${Math.min(J, de - 16)}px`;
|
|
8502
8503
|
V({
|
|
8503
8504
|
position: "absolute",
|
|
8504
8505
|
top: we !== void 0 ? `${we}px` : void 0,
|
|
@@ -8515,7 +8516,7 @@ function da({
|
|
|
8515
8516
|
setTimeout(q, 0);
|
|
8516
8517
|
});
|
|
8517
8518
|
const j = () => {
|
|
8518
|
-
|
|
8519
|
+
G.current && K.current && q();
|
|
8519
8520
|
};
|
|
8520
8521
|
return window.addEventListener("resize", j), window.addEventListener("scroll", j, !0), () => {
|
|
8521
8522
|
window.removeEventListener("resize", j), window.removeEventListener("scroll", j, !0);
|
|
@@ -8524,12 +8525,12 @@ function da({
|
|
|
8524
8525
|
Y(!1), V({});
|
|
8525
8526
|
}, [k]), oe(() => {
|
|
8526
8527
|
const q = (j) => {
|
|
8527
|
-
|
|
8528
|
+
H.current && !H.current.contains(j.target) && X();
|
|
8528
8529
|
};
|
|
8529
8530
|
if (k)
|
|
8530
8531
|
return document.addEventListener("mousedown", q), () => document.removeEventListener("mousedown", q);
|
|
8531
8532
|
}, [k, X]);
|
|
8532
|
-
const
|
|
8533
|
+
const W = S("ina-month-picker", r), B = S(
|
|
8533
8534
|
"ina-month-picker__trigger",
|
|
8534
8535
|
`ina-month-picker__trigger--size-${A}`,
|
|
8535
8536
|
i && "ina-month-picker__trigger--disabled",
|
|
@@ -8540,14 +8541,14 @@ function da({
|
|
|
8540
8541
|
);
|
|
8541
8542
|
return oe(() => {
|
|
8542
8543
|
_(l);
|
|
8543
|
-
}, [l]), /* @__PURE__ */ w("div", { ref:
|
|
8544
|
+
}, [l]), /* @__PURE__ */ w("div", { ref: H, className: W, children: [
|
|
8544
8545
|
/* @__PURE__ */ w(
|
|
8545
8546
|
"button",
|
|
8546
8547
|
{
|
|
8547
|
-
ref:
|
|
8548
|
+
ref: G,
|
|
8548
8549
|
type: "button",
|
|
8549
8550
|
onClick: te,
|
|
8550
|
-
className:
|
|
8551
|
+
className: B,
|
|
8551
8552
|
disabled: i,
|
|
8552
8553
|
"aria-expanded": k,
|
|
8553
8554
|
"aria-haspopup": "listbox",
|
|
@@ -8556,12 +8557,12 @@ function da({
|
|
|
8556
8557
|
},
|
|
8557
8558
|
children: [
|
|
8558
8559
|
p && /* @__PURE__ */ n(Ut, { size: 16, className: "ina-month-picker__icon" }),
|
|
8559
|
-
/* @__PURE__ */ n("span", { className: "ina-month-picker__trigger-text", children: F[
|
|
8560
|
+
/* @__PURE__ */ n("span", { className: "ina-month-picker__trigger-text", children: F[C] }),
|
|
8560
8561
|
I && (e !== void 0 || a !== void 0) && /* @__PURE__ */ n(
|
|
8561
8562
|
"button",
|
|
8562
8563
|
{
|
|
8563
8564
|
type: "button",
|
|
8564
|
-
onClick:
|
|
8565
|
+
onClick: O,
|
|
8565
8566
|
className: "ina-month-picker__clear-button",
|
|
8566
8567
|
disabled: i,
|
|
8567
8568
|
"aria-label": "Clear month",
|
|
@@ -8598,27 +8599,27 @@ function da({
|
|
|
8598
8599
|
k && /* @__PURE__ */ n(
|
|
8599
8600
|
"div",
|
|
8600
8601
|
{
|
|
8601
|
-
ref:
|
|
8602
|
+
ref: K,
|
|
8602
8603
|
className: S(
|
|
8603
8604
|
se,
|
|
8604
8605
|
$ && "ina-month-picker__panel--right-aligned"
|
|
8605
8606
|
),
|
|
8606
|
-
style:
|
|
8607
|
+
style: P,
|
|
8607
8608
|
children: /* @__PURE__ */ n("div", { className: "ina-month-picker__grid", children: F.map((q, j) => {
|
|
8608
|
-
const Q = j ===
|
|
8609
|
+
const Q = j === C, ee = j === f, de = ae(j);
|
|
8609
8610
|
return /* @__PURE__ */ n(
|
|
8610
8611
|
"button",
|
|
8611
8612
|
{
|
|
8612
8613
|
type: "button",
|
|
8613
8614
|
role: "option",
|
|
8614
8615
|
"aria-selected": Q,
|
|
8615
|
-
tabIndex: Q || !
|
|
8616
|
-
onClick: () => !
|
|
8616
|
+
tabIndex: Q || !C && j === 0 ? 0 : -1,
|
|
8617
|
+
onClick: () => !de && ce(j),
|
|
8617
8618
|
onKeyDown: (ie) => {
|
|
8618
8619
|
var J, he;
|
|
8619
|
-
if (!
|
|
8620
|
+
if (!de) {
|
|
8620
8621
|
if (ie.key === "Enter" || ie.key === " ")
|
|
8621
|
-
ie.preventDefault(),
|
|
8622
|
+
ie.preventDefault(), ce(j);
|
|
8622
8623
|
else if (ie.key === "ArrowRight") {
|
|
8623
8624
|
ie.preventDefault();
|
|
8624
8625
|
const ve = ie.currentTarget.nextElementSibling;
|
|
@@ -8642,15 +8643,15 @@ function da({
|
|
|
8642
8643
|
}
|
|
8643
8644
|
}
|
|
8644
8645
|
},
|
|
8645
|
-
onMouseEnter: () => !
|
|
8646
|
+
onMouseEnter: () => !de && T(j),
|
|
8646
8647
|
onMouseLeave: () => T(null),
|
|
8647
8648
|
className: S(
|
|
8648
8649
|
"ina-month-picker__month-option",
|
|
8649
8650
|
Q && "ina-month-picker__month-option--selected",
|
|
8650
8651
|
ee && "ina-month-picker__month-option--hovered",
|
|
8651
|
-
|
|
8652
|
+
de && "ina-month-picker__month-option--disabled"
|
|
8652
8653
|
),
|
|
8653
|
-
disabled: i ||
|
|
8654
|
+
disabled: i || de,
|
|
8654
8655
|
children: q
|
|
8655
8656
|
},
|
|
8656
8657
|
j
|
|
@@ -8705,18 +8706,18 @@ const Oa = [
|
|
|
8705
8706
|
if (s.forEach((A, F) => {
|
|
8706
8707
|
A.includes("dd") || A.includes("DD") ? l = F : A.includes("MM") && !A.includes("MMM") ? c = F : A.includes("yyyy") || A.includes("YYYY") ? b = F : (A.includes("MMMM") || A.includes("MMM")) && (c = F);
|
|
8707
8708
|
}), l === -1 || c === -1 || b === -1) {
|
|
8708
|
-
const A = parseInt(r[0], 10), F = parseInt(r[1], 10) - 1,
|
|
8709
|
+
const A = parseInt(r[0], 10), F = parseInt(r[1], 10) - 1, C = parseInt(r[2], 10), k = new Date(C, F, A);
|
|
8709
8710
|
return isNaN(k.getTime()) ? null : k;
|
|
8710
8711
|
}
|
|
8711
8712
|
const h = parseInt(r[l], 10), u = parseInt(r[b], 10);
|
|
8712
|
-
let
|
|
8713
|
+
let N;
|
|
8713
8714
|
const m = r[c], p = Oa.findIndex(
|
|
8714
8715
|
(A) => A.toLowerCase() === m.toLowerCase()
|
|
8715
8716
|
), I = Ua.findIndex(
|
|
8716
8717
|
(A) => A.toLowerCase() === m.toLowerCase()
|
|
8717
8718
|
);
|
|
8718
|
-
p !== -1 ?
|
|
8719
|
-
const E = new Date(u,
|
|
8719
|
+
p !== -1 ? N = p : I !== -1 ? N = I : N = parseInt(m, 10) - 1;
|
|
8720
|
+
const E = new Date(u, N, h);
|
|
8720
8721
|
return isNaN(E.getTime()) ? null : E;
|
|
8721
8722
|
}, Le = (e, a) => e.getDate() === a.getDate() && e.getMonth() === a.getMonth() && e.getFullYear() === a.getFullYear(), ua = (e, a) => a.some((t) => Le(t, e)), fa = ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"];
|
|
8722
8723
|
function ks({
|
|
@@ -8731,21 +8732,21 @@ function ks({
|
|
|
8731
8732
|
panelMaxHeight: b,
|
|
8732
8733
|
panelClassName: h = "",
|
|
8733
8734
|
triggerClassname: u = "",
|
|
8734
|
-
disabledBackDate:
|
|
8735
|
+
disabledBackDate: N = !1,
|
|
8735
8736
|
disabledFutureDate: m = !1,
|
|
8736
8737
|
disabledDateBefore: p,
|
|
8737
8738
|
disabledDateAfter: I,
|
|
8738
8739
|
disabled: E = !1,
|
|
8739
8740
|
readonly: A = !1,
|
|
8740
8741
|
size: F = "md",
|
|
8741
|
-
label:
|
|
8742
|
+
label: C,
|
|
8742
8743
|
required: k,
|
|
8743
8744
|
panelOnly: _ = !1
|
|
8744
8745
|
}) {
|
|
8745
|
-
const [f, T] = Z(!1), [$, Y] = Z(/* @__PURE__ */ new Date()), [
|
|
8746
|
+
const [f, T] = Z(!1), [$, Y] = Z(/* @__PURE__ */ new Date()), [P, V] = Z(() => {
|
|
8746
8747
|
const d = /* @__PURE__ */ new Date();
|
|
8747
8748
|
return d.setMonth(d.getMonth() + 1), d;
|
|
8748
|
-
}), [
|
|
8749
|
+
}), [H, G] = Z(null), [K, ae] = Z(!1), [ce, te] = Z(c), [X, O] = Z(null), W = le(`datepicker-${Math.random().toString(36).slice(2)}`), B = le(null), se = le(null), q = le(null), j = () => {
|
|
8749
8750
|
if (e === "single") {
|
|
8750
8751
|
const d = ze(a, s);
|
|
8751
8752
|
return d ? [d] : [];
|
|
@@ -8758,7 +8759,7 @@ function ks({
|
|
|
8758
8759
|
oe(() => {
|
|
8759
8760
|
const d = (D) => {
|
|
8760
8761
|
var x;
|
|
8761
|
-
((x = D.detail) == null ? void 0 : x.exclude) !==
|
|
8762
|
+
((x = D.detail) == null ? void 0 : x.exclude) !== B.current && f && (T(!1), G(null), O(null));
|
|
8762
8763
|
};
|
|
8763
8764
|
return document.addEventListener(
|
|
8764
8765
|
"closeDatePicker",
|
|
@@ -8772,15 +8773,15 @@ function ks({
|
|
|
8772
8773
|
}, [f]), oe(() => {
|
|
8773
8774
|
const d = (D) => {
|
|
8774
8775
|
const x = D.target;
|
|
8775
|
-
|
|
8776
|
+
B.current && B.current.contains(x) || (T(!1), G(null), O(null), O(null));
|
|
8776
8777
|
};
|
|
8777
8778
|
if (f && !_)
|
|
8778
8779
|
return document.addEventListener("mousedown", d, !0), () => document.removeEventListener("mousedown", d, !0);
|
|
8779
8780
|
}, [f, _]), oe(() => {
|
|
8780
8781
|
f && document.querySelectorAll(".ina-date-picker").forEach((D) => {
|
|
8781
|
-
if (D !==
|
|
8782
|
+
if (D !== B.current && D.querySelector(".ina-date-picker__panel")) {
|
|
8782
8783
|
const v = new CustomEvent("closeDatePicker", {
|
|
8783
|
-
detail: { exclude:
|
|
8784
|
+
detail: { exclude: B.current }
|
|
8784
8785
|
});
|
|
8785
8786
|
document.dispatchEvent(v);
|
|
8786
8787
|
}
|
|
@@ -8829,7 +8830,7 @@ function ks({
|
|
|
8829
8830
|
if (d)
|
|
8830
8831
|
return new Date(d.getFullYear(), d.getMonth(), 1);
|
|
8831
8832
|
}
|
|
8832
|
-
if (
|
|
8833
|
+
if (N) {
|
|
8833
8834
|
const d = /* @__PURE__ */ new Date();
|
|
8834
8835
|
return new Date(d.getFullYear(), d.getMonth(), 1);
|
|
8835
8836
|
}
|
|
@@ -8841,12 +8842,12 @@ function ks({
|
|
|
8841
8842
|
}, [
|
|
8842
8843
|
p,
|
|
8843
8844
|
I,
|
|
8844
|
-
|
|
8845
|
+
N,
|
|
8845
8846
|
m,
|
|
8846
8847
|
s
|
|
8847
|
-
]),
|
|
8848
|
+
]), de = le(!1);
|
|
8848
8849
|
oe(() => {
|
|
8849
|
-
if ((f || _) && !
|
|
8850
|
+
if ((f || _) && !de.current) {
|
|
8850
8851
|
const d = j();
|
|
8851
8852
|
let D = null, x = null;
|
|
8852
8853
|
if (e === "range" && d.length >= 2) {
|
|
@@ -8889,8 +8890,8 @@ function ks({
|
|
|
8889
8890
|
U.setMonth(U.getMonth() + 1), V(U);
|
|
8890
8891
|
}
|
|
8891
8892
|
}
|
|
8892
|
-
|
|
8893
|
-
} else f || (
|
|
8893
|
+
de.current = !0;
|
|
8894
|
+
} else f || (de.current = !1);
|
|
8894
8895
|
}, [f, e, ee]), oe(() => {
|
|
8895
8896
|
if (f && se.current && !_) {
|
|
8896
8897
|
const d = () => {
|
|
@@ -8925,10 +8926,10 @@ function ks({
|
|
|
8925
8926
|
(d) => {
|
|
8926
8927
|
const D = d.getFullYear(), x = d.getMonth(), v = new Date(D, x, 1), g = new Date(D, x + 1, 0), U = new Date(v);
|
|
8927
8928
|
U.setDate(U.getDate() - v.getDay());
|
|
8928
|
-
const re = [],
|
|
8929
|
-
|
|
8929
|
+
const re = [], ue = new Date(g);
|
|
8930
|
+
ue.setDate(ue.getDate() + (6 - g.getDay()));
|
|
8930
8931
|
let ye = new Date(U);
|
|
8931
|
-
for (; ye <=
|
|
8932
|
+
for (; ye <= ue; )
|
|
8932
8933
|
re.push({
|
|
8933
8934
|
date: new Date(ye),
|
|
8934
8935
|
isCurrentMonth: ye.getMonth() === x,
|
|
@@ -8938,23 +8939,23 @@ function ks({
|
|
|
8938
8939
|
},
|
|
8939
8940
|
[_e]
|
|
8940
8941
|
), J = () => {
|
|
8941
|
-
e === "single" ? t("") : e === "range" ? (t(["", ""]),
|
|
8942
|
+
e === "single" ? t("") : e === "range" ? (t(["", ""]), O(null)) : t([]);
|
|
8942
8943
|
}, he = (d) => {
|
|
8943
|
-
if (
|
|
8944
|
+
if (G(null), e === "single") {
|
|
8944
8945
|
const D = Ge(d, s);
|
|
8945
8946
|
t(D);
|
|
8946
8947
|
} else if (e === "range") {
|
|
8947
8948
|
const D = Q;
|
|
8948
8949
|
if (D.length === 0 && !X)
|
|
8949
|
-
|
|
8950
|
+
O(d);
|
|
8950
8951
|
else if (D.length === 1 || X) {
|
|
8951
|
-
const x = X || D[0], v = d, [g, U] = x <= v ? [x, v] : [v, x], re = Ge(g, s),
|
|
8952
|
+
const x = X || D[0], v = d, [g, U] = x <= v ? [x, v] : [v, x], re = Ge(g, s), ue = Ge(U, s);
|
|
8952
8953
|
t([
|
|
8953
8954
|
re,
|
|
8954
|
-
|
|
8955
|
-
]),
|
|
8955
|
+
ue
|
|
8956
|
+
]), O(null), T(!1);
|
|
8956
8957
|
} else
|
|
8957
|
-
t(["", ""]),
|
|
8958
|
+
t(["", ""]), O(d);
|
|
8958
8959
|
} else if (e === "multiple") {
|
|
8959
8960
|
const D = Q, x = ua(d, D);
|
|
8960
8961
|
let v;
|
|
@@ -8968,7 +8969,7 @@ function ks({
|
|
|
8968
8969
|
}, fe = (d) => {
|
|
8969
8970
|
Y((D) => {
|
|
8970
8971
|
const x = new Date(D);
|
|
8971
|
-
if (d === "prev" ? x.setMonth(x.getMonth() - 1) : x.setMonth(x.getMonth() + 1), e !== "single" && ve(x,
|
|
8972
|
+
if (d === "prev" ? x.setMonth(x.getMonth() - 1) : x.setMonth(x.getMonth() + 1), e !== "single" && ve(x, P)) {
|
|
8972
8973
|
const v = new Date(x);
|
|
8973
8974
|
v.setMonth(v.getMonth() + 1), V(v);
|
|
8974
8975
|
}
|
|
@@ -8993,7 +8994,7 @@ function ks({
|
|
|
8993
8994
|
return v;
|
|
8994
8995
|
}) : Y((x) => {
|
|
8995
8996
|
const v = new Date(x);
|
|
8996
|
-
if (v.setMonth(d), e !== "single" && ve(v,
|
|
8997
|
+
if (v.setMonth(d), e !== "single" && ve(v, P)) {
|
|
8997
8998
|
const g = new Date(v);
|
|
8998
8999
|
g.setMonth(g.getMonth() + 1), V(g);
|
|
8999
9000
|
}
|
|
@@ -9009,7 +9010,7 @@ function ks({
|
|
|
9009
9010
|
return v;
|
|
9010
9011
|
}) : Y((x) => {
|
|
9011
9012
|
const v = new Date(x);
|
|
9012
|
-
if (v.setFullYear(d), e !== "single" && ve(v,
|
|
9013
|
+
if (v.setFullYear(d), e !== "single" && ve(v, P)) {
|
|
9013
9014
|
const g = new Date(v);
|
|
9014
9015
|
g.setMonth(g.getMonth() + 1), V(g);
|
|
9015
9016
|
}
|
|
@@ -9076,16 +9077,16 @@ function ks({
|
|
|
9076
9077
|
}
|
|
9077
9078
|
return !1;
|
|
9078
9079
|
}, Ve = (d) => {
|
|
9079
|
-
if (!d || !
|
|
9080
|
+
if (!d || !H) return !1;
|
|
9080
9081
|
if (e === "range") {
|
|
9081
9082
|
const D = X || (Q.length > 0 ? Q[0] : null);
|
|
9082
9083
|
if (D) {
|
|
9083
|
-
const [x, v] = D <=
|
|
9084
|
+
const [x, v] = D <= H ? [D, H] : [H, D];
|
|
9084
9085
|
return d > x && d < v;
|
|
9085
9086
|
}
|
|
9086
9087
|
}
|
|
9087
9088
|
return !1;
|
|
9088
|
-
}, Ie = (d) => !d || !
|
|
9089
|
+
}, Ie = (d) => !d || !H ? !1 : Le(d, H), o = (d) => {
|
|
9089
9090
|
if (!d) return "none";
|
|
9090
9091
|
if (e === "range") {
|
|
9091
9092
|
if (X && Le(d, X))
|
|
@@ -9101,11 +9102,11 @@ function ks({
|
|
|
9101
9102
|
}
|
|
9102
9103
|
return "none";
|
|
9103
9104
|
}, y = (d) => {
|
|
9104
|
-
if (!d || !
|
|
9105
|
+
if (!d || !H) return "none";
|
|
9105
9106
|
if (e === "range") {
|
|
9106
9107
|
const D = X || (Q.length > 0 ? Q[0] : null);
|
|
9107
9108
|
if (D) {
|
|
9108
|
-
const [x, v] = D <=
|
|
9109
|
+
const [x, v] = D <= H ? [D, H] : [H, D];
|
|
9109
9110
|
if (Le(d, x) && Le(d, v))
|
|
9110
9111
|
return "single";
|
|
9111
9112
|
if (Le(d, x)) return "start";
|
|
@@ -9114,12 +9115,12 @@ function ks({
|
|
|
9114
9115
|
}
|
|
9115
9116
|
}
|
|
9116
9117
|
return "none";
|
|
9117
|
-
},
|
|
9118
|
+
}, M = me(
|
|
9118
9119
|
(d) => {
|
|
9119
9120
|
const D = /* @__PURE__ */ new Date();
|
|
9120
9121
|
D.setHours(0, 0, 0, 0);
|
|
9121
9122
|
const x = new Date(d);
|
|
9122
|
-
if (x.setHours(0, 0, 0, 0),
|
|
9123
|
+
if (x.setHours(0, 0, 0, 0), N && x < D || m && x > D)
|
|
9123
9124
|
return !0;
|
|
9124
9125
|
if (p) {
|
|
9125
9126
|
const v = ze(p, s);
|
|
@@ -9134,7 +9135,7 @@ function ks({
|
|
|
9134
9135
|
return !1;
|
|
9135
9136
|
},
|
|
9136
9137
|
[
|
|
9137
|
-
|
|
9138
|
+
N,
|
|
9138
9139
|
m,
|
|
9139
9140
|
p,
|
|
9140
9141
|
I,
|
|
@@ -9142,7 +9143,7 @@ function ks({
|
|
|
9142
9143
|
]
|
|
9143
9144
|
), R = me(
|
|
9144
9145
|
(d) => {
|
|
9145
|
-
const { date: D, isCurrentMonth: x, isToday: v } = d, g = o(D), U = y(D), re = ke(D),
|
|
9146
|
+
const { date: D, isCurrentMonth: x, isToday: v } = d, g = o(D), U = y(D), re = ke(D), ue = Ne(D), ye = Ve(D), De = Ie(D), je = M(D);
|
|
9146
9147
|
return {
|
|
9147
9148
|
className: S("ina-date-picker__day", {
|
|
9148
9149
|
"ina-date-picker__day--other-month": !x,
|
|
@@ -9153,12 +9154,12 @@ function ks({
|
|
|
9153
9154
|
"ina-date-picker__day--range-in": g === "middle",
|
|
9154
9155
|
"ina-date-picker__day--start": U === "start",
|
|
9155
9156
|
"ina-date-picker__day--end": U === "end",
|
|
9156
|
-
"ina-date-picker__day--in-range":
|
|
9157
|
+
"ina-date-picker__day--in-range": ue,
|
|
9157
9158
|
"ina-date-picker__day--hover": ye,
|
|
9158
9159
|
"ina-date-picker__day--disabled": je
|
|
9159
9160
|
}),
|
|
9160
9161
|
isSelected: re,
|
|
9161
|
-
isInRange:
|
|
9162
|
+
isInRange: ue,
|
|
9162
9163
|
isHovered: ye,
|
|
9163
9164
|
isHoveredEnd: De,
|
|
9164
9165
|
isDisabled: je
|
|
@@ -9171,29 +9172,29 @@ function ks({
|
|
|
9171
9172
|
Ne,
|
|
9172
9173
|
Ve,
|
|
9173
9174
|
Ie,
|
|
9174
|
-
|
|
9175
|
+
M
|
|
9175
9176
|
]
|
|
9176
9177
|
), L = Fe(
|
|
9177
9178
|
() => ie($),
|
|
9178
9179
|
[$, ie]
|
|
9179
9180
|
), z = Fe(
|
|
9180
|
-
() => ie(
|
|
9181
|
-
[
|
|
9181
|
+
() => ie(P),
|
|
9182
|
+
[P, ie]
|
|
9182
9183
|
);
|
|
9183
9184
|
return /* @__PURE__ */ w(
|
|
9184
9185
|
"div",
|
|
9185
9186
|
{
|
|
9186
|
-
ref:
|
|
9187
|
+
ref: B,
|
|
9187
9188
|
className: S(
|
|
9188
9189
|
"ina-date-picker",
|
|
9189
9190
|
E && "ina-date-picker--disabled",
|
|
9190
9191
|
_ && "ina-date-picker--panel-only",
|
|
9191
9192
|
l
|
|
9192
9193
|
),
|
|
9193
|
-
style: { width:
|
|
9194
|
+
style: { width: ce },
|
|
9194
9195
|
children: [
|
|
9195
|
-
!_ &&
|
|
9196
|
-
|
|
9196
|
+
!_ && C && /* @__PURE__ */ w("label", { className: "ina-date-picker__label", htmlFor: W.current, children: [
|
|
9197
|
+
C,
|
|
9197
9198
|
k && /* @__PURE__ */ n("span", { className: "ina-date-picker__required", children: "*" })
|
|
9198
9199
|
] }),
|
|
9199
9200
|
!_ && /* @__PURE__ */ w(Ye, { children: [
|
|
@@ -9204,9 +9205,9 @@ function ks({
|
|
|
9204
9205
|
type: "button",
|
|
9205
9206
|
onClick: () => {
|
|
9206
9207
|
E || A || (f || document.querySelectorAll(".ina-date-picker").forEach((D) => {
|
|
9207
|
-
if (D !==
|
|
9208
|
+
if (D !== B.current) {
|
|
9208
9209
|
const x = new CustomEvent("closeDatePicker", {
|
|
9209
|
-
detail: { exclude:
|
|
9210
|
+
detail: { exclude: B.current }
|
|
9210
9211
|
});
|
|
9211
9212
|
document.dispatchEvent(x);
|
|
9212
9213
|
}
|
|
@@ -9219,10 +9220,10 @@ function ks({
|
|
|
9219
9220
|
A && "ina-date-picker__trigger--readonly",
|
|
9220
9221
|
u
|
|
9221
9222
|
),
|
|
9222
|
-
id:
|
|
9223
|
+
id: W.current,
|
|
9223
9224
|
"aria-haspopup": "grid",
|
|
9224
9225
|
"aria-expanded": f,
|
|
9225
|
-
style: { width:
|
|
9226
|
+
style: { width: ce },
|
|
9226
9227
|
disabled: E,
|
|
9227
9228
|
children: [
|
|
9228
9229
|
/* @__PURE__ */ n(Ut, { size: 20, className: "ina-date-picker__trigger-icon" }),
|
|
@@ -9262,7 +9263,7 @@ function ks({
|
|
|
9262
9263
|
className: S(
|
|
9263
9264
|
"ina-date-picker__panel",
|
|
9264
9265
|
`ina-date-picker__panel--${i.split("-")[0]}`,
|
|
9265
|
-
|
|
9266
|
+
K && !i.includes("left") && !i.includes("right") && "ina-date-picker__panel--right-aligned",
|
|
9266
9267
|
h
|
|
9267
9268
|
),
|
|
9268
9269
|
style: {
|
|
@@ -9405,8 +9406,8 @@ function ks({
|
|
|
9405
9406
|
}
|
|
9406
9407
|
}
|
|
9407
9408
|
},
|
|
9408
|
-
onMouseEnter: () => !x.isDisabled &&
|
|
9409
|
-
onMouseLeave: () =>
|
|
9409
|
+
onMouseEnter: () => !x.isDisabled && G(d.date),
|
|
9410
|
+
onMouseLeave: () => G(null),
|
|
9410
9411
|
disabled: x.isDisabled,
|
|
9411
9412
|
className: S(
|
|
9412
9413
|
x.className,
|
|
@@ -9440,7 +9441,7 @@ function ks({
|
|
|
9440
9441
|
/* @__PURE__ */ n("div", { className: "ina-date-picker__dropdown-container", children: /* @__PURE__ */ n(
|
|
9441
9442
|
da,
|
|
9442
9443
|
{
|
|
9443
|
-
value:
|
|
9444
|
+
value: P.getMonth(),
|
|
9444
9445
|
onChange: (d) => Ce(d, !0),
|
|
9445
9446
|
locale: "id",
|
|
9446
9447
|
disabled: E,
|
|
@@ -9451,7 +9452,7 @@ function ks({
|
|
|
9451
9452
|
/* @__PURE__ */ n("div", { className: "ina-date-picker__dropdown-container", children: /* @__PURE__ */ n(
|
|
9452
9453
|
ca,
|
|
9453
9454
|
{
|
|
9454
|
-
value:
|
|
9455
|
+
value: P.getFullYear(),
|
|
9455
9456
|
onChange: (d) => {
|
|
9456
9457
|
const D = typeof d == "string" ? parseInt(d, 10) : d;
|
|
9457
9458
|
be(D, !0);
|
|
@@ -9525,8 +9526,8 @@ function ks({
|
|
|
9525
9526
|
}
|
|
9526
9527
|
}
|
|
9527
9528
|
},
|
|
9528
|
-
onMouseEnter: () => !x.isDisabled &&
|
|
9529
|
-
onMouseLeave: () =>
|
|
9529
|
+
onMouseEnter: () => !x.isDisabled && G(d.date),
|
|
9530
|
+
onMouseLeave: () => G(null),
|
|
9530
9531
|
disabled: x.isDisabled,
|
|
9531
9532
|
className: x.className + (!x.isSelected && !x.isInRange && !x.isHovered && !x.isHoveredEnd && !x.isDisabled ? " ina-date-picker__day--hover" : ""),
|
|
9532
9533
|
children: d.date.getDate()
|
|
@@ -9569,7 +9570,7 @@ function Ns({
|
|
|
9569
9570
|
h(E, I);
|
|
9570
9571
|
},
|
|
9571
9572
|
[l, h]
|
|
9572
|
-
),
|
|
9573
|
+
), N = me(
|
|
9573
9574
|
(m, p) => t.some(
|
|
9574
9575
|
(I) => I.rowId === m && I.columnId === p
|
|
9575
9576
|
),
|
|
@@ -9606,7 +9607,7 @@ function Ns({
|
|
|
9606
9607
|
type: "radio",
|
|
9607
9608
|
name: `${l}-${m.id}`,
|
|
9608
9609
|
value: p.id,
|
|
9609
|
-
checked:
|
|
9610
|
+
checked: N(m.id, p.id),
|
|
9610
9611
|
onChange: u,
|
|
9611
9612
|
disabled: s,
|
|
9612
9613
|
className: "ina-multiple-choice-grid__radio-input",
|
|
@@ -9635,7 +9636,7 @@ function Cs({
|
|
|
9635
9636
|
id: b,
|
|
9636
9637
|
name: h,
|
|
9637
9638
|
value: u,
|
|
9638
|
-
color:
|
|
9639
|
+
color: N,
|
|
9639
9640
|
...m
|
|
9640
9641
|
}) {
|
|
9641
9642
|
const p = e !== void 0, [I, E] = Z(a), A = p ? e : I, F = me(
|
|
@@ -9645,7 +9646,7 @@ function Cs({
|
|
|
9645
9646
|
p || E($), i && i($);
|
|
9646
9647
|
},
|
|
9647
9648
|
[t, i, p]
|
|
9648
|
-
),
|
|
9649
|
+
), C = S(
|
|
9649
9650
|
"ina-toggle",
|
|
9650
9651
|
`ina-toggle--size-${r}`,
|
|
9651
9652
|
{
|
|
@@ -9667,8 +9668,8 @@ function Cs({
|
|
|
9667
9668
|
"ina-toggle__thumb--checked": A,
|
|
9668
9669
|
"ina-toggle__thumb--disabled": t
|
|
9669
9670
|
}
|
|
9670
|
-
), f = A &&
|
|
9671
|
-
return /* @__PURE__ */ w("div", { className:
|
|
9671
|
+
), f = A && N && !t ? { backgroundColor: N, borderColor: N } : {};
|
|
9672
|
+
return /* @__PURE__ */ w("div", { className: C, children: [
|
|
9672
9673
|
/* @__PURE__ */ n(
|
|
9673
9674
|
"input",
|
|
9674
9675
|
{
|
|
@@ -9707,7 +9708,7 @@ function Ms({
|
|
|
9707
9708
|
disabled: b = !1,
|
|
9708
9709
|
className: h = "",
|
|
9709
9710
|
containerClassName: u = "",
|
|
9710
|
-
tabClassName:
|
|
9711
|
+
tabClassName: N = ""
|
|
9711
9712
|
}) {
|
|
9712
9713
|
var k;
|
|
9713
9714
|
const [m, p] = Z(
|
|
@@ -9725,12 +9726,12 @@ function Ms({
|
|
|
9725
9726
|
c && "ina-tab-horizontal--use-brand-color",
|
|
9726
9727
|
b && "ina-tab-horizontal--disabled",
|
|
9727
9728
|
h
|
|
9728
|
-
),
|
|
9729
|
+
), C = S(
|
|
9729
9730
|
"ina-tab-horizontal__container",
|
|
9730
9731
|
l && "ina-tab-horizontal__container--full-width",
|
|
9731
9732
|
u
|
|
9732
9733
|
);
|
|
9733
|
-
return /* @__PURE__ */ n("div", { className: F, children: /* @__PURE__ */ n("div", { className:
|
|
9734
|
+
return /* @__PURE__ */ n("div", { className: F, children: /* @__PURE__ */ n("div", { className: C, role: "tablist", children: e.map((_, f) => {
|
|
9734
9735
|
const T = I === _.value, $ = b || _.disabled, Y = S(
|
|
9735
9736
|
"ina-tab-horizontal__tab",
|
|
9736
9737
|
`ina-tab-horizontal__tab--size-${i}`,
|
|
@@ -9738,12 +9739,12 @@ function Ms({
|
|
|
9738
9739
|
T && "ina-tab-horizontal__tab--selected",
|
|
9739
9740
|
$ && "ina-tab-horizontal__tab--disabled",
|
|
9740
9741
|
l && "ina-tab-horizontal__tab--full-width",
|
|
9741
|
-
|
|
9742
|
+
N
|
|
9742
9743
|
);
|
|
9743
9744
|
return /* @__PURE__ */ n(
|
|
9744
9745
|
"button",
|
|
9745
9746
|
{
|
|
9746
|
-
ref: (
|
|
9747
|
+
ref: (P) => E.current[f] = P,
|
|
9747
9748
|
type: "button",
|
|
9748
9749
|
role: "tab",
|
|
9749
9750
|
"aria-selected": T,
|
|
@@ -9752,20 +9753,20 @@ function Ms({
|
|
|
9752
9753
|
tabIndex: T ? 0 : -1,
|
|
9753
9754
|
className: Y,
|
|
9754
9755
|
onClick: () => A(_.value, _.disabled),
|
|
9755
|
-
onKeyDown: (
|
|
9756
|
-
var
|
|
9756
|
+
onKeyDown: (P) => {
|
|
9757
|
+
var H, G;
|
|
9757
9758
|
if ($) return;
|
|
9758
9759
|
let V;
|
|
9759
|
-
if (
|
|
9760
|
-
|
|
9761
|
-
else if (
|
|
9762
|
-
for (
|
|
9760
|
+
if (P.key === "Enter" || P.key === " ")
|
|
9761
|
+
P.preventDefault(), A(_.value, _.disabled);
|
|
9762
|
+
else if (P.key === "ArrowRight") {
|
|
9763
|
+
for (P.preventDefault(), V = (f + 1) % e.length; e[V].disabled && V !== f; )
|
|
9763
9764
|
V = (V + 1) % e.length;
|
|
9764
|
-
(
|
|
9765
|
-
} else if (
|
|
9766
|
-
for (
|
|
9765
|
+
(H = E.current[V]) == null || H.focus();
|
|
9766
|
+
} else if (P.key === "ArrowLeft") {
|
|
9767
|
+
for (P.preventDefault(), V = (f - 1 + e.length) % e.length; e[V].disabled && V !== f; )
|
|
9767
9768
|
V = (V - 1 + e.length) % e.length;
|
|
9768
|
-
(
|
|
9769
|
+
(G = E.current[V]) == null || G.focus();
|
|
9769
9770
|
}
|
|
9770
9771
|
},
|
|
9771
9772
|
children: _.label
|
|
@@ -9786,7 +9787,7 @@ function xs({
|
|
|
9786
9787
|
className: b = "",
|
|
9787
9788
|
containerClassName: h = "",
|
|
9788
9789
|
tabClassName: u = "",
|
|
9789
|
-
width:
|
|
9790
|
+
width: N = "200px"
|
|
9790
9791
|
}) {
|
|
9791
9792
|
var _;
|
|
9792
9793
|
const [m, p] = Z(
|
|
@@ -9803,14 +9804,14 @@ function xs({
|
|
|
9803
9804
|
l && "ina-tab-vertical--use-brand-color",
|
|
9804
9805
|
c && "ina-tab-vertical--disabled",
|
|
9805
9806
|
b
|
|
9806
|
-
),
|
|
9807
|
+
), C = S(
|
|
9807
9808
|
"ina-tab-vertical__container",
|
|
9808
9809
|
h
|
|
9809
9810
|
), k = {
|
|
9810
|
-
width: typeof
|
|
9811
|
+
width: typeof N == "number" ? `${N}px` : N
|
|
9811
9812
|
};
|
|
9812
|
-
return /* @__PURE__ */ n("div", { className: F, style: k, children: /* @__PURE__ */ n("div", { className:
|
|
9813
|
-
const $ = I === f.value, Y = c || f.disabled,
|
|
9813
|
+
return /* @__PURE__ */ n("div", { className: F, style: k, children: /* @__PURE__ */ n("div", { className: C, role: "tablist", children: e.map((f, T) => {
|
|
9814
|
+
const $ = I === f.value, Y = c || f.disabled, P = S(
|
|
9814
9815
|
"ina-tab-vertical__tab",
|
|
9815
9816
|
`ina-tab-vertical__tab--size-${i}`,
|
|
9816
9817
|
`ina-tab-vertical__tab--variant-${s}`,
|
|
@@ -9828,22 +9829,22 @@ function xs({
|
|
|
9828
9829
|
"aria-disabled": Y,
|
|
9829
9830
|
disabled: Y,
|
|
9830
9831
|
tabIndex: $ ? 0 : -1,
|
|
9831
|
-
className:
|
|
9832
|
+
className: P,
|
|
9832
9833
|
onClick: () => A(f.value, f.disabled),
|
|
9833
9834
|
onKeyDown: (V) => {
|
|
9834
|
-
var
|
|
9835
|
+
var G, K;
|
|
9835
9836
|
if (Y) return;
|
|
9836
|
-
let
|
|
9837
|
+
let H;
|
|
9837
9838
|
if (V.key === "Enter" || V.key === " ")
|
|
9838
9839
|
V.preventDefault(), A(f.value, f.disabled);
|
|
9839
9840
|
else if (V.key === "ArrowDown") {
|
|
9840
|
-
for (V.preventDefault(),
|
|
9841
|
-
|
|
9842
|
-
(
|
|
9841
|
+
for (V.preventDefault(), H = (T + 1) % e.length; e[H].disabled && H !== T; )
|
|
9842
|
+
H = (H + 1) % e.length;
|
|
9843
|
+
(G = E.current[H]) == null || G.focus();
|
|
9843
9844
|
} else if (V.key === "ArrowUp") {
|
|
9844
|
-
for (V.preventDefault(),
|
|
9845
|
-
|
|
9846
|
-
(
|
|
9845
|
+
for (V.preventDefault(), H = (T - 1 + e.length) % e.length; e[H].disabled && H !== T; )
|
|
9846
|
+
H = (H - 1 + e.length) % e.length;
|
|
9847
|
+
(K = E.current[H]) == null || K.focus();
|
|
9847
9848
|
}
|
|
9848
9849
|
},
|
|
9849
9850
|
children: f.label
|