xiaodao-spreader 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/types/components/spreader/{components/spreadsheet.vue.d.ts → spreader.vue.d.ts} +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/xiaodao-spreader.es.js +590 -580
- package/dist/xiaodao-spreader.umd.js +5 -5
- package/package.json +5 -2
- package/dist/types/components/spreader/index.d.ts +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as $t, ref as V, computed as se, watch as ut, nextTick as $e, onMounted as Il, onBeforeUnmount as ll, openBlock as W, createElementBlock as fe, normalizeStyle as nt, normalizeClass as Pe, toDisplayString as xt, createElementVNode as b, createCommentVNode as Qe, createBlock as Ae, Teleport as ze, createVNode as Je, Transition as Wt, withCtx as It, Fragment as bt, renderList as Rt, withModifiers as qe, unref as ke, withDirectives as vo, vShow as go, reactive as
|
|
2
|
-
const Re = 52, Se = 24, Qt = 100, Ol = 24, fl = 30, vl = 24, xl = 1e3, gl = 500, el = 11,
|
|
1
|
+
import { defineComponent as $t, ref as V, computed as se, watch as ut, nextTick as $e, onMounted as Il, onBeforeUnmount as ll, openBlock as W, createElementBlock as fe, normalizeStyle as nt, normalizeClass as Pe, toDisplayString as xt, createElementVNode as b, createCommentVNode as Qe, createBlock as Ae, Teleport as ze, createVNode as Je, Transition as Wt, withCtx as It, Fragment as bt, renderList as Rt, withModifiers as qe, unref as ke, withDirectives as vo, vShow as go, reactive as Mt, watchEffect as mo, useModel as po, mergeModels as ho } from "vue";
|
|
2
|
+
const Re = 52, Se = 24, Qt = 100, Ol = 24, fl = 30, vl = 24, xl = 1e3, gl = 500, el = 11, bo = 50, Co = {
|
|
3
3
|
"zh-CN": {
|
|
4
4
|
insert: "插入",
|
|
5
5
|
delete: "删除",
|
|
@@ -224,10 +224,10 @@ const Re = 52, Se = 24, Qt = 100, Ol = 24, fl = 30, vl = 24, xl = 1e3, gl = 500,
|
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
function U(e, p) {
|
|
227
|
-
var
|
|
228
|
-
return ((
|
|
227
|
+
var v;
|
|
228
|
+
return ((v = Co[e]) == null ? void 0 : v[p]) ?? p;
|
|
229
229
|
}
|
|
230
|
-
const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif',
|
|
230
|
+
const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif', Bt = 10, yo = [
|
|
231
231
|
{ label: "", value: "" },
|
|
232
232
|
{ label: "微软雅黑", value: '"Microsoft YaHei", "微软雅黑", sans-serif' },
|
|
233
233
|
{ label: "宋体", value: '"SimSun", "宋体", serif' },
|
|
@@ -243,7 +243,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
243
243
|
{ label: "Tahoma", value: "Tahoma, sans-serif" },
|
|
244
244
|
{ label: "Trebuchet MS", value: '"Trebuchet MS", sans-serif' },
|
|
245
245
|
{ label: "Comic Sans MS", value: '"Comic Sans MS", cursive' }
|
|
246
|
-
],
|
|
246
|
+
], wo = [
|
|
247
247
|
{ label: "9", value: 9 },
|
|
248
248
|
{ label: "10", value: 10 },
|
|
249
249
|
{ label: "11", value: 11 },
|
|
@@ -259,20 +259,20 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
259
259
|
{ label: "36", value: 36 },
|
|
260
260
|
{ label: "48", value: 48 },
|
|
261
261
|
{ label: "72", value: 72 }
|
|
262
|
-
],
|
|
263
|
-
{ value: "left", labelKey: "alignLeft", icon:
|
|
264
|
-
{ value: "center", labelKey: "alignCenter", icon:
|
|
265
|
-
{ value: "right", labelKey: "alignRight", icon:
|
|
266
|
-
],
|
|
267
|
-
{ value: "top", labelKey: "alignTop", icon:
|
|
268
|
-
{ value: "middle", labelKey: "alignMiddle", icon:
|
|
269
|
-
{ value: "bottom", labelKey: "alignBottom", icon:
|
|
270
|
-
],
|
|
271
|
-
{ key: "mergeCenter", labelKey: "mergeCenter", icon:
|
|
272
|
-
{ key: "mergeAcross", labelKey: "mergeAcross", icon:
|
|
273
|
-
{ key: "mergeCells", labelKey: "mergeCells", icon:
|
|
274
|
-
{ key: "unmergeCells", labelKey: "unmergeCells", icon:
|
|
275
|
-
],
|
|
262
|
+
], ko = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="19" y2="6"/><line x1="3" y1="12" x2="15" y2="12"/><line x1="3" y1="18" x2="17" y2="18"/></svg>', xo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="21" y2="6"/><line x1="6" y1="12" x2="18" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/></svg>', Ro = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="5" y1="6" x2="21" y2="6"/><line x1="9" y1="12" x2="21" y2="12"/><line x1="7" y1="18" x2="21" y2="18"/></svg>', So = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="6" y1="7" x2="6" y2="20"/><line x1="12" y1="7" x2="12" y2="16"/><line x1="18" y1="7" x2="18" y2="20"/><line x1="4" y1="3" x2="20" y2="3"/></svg>', Mo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="6" y1="4" x2="6" y2="20"/><line x1="12" y1="8" x2="12" y2="16"/><line x1="18" y1="4" x2="18" y2="20"/></svg>', Bo = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="6" y1="4" x2="6" y2="17"/><line x1="12" y1="8" x2="12" y2="17"/><line x1="18" y1="4" x2="18" y2="17"/><line x1="4" y1="21" x2="20" y2="21"/></svg>', Do = [
|
|
263
|
+
{ value: "left", labelKey: "alignLeft", icon: ko },
|
|
264
|
+
{ value: "center", labelKey: "alignCenter", icon: xo },
|
|
265
|
+
{ value: "right", labelKey: "alignRight", icon: Ro }
|
|
266
|
+
], Fo = [
|
|
267
|
+
{ value: "top", labelKey: "alignTop", icon: So },
|
|
268
|
+
{ value: "middle", labelKey: "alignMiddle", icon: Mo },
|
|
269
|
+
{ value: "bottom", labelKey: "alignBottom", icon: Bo }
|
|
270
|
+
], To = '<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M709.952 465.92l88-76.032C801.92 385.984 806.656 384 812.032 384s10.048 1.984 14.08 5.952C830.08 393.92 832 398.656 832 403.968L832 448l32 0C881.664 448 896 462.336 896 480S881.664 512 864 512L832 512l0 44.032c0 5.376-1.92 10.112-5.952 14.08C822.08 574.08 817.344 576 812.032 576s-10.048-1.92-14.08-5.952L709.952 494.08C705.984 490.112 704 485.376 704 480S705.984 469.952 709.952 465.92zM378.048 465.92 290.048 389.952C286.08 385.984 281.344 384 275.968 384s-10.048 1.984-14.08 5.952C257.92 393.92 256 398.656 256 403.968L256 448 224 448C206.336 448 192 462.336 192 480S206.336 512 224 512L256 512l0 44.032c0 5.376 1.92 10.112 5.952 14.08C265.92 574.08 270.656 576 275.968 576s10.048-1.92 14.08-5.952L378.048 494.08C382.016 490.112 384 485.376 384 480S382.016 469.952 378.048 465.92zM448 128 128 128l0 704 320 0 0-128 64 0 0 128c0 35.392-28.608 64-64 64L128 896c-35.392 0-64-28.608-64-64L64 128c0-35.392 28.608-64 64-64l320 0 0 0c35.392 0 64 28.608 64 64l0 128L448 256 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128M722.304 642.304c0 8.512-3.52 16.32-10.496 23.36s-15.424 10.624-25.344 10.624c-5.76 0-10.688-1.088-14.72-3.136-4.096-2.048-7.616-4.928-10.432-8.512s-5.824-9.088-9.024-16.512-5.952-13.952-8.32-19.648l-17.28-46.016L479.36 582.464 462.08 629.568c-6.72 18.304-12.48 30.656-17.344 37.12s-12.544 9.6-23.424 9.6c-9.28 0-17.408-3.456-24.512-10.24s-10.624-14.592-10.624-23.232c0-4.992 0.896-10.176 2.496-15.488S393.024 614.592 396.8 605.056l92.672-238.016C492.096 360.256 495.296 352 499.008 342.464s7.68-17.536 11.904-23.872 9.664-11.456 16.576-15.36c6.784-3.968 15.232-5.888 25.344-5.888 10.176 0 18.752 1.92 25.472 5.888 6.848 3.968 12.352 8.96 16.64 15.104 4.096 6.208 7.744 12.8 10.624 19.904s6.528 16.576 11.008 28.352l94.656 236.48C718.592 621.056 722.304 634.112 722.304 642.304zM606.912 526.784 552.32 375.552 498.624 526.784 606.912 526.784z"/></svg>', Eo = '<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M832 64c70.4 0 128 57.6 128 128v640c0 70.4-57.6 128-128 128H192c-70.4 0-128-57.6-128-128V192c0-70.4 57.6-128 128-128h640zM448 768H128v64c0 38.4 25.6 64 64 64h256v-128z m448 0H512v128h320c38.4 0 64-25.6 64-64v-64z m0-448H128v384h768V320zM633.6 390.4l96 96c6.4 6.4 6.4 12.8 6.4 19.2 0 6.4-6.4 12.8-6.4 19.2L633.6 633.6c-12.8 12.8-32 12.8-44.8 0-12.8-12.8-12.8-32-6.4-44.8l44.8-44.8H288c-19.2 0-32-12.8-32-32s12.8-32 32-32h339.2l-44.8-44.8c-6.4-12.8-6.4-32 0-44.8 12.8-12.8 38.4-12.8 51.2 0zM448 128H192c-38.4 0-64 25.6-64 64v64h320V128z m384 0H512v128h384V192c0-38.4-25.6-64-64-64z"/></svg>', Lo = '<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M512 480c0 5.376-1.984 10.112-5.952 14.08L354.048 634.048C350.08 638.08 345.344 640 339.968 640s-10.048-1.92-14.08-5.952C321.92 630.144 320 625.344 320 620.032L320 512 224 512C206.336 512 192 497.664 192 480S206.336 448 224 448L320 448 320 339.968c0-5.376 1.92-10.048 5.952-14.08C329.92 321.984 334.656 320 339.968 320s10.048 1.984 14.08 5.952L506.048 465.92C510.016 469.952 512 474.624 512 480zM576 480c0 5.376 1.984 10.112 5.952 14.08l152 140.032C737.92 638.08 742.656 640 748.032 640s10.048-1.92 14.08-5.952C766.08 630.144 768 625.344 768 620.032L768 512l96 0C881.664 512 896 497.664 896 480S881.664 448 864 448L768 448 768 339.968c0-5.376-1.92-10.048-5.952-14.08C758.08 321.984 753.344 320 748.032 320s-10.048 1.984-14.08 5.952L581.952 465.92C577.984 469.952 576 474.624 576 480zM448 128l0 128 64 0L512 128c0-35.392-28.672-64-64-64l0 0L128 64C92.672 64 64 92.608 64 128l0 704c0 35.392 28.672 64 64 64l320 0c35.328 0 64-28.608 64-64l0-128L448 704l0 128L128 832 128 128 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128"/></svg>', Oo = '<svg viewBox="0 0 1024 1024" fill="currentColor"><path d="M197.952 465.92l152-140.032C353.92 321.984 358.656 320 364.032 320s10.048 1.984 14.08 5.952C382.08 329.92 384 334.656 384 339.968L384 448l96 0C497.664 448 512 462.336 512 480S497.664 512 480 512L384 512l0 108.032c0 5.376-1.92 10.112-5.952 14.08C374.08 638.08 369.344 640 364.032 640S353.92 638.08 349.952 634.048L197.952 494.08C193.984 490.112 192 485.376 192 480S193.984 469.952 197.952 465.92zM890.048 465.92l-152-140.032C734.08 321.984 729.344 320 723.968 320s-10.048 1.984-14.08 5.952C705.92 329.92 704 334.656 704 339.968L704 448 608 448C590.336 448 576 462.336 576 480S590.336 512 608 512L704 512l0 108.032c0 5.376 1.92 10.112 5.952 14.08C713.92 638.08 718.656 640 723.968 640s10.048-1.92 14.08-5.952l152-140.032C894.016 490.112 896 485.376 896 480S894.016 469.952 890.048 465.92zM448 128l0 128 64 0L512 128c0-35.392-28.608-64-64-64l0 0L128 64C92.608 64 64 92.608 64 128l0 704c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64l0-128L448 704l0 128L128 832 128 128 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128"/></svg>', Zl = [
|
|
271
|
+
{ key: "mergeCenter", labelKey: "mergeCenter", icon: To },
|
|
272
|
+
{ key: "mergeAcross", labelKey: "mergeAcross", icon: Eo },
|
|
273
|
+
{ key: "mergeCells", labelKey: "mergeCells", icon: Lo },
|
|
274
|
+
{ key: "unmergeCells", labelKey: "unmergeCells", icon: Oo }
|
|
275
|
+
], Ao = {
|
|
276
276
|
bg: "#f4f4f4",
|
|
277
277
|
gridBg: "#ffffff",
|
|
278
278
|
headerBg: "#e8e8e8",
|
|
@@ -327,7 +327,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
327
327
|
toolbarBtnHoverBg: "#e6e6e6",
|
|
328
328
|
toolbarBtnDisabledColor: "#b0b0b0",
|
|
329
329
|
toolbarBtnActiveColor: "#0078d7"
|
|
330
|
-
},
|
|
330
|
+
}, zo = {
|
|
331
331
|
bg: "#1e1e1e",
|
|
332
332
|
gridBg: "#252526",
|
|
333
333
|
headerBg: "#252525",
|
|
@@ -382,10 +382,10 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
382
382
|
toolbarBtnHoverBg: "#3a3a3a",
|
|
383
383
|
toolbarBtnDisabledColor: "#666",
|
|
384
384
|
toolbarBtnActiveColor: "#4ea1ff"
|
|
385
|
-
},
|
|
385
|
+
}, Ho = ["title"], Wo = ["innerHTML"], Io = {
|
|
386
386
|
key: 1,
|
|
387
387
|
class: "sp-dropdown__value"
|
|
388
|
-
},
|
|
388
|
+
}, $o = ["disabled"], Ko = ["onClick"], No = ["innerHTML"], Vo = { class: "sp-dropdown__item-label" }, Po = ["disabled"], Uo = /* @__PURE__ */ $t({
|
|
389
389
|
__name: "dropdown",
|
|
390
390
|
props: {
|
|
391
391
|
modelValue: {},
|
|
@@ -401,17 +401,17 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
401
401
|
},
|
|
402
402
|
emits: ["update:modelValue", "change", "update:modelOpen"],
|
|
403
403
|
setup(e, { emit: p }) {
|
|
404
|
-
const
|
|
404
|
+
const v = e, o = p, s = V(!1), k = V(0), a = V(null), z = V(null), g = V(null), le = V({ top: 0, up: !1 }), q = V(0), y = V(!1), ae = se(() => v.options.find((de) => String(de.value) === String(v.modelValue))), L = se(() => v.menuWidth), f = se(() => Math.min(v.visibleCount, v.options.length)), Ce = se(() => v.options.slice(k.value, k.value + f.value)), he = se(() => k.value > 0), De = se(() => k.value + f.value < v.options.length), Y = se(() => v.options.length > f.value);
|
|
405
405
|
function X(de) {
|
|
406
|
-
k.value = Math.max(0, Math.min(
|
|
406
|
+
k.value = Math.max(0, Math.min(v.options.length - f.value, k.value + de));
|
|
407
407
|
}
|
|
408
408
|
function be() {
|
|
409
|
-
s.value = !0,
|
|
410
|
-
const de =
|
|
409
|
+
s.value = !0, v.modelOpen !== void 0 && o("update:modelOpen", !0);
|
|
410
|
+
const de = v.triggerEl ?? a.value;
|
|
411
411
|
if (!de)
|
|
412
412
|
return;
|
|
413
413
|
const n = de.getBoundingClientRect(), d = f.value * 22 + (Y.value ? 2 * 15 : 0) + 8, l = window.innerHeight - n.bottom - 4 < d && n.top - 4 > d;
|
|
414
|
-
|
|
414
|
+
v.align === "right" ? le.value = {
|
|
415
415
|
right: window.innerWidth - n.right,
|
|
416
416
|
top: l ? n.top - d - 4 : n.bottom + 4,
|
|
417
417
|
up: l
|
|
@@ -420,11 +420,11 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
420
420
|
top: l ? n.top - d - 4 : n.bottom + 4,
|
|
421
421
|
up: l
|
|
422
422
|
};
|
|
423
|
-
const r =
|
|
424
|
-
k.value = r >= 0 ? Math.max(0, Math.min(r - Math.floor(f.value / 2),
|
|
423
|
+
const r = v.options.findIndex((I) => String(I.value) === String(v.modelValue));
|
|
424
|
+
k.value = r >= 0 ? Math.max(0, Math.min(r - Math.floor(f.value / 2), v.options.length - f.value)) : 0;
|
|
425
425
|
}
|
|
426
426
|
function F() {
|
|
427
|
-
s.value = !1,
|
|
427
|
+
s.value = !1, v.modelOpen !== void 0 && o("update:modelOpen", !1);
|
|
428
428
|
}
|
|
429
429
|
function j() {
|
|
430
430
|
s.value ? F() : be();
|
|
@@ -437,7 +437,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
437
437
|
if (!s.value)
|
|
438
438
|
return;
|
|
439
439
|
const n = de.target;
|
|
440
|
-
(d = a.value) != null && d.contains(n) || (w =
|
|
440
|
+
(d = a.value) != null && d.contains(n) || (w = g.value) != null && w.contains(n) || F();
|
|
441
441
|
}
|
|
442
442
|
function oe(de) {
|
|
443
443
|
s.value && (de.preventDefault(), X(de.deltaY > 0 ? 1 : -1));
|
|
@@ -447,13 +447,13 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
447
447
|
var n, d;
|
|
448
448
|
de ? (n = z.value) == null || n.addEventListener("wheel", oe, { passive: !1 }) : (d = z.value) == null || d.removeEventListener("wheel", oe);
|
|
449
449
|
});
|
|
450
|
-
}), ut(() =>
|
|
450
|
+
}), ut(() => v.modelOpen, (de) => {
|
|
451
451
|
de !== void 0 && de !== s.value && (de ? be() : F());
|
|
452
452
|
});
|
|
453
453
|
function c(de) {
|
|
454
454
|
s.value && (q.value = de.touches[0].clientY, y.value = !0);
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function h(de) {
|
|
457
457
|
if (!s.value || !y.value)
|
|
458
458
|
return;
|
|
459
459
|
const n = de.touches[0].clientY - q.value;
|
|
@@ -488,7 +488,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
488
488
|
key: 0,
|
|
489
489
|
class: "sp-dropdown__icon",
|
|
490
490
|
innerHTML: ae.value.icon
|
|
491
|
-
}, null, 8,
|
|
491
|
+
}, null, 8, Wo)) : (W(), fe("span", Io, xt(((w = ae.value) == null ? void 0 : w.label) ?? ""), 1)),
|
|
492
492
|
n[2] || (n[2] = b("svg", {
|
|
493
493
|
class: "sp-dropdown__caret",
|
|
494
494
|
viewBox: "0 0 1024 1024",
|
|
@@ -496,14 +496,14 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
496
496
|
}, [
|
|
497
497
|
b("path", { d: "M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z" })
|
|
498
498
|
], -1))
|
|
499
|
-
], 10,
|
|
499
|
+
], 10, Ho)),
|
|
500
500
|
(W(), Ae(ze, { to: "body" }, [
|
|
501
501
|
Je(Wt, { name: "menu-pop" }, {
|
|
502
502
|
default: It(() => [
|
|
503
503
|
s.value ? (W(), fe("div", {
|
|
504
504
|
key: 0,
|
|
505
505
|
ref_key: "menuRef",
|
|
506
|
-
ref:
|
|
506
|
+
ref: g,
|
|
507
507
|
class: Pe(["sp-dropdown__menu", { "sp-dropdown__menu--up": le.value.up }]),
|
|
508
508
|
style: nt({ left: le.value.left !== void 0 ? le.value.left + "px" : void 0, right: le.value.right !== void 0 ? le.value.right + "px" : void 0, top: le.value.top + "px", minWidth: L.value !== void 0 ? typeof L.value == "number" ? L.value + "px" : L.value : void 0 }),
|
|
509
509
|
onKeydown: He
|
|
@@ -521,13 +521,13 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
521
521
|
}, [
|
|
522
522
|
b("path", { d: "M180.053333 662.613333a32 32 0 0 0 45.226667 0L512 375.893333l286.72 286.72a32 32 0 1 0 45.226667-45.226666l-309.333334-309.333334a32 32 0 0 0-45.226666 0l-309.333334 309.333334a32 32 0 0 0 0 45.226666z" })
|
|
523
523
|
], -1)
|
|
524
|
-
])], 10,
|
|
524
|
+
])], 10, $o)) : Qe("", !0),
|
|
525
525
|
b("div", {
|
|
526
526
|
ref_key: "listRef",
|
|
527
527
|
ref: z,
|
|
528
528
|
class: "sp-dropdown__list",
|
|
529
529
|
onTouchstart: c,
|
|
530
|
-
onTouchmove:
|
|
530
|
+
onTouchmove: h,
|
|
531
531
|
onTouchend: Ne
|
|
532
532
|
}, [
|
|
533
533
|
(W(!0), fe(bt, null, Rt(Ce.value, (l) => (W(), fe("button", {
|
|
@@ -540,9 +540,9 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
540
540
|
key: 0,
|
|
541
541
|
class: "sp-dropdown__item-icon",
|
|
542
542
|
innerHTML: l.icon
|
|
543
|
-
}, null, 8,
|
|
544
|
-
b("span",
|
|
545
|
-
], 10,
|
|
543
|
+
}, null, 8, No)) : Qe("", !0),
|
|
544
|
+
b("span", Vo, xt(l.label), 1)
|
|
545
|
+
], 10, Ko))), 128))
|
|
546
546
|
], 544),
|
|
547
547
|
Y.value ? (W(), fe("button", {
|
|
548
548
|
key: 1,
|
|
@@ -557,7 +557,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
557
557
|
}, [
|
|
558
558
|
b("path", { d: "M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z" })
|
|
559
559
|
], -1)
|
|
560
|
-
])], 10,
|
|
560
|
+
])], 10, Po)) : Qe("", !0)
|
|
561
561
|
], 38)) : Qe("", !0)
|
|
562
562
|
]),
|
|
563
563
|
_: 1
|
|
@@ -567,11 +567,11 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
567
567
|
};
|
|
568
568
|
}
|
|
569
569
|
}), Kt = (e, p) => {
|
|
570
|
-
const
|
|
570
|
+
const v = e.__vccOpts || e;
|
|
571
571
|
for (const [o, s] of p)
|
|
572
|
-
|
|
573
|
-
return
|
|
574
|
-
}, Rl = /* @__PURE__ */ Kt(
|
|
572
|
+
v[o] = s;
|
|
573
|
+
return v;
|
|
574
|
+
}, Rl = /* @__PURE__ */ Kt(Uo, [["__scopeId", "data-v-8dc09f5d"]]), Yo = ["title", "onClick"], Go = /* @__PURE__ */ $t({
|
|
575
575
|
__name: "colorPicker",
|
|
576
576
|
props: {
|
|
577
577
|
modelOpen: { type: Boolean, default: void 0 },
|
|
@@ -581,8 +581,8 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
581
581
|
triggerEl: { default: null }
|
|
582
582
|
},
|
|
583
583
|
emits: ["update:modelValue", "change", "update:modelOpen"],
|
|
584
|
-
setup(e, { expose: p, emit:
|
|
585
|
-
const o = e, s =
|
|
584
|
+
setup(e, { expose: p, emit: v }) {
|
|
585
|
+
const o = e, s = v, k = [
|
|
586
586
|
[
|
|
587
587
|
{ key: "colorAutomatic", value: "" },
|
|
588
588
|
{ key: "colorLightBlue", value: "#DEEBF7" },
|
|
@@ -713,7 +713,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
713
713
|
], z = se(
|
|
714
714
|
() => o.colorKey === "fill" ? a : k
|
|
715
715
|
);
|
|
716
|
-
function
|
|
716
|
+
function g(Y) {
|
|
717
717
|
return U(o.locale, Y);
|
|
718
718
|
}
|
|
719
719
|
function le(Y) {
|
|
@@ -781,13 +781,13 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
781
781
|
(W(!0), fe(bt, null, Rt(be, (j) => (W(), fe("button", {
|
|
782
782
|
key: j.value,
|
|
783
783
|
class: Pe(["color-picker__swatch", { "color-picker__swatch--selected": le(j.value) }]),
|
|
784
|
-
title:
|
|
784
|
+
title: g(j.key),
|
|
785
785
|
style: nt({
|
|
786
786
|
background: j.value || "transparent",
|
|
787
787
|
border: j.value ? "1px solid rgba(0,0,0,0.15)" : "1px dashed #999"
|
|
788
788
|
}),
|
|
789
789
|
onClick: (Me) => De(j.value)
|
|
790
|
-
}, null, 14,
|
|
790
|
+
}, null, 14, Yo))), 128))
|
|
791
791
|
]))), 128))
|
|
792
792
|
], 36)) : Qe("", !0)
|
|
793
793
|
]),
|
|
@@ -796,10 +796,10 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
796
796
|
]))
|
|
797
797
|
], 512));
|
|
798
798
|
}
|
|
799
|
-
}), Jl = /* @__PURE__ */ Kt(
|
|
799
|
+
}), Jl = /* @__PURE__ */ Kt(Go, [["__scopeId", "data-v-f00d0dae"]]), Xo = ["title", "onClick"], jo = {
|
|
800
800
|
viewBox: "0 0 30 30",
|
|
801
801
|
class: "border-picker__icon"
|
|
802
|
-
},
|
|
802
|
+
}, qo = ["x1", "y1", "x2", "y2", "stroke-width", "stroke-dasharray", "stroke-linecap"], Zo = { class: "border-picker__label" }, Jo = /* @__PURE__ */ $t({
|
|
803
803
|
__name: "borderPicker",
|
|
804
804
|
props: {
|
|
805
805
|
modelOpen: { type: Boolean, default: void 0 },
|
|
@@ -808,8 +808,8 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
808
808
|
triggerEl: { default: null }
|
|
809
809
|
},
|
|
810
810
|
emits: ["update:modelOpen", "change"],
|
|
811
|
-
setup(e, { expose: p, emit:
|
|
812
|
-
const o = e, s =
|
|
811
|
+
setup(e, { expose: p, emit: v }) {
|
|
812
|
+
const o = e, s = v, k = [
|
|
813
813
|
{ key: "bottom", i18nKey: "borderBottom" },
|
|
814
814
|
{ key: "top", i18nKey: "borderTop" },
|
|
815
815
|
{ key: "left", i18nKey: "borderLeft" },
|
|
@@ -834,7 +834,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
834
834
|
all: ["top", "bottom", "left", "right", "vMid", "hMid"],
|
|
835
835
|
outer: ["top", "bottom", "left", "right"],
|
|
836
836
|
thickOuter: ["top", "bottom", "left", "right"]
|
|
837
|
-
},
|
|
837
|
+
}, g = {
|
|
838
838
|
bottom: [],
|
|
839
839
|
top: [],
|
|
840
840
|
left: [],
|
|
@@ -845,7 +845,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
845
845
|
thickOuter: ["top", "bottom", "left", "right"]
|
|
846
846
|
};
|
|
847
847
|
function le(Y, X) {
|
|
848
|
-
return
|
|
848
|
+
return g[Y].includes(X) ? "thick" : z[Y].includes(X) ? "solid" : "dashed";
|
|
849
849
|
}
|
|
850
850
|
const q = V(!1), y = V(null), ae = V(null), L = V({ top: 0 });
|
|
851
851
|
ut(() => o.modelOpen, (Y) => {
|
|
@@ -897,7 +897,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
897
897
|
title: ke(U)(e.locale, be.i18nKey),
|
|
898
898
|
onClick: (F) => De(be.key)
|
|
899
899
|
}, [
|
|
900
|
-
(W(), fe("svg",
|
|
900
|
+
(W(), fe("svg", jo, [
|
|
901
901
|
(W(), fe(bt, null, Rt(a, (F) => b("line", {
|
|
902
902
|
key: F.name,
|
|
903
903
|
x1: F.x1,
|
|
@@ -908,10 +908,10 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
908
908
|
"stroke-width": le(be.key, F.name) === "thick" ? 3 : 1.5,
|
|
909
909
|
"stroke-dasharray": le(be.key, F.name) === "dashed" ? "0 4" : "none",
|
|
910
910
|
"stroke-linecap": le(be.key, F.name) === "dashed" ? "round" : "square"
|
|
911
|
-
}, null, 8,
|
|
911
|
+
}, null, 8, qo)), 64))
|
|
912
912
|
])),
|
|
913
|
-
b("span",
|
|
914
|
-
], 8,
|
|
913
|
+
b("span", Zo, xt(ke(U)(e.locale, be.i18nKey)), 1)
|
|
914
|
+
], 8, Xo)), 64))
|
|
915
915
|
], 36)) : Qe("", !0)
|
|
916
916
|
]),
|
|
917
917
|
_: 1
|
|
@@ -919,7 +919,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
919
919
|
]))
|
|
920
920
|
], 512));
|
|
921
921
|
}
|
|
922
|
-
}),
|
|
922
|
+
}), Qo = /* @__PURE__ */ Kt(Jo, [["__scopeId", "data-v-3721e5e4"]]), _o = ["title", "onClick"], en = ["innerHTML"], tn = { class: "merge-picker__label" }, ln = /* @__PURE__ */ $t({
|
|
923
923
|
__name: "mergePicker",
|
|
924
924
|
props: {
|
|
925
925
|
modelOpen: { type: Boolean, default: void 0 },
|
|
@@ -927,8 +927,8 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
927
927
|
triggerEl: { default: null }
|
|
928
928
|
},
|
|
929
929
|
emits: ["update:modelOpen", "change"],
|
|
930
|
-
setup(e, { expose: p, emit:
|
|
931
|
-
const o = e, s =
|
|
930
|
+
setup(e, { expose: p, emit: v }) {
|
|
931
|
+
const o = e, s = v, k = V(!1), a = V(null), z = V(null), g = V({ top: 0 });
|
|
932
932
|
ut(() => o.modelOpen, (L) => {
|
|
933
933
|
L !== void 0 && L !== k.value && (L ? q() : y());
|
|
934
934
|
});
|
|
@@ -942,7 +942,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
942
942
|
if (L) {
|
|
943
943
|
const f = L.getBoundingClientRect(), Ce = Zl.length * 30 + 12, he = 160;
|
|
944
944
|
let De = window.innerWidth - f.right, Y = f.bottom + 4, X;
|
|
945
|
-
f.left - he < 4 && (De = void 0, X = Math.max(4, f.left)), Y + Ce > window.innerHeight - 4 && (Y = f.top - Ce - 4), Y < 4 && (Y = 4),
|
|
945
|
+
f.left - he < 4 && (De = void 0, X = Math.max(4, f.left)), Y + Ce > window.innerHeight - 4 && (Y = f.top - Ce - 4), Y < 4 && (Y = 4), g.value = De !== void 0 ? { right: De, top: Y } : { left: X, top: Y };
|
|
946
946
|
}
|
|
947
947
|
document.addEventListener("mousedown", le);
|
|
948
948
|
});
|
|
@@ -969,9 +969,9 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
969
969
|
ref: z,
|
|
970
970
|
class: "merge-picker__menu",
|
|
971
971
|
style: nt({
|
|
972
|
-
left:
|
|
973
|
-
right:
|
|
974
|
-
top:
|
|
972
|
+
left: g.value.left !== void 0 ? g.value.left + "px" : void 0,
|
|
973
|
+
right: g.value.right !== void 0 ? g.value.right + "px" : void 0,
|
|
974
|
+
top: g.value.top + "px"
|
|
975
975
|
}),
|
|
976
976
|
onMousedown: f[0] || (f[0] = qe(() => {
|
|
977
977
|
}, ["stop"]))
|
|
@@ -985,9 +985,9 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
985
985
|
b("span", {
|
|
986
986
|
class: "merge-picker__icon",
|
|
987
987
|
innerHTML: Ce.icon
|
|
988
|
-
}, null, 8,
|
|
989
|
-
b("span",
|
|
990
|
-
], 8,
|
|
988
|
+
}, null, 8, en),
|
|
989
|
+
b("span", tn, xt(ke(U)(e.locale, Ce.labelKey)), 1)
|
|
990
|
+
], 8, _o))), 128))
|
|
991
991
|
], 36)) : Qe("", !0)
|
|
992
992
|
]),
|
|
993
993
|
_: 1
|
|
@@ -995,68 +995,68 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
995
995
|
]))
|
|
996
996
|
], 512));
|
|
997
997
|
}
|
|
998
|
-
}),
|
|
998
|
+
}), on = /* @__PURE__ */ Kt(ln, [["__scopeId", "data-v-24e4dbe5"]]), nn = {
|
|
999
999
|
class: "tb-item",
|
|
1000
1000
|
"data-key": "undo"
|
|
1001
|
-
},
|
|
1001
|
+
}, rn = ["title", "disabled"], an = {
|
|
1002
1002
|
class: "tb-item",
|
|
1003
1003
|
"data-key": "redo"
|
|
1004
|
-
},
|
|
1004
|
+
}, cn = ["title", "disabled"], un = {
|
|
1005
1005
|
class: "tb-item",
|
|
1006
1006
|
"data-key": "paint"
|
|
1007
|
-
},
|
|
1007
|
+
}, sn = ["title", "disabled"], dn = {
|
|
1008
1008
|
class: "tb-item",
|
|
1009
1009
|
"data-key": "clear"
|
|
1010
|
-
},
|
|
1010
|
+
}, fn = ["title", "disabled"], vn = {
|
|
1011
1011
|
class: "tb-item",
|
|
1012
1012
|
"data-key": "font"
|
|
1013
|
-
},
|
|
1013
|
+
}, gn = {
|
|
1014
1014
|
class: "tb-item",
|
|
1015
1015
|
"data-key": "fontSize"
|
|
1016
|
-
},
|
|
1016
|
+
}, mn = { class: "toolbar-font-size" }, pn = ["value", "title"], hn = ["title"], bn = ["title", "disabled"], Cn = ["title", "disabled"], yn = {
|
|
1017
1017
|
class: "tb-item",
|
|
1018
1018
|
"data-key": "bold"
|
|
1019
|
-
},
|
|
1019
|
+
}, wn = ["title", "disabled"], kn = {
|
|
1020
1020
|
class: "tb-item",
|
|
1021
1021
|
"data-key": "italic"
|
|
1022
|
-
},
|
|
1022
|
+
}, xn = ["title", "disabled"], Rn = {
|
|
1023
1023
|
class: "tb-item",
|
|
1024
1024
|
"data-key": "underline"
|
|
1025
|
-
},
|
|
1025
|
+
}, Sn = ["title", "disabled"], Mn = {
|
|
1026
1026
|
class: "tb-item",
|
|
1027
1027
|
"data-key": "strike"
|
|
1028
|
-
},
|
|
1028
|
+
}, Bn = ["title", "disabled"], Dn = {
|
|
1029
1029
|
class: "tb-item",
|
|
1030
1030
|
"data-key": "textColor"
|
|
1031
|
-
},
|
|
1031
|
+
}, Fn = { class: "toolbar-split" }, Tn = ["title", "disabled"], En = {
|
|
1032
1032
|
viewBox: "0 0 1024 1024",
|
|
1033
1033
|
fill: "currentColor"
|
|
1034
|
-
},
|
|
1034
|
+
}, Ln = ["fill"], On = ["title", "disabled"], An = {
|
|
1035
1035
|
class: "tb-item",
|
|
1036
1036
|
"data-key": "fillColor"
|
|
1037
|
-
},
|
|
1037
|
+
}, zn = { class: "toolbar-split" }, Hn = ["title", "disabled"], Wn = {
|
|
1038
1038
|
viewBox: "0 0 1024 1024",
|
|
1039
1039
|
fill: "currentColor"
|
|
1040
|
-
},
|
|
1040
|
+
}, In = ["fill"], $n = ["title", "disabled"], Kn = {
|
|
1041
1041
|
class: "tb-item",
|
|
1042
1042
|
"data-key": "border"
|
|
1043
|
-
},
|
|
1043
|
+
}, Nn = { class: "toolbar-split" }, Vn = ["title", "disabled"], Pn = {
|
|
1044
1044
|
viewBox: "0 0 30 30",
|
|
1045
1045
|
fill: "none",
|
|
1046
1046
|
stroke: "currentColor"
|
|
1047
|
-
},
|
|
1047
|
+
}, Un = ["x1", "y1", "x2", "y2", "stroke-width", "stroke-dasharray", "stroke-linecap"], Yn = ["title", "disabled"], Gn = {
|
|
1048
1048
|
class: "tb-item",
|
|
1049
1049
|
"data-key": "hAlign"
|
|
1050
|
-
},
|
|
1050
|
+
}, Xn = {
|
|
1051
1051
|
class: "tb-item",
|
|
1052
1052
|
"data-key": "vAlign"
|
|
1053
|
-
},
|
|
1053
|
+
}, jn = {
|
|
1054
1054
|
class: "tb-item",
|
|
1055
1055
|
"data-key": "wrap"
|
|
1056
|
-
},
|
|
1056
|
+
}, qn = ["title"], Zn = {
|
|
1057
1057
|
class: "tb-item",
|
|
1058
1058
|
"data-key": "merge"
|
|
1059
|
-
},
|
|
1059
|
+
}, Jn = { class: "toolbar-split" }, Qn = ["title", "disabled"], _n = ["title", "disabled"], Al = 2, er = 6, tr = 34, lr = /* @__PURE__ */ $t({
|
|
1060
1060
|
__name: "toolbar",
|
|
1061
1061
|
props: {
|
|
1062
1062
|
locale: {},
|
|
@@ -1092,7 +1092,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1092
1092
|
},
|
|
1093
1093
|
emits: ["undo", "redo", "paint-format", "clear-format", "font-size-blur", "font-size-toggle", "font-size-step-up", "font-size-step-down", "bold-toggle", "italic-toggle", "underline-toggle", "strikethrough-toggle", "apply-text-color", "apply-fill-color", "apply-border", "wrap-toggle", "apply-merge", "font-family-change", "font-size-change", "h-align-change", "v-align-change", "font-size-input", "text-color-change", "fill-color-change", "font-size-keydown", "update:font-size-menu-open", "update:text-color-menu-open", "update:fill-color-menu-open", "update:border-menu-open", "update:merge-menu-open", "border-change", "merge-change"],
|
|
1094
1094
|
setup(e, { emit: p }) {
|
|
1095
|
-
const
|
|
1095
|
+
const v = [
|
|
1096
1096
|
{ name: "top", x1: 4, y1: 4, x2: 26, y2: 4 },
|
|
1097
1097
|
{ name: "bottom", x1: 4, y1: 26, x2: 26, y2: 26 },
|
|
1098
1098
|
{ name: "left", x1: 4, y1: 4, x2: 4, y2: 26 },
|
|
@@ -1143,7 +1143,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1143
1143
|
"vAlign",
|
|
1144
1144
|
"wrap",
|
|
1145
1145
|
"merge"
|
|
1146
|
-
], z = V(null),
|
|
1146
|
+
], z = V(null), g = V(null), le = V(null), q = V(null), y = V(null), ae = V(null), L = V(null), f = V(null), Ce = V(/* @__PURE__ */ new Set()), he = V(!1), De = V(!1), Y = V(0), X = /* @__PURE__ */ new Map(), be = se(() => Ce.value.size > 0);
|
|
1147
1147
|
function F(w) {
|
|
1148
1148
|
return Ce.value.has(w);
|
|
1149
1149
|
}
|
|
@@ -1166,7 +1166,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1166
1166
|
function Be() {
|
|
1167
1167
|
if (!z.value)
|
|
1168
1168
|
return;
|
|
1169
|
-
const w = z.value.clientWidth -
|
|
1169
|
+
const w = z.value.clientWidth - er * 2;
|
|
1170
1170
|
if (w <= 0)
|
|
1171
1171
|
return;
|
|
1172
1172
|
X.size === 0 && j();
|
|
@@ -1175,7 +1175,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1175
1175
|
l += (X.get(I) ?? 0) + Al;
|
|
1176
1176
|
const r = /* @__PURE__ */ new Set();
|
|
1177
1177
|
if (l > w) {
|
|
1178
|
-
const I = w -
|
|
1178
|
+
const I = w - tr - Al;
|
|
1179
1179
|
let E = 0;
|
|
1180
1180
|
for (let $ = 0; $ < a.length; $++) {
|
|
1181
1181
|
const ce = a[$], we = (X.get(ce) ?? 0) + Al;
|
|
@@ -1190,7 +1190,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1190
1190
|
Me(r, Ce.value) || (Ce.value = r, Y.value++, r.size === 0 && (he.value = !1));
|
|
1191
1191
|
}
|
|
1192
1192
|
let oe = null;
|
|
1193
|
-
const c = V(0),
|
|
1193
|
+
const c = V(0), h = se(() => {
|
|
1194
1194
|
const w = le.value, l = { position: "fixed", top: "0px", right: "0px" };
|
|
1195
1195
|
if (!w)
|
|
1196
1196
|
return { ...n.themeVars, ...l };
|
|
@@ -1211,7 +1211,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1211
1211
|
if (!he.value)
|
|
1212
1212
|
return;
|
|
1213
1213
|
const l = w.target;
|
|
1214
|
-
(r =
|
|
1214
|
+
(r = g.value) != null && r.contains(l) || (I = le.value) != null && I.contains(l) || (De.value = !0, he.value = !1, $e(() => {
|
|
1215
1215
|
De.value = !1;
|
|
1216
1216
|
}));
|
|
1217
1217
|
}
|
|
@@ -1236,9 +1236,9 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1236
1236
|
}, [
|
|
1237
1237
|
(W(), Ae(ze, {
|
|
1238
1238
|
disabled: !F("undo"),
|
|
1239
|
-
to:
|
|
1239
|
+
to: g.value ?? void 0
|
|
1240
1240
|
}, [
|
|
1241
|
-
b("div",
|
|
1241
|
+
b("div", nn, [
|
|
1242
1242
|
b("button", {
|
|
1243
1243
|
class: Pe(["toolbar-btn", { "toolbar-btn--disabled": !e.canUndo }]),
|
|
1244
1244
|
title: ke(U)(e.locale, "undo"),
|
|
@@ -1252,14 +1252,14 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1252
1252
|
}, [
|
|
1253
1253
|
b("path", { d: "M596.16 284.064H258.56l101.376-101.44a31.968 31.968 0 1 0-45.248-45.216L178.56 273.504c-11.904 11.872-18.496 27.84-18.56 44.8a63.04 63.04 0 0 0 18.56 45.28l136.128 136.16a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248l-106.752-106.496H596.16c114.88 0 208.32 93.312 208.32 208s-93.44 208-208.32 208h-223.36a32 32 0 0 0 0 64h223.36c150.144 0 272.32-122.016 272.32-272 0-149.984-122.176-272-272.32-272" })
|
|
1254
1254
|
], -1)
|
|
1255
|
-
])], 10,
|
|
1255
|
+
])], 10, rn)
|
|
1256
1256
|
])
|
|
1257
1257
|
], 8, ["disabled", "to"])),
|
|
1258
1258
|
(W(), Ae(ze, {
|
|
1259
1259
|
disabled: !F("redo"),
|
|
1260
|
-
to:
|
|
1260
|
+
to: g.value ?? void 0
|
|
1261
1261
|
}, [
|
|
1262
|
-
b("div",
|
|
1262
|
+
b("div", an, [
|
|
1263
1263
|
b("button", {
|
|
1264
1264
|
class: Pe(["toolbar-btn", { "toolbar-btn--disabled": !e.canRedo }]),
|
|
1265
1265
|
title: ke(U)(e.locale, "redo"),
|
|
@@ -1276,14 +1276,14 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1276
1276
|
d: "M596.16 284.064H258.56l101.376-101.44a31.968 31.968 0 1 0-45.248-45.216L178.56 273.504c-11.904 11.872-18.496 27.84-18.56 44.8a63.04 63.04 0 0 0 18.56 45.28l136.128 136.16a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248l-106.752-106.496H596.16c114.88 0 208.32 93.312 208.32 208s-93.44 208-208.32 208h-223.36a32 32 0 0 0 0 64h223.36c150.144 0 272.32-122.016 272.32-272 0-149.984-122.176-272-272.32-272"
|
|
1277
1277
|
})
|
|
1278
1278
|
], -1)
|
|
1279
|
-
])], 10,
|
|
1279
|
+
])], 10, cn)
|
|
1280
1280
|
])
|
|
1281
1281
|
], 8, ["disabled", "to"])),
|
|
1282
1282
|
(W(), Ae(ze, {
|
|
1283
1283
|
disabled: !F("paint"),
|
|
1284
|
-
to:
|
|
1284
|
+
to: g.value ?? void 0
|
|
1285
1285
|
}, [
|
|
1286
|
-
b("div",
|
|
1286
|
+
b("div", un, [
|
|
1287
1287
|
b("button", {
|
|
1288
1288
|
class: Pe(["toolbar-btn", { "toolbar-btn--active": e.paintFmtActive }]),
|
|
1289
1289
|
title: ke(U)(e.locale, "paintFormat"),
|
|
@@ -1297,14 +1297,14 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1297
1297
|
}, [
|
|
1298
1298
|
b("path", { d: "M722.285714 438.857143a36.571429 36.571429 0 0 1-36.571428 36.571428h-512a36.571429 36.571429 0 0 1-36.571429-36.571428V164.571429a36.571429 36.571429 0 0 1 36.571429-36.571429h512a36.571429 36.571429 0 0 1 36.571428 36.571429V256h128a36.571429 36.571429 0 0 1 36.571429 36.571429v294.4a36.571429 36.571429 0 0 1-31.890286 36.278857L448 675.766857V859.428571a36.571429 36.571429 0 0 1-32.292571 36.315429l-4.278858 0.256a36.571429 36.571429 0 0 1-36.571428-36.571429v-215.771428a36.571429 36.571429 0 0 1 31.890286-36.278857l406.966857-52.553143V329.142857h-91.428572v109.714286z m-73.142857-237.714286h-438.857143V402.285714h438.857143V201.142857z" })
|
|
1299
1299
|
], -1)
|
|
1300
|
-
])], 10,
|
|
1300
|
+
])], 10, sn)
|
|
1301
1301
|
])
|
|
1302
1302
|
], 8, ["disabled", "to"])),
|
|
1303
1303
|
(W(), Ae(ze, {
|
|
1304
1304
|
disabled: !F("clear"),
|
|
1305
|
-
to:
|
|
1305
|
+
to: g.value ?? void 0
|
|
1306
1306
|
}, [
|
|
1307
|
-
b("div",
|
|
1307
|
+
b("div", dn, [
|
|
1308
1308
|
b("button", {
|
|
1309
1309
|
class: Pe(["toolbar-btn", { "toolbar-btn--disabled": !e.hasSelection }]),
|
|
1310
1310
|
title: ke(U)(e.locale, "clearFormat"),
|
|
@@ -1318,12 +1318,12 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1318
1318
|
}, [
|
|
1319
1319
|
b("path", { d: "M672.748 105.674c-3.666-3.799-8.778-5.949-14.125-5.949-5.341 0-10.459 2.15-14.119 5.949L10.418 754.633c-7.789 8.163-7.789 20.798 0 28.967l123.353 126.213c7.782 7.979 23.113 14.461 34.111 14.461h395.042c12.774-0.742 24.882-5.854 34.162-14.461l416.525-426.362c7.751-8.163 7.751-20.76 0-28.916l-340.92-348.861h0.057zM557.85 832.801c-9.273 8.582-21.343 13.707-34.111 14.461H217.888c-12.781-0.742-24.882-5.867-34.162-14.461l-58.074-59.482c-7.782-8.163-7.782-20.804 0-28.967l232.333-237.87c3.666-3.799 8.778-5.949 14.125-5.949s10.453 2.15 14.119 5.949l231.102 236.551c7.744 8.157 7.744 20.753 0 28.916l-59.539 60.909 0.058-0.057z m0 0" })
|
|
1320
1320
|
], -1)
|
|
1321
|
-
])], 10,
|
|
1321
|
+
])], 10, fn)
|
|
1322
1322
|
])
|
|
1323
1323
|
], 8, ["disabled", "to"])),
|
|
1324
1324
|
(W(), Ae(ze, {
|
|
1325
1325
|
disabled: !F("sep1"),
|
|
1326
|
-
to:
|
|
1326
|
+
to: g.value ?? void 0
|
|
1327
1327
|
}, [
|
|
1328
1328
|
l[43] || (l[43] = b("div", {
|
|
1329
1329
|
class: "tb-item",
|
|
@@ -1334,9 +1334,9 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1334
1334
|
], 8, ["disabled", "to"])),
|
|
1335
1335
|
(W(), Ae(ze, {
|
|
1336
1336
|
disabled: !F("font"),
|
|
1337
|
-
to:
|
|
1337
|
+
to: g.value ?? void 0
|
|
1338
1338
|
}, [
|
|
1339
|
-
b("div",
|
|
1339
|
+
b("div", vn, [
|
|
1340
1340
|
Je(Rl, {
|
|
1341
1341
|
class: "toolbar-font",
|
|
1342
1342
|
"model-value": e.selFontFamily,
|
|
@@ -1345,16 +1345,17 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1345
1345
|
"menu-width": F("font") ? 120 : void 0,
|
|
1346
1346
|
"visible-count": 8,
|
|
1347
1347
|
title: ke(U)(e.locale, "fontFamily"),
|
|
1348
|
+
align: "right",
|
|
1348
1349
|
onChange: l[4] || (l[4] = (r) => d("font-family-change", r))
|
|
1349
1350
|
}, null, 8, ["model-value", "options", "width", "menu-width", "title"])
|
|
1350
1351
|
])
|
|
1351
1352
|
], 8, ["disabled", "to"])),
|
|
1352
1353
|
(W(), Ae(ze, {
|
|
1353
1354
|
disabled: !F("fontSize"),
|
|
1354
|
-
to:
|
|
1355
|
+
to: g.value ?? void 0
|
|
1355
1356
|
}, [
|
|
1356
|
-
b("div",
|
|
1357
|
-
b("div",
|
|
1357
|
+
b("div", gn, [
|
|
1358
|
+
b("div", mn, [
|
|
1358
1359
|
b("input", {
|
|
1359
1360
|
class: "toolbar-font-size__input",
|
|
1360
1361
|
type: "number",
|
|
@@ -1366,7 +1367,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1366
1367
|
onInput: l[5] || (l[5] = (r) => d("font-size-input", r.target.value)),
|
|
1367
1368
|
onBlur: l[6] || (l[6] = (r) => d("font-size-blur")),
|
|
1368
1369
|
onKeydown: l[7] || (l[7] = (r) => d("font-size-keydown", r))
|
|
1369
|
-
}, null, 40,
|
|
1370
|
+
}, null, 40, pn),
|
|
1370
1371
|
Je(Rl, {
|
|
1371
1372
|
class: "toolbar-font-size__dropdown",
|
|
1372
1373
|
"model-value": e.selFontSize,
|
|
@@ -1377,6 +1378,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1377
1378
|
title: ke(U)(e.locale, "fontSize"),
|
|
1378
1379
|
"hide-trigger": !0,
|
|
1379
1380
|
"model-open": e.fontSizeMenuOpen,
|
|
1381
|
+
align: "right",
|
|
1380
1382
|
"trigger-el": f.value,
|
|
1381
1383
|
"onUpdate:modelOpen": l[8] || (l[8] = (r) => d("update:font-size-menu-open", r)),
|
|
1382
1384
|
onChange: l[9] || (l[9] = (r) => d("font-size-change", r))
|
|
@@ -1397,7 +1399,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1397
1399
|
}, [
|
|
1398
1400
|
b("path", { d: "M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z" })
|
|
1399
1401
|
], -1)
|
|
1400
|
-
])], 40,
|
|
1402
|
+
])], 40, hn),
|
|
1401
1403
|
b("button", {
|
|
1402
1404
|
class: "toolbar-btn toolbar-btn--step",
|
|
1403
1405
|
type: "button",
|
|
@@ -1413,7 +1415,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1413
1415
|
}, [
|
|
1414
1416
|
b("path", { d: "M481.28 125.95a29.506 29.506 0 0 0-27.45-18.7h-63.34c-12.13 0-23.02 7.42-27.45 18.7L67.94 876.46c-7.61 19.35 6.66 40.29 27.45 40.29h35.47c12.26 0 23.24-7.58 27.58-19.04l80.89-213.35h364.54l81.94 213.46a29.51 29.51 0 0 0 27.54 18.93h35.56c20.8 0 35.06-20.94 27.45-40.29L481.28 125.95zM273.47 594.06l145.38-384.38h2.2l147.58 384.38H273.47zM928.64 195.74h-177c-16.29 0-29.5 13.21-29.5 29.5s13.21 29.5 29.5 29.5h177c16.29 0 29.5-13.21 29.5-29.5s-13.21-29.5-29.5-29.5z" })
|
|
1415
1417
|
], -1)
|
|
1416
|
-
])], 40,
|
|
1418
|
+
])], 40, bn),
|
|
1417
1419
|
b("button", {
|
|
1418
1420
|
class: "toolbar-btn toolbar-btn--step",
|
|
1419
1421
|
type: "button",
|
|
@@ -1429,13 +1431,13 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1429
1431
|
}, [
|
|
1430
1432
|
b("path", { d: "M481.28 125.95a29.506 29.506 0 0 0-27.45-18.7h-63.34c-12.13 0-23.02 7.42-27.45 18.7L67.94 876.46c-7.61 19.35 6.66 40.29 27.45 40.29h35.47c12.26 0 23.24-7.58 27.58-19.04l80.89-213.35h364.54l81.94 213.46a29.51 29.51 0 0 0 27.54 18.93h35.56c20.8 0 35.06-20.94 27.45-40.29L481.28 125.95zM273.47 594.06l145.38-384.38h2.2l147.58 384.38H273.47zM928.64 195.74h-59v-59c0-16.29-13.21-29.5-29.5-29.5s-29.5 13.21-29.5 29.5v59h-59c-16.29 0-29.5 13.21-29.5 29.5s13.21 29.5 29.5 29.5h59v59c0 16.29 13.21 29.5 29.5 29.5s29.5-13.21 29.5-29.5v-59h59c16.29 0 29.5-13.21 29.5-29.5s-13.21-29.5-29.5-29.5z" })
|
|
1431
1433
|
], -1)
|
|
1432
|
-
])], 40,
|
|
1434
|
+
])], 40, Cn)
|
|
1433
1435
|
])
|
|
1434
1436
|
])
|
|
1435
1437
|
], 8, ["disabled", "to"])),
|
|
1436
1438
|
(W(), Ae(ze, {
|
|
1437
1439
|
disabled: !F("sep2"),
|
|
1438
|
-
to:
|
|
1440
|
+
to: g.value ?? void 0
|
|
1439
1441
|
}, [
|
|
1440
1442
|
l[47] || (l[47] = b("div", {
|
|
1441
1443
|
class: "tb-item",
|
|
@@ -1446,9 +1448,9 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1446
1448
|
], 8, ["disabled", "to"])),
|
|
1447
1449
|
(W(), Ae(ze, {
|
|
1448
1450
|
disabled: !F("bold"),
|
|
1449
|
-
to:
|
|
1451
|
+
to: g.value ?? void 0
|
|
1450
1452
|
}, [
|
|
1451
|
-
b("div",
|
|
1453
|
+
b("div", yn, [
|
|
1452
1454
|
b("button", {
|
|
1453
1455
|
class: Pe(["toolbar-btn", { "toolbar-btn--active": e.selFontWeight }]),
|
|
1454
1456
|
title: ke(U)(e.locale, "bold"),
|
|
@@ -1463,14 +1465,14 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1463
1465
|
b("path", { d: "M733.610667 467.712A267.562667 267.562667 0 0 0 548.010667 10.581333H183.466667a53.333333 53.333333 0 0 0 0 106.666667h43.221333a10.666667 10.666667 0 0 1 10.666667 10.666667V896a10.666667 10.666667 0 0 1-10.666667 10.666667H183.466667a53.333333 53.333333 0 1 0 0 106.666666h425.088a287.658667 287.658667 0 0 0 125.013333-545.536z m-185.6-350.464a160.512 160.512 0 0 1 0 320.981333H354.688a10.666667 10.666667 0 0 1-10.666667-10.666666V128a10.666667 10.666667 0 0 1 10.666667-10.666667z m60.586666 789.333333H354.688a10.666667 10.666667 0 0 1-10.666667-10.666666v-340.352a10.666667 10.666667 0 0 1 10.666667-10.666667H608.597333a180.864 180.864 0 0 1 0 361.685333z" })
|
|
1464
1466
|
])
|
|
1465
1467
|
], -1)
|
|
1466
|
-
])], 10,
|
|
1468
|
+
])], 10, wn)
|
|
1467
1469
|
])
|
|
1468
1470
|
], 8, ["disabled", "to"])),
|
|
1469
1471
|
(W(), Ae(ze, {
|
|
1470
1472
|
disabled: !F("italic"),
|
|
1471
|
-
to:
|
|
1473
|
+
to: g.value ?? void 0
|
|
1472
1474
|
}, [
|
|
1473
|
-
b("div",
|
|
1475
|
+
b("div", kn, [
|
|
1474
1476
|
b("button", {
|
|
1475
1477
|
class: Pe(["toolbar-btn", { "toolbar-btn--active": e.selFontStyle }]),
|
|
1476
1478
|
title: ke(U)(e.locale, "italic"),
|
|
@@ -1485,14 +1487,14 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1485
1487
|
b("path", { d: "M960 10.581333h-325.845333a53.333333 53.333333 0 0 0 0 106.666667h46.336a10.666667 10.666667 0 0 1 9.002666 16.384L203.946667 896.725333a21.333333 21.333333 0 0 1-18.005334 9.856H64a53.333333 53.333333 0 0 0 0 106.666667h325.845333a53.333333 53.333333 0 0 0 0-106.666667H343.509333a10.666667 10.666667 0 0 1-9.002666-16.384L820.053333 127.146667a21.333333 21.333333 0 0 1 18.005334-9.898667H960a53.333333 53.333333 0 0 0 0-106.666667z" })
|
|
1486
1488
|
])
|
|
1487
1489
|
], -1)
|
|
1488
|
-
])], 10,
|
|
1490
|
+
])], 10, xn)
|
|
1489
1491
|
])
|
|
1490
1492
|
], 8, ["disabled", "to"])),
|
|
1491
1493
|
(W(), Ae(ze, {
|
|
1492
1494
|
disabled: !F("underline"),
|
|
1493
|
-
to:
|
|
1495
|
+
to: g.value ?? void 0
|
|
1494
1496
|
}, [
|
|
1495
|
-
b("div",
|
|
1497
|
+
b("div", Rn, [
|
|
1496
1498
|
b("button", {
|
|
1497
1499
|
class: Pe(["toolbar-btn", { "toolbar-btn--active": e.selUnderline }]),
|
|
1498
1500
|
title: ke(U)(e.locale, "underline"),
|
|
@@ -1507,14 +1509,14 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1507
1509
|
b("path", { d: "M960 906.581333h-896a53.333333 53.333333 0 0 0 0 106.666667h896a53.333333 53.333333 0 0 0 0-106.666667zM84.394667 117.248h58.154666a10.666667 10.666667 0 0 1 10.666667 10.666667v363.648a358.784 358.784 0 0 0 717.568 0V128a10.666667 10.666667 0 0 1 10.666667-10.666667h58.154666a53.333333 53.333333 0 0 0 0-106.666666H695.466667a53.333333 53.333333 0 0 0 0 106.666666h58.154666a10.666667 10.666667 0 0 1 10.666667 10.666667v363.648a252.117333 252.117333 0 0 1-504.234667 0V128a10.666667 10.666667 0 0 1 10.666667-10.666667H328.533333a53.333333 53.333333 0 1 0 0-106.666666H84.394667a53.333333 53.333333 0 0 0 0 106.666666z" })
|
|
1508
1510
|
])
|
|
1509
1511
|
], -1)
|
|
1510
|
-
])], 10,
|
|
1512
|
+
])], 10, Sn)
|
|
1511
1513
|
])
|
|
1512
1514
|
], 8, ["disabled", "to"])),
|
|
1513
1515
|
(W(), Ae(ze, {
|
|
1514
1516
|
disabled: !F("strike"),
|
|
1515
|
-
to:
|
|
1517
|
+
to: g.value ?? void 0
|
|
1516
1518
|
}, [
|
|
1517
|
-
b("div",
|
|
1519
|
+
b("div", Mn, [
|
|
1518
1520
|
b("button", {
|
|
1519
1521
|
class: Pe(["toolbar-btn", { "toolbar-btn--active": e.selStrikethrough }]),
|
|
1520
1522
|
title: ke(U)(e.locale, "strikethrough"),
|
|
@@ -1529,12 +1531,12 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1529
1531
|
b("path", { d: "M1013.333333 552.618667A53.333333 53.333333 0 0 0 960 499.2h-381.269333a20.992 20.992 0 0 1-12.032-3.84c-30.805333-21.888-63.232-41.856-94.634667-61.098667-119.466667-73.173333-192-123.733333-192-207.488 0-95.36 94.165333-109.610667 150.314667-109.610666a193.706667 193.706667 0 0 1 131.456 32.597333 113.578667 113.578667 0 0 1 19.072 84.906667v12.8a53.333333 53.333333 0 1 0 106.666666 0v-11.434667a208.512 208.512 0 0 0-49.706666-161.152C595.157333 31.616 527.317333 10.581333 430.549333 10.581333c-156.074667 0-256.981333 84.864-256.981333 216.277334 0 118.314667 80.725333 192.512 170.666667 252.885333a10.666667 10.666667 0 0 1-5.930667 19.541333H64a53.333333 53.333333 0 0 0 0 106.666667h468.352a10.709333 10.709333 0 0 1 6.784 2.474667 185.130667 185.130667 0 0 1 82.432 147.882666c0 139.434667-146.176 150.272-191.018667 150.272-77.397333 0-133.930667-17.28-163.584-50.048a144.810667 144.810667 0 0 1-27.733333-115.2 53.333333 53.333333 0 0 0-106.154667-10.496A245.76 245.76 0 0 0 187.733333 928.128c51.2 56.490667 132.864 85.333333 242.688 85.333333 178.090667 0 297.685333-103.253333 297.685334-256.938666a258.517333 258.517333 0 0 0-36.224-134.272 10.666667 10.666667 0 0 1 9.216-16.085334H960a53.333333 53.333333 0 0 0 53.333333-53.546666z" })
|
|
1530
1532
|
])
|
|
1531
1533
|
], -1)
|
|
1532
|
-
])], 10,
|
|
1534
|
+
])], 10, Bn)
|
|
1533
1535
|
])
|
|
1534
1536
|
], 8, ["disabled", "to"])),
|
|
1535
1537
|
(W(), Ae(ze, {
|
|
1536
1538
|
disabled: !F("sep3"),
|
|
1537
|
-
to:
|
|
1539
|
+
to: g.value ?? void 0
|
|
1538
1540
|
}, [
|
|
1539
1541
|
l[52] || (l[52] = b("div", {
|
|
1540
1542
|
class: "tb-item",
|
|
@@ -1545,26 +1547,26 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1545
1547
|
], 8, ["disabled", "to"])),
|
|
1546
1548
|
(W(), Ae(ze, {
|
|
1547
1549
|
disabled: !F("textColor"),
|
|
1548
|
-
to:
|
|
1550
|
+
to: g.value ?? void 0
|
|
1549
1551
|
}, [
|
|
1550
|
-
b("div",
|
|
1551
|
-
b("div",
|
|
1552
|
+
b("div", Dn, [
|
|
1553
|
+
b("div", Fn, [
|
|
1552
1554
|
b("button", {
|
|
1553
1555
|
class: "toolbar-btn toolbar-split__main",
|
|
1554
1556
|
title: ke(U)(e.locale, "fontColor"),
|
|
1555
1557
|
disabled: !e.hasSelection,
|
|
1556
1558
|
onClick: l[20] || (l[20] = (r) => d("apply-text-color"))
|
|
1557
1559
|
}, [
|
|
1558
|
-
(W(), fe("svg",
|
|
1560
|
+
(W(), fe("svg", En, [
|
|
1559
1561
|
l[53] || (l[53] = b("g", { transform: "translate(102.4, 102.4) scale(0.8)" }, [
|
|
1560
1562
|
b("path", { d: "M663.120842 529.946947H364.759579l-84.07579 212.884211a53.894737 53.894737 0 0 1-50.122105 34.169263h-14.551579a34.869895 34.869895 0 0 1-32.498526-47.696842L443.715368 70.063158a53.894737 53.894737 0 0 1 50.122106-34.115369h41.768421a53.894737 53.894737 0 0 1 50.176 34.277053l257.670737 659.078737a34.977684 34.977684 0 0 1-32.552421 47.696842h-14.389895a53.894737 53.894737 0 0 1-50.229895-34.277053l-83.159579-212.776421z m-35.139368-89.788631l-113.340632-289.953684-114.472421 289.953684h227.813053z" })
|
|
1561
1563
|
], -1)),
|
|
1562
1564
|
b("path", {
|
|
1563
1565
|
d: "M62.895 844.369m53.895 0l790.474 0q53.895 0 53.895 53.895l0 26.947q0 53.895-53.895 53.895l-790.474 0q-53.895 0-53.895-53.895l0-26.947q0-53.895 53.895-53.895z",
|
|
1564
1566
|
fill: e.cachedTextColor || "#000000"
|
|
1565
|
-
}, null, 8,
|
|
1567
|
+
}, null, 8, Ln)
|
|
1566
1568
|
]))
|
|
1567
|
-
], 8,
|
|
1569
|
+
], 8, Tn),
|
|
1568
1570
|
b("button", {
|
|
1569
1571
|
ref_key: "textColorArrowRef",
|
|
1570
1572
|
ref: q,
|
|
@@ -1579,7 +1581,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1579
1581
|
}, [
|
|
1580
1582
|
b("path", { d: "M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z" })
|
|
1581
1583
|
], -1)
|
|
1582
|
-
])], 8,
|
|
1584
|
+
])], 8, On),
|
|
1583
1585
|
Je(Jl, {
|
|
1584
1586
|
"model-open": e.textColorMenuOpen,
|
|
1585
1587
|
"color-key": "text",
|
|
@@ -1594,24 +1596,24 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1594
1596
|
], 8, ["disabled", "to"])),
|
|
1595
1597
|
(W(), Ae(ze, {
|
|
1596
1598
|
disabled: !F("fillColor"),
|
|
1597
|
-
to:
|
|
1599
|
+
to: g.value ?? void 0
|
|
1598
1600
|
}, [
|
|
1599
|
-
b("div",
|
|
1600
|
-
b("div",
|
|
1601
|
+
b("div", An, [
|
|
1602
|
+
b("div", zn, [
|
|
1601
1603
|
b("button", {
|
|
1602
1604
|
class: "toolbar-btn toolbar-split__main",
|
|
1603
1605
|
title: ke(U)(e.locale, "fillColor"),
|
|
1604
1606
|
disabled: !e.hasSelection,
|
|
1605
1607
|
onClick: l[24] || (l[24] = (r) => d("apply-fill-color"))
|
|
1606
1608
|
}, [
|
|
1607
|
-
(W(), fe("svg",
|
|
1609
|
+
(W(), fe("svg", Wn, [
|
|
1608
1610
|
l[55] || (l[55] = b("path", { d: "M447.018667 37.952l352.298666 352.298667c6.613333 6.613333 6.613333 17.344 0 23.957333L446.101333 767.424a16.938667 16.938667 0 0 1-23.957333 0L121.429333 466.688a16.938667 16.938667 0 0 1 0-23.957333L428.608 135.552 388.992 96a8.469333 8.469333 0 0 1 0-11.989333l46.058667-46.037334a8.469333 8.469333 0 0 1 11.968 0z m346.325333 517.461333l57.514667 60.074667c31.744 33.194667 31.744 86.997333 0 120.192a78.869333 78.869333 0 0 1-115.008 0c-31.765333-33.194667-31.765333-86.997333 0-120.192l57.493333-60.074667zM486.101333 193.066667l-261.12 261.12 20.458667 20.458666 380.16-1.728 70.186667-70.186666-209.706667-209.664z" }, null, -1)),
|
|
1609
1611
|
b("path", {
|
|
1610
1612
|
d: "M85.333333 853.333333m8.896 0l835.541334 0q8.896 0 8.896 8.896l0 110.208q0 8.896-8.896 8.896l-835.541334 0q-8.896 0-8.896-8.896l0-110.208q0-8.896 8.896-8.896Z",
|
|
1611
1613
|
fill: e.cachedFillColor || "currentColor"
|
|
1612
|
-
}, null, 8,
|
|
1614
|
+
}, null, 8, In)
|
|
1613
1615
|
]))
|
|
1614
|
-
], 8,
|
|
1616
|
+
], 8, Hn),
|
|
1615
1617
|
b("button", {
|
|
1616
1618
|
ref_key: "fillColorArrowRef",
|
|
1617
1619
|
ref: y,
|
|
@@ -1626,7 +1628,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1626
1628
|
}, [
|
|
1627
1629
|
b("path", { d: "M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z" })
|
|
1628
1630
|
], -1)
|
|
1629
|
-
])], 8,
|
|
1631
|
+
])], 8, $n),
|
|
1630
1632
|
Je(Jl, {
|
|
1631
1633
|
"model-open": e.fillColorMenuOpen,
|
|
1632
1634
|
"color-key": "fill",
|
|
@@ -1641,18 +1643,18 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1641
1643
|
], 8, ["disabled", "to"])),
|
|
1642
1644
|
(W(), Ae(ze, {
|
|
1643
1645
|
disabled: !F("border"),
|
|
1644
|
-
to:
|
|
1646
|
+
to: g.value ?? void 0
|
|
1645
1647
|
}, [
|
|
1646
|
-
b("div",
|
|
1647
|
-
b("div",
|
|
1648
|
+
b("div", Kn, [
|
|
1649
|
+
b("div", Nn, [
|
|
1648
1650
|
b("button", {
|
|
1649
1651
|
class: "toolbar-btn toolbar-split__main",
|
|
1650
1652
|
title: ke(U)(e.locale, "borders"),
|
|
1651
1653
|
disabled: !e.hasSelection,
|
|
1652
1654
|
onClick: l[28] || (l[28] = (r) => d("apply-border"))
|
|
1653
1655
|
}, [
|
|
1654
|
-
(W(), fe("svg",
|
|
1655
|
-
(W(), fe(bt, null, Rt(
|
|
1656
|
+
(W(), fe("svg", Pn, [
|
|
1657
|
+
(W(), fe(bt, null, Rt(v, (r) => b("line", {
|
|
1656
1658
|
key: r.name,
|
|
1657
1659
|
x1: r.x1,
|
|
1658
1660
|
y1: r.y1,
|
|
@@ -1661,9 +1663,9 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1661
1663
|
"stroke-width": k(e.cachedBorder, r.name) === "thick" ? 3 : 1.5,
|
|
1662
1664
|
"stroke-dasharray": k(e.cachedBorder, r.name) === "dashed" ? "0 4" : "none",
|
|
1663
1665
|
"stroke-linecap": k(e.cachedBorder, r.name) === "dashed" ? "round" : "square"
|
|
1664
|
-
}, null, 8,
|
|
1666
|
+
}, null, 8, Un)), 64))
|
|
1665
1667
|
]))
|
|
1666
|
-
], 8,
|
|
1668
|
+
], 8, Vn),
|
|
1667
1669
|
b("button", {
|
|
1668
1670
|
ref_key: "borderArrowRef",
|
|
1669
1671
|
ref: ae,
|
|
@@ -1678,8 +1680,8 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1678
1680
|
}, [
|
|
1679
1681
|
b("path", { d: "M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z" })
|
|
1680
1682
|
], -1)
|
|
1681
|
-
])], 8,
|
|
1682
|
-
Je(
|
|
1683
|
+
])], 8, Yn),
|
|
1684
|
+
Je(Qo, {
|
|
1683
1685
|
"model-open": e.borderMenuOpen,
|
|
1684
1686
|
locale: e.locale,
|
|
1685
1687
|
"current-border": e.cachedBorder,
|
|
@@ -1692,7 +1694,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1692
1694
|
], 8, ["disabled", "to"])),
|
|
1693
1695
|
(W(), Ae(ze, {
|
|
1694
1696
|
disabled: !F("sep4"),
|
|
1695
|
-
to:
|
|
1697
|
+
to: g.value ?? void 0
|
|
1696
1698
|
}, [
|
|
1697
1699
|
l[58] || (l[58] = b("div", {
|
|
1698
1700
|
class: "tb-item",
|
|
@@ -1703,9 +1705,9 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1703
1705
|
], 8, ["disabled", "to"])),
|
|
1704
1706
|
(W(), Ae(ze, {
|
|
1705
1707
|
disabled: !F("hAlign"),
|
|
1706
|
-
to:
|
|
1708
|
+
to: g.value ?? void 0
|
|
1707
1709
|
}, [
|
|
1708
|
-
b("div",
|
|
1710
|
+
b("div", Gn, [
|
|
1709
1711
|
Je(Rl, {
|
|
1710
1712
|
class: "toolbar-align",
|
|
1711
1713
|
"model-value": e.selHAlign,
|
|
@@ -1721,9 +1723,9 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1721
1723
|
], 8, ["disabled", "to"])),
|
|
1722
1724
|
(W(), Ae(ze, {
|
|
1723
1725
|
disabled: !F("vAlign"),
|
|
1724
|
-
to:
|
|
1726
|
+
to: g.value ?? void 0
|
|
1725
1727
|
}, [
|
|
1726
|
-
b("div",
|
|
1728
|
+
b("div", Xn, [
|
|
1727
1729
|
Je(Rl, {
|
|
1728
1730
|
class: "toolbar-align",
|
|
1729
1731
|
"model-value": e.selVAlign,
|
|
@@ -1736,7 +1738,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1736
1738
|
onChange: l[33] || (l[33] = (r) => d("v-align-change", r))
|
|
1737
1739
|
}, null, 8, ["model-value", "options", "width", "menu-width", "title"])
|
|
1738
1740
|
]),
|
|
1739
|
-
b("div",
|
|
1741
|
+
b("div", jn, [
|
|
1740
1742
|
b("button", {
|
|
1741
1743
|
class: Pe(["toolbar-btn", { "toolbar-btn--active": e.selWrap }]),
|
|
1742
1744
|
type: "button",
|
|
@@ -1749,15 +1751,15 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1749
1751
|
}, [
|
|
1750
1752
|
b("path", { d: "M896 179.2a38.4 38.4 0 0 0-76.8 0v665.6a38.4 38.4 0 0 0 76.8 0v-665.6zM204.8 281.6A38.4 38.4 0 0 0 204.8 358.4h179.2a38.4 38.4 0 0 0 0-76.8H204.8zM550.4 281.6a38.4 38.4 0 0 0 0 76.8h51.2c35.328 0 64 28.672 64 64v179.2c0 35.328-28.672 64-64 64H246.272l36.864-36.864a38.4 38.4 0 1 0-54.272-54.272l-102.4 102.4a38.4 38.4 0 0 0 0 54.272l102.4 102.4a38.4 38.4 0 0 0 54.272-54.272l-36.864-36.864h355.328a140.8 140.8 0 0 0 140.8-140.8v-179.2a140.8 140.8 0 0 0-140.8-140.8h-51.2z" })
|
|
1751
1753
|
], -1)
|
|
1752
|
-
])], 10,
|
|
1754
|
+
])], 10, qn)
|
|
1753
1755
|
])
|
|
1754
1756
|
], 8, ["disabled", "to"])),
|
|
1755
1757
|
(W(), Ae(ze, {
|
|
1756
1758
|
disabled: !F("merge"),
|
|
1757
|
-
to:
|
|
1759
|
+
to: g.value ?? void 0
|
|
1758
1760
|
}, [
|
|
1759
|
-
b("div",
|
|
1760
|
-
b("div",
|
|
1761
|
+
b("div", Zn, [
|
|
1762
|
+
b("div", Jn, [
|
|
1761
1763
|
b("button", {
|
|
1762
1764
|
class: "toolbar-btn toolbar-split__main",
|
|
1763
1765
|
title: ke(U)(e.locale, "mergeCenter"),
|
|
@@ -1770,7 +1772,7 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1770
1772
|
}, [
|
|
1771
1773
|
b("path", { d: "M709.952 465.92l88-76.032C801.92 385.984 806.656 384 812.032 384s10.048 1.984 14.08 5.952C830.08 393.92 832 398.656 832 403.968L832 448l32 0C881.664 448 896 462.336 896 480S881.664 512 864 512L832 512l0 44.032c0 5.376-1.92 10.112-5.952 14.08C822.08 574.08 817.344 576 812.032 576s-10.048-1.92-14.08-5.952L709.952 494.08C705.984 490.112 704 485.376 704 480S705.984 469.952 709.952 465.92zM378.048 465.92 290.048 389.952C286.08 385.984 281.344 384 275.968 384s-10.048 1.984-14.08 5.952C257.92 393.92 256 398.656 256 403.968L256 448 224 448C206.336 448 192 462.336 192 480S206.336 512 224 512L256 512l0 44.032c0 5.376 1.92 10.112 5.952 14.08C265.92 574.08 270.656 576 275.968 576s10.048-1.92 14.08-5.952L378.048 494.08C382.016 490.112 384 485.376 384 480S382.016 469.952 378.048 465.92zM448 128 128 128l0 704 320 0 0-128 64 0 0 128c0 35.392-28.608 64-64 64L128 896c-35.392 0-64-28.608-64-64L64 128c0-35.392 28.608-64 64-64l320 0 0 0c35.392 0 64 28.608 64 64l0 128L448 256 448 128M640 128l320 0 0 704-320 0 0-128L576 704l0 128c0 35.392 28.608 64 64 64l320 0c35.392 0 64-28.608 64-64L1024 128c0-35.392-28.608-64-64-64l-320 0 0 0C604.608 64 576 92.608 576 128l0 128 64 0L640 128M722.304 642.304c0 8.512-3.52 16.32-10.496 23.36s-15.424 10.624-25.344 10.624c-5.76 0-10.688-1.088-14.72-3.136-4.096-2.048-7.616-4.928-10.432-8.512s-5.824-9.088-9.024-16.512-5.952-13.952-8.32-19.648l-17.28-46.016L479.36 582.464 462.08 629.568c-6.72 18.304-12.48 30.656-17.344 37.12s-12.544 9.6-23.424 9.6c-9.28 0-17.408-3.456-24.512-10.24s-10.624-14.592-10.624-23.232c0-4.992 0.896-10.176 2.496-15.488S393.024 614.592 396.8 605.056l92.672-238.016C492.096 360.256 495.296 352 499.008 342.464s7.68-17.536 11.904-23.872 9.664-11.456 16.576-15.36c6.784-3.968 15.232-5.888 25.344-5.888 10.176 0 18.752 1.92 25.472 5.888 6.848 3.968 12.352 8.96 16.64 15.104 4.096 6.208 7.744 12.8 10.624 19.904s6.528 16.576 11.008 28.352l94.656 236.48C718.592 621.056 722.304 634.112 722.304 642.304zM606.912 526.784 552.32 375.552 498.624 526.784 606.912 526.784z" })
|
|
1772
1774
|
], -1)
|
|
1773
|
-
])], 8,
|
|
1775
|
+
])], 8, Qn),
|
|
1774
1776
|
b("button", {
|
|
1775
1777
|
ref_key: "mergeArrowRef",
|
|
1776
1778
|
ref: L,
|
|
@@ -1785,8 +1787,8 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1785
1787
|
}, [
|
|
1786
1788
|
b("path", { d: "M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z" })
|
|
1787
1789
|
], -1)
|
|
1788
|
-
])], 8,
|
|
1789
|
-
Je(
|
|
1790
|
+
])], 8, _n),
|
|
1791
|
+
Je(on, {
|
|
1790
1792
|
"model-open": e.mergeMenuOpen,
|
|
1791
1793
|
locale: e.locale,
|
|
1792
1794
|
"trigger-el": L.value,
|
|
@@ -1831,10 +1833,10 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1831
1833
|
default: It(() => [
|
|
1832
1834
|
vo((W(), fe("div", {
|
|
1833
1835
|
ref_key: "overflowMenuEl",
|
|
1834
|
-
ref:
|
|
1836
|
+
ref: g,
|
|
1835
1837
|
key: Y.value,
|
|
1836
1838
|
class: Pe(["overflow-menu", { "no-anim": De.value }]),
|
|
1837
|
-
style: nt(
|
|
1839
|
+
style: nt(h.value)
|
|
1838
1840
|
}, null, 6)), [
|
|
1839
1841
|
[go, he.value]
|
|
1840
1842
|
])
|
|
@@ -1844,10 +1846,10 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1844
1846
|
]))
|
|
1845
1847
|
], 64));
|
|
1846
1848
|
}
|
|
1847
|
-
}),
|
|
1849
|
+
}), or = /* @__PURE__ */ Kt(lr, [["__scopeId", "data-v-b7edb6bc"]]), nr = { class: "tab-list" }, rr = ["onClick", "onDblclick", "onContextmenu"], ar = ["value"], ir = {
|
|
1848
1850
|
key: 1,
|
|
1849
1851
|
class: "tab-item__name"
|
|
1850
|
-
},
|
|
1852
|
+
}, cr = ["title"], ur = /* @__PURE__ */ $t({
|
|
1851
1853
|
__name: "tabbar",
|
|
1852
1854
|
props: {
|
|
1853
1855
|
locale: {},
|
|
@@ -1858,50 +1860,50 @@ const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1858
1860
|
},
|
|
1859
1861
|
emits: ["tab-click", "tab-dblclick", "tab-contextmenu", "tab-rename-input", "tab-rename-keydown", "tab-rename-commit", "add-sheet", "tabbar-contextmenu"],
|
|
1860
1862
|
setup(e, { emit: p }) {
|
|
1861
|
-
const
|
|
1863
|
+
const v = p;
|
|
1862
1864
|
return (o, s) => (W(), fe("div", {
|
|
1863
1865
|
class: "tab-bar",
|
|
1864
|
-
onContextmenu: s[5] || (s[5] = (k) =>
|
|
1866
|
+
onContextmenu: s[5] || (s[5] = (k) => v("tabbar-contextmenu", k))
|
|
1865
1867
|
}, [
|
|
1866
|
-
b("div",
|
|
1868
|
+
b("div", nr, [
|
|
1867
1869
|
(W(!0), fe(bt, null, Rt(e.sheets, (k, a) => (W(), fe("div", {
|
|
1868
1870
|
key: k.id,
|
|
1869
1871
|
class: Pe(["tab-item", { "tab-item--active": a === e.activeSheetIndex }]),
|
|
1870
|
-
onClick: (z) =>
|
|
1871
|
-
onDblclick: qe((z) =>
|
|
1872
|
-
onContextmenu: (z) =>
|
|
1872
|
+
onClick: (z) => v("tab-click", a),
|
|
1873
|
+
onDblclick: qe((z) => v("tab-dblclick", a), ["prevent"]),
|
|
1874
|
+
onContextmenu: (z) => v("tab-contextmenu", { ev: z, i: a })
|
|
1873
1875
|
}, [
|
|
1874
1876
|
e.renTab === a ? (W(), fe("input", {
|
|
1875
1877
|
key: 0,
|
|
1876
1878
|
class: "tab-rename-input",
|
|
1877
1879
|
value: e.renTabVal,
|
|
1878
|
-
onInput: s[0] || (s[0] = (z) =>
|
|
1879
|
-
onKeydown: s[1] || (s[1] = (z) =>
|
|
1880
|
-
onBlur: s[2] || (s[2] = (z) =>
|
|
1880
|
+
onInput: s[0] || (s[0] = (z) => v("tab-rename-input", z.target.value)),
|
|
1881
|
+
onKeydown: s[1] || (s[1] = (z) => v("tab-rename-keydown", z)),
|
|
1882
|
+
onBlur: s[2] || (s[2] = (z) => v("tab-rename-commit")),
|
|
1881
1883
|
onClick: s[3] || (s[3] = qe(() => {
|
|
1882
1884
|
}, ["stop"]))
|
|
1883
|
-
}, null, 40,
|
|
1884
|
-
], 42,
|
|
1885
|
+
}, null, 40, ar)) : (W(), fe("span", ir, xt(k.name), 1))
|
|
1886
|
+
], 42, rr))), 128))
|
|
1885
1887
|
]),
|
|
1886
1888
|
b("button", {
|
|
1887
1889
|
class: "tab-bar__add-btn",
|
|
1888
1890
|
title: ke(U)(e.locale, "addSheet"),
|
|
1889
|
-
onClick: s[4] || (s[4] = (k) =>
|
|
1890
|
-
}, " + ", 8,
|
|
1891
|
+
onClick: s[4] || (s[4] = (k) => v("add-sheet"))
|
|
1892
|
+
}, " + ", 8, cr)
|
|
1891
1893
|
], 32));
|
|
1892
1894
|
}
|
|
1893
|
-
}),
|
|
1895
|
+
}), sr = /* @__PURE__ */ Kt(ur, [["__scopeId", "data-v-454e1a12"]]);
|
|
1894
1896
|
function ht(e) {
|
|
1895
|
-
let p = "",
|
|
1897
|
+
let p = "", v = e;
|
|
1896
1898
|
do
|
|
1897
|
-
p = String.fromCharCode(65 +
|
|
1898
|
-
while (
|
|
1899
|
+
p = String.fromCharCode(65 + v % 26) + p, v = Math.floor(v / 26) - 1;
|
|
1900
|
+
while (v >= 0);
|
|
1899
1901
|
return p;
|
|
1900
1902
|
}
|
|
1901
1903
|
function Hl(e) {
|
|
1902
1904
|
let p = 0;
|
|
1903
|
-
for (let
|
|
1904
|
-
p = p * 26 + (e.toUpperCase().charCodeAt(
|
|
1905
|
+
for (let v = 0; v < e.length; v++)
|
|
1906
|
+
p = p * 26 + (e.toUpperCase().charCodeAt(v) - 64);
|
|
1905
1907
|
return p - 1;
|
|
1906
1908
|
}
|
|
1907
1909
|
function Ht(e) {
|
|
@@ -1924,24 +1926,24 @@ function zl(e) {
|
|
|
1924
1926
|
function tl(e, p) {
|
|
1925
1927
|
return `${e},${p}`;
|
|
1926
1928
|
}
|
|
1927
|
-
function Ml(e, p,
|
|
1929
|
+
function Ml(e, p, v) {
|
|
1928
1930
|
const o = e.match(/^\$?([A-Z]+)\$?(\d+)$/i);
|
|
1929
1931
|
if (!o)
|
|
1930
1932
|
return null;
|
|
1931
1933
|
const s = Hl(o[1]), k = parseInt(o[2], 10) - 1;
|
|
1932
|
-
return s < 0 || s >= p || k < 0 || k >=
|
|
1934
|
+
return s < 0 || s >= p || k < 0 || k >= v ? null : { col: s, row: k };
|
|
1933
1935
|
}
|
|
1934
1936
|
function zt(e, p) {
|
|
1935
1937
|
if (!p)
|
|
1936
1938
|
return { x: 0, y: 0 };
|
|
1937
|
-
const
|
|
1938
|
-
return { x: e.clientX -
|
|
1939
|
+
const v = p.getBoundingClientRect();
|
|
1940
|
+
return { x: e.clientX - v.left, y: e.clientY - v.top };
|
|
1939
1941
|
}
|
|
1940
|
-
function
|
|
1942
|
+
function dr(e, p, v) {
|
|
1941
1943
|
const o = e.split(":");
|
|
1942
1944
|
if (o.length !== 2)
|
|
1943
1945
|
return null;
|
|
1944
|
-
const s = Ml(o[0], p,
|
|
1946
|
+
const s = Ml(o[0], p, v), k = Ml(o[1], p, v);
|
|
1945
1947
|
return !s || !k ? null : {
|
|
1946
1948
|
sc: Math.min(s.col, k.col),
|
|
1947
1949
|
sr: Math.min(s.row, k.row),
|
|
@@ -1949,13 +1951,13 @@ function sr(e, p, h) {
|
|
|
1949
1951
|
er: Math.max(s.row, k.row)
|
|
1950
1952
|
};
|
|
1951
1953
|
}
|
|
1952
|
-
function
|
|
1953
|
-
const k =
|
|
1954
|
+
function fr(e, p, v, o, s) {
|
|
1955
|
+
const k = v[tl(e, p)];
|
|
1954
1956
|
if (!k)
|
|
1955
1957
|
return 0;
|
|
1956
1958
|
const a = k.value;
|
|
1957
1959
|
if (a.startsWith("="))
|
|
1958
|
-
return Ql(tl(e, p),
|
|
1960
|
+
return Ql(tl(e, p), v, o, s) ?? 0;
|
|
1959
1961
|
const z = parseFloat(a);
|
|
1960
1962
|
return isNaN(z) ? 0 : z;
|
|
1961
1963
|
}
|
|
@@ -1963,10 +1965,10 @@ const _t = /* @__PURE__ */ new Map();
|
|
|
1963
1965
|
function Wl() {
|
|
1964
1966
|
_t.clear();
|
|
1965
1967
|
}
|
|
1966
|
-
function Ql(e, p,
|
|
1967
|
-
return
|
|
1968
|
+
function Ql(e, p, v, o) {
|
|
1969
|
+
return vr(e, p, v, o);
|
|
1968
1970
|
}
|
|
1969
|
-
function
|
|
1971
|
+
function vr(e, p, v, o, s) {
|
|
1970
1972
|
if (_t.has(e))
|
|
1971
1973
|
return NaN;
|
|
1972
1974
|
_t.set(e, NaN);
|
|
@@ -1980,51 +1982,51 @@ function fr(e, p, h, o, s) {
|
|
|
1980
1982
|
}
|
|
1981
1983
|
const z = a.slice(1).trim();
|
|
1982
1984
|
if (z.toUpperCase().startsWith("SUM(") && z.endsWith(")")) {
|
|
1983
|
-
const le = z.slice(4, -1).trim(), q =
|
|
1985
|
+
const le = z.slice(4, -1).trim(), q = dr(le, v, o);
|
|
1984
1986
|
if (q) {
|
|
1985
1987
|
let y = 0;
|
|
1986
1988
|
for (let ae = q.sc; ae <= q.ec; ae++)
|
|
1987
1989
|
for (let L = q.sr; L <= q.er; L++)
|
|
1988
|
-
y +=
|
|
1990
|
+
y += fr(ae, L, p, v, o);
|
|
1989
1991
|
return isNaN(y) ? NaN : (_t.set(e, y), y);
|
|
1990
1992
|
}
|
|
1991
1993
|
return NaN;
|
|
1992
1994
|
}
|
|
1993
1995
|
return NaN;
|
|
1994
1996
|
}
|
|
1995
|
-
function $l(e, p,
|
|
1997
|
+
function $l(e, p, v) {
|
|
1996
1998
|
const o = [], s = /(\$?[A-Z]+\$?\d+)(?::(\$?[A-Z]+\$?\d+))?/gi;
|
|
1997
1999
|
let k;
|
|
1998
2000
|
for (; (k = s.exec(e)) !== null; ) {
|
|
1999
|
-
const a = Ml(k[1], p,
|
|
2001
|
+
const a = Ml(k[1], p, v);
|
|
2000
2002
|
if (a)
|
|
2001
2003
|
if (k[2]) {
|
|
2002
|
-
const z = Ml(k[2], p,
|
|
2004
|
+
const z = Ml(k[2], p, v);
|
|
2003
2005
|
if (!z)
|
|
2004
2006
|
continue;
|
|
2005
|
-
for (let
|
|
2007
|
+
for (let g = Math.min(a.col, z.col); g <= Math.max(a.col, z.col); g++)
|
|
2006
2008
|
for (let le = Math.min(a.row, z.row); le <= Math.max(a.row, z.row); le++)
|
|
2007
|
-
o.push(tl(
|
|
2009
|
+
o.push(tl(g, le));
|
|
2008
2010
|
} else
|
|
2009
2011
|
o.push(tl(a.col, a.row));
|
|
2010
2012
|
}
|
|
2011
2013
|
return o;
|
|
2012
2014
|
}
|
|
2013
|
-
function
|
|
2014
|
-
const k =
|
|
2015
|
+
function gr(e, p, v, o, s) {
|
|
2016
|
+
const k = v[tl(e, p)];
|
|
2015
2017
|
if (!k)
|
|
2016
2018
|
return "";
|
|
2017
2019
|
const a = k.value;
|
|
2018
2020
|
if (!a.startsWith("="))
|
|
2019
2021
|
return a;
|
|
2020
|
-
const z = Ql(tl(e, p),
|
|
2022
|
+
const z = Ql(tl(e, p), v, o, s);
|
|
2021
2023
|
return isNaN(z) ? "#ERROR" : String(z);
|
|
2022
2024
|
}
|
|
2023
|
-
function
|
|
2024
|
-
return p === 0 &&
|
|
2025
|
+
function mr(e, p, v, o, s, k) {
|
|
2026
|
+
return p === 0 && v === 0 ? e : e.replace(
|
|
2025
2027
|
/(\$?)([A-Z]+)(\$?)(\d+)/gi,
|
|
2026
|
-
(a, z,
|
|
2027
|
-
const y = z ? Hl(
|
|
2028
|
+
(a, z, g, le, q) => {
|
|
2029
|
+
const y = z ? Hl(g) : Hl(g) + p, ae = le ? parseInt(q, 10) - 1 : parseInt(q, 10) - 1 + v;
|
|
2028
2030
|
let L;
|
|
2029
2031
|
y < 0 ? L = "A" : y >= o ? L = k(o - 1) : L = k(y);
|
|
2030
2032
|
let f;
|
|
@@ -2032,33 +2034,33 @@ function gr(e, p, h, o, s, k) {
|
|
|
2032
2034
|
}
|
|
2033
2035
|
);
|
|
2034
2036
|
}
|
|
2035
|
-
class
|
|
2037
|
+
class pr {
|
|
2036
2038
|
constructor() {
|
|
2037
2039
|
this.deps = /* @__PURE__ */ new Map(), this.rev = /* @__PURE__ */ new Map(), this.dirty = /* @__PURE__ */ new Set();
|
|
2038
2040
|
}
|
|
2039
2041
|
clear(p) {
|
|
2040
2042
|
var o;
|
|
2041
|
-
const
|
|
2042
|
-
if (
|
|
2043
|
-
for (const s of
|
|
2043
|
+
const v = this.deps.get(p);
|
|
2044
|
+
if (v) {
|
|
2045
|
+
for (const s of v)
|
|
2044
2046
|
(o = this.rev.get(s)) == null || o.delete(p);
|
|
2045
2047
|
this.deps.delete(p);
|
|
2046
2048
|
}
|
|
2047
2049
|
}
|
|
2048
|
-
set(p,
|
|
2049
|
-
if (this.clear(p),
|
|
2050
|
-
this.deps.set(p,
|
|
2051
|
-
for (const o of
|
|
2050
|
+
set(p, v) {
|
|
2051
|
+
if (this.clear(p), v.length !== 0) {
|
|
2052
|
+
this.deps.set(p, v);
|
|
2053
|
+
for (const o of v)
|
|
2052
2054
|
this.rev.has(o) || this.rev.set(o, /* @__PURE__ */ new Set()), this.rev.get(o).add(p);
|
|
2053
2055
|
}
|
|
2054
2056
|
}
|
|
2055
2057
|
markDirty(p) {
|
|
2056
|
-
const
|
|
2057
|
-
for (;
|
|
2058
|
-
const o =
|
|
2058
|
+
const v = [p];
|
|
2059
|
+
for (; v.length > 0; ) {
|
|
2060
|
+
const o = v.pop(), s = this.rev.get(o);
|
|
2059
2061
|
if (s)
|
|
2060
2062
|
for (const k of s)
|
|
2061
|
-
this.dirty.has(k) || (this.dirty.add(k),
|
|
2063
|
+
this.dirty.has(k) || (this.dirty.add(k), v.push(k));
|
|
2062
2064
|
}
|
|
2063
2065
|
}
|
|
2064
2066
|
getDirtyAndClear() {
|
|
@@ -2066,30 +2068,38 @@ class mr {
|
|
|
2066
2068
|
return this.dirty = /* @__PURE__ */ new Set(), p;
|
|
2067
2069
|
}
|
|
2068
2070
|
/** 从 cells 快照重建所有依赖关系 */
|
|
2069
|
-
rebuild(p,
|
|
2071
|
+
rebuild(p, v, o) {
|
|
2070
2072
|
this.deps.clear(), this.rev.clear(), this.dirty.clear(), _t.clear();
|
|
2071
2073
|
for (const [s, k] of Object.entries(p))
|
|
2072
2074
|
if (k.value.startsWith("=")) {
|
|
2073
|
-
const a = $l(k.value.slice(1),
|
|
2075
|
+
const a = $l(k.value.slice(1), v, o);
|
|
2074
2076
|
this.set(s, a);
|
|
2075
2077
|
}
|
|
2076
2078
|
}
|
|
2077
2079
|
}
|
|
2078
|
-
function
|
|
2079
|
-
const
|
|
2080
|
+
function hr(e, p) {
|
|
2081
|
+
const v = Mt({
|
|
2080
2082
|
rowCount: e.rowCount ?? p.rowCount,
|
|
2081
2083
|
colCount: e.colCount ?? p.colCount,
|
|
2082
2084
|
width: e.width,
|
|
2083
2085
|
height: e.height,
|
|
2084
2086
|
theme: e.theme ?? p.theme,
|
|
2085
2087
|
locale: e.locale ?? p.locale
|
|
2086
|
-
}
|
|
2088
|
+
});
|
|
2089
|
+
mo(() => {
|
|
2090
|
+
v.rowCount = e.rowCount ?? p.rowCount, v.colCount = e.colCount ?? p.colCount, v.width = e.width, v.height = e.height, v.theme = e.theme ?? p.theme, v.locale = e.locale ?? p.locale;
|
|
2091
|
+
});
|
|
2092
|
+
const o = se(() => v.locale === "zh-CN" ? "zh-CN" : "en-US"), s = v.colCount, k = v.rowCount, a = Mt({}), z = Mt({}), g = new pr(), le = V(null), q = V({ col: 0, row: 0 }), y = V(null), ae = V(""), L = V(new Array(s).fill(Qt)), f = V(new Array(k).fill(void 0)), Ce = V(0), he = V(0), De = (Ol - Bt) / 2, Y = /* @__PURE__ */ new Map();
|
|
2087
2093
|
let X = null;
|
|
2088
2094
|
function be(x, R, S, G) {
|
|
2089
2095
|
const Z = `${G} ${S} ${R}px ${x}`, ie = Y.get(Z);
|
|
2090
2096
|
if (ie)
|
|
2091
2097
|
return ie;
|
|
2092
|
-
|
|
2098
|
+
if (!X) {
|
|
2099
|
+
if (typeof document > "u")
|
|
2100
|
+
return { ascent: R * 0.8, descent: R * 0.2 };
|
|
2101
|
+
X = document.createElement("canvas");
|
|
2102
|
+
}
|
|
2093
2103
|
const ge = X.getContext("2d");
|
|
2094
2104
|
if (!ge)
|
|
2095
2105
|
return { ascent: R * 0.8, descent: R * 0.2 };
|
|
@@ -2097,13 +2107,13 @@ function pr(e, p) {
|
|
|
2097
2107
|
const i = ge.measureText("M"), C = i.actualBoundingBoxAscent, H = i.actualBoundingBoxDescent, K = C || R * 0.8, J = H || R * 0.2, te = Math.max(K, R * 0.5), Q = Math.max(J, R * 0.15), me = { ascent: te, descent: Q };
|
|
2098
2108
|
return Y.set(Z, me), me;
|
|
2099
2109
|
}
|
|
2100
|
-
let F = (x, R) => `${x},${R}`, j = () => null, Me = () =>
|
|
2110
|
+
let F = (x, R) => `${x},${R}`, j = () => null, Me = () => Bt, Be = se(() => [0]), oe = () => Ol, c = (x, R, S, G) => ({
|
|
2101
2111
|
startCol: Math.min(x, S),
|
|
2102
2112
|
startRow: Math.min(R, G),
|
|
2103
2113
|
endCol: Math.max(x, S),
|
|
2104
2114
|
endRow: Math.max(R, G)
|
|
2105
2115
|
});
|
|
2106
|
-
function
|
|
2116
|
+
function h(x, R) {
|
|
2107
2117
|
var i;
|
|
2108
2118
|
const S = (i = a[F(x, R)]) == null ? void 0 : i.style, G = Me(x, R), Z = typeof (S == null ? void 0 : S.fontFamily) == "string" && S.fontFamily ? S.fontFamily : Sl, ie = (S == null ? void 0 : S.fontWeight) === "bold" ? "bold" : "normal", ge = (S == null ? void 0 : S.fontStyle) === "italic" ? "italic" : "normal";
|
|
2109
2119
|
return be(Z, G, ie, ge);
|
|
@@ -2129,7 +2139,7 @@ function pr(e, p) {
|
|
|
2129
2139
|
function He(x, R) {
|
|
2130
2140
|
var G;
|
|
2131
2141
|
const S = (G = a[F(x, R)]) == null ? void 0 : G.style;
|
|
2132
|
-
return typeof (S == null ? void 0 : S.fontSize) == "number" && S.fontSize > 0 ? S.fontSize :
|
|
2142
|
+
return typeof (S == null ? void 0 : S.fontSize) == "number" && S.fontSize > 0 ? S.fontSize : Bt;
|
|
2133
2143
|
}
|
|
2134
2144
|
Me = He;
|
|
2135
2145
|
const de = se(() => {
|
|
@@ -2147,7 +2157,7 @@ function pr(e, p) {
|
|
|
2147
2157
|
const R = f.value[x];
|
|
2148
2158
|
if (R != null && R > 0)
|
|
2149
2159
|
return R;
|
|
2150
|
-
let S =
|
|
2160
|
+
let S = Bt, G = S * 0.8, Z = S * 0.2, ie = 1;
|
|
2151
2161
|
const ge = X ? X.getContext("2d") : null;
|
|
2152
2162
|
for (let J = 0; J < s; J++) {
|
|
2153
2163
|
const te = He(J, x), Q = (K = a[F(J, x)]) == null ? void 0 : K.style, me = typeof (Q == null ? void 0 : Q.fontFamily) == "string" && Q.fontFamily ? Q.fontFamily : Sl, Te = (Q == null ? void 0 : Q.fontWeight) === "bold" ? "bold" : "normal", Ze = (Q == null ? void 0 : Q.fontStyle) === "italic" ? "italic" : "normal", Ue = pe(J, x);
|
|
@@ -2157,14 +2167,14 @@ function pr(e, p) {
|
|
|
2157
2167
|
`)[0] || Ue, at = ge.measureText(et), mt = at.actualBoundingBoxAscent, nl = at.actualBoundingBoxDescent, ml = mt || te * 0.8, pl = nl || te * 0.2, hl = Math.max(ml, te * 0.5), bl = Math.max(pl, te * 0.15);
|
|
2158
2168
|
hl > G && (G = hl), bl > Z && (Z = bl), te > S && (S = te);
|
|
2159
2169
|
const Bl = (Q == null ? void 0 : Q.wrap) === "wrap";
|
|
2160
|
-
let
|
|
2170
|
+
let Ft;
|
|
2161
2171
|
if (Bl) {
|
|
2162
2172
|
const Nt = j(J, x);
|
|
2163
2173
|
let rl;
|
|
2164
|
-
Nt && J === Nt.range.startCol && x === Nt.range.startRow ? rl = Be.value[Nt.range.endCol + 1] - Be.value[J] : rl = L.value[J],
|
|
2174
|
+
Nt && J === Nt.range.startCol && x === Nt.range.startRow ? rl = Be.value[Nt.range.endCol + 1] - Be.value[J] : rl = L.value[J], Ft = Ne(ge, Ue, Math.max(0, rl - 10), !0).length, Ft > ie && (ie = Ft);
|
|
2165
2175
|
} else
|
|
2166
|
-
|
|
2167
|
-
`).length,
|
|
2176
|
+
Ft = Ue.split(`
|
|
2177
|
+
`).length, Ft > ie && (ie = Ft);
|
|
2168
2178
|
} else if (te > S) {
|
|
2169
2179
|
S = te;
|
|
2170
2180
|
const et = be(me, te, Te, Ze);
|
|
@@ -2247,25 +2257,25 @@ function pr(e, p) {
|
|
|
2247
2257
|
return ((S = a[$(x, R)]) == null ? void 0 : S.value) ?? "";
|
|
2248
2258
|
}
|
|
2249
2259
|
function pe(x, R) {
|
|
2250
|
-
return Wl(),
|
|
2260
|
+
return Wl(), gr(x, R, a, s, k);
|
|
2251
2261
|
}
|
|
2252
2262
|
function N(x, R, S) {
|
|
2253
2263
|
var ge, i;
|
|
2254
2264
|
const G = $(x, R);
|
|
2255
2265
|
if (Wl(), S === "" || S == null) {
|
|
2256
|
-
|
|
2266
|
+
g.clear(G);
|
|
2257
2267
|
const C = ((ge = a[G]) == null ? void 0 : ge.style) ?? null;
|
|
2258
|
-
C ? a[G] = { value: "", style: C } : ce(G),
|
|
2268
|
+
C ? a[G] = { value: "", style: C } : ce(G), g.markDirty(G);
|
|
2259
2269
|
return;
|
|
2260
2270
|
}
|
|
2261
2271
|
const Z = String(S), ie = ((i = a[G]) == null ? void 0 : i.style) ?? null;
|
|
2262
|
-
a[G] = { value: Z, style: ie }, Z.startsWith("=") ?
|
|
2272
|
+
a[G] = { value: Z, style: ie }, Z.startsWith("=") ? g.set(G, $l(Z.slice(1), s, k)) : g.clear(G), g.markDirty(G);
|
|
2263
2273
|
}
|
|
2264
2274
|
function ve(x, R, S, G) {
|
|
2265
2275
|
for (let Z = x; Z <= R; Z++)
|
|
2266
2276
|
for (let ie = S; ie <= G; ie++) {
|
|
2267
2277
|
const ge = $(Z, ie);
|
|
2268
|
-
|
|
2278
|
+
g.clear(ge), ce(ge), g.markDirty(ge), P(Z, ie);
|
|
2269
2279
|
}
|
|
2270
2280
|
}
|
|
2271
2281
|
let Fe = () => {
|
|
@@ -2290,7 +2300,7 @@ function pr(e, p) {
|
|
|
2290
2300
|
let H = Ce.value, K = he.value;
|
|
2291
2301
|
Z < H ? H = Z : Z + i > H + S && (H = Z + i - S), ie < K ? K = ie : ie + C > K + G && (K = ie + C - G), d(H, K);
|
|
2292
2302
|
}
|
|
2293
|
-
function
|
|
2303
|
+
function Dt(x) {
|
|
2294
2304
|
const R = de.value;
|
|
2295
2305
|
if (x < 0 || x >= R[s])
|
|
2296
2306
|
return -1;
|
|
@@ -2313,13 +2323,13 @@ function pr(e, p) {
|
|
|
2313
2323
|
return S;
|
|
2314
2324
|
}
|
|
2315
2325
|
const rt = {
|
|
2316
|
-
props:
|
|
2326
|
+
props: v,
|
|
2317
2327
|
locale: o,
|
|
2318
2328
|
colCount: s,
|
|
2319
2329
|
rowCount: k,
|
|
2320
2330
|
cells: a,
|
|
2321
2331
|
merges: z,
|
|
2322
|
-
formulaDeps:
|
|
2332
|
+
formulaDeps: g,
|
|
2323
2333
|
selection: le,
|
|
2324
2334
|
activeCell: q,
|
|
2325
2335
|
editingCell: y,
|
|
@@ -2332,7 +2342,7 @@ function pr(e, p) {
|
|
|
2332
2342
|
fontMetricsCache: Y,
|
|
2333
2343
|
fontMetricsCanvas: X,
|
|
2334
2344
|
measureFontMetrics: be,
|
|
2335
|
-
_getFontMetricsForCell:
|
|
2345
|
+
_getFontMetricsForCell: h,
|
|
2336
2346
|
getWrappedLines: Ne,
|
|
2337
2347
|
cellFontSize: He,
|
|
2338
2348
|
colPositions: de,
|
|
@@ -2360,7 +2370,7 @@ function pr(e, p) {
|
|
|
2360
2370
|
cancelEdit: Ct,
|
|
2361
2371
|
moveActive: tt,
|
|
2362
2372
|
ensureVisible: st,
|
|
2363
|
-
hitCol:
|
|
2373
|
+
hitCol: Dt,
|
|
2364
2374
|
hitRow: ol,
|
|
2365
2375
|
// viewSize 引用
|
|
2366
2376
|
viewSize: n
|
|
@@ -2376,8 +2386,8 @@ function pr(e, p) {
|
|
|
2376
2386
|
return (S = rt.clampScroll) == null ? void 0 : S.call(rt, x, R);
|
|
2377
2387
|
}, rt;
|
|
2378
2388
|
}
|
|
2379
|
-
function
|
|
2380
|
-
const
|
|
2389
|
+
function br(e, p) {
|
|
2390
|
+
const v = V([]), o = V([]);
|
|
2381
2391
|
function s(i) {
|
|
2382
2392
|
const C = {};
|
|
2383
2393
|
for (const [H, K] of Object.entries(i))
|
|
@@ -2405,25 +2415,25 @@ function hr(e, p) {
|
|
|
2405
2415
|
p.sheets.value = i.sheets.map((C) => ({ ...C, cells: s(C.cells) })), p.loadSheet(Math.max(0, Math.min(i.activeSheetIndex, p.sheets.value.length - 1))), e.formulaDeps.rebuild(e.cells, e.colCount, e.rowCount);
|
|
2406
2416
|
}
|
|
2407
2417
|
function z() {
|
|
2408
|
-
const i = k(), C =
|
|
2409
|
-
C && JSON.stringify(C) === JSON.stringify(i) || (
|
|
2418
|
+
const i = k(), C = v.value[v.value.length - 1];
|
|
2419
|
+
C && JSON.stringify(C) === JSON.stringify(i) || (v.value.push(i), o.value = [], v.value.length > bo && v.value.shift());
|
|
2410
2420
|
}
|
|
2411
2421
|
e.saveUndo = z;
|
|
2412
|
-
function
|
|
2422
|
+
function g() {
|
|
2413
2423
|
var i;
|
|
2414
|
-
|
|
2424
|
+
v.value.length && (o.value.push(k()), a(v.value.pop()), (i = e.scheduleRender) == null || i.call(e), $e(() => {
|
|
2415
2425
|
var C;
|
|
2416
2426
|
return (C = e.emitModelData) == null ? void 0 : C.call(e);
|
|
2417
2427
|
}));
|
|
2418
2428
|
}
|
|
2419
2429
|
function le() {
|
|
2420
2430
|
var i;
|
|
2421
|
-
o.value.length && (
|
|
2431
|
+
o.value.length && (v.value.push(k()), a(o.value.pop()), (i = e.scheduleRender) == null || i.call(e), $e(() => {
|
|
2422
2432
|
var C;
|
|
2423
2433
|
return (C = e.emitModelData) == null ? void 0 : C.call(e);
|
|
2424
2434
|
}));
|
|
2425
2435
|
}
|
|
2426
|
-
const q = se(() =>
|
|
2436
|
+
const q = se(() => v.value.length > 0), y = se(() => o.value.length > 0), ae = se(() => !!e.selection.value), L = V(null);
|
|
2427
2437
|
function f() {
|
|
2428
2438
|
var H;
|
|
2429
2439
|
const i = e.selection.value;
|
|
@@ -2468,9 +2478,9 @@ function hr(e, p) {
|
|
|
2468
2478
|
}
|
|
2469
2479
|
}
|
|
2470
2480
|
const De = se(
|
|
2471
|
-
() =>
|
|
2481
|
+
() => yo.map((i) => ({ ...i, label: i.value === "" ? U(e.locale.value, "fontDefault") : i.label }))
|
|
2472
2482
|
), Y = se(
|
|
2473
|
-
() =>
|
|
2483
|
+
() => wo.map((i) => ({ ...i, label: String(i.value) }))
|
|
2474
2484
|
), X = "\0", be = se(() => {
|
|
2475
2485
|
var K;
|
|
2476
2486
|
const i = e.selection.value;
|
|
@@ -2489,7 +2499,7 @@ function hr(e, p) {
|
|
|
2489
2499
|
}), F = se(() => {
|
|
2490
2500
|
const i = e.selection.value;
|
|
2491
2501
|
if (!i)
|
|
2492
|
-
return
|
|
2502
|
+
return Bt;
|
|
2493
2503
|
let C, H = !1;
|
|
2494
2504
|
for (let K = i.startCol; K <= i.endCol && !H; K++)
|
|
2495
2505
|
for (let J = i.startRow; J <= i.endRow && !H; J++) {
|
|
@@ -2499,7 +2509,7 @@ function hr(e, p) {
|
|
|
2499
2509
|
const Q = e.cellFontSize(K, J);
|
|
2500
2510
|
C === void 0 ? C = Q : Q !== C && (H = !0);
|
|
2501
2511
|
}
|
|
2502
|
-
return H ? 0 : C ??
|
|
2512
|
+
return H ? 0 : C ?? Bt;
|
|
2503
2513
|
});
|
|
2504
2514
|
function j(i, C) {
|
|
2505
2515
|
var K, J, te, Q;
|
|
@@ -2522,14 +2532,14 @@ function hr(e, p) {
|
|
|
2522
2532
|
function Me(i) {
|
|
2523
2533
|
j("fontFamily", i === "" ? "" : i);
|
|
2524
2534
|
}
|
|
2525
|
-
const Be = V(!1), oe = V(!1), c = V(!1),
|
|
2535
|
+
const Be = V(!1), oe = V(!1), c = V(!1), h = V(!1), Ne = V(!1);
|
|
2526
2536
|
function He(i) {
|
|
2527
2537
|
j("fontSize", i), Be.value = !1;
|
|
2528
2538
|
}
|
|
2529
2539
|
const de = se(
|
|
2530
|
-
() => Bo.map((i) => ({ label: U(e.locale.value, i.labelKey), value: i.value, icon: i.icon }))
|
|
2531
|
-
), n = se(
|
|
2532
2540
|
() => Do.map((i) => ({ label: U(e.locale.value, i.labelKey), value: i.value, icon: i.icon }))
|
|
2541
|
+
), n = se(
|
|
2542
|
+
() => Fo.map((i) => ({ label: U(e.locale.value, i.labelKey), value: i.value, icon: i.icon }))
|
|
2533
2543
|
), d = se(() => {
|
|
2534
2544
|
var K;
|
|
2535
2545
|
const i = e.selection.value;
|
|
@@ -2581,20 +2591,20 @@ function hr(e, p) {
|
|
|
2581
2591
|
return;
|
|
2582
2592
|
}
|
|
2583
2593
|
let C = parseInt(i, 10);
|
|
2584
|
-
isNaN(C) ? C = F.value === 0 ?
|
|
2594
|
+
isNaN(C) ? C = F.value === 0 ? Bt : F.value : C = Math.max(5, Math.min(72, C)), $.value = String(C), C !== F.value && j("fontSize", C);
|
|
2585
2595
|
}
|
|
2586
2596
|
function Ve(i) {
|
|
2587
2597
|
i.key === "Enter" && i.target.blur();
|
|
2588
2598
|
}
|
|
2589
2599
|
function Xe(i) {
|
|
2590
|
-
i && i.preventDefault(), ce.value = !ce.value, ce.value && (c && (c.value = !1), oe && (oe.value = !1),
|
|
2600
|
+
i && i.preventDefault(), ce.value = !ce.value, ce.value && (c && (c.value = !1), oe && (oe.value = !1), h.value = !1, Ne.value = !1);
|
|
2591
2601
|
}
|
|
2592
2602
|
function ye() {
|
|
2593
|
-
const i = F.value === 0 ?
|
|
2603
|
+
const i = F.value === 0 ? Bt : F.value, C = Math.min(72, i + 1);
|
|
2594
2604
|
j("fontSize", C), $.value = String(C), ce.value = !1;
|
|
2595
2605
|
}
|
|
2596
2606
|
function _e() {
|
|
2597
|
-
const i = F.value === 0 ?
|
|
2607
|
+
const i = F.value === 0 ? Bt : F.value, C = Math.max(5, i - 1);
|
|
2598
2608
|
j("fontSize", C), $.value = String(C), ce.value = !1;
|
|
2599
2609
|
}
|
|
2600
2610
|
function B(i) {
|
|
@@ -2626,8 +2636,8 @@ function hr(e, p) {
|
|
|
2626
2636
|
function Ke() {
|
|
2627
2637
|
j("strikethrough", pe.value ? "" : "line-through");
|
|
2628
2638
|
}
|
|
2629
|
-
const gt = V(""), Ct = V(""), tt =
|
|
2630
|
-
function
|
|
2639
|
+
const gt = V(""), Ct = V(""), tt = h, st = Ne;
|
|
2640
|
+
function Dt() {
|
|
2631
2641
|
tt.value = !tt.value, st.value = !1, oe && (oe.value = !1), c && (c.value = !1);
|
|
2632
2642
|
}
|
|
2633
2643
|
function ol() {
|
|
@@ -2680,13 +2690,13 @@ function hr(e, p) {
|
|
|
2680
2690
|
return H ? "" : C ?? "";
|
|
2681
2691
|
});
|
|
2682
2692
|
return {
|
|
2683
|
-
undoStack:
|
|
2693
|
+
undoStack: v,
|
|
2684
2694
|
redoStack: o,
|
|
2685
2695
|
cloneCells: s,
|
|
2686
2696
|
takeSnap: k,
|
|
2687
2697
|
restoreSnap: a,
|
|
2688
2698
|
saveUndo: z,
|
|
2689
|
-
undo:
|
|
2699
|
+
undo: g,
|
|
2690
2700
|
redo: le,
|
|
2691
2701
|
canUndo: q,
|
|
2692
2702
|
canRedo: y,
|
|
@@ -2731,7 +2741,7 @@ function hr(e, p) {
|
|
|
2731
2741
|
cachedFillColor: Ct,
|
|
2732
2742
|
textColorMenuOpen: tt,
|
|
2733
2743
|
fillColorMenuOpen: st,
|
|
2734
|
-
_toggleTextColorMenu:
|
|
2744
|
+
_toggleTextColorMenu: Dt,
|
|
2735
2745
|
_toggleFillColorMenu: ol,
|
|
2736
2746
|
onBorderMenuToggle: rt,
|
|
2737
2747
|
onTextColorChange: x,
|
|
@@ -2742,7 +2752,7 @@ function hr(e, p) {
|
|
|
2742
2752
|
selFillColor: ie
|
|
2743
2753
|
};
|
|
2744
2754
|
}
|
|
2745
|
-
function
|
|
2755
|
+
function Cr(e, p) {
|
|
2746
2756
|
p.borderMenuOpen && (e.borderMenuOpen = p.borderMenuOpen), p.mergeMenuOpen && (e.mergeMenuOpen = p.mergeMenuOpen), (() => {
|
|
2747
2757
|
const o = e.borderMenuOpen, s = e.mergeMenuOpen;
|
|
2748
2758
|
e.onBorderMenuToggle = (k) => {
|
|
@@ -2756,8 +2766,8 @@ function br(e, p) {
|
|
|
2756
2766
|
};
|
|
2757
2767
|
})();
|
|
2758
2768
|
}
|
|
2759
|
-
function
|
|
2760
|
-
const
|
|
2769
|
+
function yr(e, p) {
|
|
2770
|
+
const v = V("none"), o = V(!1), s = "#444";
|
|
2761
2771
|
function k(n, d, w, l) {
|
|
2762
2772
|
const r = e.findMerge(d, w), I = r ? r.range.endCol : d, E = r ? r.range.endRow : w, $ = r ? r.range.startCol : d, we = (r ? r.range.startRow : w) === l.startRow, Oe = E === l.endRow, Ve = $ === l.startCol, Xe = I === l.endCol, ye = { top: 0, bottom: 0, left: 0, right: 0 };
|
|
2763
2773
|
switch (n) {
|
|
@@ -2805,7 +2815,7 @@ function Cr(e, p) {
|
|
|
2805
2815
|
a(n, d - 1, "Bottom", I, !0), a(n, d + 1, "Top", E, !0), a(n - 1, d, "Right", $, !0), a(n + 1, d, "Left", ce, !0);
|
|
2806
2816
|
}
|
|
2807
2817
|
e.syncCellBorders = z;
|
|
2808
|
-
function
|
|
2818
|
+
function g(n, d, w, l = !0) {
|
|
2809
2819
|
var Ve, Xe;
|
|
2810
2820
|
const r = e.cellKey(n, d), I = ((Ve = e.cells[r]) == null ? void 0 : Ve.value) ?? "", E = (Xe = e.cells[r]) != null && Xe.style ? { ...e.cells[r].style } : {}, $ = ["Top", "Bottom", "Left", "Right"], ce = [w.top, w.bottom, w.left, w.right];
|
|
2811
2821
|
for (let ye = 0; ye < 4; ye++) {
|
|
@@ -2818,14 +2828,14 @@ function Cr(e, p) {
|
|
|
2818
2828
|
}
|
|
2819
2829
|
function le(n) {
|
|
2820
2830
|
var w, l;
|
|
2821
|
-
|
|
2831
|
+
v.value = n;
|
|
2822
2832
|
const d = e.selection.value;
|
|
2823
2833
|
if (d) {
|
|
2824
2834
|
if (p.saveUndo(), n === "none")
|
|
2825
2835
|
for (let r = d.startCol; r <= d.endCol; r++)
|
|
2826
2836
|
for (let I = d.startRow; I <= d.endRow; I++) {
|
|
2827
2837
|
const E = e.findMerge(r, I);
|
|
2828
|
-
E && (r !== E.range.startCol || I !== E.range.startRow) ||
|
|
2838
|
+
E && (r !== E.range.startCol || I !== E.range.startRow) || g(r, I, { top: 0, bottom: 0, left: 0, right: 0 }, !0);
|
|
2829
2839
|
}
|
|
2830
2840
|
else
|
|
2831
2841
|
for (let r = d.startCol; r <= d.endCol; r++)
|
|
@@ -2834,13 +2844,13 @@ function Cr(e, p) {
|
|
|
2834
2844
|
if (E && (r !== E.range.startCol || I !== E.range.startRow))
|
|
2835
2845
|
continue;
|
|
2836
2846
|
const $ = k(n, r, I, d);
|
|
2837
|
-
|
|
2847
|
+
g(r, I, $, !1);
|
|
2838
2848
|
}
|
|
2839
2849
|
(w = e.scheduleRender) == null || w.call(e), (l = e.emitModelData) == null || l.call(e);
|
|
2840
2850
|
}
|
|
2841
2851
|
}
|
|
2842
2852
|
function q() {
|
|
2843
|
-
le(
|
|
2853
|
+
le(v.value);
|
|
2844
2854
|
}
|
|
2845
2855
|
function y(n, d, w) {
|
|
2846
2856
|
var I, E;
|
|
@@ -2999,7 +3009,7 @@ function Cr(e, p) {
|
|
|
2999
3009
|
}
|
|
3000
3010
|
}
|
|
3001
3011
|
}
|
|
3002
|
-
async function
|
|
3012
|
+
async function h() {
|
|
3003
3013
|
var I;
|
|
3004
3014
|
let n;
|
|
3005
3015
|
try {
|
|
@@ -3016,7 +3026,7 @@ function Cr(e, p) {
|
|
|
3016
3026
|
const we = w.col + ce, Oe = w.row + E;
|
|
3017
3027
|
if (we < e.colCount && Oe < e.rowCount) {
|
|
3018
3028
|
let Ve = $[ce];
|
|
3019
|
-
if (Ve.startsWith("=") && l && (Ve =
|
|
3029
|
+
if (Ve.startsWith("=") && l && (Ve = mr(
|
|
3020
3030
|
Ve,
|
|
3021
3031
|
we - (l.startCol + ce),
|
|
3022
3032
|
Oe - (l.startRow + E),
|
|
@@ -3073,14 +3083,14 @@ function Cr(e, p) {
|
|
|
3073
3083
|
(I = e.scheduleRender) == null || I.call(e), (E = e.emitModelData) == null || E.call(e);
|
|
3074
3084
|
}
|
|
3075
3085
|
return {
|
|
3076
|
-
cachedBorder:
|
|
3086
|
+
cachedBorder: v,
|
|
3077
3087
|
borderMenuOpen: o,
|
|
3078
3088
|
BORDER_COLOR: s,
|
|
3079
3089
|
borderTypeToWidths: k,
|
|
3080
3090
|
onBorderChange: le,
|
|
3081
3091
|
setCellBorderSide: a,
|
|
3082
3092
|
syncCellBorders: z,
|
|
3083
|
-
applyBorderToCell:
|
|
3093
|
+
applyBorderToCell: g,
|
|
3084
3094
|
applyCachedBorder: q,
|
|
3085
3095
|
cellBorderWidth: y,
|
|
3086
3096
|
mergeMenuOpen: ae,
|
|
@@ -3098,17 +3108,17 @@ function Cr(e, p) {
|
|
|
3098
3108
|
setCellWithStyle: Be,
|
|
3099
3109
|
copyToClipboard: oe,
|
|
3100
3110
|
copyRowCol: c,
|
|
3101
|
-
pasteFromClipboard:
|
|
3111
|
+
pasteFromClipboard: h,
|
|
3102
3112
|
cutSelected: Ne,
|
|
3103
3113
|
clearSelected: He,
|
|
3104
3114
|
sumSelected: de
|
|
3105
3115
|
};
|
|
3106
3116
|
}
|
|
3107
|
-
function
|
|
3108
|
-
const s = {}, k = o(p), a = o(
|
|
3117
|
+
function wr(e, p, v, o) {
|
|
3118
|
+
const s = {}, k = o(p), a = o(v);
|
|
3109
3119
|
return k != null && (s.width = `${k}px`), a != null && (s.height = `${a}px`), s["--sp-formula-bar-bg"] = e.formulaBarBg, s["--sp-formula-bar-border"] = e.formulaBarBorder, s["--sp-formula-bar-label-color"] = e.formulaBarLabelText, s["--sp-formula-bar-label-bg"] = e.formulaBarLabelBg, s["--sp-formula-bar-label-border"] = e.formulaBarLabelBorder, s["--sp-formula-bar-input-bg"] = e.formulaBarInputBg, s["--sp-formula-bar-input-border"] = e.formulaBarInputBorder, s["--sp-formula-bar-input-color"] = e.formulaBarInputText, s["--sp-formula-bar-input-focus-border"] = e.formulaBarInputFocusBorder, s["--sp-formula-bar-input-focus-shadow"] = e.formulaBarInputFocusShadow, s["--sp-wrapper-bg"] = e.wrapperBg, s["--sp-cell-editor-border"] = e.cellEditorBorder, s["--sp-cell-editor-color"] = e.cellEditorText, s["--sp-cell-editor-bg"] = e.cellEditorBg, s["--sp-cell-editor-shadow"] = e.cellEditorShadow, s["--sp-tab-bar-bg"] = e.tabBarBg, s["--sp-tab-bar-border"] = e.tabBarBorder, s["--sp-tab-active-bg"] = e.tabActiveBg, s["--sp-tab-active-color"] = e.tabActiveText, s["--sp-tab-active-border"] = e.tabActiveBorder, s["--sp-tab-inactive-bg"] = e.tabInactiveBg, s["--sp-tab-inactive-color"] = e.tabInactiveText, s["--sp-tab-inactive-border"] = e.tabInactiveBorder, s["--sp-tab-hover-bg"] = e.tabHoverBg, s["--sp-tab-add-btn-color"] = e.tabAddBtnColor, s["--sp-tab-add-btn-hover-bg"] = e.tabAddBtnHoverBg, s["--sp-tab-scroll-btn-color"] = e.tabScrollBtnColor, s["--sp-tab-scroll-btn-hover-bg"] = e.tabScrollBtnHoverBg, s["--sp-scroll-thumb"] = e.scrollbarThumb, s["--sp-scroll-thumb-hover"] = e.scrollbarThumbHover, s["--sp-scroll-btn-bg"] = e.scrollBtnBg, s["--sp-scroll-btn-color"] = e.scrollBtnColor, s["--sp-scroll-btn-hover-bg"] = e.scrollBtnHoverBg, s["--sp-scroll-btn-active-bg"] = e.scrollBtnActiveBg, s["--sp-scroll-track-bg"] = e.scrollTrackBg, s["--sp-toolbar-bg"] = e.toolbarBg, s["--sp-toolbar-border"] = e.toolbarBorder, s["--sp-toolbar-btn-color"] = e.toolbarBtnColor, s["--sp-toolbar-btn-hover-bg"] = e.toolbarBtnHoverBg, s["--sp-toolbar-btn-disabled-color"] = e.toolbarBtnDisabledColor, s["--sp-toolbar-btn-active-color"] = e.toolbarBtnActiveColor, s;
|
|
3110
3120
|
}
|
|
3111
|
-
function
|
|
3121
|
+
function kr(e, p, v, o) {
|
|
3112
3122
|
function s(B, O) {
|
|
3113
3123
|
var ne, pe;
|
|
3114
3124
|
const P = O - B + 1;
|
|
@@ -3187,9 +3197,9 @@ function wr(e, p, h, o) {
|
|
|
3187
3197
|
for (let N = 0; N < e.rowCount; N++)
|
|
3188
3198
|
(ne = e.syncCellBorders) == null || ne.call(e, B - 1, N), (pe = e.syncCellBorders) == null || pe.call(e, B, N);
|
|
3189
3199
|
}
|
|
3190
|
-
let
|
|
3200
|
+
let g = 0;
|
|
3191
3201
|
function le() {
|
|
3192
|
-
return
|
|
3202
|
+
return g++, `s_${g}`;
|
|
3193
3203
|
}
|
|
3194
3204
|
function q(B) {
|
|
3195
3205
|
return {
|
|
@@ -3264,7 +3274,7 @@ function wr(e, p, h, o) {
|
|
|
3264
3274
|
}
|
|
3265
3275
|
const F = se(() => y.value.length);
|
|
3266
3276
|
let j = "";
|
|
3267
|
-
const Me =
|
|
3277
|
+
const Me = v;
|
|
3268
3278
|
function Be() {
|
|
3269
3279
|
L();
|
|
3270
3280
|
const B = y.value.map((P) => {
|
|
@@ -3293,12 +3303,12 @@ function wr(e, p, h, o) {
|
|
|
3293
3303
|
oe = !1, Be();
|
|
3294
3304
|
}));
|
|
3295
3305
|
}
|
|
3296
|
-
const
|
|
3306
|
+
const h = se(() => e.props.theme === "dark" ? zo : Ao), Ne = se(() => wr(h.value, e.props.width, e.props.height, Ht)), He = se(() => {
|
|
3297
3307
|
const B = {};
|
|
3298
3308
|
for (const [O, P] of Object.entries(Ne.value))
|
|
3299
3309
|
O.startsWith("--") && (B[O] = P);
|
|
3300
3310
|
return B;
|
|
3301
|
-
}), de = V(null), n = V(null), d = V(null), w = V(null), l =
|
|
3311
|
+
}), de = V(null), n = V(null), d = V(null), w = V(null), l = Mt({ w: 800, h: 600 });
|
|
3302
3312
|
e.viewSize && ut(l, (B) => {
|
|
3303
3313
|
e.viewSize && (e.viewSize.w = B.w, e.viewSize.h = B.h);
|
|
3304
3314
|
}, { deep: !0 });
|
|
@@ -3366,7 +3376,7 @@ function wr(e, p, h, o) {
|
|
|
3366
3376
|
mkSheet: q,
|
|
3367
3377
|
emitModelData: Be,
|
|
3368
3378
|
scheduleOptEmit: c,
|
|
3369
|
-
themeColors:
|
|
3379
|
+
themeColors: h,
|
|
3370
3380
|
outerStyle: Ne,
|
|
3371
3381
|
toolbarThemeVars: He,
|
|
3372
3382
|
wrapperRef: de,
|
|
@@ -3385,17 +3395,17 @@ function wr(e, p, h, o) {
|
|
|
3385
3395
|
modelData: Me
|
|
3386
3396
|
};
|
|
3387
3397
|
}
|
|
3388
|
-
function
|
|
3398
|
+
function xr(e, p, v, o, s) {
|
|
3389
3399
|
let k = !1, a = null, z = 1;
|
|
3390
|
-
function
|
|
3400
|
+
function g() {
|
|
3391
3401
|
k || (k = !0, requestAnimationFrame(() => {
|
|
3392
3402
|
k = !1, q();
|
|
3393
3403
|
}));
|
|
3394
3404
|
}
|
|
3395
|
-
e.scheduleRender =
|
|
3405
|
+
e.scheduleRender = g;
|
|
3396
3406
|
const le = "#444";
|
|
3397
3407
|
function q() {
|
|
3398
|
-
var El, Ot, cl, St,
|
|
3408
|
+
var El, Ot, cl, St, Tt, ul, Pl, Ul, Yl, Gl, Xl;
|
|
3399
3409
|
const t = o.canvasRef.value;
|
|
3400
3410
|
if (!t)
|
|
3401
3411
|
return;
|
|
@@ -3403,8 +3413,8 @@ function kr(e, p, h, o, s) {
|
|
|
3403
3413
|
if (!u || (a = t.getContext("2d"), !a))
|
|
3404
3414
|
return;
|
|
3405
3415
|
z = window.devicePixelRatio || 1;
|
|
3406
|
-
const M = u.getBoundingClientRect(), D = M.width,
|
|
3407
|
-
o.viewSize.w = D, o.viewSize.h =
|
|
3416
|
+
const M = u.getBoundingClientRect(), D = M.width, m = M.height;
|
|
3417
|
+
o.viewSize.w = D, o.viewSize.h = m, t.width = D * z, t.height = m * z, t.style.width = D + "px", t.style.height = m + "px", a.setTransform(z, 0, 0, z, 0, 0);
|
|
3408
3418
|
const T = e.scrollX.value, _ = e.scrollY.value, re = Re, ue = Se, Ee = o.themeColors.value, ct = e.colPositions.value, lt = e.rowPositions.value, Vt = e.colWidths.value, Et = [];
|
|
3409
3419
|
for (let A = 0; A < e.rowCount; A++)
|
|
3410
3420
|
Et[A] = lt[A + 1] - lt[A];
|
|
@@ -3414,10 +3424,10 @@ function kr(e, p, h, o, s) {
|
|
|
3414
3424
|
Lt = A;
|
|
3415
3425
|
const Pt = Lt, ft = Math.max(0, e.hitRow(_));
|
|
3416
3426
|
let Cl = ft;
|
|
3417
|
-
for (let A = ft; A < e.rowCount && !(ue + lt[A] - _ >=
|
|
3427
|
+
for (let A = ft; A < e.rowCount && !(ue + lt[A] - _ >= m); A++)
|
|
3418
3428
|
Cl = A;
|
|
3419
3429
|
const Ut = Cl;
|
|
3420
|
-
a.fillStyle = Ee.bg, a.fillRect(0, 0, D,
|
|
3430
|
+
a.fillStyle = Ee.bg, a.fillRect(0, 0, D, m), a.fillStyle = Ee.gridBg, a.fillRect(re, ue, D - re, m - ue), a.save(), a.beginPath(), a.rect(re, ue, D - re, m - ue), a.clip();
|
|
3421
3431
|
const it = e.selection.value, il = e.editingCell.value;
|
|
3422
3432
|
for (let A = ft; A <= Ut; A++)
|
|
3423
3433
|
for (let ee = yt; ee <= Pt; ee++) {
|
|
@@ -3426,7 +3436,7 @@ function kr(e, p, h, o, s) {
|
|
|
3426
3436
|
continue;
|
|
3427
3437
|
const We = re + ct[ee] - T, Ie = ue + lt[A] - _;
|
|
3428
3438
|
let Ye = Vt[ee], Ge = Et[A];
|
|
3429
|
-
if (Le && (Ye = ct[Le.range.endCol + 1] - ct[ee], Ge = lt[Le.range.endRow + 1] - lt[A]), We + Ye < re || Ie + Ge < ue || We > D || Ie >
|
|
3439
|
+
if (Le && (Ye = ct[Le.range.endCol + 1] - ct[ee], Ge = lt[Le.range.endRow + 1] - lt[A]), We + Ye < re || Ie + Ge < ue || We > D || Ie > m)
|
|
3430
3440
|
continue;
|
|
3431
3441
|
const je = (El = e.cells[e.cellKey(ee, A)]) == null ? void 0 : El.style, Yt = typeof (je == null ? void 0 : je.backgroundColor) == "string" ? je.backgroundColor : "";
|
|
3432
3442
|
if (Yt && (a.fillStyle = Yt, a.fillRect(We, Ie, Ye, Ge)), e.isSelected(ee, A) && (a.fillStyle = Ee.selectionBg, a.fillRect(We, Ie, Ye, Ge)), e.activeCell.value.col === ee && e.activeCell.value.row === A && (a.strokeStyle = Ee.activeCellBorder, a.lineWidth = 2, a.strokeRect(We + 1, Ie + 1, Ye - 2, Ge - 2)), a.strokeStyle = Ee.gridLine, a.lineWidth = 0.5, a.strokeRect(We + 0.25, Ie + 0.25, Ye - 0.5, Ge - 0.5), !(il && il.col === ee && il.row === A)) {
|
|
@@ -3464,9 +3474,9 @@ function kr(e, p, h, o, s) {
|
|
|
3464
3474
|
continue;
|
|
3465
3475
|
const We = re + ct[ee] - T, Ie = ue + lt[A] - _;
|
|
3466
3476
|
let Ye = Vt[ee], Ge = Et[A];
|
|
3467
|
-
if (Le && (Ye = ct[Le.range.endCol + 1] - ct[ee], Ge = lt[Le.range.endRow + 1] - lt[A]), We + Ye < re || Ie + Ge < ue || We > D || Ie >
|
|
3477
|
+
if (Le && (Ye = ct[Le.range.endCol + 1] - ct[ee], Ge = lt[Le.range.endRow + 1] - lt[A]), We + Ye < re || Ie + Ge < ue || We > D || Ie > m)
|
|
3468
3478
|
continue;
|
|
3469
|
-
const je = (cl = e.cells[e.cellKey(ee, A)]) == null ? void 0 : cl.style, Yt = (je == null ? void 0 : je.borderTopWidth) || 0, Gt = (je == null ? void 0 : je.borderLeftWidth) || 0, xe = (je == null ? void 0 : je.borderBottomWidth) || 0, ot = (je == null ? void 0 : je.borderRightWidth) || 0, vt = Math.max(Yt,
|
|
3479
|
+
const je = (cl = e.cells[e.cellKey(ee, A)]) == null ? void 0 : cl.style, Yt = (je == null ? void 0 : je.borderTopWidth) || 0, Gt = (je == null ? void 0 : je.borderLeftWidth) || 0, xe = (je == null ? void 0 : je.borderBottomWidth) || 0, ot = (je == null ? void 0 : je.borderRightWidth) || 0, vt = Math.max(Yt, v.cellBorderWidth(ee, A - 1, "Bottom")), wt = Math.max(Gt, v.cellBorderWidth(ee - 1, A, "Right")), pt = Math.max(xe, v.cellBorderWidth(ee, A + 1, "Top")), Xt = Math.max(ot, v.cellBorderWidth(ee + 1, A, "Left"));
|
|
3470
3480
|
(vt > 0 || wt > 0 || pt > 0 || Xt > 0) && (a.fillStyle = le, vt > 0 && a.fillRect(We, Ie, Ye, vt), pt > 0 && a.fillRect(We, Ie + Ge - pt, Ye, pt), wt > 0 && a.fillRect(We, Ie, wt, Ge), Xt > 0 && a.fillRect(We + Ye - Xt, Ie, Xt, Ge));
|
|
3471
3481
|
}
|
|
3472
3482
|
for (let A = ft; A <= Ut; A++)
|
|
@@ -3476,9 +3486,9 @@ function kr(e, p, h, o, s) {
|
|
|
3476
3486
|
continue;
|
|
3477
3487
|
const We = re + ct[ee] - T, Ie = ue + lt[A] - _;
|
|
3478
3488
|
let Ye = Vt[ee], Ge = Et[A];
|
|
3479
|
-
if (Le && (Ye = ct[Le.range.endCol + 1] - ct[ee], Ge = lt[Le.range.endRow + 1] - lt[A]), We + Ye < re || Ie + Ge < ue || We > D || Ie >
|
|
3489
|
+
if (Le && (Ye = ct[Le.range.endCol + 1] - ct[ee], Ge = lt[Le.range.endRow + 1] - lt[A]), We + Ye < re || Ie + Ge < ue || We > D || Ie > m)
|
|
3480
3490
|
continue;
|
|
3481
|
-
const je = ((
|
|
3491
|
+
const je = ((Tt = (St = e.cells[e.cellKey(ee, A)]) == null ? void 0 : St.style) == null ? void 0 : Tt.borderTopWidth) || 0, Yt = ((Pl = (ul = e.cells[e.cellKey(ee, A)]) == null ? void 0 : ul.style) == null ? void 0 : Pl.borderLeftWidth) || 0, Gt = ((Yl = (Ul = e.cells[e.cellKey(ee, A)]) == null ? void 0 : Ul.style) == null ? void 0 : Yl.borderBottomWidth) || 0, xe = ((Xl = (Gl = e.cells[e.cellKey(ee, A)]) == null ? void 0 : Gl.style) == null ? void 0 : Xl.borderRightWidth) || 0, ot = Math.max(je, v.cellBorderWidth(ee, A - 1, "Bottom")), vt = Math.max(Yt, v.cellBorderWidth(ee - 1, A, "Right")), wt = Math.max(Gt, v.cellBorderWidth(ee, A + 1, "Top")), pt = Math.max(xe, v.cellBorderWidth(ee + 1, A, "Left"));
|
|
3482
3492
|
a.fillStyle = le, ot > 0 && vt > 0 && a.fillRect(We - vt, Ie - ot, vt, ot), ot > 0 && pt > 0 && a.fillRect(We + Ye, Ie - ot, pt, ot), wt > 0 && vt > 0 && a.fillRect(We - vt, Ie + Ge, vt, wt), wt > 0 && pt > 0 && a.fillRect(We + Ye, Ie + Ge, pt, wt);
|
|
3483
3493
|
}
|
|
3484
3494
|
a.restore(), a.fillStyle = Ee.headerBg, a.fillRect(re, 0, D - re, ue);
|
|
@@ -3486,35 +3496,35 @@ function kr(e, p, h, o, s) {
|
|
|
3486
3496
|
const ee = re + ct[A] - T, Le = Vt[A];
|
|
3487
3497
|
ee + Le < re || ee > D || (it && A >= it.startCol && A <= it.endCol && (a.fillStyle = Ee.selectionBg, a.fillRect(ee, 0, Le, ue)), a.strokeStyle = Ee.headerBorder, a.lineWidth = 0.5, a.strokeRect(ee + 0.25, 0.25, Le - 0.5, ue - 0.5), it && A >= it.startCol && A <= it.endCol && (a.strokeStyle = Ee.activeCellBorder, a.lineWidth = 2, a.beginPath(), a.moveTo(ee, ue - 1), a.lineTo(ee + Le, ue - 1), a.stroke()), a.fillStyle = Ee.headerText, a.font = '11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', a.textAlign = "center", a.textBaseline = "middle", a.fillText(ht(A), ee + Le / 2, ue / 2));
|
|
3488
3498
|
}
|
|
3489
|
-
a.strokeStyle = Ee.headerSep, a.lineWidth = 1, a.beginPath(), a.moveTo(re, ue + 0.5), a.lineTo(D, ue + 0.5), a.stroke(), a.fillStyle = Ee.headerBg, a.fillRect(0, ue, re,
|
|
3499
|
+
a.strokeStyle = Ee.headerSep, a.lineWidth = 1, a.beginPath(), a.moveTo(re, ue + 0.5), a.lineTo(D, ue + 0.5), a.stroke(), a.fillStyle = Ee.headerBg, a.fillRect(0, ue, re, m - ue);
|
|
3490
3500
|
for (let A = ft; A <= Ut; A++) {
|
|
3491
3501
|
const ee = ue + lt[A] - _, Le = Et[A];
|
|
3492
|
-
ee + Le < ue || ee >
|
|
3502
|
+
ee + Le < ue || ee > m || (it && A >= it.startRow && A <= it.endRow && (a.fillStyle = Ee.selectionBg, a.fillRect(0, ee, re, Le)), a.strokeStyle = Ee.headerBorder, a.lineWidth = 0.5, a.strokeRect(0.25, ee + 0.25, re - 0.5, Le - 0.5), it && A >= it.startRow && A <= it.endRow && (a.strokeStyle = Ee.activeCellBorder, a.lineWidth = 2, a.beginPath(), a.moveTo(re - 1, ee), a.lineTo(re - 1, ee + Le), a.stroke()), a.fillStyle = Ee.headerText, a.font = '11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', a.textAlign = "center", a.textBaseline = "middle", a.fillText(String(A + 1), re / 2, ee + Le / 2 + 0.5));
|
|
3493
3503
|
}
|
|
3494
|
-
a.strokeStyle = Ee.headerSep, a.lineWidth = 1, a.beginPath(), a.moveTo(re + 0.5, ue), a.lineTo(re + 0.5,
|
|
3504
|
+
a.strokeStyle = Ee.headerSep, a.lineWidth = 1, a.beginPath(), a.moveTo(re + 0.5, ue), a.lineTo(re + 0.5, m), a.stroke(), a.fillStyle = Ee.headerBg, a.fillRect(0, 0, re, ue), a.strokeStyle = Ee.headerSep, a.lineWidth = 1, a.strokeRect(0.5, 0.5, re - 0.5, ue - 0.5);
|
|
3495
3505
|
}
|
|
3496
3506
|
const y = se(() => ht(e.activeCell.value.col) + String(e.activeCell.value.row + 1)), ae = se(() => e.editingCell.value ? e.editValue.value : e.getCellRaw(e.activeCell.value.col, e.activeCell.value.row));
|
|
3497
3507
|
function L() {
|
|
3498
|
-
e.editingCell.value || (e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.editValue.value = e.getCellRaw(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(),
|
|
3508
|
+
e.editingCell.value || (e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.editValue.value = e.getCellRaw(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(), g());
|
|
3499
3509
|
}
|
|
3500
3510
|
function f(t) {
|
|
3501
3511
|
e.editValue.value = t.target.value;
|
|
3502
3512
|
}
|
|
3503
3513
|
function Ce(t) {
|
|
3504
3514
|
var u, M;
|
|
3505
|
-
t.key === "Enter" ? (t.preventDefault(), e.commitEdit(), e.moveActive(0, 1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), (u = o.formulaBarRef.value) == null || u.blur(),
|
|
3515
|
+
t.key === "Enter" ? (t.preventDefault(), e.commitEdit(), e.moveActive(0, 1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), (u = o.formulaBarRef.value) == null || u.blur(), g(), o.focusEditInput()) : t.key === "Escape" && (t.preventDefault(), e.cancelEdit(), (M = o.formulaBarRef.value) == null || M.blur(), g(), o.focusEditInput());
|
|
3506
3516
|
}
|
|
3507
3517
|
function he() {
|
|
3508
3518
|
setTimeout(() => {
|
|
3509
|
-
e.editingCell.value && (e.commitEdit(),
|
|
3519
|
+
e.editingCell.value && (e.commitEdit(), g());
|
|
3510
3520
|
}, 0);
|
|
3511
3521
|
}
|
|
3512
3522
|
const De = V(null), Y = V("");
|
|
3513
3523
|
function X(t) {
|
|
3514
|
-
De.value === null && (o.switchSheet(t),
|
|
3524
|
+
De.value === null && (o.switchSheet(t), g());
|
|
3515
3525
|
}
|
|
3516
3526
|
function be(t) {
|
|
3517
|
-
t !== o.activeSheetIndex.value && (o.saveSheet(), o.loadSheet(t),
|
|
3527
|
+
t !== o.activeSheetIndex.value && (o.saveSheet(), o.loadSheet(t), g()), De.value = t, Y.value = o.sheets.value[t].name, $e(() => {
|
|
3518
3528
|
const u = document.querySelector(".tab-rename-input");
|
|
3519
3529
|
u == null || u.focus(), u == null || u.select();
|
|
3520
3530
|
});
|
|
@@ -3533,10 +3543,10 @@ function kr(e, p, h, o, s) {
|
|
|
3533
3543
|
function c() {
|
|
3534
3544
|
oe && (document.removeEventListener("click", oe), oe = null);
|
|
3535
3545
|
}
|
|
3536
|
-
function
|
|
3546
|
+
function h(t, u, M) {
|
|
3537
3547
|
c();
|
|
3538
|
-
const D = 140,
|
|
3539
|
-
t + D > T && (t -= D), u +
|
|
3548
|
+
const D = 140, m = M.length * 28 + 8, T = window.innerWidth, _ = window.innerHeight;
|
|
3549
|
+
t + D > T && (t -= D), u + m > _ && (u -= m), Be.value = { x: t, y: u, items: M }, oe = () => {
|
|
3540
3550
|
Be.value = null, c();
|
|
3541
3551
|
}, setTimeout(() => document.addEventListener("click", oe, { once: !0 }), 0);
|
|
3542
3552
|
}
|
|
@@ -3551,13 +3561,13 @@ function kr(e, p, h, o, s) {
|
|
|
3551
3561
|
Ne.value = !1;
|
|
3552
3562
|
return;
|
|
3553
3563
|
}
|
|
3554
|
-
const
|
|
3555
|
-
Ne.value =
|
|
3564
|
+
const m = D.getBoundingClientRect();
|
|
3565
|
+
Ne.value = m.right > window.innerWidth;
|
|
3556
3566
|
}
|
|
3557
3567
|
function de(t, u) {
|
|
3558
|
-
t.preventDefault(), t.stopPropagation(),
|
|
3568
|
+
t.preventDefault(), t.stopPropagation(), h(t.clientX, t.clientY, [
|
|
3559
3569
|
{ label: U(e.locale.value, "insert"), action: () => {
|
|
3560
|
-
o.addSheet(),
|
|
3570
|
+
o.addSheet(), g();
|
|
3561
3571
|
} },
|
|
3562
3572
|
{ label: U(e.locale.value, "copy"), action: () => {
|
|
3563
3573
|
o.dupSheet(u);
|
|
@@ -3566,7 +3576,7 @@ function kr(e, p, h, o, s) {
|
|
|
3566
3576
|
be(u);
|
|
3567
3577
|
} },
|
|
3568
3578
|
{ label: U(e.locale.value, "delete"), action: () => {
|
|
3569
|
-
o.removeSheet(u),
|
|
3579
|
+
o.removeSheet(u), g();
|
|
3570
3580
|
}, disabled: o.sheetCount.value <= 1 },
|
|
3571
3581
|
{ label: U(e.locale.value, "moveSheetLeft"), action: () => {
|
|
3572
3582
|
o.moveSheet(u, -1);
|
|
@@ -3577,57 +3587,57 @@ function kr(e, p, h, o, s) {
|
|
|
3577
3587
|
]);
|
|
3578
3588
|
}
|
|
3579
3589
|
function n(t) {
|
|
3580
|
-
t.preventDefault(), !(t.target.closest(".tab-item") || t.target.closest(".tab-bar__add-btn")) &&
|
|
3590
|
+
t.preventDefault(), !(t.target.closest(".tab-item") || t.target.closest(".tab-bar__add-btn")) && h(t.clientX, t.clientY, [
|
|
3581
3591
|
{ label: U(e.locale.value, "insert"), action: () => {
|
|
3582
|
-
o.addSheet(),
|
|
3592
|
+
o.addSheet(), g();
|
|
3583
3593
|
} }
|
|
3584
3594
|
]);
|
|
3585
3595
|
}
|
|
3586
3596
|
function d(t) {
|
|
3587
|
-
t.preventDefault(), e.selectAll(),
|
|
3597
|
+
t.preventDefault(), e.selectAll(), g(), h(t.clientX, t.clientY, [
|
|
3588
3598
|
{ label: U(e.locale.value, "cut"), action: () => {
|
|
3589
|
-
|
|
3599
|
+
v.cutSelected(), o.emitModelData();
|
|
3590
3600
|
} },
|
|
3591
|
-
{ label: U(e.locale.value, "copy"), action: () =>
|
|
3601
|
+
{ label: U(e.locale.value, "copy"), action: () => v.copyToClipboard() },
|
|
3592
3602
|
{ label: U(e.locale.value, "paste"), action: () => {
|
|
3593
|
-
p.saveUndo(),
|
|
3594
|
-
|
|
3603
|
+
p.saveUndo(), v.pasteFromClipboard().then(() => {
|
|
3604
|
+
g(), $e(() => o.emitModelData());
|
|
3595
3605
|
});
|
|
3596
3606
|
} },
|
|
3597
3607
|
{ label: U(e.locale.value, "delete"), action: () => {
|
|
3598
|
-
p.saveUndo(),
|
|
3608
|
+
p.saveUndo(), v.clearSelected();
|
|
3599
3609
|
for (let u = 0; u < e.colCount; u++)
|
|
3600
3610
|
e.colWidths.value[u] = Qt;
|
|
3601
3611
|
for (let u = 0; u < e.rowCount; u++)
|
|
3602
3612
|
e.rowHeights.value[u] = void 0;
|
|
3603
|
-
|
|
3613
|
+
g(), o.emitModelData();
|
|
3604
3614
|
} }
|
|
3605
3615
|
]);
|
|
3606
3616
|
}
|
|
3607
3617
|
function w(t, u) {
|
|
3608
3618
|
t.preventDefault();
|
|
3609
|
-
const M = t.clientX, D = t.clientY,
|
|
3610
|
-
|
|
3619
|
+
const M = t.clientX, D = t.clientY, m = e.selection.value;
|
|
3620
|
+
m && m.startCol === 0 && m.endCol === e.colCount - 1 && u >= m.startRow && u <= m.endRow || (e.selectRange(0, u, e.colCount - 1, u), g());
|
|
3611
3621
|
const T = e.selection.value;
|
|
3612
|
-
|
|
3622
|
+
h(t.clientX, t.clientY, [
|
|
3613
3623
|
{ label: U(e.locale.value, "insert"), action: () => {
|
|
3614
|
-
p.saveUndo(), o.insertRows(T.startRow, T.endRow),
|
|
3624
|
+
p.saveUndo(), o.insertRows(T.startRow, T.endRow), g(), o.emitModelData();
|
|
3615
3625
|
}, disabled: T.endRow >= e.rowCount - 1 },
|
|
3616
3626
|
{ label: U(e.locale.value, "cut"), action: () => {
|
|
3617
|
-
p.saveUndo(),
|
|
3627
|
+
p.saveUndo(), v.copyRowCol();
|
|
3618
3628
|
for (let _ = T.startRow; _ <= T.endRow; _++)
|
|
3619
3629
|
for (let re = 0; re < e.colCount; re++)
|
|
3620
3630
|
e.delCell(e.cellKey(re, _));
|
|
3621
|
-
|
|
3631
|
+
g(), o.emitModelData();
|
|
3622
3632
|
} },
|
|
3623
|
-
{ label: U(e.locale.value, "copy"), action: () =>
|
|
3633
|
+
{ label: U(e.locale.value, "copy"), action: () => v.copyRowCol() },
|
|
3624
3634
|
{ label: U(e.locale.value, "paste"), action: () => {
|
|
3625
|
-
p.saveUndo(),
|
|
3626
|
-
|
|
3635
|
+
p.saveUndo(), v.pasteFromClipboard().then(() => {
|
|
3636
|
+
g(), $e(() => o.emitModelData());
|
|
3627
3637
|
});
|
|
3628
3638
|
} },
|
|
3629
3639
|
{ label: U(e.locale.value, "delete"), action: () => {
|
|
3630
|
-
p.saveUndo(), o.deleteRows(T.startRow, T.endRow),
|
|
3640
|
+
p.saveUndo(), o.deleteRows(T.startRow, T.endRow), g(), o.emitModelData();
|
|
3631
3641
|
} },
|
|
3632
3642
|
{ label: `${U(e.locale.value, "rowHeight")}...`, action: () => we("row", M, D) },
|
|
3633
3643
|
{ label: U(e.locale.value, "autoRowHeight"), action: () => o.resetRowHeight() }
|
|
@@ -3635,51 +3645,51 @@ function kr(e, p, h, o, s) {
|
|
|
3635
3645
|
}
|
|
3636
3646
|
function l(t, u) {
|
|
3637
3647
|
t.preventDefault();
|
|
3638
|
-
const M = t.clientX, D = t.clientY,
|
|
3639
|
-
|
|
3648
|
+
const M = t.clientX, D = t.clientY, m = e.selection.value;
|
|
3649
|
+
m && m.startRow === 0 && m.endRow === e.rowCount - 1 && u >= m.startCol && u <= m.endCol || (e.selectRange(u, 0, u, e.rowCount - 1), g());
|
|
3640
3650
|
const T = e.selection.value;
|
|
3641
|
-
|
|
3651
|
+
h(t.clientX, t.clientY, [
|
|
3642
3652
|
{ label: U(e.locale.value, "insert"), action: () => {
|
|
3643
|
-
p.saveUndo(), o.insertCols(T.startCol, T.endCol),
|
|
3653
|
+
p.saveUndo(), o.insertCols(T.startCol, T.endCol), g(), o.emitModelData();
|
|
3644
3654
|
}, disabled: T.endCol >= e.colCount - 1 },
|
|
3645
3655
|
{ label: U(e.locale.value, "cut"), action: () => {
|
|
3646
|
-
p.saveUndo(),
|
|
3656
|
+
p.saveUndo(), v.copyRowCol();
|
|
3647
3657
|
for (let _ = T.startCol; _ <= T.endCol; _++)
|
|
3648
3658
|
for (let re = 0; re < e.rowCount; re++)
|
|
3649
3659
|
e.delCell(e.cellKey(_, re));
|
|
3650
|
-
|
|
3660
|
+
g(), o.emitModelData();
|
|
3651
3661
|
} },
|
|
3652
|
-
{ label: U(e.locale.value, "copy"), action: () =>
|
|
3662
|
+
{ label: U(e.locale.value, "copy"), action: () => v.copyRowCol() },
|
|
3653
3663
|
{ label: U(e.locale.value, "paste"), action: () => {
|
|
3654
|
-
p.saveUndo(),
|
|
3655
|
-
|
|
3664
|
+
p.saveUndo(), v.pasteFromClipboard().then(() => {
|
|
3665
|
+
g(), $e(() => o.emitModelData());
|
|
3656
3666
|
});
|
|
3657
3667
|
} },
|
|
3658
3668
|
{ label: U(e.locale.value, "delete"), action: () => {
|
|
3659
|
-
p.saveUndo(), o.deleteCols(T.startCol, T.endCol),
|
|
3669
|
+
p.saveUndo(), o.deleteCols(T.startCol, T.endCol), g(), o.emitModelData();
|
|
3660
3670
|
} },
|
|
3661
3671
|
{ label: `${U(e.locale.value, "colWidth")}...`, action: () => we("col", M, D) },
|
|
3662
3672
|
{ label: U(e.locale.value, "defaultColWidth"), action: () => o.resetColWidth() }
|
|
3663
3673
|
]);
|
|
3664
3674
|
}
|
|
3665
3675
|
function r(t, u, M) {
|
|
3666
|
-
t.preventDefault(), e.isSelected(u, M) || (e.selectCell(u, M),
|
|
3667
|
-
const D = e.selection.value,
|
|
3668
|
-
|
|
3676
|
+
t.preventDefault(), e.isSelected(u, M) || (e.selectCell(u, M), g());
|
|
3677
|
+
const D = e.selection.value, m = !!(D && D.startCol === D.endCol && D.startRow === D.endRow);
|
|
3678
|
+
h(t.clientX, t.clientY, [
|
|
3669
3679
|
{ label: U(e.locale.value, "cut"), action: () => {
|
|
3670
|
-
|
|
3680
|
+
v.cutSelected(), o.emitModelData();
|
|
3671
3681
|
} },
|
|
3672
|
-
{ label: U(e.locale.value, "copy"), action: () =>
|
|
3682
|
+
{ label: U(e.locale.value, "copy"), action: () => v.copyToClipboard() },
|
|
3673
3683
|
{ label: U(e.locale.value, "paste"), action: () => {
|
|
3674
|
-
p.saveUndo(),
|
|
3675
|
-
|
|
3684
|
+
p.saveUndo(), v.pasteFromClipboard().then(() => {
|
|
3685
|
+
g(), $e(() => o.emitModelData());
|
|
3676
3686
|
});
|
|
3677
3687
|
} },
|
|
3678
3688
|
{ label: U(e.locale.value, "delete"), action: () => {
|
|
3679
|
-
p.saveUndo(),
|
|
3689
|
+
p.saveUndo(), v.clearSelected(), g(), o.emitModelData();
|
|
3680
3690
|
} },
|
|
3681
3691
|
{ label: U(e.locale.value, "calculate"), children: [
|
|
3682
|
-
{ label: U(e.locale.value, "sum"), action:
|
|
3692
|
+
{ label: U(e.locale.value, "sum"), action: v.sumSelected, disabled: m }
|
|
3683
3693
|
] }
|
|
3684
3694
|
]);
|
|
3685
3695
|
}
|
|
@@ -3691,14 +3701,14 @@ function kr(e, p, h, o, s) {
|
|
|
3691
3701
|
function we(t, u, M) {
|
|
3692
3702
|
ce();
|
|
3693
3703
|
const D = e.selection.value;
|
|
3694
|
-
let
|
|
3704
|
+
let m = "";
|
|
3695
3705
|
if (D) {
|
|
3696
3706
|
const Ee = t === "row" ? e.getRowHeight(D.startRow) : e.colWidths.value[D.startCol];
|
|
3697
|
-
|
|
3707
|
+
m = Ee != null && Ee > 0 ? String(Math.round(Ee)) : "";
|
|
3698
3708
|
}
|
|
3699
3709
|
const T = 220, _ = 118;
|
|
3700
3710
|
let re = u, ue = M;
|
|
3701
|
-
re + T > window.innerWidth && (re = window.innerWidth - T - 8), ue + _ > window.innerHeight && (ue = window.innerHeight - _ - 8), re < 8 && (re = 8), ue < 8 && (ue = 8), E.value = { type: t, x: re, y: ue, value:
|
|
3711
|
+
re + T > window.innerWidth && (re = window.innerWidth - T - 8), ue + _ > window.innerHeight && (ue = window.innerHeight - _ - 8), re < 8 && (re = 8), ue < 8 && (ue = 8), E.value = { type: t, x: re, y: ue, value: m, error: "" }, $ = () => {
|
|
3702
3712
|
E.value = null;
|
|
3703
3713
|
}, setTimeout(() => document.addEventListener("mousedown", $, { once: !0 }), 0), $e(() => {
|
|
3704
3714
|
const Ee = I.value;
|
|
@@ -3709,8 +3719,8 @@ function kr(e, p, h, o, s) {
|
|
|
3709
3719
|
const u = E.value;
|
|
3710
3720
|
if (!u)
|
|
3711
3721
|
return;
|
|
3712
|
-
const M = t.target, D = M.value,
|
|
3713
|
-
u.value =
|
|
3722
|
+
const M = t.target, D = M.value, m = D.replace(/[^\d]/g, "");
|
|
3723
|
+
u.value = m, D !== m && (M.value = m), u.error = "";
|
|
3714
3724
|
}
|
|
3715
3725
|
function Ve(t) {
|
|
3716
3726
|
t.key === "Enter" ? (t.preventDefault(), ye()) : t.key === "Escape" && (t.preventDefault(), _e());
|
|
@@ -3719,19 +3729,19 @@ function kr(e, p, h, o, s) {
|
|
|
3719
3729
|
const t = E.value;
|
|
3720
3730
|
if (!t)
|
|
3721
3731
|
return;
|
|
3722
|
-
const u = t.value.trim(), M = Number(u), D = t.type === "row",
|
|
3732
|
+
const u = t.value.trim(), M = Number(u), D = t.type === "row", m = D ? vl : fl, T = D ? gl : xl;
|
|
3723
3733
|
if (u === "" || !Number.isFinite(M)) {
|
|
3724
3734
|
_e();
|
|
3725
3735
|
return;
|
|
3726
3736
|
}
|
|
3727
|
-
const _ = Math.max(
|
|
3737
|
+
const _ = Math.max(m, Math.min(T, Math.round(M)));
|
|
3728
3738
|
t.value = String(_), t.error = "";
|
|
3729
3739
|
}
|
|
3730
3740
|
function ye() {
|
|
3731
3741
|
const t = E.value, u = e.selection.value;
|
|
3732
3742
|
if (!t || !u)
|
|
3733
3743
|
return;
|
|
3734
|
-
const M = t.value.trim(), D = Number(M),
|
|
3744
|
+
const M = t.value.trim(), D = Number(M), m = t.type === "row", T = m ? vl : fl, _ = m ? gl : xl;
|
|
3735
3745
|
if (M === "" || !Number.isFinite(D)) {
|
|
3736
3746
|
t.error = U(e.locale.value, "dimNumberError");
|
|
3737
3747
|
return;
|
|
@@ -3741,23 +3751,23 @@ function kr(e, p, h, o, s) {
|
|
|
3741
3751
|
return;
|
|
3742
3752
|
}
|
|
3743
3753
|
const re = D;
|
|
3744
|
-
if (p.saveUndo(),
|
|
3754
|
+
if (p.saveUndo(), m)
|
|
3745
3755
|
for (let ue = u.startRow; ue <= u.endRow; ue++)
|
|
3746
3756
|
e.rowHeights.value[ue] = re;
|
|
3747
3757
|
else
|
|
3748
3758
|
for (let ue = u.startCol; ue <= u.endCol; ue++)
|
|
3749
3759
|
e.colWidths.value[ue] = re;
|
|
3750
|
-
|
|
3760
|
+
g(), o.emitModelData(), _e();
|
|
3751
3761
|
}
|
|
3752
3762
|
function _e() {
|
|
3753
3763
|
ce(), E.value = null;
|
|
3754
3764
|
}
|
|
3755
3765
|
const B = se(() => {
|
|
3756
3766
|
var ul;
|
|
3757
|
-
const t = !e.editingCell.value, u = e.editingCell.value ?? e.activeCell.value, M = u.col, D = u.row,
|
|
3767
|
+
const t = !e.editingCell.value, u = e.editingCell.value ?? e.activeCell.value, M = u.col, D = u.row, m = (ul = e.cells[e.cellKey(M, D)]) == null ? void 0 : ul.style, T = e.cellFontSize(M, D), _ = typeof (m == null ? void 0 : m.fontFamily) == "string" && m.fontFamily ? m.fontFamily : Sl, re = (m == null ? void 0 : m.fontWeight) === "bold" ? "bold" : "normal", ue = (m == null ? void 0 : m.fontStyle) === "italic" ? "italic" : "normal", Ee = (m == null ? void 0 : m.underline) === "underline" ? "underline" : (m == null ? void 0 : m.strikethrough) === "line-through" ? "line-through" : "none", ct = (m == null ? void 0 : m.underline) === "underline" && (m == null ? void 0 : m.strikethrough) === "line-through" ? "underline line-through" : Ee, lt = typeof (m == null ? void 0 : m.color) == "string" ? m.color : void 0, Vt = typeof (m == null ? void 0 : m.backgroundColor) == "string" ? m.backgroundColor : void 0, Et = typeof (m == null ? void 0 : m.textAlign) == "string" ? m.textAlign : "left", yt = typeof (m == null ? void 0 : m.verticalAlign) == "string" ? m.verticalAlign : "top", Lt = e.findMerge(M, D), Pt = Lt ? e.colPositions.value[Lt.range.endCol + 1] - e.colPositions.value[M] : e.colWidths.value[M], ft = Lt ? e.rowPositions.value[Lt.range.endRow + 1] - e.rowPositions.value[D] : e.getRowHeight(D), Cl = 2, { ascent: Ut, descent: it } = e.measureFontMetrics(_, T, re, ue), il = Ut + it, Ot = (e.editValue.value ? e.editValue.value.split(`
|
|
3758
3768
|
`).length : 1) * il, cl = e.BASE_CELL_VPAD - Cl;
|
|
3759
|
-
let St = 0,
|
|
3760
|
-
return yt === "middle" ? (St = Math.floor((ft - Ot) / 2),
|
|
3769
|
+
let St = 0, Tt = 0;
|
|
3770
|
+
return yt === "middle" ? (St = Math.floor((ft - Ot) / 2), Tt = Math.max(0, ft - Ot - St)) : yt === "top" ? (St = cl, Tt = Math.max(0, ft - Ot - St)) : yt === "bottom" && (Tt = cl, St = Math.max(0, ft - Ot - Tt)), {
|
|
3761
3771
|
left: `${Re + e.colPositions.value[M] - e.scrollX.value}px`,
|
|
3762
3772
|
top: `${Se + e.rowPositions.value[D] - e.scrollY.value}px`,
|
|
3763
3773
|
width: `${Pt}px`,
|
|
@@ -3771,7 +3781,7 @@ function kr(e, p, h, o, s) {
|
|
|
3771
3781
|
textAlign: Et,
|
|
3772
3782
|
paddingTop: `${St}px`,
|
|
3773
3783
|
paddingRight: "3px",
|
|
3774
|
-
paddingBottom: `${
|
|
3784
|
+
paddingBottom: `${Tt}px`,
|
|
3775
3785
|
paddingLeft: "3px",
|
|
3776
3786
|
opacity: t ? 0 : 1,
|
|
3777
3787
|
pointerEvents: t ? "none" : "auto",
|
|
@@ -3789,20 +3799,20 @@ function kr(e, p, h, o, s) {
|
|
|
3789
3799
|
return Math.max(0, o.viewSize.h - Se - el);
|
|
3790
3800
|
}
|
|
3791
3801
|
const ne = se(() => O()), pe = se(() => P()), N = se(() => Math.max(0, ne.value - 11 * 2)), ve = se(() => Math.max(0, pe.value - 11 * 2)), Fe = se(() => o.maxScrollX.value <= 0 ? N.value : Math.max(24, O() / e.totalWidth.value * N.value)), Ke = se(() => o.maxScrollX.value <= 0 ? 0 : e.scrollX.value / o.maxScrollX.value * (N.value - Fe.value)), gt = se(() => o.maxScrollY.value <= 0 ? ve.value : Math.max(24, P() / e.totalHeight.value * ve.value)), Ct = se(() => o.maxScrollY.value <= 0 ? 0 : e.scrollY.value / o.maxScrollY.value * (ve.value - gt.value));
|
|
3792
|
-
let tt = null, st = 0,
|
|
3802
|
+
let tt = null, st = 0, Dt = 0;
|
|
3793
3803
|
function ol(t) {
|
|
3794
|
-
t.preventDefault(), tt = "v", st = t.clientY,
|
|
3804
|
+
t.preventDefault(), tt = "v", st = t.clientY, Dt = e.scrollY.value, document.addEventListener("mousemove", x), document.addEventListener("mouseup", R);
|
|
3795
3805
|
}
|
|
3796
3806
|
function rt(t) {
|
|
3797
|
-
t.preventDefault(), tt = "h", st = t.clientX,
|
|
3807
|
+
t.preventDefault(), tt = "h", st = t.clientX, Dt = e.scrollX.value, document.addEventListener("mousemove", x), document.addEventListener("mouseup", R);
|
|
3798
3808
|
}
|
|
3799
3809
|
function x(t) {
|
|
3800
3810
|
if (tt === "v") {
|
|
3801
3811
|
const M = (t.clientY - st) / (ve.value - gt.value);
|
|
3802
|
-
o.clampScroll(null,
|
|
3812
|
+
o.clampScroll(null, Dt + M * o.maxScrollY.value), g();
|
|
3803
3813
|
} else if (tt === "h") {
|
|
3804
3814
|
const M = (t.clientX - st) / (N.value - Fe.value);
|
|
3805
|
-
o.clampScroll(
|
|
3815
|
+
o.clampScroll(Dt + M * o.maxScrollX.value, null), g();
|
|
3806
3816
|
}
|
|
3807
3817
|
}
|
|
3808
3818
|
function R() {
|
|
@@ -3812,13 +3822,13 @@ function kr(e, p, h, o, s) {
|
|
|
3812
3822
|
if (tt)
|
|
3813
3823
|
return;
|
|
3814
3824
|
const u = t.currentTarget.getBoundingClientRect(), M = t.clientY - u.top;
|
|
3815
|
-
M < Ct.value ? o.clampScroll(null, e.scrollY.value - P()) : M > Ct.value + gt.value && o.clampScroll(null, e.scrollY.value + P()),
|
|
3825
|
+
M < Ct.value ? o.clampScroll(null, e.scrollY.value - P()) : M > Ct.value + gt.value && o.clampScroll(null, e.scrollY.value + P()), g();
|
|
3816
3826
|
}
|
|
3817
3827
|
function G(t) {
|
|
3818
3828
|
if (tt)
|
|
3819
3829
|
return;
|
|
3820
3830
|
const u = t.currentTarget.getBoundingClientRect(), M = t.clientX - u.left;
|
|
3821
|
-
M < Ke.value ? o.clampScroll(e.scrollX.value - O(), null) : M > Ke.value + Fe.value && o.clampScroll(e.scrollX.value + O(), null),
|
|
3831
|
+
M < Ke.value ? o.clampScroll(e.scrollX.value - O(), null) : M > Ke.value + Fe.value && o.clampScroll(e.scrollX.value + O(), null), g();
|
|
3822
3832
|
}
|
|
3823
3833
|
let Z = !1, ie = 0, ge = 0, i = !1, C = !1, H = 0, K = 0, J = 0, te = 0, Q = 0, me = 0, Te = 0, Ze = 0, Ue = !1, et = !1, at = 0, mt = 0, nl = 0, ml = -1, pl = -1;
|
|
3824
3834
|
function hl(t) {
|
|
@@ -3827,76 +3837,76 @@ function kr(e, p, h, o, s) {
|
|
|
3827
3837
|
t.preventDefault(), Be.value = null;
|
|
3828
3838
|
const u = zt(t, o.canvasRef.value);
|
|
3829
3839
|
if (u.y < Se && u.x >= Re) {
|
|
3830
|
-
const
|
|
3840
|
+
const m = u.x - Re + e.scrollX.value, T = e.hitCol(m);
|
|
3831
3841
|
if (T >= 0 && Math.abs(u.x - (Re + e.colPositions.value[T + 1] - e.scrollX.value)) <= 4) {
|
|
3832
|
-
p.saveUndo(), i = !0, H = T, J = e.colWidths.value[T], te =
|
|
3842
|
+
p.saveUndo(), i = !0, H = T, J = e.colWidths.value[T], te = m, g();
|
|
3833
3843
|
return;
|
|
3834
3844
|
}
|
|
3835
3845
|
}
|
|
3836
3846
|
if (u.x < Re && u.y >= Se) {
|
|
3837
|
-
const
|
|
3847
|
+
const m = u.y - Se + e.scrollY.value, T = e.hitRow(m);
|
|
3838
3848
|
if (T >= 0 && Math.abs(u.y - (Se + e.rowPositions.value[T + 1] - e.scrollY.value)) <= 4) {
|
|
3839
|
-
p.saveUndo(), C = !0, K = T, J = e.getRowHeight(T), te =
|
|
3849
|
+
p.saveUndo(), C = !0, K = T, J = e.getRowHeight(T), te = m, g();
|
|
3840
3850
|
return;
|
|
3841
3851
|
}
|
|
3842
3852
|
}
|
|
3843
3853
|
if (u.x < Re || u.y < Se) {
|
|
3844
3854
|
if (e.commitEdit(), u.y < Se && u.x >= Re) {
|
|
3845
|
-
const
|
|
3846
|
-
|
|
3855
|
+
const m = e.hitCol(u.x - Re + e.scrollX.value);
|
|
3856
|
+
m >= 0 && (e.selectRange(m, 0, m, e.rowCount - 1), Z = !0, ie = m, ge = 0);
|
|
3847
3857
|
} else if (u.x < Re && u.y >= Se) {
|
|
3848
|
-
const
|
|
3849
|
-
|
|
3858
|
+
const m = e.hitRow(u.y - Se + e.scrollY.value);
|
|
3859
|
+
m >= 0 && (e.selectRange(0, m, e.colCount - 1, m), Z = !0, ie = 0, ge = m);
|
|
3850
3860
|
} else
|
|
3851
3861
|
u.x < Re && u.y < Se && e.selectAll();
|
|
3852
|
-
|
|
3862
|
+
g();
|
|
3853
3863
|
return;
|
|
3854
3864
|
}
|
|
3855
3865
|
const M = e.hitCol(u.x - Re + e.scrollX.value), D = e.hitRow(u.y - Se + e.scrollY.value);
|
|
3856
3866
|
if (!(M < 0 || D < 0)) {
|
|
3857
3867
|
if (e.commitEdit(), t.shiftKey && e.selection.value) {
|
|
3858
|
-
const
|
|
3859
|
-
e.selectRange(
|
|
3868
|
+
const m = e.selection.value;
|
|
3869
|
+
e.selectRange(m.startCol, m.startRow, M, D);
|
|
3860
3870
|
} else
|
|
3861
3871
|
e.selectCell(M, D);
|
|
3862
|
-
Z = !0, ie = M, ge = D, o.focusEditInput(),
|
|
3872
|
+
Z = !0, ie = M, ge = D, o.focusEditInput(), g();
|
|
3863
3873
|
}
|
|
3864
3874
|
}
|
|
3865
3875
|
function bl(t) {
|
|
3866
3876
|
if (i) {
|
|
3867
3877
|
const T = zt(t, o.canvasRef.value).x - Re + e.scrollX.value - te, _ = J + T;
|
|
3868
|
-
_ >= fl && _ <= xl ? e.colWidths.value[H] = _ : _ < fl ? e.colWidths.value[H] = fl : e.colWidths.value[H] = xl,
|
|
3878
|
+
_ >= fl && _ <= xl ? e.colWidths.value[H] = _ : _ < fl ? e.colWidths.value[H] = fl : e.colWidths.value[H] = xl, g();
|
|
3869
3879
|
return;
|
|
3870
3880
|
}
|
|
3871
3881
|
if (C) {
|
|
3872
3882
|
const T = zt(t, o.canvasRef.value).y - Se + e.scrollY.value - te, _ = J + T;
|
|
3873
|
-
_ >= vl && _ <= gl ? e.rowHeights.value[K] = _ : _ < vl ? e.rowHeights.value[K] = vl : e.rowHeights.value[K] = gl,
|
|
3883
|
+
_ >= vl && _ <= gl ? e.rowHeights.value[K] = _ : _ < vl ? e.rowHeights.value[K] = vl : e.rowHeights.value[K] = gl, g();
|
|
3874
3884
|
return;
|
|
3875
3885
|
}
|
|
3876
3886
|
if (!Z) {
|
|
3877
|
-
const
|
|
3878
|
-
if (!
|
|
3887
|
+
const m = o.canvasRef.value;
|
|
3888
|
+
if (!m)
|
|
3879
3889
|
return;
|
|
3880
3890
|
if (p.paintFmt.value) {
|
|
3881
|
-
|
|
3891
|
+
m.style.cursor = "copy";
|
|
3882
3892
|
return;
|
|
3883
3893
|
}
|
|
3884
|
-
const T = zt(t,
|
|
3894
|
+
const T = zt(t, m);
|
|
3885
3895
|
if (T.y < Se && T.x >= Re) {
|
|
3886
3896
|
const _ = e.hitCol(T.x - Re + e.scrollX.value);
|
|
3887
3897
|
if (_ >= 0 && Math.abs(T.x - (Re + e.colPositions.value[_ + 1] - e.scrollX.value)) <= 4) {
|
|
3888
|
-
|
|
3898
|
+
m.style.cursor = "col-resize";
|
|
3889
3899
|
return;
|
|
3890
3900
|
}
|
|
3891
3901
|
}
|
|
3892
3902
|
if (T.x < Re && T.y >= Se) {
|
|
3893
3903
|
const _ = e.hitRow(T.y - Se + e.scrollY.value);
|
|
3894
3904
|
if (_ >= 0 && Math.abs(T.y - (Se + e.rowPositions.value[_ + 1] - e.scrollY.value)) <= 4) {
|
|
3895
|
-
|
|
3905
|
+
m.style.cursor = "row-resize";
|
|
3896
3906
|
return;
|
|
3897
3907
|
}
|
|
3898
3908
|
}
|
|
3899
|
-
|
|
3909
|
+
m.style.cursor = "cell";
|
|
3900
3910
|
return;
|
|
3901
3911
|
}
|
|
3902
3912
|
const u = zt(t, o.canvasRef.value);
|
|
@@ -3904,23 +3914,23 @@ function kr(e, p, h, o, s) {
|
|
|
3904
3914
|
return;
|
|
3905
3915
|
if (u.x < Re || u.y < Se) {
|
|
3906
3916
|
if (u.y < Se && u.x >= Re) {
|
|
3907
|
-
const
|
|
3908
|
-
|
|
3917
|
+
const m = e.hitCol(u.x - Re + e.scrollX.value);
|
|
3918
|
+
m >= 0 && e.selectRange(Math.min(ie, m), 0, Math.max(ie, m), e.rowCount - 1);
|
|
3909
3919
|
} else if (u.x < Re && u.y >= Se) {
|
|
3910
|
-
const
|
|
3911
|
-
|
|
3920
|
+
const m = e.hitRow(u.y - Se + e.scrollY.value);
|
|
3921
|
+
m >= 0 && e.selectRange(0, Math.min(ge, m), e.colCount - 1, Math.max(ge, m));
|
|
3912
3922
|
}
|
|
3913
|
-
|
|
3923
|
+
g();
|
|
3914
3924
|
return;
|
|
3915
3925
|
}
|
|
3916
3926
|
const M = e.hitCol(u.x - Re + e.scrollX.value), D = e.hitRow(u.y - Se + e.scrollY.value);
|
|
3917
|
-
M < 0 || D < 0 || (ge === 0 && ie >= 0 && e.selection.value && e.selection.value.startRow === 0 && e.selection.value.endRow === e.rowCount - 1 ? e.selectRange(Math.min(ie, M), 0, Math.max(ie, M), e.rowCount - 1) : ie === 0 && ge >= 0 && e.selection.value && e.selection.value.startCol === 0 && e.selection.value.endCol === e.colCount - 1 ? e.selectRange(0, Math.min(ge, D), e.colCount - 1, Math.max(ge, D)) : e.selectRange(ie, ge, M, D),
|
|
3927
|
+
M < 0 || D < 0 || (ge === 0 && ie >= 0 && e.selection.value && e.selection.value.startRow === 0 && e.selection.value.endRow === e.rowCount - 1 ? e.selectRange(Math.min(ie, M), 0, Math.max(ie, M), e.rowCount - 1) : ie === 0 && ge >= 0 && e.selection.value && e.selection.value.startCol === 0 && e.selection.value.endCol === e.colCount - 1 ? e.selectRange(0, Math.min(ge, D), e.colCount - 1, Math.max(ge, D)) : e.selectRange(ie, ge, M, D), g());
|
|
3918
3928
|
}
|
|
3919
3929
|
function Bl(t) {
|
|
3920
3930
|
const u = i || C;
|
|
3921
3931
|
Z = !1, i = !1, C = !1, u && o.scheduleOptEmit(), p.paintFmt.value && p.applyPaintFormat();
|
|
3922
3932
|
}
|
|
3923
|
-
function
|
|
3933
|
+
function Ft() {
|
|
3924
3934
|
const t = i || C;
|
|
3925
3935
|
Z = !1, i = !1, C = !1, t && o.scheduleOptEmit();
|
|
3926
3936
|
}
|
|
@@ -3951,10 +3961,10 @@ function kr(e, p, h, o, s) {
|
|
|
3951
3961
|
if (u.x < Re || u.y < Se)
|
|
3952
3962
|
return;
|
|
3953
3963
|
const M = e.hitCol(u.x - Re + e.scrollX.value), D = e.hitRow(u.y - Se + e.scrollY.value);
|
|
3954
|
-
M < 0 || D < 0 || (e.selectCell(M, D), e.ensureVisible(M, D), e.startEdit(),
|
|
3964
|
+
M < 0 || D < 0 || (e.selectCell(M, D), e.ensureVisible(M, D), e.startEdit(), g(), o.focusEditInput());
|
|
3955
3965
|
}
|
|
3956
3966
|
function Kl(t) {
|
|
3957
|
-
o.clampScroll(e.scrollX.value + t.deltaX, e.scrollY.value + t.deltaY),
|
|
3967
|
+
o.clampScroll(e.scrollX.value + t.deltaX, e.scrollY.value + t.deltaY), g();
|
|
3958
3968
|
}
|
|
3959
3969
|
function _l(t) {
|
|
3960
3970
|
if (t.touches.length !== 1) {
|
|
@@ -3964,8 +3974,8 @@ function kr(e, p, h, o, s) {
|
|
|
3964
3974
|
const u = t.touches[0], M = o.canvasRef.value;
|
|
3965
3975
|
if (!M)
|
|
3966
3976
|
return;
|
|
3967
|
-
const D = M.getBoundingClientRect(),
|
|
3968
|
-
|
|
3977
|
+
const D = M.getBoundingClientRect(), m = u.clientX - D.left, T = u.clientY - D.top;
|
|
3978
|
+
m >= Re && T >= Se && (t.preventDefault(), Ue = !0, et = !1, Q = m, me = T, Te = e.scrollX.value, Ze = e.scrollY.value, at = e.hitCol(m - Re + e.scrollX.value), mt = e.hitRow(T - Se + e.scrollY.value));
|
|
3969
3979
|
}
|
|
3970
3980
|
function eo(t) {
|
|
3971
3981
|
if (!Ue || t.touches.length !== 1)
|
|
@@ -3973,13 +3983,13 @@ function kr(e, p, h, o, s) {
|
|
|
3973
3983
|
const u = t.touches[0], M = o.canvasRef.value;
|
|
3974
3984
|
if (!M)
|
|
3975
3985
|
return;
|
|
3976
|
-
const D = M.getBoundingClientRect(),
|
|
3977
|
-
(Math.abs(
|
|
3986
|
+
const D = M.getBoundingClientRect(), m = u.clientX - D.left, T = u.clientY - D.top;
|
|
3987
|
+
(Math.abs(m - Q) > 8 || Math.abs(T - me) > 8) && (et = !0, t.preventDefault(), o.clampScroll(Te + (Q - m), Ze + (me - T)), g());
|
|
3978
3988
|
}
|
|
3979
3989
|
function to() {
|
|
3980
3990
|
if (Ue && (Ue = !1, !et && at >= 0 && mt >= 0)) {
|
|
3981
3991
|
const t = Date.now();
|
|
3982
|
-
at === ml && mt === pl && t - nl < 300 ? (e.selectCell(at, mt), e.startEdit(),
|
|
3992
|
+
at === ml && mt === pl && t - nl < 300 ? (e.selectCell(at, mt), e.startEdit(), g(), o.focusEditInput(), nl = 0) : (e.commitEdit(), e.selectCell(at, mt), g(), nl = t), ml = at, pl = mt, o.focusEditInput();
|
|
3983
3993
|
}
|
|
3984
3994
|
}
|
|
3985
3995
|
function Dl(t) {
|
|
@@ -3994,10 +4004,10 @@ function kr(e, p, h, o, s) {
|
|
|
3994
4004
|
const u = t.ctrlKey || t.metaKey, M = t.shiftKey;
|
|
3995
4005
|
switch (!0) {
|
|
3996
4006
|
case (u && (t.key === "c" || t.key === "C")):
|
|
3997
|
-
t.preventDefault(),
|
|
4007
|
+
t.preventDefault(), v.copyToClipboard();
|
|
3998
4008
|
return;
|
|
3999
4009
|
case (u && (t.key === "x" || t.key === "X")):
|
|
4000
|
-
t.preventDefault(),
|
|
4010
|
+
t.preventDefault(), v.cutSelected();
|
|
4001
4011
|
return;
|
|
4002
4012
|
case (u && (t.key === "z" || t.key === "Z")):
|
|
4003
4013
|
t.preventDefault(), p.undo();
|
|
@@ -4006,59 +4016,59 @@ function kr(e, p, h, o, s) {
|
|
|
4006
4016
|
t.preventDefault(), p.redo();
|
|
4007
4017
|
return;
|
|
4008
4018
|
case (u && (t.key === "v" || t.key === "V")):
|
|
4009
|
-
t.preventDefault(), p.saveUndo(),
|
|
4010
|
-
|
|
4019
|
+
t.preventDefault(), p.saveUndo(), v.pasteFromClipboard().then(() => {
|
|
4020
|
+
g(), $e(() => o.emitModelData());
|
|
4011
4021
|
});
|
|
4012
4022
|
return;
|
|
4013
4023
|
case (u && (t.key === "a" || t.key === "A")):
|
|
4014
|
-
t.preventDefault(), e.selectAll(),
|
|
4024
|
+
t.preventDefault(), e.selectAll(), g();
|
|
4015
4025
|
return;
|
|
4016
4026
|
case (u && t.key === "Home"):
|
|
4017
|
-
t.preventDefault(), e.selectCell(0, 0), e.ensureVisible(0, 0),
|
|
4027
|
+
t.preventDefault(), e.selectCell(0, 0), e.ensureVisible(0, 0), g();
|
|
4018
4028
|
return;
|
|
4019
4029
|
case (u && t.key === "End"):
|
|
4020
|
-
t.preventDefault(), e.selectCell(e.colCount - 1, e.rowCount - 1), e.ensureVisible(e.colCount - 1, e.rowCount - 1),
|
|
4030
|
+
t.preventDefault(), e.selectCell(e.colCount - 1, e.rowCount - 1), e.ensureVisible(e.colCount - 1, e.rowCount - 1), g();
|
|
4021
4031
|
return;
|
|
4022
4032
|
case t.key === "Home":
|
|
4023
|
-
t.preventDefault(), e.selectCell(0, e.activeCell.value.row), e.ensureVisible(0, e.activeCell.value.row),
|
|
4033
|
+
t.preventDefault(), e.selectCell(0, e.activeCell.value.row), e.ensureVisible(0, e.activeCell.value.row), g();
|
|
4024
4034
|
return;
|
|
4025
4035
|
case t.key === "End":
|
|
4026
|
-
t.preventDefault(), e.selectCell(e.colCount - 1, e.activeCell.value.row), e.ensureVisible(e.colCount - 1, e.activeCell.value.row),
|
|
4036
|
+
t.preventDefault(), e.selectCell(e.colCount - 1, e.activeCell.value.row), e.ensureVisible(e.colCount - 1, e.activeCell.value.row), g();
|
|
4027
4037
|
return;
|
|
4028
4038
|
case t.key === "ArrowUp":
|
|
4029
|
-
t.preventDefault(), e.moveActive(0, -1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row),
|
|
4039
|
+
t.preventDefault(), e.moveActive(0, -1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), g();
|
|
4030
4040
|
return;
|
|
4031
4041
|
case t.key === "ArrowDown":
|
|
4032
|
-
t.preventDefault(), e.moveActive(0, 1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row),
|
|
4042
|
+
t.preventDefault(), e.moveActive(0, 1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), g();
|
|
4033
4043
|
return;
|
|
4034
4044
|
case t.key === "ArrowLeft":
|
|
4035
|
-
t.preventDefault(), e.moveActive(-1, 0), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row),
|
|
4045
|
+
t.preventDefault(), e.moveActive(-1, 0), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), g();
|
|
4036
4046
|
return;
|
|
4037
4047
|
case t.key === "ArrowRight":
|
|
4038
|
-
t.preventDefault(), e.moveActive(1, 0), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row),
|
|
4048
|
+
t.preventDefault(), e.moveActive(1, 0), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), g();
|
|
4039
4049
|
return;
|
|
4040
4050
|
case t.key === "Tab":
|
|
4041
|
-
t.preventDefault(), e.moveActive(M ? -1 : 1, 0), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row),
|
|
4051
|
+
t.preventDefault(), e.moveActive(M ? -1 : 1, 0), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), g();
|
|
4042
4052
|
return;
|
|
4043
4053
|
case t.key === "Enter":
|
|
4044
|
-
t.preventDefault(), e.moveActive(0, M ? -1 : 1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row),
|
|
4054
|
+
t.preventDefault(), e.moveActive(0, M ? -1 : 1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), g();
|
|
4045
4055
|
return;
|
|
4046
4056
|
case t.key === "F2":
|
|
4047
|
-
t.preventDefault(), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(),
|
|
4057
|
+
t.preventDefault(), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(), g(), o.focusEditInput();
|
|
4048
4058
|
return;
|
|
4049
4059
|
case t.key === "Delete":
|
|
4050
4060
|
case t.key === "Backspace":
|
|
4051
|
-
t.preventDefault(), p.saveUndo(),
|
|
4061
|
+
t.preventDefault(), p.saveUndo(), v.clearSelected(), g();
|
|
4052
4062
|
return;
|
|
4053
4063
|
case t.key === "Escape":
|
|
4054
|
-
t.preventDefault(), e.cancelEdit(), p.paintFmt.value = null,
|
|
4064
|
+
t.preventDefault(), e.cancelEdit(), p.paintFmt.value = null, g();
|
|
4055
4065
|
return;
|
|
4056
4066
|
case Nl(t):
|
|
4057
4067
|
if (Dl(t)) {
|
|
4058
|
-
e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(""),
|
|
4068
|
+
e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(""), g(), o.focusEditInput();
|
|
4059
4069
|
return;
|
|
4060
4070
|
}
|
|
4061
|
-
t.preventDefault(), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(t.key),
|
|
4071
|
+
t.preventDefault(), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(t.key), g(), $e(() => {
|
|
4062
4072
|
const D = o.editInputRef.value;
|
|
4063
4073
|
D && (D.focus(), D.setSelectionRange(1, 1));
|
|
4064
4074
|
});
|
|
@@ -4069,13 +4079,13 @@ function kr(e, p, h, o, s) {
|
|
|
4069
4079
|
function lo(t) {
|
|
4070
4080
|
const u = t.target.value;
|
|
4071
4081
|
if (!e.editingCell.value) {
|
|
4072
|
-
e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(u),
|
|
4082
|
+
e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(u), g();
|
|
4073
4083
|
return;
|
|
4074
4084
|
}
|
|
4075
4085
|
e.editValue.value = u;
|
|
4076
4086
|
}
|
|
4077
4087
|
function oo() {
|
|
4078
|
-
Fl = !0, e.editingCell.value || (e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(""),
|
|
4088
|
+
Fl = !0, e.editingCell.value || (e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(""), g());
|
|
4079
4089
|
}
|
|
4080
4090
|
function no(t) {
|
|
4081
4091
|
Fl = !1, Tl = !0, setTimeout(() => {
|
|
@@ -4095,18 +4105,18 @@ function kr(e, p, h, o, s) {
|
|
|
4095
4105
|
const u = o.editInputRef.value;
|
|
4096
4106
|
if (!u)
|
|
4097
4107
|
return;
|
|
4098
|
-
const M = u.selectionStart ?? u.value.length, D = u.selectionEnd ?? u.value.length,
|
|
4099
|
-
` +
|
|
4100
|
-
e.editValue.value = T, u.value = T, u.selectionStart = u.selectionEnd = M + 1,
|
|
4108
|
+
const M = u.selectionStart ?? u.value.length, D = u.selectionEnd ?? u.value.length, m = u.value, T = m.slice(0, M) + `
|
|
4109
|
+
` + m.slice(D);
|
|
4110
|
+
e.editValue.value = T, u.value = T, u.selectionStart = u.selectionEnd = M + 1, g();
|
|
4101
4111
|
} else
|
|
4102
|
-
t.key === "Enter" ? (t.preventDefault(), e.commitEdit(), e.moveActive(0, 1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row),
|
|
4112
|
+
t.key === "Enter" ? (t.preventDefault(), e.commitEdit(), e.moveActive(0, 1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), g(), o.focusEditInput()) : t.key === "Tab" ? (t.preventDefault(), e.commitEdit(), e.moveActive(t.shiftKey ? -1 : 1, 0), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), g(), o.focusEditInput()) : t.key === "Escape" && (t.preventDefault(), e.cancelEdit(), g(), o.focusEditInput());
|
|
4103
4113
|
}
|
|
4104
4114
|
function ao(t) {
|
|
4105
4115
|
e.editingCell.value;
|
|
4106
4116
|
}
|
|
4107
4117
|
function io() {
|
|
4108
4118
|
setTimeout(() => {
|
|
4109
|
-
e.editingCell.value && (e.commitEdit(),
|
|
4119
|
+
e.editingCell.value && (e.commitEdit(), g());
|
|
4110
4120
|
}, 0);
|
|
4111
4121
|
}
|
|
4112
4122
|
let dt = null;
|
|
@@ -4117,7 +4127,7 @@ function kr(e, p, h, o, s) {
|
|
|
4117
4127
|
const M = Ht(e.props.width), D = Ht(e.props.height);
|
|
4118
4128
|
M != null ? o.viewSize.w = M : o.viewSize.w = t.width, D != null ? o.viewSize.h = D : o.viewSize.h = t.height;
|
|
4119
4129
|
}
|
|
4120
|
-
o.clampScroll(null, null),
|
|
4130
|
+
o.clampScroll(null, null), g();
|
|
4121
4131
|
}
|
|
4122
4132
|
function co() {
|
|
4123
4133
|
Il(() => {
|
|
@@ -4126,28 +4136,28 @@ function kr(e, p, h, o, s) {
|
|
|
4126
4136
|
al(), o.focusEditInput();
|
|
4127
4137
|
}), e.selectCell(0, 0), o.modelData.value && o.modelData.value.length > 0 && (s.value = JSON.stringify(o.modelData.value), o.sheets.value = o.modelData.value.map((M) => {
|
|
4128
4138
|
const D = o.mkSheet(M.name);
|
|
4129
|
-
for (const [
|
|
4130
|
-
D.cells[
|
|
4139
|
+
for (const [m, T] of Object.entries(M.cells))
|
|
4140
|
+
D.cells[m] = { value: T.value, style: T.style ?? null };
|
|
4131
4141
|
if (M.colWidths)
|
|
4132
|
-
for (const [
|
|
4133
|
-
const _ = Number(
|
|
4142
|
+
for (const [m, T] of Object.entries(M.colWidths)) {
|
|
4143
|
+
const _ = Number(m);
|
|
4134
4144
|
_ >= 0 && _ < e.colCount && T >= 30 && (D.colWidths[_] = T);
|
|
4135
4145
|
}
|
|
4136
4146
|
if (M.rowHeights)
|
|
4137
|
-
for (const [
|
|
4138
|
-
const _ = Number(
|
|
4147
|
+
for (const [m, T] of Object.entries(M.rowHeights)) {
|
|
4148
|
+
const _ = Number(m);
|
|
4139
4149
|
_ >= 0 && _ < e.rowCount && T >= 24 && (D.rowHeights[_] = T);
|
|
4140
4150
|
}
|
|
4141
4151
|
if (M.merges)
|
|
4142
|
-
for (const [
|
|
4143
|
-
D.merges[
|
|
4152
|
+
for (const [m, T] of Object.entries(M.merges))
|
|
4153
|
+
D.merges[m] = { ...T };
|
|
4144
4154
|
return D;
|
|
4145
4155
|
}), o.sheets.value.length > 0 && o.loadSheet(0));
|
|
4146
4156
|
}), ut(() => [e.props.width, e.props.height], () => {
|
|
4147
4157
|
const t = Ht(e.props.width), u = Ht(e.props.height);
|
|
4148
4158
|
t != null && u != null ? (dt == null || dt.disconnect(), dt = null) : !dt && o.wrapperRef.value && (dt = new ResizeObserver(() => al()), dt.observe(o.wrapperRef.value)), $e(() => al());
|
|
4149
|
-
}), ut(() => e.props.theme, () =>
|
|
4150
|
-
$e(() => o.emitModelData()),
|
|
4159
|
+
}), ut(() => e.props.theme, () => g()), ut(() => ({ ...e.cells }), () => $e(() => o.emitModelData()), { deep: !1 }), ut(() => ({ ...e.merges }), () => {
|
|
4160
|
+
$e(() => o.emitModelData()), g();
|
|
4151
4161
|
}, { deep: !1 }), ut(o.activeSheetIndex, () => $e(() => o.emitModelData())), ut(() => o.modelData.value, (t) => {
|
|
4152
4162
|
if (!t || t.length === 0)
|
|
4153
4163
|
return;
|
|
@@ -4156,31 +4166,31 @@ function kr(e, p, h, o, s) {
|
|
|
4156
4166
|
return;
|
|
4157
4167
|
s.value = u;
|
|
4158
4168
|
const M = e.selection.value ? { ...e.selection.value } : null, D = { ...e.activeCell.value };
|
|
4159
|
-
o.sheets.value = t.map((
|
|
4160
|
-
const T = o.mkSheet(
|
|
4161
|
-
for (const [_, re] of Object.entries(
|
|
4169
|
+
o.sheets.value = t.map((m) => {
|
|
4170
|
+
const T = o.mkSheet(m.name);
|
|
4171
|
+
for (const [_, re] of Object.entries(m.cells))
|
|
4162
4172
|
T.cells[_] = { value: re.value, style: re.style ?? null };
|
|
4163
|
-
if (
|
|
4164
|
-
for (const [_, re] of Object.entries(
|
|
4173
|
+
if (m.colWidths)
|
|
4174
|
+
for (const [_, re] of Object.entries(m.colWidths)) {
|
|
4165
4175
|
const ue = Number(_);
|
|
4166
4176
|
ue >= 0 && ue < e.colCount && re >= 30 && (T.colWidths[ue] = re);
|
|
4167
4177
|
}
|
|
4168
|
-
if (
|
|
4169
|
-
for (const [_, re] of Object.entries(
|
|
4178
|
+
if (m.rowHeights)
|
|
4179
|
+
for (const [_, re] of Object.entries(m.rowHeights)) {
|
|
4170
4180
|
const ue = Number(_);
|
|
4171
4181
|
ue >= 0 && ue < e.rowCount && re >= 24 && (T.rowHeights[ue] = re);
|
|
4172
4182
|
}
|
|
4173
|
-
if (
|
|
4174
|
-
for (const [_, re] of Object.entries(
|
|
4183
|
+
if (m.merges)
|
|
4184
|
+
for (const [_, re] of Object.entries(m.merges))
|
|
4175
4185
|
T.merges[_] = { ...re };
|
|
4176
4186
|
return T;
|
|
4177
|
-
}), o.sheets.value.length > 0 && o.loadSheet(0), M && (e.selection.value = M), e.activeCell.value = D,
|
|
4187
|
+
}), o.sheets.value.length > 0 && o.loadSheet(0), M && (e.selection.value = M), e.activeCell.value = D, g();
|
|
4178
4188
|
}, { deep: !0 }), ll(() => {
|
|
4179
4189
|
dt == null || dt.disconnect();
|
|
4180
4190
|
});
|
|
4181
4191
|
}
|
|
4182
4192
|
return {
|
|
4183
|
-
scheduleRender:
|
|
4193
|
+
scheduleRender: g,
|
|
4184
4194
|
render: q,
|
|
4185
4195
|
activeCellLabel: y,
|
|
4186
4196
|
formulaBarDisplay: ae,
|
|
@@ -4230,7 +4240,7 @@ function kr(e, p, h, o, s) {
|
|
|
4230
4240
|
onMouseDown: hl,
|
|
4231
4241
|
onMouseMove: bl,
|
|
4232
4242
|
onMouseUp: Bl,
|
|
4233
|
-
onMouseLeave:
|
|
4243
|
+
onMouseLeave: Ft,
|
|
4234
4244
|
onCanvasCtx: Nt,
|
|
4235
4245
|
onDblClick: rl,
|
|
4236
4246
|
onWheel: Kl,
|
|
@@ -4248,18 +4258,18 @@ function kr(e, p, h, o, s) {
|
|
|
4248
4258
|
setupLifecycle: co
|
|
4249
4259
|
};
|
|
4250
4260
|
}
|
|
4251
|
-
const
|
|
4261
|
+
const Rr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" }, Mr = ["value"], Br = ["value"], Dr = {
|
|
4252
4262
|
key: 2,
|
|
4253
4263
|
class: "sb-corner"
|
|
4254
|
-
},
|
|
4264
|
+
}, Fr = ["onClick", "onMouseenter"], Tr = { class: "context-menu__label" }, Er = {
|
|
4255
4265
|
key: 0,
|
|
4256
4266
|
class: "context-menu__arrow"
|
|
4257
|
-
},
|
|
4267
|
+
}, Lr = ["onClick"], Or = { class: "dim-panel__title" }, Ar = { class: "dim-panel__body" }, zr = ["value"], Hr = {
|
|
4258
4268
|
key: 0,
|
|
4259
4269
|
class: "dim-panel__error"
|
|
4260
|
-
},
|
|
4261
|
-
__name: "
|
|
4262
|
-
props: /* @__PURE__ */
|
|
4270
|
+
}, Wr = { class: "dim-panel__footer" }, Ir = /* @__PURE__ */ $t({
|
|
4271
|
+
__name: "spreader",
|
|
4272
|
+
props: /* @__PURE__ */ ho({
|
|
4263
4273
|
rowCount: { default: 200 },
|
|
4264
4274
|
colCount: { default: 26 },
|
|
4265
4275
|
width: {},
|
|
@@ -4272,7 +4282,7 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4272
4282
|
}),
|
|
4273
4283
|
emits: ["update:data"],
|
|
4274
4284
|
setup(e) {
|
|
4275
|
-
const p = e,
|
|
4285
|
+
const p = e, v = po(e, "data"), o = { value: "" }, s = hr(
|
|
4276
4286
|
p,
|
|
4277
4287
|
{ rowCount: p.rowCount, colCount: p.colCount, theme: p.theme, locale: p.locale }
|
|
4278
4288
|
), k = {
|
|
@@ -4294,26 +4304,26 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4294
4304
|
colWidths: [],
|
|
4295
4305
|
rowHeights: []
|
|
4296
4306
|
})
|
|
4297
|
-
}, a =
|
|
4298
|
-
|
|
4307
|
+
}, a = br(s, k), z = yr(s, a);
|
|
4308
|
+
Cr(a, {
|
|
4299
4309
|
borderMenuOpen: z.borderMenuOpen,
|
|
4300
4310
|
mergeMenuOpen: z.mergeMenuOpen
|
|
4301
4311
|
});
|
|
4302
|
-
const
|
|
4312
|
+
const g = kr(
|
|
4303
4313
|
s,
|
|
4304
4314
|
a,
|
|
4305
|
-
|
|
4315
|
+
v
|
|
4306
4316
|
);
|
|
4307
|
-
k.sheets =
|
|
4308
|
-
const le =
|
|
4317
|
+
k.sheets = g.sheets, k.activeSheetIndex = g.activeSheetIndex, k.saveSheet = g.saveSheet, k.loadSheet = g.loadSheet, k.mkSheet = g.mkSheet;
|
|
4318
|
+
const le = xr(
|
|
4309
4319
|
s,
|
|
4310
4320
|
a,
|
|
4311
4321
|
z,
|
|
4312
|
-
|
|
4322
|
+
g,
|
|
4313
4323
|
o
|
|
4314
4324
|
);
|
|
4315
4325
|
le.setupLifecycle();
|
|
4316
|
-
const q =
|
|
4326
|
+
const q = Mt(s), y = Mt(a), ae = Mt(z), L = Mt(g), f = Mt(le);
|
|
4317
4327
|
function Ce(oe) {
|
|
4318
4328
|
a.fontSizeMenuOpen.value = oe;
|
|
4319
4329
|
}
|
|
@@ -4330,13 +4340,13 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4330
4340
|
le.ctxMenu.value = null;
|
|
4331
4341
|
}
|
|
4332
4342
|
const be = (oe) => {
|
|
4333
|
-
|
|
4343
|
+
g.formulaBarRef.value = oe;
|
|
4334
4344
|
}, F = (oe) => {
|
|
4335
|
-
|
|
4345
|
+
g.wrapperRef.value = oe;
|
|
4336
4346
|
}, j = (oe) => {
|
|
4337
|
-
|
|
4347
|
+
g.canvasRef.value = oe;
|
|
4338
4348
|
}, Me = (oe) => {
|
|
4339
|
-
|
|
4349
|
+
g.editInputRef.value = oe;
|
|
4340
4350
|
}, Be = (oe) => {
|
|
4341
4351
|
le.dimInputRef.value = oe;
|
|
4342
4352
|
};
|
|
@@ -4344,7 +4354,7 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4344
4354
|
class: "spreadsheet-outer",
|
|
4345
4355
|
style: nt(L.outerStyle)
|
|
4346
4356
|
}, [
|
|
4347
|
-
Je(
|
|
4357
|
+
Je(or, {
|
|
4348
4358
|
locale: q.locale,
|
|
4349
4359
|
"can-undo": y.canUndo,
|
|
4350
4360
|
"can-redo": y.canRedo,
|
|
@@ -4375,54 +4385,54 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4375
4385
|
"sel-wrap": y.selWrap,
|
|
4376
4386
|
"merge-menu-open": ae.mergeMenuOpen,
|
|
4377
4387
|
"theme-vars": L.toolbarThemeVars,
|
|
4378
|
-
onUndo: c[0] || (c[0] = (
|
|
4379
|
-
onRedo: c[1] || (c[1] = (
|
|
4388
|
+
onUndo: c[0] || (c[0] = (h) => y.undo()),
|
|
4389
|
+
onRedo: c[1] || (c[1] = (h) => y.redo()),
|
|
4380
4390
|
onPaintFormat: y.onPaintFormat,
|
|
4381
|
-
onClearFormat: c[2] || (c[2] = (
|
|
4382
|
-
onFontFamilyChange: c[3] || (c[3] = (
|
|
4383
|
-
onFontSizeInput: c[4] || (c[4] = (
|
|
4391
|
+
onClearFormat: c[2] || (c[2] = (h) => y.clearFormat()),
|
|
4392
|
+
onFontFamilyChange: c[3] || (c[3] = (h) => y.onFontFamilyChange(h)),
|
|
4393
|
+
onFontSizeInput: c[4] || (c[4] = (h) => y.onFontSizeInput(h)),
|
|
4384
4394
|
onFontSizeBlur: y.onFontSizeBlur,
|
|
4385
|
-
onFontSizeKeydown: c[5] || (c[5] = (
|
|
4386
|
-
onFontSizeChange: c[6] || (c[6] = (
|
|
4387
|
-
"onUpdate:fontSizeMenuOpen": c[7] || (c[7] = (
|
|
4388
|
-
onFontSizeToggle: c[8] || (c[8] = (
|
|
4395
|
+
onFontSizeKeydown: c[5] || (c[5] = (h) => y.onFontSizeKeydown(h)),
|
|
4396
|
+
onFontSizeChange: c[6] || (c[6] = (h) => y.onFontSizeChange(h)),
|
|
4397
|
+
"onUpdate:fontSizeMenuOpen": c[7] || (c[7] = (h) => Ce(h)),
|
|
4398
|
+
onFontSizeToggle: c[8] || (c[8] = (h) => y.toggleFontSizeMenu()),
|
|
4389
4399
|
onFontSizeStepUp: y.onFontSizeStepUp,
|
|
4390
4400
|
onFontSizeStepDown: y.onFontSizeStepDown,
|
|
4391
4401
|
onBoldToggle: y.toggleFontWeight,
|
|
4392
4402
|
onItalicToggle: y.toggleFontStyle,
|
|
4393
4403
|
onUnderlineToggle: y.toggleUnderline,
|
|
4394
4404
|
onStrikethroughToggle: y.toggleStrikethrough,
|
|
4395
|
-
onTextColorChange: c[9] || (c[9] = (
|
|
4396
|
-
"onUpdate:textColorMenuOpen": c[10] || (c[10] = (
|
|
4397
|
-
onFillColorChange: c[11] || (c[11] = (
|
|
4398
|
-
"onUpdate:fillColorMenuOpen": c[12] || (c[12] = (
|
|
4405
|
+
onTextColorChange: c[9] || (c[9] = (h) => y.onTextColorChange(h)),
|
|
4406
|
+
"onUpdate:textColorMenuOpen": c[10] || (c[10] = (h) => he(h)),
|
|
4407
|
+
onFillColorChange: c[11] || (c[11] = (h) => y.onFillColorChange(h)),
|
|
4408
|
+
"onUpdate:fillColorMenuOpen": c[12] || (c[12] = (h) => De(h)),
|
|
4399
4409
|
onApplyTextColor: y.applyCachedTextColor,
|
|
4400
4410
|
onApplyFillColor: y.applyCachedFillColor,
|
|
4401
|
-
"onUpdate:borderMenuOpen": c[13] || (c[13] = (
|
|
4402
|
-
onBorderChange: c[14] || (c[14] = (
|
|
4411
|
+
"onUpdate:borderMenuOpen": c[13] || (c[13] = (h) => y.onBorderMenuToggle(h)),
|
|
4412
|
+
onBorderChange: c[14] || (c[14] = (h) => ae.onBorderChange(h)),
|
|
4403
4413
|
onApplyBorder: ae.applyCachedBorder,
|
|
4404
|
-
onHAlignChange: c[15] || (c[15] = (
|
|
4405
|
-
onVAlignChange: c[16] || (c[16] = (
|
|
4414
|
+
onHAlignChange: c[15] || (c[15] = (h) => y.onHAlignChange(h)),
|
|
4415
|
+
onVAlignChange: c[16] || (c[16] = (h) => y.onVAlignChange(h)),
|
|
4406
4416
|
onWrapToggle: y.onWrapToggle,
|
|
4407
|
-
"onUpdate:mergeMenuOpen": c[17] || (c[17] = (
|
|
4408
|
-
onMergeChange: c[18] || (c[18] = (
|
|
4417
|
+
"onUpdate:mergeMenuOpen": c[17] || (c[17] = (h) => ae.onMergeMenuToggle(h)),
|
|
4418
|
+
onMergeChange: c[18] || (c[18] = (h) => ae.onMergeChange(h)),
|
|
4409
4419
|
onApplyMerge: ae.onApplyMerge
|
|
4410
4420
|
}, null, 8, ["locale", "can-undo", "can-redo", "paint-fmt-active", "has-selection", "font-family-options", "font-size-options", "sel-font-family", "sel-font-size", "font-size-input", "font-size-menu-open", "sel-font-weight", "sel-font-style", "sel-underline", "sel-strikethrough", "sel-text-color", "text-color-menu-open", "sel-fill-color", "fill-color-menu-open", "cached-text-color", "cached-fill-color", "border-menu-open", "cached-border", "h-align-options", "v-align-options", "sel-h-align", "sel-v-align", "sel-wrap", "merge-menu-open", "theme-vars", "onPaintFormat", "onFontSizeBlur", "onFontSizeStepUp", "onFontSizeStepDown", "onBoldToggle", "onItalicToggle", "onUnderlineToggle", "onStrikethroughToggle", "onApplyTextColor", "onApplyFillColor", "onApplyBorder", "onWrapToggle", "onApplyMerge"]),
|
|
4411
|
-
b("div",
|
|
4412
|
-
b("div",
|
|
4421
|
+
b("div", Rr, [
|
|
4422
|
+
b("div", Sr, xt(f.activeCellLabel), 1),
|
|
4413
4423
|
b("input", {
|
|
4414
4424
|
ref: be,
|
|
4415
4425
|
class: "formula-bar__input",
|
|
4416
4426
|
value: f.formulaBarDisplay,
|
|
4417
4427
|
onFocus: c[19] || (c[19] = //@ts-ignore
|
|
4418
|
-
(...
|
|
4428
|
+
(...h) => f.onFormulaBarFocus && f.onFormulaBarFocus(...h)),
|
|
4419
4429
|
onInput: c[20] || (c[20] = //@ts-ignore
|
|
4420
|
-
(...
|
|
4430
|
+
(...h) => f.onFormulaBarInput && f.onFormulaBarInput(...h)),
|
|
4421
4431
|
onKeydown: c[21] || (c[21] = //@ts-ignore
|
|
4422
|
-
(...
|
|
4432
|
+
(...h) => f.onFormulaBarKeydown && f.onFormulaBarKeydown(...h)),
|
|
4423
4433
|
onBlur: c[22] || (c[22] = //@ts-ignore
|
|
4424
|
-
(...
|
|
4425
|
-
}, null, 40,
|
|
4434
|
+
(...h) => f.onFormulaBarBlur && f.onFormulaBarBlur(...h))
|
|
4435
|
+
}, null, 40, Mr)
|
|
4426
4436
|
]),
|
|
4427
4437
|
b("div", {
|
|
4428
4438
|
ref: F,
|
|
@@ -4433,38 +4443,38 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4433
4443
|
class: "grid-canvas",
|
|
4434
4444
|
tabindex: "0",
|
|
4435
4445
|
onMousedown: c[23] || (c[23] = //@ts-ignore
|
|
4436
|
-
(...
|
|
4446
|
+
(...h) => f.onMouseDown && f.onMouseDown(...h)),
|
|
4437
4447
|
onMousemove: c[24] || (c[24] = //@ts-ignore
|
|
4438
|
-
(...
|
|
4448
|
+
(...h) => f.onMouseMove && f.onMouseMove(...h)),
|
|
4439
4449
|
onMouseup: c[25] || (c[25] = //@ts-ignore
|
|
4440
|
-
(...
|
|
4450
|
+
(...h) => f.onMouseUp && f.onMouseUp(...h)),
|
|
4441
4451
|
onMouseleave: c[26] || (c[26] = //@ts-ignore
|
|
4442
|
-
(...
|
|
4452
|
+
(...h) => f.onMouseLeave && f.onMouseLeave(...h)),
|
|
4443
4453
|
onDblclick: c[27] || (c[27] = //@ts-ignore
|
|
4444
|
-
(...
|
|
4454
|
+
(...h) => f.onDblClick && f.onDblClick(...h)),
|
|
4445
4455
|
onWheel: c[28] || (c[28] = qe(
|
|
4446
4456
|
//@ts-ignore
|
|
4447
|
-
(...
|
|
4457
|
+
(...h) => f.onWheel && f.onWheel(...h),
|
|
4448
4458
|
["prevent"]
|
|
4449
4459
|
)),
|
|
4450
4460
|
onFocus: c[29] || (c[29] = //@ts-ignore
|
|
4451
|
-
(...
|
|
4461
|
+
(...h) => L.onCanvasFocus && L.onCanvasFocus(...h)),
|
|
4452
4462
|
onKeydown: c[30] || (c[30] = //@ts-ignore
|
|
4453
|
-
(...
|
|
4463
|
+
(...h) => f.onKeydown && f.onKeydown(...h)),
|
|
4454
4464
|
onContextmenu: c[31] || (c[31] = //@ts-ignore
|
|
4455
|
-
(...
|
|
4465
|
+
(...h) => f.onCanvasCtx && f.onCanvasCtx(...h)),
|
|
4456
4466
|
onTouchstart: c[32] || (c[32] = qe(
|
|
4457
4467
|
//@ts-ignore
|
|
4458
|
-
(...
|
|
4468
|
+
(...h) => f.onTouchStart && f.onTouchStart(...h),
|
|
4459
4469
|
["prevent"]
|
|
4460
4470
|
)),
|
|
4461
4471
|
onTouchmove: c[33] || (c[33] = qe(
|
|
4462
4472
|
//@ts-ignore
|
|
4463
|
-
(...
|
|
4473
|
+
(...h) => f.onTouchMove && f.onTouchMove(...h),
|
|
4464
4474
|
["prevent"]
|
|
4465
4475
|
)),
|
|
4466
4476
|
onTouchend: c[34] || (c[34] = //@ts-ignore
|
|
4467
|
-
(...
|
|
4477
|
+
(...h) => f.onTouchEnd && f.onTouchEnd(...h))
|
|
4468
4478
|
}, null, 32),
|
|
4469
4479
|
b("textarea", {
|
|
4470
4480
|
ref: Me,
|
|
@@ -4472,18 +4482,18 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4472
4482
|
value: q.editValue,
|
|
4473
4483
|
style: nt(f.editInputStyle),
|
|
4474
4484
|
onInput: c[35] || (c[35] = //@ts-ignore
|
|
4475
|
-
(...
|
|
4485
|
+
(...h) => f.onEditInput && f.onEditInput(...h)),
|
|
4476
4486
|
onKeydown: c[36] || (c[36] = //@ts-ignore
|
|
4477
|
-
(...
|
|
4487
|
+
(...h) => f.onEditKd && f.onEditKd(...h)),
|
|
4478
4488
|
onCompositionstart: c[37] || (c[37] = //@ts-ignore
|
|
4479
|
-
(...
|
|
4489
|
+
(...h) => f.onEditCompositionStart && f.onEditCompositionStart(...h)),
|
|
4480
4490
|
onCompositionend: c[38] || (c[38] = //@ts-ignore
|
|
4481
|
-
(...
|
|
4491
|
+
(...h) => f.onEditCompositionEnd && f.onEditCompositionEnd(...h)),
|
|
4482
4492
|
onBlur: c[39] || (c[39] = //@ts-ignore
|
|
4483
|
-
(...
|
|
4493
|
+
(...h) => f.onEditBlur && f.onEditBlur(...h)),
|
|
4484
4494
|
onPaste: c[40] || (c[40] = //@ts-ignore
|
|
4485
|
-
(...
|
|
4486
|
-
}, null, 44,
|
|
4495
|
+
(...h) => f.onEditPaste && f.onEditPaste(...h))
|
|
4496
|
+
}, null, 44, Br),
|
|
4487
4497
|
L.maxScrollY > 0 ? (W(), fe("div", {
|
|
4488
4498
|
key: 0,
|
|
4489
4499
|
class: "v-scrollbar",
|
|
@@ -4492,7 +4502,7 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4492
4502
|
b("button", {
|
|
4493
4503
|
class: "sb-btn sb-btn--up",
|
|
4494
4504
|
title: "",
|
|
4495
|
-
onMousedown: c[41] || (c[41] = qe((
|
|
4505
|
+
onMousedown: c[41] || (c[41] = qe((h) => {
|
|
4496
4506
|
L.clampScroll(null, q.scrollY - 50), f.scheduleRender();
|
|
4497
4507
|
}, ["prevent"]))
|
|
4498
4508
|
}, [...c[64] || (c[64] = [
|
|
@@ -4501,18 +4511,18 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4501
4511
|
b("div", {
|
|
4502
4512
|
class: "sb-track sb-track--v",
|
|
4503
4513
|
onMousedown: c[43] || (c[43] = //@ts-ignore
|
|
4504
|
-
(...
|
|
4514
|
+
(...h) => f.onVTrk && f.onVTrk(...h))
|
|
4505
4515
|
}, [
|
|
4506
4516
|
b("div", {
|
|
4507
4517
|
class: "sb-thumb sb-thumb--v",
|
|
4508
4518
|
style: nt({ top: f.vThumbT + "px", height: f.vThumbH + "px" }),
|
|
4509
4519
|
onMousedown: c[42] || (c[42] = //@ts-ignore
|
|
4510
|
-
(...
|
|
4520
|
+
(...h) => f.onVStart && f.onVStart(...h))
|
|
4511
4521
|
}, null, 36)
|
|
4512
4522
|
], 32),
|
|
4513
4523
|
b("button", {
|
|
4514
4524
|
class: "sb-btn sb-btn--down",
|
|
4515
|
-
onMousedown: c[44] || (c[44] = qe((
|
|
4525
|
+
onMousedown: c[44] || (c[44] = qe((h) => {
|
|
4516
4526
|
L.clampScroll(null, q.scrollY + 50), f.scheduleRender();
|
|
4517
4527
|
}, ["prevent"]))
|
|
4518
4528
|
}, [...c[65] || (c[65] = [
|
|
@@ -4526,7 +4536,7 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4526
4536
|
}, [
|
|
4527
4537
|
b("button", {
|
|
4528
4538
|
class: "sb-btn sb-btn--left",
|
|
4529
|
-
onMousedown: c[45] || (c[45] = qe((
|
|
4539
|
+
onMousedown: c[45] || (c[45] = qe((h) => {
|
|
4530
4540
|
L.clampScroll(q.scrollX - 50, null), f.scheduleRender();
|
|
4531
4541
|
}, ["prevent"]))
|
|
4532
4542
|
}, [...c[66] || (c[66] = [
|
|
@@ -4535,40 +4545,40 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4535
4545
|
b("div", {
|
|
4536
4546
|
class: "sb-track sb-track--h",
|
|
4537
4547
|
onMousedown: c[47] || (c[47] = //@ts-ignore
|
|
4538
|
-
(...
|
|
4548
|
+
(...h) => f.onHTrk && f.onHTrk(...h))
|
|
4539
4549
|
}, [
|
|
4540
4550
|
b("div", {
|
|
4541
4551
|
class: "sb-thumb sb-thumb--h",
|
|
4542
4552
|
style: nt({ left: f.hThumbL + "px", width: f.hThumbW + "px" }),
|
|
4543
4553
|
onMousedown: c[46] || (c[46] = //@ts-ignore
|
|
4544
|
-
(...
|
|
4554
|
+
(...h) => f.onHStart && f.onHStart(...h))
|
|
4545
4555
|
}, null, 36)
|
|
4546
4556
|
], 32),
|
|
4547
4557
|
b("button", {
|
|
4548
4558
|
class: "sb-btn sb-btn--right",
|
|
4549
|
-
onMousedown: c[48] || (c[48] = qe((
|
|
4559
|
+
onMousedown: c[48] || (c[48] = qe((h) => {
|
|
4550
4560
|
L.clampScroll(q.scrollX + 50, null), f.scheduleRender();
|
|
4551
4561
|
}, ["prevent"]))
|
|
4552
4562
|
}, [...c[67] || (c[67] = [
|
|
4553
4563
|
b("span", { class: "sb-arrow sb-arrow--right" }, null, -1)
|
|
4554
4564
|
])], 32)
|
|
4555
4565
|
], 4)) : Qe("", !0),
|
|
4556
|
-
L.maxScrollX > 0 && L.maxScrollY > 0 ? (W(), fe("div",
|
|
4566
|
+
L.maxScrollX > 0 && L.maxScrollY > 0 ? (W(), fe("div", Dr)) : Qe("", !0)
|
|
4557
4567
|
]),
|
|
4558
|
-
Je(
|
|
4568
|
+
Je(sr, {
|
|
4559
4569
|
locale: q.locale,
|
|
4560
4570
|
sheets: L.sheets,
|
|
4561
4571
|
"active-sheet-index": L.activeSheetIndex,
|
|
4562
4572
|
"ren-tab": f.renTab,
|
|
4563
4573
|
"ren-tab-val": f.renTabVal,
|
|
4564
|
-
onTabClick: c[49] || (c[49] = (
|
|
4565
|
-
onTabDblclick: c[50] || (c[50] = (
|
|
4566
|
-
onTabContextmenu: c[51] || (c[51] = (
|
|
4567
|
-
onTabRenameInput: c[52] || (c[52] = (
|
|
4568
|
-
onTabRenameKeydown: c[53] || (c[53] = (
|
|
4574
|
+
onTabClick: c[49] || (c[49] = (h) => f.onTabClick(h)),
|
|
4575
|
+
onTabDblclick: c[50] || (c[50] = (h) => f.onTabDblClick(h)),
|
|
4576
|
+
onTabContextmenu: c[51] || (c[51] = (h) => f.onTabCtxMenu(h.ev, h.i)),
|
|
4577
|
+
onTabRenameInput: c[52] || (c[52] = (h) => Y(h)),
|
|
4578
|
+
onTabRenameKeydown: c[53] || (c[53] = (h) => f.onTabRenameKd(h)),
|
|
4569
4579
|
onTabRenameCommit: f.commitTabRename,
|
|
4570
|
-
onTabbarContextmenu: c[54] || (c[54] = (
|
|
4571
|
-
onAddSheet: c[55] || (c[55] = (
|
|
4580
|
+
onTabbarContextmenu: c[54] || (c[54] = (h) => f.onTabBarCtx(h)),
|
|
4581
|
+
onAddSheet: c[55] || (c[55] = (h) => {
|
|
4572
4582
|
L.addSheet(), f.scheduleRender();
|
|
4573
4583
|
})
|
|
4574
4584
|
}, null, 8, ["locale", "sheets", "active-sheet-index", "ren-tab", "ren-tab-val", "onTabRenameCommit"]),
|
|
@@ -4582,25 +4592,25 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4582
4592
|
onClick: c[56] || (c[56] = qe(() => {
|
|
4583
4593
|
}, ["stop"]))
|
|
4584
4594
|
}, [
|
|
4585
|
-
(W(!0), fe(bt, null, Rt(f.ctxMenu.items, (
|
|
4595
|
+
(W(!0), fe(bt, null, Rt(f.ctxMenu.items, (h, Ne) => (W(), fe("div", {
|
|
4586
4596
|
key: Ne,
|
|
4587
|
-
class: Pe(["context-menu__item", { "context-menu__item--disabled":
|
|
4588
|
-
onClick: (He) => !
|
|
4589
|
-
onMouseenter: (He) => f.onCtxItemEnter(He,
|
|
4597
|
+
class: Pe(["context-menu__item", { "context-menu__item--disabled": h.disabled }]),
|
|
4598
|
+
onClick: (He) => !h.disabled && h.action && (h.action(), X()),
|
|
4599
|
+
onMouseenter: (He) => f.onCtxItemEnter(He, h)
|
|
4590
4600
|
}, [
|
|
4591
|
-
b("span",
|
|
4592
|
-
|
|
4593
|
-
|
|
4601
|
+
b("span", Tr, xt(h.label), 1),
|
|
4602
|
+
h.children ? (W(), fe("span", Er)) : Qe("", !0),
|
|
4603
|
+
h.children ? (W(), fe("div", {
|
|
4594
4604
|
key: 1,
|
|
4595
4605
|
class: Pe(["context-submenu", { "context-submenu--left": f.ctxSubmenuLeft }])
|
|
4596
4606
|
}, [
|
|
4597
|
-
(W(!0), fe(bt, null, Rt(
|
|
4607
|
+
(W(!0), fe(bt, null, Rt(h.children, (He, de) => (W(), fe("div", {
|
|
4598
4608
|
key: de,
|
|
4599
4609
|
class: Pe(["context-menu__item", { "context-menu__item--disabled": He.disabled }]),
|
|
4600
4610
|
onClick: qe((n) => !He.disabled && He.action && (He.action(), X()), ["stop"])
|
|
4601
|
-
}, xt(He.label), 11,
|
|
4611
|
+
}, xt(He.label), 11, Lr))), 128))
|
|
4602
4612
|
], 2)) : Qe("", !0)
|
|
4603
|
-
], 42,
|
|
4613
|
+
], 42, Fr))), 128))
|
|
4604
4614
|
], 4)) : Qe("", !0)
|
|
4605
4615
|
]),
|
|
4606
4616
|
_: 1
|
|
@@ -4618,8 +4628,8 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4618
4628
|
onClick: c[63] || (c[63] = qe(() => {
|
|
4619
4629
|
}, ["stop"]))
|
|
4620
4630
|
}, [
|
|
4621
|
-
b("div",
|
|
4622
|
-
b("div",
|
|
4631
|
+
b("div", Or, xt(f.dimPanel.type === "row" ? "行高" : "列宽"), 1),
|
|
4632
|
+
b("div", Ar, [
|
|
4623
4633
|
b("input", {
|
|
4624
4634
|
ref: Be,
|
|
4625
4635
|
class: Pe(["dim-panel__input", { "dim-panel__input--error": f.dimPanel.error }]),
|
|
@@ -4629,25 +4639,25 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4629
4639
|
inputmode: "numeric",
|
|
4630
4640
|
value: f.dimPanel.value,
|
|
4631
4641
|
onInput: c[57] || (c[57] = //@ts-ignore
|
|
4632
|
-
(...
|
|
4642
|
+
(...h) => f.onDimInput && f.onDimInput(...h)),
|
|
4633
4643
|
onKeydown: c[58] || (c[58] = //@ts-ignore
|
|
4634
|
-
(...
|
|
4644
|
+
(...h) => f.onDimKeydown && f.onDimKeydown(...h)),
|
|
4635
4645
|
onBlur: c[59] || (c[59] = //@ts-ignore
|
|
4636
|
-
(...
|
|
4637
|
-
}, null, 42,
|
|
4646
|
+
(...h) => f.onDimBlur && f.onDimBlur(...h))
|
|
4647
|
+
}, null, 42, zr),
|
|
4638
4648
|
c[68] || (c[68] = b("span", { class: "dim-panel__unit" }, "px", -1))
|
|
4639
4649
|
]),
|
|
4640
|
-
f.dimPanel.error ? (W(), fe("div",
|
|
4641
|
-
b("div",
|
|
4650
|
+
f.dimPanel.error ? (W(), fe("div", Hr, xt(f.dimPanel.error), 1)) : Qe("", !0),
|
|
4651
|
+
b("div", Wr, [
|
|
4642
4652
|
b("button", {
|
|
4643
4653
|
class: "dim-panel__btn dim-panel__btn--primary",
|
|
4644
4654
|
onClick: c[60] || (c[60] = //@ts-ignore
|
|
4645
|
-
(...
|
|
4655
|
+
(...h) => f.applyDimPanel && f.applyDimPanel(...h))
|
|
4646
4656
|
}, " 确定 "),
|
|
4647
4657
|
b("button", {
|
|
4648
4658
|
class: "dim-panel__btn",
|
|
4649
4659
|
onClick: c[61] || (c[61] = //@ts-ignore
|
|
4650
|
-
(...
|
|
4660
|
+
(...h) => f.closeDimPanel && f.closeDimPanel(...h))
|
|
4651
4661
|
}, " 取消 ")
|
|
4652
4662
|
])
|
|
4653
4663
|
], 36)) : Qe("", !0)
|
|
@@ -4657,8 +4667,8 @@ const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" },
|
|
|
4657
4667
|
]))
|
|
4658
4668
|
], 4));
|
|
4659
4669
|
}
|
|
4660
|
-
}),
|
|
4670
|
+
}), Kr = /* @__PURE__ */ Kt(Ir, [["__scopeId", "data-v-0c81e050"]]);
|
|
4661
4671
|
export {
|
|
4662
|
-
|
|
4663
|
-
|
|
4672
|
+
Kr as Spreader,
|
|
4673
|
+
Kr as default
|
|
4664
4674
|
};
|