ywana-core8 0.0.277 → 0.0.280
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 +54 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +41 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +54 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +54 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/site/index.js +2 -1
- package/src/site/view.css +41 -0
- package/src/site/view.js +35 -0
- package/src/site/view.test.js +41 -0
- package/src/widgets/upload/Upload.test.js +2 -2
- package/src/widgets/upload/UploadArea.js +5 -2
- package/src/widgets/upload/UploadDialog.js +1 -1
- package/src/widgets/upload/Uploader.js +1 -1
package/package.json
CHANGED
package/src/site/index.js
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
.view {
|
2
|
+
flex: 1;
|
3
|
+
border: solid 1px rgb(200,200,200);;
|
4
|
+
display: flex;
|
5
|
+
flex-direction: column;
|
6
|
+
}
|
7
|
+
|
8
|
+
.view>header {
|
9
|
+
width: 100%;
|
10
|
+
display: flex;
|
11
|
+
align-items: center;
|
12
|
+
background-color: rgb(200,200,200);
|
13
|
+
}
|
14
|
+
|
15
|
+
.view>header>label {
|
16
|
+
flex: 1;
|
17
|
+
}
|
18
|
+
|
19
|
+
.view>nav {
|
20
|
+
display: flex;
|
21
|
+
flex-direction: ;
|
22
|
+
align-items: center;
|
23
|
+
justify-content: flex-end;
|
24
|
+
background-color: rgb(230,230,230);
|
25
|
+
}
|
26
|
+
|
27
|
+
.view>nav>* {
|
28
|
+
border-radius: 0px !important;
|
29
|
+
}
|
30
|
+
|
31
|
+
.view>main {
|
32
|
+
flex: 1;
|
33
|
+
height: 100%;
|
34
|
+
}
|
35
|
+
|
36
|
+
.view>footer {
|
37
|
+
width: 100%;
|
38
|
+
display: flex;
|
39
|
+
align-items: center;
|
40
|
+
background-color: rgb(230,230,230);
|
41
|
+
}
|
package/src/site/view.js
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import { Icon, MenuIcon } from '../html'
|
3
|
+
import './view.css'
|
4
|
+
|
5
|
+
/**
|
6
|
+
* View
|
7
|
+
*/
|
8
|
+
export const View = (props) => {
|
9
|
+
|
10
|
+
const { icon, title, toolbar, menu, info, onClose, canCollapse = false, children } = props
|
11
|
+
const [open, setOpen] = useState(true)
|
12
|
+
|
13
|
+
function toggle() {
|
14
|
+
setOpen(!open)
|
15
|
+
}
|
16
|
+
|
17
|
+
function close() {
|
18
|
+
if (onClose) onClose()
|
19
|
+
}
|
20
|
+
|
21
|
+
return (
|
22
|
+
<section className='view'>
|
23
|
+
<header>
|
24
|
+
{canCollapse ? <Icon icon="expand_more" size="small" clickable action={toggle} /> : null}
|
25
|
+
{icon ? <Icon icon={icon} size="small" /> : null}
|
26
|
+
{title ? <label>{title}</label> : null}
|
27
|
+
{menu ? <MenuIcon align="alignRight">{menu}</MenuIcon> : null}
|
28
|
+
{onClose ? <Icon icon="close" size="small" clickable action={close} /> : null}
|
29
|
+
</header>
|
30
|
+
{toolbar ? <nav>{toolbar}</nav> : null}
|
31
|
+
{open ? <main>{children}</main> : null}
|
32
|
+
{info ? <footer>{info}</footer> : null}
|
33
|
+
</section>
|
34
|
+
)
|
35
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import { Icon, MenuItem, Chip } from '../html'
|
3
|
+
import { View } from './view'
|
4
|
+
|
5
|
+
const ViewTest = (prop) => {
|
6
|
+
|
7
|
+
function close() {
|
8
|
+
alert('close view')
|
9
|
+
}
|
10
|
+
|
11
|
+
const menu = [
|
12
|
+
<MenuItem key="option1" label="option1" action={() => alert('1')} />
|
13
|
+
]
|
14
|
+
|
15
|
+
const toolbar = [
|
16
|
+
<Icon key="action1" icon="person" clickable size="small"/>,
|
17
|
+
<Icon key="action2 " icon="people" clickable size="small"/>
|
18
|
+
]
|
19
|
+
|
20
|
+
const info = [
|
21
|
+
<Chip label="Info1" />,
|
22
|
+
<Chip label="Info2" />,
|
23
|
+
<Chip label="Info3" />
|
24
|
+
]
|
25
|
+
|
26
|
+
return (
|
27
|
+
<div style={{ padding: "1rem", height: "20rem" }}>
|
28
|
+
<View
|
29
|
+
canCollapse={true}
|
30
|
+
icon="star"
|
31
|
+
title="Title"
|
32
|
+
menu={menu}
|
33
|
+
onClose={close}
|
34
|
+
toolbar={toolbar}
|
35
|
+
info={info}
|
36
|
+
>
|
37
|
+
hola
|
38
|
+
</View>
|
39
|
+
</div>
|
40
|
+
)
|
41
|
+
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { UploadArea } from './UploadArea'
|
3
|
-
import {
|
4
|
-
import { Uploader, UPLOAD_STATES } from './Uploader'
|
3
|
+
import { Uploader } from './Uploader'
|
5
4
|
import { UploadProgress } from './UploadProgress'
|
5
|
+
import { UPLOAD_STATES } from './UploadStates'
|
6
6
|
|
7
7
|
const UploadAreaTest = (props) => {
|
8
8
|
return (
|
@@ -45,8 +45,11 @@ const UploadIcon = ({ icon = "folder_open", resumable }) => {
|
|
45
45
|
const iconElement = useRef()
|
46
46
|
|
47
47
|
useEffect(() => {
|
48
|
-
if (resumable && iconElement
|
49
|
-
|
48
|
+
if (resumable && iconElement.current) {
|
49
|
+
resumable.assignBrowse(iconElement.current)
|
50
|
+
console.log('uploadicon')
|
51
|
+
}
|
52
|
+
}, [iconElement])
|
50
53
|
|
51
54
|
return (
|
52
55
|
<div className="upload-icon" ref={iconElement}>
|
@@ -23,7 +23,7 @@ export const UploadDialog = ({ label, target, accept, onSuccess, onClose }) => {
|
|
23
23
|
|
24
24
|
const actions = (
|
25
25
|
<Fragment>
|
26
|
-
<Button label="
|
26
|
+
<Button label="CERRAR" action={() => onAction("CLOSE")} />
|
27
27
|
</Fragment>
|
28
28
|
)
|
29
29
|
|
@@ -2,8 +2,8 @@ import React, { useState, useMemo } from 'react'
|
|
2
2
|
import ResumableJS from 'resumablejs'
|
3
3
|
import { UploadArea } from "./UploadArea";
|
4
4
|
import { UploadProgress } from './UploadProgress';
|
5
|
-
import './Uploader.css'
|
6
5
|
import { UPLOAD_STATES } from './UploadStates';
|
6
|
+
import './Uploader.css'
|
7
7
|
|
8
8
|
|
9
9
|
/**
|