xiaodao-spreader 0.1.5 → 0.1.6
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/xiaodao-spreader.es.js +1104 -1084
- package/dist/xiaodao-spreader.umd.js +9 -9
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as $t, ref as V, computed as
|
|
2
|
-
const
|
|
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 Tt, useModel as mo, mergeModels as po } from "vue";
|
|
2
|
+
const Re = 52, Se = 24, Qt = 100, Ol = 24, fl = 30, vl = 24, xl = 1e3, gl = 500, el = 11, ho = 50, bo = {
|
|
3
3
|
"zh-CN": {
|
|
4
4
|
insert: "插入",
|
|
5
5
|
delete: "删除",
|
|
@@ -227,7 +227,7 @@ function U(e, p) {
|
|
|
227
227
|
var h;
|
|
228
228
|
return ((h = bo[e]) == null ? void 0 : h[p]) ?? p;
|
|
229
229
|
}
|
|
230
|
-
const
|
|
230
|
+
const Sl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif', Mt = 10, Co = [
|
|
231
231
|
{ label: "", value: "" },
|
|
232
232
|
{ label: "微软雅黑", value: '"Microsoft YaHei", "微软雅黑", sans-serif' },
|
|
233
233
|
{ label: "宋体", value: '"SimSun", "宋体", serif' },
|
|
@@ -259,13 +259,13 @@ const Rl = '-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
|
-
], wo = '<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>', ko = '<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>', xo = '<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>',
|
|
262
|
+
], wo = '<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>', ko = '<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>', xo = '<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>', Ro = '<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>', So = '<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>', 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="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>', Bo = [
|
|
263
263
|
{ value: "left", labelKey: "alignLeft", icon: wo },
|
|
264
264
|
{ value: "center", labelKey: "alignCenter", icon: ko },
|
|
265
265
|
{ value: "right", labelKey: "alignRight", icon: xo }
|
|
266
266
|
], Do = [
|
|
267
|
-
{ value: "top", labelKey: "alignTop", icon:
|
|
268
|
-
{ value: "middle", labelKey: "alignMiddle", icon:
|
|
267
|
+
{ value: "top", labelKey: "alignTop", icon: Ro },
|
|
268
|
+
{ value: "middle", labelKey: "alignMiddle", icon: So },
|
|
269
269
|
{ value: "bottom", labelKey: "alignBottom", icon: Mo }
|
|
270
270
|
], Fo = '<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>', To = '<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>', Eo = '<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>', Lo = '<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
271
|
{ key: "mergeCenter", labelKey: "mergeCenter", icon: Fo },
|
|
@@ -401,21 +401,21 @@ const Rl = '-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 h = e, o = p, s = V(!1), k = V(0), a = V(null), z = V(null), v = V(null),
|
|
405
|
-
function X(
|
|
406
|
-
k.value = Math.max(0, Math.min(h.options.length - f.value, k.value +
|
|
404
|
+
const h = e, o = p, s = V(!1), k = V(0), a = V(null), z = V(null), v = V(null), le = V({ top: 0, up: !1 }), q = V(0), y = V(!1), ae = se(() => h.options.find((de) => String(de.value) === String(h.modelValue))), L = se(() => h.menuWidth), f = se(() => Math.min(h.visibleCount, h.options.length)), Ce = se(() => h.options.slice(k.value, k.value + f.value)), he = se(() => k.value > 0), De = se(() => k.value + f.value < h.options.length), Y = se(() => h.options.length > f.value);
|
|
405
|
+
function X(de) {
|
|
406
|
+
k.value = Math.max(0, Math.min(h.options.length - f.value, k.value + de));
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function be() {
|
|
409
409
|
s.value = !0, h.modelOpen !== void 0 && o("update:modelOpen", !0);
|
|
410
|
-
const
|
|
411
|
-
if (!
|
|
410
|
+
const de = h.triggerEl ?? a.value;
|
|
411
|
+
if (!de)
|
|
412
412
|
return;
|
|
413
|
-
const n =
|
|
414
|
-
h.align === "right" ?
|
|
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
|
+
h.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
|
|
418
|
-
} :
|
|
418
|
+
} : le.value = {
|
|
419
419
|
left: n.left,
|
|
420
420
|
top: l ? n.top - d - 4 : n.bottom + 4,
|
|
421
421
|
up: l
|
|
@@ -423,72 +423,72 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
423
423
|
const r = h.options.findIndex((I) => String(I.value) === String(h.modelValue));
|
|
424
424
|
k.value = r >= 0 ? Math.max(0, Math.min(r - Math.floor(f.value / 2), h.options.length - f.value)) : 0;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function F() {
|
|
427
427
|
s.value = !1, h.modelOpen !== void 0 && o("update:modelOpen", !1);
|
|
428
428
|
}
|
|
429
429
|
function j() {
|
|
430
|
-
s.value ?
|
|
430
|
+
s.value ? F() : be();
|
|
431
431
|
}
|
|
432
|
-
function Me(
|
|
433
|
-
o("update:modelValue",
|
|
432
|
+
function Me(de) {
|
|
433
|
+
o("update:modelValue", de.value), o("change", de.value), F();
|
|
434
434
|
}
|
|
435
|
-
function Be(
|
|
435
|
+
function Be(de) {
|
|
436
436
|
var d, w;
|
|
437
437
|
if (!s.value)
|
|
438
438
|
return;
|
|
439
|
-
const n =
|
|
440
|
-
(d = a.value) != null && d.contains(n) || (w = v.value) != null && w.contains(n) ||
|
|
439
|
+
const n = de.target;
|
|
440
|
+
(d = a.value) != null && d.contains(n) || (w = v.value) != null && w.contains(n) || F();
|
|
441
441
|
}
|
|
442
|
-
function
|
|
443
|
-
s.value && (
|
|
442
|
+
function oe(de) {
|
|
443
|
+
s.value && (de.preventDefault(), X(de.deltaY > 0 ? 1 : -1));
|
|
444
444
|
}
|
|
445
|
-
ut(s, (
|
|
446
|
-
|
|
445
|
+
ut(s, (de) => {
|
|
446
|
+
$e(() => {
|
|
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(() => h.modelOpen, (
|
|
451
|
-
|
|
450
|
+
}), ut(() => h.modelOpen, (de) => {
|
|
451
|
+
de !== void 0 && de !== s.value && (de ? be() : F());
|
|
452
452
|
});
|
|
453
|
-
function c(
|
|
454
|
-
s.value && (q.value =
|
|
453
|
+
function c(de) {
|
|
454
|
+
s.value && (q.value = de.touches[0].clientY, y.value = !0);
|
|
455
455
|
}
|
|
456
|
-
function m(
|
|
456
|
+
function m(de) {
|
|
457
457
|
if (!s.value || !y.value)
|
|
458
458
|
return;
|
|
459
|
-
const n =
|
|
460
|
-
Math.abs(n) > 5 && (X(n < 0 ? 1 : -1), q.value =
|
|
459
|
+
const n = de.touches[0].clientY - q.value;
|
|
460
|
+
Math.abs(n) > 5 && (X(n < 0 ? 1 : -1), q.value = de.touches[0].clientY);
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Ne() {
|
|
463
463
|
y.value = !1;
|
|
464
464
|
}
|
|
465
|
-
function
|
|
466
|
-
|
|
465
|
+
function He(de) {
|
|
466
|
+
de.key === "Escape" && F();
|
|
467
467
|
}
|
|
468
468
|
return Il(() => {
|
|
469
|
-
document.addEventListener("mousedown", Be), window.addEventListener("resize",
|
|
469
|
+
document.addEventListener("mousedown", Be), window.addEventListener("resize", F), window.addEventListener("scroll", F, !0);
|
|
470
470
|
}), ll(() => {
|
|
471
|
-
document.removeEventListener("mousedown", Be), window.removeEventListener("resize",
|
|
472
|
-
}), (
|
|
471
|
+
document.removeEventListener("mousedown", Be), window.removeEventListener("resize", F), window.removeEventListener("scroll", F, !0);
|
|
472
|
+
}), (de, n) => {
|
|
473
473
|
var d, w;
|
|
474
|
-
return W(),
|
|
474
|
+
return W(), fe("div", {
|
|
475
475
|
ref_key: "rootRef",
|
|
476
476
|
ref: a,
|
|
477
477
|
class: "sp-dropdown",
|
|
478
478
|
style: nt(typeof e.width == "number" ? { width: e.width + "px" } : { width: e.width })
|
|
479
479
|
}, [
|
|
480
|
-
e.hideTrigger ?
|
|
480
|
+
e.hideTrigger ? Qe("", !0) : (W(), fe("button", {
|
|
481
481
|
key: 0,
|
|
482
482
|
type: "button",
|
|
483
483
|
class: Pe(["sp-dropdown__trigger", { "sp-dropdown__trigger--open": s.value }]),
|
|
484
484
|
title: e.title,
|
|
485
485
|
onClick: j
|
|
486
486
|
}, [
|
|
487
|
-
(d =
|
|
487
|
+
(d = ae.value) != null && d.icon ? (W(), fe("span", {
|
|
488
488
|
key: 0,
|
|
489
489
|
class: "sp-dropdown__icon",
|
|
490
|
-
innerHTML:
|
|
491
|
-
}, null, 8, Ho)) : (W(),
|
|
490
|
+
innerHTML: ae.value.icon
|
|
491
|
+
}, null, 8, Ho)) : (W(), fe("span", Wo, 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",
|
|
@@ -497,22 +497,22 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
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
499
|
], 10, zo)),
|
|
500
|
-
(W(),
|
|
501
|
-
|
|
500
|
+
(W(), Ae(ze, { to: "body" }, [
|
|
501
|
+
Je(Wt, { name: "menu-pop" }, {
|
|
502
502
|
default: It(() => [
|
|
503
|
-
s.value ? (W(),
|
|
503
|
+
s.value ? (W(), fe("div", {
|
|
504
504
|
key: 0,
|
|
505
505
|
ref_key: "menuRef",
|
|
506
506
|
ref: v,
|
|
507
|
-
class: Pe(["sp-dropdown__menu", { "sp-dropdown__menu--up":
|
|
508
|
-
style: nt({ left:
|
|
509
|
-
onKeydown:
|
|
507
|
+
class: Pe(["sp-dropdown__menu", { "sp-dropdown__menu--up": le.value.up }]),
|
|
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
|
+
onKeydown: He
|
|
510
510
|
}, [
|
|
511
|
-
Y.value ? (W(),
|
|
511
|
+
Y.value ? (W(), fe("button", {
|
|
512
512
|
key: 0,
|
|
513
513
|
type: "button",
|
|
514
|
-
class: Pe(["sp-dropdown__nav", { "sp-dropdown__nav--disabled": !
|
|
515
|
-
disabled: !
|
|
514
|
+
class: Pe(["sp-dropdown__nav", { "sp-dropdown__nav--disabled": !he.value }]),
|
|
515
|
+
disabled: !he.value,
|
|
516
516
|
onClick: n[0] || (n[0] = (l) => X(-1))
|
|
517
517
|
}, [...n[3] || (n[3] = [
|
|
518
518
|
b("svg", {
|
|
@@ -521,30 +521,30 @@ const Rl = '-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, Io)) :
|
|
524
|
+
])], 10, Io)) : 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
530
|
onTouchmove: m,
|
|
531
|
-
onTouchend:
|
|
531
|
+
onTouchend: Ne
|
|
532
532
|
}, [
|
|
533
|
-
(W(!0),
|
|
533
|
+
(W(!0), fe(bt, null, Rt(Ce.value, (l) => (W(), fe("button", {
|
|
534
534
|
key: String(l.value),
|
|
535
535
|
type: "button",
|
|
536
536
|
class: Pe(["sp-dropdown__item", { "sp-dropdown__item--active": String(l.value) === String(e.modelValue) }]),
|
|
537
537
|
onClick: (r) => Me(l)
|
|
538
538
|
}, [
|
|
539
|
-
l.icon ? (W(),
|
|
539
|
+
l.icon ? (W(), fe("span", {
|
|
540
540
|
key: 0,
|
|
541
541
|
class: "sp-dropdown__item-icon",
|
|
542
542
|
innerHTML: l.icon
|
|
543
|
-
}, null, 8, Ko)) :
|
|
543
|
+
}, null, 8, Ko)) : Qe("", !0),
|
|
544
544
|
b("span", No, xt(l.label), 1)
|
|
545
545
|
], 10, $o))), 128))
|
|
546
546
|
], 544),
|
|
547
|
-
Y.value ? (W(),
|
|
547
|
+
Y.value ? (W(), fe("button", {
|
|
548
548
|
key: 1,
|
|
549
549
|
type: "button",
|
|
550
550
|
class: Pe(["sp-dropdown__nav", { "sp-dropdown__nav--disabled": !De.value }]),
|
|
@@ -557,8 +557,8 @@ const Rl = '-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, Vo)) :
|
|
561
|
-
], 38)) :
|
|
560
|
+
])], 10, Vo)) : Qe("", !0)
|
|
561
|
+
], 38)) : Qe("", !0)
|
|
562
562
|
]),
|
|
563
563
|
_: 1
|
|
564
564
|
})
|
|
@@ -571,7 +571,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
571
571
|
for (const [o, s] of p)
|
|
572
572
|
h[o] = s;
|
|
573
573
|
return h;
|
|
574
|
-
},
|
|
574
|
+
}, Rl = /* @__PURE__ */ Kt(Po, [["__scopeId", "data-v-8dc09f5d"]]), Uo = ["title", "onClick"], Yo = /* @__PURE__ */ $t({
|
|
575
575
|
__name: "colorPicker",
|
|
576
576
|
props: {
|
|
577
577
|
modelOpen: { type: Boolean, default: void 0 },
|
|
@@ -710,31 +710,31 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
710
710
|
{ key: "colorDarkCoffee", value: "#1F1800" },
|
|
711
711
|
{ key: "colorInkGreen", value: "#081C15" }
|
|
712
712
|
]
|
|
713
|
-
], z =
|
|
713
|
+
], z = se(
|
|
714
714
|
() => o.colorKey === "fill" ? a : k
|
|
715
715
|
);
|
|
716
716
|
function v(Y) {
|
|
717
717
|
return U(o.locale, Y);
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function le(Y) {
|
|
720
720
|
const X = o.currentColor;
|
|
721
721
|
return !X && !Y ? !0 : X ? X.toLowerCase() === Y.toLowerCase() : !1;
|
|
722
722
|
}
|
|
723
|
-
const q = V(!1), y = V(null),
|
|
723
|
+
const q = V(!1), y = V(null), ae = V(null), L = V({ top: 0 });
|
|
724
724
|
ut(() => o.modelOpen, (Y) => {
|
|
725
|
-
Y !== void 0 && Y !== q.value && (Y ? Ce() :
|
|
725
|
+
Y !== void 0 && Y !== q.value && (Y ? Ce() : he());
|
|
726
726
|
});
|
|
727
727
|
function f(Y) {
|
|
728
|
-
const X = y.value,
|
|
729
|
-
X && X.contains(
|
|
728
|
+
const X = y.value, be = ae.value, F = Y.target;
|
|
729
|
+
X && X.contains(F) || be && be.contains(F) || he();
|
|
730
730
|
}
|
|
731
731
|
function Ce() {
|
|
732
|
-
q.value = !0, o.modelOpen !== void 0 && s("update:modelOpen", !0),
|
|
732
|
+
q.value = !0, o.modelOpen !== void 0 && s("update:modelOpen", !0), $e(() => {
|
|
733
733
|
const Y = o.triggerEl ?? y.value;
|
|
734
734
|
if (Y) {
|
|
735
|
-
const X = Y.getBoundingClientRect(),
|
|
735
|
+
const X = Y.getBoundingClientRect(), be = 150, F = 120;
|
|
736
736
|
let j = window.innerWidth - X.right, Me = X.bottom + 4, Be;
|
|
737
|
-
X.left -
|
|
737
|
+
X.left - F < 4 && (j = void 0, Be = Math.max(4, X.left)), Me + be > window.innerHeight - 4 && (Me = X.top - be - 4), Me < 4 && (Me = 4), L.value = j !== void 0 ? {
|
|
738
738
|
right: j,
|
|
739
739
|
top: Me
|
|
740
740
|
} : {
|
|
@@ -745,26 +745,26 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
745
745
|
document.addEventListener("mousedown", f);
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function he() {
|
|
749
749
|
q.value = !1, o.modelOpen !== void 0 && s("update:modelOpen", !1), document.removeEventListener("mousedown", f);
|
|
750
750
|
}
|
|
751
751
|
function De(Y) {
|
|
752
|
-
s("update:modelValue", Y), s("change", Y),
|
|
752
|
+
s("update:modelValue", Y), s("change", Y), he();
|
|
753
753
|
}
|
|
754
754
|
return ll(() => {
|
|
755
755
|
document.removeEventListener("mousedown", f);
|
|
756
|
-
}), p({ open: q, openMenu: Ce, close:
|
|
756
|
+
}), p({ open: q, openMenu: Ce, close: he }), (Y, X) => (W(), fe("div", {
|
|
757
757
|
ref_key: "rootRef",
|
|
758
758
|
ref: y,
|
|
759
759
|
class: "color-picker"
|
|
760
760
|
}, [
|
|
761
|
-
(W(),
|
|
762
|
-
|
|
761
|
+
(W(), Ae(ze, { to: "body" }, [
|
|
762
|
+
Je(Wt, { name: "menu-pop" }, {
|
|
763
763
|
default: It(() => [
|
|
764
|
-
q.value ? (W(),
|
|
764
|
+
q.value ? (W(), fe("div", {
|
|
765
765
|
key: 0,
|
|
766
766
|
ref_key: "menuRef",
|
|
767
|
-
ref:
|
|
767
|
+
ref: ae,
|
|
768
768
|
class: "color-picker__menu",
|
|
769
769
|
style: nt({
|
|
770
770
|
left: L.value.left !== void 0 ? L.value.left + "px" : void 0,
|
|
@@ -774,13 +774,13 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
774
774
|
onMousedown: X[0] || (X[0] = qe(() => {
|
|
775
775
|
}, ["stop"]))
|
|
776
776
|
}, [
|
|
777
|
-
(W(!0),
|
|
778
|
-
key:
|
|
777
|
+
(W(!0), fe(bt, null, Rt(z.value, (be, F) => (W(), fe("div", {
|
|
778
|
+
key: F,
|
|
779
779
|
class: "color-picker__row"
|
|
780
780
|
}, [
|
|
781
|
-
(W(!0),
|
|
781
|
+
(W(!0), fe(bt, null, Rt(be, (j) => (W(), fe("button", {
|
|
782
782
|
key: j.value,
|
|
783
|
-
class: Pe(["color-picker__swatch", { "color-picker__swatch--selected":
|
|
783
|
+
class: Pe(["color-picker__swatch", { "color-picker__swatch--selected": le(j.value) }]),
|
|
784
784
|
title: v(j.key),
|
|
785
785
|
style: nt({
|
|
786
786
|
background: j.value || "transparent",
|
|
@@ -789,7 +789,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
789
789
|
onClick: (Me) => De(j.value)
|
|
790
790
|
}, null, 14, Uo))), 128))
|
|
791
791
|
]))), 128))
|
|
792
|
-
], 36)) :
|
|
792
|
+
], 36)) : Qe("", !0)
|
|
793
793
|
]),
|
|
794
794
|
_: 1
|
|
795
795
|
})
|
|
@@ -844,75 +844,75 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
844
844
|
outer: [],
|
|
845
845
|
thickOuter: ["top", "bottom", "left", "right"]
|
|
846
846
|
};
|
|
847
|
-
function
|
|
847
|
+
function le(Y, X) {
|
|
848
848
|
return v[Y].includes(X) ? "thick" : z[Y].includes(X) ? "solid" : "dashed";
|
|
849
849
|
}
|
|
850
|
-
const q = V(!1), y = V(null),
|
|
850
|
+
const q = V(!1), y = V(null), ae = V(null), L = V({ top: 0 });
|
|
851
851
|
ut(() => o.modelOpen, (Y) => {
|
|
852
|
-
Y !== void 0 && Y !== q.value && (Y ? Ce() :
|
|
852
|
+
Y !== void 0 && Y !== q.value && (Y ? Ce() : he());
|
|
853
853
|
});
|
|
854
854
|
function f(Y) {
|
|
855
|
-
const X = y.value,
|
|
856
|
-
X && X.contains(
|
|
855
|
+
const X = y.value, be = ae.value, F = Y.target;
|
|
856
|
+
X && X.contains(F) || be && be.contains(F) || he();
|
|
857
857
|
}
|
|
858
858
|
function Ce() {
|
|
859
|
-
q.value = !0, o.modelOpen !== void 0 && s("update:modelOpen", !0),
|
|
859
|
+
q.value = !0, o.modelOpen !== void 0 && s("update:modelOpen", !0), $e(() => {
|
|
860
860
|
const Y = o.triggerEl ?? y.value;
|
|
861
861
|
if (Y) {
|
|
862
|
-
const X = Y.getBoundingClientRect(),
|
|
862
|
+
const X = Y.getBoundingClientRect(), be = 200, F = 160;
|
|
863
863
|
let j = window.innerWidth - X.right, Me = X.bottom + 4, Be;
|
|
864
|
-
X.left -
|
|
864
|
+
X.left - F < 4 && (j = void 0, Be = Math.max(4, X.left)), Me + be > window.innerHeight - 4 && (Me = X.top - be - 4), Me < 4 && (Me = 4), L.value = j !== void 0 ? { right: j, top: Me } : { left: Be, top: Me };
|
|
865
865
|
}
|
|
866
866
|
document.addEventListener("mousedown", f);
|
|
867
867
|
});
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function he() {
|
|
870
870
|
q.value = !1, o.modelOpen !== void 0 && s("update:modelOpen", !1), document.removeEventListener("mousedown", f);
|
|
871
871
|
}
|
|
872
872
|
function De(Y) {
|
|
873
|
-
s("change", Y),
|
|
873
|
+
s("change", Y), he();
|
|
874
874
|
}
|
|
875
875
|
return ll(() => {
|
|
876
876
|
document.removeEventListener("mousedown", f);
|
|
877
|
-
}), p({ open: q, openMenu: Ce, close:
|
|
877
|
+
}), p({ open: q, openMenu: Ce, close: he }), (Y, X) => (W(), fe("div", {
|
|
878
878
|
ref_key: "rootRef",
|
|
879
879
|
ref: y,
|
|
880
880
|
class: "border-picker"
|
|
881
881
|
}, [
|
|
882
|
-
(W(),
|
|
883
|
-
|
|
882
|
+
(W(), Ae(ze, { to: "body" }, [
|
|
883
|
+
Je(Wt, { name: "menu-pop" }, {
|
|
884
884
|
default: It(() => [
|
|
885
|
-
q.value ? (W(),
|
|
885
|
+
q.value ? (W(), fe("div", {
|
|
886
886
|
key: 0,
|
|
887
887
|
ref_key: "menuRef",
|
|
888
|
-
ref:
|
|
888
|
+
ref: ae,
|
|
889
889
|
class: "border-picker__menu",
|
|
890
890
|
style: nt({ left: L.value.left !== void 0 ? L.value.left + "px" : void 0, right: L.value.right !== void 0 ? L.value.right + "px" : void 0, top: L.value.top + "px" }),
|
|
891
891
|
onMousedown: X[0] || (X[0] = qe(() => {
|
|
892
892
|
}, ["stop"]))
|
|
893
893
|
}, [
|
|
894
|
-
(W(),
|
|
895
|
-
key:
|
|
894
|
+
(W(), fe(bt, null, Rt(k, (be) => b("button", {
|
|
895
|
+
key: be.key,
|
|
896
896
|
class: "border-picker__item",
|
|
897
|
-
title: ke(U)(e.locale,
|
|
898
|
-
onClick: (
|
|
897
|
+
title: ke(U)(e.locale, be.i18nKey),
|
|
898
|
+
onClick: (F) => De(be.key)
|
|
899
899
|
}, [
|
|
900
|
-
(W(),
|
|
901
|
-
(W(),
|
|
902
|
-
key:
|
|
903
|
-
x1:
|
|
904
|
-
y1:
|
|
905
|
-
x2:
|
|
906
|
-
y2:
|
|
900
|
+
(W(), fe("svg", Xo, [
|
|
901
|
+
(W(), fe(bt, null, Rt(a, (F) => b("line", {
|
|
902
|
+
key: F.name,
|
|
903
|
+
x1: F.x1,
|
|
904
|
+
y1: F.y1,
|
|
905
|
+
x2: F.x2,
|
|
906
|
+
y2: F.y2,
|
|
907
907
|
stroke: "currentColor",
|
|
908
|
-
"stroke-width":
|
|
909
|
-
"stroke-dasharray":
|
|
910
|
-
"stroke-linecap":
|
|
908
|
+
"stroke-width": le(be.key, F.name) === "thick" ? 3 : 1.5,
|
|
909
|
+
"stroke-dasharray": le(be.key, F.name) === "dashed" ? "0 4" : "none",
|
|
910
|
+
"stroke-linecap": le(be.key, F.name) === "dashed" ? "round" : "square"
|
|
911
911
|
}, null, 8, jo)), 64))
|
|
912
912
|
])),
|
|
913
|
-
b("span", qo, xt(ke(U)(e.locale,
|
|
913
|
+
b("span", qo, xt(ke(U)(e.locale, be.i18nKey)), 1)
|
|
914
914
|
], 8, Go)), 64))
|
|
915
|
-
], 36)) :
|
|
915
|
+
], 36)) : Qe("", !0)
|
|
916
916
|
]),
|
|
917
917
|
_: 1
|
|
918
918
|
})
|
|
@@ -932,38 +932,38 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
932
932
|
ut(() => o.modelOpen, (L) => {
|
|
933
933
|
L !== void 0 && L !== k.value && (L ? q() : y());
|
|
934
934
|
});
|
|
935
|
-
function
|
|
936
|
-
const f = a.value, Ce = z.value,
|
|
937
|
-
f && f.contains(
|
|
935
|
+
function le(L) {
|
|
936
|
+
const f = a.value, Ce = z.value, he = L.target;
|
|
937
|
+
f && f.contains(he) || Ce && Ce.contains(he) || y();
|
|
938
938
|
}
|
|
939
939
|
function q() {
|
|
940
|
-
k.value = !0, o.modelOpen !== void 0 && s("update:modelOpen", !0),
|
|
940
|
+
k.value = !0, o.modelOpen !== void 0 && s("update:modelOpen", !0), $e(() => {
|
|
941
941
|
const L = o.triggerEl ?? a.value;
|
|
942
942
|
if (L) {
|
|
943
|
-
const f = L.getBoundingClientRect(), Ce = Zl.length * 30 + 12,
|
|
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 -
|
|
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), v.value = De !== void 0 ? { right: De, top: Y } : { left: X, top: Y };
|
|
946
946
|
}
|
|
947
|
-
document.addEventListener("mousedown",
|
|
947
|
+
document.addEventListener("mousedown", le);
|
|
948
948
|
});
|
|
949
949
|
}
|
|
950
950
|
function y() {
|
|
951
|
-
k.value = !1, o.modelOpen !== void 0 && s("update:modelOpen", !1), document.removeEventListener("mousedown",
|
|
951
|
+
k.value = !1, o.modelOpen !== void 0 && s("update:modelOpen", !1), document.removeEventListener("mousedown", le);
|
|
952
952
|
}
|
|
953
|
-
function
|
|
953
|
+
function ae(L) {
|
|
954
954
|
s("change", L), y();
|
|
955
955
|
}
|
|
956
956
|
return ll(() => {
|
|
957
|
-
document.removeEventListener("mousedown",
|
|
958
|
-
}), p({ open: k, openMenu: q, close: y }), (L, f) => (W(),
|
|
957
|
+
document.removeEventListener("mousedown", le);
|
|
958
|
+
}), p({ open: k, openMenu: q, close: y }), (L, f) => (W(), fe("div", {
|
|
959
959
|
ref_key: "rootRef",
|
|
960
960
|
ref: a,
|
|
961
961
|
class: "merge-picker"
|
|
962
962
|
}, [
|
|
963
|
-
(W(),
|
|
964
|
-
|
|
963
|
+
(W(), Ae(ze, { to: "body" }, [
|
|
964
|
+
Je(Wt, { name: "menu-pop" }, {
|
|
965
965
|
default: It(() => [
|
|
966
|
-
k.value ? (W(),
|
|
966
|
+
k.value ? (W(), fe("div", {
|
|
967
967
|
key: 0,
|
|
968
968
|
ref_key: "menuRef",
|
|
969
969
|
ref: z,
|
|
@@ -976,11 +976,11 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
976
976
|
onMousedown: f[0] || (f[0] = qe(() => {
|
|
977
977
|
}, ["stop"]))
|
|
978
978
|
}, [
|
|
979
|
-
(W(!0),
|
|
979
|
+
(W(!0), fe(bt, null, Rt(ke(Zl), (Ce) => (W(), fe("button", {
|
|
980
980
|
key: Ce.key,
|
|
981
981
|
class: "merge-picker__item",
|
|
982
982
|
title: ke(U)(e.locale, Ce.labelKey),
|
|
983
|
-
onClick: (
|
|
983
|
+
onClick: (he) => ae(Ce.key)
|
|
984
984
|
}, [
|
|
985
985
|
b("span", {
|
|
986
986
|
class: "merge-picker__icon",
|
|
@@ -988,7 +988,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
988
988
|
}, null, 8, _o),
|
|
989
989
|
b("span", en, xt(ke(U)(e.locale, Ce.labelKey)), 1)
|
|
990
990
|
], 8, Qo))), 128))
|
|
991
|
-
], 36)) :
|
|
991
|
+
], 36)) : Qe("", !0)
|
|
992
992
|
]),
|
|
993
993
|
_: 1
|
|
994
994
|
})
|
|
@@ -1022,7 +1022,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1022
1022
|
}, kn = ["title", "disabled"], xn = {
|
|
1023
1023
|
class: "tb-item",
|
|
1024
1024
|
"data-key": "underline"
|
|
1025
|
-
},
|
|
1025
|
+
}, Rn = ["title", "disabled"], Sn = {
|
|
1026
1026
|
class: "tb-item",
|
|
1027
1027
|
"data-key": "strike"
|
|
1028
1028
|
}, Mn = ["title", "disabled"], Bn = {
|
|
@@ -1143,8 +1143,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1143
1143
|
"vAlign",
|
|
1144
1144
|
"wrap",
|
|
1145
1145
|
"merge"
|
|
1146
|
-
], z = V(null), v = V(null),
|
|
1147
|
-
function
|
|
1146
|
+
], z = V(null), v = 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
|
+
function F(w) {
|
|
1148
1148
|
return Ce.value.has(w);
|
|
1149
1149
|
}
|
|
1150
1150
|
function j() {
|
|
@@ -1176,22 +1176,22 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1176
1176
|
const r = /* @__PURE__ */ new Set();
|
|
1177
1177
|
if (l > w) {
|
|
1178
1178
|
const I = w - er - Al;
|
|
1179
|
-
let
|
|
1179
|
+
let E = 0;
|
|
1180
1180
|
for (let $ = 0; $ < a.length; $++) {
|
|
1181
|
-
const
|
|
1182
|
-
if (
|
|
1183
|
-
for (let
|
|
1184
|
-
r.add(a[
|
|
1181
|
+
const ce = a[$], we = (X.get(ce) ?? 0) + Al;
|
|
1182
|
+
if (E + we > I) {
|
|
1183
|
+
for (let Oe = $; Oe < a.length; Oe++)
|
|
1184
|
+
r.add(a[Oe]);
|
|
1185
1185
|
break;
|
|
1186
1186
|
}
|
|
1187
|
-
|
|
1187
|
+
E += we;
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
|
-
Me(r, Ce.value) || (Ce.value = r, Y.value++, r.size === 0 && (
|
|
1190
|
+
Me(r, Ce.value) || (Ce.value = r, Y.value++, r.size === 0 && (he.value = !1));
|
|
1191
1191
|
}
|
|
1192
|
-
let
|
|
1193
|
-
const c = V(0), m =
|
|
1194
|
-
const w =
|
|
1192
|
+
let oe = null;
|
|
1193
|
+
const c = V(0), m = se(() => {
|
|
1194
|
+
const w = le.value, l = { position: "fixed", top: "0px", right: "0px" };
|
|
1195
1195
|
if (!w)
|
|
1196
1196
|
return { ...n.themeVars, ...l };
|
|
1197
1197
|
c.value;
|
|
@@ -1203,39 +1203,39 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1203
1203
|
right: `${window.innerWidth - r.right}px`
|
|
1204
1204
|
};
|
|
1205
1205
|
});
|
|
1206
|
-
function
|
|
1207
|
-
|
|
1206
|
+
function Ne() {
|
|
1207
|
+
he.value && (c.value++, $e(() => Be()));
|
|
1208
1208
|
}
|
|
1209
|
-
function
|
|
1209
|
+
function He(w) {
|
|
1210
1210
|
var r, I;
|
|
1211
|
-
if (!
|
|
1211
|
+
if (!he.value)
|
|
1212
1212
|
return;
|
|
1213
1213
|
const l = w.target;
|
|
1214
|
-
(r = v.value) != null && r.contains(l) || (I =
|
|
1214
|
+
(r = v.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
|
}
|
|
1218
|
-
function
|
|
1219
|
-
|
|
1218
|
+
function de() {
|
|
1219
|
+
he.value = !he.value;
|
|
1220
1220
|
}
|
|
1221
1221
|
Il(() => {
|
|
1222
|
-
|
|
1222
|
+
$e(() => {
|
|
1223
1223
|
j(), Be();
|
|
1224
|
-
}), z.value && (
|
|
1225
|
-
|
|
1226
|
-
}),
|
|
1224
|
+
}), z.value && (oe = new ResizeObserver(() => {
|
|
1225
|
+
he.value || Be();
|
|
1226
|
+
}), oe.observe(z.value)), document.addEventListener("mousedown", He, !0), window.addEventListener("resize", Ne);
|
|
1227
1227
|
}), ll(() => {
|
|
1228
|
-
|
|
1228
|
+
oe == null || oe.disconnect(), document.removeEventListener("mousedown", He, !0), window.removeEventListener("resize", Ne);
|
|
1229
1229
|
});
|
|
1230
1230
|
const n = e, d = p;
|
|
1231
|
-
return (w, l) => (W(),
|
|
1231
|
+
return (w, l) => (W(), fe(bt, null, [
|
|
1232
1232
|
b("div", {
|
|
1233
1233
|
ref_key: "rootEl",
|
|
1234
1234
|
ref: z,
|
|
1235
1235
|
class: "toolbar"
|
|
1236
1236
|
}, [
|
|
1237
|
-
(W(),
|
|
1238
|
-
disabled: !
|
|
1237
|
+
(W(), Ae(ze, {
|
|
1238
|
+
disabled: !F("undo"),
|
|
1239
1239
|
to: v.value ?? void 0
|
|
1240
1240
|
}, [
|
|
1241
1241
|
b("div", on, [
|
|
@@ -1255,8 +1255,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1255
1255
|
])], 10, nn)
|
|
1256
1256
|
])
|
|
1257
1257
|
], 8, ["disabled", "to"])),
|
|
1258
|
-
(W(),
|
|
1259
|
-
disabled: !
|
|
1258
|
+
(W(), Ae(ze, {
|
|
1259
|
+
disabled: !F("redo"),
|
|
1260
1260
|
to: v.value ?? void 0
|
|
1261
1261
|
}, [
|
|
1262
1262
|
b("div", rn, [
|
|
@@ -1279,8 +1279,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1279
1279
|
])], 10, an)
|
|
1280
1280
|
])
|
|
1281
1281
|
], 8, ["disabled", "to"])),
|
|
1282
|
-
(W(),
|
|
1283
|
-
disabled: !
|
|
1282
|
+
(W(), Ae(ze, {
|
|
1283
|
+
disabled: !F("paint"),
|
|
1284
1284
|
to: v.value ?? void 0
|
|
1285
1285
|
}, [
|
|
1286
1286
|
b("div", cn, [
|
|
@@ -1300,8 +1300,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1300
1300
|
])], 10, un)
|
|
1301
1301
|
])
|
|
1302
1302
|
], 8, ["disabled", "to"])),
|
|
1303
|
-
(W(),
|
|
1304
|
-
disabled: !
|
|
1303
|
+
(W(), Ae(ze, {
|
|
1304
|
+
disabled: !F("clear"),
|
|
1305
1305
|
to: v.value ?? void 0
|
|
1306
1306
|
}, [
|
|
1307
1307
|
b("div", sn, [
|
|
@@ -1321,8 +1321,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1321
1321
|
])], 10, dn)
|
|
1322
1322
|
])
|
|
1323
1323
|
], 8, ["disabled", "to"])),
|
|
1324
|
-
(W(),
|
|
1325
|
-
disabled: !
|
|
1324
|
+
(W(), Ae(ze, {
|
|
1325
|
+
disabled: !F("sep1"),
|
|
1326
1326
|
to: v.value ?? void 0
|
|
1327
1327
|
}, [
|
|
1328
1328
|
l[43] || (l[43] = b("div", {
|
|
@@ -1332,25 +1332,25 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1332
1332
|
b("div", { class: "toolbar-sep" })
|
|
1333
1333
|
], -1))
|
|
1334
1334
|
], 8, ["disabled", "to"])),
|
|
1335
|
-
(W(),
|
|
1336
|
-
disabled: !
|
|
1335
|
+
(W(), Ae(ze, {
|
|
1336
|
+
disabled: !F("font"),
|
|
1337
1337
|
to: v.value ?? void 0
|
|
1338
1338
|
}, [
|
|
1339
1339
|
b("div", fn, [
|
|
1340
|
-
|
|
1340
|
+
Je(Rl, {
|
|
1341
1341
|
class: "toolbar-font",
|
|
1342
1342
|
"model-value": e.selFontFamily,
|
|
1343
1343
|
options: e.fontFamilyOptions,
|
|
1344
|
-
width:
|
|
1345
|
-
"menu-width":
|
|
1344
|
+
width: F("font") ? "100%" : 110,
|
|
1345
|
+
"menu-width": F("font") ? 120 : void 0,
|
|
1346
1346
|
"visible-count": 8,
|
|
1347
1347
|
title: ke(U)(e.locale, "fontFamily"),
|
|
1348
1348
|
onChange: l[4] || (l[4] = (r) => d("font-family-change", r))
|
|
1349
1349
|
}, null, 8, ["model-value", "options", "width", "menu-width", "title"])
|
|
1350
1350
|
])
|
|
1351
1351
|
], 8, ["disabled", "to"])),
|
|
1352
|
-
(W(),
|
|
1353
|
-
disabled: !
|
|
1352
|
+
(W(), Ae(ze, {
|
|
1353
|
+
disabled: !F("fontSize"),
|
|
1354
1354
|
to: v.value ?? void 0
|
|
1355
1355
|
}, [
|
|
1356
1356
|
b("div", vn, [
|
|
@@ -1367,12 +1367,12 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1367
1367
|
onBlur: l[6] || (l[6] = (r) => d("font-size-blur")),
|
|
1368
1368
|
onKeydown: l[7] || (l[7] = (r) => d("font-size-keydown", r))
|
|
1369
1369
|
}, null, 40, mn),
|
|
1370
|
-
|
|
1370
|
+
Je(Rl, {
|
|
1371
1371
|
class: "toolbar-font-size__dropdown",
|
|
1372
1372
|
"model-value": e.selFontSize,
|
|
1373
1373
|
options: e.fontSizeOptions,
|
|
1374
|
-
width:
|
|
1375
|
-
"menu-width":
|
|
1374
|
+
width: F("fontSize") ? "100%" : 56,
|
|
1375
|
+
"menu-width": F("fontSize") ? 120 : 56,
|
|
1376
1376
|
"visible-count": 9,
|
|
1377
1377
|
title: ke(U)(e.locale, "fontSize"),
|
|
1378
1378
|
"hide-trigger": !0,
|
|
@@ -1433,8 +1433,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1433
1433
|
])
|
|
1434
1434
|
])
|
|
1435
1435
|
], 8, ["disabled", "to"])),
|
|
1436
|
-
(W(),
|
|
1437
|
-
disabled: !
|
|
1436
|
+
(W(), Ae(ze, {
|
|
1437
|
+
disabled: !F("sep2"),
|
|
1438
1438
|
to: v.value ?? void 0
|
|
1439
1439
|
}, [
|
|
1440
1440
|
l[47] || (l[47] = b("div", {
|
|
@@ -1444,8 +1444,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1444
1444
|
b("div", { class: "toolbar-sep" })
|
|
1445
1445
|
], -1))
|
|
1446
1446
|
], 8, ["disabled", "to"])),
|
|
1447
|
-
(W(),
|
|
1448
|
-
disabled: !
|
|
1447
|
+
(W(), Ae(ze, {
|
|
1448
|
+
disabled: !F("bold"),
|
|
1449
1449
|
to: v.value ?? void 0
|
|
1450
1450
|
}, [
|
|
1451
1451
|
b("div", Cn, [
|
|
@@ -1466,8 +1466,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1466
1466
|
])], 10, yn)
|
|
1467
1467
|
])
|
|
1468
1468
|
], 8, ["disabled", "to"])),
|
|
1469
|
-
(W(),
|
|
1470
|
-
disabled: !
|
|
1469
|
+
(W(), Ae(ze, {
|
|
1470
|
+
disabled: !F("italic"),
|
|
1471
1471
|
to: v.value ?? void 0
|
|
1472
1472
|
}, [
|
|
1473
1473
|
b("div", wn, [
|
|
@@ -1488,8 +1488,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1488
1488
|
])], 10, kn)
|
|
1489
1489
|
])
|
|
1490
1490
|
], 8, ["disabled", "to"])),
|
|
1491
|
-
(W(),
|
|
1492
|
-
disabled: !
|
|
1491
|
+
(W(), Ae(ze, {
|
|
1492
|
+
disabled: !F("underline"),
|
|
1493
1493
|
to: v.value ?? void 0
|
|
1494
1494
|
}, [
|
|
1495
1495
|
b("div", xn, [
|
|
@@ -1507,14 +1507,14 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1507
1507
|
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
1508
|
])
|
|
1509
1509
|
], -1)
|
|
1510
|
-
])], 10,
|
|
1510
|
+
])], 10, Rn)
|
|
1511
1511
|
])
|
|
1512
1512
|
], 8, ["disabled", "to"])),
|
|
1513
|
-
(W(),
|
|
1514
|
-
disabled: !
|
|
1513
|
+
(W(), Ae(ze, {
|
|
1514
|
+
disabled: !F("strike"),
|
|
1515
1515
|
to: v.value ?? void 0
|
|
1516
1516
|
}, [
|
|
1517
|
-
b("div",
|
|
1517
|
+
b("div", Sn, [
|
|
1518
1518
|
b("button", {
|
|
1519
1519
|
class: Pe(["toolbar-btn", { "toolbar-btn--active": e.selStrikethrough }]),
|
|
1520
1520
|
title: ke(U)(e.locale, "strikethrough"),
|
|
@@ -1532,8 +1532,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1532
1532
|
])], 10, Mn)
|
|
1533
1533
|
])
|
|
1534
1534
|
], 8, ["disabled", "to"])),
|
|
1535
|
-
(W(),
|
|
1536
|
-
disabled: !
|
|
1535
|
+
(W(), Ae(ze, {
|
|
1536
|
+
disabled: !F("sep3"),
|
|
1537
1537
|
to: v.value ?? void 0
|
|
1538
1538
|
}, [
|
|
1539
1539
|
l[52] || (l[52] = b("div", {
|
|
@@ -1543,8 +1543,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1543
1543
|
b("div", { class: "toolbar-sep" })
|
|
1544
1544
|
], -1))
|
|
1545
1545
|
], 8, ["disabled", "to"])),
|
|
1546
|
-
(W(),
|
|
1547
|
-
disabled: !
|
|
1546
|
+
(W(), Ae(ze, {
|
|
1547
|
+
disabled: !F("textColor"),
|
|
1548
1548
|
to: v.value ?? void 0
|
|
1549
1549
|
}, [
|
|
1550
1550
|
b("div", Bn, [
|
|
@@ -1555,7 +1555,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1555
1555
|
disabled: !e.hasSelection,
|
|
1556
1556
|
onClick: l[20] || (l[20] = (r) => d("apply-text-color"))
|
|
1557
1557
|
}, [
|
|
1558
|
-
(W(),
|
|
1558
|
+
(W(), fe("svg", Tn, [
|
|
1559
1559
|
l[53] || (l[53] = b("g", { transform: "translate(102.4, 102.4) scale(0.8)" }, [
|
|
1560
1560
|
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
1561
|
], -1)),
|
|
@@ -1580,7 +1580,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1580
1580
|
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
1581
|
], -1)
|
|
1582
1582
|
])], 8, Ln),
|
|
1583
|
-
|
|
1583
|
+
Je(Jl, {
|
|
1584
1584
|
"model-open": e.textColorMenuOpen,
|
|
1585
1585
|
"color-key": "text",
|
|
1586
1586
|
"current-color": e.selTextColor,
|
|
@@ -1592,8 +1592,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1592
1592
|
])
|
|
1593
1593
|
])
|
|
1594
1594
|
], 8, ["disabled", "to"])),
|
|
1595
|
-
(W(),
|
|
1596
|
-
disabled: !
|
|
1595
|
+
(W(), Ae(ze, {
|
|
1596
|
+
disabled: !F("fillColor"),
|
|
1597
1597
|
to: v.value ?? void 0
|
|
1598
1598
|
}, [
|
|
1599
1599
|
b("div", On, [
|
|
@@ -1604,7 +1604,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1604
1604
|
disabled: !e.hasSelection,
|
|
1605
1605
|
onClick: l[24] || (l[24] = (r) => d("apply-fill-color"))
|
|
1606
1606
|
}, [
|
|
1607
|
-
(W(),
|
|
1607
|
+
(W(), fe("svg", Hn, [
|
|
1608
1608
|
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
1609
|
b("path", {
|
|
1610
1610
|
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",
|
|
@@ -1627,7 +1627,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1627
1627
|
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
1628
|
], -1)
|
|
1629
1629
|
])], 8, In),
|
|
1630
|
-
|
|
1630
|
+
Je(Jl, {
|
|
1631
1631
|
"model-open": e.fillColorMenuOpen,
|
|
1632
1632
|
"color-key": "fill",
|
|
1633
1633
|
"current-color": e.selFillColor,
|
|
@@ -1639,8 +1639,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1639
1639
|
])
|
|
1640
1640
|
])
|
|
1641
1641
|
], 8, ["disabled", "to"])),
|
|
1642
|
-
(W(),
|
|
1643
|
-
disabled: !
|
|
1642
|
+
(W(), Ae(ze, {
|
|
1643
|
+
disabled: !F("border"),
|
|
1644
1644
|
to: v.value ?? void 0
|
|
1645
1645
|
}, [
|
|
1646
1646
|
b("div", $n, [
|
|
@@ -1651,8 +1651,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1651
1651
|
disabled: !e.hasSelection,
|
|
1652
1652
|
onClick: l[28] || (l[28] = (r) => d("apply-border"))
|
|
1653
1653
|
}, [
|
|
1654
|
-
(W(),
|
|
1655
|
-
(W(),
|
|
1654
|
+
(W(), fe("svg", Vn, [
|
|
1655
|
+
(W(), fe(bt, null, Rt(h, (r) => b("line", {
|
|
1656
1656
|
key: r.name,
|
|
1657
1657
|
x1: r.x1,
|
|
1658
1658
|
y1: r.y1,
|
|
@@ -1666,7 +1666,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1666
1666
|
], 8, Nn),
|
|
1667
1667
|
b("button", {
|
|
1668
1668
|
ref_key: "borderArrowRef",
|
|
1669
|
-
ref:
|
|
1669
|
+
ref: ae,
|
|
1670
1670
|
class: "toolbar-btn toolbar-split__arrow",
|
|
1671
1671
|
title: ke(U)(e.locale, "borders"),
|
|
1672
1672
|
disabled: !e.hasSelection,
|
|
@@ -1679,19 +1679,19 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1679
1679
|
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
1680
|
], -1)
|
|
1681
1681
|
])], 8, Un),
|
|
1682
|
-
|
|
1682
|
+
Je(Jo, {
|
|
1683
1683
|
"model-open": e.borderMenuOpen,
|
|
1684
1684
|
locale: e.locale,
|
|
1685
1685
|
"current-border": e.cachedBorder,
|
|
1686
|
-
"trigger-el":
|
|
1686
|
+
"trigger-el": ae.value,
|
|
1687
1687
|
"onUpdate:modelOpen": l[30] || (l[30] = (r) => d("update:border-menu-open", r)),
|
|
1688
1688
|
onChange: l[31] || (l[31] = (r) => d("border-change", r))
|
|
1689
1689
|
}, null, 8, ["model-open", "locale", "current-border", "trigger-el"])
|
|
1690
1690
|
])
|
|
1691
1691
|
])
|
|
1692
1692
|
], 8, ["disabled", "to"])),
|
|
1693
|
-
(W(),
|
|
1694
|
-
disabled: !
|
|
1693
|
+
(W(), Ae(ze, {
|
|
1694
|
+
disabled: !F("sep4"),
|
|
1695
1695
|
to: v.value ?? void 0
|
|
1696
1696
|
}, [
|
|
1697
1697
|
l[58] || (l[58] = b("div", {
|
|
@@ -1701,17 +1701,17 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1701
1701
|
b("div", { class: "toolbar-sep" })
|
|
1702
1702
|
], -1))
|
|
1703
1703
|
], 8, ["disabled", "to"])),
|
|
1704
|
-
(W(),
|
|
1705
|
-
disabled: !
|
|
1704
|
+
(W(), Ae(ze, {
|
|
1705
|
+
disabled: !F("hAlign"),
|
|
1706
1706
|
to: v.value ?? void 0
|
|
1707
1707
|
}, [
|
|
1708
1708
|
b("div", Yn, [
|
|
1709
|
-
|
|
1709
|
+
Je(Rl, {
|
|
1710
1710
|
class: "toolbar-align",
|
|
1711
1711
|
"model-value": e.selHAlign,
|
|
1712
1712
|
options: e.hAlignOptions,
|
|
1713
|
-
width:
|
|
1714
|
-
"menu-width":
|
|
1713
|
+
width: F("hAlign") ? "100%" : 44,
|
|
1714
|
+
"menu-width": F("hAlign") ? 120 : void 0,
|
|
1715
1715
|
"visible-count": 3,
|
|
1716
1716
|
align: "right",
|
|
1717
1717
|
title: ke(U)(e.locale, "hAlign"),
|
|
@@ -1719,17 +1719,17 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1719
1719
|
}, null, 8, ["model-value", "options", "width", "menu-width", "title"])
|
|
1720
1720
|
])
|
|
1721
1721
|
], 8, ["disabled", "to"])),
|
|
1722
|
-
(W(),
|
|
1723
|
-
disabled: !
|
|
1722
|
+
(W(), Ae(ze, {
|
|
1723
|
+
disabled: !F("vAlign"),
|
|
1724
1724
|
to: v.value ?? void 0
|
|
1725
1725
|
}, [
|
|
1726
1726
|
b("div", Gn, [
|
|
1727
|
-
|
|
1727
|
+
Je(Rl, {
|
|
1728
1728
|
class: "toolbar-align",
|
|
1729
1729
|
"model-value": e.selVAlign,
|
|
1730
1730
|
options: e.vAlignOptions,
|
|
1731
|
-
width:
|
|
1732
|
-
"menu-width":
|
|
1731
|
+
width: F("vAlign") ? "100%" : 44,
|
|
1732
|
+
"menu-width": F("vAlign") ? 120 : void 0,
|
|
1733
1733
|
"visible-count": 3,
|
|
1734
1734
|
align: "right",
|
|
1735
1735
|
title: ke(U)(e.locale, "vAlign"),
|
|
@@ -1752,8 +1752,8 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1752
1752
|
])], 10, jn)
|
|
1753
1753
|
])
|
|
1754
1754
|
], 8, ["disabled", "to"])),
|
|
1755
|
-
(W(),
|
|
1756
|
-
disabled: !
|
|
1755
|
+
(W(), Ae(ze, {
|
|
1756
|
+
disabled: !F("merge"),
|
|
1757
1757
|
to: v.value ?? void 0
|
|
1758
1758
|
}, [
|
|
1759
1759
|
b("div", qn, [
|
|
@@ -1786,7 +1786,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1786
1786
|
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
1787
|
], -1)
|
|
1788
1788
|
])], 8, Qn),
|
|
1789
|
-
|
|
1789
|
+
Je(ln, {
|
|
1790
1790
|
"model-open": e.mergeMenuOpen,
|
|
1791
1791
|
locale: e.locale,
|
|
1792
1792
|
"trigger-el": L.value,
|
|
@@ -1796,13 +1796,13 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1796
1796
|
])
|
|
1797
1797
|
])
|
|
1798
1798
|
], 8, ["disabled", "to"])),
|
|
1799
|
-
|
|
1799
|
+
be.value ? (W(), fe("button", {
|
|
1800
1800
|
key: 0,
|
|
1801
1801
|
ref_key: "moreBtnEl",
|
|
1802
|
-
ref:
|
|
1803
|
-
class: Pe(["toolbar-more", { "toolbar-more--active":
|
|
1802
|
+
ref: le,
|
|
1803
|
+
class: Pe(["toolbar-more", { "toolbar-more--active": he.value }]),
|
|
1804
1804
|
type: "button",
|
|
1805
|
-
onClick:
|
|
1805
|
+
onClick: de
|
|
1806
1806
|
}, [...l[62] || (l[62] = [
|
|
1807
1807
|
b("svg", {
|
|
1808
1808
|
viewBox: "0 0 1024 1024",
|
|
@@ -1824,19 +1824,19 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1824
1824
|
r: "96"
|
|
1825
1825
|
})
|
|
1826
1826
|
], -1)
|
|
1827
|
-
])], 2)) :
|
|
1827
|
+
])], 2)) : Qe("", !0)
|
|
1828
1828
|
], 512),
|
|
1829
|
-
(W(),
|
|
1830
|
-
|
|
1829
|
+
(W(), Ae(ze, { to: "body" }, [
|
|
1830
|
+
Je(Wt, { name: "menu-pop" }, {
|
|
1831
1831
|
default: It(() => [
|
|
1832
|
-
vo((W(),
|
|
1832
|
+
vo((W(), fe("div", {
|
|
1833
1833
|
ref_key: "overflowMenuEl",
|
|
1834
1834
|
ref: v,
|
|
1835
1835
|
key: Y.value,
|
|
1836
1836
|
class: Pe(["overflow-menu", { "no-anim": De.value }]),
|
|
1837
1837
|
style: nt(m.value)
|
|
1838
1838
|
}, null, 6)), [
|
|
1839
|
-
[go,
|
|
1839
|
+
[go, he.value]
|
|
1840
1840
|
])
|
|
1841
1841
|
]),
|
|
1842
1842
|
_: 1
|
|
@@ -1859,19 +1859,19 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1859
1859
|
emits: ["tab-click", "tab-dblclick", "tab-contextmenu", "tab-rename-input", "tab-rename-keydown", "tab-rename-commit", "add-sheet", "tabbar-contextmenu"],
|
|
1860
1860
|
setup(e, { emit: p }) {
|
|
1861
1861
|
const h = p;
|
|
1862
|
-
return (o, s) => (W(),
|
|
1862
|
+
return (o, s) => (W(), fe("div", {
|
|
1863
1863
|
class: "tab-bar",
|
|
1864
1864
|
onContextmenu: s[5] || (s[5] = (k) => h("tabbar-contextmenu", k))
|
|
1865
1865
|
}, [
|
|
1866
1866
|
b("div", or, [
|
|
1867
|
-
(W(!0),
|
|
1867
|
+
(W(!0), fe(bt, null, Rt(e.sheets, (k, a) => (W(), fe("div", {
|
|
1868
1868
|
key: k.id,
|
|
1869
1869
|
class: Pe(["tab-item", { "tab-item--active": a === e.activeSheetIndex }]),
|
|
1870
1870
|
onClick: (z) => h("tab-click", a),
|
|
1871
1871
|
onDblclick: qe((z) => h("tab-dblclick", a), ["prevent"]),
|
|
1872
1872
|
onContextmenu: (z) => h("tab-contextmenu", { ev: z, i: a })
|
|
1873
1873
|
}, [
|
|
1874
|
-
e.renTab === a ? (W(),
|
|
1874
|
+
e.renTab === a ? (W(), fe("input", {
|
|
1875
1875
|
key: 0,
|
|
1876
1876
|
class: "tab-rename-input",
|
|
1877
1877
|
value: e.renTabVal,
|
|
@@ -1880,7 +1880,7 @@ const Rl = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sa
|
|
|
1880
1880
|
onBlur: s[2] || (s[2] = (z) => h("tab-rename-commit")),
|
|
1881
1881
|
onClick: s[3] || (s[3] = qe(() => {
|
|
1882
1882
|
}, ["stop"]))
|
|
1883
|
-
}, null, 40, rr)) : (W(),
|
|
1883
|
+
}, null, 40, rr)) : (W(), fe("span", ar, xt(k.name), 1))
|
|
1884
1884
|
], 42, nr))), 128))
|
|
1885
1885
|
]),
|
|
1886
1886
|
b("button", {
|
|
@@ -1975,17 +1975,17 @@ function fr(e, p, h, o, s) {
|
|
|
1975
1975
|
return NaN;
|
|
1976
1976
|
const a = k.value;
|
|
1977
1977
|
if (!a.startsWith("=")) {
|
|
1978
|
-
const
|
|
1978
|
+
const le = parseFloat(a), q = isNaN(le) ? 0 : le;
|
|
1979
1979
|
return _t.set(e, q), q;
|
|
1980
1980
|
}
|
|
1981
1981
|
const z = a.slice(1).trim();
|
|
1982
1982
|
if (z.toUpperCase().startsWith("SUM(") && z.endsWith(")")) {
|
|
1983
|
-
const
|
|
1983
|
+
const le = z.slice(4, -1).trim(), q = sr(le, h, o);
|
|
1984
1984
|
if (q) {
|
|
1985
1985
|
let y = 0;
|
|
1986
|
-
for (let
|
|
1986
|
+
for (let ae = q.sc; ae <= q.ec; ae++)
|
|
1987
1987
|
for (let L = q.sr; L <= q.er; L++)
|
|
1988
|
-
y += dr(
|
|
1988
|
+
y += dr(ae, L, p, h, o);
|
|
1989
1989
|
return isNaN(y) ? NaN : (_t.set(e, y), y);
|
|
1990
1990
|
}
|
|
1991
1991
|
return NaN;
|
|
@@ -2003,8 +2003,8 @@ function $l(e, p, h) {
|
|
|
2003
2003
|
if (!z)
|
|
2004
2004
|
continue;
|
|
2005
2005
|
for (let v = Math.min(a.col, z.col); v <= Math.max(a.col, z.col); v++)
|
|
2006
|
-
for (let
|
|
2007
|
-
o.push(tl(v,
|
|
2006
|
+
for (let le = Math.min(a.row, z.row); le <= Math.max(a.row, z.row); le++)
|
|
2007
|
+
o.push(tl(v, le));
|
|
2008
2008
|
} else
|
|
2009
2009
|
o.push(tl(a.col, a.row));
|
|
2010
2010
|
}
|
|
@@ -2023,12 +2023,12 @@ function vr(e, p, h, o, s) {
|
|
|
2023
2023
|
function gr(e, p, h, o, s, k) {
|
|
2024
2024
|
return p === 0 && h === 0 ? e : e.replace(
|
|
2025
2025
|
/(\$?)([A-Z]+)(\$?)(\d+)/gi,
|
|
2026
|
-
(a, z, v,
|
|
2027
|
-
const y = z ? Hl(v) : Hl(v) + p,
|
|
2026
|
+
(a, z, v, le, q) => {
|
|
2027
|
+
const y = z ? Hl(v) : Hl(v) + p, ae = le ? parseInt(q, 10) - 1 : parseInt(q, 10) - 1 + h;
|
|
2028
2028
|
let L;
|
|
2029
2029
|
y < 0 ? L = "A" : y >= o ? L = k(o - 1) : L = k(y);
|
|
2030
2030
|
let f;
|
|
2031
|
-
return
|
|
2031
|
+
return ae < 0 ? f = "1" : ae >= s ? f = String(s) : f = String(ae + 1), (z || "") + L + (le || "") + f;
|
|
2032
2032
|
}
|
|
2033
2033
|
);
|
|
2034
2034
|
}
|
|
@@ -2083,232 +2083,234 @@ function pr(e, p) {
|
|
|
2083
2083
|
height: e.height,
|
|
2084
2084
|
theme: e.theme ?? p.theme,
|
|
2085
2085
|
locale: e.locale ?? p.locale
|
|
2086
|
-
}, o =
|
|
2086
|
+
}, o = se(() => h.locale === "zh-CN" ? "zh-CN" : "en-US"), s = h.colCount, k = h.rowCount, a = Tt({}), z = Tt({}), v = new mr(), 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 - Mt) / 2, Y = /* @__PURE__ */ new Map();
|
|
2087
2087
|
let X = null;
|
|
2088
|
-
function
|
|
2089
|
-
const Z = `${G} ${
|
|
2090
|
-
if (
|
|
2091
|
-
return
|
|
2088
|
+
function be(x, R, S, G) {
|
|
2089
|
+
const Z = `${G} ${S} ${R}px ${x}`, ie = Y.get(Z);
|
|
2090
|
+
if (ie)
|
|
2091
|
+
return ie;
|
|
2092
2092
|
X || (X = document.createElement("canvas"));
|
|
2093
2093
|
const ge = X.getContext("2d");
|
|
2094
2094
|
if (!ge)
|
|
2095
|
-
return { ascent:
|
|
2095
|
+
return { ascent: R * 0.8, descent: R * 0.2 };
|
|
2096
2096
|
ge.font = Z;
|
|
2097
|
-
const i = ge.measureText("M"), C = i.actualBoundingBoxAscent, H = i.actualBoundingBoxDescent, K = C ||
|
|
2098
|
-
return Y.set(Z,
|
|
2099
|
-
}
|
|
2100
|
-
let
|
|
2101
|
-
startCol: Math.min(x,
|
|
2102
|
-
startRow: Math.min(
|
|
2103
|
-
endCol: Math.max(x,
|
|
2104
|
-
endRow: Math.max(
|
|
2097
|
+
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
|
+
return Y.set(Z, me), me;
|
|
2099
|
+
}
|
|
2100
|
+
let F = (x, R) => `${x},${R}`, j = () => null, Me = () => Mt, Be = se(() => [0]), oe = () => Ol, c = (x, R, S, G) => ({
|
|
2101
|
+
startCol: Math.min(x, S),
|
|
2102
|
+
startRow: Math.min(R, G),
|
|
2103
|
+
endCol: Math.max(x, S),
|
|
2104
|
+
endRow: Math.max(R, G)
|
|
2105
2105
|
});
|
|
2106
|
-
function m(x,
|
|
2106
|
+
function m(x, R) {
|
|
2107
2107
|
var i;
|
|
2108
|
-
const
|
|
2109
|
-
return
|
|
2108
|
+
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
|
+
return be(Z, G, ie, ge);
|
|
2110
2110
|
}
|
|
2111
|
-
function
|
|
2112
|
-
if (!
|
|
2111
|
+
function Ne(x, R, S, G) {
|
|
2112
|
+
if (!R)
|
|
2113
2113
|
return [""];
|
|
2114
|
-
const Z =
|
|
2115
|
-
`),
|
|
2114
|
+
const Z = R.split(`
|
|
2115
|
+
`), ie = [];
|
|
2116
2116
|
for (const ge of Z)
|
|
2117
|
-
if (!G ||
|
|
2118
|
-
|
|
2117
|
+
if (!G || S <= 0)
|
|
2118
|
+
ie.push(ge);
|
|
2119
2119
|
else {
|
|
2120
2120
|
let i = "";
|
|
2121
2121
|
for (let C = 0; C < ge.length; C++) {
|
|
2122
2122
|
const H = ge[C], K = i + H;
|
|
2123
|
-
x.measureText(K).width >
|
|
2123
|
+
x.measureText(K).width > S && i ? (ie.push(i), i = H) : i = K;
|
|
2124
2124
|
}
|
|
2125
|
-
|
|
2125
|
+
ie.push(i);
|
|
2126
2126
|
}
|
|
2127
|
-
return
|
|
2127
|
+
return ie;
|
|
2128
2128
|
}
|
|
2129
|
-
function
|
|
2129
|
+
function He(x, R) {
|
|
2130
2130
|
var G;
|
|
2131
|
-
const
|
|
2132
|
-
return typeof (
|
|
2131
|
+
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 : Mt;
|
|
2133
2133
|
}
|
|
2134
|
-
Me =
|
|
2135
|
-
const
|
|
2134
|
+
Me = He;
|
|
2135
|
+
const de = se(() => {
|
|
2136
2136
|
const x = [0];
|
|
2137
|
-
for (let
|
|
2138
|
-
x.push(x[
|
|
2137
|
+
for (let R = 0; R < s; R++)
|
|
2138
|
+
x.push(x[R] + L.value[R]);
|
|
2139
2139
|
return x;
|
|
2140
2140
|
});
|
|
2141
|
-
Be =
|
|
2141
|
+
Be = de;
|
|
2142
2142
|
const n = { w: 800, h: 600 };
|
|
2143
2143
|
let d = () => {
|
|
2144
2144
|
};
|
|
2145
2145
|
function w(x) {
|
|
2146
2146
|
var K;
|
|
2147
|
-
const
|
|
2148
|
-
if (
|
|
2149
|
-
return
|
|
2150
|
-
let
|
|
2147
|
+
const R = f.value[x];
|
|
2148
|
+
if (R != null && R > 0)
|
|
2149
|
+
return R;
|
|
2150
|
+
let S = Mt, G = S * 0.8, Z = S * 0.2, ie = 1;
|
|
2151
2151
|
const ge = X ? X.getContext("2d") : null;
|
|
2152
|
-
for (let
|
|
2153
|
-
const
|
|
2152
|
+
for (let J = 0; J < s; J++) {
|
|
2153
|
+
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);
|
|
2154
2154
|
if (Ue && ge) {
|
|
2155
|
-
ge.font = `${
|
|
2156
|
-
const
|
|
2157
|
-
`)[0] || Ue, at = ge.measureText(
|
|
2158
|
-
hl > G && (G = hl), bl > Z && (Z = bl),
|
|
2159
|
-
const Bl = (
|
|
2155
|
+
ge.font = `${Ze} ${Te} ${te}px ${me}`;
|
|
2156
|
+
const et = Ue.split(`
|
|
2157
|
+
`)[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
|
+
hl > G && (G = hl), bl > Z && (Z = bl), te > S && (S = te);
|
|
2159
|
+
const Bl = (Q == null ? void 0 : Q.wrap) === "wrap";
|
|
2160
2160
|
let Dt;
|
|
2161
2161
|
if (Bl) {
|
|
2162
|
-
const Nt = j(
|
|
2162
|
+
const Nt = j(J, x);
|
|
2163
2163
|
let rl;
|
|
2164
|
-
Nt &&
|
|
2164
|
+
Nt && J === Nt.range.startCol && x === Nt.range.startRow ? rl = Be.value[Nt.range.endCol + 1] - Be.value[J] : rl = L.value[J], Dt = Ne(ge, Ue, Math.max(0, rl - 10), !0).length, Dt > ie && (ie = Dt);
|
|
2165
2165
|
} else
|
|
2166
2166
|
Dt = Ue.split(`
|
|
2167
|
-
`).length, Dt >
|
|
2168
|
-
} else if (
|
|
2169
|
-
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2167
|
+
`).length, Dt > ie && (ie = Dt);
|
|
2168
|
+
} else if (te > S) {
|
|
2169
|
+
S = te;
|
|
2170
|
+
const et = be(me, te, Te, Ze);
|
|
2171
|
+
et.ascent > G && (G = et.ascent), et.descent > Z && (Z = et.descent);
|
|
2172
2172
|
}
|
|
2173
2173
|
}
|
|
2174
|
-
const i =
|
|
2174
|
+
const i = S, C = De * 2 + ie * i;
|
|
2175
2175
|
return Math.min(gl, Math.max(Ol, Math.round(C)));
|
|
2176
2176
|
}
|
|
2177
|
-
|
|
2177
|
+
oe = w;
|
|
2178
2178
|
function l(x) {
|
|
2179
2179
|
return f.value[x] === void 0;
|
|
2180
2180
|
}
|
|
2181
|
-
const r =
|
|
2181
|
+
const r = se(() => {
|
|
2182
2182
|
const x = [0];
|
|
2183
|
-
for (let
|
|
2184
|
-
x.push(x[
|
|
2183
|
+
for (let R = 0; R < k; R++)
|
|
2184
|
+
x.push(x[R] + oe(R));
|
|
2185
2185
|
return x;
|
|
2186
|
-
}), I =
|
|
2187
|
-
function $(x,
|
|
2188
|
-
return `${x},${
|
|
2186
|
+
}), I = se(() => de.value[s]), E = se(() => r.value[k]);
|
|
2187
|
+
function $(x, R) {
|
|
2188
|
+
return `${x},${R}`;
|
|
2189
2189
|
}
|
|
2190
|
-
|
|
2191
|
-
function
|
|
2190
|
+
F = $;
|
|
2191
|
+
function ce(x) {
|
|
2192
2192
|
Reflect.deleteProperty(a, x);
|
|
2193
2193
|
}
|
|
2194
|
-
function we(x,
|
|
2195
|
-
const
|
|
2196
|
-
|
|
2194
|
+
function we(x, R) {
|
|
2195
|
+
const S = j(x, R);
|
|
2196
|
+
S ? (q.value = { col: S.range.startCol, row: S.range.startRow }, le.value = { ...S.range }) : (q.value = { col: x, row: R }, le.value = { startCol: x, startRow: R, endCol: x, endRow: R });
|
|
2197
2197
|
}
|
|
2198
|
-
function
|
|
2199
|
-
const Z = j(x,
|
|
2200
|
-
q.value = Z ? { col: Z.range.startCol, row: Z.range.startRow } : { col: x, row:
|
|
2198
|
+
function Oe(x, R, S, G) {
|
|
2199
|
+
const Z = j(x, R);
|
|
2200
|
+
q.value = Z ? { col: Z.range.startCol, row: Z.range.startRow } : { col: x, row: R }, le.value = c(x, R, S, G);
|
|
2201
2201
|
}
|
|
2202
|
-
function
|
|
2203
|
-
|
|
2202
|
+
function Ve() {
|
|
2203
|
+
Oe(0, 0, s - 1, k - 1);
|
|
2204
2204
|
}
|
|
2205
|
-
function Xe(x,
|
|
2206
|
-
const
|
|
2207
|
-
return
|
|
2205
|
+
function Xe(x, R) {
|
|
2206
|
+
const S = le.value;
|
|
2207
|
+
return S ? x >= S.startCol && x <= S.endCol && R >= S.startRow && R <= S.endRow : !1;
|
|
2208
2208
|
}
|
|
2209
|
-
function ye(x,
|
|
2210
|
-
for (const
|
|
2211
|
-
const G = z[
|
|
2212
|
-
if (G && x >= G.startCol && x <= G.endCol &&
|
|
2213
|
-
return { range: G, anchor:
|
|
2209
|
+
function ye(x, R) {
|
|
2210
|
+
for (const S in z) {
|
|
2211
|
+
const G = z[S];
|
|
2212
|
+
if (G && x >= G.startCol && x <= G.endCol && R >= G.startRow && R <= G.endRow)
|
|
2213
|
+
return { range: G, anchor: S };
|
|
2214
2214
|
}
|
|
2215
2215
|
return null;
|
|
2216
2216
|
}
|
|
2217
2217
|
j = ye;
|
|
2218
|
-
function
|
|
2219
|
-
return z[$(x,
|
|
2218
|
+
function _e(x, R) {
|
|
2219
|
+
return z[$(x, R)] !== void 0;
|
|
2220
2220
|
}
|
|
2221
|
-
function
|
|
2222
|
-
const
|
|
2223
|
-
if (
|
|
2224
|
-
const G =
|
|
2221
|
+
function B(x, R) {
|
|
2222
|
+
const S = j(x, R);
|
|
2223
|
+
if (S && x === S.range.startCol && R === S.range.startRow) {
|
|
2224
|
+
const G = de.value[S.range.endCol + 1] - de.value[x], Z = r.value[S.range.endRow + 1] - r.value[R];
|
|
2225
2225
|
return { w: G, h: Z };
|
|
2226
2226
|
}
|
|
2227
|
-
return { w: L.value[x], h:
|
|
2227
|
+
return { w: L.value[x], h: oe(R) };
|
|
2228
2228
|
}
|
|
2229
|
-
function O(x,
|
|
2230
|
-
let Z = Math.min(x,
|
|
2229
|
+
function O(x, R, S, G) {
|
|
2230
|
+
let Z = Math.min(x, S), ie = Math.max(x, S), ge = Math.min(R, G), i = Math.max(R, G), C = !0;
|
|
2231
2231
|
for (; C; ) {
|
|
2232
2232
|
C = !1;
|
|
2233
2233
|
for (const H in z) {
|
|
2234
2234
|
const K = z[H];
|
|
2235
2235
|
if (!K)
|
|
2236
2236
|
continue;
|
|
2237
|
-
K.startCol <=
|
|
2237
|
+
K.startCol <= ie && K.endCol >= Z && K.startRow <= i && K.endRow >= ge && (K.startCol < Z && (Z = K.startCol, C = !0), K.endCol > ie && (ie = K.endCol, C = !0), K.startRow < ge && (ge = K.startRow, C = !0), K.endRow > i && (i = K.endRow, C = !0));
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
|
-
return { startCol: Z, startRow: ge, endCol:
|
|
2240
|
+
return { startCol: Z, startRow: ge, endCol: ie, endRow: i };
|
|
2241
2241
|
}
|
|
2242
2242
|
c = O;
|
|
2243
2243
|
let P = () => {
|
|
2244
2244
|
};
|
|
2245
|
-
function
|
|
2246
|
-
var
|
|
2247
|
-
return ((
|
|
2248
|
-
}
|
|
2249
|
-
function
|
|
2250
|
-
return Wl(), vr(x,
|
|
2251
|
-
}
|
|
2252
|
-
function N(x,
|
|
2253
|
-
var ge;
|
|
2254
|
-
const G = $(x,
|
|
2255
|
-
if (Wl(),
|
|
2256
|
-
v.clear(G)
|
|
2245
|
+
function ne(x, R) {
|
|
2246
|
+
var S;
|
|
2247
|
+
return ((S = a[$(x, R)]) == null ? void 0 : S.value) ?? "";
|
|
2248
|
+
}
|
|
2249
|
+
function pe(x, R) {
|
|
2250
|
+
return Wl(), vr(x, R, a, s, k);
|
|
2251
|
+
}
|
|
2252
|
+
function N(x, R, S) {
|
|
2253
|
+
var ge, i;
|
|
2254
|
+
const G = $(x, R);
|
|
2255
|
+
if (Wl(), S === "" || S == null) {
|
|
2256
|
+
v.clear(G);
|
|
2257
|
+
const C = ((ge = a[G]) == null ? void 0 : ge.style) ?? null;
|
|
2258
|
+
C ? a[G] = { value: "", style: C } : ce(G), v.markDirty(G);
|
|
2257
2259
|
return;
|
|
2258
2260
|
}
|
|
2259
|
-
const Z = String(
|
|
2260
|
-
a[G] = { value: Z, style:
|
|
2261
|
-
}
|
|
2262
|
-
function ve(x,
|
|
2263
|
-
for (let Z = x; Z <=
|
|
2264
|
-
for (let
|
|
2265
|
-
const ge = $(Z,
|
|
2266
|
-
v.clear(ge),
|
|
2261
|
+
const Z = String(S), ie = ((i = a[G]) == null ? void 0 : i.style) ?? null;
|
|
2262
|
+
a[G] = { value: Z, style: ie }, Z.startsWith("=") ? v.set(G, $l(Z.slice(1), s, k)) : v.clear(G), v.markDirty(G);
|
|
2263
|
+
}
|
|
2264
|
+
function ve(x, R, S, G) {
|
|
2265
|
+
for (let Z = x; Z <= R; Z++)
|
|
2266
|
+
for (let ie = S; ie <= G; ie++) {
|
|
2267
|
+
const ge = $(Z, ie);
|
|
2268
|
+
v.clear(ge), ce(ge), v.markDirty(ge), P(Z, ie);
|
|
2267
2269
|
}
|
|
2268
2270
|
}
|
|
2269
2271
|
let Fe = () => {
|
|
2270
2272
|
};
|
|
2271
|
-
function
|
|
2272
|
-
y.value || (y.value = { ...q.value },
|
|
2273
|
+
function Ke(x) {
|
|
2274
|
+
y.value || (y.value = { ...q.value }, ae.value = x ?? ne(q.value.col, q.value.row));
|
|
2273
2275
|
}
|
|
2274
2276
|
function gt() {
|
|
2275
|
-
y.value && (Fe(), N(y.value.col, y.value.row,
|
|
2277
|
+
y.value && (Fe(), N(y.value.col, y.value.row, ae.value), y.value = null, ae.value = "");
|
|
2276
2278
|
}
|
|
2277
2279
|
function Ct() {
|
|
2278
|
-
y.value = null,
|
|
2280
|
+
y.value = null, ae.value = "";
|
|
2279
2281
|
}
|
|
2280
|
-
function
|
|
2281
|
-
const
|
|
2282
|
-
let G = Math.max(0, Math.min(s - 1,
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2282
|
+
function tt(x, R) {
|
|
2283
|
+
const S = q.value;
|
|
2284
|
+
let G = Math.max(0, Math.min(s - 1, S.col + x)), Z = Math.max(0, Math.min(k - 1, S.row + R));
|
|
2285
|
+
const ie = j(S.col, S.row), ge = j(G, Z);
|
|
2286
|
+
ie && ge && ie.anchor === ge.anchor && (x > 0 ? G = ie.range.endCol + 1 : x < 0 && (G = ie.range.startCol - 1), R > 0 ? Z = ie.range.endRow + 1 : R < 0 && (Z = ie.range.startRow - 1), G = Math.max(0, Math.min(s - 1, G)), Z = Math.max(0, Math.min(k - 1, Z))), we(G, Z);
|
|
2285
2287
|
}
|
|
2286
|
-
function st(x,
|
|
2287
|
-
const
|
|
2288
|
-
let H = Ce.value, K =
|
|
2289
|
-
Z < H ? H = Z : Z + i > H +
|
|
2288
|
+
function st(x, R) {
|
|
2289
|
+
const S = Math.max(0, n.w - Re - el), G = Math.max(0, n.h - Se - el), Z = de.value[x], ie = r.value[R], ge = j(x, R), i = ge ? de.value[ge.range.endCol + 1] - de.value[x] : L.value[x], C = ge ? r.value[ge.range.endRow + 1] - r.value[R] : oe(R);
|
|
2290
|
+
let H = Ce.value, K = he.value;
|
|
2291
|
+
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);
|
|
2290
2292
|
}
|
|
2291
2293
|
function Bt(x) {
|
|
2292
|
-
const
|
|
2293
|
-
if (x < 0 || x >=
|
|
2294
|
+
const R = de.value;
|
|
2295
|
+
if (x < 0 || x >= R[s])
|
|
2294
2296
|
return -1;
|
|
2295
|
-
let
|
|
2296
|
-
for (;
|
|
2297
|
-
const Z =
|
|
2298
|
-
|
|
2297
|
+
let S = 0, G = s - 1;
|
|
2298
|
+
for (; S < G; ) {
|
|
2299
|
+
const Z = S + G + 1 >> 1;
|
|
2300
|
+
R[Z] <= x ? S = Z : G = Z - 1;
|
|
2299
2301
|
}
|
|
2300
|
-
return
|
|
2302
|
+
return S;
|
|
2301
2303
|
}
|
|
2302
2304
|
function ol(x) {
|
|
2303
|
-
const
|
|
2304
|
-
if (x < 0 || x >=
|
|
2305
|
+
const R = r.value;
|
|
2306
|
+
if (x < 0 || x >= R[k])
|
|
2305
2307
|
return -1;
|
|
2306
|
-
let
|
|
2307
|
-
for (;
|
|
2308
|
-
const Z =
|
|
2309
|
-
|
|
2308
|
+
let S = 0, G = k - 1;
|
|
2309
|
+
for (; S < G; ) {
|
|
2310
|
+
const Z = S + G + 1 >> 1;
|
|
2311
|
+
R[Z] <= x ? S = Z : G = Z - 1;
|
|
2310
2312
|
}
|
|
2311
|
-
return
|
|
2313
|
+
return S;
|
|
2312
2314
|
}
|
|
2313
2315
|
const rt = {
|
|
2314
2316
|
props: h,
|
|
@@ -2318,45 +2320,45 @@ function pr(e, p) {
|
|
|
2318
2320
|
cells: a,
|
|
2319
2321
|
merges: z,
|
|
2320
2322
|
formulaDeps: v,
|
|
2321
|
-
selection:
|
|
2323
|
+
selection: le,
|
|
2322
2324
|
activeCell: q,
|
|
2323
2325
|
editingCell: y,
|
|
2324
|
-
editValue:
|
|
2326
|
+
editValue: ae,
|
|
2325
2327
|
colWidths: L,
|
|
2326
2328
|
rowHeights: f,
|
|
2327
2329
|
scrollX: Ce,
|
|
2328
|
-
scrollY:
|
|
2330
|
+
scrollY: he,
|
|
2329
2331
|
BASE_CELL_VPAD: De,
|
|
2330
2332
|
fontMetricsCache: Y,
|
|
2331
2333
|
fontMetricsCanvas: X,
|
|
2332
|
-
measureFontMetrics:
|
|
2334
|
+
measureFontMetrics: be,
|
|
2333
2335
|
_getFontMetricsForCell: m,
|
|
2334
|
-
getWrappedLines:
|
|
2335
|
-
cellFontSize:
|
|
2336
|
-
colPositions:
|
|
2336
|
+
getWrappedLines: Ne,
|
|
2337
|
+
cellFontSize: He,
|
|
2338
|
+
colPositions: de,
|
|
2337
2339
|
getRowHeight: w,
|
|
2338
2340
|
_isAutoRow: l,
|
|
2339
2341
|
rowPositions: r,
|
|
2340
2342
|
totalWidth: I,
|
|
2341
|
-
totalHeight:
|
|
2343
|
+
totalHeight: E,
|
|
2342
2344
|
selectCell: we,
|
|
2343
|
-
selectRange:
|
|
2344
|
-
selectAll:
|
|
2345
|
+
selectRange: Oe,
|
|
2346
|
+
selectAll: Ve,
|
|
2345
2347
|
isSelected: Xe,
|
|
2346
2348
|
cellKey: $,
|
|
2347
|
-
delCell:
|
|
2349
|
+
delCell: ce,
|
|
2348
2350
|
findMerge: ye,
|
|
2349
|
-
_isMergeAnchor:
|
|
2350
|
-
_mergedSpan:
|
|
2351
|
+
_isMergeAnchor: _e,
|
|
2352
|
+
_mergedSpan: B,
|
|
2351
2353
|
expandSelectionForMerges: O,
|
|
2352
|
-
getCellRaw:
|
|
2353
|
-
getCellValue:
|
|
2354
|
+
getCellRaw: ne,
|
|
2355
|
+
getCellValue: pe,
|
|
2354
2356
|
setCellValue: N,
|
|
2355
2357
|
clearCellsInRange: ve,
|
|
2356
|
-
startEdit:
|
|
2358
|
+
startEdit: Ke,
|
|
2357
2359
|
commitEdit: gt,
|
|
2358
2360
|
cancelEdit: Ct,
|
|
2359
|
-
moveActive:
|
|
2361
|
+
moveActive: tt,
|
|
2360
2362
|
ensureVisible: st,
|
|
2361
2363
|
hitCol: Bt,
|
|
2362
2364
|
hitRow: ol,
|
|
@@ -2366,12 +2368,12 @@ function pr(e, p) {
|
|
|
2366
2368
|
return Fe = () => {
|
|
2367
2369
|
var x;
|
|
2368
2370
|
return (x = rt.saveUndo) == null ? void 0 : x.call(rt);
|
|
2369
|
-
}, P = (x,
|
|
2370
|
-
var
|
|
2371
|
-
return (
|
|
2372
|
-
}, d = (x,
|
|
2373
|
-
var
|
|
2374
|
-
return (
|
|
2371
|
+
}, P = (x, R) => {
|
|
2372
|
+
var S;
|
|
2373
|
+
return (S = rt.syncCellBorders) == null ? void 0 : S.call(rt, x, R);
|
|
2374
|
+
}, d = (x, R) => {
|
|
2375
|
+
var S;
|
|
2376
|
+
return (S = rt.clampScroll) == null ? void 0 : S.call(rt, x, R);
|
|
2375
2377
|
}, rt;
|
|
2376
2378
|
}
|
|
2377
2379
|
function hr(e, p) {
|
|
@@ -2409,19 +2411,19 @@ function hr(e, p) {
|
|
|
2409
2411
|
e.saveUndo = z;
|
|
2410
2412
|
function v() {
|
|
2411
2413
|
var i;
|
|
2412
|
-
h.value.length && (o.value.push(k()), a(h.value.pop()), (i = e.scheduleRender) == null || i.call(e),
|
|
2414
|
+
h.value.length && (o.value.push(k()), a(h.value.pop()), (i = e.scheduleRender) == null || i.call(e), $e(() => {
|
|
2413
2415
|
var C;
|
|
2414
2416
|
return (C = e.emitModelData) == null ? void 0 : C.call(e);
|
|
2415
2417
|
}));
|
|
2416
2418
|
}
|
|
2417
|
-
function
|
|
2419
|
+
function le() {
|
|
2418
2420
|
var i;
|
|
2419
|
-
o.value.length && (h.value.push(k()), a(o.value.pop()), (i = e.scheduleRender) == null || i.call(e),
|
|
2421
|
+
o.value.length && (h.value.push(k()), a(o.value.pop()), (i = e.scheduleRender) == null || i.call(e), $e(() => {
|
|
2420
2422
|
var C;
|
|
2421
2423
|
return (C = e.emitModelData) == null ? void 0 : C.call(e);
|
|
2422
2424
|
}));
|
|
2423
2425
|
}
|
|
2424
|
-
const q =
|
|
2426
|
+
const q = se(() => h.value.length > 0), y = se(() => o.value.length > 0), ae = se(() => !!e.selection.value), L = V(null);
|
|
2425
2427
|
function f() {
|
|
2426
2428
|
var H;
|
|
2427
2429
|
const i = e.selection.value;
|
|
@@ -2429,114 +2431,120 @@ function hr(e, p) {
|
|
|
2429
2431
|
return;
|
|
2430
2432
|
const C = {};
|
|
2431
2433
|
for (let K = i.startCol; K <= i.endCol; K++)
|
|
2432
|
-
for (let
|
|
2433
|
-
C[`${K - i.startCol},${
|
|
2434
|
+
for (let J = i.startRow; J <= i.endRow; J++)
|
|
2435
|
+
C[`${K - i.startCol},${J - i.startRow}`] = ((H = e.cells[e.cellKey(K, J)]) == null ? void 0 : H.style) ?? null;
|
|
2434
2436
|
L.value = { styles: C };
|
|
2435
2437
|
}
|
|
2436
2438
|
function Ce() {
|
|
2437
|
-
var H, K,
|
|
2439
|
+
var H, K, J, te;
|
|
2438
2440
|
const i = L.value, C = e.selection.value;
|
|
2439
2441
|
if (!(!i || !C)) {
|
|
2440
2442
|
z();
|
|
2441
|
-
for (let
|
|
2442
|
-
for (let
|
|
2443
|
-
const
|
|
2444
|
-
if (
|
|
2443
|
+
for (let Q = C.startCol; Q <= C.endCol; Q++)
|
|
2444
|
+
for (let me = C.startRow; me <= C.endRow; me++) {
|
|
2445
|
+
const Te = e.findMerge(Q, me);
|
|
2446
|
+
if (Te && (Q !== Te.range.startCol || me !== Te.range.startRow))
|
|
2445
2447
|
continue;
|
|
2446
|
-
const
|
|
2447
|
-
|
|
2448
|
+
const Ze = i.styles[`${Q - C.startCol},${me - C.startRow}`] ?? null, Ue = e.cellKey(Q, me), et = ((H = e.cells[Ue]) == null ? void 0 : H.value) ?? "";
|
|
2449
|
+
et === "" && Ze === null ? e.delCell(Ue) : e.cells[Ue] = { value: et, style: Ze }, (K = e.syncCellBorders) == null || K.call(e, Q, me);
|
|
2448
2450
|
}
|
|
2449
|
-
L.value = null, (
|
|
2451
|
+
L.value = null, (J = e.scheduleRender) == null || J.call(e), (te = e.emitModelData) == null || te.call(e);
|
|
2450
2452
|
}
|
|
2451
2453
|
}
|
|
2452
|
-
function
|
|
2453
|
-
var C, H, K,
|
|
2454
|
+
function he() {
|
|
2455
|
+
var C, H, K, J;
|
|
2454
2456
|
const i = e.selection.value;
|
|
2455
2457
|
if (i) {
|
|
2456
2458
|
z();
|
|
2457
|
-
for (let
|
|
2458
|
-
for (let
|
|
2459
|
-
const
|
|
2460
|
-
if (
|
|
2459
|
+
for (let te = i.startCol; te <= i.endCol; te++)
|
|
2460
|
+
for (let Q = i.startRow; Q <= i.endRow; Q++) {
|
|
2461
|
+
const me = e.findMerge(te, Q);
|
|
2462
|
+
if (me && (te !== me.range.startCol || Q !== me.range.startRow))
|
|
2461
2463
|
continue;
|
|
2462
|
-
const
|
|
2463
|
-
|
|
2464
|
+
const Te = e.cellKey(te, Q), Ze = ((C = e.cells[Te]) == null ? void 0 : C.value) ?? "";
|
|
2465
|
+
Ze === "" ? e.delCell(Te) : e.cells[Te] = { value: Ze, style: null }, (H = e.syncCellBorders) == null || H.call(e, te, Q);
|
|
2464
2466
|
}
|
|
2465
|
-
(K = e.scheduleRender) == null || K.call(e), (
|
|
2467
|
+
(K = e.scheduleRender) == null || K.call(e), (J = e.emitModelData) == null || J.call(e);
|
|
2466
2468
|
}
|
|
2467
2469
|
}
|
|
2468
|
-
const De =
|
|
2470
|
+
const De = se(
|
|
2469
2471
|
() => Co.map((i) => ({ ...i, label: i.value === "" ? U(e.locale.value, "fontDefault") : i.label }))
|
|
2470
|
-
), Y =
|
|
2472
|
+
), Y = se(
|
|
2471
2473
|
() => yo.map((i) => ({ ...i, label: String(i.value) }))
|
|
2472
|
-
), X = "\0",
|
|
2474
|
+
), X = "\0", be = se(() => {
|
|
2473
2475
|
var K;
|
|
2474
2476
|
const i = e.selection.value;
|
|
2475
2477
|
if (!i)
|
|
2476
2478
|
return "";
|
|
2477
2479
|
let C, H = !1;
|
|
2478
|
-
for (let
|
|
2479
|
-
for (let
|
|
2480
|
-
const
|
|
2481
|
-
|
|
2480
|
+
for (let J = i.startCol; J <= i.endCol && !H; J++)
|
|
2481
|
+
for (let te = i.startRow; te <= i.endRow && !H; te++) {
|
|
2482
|
+
const Q = e.findMerge(J, te);
|
|
2483
|
+
if (Q && (J !== Q.range.startCol || te !== Q.range.startRow))
|
|
2484
|
+
continue;
|
|
2485
|
+
const me = (K = e.cells[e.cellKey(J, te)]) == null ? void 0 : K.style, Te = typeof (me == null ? void 0 : me.fontFamily) == "string" ? me.fontFamily : "";
|
|
2486
|
+
C === void 0 ? C = Te : Te !== C && (H = !0);
|
|
2482
2487
|
}
|
|
2483
2488
|
return H ? X : C ?? "";
|
|
2484
|
-
}),
|
|
2489
|
+
}), F = se(() => {
|
|
2485
2490
|
const i = e.selection.value;
|
|
2486
2491
|
if (!i)
|
|
2487
2492
|
return Mt;
|
|
2488
2493
|
let C, H = !1;
|
|
2489
2494
|
for (let K = i.startCol; K <= i.endCol && !H; K++)
|
|
2490
|
-
for (let
|
|
2491
|
-
const
|
|
2492
|
-
|
|
2495
|
+
for (let J = i.startRow; J <= i.endRow && !H; J++) {
|
|
2496
|
+
const te = e.findMerge(K, J);
|
|
2497
|
+
if (te && (K !== te.range.startCol || J !== te.range.startRow))
|
|
2498
|
+
continue;
|
|
2499
|
+
const Q = e.cellFontSize(K, J);
|
|
2500
|
+
C === void 0 ? C = Q : Q !== C && (H = !0);
|
|
2493
2501
|
}
|
|
2494
2502
|
return H ? 0 : C ?? Mt;
|
|
2495
2503
|
});
|
|
2496
2504
|
function j(i, C) {
|
|
2497
|
-
var K,
|
|
2505
|
+
var K, J, te, Q;
|
|
2498
2506
|
const H = e.selection.value;
|
|
2499
2507
|
if (H) {
|
|
2500
2508
|
z();
|
|
2501
|
-
for (let
|
|
2502
|
-
for (let
|
|
2503
|
-
const
|
|
2504
|
-
if (
|
|
2509
|
+
for (let me = H.startCol; me <= H.endCol; me++)
|
|
2510
|
+
for (let Te = H.startRow; Te <= H.endRow; Te++) {
|
|
2511
|
+
const Ze = e.findMerge(me, Te);
|
|
2512
|
+
if (Ze && (me !== Ze.range.startCol || Te !== Ze.range.startRow))
|
|
2505
2513
|
continue;
|
|
2506
|
-
const Ue = e.cellKey(
|
|
2514
|
+
const Ue = e.cellKey(me, Te), et = ((K = e.cells[Ue]) == null ? void 0 : K.value) ?? "", at = (J = e.cells[Ue]) != null && J.style ? { ...e.cells[Ue].style } : {};
|
|
2507
2515
|
C === "" || C === null || C === void 0 || C === 0 ? Reflect.deleteProperty(at, i) : at[i] = C;
|
|
2508
2516
|
const mt = Object.keys(at).length ? at : null;
|
|
2509
|
-
|
|
2517
|
+
et === "" && mt === null ? e.delCell(Ue) : e.cells[Ue] = { value: et, style: mt };
|
|
2510
2518
|
}
|
|
2511
|
-
(
|
|
2519
|
+
(te = e.scheduleRender) == null || te.call(e), (Q = e.emitModelData) == null || Q.call(e);
|
|
2512
2520
|
}
|
|
2513
2521
|
}
|
|
2514
2522
|
function Me(i) {
|
|
2515
2523
|
j("fontFamily", i === "" ? "" : i);
|
|
2516
2524
|
}
|
|
2517
|
-
const Be = V(!1),
|
|
2518
|
-
function
|
|
2525
|
+
const Be = V(!1), oe = V(!1), c = V(!1), m = V(!1), Ne = V(!1);
|
|
2526
|
+
function He(i) {
|
|
2519
2527
|
j("fontSize", i), Be.value = !1;
|
|
2520
2528
|
}
|
|
2521
|
-
const
|
|
2529
|
+
const de = se(
|
|
2522
2530
|
() => Bo.map((i) => ({ label: U(e.locale.value, i.labelKey), value: i.value, icon: i.icon }))
|
|
2523
|
-
), n =
|
|
2531
|
+
), n = se(
|
|
2524
2532
|
() => Do.map((i) => ({ label: U(e.locale.value, i.labelKey), value: i.value, icon: i.icon }))
|
|
2525
|
-
), d =
|
|
2533
|
+
), d = se(() => {
|
|
2526
2534
|
var K;
|
|
2527
2535
|
const i = e.selection.value;
|
|
2528
2536
|
if (!i)
|
|
2529
2537
|
return "left";
|
|
2530
2538
|
const C = (K = e.cells[e.cellKey(i.startCol, i.startRow)]) == null ? void 0 : K.style, H = typeof (C == null ? void 0 : C.textAlign) == "string" ? C.textAlign : "";
|
|
2531
2539
|
return H === "center" || H === "right" ? H : "left";
|
|
2532
|
-
}), w =
|
|
2540
|
+
}), w = se(() => {
|
|
2533
2541
|
var K;
|
|
2534
2542
|
const i = e.selection.value;
|
|
2535
2543
|
if (!i)
|
|
2536
2544
|
return "top";
|
|
2537
2545
|
const C = (K = e.cells[e.cellKey(i.startCol, i.startRow)]) == null ? void 0 : K.style, H = typeof (C == null ? void 0 : C.verticalAlign) == "string" ? C.verticalAlign : "";
|
|
2538
2546
|
return H === "middle" || H === "bottom" ? H : "top";
|
|
2539
|
-
}), l =
|
|
2547
|
+
}), l = se(() => {
|
|
2540
2548
|
var H;
|
|
2541
2549
|
const i = e.selection.value;
|
|
2542
2550
|
if (!i)
|
|
@@ -2550,59 +2558,62 @@ function hr(e, p) {
|
|
|
2550
2558
|
function I(i) {
|
|
2551
2559
|
j("verticalAlign", i);
|
|
2552
2560
|
}
|
|
2553
|
-
function
|
|
2561
|
+
function E() {
|
|
2554
2562
|
if (!e.selection.value)
|
|
2555
2563
|
return;
|
|
2556
2564
|
const C = l.value;
|
|
2557
2565
|
j("wrap", C ? void 0 : "wrap");
|
|
2558
2566
|
}
|
|
2559
|
-
const $ = V(""),
|
|
2560
|
-
ut(
|
|
2567
|
+
const $ = V(""), ce = Be;
|
|
2568
|
+
ut(F, (i) => {
|
|
2561
2569
|
$.value = i === 0 ? "" : String(i);
|
|
2562
2570
|
}, { immediate: !0 });
|
|
2563
2571
|
function we(i) {
|
|
2564
2572
|
const C = i.replace(/[^\d]/g, "");
|
|
2565
2573
|
$.value = C;
|
|
2566
2574
|
const H = parseInt(C, 10);
|
|
2567
|
-
!isNaN(H) && H >= 5 && H <= 72 && H !==
|
|
2575
|
+
!isNaN(H) && H >= 5 && H <= 72 && H !== F.value && j("fontSize", H);
|
|
2568
2576
|
}
|
|
2569
|
-
function
|
|
2577
|
+
function Oe() {
|
|
2570
2578
|
const i = $.value.trim();
|
|
2571
2579
|
if (!i) {
|
|
2572
|
-
$.value =
|
|
2580
|
+
$.value = F.value === 0 ? "" : String(F.value);
|
|
2573
2581
|
return;
|
|
2574
2582
|
}
|
|
2575
2583
|
let C = parseInt(i, 10);
|
|
2576
|
-
isNaN(C) ? C =
|
|
2584
|
+
isNaN(C) ? C = F.value === 0 ? Mt : F.value : C = Math.max(5, Math.min(72, C)), $.value = String(C), C !== F.value && j("fontSize", C);
|
|
2577
2585
|
}
|
|
2578
|
-
function
|
|
2586
|
+
function Ve(i) {
|
|
2579
2587
|
i.key === "Enter" && i.target.blur();
|
|
2580
2588
|
}
|
|
2581
2589
|
function Xe(i) {
|
|
2582
|
-
i && i.preventDefault(),
|
|
2590
|
+
i && i.preventDefault(), ce.value = !ce.value, ce.value && (c && (c.value = !1), oe && (oe.value = !1), m.value = !1, Ne.value = !1);
|
|
2583
2591
|
}
|
|
2584
2592
|
function ye() {
|
|
2585
|
-
const i =
|
|
2586
|
-
j("fontSize", C), $.value = String(C),
|
|
2593
|
+
const i = F.value === 0 ? Mt : F.value, C = Math.min(72, i + 1);
|
|
2594
|
+
j("fontSize", C), $.value = String(C), ce.value = !1;
|
|
2587
2595
|
}
|
|
2588
|
-
function
|
|
2589
|
-
const i =
|
|
2590
|
-
j("fontSize", C), $.value = String(C),
|
|
2596
|
+
function _e() {
|
|
2597
|
+
const i = F.value === 0 ? Mt : F.value, C = Math.max(5, i - 1);
|
|
2598
|
+
j("fontSize", C), $.value = String(C), ce.value = !1;
|
|
2591
2599
|
}
|
|
2592
|
-
function
|
|
2593
|
-
var
|
|
2600
|
+
function B(i) {
|
|
2601
|
+
var J;
|
|
2594
2602
|
const C = e.selection.value;
|
|
2595
2603
|
if (!C)
|
|
2596
2604
|
return !1;
|
|
2597
2605
|
let H, K = !1;
|
|
2598
|
-
for (let
|
|
2599
|
-
for (let
|
|
2600
|
-
const
|
|
2601
|
-
|
|
2606
|
+
for (let te = C.startCol; te <= C.endCol && !K; te++)
|
|
2607
|
+
for (let Q = C.startRow; Q <= C.endRow && !K; Q++) {
|
|
2608
|
+
const me = e.findMerge(te, Q);
|
|
2609
|
+
if (me && (te !== me.range.startCol || Q !== me.range.startRow))
|
|
2610
|
+
continue;
|
|
2611
|
+
const Te = (J = e.cells[e.cellKey(te, Q)]) == null ? void 0 : J.style, Ze = !!(Te != null && Te[i]);
|
|
2612
|
+
H === void 0 ? H = Ze : Ze !== H && (K = !0);
|
|
2602
2613
|
}
|
|
2603
2614
|
return !K && H === !0;
|
|
2604
2615
|
}
|
|
2605
|
-
const O =
|
|
2616
|
+
const O = se(() => B("fontWeight")), P = se(() => B("fontStyle")), ne = se(() => B("underline")), pe = se(() => B("strikethrough"));
|
|
2606
2617
|
function N() {
|
|
2607
2618
|
j("fontWeight", O.value ? "" : "bold");
|
|
2608
2619
|
}
|
|
@@ -2610,55 +2621,61 @@ function hr(e, p) {
|
|
|
2610
2621
|
j("fontStyle", P.value ? "" : "italic");
|
|
2611
2622
|
}
|
|
2612
2623
|
function Fe() {
|
|
2613
|
-
j("underline",
|
|
2624
|
+
j("underline", ne.value ? "" : "underline");
|
|
2614
2625
|
}
|
|
2615
|
-
function
|
|
2616
|
-
j("strikethrough",
|
|
2626
|
+
function Ke() {
|
|
2627
|
+
j("strikethrough", pe.value ? "" : "line-through");
|
|
2617
2628
|
}
|
|
2618
|
-
const gt = V(""), Ct = V(""),
|
|
2629
|
+
const gt = V(""), Ct = V(""), tt = m, st = Ne;
|
|
2619
2630
|
function Bt() {
|
|
2620
|
-
|
|
2631
|
+
tt.value = !tt.value, st.value = !1, oe && (oe.value = !1), c && (c.value = !1);
|
|
2621
2632
|
}
|
|
2622
2633
|
function ol() {
|
|
2623
|
-
st.value = !st.value,
|
|
2634
|
+
st.value = !st.value, tt.value = !1, oe && (oe.value = !1), c && (c.value = !1);
|
|
2624
2635
|
}
|
|
2625
2636
|
function rt(i) {
|
|
2626
|
-
|
|
2637
|
+
oe && (oe.value = i), i && (tt.value = !1, st.value = !1, c && (c.value = !1));
|
|
2627
2638
|
}
|
|
2628
2639
|
function x(i) {
|
|
2629
2640
|
gt.value = i, j("color", i === "" ? "" : i);
|
|
2630
2641
|
}
|
|
2631
|
-
function
|
|
2642
|
+
function R(i) {
|
|
2632
2643
|
Ct.value = i, j("backgroundColor", i === "" ? "" : i);
|
|
2633
2644
|
}
|
|
2634
|
-
function
|
|
2645
|
+
function S() {
|
|
2635
2646
|
j("color", gt.value === "" ? "" : gt.value);
|
|
2636
2647
|
}
|
|
2637
2648
|
function G() {
|
|
2638
2649
|
j("backgroundColor", Ct.value === "" ? "" : Ct.value);
|
|
2639
2650
|
}
|
|
2640
|
-
const Z =
|
|
2651
|
+
const Z = se(() => {
|
|
2641
2652
|
var K;
|
|
2642
2653
|
const i = e.selection.value;
|
|
2643
2654
|
if (!i)
|
|
2644
2655
|
return "";
|
|
2645
2656
|
let C, H = !1;
|
|
2646
|
-
for (let
|
|
2647
|
-
for (let
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2657
|
+
for (let J = i.startCol; J <= i.endCol && !H; J++)
|
|
2658
|
+
for (let te = i.startRow; te <= i.endRow && !H; te++) {
|
|
2659
|
+
const Q = e.findMerge(J, te);
|
|
2660
|
+
if (Q && (J !== Q.range.startCol || te !== Q.range.startRow))
|
|
2661
|
+
continue;
|
|
2662
|
+
const me = (K = e.cells[e.cellKey(J, te)]) == null ? void 0 : K.style, Te = typeof (me == null ? void 0 : me.color) == "string" ? me.color : "";
|
|
2663
|
+
C === void 0 ? C = Te : Te !== C && (H = !0);
|
|
2650
2664
|
}
|
|
2651
2665
|
return H ? "" : C ?? "";
|
|
2652
|
-
}),
|
|
2666
|
+
}), ie = se(() => {
|
|
2653
2667
|
var K;
|
|
2654
2668
|
const i = e.selection.value;
|
|
2655
2669
|
if (!i)
|
|
2656
2670
|
return "";
|
|
2657
2671
|
let C, H = !1;
|
|
2658
|
-
for (let
|
|
2659
|
-
for (let
|
|
2660
|
-
const
|
|
2661
|
-
|
|
2672
|
+
for (let J = i.startCol; J <= i.endCol && !H; J++)
|
|
2673
|
+
for (let te = i.startRow; te <= i.endRow && !H; te++) {
|
|
2674
|
+
const Q = e.findMerge(J, te);
|
|
2675
|
+
if (Q && (J !== Q.range.startCol || te !== Q.range.startRow))
|
|
2676
|
+
continue;
|
|
2677
|
+
const me = (K = e.cells[e.cellKey(J, te)]) == null ? void 0 : K.style, Te = typeof (me == null ? void 0 : me.backgroundColor) == "string" ? me.backgroundColor : "";
|
|
2678
|
+
C === void 0 ? C = Te : Te !== C && (H = !0);
|
|
2662
2679
|
}
|
|
2663
2680
|
return H ? "" : C ?? "";
|
|
2664
2681
|
});
|
|
@@ -2670,59 +2687,59 @@ function hr(e, p) {
|
|
|
2670
2687
|
restoreSnap: a,
|
|
2671
2688
|
saveUndo: z,
|
|
2672
2689
|
undo: v,
|
|
2673
|
-
redo:
|
|
2690
|
+
redo: le,
|
|
2674
2691
|
canUndo: q,
|
|
2675
2692
|
canRedo: y,
|
|
2676
|
-
hasSelection:
|
|
2693
|
+
hasSelection: ae,
|
|
2677
2694
|
paintFmt: L,
|
|
2678
2695
|
onPaintFormat: f,
|
|
2679
2696
|
applyPaintFormat: Ce,
|
|
2680
|
-
clearFormat:
|
|
2697
|
+
clearFormat: he,
|
|
2681
2698
|
fontFamilyOptions: De,
|
|
2682
2699
|
fontSizeOptions: Y,
|
|
2683
2700
|
FONT_FAMILY_MIXED: X,
|
|
2684
|
-
selFontFamily:
|
|
2685
|
-
selFontSize:
|
|
2701
|
+
selFontFamily: be,
|
|
2702
|
+
selFontSize: F,
|
|
2686
2703
|
applyStyleToSelection: j,
|
|
2687
2704
|
onFontFamilyChange: Me,
|
|
2688
|
-
onFontSizeChange:
|
|
2689
|
-
hAlignOptions:
|
|
2705
|
+
onFontSizeChange: He,
|
|
2706
|
+
hAlignOptions: de,
|
|
2690
2707
|
vAlignOptions: n,
|
|
2691
2708
|
selHAlign: d,
|
|
2692
2709
|
selVAlign: w,
|
|
2693
2710
|
selWrap: l,
|
|
2694
2711
|
onHAlignChange: r,
|
|
2695
2712
|
onVAlignChange: I,
|
|
2696
|
-
onWrapToggle:
|
|
2713
|
+
onWrapToggle: E,
|
|
2697
2714
|
fontSizeInput: $,
|
|
2698
|
-
fontSizeMenuOpen:
|
|
2715
|
+
fontSizeMenuOpen: ce,
|
|
2699
2716
|
onFontSizeInput: we,
|
|
2700
|
-
onFontSizeBlur:
|
|
2701
|
-
onFontSizeKeydown:
|
|
2717
|
+
onFontSizeBlur: Oe,
|
|
2718
|
+
onFontSizeKeydown: Ve,
|
|
2702
2719
|
toggleFontSizeMenu: Xe,
|
|
2703
2720
|
onFontSizeStepUp: ye,
|
|
2704
|
-
onFontSizeStepDown:
|
|
2721
|
+
onFontSizeStepDown: _e,
|
|
2705
2722
|
selFontWeight: O,
|
|
2706
2723
|
selFontStyle: P,
|
|
2707
|
-
selUnderline:
|
|
2708
|
-
selStrikethrough:
|
|
2724
|
+
selUnderline: ne,
|
|
2725
|
+
selStrikethrough: pe,
|
|
2709
2726
|
toggleFontWeight: N,
|
|
2710
2727
|
toggleFontStyle: ve,
|
|
2711
2728
|
toggleUnderline: Fe,
|
|
2712
|
-
toggleStrikethrough:
|
|
2729
|
+
toggleStrikethrough: Ke,
|
|
2713
2730
|
cachedTextColor: gt,
|
|
2714
2731
|
cachedFillColor: Ct,
|
|
2715
|
-
textColorMenuOpen:
|
|
2732
|
+
textColorMenuOpen: tt,
|
|
2716
2733
|
fillColorMenuOpen: st,
|
|
2717
2734
|
_toggleTextColorMenu: Bt,
|
|
2718
2735
|
_toggleFillColorMenu: ol,
|
|
2719
2736
|
onBorderMenuToggle: rt,
|
|
2720
2737
|
onTextColorChange: x,
|
|
2721
|
-
onFillColorChange:
|
|
2722
|
-
applyCachedTextColor:
|
|
2738
|
+
onFillColorChange: R,
|
|
2739
|
+
applyCachedTextColor: S,
|
|
2723
2740
|
applyCachedFillColor: G,
|
|
2724
2741
|
selTextColor: Z,
|
|
2725
|
-
selFillColor:
|
|
2742
|
+
selFillColor: ie
|
|
2726
2743
|
};
|
|
2727
2744
|
}
|
|
2728
2745
|
function br(e, p) {
|
|
@@ -2742,18 +2759,18 @@ function br(e, p) {
|
|
|
2742
2759
|
function Cr(e, p) {
|
|
2743
2760
|
const h = V("none"), o = V(!1), s = "#444";
|
|
2744
2761
|
function k(n, d, w, l) {
|
|
2745
|
-
const r = e.findMerge(d, w), I = r ? r.range.endCol : d,
|
|
2762
|
+
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 };
|
|
2746
2763
|
switch (n) {
|
|
2747
2764
|
case "none":
|
|
2748
2765
|
return ye;
|
|
2749
2766
|
case "bottom":
|
|
2750
|
-
|
|
2767
|
+
Oe && (ye.bottom = 1);
|
|
2751
2768
|
break;
|
|
2752
2769
|
case "top":
|
|
2753
2770
|
we && (ye.top = 1);
|
|
2754
2771
|
break;
|
|
2755
2772
|
case "left":
|
|
2756
|
-
|
|
2773
|
+
Ve && (ye.left = 1);
|
|
2757
2774
|
break;
|
|
2758
2775
|
case "right":
|
|
2759
2776
|
Xe && (ye.right = 1);
|
|
@@ -2762,44 +2779,44 @@ function Cr(e, p) {
|
|
|
2762
2779
|
ye.top = 1, ye.bottom = 1, ye.left = 1, ye.right = 1;
|
|
2763
2780
|
break;
|
|
2764
2781
|
case "outer":
|
|
2765
|
-
we && (ye.top = 1),
|
|
2782
|
+
we && (ye.top = 1), Oe && (ye.bottom = 1), Ve && (ye.left = 1), Xe && (ye.right = 1);
|
|
2766
2783
|
break;
|
|
2767
2784
|
case "thickOuter":
|
|
2768
|
-
we && (ye.top = 2),
|
|
2785
|
+
we && (ye.top = 2), Oe && (ye.bottom = 2), Ve && (ye.left = 2), Xe && (ye.right = 2);
|
|
2769
2786
|
break;
|
|
2770
2787
|
}
|
|
2771
2788
|
return ye;
|
|
2772
2789
|
}
|
|
2773
2790
|
function a(n, d, w, l, r) {
|
|
2774
|
-
var ye,
|
|
2791
|
+
var ye, _e;
|
|
2775
2792
|
if (n < 0 || d < 0 || n >= e.colCount || d >= e.rowCount)
|
|
2776
2793
|
return;
|
|
2777
2794
|
const I = e.findMerge(n, d);
|
|
2778
2795
|
if (I && (w === "Top" && d !== I.range.startRow || w === "Bottom" && d !== I.range.endRow || w === "Left" && n !== I.range.startCol || w === "Right" && n !== I.range.endCol))
|
|
2779
2796
|
return;
|
|
2780
|
-
const
|
|
2781
|
-
l === 0 ? r && Reflect.deleteProperty(
|
|
2782
|
-
const Xe = Object.keys(
|
|
2783
|
-
$ === "" && Xe === null ? e.delCell(
|
|
2797
|
+
const E = I ? I.anchor : e.cellKey(n, d), $ = ((ye = e.cells[E]) == null ? void 0 : ye.value) ?? "", ce = (_e = e.cells[E]) != null && _e.style ? { ...e.cells[E].style } : {}, we = `border${w}Width`;
|
|
2798
|
+
l === 0 ? r && Reflect.deleteProperty(ce, we) : (ce[we] = l, ce.borderColor = s), ["Top", "Bottom", "Left", "Right"].some((B) => ce[`border${B}Width`] !== void 0) || Reflect.deleteProperty(ce, "borderColor");
|
|
2799
|
+
const Xe = Object.keys(ce).length ? ce : null;
|
|
2800
|
+
$ === "" && Xe === null ? e.delCell(E) : e.cells[E] = { value: $, style: Xe };
|
|
2784
2801
|
}
|
|
2785
2802
|
function z(n, d) {
|
|
2786
2803
|
var we;
|
|
2787
|
-
const w = e.findMerge(n, d), l = w ? w.anchor : e.cellKey(n, d), r = (we = e.cells[l]) == null ? void 0 : we.style, I = (r == null ? void 0 : r.borderTopWidth) || 0,
|
|
2788
|
-
a(n, d - 1, "Bottom", I, !0), a(n, d + 1, "Top",
|
|
2804
|
+
const w = e.findMerge(n, d), l = w ? w.anchor : e.cellKey(n, d), r = (we = e.cells[l]) == null ? void 0 : we.style, I = (r == null ? void 0 : r.borderTopWidth) || 0, E = (r == null ? void 0 : r.borderBottomWidth) || 0, $ = (r == null ? void 0 : r.borderLeftWidth) || 0, ce = (r == null ? void 0 : r.borderRightWidth) || 0;
|
|
2805
|
+
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);
|
|
2789
2806
|
}
|
|
2790
2807
|
e.syncCellBorders = z;
|
|
2791
2808
|
function v(n, d, w, l = !0) {
|
|
2792
|
-
var
|
|
2793
|
-
const r = e.cellKey(n, d), I = ((
|
|
2809
|
+
var Ve, Xe;
|
|
2810
|
+
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];
|
|
2794
2811
|
for (let ye = 0; ye < 4; ye++) {
|
|
2795
|
-
const
|
|
2796
|
-
|
|
2812
|
+
const _e = `border${$[ye]}Width`;
|
|
2813
|
+
ce[ye] === 0 ? l && Reflect.deleteProperty(E, _e) : (E[_e] = ce[ye], E.borderColor = s);
|
|
2797
2814
|
}
|
|
2798
|
-
$.some((ye) =>
|
|
2799
|
-
const
|
|
2800
|
-
I === "" &&
|
|
2815
|
+
$.some((ye) => E[`border${ye}Width`] !== void 0) || Reflect.deleteProperty(E, "borderColor");
|
|
2816
|
+
const Oe = Object.keys(E).length ? E : null;
|
|
2817
|
+
I === "" && Oe === null ? e.delCell(r) : e.cells[r] = { value: I, style: Oe }, z(n, d);
|
|
2801
2818
|
}
|
|
2802
|
-
function
|
|
2819
|
+
function le(n) {
|
|
2803
2820
|
var w, l;
|
|
2804
2821
|
h.value = n;
|
|
2805
2822
|
const d = e.selection.value;
|
|
@@ -2807,14 +2824,14 @@ function Cr(e, p) {
|
|
|
2807
2824
|
if (p.saveUndo(), n === "none")
|
|
2808
2825
|
for (let r = d.startCol; r <= d.endCol; r++)
|
|
2809
2826
|
for (let I = d.startRow; I <= d.endRow; I++) {
|
|
2810
|
-
const
|
|
2811
|
-
|
|
2827
|
+
const E = e.findMerge(r, I);
|
|
2828
|
+
E && (r !== E.range.startCol || I !== E.range.startRow) || v(r, I, { top: 0, bottom: 0, left: 0, right: 0 }, !0);
|
|
2812
2829
|
}
|
|
2813
2830
|
else
|
|
2814
2831
|
for (let r = d.startCol; r <= d.endCol; r++)
|
|
2815
2832
|
for (let I = d.startRow; I <= d.endRow; I++) {
|
|
2816
|
-
const
|
|
2817
|
-
if (
|
|
2833
|
+
const E = e.findMerge(r, I);
|
|
2834
|
+
if (E && (r !== E.range.startCol || I !== E.range.startRow))
|
|
2818
2835
|
continue;
|
|
2819
2836
|
const $ = k(n, r, I, d);
|
|
2820
2837
|
v(r, I, $, !1);
|
|
@@ -2823,45 +2840,45 @@ function Cr(e, p) {
|
|
|
2823
2840
|
}
|
|
2824
2841
|
}
|
|
2825
2842
|
function q() {
|
|
2826
|
-
|
|
2843
|
+
le(h.value);
|
|
2827
2844
|
}
|
|
2828
2845
|
function y(n, d, w) {
|
|
2829
|
-
var I,
|
|
2846
|
+
var I, E;
|
|
2830
2847
|
const l = e.findMerge(n, d);
|
|
2831
2848
|
if (l) {
|
|
2832
2849
|
const $ = (I = e.cells[l.anchor]) == null ? void 0 : I.style;
|
|
2833
2850
|
return w === "Top" && d === l.range.startRow ? ($ == null ? void 0 : $.borderTopWidth) || 0 : w === "Bottom" && d === l.range.endRow ? ($ == null ? void 0 : $.borderBottomWidth) || 0 : w === "Left" && n === l.range.startCol ? ($ == null ? void 0 : $.borderLeftWidth) || 0 : w === "Right" && n === l.range.endCol && ($ == null ? void 0 : $.borderRightWidth) || 0;
|
|
2834
2851
|
}
|
|
2835
|
-
const r = (
|
|
2852
|
+
const r = (E = e.cells[e.cellKey(n, d)]) == null ? void 0 : E.style;
|
|
2836
2853
|
return (r == null ? void 0 : r[`border${w}Width`]) || 0;
|
|
2837
2854
|
}
|
|
2838
|
-
const
|
|
2855
|
+
const ae = V(!1);
|
|
2839
2856
|
function L(n) {
|
|
2840
|
-
|
|
2857
|
+
ae.value = n, n && (p.textColorMenuOpen.value = !1, p.fillColorMenuOpen.value = !1, o.value = !1, p.fontSizeMenuOpen.value = !1);
|
|
2841
2858
|
}
|
|
2842
2859
|
function f(n, d, w, l) {
|
|
2843
2860
|
const r = [];
|
|
2844
2861
|
for (const I in e.merges) {
|
|
2845
|
-
const
|
|
2846
|
-
|
|
2862
|
+
const E = e.merges[I];
|
|
2863
|
+
E && E.startCol <= w && E.endCol >= n && E.startRow <= l && E.endRow >= d && r.push(I);
|
|
2847
2864
|
}
|
|
2848
2865
|
for (const I of r)
|
|
2849
2866
|
Reflect.deleteProperty(e.merges, I);
|
|
2850
2867
|
}
|
|
2851
2868
|
function Ce() {
|
|
2852
|
-
var r, I,
|
|
2869
|
+
var r, I, E, $;
|
|
2853
2870
|
const n = e.selection.value;
|
|
2854
2871
|
if (!n || n.startCol === n.endCol && n.startRow === n.endRow)
|
|
2855
2872
|
return;
|
|
2856
2873
|
p.saveUndo(), f(n.startCol, n.startRow, n.endCol, n.endRow);
|
|
2857
2874
|
const d = e.cellKey(n.startCol, n.startRow), w = ((r = e.cells[d]) == null ? void 0 : r.value) ?? "";
|
|
2858
|
-
for (let
|
|
2875
|
+
for (let ce = n.startCol; ce <= n.endCol; ce++)
|
|
2859
2876
|
for (let we = n.startRow; we <= n.endRow; we++)
|
|
2860
|
-
|
|
2877
|
+
ce === n.startCol && we === n.startRow || e.clearCellsInRange(ce, ce, we, we);
|
|
2861
2878
|
const l = (I = e.cells[d]) != null && I.style ? { ...e.cells[d].style } : {};
|
|
2862
|
-
l.textAlign = "center", e.cells[d] = { value: w, style: l }, e.merges[d] = { startCol: n.startCol, startRow: n.startRow, endCol: n.endCol, endRow: n.endRow }, e.selectCell(n.startCol, n.startRow), (
|
|
2879
|
+
l.textAlign = "center", e.cells[d] = { value: w, style: l }, e.merges[d] = { startCol: n.startCol, startRow: n.startRow, endCol: n.endCol, endRow: n.endRow }, e.selectCell(n.startCol, n.startRow), (E = e.scheduleRender) == null || E.call(e), ($ = e.emitModelData) == null || $.call(e);
|
|
2863
2880
|
}
|
|
2864
|
-
function
|
|
2881
|
+
function he() {
|
|
2865
2882
|
var d, w, l;
|
|
2866
2883
|
const n = e.selection.value;
|
|
2867
2884
|
if (!(!n || n.startCol === n.endCol)) {
|
|
@@ -2870,8 +2887,8 @@ function Cr(e, p) {
|
|
|
2870
2887
|
f(n.startCol, r, n.endCol, r);
|
|
2871
2888
|
const I = e.cellKey(n.startCol, r);
|
|
2872
2889
|
(d = e.cells[I]) == null || d.value;
|
|
2873
|
-
for (let
|
|
2874
|
-
e.clearCellsInRange(
|
|
2890
|
+
for (let E = n.startCol + 1; E <= n.endCol; E++)
|
|
2891
|
+
e.clearCellsInRange(E, E, r, r);
|
|
2875
2892
|
e.merges[I] = { startCol: n.startCol, startRow: r, endCol: n.endCol, endRow: r };
|
|
2876
2893
|
}
|
|
2877
2894
|
e.selectRange(n.startCol, n.startRow, n.endCol, n.endRow), (w = e.scheduleRender) == null || w.call(e), (l = e.emitModelData) == null || l.call(e);
|
|
@@ -2886,8 +2903,8 @@ function Cr(e, p) {
|
|
|
2886
2903
|
const d = e.cellKey(n.startCol, n.startRow);
|
|
2887
2904
|
(w = e.cells[d]) == null || w.value;
|
|
2888
2905
|
for (let I = n.startCol; I <= n.endCol; I++)
|
|
2889
|
-
for (let
|
|
2890
|
-
I === n.startCol &&
|
|
2906
|
+
for (let E = n.startRow; E <= n.endRow; E++)
|
|
2907
|
+
I === n.startCol && E === n.startRow || e.clearCellsInRange(I, I, E, E);
|
|
2891
2908
|
e.merges[d] = { startCol: n.startCol, startRow: n.startRow, endCol: n.endCol, endRow: n.endRow }, e.selectCell(n.startCol, n.startRow), (l = e.scheduleRender) == null || l.call(e), (r = e.emitModelData) == null || r.call(e);
|
|
2892
2909
|
}
|
|
2893
2910
|
function Y() {
|
|
@@ -2902,13 +2919,13 @@ function Cr(e, p) {
|
|
|
2902
2919
|
const d = e.findMerge(n.startCol, n.startRow);
|
|
2903
2920
|
d && n.startCol === d.range.startCol && n.startRow === d.range.startRow && n.endCol === d.range.endCol && n.endRow === d.range.endRow ? Y() : Ce();
|
|
2904
2921
|
}
|
|
2905
|
-
function
|
|
2922
|
+
function be(n) {
|
|
2906
2923
|
switch (n) {
|
|
2907
2924
|
case "mergeCenter":
|
|
2908
2925
|
Ce();
|
|
2909
2926
|
break;
|
|
2910
2927
|
case "mergeAcross":
|
|
2911
|
-
|
|
2928
|
+
he();
|
|
2912
2929
|
break;
|
|
2913
2930
|
case "mergeCells":
|
|
2914
2931
|
De();
|
|
@@ -2918,17 +2935,17 @@ function Cr(e, p) {
|
|
|
2918
2935
|
break;
|
|
2919
2936
|
}
|
|
2920
2937
|
}
|
|
2921
|
-
let
|
|
2938
|
+
let F = null, j = [];
|
|
2922
2939
|
function Me(n, d, w, l) {
|
|
2923
2940
|
var r;
|
|
2924
2941
|
j = [];
|
|
2925
2942
|
for (let I = w; I <= l; I++) {
|
|
2926
|
-
const
|
|
2943
|
+
const E = [];
|
|
2927
2944
|
for (let $ = n; $ <= d; $++) {
|
|
2928
|
-
const
|
|
2929
|
-
|
|
2945
|
+
const ce = (r = e.cells[e.cellKey($, I)]) == null ? void 0 : r.style;
|
|
2946
|
+
E.push(ce ? { ...ce } : null);
|
|
2930
2947
|
}
|
|
2931
|
-
j.push(
|
|
2948
|
+
j.push(E);
|
|
2932
2949
|
}
|
|
2933
2950
|
}
|
|
2934
2951
|
function Be(n, d, w, l) {
|
|
@@ -2939,11 +2956,11 @@ function Cr(e, p) {
|
|
|
2939
2956
|
}
|
|
2940
2957
|
e.cells[r] = { value: w, style: l ? { ...l } : null }, w.startsWith("=") ? e.formulaDeps.set(r, $l(w.slice(1), e.colCount, e.rowCount)) : e.formulaDeps.clear(r), e.formulaDeps.markDirty(r);
|
|
2941
2958
|
}
|
|
2942
|
-
function
|
|
2959
|
+
function oe() {
|
|
2943
2960
|
const n = e.selection.value;
|
|
2944
2961
|
if (!n)
|
|
2945
2962
|
return;
|
|
2946
|
-
|
|
2963
|
+
F = { ...n }, Me(n.startCol, n.endCol, n.startRow, n.endRow);
|
|
2947
2964
|
const d = [];
|
|
2948
2965
|
for (let w = n.startRow; w <= n.endRow; w++) {
|
|
2949
2966
|
const l = [];
|
|
@@ -2958,7 +2975,7 @@ function Cr(e, p) {
|
|
|
2958
2975
|
const n = e.selection.value;
|
|
2959
2976
|
if (n) {
|
|
2960
2977
|
if (n.startCol === 0 && n.endCol === e.colCount - 1) {
|
|
2961
|
-
|
|
2978
|
+
F = { ...n }, Me(0, e.colCount - 1, n.startRow, n.endRow);
|
|
2962
2979
|
const d = [];
|
|
2963
2980
|
for (let w = n.startRow; w <= n.endRow; w++) {
|
|
2964
2981
|
const l = [];
|
|
@@ -2969,7 +2986,7 @@ function Cr(e, p) {
|
|
|
2969
2986
|
zl(d.join(`
|
|
2970
2987
|
`));
|
|
2971
2988
|
} else if (n.startRow === 0 && n.endRow === e.rowCount - 1) {
|
|
2972
|
-
|
|
2989
|
+
F = { ...n }, Me(n.startCol, n.endCol, 0, e.rowCount - 1);
|
|
2973
2990
|
const d = [];
|
|
2974
2991
|
for (let w = 0; w < e.rowCount; w++) {
|
|
2975
2992
|
const l = [];
|
|
@@ -2992,45 +3009,45 @@ function Cr(e, p) {
|
|
|
2992
3009
|
}
|
|
2993
3010
|
if (!n && n !== "")
|
|
2994
3011
|
return;
|
|
2995
|
-
const d = n.split(/\r?\n/), w = e.activeCell.value, l =
|
|
2996
|
-
for (let
|
|
2997
|
-
const $ = d[
|
|
2998
|
-
for (let
|
|
2999
|
-
const we = w.col +
|
|
3000
|
-
if (we < e.colCount &&
|
|
3001
|
-
let
|
|
3002
|
-
if (
|
|
3003
|
-
|
|
3004
|
-
we - (l.startCol +
|
|
3005
|
-
|
|
3012
|
+
const d = n.split(/\r?\n/), w = e.activeCell.value, l = F, r = l && j.length > 0;
|
|
3013
|
+
for (let E = 0; E < d.length; E++) {
|
|
3014
|
+
const $ = d[E].split(" ");
|
|
3015
|
+
for (let ce = 0; ce < $.length; ce++) {
|
|
3016
|
+
const we = w.col + ce, Oe = w.row + E;
|
|
3017
|
+
if (we < e.colCount && Oe < e.rowCount) {
|
|
3018
|
+
let Ve = $[ce];
|
|
3019
|
+
if (Ve.startsWith("=") && l && (Ve = gr(
|
|
3020
|
+
Ve,
|
|
3021
|
+
we - (l.startCol + ce),
|
|
3022
|
+
Oe - (l.startRow + E),
|
|
3006
3023
|
e.colCount,
|
|
3007
3024
|
e.rowCount,
|
|
3008
3025
|
ht
|
|
3009
|
-
)), r &&
|
|
3010
|
-
const Xe = j[
|
|
3011
|
-
Be(we,
|
|
3026
|
+
)), r && E < j.length && ce < (((I = j[E]) == null ? void 0 : I.length) ?? 0)) {
|
|
3027
|
+
const Xe = j[E][ce] ?? null;
|
|
3028
|
+
Be(we, Oe, Ve, Xe), z(we, Oe);
|
|
3012
3029
|
} else
|
|
3013
|
-
e.setCellValue(we,
|
|
3030
|
+
e.setCellValue(we, Oe, Ve);
|
|
3014
3031
|
}
|
|
3015
3032
|
}
|
|
3016
3033
|
}
|
|
3017
3034
|
}
|
|
3018
|
-
function
|
|
3035
|
+
function Ne() {
|
|
3019
3036
|
var n;
|
|
3020
|
-
if (
|
|
3037
|
+
if (oe(), e.selection.value) {
|
|
3021
3038
|
const d = e.selection.value;
|
|
3022
3039
|
e.clearCellsInRange(d.startCol, d.endCol, d.startRow, d.endRow), (n = e.scheduleRender) == null || n.call(e);
|
|
3023
3040
|
}
|
|
3024
3041
|
}
|
|
3025
|
-
function
|
|
3042
|
+
function He() {
|
|
3026
3043
|
var n;
|
|
3027
3044
|
if (e.selection.value) {
|
|
3028
3045
|
const d = e.selection.value;
|
|
3029
3046
|
e.clearCellsInRange(d.startCol, d.endCol, d.startRow, d.endRow), (n = e.scheduleRender) == null || n.call(e);
|
|
3030
3047
|
}
|
|
3031
3048
|
}
|
|
3032
|
-
function
|
|
3033
|
-
var I,
|
|
3049
|
+
function de() {
|
|
3050
|
+
var I, E;
|
|
3034
3051
|
const n = e.selection.value;
|
|
3035
3052
|
if (!n)
|
|
3036
3053
|
return;
|
|
@@ -3047,44 +3064,44 @@ function Cr(e, p) {
|
|
|
3047
3064
|
else
|
|
3048
3065
|
for (let $ = d; $ <= l; $++)
|
|
3049
3066
|
if (r + 1 < e.rowCount) {
|
|
3050
|
-
const
|
|
3051
|
-
e.setCellValue($, r + 1, `=SUM(${
|
|
3067
|
+
const ce = `${ht($)}${w + 1}:${ht($)}${r + 1}`;
|
|
3068
|
+
e.setCellValue($, r + 1, `=SUM(${ce})`);
|
|
3052
3069
|
} else {
|
|
3053
|
-
const
|
|
3054
|
-
e.setCellValue($, r, `=SUM(${
|
|
3070
|
+
const ce = `${ht($)}${w + 1}:${ht($)}${r}`;
|
|
3071
|
+
e.setCellValue($, r, `=SUM(${ce})`);
|
|
3055
3072
|
}
|
|
3056
|
-
(I = e.scheduleRender) == null || I.call(e), (
|
|
3073
|
+
(I = e.scheduleRender) == null || I.call(e), (E = e.emitModelData) == null || E.call(e);
|
|
3057
3074
|
}
|
|
3058
3075
|
return {
|
|
3059
3076
|
cachedBorder: h,
|
|
3060
3077
|
borderMenuOpen: o,
|
|
3061
3078
|
BORDER_COLOR: s,
|
|
3062
3079
|
borderTypeToWidths: k,
|
|
3063
|
-
onBorderChange:
|
|
3080
|
+
onBorderChange: le,
|
|
3064
3081
|
setCellBorderSide: a,
|
|
3065
3082
|
syncCellBorders: z,
|
|
3066
3083
|
applyBorderToCell: v,
|
|
3067
3084
|
applyCachedBorder: q,
|
|
3068
3085
|
cellBorderWidth: y,
|
|
3069
|
-
mergeMenuOpen:
|
|
3086
|
+
mergeMenuOpen: ae,
|
|
3070
3087
|
onMergeMenuToggle: L,
|
|
3071
3088
|
removeOverlappingMerges: f,
|
|
3072
3089
|
mergeAndCenter: Ce,
|
|
3073
|
-
mergeAcross:
|
|
3090
|
+
mergeAcross: he,
|
|
3074
3091
|
mergeCells: De,
|
|
3075
3092
|
unmergeCells: Y,
|
|
3076
3093
|
onApplyMerge: X,
|
|
3077
|
-
onMergeChange:
|
|
3094
|
+
onMergeChange: be,
|
|
3078
3095
|
copySourceRange: null,
|
|
3079
3096
|
copySourceStyles: [],
|
|
3080
3097
|
captureStyles: Me,
|
|
3081
3098
|
setCellWithStyle: Be,
|
|
3082
|
-
copyToClipboard:
|
|
3099
|
+
copyToClipboard: oe,
|
|
3083
3100
|
copyRowCol: c,
|
|
3084
3101
|
pasteFromClipboard: m,
|
|
3085
|
-
cutSelected:
|
|
3086
|
-
clearSelected:
|
|
3087
|
-
sumSelected:
|
|
3102
|
+
cutSelected: Ne,
|
|
3103
|
+
clearSelected: He,
|
|
3104
|
+
sumSelected: de
|
|
3088
3105
|
};
|
|
3089
3106
|
}
|
|
3090
3107
|
function yr(e, p, h, o) {
|
|
@@ -3092,16 +3109,16 @@ function yr(e, p, h, o) {
|
|
|
3092
3109
|
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;
|
|
3093
3110
|
}
|
|
3094
3111
|
function wr(e, p, h, o) {
|
|
3095
|
-
function s(
|
|
3096
|
-
var
|
|
3097
|
-
const P = O -
|
|
3098
|
-
for (let N =
|
|
3112
|
+
function s(B, O) {
|
|
3113
|
+
var ne, pe;
|
|
3114
|
+
const P = O - B + 1;
|
|
3115
|
+
for (let N = B; N <= O; N++)
|
|
3099
3116
|
for (let ve = 0; ve < e.colCount; ve++)
|
|
3100
3117
|
e.delCell(e.cellKey(ve, N));
|
|
3101
|
-
for (let N =
|
|
3118
|
+
for (let N = B; N < e.rowCount - P; N++) {
|
|
3102
3119
|
for (let ve = 0; ve < e.colCount; ve++) {
|
|
3103
|
-
const Fe = e.cellKey(ve, N + P),
|
|
3104
|
-
e.cells[Fe] ? (e.cells[
|
|
3120
|
+
const Fe = e.cellKey(ve, N + P), Ke = e.cellKey(ve, N);
|
|
3121
|
+
e.cells[Fe] ? (e.cells[Ke] = e.cells[Fe], e.delCell(Fe)) : e.delCell(Ke);
|
|
3105
3122
|
}
|
|
3106
3123
|
e.rowHeights.value[N] = e.rowHeights.value[N + P];
|
|
3107
3124
|
}
|
|
@@ -3110,54 +3127,54 @@ function wr(e, p, h, o) {
|
|
|
3110
3127
|
e.delCell(e.cellKey(ve, N));
|
|
3111
3128
|
e.rowHeights.value[N] = void 0;
|
|
3112
3129
|
}
|
|
3113
|
-
if (
|
|
3130
|
+
if (B > 0)
|
|
3114
3131
|
for (let N = 0; N < e.colCount; N++)
|
|
3115
|
-
(
|
|
3132
|
+
(ne = e.syncCellBorders) == null || ne.call(e, N, B - 1), (pe = e.syncCellBorders) == null || pe.call(e, N, B);
|
|
3116
3133
|
}
|
|
3117
|
-
function k(
|
|
3118
|
-
const P = O -
|
|
3134
|
+
function k(B, O) {
|
|
3135
|
+
const P = O - B + 1;
|
|
3119
3136
|
if (!(O >= e.rowCount - 1)) {
|
|
3120
|
-
for (let
|
|
3121
|
-
for (let
|
|
3122
|
-
const N = e.cellKey(
|
|
3137
|
+
for (let ne = e.rowCount - 1; ne > O; ne--) {
|
|
3138
|
+
for (let pe = 0; pe < e.colCount; pe++) {
|
|
3139
|
+
const N = e.cellKey(pe, ne - P), ve = e.cellKey(pe, ne);
|
|
3123
3140
|
e.cells[N] ? e.cells[ve] = e.cells[N] : e.delCell(ve);
|
|
3124
3141
|
}
|
|
3125
|
-
e.rowHeights.value[
|
|
3142
|
+
e.rowHeights.value[ne] = e.rowHeights.value[ne - P];
|
|
3126
3143
|
}
|
|
3127
|
-
for (let
|
|
3128
|
-
for (let
|
|
3129
|
-
e.delCell(e.cellKey(
|
|
3130
|
-
e.rowHeights.value[
|
|
3144
|
+
for (let ne = O + 1; ne <= O + P; ne++) {
|
|
3145
|
+
for (let pe = 0; pe < e.colCount; pe++)
|
|
3146
|
+
e.delCell(e.cellKey(pe, ne));
|
|
3147
|
+
e.rowHeights.value[ne] = void 0;
|
|
3131
3148
|
}
|
|
3132
3149
|
}
|
|
3133
3150
|
}
|
|
3134
|
-
function a(
|
|
3135
|
-
const P = O -
|
|
3151
|
+
function a(B, O) {
|
|
3152
|
+
const P = O - B + 1;
|
|
3136
3153
|
if (!(O >= e.colCount - 1)) {
|
|
3137
|
-
for (let
|
|
3138
|
-
for (let
|
|
3139
|
-
const N = e.cellKey(
|
|
3154
|
+
for (let ne = e.colCount - 1; ne > O; ne--) {
|
|
3155
|
+
for (let pe = 0; pe < e.rowCount; pe++) {
|
|
3156
|
+
const N = e.cellKey(ne - P, pe), ve = e.cellKey(ne, pe);
|
|
3140
3157
|
e.cells[N] ? e.cells[ve] = e.cells[N] : e.delCell(ve);
|
|
3141
3158
|
}
|
|
3142
|
-
e.colWidths.value[
|
|
3159
|
+
e.colWidths.value[ne] = e.colWidths.value[ne - P];
|
|
3143
3160
|
}
|
|
3144
|
-
for (let
|
|
3145
|
-
for (let
|
|
3146
|
-
e.delCell(e.cellKey(
|
|
3147
|
-
e.colWidths.value[
|
|
3161
|
+
for (let ne = O + 1; ne <= O + P; ne++) {
|
|
3162
|
+
for (let pe = 0; pe < e.rowCount; pe++)
|
|
3163
|
+
e.delCell(e.cellKey(ne, pe));
|
|
3164
|
+
e.colWidths.value[ne] = Qt;
|
|
3148
3165
|
}
|
|
3149
3166
|
}
|
|
3150
3167
|
}
|
|
3151
|
-
function z(
|
|
3152
|
-
var
|
|
3153
|
-
const P = O -
|
|
3154
|
-
for (let N =
|
|
3168
|
+
function z(B, O) {
|
|
3169
|
+
var ne, pe;
|
|
3170
|
+
const P = O - B + 1;
|
|
3171
|
+
for (let N = B; N <= O; N++)
|
|
3155
3172
|
for (let ve = 0; ve < e.rowCount; ve++)
|
|
3156
3173
|
e.delCell(e.cellKey(N, ve));
|
|
3157
|
-
for (let N =
|
|
3174
|
+
for (let N = B; N < e.colCount - P; N++) {
|
|
3158
3175
|
for (let ve = 0; ve < e.rowCount; ve++) {
|
|
3159
|
-
const Fe = e.cellKey(N + P, ve),
|
|
3160
|
-
e.cells[Fe] ? (e.cells[
|
|
3176
|
+
const Fe = e.cellKey(N + P, ve), Ke = e.cellKey(N, ve);
|
|
3177
|
+
e.cells[Fe] ? (e.cells[Ke] = e.cells[Fe], e.delCell(Fe)) : e.delCell(Ke);
|
|
3161
3178
|
}
|
|
3162
3179
|
e.colWidths.value[N] = e.colWidths.value[N + P];
|
|
3163
3180
|
}
|
|
@@ -3166,18 +3183,18 @@ function wr(e, p, h, o) {
|
|
|
3166
3183
|
e.delCell(e.cellKey(N, ve));
|
|
3167
3184
|
e.colWidths.value[N] = Qt;
|
|
3168
3185
|
}
|
|
3169
|
-
if (
|
|
3186
|
+
if (B > 0)
|
|
3170
3187
|
for (let N = 0; N < e.rowCount; N++)
|
|
3171
|
-
(
|
|
3188
|
+
(ne = e.syncCellBorders) == null || ne.call(e, B - 1, N), (pe = e.syncCellBorders) == null || pe.call(e, B, N);
|
|
3172
3189
|
}
|
|
3173
3190
|
let v = 0;
|
|
3174
|
-
function
|
|
3191
|
+
function le() {
|
|
3175
3192
|
return v++, `s_${v}`;
|
|
3176
3193
|
}
|
|
3177
|
-
function q(
|
|
3194
|
+
function q(B) {
|
|
3178
3195
|
return {
|
|
3179
|
-
id:
|
|
3180
|
-
name:
|
|
3196
|
+
id: le(),
|
|
3197
|
+
name: B,
|
|
3181
3198
|
cells: {},
|
|
3182
3199
|
merges: {},
|
|
3183
3200
|
selection: { startCol: 0, startRow: 0, endCol: 0, endRow: 0 },
|
|
@@ -3188,42 +3205,42 @@ function wr(e, p, h, o) {
|
|
|
3188
3205
|
rowHeights: new Array(e.rowCount).fill(void 0)
|
|
3189
3206
|
};
|
|
3190
3207
|
}
|
|
3191
|
-
const y = V([q("Sheet1")]),
|
|
3208
|
+
const y = V([q("Sheet1")]), ae = V(0);
|
|
3192
3209
|
function L() {
|
|
3193
|
-
const
|
|
3194
|
-
|
|
3210
|
+
const B = y.value[ae.value];
|
|
3211
|
+
B && (B.cells = { ...e.cells }, B.merges = { ...e.merges }, B.selection = e.selection.value ? { ...e.selection.value } : null, B.activeCell = { ...e.activeCell.value }, B.scrollX = e.scrollX.value, B.scrollY = e.scrollY.value, B.colWidths = [...e.colWidths.value], B.rowHeights = [...e.rowHeights.value]);
|
|
3195
3212
|
}
|
|
3196
|
-
function f(
|
|
3197
|
-
const O = y.value[
|
|
3198
|
-
O && (Object.keys(e.cells).forEach((P) => e.delCell(P)), Object.assign(e.cells, O.cells), Object.keys(e.merges).forEach((P) => Reflect.deleteProperty(e.merges, P)), O.merges && Object.assign(e.merges, O.merges), e.selection.value = O.selection ? { ...O.selection } : null, e.activeCell.value = { ...O.activeCell }, e.scrollX.value = O.scrollX, e.scrollY.value = O.scrollY, e.colWidths.value = [...O.colWidths], e.rowHeights.value = [...O.rowHeights],
|
|
3213
|
+
function f(B) {
|
|
3214
|
+
const O = y.value[B];
|
|
3215
|
+
O && (Object.keys(e.cells).forEach((P) => e.delCell(P)), Object.assign(e.cells, O.cells), Object.keys(e.merges).forEach((P) => Reflect.deleteProperty(e.merges, P)), O.merges && Object.assign(e.merges, O.merges), e.selection.value = O.selection ? { ...O.selection } : null, e.activeCell.value = { ...O.activeCell }, e.scrollX.value = O.scrollX, e.scrollY.value = O.scrollY, e.colWidths.value = [...O.colWidths], e.rowHeights.value = [...O.rowHeights], ae.value = B);
|
|
3199
3216
|
}
|
|
3200
|
-
function Ce(
|
|
3201
|
-
|
|
3217
|
+
function Ce(B) {
|
|
3218
|
+
B === ae.value || B < 0 || B >= y.value.length || (e.cancelEdit(), L(), f(B));
|
|
3202
3219
|
}
|
|
3203
|
-
function
|
|
3204
|
-
return p.saveUndo(), e.cancelEdit(), L(), y.value.push(q(
|
|
3220
|
+
function he(B) {
|
|
3221
|
+
return p.saveUndo(), e.cancelEdit(), L(), y.value.push(q(B ?? `Sheet${y.value.length + 1}`)), f(y.value.length - 1), y.value.length - 1;
|
|
3205
3222
|
}
|
|
3206
|
-
function De(
|
|
3207
|
-
return y.value.length <= 1 || (p.saveUndo(), e.cancelEdit(), y.value.splice(
|
|
3223
|
+
function De(B) {
|
|
3224
|
+
return y.value.length <= 1 || (p.saveUndo(), e.cancelEdit(), y.value.splice(B, 1), f(Math.min(B, y.value.length - 1))), ae.value;
|
|
3208
3225
|
}
|
|
3209
|
-
function Y(
|
|
3210
|
-
y.value[
|
|
3226
|
+
function Y(B, O) {
|
|
3227
|
+
y.value[B] && O.trim() && (p.saveUndo(), y.value[B].name = O.trim());
|
|
3211
3228
|
}
|
|
3212
|
-
function X(
|
|
3229
|
+
function X(B) {
|
|
3213
3230
|
p.saveUndo(), e.cancelEdit(), L();
|
|
3214
|
-
const O = y.value[
|
|
3231
|
+
const O = y.value[B];
|
|
3215
3232
|
if (!O)
|
|
3216
|
-
return
|
|
3233
|
+
return B;
|
|
3217
3234
|
let P = O.name;
|
|
3218
|
-
const
|
|
3219
|
-
let
|
|
3220
|
-
|
|
3221
|
-
let N = `${P} (${
|
|
3222
|
-
const ve = new Set(y.value.map((
|
|
3235
|
+
const ne = P.match(/^(.*?)\s*\((\d+)\)$/);
|
|
3236
|
+
let pe = ne ? parseInt(ne[2], 10) + 1 : 2;
|
|
3237
|
+
ne && (P = ne[1]);
|
|
3238
|
+
let N = `${P} (${pe})`;
|
|
3239
|
+
const ve = new Set(y.value.map((Ke) => Ke.name));
|
|
3223
3240
|
for (; ve.has(N); )
|
|
3224
|
-
|
|
3241
|
+
pe++, N = `${P} (${pe})`;
|
|
3225
3242
|
const Fe = {
|
|
3226
|
-
id:
|
|
3243
|
+
id: le(),
|
|
3227
3244
|
name: N,
|
|
3228
3245
|
cells: { ...O.cells },
|
|
3229
3246
|
merges: O.merges ? { ...O.merges } : {},
|
|
@@ -3234,98 +3251,98 @@ function wr(e, p, h, o) {
|
|
|
3234
3251
|
colWidths: [...O.colWidths],
|
|
3235
3252
|
rowHeights: [...O.rowHeights]
|
|
3236
3253
|
};
|
|
3237
|
-
return y.value.splice(
|
|
3254
|
+
return y.value.splice(B + 1, 0, Fe), f(B + 1), B + 1;
|
|
3238
3255
|
}
|
|
3239
|
-
function
|
|
3256
|
+
function be(B, O) {
|
|
3240
3257
|
var N;
|
|
3241
|
-
const P =
|
|
3258
|
+
const P = B + O;
|
|
3242
3259
|
if (P < 0 || P >= y.value.length)
|
|
3243
3260
|
return;
|
|
3244
3261
|
p.saveUndo();
|
|
3245
|
-
const
|
|
3246
|
-
y.value.splice(P, 0,
|
|
3262
|
+
const ne = ae.value, pe = y.value.splice(B, 1)[0];
|
|
3263
|
+
y.value.splice(P, 0, pe), ne === B ? ae.value = P : B < ne && P >= ne ? ae.value = ne - 1 : B > ne && P <= ne && (ae.value = ne + 1), (N = e.scheduleRender) == null || N.call(e);
|
|
3247
3264
|
}
|
|
3248
|
-
const
|
|
3265
|
+
const F = se(() => y.value.length);
|
|
3249
3266
|
let j = "";
|
|
3250
3267
|
const Me = h;
|
|
3251
3268
|
function Be() {
|
|
3252
3269
|
L();
|
|
3253
|
-
const
|
|
3254
|
-
const
|
|
3255
|
-
for (const [Fe,
|
|
3256
|
-
|
|
3257
|
-
const
|
|
3258
|
-
P.merges && Object.keys(P.merges).length && (
|
|
3270
|
+
const B = y.value.map((P) => {
|
|
3271
|
+
const ne = {};
|
|
3272
|
+
for (const [Fe, Ke] of Object.entries(P.cells))
|
|
3273
|
+
ne[Fe] = { value: Ke.value }, Ke.style && (ne[Fe].style = Ke.style);
|
|
3274
|
+
const pe = { name: P.name, cells: ne };
|
|
3275
|
+
P.merges && Object.keys(P.merges).length && (pe.merges = { ...P.merges });
|
|
3259
3276
|
const N = {};
|
|
3260
3277
|
for (let Fe = 0; Fe < P.colWidths.length; Fe++)
|
|
3261
3278
|
P.colWidths[Fe] !== 100 && (N[Fe] = P.colWidths[Fe]);
|
|
3262
|
-
Object.keys(N).length && (
|
|
3279
|
+
Object.keys(N).length && (pe.colWidths = N);
|
|
3263
3280
|
const ve = {};
|
|
3264
3281
|
for (let Fe = 0; Fe < P.rowHeights.length; Fe++) {
|
|
3265
|
-
const
|
|
3266
|
-
|
|
3282
|
+
const Ke = P.rowHeights[Fe];
|
|
3283
|
+
Ke != null && (ve[Fe] = Ke);
|
|
3267
3284
|
}
|
|
3268
|
-
return Object.keys(ve).length && (
|
|
3269
|
-
}), O = JSON.stringify(
|
|
3270
|
-
O !== j && (j = O, Me.value =
|
|
3285
|
+
return Object.keys(ve).length && (pe.rowHeights = ve), pe;
|
|
3286
|
+
}), O = JSON.stringify(B);
|
|
3287
|
+
O !== j && (j = O, Me.value = B);
|
|
3271
3288
|
}
|
|
3272
3289
|
e.emitModelData = Be;
|
|
3273
|
-
let
|
|
3290
|
+
let oe = !1;
|
|
3274
3291
|
function c() {
|
|
3275
|
-
|
|
3276
|
-
|
|
3292
|
+
oe || (oe = !0, Promise.resolve().then(() => {
|
|
3293
|
+
oe = !1, Be();
|
|
3277
3294
|
}));
|
|
3278
3295
|
}
|
|
3279
|
-
const m =
|
|
3280
|
-
const
|
|
3281
|
-
for (const [O, P] of Object.entries(
|
|
3282
|
-
O.startsWith("--") && (
|
|
3283
|
-
return
|
|
3284
|
-
}),
|
|
3285
|
-
e.viewSize && ut(l, (
|
|
3286
|
-
e.viewSize && (e.viewSize.w =
|
|
3296
|
+
const m = se(() => e.props.theme === "dark" ? Ao : Oo), Ne = se(() => yr(m.value, e.props.width, e.props.height, Ht)), He = se(() => {
|
|
3297
|
+
const B = {};
|
|
3298
|
+
for (const [O, P] of Object.entries(Ne.value))
|
|
3299
|
+
O.startsWith("--") && (B[O] = P);
|
|
3300
|
+
return B;
|
|
3301
|
+
}), de = V(null), n = V(null), d = V(null), w = V(null), l = Tt({ w: 800, h: 600 });
|
|
3302
|
+
e.viewSize && ut(l, (B) => {
|
|
3303
|
+
e.viewSize && (e.viewSize.w = B.w, e.viewSize.h = B.h);
|
|
3287
3304
|
}, { deep: !0 });
|
|
3288
|
-
const r = 48, I = 28,
|
|
3289
|
-
function we(
|
|
3290
|
-
const P = Math.max(0, l.w - r -
|
|
3291
|
-
e.scrollX.value = Math.max(0, Math.min(
|
|
3305
|
+
const r = 48, I = 28, E = 11, $ = se(() => Math.max(0, e.totalWidth.value - Math.max(0, l.w - r - E))), ce = se(() => Math.max(0, e.totalHeight.value - Math.max(0, l.h - I - E)));
|
|
3306
|
+
function we(B, O) {
|
|
3307
|
+
const P = Math.max(0, l.w - r - E), ne = Math.max(0, l.h - I - E);
|
|
3308
|
+
e.scrollX.value = Math.max(0, Math.min(B ?? e.scrollX.value, Math.max(0, e.totalWidth.value - P))), e.scrollY.value = Math.max(0, Math.min(O ?? e.scrollY.value, Math.max(0, e.totalHeight.value - ne)));
|
|
3292
3309
|
}
|
|
3293
3310
|
e.clampScroll = we;
|
|
3294
|
-
function
|
|
3295
|
-
var
|
|
3296
|
-
return typeof window > "u" ? !1 : !((
|
|
3311
|
+
function Oe() {
|
|
3312
|
+
var B;
|
|
3313
|
+
return typeof window > "u" ? !1 : !((B = window.matchMedia) != null && B.call(window, "(hover: none) and (pointer: coarse)").matches);
|
|
3297
3314
|
}
|
|
3298
|
-
function
|
|
3299
|
-
|
|
3315
|
+
function Ve(B = !1) {
|
|
3316
|
+
$e(() => {
|
|
3300
3317
|
const O = d.value;
|
|
3301
3318
|
if (O) {
|
|
3302
|
-
if (!e.editingCell.value && !
|
|
3319
|
+
if (!e.editingCell.value && !Oe()) {
|
|
3303
3320
|
document.activeElement === O && O.blur();
|
|
3304
3321
|
return;
|
|
3305
3322
|
}
|
|
3306
|
-
O.focus({ preventScroll: !0 }),
|
|
3323
|
+
O.focus({ preventScroll: !0 }), B && O.select();
|
|
3307
3324
|
}
|
|
3308
3325
|
});
|
|
3309
3326
|
}
|
|
3310
3327
|
function Xe() {
|
|
3311
|
-
|
|
3328
|
+
Ve();
|
|
3312
3329
|
}
|
|
3313
3330
|
function ye() {
|
|
3314
3331
|
var O;
|
|
3315
|
-
const
|
|
3316
|
-
if (
|
|
3332
|
+
const B = e.selection.value;
|
|
3333
|
+
if (B) {
|
|
3317
3334
|
p.saveUndo();
|
|
3318
|
-
for (let P =
|
|
3335
|
+
for (let P = B.startRow; P <= B.endRow; P++)
|
|
3319
3336
|
e.rowHeights.value[P] = void 0;
|
|
3320
3337
|
(O = e.scheduleRender) == null || O.call(e), Be();
|
|
3321
3338
|
}
|
|
3322
3339
|
}
|
|
3323
|
-
function
|
|
3340
|
+
function _e() {
|
|
3324
3341
|
var O;
|
|
3325
|
-
const
|
|
3326
|
-
if (
|
|
3342
|
+
const B = e.selection.value;
|
|
3343
|
+
if (B) {
|
|
3327
3344
|
p.saveUndo();
|
|
3328
|
-
for (let P =
|
|
3345
|
+
for (let P = B.startCol; P <= B.endCol; P++)
|
|
3329
3346
|
e.colWidths.value[P] = Qt;
|
|
3330
3347
|
(O = e.scheduleRender) == null || O.call(e), Be();
|
|
3331
3348
|
}
|
|
@@ -3336,35 +3353,35 @@ function wr(e, p, h, o) {
|
|
|
3336
3353
|
insertCols: a,
|
|
3337
3354
|
deleteCols: z,
|
|
3338
3355
|
sheets: y,
|
|
3339
|
-
activeSheetIndex:
|
|
3356
|
+
activeSheetIndex: ae,
|
|
3340
3357
|
saveSheet: L,
|
|
3341
3358
|
loadSheet: f,
|
|
3342
3359
|
switchSheet: Ce,
|
|
3343
|
-
addSheet:
|
|
3360
|
+
addSheet: he,
|
|
3344
3361
|
removeSheet: De,
|
|
3345
3362
|
renameSheet: Y,
|
|
3346
3363
|
dupSheet: X,
|
|
3347
|
-
moveSheet:
|
|
3348
|
-
sheetCount:
|
|
3364
|
+
moveSheet: be,
|
|
3365
|
+
sheetCount: F,
|
|
3349
3366
|
mkSheet: q,
|
|
3350
3367
|
emitModelData: Be,
|
|
3351
3368
|
scheduleOptEmit: c,
|
|
3352
3369
|
themeColors: m,
|
|
3353
|
-
outerStyle:
|
|
3354
|
-
toolbarThemeVars:
|
|
3355
|
-
wrapperRef:
|
|
3370
|
+
outerStyle: Ne,
|
|
3371
|
+
toolbarThemeVars: He,
|
|
3372
|
+
wrapperRef: de,
|
|
3356
3373
|
canvasRef: n,
|
|
3357
3374
|
editInputRef: d,
|
|
3358
3375
|
formulaBarRef: w,
|
|
3359
3376
|
viewSize: l,
|
|
3360
3377
|
maxScrollX: $,
|
|
3361
|
-
maxScrollY:
|
|
3378
|
+
maxScrollY: ce,
|
|
3362
3379
|
clampScroll: we,
|
|
3363
|
-
canFocusHiddenEditor:
|
|
3364
|
-
focusEditInput:
|
|
3380
|
+
canFocusHiddenEditor: Oe,
|
|
3381
|
+
focusEditInput: Ve,
|
|
3365
3382
|
onCanvasFocus: Xe,
|
|
3366
3383
|
resetRowHeight: ye,
|
|
3367
|
-
resetColWidth:
|
|
3384
|
+
resetColWidth: _e,
|
|
3368
3385
|
modelData: Me
|
|
3369
3386
|
};
|
|
3370
3387
|
}
|
|
@@ -3376,9 +3393,9 @@ function kr(e, p, h, o, s) {
|
|
|
3376
3393
|
}));
|
|
3377
3394
|
}
|
|
3378
3395
|
e.scheduleRender = v;
|
|
3379
|
-
const
|
|
3396
|
+
const le = "#444";
|
|
3380
3397
|
function q() {
|
|
3381
|
-
var El, Ot, cl,
|
|
3398
|
+
var El, Ot, cl, St, Ft, ul, Pl, Ul, Yl, Gl, Xl;
|
|
3382
3399
|
const t = o.canvasRef.value;
|
|
3383
3400
|
if (!t)
|
|
3384
3401
|
return;
|
|
@@ -3386,37 +3403,37 @@ function kr(e, p, h, o, s) {
|
|
|
3386
3403
|
if (!u || (a = t.getContext("2d"), !a))
|
|
3387
3404
|
return;
|
|
3388
3405
|
z = window.devicePixelRatio || 1;
|
|
3389
|
-
const
|
|
3390
|
-
o.viewSize.w =
|
|
3391
|
-
const
|
|
3406
|
+
const M = u.getBoundingClientRect(), D = M.width, g = M.height;
|
|
3407
|
+
o.viewSize.w = D, o.viewSize.h = g, t.width = D * z, t.height = g * z, t.style.width = D + "px", t.style.height = g + "px", a.setTransform(z, 0, 0, z, 0, 0);
|
|
3408
|
+
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 = [];
|
|
3392
3409
|
for (let A = 0; A < e.rowCount; A++)
|
|
3393
3410
|
Et[A] = lt[A + 1] - lt[A];
|
|
3394
|
-
const yt = Math.max(0, e.hitCol(
|
|
3411
|
+
const yt = Math.max(0, e.hitCol(T));
|
|
3395
3412
|
let Lt = yt;
|
|
3396
|
-
for (let A = yt; A < e.colCount && !(
|
|
3413
|
+
for (let A = yt; A < e.colCount && !(re + ct[A] - T >= D); A++)
|
|
3397
3414
|
Lt = A;
|
|
3398
|
-
const Pt = Lt, ft = Math.max(0, e.hitRow(
|
|
3415
|
+
const Pt = Lt, ft = Math.max(0, e.hitRow(_));
|
|
3399
3416
|
let Cl = ft;
|
|
3400
|
-
for (let A = ft; A < e.rowCount && !(
|
|
3417
|
+
for (let A = ft; A < e.rowCount && !(ue + lt[A] - _ >= g); A++)
|
|
3401
3418
|
Cl = A;
|
|
3402
3419
|
const Ut = Cl;
|
|
3403
|
-
a.fillStyle =
|
|
3420
|
+
a.fillStyle = Ee.bg, a.fillRect(0, 0, D, g), a.fillStyle = Ee.gridBg, a.fillRect(re, ue, D - re, g - ue), a.save(), a.beginPath(), a.rect(re, ue, D - re, g - ue), a.clip();
|
|
3404
3421
|
const it = e.selection.value, il = e.editingCell.value;
|
|
3405
3422
|
for (let A = ft; A <= Ut; A++)
|
|
3406
|
-
for (let
|
|
3407
|
-
const
|
|
3408
|
-
if (
|
|
3423
|
+
for (let ee = yt; ee <= Pt; ee++) {
|
|
3424
|
+
const Le = e.findMerge(ee, A);
|
|
3425
|
+
if (Le && !(ee === Le.range.startCol && A === Le.range.startRow))
|
|
3409
3426
|
continue;
|
|
3410
|
-
const
|
|
3411
|
-
let Ye = Vt[
|
|
3412
|
-
if (
|
|
3427
|
+
const We = re + ct[ee] - T, Ie = ue + lt[A] - _;
|
|
3428
|
+
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 > g)
|
|
3413
3430
|
continue;
|
|
3414
|
-
const je = (El = e.cells[e.cellKey(
|
|
3415
|
-
if (Yt && (a.fillStyle = Yt, a.fillRect(
|
|
3416
|
-
const Gt = e.getCellValue(
|
|
3431
|
+
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
|
+
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)) {
|
|
3433
|
+
const Gt = e.getCellValue(ee, A);
|
|
3417
3434
|
if (Gt) {
|
|
3418
|
-
const xe = (Ot = e.cells[e.cellKey(
|
|
3419
|
-
a.fillStyle = Ll ||
|
|
3435
|
+
const xe = (Ot = e.cells[e.cellKey(ee, A)]) == null ? void 0 : Ot.style, ot = e.cellFontSize(ee, A), vt = typeof (xe == null ? void 0 : xe.fontFamily) == "string" && xe.fontFamily ? xe.fontFamily : Sl, wt = (xe == null ? void 0 : xe.fontWeight) === "bold" ? "bold" : "normal", pt = (xe == null ? void 0 : xe.fontStyle) === "italic" ? "italic" : "normal", Xt = (xe == null ? void 0 : xe.underline) === "underline", uo = (xe == null ? void 0 : xe.strikethrough) === "line-through", Ll = typeof (xe == null ? void 0 : xe.color) == "string" ? xe.color : "", jl = typeof (xe == null ? void 0 : xe.textAlign) == "string" ? xe.textAlign : "left", ql = typeof (xe == null ? void 0 : xe.verticalAlign) == "string" ? xe.verticalAlign : "top";
|
|
3436
|
+
a.fillStyle = Ll || Ee.cellText, a.font = `${pt} ${wt} ${ot}px ${vt}`, a.textBaseline = "alphabetic", a.save(), a.beginPath(), a.rect(We + 5, Ie + 1, Ye - 10, Ge - 2), a.clip();
|
|
3420
3437
|
const so = (xe == null ? void 0 : xe.wrap) === "wrap", sl = e.getWrappedLines(a, Gt, Ye - 10, so);
|
|
3421
3438
|
let jt = 0, At = 0;
|
|
3422
3439
|
for (const qt of sl) {
|
|
@@ -3426,12 +3443,12 @@ function kr(e, p, h, o, s) {
|
|
|
3426
3443
|
jt = Math.max(jt, ot * 0.5), At = Math.max(At, ot * 0.15);
|
|
3427
3444
|
const yl = ot, fo = sl.length * yl;
|
|
3428
3445
|
let wl;
|
|
3429
|
-
ql === "middle" ? wl =
|
|
3446
|
+
ql === "middle" ? wl = Ie + (Ge - fo) / 2 + jt : ql === "bottom" ? wl = Ie + Ge - e.BASE_CELL_VPAD - At - (sl.length - 1) * yl : wl = Ie + e.BASE_CELL_VPAD + jt;
|
|
3430
3447
|
for (let qt = 0; qt < sl.length; qt++) {
|
|
3431
3448
|
const dl = sl[qt], Zt = wl + qt * yl, Jt = a.measureText(dl);
|
|
3432
3449
|
let kt;
|
|
3433
|
-
if (jl === "center" ? kt =
|
|
3434
|
-
a.strokeStyle = Ll ||
|
|
3450
|
+
if (jl === "center" ? kt = We + Ye / 2 - Jt.width / 2 : jl === "right" ? kt = We + Ye - 5 - Jt.width : kt = We + 5, a.fillText(dl, kt, Zt), Xt && (a.strokeStyle = Ll || Ee.cellText, a.lineWidth = 1, a.beginPath(), a.moveTo(kt, Zt + At + 1), a.lineTo(kt + Jt.width, Zt + At + 1), a.stroke()), uo) {
|
|
3451
|
+
a.strokeStyle = Ll || Ee.cellText, a.lineWidth = 1;
|
|
3435
3452
|
const kl = Zt - yl * 0.25;
|
|
3436
3453
|
a.beginPath(), a.moveTo(kt, kl), a.lineTo(kt + Jt.width, kl), a.stroke();
|
|
3437
3454
|
}
|
|
@@ -3441,42 +3458,42 @@ function kr(e, p, h, o, s) {
|
|
|
3441
3458
|
}
|
|
3442
3459
|
}
|
|
3443
3460
|
for (let A = ft; A <= Ut; A++)
|
|
3444
|
-
for (let
|
|
3445
|
-
const
|
|
3446
|
-
if (
|
|
3461
|
+
for (let ee = yt; ee <= Pt; ee++) {
|
|
3462
|
+
const Le = e.findMerge(ee, A);
|
|
3463
|
+
if (Le && !(ee === Le.range.startCol && A === Le.range.startRow))
|
|
3447
3464
|
continue;
|
|
3448
|
-
const
|
|
3449
|
-
let Ye = Vt[
|
|
3450
|
-
if (
|
|
3465
|
+
const We = re + ct[ee] - T, Ie = ue + lt[A] - _;
|
|
3466
|
+
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 > g)
|
|
3451
3468
|
continue;
|
|
3452
|
-
const je = (cl = e.cells[e.cellKey(
|
|
3453
|
-
(vt > 0 || wt > 0 || pt > 0 || Xt > 0) && (a.fillStyle =
|
|
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, h.cellBorderWidth(ee, A - 1, "Bottom")), wt = Math.max(Gt, h.cellBorderWidth(ee - 1, A, "Right")), pt = Math.max(xe, h.cellBorderWidth(ee, A + 1, "Top")), Xt = Math.max(ot, h.cellBorderWidth(ee + 1, A, "Left"));
|
|
3470
|
+
(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));
|
|
3454
3471
|
}
|
|
3455
3472
|
for (let A = ft; A <= Ut; A++)
|
|
3456
|
-
for (let
|
|
3457
|
-
const
|
|
3458
|
-
if (
|
|
3473
|
+
for (let ee = yt; ee <= Pt; ee++) {
|
|
3474
|
+
const Le = e.findMerge(ee, A);
|
|
3475
|
+
if (Le && !(ee === Le.range.startCol && A === Le.range.startRow))
|
|
3459
3476
|
continue;
|
|
3460
|
-
const
|
|
3461
|
-
let Ye = Vt[
|
|
3462
|
-
if (
|
|
3477
|
+
const We = re + ct[ee] - T, Ie = ue + lt[A] - _;
|
|
3478
|
+
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 > g)
|
|
3463
3480
|
continue;
|
|
3464
|
-
const je = ((Ft = (
|
|
3465
|
-
a.fillStyle =
|
|
3481
|
+
const je = ((Ft = (St = e.cells[e.cellKey(ee, A)]) == null ? void 0 : St.style) == null ? void 0 : Ft.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, h.cellBorderWidth(ee, A - 1, "Bottom")), vt = Math.max(Yt, h.cellBorderWidth(ee - 1, A, "Right")), wt = Math.max(Gt, h.cellBorderWidth(ee, A + 1, "Top")), pt = Math.max(xe, h.cellBorderWidth(ee + 1, A, "Left"));
|
|
3482
|
+
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);
|
|
3466
3483
|
}
|
|
3467
|
-
a.restore(), a.fillStyle =
|
|
3484
|
+
a.restore(), a.fillStyle = Ee.headerBg, a.fillRect(re, 0, D - re, ue);
|
|
3468
3485
|
for (let A = yt; A <= Pt; A++) {
|
|
3469
|
-
const
|
|
3470
|
-
|
|
3486
|
+
const ee = re + ct[A] - T, Le = Vt[A];
|
|
3487
|
+
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));
|
|
3471
3488
|
}
|
|
3472
|
-
a.strokeStyle =
|
|
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, g - ue);
|
|
3473
3490
|
for (let A = ft; A <= Ut; A++) {
|
|
3474
|
-
const
|
|
3475
|
-
|
|
3491
|
+
const ee = ue + lt[A] - _, Le = Et[A];
|
|
3492
|
+
ee + Le < ue || ee > g || (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));
|
|
3476
3493
|
}
|
|
3477
|
-
a.strokeStyle =
|
|
3494
|
+
a.strokeStyle = Ee.headerSep, a.lineWidth = 1, a.beginPath(), a.moveTo(re + 0.5, ue), a.lineTo(re + 0.5, g), 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);
|
|
3478
3495
|
}
|
|
3479
|
-
const y =
|
|
3496
|
+
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));
|
|
3480
3497
|
function L() {
|
|
3481
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(), v());
|
|
3482
3499
|
}
|
|
@@ -3484,10 +3501,10 @@ function kr(e, p, h, o, s) {
|
|
|
3484
3501
|
e.editValue.value = t.target.value;
|
|
3485
3502
|
}
|
|
3486
3503
|
function Ce(t) {
|
|
3487
|
-
var u,
|
|
3488
|
-
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(), v(), o.focusEditInput()) : t.key === "Escape" && (t.preventDefault(), e.cancelEdit(), (
|
|
3504
|
+
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(), v(), o.focusEditInput()) : t.key === "Escape" && (t.preventDefault(), e.cancelEdit(), (M = o.formulaBarRef.value) == null || M.blur(), v(), o.focusEditInput());
|
|
3489
3506
|
}
|
|
3490
|
-
function
|
|
3507
|
+
function he() {
|
|
3491
3508
|
setTimeout(() => {
|
|
3492
3509
|
e.editingCell.value && (e.commitEdit(), v());
|
|
3493
3510
|
}, 0);
|
|
@@ -3496,48 +3513,48 @@ function kr(e, p, h, o, s) {
|
|
|
3496
3513
|
function X(t) {
|
|
3497
3514
|
De.value === null && (o.switchSheet(t), v());
|
|
3498
3515
|
}
|
|
3499
|
-
function
|
|
3500
|
-
t !== o.activeSheetIndex.value && (o.saveSheet(), o.loadSheet(t), v()), De.value = t, Y.value = o.sheets.value[t].name,
|
|
3516
|
+
function be(t) {
|
|
3517
|
+
t !== o.activeSheetIndex.value && (o.saveSheet(), o.loadSheet(t), v()), De.value = t, Y.value = o.sheets.value[t].name, $e(() => {
|
|
3501
3518
|
const u = document.querySelector(".tab-rename-input");
|
|
3502
3519
|
u == null || u.focus(), u == null || u.select();
|
|
3503
3520
|
});
|
|
3504
3521
|
}
|
|
3505
|
-
function
|
|
3506
|
-
De.value !== null && (o.renameSheet(De.value, Y.value),
|
|
3522
|
+
function F() {
|
|
3523
|
+
De.value !== null && (o.renameSheet(De.value, Y.value), $e(() => o.emitModelData())), De.value = null, Y.value = "";
|
|
3507
3524
|
}
|
|
3508
3525
|
function j() {
|
|
3509
3526
|
De.value = null, Y.value = "";
|
|
3510
3527
|
}
|
|
3511
3528
|
function Me(t) {
|
|
3512
|
-
t.key === "Enter" ? (t.preventDefault(),
|
|
3529
|
+
t.key === "Enter" ? (t.preventDefault(), F()) : t.key === "Escape" && (t.preventDefault(), j());
|
|
3513
3530
|
}
|
|
3514
3531
|
const Be = V(null);
|
|
3515
|
-
let
|
|
3532
|
+
let oe = null;
|
|
3516
3533
|
function c() {
|
|
3517
|
-
|
|
3534
|
+
oe && (document.removeEventListener("click", oe), oe = null);
|
|
3518
3535
|
}
|
|
3519
|
-
function m(t, u,
|
|
3536
|
+
function m(t, u, M) {
|
|
3520
3537
|
c();
|
|
3521
|
-
const
|
|
3522
|
-
t +
|
|
3538
|
+
const D = 140, g = M.length * 28 + 8, T = window.innerWidth, _ = window.innerHeight;
|
|
3539
|
+
t + D > T && (t -= D), u + g > _ && (u -= g), Be.value = { x: t, y: u, items: M }, oe = () => {
|
|
3523
3540
|
Be.value = null, c();
|
|
3524
|
-
}, setTimeout(() => document.addEventListener("click",
|
|
3541
|
+
}, setTimeout(() => document.addEventListener("click", oe, { once: !0 }), 0);
|
|
3525
3542
|
}
|
|
3526
|
-
const
|
|
3527
|
-
function
|
|
3543
|
+
const Ne = V(!1);
|
|
3544
|
+
function He(t, u) {
|
|
3528
3545
|
if (!u.children) {
|
|
3529
|
-
|
|
3546
|
+
Ne.value = !1;
|
|
3530
3547
|
return;
|
|
3531
3548
|
}
|
|
3532
|
-
const
|
|
3533
|
-
if (!
|
|
3534
|
-
|
|
3549
|
+
const D = t.currentTarget.querySelector(".context-submenu");
|
|
3550
|
+
if (!D) {
|
|
3551
|
+
Ne.value = !1;
|
|
3535
3552
|
return;
|
|
3536
3553
|
}
|
|
3537
|
-
const g =
|
|
3538
|
-
|
|
3554
|
+
const g = D.getBoundingClientRect();
|
|
3555
|
+
Ne.value = g.right > window.innerWidth;
|
|
3539
3556
|
}
|
|
3540
|
-
function
|
|
3557
|
+
function de(t, u) {
|
|
3541
3558
|
t.preventDefault(), t.stopPropagation(), m(t.clientX, t.clientY, [
|
|
3542
3559
|
{ label: U(e.locale.value, "insert"), action: () => {
|
|
3543
3560
|
o.addSheet(), v();
|
|
@@ -3546,7 +3563,7 @@ function kr(e, p, h, o, s) {
|
|
|
3546
3563
|
o.dupSheet(u);
|
|
3547
3564
|
} },
|
|
3548
3565
|
{ label: U(e.locale.value, "rename"), action: () => {
|
|
3549
|
-
|
|
3566
|
+
be(u);
|
|
3550
3567
|
} },
|
|
3551
3568
|
{ label: U(e.locale.value, "delete"), action: () => {
|
|
3552
3569
|
o.removeSheet(u), v();
|
|
@@ -3574,7 +3591,7 @@ function kr(e, p, h, o, s) {
|
|
|
3574
3591
|
{ label: U(e.locale.value, "copy"), action: () => h.copyToClipboard() },
|
|
3575
3592
|
{ label: U(e.locale.value, "paste"), action: () => {
|
|
3576
3593
|
p.saveUndo(), h.pasteFromClipboard().then(() => {
|
|
3577
|
-
v(),
|
|
3594
|
+
v(), $e(() => o.emitModelData());
|
|
3578
3595
|
});
|
|
3579
3596
|
} },
|
|
3580
3597
|
{ label: U(e.locale.value, "delete"), action: () => {
|
|
@@ -3589,65 +3606,65 @@ function kr(e, p, h, o, s) {
|
|
|
3589
3606
|
}
|
|
3590
3607
|
function w(t, u) {
|
|
3591
3608
|
t.preventDefault();
|
|
3592
|
-
const
|
|
3609
|
+
const M = t.clientX, D = t.clientY, g = e.selection.value;
|
|
3593
3610
|
g && g.startCol === 0 && g.endCol === e.colCount - 1 && u >= g.startRow && u <= g.endRow || (e.selectRange(0, u, e.colCount - 1, u), v());
|
|
3594
|
-
const
|
|
3611
|
+
const T = e.selection.value;
|
|
3595
3612
|
m(t.clientX, t.clientY, [
|
|
3596
3613
|
{ label: U(e.locale.value, "insert"), action: () => {
|
|
3597
|
-
p.saveUndo(), o.insertRows(
|
|
3598
|
-
}, disabled:
|
|
3614
|
+
p.saveUndo(), o.insertRows(T.startRow, T.endRow), v(), o.emitModelData();
|
|
3615
|
+
}, disabled: T.endRow >= e.rowCount - 1 },
|
|
3599
3616
|
{ label: U(e.locale.value, "cut"), action: () => {
|
|
3600
3617
|
p.saveUndo(), h.copyRowCol();
|
|
3601
|
-
for (let
|
|
3602
|
-
for (let
|
|
3603
|
-
e.delCell(e.cellKey(
|
|
3618
|
+
for (let _ = T.startRow; _ <= T.endRow; _++)
|
|
3619
|
+
for (let re = 0; re < e.colCount; re++)
|
|
3620
|
+
e.delCell(e.cellKey(re, _));
|
|
3604
3621
|
v(), o.emitModelData();
|
|
3605
3622
|
} },
|
|
3606
3623
|
{ label: U(e.locale.value, "copy"), action: () => h.copyRowCol() },
|
|
3607
3624
|
{ label: U(e.locale.value, "paste"), action: () => {
|
|
3608
3625
|
p.saveUndo(), h.pasteFromClipboard().then(() => {
|
|
3609
|
-
v(),
|
|
3626
|
+
v(), $e(() => o.emitModelData());
|
|
3610
3627
|
});
|
|
3611
3628
|
} },
|
|
3612
3629
|
{ label: U(e.locale.value, "delete"), action: () => {
|
|
3613
|
-
p.saveUndo(), o.deleteRows(
|
|
3630
|
+
p.saveUndo(), o.deleteRows(T.startRow, T.endRow), v(), o.emitModelData();
|
|
3614
3631
|
} },
|
|
3615
|
-
{ label: `${U(e.locale.value, "rowHeight")}...`, action: () => we("row",
|
|
3632
|
+
{ label: `${U(e.locale.value, "rowHeight")}...`, action: () => we("row", M, D) },
|
|
3616
3633
|
{ label: U(e.locale.value, "autoRowHeight"), action: () => o.resetRowHeight() }
|
|
3617
3634
|
]);
|
|
3618
3635
|
}
|
|
3619
3636
|
function l(t, u) {
|
|
3620
3637
|
t.preventDefault();
|
|
3621
|
-
const
|
|
3638
|
+
const M = t.clientX, D = t.clientY, g = e.selection.value;
|
|
3622
3639
|
g && g.startRow === 0 && g.endRow === e.rowCount - 1 && u >= g.startCol && u <= g.endCol || (e.selectRange(u, 0, u, e.rowCount - 1), v());
|
|
3623
|
-
const
|
|
3640
|
+
const T = e.selection.value;
|
|
3624
3641
|
m(t.clientX, t.clientY, [
|
|
3625
3642
|
{ label: U(e.locale.value, "insert"), action: () => {
|
|
3626
|
-
p.saveUndo(), o.insertCols(
|
|
3627
|
-
}, disabled:
|
|
3643
|
+
p.saveUndo(), o.insertCols(T.startCol, T.endCol), v(), o.emitModelData();
|
|
3644
|
+
}, disabled: T.endCol >= e.colCount - 1 },
|
|
3628
3645
|
{ label: U(e.locale.value, "cut"), action: () => {
|
|
3629
3646
|
p.saveUndo(), h.copyRowCol();
|
|
3630
|
-
for (let
|
|
3631
|
-
for (let
|
|
3632
|
-
e.delCell(e.cellKey(
|
|
3647
|
+
for (let _ = T.startCol; _ <= T.endCol; _++)
|
|
3648
|
+
for (let re = 0; re < e.rowCount; re++)
|
|
3649
|
+
e.delCell(e.cellKey(_, re));
|
|
3633
3650
|
v(), o.emitModelData();
|
|
3634
3651
|
} },
|
|
3635
3652
|
{ label: U(e.locale.value, "copy"), action: () => h.copyRowCol() },
|
|
3636
3653
|
{ label: U(e.locale.value, "paste"), action: () => {
|
|
3637
3654
|
p.saveUndo(), h.pasteFromClipboard().then(() => {
|
|
3638
|
-
v(),
|
|
3655
|
+
v(), $e(() => o.emitModelData());
|
|
3639
3656
|
});
|
|
3640
3657
|
} },
|
|
3641
3658
|
{ label: U(e.locale.value, "delete"), action: () => {
|
|
3642
|
-
p.saveUndo(), o.deleteCols(
|
|
3659
|
+
p.saveUndo(), o.deleteCols(T.startCol, T.endCol), v(), o.emitModelData();
|
|
3643
3660
|
} },
|
|
3644
|
-
{ label: `${U(e.locale.value, "colWidth")}...`, action: () => we("col",
|
|
3661
|
+
{ label: `${U(e.locale.value, "colWidth")}...`, action: () => we("col", M, D) },
|
|
3645
3662
|
{ label: U(e.locale.value, "defaultColWidth"), action: () => o.resetColWidth() }
|
|
3646
3663
|
]);
|
|
3647
3664
|
}
|
|
3648
|
-
function r(t, u,
|
|
3649
|
-
t.preventDefault(), e.isSelected(u,
|
|
3650
|
-
const
|
|
3665
|
+
function r(t, u, M) {
|
|
3666
|
+
t.preventDefault(), e.isSelected(u, M) || (e.selectCell(u, M), v());
|
|
3667
|
+
const D = e.selection.value, g = !!(D && D.startCol === D.endCol && D.startRow === D.endRow);
|
|
3651
3668
|
m(t.clientX, t.clientY, [
|
|
3652
3669
|
{ label: U(e.locale.value, "cut"), action: () => {
|
|
3653
3670
|
h.cutSelected(), o.emitModelData();
|
|
@@ -3655,7 +3672,7 @@ function kr(e, p, h, o, s) {
|
|
|
3655
3672
|
{ label: U(e.locale.value, "copy"), action: () => h.copyToClipboard() },
|
|
3656
3673
|
{ label: U(e.locale.value, "paste"), action: () => {
|
|
3657
3674
|
p.saveUndo(), h.pasteFromClipboard().then(() => {
|
|
3658
|
-
v(),
|
|
3675
|
+
v(), $e(() => o.emitModelData());
|
|
3659
3676
|
});
|
|
3660
3677
|
} },
|
|
3661
3678
|
{ label: U(e.locale.value, "delete"), action: () => {
|
|
@@ -3666,93 +3683,93 @@ function kr(e, p, h, o, s) {
|
|
|
3666
3683
|
] }
|
|
3667
3684
|
]);
|
|
3668
3685
|
}
|
|
3669
|
-
const I = V(null),
|
|
3686
|
+
const I = V(null), E = V(null);
|
|
3670
3687
|
let $ = null;
|
|
3671
|
-
function
|
|
3688
|
+
function ce() {
|
|
3672
3689
|
$ && (document.removeEventListener("mousedown", $), $ = null);
|
|
3673
3690
|
}
|
|
3674
|
-
function we(t, u,
|
|
3675
|
-
|
|
3676
|
-
const
|
|
3691
|
+
function we(t, u, M) {
|
|
3692
|
+
ce();
|
|
3693
|
+
const D = e.selection.value;
|
|
3677
3694
|
let g = "";
|
|
3678
|
-
if (
|
|
3679
|
-
const
|
|
3680
|
-
g =
|
|
3695
|
+
if (D) {
|
|
3696
|
+
const Ee = t === "row" ? e.getRowHeight(D.startRow) : e.colWidths.value[D.startCol];
|
|
3697
|
+
g = Ee != null && Ee > 0 ? String(Math.round(Ee)) : "";
|
|
3681
3698
|
}
|
|
3682
|
-
const
|
|
3683
|
-
let
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
}, setTimeout(() => document.addEventListener("mousedown", $, { once: !0 }), 0),
|
|
3687
|
-
const
|
|
3688
|
-
|
|
3699
|
+
const T = 220, _ = 118;
|
|
3700
|
+
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: g, error: "" }, $ = () => {
|
|
3702
|
+
E.value = null;
|
|
3703
|
+
}, setTimeout(() => document.addEventListener("mousedown", $, { once: !0 }), 0), $e(() => {
|
|
3704
|
+
const Ee = I.value;
|
|
3705
|
+
Ee && (Ee.focus(), Ee.select());
|
|
3689
3706
|
});
|
|
3690
3707
|
}
|
|
3691
|
-
function
|
|
3692
|
-
const u =
|
|
3708
|
+
function Oe(t) {
|
|
3709
|
+
const u = E.value;
|
|
3693
3710
|
if (!u)
|
|
3694
3711
|
return;
|
|
3695
|
-
const
|
|
3696
|
-
u.value = g,
|
|
3712
|
+
const M = t.target, D = M.value, g = D.replace(/[^\d]/g, "");
|
|
3713
|
+
u.value = g, D !== g && (M.value = g), u.error = "";
|
|
3697
3714
|
}
|
|
3698
|
-
function
|
|
3699
|
-
t.key === "Enter" ? (t.preventDefault(), ye()) : t.key === "Escape" && (t.preventDefault(),
|
|
3715
|
+
function Ve(t) {
|
|
3716
|
+
t.key === "Enter" ? (t.preventDefault(), ye()) : t.key === "Escape" && (t.preventDefault(), _e());
|
|
3700
3717
|
}
|
|
3701
3718
|
function Xe() {
|
|
3702
|
-
const t =
|
|
3719
|
+
const t = E.value;
|
|
3703
3720
|
if (!t)
|
|
3704
3721
|
return;
|
|
3705
|
-
const u = t.value.trim(),
|
|
3706
|
-
if (u === "" || !Number.isFinite(
|
|
3707
|
-
|
|
3722
|
+
const u = t.value.trim(), M = Number(u), D = t.type === "row", g = D ? vl : fl, T = D ? gl : xl;
|
|
3723
|
+
if (u === "" || !Number.isFinite(M)) {
|
|
3724
|
+
_e();
|
|
3708
3725
|
return;
|
|
3709
3726
|
}
|
|
3710
|
-
const
|
|
3711
|
-
t.value = String(
|
|
3727
|
+
const _ = Math.max(g, Math.min(T, Math.round(M)));
|
|
3728
|
+
t.value = String(_), t.error = "";
|
|
3712
3729
|
}
|
|
3713
3730
|
function ye() {
|
|
3714
|
-
const t =
|
|
3731
|
+
const t = E.value, u = e.selection.value;
|
|
3715
3732
|
if (!t || !u)
|
|
3716
3733
|
return;
|
|
3717
|
-
const
|
|
3718
|
-
if (
|
|
3734
|
+
const M = t.value.trim(), D = Number(M), g = t.type === "row", T = g ? vl : fl, _ = g ? gl : xl;
|
|
3735
|
+
if (M === "" || !Number.isFinite(D)) {
|
|
3719
3736
|
t.error = U(e.locale.value, "dimNumberError");
|
|
3720
3737
|
return;
|
|
3721
3738
|
}
|
|
3722
|
-
if (
|
|
3723
|
-
t.error = U(e.locale.value, "dimRangeError").replace("{min}", String(
|
|
3739
|
+
if (D < T || D > _) {
|
|
3740
|
+
t.error = U(e.locale.value, "dimRangeError").replace("{min}", String(T)).replace("{max}", String(_));
|
|
3724
3741
|
return;
|
|
3725
3742
|
}
|
|
3726
|
-
const
|
|
3743
|
+
const re = D;
|
|
3727
3744
|
if (p.saveUndo(), g)
|
|
3728
|
-
for (let
|
|
3729
|
-
e.rowHeights.value[
|
|
3745
|
+
for (let ue = u.startRow; ue <= u.endRow; ue++)
|
|
3746
|
+
e.rowHeights.value[ue] = re;
|
|
3730
3747
|
else
|
|
3731
|
-
for (let
|
|
3732
|
-
e.colWidths.value[
|
|
3733
|
-
v(), o.emitModelData(),
|
|
3748
|
+
for (let ue = u.startCol; ue <= u.endCol; ue++)
|
|
3749
|
+
e.colWidths.value[ue] = re;
|
|
3750
|
+
v(), o.emitModelData(), _e();
|
|
3734
3751
|
}
|
|
3735
|
-
function
|
|
3736
|
-
|
|
3752
|
+
function _e() {
|
|
3753
|
+
ce(), E.value = null;
|
|
3737
3754
|
}
|
|
3738
|
-
const
|
|
3755
|
+
const B = se(() => {
|
|
3739
3756
|
var ul;
|
|
3740
|
-
const t = !e.editingCell.value, u = e.editingCell.value ?? e.activeCell.value,
|
|
3757
|
+
const t = !e.editingCell.value, u = e.editingCell.value ?? e.activeCell.value, M = u.col, D = u.row, g = (ul = e.cells[e.cellKey(M, D)]) == null ? void 0 : ul.style, T = e.cellFontSize(M, D), _ = typeof (g == null ? void 0 : g.fontFamily) == "string" && g.fontFamily ? g.fontFamily : Sl, re = (g == null ? void 0 : g.fontWeight) === "bold" ? "bold" : "normal", ue = (g == null ? void 0 : g.fontStyle) === "italic" ? "italic" : "normal", Ee = (g == null ? void 0 : g.underline) === "underline" ? "underline" : (g == null ? void 0 : g.strikethrough) === "line-through" ? "line-through" : "none", ct = (g == null ? void 0 : g.underline) === "underline" && (g == null ? void 0 : g.strikethrough) === "line-through" ? "underline line-through" : Ee, lt = typeof (g == null ? void 0 : g.color) == "string" ? g.color : void 0, Vt = typeof (g == null ? void 0 : g.backgroundColor) == "string" ? g.backgroundColor : void 0, Et = typeof (g == null ? void 0 : g.textAlign) == "string" ? g.textAlign : "left", yt = typeof (g == null ? void 0 : g.verticalAlign) == "string" ? g.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(`
|
|
3741
3758
|
`).length : 1) * il, cl = e.BASE_CELL_VPAD - Cl;
|
|
3742
|
-
let
|
|
3743
|
-
return yt === "middle" ? (
|
|
3744
|
-
left: `${
|
|
3745
|
-
top: `${
|
|
3759
|
+
let St = 0, Ft = 0;
|
|
3760
|
+
return yt === "middle" ? (St = Math.floor((ft - Ot) / 2), Ft = Math.max(0, ft - Ot - St)) : yt === "top" ? (St = cl, Ft = Math.max(0, ft - Ot - St)) : yt === "bottom" && (Ft = cl, St = Math.max(0, ft - Ot - Ft)), {
|
|
3761
|
+
left: `${Re + e.colPositions.value[M] - e.scrollX.value}px`,
|
|
3762
|
+
top: `${Se + e.rowPositions.value[D] - e.scrollY.value}px`,
|
|
3746
3763
|
width: `${Pt}px`,
|
|
3747
3764
|
height: `${ft}px`,
|
|
3748
|
-
fontFamily:
|
|
3749
|
-
fontSize: `${
|
|
3765
|
+
fontFamily: _,
|
|
3766
|
+
fontSize: `${T}px`,
|
|
3750
3767
|
lineHeight: 1,
|
|
3751
|
-
fontWeight:
|
|
3752
|
-
fontStyle:
|
|
3768
|
+
fontWeight: re,
|
|
3769
|
+
fontStyle: ue,
|
|
3753
3770
|
textDecoration: ct,
|
|
3754
3771
|
textAlign: Et,
|
|
3755
|
-
paddingTop: `${
|
|
3772
|
+
paddingTop: `${St}px`,
|
|
3756
3773
|
paddingRight: "3px",
|
|
3757
3774
|
paddingBottom: `${Ft}px`,
|
|
3758
3775
|
paddingLeft: "3px",
|
|
@@ -3766,94 +3783,94 @@ function kr(e, p, h, o, s) {
|
|
|
3766
3783
|
};
|
|
3767
3784
|
});
|
|
3768
3785
|
function O() {
|
|
3769
|
-
return Math.max(0, o.viewSize.w -
|
|
3786
|
+
return Math.max(0, o.viewSize.w - Re - el);
|
|
3770
3787
|
}
|
|
3771
3788
|
function P() {
|
|
3772
|
-
return Math.max(0, o.viewSize.h -
|
|
3789
|
+
return Math.max(0, o.viewSize.h - Se - el);
|
|
3773
3790
|
}
|
|
3774
|
-
const
|
|
3775
|
-
let
|
|
3791
|
+
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, Bt = 0;
|
|
3776
3793
|
function ol(t) {
|
|
3777
|
-
t.preventDefault(),
|
|
3794
|
+
t.preventDefault(), tt = "v", st = t.clientY, Bt = e.scrollY.value, document.addEventListener("mousemove", x), document.addEventListener("mouseup", R);
|
|
3778
3795
|
}
|
|
3779
3796
|
function rt(t) {
|
|
3780
|
-
t.preventDefault(),
|
|
3797
|
+
t.preventDefault(), tt = "h", st = t.clientX, Bt = e.scrollX.value, document.addEventListener("mousemove", x), document.addEventListener("mouseup", R);
|
|
3781
3798
|
}
|
|
3782
3799
|
function x(t) {
|
|
3783
|
-
if (
|
|
3784
|
-
const
|
|
3785
|
-
o.clampScroll(null, Bt +
|
|
3786
|
-
} else if (
|
|
3787
|
-
const
|
|
3788
|
-
o.clampScroll(Bt +
|
|
3800
|
+
if (tt === "v") {
|
|
3801
|
+
const M = (t.clientY - st) / (ve.value - gt.value);
|
|
3802
|
+
o.clampScroll(null, Bt + M * o.maxScrollY.value), v();
|
|
3803
|
+
} else if (tt === "h") {
|
|
3804
|
+
const M = (t.clientX - st) / (N.value - Fe.value);
|
|
3805
|
+
o.clampScroll(Bt + M * o.maxScrollX.value, null), v();
|
|
3789
3806
|
}
|
|
3790
3807
|
}
|
|
3791
|
-
function
|
|
3792
|
-
|
|
3808
|
+
function R() {
|
|
3809
|
+
tt = null, document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", R);
|
|
3793
3810
|
}
|
|
3794
|
-
function
|
|
3795
|
-
if (
|
|
3811
|
+
function S(t) {
|
|
3812
|
+
if (tt)
|
|
3796
3813
|
return;
|
|
3797
|
-
const u = t.currentTarget.getBoundingClientRect(),
|
|
3798
|
-
|
|
3814
|
+
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()), v();
|
|
3799
3816
|
}
|
|
3800
3817
|
function G(t) {
|
|
3801
|
-
if (
|
|
3818
|
+
if (tt)
|
|
3802
3819
|
return;
|
|
3803
|
-
const u = t.currentTarget.getBoundingClientRect(),
|
|
3804
|
-
|
|
3820
|
+
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), v();
|
|
3805
3822
|
}
|
|
3806
|
-
let Z = !1,
|
|
3823
|
+
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;
|
|
3807
3824
|
function hl(t) {
|
|
3808
3825
|
if (t.button !== 0)
|
|
3809
3826
|
return;
|
|
3810
3827
|
t.preventDefault(), Be.value = null;
|
|
3811
3828
|
const u = zt(t, o.canvasRef.value);
|
|
3812
|
-
if (u.y <
|
|
3813
|
-
const g = u.x -
|
|
3814
|
-
if (
|
|
3815
|
-
p.saveUndo(), i = !0, H =
|
|
3829
|
+
if (u.y < Se && u.x >= Re) {
|
|
3830
|
+
const g = u.x - Re + e.scrollX.value, T = e.hitCol(g);
|
|
3831
|
+
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 = g, v();
|
|
3816
3833
|
return;
|
|
3817
3834
|
}
|
|
3818
3835
|
}
|
|
3819
|
-
if (u.x <
|
|
3820
|
-
const g = u.y -
|
|
3821
|
-
if (
|
|
3822
|
-
p.saveUndo(), C = !0, K =
|
|
3836
|
+
if (u.x < Re && u.y >= Se) {
|
|
3837
|
+
const g = u.y - Se + e.scrollY.value, T = e.hitRow(g);
|
|
3838
|
+
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 = g, v();
|
|
3823
3840
|
return;
|
|
3824
3841
|
}
|
|
3825
3842
|
}
|
|
3826
|
-
if (u.x <
|
|
3827
|
-
if (e.commitEdit(), u.y <
|
|
3828
|
-
const g = e.hitCol(u.x -
|
|
3829
|
-
g >= 0 && (e.selectRange(g, 0, g, e.rowCount - 1), Z = !0,
|
|
3830
|
-
} else if (u.x <
|
|
3831
|
-
const g = e.hitRow(u.y -
|
|
3832
|
-
g >= 0 && (e.selectRange(0, g, e.colCount - 1, g), Z = !0,
|
|
3843
|
+
if (u.x < Re || u.y < Se) {
|
|
3844
|
+
if (e.commitEdit(), u.y < Se && u.x >= Re) {
|
|
3845
|
+
const g = e.hitCol(u.x - Re + e.scrollX.value);
|
|
3846
|
+
g >= 0 && (e.selectRange(g, 0, g, e.rowCount - 1), Z = !0, ie = g, ge = 0);
|
|
3847
|
+
} else if (u.x < Re && u.y >= Se) {
|
|
3848
|
+
const g = e.hitRow(u.y - Se + e.scrollY.value);
|
|
3849
|
+
g >= 0 && (e.selectRange(0, g, e.colCount - 1, g), Z = !0, ie = 0, ge = g);
|
|
3833
3850
|
} else
|
|
3834
|
-
u.x <
|
|
3851
|
+
u.x < Re && u.y < Se && e.selectAll();
|
|
3835
3852
|
v();
|
|
3836
3853
|
return;
|
|
3837
3854
|
}
|
|
3838
|
-
const
|
|
3839
|
-
if (!(
|
|
3855
|
+
const M = e.hitCol(u.x - Re + e.scrollX.value), D = e.hitRow(u.y - Se + e.scrollY.value);
|
|
3856
|
+
if (!(M < 0 || D < 0)) {
|
|
3840
3857
|
if (e.commitEdit(), t.shiftKey && e.selection.value) {
|
|
3841
3858
|
const g = e.selection.value;
|
|
3842
|
-
e.selectRange(g.startCol, g.startRow,
|
|
3859
|
+
e.selectRange(g.startCol, g.startRow, M, D);
|
|
3843
3860
|
} else
|
|
3844
|
-
e.selectCell(
|
|
3845
|
-
Z = !0,
|
|
3861
|
+
e.selectCell(M, D);
|
|
3862
|
+
Z = !0, ie = M, ge = D, o.focusEditInput(), v();
|
|
3846
3863
|
}
|
|
3847
3864
|
}
|
|
3848
3865
|
function bl(t) {
|
|
3849
3866
|
if (i) {
|
|
3850
|
-
const
|
|
3851
|
-
|
|
3867
|
+
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, v();
|
|
3852
3869
|
return;
|
|
3853
3870
|
}
|
|
3854
3871
|
if (C) {
|
|
3855
|
-
const
|
|
3856
|
-
|
|
3872
|
+
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, v();
|
|
3857
3874
|
return;
|
|
3858
3875
|
}
|
|
3859
3876
|
if (!Z) {
|
|
@@ -3864,17 +3881,17 @@ function kr(e, p, h, o, s) {
|
|
|
3864
3881
|
g.style.cursor = "copy";
|
|
3865
3882
|
return;
|
|
3866
3883
|
}
|
|
3867
|
-
const
|
|
3868
|
-
if (
|
|
3869
|
-
const
|
|
3870
|
-
if (
|
|
3884
|
+
const T = zt(t, g);
|
|
3885
|
+
if (T.y < Se && T.x >= Re) {
|
|
3886
|
+
const _ = e.hitCol(T.x - Re + e.scrollX.value);
|
|
3887
|
+
if (_ >= 0 && Math.abs(T.x - (Re + e.colPositions.value[_ + 1] - e.scrollX.value)) <= 4) {
|
|
3871
3888
|
g.style.cursor = "col-resize";
|
|
3872
3889
|
return;
|
|
3873
3890
|
}
|
|
3874
3891
|
}
|
|
3875
|
-
if (
|
|
3876
|
-
const
|
|
3877
|
-
if (
|
|
3892
|
+
if (T.x < Re && T.y >= Se) {
|
|
3893
|
+
const _ = e.hitRow(T.y - Se + e.scrollY.value);
|
|
3894
|
+
if (_ >= 0 && Math.abs(T.y - (Se + e.rowPositions.value[_ + 1] - e.scrollY.value)) <= 4) {
|
|
3878
3895
|
g.style.cursor = "row-resize";
|
|
3879
3896
|
return;
|
|
3880
3897
|
}
|
|
@@ -3883,21 +3900,21 @@ function kr(e, p, h, o, s) {
|
|
|
3883
3900
|
return;
|
|
3884
3901
|
}
|
|
3885
3902
|
const u = zt(t, o.canvasRef.value);
|
|
3886
|
-
if (
|
|
3903
|
+
if (ie < 0 || ge < 0)
|
|
3887
3904
|
return;
|
|
3888
|
-
if (u.x <
|
|
3889
|
-
if (u.y <
|
|
3890
|
-
const g = e.hitCol(u.x -
|
|
3891
|
-
g >= 0 && e.selectRange(Math.min(
|
|
3892
|
-
} else if (u.x <
|
|
3893
|
-
const g = e.hitRow(u.y -
|
|
3905
|
+
if (u.x < Re || u.y < Se) {
|
|
3906
|
+
if (u.y < Se && u.x >= Re) {
|
|
3907
|
+
const g = e.hitCol(u.x - Re + e.scrollX.value);
|
|
3908
|
+
g >= 0 && e.selectRange(Math.min(ie, g), 0, Math.max(ie, g), e.rowCount - 1);
|
|
3909
|
+
} else if (u.x < Re && u.y >= Se) {
|
|
3910
|
+
const g = e.hitRow(u.y - Se + e.scrollY.value);
|
|
3894
3911
|
g >= 0 && e.selectRange(0, Math.min(ge, g), e.colCount - 1, Math.max(ge, g));
|
|
3895
3912
|
}
|
|
3896
3913
|
v();
|
|
3897
3914
|
return;
|
|
3898
3915
|
}
|
|
3899
|
-
const
|
|
3900
|
-
|
|
3916
|
+
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), v());
|
|
3901
3918
|
}
|
|
3902
3919
|
function Bl(t) {
|
|
3903
3920
|
const u = i || C;
|
|
@@ -3910,31 +3927,31 @@ function kr(e, p, h, o, s) {
|
|
|
3910
3927
|
function Nt(t) {
|
|
3911
3928
|
t.preventDefault();
|
|
3912
3929
|
const u = zt(t, o.canvasRef.value);
|
|
3913
|
-
if (u.x <
|
|
3930
|
+
if (u.x < Re && u.y < Se) {
|
|
3914
3931
|
d(t);
|
|
3915
3932
|
return;
|
|
3916
3933
|
}
|
|
3917
|
-
if (u.y <
|
|
3918
|
-
const
|
|
3919
|
-
|
|
3934
|
+
if (u.y < Se && u.x >= Re) {
|
|
3935
|
+
const M = e.hitCol(u.x - Re + e.scrollX.value);
|
|
3936
|
+
M >= 0 && l(t, M);
|
|
3920
3937
|
return;
|
|
3921
3938
|
}
|
|
3922
|
-
if (u.x <
|
|
3923
|
-
const
|
|
3924
|
-
|
|
3939
|
+
if (u.x < Re && u.y >= Se) {
|
|
3940
|
+
const M = e.hitRow(u.y - Se + e.scrollY.value);
|
|
3941
|
+
M >= 0 && w(t, M);
|
|
3925
3942
|
return;
|
|
3926
3943
|
}
|
|
3927
|
-
if (u.x >=
|
|
3928
|
-
const
|
|
3929
|
-
|
|
3944
|
+
if (u.x >= Re && u.y >= Se) {
|
|
3945
|
+
const M = e.hitCol(u.x - Re + e.scrollX.value), D = e.hitRow(u.y - Se + e.scrollY.value);
|
|
3946
|
+
M >= 0 && D >= 0 && r(t, M, D);
|
|
3930
3947
|
}
|
|
3931
3948
|
}
|
|
3932
3949
|
function rl(t) {
|
|
3933
3950
|
const u = zt(t, o.canvasRef.value);
|
|
3934
|
-
if (u.x <
|
|
3951
|
+
if (u.x < Re || u.y < Se)
|
|
3935
3952
|
return;
|
|
3936
|
-
const
|
|
3937
|
-
|
|
3953
|
+
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(), v(), o.focusEditInput());
|
|
3938
3955
|
}
|
|
3939
3956
|
function Kl(t) {
|
|
3940
3957
|
o.clampScroll(e.scrollX.value + t.deltaX, e.scrollY.value + t.deltaY), v();
|
|
@@ -3944,23 +3961,23 @@ function kr(e, p, h, o, s) {
|
|
|
3944
3961
|
Ue = !1;
|
|
3945
3962
|
return;
|
|
3946
3963
|
}
|
|
3947
|
-
const u = t.touches[0],
|
|
3948
|
-
if (!
|
|
3964
|
+
const u = t.touches[0], M = o.canvasRef.value;
|
|
3965
|
+
if (!M)
|
|
3949
3966
|
return;
|
|
3950
|
-
const
|
|
3951
|
-
g >=
|
|
3967
|
+
const D = M.getBoundingClientRect(), g = u.clientX - D.left, T = u.clientY - D.top;
|
|
3968
|
+
g >= Re && T >= Se && (t.preventDefault(), Ue = !0, et = !1, Q = g, me = T, Te = e.scrollX.value, Ze = e.scrollY.value, at = e.hitCol(g - Re + e.scrollX.value), mt = e.hitRow(T - Se + e.scrollY.value));
|
|
3952
3969
|
}
|
|
3953
3970
|
function eo(t) {
|
|
3954
3971
|
if (!Ue || t.touches.length !== 1)
|
|
3955
3972
|
return;
|
|
3956
|
-
const u = t.touches[0],
|
|
3957
|
-
if (!
|
|
3973
|
+
const u = t.touches[0], M = o.canvasRef.value;
|
|
3974
|
+
if (!M)
|
|
3958
3975
|
return;
|
|
3959
|
-
const
|
|
3960
|
-
(Math.abs(g -
|
|
3976
|
+
const D = M.getBoundingClientRect(), g = u.clientX - D.left, T = u.clientY - D.top;
|
|
3977
|
+
(Math.abs(g - Q) > 8 || Math.abs(T - me) > 8) && (et = !0, t.preventDefault(), o.clampScroll(Te + (Q - g), Ze + (me - T)), v());
|
|
3961
3978
|
}
|
|
3962
3979
|
function to() {
|
|
3963
|
-
if (Ue && (Ue = !1, !
|
|
3980
|
+
if (Ue && (Ue = !1, !et && at >= 0 && mt >= 0)) {
|
|
3964
3981
|
const t = Date.now();
|
|
3965
3982
|
at === ml && mt === pl && t - nl < 300 ? (e.selectCell(at, mt), e.startEdit(), v(), o.focusEditInput(), nl = 0) : (e.commitEdit(), e.selectCell(at, mt), v(), nl = t), ml = at, pl = mt, o.focusEditInput();
|
|
3966
3983
|
}
|
|
@@ -3974,7 +3991,7 @@ function kr(e, p, h, o, s) {
|
|
|
3974
3991
|
function Vl(t) {
|
|
3975
3992
|
if (e.editingCell.value)
|
|
3976
3993
|
return;
|
|
3977
|
-
const u = t.ctrlKey || t.metaKey,
|
|
3994
|
+
const u = t.ctrlKey || t.metaKey, M = t.shiftKey;
|
|
3978
3995
|
switch (!0) {
|
|
3979
3996
|
case (u && (t.key === "c" || t.key === "C")):
|
|
3980
3997
|
t.preventDefault(), h.copyToClipboard();
|
|
@@ -3990,7 +4007,7 @@ function kr(e, p, h, o, s) {
|
|
|
3990
4007
|
return;
|
|
3991
4008
|
case (u && (t.key === "v" || t.key === "V")):
|
|
3992
4009
|
t.preventDefault(), p.saveUndo(), h.pasteFromClipboard().then(() => {
|
|
3993
|
-
v(),
|
|
4010
|
+
v(), $e(() => o.emitModelData());
|
|
3994
4011
|
});
|
|
3995
4012
|
return;
|
|
3996
4013
|
case (u && (t.key === "a" || t.key === "A")):
|
|
@@ -4021,10 +4038,10 @@ function kr(e, p, h, o, s) {
|
|
|
4021
4038
|
t.preventDefault(), e.moveActive(1, 0), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), v();
|
|
4022
4039
|
return;
|
|
4023
4040
|
case t.key === "Tab":
|
|
4024
|
-
t.preventDefault(), e.moveActive(
|
|
4041
|
+
t.preventDefault(), e.moveActive(M ? -1 : 1, 0), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), v();
|
|
4025
4042
|
return;
|
|
4026
4043
|
case t.key === "Enter":
|
|
4027
|
-
t.preventDefault(), e.moveActive(0,
|
|
4044
|
+
t.preventDefault(), e.moveActive(0, M ? -1 : 1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), v();
|
|
4028
4045
|
return;
|
|
4029
4046
|
case t.key === "F2":
|
|
4030
4047
|
t.preventDefault(), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(), v(), o.focusEditInput();
|
|
@@ -4041,9 +4058,9 @@ function kr(e, p, h, o, s) {
|
|
|
4041
4058
|
e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(""), v(), o.focusEditInput();
|
|
4042
4059
|
return;
|
|
4043
4060
|
}
|
|
4044
|
-
t.preventDefault(), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(t.key), v(),
|
|
4045
|
-
const
|
|
4046
|
-
|
|
4061
|
+
t.preventDefault(), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), e.startEdit(t.key), v(), $e(() => {
|
|
4062
|
+
const D = o.editInputRef.value;
|
|
4063
|
+
D && (D.focus(), D.setSelectionRange(1, 1));
|
|
4047
4064
|
});
|
|
4048
4065
|
return;
|
|
4049
4066
|
}
|
|
@@ -4078,9 +4095,9 @@ function kr(e, p, h, o, s) {
|
|
|
4078
4095
|
const u = o.editInputRef.value;
|
|
4079
4096
|
if (!u)
|
|
4080
4097
|
return;
|
|
4081
|
-
const
|
|
4082
|
-
` + g.slice(
|
|
4083
|
-
e.editValue.value =
|
|
4098
|
+
const M = u.selectionStart ?? u.value.length, D = u.selectionEnd ?? u.value.length, g = u.value, T = g.slice(0, M) + `
|
|
4099
|
+
` + g.slice(D);
|
|
4100
|
+
e.editValue.value = T, u.value = T, u.selectionStart = u.selectionEnd = M + 1, v();
|
|
4084
4101
|
} else
|
|
4085
4102
|
t.key === "Enter" ? (t.preventDefault(), e.commitEdit(), e.moveActive(0, 1), e.ensureVisible(e.activeCell.value.col, e.activeCell.value.row), v(), 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), v(), o.focusEditInput()) : t.key === "Escape" && (t.preventDefault(), e.cancelEdit(), v(), o.focusEditInput());
|
|
4086
4103
|
}
|
|
@@ -4097,64 +4114,67 @@ function kr(e, p, h, o, s) {
|
|
|
4097
4114
|
var u;
|
|
4098
4115
|
const t = (u = o.wrapperRef.value) == null ? void 0 : u.getBoundingClientRect();
|
|
4099
4116
|
if (t) {
|
|
4100
|
-
const
|
|
4101
|
-
|
|
4117
|
+
const M = Ht(e.props.width), D = Ht(e.props.height);
|
|
4118
|
+
M != null ? o.viewSize.w = M : o.viewSize.w = t.width, D != null ? o.viewSize.h = D : o.viewSize.h = t.height;
|
|
4102
4119
|
}
|
|
4103
4120
|
o.clampScroll(null, null), v();
|
|
4104
4121
|
}
|
|
4105
4122
|
function co() {
|
|
4106
4123
|
Il(() => {
|
|
4107
4124
|
const t = Ht(e.props.width), u = Ht(e.props.height);
|
|
4108
|
-
(t == null || u == null) && (dt = new ResizeObserver(() => al()), o.wrapperRef.value && dt.observe(o.wrapperRef.value)),
|
|
4125
|
+
(t == null || u == null) && (dt = new ResizeObserver(() => al()), o.wrapperRef.value && dt.observe(o.wrapperRef.value)), $e(() => {
|
|
4109
4126
|
al(), o.focusEditInput();
|
|
4110
|
-
}), 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((
|
|
4111
|
-
const
|
|
4112
|
-
for (const [g,
|
|
4113
|
-
|
|
4114
|
-
if (
|
|
4115
|
-
for (const [g,
|
|
4116
|
-
const
|
|
4117
|
-
|
|
4127
|
+
}), 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
|
+
const D = o.mkSheet(M.name);
|
|
4129
|
+
for (const [g, T] of Object.entries(M.cells))
|
|
4130
|
+
D.cells[g] = { value: T.value, style: T.style ?? null };
|
|
4131
|
+
if (M.colWidths)
|
|
4132
|
+
for (const [g, T] of Object.entries(M.colWidths)) {
|
|
4133
|
+
const _ = Number(g);
|
|
4134
|
+
_ >= 0 && _ < e.colCount && T >= 30 && (D.colWidths[_] = T);
|
|
4118
4135
|
}
|
|
4119
|
-
if (
|
|
4120
|
-
for (const [g,
|
|
4121
|
-
const
|
|
4122
|
-
|
|
4136
|
+
if (M.rowHeights)
|
|
4137
|
+
for (const [g, T] of Object.entries(M.rowHeights)) {
|
|
4138
|
+
const _ = Number(g);
|
|
4139
|
+
_ >= 0 && _ < e.rowCount && T >= 24 && (D.rowHeights[_] = T);
|
|
4123
4140
|
}
|
|
4124
|
-
|
|
4141
|
+
if (M.merges)
|
|
4142
|
+
for (const [g, T] of Object.entries(M.merges))
|
|
4143
|
+
D.merges[g] = { ...T };
|
|
4144
|
+
return D;
|
|
4125
4145
|
}), o.sheets.value.length > 0 && o.loadSheet(0));
|
|
4126
4146
|
}), ut(() => [e.props.width, e.props.height], () => {
|
|
4127
4147
|
const t = Ht(e.props.width), u = Ht(e.props.height);
|
|
4128
|
-
t != null && u != null ? (dt == null || dt.disconnect(), dt = null) : !dt && o.wrapperRef.value && (dt = new ResizeObserver(() => al()), dt.observe(o.wrapperRef.value)),
|
|
4129
|
-
}), ut(() => e.props.theme, () => v()), ut(() => ({ ...e.cells }), () =>
|
|
4130
|
-
|
|
4131
|
-
}, { deep: !1 }), ut(o.activeSheetIndex, () =>
|
|
4148
|
+
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, () => v()), ut(() => ({ ...e.cells }), () => $e(() => o.emitModelData()), { deep: !1 }), ut(() => ({ ...e.merges }), () => {
|
|
4150
|
+
$e(() => o.emitModelData()), v();
|
|
4151
|
+
}, { deep: !1 }), ut(o.activeSheetIndex, () => $e(() => o.emitModelData())), ut(() => o.modelData.value, (t) => {
|
|
4132
4152
|
if (!t || t.length === 0)
|
|
4133
4153
|
return;
|
|
4134
4154
|
const u = JSON.stringify(t);
|
|
4135
4155
|
if (u === s.value)
|
|
4136
4156
|
return;
|
|
4137
4157
|
s.value = u;
|
|
4138
|
-
const
|
|
4158
|
+
const M = e.selection.value ? { ...e.selection.value } : null, D = { ...e.activeCell.value };
|
|
4139
4159
|
o.sheets.value = t.map((g) => {
|
|
4140
|
-
const
|
|
4141
|
-
for (const [
|
|
4142
|
-
|
|
4160
|
+
const T = o.mkSheet(g.name);
|
|
4161
|
+
for (const [_, re] of Object.entries(g.cells))
|
|
4162
|
+
T.cells[_] = { value: re.value, style: re.style ?? null };
|
|
4143
4163
|
if (g.colWidths)
|
|
4144
|
-
for (const [
|
|
4145
|
-
const
|
|
4146
|
-
|
|
4164
|
+
for (const [_, re] of Object.entries(g.colWidths)) {
|
|
4165
|
+
const ue = Number(_);
|
|
4166
|
+
ue >= 0 && ue < e.colCount && re >= 30 && (T.colWidths[ue] = re);
|
|
4147
4167
|
}
|
|
4148
4168
|
if (g.rowHeights)
|
|
4149
|
-
for (const [
|
|
4150
|
-
const
|
|
4151
|
-
|
|
4169
|
+
for (const [_, re] of Object.entries(g.rowHeights)) {
|
|
4170
|
+
const ue = Number(_);
|
|
4171
|
+
ue >= 0 && ue < e.rowCount && re >= 24 && (T.rowHeights[ue] = re);
|
|
4152
4172
|
}
|
|
4153
4173
|
if (g.merges)
|
|
4154
|
-
for (const [
|
|
4155
|
-
|
|
4156
|
-
return
|
|
4157
|
-
}), o.sheets.value.length > 0 && o.loadSheet(0),
|
|
4174
|
+
for (const [_, re] of Object.entries(g.merges))
|
|
4175
|
+
T.merges[_] = { ...re };
|
|
4176
|
+
return T;
|
|
4177
|
+
}), o.sheets.value.length > 0 && o.loadSheet(0), M && (e.selection.value = M), e.activeCell.value = D, v();
|
|
4158
4178
|
}, { deep: !0 }), ll(() => {
|
|
4159
4179
|
dt == null || dt.disconnect();
|
|
4160
4180
|
});
|
|
@@ -4163,49 +4183,49 @@ function kr(e, p, h, o, s) {
|
|
|
4163
4183
|
scheduleRender: v,
|
|
4164
4184
|
render: q,
|
|
4165
4185
|
activeCellLabel: y,
|
|
4166
|
-
formulaBarDisplay:
|
|
4186
|
+
formulaBarDisplay: ae,
|
|
4167
4187
|
onFormulaBarFocus: L,
|
|
4168
4188
|
onFormulaBarInput: f,
|
|
4169
4189
|
onFormulaBarKeydown: Ce,
|
|
4170
|
-
onFormulaBarBlur:
|
|
4190
|
+
onFormulaBarBlur: he,
|
|
4171
4191
|
renTab: De,
|
|
4172
4192
|
renTabVal: Y,
|
|
4173
4193
|
onTabClick: X,
|
|
4174
|
-
onTabDblClick:
|
|
4175
|
-
commitTabRename:
|
|
4194
|
+
onTabDblClick: be,
|
|
4195
|
+
commitTabRename: F,
|
|
4176
4196
|
cclTabRename: j,
|
|
4177
4197
|
onTabRenameKd: Me,
|
|
4178
4198
|
ctxMenu: Be,
|
|
4179
|
-
ctxSubmenuLeft:
|
|
4180
|
-
onCtxItemEnter:
|
|
4181
|
-
onTabCtxMenu:
|
|
4199
|
+
ctxSubmenuLeft: Ne,
|
|
4200
|
+
onCtxItemEnter: He,
|
|
4201
|
+
onTabCtxMenu: de,
|
|
4182
4202
|
onTabBarCtx: n,
|
|
4183
4203
|
onCornerCtx: d,
|
|
4184
4204
|
onRowHdrCtx: w,
|
|
4185
4205
|
onColHdrCtx: l,
|
|
4186
4206
|
onCellCtx: r,
|
|
4187
4207
|
dimInputRef: I,
|
|
4188
|
-
dimPanel:
|
|
4208
|
+
dimPanel: E,
|
|
4189
4209
|
openDimPanel: we,
|
|
4190
|
-
onDimInput:
|
|
4191
|
-
onDimKeydown:
|
|
4210
|
+
onDimInput: Oe,
|
|
4211
|
+
onDimKeydown: Ve,
|
|
4192
4212
|
onDimBlur: Xe,
|
|
4193
4213
|
applyDimPanel: ye,
|
|
4194
|
-
closeDimPanel:
|
|
4195
|
-
editInputStyle:
|
|
4196
|
-
hScrollbarW:
|
|
4197
|
-
vScrollbarH:
|
|
4214
|
+
closeDimPanel: _e,
|
|
4215
|
+
editInputStyle: B,
|
|
4216
|
+
hScrollbarW: ne,
|
|
4217
|
+
vScrollbarH: pe,
|
|
4198
4218
|
hTrackW: N,
|
|
4199
4219
|
vTrackH: ve,
|
|
4200
4220
|
hThumbW: Fe,
|
|
4201
|
-
hThumbL:
|
|
4221
|
+
hThumbL: Ke,
|
|
4202
4222
|
vThumbH: gt,
|
|
4203
4223
|
vThumbT: Ct,
|
|
4204
4224
|
onVStart: ol,
|
|
4205
4225
|
onHStart: rt,
|
|
4206
4226
|
onSbMove: x,
|
|
4207
|
-
onSbUp:
|
|
4208
|
-
onVTrk:
|
|
4227
|
+
onSbUp: R,
|
|
4228
|
+
onVTrk: S,
|
|
4209
4229
|
onHTrk: G,
|
|
4210
4230
|
onMouseDown: hl,
|
|
4211
4231
|
onMouseMove: bl,
|
|
@@ -4228,7 +4248,7 @@ function kr(e, p, h, o, s) {
|
|
|
4228
4248
|
setupLifecycle: co
|
|
4229
4249
|
};
|
|
4230
4250
|
}
|
|
4231
|
-
const xr = { class: "formula-bar" },
|
|
4251
|
+
const xr = { class: "formula-bar" }, Rr = { class: "formula-bar__cell-label" }, Sr = ["value"], Mr = ["value"], Br = {
|
|
4232
4252
|
key: 2,
|
|
4233
4253
|
class: "sb-corner"
|
|
4234
4254
|
}, Dr = ["onClick", "onMouseenter"], Fr = { class: "context-menu__label" }, Tr = {
|
|
@@ -4260,11 +4280,11 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4260
4280
|
activeSheetIndex: V(0),
|
|
4261
4281
|
saveSheet: () => {
|
|
4262
4282
|
},
|
|
4263
|
-
loadSheet: (
|
|
4283
|
+
loadSheet: (oe) => {
|
|
4264
4284
|
},
|
|
4265
|
-
mkSheet: (
|
|
4285
|
+
mkSheet: (oe) => ({
|
|
4266
4286
|
id: "",
|
|
4267
|
-
name:
|
|
4287
|
+
name: oe,
|
|
4268
4288
|
cells: {},
|
|
4269
4289
|
merges: {},
|
|
4270
4290
|
selection: null,
|
|
@@ -4285,46 +4305,46 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4285
4305
|
h
|
|
4286
4306
|
);
|
|
4287
4307
|
k.sheets = v.sheets, k.activeSheetIndex = v.activeSheetIndex, k.saveSheet = v.saveSheet, k.loadSheet = v.loadSheet, k.mkSheet = v.mkSheet;
|
|
4288
|
-
const
|
|
4308
|
+
const le = kr(
|
|
4289
4309
|
s,
|
|
4290
4310
|
a,
|
|
4291
4311
|
z,
|
|
4292
4312
|
v,
|
|
4293
4313
|
o
|
|
4294
4314
|
);
|
|
4295
|
-
|
|
4296
|
-
const q = Tt(s), y = Tt(a),
|
|
4297
|
-
function Ce(
|
|
4298
|
-
a.fontSizeMenuOpen.value =
|
|
4315
|
+
le.setupLifecycle();
|
|
4316
|
+
const q = Tt(s), y = Tt(a), ae = Tt(z), L = Tt(v), f = Tt(le);
|
|
4317
|
+
function Ce(oe) {
|
|
4318
|
+
a.fontSizeMenuOpen.value = oe;
|
|
4299
4319
|
}
|
|
4300
|
-
function
|
|
4301
|
-
a.textColorMenuOpen.value =
|
|
4320
|
+
function he(oe) {
|
|
4321
|
+
a.textColorMenuOpen.value = oe;
|
|
4302
4322
|
}
|
|
4303
|
-
function De(
|
|
4304
|
-
a.fillColorMenuOpen.value =
|
|
4323
|
+
function De(oe) {
|
|
4324
|
+
a.fillColorMenuOpen.value = oe;
|
|
4305
4325
|
}
|
|
4306
|
-
function Y(
|
|
4307
|
-
|
|
4326
|
+
function Y(oe) {
|
|
4327
|
+
le.renTabVal.value = oe;
|
|
4308
4328
|
}
|
|
4309
4329
|
function X() {
|
|
4310
|
-
|
|
4330
|
+
le.ctxMenu.value = null;
|
|
4311
4331
|
}
|
|
4312
|
-
const
|
|
4313
|
-
v.formulaBarRef.value =
|
|
4314
|
-
},
|
|
4315
|
-
v.wrapperRef.value =
|
|
4316
|
-
}, j = (
|
|
4317
|
-
v.canvasRef.value =
|
|
4318
|
-
}, Me = (
|
|
4319
|
-
v.editInputRef.value =
|
|
4320
|
-
}, Be = (
|
|
4321
|
-
|
|
4332
|
+
const be = (oe) => {
|
|
4333
|
+
v.formulaBarRef.value = oe;
|
|
4334
|
+
}, F = (oe) => {
|
|
4335
|
+
v.wrapperRef.value = oe;
|
|
4336
|
+
}, j = (oe) => {
|
|
4337
|
+
v.canvasRef.value = oe;
|
|
4338
|
+
}, Me = (oe) => {
|
|
4339
|
+
v.editInputRef.value = oe;
|
|
4340
|
+
}, Be = (oe) => {
|
|
4341
|
+
le.dimInputRef.value = oe;
|
|
4322
4342
|
};
|
|
4323
|
-
return (
|
|
4343
|
+
return (oe, c) => (W(), fe("div", {
|
|
4324
4344
|
class: "spreadsheet-outer",
|
|
4325
4345
|
style: nt(L.outerStyle)
|
|
4326
4346
|
}, [
|
|
4327
|
-
|
|
4347
|
+
Je(lr, {
|
|
4328
4348
|
locale: q.locale,
|
|
4329
4349
|
"can-undo": y.canUndo,
|
|
4330
4350
|
"can-redo": y.canRedo,
|
|
@@ -4346,14 +4366,14 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4346
4366
|
"fill-color-menu-open": y.fillColorMenuOpen,
|
|
4347
4367
|
"cached-text-color": y.cachedTextColor,
|
|
4348
4368
|
"cached-fill-color": y.cachedFillColor,
|
|
4349
|
-
"border-menu-open":
|
|
4350
|
-
"cached-border":
|
|
4369
|
+
"border-menu-open": ae.borderMenuOpen,
|
|
4370
|
+
"cached-border": ae.cachedBorder,
|
|
4351
4371
|
"h-align-options": y.hAlignOptions,
|
|
4352
4372
|
"v-align-options": y.vAlignOptions,
|
|
4353
4373
|
"sel-h-align": y.selHAlign,
|
|
4354
4374
|
"sel-v-align": y.selVAlign,
|
|
4355
4375
|
"sel-wrap": y.selWrap,
|
|
4356
|
-
"merge-menu-open":
|
|
4376
|
+
"merge-menu-open": ae.mergeMenuOpen,
|
|
4357
4377
|
"theme-vars": L.toolbarThemeVars,
|
|
4358
4378
|
onUndo: c[0] || (c[0] = (m) => y.undo()),
|
|
4359
4379
|
onRedo: c[1] || (c[1] = (m) => y.redo()),
|
|
@@ -4373,25 +4393,25 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4373
4393
|
onUnderlineToggle: y.toggleUnderline,
|
|
4374
4394
|
onStrikethroughToggle: y.toggleStrikethrough,
|
|
4375
4395
|
onTextColorChange: c[9] || (c[9] = (m) => y.onTextColorChange(m)),
|
|
4376
|
-
"onUpdate:textColorMenuOpen": c[10] || (c[10] = (m) =>
|
|
4396
|
+
"onUpdate:textColorMenuOpen": c[10] || (c[10] = (m) => he(m)),
|
|
4377
4397
|
onFillColorChange: c[11] || (c[11] = (m) => y.onFillColorChange(m)),
|
|
4378
4398
|
"onUpdate:fillColorMenuOpen": c[12] || (c[12] = (m) => De(m)),
|
|
4379
4399
|
onApplyTextColor: y.applyCachedTextColor,
|
|
4380
4400
|
onApplyFillColor: y.applyCachedFillColor,
|
|
4381
4401
|
"onUpdate:borderMenuOpen": c[13] || (c[13] = (m) => y.onBorderMenuToggle(m)),
|
|
4382
|
-
onBorderChange: c[14] || (c[14] = (m) =>
|
|
4383
|
-
onApplyBorder:
|
|
4402
|
+
onBorderChange: c[14] || (c[14] = (m) => ae.onBorderChange(m)),
|
|
4403
|
+
onApplyBorder: ae.applyCachedBorder,
|
|
4384
4404
|
onHAlignChange: c[15] || (c[15] = (m) => y.onHAlignChange(m)),
|
|
4385
4405
|
onVAlignChange: c[16] || (c[16] = (m) => y.onVAlignChange(m)),
|
|
4386
4406
|
onWrapToggle: y.onWrapToggle,
|
|
4387
|
-
"onUpdate:mergeMenuOpen": c[17] || (c[17] = (m) =>
|
|
4388
|
-
onMergeChange: c[18] || (c[18] = (m) =>
|
|
4389
|
-
onApplyMerge:
|
|
4407
|
+
"onUpdate:mergeMenuOpen": c[17] || (c[17] = (m) => ae.onMergeMenuToggle(m)),
|
|
4408
|
+
onMergeChange: c[18] || (c[18] = (m) => ae.onMergeChange(m)),
|
|
4409
|
+
onApplyMerge: ae.onApplyMerge
|
|
4390
4410
|
}, 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"]),
|
|
4391
4411
|
b("div", xr, [
|
|
4392
|
-
b("div",
|
|
4412
|
+
b("div", Rr, xt(f.activeCellLabel), 1),
|
|
4393
4413
|
b("input", {
|
|
4394
|
-
ref:
|
|
4414
|
+
ref: be,
|
|
4395
4415
|
class: "formula-bar__input",
|
|
4396
4416
|
value: f.formulaBarDisplay,
|
|
4397
4417
|
onFocus: c[19] || (c[19] = //@ts-ignore
|
|
@@ -4402,10 +4422,10 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4402
4422
|
(...m) => f.onFormulaBarKeydown && f.onFormulaBarKeydown(...m)),
|
|
4403
4423
|
onBlur: c[22] || (c[22] = //@ts-ignore
|
|
4404
4424
|
(...m) => f.onFormulaBarBlur && f.onFormulaBarBlur(...m))
|
|
4405
|
-
}, null, 40,
|
|
4425
|
+
}, null, 40, Sr)
|
|
4406
4426
|
]),
|
|
4407
4427
|
b("div", {
|
|
4408
|
-
ref:
|
|
4428
|
+
ref: F,
|
|
4409
4429
|
class: "spreadsheet-wrapper"
|
|
4410
4430
|
}, [
|
|
4411
4431
|
b("canvas", {
|
|
@@ -4464,10 +4484,10 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4464
4484
|
onPaste: c[40] || (c[40] = //@ts-ignore
|
|
4465
4485
|
(...m) => f.onEditPaste && f.onEditPaste(...m))
|
|
4466
4486
|
}, null, 44, Mr),
|
|
4467
|
-
L.maxScrollY > 0 ? (W(),
|
|
4487
|
+
L.maxScrollY > 0 ? (W(), fe("div", {
|
|
4468
4488
|
key: 0,
|
|
4469
4489
|
class: "v-scrollbar",
|
|
4470
|
-
style: nt({ top: ke(
|
|
4490
|
+
style: nt({ top: ke(Se) + "px", height: `calc(100% - ${ke(Se) + ke(el)}px)` })
|
|
4471
4491
|
}, [
|
|
4472
4492
|
b("button", {
|
|
4473
4493
|
class: "sb-btn sb-btn--up",
|
|
@@ -4498,11 +4518,11 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4498
4518
|
}, [...c[65] || (c[65] = [
|
|
4499
4519
|
b("span", { class: "sb-arrow sb-arrow--down" }, null, -1)
|
|
4500
4520
|
])], 32)
|
|
4501
|
-
], 4)) :
|
|
4502
|
-
L.maxScrollX > 0 ? (W(),
|
|
4521
|
+
], 4)) : Qe("", !0),
|
|
4522
|
+
L.maxScrollX > 0 ? (W(), fe("div", {
|
|
4503
4523
|
key: 1,
|
|
4504
4524
|
class: "h-scrollbar",
|
|
4505
|
-
style: nt({ left: ke(
|
|
4525
|
+
style: nt({ left: ke(Re) + "px", width: `calc(100% - ${ke(Re) + ke(el)}px)` })
|
|
4506
4526
|
}, [
|
|
4507
4527
|
b("button", {
|
|
4508
4528
|
class: "sb-btn sb-btn--left",
|
|
@@ -4532,10 +4552,10 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4532
4552
|
}, [...c[67] || (c[67] = [
|
|
4533
4553
|
b("span", { class: "sb-arrow sb-arrow--right" }, null, -1)
|
|
4534
4554
|
])], 32)
|
|
4535
|
-
], 4)) :
|
|
4536
|
-
L.maxScrollX > 0 && L.maxScrollY > 0 ? (W(),
|
|
4555
|
+
], 4)) : Qe("", !0),
|
|
4556
|
+
L.maxScrollX > 0 && L.maxScrollY > 0 ? (W(), fe("div", Br)) : Qe("", !0)
|
|
4537
4557
|
]),
|
|
4538
|
-
|
|
4558
|
+
Je(ur, {
|
|
4539
4559
|
locale: q.locale,
|
|
4540
4560
|
sheets: L.sheets,
|
|
4541
4561
|
"active-sheet-index": L.activeSheetIndex,
|
|
@@ -4552,44 +4572,44 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4552
4572
|
L.addSheet(), f.scheduleRender();
|
|
4553
4573
|
})
|
|
4554
4574
|
}, null, 8, ["locale", "sheets", "active-sheet-index", "ren-tab", "ren-tab-val", "onTabRenameCommit"]),
|
|
4555
|
-
(W(),
|
|
4556
|
-
|
|
4575
|
+
(W(), Ae(ze, { to: "body" }, [
|
|
4576
|
+
Je(Wt, { name: "menu-pop" }, {
|
|
4557
4577
|
default: It(() => [
|
|
4558
|
-
f.ctxMenu ? (W(),
|
|
4578
|
+
f.ctxMenu ? (W(), fe("div", {
|
|
4559
4579
|
key: 0,
|
|
4560
4580
|
class: "context-menu",
|
|
4561
4581
|
style: nt({ left: f.ctxMenu.x + "px", top: f.ctxMenu.y + "px" }),
|
|
4562
4582
|
onClick: c[56] || (c[56] = qe(() => {
|
|
4563
4583
|
}, ["stop"]))
|
|
4564
4584
|
}, [
|
|
4565
|
-
(W(!0),
|
|
4566
|
-
key:
|
|
4585
|
+
(W(!0), fe(bt, null, Rt(f.ctxMenu.items, (m, Ne) => (W(), fe("div", {
|
|
4586
|
+
key: Ne,
|
|
4567
4587
|
class: Pe(["context-menu__item", { "context-menu__item--disabled": m.disabled }]),
|
|
4568
|
-
onClick: (
|
|
4569
|
-
onMouseenter: (
|
|
4588
|
+
onClick: (He) => !m.disabled && m.action && (m.action(), X()),
|
|
4589
|
+
onMouseenter: (He) => f.onCtxItemEnter(He, m)
|
|
4570
4590
|
}, [
|
|
4571
4591
|
b("span", Fr, xt(m.label), 1),
|
|
4572
|
-
m.children ? (W(),
|
|
4573
|
-
m.children ? (W(),
|
|
4592
|
+
m.children ? (W(), fe("span", Tr)) : Qe("", !0),
|
|
4593
|
+
m.children ? (W(), fe("div", {
|
|
4574
4594
|
key: 1,
|
|
4575
4595
|
class: Pe(["context-submenu", { "context-submenu--left": f.ctxSubmenuLeft }])
|
|
4576
4596
|
}, [
|
|
4577
|
-
(W(!0),
|
|
4578
|
-
key:
|
|
4579
|
-
class: Pe(["context-menu__item", { "context-menu__item--disabled":
|
|
4580
|
-
onClick: qe((n) => !
|
|
4581
|
-
}, xt(
|
|
4582
|
-
], 2)) :
|
|
4597
|
+
(W(!0), fe(bt, null, Rt(m.children, (He, de) => (W(), fe("div", {
|
|
4598
|
+
key: de,
|
|
4599
|
+
class: Pe(["context-menu__item", { "context-menu__item--disabled": He.disabled }]),
|
|
4600
|
+
onClick: qe((n) => !He.disabled && He.action && (He.action(), X()), ["stop"])
|
|
4601
|
+
}, xt(He.label), 11, Er))), 128))
|
|
4602
|
+
], 2)) : Qe("", !0)
|
|
4583
4603
|
], 42, Dr))), 128))
|
|
4584
|
-
], 4)) :
|
|
4604
|
+
], 4)) : Qe("", !0)
|
|
4585
4605
|
]),
|
|
4586
4606
|
_: 1
|
|
4587
4607
|
})
|
|
4588
4608
|
])),
|
|
4589
|
-
(W(),
|
|
4590
|
-
|
|
4609
|
+
(W(), Ae(ze, { to: "body" }, [
|
|
4610
|
+
Je(Wt, { name: "menu-pop" }, {
|
|
4591
4611
|
default: It(() => [
|
|
4592
|
-
f.dimPanel ? (W(),
|
|
4612
|
+
f.dimPanel ? (W(), fe("div", {
|
|
4593
4613
|
key: 0,
|
|
4594
4614
|
class: "dim-panel",
|
|
4595
4615
|
style: nt({ left: f.dimPanel.x + "px", top: f.dimPanel.y + "px" }),
|
|
@@ -4617,7 +4637,7 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4617
4637
|
}, null, 42, Ar),
|
|
4618
4638
|
c[68] || (c[68] = b("span", { class: "dim-panel__unit" }, "px", -1))
|
|
4619
4639
|
]),
|
|
4620
|
-
f.dimPanel.error ? (W(),
|
|
4640
|
+
f.dimPanel.error ? (W(), fe("div", zr, xt(f.dimPanel.error), 1)) : Qe("", !0),
|
|
4621
4641
|
b("div", Hr, [
|
|
4622
4642
|
b("button", {
|
|
4623
4643
|
class: "dim-panel__btn dim-panel__btn--primary",
|
|
@@ -4630,7 +4650,7 @@ const xr = { class: "formula-bar" }, Sr = { class: "formula-bar__cell-label" },
|
|
|
4630
4650
|
(...m) => f.closeDimPanel && f.closeDimPanel(...m))
|
|
4631
4651
|
}, " 取消 ")
|
|
4632
4652
|
])
|
|
4633
|
-
], 36)) :
|
|
4653
|
+
], 36)) : Qe("", !0)
|
|
4634
4654
|
]),
|
|
4635
4655
|
_: 1
|
|
4636
4656
|
})
|