@idds/react 1.5.70 → 1.5.71
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 +8 -8
- package/dist/index.css +1 -1
- package/dist/index.es.js +712 -705
- package/dist/types/components/Chip.d.ts +2 -0
- package/dist/types/components/Chip.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -604,24 +604,24 @@ function Dr(e) {
|
|
|
604
604
|
const E = fe(
|
|
605
605
|
(N, g) => {
|
|
606
606
|
const m = y.current.size;
|
|
607
|
-
return y.current.set(N, m), g && p((
|
|
607
|
+
return y.current.set(N, m), g && p((F) => c ? F.includes(m) ? F : [...F, m] : F.length === 0 ? [m] : F), m;
|
|
608
608
|
},
|
|
609
609
|
[c]
|
|
610
610
|
), A = fe((N) => {
|
|
611
611
|
const g = y.current.get(N);
|
|
612
612
|
if (g !== void 0) {
|
|
613
|
-
y.current.delete(N), p((
|
|
613
|
+
y.current.delete(N), p((T) => T.filter((P) => P !== g).map((P) => P > g ? P - 1 : P));
|
|
614
614
|
const m = /* @__PURE__ */ new Map();
|
|
615
|
-
let
|
|
616
|
-
y.current.forEach((
|
|
617
|
-
m.set(U,
|
|
615
|
+
let F = 0;
|
|
616
|
+
y.current.forEach((T, U) => {
|
|
617
|
+
m.set(U, F), F++;
|
|
618
618
|
}), y.current = m;
|
|
619
619
|
}
|
|
620
620
|
}, []), S = fe(
|
|
621
621
|
(N, g) => {
|
|
622
622
|
p((m) => {
|
|
623
|
-
let
|
|
624
|
-
return c ? g ? m.includes(N) ?
|
|
623
|
+
let F;
|
|
624
|
+
return c ? g ? m.includes(N) ? F = m : F = [...m, N] : F = m.filter((T) => T !== N) : g ? F = [N] : F = [], h((T) => T + 1), s == null || s(F), F;
|
|
625
625
|
});
|
|
626
626
|
},
|
|
627
627
|
[c, s]
|
|
@@ -661,17 +661,17 @@ function Sr(e) {
|
|
|
661
661
|
const { registerItem: S, unregisterItem: L } = p || {};
|
|
662
662
|
ne(() => {
|
|
663
663
|
if (S) {
|
|
664
|
-
const
|
|
665
|
-
E(
|
|
664
|
+
const P = S(h.current, A.current);
|
|
665
|
+
E(P);
|
|
666
666
|
}
|
|
667
667
|
return () => {
|
|
668
668
|
L && (L(h.current), E(-1));
|
|
669
669
|
};
|
|
670
670
|
}, [S, L]);
|
|
671
|
-
const M = p !== null, N = s !== void 0 || M, g = $e(() => M && u >= 0 && p ? p.isItemOpen(u) : s !== void 0 ? s : y, [M, u, p, s, y]), m = $e(() => `accordion-header-${h.current}`, []),
|
|
671
|
+
const M = p !== null, N = s !== void 0 || M, g = $e(() => M && u >= 0 && p ? p.isItemOpen(u) : s !== void 0 ? s : y, [M, u, p, s, y]), m = $e(() => `accordion-header-${h.current}`, []), F = $e(() => `accordion-content-${h.current}`, []), T = () => {
|
|
672
672
|
if (l) return;
|
|
673
|
-
const
|
|
674
|
-
M && u >= 0 && p ? p.handleItemToggle(u,
|
|
673
|
+
const P = !g;
|
|
674
|
+
M && u >= 0 && p ? p.handleItemToggle(u, P) : N || v(P), i == null || i(P);
|
|
675
675
|
}, U = I("ina-accordion", c, {
|
|
676
676
|
"ina-accordion--disabled": l,
|
|
677
677
|
"ina-accordion--open": g
|
|
@@ -682,10 +682,10 @@ function Sr(e) {
|
|
|
682
682
|
{
|
|
683
683
|
type: "button",
|
|
684
684
|
id: m,
|
|
685
|
-
onClick:
|
|
685
|
+
onClick: T,
|
|
686
686
|
className: "ina-accordion__toggle",
|
|
687
687
|
"aria-expanded": g,
|
|
688
|
-
"aria-controls":
|
|
688
|
+
"aria-controls": F,
|
|
689
689
|
disabled: l,
|
|
690
690
|
children: [
|
|
691
691
|
/* @__PURE__ */ n("div", { className: "ina-accordion__title", children: a }),
|
|
@@ -716,7 +716,7 @@ function Sr(e) {
|
|
|
716
716
|
/* @__PURE__ */ n(
|
|
717
717
|
"div",
|
|
718
718
|
{
|
|
719
|
-
id:
|
|
719
|
+
id: F,
|
|
720
720
|
className: I("ina-accordion__content", {
|
|
721
721
|
"ina-accordion__content--open": g
|
|
722
722
|
}),
|
|
@@ -1543,53 +1543,53 @@ function Xa(e, a, t, r) {
|
|
|
1543
1543
|
var S = typeof window < "u", L = !a && a !== 0 && S;
|
|
1544
1544
|
if (typeof e != "function") throw new TypeError("Expected a function");
|
|
1545
1545
|
a = +a || 0;
|
|
1546
|
-
var M = !!(t = t || {}).leading, N = !("trailing" in t) || !!t.trailing, g = !!t.flushOnExit && N, m = "maxWait" in t,
|
|
1547
|
-
var
|
|
1548
|
-
var W = v.current,
|
|
1549
|
-
return v.current = p.current = null, l.current =
|
|
1550
|
-
}, O = function(
|
|
1551
|
-
L && cancelAnimationFrame(y.current), y.current = L ? requestAnimationFrame(
|
|
1552
|
-
}, ee = function(
|
|
1546
|
+
var M = !!(t = t || {}).leading, N = !("trailing" in t) || !!t.trailing, g = !!t.flushOnExit && N, m = "maxWait" in t, F = "debounceOnServer" in t && !!t.debounceOnServer, T = m ? Math.max(+t.maxWait || 0, a) : null, U = $e(function() {
|
|
1547
|
+
var P = function(Z) {
|
|
1548
|
+
var W = v.current, R = p.current;
|
|
1549
|
+
return v.current = p.current = null, l.current = Z, c.current = c.current || Z, C.current = h.current.apply(R, W);
|
|
1550
|
+
}, O = function(Z, W) {
|
|
1551
|
+
L && cancelAnimationFrame(y.current), y.current = L ? requestAnimationFrame(Z) : setTimeout(Z, W);
|
|
1552
|
+
}, ee = function(Z) {
|
|
1553
1553
|
if (!u.current) return !1;
|
|
1554
|
-
var W =
|
|
1555
|
-
return !i.current || W >= a || W < 0 || m &&
|
|
1556
|
-
}, j = function(
|
|
1557
|
-
return y.current = null, N && v.current ?
|
|
1558
|
-
},
|
|
1554
|
+
var W = Z - i.current;
|
|
1555
|
+
return !i.current || W >= a || W < 0 || m && Z - l.current >= T;
|
|
1556
|
+
}, j = function(Z) {
|
|
1557
|
+
return y.current = null, N && v.current ? P(Z) : (v.current = p.current = null, C.current);
|
|
1558
|
+
}, J = function Z() {
|
|
1559
1559
|
var W = Date.now();
|
|
1560
1560
|
if (M && c.current === l.current && ce(), ee(W)) return j(W);
|
|
1561
1561
|
if (u.current) {
|
|
1562
|
-
var
|
|
1563
|
-
O(
|
|
1562
|
+
var R = a - (W - i.current), K = m ? Math.min(R, T - (W - l.current)) : R;
|
|
1563
|
+
O(Z, K);
|
|
1564
1564
|
}
|
|
1565
1565
|
}, ce = function() {
|
|
1566
1566
|
r && r({});
|
|
1567
1567
|
}, oe = function() {
|
|
1568
|
-
if (S ||
|
|
1569
|
-
var
|
|
1568
|
+
if (S || F) {
|
|
1569
|
+
var Z, W = Date.now(), R = ee(W);
|
|
1570
1570
|
if (v.current = [].slice.call(arguments), p.current = s, i.current = W, g && !E.current && (E.current = function() {
|
|
1571
1571
|
var K;
|
|
1572
1572
|
((K = global.document) == null ? void 0 : K.visibilityState) === "hidden" && A.current.flush();
|
|
1573
|
-
}, (
|
|
1574
|
-
if (!y.current && u.current) return l.current = i.current, O(
|
|
1575
|
-
if (m) return O(
|
|
1573
|
+
}, (Z = global.document) == null || Z.addEventListener == null || Z.addEventListener("visibilitychange", E.current)), R) {
|
|
1574
|
+
if (!y.current && u.current) return l.current = i.current, O(J, a), M ? P(i.current) : C.current;
|
|
1575
|
+
if (m) return O(J, a), P(i.current);
|
|
1576
1576
|
}
|
|
1577
|
-
return y.current || O(
|
|
1577
|
+
return y.current || O(J, a), C.current;
|
|
1578
1578
|
}
|
|
1579
1579
|
};
|
|
1580
1580
|
return oe.cancel = function() {
|
|
1581
|
-
var
|
|
1582
|
-
|
|
1581
|
+
var Z = y.current;
|
|
1582
|
+
Z && (L ? cancelAnimationFrame(y.current) : clearTimeout(y.current)), l.current = 0, v.current = i.current = p.current = y.current = null, Z && r && r({});
|
|
1583
1583
|
}, oe.isPending = function() {
|
|
1584
1584
|
return !!y.current;
|
|
1585
1585
|
}, oe.flush = function() {
|
|
1586
1586
|
return y.current ? j(Date.now()) : C.current;
|
|
1587
1587
|
}, oe;
|
|
1588
|
-
}, [M, m, a,
|
|
1588
|
+
}, [M, m, a, T, N, g, L, S, F, r]);
|
|
1589
1589
|
return A.current = U, ne(function() {
|
|
1590
1590
|
return u.current = !0, function() {
|
|
1591
|
-
var
|
|
1592
|
-
g && A.current.flush(), E.current && ((
|
|
1591
|
+
var P;
|
|
1592
|
+
g && A.current.flush(), E.current && ((P = global.document) == null || P.removeEventListener == null || P.removeEventListener("visibilitychange", E.current), E.current = null), u.current = !1;
|
|
1593
1593
|
};
|
|
1594
1594
|
}, [g]), U;
|
|
1595
1595
|
}
|
|
@@ -1801,32 +1801,32 @@ function Ca({
|
|
|
1801
1801
|
onBlur: g,
|
|
1802
1802
|
...m
|
|
1803
1803
|
}) {
|
|
1804
|
-
const
|
|
1804
|
+
const F = () => N != null && N.enableXssProtection ? Xe(e).sanitized : e, [T, U] = Y(F()), [P] = pt(T, r), O = re(!0);
|
|
1805
1805
|
ne(() => {
|
|
1806
1806
|
let W = e;
|
|
1807
1807
|
if (N != null && N.enableXssProtection) {
|
|
1808
|
-
const
|
|
1809
|
-
|
|
1808
|
+
const R = Xe(e);
|
|
1809
|
+
R.isValid || (N.logViolations && console.warn(
|
|
1810
1810
|
"TextField security violation on value change:",
|
|
1811
|
-
|
|
1812
|
-
), N.onSecurityViolation && N.onSecurityViolation(
|
|
1811
|
+
R.threats
|
|
1812
|
+
), N.onSecurityViolation && N.onSecurityViolation(R.threats, e), W = R.sanitized);
|
|
1813
1813
|
}
|
|
1814
1814
|
U(W);
|
|
1815
1815
|
}, [e, N]), ne(() => {
|
|
1816
|
-
O.current ? O.current = !1 : r > 0 && s && s(
|
|
1817
|
-
}, [
|
|
1816
|
+
O.current ? O.current = !1 : r > 0 && s && s(P);
|
|
1817
|
+
}, [P, r, s]);
|
|
1818
1818
|
const ee = (W) => {
|
|
1819
|
-
let
|
|
1820
|
-
if (!(h != null &&
|
|
1819
|
+
let R = W.target.value;
|
|
1820
|
+
if (!(h != null && R.length > h)) {
|
|
1821
1821
|
if (N != null && N.enableXssProtection) {
|
|
1822
|
-
const K = Xe(
|
|
1823
|
-
K.isValid || (N.logViolations && console.warn("TextField security violation:", K.threats), N.onSecurityViolation && N.onSecurityViolation(K.threats,
|
|
1822
|
+
const K = Xe(R);
|
|
1823
|
+
K.isValid || (N.logViolations && console.warn("TextField security violation:", K.threats), N.onSecurityViolation && N.onSecurityViolation(K.threats, R), R = K.sanitized);
|
|
1824
1824
|
}
|
|
1825
|
-
U(
|
|
1825
|
+
U(R), a(R), t == null || t(W);
|
|
1826
1826
|
}
|
|
1827
1827
|
}, j = (W) => {
|
|
1828
1828
|
g == null || g(W);
|
|
1829
|
-
},
|
|
1829
|
+
}, J = () => {
|
|
1830
1830
|
U(""), a(""), s && s(""), A == null || A();
|
|
1831
1831
|
}, ce = I(
|
|
1832
1832
|
"ina-text-field__wrapper",
|
|
@@ -1836,7 +1836,7 @@ function Ca({
|
|
|
1836
1836
|
), oe = I(
|
|
1837
1837
|
"ina-text-field__helper-text",
|
|
1838
1838
|
`ina-text-field__helper-text--${v}`
|
|
1839
|
-
),
|
|
1839
|
+
), Z = v !== "neutral" && p != null ? p : y;
|
|
1840
1840
|
return /* @__PURE__ */ w("div", { className: "ina-text-field", children: [
|
|
1841
1841
|
c && /* @__PURE__ */ w(
|
|
1842
1842
|
"label",
|
|
@@ -1858,7 +1858,7 @@ function Ca({
|
|
|
1858
1858
|
id: m != null && m.id || m != null && m.name ? String((m == null ? void 0 : m.id) || (m == null ? void 0 : m.name)) : String(c).toLowerCase(),
|
|
1859
1859
|
type: m.type ?? "text",
|
|
1860
1860
|
className: I("ina-text-field__input", M),
|
|
1861
|
-
value:
|
|
1861
|
+
value: T,
|
|
1862
1862
|
onChange: ee,
|
|
1863
1863
|
onBlur: j,
|
|
1864
1864
|
placeholder: S,
|
|
@@ -1866,12 +1866,12 @@ function Ca({
|
|
|
1866
1866
|
maxLength: h
|
|
1867
1867
|
}
|
|
1868
1868
|
),
|
|
1869
|
-
E &&
|
|
1869
|
+
E && T !== "" && !L && /* @__PURE__ */ n(
|
|
1870
1870
|
"button",
|
|
1871
1871
|
{
|
|
1872
1872
|
type: "button",
|
|
1873
1873
|
className: "ina-text-field__clear-button",
|
|
1874
|
-
onClick:
|
|
1874
|
+
onClick: J,
|
|
1875
1875
|
"aria-label": "Clear input",
|
|
1876
1876
|
children: /* @__PURE__ */ n(Ve, { size: 16, className: "ina-text-field__clear-icon" })
|
|
1877
1877
|
}
|
|
@@ -1879,9 +1879,9 @@ function Ca({
|
|
|
1879
1879
|
l && /* @__PURE__ */ n("div", { className: "ina-text-field__suffix-icon", children: l })
|
|
1880
1880
|
] }),
|
|
1881
1881
|
/* @__PURE__ */ w("div", { className: "ina-text-field__bottom-area", children: [
|
|
1882
|
-
|
|
1882
|
+
Z && /* @__PURE__ */ n("div", { className: oe, children: Z }),
|
|
1883
1883
|
u && h != null && /* @__PURE__ */ w("div", { className: "ina-text-field__char-count", children: [
|
|
1884
|
-
|
|
1884
|
+
T.length,
|
|
1885
1885
|
"/",
|
|
1886
1886
|
h
|
|
1887
1887
|
] })
|
|
@@ -1901,15 +1901,15 @@ function Pr({
|
|
|
1901
1901
|
className: v = ""
|
|
1902
1902
|
}) {
|
|
1903
1903
|
const p = Array.isArray(a) ? a : a ? [a] : [], C = p.filter(
|
|
1904
|
-
(
|
|
1904
|
+
(P) => !e.some((O) => O.value === P) && P !== ""
|
|
1905
1905
|
), h = C.length > 0, u = C[C.length - 1] || "", [E, A] = Y(!1), [S, L] = Y(u), M = () => {
|
|
1906
1906
|
if (p.length > 0) {
|
|
1907
1907
|
if (h && l)
|
|
1908
1908
|
return e.length;
|
|
1909
|
-
const
|
|
1909
|
+
const P = e.findIndex(
|
|
1910
1910
|
(O) => O.value === p[0]
|
|
1911
1911
|
);
|
|
1912
|
-
if (
|
|
1912
|
+
if (P !== -1) return P;
|
|
1913
1913
|
}
|
|
1914
1914
|
return 0;
|
|
1915
1915
|
}, [N, g] = Y(M()), m = re([]);
|
|
@@ -1918,61 +1918,68 @@ function Pr({
|
|
|
1918
1918
|
}, [a, e, h]), ne(() => {
|
|
1919
1919
|
h ? L(u) : (A(!1), L(""));
|
|
1920
1920
|
}, [a, h]);
|
|
1921
|
-
const
|
|
1922
|
-
if (
|
|
1921
|
+
const F = (P) => {
|
|
1922
|
+
if (P)
|
|
1923
1923
|
if (t) {
|
|
1924
1924
|
let O;
|
|
1925
|
-
p.includes(
|
|
1925
|
+
p.includes(P) ? O = p.filter((ee) => ee !== P) : O = [...p, P], i == null || i(O);
|
|
1926
1926
|
} else
|
|
1927
|
-
i == null || i(
|
|
1928
|
-
},
|
|
1927
|
+
p.includes(P) ? i == null || i("") : i == null || i(P);
|
|
1928
|
+
}, T = l ? [...e, { label: c, value: c }] : e, U = I("ina-chip", v);
|
|
1929
1929
|
return /* @__PURE__ */ w("div", { className: U, children: [
|
|
1930
|
-
/* @__PURE__ */ n("div", { className: "ina-chip__list", children:
|
|
1931
|
-
const ee = l &&
|
|
1930
|
+
/* @__PURE__ */ n("div", { className: "ina-chip__list", children: T.map((P, O) => {
|
|
1931
|
+
const ee = l && P.label === c, j = ee ? h : p.includes(P.value);
|
|
1932
1932
|
return /* @__PURE__ */ n(
|
|
1933
1933
|
"button",
|
|
1934
1934
|
{
|
|
1935
|
-
ref: (
|
|
1935
|
+
ref: (J) => m.current[O] = J,
|
|
1936
1936
|
type: "button",
|
|
1937
|
-
tabIndex: O === N ? 0 : -1,
|
|
1937
|
+
tabIndex: O === N && !P.disabled ? 0 : -1,
|
|
1938
|
+
disabled: P.disabled,
|
|
1938
1939
|
onClick: () => {
|
|
1939
|
-
ee ? (A(!0), L(u)) :
|
|
1940
|
+
P.disabled || (g(O), ee ? (A(!0), L(u)) : F(P.value));
|
|
1940
1941
|
},
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1942
|
+
onKeyDown: (J) => {
|
|
1943
|
+
var ce, oe, Z, W;
|
|
1944
|
+
if (!P.disabled) {
|
|
1945
|
+
if (J.key === "ArrowRight" || J.key === "ArrowDown") {
|
|
1946
|
+
J.preventDefault();
|
|
1947
|
+
let R = (O + 1) % T.length;
|
|
1948
|
+
for (; (ce = T[R]) != null && ce.disabled && R !== O; )
|
|
1949
|
+
R = (R + 1) % T.length;
|
|
1950
|
+
g(R), (oe = m.current[R]) == null || oe.focus();
|
|
1951
|
+
} else if (J.key === "ArrowLeft" || J.key === "ArrowUp") {
|
|
1952
|
+
J.preventDefault();
|
|
1953
|
+
let R = (O - 1 + T.length) % T.length;
|
|
1954
|
+
for (; (Z = T[R]) != null && Z.disabled && R !== O; )
|
|
1955
|
+
R = (R - 1 + T.length) % T.length;
|
|
1956
|
+
g(R), (W = m.current[R]) == null || W.focus();
|
|
1957
|
+
}
|
|
1958
|
+
J.key === " " && (J.preventDefault(), ee ? (A(!0), L(u)) : F(P.value));
|
|
1952
1959
|
}
|
|
1953
|
-
Z.key === " " && (Z.preventDefault(), ee ? (A(!0), L(u)) : T(H.value));
|
|
1954
1960
|
},
|
|
1955
1961
|
className: I(
|
|
1956
1962
|
"ina-chip__item",
|
|
1957
1963
|
`ina-chip__item--size-${r}`,
|
|
1958
1964
|
`ina-chip__item--variant-${s}`,
|
|
1959
|
-
j && "ina-chip__item--selected"
|
|
1965
|
+
j && "ina-chip__item--selected",
|
|
1966
|
+
P.disabled && "ina-chip__item--disabled"
|
|
1960
1967
|
),
|
|
1961
|
-
children:
|
|
1968
|
+
children: P.label
|
|
1962
1969
|
},
|
|
1963
|
-
`${
|
|
1970
|
+
`${P.label}-${O}`
|
|
1964
1971
|
);
|
|
1965
1972
|
}) }),
|
|
1966
1973
|
l && E && /* @__PURE__ */ n("div", { className: "ina-chip__custom-field", children: y ?? /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
1967
1974
|
Ca,
|
|
1968
1975
|
{
|
|
1969
1976
|
value: S,
|
|
1970
|
-
onChange: (
|
|
1977
|
+
onChange: (P) => L(P),
|
|
1971
1978
|
onBlur: () => {
|
|
1972
|
-
S.trim() !== "" &&
|
|
1979
|
+
S.trim() !== "" && F(S.trim()), A(!1);
|
|
1973
1980
|
},
|
|
1974
|
-
onKeyDown: (
|
|
1975
|
-
|
|
1981
|
+
onKeyDown: (P) => {
|
|
1982
|
+
P.key === "Enter" && (S.trim() !== "" && F(S.trim()), A(!1), P.target.blur());
|
|
1976
1983
|
},
|
|
1977
1984
|
showClearButton: !1,
|
|
1978
1985
|
className: "ina-chip__input",
|
|
@@ -2060,13 +2067,13 @@ function Gr({
|
|
|
2060
2067
|
v || (m.key === "Enter" || m.key === " ") && (m.preventDefault(), L(!u));
|
|
2061
2068
|
};
|
|
2062
2069
|
ne(() => {
|
|
2063
|
-
const m = (
|
|
2064
|
-
E.current && !E.current.contains(
|
|
2065
|
-
},
|
|
2066
|
-
|
|
2070
|
+
const m = (T) => {
|
|
2071
|
+
E.current && !E.current.contains(T.target) && u && L(!1);
|
|
2072
|
+
}, F = (T) => {
|
|
2073
|
+
T.key === "Escape" && u && L(!1);
|
|
2067
2074
|
};
|
|
2068
|
-
return document.addEventListener("mousedown", m), document.addEventListener("touchstart", m), document.addEventListener("keydown",
|
|
2069
|
-
document.removeEventListener("mousedown", m), document.removeEventListener("touchstart", m), document.removeEventListener("keydown",
|
|
2075
|
+
return document.addEventListener("mousedown", m), document.addEventListener("touchstart", m), document.addEventListener("keydown", F), () => {
|
|
2076
|
+
document.removeEventListener("mousedown", m), document.removeEventListener("touchstart", m), document.removeEventListener("keydown", F);
|
|
2070
2077
|
};
|
|
2071
2078
|
}, [u, s]);
|
|
2072
2079
|
const g = typeof e == "string" || typeof e == "number";
|
|
@@ -2433,55 +2440,55 @@ function Ur({
|
|
|
2433
2440
|
onRemove: u,
|
|
2434
2441
|
...E
|
|
2435
2442
|
}) {
|
|
2436
|
-
const A = re(null), [S, L] = Y([]), [M, N] = Y(!1), [g, m] = Y([]), [
|
|
2437
|
-
var
|
|
2438
|
-
p || (
|
|
2439
|
-
}, [p]),
|
|
2440
|
-
async (
|
|
2443
|
+
const A = re(null), [S, L] = Y([]), [M, N] = Y(!1), [g, m] = Y([]), [F, T] = Y(!1), U = fe(() => {
|
|
2444
|
+
var R;
|
|
2445
|
+
p || (R = A.current) == null || R.click();
|
|
2446
|
+
}, [p]), P = fe(
|
|
2447
|
+
async (R) => {
|
|
2441
2448
|
const K = [], G = [], X = [];
|
|
2442
2449
|
if (s && c) {
|
|
2443
|
-
const
|
|
2444
|
-
if (
|
|
2445
|
-
const se = c -
|
|
2450
|
+
const $ = S.length;
|
|
2451
|
+
if ($ + R.length > c) {
|
|
2452
|
+
const se = c - $;
|
|
2446
2453
|
if (se <= 0) {
|
|
2447
2454
|
X.push({
|
|
2448
2455
|
isValid: !1,
|
|
2449
2456
|
error: `Maksimal ${c} file yang dapat diupload`,
|
|
2450
|
-
file:
|
|
2457
|
+
file: R[0]
|
|
2451
2458
|
}), m(X), h == null || h([], X);
|
|
2452
2459
|
return;
|
|
2453
2460
|
}
|
|
2454
|
-
|
|
2461
|
+
R = R.slice(0, se);
|
|
2455
2462
|
}
|
|
2456
2463
|
}
|
|
2457
2464
|
if (s && y) {
|
|
2458
|
-
const
|
|
2459
|
-
if (
|
|
2465
|
+
const $ = S.reduce((me, ye) => me + ye.file.size, 0), se = R.reduce((me, ye) => me + ye.size, 0), ve = y * 1024 * 1024;
|
|
2466
|
+
if ($ + se > ve) {
|
|
2460
2467
|
X.push({
|
|
2461
2468
|
isValid: !1,
|
|
2462
2469
|
error: `Ukuran total file maksimal ${y} MB`,
|
|
2463
|
-
file:
|
|
2470
|
+
file: R[0]
|
|
2464
2471
|
}), m(X), h == null || h([], X);
|
|
2465
2472
|
return;
|
|
2466
2473
|
}
|
|
2467
2474
|
}
|
|
2468
|
-
for (const
|
|
2475
|
+
for (const $ of R) {
|
|
2469
2476
|
if (l && l.length > 0) {
|
|
2470
|
-
const ve =
|
|
2477
|
+
const ve = $.name.toLowerCase(), me = ve.substring(ve.lastIndexOf(".") + 1);
|
|
2471
2478
|
if (!l.includes(me.toLowerCase())) {
|
|
2472
2479
|
X.push({
|
|
2473
2480
|
isValid: !1,
|
|
2474
2481
|
error: `Ekstensi file harus: ${l.join(", ")}`,
|
|
2475
|
-
file:
|
|
2482
|
+
file: $
|
|
2476
2483
|
}), K.push({
|
|
2477
2484
|
isValid: !1,
|
|
2478
2485
|
error: `Ekstensi file harus: ${l.join(", ")}`,
|
|
2479
|
-
file:
|
|
2486
|
+
file: $
|
|
2480
2487
|
});
|
|
2481
2488
|
continue;
|
|
2482
2489
|
}
|
|
2483
2490
|
}
|
|
2484
|
-
const se = Nt(
|
|
2491
|
+
const se = Nt($, {
|
|
2485
2492
|
allowedTypes: r || void 0,
|
|
2486
2493
|
maxSize: i || void 0,
|
|
2487
2494
|
validateExtension: !0
|
|
@@ -2490,35 +2497,35 @@ function Ur({
|
|
|
2490
2497
|
X.push(se), K.push(se);
|
|
2491
2498
|
continue;
|
|
2492
2499
|
}
|
|
2493
|
-
if (v &&
|
|
2500
|
+
if (v && $.type) {
|
|
2494
2501
|
const ve = await Ct(
|
|
2495
|
-
|
|
2496
|
-
|
|
2502
|
+
$,
|
|
2503
|
+
$.type
|
|
2497
2504
|
);
|
|
2498
2505
|
if (!ve.isValid) {
|
|
2499
2506
|
X.push({
|
|
2500
2507
|
isValid: !1,
|
|
2501
2508
|
error: ve.error || "File signature tidak valid",
|
|
2502
|
-
file:
|
|
2509
|
+
file: $
|
|
2503
2510
|
}), K.push({
|
|
2504
2511
|
isValid: !1,
|
|
2505
2512
|
error: ve.error || "File signature tidak valid",
|
|
2506
|
-
file:
|
|
2513
|
+
file: $
|
|
2507
2514
|
});
|
|
2508
2515
|
continue;
|
|
2509
2516
|
}
|
|
2510
2517
|
}
|
|
2511
2518
|
G.push({
|
|
2512
|
-
file:
|
|
2519
|
+
file: $,
|
|
2513
2520
|
status: "idle"
|
|
2514
2521
|
}), K.push({
|
|
2515
2522
|
isValid: !0,
|
|
2516
|
-
file:
|
|
2523
|
+
file: $
|
|
2517
2524
|
});
|
|
2518
2525
|
}
|
|
2519
|
-
L(s ? (
|
|
2520
|
-
const
|
|
2521
|
-
h == null || h(
|
|
2526
|
+
L(s ? ($) => [...$, ...G] : G.slice(0, 1)), m(X);
|
|
2527
|
+
const H = s ? [...S, ...G].map(($) => $.file) : G.map(($) => $.file);
|
|
2528
|
+
h == null || h(H, X);
|
|
2522
2529
|
},
|
|
2523
2530
|
[
|
|
2524
2531
|
r,
|
|
@@ -2532,52 +2539,52 @@ function Ur({
|
|
|
2532
2539
|
v
|
|
2533
2540
|
]
|
|
2534
2541
|
), O = fe(
|
|
2535
|
-
async (
|
|
2536
|
-
const K = Array.from(
|
|
2537
|
-
await
|
|
2542
|
+
async (R) => {
|
|
2543
|
+
const K = Array.from(R.target.files || []);
|
|
2544
|
+
await P(K), A.current && (A.current.value = "");
|
|
2538
2545
|
},
|
|
2539
|
-
[
|
|
2546
|
+
[P]
|
|
2540
2547
|
), ee = fe(
|
|
2541
|
-
(
|
|
2542
|
-
|
|
2548
|
+
(R) => {
|
|
2549
|
+
R.preventDefault(), R.stopPropagation(), p || N(!0);
|
|
2543
2550
|
},
|
|
2544
2551
|
[p]
|
|
2545
|
-
), j = fe((
|
|
2546
|
-
|
|
2547
|
-
}, []),
|
|
2548
|
-
async (
|
|
2552
|
+
), j = fe((R) => {
|
|
2553
|
+
R.preventDefault(), R.stopPropagation(), N(!1);
|
|
2554
|
+
}, []), J = fe(
|
|
2555
|
+
async (R) => {
|
|
2549
2556
|
var G;
|
|
2550
|
-
if (
|
|
2551
|
-
const K = Array.from(((G =
|
|
2552
|
-
await
|
|
2557
|
+
if (R.preventDefault(), R.stopPropagation(), N(!1), p) return;
|
|
2558
|
+
const K = Array.from(((G = R.dataTransfer) == null ? void 0 : G.files) || []);
|
|
2559
|
+
await P(K);
|
|
2553
2560
|
},
|
|
2554
|
-
[p,
|
|
2561
|
+
[p, P]
|
|
2555
2562
|
), ce = fe(
|
|
2556
|
-
(
|
|
2563
|
+
(R) => {
|
|
2557
2564
|
if (p) return;
|
|
2558
|
-
const K = S[
|
|
2559
|
-
L(G), u == null || u(K.file,
|
|
2565
|
+
const K = S[R], G = S.filter((X, H) => H !== R);
|
|
2566
|
+
L(G), u == null || u(K.file, R), h == null || h(
|
|
2560
2567
|
G.map((X) => X.file),
|
|
2561
2568
|
g
|
|
2562
2569
|
);
|
|
2563
2570
|
},
|
|
2564
2571
|
[p, S, g, u, h]
|
|
2565
2572
|
), oe = fe(
|
|
2566
|
-
(
|
|
2573
|
+
(R, K, G, X) => {
|
|
2567
2574
|
L(
|
|
2568
|
-
(
|
|
2569
|
-
(
|
|
2575
|
+
(H) => H.map(
|
|
2576
|
+
($, se) => se === R ? { ...$, status: K, error: G, progress: X } : $
|
|
2570
2577
|
)
|
|
2571
2578
|
);
|
|
2572
2579
|
},
|
|
2573
2580
|
[]
|
|
2574
|
-
),
|
|
2581
|
+
), Z = I("ina-file-upload", C, {
|
|
2575
2582
|
"ina-file-upload--disabled": p
|
|
2576
2583
|
}), W = I("ina-file-upload__dropzone", {
|
|
2577
2584
|
"ina-file-upload__dropzone--drag-over": M,
|
|
2578
2585
|
"ina-file-upload__dropzone--disabled": p
|
|
2579
2586
|
});
|
|
2580
|
-
return /* @__PURE__ */ w("div", { className:
|
|
2587
|
+
return /* @__PURE__ */ w("div", { className: Z, children: [
|
|
2581
2588
|
e && /* @__PURE__ */ n("div", { className: "ina-file-upload__label", children: e }),
|
|
2582
2589
|
/* @__PURE__ */ w(
|
|
2583
2590
|
"div",
|
|
@@ -2586,7 +2593,7 @@ function Ur({
|
|
|
2586
2593
|
onClick: U,
|
|
2587
2594
|
onDragOver: ee,
|
|
2588
2595
|
onDragLeave: j,
|
|
2589
|
-
onDrop:
|
|
2596
|
+
onDrop: J,
|
|
2590
2597
|
children: [
|
|
2591
2598
|
/* @__PURE__ */ n(
|
|
2592
2599
|
"input",
|
|
@@ -2613,8 +2620,8 @@ function Ur({
|
|
|
2613
2620
|
type: "button",
|
|
2614
2621
|
className: "ina-file-upload__button",
|
|
2615
2622
|
disabled: p,
|
|
2616
|
-
onClick: (
|
|
2617
|
-
|
|
2623
|
+
onClick: (R) => {
|
|
2624
|
+
R.stopPropagation(), U();
|
|
2618
2625
|
},
|
|
2619
2626
|
children: "Pilih File"
|
|
2620
2627
|
}
|
|
@@ -2624,38 +2631,38 @@ function Ur({
|
|
|
2624
2631
|
}
|
|
2625
2632
|
),
|
|
2626
2633
|
S.length > 0 && /* @__PURE__ */ w(Ye, { children: [
|
|
2627
|
-
/* @__PURE__ */ n("div", { className: "ina-file-upload__files", children: (s && S.length > 5 && !
|
|
2634
|
+
/* @__PURE__ */ n("div", { className: "ina-file-upload__files", children: (s && S.length > 5 && !F ? S.slice(0, 5) : S).map((R) => {
|
|
2628
2635
|
const K = S.findIndex(
|
|
2629
|
-
(G) => G.file.name ===
|
|
2636
|
+
(G) => G.file.name === R.file.name && G.file.size === R.file.size && G.status === R.status
|
|
2630
2637
|
);
|
|
2631
2638
|
return /* @__PURE__ */ w(
|
|
2632
2639
|
"div",
|
|
2633
2640
|
{
|
|
2634
2641
|
className: I("ina-file-upload__file", {
|
|
2635
|
-
"ina-file-upload__file--error":
|
|
2636
|
-
"ina-file-upload__file--success":
|
|
2637
|
-
"ina-file-upload__file--uploading":
|
|
2642
|
+
"ina-file-upload__file--error": R.status === "error",
|
|
2643
|
+
"ina-file-upload__file--success": R.status === "success",
|
|
2644
|
+
"ina-file-upload__file--uploading": R.status === "uploading"
|
|
2638
2645
|
}),
|
|
2639
2646
|
children: [
|
|
2640
2647
|
/* @__PURE__ */ w("div", { className: "ina-file-upload__file-indicator", children: [
|
|
2641
|
-
|
|
2648
|
+
R.status === "uploading" && /* @__PURE__ */ n("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--uploading", children: /* @__PURE__ */ n(
|
|
2642
2649
|
Mt,
|
|
2643
2650
|
{
|
|
2644
2651
|
size: 20,
|
|
2645
2652
|
className: "ina-file-upload__file-icon--spinning"
|
|
2646
2653
|
}
|
|
2647
2654
|
) }),
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2655
|
+
R.status === "success" && /* @__PURE__ */ n("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--success", children: /* @__PURE__ */ n(xt, { size: 20, stroke: "2" }) }),
|
|
2656
|
+
R.status === "error" && /* @__PURE__ */ n("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--error", children: /* @__PURE__ */ n(un, { size: 20, stroke: "2" }) }),
|
|
2657
|
+
R.status === "idle" && /* @__PURE__ */ n("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--success", children: /* @__PURE__ */ n(xt, { size: 20, stroke: "2" }) })
|
|
2651
2658
|
] }),
|
|
2652
2659
|
/* @__PURE__ */ w("div", { className: "ina-file-upload__file-info", children: [
|
|
2653
|
-
/* @__PURE__ */ n("div", { className: "ina-file-upload__file-name", children: ot(
|
|
2654
|
-
/* @__PURE__ */ n("div", { className: "ina-file-upload__file-size", children: on(
|
|
2655
|
-
|
|
2660
|
+
/* @__PURE__ */ n("div", { className: "ina-file-upload__file-name", children: ot(R.file.name) }),
|
|
2661
|
+
/* @__PURE__ */ n("div", { className: "ina-file-upload__file-size", children: on(R.file.size) }),
|
|
2662
|
+
R.error && /* @__PURE__ */ n("div", { className: "ina-file-upload__file-error", children: R.error })
|
|
2656
2663
|
] }),
|
|
2657
2664
|
/* @__PURE__ */ w("div", { className: "ina-file-upload__file-actions", children: [
|
|
2658
|
-
|
|
2665
|
+
R.status === "error" && /* @__PURE__ */ w(Ye, { children: [
|
|
2659
2666
|
/* @__PURE__ */ n(
|
|
2660
2667
|
"button",
|
|
2661
2668
|
{
|
|
@@ -2679,7 +2686,7 @@ function Ur({
|
|
|
2679
2686
|
}
|
|
2680
2687
|
)
|
|
2681
2688
|
] }),
|
|
2682
|
-
|
|
2689
|
+
R.status === "uploading" && /* @__PURE__ */ n(
|
|
2683
2690
|
"button",
|
|
2684
2691
|
{
|
|
2685
2692
|
type: "button",
|
|
@@ -2689,7 +2696,7 @@ function Ur({
|
|
|
2689
2696
|
children: /* @__PURE__ */ n(Ve, { size: 20 })
|
|
2690
2697
|
}
|
|
2691
2698
|
),
|
|
2692
|
-
|
|
2699
|
+
R.status === "success" && /* @__PURE__ */ n(
|
|
2693
2700
|
"button",
|
|
2694
2701
|
{
|
|
2695
2702
|
type: "button",
|
|
@@ -2699,7 +2706,7 @@ function Ur({
|
|
|
2699
2706
|
children: /* @__PURE__ */ n(it, { size: 20 })
|
|
2700
2707
|
}
|
|
2701
2708
|
),
|
|
2702
|
-
|
|
2709
|
+
R.status === "idle" && /* @__PURE__ */ n(
|
|
2703
2710
|
"button",
|
|
2704
2711
|
{
|
|
2705
2712
|
type: "button",
|
|
@@ -2712,7 +2719,7 @@ function Ur({
|
|
|
2712
2719
|
] })
|
|
2713
2720
|
]
|
|
2714
2721
|
},
|
|
2715
|
-
`${
|
|
2722
|
+
`${R.file.name}-${K}`
|
|
2716
2723
|
);
|
|
2717
2724
|
}) }),
|
|
2718
2725
|
s && S.length > 5 && /* @__PURE__ */ w(
|
|
@@ -2720,9 +2727,9 @@ function Ur({
|
|
|
2720
2727
|
{
|
|
2721
2728
|
type: "button",
|
|
2722
2729
|
className: "ina-file-upload__show-more",
|
|
2723
|
-
onClick: () =>
|
|
2730
|
+
onClick: () => T(!F),
|
|
2724
2731
|
children: [
|
|
2725
|
-
|
|
2732
|
+
F ? "Sembunyikan" : "Lihat Selengkapnya",
|
|
2726
2733
|
/* @__PURE__ */ n(
|
|
2727
2734
|
"svg",
|
|
2728
2735
|
{
|
|
@@ -2732,7 +2739,7 @@ function Ur({
|
|
|
2732
2739
|
fill: "none",
|
|
2733
2740
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2734
2741
|
className: I("ina-file-upload__show-more-icon", {
|
|
2735
|
-
"ina-file-upload__show-more-icon--expanded":
|
|
2742
|
+
"ina-file-upload__show-more-icon--expanded": F
|
|
2736
2743
|
}),
|
|
2737
2744
|
children: /* @__PURE__ */ n(
|
|
2738
2745
|
"path",
|
|
@@ -2750,10 +2757,10 @@ function Ur({
|
|
|
2750
2757
|
}
|
|
2751
2758
|
)
|
|
2752
2759
|
] }),
|
|
2753
|
-
g.length > 0 && /* @__PURE__ */ n("div", { className: "ina-file-upload__errors", children: g.map((
|
|
2754
|
-
ot(
|
|
2760
|
+
g.length > 0 && /* @__PURE__ */ n("div", { className: "ina-file-upload__errors", children: g.map((R, K) => /* @__PURE__ */ w("div", { className: "ina-file-upload__error-message", children: [
|
|
2761
|
+
ot(R.file.name),
|
|
2755
2762
|
": ",
|
|
2756
|
-
|
|
2763
|
+
R.error
|
|
2757
2764
|
] }, K)) })
|
|
2758
2765
|
] });
|
|
2759
2766
|
}
|
|
@@ -2836,13 +2843,13 @@ function Wr({
|
|
|
2836
2843
|
onRemove: C,
|
|
2837
2844
|
...h
|
|
2838
2845
|
}) {
|
|
2839
|
-
const u = re(null), [E, A] = Y(null), [S, L] = Y(0), [M, N] = Y("idle"), [g, m] = Y(!1),
|
|
2846
|
+
const u = re(null), [E, A] = Y(null), [S, L] = Y(0), [M, N] = Y("idle"), [g, m] = Y(!1), F = y !== void 0 ? y : S, T = v !== void 0 ? v : M, U = fe(() => {
|
|
2840
2847
|
var K;
|
|
2841
2848
|
l || E || (K = u.current) == null || K.click();
|
|
2842
|
-
}, [l, E]),
|
|
2849
|
+
}, [l, E]), P = fe(
|
|
2843
2850
|
async (K) => {
|
|
2844
|
-
var
|
|
2845
|
-
const G = (
|
|
2851
|
+
var $;
|
|
2852
|
+
const G = ($ = K.target.files) == null ? void 0 : $[0];
|
|
2846
2853
|
if (!G) return;
|
|
2847
2854
|
if (ot(G.name) !== G.name) {
|
|
2848
2855
|
const se = {
|
|
@@ -2865,13 +2872,13 @@ function Wr({
|
|
|
2865
2872
|
return;
|
|
2866
2873
|
}
|
|
2867
2874
|
}
|
|
2868
|
-
const
|
|
2875
|
+
const H = Nt(G, {
|
|
2869
2876
|
allowedTypes: t || void 0,
|
|
2870
2877
|
maxSize: r || void 0,
|
|
2871
2878
|
validateExtension: !0
|
|
2872
2879
|
});
|
|
2873
|
-
if (!
|
|
2874
|
-
A(null), N("error"), p == null || p(null,
|
|
2880
|
+
if (!H.isValid) {
|
|
2881
|
+
A(null), N("error"), p == null || p(null, H), u.current && (u.current.value = "");
|
|
2875
2882
|
return;
|
|
2876
2883
|
}
|
|
2877
2884
|
if (i && G.type) {
|
|
@@ -2898,7 +2905,7 @@ function Wr({
|
|
|
2898
2905
|
l || E || U();
|
|
2899
2906
|
}, [l, E, U]), j = fe(() => {
|
|
2900
2907
|
l || E || m(!0);
|
|
2901
|
-
}, [l, E]),
|
|
2908
|
+
}, [l, E]), J = fe(() => {
|
|
2902
2909
|
m(!1);
|
|
2903
2910
|
}, []), ce = fe(
|
|
2904
2911
|
(K) => {
|
|
@@ -2910,23 +2917,23 @@ function Wr({
|
|
|
2910
2917
|
l || E || (K.preventDefault(), K.stopPropagation(), m(!1));
|
|
2911
2918
|
},
|
|
2912
2919
|
[l, E]
|
|
2913
|
-
),
|
|
2920
|
+
), Z = fe(
|
|
2914
2921
|
async (K) => {
|
|
2915
2922
|
if (l || E) return;
|
|
2916
2923
|
K.preventDefault(), K.stopPropagation(), m(!1);
|
|
2917
2924
|
const G = K.dataTransfer.files[0];
|
|
2918
2925
|
if (!G) return;
|
|
2919
2926
|
if (ot(G.name) !== G.name) {
|
|
2920
|
-
const
|
|
2927
|
+
const $ = {
|
|
2921
2928
|
isValid: !1,
|
|
2922
2929
|
error: "Nama file mengandung karakter yang tidak diizinkan",
|
|
2923
2930
|
file: G
|
|
2924
2931
|
};
|
|
2925
|
-
A(null), N("error"), p == null || p(null,
|
|
2932
|
+
A(null), N("error"), p == null || p(null, $);
|
|
2926
2933
|
return;
|
|
2927
2934
|
}
|
|
2928
2935
|
if (s && s.length > 0) {
|
|
2929
|
-
const
|
|
2936
|
+
const $ = G.name.toLowerCase(), se = $.substring($.lastIndexOf(".") + 1);
|
|
2930
2937
|
if (!s.includes(se.toLowerCase())) {
|
|
2931
2938
|
const ve = {
|
|
2932
2939
|
isValid: !1,
|
|
@@ -2937,24 +2944,24 @@ function Wr({
|
|
|
2937
2944
|
return;
|
|
2938
2945
|
}
|
|
2939
2946
|
}
|
|
2940
|
-
const
|
|
2947
|
+
const H = Nt(G, {
|
|
2941
2948
|
allowedTypes: t || void 0,
|
|
2942
2949
|
maxSize: r || void 0,
|
|
2943
2950
|
validateExtension: !0
|
|
2944
2951
|
});
|
|
2945
|
-
if (!
|
|
2946
|
-
A(null), N("error"), p == null || p(null,
|
|
2952
|
+
if (!H.isValid) {
|
|
2953
|
+
A(null), N("error"), p == null || p(null, H);
|
|
2947
2954
|
return;
|
|
2948
2955
|
}
|
|
2949
2956
|
if (i && G.type) {
|
|
2950
|
-
const
|
|
2957
|
+
const $ = await Ct(
|
|
2951
2958
|
G,
|
|
2952
2959
|
G.type
|
|
2953
2960
|
);
|
|
2954
|
-
if (
|
|
2961
|
+
if (!$.isValid) {
|
|
2955
2962
|
const se = {
|
|
2956
2963
|
isValid: !1,
|
|
2957
|
-
error:
|
|
2964
|
+
error: $.error || "File signature tidak valid",
|
|
2958
2965
|
file: G
|
|
2959
2966
|
};
|
|
2960
2967
|
A(null), N("error"), p == null || p(null, se);
|
|
@@ -2976,7 +2983,7 @@ function Wr({
|
|
|
2976
2983
|
if (!E) return null;
|
|
2977
2984
|
const K = E.type, G = E.name.toLowerCase();
|
|
2978
2985
|
return K === "application/pdf" || G.endsWith(".pdf") ? /* @__PURE__ */ n(pn, { size: 16 }) : K.startsWith("image/") ? /* @__PURE__ */ n(mn, { size: 16 }) : /* @__PURE__ */ n(fn, { size: 16 });
|
|
2979
|
-
},
|
|
2986
|
+
}, R = I("ina-single-file-upload__container", {
|
|
2980
2987
|
"ina-single-file-upload__container--active": g && !l && !E,
|
|
2981
2988
|
"ina-single-file-upload__container--disabled": l
|
|
2982
2989
|
});
|
|
@@ -2990,48 +2997,48 @@ function Wr({
|
|
|
2990
2997
|
accept: t,
|
|
2991
2998
|
disabled: l,
|
|
2992
2999
|
className: I("ina-single-file-upload__input", c),
|
|
2993
|
-
onChange:
|
|
3000
|
+
onChange: P
|
|
2994
3001
|
}
|
|
2995
3002
|
),
|
|
2996
3003
|
/* @__PURE__ */ w(
|
|
2997
3004
|
"div",
|
|
2998
3005
|
{
|
|
2999
|
-
className:
|
|
3006
|
+
className: R,
|
|
3000
3007
|
onClick: ee,
|
|
3001
3008
|
onFocus: j,
|
|
3002
|
-
onBlur:
|
|
3009
|
+
onBlur: J,
|
|
3003
3010
|
onDragOver: ce,
|
|
3004
3011
|
onDragLeave: oe,
|
|
3005
|
-
onDrop:
|
|
3012
|
+
onDrop: Z,
|
|
3006
3013
|
tabIndex: l || E ? -1 : 0,
|
|
3007
3014
|
role: "button",
|
|
3008
3015
|
"aria-label": E ? `File: ${E.name}` : "Upload file",
|
|
3009
3016
|
children: [
|
|
3010
|
-
!E &&
|
|
3017
|
+
!E && T === "idle" && /* @__PURE__ */ w(Ye, { children: [
|
|
3011
3018
|
/* @__PURE__ */ n("div", { className: "ina-single-file-upload__icon-wrapper ina-single-file-upload__icon-wrapper--default", children: /* @__PURE__ */ n(kt, { size: 24 }) }),
|
|
3012
3019
|
/* @__PURE__ */ w("div", { className: "ina-single-file-upload__content", children: [
|
|
3013
3020
|
/* @__PURE__ */ n("div", { className: "ina-single-file-upload__title", children: e }),
|
|
3014
3021
|
/* @__PURE__ */ n("div", { className: "ina-single-file-upload__description", children: a })
|
|
3015
3022
|
] })
|
|
3016
3023
|
] }),
|
|
3017
|
-
!E &&
|
|
3024
|
+
!E && T === "uploading" && /* @__PURE__ */ w(Ye, { children: [
|
|
3018
3025
|
/* @__PURE__ */ n("div", { className: "ina-single-file-upload__icon-wrapper ina-single-file-upload__icon-wrapper--default", children: /* @__PURE__ */ n(kt, { size: 24 }) }),
|
|
3019
3026
|
/* @__PURE__ */ w("div", { className: "ina-single-file-upload__progress", children: [
|
|
3020
3027
|
/* @__PURE__ */ n("div", { className: "ina-single-file-upload__progress-bar", children: /* @__PURE__ */ n(
|
|
3021
3028
|
"div",
|
|
3022
3029
|
{
|
|
3023
3030
|
className: "ina-single-file-upload__progress-fill",
|
|
3024
|
-
style: { width: `${
|
|
3031
|
+
style: { width: `${F}%` }
|
|
3025
3032
|
}
|
|
3026
3033
|
) }),
|
|
3027
3034
|
/* @__PURE__ */ w("div", { className: "ina-single-file-upload__progress-text", children: [
|
|
3028
3035
|
"Uploading... ",
|
|
3029
|
-
|
|
3036
|
+
F,
|
|
3030
3037
|
"%"
|
|
3031
3038
|
] })
|
|
3032
3039
|
] })
|
|
3033
3040
|
] }),
|
|
3034
|
-
E &&
|
|
3041
|
+
E && T === "success" && /* @__PURE__ */ w(Ye, { children: [
|
|
3035
3042
|
/* @__PURE__ */ n("div", { className: "ina-single-file-upload__icon-wrapper ina-single-file-upload__icon-wrapper--file", children: W() }),
|
|
3036
3043
|
/* @__PURE__ */ w("div", { className: "ina-single-file-upload__content", children: [
|
|
3037
3044
|
/* @__PURE__ */ n("div", { className: "ina-single-file-upload__title", children: E.name }),
|
|
@@ -3287,16 +3294,16 @@ function gn({
|
|
|
3287
3294
|
});
|
|
3288
3295
|
else {
|
|
3289
3296
|
E(!1), L.current && (L.current.focus(), L.current = null);
|
|
3290
|
-
const
|
|
3297
|
+
const T = setTimeout(() => {
|
|
3291
3298
|
h(!1);
|
|
3292
3299
|
}, 300);
|
|
3293
|
-
return () => clearTimeout(
|
|
3300
|
+
return () => clearTimeout(T);
|
|
3294
3301
|
}
|
|
3295
3302
|
}, [e]), ne(() => {
|
|
3296
3303
|
if (v && C) {
|
|
3297
|
-
const
|
|
3304
|
+
const T = document.documentElement.style.overflow;
|
|
3298
3305
|
return document.documentElement.style.overflow = "hidden", () => {
|
|
3299
|
-
document.documentElement.style.overflow =
|
|
3306
|
+
document.documentElement.style.overflow = T;
|
|
3300
3307
|
};
|
|
3301
3308
|
}
|
|
3302
3309
|
}, [C, v]), ne(() => {
|
|
@@ -3305,15 +3312,15 @@ function gn({
|
|
|
3305
3312
|
var U;
|
|
3306
3313
|
(U = A.current) == null || U.focus();
|
|
3307
3314
|
}, 50);
|
|
3308
|
-
const
|
|
3315
|
+
const T = (U) => {
|
|
3309
3316
|
if (U.key === "Escape" && u) {
|
|
3310
3317
|
a();
|
|
3311
3318
|
return;
|
|
3312
3319
|
}
|
|
3313
3320
|
if (U.key === "Tab" && u) {
|
|
3314
|
-
const
|
|
3315
|
-
if (!
|
|
3316
|
-
const O =
|
|
3321
|
+
const P = document.querySelector(".ina-modal__dialog");
|
|
3322
|
+
if (!P) return;
|
|
3323
|
+
const O = P.querySelectorAll(
|
|
3317
3324
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
3318
3325
|
);
|
|
3319
3326
|
if (O.length === 0) return;
|
|
@@ -3321,7 +3328,7 @@ function gn({
|
|
|
3321
3328
|
U.shiftKey ? document.activeElement === ee && (U.preventDefault(), j.focus()) : document.activeElement === j && (U.preventDefault(), ee.focus());
|
|
3322
3329
|
}
|
|
3323
3330
|
};
|
|
3324
|
-
return document.addEventListener("keydown",
|
|
3331
|
+
return document.addEventListener("keydown", T), () => document.removeEventListener("keydown", T);
|
|
3325
3332
|
}, [C, u, v, a]), !C || !v) return null;
|
|
3326
3333
|
const M = i ?? document.body, N = I(
|
|
3327
3334
|
"ina-modal",
|
|
@@ -3333,7 +3340,7 @@ function gn({
|
|
|
3333
3340
|
), m = I(
|
|
3334
3341
|
"ina-modal__header",
|
|
3335
3342
|
t ? "ina-modal__header--with-title" : "ina-modal__header--no-border"
|
|
3336
|
-
),
|
|
3343
|
+
), F = /* @__PURE__ */ w(
|
|
3337
3344
|
"div",
|
|
3338
3345
|
{
|
|
3339
3346
|
className: N,
|
|
@@ -3350,7 +3357,7 @@ function gn({
|
|
|
3350
3357
|
}
|
|
3351
3358
|
}
|
|
3352
3359
|
),
|
|
3353
|
-
/* @__PURE__ */ n("div", { className: "ina-modal__container", children: /* @__PURE__ */ w("div", { className: g, onClick: (
|
|
3360
|
+
/* @__PURE__ */ n("div", { className: "ina-modal__container", children: /* @__PURE__ */ w("div", { className: g, onClick: (T) => T.stopPropagation(), children: [
|
|
3354
3361
|
/* @__PURE__ */ w("div", { className: m, children: [
|
|
3355
3362
|
t && /* @__PURE__ */ n("div", { className: "ina-modal__title", children: typeof t == "string" ? /* @__PURE__ */ n("h2", { id: S.current, children: t }) : t }),
|
|
3356
3363
|
/* @__PURE__ */ n(
|
|
@@ -3369,7 +3376,7 @@ function gn({
|
|
|
3369
3376
|
]
|
|
3370
3377
|
}
|
|
3371
3378
|
);
|
|
3372
|
-
return Vt(
|
|
3379
|
+
return Vt(F, M);
|
|
3373
3380
|
}
|
|
3374
3381
|
const ct = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
3375
3382
|
"svg",
|
|
@@ -3451,14 +3458,14 @@ function bn({
|
|
|
3451
3458
|
if (a <= 0) return null;
|
|
3452
3459
|
function u() {
|
|
3453
3460
|
const m = [];
|
|
3454
|
-
let
|
|
3455
|
-
e === 1 ? (
|
|
3456
|
-
for (let U =
|
|
3461
|
+
let F, T;
|
|
3462
|
+
e === 1 ? (F = 1, T = Math.min(3, a)) : e === a ? (F = Math.max(1, a - 2), T = a) : (F = e - 1, T = e + 1);
|
|
3463
|
+
for (let U = F; U <= T; U++)
|
|
3457
3464
|
m.push(E(U));
|
|
3458
3465
|
return m;
|
|
3459
3466
|
}
|
|
3460
3467
|
const E = (m) => {
|
|
3461
|
-
const
|
|
3468
|
+
const F = m === e;
|
|
3462
3469
|
return /* @__PURE__ */ n(
|
|
3463
3470
|
"button",
|
|
3464
3471
|
{
|
|
@@ -3468,8 +3475,8 @@ function bn({
|
|
|
3468
3475
|
disabled: l,
|
|
3469
3476
|
className: I(
|
|
3470
3477
|
"ina-pagination__page-button",
|
|
3471
|
-
|
|
3472
|
-
!l && !
|
|
3478
|
+
F && "ina-pagination__page-button--active",
|
|
3479
|
+
!l && !F && "ina-pagination__page-button--enabled",
|
|
3473
3480
|
l && "ina-pagination__page-button--disabled"
|
|
3474
3481
|
),
|
|
3475
3482
|
children: m
|
|
@@ -3485,8 +3492,8 @@ function bn({
|
|
|
3485
3492
|
}, M = (m) => {
|
|
3486
3493
|
m.preventDefault(), !l && e < a && s(a);
|
|
3487
3494
|
}, N = (m) => {
|
|
3488
|
-
const
|
|
3489
|
-
l || i(
|
|
3495
|
+
const F = parseInt(m.target.value, 10);
|
|
3496
|
+
l || i(F);
|
|
3490
3497
|
}, g = I(
|
|
3491
3498
|
"ina-pagination",
|
|
3492
3499
|
c && "ina-pagination--full-width"
|
|
@@ -3589,7 +3596,7 @@ function bn({
|
|
|
3589
3596
|
"ina-pagination__page-size-select",
|
|
3590
3597
|
l && "ina-pagination__page-size-select--disabled"
|
|
3591
3598
|
),
|
|
3592
|
-
children: r.map((m,
|
|
3599
|
+
children: r.map((m, F) => /* @__PURE__ */ n("option", { value: m, children: m }, `${m}-${F}`))
|
|
3593
3600
|
}
|
|
3594
3601
|
)
|
|
3595
3602
|
] })
|
|
@@ -3758,18 +3765,18 @@ function es({
|
|
|
3758
3765
|
onBlur: A,
|
|
3759
3766
|
...S
|
|
3760
3767
|
}) {
|
|
3761
|
-
const [L, M] = Y(e), [N, g] = Y(!1), [m] = pt(L, t),
|
|
3768
|
+
const [L, M] = Y(e), [N, g] = Y(!1), [m] = pt(L, t), F = re(!0);
|
|
3762
3769
|
ne(() => {
|
|
3763
3770
|
M(e);
|
|
3764
3771
|
}, [e]), ne(() => {
|
|
3765
|
-
|
|
3772
|
+
F.current ? F.current = !1 : t > 0 && r && r(m);
|
|
3766
3773
|
}, [m, t, r]);
|
|
3767
|
-
const
|
|
3774
|
+
const T = (ee) => {
|
|
3768
3775
|
const j = ee.target.value;
|
|
3769
3776
|
p != null && j.length > p || (M(j), a(j));
|
|
3770
3777
|
}, U = (ee) => {
|
|
3771
3778
|
A == null || A(ee);
|
|
3772
|
-
},
|
|
3779
|
+
}, P = () => {
|
|
3773
3780
|
M(""), a(""), r && r("");
|
|
3774
3781
|
}, O = c !== "neutral" && y != null ? y : l;
|
|
3775
3782
|
return /* @__PURE__ */ w("div", { className: I("ina-password-input", E), children: [
|
|
@@ -3802,7 +3809,7 @@ function es({
|
|
|
3802
3809
|
type: N ? "text" : "password",
|
|
3803
3810
|
className: "ina-password-input__input",
|
|
3804
3811
|
value: L,
|
|
3805
|
-
onChange:
|
|
3812
|
+
onChange: T,
|
|
3806
3813
|
onBlur: U,
|
|
3807
3814
|
placeholder: h,
|
|
3808
3815
|
disabled: u,
|
|
@@ -3814,7 +3821,7 @@ function es({
|
|
|
3814
3821
|
{
|
|
3815
3822
|
type: "button",
|
|
3816
3823
|
className: "ina-password-input__clear-button",
|
|
3817
|
-
onClick:
|
|
3824
|
+
onClick: P,
|
|
3818
3825
|
"aria-label": "Clear input",
|
|
3819
3826
|
children: /* @__PURE__ */ n(Ve, { size: 16 })
|
|
3820
3827
|
}
|
|
@@ -4426,57 +4433,57 @@ function ts({
|
|
|
4426
4433
|
id: A,
|
|
4427
4434
|
...S
|
|
4428
4435
|
}) {
|
|
4429
|
-
const L = $e(() => A || `phone-input-${Math.random().toString(36).substr(2, 9)}`, [A]), [M, N] = Y(a), [g, m] = Y(!1), [
|
|
4430
|
-
u.find((
|
|
4431
|
-
), O = re(null), ee = re(null), j = re(null),
|
|
4432
|
-
const
|
|
4433
|
-
return
|
|
4436
|
+
const L = $e(() => A || `phone-input-${Math.random().toString(36).substr(2, 9)}`, [A]), [M, N] = Y(a), [g, m] = Y(!1), [F, T] = Y(""), [U, P] = Y(
|
|
4437
|
+
u.find((H) => H.code === h) || u[0]
|
|
4438
|
+
), O = re(null), ee = re(null), j = re(null), J = (H) => {
|
|
4439
|
+
const $ = H.replace(/\D/g, "");
|
|
4440
|
+
return $.length > 7 ? $.replace(/^(\d{3})(\d{4})(.*)/, "$1-$2-$3") : $.length > 3 ? $.replace(/^(\d{3})(.*)/, "$1-$2") : $;
|
|
4434
4441
|
};
|
|
4435
4442
|
ne(() => {
|
|
4436
4443
|
if (!a) {
|
|
4437
4444
|
N("");
|
|
4438
4445
|
return;
|
|
4439
4446
|
}
|
|
4440
|
-
const
|
|
4441
|
-
let
|
|
4442
|
-
a.startsWith(
|
|
4447
|
+
const H = U.dialCode;
|
|
4448
|
+
let $ = a;
|
|
4449
|
+
a.startsWith(H) && ($ = a.substring(H.length)), N(J($));
|
|
4443
4450
|
}, [a, U.dialCode]), ne(() => {
|
|
4444
|
-
const
|
|
4445
|
-
j.current && !j.current.contains(
|
|
4451
|
+
const H = ($) => {
|
|
4452
|
+
j.current && !j.current.contains($.target) && m(!1);
|
|
4446
4453
|
};
|
|
4447
|
-
return document.addEventListener("mousedown",
|
|
4448
|
-
document.removeEventListener("mousedown",
|
|
4454
|
+
return document.addEventListener("mousedown", H), () => {
|
|
4455
|
+
document.removeEventListener("mousedown", H);
|
|
4449
4456
|
};
|
|
4450
4457
|
}, []);
|
|
4451
4458
|
const ce = $e(() => {
|
|
4452
|
-
if (!
|
|
4453
|
-
const
|
|
4459
|
+
if (!F) return u;
|
|
4460
|
+
const H = F.toLowerCase();
|
|
4454
4461
|
return u.filter(
|
|
4455
|
-
(
|
|
4462
|
+
($) => $.name.toLowerCase().includes(H) || $.dialCode.includes(H) || $.code.toLowerCase().includes(H)
|
|
4456
4463
|
);
|
|
4457
|
-
}, [u,
|
|
4458
|
-
v || p || m((
|
|
4459
|
-
const
|
|
4460
|
-
return
|
|
4464
|
+
}, [u, F]), oe = () => {
|
|
4465
|
+
v || p || m((H) => {
|
|
4466
|
+
const $ = !H;
|
|
4467
|
+
return $ && (T(""), setTimeout(() => {
|
|
4461
4468
|
var se;
|
|
4462
4469
|
(se = ee.current) == null || se.focus();
|
|
4463
|
-
}, 0)),
|
|
4470
|
+
}, 0)), $;
|
|
4464
4471
|
});
|
|
4465
|
-
},
|
|
4466
|
-
if (H
|
|
4467
|
-
const
|
|
4468
|
-
t == null || t(`${
|
|
4472
|
+
}, Z = (H) => {
|
|
4473
|
+
if (P(H), m(!1), M) {
|
|
4474
|
+
const $ = M.replace(/\D/g, ""), se = $.startsWith("0") ? $.substring(1) : $;
|
|
4475
|
+
t == null || t(`${H.dialCode}${se}`);
|
|
4469
4476
|
}
|
|
4470
4477
|
setTimeout(() => {
|
|
4471
|
-
var
|
|
4472
|
-
(
|
|
4478
|
+
var $;
|
|
4479
|
+
($ = O.current) == null || $.focus();
|
|
4473
4480
|
}, 0);
|
|
4474
|
-
}, W = (
|
|
4475
|
-
const se =
|
|
4481
|
+
}, W = (H) => {
|
|
4482
|
+
const se = H.target.value.replace(/\D/g, ""), ve = J(se);
|
|
4476
4483
|
N(ve);
|
|
4477
4484
|
let me = se;
|
|
4478
|
-
me.startsWith("0") && (me = me.substring(1)), t == null || t(`${U.dialCode}${me}`), r == null || r(
|
|
4479
|
-
},
|
|
4485
|
+
me.startsWith("0") && (me = me.substring(1)), t == null || t(`${U.dialCode}${me}`), r == null || r(H);
|
|
4486
|
+
}, R = I(
|
|
4480
4487
|
"ina-phone-input",
|
|
4481
4488
|
v && "ina-phone-input--disabled",
|
|
4482
4489
|
E
|
|
@@ -4490,7 +4497,7 @@ function ts({
|
|
|
4490
4497
|
l === "error" && "ina-phone-input__helper-text--error",
|
|
4491
4498
|
l === "warning" && "ina-phone-input__helper-text--warning"
|
|
4492
4499
|
), X = l !== "neutral" && c ? c : c || y;
|
|
4493
|
-
return /* @__PURE__ */ w("div", { className:
|
|
4500
|
+
return /* @__PURE__ */ w("div", { className: R, children: [
|
|
4494
4501
|
e && /* @__PURE__ */ w("label", { htmlFor: L, className: "ina-phone-input__label", children: [
|
|
4495
4502
|
e,
|
|
4496
4503
|
C && /* @__PURE__ */ n("span", { className: "ina-text-field__required", children: "*" })
|
|
@@ -4548,43 +4555,43 @@ function ts({
|
|
|
4548
4555
|
"input",
|
|
4549
4556
|
{
|
|
4550
4557
|
ref: ee,
|
|
4551
|
-
value:
|
|
4552
|
-
onChange: (
|
|
4558
|
+
value: F,
|
|
4559
|
+
onChange: (H) => T(H.target.value),
|
|
4553
4560
|
type: "text",
|
|
4554
4561
|
placeholder: "Cari",
|
|
4555
4562
|
className: "ina-phone-input__country-search-input"
|
|
4556
4563
|
}
|
|
4557
4564
|
) }),
|
|
4558
|
-
/* @__PURE__ */ n("div", { className: "ina-phone-input__country-list", children: ce.map((
|
|
4565
|
+
/* @__PURE__ */ n("div", { className: "ina-phone-input__country-list", children: ce.map((H) => /* @__PURE__ */ w(
|
|
4559
4566
|
"button",
|
|
4560
4567
|
{
|
|
4561
4568
|
type: "button",
|
|
4562
4569
|
className: I(
|
|
4563
4570
|
"ina-phone-input__country-option",
|
|
4564
|
-
|
|
4571
|
+
H.code === U.code && "ina-phone-input__country-option--selected"
|
|
4565
4572
|
),
|
|
4566
|
-
onClick: () =>
|
|
4573
|
+
onClick: () => Z(H),
|
|
4567
4574
|
children: [
|
|
4568
4575
|
/* @__PURE__ */ n(
|
|
4569
4576
|
Kt,
|
|
4570
4577
|
{
|
|
4571
|
-
code:
|
|
4572
|
-
alt:
|
|
4578
|
+
code: H.code,
|
|
4579
|
+
alt: H.name,
|
|
4573
4580
|
className: "ina-phone-input__country-flag-img",
|
|
4574
4581
|
width: "24",
|
|
4575
4582
|
height: "18"
|
|
4576
4583
|
}
|
|
4577
4584
|
),
|
|
4578
4585
|
/* @__PURE__ */ w("span", { className: "ina-phone-input__country-name", children: [
|
|
4579
|
-
|
|
4586
|
+
H.name,
|
|
4580
4587
|
" (",
|
|
4581
|
-
|
|
4588
|
+
H.code,
|
|
4582
4589
|
")"
|
|
4583
4590
|
] }),
|
|
4584
|
-
/* @__PURE__ */ n("span", { className: "ina-phone-input__country-dial-code", children:
|
|
4591
|
+
/* @__PURE__ */ n("span", { className: "ina-phone-input__country-dial-code", children: H.dialCode })
|
|
4585
4592
|
]
|
|
4586
4593
|
},
|
|
4587
|
-
|
|
4594
|
+
H.code
|
|
4588
4595
|
)) })
|
|
4589
4596
|
] })
|
|
4590
4597
|
] }),
|
|
@@ -4707,20 +4714,20 @@ const ns = ({
|
|
|
4707
4714
|
onLoadMore: N,
|
|
4708
4715
|
onSearch: g,
|
|
4709
4716
|
searchDebounceMs: m = 300,
|
|
4710
|
-
renderSelectedPreview:
|
|
4711
|
-
onRemoveSelected:
|
|
4717
|
+
renderSelectedPreview: F,
|
|
4718
|
+
onRemoveSelected: T,
|
|
4712
4719
|
searchValue: U,
|
|
4713
|
-
onSearchChange:
|
|
4720
|
+
onSearchChange: P,
|
|
4714
4721
|
disabled: O = !1,
|
|
4715
4722
|
showPreviewValue: ee = !0,
|
|
4716
4723
|
searchable: j = !0,
|
|
4717
|
-
onSelectedRawChange:
|
|
4724
|
+
onSelectedRawChange: J,
|
|
4718
4725
|
label: ce,
|
|
4719
4726
|
required: oe,
|
|
4720
|
-
selectionTitle:
|
|
4727
|
+
selectionTitle: Z
|
|
4721
4728
|
}) => {
|
|
4722
4729
|
var k;
|
|
4723
|
-
const [W,
|
|
4730
|
+
const [W, R] = Y(!1), [K, G] = Y(""), [X, H] = Y(-1), $ = re(null), se = re(null), ve = re([]), me = re(null), ye = re(/* @__PURE__ */ new Map()), ie = U !== void 0, q = ie ? U : K;
|
|
4724
4731
|
ne(() => (me.current && clearTimeout(me.current), g && q !== "" ? me.current = setTimeout(() => {
|
|
4725
4732
|
g(q);
|
|
4726
4733
|
}, m) : g && q === "" && g(""), () => {
|
|
@@ -4729,10 +4736,10 @@ const ns = ({
|
|
|
4729
4736
|
ie && U !== K && G(U);
|
|
4730
4737
|
}, [U, ie, K]), ne(() => {
|
|
4731
4738
|
const f = (D) => {
|
|
4732
|
-
|
|
4739
|
+
$.current && !$.current.contains(D.target) && (R(!1), H(-1), C == null || C());
|
|
4733
4740
|
};
|
|
4734
4741
|
return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
|
|
4735
|
-
}, [C, ie,
|
|
4742
|
+
}, [C, ie, P]), ne(() => () => {
|
|
4736
4743
|
me.current && clearTimeout(me.current);
|
|
4737
4744
|
}, []);
|
|
4738
4745
|
const ue = v && Array.isArray(a) ? a : [], de = v ? null : a, _e = (f) => {
|
|
@@ -4745,7 +4752,7 @@ const ns = ({
|
|
|
4745
4752
|
return D !== null ? { label: D, value: f } : e.find((te) => te.value === f) || null;
|
|
4746
4753
|
};
|
|
4747
4754
|
ne(() => {
|
|
4748
|
-
if (
|
|
4755
|
+
if (J) {
|
|
4749
4756
|
let f = null;
|
|
4750
4757
|
if (v) {
|
|
4751
4758
|
if (ue.length > 0) {
|
|
@@ -4754,7 +4761,7 @@ const ns = ({
|
|
|
4754
4761
|
}
|
|
4755
4762
|
} else
|
|
4756
4763
|
de != null && de !== "" && (f = Ne(de));
|
|
4757
|
-
|
|
4764
|
+
J(f);
|
|
4758
4765
|
}
|
|
4759
4766
|
}, [a, v, e]), ne(() => {
|
|
4760
4767
|
const f = ye.current;
|
|
@@ -4795,7 +4802,7 @@ const ns = ({
|
|
|
4795
4802
|
(f) => f.label.toLowerCase().includes(q.toLowerCase())
|
|
4796
4803
|
) : e;
|
|
4797
4804
|
ne(() => {
|
|
4798
|
-
|
|
4805
|
+
H(-1);
|
|
4799
4806
|
}, [be]), ne(() => {
|
|
4800
4807
|
var f;
|
|
4801
4808
|
W && X >= 0 && ve.current[X] && ((f = ve.current[X]) == null || f.scrollIntoView({
|
|
@@ -4805,18 +4812,18 @@ const ns = ({
|
|
|
4805
4812
|
}, [X, W]);
|
|
4806
4813
|
const xe = (f) => {
|
|
4807
4814
|
const D = f.target.value;
|
|
4808
|
-
ie ?
|
|
4815
|
+
ie ? P == null || P(D) : G(D);
|
|
4809
4816
|
}, we = (f) => {
|
|
4810
|
-
if (ye.current.delete(f),
|
|
4811
|
-
|
|
4817
|
+
if (ye.current.delete(f), T)
|
|
4818
|
+
T(f);
|
|
4812
4819
|
else if (v) {
|
|
4813
4820
|
const V = (Array.isArray(a) ? [...a] : []).filter((te) => te !== f);
|
|
4814
4821
|
t(V);
|
|
4815
4822
|
} else
|
|
4816
4823
|
t(null);
|
|
4817
4824
|
}, Ie = () => {
|
|
4818
|
-
if (
|
|
4819
|
-
return
|
|
4825
|
+
if (F)
|
|
4826
|
+
return F(a);
|
|
4820
4827
|
if (v && ue.length > 0)
|
|
4821
4828
|
return /* @__PURE__ */ w("div", { className: "ina-select-dropdown__preview-content", children: [
|
|
4822
4829
|
ue.slice(0, 3).map((f, D) => {
|
|
@@ -4885,32 +4892,32 @@ const ns = ({
|
|
|
4885
4892
|
), _ = I(
|
|
4886
4893
|
"ina-select-dropdown__trigger-icon",
|
|
4887
4894
|
O && "ina-select-dropdown__trigger-icon--disabled"
|
|
4888
|
-
), x = () => v || W ? q : de != null && de !== "" && _e(de) || "",
|
|
4895
|
+
), x = () => v || W ? q : de != null && de !== "" && _e(de) || "", B = () => {
|
|
4889
4896
|
var D;
|
|
4890
|
-
!W && !O &&
|
|
4891
|
-
const f = (D =
|
|
4897
|
+
!W && !O && R(!0);
|
|
4898
|
+
const f = (D = $.current) == null ? void 0 : D.querySelector("input");
|
|
4892
4899
|
f && f.focus();
|
|
4893
|
-
},
|
|
4894
|
-
W ||
|
|
4900
|
+
}, z = (f) => {
|
|
4901
|
+
W || R(!0), xe(f);
|
|
4895
4902
|
}, d = (f) => {
|
|
4896
4903
|
var D;
|
|
4897
4904
|
if (!(O || f.disabled))
|
|
4898
4905
|
if (v) {
|
|
4899
4906
|
const V = Array.isArray(a) ? [...a] : [], te = V.includes(f.value) ? V.filter((ae) => ae !== f.value) : [...V, f.value];
|
|
4900
4907
|
V.includes(f.value) ? ye.current.delete(f.value) : ye.current.set(f.value, f.label), t(te);
|
|
4901
|
-
const le = (D =
|
|
4908
|
+
const le = (D = $.current) == null ? void 0 : D.querySelector("input");
|
|
4902
4909
|
le && le.focus();
|
|
4903
4910
|
} else
|
|
4904
|
-
f.value === de ? (ye.current.delete(f.value), t(null, f)) : (ye.current.set(f.value, f.label), t(f.value, f)),
|
|
4911
|
+
f.value === de ? (ye.current.delete(f.value), t(null, f)) : (ye.current.set(f.value, f.label), t(f.value, f)), R(!1), H(-1), ie ? P == null || P("") : G(""), C == null || C();
|
|
4905
4912
|
}, b = (f) => {
|
|
4906
|
-
f.key === "ArrowDown" ? (f.preventDefault(), W ?
|
|
4913
|
+
f.key === "ArrowDown" ? (f.preventDefault(), W ? H(
|
|
4907
4914
|
(D) => D < be.length - 1 ? D + 1 : D
|
|
4908
|
-
) : (
|
|
4915
|
+
) : (R(!0), H(0))) : f.key === "ArrowUp" ? (f.preventDefault(), H((D) => D > 0 ? D - 1 : D)) : f.key === "Enter" ? (f.preventDefault(), W && X >= 0 && X < be.length && d(be[X])) : f.key === "Escape" && (f.preventDefault(), R(!1), H(-1));
|
|
4909
4916
|
};
|
|
4910
4917
|
return /* @__PURE__ */ w(
|
|
4911
4918
|
"div",
|
|
4912
4919
|
{
|
|
4913
|
-
ref:
|
|
4920
|
+
ref: $,
|
|
4914
4921
|
style: { width: bt(u) },
|
|
4915
4922
|
className: Me,
|
|
4916
4923
|
children: [
|
|
@@ -4921,7 +4928,7 @@ const ns = ({
|
|
|
4921
4928
|
/* @__PURE__ */ w(
|
|
4922
4929
|
"div",
|
|
4923
4930
|
{
|
|
4924
|
-
onClick:
|
|
4931
|
+
onClick: B,
|
|
4925
4932
|
className: o,
|
|
4926
4933
|
role: "combobox",
|
|
4927
4934
|
"aria-expanded": W,
|
|
@@ -4938,7 +4945,7 @@ const ns = ({
|
|
|
4938
4945
|
),
|
|
4939
4946
|
placeholder: he,
|
|
4940
4947
|
value: x(),
|
|
4941
|
-
onChange:
|
|
4948
|
+
onChange: z,
|
|
4942
4949
|
onKeyDown: b,
|
|
4943
4950
|
disabled: O,
|
|
4944
4951
|
"aria-autocomplete": "list",
|
|
@@ -4993,7 +5000,7 @@ const ns = ({
|
|
|
4993
5000
|
D.scrollHeight - D.scrollTop - D.clientHeight < 50 && !L && S && N && !O && N(M + 1);
|
|
4994
5001
|
},
|
|
4995
5002
|
children: [
|
|
4996
|
-
|
|
5003
|
+
Z && /* @__PURE__ */ n("div", { className: "ina-select-dropdown__selection-title", children: Z }),
|
|
4997
5004
|
be.map((f, D) => {
|
|
4998
5005
|
const V = v ? ue.includes(f.value) : f.value === de, te = c ? c(f) : /* @__PURE__ */ n("span", { className: "ina-select-dropdown__option-label", children: f.label });
|
|
4999
5006
|
let le = null;
|
|
@@ -5308,11 +5315,11 @@ function ls({
|
|
|
5308
5315
|
lastColumnSticky: N = !1,
|
|
5309
5316
|
renderSortIndicator: g,
|
|
5310
5317
|
emptyState: m = "No data found",
|
|
5311
|
-
showPagination:
|
|
5318
|
+
showPagination: F = !0
|
|
5312
5319
|
}) {
|
|
5313
|
-
const [
|
|
5320
|
+
const [T, U] = Y([]), [P, O] = Y(0), [ee, j] = Y(!1), J = re(null), ce = fa(), [oe, Z] = Y(t), [W, R] = Y(r), [K, G] = Y(i), [X, H] = Y(
|
|
5314
5321
|
l
|
|
5315
|
-
), [
|
|
5322
|
+
), [$, se] = Y(""), [ve, me] = Y(""), [ye, ie] = Y({}), q = Object.values(ye).every(Boolean), ge = Object.values(ye).some(Boolean), [ue, de] = Y({}), [_e, Ne] = Y(null), he = Math.ceil(P / W);
|
|
5316
5323
|
ne(() => {
|
|
5317
5324
|
const V = new AbortController(), te = V.signal;
|
|
5318
5325
|
async function le() {
|
|
@@ -5323,7 +5330,7 @@ function ls({
|
|
|
5323
5330
|
pageSize: W,
|
|
5324
5331
|
sortField: K,
|
|
5325
5332
|
sortOrder: X,
|
|
5326
|
-
searchTerm:
|
|
5333
|
+
searchTerm: $
|
|
5327
5334
|
});
|
|
5328
5335
|
te.aborted || (U(ae.data), O(ae.total), ie({}), de({}), Ne(null));
|
|
5329
5336
|
} catch (ae) {
|
|
@@ -5335,18 +5342,18 @@ function ls({
|
|
|
5335
5342
|
return le(), () => {
|
|
5336
5343
|
V.abort();
|
|
5337
5344
|
};
|
|
5338
|
-
}, [oe, W, K, X,
|
|
5339
|
-
|
|
5345
|
+
}, [oe, W, K, X, $, a]), ne(() => {
|
|
5346
|
+
Z(t);
|
|
5340
5347
|
}, [t]);
|
|
5341
5348
|
const be = () => {
|
|
5342
5349
|
const V = !q, te = {};
|
|
5343
|
-
|
|
5350
|
+
T.forEach((le) => {
|
|
5344
5351
|
te[le[A]] = V;
|
|
5345
|
-
}), ie(te), h == null || h(V ? [
|
|
5352
|
+
}), ie(te), h == null || h(V ? [...T] : []);
|
|
5346
5353
|
}, xe = (V) => {
|
|
5347
5354
|
ie((te) => {
|
|
5348
5355
|
const le = { ...te, [V]: !te[V] };
|
|
5349
|
-
return h == null || h(
|
|
5356
|
+
return h == null || h(T.filter((ae) => le[ae[A]]).map((ae) => ae)), le;
|
|
5350
5357
|
});
|
|
5351
5358
|
}, we = (V, te, le, ae) => {
|
|
5352
5359
|
ae.stopPropagation(), de((Le) => ({
|
|
@@ -5364,19 +5371,19 @@ function ls({
|
|
|
5364
5371
|
return delete le[V], le;
|
|
5365
5372
|
}), Ne(null);
|
|
5366
5373
|
}, o = (V, te) => {
|
|
5367
|
-
V.sortable && (K === V.accessor && X === te ? (G(null),
|
|
5374
|
+
V.sortable && (K === V.accessor && X === te ? (G(null), H(null)) : (G(V.accessor), H(te)), Z(1));
|
|
5368
5375
|
}, _ = (V) => me(V), x = (V) => {
|
|
5369
|
-
V.key === "Enter" && (V.preventDefault(),
|
|
5370
|
-
},
|
|
5371
|
-
|
|
5372
|
-
},
|
|
5376
|
+
V.key === "Enter" && (V.preventDefault(), Z(1), se(ve.trim()));
|
|
5377
|
+
}, B = () => {
|
|
5378
|
+
Z(1), se(ve.trim());
|
|
5379
|
+
}, z = (V, te) => {
|
|
5373
5380
|
te.target.closest(
|
|
5374
5381
|
'button, [role="button"], .ina-button, [data-action]'
|
|
5375
5382
|
) || L && M && M(V);
|
|
5376
5383
|
};
|
|
5377
5384
|
ne(() => {
|
|
5378
5385
|
const V = (te) => {
|
|
5379
|
-
|
|
5386
|
+
J.current && !J.current.contains(te.target) && Ne(null);
|
|
5380
5387
|
};
|
|
5381
5388
|
return document.addEventListener("mousedown", V), () => {
|
|
5382
5389
|
document.removeEventListener("mousedown", V);
|
|
@@ -5403,7 +5410,7 @@ function ls({
|
|
|
5403
5410
|
disabled: ee
|
|
5404
5411
|
}
|
|
5405
5412
|
),
|
|
5406
|
-
/* @__PURE__ */ n(lt, { onClick:
|
|
5413
|
+
/* @__PURE__ */ n(lt, { onClick: B, disabled: ee, children: v })
|
|
5407
5414
|
] }) }),
|
|
5408
5415
|
/* @__PURE__ */ n(
|
|
5409
5416
|
kn,
|
|
@@ -5414,7 +5421,7 @@ function ls({
|
|
|
5414
5421
|
className: "ina-table__progress-bar"
|
|
5415
5422
|
}
|
|
5416
5423
|
),
|
|
5417
|
-
/* @__PURE__ */ w("table", { ref:
|
|
5424
|
+
/* @__PURE__ */ w("table", { ref: J, className: k, children: [
|
|
5418
5425
|
/* @__PURE__ */ n("thead", { className: f, children: /* @__PURE__ */ w("tr", { children: [
|
|
5419
5426
|
C && /* @__PURE__ */ n("th", { className: "ina-table__header-cell", children: /* @__PURE__ */ n(
|
|
5420
5427
|
Ut,
|
|
@@ -5486,14 +5493,14 @@ function ls({
|
|
|
5486
5493
|
);
|
|
5487
5494
|
})
|
|
5488
5495
|
] }) }),
|
|
5489
|
-
/* @__PURE__ */ n("tbody", { className: D, children: !ee &&
|
|
5496
|
+
/* @__PURE__ */ n("tbody", { className: D, children: !ee && T.length === 0 ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n(
|
|
5490
5497
|
"td",
|
|
5491
5498
|
{
|
|
5492
5499
|
colSpan: C ? e.length + 1 : e.length,
|
|
5493
5500
|
className: "ina-table__empty-cell",
|
|
5494
5501
|
children: m
|
|
5495
5502
|
}
|
|
5496
|
-
) }) :
|
|
5503
|
+
) }) : T.map((V, te) => {
|
|
5497
5504
|
const le = String(V[A]);
|
|
5498
5505
|
return /* @__PURE__ */ w(
|
|
5499
5506
|
"tr",
|
|
@@ -5503,7 +5510,7 @@ function ls({
|
|
|
5503
5510
|
ee && "ina-table__row--loading",
|
|
5504
5511
|
L && "ina-table__row--clickable"
|
|
5505
5512
|
),
|
|
5506
|
-
onClick: (ae) =>
|
|
5513
|
+
onClick: (ae) => z(V, ae),
|
|
5507
5514
|
children: [
|
|
5508
5515
|
C && /* @__PURE__ */ n("td", { className: "ina-table__cell", children: /* @__PURE__ */ n(
|
|
5509
5516
|
Ut,
|
|
@@ -5567,18 +5574,18 @@ function ls({
|
|
|
5567
5574
|
);
|
|
5568
5575
|
}) })
|
|
5569
5576
|
] }),
|
|
5570
|
-
|
|
5577
|
+
F && /* @__PURE__ */ n("div", { className: "ina-table__pagination", children: /* @__PURE__ */ n(
|
|
5571
5578
|
bn,
|
|
5572
5579
|
{
|
|
5573
5580
|
currentPage: oe,
|
|
5574
5581
|
totalPages: he,
|
|
5575
5582
|
pageSize: W,
|
|
5576
5583
|
pageSizeOptions: s,
|
|
5577
|
-
onPageChange:
|
|
5584
|
+
onPageChange: Z,
|
|
5578
5585
|
onPageSizeChange: (V) => {
|
|
5579
|
-
|
|
5586
|
+
R(V), Z(1);
|
|
5580
5587
|
},
|
|
5581
|
-
disabled: ee ||
|
|
5588
|
+
disabled: ee || P === 0,
|
|
5582
5589
|
fullWidth: !0
|
|
5583
5590
|
}
|
|
5584
5591
|
) })
|
|
@@ -5607,7 +5614,7 @@ function os({
|
|
|
5607
5614
|
onBlur: N,
|
|
5608
5615
|
...g
|
|
5609
5616
|
}) {
|
|
5610
|
-
const m = () => M != null && M.enableXssProtection ? Xe(e).sanitized : e, [
|
|
5617
|
+
const m = () => M != null && M.enableXssProtection ? Xe(e).sanitized : e, [F, T] = Y(m()), [U] = pt(F, t), P = re(!0), O = re(null), [ee, j] = Y(u);
|
|
5611
5618
|
ne(() => {
|
|
5612
5619
|
let G = e;
|
|
5613
5620
|
if (M != null && M.enableXssProtection) {
|
|
@@ -5617,39 +5624,39 @@ function os({
|
|
|
5617
5624
|
X.threats
|
|
5618
5625
|
), M.onSecurityViolation && M.onSecurityViolation(X.threats, e), G = X.sanitized);
|
|
5619
5626
|
}
|
|
5620
|
-
|
|
5627
|
+
T(G);
|
|
5621
5628
|
}, [e, M]), ne(() => {
|
|
5622
|
-
|
|
5629
|
+
P.current ? P.current = !1 : t > 0 && r && r(U);
|
|
5623
5630
|
}, [U, t, r]), ne(() => {
|
|
5624
5631
|
const G = O.current;
|
|
5625
5632
|
if (!G) return;
|
|
5626
5633
|
G.rows = u;
|
|
5627
|
-
const X = parseInt(getComputedStyle(G).lineHeight || "0", 10),
|
|
5628
|
-
let
|
|
5629
|
-
E && (
|
|
5630
|
-
}, [
|
|
5631
|
-
const
|
|
5634
|
+
const X = parseInt(getComputedStyle(G).lineHeight || "0", 10), H = G.scrollHeight;
|
|
5635
|
+
let $ = Math.floor(H / X);
|
|
5636
|
+
E && ($ = Math.min($, E)), j(Math.max($, u));
|
|
5637
|
+
}, [F, u, E]);
|
|
5638
|
+
const J = (G) => {
|
|
5632
5639
|
let X = G.target.value;
|
|
5633
5640
|
if (!(p != null && X.length > p)) {
|
|
5634
5641
|
if (M != null && M.enableXssProtection) {
|
|
5635
|
-
const
|
|
5636
|
-
|
|
5642
|
+
const H = Xe(X);
|
|
5643
|
+
H.isValid || (M.logViolations && console.warn("TextArea security violation:", H.threats), M.onSecurityViolation && M.onSecurityViolation(H.threats, X), X = H.sanitized);
|
|
5637
5644
|
}
|
|
5638
|
-
|
|
5645
|
+
T(X), a(X);
|
|
5639
5646
|
}
|
|
5640
5647
|
}, ce = (G) => {
|
|
5641
5648
|
N == null || N(G);
|
|
5642
5649
|
}, oe = () => {
|
|
5643
|
-
|
|
5644
|
-
},
|
|
5650
|
+
T(""), a(""), r && r("");
|
|
5651
|
+
}, Z = I("ina-text-area", L), W = I(
|
|
5645
5652
|
"ina-text-area__wrapper",
|
|
5646
5653
|
`ina-text-area__wrapper--status-${y}`,
|
|
5647
5654
|
S && "ina-text-area__wrapper--disabled"
|
|
5648
|
-
),
|
|
5655
|
+
), R = I(
|
|
5649
5656
|
"ina-text-area__helper-text",
|
|
5650
5657
|
`ina-text-area__helper-text--${y}`
|
|
5651
5658
|
), K = y !== "neutral" && v != null ? v : c;
|
|
5652
|
-
return /* @__PURE__ */ w("div", { className:
|
|
5659
|
+
return /* @__PURE__ */ w("div", { className: Z, children: [
|
|
5653
5660
|
l && /* @__PURE__ */ w(
|
|
5654
5661
|
"label",
|
|
5655
5662
|
{
|
|
@@ -5671,15 +5678,15 @@ function os({
|
|
|
5671
5678
|
ref: O,
|
|
5672
5679
|
rows: ee,
|
|
5673
5680
|
className: "ina-text-area__input",
|
|
5674
|
-
value:
|
|
5675
|
-
onChange:
|
|
5681
|
+
value: F,
|
|
5682
|
+
onChange: J,
|
|
5676
5683
|
onBlur: ce,
|
|
5677
5684
|
placeholder: A,
|
|
5678
5685
|
disabled: S,
|
|
5679
5686
|
maxLength: p
|
|
5680
5687
|
}
|
|
5681
5688
|
),
|
|
5682
|
-
h &&
|
|
5689
|
+
h && F !== "" && !S && /* @__PURE__ */ n(
|
|
5683
5690
|
"button",
|
|
5684
5691
|
{
|
|
5685
5692
|
type: "button",
|
|
@@ -5691,9 +5698,9 @@ function os({
|
|
|
5691
5698
|
),
|
|
5692
5699
|
i && /* @__PURE__ */ n("div", { className: "ina-text-area__suffix-icon", children: i })
|
|
5693
5700
|
] }),
|
|
5694
|
-
K && /* @__PURE__ */ n("div", { className:
|
|
5701
|
+
K && /* @__PURE__ */ n("div", { className: R, children: K }),
|
|
5695
5702
|
C && p != null && /* @__PURE__ */ w("div", { className: "ina-text-area__char-count", children: [
|
|
5696
|
-
|
|
5703
|
+
F.length,
|
|
5697
5704
|
"/",
|
|
5698
5705
|
p
|
|
5699
5706
|
] })
|
|
@@ -5733,30 +5740,30 @@ function cs({
|
|
|
5733
5740
|
return;
|
|
5734
5741
|
const m = e.split("");
|
|
5735
5742
|
m[M] = g;
|
|
5736
|
-
const
|
|
5737
|
-
if (a(
|
|
5738
|
-
const
|
|
5739
|
-
h.current[
|
|
5743
|
+
const F = m.join("").slice(0, t);
|
|
5744
|
+
if (a(F), g && M < t - 1) {
|
|
5745
|
+
const T = M + 1;
|
|
5746
|
+
h.current[T] && h.current[T].focus();
|
|
5740
5747
|
}
|
|
5741
5748
|
}, E = (M, N) => {
|
|
5742
5749
|
var g, m;
|
|
5743
5750
|
if (N.key === "Backspace")
|
|
5744
5751
|
if (!(e || "")[M] && M > 0) {
|
|
5745
|
-
const
|
|
5746
|
-
if (h.current[
|
|
5747
|
-
h.current[
|
|
5752
|
+
const T = M - 1;
|
|
5753
|
+
if (h.current[T]) {
|
|
5754
|
+
h.current[T].focus();
|
|
5748
5755
|
const U = e.split("");
|
|
5749
|
-
U[
|
|
5756
|
+
U[T] = "", a(U.join(""));
|
|
5750
5757
|
}
|
|
5751
5758
|
} else {
|
|
5752
|
-
const
|
|
5753
|
-
|
|
5759
|
+
const T = e.split("");
|
|
5760
|
+
T[M] = "", a(T.join(""));
|
|
5754
5761
|
}
|
|
5755
|
-
N.key === "ArrowLeft" && M > 0 && (N.preventDefault(), (g = h.current[M - 1]) == null || g.focus()), N.key === "ArrowRight" && M < t - 1 && (N.preventDefault(), (m = h.current[M + 1]) == null || m.focus()), (N.ctrlKey || N.metaKey) && N.key === "v" && (N.preventDefault(), navigator.clipboard.readText().then((
|
|
5756
|
-
const
|
|
5757
|
-
if (
|
|
5758
|
-
a(
|
|
5759
|
-
const U = Math.min(
|
|
5762
|
+
N.key === "ArrowLeft" && M > 0 && (N.preventDefault(), (g = h.current[M - 1]) == null || g.focus()), N.key === "ArrowRight" && M < t - 1 && (N.preventDefault(), (m = h.current[M + 1]) == null || m.focus()), (N.ctrlKey || N.metaKey) && N.key === "v" && (N.preventDefault(), navigator.clipboard.readText().then((F) => {
|
|
5763
|
+
const T = F.replace(/\D/g, "").slice(0, t);
|
|
5764
|
+
if (T) {
|
|
5765
|
+
a(T);
|
|
5766
|
+
const U = Math.min(T.length - 1, t - 1);
|
|
5760
5767
|
h.current[U] && h.current[U].focus();
|
|
5761
5768
|
}
|
|
5762
5769
|
}));
|
|
@@ -5860,14 +5867,14 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
5860
5867
|
disabledTimeBefore: N,
|
|
5861
5868
|
disabledTimeAfter: g,
|
|
5862
5869
|
showNowButton: m = !1,
|
|
5863
|
-
label:
|
|
5864
|
-
required:
|
|
5870
|
+
label: F,
|
|
5871
|
+
required: T,
|
|
5865
5872
|
...U
|
|
5866
|
-
},
|
|
5867
|
-
const [O, ee] = Y(!1), [j,
|
|
5873
|
+
}, P) => {
|
|
5874
|
+
const [O, ee] = Y(!1), [j, J] = Y(
|
|
5868
5875
|
e || v || ""
|
|
5869
|
-
), [ce, oe] = Y(null), [
|
|
5870
|
-
ma(
|
|
5876
|
+
), [ce, oe] = Y(null), [Z, W] = Y(null), [R, K] = Y(!1), G = re(null), X = re(null), H = re(null);
|
|
5877
|
+
ma(P, () => ({
|
|
5871
5878
|
focus: () => {
|
|
5872
5879
|
var o;
|
|
5873
5880
|
return (o = X.current) == null ? void 0 : o.focus();
|
|
@@ -5877,45 +5884,45 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
5877
5884
|
return (o = X.current) == null ? void 0 : o.blur();
|
|
5878
5885
|
}
|
|
5879
5886
|
}));
|
|
5880
|
-
const
|
|
5887
|
+
const $ = (o) => {
|
|
5881
5888
|
if (!o) return { hours: 0, minutes: 0, seconds: 0, period: "AM" };
|
|
5882
|
-
const _ = o.split(":"), x = _[0],
|
|
5889
|
+
const _ = o.split(":"), x = _[0], B = parseInt(_[1] || "0", 10), z = parseInt(_[2] || "0", 10);
|
|
5883
5890
|
if (u) {
|
|
5884
5891
|
const d = o.includes("AM") ? "AM" : "PM", b = parseInt(x.replace(/[^\d]/g, ""), 10);
|
|
5885
|
-
return { hours: b === 12 ? 0 : b, minutes:
|
|
5892
|
+
return { hours: b === 12 ? 0 : b, minutes: B, seconds: z, period: d };
|
|
5886
5893
|
} else
|
|
5887
|
-
return { hours: parseInt(x, 10), minutes:
|
|
5888
|
-
}, se = (o, _, x,
|
|
5889
|
-
let
|
|
5890
|
-
u && (
|
|
5891
|
-
const d =
|
|
5894
|
+
return { hours: parseInt(x, 10), minutes: B, seconds: z, period: "AM" };
|
|
5895
|
+
}, se = (o, _, x, B) => {
|
|
5896
|
+
let z = o;
|
|
5897
|
+
u && (B === "PM" && o > 0 && (z = o + 12), z = z || 12);
|
|
5898
|
+
const d = z.toString().padStart(2, "0"), b = _.toString().padStart(2, "0");
|
|
5892
5899
|
if (E) {
|
|
5893
5900
|
const k = x.toString().padStart(2, "0");
|
|
5894
|
-
return u ? `${o}:${b}:${k} ${
|
|
5901
|
+
return u ? `${o}:${b}:${k} ${B}` : `${d}:${b}:${k}`;
|
|
5895
5902
|
}
|
|
5896
|
-
return u ? `${o}:${b} ${
|
|
5903
|
+
return u ? `${o}:${b} ${B}` : `${d}:${b}`;
|
|
5897
5904
|
}, ve = (o) => {
|
|
5898
5905
|
if (!o) return 0;
|
|
5899
|
-
const _ = o.split(":"), x = parseInt(_[0] || "0", 10),
|
|
5906
|
+
const _ = o.split(":"), x = parseInt(_[0] || "0", 10), B = parseInt(_[1] || "0", 10);
|
|
5900
5907
|
if (u && o.includes(" ")) {
|
|
5901
|
-
const
|
|
5908
|
+
const z = o.split(" ")[1];
|
|
5902
5909
|
let d = x;
|
|
5903
|
-
return
|
|
5910
|
+
return z === "PM" && x !== 12 ? d = x + 12 : z === "AM" && x === 12 && (d = 0), d * 60 + B;
|
|
5904
5911
|
}
|
|
5905
|
-
return x * 60 +
|
|
5906
|
-
}, me = (o, _, x,
|
|
5907
|
-
const d = se(o, _, x,
|
|
5908
|
-
if (M && !
|
|
5912
|
+
return x * 60 + B;
|
|
5913
|
+
}, me = (o, _, x, B, z = {}) => {
|
|
5914
|
+
const d = se(o, _, x, B), b = ve(d);
|
|
5915
|
+
if (M && !z.ignoreBefore) {
|
|
5909
5916
|
const k = /* @__PURE__ */ new Date(), f = k.getHours() * 60 + k.getMinutes();
|
|
5910
5917
|
if (b < f)
|
|
5911
5918
|
return !0;
|
|
5912
5919
|
}
|
|
5913
|
-
if (N && !
|
|
5920
|
+
if (N && !z.ignoreBefore) {
|
|
5914
5921
|
const k = ve(N);
|
|
5915
5922
|
if (b < k)
|
|
5916
5923
|
return !0;
|
|
5917
5924
|
}
|
|
5918
|
-
if (g && !
|
|
5925
|
+
if (g && !z.ignoreAfter) {
|
|
5919
5926
|
const k = ve(g);
|
|
5920
5927
|
if (b > k)
|
|
5921
5928
|
return !0;
|
|
@@ -5938,7 +5945,7 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
5938
5945
|
break;
|
|
5939
5946
|
}
|
|
5940
5947
|
return _;
|
|
5941
|
-
}, ie =
|
|
5948
|
+
}, ie = $(j || ""), q = ye("hour"), ge = ye("minute"), ue = ye("second"), de = () => {
|
|
5942
5949
|
a || O || (ee(!0), K(!0), C == null || C(!0), setTimeout(() => {
|
|
5943
5950
|
var o;
|
|
5944
5951
|
return (o = X.current) == null ? void 0 : o.focus();
|
|
@@ -5948,16 +5955,16 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
5948
5955
|
}, Ne = () => {
|
|
5949
5956
|
a || (O ? _e() : de());
|
|
5950
5957
|
}, he = (o, _) => {
|
|
5951
|
-
let x = ie.hours,
|
|
5958
|
+
let x = ie.hours, B = ie.minutes, z = ie.seconds, d = ie.period;
|
|
5952
5959
|
switch (o) {
|
|
5953
5960
|
case "hour":
|
|
5954
5961
|
x = u && _ === 12 ? 0 : _;
|
|
5955
5962
|
break;
|
|
5956
5963
|
case "minute":
|
|
5957
|
-
|
|
5964
|
+
B = _;
|
|
5958
5965
|
break;
|
|
5959
5966
|
case "second":
|
|
5960
|
-
|
|
5967
|
+
z = _;
|
|
5961
5968
|
break;
|
|
5962
5969
|
case "period":
|
|
5963
5970
|
d = _;
|
|
@@ -5965,19 +5972,19 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
5965
5972
|
}
|
|
5966
5973
|
const b = se(
|
|
5967
5974
|
x,
|
|
5975
|
+
B,
|
|
5968
5976
|
z,
|
|
5969
|
-
R,
|
|
5970
5977
|
u ? d : void 0
|
|
5971
5978
|
);
|
|
5972
|
-
|
|
5979
|
+
J(b), p == null || p(b);
|
|
5973
5980
|
}, be = (o) => {
|
|
5974
5981
|
const _ = o.target.value;
|
|
5975
|
-
|
|
5982
|
+
J(_), p == null || p(_);
|
|
5976
5983
|
}, xe = () => {
|
|
5977
|
-
|
|
5984
|
+
J(""), p == null || p("");
|
|
5978
5985
|
};
|
|
5979
5986
|
ne(() => {
|
|
5980
|
-
v !== void 0 && v !== j &&
|
|
5987
|
+
v !== void 0 && v !== j && J(v);
|
|
5981
5988
|
}, [v]), ne(() => {
|
|
5982
5989
|
const o = (_) => {
|
|
5983
5990
|
G.current && !G.current.contains(_.target) && _e();
|
|
@@ -6000,10 +6007,10 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6000
6007
|
onMouseLeave: () => {
|
|
6001
6008
|
oe(null), W(null);
|
|
6002
6009
|
},
|
|
6003
|
-
children: _.map((
|
|
6004
|
-
let
|
|
6010
|
+
children: _.map((B) => {
|
|
6011
|
+
let z = !1;
|
|
6005
6012
|
if (o === "hour") {
|
|
6006
|
-
const k = u &&
|
|
6013
|
+
const k = u && B === 12 ? 0 : B, f = me(
|
|
6007
6014
|
k,
|
|
6008
6015
|
59,
|
|
6009
6016
|
59,
|
|
@@ -6016,24 +6023,24 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6016
6023
|
u ? ie.period : void 0,
|
|
6017
6024
|
{ ignoreBefore: !0 }
|
|
6018
6025
|
);
|
|
6019
|
-
|
|
6020
|
-
} else o === "minute" ?
|
|
6026
|
+
z = f || D;
|
|
6027
|
+
} else o === "minute" ? z = me(
|
|
6021
6028
|
ie.hours,
|
|
6022
|
-
|
|
6029
|
+
B,
|
|
6023
6030
|
ie.seconds,
|
|
6024
6031
|
u ? ie.period : void 0
|
|
6025
|
-
) : o === "second" ?
|
|
6032
|
+
) : o === "second" ? z = me(
|
|
6026
6033
|
ie.hours,
|
|
6027
6034
|
ie.minutes,
|
|
6028
|
-
|
|
6035
|
+
B,
|
|
6029
6036
|
u ? ie.period : void 0
|
|
6030
|
-
) : o === "period" && (
|
|
6037
|
+
) : o === "period" && (z = me(
|
|
6031
6038
|
ie.hours,
|
|
6032
6039
|
ie.minutes,
|
|
6033
6040
|
ie.seconds,
|
|
6034
|
-
|
|
6041
|
+
B
|
|
6035
6042
|
));
|
|
6036
|
-
const d =
|
|
6043
|
+
const d = B === x, b = d || !_.includes(x) && B === _[0];
|
|
6037
6044
|
return /* @__PURE__ */ n(
|
|
6038
6045
|
"div",
|
|
6039
6046
|
{
|
|
@@ -6043,14 +6050,14 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6043
6050
|
className: I(
|
|
6044
6051
|
"ina-time-picker__option",
|
|
6045
6052
|
d && "ina-time-picker__option--selected",
|
|
6046
|
-
|
|
6047
|
-
|
|
6053
|
+
Z === B && "ina-time-picker__option--hovered",
|
|
6054
|
+
z && "ina-time-picker__option--disabled"
|
|
6048
6055
|
),
|
|
6049
|
-
onClick: () => !
|
|
6056
|
+
onClick: () => !z && he(o, B),
|
|
6050
6057
|
onKeyDown: (k) => {
|
|
6051
|
-
if (!
|
|
6058
|
+
if (!z) {
|
|
6052
6059
|
if (k.key === "Enter" || k.key === " ")
|
|
6053
|
-
k.preventDefault(), he(o,
|
|
6060
|
+
k.preventDefault(), he(o, B);
|
|
6054
6061
|
else if (k.key === "ArrowDown") {
|
|
6055
6062
|
k.preventDefault();
|
|
6056
6063
|
const f = k.currentTarget.nextElementSibling;
|
|
@@ -6063,11 +6070,11 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6063
6070
|
}
|
|
6064
6071
|
},
|
|
6065
6072
|
onMouseEnter: () => {
|
|
6066
|
-
|
|
6073
|
+
z || (oe(o), W(B));
|
|
6067
6074
|
},
|
|
6068
|
-
children:
|
|
6075
|
+
children: B.toString().padStart(2, "0")
|
|
6069
6076
|
},
|
|
6070
|
-
|
|
6077
|
+
B
|
|
6071
6078
|
);
|
|
6072
6079
|
})
|
|
6073
6080
|
}
|
|
@@ -6087,9 +6094,9 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6087
6094
|
(L || A) && "ina-time-picker__input--with-suffix"
|
|
6088
6095
|
);
|
|
6089
6096
|
return /* @__PURE__ */ w("div", { ref: G, className: Ie, children: [
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6097
|
+
F && /* @__PURE__ */ w("label", { className: "ina-time-picker__label", children: [
|
|
6098
|
+
F,
|
|
6099
|
+
T && /* @__PURE__ */ n("span", { className: "ina-time-picker__required", children: "*" })
|
|
6093
6100
|
] }),
|
|
6094
6101
|
/* @__PURE__ */ w(
|
|
6095
6102
|
"div",
|
|
@@ -6120,7 +6127,7 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6120
6127
|
o.stopPropagation(), de();
|
|
6121
6128
|
},
|
|
6122
6129
|
onFocus: () => {
|
|
6123
|
-
|
|
6130
|
+
R || de(), K(!1);
|
|
6124
6131
|
},
|
|
6125
6132
|
placeholder: l,
|
|
6126
6133
|
disabled: a,
|
|
@@ -6155,7 +6162,7 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6155
6162
|
]
|
|
6156
6163
|
}
|
|
6157
6164
|
),
|
|
6158
|
-
O && /* @__PURE__ */ w("div", { ref:
|
|
6165
|
+
O && /* @__PURE__ */ w("div", { ref: H, className: "ina-time-picker__panel", children: [
|
|
6159
6166
|
/* @__PURE__ */ w("div", { className: "ina-time-picker__content", children: [
|
|
6160
6167
|
we(
|
|
6161
6168
|
"hour",
|
|
@@ -6211,13 +6218,13 @@ const In = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6211
6218
|
o.getMinutes(),
|
|
6212
6219
|
E ? o.getSeconds() : 0,
|
|
6213
6220
|
u ? o.getHours() >= 12 ? "PM" : "AM" : void 0
|
|
6214
|
-
), x = o.getHours() % 12 || 12,
|
|
6221
|
+
), x = o.getHours() % 12 || 12, B = u ? se(
|
|
6215
6222
|
x,
|
|
6216
6223
|
o.getMinutes(),
|
|
6217
6224
|
E ? o.getSeconds() : 0,
|
|
6218
6225
|
o.getHours() >= 12 ? "PM" : "AM"
|
|
6219
6226
|
) : _;
|
|
6220
|
-
|
|
6227
|
+
J(B), p == null || p(B), _e();
|
|
6221
6228
|
},
|
|
6222
6229
|
children: "Sekarang"
|
|
6223
6230
|
}
|
|
@@ -6729,8 +6736,8 @@ function Hn(e) {
|
|
|
6729
6736
|
if (!i) {
|
|
6730
6737
|
const m = Dt(r, t._names, g || t._formValues, !1, y.current);
|
|
6731
6738
|
if (v.current) {
|
|
6732
|
-
const
|
|
6733
|
-
Ge(
|
|
6739
|
+
const F = v.current(m);
|
|
6740
|
+
Ge(F, p.current) || (E(F), p.current = F);
|
|
6734
6741
|
} else
|
|
6735
6742
|
E(m);
|
|
6736
6743
|
}
|
|
@@ -6807,7 +6814,7 @@ function On(e) {
|
|
|
6807
6814
|
m && m._f && g && (m._f.ref = {
|
|
6808
6815
|
focus: () => Fe(g.focus) && g.focus(),
|
|
6809
6816
|
select: () => Fe(g.select) && g.select(),
|
|
6810
|
-
setCustomValidity: (
|
|
6817
|
+
setCustomValidity: (F) => Fe(g.setCustomValidity) && g.setCustomValidity(F),
|
|
6811
6818
|
reportValidity: () => Fe(g.reportValidity) && g.reportValidity()
|
|
6812
6819
|
});
|
|
6813
6820
|
}, [s._fields, t]), N = pe.useMemo(() => ({
|
|
@@ -6824,16 +6831,16 @@ function On(e) {
|
|
|
6824
6831
|
...h.current.rules,
|
|
6825
6832
|
...Pe(h.current.disabled) ? { disabled: h.current.disabled } : {}
|
|
6826
6833
|
});
|
|
6827
|
-
const
|
|
6828
|
-
const
|
|
6829
|
-
|
|
6834
|
+
const F = (T, U) => {
|
|
6835
|
+
const P = Q(s._fields, T);
|
|
6836
|
+
P && P._f && (P._f.mount = U);
|
|
6830
6837
|
};
|
|
6831
|
-
if (
|
|
6832
|
-
const
|
|
6833
|
-
ke(s._defaultValues, t,
|
|
6838
|
+
if (F(t, !0), g) {
|
|
6839
|
+
const T = De(Q(s._options.defaultValues, t, h.current.defaultValue));
|
|
6840
|
+
ke(s._defaultValues, t, T), Ce(Q(s._formValues, t)) && ke(s._formValues, t, T);
|
|
6834
6841
|
}
|
|
6835
6842
|
return !y && s.register(t), u.current = t, () => {
|
|
6836
|
-
(y ? g && !s._state.action : g) ? s.unregister(t) :
|
|
6843
|
+
(y ? g && !s._state.action : g) ? s.unregister(t) : F(t, !1);
|
|
6837
6844
|
};
|
|
6838
6845
|
}, [t, s, y, i]), pe.useEffect(() => {
|
|
6839
6846
|
s._setDisabledField({
|
|
@@ -7100,70 +7107,70 @@ var Je = (e) => Ee(e) && !ft(e) ? e : {
|
|
|
7100
7107
|
return {};
|
|
7101
7108
|
const N = c ? c[0] : l, g = (j) => {
|
|
7102
7109
|
s && N.reportValidity && (N.setCustomValidity(Pe(j) ? "" : j || ""), N.reportValidity());
|
|
7103
|
-
}, m = {},
|
|
7104
|
-
const W = j ?
|
|
7110
|
+
}, m = {}, F = Pt(l), T = rt(l), U = F || T, P = (S || Bt(l)) && Ce(l.value) && Ce(M) || ut(l) && l.value === "" || M === "" || Array.isArray(M) && !M.length, O = Wn.bind(null, A, r, m), ee = (j, J, ce, oe = je.maxLength, Z = je.minLength) => {
|
|
7111
|
+
const W = j ? J : ce;
|
|
7105
7112
|
m[A] = {
|
|
7106
|
-
type: j ? oe :
|
|
7113
|
+
type: j ? oe : Z,
|
|
7107
7114
|
message: W,
|
|
7108
7115
|
ref: l,
|
|
7109
|
-
...O(j ? oe :
|
|
7116
|
+
...O(j ? oe : Z, W)
|
|
7110
7117
|
};
|
|
7111
7118
|
};
|
|
7112
|
-
if (i ? !Array.isArray(M) || !M.length : y && (!U && (
|
|
7113
|
-
const { value: j, message:
|
|
7119
|
+
if (i ? !Array.isArray(M) || !M.length : y && (!U && (P || ze(M)) || Pe(M) && !M || T && !za(c).isValid || F && !Pa(c).isValid)) {
|
|
7120
|
+
const { value: j, message: J } = He(y) ? { value: !!y, message: y } : Je(y);
|
|
7114
7121
|
if (j && (m[A] = {
|
|
7115
7122
|
type: je.required,
|
|
7116
|
-
message:
|
|
7123
|
+
message: J,
|
|
7117
7124
|
ref: N,
|
|
7118
|
-
...O(je.required,
|
|
7125
|
+
...O(je.required, J)
|
|
7119
7126
|
}, !r))
|
|
7120
|
-
return g(
|
|
7127
|
+
return g(J), m;
|
|
7121
7128
|
}
|
|
7122
|
-
if (!
|
|
7123
|
-
let j,
|
|
7129
|
+
if (!P && (!ze(C) || !ze(h))) {
|
|
7130
|
+
let j, J;
|
|
7124
7131
|
const ce = Je(h), oe = Je(C);
|
|
7125
7132
|
if (!ze(M) && !isNaN(M)) {
|
|
7126
|
-
const
|
|
7127
|
-
ze(ce.value) || (j =
|
|
7133
|
+
const Z = l.valueAsNumber || M && +M;
|
|
7134
|
+
ze(ce.value) || (j = Z > ce.value), ze(oe.value) || (J = Z < oe.value);
|
|
7128
7135
|
} else {
|
|
7129
|
-
const
|
|
7130
|
-
He(ce.value) && M && (j =
|
|
7136
|
+
const Z = l.valueAsDate || new Date(M), W = (G) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + G), R = l.type == "time", K = l.type == "week";
|
|
7137
|
+
He(ce.value) && M && (j = R ? W(M) > W(ce.value) : K ? M > ce.value : Z > new Date(ce.value)), He(oe.value) && M && (J = R ? W(M) < W(oe.value) : K ? M < oe.value : Z < new Date(oe.value));
|
|
7131
7138
|
}
|
|
7132
|
-
if ((j ||
|
|
7139
|
+
if ((j || J) && (ee(!!j, ce.message, oe.message, je.max, je.min), !r))
|
|
7133
7140
|
return g(m[A].message), m;
|
|
7134
7141
|
}
|
|
7135
|
-
if ((v || p) && !
|
|
7136
|
-
const j = Je(v),
|
|
7137
|
-
if ((ce || oe) && (ee(ce, j.message,
|
|
7142
|
+
if ((v || p) && !P && (He(M) || i && Array.isArray(M))) {
|
|
7143
|
+
const j = Je(v), J = Je(p), ce = !ze(j.value) && M.length > +j.value, oe = !ze(J.value) && M.length < +J.value;
|
|
7144
|
+
if ((ce || oe) && (ee(ce, j.message, J.message), !r))
|
|
7138
7145
|
return g(m[A].message), m;
|
|
7139
7146
|
}
|
|
7140
|
-
if (u && !
|
|
7141
|
-
const { value: j, message:
|
|
7147
|
+
if (u && !P && He(M)) {
|
|
7148
|
+
const { value: j, message: J } = Je(u);
|
|
7142
7149
|
if (ft(j) && !M.match(j) && (m[A] = {
|
|
7143
7150
|
type: je.pattern,
|
|
7144
|
-
message:
|
|
7151
|
+
message: J,
|
|
7145
7152
|
ref: l,
|
|
7146
|
-
...O(je.pattern,
|
|
7153
|
+
...O(je.pattern, J)
|
|
7147
7154
|
}, !r))
|
|
7148
|
-
return g(
|
|
7155
|
+
return g(J), m;
|
|
7149
7156
|
}
|
|
7150
7157
|
if (E) {
|
|
7151
7158
|
if (Fe(E)) {
|
|
7152
|
-
const j = await E(M, t),
|
|
7153
|
-
if (
|
|
7154
|
-
...
|
|
7155
|
-
...O(je.validate,
|
|
7159
|
+
const j = await E(M, t), J = sa(j, N);
|
|
7160
|
+
if (J && (m[A] = {
|
|
7161
|
+
...J,
|
|
7162
|
+
...O(je.validate, J.message)
|
|
7156
7163
|
}, !r))
|
|
7157
|
-
return g(
|
|
7164
|
+
return g(J.message), m;
|
|
7158
7165
|
} else if (Ee(E)) {
|
|
7159
7166
|
let j = {};
|
|
7160
|
-
for (const
|
|
7167
|
+
for (const J in E) {
|
|
7161
7168
|
if (!Te(j) && !r)
|
|
7162
7169
|
break;
|
|
7163
|
-
const ce = sa(await E[
|
|
7170
|
+
const ce = sa(await E[J](M, t), N, J);
|
|
7164
7171
|
ce && (j = {
|
|
7165
7172
|
...ce,
|
|
7166
|
-
...O(
|
|
7173
|
+
...O(J, ce.message)
|
|
7167
7174
|
}, g(ce.message), r && (m[A] = j));
|
|
7168
7175
|
}
|
|
7169
7176
|
if (!Te(j) && (m[A] = {
|
|
@@ -7244,19 +7251,19 @@ function sr(e = {}) {
|
|
|
7244
7251
|
validatingFields: t.validatingFields,
|
|
7245
7252
|
isValidating: !Te(t.validatingFields)
|
|
7246
7253
|
}));
|
|
7247
|
-
}, M = (o, _ = [], x,
|
|
7248
|
-
if (
|
|
7254
|
+
}, M = (o, _ = [], x, B, z = !0, d = !0) => {
|
|
7255
|
+
if (B && x && !a.disabled) {
|
|
7249
7256
|
if (l.action = !0, d && Array.isArray(Q(r, o))) {
|
|
7250
|
-
const b = x(Q(r, o),
|
|
7251
|
-
|
|
7257
|
+
const b = x(Q(r, o), B.argA, B.argB);
|
|
7258
|
+
z && ke(r, o, b);
|
|
7252
7259
|
}
|
|
7253
7260
|
if (d && Array.isArray(Q(t.errors, o))) {
|
|
7254
|
-
const b = x(Q(t.errors, o),
|
|
7255
|
-
|
|
7261
|
+
const b = x(Q(t.errors, o), B.argA, B.argB);
|
|
7262
|
+
z && ke(t.errors, o, b), ar(t.errors, o);
|
|
7256
7263
|
}
|
|
7257
7264
|
if ((C.touchedFields || h.touchedFields) && d && Array.isArray(Q(t.touchedFields, o))) {
|
|
7258
|
-
const b = x(Q(t.touchedFields, o),
|
|
7259
|
-
|
|
7265
|
+
const b = x(Q(t.touchedFields, o), B.argA, B.argB);
|
|
7266
|
+
z && ke(t.touchedFields, o, b);
|
|
7260
7267
|
}
|
|
7261
7268
|
(C.dirtyFields || h.dirtyFields) && (t.dirtyFields = Ze(s, i)), u.state.next({
|
|
7262
7269
|
name: o,
|
|
@@ -7276,19 +7283,19 @@ function sr(e = {}) {
|
|
|
7276
7283
|
errors: t.errors,
|
|
7277
7284
|
isValid: !1
|
|
7278
7285
|
});
|
|
7279
|
-
}, m = (o, _, x,
|
|
7280
|
-
const
|
|
7281
|
-
if (
|
|
7286
|
+
}, m = (o, _, x, B) => {
|
|
7287
|
+
const z = Q(r, o);
|
|
7288
|
+
if (z) {
|
|
7282
7289
|
const d = Q(i, o, Ce(x) ? Q(s, o) : x);
|
|
7283
|
-
Ce(d) ||
|
|
7290
|
+
Ce(d) || B && B.defaultChecked || _ ? ke(i, o, _ ? d : ea(z._f)) : oe(o, d), l.mount && !l.action && S();
|
|
7284
7291
|
}
|
|
7285
|
-
},
|
|
7292
|
+
}, F = (o, _, x, B, z) => {
|
|
7286
7293
|
let d = !1, b = !1;
|
|
7287
7294
|
const k = {
|
|
7288
7295
|
name: o
|
|
7289
7296
|
};
|
|
7290
7297
|
if (!a.disabled) {
|
|
7291
|
-
if (!x ||
|
|
7298
|
+
if (!x || B) {
|
|
7292
7299
|
(C.isDirty || h.isDirty) && (b = t.isDirty, t.isDirty = k.isDirty = j(), d = b !== k.isDirty);
|
|
7293
7300
|
const f = Ge(Q(s, o), _);
|
|
7294
7301
|
b = !!Q(t.dirtyFields, o), f ? Se(t.dirtyFields, o) : ke(t.dirtyFields, o, !0), k.dirtyFields = t.dirtyFields, d = d || (C.dirtyFields || h.dirtyFields) && b !== !f;
|
|
@@ -7297,14 +7304,14 @@ function sr(e = {}) {
|
|
|
7297
7304
|
const f = Q(t.touchedFields, o);
|
|
7298
7305
|
f || (ke(t.touchedFields, o, x), k.touchedFields = t.touchedFields, d = d || (C.touchedFields || h.touchedFields) && f !== x);
|
|
7299
7306
|
}
|
|
7300
|
-
d &&
|
|
7307
|
+
d && z && u.state.next(k);
|
|
7301
7308
|
}
|
|
7302
7309
|
return d ? k : {};
|
|
7303
|
-
},
|
|
7304
|
-
const
|
|
7305
|
-
if (a.delayError && x ? (y = A(() => N(o, x)), y(a.delayError)) : (clearTimeout(v), y = null, x ? ke(t.errors, o, x) : Se(t.errors, o)), (x ? !Ge(
|
|
7310
|
+
}, T = (o, _, x, B) => {
|
|
7311
|
+
const z = Q(t.errors, o), d = (C.isValid || h.isValid) && Pe(_) && t.isValid !== _;
|
|
7312
|
+
if (a.delayError && x ? (y = A(() => N(o, x)), y(a.delayError)) : (clearTimeout(v), y = null, x ? ke(t.errors, o, x) : Se(t.errors, o)), (x ? !Ge(z, x) : z) || !Te(B) || d) {
|
|
7306
7313
|
const b = {
|
|
7307
|
-
...
|
|
7314
|
+
...B,
|
|
7308
7315
|
...d && Pe(_) ? { isValid: _ } : {},
|
|
7309
7316
|
errors: t.errors,
|
|
7310
7317
|
name: o
|
|
@@ -7314,12 +7321,12 @@ function sr(e = {}) {
|
|
|
7314
7321
|
...b
|
|
7315
7322
|
}, u.state.next(b);
|
|
7316
7323
|
}
|
|
7317
|
-
}, U = async (o) => (L(o, !0), await a.resolver(i, a.context, Jn(o || c.mount, r, a.criteriaMode, a.shouldUseNativeValidation))),
|
|
7324
|
+
}, U = async (o) => (L(o, !0), await a.resolver(i, a.context, Jn(o || c.mount, r, a.criteriaMode, a.shouldUseNativeValidation))), P = async (o) => {
|
|
7318
7325
|
const { errors: _ } = await U(o);
|
|
7319
7326
|
if (L(o), o)
|
|
7320
7327
|
for (const x of o) {
|
|
7321
|
-
const
|
|
7322
|
-
|
|
7328
|
+
const B = Q(_, x);
|
|
7329
|
+
B ? ke(t.errors, x, B) : Se(t.errors, x);
|
|
7323
7330
|
}
|
|
7324
7331
|
else
|
|
7325
7332
|
t.errors = _;
|
|
@@ -7327,14 +7334,14 @@ function sr(e = {}) {
|
|
|
7327
7334
|
}, O = async (o, _, x = {
|
|
7328
7335
|
valid: !0
|
|
7329
7336
|
}) => {
|
|
7330
|
-
for (const
|
|
7331
|
-
const
|
|
7332
|
-
if (
|
|
7333
|
-
const { _f: d, ...b } =
|
|
7337
|
+
for (const B in o) {
|
|
7338
|
+
const z = o[B];
|
|
7339
|
+
if (z) {
|
|
7340
|
+
const { _f: d, ...b } = z;
|
|
7334
7341
|
if (d) {
|
|
7335
|
-
const k = c.array.has(d.name), f =
|
|
7342
|
+
const k = c.array.has(d.name), f = z._f && Zn(z._f);
|
|
7336
7343
|
f && C.validatingFields && L([d.name], !0);
|
|
7337
|
-
const D = await ia(
|
|
7344
|
+
const D = await ia(z, c.disabled, i, E, a.shouldUseNativeValidation && !_, k);
|
|
7338
7345
|
if (f && C.validatingFields && L([d.name]), D[d.name] && (x.valid = !1, _ || e.shouldUseNativeValidation))
|
|
7339
7346
|
break;
|
|
7340
7347
|
!_ && (Q(D, d.name) ? k ? nr(t.errors, D, d.name) : ke(t.errors, d.name, D[d.name]) : Se(t.errors, d.name));
|
|
@@ -7349,38 +7356,38 @@ function sr(e = {}) {
|
|
|
7349
7356
|
_ && (_._f.refs ? _._f.refs.every((x) => !wt(x)) : !wt(_._f.ref)) && ie(o);
|
|
7350
7357
|
}
|
|
7351
7358
|
c.unMount = /* @__PURE__ */ new Set();
|
|
7352
|
-
}, j = (o, _) => !a.disabled && (o && _ && ke(i, o, _), !Ge(X(), s)),
|
|
7359
|
+
}, j = (o, _) => !a.disabled && (o && _ && ke(i, o, _), !Ge(X(), s)), J = (o, _, x) => Dt(o, c, {
|
|
7353
7360
|
...l.mount ? i : Ce(_) ? s : He(o) ? { [o]: _ } : _
|
|
7354
7361
|
}, x, _), ce = (o) => Tt(Q(l.mount ? i : s, o, a.shouldUnregister ? Q(s, o, []) : [])), oe = (o, _, x = {}) => {
|
|
7355
|
-
const
|
|
7356
|
-
let
|
|
7357
|
-
if (
|
|
7358
|
-
const d =
|
|
7359
|
-
d && (!d.disabled && ke(i, o, Ba(_, d)),
|
|
7360
|
-
(!b.defaultChecked || !b.disabled) && (Array.isArray(
|
|
7361
|
-
}) : d.refs.forEach((b) => b.checked = b.value ===
|
|
7362
|
+
const B = Q(r, o);
|
|
7363
|
+
let z = _;
|
|
7364
|
+
if (B) {
|
|
7365
|
+
const d = B._f;
|
|
7366
|
+
d && (!d.disabled && ke(i, o, Ba(_, d)), z = ut(d.ref) && ze(_) ? "" : _, $a(d.ref) ? [...d.ref.options].forEach((b) => b.selected = z.includes(b.value)) : d.refs ? rt(d.ref) ? d.refs.forEach((b) => {
|
|
7367
|
+
(!b.defaultChecked || !b.disabled) && (Array.isArray(z) ? b.checked = !!z.find((k) => k === b.value) : b.checked = z === b.value || !!z);
|
|
7368
|
+
}) : d.refs.forEach((b) => b.checked = b.value === z) : Bt(d.ref) ? d.ref.value = "" : (d.ref.value = z, d.ref.type || u.state.next({
|
|
7362
7369
|
name: o,
|
|
7363
7370
|
values: De(i)
|
|
7364
7371
|
})));
|
|
7365
7372
|
}
|
|
7366
|
-
(x.shouldDirty || x.shouldTouch) &&
|
|
7367
|
-
},
|
|
7368
|
-
for (const
|
|
7369
|
-
if (!_.hasOwnProperty(
|
|
7373
|
+
(x.shouldDirty || x.shouldTouch) && F(o, z, x.shouldTouch, x.shouldDirty, !0), x.shouldValidate && G(o);
|
|
7374
|
+
}, Z = (o, _, x) => {
|
|
7375
|
+
for (const B in _) {
|
|
7376
|
+
if (!_.hasOwnProperty(B))
|
|
7370
7377
|
return;
|
|
7371
|
-
const
|
|
7372
|
-
(c.array.has(o) || Ee(
|
|
7378
|
+
const z = _[B], d = o + "." + B, b = Q(r, d);
|
|
7379
|
+
(c.array.has(o) || Ee(z) || b && !b._f) && !Ke(z) ? Z(d, z, x) : oe(d, z, x);
|
|
7373
7380
|
}
|
|
7374
7381
|
}, W = (o, _, x = {}) => {
|
|
7375
|
-
const
|
|
7376
|
-
ke(i, o, d),
|
|
7382
|
+
const B = Q(r, o), z = c.array.has(o), d = De(_);
|
|
7383
|
+
ke(i, o, d), z ? (u.array.next({
|
|
7377
7384
|
name: o,
|
|
7378
7385
|
values: De(i)
|
|
7379
7386
|
}), (C.isDirty || C.dirtyFields || h.isDirty || h.dirtyFields) && x.shouldDirty && u.state.next({
|
|
7380
7387
|
name: o,
|
|
7381
7388
|
dirtyFields: Ze(s, i),
|
|
7382
7389
|
isDirty: j(o, d)
|
|
7383
|
-
})) :
|
|
7390
|
+
})) : B && !B._f && !ze(d) ? Z(o, d, x) : oe(o, d, x), na(o, c) ? u.state.next({
|
|
7384
7391
|
...t,
|
|
7385
7392
|
name: o,
|
|
7386
7393
|
values: De(i)
|
|
@@ -7388,18 +7395,18 @@ function sr(e = {}) {
|
|
|
7388
7395
|
name: l.mount ? o : void 0,
|
|
7389
7396
|
values: De(i)
|
|
7390
7397
|
});
|
|
7391
|
-
},
|
|
7398
|
+
}, R = async (o) => {
|
|
7392
7399
|
l.mount = !0;
|
|
7393
7400
|
const _ = o.target;
|
|
7394
|
-
let x = _.name,
|
|
7395
|
-
const
|
|
7396
|
-
|
|
7401
|
+
let x = _.name, B = !0;
|
|
7402
|
+
const z = Q(r, x), d = (f) => {
|
|
7403
|
+
B = Number.isNaN(f) || Ke(f) && isNaN(f.getTime()) || Ge(f, Q(i, x, f));
|
|
7397
7404
|
}, b = ta(a.mode), k = ta(a.reValidateMode);
|
|
7398
|
-
if (
|
|
7405
|
+
if (z) {
|
|
7399
7406
|
let f, D;
|
|
7400
|
-
const V = _.type ? ea(
|
|
7401
|
-
ke(i, x, V), te ? (!_ || !_.readOnly) && (
|
|
7402
|
-
const Le =
|
|
7407
|
+
const V = _.type ? ea(z._f) : Aa(o), te = o.type === dt.BLUR || o.type === dt.FOCUS_OUT, le = !Xn(z._f) && !a.resolver && !Q(t.errors, x) && !z._f.deps || tr(te, Q(t.touchedFields, x), t.isSubmitted, k, b), ae = na(x, c, te);
|
|
7408
|
+
ke(i, x, V), te ? (!_ || !_.readOnly) && (z._f.onBlur && z._f.onBlur(o), y && y(0)) : z._f.onChange && z._f.onChange(o);
|
|
7409
|
+
const Le = F(x, V, te), Be = !Te(Le) || ae;
|
|
7403
7410
|
if (!te && u.state.next({
|
|
7404
7411
|
name: x,
|
|
7405
7412
|
type: o.type,
|
|
@@ -7408,61 +7415,61 @@ function sr(e = {}) {
|
|
|
7408
7415
|
return (C.isValid || h.isValid) && (a.mode === "onBlur" ? te && S() : te || S()), Be && u.state.next({ name: x, ...ae ? {} : Le });
|
|
7409
7416
|
if (!te && ae && u.state.next({ ...t }), a.resolver) {
|
|
7410
7417
|
const { errors: qe } = await U([x]);
|
|
7411
|
-
if (L([x]), d(V),
|
|
7418
|
+
if (L([x]), d(V), B) {
|
|
7412
7419
|
const vt = ra(t.errors, r, x), st = ra(qe, r, vt.name || x);
|
|
7413
7420
|
f = st.error, x = st.name, D = Te(qe);
|
|
7414
7421
|
}
|
|
7415
7422
|
} else
|
|
7416
|
-
L([x], !0), f = (await ia(
|
|
7417
|
-
|
|
7423
|
+
L([x], !0), f = (await ia(z, c.disabled, i, E, a.shouldUseNativeValidation))[x], L([x]), d(V), B && (f ? D = !1 : (C.isValid || h.isValid) && (D = await O(r, !0)));
|
|
7424
|
+
B && (z._f.deps && (!Array.isArray(z._f.deps) || z._f.deps.length > 0) && G(z._f.deps), T(x, D, f, Le));
|
|
7418
7425
|
}
|
|
7419
7426
|
}, K = (o, _) => {
|
|
7420
7427
|
if (Q(t.errors, _) && o.focus)
|
|
7421
7428
|
return o.focus(), 1;
|
|
7422
7429
|
}, G = async (o, _ = {}) => {
|
|
7423
|
-
let x,
|
|
7424
|
-
const
|
|
7430
|
+
let x, B;
|
|
7431
|
+
const z = et(o);
|
|
7425
7432
|
if (a.resolver) {
|
|
7426
|
-
const d = await
|
|
7427
|
-
x = Te(d),
|
|
7428
|
-
} else o ? (
|
|
7433
|
+
const d = await P(Ce(o) ? o : z);
|
|
7434
|
+
x = Te(d), B = o ? !z.some((b) => Q(d, b)) : x;
|
|
7435
|
+
} else o ? (B = (await Promise.all(z.map(async (d) => {
|
|
7429
7436
|
const b = Q(r, d);
|
|
7430
7437
|
return await O(b && b._f ? { [d]: b } : b);
|
|
7431
|
-
}))).every(Boolean), !(!
|
|
7438
|
+
}))).every(Boolean), !(!B && !t.isValid) && S()) : B = x = await O(r);
|
|
7432
7439
|
return u.state.next({
|
|
7433
7440
|
...!He(o) || (C.isValid || h.isValid) && x !== t.isValid ? {} : { name: o },
|
|
7434
7441
|
...a.resolver || !o ? { isValid: x } : {},
|
|
7435
7442
|
errors: t.errors
|
|
7436
|
-
}), _.shouldFocus && !
|
|
7443
|
+
}), _.shouldFocus && !B && tt(r, K, o ? z : c.mount), B;
|
|
7437
7444
|
}, X = (o, _) => {
|
|
7438
7445
|
let x = {
|
|
7439
7446
|
...l.mount ? i : s
|
|
7440
7447
|
};
|
|
7441
|
-
return _ && (x = Fa(_.dirtyFields ? t.dirtyFields : t.touchedFields, x)), Ce(o) ? x : He(o) ? Q(x, o) : o.map((
|
|
7442
|
-
},
|
|
7448
|
+
return _ && (x = Fa(_.dirtyFields ? t.dirtyFields : t.touchedFields, x)), Ce(o) ? x : He(o) ? Q(x, o) : o.map((B) => Q(x, B));
|
|
7449
|
+
}, H = (o, _) => ({
|
|
7443
7450
|
invalid: !!Q((_ || t).errors, o),
|
|
7444
7451
|
isDirty: !!Q((_ || t).dirtyFields, o),
|
|
7445
7452
|
error: Q((_ || t).errors, o),
|
|
7446
7453
|
isValidating: !!Q(t.validatingFields, o),
|
|
7447
7454
|
isTouched: !!Q((_ || t).touchedFields, o)
|
|
7448
|
-
}),
|
|
7455
|
+
}), $ = (o) => {
|
|
7449
7456
|
o && et(o).forEach((_) => Se(t.errors, _)), u.state.next({
|
|
7450
7457
|
errors: o ? t.errors : {}
|
|
7451
7458
|
});
|
|
7452
7459
|
}, se = (o, _, x) => {
|
|
7453
|
-
const
|
|
7460
|
+
const B = (Q(r, o, { _f: {} })._f || {}).ref, z = Q(t.errors, o) || {}, { ref: d, message: b, type: k, ...f } = z;
|
|
7454
7461
|
ke(t.errors, o, {
|
|
7455
7462
|
...f,
|
|
7456
7463
|
..._,
|
|
7457
|
-
ref:
|
|
7464
|
+
ref: B
|
|
7458
7465
|
}), u.state.next({
|
|
7459
7466
|
name: o,
|
|
7460
7467
|
errors: t.errors,
|
|
7461
7468
|
isValid: !1
|
|
7462
|
-
}), x && x.shouldFocus &&
|
|
7469
|
+
}), x && x.shouldFocus && B && B.focus && B.focus();
|
|
7463
7470
|
}, ve = (o, _) => Fe(o) ? u.state.subscribe({
|
|
7464
|
-
next: (x) => "values" in x && o(
|
|
7465
|
-
}) :
|
|
7471
|
+
next: (x) => "values" in x && o(J(void 0, _), x)
|
|
7472
|
+
}) : J(o, _, !0), me = (o) => u.state.subscribe({
|
|
7466
7473
|
next: (_) => {
|
|
7467
7474
|
er(o.name, _.name, o.exact) && Qn(_, o.formState || C, we, o.reRenderRoot) && o.callback({
|
|
7468
7475
|
values: { ...i },
|
|
@@ -7491,12 +7498,12 @@ function sr(e = {}) {
|
|
|
7491
7498
|
}), !_.keepIsValid && S();
|
|
7492
7499
|
}, q = ({ disabled: o, name: _ }) => {
|
|
7493
7500
|
if (Pe(o) && l.mount || o || c.disabled.has(_)) {
|
|
7494
|
-
const
|
|
7495
|
-
o ? c.disabled.add(_) : c.disabled.delete(_),
|
|
7501
|
+
const z = c.disabled.has(_) !== !!o;
|
|
7502
|
+
o ? c.disabled.add(_) : c.disabled.delete(_), z && l.mount && !l.action && S();
|
|
7496
7503
|
}
|
|
7497
7504
|
}, ge = (o, _ = {}) => {
|
|
7498
7505
|
let x = Q(r, o);
|
|
7499
|
-
const
|
|
7506
|
+
const B = Pe(_.disabled) || Pe(a.disabled);
|
|
7500
7507
|
return ke(r, o, {
|
|
7501
7508
|
...x || {},
|
|
7502
7509
|
_f: {
|
|
@@ -7509,7 +7516,7 @@ function sr(e = {}) {
|
|
|
7509
7516
|
disabled: Pe(_.disabled) ? _.disabled : a.disabled,
|
|
7510
7517
|
name: o
|
|
7511
7518
|
}) : m(o, !0, _.value), {
|
|
7512
|
-
...
|
|
7519
|
+
...B ? { disabled: _.disabled || a.disabled } : {},
|
|
7513
7520
|
...a.progressive ? {
|
|
7514
7521
|
required: !!_.required,
|
|
7515
7522
|
min: Qe(_.min),
|
|
@@ -7519,12 +7526,12 @@ function sr(e = {}) {
|
|
|
7519
7526
|
pattern: Qe(_.pattern)
|
|
7520
7527
|
} : {},
|
|
7521
7528
|
name: o,
|
|
7522
|
-
onChange:
|
|
7523
|
-
onBlur:
|
|
7524
|
-
ref: (
|
|
7525
|
-
if (
|
|
7529
|
+
onChange: R,
|
|
7530
|
+
onBlur: R,
|
|
7531
|
+
ref: (z) => {
|
|
7532
|
+
if (z) {
|
|
7526
7533
|
ge(o, _), x = Q(r, o);
|
|
7527
|
-
const d = Ce(
|
|
7534
|
+
const d = Ce(z.value) && z.querySelectorAll && z.querySelectorAll("input,select,textarea")[0] || z, b = jn(d), k = x._f.refs || [];
|
|
7528
7535
|
if (b ? k.find((f) => f === d) : d === x._f.ref)
|
|
7529
7536
|
return;
|
|
7530
7537
|
ke(r, o, {
|
|
@@ -7546,48 +7553,48 @@ function sr(e = {}) {
|
|
|
7546
7553
|
};
|
|
7547
7554
|
}, ue = () => a.shouldFocusError && tt(r, K, c.mount), de = (o) => {
|
|
7548
7555
|
Pe(o) && (u.state.next({ disabled: o }), tt(r, (_, x) => {
|
|
7549
|
-
const
|
|
7550
|
-
|
|
7551
|
-
|
|
7556
|
+
const B = Q(r, x);
|
|
7557
|
+
B && (_.disabled = B._f.disabled || o, Array.isArray(B._f.refs) && B._f.refs.forEach((z) => {
|
|
7558
|
+
z.disabled = B._f.disabled || o;
|
|
7552
7559
|
}));
|
|
7553
7560
|
}, 0, !1));
|
|
7554
7561
|
}, _e = (o, _) => async (x) => {
|
|
7555
|
-
let
|
|
7562
|
+
let B;
|
|
7556
7563
|
x && (x.preventDefault && x.preventDefault(), x.persist && x.persist());
|
|
7557
|
-
let
|
|
7564
|
+
let z = De(i);
|
|
7558
7565
|
if (u.state.next({
|
|
7559
7566
|
isSubmitting: !0
|
|
7560
7567
|
}), a.resolver) {
|
|
7561
7568
|
const { errors: d, values: b } = await U();
|
|
7562
|
-
L(), t.errors = d,
|
|
7569
|
+
L(), t.errors = d, z = De(b);
|
|
7563
7570
|
} else
|
|
7564
7571
|
await O(r);
|
|
7565
7572
|
if (c.disabled.size)
|
|
7566
7573
|
for (const d of c.disabled)
|
|
7567
|
-
Se(
|
|
7574
|
+
Se(z, d);
|
|
7568
7575
|
if (Se(t.errors, "root"), Te(t.errors)) {
|
|
7569
7576
|
u.state.next({
|
|
7570
7577
|
errors: {}
|
|
7571
7578
|
});
|
|
7572
7579
|
try {
|
|
7573
|
-
await o(
|
|
7580
|
+
await o(z, x);
|
|
7574
7581
|
} catch (d) {
|
|
7575
|
-
|
|
7582
|
+
B = d;
|
|
7576
7583
|
}
|
|
7577
7584
|
} else
|
|
7578
7585
|
_ && await _({ ...t.errors }, x), ue(), setTimeout(ue);
|
|
7579
7586
|
if (u.state.next({
|
|
7580
7587
|
isSubmitted: !0,
|
|
7581
7588
|
isSubmitting: !1,
|
|
7582
|
-
isSubmitSuccessful: Te(t.errors) && !
|
|
7589
|
+
isSubmitSuccessful: Te(t.errors) && !B,
|
|
7583
7590
|
submitCount: t.submitCount + 1,
|
|
7584
7591
|
errors: t.errors
|
|
7585
|
-
}),
|
|
7586
|
-
throw
|
|
7592
|
+
}), B)
|
|
7593
|
+
throw B;
|
|
7587
7594
|
}, Ne = (o, _ = {}) => {
|
|
7588
7595
|
Q(r, o) && (Ce(_.defaultValue) ? W(o, De(Q(s, o))) : (W(o, _.defaultValue), ke(s, o, De(_.defaultValue))), _.keepTouched || Se(t.touchedFields, o), _.keepDirty || (Se(t.dirtyFields, o), t.isDirty = _.defaultValue ? j(o, De(Q(s, o))) : j()), _.keepError || (Se(t.errors, o), C.isValid && S()), u.state.next({ ...t }));
|
|
7589
7596
|
}, he = (o, _ = {}) => {
|
|
7590
|
-
const x = o ? De(o) : s,
|
|
7597
|
+
const x = o ? De(o) : s, B = De(x), z = Te(o), d = z ? s : B;
|
|
7591
7598
|
if (_.keepDefaultValues || (s = x), !_.keepValues) {
|
|
7592
7599
|
if (_.keepDirtyValues) {
|
|
7593
7600
|
const b = /* @__PURE__ */ new Set([
|
|
@@ -7635,9 +7642,9 @@ function sr(e = {}) {
|
|
|
7635
7642
|
focus: ""
|
|
7636
7643
|
}, l.mount = !C.isValid || !!_.keepIsValid || !!_.keepDirtyValues || !a.shouldUnregister && !Te(d), l.watch = !!a.shouldUnregister, l.keepIsValid = !!_.keepIsValid, l.action = !1, _.keepErrors || (t.errors = {}), u.state.next({
|
|
7637
7644
|
submitCount: _.keepSubmitCount ? t.submitCount : 0,
|
|
7638
|
-
isDirty:
|
|
7645
|
+
isDirty: z ? !1 : _.keepDirty ? t.isDirty : !!(_.keepDefaultValues && !Ge(o, s)),
|
|
7639
7646
|
isSubmitted: _.keepIsSubmitted ? t.isSubmitted : !1,
|
|
7640
|
-
dirtyFields:
|
|
7647
|
+
dirtyFields: z ? {} : _.keepDirtyValues ? _.keepDefaultValues && i ? Ze(s, i) : t.dirtyFields : _.keepDefaultValues && o ? Ze(s, o) : _.keepDirty ? t.dirtyFields : {},
|
|
7641
7648
|
touchedFields: _.keepTouched ? t.touchedFields : {},
|
|
7642
7649
|
errors: _.keepErrors ? t.errors : {},
|
|
7643
7650
|
isSubmitSuccessful: _.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
@@ -7645,11 +7652,11 @@ function sr(e = {}) {
|
|
|
7645
7652
|
defaultValues: s
|
|
7646
7653
|
});
|
|
7647
7654
|
}, be = (o, _) => he(Fe(o) ? o(i) : o, { ...a.resetOptions, ..._ }), xe = (o, _ = {}) => {
|
|
7648
|
-
const x = Q(r, o),
|
|
7649
|
-
if (
|
|
7650
|
-
const
|
|
7651
|
-
|
|
7652
|
-
|
|
7655
|
+
const x = Q(r, o), B = x && x._f;
|
|
7656
|
+
if (B) {
|
|
7657
|
+
const z = B.refs ? B.refs[0] : B.ref;
|
|
7658
|
+
z.focus && setTimeout(() => {
|
|
7659
|
+
z.focus(), _.shouldSelect && Fe(z.select) && z.select();
|
|
7653
7660
|
});
|
|
7654
7661
|
}
|
|
7655
7662
|
}, we = (o) => {
|
|
@@ -7661,14 +7668,14 @@ function sr(e = {}) {
|
|
|
7661
7668
|
control: {
|
|
7662
7669
|
register: ge,
|
|
7663
7670
|
unregister: ie,
|
|
7664
|
-
getFieldState:
|
|
7671
|
+
getFieldState: H,
|
|
7665
7672
|
handleSubmit: _e,
|
|
7666
7673
|
setError: se,
|
|
7667
7674
|
_subscribe: me,
|
|
7668
7675
|
_runSchema: U,
|
|
7669
7676
|
_updateIsValidating: L,
|
|
7670
7677
|
_focusError: ue,
|
|
7671
|
-
_getWatch:
|
|
7678
|
+
_getWatch: J,
|
|
7672
7679
|
_getDirty: j,
|
|
7673
7680
|
_setValid: S,
|
|
7674
7681
|
_setFieldArray: M,
|
|
@@ -7728,11 +7735,11 @@ function sr(e = {}) {
|
|
|
7728
7735
|
getValues: X,
|
|
7729
7736
|
reset: be,
|
|
7730
7737
|
resetField: Ne,
|
|
7731
|
-
clearErrors:
|
|
7738
|
+
clearErrors: $,
|
|
7732
7739
|
unregister: ie,
|
|
7733
7740
|
setError: se,
|
|
7734
7741
|
setFocus: xe,
|
|
7735
|
-
getFieldState:
|
|
7742
|
+
getFieldState: H
|
|
7736
7743
|
};
|
|
7737
7744
|
return {
|
|
7738
7745
|
...Me,
|
|
@@ -7882,7 +7889,7 @@ function la({
|
|
|
7882
7889
|
};
|
|
7883
7890
|
return q(), window.addEventListener("resize", q), () => window.removeEventListener("resize", q);
|
|
7884
7891
|
}, [i]);
|
|
7885
|
-
const
|
|
7892
|
+
const F = $e(() => Math.floor(N / g) * g, [N, g]), [T, U] = Y(v), [P, O] = Y(null), [ee, j] = Y(!1), [J, ce] = Y({}), oe = re(null), Z = re(null), W = re(null), R = fe(
|
|
7886
7893
|
(q) => {
|
|
7887
7894
|
const ge = (/* @__PURE__ */ new Date()).getFullYear();
|
|
7888
7895
|
if (C && q < ge || h && q > ge)
|
|
@@ -7906,29 +7913,29 @@ function la({
|
|
|
7906
7913
|
E
|
|
7907
7914
|
]
|
|
7908
7915
|
), K = $e(() => {
|
|
7909
|
-
const q = [], ge =
|
|
7916
|
+
const q = [], ge = F, ue = Math.min(F + g - 1, s);
|
|
7910
7917
|
for (let de = ge; de <= ue; de++)
|
|
7911
7918
|
de >= r && q.push(de);
|
|
7912
7919
|
return q;
|
|
7913
|
-
}, [
|
|
7920
|
+
}, [F, g, r, s]), G = fe(
|
|
7914
7921
|
(q) => {
|
|
7915
|
-
const ge = q === "prev" ? Math.max(
|
|
7916
|
-
|
|
7922
|
+
const ge = q === "prev" ? Math.max(F - g, r) : Math.min(
|
|
7923
|
+
F + g,
|
|
7917
7924
|
s - g + 1
|
|
7918
7925
|
), ue = Math.max(ge, r);
|
|
7919
7926
|
t == null || t(ue);
|
|
7920
7927
|
},
|
|
7921
|
-
[
|
|
7928
|
+
[F, g, r, s, t]
|
|
7922
7929
|
), X = fe(
|
|
7923
7930
|
(q) => {
|
|
7924
7931
|
t == null || t(q), U(!1), p == null || p(!1);
|
|
7925
7932
|
},
|
|
7926
7933
|
[t, p]
|
|
7927
|
-
),
|
|
7934
|
+
), H = fe(() => {
|
|
7928
7935
|
if (c) return;
|
|
7929
|
-
const q =
|
|
7936
|
+
const q = !T;
|
|
7930
7937
|
U(q), p == null || p(q);
|
|
7931
|
-
}, [c,
|
|
7938
|
+
}, [c, T, p]), $ = fe(() => {
|
|
7932
7939
|
U(!1), p == null || p(!1);
|
|
7933
7940
|
}, [p]), se = fe(
|
|
7934
7941
|
(q) => {
|
|
@@ -7937,24 +7944,24 @@ function la({
|
|
|
7937
7944
|
[L, t]
|
|
7938
7945
|
);
|
|
7939
7946
|
ne(() => {
|
|
7940
|
-
if (
|
|
7947
|
+
if (T && Z.current) {
|
|
7941
7948
|
const q = () => {
|
|
7942
|
-
if (!
|
|
7943
|
-
const ue =
|
|
7949
|
+
if (!Z.current || !W.current) return;
|
|
7950
|
+
const ue = Z.current.getBoundingClientRect(), de = W.current.getBoundingClientRect(), _e = window.innerWidth, Ne = window.innerHeight, he = _e <= 640 ? 200 : 320, be = de.width || he, xe = _e - ue.right;
|
|
7944
7951
|
let we, Ie, Me = !1;
|
|
7945
7952
|
Me = be > xe, Me ? (Ie = 0, we = void 0) : (we = 0, Ie = void 0);
|
|
7946
7953
|
const o = Ne - ue.bottom, _ = ue.top;
|
|
7947
|
-
let x,
|
|
7948
|
-
o < de.height && _ > o ? (
|
|
7954
|
+
let x, B, z = "400px";
|
|
7955
|
+
o < de.height && _ > o ? (B = ue.height + 4, x = void 0, z = `${Math.min(_ - 10, 400)}px`) : (x = ue.height + 4, B = void 0, z = `${Math.min(o - 10, 400)}px`);
|
|
7949
7956
|
const d = `${Math.min(be, _e - 16)}px`;
|
|
7950
7957
|
ce({
|
|
7951
7958
|
position: "absolute",
|
|
7952
7959
|
top: x !== void 0 ? `${x}px` : void 0,
|
|
7953
|
-
bottom:
|
|
7960
|
+
bottom: B !== void 0 ? `${B}px` : void 0,
|
|
7954
7961
|
left: we !== void 0 ? `${we}px` : void 0,
|
|
7955
7962
|
right: Ie !== void 0 ? `${Ie}px` : void 0,
|
|
7956
7963
|
maxWidth: d,
|
|
7957
|
-
maxHeight:
|
|
7964
|
+
maxHeight: z,
|
|
7958
7965
|
zIndex: 10006
|
|
7959
7966
|
// Higher than MonthPicker panel (10005) and DatePicker panel (10004)
|
|
7960
7967
|
}), j(Me);
|
|
@@ -7963,22 +7970,22 @@ function la({
|
|
|
7963
7970
|
setTimeout(q, 0);
|
|
7964
7971
|
});
|
|
7965
7972
|
const ge = () => {
|
|
7966
|
-
|
|
7973
|
+
Z.current && W.current && q();
|
|
7967
7974
|
};
|
|
7968
7975
|
return window.addEventListener("resize", ge), window.addEventListener("scroll", ge, !0), () => {
|
|
7969
7976
|
window.removeEventListener("resize", ge), window.removeEventListener("scroll", ge, !0);
|
|
7970
7977
|
};
|
|
7971
7978
|
} else
|
|
7972
7979
|
j(!1), ce({});
|
|
7973
|
-
}, [
|
|
7980
|
+
}, [T]), ne(() => {
|
|
7974
7981
|
const q = (ge) => {
|
|
7975
|
-
oe.current && !oe.current.contains(ge.target) &&
|
|
7982
|
+
oe.current && !oe.current.contains(ge.target) && $();
|
|
7976
7983
|
};
|
|
7977
|
-
if (
|
|
7984
|
+
if (T)
|
|
7978
7985
|
return document.addEventListener("mousedown", q), () => document.removeEventListener("mousedown", q);
|
|
7979
|
-
}, [
|
|
7980
|
-
const ve = `${
|
|
7981
|
-
|
|
7986
|
+
}, [T, $]);
|
|
7987
|
+
const ve = `${F} - ${Math.min(
|
|
7988
|
+
F + g - 1,
|
|
7982
7989
|
s
|
|
7983
7990
|
)}`, me = I("ina-year-picker", l), ye = I(
|
|
7984
7991
|
"ina-year-picker__trigger",
|
|
@@ -7987,7 +7994,7 @@ function la({
|
|
|
7987
7994
|
y && "ina-year-picker__trigger--readonly"
|
|
7988
7995
|
), ie = I(
|
|
7989
7996
|
"ina-year-picker__panel",
|
|
7990
|
-
|
|
7997
|
+
T && "ina-year-picker__panel--open"
|
|
7991
7998
|
);
|
|
7992
7999
|
return ne(() => {
|
|
7993
8000
|
U(v);
|
|
@@ -7995,15 +8002,15 @@ function la({
|
|
|
7995
8002
|
/* @__PURE__ */ w(
|
|
7996
8003
|
"button",
|
|
7997
8004
|
{
|
|
7998
|
-
ref:
|
|
8005
|
+
ref: Z,
|
|
7999
8006
|
type: "button",
|
|
8000
|
-
onClick:
|
|
8007
|
+
onClick: H,
|
|
8001
8008
|
className: ye,
|
|
8002
8009
|
disabled: c,
|
|
8003
|
-
"aria-expanded":
|
|
8010
|
+
"aria-expanded": T,
|
|
8004
8011
|
"aria-haspopup": "listbox",
|
|
8005
8012
|
onKeyDown: (q) => {
|
|
8006
|
-
q.key === "Enter" || q.key === " " ? (q.preventDefault(),
|
|
8013
|
+
q.key === "Enter" || q.key === " " ? (q.preventDefault(), H()) : q.key === "Escape" && T && (q.preventDefault(), $());
|
|
8007
8014
|
},
|
|
8008
8015
|
children: [
|
|
8009
8016
|
A && /* @__PURE__ */ n(Ht, { size: 16, className: "ina-year-picker__icon" }),
|
|
@@ -8024,7 +8031,7 @@ function la({
|
|
|
8024
8031
|
{
|
|
8025
8032
|
className: I(
|
|
8026
8033
|
"ina-year-picker__chevron",
|
|
8027
|
-
|
|
8034
|
+
T && "ina-year-picker__chevron--open"
|
|
8028
8035
|
),
|
|
8029
8036
|
width: "16",
|
|
8030
8037
|
height: "16",
|
|
@@ -8046,7 +8053,7 @@ function la({
|
|
|
8046
8053
|
]
|
|
8047
8054
|
}
|
|
8048
8055
|
),
|
|
8049
|
-
|
|
8056
|
+
T && /* @__PURE__ */ w(
|
|
8050
8057
|
"div",
|
|
8051
8058
|
{
|
|
8052
8059
|
ref: W,
|
|
@@ -8054,7 +8061,7 @@ function la({
|
|
|
8054
8061
|
ie,
|
|
8055
8062
|
ee && "ina-year-picker__panel--right-aligned"
|
|
8056
8063
|
),
|
|
8057
|
-
style:
|
|
8064
|
+
style: J,
|
|
8058
8065
|
children: [
|
|
8059
8066
|
/* @__PURE__ */ w("div", { className: "ina-year-picker__header", children: [
|
|
8060
8067
|
/* @__PURE__ */ n(
|
|
@@ -8066,7 +8073,7 @@ function la({
|
|
|
8066
8073
|
(q.key === "Enter" || q.key === " ") && (q.preventDefault(), G("prev"));
|
|
8067
8074
|
},
|
|
8068
8075
|
className: "ina-year-picker__nav-button",
|
|
8069
|
-
disabled:
|
|
8076
|
+
disabled: F <= r,
|
|
8070
8077
|
"aria-label": "Previous decade",
|
|
8071
8078
|
children: /* @__PURE__ */ n(ct, { className: "ina-year-picker__nav-icon" })
|
|
8072
8079
|
}
|
|
@@ -8081,14 +8088,14 @@ function la({
|
|
|
8081
8088
|
(q.key === "Enter" || q.key === " ") && (q.preventDefault(), G("next"));
|
|
8082
8089
|
},
|
|
8083
8090
|
className: "ina-year-picker__nav-button",
|
|
8084
|
-
disabled:
|
|
8091
|
+
disabled: F + g > s,
|
|
8085
8092
|
"aria-label": "Next decade",
|
|
8086
8093
|
children: /* @__PURE__ */ n(nt, { className: "ina-year-picker__nav-icon" })
|
|
8087
8094
|
}
|
|
8088
8095
|
)
|
|
8089
8096
|
] }),
|
|
8090
8097
|
/* @__PURE__ */ n("div", { className: "ina-year-picker__grid", children: K.map((q, ge) => {
|
|
8091
|
-
const ue = q === N, de = q ===
|
|
8098
|
+
const ue = q === N, de = q === P, _e = R(q), Ne = ue || !K.includes(N) && ge === 0;
|
|
8092
8099
|
return /* @__PURE__ */ n(
|
|
8093
8100
|
"button",
|
|
8094
8101
|
{
|
|
@@ -8190,12 +8197,12 @@ function oa({
|
|
|
8190
8197
|
"Nov",
|
|
8191
8198
|
"Dec"
|
|
8192
8199
|
], [y]), M = $e(() => {
|
|
8193
|
-
const
|
|
8194
|
-
return
|
|
8195
|
-
}, [e, a]), [N, g] = Y(l), [m,
|
|
8196
|
-
(
|
|
8197
|
-
const
|
|
8198
|
-
return !!(v &&
|
|
8200
|
+
const H = e ?? a ?? (/* @__PURE__ */ new Date()).getMonth();
|
|
8201
|
+
return H == null || isNaN(H) ? (/* @__PURE__ */ new Date()).getMonth() : H;
|
|
8202
|
+
}, [e, a]), [N, g] = Y(l), [m, F] = Y(null), [T, U] = Y(!1), [P, O] = Y({}), ee = re(null), j = re(null), J = re(null), ce = fe(
|
|
8203
|
+
(H) => {
|
|
8204
|
+
const $ = (/* @__PURE__ */ new Date()).getMonth();
|
|
8205
|
+
return !!(v && H < $ || p && H > $ || C !== void 0 && H < C || h !== void 0 && H > h);
|
|
8199
8206
|
},
|
|
8200
8207
|
[
|
|
8201
8208
|
v,
|
|
@@ -8204,27 +8211,27 @@ function oa({
|
|
|
8204
8211
|
h
|
|
8205
8212
|
]
|
|
8206
8213
|
), oe = fe(
|
|
8207
|
-
(
|
|
8208
|
-
t == null || t(
|
|
8214
|
+
(H) => {
|
|
8215
|
+
t == null || t(H), g(!1), c == null || c(!1);
|
|
8209
8216
|
},
|
|
8210
8217
|
[t, c]
|
|
8211
|
-
),
|
|
8218
|
+
), Z = fe(() => {
|
|
8212
8219
|
if (s) return;
|
|
8213
|
-
const
|
|
8214
|
-
g(
|
|
8220
|
+
const H = !N;
|
|
8221
|
+
g(H), c == null || c(H);
|
|
8215
8222
|
}, [s, N, c]), W = fe(() => {
|
|
8216
8223
|
g(!1), c == null || c(!1);
|
|
8217
|
-
}, [c]),
|
|
8218
|
-
(
|
|
8219
|
-
|
|
8224
|
+
}, [c]), R = fe(
|
|
8225
|
+
(H) => {
|
|
8226
|
+
H.stopPropagation(), A ? A() : t == null || t((/* @__PURE__ */ new Date()).getMonth());
|
|
8220
8227
|
},
|
|
8221
8228
|
[A, t]
|
|
8222
8229
|
);
|
|
8223
8230
|
ne(() => {
|
|
8224
8231
|
if (N && j.current) {
|
|
8225
|
-
const
|
|
8226
|
-
if (!j.current || !
|
|
8227
|
-
const se = j.current.getBoundingClientRect(), ve =
|
|
8232
|
+
const H = () => {
|
|
8233
|
+
if (!j.current || !J.current) return;
|
|
8234
|
+
const se = j.current.getBoundingClientRect(), ve = J.current.getBoundingClientRect(), me = window.innerWidth, ye = window.innerHeight, q = ve.width || 240, ge = me - se.right;
|
|
8228
8235
|
let ue, de, _e = !1;
|
|
8229
8236
|
_e = q > ge, _e ? (de = 0, ue = void 0) : (ue = 0, de = void 0);
|
|
8230
8237
|
const Ne = ye - se.bottom, he = se.top;
|
|
@@ -8244,22 +8251,22 @@ function oa({
|
|
|
8244
8251
|
}), U(_e);
|
|
8245
8252
|
};
|
|
8246
8253
|
requestAnimationFrame(() => {
|
|
8247
|
-
setTimeout(
|
|
8254
|
+
setTimeout(H, 0);
|
|
8248
8255
|
});
|
|
8249
|
-
const
|
|
8250
|
-
j.current &&
|
|
8256
|
+
const $ = () => {
|
|
8257
|
+
j.current && J.current && H();
|
|
8251
8258
|
};
|
|
8252
|
-
return window.addEventListener("resize",
|
|
8253
|
-
window.removeEventListener("resize",
|
|
8259
|
+
return window.addEventListener("resize", $), window.addEventListener("scroll", $, !0), () => {
|
|
8260
|
+
window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0);
|
|
8254
8261
|
};
|
|
8255
8262
|
} else
|
|
8256
8263
|
U(!1), O({});
|
|
8257
8264
|
}, [N]), ne(() => {
|
|
8258
|
-
const
|
|
8259
|
-
ee.current && !ee.current.contains(
|
|
8265
|
+
const H = ($) => {
|
|
8266
|
+
ee.current && !ee.current.contains($.target) && W();
|
|
8260
8267
|
};
|
|
8261
8268
|
if (N)
|
|
8262
|
-
return document.addEventListener("mousedown",
|
|
8269
|
+
return document.addEventListener("mousedown", H), () => document.removeEventListener("mousedown", H);
|
|
8263
8270
|
}, [N, W]);
|
|
8264
8271
|
const K = I("ina-month-picker", r), G = I(
|
|
8265
8272
|
"ina-month-picker__trigger",
|
|
@@ -8278,13 +8285,13 @@ function oa({
|
|
|
8278
8285
|
{
|
|
8279
8286
|
ref: j,
|
|
8280
8287
|
type: "button",
|
|
8281
|
-
onClick:
|
|
8288
|
+
onClick: Z,
|
|
8282
8289
|
className: G,
|
|
8283
8290
|
disabled: s,
|
|
8284
8291
|
"aria-expanded": N,
|
|
8285
8292
|
"aria-haspopup": "listbox",
|
|
8286
|
-
onKeyDown: (
|
|
8287
|
-
|
|
8293
|
+
onKeyDown: (H) => {
|
|
8294
|
+
H.key === "Enter" || H.key === " " ? (H.preventDefault(), Z()) : H.key === "Escape" && N && (H.preventDefault(), W());
|
|
8288
8295
|
},
|
|
8289
8296
|
children: [
|
|
8290
8297
|
u && /* @__PURE__ */ n(Ht, { size: 16, className: "ina-month-picker__icon" }),
|
|
@@ -8293,7 +8300,7 @@ function oa({
|
|
|
8293
8300
|
"button",
|
|
8294
8301
|
{
|
|
8295
8302
|
type: "button",
|
|
8296
|
-
onClick:
|
|
8303
|
+
onClick: R,
|
|
8297
8304
|
className: "ina-month-picker__clear-button",
|
|
8298
8305
|
disabled: s,
|
|
8299
8306
|
"aria-label": "Clear month",
|
|
@@ -8330,27 +8337,27 @@ function oa({
|
|
|
8330
8337
|
N && /* @__PURE__ */ n(
|
|
8331
8338
|
"div",
|
|
8332
8339
|
{
|
|
8333
|
-
ref:
|
|
8340
|
+
ref: J,
|
|
8334
8341
|
className: I(
|
|
8335
8342
|
X,
|
|
8336
|
-
|
|
8343
|
+
T && "ina-month-picker__panel--right-aligned"
|
|
8337
8344
|
),
|
|
8338
|
-
style:
|
|
8339
|
-
children: /* @__PURE__ */ n("div", { className: "ina-month-picker__grid", children: L.map((
|
|
8340
|
-
const se =
|
|
8345
|
+
style: P,
|
|
8346
|
+
children: /* @__PURE__ */ n("div", { className: "ina-month-picker__grid", children: L.map((H, $) => {
|
|
8347
|
+
const se = $ === M, ve = $ === m, me = ce($);
|
|
8341
8348
|
return /* @__PURE__ */ n(
|
|
8342
8349
|
"button",
|
|
8343
8350
|
{
|
|
8344
8351
|
type: "button",
|
|
8345
8352
|
role: "option",
|
|
8346
8353
|
"aria-selected": se,
|
|
8347
|
-
tabIndex: se || !M &&
|
|
8348
|
-
onClick: () => !me && oe(
|
|
8354
|
+
tabIndex: se || !M && $ === 0 ? 0 : -1,
|
|
8355
|
+
onClick: () => !me && oe($),
|
|
8349
8356
|
onKeyDown: (ie) => {
|
|
8350
8357
|
var q, ge;
|
|
8351
8358
|
if (!me) {
|
|
8352
8359
|
if (ie.key === "Enter" || ie.key === " ")
|
|
8353
|
-
ie.preventDefault(), oe(
|
|
8360
|
+
ie.preventDefault(), oe($);
|
|
8354
8361
|
else if (ie.key === "ArrowRight") {
|
|
8355
8362
|
ie.preventDefault();
|
|
8356
8363
|
const ue = ie.currentTarget.nextElementSibling;
|
|
@@ -8363,19 +8370,19 @@ function oa({
|
|
|
8363
8370
|
ie.preventDefault();
|
|
8364
8371
|
const de = Array.from(
|
|
8365
8372
|
((q = ie.currentTarget.parentElement) == null ? void 0 : q.children) || []
|
|
8366
|
-
)[
|
|
8373
|
+
)[$ + 4];
|
|
8367
8374
|
de && de.focus();
|
|
8368
8375
|
} else if (ie.key === "ArrowUp") {
|
|
8369
8376
|
ie.preventDefault();
|
|
8370
8377
|
const de = Array.from(
|
|
8371
8378
|
((ge = ie.currentTarget.parentElement) == null ? void 0 : ge.children) || []
|
|
8372
|
-
)[
|
|
8379
|
+
)[$ - 4];
|
|
8373
8380
|
de && de.focus();
|
|
8374
8381
|
}
|
|
8375
8382
|
}
|
|
8376
8383
|
},
|
|
8377
|
-
onMouseEnter: () => !me &&
|
|
8378
|
-
onMouseLeave: () =>
|
|
8384
|
+
onMouseEnter: () => !me && F($),
|
|
8385
|
+
onMouseLeave: () => F(null),
|
|
8379
8386
|
className: I(
|
|
8380
8387
|
"ina-month-picker__month-option",
|
|
8381
8388
|
se && "ina-month-picker__month-option--selected",
|
|
@@ -8383,9 +8390,9 @@ function oa({
|
|
|
8383
8390
|
me && "ina-month-picker__month-option--disabled"
|
|
8384
8391
|
),
|
|
8385
8392
|
disabled: s || me,
|
|
8386
|
-
children:
|
|
8393
|
+
children: H
|
|
8387
8394
|
},
|
|
8388
|
-
|
|
8395
|
+
$
|
|
8389
8396
|
);
|
|
8390
8397
|
}) })
|
|
8391
8398
|
}
|
|
@@ -8474,10 +8481,10 @@ function ys({
|
|
|
8474
8481
|
required: N,
|
|
8475
8482
|
panelOnly: g = !1
|
|
8476
8483
|
}) {
|
|
8477
|
-
const [m,
|
|
8484
|
+
const [m, F] = Y(!1), [T, U] = Y(/* @__PURE__ */ new Date()), [P, O] = Y(() => {
|
|
8478
8485
|
const d = /* @__PURE__ */ new Date();
|
|
8479
8486
|
return d.setMonth(d.getMonth() + 1), d;
|
|
8480
|
-
}), [ee, j] = Y(null), [
|
|
8487
|
+
}), [ee, j] = Y(null), [J, ce] = Y(!1), [oe, Z] = Y(c), [W, R] = Y(null), K = re(null), G = re(null), X = re(null), H = () => {
|
|
8481
8488
|
if (e === "single") {
|
|
8482
8489
|
const d = Re(a, i);
|
|
8483
8490
|
return d ? [d] : [];
|
|
@@ -8486,11 +8493,11 @@ function ys({
|
|
|
8486
8493
|
return [k, f].filter(Boolean);
|
|
8487
8494
|
} else
|
|
8488
8495
|
return a.map((d) => Re(d, i)).filter(Boolean);
|
|
8489
|
-
},
|
|
8496
|
+
}, $ = H();
|
|
8490
8497
|
ne(() => {
|
|
8491
8498
|
const d = (b) => {
|
|
8492
8499
|
var k;
|
|
8493
|
-
((k = b.detail) == null ? void 0 : k.exclude) !== K.current && m && (
|
|
8500
|
+
((k = b.detail) == null ? void 0 : k.exclude) !== K.current && m && (F(!1), j(null), R(null));
|
|
8494
8501
|
};
|
|
8495
8502
|
return document.addEventListener(
|
|
8496
8503
|
"closeDatePicker",
|
|
@@ -8504,7 +8511,7 @@ function ys({
|
|
|
8504
8511
|
}, [m]), ne(() => {
|
|
8505
8512
|
const d = (b) => {
|
|
8506
8513
|
const k = b.target;
|
|
8507
|
-
K.current && K.current.contains(k) || (
|
|
8514
|
+
K.current && K.current.contains(k) || (F(!1), j(null), R(null), R(null));
|
|
8508
8515
|
};
|
|
8509
8516
|
if (m && !g)
|
|
8510
8517
|
return document.addEventListener("mousedown", d, !0), () => document.removeEventListener("mousedown", d, !0);
|
|
@@ -8528,23 +8535,23 @@ function ys({
|
|
|
8528
8535
|
}
|
|
8529
8536
|
if (typeof c == "string") {
|
|
8530
8537
|
if (c.includes("%")) {
|
|
8531
|
-
parseFloat(c.replace("%", "")) > 100 ?
|
|
8538
|
+
parseFloat(c.replace("%", "")) > 100 ? Z("100%") : Z(c);
|
|
8532
8539
|
return;
|
|
8533
8540
|
} else if (c.includes("px")) {
|
|
8534
8541
|
const D = parseInt(c.replace("px", ""), 10);
|
|
8535
|
-
isNaN(D) ?
|
|
8542
|
+
isNaN(D) ? Z(c) : Z(`${Math.min(D, k)}px`);
|
|
8536
8543
|
return;
|
|
8537
8544
|
} else if (c.includes("rem")) {
|
|
8538
8545
|
const V = parseFloat(c.replace("rem", "")) * 16;
|
|
8539
|
-
|
|
8546
|
+
Z(`${Math.min(V, k)}px`);
|
|
8540
8547
|
return;
|
|
8541
8548
|
} else if (c === "100%" || c === "auto") {
|
|
8542
|
-
|
|
8549
|
+
Z(c);
|
|
8543
8550
|
return;
|
|
8544
8551
|
}
|
|
8545
8552
|
const f = parseFloat(c);
|
|
8546
|
-
isNaN(f) ?
|
|
8547
|
-
} else
|
|
8553
|
+
isNaN(f) ? Z(c) : Z(`${Math.min(f, k)}px`);
|
|
8554
|
+
} else Z(typeof c == "number" ? `${Math.min(c, k)}px` : c);
|
|
8548
8555
|
};
|
|
8549
8556
|
return d(), window.addEventListener("resize", d), () => {
|
|
8550
8557
|
window.removeEventListener("resize", d);
|
|
@@ -8579,7 +8586,7 @@ function ys({
|
|
|
8579
8586
|
]), ve = re(!1);
|
|
8580
8587
|
ne(() => {
|
|
8581
8588
|
if ((m || g) && !ve.current) {
|
|
8582
|
-
const d =
|
|
8589
|
+
const d = H();
|
|
8583
8590
|
let b = null, k = null;
|
|
8584
8591
|
if (e === "range" && d.length >= 2) {
|
|
8585
8592
|
const f = d[0], D = d[1];
|
|
@@ -8616,7 +8623,7 @@ function ys({
|
|
|
8616
8623
|
else if (e === "multiple") {
|
|
8617
8624
|
const f = new Date(b);
|
|
8618
8625
|
f.setMonth(f.getMonth() + 1), O(f);
|
|
8619
|
-
} else if (e === "range" &&
|
|
8626
|
+
} else if (e === "range" && H().length === 0) {
|
|
8620
8627
|
const V = new Date(b);
|
|
8621
8628
|
V.setMonth(V.getMonth() + 1), O(V);
|
|
8622
8629
|
}
|
|
@@ -8670,25 +8677,25 @@ function ys({
|
|
|
8670
8677
|
},
|
|
8671
8678
|
[me]
|
|
8672
8679
|
), ie = () => {
|
|
8673
|
-
e === "single" ? t("") : e === "range" ? (t(["", ""]),
|
|
8680
|
+
e === "single" ? t("") : e === "range" ? (t(["", ""]), R(null)) : t([]);
|
|
8674
8681
|
}, q = (d) => {
|
|
8675
8682
|
if (j(null), e === "single") {
|
|
8676
8683
|
const b = Ue(d, i);
|
|
8677
8684
|
t(b);
|
|
8678
8685
|
} else if (e === "range") {
|
|
8679
|
-
const b =
|
|
8686
|
+
const b = $;
|
|
8680
8687
|
if (b.length === 0 && !W)
|
|
8681
|
-
|
|
8688
|
+
R(d);
|
|
8682
8689
|
else if (b.length === 1 || W) {
|
|
8683
8690
|
const k = W || b[0], f = d, [D, V] = k <= f ? [k, f] : [f, k], te = Ue(D, i), le = Ue(V, i);
|
|
8684
8691
|
t([
|
|
8685
8692
|
te,
|
|
8686
8693
|
le
|
|
8687
|
-
]),
|
|
8694
|
+
]), R(null), F(!1);
|
|
8688
8695
|
} else
|
|
8689
|
-
t(["", ""]),
|
|
8696
|
+
t(["", ""]), R(d);
|
|
8690
8697
|
} else if (e === "multiple") {
|
|
8691
|
-
const b =
|
|
8698
|
+
const b = $, k = ca(d, b);
|
|
8692
8699
|
let f;
|
|
8693
8700
|
k ? f = b.filter((V) => !Ae(V, d)) : f = [...b, d];
|
|
8694
8701
|
const D = f.map((V) => Ue(V, i));
|
|
@@ -8700,7 +8707,7 @@ function ys({
|
|
|
8700
8707
|
}, ue = (d) => {
|
|
8701
8708
|
U((b) => {
|
|
8702
8709
|
const k = new Date(b);
|
|
8703
|
-
if (d === "prev" ? k.setMonth(k.getMonth() - 1) : k.setMonth(k.getMonth() + 1), e !== "single" && ge(k,
|
|
8710
|
+
if (d === "prev" ? k.setMonth(k.getMonth() - 1) : k.setMonth(k.getMonth() + 1), e !== "single" && ge(k, P)) {
|
|
8704
8711
|
const f = new Date(k);
|
|
8705
8712
|
f.setMonth(f.getMonth() + 1), O(f);
|
|
8706
8713
|
}
|
|
@@ -8709,7 +8716,7 @@ function ys({
|
|
|
8709
8716
|
}, de = (d) => {
|
|
8710
8717
|
O((b) => {
|
|
8711
8718
|
const k = new Date(b);
|
|
8712
|
-
if (d === "prev" ? k.setMonth(k.getMonth() - 1) : k.setMonth(k.getMonth() + 1), e !== "single" && ge(
|
|
8719
|
+
if (d === "prev" ? k.setMonth(k.getMonth() - 1) : k.setMonth(k.getMonth() + 1), e !== "single" && ge(T, k)) {
|
|
8713
8720
|
const f = new Date(k);
|
|
8714
8721
|
f.setMonth(f.getMonth() - 1), U(f);
|
|
8715
8722
|
}
|
|
@@ -8718,14 +8725,14 @@ function ys({
|
|
|
8718
8725
|
}, _e = (d, b = !1) => {
|
|
8719
8726
|
b ? O((k) => {
|
|
8720
8727
|
const f = new Date(k);
|
|
8721
|
-
if (f.setMonth(d), e !== "single" && ge(
|
|
8728
|
+
if (f.setMonth(d), e !== "single" && ge(T, f)) {
|
|
8722
8729
|
const D = new Date(f);
|
|
8723
8730
|
D.setMonth(D.getMonth() - 1), U(D);
|
|
8724
8731
|
}
|
|
8725
8732
|
return f;
|
|
8726
8733
|
}) : U((k) => {
|
|
8727
8734
|
const f = new Date(k);
|
|
8728
|
-
if (f.setMonth(d), e !== "single" && ge(f,
|
|
8735
|
+
if (f.setMonth(d), e !== "single" && ge(f, P)) {
|
|
8729
8736
|
const D = new Date(f);
|
|
8730
8737
|
D.setMonth(D.getMonth() + 1), O(D);
|
|
8731
8738
|
}
|
|
@@ -8734,14 +8741,14 @@ function ys({
|
|
|
8734
8741
|
}, Ne = (d, b = !1) => {
|
|
8735
8742
|
b ? O((k) => {
|
|
8736
8743
|
const f = new Date(k);
|
|
8737
|
-
if (f.setFullYear(d), e !== "single" && ge(
|
|
8744
|
+
if (f.setFullYear(d), e !== "single" && ge(T, f)) {
|
|
8738
8745
|
const D = new Date(f);
|
|
8739
8746
|
D.setMonth(D.getMonth() - 1), U(D);
|
|
8740
8747
|
}
|
|
8741
8748
|
return f;
|
|
8742
8749
|
}) : U((k) => {
|
|
8743
8750
|
const f = new Date(k);
|
|
8744
|
-
if (f.setFullYear(d), e !== "single" && ge(f,
|
|
8751
|
+
if (f.setFullYear(d), e !== "single" && ge(f, P)) {
|
|
8745
8752
|
const D = new Date(f);
|
|
8746
8753
|
D.setMonth(D.getMonth() + 1), O(D);
|
|
8747
8754
|
}
|
|
@@ -8781,28 +8788,28 @@ function ys({
|
|
|
8781
8788
|
}, be = (d) => {
|
|
8782
8789
|
if (!d) return !1;
|
|
8783
8790
|
if (e === "single")
|
|
8784
|
-
return
|
|
8791
|
+
return $.length > 0 && Ae(d, $[0]);
|
|
8785
8792
|
if (e === "range") {
|
|
8786
8793
|
if (W && Ae(d, W))
|
|
8787
8794
|
return !0;
|
|
8788
8795
|
if (!W) {
|
|
8789
|
-
if (
|
|
8790
|
-
return Ae(d,
|
|
8791
|
-
if (
|
|
8792
|
-
const [b, k] =
|
|
8796
|
+
if ($.length === 1)
|
|
8797
|
+
return Ae(d, $[0]);
|
|
8798
|
+
if ($.length === 2) {
|
|
8799
|
+
const [b, k] = $;
|
|
8793
8800
|
return Ae(d, b) || Ae(d, k);
|
|
8794
8801
|
}
|
|
8795
8802
|
}
|
|
8796
8803
|
return !1;
|
|
8797
8804
|
} else
|
|
8798
|
-
return ca(d,
|
|
8805
|
+
return ca(d, $);
|
|
8799
8806
|
}, xe = (d) => {
|
|
8800
8807
|
if (!d) return !1;
|
|
8801
8808
|
if (e === "range") {
|
|
8802
8809
|
if (W)
|
|
8803
8810
|
return !1;
|
|
8804
|
-
if (
|
|
8805
|
-
const [b, k] =
|
|
8811
|
+
if ($.length === 2) {
|
|
8812
|
+
const [b, k] = $;
|
|
8806
8813
|
return d > b && d < k;
|
|
8807
8814
|
}
|
|
8808
8815
|
}
|
|
@@ -8810,7 +8817,7 @@ function ys({
|
|
|
8810
8817
|
}, we = (d) => {
|
|
8811
8818
|
if (!d || !ee) return !1;
|
|
8812
8819
|
if (e === "range") {
|
|
8813
|
-
const b = W || (
|
|
8820
|
+
const b = W || ($.length > 0 ? $[0] : null);
|
|
8814
8821
|
if (b) {
|
|
8815
8822
|
const [k, f] = b <= ee ? [b, ee] : [ee, b];
|
|
8816
8823
|
return d > k && d < f;
|
|
@@ -8822,8 +8829,8 @@ function ys({
|
|
|
8822
8829
|
if (e === "range") {
|
|
8823
8830
|
if (W && Ae(d, W))
|
|
8824
8831
|
return "start";
|
|
8825
|
-
if (!W &&
|
|
8826
|
-
const [b, k] =
|
|
8832
|
+
if (!W && $.length === 2) {
|
|
8833
|
+
const [b, k] = $;
|
|
8827
8834
|
if (Ae(d, b) && Ae(d, k))
|
|
8828
8835
|
return "single";
|
|
8829
8836
|
if (Ae(d, b)) return "start";
|
|
@@ -8835,7 +8842,7 @@ function ys({
|
|
|
8835
8842
|
}, o = (d) => {
|
|
8836
8843
|
if (!d || !ee) return "none";
|
|
8837
8844
|
if (e === "range") {
|
|
8838
|
-
const b = W || (
|
|
8845
|
+
const b = W || ($.length > 0 ? $[0] : null);
|
|
8839
8846
|
if (b) {
|
|
8840
8847
|
const [k, f] = b <= ee ? [b, ee] : [ee, b];
|
|
8841
8848
|
if (Ae(d, k) && Ae(d, f))
|
|
@@ -8905,12 +8912,12 @@ function ys({
|
|
|
8905
8912
|
Ie,
|
|
8906
8913
|
_
|
|
8907
8914
|
]
|
|
8915
|
+
), B = $e(
|
|
8916
|
+
() => ye(T),
|
|
8917
|
+
[T, ye]
|
|
8908
8918
|
), z = $e(
|
|
8909
|
-
() => ye(
|
|
8910
|
-
[
|
|
8911
|
-
), R = $e(
|
|
8912
|
-
() => ye(H),
|
|
8913
|
-
[H, ye]
|
|
8919
|
+
() => ye(P),
|
|
8920
|
+
[P, ye]
|
|
8914
8921
|
);
|
|
8915
8922
|
return /* @__PURE__ */ w(
|
|
8916
8923
|
"div",
|
|
@@ -8941,7 +8948,7 @@ function ys({
|
|
|
8941
8948
|
});
|
|
8942
8949
|
document.dispatchEvent(k);
|
|
8943
8950
|
}
|
|
8944
|
-
}),
|
|
8951
|
+
}), F(!m));
|
|
8945
8952
|
},
|
|
8946
8953
|
className: I(
|
|
8947
8954
|
"ina-date-picker__trigger",
|
|
@@ -8985,7 +8992,7 @@ function ys({
|
|
|
8985
8992
|
className: I(
|
|
8986
8993
|
"ina-date-picker__panel",
|
|
8987
8994
|
`ina-date-picker__panel--${s.split("-")[0]}`,
|
|
8988
|
-
|
|
8995
|
+
J && !s.includes("left") && !s.includes("right") && "ina-date-picker__panel--right-aligned",
|
|
8989
8996
|
v
|
|
8990
8997
|
),
|
|
8991
8998
|
style: {
|
|
@@ -9040,7 +9047,7 @@ function ys({
|
|
|
9040
9047
|
/* @__PURE__ */ n("div", { className: "ina-date-picker__dropdown-container", children: /* @__PURE__ */ n(
|
|
9041
9048
|
oa,
|
|
9042
9049
|
{
|
|
9043
|
-
value:
|
|
9050
|
+
value: T.getMonth(),
|
|
9044
9051
|
onChange: (d) => _e(d),
|
|
9045
9052
|
locale: "id",
|
|
9046
9053
|
disabled: A,
|
|
@@ -9051,7 +9058,7 @@ function ys({
|
|
|
9051
9058
|
/* @__PURE__ */ n("div", { className: "ina-date-picker__dropdown-container", children: /* @__PURE__ */ n(
|
|
9052
9059
|
la,
|
|
9053
9060
|
{
|
|
9054
|
-
value:
|
|
9061
|
+
value: T.getFullYear(),
|
|
9055
9062
|
onChange: (d) => {
|
|
9056
9063
|
const b = typeof d == "string" ? parseInt(d, 10) : d;
|
|
9057
9064
|
Ne(b);
|
|
@@ -9086,8 +9093,8 @@ function ys({
|
|
|
9086
9093
|
] }),
|
|
9087
9094
|
/* @__PURE__ */ w("div", { className: "ina-date-picker__calendar-grid", children: [
|
|
9088
9095
|
da.map((d) => /* @__PURE__ */ n("div", { className: "ina-date-picker__day-header", children: d }, d)),
|
|
9089
|
-
|
|
9090
|
-
const k = x(d), f = k.isSelected || !
|
|
9096
|
+
B.map((d, b) => {
|
|
9097
|
+
const k = x(d), f = k.isSelected || !B.some((D) => be(D.date)) && d.isToday || !B.some((D) => be(D.date)) && !B.some((D) => D.isToday) && b === 15;
|
|
9091
9098
|
return /* @__PURE__ */ n(
|
|
9092
9099
|
"button",
|
|
9093
9100
|
{
|
|
@@ -9152,7 +9159,7 @@ function ys({
|
|
|
9152
9159
|
/* @__PURE__ */ n("div", { className: "ina-date-picker__dropdown-container", children: /* @__PURE__ */ n(
|
|
9153
9160
|
oa,
|
|
9154
9161
|
{
|
|
9155
|
-
value:
|
|
9162
|
+
value: P.getMonth(),
|
|
9156
9163
|
onChange: (d) => _e(d, !0),
|
|
9157
9164
|
locale: "id",
|
|
9158
9165
|
disabled: A,
|
|
@@ -9163,7 +9170,7 @@ function ys({
|
|
|
9163
9170
|
/* @__PURE__ */ n("div", { className: "ina-date-picker__dropdown-container", children: /* @__PURE__ */ n(
|
|
9164
9171
|
la,
|
|
9165
9172
|
{
|
|
9166
|
-
value:
|
|
9173
|
+
value: P.getFullYear(),
|
|
9167
9174
|
onChange: (d) => {
|
|
9168
9175
|
const b = typeof d == "string" ? parseInt(d, 10) : d;
|
|
9169
9176
|
Ne(b, !0);
|
|
@@ -9195,8 +9202,8 @@ function ys({
|
|
|
9195
9202
|
] }),
|
|
9196
9203
|
/* @__PURE__ */ w("div", { className: "ina-date-picker__calendar-grid", children: [
|
|
9197
9204
|
da.map((d) => /* @__PURE__ */ n("div", { className: "ina-date-picker__day-header", children: d }, d)),
|
|
9198
|
-
|
|
9199
|
-
const k = x(d), f = k.isSelected || !
|
|
9205
|
+
z.map((d, b) => {
|
|
9206
|
+
const k = x(d), f = k.isSelected || !z.some((D) => be(D.date)) && d.isToday || !z.some((D) => be(D.date)) && !z.some((D) => D.isToday) && b === 15;
|
|
9200
9207
|
return /* @__PURE__ */ n(
|
|
9201
9208
|
"button",
|
|
9202
9209
|
{
|
|
@@ -9343,10 +9350,10 @@ function ws({
|
|
|
9343
9350
|
...h
|
|
9344
9351
|
}) {
|
|
9345
9352
|
const u = e !== void 0, [E, A] = Y(a), S = u ? e : E, L = fe(
|
|
9346
|
-
(
|
|
9353
|
+
(F) => {
|
|
9347
9354
|
if (t) return;
|
|
9348
|
-
const
|
|
9349
|
-
u || A(
|
|
9355
|
+
const T = F.target.checked;
|
|
9356
|
+
u || A(T), s && s(T);
|
|
9350
9357
|
},
|
|
9351
9358
|
[t, s, u]
|
|
9352
9359
|
), M = I(
|
|
@@ -9435,7 +9442,7 @@ function ks({
|
|
|
9435
9442
|
p
|
|
9436
9443
|
);
|
|
9437
9444
|
return /* @__PURE__ */ n("div", { className: S, children: /* @__PURE__ */ n("div", { className: L, role: "tablist", children: e.map((N) => {
|
|
9438
|
-
const g = E === N.value, m = y || N.disabled,
|
|
9445
|
+
const g = E === N.value, m = y || N.disabled, F = I(
|
|
9439
9446
|
"ina-tab-horizontal__tab",
|
|
9440
9447
|
`ina-tab-horizontal__tab--size-${s}`,
|
|
9441
9448
|
`ina-tab-horizontal__tab--variant-${i}`,
|
|
@@ -9452,10 +9459,10 @@ function ks({
|
|
|
9452
9459
|
"aria-selected": g,
|
|
9453
9460
|
"aria-disabled": m,
|
|
9454
9461
|
disabled: m,
|
|
9455
|
-
className:
|
|
9462
|
+
className: F,
|
|
9456
9463
|
onClick: () => A(N.value, N.disabled),
|
|
9457
|
-
onKeyDown: (
|
|
9458
|
-
(
|
|
9464
|
+
onKeyDown: (T) => {
|
|
9465
|
+
(T.key === "Enter" || T.key === " ") && (T.preventDefault(), A(N.value, N.disabled));
|
|
9459
9466
|
},
|
|
9460
9467
|
children: N.label
|
|
9461
9468
|
},
|
|
@@ -9499,12 +9506,12 @@ function Ns({
|
|
|
9499
9506
|
width: typeof C == "number" ? `${C}px` : C
|
|
9500
9507
|
};
|
|
9501
9508
|
return /* @__PURE__ */ n("div", { className: S, style: M, children: /* @__PURE__ */ n("div", { className: L, role: "tablist", children: e.map((g) => {
|
|
9502
|
-
const m = E === g.value,
|
|
9509
|
+
const m = E === g.value, F = c || g.disabled, T = I(
|
|
9503
9510
|
"ina-tab-vertical__tab",
|
|
9504
9511
|
`ina-tab-vertical__tab--size-${s}`,
|
|
9505
9512
|
`ina-tab-vertical__tab--variant-${i}`,
|
|
9506
9513
|
m && "ina-tab-vertical__tab--selected",
|
|
9507
|
-
|
|
9514
|
+
F && "ina-tab-vertical__tab--disabled",
|
|
9508
9515
|
p
|
|
9509
9516
|
);
|
|
9510
9517
|
return /* @__PURE__ */ n(
|
|
@@ -9513,9 +9520,9 @@ function Ns({
|
|
|
9513
9520
|
type: "button",
|
|
9514
9521
|
role: "tab",
|
|
9515
9522
|
"aria-selected": m,
|
|
9516
|
-
"aria-disabled":
|
|
9517
|
-
disabled:
|
|
9518
|
-
className:
|
|
9523
|
+
"aria-disabled": F,
|
|
9524
|
+
disabled: F,
|
|
9525
|
+
className: T,
|
|
9519
9526
|
onClick: () => A(g.value, g.disabled),
|
|
9520
9527
|
onKeyDown: (U) => {
|
|
9521
9528
|
(U.key === "Enter" || U.key === " ") && (U.preventDefault(), A(g.value, g.disabled));
|