next-recomponents 2.0.2 → 2.0.3
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.d.mts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +370 -247
- package/dist/index.mjs +317 -194
- package/package.json +1 -1
- package/src/alert/index.tsx +145 -23
- package/src/index.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -3488,7 +3488,6 @@ var require_link2 = __commonJS({
|
|
|
3488
3488
|
// src/index.tsx
|
|
3489
3489
|
var index_exports = {};
|
|
3490
3490
|
__export(index_exports, {
|
|
3491
|
-
Alert: () => Alert,
|
|
3492
3491
|
Button: () => Button,
|
|
3493
3492
|
Container: () => Container,
|
|
3494
3493
|
DocumentViewer: () => DocumentViewer,
|
|
@@ -3505,10 +3504,14 @@ __export(index_exports, {
|
|
|
3505
3504
|
useDates: () => useDates,
|
|
3506
3505
|
useExcel: () => useExcel,
|
|
3507
3506
|
useFormValues: () => useFormValues,
|
|
3507
|
+
usePopup: () => alert_default,
|
|
3508
3508
|
useResources: () => useResources
|
|
3509
3509
|
});
|
|
3510
3510
|
module.exports = __toCommonJS(index_exports);
|
|
3511
3511
|
|
|
3512
|
+
// src/button/index.tsx
|
|
3513
|
+
var import_react = require("react");
|
|
3514
|
+
|
|
3512
3515
|
// src/button/colors.tsx
|
|
3513
3516
|
var catColor = {
|
|
3514
3517
|
white: "bg-white text-black",
|
|
@@ -3520,26 +3523,8 @@ var catColor = {
|
|
|
3520
3523
|
success: "bg-green-500 text-white"
|
|
3521
3524
|
};
|
|
3522
3525
|
|
|
3523
|
-
// src/alert/index.tsx
|
|
3524
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
3525
|
-
function Alert({
|
|
3526
|
-
color = "primary",
|
|
3527
|
-
children,
|
|
3528
|
-
...props
|
|
3529
|
-
}) {
|
|
3530
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3531
|
-
"div",
|
|
3532
|
-
{
|
|
3533
|
-
className: [catColor[color], "p-2 rounded shadow border"].join(" "),
|
|
3534
|
-
...props,
|
|
3535
|
-
children
|
|
3536
|
-
}
|
|
3537
|
-
);
|
|
3538
|
-
}
|
|
3539
|
-
|
|
3540
3526
|
// src/button/index.tsx
|
|
3541
|
-
var
|
|
3542
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
3527
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
3543
3528
|
function Button({
|
|
3544
3529
|
className,
|
|
3545
3530
|
size = "small",
|
|
@@ -3551,7 +3536,7 @@ function Button({
|
|
|
3551
3536
|
...props
|
|
3552
3537
|
}) {
|
|
3553
3538
|
const [isLoading, setIsloading] = (0, import_react.useState)(false);
|
|
3554
|
-
return /* @__PURE__ */ (0,
|
|
3539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
3555
3540
|
"button",
|
|
3556
3541
|
{
|
|
3557
3542
|
...Object.assign(
|
|
@@ -3588,9 +3573,9 @@ function Button({
|
|
|
3588
3573
|
var import_react2 = require("react");
|
|
3589
3574
|
|
|
3590
3575
|
// src/container/icons.tsx
|
|
3591
|
-
var
|
|
3576
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
3592
3577
|
function MenuIcon() {
|
|
3593
|
-
return /* @__PURE__ */ (0,
|
|
3578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
3594
3579
|
"svg",
|
|
3595
3580
|
{
|
|
3596
3581
|
stroke: "currentColor",
|
|
@@ -3600,12 +3585,12 @@ function MenuIcon() {
|
|
|
3600
3585
|
height: "20px",
|
|
3601
3586
|
width: "20px",
|
|
3602
3587
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3603
|
-
children: /* @__PURE__ */ (0,
|
|
3588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M32 96v64h448V96H32zm0 128v64h448v-64H32zm0 128v64h448v-64H32z" })
|
|
3604
3589
|
}
|
|
3605
3590
|
);
|
|
3606
3591
|
}
|
|
3607
3592
|
function HomeIcon() {
|
|
3608
|
-
return /* @__PURE__ */ (0,
|
|
3593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
3609
3594
|
"svg",
|
|
3610
3595
|
{
|
|
3611
3596
|
stroke: "currentColor",
|
|
@@ -3615,12 +3600,12 @@ function HomeIcon() {
|
|
|
3615
3600
|
height: "20px",
|
|
3616
3601
|
width: "20px",
|
|
3617
3602
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3618
|
-
children: /* @__PURE__ */ (0,
|
|
3603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z" })
|
|
3619
3604
|
}
|
|
3620
3605
|
);
|
|
3621
3606
|
}
|
|
3622
3607
|
function ArrowUpIcon() {
|
|
3623
|
-
return /* @__PURE__ */ (0,
|
|
3608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
3624
3609
|
"svg",
|
|
3625
3610
|
{
|
|
3626
3611
|
stroke: "currentColor",
|
|
@@ -3632,12 +3617,12 @@ function ArrowUpIcon() {
|
|
|
3632
3617
|
height: "20px",
|
|
3633
3618
|
width: "20px",
|
|
3634
3619
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3635
|
-
children: /* @__PURE__ */ (0,
|
|
3620
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M18.2 13.3l-6.2-6.3-6.2 6.3c-.2.2-.3.5-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7z" })
|
|
3636
3621
|
}
|
|
3637
3622
|
);
|
|
3638
3623
|
}
|
|
3639
3624
|
function ArrowDownIcon() {
|
|
3640
|
-
return /* @__PURE__ */ (0,
|
|
3625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
3641
3626
|
"svg",
|
|
3642
3627
|
{
|
|
3643
3628
|
stroke: "currentColor",
|
|
@@ -3649,14 +3634,14 @@ function ArrowDownIcon() {
|
|
|
3649
3634
|
height: "20px",
|
|
3650
3635
|
width: "20px",
|
|
3651
3636
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3652
|
-
children: /* @__PURE__ */ (0,
|
|
3637
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M5.8 9.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.4-.3.7s.1.5.3.7z" })
|
|
3653
3638
|
}
|
|
3654
3639
|
);
|
|
3655
3640
|
}
|
|
3656
3641
|
|
|
3657
3642
|
// src/container/index.tsx
|
|
3658
3643
|
var import_link = __toESM(require_link2());
|
|
3659
|
-
var
|
|
3644
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
3660
3645
|
function Container({
|
|
3661
3646
|
children,
|
|
3662
3647
|
appName,
|
|
@@ -3680,10 +3665,10 @@ function Container({
|
|
|
3680
3665
|
}
|
|
3681
3666
|
}
|
|
3682
3667
|
}, []);
|
|
3683
|
-
return /* @__PURE__ */ (0,
|
|
3684
|
-
/* @__PURE__ */ (0,
|
|
3685
|
-
/* @__PURE__ */ (0,
|
|
3686
|
-
/* @__PURE__ */ (0,
|
|
3668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col h-screen", children: [
|
|
3669
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("header", { className: "z-40", children: [
|
|
3670
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "bg-blue-600 text-white p-4 flex justify-between items-center shadow-md", children: [
|
|
3671
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3687
3672
|
"button",
|
|
3688
3673
|
{
|
|
3689
3674
|
onClick: () => {
|
|
@@ -3691,20 +3676,20 @@ function Container({
|
|
|
3691
3676
|
handleClick(!isSidebarOpen);
|
|
3692
3677
|
},
|
|
3693
3678
|
className: "bg-blue-600 text-white px-2 py-1 rounded-r",
|
|
3694
|
-
children: /* @__PURE__ */ (0,
|
|
3679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MenuIcon, {})
|
|
3695
3680
|
}
|
|
3696
3681
|
),
|
|
3697
|
-
/* @__PURE__ */ (0,
|
|
3682
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h1", { className: "text-xl font-bold", children: appName })
|
|
3698
3683
|
] }),
|
|
3699
|
-
/* @__PURE__ */ (0,
|
|
3684
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3700
3685
|
"div",
|
|
3701
3686
|
{
|
|
3702
3687
|
className: ` gap-2 bg-blue-400 text-white ${isSidebarOpen ? "px-[270px]" : "px-[60px]"} hidden sm:flex`,
|
|
3703
|
-
children: navItems && /* @__PURE__ */ (0,
|
|
3704
|
-
{ location: "/", name: "Home", icon: /* @__PURE__ */ (0,
|
|
3688
|
+
children: navItems && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: [
|
|
3689
|
+
{ location: "/", name: "Home", icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(HomeIcon, {}) },
|
|
3705
3690
|
...navItems
|
|
3706
3691
|
].map((li, k) => {
|
|
3707
|
-
return li && /* @__PURE__ */ (0,
|
|
3692
|
+
return li && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3708
3693
|
import_link.default,
|
|
3709
3694
|
{
|
|
3710
3695
|
href: li.location,
|
|
@@ -3720,16 +3705,16 @@ function Container({
|
|
|
3720
3705
|
}
|
|
3721
3706
|
)
|
|
3722
3707
|
] }),
|
|
3723
|
-
/* @__PURE__ */ (0,
|
|
3724
|
-
/* @__PURE__ */ (0,
|
|
3708
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-1 overflow-hidden relative", children: [
|
|
3709
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3725
3710
|
"div",
|
|
3726
3711
|
{
|
|
3727
3712
|
style: {
|
|
3728
3713
|
width: typeof window !== "undefined" && (window == null ? void 0 : window.innerWidth) < 768 ? isSidebarOpen ? "100%" : 0 : isSidebarOpen ? 250 : 60
|
|
3729
3714
|
},
|
|
3730
3715
|
className: "bg-blue-500 text-white overflow-y-auto fixed md:static top-0 left-0 h-full z-50 md:z-auto transition-all duration-300 ease-in-out",
|
|
3731
|
-
children: /* @__PURE__ */ (0,
|
|
3732
|
-
/* @__PURE__ */ (0,
|
|
3716
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "p-4 ", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("ul", { className: "space-y-3", children: [
|
|
3717
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3733
3718
|
"li",
|
|
3734
3719
|
{
|
|
3735
3720
|
className: "p-2 md:hidden flex items-center justify-between font-bold",
|
|
@@ -3738,7 +3723,7 @@ function Container({
|
|
|
3738
3723
|
handleClick(false);
|
|
3739
3724
|
},
|
|
3740
3725
|
children: [
|
|
3741
|
-
/* @__PURE__ */ (0,
|
|
3726
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MenuIcon, {}),
|
|
3742
3727
|
" ",
|
|
3743
3728
|
appName
|
|
3744
3729
|
]
|
|
@@ -3747,17 +3732,17 @@ function Container({
|
|
|
3747
3732
|
),
|
|
3748
3733
|
menuList && menuList.map((itemMenu, k) => {
|
|
3749
3734
|
const letra = `${itemMenu == null ? void 0 : itemMenu.name}`.split("")[0];
|
|
3750
|
-
const icon = /* @__PURE__ */ (0,
|
|
3751
|
-
return /* @__PURE__ */ (0,
|
|
3735
|
+
const icon = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: (itemMenu == null ? void 0 : itemMenu.icon) || /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "px-1 border shadow rounded", children: letra }) });
|
|
3736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3752
3737
|
import_link.default,
|
|
3753
3738
|
{
|
|
3754
3739
|
href: (itemMenu == null ? void 0 : itemMenu.location) || "#",
|
|
3755
3740
|
children: [
|
|
3756
|
-
isSidebarOpen && /* @__PURE__ */ (0,
|
|
3741
|
+
isSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "text-sm flex p-1 gap-1 items-center hover:bg-gray-200 hover:text-black rounded", children: [
|
|
3757
3742
|
icon,
|
|
3758
|
-
/* @__PURE__ */ (0,
|
|
3743
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: " truncate", children: itemMenu == null ? void 0 : itemMenu.name })
|
|
3759
3744
|
] }),
|
|
3760
|
-
!isSidebarOpen && /* @__PURE__ */ (0,
|
|
3745
|
+
!isSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-sm hover:bg-gray-200 hover:text-black rounded p-1", children: icon })
|
|
3761
3746
|
]
|
|
3762
3747
|
}
|
|
3763
3748
|
) }, k);
|
|
@@ -3765,7 +3750,7 @@ function Container({
|
|
|
3765
3750
|
] }) })
|
|
3766
3751
|
}
|
|
3767
3752
|
),
|
|
3768
|
-
isSidebarOpen && typeof window !== "undefined" && window.innerWidth < 768 && /* @__PURE__ */ (0,
|
|
3753
|
+
isSidebarOpen && typeof window !== "undefined" && window.innerWidth < 768 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3769
3754
|
"div",
|
|
3770
3755
|
{
|
|
3771
3756
|
className: "fixed inset-0 bg-black bg-opacity-40 z-40",
|
|
@@ -3775,21 +3760,21 @@ function Container({
|
|
|
3775
3760
|
}
|
|
3776
3761
|
}
|
|
3777
3762
|
),
|
|
3778
|
-
/* @__PURE__ */ (0,
|
|
3779
|
-
leftPanel && /* @__PURE__ */ (0,
|
|
3780
|
-
/* @__PURE__ */ (0,
|
|
3763
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("main", { className: "flex-1 overflow-auto p-4 bg-gray-100 z-10 md:ml-0 ", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex md:flex-row flex-col h-full gap-4 ", children: [
|
|
3764
|
+
leftPanel && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("aside", { className: "w-full md:w-64 flex-shrink-0 text-xs text-blue-600 bg-gray-200 p-5 border rounded", children: leftPanel }),
|
|
3765
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("section", { className: "flex-1", children })
|
|
3781
3766
|
] }) })
|
|
3782
3767
|
] }),
|
|
3783
|
-
footPanel && /* @__PURE__ */ (0,
|
|
3784
|
-
/* @__PURE__ */ (0,
|
|
3768
|
+
footPanel && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "bg-blue-100 overflow-hidden ", children: [
|
|
3769
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex justify-center items-center p-2", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3785
3770
|
"button",
|
|
3786
3771
|
{
|
|
3787
3772
|
onClick: () => setIsFooterOpen(!isFooterOpen),
|
|
3788
3773
|
className: "text-blue-700",
|
|
3789
|
-
children: isFooterOpen ? /* @__PURE__ */ (0,
|
|
3774
|
+
children: isFooterOpen ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrowDownIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrowUpIcon, {})
|
|
3790
3775
|
}
|
|
3791
3776
|
) }),
|
|
3792
|
-
/* @__PURE__ */ (0,
|
|
3777
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3793
3778
|
"div",
|
|
3794
3779
|
{
|
|
3795
3780
|
style: isFooterOpen ? { maxHeight: "500px" } : { maxHeight: "0px" },
|
|
@@ -3803,7 +3788,7 @@ function Container({
|
|
|
3803
3788
|
|
|
3804
3789
|
// src/form/index.tsx
|
|
3805
3790
|
var import_react3 = __toESM(require("react"));
|
|
3806
|
-
var
|
|
3791
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
3807
3792
|
function useFormValues(initial) {
|
|
3808
3793
|
const reducer = (state, action) => {
|
|
3809
3794
|
return { ...state, ...action };
|
|
@@ -3843,7 +3828,7 @@ function Form({
|
|
|
3843
3828
|
}
|
|
3844
3829
|
return false;
|
|
3845
3830
|
}
|
|
3846
|
-
return /* @__PURE__ */ (0,
|
|
3831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
3847
3832
|
"form",
|
|
3848
3833
|
{
|
|
3849
3834
|
...otherProps,
|
|
@@ -3878,14 +3863,14 @@ function Form({
|
|
|
3878
3863
|
}
|
|
3879
3864
|
return child;
|
|
3880
3865
|
}),
|
|
3881
|
-
isLoading && /* @__PURE__ */ (0,
|
|
3866
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "fixed top-0 left-0 w-full h-screen flex items-center justify-center bg-white bg-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: loader }) })
|
|
3882
3867
|
]
|
|
3883
3868
|
}
|
|
3884
3869
|
);
|
|
3885
3870
|
}
|
|
3886
3871
|
|
|
3887
3872
|
// src/input/index.tsx
|
|
3888
|
-
var
|
|
3873
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
3889
3874
|
function Input({
|
|
3890
3875
|
label,
|
|
3891
3876
|
className,
|
|
@@ -3895,14 +3880,14 @@ function Input({
|
|
|
3895
3880
|
}) {
|
|
3896
3881
|
const value = `${(props == null ? void 0 : props.value) || ""}`;
|
|
3897
3882
|
const isValid = !regex ? true : regex.test(value);
|
|
3898
|
-
return /* @__PURE__ */ (0,
|
|
3899
|
-
/* @__PURE__ */ (0,
|
|
3900
|
-
/* @__PURE__ */ (0,
|
|
3883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "w-full", children: [
|
|
3884
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
3885
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "font-bold ", children: [
|
|
3901
3886
|
label,
|
|
3902
3887
|
" ",
|
|
3903
|
-
(props == null ? void 0 : props.required) && /* @__PURE__ */ (0,
|
|
3888
|
+
(props == null ? void 0 : props.required) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-red-500", children: "*" })
|
|
3904
3889
|
] }),
|
|
3905
|
-
/* @__PURE__ */ (0,
|
|
3890
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3906
3891
|
"input",
|
|
3907
3892
|
{
|
|
3908
3893
|
...props,
|
|
@@ -3915,7 +3900,7 @@ function Input({
|
|
|
3915
3900
|
}
|
|
3916
3901
|
) })
|
|
3917
3902
|
] }),
|
|
3918
|
-
!isValid && value != "" && /* @__PURE__ */ (0,
|
|
3903
|
+
!isValid && value != "" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "text-red-800 invalid", children: invalidMessage })
|
|
3919
3904
|
] });
|
|
3920
3905
|
}
|
|
3921
3906
|
|
|
@@ -35694,14 +35679,14 @@ function useExcel() {
|
|
|
35694
35679
|
|
|
35695
35680
|
// src/table/index.tsx
|
|
35696
35681
|
var import_material2 = require("@mui/material");
|
|
35697
|
-
var
|
|
35682
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
35698
35683
|
function Table(props) {
|
|
35699
35684
|
if (Array.isArray(props.data)) {
|
|
35700
|
-
return /* @__PURE__ */ (0,
|
|
35685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IHTable, { ...props });
|
|
35701
35686
|
} else {
|
|
35702
|
-
return /* @__PURE__ */ (0,
|
|
35703
|
-
/* @__PURE__ */ (0,
|
|
35704
|
-
/* @__PURE__ */ (0,
|
|
35687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: " bg-white border shadow rounded p-1", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("table", { className: "rounded", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("tbody", { children: Object.keys(props.data).map((k) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("tr", { className: "border-b ", children: [
|
|
35688
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("th", { className: "font-bold p-3 text-right", children: k }),
|
|
35689
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
35705
35690
|
"td",
|
|
35706
35691
|
{
|
|
35707
35692
|
className: typeof props.data[k] === "number" ? "text-right" : "text-center",
|
|
@@ -35712,7 +35697,7 @@ function Table(props) {
|
|
|
35712
35697
|
}
|
|
35713
35698
|
}
|
|
35714
35699
|
function EditIcon() {
|
|
35715
|
-
return /* @__PURE__ */ (0,
|
|
35700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
35716
35701
|
"svg",
|
|
35717
35702
|
{
|
|
35718
35703
|
stroke: "currentColor",
|
|
@@ -35722,7 +35707,7 @@ function EditIcon() {
|
|
|
35722
35707
|
height: "20px",
|
|
35723
35708
|
width: "20px",
|
|
35724
35709
|
xmlns: "http://www.w3.org/2000/svg",
|
|
35725
|
-
children: /* @__PURE__ */ (0,
|
|
35710
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" })
|
|
35726
35711
|
}
|
|
35727
35712
|
);
|
|
35728
35713
|
}
|
|
@@ -35792,14 +35777,14 @@ function IHTable({
|
|
|
35792
35777
|
type: "string",
|
|
35793
35778
|
renderCell: (params) => {
|
|
35794
35779
|
var _a;
|
|
35795
|
-
return /* @__PURE__ */ (0,
|
|
35780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
35796
35781
|
Button,
|
|
35797
35782
|
{
|
|
35798
35783
|
className: "text-xs",
|
|
35799
35784
|
onClick: () => {
|
|
35800
35785
|
handleOpen();
|
|
35801
35786
|
},
|
|
35802
|
-
icon: /* @__PURE__ */ (0,
|
|
35787
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EditIcon, {}),
|
|
35803
35788
|
children: (_a = params == null ? void 0 : params.row) == null ? void 0 : _a["Modal"]
|
|
35804
35789
|
}
|
|
35805
35790
|
);
|
|
@@ -35835,7 +35820,7 @@ function IHTable({
|
|
|
35835
35820
|
}
|
|
35836
35821
|
return filtered2;
|
|
35837
35822
|
}, [selectedRows]);
|
|
35838
|
-
return rows.length > 0 && /* @__PURE__ */ (0,
|
|
35823
|
+
return rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
35839
35824
|
import_material.Box,
|
|
35840
35825
|
{
|
|
35841
35826
|
sx: {
|
|
@@ -35846,8 +35831,8 @@ function IHTable({
|
|
|
35846
35831
|
zIndex: 999999999
|
|
35847
35832
|
},
|
|
35848
35833
|
children: [
|
|
35849
|
-
modal && /* @__PURE__ */ (0,
|
|
35850
|
-
/* @__PURE__ */ (0,
|
|
35834
|
+
modal && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material2.Dialog, { open, onClose: handleClose, maxWidth: "xl", fullWidth: true, children: [
|
|
35835
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
35851
35836
|
"button",
|
|
35852
35837
|
{
|
|
35853
35838
|
onClick: () => {
|
|
@@ -35857,15 +35842,15 @@ function IHTable({
|
|
|
35857
35842
|
children: "\xD7"
|
|
35858
35843
|
}
|
|
35859
35844
|
) }),
|
|
35860
|
-
/* @__PURE__ */ (0,
|
|
35845
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mt-4 m-auto p-5", children: selectedRows && Array.from(selectedRows == null ? void 0 : selectedRows.ids).length > 0 && import_react4.default.cloneElement(modal, {
|
|
35861
35846
|
row: rows.find(
|
|
35862
35847
|
(r) => Array.from(selectedRows == null ? void 0 : selectedRows.ids).includes(r.id)
|
|
35863
35848
|
)
|
|
35864
35849
|
}) })
|
|
35865
35850
|
] }),
|
|
35866
|
-
header && /* @__PURE__ */ (0,
|
|
35867
|
-
(exportName || onSave || onSelect) && /* @__PURE__ */ (0,
|
|
35868
|
-
exportName && /* @__PURE__ */ (0,
|
|
35851
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "font-bold text-xl p-2 bg-blue-500 text-white border shadow rounded", children: header }),
|
|
35852
|
+
(exportName || onSave || onSelect) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex gap-2 bg-gray-200 border shadow rounded p-2", children: [
|
|
35853
|
+
exportName && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
35869
35854
|
Button,
|
|
35870
35855
|
{
|
|
35871
35856
|
className: "bg-green-800 text-white",
|
|
@@ -35878,7 +35863,7 @@ function IHTable({
|
|
|
35878
35863
|
children: "Exportar"
|
|
35879
35864
|
}
|
|
35880
35865
|
),
|
|
35881
|
-
onSelect ? /* @__PURE__ */ (0,
|
|
35866
|
+
onSelect ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
35882
35867
|
Button,
|
|
35883
35868
|
{
|
|
35884
35869
|
disabled: filtered.length == 0,
|
|
@@ -35888,7 +35873,7 @@ function IHTable({
|
|
|
35888
35873
|
},
|
|
35889
35874
|
children: "Guardar Selecci\xF3n"
|
|
35890
35875
|
}
|
|
35891
|
-
) : onSave && /* @__PURE__ */ (0,
|
|
35876
|
+
) : onSave && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
35892
35877
|
Button,
|
|
35893
35878
|
{
|
|
35894
35879
|
onClick: (e) => {
|
|
@@ -35898,7 +35883,7 @@ function IHTable({
|
|
|
35898
35883
|
}
|
|
35899
35884
|
)
|
|
35900
35885
|
] }),
|
|
35901
|
-
/* @__PURE__ */ (0,
|
|
35886
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
35902
35887
|
import_x_data_grid.DataGrid,
|
|
35903
35888
|
{
|
|
35904
35889
|
rows,
|
|
@@ -35919,7 +35904,7 @@ function IHTable({
|
|
|
35919
35904
|
pageSizeOptions: [5, 10]
|
|
35920
35905
|
}
|
|
35921
35906
|
),
|
|
35922
|
-
/* @__PURE__ */ (0,
|
|
35907
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CustomFooter, { footer: footer || {}, rows })
|
|
35923
35908
|
]
|
|
35924
35909
|
}
|
|
35925
35910
|
);
|
|
@@ -35946,23 +35931,23 @@ function CustomFooter({
|
|
|
35946
35931
|
avg: "Promedio",
|
|
35947
35932
|
count: "Conteo"
|
|
35948
35933
|
};
|
|
35949
|
-
return /* @__PURE__ */ (0,
|
|
35934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex justify-end gap-6 px-4 py-2 bg-gray-100 border-t border-gray-300 text-sm font-semibold text-gray-700", children: entries.map(([key, type]) => {
|
|
35950
35935
|
const value = compute(key, type);
|
|
35951
35936
|
const formatted = type === "avg" ? value.toLocaleString(void 0, { maximumFractionDigits: 2 }) : value.toLocaleString();
|
|
35952
|
-
return /* @__PURE__ */ (0,
|
|
35937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
35953
35938
|
label[type],
|
|
35954
35939
|
" de ",
|
|
35955
|
-
/* @__PURE__ */ (0,
|
|
35940
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-gray-900", children: key }),
|
|
35956
35941
|
":",
|
|
35957
35942
|
" ",
|
|
35958
|
-
/* @__PURE__ */ (0,
|
|
35943
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-blue-700", children: formatted })
|
|
35959
35944
|
] }, key);
|
|
35960
35945
|
}) });
|
|
35961
35946
|
}
|
|
35962
35947
|
|
|
35963
35948
|
// src/text-area/index.tsx
|
|
35964
35949
|
var import_react5 = require("react");
|
|
35965
|
-
var
|
|
35950
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
35966
35951
|
function TextArea({
|
|
35967
35952
|
label,
|
|
35968
35953
|
className,
|
|
@@ -35972,14 +35957,14 @@ function TextArea({
|
|
|
35972
35957
|
...props
|
|
35973
35958
|
}) {
|
|
35974
35959
|
const [value, setValue] = (0, import_react5.useState)((props == null ? void 0 : props.value) || "");
|
|
35975
|
-
return /* @__PURE__ */ (0,
|
|
35976
|
-
/* @__PURE__ */ (0,
|
|
35960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
35961
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "font-bold ", children: [
|
|
35977
35962
|
label,
|
|
35978
35963
|
" ",
|
|
35979
|
-
(props == null ? void 0 : props.required) && /* @__PURE__ */ (0,
|
|
35964
|
+
(props == null ? void 0 : props.required) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-red-500", children: "*" })
|
|
35980
35965
|
] }),
|
|
35981
|
-
/* @__PURE__ */ (0,
|
|
35982
|
-
/* @__PURE__ */ (0,
|
|
35966
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
35967
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
35983
35968
|
"textarea",
|
|
35984
35969
|
{
|
|
35985
35970
|
...props,
|
|
@@ -35996,7 +35981,7 @@ function TextArea({
|
|
|
35996
35981
|
}
|
|
35997
35982
|
}
|
|
35998
35983
|
),
|
|
35999
|
-
maxLength && /* @__PURE__ */ (0,
|
|
35984
|
+
maxLength && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: " text-xs text-gray text-right", children: [
|
|
36000
35985
|
value.length,
|
|
36001
35986
|
" / ",
|
|
36002
35987
|
maxLength
|
|
@@ -36496,9 +36481,9 @@ function useResources({
|
|
|
36496
36481
|
var import_react8 = __toESM(require("react"));
|
|
36497
36482
|
|
|
36498
36483
|
// src/select/icon.tsx
|
|
36499
|
-
var
|
|
36484
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
36500
36485
|
function SelectIcon() {
|
|
36501
|
-
return /* @__PURE__ */ (0,
|
|
36486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
36502
36487
|
"svg",
|
|
36503
36488
|
{
|
|
36504
36489
|
stroke: "currentColor",
|
|
@@ -36508,15 +36493,15 @@ function SelectIcon() {
|
|
|
36508
36493
|
height: "20px",
|
|
36509
36494
|
width: "20px",
|
|
36510
36495
|
xmlns: "http://www.w3.org/2000/svg",
|
|
36511
|
-
children: /* @__PURE__ */ (0,
|
|
36496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" })
|
|
36512
36497
|
}
|
|
36513
36498
|
);
|
|
36514
36499
|
}
|
|
36515
36500
|
|
|
36516
36501
|
// src/select/close.tsx
|
|
36517
|
-
var
|
|
36502
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
36518
36503
|
function CloseIcon() {
|
|
36519
|
-
return /* @__PURE__ */ (0,
|
|
36504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
36520
36505
|
"svg",
|
|
36521
36506
|
{
|
|
36522
36507
|
stroke: "currentColor",
|
|
@@ -36526,13 +36511,13 @@ function CloseIcon() {
|
|
|
36526
36511
|
height: "20px",
|
|
36527
36512
|
width: "20px",
|
|
36528
36513
|
xmlns: "http://www.w3.org/2000/svg",
|
|
36529
|
-
children: /* @__PURE__ */ (0,
|
|
36514
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm86.63 272L320 342.63l-64-64-64 64L169.37 320l64-64-64-64L192 169.37l64 64 64-64L342.63 192l-64 64z" })
|
|
36530
36515
|
}
|
|
36531
36516
|
);
|
|
36532
36517
|
}
|
|
36533
36518
|
|
|
36534
36519
|
// src/select/index.tsx
|
|
36535
|
-
var
|
|
36520
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
36536
36521
|
function Select({
|
|
36537
36522
|
label,
|
|
36538
36523
|
placeholder = "Selecciona...",
|
|
@@ -36612,14 +36597,14 @@ function Select({
|
|
|
36612
36597
|
}
|
|
36613
36598
|
}
|
|
36614
36599
|
}, [isOpen]);
|
|
36615
|
-
return /* @__PURE__ */ (0,
|
|
36616
|
-
label && /* @__PURE__ */ (0,
|
|
36600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { ref: containerRef, className: "w-full", children: [
|
|
36601
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "font-bold mb-1 block", children: [
|
|
36617
36602
|
label,
|
|
36618
36603
|
" ",
|
|
36619
|
-
(props == null ? void 0 : props.required) && /* @__PURE__ */ (0,
|
|
36604
|
+
(props == null ? void 0 : props.required) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-red-500", children: "*" })
|
|
36620
36605
|
] }),
|
|
36621
|
-
/* @__PURE__ */ (0,
|
|
36622
|
-
/* @__PURE__ */ (0,
|
|
36606
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative", children: [
|
|
36607
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
36623
36608
|
"input",
|
|
36624
36609
|
{
|
|
36625
36610
|
autoComplete: "off",
|
|
@@ -36658,8 +36643,8 @@ function Select({
|
|
|
36658
36643
|
onKeyDown: handleKeyDown
|
|
36659
36644
|
}
|
|
36660
36645
|
),
|
|
36661
|
-
!isOpen && /* @__PURE__ */ (0,
|
|
36662
|
-
isOpen && inputValue != "" && /* @__PURE__ */ (0,
|
|
36646
|
+
!isOpen && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute top-0 right-0 flex flex-col justify-center items-center px-2 py-2 font-bold", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectIcon, {}) }),
|
|
36647
|
+
isOpen && inputValue != "" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
36663
36648
|
"button",
|
|
36664
36649
|
{
|
|
36665
36650
|
onClick: (e) => {
|
|
@@ -36674,15 +36659,15 @@ function Select({
|
|
|
36674
36659
|
},
|
|
36675
36660
|
className: "absolute top-0 right-0 flex flex-col justify-center items-center px-2 py-2 font-bold text-red-500",
|
|
36676
36661
|
style: { zIndex: 999999999 },
|
|
36677
|
-
children: /* @__PURE__ */ (0,
|
|
36662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseIcon, {})
|
|
36678
36663
|
}
|
|
36679
36664
|
),
|
|
36680
|
-
isOpen && filtered.length > 0 && /* @__PURE__ */ (0,
|
|
36665
|
+
isOpen && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
36681
36666
|
"div",
|
|
36682
36667
|
{
|
|
36683
36668
|
style: { zIndex: 9999999999 },
|
|
36684
36669
|
className: `absolute w-full border rounded shadow bg-white z-10 max-h-100 overflow-y-auto ${openUpwards ? "bottom-full mb-1" : "mt-1"}`,
|
|
36685
|
-
children: filtered.map((opt, index) => /* @__PURE__ */ (0,
|
|
36670
|
+
children: filtered.map((opt, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
36686
36671
|
"div",
|
|
36687
36672
|
{
|
|
36688
36673
|
className: `p-2 cursor-pointer ${index === highlightedIndex ? "bg-blue-100" : "hover:bg-gray-100"}`,
|
|
@@ -36718,7 +36703,7 @@ function Select({
|
|
|
36718
36703
|
}
|
|
36719
36704
|
)
|
|
36720
36705
|
] }),
|
|
36721
|
-
isOpen && /* @__PURE__ */ (0,
|
|
36706
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
36722
36707
|
"div",
|
|
36723
36708
|
{
|
|
36724
36709
|
style: { zIndex: 1 },
|
|
@@ -36736,9 +36721,9 @@ function Select({
|
|
|
36736
36721
|
var import_react9 = __toESM(require("react"));
|
|
36737
36722
|
|
|
36738
36723
|
// src/modal/close.tsx
|
|
36739
|
-
var
|
|
36724
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
36740
36725
|
function CloseIcon2() {
|
|
36741
|
-
return /* @__PURE__ */ (0,
|
|
36726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
36742
36727
|
"svg",
|
|
36743
36728
|
{
|
|
36744
36729
|
stroke: "currentColor",
|
|
@@ -36748,14 +36733,14 @@ function CloseIcon2() {
|
|
|
36748
36733
|
height: "20px",
|
|
36749
36734
|
width: "20px",
|
|
36750
36735
|
xmlns: "http://www.w3.org/2000/svg",
|
|
36751
|
-
children: /* @__PURE__ */ (0,
|
|
36736
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm86.63 272L320 342.63l-64-64-64 64L169.37 320l64-64-64-64L192 169.37l64 64 64-64L342.63 192l-64 64z" })
|
|
36752
36737
|
}
|
|
36753
36738
|
);
|
|
36754
36739
|
}
|
|
36755
36740
|
|
|
36756
36741
|
// src/modal/index.tsx
|
|
36757
36742
|
var import_material3 = require("@mui/material");
|
|
36758
|
-
var
|
|
36743
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
36759
36744
|
function Modal({ button, children, ref, title = "" }) {
|
|
36760
36745
|
const [open, setOpen] = (0, import_react9.useState)(false);
|
|
36761
36746
|
function show() {
|
|
@@ -36764,7 +36749,7 @@ function Modal({ button, children, ref, title = "" }) {
|
|
|
36764
36749
|
function hide() {
|
|
36765
36750
|
setOpen(false);
|
|
36766
36751
|
}
|
|
36767
|
-
return /* @__PURE__ */ (0,
|
|
36752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
36768
36753
|
import_react9.default.Children.map(button, (child) => {
|
|
36769
36754
|
if (import_react9.default.isValidElement(child)) {
|
|
36770
36755
|
const { type, props } = child;
|
|
@@ -36779,17 +36764,17 @@ function Modal({ button, children, ref, title = "" }) {
|
|
|
36779
36764
|
}
|
|
36780
36765
|
return child;
|
|
36781
36766
|
}),
|
|
36782
|
-
/* @__PURE__ */ (0,
|
|
36783
|
-
/* @__PURE__ */ (0,
|
|
36767
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material3.Dialog, { open, onClose: hide, fullWidth: true, maxWidth: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "m-auto p-5", children: [
|
|
36768
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
36784
36769
|
"button",
|
|
36785
36770
|
{
|
|
36786
36771
|
onClick: hide,
|
|
36787
36772
|
className: "absolute top-0 right-0 text-red-500 ",
|
|
36788
|
-
children: /* @__PURE__ */ (0,
|
|
36773
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseIcon2, {})
|
|
36789
36774
|
}
|
|
36790
36775
|
),
|
|
36791
|
-
/* @__PURE__ */ (0,
|
|
36792
|
-
/* @__PURE__ */ (0,
|
|
36776
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "font-bold text-xl", children: title }),
|
|
36777
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-col gap-3 pt-6", children: import_react9.default.Children.map(children, (child) => {
|
|
36793
36778
|
if (import_react9.default.isValidElement(child)) {
|
|
36794
36779
|
const { type, props } = child;
|
|
36795
36780
|
return import_react9.default.createElement(type, { ...props, hide });
|
|
@@ -36801,10 +36786,10 @@ function Modal({ button, children, ref, title = "" }) {
|
|
|
36801
36786
|
}
|
|
36802
36787
|
|
|
36803
36788
|
// src/pre/index.tsx
|
|
36804
|
-
var
|
|
36789
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
36805
36790
|
var Pre = ({ data }) => {
|
|
36806
36791
|
const formatted = JSON.stringify(data, null, 2);
|
|
36807
|
-
return /* @__PURE__ */ (0,
|
|
36792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
36808
36793
|
"pre",
|
|
36809
36794
|
{
|
|
36810
36795
|
style: {
|
|
@@ -36853,9 +36838,9 @@ var import_react10 = require("react");
|
|
|
36853
36838
|
var import_react_datepicker = __toESM(require("react-datepicker"));
|
|
36854
36839
|
|
|
36855
36840
|
// src/calendar/calendar.icon.tsx
|
|
36856
|
-
var
|
|
36841
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
36857
36842
|
function CalendarIcon() {
|
|
36858
|
-
return /* @__PURE__ */ (0,
|
|
36843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
36859
36844
|
"svg",
|
|
36860
36845
|
{
|
|
36861
36846
|
stroke: "currentColor",
|
|
@@ -36865,14 +36850,14 @@ function CalendarIcon() {
|
|
|
36865
36850
|
height: "20px",
|
|
36866
36851
|
width: "20px",
|
|
36867
36852
|
xmlns: "http://www.w3.org/2000/svg",
|
|
36868
|
-
children: /* @__PURE__ */ (0,
|
|
36853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M12 192h424c6.6 0 12 5.4 12 12v260c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V204c0-6.6 5.4-12 12-12zm436-44v-36c0-26.5-21.5-48-48-48h-48V12c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v52H160V12c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v52H48C21.5 64 0 85.5 0 112v36c0 6.6 5.4 12 12 12h424c6.6 0 12-5.4 12-12z" })
|
|
36869
36854
|
}
|
|
36870
36855
|
);
|
|
36871
36856
|
}
|
|
36872
36857
|
|
|
36873
36858
|
// src/calendar/index.tsx
|
|
36874
36859
|
var import_material4 = require("@mui/material");
|
|
36875
|
-
var
|
|
36860
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
36876
36861
|
function MyCalendar({
|
|
36877
36862
|
enabledDates,
|
|
36878
36863
|
onChange,
|
|
@@ -36903,20 +36888,20 @@ function MyCalendar({
|
|
|
36903
36888
|
if (!(enabledDates == null ? void 0 : enabledDates.length)) {
|
|
36904
36889
|
return null;
|
|
36905
36890
|
}
|
|
36906
|
-
return /* @__PURE__ */ (0,
|
|
36907
|
-
/* @__PURE__ */ (0,
|
|
36908
|
-
/* @__PURE__ */ (0,
|
|
36891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "relative", children: [
|
|
36892
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
36893
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "font-bold", children: [
|
|
36909
36894
|
label,
|
|
36910
36895
|
" ",
|
|
36911
|
-
(otherProps == null ? void 0 : otherProps.required) && /* @__PURE__ */ (0,
|
|
36896
|
+
(otherProps == null ? void 0 : otherProps.required) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-red-500", children: "*" })
|
|
36912
36897
|
] }),
|
|
36913
|
-
/* @__PURE__ */ (0,
|
|
36898
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
36914
36899
|
"div",
|
|
36915
36900
|
{
|
|
36916
36901
|
className: "cursor-pointer flex items-center justify-center",
|
|
36917
36902
|
onClick: (e) => setOpen(true),
|
|
36918
36903
|
children: [
|
|
36919
|
-
/* @__PURE__ */ (0,
|
|
36904
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
36920
36905
|
"input",
|
|
36921
36906
|
{
|
|
36922
36907
|
...otherProps,
|
|
@@ -36931,13 +36916,13 @@ function MyCalendar({
|
|
|
36931
36916
|
readOnly: true
|
|
36932
36917
|
}
|
|
36933
36918
|
),
|
|
36934
|
-
/* @__PURE__ */ (0,
|
|
36919
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "absolute", style: { right: "10px" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CalendarIcon, {}) })
|
|
36935
36920
|
]
|
|
36936
36921
|
}
|
|
36937
36922
|
) })
|
|
36938
36923
|
] }),
|
|
36939
|
-
/* @__PURE__ */ (0,
|
|
36940
|
-
/* @__PURE__ */ (0,
|
|
36924
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_material4.Dialog, { open, children: [
|
|
36925
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex justify-end p-5 font-bold", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
36941
36926
|
"button",
|
|
36942
36927
|
{
|
|
36943
36928
|
className: " border-lg w-[20px] bg-red-500 text-white shadow rounded",
|
|
@@ -36945,7 +36930,7 @@ function MyCalendar({
|
|
|
36945
36930
|
children: "x"
|
|
36946
36931
|
}
|
|
36947
36932
|
) }),
|
|
36948
|
-
/* @__PURE__ */ (0,
|
|
36933
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: " w-[300px] flex items-start justify-center h-[300px] p-5", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
36949
36934
|
import_react_datepicker.default,
|
|
36950
36935
|
{
|
|
36951
36936
|
inline: true,
|
|
@@ -36959,9 +36944,9 @@ function MyCalendar({
|
|
|
36959
36944
|
}
|
|
36960
36945
|
|
|
36961
36946
|
// src/doc-viewer/icon.tsx
|
|
36962
|
-
var
|
|
36947
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
36963
36948
|
function Icon() {
|
|
36964
|
-
return /* @__PURE__ */ (0,
|
|
36949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
36965
36950
|
"svg",
|
|
36966
36951
|
{
|
|
36967
36952
|
stroke: "currentColor",
|
|
@@ -36971,13 +36956,13 @@ function Icon() {
|
|
|
36971
36956
|
height: "200px",
|
|
36972
36957
|
width: "200px",
|
|
36973
36958
|
xmlns: "http://www.w3.org/2000/svg",
|
|
36974
|
-
children: /* @__PURE__ */ (0,
|
|
36959
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v88a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216a2,2,0,0,1-2,2H176a6,6,0,0,0,0,12h24a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM108,130a50,50,0,0,0-46.66,32H60a34,34,0,0,0,0,68h48a50,50,0,0,0,0-100Zm0,88H60a22,22,0,0,1-1.65-43.94c-.06.47-.1.93-.15,1.4a6,6,0,1,0,12,1.08A38.57,38.57,0,0,1,71.3,170a5.71,5.71,0,0,0,.24-.86A38,38,0,1,1,108,218Z" })
|
|
36975
36960
|
}
|
|
36976
36961
|
);
|
|
36977
36962
|
}
|
|
36978
36963
|
|
|
36979
36964
|
// src/doc-viewer/index.tsx
|
|
36980
|
-
var
|
|
36965
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
36981
36966
|
function DocumentViewer({ item }) {
|
|
36982
36967
|
const { url, name, contentType, width = "100%", height = "100%" } = item;
|
|
36983
36968
|
const isImage = contentType.startsWith("image/");
|
|
@@ -36986,10 +36971,10 @@ function DocumentViewer({ item }) {
|
|
|
36986
36971
|
const viewerUrl = isGoogleDocCompatible ? `https://docs.google.com/gview?url=${encodeURIComponent(
|
|
36987
36972
|
url
|
|
36988
36973
|
)}&embedded=true` : url;
|
|
36989
|
-
return /* @__PURE__ */ (0,
|
|
36990
|
-
/* @__PURE__ */ (0,
|
|
36991
|
-
/* @__PURE__ */ (0,
|
|
36992
|
-
/* @__PURE__ */ (0,
|
|
36974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "border shadow rounded p-2 h-[100%]", children: [
|
|
36975
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mb-1 flex justify-between ", children: [
|
|
36976
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h3", { className: "font-bold", children: name }),
|
|
36977
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
36993
36978
|
"a",
|
|
36994
36979
|
{
|
|
36995
36980
|
href: url,
|
|
@@ -37001,7 +36986,7 @@ function DocumentViewer({ item }) {
|
|
|
37001
36986
|
}
|
|
37002
36987
|
)
|
|
37003
36988
|
] }),
|
|
37004
|
-
isImage ? /* @__PURE__ */ (0,
|
|
36989
|
+
isImage ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
37005
36990
|
"img",
|
|
37006
36991
|
{
|
|
37007
36992
|
src: url,
|
|
@@ -37014,7 +36999,7 @@ function DocumentViewer({ item }) {
|
|
|
37014
36999
|
display: "block"
|
|
37015
37000
|
}
|
|
37016
37001
|
}
|
|
37017
|
-
) : isGoogleDocCompatible ? /* @__PURE__ */ (0,
|
|
37002
|
+
) : isGoogleDocCompatible ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
37018
37003
|
"iframe",
|
|
37019
37004
|
{
|
|
37020
37005
|
title: name,
|
|
@@ -37022,7 +37007,7 @@ function DocumentViewer({ item }) {
|
|
|
37022
37007
|
style: { width, height, border: "none" },
|
|
37023
37008
|
allowFullScreen: true
|
|
37024
37009
|
}
|
|
37025
|
-
) : /* @__PURE__ */ (0,
|
|
37010
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
37026
37011
|
"div",
|
|
37027
37012
|
{
|
|
37028
37013
|
style: {
|
|
@@ -37032,7 +37017,7 @@ function DocumentViewer({ item }) {
|
|
|
37032
37017
|
objectFit: "cover",
|
|
37033
37018
|
display: "block"
|
|
37034
37019
|
},
|
|
37035
|
-
children: /* @__PURE__ */ (0,
|
|
37020
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, {})
|
|
37036
37021
|
}
|
|
37037
37022
|
)
|
|
37038
37023
|
] });
|
|
@@ -37045,9 +37030,9 @@ var import_react15 = __toESM(require("react"));
|
|
|
37045
37030
|
var import_react11 = require("react");
|
|
37046
37031
|
|
|
37047
37032
|
// src/table3/filters.tsx
|
|
37048
|
-
var
|
|
37033
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
37049
37034
|
function FilterOffIcon() {
|
|
37050
|
-
return /* @__PURE__ */ (0,
|
|
37035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
37051
37036
|
"svg",
|
|
37052
37037
|
{
|
|
37053
37038
|
stroke: "currentColor",
|
|
@@ -37057,12 +37042,12 @@ function FilterOffIcon() {
|
|
|
37057
37042
|
height: "20px",
|
|
37058
37043
|
width: "20px",
|
|
37059
37044
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37060
|
-
children: /* @__PURE__ */ (0,
|
|
37045
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M6.92893 0.514648L21.0711 14.6568L19.6569 16.071L15.834 12.2486L14 14.9999V21.9999H10V14.9999L4 5.99993H3V3.99993L7.585 3.99965L5.51472 1.92886L6.92893 0.514648ZM21 3.99993V5.99993H20L18.085 8.87193L13.213 3.99993H21Z" })
|
|
37061
37046
|
}
|
|
37062
37047
|
);
|
|
37063
37048
|
}
|
|
37064
37049
|
function OrderDesc() {
|
|
37065
|
-
return /* @__PURE__ */ (0,
|
|
37050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
37066
37051
|
"svg",
|
|
37067
37052
|
{
|
|
37068
37053
|
stroke: "currentColor",
|
|
@@ -37072,12 +37057,12 @@ function OrderDesc() {
|
|
|
37072
37057
|
height: "20px",
|
|
37073
37058
|
width: "20px",
|
|
37074
37059
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37075
|
-
children: /* @__PURE__ */ (0,
|
|
37060
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M176 352h-48V48a16 16 0 0 0-16-16H80a16 16 0 0 0-16 16v304H16c-14.19 0-21.36 17.24-11.29 27.31l80 96a16 16 0 0 0 22.62 0l80-96C197.35 369.26 190.22 352 176 352zm112-128h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-56l61.26-70.45A32 32 0 0 0 432 65.63V48a16 16 0 0 0-16-16H288a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h56l-61.26 70.45A32 32 0 0 0 272 190.37V208a16 16 0 0 0 16 16zm159.06 234.62l-59.27-160A16 16 0 0 0 372.72 288h-41.44a16 16 0 0 0-15.07 10.62l-59.27 160A16 16 0 0 0 272 480h24.83a16 16 0 0 0 15.23-11.08l4.42-12.92h71l4.41 12.92A16 16 0 0 0 407.16 480H432a16 16 0 0 0 15.06-21.38zM335.61 400L352 352l16.39 48z" })
|
|
37076
37061
|
}
|
|
37077
37062
|
);
|
|
37078
37063
|
}
|
|
37079
37064
|
function OrderAsc() {
|
|
37080
|
-
return /* @__PURE__ */ (0,
|
|
37065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
37081
37066
|
"svg",
|
|
37082
37067
|
{
|
|
37083
37068
|
stroke: "currentColor",
|
|
@@ -37087,12 +37072,12 @@ function OrderAsc() {
|
|
|
37087
37072
|
height: "20px",
|
|
37088
37073
|
width: "20px",
|
|
37089
37074
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37090
|
-
children: /* @__PURE__ */ (0,
|
|
37075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M176 352h-48V48a16 16 0 0 0-16-16H80a16 16 0 0 0-16 16v304H16c-14.19 0-21.36 17.24-11.29 27.31l80 96a16 16 0 0 0 22.62 0l80-96C197.35 369.26 190.22 352 176 352zm240-64H288a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h56l-61.26 70.45A32 32 0 0 0 272 446.37V464a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-56l61.26-70.45A32 32 0 0 0 432 321.63V304a16 16 0 0 0-16-16zm31.06-85.38l-59.27-160A16 16 0 0 0 372.72 32h-41.44a16 16 0 0 0-15.07 10.62l-59.27 160A16 16 0 0 0 272 224h24.83a16 16 0 0 0 15.23-11.08l4.42-12.92h71l4.41 12.92A16 16 0 0 0 407.16 224H432a16 16 0 0 0 15.06-21.38zM335.61 144L352 96l16.39 48z" })
|
|
37091
37076
|
}
|
|
37092
37077
|
);
|
|
37093
37078
|
}
|
|
37094
37079
|
function EditIcon2() {
|
|
37095
|
-
return /* @__PURE__ */ (0,
|
|
37080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
37096
37081
|
"svg",
|
|
37097
37082
|
{
|
|
37098
37083
|
stroke: "currentColor",
|
|
@@ -37102,12 +37087,12 @@ function EditIcon2() {
|
|
|
37102
37087
|
height: "20px",
|
|
37103
37088
|
width: "20px",
|
|
37104
37089
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37105
|
-
children: /* @__PURE__ */ (0,
|
|
37090
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" })
|
|
37106
37091
|
}
|
|
37107
37092
|
);
|
|
37108
37093
|
}
|
|
37109
37094
|
function SaveIcon() {
|
|
37110
|
-
return /* @__PURE__ */ (0,
|
|
37095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
37111
37096
|
"svg",
|
|
37112
37097
|
{
|
|
37113
37098
|
stroke: "currentColor",
|
|
@@ -37118,14 +37103,14 @@ function SaveIcon() {
|
|
|
37118
37103
|
width: "20px",
|
|
37119
37104
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37120
37105
|
children: [
|
|
37121
|
-
/* @__PURE__ */ (0,
|
|
37122
|
-
/* @__PURE__ */ (0,
|
|
37106
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M272 64h-16c-4.4 0-8 3.6-8 8v72c0 4.4 7.6 8 12 8h12c4.4 0 8-3.6 8-8V72c0-4.4-3.6-8-8-8z" }),
|
|
37107
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M433.9 130.1L382 78.2c-9-9-21.3-14.2-34.1-14.2h-28c-8.8 0-16 7.3-16 16.2v80c0 8.8-7.2 16-16 16H160c-8.8 0-16-7.2-16-16v-80c0-8.8-7.2-16.2-16-16.2H96c-17.6 0-32 14.4-32 32v320c0 17.6 14.4 32 32 32h320c17.6 0 32-14.4 32-32V164c0-12.7-5.1-24.9-14.1-33.9zM322 400.1c0 8.8-8 16-17.8 16H143.8c-9.8 0-17.8-7.2-17.8-16v-96c0-8.8 8-16 17.8-16h160.4c9.8 0 17.8 7.2 17.8 16v96z" })
|
|
37123
37108
|
]
|
|
37124
37109
|
}
|
|
37125
37110
|
);
|
|
37126
37111
|
}
|
|
37127
37112
|
function ExcelIcon() {
|
|
37128
|
-
return /* @__PURE__ */ (0,
|
|
37113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
37129
37114
|
"svg",
|
|
37130
37115
|
{
|
|
37131
37116
|
stroke: "currentColor",
|
|
@@ -37135,13 +37120,13 @@ function ExcelIcon() {
|
|
|
37135
37120
|
height: "20px",
|
|
37136
37121
|
width: "20px",
|
|
37137
37122
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37138
|
-
children: /* @__PURE__ */ (0,
|
|
37123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M2.85858 2.87732L15.4293 1.0815C15.7027 1.04245 15.9559 1.2324 15.995 1.50577C15.9983 1.52919 16 1.55282 16 1.57648V22.4235C16 22.6996 15.7761 22.9235 15.5 22.9235C15.4763 22.9235 15.4527 22.9218 15.4293 22.9184L2.85858 21.1226C2.36593 21.0522 2 20.6303 2 20.1327V3.86727C2 3.36962 2.36593 2.9477 2.85858 2.87732ZM17 2.99997H21C21.5523 2.99997 22 3.44769 22 3.99997V20C22 20.5523 21.5523 21 21 21H17V2.99997ZM10.2 12L13 7.99997H10.6L9 10.2857L7.39999 7.99997H5L7.8 12L5 16H7.39999L9 13.7143L10.6 16H13L10.2 12Z" })
|
|
37139
37124
|
}
|
|
37140
37125
|
);
|
|
37141
37126
|
}
|
|
37142
37127
|
|
|
37143
37128
|
// src/table3/filter.tsx
|
|
37144
|
-
var
|
|
37129
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
37145
37130
|
function Filter({
|
|
37146
37131
|
h,
|
|
37147
37132
|
objectData,
|
|
@@ -37202,8 +37187,8 @@ function Filter({
|
|
|
37202
37187
|
setSelected(news);
|
|
37203
37188
|
}
|
|
37204
37189
|
}, [data]);
|
|
37205
|
-
return /* @__PURE__ */ (0,
|
|
37206
|
-
/* @__PURE__ */ (0,
|
|
37190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("th", { className: "cursor-pointer", children: [
|
|
37191
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "relative", children: visible && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
37207
37192
|
"div",
|
|
37208
37193
|
{
|
|
37209
37194
|
className: " w-full h-screen top-0 left-0 fixed ",
|
|
@@ -37211,8 +37196,8 @@ function Filter({
|
|
|
37211
37196
|
onClick: (e) => setVisible(!visible)
|
|
37212
37197
|
}
|
|
37213
37198
|
) }),
|
|
37214
|
-
/* @__PURE__ */ (0,
|
|
37215
|
-
/* @__PURE__ */ (0,
|
|
37199
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "relative w-full justify-center flex", children: [
|
|
37200
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
37216
37201
|
"div",
|
|
37217
37202
|
{
|
|
37218
37203
|
style: (colSizes == null ? void 0 : colSizes[h]) ? {
|
|
@@ -37224,19 +37209,19 @@ function Filter({
|
|
|
37224
37209
|
onClick: (e) => setVisible(!visible),
|
|
37225
37210
|
children: [
|
|
37226
37211
|
sort && //
|
|
37227
|
-
Object.keys(sort)[0] == h && ((sort == null ? void 0 : sort[h]) == "asc" ? /* @__PURE__ */ (0,
|
|
37228
|
-
/* @__PURE__ */ (0,
|
|
37229
|
-
selected.length < items.length && /* @__PURE__ */ (0,
|
|
37212
|
+
Object.keys(sort)[0] == h && ((sort == null ? void 0 : sort[h]) == "asc" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-green-300", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(OrderAsc, {}) }) : (sort == null ? void 0 : sort[h]) == "desc" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-green-300", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(OrderDesc, {}) })),
|
|
37213
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: h }),
|
|
37214
|
+
selected.length < items.length && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-red-500 ", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FilterOffIcon, {}) })
|
|
37230
37215
|
]
|
|
37231
37216
|
}
|
|
37232
37217
|
),
|
|
37233
|
-
visible && /* @__PURE__ */ (0,
|
|
37218
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
37234
37219
|
"div",
|
|
37235
37220
|
{
|
|
37236
37221
|
className: "border shadow rounded bg-white p-1 absolute left-0 text-black",
|
|
37237
37222
|
style: { zIndex: 9999 },
|
|
37238
|
-
children: /* @__PURE__ */ (0,
|
|
37239
|
-
/* @__PURE__ */ (0,
|
|
37223
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-1 w-[300px] min-w-[300px] resize-x overflow-auto", children: [
|
|
37224
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
37240
37225
|
"div",
|
|
37241
37226
|
{
|
|
37242
37227
|
onClick: (e) => {
|
|
@@ -37253,12 +37238,12 @@ function Filter({
|
|
|
37253
37238
|
},
|
|
37254
37239
|
className: "flex items-center gap-2 border p-1 hover:bg-blue-100",
|
|
37255
37240
|
children: [
|
|
37256
|
-
/* @__PURE__ */ (0,
|
|
37241
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(OrderAsc, {}),
|
|
37257
37242
|
" Ordenar de la A a la Z"
|
|
37258
37243
|
]
|
|
37259
37244
|
}
|
|
37260
37245
|
),
|
|
37261
|
-
/* @__PURE__ */ (0,
|
|
37246
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
37262
37247
|
"div",
|
|
37263
37248
|
{
|
|
37264
37249
|
onClick: (e) => {
|
|
@@ -37275,12 +37260,12 @@ function Filter({
|
|
|
37275
37260
|
},
|
|
37276
37261
|
className: "flex items-center gap-2 border p-1 hover:bg-blue-100",
|
|
37277
37262
|
children: [
|
|
37278
|
-
/* @__PURE__ */ (0,
|
|
37263
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(OrderDesc, {}),
|
|
37279
37264
|
"Ordenar de la Z a la A"
|
|
37280
37265
|
]
|
|
37281
37266
|
}
|
|
37282
37267
|
),
|
|
37283
|
-
selected.length < items.length && /* @__PURE__ */ (0,
|
|
37268
|
+
selected.length < items.length && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
37284
37269
|
"div",
|
|
37285
37270
|
{
|
|
37286
37271
|
className: "p-1 flex items-center justify-between px-2 bg-red-200 border shadow rounded",
|
|
@@ -37289,11 +37274,11 @@ function Filter({
|
|
|
37289
37274
|
},
|
|
37290
37275
|
children: [
|
|
37291
37276
|
"Borrar Filtro",
|
|
37292
|
-
/* @__PURE__ */ (0,
|
|
37277
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-white ", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FilterOffIcon, {}) })
|
|
37293
37278
|
]
|
|
37294
37279
|
}
|
|
37295
37280
|
),
|
|
37296
|
-
/* @__PURE__ */ (0,
|
|
37281
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
37297
37282
|
"input",
|
|
37298
37283
|
{
|
|
37299
37284
|
className: "border shadow rounded p-2 w-full",
|
|
@@ -37312,8 +37297,8 @@ function Filter({
|
|
|
37312
37297
|
}
|
|
37313
37298
|
}
|
|
37314
37299
|
) }),
|
|
37315
|
-
/* @__PURE__ */ (0,
|
|
37316
|
-
/* @__PURE__ */ (0,
|
|
37300
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "flex gap-1 cursor-pointer px-1", children: [
|
|
37301
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
37317
37302
|
"input",
|
|
37318
37303
|
{
|
|
37319
37304
|
type: "checkbox",
|
|
@@ -37329,9 +37314,9 @@ function Filter({
|
|
|
37329
37314
|
),
|
|
37330
37315
|
"(Seleccionar Todo)"
|
|
37331
37316
|
] }) }),
|
|
37332
|
-
/* @__PURE__ */ (0,
|
|
37333
|
-
return /* @__PURE__ */ (0,
|
|
37334
|
-
/* @__PURE__ */ (0,
|
|
37317
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "overflow-auto flex gap-1 flex-col p-1 border shadow rounded h-[300px]", children: itemsFiltered.map((item) => {
|
|
37318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "hover:bg-gray-100 ", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "flex gap-1 cursor-pointer truncate", children: [
|
|
37319
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
37335
37320
|
"input",
|
|
37336
37321
|
{
|
|
37337
37322
|
type: "checkbox",
|
|
@@ -37352,8 +37337,8 @@ function Filter({
|
|
|
37352
37337
|
item || "(Vacias)"
|
|
37353
37338
|
] }) }, item);
|
|
37354
37339
|
}) }),
|
|
37355
|
-
/* @__PURE__ */ (0,
|
|
37356
|
-
/* @__PURE__ */ (0,
|
|
37340
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex justify-between px-1", children: [
|
|
37341
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
37357
37342
|
"button",
|
|
37358
37343
|
{
|
|
37359
37344
|
className: "p-1 shadow rounded border bg-red-500 text-white",
|
|
@@ -37364,7 +37349,7 @@ function Filter({
|
|
|
37364
37349
|
children: "Cancelar"
|
|
37365
37350
|
}
|
|
37366
37351
|
),
|
|
37367
|
-
/* @__PURE__ */ (0,
|
|
37352
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
37368
37353
|
"button",
|
|
37369
37354
|
{
|
|
37370
37355
|
className: "p-1 shadow rounded border bg-blue-500 text-white",
|
|
@@ -37383,7 +37368,7 @@ function Filter({
|
|
|
37383
37368
|
}
|
|
37384
37369
|
|
|
37385
37370
|
// src/table3/head.tsx
|
|
37386
|
-
var
|
|
37371
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
37387
37372
|
function TableHead({
|
|
37388
37373
|
headers,
|
|
37389
37374
|
selectItems,
|
|
@@ -37398,9 +37383,9 @@ function TableHead({
|
|
|
37398
37383
|
sort,
|
|
37399
37384
|
setSort
|
|
37400
37385
|
}) {
|
|
37401
|
-
return /* @__PURE__ */ (0,
|
|
37402
|
-
modal && /* @__PURE__ */ (0,
|
|
37403
|
-
selectItems && /* @__PURE__ */ (0,
|
|
37386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("tr", { className: "bg-blue-500 text-white font-bold", children: [
|
|
37387
|
+
modal && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("th", { children: "-" }),
|
|
37388
|
+
selectItems && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("th", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
37404
37389
|
"input",
|
|
37405
37390
|
{
|
|
37406
37391
|
className: "m-2",
|
|
@@ -37428,7 +37413,7 @@ function TableHead({
|
|
|
37428
37413
|
) }),
|
|
37429
37414
|
Object.values(headers).map((h) => {
|
|
37430
37415
|
if (h.startsWith("_")) return null;
|
|
37431
|
-
return /* @__PURE__ */ (0,
|
|
37416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
37432
37417
|
Filter,
|
|
37433
37418
|
{
|
|
37434
37419
|
objectData,
|
|
@@ -37451,7 +37436,7 @@ var import_react13 = require("react");
|
|
|
37451
37436
|
|
|
37452
37437
|
// src/table3/tr.tsx
|
|
37453
37438
|
var import_react12 = __toESM(require("react"));
|
|
37454
|
-
var
|
|
37439
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
37455
37440
|
function TR({
|
|
37456
37441
|
handlers,
|
|
37457
37442
|
setObjectData,
|
|
@@ -37471,7 +37456,7 @@ function TR({
|
|
|
37471
37456
|
symbols
|
|
37472
37457
|
}) {
|
|
37473
37458
|
const color = selected == index ? "bg-blue-600 text-white hover:bg-blue-800" : index % 2 == 0 ? "bg-white" : "bg-blue-50";
|
|
37474
|
-
return /* @__PURE__ */ (0,
|
|
37459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
37475
37460
|
"tr",
|
|
37476
37461
|
{
|
|
37477
37462
|
className: ` hover:bg-blue-100 ${color} cursor-pointer`,
|
|
@@ -37479,7 +37464,7 @@ function TR({
|
|
|
37479
37464
|
setSelected(selected == index ? -1 : index);
|
|
37480
37465
|
},
|
|
37481
37466
|
children: [
|
|
37482
|
-
modal && /* @__PURE__ */ (0,
|
|
37467
|
+
modal && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { className: "border", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
37483
37468
|
"button",
|
|
37484
37469
|
{
|
|
37485
37470
|
className: "p-1 border shadow-rounded bg-blue-500 rounded text-white",
|
|
@@ -37488,10 +37473,10 @@ function TR({
|
|
|
37488
37473
|
(_a = modalRef.current) == null ? void 0 : _a.showModal();
|
|
37489
37474
|
setDialogRow(row);
|
|
37490
37475
|
},
|
|
37491
|
-
children: /* @__PURE__ */ (0,
|
|
37476
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(EditIcon2, {})
|
|
37492
37477
|
}
|
|
37493
37478
|
) }),
|
|
37494
|
-
selectItems && /* @__PURE__ */ (0,
|
|
37479
|
+
selectItems && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { className: "border", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
37495
37480
|
"input",
|
|
37496
37481
|
{
|
|
37497
37482
|
type: "checkbox",
|
|
@@ -37559,13 +37544,13 @@ function TR({
|
|
|
37559
37544
|
return acc;
|
|
37560
37545
|
}, {})
|
|
37561
37546
|
});
|
|
37562
|
-
return /* @__PURE__ */ (0,
|
|
37547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: `text-black `, children: cloned }, h);
|
|
37563
37548
|
}
|
|
37564
|
-
return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */ (0,
|
|
37549
|
+
return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: `text-center border max-w-[${colSize}px] `, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1 w-full", children: [
|
|
37565
37550
|
symbols[h],
|
|
37566
37551
|
" ",
|
|
37567
37552
|
row[h]
|
|
37568
|
-
] }) }, h) : /* @__PURE__ */ (0,
|
|
37553
|
+
] }) }, h) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: `text-center border max-w-[${colSize}px]`, children: row[h] }, h);
|
|
37569
37554
|
})
|
|
37570
37555
|
]
|
|
37571
37556
|
},
|
|
@@ -37574,7 +37559,7 @@ function TR({
|
|
|
37574
37559
|
}
|
|
37575
37560
|
|
|
37576
37561
|
// src/table3/body.tsx
|
|
37577
|
-
var
|
|
37562
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
37578
37563
|
function TableBody({
|
|
37579
37564
|
objectData,
|
|
37580
37565
|
setObjectData,
|
|
@@ -37618,7 +37603,7 @@ function TableBody({
|
|
|
37618
37603
|
return key >= start && key < end;
|
|
37619
37604
|
}).map(([id, k], index) => {
|
|
37620
37605
|
const row = objectData[id];
|
|
37621
|
-
return /* @__PURE__ */ (0,
|
|
37606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
37622
37607
|
TR,
|
|
37623
37608
|
{
|
|
37624
37609
|
...{
|
|
@@ -37643,11 +37628,11 @@ function TableBody({
|
|
|
37643
37628
|
id
|
|
37644
37629
|
);
|
|
37645
37630
|
});
|
|
37646
|
-
return /* @__PURE__ */ (0,
|
|
37631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tbody", { children: sorted });
|
|
37647
37632
|
}
|
|
37648
37633
|
|
|
37649
37634
|
// src/table3/panel.tsx
|
|
37650
|
-
var
|
|
37635
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
37651
37636
|
function Panel({
|
|
37652
37637
|
page,
|
|
37653
37638
|
setPage,
|
|
@@ -37658,9 +37643,9 @@ function Panel({
|
|
|
37658
37643
|
maxItems
|
|
37659
37644
|
}) {
|
|
37660
37645
|
const excel = useExcel();
|
|
37661
|
-
return /* @__PURE__ */ (0,
|
|
37662
|
-
/* @__PURE__ */ (0,
|
|
37663
|
-
onSave && /* @__PURE__ */ (0,
|
|
37646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-2 bg-gray-100 items-center", children: [
|
|
37647
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-1 ", children: [
|
|
37648
|
+
onSave && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
37664
37649
|
"button",
|
|
37665
37650
|
{
|
|
37666
37651
|
className: "p-2 border shadow rounded bg-blue-500 text-white flex items-center gap-1 text-md",
|
|
@@ -37669,12 +37654,12 @@ function Panel({
|
|
|
37669
37654
|
},
|
|
37670
37655
|
children: [
|
|
37671
37656
|
" ",
|
|
37672
|
-
/* @__PURE__ */ (0,
|
|
37657
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SaveIcon, {}),
|
|
37673
37658
|
"Guardar"
|
|
37674
37659
|
]
|
|
37675
37660
|
}
|
|
37676
37661
|
),
|
|
37677
|
-
exportName && /* @__PURE__ */ (0,
|
|
37662
|
+
exportName && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
37678
37663
|
"button",
|
|
37679
37664
|
{
|
|
37680
37665
|
className: "p-2 border shadow rounded bg-green-800 text-white flex items-center gap-1 text-md",
|
|
@@ -37688,22 +37673,22 @@ function Panel({
|
|
|
37688
37673
|
);
|
|
37689
37674
|
},
|
|
37690
37675
|
children: [
|
|
37691
|
-
/* @__PURE__ */ (0,
|
|
37676
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExcelIcon, {}),
|
|
37692
37677
|
"Exportar"
|
|
37693
37678
|
]
|
|
37694
37679
|
}
|
|
37695
37680
|
)
|
|
37696
37681
|
] }),
|
|
37697
|
-
maxItems !== Infinity && /* @__PURE__ */ (0,
|
|
37698
|
-
/* @__PURE__ */ (0,
|
|
37699
|
-
/* @__PURE__ */ (0,
|
|
37700
|
-
/* @__PURE__ */ (0,
|
|
37682
|
+
maxItems !== Infinity && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-2 items-center text-2xl", children: [
|
|
37683
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { onClick: () => setPage(1), disabled: page === 1, children: "\u23EE" }),
|
|
37684
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { onClick: () => setPage(page - 1), disabled: page === 1, children: "\u25C0" }),
|
|
37685
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "text-sm", children: [
|
|
37701
37686
|
"P\xE1gina ",
|
|
37702
37687
|
page,
|
|
37703
37688
|
" / ",
|
|
37704
37689
|
totalPages
|
|
37705
37690
|
] }),
|
|
37706
|
-
/* @__PURE__ */ (0,
|
|
37691
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
37707
37692
|
"button",
|
|
37708
37693
|
{
|
|
37709
37694
|
onClick: () => setPage(page + 1),
|
|
@@ -37711,7 +37696,7 @@ function Panel({
|
|
|
37711
37696
|
children: "\u25B6"
|
|
37712
37697
|
}
|
|
37713
37698
|
),
|
|
37714
|
-
/* @__PURE__ */ (0,
|
|
37699
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
37715
37700
|
"button",
|
|
37716
37701
|
{
|
|
37717
37702
|
onClick: () => setPage(totalPages),
|
|
@@ -37724,7 +37709,7 @@ function Panel({
|
|
|
37724
37709
|
}
|
|
37725
37710
|
|
|
37726
37711
|
// src/table3/footer.tsx
|
|
37727
|
-
var
|
|
37712
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
37728
37713
|
function TableFooter({
|
|
37729
37714
|
objectData,
|
|
37730
37715
|
headers,
|
|
@@ -37749,27 +37734,27 @@ function TableFooter({
|
|
|
37749
37734
|
return null;
|
|
37750
37735
|
}
|
|
37751
37736
|
}
|
|
37752
|
-
return footer && /* @__PURE__ */ (0,
|
|
37753
|
-
selectItems && /* @__PURE__ */ (0,
|
|
37754
|
-
modal && /* @__PURE__ */ (0,
|
|
37737
|
+
return footer && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tfoot", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("tr", { className: "bg-blue-500 text-white", children: [
|
|
37738
|
+
selectItems && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", {}),
|
|
37739
|
+
modal && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", {}),
|
|
37755
37740
|
headers.map((header) => {
|
|
37756
37741
|
if (header.startsWith("_")) {
|
|
37757
37742
|
return null;
|
|
37758
37743
|
} else if (footer == null ? void 0 : footer[header]) {
|
|
37759
|
-
return symbols && (symbols == null ? void 0 : symbols[header]) ? /* @__PURE__ */ (0,
|
|
37744
|
+
return symbols && (symbols == null ? void 0 : symbols[header]) ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("th", { className: "flex items-center gap-1", children: [
|
|
37760
37745
|
symbols[header],
|
|
37761
37746
|
" ",
|
|
37762
37747
|
operacion(footer[header], header)
|
|
37763
|
-
] }, header) : /* @__PURE__ */ (0,
|
|
37748
|
+
] }, header) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { children: operacion(footer[header], header) }, header);
|
|
37764
37749
|
}
|
|
37765
|
-
return /* @__PURE__ */ (0,
|
|
37750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", {}, header);
|
|
37766
37751
|
})
|
|
37767
37752
|
] }) });
|
|
37768
37753
|
}
|
|
37769
37754
|
|
|
37770
37755
|
// src/table3/dialog.tsx
|
|
37771
37756
|
var import_react14 = __toESM(require("react"));
|
|
37772
|
-
var
|
|
37757
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
37773
37758
|
function Dialog4({
|
|
37774
37759
|
modalRef,
|
|
37775
37760
|
children,
|
|
@@ -37797,15 +37782,15 @@ function Dialog4({
|
|
|
37797
37782
|
}
|
|
37798
37783
|
return null;
|
|
37799
37784
|
}, [dialogRow, children]);
|
|
37800
|
-
return /* @__PURE__ */ (0,
|
|
37785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
37801
37786
|
"dialog",
|
|
37802
37787
|
{
|
|
37803
37788
|
ref: modalRef,
|
|
37804
37789
|
className: "p-6 rounded-xl shadow-2xl backdrop:bg-black/50 w-[100%] h-screen",
|
|
37805
37790
|
children: [
|
|
37806
|
-
/* @__PURE__ */ (0,
|
|
37807
|
-
/* @__PURE__ */ (0,
|
|
37808
|
-
/* @__PURE__ */ (0,
|
|
37791
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [
|
|
37792
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", {}),
|
|
37793
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
37809
37794
|
"button",
|
|
37810
37795
|
{
|
|
37811
37796
|
onClick: () => {
|
|
@@ -37817,7 +37802,7 @@ function Dialog4({
|
|
|
37817
37802
|
}
|
|
37818
37803
|
)
|
|
37819
37804
|
] }),
|
|
37820
|
-
/* @__PURE__ */ (0,
|
|
37805
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "text-gray-700", children: clonedModal })
|
|
37821
37806
|
]
|
|
37822
37807
|
}
|
|
37823
37808
|
);
|
|
@@ -37825,7 +37810,7 @@ function Dialog4({
|
|
|
37825
37810
|
var dialog_default = Dialog4;
|
|
37826
37811
|
|
|
37827
37812
|
// src/table3/index.tsx
|
|
37828
|
-
var
|
|
37813
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
37829
37814
|
function Table3({
|
|
37830
37815
|
data,
|
|
37831
37816
|
selectItems,
|
|
@@ -37937,8 +37922,8 @@ function Table3({
|
|
|
37937
37922
|
}, [objectData]);
|
|
37938
37923
|
const style = (props == null ? void 0 : props.style) ? { ...props.style, tableLayout: "fixed" } : { tableLayout: "fixed" };
|
|
37939
37924
|
if (!objectData) return null;
|
|
37940
|
-
return /* @__PURE__ */ (0,
|
|
37941
|
-
modal && /* @__PURE__ */ (0,
|
|
37925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "border shadow rounded m-1 p-1 bg-white", children: [
|
|
37926
|
+
modal && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
37942
37927
|
dialog_default,
|
|
37943
37928
|
{
|
|
37944
37929
|
modalRef,
|
|
@@ -37948,18 +37933,155 @@ function Table3({
|
|
|
37948
37933
|
children: modal
|
|
37949
37934
|
}
|
|
37950
37935
|
),
|
|
37951
|
-
header && /* @__PURE__ */ (0,
|
|
37952
|
-
/* @__PURE__ */ (0,
|
|
37953
|
-
/* @__PURE__ */ (0,
|
|
37954
|
-
/* @__PURE__ */ (0,
|
|
37955
|
-
/* @__PURE__ */ (0,
|
|
37956
|
-
/* @__PURE__ */ (0,
|
|
37936
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "font-bold text-2xl py-5 px-2 bg-blue-50", children: header }),
|
|
37937
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Panel, { ...context }),
|
|
37938
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("table", { ...props, style, children: [
|
|
37939
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableHead, { ...context }),
|
|
37940
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableBody, { ...context }),
|
|
37941
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableFooter, { ...context })
|
|
37957
37942
|
] })
|
|
37958
37943
|
] });
|
|
37959
37944
|
}
|
|
37945
|
+
|
|
37946
|
+
// src/alert/index.tsx
|
|
37947
|
+
var import_react16 = require("react");
|
|
37948
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
37949
|
+
function usePopup() {
|
|
37950
|
+
const [popup, setPopup] = (0, import_react16.useState)({ type: "alert", message: "", visible: false, inputValue: "" });
|
|
37951
|
+
function alert2(message) {
|
|
37952
|
+
return new Promise((resolve) => {
|
|
37953
|
+
setPopup({
|
|
37954
|
+
type: "alert",
|
|
37955
|
+
message,
|
|
37956
|
+
visible: true,
|
|
37957
|
+
inputValue: "",
|
|
37958
|
+
onConfirm: () => resolve()
|
|
37959
|
+
});
|
|
37960
|
+
});
|
|
37961
|
+
}
|
|
37962
|
+
function confirm(message) {
|
|
37963
|
+
return new Promise((resolve) => {
|
|
37964
|
+
setPopup({
|
|
37965
|
+
type: "confirm",
|
|
37966
|
+
message,
|
|
37967
|
+
visible: true,
|
|
37968
|
+
inputValue: "",
|
|
37969
|
+
onConfirm: () => resolve(true),
|
|
37970
|
+
onCancel: () => resolve(false)
|
|
37971
|
+
});
|
|
37972
|
+
});
|
|
37973
|
+
}
|
|
37974
|
+
function prompt(message) {
|
|
37975
|
+
return new Promise((resolve) => {
|
|
37976
|
+
setPopup({
|
|
37977
|
+
type: "prompt",
|
|
37978
|
+
message,
|
|
37979
|
+
visible: true,
|
|
37980
|
+
inputValue: "",
|
|
37981
|
+
onConfirm: (value) => resolve(value != null ? value : ""),
|
|
37982
|
+
onCancel: () => resolve(null)
|
|
37983
|
+
});
|
|
37984
|
+
});
|
|
37985
|
+
}
|
|
37986
|
+
function close(confirmed, value) {
|
|
37987
|
+
setPopup((prev) => {
|
|
37988
|
+
var _a, _b;
|
|
37989
|
+
if (confirmed) (_a = prev.onConfirm) == null ? void 0 : _a.call(prev, value);
|
|
37990
|
+
else (_b = prev.onCancel) == null ? void 0 : _b.call(prev);
|
|
37991
|
+
return { ...prev, visible: false, inputValue: "" };
|
|
37992
|
+
});
|
|
37993
|
+
}
|
|
37994
|
+
const PopupComponent = popup.visible ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
37995
|
+
"div",
|
|
37996
|
+
{
|
|
37997
|
+
style: {
|
|
37998
|
+
position: "fixed",
|
|
37999
|
+
top: 0,
|
|
38000
|
+
left: 0,
|
|
38001
|
+
width: "100%",
|
|
38002
|
+
height: "100%",
|
|
38003
|
+
background: "rgba(0,0,0,0.5)",
|
|
38004
|
+
display: "flex",
|
|
38005
|
+
alignItems: "center",
|
|
38006
|
+
justifyContent: "center",
|
|
38007
|
+
zIndex: 1e3
|
|
38008
|
+
},
|
|
38009
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
38010
|
+
"div",
|
|
38011
|
+
{
|
|
38012
|
+
style: {
|
|
38013
|
+
background: "#fff",
|
|
38014
|
+
padding: "24px 32px",
|
|
38015
|
+
borderRadius: "8px",
|
|
38016
|
+
minWidth: "300px",
|
|
38017
|
+
textAlign: "center",
|
|
38018
|
+
boxShadow: "0 4px 20px rgba(0,0,0,0.2)"
|
|
38019
|
+
},
|
|
38020
|
+
children: [
|
|
38021
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { style: { margin: "0 0 16px", fontSize: "16px" }, children: popup.message }),
|
|
38022
|
+
popup.type === "prompt" && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
38023
|
+
"input",
|
|
38024
|
+
{
|
|
38025
|
+
autoFocus: true,
|
|
38026
|
+
type: "text",
|
|
38027
|
+
value: popup.inputValue,
|
|
38028
|
+
onChange: (e) => setPopup((prev) => ({ ...prev, inputValue: e.target.value })),
|
|
38029
|
+
onKeyDown: (e) => e.key === "Enter" && close(true, popup.inputValue),
|
|
38030
|
+
style: {
|
|
38031
|
+
width: "100%",
|
|
38032
|
+
padding: "8px 12px",
|
|
38033
|
+
marginBottom: "16px",
|
|
38034
|
+
border: "1px solid #d1d5db",
|
|
38035
|
+
borderRadius: "6px",
|
|
38036
|
+
fontSize: "14px",
|
|
38037
|
+
boxSizing: "border-box"
|
|
38038
|
+
}
|
|
38039
|
+
}
|
|
38040
|
+
),
|
|
38041
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { style: { display: "flex", gap: "8px", justifyContent: "center" }, children: [
|
|
38042
|
+
(popup.type === "confirm" || popup.type === "prompt") && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
38043
|
+
"button",
|
|
38044
|
+
{
|
|
38045
|
+
onClick: () => close(false),
|
|
38046
|
+
style: {
|
|
38047
|
+
padding: "8px 24px",
|
|
38048
|
+
background: "#e5e7eb",
|
|
38049
|
+
color: "#374151",
|
|
38050
|
+
border: "none",
|
|
38051
|
+
borderRadius: "6px",
|
|
38052
|
+
cursor: "pointer",
|
|
38053
|
+
fontSize: "14px"
|
|
38054
|
+
},
|
|
38055
|
+
children: "Cancelar"
|
|
38056
|
+
}
|
|
38057
|
+
),
|
|
38058
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
38059
|
+
"button",
|
|
38060
|
+
{
|
|
38061
|
+
onClick: () => close(true, popup.inputValue),
|
|
38062
|
+
style: {
|
|
38063
|
+
padding: "8px 24px",
|
|
38064
|
+
background: "#3b82f6",
|
|
38065
|
+
color: "#fff",
|
|
38066
|
+
border: "none",
|
|
38067
|
+
borderRadius: "6px",
|
|
38068
|
+
cursor: "pointer",
|
|
38069
|
+
fontSize: "14px"
|
|
38070
|
+
},
|
|
38071
|
+
children: "OK"
|
|
38072
|
+
}
|
|
38073
|
+
)
|
|
38074
|
+
] })
|
|
38075
|
+
]
|
|
38076
|
+
}
|
|
38077
|
+
)
|
|
38078
|
+
}
|
|
38079
|
+
) : null;
|
|
38080
|
+
return { alert: alert2, confirm, prompt, PopupComponent };
|
|
38081
|
+
}
|
|
38082
|
+
var alert_default = usePopup;
|
|
37960
38083
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37961
38084
|
0 && (module.exports = {
|
|
37962
|
-
Alert,
|
|
37963
38085
|
Button,
|
|
37964
38086
|
Container,
|
|
37965
38087
|
DocumentViewer,
|
|
@@ -37976,6 +38098,7 @@ function Table3({
|
|
|
37976
38098
|
useDates,
|
|
37977
38099
|
useExcel,
|
|
37978
38100
|
useFormValues,
|
|
38101
|
+
usePopup,
|
|
37979
38102
|
useResources
|
|
37980
38103
|
});
|
|
37981
38104
|
/*! Bundled license information:
|