ywana-core8 0.0.101 → 0.0.105

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.101",
3
+ "version": "0.0.105",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -225,7 +225,7 @@ const TableEditor = (props) => {
225
225
  }
226
226
 
227
227
  async function check(id, value) {
228
- const ids = Array.isArray(id) ? id : [ id ]
228
+ const ids = Array.isArray(id) ? id : [id]
229
229
  pageContext.check(ids, value)
230
230
  setPageContext(Object.assign({}, pageContext))
231
231
  }
@@ -263,12 +263,13 @@ const TableEditor = (props) => {
263
263
  id: field.id,
264
264
  label: field.label,
265
265
  type: field.type,
266
- onChange: field.editable ? change : field.id === "checked" ? check : null, /* checked has it´s own handler */
266
+ onChange: field.id === "checked" ? check : field.editable ? change : null, /* checked has it´s own handler */
267
267
  options
268
268
  }
269
269
  }),
270
270
  rows: groups[groupName]
271
271
  .map(item => {
272
+ item.checked = pageContext.checked.has(item.id)
272
273
  item.actions = actions ? actions.map(action => {
273
274
  return action.filter ?
274
275
  action.filter(item) ? <Icon icon={action.icon} clickable size="small" action={() => run(action, item)} /> : null
@@ -287,7 +288,7 @@ const TableEditor = (props) => {
287
288
  <Header title={groupName} >
288
289
  <span className="size">{groupSize}</span>
289
290
  </Header>
290
- <DataTable {...table} onRowSelection={select} editable={editable} onCheckAll={check}/>
291
+ <DataTable {...table} onRowSelection={select} editable={editable} onCheckAll={check} />
291
292
  </Fragment>
292
293
  )
293
294
  })
@@ -347,8 +348,8 @@ const TableContext = (url, field) => {
347
348
  if (isChecked) {
348
349
  ids.forEach(id => this.checked.add(id))
349
350
  } else {
350
- ids.forEach(id => this.checked.delete(id)
351
- }
351
+ ids.forEach(id => this.checked.delete(id))
352
+ }
352
353
  },
353
354
 
354
355
  select(id) {