next-recomponents 2.0.61 → 2.0.63

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 CHANGED
@@ -114,7 +114,7 @@ interface ItemsRecord<T = any> {
114
114
  defaultParams?: DefaultParams;
115
115
  }
116
116
  interface Props$1<T extends Record<string, ItemsRecord>> {
117
- baseURI: string;
117
+ baseURI?: string;
118
118
  endpoints: T;
119
119
  onError?: (error: any) => void;
120
120
  }
@@ -205,13 +205,13 @@ type Item = {
205
205
  url: string;
206
206
  name: string;
207
207
  contentType: string;
208
- width?: string;
209
- height?: string;
210
208
  };
211
209
  type Props = {
212
210
  item: Item;
211
+ width?: string;
212
+ height?: string;
213
213
  };
214
- declare function DocumentViewer({ item }: Props): react_jsx_runtime.JSX.Element;
214
+ declare function DocumentViewer({ item, width, height, }: Props): react_jsx_runtime.JSX.Element;
215
215
 
216
216
  interface Table3Props<T extends Record<string, any>> extends DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
217
217
  data: T[];
package/dist/index.d.ts CHANGED
@@ -114,7 +114,7 @@ interface ItemsRecord<T = any> {
114
114
  defaultParams?: DefaultParams;
115
115
  }
116
116
  interface Props$1<T extends Record<string, ItemsRecord>> {
117
- baseURI: string;
117
+ baseURI?: string;
118
118
  endpoints: T;
119
119
  onError?: (error: any) => void;
120
120
  }
@@ -205,13 +205,13 @@ type Item = {
205
205
  url: string;
206
206
  name: string;
207
207
  contentType: string;
208
- width?: string;
209
- height?: string;
210
208
  };
211
209
  type Props = {
212
210
  item: Item;
211
+ width?: string;
212
+ height?: string;
213
213
  };
214
- declare function DocumentViewer({ item }: Props): react_jsx_runtime.JSX.Element;
214
+ declare function DocumentViewer({ item, width, height, }: Props): react_jsx_runtime.JSX.Element;
215
215
 
216
216
  interface Table3Props<T extends Record<string, any>> extends DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
217
217
  data: T[];
