@idds/react 1.6.17 → 1.6.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as w, jsx as n, Fragment as Ye } from "react/jsx-runtime";
|
|
2
|
-
import ge, { useRef as le, useState as Z, useCallback as me, useMemo as Fe, useContext as Vt, createContext as
|
|
3
|
-
import { createPortal as
|
|
2
|
+
import ge, { useRef as le, useState as Z, useCallback as me, useMemo as Fe, useContext as Vt, createContext as Tt, useId as ma, useEffect as oe, forwardRef as ha, useImperativeHandle as va, Fragment as Wa } from "react";
|
|
3
|
+
import { createPortal as Lt } from "react-dom";
|
|
4
4
|
const mr = {
|
|
5
5
|
// Neutral Colors
|
|
6
6
|
"neutral-25": "var(--ina-neutral-25, #ffffff)",
|
|
@@ -254,7 +254,7 @@ const mr = {
|
|
|
254
254
|
"primary-700": "var(--ina-primary-700, #083575)",
|
|
255
255
|
"primary-800": "var(--ina-primary-800, #022a5b)",
|
|
256
256
|
"primary-900": "var(--ina-primary-900, #041225)",
|
|
257
|
-
"primary-primary": "var(--ina-primary-primary, #
|
|
257
|
+
"primary-primary": "var(--ina-primary-primary, #196bcd)",
|
|
258
258
|
// Secondary/Accent colors
|
|
259
259
|
"accent-100": "var(--ina-accent-100, #ffffff)",
|
|
260
260
|
"accent-200": "var(--ina-accent-200, #fff5ee)",
|
|
@@ -263,6 +263,16 @@ const mr = {
|
|
|
263
263
|
"accent-500": "var(--ina-accent-500, #edb98a)",
|
|
264
264
|
"accent-600": "var(--ina-accent-600, #d39663)",
|
|
265
265
|
"accent-700": "var(--ina-accent-700, #cc1515)",
|
|
266
|
+
// Secondary colors
|
|
267
|
+
"secondary-25": "var(--ina-secondary-25, #ffffff)",
|
|
268
|
+
"secondary-50": "var(--ina-secondary-50, #ffffff)",
|
|
269
|
+
"secondary-100": "var(--ina-secondary-100, #ffffff)",
|
|
270
|
+
"secondary-200": "var(--ina-secondary-200, #fff5ee)",
|
|
271
|
+
"secondary-300": "var(--ina-secondary-300, #ffe8cc)",
|
|
272
|
+
"secondary-400": "var(--ina-secondary-400, #ffd2a6)",
|
|
273
|
+
"secondary-500": "var(--ina-secondary-500, #edb98a)",
|
|
274
|
+
"secondary-600": "var(--ina-secondary-600, #d39663)",
|
|
275
|
+
"secondary-700": "var(--ina-secondary-700, #cc1515)",
|
|
266
276
|
// Interactive hover
|
|
267
277
|
"brand-hover": "var(--ina-brand-hover, #588cd7)",
|
|
268
278
|
"neutral-hover": "var(--ina-neutral-hover, #edeff5)"
|
|
@@ -583,13 +593,13 @@ function S() {
|
|
|
583
593
|
for (var e, a, t = 0, r = "", i = arguments.length; t < i; t++) (e = arguments[t]) && (a = ya(e)) && (r && (r += " "), r += a);
|
|
584
594
|
return r;
|
|
585
595
|
}
|
|
586
|
-
const _a =
|
|
596
|
+
const _a = Tt(
|
|
587
597
|
null
|
|
588
598
|
);
|
|
589
599
|
function ja() {
|
|
590
600
|
return Vt(_a);
|
|
591
601
|
}
|
|
592
|
-
function
|
|
602
|
+
function Er(e) {
|
|
593
603
|
const {
|
|
594
604
|
multiple: a,
|
|
595
605
|
multipleOpen: t = !1,
|
|
@@ -604,24 +614,24 @@ function Ar(e) {
|
|
|
604
614
|
const I = me(
|
|
605
615
|
(k, _) => {
|
|
606
616
|
const f = b.current.size;
|
|
607
|
-
return b.current.set(k, f), _ && u((
|
|
617
|
+
return b.current.set(k, f), _ && u((T) => c ? T.includes(f) ? T : [...T, f] : T.length === 0 ? [f] : T), f;
|
|
608
618
|
},
|
|
609
619
|
[c]
|
|
610
|
-
),
|
|
620
|
+
), E = me((k) => {
|
|
611
621
|
const _ = b.current.get(k);
|
|
612
622
|
if (_ !== void 0) {
|
|
613
623
|
b.current.delete(k), u(($) => $.filter((B) => B !== _).map((B) => B > _ ? B - 1 : B));
|
|
614
624
|
const f = /* @__PURE__ */ new Map();
|
|
615
|
-
let
|
|
616
|
-
b.current.forEach(($,
|
|
617
|
-
f.set(
|
|
625
|
+
let T = 0;
|
|
626
|
+
b.current.forEach(($, Y) => {
|
|
627
|
+
f.set(Y, T), T++;
|
|
618
628
|
}), b.current = f;
|
|
619
629
|
}
|
|
620
|
-
}, []),
|
|
630
|
+
}, []), A = me(
|
|
621
631
|
(k, _) => {
|
|
622
632
|
u((f) => {
|
|
623
|
-
let
|
|
624
|
-
return c ? _ ? f.includes(k) ?
|
|
633
|
+
let T;
|
|
634
|
+
return c ? _ ? f.includes(k) ? T = f : T = [...f, k] : T = f.filter(($) => $ !== k) : _ ? T = [k] : T = [], m(($) => $ + 1), i == null || i(T), T;
|
|
625
635
|
});
|
|
626
636
|
},
|
|
627
637
|
[c, i]
|
|
@@ -630,8 +640,8 @@ function Ar(e) {
|
|
|
630
640
|
multiple: c,
|
|
631
641
|
multipleOpen: c,
|
|
632
642
|
registerItem: I,
|
|
633
|
-
unregisterItem:
|
|
634
|
-
handleItemToggle:
|
|
643
|
+
unregisterItem: E,
|
|
644
|
+
handleItemToggle: A,
|
|
635
645
|
isItemOpen: F,
|
|
636
646
|
version: M
|
|
637
647
|
// Include version untuk trigger re-render
|
|
@@ -639,15 +649,15 @@ function Ar(e) {
|
|
|
639
649
|
[
|
|
640
650
|
c,
|
|
641
651
|
I,
|
|
642
|
-
A,
|
|
643
652
|
E,
|
|
653
|
+
A,
|
|
644
654
|
F,
|
|
645
655
|
M
|
|
646
656
|
]
|
|
647
657
|
);
|
|
648
658
|
return /* @__PURE__ */ n(_a.Provider, { value: N, children: /* @__PURE__ */ n("div", { className: S("ina-accordion-group", s), children: l }) });
|
|
649
659
|
}
|
|
650
|
-
function
|
|
660
|
+
function Ar(e) {
|
|
651
661
|
const {
|
|
652
662
|
title: a,
|
|
653
663
|
children: t,
|
|
@@ -656,27 +666,27 @@ function Er(e) {
|
|
|
656
666
|
onToggle: s,
|
|
657
667
|
disabled: l = !1,
|
|
658
668
|
className: c
|
|
659
|
-
} = e, [b, h] = Z(r), u = ja(), M = ma().replace(/:/g, "-"), m = le(`accordion-${M}`), [p, I] = Z(-1),
|
|
660
|
-
|
|
661
|
-
const { registerItem:
|
|
669
|
+
} = e, [b, h] = Z(r), u = ja(), M = ma().replace(/:/g, "-"), m = le(`accordion-${M}`), [p, I] = Z(-1), E = le(r);
|
|
670
|
+
E.current = r;
|
|
671
|
+
const { registerItem: A, unregisterItem: F } = u || {};
|
|
662
672
|
oe(() => {
|
|
663
|
-
if (
|
|
664
|
-
const B =
|
|
673
|
+
if (A) {
|
|
674
|
+
const B = A(m.current, E.current);
|
|
665
675
|
I(B);
|
|
666
676
|
}
|
|
667
677
|
return () => {
|
|
668
678
|
F && (F(m.current), I(-1));
|
|
669
679
|
};
|
|
670
|
-
}, [
|
|
671
|
-
const N = u !== null, k = i !== void 0 || N, _ = Fe(() => N && p >= 0 && u ? u.isItemOpen(p) : i !== void 0 ? i : b, [N, p, u, i, b]), f = Fe(() => `accordion-header-${m.current}`, []),
|
|
680
|
+
}, [A, F]);
|
|
681
|
+
const N = u !== null, k = i !== void 0 || N, _ = Fe(() => N && p >= 0 && u ? u.isItemOpen(p) : i !== void 0 ? i : b, [N, p, u, i, b]), f = Fe(() => `accordion-header-${m.current}`, []), T = Fe(() => `accordion-content-${m.current}`, []), $ = () => {
|
|
672
682
|
if (l) return;
|
|
673
683
|
const B = !_;
|
|
674
684
|
N && p >= 0 && u ? u.handleItemToggle(p, B) : k || h(B), s == null || s(B);
|
|
675
|
-
},
|
|
685
|
+
}, Y = S("ina-accordion", c, {
|
|
676
686
|
"ina-accordion--disabled": l,
|
|
677
687
|
"ina-accordion--open": _
|
|
678
688
|
});
|
|
679
|
-
return /* @__PURE__ */ w("div", { className:
|
|
689
|
+
return /* @__PURE__ */ w("div", { className: Y, children: [
|
|
680
690
|
/* @__PURE__ */ w(
|
|
681
691
|
"button",
|
|
682
692
|
{
|
|
@@ -687,24 +697,24 @@ function Er(e) {
|
|
|
687
697
|
var V;
|
|
688
698
|
if (B.key === "ArrowDown" || B.key === "ArrowUp") {
|
|
689
699
|
B.preventDefault();
|
|
690
|
-
const
|
|
691
|
-
if (!O) return;
|
|
692
|
-
const G = O.closest(".ina-accordion-group") || O.parentElement;
|
|
700
|
+
const G = B.currentTarget.closest(".ina-accordion");
|
|
693
701
|
if (!G) return;
|
|
694
|
-
const
|
|
695
|
-
|
|
702
|
+
const O = G.closest(".ina-accordion-group") || G.parentElement;
|
|
703
|
+
if (!O) return;
|
|
704
|
+
const W = Array.from(
|
|
705
|
+
O.querySelectorAll(
|
|
696
706
|
".ina-accordion__toggle:not([disabled])"
|
|
697
707
|
)
|
|
698
|
-
), ae =
|
|
708
|
+
), ae = W.indexOf(B.currentTarget);
|
|
699
709
|
if (ae > -1) {
|
|
700
|
-
const ue = B.key === "ArrowDown" ? (ae + 1) %
|
|
701
|
-
(V =
|
|
710
|
+
const ue = B.key === "ArrowDown" ? (ae + 1) % W.length : (ae - 1 + W.length) % W.length;
|
|
711
|
+
(V = W[ue]) == null || V.focus();
|
|
702
712
|
}
|
|
703
713
|
}
|
|
704
714
|
},
|
|
705
715
|
className: "ina-accordion__toggle",
|
|
706
716
|
"aria-expanded": _,
|
|
707
|
-
"aria-controls":
|
|
717
|
+
"aria-controls": T,
|
|
708
718
|
disabled: l,
|
|
709
719
|
children: [
|
|
710
720
|
/* @__PURE__ */ n("div", { className: "ina-accordion__title", children: a }),
|
|
@@ -735,7 +745,7 @@ function Er(e) {
|
|
|
735
745
|
/* @__PURE__ */ n(
|
|
736
746
|
"div",
|
|
737
747
|
{
|
|
738
|
-
id:
|
|
748
|
+
id: T,
|
|
739
749
|
className: S("ina-accordion__content", {
|
|
740
750
|
"ina-accordion__content--open": _
|
|
741
751
|
}),
|
|
@@ -774,14 +784,14 @@ function Sr({
|
|
|
774
784
|
}) {
|
|
775
785
|
const [l, c] = Z(r), b = t !== void 0, h = b ? t : l, u = le(null), [M, m] = Z("0px");
|
|
776
786
|
oe(() => {
|
|
777
|
-
const
|
|
778
|
-
if (
|
|
787
|
+
const E = u.current;
|
|
788
|
+
if (E)
|
|
779
789
|
if (h) {
|
|
780
|
-
const
|
|
781
|
-
m(`${
|
|
790
|
+
const A = E.scrollHeight;
|
|
791
|
+
m(`${A}px`);
|
|
782
792
|
} else {
|
|
783
|
-
const
|
|
784
|
-
m(`${
|
|
793
|
+
const A = E.scrollHeight;
|
|
794
|
+
m(`${A}px`), requestAnimationFrame(() => {
|
|
785
795
|
m("0px");
|
|
786
796
|
});
|
|
787
797
|
}
|
|
@@ -789,8 +799,8 @@ function Sr({
|
|
|
789
799
|
const p = () => {
|
|
790
800
|
h && m("auto");
|
|
791
801
|
}, I = () => {
|
|
792
|
-
const
|
|
793
|
-
b || c(
|
|
802
|
+
const E = !h;
|
|
803
|
+
b || c(E), i == null || i(E);
|
|
794
804
|
};
|
|
795
805
|
return /* @__PURE__ */ w("div", { className: S("ina-accordion-card", s), children: [
|
|
796
806
|
/* @__PURE__ */ w("div", { onClick: I, className: "ina-accordion-card__header", children: [
|
|
@@ -848,10 +858,10 @@ const Ya = ha(
|
|
|
848
858
|
"ina-action-dropdown",
|
|
849
859
|
c === "full" && "w-full",
|
|
850
860
|
i
|
|
851
|
-
),
|
|
861
|
+
), E = S(
|
|
852
862
|
"ina-action-dropdown__trigger",
|
|
853
863
|
l
|
|
854
|
-
),
|
|
864
|
+
), A = S(
|
|
855
865
|
"ina-action-dropdown__menu",
|
|
856
866
|
`ina-action-dropdown__menu--${t}`,
|
|
857
867
|
`ina-action-dropdown__menu--width-${c}`,
|
|
@@ -872,7 +882,7 @@ const Ya = ha(
|
|
|
872
882
|
{
|
|
873
883
|
ref: m,
|
|
874
884
|
type: "button",
|
|
875
|
-
className:
|
|
885
|
+
className: E,
|
|
876
886
|
onClick: () => !b && M(!u),
|
|
877
887
|
disabled: b,
|
|
878
888
|
children: [
|
|
@@ -881,7 +891,7 @@ const Ya = ha(
|
|
|
881
891
|
]
|
|
882
892
|
}
|
|
883
893
|
),
|
|
884
|
-
/* @__PURE__ */ n("div", { className:
|
|
894
|
+
/* @__PURE__ */ n("div", { className: A, children: /* @__PURE__ */ n("ul", { className: "ina-action-dropdown__list", children: a.map((N, k) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ w(
|
|
885
895
|
"button",
|
|
886
896
|
{
|
|
887
897
|
type: "button",
|
|
@@ -962,7 +972,7 @@ const at = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
962
972
|
/* @__PURE__ */ n("path", { d: "M12 16h.01" })
|
|
963
973
|
]
|
|
964
974
|
}
|
|
965
|
-
),
|
|
975
|
+
), Te = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
966
976
|
"svg",
|
|
967
977
|
{
|
|
968
978
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1069,12 +1079,12 @@ function Vr(e) {
|
|
|
1069
1079
|
c == null || c();
|
|
1070
1080
|
},
|
|
1071
1081
|
"aria-label": l,
|
|
1072
|
-
children: /* @__PURE__ */ n(
|
|
1082
|
+
children: /* @__PURE__ */ n(Te, { size: 14, strokeWidth: 2, className: "ina-alert__close-icon" })
|
|
1073
1083
|
}
|
|
1074
1084
|
)
|
|
1075
1085
|
] });
|
|
1076
1086
|
}
|
|
1077
|
-
function
|
|
1087
|
+
function Tr({
|
|
1078
1088
|
src: e,
|
|
1079
1089
|
alt: a = "Avatar",
|
|
1080
1090
|
initials: t = "",
|
|
@@ -1096,7 +1106,7 @@ function Lr({
|
|
|
1096
1106
|
const c = t.slice(0, 2).toUpperCase();
|
|
1097
1107
|
return /* @__PURE__ */ n("div", { className: l, children: c });
|
|
1098
1108
|
}
|
|
1099
|
-
function
|
|
1109
|
+
function Lr({
|
|
1100
1110
|
type: e = "soft",
|
|
1101
1111
|
variant: a = "info",
|
|
1102
1112
|
size: t = "md",
|
|
@@ -1204,8 +1214,8 @@ function $r({
|
|
|
1204
1214
|
showHeader: m = !0,
|
|
1205
1215
|
hoverable: p = !1,
|
|
1206
1216
|
clickable: I = !1,
|
|
1207
|
-
className:
|
|
1208
|
-
children:
|
|
1217
|
+
className: E = "",
|
|
1218
|
+
children: A
|
|
1209
1219
|
}) {
|
|
1210
1220
|
const N = (() => {
|
|
1211
1221
|
if (a)
|
|
@@ -1229,7 +1239,7 @@ function $r({
|
|
|
1229
1239
|
"ina-card--clickable": I,
|
|
1230
1240
|
"ina-card--with-header": m
|
|
1231
1241
|
},
|
|
1232
|
-
|
|
1242
|
+
E
|
|
1233
1243
|
), _ = () => /* @__PURE__ */ n("div", { className: "ina-card__media", children: l ? /* @__PURE__ */ n("img", { src: l, alt: c || "Card media" }) : null });
|
|
1234
1244
|
return /* @__PURE__ */ w("div", { className: k, children: [
|
|
1235
1245
|
e === "basic" && N === "top" && _(),
|
|
@@ -1241,7 +1251,7 @@ function $r({
|
|
|
1241
1251
|
i && /* @__PURE__ */ n("h3", { className: "ina-card__title", children: i }),
|
|
1242
1252
|
s && /* @__PURE__ */ n("p", { className: "ina-card__description", children: s })
|
|
1243
1253
|
] }),
|
|
1244
|
-
|
|
1254
|
+
A && A,
|
|
1245
1255
|
b && h && /* @__PURE__ */ n("div", { className: "ina-card__button", children: /* @__PURE__ */ n(
|
|
1246
1256
|
ct,
|
|
1247
1257
|
{
|
|
@@ -1297,7 +1307,7 @@ function Rr({
|
|
|
1297
1307
|
var l;
|
|
1298
1308
|
if (s.key === "ArrowRight" || s.key === "ArrowLeft") {
|
|
1299
1309
|
const c = Array.from(
|
|
1300
|
-
s.currentTarget.querySelectorAll('a
|
|
1310
|
+
s.currentTarget.querySelectorAll('a.ina-breadcrumb__link:not([tabindex="-1"])')
|
|
1301
1311
|
);
|
|
1302
1312
|
if (!c.length) return;
|
|
1303
1313
|
const b = c.indexOf(
|
|
@@ -1313,7 +1323,7 @@ function Rr({
|
|
|
1313
1323
|
children: /* @__PURE__ */ n("ol", { className: "ina-breadcrumb__list", children: e.map((s, l) => {
|
|
1314
1324
|
const c = l === e.length - 1, b = c, h = i(s.label, c);
|
|
1315
1325
|
return /* @__PURE__ */ w("li", { className: "ina-breadcrumb__item", children: [
|
|
1316
|
-
s.href && !b ? /* @__PURE__ */ w(
|
|
1326
|
+
(s.href || s.onClick) && !b ? /* @__PURE__ */ w(
|
|
1317
1327
|
"a",
|
|
1318
1328
|
{
|
|
1319
1329
|
href: s.href,
|
|
@@ -1322,7 +1332,9 @@ function Rr({
|
|
|
1322
1332
|
b && "ina-breadcrumb__link--active",
|
|
1323
1333
|
s.disabled && "ina-breadcrumb__link--disabled"
|
|
1324
1334
|
),
|
|
1325
|
-
tabIndex: s.disabled ? -1 : void 0,
|
|
1335
|
+
tabIndex: s.disabled ? -1 : s.href ? void 0 : 0,
|
|
1336
|
+
role: s.href ? void 0 : "button",
|
|
1337
|
+
style: !s.href && s.onClick && !s.disabled ? { cursor: "pointer" } : void 0,
|
|
1326
1338
|
onClick: (u) => {
|
|
1327
1339
|
if (s.disabled) {
|
|
1328
1340
|
u.preventDefault();
|
|
@@ -1330,6 +1342,9 @@ function Rr({
|
|
|
1330
1342
|
}
|
|
1331
1343
|
s.onClick && (u.preventDefault(), s.onClick());
|
|
1332
1344
|
},
|
|
1345
|
+
onKeyDown: (u) => {
|
|
1346
|
+
!s.href && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), !s.disabled && s.onClick && s.onClick());
|
|
1347
|
+
},
|
|
1333
1348
|
children: [
|
|
1334
1349
|
s.icon && /* @__PURE__ */ n("span", { className: "ina-breadcrumb__icon", children: s.icon }),
|
|
1335
1350
|
/* @__PURE__ */ n("span", { className: "ina-breadcrumb__text", children: h })
|
|
@@ -1435,8 +1450,8 @@ function Br({
|
|
|
1435
1450
|
className: s = "",
|
|
1436
1451
|
name: l
|
|
1437
1452
|
}) {
|
|
1438
|
-
const c = a !== void 0, [b, h] = ge.useState(t), u = le([]), M = c ? a : b, m = (I,
|
|
1439
|
-
i ||
|
|
1453
|
+
const c = a !== void 0, [b, h] = ge.useState(t), u = le([]), M = c ? a : b, m = (I, E) => {
|
|
1454
|
+
i || E || (c || h(I), r && r(I));
|
|
1440
1455
|
}, p = S(
|
|
1441
1456
|
"ina-button-group",
|
|
1442
1457
|
{
|
|
@@ -1444,43 +1459,43 @@ function Br({
|
|
|
1444
1459
|
},
|
|
1445
1460
|
s
|
|
1446
1461
|
);
|
|
1447
|
-
return /* @__PURE__ */ n("div", { className: p, role: "group", "aria-label": "Button group", children: e.map((I,
|
|
1448
|
-
const
|
|
1449
|
-
"ina-button-group__button--selected":
|
|
1462
|
+
return /* @__PURE__ */ n("div", { className: p, role: "group", "aria-label": "Button group", children: e.map((I, E) => {
|
|
1463
|
+
const A = M === I.value, F = i || I.disabled, N = S("ina-button-group__button", {
|
|
1464
|
+
"ina-button-group__button--selected": A,
|
|
1450
1465
|
"ina-button-group__button--disabled": F
|
|
1451
1466
|
});
|
|
1452
1467
|
return /* @__PURE__ */ n(
|
|
1453
1468
|
"button",
|
|
1454
1469
|
{
|
|
1455
|
-
ref: (k) => u.current[
|
|
1470
|
+
ref: (k) => u.current[E] = k,
|
|
1456
1471
|
type: "button",
|
|
1457
1472
|
className: N,
|
|
1458
1473
|
disabled: F,
|
|
1459
|
-
tabIndex:
|
|
1474
|
+
tabIndex: A ? 0 : -1,
|
|
1460
1475
|
onClick: () => m(I.value, I.disabled),
|
|
1461
1476
|
onKeyDown: (k) => {
|
|
1462
|
-
var f,
|
|
1477
|
+
var f, T;
|
|
1463
1478
|
if (F) return;
|
|
1464
1479
|
let _;
|
|
1465
1480
|
if (k.key === "Enter" || k.key === " ")
|
|
1466
1481
|
k.preventDefault(), m(I.value, I.disabled);
|
|
1467
1482
|
else if (k.key === "ArrowRight" || k.key === "ArrowDown") {
|
|
1468
|
-
for (k.preventDefault(), _ = (
|
|
1483
|
+
for (k.preventDefault(), _ = (E + 1) % e.length; e[_].disabled && _ !== E; )
|
|
1469
1484
|
_ = (_ + 1) % e.length;
|
|
1470
1485
|
(f = u.current[_]) == null || f.focus();
|
|
1471
1486
|
} else if (k.key === "ArrowLeft" || k.key === "ArrowUp") {
|
|
1472
|
-
for (k.preventDefault(), _ = (
|
|
1487
|
+
for (k.preventDefault(), _ = (E - 1 + e.length) % e.length; e[_].disabled && _ !== E; )
|
|
1473
1488
|
_ = (_ - 1 + e.length) % e.length;
|
|
1474
|
-
(
|
|
1489
|
+
(T = u.current[_]) == null || T.focus();
|
|
1475
1490
|
}
|
|
1476
1491
|
},
|
|
1477
|
-
"aria-pressed":
|
|
1492
|
+
"aria-pressed": A,
|
|
1478
1493
|
"aria-disabled": F,
|
|
1479
1494
|
name: l,
|
|
1480
1495
|
value: I.value,
|
|
1481
1496
|
children: /* @__PURE__ */ n("span", { className: "ina-button-group__button-content", children: I.label })
|
|
1482
1497
|
},
|
|
1483
|
-
`${I.value}-${
|
|
1498
|
+
`${I.value}-${E}`
|
|
1484
1499
|
);
|
|
1485
1500
|
}) });
|
|
1486
1501
|
}
|
|
@@ -1578,15 +1593,15 @@ function Wt({
|
|
|
1578
1593
|
};
|
|
1579
1594
|
let I = null;
|
|
1580
1595
|
i ? I = /* @__PURE__ */ n(Xa, { className: "ina-checkbox__icon", size: 10 }) : r && (I = /* @__PURE__ */ n(at, { className: "ina-checkbox__icon", size: 10 }));
|
|
1581
|
-
let
|
|
1582
|
-
r ?
|
|
1583
|
-
const
|
|
1596
|
+
let E = "";
|
|
1597
|
+
r ? E = "ina-checkbox__box--checked" : i ? E = "ina-checkbox__box--indeterminate" : E = "ina-checkbox__box--unchecked", h && !r && !i && !l && (E += " ina-checkbox__box--invalid");
|
|
1598
|
+
const A = S(
|
|
1584
1599
|
"ina-checkbox",
|
|
1585
1600
|
{ "ina-checkbox--disabled": l },
|
|
1586
1601
|
{ "ina-checkbox--with-subtext": t },
|
|
1587
1602
|
c
|
|
1588
1603
|
);
|
|
1589
|
-
return /* @__PURE__ */ w("label", { htmlFor: e, className:
|
|
1604
|
+
return /* @__PURE__ */ w("label", { htmlFor: e, className: A, children: [
|
|
1590
1605
|
/* @__PURE__ */ n(
|
|
1591
1606
|
"input",
|
|
1592
1607
|
{
|
|
@@ -1600,7 +1615,7 @@ function Wt({
|
|
|
1600
1615
|
...u
|
|
1601
1616
|
}
|
|
1602
1617
|
),
|
|
1603
|
-
/* @__PURE__ */ n("div", { className: S("ina-checkbox__box",
|
|
1618
|
+
/* @__PURE__ */ n("div", { className: S("ina-checkbox__box", E), children: I }),
|
|
1604
1619
|
/* @__PURE__ */ w("div", { className: "ina-checkbox__content", children: [
|
|
1605
1620
|
/* @__PURE__ */ n("span", { className: "ina-checkbox__label", children: a }),
|
|
1606
1621
|
t && /* @__PURE__ */ n("span", { className: "ina-checkbox__subtext", children: t })
|
|
@@ -1620,13 +1635,13 @@ function Hr({
|
|
|
1620
1635
|
className: h = ""
|
|
1621
1636
|
}) {
|
|
1622
1637
|
const u = Array.isArray(a) ? a : a ? [a] : [], M = u.filter(
|
|
1623
|
-
(V) => !e.some((
|
|
1624
|
-
), m = M.length > 0, p = M[M.length - 1] || "", [I,
|
|
1638
|
+
(V) => !e.some((G) => G.value === V) && V !== ""
|
|
1639
|
+
), m = M.length > 0, p = M[M.length - 1] || "", [I, E] = Z(!1), [A, F] = Z(p), N = () => {
|
|
1625
1640
|
if (u.length > 0) {
|
|
1626
1641
|
if (m && l)
|
|
1627
1642
|
return e.length;
|
|
1628
1643
|
const V = e.findIndex(
|
|
1629
|
-
(
|
|
1644
|
+
(G) => G.value === u[0]
|
|
1630
1645
|
);
|
|
1631
1646
|
if (V !== -1) return V;
|
|
1632
1647
|
}
|
|
@@ -1635,66 +1650,66 @@ function Hr({
|
|
|
1635
1650
|
oe(() => {
|
|
1636
1651
|
_(N());
|
|
1637
1652
|
}, [a, e, m]), oe(() => {
|
|
1638
|
-
m ? F(p) : (
|
|
1653
|
+
m ? F(p) : (E(!1), F(""));
|
|
1639
1654
|
}, [a, m]);
|
|
1640
|
-
const
|
|
1655
|
+
const T = (V) => {
|
|
1641
1656
|
if (V)
|
|
1642
1657
|
if (t) {
|
|
1643
|
-
let
|
|
1644
|
-
u.includes(V) ?
|
|
1658
|
+
let G;
|
|
1659
|
+
u.includes(V) ? G = u.filter((O) => O !== V) : G = [...u, V], s == null || s(G);
|
|
1645
1660
|
} else
|
|
1646
1661
|
u.includes(V) ? s == null || s("") : s == null || s(V);
|
|
1647
1662
|
}, $ = () => {
|
|
1648
|
-
const V =
|
|
1663
|
+
const V = A.trim();
|
|
1649
1664
|
if (t) {
|
|
1650
|
-
let
|
|
1651
|
-
m && p && (
|
|
1665
|
+
let G = [...u];
|
|
1666
|
+
m && p && (G = G.filter((O) => O !== p)), V && (G.includes(V) || G.push(V)), s == null || s(G);
|
|
1652
1667
|
} else
|
|
1653
1668
|
s == null || s(V);
|
|
1654
|
-
|
|
1655
|
-
},
|
|
1669
|
+
E(!1);
|
|
1670
|
+
}, Y = l ? [...e, { label: c, value: c }] : e, B = S("ina-chip", h);
|
|
1656
1671
|
return /* @__PURE__ */ w("div", { className: B, children: [
|
|
1657
|
-
/* @__PURE__ */ n("div", { className: "ina-chip__list", children:
|
|
1658
|
-
const
|
|
1672
|
+
/* @__PURE__ */ n("div", { className: "ina-chip__list", children: Y.map((V, G) => {
|
|
1673
|
+
const O = l && V.value === c, W = O ? m : u.includes(V.value);
|
|
1659
1674
|
return /* @__PURE__ */ n(
|
|
1660
1675
|
"button",
|
|
1661
1676
|
{
|
|
1662
|
-
ref: (ae) => f.current[
|
|
1677
|
+
ref: (ae) => f.current[G] = ae,
|
|
1663
1678
|
type: "button",
|
|
1664
|
-
tabIndex:
|
|
1679
|
+
tabIndex: G === k && !V.disabled ? 0 : -1,
|
|
1665
1680
|
disabled: V.disabled,
|
|
1666
1681
|
onClick: () => {
|
|
1667
|
-
V.disabled || (_(
|
|
1682
|
+
V.disabled || (_(G), O ? (E(!0), F(!t && !m ? "" : p)) : T(V.value));
|
|
1668
1683
|
},
|
|
1669
1684
|
onKeyDown: (ae) => {
|
|
1670
|
-
var ue, te, X, H,
|
|
1685
|
+
var ue, te, X, H, K;
|
|
1671
1686
|
if (!V.disabled) {
|
|
1672
1687
|
if (ae.key === "ArrowRight" || ae.key === "ArrowDown") {
|
|
1673
1688
|
ae.preventDefault();
|
|
1674
|
-
let P = (
|
|
1675
|
-
for (; (ue =
|
|
1676
|
-
P = (P + 1) %
|
|
1689
|
+
let P = (G + 1) % Y.length;
|
|
1690
|
+
for (; (ue = Y[P]) != null && ue.disabled && P !== G; )
|
|
1691
|
+
P = (P + 1) % Y.length;
|
|
1677
1692
|
_(P), (te = f.current[P]) == null || te.focus();
|
|
1678
1693
|
} else if (ae.key === "ArrowLeft" || ae.key === "ArrowUp") {
|
|
1679
1694
|
ae.preventDefault();
|
|
1680
|
-
let P = (
|
|
1681
|
-
for (; (X =
|
|
1682
|
-
P = (P - 1 +
|
|
1695
|
+
let P = (G - 1 + Y.length) % Y.length;
|
|
1696
|
+
for (; (X = Y[P]) != null && X.disabled && P !== G; )
|
|
1697
|
+
P = (P - 1 + Y.length) % Y.length;
|
|
1683
1698
|
_(P), (H = f.current[P]) == null || H.focus();
|
|
1684
1699
|
}
|
|
1685
|
-
ae.key === " " && (ae.preventDefault(), (
|
|
1700
|
+
ae.key === " " && (ae.preventDefault(), (K = f.current[G]) == null || K.click());
|
|
1686
1701
|
}
|
|
1687
1702
|
},
|
|
1688
1703
|
className: S(
|
|
1689
1704
|
"ina-chip__item",
|
|
1690
1705
|
`ina-chip__item--size-${r}`,
|
|
1691
1706
|
`ina-chip__item--variant-${i}`,
|
|
1692
|
-
|
|
1707
|
+
W && "ina-chip__item--selected",
|
|
1693
1708
|
V.disabled && "ina-chip__item--disabled"
|
|
1694
1709
|
),
|
|
1695
1710
|
children: V.label
|
|
1696
1711
|
},
|
|
1697
|
-
`${V.label}-${
|
|
1712
|
+
`${V.label}-${G}`
|
|
1698
1713
|
);
|
|
1699
1714
|
}) }),
|
|
1700
1715
|
l && I && /* @__PURE__ */ n("div", { className: "ina-chip__custom-field", children: b ?? /* @__PURE__ */ w("div", { className: "ina-chip__input-wrapper", children: [
|
|
@@ -1702,7 +1717,7 @@ function Hr({
|
|
|
1702
1717
|
"input",
|
|
1703
1718
|
{
|
|
1704
1719
|
type: "text",
|
|
1705
|
-
value:
|
|
1720
|
+
value: A,
|
|
1706
1721
|
onChange: (V) => F(V.target.value),
|
|
1707
1722
|
onBlur: () => {
|
|
1708
1723
|
$();
|
|
@@ -1714,7 +1729,7 @@ function Hr({
|
|
|
1714
1729
|
placeholder: "Masukkan data yang Anda inginkan"
|
|
1715
1730
|
}
|
|
1716
1731
|
),
|
|
1717
|
-
|
|
1732
|
+
A && /* @__PURE__ */ n(
|
|
1718
1733
|
"button",
|
|
1719
1734
|
{
|
|
1720
1735
|
type: "button",
|
|
@@ -1817,7 +1832,7 @@ function Gr({
|
|
|
1817
1832
|
triggerClassName: b = "",
|
|
1818
1833
|
disabled: h = !1
|
|
1819
1834
|
}) {
|
|
1820
|
-
const [u, M] = Z(r), m = t !== void 0, p = m ? t : u, I = le(null),
|
|
1835
|
+
const [u, M] = Z(r), m = t !== void 0, p = m ? t : u, I = le(null), E = le(null), A = le(null), F = (f) => {
|
|
1821
1836
|
m || M(f), i == null || i(f);
|
|
1822
1837
|
}, N = (f) => {
|
|
1823
1838
|
f.stopPropagation(), !h && F(!p);
|
|
@@ -1827,11 +1842,11 @@ function Gr({
|
|
|
1827
1842
|
oe(() => {
|
|
1828
1843
|
const f = ($) => {
|
|
1829
1844
|
I.current && !I.current.contains($.target) && p && F(!1);
|
|
1830
|
-
},
|
|
1845
|
+
}, T = ($) => {
|
|
1831
1846
|
$.key === "Escape" && p && F(!1);
|
|
1832
1847
|
};
|
|
1833
|
-
return document.addEventListener("mousedown", f), document.addEventListener("touchstart", f), document.addEventListener("keydown",
|
|
1834
|
-
document.removeEventListener("mousedown", f), document.removeEventListener("touchstart", f), document.removeEventListener("keydown",
|
|
1848
|
+
return document.addEventListener("mousedown", f), document.addEventListener("touchstart", f), document.addEventListener("keydown", T), () => {
|
|
1849
|
+
document.removeEventListener("mousedown", f), document.removeEventListener("touchstart", f), document.removeEventListener("keydown", T);
|
|
1835
1850
|
};
|
|
1836
1851
|
}, [p, i]);
|
|
1837
1852
|
const _ = typeof e == "string" || typeof e == "number";
|
|
@@ -1839,7 +1854,7 @@ function Gr({
|
|
|
1839
1854
|
/* @__PURE__ */ n(
|
|
1840
1855
|
"div",
|
|
1841
1856
|
{
|
|
1842
|
-
ref:
|
|
1857
|
+
ref: E,
|
|
1843
1858
|
className: S("ina-basic-dropdown__trigger", b),
|
|
1844
1859
|
onClick: N,
|
|
1845
1860
|
tabIndex: _ ? -1 : 0,
|
|
@@ -1875,7 +1890,7 @@ function Gr({
|
|
|
1875
1890
|
p && !h && /* @__PURE__ */ n(
|
|
1876
1891
|
"div",
|
|
1877
1892
|
{
|
|
1878
|
-
ref:
|
|
1893
|
+
ref: A,
|
|
1879
1894
|
className: S(
|
|
1880
1895
|
"ina-basic-dropdown__panel",
|
|
1881
1896
|
`ina-basic-dropdown__panel--${s}`,
|
|
@@ -2373,16 +2388,16 @@ function Wr({
|
|
|
2373
2388
|
onRemove: p,
|
|
2374
2389
|
...I
|
|
2375
2390
|
}) {
|
|
2376
|
-
const
|
|
2391
|
+
const E = le(null), [A, F] = Z([]), [N, k] = Z(!1), [_, f] = Z([]), [T, $] = Z(!1), Y = me(() => {
|
|
2377
2392
|
var H;
|
|
2378
|
-
u || (H =
|
|
2393
|
+
u || (H = E.current) == null || H.click();
|
|
2379
2394
|
}, [u]), B = me(
|
|
2380
2395
|
async (H) => {
|
|
2381
|
-
const
|
|
2396
|
+
const K = [], P = [], se = [];
|
|
2382
2397
|
if (i && c) {
|
|
2383
|
-
const
|
|
2384
|
-
if (
|
|
2385
|
-
const Q = c -
|
|
2398
|
+
const j = A.length;
|
|
2399
|
+
if (j + H.length > c) {
|
|
2400
|
+
const Q = c - j;
|
|
2386
2401
|
if (Q <= 0) {
|
|
2387
2402
|
se.push({
|
|
2388
2403
|
isValid: !1,
|
|
@@ -2395,8 +2410,8 @@ function Wr({
|
|
|
2395
2410
|
}
|
|
2396
2411
|
}
|
|
2397
2412
|
if (i && b) {
|
|
2398
|
-
const
|
|
2399
|
-
if (
|
|
2413
|
+
const j = A.reduce((ce, _e) => ce + _e.file.size, 0), Q = H.reduce((ce, _e) => ce + _e.size, 0), ee = b * 1024 * 1024;
|
|
2414
|
+
if (j + Q > ee) {
|
|
2400
2415
|
se.push({
|
|
2401
2416
|
isValid: !1,
|
|
2402
2417
|
error: `Ukuran total file maksimal ${b} MB`,
|
|
@@ -2405,66 +2420,66 @@ function Wr({
|
|
|
2405
2420
|
return;
|
|
2406
2421
|
}
|
|
2407
2422
|
}
|
|
2408
|
-
for (const
|
|
2423
|
+
for (const j of H) {
|
|
2409
2424
|
if (l && l.length > 0) {
|
|
2410
|
-
const ee =
|
|
2425
|
+
const ee = j.name.toLowerCase(), ce = ee.substring(ee.lastIndexOf(".") + 1);
|
|
2411
2426
|
if (!l.includes(ce.toLowerCase())) {
|
|
2412
2427
|
se.push({
|
|
2413
2428
|
isValid: !1,
|
|
2414
2429
|
error: `Ekstensi file harus: ${l.join(", ")}`,
|
|
2415
|
-
file:
|
|
2416
|
-
}),
|
|
2430
|
+
file: j
|
|
2431
|
+
}), K.push({
|
|
2417
2432
|
isValid: !1,
|
|
2418
2433
|
error: `Ekstensi file harus: ${l.join(", ")}`,
|
|
2419
|
-
file:
|
|
2434
|
+
file: j
|
|
2420
2435
|
});
|
|
2421
2436
|
continue;
|
|
2422
2437
|
}
|
|
2423
2438
|
}
|
|
2424
|
-
const Q = Ct(
|
|
2439
|
+
const Q = Ct(j, {
|
|
2425
2440
|
allowedTypes: r || void 0,
|
|
2426
2441
|
maxSize: s || void 0,
|
|
2427
2442
|
validateExtension: !0
|
|
2428
2443
|
});
|
|
2429
2444
|
if (!Q.isValid) {
|
|
2430
|
-
se.push(Q),
|
|
2445
|
+
se.push(Q), K.push(Q);
|
|
2431
2446
|
continue;
|
|
2432
2447
|
}
|
|
2433
|
-
if (h &&
|
|
2448
|
+
if (h && j.type) {
|
|
2434
2449
|
const ee = await Mt(
|
|
2435
|
-
|
|
2436
|
-
|
|
2450
|
+
j,
|
|
2451
|
+
j.type
|
|
2437
2452
|
);
|
|
2438
2453
|
if (!ee.isValid) {
|
|
2439
2454
|
se.push({
|
|
2440
2455
|
isValid: !1,
|
|
2441
2456
|
error: ee.error || "File signature tidak valid",
|
|
2442
|
-
file:
|
|
2443
|
-
}),
|
|
2457
|
+
file: j
|
|
2458
|
+
}), K.push({
|
|
2444
2459
|
isValid: !1,
|
|
2445
2460
|
error: ee.error || "File signature tidak valid",
|
|
2446
|
-
file:
|
|
2461
|
+
file: j
|
|
2447
2462
|
});
|
|
2448
2463
|
continue;
|
|
2449
2464
|
}
|
|
2450
2465
|
}
|
|
2451
2466
|
P.push({
|
|
2452
|
-
file:
|
|
2467
|
+
file: j,
|
|
2453
2468
|
status: "idle"
|
|
2454
|
-
}),
|
|
2469
|
+
}), K.push({
|
|
2455
2470
|
isValid: !0,
|
|
2456
|
-
file:
|
|
2471
|
+
file: j
|
|
2457
2472
|
});
|
|
2458
2473
|
}
|
|
2459
|
-
F(i ? (
|
|
2460
|
-
const q = i ? [...
|
|
2474
|
+
F(i ? (j) => [...j, ...P] : P.slice(0, 1)), f(se);
|
|
2475
|
+
const q = i ? [...A, ...P].map((j) => j.file) : P.map((j) => j.file);
|
|
2461
2476
|
m == null || m(q, se);
|
|
2462
2477
|
},
|
|
2463
2478
|
[
|
|
2464
2479
|
r,
|
|
2465
2480
|
s,
|
|
2466
2481
|
i,
|
|
2467
|
-
|
|
2482
|
+
A,
|
|
2468
2483
|
m,
|
|
2469
2484
|
l,
|
|
2470
2485
|
c,
|
|
@@ -2473,40 +2488,40 @@ function Wr({
|
|
|
2473
2488
|
]
|
|
2474
2489
|
), V = me(
|
|
2475
2490
|
async (H) => {
|
|
2476
|
-
const
|
|
2477
|
-
await B(
|
|
2491
|
+
const K = Array.from(H.target.files || []);
|
|
2492
|
+
await B(K), E.current && (E.current.value = "");
|
|
2478
2493
|
},
|
|
2479
2494
|
[B]
|
|
2480
|
-
),
|
|
2495
|
+
), G = me(
|
|
2481
2496
|
(H) => {
|
|
2482
2497
|
H.preventDefault(), H.stopPropagation(), u || k(!0);
|
|
2483
2498
|
},
|
|
2484
2499
|
[u]
|
|
2485
|
-
),
|
|
2500
|
+
), O = me((H) => {
|
|
2486
2501
|
H.preventDefault(), H.stopPropagation(), k(!1);
|
|
2487
|
-
}, []),
|
|
2502
|
+
}, []), W = me(
|
|
2488
2503
|
async (H) => {
|
|
2489
2504
|
var P;
|
|
2490
2505
|
if (H.preventDefault(), H.stopPropagation(), k(!1), u) return;
|
|
2491
|
-
const
|
|
2492
|
-
await B(
|
|
2506
|
+
const K = Array.from(((P = H.dataTransfer) == null ? void 0 : P.files) || []);
|
|
2507
|
+
await B(K);
|
|
2493
2508
|
},
|
|
2494
2509
|
[u, B]
|
|
2495
2510
|
), ae = me(
|
|
2496
2511
|
(H) => {
|
|
2497
2512
|
if (u) return;
|
|
2498
|
-
const
|
|
2499
|
-
F(P), p == null || p(
|
|
2513
|
+
const K = A[H], P = A.filter((se, q) => q !== H);
|
|
2514
|
+
F(P), p == null || p(K.file, H), m == null || m(
|
|
2500
2515
|
P.map((se) => se.file),
|
|
2501
2516
|
_
|
|
2502
2517
|
);
|
|
2503
2518
|
},
|
|
2504
|
-
[u,
|
|
2519
|
+
[u, A, _, p, m]
|
|
2505
2520
|
), ue = me(
|
|
2506
|
-
(H,
|
|
2521
|
+
(H, K, P, se) => {
|
|
2507
2522
|
F(
|
|
2508
2523
|
(q) => q.map(
|
|
2509
|
-
(
|
|
2524
|
+
(j, Q) => Q === H ? { ...j, status: K, error: P, progress: se } : j
|
|
2510
2525
|
)
|
|
2511
2526
|
);
|
|
2512
2527
|
},
|
|
@@ -2523,16 +2538,16 @@ function Wr({
|
|
|
2523
2538
|
"div",
|
|
2524
2539
|
{
|
|
2525
2540
|
className: X,
|
|
2526
|
-
onClick:
|
|
2527
|
-
onDragOver:
|
|
2528
|
-
onDragLeave:
|
|
2529
|
-
onDrop:
|
|
2541
|
+
onClick: Y,
|
|
2542
|
+
onDragOver: G,
|
|
2543
|
+
onDragLeave: O,
|
|
2544
|
+
onDrop: W,
|
|
2530
2545
|
children: [
|
|
2531
2546
|
/* @__PURE__ */ n(
|
|
2532
2547
|
"input",
|
|
2533
2548
|
{
|
|
2534
2549
|
...I,
|
|
2535
|
-
ref:
|
|
2550
|
+
ref: E,
|
|
2536
2551
|
type: "file",
|
|
2537
2552
|
accept: r,
|
|
2538
2553
|
multiple: i,
|
|
@@ -2554,7 +2569,7 @@ function Wr({
|
|
|
2554
2569
|
className: "ina-file-upload__button",
|
|
2555
2570
|
disabled: u,
|
|
2556
2571
|
onClick: (H) => {
|
|
2557
|
-
H.stopPropagation(),
|
|
2572
|
+
H.stopPropagation(), Y();
|
|
2558
2573
|
},
|
|
2559
2574
|
children: "Pilih File"
|
|
2560
2575
|
}
|
|
@@ -2563,9 +2578,9 @@ function Wr({
|
|
|
2563
2578
|
]
|
|
2564
2579
|
}
|
|
2565
2580
|
),
|
|
2566
|
-
|
|
2567
|
-
/* @__PURE__ */ n("div", { className: "ina-file-upload__files", children: (i &&
|
|
2568
|
-
const
|
|
2581
|
+
A.length > 0 && /* @__PURE__ */ w(Ye, { children: [
|
|
2582
|
+
/* @__PURE__ */ n("div", { className: "ina-file-upload__files", children: (i && A.length > 5 && !T ? A.slice(0, 5) : A).map((H) => {
|
|
2583
|
+
const K = A.findIndex(
|
|
2569
2584
|
(P) => P.file.name === H.file.name && P.file.size === H.file.size && P.status === H.status
|
|
2570
2585
|
);
|
|
2571
2586
|
return /* @__PURE__ */ w(
|
|
@@ -2602,7 +2617,7 @@ function Wr({
|
|
|
2602
2617
|
type: "button",
|
|
2603
2618
|
className: "ina-file-upload__file-retry",
|
|
2604
2619
|
onClick: () => {
|
|
2605
|
-
ue(
|
|
2620
|
+
ue(K, "idle");
|
|
2606
2621
|
},
|
|
2607
2622
|
title: "Coba lagi",
|
|
2608
2623
|
children: /* @__PURE__ */ n(xt, { size: 20 })
|
|
@@ -2613,7 +2628,7 @@ function Wr({
|
|
|
2613
2628
|
{
|
|
2614
2629
|
type: "button",
|
|
2615
2630
|
className: "ina-file-upload__file-remove",
|
|
2616
|
-
onClick: () => ae(
|
|
2631
|
+
onClick: () => ae(K),
|
|
2617
2632
|
title: "Hapus file",
|
|
2618
2633
|
children: /* @__PURE__ */ n(ot, { size: 20 })
|
|
2619
2634
|
}
|
|
@@ -2624,9 +2639,9 @@ function Wr({
|
|
|
2624
2639
|
{
|
|
2625
2640
|
type: "button",
|
|
2626
2641
|
className: "ina-file-upload__file-remove",
|
|
2627
|
-
onClick: () => ae(
|
|
2642
|
+
onClick: () => ae(K),
|
|
2628
2643
|
title: "Batalkan upload",
|
|
2629
|
-
children: /* @__PURE__ */ n(
|
|
2644
|
+
children: /* @__PURE__ */ n(Te, { size: 20 })
|
|
2630
2645
|
}
|
|
2631
2646
|
),
|
|
2632
2647
|
H.status === "success" && /* @__PURE__ */ n(
|
|
@@ -2634,7 +2649,7 @@ function Wr({
|
|
|
2634
2649
|
{
|
|
2635
2650
|
type: "button",
|
|
2636
2651
|
className: "ina-file-upload__file-remove",
|
|
2637
|
-
onClick: () => ae(
|
|
2652
|
+
onClick: () => ae(K),
|
|
2638
2653
|
title: "Hapus file",
|
|
2639
2654
|
children: /* @__PURE__ */ n(ot, { size: 20 })
|
|
2640
2655
|
}
|
|
@@ -2644,7 +2659,7 @@ function Wr({
|
|
|
2644
2659
|
{
|
|
2645
2660
|
type: "button",
|
|
2646
2661
|
className: "ina-file-upload__file-remove",
|
|
2647
|
-
onClick: () => ae(
|
|
2662
|
+
onClick: () => ae(K),
|
|
2648
2663
|
title: "Hapus file",
|
|
2649
2664
|
children: /* @__PURE__ */ n(ot, { size: 20 })
|
|
2650
2665
|
}
|
|
@@ -2652,17 +2667,17 @@ function Wr({
|
|
|
2652
2667
|
] })
|
|
2653
2668
|
]
|
|
2654
2669
|
},
|
|
2655
|
-
`${H.file.name}-${
|
|
2670
|
+
`${H.file.name}-${K}`
|
|
2656
2671
|
);
|
|
2657
2672
|
}) }),
|
|
2658
|
-
i &&
|
|
2673
|
+
i && A.length > 5 && /* @__PURE__ */ w(
|
|
2659
2674
|
"button",
|
|
2660
2675
|
{
|
|
2661
2676
|
type: "button",
|
|
2662
2677
|
className: "ina-file-upload__show-more",
|
|
2663
|
-
onClick: () => $(!
|
|
2678
|
+
onClick: () => $(!T),
|
|
2664
2679
|
children: [
|
|
2665
|
-
|
|
2680
|
+
T ? "Sembunyikan" : "Lihat Selengkapnya",
|
|
2666
2681
|
/* @__PURE__ */ n(
|
|
2667
2682
|
"svg",
|
|
2668
2683
|
{
|
|
@@ -2672,7 +2687,7 @@ function Wr({
|
|
|
2672
2687
|
fill: "none",
|
|
2673
2688
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2674
2689
|
className: S("ina-file-upload__show-more-icon", {
|
|
2675
|
-
"ina-file-upload__show-more-icon--expanded":
|
|
2690
|
+
"ina-file-upload__show-more-icon--expanded": T
|
|
2676
2691
|
}),
|
|
2677
2692
|
children: /* @__PURE__ */ n(
|
|
2678
2693
|
"path",
|
|
@@ -2690,11 +2705,11 @@ function Wr({
|
|
|
2690
2705
|
}
|
|
2691
2706
|
)
|
|
2692
2707
|
] }),
|
|
2693
|
-
_.length > 0 && /* @__PURE__ */ n("div", { className: "ina-file-upload__errors", children: _.map((H,
|
|
2708
|
+
_.length > 0 && /* @__PURE__ */ n("div", { className: "ina-file-upload__errors", children: _.map((H, K) => /* @__PURE__ */ w("div", { className: "ina-file-upload__error-message", children: [
|
|
2694
2709
|
dt(H.file.name),
|
|
2695
2710
|
": ",
|
|
2696
2711
|
H.error
|
|
2697
|
-
] },
|
|
2712
|
+
] }, K)) })
|
|
2698
2713
|
] });
|
|
2699
2714
|
}
|
|
2700
2715
|
const un = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
@@ -2776,13 +2791,13 @@ function jr({
|
|
|
2776
2791
|
onRemove: M,
|
|
2777
2792
|
...m
|
|
2778
2793
|
}) {
|
|
2779
|
-
const p = le(null), [I,
|
|
2780
|
-
var
|
|
2781
|
-
l || I || (
|
|
2794
|
+
const p = le(null), [I, E] = Z(null), [A, F] = Z(0), [N, k] = Z("idle"), [_, f] = Z(!1), T = b !== void 0 ? b : A, $ = h !== void 0 ? h : N, Y = me(() => {
|
|
2795
|
+
var K;
|
|
2796
|
+
l || I || (K = p.current) == null || K.click();
|
|
2782
2797
|
}, [l, I]), B = me(
|
|
2783
|
-
async (
|
|
2784
|
-
var
|
|
2785
|
-
const P = (
|
|
2798
|
+
async (K) => {
|
|
2799
|
+
var j;
|
|
2800
|
+
const P = (j = K.target.files) == null ? void 0 : j[0];
|
|
2786
2801
|
if (!P) return;
|
|
2787
2802
|
if (dt(P.name) !== P.name) {
|
|
2788
2803
|
const Q = {
|
|
@@ -2790,7 +2805,7 @@ function jr({
|
|
|
2790
2805
|
error: "Nama file mengandung karakter yang tidak diizinkan",
|
|
2791
2806
|
file: P
|
|
2792
2807
|
};
|
|
2793
|
-
|
|
2808
|
+
E(null), k("error"), u == null || u(null, Q), p.current && (p.current.value = "");
|
|
2794
2809
|
return;
|
|
2795
2810
|
}
|
|
2796
2811
|
if (i && i.length > 0) {
|
|
@@ -2801,7 +2816,7 @@ function jr({
|
|
|
2801
2816
|
error: `Ekstensi file harus: ${i.join(", ")}`,
|
|
2802
2817
|
file: P
|
|
2803
2818
|
};
|
|
2804
|
-
|
|
2819
|
+
E(null), k("error"), u == null || u(null, ce), p.current && (p.current.value = "");
|
|
2805
2820
|
return;
|
|
2806
2821
|
}
|
|
2807
2822
|
}
|
|
@@ -2811,7 +2826,7 @@ function jr({
|
|
|
2811
2826
|
validateExtension: !0
|
|
2812
2827
|
});
|
|
2813
2828
|
if (!q.isValid) {
|
|
2814
|
-
|
|
2829
|
+
E(null), k("error"), u == null || u(null, q), p.current && (p.current.value = "");
|
|
2815
2830
|
return;
|
|
2816
2831
|
}
|
|
2817
2832
|
if (s && P.type) {
|
|
@@ -2825,55 +2840,55 @@ function jr({
|
|
|
2825
2840
|
error: Q.error || "File signature tidak valid",
|
|
2826
2841
|
file: P
|
|
2827
2842
|
};
|
|
2828
|
-
|
|
2843
|
+
E(null), k("error"), u == null || u(null, ee), p.current && (p.current.value = "");
|
|
2829
2844
|
return;
|
|
2830
2845
|
}
|
|
2831
2846
|
}
|
|
2832
|
-
|
|
2847
|
+
E(P), k("success"), u == null || u(P, null), p.current && (p.current.value = "");
|
|
2833
2848
|
},
|
|
2834
2849
|
[t, r, i, s, u]
|
|
2835
2850
|
), V = me(() => {
|
|
2836
|
-
|
|
2837
|
-
}, [M, u]),
|
|
2838
|
-
l || I ||
|
|
2839
|
-
}, [l, I,
|
|
2851
|
+
E(null), F(0), k("idle"), f(!1), p.current && (p.current.value = ""), M == null || M(), u == null || u(null, null);
|
|
2852
|
+
}, [M, u]), G = me(() => {
|
|
2853
|
+
l || I || Y();
|
|
2854
|
+
}, [l, I, Y]), O = me(() => {
|
|
2840
2855
|
l || I || f(!0);
|
|
2841
|
-
}, [l, I]),
|
|
2856
|
+
}, [l, I]), W = me(() => {
|
|
2842
2857
|
f(!1);
|
|
2843
2858
|
}, []), ae = me(
|
|
2844
|
-
(
|
|
2845
|
-
l || I || (
|
|
2859
|
+
(K) => {
|
|
2860
|
+
l || I || (K.preventDefault(), K.stopPropagation(), f(!0));
|
|
2846
2861
|
},
|
|
2847
2862
|
[l, I]
|
|
2848
2863
|
), ue = me(
|
|
2849
|
-
(
|
|
2850
|
-
l || I || (
|
|
2864
|
+
(K) => {
|
|
2865
|
+
l || I || (K.preventDefault(), K.stopPropagation(), f(!1));
|
|
2851
2866
|
},
|
|
2852
2867
|
[l, I]
|
|
2853
2868
|
), te = me(
|
|
2854
|
-
async (
|
|
2869
|
+
async (K) => {
|
|
2855
2870
|
if (l || I) return;
|
|
2856
|
-
|
|
2857
|
-
const P =
|
|
2871
|
+
K.preventDefault(), K.stopPropagation(), f(!1);
|
|
2872
|
+
const P = K.dataTransfer.files[0];
|
|
2858
2873
|
if (!P) return;
|
|
2859
2874
|
if (dt(P.name) !== P.name) {
|
|
2860
|
-
const
|
|
2875
|
+
const j = {
|
|
2861
2876
|
isValid: !1,
|
|
2862
2877
|
error: "Nama file mengandung karakter yang tidak diizinkan",
|
|
2863
2878
|
file: P
|
|
2864
2879
|
};
|
|
2865
|
-
|
|
2880
|
+
E(null), k("error"), u == null || u(null, j);
|
|
2866
2881
|
return;
|
|
2867
2882
|
}
|
|
2868
2883
|
if (i && i.length > 0) {
|
|
2869
|
-
const
|
|
2884
|
+
const j = P.name.toLowerCase(), Q = j.substring(j.lastIndexOf(".") + 1);
|
|
2870
2885
|
if (!i.includes(Q.toLowerCase())) {
|
|
2871
2886
|
const ee = {
|
|
2872
2887
|
isValid: !1,
|
|
2873
2888
|
error: `Ekstensi file harus: ${i.join(", ")}`,
|
|
2874
2889
|
file: P
|
|
2875
2890
|
};
|
|
2876
|
-
|
|
2891
|
+
E(null), k("error"), u == null || u(null, ee);
|
|
2877
2892
|
return;
|
|
2878
2893
|
}
|
|
2879
2894
|
}
|
|
@@ -2883,25 +2898,25 @@ function jr({
|
|
|
2883
2898
|
validateExtension: !0
|
|
2884
2899
|
});
|
|
2885
2900
|
if (!q.isValid) {
|
|
2886
|
-
|
|
2901
|
+
E(null), k("error"), u == null || u(null, q);
|
|
2887
2902
|
return;
|
|
2888
2903
|
}
|
|
2889
2904
|
if (s && P.type) {
|
|
2890
|
-
const
|
|
2905
|
+
const j = await Mt(
|
|
2891
2906
|
P,
|
|
2892
2907
|
P.type
|
|
2893
2908
|
);
|
|
2894
|
-
if (!
|
|
2909
|
+
if (!j.isValid) {
|
|
2895
2910
|
const Q = {
|
|
2896
2911
|
isValid: !1,
|
|
2897
|
-
error:
|
|
2912
|
+
error: j.error || "File signature tidak valid",
|
|
2898
2913
|
file: P
|
|
2899
2914
|
};
|
|
2900
|
-
|
|
2915
|
+
E(null), k("error"), u == null || u(null, Q);
|
|
2901
2916
|
return;
|
|
2902
2917
|
}
|
|
2903
2918
|
}
|
|
2904
|
-
|
|
2919
|
+
E(P), k("success"), u == null || u(P, null);
|
|
2905
2920
|
},
|
|
2906
2921
|
[
|
|
2907
2922
|
l,
|
|
@@ -2914,8 +2929,8 @@ function jr({
|
|
|
2914
2929
|
]
|
|
2915
2930
|
), X = () => {
|
|
2916
2931
|
if (!I) return null;
|
|
2917
|
-
const
|
|
2918
|
-
return
|
|
2932
|
+
const K = I.type, P = I.name.toLowerCase();
|
|
2933
|
+
return K === "application/pdf" || P.endsWith(".pdf") ? /* @__PURE__ */ n(fn, { size: 16 }) : K.startsWith("image/") ? /* @__PURE__ */ n(pn, { size: 16 }) : /* @__PURE__ */ n(un, { size: 16 });
|
|
2919
2934
|
}, H = S("ina-single-file-upload__container", {
|
|
2920
2935
|
"ina-single-file-upload__container--active": _ && !l && !I,
|
|
2921
2936
|
"ina-single-file-upload__container--disabled": l
|
|
@@ -2937,9 +2952,9 @@ function jr({
|
|
|
2937
2952
|
"div",
|
|
2938
2953
|
{
|
|
2939
2954
|
className: H,
|
|
2940
|
-
onClick:
|
|
2941
|
-
onFocus:
|
|
2942
|
-
onBlur:
|
|
2955
|
+
onClick: G,
|
|
2956
|
+
onFocus: O,
|
|
2957
|
+
onBlur: W,
|
|
2943
2958
|
onDragOver: ae,
|
|
2944
2959
|
onDragLeave: ue,
|
|
2945
2960
|
onDrop: te,
|
|
@@ -2961,12 +2976,12 @@ function jr({
|
|
|
2961
2976
|
"div",
|
|
2962
2977
|
{
|
|
2963
2978
|
className: "ina-single-file-upload__progress-fill",
|
|
2964
|
-
style: { width: `${
|
|
2979
|
+
style: { width: `${T}%` }
|
|
2965
2980
|
}
|
|
2966
2981
|
) }),
|
|
2967
2982
|
/* @__PURE__ */ w("div", { className: "ina-single-file-upload__progress-text", children: [
|
|
2968
2983
|
"Uploading... ",
|
|
2969
|
-
|
|
2984
|
+
T,
|
|
2970
2985
|
"%"
|
|
2971
2986
|
] })
|
|
2972
2987
|
] })
|
|
@@ -2982,8 +2997,8 @@ function jr({
|
|
|
2982
2997
|
{
|
|
2983
2998
|
type: "button",
|
|
2984
2999
|
className: "ina-single-file-upload__delete-button",
|
|
2985
|
-
onClick: (
|
|
2986
|
-
|
|
3000
|
+
onClick: (K) => {
|
|
3001
|
+
K.stopPropagation(), V();
|
|
2987
3002
|
},
|
|
2988
3003
|
"aria-label": "Remove file",
|
|
2989
3004
|
children: /* @__PURE__ */ n(ot, { size: 18 })
|
|
@@ -3056,7 +3071,7 @@ function Yr({
|
|
|
3056
3071
|
className: "ina-field-input-table__action-button ina-field-input-table__action-button--cancel",
|
|
3057
3072
|
title: "Cancel",
|
|
3058
3073
|
children: /* @__PURE__ */ n(
|
|
3059
|
-
|
|
3074
|
+
Te,
|
|
3060
3075
|
{
|
|
3061
3076
|
size: 20,
|
|
3062
3077
|
className: "ina-field-input-table__icon ina-field-input-table__icon--cancel"
|
|
@@ -3088,43 +3103,43 @@ const mn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
3088
3103
|
}
|
|
3089
3104
|
);
|
|
3090
3105
|
function hn(e, a, t, r) {
|
|
3091
|
-
var i = this, s = le(null), l = le(0), c = le(0), b = le(null), h = le([]), u = le(), M = le(), m = le(e), p = le(!0), I = le(),
|
|
3106
|
+
var i = this, s = le(null), l = le(0), c = le(0), b = le(null), h = le([]), u = le(), M = le(), m = le(e), p = le(!0), I = le(), E = le();
|
|
3092
3107
|
m.current = e;
|
|
3093
|
-
var
|
|
3108
|
+
var A = typeof window < "u", F = !a && a !== 0 && A;
|
|
3094
3109
|
if (typeof e != "function") throw new TypeError("Expected a function");
|
|
3095
3110
|
a = +a || 0;
|
|
3096
|
-
var N = !!(t = t || {}).leading, k = !("trailing" in t) || !!t.trailing, _ = !!t.flushOnExit && k, f = "maxWait" in t,
|
|
3111
|
+
var N = !!(t = t || {}).leading, k = !("trailing" in t) || !!t.trailing, _ = !!t.flushOnExit && k, f = "maxWait" in t, T = "debounceOnServer" in t && !!t.debounceOnServer, $ = f ? Math.max(+t.maxWait || 0, a) : null, Y = Fe(function() {
|
|
3097
3112
|
var B = function(te) {
|
|
3098
3113
|
var X = h.current, H = u.current;
|
|
3099
3114
|
return h.current = u.current = null, l.current = te, c.current = c.current || te, M.current = m.current.apply(H, X);
|
|
3100
3115
|
}, V = function(te, X) {
|
|
3101
3116
|
F && cancelAnimationFrame(b.current), b.current = F ? requestAnimationFrame(te) : setTimeout(te, X);
|
|
3102
|
-
},
|
|
3117
|
+
}, G = function(te) {
|
|
3103
3118
|
if (!p.current) return !1;
|
|
3104
3119
|
var X = te - s.current;
|
|
3105
3120
|
return !s.current || X >= a || X < 0 || f && te - l.current >= $;
|
|
3106
|
-
},
|
|
3121
|
+
}, O = function(te) {
|
|
3107
3122
|
return b.current = null, k && h.current ? B(te) : (h.current = u.current = null, M.current);
|
|
3108
|
-
},
|
|
3123
|
+
}, W = function te() {
|
|
3109
3124
|
var X = Date.now();
|
|
3110
|
-
if (N && c.current === l.current && ae(),
|
|
3125
|
+
if (N && c.current === l.current && ae(), G(X)) return O(X);
|
|
3111
3126
|
if (p.current) {
|
|
3112
|
-
var H = a - (X - s.current),
|
|
3113
|
-
V(te,
|
|
3127
|
+
var H = a - (X - s.current), K = f ? Math.min(H, $ - (X - l.current)) : H;
|
|
3128
|
+
V(te, K);
|
|
3114
3129
|
}
|
|
3115
3130
|
}, ae = function() {
|
|
3116
3131
|
r && r({});
|
|
3117
3132
|
}, ue = function() {
|
|
3118
|
-
if (
|
|
3119
|
-
var te, X = Date.now(), H =
|
|
3133
|
+
if (A || T) {
|
|
3134
|
+
var te, X = Date.now(), H = G(X);
|
|
3120
3135
|
if (h.current = [].slice.call(arguments), u.current = i, s.current = X, _ && !I.current && (I.current = function() {
|
|
3121
|
-
var
|
|
3122
|
-
((
|
|
3136
|
+
var K;
|
|
3137
|
+
((K = global.document) == null ? void 0 : K.visibilityState) === "hidden" && E.current.flush();
|
|
3123
3138
|
}, (te = global.document) == null || te.addEventListener == null || te.addEventListener("visibilitychange", I.current)), H) {
|
|
3124
|
-
if (!b.current && p.current) return l.current = s.current, V(
|
|
3125
|
-
if (f) return V(
|
|
3139
|
+
if (!b.current && p.current) return l.current = s.current, V(W, a), N ? B(s.current) : M.current;
|
|
3140
|
+
if (f) return V(W, a), B(s.current);
|
|
3126
3141
|
}
|
|
3127
|
-
return b.current || V(
|
|
3142
|
+
return b.current || V(W, a), M.current;
|
|
3128
3143
|
}
|
|
3129
3144
|
};
|
|
3130
3145
|
return ue.cancel = function() {
|
|
@@ -3133,15 +3148,15 @@ function hn(e, a, t, r) {
|
|
|
3133
3148
|
}, ue.isPending = function() {
|
|
3134
3149
|
return !!b.current;
|
|
3135
3150
|
}, ue.flush = function() {
|
|
3136
|
-
return b.current ?
|
|
3151
|
+
return b.current ? O(Date.now()) : M.current;
|
|
3137
3152
|
}, ue;
|
|
3138
|
-
}, [N, f, a, $, k, _, F,
|
|
3139
|
-
return
|
|
3153
|
+
}, [N, f, a, $, k, _, F, A, T, r]);
|
|
3154
|
+
return E.current = Y, oe(function() {
|
|
3140
3155
|
return p.current = !0, function() {
|
|
3141
3156
|
var B;
|
|
3142
|
-
_ &&
|
|
3157
|
+
_ && E.current.flush(), I.current && ((B = global.document) == null || B.removeEventListener == null || B.removeEventListener("visibilitychange", I.current), I.current = null), p.current = !1;
|
|
3143
3158
|
};
|
|
3144
|
-
}, [_]),
|
|
3159
|
+
}, [_]), Y;
|
|
3145
3160
|
}
|
|
3146
3161
|
function vn(e, a) {
|
|
3147
3162
|
return e === a;
|
|
@@ -3217,7 +3232,7 @@ function es({
|
|
|
3217
3232
|
}, [m, i]), oe(() => {
|
|
3218
3233
|
M(t || "");
|
|
3219
3234
|
}, [t]);
|
|
3220
|
-
const I = le(null),
|
|
3235
|
+
const I = le(null), E = S("ina-input-search"), A = S(
|
|
3221
3236
|
"ina-input-search__wrapper",
|
|
3222
3237
|
h && "ina-input-search__wrapper--disabled",
|
|
3223
3238
|
e
|
|
@@ -3225,7 +3240,7 @@ function es({
|
|
|
3225
3240
|
"ina-input-search__clear-button",
|
|
3226
3241
|
!u && "ina-input-search__clear-button--hidden"
|
|
3227
3242
|
);
|
|
3228
|
-
return /* @__PURE__ */ w("div", { className:
|
|
3243
|
+
return /* @__PURE__ */ w("div", { className: E, children: [
|
|
3229
3244
|
a && /* @__PURE__ */ w(
|
|
3230
3245
|
"label",
|
|
3231
3246
|
{
|
|
@@ -3241,7 +3256,7 @@ function es({
|
|
|
3241
3256
|
]
|
|
3242
3257
|
}
|
|
3243
3258
|
),
|
|
3244
|
-
/* @__PURE__ */ w("div", { className:
|
|
3259
|
+
/* @__PURE__ */ w("div", { className: A, children: [
|
|
3245
3260
|
/* @__PURE__ */ n(mn, { className: "ina-input-search__search-icon", size: 20 }),
|
|
3246
3261
|
/* @__PURE__ */ n(
|
|
3247
3262
|
"input",
|
|
@@ -3265,7 +3280,7 @@ function es({
|
|
|
3265
3280
|
onClick: () => {
|
|
3266
3281
|
M(""), I.current && I.current.focus();
|
|
3267
3282
|
},
|
|
3268
|
-
children: /* @__PURE__ */ n(
|
|
3283
|
+
children: /* @__PURE__ */ n(Te, { size: 20 })
|
|
3269
3284
|
}
|
|
3270
3285
|
)
|
|
3271
3286
|
] })
|
|
@@ -3283,66 +3298,71 @@ function yn({
|
|
|
3283
3298
|
paddingBody: b = "16px 24px",
|
|
3284
3299
|
closeLabel: h = "Tutup dialog"
|
|
3285
3300
|
}) {
|
|
3286
|
-
const [u, M] = Z(!1), [m, p] = Z(!1), [I,
|
|
3301
|
+
const [u, M] = Z(!1), [m, p] = Z(!1), [I, E] = Z(!1), A = le(null), F = le(`modal-title-${Math.random().toString(36).slice(2)}`), N = le(null), k = le(!1);
|
|
3287
3302
|
if (oe(() => M(!0), []), oe(() => {
|
|
3288
3303
|
if (e)
|
|
3289
3304
|
p(!0), N.current = document.activeElement, requestAnimationFrame(() => {
|
|
3290
3305
|
requestAnimationFrame(() => {
|
|
3291
|
-
|
|
3306
|
+
E(!0);
|
|
3292
3307
|
});
|
|
3293
3308
|
});
|
|
3294
3309
|
else {
|
|
3295
|
-
|
|
3296
|
-
const
|
|
3310
|
+
E(!1), N.current && (N.current.focus(), N.current = null);
|
|
3311
|
+
const B = setTimeout(() => {
|
|
3297
3312
|
p(!1);
|
|
3298
3313
|
}, 300);
|
|
3299
|
-
return () => clearTimeout(
|
|
3314
|
+
return () => clearTimeout(B);
|
|
3300
3315
|
}
|
|
3301
3316
|
}, [e]), oe(() => {
|
|
3302
3317
|
if (u && m) {
|
|
3303
|
-
const
|
|
3318
|
+
const B = document.documentElement.style.overflow;
|
|
3304
3319
|
return document.documentElement.style.overflow = "hidden", () => {
|
|
3305
|
-
document.documentElement.style.overflow =
|
|
3320
|
+
document.documentElement.style.overflow = B;
|
|
3306
3321
|
};
|
|
3307
3322
|
}
|
|
3308
3323
|
}, [m, u]), oe(() => {
|
|
3309
3324
|
if (!m || !u) return;
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
(B = E.current) == null || B.focus();
|
|
3313
|
-
}, 50);
|
|
3314
|
-
const K = (B) => {
|
|
3315
|
-
if (B.key === "Escape" && I) {
|
|
3325
|
+
const B = (V) => {
|
|
3326
|
+
if (V.key === "Escape" && I) {
|
|
3316
3327
|
a();
|
|
3317
3328
|
return;
|
|
3318
3329
|
}
|
|
3319
|
-
if (
|
|
3320
|
-
const
|
|
3321
|
-
if (!
|
|
3322
|
-
const O =
|
|
3330
|
+
if (V.key === "Tab" && I) {
|
|
3331
|
+
const G = document.querySelector(".ina-modal__dialog");
|
|
3332
|
+
if (!G) return;
|
|
3333
|
+
const O = G.querySelectorAll(
|
|
3323
3334
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
3324
3335
|
);
|
|
3325
3336
|
if (O.length === 0) return;
|
|
3326
|
-
const
|
|
3327
|
-
|
|
3337
|
+
const W = O[0], ae = O[O.length - 1];
|
|
3338
|
+
V.shiftKey ? document.activeElement === W && (V.preventDefault(), ae.focus()) : document.activeElement === ae && (V.preventDefault(), W.focus());
|
|
3328
3339
|
}
|
|
3329
3340
|
};
|
|
3330
|
-
return document.addEventListener("keydown",
|
|
3331
|
-
}, [m, I, u, a]),
|
|
3332
|
-
|
|
3341
|
+
return document.addEventListener("keydown", B), () => document.removeEventListener("keydown", B);
|
|
3342
|
+
}, [m, I, u, a]), oe(() => {
|
|
3343
|
+
if (I && !k.current) {
|
|
3344
|
+
const B = setTimeout(() => {
|
|
3345
|
+
var V;
|
|
3346
|
+
(V = A.current) == null || V.focus(), k.current = !0;
|
|
3347
|
+
}, 50);
|
|
3348
|
+
return () => clearTimeout(B);
|
|
3349
|
+
}
|
|
3350
|
+
e || (k.current = !1);
|
|
3351
|
+
}, [I, e]), !m || !u) return null;
|
|
3352
|
+
const _ = s ?? document.body, f = S(
|
|
3333
3353
|
"ina-modal",
|
|
3334
3354
|
I ? "ina-modal--enter-active" : "ina-modal--enter"
|
|
3335
|
-
),
|
|
3355
|
+
), T = S(
|
|
3336
3356
|
"ina-modal__dialog",
|
|
3337
3357
|
c && `ina-modal__dialog--size-${c}`,
|
|
3338
3358
|
l
|
|
3339
|
-
),
|
|
3359
|
+
), $ = S(
|
|
3340
3360
|
"ina-modal__header",
|
|
3341
3361
|
t ? "ina-modal__header--with-title" : "ina-modal__header--no-border"
|
|
3342
|
-
),
|
|
3362
|
+
), Y = /* @__PURE__ */ w(
|
|
3343
3363
|
"div",
|
|
3344
3364
|
{
|
|
3345
|
-
className:
|
|
3365
|
+
className: f,
|
|
3346
3366
|
role: "dialog",
|
|
3347
3367
|
"aria-modal": "true",
|
|
3348
3368
|
"aria-labelledby": t && typeof t == "string" ? F.current : void 0,
|
|
@@ -3359,20 +3379,20 @@ function yn({
|
|
|
3359
3379
|
/* @__PURE__ */ n("div", { className: "ina-modal__container", children: /* @__PURE__ */ w(
|
|
3360
3380
|
"div",
|
|
3361
3381
|
{
|
|
3362
|
-
className:
|
|
3363
|
-
onClick: (
|
|
3382
|
+
className: T,
|
|
3383
|
+
onClick: (B) => B.stopPropagation(),
|
|
3364
3384
|
tabIndex: -1,
|
|
3365
3385
|
children: [
|
|
3366
|
-
/* @__PURE__ */ w("div", { className:
|
|
3386
|
+
/* @__PURE__ */ w("div", { className: $, children: [
|
|
3367
3387
|
t && /* @__PURE__ */ n("div", { className: "ina-modal__title", children: typeof t == "string" ? /* @__PURE__ */ n("h2", { id: F.current, children: t }) : t }),
|
|
3368
3388
|
/* @__PURE__ */ n(
|
|
3369
3389
|
"button",
|
|
3370
3390
|
{
|
|
3371
|
-
ref:
|
|
3391
|
+
ref: A,
|
|
3372
3392
|
onClick: a,
|
|
3373
3393
|
"aria-label": h,
|
|
3374
3394
|
className: "ina-modal__close-button",
|
|
3375
|
-
children: /* @__PURE__ */ n(
|
|
3395
|
+
children: /* @__PURE__ */ n(Te, { size: 24, className: "ina-modal__close-icon" })
|
|
3376
3396
|
}
|
|
3377
3397
|
)
|
|
3378
3398
|
] }),
|
|
@@ -3383,7 +3403,7 @@ function yn({
|
|
|
3383
3403
|
]
|
|
3384
3404
|
}
|
|
3385
3405
|
);
|
|
3386
|
-
return
|
|
3406
|
+
return Lt(Y, _);
|
|
3387
3407
|
}
|
|
3388
3408
|
const ut = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
3389
3409
|
"svg",
|
|
@@ -3465,14 +3485,14 @@ function wn({
|
|
|
3465
3485
|
if (a <= 0) return null;
|
|
3466
3486
|
function p() {
|
|
3467
3487
|
const f = [];
|
|
3468
|
-
let
|
|
3469
|
-
e === 1 ? (
|
|
3470
|
-
for (let
|
|
3471
|
-
f.push(I(
|
|
3488
|
+
let T, $;
|
|
3489
|
+
e === 1 ? (T = 1, $ = Math.min(3, a)) : e === a ? (T = Math.max(1, a - 2), $ = a) : (T = e - 1, $ = e + 1);
|
|
3490
|
+
for (let Y = T; Y <= $; Y++)
|
|
3491
|
+
f.push(I(Y));
|
|
3472
3492
|
return f;
|
|
3473
3493
|
}
|
|
3474
3494
|
const I = (f) => {
|
|
3475
|
-
const
|
|
3495
|
+
const T = f === e;
|
|
3476
3496
|
return /* @__PURE__ */ n(
|
|
3477
3497
|
"button",
|
|
3478
3498
|
{
|
|
@@ -3482,25 +3502,25 @@ function wn({
|
|
|
3482
3502
|
disabled: l,
|
|
3483
3503
|
className: S(
|
|
3484
3504
|
"ina-pagination__page-button",
|
|
3485
|
-
|
|
3486
|
-
!l && !
|
|
3505
|
+
T && "ina-pagination__page-button--active",
|
|
3506
|
+
!l && !T && "ina-pagination__page-button--enabled",
|
|
3487
3507
|
l && "ina-pagination__page-button--disabled"
|
|
3488
3508
|
),
|
|
3489
3509
|
children: f
|
|
3490
3510
|
},
|
|
3491
3511
|
f
|
|
3492
3512
|
);
|
|
3493
|
-
}, A = (f) => {
|
|
3494
|
-
f.preventDefault(), !l && e > 1 && i(1);
|
|
3495
3513
|
}, E = (f) => {
|
|
3514
|
+
f.preventDefault(), !l && e > 1 && i(1);
|
|
3515
|
+
}, A = (f) => {
|
|
3496
3516
|
f.preventDefault(), !l && e > 1 && i(e - 1);
|
|
3497
3517
|
}, F = (f) => {
|
|
3498
3518
|
f.preventDefault(), !l && e < a && i(e + 1);
|
|
3499
3519
|
}, N = (f) => {
|
|
3500
3520
|
f.preventDefault(), !l && e < a && i(a);
|
|
3501
3521
|
}, k = (f) => {
|
|
3502
|
-
const
|
|
3503
|
-
l || s(
|
|
3522
|
+
const T = parseInt(f.target.value, 10);
|
|
3523
|
+
l || s(T);
|
|
3504
3524
|
}, _ = S(
|
|
3505
3525
|
"ina-pagination",
|
|
3506
3526
|
c && "ina-pagination--full-width"
|
|
@@ -3540,19 +3560,19 @@ function wn({
|
|
|
3540
3560
|
{
|
|
3541
3561
|
className: "ina-pagination__nav-buttons",
|
|
3542
3562
|
onKeyDown: (f) => {
|
|
3543
|
-
var
|
|
3563
|
+
var T;
|
|
3544
3564
|
if (f.key === "ArrowRight" || f.key === "ArrowLeft") {
|
|
3545
3565
|
const $ = Array.from(
|
|
3546
3566
|
f.currentTarget.querySelectorAll("button:not([disabled])")
|
|
3547
3567
|
);
|
|
3548
3568
|
if (!$.length) return;
|
|
3549
|
-
const
|
|
3569
|
+
const Y = $.indexOf(
|
|
3550
3570
|
document.activeElement
|
|
3551
3571
|
);
|
|
3552
|
-
if (
|
|
3572
|
+
if (Y >= 0) {
|
|
3553
3573
|
f.preventDefault();
|
|
3554
|
-
const B = f.key === "ArrowRight" ? (
|
|
3555
|
-
(
|
|
3574
|
+
const B = f.key === "ArrowRight" ? (Y + 1) % $.length : (Y - 1 + $.length) % $.length;
|
|
3575
|
+
(T = $[B]) == null || T.focus();
|
|
3556
3576
|
}
|
|
3557
3577
|
} else if (f.key === "Enter" || f.key === " ") {
|
|
3558
3578
|
const $ = document.activeElement;
|
|
@@ -3563,7 +3583,7 @@ function wn({
|
|
|
3563
3583
|
/* @__PURE__ */ n(
|
|
3564
3584
|
"button",
|
|
3565
3585
|
{
|
|
3566
|
-
onClick:
|
|
3586
|
+
onClick: E,
|
|
3567
3587
|
disabled: l || e === 1,
|
|
3568
3588
|
className: S(
|
|
3569
3589
|
"ina-pagination__nav-button",
|
|
@@ -3576,7 +3596,7 @@ function wn({
|
|
|
3576
3596
|
/* @__PURE__ */ n(
|
|
3577
3597
|
"button",
|
|
3578
3598
|
{
|
|
3579
|
-
onClick:
|
|
3599
|
+
onClick: A,
|
|
3580
3600
|
disabled: l || e === 1,
|
|
3581
3601
|
className: S(
|
|
3582
3602
|
"ina-pagination__nav-button",
|
|
@@ -3629,7 +3649,7 @@ function wn({
|
|
|
3629
3649
|
"ina-pagination__page-size-select",
|
|
3630
3650
|
l && "ina-pagination__page-size-select--disabled"
|
|
3631
3651
|
),
|
|
3632
|
-
children: r.map((f,
|
|
3652
|
+
children: r.map((f, T) => /* @__PURE__ */ n("option", { value: f, children: f }, `${f}-${T}`))
|
|
3633
3653
|
}
|
|
3634
3654
|
)
|
|
3635
3655
|
] })
|
|
@@ -3795,32 +3815,32 @@ function as({
|
|
|
3795
3815
|
placeholder: m,
|
|
3796
3816
|
disabled: p = !1,
|
|
3797
3817
|
className: I = "",
|
|
3798
|
-
onBlur:
|
|
3799
|
-
...
|
|
3818
|
+
onBlur: E,
|
|
3819
|
+
...A
|
|
3800
3820
|
}) {
|
|
3801
|
-
const [F, N] = Z(e), [k, _] = Z(!1), [f] = ht(F, t),
|
|
3821
|
+
const [F, N] = Z(e), [k, _] = Z(!1), [f] = ht(F, t), T = le(!0);
|
|
3802
3822
|
oe(() => {
|
|
3803
3823
|
N(e);
|
|
3804
3824
|
}, [e]), oe(() => {
|
|
3805
|
-
|
|
3825
|
+
T.current ? T.current = !1 : t > 0 && r && r(f);
|
|
3806
3826
|
}, [f, t, r]);
|
|
3807
|
-
const $ = (
|
|
3808
|
-
const ae =
|
|
3827
|
+
const $ = (W) => {
|
|
3828
|
+
const ae = W.target.value;
|
|
3809
3829
|
u != null && ae.length > u || (N(ae), a(ae));
|
|
3810
|
-
},
|
|
3811
|
-
|
|
3830
|
+
}, Y = (W) => {
|
|
3831
|
+
E == null || E(W);
|
|
3812
3832
|
}, B = () => {
|
|
3813
3833
|
N(""), a(""), r && r("");
|
|
3814
|
-
}, V = c !== "neutral" && b != null ? b : l,
|
|
3834
|
+
}, V = c !== "neutral" && b != null ? b : l, G = (A == null ? void 0 : A.id) || (A == null ? void 0 : A.name) || String(s).toLowerCase(), O = `${G}-status`;
|
|
3815
3835
|
return /* @__PURE__ */ w("div", { className: S("ina-password-input", I), children: [
|
|
3816
3836
|
s && /* @__PURE__ */ w(
|
|
3817
3837
|
"label",
|
|
3818
3838
|
{
|
|
3819
3839
|
className: "ina-password-input__label",
|
|
3820
|
-
htmlFor: String(
|
|
3840
|
+
htmlFor: String(G),
|
|
3821
3841
|
children: [
|
|
3822
3842
|
s,
|
|
3823
|
-
|
|
3843
|
+
A.required && /* @__PURE__ */ n("span", { className: "ina-text-field__required", children: "*" })
|
|
3824
3844
|
]
|
|
3825
3845
|
}
|
|
3826
3846
|
),
|
|
@@ -3838,17 +3858,17 @@ function as({
|
|
|
3838
3858
|
/* @__PURE__ */ n(
|
|
3839
3859
|
"input",
|
|
3840
3860
|
{
|
|
3841
|
-
...
|
|
3842
|
-
id: String(
|
|
3861
|
+
...A,
|
|
3862
|
+
id: String(G),
|
|
3843
3863
|
type: k ? "text" : "password",
|
|
3844
3864
|
className: "ina-password-input__input",
|
|
3845
3865
|
value: F,
|
|
3846
3866
|
onChange: $,
|
|
3847
|
-
onBlur:
|
|
3867
|
+
onBlur: Y,
|
|
3848
3868
|
placeholder: m,
|
|
3849
3869
|
disabled: p,
|
|
3850
3870
|
maxLength: u,
|
|
3851
|
-
"aria-describedby": V ?
|
|
3871
|
+
"aria-describedby": V ? O : void 0
|
|
3852
3872
|
}
|
|
3853
3873
|
),
|
|
3854
3874
|
F !== "" && /* @__PURE__ */ n(
|
|
@@ -3857,11 +3877,11 @@ function as({
|
|
|
3857
3877
|
type: "button",
|
|
3858
3878
|
className: "ina-password-input__clear-button",
|
|
3859
3879
|
onClick: B,
|
|
3860
|
-
onKeyDown: (
|
|
3861
|
-
(
|
|
3880
|
+
onKeyDown: (W) => {
|
|
3881
|
+
(W.key === "Enter" || W.key === " ") && (W.preventDefault(), B());
|
|
3862
3882
|
},
|
|
3863
3883
|
"aria-label": "Hapus input",
|
|
3864
|
-
children: /* @__PURE__ */ n(
|
|
3884
|
+
children: /* @__PURE__ */ n(Te, { size: 16 })
|
|
3865
3885
|
}
|
|
3866
3886
|
),
|
|
3867
3887
|
/* @__PURE__ */ n(
|
|
@@ -3869,9 +3889,9 @@ function as({
|
|
|
3869
3889
|
{
|
|
3870
3890
|
type: "button",
|
|
3871
3891
|
className: "ina-password-input__toggle-button",
|
|
3872
|
-
onClick: () => _((
|
|
3873
|
-
onKeyDown: (
|
|
3874
|
-
(
|
|
3892
|
+
onClick: () => _((W) => !W),
|
|
3893
|
+
onKeyDown: (W) => {
|
|
3894
|
+
(W.key === "Enter" || W.key === " ") && (W.preventDefault(), _((ae) => !ae));
|
|
3875
3895
|
},
|
|
3876
3896
|
"aria-label": k ? "Sembunyikan password" : "Tampilkan password",
|
|
3877
3897
|
children: k ? /* @__PURE__ */ n(Mn, { size: 20 }) : /* @__PURE__ */ n(Cn, { size: 20 })
|
|
@@ -3880,7 +3900,7 @@ function as({
|
|
|
3880
3900
|
]
|
|
3881
3901
|
}
|
|
3882
3902
|
),
|
|
3883
|
-
V && /* @__PURE__ */ w("div", { id:
|
|
3903
|
+
V && /* @__PURE__ */ w("div", { id: O, className: "ina-password-input__status-area", children: [
|
|
3884
3904
|
/* @__PURE__ */ n(
|
|
3885
3905
|
"div",
|
|
3886
3906
|
{
|
|
@@ -4471,13 +4491,13 @@ function rs({
|
|
|
4471
4491
|
defaultCountry: m = "ID",
|
|
4472
4492
|
countries: p = xn,
|
|
4473
4493
|
allowClear: I = !0,
|
|
4474
|
-
className:
|
|
4475
|
-
id:
|
|
4494
|
+
className: E,
|
|
4495
|
+
id: A,
|
|
4476
4496
|
...F
|
|
4477
4497
|
}) {
|
|
4478
|
-
const N = Fe(() =>
|
|
4498
|
+
const N = Fe(() => A || `phone-input-${Math.random().toString(36).substr(2, 9)}`, [A]), [k, _] = Z(a), [f, T] = Z(!1), [$, Y] = Z(""), [B, V] = Z(
|
|
4479
4499
|
p.find((ee) => ee.code === m) || p[0]
|
|
4480
|
-
),
|
|
4500
|
+
), G = le(null), O = le(null), W = le(null), ae = Fe(() => `${N}-helper`, [N]), ue = (ee) => {
|
|
4481
4501
|
const ce = ee.replace(/\D/g, "");
|
|
4482
4502
|
return ce.length > 7 ? ce.replace(/^(\d{3})(\d{4})(.*)/, "$1-$2-$3") : ce.length > 3 ? ce.replace(/^(\d{3})(.*)/, "$1-$2") : ce;
|
|
4483
4503
|
};
|
|
@@ -4491,7 +4511,7 @@ function rs({
|
|
|
4491
4511
|
a.startsWith(ee) && (ce = a.substring(ee.length)), _(ue(ce));
|
|
4492
4512
|
}, [a, B.dialCode]), oe(() => {
|
|
4493
4513
|
const ee = (ce) => {
|
|
4494
|
-
|
|
4514
|
+
W.current && !W.current.contains(ce.target) && T(!1);
|
|
4495
4515
|
};
|
|
4496
4516
|
return document.addEventListener("mousedown", ee), () => {
|
|
4497
4517
|
document.removeEventListener("mousedown", ee);
|
|
@@ -4504,23 +4524,23 @@ function rs({
|
|
|
4504
4524
|
(ce) => ce.name.toLowerCase().includes(ee) || ce.dialCode.includes(ee) || ce.code.toLowerCase().includes(ee)
|
|
4505
4525
|
);
|
|
4506
4526
|
}, [p, $]), X = () => {
|
|
4507
|
-
h || u ||
|
|
4527
|
+
h || u || T((ee) => {
|
|
4508
4528
|
const ce = !ee;
|
|
4509
|
-
return ce && (
|
|
4529
|
+
return ce && (Y(""), setTimeout(() => {
|
|
4510
4530
|
var _e;
|
|
4511
|
-
(_e =
|
|
4531
|
+
(_e = O.current) == null || _e.focus();
|
|
4512
4532
|
}, 0)), ce;
|
|
4513
4533
|
});
|
|
4514
4534
|
}, H = (ee) => {
|
|
4515
|
-
if (V(ee),
|
|
4535
|
+
if (V(ee), T(!1), k) {
|
|
4516
4536
|
const ce = k.replace(/\D/g, ""), _e = ce.startsWith("0") ? ce.substring(1) : ce;
|
|
4517
4537
|
t == null || t(`${ee.dialCode}${_e}`);
|
|
4518
4538
|
}
|
|
4519
4539
|
setTimeout(() => {
|
|
4520
4540
|
var ce;
|
|
4521
|
-
(ce =
|
|
4541
|
+
(ce = G.current) == null || ce.focus();
|
|
4522
4542
|
}, 0);
|
|
4523
|
-
},
|
|
4543
|
+
}, K = (ee) => {
|
|
4524
4544
|
const _e = ee.target.value.replace(/\D/g, ""), ie = ue(_e);
|
|
4525
4545
|
_(ie);
|
|
4526
4546
|
let J = _e;
|
|
@@ -4528,16 +4548,16 @@ function rs({
|
|
|
4528
4548
|
}, P = S(
|
|
4529
4549
|
"ina-phone-input",
|
|
4530
4550
|
h && "ina-phone-input--disabled",
|
|
4531
|
-
|
|
4551
|
+
E
|
|
4532
4552
|
), se = () => {
|
|
4533
4553
|
var ee;
|
|
4534
|
-
_(""), t == null || t(`${B.dialCode}`), (ee =
|
|
4554
|
+
_(""), t == null || t(`${B.dialCode}`), (ee = G.current) == null || ee.focus();
|
|
4535
4555
|
}, q = S(
|
|
4536
4556
|
"ina-phone-input__wrapper",
|
|
4537
4557
|
`ina-phone-input__wrapper--size-${s}`,
|
|
4538
4558
|
h && "ina-phone-input__wrapper--disabled",
|
|
4539
4559
|
l !== "neutral" && `ina-phone-input__wrapper--status-${l}`
|
|
4540
|
-
),
|
|
4560
|
+
), j = S(
|
|
4541
4561
|
"ina-phone-input__helper-text",
|
|
4542
4562
|
l === "error" && "ina-phone-input__helper-text--error",
|
|
4543
4563
|
l === "warning" && "ina-phone-input__helper-text--warning"
|
|
@@ -4548,7 +4568,7 @@ function rs({
|
|
|
4548
4568
|
M && /* @__PURE__ */ n("span", { className: "ina-text-field__required", children: "*" })
|
|
4549
4569
|
] }),
|
|
4550
4570
|
/* @__PURE__ */ w("div", { className: q, children: [
|
|
4551
|
-
/* @__PURE__ */ w("div", { className: "ina-phone-input__country-selector", ref:
|
|
4571
|
+
/* @__PURE__ */ w("div", { className: "ina-phone-input__country-selector", ref: W, children: [
|
|
4552
4572
|
/* @__PURE__ */ w(
|
|
4553
4573
|
"button",
|
|
4554
4574
|
{
|
|
@@ -4602,9 +4622,9 @@ function rs({
|
|
|
4602
4622
|
/* @__PURE__ */ n("div", { className: "ina-phone-input__country-search", children: /* @__PURE__ */ n(
|
|
4603
4623
|
"input",
|
|
4604
4624
|
{
|
|
4605
|
-
ref:
|
|
4625
|
+
ref: O,
|
|
4606
4626
|
value: $,
|
|
4607
|
-
onChange: (ee) =>
|
|
4627
|
+
onChange: (ee) => Y(ee.target.value),
|
|
4608
4628
|
type: "text",
|
|
4609
4629
|
placeholder: "Cari",
|
|
4610
4630
|
className: "ina-phone-input__country-search-input"
|
|
@@ -4651,14 +4671,14 @@ function rs({
|
|
|
4651
4671
|
{
|
|
4652
4672
|
...F,
|
|
4653
4673
|
id: N,
|
|
4654
|
-
ref:
|
|
4674
|
+
ref: G,
|
|
4655
4675
|
value: k,
|
|
4656
4676
|
type: "tel",
|
|
4657
4677
|
placeholder: i,
|
|
4658
4678
|
disabled: h,
|
|
4659
4679
|
readOnly: u,
|
|
4660
4680
|
className: "ina-phone-input__input",
|
|
4661
|
-
onChange:
|
|
4681
|
+
onChange: K,
|
|
4662
4682
|
"aria-describedby": Q ? ae : void 0
|
|
4663
4683
|
}
|
|
4664
4684
|
),
|
|
@@ -4672,11 +4692,11 @@ function rs({
|
|
|
4672
4692
|
onKeyDown: (ee) => {
|
|
4673
4693
|
(ee.key === "Enter" || ee.key === " ") && (ee.preventDefault(), se());
|
|
4674
4694
|
},
|
|
4675
|
-
children: /* @__PURE__ */ n(
|
|
4695
|
+
children: /* @__PURE__ */ n(Te, { size: 16 })
|
|
4676
4696
|
}
|
|
4677
4697
|
)
|
|
4678
4698
|
] }),
|
|
4679
|
-
Q && /* @__PURE__ */ n("div", { id: ae, className:
|
|
4699
|
+
Q && /* @__PURE__ */ n("div", { id: ae, className: j, children: Q })
|
|
4680
4700
|
] });
|
|
4681
4701
|
}
|
|
4682
4702
|
function ss({
|
|
@@ -4770,38 +4790,38 @@ const is = ({
|
|
|
4770
4790
|
prefixNode: m,
|
|
4771
4791
|
width: p = "100%",
|
|
4772
4792
|
panelWidth: I,
|
|
4773
|
-
panelHeight:
|
|
4793
|
+
panelHeight: E = 600,
|
|
4774
4794
|
// default 600px
|
|
4775
|
-
hasMore:
|
|
4795
|
+
hasMore: A = !1,
|
|
4776
4796
|
loading: F = !1,
|
|
4777
4797
|
currentPage: N = 1,
|
|
4778
4798
|
onLoadMore: k,
|
|
4779
4799
|
onSearch: _,
|
|
4780
4800
|
searchDebounceMs: f = 300,
|
|
4781
|
-
renderSelectedPreview:
|
|
4801
|
+
renderSelectedPreview: T,
|
|
4782
4802
|
onRemoveSelected: $,
|
|
4783
|
-
searchValue:
|
|
4803
|
+
searchValue: Y,
|
|
4784
4804
|
onSearchChange: B,
|
|
4785
4805
|
disabled: V = !1,
|
|
4786
|
-
showPreviewValue:
|
|
4787
|
-
searchable:
|
|
4788
|
-
onSelectedRawChange:
|
|
4806
|
+
showPreviewValue: G = !0,
|
|
4807
|
+
searchable: O = !0,
|
|
4808
|
+
onSelectedRawChange: W,
|
|
4789
4809
|
label: ae,
|
|
4790
4810
|
required: ue,
|
|
4791
4811
|
selectionTitle: te,
|
|
4792
4812
|
mandatorySelected: X = !1
|
|
4793
4813
|
}) => {
|
|
4794
4814
|
var x;
|
|
4795
|
-
const [H,
|
|
4815
|
+
const [H, K] = Z(!1), [P, se] = Z(""), [q, j] = Z(-1), Q = le(null), ee = le(null), ce = le([]), _e = le(null), ie = le(/* @__PURE__ */ new Map()), J = Y !== void 0, he = J ? Y : P;
|
|
4796
4816
|
oe(() => (_e.current && clearTimeout(_e.current), _ && he !== "" ? _e.current = setTimeout(() => {
|
|
4797
4817
|
_(he);
|
|
4798
4818
|
}, f) : _ && he === "" && _(""), () => {
|
|
4799
4819
|
_e.current && clearTimeout(_e.current);
|
|
4800
4820
|
}), [he, _, f]), oe(() => {
|
|
4801
|
-
J &&
|
|
4802
|
-
}, [
|
|
4821
|
+
J && Y !== P && se(Y);
|
|
4822
|
+
}, [Y, J, P]), oe(() => {
|
|
4803
4823
|
const v = (g) => {
|
|
4804
|
-
Q.current && !Q.current.contains(g.target) && (
|
|
4824
|
+
Q.current && !Q.current.contains(g.target) && (K(!1), j(-1), M == null || M());
|
|
4805
4825
|
};
|
|
4806
4826
|
return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
4807
4827
|
}, [M, J, B]), oe(() => () => {
|
|
@@ -4817,7 +4837,7 @@ const is = ({
|
|
|
4817
4837
|
return g !== null ? { label: g, value: v } : e.find((re) => re.value === v) || null;
|
|
4818
4838
|
};
|
|
4819
4839
|
oe(() => {
|
|
4820
|
-
if (
|
|
4840
|
+
if (W) {
|
|
4821
4841
|
let v = null;
|
|
4822
4842
|
if (h) {
|
|
4823
4843
|
if (fe.length > 0) {
|
|
@@ -4826,7 +4846,7 @@ const is = ({
|
|
|
4826
4846
|
}
|
|
4827
4847
|
} else
|
|
4828
4848
|
pe != null && pe !== "" && (v = be(pe));
|
|
4829
|
-
|
|
4849
|
+
W(v);
|
|
4830
4850
|
}
|
|
4831
4851
|
}, [a, h, e]), oe(() => {
|
|
4832
4852
|
const v = ie.current;
|
|
@@ -4863,11 +4883,11 @@ const is = ({
|
|
|
4863
4883
|
}
|
|
4864
4884
|
else
|
|
4865
4885
|
we = Ce(pe) || r;
|
|
4866
|
-
const ke = _ ? e :
|
|
4886
|
+
const ke = _ ? e : O ? e.filter(
|
|
4867
4887
|
(v) => v.label.toLowerCase().includes(he.toLowerCase())
|
|
4868
4888
|
) : e;
|
|
4869
4889
|
oe(() => {
|
|
4870
|
-
|
|
4890
|
+
j(-1);
|
|
4871
4891
|
}, [ke]), oe(() => {
|
|
4872
4892
|
var v;
|
|
4873
4893
|
H && q >= 0 && ce.current[q] && ((v = ce.current[q]) == null || v.scrollIntoView({
|
|
@@ -4891,8 +4911,8 @@ const is = ({
|
|
|
4891
4911
|
t(null);
|
|
4892
4912
|
}
|
|
4893
4913
|
}, Ie = () => {
|
|
4894
|
-
if (
|
|
4895
|
-
return X ? null :
|
|
4914
|
+
if (T || X)
|
|
4915
|
+
return X ? null : T == null ? void 0 : T(a);
|
|
4896
4916
|
if (h && fe.length > 0)
|
|
4897
4917
|
return /* @__PURE__ */ w("div", { className: "ina-select-dropdown__preview-content", children: [
|
|
4898
4918
|
fe.slice(0, 3).map((v, g) => {
|
|
@@ -4913,7 +4933,7 @@ const is = ({
|
|
|
4913
4933
|
className: "ina-select-dropdown__preview-remove ina-select-dropdown__preview-remove--multiple",
|
|
4914
4934
|
"aria-label": `Remove ${re}`,
|
|
4915
4935
|
disabled: V,
|
|
4916
|
-
children: /* @__PURE__ */ n(
|
|
4936
|
+
children: /* @__PURE__ */ n(Te, { size: 12 })
|
|
4917
4937
|
}
|
|
4918
4938
|
)
|
|
4919
4939
|
]
|
|
@@ -4941,7 +4961,7 @@ const is = ({
|
|
|
4941
4961
|
className: "ina-select-dropdown__preview-remove ina-select-dropdown__preview-remove--single",
|
|
4942
4962
|
"aria-label": `Remove ${g}`,
|
|
4943
4963
|
disabled: V,
|
|
4944
|
-
children: /* @__PURE__ */ n(
|
|
4964
|
+
children: /* @__PURE__ */ n(Te, { size: 12 })
|
|
4945
4965
|
}
|
|
4946
4966
|
)
|
|
4947
4967
|
] }) });
|
|
@@ -4961,13 +4981,13 @@ const is = ({
|
|
|
4961
4981
|
), C = S(
|
|
4962
4982
|
"ina-select-dropdown__trigger-icon",
|
|
4963
4983
|
V && "ina-select-dropdown__trigger-icon--disabled"
|
|
4964
|
-
), R = () => h || H ? he : pe != null && pe !== "" && Ce(pe) || "",
|
|
4984
|
+
), R = () => h || H ? he : pe != null && pe !== "" && Ce(pe) || "", L = () => {
|
|
4965
4985
|
var g;
|
|
4966
|
-
!H && !V &&
|
|
4986
|
+
!H && !V && K(!0);
|
|
4967
4987
|
const v = (g = Q.current) == null ? void 0 : g.querySelector("input");
|
|
4968
4988
|
v && v.focus();
|
|
4969
4989
|
}, z = (v) => {
|
|
4970
|
-
H ||
|
|
4990
|
+
H || K(!0), Ne(v);
|
|
4971
4991
|
}, d = (v) => {
|
|
4972
4992
|
var g, U;
|
|
4973
4993
|
if (!(V || v.disabled))
|
|
@@ -4988,18 +5008,18 @@ const is = ({
|
|
|
4988
5008
|
} else {
|
|
4989
5009
|
if (v.value === pe) {
|
|
4990
5010
|
if (X) {
|
|
4991
|
-
|
|
5011
|
+
K(!1), j(-1);
|
|
4992
5012
|
return;
|
|
4993
5013
|
}
|
|
4994
5014
|
ie.current.delete(v.value), t(null, v);
|
|
4995
5015
|
} else
|
|
4996
5016
|
ie.current.set(v.value, v.label), t(v.value, v);
|
|
4997
|
-
|
|
5017
|
+
K(!1), j(-1), J ? B == null || B("") : se(""), M == null || M();
|
|
4998
5018
|
}
|
|
4999
5019
|
}, D = (v) => {
|
|
5000
|
-
v.key === "ArrowDown" ? (v.preventDefault(), H ?
|
|
5020
|
+
v.key === "ArrowDown" ? (v.preventDefault(), H ? j(
|
|
5001
5021
|
(g) => g < ke.length - 1 ? g + 1 : g
|
|
5002
|
-
) : (
|
|
5022
|
+
) : (K(!0), j(0))) : v.key === "ArrowUp" ? (v.preventDefault(), j((g) => g > 0 ? g - 1 : g)) : v.key === "Enter" ? (v.preventDefault(), H && q >= 0 && q < ke.length && d(ke[q])) : v.key === "Escape" && (v.preventDefault(), K(!1), j(-1));
|
|
5003
5023
|
};
|
|
5004
5024
|
return /* @__PURE__ */ w(
|
|
5005
5025
|
"div",
|
|
@@ -5015,14 +5035,14 @@ const is = ({
|
|
|
5015
5035
|
/* @__PURE__ */ w(
|
|
5016
5036
|
"div",
|
|
5017
5037
|
{
|
|
5018
|
-
onClick:
|
|
5038
|
+
onClick: L,
|
|
5019
5039
|
className: y,
|
|
5020
5040
|
role: "combobox",
|
|
5021
5041
|
"aria-expanded": H,
|
|
5022
5042
|
"aria-haspopup": "listbox",
|
|
5023
5043
|
children: [
|
|
5024
5044
|
m && /* @__PURE__ */ n("div", { className: "ina-select-dropdown__trigger-prefix", children: m }),
|
|
5025
|
-
|
|
5045
|
+
O && !V ? /* @__PURE__ */ n(
|
|
5026
5046
|
"input",
|
|
5027
5047
|
{
|
|
5028
5048
|
type: "text",
|
|
@@ -5073,10 +5093,10 @@ const is = ({
|
|
|
5073
5093
|
style: {
|
|
5074
5094
|
// width is now 100% via CSS, but we can override if panelWidth is provided
|
|
5075
5095
|
width: I ? wt(I) : void 0,
|
|
5076
|
-
maxHeight: wt(
|
|
5096
|
+
maxHeight: wt(E)
|
|
5077
5097
|
},
|
|
5078
5098
|
children: [
|
|
5079
|
-
|
|
5099
|
+
G && Ie() !== null && /* @__PURE__ */ n("div", { className: "ina-select-dropdown__preview", children: Ie() }),
|
|
5080
5100
|
/* @__PURE__ */ w(
|
|
5081
5101
|
"div",
|
|
5082
5102
|
{
|
|
@@ -5084,7 +5104,7 @@ const is = ({
|
|
|
5084
5104
|
className: "ina-select-dropdown__options",
|
|
5085
5105
|
onScroll: (v) => {
|
|
5086
5106
|
const g = v.currentTarget;
|
|
5087
|
-
g.scrollHeight - g.scrollTop - g.clientHeight < 50 && !F &&
|
|
5107
|
+
g.scrollHeight - g.scrollTop - g.clientHeight < 50 && !F && A && k && !V && k(N + 1);
|
|
5088
5108
|
},
|
|
5089
5109
|
children: [
|
|
5090
5110
|
te && /* @__PURE__ */ n("div", { className: "ina-select-dropdown__selection-title", children: te }),
|
|
@@ -5207,7 +5227,7 @@ function ls({
|
|
|
5207
5227
|
), I = S(
|
|
5208
5228
|
"ina-drawer__footer",
|
|
5209
5229
|
t !== "top" && "ina-drawer__footer--hidden"
|
|
5210
|
-
),
|
|
5230
|
+
), E = S("ina-drawer__close-button"), A = S("ina-drawer__close-icon"), F = [
|
|
5211
5231
|
"sm",
|
|
5212
5232
|
"md",
|
|
5213
5233
|
"lg",
|
|
@@ -5226,7 +5246,7 @@ function ls({
|
|
|
5226
5246
|
height: t === "top" || t === "bottom" ? "60vh" : "100vh",
|
|
5227
5247
|
maxHeight: t === "top" || t === "bottom" ? "60vh" : "100vh"
|
|
5228
5248
|
};
|
|
5229
|
-
return
|
|
5249
|
+
return Lt(/* @__PURE__ */ w(
|
|
5230
5250
|
"div",
|
|
5231
5251
|
{
|
|
5232
5252
|
className: M,
|
|
@@ -5247,9 +5267,9 @@ function ls({
|
|
|
5247
5267
|
{
|
|
5248
5268
|
type: "button",
|
|
5249
5269
|
onClick: a,
|
|
5250
|
-
className:
|
|
5270
|
+
className: E,
|
|
5251
5271
|
"aria-label": c,
|
|
5252
|
-
children: /* @__PURE__ */ n(
|
|
5272
|
+
children: /* @__PURE__ */ n(Te, { className: A, size: 20 })
|
|
5253
5273
|
}
|
|
5254
5274
|
)
|
|
5255
5275
|
] }),
|
|
@@ -5259,9 +5279,9 @@ function ls({
|
|
|
5259
5279
|
{
|
|
5260
5280
|
type: "button",
|
|
5261
5281
|
onClick: a,
|
|
5262
|
-
className:
|
|
5282
|
+
className: E,
|
|
5263
5283
|
"aria-label": c,
|
|
5264
|
-
children: /* @__PURE__ */ n(
|
|
5284
|
+
children: /* @__PURE__ */ n(Te, { className: A, size: 20 })
|
|
5265
5285
|
}
|
|
5266
5286
|
) })
|
|
5267
5287
|
]
|
|
@@ -5340,7 +5360,7 @@ function cs({
|
|
|
5340
5360
|
] })
|
|
5341
5361
|
] });
|
|
5342
5362
|
}
|
|
5343
|
-
function
|
|
5363
|
+
function En({
|
|
5344
5364
|
value: e,
|
|
5345
5365
|
onChange: a,
|
|
5346
5366
|
onInput: t,
|
|
@@ -5356,41 +5376,41 @@ function An({
|
|
|
5356
5376
|
maxLength: m,
|
|
5357
5377
|
showCharCount: p = !1,
|
|
5358
5378
|
showClearButton: I = !0,
|
|
5359
|
-
onClear:
|
|
5360
|
-
placeholder:
|
|
5379
|
+
onClear: E,
|
|
5380
|
+
placeholder: A,
|
|
5361
5381
|
disabled: F = !1,
|
|
5362
5382
|
className: N = "",
|
|
5363
5383
|
securityConfig: k = Da,
|
|
5364
5384
|
onBlur: _,
|
|
5365
5385
|
...f
|
|
5366
5386
|
}) {
|
|
5367
|
-
const
|
|
5387
|
+
const T = () => k != null && k.enableXssProtection ? Xe(e).sanitized : e, [$, Y] = Z(T()), [B] = ht($, r), V = le(!0);
|
|
5368
5388
|
oe(() => {
|
|
5369
|
-
let
|
|
5389
|
+
let K = e;
|
|
5370
5390
|
if (k != null && k.enableXssProtection) {
|
|
5371
5391
|
const P = Xe(e);
|
|
5372
5392
|
P.isValid || (k.logViolations && console.warn(
|
|
5373
5393
|
"TextField security violation on value change:",
|
|
5374
5394
|
P.threats
|
|
5375
|
-
), k.onSecurityViolation && k.onSecurityViolation(P.threats, e),
|
|
5395
|
+
), k.onSecurityViolation && k.onSecurityViolation(P.threats, e), K = P.sanitized);
|
|
5376
5396
|
}
|
|
5377
|
-
K
|
|
5397
|
+
Y(K);
|
|
5378
5398
|
}, [e, k]), oe(() => {
|
|
5379
5399
|
V.current ? V.current = !1 : r > 0 && i && i(B);
|
|
5380
5400
|
}, [B, r, i]);
|
|
5381
|
-
const
|
|
5382
|
-
let P =
|
|
5401
|
+
const G = (K) => {
|
|
5402
|
+
let P = K.target.value;
|
|
5383
5403
|
if (!(m != null && P.length > m)) {
|
|
5384
5404
|
if (k != null && k.enableXssProtection) {
|
|
5385
5405
|
const se = Xe(P);
|
|
5386
5406
|
se.isValid || (k.logViolations && console.warn("TextField security violation:", se.threats), k.onSecurityViolation && k.onSecurityViolation(se.threats, P), P = se.sanitized);
|
|
5387
5407
|
}
|
|
5388
|
-
|
|
5408
|
+
Y(P), a(P), t == null || t(K);
|
|
5389
5409
|
}
|
|
5390
|
-
},
|
|
5391
|
-
_ == null || _(
|
|
5392
|
-
},
|
|
5393
|
-
|
|
5410
|
+
}, O = (K) => {
|
|
5411
|
+
_ == null || _(K);
|
|
5412
|
+
}, W = () => {
|
|
5413
|
+
Y(""), a(""), i && i(""), E == null || E();
|
|
5394
5414
|
}, ae = S(
|
|
5395
5415
|
"ina-text-field__wrapper",
|
|
5396
5416
|
`ina-text-field__wrapper--size-${M}`,
|
|
@@ -5422,9 +5442,9 @@ function An({
|
|
|
5422
5442
|
type: f.type ?? "text",
|
|
5423
5443
|
className: S("ina-text-field__input", N),
|
|
5424
5444
|
value: $,
|
|
5425
|
-
onChange:
|
|
5426
|
-
onBlur:
|
|
5427
|
-
placeholder:
|
|
5445
|
+
onChange: G,
|
|
5446
|
+
onBlur: O,
|
|
5447
|
+
placeholder: A,
|
|
5428
5448
|
disabled: F,
|
|
5429
5449
|
maxLength: m,
|
|
5430
5450
|
"aria-describedby": te ? H : void 0
|
|
@@ -5435,12 +5455,12 @@ function An({
|
|
|
5435
5455
|
{
|
|
5436
5456
|
type: "button",
|
|
5437
5457
|
className: "ina-text-field__clear-button",
|
|
5438
|
-
onClick:
|
|
5439
|
-
onKeyDown: (
|
|
5440
|
-
(
|
|
5458
|
+
onClick: W,
|
|
5459
|
+
onKeyDown: (K) => {
|
|
5460
|
+
(K.key === "Enter" || K.key === " ") && (K.preventDefault(), W());
|
|
5441
5461
|
},
|
|
5442
5462
|
"aria-label": "Hapus input",
|
|
5443
|
-
children: /* @__PURE__ */ n(
|
|
5463
|
+
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-text-field__clear-icon" })
|
|
5444
5464
|
}
|
|
5445
5465
|
),
|
|
5446
5466
|
l && /* @__PURE__ */ n("div", { className: "ina-text-field__suffix-icon", children: l })
|
|
@@ -5455,7 +5475,7 @@ function An({
|
|
|
5455
5475
|
] })
|
|
5456
5476
|
] });
|
|
5457
5477
|
}
|
|
5458
|
-
const
|
|
5478
|
+
const An = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
5459
5479
|
"svg",
|
|
5460
5480
|
{
|
|
5461
5481
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5513,52 +5533,52 @@ function ds({
|
|
|
5513
5533
|
onSelectionChange: m,
|
|
5514
5534
|
editableColumns: p = [],
|
|
5515
5535
|
onRowUpdate: I,
|
|
5516
|
-
rowKey:
|
|
5517
|
-
showSearch:
|
|
5536
|
+
rowKey: E = "id",
|
|
5537
|
+
showSearch: A = !1,
|
|
5518
5538
|
rowClickable: F = !1,
|
|
5519
5539
|
onRowClick: N,
|
|
5520
5540
|
lastColumnSticky: k = !1,
|
|
5521
5541
|
renderSortIndicator: _,
|
|
5522
5542
|
emptyState: f = "No data found",
|
|
5523
|
-
showPagination:
|
|
5543
|
+
showPagination: T = !0
|
|
5524
5544
|
}) {
|
|
5525
|
-
const [$,
|
|
5545
|
+
const [$, Y] = Z([]), [B, V] = Z(0), [G, O] = Z(!1), W = le(null), ae = ma(), [ue, te] = Z(t), [X, H] = Z(r), [K, P] = Z(s), [se, q] = Z(
|
|
5526
5546
|
l
|
|
5527
|
-
), [
|
|
5547
|
+
), [j, Q] = Z(""), [ee, ce] = Z(""), [_e, ie] = Z({}), J = Object.values(_e).every(Boolean), he = Object.values(_e).some(Boolean), [ve, fe] = Z({}), [pe, Ce] = Z(null), be = Math.ceil(B / X);
|
|
5528
5548
|
oe(() => {
|
|
5529
5549
|
const g = new AbortController(), U = g.signal;
|
|
5530
5550
|
async function re() {
|
|
5531
|
-
|
|
5551
|
+
O(!0);
|
|
5532
5552
|
try {
|
|
5533
5553
|
const de = await a({
|
|
5534
5554
|
page: ue,
|
|
5535
5555
|
pageSize: X,
|
|
5536
|
-
sortField:
|
|
5556
|
+
sortField: K,
|
|
5537
5557
|
sortOrder: se,
|
|
5538
|
-
searchTerm:
|
|
5558
|
+
searchTerm: j
|
|
5539
5559
|
});
|
|
5540
|
-
U.aborted || (
|
|
5560
|
+
U.aborted || (Y(de.data), V(de.total), ie({}), fe({}), Ce(null));
|
|
5541
5561
|
} catch (de) {
|
|
5542
5562
|
U.aborted || console.error(de);
|
|
5543
5563
|
} finally {
|
|
5544
|
-
U.aborted ||
|
|
5564
|
+
U.aborted || O(!1);
|
|
5545
5565
|
}
|
|
5546
5566
|
}
|
|
5547
5567
|
return re(), () => {
|
|
5548
5568
|
g.abort();
|
|
5549
5569
|
};
|
|
5550
|
-
}, [ue, X,
|
|
5570
|
+
}, [ue, X, K, se, j, a]), oe(() => {
|
|
5551
5571
|
te(t);
|
|
5552
5572
|
}, [t]);
|
|
5553
5573
|
const we = () => {
|
|
5554
5574
|
const g = !J, U = {};
|
|
5555
5575
|
$.forEach((re) => {
|
|
5556
|
-
U[re[
|
|
5576
|
+
U[re[E]] = g;
|
|
5557
5577
|
}), ie(U), m == null || m(g ? [...$] : []);
|
|
5558
5578
|
}, ke = (g) => {
|
|
5559
5579
|
ie((U) => {
|
|
5560
5580
|
const re = { ...U, [g]: !U[g] };
|
|
5561
|
-
return m == null || m($.filter((de) => re[de[
|
|
5581
|
+
return m == null || m($.filter((de) => re[de[E]]).map((de) => de)), re;
|
|
5562
5582
|
});
|
|
5563
5583
|
}, Ne = (g, U, re, de) => {
|
|
5564
5584
|
de.stopPropagation(), fe((ye) => ({
|
|
@@ -5576,19 +5596,19 @@ function ds({
|
|
|
5576
5596
|
return delete re[g], re;
|
|
5577
5597
|
}), Ce(null);
|
|
5578
5598
|
}, o = (g, U) => {
|
|
5579
|
-
g.sortable && (
|
|
5599
|
+
g.sortable && (K === g.accessor && se === U ? (P(null), q(null)) : (P(g.accessor), q(U)), te(1));
|
|
5580
5600
|
}, y = (g) => ce(g), C = (g) => {
|
|
5581
5601
|
g.key === "Enter" && (g.preventDefault(), te(1), Q(ee.trim()));
|
|
5582
5602
|
}, R = () => {
|
|
5583
5603
|
te(1), Q(ee.trim());
|
|
5584
|
-
},
|
|
5604
|
+
}, L = (g, U) => {
|
|
5585
5605
|
U.target.closest(
|
|
5586
5606
|
'button, [role="button"], .ina-button, [data-action]'
|
|
5587
5607
|
) || F && N && N(g);
|
|
5588
5608
|
};
|
|
5589
5609
|
oe(() => {
|
|
5590
5610
|
const g = (U) => {
|
|
5591
|
-
|
|
5611
|
+
W.current && !W.current.contains(U.target) && Ce(null);
|
|
5592
5612
|
};
|
|
5593
5613
|
return document.addEventListener("mousedown", g), () => {
|
|
5594
5614
|
document.removeEventListener("mousedown", g);
|
|
@@ -5598,35 +5618,35 @@ function ds({
|
|
|
5598
5618
|
"ina-table--sticky-last-column": k
|
|
5599
5619
|
}), d = S(
|
|
5600
5620
|
"ina-table__search",
|
|
5601
|
-
!
|
|
5621
|
+
!A && "ina-table__search--hidden"
|
|
5602
5622
|
), D = S(
|
|
5603
5623
|
"ina-table__container",
|
|
5604
|
-
|
|
5624
|
+
G && "ina-table--loading"
|
|
5605
5625
|
), x = S("ina-table__header"), v = S("ina-table__body");
|
|
5606
5626
|
return /* @__PURE__ */ w("div", { className: z, children: [
|
|
5607
|
-
|
|
5627
|
+
A && /* @__PURE__ */ n("div", { className: d, children: /* @__PURE__ */ w("div", { className: "ina-table__search-controls", children: [
|
|
5608
5628
|
/* @__PURE__ */ n(
|
|
5609
|
-
|
|
5629
|
+
En,
|
|
5610
5630
|
{
|
|
5611
5631
|
value: ee,
|
|
5612
5632
|
onChange: y,
|
|
5613
5633
|
onKeyDown: C,
|
|
5614
5634
|
placeholder: b,
|
|
5615
|
-
disabled:
|
|
5635
|
+
disabled: G
|
|
5616
5636
|
}
|
|
5617
5637
|
),
|
|
5618
|
-
/* @__PURE__ */ n(ct, { onClick: R, disabled:
|
|
5638
|
+
/* @__PURE__ */ n(ct, { onClick: R, disabled: G, children: h })
|
|
5619
5639
|
] }) }),
|
|
5620
5640
|
/* @__PURE__ */ n(
|
|
5621
5641
|
Nn,
|
|
5622
5642
|
{
|
|
5623
|
-
visible:
|
|
5624
|
-
loading:
|
|
5643
|
+
visible: G,
|
|
5644
|
+
loading: G,
|
|
5625
5645
|
variant: "primary",
|
|
5626
5646
|
className: "ina-table__progress-bar"
|
|
5627
5647
|
}
|
|
5628
5648
|
),
|
|
5629
|
-
/* @__PURE__ */ w("table", { ref:
|
|
5649
|
+
/* @__PURE__ */ w("table", { ref: W, className: D, children: [
|
|
5630
5650
|
/* @__PURE__ */ n("thead", { className: x, children: /* @__PURE__ */ w("tr", { children: [
|
|
5631
5651
|
M && /* @__PURE__ */ n("th", { className: "ina-table__header-cell", children: /* @__PURE__ */ n(
|
|
5632
5652
|
Wt,
|
|
@@ -5639,7 +5659,7 @@ function ds({
|
|
|
5639
5659
|
}
|
|
5640
5660
|
) }),
|
|
5641
5661
|
e.map((g, U) => {
|
|
5642
|
-
const re =
|
|
5662
|
+
const re = K === g.accessor;
|
|
5643
5663
|
return /* @__PURE__ */ n(
|
|
5644
5664
|
"th",
|
|
5645
5665
|
{
|
|
@@ -5670,7 +5690,7 @@ function ds({
|
|
|
5670
5690
|
role: "button",
|
|
5671
5691
|
"aria-label": `Urutkan ${g.header} menaik`,
|
|
5672
5692
|
children: /* @__PURE__ */ n(
|
|
5673
|
-
|
|
5693
|
+
An,
|
|
5674
5694
|
{
|
|
5675
5695
|
size: 16,
|
|
5676
5696
|
stroke: re && se === "asc" ? 3 : 2
|
|
@@ -5705,7 +5725,7 @@ function ds({
|
|
|
5705
5725
|
);
|
|
5706
5726
|
})
|
|
5707
5727
|
] }) }),
|
|
5708
|
-
/* @__PURE__ */ n("tbody", { className: v, children: !
|
|
5728
|
+
/* @__PURE__ */ n("tbody", { className: v, children: !G && $.length === 0 ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n(
|
|
5709
5729
|
"td",
|
|
5710
5730
|
{
|
|
5711
5731
|
colSpan: M ? e.length + 1 : e.length,
|
|
@@ -5713,16 +5733,16 @@ function ds({
|
|
|
5713
5733
|
children: f
|
|
5714
5734
|
}
|
|
5715
5735
|
) }) : $.map((g, U) => {
|
|
5716
|
-
const re = String(g[
|
|
5736
|
+
const re = String(g[E]);
|
|
5717
5737
|
return /* @__PURE__ */ w(
|
|
5718
5738
|
"tr",
|
|
5719
5739
|
{
|
|
5720
5740
|
className: S(
|
|
5721
5741
|
"ina-table__row",
|
|
5722
|
-
|
|
5742
|
+
G && "ina-table__row--loading",
|
|
5723
5743
|
F && "ina-table__row--clickable"
|
|
5724
5744
|
),
|
|
5725
|
-
onClick: (de) =>
|
|
5745
|
+
onClick: (de) => L(g, de),
|
|
5726
5746
|
children: [
|
|
5727
5747
|
M && /* @__PURE__ */ n("td", { className: "ina-table__cell", children: /* @__PURE__ */ n(
|
|
5728
5748
|
Wt,
|
|
@@ -5788,7 +5808,7 @@ function ds({
|
|
|
5788
5808
|
);
|
|
5789
5809
|
}) })
|
|
5790
5810
|
] }),
|
|
5791
|
-
|
|
5811
|
+
T && /* @__PURE__ */ n("div", { className: "ina-table__pagination", children: /* @__PURE__ */ n(
|
|
5792
5812
|
wn,
|
|
5793
5813
|
{
|
|
5794
5814
|
currentPage: ue,
|
|
@@ -5799,7 +5819,7 @@ function ds({
|
|
|
5799
5819
|
onPageSizeChange: (g) => {
|
|
5800
5820
|
H(g), te(1);
|
|
5801
5821
|
},
|
|
5802
|
-
disabled:
|
|
5822
|
+
disabled: G || B === 0,
|
|
5803
5823
|
fullWidth: !0
|
|
5804
5824
|
}
|
|
5805
5825
|
) })
|
|
@@ -5821,42 +5841,42 @@ function us({
|
|
|
5821
5841
|
showClearButton: m = !0,
|
|
5822
5842
|
minRows: p = 3,
|
|
5823
5843
|
maxRows: I,
|
|
5824
|
-
placeholder:
|
|
5825
|
-
disabled:
|
|
5844
|
+
placeholder: E,
|
|
5845
|
+
disabled: A = !1,
|
|
5826
5846
|
className: F = "",
|
|
5827
5847
|
securityConfig: N = Da,
|
|
5828
5848
|
onBlur: k,
|
|
5829
5849
|
..._
|
|
5830
5850
|
}) {
|
|
5831
|
-
const f = () => N != null && N.enableXssProtection ? Xe(e).sanitized : e, [
|
|
5851
|
+
const f = () => N != null && N.enableXssProtection ? Xe(e).sanitized : e, [T, $] = Z(f()), [Y] = ht(T, t), B = le(!0), V = le(null), [G, O] = Z(p);
|
|
5832
5852
|
oe(() => {
|
|
5833
5853
|
let q = e;
|
|
5834
5854
|
if (N != null && N.enableXssProtection) {
|
|
5835
|
-
const
|
|
5836
|
-
|
|
5855
|
+
const j = Xe(e);
|
|
5856
|
+
j.isValid || (N.logViolations && console.warn(
|
|
5837
5857
|
"TextArea security violation on value change:",
|
|
5838
|
-
|
|
5839
|
-
), N.onSecurityViolation && N.onSecurityViolation(
|
|
5858
|
+
j.threats
|
|
5859
|
+
), N.onSecurityViolation && N.onSecurityViolation(j.threats, e), q = j.sanitized);
|
|
5840
5860
|
}
|
|
5841
5861
|
$(q);
|
|
5842
5862
|
}, [e, N]), oe(() => {
|
|
5843
|
-
B.current ? B.current = !1 : t > 0 && r && r(
|
|
5844
|
-
}, [
|
|
5863
|
+
B.current ? B.current = !1 : t > 0 && r && r(Y);
|
|
5864
|
+
}, [Y, t, r]), oe(() => {
|
|
5845
5865
|
const q = V.current;
|
|
5846
5866
|
if (!q) return;
|
|
5847
5867
|
q.rows = p;
|
|
5848
|
-
const
|
|
5849
|
-
let ee = Math.floor(Q /
|
|
5850
|
-
I && (ee = Math.min(ee, I)),
|
|
5851
|
-
}, [
|
|
5852
|
-
const
|
|
5853
|
-
let
|
|
5854
|
-
if (!(u != null &&
|
|
5868
|
+
const j = parseInt(getComputedStyle(q).lineHeight || "0", 10), Q = q.scrollHeight;
|
|
5869
|
+
let ee = Math.floor(Q / j);
|
|
5870
|
+
I && (ee = Math.min(ee, I)), O(Math.max(ee, p));
|
|
5871
|
+
}, [T, p, I]);
|
|
5872
|
+
const W = (q) => {
|
|
5873
|
+
let j = q.target.value;
|
|
5874
|
+
if (!(u != null && j.length > u)) {
|
|
5855
5875
|
if (N != null && N.enableXssProtection) {
|
|
5856
|
-
const Q = Xe(
|
|
5857
|
-
Q.isValid || (N.logViolations && console.warn("TextArea security violation:", Q.threats), N.onSecurityViolation && N.onSecurityViolation(Q.threats,
|
|
5876
|
+
const Q = Xe(j);
|
|
5877
|
+
Q.isValid || (N.logViolations && console.warn("TextArea security violation:", Q.threats), N.onSecurityViolation && N.onSecurityViolation(Q.threats, j), j = Q.sanitized);
|
|
5858
5878
|
}
|
|
5859
|
-
$(
|
|
5879
|
+
$(j), a(j);
|
|
5860
5880
|
}
|
|
5861
5881
|
}, ae = (q) => {
|
|
5862
5882
|
k == null || k(q);
|
|
@@ -5865,11 +5885,11 @@ function us({
|
|
|
5865
5885
|
}, te = S("ina-text-area", F), X = S(
|
|
5866
5886
|
"ina-text-area__wrapper",
|
|
5867
5887
|
`ina-text-area__wrapper--status-${b}`,
|
|
5868
|
-
|
|
5888
|
+
A && "ina-text-area__wrapper--disabled"
|
|
5869
5889
|
), H = S(
|
|
5870
5890
|
"ina-text-area__helper-text",
|
|
5871
5891
|
`ina-text-area__helper-text--${b}`
|
|
5872
|
-
),
|
|
5892
|
+
), K = b !== "neutral" && h != null ? h : c, P = (_ == null ? void 0 : _.id) || (_ == null ? void 0 : _.name) || String(l).toLowerCase(), se = `${P}-status`;
|
|
5873
5893
|
return /* @__PURE__ */ w("div", { className: te, children: [
|
|
5874
5894
|
l && /* @__PURE__ */ w(
|
|
5875
5895
|
"label",
|
|
@@ -5890,18 +5910,18 @@ function us({
|
|
|
5890
5910
|
..._,
|
|
5891
5911
|
id: String(P),
|
|
5892
5912
|
ref: V,
|
|
5893
|
-
rows:
|
|
5913
|
+
rows: G,
|
|
5894
5914
|
className: "ina-text-area__input",
|
|
5895
|
-
value:
|
|
5896
|
-
onChange:
|
|
5915
|
+
value: T,
|
|
5916
|
+
onChange: W,
|
|
5897
5917
|
onBlur: ae,
|
|
5898
|
-
placeholder:
|
|
5899
|
-
disabled:
|
|
5918
|
+
placeholder: E,
|
|
5919
|
+
disabled: A,
|
|
5900
5920
|
maxLength: u,
|
|
5901
|
-
"aria-describedby":
|
|
5921
|
+
"aria-describedby": K ? se : void 0
|
|
5902
5922
|
}
|
|
5903
5923
|
),
|
|
5904
|
-
m &&
|
|
5924
|
+
m && T !== "" && !A && /* @__PURE__ */ n(
|
|
5905
5925
|
"button",
|
|
5906
5926
|
{
|
|
5907
5927
|
type: "button",
|
|
@@ -5911,14 +5931,14 @@ function us({
|
|
|
5911
5931
|
(q.key === "Enter" || q.key === " ") && (q.preventDefault(), ue());
|
|
5912
5932
|
},
|
|
5913
5933
|
"aria-label": "Hapus input",
|
|
5914
|
-
children: /* @__PURE__ */ n(
|
|
5934
|
+
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-text-area__clear-icon" })
|
|
5915
5935
|
}
|
|
5916
5936
|
),
|
|
5917
5937
|
s && /* @__PURE__ */ n("div", { className: "ina-text-area__suffix-icon", children: s })
|
|
5918
5938
|
] }),
|
|
5919
|
-
|
|
5939
|
+
K && /* @__PURE__ */ n("div", { id: se, className: H, children: K }),
|
|
5920
5940
|
M && u != null && /* @__PURE__ */ w("div", { className: "ina-text-area__char-count", children: [
|
|
5921
|
-
|
|
5941
|
+
T.length,
|
|
5922
5942
|
"/",
|
|
5923
5943
|
u
|
|
5924
5944
|
] })
|
|
@@ -5958,8 +5978,8 @@ function fs({
|
|
|
5958
5978
|
return;
|
|
5959
5979
|
const f = e.split("");
|
|
5960
5980
|
f[N] = _;
|
|
5961
|
-
const
|
|
5962
|
-
if (a(
|
|
5981
|
+
const T = f.join("").slice(0, t);
|
|
5982
|
+
if (a(T), _ && N < t - 1) {
|
|
5963
5983
|
const $ = N + 1;
|
|
5964
5984
|
m.current[$] && m.current[$].focus();
|
|
5965
5985
|
}
|
|
@@ -5970,24 +5990,24 @@ function fs({
|
|
|
5970
5990
|
const $ = N - 1;
|
|
5971
5991
|
if (m.current[$]) {
|
|
5972
5992
|
m.current[$].focus();
|
|
5973
|
-
const
|
|
5974
|
-
|
|
5993
|
+
const Y = e.split("");
|
|
5994
|
+
Y[$] = "", a(Y.join(""));
|
|
5975
5995
|
}
|
|
5976
5996
|
} else {
|
|
5977
5997
|
const $ = e.split("");
|
|
5978
5998
|
$[N] = "", a($.join(""));
|
|
5979
5999
|
}
|
|
5980
|
-
k.key === "ArrowLeft" && N > 0 && (k.preventDefault(), (_ = m.current[N - 1]) == null || _.focus()), k.key === "ArrowRight" && N < t - 1 && (k.preventDefault(), (f = m.current[N + 1]) == null || f.focus()), (k.ctrlKey || k.metaKey) && k.key === "v" && (k.preventDefault(), navigator.clipboard.readText().then((
|
|
5981
|
-
const $ =
|
|
6000
|
+
k.key === "ArrowLeft" && N > 0 && (k.preventDefault(), (_ = m.current[N - 1]) == null || _.focus()), k.key === "ArrowRight" && N < t - 1 && (k.preventDefault(), (f = m.current[N + 1]) == null || f.focus()), (k.ctrlKey || k.metaKey) && k.key === "v" && (k.preventDefault(), navigator.clipboard.readText().then((T) => {
|
|
6001
|
+
const $ = T.replace(/\D/g, "").slice(0, t);
|
|
5982
6002
|
if ($) {
|
|
5983
6003
|
a($);
|
|
5984
|
-
const
|
|
5985
|
-
m.current[
|
|
6004
|
+
const Y = Math.min($.length - 1, t - 1);
|
|
6005
|
+
m.current[Y] && m.current[Y].focus();
|
|
5986
6006
|
}
|
|
5987
6007
|
}));
|
|
5988
|
-
},
|
|
6008
|
+
}, E = (N) => {
|
|
5989
6009
|
m.current[N] && m.current[N].select();
|
|
5990
|
-
},
|
|
6010
|
+
}, A = () => {
|
|
5991
6011
|
}, F = (N) => {
|
|
5992
6012
|
N.preventDefault();
|
|
5993
6013
|
const _ = N.clipboardData.getData("text").replace(/\D/g, "").slice(0, t);
|
|
@@ -6016,8 +6036,8 @@ function fs({
|
|
|
6016
6036
|
value: _,
|
|
6017
6037
|
onChange: (f) => p(k, f),
|
|
6018
6038
|
onKeyDown: (f) => I(k, f),
|
|
6019
|
-
onFocus: () =>
|
|
6020
|
-
onBlur:
|
|
6039
|
+
onFocus: () => E(k),
|
|
6040
|
+
onBlur: A,
|
|
6021
6041
|
onPaste: F,
|
|
6022
6042
|
disabled: c,
|
|
6023
6043
|
readOnly: b,
|
|
@@ -6061,7 +6081,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6061
6081
|
/* @__PURE__ */ n("path", { d: "M12 7v5l3 3" })
|
|
6062
6082
|
]
|
|
6063
6083
|
}
|
|
6064
|
-
),
|
|
6084
|
+
), Tn = ha(
|
|
6065
6085
|
({
|
|
6066
6086
|
defaultValue: e = "",
|
|
6067
6087
|
disabled: a = !1,
|
|
@@ -6078,20 +6098,20 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6078
6098
|
className: m = "",
|
|
6079
6099
|
use12Hours: p = !1,
|
|
6080
6100
|
showSecond: I = !1,
|
|
6081
|
-
allowClear:
|
|
6082
|
-
prefixIcon:
|
|
6101
|
+
allowClear: E = !0,
|
|
6102
|
+
prefixIcon: A,
|
|
6083
6103
|
suffixIcon: F,
|
|
6084
6104
|
disabledBackTime: N = !1,
|
|
6085
6105
|
disabledTimeBefore: k,
|
|
6086
6106
|
disabledTimeAfter: _,
|
|
6087
6107
|
showNowButton: f = !1,
|
|
6088
|
-
label:
|
|
6108
|
+
label: T,
|
|
6089
6109
|
required: $,
|
|
6090
|
-
...
|
|
6110
|
+
...Y
|
|
6091
6111
|
}, B) => {
|
|
6092
|
-
const [V,
|
|
6112
|
+
const [V, G] = Z(!1), [O, W] = Z(
|
|
6093
6113
|
e || h || ""
|
|
6094
|
-
), [ae, ue] = Z(null), [te, X] = Z(null), [H,
|
|
6114
|
+
), [ae, ue] = Z(null), [te, X] = Z(null), [H, K] = Z(!1), P = le(null), se = le(null), q = le(null);
|
|
6095
6115
|
va(B, () => ({
|
|
6096
6116
|
focus: () => {
|
|
6097
6117
|
var o;
|
|
@@ -6102,18 +6122,18 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6102
6122
|
return (o = se.current) == null ? void 0 : o.blur();
|
|
6103
6123
|
}
|
|
6104
6124
|
}));
|
|
6105
|
-
const
|
|
6125
|
+
const j = (o) => {
|
|
6106
6126
|
if (!o) return { hours: 0, minutes: 0, seconds: 0, period: "AM" };
|
|
6107
|
-
const y = o.split(":"), C = y[0], R = parseInt(y[1] || "0", 10),
|
|
6127
|
+
const y = o.split(":"), C = y[0], R = parseInt(y[1] || "0", 10), L = parseInt(y[2] || "0", 10);
|
|
6108
6128
|
if (p) {
|
|
6109
6129
|
const z = o.includes("AM") ? "AM" : "PM", d = parseInt(C.replace(/[^\d]/g, ""), 10);
|
|
6110
|
-
return { hours: d === 12 ? 0 : d, minutes: R, seconds:
|
|
6130
|
+
return { hours: d === 12 ? 0 : d, minutes: R, seconds: L, period: z };
|
|
6111
6131
|
} else
|
|
6112
|
-
return { hours: parseInt(C, 10), minutes: R, seconds:
|
|
6132
|
+
return { hours: parseInt(C, 10), minutes: R, seconds: L, period: "AM" };
|
|
6113
6133
|
}, Q = (o, y, C, R) => {
|
|
6114
|
-
let
|
|
6115
|
-
p && (R === "PM" && o > 0 && (
|
|
6116
|
-
const z =
|
|
6134
|
+
let L = o;
|
|
6135
|
+
p && (R === "PM" && o > 0 && (L = o + 12), L = L || 12);
|
|
6136
|
+
const z = L.toString().padStart(2, "0"), d = y.toString().padStart(2, "0");
|
|
6117
6137
|
if (I) {
|
|
6118
6138
|
const D = C.toString().padStart(2, "0");
|
|
6119
6139
|
return p ? `${o}:${d}:${D} ${R}` : `${z}:${d}:${D}`;
|
|
@@ -6123,24 +6143,24 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6123
6143
|
if (!o) return 0;
|
|
6124
6144
|
const y = o.split(":"), C = parseInt(y[0] || "0", 10), R = parseInt(y[1] || "0", 10);
|
|
6125
6145
|
if (p && o.includes(" ")) {
|
|
6126
|
-
const
|
|
6146
|
+
const L = o.split(" ")[1];
|
|
6127
6147
|
let z = C;
|
|
6128
|
-
return
|
|
6148
|
+
return L === "PM" && C !== 12 ? z = C + 12 : L === "AM" && C === 12 && (z = 0), z * 60 + R;
|
|
6129
6149
|
}
|
|
6130
6150
|
return C * 60 + R;
|
|
6131
|
-
}, ce = (o, y, C, R,
|
|
6151
|
+
}, ce = (o, y, C, R, L = {}) => {
|
|
6132
6152
|
const z = Q(o, y, C, R), d = ee(z);
|
|
6133
|
-
if (N && !
|
|
6153
|
+
if (N && !L.ignoreBefore) {
|
|
6134
6154
|
const D = /* @__PURE__ */ new Date(), x = D.getHours() * 60 + D.getMinutes();
|
|
6135
6155
|
if (d < x)
|
|
6136
6156
|
return !0;
|
|
6137
6157
|
}
|
|
6138
|
-
if (k && !
|
|
6158
|
+
if (k && !L.ignoreBefore) {
|
|
6139
6159
|
const D = ee(k);
|
|
6140
6160
|
if (d < D)
|
|
6141
6161
|
return !0;
|
|
6142
6162
|
}
|
|
6143
|
-
if (_ && !
|
|
6163
|
+
if (_ && !L.ignoreAfter) {
|
|
6144
6164
|
const D = ee(_);
|
|
6145
6165
|
if (d > D)
|
|
6146
6166
|
return !0;
|
|
@@ -6163,17 +6183,17 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6163
6183
|
break;
|
|
6164
6184
|
}
|
|
6165
6185
|
return y;
|
|
6166
|
-
}, ie =
|
|
6167
|
-
a || V || (
|
|
6186
|
+
}, ie = j(O || ""), J = _e("hour"), he = _e("minute"), ve = _e("second"), fe = () => {
|
|
6187
|
+
a || V || (G(!0), K(!0), M == null || M(!0), setTimeout(() => {
|
|
6168
6188
|
var o;
|
|
6169
6189
|
return (o = se.current) == null ? void 0 : o.focus();
|
|
6170
6190
|
}, 0));
|
|
6171
6191
|
}, pe = () => {
|
|
6172
|
-
|
|
6192
|
+
G(!1), K(!1), ue(null), X(null), M == null || M(!1);
|
|
6173
6193
|
}, Ce = () => {
|
|
6174
6194
|
a || (V ? pe() : fe());
|
|
6175
6195
|
}, be = (o, y) => {
|
|
6176
|
-
let C = ie.hours, R = ie.minutes,
|
|
6196
|
+
let C = ie.hours, R = ie.minutes, L = ie.seconds, z = ie.period;
|
|
6177
6197
|
switch (o) {
|
|
6178
6198
|
case "hour":
|
|
6179
6199
|
C = p && y === 12 ? 0 : y;
|
|
@@ -6182,7 +6202,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6182
6202
|
R = y;
|
|
6183
6203
|
break;
|
|
6184
6204
|
case "second":
|
|
6185
|
-
|
|
6205
|
+
L = y;
|
|
6186
6206
|
break;
|
|
6187
6207
|
case "period":
|
|
6188
6208
|
z = y;
|
|
@@ -6191,26 +6211,26 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6191
6211
|
const d = Q(
|
|
6192
6212
|
C,
|
|
6193
6213
|
R,
|
|
6194
|
-
|
|
6214
|
+
L,
|
|
6195
6215
|
p ? z : void 0
|
|
6196
6216
|
);
|
|
6197
|
-
|
|
6217
|
+
W(d), u == null || u(d);
|
|
6198
6218
|
}, we = (o) => {
|
|
6199
6219
|
let y = o.target.value;
|
|
6200
6220
|
const C = p ? /[0-9: apm]/gi : /[0-9:]/g;
|
|
6201
6221
|
y = (y.match(C) || []).join("");
|
|
6202
|
-
let R = y.replace(/[^0-9]/g, ""),
|
|
6203
|
-
if (R.length > 0 && (
|
|
6222
|
+
let R = y.replace(/[^0-9]/g, ""), L = "";
|
|
6223
|
+
if (R.length > 0 && (L += R.slice(0, 2), R.length > 2 && (L += ":" + R.slice(2, 4), I && R.length > 4 && (L += ":" + R.slice(4, 6)))), p) {
|
|
6204
6224
|
const d = y.match(/(am|pm)/i);
|
|
6205
|
-
d ?
|
|
6225
|
+
d ? L += " " + d[0].toUpperCase() : y.includes(" ") && (L += " ");
|
|
6206
6226
|
}
|
|
6207
6227
|
let z = 5;
|
|
6208
|
-
I && (z = 8), p && (z += 3),
|
|
6228
|
+
I && (z = 8), p && (z += 3), L = L.slice(0, z), o.target.value = L, W(L), u == null || u(L);
|
|
6209
6229
|
}, ke = () => {
|
|
6210
|
-
|
|
6230
|
+
W(""), u == null || u("");
|
|
6211
6231
|
};
|
|
6212
6232
|
oe(() => {
|
|
6213
|
-
h !== void 0 && h !==
|
|
6233
|
+
h !== void 0 && h !== O && W(h);
|
|
6214
6234
|
}, [h]), oe(() => {
|
|
6215
6235
|
const o = (y) => {
|
|
6216
6236
|
P.current && !P.current.contains(y.target) && pe();
|
|
@@ -6234,7 +6254,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6234
6254
|
ue(null), X(null);
|
|
6235
6255
|
},
|
|
6236
6256
|
children: y.map((R) => {
|
|
6237
|
-
let
|
|
6257
|
+
let L = !1;
|
|
6238
6258
|
if (o === "hour") {
|
|
6239
6259
|
const D = p && R === 12 ? 0 : R, x = ce(
|
|
6240
6260
|
D,
|
|
@@ -6249,18 +6269,18 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6249
6269
|
p ? ie.period : void 0,
|
|
6250
6270
|
{ ignoreBefore: !0 }
|
|
6251
6271
|
);
|
|
6252
|
-
|
|
6253
|
-
} else o === "minute" ?
|
|
6272
|
+
L = x || v;
|
|
6273
|
+
} else o === "minute" ? L = ce(
|
|
6254
6274
|
ie.hours,
|
|
6255
6275
|
R,
|
|
6256
6276
|
ie.seconds,
|
|
6257
6277
|
p ? ie.period : void 0
|
|
6258
|
-
) : o === "second" ?
|
|
6278
|
+
) : o === "second" ? L = ce(
|
|
6259
6279
|
ie.hours,
|
|
6260
6280
|
ie.minutes,
|
|
6261
6281
|
R,
|
|
6262
6282
|
p ? ie.period : void 0
|
|
6263
|
-
) : o === "period" && (
|
|
6283
|
+
) : o === "period" && (L = ce(
|
|
6264
6284
|
ie.hours,
|
|
6265
6285
|
ie.minutes,
|
|
6266
6286
|
ie.seconds,
|
|
@@ -6277,11 +6297,11 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6277
6297
|
"ina-time-picker__option",
|
|
6278
6298
|
z && "ina-time-picker__option--selected",
|
|
6279
6299
|
te === R && "ina-time-picker__option--hovered",
|
|
6280
|
-
|
|
6300
|
+
L && "ina-time-picker__option--disabled"
|
|
6281
6301
|
),
|
|
6282
|
-
onClick: () => !
|
|
6302
|
+
onClick: () => !L && be(o, R),
|
|
6283
6303
|
onKeyDown: (D) => {
|
|
6284
|
-
if (!
|
|
6304
|
+
if (!L) {
|
|
6285
6305
|
if (D.key === "Enter" || D.key === " ")
|
|
6286
6306
|
D.preventDefault(), be(o, R);
|
|
6287
6307
|
else if (D.key === "ArrowDown") {
|
|
@@ -6296,7 +6316,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6296
6316
|
}
|
|
6297
6317
|
},
|
|
6298
6318
|
onMouseEnter: () => {
|
|
6299
|
-
|
|
6319
|
+
L || (ue(o), X(R));
|
|
6300
6320
|
},
|
|
6301
6321
|
children: R.toString().padStart(2, "0")
|
|
6302
6322
|
},
|
|
@@ -6317,11 +6337,11 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6317
6337
|
"ina-time-picker__input",
|
|
6318
6338
|
`ina-time-picker__input--size-${c}`,
|
|
6319
6339
|
"ina-time-picker__input--with-prefix",
|
|
6320
|
-
(F ||
|
|
6340
|
+
(F || E) && "ina-time-picker__input--with-suffix"
|
|
6321
6341
|
);
|
|
6322
6342
|
return /* @__PURE__ */ w("div", { ref: P, className: Ve, children: [
|
|
6323
|
-
|
|
6324
|
-
|
|
6343
|
+
T && /* @__PURE__ */ w("label", { className: "ina-time-picker__label", children: [
|
|
6344
|
+
T,
|
|
6325
6345
|
$ && /* @__PURE__ */ n("span", { className: "ina-time-picker__required", children: "*" })
|
|
6326
6346
|
] }),
|
|
6327
6347
|
/* @__PURE__ */ w(
|
|
@@ -6340,30 +6360,30 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6340
6360
|
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), Ce());
|
|
6341
6361
|
},
|
|
6342
6362
|
children: [
|
|
6343
|
-
/* @__PURE__ */ n("div", { className: "ina-time-picker__prefix-icon", children:
|
|
6363
|
+
/* @__PURE__ */ n("div", { className: "ina-time-picker__prefix-icon", children: A || /* @__PURE__ */ n(Vn, { size: 16 }) }),
|
|
6344
6364
|
/* @__PURE__ */ n(
|
|
6345
6365
|
"input",
|
|
6346
6366
|
{
|
|
6347
6367
|
ref: se,
|
|
6348
6368
|
type: "text",
|
|
6349
6369
|
className: Ie,
|
|
6350
|
-
value:
|
|
6370
|
+
value: O,
|
|
6351
6371
|
onChange: we,
|
|
6352
6372
|
onClick: (o) => {
|
|
6353
6373
|
o.stopPropagation(), fe();
|
|
6354
6374
|
},
|
|
6355
6375
|
onFocus: () => {
|
|
6356
|
-
H || fe(),
|
|
6376
|
+
H || fe(), K(!1);
|
|
6357
6377
|
},
|
|
6358
6378
|
placeholder: l,
|
|
6359
6379
|
disabled: a,
|
|
6360
6380
|
onKeyDown: (o) => {
|
|
6361
|
-
o.key === "Enter" ? (o.preventDefault(),
|
|
6381
|
+
o.key === "Enter" ? (o.preventDefault(), O ? pe() : Ce()) : o.key === "Escape" && V && pe();
|
|
6362
6382
|
},
|
|
6363
|
-
...
|
|
6383
|
+
...Y
|
|
6364
6384
|
}
|
|
6365
6385
|
),
|
|
6366
|
-
|
|
6386
|
+
E && O && !a && /* @__PURE__ */ n(
|
|
6367
6387
|
"button",
|
|
6368
6388
|
{
|
|
6369
6389
|
type: "button",
|
|
@@ -6375,7 +6395,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6375
6395
|
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), ke());
|
|
6376
6396
|
},
|
|
6377
6397
|
"aria-label": "Hapus waktu",
|
|
6378
|
-
children: /* @__PURE__ */ n(
|
|
6398
|
+
children: /* @__PURE__ */ n(Te, { size: 16 })
|
|
6379
6399
|
}
|
|
6380
6400
|
),
|
|
6381
6401
|
F && /* @__PURE__ */ n(
|
|
@@ -6383,7 +6403,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6383
6403
|
{
|
|
6384
6404
|
className: "ina-time-picker__suffix-icon",
|
|
6385
6405
|
style: {
|
|
6386
|
-
visibility:
|
|
6406
|
+
visibility: E && O && !a ? "hidden" : "visible"
|
|
6387
6407
|
},
|
|
6388
6408
|
children: F
|
|
6389
6409
|
}
|
|
@@ -6453,7 +6473,7 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6453
6473
|
I ? o.getSeconds() : 0,
|
|
6454
6474
|
o.getHours() >= 12 ? "PM" : "AM"
|
|
6455
6475
|
) : y;
|
|
6456
|
-
|
|
6476
|
+
W(R), u == null || u(R), pe();
|
|
6457
6477
|
},
|
|
6458
6478
|
children: "Sekarang"
|
|
6459
6479
|
}
|
|
@@ -6472,8 +6492,8 @@ const Vn = ({ size: e = 24, stroke: a = 2, ...t }) => /* @__PURE__ */ w(
|
|
|
6472
6492
|
] });
|
|
6473
6493
|
}
|
|
6474
6494
|
);
|
|
6475
|
-
|
|
6476
|
-
const
|
|
6495
|
+
Tn.displayName = "TimePicker";
|
|
6496
|
+
const Ln = {
|
|
6477
6497
|
default: /* @__PURE__ */ n(wa, { size: 20 }),
|
|
6478
6498
|
destructive: /* @__PURE__ */ n(ka, { size: 20 }),
|
|
6479
6499
|
positive: /* @__PURE__ */ n(Dt, { size: 20 })
|
|
@@ -6504,7 +6524,7 @@ function $n({
|
|
|
6504
6524
|
position: b = "top-right",
|
|
6505
6525
|
className: h = ""
|
|
6506
6526
|
}) {
|
|
6507
|
-
const [u, M] = Z(!1), [m, p] = Z(!1), [I,
|
|
6527
|
+
const [u, M] = Z(!1), [m, p] = Z(!1), [I, E] = Z(!1), A = le(), F = le(null), N = Ln[s];
|
|
6508
6528
|
oe(() => {
|
|
6509
6529
|
M(!0);
|
|
6510
6530
|
}, []), oe(() => {
|
|
@@ -6514,10 +6534,10 @@ function $n({
|
|
|
6514
6534
|
};
|
|
6515
6535
|
}, [u, b]), oe(() => {
|
|
6516
6536
|
if (u)
|
|
6517
|
-
return e && (p(!0), requestAnimationFrame(() =>
|
|
6537
|
+
return e && (p(!0), requestAnimationFrame(() => E(!0)), A.current = setTimeout(() => k(), c)), () => clearTimeout(A.current);
|
|
6518
6538
|
}, [e, c, u]);
|
|
6519
6539
|
function k() {
|
|
6520
|
-
|
|
6540
|
+
E(!1), setTimeout(() => {
|
|
6521
6541
|
p(!1), a(), F.current && Zt(F.current);
|
|
6522
6542
|
}, 300);
|
|
6523
6543
|
}
|
|
@@ -6529,7 +6549,7 @@ function $n({
|
|
|
6529
6549
|
`ina-toast--${I ? "visible" : "hidden"}`,
|
|
6530
6550
|
h
|
|
6531
6551
|
);
|
|
6532
|
-
return
|
|
6552
|
+
return Lt(/* @__PURE__ */ n("div", { className: "ina-toast-item", children: /* @__PURE__ */ w("div", { className: _, children: [
|
|
6533
6553
|
/* @__PURE__ */ n("div", { className: "ina-toast__icon", children: N }),
|
|
6534
6554
|
/* @__PURE__ */ w("div", { className: "ina-toast__content", children: [
|
|
6535
6555
|
/* @__PURE__ */ w("div", { className: "ina-toast__text-area", children: [
|
|
@@ -6544,7 +6564,7 @@ function $n({
|
|
|
6544
6564
|
onClick: k,
|
|
6545
6565
|
className: "ina-toast__close-button",
|
|
6546
6566
|
"aria-label": "Tutup notifikasi",
|
|
6547
|
-
children: /* @__PURE__ */ n(
|
|
6567
|
+
children: /* @__PURE__ */ n(Te, { size: 16, strokeWidth: 2, className: "ina-toast__close-icon" })
|
|
6548
6568
|
}
|
|
6549
6569
|
)
|
|
6550
6570
|
] }) }), F.current);
|
|
@@ -6565,9 +6585,9 @@ function ps({
|
|
|
6565
6585
|
}) {
|
|
6566
6586
|
const [m, p] = Z(!1), I = () => {
|
|
6567
6587
|
p(!0), b && b();
|
|
6568
|
-
}, A = () => {
|
|
6569
|
-
p(!0), h && h();
|
|
6570
6588
|
}, E = () => {
|
|
6589
|
+
p(!0), h && h();
|
|
6590
|
+
}, A = () => {
|
|
6571
6591
|
m && p(!1);
|
|
6572
6592
|
}, F = S(
|
|
6573
6593
|
"ina-tooltip",
|
|
@@ -6583,7 +6603,7 @@ function ps({
|
|
|
6583
6603
|
"ina-tooltip--variant-dark": s === "dark",
|
|
6584
6604
|
"ina-tooltip--variant-media": s === "media"
|
|
6585
6605
|
});
|
|
6586
|
-
return /* @__PURE__ */ w("div", { className: F, onMouseEnter:
|
|
6606
|
+
return /* @__PURE__ */ w("div", { className: F, onMouseEnter: A, children: [
|
|
6587
6607
|
i,
|
|
6588
6608
|
/* @__PURE__ */ n("div", { className: N, role: "tooltip", children: u && r ? r : s === "basic" ? /* @__PURE__ */ n("div", { className: "ina-tooltip__bubble ina-tooltip__bubble--basic", children: e }) : /* @__PURE__ */ w("div", { className: `ina-tooltip__card ina-tooltip__card--${s}`, children: [
|
|
6589
6609
|
b && /* @__PURE__ */ n(
|
|
@@ -6640,7 +6660,7 @@ function ps({
|
|
|
6640
6660
|
type: "button",
|
|
6641
6661
|
className: "ina-tooltip__action ina-tooltip__action--next",
|
|
6642
6662
|
onClick: (_) => {
|
|
6643
|
-
_.stopPropagation(),
|
|
6663
|
+
_.stopPropagation(), E();
|
|
6644
6664
|
},
|
|
6645
6665
|
children: "Lanjut"
|
|
6646
6666
|
}
|
|
@@ -6734,9 +6754,9 @@ function ms({
|
|
|
6734
6754
|
)
|
|
6735
6755
|
] });
|
|
6736
6756
|
}
|
|
6737
|
-
const
|
|
6757
|
+
const Ea = Tt({
|
|
6738
6758
|
confirm: () => Promise.resolve(!1)
|
|
6739
|
-
}), hs = () => Vt(
|
|
6759
|
+
}), hs = () => Vt(Ea), Bn = (e, a, t, r, i) => /* @__PURE__ */ w("div", { className: "ina-modal-confirmation__footer", children: [
|
|
6740
6760
|
/* @__PURE__ */ n(
|
|
6741
6761
|
ct,
|
|
6742
6762
|
{
|
|
@@ -6781,7 +6801,7 @@ const Aa = Lt({
|
|
|
6781
6801
|
))
|
|
6782
6802
|
}), i({ resolve: b });
|
|
6783
6803
|
});
|
|
6784
|
-
return /* @__PURE__ */ w(
|
|
6804
|
+
return /* @__PURE__ */ w(Ea.Provider, { value: { confirm: l }, children: [
|
|
6785
6805
|
e,
|
|
6786
6806
|
a && /* @__PURE__ */ n(
|
|
6787
6807
|
yn,
|
|
@@ -6798,17 +6818,17 @@ const Aa = Lt({
|
|
|
6798
6818
|
}
|
|
6799
6819
|
)
|
|
6800
6820
|
] });
|
|
6801
|
-
},
|
|
6821
|
+
}, Aa = Tt({
|
|
6802
6822
|
toast: () => {
|
|
6803
6823
|
}
|
|
6804
|
-
}), gs = () => Vt(
|
|
6824
|
+
}), gs = () => Vt(Aa), ys = ({ children: e }) => {
|
|
6805
6825
|
const [a, t] = Z([]), r = (s) => {
|
|
6806
6826
|
const l = `${Date.now()}-${Math.random()}`;
|
|
6807
6827
|
t((c) => [...c, { id: l, ...s }]);
|
|
6808
6828
|
}, i = (s) => {
|
|
6809
6829
|
t((l) => l.filter((c) => c.id !== s));
|
|
6810
6830
|
};
|
|
6811
|
-
return /* @__PURE__ */ w(
|
|
6831
|
+
return /* @__PURE__ */ w(Aa.Provider, { value: { toast: r }, children: [
|
|
6812
6832
|
e,
|
|
6813
6833
|
a.map((s, l) => /* @__PURE__ */ n(
|
|
6814
6834
|
$n,
|
|
@@ -6830,11 +6850,11 @@ const Aa = Lt({
|
|
|
6830
6850
|
};
|
|
6831
6851
|
var st = (e) => e.type === "checkbox", qe = (e) => e instanceof Date, Be = (e) => e == null;
|
|
6832
6852
|
const Sa = (e) => typeof e == "object";
|
|
6833
|
-
var Se = (e) => !Be(e) && !Array.isArray(e) && Sa(e) && !qe(e), Va = (e) => Se(e) && e.target ? st(e.target) ? e.target.checked : e.target.value : e, Pn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e,
|
|
6853
|
+
var Se = (e) => !Be(e) && !Array.isArray(e) && Sa(e) && !qe(e), Va = (e) => Se(e) && e.target ? st(e.target) ? e.target.checked : e.target.value : e, Pn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ta = (e, a) => e.has(Pn(a)), Hn = (e) => {
|
|
6834
6854
|
const a = e.constructor && e.constructor.prototype;
|
|
6835
6855
|
return Se(a) && a.hasOwnProperty("isPrototypeOf");
|
|
6836
6856
|
}, Ft = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
6837
|
-
function
|
|
6857
|
+
function Ee(e) {
|
|
6838
6858
|
if (e instanceof Date)
|
|
6839
6859
|
return new Date(e);
|
|
6840
6860
|
const a = typeof FileList < "u" && e instanceof FileList;
|
|
@@ -6845,7 +6865,7 @@ function Ae(e) {
|
|
|
6845
6865
|
return e;
|
|
6846
6866
|
const r = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
6847
6867
|
for (const i in e)
|
|
6848
|
-
Object.prototype.hasOwnProperty.call(e, i) && (r[i] =
|
|
6868
|
+
Object.prototype.hasOwnProperty.call(e, i) && (r[i] = Ee(e[i]));
|
|
6849
6869
|
return r;
|
|
6850
6870
|
}
|
|
6851
6871
|
var vt = (e) => /^\w*$/.test(e), xe = (e) => e === void 0, $t = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Rt = (e) => $t(e.replace(/["|']|\]/g, "").split(/\.|\[/)), ne = (e, a, t) => {
|
|
@@ -6889,7 +6909,7 @@ const ft = {
|
|
|
6889
6909
|
}, zt = ge.createContext(null);
|
|
6890
6910
|
zt.displayName = "HookFormControlContext";
|
|
6891
6911
|
const Bt = () => ge.useContext(zt);
|
|
6892
|
-
var
|
|
6912
|
+
var La = (e, a, t, r = !0) => {
|
|
6893
6913
|
const i = {
|
|
6894
6914
|
defaultValues: a._defaultValues
|
|
6895
6915
|
};
|
|
@@ -6926,11 +6946,11 @@ function On(e) {
|
|
|
6926
6946
|
}
|
|
6927
6947
|
}), [i, r, s]), ge.useEffect(() => {
|
|
6928
6948
|
b.current.isValid && t._setValid(!0);
|
|
6929
|
-
}, [t]), ge.useMemo(() =>
|
|
6949
|
+
}, [t]), ge.useMemo(() => La(l, t, b.current, !1), [l, t]);
|
|
6930
6950
|
}
|
|
6931
|
-
var He = (e) => typeof e == "string", It = (e, a, t, r, i) => He(e) ? (r && a.watch.add(e), ne(t, e, i)) : Array.isArray(e) ? e.map((s) => (r && a.watch.add(s), ne(t, s))) : (r && (a.watchAll = !0), t),
|
|
6951
|
+
var He = (e) => typeof e == "string", It = (e, a, t, r, i) => He(e) ? (r && a.watch.add(e), ne(t, e, i)) : Array.isArray(e) ? e.map((s) => (r && a.watch.add(s), ne(t, s))) : (r && (a.watchAll = !0), t), Et = (e) => Be(e) || !Sa(e);
|
|
6932
6952
|
function Ue(e, a, t = /* @__PURE__ */ new WeakSet()) {
|
|
6933
|
-
if (
|
|
6953
|
+
if (Et(e) || Et(a))
|
|
6934
6954
|
return Object.is(e, a);
|
|
6935
6955
|
if (qe(e) && qe(a))
|
|
6936
6956
|
return Object.is(e.getTime(), a.getTime());
|
|
@@ -6958,39 +6978,39 @@ function Un(e) {
|
|
|
6958
6978
|
const [p, I] = ge.useState(() => {
|
|
6959
6979
|
const _ = t._getWatch(r, b.current);
|
|
6960
6980
|
return h.current ? h.current(_) : _;
|
|
6961
|
-
}),
|
|
6981
|
+
}), E = ge.useCallback((_) => {
|
|
6962
6982
|
const f = It(r, t._names, _ || t._formValues, !1, b.current);
|
|
6963
6983
|
return h.current ? h.current(f) : f;
|
|
6964
|
-
}, [t._formValues, t._names, r]),
|
|
6984
|
+
}, [t._formValues, t._names, r]), A = ge.useCallback((_) => {
|
|
6965
6985
|
if (!s) {
|
|
6966
6986
|
const f = It(r, t._names, _ || t._formValues, !1, b.current);
|
|
6967
6987
|
if (h.current) {
|
|
6968
|
-
const
|
|
6969
|
-
Ue(
|
|
6988
|
+
const T = h.current(f);
|
|
6989
|
+
Ue(T, u.current) || (I(T), u.current = T);
|
|
6970
6990
|
} else
|
|
6971
6991
|
I(f);
|
|
6972
6992
|
}
|
|
6973
6993
|
}, [t._formValues, t._names, s, r]);
|
|
6974
|
-
Pt(() => ((M.current !== t || !Ue(m.current, r)) && (M.current = t, m.current = r,
|
|
6994
|
+
Pt(() => ((M.current !== t || !Ue(m.current, r)) && (M.current = t, m.current = r, A()), t._subscribe({
|
|
6975
6995
|
name: r,
|
|
6976
6996
|
formState: {
|
|
6977
6997
|
values: !0
|
|
6978
6998
|
},
|
|
6979
6999
|
exact: l,
|
|
6980
7000
|
callback: (_) => {
|
|
6981
|
-
|
|
7001
|
+
A(_.values);
|
|
6982
7002
|
}
|
|
6983
|
-
})), [t, l, r,
|
|
7003
|
+
})), [t, l, r, A]), ge.useEffect(() => t._removeUnmounted());
|
|
6984
7004
|
const F = M.current !== t, N = m.current, k = ge.useMemo(() => {
|
|
6985
7005
|
if (s)
|
|
6986
7006
|
return null;
|
|
6987
7007
|
const _ = !F && !Ue(N, r);
|
|
6988
|
-
return F || _ ?
|
|
6989
|
-
}, [s, F, r, N,
|
|
7008
|
+
return F || _ ? E() : null;
|
|
7009
|
+
}, [s, F, r, N, E]);
|
|
6990
7010
|
return k !== null ? k : p;
|
|
6991
7011
|
}
|
|
6992
7012
|
function Gn(e) {
|
|
6993
|
-
const a = Bt(), { name: t, disabled: r, control: i = a, shouldUnregister: s, defaultValue: l, exact: c = !0 } = e, b =
|
|
7013
|
+
const a = Bt(), { name: t, disabled: r, control: i = a, shouldUnregister: s, defaultValue: l, exact: c = !0 } = e, b = Ta(i._names.array, t), h = ge.useMemo(() => ne(i._formValues, t, ne(i._defaultValues, t, l)), [i, t, l]), u = Un({
|
|
6994
7014
|
control: i,
|
|
6995
7015
|
name: t,
|
|
6996
7016
|
defaultValue: h,
|
|
@@ -7005,7 +7025,7 @@ function Gn(e) {
|
|
|
7005
7025
|
...Pe(e.disabled) ? { disabled: e.disabled } : {}
|
|
7006
7026
|
}));
|
|
7007
7027
|
m.current = e;
|
|
7008
|
-
const
|
|
7028
|
+
const E = ge.useMemo(() => Object.defineProperties({}, {
|
|
7009
7029
|
invalid: {
|
|
7010
7030
|
enumerable: !0,
|
|
7011
7031
|
get: () => !!ne(M.errors, t)
|
|
@@ -7026,7 +7046,7 @@ function Gn(e) {
|
|
|
7026
7046
|
enumerable: !0,
|
|
7027
7047
|
get: () => ne(M.errors, t)
|
|
7028
7048
|
}
|
|
7029
|
-
}), [M, t]),
|
|
7049
|
+
}), [M, t]), A = ge.useCallback((_) => I.current.onChange({
|
|
7030
7050
|
target: {
|
|
7031
7051
|
value: Va(_),
|
|
7032
7052
|
name: t
|
|
@@ -7043,33 +7063,33 @@ function Gn(e) {
|
|
|
7043
7063
|
f && f._f && _ && (f._f.ref = {
|
|
7044
7064
|
focus: () => Re(_.focus) && _.focus(),
|
|
7045
7065
|
select: () => Re(_.select) && _.select(),
|
|
7046
|
-
setCustomValidity: (
|
|
7066
|
+
setCustomValidity: (T) => Re(_.setCustomValidity) && _.setCustomValidity(T),
|
|
7047
7067
|
reportValidity: () => Re(_.reportValidity) && _.reportValidity()
|
|
7048
7068
|
});
|
|
7049
7069
|
}, [i._fields, t]), k = ge.useMemo(() => ({
|
|
7050
7070
|
name: t,
|
|
7051
7071
|
value: u,
|
|
7052
7072
|
...Pe(r) || M.disabled ? { disabled: M.disabled || r } : {},
|
|
7053
|
-
onChange:
|
|
7073
|
+
onChange: A,
|
|
7054
7074
|
onBlur: F,
|
|
7055
7075
|
ref: N
|
|
7056
|
-
}), [t, r, M.disabled,
|
|
7076
|
+
}), [t, r, M.disabled, A, F, N, u]);
|
|
7057
7077
|
return ge.useEffect(() => {
|
|
7058
7078
|
const _ = i._options.shouldUnregister || s, f = p.current;
|
|
7059
7079
|
f && f !== t && !b && i.unregister(f), i.register(t, {
|
|
7060
7080
|
...m.current.rules,
|
|
7061
7081
|
...Pe(m.current.disabled) ? { disabled: m.current.disabled } : {}
|
|
7062
7082
|
});
|
|
7063
|
-
const
|
|
7083
|
+
const T = ($, Y) => {
|
|
7064
7084
|
const B = ne(i._fields, $);
|
|
7065
|
-
B && B._f && (B._f.mount =
|
|
7085
|
+
B && B._f && (B._f.mount = Y);
|
|
7066
7086
|
};
|
|
7067
|
-
if (
|
|
7068
|
-
const $ =
|
|
7087
|
+
if (T(t, !0), _) {
|
|
7088
|
+
const $ = Ee(ne(i._options.defaultValues, t, m.current.defaultValue));
|
|
7069
7089
|
Me(i._defaultValues, t, $), xe(ne(i._formValues, t)) && Me(i._formValues, t, $);
|
|
7070
7090
|
}
|
|
7071
7091
|
return !b && i.register(t), p.current = t, () => {
|
|
7072
|
-
(b ? _ && !i._state.action : _) ? i.unregister(t) :
|
|
7092
|
+
(b ? _ && !i._state.action : _) ? i.unregister(t) : T(t, !1);
|
|
7073
7093
|
};
|
|
7074
7094
|
}, [t, i, b, s]), ge.useEffect(() => {
|
|
7075
7095
|
i._setDisabledField({
|
|
@@ -7079,13 +7099,13 @@ function Gn(e) {
|
|
|
7079
7099
|
}, [r, t, i]), ge.useMemo(() => ({
|
|
7080
7100
|
field: k,
|
|
7081
7101
|
formState: M,
|
|
7082
|
-
fieldState:
|
|
7083
|
-
}), [k, M,
|
|
7102
|
+
fieldState: E
|
|
7103
|
+
}), [k, M, E]);
|
|
7084
7104
|
}
|
|
7085
7105
|
const Kn = (e) => e.render(Gn(e)), Fa = ge.createContext(null);
|
|
7086
7106
|
Fa.displayName = "HookFormContext";
|
|
7087
7107
|
const Wn = (e) => {
|
|
7088
|
-
const { children: a, watch: t, getValues: r, getFieldState: i, setError: s, clearErrors: l, setValue: c, trigger: b, formState: h, resetField: u, reset: M, handleSubmit: m, unregister: p, control: I, register:
|
|
7108
|
+
const { children: a, watch: t, getValues: r, getFieldState: i, setError: s, clearErrors: l, setValue: c, trigger: b, formState: h, resetField: u, reset: M, handleSubmit: m, unregister: p, control: I, register: E, setFocus: A, subscribe: F } = e;
|
|
7089
7109
|
return ge.createElement(
|
|
7090
7110
|
Fa.Provider,
|
|
7091
7111
|
{ value: ge.useMemo(() => ({
|
|
@@ -7102,8 +7122,8 @@ const Wn = (e) => {
|
|
|
7102
7122
|
handleSubmit: m,
|
|
7103
7123
|
unregister: p,
|
|
7104
7124
|
control: I,
|
|
7105
|
-
register:
|
|
7106
|
-
setFocus:
|
|
7125
|
+
register: E,
|
|
7126
|
+
setFocus: A,
|
|
7107
7127
|
subscribe: F
|
|
7108
7128
|
}), [
|
|
7109
7129
|
l,
|
|
@@ -7112,11 +7132,11 @@ const Wn = (e) => {
|
|
|
7112
7132
|
i,
|
|
7113
7133
|
r,
|
|
7114
7134
|
m,
|
|
7115
|
-
|
|
7135
|
+
E,
|
|
7116
7136
|
M,
|
|
7117
7137
|
u,
|
|
7118
7138
|
s,
|
|
7119
|
-
|
|
7139
|
+
A,
|
|
7120
7140
|
c,
|
|
7121
7141
|
F,
|
|
7122
7142
|
b,
|
|
@@ -7183,9 +7203,9 @@ function Jn(e) {
|
|
|
7183
7203
|
return !1;
|
|
7184
7204
|
return !0;
|
|
7185
7205
|
}
|
|
7186
|
-
function
|
|
7206
|
+
function Ae(e, a) {
|
|
7187
7207
|
const t = Array.isArray(a) ? a : vt(a) ? [a] : Rt(a), r = t.length === 1 ? e : qn(e, t), i = t.length - 1, s = t[i];
|
|
7188
|
-
return r && delete r[s], i !== 0 && (Se(r) && $e(r) || Array.isArray(r) && Jn(r)) &&
|
|
7208
|
+
return r && delete r[s], i !== 0 && (Se(r) && $e(r) || Array.isArray(r) && Jn(r)) && Ae(e, t.slice(0, -1)), e;
|
|
7189
7209
|
}
|
|
7190
7210
|
var Zn = (e) => {
|
|
7191
7211
|
for (const a in e)
|
|
@@ -7196,19 +7216,19 @@ var Zn = (e) => {
|
|
|
7196
7216
|
function za(e) {
|
|
7197
7217
|
return Array.isArray(e) || Se(e) && !Zn(e);
|
|
7198
7218
|
}
|
|
7199
|
-
function
|
|
7219
|
+
function At(e, a = {}) {
|
|
7200
7220
|
for (const t in e) {
|
|
7201
7221
|
const r = e[t];
|
|
7202
|
-
za(r) ? (a[t] = Array.isArray(r) ? [] : {},
|
|
7222
|
+
za(r) ? (a[t] = Array.isArray(r) ? [] : {}, At(r, a[t])) : xe(r) || (a[t] = !0);
|
|
7203
7223
|
}
|
|
7204
7224
|
return a;
|
|
7205
7225
|
}
|
|
7206
7226
|
function Ze(e, a, t) {
|
|
7207
|
-
t || (t =
|
|
7227
|
+
t || (t = At(a));
|
|
7208
7228
|
for (const r in e) {
|
|
7209
7229
|
const i = e[r];
|
|
7210
7230
|
if (za(i))
|
|
7211
|
-
xe(a) ||
|
|
7231
|
+
xe(a) || Et(t[r]) ? t[r] = At(i, Array.isArray(i) ? [] : {}) : Ze(i, Be(a) ? {} : a[r], t[r]);
|
|
7212
7232
|
else {
|
|
7213
7233
|
const s = a[r];
|
|
7214
7234
|
t[r] = !Ue(i, s);
|
|
@@ -7315,7 +7335,7 @@ var tr = (e, a, t, r) => {
|
|
|
7315
7335
|
t(e);
|
|
7316
7336
|
const { name: i, ...s } = e;
|
|
7317
7337
|
return $e(s) || Object.keys(s).length >= Object.keys(a).length || Object.keys(s).find((l) => a[l] === (!r || Oe.all));
|
|
7318
|
-
}, ar = (e, a, t) => !e || !a || e === a || et(e).some((r) => r && (t ? r === a : r.startsWith(a) || a.startsWith(r))), nr = (e, a, t, r, i) => i.isOnAll ? !1 : !t && i.isOnTouch ? !(a || e) : (t ? r.isOnBlur : i.isOnBlur) ? !e : (t ? r.isOnChange : i.isOnChange) ? e : !0, rr = (e, a) => !$t(ne(e, a)).length &&
|
|
7338
|
+
}, ar = (e, a, t) => !e || !a || e === a || et(e).some((r) => r && (t ? r === a : r.startsWith(a) || a.startsWith(r))), nr = (e, a, t, r, i) => i.isOnAll ? !1 : !t && i.isOnTouch ? !(a || e) : (t ? r.isOnBlur : i.isOnBlur) ? !e : (t ? r.isOnChange : i.isOnChange) ? e : !0, rr = (e, a) => !$t(ne(e, a)).length && Ae(e, a), sr = (e, a, t) => {
|
|
7319
7339
|
const r = et(ne(e, t));
|
|
7320
7340
|
return Me(r, "root", a[t]), Me(e, t, r), e;
|
|
7321
7341
|
};
|
|
@@ -7331,80 +7351,80 @@ var Je = (e) => Se(e) && !mt(e) ? e : {
|
|
|
7331
7351
|
value: e,
|
|
7332
7352
|
message: ""
|
|
7333
7353
|
}, oa = async (e, a, t, r, i, s) => {
|
|
7334
|
-
const { ref: l, refs: c, required: b, maxLength: h, minLength: u, min: M, max: m, pattern: p, validate: I, name:
|
|
7335
|
-
if (!F || a.has(
|
|
7354
|
+
const { ref: l, refs: c, required: b, maxLength: h, minLength: u, min: M, max: m, pattern: p, validate: I, name: E, valueAsNumber: A, mount: F } = e._f, N = ne(t, E);
|
|
7355
|
+
if (!F || a.has(E))
|
|
7336
7356
|
return {};
|
|
7337
|
-
const k = c ? c[0] : l, _ = (
|
|
7338
|
-
i && k.reportValidity && (k.setCustomValidity(Pe(
|
|
7339
|
-
}, f = {},
|
|
7340
|
-
const X =
|
|
7341
|
-
f[
|
|
7342
|
-
type:
|
|
7357
|
+
const k = c ? c[0] : l, _ = (O) => {
|
|
7358
|
+
i && k.reportValidity && (k.setCustomValidity(Pe(O) ? "" : O || ""), k.reportValidity());
|
|
7359
|
+
}, f = {}, T = Ot(l), $ = st(l), Y = T || $, B = (A || Ht(l)) && xe(l.value) && xe(N) || pt(l) && l.value === "" || N === "" || Array.isArray(N) && !N.length, V = jn.bind(null, E, r, f), G = (O, W, ae, ue = We.maxLength, te = We.minLength) => {
|
|
7360
|
+
const X = O ? W : ae;
|
|
7361
|
+
f[E] = {
|
|
7362
|
+
type: O ? ue : te,
|
|
7343
7363
|
message: X,
|
|
7344
7364
|
ref: l,
|
|
7345
|
-
...V(
|
|
7365
|
+
...V(O ? ue : te, X)
|
|
7346
7366
|
};
|
|
7347
7367
|
};
|
|
7348
|
-
if (s ? !Array.isArray(N) || !N.length : b && (!
|
|
7349
|
-
const { value:
|
|
7350
|
-
if (
|
|
7368
|
+
if (s ? !Array.isArray(N) || !N.length : b && (!Y && (B || Be(N)) || Pe(N) && !N || $ && !Ba(c).isValid || T && !Ha(c).isValid)) {
|
|
7369
|
+
const { value: O, message: W } = He(b) ? { value: !!b, message: b } : Je(b);
|
|
7370
|
+
if (O && (f[E] = {
|
|
7351
7371
|
type: We.required,
|
|
7352
|
-
message:
|
|
7372
|
+
message: W,
|
|
7353
7373
|
ref: k,
|
|
7354
|
-
...V(We.required,
|
|
7374
|
+
...V(We.required, W)
|
|
7355
7375
|
}, !r))
|
|
7356
|
-
return _(
|
|
7376
|
+
return _(W), f;
|
|
7357
7377
|
}
|
|
7358
7378
|
if (!B && (!Be(M) || !Be(m))) {
|
|
7359
|
-
let
|
|
7379
|
+
let O, W;
|
|
7360
7380
|
const ae = Je(m), ue = Je(M);
|
|
7361
7381
|
if (!Be(N) && !isNaN(N)) {
|
|
7362
7382
|
const te = l.valueAsNumber || N && +N;
|
|
7363
|
-
Be(ae.value) || (
|
|
7383
|
+
Be(ae.value) || (O = te > ae.value), Be(ue.value) || (W = te < ue.value);
|
|
7364
7384
|
} else {
|
|
7365
|
-
const te = l.valueAsDate || new Date(N), X = (P) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + P), H = l.type == "time",
|
|
7366
|
-
He(ae.value) && N && (
|
|
7385
|
+
const te = l.valueAsDate || new Date(N), X = (P) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + P), H = l.type == "time", K = l.type == "week";
|
|
7386
|
+
He(ae.value) && N && (O = H ? X(N) > X(ae.value) : K ? N > ae.value : te > new Date(ae.value)), He(ue.value) && N && (W = H ? X(N) < X(ue.value) : K ? N < ue.value : te < new Date(ue.value));
|
|
7367
7387
|
}
|
|
7368
|
-
if ((
|
|
7369
|
-
return _(f[
|
|
7388
|
+
if ((O || W) && (G(!!O, ae.message, ue.message, We.max, We.min), !r))
|
|
7389
|
+
return _(f[E].message), f;
|
|
7370
7390
|
}
|
|
7371
7391
|
if ((h || u) && !B && (He(N) || s && Array.isArray(N))) {
|
|
7372
|
-
const
|
|
7373
|
-
if ((ae || ue) && (
|
|
7374
|
-
return _(f[
|
|
7392
|
+
const O = Je(h), W = Je(u), ae = !Be(O.value) && N.length > +O.value, ue = !Be(W.value) && N.length < +W.value;
|
|
7393
|
+
if ((ae || ue) && (G(ae, O.message, W.message), !r))
|
|
7394
|
+
return _(f[E].message), f;
|
|
7375
7395
|
}
|
|
7376
7396
|
if (p && !B && He(N)) {
|
|
7377
|
-
const { value:
|
|
7378
|
-
if (mt(
|
|
7397
|
+
const { value: O, message: W } = Je(p);
|
|
7398
|
+
if (mt(O) && !N.match(O) && (f[E] = {
|
|
7379
7399
|
type: We.pattern,
|
|
7380
|
-
message:
|
|
7400
|
+
message: W,
|
|
7381
7401
|
ref: l,
|
|
7382
|
-
...V(We.pattern,
|
|
7402
|
+
...V(We.pattern, W)
|
|
7383
7403
|
}, !r))
|
|
7384
|
-
return _(
|
|
7404
|
+
return _(W), f;
|
|
7385
7405
|
}
|
|
7386
7406
|
if (I) {
|
|
7387
7407
|
if (Re(I)) {
|
|
7388
|
-
const
|
|
7389
|
-
if (
|
|
7390
|
-
...
|
|
7391
|
-
...V(We.validate,
|
|
7408
|
+
const O = await I(N, t), W = la(O, k);
|
|
7409
|
+
if (W && (f[E] = {
|
|
7410
|
+
...W,
|
|
7411
|
+
...V(We.validate, W.message)
|
|
7392
7412
|
}, !r))
|
|
7393
|
-
return _(
|
|
7413
|
+
return _(W.message), f;
|
|
7394
7414
|
} else if (Se(I)) {
|
|
7395
|
-
let
|
|
7396
|
-
for (const
|
|
7397
|
-
if (!$e(
|
|
7415
|
+
let O = {};
|
|
7416
|
+
for (const W in I) {
|
|
7417
|
+
if (!$e(O) && !r)
|
|
7398
7418
|
break;
|
|
7399
|
-
const ae = la(await I[
|
|
7400
|
-
ae && (
|
|
7419
|
+
const ae = la(await I[W](N, t), k, W);
|
|
7420
|
+
ae && (O = {
|
|
7401
7421
|
...ae,
|
|
7402
|
-
...V(
|
|
7403
|
-
}, _(ae.message), r && (f[
|
|
7422
|
+
...V(W, ae.message)
|
|
7423
|
+
}, _(ae.message), r && (f[E] = O));
|
|
7404
7424
|
}
|
|
7405
|
-
if (!$e(
|
|
7425
|
+
if (!$e(O) && (f[E] = {
|
|
7406
7426
|
ref: k,
|
|
7407
|
-
...
|
|
7427
|
+
...O
|
|
7408
7428
|
}, !r))
|
|
7409
7429
|
return f;
|
|
7410
7430
|
}
|
|
@@ -7435,7 +7455,7 @@ function lr(e = {}) {
|
|
|
7435
7455
|
validatingFields: {},
|
|
7436
7456
|
errors: a.errors || {},
|
|
7437
7457
|
disabled: a.disabled || !1
|
|
7438
|
-
}, r = {}, i = Se(a.defaultValues) || Se(a.values) ?
|
|
7458
|
+
}, r = {}, i = Se(a.defaultValues) || Se(a.values) ? Ee(a.defaultValues || a.values) || {} : {}, s = a.shouldUnregister ? {} : Ee(i), l = {
|
|
7439
7459
|
action: !1,
|
|
7440
7460
|
mount: !1,
|
|
7441
7461
|
watch: !1,
|
|
@@ -7464,39 +7484,39 @@ function lr(e = {}) {
|
|
|
7464
7484
|
const p = {
|
|
7465
7485
|
array: Xt(),
|
|
7466
7486
|
state: Xt()
|
|
7467
|
-
}, I = a.criteriaMode === Oe.all,
|
|
7487
|
+
}, I = a.criteriaMode === Oe.all, E = (o) => (y) => {
|
|
7468
7488
|
clearTimeout(h), h = setTimeout(o, y);
|
|
7469
|
-
},
|
|
7489
|
+
}, A = async (o) => {
|
|
7470
7490
|
if (!l.keepIsValid && !a.disabled && (M.isValid || m.isValid || o)) {
|
|
7471
7491
|
let y;
|
|
7472
|
-
a.resolver ? (y = $e((await
|
|
7492
|
+
a.resolver ? (y = $e((await Y()).errors), F()) : y = await V(r, !0), y !== t.isValid && p.state.next({
|
|
7473
7493
|
isValid: y
|
|
7474
7494
|
});
|
|
7475
7495
|
}
|
|
7476
7496
|
}, F = (o, y) => {
|
|
7477
7497
|
!a.disabled && (M.isValidating || M.validatingFields || m.isValidating || m.validatingFields) && ((o || Array.from(c.mount)).forEach((C) => {
|
|
7478
|
-
C && (y ? Me(t.validatingFields, C, y) :
|
|
7498
|
+
C && (y ? Me(t.validatingFields, C, y) : Ae(t.validatingFields, C));
|
|
7479
7499
|
}), p.state.next({
|
|
7480
7500
|
validatingFields: t.validatingFields,
|
|
7481
7501
|
isValidating: !$e(t.validatingFields)
|
|
7482
7502
|
}));
|
|
7483
|
-
}, N = (o, y = [], C, R,
|
|
7503
|
+
}, N = (o, y = [], C, R, L = !0, z = !0) => {
|
|
7484
7504
|
if (R && C && !a.disabled) {
|
|
7485
7505
|
if (l.action = !0, z && Array.isArray(ne(r, o))) {
|
|
7486
7506
|
const d = C(ne(r, o), R.argA, R.argB);
|
|
7487
|
-
|
|
7507
|
+
L && Me(r, o, d);
|
|
7488
7508
|
}
|
|
7489
7509
|
if (z && Array.isArray(ne(t.errors, o))) {
|
|
7490
7510
|
const d = C(ne(t.errors, o), R.argA, R.argB);
|
|
7491
|
-
|
|
7511
|
+
L && Me(t.errors, o, d), rr(t.errors, o);
|
|
7492
7512
|
}
|
|
7493
7513
|
if ((M.touchedFields || m.touchedFields) && z && Array.isArray(ne(t.touchedFields, o))) {
|
|
7494
7514
|
const d = C(ne(t.touchedFields, o), R.argA, R.argB);
|
|
7495
|
-
|
|
7515
|
+
L && Me(t.touchedFields, o, d);
|
|
7496
7516
|
}
|
|
7497
7517
|
(M.dirtyFields || m.dirtyFields) && (t.dirtyFields = Ze(i, s)), p.state.next({
|
|
7498
7518
|
name: o,
|
|
7499
|
-
isDirty:
|
|
7519
|
+
isDirty: O(o, y),
|
|
7500
7520
|
dirtyFields: t.dirtyFields,
|
|
7501
7521
|
errors: t.errors,
|
|
7502
7522
|
isValid: t.isValid
|
|
@@ -7513,32 +7533,32 @@ function lr(e = {}) {
|
|
|
7513
7533
|
isValid: !1
|
|
7514
7534
|
});
|
|
7515
7535
|
}, f = (o, y, C, R) => {
|
|
7516
|
-
const
|
|
7517
|
-
if (
|
|
7536
|
+
const L = ne(r, o);
|
|
7537
|
+
if (L) {
|
|
7518
7538
|
const z = ne(s, o, xe(C) ? ne(i, o) : C);
|
|
7519
|
-
xe(z) || R && R.defaultChecked || y ? Me(s, o, y ? z : aa(
|
|
7539
|
+
xe(z) || R && R.defaultChecked || y ? Me(s, o, y ? z : aa(L._f)) : ue(o, z), l.mount && !l.action && A();
|
|
7520
7540
|
}
|
|
7521
|
-
},
|
|
7541
|
+
}, T = (o, y, C, R, L) => {
|
|
7522
7542
|
let z = !1, d = !1;
|
|
7523
7543
|
const D = {
|
|
7524
7544
|
name: o
|
|
7525
7545
|
};
|
|
7526
7546
|
if (!a.disabled) {
|
|
7527
7547
|
if (!C || R) {
|
|
7528
|
-
(M.isDirty || m.isDirty) && (d = t.isDirty, t.isDirty = D.isDirty =
|
|
7548
|
+
(M.isDirty || m.isDirty) && (d = t.isDirty, t.isDirty = D.isDirty = O(), z = d !== D.isDirty);
|
|
7529
7549
|
const x = Ue(ne(i, o), y);
|
|
7530
|
-
d = !!ne(t.dirtyFields, o), x ?
|
|
7550
|
+
d = !!ne(t.dirtyFields, o), x ? Ae(t.dirtyFields, o) : Me(t.dirtyFields, o, !0), D.dirtyFields = t.dirtyFields, z = z || (M.dirtyFields || m.dirtyFields) && d !== !x;
|
|
7531
7551
|
}
|
|
7532
7552
|
if (C) {
|
|
7533
7553
|
const x = ne(t.touchedFields, o);
|
|
7534
7554
|
x || (Me(t.touchedFields, o, C), D.touchedFields = t.touchedFields, z = z || (M.touchedFields || m.touchedFields) && x !== C);
|
|
7535
7555
|
}
|
|
7536
|
-
z &&
|
|
7556
|
+
z && L && p.state.next(D);
|
|
7537
7557
|
}
|
|
7538
7558
|
return z ? D : {};
|
|
7539
7559
|
}, $ = (o, y, C, R) => {
|
|
7540
|
-
const
|
|
7541
|
-
if (a.delayError && C ? (b =
|
|
7560
|
+
const L = ne(t.errors, o), z = (M.isValid || m.isValid) && Pe(y) && t.isValid !== y;
|
|
7561
|
+
if (a.delayError && C ? (b = E(() => k(o, C)), b(a.delayError)) : (clearTimeout(h), b = null, C ? Me(t.errors, o, C) : Ae(t.errors, o)), (C ? !Ue(L, C) : L) || !$e(R) || z) {
|
|
7542
7562
|
const d = {
|
|
7543
7563
|
...R,
|
|
7544
7564
|
...z && Pe(y) ? { isValid: y } : {},
|
|
@@ -7550,12 +7570,12 @@ function lr(e = {}) {
|
|
|
7550
7570
|
...d
|
|
7551
7571
|
}, p.state.next(d);
|
|
7552
7572
|
}
|
|
7553
|
-
},
|
|
7554
|
-
const { errors: y } = await
|
|
7573
|
+
}, Y = async (o) => (F(o, !0), await a.resolver(s, a.context, Xn(o || c.mount, r, a.criteriaMode, a.shouldUseNativeValidation))), B = async (o) => {
|
|
7574
|
+
const { errors: y } = await Y(o);
|
|
7555
7575
|
if (F(o), o)
|
|
7556
7576
|
for (const C of o) {
|
|
7557
7577
|
const R = ne(y, C);
|
|
7558
|
-
R ? Me(t.errors, C, R) :
|
|
7578
|
+
R ? Me(t.errors, C, R) : Ae(t.errors, C);
|
|
7559
7579
|
}
|
|
7560
7580
|
else
|
|
7561
7581
|
t.errors = y;
|
|
@@ -7564,112 +7584,112 @@ function lr(e = {}) {
|
|
|
7564
7584
|
valid: !0
|
|
7565
7585
|
}) => {
|
|
7566
7586
|
for (const R in o) {
|
|
7567
|
-
const
|
|
7568
|
-
if (
|
|
7569
|
-
const { _f: z, ...d } =
|
|
7587
|
+
const L = o[R];
|
|
7588
|
+
if (L) {
|
|
7589
|
+
const { _f: z, ...d } = L;
|
|
7570
7590
|
if (z) {
|
|
7571
|
-
const D = c.array.has(z.name), x =
|
|
7591
|
+
const D = c.array.has(z.name), x = L._f && Qn(L._f);
|
|
7572
7592
|
x && M.validatingFields && F([z.name], !0);
|
|
7573
|
-
const v = await oa(
|
|
7593
|
+
const v = await oa(L, c.disabled, s, I, a.shouldUseNativeValidation && !y, D);
|
|
7574
7594
|
if (x && M.validatingFields && F([z.name]), v[z.name] && (C.valid = !1, y || e.shouldUseNativeValidation))
|
|
7575
7595
|
break;
|
|
7576
|
-
!y && (ne(v, z.name) ? D ? sr(t.errors, v, z.name) : Me(t.errors, z.name, v[z.name]) :
|
|
7596
|
+
!y && (ne(v, z.name) ? D ? sr(t.errors, v, z.name) : Me(t.errors, z.name, v[z.name]) : Ae(t.errors, z.name));
|
|
7577
7597
|
}
|
|
7578
7598
|
!$e(d) && await V(d, y, C);
|
|
7579
7599
|
}
|
|
7580
7600
|
}
|
|
7581
7601
|
return C.valid;
|
|
7582
|
-
},
|
|
7602
|
+
}, G = () => {
|
|
7583
7603
|
for (const o of c.unMount) {
|
|
7584
7604
|
const y = ne(r, o);
|
|
7585
7605
|
y && (y._f.refs ? y._f.refs.every((C) => !kt(C)) : !kt(y._f.ref)) && ie(o);
|
|
7586
7606
|
}
|
|
7587
7607
|
c.unMount = /* @__PURE__ */ new Set();
|
|
7588
|
-
},
|
|
7608
|
+
}, O = (o, y) => !a.disabled && (o && y && Me(s, o, y), !Ue(se(), i)), W = (o, y, C) => It(o, c, {
|
|
7589
7609
|
...l.mount ? s : xe(y) ? i : He(o) ? { [o]: y } : y
|
|
7590
7610
|
}, C, y), ae = (o) => $t(ne(l.mount ? s : i, o, a.shouldUnregister ? ne(i, o, []) : [])), ue = (o, y, C = {}) => {
|
|
7591
7611
|
const R = ne(r, o);
|
|
7592
|
-
let
|
|
7612
|
+
let L = y;
|
|
7593
7613
|
if (R) {
|
|
7594
7614
|
const z = R._f;
|
|
7595
|
-
z && (!z.disabled && Me(s, o, Pa(y, z)),
|
|
7596
|
-
(!d.defaultChecked || !d.disabled) && (Array.isArray(
|
|
7597
|
-
}) : z.refs.forEach((d) => d.checked = d.value ===
|
|
7615
|
+
z && (!z.disabled && Me(s, o, Pa(y, z)), L = pt(z.ref) && Be(y) ? "" : y, Ra(z.ref) ? [...z.ref.options].forEach((d) => d.selected = L.includes(d.value)) : z.refs ? st(z.ref) ? z.refs.forEach((d) => {
|
|
7616
|
+
(!d.defaultChecked || !d.disabled) && (Array.isArray(L) ? d.checked = !!L.find((D) => D === d.value) : d.checked = L === d.value || !!L);
|
|
7617
|
+
}) : z.refs.forEach((d) => d.checked = d.value === L) : Ht(z.ref) ? z.ref.value = "" : (z.ref.value = L, z.ref.type || p.state.next({
|
|
7598
7618
|
name: o,
|
|
7599
|
-
values:
|
|
7619
|
+
values: Ee(s)
|
|
7600
7620
|
})));
|
|
7601
7621
|
}
|
|
7602
|
-
(C.shouldDirty || C.shouldTouch) &&
|
|
7622
|
+
(C.shouldDirty || C.shouldTouch) && T(o, L, C.shouldTouch, C.shouldDirty, !0), C.shouldValidate && P(o);
|
|
7603
7623
|
}, te = (o, y, C) => {
|
|
7604
7624
|
for (const R in y) {
|
|
7605
7625
|
if (!y.hasOwnProperty(R))
|
|
7606
7626
|
return;
|
|
7607
|
-
const
|
|
7608
|
-
(c.array.has(o) || Se(
|
|
7627
|
+
const L = y[R], z = o + "." + R, d = ne(r, z);
|
|
7628
|
+
(c.array.has(o) || Se(L) || d && !d._f) && !qe(L) ? te(z, L, C) : ue(z, L, C);
|
|
7609
7629
|
}
|
|
7610
7630
|
}, X = (o, y, C = {}) => {
|
|
7611
|
-
const R = ne(r, o),
|
|
7612
|
-
Me(s, o, z),
|
|
7631
|
+
const R = ne(r, o), L = c.array.has(o), z = Ee(y);
|
|
7632
|
+
Me(s, o, z), L ? (p.array.next({
|
|
7613
7633
|
name: o,
|
|
7614
|
-
values:
|
|
7634
|
+
values: Ee(s)
|
|
7615
7635
|
}), (M.isDirty || M.dirtyFields || m.isDirty || m.dirtyFields) && C.shouldDirty && p.state.next({
|
|
7616
7636
|
name: o,
|
|
7617
7637
|
dirtyFields: Ze(i, s),
|
|
7618
|
-
isDirty:
|
|
7638
|
+
isDirty: O(o, z)
|
|
7619
7639
|
})) : R && !R._f && !Be(z) ? te(o, z, C) : ue(o, z, C), sa(o, c) ? p.state.next({
|
|
7620
7640
|
...t,
|
|
7621
7641
|
name: o,
|
|
7622
|
-
values:
|
|
7642
|
+
values: Ee(s)
|
|
7623
7643
|
}) : p.state.next({
|
|
7624
7644
|
name: l.mount ? o : void 0,
|
|
7625
|
-
values:
|
|
7645
|
+
values: Ee(s)
|
|
7626
7646
|
});
|
|
7627
7647
|
}, H = async (o) => {
|
|
7628
7648
|
l.mount = !0;
|
|
7629
7649
|
const y = o.target;
|
|
7630
7650
|
let C = y.name, R = !0;
|
|
7631
|
-
const
|
|
7651
|
+
const L = ne(r, C), z = (x) => {
|
|
7632
7652
|
R = Number.isNaN(x) || qe(x) && isNaN(x.getTime()) || Ue(x, ne(s, C, x));
|
|
7633
7653
|
}, d = na(a.mode), D = na(a.reValidateMode);
|
|
7634
|
-
if (
|
|
7654
|
+
if (L) {
|
|
7635
7655
|
let x, v;
|
|
7636
|
-
const g = y.type ? aa(
|
|
7637
|
-
Me(s, C, g), U ? (!y || !y.readOnly) && (
|
|
7638
|
-
const ye =
|
|
7656
|
+
const g = y.type ? aa(L._f) : Va(o), U = o.type === ft.BLUR || o.type === ft.FOCUS_OUT, re = !er(L._f) && !a.resolver && !ne(t.errors, C) && !L._f.deps || nr(U, ne(t.touchedFields, C), t.isSubmitted, D, d), de = sa(C, c, U);
|
|
7657
|
+
Me(s, C, g), U ? (!y || !y.readOnly) && (L._f.onBlur && L._f.onBlur(o), b && b(0)) : L._f.onChange && L._f.onChange(o);
|
|
7658
|
+
const ye = T(C, g, U), De = !$e(ye) || de;
|
|
7639
7659
|
if (!U && p.state.next({
|
|
7640
7660
|
name: C,
|
|
7641
7661
|
type: o.type,
|
|
7642
|
-
values:
|
|
7662
|
+
values: Ee(s)
|
|
7643
7663
|
}), re)
|
|
7644
|
-
return (M.isValid || m.isValid) && (a.mode === "onBlur" ? U &&
|
|
7664
|
+
return (M.isValid || m.isValid) && (a.mode === "onBlur" ? U && A() : U || A()), De && p.state.next({ name: C, ...de ? {} : ye });
|
|
7645
7665
|
if (!U && de && p.state.next({ ...t }), a.resolver) {
|
|
7646
|
-
const { errors: je } = await
|
|
7666
|
+
const { errors: je } = await Y([C]);
|
|
7647
7667
|
if (F([C]), z(g), R) {
|
|
7648
7668
|
const it = ia(t.errors, r, C), lt = ia(je, r, it.name || C);
|
|
7649
7669
|
x = lt.error, C = lt.name, v = $e(je);
|
|
7650
7670
|
}
|
|
7651
7671
|
} else
|
|
7652
|
-
F([C], !0), x = (await oa(
|
|
7653
|
-
R && (
|
|
7672
|
+
F([C], !0), x = (await oa(L, c.disabled, s, I, a.shouldUseNativeValidation))[C], F([C]), z(g), R && (x ? v = !1 : (M.isValid || m.isValid) && (v = await V(r, !0)));
|
|
7673
|
+
R && (L._f.deps && (!Array.isArray(L._f.deps) || L._f.deps.length > 0) && P(L._f.deps), $(C, v, x, ye));
|
|
7654
7674
|
}
|
|
7655
|
-
},
|
|
7675
|
+
}, K = (o, y) => {
|
|
7656
7676
|
if (ne(t.errors, y) && o.focus)
|
|
7657
7677
|
return o.focus(), 1;
|
|
7658
7678
|
}, P = async (o, y = {}) => {
|
|
7659
7679
|
let C, R;
|
|
7660
|
-
const
|
|
7680
|
+
const L = et(o);
|
|
7661
7681
|
if (a.resolver) {
|
|
7662
|
-
const z = await B(xe(o) ? o :
|
|
7663
|
-
C = $e(z), R = o ? !
|
|
7664
|
-
} else o ? (R = (await Promise.all(
|
|
7682
|
+
const z = await B(xe(o) ? o : L);
|
|
7683
|
+
C = $e(z), R = o ? !L.some((d) => ne(z, d)) : C;
|
|
7684
|
+
} else o ? (R = (await Promise.all(L.map(async (z) => {
|
|
7665
7685
|
const d = ne(r, z);
|
|
7666
7686
|
return await V(d && d._f ? { [z]: d } : d);
|
|
7667
|
-
}))).every(Boolean), !(!R && !t.isValid) &&
|
|
7687
|
+
}))).every(Boolean), !(!R && !t.isValid) && A()) : R = C = await V(r);
|
|
7668
7688
|
return p.state.next({
|
|
7669
7689
|
...!He(o) || (M.isValid || m.isValid) && C !== t.isValid ? {} : { name: o },
|
|
7670
7690
|
...a.resolver || !o ? { isValid: C } : {},
|
|
7671
7691
|
errors: t.errors
|
|
7672
|
-
}), y.shouldFocus && !R && tt(r,
|
|
7692
|
+
}), y.shouldFocus && !R && tt(r, K, o ? L : c.mount), R;
|
|
7673
7693
|
}, se = (o, y) => {
|
|
7674
7694
|
let C = {
|
|
7675
7695
|
...l.mount ? s : i
|
|
@@ -7681,12 +7701,12 @@ function lr(e = {}) {
|
|
|
7681
7701
|
error: ne((y || t).errors, o),
|
|
7682
7702
|
isValidating: !!ne(t.validatingFields, o),
|
|
7683
7703
|
isTouched: !!ne((y || t).touchedFields, o)
|
|
7684
|
-
}),
|
|
7685
|
-
o && et(o).forEach((y) =>
|
|
7704
|
+
}), j = (o) => {
|
|
7705
|
+
o && et(o).forEach((y) => Ae(t.errors, y)), p.state.next({
|
|
7686
7706
|
errors: o ? t.errors : {}
|
|
7687
7707
|
});
|
|
7688
7708
|
}, Q = (o, y, C) => {
|
|
7689
|
-
const R = (ne(r, o, { _f: {} })._f || {}).ref,
|
|
7709
|
+
const R = (ne(r, o, { _f: {} })._f || {}).ref, L = ne(t.errors, o) || {}, { ref: z, message: d, type: D, ...x } = L;
|
|
7690
7710
|
Me(t.errors, o, {
|
|
7691
7711
|
...x,
|
|
7692
7712
|
...y,
|
|
@@ -7697,8 +7717,8 @@ function lr(e = {}) {
|
|
|
7697
7717
|
isValid: !1
|
|
7698
7718
|
}), C && C.shouldFocus && R && R.focus && R.focus();
|
|
7699
7719
|
}, ee = (o, y) => Re(o) ? p.state.subscribe({
|
|
7700
|
-
next: (C) => "values" in C && o(
|
|
7701
|
-
}) :
|
|
7720
|
+
next: (C) => "values" in C && o(W(void 0, y), C)
|
|
7721
|
+
}) : W(o, y, !0), ce = (o) => p.state.subscribe({
|
|
7702
7722
|
next: (y) => {
|
|
7703
7723
|
ar(o.name, y.name, o.exact) && tr(y, o.formState || M, Ne, o.reRenderRoot) && o.callback({
|
|
7704
7724
|
values: { ...s },
|
|
@@ -7718,17 +7738,17 @@ function lr(e = {}) {
|
|
|
7718
7738
|
}
|
|
7719
7739
|
})), ie = (o, y = {}) => {
|
|
7720
7740
|
for (const C of o ? et(o) : c.mount)
|
|
7721
|
-
c.mount.delete(C), c.array.delete(C), y.keepValue || (
|
|
7741
|
+
c.mount.delete(C), c.array.delete(C), y.keepValue || (Ae(r, C), Ae(s, C)), !y.keepError && Ae(t.errors, C), !y.keepDirty && Ae(t.dirtyFields, C), !y.keepTouched && Ae(t.touchedFields, C), !y.keepIsValidating && Ae(t.validatingFields, C), !a.shouldUnregister && !y.keepDefaultValue && Ae(i, C);
|
|
7722
7742
|
p.state.next({
|
|
7723
|
-
values:
|
|
7743
|
+
values: Ee(s)
|
|
7724
7744
|
}), p.state.next({
|
|
7725
7745
|
...t,
|
|
7726
|
-
...y.keepDirty ? { isDirty:
|
|
7727
|
-
}), !y.keepIsValid &&
|
|
7746
|
+
...y.keepDirty ? { isDirty: O() } : {}
|
|
7747
|
+
}), !y.keepIsValid && A();
|
|
7728
7748
|
}, J = ({ disabled: o, name: y }) => {
|
|
7729
7749
|
if (Pe(o) && l.mount || o || c.disabled.has(y)) {
|
|
7730
|
-
const
|
|
7731
|
-
o ? c.disabled.add(y) : c.disabled.delete(y),
|
|
7750
|
+
const L = c.disabled.has(y) !== !!o;
|
|
7751
|
+
o ? c.disabled.add(y) : c.disabled.delete(y), L && l.mount && !l.action && A();
|
|
7732
7752
|
}
|
|
7733
7753
|
}, he = (o, y = {}) => {
|
|
7734
7754
|
let C = ne(r, o);
|
|
@@ -7757,10 +7777,10 @@ function lr(e = {}) {
|
|
|
7757
7777
|
name: o,
|
|
7758
7778
|
onChange: H,
|
|
7759
7779
|
onBlur: H,
|
|
7760
|
-
ref: (
|
|
7761
|
-
if (
|
|
7780
|
+
ref: (L) => {
|
|
7781
|
+
if (L) {
|
|
7762
7782
|
he(o, y), C = ne(r, o);
|
|
7763
|
-
const z = xe(
|
|
7783
|
+
const z = xe(L.value) && L.querySelectorAll && L.querySelectorAll("input,select,textarea")[0] || L, d = Yn(z), D = C._f.refs || [];
|
|
7764
7784
|
if (d ? D.find((x) => x === z) : z === C._f.ref)
|
|
7765
7785
|
return;
|
|
7766
7786
|
Me(r, o, {
|
|
@@ -7777,36 +7797,36 @@ function lr(e = {}) {
|
|
|
7777
7797
|
}
|
|
7778
7798
|
}), f(o, !1, void 0, z);
|
|
7779
7799
|
} else
|
|
7780
|
-
C = ne(r, o, {}), C._f && (C._f.mount = !1), (a.shouldUnregister || y.shouldUnregister) && !(
|
|
7800
|
+
C = ne(r, o, {}), C._f && (C._f.mount = !1), (a.shouldUnregister || y.shouldUnregister) && !(Ta(c.array, o) && l.action) && c.unMount.add(o);
|
|
7781
7801
|
}
|
|
7782
7802
|
};
|
|
7783
|
-
}, ve = () => a.shouldFocusError && tt(r,
|
|
7803
|
+
}, ve = () => a.shouldFocusError && tt(r, K, c.mount), fe = (o) => {
|
|
7784
7804
|
Pe(o) && (p.state.next({ disabled: o }), tt(r, (y, C) => {
|
|
7785
7805
|
const R = ne(r, C);
|
|
7786
|
-
R && (y.disabled = R._f.disabled || o, Array.isArray(R._f.refs) && R._f.refs.forEach((
|
|
7787
|
-
|
|
7806
|
+
R && (y.disabled = R._f.disabled || o, Array.isArray(R._f.refs) && R._f.refs.forEach((L) => {
|
|
7807
|
+
L.disabled = R._f.disabled || o;
|
|
7788
7808
|
}));
|
|
7789
7809
|
}, 0, !1));
|
|
7790
7810
|
}, pe = (o, y) => async (C) => {
|
|
7791
7811
|
let R;
|
|
7792
7812
|
C && (C.preventDefault && C.preventDefault(), C.persist && C.persist());
|
|
7793
|
-
let
|
|
7813
|
+
let L = Ee(s);
|
|
7794
7814
|
if (p.state.next({
|
|
7795
7815
|
isSubmitting: !0
|
|
7796
7816
|
}), a.resolver) {
|
|
7797
|
-
const { errors: z, values: d } = await
|
|
7798
|
-
F(), t.errors = z,
|
|
7817
|
+
const { errors: z, values: d } = await Y();
|
|
7818
|
+
F(), t.errors = z, L = Ee(d);
|
|
7799
7819
|
} else
|
|
7800
7820
|
await V(r);
|
|
7801
7821
|
if (c.disabled.size)
|
|
7802
7822
|
for (const z of c.disabled)
|
|
7803
|
-
|
|
7804
|
-
if (
|
|
7823
|
+
Ae(L, z);
|
|
7824
|
+
if (Ae(t.errors, "root"), $e(t.errors)) {
|
|
7805
7825
|
p.state.next({
|
|
7806
7826
|
errors: {}
|
|
7807
7827
|
});
|
|
7808
7828
|
try {
|
|
7809
|
-
await o(
|
|
7829
|
+
await o(L, C);
|
|
7810
7830
|
} catch (z) {
|
|
7811
7831
|
R = z;
|
|
7812
7832
|
}
|
|
@@ -7821,9 +7841,9 @@ function lr(e = {}) {
|
|
|
7821
7841
|
}), R)
|
|
7822
7842
|
throw R;
|
|
7823
7843
|
}, Ce = (o, y = {}) => {
|
|
7824
|
-
ne(r, o) && (xe(y.defaultValue) ? X(o,
|
|
7844
|
+
ne(r, o) && (xe(y.defaultValue) ? X(o, Ee(ne(i, o))) : (X(o, y.defaultValue), Me(i, o, Ee(y.defaultValue))), y.keepTouched || Ae(t.touchedFields, o), y.keepDirty || (Ae(t.dirtyFields, o), t.isDirty = y.defaultValue ? O(o, Ee(ne(i, o))) : O()), y.keepError || (Ae(t.errors, o), M.isValid && A()), p.state.next({ ...t }));
|
|
7825
7845
|
}, be = (o, y = {}) => {
|
|
7826
|
-
const C = o ?
|
|
7846
|
+
const C = o ? Ee(o) : i, R = Ee(C), L = $e(o), z = L ? i : R;
|
|
7827
7847
|
if (y.keepDefaultValues || (i = C), !y.keepValues) {
|
|
7828
7848
|
if (y.keepDirtyValues) {
|
|
7829
7849
|
const d = /* @__PURE__ */ new Set([
|
|
@@ -7855,7 +7875,7 @@ function lr(e = {}) {
|
|
|
7855
7875
|
else
|
|
7856
7876
|
r = {};
|
|
7857
7877
|
}
|
|
7858
|
-
s = a.shouldUnregister ? y.keepDefaultValues ?
|
|
7878
|
+
s = a.shouldUnregister ? y.keepDefaultValues ? Ee(i) : {} : Ee(z), p.array.next({
|
|
7859
7879
|
values: { ...z }
|
|
7860
7880
|
}), p.state.next({
|
|
7861
7881
|
values: { ...z }
|
|
@@ -7871,9 +7891,9 @@ function lr(e = {}) {
|
|
|
7871
7891
|
focus: ""
|
|
7872
7892
|
}, l.mount = !M.isValid || !!y.keepIsValid || !!y.keepDirtyValues || !a.shouldUnregister && !$e(z), l.watch = !!a.shouldUnregister, l.keepIsValid = !!y.keepIsValid, l.action = !1, y.keepErrors || (t.errors = {}), p.state.next({
|
|
7873
7893
|
submitCount: y.keepSubmitCount ? t.submitCount : 0,
|
|
7874
|
-
isDirty:
|
|
7894
|
+
isDirty: L ? !1 : y.keepDirty ? t.isDirty : !!(y.keepDefaultValues && !Ue(o, i)),
|
|
7875
7895
|
isSubmitted: y.keepIsSubmitted ? t.isSubmitted : !1,
|
|
7876
|
-
dirtyFields:
|
|
7896
|
+
dirtyFields: L ? {} : y.keepDirtyValues ? y.keepDefaultValues && s ? Ze(i, s) : t.dirtyFields : y.keepDefaultValues && o ? Ze(i, o) : y.keepDirty ? t.dirtyFields : {},
|
|
7877
7897
|
touchedFields: y.keepTouched ? t.touchedFields : {},
|
|
7878
7898
|
errors: y.keepErrors ? t.errors : {},
|
|
7879
7899
|
isSubmitSuccessful: y.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
@@ -7883,9 +7903,9 @@ function lr(e = {}) {
|
|
|
7883
7903
|
}, we = (o, y) => be(Re(o) ? o(s) : o, { ...a.resetOptions, ...y }), ke = (o, y = {}) => {
|
|
7884
7904
|
const C = ne(r, o), R = C && C._f;
|
|
7885
7905
|
if (R) {
|
|
7886
|
-
const
|
|
7887
|
-
|
|
7888
|
-
|
|
7906
|
+
const L = R.refs ? R.refs[0] : R.ref;
|
|
7907
|
+
L.focus && setTimeout(() => {
|
|
7908
|
+
L.focus(), y.shouldSelect && Re(L.select) && L.select();
|
|
7889
7909
|
});
|
|
7890
7910
|
}
|
|
7891
7911
|
}, Ne = (o) => {
|
|
@@ -7901,12 +7921,12 @@ function lr(e = {}) {
|
|
|
7901
7921
|
handleSubmit: pe,
|
|
7902
7922
|
setError: Q,
|
|
7903
7923
|
_subscribe: ce,
|
|
7904
|
-
_runSchema:
|
|
7924
|
+
_runSchema: Y,
|
|
7905
7925
|
_updateIsValidating: F,
|
|
7906
7926
|
_focusError: ve,
|
|
7907
|
-
_getWatch:
|
|
7908
|
-
_getDirty:
|
|
7909
|
-
_setValid:
|
|
7927
|
+
_getWatch: W,
|
|
7928
|
+
_getDirty: O,
|
|
7929
|
+
_setValid: A,
|
|
7910
7930
|
_setFieldArray: N,
|
|
7911
7931
|
_setDisabledField: J,
|
|
7912
7932
|
_setErrors: _,
|
|
@@ -7917,7 +7937,7 @@ function lr(e = {}) {
|
|
|
7917
7937
|
isLoading: !1
|
|
7918
7938
|
});
|
|
7919
7939
|
}),
|
|
7920
|
-
_removeUnmounted:
|
|
7940
|
+
_removeUnmounted: G,
|
|
7921
7941
|
_disableForm: fe,
|
|
7922
7942
|
_subjects: p,
|
|
7923
7943
|
_proxyFormState: M,
|
|
@@ -7964,7 +7984,7 @@ function lr(e = {}) {
|
|
|
7964
7984
|
getValues: se,
|
|
7965
7985
|
reset: we,
|
|
7966
7986
|
resetField: Ce,
|
|
7967
|
-
clearErrors:
|
|
7987
|
+
clearErrors: j,
|
|
7968
7988
|
unregister: ie,
|
|
7969
7989
|
setError: Q,
|
|
7970
7990
|
setFocus: ke,
|
|
@@ -8040,7 +8060,7 @@ function or(e = {}) {
|
|
|
8040
8060
|
}), !((l = s._options.resetOptions) === null || l === void 0) && l.keepIsValid || s._setValid(), t.current = e.values, i((c) => ({ ...c }))) : s._resetDefaultValues();
|
|
8041
8061
|
}, [s, e.values]), ge.useEffect(() => {
|
|
8042
8062
|
s._state.mount || (s._setValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
|
|
8043
|
-
}), a.current.formState = ge.useMemo(() =>
|
|
8063
|
+
}), a.current.formState = ge.useMemo(() => La(r, s), [s, r]), a.current;
|
|
8044
8064
|
}
|
|
8045
8065
|
function _s(e) {
|
|
8046
8066
|
return or(e);
|
|
@@ -8100,8 +8120,8 @@ function ca({
|
|
|
8100
8120
|
disabledFutureYear: m = !1,
|
|
8101
8121
|
disabledYearBefore: p,
|
|
8102
8122
|
disabledYearAfter: I,
|
|
8103
|
-
showIcon:
|
|
8104
|
-
showClearButton:
|
|
8123
|
+
showIcon: E = !1,
|
|
8124
|
+
showClearButton: A = !1,
|
|
8105
8125
|
onClear: F,
|
|
8106
8126
|
size: N = "md"
|
|
8107
8127
|
}) {
|
|
@@ -8118,7 +8138,7 @@ function ca({
|
|
|
8118
8138
|
};
|
|
8119
8139
|
return J(), window.addEventListener("resize", J), () => window.removeEventListener("resize", J);
|
|
8120
8140
|
}, [s]);
|
|
8121
|
-
const
|
|
8141
|
+
const T = Fe(() => Math.floor(k / _) * _, [k, _]), [$, Y] = Z(h), [B, V] = Z(null), [G, O] = Z(!1), [W, ae] = Z({}), ue = le(null), te = le(null), X = le(null), H = me(
|
|
8122
8142
|
(J) => {
|
|
8123
8143
|
const he = (/* @__PURE__ */ new Date()).getFullYear();
|
|
8124
8144
|
if (M && J < he || m && J > he)
|
|
@@ -8141,31 +8161,31 @@ function ca({
|
|
|
8141
8161
|
p,
|
|
8142
8162
|
I
|
|
8143
8163
|
]
|
|
8144
|
-
),
|
|
8145
|
-
const J = [], he =
|
|
8164
|
+
), K = Fe(() => {
|
|
8165
|
+
const J = [], he = T, ve = Math.min(T + _ - 1, i);
|
|
8146
8166
|
for (let fe = he; fe <= ve; fe++)
|
|
8147
8167
|
fe >= r && J.push(fe);
|
|
8148
8168
|
return J;
|
|
8149
|
-
}, [
|
|
8169
|
+
}, [T, _, r, i]), P = me(
|
|
8150
8170
|
(J) => {
|
|
8151
|
-
const he = J === "prev" ? Math.max(
|
|
8152
|
-
|
|
8171
|
+
const he = J === "prev" ? Math.max(T - _, r) : Math.min(
|
|
8172
|
+
T + _,
|
|
8153
8173
|
i - _ + 1
|
|
8154
8174
|
), ve = Math.max(he, r);
|
|
8155
8175
|
t == null || t(ve);
|
|
8156
8176
|
},
|
|
8157
|
-
[
|
|
8177
|
+
[T, _, r, i, t]
|
|
8158
8178
|
), se = me(
|
|
8159
8179
|
(J) => {
|
|
8160
|
-
t == null || t(J),
|
|
8180
|
+
t == null || t(J), Y(!1), u == null || u(!1);
|
|
8161
8181
|
},
|
|
8162
8182
|
[t, u]
|
|
8163
8183
|
), q = me(() => {
|
|
8164
8184
|
if (c) return;
|
|
8165
8185
|
const J = !$;
|
|
8166
|
-
|
|
8167
|
-
}, [c, $, u]),
|
|
8168
|
-
|
|
8186
|
+
Y(J), u == null || u(J);
|
|
8187
|
+
}, [c, $, u]), j = me(() => {
|
|
8188
|
+
Y(!1), u == null || u(!1);
|
|
8169
8189
|
}, [u]), Q = me(
|
|
8170
8190
|
(J) => {
|
|
8171
8191
|
J.stopPropagation(), F ? F() : t == null || t((/* @__PURE__ */ new Date()).getFullYear());
|
|
@@ -8180,8 +8200,8 @@ function ca({
|
|
|
8180
8200
|
let Ne, Ve, Ie = !1;
|
|
8181
8201
|
Ie = we > ke, Ie ? (Ve = 0, Ne = void 0) : (Ne = 0, Ve = void 0);
|
|
8182
8202
|
const o = Ce - ve.bottom, y = ve.top;
|
|
8183
|
-
let C, R,
|
|
8184
|
-
o < fe.height && y > o ? (R = ve.height + 4, C = void 0,
|
|
8203
|
+
let C, R, L = "400px";
|
|
8204
|
+
o < fe.height && y > o ? (R = ve.height + 4, C = void 0, L = `${Math.min(y - 10, 400)}px`) : (C = ve.height + 4, R = void 0, L = `${Math.min(o - 10, 400)}px`);
|
|
8185
8205
|
const z = `${Math.min(we, pe - 16)}px`;
|
|
8186
8206
|
ae({
|
|
8187
8207
|
position: "absolute",
|
|
@@ -8190,10 +8210,10 @@ function ca({
|
|
|
8190
8210
|
left: Ne !== void 0 ? `${Ne}px` : void 0,
|
|
8191
8211
|
right: Ve !== void 0 ? `${Ve}px` : void 0,
|
|
8192
8212
|
maxWidth: z,
|
|
8193
|
-
maxHeight:
|
|
8213
|
+
maxHeight: L,
|
|
8194
8214
|
zIndex: 10006
|
|
8195
8215
|
// Higher than MonthPicker panel (10005) and DatePicker panel (10004)
|
|
8196
|
-
}),
|
|
8216
|
+
}), O(Ie);
|
|
8197
8217
|
};
|
|
8198
8218
|
requestAnimationFrame(() => {
|
|
8199
8219
|
setTimeout(J, 0);
|
|
@@ -8205,16 +8225,16 @@ function ca({
|
|
|
8205
8225
|
window.removeEventListener("resize", he), window.removeEventListener("scroll", he, !0);
|
|
8206
8226
|
};
|
|
8207
8227
|
} else
|
|
8208
|
-
|
|
8228
|
+
O(!1), ae({});
|
|
8209
8229
|
}, [$]), oe(() => {
|
|
8210
8230
|
const J = (he) => {
|
|
8211
|
-
ue.current && !ue.current.contains(he.target) &&
|
|
8231
|
+
ue.current && !ue.current.contains(he.target) && j();
|
|
8212
8232
|
};
|
|
8213
8233
|
if ($)
|
|
8214
8234
|
return document.addEventListener("mousedown", J), () => document.removeEventListener("mousedown", J);
|
|
8215
|
-
}, [$,
|
|
8216
|
-
const ee = `${
|
|
8217
|
-
|
|
8235
|
+
}, [$, j]);
|
|
8236
|
+
const ee = `${T} - ${Math.min(
|
|
8237
|
+
T + _ - 1,
|
|
8218
8238
|
i
|
|
8219
8239
|
)}`, ce = S("ina-year-picker", l), _e = S(
|
|
8220
8240
|
"ina-year-picker__trigger",
|
|
@@ -8226,7 +8246,7 @@ function ca({
|
|
|
8226
8246
|
$ && "ina-year-picker__panel--open"
|
|
8227
8247
|
);
|
|
8228
8248
|
return oe(() => {
|
|
8229
|
-
|
|
8249
|
+
Y(h);
|
|
8230
8250
|
}, [h]), /* @__PURE__ */ w("div", { ref: ue, className: ce, children: [
|
|
8231
8251
|
/* @__PURE__ */ w(
|
|
8232
8252
|
"button",
|
|
@@ -8239,12 +8259,12 @@ function ca({
|
|
|
8239
8259
|
"aria-expanded": $,
|
|
8240
8260
|
"aria-haspopup": "listbox",
|
|
8241
8261
|
onKeyDown: (J) => {
|
|
8242
|
-
J.key === "Enter" || J.key === " " ? (J.preventDefault(), q()) : J.key === "Escape" && $ && (J.preventDefault(),
|
|
8262
|
+
J.key === "Enter" || J.key === " " ? (J.preventDefault(), q()) : J.key === "Escape" && $ && (J.preventDefault(), j());
|
|
8243
8263
|
},
|
|
8244
8264
|
children: [
|
|
8245
|
-
|
|
8265
|
+
E && /* @__PURE__ */ n(Ut, { size: 16, className: "ina-year-picker__icon" }),
|
|
8246
8266
|
/* @__PURE__ */ n("span", { className: "ina-year-picker__trigger-text", children: k }),
|
|
8247
|
-
|
|
8267
|
+
A && (e !== void 0 || a !== void 0) && /* @__PURE__ */ n(
|
|
8248
8268
|
"button",
|
|
8249
8269
|
{
|
|
8250
8270
|
type: "button",
|
|
@@ -8252,7 +8272,7 @@ function ca({
|
|
|
8252
8272
|
className: "ina-year-picker__clear-button",
|
|
8253
8273
|
"aria-label": "Clear year",
|
|
8254
8274
|
disabled: c,
|
|
8255
|
-
children: /* @__PURE__ */ n(
|
|
8275
|
+
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-year-picker__clear-icon" })
|
|
8256
8276
|
}
|
|
8257
8277
|
),
|
|
8258
8278
|
/* @__PURE__ */ n(
|
|
@@ -8288,9 +8308,9 @@ function ca({
|
|
|
8288
8308
|
ref: X,
|
|
8289
8309
|
className: S(
|
|
8290
8310
|
ie,
|
|
8291
|
-
|
|
8311
|
+
G && "ina-year-picker__panel--right-aligned"
|
|
8292
8312
|
),
|
|
8293
|
-
style:
|
|
8313
|
+
style: W,
|
|
8294
8314
|
children: [
|
|
8295
8315
|
/* @__PURE__ */ w("div", { className: "ina-year-picker__header", children: [
|
|
8296
8316
|
/* @__PURE__ */ n(
|
|
@@ -8302,7 +8322,7 @@ function ca({
|
|
|
8302
8322
|
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), P("prev"));
|
|
8303
8323
|
},
|
|
8304
8324
|
className: "ina-year-picker__nav-button",
|
|
8305
|
-
disabled:
|
|
8325
|
+
disabled: T <= r,
|
|
8306
8326
|
"aria-label": "Previous decade",
|
|
8307
8327
|
children: /* @__PURE__ */ n(
|
|
8308
8328
|
ut,
|
|
@@ -8323,7 +8343,7 @@ function ca({
|
|
|
8323
8343
|
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), P("next"));
|
|
8324
8344
|
},
|
|
8325
8345
|
className: "ina-year-picker__nav-button",
|
|
8326
|
-
disabled:
|
|
8346
|
+
disabled: T + _ > i,
|
|
8327
8347
|
"aria-label": "Next decade",
|
|
8328
8348
|
children: /* @__PURE__ */ n(
|
|
8329
8349
|
nt,
|
|
@@ -8335,8 +8355,8 @@ function ca({
|
|
|
8335
8355
|
}
|
|
8336
8356
|
)
|
|
8337
8357
|
] }),
|
|
8338
|
-
/* @__PURE__ */ n("div", { className: "ina-year-picker__grid", children:
|
|
8339
|
-
const ve = J === k, fe = J === B, pe = H(J), Ce = ve || !
|
|
8358
|
+
/* @__PURE__ */ n("div", { className: "ina-year-picker__grid", children: K.map((J, he) => {
|
|
8359
|
+
const ve = J === k, fe = J === B, pe = H(J), Ce = ve || !K.includes(k) && he === 0;
|
|
8340
8360
|
return /* @__PURE__ */ n(
|
|
8341
8361
|
"button",
|
|
8342
8362
|
{
|
|
@@ -8408,8 +8428,8 @@ function da({
|
|
|
8408
8428
|
disabledMonthAfter: m,
|
|
8409
8429
|
showIcon: p = !1,
|
|
8410
8430
|
showClearButton: I = !1,
|
|
8411
|
-
onClear:
|
|
8412
|
-
size:
|
|
8431
|
+
onClear: E,
|
|
8432
|
+
size: A = "md"
|
|
8413
8433
|
}) {
|
|
8414
8434
|
const F = Fe(() => b === "id" ? [
|
|
8415
8435
|
"Jan",
|
|
@@ -8440,10 +8460,10 @@ function da({
|
|
|
8440
8460
|
], [b]), N = Fe(() => {
|
|
8441
8461
|
const q = e ?? a ?? (/* @__PURE__ */ new Date()).getMonth();
|
|
8442
8462
|
return q == null || isNaN(q) ? (/* @__PURE__ */ new Date()).getMonth() : q;
|
|
8443
|
-
}, [e, a]), [k, _] = Z(l), [f,
|
|
8463
|
+
}, [e, a]), [k, _] = Z(l), [f, T] = Z(null), [$, Y] = Z(!1), [B, V] = Z({}), G = le(null), O = le(null), W = le(null), ae = me(
|
|
8444
8464
|
(q) => {
|
|
8445
|
-
const
|
|
8446
|
-
return !!(h && q <
|
|
8465
|
+
const j = (/* @__PURE__ */ new Date()).getMonth();
|
|
8466
|
+
return !!(h && q < j || u && q > j || M !== void 0 && q < M || m !== void 0 && q > m);
|
|
8447
8467
|
},
|
|
8448
8468
|
[
|
|
8449
8469
|
h,
|
|
@@ -8464,15 +8484,15 @@ function da({
|
|
|
8464
8484
|
_(!1), c == null || c(!1);
|
|
8465
8485
|
}, [c]), H = me(
|
|
8466
8486
|
(q) => {
|
|
8467
|
-
q.stopPropagation(),
|
|
8487
|
+
q.stopPropagation(), E ? E() : t == null || t((/* @__PURE__ */ new Date()).getMonth());
|
|
8468
8488
|
},
|
|
8469
|
-
[
|
|
8489
|
+
[E, t]
|
|
8470
8490
|
);
|
|
8471
8491
|
oe(() => {
|
|
8472
|
-
if (k &&
|
|
8492
|
+
if (k && O.current) {
|
|
8473
8493
|
const q = () => {
|
|
8474
|
-
if (!
|
|
8475
|
-
const Q =
|
|
8494
|
+
if (!O.current || !W.current) return;
|
|
8495
|
+
const Q = O.current.getBoundingClientRect(), ee = W.current.getBoundingClientRect(), ce = window.innerWidth, _e = window.innerHeight, J = ee.width || 240, he = ce - Q.right;
|
|
8476
8496
|
let ve, fe, pe = !1;
|
|
8477
8497
|
pe = J > he, pe ? (fe = 0, ve = void 0) : (ve = 0, fe = void 0);
|
|
8478
8498
|
const Ce = _e - Q.bottom, be = Q.top;
|
|
@@ -8489,29 +8509,29 @@ function da({
|
|
|
8489
8509
|
maxHeight: Ne,
|
|
8490
8510
|
zIndex: 10005
|
|
8491
8511
|
// Higher than DatePicker panel (10004)
|
|
8492
|
-
}),
|
|
8512
|
+
}), Y(pe);
|
|
8493
8513
|
};
|
|
8494
8514
|
requestAnimationFrame(() => {
|
|
8495
8515
|
setTimeout(q, 0);
|
|
8496
8516
|
});
|
|
8497
|
-
const
|
|
8498
|
-
|
|
8517
|
+
const j = () => {
|
|
8518
|
+
O.current && W.current && q();
|
|
8499
8519
|
};
|
|
8500
|
-
return window.addEventListener("resize",
|
|
8501
|
-
window.removeEventListener("resize",
|
|
8520
|
+
return window.addEventListener("resize", j), window.addEventListener("scroll", j, !0), () => {
|
|
8521
|
+
window.removeEventListener("resize", j), window.removeEventListener("scroll", j, !0);
|
|
8502
8522
|
};
|
|
8503
8523
|
} else
|
|
8504
|
-
|
|
8524
|
+
Y(!1), V({});
|
|
8505
8525
|
}, [k]), oe(() => {
|
|
8506
|
-
const q = (
|
|
8507
|
-
|
|
8526
|
+
const q = (j) => {
|
|
8527
|
+
G.current && !G.current.contains(j.target) && X();
|
|
8508
8528
|
};
|
|
8509
8529
|
if (k)
|
|
8510
8530
|
return document.addEventListener("mousedown", q), () => document.removeEventListener("mousedown", q);
|
|
8511
8531
|
}, [k, X]);
|
|
8512
|
-
const
|
|
8532
|
+
const K = S("ina-month-picker", r), P = S(
|
|
8513
8533
|
"ina-month-picker__trigger",
|
|
8514
|
-
`ina-month-picker__trigger--size-${
|
|
8534
|
+
`ina-month-picker__trigger--size-${A}`,
|
|
8515
8535
|
i && "ina-month-picker__trigger--disabled",
|
|
8516
8536
|
s && "ina-month-picker__trigger--readonly"
|
|
8517
8537
|
), se = S(
|
|
@@ -8520,11 +8540,11 @@ function da({
|
|
|
8520
8540
|
);
|
|
8521
8541
|
return oe(() => {
|
|
8522
8542
|
_(l);
|
|
8523
|
-
}, [l]), /* @__PURE__ */ w("div", { ref:
|
|
8543
|
+
}, [l]), /* @__PURE__ */ w("div", { ref: G, className: K, children: [
|
|
8524
8544
|
/* @__PURE__ */ w(
|
|
8525
8545
|
"button",
|
|
8526
8546
|
{
|
|
8527
|
-
ref:
|
|
8547
|
+
ref: O,
|
|
8528
8548
|
type: "button",
|
|
8529
8549
|
onClick: te,
|
|
8530
8550
|
className: P,
|
|
@@ -8545,7 +8565,7 @@ function da({
|
|
|
8545
8565
|
className: "ina-month-picker__clear-button",
|
|
8546
8566
|
disabled: i,
|
|
8547
8567
|
"aria-label": "Clear month",
|
|
8548
|
-
children: /* @__PURE__ */ n(
|
|
8568
|
+
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-month-picker__clear-icon" })
|
|
8549
8569
|
}
|
|
8550
8570
|
),
|
|
8551
8571
|
/* @__PURE__ */ n(
|
|
@@ -8578,27 +8598,27 @@ function da({
|
|
|
8578
8598
|
k && /* @__PURE__ */ n(
|
|
8579
8599
|
"div",
|
|
8580
8600
|
{
|
|
8581
|
-
ref:
|
|
8601
|
+
ref: W,
|
|
8582
8602
|
className: S(
|
|
8583
8603
|
se,
|
|
8584
8604
|
$ && "ina-month-picker__panel--right-aligned"
|
|
8585
8605
|
),
|
|
8586
8606
|
style: B,
|
|
8587
|
-
children: /* @__PURE__ */ n("div", { className: "ina-month-picker__grid", children: F.map((q,
|
|
8588
|
-
const Q =
|
|
8607
|
+
children: /* @__PURE__ */ n("div", { className: "ina-month-picker__grid", children: F.map((q, j) => {
|
|
8608
|
+
const Q = j === N, ee = j === f, ce = ae(j);
|
|
8589
8609
|
return /* @__PURE__ */ n(
|
|
8590
8610
|
"button",
|
|
8591
8611
|
{
|
|
8592
8612
|
type: "button",
|
|
8593
8613
|
role: "option",
|
|
8594
8614
|
"aria-selected": Q,
|
|
8595
|
-
tabIndex: Q || !N &&
|
|
8596
|
-
onClick: () => !ce && ue(
|
|
8615
|
+
tabIndex: Q || !N && j === 0 ? 0 : -1,
|
|
8616
|
+
onClick: () => !ce && ue(j),
|
|
8597
8617
|
onKeyDown: (ie) => {
|
|
8598
8618
|
var J, he;
|
|
8599
8619
|
if (!ce) {
|
|
8600
8620
|
if (ie.key === "Enter" || ie.key === " ")
|
|
8601
|
-
ie.preventDefault(), ue(
|
|
8621
|
+
ie.preventDefault(), ue(j);
|
|
8602
8622
|
else if (ie.key === "ArrowRight") {
|
|
8603
8623
|
ie.preventDefault();
|
|
8604
8624
|
const ve = ie.currentTarget.nextElementSibling;
|
|
@@ -8611,19 +8631,19 @@ function da({
|
|
|
8611
8631
|
ie.preventDefault();
|
|
8612
8632
|
const fe = Array.from(
|
|
8613
8633
|
((J = ie.currentTarget.parentElement) == null ? void 0 : J.children) || []
|
|
8614
|
-
)[
|
|
8634
|
+
)[j + 4];
|
|
8615
8635
|
fe && fe.focus();
|
|
8616
8636
|
} else if (ie.key === "ArrowUp") {
|
|
8617
8637
|
ie.preventDefault();
|
|
8618
8638
|
const fe = Array.from(
|
|
8619
8639
|
((he = ie.currentTarget.parentElement) == null ? void 0 : he.children) || []
|
|
8620
|
-
)[
|
|
8640
|
+
)[j - 4];
|
|
8621
8641
|
fe && fe.focus();
|
|
8622
8642
|
}
|
|
8623
8643
|
}
|
|
8624
8644
|
},
|
|
8625
|
-
onMouseEnter: () => !ce &&
|
|
8626
|
-
onMouseLeave: () =>
|
|
8645
|
+
onMouseEnter: () => !ce && T(j),
|
|
8646
|
+
onMouseLeave: () => T(null),
|
|
8627
8647
|
className: S(
|
|
8628
8648
|
"ina-month-picker__month-option",
|
|
8629
8649
|
Q && "ina-month-picker__month-option--selected",
|
|
@@ -8633,7 +8653,7 @@ function da({
|
|
|
8633
8653
|
disabled: i || ce,
|
|
8634
8654
|
children: q
|
|
8635
8655
|
},
|
|
8636
|
-
|
|
8656
|
+
j
|
|
8637
8657
|
);
|
|
8638
8658
|
}) })
|
|
8639
8659
|
}
|
|
@@ -8673,32 +8693,32 @@ const Oa = [
|
|
|
8673
8693
|
if (!e) return null;
|
|
8674
8694
|
const t = ["/", "-", ".", " "];
|
|
8675
8695
|
let r = [], i = "";
|
|
8676
|
-
for (const
|
|
8677
|
-
if (e.includes(
|
|
8678
|
-
r = e.split(
|
|
8696
|
+
for (const A of t)
|
|
8697
|
+
if (e.includes(A)) {
|
|
8698
|
+
r = e.split(A), i = A;
|
|
8679
8699
|
break;
|
|
8680
8700
|
}
|
|
8681
8701
|
if (r.length !== 3)
|
|
8682
8702
|
return null;
|
|
8683
8703
|
const s = a.split(i || "/");
|
|
8684
8704
|
let l = -1, c = -1, b = -1;
|
|
8685
|
-
if (s.forEach((
|
|
8686
|
-
|
|
8705
|
+
if (s.forEach((A, F) => {
|
|
8706
|
+
A.includes("dd") || A.includes("DD") ? l = F : A.includes("MM") && !A.includes("MMM") ? c = F : A.includes("yyyy") || A.includes("YYYY") ? b = F : (A.includes("MMMM") || A.includes("MMM")) && (c = F);
|
|
8687
8707
|
}), l === -1 || c === -1 || b === -1) {
|
|
8688
|
-
const
|
|
8708
|
+
const A = parseInt(r[0], 10), F = parseInt(r[1], 10) - 1, N = parseInt(r[2], 10), k = new Date(N, F, A);
|
|
8689
8709
|
return isNaN(k.getTime()) ? null : k;
|
|
8690
8710
|
}
|
|
8691
8711
|
const h = parseInt(r[l], 10), u = parseInt(r[b], 10);
|
|
8692
8712
|
let M;
|
|
8693
8713
|
const m = r[c], p = Oa.findIndex(
|
|
8694
|
-
(
|
|
8714
|
+
(A) => A.toLowerCase() === m.toLowerCase()
|
|
8695
8715
|
), I = Ua.findIndex(
|
|
8696
|
-
(
|
|
8716
|
+
(A) => A.toLowerCase() === m.toLowerCase()
|
|
8697
8717
|
);
|
|
8698
8718
|
p !== -1 ? M = p : I !== -1 ? M = I : M = parseInt(m, 10) - 1;
|
|
8699
|
-
const
|
|
8700
|
-
return isNaN(
|
|
8701
|
-
},
|
|
8719
|
+
const E = new Date(u, M, h);
|
|
8720
|
+
return isNaN(E.getTime()) ? null : E;
|
|
8721
|
+
}, Le = (e, a) => e.getDate() === a.getDate() && e.getMonth() === a.getMonth() && e.getFullYear() === a.getFullYear(), ua = (e, a) => a.some((t) => Le(t, e)), fa = ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"];
|
|
8702
8722
|
function ks({
|
|
8703
8723
|
mode: e = "range",
|
|
8704
8724
|
selected: a,
|
|
@@ -8715,17 +8735,17 @@ function ks({
|
|
|
8715
8735
|
disabledFutureDate: m = !1,
|
|
8716
8736
|
disabledDateBefore: p,
|
|
8717
8737
|
disabledDateAfter: I,
|
|
8718
|
-
disabled:
|
|
8719
|
-
readonly:
|
|
8738
|
+
disabled: E = !1,
|
|
8739
|
+
readonly: A = !1,
|
|
8720
8740
|
size: F = "md",
|
|
8721
8741
|
label: N,
|
|
8722
8742
|
required: k,
|
|
8723
8743
|
panelOnly: _ = !1
|
|
8724
8744
|
}) {
|
|
8725
|
-
const [f,
|
|
8745
|
+
const [f, T] = Z(!1), [$, Y] = Z(/* @__PURE__ */ new Date()), [B, V] = Z(() => {
|
|
8726
8746
|
const d = /* @__PURE__ */ new Date();
|
|
8727
8747
|
return d.setMonth(d.getMonth() + 1), d;
|
|
8728
|
-
}), [
|
|
8748
|
+
}), [G, O] = Z(null), [W, ae] = Z(!1), [ue, te] = Z(c), [X, H] = Z(null), K = le(`datepicker-${Math.random().toString(36).slice(2)}`), P = le(null), se = le(null), q = le(null), j = () => {
|
|
8729
8749
|
if (e === "single") {
|
|
8730
8750
|
const d = ze(a, s);
|
|
8731
8751
|
return d ? [d] : [];
|
|
@@ -8734,11 +8754,11 @@ function ks({
|
|
|
8734
8754
|
return [x, v].filter(Boolean);
|
|
8735
8755
|
} else
|
|
8736
8756
|
return a.map((d) => ze(d, s)).filter(Boolean);
|
|
8737
|
-
}, Q =
|
|
8757
|
+
}, Q = j();
|
|
8738
8758
|
oe(() => {
|
|
8739
8759
|
const d = (D) => {
|
|
8740
8760
|
var x;
|
|
8741
|
-
((x = D.detail) == null ? void 0 : x.exclude) !== P.current && f && (
|
|
8761
|
+
((x = D.detail) == null ? void 0 : x.exclude) !== P.current && f && (T(!1), O(null), H(null));
|
|
8742
8762
|
};
|
|
8743
8763
|
return document.addEventListener(
|
|
8744
8764
|
"closeDatePicker",
|
|
@@ -8752,7 +8772,7 @@ function ks({
|
|
|
8752
8772
|
}, [f]), oe(() => {
|
|
8753
8773
|
const d = (D) => {
|
|
8754
8774
|
const x = D.target;
|
|
8755
|
-
P.current && P.current.contains(x) || (
|
|
8775
|
+
P.current && P.current.contains(x) || (T(!1), O(null), H(null), H(null));
|
|
8756
8776
|
};
|
|
8757
8777
|
if (f && !_)
|
|
8758
8778
|
return document.addEventListener("mousedown", d, !0), () => document.removeEventListener("mousedown", d, !0);
|
|
@@ -8827,7 +8847,7 @@ function ks({
|
|
|
8827
8847
|
]), ce = le(!1);
|
|
8828
8848
|
oe(() => {
|
|
8829
8849
|
if ((f || _) && !ce.current) {
|
|
8830
|
-
const d =
|
|
8850
|
+
const d = j();
|
|
8831
8851
|
let D = null, x = null;
|
|
8832
8852
|
if (e === "range" && d.length >= 2) {
|
|
8833
8853
|
const v = d[0], g = d[1];
|
|
@@ -8858,13 +8878,13 @@ function ks({
|
|
|
8858
8878
|
1
|
|
8859
8879
|
));
|
|
8860
8880
|
}
|
|
8861
|
-
if (D || (D = ee()), D && (
|
|
8881
|
+
if (D || (D = ee()), D && (Y(D), e !== "single")) {
|
|
8862
8882
|
if (x)
|
|
8863
8883
|
V(x);
|
|
8864
8884
|
else if (e === "multiple") {
|
|
8865
8885
|
const v = new Date(D);
|
|
8866
8886
|
v.setMonth(v.getMonth() + 1), V(v);
|
|
8867
|
-
} else if (e === "range" &&
|
|
8887
|
+
} else if (e === "range" && j().length === 0) {
|
|
8868
8888
|
const U = new Date(D);
|
|
8869
8889
|
U.setMonth(U.getMonth() + 1), V(U);
|
|
8870
8890
|
}
|
|
@@ -8920,7 +8940,7 @@ function ks({
|
|
|
8920
8940
|
), J = () => {
|
|
8921
8941
|
e === "single" ? t("") : e === "range" ? (t(["", ""]), H(null)) : t([]);
|
|
8922
8942
|
}, he = (d) => {
|
|
8923
|
-
if (
|
|
8943
|
+
if (O(null), e === "single") {
|
|
8924
8944
|
const D = Ge(d, s);
|
|
8925
8945
|
t(D);
|
|
8926
8946
|
} else if (e === "range") {
|
|
@@ -8932,13 +8952,13 @@ function ks({
|
|
|
8932
8952
|
t([
|
|
8933
8953
|
re,
|
|
8934
8954
|
de
|
|
8935
|
-
]), H(null),
|
|
8955
|
+
]), H(null), T(!1);
|
|
8936
8956
|
} else
|
|
8937
8957
|
t(["", ""]), H(d);
|
|
8938
8958
|
} else if (e === "multiple") {
|
|
8939
8959
|
const D = Q, x = ua(d, D);
|
|
8940
8960
|
let v;
|
|
8941
|
-
x ? v = D.filter((U) => !
|
|
8961
|
+
x ? v = D.filter((U) => !Le(U, d)) : v = [...D, d];
|
|
8942
8962
|
const g = v.map((U) => Ge(U, s));
|
|
8943
8963
|
t(g);
|
|
8944
8964
|
}
|
|
@@ -8946,7 +8966,7 @@ function ks({
|
|
|
8946
8966
|
const x = d.getFullYear(), v = d.getMonth(), g = D.getFullYear(), U = D.getMonth();
|
|
8947
8967
|
return x > g || x === g && v >= U;
|
|
8948
8968
|
}, fe = (d) => {
|
|
8949
|
-
|
|
8969
|
+
Y((D) => {
|
|
8950
8970
|
const x = new Date(D);
|
|
8951
8971
|
if (d === "prev" ? x.setMonth(x.getMonth() - 1) : x.setMonth(x.getMonth() + 1), e !== "single" && ve(x, B)) {
|
|
8952
8972
|
const v = new Date(x);
|
|
@@ -8959,7 +8979,7 @@ function ks({
|
|
|
8959
8979
|
const x = new Date(D);
|
|
8960
8980
|
if (d === "prev" ? x.setMonth(x.getMonth() - 1) : x.setMonth(x.getMonth() + 1), e !== "single" && ve($, x)) {
|
|
8961
8981
|
const v = new Date(x);
|
|
8962
|
-
v.setMonth(v.getMonth() - 1),
|
|
8982
|
+
v.setMonth(v.getMonth() - 1), Y(v);
|
|
8963
8983
|
}
|
|
8964
8984
|
return x;
|
|
8965
8985
|
});
|
|
@@ -8968,10 +8988,10 @@ function ks({
|
|
|
8968
8988
|
const v = new Date(x);
|
|
8969
8989
|
if (v.setMonth(d), e !== "single" && ve($, v)) {
|
|
8970
8990
|
const g = new Date(v);
|
|
8971
|
-
g.setMonth(g.getMonth() - 1),
|
|
8991
|
+
g.setMonth(g.getMonth() - 1), Y(g);
|
|
8972
8992
|
}
|
|
8973
8993
|
return v;
|
|
8974
|
-
}) :
|
|
8994
|
+
}) : Y((x) => {
|
|
8975
8995
|
const v = new Date(x);
|
|
8976
8996
|
if (v.setMonth(d), e !== "single" && ve(v, B)) {
|
|
8977
8997
|
const g = new Date(v);
|
|
@@ -8984,10 +9004,10 @@ function ks({
|
|
|
8984
9004
|
const v = new Date(x);
|
|
8985
9005
|
if (v.setFullYear(d), e !== "single" && ve($, v)) {
|
|
8986
9006
|
const g = new Date(v);
|
|
8987
|
-
g.setMonth(g.getMonth() - 1),
|
|
9007
|
+
g.setMonth(g.getMonth() - 1), Y(g);
|
|
8988
9008
|
}
|
|
8989
9009
|
return v;
|
|
8990
|
-
}) :
|
|
9010
|
+
}) : Y((x) => {
|
|
8991
9011
|
const v = new Date(x);
|
|
8992
9012
|
if (v.setFullYear(d), e !== "single" && ve(v, B)) {
|
|
8993
9013
|
const g = new Date(v);
|
|
@@ -9029,16 +9049,16 @@ function ks({
|
|
|
9029
9049
|
}, ke = (d) => {
|
|
9030
9050
|
if (!d) return !1;
|
|
9031
9051
|
if (e === "single")
|
|
9032
|
-
return Q.length > 0 &&
|
|
9052
|
+
return Q.length > 0 && Le(d, Q[0]);
|
|
9033
9053
|
if (e === "range") {
|
|
9034
|
-
if (X &&
|
|
9054
|
+
if (X && Le(d, X))
|
|
9035
9055
|
return !0;
|
|
9036
9056
|
if (!X) {
|
|
9037
9057
|
if (Q.length === 1)
|
|
9038
|
-
return
|
|
9058
|
+
return Le(d, Q[0]);
|
|
9039
9059
|
if (Q.length === 2) {
|
|
9040
9060
|
const [D, x] = Q;
|
|
9041
|
-
return
|
|
9061
|
+
return Le(d, D) || Le(d, x);
|
|
9042
9062
|
}
|
|
9043
9063
|
}
|
|
9044
9064
|
return !1;
|
|
@@ -9056,40 +9076,40 @@ function ks({
|
|
|
9056
9076
|
}
|
|
9057
9077
|
return !1;
|
|
9058
9078
|
}, Ve = (d) => {
|
|
9059
|
-
if (!d || !
|
|
9079
|
+
if (!d || !G) return !1;
|
|
9060
9080
|
if (e === "range") {
|
|
9061
9081
|
const D = X || (Q.length > 0 ? Q[0] : null);
|
|
9062
9082
|
if (D) {
|
|
9063
|
-
const [x, v] = D <=
|
|
9083
|
+
const [x, v] = D <= G ? [D, G] : [G, D];
|
|
9064
9084
|
return d > x && d < v;
|
|
9065
9085
|
}
|
|
9066
9086
|
}
|
|
9067
9087
|
return !1;
|
|
9068
|
-
}, Ie = (d) => !d || !
|
|
9088
|
+
}, Ie = (d) => !d || !G ? !1 : Le(d, G), o = (d) => {
|
|
9069
9089
|
if (!d) return "none";
|
|
9070
9090
|
if (e === "range") {
|
|
9071
|
-
if (X &&
|
|
9091
|
+
if (X && Le(d, X))
|
|
9072
9092
|
return "start";
|
|
9073
9093
|
if (!X && Q.length === 2) {
|
|
9074
9094
|
const [D, x] = Q;
|
|
9075
|
-
if (
|
|
9095
|
+
if (Le(d, D) && Le(d, x))
|
|
9076
9096
|
return "single";
|
|
9077
|
-
if (
|
|
9078
|
-
if (
|
|
9097
|
+
if (Le(d, D)) return "start";
|
|
9098
|
+
if (Le(d, x)) return "end";
|
|
9079
9099
|
if (d > D && d < x) return "middle";
|
|
9080
9100
|
}
|
|
9081
9101
|
}
|
|
9082
9102
|
return "none";
|
|
9083
9103
|
}, y = (d) => {
|
|
9084
|
-
if (!d || !
|
|
9104
|
+
if (!d || !G) return "none";
|
|
9085
9105
|
if (e === "range") {
|
|
9086
9106
|
const D = X || (Q.length > 0 ? Q[0] : null);
|
|
9087
9107
|
if (D) {
|
|
9088
|
-
const [x, v] = D <=
|
|
9089
|
-
if (
|
|
9108
|
+
const [x, v] = D <= G ? [D, G] : [G, D];
|
|
9109
|
+
if (Le(d, x) && Le(d, v))
|
|
9090
9110
|
return "single";
|
|
9091
|
-
if (
|
|
9092
|
-
if (
|
|
9111
|
+
if (Le(d, x)) return "start";
|
|
9112
|
+
if (Le(d, v)) return "end";
|
|
9093
9113
|
if (d > x && d < v) return "middle";
|
|
9094
9114
|
}
|
|
9095
9115
|
}
|
|
@@ -9153,7 +9173,7 @@ function ks({
|
|
|
9153
9173
|
Ie,
|
|
9154
9174
|
C
|
|
9155
9175
|
]
|
|
9156
|
-
),
|
|
9176
|
+
), L = Fe(
|
|
9157
9177
|
() => ie($),
|
|
9158
9178
|
[$, ie]
|
|
9159
9179
|
), z = Fe(
|
|
@@ -9166,13 +9186,13 @@ function ks({
|
|
|
9166
9186
|
ref: P,
|
|
9167
9187
|
className: S(
|
|
9168
9188
|
"ina-date-picker",
|
|
9169
|
-
|
|
9189
|
+
E && "ina-date-picker--disabled",
|
|
9170
9190
|
_ && "ina-date-picker--panel-only",
|
|
9171
9191
|
l
|
|
9172
9192
|
),
|
|
9173
9193
|
style: { width: ue },
|
|
9174
9194
|
children: [
|
|
9175
|
-
!_ && N && /* @__PURE__ */ w("label", { className: "ina-date-picker__label", htmlFor:
|
|
9195
|
+
!_ && N && /* @__PURE__ */ w("label", { className: "ina-date-picker__label", htmlFor: K.current, children: [
|
|
9176
9196
|
N,
|
|
9177
9197
|
k && /* @__PURE__ */ n("span", { className: "ina-date-picker__required", children: "*" })
|
|
9178
9198
|
] }),
|
|
@@ -9183,27 +9203,27 @@ function ks({
|
|
|
9183
9203
|
ref: se,
|
|
9184
9204
|
type: "button",
|
|
9185
9205
|
onClick: () => {
|
|
9186
|
-
|
|
9206
|
+
E || A || (f || document.querySelectorAll(".ina-date-picker").forEach((D) => {
|
|
9187
9207
|
if (D !== P.current) {
|
|
9188
9208
|
const x = new CustomEvent("closeDatePicker", {
|
|
9189
9209
|
detail: { exclude: P.current }
|
|
9190
9210
|
});
|
|
9191
9211
|
document.dispatchEvent(x);
|
|
9192
9212
|
}
|
|
9193
|
-
}),
|
|
9213
|
+
}), T(!f));
|
|
9194
9214
|
},
|
|
9195
9215
|
className: S(
|
|
9196
9216
|
"ina-date-picker__trigger",
|
|
9197
9217
|
`ina-date-picker__trigger--size-${F}`,
|
|
9198
|
-
|
|
9199
|
-
|
|
9218
|
+
E && "ina-date-picker__trigger--disabled",
|
|
9219
|
+
A && "ina-date-picker__trigger--readonly",
|
|
9200
9220
|
u
|
|
9201
9221
|
),
|
|
9202
|
-
id:
|
|
9222
|
+
id: K.current,
|
|
9203
9223
|
"aria-haspopup": "grid",
|
|
9204
9224
|
"aria-expanded": f,
|
|
9205
9225
|
style: { width: ue },
|
|
9206
|
-
disabled:
|
|
9226
|
+
disabled: E,
|
|
9207
9227
|
children: [
|
|
9208
9228
|
/* @__PURE__ */ n(Ut, { size: 20, className: "ina-date-picker__trigger-icon" }),
|
|
9209
9229
|
/* @__PURE__ */ n(
|
|
@@ -9219,7 +9239,7 @@ function ks({
|
|
|
9219
9239
|
]
|
|
9220
9240
|
}
|
|
9221
9241
|
),
|
|
9222
|
-
we() && !
|
|
9242
|
+
we() && !E && !A && /* @__PURE__ */ n(
|
|
9223
9243
|
"button",
|
|
9224
9244
|
{
|
|
9225
9245
|
type: "button",
|
|
@@ -9231,18 +9251,18 @@ function ks({
|
|
|
9231
9251
|
onKeyDown: (d) => {
|
|
9232
9252
|
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), J());
|
|
9233
9253
|
},
|
|
9234
|
-
children: /* @__PURE__ */ n(
|
|
9254
|
+
children: /* @__PURE__ */ n(Te, { size: 16, className: "ina-date-picker__clear-icon" })
|
|
9235
9255
|
}
|
|
9236
9256
|
)
|
|
9237
9257
|
] }),
|
|
9238
|
-
(f || _) && !
|
|
9258
|
+
(f || _) && !E && !A && /* @__PURE__ */ n(
|
|
9239
9259
|
"div",
|
|
9240
9260
|
{
|
|
9241
9261
|
ref: q,
|
|
9242
9262
|
className: S(
|
|
9243
9263
|
"ina-date-picker__panel",
|
|
9244
9264
|
`ina-date-picker__panel--${i.split("-")[0]}`,
|
|
9245
|
-
|
|
9265
|
+
W && !i.includes("left") && !i.includes("right") && "ina-date-picker__panel--right-aligned",
|
|
9246
9266
|
h
|
|
9247
9267
|
),
|
|
9248
9268
|
style: {
|
|
@@ -9300,8 +9320,8 @@ function ks({
|
|
|
9300
9320
|
value: $.getMonth(),
|
|
9301
9321
|
onChange: (d) => Ce(d),
|
|
9302
9322
|
locale: "id",
|
|
9303
|
-
disabled:
|
|
9304
|
-
readonly:
|
|
9323
|
+
disabled: E,
|
|
9324
|
+
readonly: A,
|
|
9305
9325
|
size: "sm"
|
|
9306
9326
|
}
|
|
9307
9327
|
) }),
|
|
@@ -9316,8 +9336,8 @@ function ks({
|
|
|
9316
9336
|
minYear: 1900,
|
|
9317
9337
|
maxYear: 2100,
|
|
9318
9338
|
decadeSize: 20,
|
|
9319
|
-
disabled:
|
|
9320
|
-
readonly:
|
|
9339
|
+
disabled: E,
|
|
9340
|
+
readonly: A,
|
|
9321
9341
|
size: "sm"
|
|
9322
9342
|
}
|
|
9323
9343
|
) })
|
|
@@ -9351,8 +9371,8 @@ function ks({
|
|
|
9351
9371
|
},
|
|
9352
9372
|
d
|
|
9353
9373
|
)),
|
|
9354
|
-
|
|
9355
|
-
const x = R(d), v = x.isSelected || !
|
|
9374
|
+
L.map((d, D) => {
|
|
9375
|
+
const x = R(d), v = x.isSelected || !L.some((g) => ke(g.date)) && d.isToday || !L.some((g) => ke(g.date)) && !L.some((g) => g.isToday) && D === 15;
|
|
9356
9376
|
return /* @__PURE__ */ n(
|
|
9357
9377
|
"button",
|
|
9358
9378
|
{
|
|
@@ -9385,8 +9405,8 @@ function ks({
|
|
|
9385
9405
|
}
|
|
9386
9406
|
}
|
|
9387
9407
|
},
|
|
9388
|
-
onMouseEnter: () => !x.isDisabled &&
|
|
9389
|
-
onMouseLeave: () =>
|
|
9408
|
+
onMouseEnter: () => !x.isDisabled && O(d.date),
|
|
9409
|
+
onMouseLeave: () => O(null),
|
|
9390
9410
|
disabled: x.isDisabled,
|
|
9391
9411
|
className: S(
|
|
9392
9412
|
x.className,
|
|
@@ -9423,8 +9443,8 @@ function ks({
|
|
|
9423
9443
|
value: B.getMonth(),
|
|
9424
9444
|
onChange: (d) => Ce(d, !0),
|
|
9425
9445
|
locale: "id",
|
|
9426
|
-
disabled:
|
|
9427
|
-
readonly:
|
|
9446
|
+
disabled: E,
|
|
9447
|
+
readonly: A,
|
|
9428
9448
|
size: "sm"
|
|
9429
9449
|
}
|
|
9430
9450
|
) }),
|
|
@@ -9439,8 +9459,8 @@ function ks({
|
|
|
9439
9459
|
minYear: 1900,
|
|
9440
9460
|
maxYear: 2100,
|
|
9441
9461
|
decadeSize: 20,
|
|
9442
|
-
disabled:
|
|
9443
|
-
readonly:
|
|
9462
|
+
disabled: E,
|
|
9463
|
+
readonly: A,
|
|
9444
9464
|
size: "sm"
|
|
9445
9465
|
}
|
|
9446
9466
|
) })
|
|
@@ -9505,8 +9525,8 @@ function ks({
|
|
|
9505
9525
|
}
|
|
9506
9526
|
}
|
|
9507
9527
|
},
|
|
9508
|
-
onMouseEnter: () => !x.isDisabled &&
|
|
9509
|
-
onMouseLeave: () =>
|
|
9528
|
+
onMouseEnter: () => !x.isDisabled && O(d.date),
|
|
9529
|
+
onMouseLeave: () => O(null),
|
|
9510
9530
|
disabled: x.isDisabled,
|
|
9511
9531
|
className: x.className + (!x.isSelected && !x.isInRange && !x.isHovered && !x.isHoveredEnd && !x.isDisabled ? " ina-date-picker__day--hover" : ""),
|
|
9512
9532
|
children: d.date.getDate()
|
|
@@ -9538,15 +9558,15 @@ function Ns({
|
|
|
9538
9558
|
(m, p) => {
|
|
9539
9559
|
if (s) return;
|
|
9540
9560
|
const I = t.filter(
|
|
9541
|
-
(
|
|
9561
|
+
(E) => E.rowId !== m
|
|
9542
9562
|
);
|
|
9543
9563
|
I.push({ rowId: m, columnId: p }), r == null || r(I);
|
|
9544
9564
|
},
|
|
9545
9565
|
[t, r, s]
|
|
9546
9566
|
), u = me(
|
|
9547
9567
|
(m) => {
|
|
9548
|
-
const { name: p, value: I } = m.target,
|
|
9549
|
-
h(
|
|
9568
|
+
const { name: p, value: I } = m.target, E = p.replace(`${l}-`, "");
|
|
9569
|
+
h(E, I);
|
|
9550
9570
|
},
|
|
9551
9571
|
[l, h]
|
|
9552
9572
|
), M = me(
|
|
@@ -9618,18 +9638,18 @@ function Cs({
|
|
|
9618
9638
|
color: M,
|
|
9619
9639
|
...m
|
|
9620
9640
|
}) {
|
|
9621
|
-
const p = e !== void 0, [I,
|
|
9622
|
-
(
|
|
9641
|
+
const p = e !== void 0, [I, E] = Z(a), A = p ? e : I, F = me(
|
|
9642
|
+
(T) => {
|
|
9623
9643
|
if (t) return;
|
|
9624
|
-
const $ =
|
|
9625
|
-
p ||
|
|
9644
|
+
const $ = T.target.checked;
|
|
9645
|
+
p || E($), i && i($);
|
|
9626
9646
|
},
|
|
9627
9647
|
[t, i, p]
|
|
9628
9648
|
), N = S(
|
|
9629
9649
|
"ina-toggle",
|
|
9630
9650
|
`ina-toggle--size-${r}`,
|
|
9631
9651
|
{
|
|
9632
|
-
"ina-toggle--checked":
|
|
9652
|
+
"ina-toggle--checked": A,
|
|
9633
9653
|
"ina-toggle--disabled": t
|
|
9634
9654
|
},
|
|
9635
9655
|
s
|
|
@@ -9637,17 +9657,17 @@ function Cs({
|
|
|
9637
9657
|
"ina-toggle__track",
|
|
9638
9658
|
`ina-toggle__track--size-${r}`,
|
|
9639
9659
|
{
|
|
9640
|
-
"ina-toggle__track--checked":
|
|
9660
|
+
"ina-toggle__track--checked": A,
|
|
9641
9661
|
"ina-toggle__track--disabled": t
|
|
9642
9662
|
}
|
|
9643
9663
|
), _ = S(
|
|
9644
9664
|
"ina-toggle__thumb",
|
|
9645
9665
|
`ina-toggle__thumb--size-${r}`,
|
|
9646
9666
|
{
|
|
9647
|
-
"ina-toggle__thumb--checked":
|
|
9667
|
+
"ina-toggle__thumb--checked": A,
|
|
9648
9668
|
"ina-toggle__thumb--disabled": t
|
|
9649
9669
|
}
|
|
9650
|
-
), f =
|
|
9670
|
+
), f = A && M && !t ? { backgroundColor: M, borderColor: M } : {};
|
|
9651
9671
|
return /* @__PURE__ */ w("div", { className: N, children: [
|
|
9652
9672
|
/* @__PURE__ */ n(
|
|
9653
9673
|
"input",
|
|
@@ -9657,7 +9677,7 @@ function Cs({
|
|
|
9657
9677
|
id: b,
|
|
9658
9678
|
name: h,
|
|
9659
9679
|
value: u,
|
|
9660
|
-
checked:
|
|
9680
|
+
checked: A,
|
|
9661
9681
|
disabled: t,
|
|
9662
9682
|
onChange: F,
|
|
9663
9683
|
"aria-label": l,
|
|
@@ -9692,7 +9712,7 @@ function Ms({
|
|
|
9692
9712
|
var k;
|
|
9693
9713
|
const [m, p] = Z(
|
|
9694
9714
|
t || ((k = e[0]) == null ? void 0 : k.value) || ""
|
|
9695
|
-
), I = a !== void 0 ? a : m,
|
|
9715
|
+
), I = a !== void 0 ? a : m, E = le([]), A = me(
|
|
9696
9716
|
(_, f) => {
|
|
9697
9717
|
b || f || (a === void 0 && p(_), r == null || r(_));
|
|
9698
9718
|
},
|
|
@@ -9711,11 +9731,11 @@ function Ms({
|
|
|
9711
9731
|
u
|
|
9712
9732
|
);
|
|
9713
9733
|
return /* @__PURE__ */ n("div", { className: F, children: /* @__PURE__ */ n("div", { className: N, role: "tablist", children: e.map((_, f) => {
|
|
9714
|
-
const
|
|
9734
|
+
const T = I === _.value, $ = b || _.disabled, Y = S(
|
|
9715
9735
|
"ina-tab-horizontal__tab",
|
|
9716
9736
|
`ina-tab-horizontal__tab--size-${i}`,
|
|
9717
9737
|
`ina-tab-horizontal__tab--variant-${s}`,
|
|
9718
|
-
|
|
9738
|
+
T && "ina-tab-horizontal__tab--selected",
|
|
9719
9739
|
$ && "ina-tab-horizontal__tab--disabled",
|
|
9720
9740
|
l && "ina-tab-horizontal__tab--full-width",
|
|
9721
9741
|
M
|
|
@@ -9723,29 +9743,29 @@ function Ms({
|
|
|
9723
9743
|
return /* @__PURE__ */ n(
|
|
9724
9744
|
"button",
|
|
9725
9745
|
{
|
|
9726
|
-
ref: (B) =>
|
|
9746
|
+
ref: (B) => E.current[f] = B,
|
|
9727
9747
|
type: "button",
|
|
9728
9748
|
role: "tab",
|
|
9729
|
-
"aria-selected":
|
|
9749
|
+
"aria-selected": T,
|
|
9730
9750
|
"aria-disabled": $,
|
|
9731
9751
|
disabled: $,
|
|
9732
|
-
tabIndex:
|
|
9733
|
-
className:
|
|
9734
|
-
onClick: () =>
|
|
9752
|
+
tabIndex: T ? 0 : -1,
|
|
9753
|
+
className: Y,
|
|
9754
|
+
onClick: () => A(_.value, _.disabled),
|
|
9735
9755
|
onKeyDown: (B) => {
|
|
9736
|
-
var
|
|
9756
|
+
var G, O;
|
|
9737
9757
|
if ($) return;
|
|
9738
9758
|
let V;
|
|
9739
9759
|
if (B.key === "Enter" || B.key === " ")
|
|
9740
|
-
B.preventDefault(),
|
|
9760
|
+
B.preventDefault(), A(_.value, _.disabled);
|
|
9741
9761
|
else if (B.key === "ArrowRight") {
|
|
9742
9762
|
for (B.preventDefault(), V = (f + 1) % e.length; e[V].disabled && V !== f; )
|
|
9743
9763
|
V = (V + 1) % e.length;
|
|
9744
|
-
(
|
|
9764
|
+
(G = E.current[V]) == null || G.focus();
|
|
9745
9765
|
} else if (B.key === "ArrowLeft") {
|
|
9746
9766
|
for (B.preventDefault(), V = (f - 1 + e.length) % e.length; e[V].disabled && V !== f; )
|
|
9747
9767
|
V = (V - 1 + e.length) % e.length;
|
|
9748
|
-
(
|
|
9768
|
+
(O = E.current[V]) == null || O.focus();
|
|
9749
9769
|
}
|
|
9750
9770
|
},
|
|
9751
9771
|
children: _.label
|
|
@@ -9771,9 +9791,9 @@ function xs({
|
|
|
9771
9791
|
var _;
|
|
9772
9792
|
const [m, p] = Z(
|
|
9773
9793
|
t || ((_ = e[0]) == null ? void 0 : _.value) || ""
|
|
9774
|
-
), I = a !== void 0 ? a : m,
|
|
9775
|
-
(f,
|
|
9776
|
-
c ||
|
|
9794
|
+
), I = a !== void 0 ? a : m, E = le([]), A = me(
|
|
9795
|
+
(f, T) => {
|
|
9796
|
+
c || T || (a === void 0 && p(f), r == null || r(f));
|
|
9777
9797
|
},
|
|
9778
9798
|
[c, a, r]
|
|
9779
9799
|
), F = S(
|
|
@@ -9789,41 +9809,41 @@ function xs({
|
|
|
9789
9809
|
), k = {
|
|
9790
9810
|
width: typeof M == "number" ? `${M}px` : M
|
|
9791
9811
|
};
|
|
9792
|
-
return /* @__PURE__ */ n("div", { className: F, style: k, children: /* @__PURE__ */ n("div", { className: N, role: "tablist", children: e.map((f,
|
|
9793
|
-
const $ = I === f.value,
|
|
9812
|
+
return /* @__PURE__ */ n("div", { className: F, style: k, children: /* @__PURE__ */ n("div", { className: N, role: "tablist", children: e.map((f, T) => {
|
|
9813
|
+
const $ = I === f.value, Y = c || f.disabled, B = S(
|
|
9794
9814
|
"ina-tab-vertical__tab",
|
|
9795
9815
|
`ina-tab-vertical__tab--size-${i}`,
|
|
9796
9816
|
`ina-tab-vertical__tab--variant-${s}`,
|
|
9797
9817
|
$ && "ina-tab-vertical__tab--selected",
|
|
9798
|
-
|
|
9818
|
+
Y && "ina-tab-vertical__tab--disabled",
|
|
9799
9819
|
u
|
|
9800
9820
|
);
|
|
9801
9821
|
return /* @__PURE__ */ n(
|
|
9802
9822
|
"button",
|
|
9803
9823
|
{
|
|
9804
|
-
ref: (V) =>
|
|
9824
|
+
ref: (V) => E.current[T] = V,
|
|
9805
9825
|
type: "button",
|
|
9806
9826
|
role: "tab",
|
|
9807
9827
|
"aria-selected": $,
|
|
9808
|
-
"aria-disabled":
|
|
9809
|
-
disabled:
|
|
9828
|
+
"aria-disabled": Y,
|
|
9829
|
+
disabled: Y,
|
|
9810
9830
|
tabIndex: $ ? 0 : -1,
|
|
9811
9831
|
className: B,
|
|
9812
|
-
onClick: () =>
|
|
9832
|
+
onClick: () => A(f.value, f.disabled),
|
|
9813
9833
|
onKeyDown: (V) => {
|
|
9814
|
-
var
|
|
9815
|
-
if (
|
|
9816
|
-
let
|
|
9834
|
+
var O, W;
|
|
9835
|
+
if (Y) return;
|
|
9836
|
+
let G;
|
|
9817
9837
|
if (V.key === "Enter" || V.key === " ")
|
|
9818
|
-
V.preventDefault(),
|
|
9838
|
+
V.preventDefault(), A(f.value, f.disabled);
|
|
9819
9839
|
else if (V.key === "ArrowDown") {
|
|
9820
|
-
for (V.preventDefault(),
|
|
9821
|
-
|
|
9822
|
-
(
|
|
9840
|
+
for (V.preventDefault(), G = (T + 1) % e.length; e[G].disabled && G !== T; )
|
|
9841
|
+
G = (G + 1) % e.length;
|
|
9842
|
+
(O = E.current[G]) == null || O.focus();
|
|
9823
9843
|
} else if (V.key === "ArrowUp") {
|
|
9824
|
-
for (V.preventDefault(),
|
|
9825
|
-
|
|
9826
|
-
(
|
|
9844
|
+
for (V.preventDefault(), G = (T - 1 + e.length) % e.length; e[G].disabled && G !== T; )
|
|
9845
|
+
G = (G - 1 + e.length) % e.length;
|
|
9846
|
+
(W = E.current[G]) == null || W.focus();
|
|
9827
9847
|
}
|
|
9828
9848
|
},
|
|
9829
9849
|
children: f.label
|
|
@@ -9856,10 +9876,10 @@ function Is() {
|
|
|
9856
9876
|
function Ga(e) {
|
|
9857
9877
|
gt.includes(e) ? Ke = { name: e } : Ke = { name: "default" }, Gt();
|
|
9858
9878
|
}
|
|
9859
|
-
function
|
|
9879
|
+
function Es(e) {
|
|
9860
9880
|
Ke = e, Gt();
|
|
9861
9881
|
}
|
|
9862
|
-
function
|
|
9882
|
+
function As() {
|
|
9863
9883
|
return Ke;
|
|
9864
9884
|
}
|
|
9865
9885
|
function Ss() {
|
|
@@ -9905,19 +9925,19 @@ function dr(e, a) {
|
|
|
9905
9925
|
function Vs() {
|
|
9906
9926
|
Ga("default");
|
|
9907
9927
|
}
|
|
9908
|
-
function
|
|
9928
|
+
function Ts(e) {
|
|
9909
9929
|
return gt.includes(e);
|
|
9910
9930
|
}
|
|
9911
9931
|
typeof window < "u" && dr();
|
|
9912
9932
|
export {
|
|
9913
9933
|
Ca as ALLOWED_MIME_TYPES,
|
|
9914
|
-
|
|
9934
|
+
Ar as Accordion,
|
|
9915
9935
|
Sr as AccordionCard,
|
|
9916
|
-
|
|
9936
|
+
Er as AccordionGroup,
|
|
9917
9937
|
Ya as ActionDropdown,
|
|
9918
9938
|
Vr as Alert,
|
|
9919
|
-
|
|
9920
|
-
|
|
9939
|
+
Tr as Avatar,
|
|
9940
|
+
Lr as Badge,
|
|
9921
9941
|
Gr as BasicDropdown,
|
|
9922
9942
|
Fr as BottomSheet,
|
|
9923
9943
|
Rr as Breadcrumb,
|
|
@@ -9930,7 +9950,7 @@ export {
|
|
|
9930
9950
|
Hr as Chip,
|
|
9931
9951
|
Pr as CircleProgressBar,
|
|
9932
9952
|
Or as Collapse,
|
|
9933
|
-
|
|
9953
|
+
Ea as ConfirmationContext,
|
|
9934
9954
|
vs as ConfirmationProvider,
|
|
9935
9955
|
jt as DANGEROUS_MIME_TYPES,
|
|
9936
9956
|
Da as DEFAULT_SECURITY_CONFIG,
|
|
@@ -9970,11 +9990,11 @@ export {
|
|
|
9970
9990
|
ds as Table,
|
|
9971
9991
|
Nn as TableProgressBar,
|
|
9972
9992
|
us as TextArea,
|
|
9973
|
-
|
|
9993
|
+
En as TextField,
|
|
9974
9994
|
ms as ThemeToggle,
|
|
9975
|
-
|
|
9995
|
+
Tn as TimePicker,
|
|
9976
9996
|
$n as Toast,
|
|
9977
|
-
|
|
9997
|
+
Aa as ToastContext,
|
|
9978
9998
|
ys as ToastProvider,
|
|
9979
9999
|
Cs as Toggle,
|
|
9980
10000
|
ps as Tooltip,
|
|
@@ -9990,7 +10010,7 @@ export {
|
|
|
9990
10010
|
Ss as getAvailableBrands,
|
|
9991
10011
|
Zr as getCookie,
|
|
9992
10012
|
Qr as getCurrentLocation,
|
|
9993
|
-
|
|
10013
|
+
As as getCurrentTheme,
|
|
9994
10014
|
Dn as getFlag,
|
|
9995
10015
|
Ds as getThemeMode,
|
|
9996
10016
|
mr as iddsColorTokens,
|
|
@@ -9998,7 +10018,7 @@ export {
|
|
|
9998
10018
|
vr as inakuColorTokens,
|
|
9999
10019
|
gr as inapasColorTokens,
|
|
10000
10020
|
dr as initializeTheme,
|
|
10001
|
-
|
|
10021
|
+
Ts as isValidBrand,
|
|
10002
10022
|
br as lanColorTokens,
|
|
10003
10023
|
gn as onlyAlphanumeric,
|
|
10004
10024
|
qr as onlyDecimalNumber,
|
|
@@ -10008,7 +10028,7 @@ export {
|
|
|
10008
10028
|
dt as sanitizeFileName,
|
|
10009
10029
|
cn as sanitizeInput,
|
|
10010
10030
|
Ga as setBrandTheme,
|
|
10011
|
-
|
|
10031
|
+
Es as setCustomTheme,
|
|
10012
10032
|
St as setThemeMode,
|
|
10013
10033
|
Is as toggleThemeMode,
|
|
10014
10034
|
ja as useAccordionGroup,
|