@dmsi/wedgekit-react 0.0.172 → 0.0.173

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.
Files changed (39) hide show
  1. package/dist/{chunk-PMBEIP24.js → chunk-IDSFWKOR.js} +1 -1
  2. package/dist/{chunk-XH65MD2C.js → chunk-KADNOKNW.js} +1 -1
  3. package/dist/{chunk-F6YFWBVV.js → chunk-REGRTR2Y.js} +2 -2
  4. package/dist/{chunk-O4JGGMFE.js → chunk-TB7VTSDP.js} +26 -15
  5. package/dist/components/DataGridCell.cjs +20 -9
  6. package/dist/components/DataGridCell.js +6 -6
  7. package/dist/components/DateInput.js +10 -10
  8. package/dist/components/DateRangeInput.js +10 -10
  9. package/dist/components/FilterGroup.js +5 -5
  10. package/dist/components/Input.js +2 -2
  11. package/dist/components/MobileDataGrid.js +3 -3
  12. package/dist/components/Modal.js +4 -4
  13. package/dist/components/ModalButtons.js +2 -2
  14. package/dist/components/ModalHeader.js +2 -2
  15. package/dist/components/NavigationTab.js +2 -2
  16. package/dist/components/NavigationTabs.js +2 -2
  17. package/dist/components/Notification.js +3 -3
  18. package/dist/components/OptionPill.js +2 -2
  19. package/dist/components/PDFViewer.js +6 -6
  20. package/dist/components/Password.js +2 -2
  21. package/dist/components/Search.js +3 -3
  22. package/dist/components/Select.js +3 -3
  23. package/dist/components/Stepper.js +5 -5
  24. package/dist/components/Time.js +2 -2
  25. package/dist/components/Toast.js +3 -3
  26. package/dist/components/Upload.js +3 -3
  27. package/dist/components/index.cjs +213 -181
  28. package/dist/components/index.js +205 -184
  29. package/package.json +1 -1
  30. package/src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx +1 -1
  31. package/src/components/DataGrid/PinnedColumns.tsx +19 -6
  32. package/src/components/DataGrid/TableBody/TableBodyRow.tsx +7 -2
  33. package/src/components/DataGrid/index.tsx +38 -9
  34. package/src/components/DataGridCell.tsx +16 -4
  35. package/dist/{chunk-4T3DRGLF.js → chunk-MVGOAMTP.js} +3 -3
  36. package/dist/{chunk-C4JGTH6G.js → chunk-T7NDKJDP.js} +3 -3
  37. package/dist/{chunk-LM5MKBPM.js → chunk-UGNB32SL.js} +3 -3
  38. package/dist/{chunk-ZGFQN47L.js → chunk-ZR4E5A43.js} +3 -3
  39. package/dist/{chunk-MJKBQSNI.js → chunk-ZSKLCKIR.js} +3 -3
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-3WNXMCZV.js";
4
4
  import {
5
5
  Select
6
- } from "../chunk-XH65MD2C.js";
6
+ } from "../chunk-KADNOKNW.js";
7
7
  import {
8
8
  Checkbox
9
9
  } from "../chunk-WFQEE2OO.js";
@@ -12,29 +12,29 @@ import {
12
12
  DataGridCell,
13
13
  DragAlongCell,
14
14
  DraggableCellHeader
15
- } from "../chunk-O4JGGMFE.js";
15
+ } from "../chunk-TB7VTSDP.js";
16
+ import {
17
+ MenuOption
18
+ } from "../chunk-FFU6FB3K.js";
16
19
  import {
17
20
  Menu
18
21
  } from "../chunk-UBU6IJML.js";
19
22
  import "../chunk-5GUW4DUY.js";
20
- import {
21
- MenuOption
22
- } from "../chunk-FFU6FB3K.js";
23
23
  import {
24
24
  useInfiniteScroll
25
25
  } from "../chunk-WNQ53SVY.js";
26
+ import "../chunk-WVUIIBRR.js";
26
27
  import "../chunk-6LN6QT6M.js";
27
28
  import {
28
29
  Search
29
- } from "../chunk-PMBEIP24.js";
30
+ } from "../chunk-IDSFWKOR.js";
30
31
  import {
31
32
  Input
32
- } from "../chunk-4T3DRGLF.js";
33
- import "../chunk-5UH6QUFB.js";
33
+ } from "../chunk-MVGOAMTP.js";
34
34
  import {
35
35
  Label
36
36
  } from "../chunk-JWCT72WR.js";
