@bireturn/word-editor 1.0.1 → 1.0.2
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/lib/word-editor.css +1 -1
- package/lib/word-editor.es.js +483 -491
- package/lib/word-editor.umd.js +2 -2
- package/package.json +1 -1
package/lib/word-editor.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var rn = Object.defineProperty;
|
|
2
2
|
var cn = (i, e, t) => e in i ? rn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var j = (i, e, t) => cn(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { computed as ke, ref as oe, onMounted as rt, onUnmounted as Ze, openBlock as h, createElementBlock as
|
|
4
|
+
import { computed as ke, ref as oe, onMounted as rt, onUnmounted as Ze, openBlock as h, createElementBlock as p, normalizeStyle as K, createElementVNode as re, Fragment as J, renderList as le, normalizeClass as Ie, createBlock as Fe, resolveDynamicComponent as Xe, toDisplayString as te, unref as Ae, createCommentVNode as ge, render as Ot, h as dn, defineComponent as un, getCurrentInstance as hn, watch as Be, nextTick as be, createVNode as G, createTextVNode as Re, isVNode as fn, renderSlot as gn, resolveComponent as pn, withCtx as nt, reactive as Bt, provide as vn, inject as mn } from "vue";
|
|
5
5
|
import { DynamicScroller as yn, DynamicScrollerItem as _n } from "vue-virtual-scroller";
|
|
6
6
|
import { ChevronRight as Ht, MoreHorizontal as yt, Download as it, Upload as bn, Save as xn, RotateCcw as kn, History as wn, Settings as Cn, Info as Mn, Globe as In, Lock as En, Share as Sn, ShieldCheck as Tn, Search as Fn, Filter as An, SortDesc as Pn, SortAsc as $n, Minus as Ln, Plus as _t, Eye as bt, FileText as at, Grid as Rn, Type as xt, FileDown as kt, Layers as wt, Edit as On, Move as Bn, Copy as Hn, Trash2 as Ct, Clipboard as Mt, PlusCircle as It, ArrowDown as Et, Navigation as St, ChevronDown as Dn, PanelLeftOpen as zn, ListTree as Nn, PanelLeftClose as Vn } from "lucide-vue-next";
|
|
7
7
|
const jn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" }, Kn = ["onMouseenter", "onMouseleave"], qn = ["onClick"], Wn = { class: "we-vt-context-menu--link-content menu-label" }, Un = {
|
|
@@ -36,33 +36,33 @@ const jn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
|
|
|
36
36
|
left: `${(W = l.e) == null ? void 0 : W.pageX}px`,
|
|
37
37
|
top: `${(B = l.e) == null ? void 0 : B.pageY}px`
|
|
38
38
|
};
|
|
39
|
-
}), d = oe([]),
|
|
40
|
-
let
|
|
41
|
-
const N = oe(),
|
|
39
|
+
}), d = oe([]), A = oe(null);
|
|
40
|
+
let E = null;
|
|
41
|
+
const N = oe(), P = (W, B, b) => {
|
|
42
42
|
if (W.children && W.children.length > 0) {
|
|
43
43
|
B && B.preventDefault() && B.stopPropagation();
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
W.disabled || (
|
|
46
|
+
W.disabled || (b ? t("menuClick", { ...W, parent: b.code }, l.row) : t("menuClick", W, l.row)), B && B.preventDefault() && B.stopPropagation();
|
|
47
47
|
}, X = (W) => {
|
|
48
48
|
let B = W.target;
|
|
49
49
|
for (; B && B != N.value; )
|
|
50
50
|
B = B.parentNode;
|
|
51
51
|
B != N.value && t("close");
|
|
52
52
|
}, V = (W, B) => {
|
|
53
|
-
W.currentTarget.classList.add("link--active"),
|
|
54
|
-
|
|
53
|
+
W.currentTarget.classList.add("link--active"), E && (clearTimeout(E), E = null), B.children && B.children.length > 0 ? A.value = B.code : E = setTimeout(() => {
|
|
54
|
+
A.value = null;
|
|
55
55
|
}, 100);
|
|
56
56
|
}, q = (W, B) => {
|
|
57
|
-
W.currentTarget.classList.remove("link--active"), B.children && B.children.length > 0 && (
|
|
58
|
-
|
|
57
|
+
W.currentTarget.classList.remove("link--active"), B.children && B.children.length > 0 && (E = setTimeout(() => {
|
|
58
|
+
A.value === B.code && (A.value = null);
|
|
59
59
|
}, 300));
|
|
60
60
|
}, Y = (W) => {
|
|
61
|
-
|
|
61
|
+
E && (clearTimeout(E), E = null), W.currentTarget.classList.add("link--active");
|
|
62
62
|
}, Z = (W) => {
|
|
63
63
|
W.currentTarget.classList.remove("link--active");
|
|
64
64
|
}, ye = (W) => {
|
|
65
|
-
const B = W.code || "",
|
|
65
|
+
const B = W.code || "", b = (W.name || "").toLowerCase(), m = {
|
|
66
66
|
// 添加操作 - 根据具体类型使用不同图标
|
|
67
67
|
"add-current": St,
|
|
68
68
|
// 添加(当前位置)
|
|
@@ -142,50 +142,50 @@ const jn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
|
|
|
142
142
|
more: yt
|
|
143
143
|
// 更多
|
|
144
144
|
};
|
|
145
|
-
return m[B] ? m[B] :
|
|
145
|
+
return m[B] ? m[B] : b.includes("添加") || b.includes("add") ? b.includes("当前") || b.includes("current") ? St : b.includes("下") || b.includes("next") ? Et : b.includes("子") || b.includes("child") ? It : _t : b.includes("导出") || b.includes("export") ? b.includes("节") || b.includes("section") ? wt : b.includes("章") || b.includes("chapter") ? kt : it : b.includes("粘贴") || b.includes("paste") ? Mt : b.includes("删除") || b.includes("delete") ? Ct : b.includes("pdf") ? at : b.includes("word") ? xt : yt;
|
|
146
146
|
};
|
|
147
147
|
return rt(() => {
|
|
148
|
-
var W, B,
|
|
149
|
-
(W = l.menuConfig) != null && W.visibleMethod && typeof ((B = l.menuConfig) == null ? void 0 : B.visibleMethod) == "function" && ((
|
|
150
|
-
options: (m = (
|
|
148
|
+
var W, B, b, m, x, r, L;
|
|
149
|
+
(W = l.menuConfig) != null && W.visibleMethod && typeof ((B = l.menuConfig) == null ? void 0 : B.visibleMethod) == "function" && ((x = l.menuConfig) == null || x.visibleMethod({
|
|
150
|
+
options: (m = (b = l.menuConfig) == null ? void 0 : b.body) == null ? void 0 : m.options,
|
|
151
151
|
row: l.row
|
|
152
|
-
})), d.value = (((
|
|
152
|
+
})), d.value = (((L = (r = l.menuConfig) == null ? void 0 : r.body) == null ? void 0 : L.options) || []).flat(), document.addEventListener("click", X, !0);
|
|
153
153
|
}), Ze(() => {
|
|
154
154
|
document.removeEventListener("click", X, !0);
|
|
155
|
-
}), (W, B) => (h(),
|
|
155
|
+
}), (W, B) => (h(), p("div", {
|
|
156
156
|
class: "we-vt-table--context-menu-wrapper virtual-table-menu modern-virtual-menu",
|
|
157
157
|
ref_key: "contextMenuRef",
|
|
158
158
|
ref: N,
|
|
159
159
|
style: K([{ display: "inline-block" }, o.value])
|
|
160
160
|
}, [
|
|
161
161
|
re("ul", jn, [
|
|
162
|
-
(h(!0),
|
|
162
|
+
(h(!0), p(J, null, le(d.value, (b) => (h(), p("li", {
|
|
163
163
|
class: Ie({
|
|
164
|
-
"link--disabled":
|
|
165
|
-
"has-children":
|
|
164
|
+
"link--disabled": b.disabled,
|
|
165
|
+
"has-children": b.children && b.children.length > 0,
|
|
166
166
|
"modern-menu-item": !0
|
|
167
167
|
}),
|
|
168
|
-
key:
|
|
169
|
-
onMouseenter: (m) => V(m,
|
|
170
|
-
onMouseleave: (m) => q(m,
|
|
168
|
+
key: b.code,
|
|
169
|
+
onMouseenter: (m) => V(m, b),
|
|
170
|
+
onMouseleave: (m) => q(m, b)
|
|
171
171
|
}, [
|
|
172
172
|
re("a", {
|
|
173
173
|
class: "we-vt-context-menu--link modern-menu-link",
|
|
174
|
-
onClick: (m) =>
|
|
174
|
+
onClick: (m) => P(b, m)
|
|
175
175
|
}, [
|
|
176
|
-
(h(), Fe(Xe(ye(
|
|
176
|
+
(h(), Fe(Xe(ye(b)), {
|
|
177
177
|
size: 16,
|
|
178
178
|
class: "menu-icon"
|
|
179
179
|
})),
|
|
180
|
-
re("span", Wn, te(
|
|
181
|
-
|
|
180
|
+
re("span", Wn, te(b.name), 1),
|
|
181
|
+
b.children && b.children.length > 0 ? (h(), Fe(Ae(Ht), {
|
|
182
182
|
key: 0,
|
|
183
183
|
size: 14,
|
|
184
184
|
class: "submenu-arrow"
|
|
185
185
|
})) : ge("", !0)
|
|
186
186
|
], 8, qn),
|
|
187
|
-
|
|
188
|
-
(h(!0),
|
|
187
|
+
b.children && b.children.length > 0 && A.value === b.code ? (h(), p("ul", Un, [
|
|
188
|
+
(h(!0), p(J, null, le(b.children, (m) => (h(), p("li", {
|
|
189
189
|
key: m.code,
|
|
190
190
|
class: Ie({
|
|
191
191
|
"link--disabled": m.disabled,
|
|
@@ -196,7 +196,7 @@ const jn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
|
|
|
196
196
|
}, [
|
|
197
197
|
re("a", {
|
|
198
198
|
class: "we-vt-context-menu--link modern-submenu-link",
|
|
199
|
-
onClick: (
|
|
199
|
+
onClick: (x) => P(m, x, b)
|
|
200
200
|
}, [
|
|
201
201
|
(h(), Fe(Xe(ye(m)), {
|
|
202
202
|
size: 14,
|
|
@@ -233,19 +233,19 @@ function ti(i, e, t) {
|
|
|
233
233
|
const l = (t == null ? void 0 : t.keyField) || (t == null ? void 0 : t.rowField) || "node_id", o = (t == null ? void 0 : t.parentField) || "parent_id", d = (t == null ? void 0 : t.parentField) || "order";
|
|
234
234
|
if (!(i != null && i.length))
|
|
235
235
|
return i;
|
|
236
|
-
const
|
|
236
|
+
const A = {};
|
|
237
237
|
i.forEach((X) => {
|
|
238
238
|
const V = X[o];
|
|
239
|
-
|
|
239
|
+
A[V] || (A[V] = []), A[V].push(X);
|
|
240
240
|
});
|
|
241
|
-
function
|
|
242
|
-
const V =
|
|
241
|
+
function E(X) {
|
|
242
|
+
const V = A[X] || [];
|
|
243
243
|
V.sort(
|
|
244
244
|
(Y, Z) => Y[d] && Z[d] ? Y[d] - Z[d] : 0
|
|
245
245
|
);
|
|
246
246
|
const q = [];
|
|
247
247
|
return V.forEach((Y) => {
|
|
248
|
-
q.push(Y), q.push(...
|
|
248
|
+
q.push(Y), q.push(...E(Y[l]));
|
|
249
249
|
}), q;
|
|
250
250
|
}
|
|
251
251
|
let N = [];
|
|
@@ -261,10 +261,10 @@ function ti(i, e, t) {
|
|
|
261
261
|
q[Z] = (q[Z] || 0) + 1;
|
|
262
262
|
}), N = Object.entries(q).map(([Y]) => Y);
|
|
263
263
|
}
|
|
264
|
-
let
|
|
264
|
+
let P = [];
|
|
265
265
|
return N.forEach((X) => {
|
|
266
|
-
|
|
267
|
-
}),
|
|
266
|
+
P = P.concat(E(X));
|
|
267
|
+
}), P;
|
|
268
268
|
}
|
|
269
269
|
function Tt(i, e, t) {
|
|
270
270
|
let l;
|
|
@@ -355,19 +355,19 @@ const ii = /* @__PURE__ */ un({
|
|
|
355
355
|
expose: l
|
|
356
356
|
}) {
|
|
357
357
|
var vt;
|
|
358
|
-
const o = hn(), d = oe(),
|
|
358
|
+
const o = hn(), d = oe(), A = oe(!1), E = oe(null), N = oe(null), P = oe([]);
|
|
359
359
|
let X = /* @__PURE__ */ new Map();
|
|
360
360
|
const V = /* @__PURE__ */ new Map();
|
|
361
361
|
oe(0);
|
|
362
362
|
const q = oe([]);
|
|
363
363
|
oe([]);
|
|
364
|
-
const Y = oe(/* @__PURE__ */ new Set()), Z = oe(/* @__PURE__ */ new Set()), ye = oe(null), W = 2, B = /* @__PURE__ */ new WeakMap(),
|
|
364
|
+
const Y = oe(/* @__PURE__ */ new Set()), Z = oe(/* @__PURE__ */ new Set()), ye = oe(null), W = 2, B = /* @__PURE__ */ new WeakMap(), b = oe(null), m = oe(""), x = /* @__PURE__ */ new Set(), r = ke(() => {
|
|
365
365
|
try {
|
|
366
|
-
return Array.isArray(
|
|
366
|
+
return Array.isArray(P.value) ? P.value : [];
|
|
367
367
|
} catch {
|
|
368
368
|
return [];
|
|
369
369
|
}
|
|
370
|
-
}),
|
|
370
|
+
}), L = (n) => {
|
|
371
371
|
var f, c, u;
|
|
372
372
|
if (!n) return 30;
|
|
373
373
|
if (n.height) return n.height;
|
|
@@ -386,14 +386,14 @@ const ii = /* @__PURE__ */ un({
|
|
|
386
386
|
s = n.rowHeight || 35;
|
|
387
387
|
break;
|
|
388
388
|
case "table":
|
|
389
|
-
const
|
|
390
|
-
s = Math.max(100,
|
|
389
|
+
const C = ((n.content || "").match(/<tr/g) || []).length;
|
|
390
|
+
s = Math.max(100, C * 35 + 30);
|
|
391
391
|
break;
|
|
392
392
|
case "flowchart":
|
|
393
393
|
s = 200;
|
|
394
394
|
break;
|
|
395
395
|
default: {
|
|
396
|
-
const y = (n.content || "").length,
|
|
396
|
+
const y = (n.content || "").length, g = (n.title || "").length, w = y + g, R = ((u = (n.content || "").match(/[\u4e00-\u9fa5]/g)) == null ? void 0 : u.length) || 0, O = w - R, F = R * 12 + O * 6, H = Math.max(1, Math.ceil(F / 760));
|
|
397
397
|
s = Math.max(20, H * 18), n._editing && (s += 20);
|
|
398
398
|
break;
|
|
399
399
|
}
|
|
@@ -402,20 +402,20 @@ const ii = /* @__PURE__ */ un({
|
|
|
402
402
|
key: a,
|
|
403
403
|
height: s
|
|
404
404
|
}), s;
|
|
405
|
-
},
|
|
405
|
+
}, v = ke(() => {
|
|
406
406
|
if (r.value.length === 0) return 30;
|
|
407
407
|
const n = r.value.slice(0, Math.min(100, r.value.length));
|
|
408
408
|
if (n.length === 0) return 30;
|
|
409
|
-
const a = n.reduce((f, c) => f +
|
|
409
|
+
const a = n.reduce((f, c) => f + L(c), 0) / n.length, s = Math.max(20, Math.floor(a * 0.6));
|
|
410
410
|
return Math.min(s, 60);
|
|
411
411
|
});
|
|
412
412
|
let S;
|
|
413
|
-
const
|
|
413
|
+
const $ = (n, a) => {
|
|
414
414
|
e("menu-click", {
|
|
415
415
|
menu: n,
|
|
416
416
|
row: a
|
|
417
417
|
}), S == null || S.onClose(), S = null;
|
|
418
|
-
},
|
|
418
|
+
}, M = (n) => {
|
|
419
419
|
var s, f, c, u, k;
|
|
420
420
|
if (!((c = (f = (s = i.menuConfig) == null ? void 0 : s.body) == null ? void 0 : f.options) != null && c.length)) return;
|
|
421
421
|
S == null || S.onClose(), S = null;
|
|
@@ -423,29 +423,29 @@ const ii = /* @__PURE__ */ un({
|
|
|
423
423
|
for (; a && (a != null && a.getAttribute) && !(a != null && a.getAttribute("data-id")) && a !== ((u = d.value) == null ? void 0 : u.$el); )
|
|
424
424
|
a = a.parentNode;
|
|
425
425
|
if ((k = a == null ? void 0 : a.getAttribute) != null && k.call(a, "data-id")) {
|
|
426
|
-
const
|
|
426
|
+
const C = a.getAttribute("data-id"), y = we(C);
|
|
427
427
|
y && (S = ei({
|
|
428
428
|
e: n,
|
|
429
429
|
row: y,
|
|
430
430
|
menuConfig: i.menuConfig,
|
|
431
|
-
onMenuClick:
|
|
431
|
+
onMenuClick: $
|
|
432
432
|
}), n.preventDefault(), n.stopPropagation());
|
|
433
433
|
}
|
|
434
434
|
}, I = (n) => {
|
|
435
435
|
var s, f, c;
|
|
436
|
-
if (!
|
|
436
|
+
if (!E.value)
|
|
437
437
|
return;
|
|
438
438
|
let a = n.target;
|
|
439
439
|
for (; a && (a != null && a.getAttribute) && !(a != null && a.getAttribute("data-id")) && a !== ((s = d.value) == null ? void 0 : s.$el); )
|
|
440
440
|
if (a = a.parentNode, a != null && a.classList && ["el-popper", "ck-body-wrapper"].some((u) => a.classList.contains(u)))
|
|
441
441
|
return;
|
|
442
|
-
((f = a == null ? void 0 : a.getAttribute) == null ? void 0 : f.call(a, "data-id")) != ((c =
|
|
443
|
-
row:
|
|
442
|
+
((f = a == null ? void 0 : a.getAttribute) == null ? void 0 : f.call(a, "data-id")) != ((c = E.value) == null ? void 0 : c.node_id) && (E.value._editing = !1, e("edit-closed", {
|
|
443
|
+
row: E.value,
|
|
444
444
|
column: {},
|
|
445
445
|
$table: o == null ? void 0 : o.exposed
|
|
446
|
-
}),
|
|
446
|
+
}), E.value = null);
|
|
447
447
|
};
|
|
448
|
-
((vt = i.editConfig) == null ? void 0 : vt.trigger) === "dblclick" && Be(() =>
|
|
448
|
+
((vt = i.editConfig) == null ? void 0 : vt.trigger) === "dblclick" && Be(() => E.value, (n) => {
|
|
449
449
|
document.removeEventListener("click", I, !0), n && setTimeout(() => {
|
|
450
450
|
document.addEventListener("click", I, !0);
|
|
451
451
|
}, 200);
|
|
@@ -461,25 +461,25 @@ const ii = /* @__PURE__ */ un({
|
|
|
461
461
|
})), _ = () => {
|
|
462
462
|
if (!i.pageConfig.enabled) {
|
|
463
463
|
q.value = [{
|
|
464
|
-
items:
|
|
464
|
+
items: P.value,
|
|
465
465
|
startIndex: 0,
|
|
466
|
-
endIndex:
|
|
466
|
+
endIndex: P.value.length
|
|
467
467
|
}];
|
|
468
468
|
return;
|
|
469
469
|
}
|
|
470
470
|
if (i.pageData && Object.keys(i.pageData).length) {
|
|
471
471
|
const n = [], a = i.rowConfig.keyField || "node_id", s = /* @__PURE__ */ new Map();
|
|
472
|
-
|
|
472
|
+
P.value.forEach((c) => {
|
|
473
473
|
s.set(String(c[a]), c);
|
|
474
474
|
}), Object.keys(i.pageData).sort((c, u) => parseInt(c) - parseInt(u)).forEach((c) => {
|
|
475
475
|
const u = i.pageData[c], k = [];
|
|
476
|
-
u.forEach((
|
|
477
|
-
const y = s.get(String(
|
|
476
|
+
u.forEach((C) => {
|
|
477
|
+
const y = s.get(String(C));
|
|
478
478
|
y && k.push(y);
|
|
479
479
|
}), k.length > 0 && n.push({
|
|
480
480
|
items: k,
|
|
481
481
|
pageNumber: parseInt(c),
|
|
482
|
-
height: k.reduce((
|
|
482
|
+
height: k.reduce((C, y) => C + L(y), 0)
|
|
483
483
|
});
|
|
484
484
|
}), q.value = n;
|
|
485
485
|
} else {
|
|
@@ -487,41 +487,41 @@ const ii = /* @__PURE__ */ un({
|
|
|
487
487
|
pageHeight: n,
|
|
488
488
|
margin: a
|
|
489
489
|
} = i.pageConfig, s = n - a * 2, f = [];
|
|
490
|
-
let c = [], u = 0, k = 0,
|
|
491
|
-
|
|
492
|
-
const w =
|
|
490
|
+
let c = [], u = 0, k = 0, C = 1;
|
|
491
|
+
P.value.forEach((y, g) => {
|
|
492
|
+
const w = L(y);
|
|
493
493
|
(y.layer || 0) <= 2 && c.length > 0 ? (f.push({
|
|
494
494
|
items: [...c],
|
|
495
495
|
startIndex: k,
|
|
496
|
-
endIndex:
|
|
496
|
+
endIndex: g,
|
|
497
497
|
height: u,
|
|
498
|
-
pageNumber:
|
|
499
|
-
}), c = [y], u = w, k =
|
|
498
|
+
pageNumber: C++
|
|
499
|
+
}), c = [y], u = w, k = g) : u + w > s && c.length > 0 ? (f.push({
|
|
500
500
|
items: [...c],
|
|
501
501
|
startIndex: k,
|
|
502
|
-
endIndex:
|
|
502
|
+
endIndex: g,
|
|
503
503
|
height: u,
|
|
504
|
-
pageNumber:
|
|
505
|
-
}), c = [y], u = Math.min(w, s), k =
|
|
504
|
+
pageNumber: C++
|
|
505
|
+
}), c = [y], u = Math.min(w, s), k = g) : (c.push(y), u += w);
|
|
506
506
|
}), c.length > 0 && f.push({
|
|
507
507
|
items: c,
|
|
508
508
|
startIndex: k,
|
|
509
|
-
endIndex:
|
|
509
|
+
endIndex: P.value.length,
|
|
510
510
|
height: u,
|
|
511
|
-
pageNumber:
|
|
511
|
+
pageNumber: C
|
|
512
512
|
}), q.value = f;
|
|
513
513
|
}
|
|
514
514
|
}, pe = () => {
|
|
515
515
|
try {
|
|
516
516
|
const n = Array.isArray(i.data) ? i.data : [], a = D(n);
|
|
517
|
-
if (!(a !== m.value) &&
|
|
517
|
+
if (!(a !== m.value) && P.value.length > 0)
|
|
518
518
|
return;
|
|
519
519
|
m.value = a;
|
|
520
520
|
const f = (i.treeConfig ? ti(n, void 0, i.treeConfig) : n).map((u, k) => {
|
|
521
|
-
const
|
|
521
|
+
const C = u[i.rowConfig.keyField], y = V.get(C);
|
|
522
522
|
if (!y || y.content !== u.content || y.content_type !== u.content_type) {
|
|
523
|
-
|
|
524
|
-
const
|
|
523
|
+
x.add(C);
|
|
524
|
+
const g = {
|
|
525
525
|
...u,
|
|
526
526
|
index: k,
|
|
527
527
|
_editing: u._editing || !1,
|
|
@@ -530,16 +530,16 @@ const ii = /* @__PURE__ */ un({
|
|
|
530
530
|
}
|
|
531
531
|
// 保留原始数据,避免重复深拷贝
|
|
532
532
|
};
|
|
533
|
-
return V.set(
|
|
533
|
+
return V.set(C, g), g;
|
|
534
534
|
}
|
|
535
535
|
return y.index = k, y;
|
|
536
536
|
});
|
|
537
|
-
|
|
537
|
+
P.value = f, _();
|
|
538
538
|
const c = new Set(f.map((u) => u[i.rowConfig.keyField]));
|
|
539
539
|
for (const [u] of V)
|
|
540
|
-
c.has(u) || (V.delete(u),
|
|
540
|
+
c.has(u) || (V.delete(u), x.delete(u));
|
|
541
541
|
} catch {
|
|
542
|
-
|
|
542
|
+
P.value = [], q.value = [], V.clear(), x.clear();
|
|
543
543
|
}
|
|
544
544
|
};
|
|
545
545
|
Be(() => i.data, (n, a) => {
|
|
@@ -595,16 +595,16 @@ const ii = /* @__PURE__ */ un({
|
|
|
595
595
|
if (!c) continue;
|
|
596
596
|
const u = we(c);
|
|
597
597
|
if (!u) continue;
|
|
598
|
-
const k = f.contentRect.height,
|
|
599
|
-
if (Math.abs(
|
|
598
|
+
const k = f.contentRect.height, C = ((s = B.get(u)) == null ? void 0 : s.height) || 0;
|
|
599
|
+
if (Math.abs(C - k) > 5) {
|
|
600
600
|
const y = B.get(u) || {};
|
|
601
601
|
B.set(u, {
|
|
602
602
|
...y,
|
|
603
603
|
height: k
|
|
604
604
|
}), requestAnimationFrame(() => {
|
|
605
605
|
var w;
|
|
606
|
-
const
|
|
607
|
-
(w =
|
|
606
|
+
const g = f.target.__vueParentComponent;
|
|
607
|
+
(w = g == null ? void 0 : g.proxy) != null && w.updateSize && g.proxy.updateSize();
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
}
|
|
@@ -617,7 +617,7 @@ const ii = /* @__PURE__ */ un({
|
|
|
617
617
|
});
|
|
618
618
|
}));
|
|
619
619
|
}, ce = () => {
|
|
620
|
-
|
|
620
|
+
b.value && (b.value.disconnect(), b.value = null), ve && (ve.disconnect(), ve = null);
|
|
621
621
|
}, ie = () => {
|
|
622
622
|
i.pageConfig.enabled && (ye.value && ye.value.disconnect(), ye.value = new IntersectionObserver((n) => {
|
|
623
623
|
n.forEach((a) => {
|
|
@@ -648,7 +648,7 @@ const ii = /* @__PURE__ */ un({
|
|
|
648
648
|
if (ne(), he.setup(), ie(), ((n = i.editConfig) == null ? void 0 : n.trigger) === "contenteditable" && (document.addEventListener("selectionchange", dt), document.addEventListener("mouseup", ut)), i.pageConfig.enabled)
|
|
649
649
|
for (let a = 0; a < Math.min(3, q.value.length); a++)
|
|
650
650
|
Z.value.add(a);
|
|
651
|
-
}),
|
|
651
|
+
}), A.value = !0;
|
|
652
652
|
}), Ze(() => {
|
|
653
653
|
var n;
|
|
654
654
|
ce(), he.cleanup(), ye.value && (ye.value.disconnect(), ye.value = null), ((n = i.editConfig) == null ? void 0 : n.trigger) === "contenteditable" && (document.removeEventListener("selectionchange", dt), document.removeEventListener("mouseup", ut)), Ee && clearTimeout(Ee), X = /* @__PURE__ */ new Map(), V.clear(), Z.value.clear(), Y.value.clear();
|
|
@@ -687,31 +687,31 @@ const ii = /* @__PURE__ */ un({
|
|
|
687
687
|
}
|
|
688
688
|
}, se = (n) => {
|
|
689
689
|
Ve(n);
|
|
690
|
-
},
|
|
690
|
+
}, T = (n) => Oe(n);
|
|
691
691
|
let Q = null, Pe;
|
|
692
692
|
const _e = ({
|
|
693
693
|
row: n,
|
|
694
694
|
column: a
|
|
695
695
|
}, s, f) => {
|
|
696
|
-
var k,
|
|
696
|
+
var k, C;
|
|
697
697
|
const c = f || s.target, u = Tt(c, "virtual-table-cell", (k = d.value) == null ? void 0 : k.$el);
|
|
698
|
-
Q === u && Pe && (clearTimeout(Pe), Q = null), ((
|
|
699
|
-
var
|
|
700
|
-
|
|
701
|
-
let y = (
|
|
698
|
+
Q === u && Pe && (clearTimeout(Pe), Q = null), ((C = E.value) == null ? void 0 : C[i.rowConfig.keyField]) != (n == null ? void 0 : n[i.rowConfig.keyField]) && setTimeout(() => {
|
|
699
|
+
var g, w;
|
|
700
|
+
E.value = n;
|
|
701
|
+
let y = (g = c == null ? void 0 : c.getAttribute) == null ? void 0 : g.call(c, "field");
|
|
702
702
|
if (!y) {
|
|
703
703
|
try {
|
|
704
|
-
const
|
|
705
|
-
let
|
|
706
|
-
|
|
707
|
-
const
|
|
708
|
-
|
|
704
|
+
const R = document.getSelection();
|
|
705
|
+
let O = R == null ? void 0 : R.anchorNode;
|
|
706
|
+
O && O.nodeType === 3 && (O = O.parentElement);
|
|
707
|
+
const F = (w = O == null ? void 0 : O.closest) == null ? void 0 : w.call(O, "[field]");
|
|
708
|
+
F && (y = F.getAttribute("field"));
|
|
709
709
|
} catch {
|
|
710
710
|
}
|
|
711
711
|
if (!y && (s != null && s.composedPath)) {
|
|
712
|
-
for (const
|
|
713
|
-
if (
|
|
714
|
-
y =
|
|
712
|
+
for (const R of s.composedPath())
|
|
713
|
+
if (R != null && R.getAttribute && R.getAttribute("field")) {
|
|
714
|
+
y = R.getAttribute("field");
|
|
715
715
|
break;
|
|
716
716
|
}
|
|
717
717
|
}
|
|
@@ -732,33 +732,33 @@ const ii = /* @__PURE__ */ un({
|
|
|
732
732
|
var u;
|
|
733
733
|
const c = f || s.target;
|
|
734
734
|
Q = Tt(c, "virtual-table-cell", (u = d.value) == null ? void 0 : u.$el), Pe && clearTimeout(Pe), Pe = setTimeout(() => {
|
|
735
|
-
var y,
|
|
735
|
+
var y, g, w, R, O;
|
|
736
736
|
const k = n.content_type;
|
|
737
|
-
let
|
|
738
|
-
if (!
|
|
737
|
+
let C = (y = c == null ? void 0 : c.getAttribute) == null ? void 0 : y.call(c, "field");
|
|
738
|
+
if (!C) {
|
|
739
739
|
try {
|
|
740
|
-
const
|
|
741
|
-
let H =
|
|
740
|
+
const F = document.getSelection();
|
|
741
|
+
let H = F == null ? void 0 : F.anchorNode;
|
|
742
742
|
H && H.nodeType === 3 && (H = H.parentElement);
|
|
743
|
-
const ee = (
|
|
744
|
-
ee && (
|
|
743
|
+
const ee = (g = H == null ? void 0 : H.closest) == null ? void 0 : g.call(H, "[field]");
|
|
744
|
+
ee && (C = ee.getAttribute("field"));
|
|
745
745
|
} catch {
|
|
746
746
|
}
|
|
747
|
-
if (!
|
|
748
|
-
for (const
|
|
749
|
-
if (
|
|
750
|
-
|
|
747
|
+
if (!C && (s != null && s.composedPath)) {
|
|
748
|
+
for (const F of s.composedPath())
|
|
749
|
+
if (F != null && F.getAttribute && F.getAttribute("field")) {
|
|
750
|
+
C = F.getAttribute("field");
|
|
751
751
|
break;
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
if (k !== "table") {
|
|
756
756
|
if (k === "text") {
|
|
757
|
-
let
|
|
758
|
-
if ((w = c == null ? void 0 : c.getAttribute) != null && w.call(c, "field") ?
|
|
757
|
+
let F = null, H = null;
|
|
758
|
+
if ((w = c == null ? void 0 : c.getAttribute) != null && w.call(c, "field") ? F = c : (R = c == null ? void 0 : c.closest) != null && R.call(c, "[field]") && (F = c.closest("[field]")), F && (H = F.textContent), C && H !== void 0 && H !== null) {
|
|
759
759
|
H = H.trim();
|
|
760
|
-
const ee = ((
|
|
761
|
-
H !== ee && (n[
|
|
760
|
+
const ee = ((O = n[C]) == null ? void 0 : O.trim()) || "";
|
|
761
|
+
H !== ee && (n[C] = H);
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
764
|
}
|
|
@@ -766,7 +766,7 @@ const ii = /* @__PURE__ */ un({
|
|
|
766
766
|
row: n,
|
|
767
767
|
column: {
|
|
768
768
|
...a,
|
|
769
|
-
field:
|
|
769
|
+
field: C
|
|
770
770
|
},
|
|
771
771
|
$table: o == null ? void 0 : o.exposed
|
|
772
772
|
});
|
|
@@ -787,34 +787,34 @@ const ii = /* @__PURE__ */ un({
|
|
|
787
787
|
} else
|
|
788
788
|
ct("focusout", n);
|
|
789
789
|
}, ct = (n, a) => {
|
|
790
|
-
var s, f, c, u, k,
|
|
790
|
+
var s, f, c, u, k, C;
|
|
791
791
|
try {
|
|
792
792
|
const y = document.getSelection();
|
|
793
|
-
let
|
|
794
|
-
|
|
795
|
-
const w = (s =
|
|
796
|
-
if (!w || !
|
|
797
|
-
const
|
|
793
|
+
let g = y == null ? void 0 : y.anchorNode;
|
|
794
|
+
g && g.nodeType === 3 && (g = g.parentElement);
|
|
795
|
+
const w = (s = g == null ? void 0 : g.closest) == null ? void 0 : s.call(g, ".virtual-table-cell"), R = (f = g == null ? void 0 : g.closest) == null ? void 0 : f.call(g, ".virtual-table-row");
|
|
796
|
+
if (!w || !R) return;
|
|
797
|
+
const O = R.getAttribute("data-id"), F = w.getAttribute("data-prop"), H = we(O), ee = Le.value.find((fe) => `${fe.prop}` == `${F}`) || {}, de = ((c = g == null ? void 0 : g.closest) == null ? void 0 : c.call(g, "[field]")) || null, U = ((u = de == null ? void 0 : de.getAttribute) == null ? void 0 : u.call(de, "field")) || void 0;
|
|
798
798
|
n === "focusin" ? (z = {
|
|
799
799
|
row: H,
|
|
800
800
|
column: ee,
|
|
801
801
|
cellEl: w,
|
|
802
|
-
rowEl:
|
|
802
|
+
rowEl: R,
|
|
803
803
|
fieldEl: de,
|
|
804
804
|
field: U
|
|
805
805
|
}, _e({
|
|
806
806
|
row: H,
|
|
807
807
|
column: ee
|
|
808
|
-
}, a, de || ((k =
|
|
808
|
+
}, a, de || ((k = g == null ? void 0 : g.closest) == null ? void 0 : k.call(g, "[field]")))) : xe({
|
|
809
809
|
row: H,
|
|
810
810
|
column: ee
|
|
811
|
-
}, a, de || ((
|
|
811
|
+
}, a, de || ((C = g == null ? void 0 : g.closest) == null ? void 0 : C.call(g, "[field]")));
|
|
812
812
|
} catch {
|
|
813
813
|
}
|
|
814
814
|
}, dt = () => {
|
|
815
815
|
var n;
|
|
816
816
|
((n = i.editConfig) == null ? void 0 : n.trigger) === "contenteditable" && (Ee && clearTimeout(Ee), Ee = setTimeout(() => {
|
|
817
|
-
var a, s, f, c, u, k,
|
|
817
|
+
var a, s, f, c, u, k, C, y, g, w, R, O, F, H;
|
|
818
818
|
try {
|
|
819
819
|
const ee = document.getSelection();
|
|
820
820
|
if (ee.rangeCount === 0) return;
|
|
@@ -827,7 +827,7 @@ const ii = /* @__PURE__ */ un({
|
|
|
827
827
|
if (!z || ((f = z.row) == null ? void 0 : f[i.rowConfig.keyField]) !== (Se == null ? void 0 : Se[i.rowConfig.keyField]) || ((c = z.column) == null ? void 0 : c.prop) !== (me == null ? void 0 : me.prop)) {
|
|
828
828
|
if (z) {
|
|
829
829
|
let ae = z.fieldEl;
|
|
830
|
-
!ae && z.field && (ae = (k = (u = z.cellEl) == null ? void 0 : u.querySelector) == null ? void 0 : k.call(u, `[field="${z.field}"]`)), ae || (ae = ((y = (
|
|
830
|
+
!ae && z.field && (ae = (k = (u = z.cellEl) == null ? void 0 : u.querySelector) == null ? void 0 : k.call(u, `[field="${z.field}"]`)), ae || (ae = ((y = (C = z.cellEl) == null ? void 0 : C.querySelector) == null ? void 0 : y.call(C, "[field]")) || z.cellEl), xe(z, {
|
|
831
831
|
target: ae
|
|
832
832
|
}, ae);
|
|
833
833
|
}
|
|
@@ -836,8 +836,8 @@ const ii = /* @__PURE__ */ un({
|
|
|
836
836
|
column: me,
|
|
837
837
|
cellEl: fe,
|
|
838
838
|
rowEl: Ce,
|
|
839
|
-
fieldEl: ((
|
|
840
|
-
field: ((
|
|
839
|
+
fieldEl: ((g = U == null ? void 0 : U.closest) == null ? void 0 : g.call(U, "[field]")) || null,
|
|
840
|
+
field: ((O = (R = ((w = U == null ? void 0 : U.closest) == null ? void 0 : w.call(U, "[field]")) || null) == null ? void 0 : R.getAttribute) == null ? void 0 : O.call(R, "field")) || void 0
|
|
841
841
|
}, _e({
|
|
842
842
|
row: Se,
|
|
843
843
|
column: me
|
|
@@ -846,7 +846,7 @@ const ii = /* @__PURE__ */ un({
|
|
|
846
846
|
}, fe);
|
|
847
847
|
}
|
|
848
848
|
if (ee.toString()) {
|
|
849
|
-
const ae = de.endContainer.nodeType === 3 ? de.endContainer.parentElement : de.endContainer, We = (
|
|
849
|
+
const ae = de.endContainer.nodeType === 3 ? de.endContainer.parentElement : de.endContainer, We = (F = ae == null ? void 0 : ae.closest) == null ? void 0 : F.call(ae, ".virtual-table-cell"), Ue = (H = ae == null ? void 0 : ae.closest) == null ? void 0 : H.call(ae, ".virtual-table-row");
|
|
850
850
|
}
|
|
851
851
|
} catch {
|
|
852
852
|
}
|
|
@@ -859,21 +859,21 @@ const ii = /* @__PURE__ */ un({
|
|
|
859
859
|
if (!a) return;
|
|
860
860
|
const s = a.toString();
|
|
861
861
|
if (s) {
|
|
862
|
-
const
|
|
863
|
-
let y = null,
|
|
862
|
+
const C = a.rangeCount > 0 ? a.getRangeAt(0) : null;
|
|
863
|
+
let y = null, g = null;
|
|
864
864
|
try {
|
|
865
|
-
if (
|
|
866
|
-
let w =
|
|
865
|
+
if (C) {
|
|
866
|
+
let w = C.startContainer;
|
|
867
867
|
(w == null ? void 0 : w.nodeType) === 3 && (w = w.parentElement);
|
|
868
|
-
const
|
|
869
|
-
y =
|
|
870
|
-
rowId:
|
|
871
|
-
prop:
|
|
868
|
+
const R = (f = w == null ? void 0 : w.closest) == null ? void 0 : f.call(w, ".virtual-table-cell"), O = (c = w == null ? void 0 : w.closest) == null ? void 0 : c.call(w, ".virtual-table-row");
|
|
869
|
+
y = R && O ? {
|
|
870
|
+
rowId: O.getAttribute("data-id"),
|
|
871
|
+
prop: R.getAttribute("data-prop")
|
|
872
872
|
} : null;
|
|
873
|
-
let
|
|
874
|
-
(
|
|
875
|
-
const H = (u =
|
|
876
|
-
|
|
873
|
+
let F = C.endContainer;
|
|
874
|
+
(F == null ? void 0 : F.nodeType) === 3 && (F = F.parentElement);
|
|
875
|
+
const H = (u = F == null ? void 0 : F.closest) == null ? void 0 : u.call(F, ".virtual-table-cell"), ee = (k = F == null ? void 0 : F.closest) == null ? void 0 : k.call(F, ".virtual-table-row");
|
|
876
|
+
g = H && ee ? {
|
|
877
877
|
rowId: ee.getAttribute("data-id"),
|
|
878
878
|
prop: H.getAttribute("data-prop")
|
|
879
879
|
} : null;
|
|
@@ -883,19 +883,19 @@ const ii = /* @__PURE__ */ un({
|
|
|
883
883
|
e("selection-change", {
|
|
884
884
|
text: s,
|
|
885
885
|
selection: a,
|
|
886
|
-
range:
|
|
886
|
+
range: C,
|
|
887
887
|
start: y,
|
|
888
|
-
end:
|
|
888
|
+
end: g
|
|
889
889
|
});
|
|
890
890
|
}
|
|
891
891
|
}, 10);
|
|
892
892
|
}, Vt = (n) => (n == null ? void 0 : n._editing) === !0, jt = (n) => n != null && n.parent_id ? X.get(n.parent_id) : null, Kt = (n) => {
|
|
893
893
|
var s;
|
|
894
|
-
const a =
|
|
895
|
-
return a < 1 ? null : ((s =
|
|
894
|
+
const a = P.value.findIndex((f) => f[i.rowConfig.keyField] == n[i.rowConfig.keyField]);
|
|
895
|
+
return a < 1 ? null : ((s = P.value[a - 1]) == null ? void 0 : s.layer) === n.layer ? P.value[a - 1] : null;
|
|
896
896
|
}, qt = (n) => {
|
|
897
|
-
const a =
|
|
898
|
-
return a >=
|
|
897
|
+
const a = P.value.findIndex((s) => s[i.rowConfig.keyField] == n[i.rowConfig.keyField]);
|
|
898
|
+
return a >= P.value.length - 1 ? null : P.value[a + 1];
|
|
899
899
|
}, we = (n) => {
|
|
900
900
|
if (!n) return null;
|
|
901
901
|
let a = V.get(n);
|
|
@@ -919,16 +919,16 @@ const ii = /* @__PURE__ */ un({
|
|
|
919
919
|
be(() => {
|
|
920
920
|
const u = document.querySelector(".a4-pages-container");
|
|
921
921
|
if (!u) return;
|
|
922
|
-
const k = (
|
|
922
|
+
const k = (C = 0) => {
|
|
923
923
|
const y = u.querySelector(`[data-id="${s}"]`);
|
|
924
924
|
if (y) {
|
|
925
|
-
let
|
|
925
|
+
let g = 0, w = y;
|
|
926
926
|
for (; w && w !== u; )
|
|
927
|
-
|
|
928
|
-
const
|
|
929
|
-
let
|
|
930
|
-
|
|
931
|
-
const
|
|
927
|
+
g += w.offsetTop, w = w.offsetParent;
|
|
928
|
+
const R = u.clientHeight;
|
|
929
|
+
let O = g - R * 0.3;
|
|
930
|
+
O = Math.max(0, O);
|
|
931
|
+
const F = u.scrollTop, H = Math.abs(O - F), ee = (de) => {
|
|
932
932
|
const U = u.scrollTop, fe = de - U, Ce = Math.min(800, Math.max(300, H * 0.5)), et = performance.now(), tt = (me) => me < 0.5 ? 4 * me * me * me : 1 - Math.pow(-2 * me + 2, 3) / 2, Se = (me) => {
|
|
933
933
|
const mt = me - et, ae = Math.min(mt / Ce, 1), We = tt(ae), Ue = U + fe * We;
|
|
934
934
|
u.scrollTop = Ue, ae < 1 ? requestAnimationFrame(Se) : setTimeout(() => {
|
|
@@ -938,30 +938,30 @@ const ii = /* @__PURE__ */ un({
|
|
|
938
938
|
requestAnimationFrame(Se);
|
|
939
939
|
};
|
|
940
940
|
H > 3e3 ? u.scrollTo({
|
|
941
|
-
top:
|
|
941
|
+
top: O,
|
|
942
942
|
behavior: "instant"
|
|
943
|
-
}) : ee(
|
|
943
|
+
}) : ee(O), y.classList.add("row--highlight"), setTimeout(() => {
|
|
944
944
|
y.classList.remove("row--highlight");
|
|
945
945
|
}, 1500);
|
|
946
|
-
} else
|
|
946
|
+
} else C < 10 && setTimeout(() => k(C + 1), 150);
|
|
947
947
|
};
|
|
948
948
|
setTimeout(k, 200);
|
|
949
949
|
});
|
|
950
950
|
}
|
|
951
951
|
} else {
|
|
952
|
-
const c =
|
|
952
|
+
const c = P.value.findIndex((u) => u[a] === s);
|
|
953
953
|
c !== -1 && ((f = d.value) != null && f.scrollToItem) && d.value.scrollToItem(c);
|
|
954
954
|
}
|
|
955
955
|
Ne = null;
|
|
956
956
|
});
|
|
957
957
|
}, Ve = (n) => {
|
|
958
958
|
if (n) {
|
|
959
|
-
if (!
|
|
959
|
+
if (!A.value) {
|
|
960
960
|
setTimeout(() => Ve(n), 200);
|
|
961
961
|
return;
|
|
962
962
|
}
|
|
963
|
-
N.value = n, N.value !==
|
|
964
|
-
|
|
963
|
+
N.value = n, N.value !== E.value && E.value && (E.value._editing = !1, setTimeout(() => {
|
|
964
|
+
E.value = null;
|
|
965
965
|
}, 200));
|
|
966
966
|
}
|
|
967
967
|
}, Oe = (n, a) => new Promise((s) => {
|
|
@@ -969,11 +969,11 @@ const ii = /* @__PURE__ */ un({
|
|
|
969
969
|
if (!((f = i == null ? void 0 : i.editConfig) != null && f.beforeEditMethod && typeof ((c = i == null ? void 0 : i.editConfig) == null ? void 0 : c.beforeEditMethod) == "function" && !i.editConfig.beforeEditMethod({
|
|
970
970
|
row: n
|
|
971
971
|
}))) {
|
|
972
|
-
if (!n || !
|
|
972
|
+
if (!n || !A.value) {
|
|
973
973
|
setTimeout(() => Oe(n), 200);
|
|
974
974
|
return;
|
|
975
975
|
}
|
|
976
|
-
n !==
|
|
976
|
+
n !== E.value && (P.value.forEach((u) => {
|
|
977
977
|
u._editing && e("edit-closed", {
|
|
978
978
|
row: u,
|
|
979
979
|
column: {
|
|
@@ -982,7 +982,7 @@ const ii = /* @__PURE__ */ un({
|
|
|
982
982
|
$table: o == null ? void 0 : o.exposed
|
|
983
983
|
}), u._editing = !1;
|
|
984
984
|
}), n._editing = !0, setTimeout(() => {
|
|
985
|
-
|
|
985
|
+
E.value = n, e("edit-activated", {
|
|
986
986
|
row: n,
|
|
987
987
|
column: {
|
|
988
988
|
field: a
|
|
@@ -1012,23 +1012,23 @@ const ii = /* @__PURE__ */ un({
|
|
|
1012
1012
|
let f = -1;
|
|
1013
1013
|
if (a == -1) {
|
|
1014
1014
|
const c = we(n.parent_id);
|
|
1015
|
-
for (f =
|
|
1015
|
+
for (f = P.value.findIndex((u) => u[i.rowConfig.keyField] == c[i.rowConfig.keyField]) + 1; P.value[f].parent_id == c[i.rowConfig.keyField]; )
|
|
1016
1016
|
f += 1;
|
|
1017
1017
|
} else
|
|
1018
|
-
f =
|
|
1019
|
-
X.set(n.node_id, n), V.set(n[i.rowConfig.keyField], n),
|
|
1018
|
+
f = P.value.findIndex((c) => c[i.rowConfig.keyField] == a[i.rowConfig.keyField]);
|
|
1019
|
+
X.set(n.node_id, n), V.set(n[i.rowConfig.keyField], n), P.value.splice(f, 0, n), Qe(), s({
|
|
1020
1020
|
row: n
|
|
1021
1021
|
});
|
|
1022
1022
|
}), Jt = (n, a) => new Promise((s) => {
|
|
1023
|
-
const f =
|
|
1024
|
-
X.set(n.node_id, n), V.set(n[i.rowConfig.keyField], n),
|
|
1023
|
+
const f = P.value.findIndex((c) => c[i.rowConfig.keyField] == a[i.rowConfig.keyField]) + 1;
|
|
1024
|
+
X.set(n.node_id, n), V.set(n[i.rowConfig.keyField], n), P.value.splice(f, 0, n), Qe(), s({
|
|
1025
1025
|
row: n
|
|
1026
1026
|
});
|
|
1027
1027
|
}), ht = (n) => {
|
|
1028
|
-
const a =
|
|
1028
|
+
const a = P.value.findIndex((s) => s[i.rowConfig.keyField] == n[i.rowConfig.keyField] || s === n);
|
|
1029
1029
|
if (a > -1) {
|
|
1030
1030
|
const s = n[i.rowConfig.keyField];
|
|
1031
|
-
X.delete(n.node_id), V.delete(s),
|
|
1031
|
+
X.delete(n.node_id), V.delete(s), P.value.splice(a, 1), Qe();
|
|
1032
1032
|
}
|
|
1033
1033
|
}, Xt = (n, a) => {
|
|
1034
1034
|
if (!n || !n[i.rowConfig.keyField]) return !1;
|
|
@@ -1051,18 +1051,18 @@ const ii = /* @__PURE__ */ un({
|
|
|
1051
1051
|
N.value = {};
|
|
1052
1052
|
}, ft = (n) => {
|
|
1053
1053
|
var s, f, c;
|
|
1054
|
-
let a =
|
|
1054
|
+
let a = P.value.findIndex((u) => u[i.rowConfig.keyField] == n[i.rowConfig.keyField]);
|
|
1055
1055
|
if (a > -1 && i.treeConfig) {
|
|
1056
|
-
const u = ((s = i.treeConfig) == null ? void 0 : s.keyField) || ((f = i.treeConfig) == null ? void 0 : f.rowField) || "node_id", k = ((c = i.treeConfig) == null ? void 0 : c.parentField) || "parent_id",
|
|
1056
|
+
const u = ((s = i.treeConfig) == null ? void 0 : s.keyField) || ((f = i.treeConfig) == null ? void 0 : f.rowField) || "node_id", k = ((c = i.treeConfig) == null ? void 0 : c.parentField) || "parent_id", C = [], y = /* @__PURE__ */ new Map();
|
|
1057
1057
|
y.set(n[u], !0);
|
|
1058
|
-
for (let
|
|
1059
|
-
const w =
|
|
1058
|
+
for (let g = a + 1; g < P.value.length; g++) {
|
|
1059
|
+
const w = P.value[g];
|
|
1060
1060
|
if (w && y.has(w[k]))
|
|
1061
|
-
|
|
1061
|
+
C.push(w), y.set(w[u]);
|
|
1062
1062
|
else
|
|
1063
1063
|
break;
|
|
1064
1064
|
}
|
|
1065
|
-
return
|
|
1065
|
+
return C;
|
|
1066
1066
|
}
|
|
1067
1067
|
return [];
|
|
1068
1068
|
};
|
|
@@ -1138,7 +1138,7 @@ const ii = /* @__PURE__ */ un({
|
|
|
1138
1138
|
}, qe = null;
|
|
1139
1139
|
});
|
|
1140
1140
|
}, ln = (n, a) => {
|
|
1141
|
-
var
|
|
1141
|
+
var C, y;
|
|
1142
1142
|
const {
|
|
1143
1143
|
pageHeight: s,
|
|
1144
1144
|
margin: f,
|
|
@@ -1146,24 +1146,24 @@ const ii = /* @__PURE__ */ un({
|
|
|
1146
1146
|
pageBorderPadding: u,
|
|
1147
1147
|
pageBorderStyle: k
|
|
1148
1148
|
} = i.pageConfig;
|
|
1149
|
-
return Z.value.has(a) ? G(J, null, [i.pageConfig.showPageHeader && t["page-header"] ? (
|
|
1149
|
+
return Z.value.has(a) ? G(J, null, [i.pageConfig.showPageHeader && t["page-header"] ? (C = t["page-header"]) == null ? void 0 : C.call(t, {
|
|
1150
1150
|
pageNumber: n.pageNumber || a + 1,
|
|
1151
1151
|
pageIndex: a
|
|
1152
1152
|
}) : null, a === 0 && i.showHeader ? G("div", {
|
|
1153
1153
|
class: "a4-table-header"
|
|
1154
1154
|
}, [G("div", {
|
|
1155
1155
|
class: "virtual-table-header we-vt-table--header we-vt-table--header-wrapper"
|
|
1156
|
-
}, [Le.value.map((
|
|
1157
|
-
var w,
|
|
1156
|
+
}, [Le.value.map((g) => {
|
|
1157
|
+
var w, R, O;
|
|
1158
1158
|
return G("div", {
|
|
1159
1159
|
class: "we-vt-header--column",
|
|
1160
|
-
key:
|
|
1161
|
-
style: je(
|
|
1160
|
+
key: g.prop,
|
|
1161
|
+
style: je(g.width)
|
|
1162
1162
|
}, [G("div", {
|
|
1163
1163
|
class: "we-vt-cell"
|
|
1164
|
-
}, [(w =
|
|
1165
|
-
column:
|
|
1166
|
-
}) :
|
|
1164
|
+
}, [(w = g.slots) != null && w.header ? (O = (R = g.slots) == null ? void 0 : R.header) == null ? void 0 : O.call(R, {
|
|
1165
|
+
column: g
|
|
1166
|
+
}) : g.title])]);
|
|
1167
1167
|
})])]) : null, G("div", {
|
|
1168
1168
|
class: "a4-page-content",
|
|
1169
1169
|
style: {
|
|
@@ -1173,34 +1173,34 @@ const ii = /* @__PURE__ */ un({
|
|
|
1173
1173
|
padding: `${u}px`
|
|
1174
1174
|
} : {}
|
|
1175
1175
|
}
|
|
1176
|
-
}, [n.items.map((
|
|
1177
|
-
var w,
|
|
1176
|
+
}, [n.items.map((g) => {
|
|
1177
|
+
var w, R;
|
|
1178
1178
|
return G("div", {
|
|
1179
|
-
key:
|
|
1180
|
-
"data-id":
|
|
1179
|
+
key: g[i.rowConfig.keyField],
|
|
1180
|
+
"data-id": g[i.rowConfig.keyField],
|
|
1181
1181
|
class: {
|
|
1182
1182
|
"virtual-table-row": !0,
|
|
1183
1183
|
"we-vt-body--row": !0,
|
|
1184
|
-
"row--current":
|
|
1184
|
+
"row--current": g[i.rowConfig.keyField] === ((w = N.value) == null ? void 0 : w[i.rowConfig.keyField]) || ((R = i.treeConfig) == null ? void 0 : R.childCurrent) && gt.value.includes(g[i.rowConfig.keyField])
|
|
1185
1185
|
},
|
|
1186
1186
|
style: {
|
|
1187
1187
|
width: "100%"
|
|
1188
1188
|
},
|
|
1189
|
-
onClick: () => se(
|
|
1190
|
-
onDblclick: () =>
|
|
1191
|
-
}, [Le.value.map((
|
|
1192
|
-
var
|
|
1189
|
+
onClick: () => se(g),
|
|
1190
|
+
onDblclick: () => T(g)
|
|
1191
|
+
}, [Le.value.map((O) => {
|
|
1192
|
+
var F, H, ee, de, U, fe, Ce;
|
|
1193
1193
|
return G("div", {
|
|
1194
|
-
key:
|
|
1194
|
+
key: O.prop,
|
|
1195
1195
|
class: "virtual-table-cell we-vt-cell",
|
|
1196
|
-
style: je(
|
|
1197
|
-
"data-prop":
|
|
1198
|
-
}, [
|
|
1199
|
-
row:
|
|
1200
|
-
column:
|
|
1201
|
-
})) : ((U =
|
|
1202
|
-
row:
|
|
1203
|
-
column:
|
|
1196
|
+
style: je(O.width),
|
|
1197
|
+
"data-prop": O.prop
|
|
1198
|
+
}, [g._editing && ((F = i.editConfig) == null ? void 0 : F.trigger) === "dblclick" ? ((H = O.slots) == null ? void 0 : H.edit) && ((de = (ee = O.slots) == null ? void 0 : ee.edit) == null ? void 0 : de.call(ee, {
|
|
1199
|
+
row: g,
|
|
1200
|
+
column: O
|
|
1201
|
+
})) : ((U = O.slots) == null ? void 0 : U.default) && ((Ce = (fe = O.slots) == null ? void 0 : fe.default) == null ? void 0 : Ce.call(fe, {
|
|
1202
|
+
row: g,
|
|
1203
|
+
column: O
|
|
1204
1204
|
}))]);
|
|
1205
1205
|
})]);
|
|
1206
1206
|
})]), t["page-footer"] ? (y = t["page-footer"]) == null ? void 0 : y.call(t, {
|
|
@@ -1234,20 +1234,20 @@ const ii = /* @__PURE__ */ un({
|
|
|
1234
1234
|
}, [G("div", {
|
|
1235
1235
|
class: "a4-pages-container",
|
|
1236
1236
|
contenteditable: ((k = i.editConfig) == null ? void 0 : k.trigger) === "contenteditable" ? "true" : void 0,
|
|
1237
|
-
onContextmenu:
|
|
1237
|
+
onContextmenu: M,
|
|
1238
1238
|
onFocusin: $e,
|
|
1239
1239
|
onFocusout: ze
|
|
1240
|
-
}, [q.value.map((
|
|
1241
|
-
const
|
|
1240
|
+
}, [q.value.map((C, y) => {
|
|
1241
|
+
const g = Z.value.has(y);
|
|
1242
1242
|
return G("div", {
|
|
1243
1243
|
key: `page-${y}`,
|
|
1244
|
-
class:
|
|
1244
|
+
class: g ? "a4-page" : "a4-page-placeholder",
|
|
1245
1245
|
"data-page-index": y,
|
|
1246
1246
|
style: {
|
|
1247
1247
|
width: `${a}px`,
|
|
1248
1248
|
// 不设置minHeight,让内容自然决定高度
|
|
1249
1249
|
marginBottom: `${f}px`,
|
|
1250
|
-
padding:
|
|
1250
|
+
padding: g ? `${c ? s - u : s}px` : "0",
|
|
1251
1251
|
boxSizing: "border-box",
|
|
1252
1252
|
// 使用relative定位,确保内部元素定位正确
|
|
1253
1253
|
position: "relative",
|
|
@@ -1264,7 +1264,7 @@ const ii = /* @__PURE__ */ un({
|
|
|
1264
1264
|
visibility: "hidden",
|
|
1265
1265
|
pointerEvents: "none"
|
|
1266
1266
|
}
|
|
1267
|
-
}, null), ln(
|
|
1267
|
+
}, null), ln(C, y)]);
|
|
1268
1268
|
})])]);
|
|
1269
1269
|
}, sn = () => {
|
|
1270
1270
|
var n;
|
|
@@ -1288,13 +1288,13 @@ const ii = /* @__PURE__ */ un({
|
|
|
1288
1288
|
})]) : void 0, G(yn, {
|
|
1289
1289
|
ref: d,
|
|
1290
1290
|
items: r.value,
|
|
1291
|
-
minItemSize:
|
|
1291
|
+
minItemSize: v.value,
|
|
1292
1292
|
keyField: i.rowConfig.keyField,
|
|
1293
1293
|
emitUpdate: !1,
|
|
1294
1294
|
buffer: 300,
|
|
1295
1295
|
class: "virtual-table-wrapper",
|
|
1296
1296
|
contenteditable: ((n = i.editConfig) == null ? void 0 : n.trigger) === "contenteditable" ? "true" : void 0,
|
|
1297
|
-
onContextmenu:
|
|
1297
|
+
onContextmenu: M,
|
|
1298
1298
|
onScrollend: nn,
|
|
1299
1299
|
onUpdate: an,
|
|
1300
1300
|
onFocusin: $e,
|
|
@@ -1305,7 +1305,7 @@ const ii = /* @__PURE__ */ un({
|
|
|
1305
1305
|
index: s,
|
|
1306
1306
|
active: f
|
|
1307
1307
|
}) => {
|
|
1308
|
-
var u, k,
|
|
1308
|
+
var u, k, C;
|
|
1309
1309
|
let c;
|
|
1310
1310
|
return G(_n, {
|
|
1311
1311
|
key: a[i.rowConfig.keyField],
|
|
@@ -1319,19 +1319,19 @@ const ii = /* @__PURE__ */ un({
|
|
|
1319
1319
|
"virtual-table-row": !0,
|
|
1320
1320
|
"we-vt-body--row": !0,
|
|
1321
1321
|
"row--current": a[i.rowConfig.keyField] === ((k = N.value) == null ? void 0 : k[i.rowConfig.keyField]) || // 如果是树,并且配置了childCurrent高亮子节点
|
|
1322
|
-
((
|
|
1322
|
+
((C = i.treeConfig) == null ? void 0 : C.childCurrent) && gt.value.includes(a[i.rowConfig.keyField])
|
|
1323
1323
|
}
|
|
1324
1324
|
}, ni(c = Le.value.map((y) => {
|
|
1325
|
-
var
|
|
1325
|
+
var g, w, R, O, F, H, ee;
|
|
1326
1326
|
return G("div", {
|
|
1327
1327
|
key: y.prop,
|
|
1328
1328
|
class: "virtual-table-cell we-vt-cell",
|
|
1329
1329
|
style: je(y.width),
|
|
1330
1330
|
"data-prop": y.prop
|
|
1331
|
-
}, [a._editing && ((
|
|
1331
|
+
}, [a._editing && ((g = i.editConfig) == null ? void 0 : g.trigger) === "dblclick" ? ((w = y.slots) == null ? void 0 : w.edit) && ((O = (R = y.slots) == null ? void 0 : R.edit) == null ? void 0 : O.call(R, {
|
|
1332
1332
|
row: a,
|
|
1333
1333
|
column: y
|
|
1334
|
-
})) : ((
|
|
1334
|
+
})) : ((F = y.slots) == null ? void 0 : F.default) && ((ee = (H = y.slots) == null ? void 0 : H.default) == null ? void 0 : ee.call(H, {
|
|
1335
1335
|
row: a,
|
|
1336
1336
|
column: y
|
|
1337
1337
|
}))]);
|
|
@@ -1372,12 +1372,12 @@ const si = /* @__PURE__ */ De(li, [["render", oi]]), ri = { class: "catalog-node
|
|
|
1372
1372
|
emits: ["navigate"],
|
|
1373
1373
|
setup(i, { emit: e }) {
|
|
1374
1374
|
const t = i, l = e, o = oe(!0), d = ke(() => t.item.children && t.item.children.length > 0);
|
|
1375
|
-
function
|
|
1376
|
-
|
|
1375
|
+
function A(E) {
|
|
1376
|
+
E.stopPropagation(), o.value = !o.value;
|
|
1377
1377
|
}
|
|
1378
|
-
return (
|
|
1379
|
-
const
|
|
1380
|
-
return h(),
|
|
1378
|
+
return (E, N) => {
|
|
1379
|
+
const P = pn("CatalogNode", !0);
|
|
1380
|
+
return h(), p("div", ri, [
|
|
1381
1381
|
re("div", {
|
|
1382
1382
|
class: Ie(["catalog-node__label", { "is-active": i.activeId === i.item.nodeId }]),
|
|
1383
1383
|
style: K({ paddingLeft: 10 + i.depth * 14 + "px" }),
|
|
@@ -1386,7 +1386,7 @@ const si = /* @__PURE__ */ De(li, [["render", oi]]), ri = { class: "catalog-node
|
|
|
1386
1386
|
}, [
|
|
1387
1387
|
re("span", {
|
|
1388
1388
|
class: "catalog-node__toggle",
|
|
1389
|
-
onClick:
|
|
1389
|
+
onClick: A
|
|
1390
1390
|
}, [
|
|
1391
1391
|
d.value ? (h(), Fe(Xe(o.value ? Ae(Dn) : Ae(Ht)), {
|
|
1392
1392
|
key: 0,
|
|
@@ -1395,8 +1395,8 @@ const si = /* @__PURE__ */ De(li, [["render", oi]]), ri = { class: "catalog-node
|
|
|
1395
1395
|
]),
|
|
1396
1396
|
re("span", di, te(i.item.name || "(无标题)"), 1)
|
|
1397
1397
|
], 14, ci),
|
|
1398
|
-
d.value && o.value ? (h(),
|
|
1399
|
-
(h(!0),
|
|
1398
|
+
d.value && o.value ? (h(), p("div", ui, [
|
|
1399
|
+
(h(!0), p(J, null, le(i.item.children, (X) => (h(), Fe(P, {
|
|
1400
1400
|
key: X.nodeId,
|
|
1401
1401
|
item: X,
|
|
1402
1402
|
depth: i.depth + 1,
|
|
@@ -1424,39 +1424,39 @@ const si = /* @__PURE__ */ De(li, [["render", oi]]), ri = { class: "catalog-node
|
|
|
1424
1424
|
emits: ["navigate"],
|
|
1425
1425
|
setup(i, { emit: e }) {
|
|
1426
1426
|
const t = e, l = oe(!1), o = oe("");
|
|
1427
|
-
function d(
|
|
1428
|
-
o.value =
|
|
1427
|
+
function d(A) {
|
|
1428
|
+
o.value = A.nodeId, t("navigate", A);
|
|
1429
1429
|
}
|
|
1430
|
-
return (
|
|
1430
|
+
return (A, E) => l.value ? (h(), p("div", gi, [
|
|
1431
1431
|
re("button", {
|
|
1432
1432
|
class: "catalog__icon-btn",
|
|
1433
1433
|
title: "展开目录",
|
|
1434
|
-
onClick:
|
|
1434
|
+
onClick: E[0] || (E[0] = (N) => l.value = !1)
|
|
1435
1435
|
}, [
|
|
1436
1436
|
G(Ae(zn), { size: 18 })
|
|
1437
1437
|
])
|
|
1438
|
-
])) : (h(),
|
|
1438
|
+
])) : (h(), p("div", pi, [
|
|
1439
1439
|
re("div", vi, [
|
|
1440
1440
|
re("span", mi, [
|
|
1441
1441
|
G(Ae(Nn), { size: 16 }),
|
|
1442
|
-
|
|
1442
|
+
E[2] || (E[2] = Re(" 目录 ", -1))
|
|
1443
1443
|
]),
|
|
1444
1444
|
re("button", {
|
|
1445
1445
|
class: "catalog__icon-btn",
|
|
1446
1446
|
title: "收起目录",
|
|
1447
|
-
onClick:
|
|
1447
|
+
onClick: E[1] || (E[1] = (N) => l.value = !0)
|
|
1448
1448
|
}, [
|
|
1449
1449
|
G(Ae(Vn), { size: 18 })
|
|
1450
1450
|
])
|
|
1451
1451
|
]),
|
|
1452
1452
|
re("div", yi, [
|
|
1453
|
-
(h(!0),
|
|
1453
|
+
(h(!0), p(J, null, le(i.items, (N) => (h(), Fe(fi, {
|
|
1454
1454
|
key: N.nodeId,
|
|
1455
1455
|
item: N,
|
|
1456
1456
|
"active-id": o.value,
|
|
1457
1457
|
onNavigate: d
|
|
1458
1458
|
}, null, 8, ["item", "active-id"]))), 128)),
|
|
1459
|
-
i.items.length ? ge("", !0) : (h(),
|
|
1459
|
+
i.items.length ? ge("", !0) : (h(), p("div", _i, " 暂无目录 "))
|
|
1460
1460
|
])
|
|
1461
1461
|
]));
|
|
1462
1462
|
}
|
|
@@ -1485,8 +1485,8 @@ function Ci(i) {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
if (!e.length) return [];
|
|
1487
1487
|
const t = (o, d) => {
|
|
1488
|
-
const
|
|
1489
|
-
|
|
1488
|
+
const A = d.children[d.children.length - 1];
|
|
1489
|
+
A && o.level > A.level ? t(o, A) : d.children.push(o);
|
|
1490
1490
|
}, l = [];
|
|
1491
1491
|
for (const o of e) {
|
|
1492
1492
|
const d = l[l.length - 1];
|
|
@@ -1577,22 +1577,22 @@ const Ei = { class: "editor-layout word-editor-scope" }, Si = { class: "editor-c
|
|
|
1577
1577
|
let d = null;
|
|
1578
1578
|
rt(() => {
|
|
1579
1579
|
d = new ResizeObserver((m) => {
|
|
1580
|
-
const
|
|
1580
|
+
const x = {};
|
|
1581
1581
|
for (const r of m) {
|
|
1582
|
-
const
|
|
1583
|
-
if (!
|
|
1584
|
-
const
|
|
1585
|
-
|
|
1582
|
+
const L = r.target._rowKey;
|
|
1583
|
+
if (!L) continue;
|
|
1584
|
+
const v = Math.round(r.contentRect.height);
|
|
1585
|
+
v > (o.value[L] || 0) && (x[L] = v);
|
|
1586
1586
|
}
|
|
1587
|
-
Object.keys(
|
|
1587
|
+
Object.keys(x).length && (o.value = { ...o.value, ...x });
|
|
1588
1588
|
});
|
|
1589
1589
|
}), Ze(() => {
|
|
1590
1590
|
d == null || d.disconnect(), d = null;
|
|
1591
1591
|
});
|
|
1592
|
-
function
|
|
1593
|
-
!m || !d || (m._rowKey =
|
|
1592
|
+
function A(m, x) {
|
|
1593
|
+
!m || !d || (m._rowKey = x, d.observe(m));
|
|
1594
1594
|
}
|
|
1595
|
-
const
|
|
1595
|
+
const E = {
|
|
1596
1596
|
left: "left",
|
|
1597
1597
|
center: "center",
|
|
1598
1598
|
right: "right",
|
|
@@ -1600,45 +1600,37 @@ const Ei = { class: "editor-layout word-editor-scope" }, Si = { class: "editor-c
|
|
|
1600
1600
|
justify: "justify"
|
|
1601
1601
|
};
|
|
1602
1602
|
function N(m) {
|
|
1603
|
-
const
|
|
1604
|
-
|
|
1605
|
-
const O = (g) => {
|
|
1606
|
-
r ? (r = !1, b.push({ ...g, _coverBreakBefore: !0 })) : b.push(g);
|
|
1603
|
+
const x = [], r = (L) => {
|
|
1604
|
+
x.push(L);
|
|
1607
1605
|
};
|
|
1608
|
-
for (const
|
|
1609
|
-
if (
|
|
1610
|
-
const
|
|
1611
|
-
|
|
1612
|
-
let E = !1;
|
|
1613
|
-
for (const C of S)
|
|
1614
|
-
!E && C.type === "table" && C.extension ? (b.push({ ...C, _coverBreakBefore: !0 }), E = !0) : O(C);
|
|
1615
|
-
r = !0;
|
|
1616
|
-
} else
|
|
1617
|
-
for (const E of S) O(E);
|
|
1606
|
+
for (const L of m || [])
|
|
1607
|
+
if (L && L.type === "area") {
|
|
1608
|
+
const v = N(L.valueList || []);
|
|
1609
|
+
for (const S of v) r(S);
|
|
1618
1610
|
} else
|
|
1619
|
-
|
|
1620
|
-
return
|
|
1611
|
+
r(L);
|
|
1612
|
+
return x;
|
|
1621
1613
|
}
|
|
1622
|
-
function
|
|
1623
|
-
const
|
|
1624
|
-
let
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1627
|
-
},
|
|
1628
|
-
if (
|
|
1614
|
+
function P(m) {
|
|
1615
|
+
const x = N(m), r = [];
|
|
1616
|
+
let L = [], v = 0, S = null;
|
|
1617
|
+
const $ = (I) => {
|
|
1618
|
+
L.length && (r.push({ type: "paragraph", elements: [...L], rowFlex: I }), L = []);
|
|
1619
|
+
}, M = () => {
|
|
1620
|
+
if (v === 0) return;
|
|
1629
1621
|
const I = S;
|
|
1630
|
-
|
|
1631
|
-
for (let D = 1; D <
|
|
1622
|
+
$(I);
|
|
1623
|
+
for (let D = 1; D < v; D++)
|
|
1632
1624
|
r.push({ type: "paragraph", elements: [], rowFlex: I });
|
|
1633
|
-
|
|
1625
|
+
v = 0, S = null;
|
|
1634
1626
|
};
|
|
1635
|
-
for (const I of
|
|
1627
|
+
for (const I of x || [])
|
|
1636
1628
|
if (I.type === "table")
|
|
1637
|
-
|
|
1629
|
+
M(), $(), r.push({ type: "table", el: I });
|
|
1638
1630
|
else if (I.type === "title")
|
|
1639
|
-
|
|
1631
|
+
M(), $(), r.push({ type: "title", el: I });
|
|
1640
1632
|
else if (I.type === "list") {
|
|
1641
|
-
|
|
1633
|
+
M(), $();
|
|
1642
1634
|
const D = [];
|
|
1643
1635
|
let _ = [];
|
|
1644
1636
|
for (const pe of I.valueList || [])
|
|
@@ -1646,116 +1638,116 @@ const Ei = { class: "editor-layout word-editor-scope" }, Si = { class: "editor-c
|
|
|
1646
1638
|
` || pe.value === "" ? (D.push([..._]), _ = []) : _.push(pe);
|
|
1647
1639
|
(_.length || D.length === 0) && D.push([..._]), r.push({ type: "list", listType: I.listType || "ul", listStyle: I.listStyle || "disc", items: D });
|
|
1648
1640
|
} else if (I.listId) {
|
|
1649
|
-
|
|
1641
|
+
M(), $();
|
|
1650
1642
|
const D = I.value === "" || I.value === "" ? [] : [I];
|
|
1651
1643
|
r.push({ type: "list", listType: I.listType || "ul", listStyle: I.listStyle || "disc", items: [D] });
|
|
1652
|
-
} else I.value != null && /^[\n\u200B]+$/.test(I.value) ? (
|
|
1653
|
-
return
|
|
1644
|
+
} else I.value != null && /^[\n\u200B]+$/.test(I.value) ? (v += I.value.length, I.rowFlex && (S = I.rowFlex)) : (M(), L.push(I));
|
|
1645
|
+
return M(), $(), r;
|
|
1654
1646
|
}
|
|
1655
1647
|
function X(m) {
|
|
1656
|
-
const
|
|
1657
|
-
return !
|
|
1648
|
+
const x = (m == null ? void 0 : m.width) || 0;
|
|
1649
|
+
return !x || x <= Pt ? 1 : Pt / x;
|
|
1658
1650
|
}
|
|
1659
1651
|
function V(m) {
|
|
1660
|
-
const
|
|
1661
|
-
if (!r) return
|
|
1662
|
-
const
|
|
1663
|
-
return
|
|
1652
|
+
const x = m.filter((D) => D.type === "image").reduce((D, _) => D + (_.height || _.width || 0), 0), r = m.filter((D) => D.type !== "image").map((D) => D.value || "").join("");
|
|
1653
|
+
if (!r) return x || 20;
|
|
1654
|
+
const L = m.reduce((D, _) => Math.max(D, _.size || 0), 0) || 14, v = L + 6, S = (r.match(/[一-龥]/g) || []).length, $ = r.length - S, M = S * L + $ * (L * 0.5), I = Math.max(1, Math.ceil(M / At));
|
|
1655
|
+
return x + Math.max(v, I * v);
|
|
1664
1656
|
}
|
|
1665
1657
|
function q(m) {
|
|
1666
1658
|
if (!m || !m.length) return [[]];
|
|
1667
|
-
const
|
|
1659
|
+
const x = [];
|
|
1668
1660
|
let r = [];
|
|
1669
|
-
for (const
|
|
1670
|
-
|
|
1671
|
-
return r.length &&
|
|
1661
|
+
for (const L of m)
|
|
1662
|
+
L.type === "image" && (L.width || 0) >= At ? (r.length && (x.push(r), r = []), x.push([L])) : r.push(L);
|
|
1663
|
+
return r.length && x.push(r), x.length ? x : [[]];
|
|
1672
1664
|
}
|
|
1673
1665
|
function Y(m) {
|
|
1674
1666
|
if (m.length === 0) return [];
|
|
1675
|
-
const
|
|
1676
|
-
m.forEach((S,
|
|
1677
|
-
(S.tdList || []).forEach((
|
|
1678
|
-
const I =
|
|
1667
|
+
const x = new Array(m.length).fill(0);
|
|
1668
|
+
m.forEach((S, $) => {
|
|
1669
|
+
(S.tdList || []).forEach((M) => {
|
|
1670
|
+
const I = M.rowspan || 1;
|
|
1679
1671
|
if (I > 1) {
|
|
1680
|
-
const D = Math.min(
|
|
1681
|
-
|
|
1682
|
-
for (let _ = 1; _ < I &&
|
|
1683
|
-
|
|
1672
|
+
const D = Math.min($ + I - 1, m.length - 1);
|
|
1673
|
+
x[$] = Math.max(x[$], D);
|
|
1674
|
+
for (let _ = 1; _ < I && $ + _ < m.length; _++)
|
|
1675
|
+
x[$ + _] = Math.max(x[$ + _], D);
|
|
1684
1676
|
}
|
|
1685
1677
|
});
|
|
1686
1678
|
});
|
|
1687
1679
|
const r = [];
|
|
1688
|
-
let
|
|
1680
|
+
let L = 0, v = 0;
|
|
1689
1681
|
for (let S = 0; S < m.length; S++)
|
|
1690
|
-
|
|
1691
|
-
return
|
|
1682
|
+
v = Math.max(v, x[S]), v <= S && (r.push(m.slice(L, S + 1)), L = S + 1, v = 0);
|
|
1683
|
+
return L < m.length && r.push(m.slice(L)), r;
|
|
1692
1684
|
}
|
|
1693
1685
|
const Z = ke(() => {
|
|
1694
|
-
const m =
|
|
1686
|
+
const m = P(t.value), x = [];
|
|
1695
1687
|
let r = 0;
|
|
1696
|
-
const
|
|
1688
|
+
const L = Ii(), v = { first: 0, second: 1, third: 2, fourth: 3, fifth: 4, sixth: 5, seventh: 6, eighth: 7 };
|
|
1697
1689
|
let S = -1;
|
|
1698
|
-
const
|
|
1690
|
+
const $ = (M) => {
|
|
1699
1691
|
var I, D, _;
|
|
1700
|
-
return !!((I =
|
|
1692
|
+
return !!((I = M.el) != null && I._coverBreakBefore || (_ = (D = M.elements) == null ? void 0 : D[0]) != null && _._coverBreakBefore);
|
|
1701
1693
|
};
|
|
1702
|
-
return m.forEach((
|
|
1694
|
+
return m.forEach((M, I) => {
|
|
1703
1695
|
var _, pe, ve;
|
|
1704
|
-
const D =
|
|
1705
|
-
if (D && (r = 0),
|
|
1706
|
-
const ue =
|
|
1696
|
+
const D = $(M);
|
|
1697
|
+
if (D && (r = 0), M.type === "title") {
|
|
1698
|
+
const ue = M.el.valueList || [], ne = L.next(M.el.level, (_ = M.el.extension) == null ? void 0 : _.startIndex), ce = ue.some((T) => {
|
|
1707
1699
|
var Q;
|
|
1708
|
-
return (Q =
|
|
1700
|
+
return (Q = T.extension) == null ? void 0 : Q.isIndex;
|
|
1709
1701
|
});
|
|
1710
1702
|
let ie = ue;
|
|
1711
1703
|
if (!ce && ne) {
|
|
1712
|
-
const
|
|
1704
|
+
const T = ue[0] || {};
|
|
1713
1705
|
ie = [
|
|
1714
1706
|
{
|
|
1715
1707
|
value: ne,
|
|
1716
|
-
size:
|
|
1717
|
-
bold:
|
|
1718
|
-
italic:
|
|
1719
|
-
color:
|
|
1720
|
-
font:
|
|
1708
|
+
size: T.size,
|
|
1709
|
+
bold: T.bold,
|
|
1710
|
+
italic: T.italic,
|
|
1711
|
+
color: T.color,
|
|
1712
|
+
font: T.font,
|
|
1721
1713
|
extension: { isIndex: !0 }
|
|
1722
1714
|
},
|
|
1723
1715
|
...ue
|
|
1724
1716
|
];
|
|
1725
1717
|
}
|
|
1726
|
-
const he = ie.map((
|
|
1727
|
-
r = r + se > Me && r > 0 ? se : r + se, S =
|
|
1718
|
+
const he = ie.map((T) => T.value || "").join(""), se = V(ie);
|
|
1719
|
+
r = r + se > Me && r > 0 ? se : r + se, S = v[M.el.level] ?? 0, x.push({
|
|
1728
1720
|
node_id: `blk_${I}_0`,
|
|
1729
1721
|
layer: D ? 1 : 100,
|
|
1730
1722
|
blockType: "title",
|
|
1731
|
-
level:
|
|
1732
|
-
titleEl:
|
|
1723
|
+
level: M.el.level,
|
|
1724
|
+
titleEl: M.el,
|
|
1733
1725
|
titleValueList: ie,
|
|
1734
1726
|
content_type: "text",
|
|
1735
1727
|
content: he,
|
|
1736
1728
|
height: se,
|
|
1737
1729
|
indentPx: S * 20
|
|
1738
1730
|
});
|
|
1739
|
-
} else if (
|
|
1740
|
-
const ue = q(
|
|
1731
|
+
} else if (M.type === "paragraph") {
|
|
1732
|
+
const ue = q(M.elements), ne = S >= 0 ? (S + 1) * 20 : 0;
|
|
1741
1733
|
ue.forEach((ce, ie) => {
|
|
1742
|
-
const he = ce.map((
|
|
1743
|
-
r = r + se > Me && r > 0 ? se : r + se,
|
|
1734
|
+
const he = ce.map((T) => T.value || "").join(""), se = V(ce);
|
|
1735
|
+
r = r + se > Me && r > 0 ? se : r + se, x.push({
|
|
1744
1736
|
node_id: `blk_${I}_${ie}`,
|
|
1745
1737
|
layer: D && ie === 0 ? 1 : 100,
|
|
1746
1738
|
blockType: "paragraph",
|
|
1747
1739
|
elements: ce,
|
|
1748
|
-
rowFlex:
|
|
1740
|
+
rowFlex: M.rowFlex,
|
|
1749
1741
|
content_type: "text",
|
|
1750
1742
|
content: he,
|
|
1751
1743
|
height: se,
|
|
1752
1744
|
indentPx: ne
|
|
1753
1745
|
});
|
|
1754
1746
|
});
|
|
1755
|
-
} else if (
|
|
1756
|
-
const ue = !!((pe =
|
|
1757
|
-
ie.forEach((se,
|
|
1758
|
-
const Q = `blk_${I}_${
|
|
1747
|
+
} else if (M.type === "table") {
|
|
1748
|
+
const ue = !!((pe = M.el.extension) != null && pe.isTitleTable), ne = ((ve = M.el.extension) == null ? void 0 : ve.elementType) === "signOff", ce = ue || ne ? 0 : S >= 0 ? (S + 1) * 20 : 0, ie = Y(M.el.trList || []), he = ie.length;
|
|
1749
|
+
ie.forEach((se, T) => {
|
|
1750
|
+
const Q = `blk_${I}_${T}`, Pe = se.reduce(
|
|
1759
1751
|
(xe, z) => xe + (z.height || z.minHeight || 35),
|
|
1760
1752
|
0
|
|
1761
1753
|
), _e = Math.max(Pe, o.value[Q] || 0);
|
|
@@ -1763,17 +1755,17 @@ const Ei = { class: "editor-layout word-editor-scope" }, Si = { class: "editor-c
|
|
|
1763
1755
|
const xe = Math.ceil(_e / Me);
|
|
1764
1756
|
for (let z = 0; z < xe; z++) {
|
|
1765
1757
|
const Ee = z * Me, $e = Math.min(Me, _e - Ee), ze = z > 0 || r > 0;
|
|
1766
|
-
r = $e,
|
|
1767
|
-
node_id: `blk_${I}_${
|
|
1768
|
-
layer: D &&
|
|
1758
|
+
r = $e, x.push({
|
|
1759
|
+
node_id: `blk_${I}_${T}_s${z}`,
|
|
1760
|
+
layer: D && T === 0 && z === 0 ? 1 : 100,
|
|
1769
1761
|
blockType: "table-row-group",
|
|
1770
1762
|
content_type: "table-row",
|
|
1771
1763
|
rowHeight: _e,
|
|
1772
1764
|
trGroup: se,
|
|
1773
|
-
tableEl:
|
|
1774
|
-
tableRowFlex:
|
|
1775
|
-
isFirst:
|
|
1776
|
-
isLast:
|
|
1765
|
+
tableEl: M.el,
|
|
1766
|
+
tableRowFlex: M.el.rowFlex || null,
|
|
1767
|
+
isFirst: T === 0 && z === 0,
|
|
1768
|
+
isLast: T === he - 1 && z === xe - 1,
|
|
1777
1769
|
isPageBreak: ze,
|
|
1778
1770
|
sliceOffset: Ee,
|
|
1779
1771
|
sliceHeight: $e,
|
|
@@ -1783,63 +1775,63 @@ const Ei = { class: "editor-layout word-editor-scope" }, Si = { class: "editor-c
|
|
|
1783
1775
|
});
|
|
1784
1776
|
}
|
|
1785
1777
|
} else {
|
|
1786
|
-
const xe =
|
|
1787
|
-
r = r + _e > Me ? _e : r + _e,
|
|
1788
|
-
node_id: `blk_${I}_${
|
|
1789
|
-
layer: D &&
|
|
1778
|
+
const xe = T > 0 && r + _e > Me;
|
|
1779
|
+
r = r + _e > Me ? _e : r + _e, x.push({
|
|
1780
|
+
node_id: `blk_${I}_${T}`,
|
|
1781
|
+
layer: D && T === 0 ? 1 : 100,
|
|
1790
1782
|
blockType: "table-row-group",
|
|
1791
1783
|
content_type: "table-row",
|
|
1792
1784
|
rowHeight: _e,
|
|
1793
1785
|
trGroup: se,
|
|
1794
|
-
tableEl:
|
|
1795
|
-
tableRowFlex:
|
|
1796
|
-
isFirst:
|
|
1797
|
-
isLast:
|
|
1786
|
+
tableEl: M.el,
|
|
1787
|
+
tableRowFlex: M.el.rowFlex || null,
|
|
1788
|
+
isFirst: T === 0,
|
|
1789
|
+
isLast: T === he - 1,
|
|
1798
1790
|
isPageBreak: xe,
|
|
1799
1791
|
indentPx: ce
|
|
1800
1792
|
});
|
|
1801
1793
|
}
|
|
1802
1794
|
});
|
|
1803
|
-
} else if (
|
|
1795
|
+
} else if (M.type === "list") {
|
|
1804
1796
|
const ue = Math.round(18);
|
|
1805
1797
|
let ne = 0;
|
|
1806
|
-
for (const ce of
|
|
1798
|
+
for (const ce of M.items)
|
|
1807
1799
|
ne += ce.length ? V(ce) : ue;
|
|
1808
|
-
ne = Math.max(ne, ue), r = r + ne > Me && r > 0 ? ne : r + ne,
|
|
1800
|
+
ne = Math.max(ne, ue), r = r + ne > Me && r > 0 ? ne : r + ne, x.push({
|
|
1809
1801
|
node_id: `blk_${I}_0`,
|
|
1810
1802
|
layer: D ? 1 : 100,
|
|
1811
1803
|
blockType: "list",
|
|
1812
|
-
listType:
|
|
1813
|
-
listStyle:
|
|
1814
|
-
items:
|
|
1804
|
+
listType: M.listType,
|
|
1805
|
+
listStyle: M.listStyle,
|
|
1806
|
+
items: M.items,
|
|
1815
1807
|
height: ne,
|
|
1816
1808
|
indentPx: S >= 0 ? (S + 1) * 20 : 0
|
|
1817
1809
|
});
|
|
1818
1810
|
}
|
|
1819
|
-
}),
|
|
1811
|
+
}), x;
|
|
1820
1812
|
}), ye = ke(() => Ci(Z.value));
|
|
1821
1813
|
function W(m) {
|
|
1822
|
-
var
|
|
1823
|
-
(
|
|
1814
|
+
var x;
|
|
1815
|
+
(x = l.value) == null || x.scrollToRow({ node_id: m.nodeId });
|
|
1824
1816
|
}
|
|
1825
1817
|
function B(m) {
|
|
1826
|
-
var S,
|
|
1827
|
-
const
|
|
1828
|
-
return
|
|
1818
|
+
var S, $;
|
|
1819
|
+
const x = m.elements || [], r = ((S = x.find((M) => M.rowFlex)) == null ? void 0 : S.rowFlex) || m.rowFlex, L = { textAlign: E[r] || "left" }, v = ($ = x.find((M) => M.rowMargin)) == null ? void 0 : $.rowMargin;
|
|
1820
|
+
return v && (L.lineHeight = v), L;
|
|
1829
1821
|
}
|
|
1830
|
-
function
|
|
1831
|
-
const
|
|
1832
|
-
m.font && (
|
|
1822
|
+
function b(m) {
|
|
1823
|
+
const x = {};
|
|
1824
|
+
m.font && (x.fontFamily = m.font), x.fontSize = (m.size || lt) + "px", m.bold != null && (x.fontWeight = m.bold ? "bold" : "normal"), m.italic != null && (x.fontStyle = m.italic ? "italic" : "normal"), m.color && (x.color = m.color), m.highlight && m.highlight !== "rgb(255, 255, 255)" && m.highlight !== "#ffffff" && (x.backgroundColor = m.highlight);
|
|
1833
1825
|
const r = [m.underline && "underline", m.strikeout && "line-through"].filter(Boolean).join(" ");
|
|
1834
|
-
return r && (
|
|
1826
|
+
return r && (x.textDecoration = r), m.letterSpacing && (x.letterSpacing = m.letterSpacing + "px"), x;
|
|
1835
1827
|
}
|
|
1836
|
-
return (m,
|
|
1828
|
+
return (m, x) => (h(), p("div", Ei, [
|
|
1837
1829
|
G(xi, {
|
|
1838
1830
|
items: ye.value,
|
|
1839
1831
|
onNavigate: W
|
|
1840
1832
|
}, null, 8, ["items"]),
|
|
1841
1833
|
re("div", Si, [
|
|
1842
|
-
i.loading ? (h(),
|
|
1834
|
+
i.loading ? (h(), p("div", Ti, " 加载中… ")) : (h(), Fe(Ae(ai), {
|
|
1843
1835
|
key: 1,
|
|
1844
1836
|
ref_key: "virtualTableRef",
|
|
1845
1837
|
ref: l,
|
|
@@ -1861,118 +1853,118 @@ const Ei = { class: "editor-layout word-editor-scope" }, Si = { class: "editor-c
|
|
|
1861
1853
|
default: nt(() => [
|
|
1862
1854
|
G(Ae(si), null, {
|
|
1863
1855
|
default: nt(({ row: r }) => {
|
|
1864
|
-
var
|
|
1856
|
+
var L;
|
|
1865
1857
|
return [
|
|
1866
|
-
r.blockType === "title" ? (h(),
|
|
1858
|
+
r.blockType === "title" ? (h(), p("p", {
|
|
1867
1859
|
key: 0,
|
|
1868
1860
|
class: Ie(["doc-title", `doc-title--${r.level}`]),
|
|
1869
1861
|
style: K({ paddingLeft: r.indentPx ? r.indentPx + "px" : void 0 })
|
|
1870
1862
|
}, [
|
|
1871
|
-
(h(!0),
|
|
1863
|
+
(h(!0), p(J, null, le(r.titleValueList || [], (v, S) => (h(), p("span", {
|
|
1872
1864
|
key: S,
|
|
1873
|
-
style: K(
|
|
1874
|
-
}, te(
|
|
1875
|
-
], 6)) : r.blockType === "paragraph" ? (h(),
|
|
1865
|
+
style: K(b(v))
|
|
1866
|
+
}, te(v.value), 5))), 128))
|
|
1867
|
+
], 6)) : r.blockType === "paragraph" ? (h(), p("p", {
|
|
1876
1868
|
key: 1,
|
|
1877
1869
|
class: "doc-para",
|
|
1878
1870
|
style: K({ ...B(r), paddingLeft: r.indentPx ? r.indentPx + "px" : void 0 })
|
|
1879
1871
|
}, [
|
|
1880
|
-
r.elements.length ? ge("", !0) : (h(),
|
|
1881
|
-
(h(!0),
|
|
1882
|
-
var
|
|
1883
|
-
return h(),
|
|
1884
|
-
!
|
|
1872
|
+
r.elements.length ? ge("", !0) : (h(), p("span", Fi, " ")),
|
|
1873
|
+
(h(!0), p(J, null, le(r.elements, (v, S) => {
|
|
1874
|
+
var $, M, I, D, _, pe, ve, ue, ne, ce, ie, he, se;
|
|
1875
|
+
return h(), p(J, { key: S }, [
|
|
1876
|
+
!v.type || v.type === "text" ? (h(), p("span", {
|
|
1885
1877
|
key: 0,
|
|
1886
|
-
style: K(
|
|
1887
|
-
}, te(
|
|
1878
|
+
style: K(b(v))
|
|
1879
|
+
}, te(v.value), 5)) : v.type === "hyperlink" ? (h(), p("a", {
|
|
1888
1880
|
key: 1,
|
|
1889
|
-
href:
|
|
1881
|
+
href: v.url,
|
|
1890
1882
|
class: "doc-link",
|
|
1891
1883
|
target: "_blank",
|
|
1892
1884
|
rel: "noopener"
|
|
1893
1885
|
}, [
|
|
1894
|
-
(h(!0),
|
|
1886
|
+
(h(!0), p(J, null, le(v.valueList || [], (T, Q) => (h(), p("span", {
|
|
1895
1887
|
key: Q,
|
|
1896
|
-
style: K(
|
|
1897
|
-
}, te(
|
|
1898
|
-
], 8, Ai)) :
|
|
1888
|
+
style: K(b(T))
|
|
1889
|
+
}, te(T.value), 5))), 128))
|
|
1890
|
+
], 8, Ai)) : v.type === "image" ? (h(), p("img", {
|
|
1899
1891
|
key: 2,
|
|
1900
|
-
src:
|
|
1892
|
+
src: v.value,
|
|
1901
1893
|
class: "doc-image",
|
|
1902
1894
|
style: K({
|
|
1903
|
-
width:
|
|
1904
|
-
height:
|
|
1895
|
+
width: v.width ? v.width + "px" : "auto",
|
|
1896
|
+
height: v.height ? v.height + "px" : "auto"
|
|
1905
1897
|
})
|
|
1906
|
-
}, null, 12, Pi)) :
|
|
1907
|
-
((
|
|
1898
|
+
}, null, 12, Pi)) : v.type === "control" ? (h(), p(J, { key: 3 }, [
|
|
1899
|
+
(($ = v.control) == null ? void 0 : $.type) === "text" ? (h(), p("span", {
|
|
1908
1900
|
key: 0,
|
|
1909
|
-
style: K({ fontSize: (
|
|
1901
|
+
style: K({ fontSize: (v.control.size || 12) + "px" })
|
|
1910
1902
|
}, [
|
|
1911
|
-
(h(!0),
|
|
1903
|
+
(h(!0), p(J, null, le(v.control.value || [], (T, Q) => (h(), p("span", {
|
|
1912
1904
|
key: Q,
|
|
1913
|
-
style: K(
|
|
1914
|
-
}, te(
|
|
1915
|
-
], 4)) : ((
|
|
1905
|
+
style: K(b(T))
|
|
1906
|
+
}, te(T.value), 5))), 128))
|
|
1907
|
+
], 4)) : ((M = v.control) == null ? void 0 : M.type) === "input" ? (h(), p("span", {
|
|
1916
1908
|
key: 1,
|
|
1917
1909
|
class: "ctrl-input",
|
|
1918
1910
|
style: K({
|
|
1919
|
-
minWidth: (
|
|
1920
|
-
fontSize: (
|
|
1911
|
+
minWidth: (v.control.minWidth || 60) + "px",
|
|
1912
|
+
fontSize: (v.control.size || 12) + "px"
|
|
1921
1913
|
})
|
|
1922
1914
|
}, [
|
|
1923
|
-
(h(!0),
|
|
1924
|
-
], 4)) : ((I =
|
|
1915
|
+
(h(!0), p(J, null, le(v.control.value || [], (T, Q) => (h(), p("span", { key: Q }, te(T.value), 1))), 128))
|
|
1916
|
+
], 4)) : ((I = v.control) == null ? void 0 : I.type) === "radio" ? (h(), p("span", {
|
|
1925
1917
|
key: 2,
|
|
1926
|
-
class: Ie(["ctrl-options", { "ctrl-options--vertical": ((_ = (D =
|
|
1927
|
-
style: K({ fontSize: (
|
|
1918
|
+
class: Ie(["ctrl-options", { "ctrl-options--vertical": ((_ = (D = v.control.extension) == null ? void 0 : D.elementAttributes) == null ? void 0 : _.layout) === "vertical" }]),
|
|
1919
|
+
style: K({ fontSize: (v.control.size || lt) + "px" })
|
|
1928
1920
|
}, [
|
|
1929
|
-
(h(!0),
|
|
1921
|
+
(h(!0), p(J, null, le(v.control.valueSets || [], (T, Q) => (h(), p("label", {
|
|
1930
1922
|
key: Q,
|
|
1931
1923
|
class: "ctrl-option"
|
|
1932
1924
|
}, [
|
|
1933
1925
|
re("input", {
|
|
1934
1926
|
type: "radio",
|
|
1935
1927
|
disabled: "",
|
|
1936
|
-
checked:
|
|
1928
|
+
checked: v.control.code === T.code
|
|
1937
1929
|
}, null, 8, $i),
|
|
1938
|
-
Re(" " + te(
|
|
1930
|
+
Re(" " + te(T.value), 1)
|
|
1939
1931
|
]))), 128))
|
|
1940
|
-
], 6)) : ((pe =
|
|
1932
|
+
], 6)) : ((pe = v.control) == null ? void 0 : pe.type) === "checkbox" ? (h(), p("span", {
|
|
1941
1933
|
key: 3,
|
|
1942
|
-
class: Ie(["ctrl-options", { "ctrl-options--vertical": ((ue = (ve =
|
|
1943
|
-
style: K({ fontSize: (
|
|
1934
|
+
class: Ie(["ctrl-options", { "ctrl-options--vertical": ((ue = (ve = v.control.extension) == null ? void 0 : ve.elementAttributes) == null ? void 0 : ue.layout) === "vertical" }]),
|
|
1935
|
+
style: K({ fontSize: (v.control.size || lt) + "px" })
|
|
1944
1936
|
}, [
|
|
1945
|
-
(h(!0),
|
|
1937
|
+
(h(!0), p(J, null, le(v.control.valueSets || [], (T, Q) => (h(), p("label", {
|
|
1946
1938
|
key: Q,
|
|
1947
1939
|
class: "ctrl-option"
|
|
1948
1940
|
}, [
|
|
1949
1941
|
re("input", {
|
|
1950
1942
|
type: "checkbox",
|
|
1951
1943
|
disabled: "",
|
|
1952
|
-
checked: (
|
|
1944
|
+
checked: (v.control.code || "").split(",").includes(T.code)
|
|
1953
1945
|
}, null, 8, Li),
|
|
1954
|
-
Re(" " + te(
|
|
1946
|
+
Re(" " + te(T.value), 1)
|
|
1955
1947
|
]))), 128))
|
|
1956
|
-
], 6)) : ((ne =
|
|
1957
|
-
], 64)) :
|
|
1948
|
+
], 6)) : ((ne = v.control) == null ? void 0 : ne.type) === "select" ? (h(), p("span", Ri, te(((ie = (ce = v.control.value) == null ? void 0 : ce[0]) == null ? void 0 : ie.value) || v.control.placeholder || ""), 1)) : ge("", !0)
|
|
1949
|
+
], 64)) : v.type === "checkbox" ? (h(), p("input", {
|
|
1958
1950
|
key: 4,
|
|
1959
1951
|
type: "checkbox",
|
|
1960
|
-
checked: !!((he =
|
|
1952
|
+
checked: !!((he = v.checkbox) != null && he.value),
|
|
1961
1953
|
disabled: "",
|
|
1962
1954
|
class: "el-check"
|
|
1963
|
-
}, null, 8, Oi)) :
|
|
1955
|
+
}, null, 8, Oi)) : v.type === "radio" ? (h(), p("input", {
|
|
1964
1956
|
key: 5,
|
|
1965
1957
|
type: "radio",
|
|
1966
|
-
checked: !!((se =
|
|
1958
|
+
checked: !!((se = v.radio) != null && se.value),
|
|
1967
1959
|
disabled: "",
|
|
1968
1960
|
class: "el-check"
|
|
1969
|
-
}, null, 8, Bi)) :
|
|
1961
|
+
}, null, 8, Bi)) : v.type === "superscript" ? (h(), p("sup", {
|
|
1970
1962
|
key: 6,
|
|
1971
|
-
style: K(
|
|
1972
|
-
}, te(
|
|
1963
|
+
style: K(b(v))
|
|
1964
|
+
}, te(v.value), 5)) : v.type === "subscript" ? (h(), p("sub", {
|
|
1973
1965
|
key: 7,
|
|
1974
|
-
style: K(
|
|
1975
|
-
}, te(
|
|
1966
|
+
style: K(b(v))
|
|
1967
|
+
}, te(v.value), 5)) : v.type === "tab" ? (h(), p("span", Hi)) : ge("", !0)
|
|
1976
1968
|
], 64);
|
|
1977
1969
|
}), 128))
|
|
1978
1970
|
], 4)) : r.blockType === "list" ? (h(), Fe(Xe(r.listType === "ol" ? "ol" : "ul"), {
|
|
@@ -1981,26 +1973,26 @@ const Ei = { class: "editor-layout word-editor-scope" }, Si = { class: "editor-c
|
|
|
1981
1973
|
style: K({ listStyleType: r.listStyle === "decimal" ? "decimal" : r.listStyle === "lower-alpha" ? "lower-alpha" : "disc", paddingLeft: r.indentPx ? r.indentPx + 24 + "px" : void 0 })
|
|
1982
1974
|
}, {
|
|
1983
1975
|
default: nt(() => [
|
|
1984
|
-
(h(!0),
|
|
1976
|
+
(h(!0), p(J, null, le(r.items, (v, S) => (h(), p("li", {
|
|
1985
1977
|
key: S,
|
|
1986
1978
|
class: "doc-list-item"
|
|
1987
1979
|
}, [
|
|
1988
|
-
(h(!0),
|
|
1989
|
-
|
|
1980
|
+
(h(!0), p(J, null, le(v, ($, M) => (h(), p(J, { key: M }, [
|
|
1981
|
+
!$.type || $.type === "text" ? (h(), p("span", {
|
|
1990
1982
|
key: 0,
|
|
1991
|
-
style: K(
|
|
1992
|
-
}, te(
|
|
1983
|
+
style: K(b($))
|
|
1984
|
+
}, te($.value), 5)) : $.type === "superscript" ? (h(), p("sup", {
|
|
1993
1985
|
key: 1,
|
|
1994
|
-
style: K(
|
|
1995
|
-
}, te(
|
|
1986
|
+
style: K(b($))
|
|
1987
|
+
}, te($.value), 5)) : $.type === "subscript" ? (h(), p("sub", {
|
|
1996
1988
|
key: 2,
|
|
1997
|
-
style: K(
|
|
1998
|
-
}, te(
|
|
1989
|
+
style: K(b($))
|
|
1990
|
+
}, te($.value), 5)) : ge("", !0)
|
|
1999
1991
|
], 64))), 128))
|
|
2000
1992
|
]))), 128))
|
|
2001
1993
|
]),
|
|
2002
1994
|
_: 2
|
|
2003
|
-
}, 1032, ["style"])) : r.blockType === "table-row-group" ? (h(),
|
|
1995
|
+
}, 1032, ["style"])) : r.blockType === "table-row-group" ? (h(), p("div", {
|
|
2004
1996
|
key: 3,
|
|
2005
1997
|
class: Ie(["doc-table-row-wrap", { "is-first": r.isFirst, "is-last": r.isLast, "is-page-break": r.isPageBreak }]),
|
|
2006
1998
|
style: K({
|
|
@@ -2017,49 +2009,49 @@ const Ei = { class: "editor-layout word-editor-scope" }, Si = { class: "editor-c
|
|
|
2017
2009
|
})
|
|
2018
2010
|
}, [
|
|
2019
2011
|
re("table", {
|
|
2020
|
-
ref: r._baseKey ? (
|
|
2012
|
+
ref: r._baseKey ? (v) => A(v, r._baseKey) : void 0,
|
|
2021
2013
|
class: Ie(["doc-table", { "doc-table--no-border": r.tableEl.borderType === "empty" }]),
|
|
2022
2014
|
style: K({
|
|
2023
2015
|
width: r.tableEl.width ? r.tableEl.width * X(r.tableEl) + "px" : "100%",
|
|
2024
2016
|
transform: r.sliceOffset ? `translateY(-${r.sliceOffset}px)` : void 0
|
|
2025
2017
|
})
|
|
2026
2018
|
}, [
|
|
2027
|
-
(
|
|
2028
|
-
(h(!0),
|
|
2019
|
+
(L = r.tableEl.colgroup) != null && L.length ? (h(), p("colgroup", Di, [
|
|
2020
|
+
(h(!0), p(J, null, le(r.tableEl.colgroup, (v, S) => (h(), p("col", {
|
|
2029
2021
|
key: S,
|
|
2030
|
-
style: K({ width:
|
|
2022
|
+
style: K({ width: v.width * X(r.tableEl) + "px" })
|
|
2031
2023
|
}, null, 4))), 128))
|
|
2032
2024
|
])) : ge("", !0),
|
|
2033
2025
|
re("tbody", null, [
|
|
2034
|
-
(h(!0),
|
|
2026
|
+
(h(!0), p(J, null, le(r.trGroup, (v, S) => (h(), p("tr", {
|
|
2035
2027
|
key: S,
|
|
2036
|
-
style: K({ height: (
|
|
2028
|
+
style: K({ height: (v.height || v.minHeight || 30) + "px" })
|
|
2037
2029
|
}, [
|
|
2038
|
-
(h(!0),
|
|
2039
|
-
key:
|
|
2040
|
-
colspan:
|
|
2041
|
-
rowspan:
|
|
2030
|
+
(h(!0), p(J, null, le(v.tdList || [], ($, M) => (h(), p("td", {
|
|
2031
|
+
key: M,
|
|
2032
|
+
colspan: $.colspan || 1,
|
|
2033
|
+
rowspan: $.rowspan || 1,
|
|
2042
2034
|
style: K({
|
|
2043
|
-
backgroundColor:
|
|
2044
|
-
verticalAlign:
|
|
2045
|
-
width:
|
|
2046
|
-
height:
|
|
2035
|
+
backgroundColor: $.backgroundColor || void 0,
|
|
2036
|
+
verticalAlign: $.verticalAlign || "middle",
|
|
2037
|
+
width: $.width ? $.width * X(r.tableEl) + "px" : void 0,
|
|
2038
|
+
height: $.height ? $.height + "px" : void 0
|
|
2047
2039
|
})
|
|
2048
2040
|
}, [
|
|
2049
|
-
(h(!0),
|
|
2050
|
-
I.type === "paragraph" ? (h(),
|
|
2041
|
+
(h(!0), p(J, null, le(P($.value), (I, D) => (h(), p(J, { key: D }, [
|
|
2042
|
+
I.type === "paragraph" ? (h(), p("p", {
|
|
2051
2043
|
key: 0,
|
|
2052
2044
|
class: "cell-para",
|
|
2053
2045
|
style: K(B(I))
|
|
2054
2046
|
}, [
|
|
2055
|
-
I.elements.length ? ge("", !0) : (h(),
|
|
2056
|
-
(h(!0),
|
|
2047
|
+
I.elements.length ? ge("", !0) : (h(), p("span", Ni, " ")),
|
|
2048
|
+
(h(!0), p(J, null, le(I.elements, (_, pe) => {
|
|
2057
2049
|
var ve, ue, ne, ce, ie, he, se;
|
|
2058
|
-
return h(),
|
|
2059
|
-
!_.type || _.type === "text" ? (h(),
|
|
2050
|
+
return h(), p(J, { key: pe }, [
|
|
2051
|
+
!_.type || _.type === "text" ? (h(), p("span", {
|
|
2060
2052
|
key: 0,
|
|
2061
|
-
style: K(
|
|
2062
|
-
}, te(_.value), 5)) : _.type === "image" ? (h(),
|
|
2053
|
+
style: K(b(_))
|
|
2054
|
+
}, te(_.value), 5)) : _.type === "image" ? (h(), p("img", {
|
|
2063
2055
|
key: 1,
|
|
2064
2056
|
src: _.value,
|
|
2065
2057
|
class: "doc-image",
|
|
@@ -2067,65 +2059,65 @@ const Ei = { class: "editor-layout word-editor-scope" }, Si = { class: "editor-c
|
|
|
2067
2059
|
width: _.width ? _.width + "px" : "auto",
|
|
2068
2060
|
height: _.height ? _.height + "px" : "auto"
|
|
2069
2061
|
})
|
|
2070
|
-
}, null, 12, Vi)) : _.type === "hyperlink" ? (h(),
|
|
2062
|
+
}, null, 12, Vi)) : _.type === "hyperlink" ? (h(), p("a", {
|
|
2071
2063
|
key: 2,
|
|
2072
2064
|
href: _.url,
|
|
2073
2065
|
class: "doc-link",
|
|
2074
2066
|
target: "_blank"
|
|
2075
2067
|
}, [
|
|
2076
|
-
(h(!0),
|
|
2068
|
+
(h(!0), p(J, null, le(_.valueList || [], (T, Q) => (h(), p("span", {
|
|
2077
2069
|
key: Q,
|
|
2078
|
-
style: K(
|
|
2079
|
-
}, te(
|
|
2080
|
-
], 8, ji)) : _.type === "control" ? (h(),
|
|
2081
|
-
((ve = _.control) == null ? void 0 : ve.type) === "text" ? (h(),
|
|
2070
|
+
style: K(b(T))
|
|
2071
|
+
}, te(T.value), 5))), 128))
|
|
2072
|
+
], 8, ji)) : _.type === "control" ? (h(), p(J, { key: 3 }, [
|
|
2073
|
+
((ve = _.control) == null ? void 0 : ve.type) === "text" ? (h(), p("span", {
|
|
2082
2074
|
key: 0,
|
|
2083
2075
|
style: K({ fontSize: (_.control.size || 12) + "px" })
|
|
2084
2076
|
}, [
|
|
2085
|
-
(h(!0),
|
|
2077
|
+
(h(!0), p(J, null, le(_.control.value || [], (T, Q) => (h(), p("span", {
|
|
2086
2078
|
key: Q,
|
|
2087
|
-
style: K(
|
|
2088
|
-
}, te(
|
|
2089
|
-
], 4)) : ((ue = _.control) == null ? void 0 : ue.type) === "input" ? (h(),
|
|
2079
|
+
style: K(b(T))
|
|
2080
|
+
}, te(T.value), 5))), 128))
|
|
2081
|
+
], 4)) : ((ue = _.control) == null ? void 0 : ue.type) === "input" ? (h(), p("span", {
|
|
2090
2082
|
key: 1,
|
|
2091
2083
|
class: "ctrl-input",
|
|
2092
2084
|
style: K({ fontSize: (_.control.size || 12) + "px" })
|
|
2093
2085
|
}, [
|
|
2094
|
-
(h(!0),
|
|
2095
|
-
], 4)) : ((ne = _.control) == null ? void 0 : ne.type) === "radio" ? (h(),
|
|
2086
|
+
(h(!0), p(J, null, le(_.control.value || [], (T, Q) => (h(), p("span", { key: Q }, te(T.value), 1))), 128))
|
|
2087
|
+
], 4)) : ((ne = _.control) == null ? void 0 : ne.type) === "radio" ? (h(), p("span", {
|
|
2096
2088
|
key: 2,
|
|
2097
2089
|
class: Ie(["ctrl-options", { "ctrl-options--vertical": ((ie = (ce = _.control.extension) == null ? void 0 : ce.elementAttributes) == null ? void 0 : ie.layout) === "vertical" }])
|
|
2098
2090
|
}, [
|
|
2099
|
-
(h(!0),
|
|
2091
|
+
(h(!0), p(J, null, le(_.control.valueSets || [], (T, Q) => (h(), p("label", {
|
|
2100
2092
|
key: Q,
|
|
2101
2093
|
class: "ctrl-option"
|
|
2102
2094
|
}, [
|
|
2103
2095
|
re("input", {
|
|
2104
2096
|
type: "radio",
|
|
2105
2097
|
disabled: "",
|
|
2106
|
-
checked: _.control.code ===
|
|
2098
|
+
checked: _.control.code === T.code
|
|
2107
2099
|
}, null, 8, Ki),
|
|
2108
|
-
Re(te(
|
|
2100
|
+
Re(te(T.value), 1)
|
|
2109
2101
|
]))), 128))
|
|
2110
2102
|
], 2)) : ge("", !0)
|
|
2111
|
-
], 64)) : _.type === "checkbox" ? (h(),
|
|
2103
|
+
], 64)) : _.type === "checkbox" ? (h(), p("input", {
|
|
2112
2104
|
key: 4,
|
|
2113
2105
|
type: "checkbox",
|
|
2114
2106
|
checked: !!((he = _.checkbox) != null && he.value),
|
|
2115
2107
|
disabled: "",
|
|
2116
2108
|
class: "el-check"
|
|
2117
|
-
}, null, 8, qi)) : _.type === "radio" ? (h(),
|
|
2109
|
+
}, null, 8, qi)) : _.type === "radio" ? (h(), p("input", {
|
|
2118
2110
|
key: 5,
|
|
2119
2111
|
type: "radio",
|
|
2120
2112
|
checked: !!((se = _.radio) != null && se.value),
|
|
2121
2113
|
disabled: "",
|
|
2122
2114
|
class: "el-check"
|
|
2123
|
-
}, null, 8, Wi)) : _.type === "superscript" ? (h(),
|
|
2115
|
+
}, null, 8, Wi)) : _.type === "superscript" ? (h(), p("sup", {
|
|
2124
2116
|
key: 6,
|
|
2125
|
-
style: K(
|
|
2126
|
-
}, te(_.value), 5)) : _.type === "subscript" ? (h(),
|
|
2117
|
+
style: K(b(_))
|
|
2118
|
+
}, te(_.value), 5)) : _.type === "subscript" ? (h(), p("sub", {
|
|
2127
2119
|
key: 7,
|
|
2128
|
-
style: K(
|
|
2120
|
+
style: K(b(_))
|
|
2129
2121
|
}, te(_.value), 5)) : ge("", !0)
|
|
2130
2122
|
], 64);
|
|
2131
2123
|
}), 128))
|
|
@@ -2147,7 +2139,7 @@ const Ei = { class: "editor-layout word-editor-scope" }, Si = { class: "editor-c
|
|
|
2147
2139
|
])
|
|
2148
2140
|
]));
|
|
2149
2141
|
}
|
|
2150
|
-
}, Gi = /* @__PURE__ */ De(Ui, [["__scopeId", "data-v-
|
|
2142
|
+
}, Gi = /* @__PURE__ */ De(Ui, [["__scopeId", "data-v-47bd659d"]]), $t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
2151
2143
|
function Je(i = 10) {
|
|
2152
2144
|
const e = crypto.getRandomValues(new Uint8Array(i));
|
|
2153
2145
|
return Array.from(e).map((t) => $t[t % $t.length]).join("");
|
|
@@ -2225,8 +2217,8 @@ class Ye {
|
|
|
2225
2217
|
if (d && d.type === "text")
|
|
2226
2218
|
d.value = d.value.slice(0, e.offset) + t + d.value.slice(e.offset);
|
|
2227
2219
|
else {
|
|
2228
|
-
const
|
|
2229
|
-
o.children.splice(e.elementIndex, 0,
|
|
2220
|
+
const A = this.createTextElement(t, l);
|
|
2221
|
+
o.children.splice(e.elementIndex, 0, A);
|
|
2230
2222
|
}
|
|
2231
2223
|
this.bumpVersion();
|
|
2232
2224
|
}
|
|
@@ -2265,12 +2257,12 @@ class Ye {
|
|
|
2265
2257
|
updateRangeFormat(e, t, l) {
|
|
2266
2258
|
const o = this.getAllParagraphs();
|
|
2267
2259
|
let d = !1;
|
|
2268
|
-
for (const { paragraph:
|
|
2269
|
-
const
|
|
2270
|
-
if (
|
|
2271
|
-
for (let V = 0; V <
|
|
2272
|
-
const q =
|
|
2273
|
-
if (!(
|
|
2260
|
+
for (const { paragraph: A, sectionIndex: E, paragraphIndex: N } of o) {
|
|
2261
|
+
const P = E === e.sectionIndex && N === e.paragraphIndex, X = E === t.sectionIndex && N === t.paragraphIndex;
|
|
2262
|
+
if (P && (d = !0), d)
|
|
2263
|
+
for (let V = 0; V < A.children.length; V++) {
|
|
2264
|
+
const q = A.children[V];
|
|
2265
|
+
if (!(P && V < e.elementIndex)) {
|
|
2274
2266
|
if (X && V > t.elementIndex) break;
|
|
2275
2267
|
q.format = { ...q.format, ...l };
|
|
2276
2268
|
}
|
|
@@ -2339,13 +2331,13 @@ class st {
|
|
|
2339
2331
|
if (!l) return;
|
|
2340
2332
|
const o = l.children[t.elementIndex];
|
|
2341
2333
|
if ((o == null ? void 0 : o.type) === "text" && t.offset < o.value.length) {
|
|
2342
|
-
const
|
|
2343
|
-
this._applyMove(
|
|
2334
|
+
const A = { ...t, offset: t.offset + 1 };
|
|
2335
|
+
this._applyMove(A, e);
|
|
2344
2336
|
return;
|
|
2345
2337
|
}
|
|
2346
2338
|
if (t.elementIndex < l.children.length - 1) {
|
|
2347
|
-
const
|
|
2348
|
-
this._applyMove(
|
|
2339
|
+
const A = { ...t, elementIndex: t.elementIndex + 1, offset: 0 };
|
|
2340
|
+
this._applyMove(A, e);
|
|
2349
2341
|
return;
|
|
2350
2342
|
}
|
|
2351
2343
|
const d = this._getNextParagraphPoint(t);
|
|
@@ -2360,8 +2352,8 @@ class st {
|
|
|
2360
2352
|
return;
|
|
2361
2353
|
}
|
|
2362
2354
|
if (t.elementIndex > 0) {
|
|
2363
|
-
const o = this._docModel.getParagraphAt(t.sectionIndex, t.paragraphIndex), d = o == null ? void 0 : o.children[t.elementIndex - 1],
|
|
2364
|
-
this._applyMove(
|
|
2355
|
+
const o = this._docModel.getParagraphAt(t.sectionIndex, t.paragraphIndex), d = o == null ? void 0 : o.children[t.elementIndex - 1], A = (d == null ? void 0 : d.type) === "text" ? d.value.length : 0, E = { ...t, elementIndex: t.elementIndex - 1, offset: A };
|
|
2356
|
+
this._applyMove(E, e);
|
|
2365
2357
|
return;
|
|
2366
2358
|
}
|
|
2367
2359
|
const l = this._getPrevParagraphPoint(t);
|
|
@@ -2384,8 +2376,8 @@ class st {
|
|
|
2384
2376
|
if (e.sectionIndex > 0) {
|
|
2385
2377
|
const t = this._docModel.data.sections[e.sectionIndex - 1];
|
|
2386
2378
|
if (!t) return null;
|
|
2387
|
-
const l = t.paragraphs.length - 1, o = t.paragraphs[l], d = ((o == null ? void 0 : o.children.length) ?? 0) - 1,
|
|
2388
|
-
return Te(e.sectionIndex - 1, l, Math.max(d, 0),
|
|
2379
|
+
const l = t.paragraphs.length - 1, o = t.paragraphs[l], d = ((o == null ? void 0 : o.children.length) ?? 0) - 1, A = o == null ? void 0 : o.children[d], E = (A == null ? void 0 : A.type) === "text" ? A.value.length : 0;
|
|
2380
|
+
return Te(e.sectionIndex - 1, l, Math.max(d, 0), E);
|
|
2389
2381
|
}
|
|
2390
2382
|
return null;
|
|
2391
2383
|
}
|
|
@@ -2397,12 +2389,12 @@ class st {
|
|
|
2397
2389
|
static domToModelPoint(e, t) {
|
|
2398
2390
|
let l = e instanceof Element ? e : e.parentElement;
|
|
2399
2391
|
for (; l; ) {
|
|
2400
|
-
const o = l.getAttribute("data-si"), d = l.getAttribute("data-pi"),
|
|
2401
|
-
if (o !== null && d !== null &&
|
|
2392
|
+
const o = l.getAttribute("data-si"), d = l.getAttribute("data-pi"), A = l.getAttribute("data-ei");
|
|
2393
|
+
if (o !== null && d !== null && A !== null)
|
|
2402
2394
|
return {
|
|
2403
2395
|
sectionIndex: parseInt(o),
|
|
2404
2396
|
paragraphIndex: parseInt(d),
|
|
2405
|
-
elementIndex: parseInt(
|
|
2397
|
+
elementIndex: parseInt(A),
|
|
2406
2398
|
offset: t
|
|
2407
2399
|
};
|
|
2408
2400
|
l = l.parentElement;
|
|
@@ -2482,11 +2474,11 @@ class Zi {
|
|
|
2482
2474
|
this.docModel = e, this.selectionManager = t;
|
|
2483
2475
|
}
|
|
2484
2476
|
execute() {
|
|
2485
|
-
var N,
|
|
2477
|
+
var N, P;
|
|
2486
2478
|
const { focus: e } = this.selectionManager.selection, { sectionIndex: t, paragraphIndex: l } = e, o = this.docModel.getParagraphAt(t, l);
|
|
2487
2479
|
if (!o) return;
|
|
2488
|
-
const d = e.elementIndex,
|
|
2489
|
-
|
|
2480
|
+
const d = e.elementIndex, A = o.children.splice(d), E = this.docModel.createEmptyParagraph(o.format);
|
|
2481
|
+
E.children.push(...A), this._insertedParagraphId = E.id, this.docModel.data.sections[t].paragraphs.splice(l + 1, 0, E), (P = (N = this.docModel).bumpVersion) == null || P.call(N), this.selectionManager.setCursor({
|
|
2490
2482
|
sectionIndex: t,
|
|
2491
2483
|
paragraphIndex: l + 1,
|
|
2492
2484
|
elementIndex: 0,
|