next-recomponents 1.9.98 → 2.0.0

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
@@ -35753,6 +35753,21 @@ function Table(props) {
35753
35753
  ] }, k)) }) }) });
35754
35754
  }
35755
35755
  }
35756
+ function EditIcon() {
35757
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
35758
+ "svg",
35759
+ {
35760
+ stroke: "currentColor",
35761
+ fill: "currentColor",
35762
+ strokeWidth: "0",
35763
+ viewBox: "0 0 576 512",
35764
+ height: "20px",
35765
+ width: "20px",
35766
+ xmlns: "http://www.w3.org/2000/svg",
35767
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.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" })
35768
+ }
35769
+ );
35770
+ }
35756
35771
  function IHTable({
35757
35772
  data,
35758
35773
  flex = 1,
@@ -35770,7 +35785,7 @@ function IHTable({
35770
35785
  }) {
35771
35786
  const [open, setOpen] = (0, import_react4.useState)(false);
35772
35787
  if (modal) {
35773
- buttons = __spreadProps(__spreadValues({}, buttons), { Modal: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { children: "Editar" }) });
35788
+ buttons = __spreadProps(__spreadValues({}, buttons), { Modal: "" });
35774
35789
  }
35775
35790
  const handleOpen = () => setOpen(true);
35776
35791
  const handleClose = () => {
@@ -35816,16 +35831,20 @@ function IHTable({
35816
35831
  flex,
35817
35832
  editable: false,
35818
35833
  type: "string",
35819
- renderCell: (params) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
35820
- Button,
35821
- {
35822
- className: "text-xs",
35823
- onClick: () => {
35824
- handleOpen();
35825
- },
35826
- children: "Editar"
35827
- }
35828
- )
35834
+ renderCell: (params) => {
35835
+ var _a;
35836
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
35837
+ Button,
35838
+ {
35839
+ className: "text-xs",
35840
+ onClick: () => {
35841
+ handleOpen();
35842
+ },
35843
+ icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EditIcon, {}),
35844
+ children: (_a = params == null ? void 0 : params.row) == null ? void 0 : _a["Modal"]
35845
+ }
35846
+ );
35847
+ }
35829
35848
  });
35830
35849
  }
35831
35850
  return arr;
@@ -37134,7 +37153,7 @@ function OrderAsc() {
37134
37153
  }
37135
37154
  );
37136
37155
  }
37137
- function EditIcon() {
37156
+ function EditIcon2() {
37138
37157
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
37139
37158
  "svg",
37140
37159
  {
@@ -37529,7 +37548,7 @@ function TR({
37529
37548
  (_a = modalRef.current) == null ? void 0 : _a.showModal();
37530
37549
  setDialogRow(row);
37531
37550
  },
37532
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(EditIcon, {})
37551
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(EditIcon2, {})
37533
37552
  }
37534
37553
  ) }),
37535
37554
  selectItems && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "border", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
package/dist/index.mjs CHANGED
@@ -35734,6 +35734,21 @@ function Table(props) {
35734
35734
  ] }, k)) }) }) });
35735
35735
  }
35736
35736
  }
35737
+ function EditIcon() {
35738
+ return /* @__PURE__ */ jsx6(
35739
+ "svg",
35740
+ {
35741
+ stroke: "currentColor",
35742
+ fill: "currentColor",
35743
+ strokeWidth: "0",
35744
+ viewBox: "0 0 576 512",
35745
+ height: "20px",
35746
+ width: "20px",
35747
+ xmlns: "http://www.w3.org/2000/svg",
35748
+ children: /* @__PURE__ */ jsx6("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" })
35749
+ }
35750
+ );
35751
+ }
35737
35752
  function IHTable({
35738
35753
  data,
35739
35754
  flex = 1,
@@ -35751,7 +35766,7 @@ function IHTable({
35751
35766
  }) {
35752
35767
  const [open, setOpen] = useState4(false);
35753
35768
  if (modal) {
35754
- buttons = __spreadProps(__spreadValues({}, buttons), { Modal: /* @__PURE__ */ jsx6(Button, { children: "Editar" }) });
35769
+ buttons = __spreadProps(__spreadValues({}, buttons), { Modal: "" });
35755
35770
  }
35756
35771
  const handleOpen = () => setOpen(true);
35757
35772
  const handleClose = () => {
@@ -35797,16 +35812,20 @@ function IHTable({
35797
35812
  flex,
35798
35813
  editable: false,
35799
35814
  type: "string",
35800
- renderCell: (params) => /* @__PURE__ */ jsx6(
35801
- Button,
35802
- {
35803
- className: "text-xs",
35804
- onClick: () => {
35805
- handleOpen();
35806
- },
35807
- children: "Editar"
35808
- }
35809
- )
35815
+ renderCell: (params) => {
35816
+ var _a;
35817
+ return /* @__PURE__ */ jsx6(
35818
+ Button,
35819
+ {
35820
+ className: "text-xs",
35821
+ onClick: () => {
35822
+ handleOpen();
35823
+ },
35824
+ icon: /* @__PURE__ */ jsx6(EditIcon, {}),
35825
+ children: (_a = params == null ? void 0 : params.row) == null ? void 0 : _a["Modal"]
35826
+ }
35827
+ );
35828
+ }
35810
35829
  });
35811
35830
  }
35812
35831
  return arr;
@@ -37131,7 +37150,7 @@ function OrderAsc() {
37131
37150
  }
37132
37151
  );
37133
37152
  }
37134
- function EditIcon() {
37153
+ function EditIcon2() {
37135
37154
  return /* @__PURE__ */ jsx18(
37136
37155
  "svg",
37137
37156
  {
@@ -37526,7 +37545,7 @@ function TR({
37526
37545
  (_a = modalRef.current) == null ? void 0 : _a.showModal();
37527
37546
  setDialogRow(row);
37528
37547
  },
37529
- children: /* @__PURE__ */ jsx21(EditIcon, {})
37548
+ children: /* @__PURE__ */ jsx21(EditIcon2, {})
37530
37549
  }
37531
37550
  ) }),
37532
37551
  selectItems && /* @__PURE__ */ jsx21("th", { className: "border", children: /* @__PURE__ */ jsx21(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "1.9.98",
3
+ "version": "2.0.0",
4
4
  "description": "description nueva",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -64,7 +64,21 @@ export default function Table(props: TableProps) {
64
64
  );
65
65
  }
66
66
  }
67
-
67
+ function EditIcon() {
68
+ return (
69
+ <svg
70
+ stroke="currentColor"
71
+ fill="currentColor"
72
+ strokeWidth="0"
73
+ viewBox="0 0 576 512"
74
+ height="20px"
75
+ width="20px"
76
+ xmlns="http://www.w3.org/2000/svg"
77
+ >
78
+ <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"></path>
79
+ </svg>
80
+ );
81
+ }
68
82
  function IHTable({
69
83
  data,
70
84
  flex = 1,
@@ -82,7 +96,7 @@ function IHTable({
82
96
  }: TableProps) {
83
97
  const [open, setOpen] = useState(false);
84
98
  if (modal) {
85
- buttons = { ...buttons, Modal: <Button>Editar</Button> };
99
+ buttons = { ...buttons, Modal: "" };
86
100
  }
87
101
  const handleOpen = () => setOpen(true);
88
102
  const handleClose = () => {
@@ -140,8 +154,9 @@ function IHTable({
140
154
  onClick={() => {
141
155
  handleOpen();
142
156
  }}
157
+ icon={<EditIcon />}
143
158
  >
144
- Editar
159
+ {params?.row?.["Modal"]}
145
160
  </Button>
146
161
  ) as any,
147
162
  });