@bireturn/word-editor 1.0.9 → 1.0.11
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.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var N = (t, e, n) =>
|
|
4
|
-
import { computed as de, ref as te, onMounted as _t, onUnmounted as rt, openBlock as u, createElementBlock as g, normalizeStyle as V, createElementVNode as ne, Fragment as G, renderList as Q, normalizeClass as Pe, createBlock as Fe, resolveDynamicComponent as at, toDisplayString as Y, unref as K, createCommentVNode as ve, render as
|
|
5
|
-
import { DynamicScroller as
|
|
6
|
-
import { ChevronRight as
|
|
7
|
-
const
|
|
1
|
+
var mn = Object.defineProperty;
|
|
2
|
+
var yn = (t, e, n) => e in t ? mn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var N = (t, e, n) => yn(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { computed as de, ref as te, onMounted as _t, onUnmounted as rt, openBlock as u, createElementBlock as g, normalizeStyle as V, createElementVNode as ne, Fragment as G, renderList as Q, normalizeClass as Pe, createBlock as Fe, resolveDynamicComponent as at, toDisplayString as Y, unref as K, createCommentVNode as ve, render as Ut, h as bn, defineComponent as _n, getCurrentInstance as xn, watch as Ke, nextTick as Se, createVNode as q, createTextVNode as Le, isVNode as kn, renderSlot as wn, resolveComponent as Cn, inject as mt, withCtx as qe, provide as yt, createSlots as Mn, reactive as qt } from "vue";
|
|
5
|
+
import { DynamicScroller as In, DynamicScrollerItem as En } from "vue-virtual-scroller";
|
|
6
|
+
import { ChevronRight as Wt, MoreHorizontal as It, Download as ht, Upload as Sn, Save as Fn, RotateCcw as Tn, History as An, Settings as Pn, Info as $n, Globe as Ln, Lock as Rn, Share as Hn, ShieldCheck as On, Search as Bn, Filter as Dn, SortDesc as zn, SortAsc as Nn, Minus as Vn, Plus as Et, Eye as St, FileText as ft, Grid as jn, Type as Ft, FileDown as Tt, Layers as At, Edit as Kn, Move as Un, Copy as qn, Trash2 as Pt, Clipboard as $t, PlusCircle as Lt, ArrowDown as Rt, Navigation as Ht, ChevronDown as Wn, PanelLeftOpen as Gn, ListTree as Jn, PanelLeftClose as Xn } from "lucide-vue-next";
|
|
7
|
+
const Yn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" }, Zn = ["onMouseenter", "onMouseleave"], Qn = ["onClick"], ei = { class: "we-vt-context-menu--link-content menu-label" }, ti = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "we-vt-context-menu--submenu modern-submenu"
|
|
10
|
-
},
|
|
10
|
+
}, ni = ["onClick"], ii = { class: "we-vt-context-menu--link-content submenu-label" }, li = {
|
|
11
11
|
__name: "ContextMenu",
|
|
12
12
|
props: {
|
|
13
13
|
// 事件
|
|
@@ -75,11 +75,11 @@ const Zn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
|
|
|
75
75
|
// 粘贴
|
|
76
76
|
delete: Pt,
|
|
77
77
|
// 删除
|
|
78
|
-
copy:
|
|
78
|
+
copy: qn,
|
|
79
79
|
// 复制
|
|
80
|
-
cut:
|
|
80
|
+
cut: Un,
|
|
81
81
|
// 剪切
|
|
82
|
-
edit:
|
|
82
|
+
edit: Kn,
|
|
83
83
|
// 编辑
|
|
84
84
|
// 导出操作 - 根据范围使用不同图标
|
|
85
85
|
export_part_section: At,
|
|
@@ -93,7 +93,7 @@ const Zn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
|
|
|
93
93
|
// PDF格式
|
|
94
94
|
word: Ft,
|
|
95
95
|
// WORD格式
|
|
96
|
-
excel:
|
|
96
|
+
excel: jn,
|
|
97
97
|
// Excel格式
|
|
98
98
|
txt: ft,
|
|
99
99
|
// 文本格式
|
|
@@ -104,38 +104,38 @@ const Zn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
|
|
|
104
104
|
// 预览
|
|
105
105
|
expand: Et,
|
|
106
106
|
// 展开
|
|
107
|
-
collapse:
|
|
107
|
+
collapse: Vn,
|
|
108
108
|
// 折叠
|
|
109
109
|
// 排序和过滤
|
|
110
|
-
"sort-asc":
|
|
110
|
+
"sort-asc": Nn,
|
|
111
111
|
// 升序
|
|
112
|
-
"sort-desc":
|
|
112
|
+
"sort-desc": zn,
|
|
113
113
|
// 降序
|
|
114
|
-
filter:
|
|
114
|
+
filter: Dn,
|
|
115
115
|
// 过滤
|
|
116
|
-
search:
|
|
116
|
+
search: Bn,
|
|
117
117
|
// 搜索
|
|
118
118
|
// 权限操作
|
|
119
|
-
permission:
|
|
119
|
+
permission: On,
|
|
120
120
|
// 权限设置
|
|
121
|
-
share:
|
|
121
|
+
share: Hn,
|
|
122
122
|
// 分享
|
|
123
|
-
lock:
|
|
123
|
+
lock: Rn,
|
|
124
124
|
// 锁定
|
|
125
|
-
unlock:
|
|
125
|
+
unlock: Ln,
|
|
126
126
|
// 解锁
|
|
127
127
|
// 其他操作
|
|
128
|
-
info:
|
|
128
|
+
info: $n,
|
|
129
129
|
// 信息
|
|
130
|
-
settings:
|
|
130
|
+
settings: Pn,
|
|
131
131
|
// 设置
|
|
132
|
-
history:
|
|
132
|
+
history: An,
|
|
133
133
|
// 历史
|
|
134
|
-
refresh:
|
|
134
|
+
refresh: Tn,
|
|
135
135
|
// 刷新
|
|
136
|
-
save:
|
|
136
|
+
save: Fn,
|
|
137
137
|
// 保存
|
|
138
|
-
upload:
|
|
138
|
+
upload: Sn,
|
|
139
139
|
// 上传
|
|
140
140
|
download: ht,
|
|
141
141
|
// 下载
|
|
@@ -158,7 +158,7 @@ const Zn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
|
|
|
158
158
|
ref: y,
|
|
159
159
|
style: V([{ display: "inline-block" }, o.value])
|
|
160
160
|
}, [
|
|
161
|
-
ne("ul",
|
|
161
|
+
ne("ul", Yn, [
|
|
162
162
|
(u(!0), g(G, null, Q(s.value, (h) => (u(), g("li", {
|
|
163
163
|
class: Pe({
|
|
164
164
|
"link--disabled": h.disabled,
|
|
@@ -177,14 +177,14 @@ const Zn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
|
|
|
177
177
|
size: 16,
|
|
178
178
|
class: "menu-icon"
|
|
179
179
|
})),
|
|
180
|
-
ne("span",
|
|
181
|
-
h.children && h.children.length > 0 ? (u(), Fe(K(
|
|
180
|
+
ne("span", ei, Y(h.name), 1),
|
|
181
|
+
h.children && h.children.length > 0 ? (u(), Fe(K(Wt), {
|
|
182
182
|
key: 0,
|
|
183
183
|
size: 14,
|
|
184
184
|
class: "submenu-arrow"
|
|
185
185
|
})) : ve("", !0)
|
|
186
|
-
], 8,
|
|
187
|
-
h.children && h.children.length > 0 && v.value === h.code ? (u(), g("ul",
|
|
186
|
+
], 8, Qn),
|
|
187
|
+
h.children && h.children.length > 0 && v.value === h.code ? (u(), g("ul", ti, [
|
|
188
188
|
(u(!0), g(G, null, Q(h.children, (F) => (u(), g("li", {
|
|
189
189
|
key: F.code,
|
|
190
190
|
class: Pe({
|
|
@@ -202,34 +202,34 @@ const Zn = { class: "we-vt-context-menu--option-wrapper modern-menu-wrapper" },
|
|
|
202
202
|
size: 14,
|
|
203
203
|
class: "submenu-icon"
|
|
204
204
|
})),
|
|
205
|
-
ne("span",
|
|
206
|
-
], 8,
|
|
205
|
+
ne("span", ii, Y(F.name), 1)
|
|
206
|
+
], 8, ni)
|
|
207
207
|
], 34))), 128))
|
|
208
208
|
])) : ve("", !0)
|
|
209
|
-
], 42,
|
|
209
|
+
], 42, Zn))), 128))
|
|
210
210
|
])
|
|
211
211
|
], 4));
|
|
212
212
|
}
|
|
213
|
-
},
|
|
214
|
-
function
|
|
215
|
-
const l =
|
|
216
|
-
return document.body.appendChild(o), l[
|
|
213
|
+
}, Gt = Symbol("component_container");
|
|
214
|
+
function oi(t, e, n) {
|
|
215
|
+
const l = bn(t, { ...e }, n), o = document.createElement("div");
|
|
216
|
+
return document.body.appendChild(o), l[Gt] = o, Ut(l, o), l.component;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function ai(t) {
|
|
219
219
|
var n;
|
|
220
|
-
const e = t.vnode[
|
|
221
|
-
|
|
220
|
+
const e = t.vnode[Gt];
|
|
221
|
+
Ut(null, e), e != null && e.checkVisibility && (e != null && e.checkVisibility()) && ((n = document.body) == null || n.removeChild(e));
|
|
222
222
|
}
|
|
223
|
-
let
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
},
|
|
223
|
+
let Jt;
|
|
224
|
+
const si = (t) => {
|
|
225
|
+
Jt = oi(li, t, null);
|
|
226
|
+
}, ri = function(t) {
|
|
227
227
|
const e = t.onClose;
|
|
228
228
|
return t.onClose = () => {
|
|
229
|
-
e && e.call(),
|
|
230
|
-
},
|
|
229
|
+
e && e.call(), ai(Jt);
|
|
230
|
+
}, si(t), t;
|
|
231
231
|
};
|
|
232
|
-
function
|
|
232
|
+
function ci(t, e, n) {
|
|
233
233
|
const l = (n == null ? void 0 : n.keyField) || (n == null ? void 0 : n.rowField) || "node_id", o = (n == null ? void 0 : n.parentField) || "parent_id", s = (n == null ? void 0 : n.parentField) || "order";
|
|
234
234
|
if (!(t != null && t.length))
|
|
235
235
|
return t;
|
|
@@ -277,10 +277,10 @@ function Ot(t, e, n) {
|
|
|
277
277
|
}
|
|
278
278
|
return l;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
280
|
+
function di(t) {
|
|
281
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !kn(t);
|
|
282
282
|
}
|
|
283
|
-
const
|
|
283
|
+
const ui = /* @__PURE__ */ _n({
|
|
284
284
|
name: "VirtualTable",
|
|
285
285
|
props: {
|
|
286
286
|
data: {
|
|
@@ -361,7 +361,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
361
361
|
expose: l
|
|
362
362
|
}) {
|
|
363
363
|
var Mt;
|
|
364
|
-
const o =
|
|
364
|
+
const o = xn(), s = te(), v = te(!1), m = te(null), y = te(null), r = te([]);
|
|
365
365
|
let M = /* @__PURE__ */ new Map();
|
|
366
366
|
const x = /* @__PURE__ */ new Map();
|
|
367
367
|
te(0);
|
|
@@ -430,7 +430,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
430
430
|
a = a.parentNode;
|
|
431
431
|
if ((k = a == null ? void 0 : a.getAttribute) != null && k.call(a, "data-id")) {
|
|
432
432
|
const w = a.getAttribute("data-id"), b = Ae(w);
|
|
433
|
-
b && (z =
|
|
433
|
+
b && (z = ri({
|
|
434
434
|
e: i,
|
|
435
435
|
row: b,
|
|
436
436
|
menuConfig: t.menuConfig,
|
|
@@ -524,7 +524,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
524
524
|
if (!(a !== F.value) && r.value.length > 0)
|
|
525
525
|
return;
|
|
526
526
|
F.value = a;
|
|
527
|
-
const p = (t.treeConfig ?
|
|
527
|
+
const p = (t.treeConfig ? ci(i, void 0, t.treeConfig) : i).map((f, k) => {
|
|
528
528
|
const w = f[t.rowConfig.keyField], b = x.get(w);
|
|
529
529
|
if (!b || b.content !== f.content || b.content_type !== f.content_type) {
|
|
530
530
|
P.add(w);
|
|
@@ -896,11 +896,11 @@ const hi = /* @__PURE__ */ xn({
|
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
898
|
}, 10);
|
|
899
|
-
}, Re = (i) => (i == null ? void 0 : i._editing) === !0, dt = (i) => i != null && i.parent_id ? M.get(i.parent_id) : null,
|
|
899
|
+
}, Re = (i) => (i == null ? void 0 : i._editing) === !0, dt = (i) => i != null && i.parent_id ? M.get(i.parent_id) : null, Qt = (i) => {
|
|
900
900
|
var c;
|
|
901
901
|
const a = r.value.findIndex((p) => p[t.rowConfig.keyField] == i[t.rowConfig.keyField]);
|
|
902
902
|
return a < 1 ? null : ((c = r.value[a - 1]) == null ? void 0 : c.layer) === i.layer ? r.value[a - 1] : null;
|
|
903
|
-
},
|
|
903
|
+
}, en = (i) => {
|
|
904
904
|
const a = r.value.findIndex((c) => c[t.rowConfig.keyField] == i[t.rowConfig.keyField]);
|
|
905
905
|
return a >= r.value.length - 1 ? null : r.value[a + 1];
|
|
906
906
|
}, Ae = (i) => {
|
|
@@ -909,7 +909,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
909
909
|
return a || (typeof i == "number" ? x.get(`${i}`) : typeof i == "string" && /^\d+$/.test(i) ? x.get(Number(i)) : null);
|
|
910
910
|
};
|
|
911
911
|
let Ze = null;
|
|
912
|
-
const
|
|
912
|
+
const tn = (i) => {
|
|
913
913
|
Ze && cancelAnimationFrame(Ze), Ze = requestAnimationFrame(() => {
|
|
914
914
|
var p;
|
|
915
915
|
const a = t.rowConfig.keyField, c = i[a];
|
|
@@ -998,7 +998,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
998
998
|
}), c(!0);
|
|
999
999
|
}));
|
|
1000
1000
|
}
|
|
1001
|
-
}),
|
|
1001
|
+
}), nn = (i) => Ve(i), ut = () => {
|
|
1002
1002
|
if (he(), t.pageConfig.enabled) {
|
|
1003
1003
|
const i = Array.from(B.value);
|
|
1004
1004
|
if (i.length > 0) {
|
|
@@ -1015,7 +1015,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1015
1015
|
Se(() => {
|
|
1016
1016
|
!t.pageConfig.enabled && s.value && s.value.$forceUpdate && s.value.$forceUpdate();
|
|
1017
1017
|
});
|
|
1018
|
-
},
|
|
1018
|
+
}, ln = (i, a) => new Promise((c) => {
|
|
1019
1019
|
let p = -1;
|
|
1020
1020
|
if (a == -1) {
|
|
1021
1021
|
const d = Ae(i.parent_id);
|
|
@@ -1026,7 +1026,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1026
1026
|
M.set(i.node_id, i), x.set(i[t.rowConfig.keyField], i), r.value.splice(p, 0, i), ut(), c({
|
|
1027
1027
|
row: i
|
|
1028
1028
|
});
|
|
1029
|
-
}),
|
|
1029
|
+
}), on = (i, a) => new Promise((c) => {
|
|
1030
1030
|
const p = r.value.findIndex((d) => d[t.rowConfig.keyField] == a[t.rowConfig.keyField]) + 1;
|
|
1031
1031
|
M.set(i.node_id, i), x.set(i[t.rowConfig.keyField], i), r.value.splice(p, 0, i), ut(), c({
|
|
1032
1032
|
row: i
|
|
@@ -1037,24 +1037,24 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1037
1037
|
const c = i[t.rowConfig.keyField];
|
|
1038
1038
|
M.delete(i.node_id), x.delete(c), r.value.splice(a, 1), ut();
|
|
1039
1039
|
}
|
|
1040
|
-
},
|
|
1040
|
+
}, an = (i, a) => {
|
|
1041
1041
|
if (!i || !i[t.rowConfig.keyField]) return !1;
|
|
1042
1042
|
const c = i._original;
|
|
1043
1043
|
return c ? a ? i[a] !== c[a] : Object.keys(c).some((p) => c[p] !== i[p]) : !1;
|
|
1044
|
-
},
|
|
1044
|
+
}, sn = (i) => i && i[t.rowConfig.keyField] && !i._original, rn = (i, a) => {
|
|
1045
1045
|
i && i[t.rowConfig.keyField] && (a && Object.assign(i, a), i._original = {
|
|
1046
1046
|
...i,
|
|
1047
1047
|
_editing: void 0,
|
|
1048
1048
|
_X_ROW_CHILD: void 0,
|
|
1049
1049
|
_original: void 0
|
|
1050
1050
|
});
|
|
1051
|
-
},
|
|
1051
|
+
}, cn = (i) => {
|
|
1052
1052
|
if (i && i[t.rowConfig.keyField]) {
|
|
1053
1053
|
const a = Ae(i[t.rowConfig.keyField]);
|
|
1054
1054
|
a._original ? Object.assign(a, a._original) : xt(a);
|
|
1055
1055
|
}
|
|
1056
|
+
}, dn = () => {
|
|
1056
1057
|
}, un = () => {
|
|
1057
|
-
}, hn = () => {
|
|
1058
1058
|
y.value = {};
|
|
1059
1059
|
}, kt = (i) => {
|
|
1060
1060
|
var c, p, d;
|
|
@@ -1076,22 +1076,22 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1076
1076
|
l({
|
|
1077
1077
|
isEditByRow: Re,
|
|
1078
1078
|
getParentRow: dt,
|
|
1079
|
-
getSiblingRow:
|
|
1080
|
-
getNextRow:
|
|
1079
|
+
getSiblingRow: Qt,
|
|
1080
|
+
getNextRow: en,
|
|
1081
1081
|
getRowById: Ae,
|
|
1082
|
-
scrollToRow:
|
|
1082
|
+
scrollToRow: tn,
|
|
1083
1083
|
setCurrentRow: Qe,
|
|
1084
1084
|
setEditRow: Ve,
|
|
1085
|
-
setEditCell:
|
|
1086
|
-
insertAt:
|
|
1087
|
-
insertNextAt:
|
|
1088
|
-
isUpdateByRow:
|
|
1089
|
-
isInsertByRow:
|
|
1090
|
-
reloadRow:
|
|
1091
|
-
revertData:
|
|
1085
|
+
setEditCell: nn,
|
|
1086
|
+
insertAt: ln,
|
|
1087
|
+
insertNextAt: on,
|
|
1088
|
+
isUpdateByRow: an,
|
|
1089
|
+
isInsertByRow: sn,
|
|
1090
|
+
reloadRow: rn,
|
|
1091
|
+
revertData: cn,
|
|
1092
1092
|
remove: xt,
|
|
1093
|
-
setAllTreeExpand:
|
|
1094
|
-
clearCurrentRow:
|
|
1093
|
+
setAllTreeExpand: dn,
|
|
1094
|
+
clearCurrentRow: un,
|
|
1095
1095
|
getAllChilds: kt
|
|
1096
1096
|
});
|
|
1097
1097
|
const Oe = de(() => n.default().filter((i) => {
|
|
@@ -1129,13 +1129,13 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1129
1129
|
visibleEndIndex: 0
|
|
1130
1130
|
});
|
|
1131
1131
|
let tt = null, nt = null;
|
|
1132
|
-
const
|
|
1132
|
+
const hn = (i, a) => {
|
|
1133
1133
|
tt && cancelAnimationFrame(tt), tt = requestAnimationFrame(() => {
|
|
1134
1134
|
e("scroll-end", {
|
|
1135
1135
|
...Ct.value
|
|
1136
1136
|
}), tt = null;
|
|
1137
1137
|
});
|
|
1138
|
-
},
|
|
1138
|
+
}, fn = (i, a, c, p) => {
|
|
1139
1139
|
nt && cancelAnimationFrame(nt), nt = requestAnimationFrame(() => {
|
|
1140
1140
|
Ct.value = {
|
|
1141
1141
|
viewStartIndex: i,
|
|
@@ -1144,7 +1144,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1144
1144
|
visibleEndIndex: p
|
|
1145
1145
|
}, nt = null;
|
|
1146
1146
|
});
|
|
1147
|
-
},
|
|
1147
|
+
}, gn = (i, a) => {
|
|
1148
1148
|
var S, L, Z;
|
|
1149
1149
|
const {
|
|
1150
1150
|
pageHeight: c,
|
|
@@ -1239,7 +1239,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1239
1239
|
}, null), q("div", {
|
|
1240
1240
|
class: "loading-text"
|
|
1241
1241
|
}, [Le("加载中...")])]);
|
|
1242
|
-
},
|
|
1242
|
+
}, pn = () => {
|
|
1243
1243
|
var k;
|
|
1244
1244
|
const {
|
|
1245
1245
|
pageHeight: i,
|
|
@@ -1272,9 +1272,9 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1272
1272
|
boxSizing: "border-box",
|
|
1273
1273
|
position: "relative"
|
|
1274
1274
|
}
|
|
1275
|
-
}, [
|
|
1275
|
+
}, [gn(w, b)]);
|
|
1276
1276
|
})])]);
|
|
1277
|
-
},
|
|
1277
|
+
}, vn = () => {
|
|
1278
1278
|
var i;
|
|
1279
1279
|
return q("div", {
|
|
1280
1280
|
class: "virtual-table we-vt-table we-vt-table--render-default border--none"
|
|
@@ -1293,7 +1293,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1293
1293
|
}) : a.title]), q("div", {
|
|
1294
1294
|
class: "we-vt-resizable is--line"
|
|
1295
1295
|
}, null)]);
|
|
1296
|
-
})]) : void 0, q(
|
|
1296
|
+
})]) : void 0, q(In, {
|
|
1297
1297
|
ref: s,
|
|
1298
1298
|
items: E.value,
|
|
1299
1299
|
minItemSize: ue.value,
|
|
@@ -1303,8 +1303,8 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1303
1303
|
class: "virtual-table-wrapper",
|
|
1304
1304
|
contenteditable: ((i = t.editConfig) == null ? void 0 : i.trigger) === "contenteditable" ? "true" : void 0,
|
|
1305
1305
|
onContextmenu: Ce,
|
|
1306
|
-
onScrollend:
|
|
1307
|
-
onUpdate:
|
|
1306
|
+
onScrollend: hn,
|
|
1307
|
+
onUpdate: fn,
|
|
1308
1308
|
onFocusin: be,
|
|
1309
1309
|
onFocusout: oe
|
|
1310
1310
|
}, {
|
|
@@ -1315,7 +1315,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1315
1315
|
}) => {
|
|
1316
1316
|
var f, k, w;
|
|
1317
1317
|
let d;
|
|
1318
|
-
return q(
|
|
1318
|
+
return q(En, {
|
|
1319
1319
|
key: a[t.rowConfig.keyField],
|
|
1320
1320
|
item: a,
|
|
1321
1321
|
active: p,
|
|
@@ -1329,7 +1329,7 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1329
1329
|
"row--current": a[t.rowConfig.keyField] === ((k = y.value) == null ? void 0 : k[t.rowConfig.keyField]) || // 如果是树,并且配置了childCurrent高亮子节点
|
|
1330
1330
|
((w = t.treeConfig) == null ? void 0 : w.childCurrent) && wt.value.includes(a[t.rowConfig.keyField])
|
|
1331
1331
|
}
|
|
1332
|
-
},
|
|
1332
|
+
}, di(d = Oe.value.map((b) => {
|
|
1333
1333
|
var _, C, A, R, S, L, Z;
|
|
1334
1334
|
return q("div", {
|
|
1335
1335
|
key: b.prop,
|
|
@@ -1349,14 +1349,14 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1349
1349
|
}
|
|
1350
1350
|
})]);
|
|
1351
1351
|
};
|
|
1352
|
-
return () => t.pageConfig.enabled ?
|
|
1352
|
+
return () => t.pageConfig.enabled ? pn() : vn();
|
|
1353
1353
|
}
|
|
1354
1354
|
}), Ne = (t, e) => {
|
|
1355
1355
|
const n = t.__vccOpts || t;
|
|
1356
1356
|
for (const [l, o] of e)
|
|
1357
1357
|
n[l] = o;
|
|
1358
1358
|
return n;
|
|
1359
|
-
},
|
|
1359
|
+
}, hi = /* @__PURE__ */ Ne(ui, [["__scopeId", "data-v-6bbd7545"]]), fi = {
|
|
1360
1360
|
name: "VirtualTableColumn",
|
|
1361
1361
|
props: {
|
|
1362
1362
|
prop: String,
|
|
@@ -1364,13 +1364,13 @@ const hi = /* @__PURE__ */ xn({
|
|
|
1364
1364
|
width: [String, Number]
|
|
1365
1365
|
}
|
|
1366
1366
|
};
|
|
1367
|
-
function
|
|
1368
|
-
return
|
|
1367
|
+
function gi(t, e, n, l, o, s) {
|
|
1368
|
+
return wn(t.$slots, "default");
|
|
1369
1369
|
}
|
|
1370
|
-
const
|
|
1370
|
+
const pi = /* @__PURE__ */ Ne(fi, [["render", gi]]), vi = { class: "catalog-node" }, mi = ["title"], yi = { class: "catalog-node__text" }, bi = {
|
|
1371
1371
|
key: 0,
|
|
1372
1372
|
class: "catalog-node__children"
|
|
1373
|
-
},
|
|
1373
|
+
}, _i = {
|
|
1374
1374
|
__name: "CatalogNode",
|
|
1375
1375
|
props: {
|
|
1376
1376
|
item: { type: Object, required: !0 },
|
|
@@ -1384,8 +1384,8 @@ const vi = /* @__PURE__ */ Ne(gi, [["render", pi]]), mi = { class: "catalog-node
|
|
|
1384
1384
|
m.stopPropagation(), o.value = !o.value;
|
|
1385
1385
|
}
|
|
1386
1386
|
return (m, y) => {
|
|
1387
|
-
const r =
|
|
1388
|
-
return u(), g("div",
|
|
1387
|
+
const r = Cn("CatalogNode", !0);
|
|
1388
|
+
return u(), g("div", vi, [
|
|
1389
1389
|
ne("div", {
|
|
1390
1390
|
class: Pe(["catalog-node__label", { "is-active": t.activeId === t.item.nodeId }]),
|
|
1391
1391
|
style: V({ paddingLeft: 10 + t.depth * 14 + "px" }),
|
|
@@ -1396,14 +1396,14 @@ const vi = /* @__PURE__ */ Ne(gi, [["render", pi]]), mi = { class: "catalog-node
|
|
|
1396
1396
|
class: "catalog-node__toggle",
|
|
1397
1397
|
onClick: v
|
|
1398
1398
|
}, [
|
|
1399
|
-
s.value ? (u(), Fe(at(o.value ? K(
|
|
1399
|
+
s.value ? (u(), Fe(at(o.value ? K(Wn) : K(Wt)), {
|
|
1400
1400
|
key: 0,
|
|
1401
1401
|
size: 14
|
|
1402
1402
|
})) : ve("", !0)
|
|
1403
1403
|
]),
|
|
1404
|
-
ne("span",
|
|
1405
|
-
], 14,
|
|
1406
|
-
s.value && o.value ? (u(), g("div",
|
|
1404
|
+
ne("span", yi, Y(t.item.name || "(无标题)"), 1)
|
|
1405
|
+
], 14, mi),
|
|
1406
|
+
s.value && o.value ? (u(), g("div", bi, [
|
|
1407
1407
|
(u(!0), g(G, null, Q(t.item.children, (M) => (u(), Fe(r, {
|
|
1408
1408
|
key: M.nodeId,
|
|
1409
1409
|
item: M,
|
|
@@ -1415,16 +1415,16 @@ const vi = /* @__PURE__ */ Ne(gi, [["render", pi]]), mi = { class: "catalog-node
|
|
|
1415
1415
|
]);
|
|
1416
1416
|
};
|
|
1417
1417
|
}
|
|
1418
|
-
},
|
|
1418
|
+
}, xi = /* @__PURE__ */ Ne(_i, [["__scopeId", "data-v-ac882917"]]), ki = {
|
|
1419
1419
|
key: 0,
|
|
1420
1420
|
class: "catalog catalog--collapsed"
|
|
1421
|
-
},
|
|
1421
|
+
}, wi = {
|
|
1422
1422
|
key: 1,
|
|
1423
1423
|
class: "catalog"
|
|
1424
|
-
},
|
|
1424
|
+
}, Ci = { class: "catalog__header" }, Mi = { class: "catalog__title" }, Ii = { class: "catalog__body" }, Ei = {
|
|
1425
1425
|
key: 0,
|
|
1426
1426
|
class: "catalog__empty"
|
|
1427
|
-
},
|
|
1427
|
+
}, Si = {
|
|
1428
1428
|
__name: "index",
|
|
1429
1429
|
props: {
|
|
1430
1430
|
items: { type: Array, default: () => [] }
|
|
@@ -1435,18 +1435,18 @@ const vi = /* @__PURE__ */ Ne(gi, [["render", pi]]), mi = { class: "catalog-node
|
|
|
1435
1435
|
function s(v) {
|
|
1436
1436
|
o.value = v.nodeId, n("navigate", v);
|
|
1437
1437
|
}
|
|
1438
|
-
return (v, m) => l.value ? (u(), g("div",
|
|
1438
|
+
return (v, m) => l.value ? (u(), g("div", ki, [
|
|
1439
1439
|
ne("button", {
|
|
1440
1440
|
class: "catalog__icon-btn",
|
|
1441
1441
|
title: "展开目录",
|
|
1442
1442
|
onClick: m[0] || (m[0] = (y) => l.value = !1)
|
|
1443
1443
|
}, [
|
|
1444
|
-
q(K(
|
|
1444
|
+
q(K(Gn), { size: 18 })
|
|
1445
1445
|
])
|
|
1446
|
-
])) : (u(), g("div",
|
|
1447
|
-
ne("div",
|
|
1448
|
-
ne("span",
|
|
1449
|
-
q(K(
|
|
1446
|
+
])) : (u(), g("div", wi, [
|
|
1447
|
+
ne("div", Ci, [
|
|
1448
|
+
ne("span", Mi, [
|
|
1449
|
+
q(K(Jn), { size: 16 }),
|
|
1450
1450
|
m[2] || (m[2] = Le(" 目录 ", -1))
|
|
1451
1451
|
]),
|
|
1452
1452
|
ne("button", {
|
|
@@ -1454,21 +1454,21 @@ const vi = /* @__PURE__ */ Ne(gi, [["render", pi]]), mi = { class: "catalog-node
|
|
|
1454
1454
|
title: "收起目录",
|
|
1455
1455
|
onClick: m[1] || (m[1] = (y) => l.value = !0)
|
|
1456
1456
|
}, [
|
|
1457
|
-
q(K(
|
|
1457
|
+
q(K(Xn), { size: 18 })
|
|
1458
1458
|
])
|
|
1459
1459
|
]),
|
|
1460
|
-
ne("div",
|
|
1461
|
-
(u(!0), g(G, null, Q(t.items, (y) => (u(), Fe(
|
|
1460
|
+
ne("div", Ii, [
|
|
1461
|
+
(u(!0), g(G, null, Q(t.items, (y) => (u(), Fe(xi, {
|
|
1462
1462
|
key: y.nodeId,
|
|
1463
1463
|
item: y,
|
|
1464
1464
|
"active-id": o.value,
|
|
1465
1465
|
onNavigate: s
|
|
1466
1466
|
}, null, 8, ["item", "active-id"]))), 128)),
|
|
1467
|
-
t.items.length ? ve("", !0) : (u(), g("div",
|
|
1467
|
+
t.items.length ? ve("", !0) : (u(), g("div", Ei, " 暂无目录 "))
|
|
1468
1468
|
])
|
|
1469
1469
|
]));
|
|
1470
1470
|
}
|
|
1471
|
-
},
|
|
1471
|
+
}, Fi = /* @__PURE__ */ Ne(Si, [["__scopeId", "data-v-8becafa1"]]), Ti = {
|
|
1472
1472
|
first: 1,
|
|
1473
1473
|
second: 2,
|
|
1474
1474
|
third: 3,
|
|
@@ -1476,13 +1476,13 @@ const vi = /* @__PURE__ */ Ne(gi, [["render", pi]]), mi = { class: "catalog-node
|
|
|
1476
1476
|
fifth: 5,
|
|
1477
1477
|
sixth: 6
|
|
1478
1478
|
};
|
|
1479
|
-
function
|
|
1480
|
-
return t.blockType !== "title" || !t.level ? 0 :
|
|
1479
|
+
function Ai(t) {
|
|
1480
|
+
return t.blockType !== "title" || !t.level ? 0 : Ti[t.level] || 1;
|
|
1481
1481
|
}
|
|
1482
|
-
function
|
|
1482
|
+
function Pi(t) {
|
|
1483
1483
|
const e = [];
|
|
1484
1484
|
for (const o of t || []) {
|
|
1485
|
-
const s =
|
|
1485
|
+
const s = Ai(o);
|
|
1486
1486
|
s && e.push({
|
|
1487
1487
|
id: o.node_id,
|
|
1488
1488
|
nodeId: o.node_id,
|
|
@@ -1502,7 +1502,7 @@ function $i(t) {
|
|
|
1502
1502
|
}
|
|
1503
1503
|
return l;
|
|
1504
1504
|
}
|
|
1505
|
-
const
|
|
1505
|
+
const $i = {
|
|
1506
1506
|
first: 0,
|
|
1507
1507
|
second: 1,
|
|
1508
1508
|
third: 2,
|
|
@@ -1539,11 +1539,11 @@ const Bt = [
|
|
|
1539
1539
|
(t) => `<${lt(t, !1)}>`
|
|
1540
1540
|
// eighth:小写字母+尖括号
|
|
1541
1541
|
];
|
|
1542
|
-
function
|
|
1542
|
+
function Li() {
|
|
1543
1543
|
const t = new Array(8).fill(0);
|
|
1544
1544
|
return {
|
|
1545
1545
|
next(e, n) {
|
|
1546
|
-
const l =
|
|
1546
|
+
const l = $i[e];
|
|
1547
1547
|
if (l == null) return "";
|
|
1548
1548
|
t[l]++;
|
|
1549
1549
|
for (let s = l + 1; s < t.length; s++) t[s] = 0;
|
|
@@ -1554,14 +1554,14 @@ function Ri() {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
};
|
|
1556
1556
|
}
|
|
1557
|
-
const We = 14,
|
|
1557
|
+
const We = 14, Xt = 760, Ri = 756, Hi = {
|
|
1558
1558
|
left: "left",
|
|
1559
1559
|
center: "center",
|
|
1560
1560
|
right: "right",
|
|
1561
1561
|
alignment: "justify",
|
|
1562
1562
|
justify: "justify"
|
|
1563
1563
|
};
|
|
1564
|
-
function
|
|
1564
|
+
function Yt(t) {
|
|
1565
1565
|
const e = [];
|
|
1566
1566
|
let n = !1;
|
|
1567
1567
|
const l = (o) => {
|
|
@@ -1580,7 +1580,7 @@ function Zt(t) {
|
|
|
1580
1580
|
continue;
|
|
1581
1581
|
}
|
|
1582
1582
|
if (o && o.type === "area") {
|
|
1583
|
-
const s =
|
|
1583
|
+
const s = Yt(o.valueList || []);
|
|
1584
1584
|
if ((o.areaId || "").includes("cover")) {
|
|
1585
1585
|
for (const m of s)
|
|
1586
1586
|
l({ ...m, _isCover: !0 });
|
|
@@ -1594,7 +1594,7 @@ function Zt(t) {
|
|
|
1594
1594
|
}
|
|
1595
1595
|
const Oi = (t) => t == null ? void 0 : t.some((e) => e._isCover);
|
|
1596
1596
|
function Ge(t) {
|
|
1597
|
-
const e =
|
|
1597
|
+
const e = Yt(t), n = [];
|
|
1598
1598
|
let l = [], o = 0, s = null;
|
|
1599
1599
|
const v = (y) => {
|
|
1600
1600
|
l.length && (n.push({ type: "paragraph", elements: [...l], rowFlex: y, _isCover: Oi(l) }), l = []);
|
|
@@ -1623,13 +1623,13 @@ function Ge(t) {
|
|
|
1623
1623
|
m(), v();
|
|
1624
1624
|
const r = y.value === "" || y.value === "" ? [] : [y];
|
|
1625
1625
|
n.push({ type: "list", listType: y.listType || "ul", listStyle: y.listStyle || "disc", items: [r] });
|
|
1626
|
-
} else y.value != null && /^[\
|
|
1626
|
+
} else y.value != null && /^[\n]+$/.test(y.value) ? (o += y.value.length, y.rowFlex && (s = y.rowFlex)) : (m(), l.push(y));
|
|
1627
1627
|
return m(), v(), n;
|
|
1628
1628
|
}
|
|
1629
1629
|
function ze(t) {
|
|
1630
1630
|
const e = t.filter((r) => r.type === "image").reduce((r, M) => r + (M.height || M.width || 0), 0), n = t.filter((r) => r.type !== "image").map((r) => r.value || "").join("");
|
|
1631
1631
|
if (!n) return e || 20;
|
|
1632
|
-
const l = t.reduce((r, M) => Math.max(r, M.size || 0), 0) || 14, o = l + 6, s = (n.match(/[一-龥]/g) || []).length, v = n.length - s, m = s * l + v * (l * 0.5), y = Math.max(1, Math.ceil(m /
|
|
1632
|
+
const l = t.reduce((r, M) => Math.max(r, M.size || 0), 0) || 14, o = l + 6, s = (n.match(/[一-龥]/g) || []).length, v = n.length - s, m = s * l + v * (l * 0.5), y = Math.max(1, Math.ceil(m / Xt));
|
|
1633
1633
|
return e + Math.max(o, y * o);
|
|
1634
1634
|
}
|
|
1635
1635
|
function Bi(t) {
|
|
@@ -1637,10 +1637,10 @@ function Bi(t) {
|
|
|
1637
1637
|
const e = [];
|
|
1638
1638
|
let n = [];
|
|
1639
1639
|
for (const l of t)
|
|
1640
|
-
l.type === "image" && (l.width || 0) >=
|
|
1640
|
+
l.type === "image" && (l.width || 0) >= Xt ? (n.length && (e.push(n), n = []), e.push([l])) : n.push(l);
|
|
1641
1641
|
return n.length && e.push(n), e.length ? e : [[]];
|
|
1642
1642
|
}
|
|
1643
|
-
function
|
|
1643
|
+
function Dt(t) {
|
|
1644
1644
|
if (t.length === 0) return [];
|
|
1645
1645
|
const e = new Array(t.length).fill(0);
|
|
1646
1646
|
t.forEach((s, v) => {
|
|
@@ -1660,11 +1660,11 @@ function zt(t) {
|
|
|
1660
1660
|
o = Math.max(o, e[s]), o <= s && (n.push(t.slice(l, s + 1)), l = s + 1, o = 0);
|
|
1661
1661
|
return l < t.length && n.push(t.slice(l)), n;
|
|
1662
1662
|
}
|
|
1663
|
-
function gt(t) {
|
|
1664
|
-
const
|
|
1665
|
-
return !
|
|
1663
|
+
function gt(t, e = 0) {
|
|
1664
|
+
const n = (t == null ? void 0 : t.width) || 0, l = Math.max(Ri - e, 1);
|
|
1665
|
+
return !n || n <= l ? 1 : l / n;
|
|
1666
1666
|
}
|
|
1667
|
-
function
|
|
1667
|
+
function zt(t) {
|
|
1668
1668
|
var s, v;
|
|
1669
1669
|
const e = t.elements || [], n = ((s = e.find((m) => m.rowFlex)) == null ? void 0 : s.rowFlex) || t.rowFlex, l = { textAlign: Hi[n] || "left" }, o = (v = e.find((m) => m.rowMargin)) == null ? void 0 : v.rowMargin;
|
|
1670
1670
|
return o && (l.lineHeight = o), l;
|
|
@@ -1689,7 +1689,7 @@ function _e(t) {
|
|
|
1689
1689
|
return n && (e.textDecoration = n), t.letterSpacing && (e.letterSpacing = t.letterSpacing + "px"), e;
|
|
1690
1690
|
}
|
|
1691
1691
|
const zi = 5;
|
|
1692
|
-
function
|
|
1692
|
+
function Nt(t, e = !1) {
|
|
1693
1693
|
var l, o;
|
|
1694
1694
|
let n = 0;
|
|
1695
1695
|
for (const s of t)
|
|
@@ -1749,7 +1749,7 @@ const Ni = {
|
|
|
1749
1749
|
], 6)) : t.block.blockType === "paragraph" ? (u(), g("p", {
|
|
1750
1750
|
key: 1,
|
|
1751
1751
|
class: "doc-para",
|
|
1752
|
-
style: V({ ...K(
|
|
1752
|
+
style: V({ ...K(zt)(t.block), paddingLeft: s.value ? s.value + "px" : void 0 })
|
|
1753
1753
|
}, [
|
|
1754
1754
|
t.block.elements.length ? ve("", !0) : (u(), g("span", Ni, " ")),
|
|
1755
1755
|
(u(!0), g(G, null, Q(t.block.elements, (r, M) => {
|
|
@@ -1898,14 +1898,14 @@ const Ni = {
|
|
|
1898
1898
|
ref: t.block._baseKey && K(n) ? (r) => K(n)(r, t.block._baseKey) : void 0,
|
|
1899
1899
|
class: Pe(["doc-table", { "doc-table--no-border": t.block.tableEl.borderType === "empty", "doc-table--header-footer": t.isHeaderFooter }]),
|
|
1900
1900
|
style: V({
|
|
1901
|
-
width: t.block.tableEl.width ? (t.isHeaderFooter ? t.block.tableEl.width : t.block.tableEl.width * K(gt)(t.block.tableEl)) + "px" : "100%",
|
|
1901
|
+
width: t.block.tableEl.width ? (t.isHeaderFooter ? t.block.tableEl.width : t.block.tableEl.width * K(gt)(t.block.tableEl, s.value)) + "px" : "100%",
|
|
1902
1902
|
transform: t.block.sliceOffset ? `translateY(-${t.block.sliceOffset}px)` : void 0
|
|
1903
1903
|
})
|
|
1904
1904
|
}, [
|
|
1905
1905
|
(y = t.block.tableEl.colgroup) != null && y.length ? (u(), g("colgroup", Ji, [
|
|
1906
1906
|
(u(!0), g(G, null, Q(t.block.tableEl.colgroup, (r, M) => (u(), g("col", {
|
|
1907
1907
|
key: M,
|
|
1908
|
-
style: V({ width: (t.isHeaderFooter ? r.width : r.width * K(gt)(t.block.tableEl)) + "px" })
|
|
1908
|
+
style: V({ width: (t.isHeaderFooter ? r.width : r.width * K(gt)(t.block.tableEl, s.value)) + "px" })
|
|
1909
1909
|
}, null, 4))), 128))
|
|
1910
1910
|
])) : ve("", !0),
|
|
1911
1911
|
ne("tbody", null, [
|
|
@@ -1920,7 +1920,7 @@ const Ni = {
|
|
|
1920
1920
|
style: V({
|
|
1921
1921
|
backgroundColor: x.backgroundColor || void 0,
|
|
1922
1922
|
verticalAlign: K(Di)(x),
|
|
1923
|
-
width: x.width ? x.width * K(gt)(t.block.tableEl) + "px" : void 0,
|
|
1923
|
+
width: x.width ? x.width * K(gt)(t.block.tableEl, s.value) + "px" : void 0,
|
|
1924
1924
|
height: x.height ? x.height + "px" : void 0
|
|
1925
1925
|
})
|
|
1926
1926
|
}, [
|
|
@@ -1928,7 +1928,7 @@ const Ni = {
|
|
|
1928
1928
|
B.type === "paragraph" ? (u(), g("p", {
|
|
1929
1929
|
key: 0,
|
|
1930
1930
|
class: "cell-para",
|
|
1931
|
-
style: V(K(
|
|
1931
|
+
style: V(K(zt)(B))
|
|
1932
1932
|
}, [
|
|
1933
1933
|
B.elements.length ? ve("", !0) : (u(), g("span", Yi, " ")),
|
|
1934
1934
|
(u(!0), g(G, null, Q(B.elements, (I, D) => {
|
|
@@ -2021,7 +2021,7 @@ const Ni = {
|
|
|
2021
2021
|
], 6)) : ve("", !0);
|
|
2022
2022
|
};
|
|
2023
2023
|
}
|
|
2024
|
-
}, pt = /* @__PURE__ */ Ne(il, [["__scopeId", "data-v-
|
|
2024
|
+
}, pt = /* @__PURE__ */ Ne(il, [["__scopeId", "data-v-b9e67b24"]]), ll = { class: "editor-layout word-editor-scope" }, ol = { class: "editor-container" }, al = {
|
|
2025
2025
|
key: 0,
|
|
2026
2026
|
class: "editor-loading"
|
|
2027
2027
|
}, sl = {
|
|
@@ -2077,7 +2077,7 @@ const Ni = {
|
|
|
2077
2077
|
let E = 0, X = !1;
|
|
2078
2078
|
const ue = (H) => {
|
|
2079
2079
|
F.push({ ...H, _isCover: X });
|
|
2080
|
-
}, z =
|
|
2080
|
+
}, z = Li(), ie = { first: 0, second: 1, third: 2, fourth: 3, fifth: 4, sixth: 5, seventh: 6, eighth: 7 };
|
|
2081
2081
|
let Ce = -1;
|
|
2082
2082
|
const Je = (H) => {
|
|
2083
2083
|
var he, me, Me;
|
|
@@ -2137,7 +2137,7 @@ const Ni = {
|
|
|
2137
2137
|
});
|
|
2138
2138
|
});
|
|
2139
2139
|
} else if (H.type === "table") {
|
|
2140
|
-
const fe = !!((ct = H.el.extension) != null && ct.isTitleTable), se = ((Xe = H.el.extension) == null ? void 0 : Xe.elementType) === "signOff", ke = ((Ye = H.el.extension) == null ? void 0 : Ye.elementType) === "stepTable", Ie = se || ke, we = fe || se ? 0 : Ce >= 0 ? (Ce + 1) * 20 : 0, le =
|
|
2140
|
+
const fe = !!((ct = H.el.extension) != null && ct.isTitleTable), se = ((Xe = H.el.extension) == null ? void 0 : Xe.elementType) === "signOff", ke = ((Ye = H.el.extension) == null ? void 0 : Ye.elementType) === "stepTable", Ie = se || ke, we = fe || se ? 0 : Ce >= 0 ? (Ce + 1) * 20 : 0, le = Dt(H.el.trList || []), ge = le.length;
|
|
2141
2141
|
if (Ie) {
|
|
2142
2142
|
const ye = le.flat(), O = ye.reduce(
|
|
2143
2143
|
(oe, ee) => oe + (ee.height || ee.minHeight || 35),
|
|
@@ -2255,7 +2255,7 @@ const Ni = {
|
|
|
2255
2255
|
var F;
|
|
2256
2256
|
const h = (F = e.data) == null ? void 0 : F.footer;
|
|
2257
2257
|
return h != null && h.length ? Ge(h) : [];
|
|
2258
|
-
}), x = de(() =>
|
|
2258
|
+
}), x = de(() => Nt(r.value, !0)), $ = de(() => Nt(M.value, !0)), B = de(() => r.value.length > 0), W = de(() => M.value.length > 0);
|
|
2259
2259
|
function I(h) {
|
|
2260
2260
|
var P, E, X;
|
|
2261
2261
|
const F = h.type === "table";
|
|
@@ -2269,25 +2269,25 @@ const Ni = {
|
|
|
2269
2269
|
listStyle: h.listStyle,
|
|
2270
2270
|
items: h.items,
|
|
2271
2271
|
indentPx: 0,
|
|
2272
|
-
trGroup: F ?
|
|
2272
|
+
trGroup: F ? Dt(h.el.trList).flat() : void 0,
|
|
2273
2273
|
tableEl: F ? h.el : void 0,
|
|
2274
2274
|
isFirst: !0,
|
|
2275
2275
|
isLast: !0,
|
|
2276
2276
|
tableRowFlex: ((X = h.el) == null ? void 0 : X.rowFlex) || null
|
|
2277
2277
|
};
|
|
2278
2278
|
}
|
|
2279
|
-
const D = de(() =>
|
|
2279
|
+
const D = de(() => Pi(y.value));
|
|
2280
2280
|
function T(h) {
|
|
2281
2281
|
var F;
|
|
2282
2282
|
(F = l.value) == null || F.scrollToRow({ node_id: h.nodeId });
|
|
2283
2283
|
}
|
|
2284
2284
|
return (h, F) => (u(), g("div", ll, [
|
|
2285
|
-
q(
|
|
2285
|
+
q(Fi, {
|
|
2286
2286
|
items: D.value,
|
|
2287
2287
|
onNavigate: T
|
|
2288
2288
|
}, null, 8, ["items"]),
|
|
2289
2289
|
ne("div", ol, [
|
|
2290
|
-
t.loading ? (u(), g("div", al, " 加载中… ")) : (u(), Fe(K(
|
|
2290
|
+
t.loading ? (u(), g("div", al, " 加载中… ")) : (u(), Fe(K(hi), {
|
|
2291
2291
|
key: 1,
|
|
2292
2292
|
ref_key: "virtualTableRef",
|
|
2293
2293
|
ref: l,
|
|
@@ -2308,9 +2308,9 @@ const Ni = {
|
|
|
2308
2308
|
showPageNumber: !0
|
|
2309
2309
|
},
|
|
2310
2310
|
data: y.value
|
|
2311
|
-
},
|
|
2311
|
+
}, Mn({
|
|
2312
2312
|
default: qe(() => [
|
|
2313
|
-
q(K(
|
|
2313
|
+
q(K(pi), null, {
|
|
2314
2314
|
default: qe(({ row: P }) => [
|
|
2315
2315
|
q(pt, { block: P }, null, 8, ["block"])
|
|
2316
2316
|
]),
|
|
@@ -2350,15 +2350,15 @@ const Ni = {
|
|
|
2350
2350
|
])
|
|
2351
2351
|
]));
|
|
2352
2352
|
}
|
|
2353
|
-
}, gl = /* @__PURE__ */ Ne(fl, [["__scopeId", "data-v-9ff2db2b"]]),
|
|
2353
|
+
}, gl = /* @__PURE__ */ Ne(fl, [["__scopeId", "data-v-9ff2db2b"]]), Vt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
2354
2354
|
function ot(t = 10) {
|
|
2355
2355
|
const e = crypto.getRandomValues(new Uint8Array(t));
|
|
2356
|
-
return Array.from(e).map((n) =>
|
|
2356
|
+
return Array.from(e).map((n) => Vt[n % Vt.length]).join("");
|
|
2357
2357
|
}
|
|
2358
2358
|
class st {
|
|
2359
2359
|
constructor(e) {
|
|
2360
2360
|
N(this, "data");
|
|
2361
|
-
this.data =
|
|
2361
|
+
this.data = qt({
|
|
2362
2362
|
id: ot(),
|
|
2363
2363
|
version: 1,
|
|
2364
2364
|
sections: [this.createEmptySection()],
|
|
@@ -2498,12 +2498,12 @@ class st {
|
|
|
2498
2498
|
function $e(t = 0, e = 0, n = 0, l = 0) {
|
|
2499
2499
|
return { sectionIndex: t, paragraphIndex: e, elementIndex: n, offset: l };
|
|
2500
2500
|
}
|
|
2501
|
-
function
|
|
2501
|
+
function jt(t, e) {
|
|
2502
2502
|
return t.sectionIndex === e.sectionIndex && t.paragraphIndex === e.paragraphIndex && t.elementIndex === e.elementIndex && t.offset === e.offset;
|
|
2503
2503
|
}
|
|
2504
2504
|
class bt {
|
|
2505
2505
|
constructor(e) {
|
|
2506
|
-
N(this, "_selection",
|
|
2506
|
+
N(this, "_selection", qt({
|
|
2507
2507
|
anchor: $e(),
|
|
2508
2508
|
focus: $e(),
|
|
2509
2509
|
isCollapsed: !0
|
|
@@ -2521,7 +2521,7 @@ class bt {
|
|
|
2521
2521
|
this._selection.anchor = { ...e }, this._selection.focus = { ...e }, this._selection.isCollapsed = !0;
|
|
2522
2522
|
}
|
|
2523
2523
|
setSelection(e, n) {
|
|
2524
|
-
this._selection.anchor = { ...e }, this._selection.focus = { ...n }, this._selection.isCollapsed =
|
|
2524
|
+
this._selection.anchor = { ...e }, this._selection.focus = { ...n }, this._selection.isCollapsed = jt(e, n);
|
|
2525
2525
|
}
|
|
2526
2526
|
collapse(e = !0) {
|
|
2527
2527
|
e ? this._selection.anchor = { ...this._selection.focus } : this._selection.focus = { ...this._selection.anchor }, this._selection.isCollapsed = !0;
|
|
@@ -2571,7 +2571,7 @@ class bt {
|
|
|
2571
2571
|
l && this._applyMove(l, e);
|
|
2572
2572
|
}
|
|
2573
2573
|
_applyMove(e, n) {
|
|
2574
|
-
n ? (this._selection.focus = e, this._selection.isCollapsed =
|
|
2574
|
+
n ? (this._selection.focus = e, this._selection.isCollapsed = jt(this._selection.anchor, e)) : (this._selection.anchor = { ...e }, this._selection.focus = { ...e }, this._selection.isCollapsed = !0);
|
|
2575
2575
|
}
|
|
2576
2576
|
_getNextParagraphPoint(e) {
|
|
2577
2577
|
const n = this._docModel.data.sections[e.sectionIndex];
|
|
@@ -2706,7 +2706,7 @@ class yl {
|
|
|
2706
2706
|
}));
|
|
2707
2707
|
}
|
|
2708
2708
|
}
|
|
2709
|
-
class
|
|
2709
|
+
class Kt {
|
|
2710
2710
|
constructor(e, n, l) {
|
|
2711
2711
|
N(this, "name");
|
|
2712
2712
|
N(this, "_deletedText", "");
|
|
@@ -2804,7 +2804,7 @@ class bl {
|
|
|
2804
2804
|
this.register("insertText", (n) => {
|
|
2805
2805
|
const { focus: l } = this.selectionManager.selection;
|
|
2806
2806
|
return new ml(this.docModel, this.selectionManager, l, n);
|
|
2807
|
-
}), this.register("insertParagraph", () => new yl(this.docModel, this.selectionManager)), this.register("deleteBackward", () => new
|
|
2807
|
+
}), this.register("insertParagraph", () => new yl(this.docModel, this.selectionManager)), this.register("deleteBackward", () => new Kt(this.docModel, this.selectionManager, "backward")), this.register("deleteForward", () => new Kt(this.docModel, this.selectionManager, "forward")), this.register("undo", () => null), this.register("redo", () => null), ["bold", "italic", "underline", "strikethrough", "superscript", "subscript"].forEach((n) => {
|
|
2808
2808
|
this.register(n, () => new Ue(this.docModel, this.selectionManager, n));
|
|
2809
2809
|
}), this.register("fontSize", (n) => new Ue(this.docModel, this.selectionManager, "fontSize", n)), this.register("fontFamily", (n) => new Ue(this.docModel, this.selectionManager, "fontFamily", n)), this.register("color", (n) => new Ue(this.docModel, this.selectionManager, "color", n)), this.register("backgroundColor", (n) => new Ue(this.docModel, this.selectionManager, "backgroundColor", n)), this.register("textAlign", (n) => new vt(this.docModel, this.selectionManager, "textAlign", n)), this.register("lineHeight", (n) => new vt(this.docModel, this.selectionManager, "lineHeight", n)), this.register("heading", (n) => new vt(this.docModel, this.selectionManager, "heading", n)), this.register("selectAll", () => (this.selectionManager.selectAll(), null)), this.register("setSelection", (n) => {
|
|
2810
2810
|
if (n) {
|
|
@@ -2970,15 +2970,15 @@ class xl {
|
|
|
2970
2970
|
return ["undo", "redo", "selectAll", "setSelection"].includes(e);
|
|
2971
2971
|
}
|
|
2972
2972
|
}
|
|
2973
|
-
const
|
|
2973
|
+
const Zt = Symbol("editor");
|
|
2974
2974
|
function El(t) {
|
|
2975
2975
|
const e = new xl(t);
|
|
2976
|
-
return yt(
|
|
2976
|
+
return yt(Zt, e), rt(() => {
|
|
2977
2977
|
e.unmount();
|
|
2978
2978
|
}), e;
|
|
2979
2979
|
}
|
|
2980
2980
|
function Sl() {
|
|
2981
|
-
const t = mt(
|
|
2981
|
+
const t = mt(Zt);
|
|
2982
2982
|
if (!t)
|
|
2983
2983
|
throw new Error("[useEditor] 必须在 EditorContainer 组件内使用");
|
|
2984
2984
|
return t;
|
|
@@ -2991,7 +2991,7 @@ const kl = gl, Fl = {
|
|
|
2991
2991
|
export {
|
|
2992
2992
|
xl as Editor,
|
|
2993
2993
|
kl as EditorContainer,
|
|
2994
|
-
|
|
2994
|
+
Zt as EditorKey,
|
|
2995
2995
|
El as createEditor,
|
|
2996
2996
|
Fl as default,
|
|
2997
2997
|
Sl as useEditor
|