@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 +12 -12
- package/all.js.map +1 -1
- package/index.js +11 -5
- package/index.js.map +1 -1
- package/lib/core/internal/event-delegation.d.ts.map +1 -1
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
- package/lib/plugins/clipboard/copy.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +55 -55
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +3 -3
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +1 -1
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +4 -4
- package/umd/plugins/clipboard.umd.js.map +1 -1
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
89
|
-
|
|
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)
|
|
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,
|