ywana-core8 0.0.351 → 0.0.354
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 +32 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +69 -56
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +32 -16
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +32 -16
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -1
- package/src/html/menu.css +65 -57
- package/src/html/menu.js +8 -4
- package/src/html/text.test.js +2 -0
- package/src/http/token.test.js +39 -0
- package/src/site/site.css +4 -0
- package/src/site/site.js +16 -1
- package/src/site/site.test.js +4 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ywana-core8",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.354",
|
4
4
|
"description": "ywana-core8",
|
5
5
|
"author": "Ernesto Roldan Garcia",
|
6
6
|
"license": "MIT",
|
@@ -29,6 +29,7 @@
|
|
29
29
|
"react-dom": "^17.0.2"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
+
"crypto-js": "^4.1.1",
|
32
33
|
"deep-equal": "^2.0.5",
|
33
34
|
"material-design-icons-iconfont": "^6.1.1",
|
34
35
|
"moment": "^2.29.1",
|
package/src/html/menu.css
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
.menu-icon {
|
2
|
-
|
3
|
-
|
2
|
+
position: relative;
|
3
|
+
width: 3rem;
|
4
4
|
}
|
5
5
|
|
6
|
-
.menu-icon
|
6
|
+
.menu-icon > .overlay {
|
7
7
|
position: fixed;
|
8
8
|
top: 0px;
|
9
9
|
left: 0px;
|
@@ -13,70 +13,78 @@
|
|
13
13
|
background-color: transparent;
|
14
14
|
}
|
15
15
|
|
16
|
-
.menu-icon>menu {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
16
|
+
.menu-icon > menu {
|
17
|
+
z-index: 6;
|
18
|
+
position: absolute;
|
19
|
+
top: 3rem;
|
20
|
+
left: 0px;
|
21
|
+
margin: 0;
|
22
|
+
border: solid 1px var(--divider-color);
|
23
|
+
background-color: var(--paper-color);
|
24
|
+
padding: 0;
|
25
|
+
min-width: 7rem;
|
26
|
+
max-width: 14rem;
|
27
|
+
max-height: 50vh;
|
28
|
+
overflow: auto;
|
29
|
+
box-shadow: var(--shadow1);
|
30
30
|
}
|
31
31
|
|
32
|
-
.menu-icon>menu.alignRight {
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
.menu-icon > menu.alignRight {
|
33
|
+
left: unset;
|
34
|
+
right: 0px;
|
35
|
+
}
|
36
36
|
|
37
|
-
.menu-icon>menu ul {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
.menu-icon>menu li {
|
45
|
-
min-height: 3rem;
|
46
|
-
padding: 0 .5rem;
|
47
|
-
|
48
|
-
display: flex;
|
49
|
-
align-items: center;
|
50
|
-
}
|
51
|
-
|
52
|
-
.menu-icon>menu li:hover {
|
53
|
-
background-color: var(--primary-color-lighter);
|
54
|
-
}
|
37
|
+
.menu-icon > menu ul {
|
38
|
+
list-style: none;
|
39
|
+
margin: 0;
|
40
|
+
padding: 0.5rem 0;
|
41
|
+
cursor: pointer;
|
42
|
+
}
|
55
43
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
44
|
+
.menu-icon > menu li {
|
45
|
+
min-height: 3rem;
|
46
|
+
padding: 0 0.5rem;
|
47
|
+
display: flex;
|
48
|
+
align-items: center;
|
49
|
+
}
|
61
50
|
|
62
|
-
|
63
|
-
|
64
|
-
|
51
|
+
.menu-icon > menu li:hover {
|
52
|
+
background-color: var(--primary-color-lighter);
|
53
|
+
}
|
65
54
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
}
|
55
|
+
.menu-item {
|
56
|
+
flex: 1;
|
57
|
+
display: flex;
|
58
|
+
align-items: center;
|
59
|
+
cursor: pointer;
|
60
|
+
}
|
73
61
|
|
74
|
-
|
75
|
-
|
62
|
+
.menu-item > .icon {
|
63
|
+
color: var(--text-color-light);
|
64
|
+
cursor: pointer;
|
65
|
+
}
|
66
|
+
|
67
|
+
.menu-item > label {
|
68
|
+
flex: 1;
|
69
|
+
white-space: nowrap;
|
70
|
+
padding: 0 0.5rem 0 0;
|
71
|
+
color: var(--text-color);
|
72
|
+
font-size: 0.9rem;
|
73
|
+
cursor: pointer;
|
74
|
+
}
|
75
|
+
|
76
|
+
.menu-item.disabled > label,
|
77
|
+
.menu-item.disabled > .icon {
|
78
|
+
color: var(--text-color-lighter);
|
79
|
+
cursor: initial;
|
80
|
+
}
|
81
|
+
|
82
|
+
.menu-item > .meta {
|
83
|
+
color: var(--text-color-lighter);
|
76
84
|
}
|
77
85
|
|
78
86
|
.menu-separator {
|
79
87
|
min-height: 0px !important;
|
80
88
|
height: 1px;
|
81
89
|
border-top: solid 1px var(--divider-color);
|
82
|
-
}
|
90
|
+
}
|
package/src/html/menu.js
CHANGED
@@ -52,15 +52,19 @@ export const MenuIcon = (props) => {
|
|
52
52
|
*/
|
53
53
|
export const MenuItem = (props) => {
|
54
54
|
|
55
|
-
const { id, icon, label, meta, onSelect } = props
|
55
|
+
const { id, icon, label, meta, disabled=false, onSelect } = props
|
56
56
|
const [open, setOpen] = useContext(MenuContext)
|
57
57
|
|
58
58
|
function select() {
|
59
|
-
if (
|
60
|
-
|
59
|
+
if (!disabled) {
|
60
|
+
if (onSelect) onSelect()
|
61
|
+
setOpen(false)
|
62
|
+
}
|
61
63
|
}
|
64
|
+
|
65
|
+
const style = disabled ? "disabled" : ""
|
62
66
|
return (
|
63
|
-
<li className=
|
67
|
+
<li className={`menu-item ${style}`} onClick={select}>
|
64
68
|
{icon ? <Icon icon={icon} /> : null}
|
65
69
|
<label>{label}</label>
|
66
70
|
{meta ? <div className="meta">{meta}</div> : null}
|
package/src/html/text.test.js
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
|
+
import { useEffect } from 'react/cjs/react.production.min'
|
2
3
|
import { Text, TEXTFORMATS } from './text'
|
3
4
|
|
4
5
|
const TextTest = (prop) => {
|
5
6
|
|
7
|
+
|
6
8
|
return (
|
7
9
|
<>
|
8
10
|
<Text format={TEXTFORMATS.NUMERIC}>846964.4199142859</Text>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
2
|
+
import { TextField } from '../html'
|
3
|
+
import CryptoJS from 'crypto-js';
|
4
|
+
import { useEffect } from 'react/cjs/react.production.min';
|
5
|
+
|
6
|
+
|
7
|
+
const Token = () => {
|
8
|
+
|
9
|
+
const [encrypted, setEncrypted] = useState("")
|
10
|
+
const [decrypted, setDecrypted] = useState("")
|
11
|
+
|
12
|
+
|
13
|
+
function decryptData(encrypted, secret) {
|
14
|
+
const bytes = CryptoJS.AES.decrypt(encrypted, secret);
|
15
|
+
const originalText = bytes.toString(CryptoJS.enc.Utf8);
|
16
|
+
return originalText;
|
17
|
+
}
|
18
|
+
|
19
|
+
function encryptData(message, secret) {
|
20
|
+
return CryptoJS.AES.encrypt(message, secret).toString();
|
21
|
+
}
|
22
|
+
|
23
|
+
function change(id, value) {
|
24
|
+
const secret = '12345678';
|
25
|
+
const e = encryptData(value, secret)
|
26
|
+
setEncrypted(e)
|
27
|
+
const d = decryptData(e, secret)
|
28
|
+
setDecrypted(d)
|
29
|
+
}
|
30
|
+
|
31
|
+
return (
|
32
|
+
<>
|
33
|
+
<TextField label="Text" onChange={(id, value) => change(id, value)}></TextField>
|
34
|
+
<TextField label="Encrypted" value={encrypted}></TextField>
|
35
|
+
<TextField label="Decrypted" value={decrypted}></TextField>
|
36
|
+
</>
|
37
|
+
)
|
38
|
+
}
|
39
|
+
|
package/src/site/site.css
CHANGED
package/src/site/site.js
CHANGED
@@ -104,7 +104,7 @@ export const SiteProvider = ({ children, siteLang, siteDictionary, showConsole }
|
|
104
104
|
/**
|
105
105
|
* Site
|
106
106
|
*/
|
107
|
-
export const Site = ({ icon, logo, title, toolbar, children, init, min, lang, dictionary }) => {
|
107
|
+
export const Site = ({ icon, logo, title, toolbar, footer, children, init, min, lang, dictionary }) => {
|
108
108
|
return (
|
109
109
|
<SiteProvider siteLang={lang} siteDictionary={dictionary}>
|
110
110
|
<div className="site6">
|
@@ -121,6 +121,7 @@ export const Site = ({ icon, logo, title, toolbar, children, init, min, lang, di
|
|
121
121
|
<SitePromptDialog />
|
122
122
|
<SitePreview />
|
123
123
|
<SiteNotifications />
|
124
|
+
<SiteFooter>{footer}</SiteFooter>
|
124
125
|
</div>
|
125
126
|
</SiteProvider>
|
126
127
|
)
|
@@ -141,6 +142,7 @@ const SiteHeader = (props) => {
|
|
141
142
|
<Header icon={icon} title={title} />
|
142
143
|
)
|
143
144
|
}
|
145
|
+
|
144
146
|
/**
|
145
147
|
* Site ToolBar
|
146
148
|
*/
|
@@ -154,6 +156,19 @@ const SiteToolBar = ({ children }) => {
|
|
154
156
|
)
|
155
157
|
}
|
156
158
|
|
159
|
+
/**
|
160
|
+
* Site Footer
|
161
|
+
*/
|
162
|
+
const SiteFooter = ({ children }) => {
|
163
|
+
const context = useContext(SiteContext)
|
164
|
+
const { breadcrumb } = context
|
165
|
+
return (
|
166
|
+
<footer>
|
167
|
+
{children}
|
168
|
+
</footer>
|
169
|
+
)
|
170
|
+
}
|
171
|
+
|
157
172
|
/**
|
158
173
|
* Site Aside
|
159
174
|
*/
|
package/src/site/site.test.js
CHANGED
@@ -9,8 +9,11 @@ import { Dialog } from './dialog'
|
|
9
9
|
import { Button } from '../html'
|
10
10
|
|
11
11
|
const SiteTest = (prop) => {
|
12
|
+
|
13
|
+
const footer = <div>FOOTER</div>
|
14
|
+
|
12
15
|
return (
|
13
|
-
<Site icon="star" title="Site Test" init={"PAGE2"}>
|
16
|
+
<Site icon="star" title="Site Test" init={"PAGE2"} footer={footer}>
|
14
17
|
<Page id="PAGE1" section="SECTION1" icon="description" title="Page 1" layout="workspace">
|
15
18
|
<Page1 />
|
16
19
|
</Page>
|