next-recomponents 2.0.10 → 2.0.11
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.js
CHANGED
|
@@ -3682,7 +3682,7 @@ function Container({
|
|
|
3682
3682
|
}
|
|
3683
3683
|
}, []);
|
|
3684
3684
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col h-screen", children: [
|
|
3685
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "
|
|
3685
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "", children: [
|
|
3686
3686
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "bg-blue-600 text-white p-4 flex justify-between items-center shadow-md", children: [
|
|
3687
3687
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3688
3688
|
"button",
|
|
@@ -36783,78 +36783,344 @@ function Select({
|
|
|
36783
36783
|
}
|
|
36784
36784
|
|
|
36785
36785
|
// src/modal/index.tsx
|
|
36786
|
-
var
|
|
36786
|
+
var import_react10 = __toESM(require("react"));
|
|
36787
36787
|
|
|
36788
|
-
// src/
|
|
36788
|
+
// src/pop/index.tsx
|
|
36789
|
+
var import_react9 = require("react");
|
|
36790
|
+
|
|
36791
|
+
// src/pop/actions.tsx
|
|
36789
36792
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
36790
|
-
function
|
|
36791
|
-
|
|
36792
|
-
|
|
36793
|
+
function PopupActions({
|
|
36794
|
+
type,
|
|
36795
|
+
confirm,
|
|
36796
|
+
focusRing,
|
|
36797
|
+
onConfirm,
|
|
36798
|
+
onCancel
|
|
36799
|
+
}) {
|
|
36800
|
+
const showCancel = type === "confirm" || type === "prompt";
|
|
36801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex gap-2 px-6 py-4 justify-end", children: [
|
|
36802
|
+
showCancel && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
36803
|
+
"button",
|
|
36804
|
+
{
|
|
36805
|
+
onClick: onCancel,
|
|
36806
|
+
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",
|
|
36807
|
+
children: "Cancelar"
|
|
36808
|
+
}
|
|
36809
|
+
),
|
|
36810
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
36811
|
+
"button",
|
|
36812
|
+
{
|
|
36813
|
+
onClick: onConfirm,
|
|
36814
|
+
className: `px-5 py-2 rounded-lg text-sm font-semibold text-white ${confirm} transition focus:outline-none focus:ring-2 ${focusRing}`,
|
|
36815
|
+
children: "Aceptar"
|
|
36816
|
+
}
|
|
36817
|
+
)
|
|
36818
|
+
] });
|
|
36819
|
+
}
|
|
36820
|
+
|
|
36821
|
+
// src/pop/color.tsx
|
|
36822
|
+
var COLOR_CONFIG = {
|
|
36823
|
+
primary: {
|
|
36824
|
+
bg: "from-blue-50 to-indigo-50",
|
|
36825
|
+
iconBg: "bg-blue-100",
|
|
36826
|
+
iconText: "text-blue-600",
|
|
36827
|
+
border: "border-blue-200",
|
|
36828
|
+
confirm: "bg-blue-600 hover:bg-blue-700",
|
|
36829
|
+
focusRing: "focus:ring-blue-300",
|
|
36830
|
+
label: "\u2139"
|
|
36831
|
+
},
|
|
36832
|
+
info: {
|
|
36833
|
+
bg: "from-sky-50 to-cyan-50",
|
|
36834
|
+
iconBg: "bg-sky-100",
|
|
36835
|
+
iconText: "text-sky-600",
|
|
36836
|
+
border: "border-sky-200",
|
|
36837
|
+
confirm: "bg-sky-600 hover:bg-sky-700",
|
|
36838
|
+
focusRing: "focus:ring-sky-300",
|
|
36839
|
+
label: "\u2139"
|
|
36840
|
+
},
|
|
36841
|
+
success: {
|
|
36842
|
+
bg: "from-emerald-50 to-green-50",
|
|
36843
|
+
iconBg: "bg-emerald-100",
|
|
36844
|
+
iconText: "text-emerald-600",
|
|
36845
|
+
border: "border-emerald-200",
|
|
36846
|
+
confirm: "bg-emerald-600 hover:bg-emerald-700",
|
|
36847
|
+
focusRing: "focus:ring-emerald-300",
|
|
36848
|
+
label: "\u2713"
|
|
36849
|
+
},
|
|
36850
|
+
warning: {
|
|
36851
|
+
bg: "from-amber-50 to-yellow-50",
|
|
36852
|
+
iconBg: "bg-amber-100",
|
|
36853
|
+
iconText: "text-amber-600",
|
|
36854
|
+
border: "border-amber-200",
|
|
36855
|
+
confirm: "bg-amber-500 hover:bg-amber-600",
|
|
36856
|
+
focusRing: "focus:ring-amber-300",
|
|
36857
|
+
label: "\u26A0"
|
|
36858
|
+
},
|
|
36859
|
+
danger: {
|
|
36860
|
+
bg: "from-red-50 to-rose-50",
|
|
36861
|
+
iconBg: "bg-red-100",
|
|
36862
|
+
iconText: "text-red-600",
|
|
36863
|
+
border: "border-red-200",
|
|
36864
|
+
confirm: "bg-red-600 hover:bg-red-700",
|
|
36865
|
+
focusRing: "focus:ring-red-300",
|
|
36866
|
+
label: "\u2715"
|
|
36867
|
+
},
|
|
36868
|
+
secondary: {
|
|
36869
|
+
bg: "from-slate-50 to-gray-50",
|
|
36870
|
+
iconBg: "bg-slate-100",
|
|
36871
|
+
iconText: "text-slate-600",
|
|
36872
|
+
border: "border-slate-200",
|
|
36873
|
+
confirm: "bg-slate-700 hover:bg-slate-800",
|
|
36874
|
+
focusRing: "focus:ring-slate-300",
|
|
36875
|
+
label: "\u25CE"
|
|
36876
|
+
},
|
|
36877
|
+
white: {
|
|
36878
|
+
bg: "from-gray-50 to-white",
|
|
36879
|
+
iconBg: "bg-gray-100",
|
|
36880
|
+
iconText: "text-gray-500",
|
|
36881
|
+
border: "border-gray-200",
|
|
36882
|
+
confirm: "bg-gray-700 hover:bg-gray-800",
|
|
36883
|
+
focusRing: "focus:ring-gray-300",
|
|
36884
|
+
label: "\u25CE"
|
|
36885
|
+
}
|
|
36886
|
+
};
|
|
36887
|
+
|
|
36888
|
+
// src/pop/icon.tsx
|
|
36889
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
36890
|
+
function PopupIcon({ label, iconBg, iconText }) {
|
|
36891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
36892
|
+
"div",
|
|
36793
36893
|
{
|
|
36794
|
-
|
|
36795
|
-
|
|
36796
|
-
strokeWidth: "0",
|
|
36797
|
-
viewBox: "0 0 512 512",
|
|
36798
|
-
height: "20px",
|
|
36799
|
-
width: "20px",
|
|
36800
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
36801
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.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" })
|
|
36894
|
+
className: `w-12 h-12 rounded-full ${iconBg} flex items-center justify-center`,
|
|
36895
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: `text-xl font-bold ${iconText}`, children: label })
|
|
36802
36896
|
}
|
|
36803
36897
|
);
|
|
36804
36898
|
}
|
|
36805
36899
|
|
|
36806
|
-
// src/
|
|
36807
|
-
var
|
|
36808
|
-
|
|
36809
|
-
|
|
36810
|
-
|
|
36811
|
-
|
|
36812
|
-
|
|
36813
|
-
|
|
36814
|
-
|
|
36815
|
-
|
|
36816
|
-
|
|
36817
|
-
|
|
36818
|
-
|
|
36819
|
-
|
|
36820
|
-
|
|
36821
|
-
|
|
36822
|
-
|
|
36823
|
-
|
|
36824
|
-
|
|
36825
|
-
|
|
36826
|
-
|
|
36900
|
+
// src/pop/input.tsx
|
|
36901
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
36902
|
+
function PromptInput({
|
|
36903
|
+
value,
|
|
36904
|
+
border,
|
|
36905
|
+
focusRing,
|
|
36906
|
+
onChange,
|
|
36907
|
+
onEnter
|
|
36908
|
+
}) {
|
|
36909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "px-8 pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
36910
|
+
"input",
|
|
36911
|
+
{
|
|
36912
|
+
autoFocus: true,
|
|
36913
|
+
type: "text",
|
|
36914
|
+
value,
|
|
36915
|
+
onChange: (e) => onChange(e.target.value),
|
|
36916
|
+
onKeyDown: (e) => e.key === "Enter" && onEnter(),
|
|
36917
|
+
className: `
|
|
36918
|
+
w-full px-3 py-2 rounded-lg border ${border} bg-white
|
|
36919
|
+
text-sm text-gray-800 outline-none
|
|
36920
|
+
focus:ring-2 ${focusRing} transition
|
|
36921
|
+
`,
|
|
36922
|
+
placeholder: "Escribe aqu\xED..."
|
|
36923
|
+
}
|
|
36924
|
+
) });
|
|
36925
|
+
}
|
|
36926
|
+
|
|
36927
|
+
// src/pop/overlay.tsx
|
|
36928
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
36929
|
+
function PopupOverlay({
|
|
36930
|
+
popup,
|
|
36931
|
+
onClose,
|
|
36932
|
+
onInputChange
|
|
36933
|
+
}) {
|
|
36934
|
+
const c = COLOR_CONFIG[popup.color];
|
|
36935
|
+
const resolvedMessage = typeof popup.message === "function" ? popup.message() : popup.message;
|
|
36936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
36937
|
+
"div",
|
|
36938
|
+
{
|
|
36939
|
+
className: "fixed inset-0 flex items-center justify-center z-[1000] ",
|
|
36940
|
+
style: { background: "rgba(15,23,42,0.45)", backdropFilter: "blur(2px)" },
|
|
36941
|
+
onClick: (e) => {
|
|
36942
|
+
var _a;
|
|
36943
|
+
if (e.target === e.currentTarget) {
|
|
36944
|
+
onClose(false);
|
|
36945
|
+
(_a = popup.onCancel) == null ? void 0 : _a.call(popup);
|
|
36946
|
+
}
|
|
36947
|
+
},
|
|
36948
|
+
children: [
|
|
36949
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("style", { children: `
|
|
36950
|
+
@keyframes fadeInScale {
|
|
36951
|
+
from { opacity: 0; transform: scale(0.93) translateY(8px); }
|
|
36952
|
+
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
36953
|
+
}
|
|
36954
|
+
` }),
|
|
36955
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
36956
|
+
"div",
|
|
36957
|
+
{
|
|
36958
|
+
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`,
|
|
36959
|
+
style: { animation: "fadeInScale 0.18s ease-out" },
|
|
36960
|
+
children: [
|
|
36961
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col items-center gap-3 px-8 pt-8 pb-5 text-center ", children: [
|
|
36962
|
+
(popup == null ? void 0 : popup.icons) == true && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
36963
|
+
PopupIcon,
|
|
36964
|
+
{
|
|
36965
|
+
label: c.label,
|
|
36966
|
+
iconBg: c.iconBg,
|
|
36967
|
+
iconText: c.iconText
|
|
36968
|
+
}
|
|
36969
|
+
),
|
|
36970
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w-full flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { color: "danger", onClick: (e) => onClose(false), children: "X" }) }),
|
|
36971
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
36972
|
+
"div",
|
|
36973
|
+
{
|
|
36974
|
+
className: "text-gray-800 text-[15px] font-medium leading-snug ",
|
|
36975
|
+
children: resolvedMessage
|
|
36976
|
+
}
|
|
36977
|
+
)
|
|
36978
|
+
] }),
|
|
36979
|
+
popup.type === "prompt" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
36980
|
+
PromptInput,
|
|
36981
|
+
{
|
|
36982
|
+
value: popup.inputValue,
|
|
36983
|
+
border: c.border,
|
|
36984
|
+
focusRing: c.focusRing,
|
|
36985
|
+
onChange: onInputChange,
|
|
36986
|
+
onEnter: () => onClose(true, popup.inputValue)
|
|
36987
|
+
}
|
|
36988
|
+
),
|
|
36989
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `border-t ${c.border} mt-4` }),
|
|
36990
|
+
popup.type !== "modal" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
36991
|
+
PopupActions,
|
|
36992
|
+
{
|
|
36993
|
+
type: popup.type,
|
|
36994
|
+
confirm: c.confirm,
|
|
36995
|
+
focusRing: c.focusRing,
|
|
36996
|
+
onConfirm: () => onClose(true, popup.inputValue),
|
|
36997
|
+
onCancel: () => onClose(false)
|
|
36998
|
+
}
|
|
36999
|
+
)
|
|
37000
|
+
]
|
|
36827
37001
|
}
|
|
36828
|
-
|
|
37002
|
+
)
|
|
37003
|
+
]
|
|
37004
|
+
}
|
|
37005
|
+
);
|
|
37006
|
+
}
|
|
37007
|
+
|
|
37008
|
+
// src/pop/index.tsx
|
|
37009
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
37010
|
+
var INITIAL_STATE = {
|
|
37011
|
+
type: "alert",
|
|
37012
|
+
message: "",
|
|
37013
|
+
visible: false,
|
|
37014
|
+
inputValue: "",
|
|
37015
|
+
color: "primary",
|
|
37016
|
+
icons: true,
|
|
37017
|
+
full: false
|
|
37018
|
+
};
|
|
37019
|
+
function usePopup() {
|
|
37020
|
+
const [popup, setPopup] = (0, import_react9.useState)(INITIAL_STATE);
|
|
37021
|
+
const open = (0, import_react9.useCallback)(
|
|
37022
|
+
(partial) => {
|
|
37023
|
+
setPopup({ ...partial, visible: true, inputValue: "" });
|
|
37024
|
+
},
|
|
37025
|
+
[]
|
|
37026
|
+
);
|
|
37027
|
+
const close = (0, import_react9.useCallback)((confirmed, value) => {
|
|
37028
|
+
setPopup((prev) => {
|
|
37029
|
+
var _a, _b;
|
|
37030
|
+
if (confirmed) (_a = prev.onConfirm) == null ? void 0 : _a.call(prev, value);
|
|
37031
|
+
else (_b = prev.onCancel) == null ? void 0 : _b.call(prev);
|
|
37032
|
+
return { ...prev, visible: false, inputValue: "" };
|
|
37033
|
+
});
|
|
37034
|
+
}, []);
|
|
37035
|
+
const alert2 = (0, import_react9.useCallback)(
|
|
37036
|
+
(message, color = "primary") => new Promise(
|
|
37037
|
+
(resolve) => open({
|
|
37038
|
+
type: "alert",
|
|
37039
|
+
message,
|
|
37040
|
+
color,
|
|
37041
|
+
onConfirm: () => resolve(),
|
|
37042
|
+
onCancel: () => resolve()
|
|
37043
|
+
})
|
|
37044
|
+
),
|
|
37045
|
+
[open]
|
|
37046
|
+
);
|
|
37047
|
+
const modal = (0, import_react9.useCallback)(
|
|
37048
|
+
(message, color = "primary", icons = true, full = false) => new Promise(
|
|
37049
|
+
(resolve) => open({
|
|
37050
|
+
type: "modal",
|
|
37051
|
+
message,
|
|
37052
|
+
color,
|
|
37053
|
+
onConfirm: () => resolve(),
|
|
37054
|
+
onCancel: () => resolve(),
|
|
37055
|
+
icons,
|
|
37056
|
+
full
|
|
37057
|
+
})
|
|
37058
|
+
),
|
|
37059
|
+
[open]
|
|
37060
|
+
);
|
|
37061
|
+
const confirm = (0, import_react9.useCallback)(
|
|
37062
|
+
(message, color = "primary") => new Promise(
|
|
37063
|
+
(resolve) => open({
|
|
37064
|
+
type: "confirm",
|
|
37065
|
+
message,
|
|
37066
|
+
color,
|
|
37067
|
+
onConfirm: () => resolve(true),
|
|
37068
|
+
onCancel: () => resolve(false)
|
|
37069
|
+
})
|
|
37070
|
+
),
|
|
37071
|
+
[open]
|
|
37072
|
+
);
|
|
37073
|
+
const prompt = (0, import_react9.useCallback)(
|
|
37074
|
+
(message, color = "primary") => new Promise(
|
|
37075
|
+
(resolve) => open({
|
|
37076
|
+
type: "prompt",
|
|
37077
|
+
message,
|
|
37078
|
+
color,
|
|
37079
|
+
onConfirm: (value) => resolve(value != null ? value : ""),
|
|
37080
|
+
onCancel: () => resolve(null)
|
|
37081
|
+
})
|
|
37082
|
+
),
|
|
37083
|
+
[open]
|
|
37084
|
+
);
|
|
37085
|
+
const PopupComponent = popup.visible ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
37086
|
+
PopupOverlay,
|
|
37087
|
+
{
|
|
37088
|
+
popup,
|
|
37089
|
+
onClose: close,
|
|
37090
|
+
onInputChange: (v) => setPopup((prev) => ({ ...prev, inputValue: v }))
|
|
37091
|
+
}
|
|
37092
|
+
) : null;
|
|
37093
|
+
return { alert: alert2, confirm, prompt, modal, PopupComponent, close };
|
|
37094
|
+
}
|
|
37095
|
+
|
|
37096
|
+
// src/modal/index.tsx
|
|
37097
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
37098
|
+
function Modal({
|
|
37099
|
+
button,
|
|
37100
|
+
children,
|
|
37101
|
+
color = "primary"
|
|
37102
|
+
}) {
|
|
37103
|
+
const pop = usePopup();
|
|
37104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
37105
|
+
(0, import_react10.cloneElement)(button, {
|
|
37106
|
+
onClick: async (e) => {
|
|
37107
|
+
await pop.modal(
|
|
37108
|
+
import_react10.default.cloneElement(children, { hide: () => pop.close(false) }),
|
|
37109
|
+
color,
|
|
37110
|
+
false,
|
|
37111
|
+
true
|
|
37112
|
+
);
|
|
36829
37113
|
}
|
|
36830
|
-
return child;
|
|
36831
37114
|
}),
|
|
36832
|
-
|
|
36833
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
36834
|
-
"button",
|
|
36835
|
-
{
|
|
36836
|
-
onClick: hide,
|
|
36837
|
-
className: "absolute top-0 right-0 text-red-500 ",
|
|
36838
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CloseIcon2, {})
|
|
36839
|
-
}
|
|
36840
|
-
),
|
|
36841
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "font-bold text-xl", children: title }),
|
|
36842
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-col gap-3 pt-6", children: import_react9.default.Children.map(children, (child) => {
|
|
36843
|
-
if (import_react9.default.isValidElement(child)) {
|
|
36844
|
-
const { type, props } = child;
|
|
36845
|
-
return import_react9.default.createElement(type, { ...props, hide });
|
|
36846
|
-
}
|
|
36847
|
-
return child;
|
|
36848
|
-
}) })
|
|
36849
|
-
] }) })
|
|
37115
|
+
pop.PopupComponent
|
|
36850
37116
|
] });
|
|
36851
37117
|
}
|
|
36852
37118
|
|
|
36853
37119
|
// src/pre/index.tsx
|
|
36854
|
-
var
|
|
37120
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
36855
37121
|
var Pre = ({ data }) => {
|
|
36856
37122
|
const formatted = JSON.stringify(data, null, 2);
|
|
36857
|
-
return /* @__PURE__ */ (0,
|
|
37123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
36858
37124
|
"pre",
|
|
36859
37125
|
{
|
|
36860
37126
|
style: {
|
|
@@ -36899,13 +37165,13 @@ function useDates() {
|
|
|
36899
37165
|
}
|
|
36900
37166
|
|
|
36901
37167
|
// src/calendar/index.tsx
|
|
36902
|
-
var
|
|
37168
|
+
var import_react11 = require("react");
|
|
36903
37169
|
var import_react_datepicker = __toESM(require("react-datepicker"));
|
|
36904
37170
|
|
|
36905
37171
|
// src/calendar/calendar.icon.tsx
|
|
36906
|
-
var
|
|
37172
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
36907
37173
|
function CalendarIcon() {
|
|
36908
|
-
return /* @__PURE__ */ (0,
|
|
37174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
36909
37175
|
"svg",
|
|
36910
37176
|
{
|
|
36911
37177
|
stroke: "currentColor",
|
|
@@ -36915,14 +37181,14 @@ function CalendarIcon() {
|
|
|
36915
37181
|
height: "20px",
|
|
36916
37182
|
width: "20px",
|
|
36917
37183
|
xmlns: "http://www.w3.org/2000/svg",
|
|
36918
|
-
children: /* @__PURE__ */ (0,
|
|
37184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.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" })
|
|
36919
37185
|
}
|
|
36920
37186
|
);
|
|
36921
37187
|
}
|
|
36922
37188
|
|
|
36923
37189
|
// src/calendar/index.tsx
|
|
36924
|
-
var
|
|
36925
|
-
var
|
|
37190
|
+
var import_material2 = require("@mui/material");
|
|
37191
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
36926
37192
|
function MyCalendar({
|
|
36927
37193
|
enabledDates,
|
|
36928
37194
|
onChange,
|
|
@@ -36932,11 +37198,11 @@ function MyCalendar({
|
|
|
36932
37198
|
value,
|
|
36933
37199
|
...otherProps
|
|
36934
37200
|
}) {
|
|
36935
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
36936
|
-
const [dateStr, setDateStr] = (0,
|
|
37201
|
+
const [selectedDate, setSelectedDate] = (0, import_react11.useState)(null);
|
|
37202
|
+
const [dateStr, setDateStr] = (0, import_react11.useState)(
|
|
36937
37203
|
defaultValue || value || ""
|
|
36938
37204
|
);
|
|
36939
|
-
const [open, setOpen] = (0,
|
|
37205
|
+
const [open, setOpen] = (0, import_react11.useState)(false);
|
|
36940
37206
|
function handleChange(date) {
|
|
36941
37207
|
if (!date) return;
|
|
36942
37208
|
setSelectedDate(date);
|
|
@@ -36953,20 +37219,20 @@ function MyCalendar({
|
|
|
36953
37219
|
if (!(enabledDates == null ? void 0 : enabledDates.length)) {
|
|
36954
37220
|
return null;
|
|
36955
37221
|
}
|
|
36956
|
-
return /* @__PURE__ */ (0,
|
|
36957
|
-
/* @__PURE__ */ (0,
|
|
36958
|
-
/* @__PURE__ */ (0,
|
|
37222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative", children: [
|
|
37223
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
37224
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "font-bold", children: [
|
|
36959
37225
|
label,
|
|
36960
37226
|
" ",
|
|
36961
|
-
(otherProps == null ? void 0 : otherProps.required) && /* @__PURE__ */ (0,
|
|
37227
|
+
(otherProps == null ? void 0 : otherProps.required) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-red-500", children: "*" })
|
|
36962
37228
|
] }),
|
|
36963
|
-
/* @__PURE__ */ (0,
|
|
37229
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
36964
37230
|
"div",
|
|
36965
37231
|
{
|
|
36966
37232
|
className: "cursor-pointer flex items-center justify-center",
|
|
36967
37233
|
onClick: (e) => setOpen(true),
|
|
36968
37234
|
children: [
|
|
36969
|
-
/* @__PURE__ */ (0,
|
|
37235
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
36970
37236
|
"input",
|
|
36971
37237
|
{
|
|
36972
37238
|
...otherProps,
|
|
@@ -36981,13 +37247,13 @@ function MyCalendar({
|
|
|
36981
37247
|
readOnly: true
|
|
36982
37248
|
}
|
|
36983
37249
|
),
|
|
36984
|
-
/* @__PURE__ */ (0,
|
|
37250
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "absolute", style: { right: "10px" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CalendarIcon, {}) })
|
|
36985
37251
|
]
|
|
36986
37252
|
}
|
|
36987
37253
|
) })
|
|
36988
37254
|
] }),
|
|
36989
|
-
/* @__PURE__ */ (0,
|
|
36990
|
-
/* @__PURE__ */ (0,
|
|
37255
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material2.Dialog, { open, children: [
|
|
37256
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex justify-end p-5 font-bold", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
36991
37257
|
"button",
|
|
36992
37258
|
{
|
|
36993
37259
|
className: " border-lg w-[20px] bg-red-500 text-white shadow rounded",
|
|
@@ -36995,7 +37261,7 @@ function MyCalendar({
|
|
|
36995
37261
|
children: "x"
|
|
36996
37262
|
}
|
|
36997
37263
|
) }),
|
|
36998
|
-
/* @__PURE__ */ (0,
|
|
37264
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: " w-[300px] flex items-start justify-center h-[300px] p-5", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
36999
37265
|
import_react_datepicker.default,
|
|
37000
37266
|
{
|
|
37001
37267
|
inline: true,
|
|
@@ -37009,9 +37275,9 @@ function MyCalendar({
|
|
|
37009
37275
|
}
|
|
37010
37276
|
|
|
37011
37277
|
// src/doc-viewer/icon.tsx
|
|
37012
|
-
var
|
|
37278
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
37013
37279
|
function Icon() {
|
|
37014
|
-
return /* @__PURE__ */ (0,
|
|
37280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
37015
37281
|
"svg",
|
|
37016
37282
|
{
|
|
37017
37283
|
stroke: "currentColor",
|
|
@@ -37021,13 +37287,13 @@ function Icon() {
|
|
|
37021
37287
|
height: "200px",
|
|
37022
37288
|
width: "200px",
|
|
37023
37289
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37024
|
-
children: /* @__PURE__ */ (0,
|
|
37290
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.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" })
|
|
37025
37291
|
}
|
|
37026
37292
|
);
|
|
37027
37293
|
}
|
|
37028
37294
|
|
|
37029
37295
|
// src/doc-viewer/index.tsx
|
|
37030
|
-
var
|
|
37296
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
37031
37297
|
function DocumentViewer({ item }) {
|
|
37032
37298
|
const { url, name, contentType, width = "100%", height = "100%" } = item;
|
|
37033
37299
|
const isImage = contentType.startsWith("image/");
|
|
@@ -37036,10 +37302,10 @@ function DocumentViewer({ item }) {
|
|
|
37036
37302
|
const viewerUrl = isGoogleDocCompatible ? `https://docs.google.com/gview?url=${encodeURIComponent(
|
|
37037
37303
|
url
|
|
37038
37304
|
)}&embedded=true` : url;
|
|
37039
|
-
return /* @__PURE__ */ (0,
|
|
37040
|
-
/* @__PURE__ */ (0,
|
|
37041
|
-
/* @__PURE__ */ (0,
|
|
37042
|
-
/* @__PURE__ */ (0,
|
|
37305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "border shadow rounded p-2 h-[100%]", children: [
|
|
37306
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "mb-1 flex justify-between ", children: [
|
|
37307
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "font-bold", children: name }),
|
|
37308
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
37043
37309
|
"a",
|
|
37044
37310
|
{
|
|
37045
37311
|
href: url,
|
|
@@ -37051,7 +37317,7 @@ function DocumentViewer({ item }) {
|
|
|
37051
37317
|
}
|
|
37052
37318
|
)
|
|
37053
37319
|
] }),
|
|
37054
|
-
isImage ? /* @__PURE__ */ (0,
|
|
37320
|
+
isImage ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
37055
37321
|
"img",
|
|
37056
37322
|
{
|
|
37057
37323
|
src: url,
|
|
@@ -37064,7 +37330,7 @@ function DocumentViewer({ item }) {
|
|
|
37064
37330
|
display: "block"
|
|
37065
37331
|
}
|
|
37066
37332
|
}
|
|
37067
|
-
) : isGoogleDocCompatible ? /* @__PURE__ */ (0,
|
|
37333
|
+
) : isGoogleDocCompatible ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
37068
37334
|
"iframe",
|
|
37069
37335
|
{
|
|
37070
37336
|
title: name,
|
|
@@ -37072,7 +37338,7 @@ function DocumentViewer({ item }) {
|
|
|
37072
37338
|
style: { width, height, border: "none" },
|
|
37073
37339
|
allowFullScreen: true
|
|
37074
37340
|
}
|
|
37075
|
-
) : /* @__PURE__ */ (0,
|
|
37341
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
37076
37342
|
"div",
|
|
37077
37343
|
{
|
|
37078
37344
|
style: {
|
|
@@ -37082,22 +37348,22 @@ function DocumentViewer({ item }) {
|
|
|
37082
37348
|
objectFit: "cover",
|
|
37083
37349
|
display: "block"
|
|
37084
37350
|
},
|
|
37085
|
-
children: /* @__PURE__ */ (0,
|
|
37351
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, {})
|
|
37086
37352
|
}
|
|
37087
37353
|
)
|
|
37088
37354
|
] });
|
|
37089
37355
|
}
|
|
37090
37356
|
|
|
37091
37357
|
// src/table3/index.tsx
|
|
37092
|
-
var
|
|
37358
|
+
var import_react16 = __toESM(require("react"));
|
|
37093
37359
|
|
|
37094
37360
|
// src/table3/filter.tsx
|
|
37095
|
-
var
|
|
37361
|
+
var import_react12 = require("react");
|
|
37096
37362
|
|
|
37097
37363
|
// src/table3/filters.tsx
|
|
37098
|
-
var
|
|
37364
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
37099
37365
|
function FilterOffIcon() {
|
|
37100
|
-
return /* @__PURE__ */ (0,
|
|
37366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
37101
37367
|
"svg",
|
|
37102
37368
|
{
|
|
37103
37369
|
stroke: "currentColor",
|
|
@@ -37107,12 +37373,12 @@ function FilterOffIcon() {
|
|
|
37107
37373
|
height: "20px",
|
|
37108
37374
|
width: "20px",
|
|
37109
37375
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37110
|
-
children: /* @__PURE__ */ (0,
|
|
37376
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.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" })
|
|
37111
37377
|
}
|
|
37112
37378
|
);
|
|
37113
37379
|
}
|
|
37114
37380
|
function OrderDesc() {
|
|
37115
|
-
return /* @__PURE__ */ (0,
|
|
37381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
37116
37382
|
"svg",
|
|
37117
37383
|
{
|
|
37118
37384
|
stroke: "currentColor",
|
|
@@ -37122,12 +37388,12 @@ function OrderDesc() {
|
|
|
37122
37388
|
height: "20px",
|
|
37123
37389
|
width: "20px",
|
|
37124
37390
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37125
|
-
children: /* @__PURE__ */ (0,
|
|
37391
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.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" })
|
|
37126
37392
|
}
|
|
37127
37393
|
);
|
|
37128
37394
|
}
|
|
37129
37395
|
function OrderAsc() {
|
|
37130
|
-
return /* @__PURE__ */ (0,
|
|
37396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
37131
37397
|
"svg",
|
|
37132
37398
|
{
|
|
37133
37399
|
stroke: "currentColor",
|
|
@@ -37137,12 +37403,12 @@ function OrderAsc() {
|
|
|
37137
37403
|
height: "20px",
|
|
37138
37404
|
width: "20px",
|
|
37139
37405
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37140
|
-
children: /* @__PURE__ */ (0,
|
|
37406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.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" })
|
|
37141
37407
|
}
|
|
37142
37408
|
);
|
|
37143
37409
|
}
|
|
37144
37410
|
function EditIcon2() {
|
|
37145
|
-
return /* @__PURE__ */ (0,
|
|
37411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
37146
37412
|
"svg",
|
|
37147
37413
|
{
|
|
37148
37414
|
stroke: "currentColor",
|
|
@@ -37152,12 +37418,12 @@ function EditIcon2() {
|
|
|
37152
37418
|
height: "20px",
|
|
37153
37419
|
width: "20px",
|
|
37154
37420
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37155
|
-
children: /* @__PURE__ */ (0,
|
|
37421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.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" })
|
|
37156
37422
|
}
|
|
37157
37423
|
);
|
|
37158
37424
|
}
|
|
37159
37425
|
function SaveIcon() {
|
|
37160
|
-
return /* @__PURE__ */ (0,
|
|
37426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
37161
37427
|
"svg",
|
|
37162
37428
|
{
|
|
37163
37429
|
stroke: "currentColor",
|
|
@@ -37168,14 +37434,14 @@ function SaveIcon() {
|
|
|
37168
37434
|
width: "20px",
|
|
37169
37435
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37170
37436
|
children: [
|
|
37171
|
-
/* @__PURE__ */ (0,
|
|
37172
|
-
/* @__PURE__ */ (0,
|
|
37437
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.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" }),
|
|
37438
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.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" })
|
|
37173
37439
|
]
|
|
37174
37440
|
}
|
|
37175
37441
|
);
|
|
37176
37442
|
}
|
|
37177
37443
|
function ExcelIcon() {
|
|
37178
|
-
return /* @__PURE__ */ (0,
|
|
37444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
37179
37445
|
"svg",
|
|
37180
37446
|
{
|
|
37181
37447
|
stroke: "currentColor",
|
|
@@ -37185,13 +37451,13 @@ function ExcelIcon() {
|
|
|
37185
37451
|
height: "20px",
|
|
37186
37452
|
width: "20px",
|
|
37187
37453
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37188
|
-
children: /* @__PURE__ */ (0,
|
|
37454
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.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" })
|
|
37189
37455
|
}
|
|
37190
37456
|
);
|
|
37191
37457
|
}
|
|
37192
37458
|
|
|
37193
37459
|
// src/table3/filter.tsx
|
|
37194
|
-
var
|
|
37460
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
37195
37461
|
function Filter({
|
|
37196
37462
|
h,
|
|
37197
37463
|
objectData,
|
|
@@ -37202,14 +37468,14 @@ function Filter({
|
|
|
37202
37468
|
sort,
|
|
37203
37469
|
setSort
|
|
37204
37470
|
}) {
|
|
37205
|
-
const [visible, setVisible] = (0,
|
|
37206
|
-
const [text, setText] = (0,
|
|
37207
|
-
const items = (0,
|
|
37471
|
+
const [visible, setVisible] = (0, import_react12.useState)(false);
|
|
37472
|
+
const [text, setText] = (0, import_react12.useState)("");
|
|
37473
|
+
const items = (0, import_react12.useMemo)(
|
|
37208
37474
|
() => [...new Set(Object.values(objectData).map((o) => o[h]))],
|
|
37209
37475
|
[objectData]
|
|
37210
37476
|
);
|
|
37211
|
-
const [selected, setSelected] = (0,
|
|
37212
|
-
const itemsFiltered = (0,
|
|
37477
|
+
const [selected, setSelected] = (0, import_react12.useState)(items);
|
|
37478
|
+
const itemsFiltered = (0, import_react12.useMemo)(
|
|
37213
37479
|
() => items.sort((a, b) => `${a}`.localeCompare(b)).filter((item) => {
|
|
37214
37480
|
if (!text) return true;
|
|
37215
37481
|
return `${item}`.toLowerCase().includes(text.toLowerCase());
|
|
@@ -37246,14 +37512,14 @@ function Filter({
|
|
|
37246
37512
|
const hidden = Object.values(objectData).filter(
|
|
37247
37513
|
(d) => d._visible === false
|
|
37248
37514
|
);
|
|
37249
|
-
(0,
|
|
37515
|
+
(0, import_react12.useEffect)(() => {
|
|
37250
37516
|
if (data.length != Object.values(objectData).map((o) => (o == null ? void 0 : o._id) || (o == null ? void 0 : o.id)).length) {
|
|
37251
37517
|
const news = [...new Set(data.map((o) => o[h]))];
|
|
37252
37518
|
setSelected(news);
|
|
37253
37519
|
}
|
|
37254
37520
|
}, [data]);
|
|
37255
|
-
return /* @__PURE__ */ (0,
|
|
37256
|
-
/* @__PURE__ */ (0,
|
|
37521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("th", { className: "cursor-pointer", children: [
|
|
37522
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "relative", children: visible && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
37257
37523
|
"div",
|
|
37258
37524
|
{
|
|
37259
37525
|
className: " w-full h-screen top-0 left-0 fixed ",
|
|
@@ -37261,8 +37527,8 @@ function Filter({
|
|
|
37261
37527
|
onClick: (e) => setVisible(!visible)
|
|
37262
37528
|
}
|
|
37263
37529
|
) }),
|
|
37264
|
-
/* @__PURE__ */ (0,
|
|
37265
|
-
/* @__PURE__ */ (0,
|
|
37530
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative w-full justify-center flex", children: [
|
|
37531
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
37266
37532
|
"div",
|
|
37267
37533
|
{
|
|
37268
37534
|
style: (colSizes == null ? void 0 : colSizes[h]) ? {
|
|
@@ -37274,19 +37540,19 @@ function Filter({
|
|
|
37274
37540
|
onClick: (e) => setVisible(!visible),
|
|
37275
37541
|
children: [
|
|
37276
37542
|
sort && //
|
|
37277
|
-
Object.keys(sort)[0] == h && ((sort == null ? void 0 : sort[h]) == "asc" ? /* @__PURE__ */ (0,
|
|
37278
|
-
/* @__PURE__ */ (0,
|
|
37279
|
-
selected.length < items.length && /* @__PURE__ */ (0,
|
|
37543
|
+
Object.keys(sort)[0] == h && ((sort == null ? void 0 : sort[h]) == "asc" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-green-300", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(OrderAsc, {}) }) : (sort == null ? void 0 : sort[h]) == "desc" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-green-300", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(OrderDesc, {}) })),
|
|
37544
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: h }),
|
|
37545
|
+
selected.length < items.length && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-red-500 ", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FilterOffIcon, {}) })
|
|
37280
37546
|
]
|
|
37281
37547
|
}
|
|
37282
37548
|
),
|
|
37283
|
-
visible && /* @__PURE__ */ (0,
|
|
37549
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
37284
37550
|
"div",
|
|
37285
37551
|
{
|
|
37286
37552
|
className: "border shadow rounded bg-white p-1 absolute left-0 text-black",
|
|
37287
37553
|
style: { zIndex: 9999 },
|
|
37288
|
-
children: /* @__PURE__ */ (0,
|
|
37289
|
-
/* @__PURE__ */ (0,
|
|
37554
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1 w-[300px] min-w-[300px] resize-x overflow-auto", children: [
|
|
37555
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
37290
37556
|
"div",
|
|
37291
37557
|
{
|
|
37292
37558
|
onClick: (e) => {
|
|
@@ -37303,12 +37569,12 @@ function Filter({
|
|
|
37303
37569
|
},
|
|
37304
37570
|
className: "flex items-center gap-2 border p-1 hover:bg-blue-100",
|
|
37305
37571
|
children: [
|
|
37306
|
-
/* @__PURE__ */ (0,
|
|
37572
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(OrderAsc, {}),
|
|
37307
37573
|
" Ordenar de la A a la Z"
|
|
37308
37574
|
]
|
|
37309
37575
|
}
|
|
37310
37576
|
),
|
|
37311
|
-
/* @__PURE__ */ (0,
|
|
37577
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
37312
37578
|
"div",
|
|
37313
37579
|
{
|
|
37314
37580
|
onClick: (e) => {
|
|
@@ -37325,12 +37591,12 @@ function Filter({
|
|
|
37325
37591
|
},
|
|
37326
37592
|
className: "flex items-center gap-2 border p-1 hover:bg-blue-100",
|
|
37327
37593
|
children: [
|
|
37328
|
-
/* @__PURE__ */ (0,
|
|
37594
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(OrderDesc, {}),
|
|
37329
37595
|
"Ordenar de la Z a la A"
|
|
37330
37596
|
]
|
|
37331
37597
|
}
|
|
37332
37598
|
),
|
|
37333
|
-
selected.length < items.length && /* @__PURE__ */ (0,
|
|
37599
|
+
selected.length < items.length && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
37334
37600
|
"div",
|
|
37335
37601
|
{
|
|
37336
37602
|
className: "p-1 flex items-center justify-between px-2 bg-red-200 border shadow rounded",
|
|
@@ -37339,11 +37605,11 @@ function Filter({
|
|
|
37339
37605
|
},
|
|
37340
37606
|
children: [
|
|
37341
37607
|
"Borrar Filtro",
|
|
37342
|
-
/* @__PURE__ */ (0,
|
|
37608
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-white ", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FilterOffIcon, {}) })
|
|
37343
37609
|
]
|
|
37344
37610
|
}
|
|
37345
37611
|
),
|
|
37346
|
-
/* @__PURE__ */ (0,
|
|
37612
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
37347
37613
|
"input",
|
|
37348
37614
|
{
|
|
37349
37615
|
className: "border shadow rounded p-2 w-full",
|
|
@@ -37362,8 +37628,8 @@ function Filter({
|
|
|
37362
37628
|
}
|
|
37363
37629
|
}
|
|
37364
37630
|
) }),
|
|
37365
|
-
/* @__PURE__ */ (0,
|
|
37366
|
-
/* @__PURE__ */ (0,
|
|
37631
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "flex gap-1 cursor-pointer px-1", children: [
|
|
37632
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
37367
37633
|
"input",
|
|
37368
37634
|
{
|
|
37369
37635
|
type: "checkbox",
|
|
@@ -37379,9 +37645,9 @@ function Filter({
|
|
|
37379
37645
|
),
|
|
37380
37646
|
"(Seleccionar Todo)"
|
|
37381
37647
|
] }) }),
|
|
37382
|
-
/* @__PURE__ */ (0,
|
|
37383
|
-
return /* @__PURE__ */ (0,
|
|
37384
|
-
/* @__PURE__ */ (0,
|
|
37648
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "overflow-auto flex gap-1 flex-col p-1 border shadow rounded h-[300px]", children: itemsFiltered.map((item) => {
|
|
37649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "hover:bg-gray-100 ", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "flex gap-1 cursor-pointer truncate", children: [
|
|
37650
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
37385
37651
|
"input",
|
|
37386
37652
|
{
|
|
37387
37653
|
type: "checkbox",
|
|
@@ -37402,8 +37668,8 @@ function Filter({
|
|
|
37402
37668
|
item || "(Vacias)"
|
|
37403
37669
|
] }) }, item);
|
|
37404
37670
|
}) }),
|
|
37405
|
-
/* @__PURE__ */ (0,
|
|
37406
|
-
/* @__PURE__ */ (0,
|
|
37671
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between px-1", children: [
|
|
37672
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
37407
37673
|
"button",
|
|
37408
37674
|
{
|
|
37409
37675
|
className: "p-1 shadow rounded border bg-red-500 text-white",
|
|
@@ -37414,7 +37680,7 @@ function Filter({
|
|
|
37414
37680
|
children: "Cancelar"
|
|
37415
37681
|
}
|
|
37416
37682
|
),
|
|
37417
|
-
/* @__PURE__ */ (0,
|
|
37683
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
37418
37684
|
"button",
|
|
37419
37685
|
{
|
|
37420
37686
|
className: "p-1 shadow rounded border bg-blue-500 text-white",
|
|
@@ -37433,7 +37699,7 @@ function Filter({
|
|
|
37433
37699
|
}
|
|
37434
37700
|
|
|
37435
37701
|
// src/table3/head.tsx
|
|
37436
|
-
var
|
|
37702
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
37437
37703
|
function TableHead({
|
|
37438
37704
|
headers,
|
|
37439
37705
|
selectItems,
|
|
@@ -37448,9 +37714,9 @@ function TableHead({
|
|
|
37448
37714
|
sort,
|
|
37449
37715
|
setSort
|
|
37450
37716
|
}) {
|
|
37451
|
-
return /* @__PURE__ */ (0,
|
|
37452
|
-
modal && /* @__PURE__ */ (0,
|
|
37453
|
-
selectItems && /* @__PURE__ */ (0,
|
|
37717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("tr", { className: "bg-blue-500 text-white font-bold", children: [
|
|
37718
|
+
modal && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("th", { children: "-" }),
|
|
37719
|
+
selectItems && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("th", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
37454
37720
|
"input",
|
|
37455
37721
|
{
|
|
37456
37722
|
className: "m-2",
|
|
@@ -37478,7 +37744,7 @@ function TableHead({
|
|
|
37478
37744
|
) }),
|
|
37479
37745
|
Object.values(headers).map((h) => {
|
|
37480
37746
|
if (h.startsWith("_")) return null;
|
|
37481
|
-
return /* @__PURE__ */ (0,
|
|
37747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
37482
37748
|
Filter,
|
|
37483
37749
|
{
|
|
37484
37750
|
objectData,
|
|
@@ -37497,11 +37763,11 @@ function TableHead({
|
|
|
37497
37763
|
}
|
|
37498
37764
|
|
|
37499
37765
|
// src/table3/body.tsx
|
|
37500
|
-
var
|
|
37766
|
+
var import_react14 = require("react");
|
|
37501
37767
|
|
|
37502
37768
|
// src/table3/tr.tsx
|
|
37503
|
-
var
|
|
37504
|
-
var
|
|
37769
|
+
var import_react13 = __toESM(require("react"));
|
|
37770
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
37505
37771
|
function TR({
|
|
37506
37772
|
handlers,
|
|
37507
37773
|
setObjectData,
|
|
@@ -37521,7 +37787,7 @@ function TR({
|
|
|
37521
37787
|
symbols
|
|
37522
37788
|
}) {
|
|
37523
37789
|
const color = selected == index ? "bg-blue-600 text-white hover:bg-blue-800" : index % 2 == 0 ? "bg-white" : "bg-blue-50";
|
|
37524
|
-
return /* @__PURE__ */ (0,
|
|
37790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
37525
37791
|
"tr",
|
|
37526
37792
|
{
|
|
37527
37793
|
className: ` hover:bg-blue-100 ${color} cursor-pointer`,
|
|
@@ -37529,7 +37795,7 @@ function TR({
|
|
|
37529
37795
|
setSelected(selected == index ? -1 : index);
|
|
37530
37796
|
},
|
|
37531
37797
|
children: [
|
|
37532
|
-
modal && /* @__PURE__ */ (0,
|
|
37798
|
+
modal && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("th", { className: "border", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
37533
37799
|
"button",
|
|
37534
37800
|
{
|
|
37535
37801
|
className: "p-1 border shadow-rounded bg-blue-500 rounded text-white",
|
|
@@ -37538,10 +37804,10 @@ function TR({
|
|
|
37538
37804
|
(_a = modalRef.current) == null ? void 0 : _a.showModal();
|
|
37539
37805
|
setDialogRow(row);
|
|
37540
37806
|
},
|
|
37541
|
-
children: /* @__PURE__ */ (0,
|
|
37807
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(EditIcon2, {})
|
|
37542
37808
|
}
|
|
37543
37809
|
) }),
|
|
37544
|
-
selectItems && /* @__PURE__ */ (0,
|
|
37810
|
+
selectItems && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("th", { className: "border", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
37545
37811
|
"input",
|
|
37546
37812
|
{
|
|
37547
37813
|
type: "checkbox",
|
|
@@ -37562,7 +37828,7 @@ function TR({
|
|
|
37562
37828
|
return null;
|
|
37563
37829
|
} else if (handlers == null ? void 0 : handlers[h]) {
|
|
37564
37830
|
const original = handlers[h];
|
|
37565
|
-
const cloned =
|
|
37831
|
+
const cloned = import_react13.default.cloneElement(original, {
|
|
37566
37832
|
// si es controlado por value → actualiza con row[h]
|
|
37567
37833
|
value: ((_a = original.props) == null ? void 0 : _a.value) !== void 0 ? row[h] : void 0,
|
|
37568
37834
|
// si usa children → actualiza con row[h] también
|
|
@@ -37609,13 +37875,13 @@ function TR({
|
|
|
37609
37875
|
return acc;
|
|
37610
37876
|
}, {})
|
|
37611
37877
|
});
|
|
37612
|
-
return /* @__PURE__ */ (0,
|
|
37878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("td", { className: `text-black `, children: cloned }, h);
|
|
37613
37879
|
}
|
|
37614
|
-
return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */ (0,
|
|
37880
|
+
return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("td", { className: `text-center border max-w-[${colSize}px] `, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-1 w-full", children: [
|
|
37615
37881
|
symbols[h],
|
|
37616
37882
|
" ",
|
|
37617
37883
|
row[h]
|
|
37618
|
-
] }) }, h) : /* @__PURE__ */ (0,
|
|
37884
|
+
] }) }, h) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("td", { className: `text-center border max-w-[${colSize}px]`, children: row[h] }, h);
|
|
37619
37885
|
})
|
|
37620
37886
|
]
|
|
37621
37887
|
},
|
|
@@ -37624,7 +37890,7 @@ function TR({
|
|
|
37624
37890
|
}
|
|
37625
37891
|
|
|
37626
37892
|
// src/table3/body.tsx
|
|
37627
|
-
var
|
|
37893
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
37628
37894
|
function TableBody({
|
|
37629
37895
|
objectData,
|
|
37630
37896
|
setObjectData,
|
|
@@ -37642,7 +37908,7 @@ function TableBody({
|
|
|
37642
37908
|
symbols,
|
|
37643
37909
|
sort
|
|
37644
37910
|
}) {
|
|
37645
|
-
const [selected, setSelected] = (0,
|
|
37911
|
+
const [selected, setSelected] = (0, import_react14.useState)(-1);
|
|
37646
37912
|
const sorted = Object.entries(objectData).sort(([, a], [, b]) => {
|
|
37647
37913
|
for (const [key, order] of Object.entries(
|
|
37648
37914
|
sort || { id: "desc", _id: "desc" }
|
|
@@ -37668,7 +37934,7 @@ function TableBody({
|
|
|
37668
37934
|
return key >= start && key < end;
|
|
37669
37935
|
}).map(([id, k], index) => {
|
|
37670
37936
|
const row = objectData[id];
|
|
37671
|
-
return /* @__PURE__ */ (0,
|
|
37937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
37672
37938
|
TR,
|
|
37673
37939
|
{
|
|
37674
37940
|
...{
|
|
@@ -37693,11 +37959,11 @@ function TableBody({
|
|
|
37693
37959
|
id
|
|
37694
37960
|
);
|
|
37695
37961
|
});
|
|
37696
|
-
return /* @__PURE__ */ (0,
|
|
37962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("tbody", { children: sorted });
|
|
37697
37963
|
}
|
|
37698
37964
|
|
|
37699
37965
|
// src/table3/panel.tsx
|
|
37700
|
-
var
|
|
37966
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
37701
37967
|
function Panel({
|
|
37702
37968
|
page,
|
|
37703
37969
|
setPage,
|
|
@@ -37708,9 +37974,9 @@ function Panel({
|
|
|
37708
37974
|
maxItems
|
|
37709
37975
|
}) {
|
|
37710
37976
|
const excel = useExcel();
|
|
37711
|
-
return /* @__PURE__ */ (0,
|
|
37712
|
-
/* @__PURE__ */ (0,
|
|
37713
|
-
onSave && /* @__PURE__ */ (0,
|
|
37977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex gap-2 bg-gray-100 items-center", children: [
|
|
37978
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex gap-1 ", children: [
|
|
37979
|
+
onSave && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
37714
37980
|
"button",
|
|
37715
37981
|
{
|
|
37716
37982
|
className: "p-2 border shadow rounded bg-blue-500 text-white flex items-center gap-1 text-md",
|
|
@@ -37719,12 +37985,12 @@ function Panel({
|
|
|
37719
37985
|
},
|
|
37720
37986
|
children: [
|
|
37721
37987
|
" ",
|
|
37722
|
-
/* @__PURE__ */ (0,
|
|
37988
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SaveIcon, {}),
|
|
37723
37989
|
"Guardar"
|
|
37724
37990
|
]
|
|
37725
37991
|
}
|
|
37726
37992
|
),
|
|
37727
|
-
exportName && /* @__PURE__ */ (0,
|
|
37993
|
+
exportName && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
37728
37994
|
"button",
|
|
37729
37995
|
{
|
|
37730
37996
|
className: "p-2 border shadow rounded bg-green-800 text-white flex items-center gap-1 text-md",
|
|
@@ -37738,22 +38004,22 @@ function Panel({
|
|
|
37738
38004
|
);
|
|
37739
38005
|
},
|
|
37740
38006
|
children: [
|
|
37741
|
-
/* @__PURE__ */ (0,
|
|
38007
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ExcelIcon, {}),
|
|
37742
38008
|
"Exportar"
|
|
37743
38009
|
]
|
|
37744
38010
|
}
|
|
37745
38011
|
)
|
|
37746
38012
|
] }),
|
|
37747
|
-
maxItems !== Infinity && /* @__PURE__ */ (0,
|
|
37748
|
-
/* @__PURE__ */ (0,
|
|
37749
|
-
/* @__PURE__ */ (0,
|
|
37750
|
-
/* @__PURE__ */ (0,
|
|
38013
|
+
maxItems !== Infinity && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex gap-2 items-center text-2xl", children: [
|
|
38014
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { onClick: () => setPage(1), disabled: page === 1, children: "\u23EE" }),
|
|
38015
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { onClick: () => setPage(page - 1), disabled: page === 1, children: "\u25C0" }),
|
|
38016
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "text-sm", children: [
|
|
37751
38017
|
"P\xE1gina ",
|
|
37752
38018
|
page,
|
|
37753
38019
|
" / ",
|
|
37754
38020
|
totalPages
|
|
37755
38021
|
] }),
|
|
37756
|
-
/* @__PURE__ */ (0,
|
|
38022
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
37757
38023
|
"button",
|
|
37758
38024
|
{
|
|
37759
38025
|
onClick: () => setPage(page + 1),
|
|
@@ -37761,7 +38027,7 @@ function Panel({
|
|
|
37761
38027
|
children: "\u25B6"
|
|
37762
38028
|
}
|
|
37763
38029
|
),
|
|
37764
|
-
/* @__PURE__ */ (0,
|
|
38030
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
37765
38031
|
"button",
|
|
37766
38032
|
{
|
|
37767
38033
|
onClick: () => setPage(totalPages),
|
|
@@ -37774,7 +38040,7 @@ function Panel({
|
|
|
37774
38040
|
}
|
|
37775
38041
|
|
|
37776
38042
|
// src/table3/footer.tsx
|
|
37777
|
-
var
|
|
38043
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
37778
38044
|
function TableFooter({
|
|
37779
38045
|
objectData,
|
|
37780
38046
|
headers,
|
|
@@ -37799,28 +38065,28 @@ function TableFooter({
|
|
|
37799
38065
|
return null;
|
|
37800
38066
|
}
|
|
37801
38067
|
}
|
|
37802
|
-
return footer && /* @__PURE__ */ (0,
|
|
37803
|
-
selectItems && /* @__PURE__ */ (0,
|
|
37804
|
-
modal && /* @__PURE__ */ (0,
|
|
38068
|
+
return footer && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("tfoot", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("tr", { className: "bg-blue-500 text-white", children: [
|
|
38069
|
+
selectItems && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("th", {}),
|
|
38070
|
+
modal && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("th", {}),
|
|
37805
38071
|
headers.map((header) => {
|
|
37806
38072
|
if (header.startsWith("_")) {
|
|
37807
38073
|
return null;
|
|
37808
38074
|
} else if (footer == null ? void 0 : footer[header]) {
|
|
37809
|
-
return symbols && (symbols == null ? void 0 : symbols[header]) ? /* @__PURE__ */ (0,
|
|
38075
|
+
return symbols && (symbols == null ? void 0 : symbols[header]) ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("th", { className: "flex items-center gap-1", children: [
|
|
37810
38076
|
symbols[header],
|
|
37811
38077
|
" ",
|
|
37812
38078
|
operacion(footer[header], header)
|
|
37813
|
-
] }, header) : /* @__PURE__ */ (0,
|
|
38079
|
+
] }, header) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("th", { children: operacion(footer[header], header) }, header);
|
|
37814
38080
|
}
|
|
37815
|
-
return /* @__PURE__ */ (0,
|
|
38081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("th", {}, header);
|
|
37816
38082
|
})
|
|
37817
38083
|
] }) });
|
|
37818
38084
|
}
|
|
37819
38085
|
|
|
37820
38086
|
// src/table3/dialog.tsx
|
|
37821
|
-
var
|
|
37822
|
-
var
|
|
37823
|
-
function
|
|
38087
|
+
var import_react15 = __toESM(require("react"));
|
|
38088
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
38089
|
+
function Dialog3({
|
|
37824
38090
|
modalRef,
|
|
37825
38091
|
children,
|
|
37826
38092
|
dialogRow,
|
|
@@ -37835,9 +38101,9 @@ function Dialog4({
|
|
|
37835
38101
|
var _a;
|
|
37836
38102
|
return (_a = modalRef.current) == null ? void 0 : _a.close();
|
|
37837
38103
|
};
|
|
37838
|
-
const clonedModal = (0,
|
|
37839
|
-
if (dialogRow &&
|
|
37840
|
-
return
|
|
38104
|
+
const clonedModal = (0, import_react15.useMemo)(() => {
|
|
38105
|
+
if (dialogRow && import_react15.default.isValidElement(children)) {
|
|
38106
|
+
return import_react15.default.cloneElement(children, {
|
|
37841
38107
|
key: JSON.stringify(dialogRow),
|
|
37842
38108
|
row: dialogRow,
|
|
37843
38109
|
show,
|
|
@@ -37847,15 +38113,15 @@ function Dialog4({
|
|
|
37847
38113
|
}
|
|
37848
38114
|
return null;
|
|
37849
38115
|
}, [dialogRow, children]);
|
|
37850
|
-
return /* @__PURE__ */ (0,
|
|
38116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
37851
38117
|
"dialog",
|
|
37852
38118
|
{
|
|
37853
38119
|
ref: modalRef,
|
|
37854
38120
|
className: "p-6 rounded-xl shadow-2xl backdrop:bg-black/50 w-[100%] h-screen",
|
|
37855
38121
|
children: [
|
|
37856
|
-
/* @__PURE__ */ (0,
|
|
37857
|
-
/* @__PURE__ */ (0,
|
|
37858
|
-
/* @__PURE__ */ (0,
|
|
38122
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [
|
|
38123
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", {}),
|
|
38124
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
37859
38125
|
"button",
|
|
37860
38126
|
{
|
|
37861
38127
|
onClick: () => {
|
|
@@ -37867,15 +38133,15 @@ function Dialog4({
|
|
|
37867
38133
|
}
|
|
37868
38134
|
)
|
|
37869
38135
|
] }),
|
|
37870
|
-
/* @__PURE__ */ (0,
|
|
38136
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "text-gray-700", children: clonedModal })
|
|
37871
38137
|
]
|
|
37872
38138
|
}
|
|
37873
38139
|
);
|
|
37874
38140
|
}
|
|
37875
|
-
var dialog_default =
|
|
38141
|
+
var dialog_default = Dialog3;
|
|
37876
38142
|
|
|
37877
38143
|
// src/table3/index.tsx
|
|
37878
|
-
var
|
|
38144
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
37879
38145
|
function Table3({
|
|
37880
38146
|
data,
|
|
37881
38147
|
selectItems,
|
|
@@ -37891,8 +38157,8 @@ function Table3({
|
|
|
37891
38157
|
sortBy,
|
|
37892
38158
|
...props
|
|
37893
38159
|
}) {
|
|
37894
|
-
const [handlers, setHandlers] = (0,
|
|
37895
|
-
const [page, setPage] = (0,
|
|
38160
|
+
const [handlers, setHandlers] = (0, import_react16.useState)({});
|
|
38161
|
+
const [page, setPage] = (0, import_react16.useState)(1);
|
|
37896
38162
|
function dataReducer(a, b) {
|
|
37897
38163
|
if (b == null) return {};
|
|
37898
38164
|
if (Array.isArray(b)) {
|
|
@@ -37913,7 +38179,7 @@ function Table3({
|
|
|
37913
38179
|
};
|
|
37914
38180
|
const newHandlers = { ...handlers };
|
|
37915
38181
|
for (let item in cc) {
|
|
37916
|
-
const isReactComponent =
|
|
38182
|
+
const isReactComponent = import_react16.default.isValidElement(cc[item]);
|
|
37917
38183
|
if (isReactComponent) {
|
|
37918
38184
|
newHandlers[item] = cc[item];
|
|
37919
38185
|
const value = ((_c = (_b = cc[item]) == null ? void 0 : _b.props) == null ? void 0 : _c.value) || (typeof ((_e = (_d = cc[item]) == null ? void 0 : _d.props) == null ? void 0 : _e.children) !== "object" ? (_g = (_f = cc[item]) == null ? void 0 : _f.props) == null ? void 0 : _g.children : "");
|
|
@@ -37933,12 +38199,12 @@ function Table3({
|
|
|
37933
38199
|
return newA;
|
|
37934
38200
|
}
|
|
37935
38201
|
}
|
|
37936
|
-
const [objectData, setObjectData] = (0,
|
|
37937
|
-
(0,
|
|
38202
|
+
const [objectData, setObjectData] = (0, import_react16.useReducer)(dataReducer, null);
|
|
38203
|
+
(0, import_react16.useEffect)(() => {
|
|
37938
38204
|
setObjectData(data);
|
|
37939
38205
|
setPage(1);
|
|
37940
38206
|
}, [data]);
|
|
37941
|
-
const headers = (0,
|
|
38207
|
+
const headers = (0, import_react16.useMemo)(() => {
|
|
37942
38208
|
if (!objectData) return [];
|
|
37943
38209
|
return [
|
|
37944
38210
|
...new Set(
|
|
@@ -37946,13 +38212,13 @@ function Table3({
|
|
|
37946
38212
|
)
|
|
37947
38213
|
];
|
|
37948
38214
|
}, [objectData]);
|
|
37949
|
-
const totalPages = (0,
|
|
38215
|
+
const totalPages = (0, import_react16.useMemo)(() => {
|
|
37950
38216
|
if (!objectData) return 0;
|
|
37951
38217
|
return maxItems ? Math.ceil(Object.keys(objectData).length / maxItems) : 1;
|
|
37952
38218
|
}, [objectData, maxItems]);
|
|
37953
|
-
const [sort, setSort] = (0,
|
|
37954
|
-
const modalRef = (0,
|
|
37955
|
-
const [dialogRow, setDialogRow] = (0,
|
|
38219
|
+
const [sort, setSort] = (0, import_react16.useState)(sortBy);
|
|
38220
|
+
const modalRef = (0, import_react16.useRef)(null);
|
|
38221
|
+
const [dialogRow, setDialogRow] = (0, import_react16.useState)({});
|
|
37956
38222
|
const context = {
|
|
37957
38223
|
objectData,
|
|
37958
38224
|
headers,
|
|
@@ -37979,7 +38245,7 @@ function Table3({
|
|
|
37979
38245
|
setSort,
|
|
37980
38246
|
...props
|
|
37981
38247
|
};
|
|
37982
|
-
(0,
|
|
38248
|
+
(0, import_react16.useEffect)(() => {
|
|
37983
38249
|
if ((dialogRow == null ? void 0 : dialogRow.id) || (dialogRow == null ? void 0 : dialogRow._id)) {
|
|
37984
38250
|
const newDialogRow = objectData[dialogRow == null ? void 0 : dialogRow.id] || objectData[dialogRow == null ? void 0 : dialogRow._id];
|
|
37985
38251
|
setDialogRow(newDialogRow);
|
|
@@ -37987,8 +38253,8 @@ function Table3({
|
|
|
37987
38253
|
}, [objectData]);
|
|
37988
38254
|
const style = (props == null ? void 0 : props.style) ? { ...props.style, tableLayout: "fixed" } : { tableLayout: "fixed" };
|
|
37989
38255
|
if (!objectData) return null;
|
|
37990
|
-
return /* @__PURE__ */ (0,
|
|
37991
|
-
modal && /* @__PURE__ */ (0,
|
|
38256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "border shadow rounded m-1 p-1 bg-white", children: [
|
|
38257
|
+
modal && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
37992
38258
|
dialog_default,
|
|
37993
38259
|
{
|
|
37994
38260
|
modalRef,
|
|
@@ -37998,222 +38264,15 @@ function Table3({
|
|
|
37998
38264
|
children: modal
|
|
37999
38265
|
}
|
|
38000
38266
|
),
|
|
38001
|
-
header && /* @__PURE__ */ (0,
|
|
38002
|
-
/* @__PURE__ */ (0,
|
|
38003
|
-
/* @__PURE__ */ (0,
|
|
38004
|
-
/* @__PURE__ */ (0,
|
|
38005
|
-
/* @__PURE__ */ (0,
|
|
38006
|
-
/* @__PURE__ */ (0,
|
|
38267
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "font-bold text-2xl py-5 px-2 bg-blue-50", children: header }),
|
|
38268
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Panel, { ...context }),
|
|
38269
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("table", { ...props, style, children: [
|
|
38270
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableHead, { ...context }),
|
|
38271
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableBody, { ...context }),
|
|
38272
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TableFooter, { ...context })
|
|
38007
38273
|
] })
|
|
38008
38274
|
] });
|
|
38009
38275
|
}
|
|
38010
|
-
|
|
38011
|
-
// src/pop/index.tsx
|
|
38012
|
-
var import_react16 = require("react");
|
|
38013
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
38014
|
-
var COLOR_CONFIG = {
|
|
38015
|
-
primary: {
|
|
38016
|
-
bg: "from-blue-50 to-indigo-50",
|
|
38017
|
-
iconBg: "bg-blue-100",
|
|
38018
|
-
iconText: "text-blue-600",
|
|
38019
|
-
border: "border-blue-200",
|
|
38020
|
-
confirm: "bg-blue-600 hover:bg-blue-700 focus:ring-blue-300",
|
|
38021
|
-
label: "\u2139"
|
|
38022
|
-
},
|
|
38023
|
-
info: {
|
|
38024
|
-
bg: "from-sky-50 to-cyan-50",
|
|
38025
|
-
iconBg: "bg-sky-100",
|
|
38026
|
-
iconText: "text-sky-600",
|
|
38027
|
-
border: "border-sky-200",
|
|
38028
|
-
confirm: "bg-sky-600 hover:bg-sky-700 focus:ring-sky-300",
|
|
38029
|
-
label: "\u2139"
|
|
38030
|
-
},
|
|
38031
|
-
success: {
|
|
38032
|
-
bg: "from-emerald-50 to-green-50",
|
|
38033
|
-
iconBg: "bg-emerald-100",
|
|
38034
|
-
iconText: "text-emerald-600",
|
|
38035
|
-
border: "border-emerald-200",
|
|
38036
|
-
confirm: "bg-emerald-600 hover:bg-emerald-700 focus:ring-emerald-300",
|
|
38037
|
-
label: "\u2713"
|
|
38038
|
-
},
|
|
38039
|
-
warning: {
|
|
38040
|
-
bg: "from-amber-50 to-yellow-50",
|
|
38041
|
-
iconBg: "bg-amber-100",
|
|
38042
|
-
iconText: "text-amber-600",
|
|
38043
|
-
border: "border-amber-200",
|
|
38044
|
-
confirm: "bg-amber-500 hover:bg-amber-600 focus:ring-amber-300",
|
|
38045
|
-
label: "\u26A0"
|
|
38046
|
-
},
|
|
38047
|
-
danger: {
|
|
38048
|
-
bg: "from-red-50 to-rose-50",
|
|
38049
|
-
iconBg: "bg-red-100",
|
|
38050
|
-
iconText: "text-red-600",
|
|
38051
|
-
border: "border-red-200",
|
|
38052
|
-
confirm: "bg-red-600 hover:bg-red-700 focus:ring-red-300",
|
|
38053
|
-
label: "\u2715"
|
|
38054
|
-
},
|
|
38055
|
-
secondary: {
|
|
38056
|
-
bg: "from-slate-50 to-gray-50",
|
|
38057
|
-
iconBg: "bg-slate-100",
|
|
38058
|
-
iconText: "text-slate-600",
|
|
38059
|
-
border: "border-slate-200",
|
|
38060
|
-
confirm: "bg-slate-700 hover:bg-slate-800 focus:ring-slate-300",
|
|
38061
|
-
label: "\u25CE"
|
|
38062
|
-
},
|
|
38063
|
-
white: {
|
|
38064
|
-
bg: "from-gray-50 to-white",
|
|
38065
|
-
iconBg: "bg-gray-100",
|
|
38066
|
-
iconText: "text-gray-500",
|
|
38067
|
-
border: "border-gray-200",
|
|
38068
|
-
confirm: "bg-gray-700 hover:bg-gray-800 focus:ring-gray-300",
|
|
38069
|
-
label: "\u25CE"
|
|
38070
|
-
}
|
|
38071
|
-
};
|
|
38072
|
-
function usePopup() {
|
|
38073
|
-
const [popup, setPopup] = (0, import_react16.useState)({
|
|
38074
|
-
type: "alert",
|
|
38075
|
-
message: "",
|
|
38076
|
-
visible: false,
|
|
38077
|
-
inputValue: "",
|
|
38078
|
-
color: "primary"
|
|
38079
|
-
});
|
|
38080
|
-
function alert2(message, color = "primary") {
|
|
38081
|
-
return new Promise((resolve) => {
|
|
38082
|
-
setPopup({
|
|
38083
|
-
type: "alert",
|
|
38084
|
-
message,
|
|
38085
|
-
visible: true,
|
|
38086
|
-
inputValue: "",
|
|
38087
|
-
onConfirm: () => resolve(),
|
|
38088
|
-
color
|
|
38089
|
-
});
|
|
38090
|
-
});
|
|
38091
|
-
}
|
|
38092
|
-
function modal(message, color = "primary") {
|
|
38093
|
-
return new Promise((resolve) => {
|
|
38094
|
-
setPopup({
|
|
38095
|
-
type: "modal",
|
|
38096
|
-
message,
|
|
38097
|
-
visible: true,
|
|
38098
|
-
inputValue: "",
|
|
38099
|
-
onConfirm: () => resolve(),
|
|
38100
|
-
color
|
|
38101
|
-
});
|
|
38102
|
-
});
|
|
38103
|
-
}
|
|
38104
|
-
function confirm(message, color = "primary") {
|
|
38105
|
-
return new Promise((resolve) => {
|
|
38106
|
-
setPopup({
|
|
38107
|
-
type: "confirm",
|
|
38108
|
-
message,
|
|
38109
|
-
visible: true,
|
|
38110
|
-
inputValue: "",
|
|
38111
|
-
onConfirm: () => resolve(true),
|
|
38112
|
-
onCancel: () => resolve(false),
|
|
38113
|
-
color
|
|
38114
|
-
});
|
|
38115
|
-
});
|
|
38116
|
-
}
|
|
38117
|
-
function prompt(message, color = "primary") {
|
|
38118
|
-
return new Promise((resolve) => {
|
|
38119
|
-
setPopup({
|
|
38120
|
-
type: "prompt",
|
|
38121
|
-
message,
|
|
38122
|
-
visible: true,
|
|
38123
|
-
inputValue: "",
|
|
38124
|
-
onConfirm: (value) => resolve(value != null ? value : ""),
|
|
38125
|
-
onCancel: () => resolve(null),
|
|
38126
|
-
color
|
|
38127
|
-
});
|
|
38128
|
-
});
|
|
38129
|
-
}
|
|
38130
|
-
function close(confirmed, value) {
|
|
38131
|
-
setPopup((prev) => {
|
|
38132
|
-
var _a, _b;
|
|
38133
|
-
if (confirmed) (_a = prev.onConfirm) == null ? void 0 : _a.call(prev, value);
|
|
38134
|
-
else (_b = prev.onCancel) == null ? void 0 : _b.call(prev);
|
|
38135
|
-
return { ...prev, visible: false, inputValue: "" };
|
|
38136
|
-
});
|
|
38137
|
-
}
|
|
38138
|
-
const c = COLOR_CONFIG[popup.color];
|
|
38139
|
-
const PopupComponent = popup.visible ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
38140
|
-
"div",
|
|
38141
|
-
{
|
|
38142
|
-
className: "fixed inset-0 flex items-center justify-center z-[1000]",
|
|
38143
|
-
style: { background: "rgba(15,23,42,0.45)", backdropFilter: "blur(2px)" },
|
|
38144
|
-
onClick: (e) => e.target === e.currentTarget && close(false),
|
|
38145
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
38146
|
-
"div",
|
|
38147
|
-
{
|
|
38148
|
-
className: `
|
|
38149
|
-
bg-gradient-to-br ${c.bg} border ${c.border}
|
|
38150
|
-
rounded-2xl shadow-2xl w-full max-w-sm mx-4
|
|
38151
|
-
animate-[fadeInScale_0.18s_ease-out]
|
|
38152
|
-
`,
|
|
38153
|
-
style: { animation: "fadeInScale 0.18s ease-out" },
|
|
38154
|
-
children: [
|
|
38155
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("style", { children: `
|
|
38156
|
-
@keyframes fadeInScale {
|
|
38157
|
-
from { opacity: 0; transform: scale(0.93) translateY(8px); }
|
|
38158
|
-
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
38159
|
-
}
|
|
38160
|
-
` }),
|
|
38161
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col items-center gap-3 px-8 pt-8 pb-5 text-center", children: [
|
|
38162
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
38163
|
-
"div",
|
|
38164
|
-
{
|
|
38165
|
-
className: `w-12 h-12 rounded-full ${c.iconBg} flex items-center justify-center`,
|
|
38166
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: `text-xl font-bold ${c.iconText}`, children: c.label })
|
|
38167
|
-
}
|
|
38168
|
-
),
|
|
38169
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-gray-800 text-[15px] font-medium leading-snug", children: popup.message })
|
|
38170
|
-
] }),
|
|
38171
|
-
popup.type === "prompt" && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "px-8 pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
38172
|
-
"input",
|
|
38173
|
-
{
|
|
38174
|
-
autoFocus: true,
|
|
38175
|
-
type: "text",
|
|
38176
|
-
value: popup.inputValue,
|
|
38177
|
-
onChange: (e) => setPopup((prev) => ({ ...prev, inputValue: e.target.value })),
|
|
38178
|
-
onKeyDown: (e) => e.key === "Enter" && close(true, popup.inputValue),
|
|
38179
|
-
className: `
|
|
38180
|
-
w-full px-3 py-2 rounded-lg border ${c.border} bg-white
|
|
38181
|
-
text-sm text-gray-800 outline-none
|
|
38182
|
-
focus:ring-2 ${c.confirm.includes("blue") ? "focus:ring-blue-200" : "focus:ring-gray-200"}
|
|
38183
|
-
transition
|
|
38184
|
-
`,
|
|
38185
|
-
placeholder: "Escribe aqu\xED..."
|
|
38186
|
-
}
|
|
38187
|
-
) }),
|
|
38188
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: `border-t ${c.border} mx-0 mt-4` }),
|
|
38189
|
-
popup.type != "modal" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex gap-2 px-6 py-4 justify-end", children: [
|
|
38190
|
-
(popup.type === "confirm" || popup.type === "prompt") && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
38191
|
-
"button",
|
|
38192
|
-
{
|
|
38193
|
-
onClick: () => close(false),
|
|
38194
|
-
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 ",
|
|
38195
|
-
children: "Cancelar"
|
|
38196
|
-
}
|
|
38197
|
-
),
|
|
38198
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
38199
|
-
"button",
|
|
38200
|
-
{
|
|
38201
|
-
onClick: () => close(true, popup.inputValue),
|
|
38202
|
-
className: `
|
|
38203
|
-
px-5 py-2 rounded-lg text-sm font-semibold text-white
|
|
38204
|
-
${c.confirm} transition focus:outline-none focus:ring-2
|
|
38205
|
-
`,
|
|
38206
|
-
children: "Aceptar"
|
|
38207
|
-
}
|
|
38208
|
-
)
|
|
38209
|
-
] })
|
|
38210
|
-
]
|
|
38211
|
-
}
|
|
38212
|
-
)
|
|
38213
|
-
}
|
|
38214
|
-
) : null;
|
|
38215
|
-
return { alert: alert2, confirm, prompt, PopupComponent, modal };
|
|
38216
|
-
}
|
|
38217
38276
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38218
38277
|
0 && (module.exports = {
|
|
38219
38278
|
Alert,
|