ywana-core8 0.0.272 → 0.0.275
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 +319 -386
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +96 -59
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +317 -383
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +322 -389
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/tooltip-test.js +13 -0
- package/src/html/tooltip.css +16 -1
- package/src/html/tooltip.js +7 -4
- package/src/index.js +0 -1
- package/src/widgets/index.js +2 -1
- package/src/widgets/upload/Upload.test.js +2 -5
- package/src/widgets/upload/UploadDialog.js +6 -11
- package/src/widgets/upload/UploadFile.js +2 -2
- package/src/widgets/upload/UploadProgress.js +2 -3
- package/src/widgets/upload/UploadStates.js +4 -0
- package/src/widgets/upload/Uploader.js +2 -4
- package/src/widgets/upload/index.js +1 -1
- /package/{src → src_old}/upload/UploadArea.js +0 -0
- /package/{src → src_old}/upload/UploadDialog.js +0 -0
- /package/{src → src_old}/upload/UploadFile.js +0 -0
- /package/{src → src_old}/upload/index.js +0 -0
- /package/{src → src_old}/upload/uploader.css +0 -0
- /package/{src → src_old}/upload/uploader.js +0 -0
package/package.json
CHANGED
package/src/html/tooltip.css
CHANGED
@@ -1,3 +1,18 @@
|
|
1
1
|
.tooltip {
|
2
|
-
|
2
|
+
position: relative;
|
3
|
+
cursor: pointer;
|
4
|
+
}
|
5
|
+
|
6
|
+
.tooltip-text {
|
7
|
+
display: none;
|
8
|
+
}
|
9
|
+
|
10
|
+
.tooltip:hover .tooltip-text {
|
11
|
+
display: block;
|
12
|
+
position: absolute;
|
13
|
+
border: solid 1px var(--divider-color);
|
14
|
+
background-color: var(--text-color-light);
|
15
|
+
color: var(--paper-color);
|
16
|
+
padding: .5rem;
|
17
|
+
border-radius: 4px;
|
3
18
|
}
|
package/src/html/tooltip.js
CHANGED
@@ -6,12 +6,15 @@ import './tooltip.css'
|
|
6
6
|
*/
|
7
7
|
export const Tooltip = (props) => {
|
8
8
|
|
9
|
-
const { text = "..." } = props
|
9
|
+
const { text = "...", top = "1rem", left = "1rem" } = props
|
10
|
+
|
11
|
+
const style = { top, left }
|
10
12
|
|
11
13
|
return (
|
12
|
-
<
|
13
|
-
<
|
14
|
-
|
14
|
+
<div className="tooltip" >
|
15
|
+
<span className="tooltip-text" style={style}>{text}</span>
|
16
|
+
{props.children}
|
17
|
+
</div>
|
15
18
|
)
|
16
19
|
|
17
20
|
}
|
package/src/index.js
CHANGED
@@ -6,6 +6,5 @@ export * from './html'
|
|
6
6
|
export * from './widgets'
|
7
7
|
export * from './site'
|
8
8
|
export * from './domain'
|
9
|
-
export * from './upload'
|
10
9
|
|
11
10
|
export const isFunction = value => value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
|
package/src/widgets/index.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { UploadArea } from './UploadArea'
|
3
|
+
import { UploadDialog } from './UploadDialog'
|
3
4
|
import { Uploader, UPLOAD_STATES } from './Uploader'
|
4
5
|
import { UploadProgress } from './UploadProgress'
|
5
6
|
|
6
7
|
const UploadAreaTest = (props) => {
|
7
|
-
|
8
8
|
return (
|
9
9
|
<div style={{ padding: "1rem" }}>
|
10
10
|
<UploadArea icon="cloud_upload" label="UploadArea Test" />
|
@@ -13,23 +13,20 @@ const UploadAreaTest = (props) => {
|
|
13
13
|
}
|
14
14
|
|
15
15
|
const UploadProgressTest = (prop) => {
|
16
|
-
|
17
16
|
const files = [
|
18
17
|
{ icon: "image", fileName: "fileName1", uploadState: UPLOAD_STATES.RUNNING, progress: () => { return 50 } },
|
19
18
|
{ icon: "image", fileName: "fileName4", uploadState: UPLOAD_STATES.SUCCESS, progress: () => { return 70 } },
|
20
19
|
{ icon: "description", fileName: "fileName2", uploadState: UPLOAD_STATES.ERROR, progress: () => { return 70 }, uploadError: "Unknow error" },
|
21
20
|
]
|
22
|
-
|
23
21
|
return (
|
24
22
|
<UploadProgress files={files} />
|
25
23
|
)
|
26
24
|
}
|
27
25
|
|
28
26
|
const UploaderTest = (prop) => {
|
29
|
-
|
30
27
|
return (
|
31
28
|
<div style={{ padding: "1rem" }}>
|
32
29
|
<Uploader target="https://maso.developxp.com/kiosk/api/upload" />
|
33
30
|
</div>
|
34
31
|
)
|
35
|
-
}
|
32
|
+
}
|
@@ -1,25 +1,21 @@
|
|
1
1
|
import React, { Fragment, useContext, useState } from 'react';
|
2
2
|
import { Uploader } from './Uploader'
|
3
|
-
import { Button, Text } from '
|
4
|
-
import { SiteContext, Dialog } from '
|
5
|
-
import { UploadFile } from './UploadFile';
|
3
|
+
import { Button, Text } from '../../html';
|
4
|
+
import { SiteContext, Dialog } from '../../site';
|
6
5
|
|
7
6
|
/**
|
8
7
|
* Upload Dialog
|
9
8
|
*/
|
10
|
-
export const UploadDialog = ({ label, target, accept, onSuccess,
|
9
|
+
export const UploadDialog = ({ label, target, accept, onSuccess, onClose }) => {
|
11
10
|
|
12
11
|
const site = useContext(SiteContext);
|
13
|
-
const [file, setFile] = useState();
|
14
|
-
const [errors, setErrors] = useState([])
|
15
12
|
|
16
13
|
function onComplete(uploads) {
|
17
|
-
|
18
|
-
if (onSuccess) onSuccess(uploads[0])
|
14
|
+
if (onSuccess) onSuccess(uploads)
|
19
15
|
}
|
20
16
|
|
21
17
|
function onAction(action) {
|
22
|
-
if (action === 'CLOSE'
|
18
|
+
if (action === 'CLOSE') {
|
23
19
|
site.closeDialog();
|
24
20
|
onClose()
|
25
21
|
}
|
@@ -34,8 +30,7 @@ export const UploadDialog = ({ label, target, accept, onSuccess, onOK, onError,
|
|
34
30
|
const title = <Text use="headline6">{label}</Text>
|
35
31
|
return (
|
36
32
|
<Dialog title={title} open={true} onAction={onAction} actions={actions}>
|
37
|
-
|
38
|
-
{errors.map(error => <Text use="overline" tag="div" className="error">{error}</Text>)}
|
33
|
+
<Uploader label={label} accept={accept} target={target} onComplete={onComplete} />
|
39
34
|
</Dialog>
|
40
35
|
)
|
41
36
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { Fragment } from 'react'
|
2
|
-
import { Icon,
|
3
|
-
import { UPLOAD_STATES } from './
|
2
|
+
import { Icon, LinearProgress } from '../../html'
|
3
|
+
import { UPLOAD_STATES } from './UploadStates'
|
4
4
|
import './Uploader.css'
|
5
5
|
|
6
6
|
/**
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
import { UPLOAD_STATES } from './Uploader';
|
3
2
|
import { UploadFile } from './UploadFile';
|
4
3
|
|
5
|
-
export const UploadProgress = ({ files = []
|
4
|
+
export const UploadProgress = ({ files = [] }) => {
|
6
5
|
|
7
6
|
return (
|
8
7
|
<div>
|
9
8
|
{files.map((file) => {
|
10
9
|
const f = {
|
11
|
-
icon: "
|
10
|
+
icon: "description",
|
12
11
|
name: file.fileName,
|
13
12
|
progress: file.progress() * 100,
|
14
13
|
state: file.uploadState,
|
@@ -3,10 +3,8 @@ import ResumableJS from 'resumablejs'
|
|
3
3
|
import { UploadArea } from "./UploadArea";
|
4
4
|
import { UploadProgress } from './UploadProgress';
|
5
5
|
import './Uploader.css'
|
6
|
+
import { UPLOAD_STATES } from './UploadStates';
|
6
7
|
|
7
|
-
export const UPLOAD_STATES = {
|
8
|
-
IDLE: 0, RUNNING: 1, SUCCESS: 2, ERROR: 3, COMPLETED: 4
|
9
|
-
}
|
10
8
|
|
11
9
|
/**
|
12
10
|
* Uploader
|
@@ -67,7 +65,7 @@ export const Uploader = ({ label, target, accept, simultaneousUploads = 1, class
|
|
67
65
|
|
68
66
|
return (
|
69
67
|
<div className={`uploader ${className}`}>
|
70
|
-
{state === UPLOAD_STATES.IDLE ? <UploadArea resumable={resumable} label={label} /> : <UploadProgress files={files}
|
68
|
+
{state === UPLOAD_STATES.IDLE ? <UploadArea resumable={resumable} label={label} /> : <UploadProgress files={files} /> }
|
71
69
|
</div>
|
72
70
|
)
|
73
71
|
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|