@toolbox-web/grid 1.16.0 → 1.16.1

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/index.js CHANGED
@@ -1111,7 +1111,10 @@ function $(t, e) {
1111
1111
  const ie = /* @__PURE__ */ new WeakMap();
1112
1112
  function Nt(t, e) {
1113
1113
  const i = Ke(e), o = Pt(e);
1114
- i < 0 || o < 0 || (t._focusRow = i, t._focusCol = o, Ce(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
1114
+ if (i < 0 || o < 0) return;
1115
+ t._focusRow = i, t._focusCol = o, Ce(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true");
1116
+ const n = e.closest("tbw-grid");
1117
+ n && document.activeElement !== n && n.focus({ preventScroll: !0 });
1115
1118
  }
1116
1119
  function ye(t, e, i, o) {
1117
1120
  let n = null;
@@ -1156,14 +1159,17 @@ function Wt(t, e, i) {
1156
1159
  "mousedown",
1157
1160
  (o) => {
1158
1161
  const n = o.target.closest(".cell[data-col]");
1159
- n && (n.classList.contains("editing") || Nt(t, n));
1162
+ n && (n.classList.contains("editing") || (o.preventDefault(), Nt(t, n)));
1160
1163
  },
1161
1164
  { signal: i }
1162
1165
  ), e.addEventListener(
1163
1166
  "click",
1164
1167
  (o) => {
1165
1168
  const n = o.target.closest(".data-grid-row");
1166
- n && Le(t, o, n);
1169
+ if (n && Le(t, o, n), !document.activeElement?.closest(".cell.editing")) {
1170
+ const r = o.target.closest("tbw-grid");
1171
+ r && r.focus({ preventScroll: !0 });
1172
+ }
1167
1173
  },
1168
1174
  { signal: i }
1169
1175
  ), e.addEventListener(
@@ -2756,7 +2762,7 @@ ${Ki}
2756
2762
  `;
2757
2763
  class k extends HTMLElement {
2758
2764
  static tagName = "tbw-grid";
2759
- static version = "1.16.0";
2765
+ static version = "1.16.1";
2760
2766
  static #l = 0;
2761
2767
  static adapters = [];
2762
2768
  static registerAdapter(e) {
@@ -3947,7 +3953,7 @@ const so = {
3947
3953
  class lo {
3948
3954
  static dependencies;
3949
3955
  static manifest;
3950
- version = "1.16.0";
3956
+ version = "1.16.1";
3951
3957
  styles;
3952
3958
  cellRenderers;
3953
3959
  headerRenderers;