next-recomponents 1.7.49 → 1.7.52
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 +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
- package/src/table/h.tsx +49 -40
- package/tsconfig.json +2 -2
package/dist/index.js
CHANGED
|
@@ -43495,7 +43495,7 @@ function HTable(_a) {
|
|
|
43495
43495
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("table", __spreadProps(__spreadValues({}, props), { className: "w-full border-collapse table-auto", children: [
|
|
43496
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) => {
|
|
43497
43497
|
var _a2;
|
|
43498
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
43498
|
+
return h != "_id" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
43499
43499
|
"th",
|
|
43500
43500
|
{
|
|
43501
43501
|
className: "whitespace-nowrap overflow-hidden text-ellipsis max-w-[200px] border-b p-2",
|
|
@@ -43534,7 +43534,7 @@ function HTable(_a) {
|
|
|
43534
43534
|
);
|
|
43535
43535
|
}) }) }),
|
|
43536
43536
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tbody", { className: "divide-y divide-gray-200", children: mapedData.map((md, trKey) => {
|
|
43537
|
-
var _a2, _b2;
|
|
43537
|
+
var _a2, _b2, _c;
|
|
43538
43538
|
const start = (page - 1) * maxItems;
|
|
43539
43539
|
const end = page * maxItems;
|
|
43540
43540
|
if (!hasFilters) {
|
|
@@ -43546,7 +43546,7 @@ function HTable(_a) {
|
|
|
43546
43546
|
return null;
|
|
43547
43547
|
}
|
|
43548
43548
|
}
|
|
43549
|
-
const dataKey = ((_b2 = md == null ? void 0 : md.
|
|
43549
|
+
const dataKey = ((_b2 = md == null ? void 0 : md._id) == null ? void 0 : _b2.content) || ((_c = md == null ? void 0 : md.id) == null ? void 0 : _c.content) || trKey;
|
|
43550
43550
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
43551
43551
|
"tr",
|
|
43552
43552
|
{
|
|
@@ -43562,10 +43562,10 @@ function HTable(_a) {
|
|
|
43562
43562
|
selected == trKey && "bg-green-200 hover:bg-green-300"
|
|
43563
43563
|
].join(" "),
|
|
43564
43564
|
children: head.map((h, tdKey) => {
|
|
43565
|
-
var _a3;
|
|
43565
|
+
var _a3, _b3;
|
|
43566
43566
|
const item = md[h];
|
|
43567
|
-
const id3 = trKey + "-" + (((_a3 = md == null ? void 0 : md.id) == null ? void 0 :
|
|
43568
|
-
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)(
|
|
43569
43569
|
TD,
|
|
43570
43570
|
{
|
|
43571
43571
|
"data-key": id3,
|
package/dist/index.mjs
CHANGED
|
@@ -43477,7 +43477,7 @@ function HTable(_a) {
|
|
|
43477
43477
|
/* @__PURE__ */ jsxs10("table", __spreadProps(__spreadValues({}, props), { className: "w-full border-collapse table-auto", children: [
|
|
43478
43478
|
/* @__PURE__ */ jsx12("thead", { className: "bg-gray-800 text-white", children: /* @__PURE__ */ jsx12("tr", { children: head.map((h, key) => {
|
|
43479
43479
|
var _a2;
|
|
43480
|
-
return /* @__PURE__ */ jsxs10(
|
|
43480
|
+
return h != "_id" && /* @__PURE__ */ jsxs10(
|
|
43481
43481
|
"th",
|
|
43482
43482
|
{
|
|
43483
43483
|
className: "whitespace-nowrap overflow-hidden text-ellipsis max-w-[200px] border-b p-2",
|
|
@@ -43516,7 +43516,7 @@ function HTable(_a) {
|
|
|
43516
43516
|
);
|
|
43517
43517
|
}) }) }),
|
|
43518
43518
|
/* @__PURE__ */ jsx12("tbody", { className: "divide-y divide-gray-200", children: mapedData.map((md, trKey) => {
|
|
43519
|
-
var _a2, _b2;
|
|
43519
|
+
var _a2, _b2, _c;
|
|
43520
43520
|
const start = (page - 1) * maxItems;
|
|
43521
43521
|
const end = page * maxItems;
|
|
43522
43522
|
if (!hasFilters) {
|
|
@@ -43528,7 +43528,7 @@ function HTable(_a) {
|
|
|
43528
43528
|
return null;
|
|
43529
43529
|
}
|
|
43530
43530
|
}
|
|
43531
|
-
const dataKey = ((_b2 = md == null ? void 0 : md.
|
|
43531
|
+
const dataKey = ((_b2 = md == null ? void 0 : md._id) == null ? void 0 : _b2.content) || ((_c = md == null ? void 0 : md.id) == null ? void 0 : _c.content) || trKey;
|
|
43532
43532
|
return /* @__PURE__ */ jsx12(
|
|
43533
43533
|
"tr",
|
|
43534
43534
|
{
|
|
@@ -43544,10 +43544,10 @@ function HTable(_a) {
|
|
|
43544
43544
|
selected == trKey && "bg-green-200 hover:bg-green-300"
|
|
43545
43545
|
].join(" "),
|
|
43546
43546
|
children: head.map((h, tdKey) => {
|
|
43547
|
-
var _a3;
|
|
43547
|
+
var _a3, _b3;
|
|
43548
43548
|
const item = md[h];
|
|
43549
|
-
const id3 = trKey + "-" + (((_a3 = md == null ? void 0 : md.id) == null ? void 0 :
|
|
43550
|
-
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(
|
|
43551
43551
|
TD,
|
|
43552
43552
|
{
|
|
43553
43553
|
"data-key": id3,
|
package/package.json
CHANGED
package/src/table/h.tsx
CHANGED
|
@@ -146,37 +146,39 @@ export default function HTable({
|
|
|
146
146
|
<tr>
|
|
147
147
|
{head.map((h, key) => {
|
|
148
148
|
return (
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<div
|
|
154
|
-
className="cursor-pointer flex "
|
|
155
|
-
onClick={(e) => {
|
|
156
|
-
setSelectedFilter(key == selectedFilter ? null : key);
|
|
157
|
-
}}
|
|
149
|
+
h != "_id" && (
|
|
150
|
+
<th
|
|
151
|
+
key={h}
|
|
152
|
+
className="whitespace-nowrap overflow-hidden text-ellipsis max-w-[200px] border-b p-2"
|
|
158
153
|
>
|
|
159
|
-
<div
|
|
160
|
-
|
|
161
|
-
{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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>
|
|
168
170
|
</div>
|
|
169
|
-
</div>
|
|
170
171
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
172
|
+
<FilterMenu
|
|
173
|
+
h={h}
|
|
174
|
+
mapedData={mapedData}
|
|
175
|
+
setMapedData={setMapedData}
|
|
176
|
+
index={key}
|
|
177
|
+
selectedFilter={selectedFilter}
|
|
178
|
+
setSelectedFilter={setSelectedFilter}
|
|
179
|
+
/>
|
|
180
|
+
</th>
|
|
181
|
+
)
|
|
180
182
|
);
|
|
181
183
|
})}
|
|
182
184
|
</tr>
|
|
@@ -196,7 +198,7 @@ export default function HTable({
|
|
|
196
198
|
return null;
|
|
197
199
|
}
|
|
198
200
|
}
|
|
199
|
-
const dataKey = md?.id?.content || trKey;
|
|
201
|
+
const dataKey = md?._id?.content || md?.id?.content || trKey;
|
|
200
202
|
|
|
201
203
|
return (
|
|
202
204
|
<tr
|
|
@@ -214,18 +216,25 @@ export default function HTable({
|
|
|
214
216
|
>
|
|
215
217
|
{head.map((h, tdKey: number) => {
|
|
216
218
|
const item = md[h];
|
|
217
|
-
const id =
|
|
219
|
+
const id =
|
|
220
|
+
trKey +
|
|
221
|
+
"-" +
|
|
222
|
+
(md?.["_id"]?.content || md?.id?.content || tdKey) +
|
|
223
|
+
"-" +
|
|
224
|
+
h;
|
|
218
225
|
return (
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
+
)
|
|
229
238
|
);
|
|
230
239
|
})}
|
|
231
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": "."
|