next-recomponents 1.2.5 → 1.2.6

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
@@ -11126,7 +11126,7 @@ var regular_expresions_default = regularExpresions;
11126
11126
  var import_react26 = require("react");
11127
11127
 
11128
11128
  // src/table/h.tsx
11129
- var import_react25 = require("react");
11129
+ var import_react25 = __toESM(require("react"));
11130
11130
 
11131
11131
  // src/table/td.tsx
11132
11132
  var import_react23 = __toESM(require("react"));
@@ -11437,7 +11437,7 @@ function HTable(_a) {
11437
11437
  const isObject2 = typeOf == "object";
11438
11438
  const isDate = typeOf == "string" && d[key].includes("T");
11439
11439
  const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
11440
- const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? JSON.stringify(d[key]) : d[key];
11440
+ const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? import_react25.default.isValidElement(d[key]) ? d[key] : JSON.stringify(d[key]) : d[key];
11441
11441
  obj[key] = {
11442
11442
  originalData: content,
11443
11443
  cellTypeOf,
package/dist/index.mjs CHANGED
@@ -11117,7 +11117,7 @@ var regular_expresions_default = regularExpresions;
11117
11117
  import { useState as useState7 } from "react";
11118
11118
 
11119
11119
  // src/table/h.tsx
11120
- import { useEffect as useEffect7, useMemo as useMemo7, useRef as useRef4, useState as useState6 } from "react";
11120
+ import React4, { useEffect as useEffect7, useMemo as useMemo7, useRef as useRef4, useState as useState6 } from "react";
11121
11121
 
11122
11122
  // src/table/td.tsx
11123
11123
  import React3, { useMemo as useMemo6, useState as useState4 } from "react";
@@ -11428,7 +11428,7 @@ function HTable(_a) {
11428
11428
  const isObject2 = typeOf == "object";
11429
11429
  const isDate = typeOf == "string" && d[key].includes("T");
11430
11430
  const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
11431
- const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? JSON.stringify(d[key]) : d[key];
11431
+ const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? React4.isValidElement(d[key]) ? d[key] : JSON.stringify(d[key]) : d[key];
11432
11432
  obj[key] = {
11433
11433
  originalData: content,
11434
11434
  cellTypeOf,
@@ -32471,7 +32471,7 @@ function useResources({
32471
32471
  }
32472
32472
 
32473
32473
  // src/select/index.tsx
32474
- import React5, {
32474
+ import React6, {
32475
32475
  useEffect as useEffect9,
32476
32476
  useRef as useRef5,
32477
32477
  useState as useState10
@@ -32541,7 +32541,7 @@ function Select(_a) {
32541
32541
  return options.find((opt) => opt.label == value);
32542
32542
  };
32543
32543
  useEffect9(() => {
32544
- const parsedOptions = React5.Children.toArray(children).filter((child) => {
32544
+ const parsedOptions = React6.Children.toArray(children).filter((child) => {
32545
32545
  return child.type === "option";
32546
32546
  }).map((child) => {
32547
32547
  const el = child;
@@ -32700,7 +32700,7 @@ function Select(_a) {
32700
32700
  }
32701
32701
 
32702
32702
  // src/modal/index.tsx
32703
- import React6, { useRef as useRef6 } from "react";
32703
+ import React7, { useRef as useRef6 } from "react";
32704
32704
  import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
32705
32705
  function Modal({ button, children, ref }) {
32706
32706
  const modalRef = ref || useRef6(null);
@@ -32713,9 +32713,9 @@ function Modal({ button, children, ref }) {
32713
32713
  typeof modalRef == "object" && ((_a = modalRef.current) == null ? void 0 : _a.close());
32714
32714
  }
32715
32715
  return /* @__PURE__ */ jsxs12(Fragment4, { children: [
32716
- React6.Children.map(button, (child) => {
32717
- if (React6.isValidElement(child)) {
32718
- return React6.cloneElement(child, {
32716
+ React7.Children.map(button, (child) => {
32717
+ if (React7.isValidElement(child)) {
32718
+ return React7.cloneElement(child, {
32719
32719
  onClick: (e) => {
32720
32720
  var _a, _b;
32721
32721
  show();
@@ -32734,9 +32734,9 @@ function Modal({ button, children, ref }) {
32734
32734
  children: "X"
32735
32735
  }
32736
32736
  ),
32737
- /* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-3 pt-6", children: React6.Children.map(children, (child) => {
32738
- if (React6.isValidElement(child)) {
32739
- return React6.cloneElement(child, { hide });
32737
+ /* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-3 pt-6", children: React7.Children.map(children, (child) => {
32738
+ if (React7.isValidElement(child)) {
32739
+ return React7.cloneElement(child, { hide });
32740
32740
  }
32741
32741
  return child;
32742
32742
  }) })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/table/h.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { useEffect, useMemo, useRef, useState } from "react";
1
+ import React, { useEffect, useMemo, useRef, useState } from "react";
2
2
  import { TableProps } from ".";
3
3
  import TD from "./td";
4
4
  import { FilterOffIcon } from "./filters";
@@ -59,7 +59,9 @@ export default function HTable({
59
59
  cellTypeOf == "date"
60
60
  ? d[key].split("T").join(" ").split(".")[0]
61
61
  : cellTypeOf == "object"
62
- ? JSON.stringify(d[key])
62
+ ? React.isValidElement(d[key])
63
+ ? d[key]
64
+ : JSON.stringify(d[key])
63
65
  : d[key];
64
66
  obj[key] = {
65
67
  originalData: content,