@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
- result[id] = { ...meta, stickyOffset: leftOffset };
23
- leftOffset += columnWidthPx(id, baseMeta, options?.columnWidths);
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
- result[id] = { ...meta, stickyOffset: rightOffset };
30
- rightOffset += columnWidthPx(id, baseMeta, options?.columnWidths);
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
@@ -402,6 +402,9 @@
402
402
  .collapse {
403
403
  visibility: collapse
404
404
  }
405
+ .static {
406
+ position: static
407
+ }
405
408
  .fixed {
406
409
  position: fixed
407
410
  }
@@ -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
- result[id] = { ...meta, stickyOffset: leftOffset };
956
- leftOffset += columnWidthPx(id, baseMeta, options?.columnWidths);
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
- result[id] = { ...meta, stickyOffset: rightOffset };
963
- rightOffset += columnWidthPx(id, baseMeta, options?.columnWidths);
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
  }
@@ -250,6 +250,9 @@
250
250
  .collapse {
251
251
  visibility: collapse
252
252
  }
253
+ .static {
254
+ position: static
255
+ }
253
256
  .fixed {
254
257
  position: fixed
255
258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undevy-org/tablewright",
3
- "version": "0.9.0",
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": {