ywana-core8 0.0.508 → 0.0.509
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 +48 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +48 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +48 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/table.js +39 -16
package/dist/index.umd.js
CHANGED
@@ -1809,7 +1809,8 @@
|
|
1809
1809
|
return column.type === TYPES.ENTITY ? /*#__PURE__*/React__default["default"].createElement(EntityCellViewer, {
|
1810
1810
|
id: column.id,
|
1811
1811
|
item: column.item,
|
1812
|
-
value: cell
|
1812
|
+
value: cell,
|
1813
|
+
format: format
|
1813
1814
|
}) : /*#__PURE__*/React__default["default"].createElement("td", {
|
1814
1815
|
key: column.id,
|
1815
1816
|
className: column.id
|
@@ -1824,15 +1825,59 @@
|
|
1824
1825
|
|
1825
1826
|
var EntityCellViewer = function EntityCellViewer(_ref5) {
|
1826
1827
|
var item = _ref5.item,
|
1827
|
-
value = _ref5.value
|
1828
|
+
value = _ref5.value,
|
1829
|
+
format = _ref5.format;
|
1828
1830
|
var fields = Object.values(item).filter(function (field) {
|
1829
1831
|
return field.column === true;
|
1830
1832
|
});
|
1831
1833
|
return fields.map(function (field) {
|
1834
|
+
var text = value[field.id];
|
1835
|
+
|
1836
|
+
switch (format) {
|
1837
|
+
case FORMATS.COLOR:
|
1838
|
+
text = /*#__PURE__*/React__default["default"].createElement("input", {
|
1839
|
+
type: "color",
|
1840
|
+
value: text,
|
1841
|
+
disabled: true
|
1842
|
+
});
|
1843
|
+
|
1844
|
+
case FORMATS.URL:
|
1845
|
+
text = /*#__PURE__*/React__default["default"].createElement("a", {
|
1846
|
+
href: text,
|
1847
|
+
target: "download",
|
1848
|
+
download: true
|
1849
|
+
}, text);
|
1850
|
+
break;
|
1851
|
+
|
1852
|
+
case FORMATS.IMG:
|
1853
|
+
text = /*#__PURE__*/React__default["default"].createElement("img", {
|
1854
|
+
src: text
|
1855
|
+
});
|
1856
|
+
break;
|
1857
|
+
|
1858
|
+
case FORMATS.DATE:
|
1859
|
+
var fecha = new Date(text);
|
1860
|
+
fecha.setMinutes(fecha.getMinutes() + fecha.getTimezoneOffset() + 1);
|
1861
|
+
text = fecha.toLocaleString(locale, {
|
1862
|
+
day: 'numeric',
|
1863
|
+
month: 'numeric',
|
1864
|
+
year: 'numeric'
|
1865
|
+
});
|
1866
|
+
break;
|
1867
|
+
|
1868
|
+
case FORMATS.TIME:
|
1869
|
+
text = new Date(text).toLocaleString(locale, {
|
1870
|
+
year: 'hour',
|
1871
|
+
month: 'minute',
|
1872
|
+
day: 'second'
|
1873
|
+
});
|
1874
|
+
break;
|
1875
|
+
}
|
1876
|
+
|
1832
1877
|
return /*#__PURE__*/React__default["default"].createElement("td", {
|
1833
1878
|
key: field.id,
|
1834
1879
|
className: "entity-cell " + field.id
|
1835
|
-
},
|
1880
|
+
}, text);
|
1836
1881
|
});
|
1837
1882
|
};
|
1838
1883
|
/**
|