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.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
|
|
@@ -1363,7 +1364,7 @@
|
|
1363
1364
|
var item = column.item;
|
1364
1365
|
var fields = item ? Object.values(item) : [];
|
1365
1366
|
return fields.filter(function (field) {
|
1366
|
-
return
|
1367
|
+
return field.column === true;
|
1367
1368
|
}).map(function (field) {
|
1368
1369
|
return /*#__PURE__*/React__default["default"].createElement("th", null, field.label);
|
1369
1370
|
});
|
@@ -1560,36 +1561,42 @@
|
|
1560
1561
|
options: options
|
1561
1562
|
});
|
1562
1563
|
|
1563
|
-
case TYPES.ENTITY:
|
1564
|
-
return /*#__PURE__*/React__default["default"].createElement(EntityCellViewer, {
|
1565
|
-
id: id,
|
1566
|
-
value: cell
|
1567
|
-
});
|
1568
|
-
|
1569
1564
|
default:
|
1570
1565
|
return cell;
|
1571
1566
|
}
|
1572
1567
|
}
|
1573
1568
|
};
|
1574
1569
|
|
1575
|
-
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", {
|
1576
1575
|
key: column.id,
|
1577
1576
|
className: column.id
|
1578
1577
|
}, render(column.type));
|
1579
1578
|
};
|
1579
|
+
/**
|
1580
|
+
* Entity Cell Viewer
|
1581
|
+
* @param {*} param0
|
1582
|
+
* @returns
|
1583
|
+
*/
|
1584
|
+
|
1580
1585
|
|
1581
1586
|
var EntityCellViewer = function EntityCellViewer(_ref5) {
|
1582
1587
|
var id = _ref5.id,
|
1588
|
+
item = _ref5.item,
|
1583
1589
|
value = _ref5.value;
|
1584
|
-
console.log(id, value);
|
1585
|
-
var
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
return
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
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", {
|
1596
|
+
key: column.id,
|
1597
|
+
className: "entity-cell " + column.id
|
1598
|
+
}, value[field.id]);
|
1599
|
+
});
|
1593
1600
|
};
|
1594
1601
|
/**
|
1595
1602
|
* Boolean Cell Viewer
|