@etsoo/materialui 1.6.48 → 1.6.50

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.
@@ -109,9 +109,8 @@ class NotificationMU extends react_2.NotificationReact {
109
109
  await this.returnValue(undefined);
110
110
  return true;
111
111
  };
112
- 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 ? "dialog-title draggable-dialog-title" : "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
113
- ? buttons(this, callback)
114
- : primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { ...setupProps, onClick: callback, autoFocus: true, ...primaryButtonProps, children: okLabel })) })] }, this.id));
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 ? "dialog-title draggable-dialog-title" : "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));
115
114
  }
116
115
  // Create confirm
117
116
  createConfirm(_props, className) {
@@ -124,7 +123,8 @@ class NotificationMU extends react_2.NotificationReact {
124
123
  await this.returnValue(value);
125
124
  return true;
126
125
  };
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 ? "dialog-title draggable-dialog-title" : "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)) : ((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 }))] })) })] }, this.id));
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 ? "dialog-title draggable-dialog-title" : "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)
@@ -186,11 +186,12 @@ class NotificationMU extends react_2.NotificationReact {
186
186
  this.dismiss();
187
187
  return true;
188
188
  };
189
- 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 ? "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, { ...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)) : ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [cancelButton && ((0, jsx_runtime_1.jsx)(Button_1.default, { color: "secondary", onClick: () => {
190
- if (this.onReturn)
191
- this.onReturn(undefined);
192
- this.dismiss();
193
- }, children: cancelLabel })), primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] })) })] }, this.id));
189
+ const base = () => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [cancelButton && ((0, jsx_runtime_1.jsx)(Button_1.default, { color: "secondary", onClick: () => {
190
+ if (this.onReturn)
191
+ this.onReturn(undefined);
192
+ this.dismiss();
193
+ }, 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 ? "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, { ...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));
194
195
  }
195
196
  // Create prompt
196
197
  createPrompt(_props, className) {
@@ -260,6 +261,11 @@ class NotificationMU extends react_2.NotificationReact {
260
261
  }
261
262
  // Setup callback
262
263
  const options = this.renderSetup ? this.renderSetup({}) : undefined;
264
+ const base = () => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [cancelButton && ((0, jsx_runtime_1.jsx)(Button_1.default, { color: "secondary", onClick: () => {
265
+ if (this.onReturn)
266
+ this.onReturn(undefined);
267
+ this.dismiss();
268
+ }, children: cancelLabel })), primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] }));
263
269
  return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent_1.DraggablePaperComponent : undefined, slotProps: {
264
270
  paper: {
265
271
  component: "form",
@@ -269,13 +275,7 @@ class NotificationMU extends react_2.NotificationReact {
269
275
  return false;
270
276
  }
271
277
  }
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, { component: "div", variant: "caption", ref: (div) => {
273
- console.log("ref", div);
274
- }, color: "error", align: "center" })] }), (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: () => {
275
- if (this.onReturn)
276
- this.onReturn(undefined);
277
- this.dismiss();
278
- }, children: cancelLabel })), primaryButton && ((0, jsx_runtime_1.jsx)(LoadingButton_1.LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] })) })] }, this.id));
278
+ }, 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, { 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
279
  }
280
280
  createPopup(_props, className) {
281
281
  // Destruct
@@ -103,9 +103,8 @@ export class NotificationMU extends NotificationReact {
103
103
  await this.returnValue(undefined);
104
104
  return true;
105
105
  };
106
- 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 ? "dialog-title draggable-dialog-title" : "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
107
- ? buttons(this, callback)
108
- : primaryButton && (_jsx(LoadingButton, { ...setupProps, onClick: callback, autoFocus: true, ...primaryButtonProps, children: okLabel })) })] }, this.id));
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 ? "dialog-title draggable-dialog-title" : "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));
109
108
  }
110
109
  // Create confirm
