next-recomponents 2.0.10 → 2.0.12
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 +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.js +473 -414
- package/dist/index.mjs +445 -386
- package/package.json +1 -1
- package/src/container/index.tsx +1 -1
- package/src/modal/index copy.tsx +59 -0
- package/src/modal/index.tsx +33 -52
- package/src/pop/actions.tsx +30 -0
- package/src/pop/color.tsx +69 -0
- package/src/pop/icon.tsx +15 -0
- package/src/pop/index.tsx +90 -255
- package/src/pop/input.tsx +27 -0
- package/src/pop/overlay.tsx +88 -0
- package/src/pop/types.ts +56 -0
package/dist/index.mjs
CHANGED
|
@@ -3657,7 +3657,7 @@ function Container({
|
|
|
3657
3657
|
}
|
|
3658
3658
|
}, []);
|
|
3659
3659
|
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col h-screen", children: [
|
|
3660
|
-
/* @__PURE__ */ jsxs2("header", { className: "
|
|
3660
|
+
/* @__PURE__ */ jsxs2("header", { className: "", children: [
|
|
3661
3661
|
/* @__PURE__ */ jsxs2("div", { className: "bg-blue-600 text-white p-4 flex justify-between items-center shadow-md", children: [
|
|
3662
3662
|
/* @__PURE__ */ jsx3(
|
|
3663
3663
|
"button",
|
|
@@ -36769,78 +36769,344 @@ function Select({
|
|
|
36769
36769
|
}
|
|
36770
36770
|
|
|
36771
36771
|
// src/modal/index.tsx
|
|
36772
|
-
import React6, {
|
|
36772
|
+
import React6, { cloneElement as cloneElement2 } from "react";
|
|
36773
36773
|
|
|
36774
|
-
// src/
|
|
36775
|
-
import {
|
|
36776
|
-
|
|
36777
|
-
|
|
36778
|
-
|
|
36774
|
+
// src/pop/index.tsx
|
|
36775
|
+
import { useState as useState8, useCallback } from "react";
|
|
36776
|
+
|
|
36777
|
+
// src/pop/actions.tsx
|
|
36778
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
36779
|
+
function PopupActions({
|
|
36780
|
+
type,
|
|
36781
|
+
confirm,
|
|
36782
|
+
focusRing,
|
|
36783
|
+
onConfirm,
|
|
36784
|
+
onCancel
|
|
36785
|
+
}) {
|
|
36786
|
+
const showCancel = type === "confirm" || type === "prompt";
|
|
36787
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex gap-2 px-6 py-4 justify-end", children: [
|
|
36788
|
+
showCancel && /* @__PURE__ */ jsx11(
|
|
36789
|
+
"button",
|
|
36790
|
+
{
|
|
36791
|
+
onClick: onCancel,
|
|
36792
|
+
className: "px-4 py-2 rounded-lg text-sm font-medium bg-white border border-gray-200 text-gray-600 hover:bg-gray-50 transition",
|
|
36793
|
+
children: "Cancelar"
|
|
36794
|
+
}
|
|
36795
|
+
),
|
|
36796
|
+
/* @__PURE__ */ jsx11(
|
|
36797
|
+
"button",
|
|
36798
|
+
{
|
|
36799
|
+
onClick: onConfirm,
|
|
36800
|
+
className: `px-5 py-2 rounded-lg text-sm font-semibold text-white ${confirm} transition focus:outline-none focus:ring-2 ${focusRing}`,
|
|
36801
|
+
children: "Aceptar"
|
|
36802
|
+
}
|
|
36803
|
+
)
|
|
36804
|
+
] });
|
|
36805
|
+
}
|
|
36806
|
+
|
|
36807
|
+
// src/pop/color.tsx
|
|
36808
|
+
var COLOR_CONFIG = {
|
|
36809
|
+
primary: {
|
|
36810
|
+
bg: "from-blue-50 to-indigo-50",
|
|
36811
|
+
iconBg: "bg-blue-100",
|
|
36812
|
+
iconText: "text-blue-600",
|
|
36813
|
+
border: "border-blue-200",
|
|
36814
|
+
confirm: "bg-blue-600 hover:bg-blue-700",
|
|
36815
|
+
focusRing: "focus:ring-blue-300",
|
|
36816
|
+
label: "\u2139"
|
|
36817
|
+
},
|
|
36818
|
+
info: {
|
|
36819
|
+
bg: "from-sky-50 to-cyan-50",
|
|
36820
|
+
iconBg: "bg-sky-100",
|
|
36821
|
+
iconText: "text-sky-600",
|
|
36822
|
+
border: "border-sky-200",
|
|
36823
|
+
confirm: "bg-sky-600 hover:bg-sky-700",
|
|
36824
|
+
focusRing: "focus:ring-sky-300",
|
|
36825
|
+
label: "\u2139"
|
|
36826
|
+
},
|
|
36827
|
+
success: {
|
|
36828
|
+
bg: "from-emerald-50 to-green-50",
|
|
36829
|
+
iconBg: "bg-emerald-100",
|
|
36830
|
+
iconText: "text-emerald-600",
|
|
36831
|
+
border: "border-emerald-200",
|
|
36832
|
+
confirm: "bg-emerald-600 hover:bg-emerald-700",
|
|
36833
|
+
focusRing: "focus:ring-emerald-300",
|
|
36834
|
+
label: "\u2713"
|
|
36835
|
+
},
|
|
36836
|
+
warning: {
|
|
36837
|
+
bg: "from-amber-50 to-yellow-50",
|
|
36838
|
+
iconBg: "bg-amber-100",
|
|
36839
|
+
iconText: "text-amber-600",
|
|
36840
|
+
border: "border-amber-200",
|
|
36841
|
+
confirm: "bg-amber-500 hover:bg-amber-600",
|
|
36842
|
+
focusRing: "focus:ring-amber-300",
|
|
36843
|
+
label: "\u26A0"
|
|
36844
|
+
},
|
|
36845
|
+
danger: {
|
|
36846
|
+
bg: "from-red-50 to-rose-50",
|
|
36847
|
+
iconBg: "bg-red-100",
|
|
36848
|
+
iconText: "text-red-600",
|
|
36849
|
+
border: "border-red-200",
|
|
36850
|
+
confirm: "bg-red-600 hover:bg-red-700",
|
|
36851
|
+
focusRing: "focus:ring-red-300",
|
|
36852
|
+
label: "\u2715"
|
|
36853
|
+
},
|
|
36854
|
+
secondary: {
|
|
36855
|
+
bg: "from-slate-50 to-gray-50",
|
|
36856
|
+
iconBg: "bg-slate-100",
|
|
36857
|
+
iconText: "text-slate-600",
|
|
36858
|
+
border: "border-slate-200",
|
|
36859
|
+
confirm: "bg-slate-700 hover:bg-slate-800",
|
|
36860
|
+
focusRing: "focus:ring-slate-300",
|
|
36861
|
+
label: "\u25CE"
|
|
36862
|
+
},
|
|
36863
|
+
white: {
|
|
36864
|
+
bg: "from-gray-50 to-white",
|
|
36865
|
+
iconBg: "bg-gray-100",
|
|
36866
|
+
iconText: "text-gray-500",
|
|
36867
|
+
border: "border-gray-200",
|
|
36868
|
+
confirm: "bg-gray-700 hover:bg-gray-800",
|
|
36869
|
+
focusRing: "focus:ring-gray-300",
|
|
36870
|
+
label: "\u25CE"
|
|
36871
|
+
}
|
|
36872
|
+
};
|
|
36873
|
+
|
|
36874
|
+
// src/pop/icon.tsx
|
|
36875
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
36876
|
+
function PopupIcon({ label, iconBg, iconText }) {
|
|
36877
|
+
return /* @__PURE__ */ jsx12(
|
|
36878
|
+
"div",
|
|
36779
36879
|
{
|
|
36780
|
-
|
|
36781
|
-
|
|
36782
|
-
strokeWidth: "0",
|
|
36783
|
-
viewBox: "0 0 512 512",
|
|
36784
|
-
height: "20px",
|
|
36785
|
-
width: "20px",
|
|
36786
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
36787
|
-
children: /* @__PURE__ */ jsx11("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" })
|
|
36880
|
+
className: `w-12 h-12 rounded-full ${iconBg} flex items-center justify-center`,
|
|
36881
|
+
children: /* @__PURE__ */ jsx12("span", { className: `text-xl font-bold ${iconText}`, children: label })
|
|
36788
36882
|
}
|
|
36789
36883
|
);
|
|
36790
36884
|
}
|
|
36791
36885
|
|
|
36792
|
-
// src/
|
|
36793
|
-
import {
|
|
36794
|
-
|
|
36795
|
-
|
|
36796
|
-
|
|
36797
|
-
|
|
36798
|
-
|
|
36799
|
-
|
|
36800
|
-
|
|
36801
|
-
|
|
36802
|
-
|
|
36803
|
-
|
|
36804
|
-
|
|
36805
|
-
|
|
36806
|
-
|
|
36807
|
-
|
|
36808
|
-
|
|
36809
|
-
|
|
36810
|
-
|
|
36811
|
-
|
|
36812
|
-
|
|
36886
|
+
// src/pop/input.tsx
|
|
36887
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
36888
|
+
function PromptInput({
|
|
36889
|
+
value,
|
|
36890
|
+
border,
|
|
36891
|
+
focusRing,
|
|
36892
|
+
onChange,
|
|
36893
|
+
onEnter
|
|
36894
|
+
}) {
|
|
36895
|
+
return /* @__PURE__ */ jsx13("div", { className: "px-8 pb-2", children: /* @__PURE__ */ jsx13(
|
|
36896
|
+
"input",
|
|
36897
|
+
{
|
|
36898
|
+
autoFocus: true,
|
|
36899
|
+
type: "text",
|
|
36900
|
+
value,
|
|
36901
|
+
onChange: (e) => onChange(e.target.value),
|
|
36902
|
+
onKeyDown: (e) => e.key === "Enter" && onEnter(),
|
|
36903
|
+
className: `
|
|
36904
|
+
w-full px-3 py-2 rounded-lg border ${border} bg-white
|
|
36905
|
+
text-sm text-gray-800 outline-none
|
|
36906
|
+
focus:ring-2 ${focusRing} transition
|
|
36907
|
+
`,
|
|
36908
|
+
placeholder: "Escribe aqu\xED..."
|
|
36909
|
+
}
|
|
36910
|
+
) });
|
|
36911
|
+
}
|
|
36912
|
+
|
|
36913
|
+
// src/pop/overlay.tsx
|
|
36914
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
36915
|
+
function PopupOverlay({
|
|
36916
|
+
popup,
|
|
36917
|
+
onClose,
|
|
36918
|
+
onInputChange
|
|
36919
|
+
}) {
|
|
36920
|
+
const c = COLOR_CONFIG[popup.color];
|
|
36921
|
+
const resolvedMessage = typeof popup.message === "function" ? popup.message() : popup.message;
|
|
36922
|
+
return /* @__PURE__ */ jsxs9(
|
|
36923
|
+
"div",
|
|
36924
|
+
{
|
|
36925
|
+
className: "fixed inset-0 flex items-center justify-center z-[1000] ",
|
|
36926
|
+
style: { background: "rgba(15,23,42,0.45)", backdropFilter: "blur(2px)" },
|
|
36927
|
+
onClick: (e) => {
|
|
36928
|
+
var _a;
|
|
36929
|
+
if (e.target === e.currentTarget) {
|
|
36930
|
+
onClose(false);
|
|
36931
|
+
(_a = popup.onCancel) == null ? void 0 : _a.call(popup);
|
|
36932
|
+
}
|
|
36933
|
+
},
|
|
36934
|
+
children: [
|
|
36935
|
+
/* @__PURE__ */ jsx14("style", { children: `
|
|
36936
|
+
@keyframes fadeInScale {
|
|
36937
|
+
from { opacity: 0; transform: scale(0.93) translateY(8px); }
|
|
36938
|
+
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
36939
|
+
}
|
|
36940
|
+
` }),
|
|
36941
|
+
/* @__PURE__ */ jsxs9(
|
|
36942
|
+
"div",
|
|
36943
|
+
{
|
|
36944
|
+
className: `bg-gradient-to-br ${c.bg} border ${c.border} ${popup.full == true ? " w-full h-screen m-20 " : " max-w-sm "} rounded-2xl shadow-2xl mx-4`,
|
|
36945
|
+
style: { animation: "fadeInScale 0.18s ease-out", overflow: "auto" },
|
|
36946
|
+
children: [
|
|
36947
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col items-center gap-3 px-8 pt-8 pb-5 text-center ", children: [
|
|
36948
|
+
(popup == null ? void 0 : popup.icons) == true && /* @__PURE__ */ jsx14(
|
|
36949
|
+
PopupIcon,
|
|
36950
|
+
{
|
|
36951
|
+
label: c.label,
|
|
36952
|
+
iconBg: c.iconBg,
|
|
36953
|
+
iconText: c.iconText
|
|
36954
|
+
}
|
|
36955
|
+
),
|
|
36956
|
+
/* @__PURE__ */ jsx14("div", { className: "w-full flex justify-end", children: /* @__PURE__ */ jsx14(Button, { color: "danger", onClick: (e) => onClose(false), children: "X" }) }),
|
|
36957
|
+
/* @__PURE__ */ jsx14(
|
|
36958
|
+
"div",
|
|
36959
|
+
{
|
|
36960
|
+
className: "text-gray-800 text-[15px] font-medium leading-snug ",
|
|
36961
|
+
children: resolvedMessage
|
|
36962
|
+
}
|
|
36963
|
+
)
|
|
36964
|
+
] }),
|
|
36965
|
+
popup.type === "prompt" && /* @__PURE__ */ jsx14(
|
|
36966
|
+
PromptInput,
|
|
36967
|
+
{
|
|
36968
|
+
value: popup.inputValue,
|
|
36969
|
+
border: c.border,
|
|
36970
|
+
focusRing: c.focusRing,
|
|
36971
|
+
onChange: onInputChange,
|
|
36972
|
+
onEnter: () => onClose(true, popup.inputValue)
|
|
36973
|
+
}
|
|
36974
|
+
),
|
|
36975
|
+
/* @__PURE__ */ jsx14("div", { className: `border-t ${c.border} mt-4` }),
|
|
36976
|
+
popup.type !== "modal" && /* @__PURE__ */ jsx14(
|
|
36977
|
+
PopupActions,
|
|
36978
|
+
{
|
|
36979
|
+
type: popup.type,
|
|
36980
|
+
confirm: c.confirm,
|
|
36981
|
+
focusRing: c.focusRing,
|
|
36982
|
+
onConfirm: () => onClose(true, popup.inputValue),
|
|
36983
|
+
onCancel: () => onClose(false)
|
|
36984
|
+
}
|
|
36985
|
+
)
|
|
36986
|
+
]
|
|
36813
36987
|
}
|
|
36814
|
-
|
|
36988
|
+
)
|
|
36989
|
+
]
|
|
36990
|
+
}
|
|
36991
|
+
);
|
|
36992
|
+
}
|
|
36993
|
+
|
|
36994
|
+
// src/pop/index.tsx
|
|
36995
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
36996
|
+
var INITIAL_STATE = {
|
|
36997
|
+
type: "alert",
|
|
36998
|
+
message: "",
|
|
36999
|
+
visible: false,
|
|
37000
|
+
inputValue: "",
|
|
37001
|
+
color: "primary",
|
|
37002
|
+
icons: true,
|
|
37003
|
+
full: false
|
|
37004
|
+
};
|
|
37005
|
+
function usePopup() {
|
|
37006
|
+
const [popup, setPopup] = useState8(INITIAL_STATE);
|
|
37007
|
+
const open = useCallback(
|
|
37008
|
+
(partial) => {
|
|
37009
|
+
setPopup({ ...partial, visible: true, inputValue: "" });
|
|
37010
|
+
},
|
|
37011
|
+
[]
|
|
37012
|
+
);
|
|
37013
|
+
const close = useCallback((confirmed, value) => {
|
|
37014
|
+
setPopup((prev) => {
|
|
37015
|
+
var _a, _b;
|
|
37016
|
+
if (confirmed) (_a = prev.onConfirm) == null ? void 0 : _a.call(prev, value);
|
|
37017
|
+
else (_b = prev.onCancel) == null ? void 0 : _b.call(prev);
|
|
37018
|
+
return { ...prev, visible: false, inputValue: "" };
|
|
37019
|
+
});
|
|
37020
|
+
}, []);
|
|
37021
|
+
const alert2 = useCallback(
|
|
37022
|
+
(message, color = "primary") => new Promise(
|
|
37023
|
+
(resolve) => open({
|
|
37024
|
+
type: "alert",
|
|
37025
|
+
message,
|
|
37026
|
+
color,
|
|
37027
|
+
onConfirm: () => resolve(),
|
|
37028
|
+
onCancel: () => resolve()
|
|
37029
|
+
})
|
|
37030
|
+
),
|
|
37031
|
+
[open]
|
|
37032
|
+
);
|
|
37033
|
+
const modal = useCallback(
|
|
37034
|
+
(message, color = "primary", icons = true, full = false) => new Promise(
|
|
37035
|
+
(resolve) => open({
|
|
37036
|
+
type: "modal",
|
|
37037
|
+
message,
|
|
37038
|
+
color,
|
|
37039
|
+
onConfirm: () => resolve(),
|
|
37040
|
+
onCancel: () => resolve(),
|
|
37041
|
+
icons,
|
|
37042
|
+
full
|
|
37043
|
+
})
|
|
37044
|
+
),
|
|
37045
|
+
[open]
|
|
37046
|
+
);
|
|
37047
|
+
const confirm = useCallback(
|
|
37048
|
+
(message, color = "primary") => new Promise(
|
|
37049
|
+
(resolve) => open({
|
|
37050
|
+
type: "confirm",
|
|
37051
|
+
message,
|
|
37052
|
+
color,
|
|
37053
|
+
onConfirm: () => resolve(true),
|
|
37054
|
+
onCancel: () => resolve(false)
|
|
37055
|
+
})
|
|
37056
|
+
),
|
|
37057
|
+
[open]
|
|
37058
|
+
);
|
|
37059
|
+
const prompt = useCallback(
|
|
37060
|
+
(message, color = "primary") => new Promise(
|
|
37061
|
+
(resolve) => open({
|
|
37062
|
+
type: "prompt",
|
|
37063
|
+
message,
|
|
37064
|
+
color,
|
|
37065
|
+
onConfirm: (value) => resolve(value != null ? value : ""),
|
|
37066
|
+
onCancel: () => resolve(null)
|
|
37067
|
+
})
|
|
37068
|
+
),
|
|
37069
|
+
[open]
|
|
37070
|
+
);
|
|
37071
|
+
const PopupComponent = popup.visible ? /* @__PURE__ */ jsx15(
|
|
37072
|
+
PopupOverlay,
|
|
37073
|
+
{
|
|
37074
|
+
popup,
|
|
37075
|
+
onClose: close,
|
|
37076
|
+
onInputChange: (v) => setPopup((prev) => ({ ...prev, inputValue: v }))
|
|
37077
|
+
}
|
|
37078
|
+
) : null;
|
|
37079
|
+
return { alert: alert2, confirm, prompt, modal, PopupComponent, close };
|
|
37080
|
+
}
|
|
37081
|
+
|
|
37082
|
+
// src/modal/index.tsx
|
|
37083
|
+
import { Fragment as Fragment2, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
37084
|
+
function Modal({
|
|
37085
|
+
button,
|
|
37086
|
+
children,
|
|
37087
|
+
color = "primary"
|
|
37088
|
+
}) {
|
|
37089
|
+
const pop = usePopup();
|
|
37090
|
+
return /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
37091
|
+
cloneElement2(button, {
|
|
37092
|
+
onClick: async (e) => {
|
|
37093
|
+
await pop.modal(
|
|
37094
|
+
React6.cloneElement(children, { hide: () => pop.close(false) }),
|
|
37095
|
+
color,
|
|
37096
|
+
false,
|
|
37097
|
+
true
|
|
37098
|
+
);
|
|
36815
37099
|
}
|
|
36816
|
-
return child;
|
|
36817
37100
|
}),
|
|
36818
|
-
|
|
36819
|
-
/* @__PURE__ */ jsx12(
|
|
36820
|
-
"button",
|
|
36821
|
-
{
|
|
36822
|
-
onClick: hide,
|
|
36823
|
-
className: "absolute top-0 right-0 text-red-500 ",
|
|
36824
|
-
children: /* @__PURE__ */ jsx12(CloseIcon2, {})
|
|
36825
|
-
}
|
|
36826
|
-
),
|
|
36827
|
-
/* @__PURE__ */ jsx12("div", { className: "font-bold text-xl", children: title }),
|
|
36828
|
-
/* @__PURE__ */ jsx12("div", { className: "flex flex-col gap-3 pt-6", children: React6.Children.map(children, (child) => {
|
|
36829
|
-
if (React6.isValidElement(child)) {
|
|
36830
|
-
const { type, props } = child;
|
|
36831
|
-
return React6.createElement(type, { ...props, hide });
|
|
36832
|
-
}
|
|
36833
|
-
return child;
|
|
36834
|
-
}) })
|
|
36835
|
-
] }) })
|
|
37101
|
+
pop.PopupComponent
|
|
36836
37102
|
] });
|
|
36837
37103
|
}
|
|
36838
37104
|
|
|
36839
37105
|
// src/pre/index.tsx
|
|
36840
|
-
import { jsx as
|
|
37106
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
36841
37107
|
var Pre = ({ data }) => {
|
|
36842
37108
|
const formatted = JSON.stringify(data, null, 2);
|
|
36843
|
-
return /* @__PURE__ */
|
|
37109
|
+
return /* @__PURE__ */ jsx16(
|
|
36844
37110
|
"pre",
|
|
36845
37111
|
{
|
|
36846
37112
|
style: {
|
|
@@ -36891,9 +37157,9 @@ import {
|
|
|
36891
37157
|
import DatePicker from "react-datepicker";
|
|
36892
37158
|
|
|
36893
37159
|
// src/calendar/calendar.icon.tsx
|
|
36894
|
-
import { jsx as
|
|
37160
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
36895
37161
|
function CalendarIcon() {
|
|
36896
|
-
return /* @__PURE__ */
|
|
37162
|
+
return /* @__PURE__ */ jsx17(
|
|
36897
37163
|
"svg",
|
|
36898
37164
|
{
|
|
36899
37165
|
stroke: "currentColor",
|
|
@@ -36903,14 +37169,14 @@ function CalendarIcon() {
|
|
|
36903
37169
|
height: "20px",
|
|
36904
37170
|
width: "20px",
|
|
36905
37171
|
xmlns: "http://www.w3.org/2000/svg",
|
|
36906
|
-
children: /* @__PURE__ */
|
|
37172
|
+
children: /* @__PURE__ */ jsx17("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" })
|
|
36907
37173
|
}
|
|
36908
37174
|
);
|
|
36909
37175
|
}
|
|
36910
37176
|
|
|
36911
37177
|
// src/calendar/index.tsx
|
|
36912
|
-
import { Dialog as
|
|
36913
|
-
import { jsx as
|
|
37178
|
+
import { Dialog as Dialog2 } from "@mui/material";
|
|
37179
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
36914
37180
|
function MyCalendar({
|
|
36915
37181
|
enabledDates,
|
|
36916
37182
|
onChange,
|
|
@@ -36941,20 +37207,20 @@ function MyCalendar({
|
|
|
36941
37207
|
if (!(enabledDates == null ? void 0 : enabledDates.length)) {
|
|
36942
37208
|
return null;
|
|
36943
37209
|
}
|
|
36944
|
-
return /* @__PURE__ */
|
|
36945
|
-
/* @__PURE__ */
|
|
36946
|
-
/* @__PURE__ */
|
|
37210
|
+
return /* @__PURE__ */ jsxs11("div", { className: "relative", children: [
|
|
37211
|
+
/* @__PURE__ */ jsxs11("label", { className: "flex flex-col gap-1", children: [
|
|
37212
|
+
/* @__PURE__ */ jsxs11("div", { className: "font-bold", children: [
|
|
36947
37213
|
label,
|
|
36948
37214
|
" ",
|
|
36949
|
-
(otherProps == null ? void 0 : otherProps.required) && /* @__PURE__ */
|
|
37215
|
+
(otherProps == null ? void 0 : otherProps.required) && /* @__PURE__ */ jsx18("span", { className: "text-red-500", children: "*" })
|
|
36950
37216
|
] }),
|
|
36951
|
-
/* @__PURE__ */
|
|
37217
|
+
/* @__PURE__ */ jsx18("div", { children: /* @__PURE__ */ jsxs11(
|
|
36952
37218
|
"div",
|
|
36953
37219
|
{
|
|
36954
37220
|
className: "cursor-pointer flex items-center justify-center",
|
|
36955
37221
|
onClick: (e) => setOpen(true),
|
|
36956
37222
|
children: [
|
|
36957
|
-
/* @__PURE__ */
|
|
37223
|
+
/* @__PURE__ */ jsx18(
|
|
36958
37224
|
"input",
|
|
36959
37225
|
{
|
|
36960
37226
|
...otherProps,
|
|
@@ -36969,13 +37235,13 @@ function MyCalendar({
|
|
|
36969
37235
|
readOnly: true
|
|
36970
37236
|
}
|
|
36971
37237
|
),
|
|
36972
|
-
/* @__PURE__ */
|
|
37238
|
+
/* @__PURE__ */ jsx18("div", { className: "absolute", style: { right: "10px" }, children: /* @__PURE__ */ jsx18(CalendarIcon, {}) })
|
|
36973
37239
|
]
|
|
36974
37240
|
}
|
|
36975
37241
|
) })
|
|
36976
37242
|
] }),
|
|
36977
|
-
/* @__PURE__ */
|
|
36978
|
-
/* @__PURE__ */
|
|
37243
|
+
/* @__PURE__ */ jsxs11(Dialog2, { open, children: [
|
|
37244
|
+
/* @__PURE__ */ jsx18("div", { className: "flex justify-end p-5 font-bold", children: /* @__PURE__ */ jsx18(
|
|
36979
37245
|
"button",
|
|
36980
37246
|
{
|
|
36981
37247
|
className: " border-lg w-[20px] bg-red-500 text-white shadow rounded",
|
|
@@ -36983,7 +37249,7 @@ function MyCalendar({
|
|
|
36983
37249
|
children: "x"
|
|
36984
37250
|
}
|
|
36985
37251
|
) }),
|
|
36986
|
-
/* @__PURE__ */
|
|
37252
|
+
/* @__PURE__ */ jsx18("div", { className: " w-[300px] flex items-start justify-center h-[300px] p-5", children: /* @__PURE__ */ jsx18(
|
|
36987
37253
|
DatePicker,
|
|
36988
37254
|
{
|
|
36989
37255
|
inline: true,
|
|
@@ -36997,9 +37263,9 @@ function MyCalendar({
|
|
|
36997
37263
|
}
|
|
36998
37264
|
|
|
36999
37265
|
// src/doc-viewer/icon.tsx
|
|
37000
|
-
import { jsx as
|
|
37266
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
37001
37267
|
function Icon() {
|
|
37002
|
-
return /* @__PURE__ */
|
|
37268
|
+
return /* @__PURE__ */ jsx19(
|
|
37003
37269
|
"svg",
|
|
37004
37270
|
{
|
|
37005
37271
|
stroke: "currentColor",
|
|
@@ -37009,13 +37275,13 @@ function Icon() {
|
|
|
37009
37275
|
height: "200px",
|
|
37010
37276
|
width: "200px",
|
|
37011
37277
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37012
|
-
children: /* @__PURE__ */
|
|
37278
|
+
children: /* @__PURE__ */ jsx19("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" })
|
|
37013
37279
|
}
|
|
37014
37280
|
);
|
|
37015
37281
|
}
|
|
37016
37282
|
|
|
37017
37283
|
// src/doc-viewer/index.tsx
|
|
37018
|
-
import { jsx as
|
|
37284
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
37019
37285
|
function DocumentViewer({ item }) {
|
|
37020
37286
|
const { url, name, contentType, width = "100%", height = "100%" } = item;
|
|
37021
37287
|
const isImage = contentType.startsWith("image/");
|
|
@@ -37024,10 +37290,10 @@ function DocumentViewer({ item }) {
|
|
|
37024
37290
|
const viewerUrl = isGoogleDocCompatible ? `https://docs.google.com/gview?url=${encodeURIComponent(
|
|
37025
37291
|
url
|
|
37026
37292
|
)}&embedded=true` : url;
|
|
37027
|
-
return /* @__PURE__ */
|
|
37028
|
-
/* @__PURE__ */
|
|
37029
|
-
/* @__PURE__ */
|
|
37030
|
-
/* @__PURE__ */
|
|
37293
|
+
return /* @__PURE__ */ jsxs12("div", { className: "border shadow rounded p-2 h-[100%]", children: [
|
|
37294
|
+
/* @__PURE__ */ jsxs12("div", { className: "mb-1 flex justify-between ", children: [
|
|
37295
|
+
/* @__PURE__ */ jsx20("h3", { className: "font-bold", children: name }),
|
|
37296
|
+
/* @__PURE__ */ jsx20(
|
|
37031
37297
|
"a",
|
|
37032
37298
|
{
|
|
37033
37299
|
href: url,
|
|
@@ -37039,7 +37305,7 @@ function DocumentViewer({ item }) {
|
|
|
37039
37305
|
}
|
|
37040
37306
|
)
|
|
37041
37307
|
] }),
|
|
37042
|
-
isImage ? /* @__PURE__ */
|
|
37308
|
+
isImage ? /* @__PURE__ */ jsx20(
|
|
37043
37309
|
"img",
|
|
37044
37310
|
{
|
|
37045
37311
|
src: url,
|
|
@@ -37052,7 +37318,7 @@ function DocumentViewer({ item }) {
|
|
|
37052
37318
|
display: "block"
|
|
37053
37319
|
}
|
|
37054
37320
|
}
|
|
37055
|
-
) : isGoogleDocCompatible ? /* @__PURE__ */
|
|
37321
|
+
) : isGoogleDocCompatible ? /* @__PURE__ */ jsx20(
|
|
37056
37322
|
"iframe",
|
|
37057
37323
|
{
|
|
37058
37324
|
title: name,
|
|
@@ -37060,7 +37326,7 @@ function DocumentViewer({ item }) {
|
|
|
37060
37326
|
style: { width, height, border: "none" },
|
|
37061
37327
|
allowFullScreen: true
|
|
37062
37328
|
}
|
|
37063
|
-
) : /* @__PURE__ */
|
|
37329
|
+
) : /* @__PURE__ */ jsx20(
|
|
37064
37330
|
"div",
|
|
37065
37331
|
{
|
|
37066
37332
|
style: {
|
|
@@ -37070,7 +37336,7 @@ function DocumentViewer({ item }) {
|
|
|
37070
37336
|
objectFit: "cover",
|
|
37071
37337
|
display: "block"
|
|
37072
37338
|
},
|
|
37073
|
-
children: /* @__PURE__ */
|
|
37339
|
+
children: /* @__PURE__ */ jsx20(Icon, {})
|
|
37074
37340
|
}
|
|
37075
37341
|
)
|
|
37076
37342
|
] });
|
|
@@ -37081,7 +37347,7 @@ import React9, {
|
|
|
37081
37347
|
useEffect as useEffect8,
|
|
37082
37348
|
useMemo as useMemo6,
|
|
37083
37349
|
useReducer as useReducer2,
|
|
37084
|
-
useRef as
|
|
37350
|
+
useRef as useRef5,
|
|
37085
37351
|
useState as useState12
|
|
37086
37352
|
} from "react";
|
|
37087
37353
|
|
|
@@ -37089,9 +37355,9 @@ import React9, {
|
|
|
37089
37355
|
import { useEffect as useEffect7, useMemo as useMemo4, useState as useState10 } from "react";
|
|
37090
37356
|
|
|
37091
37357
|
// src/table3/filters.tsx
|
|
37092
|
-
import { jsx as
|
|
37358
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
37093
37359
|
function FilterOffIcon() {
|
|
37094
|
-
return /* @__PURE__ */
|
|
37360
|
+
return /* @__PURE__ */ jsx21(
|
|
37095
37361
|
"svg",
|
|
37096
37362
|
{
|
|
37097
37363
|
stroke: "currentColor",
|
|
@@ -37101,12 +37367,12 @@ function FilterOffIcon() {
|
|
|
37101
37367
|
height: "20px",
|
|
37102
37368
|
width: "20px",
|
|
37103
37369
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37104
|
-
children: /* @__PURE__ */
|
|
37370
|
+
children: /* @__PURE__ */ jsx21("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" })
|
|
37105
37371
|
}
|
|
37106
37372
|
);
|
|
37107
37373
|
}
|
|
37108
37374
|
function OrderDesc() {
|
|
37109
|
-
return /* @__PURE__ */
|
|
37375
|
+
return /* @__PURE__ */ jsx21(
|
|
37110
37376
|
"svg",
|
|
37111
37377
|
{
|
|
37112
37378
|
stroke: "currentColor",
|
|
@@ -37116,12 +37382,12 @@ function OrderDesc() {
|
|
|
37116
37382
|
height: "20px",
|
|
37117
37383
|
width: "20px",
|
|
37118
37384
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37119
|
-
children: /* @__PURE__ */
|
|
37385
|
+
children: /* @__PURE__ */ jsx21("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" })
|
|
37120
37386
|
}
|
|
37121
37387
|
);
|
|
37122
37388
|
}
|
|
37123
37389
|
function OrderAsc() {
|
|
37124
|
-
return /* @__PURE__ */
|
|
37390
|
+
return /* @__PURE__ */ jsx21(
|
|
37125
37391
|
"svg",
|
|
37126
37392
|
{
|
|
37127
37393
|
stroke: "currentColor",
|
|
@@ -37131,12 +37397,12 @@ function OrderAsc() {
|
|
|
37131
37397
|
height: "20px",
|
|
37132
37398
|
width: "20px",
|
|
37133
37399
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37134
|
-
children: /* @__PURE__ */
|
|
37400
|
+
children: /* @__PURE__ */ jsx21("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" })
|
|
37135
37401
|
}
|
|
37136
37402
|
);
|
|
37137
37403
|
}
|
|
37138
37404
|
function EditIcon2() {
|
|
37139
|
-
return /* @__PURE__ */
|
|
37405
|
+
return /* @__PURE__ */ jsx21(
|
|
37140
37406
|
"svg",
|
|
37141
37407
|
{
|
|
37142
37408
|
stroke: "currentColor",
|
|
@@ -37146,12 +37412,12 @@ function EditIcon2() {
|
|
|
37146
37412
|
height: "20px",
|
|
37147
37413
|
width: "20px",
|
|
37148
37414
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37149
|
-
children: /* @__PURE__ */
|
|
37415
|
+
children: /* @__PURE__ */ jsx21("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" })
|
|
37150
37416
|
}
|
|
37151
37417
|
);
|
|
37152
37418
|
}
|
|
37153
37419
|
function SaveIcon() {
|
|
37154
|
-
return /* @__PURE__ */
|
|
37420
|
+
return /* @__PURE__ */ jsxs13(
|
|
37155
37421
|
"svg",
|
|
37156
37422
|
{
|
|
37157
37423
|
stroke: "currentColor",
|
|
@@ -37162,14 +37428,14 @@ function SaveIcon() {
|
|
|
37162
37428
|
width: "20px",
|
|
37163
37429
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37164
37430
|
children: [
|
|
37165
|
-
/* @__PURE__ */
|
|
37166
|
-
/* @__PURE__ */
|
|
37431
|
+
/* @__PURE__ */ jsx21("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" }),
|
|
37432
|
+
/* @__PURE__ */ jsx21("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" })
|
|
37167
37433
|
]
|
|
37168
37434
|
}
|
|
37169
37435
|
);
|
|
37170
37436
|
}
|
|
37171
37437
|
function ExcelIcon() {
|
|
37172
|
-
return /* @__PURE__ */
|
|
37438
|
+
return /* @__PURE__ */ jsx21(
|
|
37173
37439
|
"svg",
|
|
37174
37440
|
{
|
|
37175
37441
|
stroke: "currentColor",
|
|
@@ -37179,13 +37445,13 @@ function ExcelIcon() {
|
|
|
37179
37445
|
height: "20px",
|
|
37180
37446
|
width: "20px",
|
|
37181
37447
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37182
|
-
children: /* @__PURE__ */
|
|
37448
|
+
children: /* @__PURE__ */ jsx21("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" })
|
|
37183
37449
|
}
|
|
37184
37450
|
);
|
|
37185
37451
|
}
|
|
37186
37452
|
|
|
37187
37453
|
// src/table3/filter.tsx
|
|
37188
|
-
import { jsx as
|
|
37454
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
37189
37455
|
function Filter({
|
|
37190
37456
|
h,
|
|
37191
37457
|
objectData,
|
|
@@ -37246,8 +37512,8 @@ function Filter({
|
|
|
37246
37512
|
setSelected(news);
|
|
37247
37513
|
}
|
|
37248
37514
|
}, [data]);
|
|
37249
|
-
return /* @__PURE__ */
|
|
37250
|
-
/* @__PURE__ */
|
|
37515
|
+
return /* @__PURE__ */ jsxs14("th", { className: "cursor-pointer", children: [
|
|
37516
|
+
/* @__PURE__ */ jsx22("div", { className: "relative", children: visible && /* @__PURE__ */ jsx22(
|
|
37251
37517
|
"div",
|
|
37252
37518
|
{
|
|
37253
37519
|
className: " w-full h-screen top-0 left-0 fixed ",
|
|
@@ -37255,8 +37521,8 @@ function Filter({
|
|
|
37255
37521
|
onClick: (e) => setVisible(!visible)
|
|
37256
37522
|
}
|
|
37257
37523
|
) }),
|
|
37258
|
-
/* @__PURE__ */
|
|
37259
|
-
/* @__PURE__ */
|
|
37524
|
+
/* @__PURE__ */ jsxs14("div", { className: "relative w-full justify-center flex", children: [
|
|
37525
|
+
/* @__PURE__ */ jsxs14(
|
|
37260
37526
|
"div",
|
|
37261
37527
|
{
|
|
37262
37528
|
style: (colSizes == null ? void 0 : colSizes[h]) ? {
|
|
@@ -37268,19 +37534,19 @@ function Filter({
|
|
|
37268
37534
|
onClick: (e) => setVisible(!visible),
|
|
37269
37535
|
children: [
|
|
37270
37536
|
sort && //
|
|
37271
|
-
Object.keys(sort)[0] == h && ((sort == null ? void 0 : sort[h]) == "asc" ? /* @__PURE__ */
|
|
37272
|
-
/* @__PURE__ */
|
|
37273
|
-
selected.length < items.length && /* @__PURE__ */
|
|
37537
|
+
Object.keys(sort)[0] == h && ((sort == null ? void 0 : sort[h]) == "asc" ? /* @__PURE__ */ jsx22("div", { className: "text-green-300", children: /* @__PURE__ */ jsx22(OrderAsc, {}) }) : (sort == null ? void 0 : sort[h]) == "desc" && /* @__PURE__ */ jsx22("div", { className: "text-green-300", children: /* @__PURE__ */ jsx22(OrderDesc, {}) })),
|
|
37538
|
+
/* @__PURE__ */ jsx22("div", { children: h }),
|
|
37539
|
+
selected.length < items.length && /* @__PURE__ */ jsx22("div", { className: "text-red-500 ", children: /* @__PURE__ */ jsx22(FilterOffIcon, {}) })
|
|
37274
37540
|
]
|
|
37275
37541
|
}
|
|
37276
37542
|
),
|
|
37277
|
-
visible && /* @__PURE__ */
|
|
37543
|
+
visible && /* @__PURE__ */ jsx22(
|
|
37278
37544
|
"div",
|
|
37279
37545
|
{
|
|
37280
37546
|
className: "border shadow rounded bg-white p-1 absolute left-0 text-black",
|
|
37281
37547
|
style: { zIndex: 9999 },
|
|
37282
|
-
children: /* @__PURE__ */
|
|
37283
|
-
/* @__PURE__ */
|
|
37548
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-1 w-[300px] min-w-[300px] resize-x overflow-auto", children: [
|
|
37549
|
+
/* @__PURE__ */ jsxs14(
|
|
37284
37550
|
"div",
|
|
37285
37551
|
{
|
|
37286
37552
|
onClick: (e) => {
|
|
@@ -37297,12 +37563,12 @@ function Filter({
|
|
|
37297
37563
|
},
|
|
37298
37564
|
className: "flex items-center gap-2 border p-1 hover:bg-blue-100",
|
|
37299
37565
|
children: [
|
|
37300
|
-
/* @__PURE__ */
|
|
37566
|
+
/* @__PURE__ */ jsx22(OrderAsc, {}),
|
|
37301
37567
|
" Ordenar de la A a la Z"
|
|
37302
37568
|
]
|
|
37303
37569
|
}
|
|
37304
37570
|
),
|
|
37305
|
-
/* @__PURE__ */
|
|
37571
|
+
/* @__PURE__ */ jsxs14(
|
|
37306
37572
|
"div",
|
|
37307
37573
|
{
|
|
37308
37574
|
onClick: (e) => {
|
|
@@ -37319,12 +37585,12 @@ function Filter({
|
|
|
37319
37585
|
},
|
|
37320
37586
|
className: "flex items-center gap-2 border p-1 hover:bg-blue-100",
|
|
37321
37587
|
children: [
|
|
37322
|
-
/* @__PURE__ */
|
|
37588
|
+
/* @__PURE__ */ jsx22(OrderDesc, {}),
|
|
37323
37589
|
"Ordenar de la Z a la A"
|
|
37324
37590
|
]
|
|
37325
37591
|
}
|
|
37326
37592
|
),
|
|
37327
|
-
selected.length < items.length && /* @__PURE__ */
|
|
37593
|
+
selected.length < items.length && /* @__PURE__ */ jsxs14(
|
|
37328
37594
|
"div",
|
|
37329
37595
|
{
|
|
37330
37596
|
className: "p-1 flex items-center justify-between px-2 bg-red-200 border shadow rounded",
|
|
@@ -37333,11 +37599,11 @@ function Filter({
|
|
|
37333
37599
|
},
|
|
37334
37600
|
children: [
|
|
37335
37601
|
"Borrar Filtro",
|
|
37336
|
-
/* @__PURE__ */
|
|
37602
|
+
/* @__PURE__ */ jsx22("div", { className: "text-white ", children: /* @__PURE__ */ jsx22(FilterOffIcon, {}) })
|
|
37337
37603
|
]
|
|
37338
37604
|
}
|
|
37339
37605
|
),
|
|
37340
|
-
/* @__PURE__ */
|
|
37606
|
+
/* @__PURE__ */ jsx22("div", { className: "", children: /* @__PURE__ */ jsx22(
|
|
37341
37607
|
"input",
|
|
37342
37608
|
{
|
|
37343
37609
|
className: "border shadow rounded p-2 w-full",
|
|
@@ -37356,8 +37622,8 @@ function Filter({
|
|
|
37356
37622
|
}
|
|
37357
37623
|
}
|
|
37358
37624
|
) }),
|
|
37359
|
-
/* @__PURE__ */
|
|
37360
|
-
/* @__PURE__ */
|
|
37625
|
+
/* @__PURE__ */ jsx22("div", { children: /* @__PURE__ */ jsxs14("label", { className: "flex gap-1 cursor-pointer px-1", children: [
|
|
37626
|
+
/* @__PURE__ */ jsx22(
|
|
37361
37627
|
"input",
|
|
37362
37628
|
{
|
|
37363
37629
|
type: "checkbox",
|
|
@@ -37373,9 +37639,9 @@ function Filter({
|
|
|
37373
37639
|
),
|
|
37374
37640
|
"(Seleccionar Todo)"
|
|
37375
37641
|
] }) }),
|
|
37376
|
-
/* @__PURE__ */
|
|
37377
|
-
return /* @__PURE__ */
|
|
37378
|
-
/* @__PURE__ */
|
|
37642
|
+
/* @__PURE__ */ jsx22("div", { className: "overflow-auto flex gap-1 flex-col p-1 border shadow rounded h-[300px]", children: itemsFiltered.map((item) => {
|
|
37643
|
+
return /* @__PURE__ */ jsx22("div", { className: "hover:bg-gray-100 ", children: /* @__PURE__ */ jsxs14("label", { className: "flex gap-1 cursor-pointer truncate", children: [
|
|
37644
|
+
/* @__PURE__ */ jsx22(
|
|
37379
37645
|
"input",
|
|
37380
37646
|
{
|
|
37381
37647
|
type: "checkbox",
|
|
@@ -37396,8 +37662,8 @@ function Filter({
|
|
|
37396
37662
|
item || "(Vacias)"
|
|
37397
37663
|
] }) }, item);
|
|
37398
37664
|
}) }),
|
|
37399
|
-
/* @__PURE__ */
|
|
37400
|
-
/* @__PURE__ */
|
|
37665
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between px-1", children: [
|
|
37666
|
+
/* @__PURE__ */ jsx22(
|
|
37401
37667
|
"button",
|
|
37402
37668
|
{
|
|
37403
37669
|
className: "p-1 shadow rounded border bg-red-500 text-white",
|
|
@@ -37408,7 +37674,7 @@ function Filter({
|
|
|
37408
37674
|
children: "Cancelar"
|
|
37409
37675
|
}
|
|
37410
37676
|
),
|
|
37411
|
-
/* @__PURE__ */
|
|
37677
|
+
/* @__PURE__ */ jsx22(
|
|
37412
37678
|
"button",
|
|
37413
37679
|
{
|
|
37414
37680
|
className: "p-1 shadow rounded border bg-blue-500 text-white",
|
|
@@ -37427,7 +37693,7 @@ function Filter({
|
|
|
37427
37693
|
}
|
|
37428
37694
|
|
|
37429
37695
|
// src/table3/head.tsx
|
|
37430
|
-
import { jsx as
|
|
37696
|
+
import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
37431
37697
|
function TableHead({
|
|
37432
37698
|
headers,
|
|
37433
37699
|
selectItems,
|
|
@@ -37442,9 +37708,9 @@ function TableHead({
|
|
|
37442
37708
|
sort,
|
|
37443
37709
|
setSort
|
|
37444
37710
|
}) {
|
|
37445
|
-
return /* @__PURE__ */
|
|
37446
|
-
modal && /* @__PURE__ */
|
|
37447
|
-
selectItems && /* @__PURE__ */
|
|
37711
|
+
return /* @__PURE__ */ jsx23("thead", { children: /* @__PURE__ */ jsxs15("tr", { className: "bg-blue-500 text-white font-bold", children: [
|
|
37712
|
+
modal && /* @__PURE__ */ jsx23("th", { children: "-" }),
|
|
37713
|
+
selectItems && /* @__PURE__ */ jsx23("th", { children: /* @__PURE__ */ jsx23(
|
|
37448
37714
|
"input",
|
|
37449
37715
|
{
|
|
37450
37716
|
className: "m-2",
|
|
@@ -37472,7 +37738,7 @@ function TableHead({
|
|
|
37472
37738
|
) }),
|
|
37473
37739
|
Object.values(headers).map((h) => {
|
|
37474
37740
|
if (h.startsWith("_")) return null;
|
|
37475
|
-
return /* @__PURE__ */
|
|
37741
|
+
return /* @__PURE__ */ jsx23(
|
|
37476
37742
|
Filter,
|
|
37477
37743
|
{
|
|
37478
37744
|
objectData,
|
|
@@ -37495,7 +37761,7 @@ import { useState as useState11 } from "react";
|
|
|
37495
37761
|
|
|
37496
37762
|
// src/table3/tr.tsx
|
|
37497
37763
|
import React7 from "react";
|
|
37498
|
-
import { jsx as
|
|
37764
|
+
import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
37499
37765
|
function TR({
|
|
37500
37766
|
handlers,
|
|
37501
37767
|
setObjectData,
|
|
@@ -37515,7 +37781,7 @@ function TR({
|
|
|
37515
37781
|
symbols
|
|
37516
37782
|
}) {
|
|
37517
37783
|
const color = selected == index ? "bg-blue-600 text-white hover:bg-blue-800" : index % 2 == 0 ? "bg-white" : "bg-blue-50";
|
|
37518
|
-
return /* @__PURE__ */
|
|
37784
|
+
return /* @__PURE__ */ jsxs16(
|
|
37519
37785
|
"tr",
|
|
37520
37786
|
{
|
|
37521
37787
|
className: ` hover:bg-blue-100 ${color} cursor-pointer`,
|
|
@@ -37523,7 +37789,7 @@ function TR({
|
|
|
37523
37789
|
setSelected(selected == index ? -1 : index);
|
|
37524
37790
|
},
|
|
37525
37791
|
children: [
|
|
37526
|
-
modal && /* @__PURE__ */
|
|
37792
|
+
modal && /* @__PURE__ */ jsx24("th", { className: "border", children: /* @__PURE__ */ jsx24(
|
|
37527
37793
|
"button",
|
|
37528
37794
|
{
|
|
37529
37795
|
className: "p-1 border shadow-rounded bg-blue-500 rounded text-white",
|
|
@@ -37532,10 +37798,10 @@ function TR({
|
|
|
37532
37798
|
(_a = modalRef.current) == null ? void 0 : _a.showModal();
|
|
37533
37799
|
setDialogRow(row);
|
|
37534
37800
|
},
|
|
37535
|
-
children: /* @__PURE__ */
|
|
37801
|
+
children: /* @__PURE__ */ jsx24(EditIcon2, {})
|
|
37536
37802
|
}
|
|
37537
37803
|
) }),
|
|
37538
|
-
selectItems && /* @__PURE__ */
|
|
37804
|
+
selectItems && /* @__PURE__ */ jsx24("th", { className: "border", children: /* @__PURE__ */ jsx24(
|
|
37539
37805
|
"input",
|
|
37540
37806
|
{
|
|
37541
37807
|
type: "checkbox",
|
|
@@ -37603,13 +37869,13 @@ function TR({
|
|
|
37603
37869
|
return acc;
|
|
37604
37870
|
}, {})
|
|
37605
37871
|
});
|
|
37606
|
-
return /* @__PURE__ */
|
|
37872
|
+
return /* @__PURE__ */ jsx24("td", { className: `text-black `, children: cloned }, h);
|
|
37607
37873
|
}
|
|
37608
|
-
return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */
|
|
37874
|
+
return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */ jsx24("td", { className: `text-center border max-w-[${colSize}px] `, children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1 w-full", children: [
|
|
37609
37875
|
symbols[h],
|
|
37610
37876
|
" ",
|
|
37611
37877
|
row[h]
|
|
37612
|
-
] }) }, h) : /* @__PURE__ */
|
|
37878
|
+
] }) }, h) : /* @__PURE__ */ jsx24("td", { className: `text-center border max-w-[${colSize}px]`, children: row[h] }, h);
|
|
37613
37879
|
})
|
|
37614
37880
|
]
|
|
37615
37881
|
},
|
|
@@ -37618,7 +37884,7 @@ function TR({
|
|
|
37618
37884
|
}
|
|
37619
37885
|
|
|
37620
37886
|
// src/table3/body.tsx
|
|
37621
|
-
import { jsx as
|
|
37887
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
37622
37888
|
function TableBody({
|
|
37623
37889
|
objectData,
|
|
37624
37890
|
setObjectData,
|
|
@@ -37662,7 +37928,7 @@ function TableBody({
|
|
|
37662
37928
|
return key >= start && key < end;
|
|
37663
37929
|
}).map(([id, k], index) => {
|
|
37664
37930
|
const row = objectData[id];
|
|
37665
|
-
return /* @__PURE__ */
|
|
37931
|
+
return /* @__PURE__ */ jsx25(
|
|
37666
37932
|
TR,
|
|
37667
37933
|
{
|
|
37668
37934
|
...{
|
|
@@ -37687,11 +37953,11 @@ function TableBody({
|
|
|
37687
37953
|
id
|
|
37688
37954
|
);
|
|
37689
37955
|
});
|
|
37690
|
-
return /* @__PURE__ */
|
|
37956
|
+
return /* @__PURE__ */ jsx25("tbody", { children: sorted });
|
|
37691
37957
|
}
|
|
37692
37958
|
|
|
37693
37959
|
// src/table3/panel.tsx
|
|
37694
|
-
import { jsx as
|
|
37960
|
+
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
37695
37961
|
function Panel({
|
|
37696
37962
|
page,
|
|
37697
37963
|
setPage,
|
|
@@ -37702,9 +37968,9 @@ function Panel({
|
|
|
37702
37968
|
maxItems
|
|
37703
37969
|
}) {
|
|
37704
37970
|
const excel = useExcel();
|
|
37705
|
-
return /* @__PURE__ */
|
|
37706
|
-
/* @__PURE__ */
|
|
37707
|
-
onSave && /* @__PURE__ */
|
|
37971
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex gap-2 bg-gray-100 items-center", children: [
|
|
37972
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex gap-1 ", children: [
|
|
37973
|
+
onSave && /* @__PURE__ */ jsxs17(
|
|
37708
37974
|
"button",
|
|
37709
37975
|
{
|
|
37710
37976
|
className: "p-2 border shadow rounded bg-blue-500 text-white flex items-center gap-1 text-md",
|
|
@@ -37713,12 +37979,12 @@ function Panel({
|
|
|
37713
37979
|
},
|
|
37714
37980
|
children: [
|
|
37715
37981
|
" ",
|
|
37716
|
-
/* @__PURE__ */
|
|
37982
|
+
/* @__PURE__ */ jsx26(SaveIcon, {}),
|
|
37717
37983
|
"Guardar"
|
|
37718
37984
|
]
|
|
37719
37985
|
}
|
|
37720
37986
|
),
|
|
37721
|
-
exportName && /* @__PURE__ */
|
|
37987
|
+
exportName && /* @__PURE__ */ jsxs17(
|
|
37722
37988
|
"button",
|
|
37723
37989
|
{
|
|
37724
37990
|
className: "p-2 border shadow rounded bg-green-800 text-white flex items-center gap-1 text-md",
|
|
@@ -37732,22 +37998,22 @@ function Panel({
|
|
|
37732
37998
|
);
|
|
37733
37999
|
},
|
|
37734
38000
|
children: [
|
|
37735
|
-
/* @__PURE__ */
|
|
38001
|
+
/* @__PURE__ */ jsx26(ExcelIcon, {}),
|
|
37736
38002
|
"Exportar"
|
|
37737
38003
|
]
|
|
37738
38004
|
}
|
|
37739
38005
|
)
|
|
37740
38006
|
] }),
|
|
37741
|
-
maxItems !== Infinity && /* @__PURE__ */
|
|
37742
|
-
/* @__PURE__ */
|
|
37743
|
-
/* @__PURE__ */
|
|
37744
|
-
/* @__PURE__ */
|
|
38007
|
+
maxItems !== Infinity && /* @__PURE__ */ jsxs17("div", { className: "flex gap-2 items-center text-2xl", children: [
|
|
38008
|
+
/* @__PURE__ */ jsx26("button", { onClick: () => setPage(1), disabled: page === 1, children: "\u23EE" }),
|
|
38009
|
+
/* @__PURE__ */ jsx26("button", { onClick: () => setPage(page - 1), disabled: page === 1, children: "\u25C0" }),
|
|
38010
|
+
/* @__PURE__ */ jsxs17("span", { className: "text-sm", children: [
|
|
37745
38011
|
"P\xE1gina ",
|
|
37746
38012
|
page,
|
|
37747
38013
|
" / ",
|
|
37748
38014
|
totalPages
|
|
37749
38015
|
] }),
|
|
37750
|
-
/* @__PURE__ */
|
|
38016
|
+
/* @__PURE__ */ jsx26(
|
|
37751
38017
|
"button",
|
|
37752
38018
|
{
|
|
37753
38019
|
onClick: () => setPage(page + 1),
|
|
@@ -37755,7 +38021,7 @@ function Panel({
|
|
|
37755
38021
|
children: "\u25B6"
|
|
37756
38022
|
}
|
|
37757
38023
|
),
|
|
37758
|
-
/* @__PURE__ */
|
|
38024
|
+
/* @__PURE__ */ jsx26(
|
|
37759
38025
|
"button",
|
|
37760
38026
|
{
|
|
37761
38027
|
onClick: () => setPage(totalPages),
|
|
@@ -37768,7 +38034,7 @@ function Panel({
|
|
|
37768
38034
|
}
|
|
37769
38035
|
|
|
37770
38036
|
// src/table3/footer.tsx
|
|
37771
|
-
import { jsx as
|
|
38037
|
+
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
37772
38038
|
function TableFooter({
|
|
37773
38039
|
objectData,
|
|
37774
38040
|
headers,
|
|
@@ -37793,28 +38059,28 @@ function TableFooter({
|
|
|
37793
38059
|
return null;
|
|
37794
38060
|
}
|
|
37795
38061
|
}
|
|
37796
|
-
return footer && /* @__PURE__ */
|
|
37797
|
-
selectItems && /* @__PURE__ */
|
|
37798
|
-
modal && /* @__PURE__ */
|
|
38062
|
+
return footer && /* @__PURE__ */ jsx27("tfoot", { children: /* @__PURE__ */ jsxs18("tr", { className: "bg-blue-500 text-white", children: [
|
|
38063
|
+
selectItems && /* @__PURE__ */ jsx27("th", {}),
|
|
38064
|
+
modal && /* @__PURE__ */ jsx27("th", {}),
|
|
37799
38065
|
headers.map((header) => {
|
|
37800
38066
|
if (header.startsWith("_")) {
|
|
37801
38067
|
return null;
|
|
37802
38068
|
} else if (footer == null ? void 0 : footer[header]) {
|
|
37803
|
-
return symbols && (symbols == null ? void 0 : symbols[header]) ? /* @__PURE__ */
|
|
38069
|
+
return symbols && (symbols == null ? void 0 : symbols[header]) ? /* @__PURE__ */ jsxs18("th", { className: "flex items-center gap-1", children: [
|
|
37804
38070
|
symbols[header],
|
|
37805
38071
|
" ",
|
|
37806
38072
|
operacion(footer[header], header)
|
|
37807
|
-
] }, header) : /* @__PURE__ */
|
|
38073
|
+
] }, header) : /* @__PURE__ */ jsx27("th", { children: operacion(footer[header], header) }, header);
|
|
37808
38074
|
}
|
|
37809
|
-
return /* @__PURE__ */
|
|
38075
|
+
return /* @__PURE__ */ jsx27("th", {}, header);
|
|
37810
38076
|
})
|
|
37811
38077
|
] }) });
|
|
37812
38078
|
}
|
|
37813
38079
|
|
|
37814
38080
|
// src/table3/dialog.tsx
|
|
37815
38081
|
import React8, { useMemo as useMemo5 } from "react";
|
|
37816
|
-
import { jsx as
|
|
37817
|
-
function
|
|
38082
|
+
import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
38083
|
+
function Dialog3({
|
|
37818
38084
|
modalRef,
|
|
37819
38085
|
children,
|
|
37820
38086
|
dialogRow,
|
|
@@ -37841,15 +38107,15 @@ function Dialog4({
|
|
|
37841
38107
|
}
|
|
37842
38108
|
return null;
|
|
37843
38109
|
}, [dialogRow, children]);
|
|
37844
|
-
return /* @__PURE__ */
|
|
38110
|
+
return /* @__PURE__ */ jsxs19(
|
|
37845
38111
|
"dialog",
|
|
37846
38112
|
{
|
|
37847
38113
|
ref: modalRef,
|
|
37848
38114
|
className: "p-6 rounded-xl shadow-2xl backdrop:bg-black/50 w-[100%] h-screen",
|
|
37849
38115
|
children: [
|
|
37850
|
-
/* @__PURE__ */
|
|
37851
|
-
/* @__PURE__ */
|
|
37852
|
-
/* @__PURE__ */
|
|
38116
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between items-center mb-4", children: [
|
|
38117
|
+
/* @__PURE__ */ jsx28("div", {}),
|
|
38118
|
+
/* @__PURE__ */ jsx28(
|
|
37853
38119
|
"button",
|
|
37854
38120
|
{
|
|
37855
38121
|
onClick: () => {
|
|
@@ -37861,15 +38127,15 @@ function Dialog4({
|
|
|
37861
38127
|
}
|
|
37862
38128
|
)
|
|
37863
38129
|
] }),
|
|
37864
|
-
/* @__PURE__ */
|
|
38130
|
+
/* @__PURE__ */ jsx28("div", { className: "text-gray-700", children: clonedModal })
|
|
37865
38131
|
]
|
|
37866
38132
|
}
|
|
37867
38133
|
);
|
|
37868
38134
|
}
|
|
37869
|
-
var dialog_default =
|
|
38135
|
+
var dialog_default = Dialog3;
|
|
37870
38136
|
|
|
37871
38137
|
// src/table3/index.tsx
|
|
37872
|
-
import { jsx as
|
|
38138
|
+
import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
37873
38139
|
function Table3({
|
|
37874
38140
|
data,
|
|
37875
38141
|
selectItems,
|
|
@@ -37945,7 +38211,7 @@ function Table3({
|
|
|
37945
38211
|
return maxItems ? Math.ceil(Object.keys(objectData).length / maxItems) : 1;
|
|
37946
38212
|
}, [objectData, maxItems]);
|
|
37947
38213
|
const [sort, setSort] = useState12(sortBy);
|
|
37948
|
-
const modalRef =
|
|
38214
|
+
const modalRef = useRef5(null);
|
|
37949
38215
|
const [dialogRow, setDialogRow] = useState12({});
|
|
37950
38216
|
const context = {
|
|
37951
38217
|
objectData,
|
|
@@ -37981,8 +38247,8 @@ function Table3({
|
|
|
37981
38247
|
}, [objectData]);
|
|
37982
38248
|
const style = (props == null ? void 0 : props.style) ? { ...props.style, tableLayout: "fixed" } : { tableLayout: "fixed" };
|
|
37983
38249
|
if (!objectData) return null;
|
|
37984
|
-
return /* @__PURE__ */
|
|
37985
|
-
modal && /* @__PURE__ */
|
|
38250
|
+
return /* @__PURE__ */ jsxs20("div", { className: "border shadow rounded m-1 p-1 bg-white", children: [
|
|
38251
|
+
modal && /* @__PURE__ */ jsx29(
|
|
37986
38252
|
dialog_default,
|
|
37987
38253
|
{
|
|
37988
38254
|
modalRef,
|
|
@@ -37992,222 +38258,15 @@ function Table3({
|
|
|
37992
38258
|
children: modal
|
|
37993
38259
|
}
|
|
37994
38260
|
),
|
|
37995
|
-
header && /* @__PURE__ */
|
|
37996
|
-
/* @__PURE__ */
|
|
37997
|
-
/* @__PURE__ */
|
|
37998
|
-
/* @__PURE__ */
|
|
37999
|
-
/* @__PURE__ */
|
|
38000
|
-
/* @__PURE__ */
|
|
38261
|
+
header && /* @__PURE__ */ jsx29("div", { className: "font-bold text-2xl py-5 px-2 bg-blue-50", children: header }),
|
|
38262
|
+
/* @__PURE__ */ jsx29(Panel, { ...context }),
|
|
38263
|
+
/* @__PURE__ */ jsxs20("table", { ...props, style, children: [
|
|
38264
|
+
/* @__PURE__ */ jsx29(TableHead, { ...context }),
|
|
38265
|
+
/* @__PURE__ */ jsx29(TableBody, { ...context }),
|
|
38266
|
+
/* @__PURE__ */ jsx29(TableFooter, { ...context })
|
|
38001
38267
|
] })
|
|
38002
38268
|
] });
|
|
38003
38269
|
}
|
|
38004
|
-
|
|
38005
|
-
// src/pop/index.tsx
|
|
38006
|
-
import { useState as useState13 } from "react";
|
|
38007
|
-
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
38008
|
-
var COLOR_CONFIG = {
|
|
38009
|
-
primary: {
|
|
38010
|
-
bg: "from-blue-50 to-indigo-50",
|
|
38011
|
-
iconBg: "bg-blue-100",
|
|
38012
|
-
iconText: "text-blue-600",
|
|
38013
|
-
border: "border-blue-200",
|
|
38014
|
-
confirm: "bg-blue-600 hover:bg-blue-700 focus:ring-blue-300",
|
|
38015
|
-
label: "\u2139"
|
|
38016
|
-
},
|
|
38017
|
-
info: {
|
|
38018
|
-
bg: "from-sky-50 to-cyan-50",
|
|
38019
|
-
iconBg: "bg-sky-100",
|
|
38020
|
-
iconText: "text-sky-600",
|
|
38021
|
-
border: "border-sky-200",
|
|
38022
|
-
confirm: "bg-sky-600 hover:bg-sky-700 focus:ring-sky-300",
|
|
38023
|
-
label: "\u2139"
|
|
38024
|
-
},
|
|
38025
|
-
success: {
|
|
38026
|
-
bg: "from-emerald-50 to-green-50",
|
|
38027
|
-
iconBg: "bg-emerald-100",
|
|
38028
|
-
iconText: "text-emerald-600",
|
|
38029
|
-
border: "border-emerald-200",
|
|
38030
|
-
confirm: "bg-emerald-600 hover:bg-emerald-700 focus:ring-emerald-300",
|
|
38031
|
-
label: "\u2713"
|
|
38032
|
-
},
|
|
38033
|
-
warning: {
|
|
38034
|
-
bg: "from-amber-50 to-yellow-50",
|
|
38035
|
-
iconBg: "bg-amber-100",
|
|
38036
|
-
iconText: "text-amber-600",
|
|
38037
|
-
border: "border-amber-200",
|
|
38038
|
-
confirm: "bg-amber-500 hover:bg-amber-600 focus:ring-amber-300",
|
|
38039
|
-
label: "\u26A0"
|
|
38040
|
-
},
|
|
38041
|
-
danger: {
|
|
38042
|
-
bg: "from-red-50 to-rose-50",
|
|
38043
|
-
iconBg: "bg-red-100",
|
|
38044
|
-
iconText: "text-red-600",
|
|
38045
|
-
border: "border-red-200",
|
|
38046
|
-
confirm: "bg-red-600 hover:bg-red-700 focus:ring-red-300",
|
|
38047
|
-
label: "\u2715"
|
|
38048
|
-
},
|
|
38049
|
-
secondary: {
|
|
38050
|
-
bg: "from-slate-50 to-gray-50",
|
|
38051
|
-
iconBg: "bg-slate-100",
|
|
38052
|
-
iconText: "text-slate-600",
|
|
38053
|
-
border: "border-slate-200",
|
|
38054
|
-
confirm: "bg-slate-700 hover:bg-slate-800 focus:ring-slate-300",
|
|
38055
|
-
label: "\u25CE"
|
|
38056
|
-
},
|
|
38057
|
-
white: {
|
|
38058
|
-
bg: "from-gray-50 to-white",
|
|
38059
|
-
iconBg: "bg-gray-100",
|
|
38060
|
-
iconText: "text-gray-500",
|
|
38061
|
-
border: "border-gray-200",
|
|
38062
|
-
confirm: "bg-gray-700 hover:bg-gray-800 focus:ring-gray-300",
|
|
38063
|
-
label: "\u25CE"
|
|
38064
|
-
}
|
|
38065
|
-
};
|
|
38066
|
-
function usePopup() {
|
|
38067
|
-
const [popup, setPopup] = useState13({
|
|
38068
|
-
type: "alert",
|
|
38069
|
-
message: "",
|
|
38070
|
-
visible: false,
|
|
38071
|
-
inputValue: "",
|
|
38072
|
-
color: "primary"
|
|
38073
|
-
});
|
|
38074
|
-
function alert2(message, color = "primary") {
|
|
38075
|
-
return new Promise((resolve) => {
|
|
38076
|
-
setPopup({
|
|
38077
|
-
type: "alert",
|
|
38078
|
-
message,
|
|
38079
|
-
visible: true,
|
|
38080
|
-
inputValue: "",
|
|
38081
|
-
onConfirm: () => resolve(),
|
|
38082
|
-
color
|
|
38083
|
-
});
|
|
38084
|
-
});
|
|
38085
|
-
}
|
|
38086
|
-
function modal(message, color = "primary") {
|
|
38087
|
-
return new Promise((resolve) => {
|
|
38088
|
-
setPopup({
|
|
38089
|
-
type: "modal",
|
|
38090
|
-
message,
|
|
38091
|
-
visible: true,
|
|
38092
|
-
inputValue: "",
|
|
38093
|
-
onConfirm: () => resolve(),
|
|
38094
|
-
color
|
|
38095
|
-
});
|
|
38096
|
-
});
|
|
38097
|
-
}
|
|
38098
|
-
function confirm(message, color = "primary") {
|
|
38099
|
-
return new Promise((resolve) => {
|
|
38100
|
-
setPopup({
|
|
38101
|
-
type: "confirm",
|
|
38102
|
-
message,
|
|
38103
|
-
visible: true,
|
|
38104
|
-
inputValue: "",
|
|
38105
|
-
onConfirm: () => resolve(true),
|
|
38106
|
-
onCancel: () => resolve(false),
|
|
38107
|
-
color
|
|
38108
|
-
});
|
|
38109
|
-
});
|
|
38110
|
-
}
|
|
38111
|
-
function prompt(message, color = "primary") {
|
|
38112
|
-
return new Promise((resolve) => {
|
|
38113
|
-
setPopup({
|
|
38114
|
-
type: "prompt",
|
|
38115
|
-
message,
|
|
38116
|
-
visible: true,
|
|
38117
|
-
inputValue: "",
|
|
38118
|
-
onConfirm: (value) => resolve(value != null ? value : ""),
|
|
38119
|
-
onCancel: () => resolve(null),
|
|
38120
|
-
color
|
|
38121
|
-
});
|
|
38122
|
-
});
|
|
38123
|
-
}
|
|
38124
|
-
function close(confirmed, value) {
|
|
38125
|
-
setPopup((prev) => {
|
|
38126
|
-
var _a, _b;
|
|
38127
|
-
if (confirmed) (_a = prev.onConfirm) == null ? void 0 : _a.call(prev, value);
|
|
38128
|
-
else (_b = prev.onCancel) == null ? void 0 : _b.call(prev);
|
|
38129
|
-
return { ...prev, visible: false, inputValue: "" };
|
|
38130
|
-
});
|
|
38131
|
-
}
|
|
38132
|
-
const c = COLOR_CONFIG[popup.color];
|
|
38133
|
-
const PopupComponent = popup.visible ? /* @__PURE__ */ jsx27(
|
|
38134
|
-
"div",
|
|
38135
|
-
{
|
|
38136
|
-
className: "fixed inset-0 flex items-center justify-center z-[1000]",
|
|
38137
|
-
style: { background: "rgba(15,23,42,0.45)", backdropFilter: "blur(2px)" },
|
|
38138
|
-
onClick: (e) => e.target === e.currentTarget && close(false),
|
|
38139
|
-
children: /* @__PURE__ */ jsxs19(
|
|
38140
|
-
"div",
|
|
38141
|
-
{
|
|
38142
|
-
className: `
|
|
38143
|
-
bg-gradient-to-br ${c.bg} border ${c.border}
|
|
38144
|
-
rounded-2xl shadow-2xl w-full max-w-sm mx-4
|
|
38145
|
-
animate-[fadeInScale_0.18s_ease-out]
|
|
38146
|
-
`,
|
|
38147
|
-
style: { animation: "fadeInScale 0.18s ease-out" },
|
|
38148
|
-
children: [
|
|
38149
|
-
/* @__PURE__ */ jsx27("style", { children: `
|
|
38150
|
-
@keyframes fadeInScale {
|
|
38151
|
-
from { opacity: 0; transform: scale(0.93) translateY(8px); }
|
|
38152
|
-
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
38153
|
-
}
|
|
38154
|
-
` }),
|
|
38155
|
-
/* @__PURE__ */ jsxs19("div", { className: "flex flex-col items-center gap-3 px-8 pt-8 pb-5 text-center", children: [
|
|
38156
|
-
/* @__PURE__ */ jsx27(
|
|
38157
|
-
"div",
|
|
38158
|
-
{
|
|
38159
|
-
className: `w-12 h-12 rounded-full ${c.iconBg} flex items-center justify-center`,
|
|
38160
|
-
children: /* @__PURE__ */ jsx27("span", { className: `text-xl font-bold ${c.iconText}`, children: c.label })
|
|
38161
|
-
}
|
|
38162
|
-
),
|
|
38163
|
-
/* @__PURE__ */ jsx27("p", { className: "text-gray-800 text-[15px] font-medium leading-snug", children: popup.message })
|
|
38164
|
-
] }),
|
|
38165
|
-
popup.type === "prompt" && /* @__PURE__ */ jsx27("div", { className: "px-8 pb-2", children: /* @__PURE__ */ jsx27(
|
|
38166
|
-
"input",
|
|
38167
|
-
{
|
|
38168
|
-
autoFocus: true,
|
|
38169
|
-
type: "text",
|
|
38170
|
-
value: popup.inputValue,
|
|
38171
|
-
onChange: (e) => setPopup((prev) => ({ ...prev, inputValue: e.target.value })),
|
|
38172
|
-
onKeyDown: (e) => e.key === "Enter" && close(true, popup.inputValue),
|
|
38173
|
-
className: `
|
|
38174
|
-
w-full px-3 py-2 rounded-lg border ${c.border} bg-white
|
|
38175
|
-
text-sm text-gray-800 outline-none
|
|
38176
|
-
focus:ring-2 ${c.confirm.includes("blue") ? "focus:ring-blue-200" : "focus:ring-gray-200"}
|
|
38177
|
-
transition
|
|
38178
|
-
`,
|
|
38179
|
-
placeholder: "Escribe aqu\xED..."
|
|
38180
|
-
}
|
|
38181
|
-
) }),
|
|
38182
|
-
/* @__PURE__ */ jsx27("div", { className: `border-t ${c.border} mx-0 mt-4` }),
|
|
38183
|
-
popup.type != "modal" && /* @__PURE__ */ jsxs19("div", { className: "flex gap-2 px-6 py-4 justify-end", children: [
|
|
38184
|
-
(popup.type === "confirm" || popup.type === "prompt") && /* @__PURE__ */ jsx27(
|
|
38185
|
-
"button",
|
|
38186
|
-
{
|
|
38187
|
-
onClick: () => close(false),
|
|
38188
|
-
className: "\r\n px-4 py-2 rounded-lg text-sm font-medium\r\n bg-white border border-gray-200 text-gray-600\r\n hover:bg-gray-50 transition\r\n ",
|
|
38189
|
-
children: "Cancelar"
|
|
38190
|
-
}
|
|
38191
|
-
),
|
|
38192
|
-
/* @__PURE__ */ jsx27(
|
|
38193
|
-
"button",
|
|
38194
|
-
{
|
|
38195
|
-
onClick: () => close(true, popup.inputValue),
|
|
38196
|
-
className: `
|
|
38197
|
-
px-5 py-2 rounded-lg text-sm font-semibold text-white
|
|
38198
|
-
${c.confirm} transition focus:outline-none focus:ring-2
|
|
38199
|
-
`,
|
|
38200
|
-
children: "Aceptar"
|
|
38201
|
-
}
|
|
38202
|
-
)
|
|
38203
|
-
] })
|
|
38204
|
-
]
|
|
38205
|
-
}
|
|
38206
|
-
)
|
|
38207
|
-
}
|
|
38208
|
-
) : null;
|
|
38209
|
-
return { alert: alert2, confirm, prompt, PopupComponent, modal };
|
|
38210
|
-
}
|
|
38211
38270
|
export {
|
|
38212
38271
|
Alert,
|
|
38213
38272
|
Button,
|