@etsoo/materialui 1.2.92 → 1.2.94

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 CHANGED
@@ -223,10 +223,11 @@ export class NotificationMU extends NotificationReact {
223
223
  }
224
224
  createPopup(_props, className) {
225
225
  // Destruct
226
- const { content, open, renderSetup } = this;
226
+ // dismiss will trigger onReturn callback
227
+ const { content, dismiss, id, open, renderSetup } = this;
227
228
  // Setup callback
228
- const options = this.renderSetup ? this.renderSetup({}) : undefined;
229
- return (React.createElement(Popover, { open: open, className: className, ...options }, content));
229
+ const options = renderSetup ? renderSetup({}) : undefined;
230
+ return (React.createElement(Popover, { key: id, open: open, className: className, onClose: () => dismiss(), ...options }, content));
230
231
  }
231
232
  // Create loading
232
233
  createLoading(_props, className) {
@@ -0,0 +1,5 @@
1
+ import { PopoverProps } from "@mui/material";
2
+ /**
3
+ * Notifier Popup pros
4
+ */
5
+ export type NotifierPopupProps = Omit<PopoverProps, "open" | "onClose">;
@@ -0,0 +1 @@
1
+ export {};
package/lib/index.d.ts CHANGED
@@ -76,6 +76,7 @@ export * from "./MoreFab";
76
76
  export * from "./MUGlobal";
77
77
  export * from "./MUUtils";
78
78
  export * from "./NotifierMU";
79
+ export * from "./NotifierPopupProps";
79
80
  export * from "./OptionBool";
80
81
  export * from "./OptionGroup";
81
82
  export * from "./PercentCircularProgress";
package/lib/index.js CHANGED
@@ -76,6 +76,7 @@ export * from "./MoreFab";
76
76
  export * from "./MUGlobal";
77
77
  export * from "./MUUtils";
78
78
  export * from "./NotifierMU";
79
+ export * from "./NotifierPopupProps";
79
80
  export * from "./OptionBool";
80
81
  export * from "./OptionGroup";
81
82
  export * from "./PercentCircularProgress";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.2.92",
3
+ "version": "1.2.94",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -480,13 +480,20 @@ export class NotificationMU extends NotificationReact {
480
480
 
481
481
  private createPopup(_props: NotificationRenderProps, className?: string) {
482
482
  // Destruct
483
- const { content, open, renderSetup } = this;
483
+ // dismiss will trigger onReturn callback
484
+ const { content, dismiss, id, open, renderSetup } = this;
484
485
 
485
486
  // Setup callback
486
- const options = this.renderSetup ? this.renderSetup({}) : undefined;
487
+ const options = renderSetup ? renderSetup({}) : undefined;
487
488
 
488
489
  return (
489
- <Popover open={open} className={className} {...options}>
490
+ <Popover
491
+ key={id}
492
+ open={open}
493
+ className={className}
494
+ onClose={() => dismiss()}
495
+ {...options}
496
+ >
490
497
  {content}
491
498
  </Popover>
492
499
  );
@@ -0,0 +1,6 @@
1
+ import { PopoverProps } from "@mui/material";
2
+
3
+ /**
4
+ * Notifier Popup pros
5
+ */
6
+ export type NotifierPopupProps = Omit<PopoverProps, "open" | "onClose">;
package/src/index.ts CHANGED
@@ -80,6 +80,7 @@ export * from "./MoreFab";
80
80
  export * from "./MUGlobal";
81
81
  export * from "./MUUtils";
82
82
  export * from "./NotifierMU";
83
+ export * from "./NotifierPopupProps";
83
84
  export * from "./OptionBool";
84
85
  export * from "./OptionGroup";
85
86
  export * from "./PercentCircularProgress";