jclib-ui 1.0.204 → 1.0.205

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.
@@ -1,3 +1,15 @@
1
- import { FormConsultaProps } from './FormConsulta.types';
2
-
3
- export default function FormConsulta({ titulo, rotaApi, headersApi, rotaApp, cols, ordens, ordemPadrao, campoChave, placeHolder, msgSemDados, helpLink, getLineColor, }: FormConsultaProps): import("react/jsx-runtime").JSX.Element;
1
+ export default function FormConsulta({ titulo, rotaApi, rotaApp, cols, acoes, ordens, ordemPadrao, campoChave, placeHolder, helpLink, Modal, maxWidth, clickCanEdit, }: {
2
+ titulo: any;
3
+ rotaApi: any;
4
+ rotaApp: any;
5
+ cols: any;
6
+ acoes: any;
7
+ ordens: any;
8
+ ordemPadrao?: number;
9
+ campoChave: any;
10
+ placeHolder?: string;
11
+ helpLink: any;
12
+ Modal: any;
13
+ maxWidth?: number;
14
+ clickCanEdit: any;
15
+ }): import("react/jsx-runtime").JSX.Element;
@@ -4546,7 +4546,8 @@ function Table({
4546
4546
  msgSemDados = "Nenhum registro encontrado!",
4547
4547
  getLineColor,
4548
4548
  onClick,
4549
- fixedHeader
4549
+ fixedHeader,
4550
+ clickCanEdit
4550
4551
  }) {
4551
4552
  var _a;
4552
4553
  if (colunas) {
@@ -4562,6 +4563,21 @@ function Table({
4562
4563
  acoes.acoes = newAcoes;
4563
4564
  incColActions = acoes.acoes.length > 0;
4564
4565
  }
4566
+ function handleClick(line) {
4567
+ if (onClick) {
4568
+ onClick(line, null);
4569
+ return;
4570
+ }
4571
+ if (clickCanEdit && isDesktop()) {
4572
+ const id = line[(acoes == null ? void 0 : acoes.campo) || "id"];
4573
+ if (id) {
4574
+ const editAction = acoes == null ? void 0 : acoes.acoes[0];
4575
+ if (editAction && editAction.ativa !== false) {
4576
+ editAction.funcao(id, line, 0);
4577
+ }
4578
+ }
4579
+ }
4580
+ }
4565
4581
  if (!dados || dados.length == 0)
4566
4582
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "alert alert-warning", children: msgSemDados });
4567
4583
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$7, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableContainer, { alignTop, sizeBreak, hasBorder: border, children: [
@@ -4582,7 +4598,7 @@ function Table({
4582
4598
  opcoes,
4583
4599
  colorir,
4584
4600
  getLineColor,
4585
- onClick
4601
+ onClick: onClick || clickCanEdit ? handleClick : void 0
4586
4602
  }
4587
4603
  )
4588
4604
  ] }) });