@etsoo/materialui 1.3.42 → 1.3.43
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/__tests__/tsconfig.json +17 -17
- package/lib/AddresSelector.js +1 -2
- package/lib/AuditDisplay.js +2 -3
- package/lib/BridgeCloseButton.js +1 -2
- package/lib/ComboBox.js +5 -5
- package/lib/ComboBoxMultiple.js +7 -8
- package/lib/ComboBoxPro.js +1 -2
- package/lib/CultureDataTable.js +2 -2
- package/lib/DataGridEx.d.ts +2 -3
- package/lib/DataGridEx.js +12 -14
- package/lib/DataGridRenderers.js +6 -6
- package/lib/DataSteps.js +1 -2
- package/lib/DataTable.js +1 -2
- package/lib/DialogButton.js +2 -3
- package/lib/DnDList.js +1 -1
- package/lib/EmailInput.js +1 -2
- package/lib/FileUploadButton.js +1 -1
- package/lib/GridDataFormat.js +5 -5
- package/lib/GridUtils.js +1 -2
- package/lib/HiSelector.js +1 -1
- package/lib/HiSelectorTL.js +1 -1
- package/lib/InputField.js +4 -5
- package/lib/InputTipField.js +1 -1
- package/lib/ItemList.js +2 -3
- package/lib/ListChooser.js +4 -5
- package/lib/LoadingButton.js +1 -2
- package/lib/MaskInput.js +2 -3
- package/lib/NotifierMU.js +14 -19
- package/lib/OptionBool.js +1 -2
- package/lib/OptionGroup.js +3 -4
- package/lib/OptionGroupFlag.js +1 -1
- package/lib/QuickList.js +2 -2
- package/lib/ResponsibleContainer.d.ts +3 -3
- package/lib/ResponsibleContainer.js +3 -3
- package/lib/ScrollerListEx.d.ts +6 -7
- package/lib/ScrollerListEx.js +30 -36
- package/lib/SearchField.js +3 -4
- package/lib/SelectBool.js +1 -2
- package/lib/SelectEx.js +6 -8
- package/lib/ShowDataComparison.js +3 -4
- package/lib/Switch.js +1 -2
- package/lib/SwitchAnt.js +6 -7
- package/lib/TableEx.js +5 -7
- package/lib/TagList.js +3 -5
- package/lib/TagListPro.js +3 -5
- package/lib/TextFieldEx.js +2 -2
- package/lib/Tiplist.js +6 -8
- package/lib/TiplistPro.js +9 -10
- package/lib/TooltipClick.js +2 -2
- package/lib/TwoFieldInput.js +1 -1
- package/lib/UserAvatar.js +1 -2
- package/lib/UserAvatarEditor.js +4 -6
- package/lib/app/CommonApp.js +1 -1
- package/lib/app/ReactApp.js +4 -6
- package/lib/app/ServiceApp.js +5 -7
- package/lib/pages/DataGridPage.d.ts +2 -2
- package/lib/pages/DataGridPage.js +2 -3
- package/lib/pages/DataGridPageProps.d.ts +2 -2
- package/lib/pages/FixedListPage.d.ts +2 -2
- package/lib/pages/FixedListPage.js +2 -3
- package/lib/pages/LeftDrawer.js +2 -3
- package/lib/pages/ListPage.d.ts +2 -2
- package/lib/pages/ListPage.js +2 -3
- package/lib/pages/ListPageProps.d.ts +1 -1
- package/lib/pages/ResponsivePage.d.ts +2 -2
- package/lib/pages/ResponsivePage.js +1 -2
- package/lib/pages/ResponsivePageProps.d.ts +2 -2
- package/lib/pages/TablePage.js +3 -5
- package/lib/pages/UserMenu.js +1 -2
- package/lib/pages/ViewPage.js +6 -7
- package/package.json +14 -12
- package/src/DataGridEx.tsx +6 -12
- package/src/ResponsibleContainer.tsx +7 -9
- package/src/ScrollerListEx.tsx +301 -311
- package/src/pages/DataGridPage.tsx +4 -5
- package/src/pages/DataGridPageProps.ts +3 -4
- package/src/pages/FixedListPage.tsx +4 -5
- package/src/pages/ListPage.tsx +4 -5
- package/src/pages/ListPageProps.ts +2 -3
- package/src/pages/ResponsivePage.tsx +4 -5
- package/src/pages/ResponsivePageProps.ts +2 -3
- package/tsconfig.json +3 -3
package/lib/pages/ViewPage.js
CHANGED
|
@@ -21,10 +21,10 @@ export function ViewPageGridItem(props) {
|
|
|
21
21
|
// Default options
|
|
22
22
|
let options = {};
|
|
23
23
|
if (gridProps.xs == null && gridProps.md == null) {
|
|
24
|
-
options = getResp(singleRow
|
|
24
|
+
options = getResp(singleRow ?? "small");
|
|
25
25
|
}
|
|
26
26
|
else if (singleRow != null) {
|
|
27
|
-
options = getResp(singleRow
|
|
27
|
+
options = getResp(singleRow ?? "small");
|
|
28
28
|
}
|
|
29
29
|
// Layout
|
|
30
30
|
return (React.createElement(Grid, { item: true, ...gridProps, ...options },
|
|
@@ -60,13 +60,12 @@ function getResp(singleRow) {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
function getItemField(field, data) {
|
|
63
|
-
var _a, _b, _c;
|
|
64
63
|
// Item data and label
|
|
65
64
|
let itemData, itemLabel, gridProps = {};
|
|
66
65
|
if (Array.isArray(field)) {
|
|
67
66
|
const [fieldData, fieldType, renderProps, singleRow = "small"] = field;
|
|
68
67
|
itemData = GridDataFormat(data[fieldData], fieldType, renderProps);
|
|
69
|
-
itemLabel =
|
|
68
|
+
itemLabel = globalApp?.get(fieldData) ?? fieldData;
|
|
70
69
|
gridProps = { ...getResp(singleRow) };
|
|
71
70
|
}
|
|
72
71
|
else if (typeof field === "object") {
|
|
@@ -88,12 +87,12 @@ function getItemField(field, data) {
|
|
|
88
87
|
typeof fieldLabel === "function"
|
|
89
88
|
? fieldLabel(data)
|
|
90
89
|
: fieldLabel != null
|
|
91
|
-
?
|
|
90
|
+
? globalApp?.get(fieldLabel) ?? fieldLabel
|
|
92
91
|
: fieldLabel;
|
|
93
92
|
}
|
|
94
93
|
else {
|
|
95
94
|
itemData = formatItemData(data[field]);
|
|
96
|
-
itemLabel =
|
|
95
|
+
itemLabel = globalApp?.get(field) ?? field;
|
|
97
96
|
}
|
|
98
97
|
return [itemData, itemLabel, gridProps];
|
|
99
98
|
}
|
|
@@ -155,7 +154,7 @@ export function ViewPage(props) {
|
|
|
155
154
|
Utils.getResult(children, data, refresh),
|
|
156
155
|
pullToRefresh && (React.createElement(PullToRefreshUI, { mainElement: pullContainer, triggerElement: pullContainer, instructionsPullToRefresh: labels.pullToRefresh, instructionsReleaseToRefresh: labels.releaseToRefresh, instructionsRefreshing: labels.refreshing, onRefresh: refresh, shouldPullToRefresh: () => {
|
|
157
156
|
const container = document.querySelector(pullContainer);
|
|
158
|
-
return !
|
|
157
|
+
return !container?.scrollTop;
|
|
159
158
|
} })),
|
|
160
159
|
React.createElement(ScrollRestoration, null)))));
|
|
161
160
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.43",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"types": "lib/index.d.ts",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"build": "tsc",
|
|
@@ -50,19 +51,13 @@
|
|
|
50
51
|
"@emotion/css": "^11.11.2",
|
|
51
52
|
"@emotion/react": "^11.11.4",
|
|
52
53
|
"@emotion/styled": "^11.11.0",
|
|
53
|
-
"@etsoo/appscript": "^1.4.
|
|
54
|
-
"@etsoo/notificationbase": "^1.1.
|
|
55
|
-
"@etsoo/react": "^1.7.
|
|
56
|
-
"@etsoo/shared": "^1.2.
|
|
54
|
+
"@etsoo/appscript": "^1.4.79",
|
|
55
|
+
"@etsoo/notificationbase": "^1.1.40",
|
|
56
|
+
"@etsoo/react": "^1.7.31",
|
|
57
|
+
"@etsoo/shared": "^1.2.31",
|
|
57
58
|
"@mui/icons-material": "^5.15.11",
|
|
58
59
|
"@mui/material": "^5.15.11",
|
|
59
|
-
"@mui/x-data-grid": "^6.19.
|
|
60
|
-
"@types/pica": "^9.0.4",
|
|
61
|
-
"@types/pulltorefreshjs": "^0.1.7",
|
|
62
|
-
"@types/react": "^18.2.60",
|
|
63
|
-
"@types/react-avatar-editor": "^13.0.2",
|
|
64
|
-
"@types/react-dom": "^18.2.19",
|
|
65
|
-
"@types/react-input-mask": "^3.0.5",
|
|
60
|
+
"@mui/x-data-grid": "^6.19.6",
|
|
66
61
|
"chart.js": "^4.4.2",
|
|
67
62
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
68
63
|
"eventemitter3": "^5.0.1",
|
|
@@ -86,6 +81,13 @@
|
|
|
86
81
|
"@testing-library/jest-dom": "^6.4.2",
|
|
87
82
|
"@testing-library/react": "^14.2.1",
|
|
88
83
|
"@types/jest": "^29.5.12",
|
|
84
|
+
"@types/pica": "^9.0.4",
|
|
85
|
+
"@types/pulltorefreshjs": "^0.1.7",
|
|
86
|
+
"@types/react": "^18.2.61",
|
|
87
|
+
"@types/react-avatar-editor": "^13.0.2",
|
|
88
|
+
"@types/react-dom": "^18.2.19",
|
|
89
|
+
"@types/react-input-mask": "^3.0.5",
|
|
90
|
+
"@types/react-window": "^1.8.8",
|
|
89
91
|
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
|
90
92
|
"@typescript-eslint/parser": "^7.1.0",
|
|
91
93
|
"jest": "^29.7.0",
|
package/src/DataGridEx.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
ScrollerGridProps,
|
|
13
13
|
useCombinedRefs
|
|
14
14
|
} from "@etsoo/react";
|
|
15
|
-
import { DataTypes,
|
|
15
|
+
import { DataTypes, Utils } from "@etsoo/shared";
|
|
16
16
|
import {
|
|
17
17
|
Box,
|
|
18
18
|
BoxProps,
|
|
@@ -39,11 +39,8 @@ export type DataGridExFooterItemRendererProps<T extends object> = {
|
|
|
39
39
|
/**
|
|
40
40
|
* Extended DataGrid with VariableSizeGrid props
|
|
41
41
|
*/
|
|
42
|
-
export type DataGridExProps<
|
|
43
|
-
T
|
|
44
|
-
D extends DataTypes.Keys<T>
|
|
45
|
-
> = Omit<
|
|
46
|
-
ScrollerGridProps<T, D>,
|
|
42
|
+
export type DataGridExProps<T extends object> = Omit<
|
|
43
|
+
ScrollerGridProps<T>,
|
|
47
44
|
"itemRenderer" | "columnCount" | "columnWidth" | "width"
|
|
48
45
|
> & {
|
|
49
46
|
/**
|
|
@@ -216,10 +213,7 @@ export function DataGridExCalColumns<T>(columns: GridColumn<T>[]) {
|
|
|
216
213
|
* @param props Props
|
|
217
214
|
* @returns Component
|
|
218
215
|
*/
|
|
219
|
-
export function DataGridEx<
|
|
220
|
-
T extends object,
|
|
221
|
-
D extends DataTypes.Keys<T> = IdDefaultType<T>
|
|
222
|
-
>(props: DataGridExProps<T, D>) {
|
|
216
|
+
export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
|
|
223
217
|
// Theme
|
|
224
218
|
const theme = useTheme();
|
|
225
219
|
|
|
@@ -367,7 +361,7 @@ export function DataGridEx<
|
|
|
367
361
|
footerItemRenderer = DataGridRenderers.defaultFooterItemRenderer,
|
|
368
362
|
hideFooter = false,
|
|
369
363
|
hoverColor = "#f6f9fb",
|
|
370
|
-
idField = "id" as
|
|
364
|
+
idField = "id" as DataTypes.Keys<T>,
|
|
371
365
|
mRef = React.createRef(),
|
|
372
366
|
onClick,
|
|
373
367
|
onDoubleClick,
|
|
@@ -636,7 +630,7 @@ export function DataGridEx<
|
|
|
636
630
|
: undefined;
|
|
637
631
|
|
|
638
632
|
return (
|
|
639
|
-
<ScrollerGrid<T
|
|
633
|
+
<ScrollerGrid<T>
|
|
640
634
|
className={Utils.mergeClasses(
|
|
641
635
|
"DataGridEx-Body",
|
|
642
636
|
"DataGridEx-CustomBar",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataTypes
|
|
1
|
+
import { DataTypes } from "@etsoo/shared";
|
|
2
2
|
import { Box, Stack, SxProps, Theme } from "@mui/material";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import {
|
|
@@ -39,10 +39,9 @@ import { GridUtils } from "./GridUtils";
|
|
|
39
39
|
*/
|
|
40
40
|
export type ResponsibleContainerProps<
|
|
41
41
|
T extends object,
|
|
42
|
-
F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
|
|
43
|
-
D extends DataTypes.Keys<T> = IdDefaultType<T>
|
|
42
|
+
F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
|
|
44
43
|
> = Omit<
|
|
45
|
-
DataGridExProps<T
|
|
44
|
+
DataGridExProps<T>,
|
|
46
45
|
| "height"
|
|
47
46
|
| "itemKey"
|
|
48
47
|
| "loadData"
|
|
@@ -190,9 +189,8 @@ function defaultContainerBoxSx(
|
|
|
190
189
|
*/
|
|
191
190
|
export function ResponsibleContainer<
|
|
192
191
|
T extends object,
|
|
193
|
-
F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
|
|
194
|
-
|
|
195
|
-
>(props: ResponsibleContainerProps<T, F, D>) {
|
|
192
|
+
F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
|
|
193
|
+
>(props: ResponsibleContainerProps<T, F>) {
|
|
196
194
|
// Destruct
|
|
197
195
|
const {
|
|
198
196
|
adjustHeight,
|
|
@@ -371,7 +369,7 @@ export function ResponsibleContainer<
|
|
|
371
369
|
|
|
372
370
|
return [
|
|
373
371
|
<Box className="DataGridBox">
|
|
374
|
-
<DataGridEx<T
|
|
372
|
+
<DataGridEx<T>
|
|
375
373
|
autoLoad={!hasFields}
|
|
376
374
|
height={heightLocal}
|
|
377
375
|
width={rect.width}
|
|
@@ -404,7 +402,7 @@ export function ResponsibleContainer<
|
|
|
404
402
|
|
|
405
403
|
return [
|
|
406
404
|
<Box className="ListBox" sx={{ height: heightLocal }}>
|
|
407
|
-
<ScrollerListEx<T
|
|
405
|
+
<ScrollerListEx<T>
|
|
408
406
|
autoLoad={!hasFields}
|
|
409
407
|
height={heightLocal}
|
|
410
408
|
loadData={localLoadData}
|