package/dist/index.js CHANGED
@@ -36342,7 +36342,14 @@ function useResources({
36342
36342
  newInfo[key].loaded = true;
36343
36343
  setInfo(newInfo);
36344
36344
  try {
36345
- const consulta = await import_axios.default.request(options);
36345
+ const consulta = baseURI ? await import_axios.default.request(options) : {
36346
+ data: {
36347
+ data: [],
36348
+ totalItems: 0,
36349
+ totalPages: 1,
36350
+ currentPage: 1
36351
+ }
36352
+ };
36346
36353
  const d = consulta.data;
36347
36354
  newInfo[key].state = "success";
36348
36355
  newInfo[key].errorMessage = "";
@@ -36378,7 +36385,7 @@ function useResources({
36378
36385
  newInfo[key].loaded = true;
36379
36386
  setInfo(newInfo);
36380
36387
  try {
36381
- const consulta = await import_axios.default.request(options);
36388
+ const consulta = baseURI ? await import_axios.default.request(options) : { data: {} };
36382
36389
  const d = consulta.data;
36383
36390
  newInfo[key].state = "success";
36384
36391
  newInfo[key].errorMessage = "";
@@ -36419,7 +36426,7 @@ function useResources({
36419
36426
  newInfo[key].errorMessage = "";
36420
36427
  setInfo(newInfo);
36421
36428
  try {
36422
- const consulta = await import_axios.default.request(options);
36429
+ const consulta = baseURI ? await import_axios.default.request(options) : { data };
36423
36430
  const d = consulta.data;
36424
36431
  newInfo[key].state = "success";
36425
36432
  newInfo[key].errorMessage = "";
@@ -36495,7 +36502,7 @@ function useResources({
36495
36502
  "Content-Type": "multipart/form-data"
36496
36503
  }
36497
36504
  };
36498
- const consulta = await import_axios.default.request(options);
36505
+ const consulta = baseURI ? await import_axios.default.request(options) : { data };
36499
36506
  const d = consulta.data;
36500
36507
  newInfo[key].state = "success";
36501
36508
  newInfo[key].errorMessage = "";
@@ -36570,7 +36577,7 @@ function useResources({
36570
36577
  newInfo[key].errorMessage = "";
36571
36578
  setInfo(newInfo);
36572
36579
  try {
36573
- const consulta = await import_axios.default.request(options);
36580
+ const consulta = baseURI ? await import_axios.default.request(options) : { data };
36574
36581
  const d = consulta.data;
36575
36582
  newInfo[key].state = "success";
36576
36583
  newInfo[key].errorMessage = "";
@@ -36612,7 +36619,7 @@ function useResources({
36612
36619
  newInfo[key].errorMessage = "";
36613
36620
  setInfo(newInfo);
36614
36621
  try {
36615
- const consulta = await import_axios.default.request(options);
36622
+ const consulta = baseURI ? await import_axios.default.request(options) : { data: { state: "success" } };
36616
36623
  const d = consulta.data;
36617
36624
  newInfo[key].state = "success";
36618
36625
  newInfo[key].errorMessage = "";
@@ -37526,20 +37533,49 @@ function Icon() {
37526
37533
  }
37527
37534
  );
37528
37535
  }
37536
+ function DownloadIcon() {
37537
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
37538
+ "svg",
37539
+ {
37540
+ stroke: "currentColor",
37541
+ fill: "currentColor",
37542
+ strokeWidth: "0",
37543
+ viewBox: "0 0 24 24",
37544
+ height: "1em",
37545
+ width: "1em",
37546
+ xmlns: "http://www.w3.org/2000/svg",
37547
+ children: [
37548
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { fill: "none", d: "M0 0h24v24H0z" }),
37549
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5z" })
37550
+ ]
37551
+ }
37552
+ );
37553
+ }
37529
37554
 
37530
37555
  // src/doc-viewer/index.tsx
37531
37556
  var import_jsx_runtime22 = require("react/jsx-runtime");
37532
- function DocumentViewer({ item }) {
37533
- const { url, name, contentType, width = "100%", height = "100%" } = item;
37557
+ function DocumentViewer({
37558
+ item,
37559
+ width = "100%",
37560
+ height = "100%"
37561
+ }) {
37562
+ const { url, name, contentType } = item;
37534
37563
  const isImage = contentType.startsWith("image/");
37535
37564
  const isPdf = contentType === "application/pdf";
37536
37565
  const isGoogleDocCompatible = isPdf || contentType.includes("msword") || contentType.includes("officedocument") || contentType.includes("presentation");
37537
37566
  const viewerUrl = isGoogleDocCompatible ? `https://docs.google.com/gview?url=${encodeURIComponent(
37538
37567
  url
37539
37568
  )}&embedded=true` : url;
37540
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "border shadow rounded p-2 h-[100%]", children: [
37541
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "mb-1 flex justify-between ", children: [
37542
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "font-bold", children: name }),
37569
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "border shadow rounded relative pt-6 pb-1 px-1", children: [
37570
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "grid grid-cols-[3fr_1fr] left-0 rounded-t shadow top-0 absolute p-1 bg-blue-500 px-1 text-white w-full ", children: [
37571
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
37572
+ "h3",
37573
+ {
37574
+ className: "font-bold truncate text-xs px-1 cursor-pointer max-w-[90%] ",
37575
+ title: name,
37576
+ children: name
37577
+ }
37578
+ ),
37543
37579
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
37544
37580
  "a",
37545
37581
  {
@@ -37547,8 +37583,8 @@ function DocumentViewer({ item }) {
37547
37583
  download: name,
37548
37584
  target: "_blank",
37549
37585
  rel: "noopener noreferrer",
37550
- className: "border shadow rounded bg-blue-400 text-white p-2",
37551
- children: "Descargar"
37586
+ className: "border shadow hover:bg-blue-100 hover:text-black rounded bg-blue-900 text-white text-xs items-center truncate px-1 flex gap-1 justify-center",
37587
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DownloadIcon, {})
37552
37588
  }
37553
37589
  )
37554
37590
  ] }),
@@ -37557,6 +37593,7 @@ function DocumentViewer({ item }) {
37557
37593
  {
37558
37594
  src: url,
37559
37595
  alt: name,
37596
+ className: "rounded",
37560
37597
  style: {
37561
37598
  width,
37562
37599
  height,
@@ -37568,14 +37605,20 @@ function DocumentViewer({ item }) {
37568
37605
  ) : isGoogleDocCompatible ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
37569
37606
  "iframe",
37570
37607
  {
37608
+ className: "rounded",
37609
+ style: {
37610
+ width,
37611
+ height,
37612
+ maxWidth: "100%"
37613
+ },
37571
37614
  title: name,
37572
37615
  src: viewerUrl,
37573
- style: { width, height, border: "none" },
37574
37616
  allowFullScreen: true
37575
37617
  }
37576
37618
  ) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
37577
37619
  "div",
37578
37620
  {
37621
+ className: "rounded",
37579
37622
  style: {
37580
37623
  width,
37581
37624
  height,
package/dist/index.mjs CHANGED
@@ -36321,7 +36321,14 @@ function useResources({
36321
36321
  newInfo[key].loaded = true;
36322
36322
  setInfo(newInfo);
36323
36323
  try {
36324
- const consulta = await axios.request(options);
36324
+ const consulta = baseURI ? await axios.request(options) : {
36325
+ data: {
36326
+ data: [],
36327
+ totalItems: 0,
36328
+ totalPages: 1,
36329
+ currentPage: 1
36330
+ }
36331
+ };
36325
36332
  const d = consulta.data;
36326
36333
  newInfo[key].state = "success";
36327
36334
  newInfo[key].errorMessage = "";
@@ -36357,7 +36364,7 @@ function useResources({
36357
36364
  newInfo[key].loaded = true;
36358
36365
  setInfo(newInfo);
36359
36366
  try {
36360
- const consulta = await axios.request(options);
36367
+ const consulta = baseURI ? await axios.request(options) : { data: {} };
36361
36368
  const d = consulta.data;
36362
36369
  newInfo[key].state = "success";
36363
36370
  newInfo[key].errorMessage = "";
@@ -36398,7 +36405,7 @@ function useResources({
36398
36405
  newInfo[key].errorMessage = "";
36399
36406
  setInfo(newInfo);
36400
36407
  try {
36401
- const consulta = await axios.request(options);
36408
+ const consulta = baseURI ? await axios.request(options) : { data };
36402
36409
  const d = consulta.data;
36403
36410
  newInfo[key].state = "success";
36404
36411
  newInfo[key].errorMessage = "";
@@ -36474,7 +36481,7 @@ function useResources({
36474
36481
  "Content-Type": "multipart/form-data"
36475
36482
  }
36476
36483
  };
36477
- const consulta = await axios.request(options);
36484
+ const consulta = baseURI ? await axios.request(options) : { data };
36478
36485
  const d = consulta.data;
36479
36486
  newInfo[key].state = "success";
36480
36487
  newInfo[key].errorMessage = "";
@@ -36549,7 +36556,7 @@ function useResources({
36549
36556
  newInfo[key].errorMessage = "";
36550
36557
  setInfo(newInfo);
36551
36558
  try {
36552
- const consulta = await axios.request(options);
36559
+ const consulta = baseURI ? await axios.request(options) : { data };
36553
36560
  const d = consulta.data;
36554
36561
  newInfo[key].state = "success";
36555
36562
  newInfo[key].errorMessage = "";
@@ -36591,7 +36598,7 @@ function useResources({
36591
36598
  newInfo[key].errorMessage = "";
36592
36599
  setInfo(newInfo);
36593
36600
  try {
36594
- const consulta = await axios.request(options);
36601
+ const consulta = baseURI ? await axios.request(options) : { data: { state: "success" } };
36595
36602
  const d = consulta.data;
36596
36603
  newInfo[key].state = "success";
36597
36604
  newInfo[key].errorMessage = "";
@@ -37495,7 +37502,7 @@ function MyCalendar({
37495
37502
  }
37496
37503
 
37497
37504
  // src/doc-viewer/icon.tsx
37498
- import { jsx as jsx19 } from "react/jsx-runtime";
37505
+ import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
37499
37506
  function Icon() {
37500
37507
  return /* @__PURE__ */ jsx19(
37501
37508
  "svg",
@@ -37511,20 +37518,49 @@ function Icon() {
37511
37518
  }
37512
37519
  );
37513
37520
  }
37521
+ function DownloadIcon() {
37522
+ return /* @__PURE__ */ jsxs12(
37523
+ "svg",
37524
+ {
37525
+ stroke: "currentColor",
37526
+ fill: "currentColor",
37527
+ strokeWidth: "0",
37528
+ viewBox: "0 0 24 24",
37529
+ height: "1em",
37530
+ width: "1em",
37531
+ xmlns: "http://www.w3.org/2000/svg",
37532
+ children: [
37533
+ /* @__PURE__ */ jsx19("path", { fill: "none", d: "M0 0h24v24H0z" }),
37534
+ /* @__PURE__ */ jsx19("path", { d: "M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5z" })
37535
+ ]
37536
+ }
37537
+ );
37538
+ }
37514
37539
 
37515
37540
  // src/doc-viewer/index.tsx
37516
- import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
37517
- function DocumentViewer({ item }) {
37518
- const { url, name, contentType, width = "100%", height = "100%" } = item;
37541
+ import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
37542
+ function DocumentViewer({
37543
+ item,
37544
+ width = "100%",
37545
+ height = "100%"
37546
+ }) {
37547
+ const { url, name, contentType } = item;
37519
37548
  const isImage = contentType.startsWith("image/");
37520
37549
  const isPdf = contentType === "application/pdf";
37521
37550
  const isGoogleDocCompatible = isPdf || contentType.includes("msword") || contentType.includes("officedocument") || contentType.includes("presentation");
37522
37551
  const viewerUrl = isGoogleDocCompatible ? `https://docs.google.com/gview?url=${encodeURIComponent(
37523
37552
  url
37524
37553
  )}&embedded=true` : url;
37525
- return /* @__PURE__ */ jsxs12("div", { className: "border shadow rounded p-2 h-[100%]", children: [
37526
- /* @__PURE__ */ jsxs12("div", { className: "mb-1 flex justify-between ", children: [
37527
- /* @__PURE__ */ jsx20("h3", { className: "font-bold", children: name }),
37554
+ return /* @__PURE__ */ jsxs13("div", { className: "border shadow rounded relative pt-6 pb-1 px-1", children: [
37555
+ /* @__PURE__ */ jsxs13("div", { className: "grid grid-cols-[3fr_1fr] left-0 rounded-t shadow top-0 absolute p-1 bg-blue-500 px-1 text-white w-full ", children: [
37556
+ /* @__PURE__ */ jsx20(
37557
+ "h3",
37558
+ {
37559
+ className: "font-bold truncate text-xs px-1 cursor-pointer max-w-[90%] ",
37560
+ title: name,
37561
+ children: name
37562
+ }
37563
+ ),
37528
37564
  /* @__PURE__ */ jsx20(
37529
37565
  "a",
37530
37566
  {
@@ -37532,8 +37568,8 @@ function DocumentViewer({ item }) {
37532
37568
  download: name,
37533
37569
  target: "_blank",
37534
37570
  rel: "noopener noreferrer",
37535
- className: "border shadow rounded bg-blue-400 text-white p-2",
37536
- children: "Descargar"
37571
+ className: "border shadow hover:bg-blue-100 hover:text-black rounded bg-blue-900 text-white text-xs items-center truncate px-1 flex gap-1 justify-center",
37572
+ children: /* @__PURE__ */ jsx20(DownloadIcon, {})
37537
37573
  }
37538
37574
  )
37539
37575
  ] }),
@@ -37542,6 +37578,7 @@ function DocumentViewer({ item }) {
37542
37578
  {
37543
37579
  src: url,
37544
37580
  alt: name,
37581
+ className: "rounded",
37545
37582
  style: {
37546
37583
  width,
37547
37584
  height,
@@ -37553,14 +37590,20 @@ function DocumentViewer({ item }) {
37553
37590
  ) : isGoogleDocCompatible ? /* @__PURE__ */ jsx20(
37554
37591
  "iframe",
37555
37592
  {
37593
+ className: "rounded",
37594
+ style: {
37595
+ width,
37596
+ height,
37597
+ maxWidth: "100%"
37598
+ },
37556
37599
  title: name,
37557
37600
  src: viewerUrl,
37558
- style: { width, height, border: "none" },
37559
37601
  allowFullScreen: true
37560
37602
  }
37561
37603
  ) : /* @__PURE__ */ jsx20(
37562
37604
  "div",
37563
37605
  {
37606
+ className: "rounded",
37564
37607
  style: {
37565
37608
  width,
37566
37609
  height,
@@ -37587,7 +37630,7 @@ import React9, {
37587
37630
  import { useEffect as useEffect8, useMemo as useMemo5, useState as useState11 } from "react";
37588
37631
 
37589
37632
  // src/table3/filters.tsx
37590
- import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
37633
+ import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
37591
37634
  function FilterOffIcon() {
37592
37635
  return /* @__PURE__ */ jsx21(
37593
37636
  "svg",
@@ -37649,7 +37692,7 @@ function EditIcon2() {
37649
37692
  );
37650
37693
  }
37651
37694
  function SaveIcon() {
37652
- return /* @__PURE__ */ jsxs13(
37695
+ return /* @__PURE__ */ jsxs14(
37653
37696
  "svg",
37654
37697
  {
37655
37698
  stroke: "currentColor",
@@ -37683,7 +37726,7 @@ function ExcelIcon() {
37683
37726
  }
37684
37727
 
37685
37728
  // src/table3/filter.tsx
37686
- import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
37729
+ import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
37687
37730
  function Filter({
37688
37731
  h,
37689
37732
  objectData,
@@ -37744,7 +37787,7 @@ function Filter({
37744
37787
  setSelected(news);
37745
37788
  }
37746
37789
  }, [data]);
37747
- return /* @__PURE__ */ jsxs14("th", { className: "cursor-pointer", children: [
37790
+ return /* @__PURE__ */ jsxs15("th", { className: "cursor-pointer", children: [
37748
37791
  /* @__PURE__ */ jsx22("div", { className: "relative", children: visible && /* @__PURE__ */ jsx22(
37749
37792
  "div",
37750
37793
  {
@@ -37753,8 +37796,8 @@ function Filter({
37753
37796
  onClick: (e) => setVisible(!visible)
37754
37797
  }
37755
37798
  ) }),
37756
- /* @__PURE__ */ jsxs14("div", { className: "relative w-full justify-center flex", children: [
37757
- /* @__PURE__ */ jsxs14(
37799
+ /* @__PURE__ */ jsxs15("div", { className: "relative w-full justify-center flex", children: [
37800
+ /* @__PURE__ */ jsxs15(
37758
37801
  "div",
37759
37802
  {
37760
37803
  style: (colSizes == null ? void 0 : colSizes[h]) ? {
@@ -37777,8 +37820,8 @@ function Filter({
37777
37820
  {
37778
37821
  className: "border shadow rounded bg-white p-1 absolute left-0 text-black",
37779
37822
  style: { zIndex: 9999 },
37780
- children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-1 w-[300px] min-w-[300px] resize-x overflow-auto", children: [
37781
- /* @__PURE__ */ jsxs14(
37823
+ children: /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-1 w-[300px] min-w-[300px] resize-x overflow-auto", children: [
37824
+ /* @__PURE__ */ jsxs15(
37782
37825
  "div",
37783
37826
  {
37784
37827
  onClick: (e) => {
@@ -37800,7 +37843,7 @@ function Filter({
37800
37843
  ]
37801
37844
  }
37802
37845
  ),
37803
- /* @__PURE__ */ jsxs14(
37846
+ /* @__PURE__ */ jsxs15(
37804
37847
  "div",
37805
37848
  {
37806
37849
  onClick: (e) => {
@@ -37822,7 +37865,7 @@ function Filter({
37822
37865
  ]
37823
37866
  }
37824
37867
  ),
37825
- selected.length < items.length && /* @__PURE__ */ jsxs14(
37868
+ selected.length < items.length && /* @__PURE__ */ jsxs15(
37826
37869
  "div",
37827
37870
  {
37828
37871
  className: "p-1 flex items-center justify-between px-2 bg-red-200 border shadow rounded",
@@ -37854,7 +37897,7 @@ function Filter({
37854
37897
  }
37855
37898
  }
37856
37899
  ) }),
37857
- /* @__PURE__ */ jsx22("div", { children: /* @__PURE__ */ jsxs14("label", { className: "flex gap-1 cursor-pointer px-1", children: [
37900
+ /* @__PURE__ */ jsx22("div", { children: /* @__PURE__ */ jsxs15("label", { className: "flex gap-1 cursor-pointer px-1", children: [
37858
37901
  /* @__PURE__ */ jsx22(
37859
37902
  "input",
37860
37903
  {
@@ -37872,7 +37915,7 @@ function Filter({
37872
37915
  "(Seleccionar Todo)"
37873
37916
  ] }) }),
37874
37917
  /* @__PURE__ */ jsx22("div", { className: "overflow-auto flex gap-1 flex-col p-1 border shadow rounded h-[300px]", children: itemsFiltered.map((item) => {
37875
- return /* @__PURE__ */ jsx22("div", { className: "hover:bg-gray-100 ", children: /* @__PURE__ */ jsxs14("label", { className: "flex gap-1 cursor-pointer truncate", children: [
37918
+ return /* @__PURE__ */ jsx22("div", { className: "hover:bg-gray-100 ", children: /* @__PURE__ */ jsxs15("label", { className: "flex gap-1 cursor-pointer truncate", children: [
37876
37919
  /* @__PURE__ */ jsx22(
37877
37920
  "input",
37878
37921
  {
@@ -37894,7 +37937,7 @@ function Filter({
37894
37937
  item || "(Vacias)"
37895
37938
  ] }) }, item);
37896
37939
  }) }),
37897
- /* @__PURE__ */ jsxs14("div", { className: "flex justify-between px-1", children: [
37940
+ /* @__PURE__ */ jsxs15("div", { className: "flex justify-between px-1", children: [
37898
37941
  /* @__PURE__ */ jsx22(
37899
37942
  "button",
37900
37943
  {
@@ -37925,7 +37968,7 @@ function Filter({
37925
37968
  }
37926
37969
 
37927
37970
  // src/table3/head.tsx
37928
- import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
37971
+ import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
37929
37972
  function TableHead({
37930
37973
  headers,
37931
37974
  selectItems,
@@ -37940,7 +37983,7 @@ function TableHead({
37940
37983
  sort,
37941
37984
  setSort
37942
37985
  }) {
37943
- return /* @__PURE__ */ jsx23("thead", { children: /* @__PURE__ */ jsxs15("tr", { className: "bg-blue-500 text-white font-bold", children: [
37986
+ return /* @__PURE__ */ jsx23("thead", { children: /* @__PURE__ */ jsxs16("tr", { className: "bg-blue-500 text-white font-bold", children: [
37944
37987
  modal && /* @__PURE__ */ jsx23("th", { children: "-" }),
37945
37988
  selectItems && /* @__PURE__ */ jsx23("th", { children: /* @__PURE__ */ jsx23(
37946
37989
  "input",
@@ -37993,7 +38036,7 @@ import { useState as useState12 } from "react";
37993
38036
 
37994
38037
  // src/table3/tr.tsx
37995
38038
  import React7 from "react";
37996
- import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
38039
+ import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
37997
38040
  function TR({
37998
38041
  handlers,
37999
38042
  setObjectData,
@@ -38013,7 +38056,7 @@ function TR({
38013
38056
  symbols
38014
38057
  }) {
38015
38058
  const color = selected == index ? "bg-blue-600 text-white hover:bg-blue-800" : index % 2 == 0 ? "bg-white" : "bg-blue-50";
38016
- return /* @__PURE__ */ jsxs16(
38059
+ return /* @__PURE__ */ jsxs17(
38017
38060
  "tr",
38018
38061
  {
38019
38062
  className: ` hover:bg-blue-100 ${color} cursor-pointer`,
@@ -38103,7 +38146,7 @@ function TR({
38103
38146
  });
38104
38147
  return /* @__PURE__ */ jsx24("td", { className: `text-black `, children: cloned }, h);
38105
38148
  }
38106
- return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */ jsx24("td", { className: `text-center border max-w-[${colSize}px] `, children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1 w-full", children: [
38149
+ return symbols && (symbols == null ? void 0 : symbols[h]) ? /* @__PURE__ */ jsx24("td", { className: `text-center border max-w-[${colSize}px] `, children: /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1 w-full", children: [
38107
38150
  symbols[h],
38108
38151
  " ",
38109
38152
  row[h]
@@ -38189,7 +38232,7 @@ function TableBody({
38189
38232
  }
38190
38233
 
38191
38234
  // src/table3/panel.tsx
38192
- import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
38235
+ import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
38193
38236
  function Panel({
38194
38237
  page,
38195
38238
  setPage,
@@ -38200,9 +38243,9 @@ function Panel({
38200
38243
  maxItems
38201
38244
  }) {
38202
38245
  const excel = useExcel();
38203
- return /* @__PURE__ */ jsxs17("div", { className: "flex gap-2 bg-gray-100 items-center", children: [
38204
- /* @__PURE__ */ jsxs17("div", { className: "flex gap-1 ", children: [
38205
- onSave && /* @__PURE__ */ jsxs17(
38246
+ return /* @__PURE__ */ jsxs18("div", { className: "flex gap-2 bg-gray-100 items-center", children: [
38247
+ /* @__PURE__ */ jsxs18("div", { className: "flex gap-1 ", children: [
38248
+ onSave && /* @__PURE__ */ jsxs18(
38206
38249
  "button",
38207
38250
  {
38208
38251
  className: "p-2 border shadow rounded bg-blue-500 text-white flex items-center gap-1 text-md",
@@ -38216,7 +38259,7 @@ function Panel({
38216
38259
  ]
38217
38260
  }
38218
38261
  ),
38219
- exportName && /* @__PURE__ */ jsxs17(
38262
+ exportName && /* @__PURE__ */ jsxs18(
38220
38263
  "button",
38221
38264
  {
38222
38265
  className: "p-2 border shadow rounded bg-green-800 text-white flex items-center gap-1 text-md",
@@ -38236,10 +38279,10 @@ function Panel({
38236
38279
  }
38237
38280
  )
38238
38281
  ] }),
38239
- maxItems !== Infinity && /* @__PURE__ */ jsxs17("div", { className: "flex gap-2 items-center text-2xl", children: [
38282
+ maxItems !== Infinity && /* @__PURE__ */ jsxs18("div", { className: "flex gap-2 items-center text-2xl", children: [
38240
38283
  /* @__PURE__ */ jsx26("button", { onClick: () => setPage(1), disabled: page === 1, children: "\u23EE" }),
38241
38284
  /* @__PURE__ */ jsx26("button", { onClick: () => setPage(page - 1), disabled: page === 1, children: "\u25C0" }),
38242
- /* @__PURE__ */ jsxs17("span", { className: "text-sm", children: [
38285
+ /* @__PURE__ */ jsxs18("span", { className: "text-sm", children: [
38243
38286
  "P\xE1gina ",
38244
38287
  page,
38245
38288
  " / ",
@@ -38266,7 +38309,7 @@ function Panel({
38266
38309
  }
38267
38310
 
38268
38311
  // src/table3/footer.tsx
38269
- import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
38312
+ import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
38270
38313
  function TableFooter({
38271
38314
  objectData,
38272
38315
  headers,
@@ -38291,14 +38334,14 @@ function TableFooter({
38291
38334
  return null;
38292
38335
  }
38293
38336
  }
38294
- return footer && /* @__PURE__ */ jsx27("tfoot", { children: /* @__PURE__ */ jsxs18("tr", { className: "bg-blue-500 text-white", children: [
38337
+ return footer && /* @__PURE__ */ jsx27("tfoot", { children: /* @__PURE__ */ jsxs19("tr", { className: "bg-blue-500 text-white", children: [
38295
38338
  selectItems && /* @__PURE__ */ jsx27("th", {}),
38296
38339
  modal && /* @__PURE__ */ jsx27("th", {}),
38297
38340
  headers.map((header) => {
38298
38341
  if (header.startsWith("_")) {
38299
38342
  return null;
38300
38343
  } else if (footer == null ? void 0 : footer[header]) {
38301
- return symbols && (symbols == null ? void 0 : symbols[header]) ? /* @__PURE__ */ jsxs18("th", { className: "flex items-center gap-1", children: [
38344
+ return symbols && (symbols == null ? void 0 : symbols[header]) ? /* @__PURE__ */ jsxs19("th", { className: "flex items-center gap-1", children: [
38302
38345
  symbols[header],
38303
38346
  " ",
38304
38347
  operacion(footer[header], header)
@@ -38311,7 +38354,7 @@ function TableFooter({
38311
38354
 
38312
38355
  // src/table3/dialog.tsx
38313
38356
  import React8, { useMemo as useMemo6 } from "react";
38314
- import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
38357
+ import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
38315
38358
  function Dialog3({
38316
38359
  modalRef,
38317
38360
  children,
@@ -38339,13 +38382,13 @@ function Dialog3({
38339
38382
  }
38340
38383
  return null;
38341
38384
  }, [dialogRow, children]);
38342
- return /* @__PURE__ */ jsxs19(
38385
+ return /* @__PURE__ */ jsxs20(
38343
38386
  "dialog",
38344
38387
  {
38345
38388
  ref: modalRef,
38346
38389
  className: "p-6 rounded-xl shadow-2xl backdrop:bg-black/50 w-[100%] h-screen",
38347
38390
  children: [
38348
- /* @__PURE__ */ jsxs19("div", { className: "flex justify-between items-center mb-4", children: [
38391
+ /* @__PURE__ */ jsxs20("div", { className: "flex justify-between items-center mb-4", children: [
38349
38392
  /* @__PURE__ */ jsx28("div", {}),
38350
38393
  /* @__PURE__ */ jsx28(
38351
38394
  "button",
@@ -38367,7 +38410,7 @@ function Dialog3({
38367
38410
  var dialog_default = Dialog3;
38368
38411
 
38369
38412
  // src/table3/index.tsx
38370
- import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
38413
+ import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
38371
38414
  function Table3({
38372
38415
  data,
38373
38416
  selectItems,
@@ -38479,7 +38522,7 @@ function Table3({
38479
38522
  }, [objectData]);
38480
38523
  const style = (props == null ? void 0 : props.style) ? { ...props.style, tableLayout: "fixed" } : { tableLayout: "fixed" };
38481
38524
  if (!objectData) return null;
38482
- return /* @__PURE__ */ jsxs20("div", { className: "border shadow rounded m-1 p-1 bg-white", children: [
38525
+ return /* @__PURE__ */ jsxs21("div", { className: "border shadow rounded m-1 p-1 bg-white", children: [
38483
38526
  modal && /* @__PURE__ */ jsx29(
38484
38527
  dialog_default,
38485
38528
  {
@@ -38492,7 +38535,7 @@ function Table3({
38492
38535
  ),
38493
38536
  header && /* @__PURE__ */ jsx29("div", { className: "font-bold text-2xl py-5 px-2 bg-blue-50", children: header }),
38494
38537
  /* @__PURE__ */ jsx29(Panel, { ...context }),
38495
- /* @__PURE__ */ jsxs20("table", { ...props, style, children: [
38538
+ /* @__PURE__ */ jsxs21("table", { ...props, style, children: [
38496
38539
  /* @__PURE__ */ jsx29(TableHead, { ...context }),
38497
38540
  /* @__PURE__ */ jsx29(TableBody, { ...context }),
38498
38541
  /* @__PURE__ */ jsx29(TableFooter, { ...context })
@@ -38517,9 +38560,9 @@ import { useEffect as useEffect10, useMemo as useMemo8, useRef as useRef6, useSt
38517
38560
  import { createPortal } from "react-dom";
38518
38561
 
38519
38562
  // src/table-advanced/icons.tsx
38520
- import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
38563
+ import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
38521
38564
  function DropIcon() {
38522
- return /* @__PURE__ */ jsxs21(
38565
+ return /* @__PURE__ */ jsxs22(
38523
38566
  "svg",
38524
38567
  {
38525
38568
  stroke: "currentColor",
@@ -38608,7 +38651,7 @@ function ExcelIcon2() {
38608
38651
  );
38609
38652
  }
38610
38653
  function OrderAscIcon() {
38611
- return /* @__PURE__ */ jsxs21(
38654
+ return /* @__PURE__ */ jsxs22(
38612
38655
  "svg",
38613
38656
  {
38614
38657
  stroke: "currentColor",
@@ -38628,7 +38671,7 @@ function OrderAscIcon() {
38628
38671
  points: "38,33 38,5 34,5 34,33 28,33 36,43 44,33"
38629
38672
  }
38630
38673
  ),
38631
- /* @__PURE__ */ jsxs21("g", { fill: "#2196F3", children: [
38674
+ /* @__PURE__ */ jsxs22("g", { fill: "#2196F3", children: [
38632
38675
  /* @__PURE__ */ jsx30("path", { d: "M16.8,17.2h-5.3l-1.1,3H6.9L12.6,5h2.9l5.7,15.2h-3.2L16.8,17.2z M12.2,14.5H16l-1.9-5.7L12.2,14.5z" }),
38633
38676
  /* @__PURE__ */ jsx30("path", { d: "M12.4,40.5H20V43H8.4v-1.9L16,30.3H8.4v-2.5h11.4v1.7L12.4,40.5z" })
38634
38677
  ] })
@@ -38637,7 +38680,7 @@ function OrderAscIcon() {
38637
38680
  );
38638
38681
  }
38639
38682
  function OrderDesIcon() {
38640
- return /* @__PURE__ */ jsxs21(
38683
+ return /* @__PURE__ */ jsxs22(
38641
38684
  "svg",
38642
38685
  {
38643
38686
  stroke: "currentColor",
@@ -38651,7 +38694,7 @@ function OrderDesIcon() {
38651
38694
  className: "text-blue-500",
38652
38695
  xmlns: "http://www.w3.org/2000/svg",
38653
38696
  children: [
38654
- /* @__PURE__ */ jsxs21("g", { fill: "#2196F3", children: [
38697
+ /* @__PURE__ */ jsxs22("g", { fill: "#2196F3", children: [
38655
38698
  /* @__PURE__ */ jsx30("path", { d: "M16.8,40h-5.3l-1.1,3H6.9l5.7-15.2h2.9L21.1,43h-3.2L16.8,40z M12.2,37.3H16l-1.9-5.7L12.2,37.3z" }),
38656
38699
  /* @__PURE__ */ jsx30("path", { d: "M12.4,17.7H20v2.5H8.4v-1.9L16,7.5H8.4V5h11.4v1.7L12.4,17.7z" })
38657
38700
  ] }),
@@ -38699,7 +38742,7 @@ function ArrowUPIcon() {
38699
38742
  );
38700
38743
  }
38701
38744
  function SearchIcon() {
38702
- return /* @__PURE__ */ jsxs21(
38745
+ return /* @__PURE__ */ jsxs22(
38703
38746
  "svg",
38704
38747
  {
38705
38748
  stroke: "currentColor",
@@ -38718,7 +38761,7 @@ function SearchIcon() {
38718
38761
  );
38719
38762
  }
38720
38763
  function FilterIcon() {
38721
- return /* @__PURE__ */ jsxs21(
38764
+ return /* @__PURE__ */ jsxs22(
38722
38765
  "svg",
38723
38766
  {
38724
38767
  className: "text-red-300",
@@ -38738,13 +38781,13 @@ function FilterIcon() {
38738
38781
  }
38739
38782
 
38740
38783
  // src/table-advanced/menu.item.tsx
38741
- import { jsxs as jsxs22 } from "react/jsx-runtime";
38784
+ import { jsxs as jsxs23 } from "react/jsx-runtime";
38742
38785
  function MenuItem({
38743
38786
  label,
38744
38787
  icon,
38745
38788
  onClick
38746
38789
  }) {
38747
- return /* @__PURE__ */ jsxs22(
38790
+ return /* @__PURE__ */ jsxs23(
38748
38791
  "div",
38749
38792
  {
38750
38793
  className: "cursor-pointer border p-2 hover:bg-gray-100 flex items-center bg-white gap-2",
@@ -38758,7 +38801,7 @@ function MenuItem({
38758
38801
  }
38759
38802
 
38760
38803
  // src/table-advanced/header.tsx
38761
- import { Fragment as Fragment2, jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
38804
+ import { Fragment as Fragment2, jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
38762
38805
  function Header({
38763
38806
  header,
38764
38807
  context,
@@ -38848,7 +38891,7 @@ function Header({
38848
38891
  }
38849
38892
  ) });
38850
38893
  } else
38851
- return /* @__PURE__ */ jsx31("div", { className: " ", children: /* @__PURE__ */ jsxs23(
38894
+ return /* @__PURE__ */ jsx31("div", { className: " ", children: /* @__PURE__ */ jsxs24(
38852
38895
  "div",
38853
38896
  {
38854
38897
  ref: cellRef,
@@ -38857,8 +38900,8 @@ function Header({
38857
38900
  onMouseLeave: (e) => setHovered(false),
38858
38901
  style: { zIndex: 10, height: `${padding}px`, maxHeight: "100px" },
38859
38902
  children: [
38860
- /* @__PURE__ */ jsxs23("div", { className: "flex justify-between items-center ", children: [
38861
- !context.disabled ? /* @__PURE__ */ jsxs23("div", { className: "flex gap-2", children: [
38903
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-between items-center ", children: [
38904
+ !context.disabled ? /* @__PURE__ */ jsxs24("div", { className: "flex gap-2", children: [
38862
38905
  hasFilter ? /* @__PURE__ */ jsx31(
38863
38906
  "div",
38864
38907
  {
@@ -38914,7 +38957,7 @@ function Header({
38914
38957
  }
38915
38958
  ),
38916
38959
  visible && context.currentHeader == header && createPortal(
38917
- /* @__PURE__ */ jsxs23(Fragment2, { children: [
38960
+ /* @__PURE__ */ jsxs24(Fragment2, { children: [
38918
38961
  /* @__PURE__ */ jsx31(
38919
38962
  "div",
38920
38963
  {
@@ -38930,7 +38973,7 @@ function Header({
38930
38973
  {
38931
38974
  className: "fixed",
38932
38975
  style: { top: coords.top, left: coords.left, zIndex: 9999 },
38933
- children: /* @__PURE__ */ jsxs23("div", { className: "bg-gray-100 w-[300px] flex flex-col border shadow rounded ", children: [
38976
+ children: /* @__PURE__ */ jsxs24("div", { className: "bg-gray-100 w-[300px] flex flex-col border shadow rounded ", children: [
38934
38977
  hasFilter && /* @__PURE__ */ jsx31(
38935
38978
  MenuItem,
38936
38979
  {
@@ -38967,7 +39010,7 @@ function Header({
38967
39010
  }
38968
39011
  }
38969
39012
  ),
38970
- /* @__PURE__ */ jsxs23(
39013
+ /* @__PURE__ */ jsxs24(
38971
39014
  Form,
38972
39015
  {
38973
39016
  onSubmit: (e) => {
@@ -38982,7 +39025,7 @@ function Header({
38982
39025
  context.setCurrentHeader(null);
38983
39026
  },
38984
39027
  children: [
38985
- /* @__PURE__ */ jsxs23("div", { className: "m-2 bg-white gap-2 flex flex-col", children: [
39028
+ /* @__PURE__ */ jsxs24("div", { className: "m-2 bg-white gap-2 flex flex-col", children: [
38986
39029
  /* @__PURE__ */ jsx31(
38987
39030
  "input",
38988
39031
  {
@@ -38992,13 +39035,13 @@ function Header({
38992
39035
  onChange: (e) => setText(e.target.value)
38993
39036
  }
38994
39037
  ),
38995
- /* @__PURE__ */ jsxs23(
39038
+ /* @__PURE__ */ jsxs24(
38996
39039
  "div",
38997
39040
  {
38998
39041
  className: "flex items-start flex-col p-2 border shadow rounded max-w-[600px] h-[300px] bg-white ",
38999
39042
  style: { overflow: "auto" },
39000
39043
  children: [
39001
- /* @__PURE__ */ jsxs23(
39044
+ /* @__PURE__ */ jsxs24(
39002
39045
  "div",
39003
39046
  {
39004
39047
  className: "flex gap-2 " + (text != "" ? "text-gray-400" : ""),
@@ -39023,7 +39066,7 @@ function Header({
39023
39066
  }
39024
39067
  ),
39025
39068
  filteredValues.map((d) => {
39026
- return /* @__PURE__ */ jsxs23("div", { className: "flex gap-2 ", children: [
39069
+ return /* @__PURE__ */ jsxs24("div", { className: "flex gap-2 ", children: [
39027
39070
  /* @__PURE__ */ jsx31(
39028
39071
  "input",
39029
39072
  {
@@ -39049,7 +39092,7 @@ function Header({
39049
39092
  }
39050
39093
  )
39051
39094
  ] }),
39052
- /* @__PURE__ */ jsxs23("div", { className: "flex justify-between p-2", children: [
39095
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-between p-2", children: [
39053
39096
  /* @__PURE__ */ jsx31(
39054
39097
  "button",
39055
39098
  {
@@ -39079,11 +39122,11 @@ function Header({
39079
39122
  }
39080
39123
 
39081
39124
  // src/table-advanced/searchable.tsx
39082
- import { jsx as jsx32, jsxs as jsxs24 } from "react/jsx-runtime";
39125
+ import { jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
39083
39126
  function Searchable({
39084
39127
  context
39085
39128
  }) {
39086
- return /* @__PURE__ */ jsxs24("div", { className: "flex justify-start p-2 relative w-96 text-xs", children: [
39129
+ return /* @__PURE__ */ jsxs25("div", { className: "flex justify-start p-2 relative w-96 text-xs", children: [
39087
39130
  /* @__PURE__ */ jsx32(
39088
39131
  "input",
39089
39132
  {
@@ -39184,7 +39227,7 @@ function usePaginacion({
39184
39227
  var use_pagination_default = usePaginacion;
39185
39228
 
39186
39229
  // src/table-advanced/h.table.tsx
39187
- import { jsx as jsx33, jsxs as jsxs25 } from "react/jsx-runtime";
39230
+ import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
39188
39231
  function HTable({
39189
39232
  context
39190
39233
  }) {
@@ -39281,7 +39324,7 @@ function HTable({
39281
39324
  });
39282
39325
  }, [context.filteredData]);
39283
39326
  const pagination = use_pagination_default({ total: searchedData.length });
39284
- return /* @__PURE__ */ jsxs25(
39327
+ return /* @__PURE__ */ jsxs26(
39285
39328
  "div",
39286
39329
  {
39287
39330
  className: [
@@ -39292,9 +39335,9 @@ function HTable({
39292
39335
  ref: tableRef,
39293
39336
  children: [
39294
39337
  /* @__PURE__ */ jsx33("div", { className: "bg-white px-1 font-bold rounded-full", children: context.header }),
39295
- /* @__PURE__ */ jsxs25("div", { className: "bg-white flex gap-2 items-center", children: [
39338
+ /* @__PURE__ */ jsxs26("div", { className: "bg-white flex gap-2 items-center", children: [
39296
39339
  context.searchable && /* @__PURE__ */ jsx33(Searchable, { context }),
39297
- context.exportName && /* @__PURE__ */ jsxs25(
39340
+ context.exportName && /* @__PURE__ */ jsxs26(
39298
39341
  "button",
39299
39342
  {
39300
39343
  onClick: (e) => {
@@ -39352,7 +39395,7 @@ function HTable({
39352
39395
  }
39353
39396
  )
39354
39397
  ] }),
39355
- /* @__PURE__ */ jsxs25(
39398
+ /* @__PURE__ */ jsxs26(
39356
39399
  "div",
39357
39400
  {
39358
39401
  children: [
@@ -39576,11 +39619,11 @@ function HTable({
39576
39619
  })
39577
39620
  }
39578
39621
  ),
39579
- searchedData.length > 100 && /* @__PURE__ */ jsxs25("div", { className: "flex justify-end p-2", children: [
39622
+ searchedData.length > 100 && /* @__PURE__ */ jsxs26("div", { className: "flex justify-end p-2", children: [
39580
39623
  pagination.rango,
39581
39624
  " de ",
39582
39625
  pagination.total,
39583
- /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-5 mx-5", children: [
39626
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-5 mx-5", children: [
39584
39627
  /* @__PURE__ */ jsx33(
39585
39628
  "button",
39586
39629
  {
@@ -39648,8 +39691,8 @@ function ModalContent({
39648
39691
  context,
39649
39692
  hide
39650
39693
  }) {
39651
- return /* @__PURE__ */ jsxs25("div", { className: "relative", children: [
39652
- /* @__PURE__ */ jsxs25("div", { className: "fixed top-0 left-0 p-10 ", children: [
39694
+ return /* @__PURE__ */ jsxs26("div", { className: "relative", children: [
39695
+ /* @__PURE__ */ jsxs26("div", { className: "fixed top-0 left-0 p-10 ", children: [
39653
39696
  /* @__PURE__ */ jsx33(
39654
39697
  "button",
39655
39698
  {
@@ -39813,7 +39856,7 @@ function TableAdvanced(tableProps) {
39813
39856
 
39814
39857
  // src/tabs/index.tsx
39815
39858
  import React11, { useEffect as useEffect15, useState as useState19 } from "react";
39816
- import { Fragment as Fragment3, jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
39859
+ import { Fragment as Fragment3, jsx as jsx35, jsxs as jsxs27 } from "react/jsx-runtime";
39817
39860
  function TabContainer({
39818
39861
  children,
39819
39862
  labelMaxWidth = 100,
@@ -39832,12 +39875,12 @@ function TabContainer({
39832
39875
  useEffect15(() => {
39833
39876
  setIndex(currentIndex);
39834
39877
  }, [currentIndex]);
39835
- return /* @__PURE__ */ jsxs26("div", { className: "w-full bg-white", children: [
39878
+ return /* @__PURE__ */ jsxs27("div", { className: "w-full bg-white", children: [
39836
39879
  /* @__PURE__ */ jsx35("div", { role: "tablist", className: "flex gap-1 border-b border-slate-200", children: labels.map((label, k) => {
39837
39880
  var _a, _b;
39838
39881
  const active = k === index;
39839
39882
  const isDisabled = (_b = (_a = items.find((i) => i.props.label == label)) == null ? void 0 : _a.props) == null ? void 0 : _b.disabled;
39840
- return /* @__PURE__ */ jsxs26(
39883
+ return /* @__PURE__ */ jsxs27(
39841
39884
  "button",
39842
39885
  {
39843
39886
  style: { maxWidth: labelMaxWidth },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "2.0.61",
3
+ "version": "2.0.63",
4
4
  "description": "description nueva",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,3 +13,20 @@ export default function Icon() {
13
13
  </svg>
14
14
  );
15
15
  }
16
+
17
+ export function DownloadIcon() {
18
+ return (
19
+ <svg
20
+ stroke="currentColor"
21
+ fill="currentColor"
22
+ strokeWidth="0"
23
+ viewBox="0 0 24 24"
24
+ height="1em"
25
+ width="1em"
26
+ xmlns="http://www.w3.org/2000/svg"
27
+ >
28
+ <path fill="none" d="M0 0h24v24H0z"></path>
29
+ <path d="M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5z"></path>
30
+ </svg>
31
+ );
32
+ }
@@ -1,20 +1,24 @@
1
1
  import React from "react";
2
- import Icon from "./icon";
2
+ import Icon, { DownloadIcon } from "./icon";
3
3
 
4
4
  type Item = {
5
5
  url: string;
6
6
  name: string;
7
7
  contentType: string;
8
- width?: string;
9
- height?: string;
10
8
  };
11
9
 
12
10
  type Props = {
13
11
  item: Item;
12
+ width?: string;
13
+ height?: string;
14
14
  };
15
15
 
16
- export default function DocumentViewer({ item }: Props) {
17
- const { url, name, contentType, width = "100%", height = "100%" } = item;
16
+ export default function DocumentViewer({
17
+ item,
18
+ width = "100%",
19
+ height = "100%",
20
+ }: Props) {
21
+ const { url, name, contentType } = item;
18
22
 
19
23
  const isImage = contentType.startsWith("image/");
20
24
  const isPdf = contentType === "application/pdf";
@@ -26,22 +30,27 @@ export default function DocumentViewer({ item }: Props) {
26
30
 
27
31
  const viewerUrl = isGoogleDocCompatible
28
32
  ? `https://docs.google.com/gview?url=${encodeURIComponent(
29
- url
33
+ url,
30
34
  )}&embedded=true`
31
35
  : url;
32
36
 
33
37
  return (
34
- <div className="border shadow rounded p-2 h-[100%]">
35
- <div className="mb-1 flex justify-between ">
36
- <h3 className="font-bold">{name}</h3>
38
+ <div className="border shadow rounded relative pt-6 pb-1 px-1">
39
+ <div className="grid grid-cols-[3fr_1fr] left-0 rounded-t shadow top-0 absolute p-1 bg-blue-500 px-1 text-white w-full ">
40
+ <h3
41
+ className="font-bold truncate text-xs px-1 cursor-pointer max-w-[90%] "
42
+ title={name}
43
+ >
44
+ {name}
45
+ </h3>
37
46
  <a
38
47
  href={url}
39
48
  download={name}
40
49
  target="_blank"
41
50
  rel="noopener noreferrer"
42
- className="border shadow rounded bg-blue-400 text-white p-2"
51
+ className="border shadow hover:bg-blue-100 hover:text-black rounded bg-blue-900 text-white text-xs items-center truncate px-1 flex gap-1 justify-center"
43
52
  >
44
- Descargar
53
+ <DownloadIcon />
45
54
  </a>
46
55
  </div>
47
56
 
@@ -49,6 +58,7 @@ export default function DocumentViewer({ item }: Props) {
49
58
  <img
50
59
  src={url}
51
60
  alt={name}
61
+ className="rounded"
52
62
  style={{
53
63
  width: width,
54
64
  height: height,
@@ -59,13 +69,19 @@ export default function DocumentViewer({ item }: Props) {
59
69
  />
60
70
  ) : isGoogleDocCompatible ? (
61
71
  <iframe
72
+ className="rounded"
73
+ style={{
74
+ width: width,
75
+ height: height,
76
+ maxWidth: "100%",
77
+ }}
62
78
  title={name}
63
79
  src={viewerUrl}
64
- style={{ width, height, border: "none" }}
65
80
  allowFullScreen
66
81
  />
67
82
  ) : (
68
83
  <div
84
+ className="rounded"
69
85
  style={{
70
86
  width: width,
71
87
  height: height,
@@ -52,7 +52,16 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
52
52
  setInfo(newInfo);
53
53
 
54
54
  try {
55
- const consulta = await axios.request(options);
55
+ const consulta = baseURI
56
+ ? await axios.request(options)
57
+ : {
58
+ data: {
59
+ data: [],
60
+ totalItems: 0,
61
+ totalPages: 1,
62
+ currentPage: 1,
63
+ },
64
+ };
56
65
  const d = consulta.data;
57
66
  newInfo[key].state = "success";
58
67
  newInfo[key].errorMessage = "";
@@ -97,7 +106,9 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
97
106
  setInfo(newInfo);
98
107
 
99
108
  try {
100
- const consulta = await axios.request(options);
109
+ const consulta = baseURI
110
+ ? await axios.request(options)
111
+ : { data: {} };
101
112
  const d = consulta.data;
102
113
  newInfo[key].state = "success";
103
114
  newInfo[key].errorMessage = "";
@@ -146,7 +157,7 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
146
157
  setInfo(newInfo);
147
158
 
148
159
  try {
149
- const consulta = await axios.request(options);
160
+ const consulta = baseURI ? await axios.request(options) : { data };
150
161
  const d = consulta.data;
151
162
  newInfo[key].state = "success";
152
163
  newInfo[key].errorMessage = "";
@@ -230,7 +241,7 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
230
241
  },
231
242
  };
232
243
 
233
- const consulta = await axios.request(options);
244
+ const consulta = baseURI ? await axios.request(options) : { data };
234
245
  const d = consulta.data;
235
246
 
236
247
  newInfo[key].state = "success";
@@ -314,7 +325,7 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
314
325
  setInfo(newInfo);
315
326
 
316
327
  try {
317
- const consulta = await axios.request(options);
328
+ const consulta = baseURI ? await axios.request(options) : { data };
318
329
  const d = consulta.data;
319
330
  newInfo[key].state = "success";
320
331
  newInfo[key].errorMessage = "";
@@ -360,7 +371,9 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
360
371
  setInfo(newInfo);
361
372
 
362
373
  try {
363
- const consulta = await axios.request(options);
374
+ const consulta = baseURI
375
+ ? await axios.request(options)
376
+ : { data: { state: "success" } };
364
377
  const d = consulta.data;
365
378
  newInfo[key].state = "success";
366
379
  newInfo[key].errorMessage = "";
@@ -12,7 +12,7 @@ export interface ItemsRecord<T = any> {
12
12
  export interface ResourcesRecord extends Record<string, ItemsRecord> {}
13
13
 
14
14
  export interface Props<T extends Record<string, ItemsRecord>> {
15
- baseURI: string;
15
+ baseURI?: string;
16
16
  endpoints: T;
17
17
  onError?: (error: any) => void;
18
18
  }