ywana-core8 0.0.327 → 0.0.328

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.327",
3
+ "version": "0.0.328",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -26,7 +26,7 @@ const UploadProgressTest = (prop) => {
26
26
  const UploaderTest = (prop) => {
27
27
  return (
28
28
  <div style={{ padding: "1rem" }}>
29
- <Uploader target="https://maso.developxp.com/kiosk/api/upload" />
29
+ <Uploader icon="cloud_upload" target="https://maso.developxp.com/kiosk/api/upload" />
30
30
  </div>
31
31
  )
32
32
  }
@@ -12,7 +12,10 @@ export const UploadArea = (props) => {
12
12
 
13
13
  useEffect(() => {
14
14
  const { resumable } = props
15
- if (resumable && areaElement) resumable.assignDrop(areaElement.current)
15
+ if (resumable && areaElement) {
16
+ resumable.assignDrop(areaElement.current)
17
+ resumable.assignBrowse(areaElement.current)
18
+ }
16
19
  }, [])
17
20
 
18
21
  const onDragOver = () => {
@@ -31,7 +34,7 @@ export const UploadArea = (props) => {
31
34
  onDragLeave={onDragLeave}
32
35
  ref={areaElement}
33
36
  >
34
- <UploadIcon icon={icon} resumable={props.resumable} />
37
+ <Icon icon={icon} clickable eventPropagation={false}/>
35
38
  <label>{label}</label>
36
39
  </div>
37
40
  )
@@ -40,20 +43,20 @@ export const UploadArea = (props) => {
40
43
  /**
41
44
  * Upload Icon
42
45
  */
43
- const UploadIcon = ({ icon = "folder_open", resumable }) => {
46
+ export const UploadIcon = ({ icon = "folder_open", resumable }) => {
44
47
 
45
48
  const iconElement = useRef()
46
49
 
47
50
  useEffect(() => {
48
51
  if (resumable && iconElement.current) {
49
- console.log('UploadIcon.effect', resumable, iconElement.current)
50
52
  resumable.assignBrowse(iconElement.current)
53
+ console.log('uploadicon')
51
54
  }
52
55
  }, [iconElement])
53
56
 
54
57
  return (
55
58
  <div className="upload-icon" ref={iconElement}>
56
- <Icon icon={icon} clickable eventPropagation={true}/>
59
+ <Icon icon={icon} clickable/>
57
60
  </div>
58
61
  )
59
62
  }
@@ -9,7 +9,7 @@ import './Uploader.css'
9
9
  /**
10
10
  * Uploader
11
11
  */
12
- export const Uploader = ({ label, target, accept, simultaneousUploads = 1, className, onProgress, onSuccess, onError, onComplete }) => {
12
+ export const Uploader = ({ icon, label, target, accept, simultaneousUploads = 1, className, onProgress, onSuccess, onError, onComplete }) => {
13
13
 
14
14
  const resumable = useMemo(() => {
15
15
  const config = {
@@ -65,7 +65,7 @@ export const Uploader = ({ label, target, accept, simultaneousUploads = 1, class
65
65
 
66
66
  return (
67
67
  <div className={`uploader ${className}`}>
68
- {state === UPLOAD_STATES.IDLE ? <UploadArea resumable={resumable} label={label} /> : <UploadProgress files={files} /> }
68
+ {state === UPLOAD_STATES.IDLE ? <UploadArea resumable={resumable} icon={icon} label={label} /> : <UploadProgress files={files} /> }
69
69
  </div>
70
70
  )
71
71
  }