@xqmsg/ui-core 0.15.3 → 0.15.4

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.
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ /**
3
+ * A React component utilized to render the `EmptyTable` component
4
+ */
5
+ export declare const EmptyTable: React.FC;
@@ -11,4 +11,4 @@ export interface TableProps<T extends ReadonlyTableColumns> {
11
11
  /**
12
12
  * A React component utilized to render the `Table` component
13
13
  */
14
- export declare function Table<T extends ReadonlyTableColumns>({ columns, headers, body, placeholder, loading, loadMore, }: TableProps<T>): JSX.Element;
14
+ export declare function Table<T extends ReadonlyTableColumns>({ columns, headers, body, loading, loadMore, }: TableProps<T>): JSX.Element;
@@ -1766,6 +1766,58 @@ var TableLoadingRows = function TableLoadingRows(_ref) {
1766
1766
  }));
1767
1767
  };
1768
1768
 
1769
+ /**
1770
+ * A React component utilized to render the `EmptyTable` component
1771
+ */
1772
+
1773
+ var EmptyTable = function EmptyTable() {
1774
+ var getOpacity = function getOpacity(index) {
1775
+ switch (index) {
1776
+ case 1:
1777
+ return 0.7;
1778
+
1779
+ case 3:
1780
+ return 0.6;
1781
+
1782
+ case 5:
1783
+ return 0.5;
1784
+
1785
+ case 7:
1786
+ return 0.4;
1787
+
1788
+ case 9:
1789
+ return 0.3;
1790
+
1791
+ case 11:
1792
+ return 0.2;
1793
+
1794
+ case 13:
1795
+ return 0.1;
1796
+
1797
+ default:
1798
+ return 1;
1799
+ }
1800
+ };
1801
+
1802
+ return /*#__PURE__*/React__default.createElement(react.Table, {
1803
+ variant: "unstyled",
1804
+ width: "100%",
1805
+ style: {
1806
+ borderCollapse: 'separate',
1807
+ borderSpacing: '0px'
1808
+ }
1809
+ }, /*#__PURE__*/React__default.createElement(react.Tbody, null, Array.from({
1810
+ length: 14
1811
+ }, function (_, i) {
1812
+ return i + 1;
1813
+ }).map(function (i) {
1814
+ return /*#__PURE__*/React__default.createElement(react.Tr, null, /*#__PURE__*/React__default.createElement(react.Td, {
1815
+ height: "23px",
1816
+ opacity: getOpacity(i)
1817
+ }));
1818
+ })));
1819
+ };
1820
+
1769
1821
  /**
1770
1822
  * A React component utilized to render the `Table` component
1771
1823
  */
@@ -1774,8 +1826,6 @@ function Table(_ref) {
1774
1826
  var columns = _ref.columns,
1775
1827
  headers = _ref.headers,
1776
1828
  body = _ref.body,
1777
- _ref$placeholder = _ref.placeholder,
1778
- placeholder = _ref$placeholder === void 0 ? 'There is currently no available data' : _ref$placeholder,
1779
1829
  loading = _ref.loading,
1780
1830
  loadMore = _ref.loadMore;
1781
1831
  var columnsAsConst = generateTableColumnsAsConst(columns);
@@ -1784,7 +1834,7 @@ function Table(_ref) {
1784
1834
  overflowX: "auto",
1785
1835
  bg: "white",
1786
1836
  width: "100%"
1787
- }, /*#__PURE__*/React__default.createElement(react.Table, {
1837
+ }, body.length ? /*#__PURE__*/React__default.createElement(react.Table, {
1788
1838
  variant: "unstyled",
1789
1839
  width: "100%",
1790
1840
  style: {
@@ -1809,12 +1859,10 @@ function Table(_ref) {
1809
1859
  React__default.createElement(react.Td, null, row[column])
1810
1860
  );
1811
1861
  }));
1812
- })), !body.length && /*#__PURE__*/React__default.createElement(react.TableCaption, {
1813
- py: 10
1814
- }, placeholder), ' '), loadMore && loading !== undefined && /*#__PURE__*/React__default.createElement(TableLoadingRows, {
1862
+ }))) : /*#__PURE__*/React__default.createElement(EmptyTable, null), loadMore && loading !== undefined && body.length ? /*#__PURE__*/React__default.createElement(TableLoadingRows, {
1815
1863
  isLoading: loading,
1816
1864
  onLoadMore: loadMore
1817
- }));
1865
+ }) : null);
1818
1866
  }
1819
1867
 
1820
1868
  /**