next-recomponents 2.0.44 → 2.0.46

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
@@ -36765,12 +36765,12 @@ function Select({
36765
36765
  }).map((child) => {
36766
36766
  return {
36767
36767
  value: child.props.value,
36768
- label: child.props.children
36768
+ label: import_react9.default.Children.toArray(child.props.children).join("")
36769
36769
  };
36770
36770
  });
36771
36771
  setOptions(parsedOptions);
36772
36772
  setFiltered(parsedOptions);
36773
- const value = (props == null ? void 0 : props.value) && ((_a = parsedOptions.find((opt) => opt.value == props.value)) == null ? void 0 : _a.label);
36773
+ const value = (props == null ? void 0 : props.value) ? ((_a = parsedOptions.find((opt) => opt.value == props.value)) == null ? void 0 : _a.label) || "" : "";
36774
36774
  setInputValue(value);
36775
36775
  }, [children]);
36776
36776
  (0, import_react9.useEffect)(() => {
@@ -36798,7 +36798,8 @@ function Select({
36798
36798
  }
36799
36799
  };
36800
36800
  const selectOption = (opt) => {
36801
- setInputValue(opt.label);
36801
+ const v = `${opt.label}`;
36802
+ setInputValue(v);
36802
36803
  setIsOpen(false);
36803
36804
  };
36804
36805
  const containerRef = (0, import_react9.useRef)(null);
@@ -36816,7 +36817,7 @@ function Select({
36816
36817
  }
36817
36818
  }, [isOpen]);
36818
36819
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { ref: containerRef, className: "w-full relative my-3", children: [
36819
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative flex items-center border rounded bg-white", children: [
36820
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative flex items-center border rounded bg-white ", children: [
36820
36821
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
36821
36822
  "input",
36822
36823
  {
@@ -36877,7 +36878,7 @@ function Select({
36877
36878
  children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CloseIcon, {})
36878
36879
  }
36879
36880
  ),
36880
- isOpen && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
36881
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
36881
36882
  "div",
36882
36883
  {
36883
36884
  style: { zIndex: 9999999999 },
@@ -38770,10 +38771,10 @@ function Header({
38770
38771
  "div",
38771
38772
  {
38772
38773
  ref: cellRef,
38773
- className: "break-words border text-center relative ",
38774
+ className: "shadow ",
38774
38775
  style: { zIndex: 10, height: `${padding}px`, maxHeight: "100px" },
38775
38776
  children: [
38776
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex gap-5 items-center justify-between h-full cursor-pointer", children: [
38777
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex justify-between items-center ", children: [
38777
38778
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex gap-2", children: [
38778
38779
  hasFilter ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
38779
38780
  "div",
@@ -38801,7 +38802,8 @@ function Header({
38801
38802
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
38802
38803
  "div",
38803
38804
  {
38804
- className: "w-full",
38805
+ className: "font-bold flex truncate text-xs items-center ",
38806
+ style: { height: `${padding}px` },
38805
38807
  onClick: (e) => {
38806
38808
  context.setSort({
38807
38809
  [header]: "TOGGLE"
@@ -39153,10 +39155,14 @@ function HTable({
39153
39155
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
39154
39156
  "div",
39155
39157
  {
39156
- className: [context.className, "bg-white relative"].join(" "),
39158
+ className: [
39159
+ context.className,
39160
+ "bg-white relative",
39161
+ "p-2 border shadow rounded-2xl"
39162
+ ].join(" "),
39157
39163
  ref: tableRef,
39158
39164
  children: [
39159
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "bg-white px-1 font-bold", children: context.header }),
39165
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "bg-white px-1 font-bold rounded-full", children: context.header }),
39160
39166
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "bg-white flex gap-2 items-center", children: [
39161
39167
  context.searchable && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Searchable, { context }),
39162
39168
  context.exportName && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
@@ -39225,8 +39231,7 @@ function HTable({
39225
39231
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
39226
39232
  "div",
39227
39233
  {
39228
- className: "bg-white",
39229
- style: { position: "relative" },
39234
+ className: "bg-white relative w-full bg-red-100",
39230
39235
  children: [
39231
39236
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
39232
39237
  Header,
@@ -39262,7 +39267,7 @@ function HTable({
39262
39267
  searchedData.map((row, rowIndex) => {
39263
39268
  const items = Object.entries(row);
39264
39269
  return items.map(([key, item], i) => {
39265
- var _a, _b, _c, _d, _e, _f, _g;
39270
+ var _a, _b, _c, _d, _e;
39266
39271
  if ((_b = (_a = context == null ? void 0 : context.hideColumns) == null ? void 0 : _a.includes) == null ? void 0 : _b.call(_a, key)) return null;
39267
39272
  if (key.startsWith("_") && !key.startsWith("__")) return null;
39268
39273
  if (key == "__modal__") {
@@ -39385,8 +39390,7 @@ function HTable({
39385
39390
  }
39386
39391
  }
39387
39392
  context.setData(newData);
39388
- },
39389
- className: `${(_g = (_f = context.buttons[key]) == null ? void 0 : _f.props) == null ? void 0 : _g.className} text-xs w-full`
39393
+ }
39390
39394
  }) : ["number", "string"].includes(typeof item) ? valueFormatter({
39391
39395
  value: item,
39392
39396
  currentCoin: context.currentCoin
package/dist/index.mjs CHANGED
@@ -36750,12 +36750,12 @@ function Select({
36750
36750
  }).map((child) => {
36751
36751
  return {
36752
36752
  value: child.props.value,
36753
- label: child.props.children
36753
+ label: React5.Children.toArray(child.props.children).join("")
36754
36754
  };
36755
36755
  });
36756
36756
  setOptions(parsedOptions);
36757
36757
  setFiltered(parsedOptions);
36758
- const value = (props == null ? void 0 : props.value) && ((_a = parsedOptions.find((opt) => opt.value == props.value)) == null ? void 0 : _a.label);
36758
+ const value = (props == null ? void 0 : props.value) ? ((_a = parsedOptions.find((opt) => opt.value == props.value)) == null ? void 0 : _a.label) || "" : "";
36759
36759
  setInputValue(value);
36760
36760
  }, [children]);
36761
36761
  useEffect5(() => {
@@ -36783,7 +36783,8 @@ function Select({
36783
36783
  }
36784
36784
  };
36785
36785
  const selectOption = (opt) => {
36786
- setInputValue(opt.label);
36786
+ const v = `${opt.label}`;
36787
+ setInputValue(v);
36787
36788
  setIsOpen(false);
36788
36789
  };
36789
36790
  const containerRef = useRef2(null);
@@ -36801,7 +36802,7 @@ function Select({
36801
36802
  }
36802
36803
  }, [isOpen]);
36803
36804
  return /* @__PURE__ */ jsxs7("div", { ref: containerRef, className: "w-full relative my-3", children: [
36804
- /* @__PURE__ */ jsxs7("div", { className: "relative flex items-center border rounded bg-white", children: [
36805
+ /* @__PURE__ */ jsxs7("div", { className: "relative flex items-center border rounded bg-white ", children: [
36805
36806
  /* @__PURE__ */ jsx10(
36806
36807
  "input",
36807
36808
  {
@@ -36862,7 +36863,7 @@ function Select({
36862
36863
  children: /* @__PURE__ */ jsx10(CloseIcon, {})
36863
36864
  }
36864
36865
  ),
36865
- isOpen && filtered.length > 0 && /* @__PURE__ */ jsx10(
36866
+ isOpen && /* @__PURE__ */ jsx10(
36866
36867
  "div",
36867
36868
  {
36868
36869
  style: { zIndex: 9999999999 },
@@ -38768,10 +38769,10 @@ function Header({
38768
38769
  "div",
38769
38770
  {
38770
38771
  ref: cellRef,
38771
- className: "break-words border text-center relative ",
38772
+ className: "shadow ",
38772
38773
  style: { zIndex: 10, height: `${padding}px`, maxHeight: "100px" },
38773
38774
  children: [
38774
- /* @__PURE__ */ jsxs23("div", { className: "flex gap-5 items-center justify-between h-full cursor-pointer", children: [
38775
+ /* @__PURE__ */ jsxs23("div", { className: "flex justify-between items-center ", children: [
38775
38776
  /* @__PURE__ */ jsxs23("div", { className: "flex gap-2", children: [
38776
38777
  hasFilter ? /* @__PURE__ */ jsx31(
38777
38778
  "div",
@@ -38799,7 +38800,8 @@ function Header({
38799
38800
  /* @__PURE__ */ jsx31(
38800
38801
  "div",
38801
38802
  {
38802
- className: "w-full",
38803
+ className: "font-bold flex truncate text-xs items-center ",
38804
+ style: { height: `${padding}px` },
38803
38805
  onClick: (e) => {
38804
38806
  context.setSort({
38805
38807
  [header]: "TOGGLE"
@@ -39151,10 +39153,14 @@ function HTable({
39151
39153
  return /* @__PURE__ */ jsxs25(
39152
39154
  "div",
39153
39155
  {
39154
- className: [context.className, "bg-white relative"].join(" "),
39156
+ className: [
39157
+ context.className,
39158
+ "bg-white relative",
39159
+ "p-2 border shadow rounded-2xl"
39160
+ ].join(" "),
39155
39161
  ref: tableRef,
39156
39162
  children: [
39157
- /* @__PURE__ */ jsx33("div", { className: "bg-white px-1 font-bold", children: context.header }),
39163
+ /* @__PURE__ */ jsx33("div", { className: "bg-white px-1 font-bold rounded-full", children: context.header }),
39158
39164
  /* @__PURE__ */ jsxs25("div", { className: "bg-white flex gap-2 items-center", children: [
39159
39165
  context.searchable && /* @__PURE__ */ jsx33(Searchable, { context }),
39160
39166
  context.exportName && /* @__PURE__ */ jsxs25(
@@ -39223,8 +39229,7 @@ function HTable({
39223
39229
  return /* @__PURE__ */ jsxs25(
39224
39230
  "div",
39225
39231
  {
39226
- className: "bg-white",
39227
- style: { position: "relative" },
39232
+ className: "bg-white relative w-full bg-red-100",
39228
39233
  children: [
39229
39234
  /* @__PURE__ */ jsx33(
39230
39235
  Header,
@@ -39260,7 +39265,7 @@ function HTable({
39260
39265
  searchedData.map((row, rowIndex) => {
39261
39266
  const items = Object.entries(row);
39262
39267
  return items.map(([key, item], i) => {
39263
- var _a, _b, _c, _d, _e, _f, _g;
39268
+ var _a, _b, _c, _d, _e;
39264
39269
  if ((_b = (_a = context == null ? void 0 : context.hideColumns) == null ? void 0 : _a.includes) == null ? void 0 : _b.call(_a, key)) return null;
39265
39270
  if (key.startsWith("_") && !key.startsWith("__")) return null;
39266
39271
  if (key == "__modal__") {
@@ -39383,8 +39388,7 @@ function HTable({
39383
39388
  }
39384
39389
  }
39385
39390
  context.setData(newData);
39386
- },
39387
- className: `${(_g = (_f = context.buttons[key]) == null ? void 0 : _f.props) == null ? void 0 : _g.className} text-xs w-full`
39391
+ }
39388
39392
  }) : ["number", "string"].includes(typeof item) ? valueFormatter({
39389
39393
  value: item,
39390
39394
  currentCoin: context.currentCoin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "2.0.44",
3
+ "version": "2.0.46",
4
4
  "description": "description nueva",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -56,14 +56,14 @@ export default function Select({
56
56
  .map((child: any) => {
57
57
  return {
58
58
  value: child.props.value,
59
- label: child.props.children,
59
+ label: React.Children.toArray(child.props.children).join(""),
60
60
  };
61
61
  });
62
62
  setOptions(parsedOptions);
63
63
  setFiltered(parsedOptions);
64
- const value =
65
- props?.value &&
66
- parsedOptions.find((opt) => opt.value == props.value)?.label;
64
+ const value = props?.value
65
+ ? parsedOptions.find((opt) => opt.value == props.value)?.label || ""
66
+ : "";
67
67
  setInputValue(value);
68
68
  }, [children]);
69
69
 
@@ -97,8 +97,9 @@ export default function Select({
97
97
  };
98
98
 
99
99
  const selectOption = (opt: { value: string; label: string }) => {
100
- // console.log(opt.label);
101
- setInputValue(opt.label);
100
+ const v = `${opt.label}`;
101
+
102
+ setInputValue(v);
102
103
  setIsOpen(false);
103
104
  };
104
105
 
@@ -120,7 +121,7 @@ export default function Select({
120
121
  }, [isOpen]);
121
122
  return (
122
123
  <div ref={containerRef} className="w-full relative my-3">
123
- <div className="relative flex items-center border rounded bg-white">
124
+ <div className="relative flex items-center border rounded bg-white ">
124
125
  <input
125
126
  autoComplete="off"
126
127
  ref={inputRef}
@@ -162,6 +163,7 @@ export default function Select({
162
163
  onFocus={() => setIsOpen(true)}
163
164
  onKeyDown={handleKeyDown}
164
165
  />
166
+
165
167
  {label && (
166
168
  <label className="absolute -top-2.5 left-2 text-xs font-bold px-1">
167
169
  {label} {props?.required && <span className="text-red-500">*</span>}
@@ -190,7 +192,7 @@ export default function Select({
190
192
  <CloseIcon />
191
193
  </button>
192
194
  )}
193
- {isOpen && filtered.length > 0 && (
195
+ {isOpen && (
194
196
  <div
195
197
  style={{ zIndex: 9999999999 }}
196
198
  className={`absolute w-full border rounded shadow bg-white z-10 max-h-100 top-10 overflow-y-auto ${
@@ -153,10 +153,16 @@ export default function HTable({
153
153
  });
154
154
  return (
155
155
  <div
156
- className={[context.className, "bg-white relative"].join(" ")}
156
+ className={[
157
+ context.className,
158
+ "bg-white relative",
159
+ "p-2 border shadow rounded-2xl",
160
+ ].join(" ")}
157
161
  ref={tableRef}
158
162
  >
159
- <div className="bg-white px-1 font-bold">{context.header}</div>
163
+ <div className="bg-white px-1 font-bold rounded-full">
164
+ {context.header}
165
+ </div>
160
166
  <div className="bg-white flex gap-2 items-center">
161
167
  {context.searchable && <Searchable context={context} />}
162
168
  {context.exportName && (
@@ -234,8 +240,8 @@ export default function HTable({
234
240
  return (
235
241
  <div
236
242
  key={header}
237
- className="bg-white"
238
- style={{ position: "relative" }}
243
+ className="bg-white relative w-full bg-red-100"
244
+ // style={{ position: "relative" }}
239
245
  >
240
246
  <Header
241
247
  padding={padding}
@@ -444,7 +450,6 @@ export default function HTable({
444
450
 
445
451
  context.setData(newData);
446
452
  },
447
- className: `${context.buttons[key]?.props?.className} text-xs w-full`,
448
453
  })
449
454
  ) : ["number", "string"].includes(typeof item) ? (
450
455
  valueFormatter({
@@ -121,10 +121,10 @@ export function Header({
121
121
  <div className="">
122
122
  <div
123
123
  ref={cellRef}
124
- className={"break-words border text-center relative "}
124
+ className={"shadow "}
125
125
  style={{ zIndex: 10, height: `${padding}px`, maxHeight: "100px" }}
126
126
  >
127
- <div className="flex gap-5 items-center justify-between h-full cursor-pointer">
127
+ <div className="flex justify-between items-center ">
128
128
  <div className="flex gap-2">
129
129
  {hasFilter ? (
130
130
  <div
@@ -158,7 +158,8 @@ export function Header({
158
158
  </div>
159
159
  </div>
160
160
  <div
161
- className="w-full"
161
+ className="font-bold flex truncate text-xs items-center "
162
+ style={{ height: `${padding}px` }}
162
163
  onClick={(e) => {
163
164
  context.setSort({
164
165
  [header]: "TOGGLE",