ywana-core8 0.0.210 → 0.0.214
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 +31 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +31 -27
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +31 -27
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +1 -1
- package/src/html/table.js +9 -3
package/package.json
CHANGED
package/src/domain/TablePage.js
CHANGED
@@ -335,7 +335,7 @@ const TableEditor = (props) => {
|
|
335
335
|
label: field.label,
|
336
336
|
type: field.type,
|
337
337
|
format: field.format,
|
338
|
-
|
338
|
+
item: field.item ? field.item : [],
|
339
339
|
onChange: field.id === "checked" ? checkOne : field.editable ? change : null, /* checked has it´s own handler */
|
340
340
|
options
|
341
341
|
}
|
package/src/html/table.js
CHANGED
@@ -74,9 +74,9 @@ export const DataTable = (props) => {
|
|
74
74
|
<table>
|
75
75
|
<thead>
|
76
76
|
<tr>
|
77
|
-
{columns.map(({ id, label, type, sortable }) => {
|
77
|
+
{columns.map(({ id, label, type, item, sortable }) => {
|
78
78
|
const sort = sortDir[id] ? sortDir[id] : null
|
79
|
-
const [rowspan, colspan] = type === TYPES.ENTITY ? [1,
|
79
|
+
const [rowspan, colspan] = type === TYPES.ENTITY ? [1, Object.keys(item).length] : [2, 1]
|
80
80
|
return (
|
81
81
|
<th rowSpan={rowspan} colSpan={colspan}>
|
82
82
|
{id === "checked" ? <CheckBox onChange={checkAll} /> : <Text key={`th_${id}`}>{label}</Text>}
|
@@ -90,7 +90,13 @@ export const DataTable = (props) => {
|
|
90
90
|
{
|
91
91
|
columns
|
92
92
|
.filter(({ type }) => type === TYPES.ENTITY)
|
93
|
-
.map(
|
93
|
+
.map(column => {
|
94
|
+
const { item } = column
|
95
|
+
const fields = item ? Object.values(item) : []
|
96
|
+
return fields
|
97
|
+
.filter(field => field.column === true)
|
98
|
+
.map(field => <th>{field.label}</th>)
|
99
|
+
})
|
94
100
|
}
|
95
101
|
</tr>
|
96
102
|
</thead>
|