111
110
  createConfirm(_props, className) {
@@ -118,7 +117,8 @@ export class NotificationMU extends NotificationReact {
118
117
  await this.returnValue(value);
119
118
  return true;
120
119
  };
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 ? "dialog-title draggable-dialog-title" : "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)) : (_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));
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 ? "dialog-title draggable-dialog-title" : "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)
@@ -180,11 +180,12 @@ export class NotificationMU extends NotificationReact {
180
180
  this.dismiss();
181
181
  return true;
182
182
  };
183
- 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 ? "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, { ...inputProps, children: [content, _jsx(Typography, { component: "div", variant: "caption", ref: errorRef, color: "error", align: "center" })] }), _jsx(DialogActions, { children: buttons ? (buttons(this, handleSubmit)) : (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(Button, { color: "secondary", onClick: () => {
184
- if (this.onReturn)
185
- this.onReturn(undefined);
186
- this.dismiss();
187
- }, children: cancelLabel })), primaryButton && (_jsx(LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] })) })] }, this.id));
183
+ const base = () => (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(Button, { color: "secondary", onClick: () => {
184
+ if (this.onReturn)
185
+ this.onReturn(undefined);
186
+ this.dismiss();
187
+ }, 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 ? "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, { ...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));
188
189
  }
189
190
  // Create prompt
190
191
  createPrompt(_props, className) {
@@ -254,6 +255,11 @@ export class NotificationMU extends NotificationReact {
254
255
  }
255
256
  // Setup callback
256
257
  const options = this.renderSetup ? this.renderSetup({}) : undefined;
258
+ const base = () => (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(Button, { color: "secondary", onClick: () => {
259
+ if (this.onReturn)
260
+ this.onReturn(undefined);
261
+ this.dismiss();
262
+ }, children: cancelLabel })), primaryButton && (_jsx(LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] }));
257
263
  return (_jsxs(Dialog, { open: this.open, PaperComponent: draggable ? DraggablePaperComponent : undefined, slotProps: {
258
264
  paper: {
259
265
  component: "form",
@@ -263,13 +269,7 @@ export class NotificationMU extends NotificationReact {
263
269
  return false;
264
270
  }
265
271
  }
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, { component: "div", variant: "caption", ref: (div) => {
267
- console.log("ref", div);
268
- }, color: "error", align: "center" })] }), _jsx(DialogActions, { children: buttons ? (buttons(this, handleSubmit)) : (_jsxs(React.Fragment, { children: [cancelButton && (_jsx(Button, { color: "secondary", onClick: () => {
269
- if (this.onReturn)
270
- this.onReturn(undefined);
271
- this.dismiss();
272
- }, children: cancelLabel })), primaryButton && (_jsx(LoadingButton, { color: "primary", autoFocus: true, onClick: handleSubmit, name: "okButton", ...primaryButtonProps, children: okLabel }))] })) })] }, this.id));
272
+ }, 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, { component: "div", variant: "caption", ref: errorRef, color: "error", align: "center" })] }), _jsx(DialogActions, { children: buttons ? buttons(this, handleSubmit, base) : base() })] }, this.id));
273
273
  }
274
274
  createPopup(_props, className) {
275
275
  // Destruct
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.6.48",
3
+ "version": "1.6.50",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -36,20 +36,20 @@
36
36
  },
37
37
  "homepage": "https://github.com/ETSOO/ReactMU#readme",
38
38
  "dependencies": {
39
- "@base-ui/react": "^1.4.0",
39
+ "@base-ui/react": "^1.4.1",
40
40
  "@dnd-kit/react": "^0.4.0",
41
41
  "@emotion/react": "^11.14.0",
42
42
  "@emotion/styled": "^11.14.1",
43
- "@etsoo/appscript": "^1.6.61",
44
- "@etsoo/notificationbase": "^1.1.69",
45
- "@etsoo/react": "^1.8.85",
43
+ "@etsoo/appscript": "^1.6.62",
44
+ "@etsoo/notificationbase": "^1.1.70",
45
+ "@etsoo/react": "^1.8.87",
46
46
  "@etsoo/shared": "^1.2.83",
47
47
  "@mui/icons-material": "^9.0.0",
48
48
  "@mui/material": "^9.0.0",
49
49
  "@mui/x-data-grid": "^9.0.2",
50
50
  "chart.js": "^4.5.1",
51
51
  "chartjs-plugin-datalabels": "^2.2.0",
52
- "dompurify": "^3.4.0",
52
+ "dompurify": "^3.4.1",
53
53
  "eventemitter3": "^5.0.4",
54
54
  "pica": "^9.0.1",
55
55
  "pulltorefreshjs": "^0.1.22",
@@ -82,6 +82,6 @@
82
82
  "@vitejs/plugin-react": "^6.0.1",
83
83
  "jsdom": "^29.0.2",
84
84
  "typescript": "^6.0.3",
85
- "vitest": "^4.1.4"
85
+ "vitest": "^4.1.5"
86
86
  }
