next-recomponents 1.7.48 → 1.7.51
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 +10 -5
- package/dist/index.mjs +10 -5
- package/package.json +1 -1
- package/src/table/h.tsx +51 -40
- package/tsconfig.json +2 -2
package/dist/index.js
CHANGED
|
@@ -43424,7 +43424,12 @@ function HTable(_a) {
|
|
|
43424
43424
|
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
43425
43425
|
const isDate = !isObject2 && regex.test(`${d[key]}`);
|
|
43426
43426
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
43427
|
-
const mapedIndex = mapedData.find(
|
|
43427
|
+
const mapedIndex = mapedData.find(
|
|
43428
|
+
(mpd) => {
|
|
43429
|
+
var _a3;
|
|
43430
|
+
return ((_a3 = mpd == null ? void 0 : mpd.id) == null ? void 0 : _a3.content) == d.id;
|
|
43431
|
+
}
|
|
43432
|
+
);
|
|
43428
43433
|
const mapedContent = (_b2 = mapedIndex == null ? void 0 : mapedIndex[key]) == null ? void 0 : _b2.content;
|
|
43429
43434
|
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]);
|
|
43430
43435
|
const handler = import_react25.default.isValidElement(d[key]) ? d[key] : null;
|
|
@@ -43490,7 +43495,7 @@ function HTable(_a) {
|
|
|
43490
43495
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("table", __spreadProps(__spreadValues({}, props), { className: "w-full border-collapse table-auto", children: [
|
|
43491
43496
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("thead", { className: "bg-gray-800 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tr", { children: head.map((h, key) => {
|
|
43492
43497
|
var _a2;
|
|
43493
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
43498
|
+
return h != "_id" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
43494
43499
|
"th",
|
|
43495
43500
|
{
|
|
43496
43501
|
className: "whitespace-nowrap overflow-hidden text-ellipsis max-w-[200px] border-b p-2",
|
|
@@ -43557,10 +43562,10 @@ function HTable(_a) {
|
|
|
43557
43562
|
selected == trKey && "bg-green-200 hover:bg-green-300"
|
|
43558
43563
|
].join(" "),
|
|
43559
43564
|
children: head.map((h, tdKey) => {
|
|
43560
|
-
var _a3;
|
|
43565
|
+
var _a3, _b3;
|
|
43561
43566
|
const item = md[h];
|
|
43562
|
-
const id3 = trKey + "-" + (((_a3 = md == null ? void 0 : md.id) == null ? void 0 :
|
|
43563
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
43567
|
+
const id3 = trKey + "-" + (((_a3 = md == null ? void 0 : md["_id"]) == null ? void 0 : _a3.content) || ((_b3 = md == null ? void 0 : md.id) == null ? void 0 : _b3.content) || tdKey) + "-" + h;
|
|
43568
|
+
return h != "_id" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
43564
43569
|
TD,
|
|
43565
43570
|
{
|
|
43566
43571
|
"data-key": id3,
|
package/dist/index.mjs
CHANGED
|
@@ -43406,7 +43406,12 @@ function HTable(_a) {
|
|
|
43406
43406
|
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
43407
43407
|
const isDate = !isObject2 && regex.test(`${d[key]}`);
|
|
43408
43408
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
43409
|
-
const mapedIndex = mapedData.find(
|
|
43409
|
+
const mapedIndex = mapedData.find(
|
|
43410
|
+
(mpd) => {
|
|
43411
|
+
var _a3;
|
|
43412
|
+
return ((_a3 = mpd == null ? void 0 : mpd.id) == null ? void 0 : _a3.content) == d.id;
|
|
43413
|
+
}
|
|
43414
|
+
);
|
|
43410
43415
|
const mapedContent = (_b2 = mapedIndex == null ? void 0 : mapedIndex[key]) == null ? void 0 : _b2.content;
|
|
43411
43416
|
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]);
|
|
43412
43417
|
const handler = React4.isValidElement(d[key]) ? d[key] : null;
|
|
@@ -43472,7 +43477,7 @@ function HTable(_a) {
|
|
|
43472
43477
|
/* @__PURE__ */ jsxs10("table", __spreadProps(__spreadValues({}, props), { className: "w-full border-collapse table-auto", children: [
|
|
43473
43478
|
/* @__PURE__ */ jsx12("thead", { className: "bg-gray-800 text-white", children: /* @__PURE__ */ jsx12("tr", { children: head.map((h, key) => {
|
|
43474
43479
|
var _a2;
|
|
43475
|
-
return /* @__PURE__ */ jsxs10(
|
|
43480
|
+
return h != "_id" && /* @__PURE__ */ jsxs10(
|
|
43476
43481
|
"th",
|
|
43477
43482
|
{
|
|
43478
43483
|
className: "whitespace-nowrap overflow-hidden text-ellipsis max-w-[200px] border-b p-2",
|
|
@@ -43539,10 +43544,10 @@ function HTable(_a) {
|
|
|
43539
43544
|
selected == trKey && "bg-green-200 hover:bg-green-300"
|
|
43540
43545
|
].join(" "),
|
|
43541
43546
|
children: head.map((h, tdKey) => {
|
|
43542
|
-
var _a3;
|
|
43547
|
+
var _a3, _b3;
|
|
43543
43548
|
const item = md[h];
|
|
43544
|
-
const id3 = trKey + "-" + (((_a3 = md == null ? void 0 : md.id) == null ? void 0 :
|
|
43545
|
-
return /* @__PURE__ */ jsx12(
|
|
43549
|
+
const id3 = trKey + "-" + (((_a3 = md == null ? void 0 : md["_id"]) == null ? void 0 : _a3.content) || ((_b3 = md == null ? void 0 : md.id) == null ? void 0 : _b3.content) || tdKey) + "-" + h;
|
|
43550
|
+
return h != "_id" && /* @__PURE__ */ jsx12(
|
|
43546
43551
|
TD,
|
|
43547
43552
|
{
|
|
43548
43553
|
"data-key": id3,
|
package/package.json
CHANGED
package/src/table/h.tsx
CHANGED
|
@@ -67,7 +67,9 @@ export default function HTable({
|
|
|
67
67
|
|
|
68
68
|
const isDate = !isObject && regex.test(`${d[key]}`);
|
|
69
69
|
const cellTypeOf = isDate ? "date" : isObject ? "object" : typeOf;
|
|
70
|
-
const mapedIndex = mapedData.find(
|
|
70
|
+
const mapedIndex = mapedData.find(
|
|
71
|
+
(mpd) => (mpd?.id as any)?.content == d.id
|
|
72
|
+
);
|
|
71
73
|
|
|
72
74
|
const mapedContent = (mapedIndex?.[key] as any)?.content;
|
|
73
75
|
|
|
@@ -144,37 +146,39 @@ export default function HTable({
|
|
|
144
146
|
<tr>
|
|
145
147
|
{head.map((h, key) => {
|
|
146
148
|
return (
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<div
|
|
152
|
-
className="cursor-pointer flex "
|
|
153
|
-
onClick={(e) => {
|
|
154
|
-
setSelectedFilter(key == selectedFilter ? null : key);
|
|
155
|
-
}}
|
|
149
|
+
h != "_id" && (
|
|
150
|
+
<th
|
|
151
|
+
key={h}
|
|
152
|
+
className="whitespace-nowrap overflow-hidden text-ellipsis max-w-[200px] border-b p-2"
|
|
156
153
|
>
|
|
157
|
-
<div
|
|
158
|
-
|
|
159
|
-
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
154
|
+
<div
|
|
155
|
+
className="cursor-pointer flex "
|
|
156
|
+
onClick={(e) => {
|
|
157
|
+
setSelectedFilter(key == selectedFilter ? null : key);
|
|
158
|
+
}}
|
|
159
|
+
>
|
|
160
|
+
<div className="text-white w-full bg-black rounded flex justify-center">
|
|
161
|
+
{h}{" "}
|
|
162
|
+
{!mapedData
|
|
163
|
+
?.map((d: any) => d[h]?.exclude)
|
|
164
|
+
?.every((d: any) => d === false) && (
|
|
165
|
+
<div className="text-red-300">
|
|
166
|
+
<FilterOffIcon />
|
|
167
|
+
</div>
|
|
168
|
+
)}
|
|
169
|
+
</div>
|
|
166
170
|
</div>
|
|
167
|
-
</div>
|
|
168
171
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
172
|
+
<FilterMenu
|
|
173
|
+
h={h}
|
|
174
|
+
mapedData={mapedData}
|
|
175
|
+
setMapedData={setMapedData}
|
|
176
|
+
index={key}
|
|
177
|
+
selectedFilter={selectedFilter}
|
|
178
|
+
setSelectedFilter={setSelectedFilter}
|
|
179
|
+
/>
|
|
180
|
+
</th>
|
|
181
|
+
)
|
|
178
182
|
);
|
|
179
183
|
})}
|
|
180
184
|
</tr>
|
|
@@ -212,18 +216,25 @@ export default function HTable({
|
|
|
212
216
|
>
|
|
213
217
|
{head.map((h, tdKey: number) => {
|
|
214
218
|
const item = md[h];
|
|
215
|
-
const id =
|
|
219
|
+
const id =
|
|
220
|
+
trKey +
|
|
221
|
+
"-" +
|
|
222
|
+
(md?.["_id"]?.content || md?.id?.content || tdKey) +
|
|
223
|
+
"-" +
|
|
224
|
+
h;
|
|
216
225
|
return (
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
h != "_id" && (
|
|
227
|
+
<TD
|
|
228
|
+
data-key={id}
|
|
229
|
+
key={id}
|
|
230
|
+
index={trKey}
|
|
231
|
+
symbols={symbols}
|
|
232
|
+
item={item}
|
|
233
|
+
color={color}
|
|
234
|
+
mapedData={mapedData}
|
|
235
|
+
setMapedData={setMapedData}
|
|
236
|
+
/>
|
|
237
|
+
)
|
|
227
238
|
);
|
|
228
239
|
})}
|
|
229
240
|
</tr>
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ES6",
|
|
4
|
-
"module": "
|
|
4
|
+
"module": "node16",
|
|
5
|
+
"moduleResolution": "node16",
|
|
5
6
|
"jsx": "react-jsx",
|
|
6
7
|
"declaration": true,
|
|
7
8
|
"outDir": "dist",
|
|
8
9
|
"esModuleInterop": true,
|
|
9
|
-
"moduleResolution": "node",
|
|
10
10
|
"skipLibCheck": true,
|
|
11
11
|
"strict": true,
|
|
12
12
|
"baseUrl": "."
|