ywana-core8 0.0.213 → 0.0.217
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 +25 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +25 -18
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +25 -18
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/table.js +16 -14
- package/src/test.js +2 -3
package/dist/index.cjs
CHANGED
@@ -1338,9 +1338,10 @@ var DataTable = function DataTable(props) {
|
|
1338
1338
|
var id = _ref.id,
|
1339
1339
|
label = _ref.label,
|
1340
1340
|
type = _ref.type,
|
1341
|
+
item = _ref.item,
|
1341
1342
|
sortable = _ref.sortable;
|
1342
1343
|
|
1343
|
-
var _ref2 = type === TYPES.ENTITY ? [1,
|
1344
|
+
var _ref2 = type === TYPES.ENTITY ? [1, Object.keys(item).length] : [2, 1],
|
1344
1345
|
rowspan = _ref2[0],
|
1345
1346
|
colspan = _ref2[1];
|
1346
1347
|
|
@@ -1366,7 +1367,7 @@ var DataTable = function DataTable(props) {
|
|
1366
1367
|
var item = column.item;
|
1367
1368
|
var fields = item ? Object.values(item) : [];
|
1368
1369
|
return fields.filter(function (field) {
|
1369
|
-
return
|
1370
|
+
return field.column === true;
|
1370
1371
|
}).map(function (field) {
|
1371
1372
|
return /*#__PURE__*/React__default["default"].createElement("th", null, field.label);
|
1372
1373
|
});
|
@@ -1563,36 +1564,42 @@ var DataTableCell = function DataTableCell(_ref4) {
|
|
1563
1564
|
options: options
|
1564
1565
|
});
|
1565
1566
|
|
1566
|
-
case TYPES.ENTITY:
|
1567
|
-
return /*#__PURE__*/React__default["default"].createElement(EntityCellViewer, {
|
1568
|
-
id: id,
|
1569
|
-
value: cell
|
1570
|
-
});
|
1571
|
-
|
1572
1567
|
default:
|
1573
1568
|
return cell;
|
1574
1569
|
}
|
1575
1570
|
}
|
1576
1571
|
};
|
1577
1572
|
|
1578
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
1573
|
+
return column.type === TYPES.ENTITY ? /*#__PURE__*/React__default["default"].createElement(EntityCellViewer, {
|
1574
|
+
id: column.id,
|
1575
|
+
item: column.item,
|
1576
|
+
value: cell
|
1577
|
+
}) : /*#__PURE__*/React__default["default"].createElement("td", {
|
1579
1578
|
key: column.id,
|
1580
1579
|
className: column.id
|
1581
1580
|
}, render(column.type));
|
1582
1581
|
};
|
1582
|
+
/**
|
1583
|
+
* Entity Cell Viewer
|
1584
|
+
* @param {*} param0
|
1585
|
+
* @returns
|
1586
|
+
*/
|
1587
|
+
|
1583
1588
|
|
1584
1589
|
var EntityCellViewer = function EntityCellViewer(_ref5) {
|
1585
1590
|
var id = _ref5.id,
|
1591
|
+
item = _ref5.item,
|
1586
1592
|
value = _ref5.value;
|
1587
|
-
console.log(id, value);
|
1588
|
-
var
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
return
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1593
|
+
console.log(id, item, value);
|
1594
|
+
var fields = Object.values(item).filter(function (field) {
|
1595
|
+
return field.column === true;
|
1596
|
+
});
|
1597
|
+
return fields.map(function (field) {
|
1598
|
+
return /*#__PURE__*/React__default["default"].createElement("td", {
|
1599
|
+
key: column.id,
|
1600
|
+
className: "entity-cell " + column.id
|
1601
|
+
}, value[field.id]);
|
1602
|
+
});
|
1596
1603
|
};
|
1597
1604
|
/**
|
1598
1605
|
* Boolean Cell Viewer
|