next-recomponents 2.0.0 → 2.0.2

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.js CHANGED
@@ -1,39 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __objRest = (source, exclude) => {
26
- var target = {};
27
- for (var prop in source)
28
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
- target[prop] = source[prop];
30
- if (source != null && __getOwnPropSymbols)
31
- for (var prop of __getOwnPropSymbols(source)) {
32
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
- target[prop] = source[prop];
34
- }
35
- return target;
36
- };
37
8
  var __commonJS = (cb, mod) => function __require() {
38
9
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
39
10
  };
@@ -1543,9 +1514,10 @@ var require_route_pattern_normalizer = __commonJS({
1543
1514
  "prefix" in token && "suffix" in token && // Both prefix and suffix must be empty strings
1544
1515
  // This is what causes the validation error in path-to-regexp
1545
1516
  token.prefix === "" && token.suffix === "") {
1546
- return __spreadProps(__spreadValues({}, token), {
1517
+ return {
1518
+ ...token,
1547
1519
  prefix: "/"
1548
- });
1520
+ };
1549
1521
  }
1550
1522
  return token;
1551
1523
  });
@@ -1637,9 +1609,10 @@ var require_route_match_utils = __commonJS({
1637
1609
  return (pathname) => {
1638
1610
  const result = originalMatcher(pathname);
1639
1611
  if (!result) return false;
1640
- return __spreadProps(__spreadValues({}, result), {
1612
+ return {
1613
+ ...result,
1641
1614
  params: (0, _routepatternnormalizer.stripParameterSeparators)(result.params)
1642
- });
1615
+ };
1643
1616
  };
1644
1617
  }
1645
1618
  function safeRouteMatcher(matcherFn) {
@@ -2003,7 +1976,8 @@ var require_constants = __commonJS({
2003
1976
  */
2004
1977
  pagesDirNode: "pages-dir-node"
2005
1978
  };
2006
- var WEBPACK_LAYERS = __spreadProps(__spreadValues({}, WEBPACK_LAYERS_NAMES), {
1979
+ var WEBPACK_LAYERS = {
1980
+ ...WEBPACK_LAYERS_NAMES,
2007
1981
  GROUP: {
2008
1982
  builtinReact: [
2009
1983
  WEBPACK_LAYERS_NAMES.reactServerComponents,
@@ -2041,7 +2015,7 @@ var require_constants = __commonJS({
2041
2015
  WEBPACK_LAYERS_NAMES.actionBrowser
2042
2016
  ]
2043
2017
  }
2044
- });
2018
+ };
2045
2019
  var WEBPACK_RESOURCE_QUERIES = {
2046
2020
  edgeSSREntry: "__next_edge_ssr_entry__",
2047
2021
  metadata: "__next_metadata__",
@@ -2363,10 +2337,11 @@ var require_route_regex = __commonJS({
2363
2337
  if (!options.excludeOptionalTrailingSlash) {
2364
2338
  namedRegex += "(?:/)?";
2365
2339
  }
2366
- return __spreadProps(__spreadValues({}, getRouteRegex(normalizedRoute, options)), {
2340
+ return {
2341
+ ...getRouteRegex(normalizedRoute, options),
2367
2342
  namedRegex: "^" + namedRegex + "$",
2368
2343
  routeKeys: result.routeKeys
2369
- });
2344
+ };
2370
2345
  }
2371
2346
  function getNamedMiddlewareRegex(normalizedRoute, options) {
2372
2347
  const { parameterizedRoute } = getParametrizedRoute(normalizedRoute, false, false);
@@ -3211,7 +3186,7 @@ var require_link = __commonJS({
3211
3186
  }
3212
3187
  var Link2 = /* @__PURE__ */ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
3213
3188
  let children;
3214
- const _a = props, { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, locale, onClick, onNavigate, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false } = _a, restProps = __objRest(_a, ["href", "as", "children", "prefetch", "passHref", "replace", "shallow", "scroll", "locale", "onClick", "onNavigate", "onMouseEnter", "onTouchStart", "legacyBehavior"]);
3189
+ const { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, locale, onClick, onNavigate, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false, ...restProps } = props;
3215
3190
  children = childrenProp;
3216
3191
  if (legacyBehavior && (typeof children === "string" || typeof children === "number")) {
3217
3192
  children = /* @__PURE__ */ (0, _jsxruntime.jsx)("a", {
@@ -3480,9 +3455,11 @@ var require_link = __commonJS({
3480
3455
  }
3481
3456
  return /* @__PURE__ */ _react.default.cloneElement(child, childProps);
3482
3457
  }
3483
- return /* @__PURE__ */ (0, _jsxruntime.jsx)("a", __spreadProps(__spreadValues(__spreadValues({}, restProps), childProps), {
3458
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("a", {
3459
+ ...restProps,
3460
+ ...childProps,
3484
3461
  children
3485
- }));
3462
+ });
3486
3463
  });
3487
3464
  var LinkStatusContext = /* @__PURE__ */ (0, _react.createContext)({
3488
3465
  // We do not support link status in the Pages Router, so we always return false
@@ -3545,63 +3522,53 @@ var catColor = {
3545
3522
 
3546
3523
  // src/alert/index.tsx
3547
3524
  var import_jsx_runtime = require("react/jsx-runtime");
3548
- function Alert(_a) {
3549
- var _b = _a, {
3550
- color = "primary",
3551
- children
3552
- } = _b, props = __objRest(_b, [
3553
- "color",
3554
- "children"
3555
- ]);
3525
+ function Alert({
3526
+ color = "primary",
3527
+ children,
3528
+ ...props
3529
+ }) {
3556
3530
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
3557
3531
  "div",
3558
- __spreadProps(__spreadValues({
3559
- className: [catColor[color], "p-2 rounded shadow border"].join(" ")
3560
- }, props), {
3532
+ {
3533
+ className: [catColor[color], "p-2 rounded shadow border"].join(" "),
3534
+ ...props,
3561
3535
  children
3562
- })
3536
+ }
3563
3537
  );
3564
3538
  }
3565
3539
 
3566
3540
  // src/button/index.tsx
3567
3541
  var import_react = require("react");
3568
3542
  var import_jsx_runtime2 = require("react/jsx-runtime");
3569
- function Button(_a) {
3570
- var _b = _a, {
3571
- className,
3572
- size = "small",
3573
- color = "primary",
3574
- children,
3575
- icon,
3576
- disabled,
3577
- full = false
3578
- } = _b, props = __objRest(_b, [
3579
- "className",
3580
- "size",
3581
- "color",
3582
- "children",
3583
- "icon",
3584
- "disabled",
3585
- "full"
3586
- ]);
3543
+ function Button({
3544
+ className,
3545
+ size = "small",
3546
+ color = "primary",
3547
+ children,
3548
+ icon,
3549
+ disabled,
3550
+ full = false,
3551
+ ...props
3552
+ }) {
3587
3553
  const [isLoading, setIsloading] = (0, import_react.useState)(false);
3588
3554
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
3589
3555
  "button",
3590
- __spreadProps(__spreadValues({}, Object.assign(
3591
- {},
3592
- ...Object.keys(props).map((prop) => {
3593
- const originalHandler = props[prop];
3594
- const newProp = { [prop]: originalHandler };
3595
- if (prop.startsWith("on") && typeof originalHandler === "function") {
3596
- newProp[prop] = async (e) => {
3597
- setIsloading(true);
3598
- originalHandler && await originalHandler(e);
3599
- setIsloading(false);
3600
- };
3601
- }
3602
- return newProp;
3603
- })
3604
- )), {
3556
+ {
3557
+ ...Object.assign(
3558
+ {},
3559
+ ...Object.keys(props).map((prop) => {
3560
+ const originalHandler = props[prop];
3561
+ const newProp = { [prop]: originalHandler };
3562
+ if (prop.startsWith("on") && typeof originalHandler === "function") {
3563
+ newProp[prop] = async (e) => {
3564
+ setIsloading(true);
3565
+ originalHandler && await originalHandler(e);
3566
+ setIsloading(false);
3567
+ };
3568
+ }
3569
+ return newProp;
3570
+ })
3571
+ ),
3605
3572
  className: [
3606
3573
  className,
3607
3574
  "p-2 border shadow rounded flex gap-1 justify-center items-center",
@@ -3613,7 +3580,7 @@ function Button(_a) {
3613
3580
  icon,
3614
3581
  children
3615
3582
  ]
3616
- })
3583
+ }
3617
3584
  );
3618
3585
  }
3619
3586
 
@@ -3839,30 +3806,24 @@ var import_react3 = __toESM(require("react"));
3839
3806
  var import_jsx_runtime5 = require("react/jsx-runtime");
3840
3807
  function useFormValues(initial) {
3841
3808
  const reducer = (state, action) => {
3842
- return __spreadValues(__spreadValues({}, state), action);
3809
+ return { ...state, ...action };
3843
3810
  };
3844
3811
  return (0, import_react3.useReducer)(reducer, initial);
3845
3812
  }
3846
- function Form(_a) {
3847
- var _b = _a, {
3848
- onSubmit,
3849
- state,
3850
- invalidMessage = "Existen valores inv\xE1lidos en el formulario",
3851
- children,
3852
- loader = "Loading..."
3853
- } = _b, otherProps = __objRest(_b, [
3854
- "onSubmit",
3855
- "state",
3856
- "invalidMessage",
3857
- "children",
3858
- "loader"
3859
- ]);
3813
+ function Form({
3814
+ onSubmit,
3815
+ state,
3816
+ invalidMessage = "Existen valores inv\xE1lidos en el formulario",
3817
+ children,
3818
+ loader = "Loading...",
3819
+ ...otherProps
3820
+ }) {
3860
3821
  const [isLoading, setIsLoading] = (0, import_react3.useState)(false);
3861
3822
  const ref = (0, import_react3.useRef)(null);
3862
3823
  const [hvalues, setHValues] = state || (0, import_react3.useState)({});
3863
3824
  (0, import_react3.useEffect)(() => {
3864
3825
  if (ref == null ? void 0 : ref.current) {
3865
- const newValues = __spreadValues({}, hvalues);
3826
+ const newValues = { ...hvalues };
3866
3827
  const formData = new FormData(ref.current);
3867
3828
  for (let [k, v] of formData.entries()) {
3868
3829
  if (!newValues[k]) {
@@ -3875,8 +3836,8 @@ function Form(_a) {
3875
3836
  }
3876
3837
  }, [state, ref]);
3877
3838
  function hasErrors() {
3878
- var _a2;
3879
- const hasInvalids = (_a2 = ref == null ? void 0 : ref.current) == null ? void 0 : _a2.querySelectorAll(".invalid");
3839
+ var _a;
3840
+ const hasInvalids = (_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.querySelectorAll(".invalid");
3880
3841
  if (hasInvalids && (hasInvalids == null ? void 0 : hasInvalids.length) > 0) {
3881
3842
  return true;
3882
3843
  }
@@ -3884,7 +3845,8 @@ function Form(_a) {
3884
3845
  }
3885
3846
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
3886
3847
  "form",
3887
- __spreadProps(__spreadValues({}, otherProps), {
3848
+ {
3849
+ ...otherProps,
3888
3850
  ref,
3889
3851
  onSubmit: async (e) => {
3890
3852
  e.preventDefault();
@@ -3894,19 +3856,19 @@ function Form(_a) {
3894
3856
  }
3895
3857
  if (onSubmit) {
3896
3858
  setIsLoading(true);
3897
- await onSubmit(__spreadProps(__spreadValues({}, e), { values: hvalues }));
3859
+ await onSubmit({ ...e, values: hvalues });
3898
3860
  setIsLoading(false);
3899
3861
  }
3900
3862
  },
3901
3863
  children: [
3902
3864
  import_react3.default.Children.map(children, (child) => {
3903
3865
  if (import_react3.default.isValidElement(child)) {
3904
- const props = (child == null ? void 0 : child.props) ? __spreadValues({}, child.props) : {};
3866
+ const props = (child == null ? void 0 : child.props) ? { ...child.props } : {};
3905
3867
  try {
3906
3868
  return import_react3.default.cloneElement(child, {
3907
3869
  value: hvalues[props.name] || "",
3908
3870
  onChange: (e) => {
3909
- setHValues(__spreadProps(__spreadValues({}, hvalues), { [props.name]: e.target.value }));
3871
+ setHValues({ ...hvalues, [props.name]: e.target.value });
3910
3872
  (props == null ? void 0 : props.onChange) && props.onChange(e);
3911
3873
  }
3912
3874
  });
@@ -3918,24 +3880,19 @@ function Form(_a) {
3918
3880
  }),
3919
3881
  isLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "fixed top-0 left-0 w-full h-screen flex items-center justify-center bg-white bg-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: loader }) })
3920
3882
  ]
3921
- })
3883
+ }
3922
3884
  );
3923
3885
  }
3924
3886
 
3925
3887
  // src/input/index.tsx
3926
3888
  var import_jsx_runtime6 = require("react/jsx-runtime");
3927
- function Input(_a) {
3928
- var _b = _a, {
3929
- label,
3930
- className,
3931
- regex,
3932
- invalidMessage = "Valor no v\xE1lido"
3933
- } = _b, props = __objRest(_b, [
3934
- "label",
3935
- "className",
3936
- "regex",
3937
- "invalidMessage"
3938
- ]);
3889
+ function Input({
3890
+ label,
3891
+ className,
3892
+ regex,
3893
+ invalidMessage = "Valor no v\xE1lido",
3894
+ ...props
3895
+ }) {
3939
3896
  const value = `${(props == null ? void 0 : props.value) || ""}`;
3940
3897
  const isValid = !regex ? true : regex.test(value);
3941
3898
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w-full", children: [
@@ -3947,14 +3904,15 @@ function Input(_a) {
3947
3904
  ] }),
3948
3905
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3949
3906
  "input",
3950
- __spreadProps(__spreadValues({}, props), {
3907
+ {
3908
+ ...props,
3951
3909
  className: [
3952
3910
  "p-2 w-full rounded border shadow",
3953
3911
  value != "" && !isValid && "bg-red-200 text-black",
3954
3912
  value != "" && isValid && "bg-green-200 text-black",
3955
3913
  className
3956
3914
  ].join(" ")
3957
- })
3915
+ }
3958
3916
  ) })
3959
3917
  ] }),
3960
3918
  !isValid && value != "" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "text-red-800 invalid", children: invalidMessage })
@@ -35739,7 +35697,7 @@ var import_material2 = require("@mui/material");
35739
35697
  var import_jsx_runtime7 = require("react/jsx-runtime");
35740
35698
  function Table(props) {
35741
35699
  if (Array.isArray(props.data)) {
35742
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IHTable, __spreadValues({}, props));
35700
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IHTable, { ...props });
35743
35701
  } else {
35744
35702
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: " bg-white border shadow rounded p-1", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("table", { className: "rounded", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("tbody", { children: Object.keys(props.data).map((k) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("tr", { className: "border-b ", children: [
35745
35703
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("th", { className: "font-bold p-3 text-right", children: k }),
@@ -35777,7 +35735,7 @@ function IHTable({
35777
35735
  buttons,
35778
35736
  exportName,
35779
35737
  modal,
35780
- height = 370,
35738
+ height = 600,
35781
35739
  width = "100%",
35782
35740
  header,
35783
35741
  hideColumns = [],
@@ -35785,7 +35743,7 @@ function IHTable({
35785
35743
  }) {
35786
35744
  const [open, setOpen] = (0, import_react4.useState)(false);
35787
35745
  if (modal) {
35788
- buttons = __spreadProps(__spreadValues({}, buttons), { Modal: "" });
35746
+ buttons = { ...buttons, Modal: "" };
35789
35747
  }
35790
35748
  const handleOpen = () => setOpen(true);
35791
35749
  const handleClose = () => {
@@ -35810,13 +35768,14 @@ function IHTable({
35810
35768
  editable: editableFields == null ? void 0 : editableFields.includes(key),
35811
35769
  type: typeof rows[0][key] === "number" ? "number" : "string",
35812
35770
  renderCell: (buttons == null ? void 0 : buttons[key]) ? (params) => {
35813
- var _a;
35771
+ var _a, _b;
35814
35772
  return import_react4.default.cloneElement(buttons[key], {
35815
- children: (_a = params == null ? void 0 : params.row) == null ? void 0 : _a[key],
35773
+ className: ((_a = params == null ? void 0 : params.className) != null ? _a : "") + " m-auto text-xs ",
35774
+ children: (_b = params == null ? void 0 : params.row) == null ? void 0 : _b[key],
35816
35775
  onClick: (e) => {
35817
- var _a2, _b;
35776
+ var _a2, _b2;
35818
35777
  e.row = params == null ? void 0 : params.row;
35819
- if ((_b = (_a2 = buttons[key]) == null ? void 0 : _a2.props) == null ? void 0 : _b.onClick) {
35778
+ if ((_b2 = (_a2 = buttons[key]) == null ? void 0 : _a2.props) == null ? void 0 : _b2.onClick) {
35820
35779
  const newVal = buttons[key].props.onClick(e);
35821
35780
  newVal && handleRowUpdate(newVal);
35822
35781
  }
@@ -35887,32 +35846,23 @@ function IHTable({
35887
35846
  zIndex: 999999999
35888
35847
  },
35889
35848
  children: [
35890
- modal && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
35891
- import_material2.Dialog,
35892
- {
35893
- open,
35894
- onClose: handleClose,
35895
- maxWidth: "xl",
35896
- fullWidth: true,
35897
- children: [
35898
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
35899
- "button",
35900
- {
35901
- onClick: () => {
35902
- handleClose();
35903
- },
35904
- className: "text-gray-500 hover:text-gray-800 text-xl font-bold p-5",
35905
- children: "\xD7"
35906
- }
35907
- ) }),
35908
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mt-4 m-auto p-5", children: selectedRows && Array.from(selectedRows == null ? void 0 : selectedRows.ids).length > 0 && import_react4.default.cloneElement(modal, {
35909
- row: rows.find(
35910
- (r) => Array.from(selectedRows == null ? void 0 : selectedRows.ids).includes(r.id)
35911
- )
35912
- }) })
35913
- ]
35914
- }
35915
- ),
35849
+ modal && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material2.Dialog, { open, onClose: handleClose, maxWidth: "xl", fullWidth: true, children: [
35850
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
35851
+ "button",
35852
+ {
35853
+ onClick: () => {
35854
+ handleClose();
35855
+ },
35856
+ className: "text-gray-500 hover:text-gray-800 text-xl font-bold p-5",
35857
+ children: "\xD7"
35858
+ }
35859
+ ) }),
35860
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mt-4 m-auto p-5", children: selectedRows && Array.from(selectedRows == null ? void 0 : selectedRows.ids).length > 0 && import_react4.default.cloneElement(modal, {
35861
+ row: rows.find(
35862
+ (r) => Array.from(selectedRows == null ? void 0 : selectedRows.ids).includes(r.id)
35863
+ )
35864
+ }) })
35865
+ ] }),
35916
35866
  header && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "font-bold text-xl p-2 bg-blue-500 text-white border shadow rounded", children: header }),
35917
35867
  (exportName || onSave || onSelect) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex gap-2 bg-gray-200 border shadow rounded p-2", children: [
35918
35868
  exportName && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
@@ -35921,10 +35871,7 @@ function IHTable({
35921
35871
  className: "bg-green-800 text-white",
35922
35872
  onClick: (e) => {
35923
35873
  excel.export(
35924
- rows.map((_a) => {
35925
- var _b = _a, { _edited } = _b, r = __objRest(_b, ["_edited"]);
35926
- return r;
35927
- }),
35874
+ rows.map(({ _edited, ...r }) => r),
35928
35875
  `${exportName}.xlsx`
35929
35876
  );
35930
35877
  },
@@ -35937,10 +35884,7 @@ function IHTable({
35937
35884
  disabled: filtered.length == 0,
35938
35885
  color: filtered.length == 0 ? "white" : "primary",
35939
35886
  onClick: (e) => {
35940
- onSelect == null ? void 0 : onSelect(filtered.map((_a) => {
35941
- var _b = _a, { _edited } = _b, r = __objRest(_b, ["_edited"]);
35942
- return r;
35943
- }));
35887
+ onSelect == null ? void 0 : onSelect(filtered.map(({ _edited, ...r }) => r));
35944
35888
  },
35945
35889
  children: "Guardar Selecci\xF3n"
35946
35890
  }
@@ -35948,10 +35892,7 @@ function IHTable({
35948
35892
  Button,
35949
35893
  {
35950
35894
  onClick: (e) => {
35951
- onSave == null ? void 0 : onSave(rows.map((_a) => {
35952
- var _b = _a, { _edited } = _b, r = __objRest(_b, ["_edited"]);
35953
- return r;
35954
- }));
35895
+ onSave == null ? void 0 : onSave(rows.map(({ _edited, ...r }) => r));
35955
35896
  },
35956
35897
  children: "Guardar"
35957
35898
  }
@@ -35965,7 +35906,6 @@ function IHTable({
35965
35906
  checkboxSelection: Boolean(onSelect),
35966
35907
  rowSelectionModel: selectedRows,
35967
35908
  onRowSelectionModelChange: (newSelection) => {
35968
- console.log(newSelection);
35969
35909
  setSelectedRows(newSelection);
35970
35910
  },
35971
35911
  sx: {
@@ -35984,36 +35924,53 @@ function IHTable({
35984
35924
  }
35985
35925
  );
35986
35926
  }
35987
- function CustomFooter(props) {
35988
- const { rows, footer } = props;
35989
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: Object.keys(footer).map((k) => {
35990
- const total = rows.reduce((acc, r) => acc + r[k], 0);
35991
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex justify-end w-full pr-4 font-bold", children: [
35992
- "Suma de ",
35993
- k,
35994
- ": ",
35995
- total
35996
- ] }, k);
35927
+ function CustomFooter({
35928
+ rows,
35929
+ footer
35930
+ }) {
35931
+ const entries = Object.entries(footer);
35932
+ if (!entries.length) return null;
35933
+ const compute = (key, type) => {
35934
+ const values = rows.map((r) => {
35935
+ var _a;
35936
+ return Number((_a = r[key]) != null ? _a : 0);
35937
+ }).filter((v) => !isNaN(v));
35938
+ if (type === "sum") return values.reduce((acc, v) => acc + v, 0);
35939
+ if (type === "avg")
35940
+ return values.length ? values.reduce((acc, v) => acc + v, 0) / values.length : 0;
35941
+ if (type === "count") return values.length;
35942
+ return 0;
35943
+ };
35944
+ const label = {
35945
+ sum: "Suma",
35946
+ avg: "Promedio",
35947
+ count: "Conteo"
35948
+ };
35949
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex justify-end gap-6 px-4 py-2 bg-gray-100 border-t border-gray-300 text-sm font-semibold text-gray-700", children: entries.map(([key, type]) => {
35950
+ const value = compute(key, type);
35951
+ const formatted = type === "avg" ? value.toLocaleString(void 0, { maximumFractionDigits: 2 }) : value.toLocaleString();
35952
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
35953
+ label[type],
35954
+ " de ",
35955
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-gray-900", children: key }),
35956
+ ":",
35957
+ " ",
35958
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-blue-700", children: formatted })
35959
+ ] }, key);
35997
35960
  }) });
35998
35961
  }
35999
35962
 
36000
35963
  // src/text-area/index.tsx
36001
35964
  var import_react5 = require("react");
36002
35965
  var import_jsx_runtime8 = require("react/jsx-runtime");
36003
- function TextArea(_a) {
36004
- var _b = _a, {
36005
- label,
36006
- className,
36007
- maxLength,
36008
- onChange,
36009
- children = ""
36010
- } = _b, props = __objRest(_b, [
36011
- "label",
36012
- "className",
36013
- "maxLength",
36014
- "onChange",
36015
- "children"
36016
- ]);
35966
+ function TextArea({
35967
+ label,
35968
+ className,
35969
+ maxLength,
35970
+ onChange,
35971
+ children = "",
35972
+ ...props
35973
+ }) {
36017
35974
  const [value, setValue] = (0, import_react5.useState)((props == null ? void 0 : props.value) || "");
36018
35975
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "flex flex-col gap-1", children: [
36019
35976
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "font-bold ", children: [
@@ -36024,7 +35981,8 @@ function TextArea(_a) {
36024
35981
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
36025
35982
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
36026
35983
  "textarea",
36027
- __spreadProps(__spreadValues({}, props), {
35984
+ {
35985
+ ...props,
36028
35986
  className: ["p-1 w-full rounded border shadow", className].join(
36029
35987
  " "
36030
35988
  ),
@@ -36036,7 +35994,7 @@ function TextArea(_a) {
36036
35994
  setValue(e.target.value);
36037
35995
  onChange == null ? void 0 : onChange(e);
36038
35996
  }
36039
- })
35997
+ }
36040
35998
  ),
36041
35999
  maxLength && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: " text-xs text-gray text-right", children: [
36042
36000
  value.length,
@@ -36148,7 +36106,8 @@ function useResources({
36148
36106
  const [info, setInfo] = (0, import_react7.useState)(
36149
36107
  Object.keys(endpoints).reduce((acc, key) => {
36150
36108
  var _a, _b;
36151
- const newAcc = __spreadProps(__spreadValues({}, acc), {
36109
+ const newAcc = {
36110
+ ...acc,
36152
36111
  [key]: {
36153
36112
  loaded: false,
36154
36113
  id: (_a = endpoints[key]) == null ? void 0 : _a.id,
@@ -36156,23 +36115,22 @@ function useResources({
36156
36115
  data: [],
36157
36116
  selectedItem: {}
36158
36117
  }
36159
- });
36118
+ };
36160
36119
  return newAcc;
36161
36120
  }, {})
36162
36121
  );
36163
36122
  const results = Object.keys(endpoints).reduce(
36164
36123
  (acc, key) => {
36165
- var _c, _d, _e, _f, _g, _h, _i;
36124
+ var _a, _b, _c, _d, _e, _f, _g;
36166
36125
  const endpoint = endpoints[key];
36167
- const showFunc = async (_a, autoLoad = false) => {
36168
- var _b = _a, { limit = 10, page = 1, merge = true } = _b, query = __objRest(_b, ["limit", "page", "merge"]);
36126
+ const showFunc = async ({ limit = 10, page = 1, merge = true, ...query }, autoLoad = false) => {
36169
36127
  const options = {
36170
36128
  method: "GET",
36171
36129
  url: `${baseURI}/${key}`,
36172
- params: __spreadValues({ limit, page }, query),
36130
+ params: { limit, page, ...query },
36173
36131
  headers: { Authorization: token }
36174
36132
  };
36175
- const newInfo = __spreadValues({}, info);
36133
+ const newInfo = { ...info };
36176
36134
  newInfo[key].state = "loading";
36177
36135
  newInfo[key].errorMessage = "";
36178
36136
  newInfo[key].params = query;
@@ -36187,28 +36145,28 @@ function useResources({
36187
36145
  newInfo[key].totalItems = d.totalItems;
36188
36146
  newInfo[key].totalPages = d.totalPages;
36189
36147
  newInfo[key].currentPage = d.currentPage;
36190
- setInfo(__spreadValues({}, newInfo));
36148
+ setInfo({ ...newInfo });
36191
36149
  return d.data;
36192
36150
  } catch (error) {
36193
36151
  const item = http_codes_default.find((s) => s.code == error.status);
36194
36152
  newInfo[key].state = "error";
36195
36153
  newInfo[key].errorMessage = item == null ? void 0 : item.meaning;
36196
36154
  if (error.status == 403) {
36197
- onError == null ? void 0 : onError(__spreadValues({ error }, { errorMessage: item == null ? void 0 : item.meaning }));
36155
+ onError == null ? void 0 : onError({ error, ...{ errorMessage: item == null ? void 0 : item.meaning } });
36198
36156
  }
36199
- setInfo(__spreadValues({}, newInfo));
36157
+ setInfo({ ...newInfo });
36200
36158
  return error;
36201
36159
  }
36202
36160
  };
36203
36161
  const findFunc = async (id, query) => {
36204
- var _a, _b, _c2;
36162
+ var _a2, _b2, _c2;
36205
36163
  const options = {
36206
36164
  method: "GET",
36207
36165
  url: `${baseURI}/${key}/${id}`,
36208
- params: __spreadValues({}, query),
36166
+ params: { ...query },
36209
36167
  headers: { Authorization: token }
36210
36168
  };
36211
- const newInfo = __spreadValues({}, info);
36169
+ const newInfo = { ...info };
36212
36170
  newInfo[key].state = "loading";
36213
36171
  newInfo[key].errorMessage = "";
36214
36172
  newInfo[key].params = query;
@@ -36220,7 +36178,7 @@ function useResources({
36220
36178
  newInfo[key].state = "success";
36221
36179
  newInfo[key].errorMessage = "";
36222
36180
  newInfo[key].selectedItem = d;
36223
- const index = (_b = (_a = newInfo[key]) == null ? void 0 : _a.data) == null ? void 0 : _b.findIndex((d2) => (d2 == null ? void 0 : d2.id) == id);
36181
+ const index = (_b2 = (_a2 = newInfo[key]) == null ? void 0 : _a2.data) == null ? void 0 : _b2.findIndex((d2) => (d2 == null ? void 0 : d2.id) == id);
36224
36182
  if (index >= 0) {
36225
36183
  newInfo[key].data[index] = d;
36226
36184
  } else {
@@ -36230,28 +36188,28 @@ function useResources({
36230
36188
  newInfo[key].data = [d];
36231
36189
  }
36232
36190
  }
36233
- setInfo(__spreadValues({}, newInfo));
36191
+ setInfo({ ...newInfo });
36234
36192
  return d;
36235
36193
  } catch (error) {
36236
36194
  const item = http_codes_default.find((s) => s.code == error.status);
36237
36195
  newInfo[key].state = "error";
36238
36196
  newInfo[key].errorMessage = (item == null ? void 0 : item.meaning) || error.message;
36239
36197
  if (error.status == 403) {
36240
- onError == null ? void 0 : onError(__spreadValues({ error }, { errorMessage: item == null ? void 0 : item.meaning }));
36198
+ onError == null ? void 0 : onError({ error, ...{ errorMessage: item == null ? void 0 : item.meaning } });
36241
36199
  }
36242
- setInfo(__spreadValues({}, newInfo));
36200
+ setInfo({ ...newInfo });
36243
36201
  return error;
36244
36202
  }
36245
36203
  };
36246
36204
  const bodyCreateFunc = async (data) => {
36247
- var _a, _b, _c2, _d2, _e2, _f2;
36205
+ var _a2, _b2, _c2, _d2, _e2, _f2;
36248
36206
  const options = {
36249
36207
  method: "POST",
36250
36208
  url: `${baseURI}/${key}`,
36251
- data: Array.isArray(data) ? [...data] : __spreadValues({}, data),
36209
+ data: Array.isArray(data) ? [...data] : { ...data },
36252
36210
  headers: { Authorization: token }
36253
36211
  };
36254
- const newInfo = __spreadValues({}, info);
36212
+ const newInfo = { ...info };
36255
36213
  newInfo[key].state = "loading";
36256
36214
  newInfo[key].errorMessage = "";
36257
36215
  setInfo(newInfo);
@@ -36262,7 +36220,7 @@ function useResources({
36262
36220
  newInfo[key].errorMessage = "";
36263
36221
  if (Array.isArray(data)) {
36264
36222
  for (let datum of data) {
36265
- const index = (_b = (_a = newInfo[key]) == null ? void 0 : _a.data) == null ? void 0 : _b.findIndex(
36223
+ const index = (_b2 = (_a2 = newInfo[key]) == null ? void 0 : _a2.data) == null ? void 0 : _b2.findIndex(
36266
36224
  (d2) => (d2 == null ? void 0 : d2.id) == (datum == null ? void 0 : datum.id)
36267
36225
  );
36268
36226
  if (index >= 0) {
@@ -36291,22 +36249,22 @@ function useResources({
36291
36249
  }
36292
36250
  }
36293
36251
  }
36294
- setInfo(__spreadValues({}, newInfo));
36252
+ setInfo({ ...newInfo });
36295
36253
  return d;
36296
36254
  } catch (error) {
36297
36255
  const item = http_codes_default.find((s) => s.code == error.status);
36298
36256
  newInfo[key].state = "error";
36299
36257
  newInfo[key].errorMessage = (item == null ? void 0 : item.meaning) || error.message;
36300
36258
  if (error.status == 403) {
36301
- onError == null ? void 0 : onError(__spreadValues({ error }, { errorMessage: item == null ? void 0 : item.meaning }));
36259
+ onError == null ? void 0 : onError({ error, ...{ errorMessage: item == null ? void 0 : item.meaning } });
36302
36260
  }
36303
- setInfo(__spreadValues({}, newInfo));
36261
+ setInfo({ ...newInfo });
36304
36262
  return error;
36305
36263
  }
36306
36264
  };
36307
36265
  const formCreateFunc = async (data) => {
36308
- var _a, _b, _c2, _d2, _e2, _f2;
36309
- const newInfo = __spreadValues({}, info);
36266
+ var _a2, _b2, _c2, _d2, _e2, _f2;
36267
+ const newInfo = { ...info };
36310
36268
  newInfo[key].state = "loading";
36311
36269
  newInfo[key].errorMessage = "";
36312
36270
  setInfo(newInfo);
@@ -36338,7 +36296,7 @@ function useResources({
36338
36296
  newInfo[key].errorMessage = "";
36339
36297
  if (Array.isArray(data)) {
36340
36298
  for (let datum of data) {
36341
- const index = (_b = (_a = newInfo[key]) == null ? void 0 : _a.data) == null ? void 0 : _b.findIndex(
36299
+ const index = (_b2 = (_a2 = newInfo[key]) == null ? void 0 : _a2.data) == null ? void 0 : _b2.findIndex(
36342
36300
  (d2) => (d2 == null ? void 0 : d2.id) == (datum == null ? void 0 : datum.id)
36343
36301
  );
36344
36302
  if (index >= 0) {
@@ -36367,20 +36325,21 @@ function useResources({
36367
36325
  }
36368
36326
  }
36369
36327
  }
36370
- setInfo(__spreadValues({}, newInfo));
36328
+ setInfo({ ...newInfo });
36371
36329
  return d;
36372
36330
  } catch (error) {
36373
36331
  const item = http_codes_default.find((s) => s.code == error.status);
36374
36332
  newInfo[key].state = "error";
36375
36333
  newInfo[key].errorMessage = (item == null ? void 0 : item.meaning) || error.message;
36376
36334
  if (error.status == 403) {
36377
- onError == null ? void 0 : onError(__spreadValues({ error }, { errorMessage: item == null ? void 0 : item.meaning }));
36335
+ onError == null ? void 0 : onError({ error, ...{ errorMessage: item == null ? void 0 : item.meaning } });
36378
36336
  }
36379
- setInfo(__spreadValues({}, newInfo));
36337
+ setInfo({ ...newInfo });
36380
36338
  return error;
36381
36339
  }
36382
36340
  };
36383
- acc[key] = __spreadProps(__spreadValues({}, endpoint), {
36341
+ acc[key] = {
36342
+ ...endpoint,
36384
36343
  loaded: false,
36385
36344
  show: showFunc,
36386
36345
  find: findFunc,
@@ -36394,14 +36353,14 @@ function useResources({
36394
36353
  return await bodyCreateFunc(data);
36395
36354
  },
36396
36355
  update: async (id, data) => {
36397
- var _a, _b, _c2;
36356
+ var _a2, _b2, _c2;
36398
36357
  const options = {
36399
36358
  method: "PATCH",
36400
36359
  url: `${baseURI}/${key}/${id}`,
36401
- data: Array.isArray(data) ? [...data] : __spreadValues({}, data),
36360
+ data: Array.isArray(data) ? [...data] : { ...data },
36402
36361
  headers: { Authorization: token }
36403
36362
  };
36404
- const newInfo = __spreadValues({}, info);
36363
+ const newInfo = { ...info };
36405
36364
  newInfo[key].state = "loading";
36406
36365
  newInfo[key].errorMessage = "";
36407
36366
  setInfo(newInfo);
@@ -36410,12 +36369,12 @@ function useResources({
36410
36369
  const d = consulta.data;
36411
36370
  newInfo[key].state = "success";
36412
36371
  newInfo[key].errorMessage = "";
36413
- newInfo[key].selectedItem = __spreadValues(__spreadValues({}, newInfo[key].selectedItem), d);
36414
- const index = (_b = (_a = newInfo[key]) == null ? void 0 : _a.data) == null ? void 0 : _b.findIndex(
36372
+ newInfo[key].selectedItem = { ...newInfo[key].selectedItem, ...d };
36373
+ const index = (_b2 = (_a2 = newInfo[key]) == null ? void 0 : _a2.data) == null ? void 0 : _b2.findIndex(
36415
36374
  (d2) => (d2 == null ? void 0 : d2.id) == id
36416
36375
  );
36417
36376
  if (index >= 0) {
36418
- newInfo[key].data[index] = __spreadValues(__spreadValues({}, newInfo[key].data[index]), d);
36377
+ newInfo[key].data[index] = { ...newInfo[key].data[index], ...d };
36419
36378
  } else {
36420
36379
  if ((_c2 = newInfo[key]) == null ? void 0 : _c2.data) {
36421
36380
  newInfo[key].data.unshift(d);
@@ -36423,27 +36382,27 @@ function useResources({
36423
36382
  newInfo[key].data = [d];
36424
36383
  }
36425
36384
  }
36426
- setInfo(__spreadValues({}, newInfo));
36385
+ setInfo({ ...newInfo });
36427
36386
  return d;
36428
36387
  } catch (error) {
36429
36388
  const item = http_codes_default.find((s) => s.code == error.status);
36430
36389
  newInfo[key].state = "error";
36431
36390
  newInfo[key].errorMessage = (item == null ? void 0 : item.meaning) || error.message;
36432
36391
  if (error.status == 403) {
36433
- onError == null ? void 0 : onError(__spreadValues({ error }, { errorMessage: item == null ? void 0 : item.meaning }));
36392
+ onError == null ? void 0 : onError({ error, ...{ errorMessage: item == null ? void 0 : item.meaning } });
36434
36393
  }
36435
- setInfo(__spreadValues({}, newInfo));
36394
+ setInfo({ ...newInfo });
36436
36395
  return error;
36437
36396
  }
36438
36397
  },
36439
36398
  remove: async (id) => {
36440
- var _a, _b;
36399
+ var _a2, _b2;
36441
36400
  const options = {
36442
36401
  method: "DELETE",
36443
36402
  url: `${baseURI}/${key}/${id}`,
36444
36403
  headers: { Authorization: token }
36445
36404
  };
36446
- const newInfo = __spreadValues({}, info);
36405
+ const newInfo = { ...info };
36447
36406
  newInfo[key].state = "loading";
36448
36407
  newInfo[key].errorMessage = "";
36449
36408
  setInfo(newInfo);
@@ -36453,32 +36412,32 @@ function useResources({
36453
36412
  newInfo[key].state = "success";
36454
36413
  newInfo[key].errorMessage = "";
36455
36414
  newInfo[key].selectedItem = d;
36456
- const index = (_b = (_a = newInfo[key]) == null ? void 0 : _a.data) == null ? void 0 : _b.findIndex(
36415
+ const index = (_b2 = (_a2 = newInfo[key]) == null ? void 0 : _a2.data) == null ? void 0 : _b2.findIndex(
36457
36416
  (d2) => (d2 == null ? void 0 : d2.id) == id
36458
36417
  );
36459
36418
  if (index >= 0) {
36460
36419
  newInfo[key].data.splice(index, 1);
36461
36420
  }
36462
- setInfo(__spreadValues({}, newInfo));
36421
+ setInfo({ ...newInfo });
36463
36422
  return d.data;
36464
36423
  } catch (error) {
36465
36424
  const item = http_codes_default.find((s) => s.code == error.status);
36466
36425
  newInfo[key].state = "error";
36467
36426
  newInfo[key].errorMessage = (item == null ? void 0 : item.meaning) || error.message;
36468
36427
  if (error.status == 403) {
36469
- onError == null ? void 0 : onError(__spreadValues({ error }, { errorMessage: item == null ? void 0 : item.meaning }));
36428
+ onError == null ? void 0 : onError({ error, ...{ errorMessage: item == null ? void 0 : item.meaning } });
36470
36429
  }
36471
- setInfo(__spreadValues({}, newInfo));
36430
+ setInfo({ ...newInfo });
36472
36431
  return error;
36473
36432
  }
36474
36433
  },
36475
- totalPages: (_c = info[key]) == null ? void 0 : _c.totalPages,
36476
- currentPage: (_d = info[key]) == null ? void 0 : _d.currentPage,
36477
- state: ((_e = info[key]) == null ? void 0 : _e.state) || "success",
36478
- errorMessage: (_f = info[key]) == null ? void 0 : _f.errorMessage,
36479
- params: (_g = info[key]) == null ? void 0 : _g.params,
36434
+ totalPages: (_a = info[key]) == null ? void 0 : _a.totalPages,
36435
+ currentPage: (_b = info[key]) == null ? void 0 : _b.currentPage,
36436
+ state: ((_c = info[key]) == null ? void 0 : _c.state) || "success",
36437
+ errorMessage: (_d = info[key]) == null ? void 0 : _d.errorMessage,
36438
+ params: (_e = info[key]) == null ? void 0 : _e.params,
36480
36439
  setLoaded: () => {
36481
- const newInfo = __spreadValues({}, info);
36440
+ const newInfo = { ...info };
36482
36441
  newInfo[key].loaded = true;
36483
36442
  setInfo(newInfo);
36484
36443
  },
@@ -36498,16 +36457,16 @@ function useResources({
36498
36457
  currentPage = currentInfo.currentPage || currentPage + 1;
36499
36458
  totalPages = currentInfo.totalPages || currentPage;
36500
36459
  }
36501
- const newInfo = __spreadValues({}, info);
36460
+ const newInfo = { ...info };
36502
36461
  newInfo[key].data = allData;
36503
36462
  newInfo[key].currentPage = currentPage;
36504
36463
  newInfo[key].totalPages = totalPages;
36505
36464
  setInfo(newInfo);
36506
36465
  return allData;
36507
36466
  },
36508
- data: ((_h = info[key]) == null ? void 0 : _h.data) || [],
36509
- selectedItem: ((_i = info[key]) == null ? void 0 : _i.selectedItem) || {}
36510
- });
36467
+ data: ((_f = info[key]) == null ? void 0 : _f.data) || [],
36468
+ selectedItem: ((_g = info[key]) == null ? void 0 : _g.selectedItem) || {}
36469
+ };
36511
36470
  return acc;
36512
36471
  },
36513
36472
  {}
@@ -36574,18 +36533,13 @@ function CloseIcon() {
36574
36533
 
36575
36534
  // src/select/index.tsx
36576
36535
  var import_jsx_runtime11 = require("react/jsx-runtime");
36577
- function Select(_a) {
36578
- var _b = _a, {
36579
- label,
36580
- placeholder = "Selecciona...",
36581
- children,
36582
- strictMode = true
36583
- } = _b, props = __objRest(_b, [
36584
- "label",
36585
- "placeholder",
36586
- "children",
36587
- "strictMode"
36588
- ]);
36536
+ function Select({
36537
+ label,
36538
+ placeholder = "Selecciona...",
36539
+ children,
36540
+ strictMode = true,
36541
+ ...props
36542
+ }) {
36589
36543
  const [isOpen, setIsOpen] = (0, import_react8.useState)(false);
36590
36544
  const [inputValue, setInputValue] = (0, import_react8.useState)("");
36591
36545
  const [options, setOptions] = (0, import_react8.useState)(
@@ -36602,7 +36556,7 @@ function Select(_a) {
36602
36556
  };
36603
36557
  const normalize = (str) => str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z]/g, "");
36604
36558
  (0, import_react8.useEffect)(() => {
36605
- var _a2;
36559
+ var _a;
36606
36560
  const parsedOptions = import_react8.default.Children.toArray(children).filter((child) => {
36607
36561
  return child.type === "option";
36608
36562
  }).map((child) => {
@@ -36613,7 +36567,7 @@ function Select(_a) {
36613
36567
  });
36614
36568
  setOptions(parsedOptions);
36615
36569
  setFiltered(parsedOptions);
36616
- const value = (props == null ? void 0 : props.value) && ((_a2 = parsedOptions.find((opt) => opt.value == props.value)) == null ? void 0 : _a2.label);
36570
+ const value = (props == null ? void 0 : props.value) && ((_a = parsedOptions.find((opt) => opt.value == props.value)) == null ? void 0 : _a.label);
36617
36571
  setInputValue(value);
36618
36572
  }, [children]);
36619
36573
  (0, import_react8.useEffect)(() => {
@@ -36667,10 +36621,10 @@ function Select(_a) {
36667
36621
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative", children: [
36668
36622
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
36669
36623
  "input",
36670
- __spreadProps(__spreadValues({
36624
+ {
36671
36625
  autoComplete: "off",
36672
- ref: inputRef
36673
- }, props), {
36626
+ ref: inputRef,
36627
+ ...props,
36674
36628
  className: [
36675
36629
  "p-2 w-full rounded border shadow",
36676
36630
  props == null ? void 0 : props.className
@@ -36678,13 +36632,13 @@ function Select(_a) {
36678
36632
  value: inputValue,
36679
36633
  onBlur: (e) => {
36680
36634
  setTimeout(() => {
36681
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
36635
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
36682
36636
  const item = validOption(e.target.value);
36683
36637
  if (!item) {
36684
36638
  if (strictMode) {
36685
36639
  e.target.value = "";
36686
36640
  setInputValue("");
36687
- (_c = (_b2 = (_a2 = e.target) == null ? void 0 : _a2.classList) == null ? void 0 : _b2.remove) == null ? void 0 : _c.call(_b2, "bg-green-200");
36641
+ (_c = (_b = (_a = e.target) == null ? void 0 : _a.classList) == null ? void 0 : _b.remove) == null ? void 0 : _c.call(_b, "bg-green-200");
36688
36642
  (_f = (_e = (_d = e.target) == null ? void 0 : _d.classList) == null ? void 0 : _e.add) == null ? void 0 : _f.call(_e, "bg-red-200");
36689
36643
  return;
36690
36644
  }
@@ -36702,18 +36656,18 @@ function Select(_a) {
36702
36656
  placeholder,
36703
36657
  onFocus: () => setIsOpen(true),
36704
36658
  onKeyDown: handleKeyDown
36705
- })
36659
+ }
36706
36660
  ),
36707
36661
  !isOpen && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute top-0 right-0 flex flex-col justify-center items-center px-2 py-2 font-bold", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectIcon, {}) }),
36708
36662
  isOpen && inputValue != "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
36709
36663
  "button",
36710
36664
  {
36711
36665
  onClick: (e) => {
36712
- var _a2, _b2, _c, _d, _e, _f;
36666
+ var _a, _b, _c, _d, _e, _f;
36713
36667
  setIsOpen(true);
36714
36668
  setInputValue("");
36715
36669
  if ((inputRef == null ? void 0 : inputRef.current) && strictMode) {
36716
- (_c = (_b2 = (_a2 = inputRef.current) == null ? void 0 : _a2.classList) == null ? void 0 : _b2.remove) == null ? void 0 : _c.call(_b2, "bg-green-200");
36670
+ (_c = (_b = (_a = inputRef.current) == null ? void 0 : _a.classList) == null ? void 0 : _b.remove) == null ? void 0 : _c.call(_b, "bg-green-200");
36717
36671
  (_f = (_e = (_d = inputRef.current) == null ? void 0 : _d.classList) == null ? void 0 : _e.add) == null ? void 0 : _f.call(_e, "bg-red-200");
36718
36672
  inputRef.current.focus();
36719
36673
  }
@@ -36733,9 +36687,9 @@ function Select(_a) {
36733
36687
  {
36734
36688
  className: `p-2 cursor-pointer ${index === highlightedIndex ? "bg-blue-100" : "hover:bg-gray-100"}`,
36735
36689
  onClick: () => {
36736
- var _a2;
36690
+ var _a;
36737
36691
  try {
36738
- (_a2 = props == null ? void 0 : props.onChange) == null ? void 0 : _a2.call(props, {
36692
+ (_a = props == null ? void 0 : props.onChange) == null ? void 0 : _a.call(props, {
36739
36693
  target: { value: (opt == null ? void 0 : opt.value) || opt.label }
36740
36694
  });
36741
36695
  } catch (error) {
@@ -36814,13 +36768,14 @@ function Modal({ button, children, ref, title = "" }) {
36814
36768
  import_react9.default.Children.map(button, (child) => {
36815
36769
  if (import_react9.default.isValidElement(child)) {
36816
36770
  const { type, props } = child;
36817
- return import_react9.default.createElement(type, __spreadProps(__spreadValues({}, props), {
36771
+ return import_react9.default.createElement(type, {
36772
+ ...props,
36818
36773
  onClick: (e) => {
36819
36774
  var _a, _b;
36820
36775
  show();
36821
36776
  (_b = (_a = child.props) == null ? void 0 : _a.onClick) == null ? void 0 : _b.call(_a, e);
36822
36777
  }
36823
- }));
36778
+ });
36824
36779
  }
36825
36780
  return child;
36826
36781
  }),
@@ -36837,7 +36792,7 @@ function Modal({ button, children, ref, title = "" }) {
36837
36792
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-col gap-3 pt-6", children: import_react9.default.Children.map(children, (child) => {
36838
36793
  if (import_react9.default.isValidElement(child)) {
36839
36794
  const { type, props } = child;
36840
- return import_react9.default.createElement(type, __spreadProps(__spreadValues({}, props), { hide }));
36795
+ return import_react9.default.createElement(type, { ...props, hide });
36841
36796
  }
36842
36797
  return child;
36843
36798
  }) })
@@ -36916,40 +36871,29 @@ function CalendarIcon() {
36916
36871
  }
36917
36872
 
36918
36873
  // src/calendar/index.tsx
36874
+ var import_material4 = require("@mui/material");
36919
36875
  var import_jsx_runtime16 = require("react/jsx-runtime");
36920
- function MyCalendar(_a) {
36921
- var _b = _a, {
36922
- enabledDates,
36923
- onChange,
36924
- defaultValue = "",
36925
- className = "",
36926
- label = "",
36927
- value
36928
- } = _b, otherProps = __objRest(_b, [
36929
- "enabledDates",
36930
- "onChange",
36931
- "defaultValue",
36932
- "className",
36933
- "label",
36934
- "value"
36935
- ]);
36936
- const modalRef = (0, import_react10.useRef)(null);
36876
+ function MyCalendar({
36877
+ enabledDates,
36878
+ onChange,
36879
+ defaultValue = "",
36880
+ className = "",
36881
+ label = "",
36882
+ value,
36883
+ ...otherProps
36884
+ }) {
36937
36885
  const [selectedDate, setSelectedDate] = (0, import_react10.useState)(null);
36938
36886
  const [dateStr, setDateStr] = (0, import_react10.useState)(
36939
36887
  defaultValue || value || ""
36940
36888
  );
36941
- const [visible, setVisible] = (0, import_react10.useState)(false);
36942
- (0, import_react10.useEffect)(() => {
36943
- setVisible(typeof window !== "undefined");
36944
- }, []);
36889
+ const [open, setOpen] = (0, import_react10.useState)(false);
36945
36890
  function handleChange(date) {
36946
- var _a2, _b2;
36947
36891
  if (!date) return;
36948
36892
  setSelectedDate(date);
36949
36893
  const formattedDate = date.toISOString().split("T")[0];
36950
36894
  setDateStr(formattedDate);
36951
36895
  onChange == null ? void 0 : onChange({ target: { value: formattedDate } });
36952
- (_b2 = (_a2 = modalRef.current) == null ? void 0 : _a2.close) == null ? void 0 : _b2.call(_a2);
36896
+ setOpen(false);
36953
36897
  }
36954
36898
  const normalizedEnabledDates = enabledDates.map((item) => {
36955
36899
  if (item instanceof Date) return item;
@@ -36969,15 +36913,13 @@ function MyCalendar(_a) {
36969
36913
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
36970
36914
  "div",
36971
36915
  {
36972
- onClick: () => {
36973
- var _a2, _b2;
36974
- return (_b2 = (_a2 = modalRef == null ? void 0 : modalRef.current) == null ? void 0 : _a2.showModal) == null ? void 0 : _b2.call(_a2);
36975
- },
36976
36916
  className: "cursor-pointer flex items-center justify-center",
36917
+ onClick: (e) => setOpen(true),
36977
36918
  children: [
36978
36919
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
36979
36920
  "input",
36980
- __spreadProps(__spreadValues({}, otherProps), {
36921
+ {
36922
+ ...otherProps,
36981
36923
  className: [
36982
36924
  "p-2 w-full rounded border shadow cursor-pointer",
36983
36925
  className
@@ -36987,36 +36929,32 @@ function MyCalendar(_a) {
36987
36929
  return;
36988
36930
  },
36989
36931
  readOnly: true
36990
- })
36932
+ }
36991
36933
  ),
36992
36934
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "absolute", style: { right: "10px" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CalendarIcon, {}) })
36993
36935
  ]
36994
36936
  }
36995
36937
  ) })
36996
36938
  ] }),
36997
- visible && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
36998
- "dialog",
36999
- {
37000
- ref: modalRef,
37001
- id: "my-calendar-modal-item",
37002
- onClick: (e) => {
37003
- var _a2;
37004
- const el = e.target;
37005
- if ((el == null ? void 0 : el.id) === "my-calendar-modal-item") {
37006
- (_a2 = modalRef.current) == null ? void 0 : _a2.close();
37007
- }
37008
- },
37009
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: " w-[300px] flex items-start justify-center h-[300px] p-5", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
37010
- import_react_datepicker.default,
37011
- {
37012
- inline: true,
37013
- selected: selectedDate,
37014
- onChange: handleChange,
37015
- includeDates: normalizedEnabledDates
37016
- }
37017
- ) })
37018
- }
37019
- )
36939
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_material4.Dialog, { open, children: [
36940
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex justify-end p-5 font-bold", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
36941
+ "button",
36942
+ {
36943
+ className: " border-lg w-[20px] bg-red-500 text-white shadow rounded",
36944
+ onClick: (e) => setOpen(false),
36945
+ children: "x"
36946
+ }
36947
+ ) }),
36948
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: " w-[300px] flex items-start justify-center h-[300px] p-5", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
36949
+ import_react_datepicker.default,
36950
+ {
36951
+ inline: true,
36952
+ selected: selectedDate,
36953
+ onChange: handleChange,
36954
+ includeDates: normalizedEnabledDates
36955
+ }
36956
+ ) })
36957
+ ] })
37020
36958
  ] });
37021
36959
  }
37022
36960
 
@@ -37302,13 +37240,14 @@ function Filter({
37302
37240
  "div",
37303
37241
  {
37304
37242
  onClick: (e) => {
37305
- const newSort = __spreadValues({}, sort);
37243
+ const newSort = { ...sort };
37306
37244
  newSort[h] = "asc";
37307
- const reorderedSort = __spreadValues({
37308
- [h]: "asc"
37309
- }, Object.fromEntries(
37310
- Object.entries(newSort).filter(([key]) => key !== h)
37311
- ));
37245
+ const reorderedSort = {
37246
+ [h]: "asc",
37247
+ ...Object.fromEntries(
37248
+ Object.entries(newSort).filter(([key]) => key !== h)
37249
+ )
37250
+ };
37312
37251
  setSort(reorderedSort);
37313
37252
  setVisible(false);
37314
37253
  },
@@ -37323,13 +37262,14 @@ function Filter({
37323
37262
  "div",
37324
37263
  {
37325
37264
  onClick: (e) => {
37326
- const newSort = __spreadValues({}, sort);
37265
+ const newSort = { ...sort };
37327
37266
  newSort[h] = "desc";
37328
- const reorderedSort = __spreadValues({
37329
- [h]: "desc"
37330
- }, Object.fromEntries(
37331
- Object.entries(newSort).filter(([key]) => key !== h)
37332
- ));
37267
+ const reorderedSort = {
37268
+ [h]: "desc",
37269
+ ...Object.fromEntries(
37270
+ Object.entries(newSort).filter(([key]) => key !== h)
37271
+ )
37272
+ };
37333
37273
  setSort(reorderedSort);
37334
37274
  setVisible(false);
37335
37275
  },
@@ -37572,45 +37512,53 @@ function TR({
37572
37512
  return null;
37573
37513
  } else if (handlers == null ? void 0 : handlers[h]) {
37574
37514
  const original = handlers[h];
37575
- const cloned = import_react12.default.cloneElement(original, __spreadValues(__spreadValues({
37515
+ const cloned = import_react12.default.cloneElement(original, {
37576
37516
  // si es controlado por value → actualiza con row[h]
37577
37517
  value: ((_a = original.props) == null ? void 0 : _a.value) !== void 0 ? row[h] : void 0,
37578
37518
  // si usa children → actualiza con row[h] también
37579
- children: ((_b = original.props) == null ? void 0 : _b.children) ? typeof original.props.children == "object" ? (_c = original.props) == null ? void 0 : _c.children : row == null ? void 0 : row[h] : null
37580
- }, original.props.hasOwnProperty("row") ? {
37581
- row,
37582
- updateRow: (finalResponse) => setObjectData(__spreadValues(__spreadValues({}, (row == null ? void 0 : row._id) ? {
37583
- _id: row == null ? void 0 : row._id,
37584
- _updated: true,
37585
- _visible: true
37586
- } : {
37587
- id: (row == null ? void 0 : row.id) || null,
37588
- _updated: true,
37589
- _visible: true
37590
- }), finalResponse))
37591
- } : {}), Object.keys(__spreadProps(__spreadValues({}, original.props), {
37592
- onChange: (_d = original.props) == null ? void 0 : _d.onChange
37593
- })).filter((action) => action.startsWith("on")).reduce((acc, action) => {
37594
- acc[action] = (e) => {
37595
- var _a2, _b2;
37596
- e.row = row;
37597
- const userResponse = ((_b2 = (_a2 = original.props) == null ? void 0 : _a2[action]) == null ? void 0 : _b2.call(_a2, e)) || {};
37598
- const newObject = (row == null ? void 0 : row._id) ? __spreadValues({
37599
- _id: row == null ? void 0 : row._id,
37600
- [h]: e.target.value,
37601
- _updated: true,
37602
- _visible: true
37603
- }, userResponse) : __spreadValues({
37604
- id: (row == null ? void 0 : row.id) || null,
37605
- [h]: e.target.value,
37606
- _updated: true,
37607
- _visible: true
37608
- }, userResponse);
37609
- const finalResponse = action == "onChange" && onChange ? onChange(__spreadProps(__spreadValues({}, e), { row: __spreadValues(__spreadValues({}, e.row), newObject) })) : {};
37610
- setObjectData(__spreadValues(__spreadValues({}, newObject), finalResponse));
37611
- };
37612
- return acc;
37613
- }, {})));
37519
+ children: ((_b = original.props) == null ? void 0 : _b.children) ? typeof original.props.children == "object" ? (_c = original.props) == null ? void 0 : _c.children : row == null ? void 0 : row[h] : null,
37520
+ ...original.props.hasOwnProperty("row") ? {
37521
+ row,
37522
+ updateRow: (finalResponse) => setObjectData({
37523
+ ...(row == null ? void 0 : row._id) ? {
37524
+ _id: row == null ? void 0 : row._id,
37525
+ _updated: true,
37526
+ _visible: true
37527
+ } : {
37528
+ id: (row == null ? void 0 : row.id) || null,
37529
+ _updated: true,
37530
+ _visible: true
37531
+ },
37532
+ ...finalResponse
37533
+ })
37534
+ } : {},
37535
+ ...Object.keys({
37536
+ ...original.props,
37537
+ onChange: (_d = original.props) == null ? void 0 : _d.onChange
37538
+ }).filter((action) => action.startsWith("on")).reduce((acc, action) => {
37539
+ acc[action] = (e) => {
37540
+ var _a2, _b2;
37541
+ e.row = row;
37542
+ const userResponse = ((_b2 = (_a2 = original.props) == null ? void 0 : _a2[action]) == null ? void 0 : _b2.call(_a2, e)) || {};
37543
+ const newObject = (row == null ? void 0 : row._id) ? {
37544
+ _id: row == null ? void 0 : row._id,
37545
+ [h]: e.target.value,
37546
+ _updated: true,
37547
+ _visible: true,
37548
+ ...userResponse
37549
+ } : {
37550
+ id: (row == null ? void 0 : row.id) || null,
37551
+ [h]: e.target.value,
37552
+ _updated: true,
37553
+ _visible: true,
37554
+ ...userResponse
37555
+ };
37556
+ const finalResponse = action == "onChange" && onChange ? onChange({ ...e, row: { ...e.row, ...newObject } }) : {};
37557
+ setObjectData({ ...newObject, ...finalResponse });
37558
+ };
37559
+ return acc;
37560
+ }, {})
37561
+ });
37614
37562
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: `text-black `, children: cloned }, h);
37615
37563
  }
37616
37564
  return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: `text-center border max-w-[${colSize}px] `, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-1 w-full", children: [
@@ -37672,24 +37620,26 @@ function TableBody({
37672
37620
  const row = objectData[id];
37673
37621
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
37674
37622
  TR,
37675
- __spreadValues({}, {
37676
- headers,
37677
- index,
37678
- setObjectData,
37679
- id,
37680
- row,
37681
- handlers,
37682
- selectItems,
37683
- colSizes,
37684
- modal,
37685
- modalRef,
37686
- dialogRow,
37687
- symbols,
37688
- setDialogRow,
37689
- setSelected,
37690
- selected,
37691
- onChange
37692
- }),
37623
+ {
37624
+ ...{
37625
+ headers,
37626
+ index,
37627
+ setObjectData,
37628
+ id,
37629
+ row,
37630
+ handlers,
37631
+ selectItems,
37632
+ colSizes,
37633
+ modal,
37634
+ modalRef,
37635
+ dialogRow,
37636
+ symbols,
37637
+ setDialogRow,
37638
+ setSelected,
37639
+ selected,
37640
+ onChange
37641
+ }
37642
+ },
37693
37643
  id
37694
37644
  );
37695
37645
  });
@@ -37731,7 +37681,7 @@ function Panel({
37731
37681
  onClick: (e) => {
37732
37682
  excel.export(
37733
37683
  Object.values(objectData).reverse().map((d) => {
37734
- const _a = d, { _visible, _id, _selected } = _a, data = __objRest(_a, ["_visible", "_id", "_selected"]);
37684
+ const { _visible, _id, _selected, ...data } = d;
37735
37685
  return data;
37736
37686
  }),
37737
37687
  exportName + ".xlsx"
@@ -37820,7 +37770,7 @@ function TableFooter({
37820
37770
  // src/table3/dialog.tsx
37821
37771
  var import_react14 = __toESM(require("react"));
37822
37772
  var import_jsx_runtime26 = require("react/jsx-runtime");
37823
- function Dialog3({
37773
+ function Dialog4({
37824
37774
  modalRef,
37825
37775
  children,
37826
37776
  dialogRow,
@@ -37872,73 +37822,64 @@ function Dialog3({
37872
37822
  }
37873
37823
  );
37874
37824
  }
37875
- var dialog_default = Dialog3;
37825
+ var dialog_default = Dialog4;
37876
37826
 
37877
37827
  // src/table3/index.tsx
37878
37828
  var import_jsx_runtime27 = require("react/jsx-runtime");
37879
- function Table3(_a) {
37880
- var _b = _a, {
37881
- data,
37882
- selectItems,
37883
- maxItems = Infinity,
37884
- onSave,
37885
- exportName,
37886
- colSizes,
37887
- modal,
37888
- header,
37889
- footer,
37890
- onChange,
37891
- symbols,
37892
- sortBy
37893
- } = _b, props = __objRest(_b, [
37894
- "data",
37895
- "selectItems",
37896
- "maxItems",
37897
- "onSave",
37898
- "exportName",
37899
- "colSizes",
37900
- "modal",
37901
- "header",
37902
- "footer",
37903
- "onChange",
37904
- "symbols",
37905
- "sortBy"
37906
- ]);
37829
+ function Table3({
37830
+ data,
37831
+ selectItems,
37832
+ maxItems = Infinity,
37833
+ onSave,
37834
+ exportName,
37835
+ colSizes,
37836
+ modal,
37837
+ header,
37838
+ footer,
37839
+ onChange,
37840
+ symbols,
37841
+ sortBy,
37842
+ ...props
37843
+ }) {
37907
37844
  const [handlers, setHandlers] = (0, import_react15.useState)({});
37908
37845
  const [page, setPage] = (0, import_react15.useState)(1);
37909
37846
  function dataReducer(a, b) {
37910
37847
  if (b == null) return {};
37911
37848
  if (Array.isArray(b)) {
37912
37849
  const obj = b.reduce((acc, bb) => {
37913
- var _a2, _b2, _c, _d, _e, _f, _g;
37850
+ var _a, _b, _c, _d, _e, _f, _g;
37914
37851
  const id = (bb == null ? void 0 : bb.id) || (bb == null ? void 0 : bb._id);
37915
37852
  if (!id) throw new Error("Se necesita el id o _id");
37916
- const cc = ((_a2 = a == null ? void 0 : a[id]) == null ? void 0 : _a2._updated) ? __spreadProps(__spreadValues(__spreadValues({}, bb), a == null ? void 0 : a[id]), {
37853
+ const cc = ((_a = a == null ? void 0 : a[id]) == null ? void 0 : _a._updated) ? {
37854
+ ...bb,
37855
+ ...a == null ? void 0 : a[id],
37917
37856
  _selected: bb == null ? void 0 : bb._selected,
37918
37857
  _visible: (bb == null ? void 0 : bb._visible) == false ? false : true
37919
- }) : __spreadProps(__spreadValues(__spreadValues({}, a == null ? void 0 : a[id]), bb), {
37858
+ } : {
37859
+ ...a == null ? void 0 : a[id],
37860
+ ...bb,
37920
37861
  _selected: bb == null ? void 0 : bb._selected,
37921
37862
  _visible: (bb == null ? void 0 : bb._visible) == false ? false : true
37922
- });
37923
- const newHandlers = __spreadValues({}, handlers);
37863
+ };
37864
+ const newHandlers = { ...handlers };
37924
37865
  for (let item in cc) {
37925
37866
  const isReactComponent = import_react15.default.isValidElement(cc[item]);
37926
37867
  if (isReactComponent) {
37927
37868
  newHandlers[item] = cc[item];
37928
- const value = ((_c = (_b2 = cc[item]) == null ? void 0 : _b2.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 : "");
37869
+ 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 : "");
37929
37870
  cc[item] = value || "";
37930
37871
  }
37931
37872
  }
37932
37873
  setHandlers(newHandlers);
37933
- acc[id] = __spreadValues(__spreadValues({}, bb), cc);
37874
+ acc[id] = { ...bb, ...cc };
37934
37875
  return acc;
37935
37876
  }, {});
37936
37877
  return obj;
37937
37878
  } else {
37938
- const newA = __spreadValues({}, a);
37879
+ const newA = { ...a };
37939
37880
  const id = (b == null ? void 0 : b.id) || (b == null ? void 0 : b._id);
37940
37881
  if (!id) throw new Error("Se necesita el id o _id para actualizar");
37941
- newA[id] = __spreadValues(__spreadValues({}, newA[id]), b);
37882
+ newA[id] = { ...newA[id], ...b };
37942
37883
  return newA;
37943
37884
  }
37944
37885
  }
@@ -37962,7 +37903,7 @@ function Table3(_a) {
37962
37903
  const [sort, setSort] = (0, import_react15.useState)(sortBy);
37963
37904
  const modalRef = (0, import_react15.useRef)(null);
37964
37905
  const [dialogRow, setDialogRow] = (0, import_react15.useState)({});
37965
- const context = __spreadValues({
37906
+ const context = {
37966
37907
  objectData,
37967
37908
  headers,
37968
37909
  handlers,
@@ -37985,15 +37926,16 @@ function Table3(_a) {
37985
37926
  data,
37986
37927
  symbols,
37987
37928
  sort,
37988
- setSort
37989
- }, props);
37929
+ setSort,
37930
+ ...props
37931
+ };
37990
37932
  (0, import_react15.useEffect)(() => {
37991
37933
  if ((dialogRow == null ? void 0 : dialogRow.id) || (dialogRow == null ? void 0 : dialogRow._id)) {
37992
37934
  const newDialogRow = objectData[dialogRow == null ? void 0 : dialogRow.id] || objectData[dialogRow == null ? void 0 : dialogRow._id];
37993
37935
  setDialogRow(newDialogRow);
37994
37936
  }
37995
37937
  }, [objectData]);
37996
- const style = (props == null ? void 0 : props.style) ? __spreadProps(__spreadValues({}, props.style), { tableLayout: "fixed" }) : { tableLayout: "fixed" };
37938
+ const style = (props == null ? void 0 : props.style) ? { ...props.style, tableLayout: "fixed" } : { tableLayout: "fixed" };
37997
37939
  if (!objectData) return null;
37998
37940
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "border shadow rounded m-1 p-1 bg-white", children: [
37999
37941
  modal && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
@@ -38007,12 +37949,12 @@ function Table3(_a) {
38007
37949
  }
38008
37950
  ),
38009
37951
  header && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "font-bold text-2xl py-5 px-2 bg-blue-50", children: header }),
38010
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Panel, __spreadValues({}, context)),
38011
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("table", __spreadProps(__spreadValues({}, props), { style, children: [
38012
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TableHead, __spreadValues({}, context)),
38013
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TableBody, __spreadValues({}, context)),
38014
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TableFooter, __spreadValues({}, context))
38015
- ] }))
37952
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Panel, { ...context }),
37953
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("table", { ...props, style, children: [
37954
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TableHead, { ...context }),
37955
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TableBody, { ...context }),
37956
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TableFooter, { ...context })
37957
+ ] })
38016
37958
  ] });
38017
37959
  }
38018
37960
  // Annotate the CommonJS export names for ESM import in node: