@etsoo/materialui 1.6.82 → 1.6.84
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/lib/cjs/ResponsibleContainer.d.ts +5 -1
- package/lib/cjs/ResponsibleContainer.js +8 -4
- package/lib/cjs/pages/ResponsivePage.d.ts +5 -1
- package/lib/mjs/ResponsibleContainer.d.ts +5 -1
- package/lib/mjs/ResponsibleContainer.js +8 -4
- package/lib/mjs/pages/ResponsivePage.d.ts +5 -1
- package/package.json +21 -21
- package/src/ResponsibleContainer.tsx +24 -2
- package/src/pages/ResponsivePage.tsx +6 -1
|
@@ -6,7 +6,7 @@ import { SxProps, Theme } from "@mui/material/styles";
|
|
|
6
6
|
/**
|
|
7
7
|
* ResponsibleContainer props
|
|
8
8
|
*/
|
|
9
|
-
export type ResponsibleContainerProps<T extends object, F> = Omit<DataGridExProps<T>, "height" | "loadData" | "mRef" | "onInitLoad" | "onUpdateRows" | "rowHeight"> & {
|
|
9
|
+
export type ResponsibleContainerProps<T extends object, F> = Omit<DataGridExProps<T>, "height" | "loadData" | "mRef" | "onInitLoad" | "onUpdateRows" | "rowHeight" | "rowKey"> & {
|
|
10
10
|
/**
|
|
11
11
|
* Height will be deducted
|
|
12
12
|
* @param height Current calcuated height
|
|
@@ -73,6 +73,10 @@ export type ResponsibleContainerProps<T extends object, F> = Omit<DataGridExProp
|
|
|
73
73
|
* @param isGrid Is displaying as DataGrid
|
|
74
74
|
*/
|
|
75
75
|
rowHeight?: number | [number, number] | (<B extends boolean>(isGrid: B) => B extends true ? DataGridExProps<T>["rowHeight"] : ScrollerListExProps<T>["rowHeight"]);
|
|
76
|
+
/**
|
|
77
|
+
* Row key
|
|
78
|
+
*/
|
|
79
|
+
rowKey?: (index: number, data: T) => React.Key;
|
|
76
80
|
/**
|
|
77
81
|
* Size ready to read miliseconds span
|
|
78
82
|
*/
|
|
@@ -127,12 +127,16 @@ function ResponsibleContainer(props) {
|
|
|
127
127
|
heightLocal = adjustFabHeight(heightLocal, showDataGrid);
|
|
128
128
|
if (showDataGrid) {
|
|
129
129
|
// Remove useless props
|
|
130
|
-
const { itemRenderer, ...gridProps } = rest;
|
|
131
|
-
return ((0, jsx_runtime_1.jsx)(Box_1.default, { className: "DataGridBox", children: (0, jsx_runtime_1.jsx)(DataGridEx_1.DataGridEx, { autoLoad: !hasFields, cacheKey: cacheKey, cacheMinutes: cacheMinutes, height: heightLocal, width: rect.width, loadData: localLoadData, mRef: mRefs, onDoubleClick: (_, data) => quickAction && quickAction(data), columns: columns, rowHeight: getRowHeight(true),
|
|
130
|
+
const { itemRenderer, rowKey, ...gridProps } = rest;
|
|
131
|
+
return ((0, jsx_runtime_1.jsx)(Box_1.default, { className: "DataGridBox", children: (0, jsx_runtime_1.jsx)(DataGridEx_1.DataGridEx, { autoLoad: !hasFields, cacheKey: cacheKey, cacheMinutes: cacheMinutes, height: heightLocal, width: rect.width, loadData: localLoadData, mRef: mRefs, onDoubleClick: (_, data) => quickAction && quickAction(data), columns: columns, rowHeight: getRowHeight(true), rowKey: rowKey == null
|
|
132
|
+
? undefined
|
|
133
|
+
: ({ rowIndex, data }) => rowKey(rowIndex, data.rows[rowIndex]), ...gridProps }) }));
|
|
132
134
|
}
|
|
133
135
|
// Remove useless props
|
|
134
|
-
const { checkable, borderRowsCount, bottomHeight, footerItemRenderer, headerHeight, hideFooter, hoverColor, selectable, onCellsRendered, ...listProps } = rest;
|
|
135
|
-
return ((0, jsx_runtime_1.jsx)(Box_1.default, { className: "ListBox", sx: { height: heightLocal }, children: (0, jsx_runtime_1.jsx)(ScrollerListEx_1.ScrollerListEx, { autoLoad: !hasFields, cacheKey: cacheKey, cacheMinutes: cacheMinutes, height: heightLocal, loadData: localLoadData, mRef: mRefs, onClick: (event, data) => quickAction && react_2.ReactUtils.isSafeClick(event) && quickAction(data),
|
|
136
|
+
const { checkable, borderRowsCount, bottomHeight, footerItemRenderer, headerHeight, hideFooter, hoverColor, selectable, onCellsRendered, rowKey, ...listProps } = rest;
|
|
137
|
+
return ((0, jsx_runtime_1.jsx)(Box_1.default, { className: "ListBox", sx: { height: heightLocal }, children: (0, jsx_runtime_1.jsx)(ScrollerListEx_1.ScrollerListEx, { autoLoad: !hasFields, cacheKey: cacheKey, cacheMinutes: cacheMinutes, height: heightLocal, loadData: localLoadData, mRef: mRefs, onClick: (event, data) => quickAction && react_2.ReactUtils.isSafeClick(event) && quickAction(data), rowKey: rowKey == null
|
|
138
|
+
? undefined
|
|
139
|
+
: (index, data) => rowKey(index, data.items[index]), rowHeight: getRowHeight(false), ...listProps }) }));
|
|
136
140
|
})();
|
|
137
141
|
const searchBar = react_1.default.useMemo(() => {
|
|
138
142
|
if (!hasFields || rect?.width == null || rect.width < 20)
|
|
@@ -7,7 +7,7 @@ import type { OperationMessageHandlerAll } from "../messages/OperationMessageHan
|
|
|
7
7
|
/**
|
|
8
8
|
* Response page props
|
|
9
9
|
*/
|
|
10
|
-
export type ResponsePageProps<T extends object, F> = Omit<DataGridPageProps<T, F>, "mRef" | "rowHeight"> & {
|
|
10
|
+
export type ResponsePageProps<T extends object, F> = Omit<DataGridPageProps<T, F>, "mRef" | "rowHeight" | "rowKey"> & {
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
13
13
|
* @param height Current height
|
|
@@ -43,6 +43,10 @@ export type ResponsePageProps<T extends object, F> = Omit<DataGridPageProps<T, F
|
|
|
43
43
|
* Row height
|
|
44
44
|
*/
|
|
45
45
|
rowHeight?: ResponsibleContainerProps<T, F>["rowHeight"];
|
|
46
|
+
/**
|
|
47
|
+
* Row key
|
|
48
|
+
*/
|
|
49
|
+
rowKey?: (index: number, data: T) => React.Key;
|
|
46
50
|
/**
|
|
47
51
|
* Header
|
|
48
52
|
*/
|
|
@@ -6,7 +6,7 @@ import { SxProps, Theme } from "@mui/material/styles";
|
|
|
6
6
|
/**
|
|
7
7
|
* ResponsibleContainer props
|
|
8
8
|
*/
|
|
9
|
-
export type ResponsibleContainerProps<T extends object, F> = Omit<DataGridExProps<T>, "height" | "loadData" | "mRef" | "onInitLoad" | "onUpdateRows" | "rowHeight"> & {
|
|
9
|
+
export type ResponsibleContainerProps<T extends object, F> = Omit<DataGridExProps<T>, "height" | "loadData" | "mRef" | "onInitLoad" | "onUpdateRows" | "rowHeight" | "rowKey"> & {
|
|
10
10
|
/**
|
|
11
11
|
* Height will be deducted
|
|
12
12
|
* @param height Current calcuated height
|
|
@@ -73,6 +73,10 @@ export type ResponsibleContainerProps<T extends object, F> = Omit<DataGridExProp
|
|
|
73
73
|
* @param isGrid Is displaying as DataGrid
|
|
74
74
|
*/
|
|
75
75
|
rowHeight?: number | [number, number] | (<B extends boolean>(isGrid: B) => B extends true ? DataGridExProps<T>["rowHeight"] : ScrollerListExProps<T>["rowHeight"]);
|
|
76
|
+
/**
|
|
77
|
+
* Row key
|
|
78
|
+
*/
|
|
79
|
+
rowKey?: (index: number, data: T) => React.Key;
|
|
76
80
|
/**
|
|
77
81
|
* Size ready to read miliseconds span
|
|
78
82
|
*/
|
|
@@ -121,12 +121,16 @@ export function ResponsibleContainer(props) {
|
|
|
121
121
|
heightLocal = adjustFabHeight(heightLocal, showDataGrid);
|
|
122
122
|
if (showDataGrid) {
|
|
123
123
|
// Remove useless props
|
|
124
|
-
const { itemRenderer, ...gridProps } = rest;
|
|
125
|
-
return (_jsx(Box, { className: "DataGridBox", children: _jsx(DataGridEx, { autoLoad: !hasFields, cacheKey: cacheKey, cacheMinutes: cacheMinutes, height: heightLocal, width: rect.width, loadData: localLoadData, mRef: mRefs, onDoubleClick: (_, data) => quickAction && quickAction(data), columns: columns, rowHeight: getRowHeight(true),
|
|
124
|
+
const { itemRenderer, rowKey, ...gridProps } = rest;
|
|
125
|
+
return (_jsx(Box, { className: "DataGridBox", children: _jsx(DataGridEx, { autoLoad: !hasFields, cacheKey: cacheKey, cacheMinutes: cacheMinutes, height: heightLocal, width: rect.width, loadData: localLoadData, mRef: mRefs, onDoubleClick: (_, data) => quickAction && quickAction(data), columns: columns, rowHeight: getRowHeight(true), rowKey: rowKey == null
|
|
126
|
+
? undefined
|
|
127
|
+
: ({ rowIndex, data }) => rowKey(rowIndex, data.rows[rowIndex]), ...gridProps }) }));
|
|
126
128
|
}
|
|
127
129
|
// Remove useless props
|
|
128
|
-
const { checkable, borderRowsCount, bottomHeight, footerItemRenderer, headerHeight, hideFooter, hoverColor, selectable, onCellsRendered, ...listProps } = rest;
|
|
129
|
-
return (_jsx(Box, { className: "ListBox", sx: { height: heightLocal }, children: _jsx(ScrollerListEx, { autoLoad: !hasFields, cacheKey: cacheKey, cacheMinutes: cacheMinutes, height: heightLocal, loadData: localLoadData, mRef: mRefs, onClick: (event, data) => quickAction && ReactUtils.isSafeClick(event) && quickAction(data),
|
|
130
|
+
const { checkable, borderRowsCount, bottomHeight, footerItemRenderer, headerHeight, hideFooter, hoverColor, selectable, onCellsRendered, rowKey, ...listProps } = rest;
|
|
131
|
+
return (_jsx(Box, { className: "ListBox", sx: { height: heightLocal }, children: _jsx(ScrollerListEx, { autoLoad: !hasFields, cacheKey: cacheKey, cacheMinutes: cacheMinutes, height: heightLocal, loadData: localLoadData, mRef: mRefs, onClick: (event, data) => quickAction && ReactUtils.isSafeClick(event) && quickAction(data), rowKey: rowKey == null
|
|
132
|
+
? undefined
|
|
133
|
+
: (index, data) => rowKey(index, data.items[index]), rowHeight: getRowHeight(false), ...listProps }) }));
|
|
130
134
|
})();
|
|
131
135
|
const searchBar = React.useMemo(() => {
|
|
132
136
|
if (!hasFields || rect?.width == null || rect.width < 20)
|
|
@@ -7,7 +7,7 @@ import type { OperationMessageHandlerAll } from "../messages/OperationMessageHan
|
|
|
7
7
|
/**
|
|
8
8
|
* Response page props
|
|
9
9
|
*/
|
|
10
|
-
export type ResponsePageProps<T extends object, F> = Omit<DataGridPageProps<T, F>, "mRef" | "rowHeight"> & {
|
|
10
|
+
export type ResponsePageProps<T extends object, F> = Omit<DataGridPageProps<T, F>, "mRef" | "rowHeight" | "rowKey"> & {
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
13
13
|
* @param height Current height
|
|
@@ -43,6 +43,10 @@ export type ResponsePageProps<T extends object, F> = Omit<DataGridPageProps<T, F
|
|
|
43
43
|
* Row height
|
|
44
44
|
*/
|
|
45
45
|
rowHeight?: ResponsibleContainerProps<T, F>["rowHeight"];
|
|
46
|
+
/**
|
|
47
|
+
* Row key
|
|
48
|
+
*/
|
|
49
|
+
rowKey?: (index: number, data: T) => React.Key;
|
|
46
50
|
/**
|
|
47
51
|
* Header
|
|
48
52
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.84",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -36,30 +36,30 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/ETSOO/ReactMU#readme",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@base-ui/react": "^1.
|
|
39
|
+
"@base-ui/react": "^1.7.0",
|
|
40
40
|
"@dnd-kit/react": "^0.5.0",
|
|
41
41
|
"@emotion/react": "^11.14.0",
|
|
42
42
|
"@emotion/styled": "^11.14.1",
|
|
43
|
-
"@etsoo/appscript": "^1.6.
|
|
44
|
-
"@etsoo/notificationbase": "^1.1.
|
|
45
|
-
"@etsoo/react": "^1.
|
|
46
|
-
"@etsoo/shared": "^1.2.
|
|
47
|
-
"@mui/icons-material": "^9.
|
|
48
|
-
"@mui/material": "^9.
|
|
49
|
-
"@mui/x-data-grid": "^9.
|
|
43
|
+
"@etsoo/appscript": "^1.6.74",
|
|
44
|
+
"@etsoo/notificationbase": "^1.1.75",
|
|
45
|
+
"@etsoo/react": "^1.9.0",
|
|
46
|
+
"@etsoo/shared": "^1.2.91",
|
|
47
|
+
"@mui/icons-material": "^9.3.1",
|
|
48
|
+
"@mui/material": "^9.3.1",
|
|
49
|
+
"@mui/x-data-grid": "^9.12.0",
|
|
50
50
|
"chart.js": "^4.5.1",
|
|
51
51
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
52
|
-
"dompurify": "^3.4.
|
|
52
|
+
"dompurify": "^3.4.14",
|
|
53
53
|
"eventemitter3": "^5.0.4",
|
|
54
|
-
"pica": "^10.0.
|
|
54
|
+
"pica": "^10.0.3",
|
|
55
55
|
"pulltorefreshjs": "^0.1.22",
|
|
56
|
-
"react": "^19.2.
|
|
56
|
+
"react": "^19.2.8",
|
|
57
57
|
"react-avatar-editor": "^15.1.0",
|
|
58
58
|
"react-chartjs-2": "^5.3.1",
|
|
59
|
-
"react-dom": "^19.2.
|
|
60
|
-
"react-draggable": "^4.7.
|
|
59
|
+
"react-dom": "^19.2.8",
|
|
60
|
+
"react-draggable": "^4.7.1",
|
|
61
61
|
"react-imask": "7.6.1",
|
|
62
|
-
"signature_pad": "^5.1.
|
|
62
|
+
"signature_pad": "^5.1.4"
|
|
63
63
|
},
|
|
64
64
|
"overrides": {
|
|
65
65
|
"react": "$react",
|
|
@@ -72,18 +72,18 @@
|
|
|
72
72
|
"@babel/preset-react": "^8.0.1",
|
|
73
73
|
"@babel/preset-typescript": "^8.0.1",
|
|
74
74
|
"@babel/runtime-corejs3": "^8.0.0",
|
|
75
|
-
"@testing-library/jest-dom": "^
|
|
75
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
76
76
|
"@testing-library/react": "^16.3.2",
|
|
77
77
|
"@types/pica": "^9.0.5",
|
|
78
78
|
"@types/pulltorefreshjs": "^0.1.7",
|
|
79
|
-
"@types/react": "^19.2.
|
|
79
|
+
"@types/react": "^19.2.18",
|
|
80
80
|
"@types/react-avatar-editor": "^13.0.4",
|
|
81
|
-
"@types/react-dom": "^19.2.
|
|
81
|
+
"@types/react-dom": "^19.2.5",
|
|
82
82
|
"@types/react-input-mask": "^3.0.6",
|
|
83
|
-
"@vitejs/plugin-react": "^6.0
|
|
84
|
-
"jsdom": "^
|
|
83
|
+
"@vitejs/plugin-react": "^6.1.0",
|
|
84
|
+
"jsdom": "^30.0.1",
|
|
85
85
|
"typescript": "^7.0.2",
|
|
86
|
-
"vitest": "^4.1.
|
|
86
|
+
"vitest": "^4.1.11"
|
|
87
87
|
},
|
|
88
88
|
"allowScripts": {
|
|
89
89
|
"core-js-pure@3.49.0": true
|
|
@@ -27,7 +27,13 @@ import Stack from "@mui/material/Stack";
|
|
|
27
27
|
*/
|
|
28
28
|
export type ResponsibleContainerProps<T extends object, F> = Omit<
|
|
29
29
|
DataGridExProps<T>,
|
|
30
|
-
|
|
30
|
+
| "height"
|
|
31
|
+
| "loadData"
|
|
32
|
+
| "mRef"
|
|
33
|
+
| "onInitLoad"
|
|
34
|
+
| "onUpdateRows"
|
|
35
|
+
| "rowHeight"
|
|
36
|
+
| "rowKey"
|
|
31
37
|
> & {
|
|
32
38
|
/**
|
|
33
39
|
* Height will be deducted
|
|
@@ -126,6 +132,11 @@ export type ResponsibleContainerProps<T extends object, F> = Omit<
|
|
|
126
132
|
? DataGridExProps<T>["rowHeight"]
|
|
127
133
|
: ScrollerListExProps<T>["rowHeight"]);
|
|
128
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Row key
|
|
137
|
+
*/
|
|
138
|
+
rowKey?: (index: number, data: T) => React.Key;
|
|
139
|
+
|
|
129
140
|
/**
|
|
130
141
|
* Size ready to read miliseconds span
|
|
131
142
|
*/
|
|
@@ -320,7 +331,7 @@ export function ResponsibleContainer<T extends object, F>(
|
|
|
320
331
|
|
|
321
332
|
if (showDataGrid) {
|
|
322
333
|
// Remove useless props
|
|
323
|
-
const { itemRenderer, ...gridProps } = rest;
|
|
334
|
+
const { itemRenderer, rowKey, ...gridProps } = rest;
|
|
324
335
|
|
|
325
336
|
return (
|
|
326
337
|
<Box className="DataGridBox">
|
|
@@ -335,6 +346,11 @@ export function ResponsibleContainer<T extends object, F>(
|
|
|
335
346
|
onDoubleClick={(_, data) => quickAction && quickAction(data)}
|
|
336
347
|
columns={columns}
|
|
337
348
|
rowHeight={getRowHeight(true)}
|
|
349
|
+
rowKey={
|
|
350
|
+
rowKey == null
|
|
351
|
+
? undefined
|
|
352
|
+
: ({ rowIndex, data }) => rowKey(rowIndex, data.rows[rowIndex])
|
|
353
|
+
}
|
|
338
354
|
{...gridProps}
|
|
339
355
|
/>
|
|
340
356
|
</Box>
|
|
@@ -352,6 +368,7 @@ export function ResponsibleContainer<T extends object, F>(
|
|
|
352
368
|
hoverColor,
|
|
353
369
|
selectable,
|
|
354
370
|
onCellsRendered,
|
|
371
|
+
rowKey,
|
|
355
372
|
...listProps
|
|
356
373
|
} = rest;
|
|
357
374
|
|
|
@@ -367,6 +384,11 @@ export function ResponsibleContainer<T extends object, F>(
|
|
|
367
384
|
onClick={(event, data) =>
|
|
368
385
|
quickAction && ReactUtils.isSafeClick(event) && quickAction(data)
|
|
369
386
|
}
|
|
387
|
+
rowKey={
|
|
388
|
+
rowKey == null
|
|
389
|
+
? undefined
|
|
390
|
+
: (index, data) => rowKey(index, data.items[index])
|
|
391
|
+
}
|
|
370
392
|
rowHeight={getRowHeight(false)}
|
|
371
393
|
{...listProps}
|
|
372
394
|
/>
|
|
@@ -16,7 +16,7 @@ import type { OperationMessageHandlerAll } from "../messages/OperationMessageHan
|
|
|
16
16
|
*/
|
|
17
17
|
export type ResponsePageProps<T extends object, F> = Omit<
|
|
18
18
|
DataGridPageProps<T, F>,
|
|
19
|
-
"mRef" | "rowHeight"
|
|
19
|
+
"mRef" | "rowHeight" | "rowKey"
|
|
20
20
|
> & {
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
@@ -61,6 +61,11 @@ export type ResponsePageProps<T extends object, F> = Omit<
|
|
|
61
61
|
*/
|
|
62
62
|
rowHeight?: ResponsibleContainerProps<T, F>["rowHeight"];
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Row key
|
|
66
|
+
*/
|
|
67
|
+
rowKey?: (index: number, data: T) => React.Key;
|
|
68
|
+
|
|
64
69
|
/**
|
|
65
70
|
* Header
|
|
66
71
|
*/
|