ywana-core8 0.0.543 → 0.0.546

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.543",
3
+ "version": "0.0.546",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -238,7 +238,10 @@ export const CollectionTree = (props) => {
238
238
  const title = typeof node.name === 'boolean' ? `${node.field} = ${node.name}` : node.name
239
239
  return (
240
240
  <TreeNode key={node.name} icon={null} label={title} open={true}>
241
- {node.nodes ? renderNodes(node.nodes) : node.items.map(item => <TreeItem icon={icon} key={item.id} id={item.id} label={item.name} onSelect={select}>item</TreeItem>)}
241
+ {node.nodes ? renderNodes(node.nodes) : node.items.map(item => {
242
+ const selected = pageContext.selected && item.id === pageContext.selected.id
243
+ return <TreeItem icon={icon} key={item.id} id={item.id} label={item.name} onSelect={select} selected={selected}>item</TreeItem>
244
+ })}
242
245
  </TreeNode>
243
246
  )
244
247
  })
@@ -18,7 +18,7 @@ export const TablePage = (props) => {
18
18
  const site = useContext(SiteContext)
19
19
  const { id = "table",
20
20
  icon, title, name,
21
- schema, url, field, host, params,
21
+ schema, url, field, host, params = "",
22
22
  autosave = true, delay = 1000,
23
23
  editable,
24
24
  actions = [], dev = false, tableActions, selectionActions = [],
@@ -615,7 +615,7 @@ const TableContext = (url, field, host, urlQuery, params) => {
615
615
  /**
616
616
  * table API
617
617
  */
618
- const TableAPI = (url, host, params) => {
618
+ const TableAPI = (url, host, params = "") => {
619
619
 
620
620
  const http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
621
621
 
package/src/html/tree.js CHANGED
@@ -33,14 +33,16 @@ export const TreeNode = ({ icon = 'folder', label, tooltip, open=false, children
33
33
  /**
34
34
  * Tree Item
35
35
  */
36
- export const TreeItem = ({ id, icon = 'description', label, actions, onSelect }) => {
36
+ export const TreeItem = ({ id, icon = 'description', label, actions, onSelect, selected = false }) => {
37
37
 
38
38
  function select() {
39
39
  if (onSelect) onSelect(id)
40
40
  }
41
41
 
42
+ const style = selected ? "selected" : ""
43
+
42
44
  return (
43
- <div className="tree-item final" onClick={select}>
45
+ <div className={`tree-item final ${style}`} onClick={select}>
44
46
  <Icon icon={icon} size="small" small />
45
47
  <div className="label">{label}</div>
46
48
  <div className="actions">{actions}</div>