@etsoo/materialui 1.4.19 → 1.4.20
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/NotifierMU.js +6 -6
- package/package.json +2 -2
- package/src/NotifierMU.tsx +9 -6
package/lib/NotifierMU.js
CHANGED
|
@@ -34,7 +34,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
34
34
|
// Create alert
|
|
35
35
|
createAlert(_props, className) {
|
|
36
36
|
const labels = Labels.NotificationMU;
|
|
37
|
-
const { buttons, inputs, fullScreen, fullWidth = true, maxWidth, okLabel = labels.alertOK, primaryButton = true, primaryButtonProps, closable = false } = this.inputProps ?? {};
|
|
37
|
+
const { buttons, inputs, fullScreen, fullWidth = true, maxWidth, okLabel = labels.alertOK, primaryButton = true, primaryButtonProps, closable = false, draggable = fullScreen === true ? false : true } = this.inputProps ?? {};
|
|
38
38
|
let title = this.title;
|
|
39
39
|
let icon;
|
|
40
40
|
if (this.type === NotificationMessageType.Success) {
|
|
@@ -63,7 +63,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
63
63
|
await this.returnValue(undefined);
|
|
64
64
|
return true;
|
|
65
65
|
};
|
|
66
|
-
return (_jsxs(Dialog, { open: this.open, PaperComponent: DraggablePaperComponent, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [_jsxs(IconDialogTitle, { className: "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
|
|
66
|
+
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [_jsxs(IconDialogTitle, { className: "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
|
|
67
67
|
? buttons(this, callback)
|
|
68
68
|
: primaryButton && (_jsx(LoadingButton, { ...setupProps, onClick: callback, autoFocus: true, ...primaryButtonProps, children: okLabel })) })] }, this.id));
|
|
69
69
|
}
|
|
@@ -71,14 +71,14 @@ export class NotificationMU extends NotificationReact {
|
|
|
71
71
|
createConfirm(_props, className) {
|
|
72
72
|
const labels = Labels.NotificationMU;
|
|
73
73
|
const title = this.title ?? labels.confirmTitle;
|
|
74
|
-
const { buttons, okLabel = labels.confirmYes, cancelLabel = labels.confirmNo, cancelButton = true, inputs, fullScreen, fullWidth = true, maxWidth, primaryButton = true, primaryButtonProps, closable = false } = this.inputProps ?? {};
|
|
74
|
+
const { buttons, okLabel = labels.confirmYes, cancelLabel = labels.confirmNo, cancelButton = true, inputs, fullScreen, fullWidth = true, maxWidth, primaryButton = true, primaryButtonProps, closable = false, draggable = fullScreen === true ? false : true } = this.inputProps ?? {};
|
|
75
75
|
// Setup callback
|
|
76
76
|
const options = this.renderSetup ? this.renderSetup({}) : undefined;
|
|
77
77
|
const callback = async (_event, value) => {
|
|
78
78
|
await this.returnValue(value);
|
|
79
79
|
return true;
|
|
80
80
|
};
|
|
81
|
-
return (_jsxs(Dialog, { open: this.open, PaperComponent: DraggablePaperComponent, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [_jsxs(IconDialogTitle, { className: "draggable-dialog-title", children: [_jsx(Help, { 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)) : (_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 }))] })) })] }, this.id));
|
|
81
|
+
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: [_jsxs(IconDialogTitle, { className: "draggable-dialog-title", children: [_jsx(Help, { 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)) : (_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 }))] })) })] }, this.id));
|
|
82
82
|
}
|
|
83
83
|
createMessageColor() {
|
|
84
84
|
if (this.type === NotificationMessageType.Danger)
|
|
@@ -106,7 +106,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
106
106
|
createPrompt(_props, className) {
|
|
107
107
|
const labels = Labels.NotificationMU;
|
|
108
108
|
const title = this.title ?? labels.promptTitle;
|
|
109
|
-
const { buttons, cancelLabel = labels.promptCancel, okLabel = labels.promptOK, cancelButton = true, inputs, type, fullScreen, fullWidth = true, maxWidth, primaryButton = true, primaryButtonProps, inputProps, closable = false } = this.inputProps ?? {};
|
|
109
|
+
const { buttons, cancelLabel = labels.promptCancel, okLabel = labels.promptOK, cancelButton = true, inputs, type, fullScreen, fullWidth = true, maxWidth, primaryButton = true, primaryButtonProps, inputProps, closable = false, draggable = fullScreen === true ? false : true } = this.inputProps ?? {};
|
|
110
110
|
const inputRef = React.createRef();
|
|
111
111
|
const errorRef = React.createRef();
|
|
112
112
|
const setError = (error) => {
|
|
@@ -173,7 +173,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
173
173
|
}
|
|
174
174
|
// Setup callback
|
|
175
175
|
const options = this.renderSetup ? this.renderSetup({}) : undefined;
|
|
176
|
-
return (_jsx(Dialog, { open: this.open, PaperComponent: DraggablePaperComponent, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: _jsxs("form", { onSubmit: (event) => {
|
|
176
|
+
return (_jsx(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, ...options, children: _jsxs("form", { onSubmit: (event) => {
|
|
177
177
|
event.preventDefault();
|
|
178
178
|
event.currentTarget.elements.namedItem("okButton")?.click();
|
|
179
179
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.20",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@emotion/styled": "^11.13.0",
|
|
53
53
|
"@etsoo/appscript": "^1.5.61",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.52",
|
|
55
|
-
"@etsoo/react": "^1.7.
|
|
55
|
+
"@etsoo/react": "^1.7.92",
|
|
56
56
|
"@etsoo/shared": "^1.2.51",
|
|
57
57
|
"@mui/icons-material": "^6.1.4",
|
|
58
58
|
"@mui/material": "^6.1.4",
|
package/src/NotifierMU.tsx
CHANGED
|
@@ -79,7 +79,8 @@ export class NotificationMU extends NotificationReact {
|
|
|
79
79
|
okLabel = labels.alertOK,
|
|
80
80
|
primaryButton = true,
|
|
81
81
|
primaryButtonProps,
|
|
82
|
-
closable = false
|
|
82
|
+
closable = false,
|
|
83
|
+
draggable = fullScreen === true ? false : true
|
|
83
84
|
} = this.inputProps ?? {};
|
|
84
85
|
|
|
85
86
|
let title = this.title;
|
|
@@ -115,7 +116,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
115
116
|
<Dialog
|
|
116
117
|
key={this.id}
|
|
117
118
|
open={this.open}
|
|
118
|
-
PaperComponent={DraggablePaperComponent}
|
|
119
|
+
PaperComponent={draggable ? DraggablePaperComponent : undefined}
|
|
119
120
|
className={className}
|
|
120
121
|
fullWidth={fullWidth}
|
|
121
122
|
maxWidth={maxWidth}
|
|
@@ -177,7 +178,8 @@ export class NotificationMU extends NotificationReact {
|
|
|
177
178
|
maxWidth,
|
|
178
179
|
primaryButton = true,
|
|
179
180
|
primaryButtonProps,
|
|
180
|
-
closable = false
|
|
181
|
+
closable = false,
|
|
182
|
+
draggable = fullScreen === true ? false : true
|
|
181
183
|
} = this.inputProps ?? {};
|
|
182
184
|
|
|
183
185
|
// Setup callback
|
|
@@ -195,7 +197,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
195
197
|
<Dialog
|
|
196
198
|
key={this.id}
|
|
197
199
|
open={this.open}
|
|
198
|
-
PaperComponent={DraggablePaperComponent}
|
|
200
|
+
PaperComponent={draggable ? DraggablePaperComponent : undefined}
|
|
199
201
|
className={className}
|
|
200
202
|
fullWidth={fullWidth}
|
|
201
203
|
maxWidth={maxWidth}
|
|
@@ -317,7 +319,8 @@ export class NotificationMU extends NotificationReact {
|
|
|
317
319
|
primaryButton = true,
|
|
318
320
|
primaryButtonProps,
|
|
319
321
|
inputProps,
|
|
320
|
-
closable = false
|
|
322
|
+
closable = false,
|
|
323
|
+
draggable = fullScreen === true ? false : true
|
|
321
324
|
} = this.inputProps ?? {};
|
|
322
325
|
|
|
323
326
|
const inputRef = React.createRef<HTMLInputElement>();
|
|
@@ -417,7 +420,7 @@ export class NotificationMU extends NotificationReact {
|
|
|
417
420
|
<Dialog
|
|
418
421
|
key={this.id}
|
|
419
422
|
open={this.open}
|
|
420
|
-
PaperComponent={DraggablePaperComponent}
|
|
423
|
+
PaperComponent={draggable ? DraggablePaperComponent : undefined}
|
|
421
424
|
className={className}
|
|
422
425
|
fullWidth={fullWidth}
|
|
423
426
|
maxWidth={maxWidth}
|