ywana-core8 0.0.53 → 0.0.57

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.53",
3
+ "version": "0.0.57",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -11,6 +11,10 @@ menu.collection-page>header {
11
11
  border-bottom: dotted 1px var(--divider-color);
12
12
  }
13
13
 
14
+ menu.collection-page>.list {
15
+ overflow:auto;
16
+ }
17
+
14
18
  menu.collection-page>main {
15
19
  flex: 1;
16
20
  overflow:auto;
@@ -203,6 +203,12 @@ const TableEditor = (props) => {
203
203
  setPageContext(Object.assign({}, pageContext))
204
204
  }
205
205
 
206
+ async function run(action) {
207
+ await action.action(item.id, pageContext)
208
+ await pageContext.load()
209
+ setPageContext(Object.assign({}, pageContext))
210
+ }
211
+
206
212
  function renderGroups() {
207
213
 
208
214
  const items = filter ? filter(all) : all
@@ -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
  })
@@ -19,7 +19,7 @@ export const Button = ({ label, icon, action, disabled = false, outlined, raised
19
19
  if (disabled) style = `${style} disabled`
20
20
  return (
21
21
  <button className={`btn ${style}`} onClick={click}>
22
- { icon ? <Icon icon={icon} size="small" /> : null }
22
+ { icon ? <Icon icon={icon} size="small" clickable action={click} /> : null }
23
23
  <span>{ label }</span>
24
24
  </button>
25
25
  )
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" : ""