@etsoo/materialui 1.4.22 → 1.4.24

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.
Files changed (93) hide show
  1. package/README.md +2 -1
  2. package/__tests__/ReactAppTests.tsx +6 -4
  3. package/babel.config.json +12 -12
  4. package/lib/AddresSelector.d.ts +8 -2
  5. package/lib/AddresSelector.js +1 -1
  6. package/lib/AuditDisplay.d.ts +1 -1
  7. package/lib/BackButton.d.ts +1 -1
  8. package/lib/BackButton.js +5 -5
  9. package/lib/CountryList.d.ts +5 -4
  10. package/lib/CountryList.js +3 -3
  11. package/lib/CustomFabProps.d.ts +3 -3
  12. package/lib/DataGridEx.js +3 -6
  13. package/lib/DataGridRenderers.d.ts +3 -3
  14. package/lib/DataGridRenderers.js +17 -17
  15. package/lib/DataTable.d.ts +1 -7
  16. package/lib/DataTable.js +3 -13
  17. package/lib/DialogButton.d.ts +2 -2
  18. package/lib/DialogButton.js +4 -4
  19. package/lib/EmailInput.d.ts +2 -2
  20. package/lib/EmailInput.js +2 -2
  21. package/lib/FlexBox.d.ts +3 -3
  22. package/lib/FlexBox.js +1 -1
  23. package/lib/GridDataFormat.d.ts +2 -2
  24. package/lib/GridDataFormat.js +7 -7
  25. package/lib/GridUtils.js +2 -1
  26. package/lib/ListItemRightIcon.d.ts +1 -1
  27. package/lib/ListItemRightIcon.js +2 -2
  28. package/lib/LoadingButton.d.ts +1 -1
  29. package/lib/LoadingButton.js +2 -2
  30. package/lib/MUGlobal.d.ts +6 -6
  31. package/lib/MUGlobal.js +20 -22
  32. package/lib/MobileListItemRenderer.d.ts +3 -3
  33. package/lib/MobileListItemRenderer.js +8 -10
  34. package/lib/PList.js +1 -1
  35. package/lib/ProgressCount.js +12 -12
  36. package/lib/RegionsRQ.d.ts +22 -0
  37. package/lib/RegionsRQ.js +1 -0
  38. package/lib/SearchField.d.ts +1 -1
  39. package/lib/SearchField.js +4 -4
  40. package/lib/SearchOptionGroup.d.ts +2 -2
  41. package/lib/SearchOptionGroup.js +3 -3
  42. package/lib/Switch.d.ts +3 -3
  43. package/lib/Switch.js +5 -5
  44. package/lib/TabBox.d.ts +5 -5
  45. package/lib/TabBox.js +5 -5
  46. package/lib/TableEx.js +4 -7
  47. package/lib/TooltipClick.d.ts +3 -3
  48. package/lib/TooltipClick.js +3 -3
  49. package/lib/TwoFieldInput.d.ts +2 -2
  50. package/lib/TwoFieldInput.js +13 -13
  51. package/lib/app/IServicePage.d.ts +1 -1
  52. package/lib/app/Labels.d.ts +1 -1
  53. package/lib/app/Labels.js +31 -31
  54. package/lib/index.d.ts +1 -0
  55. package/lib/index.js +1 -0
  56. package/lib/texts/MoneyText.d.ts +1 -1
  57. package/lib/texts/MoneyText.js +3 -3
  58. package/lib/texts/NumberText.d.ts +1 -1
  59. package/lib/texts/NumberText.js +3 -3
  60. package/package.json +20 -20
  61. package/src/AddresSelector.tsx +31 -4
  62. package/src/AuditDisplay.tsx +1 -1
  63. package/src/BackButton.tsx +39 -39
  64. package/src/CountryList.tsx +49 -48
  65. package/src/CustomFabProps.ts +19 -19
  66. package/src/DataGridEx.tsx +2 -7
  67. package/src/DataGridRenderers.tsx +119 -119
  68. package/src/DataTable.tsx +2 -31
  69. package/src/DialogButton.tsx +149 -151
  70. package/src/EmailInput.tsx +9 -11
  71. package/src/FlexBox.tsx +6 -6
  72. package/src/GridDataFormat.tsx +58 -58
  73. package/src/GridUtils.ts +2 -1
  74. package/src/ListItemRightIcon.tsx +3 -3
  75. package/src/LoadingButton.tsx +53 -53
  76. package/src/MUGlobal.ts +196 -203
  77. package/src/MobileListItemRenderer.tsx +63 -65
  78. package/src/NotifierPromptProps.ts +16 -16
  79. package/src/PList.tsx +14 -14
  80. package/src/ProgressCount.tsx +144 -148
  81. package/src/RegionsRQ.ts +26 -0
  82. package/src/SearchField.tsx +59 -59
  83. package/src/SearchOptionGroup.tsx +20 -20
  84. package/src/Switch.tsx +72 -72
  85. package/src/TabBox.tsx +87 -89
  86. package/src/TableEx.tsx +5 -8
  87. package/src/TooltipClick.tsx +62 -64
  88. package/src/TwoFieldInput.tsx +104 -104
  89. package/src/app/IServicePage.ts +1 -1
  90. package/src/app/Labels.ts +67 -67
  91. package/src/index.ts +1 -0
  92. package/src/texts/MoneyText.tsx +29 -35
  93. package/src/texts/NumberText.tsx +23 -23
