@univerjs/sheets-ui 0.8.0-nightly.202506031608 → 0.8.0-nightly.202506041607
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +8 -8
- package/lib/es/index.js +491 -495
- package/lib/index.js +491 -495
- package/lib/umd/index.js +8 -8
- package/package.json +12 -12
package/lib/index.js
CHANGED
|
@@ -353,7 +353,7 @@ class fC {
|
|
|
353
353
|
* @param moveOffsetY
|
|
354
354
|
*/
|
|
355
355
|
_controlMoving(e, t) {
|
|
356
|
-
var
|
|
356
|
+
var E;
|
|
357
357
|
const n = this._scene, i = n.getScrollXYInfoByViewport(Ve.FromArray([e, t])), { scaleX: o, scaleY: s } = n.getAncestorScale(), l = this._skeleton.getCellIndexByOffset(
|
|
358
358
|
e,
|
|
359
359
|
t,
|
|
@@ -369,11 +369,11 @@ class fC {
|
|
|
369
369
|
range: { startRow: h, endRow: g, startColumn: m, endColumn: f },
|
|
370
370
|
primary: v,
|
|
371
371
|
style: null
|
|
372
|
-
}, this._skeleton), _ = this._skeleton.getNoMergeCellWithCoordByIndex(h, m), S = this._skeleton.getNoMergeCellWithCoordByIndex(g, f), I = (_ == null ? void 0 : _.startY) || 0, R = (S == null ? void 0 : S.endY) || 0, y = (_ == null ? void 0 : _.startX) || 0,
|
|
373
|
-
(
|
|
372
|
+
}, this._skeleton), _ = this._skeleton.getNoMergeCellWithCoordByIndex(h, m), S = this._skeleton.getNoMergeCellWithCoordByIndex(g, f), I = (_ == null ? void 0 : _.startY) || 0, R = (S == null ? void 0 : S.endY) || 0, y = (_ == null ? void 0 : _.startX) || 0, M = (S == null ? void 0 : S.endX) || 0;
|
|
373
|
+
(E = this._helperSelection) == null || E.transformByState({
|
|
374
374
|
left: y,
|
|
375
375
|
top: I,
|
|
376
|
-
width:
|
|
376
|
+
width: M - y,
|
|
377
377
|
height: R - I
|
|
378
378
|
}), this._targetSelection = { ...C.rangeWithCoord }, this._control.selectionMoving$.next(C.rangeWithCoord);
|
|
379
379
|
}
|
|
@@ -404,24 +404,24 @@ class fC {
|
|
|
404
404
|
strokeWidth: S.strokeWidth / I
|
|
405
405
|
}), i.addObject(this._helperSelection));
|
|
406
406
|
const R = i.getViewport(U.VIEW_MAIN), y = Zr.create(i);
|
|
407
|
-
this._scrollTimer = y, y.startScroll(s, l, R), i.disableObjectsEvent(), this._scenePointerMoveSub = i.onPointerMove$.subscribeEvent((
|
|
407
|
+
this._scrollTimer = y, y.startScroll(s, l, R), i.disableObjectsEvent(), this._scenePointerMoveSub = i.onPointerMove$.subscribeEvent((M) => {
|
|
408
408
|
var O;
|
|
409
409
|
if (this._disabled)
|
|
410
410
|
return;
|
|
411
|
-
const { offsetX:
|
|
411
|
+
const { offsetX: E, offsetY: T } = M;
|
|
412
412
|
if (((O = this._injector.get(lt, uc.OPTIONAL)) == null ? void 0 : O.interceptor.fetchThroughInterceptors(Pc)(!1, null)) === !1)
|
|
413
413
|
return;
|
|
414
414
|
const { x: A, y: H } = i.getCoordRelativeToViewport(
|
|
415
|
-
Ve.FromArray([
|
|
415
|
+
Ve.FromArray([E, T])
|
|
416
416
|
);
|
|
417
417
|
this._controlMoving(A, H), i.setCursor(ye.MOVE), y.scrolling(A, H, () => {
|
|
418
418
|
this._controlMoving(A, H);
|
|
419
419
|
});
|
|
420
420
|
}), this._scenePointerUpSub = i.onPointerUp$.subscribeEvent(() => {
|
|
421
|
-
var
|
|
422
|
-
(
|
|
423
|
-
const
|
|
424
|
-
|
|
421
|
+
var E, T, P, A;
|
|
422
|
+
(E = this._helperSelection) == null || E.dispose();
|
|
423
|
+
const M = this._scene;
|
|
424
|
+
M.resetCursor(), this._clearObserverEvent(), M.enableObjectsEvent(), (T = this._scrollTimer) == null || T.dispose(), this._control.selectionMoveEnd$.next(this._targetSelection), (A = (P = this._selectionHooks).selectionMoveEnd) == null || A.call(P);
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
_initialWidget() {
|
|
@@ -555,7 +555,7 @@ class fC {
|
|
|
555
555
|
const H = this._fillRuler(a, g, f, this._relativeSelectionRowLength, u);
|
|
556
556
|
g = H.startRowOrColumn, f = H.endRowOrColumn, p = H.isLighten;
|
|
557
557
|
}
|
|
558
|
-
const _ = this._skeleton.getNoMergeCellWithCoordByIndex(g, m), S = this._skeleton.getNoMergeCellWithCoordByIndex(f, v), I = (_ == null ? void 0 : _.startY) || 0, R = (S == null ? void 0 : S.endY) || 0, y = (_ == null ? void 0 : _.startX) || 0,
|
|
558
|
+
const _ = this._skeleton.getNoMergeCellWithCoordByIndex(g, m), S = this._skeleton.getNoMergeCellWithCoordByIndex(f, v), I = (_ == null ? void 0 : _.startY) || 0, R = (S == null ? void 0 : S.endY) || 0, y = (_ == null ? void 0 : _.startX) || 0, M = (S == null ? void 0 : S.endX) || 0;
|
|
559
559
|
p ? this._controlHandler((H, O) => {
|
|
560
560
|
const V = new xn(this._fillControlColors[O]).lighten(mC).toRgbString();
|
|
561
561
|
H.setProps({
|
|
@@ -566,17 +566,17 @@ class fC {
|
|
|
566
566
|
fill: this._fillControlColors[O]
|
|
567
567
|
});
|
|
568
568
|
});
|
|
569
|
-
const
|
|
569
|
+
const E = Ms / this._getScale();
|
|
570
570
|
g === f && C === !0 || m === v && C === !1 ? (T = this._helperSelection) == null || T.hide() : ((P = this._helperSelection) == null || P.transformByState({
|
|
571
|
-
left: y -
|
|
572
|
-
top: I -
|
|
573
|
-
width:
|
|
571
|
+
left: y - E / 2,
|
|
572
|
+
top: I - E / 2,
|
|
573
|
+
width: M - y,
|
|
574
574
|
height: R - I
|
|
575
575
|
}), (A = this._helperSelection) == null || A.show()), this._targetSelection = {
|
|
576
576
|
startY: I,
|
|
577
577
|
endY: R,
|
|
578
578
|
startX: y,
|
|
579
|
-
endX:
|
|
579
|
+
endX: M,
|
|
580
580
|
startRow: g,
|
|
581
581
|
endRow: f,
|
|
582
582
|
startColumn: m,
|
|
@@ -612,7 +612,7 @@ class fC {
|
|
|
612
612
|
this._fillControlColors.push(I.fill);
|
|
613
613
|
}), this._scenePointerMoveSub = i.onPointerMove$.subscribeEvent((I) => {
|
|
614
614
|
var H;
|
|
615
|
-
const { offsetX: R, offsetY: y } = I,
|
|
615
|
+
const { offsetX: R, offsetY: y } = I, M = i.getActiveViewportByCoord(Ve.FromArray([R, y]));
|
|
616
616
|
if (!this._injector.get(lt).interceptor.fetchThroughInterceptors(xc)(!1, { x: e.offsetX, y: e.offsetY, skeleton: this._skeleton, scene: this._scene }))
|
|
617
617
|
return;
|
|
618
618
|
const { x: T, y: P } = i.getCoordRelativeToViewport(
|
|
@@ -620,7 +620,7 @@ class fC {
|
|
|
620
620
|
);
|
|
621
621
|
this._autoFillMoving(T, P), i.setCursor(ye.CROSSHAIR);
|
|
622
622
|
const A = this._targetSelection;
|
|
623
|
-
if (_ &&
|
|
623
|
+
if (_ && M && ((H = this._activeViewport) == null ? void 0 : H.viewportKey) !== (M == null ? void 0 : M.viewportKey)) {
|
|
624
624
|
let O;
|
|
625
625
|
A.startRow !== a ? (S.scrollTimerType = yt.Y, O = {
|
|
626
626
|
...A,
|
|
@@ -634,10 +634,10 @@ class fC {
|
|
|
634
634
|
}) : (S.scrollTimerType = yt.X, O = {
|
|
635
635
|
...A,
|
|
636
636
|
startColumn: A.endColumn
|
|
637
|
-
}), this._isSelectionInViewport(O,
|
|
637
|
+
}), this._isSelectionInViewport(O, M) && (_.scrollToBarPos({
|
|
638
638
|
x: S.scrollTimerType === yt.X ? 0 : void 0,
|
|
639
639
|
y: S.scrollTimerType === yt.Y ? 0 : void 0
|
|
640
|
-
}), this._activeViewport =
|
|
640
|
+
}), this._activeViewport = M);
|
|
641
641
|
}
|
|
642
642
|
S.scrolling(T, P, () => {
|
|
643
643
|
this._autoFillMoving(T, P);
|
|
@@ -646,9 +646,9 @@ class fC {
|
|
|
646
646
|
var R, y;
|
|
647
647
|
(R = this._helperSelection) == null || R.dispose();
|
|
648
648
|
const I = this._scene;
|
|
649
|
-
I.resetCursor(), this._clearObserverEvent(), I.enableObjectsEvent(), (y = this._scrollTimer) == null || y.dispose(), this._control.refreshSelectionFilled(this._targetSelection), this._isInMergeState = !1, this._controlHandler((
|
|
650
|
-
|
|
651
|
-
fill: this._fillControlColors[
|
|
649
|
+
I.resetCursor(), this._clearObserverEvent(), I.enableObjectsEvent(), (y = this._scrollTimer) == null || y.dispose(), this._control.refreshSelectionFilled(this._targetSelection), this._isInMergeState = !1, this._controlHandler((M, E) => {
|
|
650
|
+
M.setProps({
|
|
651
|
+
fill: this._fillControlColors[E]
|
|
652
652
|
});
|
|
653
653
|
}), this._fillControlColors = [];
|
|
654
654
|
});
|
|
@@ -1180,8 +1180,8 @@ class Vd extends oe {
|
|
|
1180
1180
|
}
|
|
1181
1181
|
// eslint-disable-next-line complexity
|
|
1182
1182
|
dispose() {
|
|
1183
|
-
var t, n, i, o, s, l, a, c, d, u, h, g, m, f, v, p, C, _, S, I, R, y,
|
|
1184
|
-
(t = this._leftBorder) == null || t.dispose(), (n = this._rightBorder) == null || n.dispose(), (i = this._topBorder) == null || i.dispose(), (o = this._bottomBorder) == null || o.dispose(), (s = this._backgroundControlTop) == null || s.dispose(), (l = this._backgroundControlMiddleLeft) == null || l.dispose(), (a = this._backgroundControlMiddleRight) == null || a.dispose(), (c = this._backgroundControlBottom) == null || c.dispose(), this._autoFillControl.dispose(), (d = this._selectionShapeGroup) == null || d.dispose(), (u = this._rowHeaderBackground) == null || u.dispose(), (h = this._rowHeaderBorder) == null || h.dispose(), (g = this._rowHeaderGroup) == null || g.dispose(), (m = this._rowHeaderBackground) == null || m.dispose(), (f = this._columnHeaderBackground) == null || f.dispose(), (v = this._columnHeaderBorder) == null || v.dispose(), (p = this._columnHeaderGroup) == null || p.dispose(), (C = this._topLeftWidget) == null || C.dispose(), (_ = this._topCenterWidget) == null || _.dispose(), (S = this._topRightWidget) == null || S.dispose(), (I = this._middleLeftWidget) == null || I.dispose(), (R = this._middleRightWidget) == null || R.dispose(), (y = this._bottomLeftWidget) == null || y.dispose(), (
|
|
1183
|
+
var t, n, i, o, s, l, a, c, d, u, h, g, m, f, v, p, C, _, S, I, R, y, M, E, T;
|
|
1184
|
+
(t = this._leftBorder) == null || t.dispose(), (n = this._rightBorder) == null || n.dispose(), (i = this._topBorder) == null || i.dispose(), (o = this._bottomBorder) == null || o.dispose(), (s = this._backgroundControlTop) == null || s.dispose(), (l = this._backgroundControlMiddleLeft) == null || l.dispose(), (a = this._backgroundControlMiddleRight) == null || a.dispose(), (c = this._backgroundControlBottom) == null || c.dispose(), this._autoFillControl.dispose(), (d = this._selectionShapeGroup) == null || d.dispose(), (u = this._rowHeaderBackground) == null || u.dispose(), (h = this._rowHeaderBorder) == null || h.dispose(), (g = this._rowHeaderGroup) == null || g.dispose(), (m = this._rowHeaderBackground) == null || m.dispose(), (f = this._columnHeaderBackground) == null || f.dispose(), (v = this._columnHeaderBorder) == null || v.dispose(), (p = this._columnHeaderGroup) == null || p.dispose(), (C = this._topLeftWidget) == null || C.dispose(), (_ = this._topCenterWidget) == null || _.dispose(), (S = this._topRightWidget) == null || S.dispose(), (I = this._middleLeftWidget) == null || I.dispose(), (R = this._middleRightWidget) == null || R.dispose(), (y = this._bottomLeftWidget) == null || y.dispose(), (M = this._bottomCenterWidget) == null || M.dispose(), (E = this._bottomRightWidget) == null || E.dispose(), (T = this._controlExtension) == null || T.dispose(), super.dispose(), this._dispose$.next(this), this._dispose$.complete();
|
|
1185
1185
|
}
|
|
1186
1186
|
/**
|
|
1187
1187
|
* Get the cell information of the current selection, considering the case of merging cells
|
|
@@ -1627,11 +1627,11 @@ class rm extends oe {
|
|
|
1627
1627
|
this._scrollTimer = Zr.create(this._scene, o), this._scrollTimer.startScroll((m = t == null ? void 0 : t.left) != null ? m : 0, (f = t == null ? void 0 : t.top) != null ? f : 0, t);
|
|
1628
1628
|
const h = this._scene, g = h.getActiveViewportByCoord(Ve.FromArray([s, l]));
|
|
1629
1629
|
this._scenePointerMoveSub = h.onPointerMove$.subscribeEvent((v) => {
|
|
1630
|
-
var A, H, O, V, W,
|
|
1630
|
+
var A, H, O, V, W, j, B, z, Z;
|
|
1631
1631
|
const { offsetX: p, offsetY: C } = v, { x: _, y: S } = h.getCoordRelativeToViewport(Ve.FromArray([p, C]));
|
|
1632
1632
|
this._movingHandler(_, S, n, i);
|
|
1633
1633
|
let I = _, R = S;
|
|
1634
|
-
const y = this.getActiveSelectionControl(),
|
|
1634
|
+
const y = this.getActiveSelectionControl(), M = this._getFreeze(), E = y == null ? void 0 : y.model, T = (A = h.getActiveViewportByCoord(Ve.FromArray([p, C]))) != null ? A : this._getViewportByCell(E == null ? void 0 : E.endRow, E == null ? void 0 : E.endColumn);
|
|
1635
1635
|
if ((() => {
|
|
1636
1636
|
if (!g || !T || !t)
|
|
1637
1637
|
return !1;
|
|
@@ -1644,16 +1644,16 @@ class rm extends oe {
|
|
|
1644
1644
|
ce && (a += 1), ge && (c += 1);
|
|
1645
1645
|
const se = g.viewportKey, _e = T.viewportKey;
|
|
1646
1646
|
if (se === U.VIEW_ROW_TOP)
|
|
1647
|
-
C < t.top && ((H =
|
|
1647
|
+
C < t.top && ((H = E == null ? void 0 : E.endRow) != null ? H : 0) < ((O = M == null ? void 0 : M.startRow) != null ? O : 0) ? R = t.top : ge && c % 2 === 1 && t.scrollToViewportPos({
|
|
1648
1648
|
viewportScrollY: 0
|
|
1649
1649
|
});
|
|
1650
1650
|
else if (se === U.VIEW_COLUMN_LEFT)
|
|
1651
|
-
p < t.left && ((V =
|
|
1651
|
+
p < t.left && ((V = E == null ? void 0 : E.endColumn) != null ? V : 0) < ((W = M == null ? void 0 : M.startColumn) != null ? W : 0) ? I = t.left : ce && a % 2 === 1 && t.scrollToViewportPos({
|
|
1652
1652
|
viewportScrollX: 0
|
|
1653
1653
|
});
|
|
1654
1654
|
else if (se === _e) {
|
|
1655
1655
|
let G = !1, ee = !1;
|
|
1656
|
-
se === U.VIEW_MAIN_LEFT_TOP ? (G = !0, ee = !0) : se === U.VIEW_MAIN_TOP ? ee = !0 : se === U.VIEW_MAIN_LEFT && (G = !0), ((
|
|
1656
|
+
se === U.VIEW_MAIN_LEFT_TOP ? (G = !0, ee = !0) : se === U.VIEW_MAIN_TOP ? ee = !0 : se === U.VIEW_MAIN_LEFT && (G = !0), ((j = E == null ? void 0 : E.endRow) != null ? j : 0) > ((B = M == null ? void 0 : M.startRow) != null ? B : 0) && (ee = !1), ((z = E == null ? void 0 : E.endColumn) != null ? z : 0) > ((Z = M == null ? void 0 : M.startColumn) != null ? Z : 0) && (G = !1), G && (I = t.left), ee && (R = t.top);
|
|
1657
1657
|
} else {
|
|
1658
1658
|
const G = {
|
|
1659
1659
|
x: g.scrollX,
|
|
@@ -1696,13 +1696,13 @@ class rm extends oe {
|
|
|
1696
1696
|
* When mousedown and mouseup need to go to the coordination and undo stack, when mousemove does not need to go to the coordination and undo stack
|
|
1697
1697
|
*/
|
|
1698
1698
|
_movingHandler(t, n, i, o) {
|
|
1699
|
-
var I, R, y,
|
|
1699
|
+
var I, R, y, M, E;
|
|
1700
1700
|
const s = this._skeleton, l = this._scene, [a, c] = s.getLocation(), d = {
|
|
1701
1701
|
startRow: (I = i == null ? void 0 : i.model.startRow) != null ? I : -1,
|
|
1702
1702
|
endRow: (R = i == null ? void 0 : i.model.endRow) != null ? R : -1,
|
|
1703
1703
|
startColumn: (y = i == null ? void 0 : i.model.startColumn) != null ? y : -1,
|
|
1704
|
-
endColumn: (
|
|
1705
|
-
}, u = l.getViewport(U.VIEW_MAIN), h = (
|
|
1704
|
+
endColumn: (M = i == null ? void 0 : i.model.endColumn) != null ? M : -1
|
|
1705
|
+
}, u = l.getViewport(U.VIEW_MAIN), h = (E = this._getViewportByCell(d.endRow, d.endColumn)) != null ? E : u, g = l.getScrollXYInfoByViewport(
|
|
1706
1706
|
Ve.FromArray([this._startViewportPosX, this._startViewportPosY]),
|
|
1707
1707
|
h
|
|
1708
1708
|
), { scaleX: m, scaleY: f } = l.getAncestorScale();
|
|
@@ -3097,9 +3097,9 @@ let Ds = class extends oe {
|
|
|
3097
3097
|
e !== Ne.NO_FORMAT && u.forEach((_) => {
|
|
3098
3098
|
if (_.id === be.id) {
|
|
3099
3099
|
const { cellValue: S } = _.params;
|
|
3100
|
-
new Ge(S).forValue((R, y,
|
|
3101
|
-
const
|
|
3102
|
-
(
|
|
3100
|
+
new Ge(S).forValue((R, y, M) => {
|
|
3101
|
+
const E = Object.keys(c.getStyles().get(M == null ? void 0 : M.s) || {});
|
|
3102
|
+
(M != null && M.p || E.length && bC.some((T) => E.includes(T))) && g.push({ startRow: R, endRow: R, startColumn: y, endColumn: y });
|
|
3103
3103
|
});
|
|
3104
3104
|
}
|
|
3105
3105
|
});
|
|
@@ -3321,7 +3321,7 @@ let Ls = class extends oe {
|
|
|
3321
3321
|
v = Fr(v, S, R), p = Ur(p, I, R), C = Fr(C, S, R), _ = Ur(_, I, R);
|
|
3322
3322
|
const y = t.getActiveSheet();
|
|
3323
3323
|
if (!y) return;
|
|
3324
|
-
const
|
|
3324
|
+
const M = {
|
|
3325
3325
|
workbook: t,
|
|
3326
3326
|
worksheet: y,
|
|
3327
3327
|
unitId: t.getUnitId(),
|
|
@@ -3330,31 +3330,31 @@ let Ls = class extends oe {
|
|
|
3330
3330
|
col: h,
|
|
3331
3331
|
origin: y.getCellRaw(u, h)
|
|
3332
3332
|
};
|
|
3333
|
-
let
|
|
3333
|
+
let E;
|
|
3334
3334
|
const T = this._sheetInterceptorService.writeCellInterceptor.fetchThroughInterceptors(iS)(
|
|
3335
3335
|
y.getCell(u, h),
|
|
3336
|
-
|
|
3336
|
+
M
|
|
3337
3337
|
);
|
|
3338
|
-
|
|
3339
|
-
const P = (A =
|
|
3340
|
-
if (P != null && (P.cellValueType = Mt.STRING), !
|
|
3341
|
-
const V = y.getBlankCellDocumentModel(T,
|
|
3342
|
-
if (
|
|
3343
|
-
const { verticalAlign: W, horizontalAlign:
|
|
3338
|
+
E = T && y.getCellDocumentModelWithFormula(T, M.row, M.col);
|
|
3339
|
+
const P = (A = E == null ? void 0 : E.documentModel) == null ? void 0 : A.documentStyle.renderConfig;
|
|
3340
|
+
if (P != null && (P.cellValueType = Mt.STRING), !E || E.documentModel == null) {
|
|
3341
|
+
const V = y.getBlankCellDocumentModel(T, M.row, M.col);
|
|
3342
|
+
if (E != null) {
|
|
3343
|
+
const { verticalAlign: W, horizontalAlign: j, wrapStrategy: B, textRotation: z, fill: Z } = E, { centerAngle: ce, vertexAngle: ge } = sd(z);
|
|
3344
3344
|
V.documentModel.documentStyle.renderConfig = {
|
|
3345
3345
|
...P,
|
|
3346
3346
|
verticalAlign: W,
|
|
3347
|
-
horizontalAlign:
|
|
3347
|
+
horizontalAlign: j,
|
|
3348
3348
|
wrapStrategy: B,
|
|
3349
3349
|
background: { rgb: Z },
|
|
3350
3350
|
centerAngle: ce,
|
|
3351
3351
|
vertexAngle: ge
|
|
3352
3352
|
};
|
|
3353
3353
|
}
|
|
3354
|
-
|
|
3354
|
+
E = V;
|
|
3355
3355
|
}
|
|
3356
|
-
if (
|
|
3357
|
-
const V = (O =
|
|
3356
|
+
if (E.fill = E.fill || "#fff", (H = E.documentModel) == null || H.setZoomRatio(Math.max(S, I)), (T == null ? void 0 : T.isInArrayFormulaRange) === !0) {
|
|
3357
|
+
const V = (O = E.documentModel) == null ? void 0 : O.getBody();
|
|
3358
3358
|
V && (V.textRuns = [
|
|
3359
3359
|
{
|
|
3360
3360
|
st: 0,
|
|
@@ -3381,7 +3381,7 @@ let Ls = class extends oe {
|
|
|
3381
3381
|
column: h,
|
|
3382
3382
|
unitId: l,
|
|
3383
3383
|
sheetId: a,
|
|
3384
|
-
documentLayoutObject:
|
|
3384
|
+
documentLayoutObject: E,
|
|
3385
3385
|
editorUnitId: this._editorUnitId,
|
|
3386
3386
|
isInArrayFormulaRange: T == null ? void 0 : T.isInArrayFormulaRange
|
|
3387
3387
|
};
|
|
@@ -3977,29 +3977,29 @@ let Ws = class extends oe {
|
|
|
3977
3977
|
const _ = [];
|
|
3978
3978
|
if (t === F.DOWN || t === F.UP) {
|
|
3979
3979
|
const O = m.length, V = [];
|
|
3980
|
-
g.forEach((W,
|
|
3981
|
-
const B = p[
|
|
3982
|
-
V.push(
|
|
3980
|
+
g.forEach((W, j) => {
|
|
3981
|
+
const B = p[j], z = this._getApplyData(B, C, O, t, n, s, e);
|
|
3982
|
+
V.push(z);
|
|
3983
3983
|
});
|
|
3984
3984
|
for (let W = 0; W < V[0].length; W++) {
|
|
3985
|
-
const
|
|
3985
|
+
const j = [];
|
|
3986
3986
|
for (let B = 0; B < V.length; B++)
|
|
3987
|
-
|
|
3987
|
+
j.push({
|
|
3988
3988
|
s: null,
|
|
3989
3989
|
...V[B][W]
|
|
3990
3990
|
});
|
|
3991
|
-
_.push(
|
|
3991
|
+
_.push(j);
|
|
3992
3992
|
}
|
|
3993
3993
|
} else {
|
|
3994
3994
|
const O = g.length;
|
|
3995
3995
|
m.forEach((V, W) => {
|
|
3996
|
-
const
|
|
3996
|
+
const j = p[W], B = this._getApplyData(j, C, O, t, n, s, e), z = [];
|
|
3997
3997
|
for (let Z = 0; Z < B.length; Z++)
|
|
3998
|
-
|
|
3998
|
+
z.push({
|
|
3999
3999
|
s: null,
|
|
4000
4000
|
...B[Z]
|
|
4001
4001
|
});
|
|
4002
|
-
_.push(
|
|
4002
|
+
_.push(z);
|
|
4003
4003
|
});
|
|
4004
4004
|
}
|
|
4005
4005
|
let S = [];
|
|
@@ -4009,13 +4009,13 @@ let Ws = class extends oe {
|
|
|
4009
4009
|
V && I && I && (V.s = I.getStyleByCell(V));
|
|
4010
4010
|
});
|
|
4011
4011
|
})) : _.forEach((O, V) => {
|
|
4012
|
-
O.forEach((W,
|
|
4013
|
-
W && I && (W.s = I.getStyleByCell(this._beforeApplyData[V][
|
|
4012
|
+
O.forEach((W, j) => {
|
|
4013
|
+
W && I && (W.s = I.getStyleByCell(this._beforeApplyData[V][j]) || null);
|
|
4014
4014
|
});
|
|
4015
4015
|
}), n === Ne.ONLY_FORMAT && _.forEach((O, V) => {
|
|
4016
|
-
O.forEach((W,
|
|
4016
|
+
O.forEach((W, j) => {
|
|
4017
4017
|
if (W) {
|
|
4018
|
-
const B = this._beforeApplyData[V][
|
|
4018
|
+
const B = this._beforeApplyData[V][j] || {};
|
|
4019
4019
|
W.f = B.f, W.si = B.si, W.t = B.t, W.v = B.v;
|
|
4020
4020
|
}
|
|
4021
4021
|
});
|
|
@@ -4028,11 +4028,11 @@ let Ws = class extends oe {
|
|
|
4028
4028
|
unitId: c,
|
|
4029
4029
|
subUnitId: d,
|
|
4030
4030
|
ranges: O
|
|
4031
|
-
},
|
|
4031
|
+
}, j = this._injector.invoke(
|
|
4032
4032
|
Wl,
|
|
4033
4033
|
W
|
|
4034
4034
|
);
|
|
4035
|
-
O.length && (o.push({ id: Kt.id, params: W }), i.unshift({ id: Qt.id, params:
|
|
4035
|
+
O.length && (o.push({ id: Kt.id, params: W }), i.unshift({ id: Qt.id, params: j }));
|
|
4036
4036
|
}
|
|
4037
4037
|
const R = {
|
|
4038
4038
|
subUnitId: d,
|
|
@@ -4043,23 +4043,23 @@ let Ws = class extends oe {
|
|
|
4043
4043
|
R
|
|
4044
4044
|
);
|
|
4045
4045
|
o.push({ id: be.id, params: R }), i.unshift({ id: be.id, params: y });
|
|
4046
|
-
const
|
|
4046
|
+
const M = new Ge();
|
|
4047
4047
|
m.forEach((O, V) => {
|
|
4048
|
-
g.forEach((W,
|
|
4049
|
-
_[V][
|
|
4048
|
+
g.forEach((W, j) => {
|
|
4049
|
+
_[V][j] && M.setValue(O, W, _[V][j]);
|
|
4050
4050
|
});
|
|
4051
4051
|
});
|
|
4052
|
-
const
|
|
4052
|
+
const E = M.getMatrix(), T = {
|
|
4053
4053
|
subUnitId: d,
|
|
4054
4054
|
unitId: c,
|
|
4055
|
-
cellValue:
|
|
4055
|
+
cellValue: E
|
|
4056
4056
|
}, P = this._injector.invoke(
|
|
4057
4057
|
$t,
|
|
4058
4058
|
T
|
|
4059
4059
|
);
|
|
4060
4060
|
if (this._autoFillService.getActiveHooks().forEach((O) => {
|
|
4061
4061
|
var V;
|
|
4062
|
-
(V = O.onBeforeSubmit) == null || V.call(O, e, t, n,
|
|
4062
|
+
(V = O.onBeforeSubmit) == null || V.call(O, e, t, n, E);
|
|
4063
4063
|
}), i.unshift({ id: be.id, params: P }), o.push({ id: be.id, params: T }), S != null && S.length) {
|
|
4064
4064
|
const O = Bl(S), V = {
|
|
4065
4065
|
unitId: c,
|
|
@@ -4144,15 +4144,15 @@ let Bs = class extends oe {
|
|
|
4144
4144
|
};
|
|
4145
4145
|
if (!y || !s)
|
|
4146
4146
|
return;
|
|
4147
|
-
const
|
|
4148
|
-
if (!
|
|
4147
|
+
const M = v.getCell(y.actualRow, y.actualCol);
|
|
4148
|
+
if (!M)
|
|
4149
4149
|
return;
|
|
4150
|
-
const
|
|
4151
|
-
if (!(
|
|
4150
|
+
const E = M.customRender;
|
|
4151
|
+
if (!(E != null && E.length))
|
|
4152
4152
|
return;
|
|
4153
|
-
const T = y.actualRow, P = y.actualCol, A =
|
|
4154
|
-
data:
|
|
4155
|
-
style: s.getStyles().getStyleByCell(
|
|
4153
|
+
const T = y.actualRow, P = y.actualCol, A = E.sort(qp), H = v.getSheetId(), O = {
|
|
4154
|
+
data: M,
|
|
4155
|
+
style: s.getStyles().getStyleByCell(M),
|
|
4156
4156
|
primaryWithCoord: s.getCellWithCoordByIndex(y.actualRow, y.actualCol),
|
|
4157
4157
|
unitId: o,
|
|
4158
4158
|
subUnitId: H,
|
|
@@ -4163,9 +4163,9 @@ let Bs = class extends oe {
|
|
|
4163
4163
|
}, V = {
|
|
4164
4164
|
x: S.x + g / C,
|
|
4165
4165
|
y: S.y + m / _
|
|
4166
|
-
}, W = A.find((
|
|
4166
|
+
}, W = A.find((j) => {
|
|
4167
4167
|
var B;
|
|
4168
|
-
return (B =
|
|
4168
|
+
return (B = j.isHit) == null ? void 0 : B.call(j, V, O);
|
|
4169
4169
|
});
|
|
4170
4170
|
if (W)
|
|
4171
4171
|
return [W, O];
|
|
@@ -4173,9 +4173,9 @@ let Bs = class extends oe {
|
|
|
4173
4173
|
var m, f, v, p;
|
|
4174
4174
|
const g = c(h);
|
|
4175
4175
|
if (g) {
|
|
4176
|
-
const [C, _] = g, { row: S, col: I, worksheet: R, unitId: y, subUnitId:
|
|
4176
|
+
const [C, _] = g, { row: S, col: I, worksheet: R, unitId: y, subUnitId: M } = _;
|
|
4177
4177
|
if (!((m = this._permissionService.composePermission(
|
|
4178
|
-
[new K(y).id, new te(y,
|
|
4178
|
+
[new K(y).id, new te(y, M).id]
|
|
4179
4179
|
)) == null ? void 0 : m.every((P) => P.value)))
|
|
4180
4180
|
return !1;
|
|
4181
4181
|
const T = (v = (f = R.getCell(S, I)) == null ? void 0 : f.selectionProtection) == null ? void 0 : v[0];
|
|
@@ -4698,7 +4698,7 @@ const Dt = {
|
|
|
4698
4698
|
keycode: Y.TAB
|
|
4699
4699
|
});
|
|
4700
4700
|
let R;
|
|
4701
|
-
const { startRow: y, endRow:
|
|
4701
|
+
const { startRow: y, endRow: M, startColumn: E, endColumn: T } = p, P = a ? C.startRow === y && C.startColumn === E : C.endRow === M && C.endColumn === T;
|
|
4702
4702
|
if (ae.equals(p, C)) {
|
|
4703
4703
|
if (l === Y.TAB)
|
|
4704
4704
|
I == null && S.addOrUpdate({
|
|
@@ -4710,8 +4710,8 @@ const Dt = {
|
|
|
4710
4710
|
else {
|
|
4711
4711
|
const B = I == null ? void 0 : I.selection;
|
|
4712
4712
|
if (B != null) {
|
|
4713
|
-
const { range:
|
|
4714
|
-
_ = Hc(
|
|
4713
|
+
const { range: z, primary: Z } = B;
|
|
4714
|
+
_ = Hc(z, Z, s);
|
|
4715
4715
|
}
|
|
4716
4716
|
S.remove({
|
|
4717
4717
|
unitId: f,
|
|
@@ -4719,20 +4719,20 @@ const Dt = {
|
|
|
4719
4719
|
keycode: Y.TAB
|
|
4720
4720
|
});
|
|
4721
4721
|
}
|
|
4722
|
-
const W = Gn(_, s, i),
|
|
4723
|
-
if (ae.equals(
|
|
4722
|
+
const W = Gn(_, s, i), j = ms(W.startRow, W.startColumn, i);
|
|
4723
|
+
if (ae.equals(j, _))
|
|
4724
4724
|
return !1;
|
|
4725
4725
|
R = {
|
|
4726
|
-
range: ae.clone(
|
|
4726
|
+
range: ae.clone(j),
|
|
4727
4727
|
primary: {
|
|
4728
|
-
startRow:
|
|
4729
|
-
startColumn:
|
|
4730
|
-
endRow:
|
|
4731
|
-
endColumn:
|
|
4728
|
+
startRow: j.startRow,
|
|
4729
|
+
startColumn: j.startColumn,
|
|
4730
|
+
endRow: j.endRow,
|
|
4731
|
+
endColumn: j.endColumn,
|
|
4732
4732
|
actualRow: W.startRow,
|
|
4733
4733
|
actualColumn: W.startColumn,
|
|
4734
|
-
isMerged:
|
|
4735
|
-
isMergedMainCell:
|
|
4734
|
+
isMerged: j.isMerged,
|
|
4735
|
+
isMergedMainCell: j.startRow === W.startRow && j.startColumn === W.startColumn
|
|
4736
4736
|
}
|
|
4737
4737
|
};
|
|
4738
4738
|
} else {
|
|
@@ -4741,7 +4741,7 @@ const Dt = {
|
|
|
4741
4741
|
sheetId: v,
|
|
4742
4742
|
keycode: Y.TAB
|
|
4743
4743
|
});
|
|
4744
|
-
const W = le.deepClone(C),
|
|
4744
|
+
const W = le.deepClone(C), j = P ? g.range : Gn(
|
|
4745
4745
|
{
|
|
4746
4746
|
startRow: W.startRow,
|
|
4747
4747
|
startColumn: W.startColumn,
|
|
@@ -4752,22 +4752,22 @@ const Dt = {
|
|
|
4752
4752
|
i,
|
|
4753
4753
|
{
|
|
4754
4754
|
startRow: y,
|
|
4755
|
-
endRow:
|
|
4756
|
-
startColumn:
|
|
4755
|
+
endRow: M,
|
|
4756
|
+
startColumn: E,
|
|
4757
4757
|
endColumn: T
|
|
4758
4758
|
}
|
|
4759
|
-
), B = P && a,
|
|
4759
|
+
), B = P && a, z = B ? ms(j.endRow, j.endColumn, i) : ms(j.startRow, j.startColumn, i);
|
|
4760
4760
|
R = {
|
|
4761
4761
|
range: P ? g.range : ae.clone(p),
|
|
4762
4762
|
primary: {
|
|
4763
|
-
startRow:
|
|
4764
|
-
startColumn:
|
|
4765
|
-
endRow:
|
|
4766
|
-
endColumn:
|
|
4767
|
-
actualRow: B ?
|
|
4768
|
-
actualColumn: B ?
|
|
4769
|
-
isMerged:
|
|
4770
|
-
isMergedMainCell:
|
|
4763
|
+
startRow: z.startRow,
|
|
4764
|
+
startColumn: z.startColumn,
|
|
4765
|
+
endRow: z.endRow,
|
|
4766
|
+
endColumn: z.endColumn,
|
|
4767
|
+
actualRow: B ? z.startRow : j.startRow,
|
|
4768
|
+
actualColumn: B ? z.startColumn : j.startColumn,
|
|
4769
|
+
isMerged: z.isMerged,
|
|
4770
|
+
isMergedMainCell: z.startRow === j.startRow && z.startColumn === j.startColumn
|
|
4771
4771
|
},
|
|
4772
4772
|
style: P ? g.style : u.style
|
|
4773
4773
|
};
|
|
@@ -5350,8 +5350,8 @@ let ho = class extends oe {
|
|
|
5350
5350
|
// For arrow key to active cell cause scrolling.
|
|
5351
5351
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
5352
5352
|
_scrollToCell(r, e, t = !1, n = !1) {
|
|
5353
|
-
var
|
|
5354
|
-
const { rowHeightAccumulation: i, columnWidthAccumulation: o } = (
|
|
5353
|
+
var E, T, P;
|
|
5354
|
+
const { rowHeightAccumulation: i, columnWidthAccumulation: o } = (E = this._sheetSkeletonManagerService.getCurrentSkeleton()) != null ? E : {};
|
|
5355
5355
|
if (i == null || o == null) return !1;
|
|
5356
5356
|
const s = (T = this._getSheetObject()) == null ? void 0 : T.scene;
|
|
5357
5357
|
if (s == null) return !1;
|
|
@@ -5387,8 +5387,8 @@ let ho = class extends oe {
|
|
|
5387
5387
|
;
|
|
5388
5388
|
}
|
|
5389
5389
|
if (_ === void 0 && S === void 0) return !1;
|
|
5390
|
-
let { offsetX: I, offsetY: R, sheetViewStartRow: y, sheetViewStartColumn:
|
|
5391
|
-
if (_ = _ ? Math.min(_, r) : y + h, S = S ? Math.min(S, e) :
|
|
5390
|
+
let { offsetX: I, offsetY: R, sheetViewStartRow: y, sheetViewStartColumn: M } = this._scrollManagerService.getCurrentScrollState() || {};
|
|
5391
|
+
if (_ = _ ? Math.min(_, r) : y + h, S = S ? Math.min(S, e) : M + g, n) {
|
|
5392
5392
|
I = 0, S = e;
|
|
5393
5393
|
const A = a.getHiddenColumnsInRange({ startColumn: S - g, endColumn: S });
|
|
5394
5394
|
S = S - A.length;
|
|
@@ -5740,15 +5740,15 @@ function z1() {
|
|
|
5740
5740
|
return null;
|
|
5741
5741
|
const I = en(e, t);
|
|
5742
5742
|
if (!I || !p) return null;
|
|
5743
|
-
const { scene: R } = I, y = v == null ? void 0 : v.getCurrentSkeleton(),
|
|
5744
|
-
if (!
|
|
5745
|
-
const A = (y == null ? void 0 : y.getNoMergeCellWithCoordByIndex(c.row, c.col).endX) || 0, H = (y == null ? void 0 : y.getNoMergeCellWithCoordByIndex(c.row, c.col).endY) || 0, O = Fr(A,
|
|
5743
|
+
const { scene: R } = I, y = v == null ? void 0 : v.getCurrentSkeleton(), M = p.getViewPort(), E = R == null ? void 0 : R.scaleX, T = R == null ? void 0 : R.scaleY, P = R == null ? void 0 : R.getViewportScrollXY(M);
|
|
5744
|
+
if (!E || !R || !E || !T || !P) return null;
|
|
5745
|
+
const A = (y == null ? void 0 : y.getNoMergeCellWithCoordByIndex(c.row, c.col).endX) || 0, H = (y == null ? void 0 : y.getNoMergeCellWithCoordByIndex(c.row, c.col).endY) || 0, O = Fr(A, E, P), V = Ur(H, T, P);
|
|
5746
5746
|
if (O == null || V == null) return null;
|
|
5747
5747
|
const W = (Z) => {
|
|
5748
5748
|
a(Z);
|
|
5749
|
-
},
|
|
5749
|
+
}, j = (Z) => {
|
|
5750
5750
|
r.executeCommand(Zl.id, { type: Z.value }), a(!1);
|
|
5751
|
-
}, B = l || g,
|
|
5751
|
+
}, B = l || g, z = o.filter((Z) => !Z.disable);
|
|
5752
5752
|
return /* @__PURE__ */ w("div", { className: "univer-absolute univer-inset-0 univer-z-10 univer-size-0", children: /* @__PURE__ */ w(
|
|
5753
5753
|
"div",
|
|
5754
5754
|
{
|
|
@@ -5760,11 +5760,11 @@ function z1() {
|
|
|
5760
5760
|
Md,
|
|
5761
5761
|
{
|
|
5762
5762
|
align: "start",
|
|
5763
|
-
items:
|
|
5763
|
+
items: z.map((Z) => ({
|
|
5764
5764
|
type: "radio",
|
|
5765
5765
|
value: u,
|
|
5766
5766
|
options: [{ label: i.t(Z.label), value: Z.value }],
|
|
5767
|
-
onSelect: () =>
|
|
5767
|
+
onSelect: () => j(Z)
|
|
5768
5768
|
})),
|
|
5769
5769
|
open: l,
|
|
5770
5770
|
onOpenChange: W,
|
|
@@ -5848,8 +5848,8 @@ const Fs = -1e3, Xu = {
|
|
|
5848
5848
|
const y = n.getEditor(Le);
|
|
5849
5849
|
if (y == null)
|
|
5850
5850
|
return;
|
|
5851
|
-
const { left:
|
|
5852
|
-
t.setRect({ left:
|
|
5851
|
+
const { left: M, top: E, width: T, height: P } = y.getBoundingClientRect();
|
|
5852
|
+
t.setRect({ left: M, top: E, width: T, height: P });
|
|
5853
5853
|
}
|
|
5854
5854
|
});
|
|
5855
5855
|
return () => {
|
|
@@ -6124,7 +6124,7 @@ function q1(r) {
|
|
|
6124
6124
|
), l = D($l), a = D(qe), c = D(ft), d = D($e), u = D(N), h = D($), g = D(rt), m = D(Wo), f = D(L), [v, p] = re({
|
|
6125
6125
|
editDisable: !1,
|
|
6126
6126
|
viewDisable: !1
|
|
6127
|
-
}), [C, _] = re(!1), S = D(Zt), I = ht(() => u.getCurrentTypeOfUnit$(x.UNIVER_SHEET), void 0, void 0, []), R = Tn(0), y = ht(a.currentEditCellState$),
|
|
6127
|
+
}), [C, _] = re(!1), S = D(Zt), I = ht(() => u.getCurrentTypeOfUnit$(x.UNIVER_SHEET), void 0, void 0, []), R = Tn(0), y = ht(a.currentEditCellState$), M = Em(R, (ne = y == null ? void 0 : y.unitId) != null ? ne : ""), E = S.get(Od), T = qh(om.FORMULA_AUX), P = D(ke);
|
|
6128
6128
|
ht(wt(() => P.subscribeContextValue$(Ot), [P]));
|
|
6129
6129
|
const A = P.getContextValue(Ot), H = Tn(null), O = D(vi);
|
|
6130
6130
|
eS(() => {
|
|
@@ -6215,7 +6215,7 @@ function q1(r) {
|
|
|
6215
6215
|
unitId: y.unitId
|
|
6216
6216
|
});
|
|
6217
6217
|
}
|
|
6218
|
-
function
|
|
6218
|
+
function j() {
|
|
6219
6219
|
a.isVisible().visible && f.executeCommand(tt.id, {
|
|
6220
6220
|
visible: !1,
|
|
6221
6221
|
eventType: ze.PointerDown,
|
|
@@ -6225,7 +6225,7 @@ function q1(r) {
|
|
|
6225
6225
|
function B() {
|
|
6226
6226
|
l.handleFxBtnClick(!0);
|
|
6227
6227
|
}
|
|
6228
|
-
const { viewDisable:
|
|
6228
|
+
const { viewDisable: z, editDisable: Z } = v, ce = Z || C, ge = Tn(!1), se = () => {
|
|
6229
6229
|
try {
|
|
6230
6230
|
a.isVisible().visible === !1 && f.syncExecuteCommand(
|
|
6231
6231
|
tt.id,
|
|
@@ -6242,7 +6242,7 @@ function q1(r) {
|
|
|
6242
6242
|
ge.current && setTimeout(() => {
|
|
6243
6243
|
O.blur(!0);
|
|
6244
6244
|
}, 30), ge.current = !1;
|
|
6245
|
-
}, ee = ((pe = (Fe = (ve = y == null ? void 0 : y.documentLayoutObject.documentModel) == null ? void 0 : ve.getDrawingsOrder()) == null ? void 0 : Fe.length) != null ? pe : 0) > 0 ||
|
|
6245
|
+
}, ee = ((pe = (Fe = (ve = y == null ? void 0 : y.documentLayoutObject.documentModel) == null ? void 0 : ve.getDrawingsOrder()) == null ? void 0 : Fe.length) != null ? pe : 0) > 0 || z;
|
|
6246
6246
|
return /* @__PURE__ */ q(
|
|
6247
6247
|
"div",
|
|
6248
6248
|
{
|
|
@@ -6276,7 +6276,7 @@ function q1(r) {
|
|
|
6276
6276
|
className: He("univer-flex univer-items-center univer-justify-center univer-rounded univer-p-1 univer-text-base dark:!univer-text-white", {
|
|
6277
6277
|
"univer-cursor-pointer univer-text-red-600 dark:!univer-text-red-400 dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100": n
|
|
6278
6278
|
}),
|
|
6279
|
-
onClick:
|
|
6279
|
+
onClick: j,
|
|
6280
6280
|
children: /* @__PURE__ */ w(_i, {})
|
|
6281
6281
|
}
|
|
6282
6282
|
),
|
|
@@ -6301,8 +6301,8 @@ function q1(r) {
|
|
|
6301
6301
|
onPointerUp: _e,
|
|
6302
6302
|
style: { pointerEvents: ee ? "none" : "auto" },
|
|
6303
6303
|
children: [
|
|
6304
|
-
|
|
6305
|
-
|
|
6304
|
+
E && /* @__PURE__ */ w(
|
|
6305
|
+
E,
|
|
6306
6306
|
{
|
|
6307
6307
|
className: "univer-relative univer-h-full univer-w-full univer-break-words univer-outline-none [&>div]:univer-ring-transparent",
|
|
6308
6308
|
disableSelectionOnClick: !0,
|
|
@@ -6316,7 +6316,7 @@ function q1(r) {
|
|
|
6316
6316
|
isSupportAcrossSheet: !0,
|
|
6317
6317
|
resetSelectionOnBlur: !1,
|
|
6318
6318
|
isSingle: !1,
|
|
6319
|
-
keyboardEventConfig:
|
|
6319
|
+
keyboardEventConfig: M,
|
|
6320
6320
|
onFormulaSelectingChange: (Re, de) => {
|
|
6321
6321
|
R.current = Re, de && (Re ? a.enableForceKeepVisible() : a.disableForceKeepVisible());
|
|
6322
6322
|
},
|
|
@@ -6835,14 +6835,14 @@ const Yr = class Yr {
|
|
|
6835
6835
|
this._slideTabBar = t, this._slideScrollbar = new tw(this), this._config = e, this._initConfig();
|
|
6836
6836
|
let n = 0, i = 0, o = 0;
|
|
6837
6837
|
this._downAction = (s) => {
|
|
6838
|
-
var I, R, y,
|
|
6838
|
+
var I, R, y, M, E, T;
|
|
6839
6839
|
if ((I = this._activeTabItem) != null && I.isEditMode())
|
|
6840
6840
|
return;
|
|
6841
6841
|
this._longPressTimer && (clearTimeout(this._longPressTimer), this._longPressTimer = null);
|
|
6842
6842
|
const l = (y = (R = s.target) == null ? void 0 : R.closest(`${e.slideTabBarItemSelector}`)) == null ? void 0 : y.getAttribute("data-id"), a = this._slideTabItems.findIndex((P) => P.getId() === l);
|
|
6843
6843
|
if (l == null || a === -1) return;
|
|
6844
6844
|
if (this._activeTabItemIndex !== a) {
|
|
6845
|
-
(
|
|
6845
|
+
(M = this._activeTabItem) == null || M.removeEventListener("pointermove", this._moveAction), (E = this._activeTabItem) == null || E.removeEventListener("pointerup", this._upAction), this.removeListener(), this._config.onChangeTab(s, l);
|
|
6846
6846
|
return;
|
|
6847
6847
|
}
|
|
6848
6848
|
if (this._compareIndex = a, this._downActionX = s.pageX, this._moveActionX = 0, this._scrollIncremental = 0, this._activeTabItem = this._slideTabItems[a], !this._activeTabItem) {
|
|
@@ -7120,9 +7120,9 @@ function nw() {
|
|
|
7120
7120
|
Me(() => {
|
|
7121
7121
|
R();
|
|
7122
7122
|
const { slideTabBar: G, disconnectResizeObserver: ee } = y(), ne = W(), ve = [
|
|
7123
|
-
|
|
7123
|
+
j(),
|
|
7124
7124
|
B(),
|
|
7125
|
-
|
|
7125
|
+
z()
|
|
7126
7126
|
// When adding a sheet, it no longer slides, which has been uniformly handled in setupSlideTabBarUpdate
|
|
7127
7127
|
];
|
|
7128
7128
|
return () => {
|
|
@@ -7181,7 +7181,7 @@ function nw() {
|
|
|
7181
7181
|
d.current.slideTabBar = G;
|
|
7182
7182
|
const ee = ge(G);
|
|
7183
7183
|
return { slideTabBar: G, disconnectResizeObserver: ee };
|
|
7184
|
-
},
|
|
7184
|
+
}, M = xl(Qh), E = (_e = M == null ? void 0 : M.contextMenu) != null ? _e : !0, T = (G) => {
|
|
7185
7185
|
if (G.trim() === "") {
|
|
7186
7186
|
const ee = "sheetNameEmptyAlert";
|
|
7187
7187
|
return f.open({
|
|
@@ -7263,12 +7263,12 @@ function nw() {
|
|
|
7263
7263
|
R();
|
|
7264
7264
|
break;
|
|
7265
7265
|
}
|
|
7266
|
-
}),
|
|
7266
|
+
}), j = () => g.scroll$.subscribe((G) => {
|
|
7267
7267
|
Z(G);
|
|
7268
7268
|
}), B = () => g.scrollX$.subscribe((G) => {
|
|
7269
7269
|
var ee;
|
|
7270
7270
|
(ee = d.current.slideTabBar) == null || ee.flipPage(G);
|
|
7271
|
-
}),
|
|
7271
|
+
}), z = () => g.renameId$.subscribe(() => {
|
|
7272
7272
|
O();
|
|
7273
7273
|
}), Z = (G) => {
|
|
7274
7274
|
const { leftEnd: ee, rightEnd: ne } = G;
|
|
@@ -7294,7 +7294,7 @@ function nw() {
|
|
|
7294
7294
|
return ne.observe(ee), () => ne.disconnect();
|
|
7295
7295
|
}, se = (G) => {
|
|
7296
7296
|
var ee, ne, ve, Fe, pe;
|
|
7297
|
-
if (
|
|
7297
|
+
if (E && !(v != null && v.isForceKeepVisible())) {
|
|
7298
7298
|
if (G) {
|
|
7299
7299
|
const { left: Re } = (ne = (ee = u.current) == null ? void 0 : ee.getBoundingClientRect()) != null ? ne : {}, { left: de } = (pe = (Fe = (ve = d.current.slideTabBar) == null ? void 0 : ve.getActiveItem()) == null ? void 0 : Fe.getSlideTabItem().getBoundingClientRect()) != null ? pe : {};
|
|
7300
7300
|
Re !== void 0 && de !== void 0 && c([de - Re, 0]);
|
|
@@ -7547,8 +7547,8 @@ const zu = 800, uw = 3, hw = () => {
|
|
|
7547
7547
|
disable: !1,
|
|
7548
7548
|
pattern: null
|
|
7549
7549
|
})), o = (g, m, f, v) => {
|
|
7550
|
-
const [p, C] = re(g), [_, S] = re(!0), I = wt(() => p.filter((
|
|
7551
|
-
const T =
|
|
7550
|
+
const [p, C] = re(g), [_, S] = re(!0), I = wt(() => p.filter((E) => E.show && !E.disable), [p]), R = wt(() => I.find((E) => E.show && !E.disable), [I]), y = wt(() => f && R ? [R] : I, [f, R, I]), M = On((E) => {
|
|
7551
|
+
const T = E == null ? void 0 : E.values;
|
|
7552
7552
|
if (!(T != null && T.length)) {
|
|
7553
7553
|
S(!1);
|
|
7554
7554
|
return;
|
|
@@ -7560,16 +7560,16 @@ const zu = 800, uw = 3, hw = () => {
|
|
|
7560
7560
|
...A,
|
|
7561
7561
|
value: (O = (H = T.find((W) => W.func === A.name)) == null ? void 0 : H.value) != null ? O : A.value,
|
|
7562
7562
|
disable: !T.some((W) => W.func === A.name),
|
|
7563
|
-
pattern: (V =
|
|
7563
|
+
pattern: (V = E == null ? void 0 : E.pattern) != null ? V : null
|
|
7564
7564
|
};
|
|
7565
7565
|
})
|
|
7566
7566
|
);
|
|
7567
7567
|
}, []);
|
|
7568
7568
|
return Me(() => {
|
|
7569
7569
|
if (!v) return;
|
|
7570
|
-
const
|
|
7571
|
-
return () =>
|
|
7572
|
-
}, [v, m,
|
|
7570
|
+
const E = m.state$.subscribe(M);
|
|
7571
|
+
return () => E.unsubscribe();
|
|
7572
|
+
}, [v, m, M]), {
|
|
7573
7573
|
statistics: p,
|
|
7574
7574
|
showList: y,
|
|
7575
7575
|
show: _
|
|
@@ -7708,7 +7708,7 @@ let Us = class extends oe {
|
|
|
7708
7708
|
}
|
|
7709
7709
|
// eslint-disable-next-line complexity
|
|
7710
7710
|
fitTextSize(r) {
|
|
7711
|
-
var
|
|
7711
|
+
var M, E, T, P;
|
|
7712
7712
|
const e = this._editorBridgeService.getEditCellState();
|
|
7713
7713
|
if (!e) return;
|
|
7714
7714
|
const { position: t, documentLayoutObject: n, canvasOffset: i, scaleX: o, scaleY: s } = e, { startX: l, startY: a, endX: c, endY: d } = t, u = this._univerInstanceService.getUnit(Le, x.UNIVER_DOC);
|
|
@@ -7727,7 +7727,7 @@ let Us = class extends oe {
|
|
|
7727
7727
|
if (!g || g.actualWidth <= 0) return;
|
|
7728
7728
|
let { actualWidth: m, actualHeight: f } = g;
|
|
7729
7729
|
const { verticalAlign: v, horizontalAlign: p, paddingData: C, fill: _ } = n;
|
|
7730
|
-
m = m + ((
|
|
7730
|
+
m = m + ((M = C.l) != null ? M : 0) + ((E = C.r) != null ? E : 0), f = f + ((T = C.t) != null ? T : 0) + ((P = C.b) != null ? P : 0);
|
|
7731
7731
|
let S = c - l, I = d - a;
|
|
7732
7732
|
S < m && (S = Math.ceil(m)), I < f && (I = Math.ceil(f));
|
|
7733
7733
|
let R = 0;
|
|
@@ -7815,7 +7815,7 @@ let Us = class extends oe {
|
|
|
7815
7815
|
R > _ ? (y == null ? p && new ld(p, { enableHorizontal: !1, barSize: 8 }) : p == null || p.resetCanvasSizeAndUpdateScroll(), p == null || p.scrollToViewportPos({
|
|
7816
7816
|
viewportScrollY: R - _
|
|
7817
7817
|
}), R = _) : (y = null, (H = p == null ? void 0 : p.getScrollBar()) == null || H.dispose()), r += (y == null ? void 0 : y.barSize) || 0, r > S && (r = S), this._addBackground(f, r / o, e / s, i);
|
|
7818
|
-
const { scaleX:
|
|
7818
|
+
const { scaleX: M, scaleY: E } = f.getPrecisionScale();
|
|
7819
7819
|
f.transformByState({
|
|
7820
7820
|
width: r * I / o,
|
|
7821
7821
|
height: e * I / s,
|
|
@@ -7823,8 +7823,8 @@ let Us = class extends oe {
|
|
|
7823
7823
|
scaleY: s * I
|
|
7824
7824
|
}), m.resize(r * I / o, e * I / s), setTimeout(() => {
|
|
7825
7825
|
v.resizeBySize(
|
|
7826
|
-
mu(r,
|
|
7827
|
-
mu(R,
|
|
7826
|
+
mu(r, M),
|
|
7827
|
+
mu(R, E)
|
|
7828
7828
|
), a == null || a();
|
|
7829
7829
|
}, 0);
|
|
7830
7830
|
const T = this._layoutService.getContentElement().getBoundingClientRect(), P = u.getBoundingClientRect();
|
|
@@ -9310,17 +9310,17 @@ const Il = class Il {
|
|
|
9310
9310
|
var l, a;
|
|
9311
9311
|
const n = new Ge(), i = (l = Jw(e)) != null ? l : [], { rowProperties: o = [] } = Qw(e), s = this._parseTableByHtml(this._dom, t, (a = this._getCurrentSkeleton()) == null ? void 0 : a.skeleton);
|
|
9312
9312
|
return s && s.forValue((c, d, u) => {
|
|
9313
|
-
var m, f, v, p, C, _, S, I, R, y,
|
|
9313
|
+
var m, f, v, p, C, _, S, I, R, y, M, E, T, P, A, H, O, V, W, j, B, z, Z, ce;
|
|
9314
9314
|
let h = Hv(void 0, u.style);
|
|
9315
9315
|
if ((p = (v = (f = (m = u == null ? void 0 : u.richTextParma) == null ? void 0 : m.p) == null ? void 0 : f.body) == null ? void 0 : v.textRuns) != null && p.length) {
|
|
9316
9316
|
const ge = (_ = (C = u == null ? void 0 : u.richTextParma) == null ? void 0 : C.v) == null ? void 0 : _.length;
|
|
9317
9317
|
for (let se = 0; se < ((y = (R = (I = (S = u == null ? void 0 : u.richTextParma) == null ? void 0 : S.p) == null ? void 0 : I.body) == null ? void 0 : R.textRuns) == null ? void 0 : y.length); se++) {
|
|
9318
|
-
const _e = (T = (
|
|
9318
|
+
const _e = (T = (E = (M = u == null ? void 0 : u.richTextParma) == null ? void 0 : M.p) == null ? void 0 : E.body) == null ? void 0 : T.textRuns[se];
|
|
9319
9319
|
_e.st === 0 && _e.ed === ge && (h = { ..._e.ts, ...h }, (H = (A = (P = u == null ? void 0 : u.richTextParma) == null ? void 0 : P.p) == null ? void 0 : A.body) == null || H.textRuns.splice(se, 1), se--);
|
|
9320
9320
|
}
|
|
9321
|
-
((
|
|
9321
|
+
((j = (W = (V = (O = u == null ? void 0 : u.richTextParma) == null ? void 0 : O.p) == null ? void 0 : V.body) == null ? void 0 : W.textRuns) == null ? void 0 : j.length) === 0 && (u.content = (B = u == null ? void 0 : u.richTextParma) == null ? void 0 : B.v, delete u.richTextParma);
|
|
9322
9322
|
}
|
|
9323
|
-
const g = (ce = (Z = (
|
|
9323
|
+
const g = (ce = (Z = (z = u == null ? void 0 : u.richTextParma) == null ? void 0 : z.p) == null ? void 0 : Z.body) != null && ce.textRuns ? {
|
|
9324
9324
|
v: u.richTextParma.v,
|
|
9325
9325
|
p: u.richTextParma.p,
|
|
9326
9326
|
s: h,
|
|
@@ -9355,15 +9355,15 @@ const Il = class Il {
|
|
|
9355
9355
|
if (p = this._getStyle(v, h), d > 0) {
|
|
9356
9356
|
const y = i.getValue(d - 1, m);
|
|
9357
9357
|
if ((a = y == null ? void 0 : y.style) != null && a.includes("border-bottom") && p.includes("border-top")) {
|
|
9358
|
-
const
|
|
9359
|
-
|
|
9358
|
+
const M = th(y.style, "border-bottom");
|
|
9359
|
+
M && Cu(M.substr(M.indexOf(":") + 1)) !== "none" && (p = p.replace(/border-top:[^;]+;/, ""));
|
|
9360
9360
|
}
|
|
9361
9361
|
}
|
|
9362
9362
|
if (f > 0) {
|
|
9363
9363
|
const y = i.getValue(d, m - 1);
|
|
9364
9364
|
if ((c = y == null ? void 0 : y.style) != null && c.includes("border-right") && p.includes("border-left")) {
|
|
9365
|
-
const
|
|
9366
|
-
|
|
9365
|
+
const M = th(y.style, "border-right");
|
|
9366
|
+
M && Cu(M.substr(M.indexOf(":") + 1)) !== "none" && (p = p.replace(/border-left:[^;]+;/, ""));
|
|
9367
9367
|
}
|
|
9368
9368
|
}
|
|
9369
9369
|
const { cellText: S, cellRichStyle: I } = this._getCellTextAndRichText(v, p, n), R = {
|
|
@@ -10019,7 +10019,7 @@ let Zs = class extends oe {
|
|
|
10019
10019
|
const l = i.reduce((S, I) => {
|
|
10020
10020
|
var y;
|
|
10021
10021
|
const R = (y = I.getFilteredOutRows) == null ? void 0 : y.call(I, n);
|
|
10022
|
-
return R == null || R.forEach((
|
|
10022
|
+
return R == null || R.forEach((M) => S.add(M)), S;
|
|
10023
10023
|
}, /* @__PURE__ */ new Set()), { startColumn: a, startRow: c, endColumn: d, endRow: u } = n, h = s.getMatrixWithMergedCells(c, a, u, d, Bh.Both), g = new Ge();
|
|
10024
10024
|
let m = c;
|
|
10025
10025
|
const f = new Ge(), v = { rows: [], cols: [] };
|
|
@@ -10137,49 +10137,47 @@ let Zs = class extends oe {
|
|
|
10137
10137
|
}
|
|
10138
10138
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
10139
10139
|
async _pasteInternal(e, t) {
|
|
10140
|
-
var
|
|
10140
|
+
var S, I;
|
|
10141
10141
|
const n = le.deepClone(this._copyContentCache.get(e)), { range: i, matrix: o, unitId: s, subUnitId: l } = n || {};
|
|
10142
10142
|
if (!o || !n || !i || !s || !l || !o || !n)
|
|
10143
10143
|
return !1;
|
|
10144
|
-
const { mapFunc: a } = wr([i]), c = (
|
|
10145
|
-
o.forValue((
|
|
10146
|
-
const { row:
|
|
10147
|
-
if (
|
|
10148
|
-
for (let
|
|
10149
|
-
for (let
|
|
10150
|
-
if (
|
|
10151
|
-
const
|
|
10152
|
-
o.setValue(
|
|
10144
|
+
const { mapFunc: a } = wr([i]), c = (S = this._univerInstanceService.getUniverSheetInstance(s)) == null ? void 0 : S.getSheetBySheetId(l);
|
|
10145
|
+
o.forValue((R, y, M) => {
|
|
10146
|
+
const { row: E, col: T } = a(R, y), P = c == null ? void 0 : c.getComposedCellStyle(E, T), A = le.deepClone(M);
|
|
10147
|
+
if (A.s = P, o.setValue(R, y, A), M.colSpan || M.rowSpan)
|
|
10148
|
+
for (let H = 0; H < M.rowSpan; H++)
|
|
10149
|
+
for (let O = 0; O < M.colSpan; O++) {
|
|
10150
|
+
if (H === 0 && O === 0) continue;
|
|
10151
|
+
const V = R + H, W = y + O;
|
|
10152
|
+
o.setValue(V, W, { s: P });
|
|
10153
10153
|
}
|
|
10154
10154
|
});
|
|
10155
10155
|
const d = this._getPastedRange(o);
|
|
10156
10156
|
if (!d) return !1;
|
|
10157
|
-
const u = (
|
|
10157
|
+
const u = (I = this._univerInstanceService.getUniverSheetInstance(d.unitId)) == null ? void 0 : I.getSheetBySheetId(d.subUnitId);
|
|
10158
10158
|
if (!u)
|
|
10159
10159
|
return !1;
|
|
10160
10160
|
const h = u == null ? void 0 : u.getMergeData();
|
|
10161
|
-
if (h && h.some((
|
|
10161
|
+
if (h && h.some((y) => xa(y, d.pastedRange) && !ih(d.pastedRange, y)))
|
|
10162
10162
|
return this._errorService.emit(this._localeService.t("clipboard.paste.overlappingMergedCells")), !1;
|
|
10163
10163
|
const g = this._univerInstanceService.getUnit(s);
|
|
10164
10164
|
if (!g) return !1;
|
|
10165
10165
|
const m = g.getSheetBySheetId(l);
|
|
10166
10166
|
if (!m) return !1;
|
|
10167
|
-
const f = m.getColumnManager(), v = m.getRowManager(), p =
|
|
10168
|
-
if (i.cols.forEach((
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
const M = v.getRowOrCreate(E), { ah: T = C, h: P = C } = M, A = Math.max(T, P);
|
|
10173
|
-
S.push({ height: `${A}` });
|
|
10167
|
+
const f = m.getColumnManager(), v = m.getRowManager(), p = [], C = [];
|
|
10168
|
+
if (i.cols.forEach((R) => {
|
|
10169
|
+
p.push({ width: `${f.getColumnWidth(R)}` });
|
|
10170
|
+
}), i.rows.forEach((R) => {
|
|
10171
|
+
C.push({ height: `${v.getRowHeight(R)}` });
|
|
10174
10172
|
}), n.copyType === jn.CUT) {
|
|
10175
|
-
const
|
|
10176
|
-
d.pastedRange.rows = Array.from(new Array(
|
|
10173
|
+
const R = d.pastedRange.rows[0], y = i.rows[i.rows.length - 1] - i.rows[0] + R;
|
|
10174
|
+
d.pastedRange.rows = Array.from(new Array(y + 1).keys()).slice(R);
|
|
10177
10175
|
}
|
|
10178
|
-
const
|
|
10176
|
+
const _ = this._pasteUSM(
|
|
10179
10177
|
{
|
|
10180
10178
|
cellMatrix: o,
|
|
10181
|
-
colProperties:
|
|
10182
|
-
rowProperties:
|
|
10179
|
+
colProperties: p,
|
|
10180
|
+
rowProperties: C
|
|
10183
10181
|
},
|
|
10184
10182
|
// paste data
|
|
10185
10183
|
d,
|
|
@@ -10193,7 +10191,7 @@ let Zs = class extends oe {
|
|
|
10193
10191
|
copyId: e
|
|
10194
10192
|
}
|
|
10195
10193
|
);
|
|
10196
|
-
return n.copyType === jn.CUT && (this._copyContentCache.set(e, { ...n, matrix: null }), this._copyMarkId && this._markSelectionService.removeShape(this._copyMarkId), this._copyMarkId = null),
|
|
10194
|
+
return n.copyType === jn.CUT && (this._copyContentCache.set(e, { ...n, matrix: null }), this._copyMarkId && this._markSelectionService.removeShape(this._copyMarkId), this._copyMarkId = null), _;
|
|
10197
10195
|
}
|
|
10198
10196
|
// eslint-disable-next-line max-lines-per-function
|
|
10199
10197
|
_pasteUSM(e, t, n, i) {
|
|
@@ -10223,9 +10221,9 @@ let Zs = class extends oe {
|
|
|
10223
10221
|
(R) => !R.specialPasteInfo && R.id !== et.DEFAULT_PASTE || n === R.id
|
|
10224
10222
|
);
|
|
10225
10223
|
_.forEach((R) => {
|
|
10226
|
-
var
|
|
10224
|
+
var E, T, P;
|
|
10227
10225
|
if (o) {
|
|
10228
|
-
const A = (
|
|
10226
|
+
const A = (E = R.onPasteRows) == null ? void 0 : E.call(R, { range: d, unitId: a, subUnitId: c }, o, {
|
|
10229
10227
|
pasteType: n
|
|
10230
10228
|
});
|
|
10231
10229
|
A && (p.push(...A.redos), C.push(...A.undos));
|
|
@@ -10237,14 +10235,14 @@ let Zs = class extends oe {
|
|
|
10237
10235
|
{ pasteType: n }
|
|
10238
10236
|
);
|
|
10239
10237
|
y && (p.push(...y.redos), C.push(...y.undos));
|
|
10240
|
-
const
|
|
10238
|
+
const M = (P = R.onPasteCells) == null ? void 0 : P.call(
|
|
10241
10239
|
R,
|
|
10242
10240
|
f,
|
|
10243
10241
|
{ range: d, unitId: a, subUnitId: c },
|
|
10244
10242
|
l,
|
|
10245
10243
|
v
|
|
10246
10244
|
);
|
|
10247
|
-
|
|
10245
|
+
M && (p.push(...M.redos), C.push(...M.undos));
|
|
10248
10246
|
});
|
|
10249
10247
|
const S = this._getSetSelectionOperation(a, c, d, l, n);
|
|
10250
10248
|
S && p.push(S), p = rh(p), C = rh(C), C.push({ id: nt.id, params: { unitId: t.unitId, subUnitId: t.subUnitId } }), this._logService.log("[SheetClipboardService]", "pasting mutations", {
|
|
@@ -10375,10 +10373,10 @@ let Zs = class extends oe {
|
|
|
10375
10373
|
const S = C.getMergeData().filter(
|
|
10376
10374
|
(T) => a.rows.includes(T.startRow) && a.cols.includes(T.startColumn)
|
|
10377
10375
|
), I = S[0];
|
|
10378
|
-
let R = 0, y = 0,
|
|
10379
|
-
if (I && (R = I.startRow, y = I.startColumn,
|
|
10376
|
+
let R = 0, y = 0, M = 0, E = 0;
|
|
10377
|
+
if (I && (R = I.startRow, y = I.startColumn, M = I.endRow, E = I.endColumn), f % e === 0 && v % t === 0)
|
|
10380
10378
|
if (S.length > 0 && (f !== e || v !== t))
|
|
10381
|
-
if (R === a.rows[0] && y === a.cols[0] &&
|
|
10379
|
+
if (R === a.rows[0] && y === a.cols[0] && M === a.rows[f - 1] && E === a.cols[v - 1])
|
|
10382
10380
|
if (C0(n))
|
|
10383
10381
|
for (let P = 0; P < f; P++)
|
|
10384
10382
|
for (let A = 0; A < v; A++) {
|
|
@@ -10901,18 +10899,18 @@ const sa = {
|
|
|
10901
10899
|
p = I, _ = I - f, C = R, S = R - v;
|
|
10902
10900
|
else
|
|
10903
10901
|
return !1;
|
|
10904
|
-
const
|
|
10902
|
+
const M = {
|
|
10905
10903
|
unitId: s,
|
|
10906
10904
|
subUnitId: l,
|
|
10907
10905
|
startRow: p,
|
|
10908
10906
|
startColumn: C,
|
|
10909
10907
|
xSplit: C > 0 ? Math.max(1, S) : S,
|
|
10910
10908
|
ySplit: p > 0 ? Math.max(1, _) : _
|
|
10911
|
-
},
|
|
10912
|
-
return a.syncExecuteCommand(fr.id,
|
|
10909
|
+
}, E = ug(r, M);
|
|
10910
|
+
return a.syncExecuteCommand(fr.id, M) && i.pushUndoRedo({
|
|
10913
10911
|
unitID: s,
|
|
10914
|
-
undoMutations: [{ id: fr.id, params:
|
|
10915
|
-
redoMutations: [{ id: fr.id, params:
|
|
10912
|
+
undoMutations: [{ id: fr.id, params: E }],
|
|
10913
|
+
redoMutations: [{ id: fr.id, params: M }]
|
|
10916
10914
|
}), !0;
|
|
10917
10915
|
}
|
|
10918
10916
|
}, aa = {
|
|
@@ -10939,10 +10937,8 @@ const I0 = (r, e) => {
|
|
|
10939
10937
|
const { unitId: t, subUnitId: n, ranges: i } = r, o = {}, s = e.getColumnManager();
|
|
10940
10938
|
for (let l = 0; l < i.length; l++) {
|
|
10941
10939
|
const a = i[l];
|
|
10942
|
-
for (let c = a.startColumn; c < a.endColumn + 1; c++)
|
|
10943
|
-
|
|
10944
|
-
o[c] = d.w;
|
|
10945
|
-
}
|
|
10940
|
+
for (let c = a.startColumn; c < a.endColumn + 1; c++)
|
|
10941
|
+
o[c] = s.getColumnWidth(c);
|
|
10946
10942
|
}
|
|
10947
10943
|
return {
|
|
10948
10944
|
unitId: t,
|
|
@@ -11097,22 +11093,22 @@ function fe(r, e = {}, t = !1) {
|
|
|
11097
11093
|
return Ie(!0);
|
|
11098
11094
|
const C = r.get($), _ = r.get($e), S = r.get(ft), R = r.get(ke).subscribeContextValue$(Ml).pipe(Ia(!1));
|
|
11099
11095
|
return ct([C.selectionMoveEnd$, R]).pipe(
|
|
11100
|
-
Pn(([y,
|
|
11101
|
-
if (
|
|
11096
|
+
Pn(([y, M]) => {
|
|
11097
|
+
if (M)
|
|
11102
11098
|
return Ie(!0);
|
|
11103
|
-
const
|
|
11104
|
-
if (A == null || A.forEach((
|
|
11105
|
-
V.push(new
|
|
11106
|
-
}), H == null || H.forEach((
|
|
11107
|
-
V.push(new
|
|
11108
|
-
}), S.getRule(
|
|
11109
|
-
return P.composePermission$(V).pipe(fn((
|
|
11110
|
-
const
|
|
11111
|
-
return O == null || O.forEach((
|
|
11099
|
+
const E = m.getUnitId(), T = p.getSheetId(), P = r.get(rt), { workbookTypes: A = [K], worksheetTypes: H, rangeTypes: O } = e, V = [];
|
|
11100
|
+
if (A == null || A.forEach((z) => {
|
|
11101
|
+
V.push(new z(E).id);
|
|
11102
|
+
}), H == null || H.forEach((z) => {
|
|
11103
|
+
V.push(new z(E, T).id);
|
|
11104
|
+
}), S.getRule(E, T))
|
|
11105
|
+
return P.composePermission$(V).pipe(fn((z) => z.some((Z) => Z.value === !1)));
|
|
11106
|
+
const j = y == null ? void 0 : y.map((z) => z.range), B = _.getSubunitRuleList(E, T).filter((z) => j == null ? void 0 : j.some((Z) => z.ranges.some((ce) => ae.intersects(Z, ce))));
|
|
11107
|
+
return O == null || O.forEach((z) => {
|
|
11112
11108
|
B.forEach((Z) => {
|
|
11113
|
-
V.push(new
|
|
11109
|
+
V.push(new z(E, T, Z.permissionId).id);
|
|
11114
11110
|
});
|
|
11115
|
-
}), P.composePermission$(V).pipe(fn((
|
|
11111
|
+
}), P.composePermission$(V).pipe(fn((z) => z.some((Z) => Z.value === !1)));
|
|
11116
11112
|
})
|
|
11117
11113
|
);
|
|
11118
11114
|
})
|
|
@@ -12241,41 +12237,41 @@ let po = class extends oe {
|
|
|
12241
12237
|
let R = Wa / Math.max(1, I);
|
|
12242
12238
|
if (e === 0) {
|
|
12243
12239
|
(o === -1 || o === 0) && (R = R * 2);
|
|
12244
|
-
const
|
|
12240
|
+
const M = R;
|
|
12245
12241
|
this._rowFreezeHeaderRect = new we(r_, {
|
|
12246
12242
|
fill: this._freezeNormalHeaderColor,
|
|
12247
12243
|
width: p,
|
|
12248
12244
|
height: R,
|
|
12249
12245
|
left: 0,
|
|
12250
|
-
top: m -
|
|
12246
|
+
top: m - M,
|
|
12251
12247
|
zIndex: 3
|
|
12252
12248
|
});
|
|
12253
|
-
let
|
|
12254
|
-
(o === -1 || o === 0) && (
|
|
12255
|
-
fill:
|
|
12249
|
+
let E = this._freezeNormalHeaderColor;
|
|
12250
|
+
(o === -1 || o === 0) && (E = this._freezeNormalMainColor), this._rowFreezeMainRect = new we(n_, {
|
|
12251
|
+
fill: E,
|
|
12256
12252
|
width: _ * 2 / I,
|
|
12257
12253
|
height: R,
|
|
12258
12254
|
left: p,
|
|
12259
|
-
top: m -
|
|
12255
|
+
top: m - M,
|
|
12260
12256
|
zIndex: 3
|
|
12261
12257
|
}), h.addObjects([this._rowFreezeHeaderRect, this._rowFreezeMainRect], nr);
|
|
12262
12258
|
} else {
|
|
12263
12259
|
(s === -1 || s === 0) && (R = R * 2);
|
|
12264
|
-
const
|
|
12260
|
+
const M = R;
|
|
12265
12261
|
this._columnFreezeHeaderRect = new we(o_, {
|
|
12266
12262
|
fill: this._freezeNormalHeaderColor,
|
|
12267
12263
|
width: R,
|
|
12268
12264
|
height: C,
|
|
12269
|
-
left: g -
|
|
12265
|
+
left: g - M,
|
|
12270
12266
|
top: 0,
|
|
12271
12267
|
zIndex: 3
|
|
12272
12268
|
});
|
|
12273
|
-
let
|
|
12274
|
-
(s === -1 || s === 0) && (
|
|
12275
|
-
fill:
|
|
12269
|
+
let E = this._freezeNormalHeaderColor;
|
|
12270
|
+
(s === -1 || s === 0) && (E = this._freezeNormalMainColor), this._columnFreezeMainRect = new we(i_, {
|
|
12271
|
+
fill: E,
|
|
12276
12272
|
width: R,
|
|
12277
12273
|
height: S * 2 / I,
|
|
12278
|
-
left: g -
|
|
12274
|
+
left: g - M,
|
|
12279
12275
|
top: C,
|
|
12280
12276
|
zIndex: 3
|
|
12281
12277
|
}), h.addObjects([this._columnFreezeHeaderRect, this._columnFreezeMainRect], nr);
|
|
@@ -12346,7 +12342,7 @@ let po = class extends oe {
|
|
|
12346
12342
|
return;
|
|
12347
12343
|
const n = e.scene, i = Math.max(n.scaleX, n.scaleY), o = this._scrollManagerService.getCurrentScrollState(), s = (e.engine.height - t.columnHeaderHeight) / i, l = (e.engine.width - t.rowHeaderWidth) / i, a = (p = o == null ? void 0 : o.sheetViewStartRow) != null ? p : 0, c = a === 0 ? -((C = o == null ? void 0 : o.offsetY) != null ? C : 0) : t.rowHeightAccumulation[a - 1] - ((_ = o == null ? void 0 : o.offsetY) != null ? _ : 0);
|
|
12348
12344
|
let d = 0, u = !1;
|
|
12349
|
-
for (let y = a,
|
|
12345
|
+
for (let y = a, M = t.rowHeightAccumulation.length; y < M; y++)
|
|
12350
12346
|
if (t.rowHeightAccumulation[y] - c > s) {
|
|
12351
12347
|
d = y, u = !0;
|
|
12352
12348
|
break;
|
|
@@ -12354,7 +12350,7 @@ let po = class extends oe {
|
|
|
12354
12350
|
u || (d = t.rowHeightAccumulation.length - 1);
|
|
12355
12351
|
const h = (S = o == null ? void 0 : o.sheetViewStartColumn) != null ? S : 0, g = h === 0 ? -((I = o == null ? void 0 : o.offsetX) != null ? I : 0) : t.columnWidthAccumulation[h - 1] - ((R = o == null ? void 0 : o.offsetX) != null ? R : 0);
|
|
12356
12352
|
let m = 0, f = !1;
|
|
12357
|
-
for (let y = h,
|
|
12353
|
+
for (let y = h, M = t.columnWidthAccumulation.length; y < M; y++)
|
|
12358
12354
|
if (t.columnWidthAccumulation[y] - g > l) {
|
|
12359
12355
|
m = y, f = !0;
|
|
12360
12356
|
break;
|
|
@@ -12383,7 +12379,7 @@ let po = class extends oe {
|
|
|
12383
12379
|
this._activeViewport = null;
|
|
12384
12380
|
const h = this._getFreeze();
|
|
12385
12381
|
h && (this._changeToColumn = h.startColumn, this._changeToRow = h.startRow), this._scenePointerMoveSub = a.onPointerMove$.subscribeEvent((m) => {
|
|
12386
|
-
var R, y,
|
|
12382
|
+
var R, y, M, E;
|
|
12387
12383
|
const f = this._getActiveViewport(m), { startX: v, startY: p, row: C, column: _ } = Hn(
|
|
12388
12384
|
m.offsetX,
|
|
12389
12385
|
m.offsetY,
|
|
@@ -12404,13 +12400,13 @@ let po = class extends oe {
|
|
|
12404
12400
|
top: Math.min(p, d) - I / 2
|
|
12405
12401
|
})) == null || y.setProps({
|
|
12406
12402
|
fill: this._freezeNormalHeaderColor
|
|
12407
|
-
}), this._changeToRow = c === void 0 ? C : Math.min(C, c.lastRow), this._changeToOffsetY = Math.min(p, d), this._activeViewport = f) : ((
|
|
12403
|
+
}), this._changeToRow = c === void 0 ? C : Math.min(C, c.lastRow), this._changeToOffsetY = Math.min(p, d), this._activeViewport = f) : ((M = t.transformByState({
|
|
12408
12404
|
left: Math.min(v, u) - I / 2
|
|
12409
|
-
})) == null ||
|
|
12405
|
+
})) == null || M.setProps({
|
|
12410
12406
|
fill: this._freezeActiveColor
|
|
12411
|
-
}), (
|
|
12407
|
+
}), (E = n.transformByState({
|
|
12412
12408
|
left: Math.min(v, u) - I / 2
|
|
12413
|
-
})) == null ||
|
|
12409
|
+
})) == null || E.setProps({
|
|
12414
12410
|
fill: this._freezeNormalHeaderColor
|
|
12415
12411
|
}), this._changeToColumn = c === void 0 ? _ : Math.min(_, c.lastColumn), this._changeToOffsetX = v, this._activeViewport = f);
|
|
12416
12412
|
}), this._scenePointerUpSub = a.onPointerUp$.subscribeEvent(() => {
|
|
@@ -12445,12 +12441,12 @@ let po = class extends oe {
|
|
|
12445
12441
|
const S = this._context.unit, I = S.getActiveSheet();
|
|
12446
12442
|
if (!I) return;
|
|
12447
12443
|
const R = (T = I.getConfig()) == null ? void 0 : T.freeze;
|
|
12448
|
-
let y = (R == null ? void 0 : R.xSplit) || 0,
|
|
12449
|
-
const
|
|
12450
|
-
i === 0 && (!
|
|
12451
|
-
startRow:
|
|
12444
|
+
let y = (R == null ? void 0 : R.xSplit) || 0, M = (R == null ? void 0 : R.ySplit) || 0;
|
|
12445
|
+
const E = (P = this._activeViewport) == null ? void 0 : P.viewportKey;
|
|
12446
|
+
i === 0 && (!E || E === U.VIEW_LEFT_TOP || E === U.VIEW_MAIN_LEFT_TOP || E === U.VIEW_MAIN_TOP || E === U.VIEW_ROW_TOP ? M = this._changeToRow - (R.startRow - R.ySplit) : M = this._changeToRow - C, M = M < 0 ? 0 : M), i === 1 && (!E || E === U.VIEW_LEFT_TOP || E === U.VIEW_MAIN_LEFT_TOP || E === U.VIEW_MAIN_LEFT || E === U.VIEW_COLUMN_LEFT ? y = this._changeToColumn - (R.startColumn - R.xSplit) : y = this._changeToColumn - _, y = y < 0 ? 0 : y), this._commandService.executeCommand(gS.id, {
|
|
12447
|
+
startRow: M === 0 ? -1 : this._changeToRow,
|
|
12452
12448
|
startColumn: y === 0 ? -1 : this._changeToColumn,
|
|
12453
|
-
ySplit:
|
|
12449
|
+
ySplit: M,
|
|
12454
12450
|
xSplit: y,
|
|
12455
12451
|
unitId: S.getUnitId(),
|
|
12456
12452
|
subUnitId: I.getSheetId()
|
|
@@ -12574,10 +12570,10 @@ let po = class extends oe {
|
|
|
12574
12570
|
width: 0
|
|
12575
12571
|
});
|
|
12576
12572
|
else if (_ === !0 && S === !1) {
|
|
12577
|
-
const
|
|
12573
|
+
const M = R.startY - I.startY;
|
|
12578
12574
|
d.resizeWhenFreezeChange({
|
|
12579
12575
|
left: l,
|
|
12580
|
-
top: a +
|
|
12576
|
+
top: a + M,
|
|
12581
12577
|
bottom: 0,
|
|
12582
12578
|
right: 0
|
|
12583
12579
|
}), d.setPadding({
|
|
@@ -12591,7 +12587,7 @@ let po = class extends oe {
|
|
|
12591
12587
|
}), g.resizeWhenFreezeChange({
|
|
12592
12588
|
left: l,
|
|
12593
12589
|
top: a,
|
|
12594
|
-
height:
|
|
12590
|
+
height: M,
|
|
12595
12591
|
right: 0
|
|
12596
12592
|
}), g.updateScrollVal({
|
|
12597
12593
|
viewportScrollY: I.startY,
|
|
@@ -12601,19 +12597,19 @@ let po = class extends oe {
|
|
|
12601
12597
|
left: 0,
|
|
12602
12598
|
top: a,
|
|
12603
12599
|
width: l + 1,
|
|
12604
|
-
height:
|
|
12600
|
+
height: M
|
|
12605
12601
|
}), v.updateScrollVal({
|
|
12606
12602
|
viewportScrollY: I.startY
|
|
12607
12603
|
}), p.resizeWhenFreezeChange({
|
|
12608
12604
|
left: 0,
|
|
12609
|
-
top: a +
|
|
12605
|
+
top: a + M,
|
|
12610
12606
|
bottom: 0,
|
|
12611
12607
|
width: l + 1
|
|
12612
12608
|
}), g.enable(), v.enable();
|
|
12613
12609
|
} else if (_ === !1 && S === !0) {
|
|
12614
|
-
const
|
|
12610
|
+
const M = R.startX - I.startX;
|
|
12615
12611
|
d.resizeWhenFreezeChange({
|
|
12616
|
-
left: l +
|
|
12612
|
+
left: l + M,
|
|
12617
12613
|
top: a,
|
|
12618
12614
|
bottom: 0,
|
|
12619
12615
|
right: 0
|
|
@@ -12628,7 +12624,7 @@ let po = class extends oe {
|
|
|
12628
12624
|
}), h.resizeWhenFreezeChange({
|
|
12629
12625
|
left: l,
|
|
12630
12626
|
top: a,
|
|
12631
|
-
width:
|
|
12627
|
+
width: M,
|
|
12632
12628
|
bottom: 0,
|
|
12633
12629
|
right: 0
|
|
12634
12630
|
}), h.updateScrollVal({
|
|
@@ -12638,21 +12634,21 @@ let po = class extends oe {
|
|
|
12638
12634
|
}), m.resizeWhenFreezeChange({
|
|
12639
12635
|
left: l,
|
|
12640
12636
|
top: 0,
|
|
12641
|
-
width:
|
|
12637
|
+
width: M,
|
|
12642
12638
|
height: a + 1
|
|
12643
12639
|
}), m.updateScrollVal({
|
|
12644
12640
|
viewportScrollX: I.startX
|
|
12645
12641
|
}), f.resizeWhenFreezeChange({
|
|
12646
|
-
left: l +
|
|
12642
|
+
left: l + M,
|
|
12647
12643
|
top: 0,
|
|
12648
12644
|
height: a + 1,
|
|
12649
12645
|
right: 0
|
|
12650
12646
|
}), h.enable(), m.enable();
|
|
12651
12647
|
} else {
|
|
12652
|
-
const
|
|
12648
|
+
const M = R.startX - I.startX, E = R.startY - I.startY;
|
|
12653
12649
|
d.resizeWhenFreezeChange({
|
|
12654
|
-
left: l +
|
|
12655
|
-
top: a +
|
|
12650
|
+
left: l + M,
|
|
12651
|
+
top: a + E,
|
|
12656
12652
|
bottom: 0,
|
|
12657
12653
|
right: 0
|
|
12658
12654
|
}), d.setPadding({
|
|
@@ -12671,17 +12667,17 @@ let po = class extends oe {
|
|
|
12671
12667
|
} : null
|
|
12672
12668
|
}), h.resizeWhenFreezeChange({
|
|
12673
12669
|
left: l,
|
|
12674
|
-
top: a +
|
|
12675
|
-
width:
|
|
12670
|
+
top: a + E,
|
|
12671
|
+
width: M,
|
|
12676
12672
|
bottom: 0
|
|
12677
12673
|
}), h.updateScrollVal({
|
|
12678
12674
|
viewportScrollX: I.startX,
|
|
12679
12675
|
rawScrollY: d.scrollY,
|
|
12680
12676
|
viewportScrollY: d.viewportScrollY
|
|
12681
12677
|
}), g.resizeWhenFreezeChange({
|
|
12682
|
-
left: l +
|
|
12678
|
+
left: l + M,
|
|
12683
12679
|
top: a,
|
|
12684
|
-
height:
|
|
12680
|
+
height: E,
|
|
12685
12681
|
right: 0
|
|
12686
12682
|
}), g.updateScrollVal({
|
|
12687
12683
|
viewportScrollY: I.startY,
|
|
@@ -12690,8 +12686,8 @@ let po = class extends oe {
|
|
|
12690
12686
|
}), u.resizeWhenFreezeChange({
|
|
12691
12687
|
left: l,
|
|
12692
12688
|
top: a,
|
|
12693
|
-
width:
|
|
12694
|
-
height:
|
|
12689
|
+
width: M,
|
|
12690
|
+
height: E
|
|
12695
12691
|
}), u.updateScrollVal({
|
|
12696
12692
|
viewportScrollX: I.startX,
|
|
12697
12693
|
viewportScrollY: I.startY
|
|
@@ -12699,23 +12695,23 @@ let po = class extends oe {
|
|
|
12699
12695
|
left: 0,
|
|
12700
12696
|
top: a,
|
|
12701
12697
|
width: l + 1,
|
|
12702
|
-
height:
|
|
12698
|
+
height: E
|
|
12703
12699
|
}), v.updateScrollVal({
|
|
12704
12700
|
viewportScrollY: I.startY
|
|
12705
12701
|
}), p.resizeWhenFreezeChange({
|
|
12706
12702
|
left: 0,
|
|
12707
|
-
top: a +
|
|
12703
|
+
top: a + E,
|
|
12708
12704
|
bottom: 0,
|
|
12709
12705
|
width: l + 1
|
|
12710
12706
|
}), m.resizeWhenFreezeChange({
|
|
12711
12707
|
left: l,
|
|
12712
12708
|
top: 0,
|
|
12713
|
-
width:
|
|
12709
|
+
width: M,
|
|
12714
12710
|
height: a + 1
|
|
12715
12711
|
}), m.updateScrollVal({
|
|
12716
12712
|
viewportScrollX: I.startX
|
|
12717
12713
|
}), f.resizeWhenFreezeChange({
|
|
12718
|
-
left: l +
|
|
12714
|
+
left: l + M,
|
|
12719
12715
|
top: 0,
|
|
12720
12716
|
height: a + 1,
|
|
12721
12717
|
right: 0
|
|
@@ -13171,68 +13167,68 @@ let vo = class extends oe {
|
|
|
13171
13167
|
);
|
|
13172
13168
|
if (!y)
|
|
13173
13169
|
return;
|
|
13174
|
-
const
|
|
13170
|
+
const M = i.getScrollXYInfoByViewport(
|
|
13175
13171
|
Ve.FromArray([this._startOffsetX, this._startOffsetY])
|
|
13176
13172
|
);
|
|
13177
13173
|
this._newBackgroundAndLine(), i.setCursor(ye.GRABBING), i.disableObjectsEvent();
|
|
13178
|
-
let
|
|
13174
|
+
let E = !1, T;
|
|
13179
13175
|
const P = () => {
|
|
13180
|
-
if (
|
|
13176
|
+
if (E)
|
|
13181
13177
|
return;
|
|
13182
13178
|
T = Zr.create(i, I), this._scrollTimer = T;
|
|
13183
13179
|
const O = i.getViewport(U.VIEW_MAIN);
|
|
13184
|
-
T.startScroll(p, C, O),
|
|
13180
|
+
T.startScroll(p, C, O), E = !0;
|
|
13185
13181
|
};
|
|
13186
13182
|
this._dragHeaderMoveSub = i.onPointerMove$.subscribeEvent((O) => {
|
|
13187
13183
|
P();
|
|
13188
|
-
const { offsetX: V, offsetY: W } = O, { x:
|
|
13184
|
+
const { offsetX: V, offsetY: W } = O, { x: j, y: B } = i.getCoordRelativeToViewport(
|
|
13189
13185
|
Ve.FromArray([V, W])
|
|
13190
13186
|
);
|
|
13191
13187
|
this._rowColumnMoving(
|
|
13192
|
-
|
|
13188
|
+
j,
|
|
13193
13189
|
B,
|
|
13194
13190
|
y,
|
|
13195
|
-
|
|
13191
|
+
M,
|
|
13196
13192
|
e
|
|
13197
|
-
), T.scrolling(
|
|
13193
|
+
), T.scrolling(j, B, () => {
|
|
13198
13194
|
this._rowColumnMoving(
|
|
13199
|
-
|
|
13195
|
+
j,
|
|
13200
13196
|
B,
|
|
13201
13197
|
y,
|
|
13202
|
-
|
|
13198
|
+
M,
|
|
13203
13199
|
e
|
|
13204
13200
|
);
|
|
13205
13201
|
});
|
|
13206
13202
|
}), this._scenePointerUpSub = i.onPointerUp$.subscribeEvent(() => {
|
|
13207
|
-
var V, W,
|
|
13203
|
+
var V, W, j;
|
|
13208
13204
|
this._disposeBackgroundAndLine(), i.resetCursor(), i.enableObjectsEvent(), this._clearObserverEvent(), (V = this._scrollTimer) == null || V.dispose();
|
|
13209
13205
|
const O = this._workbookSelections.getCurrentSelections();
|
|
13210
13206
|
if (e === X.ROW) {
|
|
13211
13207
|
if (this._changeFromRow !== this._changeToRow && this._changeToRow !== -1) {
|
|
13212
|
-
const
|
|
13208
|
+
const z = (W = ((O == null ? void 0 : O.filter(
|
|
13213
13209
|
(Z) => Z.range.rangeType === X.ROW && Z.range.startRow <= this._changeFromRow && this._changeFromRow <= Z.range.endRow
|
|
13214
13210
|
)) || [])[0]) == null ? void 0 : W.range;
|
|
13215
|
-
|
|
13216
|
-
fromRange:
|
|
13211
|
+
z && this._commandService.executeCommand(bg.id, {
|
|
13212
|
+
fromRange: z,
|
|
13217
13213
|
toRange: {
|
|
13218
|
-
...
|
|
13214
|
+
...z,
|
|
13219
13215
|
startRow: this._changeToRow,
|
|
13220
|
-
endRow: this._changeToRow +
|
|
13216
|
+
endRow: this._changeToRow + z.endRow - z.startRow
|
|
13221
13217
|
}
|
|
13222
13218
|
});
|
|
13223
13219
|
}
|
|
13224
13220
|
this._changeToRow = this._changeFromRow = -1;
|
|
13225
13221
|
} else {
|
|
13226
13222
|
if (this._changeFromColumn !== this._changeToColumn && this._changeToColumn !== -1) {
|
|
13227
|
-
const
|
|
13223
|
+
const z = (j = ((O == null ? void 0 : O.filter(
|
|
13228
13224
|
(Z) => Z.range.rangeType === X.COLUMN && Z.range.startColumn <= this._changeFromColumn && this._changeFromColumn <= Z.range.endColumn
|
|
13229
|
-
)) || [])[0]) == null ? void 0 :
|
|
13230
|
-
|
|
13231
|
-
fromRange:
|
|
13225
|
+
)) || [])[0]) == null ? void 0 : j.range;
|
|
13226
|
+
z && this._commandService.executeCommand(_g.id, {
|
|
13227
|
+
fromRange: z,
|
|
13232
13228
|
toRange: {
|
|
13233
|
-
...
|
|
13229
|
+
...z,
|
|
13234
13230
|
startColumn: this._changeToColumn,
|
|
13235
|
-
endColumn: this._changeToColumn +
|
|
13231
|
+
endColumn: this._changeToColumn + z.endColumn - z.startColumn
|
|
13236
13232
|
}
|
|
13237
13233
|
});
|
|
13238
13234
|
}
|
|
@@ -13244,7 +13240,7 @@ let vo = class extends oe {
|
|
|
13244
13240
|
}
|
|
13245
13241
|
// eslint-disable-next-line max-lines-per-function
|
|
13246
13242
|
_rowColumnMoving(e, t, n, i, o) {
|
|
13247
|
-
var B,
|
|
13243
|
+
var B, z, Z, ce, ge, se, _e;
|
|
13248
13244
|
const s = this._context.scene, l = (B = this._sheetSkeletonManagerService.getCurrentParam()) == null ? void 0 : B.skeleton;
|
|
13249
13245
|
if (l == null)
|
|
13250
13246
|
return;
|
|
@@ -13257,8 +13253,8 @@ let vo = class extends oe {
|
|
|
13257
13253
|
), { row: v, column: p } = f, C = l.getNoMergeCellWithCoordByIndex(v, p), { startX: _, startY: S, endX: I, endY: R } = C, y = this._sheetSkeletonManagerService.attachRangeWithCoord(n.range);
|
|
13258
13254
|
if (y == null)
|
|
13259
13255
|
return;
|
|
13260
|
-
const
|
|
13261
|
-
startX:
|
|
13256
|
+
const M = Math.max(g, g), {
|
|
13257
|
+
startX: E,
|
|
13262
13258
|
endX: T,
|
|
13263
13259
|
startY: P,
|
|
13264
13260
|
endY: A,
|
|
@@ -13267,28 +13263,28 @@ let vo = class extends oe {
|
|
|
13267
13263
|
endRow: V,
|
|
13268
13264
|
endColumn: W
|
|
13269
13265
|
} = y;
|
|
13270
|
-
o === X.ROW ? (
|
|
13266
|
+
o === X.ROW ? (z = this._moveHelperBackgroundShape) == null || z.transformByState({
|
|
13271
13267
|
height: A - P,
|
|
13272
13268
|
width: u + a,
|
|
13273
13269
|
left: 0,
|
|
13274
|
-
top: P + (t - this._startOffsetY) /
|
|
13270
|
+
top: P + (t - this._startOffsetY) / M + h.y - i.y
|
|
13275
13271
|
}) : (Z = this._moveHelperBackgroundShape) == null || Z.transformByState({
|
|
13276
13272
|
height: d + c,
|
|
13277
|
-
width: T -
|
|
13278
|
-
left:
|
|
13273
|
+
width: T - E,
|
|
13274
|
+
left: E + (e - this._startOffsetX) / M + h.x - i.x,
|
|
13279
13275
|
top: 0
|
|
13280
13276
|
}), (ce = this._moveHelperBackgroundShape) == null || ce.show();
|
|
13281
|
-
const
|
|
13277
|
+
const j = m_ / M;
|
|
13282
13278
|
if (o === X.ROW) {
|
|
13283
13279
|
let G = 0;
|
|
13284
13280
|
if (v <= H)
|
|
13285
|
-
G = S -
|
|
13281
|
+
G = S - j / 2, this._changeToRow = v;
|
|
13286
13282
|
else if (v > V)
|
|
13287
|
-
G = R -
|
|
13283
|
+
G = R - j / 2, this._changeToRow = v + 1;
|
|
13288
13284
|
else
|
|
13289
13285
|
return;
|
|
13290
13286
|
(ge = this._moveHelperLineShape) == null || ge.transformByState({
|
|
13291
|
-
height:
|
|
13287
|
+
height: j,
|
|
13292
13288
|
width: u,
|
|
13293
13289
|
left: a,
|
|
13294
13290
|
top: G
|
|
@@ -13296,14 +13292,14 @@ let vo = class extends oe {
|
|
|
13296
13292
|
} else {
|
|
13297
13293
|
let G = 0;
|
|
13298
13294
|
if (p <= O)
|
|
13299
|
-
G = _ -
|
|
13295
|
+
G = _ - j / 2, this._changeToColumn = p;
|
|
13300
13296
|
else if (p > W)
|
|
13301
|
-
G = I -
|
|
13297
|
+
G = I - j / 2, this._changeToColumn = p + 1;
|
|
13302
13298
|
else
|
|
13303
13299
|
return;
|
|
13304
13300
|
(se = this._moveHelperLineShape) == null || se.transformByState({
|
|
13305
13301
|
height: d,
|
|
13306
|
-
width:
|
|
13302
|
+
width: j,
|
|
13307
13303
|
left: G,
|
|
13308
13304
|
top: c
|
|
13309
13305
|
});
|
|
@@ -13447,8 +13443,8 @@ let Ks = class extends oe {
|
|
|
13447
13443
|
var d, u;
|
|
13448
13444
|
(d = this._rowResizeRect) == null || d.hide(), (u = this._columnResizeRect) == null || u.hide();
|
|
13449
13445
|
}, l = (a, c) => {
|
|
13450
|
-
var
|
|
13451
|
-
const d = (
|
|
13446
|
+
var M;
|
|
13447
|
+
const d = (M = this._sheetSkeletonManagerService.getCurrentParam()) == null ? void 0 : M.skeleton;
|
|
13452
13448
|
if (d == null || this._rowResizeRect == null || this._columnResizeRect == null)
|
|
13453
13449
|
return;
|
|
13454
13450
|
const { rowHeaderWidth: u, columnHeaderHeight: h } = d, { startX: g, startY: m, endX: f, endY: v, row: p, column: C } = Hn(
|
|
@@ -13458,11 +13454,11 @@ let Ks = class extends oe {
|
|
|
13458
13454
|
d
|
|
13459
13455
|
), _ = ps(a.offsetX, a.offsetY, i), { scaleX: S, scaleY: I } = i.getAncestorScale(), R = Math.max(S, I), y = ji / R;
|
|
13460
13456
|
if (e === 0) {
|
|
13461
|
-
let
|
|
13457
|
+
let E = m - y / 2;
|
|
13462
13458
|
if (_.y <= m + y / 2 && _.y >= m)
|
|
13463
13459
|
this._currentRow = p - 1;
|
|
13464
13460
|
else if (_.y >= v - y / 2 && _.y <= v)
|
|
13465
|
-
this._currentRow = p,
|
|
13461
|
+
this._currentRow = p, E = v - y / 2;
|
|
13466
13462
|
else {
|
|
13467
13463
|
this._rowResizeRect.hide();
|
|
13468
13464
|
return;
|
|
@@ -13474,16 +13470,16 @@ let Ks = class extends oe {
|
|
|
13474
13470
|
const P = Math.min(p_, u / 3);
|
|
13475
13471
|
this._rowResizeRect.transformByState({
|
|
13476
13472
|
left: u / 2 - P / 2,
|
|
13477
|
-
top:
|
|
13473
|
+
top: E
|
|
13478
13474
|
}), this._rowResizeRect.setShapeProps({
|
|
13479
13475
|
size: P
|
|
13480
13476
|
}), this._rowResizeRect.show();
|
|
13481
13477
|
} else {
|
|
13482
|
-
let
|
|
13478
|
+
let E = g - y / 2;
|
|
13483
13479
|
if (_.x <= g + y / 2 && _.x >= g)
|
|
13484
13480
|
this._currentColumn = C - 1;
|
|
13485
13481
|
else if (_.x >= f - y / 2 && _.x <= f)
|
|
13486
|
-
this._currentColumn = C,
|
|
13482
|
+
this._currentColumn = C, E = f - y / 2;
|
|
13487
13483
|
else {
|
|
13488
13484
|
this._columnResizeRect.hide();
|
|
13489
13485
|
return;
|
|
@@ -13494,7 +13490,7 @@ let Ks = class extends oe {
|
|
|
13494
13490
|
return !1;
|
|
13495
13491
|
const P = h * 0.7;
|
|
13496
13492
|
this._columnResizeRect.transformByState({
|
|
13497
|
-
left:
|
|
13493
|
+
left: E,
|
|
13498
13494
|
top: h / 2 - P / 2
|
|
13499
13495
|
}), this._columnResizeRect.setShapeProps({
|
|
13500
13496
|
size: P
|
|
@@ -13517,14 +13513,14 @@ let Ks = class extends oe {
|
|
|
13517
13513
|
})
|
|
13518
13514
|
), this.disposeWithMe(
|
|
13519
13515
|
n.onPointerDown$.subscribeEvent((i) => {
|
|
13520
|
-
var W,
|
|
13516
|
+
var W, j, B, z, Z, ce, ge;
|
|
13521
13517
|
const o = (W = this._sheetSkeletonManagerService.getCurrentParam()) == null ? void 0 : W.skeleton;
|
|
13522
13518
|
if (o == null) return;
|
|
13523
|
-
const s = this._context.scene, l = s.getEngine(), a = (l == null ? void 0 : l.height) || 0, c = (l == null ? void 0 : l.width) || 0, d = s.getViewport(U.VIEW_MAIN), u = (((B = (
|
|
13519
|
+
const s = this._context.scene, l = s.getEngine(), a = (l == null ? void 0 : l.height) || 0, c = (l == null ? void 0 : l.width) || 0, d = s.getViewport(U.VIEW_MAIN), u = (((B = (j = d == null ? void 0 : d.getScrollBar()) == null ? void 0 : j.horizonScrollTrack) == null ? void 0 : B.height) || 0) + 10, h = (((Z = (z = d == null ? void 0 : d.getScrollBar()) == null ? void 0 : z.verticalScrollTrack) == null ? void 0 : Z.width) || 0) + 10, g = ps(i.offsetX, i.offsetY, s), { scaleX: m, scaleY: f } = s.getAncestorScale();
|
|
13524
13520
|
this._startOffsetX = g.x, this._startOffsetY = g.y;
|
|
13525
13521
|
const v = o.getOffsetByColumn(this._currentColumn), p = o.getOffsetByRow(this._currentRow), C = o.getNoMergeCellWithCoordByIndex(this._currentRow, this._currentColumn);
|
|
13526
13522
|
let _ = !1, S = 0, I = 0;
|
|
13527
|
-
const { columnTotalWidth: R, rowHeaderWidth: y, rowTotalHeight:
|
|
13523
|
+
const { columnTotalWidth: R, rowHeaderWidth: y, rowTotalHeight: M, columnHeaderHeight: E } = o, T = c > R + y ? c : R + y, P = a > M + E ? a : M + E, A = Math.max(m, f), H = Fc / A;
|
|
13528
13524
|
e === 0 ? this._resizeHelperShape = new we(hh, {
|
|
13529
13525
|
width: T,
|
|
13530
13526
|
height: H,
|
|
@@ -13986,10 +13982,10 @@ function fh(r, e, t, n, i) {
|
|
|
13986
13982
|
const a = i.getFreeze(), { startColumn: c, startRow: d, xSplit: u, ySplit: h } = a, g = n.getNoMergeCellWithCoordByIndex(d - h, c - u, !1), m = n.getNoMergeCellWithCoordByIndex(d, c, !1), { rowHeaderWidth: f, columnHeaderHeight: v } = n, p = m.startX - g.startX, C = m.startY - g.startY, { top: _, left: S, viewportScrollX: I, viewportScrollY: R } = l;
|
|
13987
13983
|
let y;
|
|
13988
13984
|
r > S ? y = (r - I) * o : y = (p + f - (S - r)) * o;
|
|
13989
|
-
let
|
|
13990
|
-
return e > _ ?
|
|
13985
|
+
let M;
|
|
13986
|
+
return e > _ ? M = (e - R) * s : M = (C + v - (_ - e)) * o, {
|
|
13991
13987
|
x: y,
|
|
13992
|
-
y:
|
|
13988
|
+
y: M
|
|
13993
13989
|
};
|
|
13994
13990
|
}
|
|
13995
13991
|
function x_(r, e, t, n, i) {
|
|
@@ -14020,8 +14016,8 @@ function of(r, e, t, n, i, o) {
|
|
|
14020
14016
|
row: h,
|
|
14021
14017
|
col: u
|
|
14022
14018
|
};
|
|
14023
|
-
a.overflowCache.forValue((R, y,
|
|
14024
|
-
|
|
14019
|
+
a.overflowCache.forValue((R, y, M) => {
|
|
14020
|
+
M.startRow <= h && M.endRow >= h && M.startColumn <= u && M.endColumn >= u && (u = y, h = R);
|
|
14025
14021
|
});
|
|
14026
14022
|
const m = a.getCellWithCoordByIndex(h, u), f = x_(e, t, a, h, u);
|
|
14027
14023
|
let v;
|
|
@@ -14075,8 +14071,8 @@ const ir = {
|
|
|
14075
14071
|
ranges: le.deepClone(d)
|
|
14076
14072
|
}, p = Wl(r, f), C = Fl(r, v);
|
|
14077
14073
|
if (p.ranges.length > 0 && h.push({ id: Kt.id, params: p }), h.push({ id: Qt.id, params: v }), g.push({ id: Kt.id, params: C }), p.ranges.length > 0 && g.push({ id: Qt.id, params: p }), m) {
|
|
14078
|
-
const
|
|
14079
|
-
h.unshift(...
|
|
14074
|
+
const M = rf(r, l, u, d);
|
|
14075
|
+
h.unshift(...M.redos), g.push(...M.undos);
|
|
14080
14076
|
}
|
|
14081
14077
|
const _ = _S(r, e, d);
|
|
14082
14078
|
_ && h.push(_);
|
|
@@ -15110,24 +15106,24 @@ let gi = class extends oe {
|
|
|
15110
15106
|
}
|
|
15111
15107
|
_createHiddenRectObserver(e) {
|
|
15112
15108
|
const { row: t, column: n, worksheet: i, skeleton: o, currentRender: s } = e, l = () => {
|
|
15113
|
-
var B,
|
|
15114
|
-
const u = i.getFreeze(), { startRow: h, startColumn: g, xSplit: m, ySplit: f } = u, v = h - f, p = g - m, { rowHeightAccumulation: C, columnWidthAccumulation: _, rowHeaderWidth: S, columnHeaderHeight: I } = o, R = S + (p === -1 ? 0 : _[p + m - 1] - ((B = _[p - 1]) != null ? B : 0)), y = I + (v === -1 ? 0 : C[v + f - 1] - ((
|
|
15109
|
+
var B, z;
|
|
15110
|
+
const u = i.getFreeze(), { startRow: h, startColumn: g, xSplit: m, ySplit: f } = u, v = h - f, p = g - m, { rowHeightAccumulation: C, columnWidthAccumulation: _, rowHeaderWidth: S, columnHeaderHeight: I } = o, R = S + (p === -1 ? 0 : _[p + m - 1] - ((B = _[p - 1]) != null ? B : 0)), y = I + (v === -1 ? 0 : C[v + f - 1] - ((z = C[v]) != null ? z : 0)), M = s.engine.getCanvasElement(), E = M.getBoundingClientRect(), T = ja(M.style.width), P = E.width / T, A = s.scene.getAncestorScale().scaleX, H = R * P * A, O = y * P * A, V = {
|
|
15115
15111
|
left: -1 / 0,
|
|
15116
15112
|
top: -1 / 0,
|
|
15117
|
-
right:
|
|
15118
|
-
bottom:
|
|
15113
|
+
right: E.left + H,
|
|
15114
|
+
bottom: E.top + O
|
|
15119
15115
|
}, W = {
|
|
15120
|
-
left:
|
|
15116
|
+
left: E.left + H,
|
|
15121
15117
|
top: -1 / 0,
|
|
15122
15118
|
right: 1 / 0,
|
|
15123
|
-
bottom:
|
|
15124
|
-
},
|
|
15119
|
+
bottom: E.top + O
|
|
15120
|
+
}, j = {
|
|
15125
15121
|
left: -1 / 0,
|
|
15126
|
-
top:
|
|
15127
|
-
right:
|
|
15122
|
+
top: E.top + O,
|
|
15123
|
+
right: E.left + H,
|
|
15128
15124
|
bottom: 1 / 0
|
|
15129
15125
|
};
|
|
15130
|
-
return t < h && n < g ? [] : t < h ? [V] : n < g ? [V] : [V, W,
|
|
15126
|
+
return t < h && n < g ? [] : t < h ? [V] : n < g ? [V] : [V, W, j];
|
|
15131
15127
|
}, a = l(), c = new Ee(a), d = new gt();
|
|
15132
15128
|
return d.add(this._commandService.onCommandExecuted((u) => {
|
|
15133
15129
|
u.id === fr.id && c.next(l());
|
|
@@ -15316,8 +15312,8 @@ let gi = class extends oe {
|
|
|
15316
15312
|
this._globalPopupManagerService.removePopup(I), v.complete();
|
|
15317
15313
|
})), R.add(S);
|
|
15318
15314
|
const y = { startRow: e, endRow: e, startColumn: t, endColumn: t };
|
|
15319
|
-
return R.add(this._refRangeService.watchRange(c, d, y, (
|
|
15320
|
-
|
|
15315
|
+
return R.add(this._refRangeService.watchRange(c, d, y, (M, E) => {
|
|
15316
|
+
E ? C(E.startRow, E.startColumn) : R.dispose();
|
|
15321
15317
|
})), {
|
|
15322
15318
|
dispose() {
|
|
15323
15319
|
R.dispose();
|
|
@@ -15365,16 +15361,16 @@ let gi = class extends oe {
|
|
|
15365
15361
|
anchorRect$: v,
|
|
15366
15362
|
canvasElement: u.engine.getCanvasElement(),
|
|
15367
15363
|
hiddenRects$: I
|
|
15368
|
-
}),
|
|
15369
|
-
|
|
15364
|
+
}), M = new gt();
|
|
15365
|
+
M.add(p), M.add(We(() => {
|
|
15370
15366
|
this._globalPopupManagerService.removePopup(y), _.complete(), S.complete();
|
|
15371
|
-
})),
|
|
15372
|
-
const
|
|
15373
|
-
return
|
|
15374
|
-
P ? C(P.startRow, P.startColumn) :
|
|
15367
|
+
})), M.add(R);
|
|
15368
|
+
const E = { ...e };
|
|
15369
|
+
return M.add(this._refRangeService.watchRange(c, d, E, (T, P) => {
|
|
15370
|
+
P ? C(P.startRow, P.startColumn) : M.dispose();
|
|
15375
15371
|
})), {
|
|
15376
15372
|
dispose() {
|
|
15377
|
-
|
|
15373
|
+
M.dispose();
|
|
15378
15374
|
},
|
|
15379
15375
|
canDispose: () => this._globalPopupManagerService.activePopupId !== y
|
|
15380
15376
|
};
|
|
@@ -15588,12 +15584,12 @@ const J_ = (r) => {
|
|
|
15588
15584
|
} = r, g = D(N).getCurrentUnitForType(x.UNIVER_SHEET), m = D(Pe), f = D(Uo), v = D(Yg), p = D(jg), C = D(Zt), _ = wt(() => C.get(tm), []), S = wt(() => C.get(Od), []);
|
|
15589
15585
|
if (g == null)
|
|
15590
15586
|
return;
|
|
15591
|
-
const I = wt(() => g.getUnitId(), []), R = wt(() => g.getActiveSheet().getSheetId(), []), [y,
|
|
15587
|
+
const I = wt(() => g.getUnitId(), []), R = wt(() => g.getActiveSheet().getSheetId(), []), [y, M] = re(s), [E, T] = re(l), [P, A] = re(a), [H, O] = re(c), [V, W] = re(""), [j, B] = re(n), [z, Z] = re(!0), ce = [{
|
|
15592
15588
|
label: m.t("definedName.scopeWorkbook"),
|
|
15593
15589
|
value: Ic
|
|
15594
15590
|
}], ge = (pe) => !Zg(pe);
|
|
15595
15591
|
Me(() => {
|
|
15596
|
-
Z(!0),
|
|
15592
|
+
Z(!0), M(s), A(a), O(c);
|
|
15597
15593
|
let pe = l;
|
|
15598
15594
|
l.substring(0, 1) === Br.EQUALS ? B("formula") : ge(l) ? (B("formula"), pe = Br.EQUALS + l) : B("range"), T(pe), W("");
|
|
15599
15595
|
}, [t]), g.getSheetOrders().forEach((pe) => {
|
|
@@ -15627,11 +15623,11 @@ const J_ = (r) => {
|
|
|
15627
15623
|
W(m.t("definedName.nameSheetConflict"));
|
|
15628
15624
|
return;
|
|
15629
15625
|
}
|
|
15630
|
-
if (
|
|
15626
|
+
if (E.length === 0) {
|
|
15631
15627
|
W(m.t("definedName.formulaOrRefStringEmpty"));
|
|
15632
15628
|
return;
|
|
15633
15629
|
}
|
|
15634
|
-
if (!
|
|
15630
|
+
if (!z) {
|
|
15635
15631
|
W(m.t("definedName.formulaOrRefStringInvalid"));
|
|
15636
15632
|
return;
|
|
15637
15633
|
}
|
|
@@ -15643,7 +15639,7 @@ const J_ = (r) => {
|
|
|
15643
15639
|
i && i({
|
|
15644
15640
|
id: u || "",
|
|
15645
15641
|
name: y,
|
|
15646
|
-
formulaOrRefString: p.convertRefersToAbsolute(
|
|
15642
|
+
formulaOrRefString: p.convertRefersToAbsolute(E, au.ALL, au.ALL, Re),
|
|
15647
15643
|
comment: P,
|
|
15648
15644
|
localSheetId: H
|
|
15649
15645
|
});
|
|
@@ -15668,19 +15664,19 @@ const J_ = (r) => {
|
|
|
15668
15664
|
placeholder: m.t("definedName.inputNamePlaceholder"),
|
|
15669
15665
|
value: y,
|
|
15670
15666
|
allowClear: !0,
|
|
15671
|
-
onChange:
|
|
15667
|
+
onChange: M
|
|
15672
15668
|
}
|
|
15673
15669
|
) }),
|
|
15674
|
-
/* @__PURE__ */ w("div", { children: /* @__PURE__ */ q(Ec, { value:
|
|
15670
|
+
/* @__PURE__ */ w("div", { children: /* @__PURE__ */ q(Ec, { value: j, onChange: ee, children: [
|
|
15675
15671
|
/* @__PURE__ */ w(zr, { value: "range", children: m.t("definedName.ratioRange") }),
|
|
15676
15672
|
/* @__PURE__ */ w(zr, { value: "formula", children: m.t("definedName.ratioFormula") })
|
|
15677
15673
|
] }) }),
|
|
15678
|
-
|
|
15674
|
+
j === "range" ? _ && /* @__PURE__ */ w(
|
|
15679
15675
|
_,
|
|
15680
15676
|
{
|
|
15681
15677
|
unitId: I,
|
|
15682
15678
|
subUnitId: R,
|
|
15683
|
-
initialValue:
|
|
15679
|
+
initialValue: E,
|
|
15684
15680
|
onChange: (pe, Re) => se(Re),
|
|
15685
15681
|
supportAcrossSheet: !0
|
|
15686
15682
|
}
|
|
@@ -15689,7 +15685,7 @@ const J_ = (r) => {
|
|
|
15689
15685
|
{
|
|
15690
15686
|
ref: ne,
|
|
15691
15687
|
className: He("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent dark:!univer-bg-gray-700 dark:!univer-text-white hover:univer-border-primary-600", wi),
|
|
15692
|
-
initValue:
|
|
15688
|
+
initValue: E,
|
|
15693
15689
|
unitId: I,
|
|
15694
15690
|
subUnitId: R,
|
|
15695
15691
|
isFocus: ve,
|
|
@@ -15774,11 +15770,11 @@ const J_ = (r) => {
|
|
|
15774
15770
|
}, []);
|
|
15775
15771
|
const v = (P) => {
|
|
15776
15772
|
const { name: A, formulaOrRefString: H, comment: O, localSheetId: V, hidden: W } = P;
|
|
15777
|
-
let
|
|
15778
|
-
if (
|
|
15779
|
-
|
|
15773
|
+
let j = P.id;
|
|
15774
|
+
if (j == null || j.length === 0)
|
|
15775
|
+
j = le.generateRandomId(10), r.executeCommand(MS.id, { id: j, unitId: s, name: A, formulaOrRefString: H, comment: O, localSheetId: V, hidden: W });
|
|
15780
15776
|
else {
|
|
15781
|
-
const B = { id:
|
|
15777
|
+
const B = { id: j, unitId: s, name: A, formulaOrRefString: H, comment: O, localSheetId: V, hidden: W };
|
|
15782
15778
|
r.executeCommand(ES.id, B);
|
|
15783
15779
|
}
|
|
15784
15780
|
c(!1), g(null);
|
|
@@ -15817,9 +15813,9 @@ const J_ = (r) => {
|
|
|
15817
15813
|
return A == null ? "" : A.map((V) => Gg(P, V.range)).join(",");
|
|
15818
15814
|
}, y = () => {
|
|
15819
15815
|
c(!1), g(null);
|
|
15820
|
-
},
|
|
15816
|
+
}, M = () => {
|
|
15821
15817
|
c(!0), g(null);
|
|
15822
|
-
},
|
|
15818
|
+
}, E = (P) => {
|
|
15823
15819
|
c(!1), g(P);
|
|
15824
15820
|
}, T = (P) => {
|
|
15825
15821
|
const A = t.getSheetBySheetId(P);
|
|
@@ -15841,7 +15837,7 @@ const J_ = (r) => {
|
|
|
15841
15837
|
"univer-hidden": a
|
|
15842
15838
|
}
|
|
15843
15839
|
),
|
|
15844
|
-
onClick:
|
|
15840
|
+
onClick: M,
|
|
15845
15841
|
children: [
|
|
15846
15842
|
/* @__PURE__ */ w(Bd, {}),
|
|
15847
15843
|
/* @__PURE__ */ w("span", { className: "univer-ml-1", children: n.t("definedName.addButton") })
|
|
@@ -15899,7 +15895,7 @@ const J_ = (r) => {
|
|
|
15899
15895
|
{
|
|
15900
15896
|
className: "univer-absolute univer-right-[60px] univer-top-1/2 univer-hidden -univer-translate-y-1/2 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-p-1 univer-text-xs univer-text-primary-600 dark:hover:!univer-bg-gray-600 group-hover:univer-flex hover:univer-bg-gray-100",
|
|
15901
15897
|
onClick: (H) => {
|
|
15902
|
-
H.stopPropagation(),
|
|
15898
|
+
H.stopPropagation(), E(P.id);
|
|
15903
15899
|
},
|
|
15904
15900
|
children: /* @__PURE__ */ w(Im, {})
|
|
15905
15901
|
}
|
|
@@ -16420,8 +16416,8 @@ function Cb(r) {
|
|
|
16420
16416
|
c.ruleChange$
|
|
16421
16417
|
).pipe(
|
|
16422
16418
|
Be(() => {
|
|
16423
|
-
var
|
|
16424
|
-
const h = o.getUnitId(), g = l.getSheetId(), m = t.getSubunitRuleList(h, g), f = (
|
|
16419
|
+
var M, E;
|
|
16420
|
+
const h = o.getUnitId(), g = l.getSheetId(), m = t.getSubunitRuleList(h, g), f = (M = u.getCurrentSelections()) == null ? void 0 : M.map((T) => T.range);
|
|
16425
16421
|
if (m.map((T) => T.ranges).flat(), !(f != null && f.length) || f.length > 1)
|
|
16426
16422
|
return !0;
|
|
16427
16423
|
const v = f[0];
|
|
@@ -16429,7 +16425,7 @@ function Cb(r) {
|
|
|
16429
16425
|
return !0;
|
|
16430
16426
|
const p = c.getRule(h, g);
|
|
16431
16427
|
if (p != null && p.permissionId)
|
|
16432
|
-
return ((
|
|
16428
|
+
return ((E = d.getPermissionPoint(new AS(h, g).id)) == null ? void 0 : E.value) === !1;
|
|
16433
16429
|
if (m.filter((T) => T.ranges.some((P) => ae.intersects(P, v))).length !== 1)
|
|
16434
16430
|
return !0;
|
|
16435
16431
|
const { startRow: _, endRow: S, startColumn: I, endColumn: R } = v, y = r.get(Wo);
|
|
@@ -16484,18 +16480,18 @@ function Sf(r) {
|
|
|
16484
16480
|
return ct([n, i.currentUser$, a, l]).pipe(
|
|
16485
16481
|
at(([d, u, h, g]) => !d || h != null && h.visible && h.unitId === d.getUnitId() || g ? Ie(!0) : d.activeSheet$.pipe(
|
|
16486
16482
|
at((m) => {
|
|
16487
|
-
var
|
|
16483
|
+
var M;
|
|
16488
16484
|
if (!m)
|
|
16489
16485
|
return Ie(!0);
|
|
16490
|
-
const v = r.get(ke).subscribeContextValue$(Ml).pipe(xt(!1)), p = d.getUnitId(), C = m.getSheetId(), _ = r.get($e), S = r.get(ft), I = r.get($), R = (
|
|
16486
|
+
const v = r.get(ke).subscribeContextValue$(Ml).pipe(xt(!1)), p = d.getUnitId(), C = m.getSheetId(), _ = r.get($e), S = r.get(ft), I = r.get($), R = (M = t.composePermission$([new Ul(p).id]).pipe(Be((E) => E.every((T) => T.value)))) != null ? M : Ie(!1), y = St(
|
|
16491
16487
|
_.ruleChange$,
|
|
16492
16488
|
S.ruleChange$
|
|
16493
16489
|
).pipe(
|
|
16494
16490
|
xt(null)
|
|
16495
16491
|
);
|
|
16496
16492
|
return ct([R, y, I.selectionMoveEnd$, v]).pipe(
|
|
16497
|
-
Be(([
|
|
16498
|
-
if (!
|
|
16493
|
+
Be(([E, T, P, A]) => {
|
|
16494
|
+
if (!E || A)
|
|
16499
16495
|
return !0;
|
|
16500
16496
|
const H = I.getCurrentSelections(), O = H == null ? void 0 : H.map((B) => B.range);
|
|
16501
16497
|
if (!(O != null && O.length))
|
|
@@ -16504,7 +16500,7 @@ function Sf(r) {
|
|
|
16504
16500
|
if (V != null && V.permissionId)
|
|
16505
16501
|
return !0;
|
|
16506
16502
|
const W = _.getSubunitRuleList(p, C);
|
|
16507
|
-
return O == null ? void 0 : O.some((B) => W.some((
|
|
16503
|
+
return O == null ? void 0 : O.some((B) => W.some((z) => z.ranges.some((Z) => ae.intersects(B, Z))));
|
|
16508
16504
|
})
|
|
16509
16505
|
);
|
|
16510
16506
|
})
|
|
@@ -16590,7 +16586,7 @@ function Ib(r) {
|
|
|
16590
16586
|
).pipe(xt(null));
|
|
16591
16587
|
return ct([g]).pipe(
|
|
16592
16588
|
Be(([m]) => {
|
|
16593
|
-
var
|
|
16589
|
+
var E;
|
|
16594
16590
|
const f = r.get($).getCurrentSelections(), v = f == null ? void 0 : f.map((T) => T.range);
|
|
16595
16591
|
if (!(v != null && v.length) || v.length > 1)
|
|
16596
16592
|
return !0;
|
|
@@ -16599,13 +16595,13 @@ function Ib(r) {
|
|
|
16599
16595
|
return !0;
|
|
16600
16596
|
const C = h.getRule(a, c);
|
|
16601
16597
|
if (C != null && C.permissionId)
|
|
16602
|
-
return ((
|
|
16598
|
+
return ((E = t.getPermissionPoint(new kg(a, c).id)) == null ? void 0 : E.value) === !1;
|
|
16603
16599
|
if (u.getSubunitRuleList(a, c).filter((T) => T.ranges.some((P) => ae.intersects(P, p))).length !== 1)
|
|
16604
16600
|
return !0;
|
|
16605
|
-
const { startRow: S, endRow: I, startColumn: R, endColumn: y } = p,
|
|
16601
|
+
const { startRow: S, endRow: I, startColumn: R, endColumn: y } = p, M = r.get(Wo);
|
|
16606
16602
|
for (let T = S; T <= I; T++)
|
|
16607
16603
|
for (let P = R; P <= y; P++) {
|
|
16608
|
-
const A =
|
|
16604
|
+
const A = M.getCellInfo(a, c, T, P);
|
|
16609
16605
|
if (A)
|
|
16610
16606
|
return A[ro.Delete] === !1;
|
|
16611
16607
|
}
|
|
@@ -18115,10 +18111,10 @@ const Rh = 2, Qb = [
|
|
|
18115
18111
|
if (!h || !c || !h || !g || !m) return null;
|
|
18116
18112
|
const v = d == null ? void 0 : d.getNoMergeCellPositionByIndex(i.endRow, i.endCol), p = (A = v == null ? void 0 : v.endX) != null ? A : 0, C = (H = v == null ? void 0 : v.endY) != null ? H : 0, _ = (O = Fr(p, h, m)) != null ? O : -9999, S = (V = Ur(C, g, m)) != null ? V : -9999, I = f == null ? void 0 : f.getWidth(), R = f == null ? void 0 : f.getHeight();
|
|
18117
18113
|
if (!I || !R) return null;
|
|
18118
|
-
const y = _ + 50 <= I,
|
|
18119
|
-
let
|
|
18120
|
-
return y || (
|
|
18121
|
-
positionX:
|
|
18114
|
+
const y = _ + 50 <= I, M = S + 50 <= R;
|
|
18115
|
+
let E = _, T = S;
|
|
18116
|
+
return y || (E = I - 100), M || (T = R - 100), {
|
|
18117
|
+
positionX: E,
|
|
18122
18118
|
positionY: T
|
|
18123
18119
|
};
|
|
18124
18120
|
}, $b = () => {
|
|
@@ -18221,17 +18217,17 @@ function nR(r, e, t) {
|
|
|
18221
18217
|
const h = t.get(N), g = t.get(vn), m = h.getUniverSheetInstance(l), f = m == null ? void 0 : m.getSheetBySheetId(s), v = m == null ? void 0 : m.getSheetBySheetId(c);
|
|
18222
18218
|
if (f && v) {
|
|
18223
18219
|
const p = new Ge(), C = new Ge(), _ = f.getCellMatrix(), S = v.getCellMatrix();
|
|
18224
|
-
gs.foreach(u, (B,
|
|
18225
|
-
p.setValue(B,
|
|
18220
|
+
gs.foreach(u, (B, z) => {
|
|
18221
|
+
p.setValue(B, z, le.deepClone(_.getValue(B, z))), C.setValue(B, z, null);
|
|
18226
18222
|
});
|
|
18227
18223
|
const I = new Ge();
|
|
18228
|
-
gs.foreach(d, (B,
|
|
18229
|
-
I.setValue(B,
|
|
18224
|
+
gs.foreach(d, (B, z) => {
|
|
18225
|
+
I.setValue(B, z, le.deepClone(S.getValue(B, z)));
|
|
18230
18226
|
});
|
|
18231
18227
|
const R = new Ge();
|
|
18232
|
-
gs.foreach(u, (B,
|
|
18233
|
-
const Z = sv(B,
|
|
18234
|
-
R.setValue(ge.startRow, ge.startColumn, _.getValue(B,
|
|
18228
|
+
gs.foreach(u, (B, z) => {
|
|
18229
|
+
const Z = sv(B, z), ce = ae.getRelativeRange(Z, u), ge = ae.getPositionRange(ce, d);
|
|
18230
|
+
R.setValue(ge.startRow, ge.startColumn, _.getValue(B, z));
|
|
18235
18231
|
});
|
|
18236
18232
|
const y = {
|
|
18237
18233
|
fromRange: u,
|
|
@@ -18245,7 +18241,7 @@ function nR(r, e, t) {
|
|
|
18245
18241
|
subUnitId: c
|
|
18246
18242
|
},
|
|
18247
18243
|
unitId: l
|
|
18248
|
-
},
|
|
18244
|
+
}, M = {
|
|
18249
18245
|
fromRange: d,
|
|
18250
18246
|
toRange: u,
|
|
18251
18247
|
from: {
|
|
@@ -18257,7 +18253,7 @@ function nR(r, e, t) {
|
|
|
18257
18253
|
subUnitId: c
|
|
18258
18254
|
},
|
|
18259
18255
|
unitId: l
|
|
18260
|
-
},
|
|
18256
|
+
}, E = g.onCommandExecute({
|
|
18261
18257
|
id: Bg.id,
|
|
18262
18258
|
params: { toRange: d, fromRange: u }
|
|
18263
18259
|
}), T = f.getMergeData(), P = v.getMergeData(), A = T.filter((B) => ae.intersects(B, u)), H = P.filter((B) => ae.intersects(B, d)), O = A.map((B) => ae.getRelativeRange(B, u)).map((B) => ae.getPositionRange(B, d)), V = Bl(O), W = [
|
|
@@ -18285,7 +18281,7 @@ function nR(r, e, t) {
|
|
|
18285
18281
|
ranges: V
|
|
18286
18282
|
}
|
|
18287
18283
|
}
|
|
18288
|
-
],
|
|
18284
|
+
], j = [
|
|
18289
18285
|
{
|
|
18290
18286
|
id: Kt.id,
|
|
18291
18287
|
params: {
|
|
@@ -18313,7 +18309,7 @@ function nR(r, e, t) {
|
|
|
18313
18309
|
];
|
|
18314
18310
|
n = [
|
|
18315
18311
|
{ id: $n.id, params: y },
|
|
18316
|
-
...
|
|
18312
|
+
...E.redos,
|
|
18317
18313
|
...W,
|
|
18318
18314
|
{
|
|
18319
18315
|
id: Te.id,
|
|
@@ -18325,9 +18321,9 @@ function nR(r, e, t) {
|
|
|
18325
18321
|
}
|
|
18326
18322
|
}
|
|
18327
18323
|
], i = [
|
|
18328
|
-
{ id: $n.id, params:
|
|
18329
|
-
...
|
|
18330
|
-
...
|
|
18324
|
+
{ id: $n.id, params: M },
|
|
18325
|
+
...E.undos,
|
|
18326
|
+
...j,
|
|
18331
18327
|
{
|
|
18332
18328
|
id: Te.id,
|
|
18333
18329
|
params: {
|
|
@@ -18359,8 +18355,8 @@ function tp(r, e, t, n) {
|
|
|
18359
18355
|
if (zl((I = y == null ? void 0 : y.n) == null ? void 0 : I.pattern))
|
|
18360
18356
|
S.t = Mt.STRING;
|
|
18361
18357
|
else {
|
|
18362
|
-
const
|
|
18363
|
-
(
|
|
18358
|
+
const M = String(p.v), E = mn.parseValue(M);
|
|
18359
|
+
(E == null ? void 0 : E.v) !== void 0 && typeof E.v == "number" && (!E.z && ov(M) ? S.t = Mt.FORCE_STRING : S.v = E.v);
|
|
18364
18360
|
}
|
|
18365
18361
|
}
|
|
18366
18362
|
if ((R = p.p) != null && R.body && Dc(p.p.body)) {
|
|
@@ -18394,7 +18390,7 @@ function np(r, e, t, n, i = !1) {
|
|
|
18394
18390
|
var f;
|
|
18395
18391
|
const o = [], s = [], { unitId: l, subUnitId: a, range: c } = r, d = (f = n.get(N).getUniverSheetInstance(l)) == null ? void 0 : f.getSheetBySheetId(a), u = new Ge(), { mapFunc: h } = wr([c]);
|
|
18396
18392
|
t.forValue((v, p, C) => {
|
|
18397
|
-
var
|
|
18393
|
+
var M, E;
|
|
18398
18394
|
const _ = {
|
|
18399
18395
|
s: Object.assign({}, {
|
|
18400
18396
|
...rd,
|
|
@@ -18410,11 +18406,11 @@ function np(r, e, t, n, i = !1) {
|
|
|
18410
18406
|
t: null
|
|
18411
18407
|
}));
|
|
18412
18408
|
const { row: I, col: R } = h(v, p), y = d == null ? void 0 : d.getCellStyle(I, R);
|
|
18413
|
-
if (C.v && !e && zl((
|
|
18409
|
+
if (C.v && !e && zl((M = y == null ? void 0 : y.n) == null ? void 0 : M.pattern))
|
|
18414
18410
|
_.s || (_.s = {}), _.s.n = y == null ? void 0 : y.n;
|
|
18415
18411
|
else {
|
|
18416
18412
|
const T = String(C.v), P = mn.parseValue(T);
|
|
18417
|
-
P != null && P.z && (_.s || (_.s = {}), typeof _.s == "object" && ((
|
|
18413
|
+
P != null && P.z && (_.s || (_.s = {}), typeof _.s == "object" && ((E = _.s) != null && E.n ? _.s.n.pattern = P.z : _.s.n = { pattern: P.z }));
|
|
18418
18414
|
}
|
|
18419
18415
|
u.setValue(I, R, _);
|
|
18420
18416
|
});
|
|
@@ -18762,7 +18758,7 @@ let fi = class extends Nn {
|
|
|
18762
18758
|
if (_) {
|
|
18763
18759
|
const R = m.getRow(l.rows[0] + C), y = Number.parseFloat(_);
|
|
18764
18760
|
if (R) {
|
|
18765
|
-
const { h:
|
|
18761
|
+
const { h: M = mc, ah: E = 0 } = R, T = Math.max(M, E);
|
|
18766
18762
|
y > T ? (f[C + l.rows[0]] = y, v[C + l.rows[0]] = T) : (f[C + l.rows[0]] = T, v[C + l.rows[0]] = T);
|
|
18767
18763
|
} else
|
|
18768
18764
|
f[C + l.rows[0]] = y, v[C + l.rows[0]] = (I = (S = m.getRow(l.rows[0] + C)) == null ? void 0 : S.h) != null ? I : mc;
|
|
@@ -18839,15 +18835,15 @@ let fi = class extends Nn {
|
|
|
18839
18835
|
if (s.length > 0) {
|
|
18840
18836
|
const S = {
|
|
18841
18837
|
...C,
|
|
18842
|
-
colWidth: s.slice(0, m).reduce((R, y,
|
|
18843
|
-
var
|
|
18844
|
-
return R[
|
|
18838
|
+
colWidth: s.slice(0, m).reduce((R, y, M) => {
|
|
18839
|
+
var E;
|
|
18840
|
+
return R[M + p] = y.width ? Math.max(+y.width, (E = i.getColumnWidth(v[M])) != null ? E : f) : f, R;
|
|
18845
18841
|
}, {})
|
|
18846
18842
|
}, I = {
|
|
18847
18843
|
...C,
|
|
18848
|
-
colWidth: s.slice(0, m).reduce((R, y,
|
|
18849
|
-
var
|
|
18850
|
-
return R[
|
|
18844
|
+
colWidth: s.slice(0, m).reduce((R, y, M) => {
|
|
18845
|
+
var E;
|
|
18846
|
+
return R[M + p] = (E = i.getColumnWidth(v[M])) != null ? E : f, R;
|
|
18851
18847
|
}, {})
|
|
18852
18848
|
};
|
|
18853
18849
|
c.push({
|
|
@@ -18981,11 +18977,11 @@ let fi = class extends Nn {
|
|
|
18981
18977
|
};
|
|
18982
18978
|
},
|
|
18983
18979
|
onPasteColumns(s, l, a) {
|
|
18984
|
-
var
|
|
18985
|
-
const c = e._instanceService.getCurrentUnitForType(x.UNIVER_SHEET), d = c.getUnitId(), u = (
|
|
18980
|
+
var M, E;
|
|
18981
|
+
const c = e._instanceService.getCurrentUnitForType(x.UNIVER_SHEET), d = c.getUnitId(), u = (M = c.getActiveSheet()) == null ? void 0 : M.getSheetId();
|
|
18986
18982
|
if (!d || !u)
|
|
18987
18983
|
throw new Error("Cannot find unitId or subUnitId");
|
|
18988
|
-
const h = [], g = [], m = e._getWorksheet(d, u), { range: f } = s, v = f.cols, p = v[0], C = m.getMaxColumns(), _ = f.cols[f.cols.length - 1] - C, S = l.length - _, I = (
|
|
18984
|
+
const h = [], g = [], m = e._getWorksheet(d, u), { range: f } = s, v = f.cols, p = v[0], C = m.getMaxColumns(), _ = f.cols[f.cols.length - 1] - C, S = l.length - _, I = (E = e._configService.getConfig(du)) != null ? E : uu, R = {
|
|
18989
18985
|
unitId: d,
|
|
18990
18986
|
subUnitId: u,
|
|
18991
18987
|
ranges: [{
|
|
@@ -19034,11 +19030,11 @@ let fi = class extends Nn {
|
|
|
19034
19030
|
a.forValue((S, I, R) => {
|
|
19035
19031
|
const y = R.s;
|
|
19036
19032
|
if (typeof y == "object") {
|
|
19037
|
-
const
|
|
19038
|
-
|
|
19033
|
+
const M = le.deepClone(R);
|
|
19034
|
+
M.s && (M.s = {
|
|
19039
19035
|
...y,
|
|
19040
19036
|
bd: null
|
|
19041
|
-
}), f.setValue(h.rows[S], h.cols[I],
|
|
19037
|
+
}), f.setValue(h.rows[S], h.cols[I], M);
|
|
19042
19038
|
}
|
|
19043
19039
|
});
|
|
19044
19040
|
const v = {
|
|
@@ -19365,19 +19361,19 @@ const jy = (r, e, t, n, i, o) => {
|
|
|
19365
19361
|
h.overflowCache.forValue((O, V, W) => {
|
|
19366
19362
|
W.startRow <= _ && W.endRow >= _ && W.startColumn <= C && W.endColumn >= C && (C = V, _ = O);
|
|
19367
19363
|
});
|
|
19368
|
-
const S = h.getCellWithCoordByIndex(_, C), I = c.getCell(S.actualRow, S.actualColumn), { topOffset: R = 0, leftOffset: y = 0 } = (H = I == null ? void 0 : I.fontRenderExtension) != null ? H : {}, { paddingLeft:
|
|
19364
|
+
const S = h.getCellWithCoordByIndex(_, C), I = c.getCell(S.actualRow, S.actualColumn), { topOffset: R = 0, leftOffset: y = 0 } = (H = I == null ? void 0 : I.fontRenderExtension) != null ? H : {}, { paddingLeft: M, paddingTop: E } = ip(S, g, !1), T = ru({ startOffset: f.startIndex, endOffset: f.endIndex }, m);
|
|
19369
19365
|
return {
|
|
19370
19366
|
rects: T == null ? void 0 : T.map((O) => ({
|
|
19371
|
-
top: O.top + S.mergeInfo.startY +
|
|
19372
|
-
bottom: O.bottom + S.mergeInfo.startY +
|
|
19373
|
-
left: O.left + S.mergeInfo.startX +
|
|
19374
|
-
right: O.right + S.mergeInfo.startX +
|
|
19367
|
+
top: O.top + S.mergeInfo.startY + E + R + v,
|
|
19368
|
+
bottom: O.bottom + S.mergeInfo.startY + E + R + v,
|
|
19369
|
+
left: O.left + S.mergeInfo.startX + M + y,
|
|
19370
|
+
right: O.right + S.mergeInfo.startX + M + y
|
|
19375
19371
|
})),
|
|
19376
19372
|
customRange: f,
|
|
19377
19373
|
label: m.getViewModel().getBody().dataStream.slice(f.startIndex, f.endIndex + 1)
|
|
19378
19374
|
};
|
|
19379
19375
|
}, Yy = (r, e, t, n, i, o) => {
|
|
19380
|
-
var y,
|
|
19376
|
+
var y, M, E;
|
|
19381
19377
|
const s = r.get(qe), l = s.getEditCellState();
|
|
19382
19378
|
if (!l || !s.isVisible().visible)
|
|
19383
19379
|
return null;
|
|
@@ -19390,7 +19386,7 @@ const jy = (r, e, t, n, i, o) => {
|
|
|
19390
19386
|
const p = f.with(Kn).getSkeleton(), C = (y = v.with(he).getSkeletonParam(u)) == null ? void 0 : y.skeleton;
|
|
19391
19387
|
if (!p || !C)
|
|
19392
19388
|
return null;
|
|
19393
|
-
const _ = (
|
|
19389
|
+
const _ = (E = (M = p.getViewModel().getBody()) == null ? void 0 : M.customRanges) == null ? void 0 : E.find((T) => T.rangeId === o);
|
|
19394
19390
|
if (!_)
|
|
19395
19391
|
return null;
|
|
19396
19392
|
const S = 4, I = ru({ startOffset: _.startIndex, endOffset: _.endIndex }, p), R = f.engine.getCanvasElement().getBoundingClientRect();
|
|
@@ -19546,7 +19542,7 @@ let Ir = class extends oe {
|
|
|
19546
19542
|
let g = null, m = null, f = null;
|
|
19547
19543
|
const v = a.getCellWithCoordByIndex(d.row, d.col), p = n.getCell(d.row, d.col), { topOffset: C = 0, leftOffset: _ = 0 } = (I = p == null ? void 0 : p.fontRenderExtension) != null ? I : {};
|
|
19548
19544
|
if (h != null && h.documentSkeleton) {
|
|
19549
|
-
const { paddingLeft:
|
|
19545
|
+
const { paddingLeft: M, paddingTop: E } = ip(v, h, (p == null ? void 0 : p.v) !== null && (p == null ? void 0 : p.v) !== void 0 ? !Number.isNaN(+p.v) : !1), T = fR(h.documentSkeleton, M, E), P = o - c.startX - _, A = s - c.startY - C;
|
|
19550
19546
|
g = T.links.find((H) => H.rects.some((O) => O.left <= P && P <= O.right && O.top <= A && A <= O.bottom)), m = T.checkLists.find((H) => H.rect.left <= P && P <= H.rect.right && H.rect.top <= A && A <= H.rect.bottom), f = T.drawings.find((H) => H.rect.left <= P && P <= H.rect.right && H.rect.top <= A && A <= H.rect.bottom);
|
|
19551
19547
|
}
|
|
19552
19548
|
const S = (y = (R = g == null ? void 0 : g.rects.pop()) != null ? R : m == null ? void 0 : m.rect) != null ? y : f == null ? void 0 : f.rect;
|
|
@@ -20744,9 +20740,9 @@ let pi = class extends oe {
|
|
|
20744
20740
|
for (const C of d) {
|
|
20745
20741
|
const { startRow: _, startColumn: S, endColumn: I, endRow: R } = this.getRangeStartEndInfo(C, o);
|
|
20746
20742
|
for (let y = _; y <= R; y++)
|
|
20747
|
-
for (let
|
|
20748
|
-
const
|
|
20749
|
-
u.add(
|
|
20743
|
+
for (let M = S; M <= I; M++) {
|
|
20744
|
+
const E = o.getCellRaw(y, M);
|
|
20745
|
+
u.add(E, h, g);
|
|
20750
20746
|
}
|
|
20751
20747
|
}
|
|
20752
20748
|
const m = UR(u);
|
|
@@ -20918,7 +20914,7 @@ const sp = (r, e, t, n, i) => {
|
|
|
20918
20914
|
edit: S.editState === ln.DesignedUserCanEdit ? on.SomeCollaborator : on.OneSelf
|
|
20919
20915
|
};
|
|
20920
20916
|
if (S.editState === ln.DesignedUserCanEdit && R.length === 0 && (R = [], y.edit = on.OneSelf), S.permissionId) {
|
|
20921
|
-
const
|
|
20917
|
+
const E = y_(R.filter((O) => O.role === kt.Editor), m.oldCollaboratorList.filter((O) => O.role === kt.Editor)), T = (l == null ? void 0 : l.viewState) === S.viewState, P = (l == null ? void 0 : l.editState) === S.editState, A = S.unitType === (l == null ? void 0 : l.unitType) && S.description === l.description && S.ranges === l.ranges, H = !E || !T || !P;
|
|
20922
20918
|
if (A && H)
|
|
20923
20919
|
await u.update({
|
|
20924
20920
|
objectType: S.unitType,
|
|
@@ -20960,7 +20956,7 @@ const sp = (r, e, t, n, i) => {
|
|
|
20960
20956
|
});
|
|
20961
20957
|
}
|
|
20962
20958
|
} else if (S.unitType === Vt.Worksheet) {
|
|
20963
|
-
const
|
|
20959
|
+
const E = await u.create({
|
|
20964
20960
|
worksheetObject: {
|
|
20965
20961
|
collaborators: R,
|
|
20966
20962
|
unitID: S.unitId,
|
|
@@ -20970,12 +20966,12 @@ const sp = (r, e, t, n, i) => {
|
|
|
20970
20966
|
},
|
|
20971
20967
|
objectType: Vt.Worksheet
|
|
20972
20968
|
}), { ranges: T = [], ...P } = S;
|
|
20973
|
-
P.permissionId =
|
|
20969
|
+
P.permissionId = E, g.executeCommand(yg.id, {
|
|
20974
20970
|
rule: P,
|
|
20975
20971
|
unitId: S.unitId
|
|
20976
20972
|
});
|
|
20977
20973
|
} else if (S.unitType === Vt.SelectRange) {
|
|
20978
|
-
const
|
|
20974
|
+
const E = await u.create({
|
|
20979
20975
|
selectRangeObject: {
|
|
20980
20976
|
collaborators: R,
|
|
20981
20977
|
unitID: S.unitId,
|
|
@@ -20986,10 +20982,10 @@ const sp = (r, e, t, n, i) => {
|
|
|
20986
20982
|
});
|
|
20987
20983
|
g.executeCommand(XS.id, {
|
|
20988
20984
|
rule: S,
|
|
20989
|
-
permissionId:
|
|
20985
|
+
permissionId: E
|
|
20990
20986
|
});
|
|
20991
20987
|
}
|
|
20992
|
-
const
|
|
20988
|
+
const M = {
|
|
20993
20989
|
header: { title: `${h.t("permission.panel.title")}` },
|
|
20994
20990
|
children: {
|
|
20995
20991
|
label: So,
|
|
@@ -20997,7 +20993,7 @@ const sp = (r, e, t, n, i) => {
|
|
|
20997
20993
|
},
|
|
20998
20994
|
width: 330
|
|
20999
20995
|
};
|
|
21000
|
-
d.open(
|
|
20996
|
+
d.open(M);
|
|
21001
20997
|
},
|
|
21002
20998
|
children: h.t("permission.button.confirm")
|
|
21003
20999
|
}
|
|
@@ -21017,17 +21013,17 @@ const sp = (r, e, t, n, i) => {
|
|
|
21017
21013
|
if (!h || !g)
|
|
21018
21014
|
return null;
|
|
21019
21015
|
const m = h.getUnitId(), f = g.getSheetId(), v = (p) => {
|
|
21020
|
-
const C = p.split(",").map(Kg).map((
|
|
21021
|
-
if (C.some((
|
|
21016
|
+
const C = p.split(",").map(Kg).map((E) => E.range);
|
|
21017
|
+
if (C.some((E) => !dv(E) || E.endColumn < E.startColumn || E.endRow < E.startRow))
|
|
21022
21018
|
return;
|
|
21023
21019
|
const _ = c.getCurrentUnitForType(x.UNIVER_SHEET), S = _ == null ? void 0 : _.getActiveSheet();
|
|
21024
21020
|
if (!_ || !S)
|
|
21025
21021
|
return;
|
|
21026
|
-
const I = _.getUnitId(), R = S.getSheetId(), y = C.map((
|
|
21022
|
+
const I = _.getUnitId(), R = S.getSheetId(), y = C.map((E) => {
|
|
21027
21023
|
const T = S.getRowCount(), P = S.getColumnCount();
|
|
21028
|
-
return zS(
|
|
21029
|
-
}),
|
|
21030
|
-
t(y,
|
|
21024
|
+
return zS(E, T, P), E;
|
|
21025
|
+
}), M = sp(u, y, s, I, R);
|
|
21026
|
+
t(y, M);
|
|
21031
21027
|
};
|
|
21032
21028
|
return /* @__PURE__ */ q(tr, { children: [
|
|
21033
21029
|
/* @__PURE__ */ w(
|
|
@@ -21062,8 +21058,8 @@ const sp = (r, e, t, n, i) => {
|
|
|
21062
21058
|
return Me(() => {
|
|
21063
21059
|
const _ = i.get(N), S = i.get(Ci), I = _.getCurrentUnitForType(x.UNIVER_SHEET);
|
|
21064
21060
|
if (!I) return;
|
|
21065
|
-
const R = I.getActiveSheet().getSheetId(), y = I.activeSheet$.subscribe((
|
|
21066
|
-
(
|
|
21061
|
+
const R = I.getActiveSheet().getSheetId(), y = I.activeSheet$.subscribe((M) => {
|
|
21062
|
+
(M == null ? void 0 : M.getSheetId()) !== R && S.close();
|
|
21067
21063
|
});
|
|
21068
21064
|
return () => {
|
|
21069
21065
|
y.unsubscribe();
|
|
@@ -21123,24 +21119,24 @@ function JR() {
|
|
|
21123
21119
|
if (!_) return null;
|
|
21124
21120
|
const S = _.getUnitId(), I = On(async (O) => {
|
|
21125
21121
|
var G;
|
|
21126
|
-
const V = _.getActiveSheet(), W = _.getUnitId(),
|
|
21122
|
+
const V = _.getActiveSheet(), W = _.getUnitId(), j = V.getSheetId(), B = [], z = [];
|
|
21127
21123
|
_.getSheets().forEach((ee) => {
|
|
21128
21124
|
const ne = ee.getSheetId();
|
|
21129
21125
|
l.getSubunitRuleList(W, ne).forEach((pe) => {
|
|
21130
21126
|
pe.permissionId && B.push(pe.permissionId);
|
|
21131
21127
|
});
|
|
21132
21128
|
const Fe = a.getRule(W, ne);
|
|
21133
|
-
Fe != null && Fe.permissionId &&
|
|
21129
|
+
Fe != null && Fe.permissionId && z.push(Fe.permissionId);
|
|
21134
21130
|
});
|
|
21135
|
-
const Z = [...B, ...
|
|
21131
|
+
const Z = [...B, ...z], ce = await h.list({
|
|
21136
21132
|
objectIDs: Z,
|
|
21137
21133
|
unitID: W,
|
|
21138
21134
|
actions: jS
|
|
21139
|
-
}), ge = l.getSubunitRuleList(W,
|
|
21135
|
+
}), ge = l.getSubunitRuleList(W, j).map((ee) => ee.permissionId), se = (G = a.getRule(W, j)) == null ? void 0 : G.permissionId;
|
|
21140
21136
|
se && ge.push(se);
|
|
21141
21137
|
const _e = ce.filter((ee) => {
|
|
21142
21138
|
var ne;
|
|
21143
|
-
return ge.includes(ee.objectID) || ee.objectID === ((ne = a.getRule(W,
|
|
21139
|
+
return ge.includes(ee.objectID) || ee.objectID === ((ne = a.getRule(W, j)) == null ? void 0 : ne.permissionId);
|
|
21144
21140
|
});
|
|
21145
21141
|
return O ? _e : ce;
|
|
21146
21142
|
}, []), [R, y] = re([]);
|
|
@@ -21173,20 +21169,20 @@ function JR() {
|
|
|
21173
21169
|
}
|
|
21174
21170
|
})();
|
|
21175
21171
|
}, [p, C]);
|
|
21176
|
-
function
|
|
21177
|
-
const { unitId: V, subUnitId: W, unitType:
|
|
21172
|
+
function M(O) {
|
|
21173
|
+
const { unitId: V, subUnitId: W, unitType: j } = O;
|
|
21178
21174
|
let B;
|
|
21179
|
-
|
|
21175
|
+
j === yn.Worksheet ? B = d.executeCommand(xs.id, { unitId: V, subUnitId: W, rule: O }) : j === yn.SelectRange && (B = d.executeCommand(YS.id, { unitId: V, subUnitId: W, rule: O })), B && (n(!t), O.ranges === i && o([]));
|
|
21180
21176
|
}
|
|
21181
21177
|
Me(() => {
|
|
21182
21178
|
v.reset();
|
|
21183
21179
|
}, []), Ub(i);
|
|
21184
|
-
const
|
|
21180
|
+
const E = wt(() => {
|
|
21185
21181
|
const O = /* @__PURE__ */ new Map();
|
|
21186
21182
|
return _.getSheets().forEach((V) => {
|
|
21187
21183
|
const W = V.getSheetId();
|
|
21188
|
-
l.getSubunitRuleList(S, W).forEach((
|
|
21189
|
-
O.set(
|
|
21184
|
+
l.getSubunitRuleList(S, W).forEach((z) => {
|
|
21185
|
+
O.set(z.permissionId, z);
|
|
21190
21186
|
});
|
|
21191
21187
|
const B = a.getRule(S, W);
|
|
21192
21188
|
B && O.set(B == null ? void 0 : B.permissionId, B);
|
|
@@ -21226,10 +21222,10 @@ function JR() {
|
|
|
21226
21222
|
] }),
|
|
21227
21223
|
(R == null ? void 0 : R.length) > 0 ? /* @__PURE__ */ w("div", { children: R == null ? void 0 : R.map((O) => {
|
|
21228
21224
|
var ne, ve, Fe, pe, Re;
|
|
21229
|
-
const V =
|
|
21225
|
+
const V = E.get(O.objectID);
|
|
21230
21226
|
if (!V)
|
|
21231
21227
|
return null;
|
|
21232
|
-
const W = O.actions.find((de) => de.action === me.Edit),
|
|
21228
|
+
const W = O.actions.find((de) => de.action === me.Edit), j = W == null ? void 0 : W.allowed, B = O.actions.find((de) => de.action === me.View), z = B == null ? void 0 : B.allowed, Z = O.actions.find((de) => de.action === me.ManageCollaborator), ce = O.actions.find((de) => de.action === me.Delete), ge = (Z == null ? void 0 : Z.allowed) || f.userID === ((ne = O.creator) == null ? void 0 : ne.userID), se = (ce == null ? void 0 : ce.allowed) || f.userID === ((ve = O.creator) == null ? void 0 : ve.userID);
|
|
21233
21229
|
let _e = "";
|
|
21234
21230
|
const G = _.getSheetBySheetId(V.subUnitId), ee = G == null ? void 0 : G.getName();
|
|
21235
21231
|
if (V.unitType === yn.SelectRange) {
|
|
@@ -21281,7 +21277,7 @@ function JR() {
|
|
|
21281
21277
|
"div",
|
|
21282
21278
|
{
|
|
21283
21279
|
className: "univer-box-border univer-h-6 univer-rounded-sm univer-p-1 hover:univer-bg-gray-200",
|
|
21284
|
-
onClick: () =>
|
|
21280
|
+
onClick: () => M(V),
|
|
21285
21281
|
children: /* @__PURE__ */ w(Jl, {})
|
|
21286
21282
|
}
|
|
21287
21283
|
) })
|
|
@@ -21302,7 +21298,7 @@ function JR() {
|
|
|
21302
21298
|
"span",
|
|
21303
21299
|
{
|
|
21304
21300
|
className: "univer-h-4 univer-text-xs univer-text-gray-900 dark:!univer-text-white",
|
|
21305
|
-
children:
|
|
21301
|
+
children: j ? `${s.t("permission.panel.iCanEdit")}` : `${s.t("permission.panel.iCanNotEdit")}`
|
|
21306
21302
|
}
|
|
21307
21303
|
)
|
|
21308
21304
|
] }),
|
|
@@ -21318,7 +21314,7 @@ function JR() {
|
|
|
21318
21314
|
"span",
|
|
21319
21315
|
{
|
|
21320
21316
|
className: "univer-h-4 univer-text-xs univer-text-gray-900 dark:!univer-text-white",
|
|
21321
|
-
children:
|
|
21317
|
+
children: z ? `${s.t("permission.panel.iCanView")}` : `${s.t("permission.panel.iCanNotView")}`
|
|
21322
21318
|
}
|
|
21323
21319
|
)
|
|
21324
21320
|
] }),
|
|
@@ -21456,8 +21452,8 @@ const $R = ({ showDetail: r, fromSheetBar: e, rule: t, oldRule: n }) => {
|
|
|
21456
21452
|
collaborators: void 0
|
|
21457
21453
|
}).then(() => {
|
|
21458
21454
|
qS().forEach((y) => {
|
|
21459
|
-
const
|
|
21460
|
-
T && o.updatePermissionPoint(
|
|
21455
|
+
const M = new y(C, _), E = M.subType, T = I.find((P) => P.action === E);
|
|
21456
|
+
T && o.updatePermissionPoint(M.id, T.role === kt.Editor);
|
|
21461
21457
|
});
|
|
21462
21458
|
}) : (R = await t.create({
|
|
21463
21459
|
objectType: yn.Worksheet,
|
|
@@ -21776,8 +21772,8 @@ const dI = (r) => {
|
|
|
21776
21772
|
],
|
|
21777
21773
|
onChange: (I) => {
|
|
21778
21774
|
I === "delete" && c.setSelectUserList(h.filter((R) => {
|
|
21779
|
-
var y,
|
|
21780
|
-
return ((y = R.subject) == null ? void 0 : y.userID) !== ((
|
|
21775
|
+
var y, M;
|
|
21776
|
+
return ((y = R.subject) == null ? void 0 : y.userID) !== ((M = p.subject) == null ? void 0 : M.userID);
|
|
21781
21777
|
}));
|
|
21782
21778
|
}
|
|
21783
21779
|
}
|
|
@@ -22269,13 +22265,13 @@ let zc = class extends oe {
|
|
|
22269
22265
|
}
|
|
22270
22266
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
22271
22267
|
_scrollToCell(r, e) {
|
|
22272
|
-
var I, R, y,
|
|
22268
|
+
var I, R, y, M;
|
|
22273
22269
|
const { rowHeightAccumulation: t, columnWidthAccumulation: n } = (R = (I = this._sheetSkeletonManagerService.getCurrentParam()) == null ? void 0 : I.skeleton) != null ? R : {};
|
|
22274
22270
|
if (t == null || n == null) return !1;
|
|
22275
22271
|
const i = (y = this._getSheetObject()) == null ? void 0 : y.scene;
|
|
22276
22272
|
if (i == null) return !1;
|
|
22277
22273
|
const o = i.getViewport(U.VIEW_MAIN);
|
|
22278
|
-
if (o == null || ((
|
|
22274
|
+
if (o == null || ((M = this._sheetSkeletonManagerService.getCurrentParam()) == null ? void 0 : M.skeleton) == null) return !1;
|
|
22279
22275
|
const l = this._context.unit.getActiveSheet();
|
|
22280
22276
|
if (!l) return !1;
|
|
22281
22277
|
const {
|
|
@@ -22293,17 +22289,17 @@ let zc = class extends oe {
|
|
|
22293
22289
|
} = h;
|
|
22294
22290
|
let p, C;
|
|
22295
22291
|
if (r >= c && e >= a - u && (r <= g && (p = r), r >= f)) {
|
|
22296
|
-
const
|
|
22292
|
+
const E = t[r] - o.height;
|
|
22297
22293
|
for (let T = g; T <= r; T++)
|
|
22298
|
-
if (t[T] >=
|
|
22294
|
+
if (t[T] >= E) {
|
|
22299
22295
|
p = T + 1;
|
|
22300
22296
|
break;
|
|
22301
22297
|
}
|
|
22302
22298
|
}
|
|
22303
22299
|
if (e >= a && r >= c - d && (e <= m && (C = e), e >= v)) {
|
|
22304
|
-
const
|
|
22300
|
+
const E = n[e] - o.width;
|
|
22305
22301
|
for (let T = m; T <= e; T++)
|
|
22306
|
-
if (n[T] >=
|
|
22302
|
+
if (n[T] >= E) {
|
|
22307
22303
|
C = T + 1;
|
|
22308
22304
|
break;
|
|
22309
22305
|
}
|
|
@@ -22553,13 +22549,13 @@ const yI = (r) => {
|
|
|
22553
22549
|
className: He("univer-max-h-52 univer-overflow-y-auto univer-px-2", jl),
|
|
22554
22550
|
children: p.map((S, I) => {
|
|
22555
22551
|
const R = e.indexOf(S.value) > -1, y = () => {
|
|
22556
|
-
let
|
|
22557
|
-
R ?
|
|
22552
|
+
let E;
|
|
22553
|
+
R ? E = new Set(e.filter((P) => P !== S.value)) : E = new Set(n ? [...e, S.value] : [S.value]);
|
|
22558
22554
|
const T = [];
|
|
22559
22555
|
i.forEach((P) => {
|
|
22560
|
-
|
|
22556
|
+
E.has(P.value) && T.push(P.value);
|
|
22561
22557
|
}), t(T);
|
|
22562
|
-
},
|
|
22558
|
+
}, M = S.label.toLocaleLowerCase().indexOf(h);
|
|
22563
22559
|
return /* @__PURE__ */ q(
|
|
22564
22560
|
"div",
|
|
22565
22561
|
{
|
|
@@ -22572,9 +22568,9 @@ const yI = (r) => {
|
|
|
22572
22568
|
className: "univer-h-4 univer-w-fit univer-flex-[0_1_auto] univer-overflow-hidden univer-truncate univer-whitespace-nowrap univer-rounded-lg univer-px-1 univer-py-0 univer-text-xs",
|
|
22573
22569
|
style: { background: S.color },
|
|
22574
22570
|
children: h && S.label.toLowerCase().includes(h) ? /* @__PURE__ */ q(tr, { children: [
|
|
22575
|
-
/* @__PURE__ */ w("span", { children: S.label.substring(0,
|
|
22576
|
-
/* @__PURE__ */ w("span", { className: "univer-font-semibold", children: S.label.substring(
|
|
22577
|
-
/* @__PURE__ */ w("span", { children: S.label.substring(
|
|
22571
|
+
/* @__PURE__ */ w("span", { children: S.label.substring(0, M) }),
|
|
22572
|
+
/* @__PURE__ */ w("span", { className: "univer-font-semibold", children: S.label.substring(M, M + h.length) }),
|
|
22573
|
+
/* @__PURE__ */ w("span", { children: S.label.substring(M + h.length) })
|
|
22578
22574
|
] }) : S.label
|
|
22579
22575
|
}
|
|
22580
22576
|
),
|
|
@@ -22620,10 +22616,10 @@ const yI = (r) => {
|
|
|
22620
22616
|
);
|
|
22621
22617
|
};
|
|
22622
22618
|
function pp(r) {
|
|
22623
|
-
var I, R, y,
|
|
22624
|
-
const { popup: { extraProps: e } } = r, { location: t, hideFn: n, onChange: i, onEdit: o, options: s, defaultValue: l, multiple: a, showEdit: c } = e, { worksheet: d } = t, [u, h] = re(""), g = D(L), m = D(Pe), [f, v] = re(l), p = D(qe), C = D(N), _ = Jv.useContext(), S = ((R = (I = _.current) == null ? void 0 : I.right) != null ? R : 0) - ((
|
|
22619
|
+
var I, R, y, M;
|
|
22620
|
+
const { popup: { extraProps: e } } = r, { location: t, hideFn: n, onChange: i, onEdit: o, options: s, defaultValue: l, multiple: a, showEdit: c } = e, { worksheet: d } = t, [u, h] = re(""), g = D(L), m = D(Pe), [f, v] = re(l), p = D(qe), C = D(N), _ = Jv.useContext(), S = ((R = (I = _.current) == null ? void 0 : I.right) != null ? R : 0) - ((M = (y = _.current) == null ? void 0 : y.left) != null ? M : 0);
|
|
22625
22621
|
return Me(() => {
|
|
22626
|
-
const
|
|
22622
|
+
const E = g.onCommandExecuted((T) => {
|
|
22627
22623
|
var P, A;
|
|
22628
22624
|
if (T.id === io.id) {
|
|
22629
22625
|
const H = T.params, { unitId: O } = H, V = C.getUnit(O, x.UNIVER_DOC);
|
|
@@ -22633,7 +22629,7 @@ function pp(r) {
|
|
|
22633
22629
|
}
|
|
22634
22630
|
});
|
|
22635
22631
|
return () => {
|
|
22636
|
-
|
|
22632
|
+
E.dispose();
|
|
22637
22633
|
};
|
|
22638
22634
|
}, [g, p, C]), d ? /* @__PURE__ */ w(
|
|
22639
22635
|
yI,
|
|
@@ -22642,9 +22638,9 @@ function pp(r) {
|
|
|
22642
22638
|
title: a ? m.t("dataValidation.listMultiple.dropdown") : m.t("dataValidation.list.dropdown"),
|
|
22643
22639
|
value: II(f != null ? f : ""),
|
|
22644
22640
|
multiple: a,
|
|
22645
|
-
onChange: async (
|
|
22646
|
-
const T = RI(
|
|
22647
|
-
v(T), await (i == null ? void 0 : i(
|
|
22641
|
+
onChange: async (E) => {
|
|
22642
|
+
const T = RI(E);
|
|
22643
|
+
v(T), await (i == null ? void 0 : i(E)) !== !1 && n();
|
|
22648
22644
|
},
|
|
22649
22645
|
options: s,
|
|
22650
22646
|
onEdit: o,
|
|
@@ -23173,14 +23169,14 @@ let pl = class extends rm {
|
|
|
23173
23169
|
* In Mobile version, new selection is determined by cursor cell and current of activeSelectionControl.model
|
|
23174
23170
|
*/
|
|
23175
23171
|
_movingHandler(e, t, n, i) {
|
|
23176
|
-
var
|
|
23172
|
+
var M, E, T, P, A, H, O, V, W, j, B, z, Z;
|
|
23177
23173
|
this._rangeType = i;
|
|
23178
23174
|
const o = this._skeleton, s = this._scene, l = {
|
|
23179
23175
|
startRow: n.model.startRow,
|
|
23180
23176
|
endRow: n.model.endRow,
|
|
23181
23177
|
startColumn: n.model.startColumn,
|
|
23182
23178
|
endColumn: n.model.endColumn
|
|
23183
|
-
}, a = s.getViewport(U.VIEW_MAIN), c = (
|
|
23179
|
+
}, a = s.getViewport(U.VIEW_MAIN), c = (M = this._getViewportByCell(l.endRow, l.endColumn)) != null ? M : a, d = s.getScrollXYInfoByViewport(
|
|
23184
23180
|
Ve.FromArray([this._startViewportPosX, this._startViewportPosY]),
|
|
23185
23181
|
c
|
|
23186
23182
|
), { scaleX: u, scaleY: h } = s.getAncestorScale();
|
|
@@ -23188,7 +23184,7 @@ let pl = class extends rm {
|
|
|
23188
23184
|
const g = this._getSelectionWithCoordByOffset(e, t, u, h, d);
|
|
23189
23185
|
if (!g)
|
|
23190
23186
|
return !1;
|
|
23191
|
-
const { rangeWithCoord: m } = g, f = n.model.currentCell, v = (
|
|
23187
|
+
const { rangeWithCoord: m } = g, f = n.model.currentCell, v = (E = f == null ? void 0 : f.mergeInfo.startRow) != null ? E : -1, p = (T = f == null ? void 0 : f.mergeInfo.endRow) != null ? T : -1, C = (P = f == null ? void 0 : f.mergeInfo.startColumn) != null ? P : -1, _ = (A = f == null ? void 0 : f.mergeInfo.endColumn) != null ? A : -1;
|
|
23192
23188
|
let S = {
|
|
23193
23189
|
startRow: Math.min(m.startRow, v),
|
|
23194
23190
|
startColumn: Math.min(m.startColumn, C),
|
|
@@ -23201,9 +23197,9 @@ let pl = class extends rm {
|
|
|
23201
23197
|
endRow: Math.max(m.endRow, (V = f == null ? void 0 : f.actualRow) != null ? V : -1),
|
|
23202
23198
|
endColumn: Math.max(m.endColumn, (W = f == null ? void 0 : f.actualColumn) != null ? W : -1)
|
|
23203
23199
|
} : i === X.ROW && (S = {
|
|
23204
|
-
startRow: Math.min(m.startRow, (
|
|
23200
|
+
startRow: Math.min(m.startRow, (j = f == null ? void 0 : f.actualRow) != null ? j : -1),
|
|
23205
23201
|
startColumn: Math.min(m.startColumn, (B = f == null ? void 0 : f.actualColumn) != null ? B : -1),
|
|
23206
|
-
endRow: Math.max(m.endRow, (
|
|
23202
|
+
endRow: Math.max(m.endRow, (z = f == null ? void 0 : f.actualRow) != null ? z : -1),
|
|
23207
23203
|
endColumn: Math.max(m.endColumn, (Z = f == null ? void 0 : f.actualColumn) != null ? Z : -1)
|
|
23208
23204
|
}), !S)
|
|
23209
23205
|
return !1;
|
|
@@ -23803,13 +23799,13 @@ let _l = class extends oe {
|
|
|
23803
23799
|
endRow: t.startRow + h - 1,
|
|
23804
23800
|
endColumn: t.startColumn + g - 1
|
|
23805
23801
|
} : t, f = Array.from({ length: m.endRow - m.startRow + 1 }, () => Array.from({ length: m.endColumn - m.startColumn + 1 }, () => ({}))), v = [];
|
|
23806
|
-
f.forEach((B,
|
|
23802
|
+
f.forEach((B, z) => {
|
|
23807
23803
|
B.forEach((Z, ce) => {
|
|
23808
|
-
const ge =
|
|
23809
|
-
_e && (f[
|
|
23804
|
+
const ge = z % h + a, se = ce % g + c, _e = l.getValue(ge, se);
|
|
23805
|
+
_e && (f[z][ce].s = Object.keys(_e).length > 0 ? _e : null);
|
|
23810
23806
|
});
|
|
23811
23807
|
}), s.forEach((B) => {
|
|
23812
|
-
const
|
|
23808
|
+
const z = {
|
|
23813
23809
|
startRow: B.startRow - a,
|
|
23814
23810
|
startColumn: B.startColumn - c,
|
|
23815
23811
|
endRow: B.endRow - a,
|
|
@@ -23818,19 +23814,19 @@ let _l = class extends oe {
|
|
|
23818
23814
|
for (let ge = 0; ge < Z; ge++)
|
|
23819
23815
|
for (let se = 0; se < ce; se++)
|
|
23820
23816
|
v.push({
|
|
23821
|
-
startRow:
|
|
23822
|
-
startColumn:
|
|
23823
|
-
endRow:
|
|
23824
|
-
endColumn:
|
|
23817
|
+
startRow: z.startRow + ge * h + m.startRow,
|
|
23818
|
+
startColumn: z.startColumn + se * g + m.startColumn,
|
|
23819
|
+
endRow: z.endRow + ge * h + m.startRow,
|
|
23820
|
+
endColumn: z.endColumn + se * g + m.startColumn
|
|
23825
23821
|
});
|
|
23826
23822
|
});
|
|
23827
23823
|
const p = [m], C = new Ge(), _ = new Ge();
|
|
23828
23824
|
if (le.isArray(f))
|
|
23829
23825
|
for (let B = 0; B < p.length; B++) {
|
|
23830
|
-
const { startRow:
|
|
23831
|
-
for (let se = 0; se <= ce -
|
|
23826
|
+
const { startRow: z, startColumn: Z, endRow: ce, endColumn: ge } = p[B];
|
|
23827
|
+
for (let se = 0; se <= ce - z; se++)
|
|
23832
23828
|
for (let _e = 0; _e <= ge - Z; _e++)
|
|
23833
|
-
C.setValue(se +
|
|
23829
|
+
C.setValue(se + z, _e + Z, { s: null }), _.setValue(se + z, _e + Z, f[se][_e]);
|
|
23834
23830
|
}
|
|
23835
23831
|
const S = {
|
|
23836
23832
|
subUnitId: e,
|
|
@@ -23843,28 +23839,28 @@ let _l = class extends oe {
|
|
|
23843
23839
|
}, R = this._injector.invoke(
|
|
23844
23840
|
$t,
|
|
23845
23841
|
S
|
|
23846
|
-
), { undos: y, redos:
|
|
23842
|
+
), { undos: y, redos: M } = i.onCommandExecute({
|
|
23847
23843
|
id: Nl.id,
|
|
23848
23844
|
params: { ...I, range: p }
|
|
23849
|
-
}),
|
|
23845
|
+
}), E = Bl(v), T = [], P = [], A = o.getUnit(r).getSheetBySheetId(e), H = nf(A, E), O = {
|
|
23850
23846
|
unitId: r,
|
|
23851
23847
|
subUnitId: e,
|
|
23852
|
-
ranges:
|
|
23848
|
+
ranges: E
|
|
23853
23849
|
}, V = {
|
|
23854
23850
|
unitId: r,
|
|
23855
23851
|
subUnitId: e,
|
|
23856
|
-
ranges:
|
|
23852
|
+
ranges: E
|
|
23857
23853
|
};
|
|
23858
23854
|
T.push({ id: Kt.id, params: O }), T.push({ id: Qt.id, params: V });
|
|
23859
23855
|
const W = this._injector.invoke(
|
|
23860
23856
|
Wl,
|
|
23861
23857
|
O
|
|
23862
|
-
),
|
|
23858
|
+
), j = this._injector.invoke(
|
|
23863
23859
|
Fl,
|
|
23864
23860
|
V
|
|
23865
23861
|
);
|
|
23866
|
-
if (P.push({ id: Kt.id, params:
|
|
23867
|
-
const B = this._injector.invoke((
|
|
23862
|
+
if (P.push({ id: Kt.id, params: j }), P.push({ id: Qt.id, params: W }), H) {
|
|
23863
|
+
const B = this._injector.invoke((z) => rf(z, r, A, E));
|
|
23868
23864
|
T.unshift(...B.redos), P.push(...B.undos);
|
|
23869
23865
|
}
|
|
23870
23866
|
return {
|
|
@@ -23877,7 +23873,7 @@ let _l = class extends oe {
|
|
|
23877
23873
|
redos: [
|
|
23878
23874
|
{ id: be.id, params: S },
|
|
23879
23875
|
{ id: be.id, params: I },
|
|
23880
|
-
...
|
|
23876
|
+
...M,
|
|
23881
23877
|
...T
|
|
23882
23878
|
]
|
|
23883
23879
|
};
|
|
@@ -24118,7 +24114,7 @@ let qc = class extends oe {
|
|
|
24118
24114
|
_initialHover(e = 0) {
|
|
24119
24115
|
var u, h, g;
|
|
24120
24116
|
const t = this._context.components.get(Ye.COLUMN), n = this._context.components.get(Ye.ROW), i = e === 0 ? n : t, o = (m) => {
|
|
24121
|
-
var y,
|
|
24117
|
+
var y, M, E;
|
|
24122
24118
|
const f = (y = this._sheetSkeletonManagerService.getCurrentParam()) == null ? void 0 : y.skeleton;
|
|
24123
24119
|
if (f == null)
|
|
24124
24120
|
return;
|
|
@@ -24129,14 +24125,14 @@ let qc = class extends oe {
|
|
|
24129
24125
|
f
|
|
24130
24126
|
);
|
|
24131
24127
|
if (e === 0)
|
|
24132
|
-
(
|
|
24128
|
+
(M = this._hoverRect) == null || M.transformByState({
|
|
24133
24129
|
width: v,
|
|
24134
24130
|
height: I - _,
|
|
24135
24131
|
left: 0,
|
|
24136
24132
|
top: _
|
|
24137
24133
|
});
|
|
24138
24134
|
else {
|
|
24139
|
-
if (this._currentColumn = R, (
|
|
24135
|
+
if (this._currentColumn = R, (E = this._hoverRect) == null || E.transformByState({
|
|
24140
24136
|
width: S - C,
|
|
24141
24137
|
height: p,
|
|
24142
24138
|
left: C,
|
|
@@ -24656,15 +24652,15 @@ let $c = class extends rm {
|
|
|
24656
24652
|
return;
|
|
24657
24653
|
}
|
|
24658
24654
|
this._checkClearPreviousControls(e);
|
|
24659
|
-
const y = S == null ? void 0 : S.model.currentCell,
|
|
24660
|
-
|
|
24655
|
+
const y = S == null ? void 0 : S.model.currentCell, M = e.shiftKey && y, E = this._remainLastEnabled && !e.ctrlKey && !e.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
|
|
24656
|
+
M && y ? this._makeSelectionByTwoCells(
|
|
24661
24657
|
y,
|
|
24662
24658
|
I,
|
|
24663
24659
|
s,
|
|
24664
24660
|
n,
|
|
24665
24661
|
S
|
|
24666
24662
|
// Get updated in this method
|
|
24667
|
-
) :
|
|
24663
|
+
) : E && S ? S.updateRangeBySelectionWithCoord(_) : S = this.newSelectionControl(l, s, C);
|
|
24668
24664
|
for (let A = 0; A < this.getSelectionControls().length - 1; A++)
|
|
24669
24665
|
this.getSelectionControls()[A].clearHighlight();
|
|
24670
24666
|
l.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (T = l.getTransformer()) == null || T.clearSelectedObjects(), this._setupPointerMoveListener(d, S, n, o, h, g), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), this._scenePointerUpSub = l.onPointerUp$.subscribeEvent(() => {
|
|
@@ -24863,14 +24859,14 @@ function Gy(r, e, t, n) {
|
|
|
24863
24859
|
startRow: h,
|
|
24864
24860
|
endRow: h
|
|
24865
24861
|
}), { startX: p, startY: C } = f, { startX: _, startY: S } = v, I = Zn(p + l, 1), R = Zn(C + c, 1);
|
|
24866
|
-
let y = Zn(_ + u - I, 1),
|
|
24867
|
-
return f.startX === v.endX && (y = 0), f.startY === v.endY && (
|
|
24862
|
+
let y = Zn(_ + u - I, 1), M = Zn(S + g - R, 1);
|
|
24863
|
+
return f.startX === v.endX && (y = 0), f.startY === v.endY && (M = 0), {
|
|
24868
24864
|
unitId: r,
|
|
24869
24865
|
subUnitId: e,
|
|
24870
24866
|
left: I,
|
|
24871
24867
|
top: R,
|
|
24872
24868
|
width: y,
|
|
24873
|
-
height:
|
|
24869
|
+
height: M
|
|
24874
24870
|
};
|
|
24875
24871
|
}
|
|
24876
24872
|
function qy(r, e, t, n, i, o, s) {
|