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.umd.js
CHANGED
@@ -1335,9 +1335,10 @@
|
|
1335
1335
|
var id = _ref.id,
|
1336
1336
|
label = _ref.label,
|
1337
1337
|
type = _ref.type,
|
1338
|
+
item = _ref.item,
|
1338
1339
|
sortable = _ref.sortable;
|
1339
1340
|
|
1340
|
-
var _ref2 = type === TYPES.ENTITY ? [1,
|
1341
|
+
var _ref2 = type === TYPES.ENTITY ? [1, Object.keys(item).length] : [2, 1],
|
1341
1342
|
rowspan = _ref2[0],
|
1342
1343
|
colspan = _ref2[1];
|
1343
1344
|
|
@@ -1360,10 +1361,11 @@
|
|
1360
1361
|
var type = _ref3.type;
|
1361
1362
|
return type === TYPES.ENTITY;
|
1362
1363
|
}).map(function (column) {
|
1363
|
-
var
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1364
|
+
var item = column.item;
|
1365
|
+
var fields = item ? Object.values(item) : [];
|
1366
|
+
return fields.filter(function (field) {
|
1367
|
+
return field.column === true;
|
1368
|
+
}).map(function (field) {
|
1367
1369
|
return /*#__PURE__*/React__default["default"].createElement("th", null, field.label);
|
1368
1370
|
});
|
1369
1371
|
}))), /*#__PURE__*/React__default["default"].createElement("tbody", null, multiSort(rows, sortDir).map(function (row) {
|
@@ -1559,36 +1561,39 @@
|
|
1559
1561
|
options: options
|
1560
1562
|
});
|
1561
1563
|
|
1562
|
-
case TYPES.ENTITY:
|
1563
|
-
return /*#__PURE__*/React__default["default"].createElement(EntityCellViewer, {
|
1564
|
-
id: id,
|
1565
|
-
value: cell
|
1566
|
-
});
|
1567
|
-
|
1568
1564
|
default:
|
1569
1565
|
return cell;
|
1570
1566
|
}
|
1571
1567
|
}
|
1572
1568
|
};
|
1573
1569
|
|
1574
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
1570
|
+
return column.type === TYPES.ENTITY ? /*#__PURE__*/React__default["default"].createElement(EntityCellViewer, {
|
1571
|
+
id: column.id,
|
1572
|
+
item: column.item,
|
1573
|
+
value: cell
|
1574
|
+
}) : /*#__PURE__*/React__default["default"].createElement("td", {
|
1575
1575
|
key: column.id,
|
1576
1576
|
className: column.id
|
1577
1577
|
}, render(column.type));
|
1578
1578
|
};
|
1579
|
+
/**
|
1580
|
+
* Entity Cell Viewer
|
1581
|
+
* @param {*} param0
|
1582
|
+
* @returns
|
1583
|
+
*/
|
1584
|
+
|
1579
1585
|
|
1580
1586
|
var EntityCellViewer = function EntityCellViewer(_ref5) {
|
1581
1587
|
var id = _ref5.id,
|
1588
|
+
item = _ref5.item,
|
1582
1589
|
value = _ref5.value;
|
1583
|
-
console.log(id, value);
|
1584
|
-
var
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
return
|
1589
|
-
})
|
1590
|
-
return /*#__PURE__*/React__default["default"].createElement("div", null, v);
|
1591
|
-
}));
|
1590
|
+
console.log(id, item, value);
|
1591
|
+
var fields = Object.values(item).filter(function (field) {
|
1592
|
+
return field.column === true;
|
1593
|
+
});
|
1594
|
+
return fields.map(function (field) {
|
1595
|
+
return /*#__PURE__*/React__default["default"].createElement("td", null, value[field.id]);
|
1596
|
+
});
|
1592
1597
|
};
|
1593
1598
|
/**
|
1594
1599
|
* Boolean Cell Viewer
|