@dmsi/wedgekit-react 0.0.208 → 0.0.210
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-2WRRRPEB.js → chunk-BHFIS4ZV.js} +1 -1
- package/dist/{chunk-33W2KSCB.js → chunk-HKSYYK4K.js} +1 -1
- package/dist/{chunk-EFX3RPW4.js → chunk-LQW4LMNB.js} +18 -27
- package/dist/components/DataGridCell.cjs +826 -839
- package/dist/components/DataGridCell.js +6 -6
- package/dist/components/DateInput.js +7 -7
- package/dist/components/DateRangeInput.js +7 -7
- package/dist/components/FilterGroup.js +7 -7
- package/dist/components/Input.js +2 -2
- package/dist/components/MenuOption.js +2 -2
- package/dist/components/MobileDataGrid.js +3 -3
- package/dist/components/Modal.js +1 -1
- package/dist/components/NestedMenu.js +2 -2
- package/dist/components/Notification.js +3 -3
- package/dist/components/PDFViewer.js +3 -3
- 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 +2 -2
- package/dist/components/Time.js +4 -4
- package/dist/components/Toast.js +3 -3
- package/dist/components/Upload.js +3 -3
- package/dist/components/index.cjs +901 -909
- package/dist/components/index.js +33 -28
- package/package.json +1 -1
- package/src/components/DataGrid/TableBody/TableBodyRow.tsx +0 -4
- package/src/components/DataGrid/TableBody/index.tsx +14 -3
- package/src/components/DataGrid/index.tsx +1 -4
- package/src/components/DataGridCell.tsx +11 -17
- package/dist/{chunk-7W4I2NK3.js → chunk-GW7OVMMC.js} +3 -3
- package/dist/{chunk-ERW3AMED.js → chunk-TPZ6752P.js} +3 -3
package/dist/components/index.js
CHANGED
|
@@ -3,40 +3,43 @@ import {
|
|
|
3
3
|
} from "../chunk-3WNXMCZV.js";
|
|
4
4
|
import {
|
|
5
5
|
Select
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import {
|
|
8
|
-
Checkbox
|
|
9
|
-
} from "../chunk-E3UOI2D2.js";
|
|
6
|
+
} from "../chunk-HKSYYK4K.js";
|
|
10
7
|
import {
|
|
11
8
|
DataCellHeader,
|
|
12
9
|
DataGridCell,
|
|
13
10
|
DragAlongCell,
|
|
14
11
|
DraggableCellHeader
|
|
15
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-LQW4LMNB.js";
|
|
16
13
|
import {
|
|
17
14
|
Menu
|
|
18
15
|
} from "../chunk-JITZWSPR.js";
|
|
19
16
|
import "../chunk-NIHZMIOL.js";
|
|
20
17
|
import {
|
|
21
18
|
MenuOption
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import
|
|
24
|
-
useInfiniteScroll,
|
|
25
|
-
useTableLayout
|
|
26
|
-
} from "../chunk-E6Y7ZHQX.js";
|
|
27
|
-
import "../chunk-VXWSAIB5.js";
|
|
28
|
-
import "../chunk-T3F37S6Z.js";
|
|
19
|
+
} from "../chunk-TPZ6752P.js";
|
|
20
|
+
import "../chunk-WVUIIBRR.js";
|
|
29
21
|
import {
|
|
30
22
|
Search
|
|
31
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-BHFIS4ZV.js";
|
|
32
24
|
import {
|
|
33
25
|
Input
|
|
34
|
-
} from "../chunk-
|
|
35
|
-
import "../chunk-5UH6QUFB.js";
|
|
26
|
+
} from "../chunk-GW7OVMMC.js";
|
|
36
27
|
import {
|
|
37
28
|
Label
|
|
38
29
|
} from "../chunk-CJVTFYI4.js";
|
|
39
|
-
import
|
|
30
|
+
import {
|
|
31
|
+
Checkbox
|
|
32
|
+
} from "../chunk-E3UOI2D2.js";
|
|
33
|
+
import {
|
|
34
|
+
Button
|
|
35
|
+
} from "../chunk-SK742QNF.js";
|
|
36
|
+
import {
|
|
37
|
+
useInfiniteScroll,
|
|
38
|
+
useTableLayout
|
|
39
|
+
} from "../chunk-E6Y7ZHQX.js";
|
|
40
|
+
import "../chunk-VXWSAIB5.js";
|
|
41
|
+
import "../chunk-T3F37S6Z.js";
|
|
42
|
+
import "../chunk-5UH6QUFB.js";
|
|
40
43
|
import {
|
|
41
44
|
Subheader
|
|
42
45
|
} from "../chunk-KGVKHWUK.js";
|
|
@@ -50,9 +53,6 @@ import {
|
|
|
50
53
|
import {
|
|
51
54
|
Paragraph
|
|
52
55
|
} from "../chunk-CJELWEO2.js";
|
|
53
|
-
import {
|
|
54
|
-
Button
|
|
55
|
-
} from "../chunk-SK742QNF.js";
|
|
56
56
|
import {
|
|
57
57
|
Icon
|
|
58
58
|
} from "../chunk-UAPWR2KE.js";
|
|
@@ -172,7 +172,7 @@ function TableBodyRow({
|
|
|
172
172
|
/* @__PURE__ */ jsx2("td", { style: { display: "flex", width: virtualPaddingLeft } })
|
|
173
173
|
) : null,
|
|
174
174
|
columns.map((column) => {
|
|
175
|
-
var _a2
|
|
175
|
+
var _a2;
|
|
176
176
|
const cell = locked ? column : visibleCells[column.index];
|
|
177
177
|
if (!cell) {
|
|
178
178
|
return;
|
|
@@ -187,7 +187,6 @@ function TableBodyRow({
|
|
|
187
187
|
className: clsx2({
|
|
188
188
|
"justify-end": typeof cellValue === "number"
|
|
189
189
|
}),
|
|
190
|
-
width: (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.headerWidth) != null ? _c : `${cell.column.getSize()}px`,
|
|
191
190
|
children: /* @__PURE__ */ jsx2(
|
|
192
191
|
Tooltip,
|
|
193
192
|
{
|
|
@@ -373,7 +372,15 @@ function TableBody({
|
|
|
373
372
|
transform: `translateY(${virtualRows[virtualRows.length - 1].start + 40}px)`
|
|
374
373
|
},
|
|
375
374
|
className: "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal",
|
|
376
|
-
children: table.getAllLeafColumns().map((column) => /* @__PURE__ */ jsx4(
|
|
375
|
+
children: table.getAllLeafColumns().map((column) => /* @__PURE__ */ jsx4(
|
|
376
|
+
LoadingCell,
|
|
377
|
+
{
|
|
378
|
+
id,
|
|
379
|
+
testid,
|
|
380
|
+
column: column.columnDef
|
|
381
|
+
},
|
|
382
|
+
column.id
|
|
383
|
+
))
|
|
377
384
|
}
|
|
378
385
|
)
|
|
379
386
|
]
|
|
@@ -903,23 +910,21 @@ function DataGrid({
|
|
|
903
910
|
)
|
|
904
911
|
) : null,
|
|
905
912
|
virtualColumns.map((virtualColumn) => {
|
|
906
|
-
var _a2, _b2, _c2
|
|
913
|
+
var _a2, _b2, _c2;
|
|
907
914
|
const header = headerGroup.headers[virtualColumn.index];
|
|
908
915
|
if (!header) {
|
|
909
916
|
return;
|
|
910
917
|
}
|
|
911
918
|
if (typeof header.column.columnDef.header === "string") {
|
|
912
|
-
const
|
|
913
|
-
const cellValue = (_b2 = table.getRowModel().rows[0]) == null ? void 0 : _b2.getValue(header.column.id);
|
|
919
|
+
const cellValue = (_a2 = table.getRowModel().rows[0]) == null ? void 0 : _a2.getValue(header.column.id);
|
|
914
920
|
return /* @__PURE__ */ jsxs5(
|
|
915
921
|
DraggableCellHeader,
|
|
916
922
|
{
|
|
917
923
|
id: id ? `${id}-header-${header.id}` : void 0,
|
|
918
924
|
testid: testid ? `${testid}-header-${header.id}` : void 0,
|
|
919
925
|
header,
|
|
920
|
-
locked: (
|
|
926
|
+
locked: (_b2 = header.column.columnDef.meta) == null ? void 0 : _b2.locked,
|
|
921
927
|
center: centerHeader,
|
|
922
|
-
width: customHeaderWidth,
|
|
923
928
|
className: clsx5(
|
|
924
929
|
header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
|
|
925
930
|
"group",
|
|
@@ -960,7 +965,7 @@ function DataGrid({
|
|
|
960
965
|
header.id
|
|
961
966
|
);
|
|
962
967
|
}
|
|
963
|
-
return /* @__PURE__ */ jsx8(React3.Fragment, { children: ((
|
|
968
|
+
return /* @__PURE__ */ jsx8(React3.Fragment, { children: ((_c2 = header.column.columnDef.meta) == null ? void 0 : _c2.checkbox) ? /* @__PURE__ */ jsx8(
|
|
964
969
|
DataGridCell,
|
|
965
970
|
{
|
|
966
971
|
id: id ? `${id}-header-${header.id}` : void 0,
|
package/package.json
CHANGED
|
@@ -107,10 +107,6 @@ export function TableBodyRow<T>({
|
|
|
107
107
|
className={clsx({
|
|
108
108
|
"justify-end": typeof cellValue === "number",
|
|
109
109
|
})}
|
|
110
|
-
width={
|
|
111
|
-
(cell.column.columnDef.meta?.headerWidth as string | undefined) ??
|
|
112
|
-
`${cell.column.getSize()}px`
|
|
113
|
-
}
|
|
114
110
|
>
|
|
115
111
|
<Tooltip
|
|
116
112
|
id={id ? `${id}-tooltip-${cell.id}` : undefined}
|
|
@@ -89,7 +89,9 @@ export function TableBody<T>({
|
|
|
89
89
|
x.headers.map((header) => (
|
|
90
90
|
<CellElement
|
|
91
91
|
id={id ? `${id}-filter-cell-${header.id}` : undefined}
|
|
92
|
-
testid={
|
|
92
|
+
testid={
|
|
93
|
+
testid ? `${testid}-filter-cell-${header.id}` : undefined
|
|
94
|
+
}
|
|
93
95
|
noPadding
|
|
94
96
|
key={header.id}
|
|
95
97
|
cell={header}
|
|
@@ -105,7 +107,11 @@ export function TableBody<T>({
|
|
|
105
107
|
}) ?? (
|
|
106
108
|
<Search
|
|
107
109
|
id={id ? `${id}-filter-search-${header.id}` : undefined}
|
|
108
|
-
testid={
|
|
110
|
+
testid={
|
|
111
|
+
testid
|
|
112
|
+
? `${testid}-filter-search-${header.id}`
|
|
113
|
+
: undefined
|
|
114
|
+
}
|
|
109
115
|
removeRoundness
|
|
110
116
|
onChange={(e) =>
|
|
111
117
|
header.column.setFilterValue(e.target.value)
|
|
@@ -156,7 +162,12 @@ export function TableBody<T>({
|
|
|
156
162
|
className="odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal"
|
|
157
163
|
>
|
|
158
164
|
{table.getAllLeafColumns().map((column) => (
|
|
159
|
-
<LoadingCell
|
|
165
|
+
<LoadingCell
|
|
166
|
+
id={id}
|
|
167
|
+
testid={testid}
|
|
168
|
+
key={column.id}
|
|
169
|
+
column={column.columnDef}
|
|
170
|
+
/>
|
|
160
171
|
))}
|
|
161
172
|
</tr>
|
|
162
173
|
)}
|
|
@@ -401,9 +401,6 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
401
401
|
}
|
|
402
402
|
|
|
403
403
|
if (typeof header.column.columnDef.header === "string") {
|
|
404
|
-
const customHeaderWidth =
|
|
405
|
-
header.column.columnDef.meta?.headerWidth;
|
|
406
|
-
|
|
407
404
|
const cellValue = table
|
|
408
405
|
.getRowModel()
|
|
409
406
|
.rows[0]?.getValue(header.column.id);
|
|
@@ -420,7 +417,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
420
417
|
header={header}
|
|
421
418
|
locked={header.column.columnDef.meta?.locked}
|
|
422
419
|
center={centerHeader}
|
|
423
|
-
width={
|
|
420
|
+
// width={`${header.column.getSize()}px`}
|
|
424
421
|
className={clsx(
|
|
425
422
|
header.column.getCanSort()
|
|
426
423
|
? "cursor-pointer"
|
|
@@ -14,20 +14,20 @@ import clsx from "clsx";
|
|
|
14
14
|
import {
|
|
15
15
|
ComponentProps,
|
|
16
16
|
CSSProperties,
|
|
17
|
-
memo,
|
|
18
17
|
PropsWithChildren,
|
|
19
18
|
RefObject,
|
|
20
19
|
useEffect,
|
|
21
20
|
useRef,
|
|
22
21
|
useState,
|
|
22
|
+
memo,
|
|
23
23
|
} from "react";
|
|
24
24
|
import { componentPadding, paddingUsingComponentGap } from "../classNames";
|
|
25
|
-
import {
|
|
25
|
+
import { MenuOption } from "./MenuOption";
|
|
26
|
+
import { Menu } from "./Menu";
|
|
26
27
|
import { Icon } from "./Icon";
|
|
27
28
|
import { Search } from "./Search";
|
|
28
|
-
import { Menu } from "./Menu";
|
|
29
|
-
import { MenuOption } from "./MenuOption";
|
|
30
29
|
import { useSubMenuSystem } from "./useMenuSystem";
|
|
30
|
+
import type { AsProps } from "../types";
|
|
31
31
|
|
|
32
32
|
type Tags = "td" | "th";
|
|
33
33
|
|
|
@@ -44,6 +44,7 @@ type DataGridCellProps = PropsWithChildren<{
|
|
|
44
44
|
warning?: boolean;
|
|
45
45
|
center?: boolean;
|
|
46
46
|
width?: string;
|
|
47
|
+
minWidth?: string;
|
|
47
48
|
}>;
|
|
48
49
|
|
|
49
50
|
export const DataGridCell = memo(
|
|
@@ -63,6 +64,7 @@ export const DataGridCell = memo(
|
|
|
63
64
|
warning,
|
|
64
65
|
center,
|
|
65
66
|
width,
|
|
67
|
+
minWidth,
|
|
66
68
|
testid,
|
|
67
69
|
...props
|
|
68
70
|
}: AsProps<Tags> & DataGridCellProps) => {
|
|
@@ -171,7 +173,7 @@ export const DataGridCell = memo(
|
|
|
171
173
|
id={id}
|
|
172
174
|
data-testid={testid}
|
|
173
175
|
className={clsx("flex h-10", !width && "flex-1")}
|
|
174
|
-
style={{ width }}
|
|
176
|
+
style={{ width, minWidth }}
|
|
175
177
|
{...props}
|
|
176
178
|
data-theme={type === "header" && !locked ? "brand" : undefined}
|
|
177
179
|
>
|
|
@@ -260,7 +262,7 @@ export function DataCellHeader<T>({
|
|
|
260
262
|
const style: CSSProperties = {
|
|
261
263
|
position: "relative",
|
|
262
264
|
whiteSpace: "nowrap",
|
|
263
|
-
|
|
265
|
+
minWidth: header.column.getSize(),
|
|
264
266
|
"--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
|
|
265
267
|
"--color-icon-on-action-primary-normal":
|
|
266
268
|
"var(--color-text-brand-primary-normal)",
|
|
@@ -277,6 +279,7 @@ export function DataCellHeader<T>({
|
|
|
277
279
|
type="header"
|
|
278
280
|
component="header"
|
|
279
281
|
style={style}
|
|
282
|
+
minWidth={`${header.column.getSize()}px`}
|
|
280
283
|
onClick={header.column.getToggleSortingHandler()}
|
|
281
284
|
onRightClick={() => setShowMenu(!showMenu)}
|
|
282
285
|
{...props}
|
|
@@ -470,7 +473,6 @@ export function DraggableCellHeader<T extends Record<string, any>>({
|
|
|
470
473
|
transition: "width transform 0.2s ease-in-out",
|
|
471
474
|
whiteSpace: "nowrap",
|
|
472
475
|
zIndex: isDragging ? 1 : 0,
|
|
473
|
-
width: header.column.columnDef.meta?.headerWidth ?? header.column.getSize(),
|
|
474
476
|
"--color-text-primary-normal": "var(--color-action-000)",
|
|
475
477
|
"--color-icon-on-action-primary-normal": "var(--color-action-000)",
|
|
476
478
|
userSelect: "none",
|
|
@@ -510,20 +512,12 @@ export function DragAlongCell<T extends RowData, TValue>({
|
|
|
510
512
|
position: "relative",
|
|
511
513
|
transform: CSS.Translate.toString(transform),
|
|
512
514
|
transition: "width transform 0.2s ease-in-out",
|
|
513
|
-
|
|
515
|
+
minWidth: cell.column.getSize(),
|
|
514
516
|
zIndex: isDragging ? 1 : 0,
|
|
515
517
|
};
|
|
516
518
|
|
|
517
519
|
return (
|
|
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
|
-
>
|
|
520
|
+
<DataGridCell style={style} ref={setNodeRef} {...props}>
|
|
527
521
|
{children}
|
|
528
522
|
</DataGridCell>
|
|
529
523
|
);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Label
|
|
3
|
+
} from "./chunk-CJVTFYI4.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-CJVTFYI4.js";
|
|
9
9
|
import {
|
|
10
10
|
Icon
|
|
11
11
|
} from "./chunk-UAPWR2KE.js";
|