ywana-core8 0.0.981 → 0.0.983

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.981",
3
+ "version": "0.0.983",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -24,7 +24,8 @@ export const TokenField = ({ id, label, tokens = [], readOnly, options, predicti
24
24
 
25
25
  function changeDropDown(fid, value) {
26
26
 
27
- const valueIsNotEmpty = value && value.length > 0
27
+ const isNumericValue = !isNaN(value)
28
+ const valueIsNotEmpty = (value && value.length > 0) || isNumericValue
28
29
 
29
30
  if (valueIsNotEmpty) {
30
31
  const next = Array.isArray(tokens) ? tokens.concat(value) : [value]
package/src/html/tree.css CHANGED
@@ -42,6 +42,11 @@
42
42
  width: 100%;
43
43
  }
44
44
 
45
+ .tree-item>.label>.clickable:hover {
46
+ cursor: pointer;
47
+ color: var(--accent-color);
48
+ }
49
+
45
50
  .tree-item>.actions {
46
51
  padding: 0 .5rem;
47
52
  color: var(--text-color-lighter);
package/src/html/tree.js CHANGED
@@ -18,15 +18,21 @@ export const Tree = ({ nodes = [], children }) => {
18
18
  /**
19
19
  * Tree Node
20
20
  */
21
- export const TreeNode = ({ icon = 'folder', label, tooltip, open=false, children, actions }) => {
21
+ export const TreeNode = ({ id, icon = 'folder', label, tooltip, open=false, children, actions, onSelect }) => {
22
22
 
23
23
  const labelTxt = label ? <Text format={TEXTFORMATS.STRING}>{label}</Text> : null
24
24
 
25
+ function select() {
26
+ if (onSelect) onSelect(id)
27
+ }
28
+
29
+ const clickable = onSelect ? "clickable" : ""
30
+
25
31
  return (
26
- <details className="tree-node" open={open}>
32
+ <details className="tree-node" open={open} >
27
33
  <summary className="tree-item">
28
34
  { icon ? <Icon icon={icon} size="small" small /> : null }
29
- <div className="label">{labelTxt}</div>
35
+ <div className="label" onClick={select} className={clickable}>{labelTxt}</div>
30
36
  <div className="actions">{actions}</div>
31
37
  </summary>
32
38
  {children}