87
87
  }
@@ -156,6 +156,18 @@ export class NotificationMU extends NotificationReact {
156
156
  return true;
157
157
  };
158
158
 
159
+ const base = () =>
160
+ primaryButton && (
161
+ <LoadingButton
162
+ {...setupProps}
163
+ onClick={callback}
164
+ autoFocus
165
+ {...primaryButtonProps}
166
+ >
167
+ {okLabel}
168
+ </LoadingButton>
169
+ );
170
+
159
171
  return (
160
172
  <Dialog
161
173
  key={this.id}
@@ -194,18 +206,7 @@ export class NotificationMU extends NotificationReact {
194
206
  {inputs}
195
207
  </DialogContent>
196
208
  <DialogActions>
197
- {buttons
198
- ? buttons(this, callback)
199
- : primaryButton && (
200
- <LoadingButton
201
- {...setupProps}
202
- onClick={callback}
203
- autoFocus
204
- {...primaryButtonProps}
205
- >
206
- {okLabel}
207
- </LoadingButton>
208
- )}
209
+ {buttons ? buttons(this, callback, base) : base()}
209
210
  </DialogActions>
210
211
  </Dialog>
211
212
  );
@@ -242,6 +243,29 @@ export class NotificationMU extends NotificationReact {
242
243
  return true;
243
244
  };
244
245
 
246
+ const base = () => (
247
+ <React.Fragment>
248
+ {cancelButton && (
249
+ <LoadingButton
250
+ color="secondary"
251
+ onClick={async (event) => await callback(event, false)}
252
+ >
253
+ {cancelLabel}
254
+ </LoadingButton>
255
+ )}
256
+ {primaryButton && (
257
+ <LoadingButton
258
+ color="primary"
259
+ onClick={async (event) => await callback(event, true)}
260
+ autoFocus
261
+ {...primaryButtonProps}
262
+ >
263
+ {okLabel}
264
+ </LoadingButton>
265
+ )}
266
+ </React.Fragment>
267
+ );
268
+
245
269
  return (
246
270
  <Dialog
247
271
  key={this.id}
@@ -280,30 +304,7 @@ export class NotificationMU extends NotificationReact {
280
304
  {inputs}
281
305
  </DialogContent>
282
306
  <DialogActions>
283
- {buttons ? (
284
- buttons(this, callback)
285
- ) : (
286
- <React.Fragment>
287
- {cancelButton && (
288
- <LoadingButton
289
- color="secondary"
290
- onClick={async (event) => await callback(event, false)}
291
- >
292
- {cancelLabel}
293
- </LoadingButton>
294
- )}
295
- {primaryButton && (
296
- <LoadingButton
297
- color="primary"
298
- onClick={async (event) => await callback(event, true)}
299
- autoFocus
300
- {...primaryButtonProps}
301
- >
302
- {okLabel}
303
- </LoadingButton>
304
- )}
305
- </React.Fragment>
306
- )}
307
+ {buttons ? buttons(this, callback, base) : base()}
307
308
  </DialogActions>
308
309
  </Dialog>
309
310
  );
@@ -420,6 +421,33 @@ export class NotificationMU extends NotificationReact {
420
421
  return true;
421
422
  };
422
423
 
424
+ const base = () => (
425
+ <React.Fragment>
426
+ {cancelButton && (
427
+ <Button
428
+ color="secondary"
429
+ onClick={() => {
430
+ if (this.onReturn) this.onReturn(undefined);
431
+ this.dismiss();
432
+ }}
433
+ >
434
+ {cancelLabel}
435
+ </Button>
436
+ )}
437
+ {primaryButton && (
438
+ <LoadingButton
439
+ color="primary"
440
+ autoFocus
441
+ onClick={handleSubmit}
442
+ name="okButton"
443
+ {...primaryButtonProps}
444
+ >
445
+ {okLabel}
446
+ </LoadingButton>
447
+ )}
448
+ </React.Fragment>
449
+ );
450
+
423
451
  return (
424
452
  <Dialog
425
453
  key={this.id}
@@ -461,34 +489,7 @@ export class NotificationMU extends NotificationReact {
461
489
  />
462
490
  </DialogContent>
463
491
  <DialogActions>
464
- {buttons ? (
465
- buttons(this, handleSubmit)
466
- ) : (
467
- <React.Fragment>
468
- {cancelButton && (
469
- <Button
470
- color="secondary"
471
- onClick={() => {
472
- if (this.onReturn) this.onReturn(undefined);
473
- this.dismiss();
474
- }}
475
- >
476
- {cancelLabel}
477
- </Button>
478
- )}
479
- {primaryButton && (
480
- <LoadingButton
481
- color="primary"
482
- autoFocus
483
- onClick={handleSubmit}
484
- name="okButton"
485
- {...primaryButtonProps}
486
- >
487
- {okLabel}
488
- </LoadingButton>
489
- )}
490
- </React.Fragment>
491
- )}
492
+ {buttons ? buttons(this, handleSubmit, base) : base()}
492
493
  </DialogActions>
493
494
  </Dialog>
494
495
  );
@@ -608,6 +609,33 @@ export class NotificationMU extends NotificationReact {
608
609
  // Setup callback
609
610
  const options = this.renderSetup ? this.renderSetup({}) : undefined;
610
611
 
612
+ const base = () => (
613
+ <React.Fragment>
614
+ {cancelButton && (
615
+ <Button
616
+ color="secondary"
617
+ onClick={() => {
618
+ if (this.onReturn) this.onReturn(undefined);
619
+ this.dismiss();
620
+ }}
621
+ >
622
+ {cancelLabel}
623
+ </Button>
624
+ )}
625
+ {primaryButton && (
626
+ <LoadingButton
627
+ color="primary"
628
+ autoFocus
629
+ onClick={handleSubmit}
630
+ name="okButton"
631
+ {...primaryButtonProps}
632
+ >
633
+ {okLabel}
634
+ </LoadingButton>
635
+ )}
636
+ </React.Fragment>
637
+ );
638
+
611
639
  return (
612
640
  <Dialog
613
641
  key={this.id}
@@ -662,42 +690,13 @@ export class NotificationMU extends NotificationReact {
662
690
  <Typography
663
691
  component="div"
664
692
  variant="caption"
665
- ref={(div) => {
666
- console.log("ref", div);
667
- }}
693
+ ref={errorRef}
668
694
  color="error"
669
695
  align="center"
670
696
  />
671
697
  </DialogContent>
672
698
  <DialogActions>
673
- {buttons ? (
674
- buttons(this, handleSubmit)
675
- ) : (
676
- <React.Fragment>
677
- {cancelButton && (
678
- <Button
679
- color="secondary"
680
- onClick={() => {
681
- if (this.onReturn) this.onReturn(undefined);
682
- this.dismiss();
683
- }}
684
- >
685
- {cancelLabel}
686
- </Button>
687
- )}
688
- {primaryButton && (
689
- <LoadingButton
690
- color="primary"
691
- autoFocus
692
- onClick={handleSubmit}
693
- name="okButton"
694
- {...primaryButtonProps}
695
- >
696
- {okLabel}
697
- </LoadingButton>
698
- )}
699
- </React.Fragment>
700
- )}
699
+ {buttons ? buttons(this, handleSubmit, base) : base()}
701
700
  </DialogActions>
702
701
  </Dialog>
703
702
  );