@etsoo/materialui 1.6.73 → 1.6.74
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/NotifierMU.d.ts +1 -1
- package/lib/cjs/NotifierMU.js +6 -7
- package/lib/mjs/NotifierMU.d.ts +1 -1
- package/lib/mjs/NotifierMU.js +6 -7
- package/package.json +2 -2
- package/src/NotifierMU.tsx +7 -16
package/lib/cjs/NotifierMU.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { INotificationBaseReact, INotificationReact, NotificationReact, Notifier
|
|
|
5
5
|
* MU notification data methods
|
|
6
6
|
*/
|
|
7
7
|
export interface NotificationMUDataMethods {
|
|
8
|
-
getValue(): unknown
|
|
8
|
+
getValue(): unknown | PromiseLike<unknown>;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* MU notification data props
|
package/lib/cjs/NotifierMU.js
CHANGED
|
@@ -110,7 +110,7 @@ class NotificationMU extends react_2.NotificationReact {
|
|
|
110
110
|
return true;
|
|
111
111
|
};
|
|
112
112
|
const base = () => primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { ...setupProps, onClick: callback, autoFocus: true, ...primaryButtonProps, children: okLabel }));
|
|
113
|
-
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "
|
|
113
|
+
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: `dialog-title${draggable ? " draggable-dialog-title" : ""}`, children: [icon, (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(DialogContent_1.default, { children: [typeof this.content === "string" ? ((0, jsx_runtime_1.jsx)(DialogContentText_1.default, { children: this.content })) : (this.content), inputs] }), (0, jsx_runtime_1.jsx)(DialogActions_1.default, { children: buttons ? buttons(this, callback, base) : base() })] }, this.id));
|
|
114
114
|
}
|
|
115
115
|
// Create confirm
|
|
116
116
|
createConfirm(_props, className) {
|
|
@@ -124,7 +124,7 @@ class NotificationMU extends react_2.NotificationReact {
|
|
|
124
124
|
return true;
|
|
125
125
|
};
|
|
126
126
|
const base = () => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [cancelButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "secondary", onClick: async (event) => await callback(event, false), children: cancelLabel })), primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "primary", onClick: async (event) => await callback(event, true), autoFocus: true, ...primaryButtonProps, children: okLabel }))] }));
|
|
127
|
-
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "
|
|
127
|
+
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: `dialog-title${draggable ? " draggable-dialog-title" : ""}`, children: [(0, jsx_runtime_1.jsx)(Help_1.default, { color: "action" }), (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(DialogContent_1.default, { children: [typeof this.content === "string" ? ((0, jsx_runtime_1.jsx)(DialogContentText_1.default, { children: this.content })) : (this.content), inputs] }), (0, jsx_runtime_1.jsx)(DialogActions_1.default, { children: buttons ? buttons(this, callback, base) : base() })] }, this.id));
|
|
128
128
|
}
|
|
129
129
|
createMessageColor() {
|
|
130
130
|
if (this.type === notificationbase_1.NotificationMessageType.Danger)
|
|
@@ -168,13 +168,12 @@ class NotificationMU extends react_2.NotificationReact {
|
|
|
168
168
|
setError(undefined);
|
|
169
169
|
if (this.onReturn) {
|
|
170
170
|
// Get the value
|
|
171
|
-
const value = mRef.current?.getValue();
|
|
171
|
+
const value = await mRef.current?.getValue();
|
|
172
172
|
if (value == null) {
|
|
173
173
|
return false;
|
|
174
174
|
}
|
|
175
|
-
const
|
|
175
|
+
const v = await this.onReturn(value);
|
|
176
176
|
// returns false to prevent default dismiss
|
|
177
|
-
const v = await result;
|
|
178
177
|
if (v === false) {
|
|
179
178
|
return false;
|
|
180
179
|
}
|
|
@@ -191,7 +190,7 @@ class NotificationMU extends react_2.NotificationReact {
|
|
|
191
190
|
this.onReturn(undefined);
|
|
192
191
|
this.dismiss();
|
|
193
192
|
}, children: cancelLabel })), primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] }));
|
|
194
|
-
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "
|
|
193
|
+
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: `dialog-title${draggable ? " draggable-dialog-title" : ""}`, children: [(0, jsx_runtime_1.jsx)(Info_1.default, { color: "primary" }), (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(DialogContent_1.default, { ...inputProps, children: [content, (0, jsx_runtime_1.jsx)(Typography_1.default, { component: "div", variant: "caption", ref: errorRef, color: "error", align: "center" })] }), (0, jsx_runtime_1.jsx)(DialogActions_1.default, { children: buttons ? buttons(this, handleSubmit, base) : base() })] }, this.id));
|
|
195
194
|
}
|
|
196
195
|
// Create prompt
|
|
197
196
|
createPrompt(_props, className) {
|
|
@@ -275,7 +274,7 @@ class NotificationMU extends react_2.NotificationReact {
|
|
|
275
274
|
return false;
|
|
276
275
|
}
|
|
277
276
|
}
|
|
278
|
-
}, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "
|
|
277
|
+
}, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: `dialog-title${draggable ? " draggable-dialog-title" : ""}`, children: [(0, jsx_runtime_1.jsx)(Info_1.default, { color: "primary" }), (0, jsx_runtime_1.jsx)("span", { className: "dialogTitle", children: title }), closable && ((0, jsx_runtime_1.jsx)(IconButton_1.default, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: (0, jsx_runtime_1.jsx)(Close_1.default, {}) }))] }), (0, jsx_runtime_1.jsxs)(DialogContent_1.default, { dividers: true, children: [typeof this.content === "string" ? ((0, jsx_runtime_1.jsx)(DialogContentText_1.default, { children: this.content })) : (this.content), localInputs, (0, jsx_runtime_1.jsx)(Typography_1.default, { component: "div", variant: "caption", ref: errorRef, color: "error", align: "center" })] }), (0, jsx_runtime_1.jsx)(DialogActions_1.default, { children: buttons ? buttons(this, handleSubmit, base) : base() })] }, this.id));
|
|
279
278
|
}
|
|
280
279
|
createPopup(_props, className) {
|
|
281
280
|
// Destruct
|
package/lib/mjs/NotifierMU.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { INotificationBaseReact, INotificationReact, NotificationReact, Notifier
|
|
|
5
5
|
* MU notification data methods
|
|
6
6
|
*/
|
|
7
7
|
export interface NotificationMUDataMethods {
|
|
8
|
-
getValue(): unknown
|
|
8
|
+
getValue(): unknown | PromiseLike<unknown>;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* MU notification data props
|
package/lib/mjs/NotifierMU.js
CHANGED
|
@@ -104,7 +104,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
104
104
|
return true;
|
|
105
105
|
};
|
|
106
106
|
const base = () => primaryButton && (_jsx(LoadingButton, { ...setupProps, onClick: callback, autoFocus: true, ...primaryButtonProps, children: okLabel }));
|
|
107
|
-
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: draggable ? "
|
|
107
|
+
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: `dialog-title${draggable ? " draggable-dialog-title" : ""}`, children: [icon, _jsx("span", { className: "dialogTitle", children: title }), closable && (_jsx(IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: _jsx(CloseIcon, {}) }))] }), _jsxs(DialogContent, { children: [typeof this.content === "string" ? (_jsx(DialogContentText, { children: this.content })) : (this.content), inputs] }), _jsx(DialogActions, { children: buttons ? buttons(this, callback, base) : base() })] }, this.id));
|
|
108
108
|
}
|
|
109
109
|
// Create confirm
|
|
110
110
|
createConfirm(_props, className) {
|
|
@@ -118,7 +118,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
118
118
|
return true;
|
|
119
119
|
};
|
|
120
120
|
const base = () => (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(LoadingButton, { color: "secondary", onClick: async (event) => await callback(event, false), children: cancelLabel })), primaryButton && (_jsx(LoadingButton, { color: "primary", onClick: async (event) => await callback(event, true), autoFocus: true, ...primaryButtonProps, children: okLabel }))] }));
|
|
121
|
-
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: draggable ? "
|
|
121
|
+
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: `dialog-title${draggable ? " draggable-dialog-title" : ""}`, children: [_jsx(HelpIcon, { color: "action" }), _jsx("span", { className: "dialogTitle", children: title }), closable && (_jsx(IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: _jsx(CloseIcon, {}) }))] }), _jsxs(DialogContent, { children: [typeof this.content === "string" ? (_jsx(DialogContentText, { children: this.content })) : (this.content), inputs] }), _jsx(DialogActions, { children: buttons ? buttons(this, callback, base) : base() })] }, this.id));
|
|
122
122
|
}
|
|
123
123
|
createMessageColor() {
|
|
124
124
|
if (this.type === NotificationMessageType.Danger)
|
|
@@ -162,13 +162,12 @@ export class NotificationMU extends NotificationReact {
|
|
|
162
162
|
setError(undefined);
|
|
163
163
|
if (this.onReturn) {
|
|
164
164
|
// Get the value
|
|
165
|
-
const value = mRef.current?.getValue();
|
|
165
|
+
const value = await mRef.current?.getValue();
|
|
166
166
|
if (value == null) {
|
|
167
167
|
return false;
|
|
168
168
|
}
|
|
169
|
-
const
|
|
169
|
+
const v = await this.onReturn(value);
|
|
170
170
|
// returns false to prevent default dismiss
|
|
171
|
-
const v = await result;
|
|
172
171
|
if (v === false) {
|
|
173
172
|
return false;
|
|
174
173
|
}
|
|
@@ -185,7 +184,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
185
184
|
this.onReturn(undefined);
|
|
186
185
|
this.dismiss();
|
|
187
186
|
}, children: cancelLabel })), primaryButton && (_jsx(LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] }));
|
|
188
|
-
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: draggable ? "
|
|
187
|
+
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: `dialog-title${draggable ? " draggable-dialog-title" : ""}`, children: [_jsx(InfoIcon, { color: "primary" }), _jsx("span", { className: "dialogTitle", children: title }), closable && (_jsx(IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: _jsx(CloseIcon, {}) }))] }), _jsxs(DialogContent, { ...inputProps, children: [content, _jsx(Typography, { component: "div", variant: "caption", ref: errorRef, color: "error", align: "center" })] }), _jsx(DialogActions, { children: buttons ? buttons(this, handleSubmit, base) : base() })] }, this.id));
|
|
189
188
|
}
|
|
190
189
|
// Create prompt
|
|
191
190
|
createPrompt(_props, className) {
|
|
@@ -269,7 +268,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
269
268
|
return false;
|
|
270
269
|
}
|
|
271
270
|
}
|
|
272
|
-
}, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: draggable ? "
|
|
271
|
+
}, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: `dialog-title${draggable ? " draggable-dialog-title" : ""}`, children: [_jsx(InfoIcon, { color: "primary" }), _jsx("span", { className: "dialogTitle", children: title }), closable && (_jsx(IconButton, { className: "MuiDialogContent-root-close-button", size: "small", onClick: () => this.returnValue("CLOSE"), children: _jsx(CloseIcon, {}) }))] }), _jsxs(DialogContent, { dividers: true, children: [typeof this.content === "string" ? (_jsx(DialogContentText, { children: this.content })) : (this.content), localInputs, _jsx(Typography, { component: "div", variant: "caption", ref: errorRef, color: "error", align: "center" })] }), _jsx(DialogActions, { children: buttons ? buttons(this, handleSubmit, base) : base() })] }, this.id));
|
|
273
272
|
}
|
|
274
273
|
createPopup(_props, className) {
|
|
275
274
|
// Destruct
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.74",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@emotion/styled": "^11.14.1",
|
|
43
43
|
"@etsoo/appscript": "^1.6.69",
|
|
44
44
|
"@etsoo/notificationbase": "^1.1.72",
|
|
45
|
-
"@etsoo/react": "^1.8.
|
|
45
|
+
"@etsoo/react": "^1.8.93",
|
|
46
46
|
"@etsoo/shared": "^1.2.87",
|
|
47
47
|
"@mui/icons-material": "^9.1.1",
|
|
48
48
|
"@mui/material": "^9.1.2",
|
package/src/NotifierMU.tsx
CHANGED
|
@@ -80,7 +80,7 @@ const setError = (div?: HTMLDivElement | null, error?: string) => {
|
|
|
80
80
|
* MU notification data methods
|
|
81
81
|
*/
|
|
82
82
|
export interface NotificationMUDataMethods {
|
|
83
|
-
getValue(): unknown
|
|
83
|
+
getValue(): unknown | PromiseLike<unknown>;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
@@ -181,9 +181,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
181
181
|
>
|
|
182
182
|
<IconDialogTitle
|
|
183
183
|
draggable={draggable}
|
|
184
|
-
className={
|
|
185
|
-
draggable ? "dialog-title draggable-dialog-title" : "dialog-title"
|
|
186
|
-
}
|
|
184
|
+
className={`dialog-title${draggable ? " draggable-dialog-title" : ""}`}
|
|
187
185
|
>
|
|
188
186
|
{icon}
|
|
189
187
|
<span className="dialogTitle">{title}</span>
|
|
@@ -279,9 +277,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
279
277
|
>
|
|
280
278
|
<IconDialogTitle
|
|
281
279
|
draggable={draggable}
|
|
282
|
-
className={
|
|
283
|
-
draggable ? "dialog-title draggable-dialog-title" : "dialog-title"
|
|
284
|
-
}
|
|
280
|
+
className={`dialog-title${draggable ? " draggable-dialog-title" : ""}`}
|
|
285
281
|
>
|
|
286
282
|
<HelpIcon color="action" />
|
|
287
283
|
<span className="dialogTitle">{title}</span>
|
|
@@ -398,15 +394,14 @@ export class NotificationMU extends NotificationReact {
|
|
|
398
394
|
|
|
399
395
|
if (this.onReturn) {
|
|
400
396
|
// Get the value
|
|
401
|
-
const value = mRef.current?.getValue();
|
|
397
|
+
const value = await mRef.current?.getValue();
|
|
402
398
|
if (value == null) {
|
|
403
399
|
return false;
|
|
404
400
|
}
|
|
405
401
|
|
|
406
|
-
const
|
|
402
|
+
const v = await this.onReturn(value);
|
|
407
403
|
|
|
408
404
|
// returns false to prevent default dismiss
|
|
409
|
-
const v = await result;
|
|
410
405
|
if (v === false) {
|
|
411
406
|
return false;
|
|
412
407
|
}
|
|
@@ -462,9 +457,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
462
457
|
>
|
|
463
458
|
<IconDialogTitle
|
|
464
459
|
draggable={draggable}
|
|
465
|
-
className={
|
|
466
|
-
draggable ? "dialog-title draggable-dialog-title" : "dialog-title"
|
|
467
|
-
}
|
|
460
|
+
className={`dialog-title${draggable ? " draggable-dialog-title" : ""}`}
|
|
468
461
|
>
|
|
469
462
|
<InfoIcon color="primary" />
|
|
470
463
|
<span className="dialogTitle">{title}</span>
|
|
@@ -664,9 +657,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
664
657
|
>
|
|
665
658
|
<IconDialogTitle
|
|
666
659
|
draggable={draggable}
|
|
667
|
-
className={
|
|
668
|
-
draggable ? "dialog-title draggable-dialog-title" : "dialog-title"
|
|
669
|
-
}
|
|
660
|
+
className={`dialog-title${draggable ? " draggable-dialog-title" : ""}`}
|
|
670
661
|
>
|
|
671
662
|
<InfoIcon color="primary" />
|
|
672
663
|
<span className="dialogTitle">{title}</span>
|