jclib-ui 1.0.217 → 1.0.218

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.
@@ -4564,21 +4564,29 @@ function Table({
4564
4564
  acoes.acoes = newAcoes;
4565
4565
  incColActions = acoes.acoes.length > 0;
4566
4566
  }
4567
+ function hasSelection(element) {
4568
+ const selecao = window.getSelection();
4569
+ if (selecao.rangeCount > 0) {
4570
+ const range = selecao.getRangeAt(0);
4571
+ if (element.contains(range.commonAncestorContainer)) {
4572
+ if (selecao.toString().length > 0) {
4573
+ return true;
4574
+ }
4575
+ }
4576
+ }
4577
+ return false;
4578
+ }
4567
4579
  function handleClick(line, ev) {
4568
4580
  if (onClick) {
4581
+ if (hasSelection(ev == null ? void 0 : ev.currentTarget)) {
4582
+ return;
4583
+ }
4569
4584
  onClick(line, ev);
4570
4585
  return;
4571
4586
  }
4572
4587
  if (clickCanEdit && isDesktop()) {
4573
- const elemento = ev == null ? void 0 : ev.currentTarget;
4574
- const selecao = window.getSelection();
4575
- if (selecao.rangeCount > 0) {
4576
- const range = selecao.getRangeAt(0);
4577
- if (elemento.contains(range.commonAncestorContainer)) {
4578
- if (selecao.toString().length > 0) {
4579
- return;
4580
- }
4581
- }
4588
+ if (hasSelection(ev == null ? void 0 : ev.currentTarget)) {
4589
+ return;
4582
4590
  }
4583
4591
  const id = line[(acoes == null ? void 0 : acoes.campo) || "id"];
4584
4592
  if (id != void 0) {