ywana-core8 0.0.273 → 0.0.276

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.273",
3
+ "version": "0.0.276",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
package/src/html/table.js CHANGED
@@ -42,10 +42,8 @@ export const DataTable = (props) => {
42
42
  // Loop until sorted (-1 or 1) or until the sort keys have been processed.
43
43
  while (sorted === 0 && index < sortKeys.length) {
44
44
  const key = sortKeys[index];
45
-
46
45
  if (key) {
47
46
  const direction = sortObject[key];
48
-
49
47
  sorted = keySort(a[key], b[key], direction);
50
48
  index++;
51
49
  }
@@ -0,0 +1,13 @@
1
+ import React, { useState } from 'react'
2
+ import { Tooltip } from './tooltip'
3
+
4
+ const TooltipTest = (prop) => {
5
+
6
+ return (
7
+ <>
8
+ <Tooltip text="role1" top="2rem" >
9
+ John Smith
10
+ </Tooltip>
11
+ </>
12
+ )
13
+ }
@@ -1,3 +1,19 @@
1
1
  .tooltip {
2
-
2
+ position: relative;
3
+ cursor: pointer;
4
+ }
5
+
6
+ .tooltip-text {
7
+ display: none;
8
+ z-index: 10;
9
+ }
10
+
11
+ .tooltip:hover .tooltip-text {
12
+ display: block;
13
+ position: absolute;
14
+ border: solid 1px var(--divider-color);
15
+ background-color: var(--text-color-light);
16
+ color: var(--paper-color);
17
+ padding: .5rem;
18
+ border-radius: 4px;
3
19
  }
@@ -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
- <ReactTooltip id="filters" effect="solid" className="tooltip">
13
- <Text use="body2">{text}</Text>
14
- </ReactTooltip>
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/site/site.js CHANGED
@@ -70,6 +70,7 @@ export const SiteProvider = ({ children, siteLang, siteDictionary, showConsole }
70
70
  closePreview: () => { setPreview(null) },
71
71
 
72
72
  confirm: (message) => window.confirm(message),
73
+ prompt: (message) => window.prompt(message),
73
74
 
74
75
  notify: ({ title, body, type = "success" }) => {
75
76
  Store.addNotification({
@@ -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
+ }
@@ -2,24 +2,20 @@ import React, { Fragment, useContext, useState } from 'react';
2
2
  import { Uploader } from './Uploader'
3
3
  import { Button, Text } from '../../html';
4
4
  import { SiteContext, Dialog } from '../../site';
5
- import { UploadFile } from './UploadFile';
6
5
 
7
6
  /**
8
7
  * Upload Dialog
9
8
  */
10
- export const UploadDialog = ({ label, target, accept, onSuccess, onOK, onError, onClose, onActionClose = true }) => {
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
- setFile(uploads[0]);
18
- if (onSuccess) onSuccess(uploads[0])
14
+ if (onSuccess) onSuccess(uploads)
19
15
  }
20
16
 
21
17
  function onAction(action) {
22
- if (action === 'CLOSE' || onActionClose === true) {
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
- {file ? <UploadFile file={file} /> : <Uploader label={label} accept={accept} target={target} onComplete={onComplete} />}
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, Text, LinearProgress } from '../../html'
3
- import { UPLOAD_STATES } from './Uploader'
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 = [], state }) => {
4
+ export const UploadProgress = ({ files = [] }) => {
6
5
 
7
6
  return (
8
7
  <div>
9
8
  {files.map((file) => {
10
9
  const f = {
11
- icon: "image",
10
+ icon: "description",
12
11
  name: file.fileName,
13
12
  progress: file.progress() * 100,
14
13
  state: file.uploadState,
@@ -0,0 +1,4 @@
1
+
2
+ export const UPLOAD_STATES = {
3
+ IDLE: 0, RUNNING: 1, SUCCESS: 2, ERROR: 3, COMPLETED: 4
4
+ }
@@ -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} state={state} /> }
68
+ {state === UPLOAD_STATES.IDLE ? <UploadArea resumable={resumable} label={label} /> : <UploadProgress files={files} /> }
71
69
  </div>
72
70
  )
73
71
  }
@@ -1,4 +1,4 @@
1
1
  export * from './Uploader'
2
2
  export * from './UploadDialog'
3
3
  export * from './UploadArea'
4
- export * from './UploadFile'
4
+ export * from './UploadFile'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes