ywana-core8 0.0.379 → 0.0.382
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 +6 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +6 -20
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +6 -20
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/site/dialog.js +2 -9
- package/src/widgets/upload/UploadDialog.js +3 -4
package/package.json
CHANGED
package/src/site/dialog.js
CHANGED
@@ -11,7 +11,7 @@ import './dialog.css'
|
|
11
11
|
export const Dialog = (props) => {
|
12
12
|
|
13
13
|
const site = useContext(SiteContext)
|
14
|
-
const { icon, title = "Dialog", children, onAction, actions, className
|
14
|
+
const { icon, title = "Dialog", children, onAction, actions, className} = props
|
15
15
|
|
16
16
|
function close() {
|
17
17
|
if (className === "prompt") {
|
@@ -21,18 +21,11 @@ export const Dialog = (props) => {
|
|
21
21
|
}
|
22
22
|
}
|
23
23
|
|
24
|
-
function prevent(e) {
|
25
|
-
if (!eventPropagation) {
|
26
|
-
e.preventDefault()
|
27
|
-
e.stopPropagation()
|
28
|
-
}
|
29
|
-
}
|
30
|
-
|
31
24
|
return (
|
32
25
|
<Fragment>
|
33
26
|
<div className={`overlay ${className}`} />
|
34
27
|
<div className={`dialog ${className}`} onClick={close}>
|
35
|
-
<div className="dialog-panel"
|
28
|
+
<div className="dialog-panel">
|
36
29
|
<header>
|
37
30
|
{icon ? <MenuIcon icon={icon} /> : null}
|
38
31
|
<Text>{title}</Text>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { Fragment, useContext } from 'react';
|
1
|
+
import React, { Fragment, useContext, useState } from 'react';
|
2
2
|
import { Uploader } from './Uploader'
|
3
3
|
import { Button, Text } from '../../html';
|
4
4
|
import { SiteContext, Dialog } from '../../site';
|
@@ -6,7 +6,7 @@ import { SiteContext, Dialog } from '../../site';
|
|
6
6
|
/**
|
7
7
|
* Upload Dialog
|
8
8
|
*/
|
9
|
-
export const UploadDialog = ({
|
9
|
+
export const UploadDialog = ({ label, target, accept, onSuccess, onComplete, onClose }) => {
|
10
10
|
|
11
11
|
const site = useContext(SiteContext);
|
12
12
|
|
@@ -33,9 +33,8 @@ export const UploadDialog = ({ className, label, target, accept, onSuccess, onCo
|
|
33
33
|
|
34
34
|
const title = <Text use="headline6">{label}</Text>
|
35
35
|
return (
|
36
|
-
<Dialog
|
36
|
+
<Dialog title={title} open={true} onAction={onAction} actions={actions}>
|
37
37
|
<Uploader label={label} accept={accept} target={target} onSuccess={success} onComplete={complete} />
|
38
|
-
{children}
|
39
38
|
</Dialog>
|
40
39
|
)
|
41
40
|
}
|