ywana-core8 0.0.212 → 0.0.216
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 +26 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +26 -21
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +26 -21
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/table.js +21 -17
- package/src/test.js +2 -3
package/dist/index.modern.js
CHANGED
@@ -1331,9 +1331,10 @@ var DataTable = function DataTable(props) {
|
|
1331
1331
|
var id = _ref.id,
|
1332
1332
|
label = _ref.label,
|
1333
1333
|
type = _ref.type,
|
1334
|
+
item = _ref.item,
|
1334
1335
|
sortable = _ref.sortable;
|
1335
1336
|
|
1336
|
-
var _ref2 = type === TYPES.ENTITY ? [1,
|
1337
|
+
var _ref2 = type === TYPES.ENTITY ? [1, Object.keys(item).length] : [2, 1],
|
1337
1338
|
rowspan = _ref2[0],
|
1338
1339
|
colspan = _ref2[1];
|
1339
1340
|
|
@@ -1356,10 +1357,11 @@ var DataTable = function DataTable(props) {
|
|
1356
1357
|
var type = _ref3.type;
|
1357
1358
|
return type === TYPES.ENTITY;
|
1358
1359
|
}).map(function (column) {
|
1359
|
-
var
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1360
|
+
var item = column.item;
|
1361
|
+
var fields = item ? Object.values(item) : [];
|
1362
|
+
return fields.filter(function (field) {
|
1363
|
+
return field.column === true;
|
1364
|
+
}).map(function (field) {
|
1363
1365
|
return /*#__PURE__*/React.createElement("th", null, field.label);
|
1364
1366
|
});
|
1365
1367
|
}))), /*#__PURE__*/React.createElement("tbody", null, multiSort(rows, sortDir).map(function (row) {
|
@@ -1555,36 +1557,39 @@ var DataTableCell = function DataTableCell(_ref4) {
|
|
1555
1557
|
options: options
|
1556
1558
|
});
|
1557
1559
|
|
1558
|
-
case TYPES.ENTITY:
|
1559
|
-
return /*#__PURE__*/React.createElement(EntityCellViewer, {
|
1560
|
-
id: id,
|
1561
|
-
value: cell
|
1562
|
-
});
|
1563
|
-
|
1564
1560
|
default:
|
1565
1561
|
return cell;
|
1566
1562
|
}
|
1567
1563
|
}
|
1568
1564
|
};
|
1569
1565
|
|
1570
|
-
return /*#__PURE__*/React.createElement(
|
1566
|
+
return column.type === TYPES.ENTITY ? /*#__PURE__*/React.createElement(EntityCellViewer, {
|
1567
|
+
id: column.id,
|
1568
|
+
item: column.item,
|
1569
|
+
value: cell
|
1570
|
+
}) : /*#__PURE__*/React.createElement("td", {
|
1571
1571
|
key: column.id,
|
1572
1572
|
className: column.id
|
1573
1573
|
}, render(column.type));
|
1574
1574
|
};
|
1575
|
+
/**
|
1576
|
+
* Entity Cell Viewer
|
1577
|
+
* @param {*} param0
|
1578
|
+
* @returns
|
1579
|
+
*/
|
1580
|
+
|
1575
1581
|
|
1576
1582
|
var EntityCellViewer = function EntityCellViewer(_ref5) {
|
1577
1583
|
var id = _ref5.id,
|
1584
|
+
item = _ref5.item,
|
1578
1585
|
value = _ref5.value;
|
1579
|
-
console.log(id, value);
|
1580
|
-
var
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
return
|
1585
|
-
})
|
1586
|
-
return /*#__PURE__*/React.createElement("div", null, v);
|
1587
|
-
}));
|
1586
|
+
console.log(id, item, value);
|
1587
|
+
var fields = Object.values(item).filter(function (field) {
|
1588
|
+
return field.column === true;
|
1589
|
+
});
|
1590
|
+
return fields.map(function (field) {
|
1591
|
+
return /*#__PURE__*/React.createElement("td", null, value[field.id]);
|
1592
|
+
});
|
1588
1593
|
};
|
1589
1594
|
/**
|
1590
1595
|
* Boolean Cell Viewer
|