ywana-core8 0.1.46 → 0.1.47

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.1.46",
3
+ "version": "0.1.47",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
package/src/html/tree.js CHANGED
@@ -43,17 +43,22 @@ export const TreeNode = ({ id, icon = 'folder', label, tooltip, open=false, chil
43
43
  /**
44
44
  * Tree Item
45
45
  */
46
- export const TreeItem = ({ id, icon = 'description', label, actions, onSelect, selected = false }) => {
46
+ export const TreeItem = ({ id, icon = 'description', label, actions, onSelect, selected = false, onCheck, checked = false }) => {
47
47
 
48
48
  function select() {
49
49
  if (onSelect) onSelect(id)
50
50
  }
51
51
 
52
+ function check(event) {
53
+ if (onCheck) onCheck(id, event.target.checked)
54
+ }
55
+
52
56
  const style = selected ? "selected" : ""
53
57
  const labelTxt = label ? <Text format={TEXTFORMATS.STRING}>{label}</Text> : null
54
58
 
55
59
  return (
56
60
  <div className={`tree-item final ${style}`} onClick={select}>
61
+ { onCheck ? <input type="checkbox" checked={checked} onChange={check} /> : null }
57
62
  <Icon icon={icon} size="small" small />
58
63
  <div className="label">{labelTxt}</div>
59
64
  <div className="actions">{actions}</div>