@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/all.js CHANGED
@@ -17,11 +17,12 @@ function Rt(a) {
17
17
  async function St(a) {
18
18
  try {
19
19
  return await navigator.clipboard.writeText(a), !0;
20
- } catch {
21
- const e = document.createElement("textarea");
22
- e.value = a, e.style.position = "fixed", e.style.opacity = "0", e.style.pointerEvents = "none", document.body.appendChild(e), e.select();
23
- const t = document.execCommand("copy");
24
- return document.body.removeChild(e), t;
20
+ } catch (e) {
21
+ console.warn("[copyToClipboard] Clipboard API failed:", e);
22
+ const t = document.createElement("textarea");
23
+ t.value = a, t.style.position = "fixed", t.style.opacity = "0", t.style.pointerEvents = "none", document.body.appendChild(t), t.select();
24
+ const i = document.execCommand("copy");
25
+ return document.body.removeChild(t), i;
25
26
  }
26
27
  }
27
28
  function Ae(a, e) {
@@ -84,17 +85,15 @@ class _n extends I {
84
85
  }
85
86
  lastCopied = null;
86
87
  attach(e) {
87
- super.attach(e), e.addEventListener(
88
- "paste",
89
- (t) => this.#e(t),
90
- { signal: this.disconnectSignal }
91
- );
88
+ super.attach(e), e.addEventListener("paste", (i) => this.#e(i), {
89
+ signal: this.disconnectSignal
90
+ });
92
91
  }
93
92
  detach() {
94
93
  this.lastCopied = null;
95
94
  }
96
95
  onKeyDown(e) {
97
- return (e.ctrlKey || e.metaKey) && e.key === "c" ? (this.#t(e.target), !0) : !1;
96
+ return (e.ctrlKey || e.metaKey) && e.key === "c" ? (e.preventDefault(), this.#t(e.target), !0) : !1;
98
97
  }
99
98
  #t(e) {
100
99
  const t = this.#r();
@@ -182,7 +181,8 @@ class _n extends I {
182
181
  }
183
182
  async copy(e) {
184
183
  const { columns: t, rows: i } = this.#i(e);
185
- if (t.length === 0 || i.length === 0) return "";
184
+ if (t.length === 0 || i.length === 0)
185
+ return "";
186
186
  const n = this.#n(t, i, e);
187
187
  return await St(n), this.lastCopied = { text: n, timestamp: Date.now() }, this.emit("copy", {
188
188
  text: n,