ywana-core8 0.0.232 → 0.0.233

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.232",
3
+ "version": "0.0.233",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -310,15 +310,26 @@ const TableEditor = (props) => {
310
310
  })
311
311
  }
312
312
 
313
+ function renderGroupLabel(groupName) {
314
+ const grouper = schema[groupBy]
315
+ if (grouper.options) {
316
+ const options = CHECK['isFunction'](grouper.options) ? grouper.options() : grouper.options
317
+ const option = options.find(option => option.value === groupName)
318
+ return option.label
319
+ } else {
320
+ return groupName
321
+ }
322
+ }
323
+
313
324
  function renderGroups() {
314
325
 
315
326
  const items = filter ? filter(all) : all
316
327
 
317
- const groups = items.reduce((groups, filter) => {
318
- const groupName = filter[groupBy]
328
+ const groups = items.reduce((groups, item) => {
329
+ const groupName = item[groupBy]
319
330
  const group = groups[groupName]
320
331
  if (!group) groups[groupName] = []
321
- groups[groupName].push(filter)
332
+ groups[groupName].push(item)
322
333
  return groups
323
334
  }, {})
324
335
 
@@ -361,6 +372,7 @@ const TableEditor = (props) => {
361
372
  return (
362
373
  <Fragment key={groupName}>
363
374
  <Header title={groupName} >
375
+ {renderGroupLabel(groupName)}
364
376
  <span className="size">{groupSize}</span>
365
377
  </Header>
366
378
  <DataTable {...table} onRowSelection={select} editable={editable} onCheckAll={check} />