37
- import "../chunk-WVUIIBRR.js";
37
+ import "../chunk-5UH6QUFB.js";
38
38
  import {
39
39
  Subheader
40
40
  } from "../chunk-CYZL57LH.js";
@@ -48,12 +48,12 @@ import {
48
48
  import {
49
49
  Paragraph
50
50
  } from "../chunk-HVI3CL7Y.js";
51
- import {
52
- Button
53
- } from "../chunk-FKMKHLQH.js";
54
51
  import {
55
52
  Icon
56
53
  } from "../chunk-NKUETCDA.js";
54
+ import {
55
+ Button
56
+ } from "../chunk-FKMKHLQH.js";
57
57
  import {
58
58
  componentGap,
59
59
  componentPadding
@@ -170,7 +170,7 @@ function TableBodyRow({
170
170
  /* @__PURE__ */ jsx2("td", { style: { display: "flex", width: virtualPaddingLeft } })
171
171
  ) : null,
172
172
  columns.map((column) => {
173
- var _a2, _b;
173
+ var _a2, _b, _c;
174
174
  const cell = locked ? column : visibleCells[column.index];
175
175
  if (!cell) {
176
176
  return;
@@ -185,7 +185,7 @@ function TableBodyRow({
185
185
  className: clsx2({
186
186
  "justify-end": typeof cellValue === "number"
187
187
  }),
188
- width: (_b = cell.column.columnDef.meta) == null ? void 0 : _b.headerWidth,
188
+ width: (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.headerWidth) != null ? _c : `${cell.column.getSize()}px`,
189
189
  children: /* @__PURE__ */ jsx2(
190
190
  Tooltip,
191
191
  {
@@ -412,68 +412,75 @@ function PinnedColumns(_a) {
412
412
  "data-testid": pinnedTestId,
413
413
  children: [
414
414
  /* @__PURE__ */ jsx5("thead", { className: "sticky top-0 z-20 grid", children: headerGroups.map((headerGroup) => {
415
- return /* @__PURE__ */ jsx5("tr", { "data-testid": pinnedTestId ? `${pinnedTestId}-header-row-${headerGroup.id}` : void 0, className: "flex w-full", children: headerGroup.headers.map((header) => {
416
- var _a3, _b2, _c;
417
- if (!header) {
418
- return;
419
- }
420
- if (typeof header.column.columnDef.header === "string") {
421
- const customHeaderWidth = (_a3 = header.column.columnDef.meta) == null ? void 0 : _a3.headerWidth;
422
- return /* @__PURE__ */ jsxs3(
423
- DataCellHeader,
424
- {
425
- locked: true,
426
- testid: pinnedTestId ? `${pinnedTestId}-header-${header.id}` : void 0,
427
- header,
428
- center: centerHeader,
429
- width: customHeaderWidth,
430
- className: clsx4(
431
- header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
432
- "group"
433
- ),
434
- children: [
435
- /* @__PURE__ */ jsx5(Subheader, { tall: true, children: header.column.columnDef.header }),
436
- getSortIcon(header.column.getIsSorted()),
437
- !header.column.getIsSorted() && header.column.getCanSort() && getSortIcon(
438
- header.column.getNextSortingOrder(),
439
- true
440
- ),
441
- header.column.getSortIndex() !== -1 && table.getState().sorting.length > 1 && /* @__PURE__ */ jsx5(Subheader, { tall: true, children: header.column.getSortIndex() + 1 }),
442
- !((_b2 = header.column.columnDef.meta) == null ? void 0 : _b2.locked) && /* @__PURE__ */ jsx5(
443
- "div",
444
- {
445
- onDoubleClick: (e) => {
446
- e.stopPropagation();
447
- header.column.resetSize();
448
- },
449
- onMouseDown: (e) => {
450
- e.stopPropagation();
451
- header.getResizeHandler()(e);
452
- },
453
- onTouchStart: (e) => {
454
- e.stopPropagation();
455
- header.getResizeHandler()(e);
456
- },
457
- className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
458
- }
459
- )
460
- ]
461
- },
462
- header.id
463
- );
464
- }
465
- return /* @__PURE__ */ jsx5(React2.Fragment, { children: ((_c = header.column.columnDef.meta) == null ? void 0 : _c.checkbox) ? /* @__PURE__ */ jsx5(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ jsx5(
466
- Checkbox,
467
- {
468
- checked: allSelectedAcrossPages,
469
- indeterminate: someSelectedAcrossPages,
470
- onChange: toggleSelectAllAcrossPages
471
- }
472
- ) }) : flexRender2(
473
- header.column.columnDef.header,
474
- header.getContext()
475
- ) }, header.id);
476
- }) }, headerGroup.id);
415
+ return /* @__PURE__ */ jsx5(
416
+ "tr",
417
+ {
418
+ "data-testid": pinnedTestId ? `${pinnedTestId}-header-row-${headerGroup.id}` : void 0,
419
+ className: "flex w-full",
420
+ children: headerGroup.headers.map((header) => {
421
+ var _a3, _b2, _c, _d;
422
+ if (!header) {
423
+ return;
424
+ }
425
+ if (typeof header.column.columnDef.header === "string") {
426
+ return /* @__PURE__ */ jsxs3(
427
+ DataCellHeader,
428
+ {
429
+ locked: true,
430
+ testid: pinnedTestId ? `${pinnedTestId}-header-${header.id}` : void 0,
431
+ header,
432
+ center: centerHeader,
433
+ width: (_b2 = (_a3 = header.column.columnDef.meta) == null ? void 0 : _a3.headerWidth) != null ? _b2 : `${header.column.getSize()}px`,
434
+ className: clsx4(
435
+ header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
436
+ "group"
437
+ ),
438
+ children: [
439
+ /* @__PURE__ */ jsx5(Subheader, { tall: true, children: header.column.columnDef.header }),
440
+ getSortIcon(header.column.getIsSorted()),
441
+ !header.column.getIsSorted() && header.column.getCanSort() && getSortIcon(
442
+ header.column.getNextSortingOrder(),
443
+ true
444
+ ),
445
+ header.column.getSortIndex() !== -1 && table.getState().sorting.length > 1 && /* @__PURE__ */ jsx5(Subheader, { tall: true, children: header.column.getSortIndex() + 1 }),
446
+ !((_c = header.column.columnDef.meta) == null ? void 0 : _c.locked) && /* @__PURE__ */ jsx5(
447
+ "div",
448
+ {
449
+ onDoubleClick: (e) => {
450
+ e.stopPropagation();
451
+ header.column.resetSize();
452
+ },
453
+ onMouseDown: (e) => {
454
+ e.stopPropagation();
455
+ header.getResizeHandler()(e);
456
+ },
457
+ onTouchStart: (e) => {
458
+ e.stopPropagation();
459
+ header.getResizeHandler()(e);
460
+ },
461
+ className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
462
+ }
463
+ )
464
+ ]
465
+ },
466
+ header.id
467
+ );
468
+ }
469
+ return /* @__PURE__ */ jsx5(React2.Fragment, { children: ((_d = header.column.columnDef.meta) == null ? void 0 : _d.checkbox) ? /* @__PURE__ */ jsx5(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ jsx5(
470
+ Checkbox,
471
+ {
472
+ checked: allSelectedAcrossPages,
473
+ indeterminate: someSelectedAcrossPages,
474
+ onChange: toggleSelectAllAcrossPages
475
+ }
476
+ ) }) : flexRender2(
477
+ header.column.columnDef.header,
478
+ header.getContext()
479
+ ) }, header.id);
480
+ })
481
+ },
482
+ headerGroup.id
483
+ );
477
484
  }) }),
478
485
  /* @__PURE__ */ jsx5(
479
486
  TableBody,
@@ -535,7 +542,7 @@ function ColumnSelectorHeaderCell({
535
542
  {
536
543
  id,
537
544
  testid,
538
- width: "48",
545
+ width: "48px",
539
546
  type: "header",
540
547
  color: "text-secondary-normal",
541
548
  ref,
@@ -781,7 +788,7 @@ function DataGrid({
781
788
  //estimate width of each column for accurate scrollbar dragging
782
789
  getScrollElement: () => containerRef.current,
783
790
  horizontal: true,
784
- overscan: 3
791
+ overscan: 8
785
792
  //how many columns to render on each side off screen each way
786
793
  });
787
794
  const virtualColumns = columnVirtualizer.getVirtualItems();
@@ -836,118 +843,126 @@ function DataGrid({
836
843
  }
837
844
  ),
838
845
  /* @__PURE__ */ jsxs5("table", { className: "flex-1 flex flex-col min-h-min", children: [
839
- /* @__PURE__ */ jsx8("thead", { className: "sticky top-0 z-10 grid", children: table.getCenterHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxs5("tr", { "data-testid": testid ? `${testid}-header-row-${headerGroup.id}` : void 0, className: "flex w-full", children: [
840
- virtualPaddingLeft ? (
841
- // fake empty column to the left for virtualization scroll padding
842
- /* @__PURE__ */ jsx8(
843
- "th",
844
- {
845
- style: { display: "flex", width: virtualPaddingLeft }
846
- }
847
- )
848
- ) : null,
849
- virtualColumns.map((virtualColumn) => {
850
- var _a2, _b2, _c2, _d2;
851
- const header = headerGroup.headers[virtualColumn.index];
852
- if (!header) {
853
- return;
854
- }
855
- if (typeof header.column.columnDef.header === "string") {
856
- const customHeaderWidth = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.headerWidth;
857
- const cellValue = (_b2 = table.getRowModel().rows[0]) == null ? void 0 : _b2.getValue(header.column.id);
858
- return /* @__PURE__ */ jsxs5(
859
- DraggableCellHeader,
860
- {
861
- id: id ? `${id}-header-${header.id}` : void 0,
862
- testid: testid ? `${testid}-header-${header.id}` : void 0,
863
- header,
864
- locked: (_c2 = header.column.columnDef.meta) == null ? void 0 : _c2.locked,
865
- center: centerHeader,
866
- width: customHeaderWidth,
867
- className: clsx5(
868
- header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
869
- "group",
846
+ /* @__PURE__ */ jsx8("thead", { className: "sticky top-0 z-10 grid", children: table.getCenterHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxs5(
847
+ "tr",
848
+ {
849
+ "data-testid": testid ? `${testid}-header-row-${headerGroup.id}` : void 0,
850
+ className: "flex w-full",
851
+ children: [
852
+ virtualPaddingLeft ? (
853
+ // fake empty column to the left for virtualization scroll padding
854
+ /* @__PURE__ */ jsx8(
855
+ "th",
856
+ {
857
+ style: { display: "flex", width: virtualPaddingLeft }
858
+ }
859
+ )
860
+ ) : null,
861
+ virtualColumns.map((virtualColumn) => {
862
+ var _a2, _b2, _c2, _d2;
863
+ const header = headerGroup.headers[virtualColumn.index];
864
+ if (!header) {
865
+ return;
866
+ }
867
+ if (typeof header.column.columnDef.header === "string") {
868
+ const customHeaderWidth = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.headerWidth;
869
+ const cellValue = (_b2 = table.getRowModel().rows[0]) == null ? void 0 : _b2.getValue(header.column.id);
870
+ return /* @__PURE__ */ jsxs5(
871
+ DraggableCellHeader,
870
872
  {
871
- "justify-end": typeof cellValue === "number"
872
- }
873
- ),
874
- useMenuDefaultMinWidth,
875
- children: [
876
- typeof cellValue !== "number" && /* @__PURE__ */ jsx8(Subheader, { tall: true, children: header.column.columnDef.header }),
877
- getSortIcon(header.column.getIsSorted()),
878
- !header.column.getIsSorted() && header.column.getCanSort() && getSortIcon(
879
- header.column.getNextSortingOrder(),
880
- true
881
- ),
882
- header.column.getSortIndex() !== -1 && table.getState().sorting.length > 1 && /* @__PURE__ */ jsx8(Subheader, { tall: true, children: header.column.getSortIndex() + 1 }),
883
- typeof cellValue === "number" && /* @__PURE__ */ jsx8(Subheader, { tall: true, children: header.column.columnDef.header }),
884
- /* @__PURE__ */ jsx8(
885
- "div",
873
+ id: id ? `${id}-header-${header.id}` : void 0,
874
+ testid: testid ? `${testid}-header-${header.id}` : void 0,
875
+ header,
876
+ locked: (_c2 = header.column.columnDef.meta) == null ? void 0 : _c2.locked,
877
+ center: centerHeader,
878
+ width: customHeaderWidth,
879
+ className: clsx5(
880
+ header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
881
+ "group",
882
+ {
883
+ "justify-end": typeof cellValue === "number"
884
+ }
885
+ ),
886
+ useMenuDefaultMinWidth,
887
+ children: [
888
+ typeof cellValue !== "number" && /* @__PURE__ */ jsx8(Subheader, { tall: true, children: header.column.columnDef.header }),
889
+ getSortIcon(header.column.getIsSorted()),
890
+ !header.column.getIsSorted() && header.column.getCanSort() && getSortIcon(
891
+ header.column.getNextSortingOrder(),
892
+ true
893
+ ),
894
+ header.column.getSortIndex() !== -1 && table.getState().sorting.length > 1 && /* @__PURE__ */ jsx8(Subheader, { tall: true, children: header.column.getSortIndex() + 1 }),
895
+ typeof cellValue === "number" && /* @__PURE__ */ jsx8(Subheader, { tall: true, children: header.column.columnDef.header }),
896
+ /* @__PURE__ */ jsx8(
897
+ "div",
898
+ {
899
+ onDoubleClick: (e) => {
900
+ e.stopPropagation();
901
+ header.column.resetSize();
902
+ },
903
+ onMouseDown: (e) => {
904
+ e.stopPropagation();
905
+ header.getResizeHandler()(e);
906
+ },
907
+ onTouchStart: (e) => {
908
+ e.stopPropagation();
909
+ header.getResizeHandler()(e);
910
+ },
911
+ className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
912
+ }
913
+ )
914
+ ]
915
+ },
916
+ header.id
917
+ );
918
+ }
919
+ return /* @__PURE__ */ jsx8(React3.Fragment, { children: ((_d2 = header.column.columnDef.meta) == null ? void 0 : _d2.checkbox) ? /* @__PURE__ */ jsx8(
920
+ DataGridCell,
921
+ {
922
+ id: id ? `${id}-header-${header.id}` : void 0,
923
+ testid: testid ? `${testid}-header-${header.id}` : void 0,
924
+ type: "header",
925
+ component: "checkbox",
926
+ locked: true,
927
+ children: /* @__PURE__ */ jsx8(
928
+ Checkbox,
886
929
  {
887
- onDoubleClick: (e) => {
888
- e.stopPropagation();
889
- header.column.resetSize();
890
- },
891
- onMouseDown: (e) => {
892
- e.stopPropagation();
893
- header.getResizeHandler()(e);
894
- },
895
- onTouchStart: (e) => {
896
- e.stopPropagation();
897
- header.getResizeHandler()(e);
898
- },
899
- className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
930
+ id: id ? `${id}-select-all-checkbox` : void 0,
931
+ testid: testid ? `${testid}-select-all-checkbox` : void 0,
932
+ checked: allSelectedAcrossPages,
933
+ indeterminate: someSelectedAcrossPages,
934
+ onChange: toggleSelectAllAcrossPages
900
935
  }
901
936
  )
902
- ]
903
- },
904
- header.id
905
- );
906
- }
907
- return /* @__PURE__ */ jsx8(React3.Fragment, { children: ((_d2 = header.column.columnDef.meta) == null ? void 0 : _d2.checkbox) ? /* @__PURE__ */ jsx8(
908
- DataGridCell,
909
- {
910
- id: id ? `${id}-header-${header.id}` : void 0,
911
- testid: testid ? `${testid}-header-${header.id}` : void 0,
912
- type: "header",
913
- component: "checkbox",
914
- locked: true,
915
- children: /* @__PURE__ */ jsx8(
916
- Checkbox,
937
+ }
938
+ ) : flexRender3(
939
+ header.column.columnDef.header,
940
+ header.getContext()
941
+ ) }, header.id);
942
+ }),
943
+ virtualPaddingRight ? (
944
+ //fake empty column to the right for virtualization scroll padding
945
+ /* @__PURE__ */ jsx8(
946
+ "th",
917
947
  {
918
- id: id ? `${id}-select-all-checkbox` : void 0,
919
- testid: testid ? `${testid}-select-all-checkbox` : void 0,
920
- checked: allSelectedAcrossPages,
921
- indeterminate: someSelectedAcrossPages,
922
- onChange: toggleSelectAllAcrossPages
948
+ style: { display: "flex", width: virtualPaddingRight }
923
949
  }
924
950
  )
925
- }
926
- ) : flexRender3(
927
- header.column.columnDef.header,
928
- header.getContext()
929
- ) }, header.id);
930
- }),
931
- virtualPaddingRight ? (
932
- //fake empty column to the right for virtualization scroll padding
933
- /* @__PURE__ */ jsx8(
934
- "th",
935
- {
936
- style: { display: "flex", width: virtualPaddingRight }
937
- }
938
- )
939
- ) : null,
940
- enableColumnSelector && /* @__PURE__ */ jsx8(
941
- ColumnSelectorHeaderCell,
942
- {
943
- id: id ? `${id}-column-selector` : void 0,
944
- testid: testid ? `${testid}-column-selector` : void 0,
945
- table,
946
- toggleColumnVisibility,
947
- resetColumnVisibility
948
- }
949
- )
950
- ] }, headerGroup.id)) }),
951
+ ) : null,
952
+ enableColumnSelector && /* @__PURE__ */ jsx8(
953
+ ColumnSelectorHeaderCell,
954
+ {
955
+ id: id ? `${id}-column-selector` : void 0,
956
+ testid: testid ? `${testid}-column-selector` : void 0,
957
+ table,
958
+ toggleColumnVisibility,
959
+ resetColumnVisibility
960
+ }
961
+ )
962
+ ]
963
+ },
964
+ headerGroup.id
965
+ )) }),
951
966
  /* @__PURE__ */ jsx8(
952
967
  TableBody,
953
968
  {
@@ -1076,7 +1091,13 @@ function DataGrid({
1076
1091
  )
1077
1092
  ] })
1078
1093
  ] }),
1079
- status && /* @__PURE__ */ jsx8(Paragraph, { testid: testid ? `${testid}-status-text` : void 0, children: status })
1094
+ status && /* @__PURE__ */ jsx8(
1095
+ Paragraph,
1096
+ {
1097
+ testid: testid ? `${testid}-status-text` : void 0,
1098
+ children: status
1099
+ }
1100
+ )
1080
1101
  ] })
1081
1102
  ]
1082
1103
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.172",
4
+ "version": "0.0.173",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",
@@ -23,7 +23,7 @@ export function ColumnSelectorHeaderCell<T>({
23
23
  <DataGridCell
24
24
  id={id}
25
25
  testid={testid}
26
- width="48"
26
+ width="48px"
27
27
  type="header"
28
28
  color="text-secondary-normal"
29
29
  ref={ref}
@@ -50,24 +50,37 @@ export function PinnedColumns<TData>({
50
50
  <thead className="sticky top-0 z-20 grid">
51
51
  {headerGroups.map((headerGroup) => {
52
52
  return (
53
- <tr key={headerGroup.id} data-testid={pinnedTestId ? `${pinnedTestId}-header-row-${headerGroup.id}` : undefined} className="flex w-full">
53
+ <tr
54
+ key={headerGroup.id}
55
+ data-testid={
56
+ pinnedTestId
57
+ ? `${pinnedTestId}-header-row-${headerGroup.id}`
58
+ : undefined
59
+ }
60
+ className="flex w-full"
61
+ >
54
62
  {headerGroup.headers.map((header) => {
55
63
  if (!header) {
56
64
  return;
57
65
  }
58
66
 
59
67
  if (typeof header.column.columnDef.header === "string") {
60
- const customHeaderWidth =
61
- header.column.columnDef.meta?.headerWidth;
62
-
63
68
  return (
64
69
  <DataCellHeader
65
70
  locked
66
71
  key={header.id}
67
- testid={pinnedTestId ? `${pinnedTestId}-header-${header.id}` : undefined}
72
+ testid={
73
+ pinnedTestId
74
+ ? `${pinnedTestId}-header-${header.id}`
75
+ : undefined
76
+ }
68
77
  header={header}
69
78
  center={centerHeader}
70
- width={customHeaderWidth}
79
+ width={
80
+ (header.column.columnDef.meta?.headerWidth as
81
+ | string
82
+ | undefined) ?? `${header.column.getSize()}px`
83
+ }
71
84
  className={clsx(
72
85
  header.column.getCanSort()
73
86
  ? "cursor-pointer"
@@ -100,12 +100,17 @@ export function TableBodyRow<T>({
100
100
  <CellElement
101
101
  key={cell.id}
102
102
  id={id ? `${id}-row-${row.id}-cell-${cell.id}` : undefined}
103
- testid={testid ? `${testid}-row-${row.id}-cell-${cell.id}` : undefined}
103
+ testid={
104
+ testid ? `${testid}-row-${row.id}-cell-${cell.id}` : undefined
105
+ }
104
106
  cell={cell}
105
107
  className={clsx({
106
108
  "justify-end": typeof cellValue === "number",
107
109
  })}
108
- width={cell.column.columnDef.meta?.headerWidth}
110
+ width={
111
+ (cell.column.columnDef.meta?.headerWidth as string | undefined) ??
112
+ `${cell.column.getSize()}px`
113
+ }
109
114
  >
110
115
  <Tooltip
111
116
  id={id ? `${id}-tooltip-${cell.id}` : undefined}