ywana-core8 0.0.351 → 0.0.352

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.351",
3
+ "version": "0.0.352",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
package/src/html/menu.css CHANGED
@@ -1,9 +1,9 @@
1
1
  .menu-icon {
2
- position: relative;
3
- width: 3rem;
2
+ position: relative;
3
+ width: 3rem;
4
4
  }
5
5
 
6
- .menu-icon>.overlay {
6
+ .menu-icon > .overlay {
7
7
  position: fixed;
8
8
  top: 0px;
9
9
  left: 0px;
@@ -13,70 +13,75 @@
13
13
  background-color: transparent;
14
14
  }
15
15
 
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);
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
+ }
31
+
32
+ .menu-icon > menu.alignRight {
33
+ left: unset;
34
+ right: 0px;
35
+ }
36
+
37
+ .menu-icon > menu ul {
38
+ list-style: none;
39
+ margin: 0;
40
+ padding: 0.5rem 0;
41
+ cursor: pointer;
42
+ }
43
+
44
+ .menu-icon > menu li {
45
+ min-height: 3rem;
46
+ padding: 0 0.5rem;
47
+
48
+ display: flex;
49
+ align-items: center;
30
50
  }
31
51
 
32
- .menu-icon>menu.alignRight {
33
- left:unset;
34
- right: 0px;
35
- }
52
+ .menu-icon > menu li:hover {
53
+ background-color: var(--primary-color-lighter);
54
+ }
36
55
 
37
- .menu-icon>menu ul {
38
- list-style: none;
39
- margin: 0;
40
- padding: .5rem 0;
41
- cursor: pointer;
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
- }
56
+ .menu-item {
57
+ flex: 1;
58
+ display: flex;
59
+ align-items: center;
60
+ }
55
61
 
56
- .menu-item {
57
- flex: 1;
58
- display: flex;
59
- align-items: center;
60
- }
62
+ .menu-item > .icon {
63
+ color: var(--text-color-light);
64
+ }
61
65
 
62
- .menu-item>.icon {
63
- color: var(--text-color-light)
64
- }
66
+ .menu-item > label {
67
+ flex: 1;
68
+ white-space: nowrap;
69
+ padding: 0 0.5rem 0 0;
70
+ color: var(--text-color);
71
+ font-size: 0.9rem;
72
+ }
65
73
 
66
- .menu-item>label {
67
- flex: 1;
68
- white-space: nowrap;
69
- padding: 0 .5rem 0 0;
70
- color: var(--text-color);
71
- font-size: .9rem;
72
- }
74
+ .menu-item.disabled > label,
75
+ .menu-item.disabled > .icon {
76
+ color: var(--text-color-lighter);
77
+ }
73
78
 
74
- .menu-item>.meta {
75
- color: var(--text-color-lighter)
79
+ .menu-item > .meta {
80
+ color: var(--text-color-lighter);
76
81
  }
77
82
 
78
83
  .menu-separator {
79
84
  min-height: 0px !important;
80
85
  height: 1px;
81
86
  border-top: solid 1px var(--divider-color);
82
- }
87
+ }
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 (onSelect) onSelect()
60
- setOpen(false)
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="menu-item" onClick={select}>
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}