ywana-core8 0.0.327 → 0.0.330

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.330",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -10,15 +10,17 @@ import './dialog.css'
10
10
  */
11
11
  export const Dialog = (props) => {
12
12
  const site = useContext(SiteContext)
13
- const { icon, title = "Dialog", children, onAction, actions, className } = props
13
+ const { icon, title = "Dialog", children, onAction, actions, className, eventPropagation = false } = props
14
14
 
15
15
  function close() {
16
16
  site.closeDialog()
17
17
  }
18
18
 
19
19
  function prevent(e) {
20
- e.preventDefault()
21
- e.stopPropagation()
20
+ if (!eventPropagation) {
21
+ e.preventDefault()
22
+ e.stopPropagation()
23
+ }
22
24
  }
23
25
 
24
26
  return (
@@ -42,7 +42,8 @@ export const ResetPasswordBox = ({ logo, title, children, onOK, onClose }) => {
42
42
  { children }
43
43
  </header>
44
44
  <main>
45
- <Text use="headline6">Change Password</Text>
45
+ <Text use="headline6">Change Password</Text>
46
+ <TextField label={tx(userLabel)} value={user} onChange={changeUser} onEnter={ok} outlined />
46
47
  <TextField id="password1" outlined icon="lock" type="password" label="New Password" lapse={100} onChange={changeField} onEnter={ok}/>
47
48
  <TextField id="password2" outlined icon="lock" type="password" label="Confirm New Password" lapse={100} onChange={changeField} onEnter={ok}/>
48
49
  { error ? <div className="error">{error}</div> : null}
@@ -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
  }
@@ -29,7 +29,7 @@ export const UploadDialog = ({ label, target, accept, onSuccess, onClose }) => {
29
29
 
30
30
  const title = <Text use="headline6">{label}</Text>
31
31
  return (
32
- <Dialog title={title} open={true} onAction={onAction} actions={actions}>
32
+ <Dialog title={title} open={true} onAction={onAction} actions={actions} eventPropagation={true}>
33
33
  <Uploader label={label} accept={accept} target={target} onComplete={onComplete} />
34
34
  </Dialog>
35
35
  )
@@ -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
  }