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/dist/index.cjs +23 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +23 -9
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +23 -9
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +15 -3
package/package.json
CHANGED
package/src/domain/TablePage.js
CHANGED
@@ -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,
|
318
|
-
const groupName =
|
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(
|
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} />
|