e-virt-table 0.0.18 → 0.0.19
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/dist/index.cjs.js +3 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +11 -5
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Editor.js +25 -5
- package/dist/lib/Editor.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -5061,12 +5061,18 @@ class qi {
|
|
|
5061
5061
|
if (this.enable) {
|
|
5062
5062
|
if ((r.altKey || r.metaKey) && r.code === "Enter") {
|
|
5063
5063
|
r.preventDefault();
|
|
5064
|
-
const n = this.inputEl.
|
|
5065
|
-
|
|
5064
|
+
const n = this.inputEl, l = window.getSelection();
|
|
5065
|
+
if (!n || !l || !l.rangeCount) return;
|
|
5066
|
+
const h = l.getRangeAt(0);
|
|
5067
|
+
if (h.startContainer === n && h.startOffset === n.childNodes.length)
|
|
5068
|
+
n.textContent += `
|
|
5066
5069
|
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
+
`, l.selectAllChildren(this.inputEl), l.collapseToEnd();
|
|
5071
|
+
else {
|
|
5072
|
+
const d = document.createTextNode(`
|
|
5073
|
+
`);
|
|
5074
|
+
h.insertNode(d), h.setStartAfter(d), h.collapse(!1), l.removeAllRanges(), l.addRange(h);
|
|
5075
|
+
}
|
|
5070
5076
|
return;
|
|
5071
5077
|
}
|
|
5072
5078
|
(r.code === "Escape" || r.code === "Enter") && (r.preventDefault(), this.inputEl.blur());
|