@etsoo/materialui 1.6.35 → 1.6.37
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.js +14 -9
- package/lib/mjs/NotifierMU.js +14 -9
- package/package.json +1 -1
- package/src/NotifierMU.tsx +75 -73
package/lib/cjs/NotifierMU.js
CHANGED
|
@@ -260,15 +260,20 @@ class NotificationMU extends react_2.NotificationReact {
|
|
|
260
260
|
}
|
|
261
261
|
// Setup callback
|
|
262
262
|
const options = this.renderSetup ? this.renderSetup({}) : undefined;
|
|
263
|
-
return ((0, jsx_runtime_1.
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
263
|
+
return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, slotProps: {
|
|
264
|
+
paper: {
|
|
265
|
+
component: "form",
|
|
266
|
+
onSubmit: (event) => {
|
|
267
|
+
event.preventDefault();
|
|
268
|
+
event.currentTarget.elements.namedItem("okButton")?.click();
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [(0, jsx_runtime_1.jsxs)(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "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, { variant: "caption", display: "block", ref: errorRef, color: "error" })] }), (0, jsx_runtime_1.jsx)(DialogActions_1.default, { children: buttons ? (buttons(this, handleSubmit)) : ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [cancelButton && ((0, jsx_runtime_1.jsx)(Button_1.default, { color: "secondary", onClick: () => {
|
|
273
|
+
if (this.onReturn)
|
|
274
|
+
this.onReturn(undefined);
|
|
275
|
+
this.dismiss();
|
|
276
|
+
}, children: cancelLabel })), primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] })) })] }, this.id));
|
|
272
277
|
}
|
|
273
278
|
createPopup(_props, className) {
|
|
274
279
|
// Destruct
|
package/lib/mjs/NotifierMU.js
CHANGED
|
@@ -254,15 +254,20 @@ export class NotificationMU extends NotificationReact {
|
|
|
254
254
|
}
|
|
255
255
|
// Setup callback
|
|
256
256
|
const options = this.renderSetup ? this.renderSetup({}) : undefined;
|
|
257
|
-
return (
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
257
|
+
return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, slotProps: {
|
|
258
|
+
paper: {
|
|
259
|
+
component: "form",
|
|
260
|
+
onSubmit: (event) => {
|
|
261
|
+
event.preventDefault();
|
|
262
|
+
event.currentTarget.elements.namedItem("okButton")?.click();
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: [_jsxs(IconDialogTitle, { draggable: draggable, className: draggable ? "dialog-title draggable-dialog-title" : "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, { variant: "caption", display: "block", ref: errorRef, color: "error" })] }), _jsx(DialogActions, { children: buttons ? (buttons(this, handleSubmit)) : (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(Button, { color: "secondary", onClick: () => {
|
|
267
|
+
if (this.onReturn)
|
|
268
|
+
this.onReturn(undefined);
|
|
269
|
+
this.dismiss();
|
|
270
|
+
}, children: cancelLabel })), primaryButton && (_jsx(LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] })) })] }, this.id));
|
|
266
271
|
}
|
|
267
272
|
createPopup(_props, className) {
|
|
268
273
|
// Destruct
|
package/package.json
CHANGED
package/src/NotifierMU.tsx
CHANGED
|
@@ -610,6 +610,20 @@ export class NotificationMU extends NotificationReact {
|
|
|
610
610
|
key={this.id}
|
|
611
611
|
open={this.open}
|
|
612
612
|
PaperComponent={draggable ? DraggablePaperComponent : undefined}
|
|
613
|
+
slotProps={{
|
|
614
|
+
paper: {
|
|
615
|
+
component: "form",
|
|
616
|
+
onSubmit: (event: React.SubmitEvent<HTMLFormElement>) => {
|
|
617
|
+
event.preventDefault();
|
|
618
|
+
(
|
|
619
|
+
event.currentTarget.elements.namedItem(
|
|
620
|
+
"okButton"
|
|
621
|
+
) as HTMLButtonElement
|
|
622
|
+
)?.click();
|
|
623
|
+
return false;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}}
|
|
613
627
|
className={className}
|
|
614
628
|
fullWidth={fullWidth}
|
|
615
629
|
maxWidth={maxWidth}
|
|
@@ -617,80 +631,68 @@ export class NotificationMU extends NotificationReact {
|
|
|
617
631
|
scroll="paper"
|
|
618
632
|
{...options}
|
|
619
633
|
>
|
|
620
|
-
<
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
"okButton"
|
|
626
|
-
) as HTMLButtonElement
|
|
627
|
-
)?.click();
|
|
628
|
-
return false;
|
|
629
|
-
}}
|
|
634
|
+
<IconDialogTitle
|
|
635
|
+
draggable={draggable}
|
|
636
|
+
className={
|
|
637
|
+
draggable ? "dialog-title draggable-dialog-title" : "dialog-title"
|
|
638
|
+
}
|
|
630
639
|
>
|
|
631
|
-
<
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
{okLabel}
|
|
688
|
-
</LoadingButton>
|
|
689
|
-
)}
|
|
690
|
-
</React.Fragment>
|
|
691
|
-
)}
|
|
692
|
-
</DialogActions>
|
|
693
|
-
</form>
|
|
640
|
+
<InfoIcon color="primary" />
|
|
641
|
+
<span className="dialogTitle">{title}</span>
|
|
642
|
+
{closable && (
|
|
643
|
+
<IconButton
|
|
644
|
+
className="MuiDialogContent-root-close-button"
|
|
645
|
+
size="small"
|
|
646
|
+
onClick={() => this.returnValue("CLOSE")}
|
|
647
|
+
>
|
|
648
|
+
<CloseIcon />
|
|
649
|
+
</IconButton>
|
|
650
|
+
)}
|
|
651
|
+
</IconDialogTitle>
|
|
652
|
+
<DialogContent dividers>
|
|
653
|
+
{typeof this.content === "string" ? (
|
|
654
|
+
<DialogContentText>{this.content}</DialogContentText>
|
|
655
|
+
) : (
|
|
656
|
+
this.content
|
|
657
|
+
)}
|
|
658
|
+
{localInputs}
|
|
659
|
+
<Typography
|
|
660
|
+
variant="caption"
|
|
661
|
+
display="block"
|
|
662
|
+
ref={errorRef}
|
|
663
|
+
color="error"
|
|
664
|
+
/>
|
|
665
|
+
</DialogContent>
|
|
666
|
+
<DialogActions>
|
|
667
|
+
{buttons ? (
|
|
668
|
+
buttons(this, handleSubmit)
|
|
669
|
+
) : (
|
|
670
|
+
<React.Fragment>
|
|
671
|
+
{cancelButton && (
|
|
672
|
+
<Button
|
|
673
|
+
color="secondary"
|
|
674
|
+
onClick={() => {
|
|
675
|
+
if (this.onReturn) this.onReturn(undefined);
|
|
676
|
+
this.dismiss();
|
|
677
|
+
}}
|
|
678
|
+
>
|
|
679
|
+
{cancelLabel}
|
|
680
|
+
</Button>
|
|
681
|
+
)}
|
|
682
|
+
{primaryButton && (
|
|
683
|
+
<LoadingButton
|
|
684
|
+
color="primary"
|
|
685
|
+
autoFocus
|
|
686
|
+
onClick={handleSubmit}
|
|
687
|
+
name="okButton"
|
|
688
|
+
{...primaryButtonProps}
|
|
689
|
+
>
|
|
690
|
+
{okLabel}
|
|
691
|
+
</LoadingButton>
|
|
692
|
+
)}
|
|
693
|
+
</React.Fragment>
|
|
694
|
+
)}
|
|
695
|
+
</DialogActions>
|
|
694
696
|
</Dialog>
|
|
695
697
|
);
|
|
696
698
|
}
|