componenteshospitais 1.8.5 → 1.8.6

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/cjs/index.js CHANGED
@@ -17532,9 +17532,9 @@ var styles = {"tableContainer":"tableStandard-module_tableContainer__W2g84","tab
17532
17532
  styleInject(css_248z);
17533
17533
 
17534
17534
  var TableStandard = function (_a) {
17535
- var dados = _a.dados, onRowClick = _a.onRowClick, _b = _a.idColumn, idColumn = _b === void 0 ? 'id' : _b, onActionClick = _a.onActionClick, onDownloadClick = _a.onDownloadClick, _c = _a.showActionColumn, showActionColumn = _c === void 0 ? false : _c, _d = _a.showDownloadButton, showDownloadButton = _d === void 0 ? false : _d, _e = _a.showExcelDownloadButton, showExcelDownloadButton = _e === void 0 ? false : _e, _f = _a.cor, cor = _f === void 0 ? false : _f, _g = _a.numeroPaginas, numeroPaginas = _g === void 0 ? 10 : _g, empresa = _a.empresa;
17536
- var _h = React$2.useState(null), selectedRow = _h[0], setSelectedRow = _h[1];
17537
- var _j = React$2.useState(1), currentPage = _j[0], setCurrentPage = _j[1];
17535
+ var dados = _a.dados, onRowClick = _a.onRowClick, _b = _a.idColumn, idColumn = _b === void 0 ? 'id' : _b, onActionClick = _a.onActionClick, onDownloadClick = _a.onDownloadClick, onViewClick = _a.onViewClick, _c = _a.showActionColumn, showActionColumn = _c === void 0 ? false : _c, _d = _a.showDownloadButton, showDownloadButton = _d === void 0 ? false : _d, _e = _a.showExcelDownloadButton, showExcelDownloadButton = _e === void 0 ? false : _e, _f = _a.showViewButton, showViewButton = _f === void 0 ? false : _f, _g = _a.cor, cor = _g === void 0 ? false : _g, _h = _a.numeroPaginas, numeroPaginas = _h === void 0 ? 10 : _h, empresa = _a.empresa;
17536
+ var _j = React$2.useState(null), selectedRow = _j[0], setSelectedRow = _j[1];
17537
+ var _k = React$2.useState(1), currentPage = _k[0], setCurrentPage = _k[1];
17538
17538
  var ultimoItem = currentPage * numeroPaginas;
17539
17539
  var primeiroItem = ultimoItem - numeroPaginas;
17540
17540
  var currentItems = dados.slice(primeiroItem, ultimoItem);
@@ -17571,10 +17571,10 @@ var TableStandard = function (_a) {
17571
17571
  React$2.createElement("thead", null,
17572
17572
  React$2.createElement("tr", { className: "".concat(empresaClass, " ").concat(styles.row) },
17573
17573
  Object.keys(dados[0] || {}).map(function (key) { return (React$2.createElement("th", { key: key, className: styles.header }, key.charAt(0).toUpperCase() + key.slice(1))); }),
17574
- (showActionColumn || showDownloadButton) && React$2.createElement("th", { className: styles.header }, "A\u00E7\u00F5es"))),
17574
+ (showActionColumn || showDownloadButton || showViewButton) && React$2.createElement("th", { className: styles.header }, "A\u00E7\u00F5es"))),
17575
17575
  React$2.createElement("tbody", null, currentItems.map(function (row, index) { return (React$2.createElement("tr", { key: index, className: "".concat(styles.row, " ").concat(selectedRow === row[idColumn] ? styles.activeRow : ''), onClick: function () { return handleRowClick(row); }, style: { background: cor ? 'white' : '' } },
17576
17576
  Object.keys(row).map(function (key, i) { return (React$2.createElement("td", { key: i, className: styles.cell }, row[key])); }),
17577
- (showActionColumn || showDownloadButton) && (React$2.createElement("td", { className: styles.cell },
17577
+ (showActionColumn || showDownloadButton || showViewButton) && (React$2.createElement("td", { className: styles.cell },
17578
17578
  React$2.createElement("div", { style: { display: 'flex', gap: '0.5rem', justifyContent: 'center' }, className: "".concat(empresaClass) },
17579
17579
  showActionColumn && (React$2.createElement("button", { onClick: function (e) {
17580
17580
  e.stopPropagation();
@@ -17587,7 +17587,13 @@ var TableStandard = function (_a) {
17587
17587
  if (onDownloadClick)
17588
17588
  onDownloadClick(row[idColumn]);
17589
17589
  }, className: styles.downloadButton, title: 'Download do Arquivo' },
17590
- React$2.createElement(FaDownload, null)))))))); }))),
17590
+ React$2.createElement(FaDownload, null))),
17591
+ showViewButton && (React$2.createElement("button", { onClick: function (e) {
17592
+ e.stopPropagation();
17593
+ if (onViewClick)
17594
+ onViewClick(row[idColumn]);
17595
+ }, className: styles.actionButton, title: 'Visualizar' },
17596
+ React$2.createElement(FaEye, null)))))))); }))),
17591
17597
  React$2.createElement("div", { className: "".concat(empresaClass, " ").concat(styles.pagination) }, pageNumbers.map(function (number) { return (React$2.createElement("button", { key: number, onClick: function () { return setCurrentPage(number); }, className: "".concat(styles.pageButton, " ").concat(currentPage === number ? styles.activePage : '') }, number)); }))));
17592
17598
  };
17593
17599