@@ -1,140 +1,140 @@
1
- import React from 'react';
2
- import { CircularProgress } from '@mui/material';
3
- import { DateUtils, NumberUtils } from '@etsoo/shared';
4
- import CheckIcon from '@mui/icons-material/Check';
5
- import ClearIcon from '@mui/icons-material/Clear';
6
- import { DataGridExFooterItemRendererProps } from './DataGridEx';
7
- import { DateText } from './texts/DateText';
8
- import { GridCellRendererProps, GridDataType } from '@etsoo/react';
1
+ import React from "react";
2
+ import { CircularProgress } from "@mui/material";
3
+ import { DateUtils, NumberUtils } from "@etsoo/shared";
4
+ import CheckIcon from "@mui/icons-material/Check";
5
+ import ClearIcon from "@mui/icons-material/Clear";
6
+ import { DataGridExFooterItemRendererProps } from "./DataGridEx";
7
+ import { DateText } from "./texts/DateText";
8
+ import { GridCellRendererProps, GridDataType } from "@etsoo/react";
9
9
 
10
10
  /**
11
11
  * Data grid renderers
12
12
  */
13
13
  export namespace DataGridRenderers {
14
- /**
15
- * Default cell renderer
16
- * @param param Props
17
- * @returns Component
18
- */
19
- export function defaultCellRenderer<T extends Record<string, any>>({
20
- cellProps,
21
- data,
22
- field,
23
- formattedValue,
24
- columnIndex,
25
- type,
26
- renderProps
27
- }: GridCellRendererProps<T>): React.ReactNode {
28
- // Is loading
29
- if (data == null) {
30
- // First column, show loading indicator
31
- if (columnIndex === 0) return <CircularProgress size={15} />;
14
+ /**
15
+ * Default cell renderer
16
+ * @param param Props
17
+ * @returns Component
18
+ */
19
+ export function defaultCellRenderer<T extends Record<string, any>>({
20
+ cellProps,
21
+ data,
22
+ field,
23
+ formattedValue,
24
+ columnIndex,
25
+ type,
26
+ renderProps
27
+ }: GridCellRendererProps<T>): React.ReactNode {
28
+ // Is loading
29
+ if (data == null) {
30
+ // First column, show loading indicator
31
+ if (columnIndex === 0) return <CircularProgress size={15} />;
32
32
 
33
- // Others return undefined
34
- return undefined;
35
- }
36
-
37
- // No formatted value and data field
38
- if (formattedValue == null && field == null) return undefined;
33
+ // Others return undefined
34
+ return undefined;
35
+ }
39
36
 
40
- // Cell value
41
- const value = formattedValue ?? data[field!];
42
- if (value == null) return undefined;
37
+ // No formatted value and data field
38
+ if (formattedValue == null && field == null) return undefined;
43
39
 
44
- // For date time
45
- // Conversion if necessary
46
- if (type === GridDataType.Date || type === GridDataType.DateTime) {
47
- const dateValue = value instanceof Date ? value : new Date(value);
40
+ // Cell value
41
+ const value = formattedValue ?? data[field!];
42
+ if (value == null) return undefined;
48
43
 
49
- const option = type === GridDataType.DateTime ? 'ds' : 'd';
44
+ // For date time
45
+ // Conversion if necessary
46
+ if (type === GridDataType.Date || type === GridDataType.DateTime) {
47
+ const dateValue = value instanceof Date ? value : new Date(value);
50
48
 
51
- const nearDays = renderProps?.nearDays;
52
- if (nearDays != null) {
53
- return (
54
- <DateText
55
- value={dateValue}
56
- locale={renderProps?.culture}
57
- timeZone={renderProps?.timeZone}
58
- options={option}
59
- nearDays={nearDays}
60
- />
61
- );
62
- }
49
+ const option = type === GridDataType.DateTime ? "ds" : "d";
63
50
 
64
- return DateUtils.format(
65
- dateValue,
66
- renderProps?.culture,
67
- option,
68
- renderProps?.timeZone
69
- );
70
- }
51
+ const nearDays = renderProps?.nearDays;
52
+ if (nearDays != null) {
53
+ return (
54
+ <DateText
55
+ value={dateValue}
56
+ locale={renderProps?.culture}
57
+ timeZone={renderProps?.timeZone}
58
+ options={option}
59
+ nearDays={nearDays}
60
+ />
61
+ );
62
+ }
71
63
 
72
- // For numbers
73
- if (typeof value === 'number') {
74
- if (type === GridDataType.Money || type === GridDataType.IntMoney)
75
- return NumberUtils.formatMoney(
76
- value,
77
- renderProps?.currency,
78
- renderProps?.culture,
79
- type === GridDataType.IntMoney,
80
- renderProps?.numberFormatOptions
81
- );
82
- else
83
- return NumberUtils.format(
84
- value,
85
- renderProps?.culture,
86
- renderProps?.numberFormatOptions
87
- );
88
- }
64
+ return DateUtils.format(
65
+ dateValue,
66
+ renderProps?.culture,
67
+ option,
68
+ renderProps?.timeZone
69
+ );
70
+ }
89
71
 
90
- // For boolean
91
- if (typeof value === 'boolean') {
92
- // Add style
93
- if ('align' in cellProps) {
94
- cellProps.sx = {
95
- paddingTop: '12px!important',
96
- paddingBottom: '6px!important'
97
- };
98
- } else {
99
- cellProps.sx = {
100
- paddingTop: '16px!important',
101
- paddingBottom: '8px!important'
102
- };
103
- }
72
+ // For numbers
73
+ if (typeof value === "number") {
74
+ if (type === GridDataType.Money || type === GridDataType.IntMoney)
75
+ return NumberUtils.formatMoney(
76
+ value,
77
+ renderProps?.currency,
78
+ renderProps?.culture,
79
+ type === GridDataType.IntMoney,
80
+ renderProps?.numberFormatOptions
81
+ );
82
+ else
83
+ return NumberUtils.format(
84
+ value,
85
+ renderProps?.culture,
86
+ renderProps?.numberFormatOptions
87
+ );
88
+ }
104
89
 
105
- if (value) return <CheckIcon fontSize="small" />;
106
- else return <ClearIcon fontSize="small" color="warning" />;
107
- }
90
+ // For boolean
91
+ if (typeof value === "boolean") {
92
+ // Add style
93
+ if ("align" in cellProps) {
94
+ cellProps.sx = {
95
+ paddingTop: "12px!important",
96
+ paddingBottom: "6px!important"
97
+ };
98
+ } else {
99
+ cellProps.sx = {
100
+ paddingTop: "16px!important",
101
+ paddingBottom: "8px!important"
102
+ };
103
+ }
108
104
 
109
- // To string
110
- return new String(value);
105
+ if (value) return <CheckIcon fontSize="small" />;
106
+ else return <ClearIcon fontSize="small" color="warning" />;
111
107
  }
112
108
 
113
- /**
114
- * Default footer item renderer
115
- * @param rows Rows
116
- * @param props Renderer props
117
- * @param location Renderer location (column index)
118
- * @returns Component
119
- */
120
- export function defaultFooterItemRenderer<T extends object>(
121
- _rows: T[],
122
- { index, states, checkable }: DataGridExFooterItemRendererProps<T>,
123
- location: number = 0
124
- ) {
125
- const { selectedItems, loadedItems, hasNextPage } = states;
109
+ // To string
110
+ return new String(value);
111
+ }
126
112
 
127
- if (index === location) {
128
- if (checkable) {
129
- return [
130
- selectedItems.length,
131
- loadedItems.toLocaleString() + (hasNextPage ? '+' : '')
132
- ].join(' / ');
133
- } else {
134
- return loadedItems.toLocaleString() + (hasNextPage ? '+' : '');
135
- }
136
- }
113
+ /**
114
+ * Default footer item renderer
115
+ * @param rows Rows
116
+ * @param props Renderer props
117
+ * @param location Renderer location (column index)
118
+ * @returns Component
119
+ */
120
+ export function defaultFooterItemRenderer<T extends object>(
121
+ _rows: T[],
122
+ { index, states, checkable }: DataGridExFooterItemRendererProps<T>,
123
+ location: number = 0
124
+ ) {
125
+ const { selectedItems, loadedItems, hasNextPage } = states;
137
126
 
138
- return undefined;
127
+ if (index === location) {
128
+ if (checkable) {
129
+ return [
130
+ selectedItems.length,
131
+ loadedItems.toLocaleString() + (hasNextPage ? "+" : "")
132
+ ].join(" / ");
133
+ } else {
134
+ return loadedItems.toLocaleString() + (hasNextPage ? "+" : "");
135
+ }
139
136
  }
137
+
138
+ return undefined;
139
+ }
140
140
  }
package/src/DataTable.tsx CHANGED
@@ -30,16 +30,6 @@ export type DataTableProps<R extends GridValidRowModel = any> = Omit<
30
30
  * @returns Result
31
31
  */
32
32
  onCellSelection?: (params: DataTableSelectedCellParams) => void | false;
33
-
34
- /**
35
- * Toolbar creator
36
- * @returns Toolbar
37
- */
38
- toolbarCreator?: (
39
- selectedCellParams: DataTableSelectedCellParams | null,
40
- setCellModesModel: React.Dispatch<React.SetStateAction<GridCellModesModel>>,
41
- cellModesModel: GridCellModesModel
42
- ) => React.ReactElement;
43
33
  };
44
34
 
45
35
  /**
@@ -54,9 +44,9 @@ export function DataTable<R extends GridValidRowModel = any>(
54
44
  const {
55
45
  localeText = {},
56
46
  onCellSelection,
57
- toolbarCreator,
58
47
  onProcessRowUpdateError = (error) =>
59
48
  console.log("onProcessRowUpdateError", error),
49
+ slotProps,
60
50
  ...rest
61
51
  } = props;
62
52
 
@@ -64,9 +54,6 @@ export function DataTable<R extends GridValidRowModel = any>(
64
54
  const { noRows } = globalApp?.getLabels("noRows") ?? {};
65
55
  if (noRows && !localeText.noRowsLabel) localeText.noRowsLabel = noRows;
66
56
 
67
- const [selectedCellParams, setSelectedCellParams] =
68
- React.useState<DataTableSelectedCellParams | null>(null);
69
-
70
57
  const [cellModesModel, setCellModesModel] =
71
58
  React.useState<GridCellModesModel>({});
72
59
 
@@ -92,8 +79,6 @@ export function DataTable<R extends GridValidRowModel = any>(
92
79
  if (onCellSelection) {
93
80
  if (onCellSelection(params) === false) return;
94
81
  }
95
-
96
- setSelectedCellParams(params);
97
82
  },
98
83
  []
99
84
  );
@@ -106,22 +91,8 @@ export function DataTable<R extends GridValidRowModel = any>(
106
91
  cellModesModel={cellModesModel}
107
92
  onCellModesModelChange={(model) => setCellModesModel(model)}
108
93
  onProcessRowUpdateError={onProcessRowUpdateError}
109
- slots={{
110
- toolbar: toolbarCreator
111
- ? ({ selectedCellParams, setCellModesModel, cellModesModel }) =>
112
- toolbarCreator(
113
- selectedCellParams,
114
- setCellModesModel,
115
- cellModesModel
116
- )
117
- : undefined
118
- }}
119
94
  slotProps={{
120
- toolbar: {
121
- selectedCellParams,
122
- setCellModesModel,
123
- cellModesModel
124
- },
95
+ ...slotProps,
125
96
  cell: {
126
97
  onFocus: handleCellFocus
127
98
  }
@@ -1,71 +1,71 @@
1
1
  import {
2
- Breakpoint,
3
- Button,
4
- ButtonProps,
5
- Dialog,
6
- DialogActions,
7
- DialogContent,
8
- DialogContentText,
9
- DialogTitle,
10
- IconButton
11
- } from '@mui/material';
12
- import React from 'react';
13
- import { Labels } from './app/Labels';
2
+ Breakpoint,
3
+ Button,
4
+ ButtonProps,
5
+ Dialog,
6
+ DialogActions,
7
+ DialogContent,
8
+ DialogContentText,
9
+ DialogTitle,
10
+ IconButton
11
+ } from "@mui/material";
12
+ import React from "react";
13
+ import { Labels } from "./app/Labels";
14
14
 
15
15
  export interface DialogButtonProps extends ButtonProps {
16
- /**
17
- * Button label
18
- */
19
- buttonLabel?: string;
20
-
21
- /**
22
- * Dialog content
23
- */
24
- content: string;
25
-
26
- /**
27
- * Show content in pre component
28
- */
29
- contentPre?: boolean;
30
-
31
- /**
32
- * Default is label
33
- */
34
- dialogTitle?: string;
35
-
36
- /**
37
- * Disable the scroll lock behavior.
38
- * @default false
39
- */
40
- disableScrollLock?: boolean;
41
-
42
- /**
43
- * Show fullscreen dialog
44
- */
45
- fullScreen?: boolean;
46
-
47
- /**
48
- * If `true`, the dialog stretches to `maxWidth`.
49
- *
50
- * Notice that the dialog width grow is limited by the default margin.
51
- * @default false
52
- */
53
- fullWidth?: boolean;
54
-
55
- /**
56
- * Other layouts
57
- */
58
- inputs?: React.ReactNode;
59
-
60
- /**
61
- * Max width of the dialog
62
- */
63
- maxWidth?: Breakpoint | false;
64
-
65
- /**
66
- * Icon button
67
- */
68
- icon?: React.ReactNode;
16
+ /**
17
+ * Button label
18
+ */
19
+ buttonLabel?: string;
20
+
21
+ /**
22
+ * Dialog content
23
+ */
24
+ content: string;
25
+
26
+ /**
27
+ * Show content in pre component
28
+ */
29
+ contentPre?: boolean;
30
+
31
+ /**
32
+ * Default is label
33
+ */
34
+ dialogTitle?: string;
35
+
36
+ /**
37
+ * Disable the scroll lock behavior.
38
+ * @default false
39
+ */
40
+ disableScrollLock?: boolean;
41
+
42
+ /**
43
+ * Show fullscreen dialog
44
+ */
45
+ fullScreen?: boolean;
46
+
47
+ /**
48
+ * If `true`, the dialog stretches to `maxWidth`.
49
+ *
50
+ * Notice that the dialog width grow is limited by the default margin.
51
+ * @default false
52
+ */
53
+ fullWidth?: boolean;
54
+
55
+ /**
56
+ * Other layouts
57
+ */
58
+ inputs?: React.ReactNode;
59
+
60
+ /**
61
+ * Max width of the dialog
62
+ */
63
+ maxWidth?: Breakpoint | false;
64
+
65
+ /**
66
+ * Icon button
67
+ */
68
+ icon?: React.ReactNode;
69
69
  }
