ywana-core8 0.0.161 → 0.0.162

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.161",
3
+ "version": "0.0.162",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -19,7 +19,7 @@ export const TablePage = (props) => {
19
19
  const { id = "table",
20
20
  icon, title, name,
21
21
  schema, url, field,
22
- actions, dev = false, tableActions, selectionActions = [],
22
+ actions = [], dev = false, tableActions, selectionActions = [],
23
23
  editable, canFilter = false, canQuery = false, canAdd = true, canDelete = true,
24
24
  autosave = true, delay = 1000,
25
25
  groupBy, validator, scenario,
@@ -103,6 +103,14 @@ export const TablePage = (props) => {
103
103
  return null;
104
104
  }
105
105
 
106
+ function renderActions() {
107
+ return actions.map(element => {
108
+ const action = () => element.props.action(ctx)
109
+ const clone = React.cloneElement(element, [ action ])
110
+ return clone
111
+ })
112
+ }
113
+
106
114
  return (
107
115
  <Fragment>
108
116
  <Header className="table-page" title={<Text>{title}</Text>}>
@@ -113,6 +121,7 @@ export const TablePage = (props) => {
113
121
  </MenuIcon>
114
122
  ) : null}
115
123
  {actions}
124
+ {renderActions()}
116
125
  </Header>
117
126
  <menu className="table-page">
118
127
  {canQuery ? <TableQueries schema={schema} /> : null}