ywana-core8 0.0.350 → 0.0.351
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/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +5 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +5 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/site/dialog.js +5 -1
- package/src/site/site.test.js +8 -9
package/package.json
CHANGED
package/src/site/dialog.js
CHANGED
@@ -14,7 +14,11 @@ export const Dialog = (props) => {
|
|
14
14
|
const { icon, title = "Dialog", children, onAction, actions, className, eventPropagation = false } = props
|
15
15
|
|
16
16
|
function close() {
|
17
|
-
|
17
|
+
if (className === "prompt") {
|
18
|
+
site.closePromptDialog()
|
19
|
+
} else {
|
20
|
+
site.closeDialog()
|
21
|
+
}
|
18
22
|
}
|
19
23
|
|
20
24
|
function prevent(e) {
|
package/src/site/site.test.js
CHANGED
@@ -25,7 +25,7 @@ const Page1 = (props) => {
|
|
25
25
|
|
26
26
|
const site = useContext(SiteContext)
|
27
27
|
useEffect(() => {
|
28
|
-
site.notify({ title: "Notification 1", body: "Lorem ipsum dolor sit amet"})
|
28
|
+
site.notify({ title: "Notification 1", body: "Lorem ipsum dolor sit amet" })
|
29
29
|
}, [])
|
30
30
|
|
31
31
|
return (
|
@@ -41,7 +41,7 @@ const Page1 = (props) => {
|
|
41
41
|
const Page2 = (props) => {
|
42
42
|
|
43
43
|
const site = useContext(SiteContext)
|
44
|
-
|
44
|
+
|
45
45
|
function prompt() {
|
46
46
|
const actions = (
|
47
47
|
<Fragment>
|
@@ -50,14 +50,13 @@ const Page2 = (props) => {
|
|
50
50
|
)
|
51
51
|
site.openPromptDialog(<Dialog className="prompt" actions={actions} >PROMPT</Dialog>)
|
52
52
|
}
|
53
|
-
|
53
|
+
|
54
54
|
function openDialog() {
|
55
|
-
|
56
|
-
|
57
|
-
<
|
58
|
-
|
59
|
-
|
60
|
-
)
|
55
|
+
const actions = (
|
56
|
+
<Fragment>
|
57
|
+
<Button label="CLOSE" action={() => site.closeDialog()} />
|
58
|
+
</Fragment>
|
59
|
+
)
|
61
60
|
site.openDialog(
|
62
61
|
<Dialog actions={actions}>
|
63
62
|
<main>
|