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.modern.js
CHANGED
@@ -1806,8 +1806,7 @@ var DataTableCell = function DataTableCell(_ref4) {
|
|
1806
1806
|
return column.type === TYPES.ENTITY ? /*#__PURE__*/React.createElement(EntityCellViewer, {
|
1807
1807
|
id: column.id,
|
1808
1808
|
item: column.item,
|
1809
|
-
value: cell
|
1810
|
-
format: format
|
1809
|
+
value: cell
|
1811
1810
|
}) : /*#__PURE__*/React.createElement("td", {
|
1812
1811
|
key: column.id,
|
1813
1812
|
className: column.id
|
@@ -1822,53 +1821,54 @@ var DataTableCell = function DataTableCell(_ref4) {
|
|
1822
1821
|
|
1823
1822
|
var EntityCellViewer = function EntityCellViewer(_ref5) {
|
1824
1823
|
var item = _ref5.item,
|
1825
|
-
value = _ref5.value
|
1826
|
-
format = _ref5.format;
|
1824
|
+
value = _ref5.value;
|
1827
1825
|
var fields = Object.values(item).filter(function (field) {
|
1828
1826
|
return field.column === true;
|
1829
1827
|
});
|
1830
1828
|
return fields.map(function (field) {
|
1831
1829
|
var text = value[field.id];
|
1832
1830
|
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1831
|
+
if (field.format) {
|
1832
|
+
switch (format) {
|
1833
|
+
case FORMATS.COLOR:
|
1834
|
+
text = /*#__PURE__*/React.createElement("input", {
|
1835
|
+
type: "color",
|
1836
|
+
value: text,
|
1837
|
+
disabled: true
|
1838
|
+
});
|
1840
1839
|
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
1849
|
-
case FORMATS.IMG:
|
1850
|
-
text = /*#__PURE__*/React.createElement("img", {
|
1851
|
-
src: text
|
1852
|
-
});
|
1853
|
-
break;
|
1840
|
+
case FORMATS.URL:
|
1841
|
+
text = /*#__PURE__*/React.createElement("a", {
|
1842
|
+
href: text,
|
1843
|
+
target: "download",
|
1844
|
+
download: true
|
1845
|
+
}, text);
|
1846
|
+
break;
|
1854
1847
|
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
month: 'numeric',
|
1861
|
-
year: 'numeric'
|
1862
|
-
});
|
1863
|
-
break;
|
1848
|
+
case FORMATS.IMG:
|
1849
|
+
text = /*#__PURE__*/React.createElement("img", {
|
1850
|
+
src: text
|
1851
|
+
});
|
1852
|
+
break;
|
1864
1853
|
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1854
|
+
case FORMATS.DATE:
|
1855
|
+
var fecha = new Date(text);
|
1856
|
+
fecha.setMinutes(fecha.getMinutes() + fecha.getTimezoneOffset() + 1);
|
1857
|
+
text = fecha.toLocaleString(locale, {
|
1858
|
+
day: 'numeric',
|
1859
|
+
month: 'numeric',
|
1860
|
+
year: 'numeric'
|
1861
|
+
});
|
1862
|
+
break;
|
1863
|
+
|
1864
|
+
case FORMATS.TIME:
|
1865
|
+
text = new Date(text).toLocaleString(locale, {
|
1866
|
+
year: 'hour',
|
1867
|
+
month: 'minute',
|
1868
|
+
day: 'second'
|
1869
|
+
});
|
1870
|
+
break;
|
1871
|
+
}
|
1872
1872
|
}
|
1873
1873
|
|
1874
1874
|
return /*#__PURE__*/React.createElement("td", {
|