@undevy-org/tablewright 0.9.0 → 0.9.1
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.
|
@@ -19,15 +19,25 @@ function applyColumnPinningToMeta(baseMeta, pinning, options) {
|
|
|
19
19
|
for (const id of order) {
|
|
20
20
|
const meta = result[id];
|
|
21
21
|
if (meta?.sticky !== "left") continue;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const width = columnWidthPx(id, baseMeta, options?.columnWidths);
|
|
23
|
+
if (pinnedLeft.has(id)) {
|
|
24
|
+
result[id] = { ...meta, stickyOffset: leftOffset };
|
|
25
|
+
leftOffset += width;
|
|
26
|
+
} else {
|
|
27
|
+
leftOffset = (meta.stickyOffset ?? 0) + width;
|
|
28
|
+
}
|
|
24
29
|
}
|
|
25
30
|
let rightOffset = 0;
|
|
26
31
|
for (const id of [...order].reverse()) {
|
|
27
32
|
const meta = result[id];
|
|
28
33
|
if (meta?.sticky !== "right") continue;
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
const width = columnWidthPx(id, baseMeta, options?.columnWidths);
|
|
35
|
+
if (pinnedRight.has(id)) {
|
|
36
|
+
result[id] = { ...meta, stickyOffset: rightOffset };
|
|
37
|
+
rightOffset += width;
|
|
38
|
+
} else {
|
|
39
|
+
rightOffset = (meta.stickyOffset ?? 0) + width;
|
|
40
|
+
}
|
|
31
41
|
}
|
|
32
42
|
return result;
|
|
33
43
|
}
|
package/dist/styles.css
CHANGED
package/dist/tablewright.cjs
CHANGED
|
@@ -952,15 +952,25 @@ function applyColumnPinningToMeta(baseMeta, pinning, options) {
|
|
|
952
952
|
for (const id of order) {
|
|
953
953
|
const meta = result[id];
|
|
954
954
|
if (meta?.sticky !== "left") continue;
|
|
955
|
-
|
|
956
|
-
|
|
955
|
+
const width = columnWidthPx(id, baseMeta, options?.columnWidths);
|
|
956
|
+
if (pinnedLeft.has(id)) {
|
|
957
|
+
result[id] = { ...meta, stickyOffset: leftOffset };
|
|
958
|
+
leftOffset += width;
|
|
959
|
+
} else {
|
|
960
|
+
leftOffset = (meta.stickyOffset ?? 0) + width;
|
|
961
|
+
}
|
|
957
962
|
}
|
|
958
963
|
let rightOffset = 0;
|
|
959
964
|
for (const id of [...order].reverse()) {
|
|
960
965
|
const meta = result[id];
|
|
961
966
|
if (meta?.sticky !== "right") continue;
|
|
962
|
-
|
|
963
|
-
|
|
967
|
+
const width = columnWidthPx(id, baseMeta, options?.columnWidths);
|
|
968
|
+
if (pinnedRight.has(id)) {
|
|
969
|
+
result[id] = { ...meta, stickyOffset: rightOffset };
|
|
970
|
+
rightOffset += width;
|
|
971
|
+
} else {
|
|
972
|
+
rightOffset = (meta.stickyOffset ?? 0) + width;
|
|
973
|
+
}
|
|
964
974
|
}
|
|
965
975
|
return result;
|
|
966
976
|
}
|
package/dist/tablewright.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@undevy-org/tablewright",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "React data-table and application-shell components: filters, drawers, row controls, sortable and resizable columns, built on Radix UI and TanStack Table.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|