@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.
- package/dist/{chunk-PMBEIP24.js → chunk-IDSFWKOR.js} +1 -1
- package/dist/{chunk-XH65MD2C.js → chunk-KADNOKNW.js} +1 -1
- package/dist/{chunk-F6YFWBVV.js → chunk-REGRTR2Y.js} +2 -2
- package/dist/{chunk-O4JGGMFE.js → chunk-TB7VTSDP.js} +26 -15
- package/dist/components/DataGridCell.cjs +20 -9
- package/dist/components/DataGridCell.js +6 -6
- package/dist/components/DateInput.js +10 -10
- package/dist/components/DateRangeInput.js +10 -10
- package/dist/components/FilterGroup.js +5 -5
- package/dist/components/Input.js +2 -2
- package/dist/components/MobileDataGrid.js +3 -3
- package/dist/components/Modal.js +4 -4
- package/dist/components/ModalButtons.js +2 -2
- package/dist/components/ModalHeader.js +2 -2
- package/dist/components/NavigationTab.js +2 -2
- package/dist/components/NavigationTabs.js +2 -2
- package/dist/components/Notification.js +3 -3
- package/dist/components/OptionPill.js +2 -2
- package/dist/components/PDFViewer.js +6 -6
- package/dist/components/Password.js +2 -2
- package/dist/components/Search.js +3 -3
- package/dist/components/Select.js +3 -3
- package/dist/components/Stepper.js +5 -5
- package/dist/components/Time.js +2 -2
- package/dist/components/Toast.js +3 -3
- package/dist/components/Upload.js +3 -3
- package/dist/components/index.cjs +213 -181
- package/dist/components/index.js +205 -184
- package/package.json +1 -1
- package/src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx +1 -1
- package/src/components/DataGrid/PinnedColumns.tsx +19 -6
- package/src/components/DataGrid/TableBody/TableBodyRow.tsx +7 -2
- package/src/components/DataGrid/index.tsx +38 -9
- package/src/components/DataGridCell.tsx +16 -4
- package/dist/{chunk-4T3DRGLF.js → chunk-MVGOAMTP.js} +3 -3
- package/dist/{chunk-C4JGTH6G.js → chunk-T7NDKJDP.js} +3 -3
- package/dist/{chunk-LM5MKBPM.js → chunk-UGNB32SL.js} +3 -3
- package/dist/{chunk-ZGFQN47L.js → chunk-ZR4E5A43.js} +3 -3
- package/dist/{chunk-MJKBQSNI.js → chunk-ZSKLCKIR.js} +3 -3
|
@@ -299,7 +299,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
299
299
|
estimateSize: (index) => visibleColumns[index].getSize(), //estimate width of each column for accurate scrollbar dragging
|
|
300
300
|
getScrollElement: () => containerRef.current,
|
|
301
301
|
horizontal: true,
|
|
302
|
-
overscan:
|
|
302
|
+
overscan: 8, //how many columns to render on each side off screen each way
|
|
303
303
|
});
|
|
304
304
|
|
|
305
305
|
const virtualColumns = columnVirtualizer.getVirtualItems();
|
|
@@ -355,7 +355,15 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
355
355
|
<table className="flex-1 flex flex-col min-h-min">
|
|
356
356
|
<thead className="sticky top-0 z-10 grid">
|
|
357
357
|
{table.getCenterHeaderGroups().map((headerGroup) => (
|
|
358
|
-
<tr
|
|
358
|
+
<tr
|
|
359
|
+
data-testid={
|
|
360
|
+
testid
|
|
361
|
+
? `${testid}-header-row-${headerGroup.id}`
|
|
362
|
+
: undefined
|
|
363
|
+
}
|
|
364
|
+
key={headerGroup.id}
|
|
365
|
+
className="flex w-full"
|
|
366
|
+
>
|
|
359
367
|
{virtualPaddingLeft ? (
|
|
360
368
|
// fake empty column to the left for virtualization scroll padding
|
|
361
369
|
<th
|
|
@@ -381,7 +389,11 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
381
389
|
<DraggableCellHeader
|
|
382
390
|
key={header.id}
|
|
383
391
|
id={id ? `${id}-header-${header.id}` : undefined}
|
|
384
|
-
testid={
|
|
392
|
+
testid={
|
|
393
|
+
testid
|
|
394
|
+
? `${testid}-header-${header.id}`
|
|
395
|
+
: undefined
|
|
396
|
+
}
|
|
385
397
|
header={header}
|
|
386
398
|
locked={header.column.columnDef.meta?.locked}
|
|
387
399
|
center={centerHeader}
|
|
@@ -446,16 +458,23 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
446
458
|
{header.column.columnDef.meta?.checkbox ? (
|
|
447
459
|
<DataGridCell
|
|
448
460
|
id={id ? `${id}-header-${header.id}` : undefined}
|
|
449
|
-
testid={
|
|
461
|
+
testid={
|
|
462
|
+
testid
|
|
463
|
+
? `${testid}-header-${header.id}`
|
|
464
|
+
: undefined
|
|
465
|
+
}
|
|
450
466
|
type="header"
|
|
451
|
-
component="checkbox"
|
|
467
|
+
component="checkbox"
|
|
468
|
+
locked
|
|
452
469
|
>
|
|
453
470
|
<Checkbox
|
|
454
471
|
id={
|
|
455
472
|
id ? `${id}-select-all-checkbox` : undefined
|
|
456
473
|
}
|
|
457
474
|
testid={
|
|
458
|
-
testid
|
|
475
|
+
testid
|
|
476
|
+
? `${testid}-select-all-checkbox`
|
|
477
|
+
: undefined
|
|
459
478
|
}
|
|
460
479
|
checked={allSelectedAcrossPages}
|
|
461
480
|
indeterminate={someSelectedAcrossPages}
|
|
@@ -481,7 +500,9 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
481
500
|
{enableColumnSelector && (
|
|
482
501
|
<ColumnSelectorHeaderCell
|
|
483
502
|
id={id ? `${id}-column-selector` : undefined}
|
|
484
|
-
testid={
|
|
503
|
+
testid={
|
|
504
|
+
testid ? `${testid}-column-selector` : undefined
|
|
505
|
+
}
|
|
485
506
|
table={table}
|
|
486
507
|
toggleColumnVisibility={toggleColumnVisibility}
|
|
487
508
|
resetColumnVisibility={resetColumnVisibility}
|
|
@@ -554,7 +575,9 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
554
575
|
<Menu
|
|
555
576
|
{...props}
|
|
556
577
|
id={id ? `${id}-pagesize-menu` : undefined}
|
|
557
|
-
testid={
|
|
578
|
+
testid={
|
|
579
|
+
testid ? `${testid}-pagesize-menu` : undefined
|
|
580
|
+
}
|
|
558
581
|
>
|
|
559
582
|
{PAGE_SIZE_OPTIONS.map((option) => (
|
|
560
583
|
<MenuOption
|
|
@@ -616,7 +639,13 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
616
639
|
</div>
|
|
617
640
|
)}
|
|
618
641
|
|
|
619
|
-
{status &&
|
|
642
|
+
{status && (
|
|
643
|
+
<Paragraph
|
|
644
|
+
testid={testid ? `${testid}-status-text` : undefined}
|
|
645
|
+
>
|
|
646
|
+
{status}
|
|
647
|
+
</Paragraph>
|
|
648
|
+
)}
|
|
620
649
|
</div>
|
|
621
650
|
)}
|
|
622
651
|
</div>
|
|
@@ -241,6 +241,8 @@ export function DataCellHeader<T>({
|
|
|
241
241
|
predeterminedPinned.current = [...left, ...right].includes(
|
|
242
242
|
header.column.id,
|
|
243
243
|
);
|
|
244
|
+
// header is stable for the lifetime of the header cell
|
|
245
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
244
246
|
}, []);
|
|
245
247
|
|
|
246
248
|
useEffect(() => {
|
|
@@ -251,12 +253,14 @@ export function DataCellHeader<T>({
|
|
|
251
253
|
return () => {
|
|
252
254
|
clearTimeout(handler);
|
|
253
255
|
};
|
|
256
|
+
// We only want to react to filter changes; header.column methods are stable
|
|
257
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
254
258
|
}, [filter]);
|
|
255
259
|
|
|
256
260
|
const style: CSSProperties = {
|
|
257
261
|
position: "relative",
|
|
258
262
|
whiteSpace: "nowrap",
|
|
259
|
-
width: header.column.getSize(),
|
|
263
|
+
width: header.column.columnDef.meta?.headerWidth ?? header.column.getSize(),
|
|
260
264
|
"--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
|
|
261
265
|
"--color-icon-on-action-primary-normal":
|
|
262
266
|
"var(--color-text-brand-primary-normal)",
|
|
@@ -466,7 +470,7 @@ export function DraggableCellHeader<T extends Record<string, any>>({
|
|
|
466
470
|
transition: "width transform 0.2s ease-in-out",
|
|
467
471
|
whiteSpace: "nowrap",
|
|
468
472
|
zIndex: isDragging ? 1 : 0,
|
|
469
|
-
width: header.column.getSize(),
|
|
473
|
+
width: header.column.columnDef.meta?.headerWidth ?? header.column.getSize(),
|
|
470
474
|
"--color-text-primary-normal": "var(--color-action-000)",
|
|
471
475
|
"--color-icon-on-action-primary-normal": "var(--color-action-000)",
|
|
472
476
|
userSelect: "none",
|
|
@@ -506,12 +510,20 @@ export function DragAlongCell<T extends RowData, TValue>({
|
|
|
506
510
|
position: "relative",
|
|
507
511
|
transform: CSS.Translate.toString(transform),
|
|
508
512
|
transition: "width transform 0.2s ease-in-out",
|
|
509
|
-
width: cell.column.getSize(),
|
|
513
|
+
width: cell.column.columnDef.meta?.headerWidth ?? cell.column.getSize(),
|
|
510
514
|
zIndex: isDragging ? 1 : 0,
|
|
511
515
|
};
|
|
512
516
|
|
|
513
517
|
return (
|
|
514
|
-
<DataGridCell
|
|
518
|
+
<DataGridCell
|
|
519
|
+
style={style}
|
|
520
|
+
ref={setNodeRef}
|
|
521
|
+
width={
|
|
522
|
+
(cell.column.columnDef.meta?.headerWidth as string | undefined) ??
|
|
523
|
+
`${cell.column.getSize()}px`
|
|
524
|
+
}
|
|
525
|
+
{...props}
|
|
526
|
+
>
|
|
515
527
|
{children}
|
|
516
528
|
</DataGridCell>
|
|
517
529
|
);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Label
|
|
3
|
+
} from "./chunk-JWCT72WR.js";
|
|
1
4
|
import {
|
|
2
5
|
formatCurrencyDisplay,
|
|
3
6
|
formatDecimalValue,
|
|
4
7
|
getDecimalPlaceholder
|
|
5
8
|
} from "./chunk-5UH6QUFB.js";
|
|
6
|
-
import {
|
|
7
|
-
Label
|
|
8
|
-
} from "./chunk-JWCT72WR.js";
|
|
9
9
|
import {
|
|
10
10
|
Icon
|
|
11
11
|
} from "./chunk-NKUETCDA.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Label
|
|
3
3
|
} from "./chunk-JWCT72WR.js";
|
|
4
|
-
import {
|
|
5
|
-
Button
|
|
6
|
-
} from "./chunk-FKMKHLQH.js";
|
|
7
4
|
import {
|
|
8
5
|
Icon
|
|
9
6
|
} from "./chunk-NKUETCDA.js";
|
|
7
|
+
import {
|
|
8
|
+
Button
|
|
9
|
+
} from "./chunk-FKMKHLQH.js";
|
|
10
10
|
import {
|
|
11
11
|
baseTransition,
|
|
12
12
|
componentGap,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Heading2
|
|
3
3
|
} from "./chunk-AZ7LVLOK.js";
|
|
4
|
-
import {
|
|
5
|
-
Button
|
|
6
|
-
} from "./chunk-FKMKHLQH.js";
|
|
7
4
|
import {
|
|
8
5
|
Icon
|
|
9
6
|
} from "./chunk-NKUETCDA.js";
|
|
7
|
+
import {
|
|
8
|
+
Button
|
|
9
|
+
} from "./chunk-FKMKHLQH.js";
|
|
10
10
|
import {
|
|
11
11
|
layoutGroupGap,
|
|
12
12
|
layoutPaddding
|