70
70
 
71
71
  /**
@@ -74,90 +74,88 @@ export interface DialogButtonProps extends ButtonProps {
74
74
  * @returns Component
75
75
  */
76
76
  export function DialogButton(props: DialogButtonProps) {
77
- // Labels shared with NotificationMU
78
- const labels = Labels.NotificationMU;
79
-
80
- // Destruct
81
- const {
82
- buttonLabel = labels.alertOK,
83
- children,
84
- content,
85
- contentPre,
86
- dialogTitle,
87
- disableScrollLock,
88
- fullScreen,
89
- fullWidth,
90
- icon,
91
- inputs,
92
- maxWidth,
93
- onClick,
94
- title,
95
- ...rest
96
- } = props;
97
-
98
- // Open state
99
- const [open, setOpen] = React.useState(false);
100
-
101
- const handleClickOpen = () => {
102
- setOpen(true);
103
- };
104
-
105
- // Onclick handler
106
- const onClickLocal = (event: React.MouseEvent<HTMLButtonElement>) => {
107
- // Stop propagation
108
- event.stopPropagation();
109
- event.preventDefault();
110
-
111
- // Show dialog
112
- handleClickOpen();
113
-
114
- // Additional callback
115
- if (onClick) onClick(event);
116
- };
117
-
118
- // Layout
119
- return (
120
- <React.Fragment>
121
- {icon == null ? (
122
- <Button {...rest} title={title} onClick={onClickLocal}>
123
- {children}
124
- </Button>
125
- ) : (
126
- <IconButton
127
- {...rest}
128
- onClick={onClickLocal}
129
- title={title ?? children?.toString()}
130
- >
131
- {icon}
132
- </IconButton>
133
- )}
134
-
135
- <Dialog
136
- disableScrollLock={disableScrollLock}
137
- fullScreen={fullScreen}
138
- fullWidth={fullWidth}
139
- maxWidth={maxWidth}
140
- open={open}
141
- onClose={() => setOpen(false)}
142
- onClick={(event) => {
143
- // The dialog will be embeded and the click event will bubble up
144
- // Stop propatation but will also cancel onClose and onBackdropClick event
145
- event.stopPropagation();
146
- }}
147
- >
148
- <DialogTitle>{dialogTitle ?? title ?? children}</DialogTitle>
149
- <DialogContent>
150
- <DialogContentText component={contentPre ? 'pre' : 'span'}>
151
- {content}
152
- </DialogContentText>
153
- {inputs}
154
- </DialogContent>
155
- <DialogActions>
156
- <Button onClick={() => setOpen(false)}>
157
- {buttonLabel}
158
- </Button>
159
- </DialogActions>
160
- </Dialog>
161
- </React.Fragment>
162
- );
77
+ // Labels shared with NotificationMU
78
+ const labels = Labels.NotificationMU;
79
+
80
+ // Destruct
81
+ const {
82
+ buttonLabel = labels.alertOK,
83
+ children,
84
+ content,
85
+ contentPre,
86
+ dialogTitle,
87
+ disableScrollLock,
88
+ fullScreen,
89
+ fullWidth,
90
+ icon,
91
+ inputs,
92
+ maxWidth,
93
+ onClick,
94
+ title,
95
+ ...rest
96
+ } = props;
97
+
98
+ // Open state
99
+ const [open, setOpen] = React.useState(false);
100
+
101
+ const handleClickOpen = () => {
102
+ setOpen(true);
103
+ };
104
+
105
+ // Onclick handler
106
+ const onClickLocal = (event: React.MouseEvent<HTMLButtonElement>) => {
107
+ // Stop propagation
108
+ event.stopPropagation();
109
+ event.preventDefault();
110
+
111
+ // Show dialog
112
+ handleClickOpen();
113
+
114
+ // Additional callback
115
+ if (onClick) onClick(event);
116
+ };
117
+
118
+ // Layout
119
+ return (
120
+ <React.Fragment>
121
+ {icon == null ? (
122
+ <Button {...rest} title={title} onClick={onClickLocal}>
123
+ {children}
124
+ </Button>
125
+ ) : (
126
+ <IconButton
127
+ {...rest}
128
+ onClick={onClickLocal}
129
+ title={title ?? children?.toString()}
130
+ >
131
+ {icon}
132
+ </IconButton>
133
+ )}
134
+
135
+ <Dialog
136
+ disableScrollLock={disableScrollLock}
137
+ fullScreen={fullScreen}
138
+ fullWidth={fullWidth}
139
+ maxWidth={maxWidth}
140
+ open={open}
141
+ onClose={() => setOpen(false)}
142
+ onClick={(event) => {
143
+ // The dialog will be embeded and the click event will bubble up
144
+ // Stop propatation but will also cancel onClose and onBackdropClick event
145
+ event.stopPropagation();
146
+ }}
147
+ >
148
+ <DialogTitle>{dialogTitle ?? title ?? children}</DialogTitle>
149
+ <DialogContent>
150
+ <DialogContentText component={contentPre ? "pre" : "span"}>
151
+ {content}
152
+ </DialogContentText>
153
+ {inputs}
154
+ </DialogContent>
155
+ <DialogActions>
156
+ <Button onClick={() => setOpen(false)}>{buttonLabel}</Button>
157
+ </DialogActions>
158
+ </Dialog>
159
+ </React.Fragment>
160
+ );
163
161
  }
@@ -1,24 +1,22 @@
1
- import { TextField, TextFieldProps } from '@mui/material';
2
- import React from 'react';
1
+ import { TextField, TextFieldProps } from "@mui/material";
2
+ import React from "react";
3
3
 
4
4
  /**
5
5
  * Email input props
6
6
  */
7
- export type EmailInputProps = Omit<TextFieldProps, 'type'> & {};
7
+ export type EmailInputProps = Omit<TextFieldProps, "type"> & {};
8
8
 
9
9
  /**
10
10
  * Email input
11
11
  * @param props Props
12
12
  */
13
13
  export function EmailInput(props: EmailInputProps) {
14
- // Destruct
15
- const { inputProps = {}, ...rest } = props;
14
+ // Destruct
15
+ const { inputProps = {}, ...rest } = props;
16
16
 
17
- // Default max length
18
- inputProps.maxLength ??= 128;
17
+ // Default max length
18
+ inputProps.maxLength ??= 128;
19
19
 
20
- // Layout
21
- return (
22
- <TextField type="email" fullWidth inputProps={inputProps} {...rest} />
23
- );
20
+ // Layout
21
+ return <TextField type="email" fullWidth inputProps={inputProps} {...rest} />;
24
22
  }