@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.
@@ -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.jsx)(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)("form", { onSubmit: (event) => {
264
- event.preventDefault();
265
- event.currentTarget.elements.namedItem("okButton")?.click();
266
- return false;
267
- }, 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: () => {
268
- if (this.onReturn)
269
- this.onReturn(undefined);
270
- this.dismiss();
271
- }, children: cancelLabel })), primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] })) })] }) }, this.id));
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
@@ -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 (_jsx(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, className: className, fullWidth: fullWidth, maxWidth: maxWidth, fullScreen: fullScreen, scroll: "paper", ...options, children: _jsxs("form", { onSubmit: (event) => {
258
- event.preventDefault();
259
- event.currentTarget.elements.namedItem("okButton")?.click();
260
- return false;
261
- }, 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: () => {
262
- if (this.onReturn)
263
- this.onReturn(undefined);
264
- this.dismiss();
265
- }, children: cancelLabel })), primaryButton && (_jsx(LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] })) })] }) }, this.id));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.6.35",
3
+ "version": "1.6.37",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -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
- <form
621
- onSubmit={(event) => {
622
- event.preventDefault();
623
- (
624
- event.currentTarget.elements.namedItem(
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
- <IconDialogTitle
632
- draggable={draggable}
633
- className={
634
- draggable ? "dialog-title draggable-dialog-title" : "dialog-title"
635
- }
636
- >
637
- <InfoIcon color="primary" />
638
- <span className="dialogTitle">{title}</span>
639
- {closable && (
640
- <IconButton
641
- className="MuiDialogContent-root-close-button"
642
- size="small"
643
- onClick={() => this.returnValue("CLOSE")}
644
- >
645
- <CloseIcon />
646
- </IconButton>
647
- )}
648
- </IconDialogTitle>
649
- <DialogContent dividers>
650
- {typeof this.content === "string" ? (
651
- <DialogContentText>{this.content}</DialogContentText>
652
- ) : (
653
- this.content
654
- )}
655
- {localInputs}
656
- <Typography
657
- variant="caption"
658
- display="block"
659
- ref={errorRef}
660
- color="error"
661
- />
662
- </DialogContent>
663
- <DialogActions>
664
- {buttons ? (
665
- buttons(this, handleSubmit)
666
- ) : (
667
- <React.Fragment>
668
- {cancelButton && (
669
- <Button
670
- color="secondary"
671
- onClick={() => {
672
- if (this.onReturn) this.onReturn(undefined);
673
- this.dismiss();
674
- }}
675
- >
676
- {cancelLabel}
677
- </Button>
678
- )}
679
- {primaryButton && (
680
- <LoadingButton
681
- color="primary"
682
- autoFocus
683
- onClick={handleSubmit}
684
- name="okButton"
685
- {...primaryButtonProps}
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
  }