next-recomponents 2.0.58 → 2.0.59
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 +3 -4
- package/dist/index.mjs +3 -4
- package/package.json +1 -1
- package/src/table-advanced/h.table.tsx +5 -4
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
|
)
|
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
|
)
|
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
|
);
|