ywana-core8 0.1.43 → 0.1.45
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 +40 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +6 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +40 -13
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +40 -13
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/widgets/login/dictionary.js +10 -0
- package/src/widgets/upload/Upload.test.js +1 -1
- package/src/widgets/upload/UploadArea.css +6 -0
- package/src/widgets/upload/UploadArea.js +9 -6
- package/src/widgets/upload/UploadDialog.js +2 -2
- package/src/widgets/upload/Uploader.js +4 -4
package/package.json
CHANGED
@@ -10,6 +10,16 @@ export const LOGIN_DICTIONARY = {
|
|
10
10
|
fr: 'Nouveau mot de passe'
|
11
11
|
},
|
12
12
|
|
13
|
+
'Current Password': {
|
14
|
+
en: 'Current Password',
|
15
|
+
es: 'Contraseña Actual',
|
16
|
+
de: 'Aktuelles Passwort',
|
17
|
+
pt: 'Senha Atual',
|
18
|
+
ca: 'Contrasenya Actual',
|
19
|
+
it: 'Password Corrente',
|
20
|
+
fr: 'Mot de passe actuel'
|
21
|
+
},
|
22
|
+
|
13
23
|
'Confirm New Password': {
|
14
24
|
en: 'Confirm New Password',
|
15
25
|
es: 'Confirmar Nueva Contraseña',
|
@@ -7,7 +7,7 @@ import { UPLOAD_STATES } from './UploadStates'
|
|
7
7
|
const UploadAreaTest = (props) => {
|
8
8
|
return (
|
9
9
|
<div style={{ padding: "1rem" }}>
|
10
|
-
<UploadArea icon="cloud_upload" label="UploadArea Test" />
|
10
|
+
<UploadArea icon="cloud_upload" label="UploadArea Test" disabled={true} />
|
11
11
|
</div>
|
12
12
|
)
|
13
13
|
}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react'
|
2
2
|
import { Icon } from '../../html'
|
3
|
-
|
3
|
+
import './UploadArea.css'
|
4
4
|
/**
|
5
5
|
* Upload Area
|
6
6
|
*/
|
7
7
|
export const UploadArea = (props) => {
|
8
8
|
|
9
|
-
const { icon, label = 'Add file or drop file here...' } = props
|
9
|
+
const { icon, label = 'Add file or drop file here...', disabled= false } = props
|
10
10
|
const areaElement = useRef()
|
11
11
|
const [drag, setDrag] = useState(false)
|
12
12
|
const { resumable } = props
|
@@ -18,22 +18,25 @@ export const UploadArea = (props) => {
|
|
18
18
|
}, [])
|
19
19
|
|
20
20
|
const onDragOver = () => {
|
21
|
+
if (disabled) return
|
21
22
|
setDrag(true)
|
22
23
|
}
|
23
24
|
|
24
25
|
const onDragLeave = () => {
|
26
|
+
if (disabled) return
|
25
27
|
setDrag(false)
|
26
28
|
}
|
27
29
|
|
28
30
|
const dragging = drag === true ? 'drag-over' : ''
|
31
|
+
const disabledStyle = disabled === true ? 'disabled' : ''
|
29
32
|
|
30
33
|
return (
|
31
|
-
<div className={`upload-area6 ${dragging}`}
|
34
|
+
<div className={`upload-area6 ${dragging} ${disabledStyle}`}
|
32
35
|
onDragOver={onDragOver}
|
33
36
|
onDragLeave={onDragLeave}
|
34
37
|
ref={areaElement}
|
35
38
|
>
|
36
|
-
<UploadIcon resumable={resumable}/>
|
39
|
+
<UploadIcon icon={icon} resumable={resumable} disabled={disabled}/>
|
37
40
|
<label>{label}</label>
|
38
41
|
</div>
|
39
42
|
)
|
@@ -42,7 +45,7 @@ export const UploadArea = (props) => {
|
|
42
45
|
/**
|
43
46
|
* Upload Icon
|
44
47
|
*/
|
45
|
-
export const UploadIcon = ({ icon = "folder_open", resumable }) => {
|
48
|
+
export const UploadIcon = ({ icon = "folder_open", resumable, disabled=false }) => {
|
46
49
|
|
47
50
|
const iconElement = useRef()
|
48
51
|
|
@@ -54,7 +57,7 @@ export const UploadIcon = ({ icon = "folder_open", resumable }) => {
|
|
54
57
|
|
55
58
|
return (
|
56
59
|
<div className="upload-icon" ref={iconElement}>
|
57
|
-
<Icon icon={icon} clickable/>
|
60
|
+
<Icon icon={icon} clickable disabled={disabled}/>
|
58
61
|
</div>
|
59
62
|
)
|
60
63
|
}
|
@@ -6,7 +6,7 @@ import { SiteContext, Dialog } from '../../site';
|
|
6
6
|
/**
|
7
7
|
* Upload Dialog
|
8
8
|
*/
|
9
|
-
export const UploadDialog = ({ label, target, accept, onSuccess, onComplete, onClose, children, className, disabled, onCanClose, overlayCanClose = true }) => {
|
9
|
+
export const UploadDialog = ({ label, target, accept, onSuccess, onComplete, onClose, children, className, disabled=false, onCanClose, overlayCanClose = true }) => {
|
10
10
|
|
11
11
|
const site = useContext(SiteContext);
|
12
12
|
|
@@ -38,7 +38,7 @@ export const UploadDialog = ({ label, target, accept, onSuccess, onComplete, onC
|
|
38
38
|
const title = <Text use="headline6">{label}</Text>
|
39
39
|
return (
|
40
40
|
<Dialog title={title} open={true} onAction={onAction} actions={actions} className={className} overlayCanClose={overlayCanClose}>
|
41
|
-
|
41
|
+
<Uploader label={label} accept={accept} target={target} onSuccess={success} onComplete={complete} disabled={disabled} />
|
42
42
|
{children}
|
43
43
|
</Dialog>
|
44
44
|
)
|
@@ -9,7 +9,7 @@ import './Uploader.css'
|
|
9
9
|
/**
|
10
10
|
* Uploader
|
11
11
|
*/
|
12
|
-
export const Uploader = ({ icon, label, view="area", target, accept, simultaneousUploads = 1, className, onProgress, onSuccess, onError, onComplete }) => {
|
12
|
+
export const Uploader = ({ icon, label, view="area", target, accept, simultaneousUploads = 1, className, onProgress, onSuccess, onError, onComplete, disabled = false }) => {
|
13
13
|
|
14
14
|
const resumable = useMemo(() => {
|
15
15
|
const config = {
|
@@ -65,9 +65,9 @@ export const Uploader = ({ icon, label, view="area", target, accept, simultaneou
|
|
65
65
|
|
66
66
|
function renderView() {
|
67
67
|
switch (view) {
|
68
|
-
case "area": return <UploadArea resumable={resumable} icon={icon} label={label} />
|
69
|
-
case "icon": return <UploadIcon resumable={resumable} icon={icon} />
|
70
|
-
default: return <UploadArea resumable={resumable} icon={icon} label={label} />
|
68
|
+
case "area": return <UploadArea resumable={resumable} icon={icon} label={label} disabled={disabled} />
|
69
|
+
case "icon": return <UploadIcon resumable={resumable} icon={icon} disabled={disabled} />
|
70
|
+
default: return <UploadArea resumable={resumable} icon={icon} label={label} disabled={disabled} />
|
71
71
|
}
|
72
72
|
}
|
73
73
|
|