ywana-core8 0.0.785 → 0.0.787

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.785",
3
+ "version": "0.0.787",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -11,20 +11,26 @@ import './dialog.css'
11
11
  export const Dialog = (props) => {
12
12
 
13
13
  const site = useContext(SiteContext)
14
- const { icon, title = "Dialog", toolbar, children, actions, className, onClose } = props
14
+ const { icon, title = "Dialog", toolbar, children, actions, className, onClose, overlayCanClose = true } = props
15
+
16
+ function overlayClose() {
17
+ if (overlayCanClose) {
18
+ close()
19
+ }
20
+ }
15
21
 
16
22
  function close() {
17
23
  if (onClose) onClose()
18
24
  if (className === "prompt") {
19
25
  site.closePromptDialog()
20
26
  } else {
21
- site.closeDialog()
27
+ site.closeDialog()
22
28
  }
23
29
  }
24
30
 
25
31
  return (
26
32
  <Fragment>
27
- <div className={`overlay ${className}`} onMouseDown={close} />
33
+ <div className={`overlay ${className}`} onMouseDown={overlayClose} />
28
34
  <dialog className={`dialog-panel ${className}`}>
29
35
  <header>
30
36
  {icon ? <MenuIcon icon={icon} /> : null}