ywana-core8 0.0.214 → 0.0.215
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 +19 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +19 -16
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +19 -16
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/table.js +13 -11
- package/src/test.js +2 -3
package/package.json
CHANGED
package/src/html/table.js
CHANGED
@@ -145,7 +145,7 @@ const DataTableRow = (props) => {
|
|
145
145
|
const DataTableCell = ({ row, column, cell, editable }) => {
|
146
146
|
|
147
147
|
const render = (type) => {
|
148
|
-
const { id, disabled = false, min, max, onChange, format, options } = column
|
148
|
+
const { id, disabled = false, min, max, onChange, format, options, item } = column
|
149
149
|
if (id === "checked") {
|
150
150
|
return <CheckBox id={id} value={cell} onChange={(id, value) => onChange(row.id, id, value)} />
|
151
151
|
} else if (editable && onChange) {
|
@@ -166,25 +166,27 @@ const DataTableCell = ({ row, column, cell, editable }) => {
|
|
166
166
|
case "ICON": return <Icon icon={cell} />
|
167
167
|
case "Boolean": return <BooleanCellViewer id={id} value={cell} />
|
168
168
|
case "String": return <StringCellViewer id={id} value={cell} format={format} options={options} />
|
169
|
-
case TYPES.ENTITY: return <EntityCellViewer id={id} value={cell} />
|
170
169
|
default: return cell
|
171
170
|
}
|
172
171
|
}
|
173
172
|
}
|
174
173
|
|
175
|
-
return (
|
174
|
+
return column.type === TYPES.ENTITY ? <EntityCellViewer id={id} item={item} value={cell} /> : (
|
176
175
|
<td key={column.id} className={column.id}>{render(column.type)}</td>
|
177
176
|
)
|
178
177
|
}
|
179
178
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
)
|
179
|
+
/**
|
180
|
+
* Entity Cell Viewer
|
181
|
+
* @param {*} param0
|
182
|
+
* @returns
|
183
|
+
*/
|
184
|
+
const EntityCellViewer = ({ id, item, value }) => {
|
185
|
+
console.log(id, item, value)
|
186
|
+
const fields = Object.values(item).filter(field => field.column === true)
|
187
|
+
return fields.map( field => {
|
188
|
+
return (<td>{value[field.id]}</td>)
|
189
|
+
})
|
188
190
|
}
|
189
191
|
|
190
192
|
/**
|
package/src/test.js
CHANGED
@@ -6,7 +6,7 @@ const Test = (props) => {
|
|
6
6
|
|
7
7
|
<div>
|
8
8
|
|
9
|
-
<table>
|
9
|
+
<table border="1">
|
10
10
|
<thead>
|
11
11
|
<tr>
|
12
12
|
<th rowspan="2" colspan="1"><div class="checkbox"><input type="checkbox" value=""/><span class="checkmark"></span><label></label></div></th>
|
@@ -14,8 +14,7 @@ const Test = (props) => {
|
|
14
14
|
<th rowspan="2" colspan="1"><span>Fecha de Entrada</span></th>
|
15
15
|
<th rowspan="2" colspan="1"><span>Circuito</span></th>
|
16
16
|
<th rowspan="2" colspan="1"><span>Clase de Muestra</span></th>
|
17
|
-
<th
|
18
|
-
<th rowspan="2" colspan="1"></th>
|
17
|
+
<th colspan="3"><span>Referencia</span></th>
|
19
18
|
<th></th>
|
20
19
|
</tr>
|
21
20
|
<tr>
|