ywana-core8 0.0.106 → 0.0.110

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.106",
3
+ "version": "0.0.110",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -224,12 +224,15 @@ const TableEditor = (props) => {
224
224
  setPageContext(Object.assign({}, pageContext))
225
225
  }
226
226
 
227
- async function check(id, value) {
228
- const ids = Array.isArray(id) ? id : [id]
227
+ async function check(ids, value) {
229
228
  pageContext.check(ids, value)
230
229
  setPageContext(Object.assign({}, pageContext))
231
230
  }
232
231
 
232
+ async function checkOne(id, field, value) {
233
+ check([id], value)
234
+ }
235
+
233
236
  function run(action, item) {
234
237
  action.action(item.id, pageContext, async () => {
235
238
  await pageContext.load()
@@ -263,13 +266,13 @@ const TableEditor = (props) => {
263
266
  id: field.id,
264
267
  label: field.label,
265
268
  type: field.type,
266
- onChange: field.id === "checked" ? (rowID, id, value ) => { check(rowId, value) } : field.editable ? change : null, /* checked has it´s own handler */
269
+ onChange: field.id === "checked" ? checkOne : field.editable ? change : null, /* checked has it´s own handler */
267
270
  options
268
271
  }
269
272
  }),
270
273
  rows: groups[groupName]
271
274
  .map(item => {
272
- item.checked = pageContext.checked.has(item.id)
275
+ item.checked = pageContext.checked ? pageContext.checked.has(item.id) : false
273
276
  item.actions = actions ? actions.map(action => {
274
277
  return action.filter ?
275
278
  action.filter(item) ? <Icon icon={action.icon} clickable size="small" action={() => run(action, item)} /> : null
@@ -300,7 +303,6 @@ const TableEditor = (props) => {
300
303
  .map(field => ({ label: field.label, value: field.id }))
301
304
  }
302
305
 
303
- console.log('table page checked', pageContext.checked)
304
306
  return (
305
307
  <Fragment>
306
308
  <Header icon={icon} title={<Text>{title}</Text>}>
@@ -314,7 +316,7 @@ const TableEditor = (props) => {
314
316
  }
315
317
 
316
318
  /**
317
- * table Context
319
+ * Table Context
318
320
  */
319
321
  const TableContext = (url, field) => {
320
322