next-recomponents 1.7.42 → 1.7.44
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 +8 -6
- package/dist/index.mjs +8 -6
- package/package.json +1 -1
- package/src/container/index.tsx +14 -9
- package/src/table/h.tsx +7 -2
package/dist/index.js
CHANGED
|
@@ -10963,17 +10963,18 @@ function Container({
|
|
|
10963
10963
|
),
|
|
10964
10964
|
menuList && menuList.map((itemMenu, k) => {
|
|
10965
10965
|
const letra = `${itemMenu == null ? void 0 : itemMenu.name}`.split("")[0];
|
|
10966
|
+
const icon = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: (itemMenu == null ? void 0 : itemMenu.icon) || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "px-1 border shadow rounded", children: letra }) });
|
|
10966
10967
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
10967
10968
|
import_link.default,
|
|
10968
10969
|
{
|
|
10969
10970
|
href: (itemMenu == null ? void 0 : itemMenu.location) || "#",
|
|
10970
10971
|
onClick: () => setIsSidebarOpen(false),
|
|
10971
10972
|
children: [
|
|
10972
|
-
isSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex p-1 items-center hover:bg-gray-
|
|
10973
|
-
|
|
10974
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: itemMenu == null ? void 0 : itemMenu.name })
|
|
10973
|
+
isSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "text-sm flex p-1 gap-1 items-center hover:bg-gray-200 hover:text-black rounded", children: [
|
|
10974
|
+
icon,
|
|
10975
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: " truncate", children: itemMenu == null ? void 0 : itemMenu.name })
|
|
10975
10976
|
] }),
|
|
10976
|
-
!isSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hover:bg-gray-200 hover:text-black rounded p-1", children:
|
|
10977
|
+
!isSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "text-sm hover:bg-gray-200 hover:text-black rounded p-1", children: icon })
|
|
10977
10978
|
]
|
|
10978
10979
|
}
|
|
10979
10980
|
) }, k);
|
|
@@ -43411,7 +43412,7 @@ function HTable(_a) {
|
|
|
43411
43412
|
}, [mapedData]);
|
|
43412
43413
|
(0, import_react25.useEffect)(() => {
|
|
43413
43414
|
const newData = data.map((d, trkey) => {
|
|
43414
|
-
var _a2, _b2;
|
|
43415
|
+
var _a2, _b2, _c;
|
|
43415
43416
|
const obj = {};
|
|
43416
43417
|
for (let key in d) {
|
|
43417
43418
|
const item = {};
|
|
@@ -43423,7 +43424,8 @@ function HTable(_a) {
|
|
|
43423
43424
|
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
43424
43425
|
const isDate = !isObject2 && regex.test(`${d[key]}`);
|
|
43425
43426
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
43426
|
-
const
|
|
43427
|
+
const mapedContent = (_b2 = mapedData[trkey][key]) == null ? void 0 : _b2.content;
|
|
43428
|
+
const content = mapedContent || (cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? import_react25.default.isValidElement(d[key]) ? ((_c = d[key]) == null ? void 0 : _c.props).value : JSON.stringify(d[key]) : d[key]);
|
|
43427
43429
|
const handler = import_react25.default.isValidElement(d[key]) ? d[key] : null;
|
|
43428
43430
|
obj[key] = {
|
|
43429
43431
|
index: trkey,
|
package/dist/index.mjs
CHANGED
|
@@ -10940,17 +10940,18 @@ function Container({
|
|
|
10940
10940
|
),
|
|
10941
10941
|
menuList && menuList.map((itemMenu, k) => {
|
|
10942
10942
|
const letra = `${itemMenu == null ? void 0 : itemMenu.name}`.split("")[0];
|
|
10943
|
+
const icon = /* @__PURE__ */ jsx5(Fragment3, { children: (itemMenu == null ? void 0 : itemMenu.icon) || /* @__PURE__ */ jsx5("span", { className: "px-1 border shadow rounded", children: letra }) });
|
|
10943
10944
|
return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsxs3(
|
|
10944
10945
|
import_link.default,
|
|
10945
10946
|
{
|
|
10946
10947
|
href: (itemMenu == null ? void 0 : itemMenu.location) || "#",
|
|
10947
10948
|
onClick: () => setIsSidebarOpen(false),
|
|
10948
10949
|
children: [
|
|
10949
|
-
isSidebarOpen && /* @__PURE__ */ jsxs3("div", { className: "flex p-1 items-center hover:bg-gray-
|
|
10950
|
-
|
|
10951
|
-
/* @__PURE__ */ jsx5("div", { children: itemMenu == null ? void 0 : itemMenu.name })
|
|
10950
|
+
isSidebarOpen && /* @__PURE__ */ jsxs3("div", { className: "text-sm flex p-1 gap-1 items-center hover:bg-gray-200 hover:text-black rounded", children: [
|
|
10951
|
+
icon,
|
|
10952
|
+
/* @__PURE__ */ jsx5("div", { className: " truncate", children: itemMenu == null ? void 0 : itemMenu.name })
|
|
10952
10953
|
] }),
|
|
10953
|
-
!isSidebarOpen && /* @__PURE__ */ jsx5("div", { className: "hover:bg-gray-200 hover:text-black rounded p-1", children:
|
|
10954
|
+
!isSidebarOpen && /* @__PURE__ */ jsx5("div", { className: "text-sm hover:bg-gray-200 hover:text-black rounded p-1", children: icon })
|
|
10954
10955
|
]
|
|
10955
10956
|
}
|
|
10956
10957
|
) }, k);
|
|
@@ -43393,7 +43394,7 @@ function HTable(_a) {
|
|
|
43393
43394
|
}, [mapedData]);
|
|
43394
43395
|
useEffect6(() => {
|
|
43395
43396
|
const newData = data.map((d, trkey) => {
|
|
43396
|
-
var _a2, _b2;
|
|
43397
|
+
var _a2, _b2, _c;
|
|
43397
43398
|
const obj = {};
|
|
43398
43399
|
for (let key in d) {
|
|
43399
43400
|
const item = {};
|
|
@@ -43405,7 +43406,8 @@ function HTable(_a) {
|
|
|
43405
43406
|
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
43406
43407
|
const isDate = !isObject2 && regex.test(`${d[key]}`);
|
|
43407
43408
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
43408
|
-
const
|
|
43409
|
+
const mapedContent = (_b2 = mapedData[trkey][key]) == null ? void 0 : _b2.content;
|
|
43410
|
+
const content = mapedContent || (cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? React4.isValidElement(d[key]) ? ((_c = d[key]) == null ? void 0 : _c.props).value : JSON.stringify(d[key]) : d[key]);
|
|
43409
43411
|
const handler = React4.isValidElement(d[key]) ? d[key] : null;
|
|
43410
43412
|
obj[key] = {
|
|
43411
43413
|
index: trkey,
|
package/package.json
CHANGED
package/src/container/index.tsx
CHANGED
|
@@ -101,6 +101,15 @@ export default function Container({
|
|
|
101
101
|
{menuList &&
|
|
102
102
|
menuList.map((itemMenu, k) => {
|
|
103
103
|
const letra = `${itemMenu?.name}`.split("")[0];
|
|
104
|
+
const icon = (
|
|
105
|
+
<>
|
|
106
|
+
{itemMenu?.icon || (
|
|
107
|
+
<span className="px-1 border shadow rounded">
|
|
108
|
+
{letra}
|
|
109
|
+
</span>
|
|
110
|
+
)}
|
|
111
|
+
</>
|
|
112
|
+
);
|
|
104
113
|
return (
|
|
105
114
|
<li key={k}>
|
|
106
115
|
<Link
|
|
@@ -108,18 +117,14 @@ export default function Container({
|
|
|
108
117
|
onClick={() => setIsSidebarOpen(false)}
|
|
109
118
|
>
|
|
110
119
|
{isSidebarOpen && (
|
|
111
|
-
<div className="flex p-1 items-center hover:bg-gray-
|
|
112
|
-
{
|
|
113
|
-
<div>{itemMenu?.name}</div>
|
|
120
|
+
<div className="text-sm flex p-1 gap-1 items-center hover:bg-gray-200 hover:text-black rounded">
|
|
121
|
+
{icon}
|
|
122
|
+
<div className=" truncate">{itemMenu?.name}</div>
|
|
114
123
|
</div>
|
|
115
124
|
)}
|
|
116
125
|
{!isSidebarOpen && (
|
|
117
|
-
<div className="hover:bg-gray-200 hover:text-black rounded p-1">
|
|
118
|
-
{
|
|
119
|
-
<span className="px-1 border shadow rounded">
|
|
120
|
-
{letra}
|
|
121
|
-
</span>
|
|
122
|
-
)}
|
|
126
|
+
<div className="text-sm hover:bg-gray-200 hover:text-black rounded p-1">
|
|
127
|
+
{icon}
|
|
123
128
|
</div>
|
|
124
129
|
)}
|
|
125
130
|
</Link>
|
package/src/table/h.tsx
CHANGED
|
@@ -57,6 +57,7 @@ export default function HTable({
|
|
|
57
57
|
const obj: any = {};
|
|
58
58
|
for (let key in d) {
|
|
59
59
|
const item: any = {};
|
|
60
|
+
|
|
60
61
|
for (let key in d) {
|
|
61
62
|
item[key] = d[key]?.content || d[key];
|
|
62
63
|
}
|
|
@@ -66,14 +67,17 @@ export default function HTable({
|
|
|
66
67
|
|
|
67
68
|
const isDate = !isObject && regex.test(`${d[key]}`);
|
|
68
69
|
const cellTypeOf = isDate ? "date" : isObject ? "object" : typeOf;
|
|
70
|
+
const mapedContent = (mapedData[trkey][key] as any)?.content;
|
|
71
|
+
|
|
69
72
|
const content =
|
|
70
|
-
|
|
73
|
+
mapedContent ||
|
|
74
|
+
(cellTypeOf == "date"
|
|
71
75
|
? d[key].split("T").join(" ").split(".")[0]
|
|
72
76
|
: cellTypeOf == "object"
|
|
73
77
|
? React.isValidElement(d[key])
|
|
74
78
|
? (d[key]?.props as any).value
|
|
75
79
|
: JSON.stringify(d[key])
|
|
76
|
-
: d[key];
|
|
80
|
+
: d[key]);
|
|
77
81
|
const handler = React.isValidElement(d[key]) ? d[key] : null;
|
|
78
82
|
obj[key] = {
|
|
79
83
|
index: trkey,
|
|
@@ -189,6 +193,7 @@ export default function HTable({
|
|
|
189
193
|
}
|
|
190
194
|
}
|
|
191
195
|
const dataKey = md?.id?.content || trKey;
|
|
196
|
+
|
|
192
197
|
return (
|
|
193
198
|
<tr
|
|
194
199
|
onDoubleClick={(e) => {
|