@dmsi/wedgekit-react 0.0.413 → 0.0.415
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-7ULLUUVJ.js +61 -0
- package/dist/components/CalendarRange.cjs +39 -35
- package/dist/components/CalendarRange.css +9 -0
- package/dist/components/CalendarRange.js +6 -5
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +6 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +9 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +6 -5
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +13 -9
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +9 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +6 -5
- package/dist/components/DataGrid/PinnedColumns.cjs +27 -23
- package/dist/components/DataGrid/PinnedColumns.css +9 -0
- package/dist/components/DataGrid/PinnedColumns.js +6 -5
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +9 -5
- package/dist/components/DataGrid/TableBody/LoadingCell.css +9 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.js +6 -5
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +14 -10
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +9 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +6 -5
- package/dist/components/DataGrid/TableBody/index.cjs +29 -25
- package/dist/components/DataGrid/TableBody/index.css +9 -0
- package/dist/components/DataGrid/TableBody/index.js +6 -5
- package/dist/components/DataGrid/index.cjs +98 -94
- package/dist/components/DataGrid/index.css +9 -0
- package/dist/components/DataGrid/index.js +6 -5
- package/dist/components/DataGrid/utils.cjs +9 -5
- package/dist/components/DataGrid/utils.css +9 -0
- package/dist/components/DataGrid/utils.js +6 -5
- package/dist/components/DateInput.cjs +45 -41
- package/dist/components/DateInput.css +9 -0
- package/dist/components/DateInput.js +6 -5
- package/dist/components/DateRangeInput.cjs +45 -41
- package/dist/components/DateRangeInput.css +9 -0
- package/dist/components/DateRangeInput.js +6 -5
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +12 -8
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +9 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +6 -5
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +20 -16
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +9 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +6 -5
- package/dist/components/MobileDataGrid/index.cjs +103 -99
- package/dist/components/MobileDataGrid/index.css +9 -0
- package/dist/components/MobileDataGrid/index.js +6 -5
- package/dist/components/ProductImagePreview/index.js +2 -2
- package/dist/components/SimpleTable.cjs +485 -0
- package/dist/components/SimpleTable.js +10 -0
- package/dist/components/index.cjs +53 -0
- package/dist/components/index.css +9 -0
- package/dist/components/index.js +9 -5
- package/dist/index.css +9 -0
- package/package.json +1 -1
- package/src/components/SimpleTable.tsx +77 -0
- package/src/components/index.ts +1 -0
- package/dist/{chunk-OBY5EH47.js → chunk-BK7SPR6Y.js} +6 -6
- package/dist/{chunk-LZGYABCX.js → chunk-ZHZIIVJN.js} +3 -3
package/dist/components/index.js
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataGrid,
|
|
3
3
|
MobileDataGrid
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-M7INAUAJ.js";
|
|
4
|
+
} from "../chunk-BK7SPR6Y.js";
|
|
6
5
|
import "../chunk-6I5LZ2ZC.js";
|
|
6
|
+
import "../chunk-M7INAUAJ.js";
|
|
7
7
|
import "../chunk-44TDIHUP.js";
|
|
8
8
|
import {
|
|
9
9
|
ProductImagePreview
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-ZHZIIVJN.js";
|
|
11
|
+
import "../chunk-2IKT6IHB.js";
|
|
11
12
|
import "../chunk-G5DEC7H3.js";
|
|
12
13
|
import "../chunk-3X3Y4TMS.js";
|
|
13
14
|
import "../chunk-BQNPOGD5.js";
|
|
14
15
|
import "../chunk-MBZ55T2D.js";
|
|
15
|
-
import "../chunk-2IKT6IHB.js";
|
|
16
16
|
import "../chunk-AA6GE3TH.js";
|
|
17
17
|
import "../chunk-KZZKQLKF.js";
|
|
18
18
|
import "../chunk-5IFPG6TS.js";
|
|
19
19
|
import "../chunk-AJ5M6MVX.js";
|
|
20
20
|
import "../chunk-M6TSTDNZ.js";
|
|
21
|
+
import "../chunk-EWGHVZL5.js";
|
|
21
22
|
import {
|
|
22
23
|
Tooltip
|
|
23
24
|
} from "../chunk-QQ5G773N.js";
|
|
24
25
|
import "../chunk-AT4AWD6B.js";
|
|
25
|
-
import "../chunk-EWGHVZL5.js";
|
|
26
26
|
import {
|
|
27
27
|
Select
|
|
28
28
|
} from "../chunk-J5V2JRIK.js";
|
|
29
|
+
import {
|
|
30
|
+
SimpleTable
|
|
31
|
+
} from "../chunk-7ULLUUVJ.js";
|
|
29
32
|
import "../chunk-D6YCMQPO.js";
|
|
30
33
|
import "../chunk-4RJKB7LC.js";
|
|
31
34
|
import "../chunk-XM7IQHBU.js";
|
|
@@ -111,6 +114,7 @@ export {
|
|
|
111
114
|
ProductImagePreview,
|
|
112
115
|
Search,
|
|
113
116
|
Select,
|
|
117
|
+
SimpleTable,
|
|
114
118
|
Subheader,
|
|
115
119
|
Tooltip
|
|
116
120
|
};
|
package/dist/index.css
CHANGED
|
@@ -819,6 +819,9 @@
|
|
|
819
819
|
.\!w-20 {
|
|
820
820
|
width: calc(var(--spacing) * 20) !important;
|
|
821
821
|
}
|
|
822
|
+
.w-2\/3 {
|
|
823
|
+
width: calc(2/3 * 100%);
|
|
824
|
+
}
|
|
822
825
|
.w-3 {
|
|
823
826
|
width: calc(var(--spacing) * 3);
|
|
824
827
|
}
|
|
@@ -939,6 +942,9 @@
|
|
|
939
942
|
.grow-0 {
|
|
940
943
|
flex-grow: 0;
|
|
941
944
|
}
|
|
945
|
+
.border-collapse {
|
|
946
|
+
border-collapse: collapse;
|
|
947
|
+
}
|
|
942
948
|
.translate-x-0 {
|
|
943
949
|
--tw-translate-x: calc(var(--spacing) * 0);
|
|
944
950
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
@@ -2013,6 +2019,9 @@
|
|
|
2013
2019
|
.text-right {
|
|
2014
2020
|
text-align: right;
|
|
2015
2021
|
}
|
|
2022
|
+
.align-middle {
|
|
2023
|
+
vertical-align: middle;
|
|
2024
|
+
}
|
|
2016
2025
|
.font-sans {
|
|
2017
2026
|
font-family: var(--font-sans);
|
|
2018
2027
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ColumnDef } from "@tanstack/react-table";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { Subheader } from "./Subheader";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { Stack } from "./Stack";
|
|
6
|
+
|
|
7
|
+
type SimpleTableProps<T> = {
|
|
8
|
+
columns: ColumnDef<T>[];
|
|
9
|
+
data: T[];
|
|
10
|
+
/** Optional additional rows appended after the main data (e.g. totals) */
|
|
11
|
+
additionalRows?: T[] | null;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function SimpleTable<T extends Record<string, unknown>>({
|
|
15
|
+
columns,
|
|
16
|
+
data,
|
|
17
|
+
additionalRows,
|
|
18
|
+
}: SimpleTableProps<T>) {
|
|
19
|
+
const allRows =
|
|
20
|
+
additionalRows && additionalRows.length > 0
|
|
21
|
+
? [...data, ...additionalRows]
|
|
22
|
+
: data;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Stack elevation={4} rounded overflowX="hidden" overflowY="hidden">
|
|
26
|
+
<table className="w-full border-collapse text-left text-sm border overflow-hidden rounded border-border-primary-normal">
|
|
27
|
+
<thead>
|
|
28
|
+
<tr className="bg-background-primary-normal divide-x divide-border-primary-normal">
|
|
29
|
+
{columns.map((column, index) => (
|
|
30
|
+
<th
|
|
31
|
+
key={index}
|
|
32
|
+
scope="col"
|
|
33
|
+
className={clsx(
|
|
34
|
+
"p-mobile-layout-padding desktop:p-desktop-layout-padding font-semibold text-text-primary-normal",
|
|
35
|
+
column.meta?.headerWidth ? column.meta.headerWidth : "w-2/3",
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
<Subheader>{column.header?.toString()}</Subheader>
|
|
39
|
+
</th>
|
|
40
|
+
))}
|
|
41
|
+
</tr>
|
|
42
|
+
</thead>
|
|
43
|
+
<tbody>
|
|
44
|
+
{allRows.map((row, rowIndex) => (
|
|
45
|
+
<tr
|
|
46
|
+
key={rowIndex}
|
|
47
|
+
className="border-t border-border-primary-normal divide-x divide-border-primary-normal"
|
|
48
|
+
>
|
|
49
|
+
{columns.map((column, colIndex) => {
|
|
50
|
+
const rawValue = column.id
|
|
51
|
+
? (row as Record<string, unknown>)[column.id]
|
|
52
|
+
: null;
|
|
53
|
+
const cellValue: ReactNode = (rawValue as ReactNode) ?? null;
|
|
54
|
+
return (
|
|
55
|
+
<td
|
|
56
|
+
key={colIndex}
|
|
57
|
+
className={clsx(
|
|
58
|
+
"p-mobile-layout-padding desktop:p-desktop-layout-padding align-middle text-text-primary-normal",
|
|
59
|
+
column.meta?.headerWidth,
|
|
60
|
+
)}
|
|
61
|
+
>
|
|
62
|
+
{cellValue !== null && cellValue !== undefined
|
|
63
|
+
? typeof cellValue === "string" ||
|
|
64
|
+
typeof cellValue === "number"
|
|
65
|
+
? cellValue.toString()
|
|
66
|
+
: cellValue
|
|
67
|
+
: ""}
|
|
68
|
+
</td>
|
|
69
|
+
);
|
|
70
|
+
})}
|
|
71
|
+
</tr>
|
|
72
|
+
))}
|
|
73
|
+
</tbody>
|
|
74
|
+
</table>
|
|
75
|
+
</Stack>
|
|
76
|
+
);
|
|
77
|
+
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GridContextProvider
|
|
3
|
-
} from "./chunk-M7INAUAJ.js";
|
|
4
1
|
import {
|
|
5
2
|
RowDetailModalProvider
|
|
6
3
|
} from "./chunk-6I5LZ2ZC.js";
|
|
4
|
+
import {
|
|
5
|
+
GridContextProvider
|
|
6
|
+
} from "./chunk-M7INAUAJ.js";
|
|
7
7
|
import {
|
|
8
8
|
ColumnList
|
|
9
9
|
} from "./chunk-AA6GE3TH.js";
|
|
10
10
|
import {
|
|
11
11
|
useGridContext
|
|
12
12
|
} from "./chunk-5IFPG6TS.js";
|
|
13
|
-
import {
|
|
14
|
-
Tooltip
|
|
15
|
-
} from "./chunk-QQ5G773N.js";
|
|
16
13
|
import {
|
|
17
14
|
Theme
|
|
18
15
|
} from "./chunk-EWGHVZL5.js";
|
|
16
|
+
import {
|
|
17
|
+
Tooltip
|
|
18
|
+
} from "./chunk-QQ5G773N.js";
|
|
19
19
|
import {
|
|
20
20
|
Select
|
|
21
21
|
} from "./chunk-J5V2JRIK.js";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MobileImageCarousel
|
|
3
|
+
} from "./chunk-2IKT6IHB.js";
|
|
1
4
|
import {
|
|
2
5
|
ProductPrimaryImage
|
|
3
6
|
} from "./chunk-G5DEC7H3.js";
|
|
@@ -10,9 +13,6 @@ import {
|
|
|
10
13
|
import {
|
|
11
14
|
CarouselPagination
|
|
12
15
|
} from "./chunk-MBZ55T2D.js";
|
|
13
|
-
import {
|
|
14
|
-
MobileImageCarousel
|
|
15
|
-
} from "./chunk-2IKT6IHB.js";
|
|
16
16
|
import {
|
|
17
17
|
Grid
|
|
18
18
|
} from "./chunk-ER6RCOH3.js";
|