ywana-core8 0.0.384 → 0.0.387
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 +9 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +3 -14
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +9 -22
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +9 -22
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/site/dialog.css +3 -14
- package/src/site/dialog.js +17 -24
- package/src/site/site.test.js +10 -0
- package/src/widgets/upload/UploadArea.js +2 -3
package/package.json
CHANGED
package/src/site/dialog.css
CHANGED
@@ -16,24 +16,12 @@
|
|
16
16
|
z-index: 1000;
|
17
17
|
}
|
18
18
|
|
19
|
-
.dialog {
|
20
|
-
border-radius: 4px;
|
21
|
-
position: absolute;
|
22
|
-
top: 0;
|
23
|
-
right: 0;
|
24
|
-
bottom: 0;
|
25
|
-
left: 0;
|
26
|
-
z-index: 110;
|
27
|
-
display: flex;
|
28
|
-
align-items: center;
|
29
|
-
justify-content: center;
|
30
|
-
}
|
31
|
-
|
32
|
-
.dialog.prompt {
|
19
|
+
.dialog-panel.prompt {
|
33
20
|
z-index: 1010;
|
34
21
|
}
|
35
22
|
|
36
23
|
.dialog-panel {
|
24
|
+
z-index: 110;
|
37
25
|
min-width: 500px;
|
38
26
|
max-width: 90%;
|
39
27
|
top: 0;
|
@@ -47,6 +35,7 @@
|
|
47
35
|
border-radius: 5px;
|
48
36
|
box-shadow: var(--shadow1);
|
49
37
|
overflow: auto;
|
38
|
+
border: solid 1px var(--divider-color);
|
50
39
|
}
|
51
40
|
|
52
41
|
.dialog-panel > header {
|
package/src/site/dialog.js
CHANGED
@@ -11,38 +11,31 @@ 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} = props
|
15
|
-
|
14
|
+
const { icon, title = "Dialog", children, onAction, actions, className } = props
|
15
|
+
|
16
16
|
function close() {
|
17
|
-
if (className === "prompt") {
|
17
|
+
if (className === "prompt") {
|
18
18
|
site.closePromptDialog()
|
19
19
|
} else {
|
20
20
|
site.closeDialog()
|
21
21
|
}
|
22
22
|
}
|
23
|
-
|
24
|
-
function prevent(e) {
|
25
|
-
e.preventDefault()
|
26
|
-
e.stopPropagation()
|
27
|
-
}
|
28
|
-
|
23
|
+
|
29
24
|
return (
|
30
25
|
<Fragment>
|
31
|
-
<div className={`overlay ${className}`} />
|
32
|
-
<
|
33
|
-
<
|
34
|
-
<
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
</div>
|
45
|
-
</div>
|
26
|
+
<div className={`overlay ${className}`} onMouseDown={close} />
|
27
|
+
<dialog className="dialog-panel ${className}">
|
28
|
+
<header>
|
29
|
+
{icon ? <MenuIcon icon={icon} /> : null}
|
30
|
+
<Text>{title}</Text>
|
31
|
+
</header>
|
32
|
+
<main>
|
33
|
+
{children}
|
34
|
+
</main>
|
35
|
+
<footer>
|
36
|
+
{actions}
|
37
|
+
</footer>
|
38
|
+
</dialog>
|
46
39
|
</Fragment>
|
47
40
|
)
|
48
41
|
}
|
package/src/site/site.test.js
CHANGED
@@ -6,6 +6,8 @@ import './site.css'
|
|
6
6
|
import './page.css'
|
7
7
|
import { Dialog } from './dialog'
|
8
8
|
import { Button, DropDown, TextField, TextArea } from '../html'
|
9
|
+
import { UploadDialog } from '../widgets/upload/UploadDialog'
|
10
|
+
import { Uploader } from '../widgets/upload/Uploader'
|
9
11
|
|
10
12
|
const SiteTest = (prop) => {
|
11
13
|
|
@@ -32,6 +34,10 @@ const Page1 = (props) => {
|
|
32
34
|
site.notify({ title: "Notification 1", body: "Lorem ipsum dolor sit amet" })
|
33
35
|
}, [])
|
34
36
|
|
37
|
+
function upload() {
|
38
|
+
site.openDialog(<UploadDialog target="https://maso.developxp.com/kiosk/api/upload" />)
|
39
|
+
}
|
40
|
+
|
35
41
|
function change(id, value) {
|
36
42
|
const next = Object.assign({}, form, { [id]: value })
|
37
43
|
setForm(next)
|
@@ -49,6 +55,10 @@ const Page1 = (props) => {
|
|
49
55
|
<Fragment>
|
50
56
|
<header>Page 1</header>
|
51
57
|
<main>
|
58
|
+
|
59
|
+
<Uploader icon="cloud_upload" target="https://maso.developxp.com/kiosk/api/upload" />
|
60
|
+
|
61
|
+
<Button label="Upload" action={upload} />
|
52
62
|
<TextField id="name" label="Name" value={form.name} onChange={change} />
|
53
63
|
<DropDown id="gender1" label="Dropdown 1" value={form.gender1} onChange={change} options={options} predictive={true} />
|
54
64
|
<DropDown id="gender2" label="Dropdown 2" value={form.gender2} onChange={change} options={options} predictive={false} />
|
@@ -9,12 +9,11 @@ export const UploadArea = (props) => {
|
|
9
9
|
const { icon, label = 'Add file or drop file here...' } = props
|
10
10
|
const areaElement = useRef()
|
11
11
|
const [drag, setDrag] = useState(false)
|
12
|
+
const { resumable } = props
|
12
13
|
|
13
14
|
useEffect(() => {
|
14
|
-
const { resumable } = props
|
15
15
|
if (resumable && areaElement) {
|
16
16
|
resumable.assignDrop(areaElement.current)
|
17
|
-
resumable.assignBrowse(areaElement.current)
|
18
17
|
}
|
19
18
|
}, [])
|
20
19
|
|
@@ -34,7 +33,7 @@ export const UploadArea = (props) => {
|
|
34
33
|
onDragLeave={onDragLeave}
|
35
34
|
ref={areaElement}
|
36
35
|
>
|
37
|
-
<
|
36
|
+
<UploadIcon resumable={resumable}/>
|
38
37
|
<label>{label}</label>
|
39
38
|
</div>
|
40
39
|
)
|