ywana-core8 0.0.386 → 0.0.389
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 +19 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +3 -14
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +19 -22
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +19 -22
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +1 -0
- package/src/domain/ContentType.js +1 -0
- package/src/site/dialog.css +3 -14
- package/src/site/dialog.js +17 -24
- package/src/site/site.test.js +10 -0
- package/src/widgets/login/LoginBox.js +2 -1
- package/src/widgets/upload/UploadArea.js +6 -5
package/package.json
CHANGED
@@ -245,6 +245,7 @@ export const StringEditor = ({ field, value = '', onChange, content, outlined })
|
|
245
245
|
|
246
246
|
function renderFormat(format, options) {
|
247
247
|
switch (format) {
|
248
|
+
case FORMATS.COLOR: return <div>COLOR PICKER</div>
|
248
249
|
case FORMATS.HTML: return <Editor id={id} value={value} onChange={change} content={content} />
|
249
250
|
case FORMATS.DATE: return <TextField outlined={outlined} id={id} type="date" label={label} value={value} onChange={change} readOnly={!editable} />
|
250
251
|
default:
|
package/src/site/dialog.css
CHANGED
@@ -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 {
|
package/src/site/dialog.js
CHANGED
@@ -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
|
-
<
|
33
|
-
<
|
34
|
-
<
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
}
|
package/src/site/site.test.js
CHANGED
@@ -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,15 +6,16 @@ import { Icon } from '../../html'
|
|
6
6
|
*/
|
7
7
|
export const UploadArea = (props) => {
|
8
8
|
|
9
|
-
const {
|
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
|
-
if (resumable && areaElement
|
15
|
+
if (resumable && areaElement) {
|
15
16
|
resumable.assignDrop(areaElement.current)
|
16
17
|
}
|
17
|
-
}, [
|
18
|
+
}, [])
|
18
19
|
|
19
20
|
const onDragOver = () => {
|
20
21
|
setDrag(true)
|
@@ -32,7 +33,7 @@ export const UploadArea = (props) => {
|
|
32
33
|
onDragLeave={onDragLeave}
|
33
34
|
ref={areaElement}
|
34
35
|
>
|
35
|
-
<UploadIcon
|
36
|
+
<UploadIcon resumable={resumable}/>
|
36
37
|
<label>{label}</label>
|
37
38
|
</div>
|
38
39
|
)
|
@@ -54,7 +55,7 @@ export const UploadIcon = ({ icon = "folder_open", resumable }) => {
|
|
54
55
|
|
55
56
|
return (
|
56
57
|
<div className="upload-icon" ref={iconElement}>
|
57
|
-
<Icon icon={icon}/>
|
58
|
+
<Icon icon={icon} clickable/>
|
58
59
|
</div>
|
59
60
|
)
|
60
61
|
}
|