next-recomponents 1.8.0 → 1.8.2
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 +24 -23
- package/dist/index.mjs +27 -26
- package/package.json +1 -1
- package/src/table/filters.tsx +16 -15
- package/src/table/vtd.tsx +1 -0
- package/src/table3/filter.tsx +8 -9
- package/src/table3/index.tsx +14 -7
- package/src/table3/panel.tsx +2 -2
- package/src/table3/tr.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -11286,6 +11286,21 @@ function FilterOffIcon() {
|
|
|
11286
11286
|
}
|
|
11287
11287
|
);
|
|
11288
11288
|
}
|
|
11289
|
+
function EditIcon() {
|
|
11290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
11291
|
+
"svg",
|
|
11292
|
+
{
|
|
11293
|
+
stroke: "currentColor",
|
|
11294
|
+
fill: "currentColor",
|
|
11295
|
+
strokeWidth: "0",
|
|
11296
|
+
viewBox: "0 0 576 512",
|
|
11297
|
+
height: "20px",
|
|
11298
|
+
width: "20px",
|
|
11299
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11300
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" })
|
|
11301
|
+
}
|
|
11302
|
+
);
|
|
11303
|
+
}
|
|
11289
11304
|
function MdLastPage() {
|
|
11290
11305
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
11291
11306
|
"svg",
|
|
@@ -11391,21 +11406,6 @@ function ExcelIcon() {
|
|
|
11391
11406
|
}
|
|
11392
11407
|
);
|
|
11393
11408
|
}
|
|
11394
|
-
function EditIcon() {
|
|
11395
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
11396
|
-
"svg",
|
|
11397
|
-
{
|
|
11398
|
-
stroke: "currentColor",
|
|
11399
|
-
fill: "currentColor",
|
|
11400
|
-
strokeWidth: "0",
|
|
11401
|
-
viewBox: "0 0 576 512",
|
|
11402
|
-
height: "20px",
|
|
11403
|
-
width: "20px",
|
|
11404
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
11405
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" })
|
|
11406
|
-
}
|
|
11407
|
-
);
|
|
11408
|
-
}
|
|
11409
11409
|
|
|
11410
11410
|
// src/table/filter.menu.tsx
|
|
11411
11411
|
var import_react24 = require("react");
|
|
@@ -44887,7 +44887,7 @@ function Filter({
|
|
|
44887
44887
|
const itemsFiltered = (0, import_react33.useMemo)(
|
|
44888
44888
|
() => items.sort((a, b) => `${a}`.localeCompare(b)).filter((item) => {
|
|
44889
44889
|
if (!text) return true;
|
|
44890
|
-
return item
|
|
44890
|
+
return `${item}`.toLowerCase().includes(text.toLowerCase());
|
|
44891
44891
|
}),
|
|
44892
44892
|
[items, text]
|
|
44893
44893
|
);
|
|
@@ -44900,10 +44900,7 @@ function Filter({
|
|
|
44900
44900
|
return (row == null ? void 0 : row._id) ? {
|
|
44901
44901
|
_id: row._id,
|
|
44902
44902
|
_visible: itemsInterno.includes(row[h])
|
|
44903
|
-
} : {
|
|
44904
|
-
id: row.id,
|
|
44905
|
-
_visible: itemsInterno.includes(row[h])
|
|
44906
|
-
};
|
|
44903
|
+
} : { id: row.id, _visible: itemsInterno.includes(row[h]) };
|
|
44907
44904
|
});
|
|
44908
44905
|
} else {
|
|
44909
44906
|
obj = array.map((row) => {
|
|
@@ -44973,13 +44970,13 @@ function Filter({
|
|
|
44973
44970
|
{
|
|
44974
44971
|
className: "border shadow rounded p-2 w-full",
|
|
44975
44972
|
type: "search",
|
|
44976
|
-
onChange: (e) => setText(e.target.value),
|
|
44973
|
+
onChange: (e) => setText(`${e.target.value}`),
|
|
44977
44974
|
value: text,
|
|
44978
44975
|
onKeyDown: (e) => {
|
|
44979
44976
|
if (e.key === "Enter") {
|
|
44980
44977
|
setSelected(
|
|
44981
44978
|
items.filter(
|
|
44982
|
-
(i) => i
|
|
44979
|
+
(i) => `${i}`.toLowerCase().includes(`${text}`.toLowerCase())
|
|
44983
44980
|
)
|
|
44984
44981
|
);
|
|
44985
44982
|
filtrar();
|
|
@@ -45477,7 +45474,10 @@ function Table3(_a) {
|
|
|
45477
45474
|
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
45478
45475
|
const id3 = (bb == null ? void 0 : bb.id) || (bb == null ? void 0 : bb._id);
|
|
45479
45476
|
if (!id3) throw new Error("Se necesita el id o _id");
|
|
45480
|
-
const cc =
|
|
45477
|
+
const cc = ((_a2 = a == null ? void 0 : a[id3]) == null ? void 0 : _a2._updated) ? __spreadProps(__spreadValues(__spreadValues({}, bb), a == null ? void 0 : a[id3]), {
|
|
45478
|
+
_selected: bb == null ? void 0 : bb._selected,
|
|
45479
|
+
_visible: (bb == null ? void 0 : bb._visible) == false ? false : true
|
|
45480
|
+
}) : __spreadProps(__spreadValues({}, bb), {
|
|
45481
45481
|
_selected: bb == null ? void 0 : bb._selected,
|
|
45482
45482
|
_visible: (bb == null ? void 0 : bb._visible) == false ? false : true
|
|
45483
45483
|
});
|
|
@@ -45551,6 +45551,7 @@ function Table3(_a) {
|
|
|
45551
45551
|
}, [objectData]);
|
|
45552
45552
|
const style = (props == null ? void 0 : props.style) ? __spreadProps(__spreadValues({}, props.style), { tableLayout: "fixed" }) : { tableLayout: "fixed" };
|
|
45553
45553
|
if (!objectData) return null;
|
|
45554
|
+
console.log({ objectData });
|
|
45554
45555
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "border shadow rounded m-1 p-1 bg-white", children: [
|
|
45555
45556
|
modal && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
45556
45557
|
dialog_default,
|
package/dist/index.mjs
CHANGED
|
@@ -11267,6 +11267,21 @@ function FilterOffIcon() {
|
|
|
11267
11267
|
}
|
|
11268
11268
|
);
|
|
11269
11269
|
}
|
|
11270
|
+
function EditIcon() {
|
|
11271
|
+
return /* @__PURE__ */ jsx9(
|
|
11272
|
+
"svg",
|
|
11273
|
+
{
|
|
11274
|
+
stroke: "currentColor",
|
|
11275
|
+
fill: "currentColor",
|
|
11276
|
+
strokeWidth: "0",
|
|
11277
|
+
viewBox: "0 0 576 512",
|
|
11278
|
+
height: "20px",
|
|
11279
|
+
width: "20px",
|
|
11280
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11281
|
+
children: /* @__PURE__ */ jsx9("path", { d: "M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" })
|
|
11282
|
+
}
|
|
11283
|
+
);
|
|
11284
|
+
}
|
|
11270
11285
|
function MdLastPage() {
|
|
11271
11286
|
return /* @__PURE__ */ jsxs7(
|
|
11272
11287
|
"svg",
|
|
@@ -11372,21 +11387,6 @@ function ExcelIcon() {
|
|
|
11372
11387
|
}
|
|
11373
11388
|
);
|
|
11374
11389
|
}
|
|
11375
|
-
function EditIcon() {
|
|
11376
|
-
return /* @__PURE__ */ jsx9(
|
|
11377
|
-
"svg",
|
|
11378
|
-
{
|
|
11379
|
-
stroke: "currentColor",
|
|
11380
|
-
fill: "currentColor",
|
|
11381
|
-
strokeWidth: "0",
|
|
11382
|
-
viewBox: "0 0 576 512",
|
|
11383
|
-
height: "20px",
|
|
11384
|
-
width: "20px",
|
|
11385
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
11386
|
-
children: /* @__PURE__ */ jsx9("path", { d: "M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" })
|
|
11387
|
-
}
|
|
11388
|
-
);
|
|
11389
|
-
}
|
|
11390
11390
|
|
|
11391
11391
|
// src/table/filter.menu.tsx
|
|
11392
11392
|
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
@@ -44857,7 +44857,7 @@ function DocumentViewer({ item }) {
|
|
|
44857
44857
|
|
|
44858
44858
|
// src/table3/index.tsx
|
|
44859
44859
|
import React11, {
|
|
44860
|
-
useEffect as
|
|
44860
|
+
useEffect as useEffect11,
|
|
44861
44861
|
useMemo as useMemo12,
|
|
44862
44862
|
useReducer as useReducer2,
|
|
44863
44863
|
useRef as useRef8,
|
|
@@ -44884,7 +44884,7 @@ function Filter({
|
|
|
44884
44884
|
const itemsFiltered = useMemo10(
|
|
44885
44885
|
() => items.sort((a, b) => `${a}`.localeCompare(b)).filter((item) => {
|
|
44886
44886
|
if (!text) return true;
|
|
44887
|
-
return item
|
|
44887
|
+
return `${item}`.toLowerCase().includes(text.toLowerCase());
|
|
44888
44888
|
}),
|
|
44889
44889
|
[items, text]
|
|
44890
44890
|
);
|
|
@@ -44897,10 +44897,7 @@ function Filter({
|
|
|
44897
44897
|
return (row == null ? void 0 : row._id) ? {
|
|
44898
44898
|
_id: row._id,
|
|
44899
44899
|
_visible: itemsInterno.includes(row[h])
|
|
44900
|
-
} : {
|
|
44901
|
-
id: row.id,
|
|
44902
|
-
_visible: itemsInterno.includes(row[h])
|
|
44903
|
-
};
|
|
44900
|
+
} : { id: row.id, _visible: itemsInterno.includes(row[h]) };
|
|
44904
44901
|
});
|
|
44905
44902
|
} else {
|
|
44906
44903
|
obj = array.map((row) => {
|
|
@@ -44970,13 +44967,13 @@ function Filter({
|
|
|
44970
44967
|
{
|
|
44971
44968
|
className: "border shadow rounded p-2 w-full",
|
|
44972
44969
|
type: "search",
|
|
44973
|
-
onChange: (e) => setText(e.target.value),
|
|
44970
|
+
onChange: (e) => setText(`${e.target.value}`),
|
|
44974
44971
|
value: text,
|
|
44975
44972
|
onKeyDown: (e) => {
|
|
44976
44973
|
if (e.key === "Enter") {
|
|
44977
44974
|
setSelected(
|
|
44978
44975
|
items.filter(
|
|
44979
|
-
(i) => i
|
|
44976
|
+
(i) => `${i}`.toLowerCase().includes(`${text}`.toLowerCase())
|
|
44980
44977
|
)
|
|
44981
44978
|
);
|
|
44982
44979
|
filtrar();
|
|
@@ -45474,7 +45471,10 @@ function Table3(_a) {
|
|
|
45474
45471
|
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
45475
45472
|
const id3 = (bb == null ? void 0 : bb.id) || (bb == null ? void 0 : bb._id);
|
|
45476
45473
|
if (!id3) throw new Error("Se necesita el id o _id");
|
|
45477
|
-
const cc =
|
|
45474
|
+
const cc = ((_a2 = a == null ? void 0 : a[id3]) == null ? void 0 : _a2._updated) ? __spreadProps(__spreadValues(__spreadValues({}, bb), a == null ? void 0 : a[id3]), {
|
|
45475
|
+
_selected: bb == null ? void 0 : bb._selected,
|
|
45476
|
+
_visible: (bb == null ? void 0 : bb._visible) == false ? false : true
|
|
45477
|
+
}) : __spreadProps(__spreadValues({}, bb), {
|
|
45478
45478
|
_selected: bb == null ? void 0 : bb._selected,
|
|
45479
45479
|
_visible: (bb == null ? void 0 : bb._visible) == false ? false : true
|
|
45480
45480
|
});
|
|
@@ -45501,7 +45501,7 @@ function Table3(_a) {
|
|
|
45501
45501
|
}
|
|
45502
45502
|
}
|
|
45503
45503
|
const [objectData, setObjectData] = useReducer2(dataReducer, null);
|
|
45504
|
-
|
|
45504
|
+
useEffect11(() => {
|
|
45505
45505
|
setObjectData(data);
|
|
45506
45506
|
setPage(1);
|
|
45507
45507
|
}, [data]);
|
|
@@ -45540,7 +45540,7 @@ function Table3(_a) {
|
|
|
45540
45540
|
footer,
|
|
45541
45541
|
onChange
|
|
45542
45542
|
}, props);
|
|
45543
|
-
|
|
45543
|
+
useEffect11(() => {
|
|
45544
45544
|
if ((dialogRow == null ? void 0 : dialogRow.id) || (dialogRow == null ? void 0 : dialogRow._id)) {
|
|
45545
45545
|
const newDialogRow = objectData[dialogRow == null ? void 0 : dialogRow.id] || objectData[dialogRow == null ? void 0 : dialogRow._id];
|
|
45546
45546
|
setDialogRow(newDialogRow);
|
|
@@ -45548,6 +45548,7 @@ function Table3(_a) {
|
|
|
45548
45548
|
}, [objectData]);
|
|
45549
45549
|
const style = (props == null ? void 0 : props.style) ? __spreadProps(__spreadValues({}, props.style), { tableLayout: "fixed" }) : { tableLayout: "fixed" };
|
|
45550
45550
|
if (!objectData) return null;
|
|
45551
|
+
console.log({ objectData });
|
|
45551
45552
|
return /* @__PURE__ */ jsxs24("div", { className: "border shadow rounded m-1 p-1 bg-white", children: [
|
|
45552
45553
|
modal && /* @__PURE__ */ jsx34(
|
|
45553
45554
|
dialog_default,
|
package/package.json
CHANGED
package/src/table/filters.tsx
CHANGED
|
@@ -13,6 +13,21 @@ export function FilterOffIcon() {
|
|
|
13
13
|
</svg>
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
+
export function EditIcon() {
|
|
17
|
+
return (
|
|
18
|
+
<svg
|
|
19
|
+
stroke="currentColor"
|
|
20
|
+
fill="currentColor"
|
|
21
|
+
strokeWidth="0"
|
|
22
|
+
viewBox="0 0 576 512"
|
|
23
|
+
height="20px"
|
|
24
|
+
width="20px"
|
|
25
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
+
>
|
|
27
|
+
<path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"></path>
|
|
28
|
+
</svg>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
16
31
|
|
|
17
32
|
export function MdLastPage() {
|
|
18
33
|
return (
|
|
@@ -110,21 +125,7 @@ export function ExcelIcon() {
|
|
|
110
125
|
</svg>
|
|
111
126
|
);
|
|
112
127
|
}
|
|
113
|
-
|
|
114
|
-
return (
|
|
115
|
-
<svg
|
|
116
|
-
stroke="currentColor"
|
|
117
|
-
fill="currentColor"
|
|
118
|
-
strokeWidth="0"
|
|
119
|
-
viewBox="0 0 576 512"
|
|
120
|
-
height="20px"
|
|
121
|
-
width="20px"
|
|
122
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
123
|
-
>
|
|
124
|
-
<path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"></path>
|
|
125
|
-
</svg>
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
+
|
|
128
129
|
export function ArrowIcon() {
|
|
129
130
|
return (
|
|
130
131
|
<svg
|
package/src/table/vtd.tsx
CHANGED
package/src/table3/filter.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { FilterOffIcon } from "../../src/table/filters";
|
|
3
4
|
|
|
4
5
|
export default function Filter({
|
|
5
6
|
h,
|
|
@@ -21,6 +22,7 @@ export default function Filter({
|
|
|
21
22
|
[objectData]
|
|
22
23
|
);
|
|
23
24
|
const [selected, setSelected] = useState<string[]>(items);
|
|
25
|
+
|
|
24
26
|
const itemsFiltered = useMemo(
|
|
25
27
|
() =>
|
|
26
28
|
items
|
|
@@ -28,7 +30,7 @@ export default function Filter({
|
|
|
28
30
|
.filter((item: string) => {
|
|
29
31
|
if (!text) return true;
|
|
30
32
|
|
|
31
|
-
return item
|
|
33
|
+
return `${item}`.toLowerCase().includes(text.toLowerCase());
|
|
32
34
|
}),
|
|
33
35
|
[items, text]
|
|
34
36
|
);
|
|
@@ -43,10 +45,7 @@ export default function Filter({
|
|
|
43
45
|
_id: row._id,
|
|
44
46
|
_visible: itemsInterno.includes(row[h]),
|
|
45
47
|
}
|
|
46
|
-
: {
|
|
47
|
-
id: row.id,
|
|
48
|
-
_visible: itemsInterno.includes(row[h]),
|
|
49
|
-
};
|
|
48
|
+
: { id: row.id, _visible: itemsInterno.includes(row[h]) };
|
|
50
49
|
});
|
|
51
50
|
} else {
|
|
52
51
|
obj = array.map((row: any) => {
|
|
@@ -128,13 +127,13 @@ export default function Filter({
|
|
|
128
127
|
<input
|
|
129
128
|
className="border shadow rounded p-2 w-full"
|
|
130
129
|
type="search"
|
|
131
|
-
onChange={(e) => setText(e.target.value)}
|
|
130
|
+
onChange={(e) => setText(`${e.target.value}`)}
|
|
132
131
|
value={text}
|
|
133
132
|
onKeyDown={(e) => {
|
|
134
133
|
if (e.key === "Enter") {
|
|
135
134
|
setSelected(
|
|
136
135
|
items.filter((i) =>
|
|
137
|
-
i
|
|
136
|
+
`${i}`.toLowerCase().includes(`${text}`.toLowerCase())
|
|
138
137
|
)
|
|
139
138
|
);
|
|
140
139
|
filtrar();
|
package/src/table3/index.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import React, {
|
|
2
3
|
DetailedHTMLProps,
|
|
3
4
|
TableHTMLAttributes,
|
|
@@ -54,12 +55,18 @@ export default function Table3({
|
|
|
54
55
|
const id = bb?.id || bb?._id;
|
|
55
56
|
if (!id) throw new Error("Se necesita el id o _id");
|
|
56
57
|
|
|
57
|
-
const cc =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
const cc = a?.[id]?._updated
|
|
59
|
+
? {
|
|
60
|
+
...bb,
|
|
61
|
+
...a?.[id],
|
|
62
|
+
_selected: bb?._selected,
|
|
63
|
+
_visible: bb?._visible == false ? false : true,
|
|
64
|
+
}
|
|
65
|
+
: {
|
|
66
|
+
...bb,
|
|
67
|
+
_selected: bb?._selected,
|
|
68
|
+
_visible: bb?._visible == false ? false : true,
|
|
69
|
+
};
|
|
63
70
|
|
|
64
71
|
const newHandlers = { ...handlers };
|
|
65
72
|
|
|
@@ -158,7 +165,7 @@ export default function Table3({
|
|
|
158
165
|
: { tableLayout: "fixed" };
|
|
159
166
|
|
|
160
167
|
if (!objectData) return null;
|
|
161
|
-
|
|
168
|
+
console.log({ objectData });
|
|
162
169
|
return (
|
|
163
170
|
<div className="border shadow rounded m-1 p-1 bg-white">
|
|
164
171
|
{modal && (
|
package/src/table3/panel.tsx
CHANGED
package/src/table3/tr.tsx
CHANGED