next-recomponents 2.0.17 → 2.0.18

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
@@ -35696,14 +35696,16 @@ function useExcel() {
35696
35696
  // src/table/index.tsx
35697
35697
  var import_jsx_runtime7 = require("react/jsx-runtime");
35698
35698
  var HEIGHT_MAP = {
35699
- 1: 150,
35700
- 2: 200,
35701
- 3: 250,
35702
- 4: 310,
35703
- 5: 360,
35704
- 6: 410,
35705
- 7: 460,
35706
- 8: 510
35699
+ 1: 110,
35700
+ 2: 165,
35701
+ 3: 215,
35702
+ 4: 265,
35703
+ 5: 320,
35704
+ 6: 370,
35705
+ 7: 425,
35706
+ 8: 475,
35707
+ 9: 525,
35708
+ 10: 585
35707
35709
  };
35708
35710
  function EditIcon() {
35709
35711
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
@@ -35756,7 +35758,10 @@ function CustomFooter({
35756
35758
  if (!entries.length) return null;
35757
35759
  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]) => {
35758
35760
  const value = computeAggregation(rows, key, type);
35759
- const formatted = type === "avg" ? value.toLocaleString(void 0, { maximumFractionDigits: 2 }) : value.toLocaleString();
35761
+ const formatted = value.toLocaleString("en-US", {
35762
+ minimumFractionDigits: value % 1 !== 0 ? 2 : 0,
35763
+ maximumFractionDigits: value % 1 !== 0 ? 2 : 0
35764
+ });
35760
35765
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
35761
35766
  FOOTER_LABELS[type],
35762
35767
  " de",
@@ -35797,7 +35802,7 @@ function Toolbar({
35797
35802
  return rest;
35798
35803
  };
35799
35804
  if (!exportName && !onSave && !onSelect) return null;
35800
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex gap-2 bg-gray-200 border shadow rounded p-2", children: [
35805
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex gap-2 p-2 text-xs", children: [
35801
35806
  exportName && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
35802
35807
  Button,
35803
35808
  {
@@ -35896,7 +35901,7 @@ function IHTable({
35896
35901
  buttons,
35897
35902
  exportName,
35898
35903
  modal,
35899
- height = 510,
35904
+ height = 580,
35900
35905
  width = "100%",
35901
35906
  header,
35902
35907
  hideColumns = [],
@@ -35951,8 +35956,8 @@ function IHTable({
35951
35956
  onModalOpen: handleModalOpen
35952
35957
  });
35953
35958
  if (!rows.length) return null;
35954
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
35955
- 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 }),
35959
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "m-2", children: [
35960
+ header && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "font-bold p-2 ", children: header }),
35956
35961
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
35957
35962
  Toolbar,
35958
35963
  {
package/dist/index.mjs CHANGED
@@ -35676,14 +35676,16 @@ function useExcel() {
35676
35676
  // src/table/index.tsx
35677
35677
  import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
35678
35678
  var HEIGHT_MAP = {
35679
- 1: 150,
35680
- 2: 200,
35681
- 3: 250,
35682
- 4: 310,
35683
- 5: 360,
35684
- 6: 410,
35685
- 7: 460,
35686
- 8: 510
35679
+ 1: 110,
35680
+ 2: 165,
35681
+ 3: 215,
35682
+ 4: 265,
35683
+ 5: 320,
35684
+ 6: 370,
35685
+ 7: 425,
35686
+ 8: 475,
35687
+ 9: 525,
35688
+ 10: 585
35687
35689
  };
35688
35690
  function EditIcon() {
35689
35691
  return /* @__PURE__ */ jsx6(
@@ -35736,7 +35738,10 @@ function CustomFooter({
35736
35738
  if (!entries.length) return null;
35737
35739
  return /* @__PURE__ */ jsx6("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]) => {
35738
35740
  const value = computeAggregation(rows, key, type);
35739
- const formatted = type === "avg" ? value.toLocaleString(void 0, { maximumFractionDigits: 2 }) : value.toLocaleString();
35741
+ const formatted = value.toLocaleString("en-US", {
35742
+ minimumFractionDigits: value % 1 !== 0 ? 2 : 0,
35743
+ maximumFractionDigits: value % 1 !== 0 ? 2 : 0
35744
+ });
35740
35745
  return /* @__PURE__ */ jsxs5("span", { children: [
35741
35746
  FOOTER_LABELS[type],
35742
35747
  " de",
@@ -35777,7 +35782,7 @@ function Toolbar({
35777
35782
  return rest;
35778
35783
  };
35779
35784
  if (!exportName && !onSave && !onSelect) return null;
35780
- return /* @__PURE__ */ jsxs5("div", { className: "flex gap-2 bg-gray-200 border shadow rounded p-2", children: [
35785
+ return /* @__PURE__ */ jsxs5("div", { className: "flex gap-2 p-2 text-xs", children: [
35781
35786
  exportName && /* @__PURE__ */ jsx6(
35782
35787
  Button,
35783
35788
  {
@@ -35876,7 +35881,7 @@ function IHTable({
35876
35881
  buttons,
35877
35882
  exportName,
35878
35883
  modal,
35879
- height = 510,
35884
+ height = 580,
35880
35885
  width = "100%",
35881
35886
  header,
35882
35887
  hideColumns = [],
@@ -35931,8 +35936,8 @@ function IHTable({
35931
35936
  onModalOpen: handleModalOpen
35932
35937
  });
35933
35938
  if (!rows.length) return null;
35934
- return /* @__PURE__ */ jsxs5("div", { children: [
35935
- header && /* @__PURE__ */ jsx6("div", { className: "font-bold text-xl p-2 bg-blue-500 text-white border shadow rounded", children: header }),
35939
+ return /* @__PURE__ */ jsxs5("div", { className: "m-2", children: [
35940
+ header && /* @__PURE__ */ jsx6("div", { className: "font-bold p-2 ", children: header }),
35936
35941
  /* @__PURE__ */ jsx6(
35937
35942
  Toolbar,
35938
35943
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "description": "description nueva",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -42,14 +42,16 @@ interface TableProps {
42
42
  // ─── Height mapping ───────────────────────────────────────────────────────────
43
43
 
44
44
  const HEIGHT_MAP: Record<number, number> = {
45
- 1: 150,
46
- 2: 200,
47
- 3: 250,
48
- 4: 310,
49
- 5: 360,
50
- 6: 410,
51
- 7: 460,
52
- 8: 510,
45
+ 1: 110,
46
+ 2: 165,
47
+ 3: 215,
48
+ 4: 265,
49
+ 5: 320,
50
+ 6: 370,
51
+ 7: 425,
52
+ 8: 475,
53
+ 9: 525,
54
+ 10: 585,
53
55
  };
54
56
 
55
57
  // ─── Icons ────────────────────────────────────────────────────────────────────
@@ -133,10 +135,10 @@ function CustomFooter({
133
135
  <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">
134
136
  {entries.map(([key, type]) => {
135
137
  const value = computeAggregation(rows, key, type);
136
- const formatted =
137
- type === "avg"
138
- ? value.toLocaleString(undefined, { maximumFractionDigits: 2 })
139
- : value.toLocaleString();
138
+ const formatted = value.toLocaleString("en-US", {
139
+ minimumFractionDigits: value % 1 !== 0 ? 2 : 0,
140
+ maximumFractionDigits: value % 1 !== 0 ? 2 : 0,
141
+ });
140
142
  return (
141
143
  <span key={key}>
142
144
  {FOOTER_LABELS[type]} de{" "}
@@ -207,7 +209,7 @@ function Toolbar({
207
209
  if (!exportName && !onSave && !onSelect) return null;
208
210
 
209
211
  return (
210
- <div className="flex gap-2 bg-gray-200 border shadow rounded p-2">
212
+ <div className="flex gap-2 p-2 text-xs">
211
213
  {exportName && (
212
214
  <Button
213
215
  className="bg-green-800 text-white"
@@ -332,7 +334,7 @@ function IHTable({
332
334
  buttons,
333
335
  exportName,
334
336
  modal,
335
- height = 510,
337
+ height = 580,
336
338
  width = "100%",
337
339
  header,
338
340
  hideColumns = [],
@@ -397,12 +399,8 @@ function IHTable({
397
399
  if (!rows.length) return null;
398
400
 
399
401
  return (
400
- <div>
401
- {header && (
402
- <div className="font-bold text-xl p-2 bg-blue-500 text-white border shadow rounded">
403
- {header}
404
- </div>
405
- )}
402
+ <div className="m-2">
403
+ {header && <div className="font-bold p-2 ">{header}</div>}
406
404
  <Toolbar
407
405
  exportName={exportName}
408
406
  onSave={onSave}