ywana-core8 0.0.133 → 0.0.137

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.133",
3
+ "version": "0.0.137",
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,
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,
@@ -96,7 +96,7 @@ export const TablePage = (props) => {
96
96
  return (
97
97
  <aside className="table-page">
98
98
  { rowSelected ? <TableRowEditor content={new Content(schema, form)} filter={editorFilter} onChange={change} onClose={closeAside} /> : null }
99
- { rowChecked ? <TableSelector schema={schema} onClose={closeAside} /> : null }
99
+ { rowChecked ? <TableSelector schema={schema} actions={selectionActions} /> : null }
100
100
  </aside>
101
101
  )
102
102
  }
@@ -153,16 +153,16 @@ const TableSelector = (props) => {
153
153
  const { all, checked} = pageContext
154
154
 
155
155
  const count = `${checked.size}/${all.length}`
156
-
157
156
  const rows = all.filter(item => checked.has(item.id))
158
- console.log(count, rows)
159
-
160
157
  const table = {
161
158
  columns: [
162
159
  { id:"idMatricula", label: "ID Matricula" }
163
160
  ],
164
161
  rows: rows || []
165
162
  }
163
+ const buttons = actions.map(({label, action }) => {
164
+ return <Button label={label} raised action={() => action(rows)} />
165
+ })
166
166
 
167
167
  return (
168
168
  <div className="table-selector">
@@ -173,7 +173,7 @@ const TableSelector = (props) => {
173
173
  <DataTable {...table} />
174
174
  </main>
175
175
  <footer>
176
- { actions }
176
+ { buttons }
177
177
  </footer>
178
178
  </div>
179
179
  )