ywana-core8 0.0.55 → 0.0.59

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.55",
3
+ "version": "0.0.59",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -203,6 +203,13 @@ const TableEditor = (props) => {
203
203
  setPageContext(Object.assign({}, pageContext))
204
204
  }
205
205
 
206
+ function run(action) {
207
+ action.action(item.id, pageContext, async () => {
208
+ await pageContext.load()
209
+ setPageContext(Object.assign({}, pageContext))
210
+ })
211
+ }
212
+
206
213
  function renderGroups() {
207
214
 
208
215
  const items = filter ? filter(all) : all
@@ -215,7 +222,6 @@ const TableEditor = (props) => {
215
222
  return groups
216
223
  }, {})
217
224
 
218
-
219
225
  return Object.keys(groups).map(groupName => {
220
226
 
221
227
  const table = {
@@ -236,7 +242,7 @@ const TableEditor = (props) => {
236
242
  }),
237
243
  rows: groups[groupName]
238
244
  .map(item => {
239
- item.actions = actions ? actions.map(action => <Icon icon={action.icon} clickable size="small" action={() => { action.action(item.id, pageContext) }}/>) : []
245
+ item.actions = actions ? actions.map(action => <Icon icon={action.icon} clickable size="small" action={() => run(action) }/>) : []
240
246
  item.actions.push(<Icon icon="delete" size="small" clickable action={() => remove(item.id)} />)
241
247
  return item
242
248
  })
package/src/html/icon.js CHANGED
@@ -9,7 +9,7 @@ export const Icon = ({ icon, size = "normal", clickable = false, action }) => {
9
9
  function click (event) {
10
10
  event.stopPropagation()
11
11
  event.preventDefault();
12
- if (action) action()
12
+ if (action) action(event)
13
13
  }
14
14
 
15
15
  const clicker = clickable ? "clickable" : ""