next-recomponents 2.0.58 → 2.0.60
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 +5 -6
- package/dist/index.mjs +5 -6
- package/package.json +1 -1
- package/src/table-advanced/h.table.tsx +6 -7
package/dist/index.js
CHANGED
|
@@ -39201,9 +39201,8 @@ function HTable({
|
|
|
39201
39201
|
function useResizableColumns(headers2, defaultWidth = 160, minWidth = 60) {
|
|
39202
39202
|
function getWidth(h) {
|
|
39203
39203
|
return [
|
|
39204
|
-
|
|
39205
|
-
"
|
|
39206
|
-
...(context == null ? void 0 : context.hideColumns) || []
|
|
39204
|
+
...(context == null ? void 0 : context.hideColumns) || [],
|
|
39205
|
+
...headers2.filter((h2) => h2.startsWith("_"))
|
|
39207
39206
|
].includes(h) ? minWidth : defaultWidth;
|
|
39208
39207
|
}
|
|
39209
39208
|
function resize(headers3) {
|
|
@@ -39267,7 +39266,7 @@ function HTable({
|
|
|
39267
39266
|
var _a, _b;
|
|
39268
39267
|
return [
|
|
39269
39268
|
h,
|
|
39270
|
-
((_a = context == null ? void 0 : context.colSize) == null ? void 0 : _a[h]) ? (_b = context == null ? void 0 : context.colSize) == null ? void 0 : _b[h] : ["__select__", "__modal__"].includes(h) ? 60 : w
|
|
39269
|
+
((_a = context == null ? void 0 : context.colSize) == null ? void 0 : _a[h]) ? (_b = context == null ? void 0 : context.colSize) == null ? void 0 : _b[h] : ["__select__", "__modal__"].includes(h) ? 60 : h.startsWith("_") ? 0 : w
|
|
39271
39270
|
];
|
|
39272
39271
|
})
|
|
39273
39272
|
)
|
|
@@ -39407,7 +39406,7 @@ function HTable({
|
|
|
39407
39406
|
children: searchedData.slice(pagination.inicio - 1, pagination.fin).map((row, rowIndex) => {
|
|
39408
39407
|
const items = Object.entries(row);
|
|
39409
39408
|
return items.map(([key, item], i) => {
|
|
39410
|
-
var _a, _b, _c
|
|
39409
|
+
var _a, _b, _c;
|
|
39411
39410
|
if ((_b = (_a = context == null ? void 0 : context.hideColumns) == null ? void 0 : _a.includes) == null ? void 0 : _b.call(_a, key)) return null;
|
|
39412
39411
|
if (key.startsWith("_") && !key.startsWith("__")) return null;
|
|
39413
39412
|
if (key == "__modal__") {
|
|
@@ -39501,7 +39500,7 @@ function HTable({
|
|
|
39501
39500
|
// ? item
|
|
39502
39501
|
// : undefined,
|
|
39503
39502
|
value: item,
|
|
39504
|
-
children:
|
|
39503
|
+
children: item,
|
|
39505
39504
|
onClick: async (e) => {
|
|
39506
39505
|
var _a2, _b2;
|
|
39507
39506
|
const ret = await ((_b2 = (_a2 = context.buttons[key].props) == null ? void 0 : _a2.onClick) == null ? void 0 : _b2.call(_a2, {
|
package/dist/index.mjs
CHANGED
|
@@ -39198,9 +39198,8 @@ function HTable({
|
|
|
39198
39198
|
function useResizableColumns(headers2, defaultWidth = 160, minWidth = 60) {
|
|
39199
39199
|
function getWidth(h) {
|
|
39200
39200
|
return [
|
|
39201
|
-
|
|
39202
|
-
"
|
|
39203
|
-
...(context == null ? void 0 : context.hideColumns) || []
|
|
39201
|
+
...(context == null ? void 0 : context.hideColumns) || [],
|
|
39202
|
+
...headers2.filter((h2) => h2.startsWith("_"))
|
|
39204
39203
|
].includes(h) ? minWidth : defaultWidth;
|
|
39205
39204
|
}
|
|
39206
39205
|
function resize(headers3) {
|
|
@@ -39264,7 +39263,7 @@ function HTable({
|
|
|
39264
39263
|
var _a, _b;
|
|
39265
39264
|
return [
|
|
39266
39265
|
h,
|
|
39267
|
-
((_a = context == null ? void 0 : context.colSize) == null ? void 0 : _a[h]) ? (_b = context == null ? void 0 : context.colSize) == null ? void 0 : _b[h] : ["__select__", "__modal__"].includes(h) ? 60 : w
|
|
39266
|
+
((_a = context == null ? void 0 : context.colSize) == null ? void 0 : _a[h]) ? (_b = context == null ? void 0 : context.colSize) == null ? void 0 : _b[h] : ["__select__", "__modal__"].includes(h) ? 60 : h.startsWith("_") ? 0 : w
|
|
39268
39267
|
];
|
|
39269
39268
|
})
|
|
39270
39269
|
)
|
|
@@ -39404,7 +39403,7 @@ function HTable({
|
|
|
39404
39403
|
children: searchedData.slice(pagination.inicio - 1, pagination.fin).map((row, rowIndex) => {
|
|
39405
39404
|
const items = Object.entries(row);
|
|
39406
39405
|
return items.map(([key, item], i) => {
|
|
39407
|
-
var _a, _b, _c
|
|
39406
|
+
var _a, _b, _c;
|
|
39408
39407
|
if ((_b = (_a = context == null ? void 0 : context.hideColumns) == null ? void 0 : _a.includes) == null ? void 0 : _b.call(_a, key)) return null;
|
|
39409
39408
|
if (key.startsWith("_") && !key.startsWith("__")) return null;
|
|
39410
39409
|
if (key == "__modal__") {
|
|
@@ -39498,7 +39497,7 @@ function HTable({
|
|
|
39498
39497
|
// ? item
|
|
39499
39498
|
// : undefined,
|
|
39500
39499
|
value: item,
|
|
39501
|
-
children:
|
|
39500
|
+
children: item,
|
|
39502
39501
|
onClick: async (e) => {
|
|
39503
39502
|
var _a2, _b2;
|
|
39504
39503
|
const ret = await ((_b2 = (_a2 = context.buttons[key].props) == null ? void 0 : _a2.onClick) == null ? void 0 : _b2.call(_a2, {
|
package/package.json
CHANGED
|
@@ -41,9 +41,8 @@ export default function HTable({
|
|
|
41
41
|
) {
|
|
42
42
|
function getWidth(h: string) {
|
|
43
43
|
return [
|
|
44
|
-
"__select__",
|
|
45
|
-
"__modal__",
|
|
46
44
|
...(context?.hideColumns || []),
|
|
45
|
+
...headers.filter((h) => h.startsWith("_")),
|
|
47
46
|
].includes(h)
|
|
48
47
|
? minWidth
|
|
49
48
|
: defaultWidth;
|
|
@@ -65,6 +64,7 @@ export default function HTable({
|
|
|
65
64
|
minWidth,
|
|
66
65
|
startWidth + (ev.clientX - startX),
|
|
67
66
|
);
|
|
67
|
+
|
|
68
68
|
setWidths((prev) => ({ ...prev, [headerKey]: newWidth }));
|
|
69
69
|
};
|
|
70
70
|
const onUp = () => {
|
|
@@ -87,7 +87,6 @@ export default function HTable({
|
|
|
87
87
|
})
|
|
88
88
|
.map((h) => `${widths[h] ?? defaultWidth}px`)
|
|
89
89
|
.join(" ");
|
|
90
|
-
|
|
91
90
|
return { widths, gridTemplateColumns, startDrag, setWidths };
|
|
92
91
|
}
|
|
93
92
|
const { gridTemplateColumns, startDrag, widths, setWidths } =
|
|
@@ -130,7 +129,9 @@ export default function HTable({
|
|
|
130
129
|
? context?.colSize?.[h]
|
|
131
130
|
: ["__select__", "__modal__"].includes(h)
|
|
132
131
|
? 60
|
|
133
|
-
:
|
|
132
|
+
: h.startsWith("_")
|
|
133
|
+
? 0
|
|
134
|
+
: w,
|
|
134
135
|
]),
|
|
135
136
|
),
|
|
136
137
|
);
|
|
@@ -443,9 +444,7 @@ export default function HTable({
|
|
|
443
444
|
// ? item
|
|
444
445
|
// : undefined,
|
|
445
446
|
value: item,
|
|
446
|
-
children:
|
|
447
|
-
? item
|
|
448
|
-
: null,
|
|
447
|
+
children: item,
|
|
449
448
|
onClick: async (e: any) => {
|
|
450
449
|
const ret =
|
|
451
450
|
(await context.buttons[key].props?.onClick?.({
|