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