ywana-core8 0.0.385 → 0.0.388

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.385",
3
+ "version": "0.0.388",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -16,24 +16,12 @@
16
16
  z-index: 1000;
17
17
  }
18
18
 
19
- .dialog {
20
- border-radius: 4px;
21
- position: absolute;
22
- top: 0;
23
- right: 0;
24
- bottom: 0;
25
- left: 0;
26
- z-index: 110;
27
- display: flex;
28
- align-items: center;
29
- justify-content: center;
30
- }
31
-
32
- .dialog.prompt {
19
+ .dialog-panel.prompt {
33
20
  z-index: 1010;
34
21
  }
35
22
 
36
23
  .dialog-panel {
24
+ z-index: 110;
37
25
  min-width: 500px;
38
26
  max-width: 90%;
39
27
  top: 0;
@@ -47,6 +35,7 @@
47
35
  border-radius: 5px;
48
36
  box-shadow: var(--shadow1);
49
37
  overflow: auto;
38
+ border: solid 1px var(--divider-color);
50
39
  }
51
40
 
52
41
  .dialog-panel > header {
@@ -11,38 +11,31 @@ import './dialog.css'
11
11
  export const Dialog = (props) => {
12
12
 
13
13
  const site = useContext(SiteContext)
14
- const { icon, title = "Dialog", children, onAction, actions, className} = props
15
-
14
+ const { icon, title = "Dialog", children, onAction, actions, className } = props
15
+
16
16
  function close() {
17
- if (className === "prompt") {
17
+ if (className === "prompt") {
18
18
  site.closePromptDialog()
19
19
  } else {
20
20
  site.closeDialog()
21
21
  }
22
22
  }
23
-
24
- function prevent(e) {
25
- e.preventDefault()
26
- e.stopPropagation()
27
- }
28
-
23
+
29
24
  return (
30
25
  <Fragment>
31
- <div className={`overlay ${className}`} />
32
- <div className={`dialog ${className}`} onClick={close}>
33
- <div className="dialog-panel" onClick={prevent}>
34
- <header>
35
- {icon ? <MenuIcon icon={icon} /> : null}
36
- <Text>{title}</Text>
37
- </header>
38
- <main>
39
- {children}
40
- </main>
41
- <footer>
42
- {actions}
43
- </footer>
44
- </div>
45
- </div>
26
+ <div className={`overlay ${className}`} onMouseDown={close} />
27
+ <dialog className="dialog-panel ${className}">
28
+ <header>
29
+ {icon ? <MenuIcon icon={icon} /> : null}
30
+ <Text>{title}</Text>
31
+ </header>
32
+ <main>
33
+ {children}
34
+ </main>
35
+ <footer>
36
+ {actions}
37
+ </footer>
38
+ </dialog>
46
39
  </Fragment>
47
40
  )
48
41
  }
@@ -6,6 +6,8 @@ import './site.css'
6
6
  import './page.css'
7
7
  import { Dialog } from './dialog'
8
8
  import { Button, DropDown, TextField, TextArea } from '../html'
9
+ import { UploadDialog } from '../widgets/upload/UploadDialog'
10
+ import { Uploader } from '../widgets/upload/Uploader'
9
11
 
10
12
  const SiteTest = (prop) => {
11
13
 
@@ -32,6 +34,10 @@ const Page1 = (props) => {
32
34
  site.notify({ title: "Notification 1", body: "Lorem ipsum dolor sit amet" })
33
35
  }, [])
34
36
 
37
+ function upload() {
38
+ site.openDialog(<UploadDialog target="https://maso.developxp.com/kiosk/api/upload" />)
39
+ }
40
+
35
41
  function change(id, value) {
36
42
  const next = Object.assign({}, form, { [id]: value })
37
43
  setForm(next)
@@ -49,6 +55,10 @@ const Page1 = (props) => {
49
55
  <Fragment>
50
56
  <header>Page 1</header>
51
57
  <main>
58
+
59
+ <Uploader icon="cloud_upload" target="https://maso.developxp.com/kiosk/api/upload" />
60
+
61
+ <Button label="Upload" action={upload} />
52
62
  <TextField id="name" label="Name" value={form.name} onChange={change} />
53
63
  <DropDown id="gender1" label="Dropdown 1" value={form.gender1} onChange={change} options={options} predictive={true} />
54
64
  <DropDown id="gender2" label="Dropdown 2" value={form.gender2} onChange={change} options={options} predictive={false} />
@@ -8,6 +8,7 @@ import './LoginBox.css'
8
8
  export const LoginBox = ({
9
9
  logo, title,
10
10
  userLabel = "User",
11
+ userValue = "",
11
12
  passwordLabel = "Password",
12
13
  passwordValue = '',
13
14
  loginLabel = "Log In", onOK,
@@ -16,7 +17,7 @@ export const LoginBox = ({
16
17
  loading
17
18
  }) => {
18
19
 
19
- const [user, setUser] = useState('')
20
+ const [user, setUser] = useState(userValue)
20
21
  const [password, setPassword] = useState(passwordValue)
21
22
 
22
23
  function canOK() {
@@ -6,14 +6,14 @@ import { Icon } from '../../html'
6
6
  */
7
7
  export const UploadArea = (props) => {
8
8
 
9
- const { resumable, icon, label = 'Add file or drop file here...' } = props
9
+ const { icon, label = 'Add file or drop file here...' } = props
10
10
  const areaElement = useRef()
11
11
  const [drag, setDrag] = useState(false)
12
+ const { resumable } = props
12
13
 
13
14
  useEffect(() => {
14
15
  if (resumable && areaElement) {
15
16
  resumable.assignDrop(areaElement.current)
16
- resumable.assignBrowse(areaElement.current)
17
17
  }
18
18
  }, [])
19
19
 
@@ -33,7 +33,7 @@ export const UploadArea = (props) => {
33
33
  onDragLeave={onDragLeave}
34
34
  ref={areaElement}
35
35
  >
36
- <UploadIcon icon={icon} resumable={resumable} />
36
+ <UploadIcon resumable={resumable}/>
37
37
  <label>{label}</label>
38
38
  </div>
39
39
  )
@@ -55,7 +55,7 @@ export const UploadIcon = ({ icon = "folder_open", resumable }) => {
55
55
 
56
56
  return (
57
57
  <div className="upload-icon" ref={iconElement}>
58
- <Icon icon={icon}/>
58
+ <Icon icon={icon} clickable/>
59
59
  </div>
60
60
  )
61
61
  }