@idds/react 1.6.17 → 1.6.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +672 -667
- package/dist/types/components/Modal.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as w, jsx as n, Fragment as Ye } from "react/jsx-runtime";
|
|
2
|
-
import ge, { useRef as le, useState as Z, useCallback as me, useMemo as Fe, useContext as Vt, createContext as
|
|
3
|
-
import { createPortal as
|
|
2
|
+
import ge, { useRef as le, useState as Z, useCallback as me, useMemo as Fe, useContext as Vt, createContext as Tt, useId as ma, useEffect as oe, forwardRef as ha, useImperativeHandle as va, Fragment as Wa } from "react";
|
|
3
|
+
import { createPortal as Lt } from "react-dom";
|
|
4
4
|
const mr = {
|
|
5
5
|
// Neutral Colors
|
|
6
6
|
"neutral-25": "var(--ina-neutral-25, #ffffff)",
|
|
@@ -583,7 +583,7 @@ function S() {
|
|
|
583
583
|
for (var e, a, t = 0, r = "", i = arguments.length; t < i; t++) (e = arguments[t]) && (a = ya(e)) && (r && (r += " "), r += a);
|
|
584
584
|
return r;
|
|
585
585
|
}
|
|
586
|
-
const _a =
|
|
586
|
+
const _a = Tt(
|
|
587
587
|
null
|
|
588
588
|
);
|
|
589
589
|
function ja() {
|
|
@@ -604,7 +604,7 @@ function Ar(e) {
|
|
|
604
604
|
const I = me(
|
|
605
605
|
(k, _) => {
|
|
606
606
|
const f = b.current.size;
|
|
607
|
-
return b.current.set(k, f), _ && u((
|
|
607
|
+
return b.current.set(k, f), _ && u((T) => c ? T.includes(f) ? T : [...T, f] : T.length === 0 ? [f] : T), f;
|
|
608
608
|
},
|
|
609
609
|
[c]
|
|
610
610
|
), A = me((k) => {
|
|
@@ -612,16 +612,16 @@ function Ar(e) {
|
|
|
612
612
|
if (_ !== void 0) {
|
|
613
613
|
b.current.delete(k), u(($) => $.filter((B) => B !== _).map((B) => B > _ ? B - 1 : B));
|
|
614
614
|
const f = /* @__PURE__ */ new Map();
|
|
615
|
-
let
|
|
616
|
-
b.current.forEach(($,
|
|
617
|
-
f.set(
|
|
615
|
+
let T = 0;
|
|
616
|
+
b.current.forEach(($, Y) => {
|
|
617
|
+
f.set(Y, T), T++;
|
|
618
618
|
}), b.current = f;
|
|
619
619
|
}
|
|
620
620
|
}, []), E = me(
|
|
621
621
|
(k, _) => {
|
|
622
622
|
u((f) => {
|
|
623
|
-
let
|
|
624
|
-
return c ? _ ? f.includes(k) ?
|
|
623
|
+
let T;
|
|
624
|
+
return c ? _ ? f.includes(k) ? T = f : T = [...f, k] : T = f.filter(($) => $ !== k) : _ ? T = [k] : T = [], m(($) => $ + 1), i == null || i(T), T;
|
|
625
625
|
});
|
|
626
626
|
},
|
|
627
627
|
[c, i]
|
|
@@ -668,15 +668,15 @@ function Er(e) {
|
|
|
668
668
|
F && (F(m.current), I(-1));
|
|
669
669
|
};
|
|
670
670
|
}, [E, F]);
|
|
671
|
-
const N = u !== null, k = i !== void 0 || N, _ = Fe(() => N && p >= 0 && u ? u.isItemOpen(p) : i !== void 0 ? i : b, [N, p, u, i, b]), f = Fe(() => `accordion-header-${m.current}`, []),
|
|
671
|
+
const N = u !== null, k = i !== void 0 || N, _ = Fe(() => N && p >= 0 && u ? u.isItemOpen(p) : i !== void 0 ? i : b, [N, p, u, i, b]), f = Fe(() => `accordion-header-${m.current}`, []), T = Fe(() => `accordion-content-${m.current}`, []), $ = () => {
|
|
672
672
|
if (l) return;
|
|
673
673
|
const B = !_;
|
|
674
674
|
N && p >= 0 && u ? u.handleItemToggle(p, B) : k || h(B), s == null || s(B);
|
|
675
|
-
},
|
|
675
|
+
}, Y = S("ina-accordion", c, {
|
|
676
676
|
"ina-accordion--disabled": l,
|
|
677
677
|
"ina-accordion--open": _
|
|
678
678
|
});
|
|
679
|
-
return /* @__PURE__ */ w("div", { className:
|
|
679
|
+
return /* @__PURE__ */ w("div", { className: Y, children: [
|
|
680
680
|
/* @__PURE__ */ w(
|
|
681
681
|
"button",
|
|
682
682
|
{
|
|
@@ -687,24 +687,24 @@ function Er(e) {
|
|
|
687
687
|
var V;
|
|
688
688
|
if (B.key === "ArrowDown" || B.key === "ArrowUp") {
|
|
689
689
|
B.preventDefault();
|
|
690
|
-
const
|
|
691
|
-
if (!O) return;
|
|
692
|
-
const G = O.closest(".ina-accordion-group") || O.parentElement;
|
|
690
|
+
const G = B.currentTarget.closest(".ina-accordion");
|
|
693
691
|
if (!G) return;
|
|
694
|
-
const
|
|
695
|
-
|
|
692
|
+
const O = G.closest(".ina-accordion-group") || G.parentElement;
|
|
693
|
+
if (!O) return;
|
|
694
|
+
const W = Array.from(
|
|
695
|
+
O.querySelectorAll(
|
|
696
696
|
".ina-accordion__toggle:not([disabled])"
|
|
697
697
|
)
|
|
698
|
-
), ae =
|
|
698
|
+
), ae = W.indexOf(B.currentTarget);
|
|
699
699
|
if (ae > -1) {
|
|
700
|
-
const ue = B.key === "ArrowDown" ? (ae + 1) %
|
|
701
|
-
(V =
|
|
700
|
+
const ue = B.key === "ArrowDown" ? (ae + 1) % W.length : (ae - 1 + W.length) % W.length;
|
|
701
|
+
(V = W[ue]) == null || V.focus();
|
|
702
702
|
}
|
|
703
703
|
}
|
|
704
704
|
},
|
|
705
705
|
className: "ina-accordion__toggle",
|
|
706
706
|
"aria-expanded": _,
|
|
707
|
-
"aria-controls":
|
|
707
|
+
"aria-controls": T,
|
|
708
708
|
disabled: l,
|
|
709
709
|
children: [
|
|
710
710
|
/* @__PURE__ */ n("div", { className: "ina-accordion__title", children: a }),
|
|
@@ -735,7 +735,7 @@ function Er(e) {
|
|
|
735
735
|
/* @__PURE__ */ n(
|
|
736
736
|
"div",
|
|
737
737
|
{
|
|
738
|
-
id:
|
|
738
|
+
id: T,
|
|
739
739
|
className: S("ina-accordion__content", {
|
|
740
740
|
"ina-accordion__content--open": _
|
|
741
741
|
}),
|
|
@@ -962,7 +962,7 @@ const at = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
962
962
|
/* @__PURE__ */ n("path", { d: "M12 16h.01" })
|
|
963
963
|
]
|
|
964
964
|
}
|
|
965
|
-
),
|
|
965
|
+
), Te = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
966
966
|
"svg",
|
|
967
967
|
{
|
|
968
968
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1069,12 +1069,12 @@ function Vr(e) {
|
|
|
1069
1069
|
c == null || c();
|
|
1070
1070
|
},
|
|
1071
1071
|
"aria-label": l,
|
|
1072
|
-
children: /* @__PURE__ */ n(
|
|
1072
|
+
children: /* @__PURE__ */ n(Te, { size: 14, strokeWidth: 2, className: "ina-alert__close-icon" })
|
|
1073
1073
|
}
|
|
1074
1074
|
)
|
|
1075
1075
|
] });
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1077
|
+
function Tr({
|
|
1078
1078
|
src: e,
|
|
1079
1079
|
alt: a = "Avatar",
|
|
1080
1080
|
initials: t = "",
|
|
@@ -1096,7 +1096,7 @@ function Lr({
|
|
|
1096
1096
|
const c = t.slice(0, 2).toUpperCase();
|
|
1097
1097
|
return /* @__PURE__ */ n("div", { className: l, children: c });
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function Lr({
|
|
1100
1100
|
type: e = "soft",
|
|
1101
1101
|
variant: a = "info",
|
|
1102
1102
|
size: t = "md",
|
|
@@ -1459,7 +1459,7 @@ function Br({
|
|
|
1459
1459
|
tabIndex: E ? 0 : -1,
|
|
1460
1460
|
onClick: () => m(I.value, I.disabled),
|
|
1461
1461
|
onKeyDown: (k) => {
|
|
1462
|
-
var f,
|
|
1462
|
+
var f, T;
|
|
1463
1463
|
if (F) return;
|
|
1464
1464
|
let _;
|
|
1465
1465
|
if (k.key === "Enter" || k.key === " ")
|
|
@@ -1471,7 +1471,7 @@ function Br({
|
|
|
1471
1471
|
} else if (k.key === "ArrowLeft" || k.key === "ArrowUp") {
|
|
1472
1472
|
for (k.preventDefault(), _ = (A - 1 + e.length) % e.length; e[_].disabled && _ !== A; )
|
|
1473
1473
|
_ = (_ - 1 + e.length) % e.length;
|
|
1474
|
-
(
|
|
1474
|
+
(T = u.current[_]) == null || T.focus();
|
|
1475
1475
|
}
|
|
1476
1476
|
},
|
|
1477
1477
|
"aria-pressed": E,
|
|
@@ -1620,13 +1620,13 @@ function Hr({
|
|
|
1620
1620
|
className: h = ""
|
|
1621
1621
|
}) {
|
|
1622
1622
|
const u = Array.isArray(a) ? a : a ? [a] : [], M = u.filter(
|
|
1623
|
-
(V) => !e.some((
|
|
1623
|
+
(V) => !e.some((G) => G.value === V) && V !== ""
|
|
1624
1624
|
), m = M.length > 0, p = M[M.length - 1] || "", [I, A] = Z(!1), [E, F] = Z(p), N = () => {
|
|
1625
1625
|
if (u.length > 0) {
|
|
1626
1626
|
if (m && l)
|
|
1627
1627
|
return e.length;
|
|
1628
1628
|
const V = e.findIndex(
|
|
1629
|
-
(
|
|
1629
|
+
(G) => G.value === u[0]
|
|
1630
1630
|
);
|
|
1631
1631
|
if (V !== -1) return V;
|
|
1632
1632
|
}
|
|
@@ -1637,64 +1637,64 @@ function Hr({
|
|
|
1637
1637
|
}, [a, e, m]), oe(() => {
|
|
1638
1638
|
m ? F(p) : (A(!1), F(""));
|
|
1639
1639
|
}, [a, m]);
|
|
1640
|
-
const
|
|
1640
|
+
const T = (V) => {
|
|
1641
1641
|
if (V)
|
|
1642
1642
|
if (t) {
|
|
1643
|
-
let
|
|
1644
|
-
u.includes(V) ?
|
|
1643
|
+
let G;
|
|
1644
|
+
u.includes(V) ? G = u.filter((O) => O !== V) : G = [...u, V], s == null || s(G);
|
|
1645
1645
|
} else
|
|
1646
1646
|
u.includes(V) ? s == null || s("") : s == null || s(V);
|
|
1647
1647
|
}, $ = () => {
|
|
1648
1648
|
const V = E.trim();
|
|
1649
1649
|
if (t) {
|
|
1650
|
-
let
|
|
1651
|
-
m && p && (
|
|
1650
|
+
let G = [...u];
|
|
1651
|
+
m && p && (G = G.filter((O) => O !== p)), V && (G.includes(V) || G.push(V)), s == null || s(G);
|
|
1652
1652
|
} else
|
|
1653
1653
|
s == null || s(V);
|
|
1654
1654
|
A(!1);
|
|
1655
|
-
},
|
|
1655
|
+
}, Y = l ? [...e, { label: c, value: c }] : e, B = S("ina-chip", h);
|
|
1656
1656
|
return /* @__PURE__ */ w("div", { className: B, children: [
|
|
1657
|
-
/* @__PURE__ */ n("div", { className: "ina-chip__list", children:
|
|
1658
|
-
const
|
|
1657
|
+
/* @__PURE__ */ n("div", { className: "ina-chip__list", children: Y.map((V, G) => {
|
|
1658
|
+
const O = l && V.value === c, W = O ? m : u.includes(V.value);
|
|
1659
1659
|
return /* @__PURE__ */ n(
|
|
1660
1660
|
"button",
|
|
1661
1661
|
{
|
|
1662
|
-
ref: (ae) => f.current[
|
|
1662
|
+
ref: (ae) => f.current[G] = ae,
|
|
1663
1663
|
type: "button",
|
|
1664
|
-
tabIndex:
|
|
1664
|
+
tabIndex: G === k && !V.disabled ? 0 : -1,
|
|
1665
1665
|
disabled: V.disabled,
|
|
1666
1666
|
onClick: () => {
|
|
1667
|
-
V.disabled || (_(
|
|
1667
|
+
V.disabled || (_(G), O ? (A(!0), F(!t && !m ? "" : p)) : T(V.value));
|
|
1668
1668
|
},
|
|
1669
1669
|
onKeyDown: (ae) => {
|
|
1670
|
-
var ue, te, X, H,
|
|
1670
|
+
var ue, te, X, H, K;
|
|
1671
1671
|
if (!V.disabled) {
|
|
1672
1672
|
if (ae.key === "ArrowRight" || ae.key === "ArrowDown") {
|
|
1673
1673
|
ae.preventDefault();
|
|
1674
|
-
let P = (
|
|
1675
|
-
for (; (ue =
|
|
1676
|
-
P = (P + 1) %
|
|
1674
|
+
let P = (G + 1) % Y.length;
|
|
1675
|
+
for (; (ue = Y[P]) != null && ue.disabled && P !== G; )
|
|
1676
|
+
P = (P + 1) % Y.length;
|
|
1677
1677
|
_(P), (te = f.current[P]) == null || te.focus();
|
|
1678
1678
|
} else if (ae.key === "ArrowLeft" || ae.key === "ArrowUp") {
|
|
1679
1679
|
ae.preventDefault();
|
|
1680
|
-
let P = (
|
|
1681
|
-
for (; (X =
|
|
1682
|
-
P = (P - 1 +
|
|
1680
|
+
let P = (G - 1 + Y.length) % Y.length;
|
|
1681
|
+
for (; (X = Y[P]) != null && X.disabled && P !== G; )
|
|
1682
|
+
P = (P - 1 + Y.length) % Y.length;
|
|
1683
1683
|
_(P), (H = f.current[P]) == null || H.focus();
|
|
1684
1684
|
}
|
|
1685
|
-
ae.key === " " && (ae.preventDefault(), (
|
|
1685
|
+
ae.key === " " && (ae.preventDefault(), (K = f.current[G]) == null || K.click());
|
|
1686
1686
|
}
|
|
1687
1687
|
},
|
|
1688
1688
|
className: S(
|
|
1689
1689
|
"ina-chip__item",
|
|
1690
1690
|
`ina-chip__item--size-${r}`,
|
|
1691
1691
|
`ina-chip__item--variant-${i}`,
|
|
1692
|
-
|
|
1692
|
+
W && "ina-chip__item--selected",
|
|
1693
1693
|
V.disabled && "ina-chip__item--disabled"
|
|
1694
1694
|
),
|
|
1695
1695
|
children: V.label
|
|
1696
1696
|
},
|
|
1697
|
-
`${V.label}-${
|
|
1697
|
+
`${V.label}-${G}`
|
|
1698
1698
|
);
|
|
1699
1699
|
}) }),
|
|
1700
1700
|
l && I && /* @__PURE__ */ n("div", { className: "ina-chip__custom-field", children: b ?? /* @__PURE__ */ w("div", { className: "ina-chip__input-wrapper", children: [
|
|
@@ -1827,11 +1827,11 @@ function Gr({
|
|
|
1827
1827
|
oe(() => {
|
|
1828
1828
|
const f = ($) => {
|
|
1829
1829
|
I.current && !I.current.contains($.target) && p && F(!1);
|
|
1830
|
-
},
|
|
1830
|
+
}, T = ($) => {
|
|
1831
1831
|
$.key === "Escape" && p && F(!1);
|
|
1832
1832
|
};
|
|
1833
|
-
return document.addEventListener("mousedown", f), document.addEventListener("touchstart", f), document.addEventListener("keydown",
|
|
1834
|
-
document.removeEventListener("mousedown", f), document.removeEventListener("touchstart", f), document.removeEventListener("keydown",
|
|
1833
|
+
return document.addEventListener("mousedown", f), document.addEventListener("touchstart", f), document.addEventListener("keydown", T), () => {
|
|
1834
|
+
document.removeEventListener("mousedown", f), document.removeEventListener("touchstart", f), document.removeEventListener("keydown", T);
|
|
1835
1835
|
};
|
|
1836
1836
|
}, [p, i]);
|
|
1837
1837
|
const _ = typeof e == "string" || typeof e == "number";
|
|
@@ -2373,16 +2373,16 @@ function Wr({
|
|
|
2373
2373
|
onRemove: p,
|
|
2374
2374
|
...I
|
|
2375
2375
|
}) {
|
|
2376
|
-
const A = le(null), [E, F] = Z([]), [N, k] = Z(!1), [_, f] = Z([]), [
|
|
2376
|
+
const A = le(null), [E, F] = Z([]), [N, k] = Z(!1), [_, f] = Z([]), [T, $] = Z(!1), Y = me(() => {
|
|
2377
2377
|
var H;
|
|
2378
2378
|
u || (H = A.current) == null || H.click();
|
|
2379
2379
|
}, [u]), B = me(
|
|
2380
2380
|
async (H) => {
|
|
2381
|
-
const
|
|
2381
|
+
const K = [], P = [], se = [];
|
|
2382
2382
|
if (i && c) {
|
|
2383
|
-
const
|
|
2384
|
-
if (
|
|
2385
|
-
const Q = c -
|
|
2383
|
+
const j = E.length;
|
|
2384
|
+
if (j + H.length > c) {
|
|
2385
|
+
const Q = c - j;
|
|
2386
2386
|
if (Q <= 0) {
|
|
2387
2387
|
se.push({
|
|
2388
2388
|
isValid: !1,
|
|
@@ -2395,8 +2395,8 @@ function Wr({
|
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
2397
|
if (i && b) {
|
|
2398
|
-
const
|
|
2399
|
-
if (
|
|
2398
|
+
const j = E.reduce((ce, _e) => ce + _e.file.size, 0), Q = H.reduce((ce, _e) => ce + _e.size, 0), ee = b * 1024 * 1024;
|
|
2399
|
+
if (j + Q > ee) {
|
|
2400
2400
|
se.push({
|
|
2401
2401
|
isValid: !1,
|
|
2402
2402
|
error: `Ukuran total file maksimal ${b} MB`,
|
|
@@ -2405,59 +2405,59 @@ function Wr({
|
|
|
2405
2405
|
return;
|
|
2406
2406
|
}
|
|
2407
2407
|
}
|
|
2408
|
-
for (const
|
|
2408
|
+
for (const j of H) {
|
|
2409
2409
|
if (l && l.length > 0) {
|
|
2410
|
-
const ee =
|
|
2410
|
+
const ee = j.name.toLowerCase(), ce = ee.substring(ee.lastIndexOf(".") + 1);
|
|
2411
2411
|
if (!l.includes(ce.toLowerCase())) {
|
|
2412
2412
|
se.push({
|
|
2413
2413
|
isValid: !1,
|
|
2414
2414
|
error: `Ekstensi file harus: ${l.join(", ")}`,
|
|
2415
|
-
file:
|
|
2416
|
-
}),
|
|
2415
|
+
file: j
|
|
2416
|
+
}), K.push({
|
|
2417
2417
|
isValid: !1,
|
|
2418
2418
|
error: `Ekstensi file harus: ${l.join(", ")}`,
|
|
2419
|
-
file:
|
|
2419
|
+
file: j
|
|
2420
2420
|
});
|
|
2421
2421
|
continue;
|
|
2422
2422
|
}
|
|
2423
2423
|
}
|
|
2424
|
-
const Q = Ct(
|
|
2424
|
+
const Q = Ct(j, {
|
|
2425
2425
|
allowedTypes: r || void 0,
|
|
2426
2426
|
maxSize: s || void 0,
|
|
2427
2427
|
validateExtension: !0
|
|
2428
2428
|
});
|
|
2429
2429
|
if (!Q.isValid) {
|
|
2430
|
-
se.push(Q),
|
|
2430
|
+
se.push(Q), K.push(Q);
|
|
2431
2431
|
continue;
|
|
2432
2432
|
}
|
|
2433
|
-
if (h &&
|
|
2433
|
+
if (h && j.type) {
|
|
2434
2434
|
const ee = await Mt(
|
|
2435
|
-
|
|
2436
|
-
|
|
2435
|
+
j,
|
|
2436
|
+
j.type
|
|
2437
2437
|
);
|
|
2438
2438
|
if (!ee.isValid) {
|
|
2439
2439
|
se.push({
|
|
2440
2440
|
isValid: !1,
|
|
2441
2441
|
error: ee.error || "File signature tidak valid",
|
|
2442
|
-
file:
|
|
2443
|
-
}),
|
|
2442
|
+
file: j
|
|
2443
|
+
}), K.push({
|
|
2444
2444
|
isValid: !1,
|
|
2445
2445
|
error: ee.error || "File signature tidak valid",
|
|
2446
|
-
file:
|
|
2446
|
+
file: j
|
|
2447
2447
|
});
|
|
2448
2448
|
continue;
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
2451
2451
|
P.push({
|
|
2452
|
-
file:
|
|
2452
|
+
file: j,
|
|
2453
2453
|
status: "idle"
|
|
2454
|
-
}),
|
|
2454
|
+
}), K.push({
|
|
2455
2455
|
isValid: !0,
|
|
2456
|
-
file:
|
|
2456
|
+
file: j
|
|
2457
2457
|
});
|
|
2458
2458
|
}
|
|
2459
|
-
F(i ? (
|
|
2460
|
-
const q = i ? [...E, ...P].map((
|
|
2459
|
+
F(i ? (j) => [...j, ...P] : P.slice(0, 1)), f(se);
|
|
2460
|
+
const q = i ? [...E, ...P].map((j) => j.file) : P.map((j) => j.file);
|
|
2461
2461
|
m == null || m(q, se);
|
|
2462
2462
|
},
|
|
2463
2463
|
[
|
|
@@ -2473,40 +2473,40 @@ function Wr({
|
|
|
2473
2473
|
]
|
|
2474
2474
|
), V = me(
|
|
2475
2475
|
async (H) => {
|
|
2476
|
-
const
|
|
2477
|
-
await B(
|
|
2476
|
+
const K = Array.from(H.target.files || []);
|
|
2477
|
+
await B(K), A.current && (A.current.value = "");
|
|
2478
2478
|
},
|
|
2479
2479
|
[B]
|
|
2480
|
-
),
|
|
2480
|
+
), G = me(
|
|
2481
2481
|
(H) => {
|
|
2482
2482
|
H.preventDefault(), H.stopPropagation(), u || k(!0);
|
|
2483
2483
|
},
|
|
2484
2484
|
[u]
|
|
2485
|
-
),
|
|
2485
|
+
), O = me((H) => {
|
|
2486
2486
|
H.preventDefault(), H.stopPropagation(), k(!1);
|
|
2487
|
-
}, []),
|
|
2487
|
+
}, []), W = me(
|
|
2488
2488
|
async (H) => {
|
|
2489
2489
|
var P;
|
|
2490
2490
|
if (H.preventDefault(), H.stopPropagation(), k(!1), u) return;
|
|
2491
|
-
const
|
|
2492
|
-
await B(
|
|
2491
|
+
const K = Array.from(((P = H.dataTransfer) == null ? void 0 : P.files) || []);
|
|
2492
|
+
await B(K);
|
|
2493
2493
|
},
|
|
2494
2494
|
[u, B]
|
|
2495
2495
|
), ae = me(
|
|
2496
2496
|
(H) => {
|
|
2497
2497
|
if (u) return;
|
|
2498
|
-
const
|
|
2499
|
-
F(P), p == null || p(
|
|
2498
|
+
const K = E[H], P = E.filter((se, q) => q !== H);
|
|
2499
|
+
F(P), p == null || p(K.file, H), m == null || m(
|
|
2500
2500
|
P.map((se) => se.file),
|
|
2501
2501
|
_
|
|
2502
2502
|
);
|
|
2503
2503
|
},
|
|
2504
2504
|
[u, E, _, p, m]
|
|
2505
2505
|
), ue = me(
|
|
2506
|
-
(H,
|
|
2506
|
+
(H, K, P, se) => {
|
|
2507
2507
|
F(
|
|
2508
2508
|
(q) => q.map(
|
|
2509
|
-
(
|
|
2509
|
+
(j, Q) => Q === H ? { ...j, status: K, error: P, progress: se } : j
|
|
2510
2510
|
)
|
|
2511
2511
|
);
|
|
2512
2512
|
},
|
|
@@ -2523,10 +2523,10 @@ function Wr({
|
|
|
2523
2523
|
"div",
|
|
2524
2524
|
{
|
|
2525
2525
|
className: X,
|
|
2526
|
-
onClick:
|
|
2527
|
-
onDragOver:
|
|
2528
|
-
onDragLeave:
|
|
2529
|
-
onDrop:
|
|
2526
|
+
onClick: Y,
|
|
2527
|
+
onDragOver: G,
|
|
2528
|
+
onDragLeave: O,
|
|
2529
|
+
onDrop: W,
|
|
2530
2530
|
children: [
|
|
2531
2531
|
/* @__PURE__ */ n(
|
|
2532
2532
|
"input",
|
|
@@ -2554,7 +2554,7 @@ function Wr({
|
|
|
2554
2554
|
className: "ina-file-upload__button",
|
|
2555
2555
|
disabled: u,
|
|
2556
2556
|
onClick: (H) => {
|
|
2557
|
-
H.stopPropagation(),
|
|
2557
|
+
H.stopPropagation(), Y();
|
|
2558
2558
|
},
|
|
2559
2559
|
children: "Pilih File"
|
|
2560
2560
|
}
|
|
@@ -2564,8 +2564,8 @@ function Wr({
|
|
|
2564
2564
|
}
|
|
2565
2565
|
),
|
|
2566
2566
|
E.length > 0 && /* @__PURE__ */ w(Ye, { children: [
|
|
2567
|
-
/* @__PURE__ */ n("div", { className: "ina-file-upload__files", children: (i && E.length > 5 && !
|
|
2568
|
-
const
|
|
2567
|
+
/* @__PURE__ */ n("div", { className: "ina-file-upload__files", children: (i && E.length > 5 && !T ? E.slice(0, 5) : E).map((H) => {
|
|
2568
|
+
const K = E.findIndex(
|
|
2569
2569
|
(P) => P.file.name === H.file.name && P.file.size === H.file.size && P.status === H.status
|
|
2570
2570
|
);
|
|
2571
2571
|
return /* @__PURE__ */ w(
|
|
@@ -2602,7 +2602,7 @@ function Wr({
|
|
|
2602
2602
|
type: "button",
|
|
2603
2603
|
className: "ina-file-upload__file-retry",
|
|
2604
2604
|
onClick: () => {
|
|
2605
|
-
ue(
|
|
2605
|
+
ue(K, "idle");
|
|
2606
2606
|
},
|
|
2607
2607
|
title: "Coba lagi",
|
|
2608
2608
|
children: /* @__PURE__ */ n(xt, { size: 20 })
|
|
@@ -2613,7 +2613,7 @@ function Wr({
|
|
|
2613
2613
|
{
|
|
2614
2614
|
type: "button",
|
|
2615
2615
|
className: "ina-file-upload__file-remove",
|
|
2616
|
-
onClick: () => ae(
|
|
2616
|
+
onClick: () => ae(K),
|
|
2617
2617
|
title: "Hapus file",
|
|
2618
2618
|
children: /* @__PURE__ */ n(ot, { size: 20 })
|
|
2619
2619
|
}
|
|
@@ -2624,9 +2624,9 @@ function Wr({
|
|
|
2624
2624
|
{
|
|
2625
2625
|
type: "button",
|
|
2626
2626
|
className: "ina-file-upload__file-remove",
|
|
2627
|
-
onClick: () => ae(
|
|
2627
|
+
onClick: () => ae(K),
|
|
2628
2628
|
title: "Batalkan upload",
|
|
2629
|
-
children: /* @__PURE__ */ n(
|
|
2629
|
+
children: /* @__PURE__ */ n(Te, { size: 20 })
|
|
2630
2630
|
}
|
|
2631
2631
|
),
|
|
2632
2632
|
H.status === "success" && /* @__PURE__ */ n(
|
|
@@ -2634,7 +2634,7 @@ function Wr({
|
|
|
2634
2634
|
{
|
|
2635
2635
|
type: "button",
|
|
2636
2636
|
className: "ina-file-upload__file-remove",
|
|
2637
|
-
onClick: () => ae(
|
|
2637
|
+
onClick: () => ae(K),
|
|
2638
2638
|
title: "Hapus file",
|
|
2639
2639
|
children: /* @__PURE__ */ n(ot, { size: 20 })
|
|
2640
2640
|
}
|
|
@@ -2644,7 +2644,7 @@ function Wr({
|
|
|
2644
2644
|
{
|
|
2645
2645
|
type: "button",
|
|
2646
2646
|
className: "ina-file-upload__file-remove",
|
|
2647
|
-
onClick: () => ae(
|
|
2647
|
+
onClick: () => ae(K),
|
|
2648
2648
|
title: "Hapus file",
|
|
2649
2649
|
children: /* @__PURE__ */ n(ot, { size: 20 })
|
|
2650
2650
|
}
|
|
@@ -2652,7 +2652,7 @@ function Wr({
|
|
|
2652
2652
|
] })
|
|
2653
2653
|
]
|
|
2654
2654
|
},
|
|
2655
|
-
`${H.file.name}-${
|
|
2655
|
+
`${H.file.name}-${K}`
|
|
2656
2656
|
);
|
|
2657
2657
|
}) }),
|
|
2658
2658
|
i && E.length > 5 && /* @__PURE__ */ w(
|
|
@@ -2660,9 +2660,9 @@ function Wr({
|
|
|
2660
2660
|
{
|
|
2661
2661
|
type: "button",
|
|
2662
2662
|
className: "ina-file-upload__show-more",
|
|
2663
|
-
onClick: () => $(!
|
|
2663
|
+
onClick: () => $(!T),
|
|
2664
2664
|
children: [
|
|
2665
|
-
|
|
2665
|
+
T ? "Sembunyikan" : "Lihat Selengkapnya",
|
|
2666
2666
|
/* @__PURE__ */ n(
|
|
2667
2667
|
"svg",
|
|
2668
2668
|
{
|
|
@@ -2672,7 +2672,7 @@ function Wr({
|
|
|
2672
2672
|
fill: "none",
|
|
2673
2673
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2674
2674
|
className: S("ina-file-upload__show-more-icon", {
|
|
2675
|
-
"ina-file-upload__show-more-icon--expanded":
|
|
2675
|
+
"ina-file-upload__show-more-icon--expanded": T
|
|
2676
2676
|
}),
|
|
2677
2677
|
children: /* @__PURE__ */ n(
|
|
2678
2678
|
"path",
|
|
@@ -2690,11 +2690,11 @@ function Wr({
|
|
|
2690
2690
|
}
|
|
2691
2691
|
)
|
|
2692
2692
|
] }),
|
|
2693
|
-
_.length > 0 && /* @__PURE__ */ n("div", { className: "ina-file-upload__errors", children: _.map((H,
|
|
2693
|
+
_.length > 0 && /* @__PURE__ */ n("div", { className: "ina-file-upload__errors", children: _.map((H, K) => /* @__PURE__ */ w("div", { className: "ina-file-upload__error-message", children: [
|
|
2694
2694
|
dt(H.file.name),
|
|
2695
2695
|
": ",
|
|
2696
2696
|
H.error
|
|
2697
|
-
] },
|
|
2697
|
+
] }, K)) })
|
|
2698
2698
|
] });
|
|
2699
2699
|
}
|
|
2700
2700
|
const un = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
@@ -2776,13 +2776,13 @@ function jr({
|
|
|
2776
2776
|
onRemove: M,
|
|
2777
2777
|
...m
|
|
2778
2778
|
}) {
|
|
2779
|
-
const p = le(null), [I, A] = Z(null), [E, F] = Z(0), [N, k] = Z("idle"), [_, f] = Z(!1),
|
|
2780
|
-
var
|
|
2781
|
-
l || I || (
|
|
2779
|
+
const p = le(null), [I, A] = Z(null), [E, F] = Z(0), [N, k] = Z("idle"), [_, f] = Z(!1), T = b !== void 0 ? b : E, $ = h !== void 0 ? h : N, Y = me(() => {
|
|
2780
|
+
var K;
|
|
2781
|
+
l || I || (K = p.current) == null || K.click();
|
|
2782
2782
|
}, [l, I]), B = me(
|
|
2783
|
-
async (
|
|
2784
|
-
var
|
|
2785
|
-
const P = (
|
|
2783
|
+
async (K) => {
|
|
2784
|
+
var j;
|
|
2785
|
+
const P = (j = K.target.files) == null ? void 0 : j[0];
|
|
2786
2786
|
if (!P) return;
|
|
2787
2787
|
if (dt(P.name) !== P.name) {
|
|
2788
2788
|
const Q = {
|
|
@@ -2834,39 +2834,39 @@ function jr({
|
|
|
2834
2834
|
[t, r, i, s, u]
|
|
2835
2835
|
), V = me(() => {
|
|
2836
2836
|
A(null), F(0), k("idle"), f(!1), p.current && (p.current.value = ""), M == null || M(), u == null || u(null, null);
|
|
2837
|
-
}, [M, u]),
|
|
2838
|
-
l || I ||
|
|
2839
|
-
}, [l, I,
|
|
2837
|
+
}, [M, u]), G = me(() => {
|
|
2838
|
+
l || I || Y();
|
|
2839
|
+
}, [l, I, Y]), O = me(() => {
|
|
2840
2840
|
l || I || f(!0);
|
|
2841
|
-
}, [l, I]),
|
|
2841
|
+
}, [l, I]), W = me(() => {
|
|
2842
2842
|
f(!1);
|
|
2843
2843
|
}, []), ae = me(
|
|
2844
|
-
(
|
|
2845
|
-
l || I || (
|
|
2844
|
+
(K) => {
|
|
2845
|
+
l || I || (K.preventDefault(), K.stopPropagation(), f(!0));
|
|
2846
2846
|
},
|
|
2847
2847
|
[l, I]
|
|
2848
2848
|
), ue = me(
|
|
2849
|
-
(
|
|
2850
|
-
l || I || (
|
|
2849
|
+
(K) => {
|
|
2850
|
+
l || I || (K.preventDefault(), K.stopPropagation(), f(!1));
|
|
2851
2851
|
},
|
|
2852
2852
|
[l, I]
|
|
2853
2853
|
), te = me(
|
|
2854
|
-
async (
|
|
2854
|
+
async (K) => {
|
|
2855
2855
|
if (l || I) return;
|
|
2856
|
-
|
|
2857
|
-
const P =
|
|
2856
|
+
K.preventDefault(), K.stopPropagation(), f(!1);
|
|
2857
|
+
const P = K.dataTransfer.files[0];
|
|
2858
2858
|
if (!P) return;
|
|
2859
2859
|
if (dt(P.name) !== P.name) {
|
|
2860
|
-
const
|
|
2860
|
+
const j = {
|
|
2861
2861
|
isValid: !1,
|
|
2862
2862
|
error: "Nama file mengandung karakter yang tidak diizinkan",
|
|
2863
2863
|
file: P
|
|
2864
2864
|
};
|
|
2865
|
-
A(null), k("error"), u == null || u(null,
|
|
2865
|
+
A(null), k("error"), u == null || u(null, j);
|
|
2866
2866
|
return;
|
|
2867
2867
|
}
|
|
2868
2868
|
if (i && i.length > 0) {
|
|
2869
|
-
const
|
|
2869
|
+
const j = P.name.toLowerCase(), Q = j.substring(j.lastIndexOf(".") + 1);
|
|
2870
2870
|
if (!i.includes(Q.toLowerCase())) {
|
|
2871
2871
|
const ee = {
|
|
2872
2872
|
isValid: !1,
|
|
@@ -2887,14 +2887,14 @@ function jr({
|
|
|
2887
2887
|
return;
|
|
2888
2888
|
}
|
|
2889
2889
|
if (s && P.type) {
|
|
2890
|
-
const
|
|
2890
|
+
const j = await Mt(
|
|
2891
2891
|
P,
|
|
2892
2892
|
P.type
|
|
2893
2893
|
);
|
|
2894
|
-
if (!
|
|
2894
|
+
if (!j.isValid) {
|
|
2895
2895
|
const Q = {
|
|
2896
2896
|
isValid: !1,
|
|
2897
|
-
error:
|
|
2897
|
+
error: j.error || "File signature tidak valid",
|
|
2898
2898
|
file: P
|
|
2899
2899
|
};
|
|
2900
2900
|
A(null), k("error"), u == null || u(null, Q);
|
|
@@ -2914,8 +2914,8 @@ function jr({
|
|
|
2914
2914
|
]
|
|
2915
2915
|
), X = () => {
|
|
2916
2916
|
if (!I) return null;
|
|
2917
|
-
const
|
|
2918
|
-
return
|
|
2917
|
+
const K = I.type, P = I.name.toLowerCase();
|
|
2918
|
+
return K === "application/pdf" || P.endsWith(".pdf") ? /* @__PURE__ */ n(fn, { size: 16 }) : K.startsWith("image/") ? /* @__PURE__ */ n(pn, { size: 16 }) : /* @__PURE__ */ n(un, { size: 16 });
|
|
2919
2919
|
}, H = S("ina-single-file-upload__container", {
|
|
2920
2920
|
"ina-single-file-upload__container--active": _ && !l && !I,
|
|
2921
2921
|
"ina-single-file-upload__container--disabled": l
|
|
@@ -2937,9 +2937,9 @@ function jr({
|
|
|
2937
2937
|
"div",
|
|
2938
2938
|
{
|
|
2939
2939
|
className: H,
|
|
2940
|
-
onClick:
|
|
2941
|
-
onFocus:
|
|
2942
|
-
onBlur:
|
|
2940
|
+
onClick: G,
|
|
2941
|
+
onFocus: O,
|
|
2942
|
+
onBlur: W,
|
|
2943
2943
|
onDragOver: ae,
|
|
2944
2944
|
onDragLeave: ue,
|
|
2945
2945
|
onDrop: te,
|
|
@@ -2961,12 +2961,12 @@ function jr({
|
|
|
2961
2961
|
"div",
|
|
2962
2962
|
{
|
|
2963
2963
|
className: "ina-single-file-upload__progress-fill",
|
|
2964
|
-
style: { width: `${
|
|
2964
|
+
style: { width: `${T}%` }
|
|
2965
2965
|
}
|
|
2966
2966
|
) }),
|
|
2967
2967
|
/* @__PURE__ */ w("div", { className: "ina-single-file-upload__progress-text", children: [
|
|
2968
2968
|
"Uploading... ",
|
|
2969
|
-
|
|
2969
|
+
T,
|
|
2970
2970
|
"%"
|
|
2971
2971
|
] })
|
|
2972
2972
|
] })
|
|
@@ -2982,8 +2982,8 @@ function jr({
|
|
|
2982
2982
|
{
|
|
2983
2983
|
type: "button",
|
|
2984
2984
|
className: "ina-single-file-upload__delete-button",
|
|
2985
|
-
onClick: (
|
|
2986
|
-
|
|
2985
|
+
onClick: (K) => {
|
|
2986
|
+
K.stopPropagation(), V();
|
|
2987
2987
|
},
|
|
2988
2988
|
"aria-label": "Remove file",
|
|
2989
2989
|
children: /* @__PURE__ */ n(ot, { size: 18 })
|
|
@@ -3056,7 +3056,7 @@ function Yr({
|
|
|
3056
3056
|
className: "ina-field-input-table__action-button ina-field-input-table__action-button--cancel",
|
|
3057
3057
|
title: "Cancel",
|
|
3058
3058
|
children: /* @__PURE__ */ n(
|
|
3059
|
-
|
|
3059
|
+
Te,
|
|
3060
3060
|
{
|
|
3061
3061
|
size: 20,
|
|
3062
3062
|
className: "ina-field-input-table__icon ina-field-input-table__icon--cancel"
|
|
@@ -3093,38 +3093,38 @@ function hn(e, a, t, r) {
|
|
|
3093
3093
|
var E = typeof window < "u", F = !a && a !== 0 && E;
|
|
3094
3094
|
if (typeof e != "function") throw new TypeError("Expected a function");
|
|
3095
3095
|
a = +a || 0;
|
|
3096
|
-
var N = !!(t = t || {}).leading, k = !("trailing" in t) || !!t.trailing, _ = !!t.flushOnExit && k, f = "maxWait" in t,
|
|
3096
|
+
var N = !!(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() {
|
|
3097
3097
|
var B = function(te) {
|
|
3098
3098
|
var X = h.current, H = u.current;
|
|
3099
3099
|
return h.current = u.current = null, l.current = te, c.current = c.current || te, M.current = m.current.apply(H, X);
|
|
3100
3100
|
}, V = function(te, X) {
|
|
3101
3101
|
F && cancelAnimationFrame(b.current), b.current = F ? requestAnimationFrame(te) : setTimeout(te, X);
|
|
3102
|
-
},
|
|
3102
|
+
}, G = function(te) {
|
|
3103
3103
|
if (!p.current) return !1;
|
|
3104
3104
|
var X = te - s.current;
|
|
3105
3105
|
return !s.current || X >= a || X < 0 || f && te - l.current >= $;
|
|
3106
|
-
},
|
|
3106
|
+
}, O = function(te) {
|
|
3107
3107
|
return b.current = null, k && h.current ? B(te) : (h.current = u.current = null, M.current);
|
|
3108
|
-
},
|
|
3108
|
+
}, W = function te() {
|
|
3109
3109
|
var X = Date.now();
|
|
3110
|
-
if (N && c.current === l.current && ae(),
|
|
3110
|
+
if (N && c.current === l.current && ae(), G(X)) return O(X);
|
|
3111
3111
|
if (p.current) {
|
|
3112
|
-
var H = a - (X - s.current),
|
|
3113
|
-
V(te,
|
|
3112
|
+
var H = a - (X - s.current), K = f ? Math.min(H, $ - (X - l.current)) : H;
|
|
3113
|
+
V(te, K);
|
|
3114
3114
|
}
|
|
3115
3115
|
}, ae = function() {
|
|
3116
3116
|
r && r({});
|
|
3117
3117
|
}, ue = function() {
|
|
3118
|
-
if (E ||
|
|
3119
|
-
var te, X = Date.now(), H =
|
|
3118
|
+
if (E || T) {
|
|
3119
|
+
var te, X = Date.now(), H = G(X);
|
|
3120
3120
|
if (h.current = [].slice.call(arguments), u.current = i, s.current = X, _ && !I.current && (I.current = function() {
|
|
3121
|
-
var
|
|
3122
|
-
((
|
|
3121
|
+
var K;
|
|
3122
|
+
((K = global.document) == null ? void 0 : K.visibilityState) === "hidden" && A.current.flush();
|
|
3123
3123
|
}, (te = global.document) == null || te.addEventListener == null || te.addEventListener("visibilitychange", I.current)), H) {
|
|
3124
|
-
if (!b.current && p.current) return l.current = s.current, V(
|
|
3125
|
-
if (f) return V(
|
|
3124
|
+
if (!b.current && p.current) return l.current = s.current, V(W, a), N ? B(s.current) : M.current;
|
|
3125
|
+
if (f) return V(W, a), B(s.current);
|
|
3126
3126
|
}
|
|
3127
|
-
return b.current || V(
|
|
3127
|
+
return b.current || V(W, a), M.current;
|
|
3128
3128
|
}
|
|
3129
3129
|
};
|
|
3130
3130
|
return ue.cancel = function() {
|
|
@@ -3133,15 +3133,15 @@ function hn(e, a, t, r) {
|
|
|
3133
3133
|
}, ue.isPending = function() {
|
|
3134
3134
|
return !!b.current;
|
|
3135
3135
|
}, ue.flush = function() {
|
|
3136
|
-
return b.current ?
|
|
3136
|
+
return b.current ? O(Date.now()) : M.current;
|
|
3137
3137
|
}, ue;
|
|
3138
|
-
}, [N, f, a, $, k, _, F, E,
|
|
3139
|
-
return A.current =
|
|
3138
|
+
}, [N, f, a, $, k, _, F, E, T, r]);
|
|
3139
|
+
return A.current = Y, oe(function() {
|
|
3140
3140
|
return p.current = !0, function() {
|
|
3141
3141
|
var B;
|
|
3142
3142
|
_ && A.current.flush(), I.current && ((B = global.document) == null || B.removeEventListener == null || B.removeEventListener("visibilitychange", I.current), I.current = null), p.current = !1;
|
|
3143
3143
|
};
|
|
3144
|
-
}, [_]),
|
|
3144
|
+
}, [_]), Y;
|
|
3145
3145
|
}
|
|
3146
3146
|
function vn(e, a) {
|
|
3147
3147
|
return e === a;
|
|
@@ -3265,7 +3265,7 @@ function es({
|
|
|
3265
3265
|
onClick: () => {
|
|
3266
3266
|
M(""), I.current && I.current.focus();
|
|
3267
3267
|
},
|
|
3268
|
-
children: /* @__PURE__ */ n(
|
|
3268
|
+
children: /* @__PURE__ */ n(Te, { size: 20 })
|
|
3269
3269
|
}
|
|
3270
3270
|
)
|
|
3271
3271
|
] })
|
|
@@ -3283,7 +3283,7 @@ function yn({
|
|
|
3283
3283
|
paddingBody: b = "16px 24px",
|
|
3284
3284
|
closeLabel: h = "Tutup dialog"
|
|
3285
3285
|
}) {
|
|
3286
|
-
const [u, M] = Z(!1), [m, p] = Z(!1), [I, A] = Z(!1), E = le(null), F = le(`modal-title-${Math.random().toString(36).slice(2)}`), N = le(null);
|
|
3286
|
+
const [u, M] = Z(!1), [m, p] = Z(!1), [I, A] = Z(!1), E = le(null), F = le(`modal-title-${Math.random().toString(36).slice(2)}`), N = le(null), k = le(!1);
|
|
3287
3287
|
if (oe(() => M(!0), []), oe(() => {
|
|
3288
3288
|
if (e)
|
|
3289
3289
|
p(!0), N.current = document.activeElement, requestAnimationFrame(() => {
|
|
@@ -3293,56 +3293,61 @@ function yn({
|
|
|
3293
3293
|
});
|
|
3294
3294
|
else {
|
|
3295
3295
|
A(!1), N.current && (N.current.focus(), N.current = null);
|
|
3296
|
-
const
|
|
3296
|
+
const B = setTimeout(() => {
|
|
3297
3297
|
p(!1);
|
|
3298
3298
|
}, 300);
|
|
3299
|
-
return () => clearTimeout(
|
|
3299
|
+
return () => clearTimeout(B);
|
|
3300
3300
|
}
|
|
3301
3301
|
}, [e]), oe(() => {
|
|
3302
3302
|
if (u && m) {
|
|
3303
|
-
const
|
|
3303
|
+
const B = document.documentElement.style.overflow;
|
|
3304
3304
|
return document.documentElement.style.overflow = "hidden", () => {
|
|
3305
|
-
document.documentElement.style.overflow =
|
|
3305
|
+
document.documentElement.style.overflow = B;
|
|
3306
3306
|
};
|
|
3307
3307
|
}
|
|
3308
3308
|
}, [m, u]), oe(() => {
|
|
3309
3309
|
if (!m || !u) return;
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
(B = E.current) == null || B.focus();
|
|
3313
|
-
}, 50);
|
|
3314
|
-
const K = (B) => {
|
|
3315
|
-
if (B.key === "Escape" && I) {
|
|
3310
|
+
const B = (V) => {
|
|
3311
|
+
if (V.key === "Escape" && I) {
|
|
3316
3312
|
a();
|
|
3317
3313
|
return;
|
|
3318
3314
|
}
|
|
3319
|
-
if (
|
|
3320
|
-
const
|
|
3321
|
-
if (!
|
|
3322
|
-
const O =
|
|
3315
|
+
if (V.key === "Tab" && I) {
|
|
3316
|
+
const G = document.querySelector(".ina-modal__dialog");
|
|
3317
|
+
if (!G) return;
|
|
3318
|
+
const O = G.querySelectorAll(
|
|
3323
3319
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
3324
3320
|
);
|
|
3325
3321
|
if (O.length === 0) return;
|
|
3326
|
-
const
|
|
3327
|
-
|
|
3322
|
+
const W = O[0], ae = O[O.length - 1];
|
|
3323
|
+
V.shiftKey ? document.activeElement === W && (V.preventDefault(), ae.focus()) : document.activeElement === ae && (V.preventDefault(), W.focus());
|
|
3328
3324
|
}
|
|
3329
3325
|
};
|
|
3330
|
-
return document.addEventListener("keydown",
|
|
3331
|
-
}, [m, I, u, a]),
|
|
3332
|
-
|
|
3326
|
+
return document.addEventListener("keydown", B), () => document.removeEventListener("keydown", B);
|
|
3327
|
+
}, [m, I, u, a]), oe(() => {
|
|
3328
|
+
if (I && !k.current) {
|
|
3329
|
+
const B = setTimeout(() => {
|
|
3330
|
+
var V;
|
|
3331
|
+
(V = E.current) == null || V.focus(), k.current = !0;
|
|
3332
|
+
}, 50);
|
|
3333
|
+
return () => clearTimeout(B);
|
|
3334
|
+
}
|
|
3335
|
+
e || (k.current = !1);
|
|
3336
|
+
}, [I, e]), !m || !u) return null;
|
|
3337
|
+
const _ = s ?? document.body, f = S(
|
|
3333
3338
|
"ina-modal",
|
|
3334
3339
|
I ? "ina-modal--enter-active" : "ina-modal--enter"
|
|
3335
|
-
),
|
|
3340
|
+
), T = S(
|
|
3336
3341
|
"ina-modal__dialog",
|
|
3337
3342
|
c && `ina-modal__dialog--size-${c}`,
|
|
3338
3343
|
l
|
|
3339
|
-
),
|
|
3344
|
+
), $ = S(
|
|
3340
3345
|
"ina-modal__header",
|
|
3341
3346
|
t ? "ina-modal__header--with-title" : "ina-modal__header--no-border"
|
|
3342
|
-
),
|
|
3347
|
+
), Y = /* @__PURE__ */ w(
|
|
3343
3348
|
"div",
|
|
3344
3349
|
{
|
|
3345
|
-
className:
|
|
3350
|
+
className: f,
|
|
3346
3351
|
role: "dialog",
|
|
3347
3352
|
"aria-modal": "true",
|
|
3348
3353
|
"aria-labelledby": t && typeof t == "string" ? F.current : void 0,
|
|
@@ -3359,11 +3364,11 @@ function yn({
|
|
|
3359
3364
|
/* @__PURE__ */ n("div", { className: "ina-modal__container", children: /* @__PURE__ */ w(
|
|
3360
3365
|
"div",
|
|
3361
3366
|
{
|
|
3362
|
-
className:
|
|
3363
|
-
onClick: (
|
|
3367
|
+
className: T,
|
|
3368
|
+
onClick: (B) => B.stopPropagation(),
|
|
3364
3369
|
tabIndex: -1,
|
|
3365
3370
|
children: [
|
|
3366
|
-
/* @__PURE__ */ w("div", { className:
|
|
3371
|
+
/* @__PURE__ */ w("div", { className: $, children: [
|
|
3367
3372
|
t && /* @__PURE__ */ n("div", { className: "ina-modal__title", children: typeof t == "string" ? /* @__PURE__ */ n("h2", { id: F.current, children: t }) : t }),
|
|
3368
3373
|
/* @__PURE__ */ n(
|
|
3369
3374
|
"button",
|
|
@@ -3372,7 +3377,7 @@ function yn({
|
|
|
3372
3377
|
onClick: a,
|
|
3373
3378
|
"aria-label": h,
|
|
3374
3379
|
className: "ina-modal__close-button",
|
|
3375
|
-
children: /* @__PURE__ */ n(
|
|
3380
|
+
children: /* @__PURE__ */ n(Te, { size: 24, className: "ina-modal__close-icon" })
|
|
3376
3381
|
}
|
|
3377
3382
|
)
|
|
3378
3383
|
] }),
|
|
@@ -3383,7 +3388,7 @@ function yn({
|
|
|
3383
3388
|
]
|
|
3384
3389
|
}
|
|
3385
3390
|
);
|
|
3386
|
-
return
|
|
3391
|
+
return Lt(Y, _);
|
|
3387
3392
|
}
|
|
3388
3393
|
const ut = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
3389
3394
|
"svg",
|
|
@@ -3465,14 +3470,14 @@ function wn({
|
|
|
3465
3470
|
if (a <= 0) return null;
|
|
3466
3471
|
function p() {
|
|
3467
3472
|
const f = [];
|
|
3468
|
-
let
|
|
3469
|
-
e === 1 ? (
|
|
3470
|
-
for (let
|
|
3471
|
-
f.push(I(
|
|
3473
|
+
let T, $;
|
|
3474
|
+
e === 1 ? (T = 1, $ = Math.min(3, a)) : e === a ? (T = Math.max(1, a - 2), $ = a) : (T = e - 1, $ = e + 1);
|
|
3475
|
+
for (let Y = T; Y <= $; Y++)
|
|
3476
|
+
f.push(I(Y));
|
|
3472
3477
|
return f;
|
|
3473
3478
|
}
|
|
3474
3479
|
const I = (f) => {
|
|
3475
|
-
const
|
|
3480
|
+
const T = f === e;
|
|
3476
3481
|
return /* @__PURE__ */ n(
|
|
3477
3482
|
"button",
|
|
3478
3483
|
{
|
|
@@ -3482,8 +3487,8 @@ function wn({
|
|
|
3482
3487
|
disabled: l,
|
|
3483
3488
|
className: S(
|
|
3484
3489
|
"ina-pagination__page-button",
|
|
3485
|
-
|
|
3486
|
-
!l && !
|
|
3490
|
+
T && "ina-pagination__page-button--active",
|
|
3491
|
+
!l && !T && "ina-pagination__page-button--enabled",
|
|
3487
3492
|
l && "ina-pagination__page-button--disabled"
|
|
3488
3493
|
),
|
|
3489
3494
|
children: f
|
|
@@ -3499,8 +3504,8 @@ function wn({
|
|
|
3499
3504
|
}, N = (f) => {
|
|
3500
3505
|
f.preventDefault(), !l && e < a && i(a);
|
|
3501
3506
|
}, k = (f) => {
|
|
3502
|
-
const
|
|
3503
|
-
l || s(
|
|
3507
|
+
const T = parseInt(f.target.value, 10);
|
|
3508
|
+
l || s(T);
|
|
3504
3509
|
}, _ = S(
|
|
3505
3510
|
"ina-pagination",
|
|
3506
3511
|
c && "ina-pagination--full-width"
|
|
@@ -3540,19 +3545,19 @@ function wn({
|
|
|
3540
3545
|
{
|
|
3541
3546
|
className: "ina-pagination__nav-buttons",
|
|
3542
3547
|
onKeyDown: (f) => {
|
|
3543
|
-
var
|
|
3548
|
+
var T;
|
|
3544
3549
|
if (f.key === "ArrowRight" || f.key === "ArrowLeft") {
|
|
3545
3550
|
const $ = Array.from(
|
|
3546
3551
|
f.currentTarget.querySelectorAll("button:not([disabled])")
|
|
3547
3552
|
);
|
|
3548
3553
|
if (!$.length) return;
|
|
3549
|
-
const
|
|
3554
|
+
const Y = $.indexOf(
|
|
3550
3555
|
document.activeElement
|
|
3551
3556
|
);
|
|
3552
|
-
if (
|
|
3557
|
+
if (Y >= 0) {
|
|
3553
3558
|
f.preventDefault();
|
|
3554
|
-
const B = f.key === "ArrowRight" ? (
|
|
3555
|
-
(
|
|
3559
|
+
const B = f.key === "ArrowRight" ? (Y + 1) % $.length : (Y - 1 + $.length) % $.length;
|
|
3560
|
+
(T = $[B]) == null || T.focus();
|
|
3556
3561
|
}
|
|
3557
3562
|
} else if (f.key === "Enter" || f.key === " ") {
|
|
3558
3563
|
const $ = document.activeElement;
|
|
@@ -3629,7 +3634,7 @@ function wn({
|
|
|
3629
3634
|
"ina-pagination__page-size-select",
|
|
3630
3635
|
l && "ina-pagination__page-size-select--disabled"
|
|
3631
3636
|
),
|
|
3632
|
-
children: r.map((f,
|
|
3637
|
+
children: r.map((f, T) => /* @__PURE__ */ n("option", { value: f, children: f }, `${f}-${T}`))
|
|
3633
3638
|
}
|
|
3634
3639
|
)
|
|
3635
3640
|
] })
|
|
@@ -3798,26 +3803,26 @@ function as({
|
|
|
3798
3803
|
onBlur: A,
|
|
3799
3804
|
...E
|
|
3800
3805
|
}) {
|
|
3801
|
-
const [F, N] = Z(e), [k, _] = Z(!1), [f] = ht(F, t),
|
|
3806
|
+
const [F, N] = Z(e), [k, _] = Z(!1), [f] = ht(F, t), T = le(!0);
|
|
3802
3807
|
oe(() => {
|
|
3803
3808
|
N(e);
|
|
3804
3809
|
}, [e]), oe(() => {
|
|
3805
|
-
|
|
3810
|
+
T.current ? T.current = !1 : t > 0 && r && r(f);
|
|
3806
3811
|
}, [f, t, r]);
|
|
3807
|
-
const $ = (
|
|
3808
|
-
const ae =
|
|
3812
|
+
const $ = (W) => {
|
|
3813
|
+
const ae = W.target.value;
|
|
3809
3814
|
u != null && ae.length > u || (N(ae), a(ae));
|
|
3810
|
-
},
|
|
3811
|
-
A == null || A(
|
|
3815
|
+
}, Y = (W) => {
|
|
3816
|
+
A == null || A(W);
|
|
3812
3817
|
}, B = () => {
|
|
3813
3818
|
N(""), a(""), r && r("");
|
|
3814
|
-
}, V = c !== "neutral" && b != null ? b : l,
|
|
3819
|
+
}, V = c !== "neutral" && b != null ? b : l, G = (E == null ? void 0 : E.id) || (E == null ? void 0 : E.name) || String(s).toLowerCase(), O = `${G}-status`;
|
|
3815
3820
|
return /* @__PURE__ */ w("div", { className: S("ina-password-input", I), children: [
|
|
3816
3821
|
s && /* @__PURE__ */ w(
|
|
3817
3822
|
"label",
|
|
3818
3823
|
{
|
|
3819
3824
|
className: "ina-password-input__label",
|
|
3820
|
-
htmlFor: String(
|
|
3825
|
+
htmlFor: String(G),
|
|
3821
3826
|
children: [
|
|
3822
3827
|
s,
|
|
3823
3828
|
E.required && /* @__PURE__ */ n("span", { className: "ina-text-field__required", children: "*" })
|
|
@@ -3839,16 +3844,16 @@ function as({
|
|
|
3839
3844
|
"input",
|
|
3840
3845
|
{
|
|
3841
3846
|
...E,
|
|
3842
|
-
id: String(
|
|
3847
|
+
id: String(G),
|
|
3843
3848
|
type: k ? "text" : "password",
|
|
3844
3849
|
className: "ina-password-input__input",
|
|
3845
3850
|
value: F,
|
|
3846
3851
|
onChange: $,
|
|
3847
|
-
onBlur:
|
|
3852
|
+
onBlur: Y,
|
|
3848
3853
|
placeholder: m,
|
|
3849
3854
|
disabled: p,
|
|
3850
3855
|
maxLength: u,
|
|
3851
|
-
"aria-describedby": V ?
|
|
3856
|
+
"aria-describedby": V ? O : void 0
|
|
3852
3857
|
}
|
|
3853
3858
|
),
|
|
3854
3859
|
F !== "" && /* @__PURE__ */ n(
|
|
@@ -3857,11 +3862,11 @@ function as({
|
|
|
3857
3862
|
type: "button",
|
|
3858
3863
|
className: "ina-password-input__clear-button",
|
|
3859
3864
|
onClick: B,
|
|
3860
|
-
onKeyDown: (
|
|
3861
|
-
(
|
|
3865
|
+
onKeyDown: (W) => {
|
|
3866
|
+
(W.key === "Enter" || W.key === " ") && (W.preventDefault(), B());
|
|
3862
3867
|
},
|
|
3863
3868
|
"aria-label": "Hapus input",
|
|
3864
|
-
children: /* @__PURE__ */ n(
|
|
3869
|
+
children: /* @__PURE__ */ n(Te, { size: 16 })
|
|
3865
3870
|
}
|
|
3866
3871
|
),
|
|
3867
3872
|
/* @__PURE__ */ n(
|
|
@@ -3869,9 +3874,9 @@ function as({
|
|
|
3869
3874
|
{
|
|
3870
3875
|
type: "button",
|
|
3871
3876
|
className: "ina-password-input__toggle-button",
|
|
3872
|
-
onClick: () => _((
|
|
3873
|
-
onKeyDown: (
|
|
3874
|
-
(
|
|
3877
|
+
onClick: () => _((W) => !W),
|
|
3878
|
+
onKeyDown: (W) => {
|
|
3879
|
+
(W.key === "Enter" || W.key === " ") && (W.preventDefault(), _((ae) => !ae));
|
|
3875
3880
|
},
|
|
3876
3881
|
"aria-label": k ? "Sembunyikan password" : "Tampilkan password",
|
|
3877
3882
|
children: k ? /* @__PURE__ */ n(Mn, { size: 20 }) : /* @__PURE__ */ n(Cn, { size: 20 })
|
|
@@ -3880,7 +3885,7 @@ function as({
|
|
|
3880
3885
|
]
|
|
3881
3886
|
}
|
|
3882
3887
|
),
|
|
3883
|
-
V && /* @__PURE__ */ w("div", { id:
|
|
3888
|
+
V && /* @__PURE__ */ w("div", { id: O, className: "ina-password-input__status-area", children: [
|
|
3884
3889
|
/* @__PURE__ */ n(
|
|
3885
3890
|
"div",
|
|
3886
3891
|
{
|
|
@@ -4475,9 +4480,9 @@ function rs({
|
|
|
4475
4480
|
id: E,
|
|
4476
4481
|
...F
|
|
4477
4482
|
}) {
|
|
4478
|
-
const N = Fe(() => E || `phone-input-${Math.random().toString(36).substr(2, 9)}`, [E]), [k, _] = Z(a), [f,
|
|
4483
|
+
const N = Fe(() => E || `phone-input-${Math.random().toString(36).substr(2, 9)}`, [E]), [k, _] = Z(a), [f, T] = Z(!1), [$, Y] = Z(""), [B, V] = Z(
|
|
4479
4484
|
p.find((ee) => ee.code === m) || p[0]
|
|
4480
|
-
),
|
|
4485
|
+
), G = le(null), O = le(null), W = le(null), ae = Fe(() => `${N}-helper`, [N]), ue = (ee) => {
|
|
4481
4486
|
const ce = ee.replace(/\D/g, "");
|
|
4482
4487
|
return ce.length > 7 ? ce.replace(/^(\d{3})(\d{4})(.*)/, "$1-$2-$3") : ce.length > 3 ? ce.replace(/^(\d{3})(.*)/, "$1-$2") : ce;
|
|
4483
4488
|
};
|
|
@@ -4491,7 +4496,7 @@ function rs({
|
|
|
4491
4496
|
a.startsWith(ee) && (ce = a.substring(ee.length)), _(ue(ce));
|
|
4492
4497
|
}, [a, B.dialCode]), oe(() => {
|
|
4493
4498
|
const ee = (ce) => {
|
|
4494
|
-
|
|
4499
|
+
W.current && !W.current.contains(ce.target) && T(!1);
|
|
4495
4500
|
};
|
|
4496
4501
|
return document.addEventListener("mousedown", ee), () => {
|
|
4497
4502
|
document.removeEventListener("mousedown", ee);
|
|
@@ -4504,23 +4509,23 @@ function rs({
|
|
|
4504
4509
|
(ce) => ce.name.toLowerCase().includes(ee) || ce.dialCode.includes(ee) || ce.code.toLowerCase().includes(ee)
|
|
4505
4510
|
);
|
|
4506
4511
|
}, [p, $]), X = () => {
|
|
4507
|
-
h || u ||
|
|
4512
|
+
h || u || T((ee) => {
|
|
4508
4513
|
const ce = !ee;
|
|
4509
|
-
return ce && (
|
|
4514
|
+
return ce && (Y(""), setTimeout(() => {
|
|
4510
4515
|
var _e;
|
|
4511
|
-
(_e =
|
|
4516
|
+
(_e = O.current) == null || _e.focus();
|
|
4512
4517
|
}, 0)), ce;
|
|
4513
4518
|
});
|
|
4514
4519
|
}, H = (ee) => {
|
|
4515
|
-
if (V(ee),
|
|
4520
|
+
if (V(ee), T(!1), k) {
|
|
4516
4521
|
const ce = k.replace(/\D/g, ""), _e = ce.startsWith("0") ? ce.substring(1) : ce;
|
|
4517
4522
|
t == null || t(`${ee.dialCode}${_e}`);
|
|
4518
4523
|
}
|
|
4519
4524
|
setTimeout(() => {
|
|
4520
4525
|
var ce;
|
|
4521
|
-
(ce =
|
|
4526
|
+
(ce = G.current) == null || ce.focus();
|
|
4522
4527
|
}, 0);
|
|
4523
|
-
},
|
|
4528
|
+
}, K = (ee) => {
|
|
4524
4529
|
const _e = ee.target.value.replace(/\D/g, ""), ie = ue(_e);
|
|
4525
4530
|
_(ie);
|
|
4526
4531
|
let J = _e;
|
|
@@ -4531,13 +4536,13 @@ function rs({
|
|
|
4531
4536
|
A
|
|
4532
4537
|
), se = () => {
|
|
4533
4538
|
var ee;
|
|
4534
|
-
_(""), t == null || t(`${B.dialCode}`), (ee =
|
|
4539
|
+
_(""), t == null || t(`${B.dialCode}`), (ee = G.current) == null || ee.focus();
|
|
4535
4540
|
}, q = S(
|
|
4536
4541
|
"ina-phone-input__wrapper",
|
|
4537
4542
|
`ina-phone-input__wrapper--size-${s}`,
|
|
4538
4543
|
h && "ina-phone-input__wrapper--disabled",
|
|
4539
4544
|
l !== "neutral" && `ina-phone-input__wrapper--status-${l}`
|
|
4540
|
-
),
|
|
4545
|
+
), j = S(
|
|
4541
4546
|
"ina-phone-input__helper-text",
|
|
4542
4547
|
l === "error" && "ina-phone-input__helper-text--error",
|
|
4543
4548
|
l === "warning" && "ina-phone-input__helper-text--warning"
|
|
@@ -4548,7 +4553,7 @@ function rs({
|
|
|
4548
4553
|
M && /* @__PURE__ */ n("span", { className: "ina-text-field__required", children: "*" })
|
|
4549
4554
|
] }),
|
|
4550
4555
|
/* @__PURE__ */ w("div", { className: q, children: [
|
|
4551
|
-
/* @__PURE__ */ w("div", { className: "ina-phone-input__country-selector", ref:
|
|
4556
|
+
/* @__PURE__ */ w("div", { className: "ina-phone-input__country-selector", ref: W, children: [
|
|
4552
4557
|
/* @__PURE__ */ w(
|
|
4553
4558
|
"button",
|
|
4554
4559
|
{
|
|
@@ -4602,9 +4607,9 @@ function rs({
|
|
|
4602
4607
|
/* @__PURE__ */ n("div", { className: "ina-phone-input__country-search", children: /* @__PURE__ */ n(
|
|
4603
4608
|
"input",
|
|
4604
4609
|
{
|
|
4605
|
-
ref:
|
|
4610
|
+
ref: O,
|
|
4606
4611
|
value: $,
|
|
4607
|
-
onChange: (ee) =>
|
|
4612
|
+
onChange: (ee) => Y(ee.target.value),
|
|
4608
4613
|
type: "text",
|
|
4609
4614
|
placeholder: "Cari",
|
|
4610
4615
|
className: "ina-phone-input__country-search-input"
|
|
@@ -4651,14 +4656,14 @@ function rs({
|
|
|
4651
4656
|
{
|
|
4652
4657
|
...F,
|
|
4653
4658
|
id: N,
|
|
4654
|
-
ref:
|
|
4659
|
+
ref: G,
|
|
4655
4660
|
value: k,
|
|
4656
4661
|
type: "tel",
|
|
4657
4662
|
placeholder: i,
|
|
4658
4663
|
disabled: h,
|
|
4659
4664
|
readOnly: u,
|
|
4660
4665
|
className: "ina-phone-input__input",
|
|
4661
|
-
onChange:
|
|
4666
|
+
onChange: K,
|
|
4662
4667
|
"aria-describedby": Q ? ae : void 0
|
|
4663
4668
|
}
|
|
4664
4669
|
),
|
|
@@ -4672,11 +4677,11 @@ function rs({
|
|
|
4672
4677
|
onKeyDown: (ee) => {
|
|
4673
4678
|
(ee.key === "Enter" || ee.key === " ") && (ee.preventDefault(), se());
|
|
4674
4679
|
},
|
|
4675
|
-
children: /* @__PURE__ */ n(
|
|
4680
|
+
children: /* @__PURE__ */ n(Te, { size: 16 })
|
|
4676
4681
|
}
|
|
4677
4682
|
)
|
|
4678
4683
|
] }),
|
|
4679
|
-
Q && /* @__PURE__ */ n("div", { id: ae, className:
|
|
4684
|
+
Q && /* @__PURE__ */ n("div", { id: ae, className: j, children: Q })
|
|
4680
4685
|
] });
|
|
4681
4686
|
}
|
|
4682
4687
|
function ss({
|
|
@@ -4778,30 +4783,30 @@ const is = ({
|
|
|
4778
4783
|
onLoadMore: k,
|
|
4779
4784
|
onSearch: _,
|
|
4780
4785
|
searchDebounceMs: f = 300,
|
|
4781
|
-
renderSelectedPreview:
|
|
4786
|
+
renderSelectedPreview: T,
|
|
4782
4787
|
onRemoveSelected: $,
|
|
4783
|
-
searchValue:
|
|
4788
|
+
searchValue: Y,
|
|
4784
4789
|
onSearchChange: B,
|
|
4785
4790
|
disabled: V = !1,
|
|
4786
|
-
showPreviewValue:
|
|
4787
|
-
searchable:
|
|
4788
|
-
onSelectedRawChange:
|
|
4791
|
+
showPreviewValue: G = !0,
|
|
4792
|
+
searchable: O = !0,
|
|
4793
|
+
onSelectedRawChange: W,
|
|
4789
4794
|
label: ae,
|
|
4790
4795
|
required: ue,
|
|
4791
4796
|
selectionTitle: te,
|
|
4792
4797
|
mandatorySelected: X = !1
|
|
4793
4798
|
}) => {
|
|
4794
4799
|
var x;
|
|
4795
|
-
const [H,
|
|
4800
|
+
const [H, K] = Z(!1), [P, se] = Z(""), [q, j] = Z(-1), Q = le(null), ee = le(null), ce = le([]), _e = le(null), ie = le(/* @__PURE__ */ new Map()), J = Y !== void 0, he = J ? Y : P;
|
|
4796
4801
|
oe(() => (_e.current && clearTimeout(_e.current), _ && he !== "" ? _e.current = setTimeout(() => {
|
|
4797
4802
|
_(he);
|
|
4798
4803
|
}, f) : _ && he === "" && _(""), () => {
|
|
4799
4804
|
_e.current && clearTimeout(_e.current);
|
|
4800
4805
|
}), [he, _, f]), oe(() => {
|
|
4801
|
-
J &&
|
|
4802
|
-
}, [
|
|
4806
|
+
J && Y !== P && se(Y);
|
|
4807
|
+
}, [Y, J, P]), oe(() => {
|
|
4803
4808
|
const v = (g) => {
|
|
4804
|
-
Q.current && !Q.current.contains(g.target) && (
|
|
4809
|
+
Q.current && !Q.current.contains(g.target) && (K(!1), j(-1), M == null || M());
|
|
4805
4810
|
};
|
|
4806
4811
|
return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
4807
4812
|
}, [M, J, B]), oe(() => () => {
|
|
@@ -4817,7 +4822,7 @@ const is = ({
|
|
|
4817
4822
|
return g !== null ? { label: g, value: v } : e.find((re) => re.value === v) || null;
|
|
4818
4823
|
};
|
|
4819
4824
|
oe(() => {
|
|
4820
|
-
if (
|
|
4825
|
+
if (W) {
|
|
4821
4826
|
let v = null;
|
|
4822
4827
|
if (h) {
|
|
4823
4828
|
if (fe.length > 0) {
|
|
@@ -4826,7 +4831,7 @@ const is = ({
|
|
|
4826
4831
|
}
|
|
4827
4832
|
} else
|
|
4828
4833
|
pe != null && pe !== "" && (v = be(pe));
|
|
4829
|
-
|
|
4834
|
+
W(v);
|
|
4830
4835
|
}
|
|
4831
4836
|
}, [a, h, e]), oe(() => {
|
|
4832
4837
|
const v = ie.current;
|
|
@@ -4863,11 +4868,11 @@ const is = ({
|
|
|
4863
4868
|
}
|
|
4864
4869
|
else
|
|
4865
4870
|
we = Ce(pe) || r;
|
|
4866
|
-
const ke = _ ? e :
|
|
4871
|
+
const ke = _ ? e : O ? e.filter(
|
|
4867
4872
|
(v) => v.label.toLowerCase().includes(he.toLowerCase())
|
|
4868
4873
|
) : e;
|
|
4869
4874
|
oe(() => {
|
|
4870
|
-
|
|
4875
|
+
j(-1);
|
|
4871
4876
|
}, [ke]), oe(() => {
|
|
4872
4877
|
var v;
|
|
4873
4878
|
H && q >= 0 && ce.current[q] && ((v = ce.current[q]) == null || v.scrollIntoView({
|
|
@@ -4891,8 +4896,8 @@ const is = ({
|
|
|
4891
4896
|
t(null);
|
|
4892
4897
|
}
|
|
4893
4898
|
}, Ie = () => {
|
|
4894
|
-
if (
|
|
4895
|
-
return X ? null :
|
|
4899
|
+
if (T || X)
|
|
4900
|
+
return X ? null : T == null ? void 0 : T(a);
|
|
4896
4901
|
if (h && fe.length > 0)
|
|
4897
4902
|
return /* @__PURE__ */ w("div", { className: "ina-select-dropdown__preview-content", children: [
|
|
4898
4903
|
fe.slice(0, 3).map((v, g) => {
|
|
@@ -4913,7 +4918,7 @@ const is = ({
|
|
|
4913
4918
|
className: "ina-select-dropdown__preview-remove ina-select-dropdown__preview-remove--multiple",
|
|
4914
4919
|
"aria-label": `Remove ${re}`,
|
|
4915
4920
|
disabled: V,
|
|
4916
|
-
children: /* @__PURE__ */ n(
|
|
4921
|
+
children: /* @__PURE__ */ n(Te, { size: 12 })
|
|
4917
4922
|
}
|
|
4918
4923
|
)
|
|
4919
4924
|
]
|
|
@@ -4941,7 +4946,7 @@ const is = ({
|
|
|
4941
4946
|
className: "ina-select-dropdown__preview-remove ina-select-dropdown__preview-remove--single",
|
|
4942
4947
|
"aria-label": `Remove ${g}`,
|
|
4943
4948
|
disabled: V,
|
|
4944
|
-
children: /* @__PURE__ */ n(
|
|
4949
|
+
children: /* @__PURE__ */ n(Te, { size: 12 })
|
|
4945
4950
|
}
|
|
4946
4951
|
)
|
|
4947
4952
|
] }) });
|
|
@@ -4961,13 +4966,13 @@ const is = ({
|
|
|
4961
4966
|
), C = S(
|
|
4962
4967
|
"ina-select-dropdown__trigger-icon",
|
|
4963
4968
|
V && "ina-select-dropdown__trigger-icon--disabled"
|
|
4964
|
-
), R = () => h || H ? he : pe != null && pe !== "" && Ce(pe) || "",
|
|
4969
|
+
), R = () => h || H ? he : pe != null && pe !== "" && Ce(pe) || "", L = () => {
|
|
4965
4970
|
var g;
|
|
4966
|
-
!H && !V &&
|
|
4971
|
+
!H && !V && K(!0);
|
|
4967
4972
|
const v = (g = Q.current) == null ? void 0 : g.querySelector("input");
|
|
4968
4973
|
v && v.focus();
|
|
4969
4974
|
}, z = (v) => {
|
|
4970
|
-
H ||
|
|
4975
|
+
H || K(!0), Ne(v);
|
|
4971
4976
|
}, d = (v) => {
|
|
4972
4977
|
var g, U;
|
|
4973
4978
|
if (!(V || v.disabled))
|
|
@@ -4988,18 +4993,18 @@ const is = ({
|
|
|
4988
4993
|
} else {
|
|
4989
4994
|
if (v.value === pe) {
|
|
4990
4995
|
if (X) {
|
|
4991
|
-
|
|
4996
|
+
K(!1), j(-1);
|
|
4992
4997
|
return;
|
|
4993
4998
|
}
|
|
4994
4999
|
ie.current.delete(v.value), t(null, v);
|
|
4995
5000
|
} else
|
|
4996
5001
|
ie.current.set(v.value, v.label), t(v.value, v);
|
|
4997
|
-
|
|
5002
|
+
K(!1), j(-1), J ? B == null || B("") : se(""), M == null || M();
|
|
4998
5003
|
}
|
|
4999
5004
|
}, D = (v) => {
|
|
5000
|
-
v.key === "ArrowDown" ? (v.preventDefault(), H ?
|
|
5005
|
+
v.key === "ArrowDown" ? (v.preventDefault(), H ? j(
|
|
5001
5006
|
(g) => g < ke.length - 1 ? g + 1 : g
|
|
5002
|
-
) : (
|
|
5007
|
+
) : (K(!0), j(0))) : v.key === "ArrowUp" ? (v.preventDefault(), j((g) => g > 0 ? g - 1 : g)) : v.key === "Enter" ? (v.preventDefault(), H && q >= 0 && q < ke.length && d(ke[q])) : v.key === "Escape" && (v.preventDefault(), K(!1), j(-1));
|
|
5003
5008
|
};
|
|
5004
5009
|
return /* @__PURE__ */ w(
|
|
5005
5010
|
"div",
|
|
@@ -5015,14 +5020,14 @@ const is = ({
|
|
|
5015
5020
|
/* @__PURE__ */ w(
|
|
5016
5021
|
"div",
|
|
5017
5022
|
{
|
|
5018
|
-
onClick:
|
|
5023
|
+
onClick: L,
|
|
5019
5024
|
className: y,
|
|
5020
5025
|
role: "combobox",
|
|
5021
5026
|
"aria-expanded": H,
|
|
5022
5027
|
"aria-haspopup": "listbox",
|
|
5023
5028
|
children: [
|
|
5024
5029
|
m && /* @__PURE__ */ n("div", { className: "ina-select-dropdown__trigger-prefix", children: m }),
|
|
5025
|
-
|
|
5030
|
+
O && !V ? /* @__PURE__ */ n(
|
|
5026
5031
|
"input",
|
|
5027
5032
|
{
|
|
5028
5033
|
type: "text",
|
|
@@ -5076,7 +5081,7 @@ const is = ({
|
|
|
5076
5081
|
maxHeight: wt(A)
|
|
5077
5082
|
},
|
|
5078
5083
|
children: [
|
|
5079
|
-
|
|
5084
|
+
G && Ie() !== null && /* @__PURE__ */ n("div", { className: "ina-select-dropdown__preview", children: Ie() }),
|
|
5080
5085
|
/* @__PURE__ */ w(
|
|
5081
5086
|
"div",
|
|
5082
5087
|
{
|
|
@@ -5226,7 +5231,7 @@ function ls({
|
|
|
5226
5231
|
height: t === "top" || t === "bottom" ? "60vh" : "100vh",
|
|
5227
5232
|
maxHeight: t === "top" || t === "bottom" ? "60vh" : "100vh"
|
|
5228
5233
|
};
|
|
5229
|
-
return
|
|
5234
|
+
return Lt(/* @__PURE__ */ w(
|
|
5230
5235
|
"div",
|
|
5231
5236
|
{
|
|
5232
5237
|
className: M,
|
|
@@ -5249,7 +5254,7 @@ function ls({
|
|
|
5249
5254
|
onClick: a,
|
|
5250
5255
|
className: A,
|
|
5251
5256
|
"aria-label": c,
|
|
5252
|
-
children: /* @__PURE__ */ n(
|
|
5257
|
+
children: /* @__PURE__ */ n(Te, { className: E, size: 20 })
|
|
5253
5258
|
}
|
|
5254
5259
|
)
|
|
5255
5260
|
] }),
|
|
@@ -5261,7 +5266,7 @@ function ls({
|
|
|
5261
5266
|
onClick: a,
|
|
5262
5267
|
className: A,
|
|
5263
5268
|
"aria-label": c,
|
|
5264
|
-
children: /* @__PURE__ */ n(
|
|
5269
|
+
children: /* @__PURE__ */ n(Te, { className: E, size: 20 })
|
|
5265
5270
|
}
|
|
5266
5271
|
) })
|
|
5267
5272
|
]
|
|
@@ -5364,33 +5369,33 @@ function An({
|
|
|
5364
5369
|
onBlur: _,
|
|
5365
5370
|
...f
|
|
5366
5371
|
}) {
|
|
5367
|
-
const
|
|
5372
|
+
const T = () => k != null && k.enableXssProtection ? Xe(e).sanitized : e, [$, Y] = Z(T()), [B] = ht($, r), V = le(!0);
|
|
5368
5373
|
oe(() => {
|
|
5369
|
-
let
|
|
5374
|
+
let K = e;
|
|
5370
5375
|
if (k != null && k.enableXssProtection) {
|
|
5371
5376
|
const P = Xe(e);
|
|
5372
5377
|
P.isValid || (k.logViolations && console.warn(
|
|
5373
5378
|
"TextField security violation on value change:",
|
|
5374
5379
|
P.threats
|
|
5375
|
-
), k.onSecurityViolation && k.onSecurityViolation(P.threats, e),
|
|
5380
|
+
), k.onSecurityViolation && k.onSecurityViolation(P.threats, e), K = P.sanitized);
|
|
5376
5381
|
}
|
|
5377
|
-
K
|
|
5382
|
+
Y(K);
|
|
5378
5383
|
}, [e, k]), oe(() => {
|
|
5379
5384
|
V.current ? V.current = !1 : r > 0 && i && i(B);
|
|
5380
5385
|
}, [B, r, i]);
|
|
5381
|
-
const
|
|
5382
|
-
let P =
|
|
5386
|
+
const G = (K) => {
|
|
5387
|
+
let P = K.target.value;
|
|
5383
5388
|
if (!(m != null && P.length > m)) {
|
|
5384
5389
|
if (k != null && k.enableXssProtection) {
|
|
5385
5390
|
const se = Xe(P);
|
|
5386
5391
|
se.isValid || (k.logViolations && console.warn("TextField security violation:", se.threats), k.onSecurityViolation && k.onSecurityViolation(se.threats, P), P = se.sanitized);
|
|
5387
5392
|
}
|
|
5388
|
-
|
|
5393
|
+
Y(P), a(P), t == null || t(K);
|
|
5389
5394
|
}
|
|
5390
|
-
},
|
|
5391
|
-
_ == null || _(
|
|
5392
|
-
},
|
|
5393
|
-
|
|
5395
|
+
}, O = (K) => {
|
|
5396
|
+
_ == null || _(K);
|
|
5397
|
+
}, W = () => {
|
|
5398
|
+
Y(""), a(""), i && i(""), A == null || A();
|
|
5394
5399
|
}, ae = S(
|
|
5395
5400
|
"ina-text-field__wrapper",
|
|
5396
5401
|
`ina-text-field__wrapper--size-${M}`,
|
|
@@ -5422,8 +5427,8 @@ function An({
|
|
|
5422
5427
|
type: f.type ?? "text",
|
|
5423
5428
|
className: S("ina-text-field__input", N),
|
|
5424
5429
|
value: $,
|
|
5425
|
-
onChange:
|
|
5426
|
-
onBlur:
|
|
5430
|
+
onChange: G,
|
|
5431
|
+
onBlur: O,
|
|
5427
5432
|
placeholder: E,
|
|
5428
5433
|
disabled: F,
|
|
5429
5434
|
maxLength: m,
|
|
@@ -5435,12 +5440,12 @@ function An({
|
|
|
5435
5440
|
{
|
|
5436
5441
|
type: "button",
|
|
5437
5442
|
className: "ina-text-field__clear-button",
|
|
5438
|
-
onClick:
|
|
5439
|
-
onKeyDown: (
|
|
5440
|
-
(
|
|
5443
|
+
onClick: W,
|
|
5444
|
+
onKeyDown: (K) => {
|
|
5445
|
+
(K.key === "Enter" || K.key === " ") && (K.preventDefault(), W());
|
|
5441
5446
|
},
|
|
5442
5447
|
"aria-label": "Hapus input",
|
|
5443
|
-
children: /* @__PURE__ */ n(
|
|
5448
|
+
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-text-field__clear-icon" })
|
|
5444
5449
|
}
|
|
5445
5450
|
),
|
|
5446
5451
|
l && /* @__PURE__ */ n("div", { className: "ina-text-field__suffix-icon", children: l })
|
|
@@ -5520,34 +5525,34 @@ function ds({
|
|
|
5520
5525
|
lastColumnSticky: k = !1,
|
|
5521
5526
|
renderSortIndicator: _,
|
|
5522
5527
|
emptyState: f = "No data found",
|
|
5523
|
-
showPagination:
|
|
5528
|
+
showPagination: T = !0
|
|
5524
5529
|
}) {
|
|
5525
|
-
const [$,
|
|
5530
|
+
const [$, Y] = Z([]), [B, V] = Z(0), [G, O] = Z(!1), W = le(null), ae = ma(), [ue, te] = Z(t), [X, H] = Z(r), [K, P] = Z(s), [se, q] = Z(
|
|
5526
5531
|
l
|
|
5527
|
-
), [
|
|
5532
|
+
), [j, Q] = Z(""), [ee, ce] = 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(B / X);
|
|
5528
5533
|
oe(() => {
|
|
5529
5534
|
const g = new AbortController(), U = g.signal;
|
|
5530
5535
|
async function re() {
|
|
5531
|
-
|
|
5536
|
+
O(!0);
|
|
5532
5537
|
try {
|
|
5533
5538
|
const de = await a({
|
|
5534
5539
|
page: ue,
|
|
5535
5540
|
pageSize: X,
|
|
5536
|
-
sortField:
|
|
5541
|
+
sortField: K,
|
|
5537
5542
|
sortOrder: se,
|
|
5538
|
-
searchTerm:
|
|
5543
|
+
searchTerm: j
|
|
5539
5544
|
});
|
|
5540
|
-
U.aborted || (
|
|
5545
|
+
U.aborted || (Y(de.data), V(de.total), ie({}), fe({}), Ce(null));
|
|
5541
5546
|
} catch (de) {
|
|
5542
5547
|
U.aborted || console.error(de);
|
|
5543
5548
|
} finally {
|
|
5544
|
-
U.aborted ||
|
|
5549
|
+
U.aborted || O(!1);
|
|
5545
5550
|
}
|
|
5546
5551
|
}
|
|
5547
5552
|
return re(), () => {
|
|
5548
5553
|
g.abort();
|
|
5549
5554
|
};
|
|
5550
|
-
}, [ue, X,
|
|
5555
|
+
}, [ue, X, K, se, j, a]), oe(() => {
|
|
5551
5556
|
te(t);
|
|
5552
5557
|
}, [t]);
|
|
5553
5558
|
const we = () => {
|
|
@@ -5576,19 +5581,19 @@ function ds({
|
|
|
5576
5581
|
return delete re[g], re;
|
|
5577
5582
|
}), Ce(null);
|
|
5578
5583
|
}, o = (g, U) => {
|
|
5579
|
-
g.sortable && (
|
|
5584
|
+
g.sortable && (K === g.accessor && se === U ? (P(null), q(null)) : (P(g.accessor), q(U)), te(1));
|
|
5580
5585
|
}, y = (g) => ce(g), C = (g) => {
|
|
5581
5586
|
g.key === "Enter" && (g.preventDefault(), te(1), Q(ee.trim()));
|
|
5582
5587
|
}, R = () => {
|
|
5583
5588
|
te(1), Q(ee.trim());
|
|
5584
|
-
},
|
|
5589
|
+
}, L = (g, U) => {
|
|
5585
5590
|
U.target.closest(
|
|
5586
5591
|
'button, [role="button"], .ina-button, [data-action]'
|
|
5587
5592
|
) || F && N && N(g);
|
|
5588
5593
|
};
|
|
5589
5594
|
oe(() => {
|
|
5590
5595
|
const g = (U) => {
|
|
5591
|
-
|
|
5596
|
+
W.current && !W.current.contains(U.target) && Ce(null);
|
|
5592
5597
|
};
|
|
5593
5598
|
return document.addEventListener("mousedown", g), () => {
|
|
5594
5599
|
document.removeEventListener("mousedown", g);
|
|
@@ -5601,7 +5606,7 @@ function ds({
|
|
|
5601
5606
|
!E && "ina-table__search--hidden"
|
|
5602
5607
|
), D = S(
|
|
5603
5608
|
"ina-table__container",
|
|
5604
|
-
|
|
5609
|
+
G && "ina-table--loading"
|
|
5605
5610
|
), x = S("ina-table__header"), v = S("ina-table__body");
|
|
5606
5611
|
return /* @__PURE__ */ w("div", { className: z, children: [
|
|
5607
5612
|
E && /* @__PURE__ */ n("div", { className: d, children: /* @__PURE__ */ w("div", { className: "ina-table__search-controls", children: [
|
|
@@ -5612,21 +5617,21 @@ function ds({
|
|
|
5612
5617
|
onChange: y,
|
|
5613
5618
|
onKeyDown: C,
|
|
5614
5619
|
placeholder: b,
|
|
5615
|
-
disabled:
|
|
5620
|
+
disabled: G
|
|
5616
5621
|
}
|
|
5617
5622
|
),
|
|
5618
|
-
/* @__PURE__ */ n(ct, { onClick: R, disabled:
|
|
5623
|
+
/* @__PURE__ */ n(ct, { onClick: R, disabled: G, children: h })
|
|
5619
5624
|
] }) }),
|
|
5620
5625
|
/* @__PURE__ */ n(
|
|
5621
5626
|
Nn,
|
|
5622
5627
|
{
|
|
5623
|
-
visible:
|
|
5624
|
-
loading:
|
|
5628
|
+
visible: G,
|
|
5629
|
+
loading: G,
|
|
5625
5630
|
variant: "primary",
|
|
5626
5631
|
className: "ina-table__progress-bar"
|
|
5627
5632
|
}
|
|
5628
5633
|
),
|
|
5629
|
-
/* @__PURE__ */ w("table", { ref:
|
|
5634
|
+
/* @__PURE__ */ w("table", { ref: W, className: D, children: [
|
|
5630
5635
|
/* @__PURE__ */ n("thead", { className: x, children: /* @__PURE__ */ w("tr", { children: [
|
|
5631
5636
|
M && /* @__PURE__ */ n("th", { className: "ina-table__header-cell", children: /* @__PURE__ */ n(
|
|
5632
5637
|
Wt,
|
|
@@ -5639,7 +5644,7 @@ function ds({
|
|
|
5639
5644
|
}
|
|
5640
5645
|
) }),
|
|
5641
5646
|
e.map((g, U) => {
|
|
5642
|
-
const re =
|
|
5647
|
+
const re = K === g.accessor;
|
|
5643
5648
|
return /* @__PURE__ */ n(
|
|
5644
5649
|
"th",
|
|
5645
5650
|
{
|
|
@@ -5705,7 +5710,7 @@ function ds({
|
|
|
5705
5710
|
);
|
|
5706
5711
|
})
|
|
5707
5712
|
] }) }),
|
|
5708
|
-
/* @__PURE__ */ n("tbody", { className: v, children: !
|
|
5713
|
+
/* @__PURE__ */ n("tbody", { className: v, children: !G && $.length === 0 ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n(
|
|
5709
5714
|
"td",
|
|
5710
5715
|
{
|
|
5711
5716
|
colSpan: M ? e.length + 1 : e.length,
|
|
@@ -5719,10 +5724,10 @@ function ds({
|
|
|
5719
5724
|
{
|
|
5720
5725
|
className: S(
|
|
5721
5726
|
"ina-table__row",
|
|
5722
|
-
|
|
5727
|
+
G && "ina-table__row--loading",
|
|
5723
5728
|
F && "ina-table__row--clickable"
|
|
5724
5729
|
),
|
|
5725
|
-
onClick: (de) =>
|
|
5730
|
+
onClick: (de) => L(g, de),
|
|
5726
5731
|
children: [
|
|
5727
5732
|
M && /* @__PURE__ */ n("td", { className: "ina-table__cell", children: /* @__PURE__ */ n(
|
|
5728
5733
|
Wt,
|
|
@@ -5788,7 +5793,7 @@ function ds({
|
|
|
5788
5793
|
);
|
|
5789
5794
|
}) })
|
|
5790
5795
|
] }),
|
|
5791
|
-
|
|
5796
|
+
T && /* @__PURE__ */ n("div", { className: "ina-table__pagination", children: /* @__PURE__ */ n(
|
|
5792
5797
|
wn,
|
|
5793
5798
|
{
|
|
5794
5799
|
currentPage: ue,
|
|
@@ -5799,7 +5804,7 @@ function ds({
|
|
|
5799
5804
|
onPageSizeChange: (g) => {
|
|
5800
5805
|
H(g), te(1);
|
|
5801
5806
|
},
|
|
5802
|
-
disabled:
|
|
5807
|
+
disabled: G || B === 0,
|
|
5803
5808
|
fullWidth: !0
|
|
5804
5809
|
}
|
|
5805
5810
|
) })
|
|
@@ -5828,35 +5833,35 @@ function us({
|
|
|
5828
5833
|
onBlur: k,
|
|
5829
5834
|
..._
|
|
5830
5835
|
}) {
|
|
5831
|
-
const f = () => N != null && N.enableXssProtection ? Xe(e).sanitized : e, [
|
|
5836
|
+
const f = () => N != null && N.enableXssProtection ? Xe(e).sanitized : e, [T, $] = Z(f()), [Y] = ht(T, t), B = le(!0), V = le(null), [G, O] = Z(p);
|
|
5832
5837
|
oe(() => {
|
|
5833
5838
|
let q = e;
|
|
5834
5839
|
if (N != null && N.enableXssProtection) {
|
|
5835
|
-
const
|
|
5836
|
-
|
|
5840
|
+
const j = Xe(e);
|
|
5841
|
+
j.isValid || (N.logViolations && console.warn(
|
|
5837
5842
|
"TextArea security violation on value change:",
|
|
5838
|
-
|
|
5839
|
-
), N.onSecurityViolation && N.onSecurityViolation(
|
|
5843
|
+
j.threats
|
|
5844
|
+
), N.onSecurityViolation && N.onSecurityViolation(j.threats, e), q = j.sanitized);
|
|
5840
5845
|
}
|
|
5841
5846
|
$(q);
|
|
5842
5847
|
}, [e, N]), oe(() => {
|
|
5843
|
-
B.current ? B.current = !1 : t > 0 && r && r(
|
|
5844
|
-
}, [
|
|
5848
|
+
B.current ? B.current = !1 : t > 0 && r && r(Y);
|
|
5849
|
+
}, [Y, t, r]), oe(() => {
|
|
5845
5850
|
const q = V.current;
|
|
5846
5851
|
if (!q) return;
|
|
5847
5852
|
q.rows = p;
|
|
5848
|
-
const
|
|
5849
|
-
let ee = Math.floor(Q /
|
|
5850
|
-
I && (ee = Math.min(ee, I)),
|
|
5851
|
-
}, [
|
|
5852
|
-
const
|
|
5853
|
-
let
|
|
5854
|
-
if (!(u != null &&
|
|
5853
|
+
const j = parseInt(getComputedStyle(q).lineHeight || "0", 10), Q = q.scrollHeight;
|
|
5854
|
+
let ee = Math.floor(Q / j);
|
|
5855
|
+
I && (ee = Math.min(ee, I)), O(Math.max(ee, p));
|
|
5856
|
+
}, [T, p, I]);
|
|
5857
|
+
const W = (q) => {
|
|
5858
|
+
let j = q.target.value;
|
|
5859
|
+
if (!(u != null && j.length > u)) {
|
|
5855
5860
|
if (N != null && N.enableXssProtection) {
|
|
5856
|
-
const Q = Xe(
|
|
5857
|
-
Q.isValid || (N.logViolations && console.warn("TextArea security violation:", Q.threats), N.onSecurityViolation && N.onSecurityViolation(Q.threats,
|
|
5861
|
+
const Q = Xe(j);
|
|
5862
|
+
Q.isValid || (N.logViolations && console.warn("TextArea security violation:", Q.threats), N.onSecurityViolation && N.onSecurityViolation(Q.threats, j), j = Q.sanitized);
|
|
5858
5863
|
}
|
|
5859
|
-
$(
|
|
5864
|
+
$(j), a(j);
|
|
5860
5865
|
}
|
|
5861
5866
|
}, ae = (q) => {
|
|
5862
5867
|
k == null || k(q);
|
|
@@ -5869,7 +5874,7 @@ function us({
|
|
|
5869
5874
|
), H = S(
|
|
5870
5875
|
"ina-text-area__helper-text",
|
|
5871
5876
|
`ina-text-area__helper-text--${b}`
|
|
5872
|
-
),
|
|
5877
|
+
), K = b !== "neutral" && h != null ? h : c, P = (_ == null ? void 0 : _.id) || (_ == null ? void 0 : _.name) || String(l).toLowerCase(), se = `${P}-status`;
|
|
5873
5878
|
return /* @__PURE__ */ w("div", { className: te, children: [
|
|
5874
5879
|
l && /* @__PURE__ */ w(
|
|
5875
5880
|
"label",
|
|
@@ -5890,18 +5895,18 @@ function us({
|
|
|
5890
5895
|
..._,
|
|
5891
5896
|
id: String(P),
|
|
5892
5897
|
ref: V,
|
|
5893
|
-
rows:
|
|
5898
|
+
rows: G,
|
|
5894
5899
|
className: "ina-text-area__input",
|
|
5895
|
-
value:
|
|
5896
|
-
onChange:
|
|
5900
|
+
value: T,
|
|
5901
|
+
onChange: W,
|
|
5897
5902
|
onBlur: ae,
|
|
5898
5903
|
placeholder: A,
|
|
5899
5904
|
disabled: E,
|
|
5900
5905
|
maxLength: u,
|
|
5901
|
-
"aria-describedby":
|
|
5906
|
+
"aria-describedby": K ? se : void 0
|
|
5902
5907
|
}
|
|
5903
5908
|
),
|
|
5904
|
-
m &&
|
|
5909
|
+
m && T !== "" && !E && /* @__PURE__ */ n(
|
|
5905
5910
|
"button",
|
|
5906
5911
|
{
|
|
5907
5912
|
type: "button",
|
|
@@ -5911,14 +5916,14 @@ function us({
|
|
|
5911
5916
|
(q.key === "Enter" || q.key === " ") && (q.preventDefault(), ue());
|
|
5912
5917
|
},
|
|
5913
5918
|
"aria-label": "Hapus input",
|
|
5914
|
-
children: /* @__PURE__ */ n(
|
|
5919
|
+
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-text-area__clear-icon" })
|
|
5915
5920
|
}
|
|
5916
5921
|
),
|
|
5917
5922
|
s && /* @__PURE__ */ n("div", { className: "ina-text-area__suffix-icon", children: s })
|
|
5918
5923
|
] }),
|
|
5919
|
-
|
|
5924
|
+
K && /* @__PURE__ */ n("div", { id: se, className: H, children: K }),
|
|
5920
5925
|
M && u != null && /* @__PURE__ */ w("div", { className: "ina-text-area__char-count", children: [
|
|
5921
|
-
|
|
5926
|
+
T.length,
|
|
5922
5927
|
"/",
|
|
5923
5928
|
u
|
|
5924
5929
|
] })
|
|
@@ -5958,8 +5963,8 @@ function fs({
|
|
|
5958
5963
|
return;
|
|
5959
5964
|
const f = e.split("");
|
|
5960
5965
|
f[N] = _;
|
|
5961
|
-
const
|
|
5962
|
-
if (a(
|
|
5966
|
+
const T = f.join("").slice(0, t);
|
|
5967
|
+
if (a(T), _ && N < t - 1) {
|
|
5963
5968
|
const $ = N + 1;
|
|
5964
5969
|
m.current[$] && m.current[$].focus();
|
|
5965
5970
|
}
|
|
@@ -5970,19 +5975,19 @@ function fs({
|
|
|
5970
5975
|
const $ = N - 1;
|
|
5971
5976
|
if (m.current[$]) {
|
|
5972
5977
|
m.current[$].focus();
|
|
5973
|
-
const
|
|
5974
|
-
|
|
5978
|
+
const Y = e.split("");
|
|
5979
|
+
Y[$] = "", a(Y.join(""));
|
|
5975
5980
|
}
|
|
5976
5981
|
} else {
|
|
5977
5982
|
const $ = e.split("");
|
|
5978
5983
|
$[N] = "", a($.join(""));
|
|
5979
5984
|
}
|
|
5980
|
-
k.key === "ArrowLeft" && N > 0 && (k.preventDefault(), (_ = m.current[N - 1]) == null || _.focus()), k.key === "ArrowRight" && N < t - 1 && (k.preventDefault(), (f = m.current[N + 1]) == null || f.focus()), (k.ctrlKey || k.metaKey) && k.key === "v" && (k.preventDefault(), navigator.clipboard.readText().then((
|
|
5981
|
-
const $ =
|
|
5985
|
+
k.key === "ArrowLeft" && N > 0 && (k.preventDefault(), (_ = m.current[N - 1]) == null || _.focus()), k.key === "ArrowRight" && N < t - 1 && (k.preventDefault(), (f = m.current[N + 1]) == null || f.focus()), (k.ctrlKey || k.metaKey) && k.key === "v" && (k.preventDefault(), navigator.clipboard.readText().then((T) => {
|
|
5986
|
+
const $ = T.replace(/\D/g, "").slice(0, t);
|
|
5982
5987
|
if ($) {
|
|
5983
5988
|
a($);
|
|
5984
|
-
const
|
|
5985
|
-
m.current[
|
|
5989
|
+
const Y = Math.min($.length - 1, t - 1);
|
|
5990
|
+
m.current[Y] && m.current[Y].focus();
|
|
5986
5991
|
}
|
|
5987
5992
|
}));
|
|
5988
5993
|
}, A = (N) => {
|
|
@@ -6061,7 +6066,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6061
6066
|
/* @__PURE__ */ n("path", { d: "M12 7v5l3 3" })
|
|
6062
6067
|
]
|
|
6063
6068
|
}
|
|
6064
|
-
),
|
|
6069
|
+
), Tn = ha(
|
|
6065
6070
|
({
|
|
6066
6071
|
defaultValue: e = "",
|
|
6067
6072
|
disabled: a = !1,
|
|
@@ -6085,13 +6090,13 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6085
6090
|
disabledTimeBefore: k,
|
|
6086
6091
|
disabledTimeAfter: _,
|
|
6087
6092
|
showNowButton: f = !1,
|
|
6088
|
-
label:
|
|
6093
|
+
label: T,
|
|
6089
6094
|
required: $,
|
|
6090
|
-
...
|
|
6095
|
+
...Y
|
|
6091
6096
|
}, B) => {
|
|
6092
|
-
const [V,
|
|
6097
|
+
const [V, G] = Z(!1), [O, W] = Z(
|
|
6093
6098
|
e || h || ""
|
|
6094
|
-
), [ae, ue] = Z(null), [te, X] = Z(null), [H,
|
|
6099
|
+
), [ae, ue] = Z(null), [te, X] = Z(null), [H, K] = Z(!1), P = le(null), se = le(null), q = le(null);
|
|
6095
6100
|
va(B, () => ({
|
|
6096
6101
|
focus: () => {
|
|
6097
6102
|
var o;
|
|
@@ -6102,18 +6107,18 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6102
6107
|
return (o = se.current) == null ? void 0 : o.blur();
|
|
6103
6108
|
}
|
|
6104
6109
|
}));
|
|
6105
|
-
const
|
|
6110
|
+
const j = (o) => {
|
|
6106
6111
|
if (!o) return { hours: 0, minutes: 0, seconds: 0, period: "AM" };
|
|
6107
|
-
const y = o.split(":"), C = y[0], R = parseInt(y[1] || "0", 10),
|
|
6112
|
+
const y = o.split(":"), C = y[0], R = parseInt(y[1] || "0", 10), L = parseInt(y[2] || "0", 10);
|
|
6108
6113
|
if (p) {
|
|
6109
6114
|
const z = o.includes("AM") ? "AM" : "PM", d = parseInt(C.replace(/[^\d]/g, ""), 10);
|
|
6110
|
-
return { hours: d === 12 ? 0 : d, minutes: R, seconds:
|
|
6115
|
+
return { hours: d === 12 ? 0 : d, minutes: R, seconds: L, period: z };
|
|
6111
6116
|
} else
|
|
6112
|
-
return { hours: parseInt(C, 10), minutes: R, seconds:
|
|
6117
|
+
return { hours: parseInt(C, 10), minutes: R, seconds: L, period: "AM" };
|
|
6113
6118
|
}, Q = (o, y, C, R) => {
|
|
6114
|
-
let
|
|
6115
|
-
p && (R === "PM" && o > 0 && (
|
|
6116
|
-
const z =
|
|
6119
|
+
let L = o;
|
|
6120
|
+
p && (R === "PM" && o > 0 && (L = o + 12), L = L || 12);
|
|
6121
|
+
const z = L.toString().padStart(2, "0"), d = y.toString().padStart(2, "0");
|
|
6117
6122
|
if (I) {
|
|
6118
6123
|
const D = C.toString().padStart(2, "0");
|
|
6119
6124
|
return p ? `${o}:${d}:${D} ${R}` : `${z}:${d}:${D}`;
|
|
@@ -6123,24 +6128,24 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6123
6128
|
if (!o) return 0;
|
|
6124
6129
|
const y = o.split(":"), C = parseInt(y[0] || "0", 10), R = parseInt(y[1] || "0", 10);
|
|
6125
6130
|
if (p && o.includes(" ")) {
|
|
6126
|
-
const
|
|
6131
|
+
const L = o.split(" ")[1];
|
|
6127
6132
|
let z = C;
|
|
6128
|
-
return
|
|
6133
|
+
return L === "PM" && C !== 12 ? z = C + 12 : L === "AM" && C === 12 && (z = 0), z * 60 + R;
|
|
6129
6134
|
}
|
|
6130
6135
|
return C * 60 + R;
|
|
6131
|
-
}, ce = (o, y, C, R,
|
|
6136
|
+
}, ce = (o, y, C, R, L = {}) => {
|
|
6132
6137
|
const z = Q(o, y, C, R), d = ee(z);
|
|
6133
|
-
if (N && !
|
|
6138
|
+
if (N && !L.ignoreBefore) {
|
|
6134
6139
|
const D = /* @__PURE__ */ new Date(), x = D.getHours() * 60 + D.getMinutes();
|
|
6135
6140
|
if (d < x)
|
|
6136
6141
|
return !0;
|
|
6137
6142
|
}
|
|
6138
|
-
if (k && !
|
|
6143
|
+
if (k && !L.ignoreBefore) {
|
|
6139
6144
|
const D = ee(k);
|
|
6140
6145
|
if (d < D)
|
|
6141
6146
|
return !0;
|
|
6142
6147
|
}
|
|
6143
|
-
if (_ && !
|
|
6148
|
+
if (_ && !L.ignoreAfter) {
|
|
6144
6149
|
const D = ee(_);
|
|
6145
6150
|
if (d > D)
|
|
6146
6151
|
return !0;
|
|
@@ -6163,17 +6168,17 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6163
6168
|
break;
|
|
6164
6169
|
}
|
|
6165
6170
|
return y;
|
|
6166
|
-
}, ie =
|
|
6167
|
-
a || V || (
|
|
6171
|
+
}, ie = j(O || ""), J = _e("hour"), he = _e("minute"), ve = _e("second"), fe = () => {
|
|
6172
|
+
a || V || (G(!0), K(!0), M == null || M(!0), setTimeout(() => {
|
|
6168
6173
|
var o;
|
|
6169
6174
|
return (o = se.current) == null ? void 0 : o.focus();
|
|
6170
6175
|
}, 0));
|
|
6171
6176
|
}, pe = () => {
|
|
6172
|
-
|
|
6177
|
+
G(!1), K(!1), ue(null), X(null), M == null || M(!1);
|
|
6173
6178
|
}, Ce = () => {
|
|
6174
6179
|
a || (V ? pe() : fe());
|
|
6175
6180
|
}, be = (o, y) => {
|
|
6176
|
-
let C = ie.hours, R = ie.minutes,
|
|
6181
|
+
let C = ie.hours, R = ie.minutes, L = ie.seconds, z = ie.period;
|
|
6177
6182
|
switch (o) {
|
|
6178
6183
|
case "hour":
|
|
6179
6184
|
C = p && y === 12 ? 0 : y;
|
|
@@ -6182,7 +6187,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6182
6187
|
R = y;
|
|
6183
6188
|
break;
|
|
6184
6189
|
case "second":
|
|
6185
|
-
|
|
6190
|
+
L = y;
|
|
6186
6191
|
break;
|
|
6187
6192
|
case "period":
|
|
6188
6193
|
z = y;
|
|
@@ -6191,26 +6196,26 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6191
6196
|
const d = Q(
|
|
6192
6197
|
C,
|
|
6193
6198
|
R,
|
|
6194
|
-
|
|
6199
|
+
L,
|
|
6195
6200
|
p ? z : void 0
|
|
6196
6201
|
);
|
|
6197
|
-
|
|
6202
|
+
W(d), u == null || u(d);
|
|
6198
6203
|
}, we = (o) => {
|
|
6199
6204
|
let y = o.target.value;
|
|
6200
6205
|
const C = p ? /[0-9: apm]/gi : /[0-9:]/g;
|
|
6201
6206
|
y = (y.match(C) || []).join("");
|
|
6202
|
-
let R = y.replace(/[^0-9]/g, ""),
|
|
6203
|
-
if (R.length > 0 && (
|
|
6207
|
+
let R = y.replace(/[^0-9]/g, ""), L = "";
|
|
6208
|
+
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) {
|
|
6204
6209
|
const d = y.match(/(am|pm)/i);
|
|
6205
|
-
d ?
|
|
6210
|
+
d ? L += " " + d[0].toUpperCase() : y.includes(" ") && (L += " ");
|
|
6206
6211
|
}
|
|
6207
6212
|
let z = 5;
|
|
6208
|
-
I && (z = 8), p && (z += 3),
|
|
6213
|
+
I && (z = 8), p && (z += 3), L = L.slice(0, z), o.target.value = L, W(L), u == null || u(L);
|
|
6209
6214
|
}, ke = () => {
|
|
6210
|
-
|
|
6215
|
+
W(""), u == null || u("");
|
|
6211
6216
|
};
|
|
6212
6217
|
oe(() => {
|
|
6213
|
-
h !== void 0 && h !==
|
|
6218
|
+
h !== void 0 && h !== O && W(h);
|
|
6214
6219
|
}, [h]), oe(() => {
|
|
6215
6220
|
const o = (y) => {
|
|
6216
6221
|
P.current && !P.current.contains(y.target) && pe();
|
|
@@ -6234,7 +6239,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6234
6239
|
ue(null), X(null);
|
|
6235
6240
|
},
|
|
6236
6241
|
children: y.map((R) => {
|
|
6237
|
-
let
|
|
6242
|
+
let L = !1;
|
|
6238
6243
|
if (o === "hour") {
|
|
6239
6244
|
const D = p && R === 12 ? 0 : R, x = ce(
|
|
6240
6245
|
D,
|
|
@@ -6249,18 +6254,18 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6249
6254
|
p ? ie.period : void 0,
|
|
6250
6255
|
{ ignoreBefore: !0 }
|
|
6251
6256
|
);
|
|
6252
|
-
|
|
6253
|
-
} else o === "minute" ?
|
|
6257
|
+
L = x || v;
|
|
6258
|
+
} else o === "minute" ? L = ce(
|
|
6254
6259
|
ie.hours,
|
|
6255
6260
|
R,
|
|
6256
6261
|
ie.seconds,
|
|
6257
6262
|
p ? ie.period : void 0
|
|
6258
|
-
) : o === "second" ?
|
|
6263
|
+
) : o === "second" ? L = ce(
|
|
6259
6264
|
ie.hours,
|
|
6260
6265
|
ie.minutes,
|
|
6261
6266
|
R,
|
|
6262
6267
|
p ? ie.period : void 0
|
|
6263
|
-
) : o === "period" && (
|
|
6268
|
+
) : o === "period" && (L = ce(
|
|
6264
6269
|
ie.hours,
|
|
6265
6270
|
ie.minutes,
|
|
6266
6271
|
ie.seconds,
|
|
@@ -6277,11 +6282,11 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6277
6282
|
"ina-time-picker__option",
|
|
6278
6283
|
z && "ina-time-picker__option--selected",
|
|
6279
6284
|
te === R && "ina-time-picker__option--hovered",
|
|
6280
|
-
|
|
6285
|
+
L && "ina-time-picker__option--disabled"
|
|
6281
6286
|
),
|
|
6282
|
-
onClick: () => !
|
|
6287
|
+
onClick: () => !L && be(o, R),
|
|
6283
6288
|
onKeyDown: (D) => {
|
|
6284
|
-
if (!
|
|
6289
|
+
if (!L) {
|
|
6285
6290
|
if (D.key === "Enter" || D.key === " ")
|
|
6286
6291
|
D.preventDefault(), be(o, R);
|
|
6287
6292
|
else if (D.key === "ArrowDown") {
|
|
@@ -6296,7 +6301,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6296
6301
|
}
|
|
6297
6302
|
},
|
|
6298
6303
|
onMouseEnter: () => {
|
|
6299
|
-
|
|
6304
|
+
L || (ue(o), X(R));
|
|
6300
6305
|
},
|
|
6301
6306
|
children: R.toString().padStart(2, "0")
|
|
6302
6307
|
},
|
|
@@ -6320,8 +6325,8 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6320
6325
|
(F || A) && "ina-time-picker__input--with-suffix"
|
|
6321
6326
|
);
|
|
6322
6327
|
return /* @__PURE__ */ w("div", { ref: P, className: Ve, children: [
|
|
6323
|
-
|
|
6324
|
-
|
|
6328
|
+
T && /* @__PURE__ */ w("label", { className: "ina-time-picker__label", children: [
|
|
6329
|
+
T,
|
|
6325
6330
|
$ && /* @__PURE__ */ n("span", { className: "ina-time-picker__required", children: "*" })
|
|
6326
6331
|
] }),
|
|
6327
6332
|
/* @__PURE__ */ w(
|
|
@@ -6347,23 +6352,23 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6347
6352
|
ref: se,
|
|
6348
6353
|
type: "text",
|
|
6349
6354
|
className: Ie,
|
|
6350
|
-
value:
|
|
6355
|
+
value: O,
|
|
6351
6356
|
onChange: we,
|
|
6352
6357
|
onClick: (o) => {
|
|
6353
6358
|
o.stopPropagation(), fe();
|
|
6354
6359
|
},
|
|
6355
6360
|
onFocus: () => {
|
|
6356
|
-
H || fe(),
|
|
6361
|
+
H || fe(), K(!1);
|
|
6357
6362
|
},
|
|
6358
6363
|
placeholder: l,
|
|
6359
6364
|
disabled: a,
|
|
6360
6365
|
onKeyDown: (o) => {
|
|
6361
|
-
o.key === "Enter" ? (o.preventDefault(),
|
|
6366
|
+
o.key === "Enter" ? (o.preventDefault(), O ? pe() : Ce()) : o.key === "Escape" && V && pe();
|
|
6362
6367
|
},
|
|
6363
|
-
...
|
|
6368
|
+
...Y
|
|
6364
6369
|
}
|
|
6365
6370
|
),
|
|
6366
|
-
A &&
|
|
6371
|
+
A && O && !a && /* @__PURE__ */ n(
|
|
6367
6372
|
"button",
|
|
6368
6373
|
{
|
|
6369
6374
|
type: "button",
|
|
@@ -6375,7 +6380,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6375
6380
|
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), ke());
|
|
6376
6381
|
},
|
|
6377
6382
|
"aria-label": "Hapus waktu",
|
|
6378
|
-
children: /* @__PURE__ */ n(
|
|
6383
|
+
children: /* @__PURE__ */ n(Te, { size: 16 })
|
|
6379
6384
|
}
|
|
6380
6385
|
),
|
|
6381
6386
|
F && /* @__PURE__ */ n(
|
|
@@ -6383,7 +6388,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6383
6388
|
{
|
|
6384
6389
|
className: "ina-time-picker__suffix-icon",
|
|
6385
6390
|
style: {
|
|
6386
|
-
visibility: A &&
|
|
6391
|
+
visibility: A && O && !a ? "hidden" : "visible"
|
|
6387
6392
|
},
|
|
6388
6393
|
children: F
|
|
6389
6394
|
}
|
|
@@ -6453,7 +6458,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6453
6458
|
I ? o.getSeconds() : 0,
|
|
6454
6459
|
o.getHours() >= 12 ? "PM" : "AM"
|
|
6455
6460
|
) : y;
|
|
6456
|
-
|
|
6461
|
+
W(R), u == null || u(R), pe();
|
|
6457
6462
|
},
|
|
6458
6463
|
children: "Sekarang"
|
|
6459
6464
|
}
|
|
@@ -6472,8 +6477,8 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6472
6477
|
] });
|
|
6473
6478
|
}
|
|
6474
6479
|
);
|
|
6475
|
-
|
|
6476
|
-
const
|
|
6480
|
+
Tn.displayName = "TimePicker";
|
|
6481
|
+
const Ln = {
|
|
6477
6482
|
default: /* @__PURE__ */ n(wa, { size: 20 }),
|
|
6478
6483
|
destructive: /* @__PURE__ */ n(ka, { size: 20 }),
|
|
6479
6484
|
positive: /* @__PURE__ */ n(Dt, { size: 20 })
|
|
@@ -6504,7 +6509,7 @@ function $n({
|
|
|
6504
6509
|
position: b = "top-right",
|
|
6505
6510
|
className: h = ""
|
|
6506
6511
|
}) {
|
|
6507
|
-
const [u, M] = Z(!1), [m, p] = Z(!1), [I, A] = Z(!1), E = le(), F = le(null), N =
|
|
6512
|
+
const [u, M] = Z(!1), [m, p] = Z(!1), [I, A] = Z(!1), E = le(), F = le(null), N = Ln[s];
|
|
6508
6513
|
oe(() => {
|
|
6509
6514
|
M(!0);
|
|
6510
6515
|
}, []), oe(() => {
|
|
@@ -6529,7 +6534,7 @@ function $n({
|
|
|
6529
6534
|
`ina-toast--${I ? "visible" : "hidden"}`,
|
|
6530
6535
|
h
|
|
6531
6536
|
);
|
|
6532
|
-
return
|
|
6537
|
+
return Lt(/* @__PURE__ */ n("div", { className: "ina-toast-item", children: /* @__PURE__ */ w("div", { className: _, children: [
|
|
6533
6538
|
/* @__PURE__ */ n("div", { className: "ina-toast__icon", children: N }),
|
|
6534
6539
|
/* @__PURE__ */ w("div", { className: "ina-toast__content", children: [
|
|
6535
6540
|
/* @__PURE__ */ w("div", { className: "ina-toast__text-area", children: [
|
|
@@ -6544,7 +6549,7 @@ function $n({
|
|
|
6544
6549
|
onClick: k,
|
|
6545
6550
|
className: "ina-toast__close-button",
|
|
6546
6551
|
"aria-label": "Tutup notifikasi",
|
|
6547
|
-
children: /* @__PURE__ */ n(
|
|
6552
|
+
children: /* @__PURE__ */ n(Te, { size: 16, strokeWidth: 2, className: "ina-toast__close-icon" })
|
|
6548
6553
|
}
|
|
6549
6554
|
)
|
|
6550
6555
|
] }) }), F.current);
|
|
@@ -6734,7 +6739,7 @@ function ms({
|
|
|
6734
6739
|
)
|
|
6735
6740
|
] });
|
|
6736
6741
|
}
|
|
6737
|
-
const Aa =
|
|
6742
|
+
const Aa = Tt({
|
|
6738
6743
|
confirm: () => Promise.resolve(!1)
|
|
6739
6744
|
}), hs = () => Vt(Aa), Bn = (e, a, t, r, i) => /* @__PURE__ */ w("div", { className: "ina-modal-confirmation__footer", children: [
|
|
6740
6745
|
/* @__PURE__ */ n(
|
|
@@ -6798,7 +6803,7 @@ const Aa = Lt({
|
|
|
6798
6803
|
}
|
|
6799
6804
|
)
|
|
6800
6805
|
] });
|
|
6801
|
-
}, Ea =
|
|
6806
|
+
}, Ea = Tt({
|
|
6802
6807
|
toast: () => {
|
|
6803
6808
|
}
|
|
6804
6809
|
}), gs = () => Vt(Ea), ys = ({ children: e }) => {
|
|
@@ -6830,7 +6835,7 @@ const Aa = Lt({
|
|
|
6830
6835
|
};
|
|
6831
6836
|
var st = (e) => e.type === "checkbox", qe = (e) => e instanceof Date, Be = (e) => e == null;
|
|
6832
6837
|
const Sa = (e) => typeof e == "object";
|
|
6833
|
-
var Se = (e) => !Be(e) && !Array.isArray(e) && Sa(e) && !qe(e), Va = (e) => Se(e) && e.target ? st(e.target) ? e.target.checked : e.target.value : e, Pn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e,
|
|
6838
|
+
var Se = (e) => !Be(e) && !Array.isArray(e) && Sa(e) && !qe(e), Va = (e) => Se(e) && e.target ? st(e.target) ? e.target.checked : e.target.value : e, Pn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ta = (e, a) => e.has(Pn(a)), Hn = (e) => {
|
|
6834
6839
|
const a = e.constructor && e.constructor.prototype;
|
|
6835
6840
|
return Se(a) && a.hasOwnProperty("isPrototypeOf");
|
|
6836
6841
|
}, Ft = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
@@ -6889,7 +6894,7 @@ const ft = {
|
|
|
6889
6894
|
}, zt = ge.createContext(null);
|
|
6890
6895
|
zt.displayName = "HookFormControlContext";
|
|
6891
6896
|
const Bt = () => ge.useContext(zt);
|
|
6892
|
-
var
|
|
6897
|
+
var La = (e, a, t, r = !0) => {
|
|
6893
6898
|
const i = {
|
|
6894
6899
|
defaultValues: a._defaultValues
|
|
6895
6900
|
};
|
|
@@ -6926,7 +6931,7 @@ function On(e) {
|
|
|
6926
6931
|
}
|
|
6927
6932
|
}), [i, r, s]), ge.useEffect(() => {
|
|
6928
6933
|
b.current.isValid && t._setValid(!0);
|
|
6929
|
-
}, [t]), ge.useMemo(() =>
|
|
6934
|
+
}, [t]), ge.useMemo(() => La(l, t, b.current, !1), [l, t]);
|
|
6930
6935
|
}
|
|
6931
6936
|
var He = (e) => typeof e == "string", It = (e, a, t, r, i) => He(e) ? (r && a.watch.add(e), ne(t, e, i)) : Array.isArray(e) ? e.map((s) => (r && a.watch.add(s), ne(t, s))) : (r && (a.watchAll = !0), t), At = (e) => Be(e) || !Sa(e);
|
|
6932
6937
|
function Ue(e, a, t = /* @__PURE__ */ new WeakSet()) {
|
|
@@ -6965,8 +6970,8 @@ function Un(e) {
|
|
|
6965
6970
|
if (!s) {
|
|
6966
6971
|
const f = It(r, t._names, _ || t._formValues, !1, b.current);
|
|
6967
6972
|
if (h.current) {
|
|
6968
|
-
const
|
|
6969
|
-
Ue(
|
|
6973
|
+
const T = h.current(f);
|
|
6974
|
+
Ue(T, u.current) || (I(T), u.current = T);
|
|
6970
6975
|
} else
|
|
6971
6976
|
I(f);
|
|
6972
6977
|
}
|
|
@@ -6990,7 +6995,7 @@ function Un(e) {
|
|
|
6990
6995
|
return k !== null ? k : p;
|
|
6991
6996
|
}
|
|
6992
6997
|
function Gn(e) {
|
|
6993
|
-
const a = Bt(), { name: t, disabled: r, control: i = a, shouldUnregister: s, defaultValue: l, exact: c = !0 } = e, b =
|
|
6998
|
+
const a = Bt(), { name: t, disabled: r, control: i = a, shouldUnregister: s, defaultValue: l, exact: c = !0 } = e, b = Ta(i._names.array, t), h = ge.useMemo(() => ne(i._formValues, t, ne(i._defaultValues, t, l)), [i, t, l]), u = Un({
|
|
6994
6999
|
control: i,
|
|
6995
7000
|
name: t,
|
|
6996
7001
|
defaultValue: h,
|
|
@@ -7043,7 +7048,7 @@ function Gn(e) {
|
|
|
7043
7048
|
f && f._f && _ && (f._f.ref = {
|
|
7044
7049
|
focus: () => Re(_.focus) && _.focus(),
|
|
7045
7050
|
select: () => Re(_.select) && _.select(),
|
|
7046
|
-
setCustomValidity: (
|
|
7051
|
+
setCustomValidity: (T) => Re(_.setCustomValidity) && _.setCustomValidity(T),
|
|
7047
7052
|
reportValidity: () => Re(_.reportValidity) && _.reportValidity()
|
|
7048
7053
|
});
|
|
7049
7054
|
}, [i._fields, t]), k = ge.useMemo(() => ({
|
|
@@ -7060,16 +7065,16 @@ function Gn(e) {
|
|
|
7060
7065
|
...m.current.rules,
|
|
7061
7066
|
...Pe(m.current.disabled) ? { disabled: m.current.disabled } : {}
|
|
7062
7067
|
});
|
|
7063
|
-
const
|
|
7068
|
+
const T = ($, Y) => {
|
|
7064
7069
|
const B = ne(i._fields, $);
|
|
7065
|
-
B && B._f && (B._f.mount =
|
|
7070
|
+
B && B._f && (B._f.mount = Y);
|
|
7066
7071
|
};
|
|
7067
|
-
if (
|
|
7072
|
+
if (T(t, !0), _) {
|
|
7068
7073
|
const $ = Ae(ne(i._options.defaultValues, t, m.current.defaultValue));
|
|
7069
7074
|
Me(i._defaultValues, t, $), xe(ne(i._formValues, t)) && Me(i._formValues, t, $);
|
|
7070
7075
|
}
|
|
7071
7076
|
return !b && i.register(t), p.current = t, () => {
|
|
7072
|
-
(b ? _ && !i._state.action : _) ? i.unregister(t) :
|
|
7077
|
+
(b ? _ && !i._state.action : _) ? i.unregister(t) : T(t, !1);
|
|
7073
7078
|
};
|
|
7074
7079
|
}, [t, i, b, s]), ge.useEffect(() => {
|
|
7075
7080
|
i._setDisabledField({
|
|
@@ -7334,77 +7339,77 @@ var Je = (e) => Se(e) && !mt(e) ? e : {
|
|
|
7334
7339
|
const { ref: l, refs: c, required: b, maxLength: h, minLength: u, min: M, max: m, pattern: p, validate: I, name: A, valueAsNumber: E, mount: F } = e._f, N = ne(t, A);
|
|
7335
7340
|
if (!F || a.has(A))
|
|
7336
7341
|
return {};
|
|
7337
|
-
const k = c ? c[0] : l, _ = (
|
|
7338
|
-
i && k.reportValidity && (k.setCustomValidity(Pe(
|
|
7339
|
-
}, f = {},
|
|
7340
|
-
const X =
|
|
7342
|
+
const k = c ? c[0] : l, _ = (O) => {
|
|
7343
|
+
i && k.reportValidity && (k.setCustomValidity(Pe(O) ? "" : O || ""), k.reportValidity());
|
|
7344
|
+
}, f = {}, T = Ot(l), $ = st(l), Y = T || $, B = (E || Ht(l)) && xe(l.value) && xe(N) || pt(l) && l.value === "" || N === "" || Array.isArray(N) && !N.length, V = jn.bind(null, A, r, f), G = (O, W, ae, ue = We.maxLength, te = We.minLength) => {
|
|
7345
|
+
const X = O ? W : ae;
|
|
7341
7346
|
f[A] = {
|
|
7342
|
-
type:
|
|
7347
|
+
type: O ? ue : te,
|
|
7343
7348
|
message: X,
|
|
7344
7349
|
ref: l,
|
|
7345
|
-
...V(
|
|
7350
|
+
...V(O ? ue : te, X)
|
|
7346
7351
|
};
|
|
7347
7352
|
};
|
|
7348
|
-
if (s ? !Array.isArray(N) || !N.length : b && (!
|
|
7349
|
-
const { value:
|
|
7350
|
-
if (
|
|
7353
|
+
if (s ? !Array.isArray(N) || !N.length : b && (!Y && (B || Be(N)) || Pe(N) && !N || $ && !Ba(c).isValid || T && !Ha(c).isValid)) {
|
|
7354
|
+
const { value: O, message: W } = He(b) ? { value: !!b, message: b } : Je(b);
|
|
7355
|
+
if (O && (f[A] = {
|
|
7351
7356
|
type: We.required,
|
|
7352
|
-
message:
|
|
7357
|
+
message: W,
|
|
7353
7358
|
ref: k,
|
|
7354
|
-
...V(We.required,
|
|
7359
|
+
...V(We.required, W)
|
|
7355
7360
|
}, !r))
|
|
7356
|
-
return _(
|
|
7361
|
+
return _(W), f;
|
|
7357
7362
|
}
|
|
7358
7363
|
if (!B && (!Be(M) || !Be(m))) {
|
|
7359
|
-
let
|
|
7364
|
+
let O, W;
|
|
7360
7365
|
const ae = Je(m), ue = Je(M);
|
|
7361
7366
|
if (!Be(N) && !isNaN(N)) {
|
|
7362
7367
|
const te = l.valueAsNumber || N && +N;
|
|
7363
|
-
Be(ae.value) || (
|
|
7368
|
+
Be(ae.value) || (O = te > ae.value), Be(ue.value) || (W = te < ue.value);
|
|
7364
7369
|
} else {
|
|
7365
|
-
const te = l.valueAsDate || new Date(N), X = (P) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + P), H = l.type == "time",
|
|
7366
|
-
He(ae.value) && N && (
|
|
7370
|
+
const te = l.valueAsDate || new Date(N), X = (P) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + P), H = l.type == "time", K = l.type == "week";
|
|
7371
|
+
He(ae.value) && N && (O = H ? X(N) > X(ae.value) : K ? N > ae.value : te > new Date(ae.value)), He(ue.value) && N && (W = H ? X(N) < X(ue.value) : K ? N < ue.value : te < new Date(ue.value));
|
|
7367
7372
|
}
|
|
7368
|
-
if ((
|
|
7373
|
+
if ((O || W) && (G(!!O, ae.message, ue.message, We.max, We.min), !r))
|
|
7369
7374
|
return _(f[A].message), f;
|
|
7370
7375
|
}
|
|
7371
7376
|
if ((h || u) && !B && (He(N) || s && Array.isArray(N))) {
|
|
7372
|
-
const
|
|
7373
|
-
if ((ae || ue) && (
|
|
7377
|
+
const O = Je(h), W = Je(u), ae = !Be(O.value) && N.length > +O.value, ue = !Be(W.value) && N.length < +W.value;
|
|
7378
|
+
if ((ae || ue) && (G(ae, O.message, W.message), !r))
|
|
7374
7379
|
return _(f[A].message), f;
|
|
7375
7380
|
}
|
|
7376
7381
|
if (p && !B && He(N)) {
|
|
7377
|
-
const { value:
|
|
7378
|
-
if (mt(
|
|
7382
|
+
const { value: O, message: W } = Je(p);
|
|
7383
|
+
if (mt(O) && !N.match(O) && (f[A] = {
|
|
7379
7384
|
type: We.pattern,
|
|
7380
|
-
message:
|
|
7385
|
+
message: W,
|
|
7381
7386
|
ref: l,
|
|
7382
|
-
...V(We.pattern,
|
|
7387
|
+
...V(We.pattern, W)
|
|
7383
7388
|
}, !r))
|
|
7384
|
-
return _(
|
|
7389
|
+
return _(W), f;
|
|
7385
7390
|
}
|
|
7386
7391
|
if (I) {
|
|
7387
7392
|
if (Re(I)) {
|
|
7388
|
-
const
|
|
7389
|
-
if (
|
|
7390
|
-
...
|
|
7391
|
-
...V(We.validate,
|
|
7393
|
+
const O = await I(N, t), W = la(O, k);
|
|
7394
|
+
if (W && (f[A] = {
|
|
7395
|
+
...W,
|
|
7396
|
+
...V(We.validate, W.message)
|
|
7392
7397
|
}, !r))
|
|
7393
|
-
return _(
|
|
7398
|
+
return _(W.message), f;
|
|
7394
7399
|
} else if (Se(I)) {
|
|
7395
|
-
let
|
|
7396
|
-
for (const
|
|
7397
|
-
if (!$e(
|
|
7400
|
+
let O = {};
|
|
7401
|
+
for (const W in I) {
|
|
7402
|
+
if (!$e(O) && !r)
|
|
7398
7403
|
break;
|
|
7399
|
-
const ae = la(await I[
|
|
7400
|
-
ae && (
|
|
7404
|
+
const ae = la(await I[W](N, t), k, W);
|
|
7405
|
+
ae && (O = {
|
|
7401
7406
|
...ae,
|
|
7402
|
-
...V(
|
|
7403
|
-
}, _(ae.message), r && (f[A] =
|
|
7407
|
+
...V(W, ae.message)
|
|
7408
|
+
}, _(ae.message), r && (f[A] = O));
|
|
7404
7409
|
}
|
|
7405
|
-
if (!$e(
|
|
7410
|
+
if (!$e(O) && (f[A] = {
|
|
7406
7411
|
ref: k,
|
|
7407
|
-
...
|
|
7412
|
+
...O
|
|
7408
7413
|
}, !r))
|
|
7409
7414
|
return f;
|
|
7410
7415
|
}
|
|
@@ -7469,7 +7474,7 @@ function lr(e = {}) {
|
|
|
7469
7474
|
}, E = async (o) => {
|
|
7470
7475
|
if (!l.keepIsValid && !a.disabled && (M.isValid || m.isValid || o)) {
|
|
7471
7476
|
let y;
|
|
7472
|
-
a.resolver ? (y = $e((await
|
|
7477
|
+
a.resolver ? (y = $e((await Y()).errors), F()) : y = await V(r, !0), y !== t.isValid && p.state.next({
|
|
7473
7478
|
isValid: y
|
|
7474
7479
|
});
|
|
7475
7480
|
}
|
|
@@ -7480,23 +7485,23 @@ function lr(e = {}) {
|
|
|
7480
7485
|
validatingFields: t.validatingFields,
|
|
7481
7486
|
isValidating: !$e(t.validatingFields)
|
|
7482
7487
|
}));
|
|
7483
|
-
}, N = (o, y = [], C, R,
|
|
7488
|
+
}, N = (o, y = [], C, R, L = !0, z = !0) => {
|
|
7484
7489
|
if (R && C && !a.disabled) {
|
|
7485
7490
|
if (l.action = !0, z && Array.isArray(ne(r, o))) {
|
|
7486
7491
|
const d = C(ne(r, o), R.argA, R.argB);
|
|
7487
|
-
|
|
7492
|
+
L && Me(r, o, d);
|
|
7488
7493
|
}
|
|
7489
7494
|
if (z && Array.isArray(ne(t.errors, o))) {
|
|
7490
7495
|
const d = C(ne(t.errors, o), R.argA, R.argB);
|
|
7491
|
-
|
|
7496
|
+
L && Me(t.errors, o, d), rr(t.errors, o);
|
|
7492
7497
|
}
|
|
7493
7498
|
if ((M.touchedFields || m.touchedFields) && z && Array.isArray(ne(t.touchedFields, o))) {
|
|
7494
7499
|
const d = C(ne(t.touchedFields, o), R.argA, R.argB);
|
|
7495
|
-
|
|
7500
|
+
L && Me(t.touchedFields, o, d);
|
|
7496
7501
|
}
|
|
7497
7502
|
(M.dirtyFields || m.dirtyFields) && (t.dirtyFields = Ze(i, s)), p.state.next({
|
|
7498
7503
|
name: o,
|
|
7499
|
-
isDirty:
|
|
7504
|
+
isDirty: O(o, y),
|
|
7500
7505
|
dirtyFields: t.dirtyFields,
|
|
7501
7506
|
errors: t.errors,
|
|
7502
7507
|
isValid: t.isValid
|
|
@@ -7513,19 +7518,19 @@ function lr(e = {}) {
|
|
|
7513
7518
|
isValid: !1
|
|
7514
7519
|
});
|
|
7515
7520
|
}, f = (o, y, C, R) => {
|
|
7516
|
-
const
|
|
7517
|
-
if (
|
|
7521
|
+
const L = ne(r, o);
|
|
7522
|
+
if (L) {
|
|
7518
7523
|
const z = ne(s, o, xe(C) ? ne(i, o) : C);
|
|
7519
|
-
xe(z) || R && R.defaultChecked || y ? Me(s, o, y ? z : aa(
|
|
7524
|
+
xe(z) || R && R.defaultChecked || y ? Me(s, o, y ? z : aa(L._f)) : ue(o, z), l.mount && !l.action && E();
|
|
7520
7525
|
}
|
|
7521
|
-
},
|
|
7526
|
+
}, T = (o, y, C, R, L) => {
|
|
7522
7527
|
let z = !1, d = !1;
|
|
7523
7528
|
const D = {
|
|
7524
7529
|
name: o
|
|
7525
7530
|
};
|
|
7526
7531
|
if (!a.disabled) {
|
|
7527
7532
|
if (!C || R) {
|
|
7528
|
-
(M.isDirty || m.isDirty) && (d = t.isDirty, t.isDirty = D.isDirty =
|
|
7533
|
+
(M.isDirty || m.isDirty) && (d = t.isDirty, t.isDirty = D.isDirty = O(), z = d !== D.isDirty);
|
|
7529
7534
|
const x = Ue(ne(i, o), y);
|
|
7530
7535
|
d = !!ne(t.dirtyFields, o), x ? Ee(t.dirtyFields, o) : Me(t.dirtyFields, o, !0), D.dirtyFields = t.dirtyFields, z = z || (M.dirtyFields || m.dirtyFields) && d !== !x;
|
|
7531
7536
|
}
|
|
@@ -7533,12 +7538,12 @@ function lr(e = {}) {
|
|
|
7533
7538
|
const x = ne(t.touchedFields, o);
|
|
7534
7539
|
x || (Me(t.touchedFields, o, C), D.touchedFields = t.touchedFields, z = z || (M.touchedFields || m.touchedFields) && x !== C);
|
|
7535
7540
|
}
|
|
7536
|
-
z &&
|
|
7541
|
+
z && L && p.state.next(D);
|
|
7537
7542
|
}
|
|
7538
7543
|
return z ? D : {};
|
|
7539
7544
|
}, $ = (o, y, C, R) => {
|
|
7540
|
-
const
|
|
7541
|
-
if (a.delayError && C ? (b = A(() => k(o, C)), b(a.delayError)) : (clearTimeout(h), b = null, C ? Me(t.errors, o, C) : Ee(t.errors, o)), (C ? !Ue(
|
|
7545
|
+
const L = ne(t.errors, o), z = (M.isValid || m.isValid) && Pe(y) && t.isValid !== y;
|
|
7546
|
+
if (a.delayError && C ? (b = A(() => k(o, C)), b(a.delayError)) : (clearTimeout(h), b = null, C ? Me(t.errors, o, C) : Ee(t.errors, o)), (C ? !Ue(L, C) : L) || !$e(R) || z) {
|
|
7542
7547
|
const d = {
|
|
7543
7548
|
...R,
|
|
7544
7549
|
...z && Pe(y) ? { isValid: y } : {},
|
|
@@ -7550,8 +7555,8 @@ function lr(e = {}) {
|
|
|
7550
7555
|
...d
|
|
7551
7556
|
}, p.state.next(d);
|
|
7552
7557
|
}
|
|
7553
|
-
},
|
|
7554
|
-
const { errors: y } = await
|
|
7558
|
+
}, Y = async (o) => (F(o, !0), await a.resolver(s, a.context, Xn(o || c.mount, r, a.criteriaMode, a.shouldUseNativeValidation))), B = async (o) => {
|
|
7559
|
+
const { errors: y } = await Y(o);
|
|
7555
7560
|
if (F(o), o)
|
|
7556
7561
|
for (const C of o) {
|
|
7557
7562
|
const R = ne(y, C);
|
|
@@ -7564,13 +7569,13 @@ function lr(e = {}) {
|
|
|
7564
7569
|
valid: !0
|
|
7565
7570
|
}) => {
|
|
7566
7571
|
for (const R in o) {
|
|
7567
|
-
const
|
|
7568
|
-
if (
|
|
7569
|
-
const { _f: z, ...d } =
|
|
7572
|
+
const L = o[R];
|
|
7573
|
+
if (L) {
|
|
7574
|
+
const { _f: z, ...d } = L;
|
|
7570
7575
|
if (z) {
|
|
7571
|
-
const D = c.array.has(z.name), x =
|
|
7576
|
+
const D = c.array.has(z.name), x = L._f && Qn(L._f);
|
|
7572
7577
|
x && M.validatingFields && F([z.name], !0);
|
|
7573
|
-
const v = await oa(
|
|
7578
|
+
const v = await oa(L, c.disabled, s, I, a.shouldUseNativeValidation && !y, D);
|
|
7574
7579
|
if (x && M.validatingFields && F([z.name]), v[z.name] && (C.valid = !1, y || e.shouldUseNativeValidation))
|
|
7575
7580
|
break;
|
|
7576
7581
|
!y && (ne(v, z.name) ? D ? sr(t.errors, v, z.name) : Me(t.errors, z.name, v[z.name]) : Ee(t.errors, z.name));
|
|
@@ -7579,43 +7584,43 @@ function lr(e = {}) {
|
|
|
7579
7584
|
}
|
|
7580
7585
|
}
|
|
7581
7586
|
return C.valid;
|
|
7582
|
-
},
|
|
7587
|
+
}, G = () => {
|
|
7583
7588
|
for (const o of c.unMount) {
|
|
7584
7589
|
const y = ne(r, o);
|
|
7585
7590
|
y && (y._f.refs ? y._f.refs.every((C) => !kt(C)) : !kt(y._f.ref)) && ie(o);
|
|
7586
7591
|
}
|
|
7587
7592
|
c.unMount = /* @__PURE__ */ new Set();
|
|
7588
|
-
},
|
|
7593
|
+
}, O = (o, y) => !a.disabled && (o && y && Me(s, o, y), !Ue(se(), i)), W = (o, y, C) => It(o, c, {
|
|
7589
7594
|
...l.mount ? s : xe(y) ? i : He(o) ? { [o]: y } : y
|
|
7590
7595
|
}, C, y), ae = (o) => $t(ne(l.mount ? s : i, o, a.shouldUnregister ? ne(i, o, []) : [])), ue = (o, y, C = {}) => {
|
|
7591
7596
|
const R = ne(r, o);
|
|
7592
|
-
let
|
|
7597
|
+
let L = y;
|
|
7593
7598
|
if (R) {
|
|
7594
7599
|
const z = R._f;
|
|
7595
|
-
z && (!z.disabled && Me(s, o, Pa(y, z)),
|
|
7596
|
-
(!d.defaultChecked || !d.disabled) && (Array.isArray(
|
|
7597
|
-
}) : z.refs.forEach((d) => d.checked = d.value ===
|
|
7600
|
+
z && (!z.disabled && Me(s, o, Pa(y, z)), L = pt(z.ref) && Be(y) ? "" : y, Ra(z.ref) ? [...z.ref.options].forEach((d) => d.selected = L.includes(d.value)) : z.refs ? st(z.ref) ? z.refs.forEach((d) => {
|
|
7601
|
+
(!d.defaultChecked || !d.disabled) && (Array.isArray(L) ? d.checked = !!L.find((D) => D === d.value) : d.checked = L === d.value || !!L);
|
|
7602
|
+
}) : z.refs.forEach((d) => d.checked = d.value === L) : Ht(z.ref) ? z.ref.value = "" : (z.ref.value = L, z.ref.type || p.state.next({
|
|
7598
7603
|
name: o,
|
|
7599
7604
|
values: Ae(s)
|
|
7600
7605
|
})));
|
|
7601
7606
|
}
|
|
7602
|
-
(C.shouldDirty || C.shouldTouch) &&
|
|
7607
|
+
(C.shouldDirty || C.shouldTouch) && T(o, L, C.shouldTouch, C.shouldDirty, !0), C.shouldValidate && P(o);
|
|
7603
7608
|
}, te = (o, y, C) => {
|
|
7604
7609
|
for (const R in y) {
|
|
7605
7610
|
if (!y.hasOwnProperty(R))
|
|
7606
7611
|
return;
|
|
7607
|
-
const
|
|
7608
|
-
(c.array.has(o) || Se(
|
|
7612
|
+
const L = y[R], z = o + "." + R, d = ne(r, z);
|
|
7613
|
+
(c.array.has(o) || Se(L) || d && !d._f) && !qe(L) ? te(z, L, C) : ue(z, L, C);
|
|
7609
7614
|
}
|
|
7610
7615
|
}, X = (o, y, C = {}) => {
|
|
7611
|
-
const R = ne(r, o),
|
|
7612
|
-
Me(s, o, z),
|
|
7616
|
+
const R = ne(r, o), L = c.array.has(o), z = Ae(y);
|
|
7617
|
+
Me(s, o, z), L ? (p.array.next({
|
|
7613
7618
|
name: o,
|
|
7614
7619
|
values: Ae(s)
|
|
7615
7620
|
}), (M.isDirty || M.dirtyFields || m.isDirty || m.dirtyFields) && C.shouldDirty && p.state.next({
|
|
7616
7621
|
name: o,
|
|
7617
7622
|
dirtyFields: Ze(i, s),
|
|
7618
|
-
isDirty:
|
|
7623
|
+
isDirty: O(o, z)
|
|
7619
7624
|
})) : R && !R._f && !Be(z) ? te(o, z, C) : ue(o, z, C), sa(o, c) ? p.state.next({
|
|
7620
7625
|
...t,
|
|
7621
7626
|
name: o,
|
|
@@ -7628,14 +7633,14 @@ function lr(e = {}) {
|
|
|
7628
7633
|
l.mount = !0;
|
|
7629
7634
|
const y = o.target;
|
|
7630
7635
|
let C = y.name, R = !0;
|
|
7631
|
-
const
|
|
7636
|
+
const L = ne(r, C), z = (x) => {
|
|
7632
7637
|
R = Number.isNaN(x) || qe(x) && isNaN(x.getTime()) || Ue(x, ne(s, C, x));
|
|
7633
7638
|
}, d = na(a.mode), D = na(a.reValidateMode);
|
|
7634
|
-
if (
|
|
7639
|
+
if (L) {
|
|
7635
7640
|
let x, v;
|
|
7636
|
-
const g = y.type ? aa(
|
|
7637
|
-
Me(s, C, g), U ? (!y || !y.readOnly) && (
|
|
7638
|
-
const ye =
|
|
7641
|
+
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, C) && !L._f.deps || nr(U, ne(t.touchedFields, C), t.isSubmitted, D, d), de = sa(C, c, U);
|
|
7642
|
+
Me(s, C, g), U ? (!y || !y.readOnly) && (L._f.onBlur && L._f.onBlur(o), b && b(0)) : L._f.onChange && L._f.onChange(o);
|
|
7643
|
+
const ye = T(C, g, U), De = !$e(ye) || de;
|
|
7639
7644
|
if (!U && p.state.next({
|
|
7640
7645
|
name: C,
|
|
7641
7646
|
type: o.type,
|
|
@@ -7643,25 +7648,25 @@ function lr(e = {}) {
|
|
|
7643
7648
|
}), re)
|
|
7644
7649
|
return (M.isValid || m.isValid) && (a.mode === "onBlur" ? U && E() : U || E()), De && p.state.next({ name: C, ...de ? {} : ye });
|
|
7645
7650
|
if (!U && de && p.state.next({ ...t }), a.resolver) {
|
|
7646
|
-
const { errors: je } = await
|
|
7651
|
+
const { errors: je } = await Y([C]);
|
|
7647
7652
|
if (F([C]), z(g), R) {
|
|
7648
7653
|
const it = ia(t.errors, r, C), lt = ia(je, r, it.name || C);
|
|
7649
7654
|
x = lt.error, C = lt.name, v = $e(je);
|
|
7650
7655
|
}
|
|
7651
7656
|
} else
|
|
7652
|
-
F([C], !0), x = (await oa(
|
|
7653
|
-
R && (
|
|
7657
|
+
F([C], !0), x = (await oa(L, c.disabled, s, I, a.shouldUseNativeValidation))[C], F([C]), z(g), R && (x ? v = !1 : (M.isValid || m.isValid) && (v = await V(r, !0)));
|
|
7658
|
+
R && (L._f.deps && (!Array.isArray(L._f.deps) || L._f.deps.length > 0) && P(L._f.deps), $(C, v, x, ye));
|
|
7654
7659
|
}
|
|
7655
|
-
},
|
|
7660
|
+
}, K = (o, y) => {
|
|
7656
7661
|
if (ne(t.errors, y) && o.focus)
|
|
7657
7662
|
return o.focus(), 1;
|
|
7658
7663
|
}, P = async (o, y = {}) => {
|
|
7659
7664
|
let C, R;
|
|
7660
|
-
const
|
|
7665
|
+
const L = et(o);
|
|
7661
7666
|
if (a.resolver) {
|
|
7662
|
-
const z = await B(xe(o) ? o :
|
|
7663
|
-
C = $e(z), R = o ? !
|
|
7664
|
-
} else o ? (R = (await Promise.all(
|
|
7667
|
+
const z = await B(xe(o) ? o : L);
|
|
7668
|
+
C = $e(z), R = o ? !L.some((d) => ne(z, d)) : C;
|
|
7669
|
+
} else o ? (R = (await Promise.all(L.map(async (z) => {
|
|
7665
7670
|
const d = ne(r, z);
|
|
7666
7671
|
return await V(d && d._f ? { [z]: d } : d);
|
|
7667
7672
|
}))).every(Boolean), !(!R && !t.isValid) && E()) : R = C = await V(r);
|
|
@@ -7669,7 +7674,7 @@ function lr(e = {}) {
|
|
|
7669
7674
|
...!He(o) || (M.isValid || m.isValid) && C !== t.isValid ? {} : { name: o },
|
|
7670
7675
|
...a.resolver || !o ? { isValid: C } : {},
|
|
7671
7676
|
errors: t.errors
|
|
7672
|
-
}), y.shouldFocus && !R && tt(r,
|
|
7677
|
+
}), y.shouldFocus && !R && tt(r, K, o ? L : c.mount), R;
|
|
7673
7678
|
}, se = (o, y) => {
|
|
7674
7679
|
let C = {
|
|
7675
7680
|
...l.mount ? s : i
|
|
@@ -7681,12 +7686,12 @@ function lr(e = {}) {
|
|
|
7681
7686
|
error: ne((y || t).errors, o),
|
|
7682
7687
|
isValidating: !!ne(t.validatingFields, o),
|
|
7683
7688
|
isTouched: !!ne((y || t).touchedFields, o)
|
|
7684
|
-
}),
|
|
7689
|
+
}), j = (o) => {
|
|
7685
7690
|
o && et(o).forEach((y) => Ee(t.errors, y)), p.state.next({
|
|
7686
7691
|
errors: o ? t.errors : {}
|
|
7687
7692
|
});
|
|
7688
7693
|
}, Q = (o, y, C) => {
|
|
7689
|
-
const R = (ne(r, o, { _f: {} })._f || {}).ref,
|
|
7694
|
+
const R = (ne(r, o, { _f: {} })._f || {}).ref, L = ne(t.errors, o) || {}, { ref: z, message: d, type: D, ...x } = L;
|
|
7690
7695
|
Me(t.errors, o, {
|
|
7691
7696
|
...x,
|
|
7692
7697
|
...y,
|
|
@@ -7697,8 +7702,8 @@ function lr(e = {}) {
|
|
|
7697
7702
|
isValid: !1
|
|
7698
7703
|
}), C && C.shouldFocus && R && R.focus && R.focus();
|
|
7699
7704
|
}, ee = (o, y) => Re(o) ? p.state.subscribe({
|
|
7700
|
-
next: (C) => "values" in C && o(
|
|
7701
|
-
}) :
|
|
7705
|
+
next: (C) => "values" in C && o(W(void 0, y), C)
|
|
7706
|
+
}) : W(o, y, !0), ce = (o) => p.state.subscribe({
|
|
7702
7707
|
next: (y) => {
|
|
7703
7708
|
ar(o.name, y.name, o.exact) && tr(y, o.formState || M, Ne, o.reRenderRoot) && o.callback({
|
|
7704
7709
|
values: { ...s },
|
|
@@ -7723,12 +7728,12 @@ function lr(e = {}) {
|
|
|
7723
7728
|
values: Ae(s)
|
|
7724
7729
|
}), p.state.next({
|
|
7725
7730
|
...t,
|
|
7726
|
-
...y.keepDirty ? { isDirty:
|
|
7731
|
+
...y.keepDirty ? { isDirty: O() } : {}
|
|
7727
7732
|
}), !y.keepIsValid && E();
|
|
7728
7733
|
}, J = ({ disabled: o, name: y }) => {
|
|
7729
7734
|
if (Pe(o) && l.mount || o || c.disabled.has(y)) {
|
|
7730
|
-
const
|
|
7731
|
-
o ? c.disabled.add(y) : c.disabled.delete(y),
|
|
7735
|
+
const L = c.disabled.has(y) !== !!o;
|
|
7736
|
+
o ? c.disabled.add(y) : c.disabled.delete(y), L && l.mount && !l.action && E();
|
|
7732
7737
|
}
|
|
7733
7738
|
}, he = (o, y = {}) => {
|
|
7734
7739
|
let C = ne(r, o);
|
|
@@ -7757,10 +7762,10 @@ function lr(e = {}) {
|
|
|
7757
7762
|
name: o,
|
|
7758
7763
|
onChange: H,
|
|
7759
7764
|
onBlur: H,
|
|
7760
|
-
ref: (
|
|
7761
|
-
if (
|
|
7765
|
+
ref: (L) => {
|
|
7766
|
+
if (L) {
|
|
7762
7767
|
he(o, y), C = ne(r, o);
|
|
7763
|
-
const z = xe(
|
|
7768
|
+
const z = xe(L.value) && L.querySelectorAll && L.querySelectorAll("input,select,textarea")[0] || L, d = Yn(z), D = C._f.refs || [];
|
|
7764
7769
|
if (d ? D.find((x) => x === z) : z === C._f.ref)
|
|
7765
7770
|
return;
|
|
7766
7771
|
Me(r, o, {
|
|
@@ -7777,36 +7782,36 @@ function lr(e = {}) {
|
|
|
7777
7782
|
}
|
|
7778
7783
|
}), f(o, !1, void 0, z);
|
|
7779
7784
|
} else
|
|
7780
|
-
C = ne(r, o, {}), C._f && (C._f.mount = !1), (a.shouldUnregister || y.shouldUnregister) && !(
|
|
7785
|
+
C = ne(r, o, {}), C._f && (C._f.mount = !1), (a.shouldUnregister || y.shouldUnregister) && !(Ta(c.array, o) && l.action) && c.unMount.add(o);
|
|
7781
7786
|
}
|
|
7782
7787
|
};
|
|
7783
|
-
}, ve = () => a.shouldFocusError && tt(r,
|
|
7788
|
+
}, ve = () => a.shouldFocusError && tt(r, K, c.mount), fe = (o) => {
|
|
7784
7789
|
Pe(o) && (p.state.next({ disabled: o }), tt(r, (y, C) => {
|
|
7785
7790
|
const R = ne(r, C);
|
|
7786
|
-
R && (y.disabled = R._f.disabled || o, Array.isArray(R._f.refs) && R._f.refs.forEach((
|
|
7787
|
-
|
|
7791
|
+
R && (y.disabled = R._f.disabled || o, Array.isArray(R._f.refs) && R._f.refs.forEach((L) => {
|
|
7792
|
+
L.disabled = R._f.disabled || o;
|
|
7788
7793
|
}));
|
|
7789
7794
|
}, 0, !1));
|
|
7790
7795
|
}, pe = (o, y) => async (C) => {
|
|
7791
7796
|
let R;
|
|
7792
7797
|
C && (C.preventDefault && C.preventDefault(), C.persist && C.persist());
|
|
7793
|
-
let
|
|
7798
|
+
let L = Ae(s);
|
|
7794
7799
|
if (p.state.next({
|
|
7795
7800
|
isSubmitting: !0
|
|
7796
7801
|
}), a.resolver) {
|
|
7797
|
-
const { errors: z, values: d } = await
|
|
7798
|
-
F(), t.errors = z,
|
|
7802
|
+
const { errors: z, values: d } = await Y();
|
|
7803
|
+
F(), t.errors = z, L = Ae(d);
|
|
7799
7804
|
} else
|
|
7800
7805
|
await V(r);
|
|
7801
7806
|
if (c.disabled.size)
|
|
7802
7807
|
for (const z of c.disabled)
|
|
7803
|
-
Ee(
|
|
7808
|
+
Ee(L, z);
|
|
7804
7809
|
if (Ee(t.errors, "root"), $e(t.errors)) {
|
|
7805
7810
|
p.state.next({
|
|
7806
7811
|
errors: {}
|
|
7807
7812
|
});
|
|
7808
7813
|
try {
|
|
7809
|
-
await o(
|
|
7814
|
+
await o(L, C);
|
|
7810
7815
|
} catch (z) {
|
|
7811
7816
|
R = z;
|
|
7812
7817
|
}
|
|
@@ -7821,9 +7826,9 @@ function lr(e = {}) {
|
|
|
7821
7826
|
}), R)
|
|
7822
7827
|
throw R;
|
|
7823
7828
|
}, Ce = (o, y = {}) => {
|
|
7824
|
-
ne(r, o) && (xe(y.defaultValue) ? X(o, Ae(ne(i, o))) : (X(o, y.defaultValue), Me(i, o, Ae(y.defaultValue))), y.keepTouched || Ee(t.touchedFields, o), y.keepDirty || (Ee(t.dirtyFields, o), t.isDirty = y.defaultValue ?
|
|
7829
|
+
ne(r, o) && (xe(y.defaultValue) ? X(o, Ae(ne(i, o))) : (X(o, y.defaultValue), Me(i, o, Ae(y.defaultValue))), y.keepTouched || Ee(t.touchedFields, o), y.keepDirty || (Ee(t.dirtyFields, o), t.isDirty = y.defaultValue ? O(o, Ae(ne(i, o))) : O()), y.keepError || (Ee(t.errors, o), M.isValid && E()), p.state.next({ ...t }));
|
|
7825
7830
|
}, be = (o, y = {}) => {
|
|
7826
|
-
const C = o ? Ae(o) : i, R = Ae(C),
|
|
7831
|
+
const C = o ? Ae(o) : i, R = Ae(C), L = $e(o), z = L ? i : R;
|
|
7827
7832
|
if (y.keepDefaultValues || (i = C), !y.keepValues) {
|
|
7828
7833
|
if (y.keepDirtyValues) {
|
|
7829
7834
|
const d = /* @__PURE__ */ new Set([
|
|
@@ -7871,9 +7876,9 @@ function lr(e = {}) {
|
|
|
7871
7876
|
focus: ""
|
|
7872
7877
|
}, l.mount = !M.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({
|
|
7873
7878
|
submitCount: y.keepSubmitCount ? t.submitCount : 0,
|
|
7874
|
-
isDirty:
|
|
7879
|
+
isDirty: L ? !1 : y.keepDirty ? t.isDirty : !!(y.keepDefaultValues && !Ue(o, i)),
|
|
7875
7880
|
isSubmitted: y.keepIsSubmitted ? t.isSubmitted : !1,
|
|
7876
|
-
dirtyFields:
|
|
7881
|
+
dirtyFields: L ? {} : y.keepDirtyValues ? y.keepDefaultValues && s ? Ze(i, s) : t.dirtyFields : y.keepDefaultValues && o ? Ze(i, o) : y.keepDirty ? t.dirtyFields : {},
|
|
7877
7882
|
touchedFields: y.keepTouched ? t.touchedFields : {},
|
|
7878
7883
|
errors: y.keepErrors ? t.errors : {},
|
|
7879
7884
|
isSubmitSuccessful: y.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
@@ -7883,9 +7888,9 @@ function lr(e = {}) {
|
|
|
7883
7888
|
}, we = (o, y) => be(Re(o) ? o(s) : o, { ...a.resetOptions, ...y }), ke = (o, y = {}) => {
|
|
7884
7889
|
const C = ne(r, o), R = C && C._f;
|
|
7885
7890
|
if (R) {
|
|
7886
|
-
const
|
|
7887
|
-
|
|
7888
|
-
|
|
7891
|
+
const L = R.refs ? R.refs[0] : R.ref;
|
|
7892
|
+
L.focus && setTimeout(() => {
|
|
7893
|
+
L.focus(), y.shouldSelect && Re(L.select) && L.select();
|
|
7889
7894
|
});
|
|
7890
7895
|
}
|
|
7891
7896
|
}, Ne = (o) => {
|
|
@@ -7901,11 +7906,11 @@ function lr(e = {}) {
|
|
|
7901
7906
|
handleSubmit: pe,
|
|
7902
7907
|
setError: Q,
|
|
7903
7908
|
_subscribe: ce,
|
|
7904
|
-
_runSchema:
|
|
7909
|
+
_runSchema: Y,
|
|
7905
7910
|
_updateIsValidating: F,
|
|
7906
7911
|
_focusError: ve,
|
|
7907
|
-
_getWatch:
|
|
7908
|
-
_getDirty:
|
|
7912
|
+
_getWatch: W,
|
|
7913
|
+
_getDirty: O,
|
|
7909
7914
|
_setValid: E,
|
|
7910
7915
|
_setFieldArray: N,
|
|
7911
7916
|
_setDisabledField: J,
|
|
@@ -7917,7 +7922,7 @@ function lr(e = {}) {
|
|
|
7917
7922
|
isLoading: !1
|
|
7918
7923
|
});
|
|
7919
7924
|
}),
|
|
7920
|
-
_removeUnmounted:
|
|
7925
|
+
_removeUnmounted: G,
|
|
7921
7926
|
_disableForm: fe,
|
|
7922
7927
|
_subjects: p,
|
|
7923
7928
|
_proxyFormState: M,
|
|
@@ -7964,7 +7969,7 @@ function lr(e = {}) {
|
|
|
7964
7969
|
getValues: se,
|
|
7965
7970
|
reset: we,
|
|
7966
7971
|
resetField: Ce,
|
|
7967
|
-
clearErrors:
|
|
7972
|
+
clearErrors: j,
|
|
7968
7973
|
unregister: ie,
|
|
7969
7974
|
setError: Q,
|
|
7970
7975
|
setFocus: ke,
|
|
@@ -8040,7 +8045,7 @@ function or(e = {}) {
|
|
|
8040
8045
|
}), !((l = s._options.resetOptions) === null || l === void 0) && l.keepIsValid || s._setValid(), t.current = e.values, i((c) => ({ ...c }))) : s._resetDefaultValues();
|
|
8041
8046
|
}, [s, e.values]), ge.useEffect(() => {
|
|
8042
8047
|
s._state.mount || (s._setValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
|
|
8043
|
-
}), a.current.formState = ge.useMemo(() =>
|
|
8048
|
+
}), a.current.formState = ge.useMemo(() => La(r, s), [s, r]), a.current;
|
|
8044
8049
|
}
|
|
8045
8050
|
function _s(e) {
|
|
8046
8051
|
return or(e);
|
|
@@ -8118,7 +8123,7 @@ function ca({
|
|
|
8118
8123
|
};
|
|
8119
8124
|
return J(), window.addEventListener("resize", J), () => window.removeEventListener("resize", J);
|
|
8120
8125
|
}, [s]);
|
|
8121
|
-
const
|
|
8126
|
+
const T = Fe(() => Math.floor(k / _) * _, [k, _]), [$, Y] = Z(h), [B, V] = Z(null), [G, O] = Z(!1), [W, ae] = Z({}), ue = le(null), te = le(null), X = le(null), H = me(
|
|
8122
8127
|
(J) => {
|
|
8123
8128
|
const he = (/* @__PURE__ */ new Date()).getFullYear();
|
|
8124
8129
|
if (M && J < he || m && J > he)
|
|
@@ -8141,31 +8146,31 @@ function ca({
|
|
|
8141
8146
|
p,
|
|
8142
8147
|
I
|
|
8143
8148
|
]
|
|
8144
|
-
),
|
|
8145
|
-
const J = [], he =
|
|
8149
|
+
), K = Fe(() => {
|
|
8150
|
+
const J = [], he = T, ve = Math.min(T + _ - 1, i);
|
|
8146
8151
|
for (let fe = he; fe <= ve; fe++)
|
|
8147
8152
|
fe >= r && J.push(fe);
|
|
8148
8153
|
return J;
|
|
8149
|
-
}, [
|
|
8154
|
+
}, [T, _, r, i]), P = me(
|
|
8150
8155
|
(J) => {
|
|
8151
|
-
const he = J === "prev" ? Math.max(
|
|
8152
|
-
|
|
8156
|
+
const he = J === "prev" ? Math.max(T - _, r) : Math.min(
|
|
8157
|
+
T + _,
|
|
8153
8158
|
i - _ + 1
|
|
8154
8159
|
), ve = Math.max(he, r);
|
|
8155
8160
|
t == null || t(ve);
|
|
8156
8161
|
},
|
|
8157
|
-
[
|
|
8162
|
+
[T, _, r, i, t]
|
|
8158
8163
|
), se = me(
|
|
8159
8164
|
(J) => {
|
|
8160
|
-
t == null || t(J),
|
|
8165
|
+
t == null || t(J), Y(!1), u == null || u(!1);
|
|
8161
8166
|
},
|
|
8162
8167
|
[t, u]
|
|
8163
8168
|
), q = me(() => {
|
|
8164
8169
|
if (c) return;
|
|
8165
8170
|
const J = !$;
|
|
8166
|
-
|
|
8167
|
-
}, [c, $, u]),
|
|
8168
|
-
|
|
8171
|
+
Y(J), u == null || u(J);
|
|
8172
|
+
}, [c, $, u]), j = me(() => {
|
|
8173
|
+
Y(!1), u == null || u(!1);
|
|
8169
8174
|
}, [u]), Q = me(
|
|
8170
8175
|
(J) => {
|
|
8171
8176
|
J.stopPropagation(), F ? F() : t == null || t((/* @__PURE__ */ new Date()).getFullYear());
|
|
@@ -8180,8 +8185,8 @@ function ca({
|
|
|
8180
8185
|
let Ne, Ve, Ie = !1;
|
|
8181
8186
|
Ie = we > ke, Ie ? (Ve = 0, Ne = void 0) : (Ne = 0, Ve = void 0);
|
|
8182
8187
|
const o = Ce - ve.bottom, y = ve.top;
|
|
8183
|
-
let C, R,
|
|
8184
|
-
o < fe.height && y > o ? (R = ve.height + 4, C = void 0,
|
|
8188
|
+
let C, R, L = "400px";
|
|
8189
|
+
o < fe.height && y > o ? (R = ve.height + 4, C = void 0, L = `${Math.min(y - 10, 400)}px`) : (C = ve.height + 4, R = void 0, L = `${Math.min(o - 10, 400)}px`);
|
|
8185
8190
|
const z = `${Math.min(we, pe - 16)}px`;
|
|
8186
8191
|
ae({
|
|
8187
8192
|
position: "absolute",
|
|
@@ -8190,10 +8195,10 @@ function ca({
|
|
|
8190
8195
|
left: Ne !== void 0 ? `${Ne}px` : void 0,
|
|
8191
8196
|
right: Ve !== void 0 ? `${Ve}px` : void 0,
|
|
8192
8197
|
maxWidth: z,
|
|
8193
|
-
maxHeight:
|
|
8198
|
+
maxHeight: L,
|
|
8194
8199
|
zIndex: 10006
|
|
8195
8200
|
// Higher than MonthPicker panel (10005) and DatePicker panel (10004)
|
|
8196
|
-
}),
|
|
8201
|
+
}), O(Ie);
|
|
8197
8202
|
};
|
|
8198
8203
|
requestAnimationFrame(() => {
|
|
8199
8204
|
setTimeout(J, 0);
|
|
@@ -8205,16 +8210,16 @@ function ca({
|
|
|
8205
8210
|
window.removeEventListener("resize", he), window.removeEventListener("scroll", he, !0);
|
|
8206
8211
|
};
|
|
8207
8212
|
} else
|
|
8208
|
-
|
|
8213
|
+
O(!1), ae({});
|
|
8209
8214
|
}, [$]), oe(() => {
|
|
8210
8215
|
const J = (he) => {
|
|
8211
|
-
ue.current && !ue.current.contains(he.target) &&
|
|
8216
|
+
ue.current && !ue.current.contains(he.target) && j();
|
|
8212
8217
|
};
|
|
8213
8218
|
if ($)
|
|
8214
8219
|
return document.addEventListener("mousedown", J), () => document.removeEventListener("mousedown", J);
|
|
8215
|
-
}, [$,
|
|
8216
|
-
const ee = `${
|
|
8217
|
-
|
|
8220
|
+
}, [$, j]);
|
|
8221
|
+
const ee = `${T} - ${Math.min(
|
|
8222
|
+
T + _ - 1,
|
|
8218
8223
|
i
|
|
8219
8224
|
)}`, ce = S("ina-year-picker", l), _e = S(
|
|
8220
8225
|
"ina-year-picker__trigger",
|
|
@@ -8226,7 +8231,7 @@ function ca({
|
|
|
8226
8231
|
$ && "ina-year-picker__panel--open"
|
|
8227
8232
|
);
|
|
8228
8233
|
return oe(() => {
|
|
8229
|
-
|
|
8234
|
+
Y(h);
|
|
8230
8235
|
}, [h]), /* @__PURE__ */ w("div", { ref: ue, className: ce, children: [
|
|
8231
8236
|
/* @__PURE__ */ w(
|
|
8232
8237
|
"button",
|
|
@@ -8239,7 +8244,7 @@ function ca({
|
|
|
8239
8244
|
"aria-expanded": $,
|
|
8240
8245
|
"aria-haspopup": "listbox",
|
|
8241
8246
|
onKeyDown: (J) => {
|
|
8242
|
-
J.key === "Enter" || J.key === " " ? (J.preventDefault(), q()) : J.key === "Escape" && $ && (J.preventDefault(),
|
|
8247
|
+
J.key === "Enter" || J.key === " " ? (J.preventDefault(), q()) : J.key === "Escape" && $ && (J.preventDefault(), j());
|
|
8243
8248
|
},
|
|
8244
8249
|
children: [
|
|
8245
8250
|
A && /* @__PURE__ */ n(Ut, { size: 16, className: "ina-year-picker__icon" }),
|
|
@@ -8252,7 +8257,7 @@ function ca({
|
|
|
8252
8257
|
className: "ina-year-picker__clear-button",
|
|
8253
8258
|
"aria-label": "Clear year",
|
|
8254
8259
|
disabled: c,
|
|
8255
|
-
children: /* @__PURE__ */ n(
|
|
8260
|
+
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-year-picker__clear-icon" })
|
|
8256
8261
|
}
|
|
8257
8262
|
),
|
|
8258
8263
|
/* @__PURE__ */ n(
|
|
@@ -8288,9 +8293,9 @@ function ca({
|
|
|
8288
8293
|
ref: X,
|
|
8289
8294
|
className: S(
|
|
8290
8295
|
ie,
|
|
8291
|
-
|
|
8296
|
+
G && "ina-year-picker__panel--right-aligned"
|
|
8292
8297
|
),
|
|
8293
|
-
style:
|
|
8298
|
+
style: W,
|
|
8294
8299
|
children: [
|
|
8295
8300
|
/* @__PURE__ */ w("div", { className: "ina-year-picker__header", children: [
|
|
8296
8301
|
/* @__PURE__ */ n(
|
|
@@ -8302,7 +8307,7 @@ function ca({
|
|
|
8302
8307
|
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), P("prev"));
|
|
8303
8308
|
},
|
|
8304
8309
|
className: "ina-year-picker__nav-button",
|
|
8305
|
-
disabled:
|
|
8310
|
+
disabled: T <= r,
|
|
8306
8311
|
"aria-label": "Previous decade",
|
|
8307
8312
|
children: /* @__PURE__ */ n(
|
|
8308
8313
|
ut,
|
|
@@ -8323,7 +8328,7 @@ function ca({
|
|
|
8323
8328
|
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), P("next"));
|
|
8324
8329
|
},
|
|
8325
8330
|
className: "ina-year-picker__nav-button",
|
|
8326
|
-
disabled:
|
|
8331
|
+
disabled: T + _ > i,
|
|
8327
8332
|
"aria-label": "Next decade",
|
|
8328
8333
|
children: /* @__PURE__ */ n(
|
|
8329
8334
|
nt,
|
|
@@ -8335,8 +8340,8 @@ function ca({
|
|
|
8335
8340
|
}
|
|
8336
8341
|
)
|
|
8337
8342
|
] }),
|
|
8338
|
-
/* @__PURE__ */ n("div", { className: "ina-year-picker__grid", children:
|
|
8339
|
-
const ve = J === k, fe = J === B, pe = H(J), Ce = ve || !
|
|
8343
|
+
/* @__PURE__ */ n("div", { className: "ina-year-picker__grid", children: K.map((J, he) => {
|
|
8344
|
+
const ve = J === k, fe = J === B, pe = H(J), Ce = ve || !K.includes(k) && he === 0;
|
|
8340
8345
|
return /* @__PURE__ */ n(
|
|
8341
8346
|
"button",
|
|
8342
8347
|
{
|
|
@@ -8440,10 +8445,10 @@ function da({
|
|
|
8440
8445
|
], [b]), N = Fe(() => {
|
|
8441
8446
|
const q = e ?? a ?? (/* @__PURE__ */ new Date()).getMonth();
|
|
8442
8447
|
return q == null || isNaN(q) ? (/* @__PURE__ */ new Date()).getMonth() : q;
|
|
8443
|
-
}, [e, a]), [k, _] = Z(l), [f,
|
|
8448
|
+
}, [e, a]), [k, _] = Z(l), [f, T] = Z(null), [$, Y] = Z(!1), [B, V] = Z({}), G = le(null), O = le(null), W = le(null), ae = me(
|
|
8444
8449
|
(q) => {
|
|
8445
|
-
const
|
|
8446
|
-
return !!(h && q <
|
|
8450
|
+
const j = (/* @__PURE__ */ new Date()).getMonth();
|
|
8451
|
+
return !!(h && q < j || u && q > j || M !== void 0 && q < M || m !== void 0 && q > m);
|
|
8447
8452
|
},
|
|
8448
8453
|
[
|
|
8449
8454
|
h,
|
|
@@ -8469,10 +8474,10 @@ function da({
|
|
|
8469
8474
|
[A, t]
|
|
8470
8475
|
);
|
|
8471
8476
|
oe(() => {
|
|
8472
|
-
if (k &&
|
|
8477
|
+
if (k && O.current) {
|
|
8473
8478
|
const q = () => {
|
|
8474
|
-
if (!
|
|
8475
|
-
const Q =
|
|
8479
|
+
if (!O.current || !W.current) return;
|
|
8480
|
+
const Q = O.current.getBoundingClientRect(), ee = W.current.getBoundingClientRect(), ce = window.innerWidth, _e = window.innerHeight, J = ee.width || 240, he = ce - Q.right;
|
|
8476
8481
|
let ve, fe, pe = !1;
|
|
8477
8482
|
pe = J > he, pe ? (fe = 0, ve = void 0) : (ve = 0, fe = void 0);
|
|
8478
8483
|
const Ce = _e - Q.bottom, be = Q.top;
|
|
@@ -8489,27 +8494,27 @@ function da({
|
|
|
8489
8494
|
maxHeight: Ne,
|
|
8490
8495
|
zIndex: 10005
|
|
8491
8496
|
// Higher than DatePicker panel (10004)
|
|
8492
|
-
}),
|
|
8497
|
+
}), Y(pe);
|
|
8493
8498
|
};
|
|
8494
8499
|
requestAnimationFrame(() => {
|
|
8495
8500
|
setTimeout(q, 0);
|
|
8496
8501
|
});
|
|
8497
|
-
const
|
|
8498
|
-
|
|
8502
|
+
const j = () => {
|
|
8503
|
+
O.current && W.current && q();
|
|
8499
8504
|
};
|
|
8500
|
-
return window.addEventListener("resize",
|
|
8501
|
-
window.removeEventListener("resize",
|
|
8505
|
+
return window.addEventListener("resize", j), window.addEventListener("scroll", j, !0), () => {
|
|
8506
|
+
window.removeEventListener("resize", j), window.removeEventListener("scroll", j, !0);
|
|
8502
8507
|
};
|
|
8503
8508
|
} else
|
|
8504
|
-
|
|
8509
|
+
Y(!1), V({});
|
|
8505
8510
|
}, [k]), oe(() => {
|
|
8506
|
-
const q = (
|
|
8507
|
-
|
|
8511
|
+
const q = (j) => {
|
|
8512
|
+
G.current && !G.current.contains(j.target) && X();
|
|
8508
8513
|
};
|
|
8509
8514
|
if (k)
|
|
8510
8515
|
return document.addEventListener("mousedown", q), () => document.removeEventListener("mousedown", q);
|
|
8511
8516
|
}, [k, X]);
|
|
8512
|
-
const
|
|
8517
|
+
const K = S("ina-month-picker", r), P = S(
|
|
8513
8518
|
"ina-month-picker__trigger",
|
|
8514
8519
|
`ina-month-picker__trigger--size-${E}`,
|
|
8515
8520
|
i && "ina-month-picker__trigger--disabled",
|
|
@@ -8520,11 +8525,11 @@ function da({
|
|
|
8520
8525
|
);
|
|
8521
8526
|
return oe(() => {
|
|
8522
8527
|
_(l);
|
|
8523
|
-
}, [l]), /* @__PURE__ */ w("div", { ref:
|
|
8528
|
+
}, [l]), /* @__PURE__ */ w("div", { ref: G, className: K, children: [
|
|
8524
8529
|
/* @__PURE__ */ w(
|
|
8525
8530
|
"button",
|
|
8526
8531
|
{
|
|
8527
|
-
ref:
|
|
8532
|
+
ref: O,
|
|
8528
8533
|
type: "button",
|
|
8529
8534
|
onClick: te,
|
|
8530
8535
|
className: P,
|
|
@@ -8545,7 +8550,7 @@ function da({
|
|
|
8545
8550
|
className: "ina-month-picker__clear-button",
|
|
8546
8551
|
disabled: i,
|
|
8547
8552
|
"aria-label": "Clear month",
|
|
8548
|
-
children: /* @__PURE__ */ n(
|
|
8553
|
+
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-month-picker__clear-icon" })
|
|
8549
8554
|
}
|
|
8550
8555
|
),
|
|
8551
8556
|
/* @__PURE__ */ n(
|
|
@@ -8578,27 +8583,27 @@ function da({
|
|
|
8578
8583
|
k && /* @__PURE__ */ n(
|
|
8579
8584
|
"div",
|
|
8580
8585
|
{
|
|
8581
|
-
ref:
|
|
8586
|
+
ref: W,
|
|
8582
8587
|
className: S(
|
|
8583
8588
|
se,
|
|
8584
8589
|
$ && "ina-month-picker__panel--right-aligned"
|
|
8585
8590
|
),
|
|
8586
8591
|
style: B,
|
|
8587
|
-
children: /* @__PURE__ */ n("div", { className: "ina-month-picker__grid", children: F.map((q,
|
|
8588
|
-
const Q =
|
|
8592
|
+
children: /* @__PURE__ */ n("div", { className: "ina-month-picker__grid", children: F.map((q, j) => {
|
|
8593
|
+
const Q = j === N, ee = j === f, ce = ae(j);
|
|
8589
8594
|
return /* @__PURE__ */ n(
|
|
8590
8595
|
"button",
|
|
8591
8596
|
{
|
|
8592
8597
|
type: "button",
|
|
8593
8598
|
role: "option",
|
|
8594
8599
|
"aria-selected": Q,
|
|
8595
|
-
tabIndex: Q || !N &&
|
|
8596
|
-
onClick: () => !ce && ue(
|
|
8600
|
+
tabIndex: Q || !N && j === 0 ? 0 : -1,
|
|
8601
|
+
onClick: () => !ce && ue(j),
|
|
8597
8602
|
onKeyDown: (ie) => {
|
|
8598
8603
|
var J, he;
|
|
8599
8604
|
if (!ce) {
|
|
8600
8605
|
if (ie.key === "Enter" || ie.key === " ")
|
|
8601
|
-
ie.preventDefault(), ue(
|
|
8606
|
+
ie.preventDefault(), ue(j);
|
|
8602
8607
|
else if (ie.key === "ArrowRight") {
|
|
8603
8608
|
ie.preventDefault();
|
|
8604
8609
|
const ve = ie.currentTarget.nextElementSibling;
|
|
@@ -8611,19 +8616,19 @@ function da({
|
|
|
8611
8616
|
ie.preventDefault();
|
|
8612
8617
|
const fe = Array.from(
|
|
8613
8618
|
((J = ie.currentTarget.parentElement) == null ? void 0 : J.children) || []
|
|
8614
|
-
)[
|
|
8619
|
+
)[j + 4];
|
|
8615
8620
|
fe && fe.focus();
|
|
8616
8621
|
} else if (ie.key === "ArrowUp") {
|
|
8617
8622
|
ie.preventDefault();
|
|
8618
8623
|
const fe = Array.from(
|
|
8619
8624
|
((he = ie.currentTarget.parentElement) == null ? void 0 : he.children) || []
|
|
8620
|
-
)[
|
|
8625
|
+
)[j - 4];
|
|
8621
8626
|
fe && fe.focus();
|
|
8622
8627
|
}
|
|
8623
8628
|
}
|
|
8624
8629
|
},
|
|
8625
|
-
onMouseEnter: () => !ce &&
|
|
8626
|
-
onMouseLeave: () =>
|
|
8630
|
+
onMouseEnter: () => !ce && T(j),
|
|
8631
|
+
onMouseLeave: () => T(null),
|
|
8627
8632
|
className: S(
|
|
8628
8633
|
"ina-month-picker__month-option",
|
|
8629
8634
|
Q && "ina-month-picker__month-option--selected",
|
|
@@ -8633,7 +8638,7 @@ function da({
|
|
|
8633
8638
|
disabled: i || ce,
|
|
8634
8639
|
children: q
|
|
8635
8640
|
},
|
|
8636
|
-
|
|
8641
|
+
j
|
|
8637
8642
|
);
|
|
8638
8643
|
}) })
|
|
8639
8644
|
}
|
|
@@ -8698,7 +8703,7 @@ const Oa = [
|
|
|
8698
8703
|
p !== -1 ? M = p : I !== -1 ? M = I : M = parseInt(m, 10) - 1;
|
|
8699
8704
|
const A = new Date(u, M, h);
|
|
8700
8705
|
return isNaN(A.getTime()) ? null : A;
|
|
8701
|
-
},
|
|
8706
|
+
}, 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"];
|
|
8702
8707
|
function ks({
|
|
8703
8708
|
mode: e = "range",
|
|
8704
8709
|
selected: a,
|
|
@@ -8722,10 +8727,10 @@ function ks({
|
|
|
8722
8727
|
required: k,
|
|
8723
8728
|
panelOnly: _ = !1
|
|
8724
8729
|
}) {
|
|
8725
|
-
const [f,
|
|
8730
|
+
const [f, T] = Z(!1), [$, Y] = Z(/* @__PURE__ */ new Date()), [B, V] = Z(() => {
|
|
8726
8731
|
const d = /* @__PURE__ */ new Date();
|
|
8727
8732
|
return d.setMonth(d.getMonth() + 1), d;
|
|
8728
|
-
}), [
|
|
8733
|
+
}), [G, O] = Z(null), [W, ae] = Z(!1), [ue, te] = Z(c), [X, H] = Z(null), K = le(`datepicker-${Math.random().toString(36).slice(2)}`), P = le(null), se = le(null), q = le(null), j = () => {
|
|
8729
8734
|
if (e === "single") {
|
|
8730
8735
|
const d = ze(a, s);
|
|
8731
8736
|
return d ? [d] : [];
|
|
@@ -8734,11 +8739,11 @@ function ks({
|
|
|
8734
8739
|
return [x, v].filter(Boolean);
|
|
8735
8740
|
} else
|
|
8736
8741
|
return a.map((d) => ze(d, s)).filter(Boolean);
|
|
8737
|
-
}, Q =
|
|
8742
|
+
}, Q = j();
|
|
8738
8743
|
oe(() => {
|
|
8739
8744
|
const d = (D) => {
|
|
8740
8745
|
var x;
|
|
8741
|
-
((x = D.detail) == null ? void 0 : x.exclude) !== P.current && f && (
|
|
8746
|
+
((x = D.detail) == null ? void 0 : x.exclude) !== P.current && f && (T(!1), O(null), H(null));
|
|
8742
8747
|
};
|
|
8743
8748
|
return document.addEventListener(
|
|
8744
8749
|
"closeDatePicker",
|
|
@@ -8752,7 +8757,7 @@ function ks({
|
|
|
8752
8757
|
}, [f]), oe(() => {
|
|
8753
8758
|
const d = (D) => {
|
|
8754
8759
|
const x = D.target;
|
|
8755
|
-
P.current && P.current.contains(x) || (
|
|
8760
|
+
P.current && P.current.contains(x) || (T(!1), O(null), H(null), H(null));
|
|
8756
8761
|
};
|
|
8757
8762
|
if (f && !_)
|
|
8758
8763
|
return document.addEventListener("mousedown", d, !0), () => document.removeEventListener("mousedown", d, !0);
|
|
@@ -8827,7 +8832,7 @@ function ks({
|
|
|
8827
8832
|
]), ce = le(!1);
|
|
8828
8833
|
oe(() => {
|
|
8829
8834
|
if ((f || _) && !ce.current) {
|
|
8830
|
-
const d =
|
|
8835
|
+
const d = j();
|
|
8831
8836
|
let D = null, x = null;
|
|
8832
8837
|
if (e === "range" && d.length >= 2) {
|
|
8833
8838
|
const v = d[0], g = d[1];
|
|
@@ -8858,13 +8863,13 @@ function ks({
|
|
|
8858
8863
|
1
|
|
8859
8864
|
));
|
|
8860
8865
|
}
|
|
8861
|
-
if (D || (D = ee()), D && (
|
|
8866
|
+
if (D || (D = ee()), D && (Y(D), e !== "single")) {
|
|
8862
8867
|
if (x)
|
|
8863
8868
|
V(x);
|
|
8864
8869
|
else if (e === "multiple") {
|
|
8865
8870
|
const v = new Date(D);
|
|
8866
8871
|
v.setMonth(v.getMonth() + 1), V(v);
|
|
8867
|
-
} else if (e === "range" &&
|
|
8872
|
+
} else if (e === "range" && j().length === 0) {
|
|
8868
8873
|
const U = new Date(D);
|
|
8869
8874
|
U.setMonth(U.getMonth() + 1), V(U);
|
|
8870
8875
|
}
|
|
@@ -8920,7 +8925,7 @@ function ks({
|
|
|
8920
8925
|
), J = () => {
|
|
8921
8926
|
e === "single" ? t("") : e === "range" ? (t(["", ""]), H(null)) : t([]);
|
|
8922
8927
|
}, he = (d) => {
|
|
8923
|
-
if (
|
|
8928
|
+
if (O(null), e === "single") {
|
|
8924
8929
|
const D = Ge(d, s);
|
|
8925
8930
|
t(D);
|
|
8926
8931
|
} else if (e === "range") {
|
|
@@ -8932,13 +8937,13 @@ function ks({
|
|
|
8932
8937
|
t([
|
|
8933
8938
|
re,
|
|
8934
8939
|
de
|
|
8935
|
-
]), H(null),
|
|
8940
|
+
]), H(null), T(!1);
|
|
8936
8941
|
} else
|
|
8937
8942
|
t(["", ""]), H(d);
|
|
8938
8943
|
} else if (e === "multiple") {
|
|
8939
8944
|
const D = Q, x = ua(d, D);
|
|
8940
8945
|
let v;
|
|
8941
|
-
x ? v = D.filter((U) => !
|
|
8946
|
+
x ? v = D.filter((U) => !Le(U, d)) : v = [...D, d];
|
|
8942
8947
|
const g = v.map((U) => Ge(U, s));
|
|
8943
8948
|
t(g);
|
|
8944
8949
|
}
|
|
@@ -8946,7 +8951,7 @@ function ks({
|
|
|
8946
8951
|
const x = d.getFullYear(), v = d.getMonth(), g = D.getFullYear(), U = D.getMonth();
|
|
8947
8952
|
return x > g || x === g && v >= U;
|
|
8948
8953
|
}, fe = (d) => {
|
|
8949
|
-
|
|
8954
|
+
Y((D) => {
|
|
8950
8955
|
const x = new Date(D);
|
|
8951
8956
|
if (d === "prev" ? x.setMonth(x.getMonth() - 1) : x.setMonth(x.getMonth() + 1), e !== "single" && ve(x, B)) {
|
|
8952
8957
|
const v = new Date(x);
|
|
@@ -8959,7 +8964,7 @@ function ks({
|
|
|
8959
8964
|
const x = new Date(D);
|
|
8960
8965
|
if (d === "prev" ? x.setMonth(x.getMonth() - 1) : x.setMonth(x.getMonth() + 1), e !== "single" && ve($, x)) {
|
|
8961
8966
|
const v = new Date(x);
|
|
8962
|
-
v.setMonth(v.getMonth() - 1),
|
|
8967
|
+
v.setMonth(v.getMonth() - 1), Y(v);
|
|
8963
8968
|
}
|
|
8964
8969
|
return x;
|
|
8965
8970
|
});
|
|
@@ -8968,10 +8973,10 @@ function ks({
|
|
|
8968
8973
|
const v = new Date(x);
|
|
8969
8974
|
if (v.setMonth(d), e !== "single" && ve($, v)) {
|
|
8970
8975
|
const g = new Date(v);
|
|
8971
|
-
g.setMonth(g.getMonth() - 1),
|
|
8976
|
+
g.setMonth(g.getMonth() - 1), Y(g);
|
|
8972
8977
|
}
|
|
8973
8978
|
return v;
|
|
8974
|
-
}) :
|
|
8979
|
+
}) : Y((x) => {
|
|
8975
8980
|
const v = new Date(x);
|
|
8976
8981
|
if (v.setMonth(d), e !== "single" && ve(v, B)) {
|
|
8977
8982
|
const g = new Date(v);
|
|
@@ -8984,10 +8989,10 @@ function ks({
|
|
|
8984
8989
|
const v = new Date(x);
|
|
8985
8990
|
if (v.setFullYear(d), e !== "single" && ve($, v)) {
|
|
8986
8991
|
const g = new Date(v);
|
|
8987
|
-
g.setMonth(g.getMonth() - 1),
|
|
8992
|
+
g.setMonth(g.getMonth() - 1), Y(g);
|
|
8988
8993
|
}
|
|
8989
8994
|
return v;
|
|
8990
|
-
}) :
|
|
8995
|
+
}) : Y((x) => {
|
|
8991
8996
|
const v = new Date(x);
|
|
8992
8997
|
if (v.setFullYear(d), e !== "single" && ve(v, B)) {
|
|
8993
8998
|
const g = new Date(v);
|
|
@@ -9029,16 +9034,16 @@ function ks({
|
|
|
9029
9034
|
}, ke = (d) => {
|
|
9030
9035
|
if (!d) return !1;
|
|
9031
9036
|
if (e === "single")
|
|
9032
|
-
return Q.length > 0 &&
|
|
9037
|
+
return Q.length > 0 && Le(d, Q[0]);
|
|
9033
9038
|
if (e === "range") {
|
|
9034
|
-
if (X &&
|
|
9039
|
+
if (X && Le(d, X))
|
|
9035
9040
|
return !0;
|
|
9036
9041
|
if (!X) {
|
|
9037
9042
|
if (Q.length === 1)
|
|
9038
|
-
return
|
|
9043
|
+
return Le(d, Q[0]);
|
|
9039
9044
|
if (Q.length === 2) {
|
|
9040
9045
|
const [D, x] = Q;
|
|
9041
|
-
return
|
|
9046
|
+
return Le(d, D) || Le(d, x);
|
|
9042
9047
|
}
|
|
9043
9048
|
}
|
|
9044
9049
|
return !1;
|
|
@@ -9056,40 +9061,40 @@ function ks({
|
|
|
9056
9061
|
}
|
|
9057
9062
|
return !1;
|
|
9058
9063
|
}, Ve = (d) => {
|
|
9059
|
-
if (!d || !
|
|
9064
|
+
if (!d || !G) return !1;
|
|
9060
9065
|
if (e === "range") {
|
|
9061
9066
|
const D = X || (Q.length > 0 ? Q[0] : null);
|
|
9062
9067
|
if (D) {
|
|
9063
|
-
const [x, v] = D <=
|
|
9068
|
+
const [x, v] = D <= G ? [D, G] : [G, D];
|
|
9064
9069
|
return d > x && d < v;
|
|
9065
9070
|
}
|
|
9066
9071
|
}
|
|
9067
9072
|
return !1;
|
|
9068
|
-
}, Ie = (d) => !d || !
|
|
9073
|
+
}, Ie = (d) => !d || !G ? !1 : Le(d, G), o = (d) => {
|
|
9069
9074
|
if (!d) return "none";
|
|
9070
9075
|
if (e === "range") {
|
|
9071
|
-
if (X &&
|
|
9076
|
+
if (X && Le(d, X))
|
|
9072
9077
|
return "start";
|
|
9073
9078
|
if (!X && Q.length === 2) {
|
|
9074
9079
|
const [D, x] = Q;
|
|
9075
|
-
if (
|
|
9080
|
+
if (Le(d, D) && Le(d, x))
|
|
9076
9081
|
return "single";
|
|
9077
|
-
if (
|
|
9078
|
-
if (
|
|
9082
|
+
if (Le(d, D)) return "start";
|
|
9083
|
+
if (Le(d, x)) return "end";
|
|
9079
9084
|
if (d > D && d < x) return "middle";
|
|
9080
9085
|
}
|
|
9081
9086
|
}
|
|
9082
9087
|
return "none";
|
|
9083
9088
|
}, y = (d) => {
|
|
9084
|
-
if (!d || !
|
|
9089
|
+
if (!d || !G) return "none";
|
|
9085
9090
|
if (e === "range") {
|
|
9086
9091
|
const D = X || (Q.length > 0 ? Q[0] : null);
|
|
9087
9092
|
if (D) {
|
|
9088
|
-
const [x, v] = D <=
|
|
9089
|
-
if (
|
|
9093
|
+
const [x, v] = D <= G ? [D, G] : [G, D];
|
|
9094
|
+
if (Le(d, x) && Le(d, v))
|
|
9090
9095
|
return "single";
|
|
9091
|
-
if (
|
|
9092
|
-
if (
|
|
9096
|
+
if (Le(d, x)) return "start";
|
|
9097
|
+
if (Le(d, v)) return "end";
|
|
9093
9098
|
if (d > x && d < v) return "middle";
|
|
9094
9099
|
}
|
|
9095
9100
|
}
|
|
@@ -9153,7 +9158,7 @@ function ks({
|
|
|
9153
9158
|
Ie,
|
|
9154
9159
|
C
|
|
9155
9160
|
]
|
|
9156
|
-
),
|
|
9161
|
+
), L = Fe(
|
|
9157
9162
|
() => ie($),
|
|
9158
9163
|
[$, ie]
|
|
9159
9164
|
), z = Fe(
|
|
@@ -9172,7 +9177,7 @@ function ks({
|
|
|
9172
9177
|
),
|
|
9173
9178
|
style: { width: ue },
|
|
9174
9179
|
children: [
|
|
9175
|
-
!_ && N && /* @__PURE__ */ w("label", { className: "ina-date-picker__label", htmlFor:
|
|
9180
|
+
!_ && N && /* @__PURE__ */ w("label", { className: "ina-date-picker__label", htmlFor: K.current, children: [
|
|
9176
9181
|
N,
|
|
9177
9182
|
k && /* @__PURE__ */ n("span", { className: "ina-date-picker__required", children: "*" })
|
|
9178
9183
|
] }),
|
|
@@ -9190,7 +9195,7 @@ function ks({
|
|
|
9190
9195
|
});
|
|
9191
9196
|
document.dispatchEvent(x);
|
|
9192
9197
|
}
|
|
9193
|
-
}),
|
|
9198
|
+
}), T(!f));
|
|
9194
9199
|
},
|
|
9195
9200
|
className: S(
|
|
9196
9201
|
"ina-date-picker__trigger",
|
|
@@ -9199,7 +9204,7 @@ function ks({
|
|
|
9199
9204
|
E && "ina-date-picker__trigger--readonly",
|
|
9200
9205
|
u
|
|
9201
9206
|
),
|
|
9202
|
-
id:
|
|
9207
|
+
id: K.current,
|
|
9203
9208
|
"aria-haspopup": "grid",
|
|
9204
9209
|
"aria-expanded": f,
|
|
9205
9210
|
style: { width: ue },
|
|
@@ -9231,7 +9236,7 @@ function ks({
|
|
|
9231
9236
|
onKeyDown: (d) => {
|
|
9232
9237
|
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), J());
|
|
9233
9238
|
},
|
|
9234
|
-
children: /* @__PURE__ */ n(
|
|
9239
|
+
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-date-picker__clear-icon" })
|
|
9235
9240
|
}
|
|
9236
9241
|
)
|
|
9237
9242
|
] }),
|
|
@@ -9242,7 +9247,7 @@ function ks({
|
|
|
9242
9247
|
className: S(
|
|
9243
9248
|
"ina-date-picker__panel",
|
|
9244
9249
|
`ina-date-picker__panel--${i.split("-")[0]}`,
|
|
9245
|
-
|
|
9250
|
+
W && !i.includes("left") && !i.includes("right") && "ina-date-picker__panel--right-aligned",
|
|
9246
9251
|
h
|
|
9247
9252
|
),
|
|
9248
9253
|
style: {
|
|
@@ -9351,8 +9356,8 @@ function ks({
|
|
|
9351
9356
|
},
|
|
9352
9357
|
d
|
|
9353
9358
|
)),
|
|
9354
|
-
|
|
9355
|
-
const x = R(d), v = x.isSelected || !
|
|
9359
|
+
L.map((d, D) => {
|
|
9360
|
+
const x = R(d), v = x.isSelected || !L.some((g) => ke(g.date)) && d.isToday || !L.some((g) => ke(g.date)) && !L.some((g) => g.isToday) && D === 15;
|
|
9356
9361
|
return /* @__PURE__ */ n(
|
|
9357
9362
|
"button",
|
|
9358
9363
|
{
|
|
@@ -9385,8 +9390,8 @@ function ks({
|
|
|
9385
9390
|
}
|
|
9386
9391
|
}
|
|
9387
9392
|
},
|
|
9388
|
-
onMouseEnter: () => !x.isDisabled &&
|
|
9389
|
-
onMouseLeave: () =>
|
|
9393
|
+
onMouseEnter: () => !x.isDisabled && O(d.date),
|
|
9394
|
+
onMouseLeave: () => O(null),
|
|
9390
9395
|
disabled: x.isDisabled,
|
|
9391
9396
|
className: S(
|
|
9392
9397
|
x.className,
|
|
@@ -9505,8 +9510,8 @@ function ks({
|
|
|
9505
9510
|
}
|
|
9506
9511
|
}
|
|
9507
9512
|
},
|
|
9508
|
-
onMouseEnter: () => !x.isDisabled &&
|
|
9509
|
-
onMouseLeave: () =>
|
|
9513
|
+
onMouseEnter: () => !x.isDisabled && O(d.date),
|
|
9514
|
+
onMouseLeave: () => O(null),
|
|
9510
9515
|
disabled: x.isDisabled,
|
|
9511
9516
|
className: x.className + (!x.isSelected && !x.isInRange && !x.isHovered && !x.isHoveredEnd && !x.isDisabled ? " ina-date-picker__day--hover" : ""),
|
|
9512
9517
|
children: d.date.getDate()
|
|
@@ -9619,9 +9624,9 @@ function Cs({
|
|
|
9619
9624
|
...m
|
|
9620
9625
|
}) {
|
|
9621
9626
|
const p = e !== void 0, [I, A] = Z(a), E = p ? e : I, F = me(
|
|
9622
|
-
(
|
|
9627
|
+
(T) => {
|
|
9623
9628
|
if (t) return;
|
|
9624
|
-
const $ =
|
|
9629
|
+
const $ = T.target.checked;
|
|
9625
9630
|
p || A($), i && i($);
|
|
9626
9631
|
},
|
|
9627
9632
|
[t, i, p]
|
|
@@ -9711,11 +9716,11 @@ function Ms({
|
|
|
9711
9716
|
u
|
|
9712
9717
|
);
|
|
9713
9718
|
return /* @__PURE__ */ n("div", { className: F, children: /* @__PURE__ */ n("div", { className: N, role: "tablist", children: e.map((_, f) => {
|
|
9714
|
-
const
|
|
9719
|
+
const T = I === _.value, $ = b || _.disabled, Y = S(
|
|
9715
9720
|
"ina-tab-horizontal__tab",
|
|
9716
9721
|
`ina-tab-horizontal__tab--size-${i}`,
|
|
9717
9722
|
`ina-tab-horizontal__tab--variant-${s}`,
|
|
9718
|
-
|
|
9723
|
+
T && "ina-tab-horizontal__tab--selected",
|
|
9719
9724
|
$ && "ina-tab-horizontal__tab--disabled",
|
|
9720
9725
|
l && "ina-tab-horizontal__tab--full-width",
|
|
9721
9726
|
M
|
|
@@ -9726,14 +9731,14 @@ function Ms({
|
|
|
9726
9731
|
ref: (B) => A.current[f] = B,
|
|
9727
9732
|
type: "button",
|
|
9728
9733
|
role: "tab",
|
|
9729
|
-
"aria-selected":
|
|
9734
|
+
"aria-selected": T,
|
|
9730
9735
|
"aria-disabled": $,
|
|
9731
9736
|
disabled: $,
|
|
9732
|
-
tabIndex:
|
|
9733
|
-
className:
|
|
9737
|
+
tabIndex: T ? 0 : -1,
|
|
9738
|
+
className: Y,
|
|
9734
9739
|
onClick: () => E(_.value, _.disabled),
|
|
9735
9740
|
onKeyDown: (B) => {
|
|
9736
|
-
var
|
|
9741
|
+
var G, O;
|
|
9737
9742
|
if ($) return;
|
|
9738
9743
|
let V;
|
|
9739
9744
|
if (B.key === "Enter" || B.key === " ")
|
|
@@ -9741,11 +9746,11 @@ function Ms({
|
|
|
9741
9746
|
else if (B.key === "ArrowRight") {
|
|
9742
9747
|
for (B.preventDefault(), V = (f + 1) % e.length; e[V].disabled && V !== f; )
|
|
9743
9748
|
V = (V + 1) % e.length;
|
|
9744
|
-
(
|
|
9749
|
+
(G = A.current[V]) == null || G.focus();
|
|
9745
9750
|
} else if (B.key === "ArrowLeft") {
|
|
9746
9751
|
for (B.preventDefault(), V = (f - 1 + e.length) % e.length; e[V].disabled && V !== f; )
|
|
9747
9752
|
V = (V - 1 + e.length) % e.length;
|
|
9748
|
-
(
|
|
9753
|
+
(O = A.current[V]) == null || O.focus();
|
|
9749
9754
|
}
|
|
9750
9755
|
},
|
|
9751
9756
|
children: _.label
|
|
@@ -9772,8 +9777,8 @@ function xs({
|
|
|
9772
9777
|
const [m, p] = Z(
|
|
9773
9778
|
t || ((_ = e[0]) == null ? void 0 : _.value) || ""
|
|
9774
9779
|
), I = a !== void 0 ? a : m, A = le([]), E = me(
|
|
9775
|
-
(f,
|
|
9776
|
-
c ||
|
|
9780
|
+
(f, T) => {
|
|
9781
|
+
c || T || (a === void 0 && p(f), r == null || r(f));
|
|
9777
9782
|
},
|
|
9778
9783
|
[c, a, r]
|
|
9779
9784
|
), F = S(
|
|
@@ -9789,41 +9794,41 @@ function xs({
|
|
|
9789
9794
|
), k = {
|
|
9790
9795
|
width: typeof M == "number" ? `${M}px` : M
|
|
9791
9796
|
};
|
|
9792
|
-
return /* @__PURE__ */ n("div", { className: F, style: k, children: /* @__PURE__ */ n("div", { className: N, role: "tablist", children: e.map((f,
|
|
9793
|
-
const $ = I === f.value,
|
|
9797
|
+
return /* @__PURE__ */ n("div", { className: F, style: k, children: /* @__PURE__ */ n("div", { className: N, role: "tablist", children: e.map((f, T) => {
|
|
9798
|
+
const $ = I === f.value, Y = c || f.disabled, B = S(
|
|
9794
9799
|
"ina-tab-vertical__tab",
|
|
9795
9800
|
`ina-tab-vertical__tab--size-${i}`,
|
|
9796
9801
|
`ina-tab-vertical__tab--variant-${s}`,
|
|
9797
9802
|
$ && "ina-tab-vertical__tab--selected",
|
|
9798
|
-
|
|
9803
|
+
Y && "ina-tab-vertical__tab--disabled",
|
|
9799
9804
|
u
|
|
9800
9805
|
);
|
|
9801
9806
|
return /* @__PURE__ */ n(
|
|
9802
9807
|
"button",
|
|
9803
9808
|
{
|
|
9804
|
-
ref: (V) => A.current[
|
|
9809
|
+
ref: (V) => A.current[T] = V,
|
|
9805
9810
|
type: "button",
|
|
9806
9811
|
role: "tab",
|
|
9807
9812
|
"aria-selected": $,
|
|
9808
|
-
"aria-disabled":
|
|
9809
|
-
disabled:
|
|
9813
|
+
"aria-disabled": Y,
|
|
9814
|
+
disabled: Y,
|
|
9810
9815
|
tabIndex: $ ? 0 : -1,
|
|
9811
9816
|
className: B,
|
|
9812
9817
|
onClick: () => E(f.value, f.disabled),
|
|
9813
9818
|
onKeyDown: (V) => {
|
|
9814
|
-
var
|
|
9815
|
-
if (
|
|
9816
|
-
let
|
|
9819
|
+
var O, W;
|
|
9820
|
+
if (Y) return;
|
|
9821
|
+
let G;
|
|
9817
9822
|
if (V.key === "Enter" || V.key === " ")
|
|
9818
9823
|
V.preventDefault(), E(f.value, f.disabled);
|
|
9819
9824
|
else if (V.key === "ArrowDown") {
|
|
9820
|
-
for (V.preventDefault(),
|
|
9821
|
-
|
|
9822
|
-
(
|
|
9825
|
+
for (V.preventDefault(), G = (T + 1) % e.length; e[G].disabled && G !== T; )
|
|
9826
|
+
G = (G + 1) % e.length;
|
|
9827
|
+
(O = A.current[G]) == null || O.focus();
|
|
9823
9828
|
} else if (V.key === "ArrowUp") {
|
|
9824
|
-
for (V.preventDefault(),
|
|
9825
|
-
|
|
9826
|
-
(
|
|
9829
|
+
for (V.preventDefault(), G = (T - 1 + e.length) % e.length; e[G].disabled && G !== T; )
|
|
9830
|
+
G = (G - 1 + e.length) % e.length;
|
|
9831
|
+
(W = A.current[G]) == null || W.focus();
|
|
9827
9832
|
}
|
|
9828
9833
|
},
|
|
9829
9834
|
children: f.label
|
|
@@ -9905,7 +9910,7 @@ function dr(e, a) {
|
|
|
9905
9910
|
function Vs() {
|
|
9906
9911
|
Ga("default");
|
|
9907
9912
|
}
|
|
9908
|
-
function
|
|
9913
|
+
function Ts(e) {
|
|
9909
9914
|
return gt.includes(e);
|
|
9910
9915
|
}
|
|
9911
9916
|
typeof window < "u" && dr();
|
|
@@ -9916,8 +9921,8 @@ export {
|
|
|
9916
9921
|
Ar as AccordionGroup,
|
|
9917
9922
|
Ya as ActionDropdown,
|
|
9918
9923
|
Vr as Alert,
|
|
9919
|
-
|
|
9920
|
-
|
|
9924
|
+
Tr as Avatar,
|
|
9925
|
+
Lr as Badge,
|
|
9921
9926
|
Gr as BasicDropdown,
|
|
9922
9927
|
Fr as BottomSheet,
|
|
9923
9928
|
Rr as Breadcrumb,
|
|
@@ -9972,7 +9977,7 @@ export {
|
|
|
9972
9977
|
us as TextArea,
|
|
9973
9978
|
An as TextField,
|
|
9974
9979
|
ms as ThemeToggle,
|
|
9975
|
-
|
|
9980
|
+
Tn as TimePicker,
|
|
9976
9981
|
$n as Toast,
|
|
9977
9982
|
Ea as ToastContext,
|
|
9978
9983
|
ys as ToastProvider,
|
|
@@ -9998,7 +10003,7 @@ export {
|
|
|
9998
10003
|
vr as inakuColorTokens,
|
|
9999
10004
|
gr as inapasColorTokens,
|
|
10000
10005
|
dr as initializeTheme,
|
|
10001
|
-
|
|
10006
|
+
Ts as isValidBrand,
|
|
10002
10007
|
br as lanColorTokens,
|
|
10003
10008
|
gn as onlyAlphanumeric,
|
|
10004
10009
|
qr as onlyDecimalNumber,
|