@univerjs/sheets 0.6.7 → 0.6.9
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/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +116 -58
- package/lib/es/index.js +555 -541
- package/lib/facade.js +6262 -0
- package/lib/index.js +12266 -0
- package/lib/locale/en-US.js +17 -0
- package/lib/locale/fa-IR.js +17 -0
- package/lib/locale/fr-FR.js +17 -0
- package/lib/locale/ru-RU.js +17 -0
- package/lib/locale/vi-VN.js +17 -0
- package/lib/locale/zh-CN.js +17 -0
- package/lib/locale/zh-TW.js +17 -0
- package/lib/types/facade/f-range.d.ts +68 -5
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +8 -8
package/lib/es/facade.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var Ze = Object.defineProperty;
|
|
2
2
|
var et = (r, e, t) => e in r ? Ze(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var E = (r, e, t) => et(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { Inject as u, Injector as x, ICommandService as
|
|
5
|
-
import { FBase as
|
|
6
|
-
import { WorksheetProtectionRuleModel as Le, RangeProtectionRuleModel as ze, WorksheetProtectionPointModel as Ge, SetDefinedNameCommand as se, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as oe, RemoveDefinedNameCommand as ut, PermissionPointsDefinitions as
|
|
4
|
+
import { Inject as u, Injector as x, ICommandService as g, IPermissionService as ue, IAuthzIoService as Be, LocaleService as Ve, generateRandomId as Fe, Rectangle as N, RANGE_TYPE as w, isFormulaString as tt, isCellV as nt, isICellData as rt, HorizontalAlign as T, VerticalAlign as A, ObjectMatrix as V, Tools as st, TextStyleValue as we, RichTextValue as P, BooleanNumber as l, WrapStrategy as G, DEFAULT_STYLES as ke, Dimension as M, isNullCell as D, ILogService as He, Direction as j, IResourceLoaderService as ot, IUniverInstanceService as re, mergeWorksheetSnapshotWithDefault as it, UndoCommand as at, RedoCommand as ht, toDisposable as Oe, UniverInstanceType as U, CanceledError as v } from "@univerjs/core";
|
|
5
|
+
import { FBase as le, FBaseInitialable as ge, FUniver as je, FEnum as dt, FEventName as ct } from "@univerjs/core/facade";
|
|
6
|
+
import { WorksheetProtectionRuleModel as Le, RangeProtectionRuleModel as ze, WorksheetProtectionPointModel as Ge, SetDefinedNameCommand as se, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as oe, RemoveDefinedNameCommand as ut, PermissionPointsDefinitions as lt, WorkbookEditablePermission as $e, UnitObject as W, AddWorksheetProtectionMutation as gt, DeleteWorksheetProtectionMutation as mt, getAllWorksheetPermissionPoint as _t, getAllWorksheetPermissionPointByPointPanel as Se, SetWorksheetPermissionPointsMutation as wt, AddRangeProtectionMutation as kt, DeleteRangeProtectionMutation as St, SetRangeProtectionMutation as Ct, WorksheetEditPermission as ft, WorksheetViewPermission as vt, SetBorderBasicCommand as It, SetStyleCommand as b, SetTextRotationCommand as Rt, SetRangeValuesCommand as B, SetTextWrapCommand as ie, SetVerticalTextAlignCommand as bt, SetHorizontalTextAlignCommand as pt, addMergeCellsUtil as Q, getAddMergeMutationRangeByType as Ce, RemoveWorksheetMergeCommand as Et, getPrimaryForRange as $, SetSelectionsOperation as me, SplitTextToColumnsCommand as yt, SetWorksheetRangeThemeStyleCommand as Ut, DeleteWorksheetRangeThemeStyleCommand as xt, SheetRangeThemeService as qe, ClearSelectionAllCommand as Ke, ClearSelectionContentCommand as Ye, ClearSelectionFormatCommand as Je, InsertRangeMoveDownCommand as Pt, InsertRangeMoveRightCommand as Mt, DeleteRangeMoveUpCommand as Nt, DeleteRangeMoveLeftCommand as Tt, getNextPrimaryCell as At, SheetsSelectionsService as Qe, SetWorksheetDefaultStyleMutation as Dt, SetColDataCommand as fe, SetRowDataCommand as ve, copyRangeStyles as L, InsertRowByRangeCommand as Ie, RemoveRowByRangeCommand as Wt, MoveRowsCommand as Bt, SetRowHiddenCommand as Re, SetSpecificRowsVisibleCommand as be, SetWorksheetRowIsAutoHeightMutation as Vt, SetRowHeightCommand as pe, SetWorksheetRowIsAutoHeightCommand as X, InsertColByRangeCommand as Ee, RemoveColByRangeCommand as Ft, MoveColsCommand as Ht, SetColHiddenCommand as ye, SetSpecificColsVisibleCommand as Ue, SetColWidthCommand as Ot, SetFrozenCommand as Z, CancelFrozenCommand as jt, ToggleGridlinesCommand as ae, SetGridlinesColorCommand as he, SetTabColorCommand as Lt, SetRangeValuesMutation as xe, SetWorksheetHideCommand as zt, SetWorksheetShowCommand as Gt, SetWorksheetNameCommand as de, AppendRowCommand as $t, InsertSheetCommand as F, SetWorksheetActiveOperation as H, RemoveSheetCommand as ce, CopySheetCommand as qt, SetWorksheetOrderCommand as Kt, RegisterWorksheetRangeThemeStyleCommand as Yt, UnregisterWorksheetRangeThemeStyleCommand as Jt, RangeThemeStyle as Qt, SetWorksheetOrderMutation as Pe, SetTabColorMutation as Me, SetWorksheetHideMutation as Ne, COMMAND_LISTENER_VALUE_CHANGE as Xt, getValueChangedEffectedRange as Zt, SheetValueChangeType as en, SheetSkeletonChangeType as tn, SplitDelimiterEnum as nn } from "@univerjs/sheets";
|
|
7
7
|
import { IDefinedNamesService as Xe, serializeRange as _e, FormulaDataModel as rn, serializeRangeWithSheet as sn, deserializeRangeWithSheet as on } from "@univerjs/engine-formula";
|
|
8
8
|
var an = Object.getOwnPropertyDescriptor, hn = (r, e, t, n) => {
|
|
9
9
|
for (var s = n > 1 ? void 0 : n ? an(e, t) : e, o = r.length - 1, i; o >= 0; o--)
|
|
@@ -180,7 +180,7 @@ class J {
|
|
|
180
180
|
return this._definedNameParam = e, this;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
let q = class extends
|
|
183
|
+
let q = class extends le {
|
|
184
184
|
constructor(r, e, t, n, s, o, i, a, h, d) {
|
|
185
185
|
super(), this._definedNameParam = r, this._injector = e, this._commandService = t, this._permissionService = n, this._worksheetProtectionRuleModel = s, this._rangeProtectionRuleModel = o, this._worksheetProtectionPointRuleModel = i, this._authzIoService = a, this._localeService = h, this._definedNamesService = d;
|
|
186
186
|
}
|
|
@@ -399,7 +399,7 @@ let q = class extends ge {
|
|
|
399
399
|
};
|
|
400
400
|
q = hn([
|
|
401
401
|
I(1, u(x)),
|
|
402
|
-
I(2,
|
|
402
|
+
I(2, g),
|
|
403
403
|
I(3, ue),
|
|
404
404
|
I(4, u(Le)),
|
|
405
405
|
I(5, u(ze)),
|
|
@@ -413,13 +413,13 @@ var cn = Object.getOwnPropertyDescriptor, un = (r, e, t, n) => {
|
|
|
413
413
|
(i = r[o]) && (s = i(s) || s);
|
|
414
414
|
return s;
|
|
415
415
|
}, y = (r, e) => (t, n) => e(t, n, r);
|
|
416
|
-
let K = class extends
|
|
416
|
+
let K = class extends le {
|
|
417
417
|
constructor(e, t, n, s, o, i, a) {
|
|
418
418
|
super();
|
|
419
419
|
/**
|
|
420
420
|
* Permission point definition, can read the point constructor want to modify from here
|
|
421
421
|
*/
|
|
422
|
-
E(this, "permissionPointsDefinition",
|
|
422
|
+
E(this, "permissionPointsDefinition", lt);
|
|
423
423
|
/**
|
|
424
424
|
* An observable object used to monitor permission change events within a range, thereby triggering corresponding subsequent processing.
|
|
425
425
|
*/
|
|
@@ -501,7 +501,7 @@ let K = class extends ge {
|
|
|
501
501
|
scope: void 0
|
|
502
502
|
}
|
|
503
503
|
});
|
|
504
|
-
if (this._commandService.syncExecuteCommand(
|
|
504
|
+
if (this._commandService.syncExecuteCommand(gt.id, {
|
|
505
505
|
unitId: e,
|
|
506
506
|
subUnitId: t,
|
|
507
507
|
rule: {
|
|
@@ -751,14 +751,14 @@ let K = class extends ge {
|
|
|
751
751
|
};
|
|
752
752
|
K = un([
|
|
753
753
|
y(0, u(x)),
|
|
754
|
-
y(1,
|
|
754
|
+
y(1, g),
|
|
755
755
|
y(2, ue),
|
|
756
756
|
y(3, u(Le)),
|
|
757
757
|
y(4, u(ze)),
|
|
758
758
|
y(5, u(Ge)),
|
|
759
759
|
y(6, u(Be))
|
|
760
760
|
], K);
|
|
761
|
-
function
|
|
761
|
+
function ln(r) {
|
|
762
762
|
switch (r) {
|
|
763
763
|
case "left":
|
|
764
764
|
return T.LEFT;
|
|
@@ -782,7 +782,7 @@ function Te(r) {
|
|
|
782
782
|
return "general";
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function gn(r) {
|
|
786
786
|
switch (r) {
|
|
787
787
|
case "top":
|
|
788
788
|
return A.TOP;
|
|
@@ -852,7 +852,7 @@ var mn = Object.getOwnPropertyDescriptor, _n = (r, e, t, n) => {
|
|
|
852
852
|
(i = r[o]) && (s = i(s) || s);
|
|
853
853
|
return s;
|
|
854
854
|
}, ne = (r, e) => (t, n) => e(t, n, r);
|
|
855
|
-
let m = class extends
|
|
855
|
+
let m = class extends ge {
|
|
856
856
|
constructor(r, e, t, n, s, o) {
|
|
857
857
|
super(n), this._workbook = r, this._worksheet = e, this._range = t, this._injector = n, this._commandService = s, this._formulaDataModel = o;
|
|
858
858
|
}
|
|
@@ -1017,7 +1017,14 @@ let m = class extends le {
|
|
|
1017
1017
|
return this._worksheet.getMergedCellRange(e, r, n, t).some((o) => N.equals(o, this._range));
|
|
1018
1018
|
}
|
|
1019
1019
|
/**
|
|
1020
|
-
* Return first cell style data in this range
|
|
1020
|
+
* Return first cell style data in this range. Please note that if there are row styles, col styles and (or)
|
|
1021
|
+
* worksheet style, they will be merged into the cell style. You can use `type` to specify the type of the style to get.
|
|
1022
|
+
*
|
|
1023
|
+
* @param {GetStyleType} type - The type of the style to get. 'row' means get the composed style of row, col and
|
|
1024
|
+
* default worksheet style. 'col' means get the composed style of col, row and default worksheet style.
|
|
1025
|
+
* 'cell' means get the style of cell without merging row style, col style and default worksheet style.
|
|
1026
|
+
* Default is 'row'.
|
|
1027
|
+
*
|
|
1021
1028
|
* @returns {IStyleData | null} The cell style data
|
|
1022
1029
|
* @example
|
|
1023
1030
|
* ```ts
|
|
@@ -1027,13 +1034,59 @@ let m = class extends le {
|
|
|
1027
1034
|
* console.log(fRange.getCellStyleData());
|
|
1028
1035
|
* ```
|
|
1029
1036
|
*/
|
|
1030
|
-
getCellStyleData() {
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1037
|
+
getCellStyleData(r = "row") {
|
|
1038
|
+
return r !== "cell" ? this._worksheet.getComposedCellStyle(this._range.startRow, this._range.startColumn, r === "row") : this._worksheet.getCellStyle(this._range.startRow, this._range.startColumn);
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Get the font family of the cell.
|
|
1042
|
+
*
|
|
1043
|
+
* @param {GetStyleType} type - The type of the style to get. 'row' means get the composed style of row, col and
|
|
1044
|
+
* default worksheet style. 'col' means get the composed style of col, row and default worksheet style.
|
|
1045
|
+
* 'cell' means get the style of cell without merging row style, col style and default worksheet style.
|
|
1046
|
+
* Default is 'row'.
|
|
1047
|
+
*
|
|
1048
|
+
* @returns {string | null} The font family of the cell
|
|
1049
|
+
* @example
|
|
1050
|
+
* ```ts
|
|
1051
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1052
|
+
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
1053
|
+
* const fRange = fWorksheet.getRange('A1:B2');
|
|
1054
|
+
* console.log(fRange.getFontFamily());
|
|
1055
|
+
* ```
|
|
1056
|
+
*/
|
|
1057
|
+
getFontFamily(r = "row") {
|
|
1058
|
+
var e, t;
|
|
1059
|
+
return (t = (e = this.getCellStyleData(r)) == null ? void 0 : e.ff) != null ? t : null;
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* Get the font size of the cell.
|
|
1063
|
+
*
|
|
1064
|
+
* @param {GetStyleType} type - The type of the style to get. 'row' means get the composed style of row, col and
|
|
1065
|
+
* default worksheet style. 'col' means get the composed style of col, row and default worksheet style.
|
|
1066
|
+
* 'cell' means get the style of cell without merging row style, col style and default worksheet style.
|
|
1067
|
+
* Default is 'row'.
|
|
1068
|
+
*
|
|
1069
|
+
* @returns {number | null} The font size of the cell
|
|
1070
|
+
* @example
|
|
1071
|
+
* ```ts
|
|
1072
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1073
|
+
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
1074
|
+
* const fRange = fWorksheet.getRange('A1:B2');
|
|
1075
|
+
* console.log(fRange.getFontSize());
|
|
1076
|
+
* ```
|
|
1077
|
+
*/
|
|
1078
|
+
getFontSize(r = "row") {
|
|
1079
|
+
var e, t;
|
|
1080
|
+
return (t = (e = this.getCellStyleData(r)) == null ? void 0 : e.fs) != null ? t : null;
|
|
1034
1081
|
}
|
|
1035
1082
|
/**
|
|
1036
|
-
* Return first cell style in this range
|
|
1083
|
+
* Return first cell style in this range.
|
|
1084
|
+
*
|
|
1085
|
+
* @param {GetStyleType} type - The type of the style to get. 'row' means get the composed style of row, col and
|
|
1086
|
+
* default worksheet style. 'col' means get the composed style of col, row and default worksheet style.
|
|
1087
|
+
* 'cell' means get the style of cell without merging row style, col style and default worksheet style.
|
|
1088
|
+
* Default is 'row'.
|
|
1089
|
+
*
|
|
1037
1090
|
* @returns {TextStyleValue | null} The cell style
|
|
1038
1091
|
* @example
|
|
1039
1092
|
* ```ts
|
|
@@ -1043,12 +1096,18 @@ let m = class extends le {
|
|
|
1043
1096
|
* console.log(fRange.getCellStyle());
|
|
1044
1097
|
* ```
|
|
1045
1098
|
*/
|
|
1046
|
-
getCellStyle() {
|
|
1047
|
-
const
|
|
1048
|
-
return
|
|
1099
|
+
getCellStyle(r = "row") {
|
|
1100
|
+
const e = this.getCellStyleData(r);
|
|
1101
|
+
return e ? we.create(e) : null;
|
|
1049
1102
|
}
|
|
1050
1103
|
/**
|
|
1051
1104
|
* Returns the cell styles for the cells in the range.
|
|
1105
|
+
*
|
|
1106
|
+
* @param {GetStyleType} type - The type of the style to get. 'row' means get the composed style of row, col and
|
|
1107
|
+
* default worksheet style. 'col' means get the composed style of col, row and default worksheet style.
|
|
1108
|
+
* 'cell' means get the style of cell without merging row style, col style and default worksheet style.
|
|
1109
|
+
* Default is 'row'.
|
|
1110
|
+
*
|
|
1052
1111
|
* @returns {Array<Array<TextStyleValue | null>>} A two-dimensional array of cell styles.
|
|
1053
1112
|
* @example
|
|
1054
1113
|
* ```ts
|
|
@@ -1058,12 +1117,11 @@ let m = class extends le {
|
|
|
1058
1117
|
* console.log(fRange.getCellStyles());
|
|
1059
1118
|
* ```
|
|
1060
1119
|
*/
|
|
1061
|
-
getCellStyles() {
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
return s ? we.create(s) : null;
|
|
1120
|
+
getCellStyles(r = "row") {
|
|
1121
|
+
return this.getCellDatas().map((t, n) => t.map((s, o) => {
|
|
1122
|
+
if (!s) return null;
|
|
1123
|
+
const i = r !== "cell" ? this._worksheet.getComposedCellStyle(n + this._range.startRow, o + this._range.startColumn, r === "row") : this._worksheet.getCellStyle(n + this._range.startRow, o + this._range.startColumn);
|
|
1124
|
+
return i ? we.create(i) : null;
|
|
1067
1125
|
}));
|
|
1068
1126
|
}
|
|
1069
1127
|
getValue(r) {
|
|
@@ -1410,7 +1468,7 @@ let m = class extends le {
|
|
|
1410
1468
|
* ```
|
|
1411
1469
|
*/
|
|
1412
1470
|
getWrap() {
|
|
1413
|
-
return this._worksheet.getRange(this._range).getWrap() ===
|
|
1471
|
+
return this._worksheet.getRange(this._range).getWrap() === l.TRUE;
|
|
1414
1472
|
}
|
|
1415
1473
|
/**
|
|
1416
1474
|
* Gets whether text wrapping is enabled for cells in the range.
|
|
@@ -1869,7 +1927,7 @@ let m = class extends le {
|
|
|
1869
1927
|
unitId: this._workbook.getUnitId(),
|
|
1870
1928
|
subUnitId: this._worksheet.getSheetId(),
|
|
1871
1929
|
range: this._range,
|
|
1872
|
-
value:
|
|
1930
|
+
value: gn(r)
|
|
1873
1931
|
}), this;
|
|
1874
1932
|
}
|
|
1875
1933
|
/**
|
|
@@ -1889,7 +1947,7 @@ let m = class extends le {
|
|
|
1889
1947
|
unitId: this._workbook.getUnitId(),
|
|
1890
1948
|
subUnitId: this._worksheet.getSheetId(),
|
|
1891
1949
|
range: this._range,
|
|
1892
|
-
value:
|
|
1950
|
+
value: ln(r)
|
|
1893
1951
|
}), this;
|
|
1894
1952
|
}
|
|
1895
1953
|
/**
|
|
@@ -1931,9 +1989,9 @@ let m = class extends le {
|
|
|
1931
1989
|
setFontWeight(r) {
|
|
1932
1990
|
let e;
|
|
1933
1991
|
if (r === "bold")
|
|
1934
|
-
e =
|
|
1992
|
+
e = l.TRUE;
|
|
1935
1993
|
else if (r === "normal")
|
|
1936
|
-
e =
|
|
1994
|
+
e = l.FALSE;
|
|
1937
1995
|
else if (r === null)
|
|
1938
1996
|
e = null;
|
|
1939
1997
|
else
|
|
@@ -1964,9 +2022,9 @@ let m = class extends le {
|
|
|
1964
2022
|
setFontStyle(r) {
|
|
1965
2023
|
let e;
|
|
1966
2024
|
if (r === "italic")
|
|
1967
|
-
e =
|
|
2025
|
+
e = l.TRUE;
|
|
1968
2026
|
else if (r === "normal")
|
|
1969
|
-
e =
|
|
2027
|
+
e = l.FALSE;
|
|
1970
2028
|
else if (r === null)
|
|
1971
2029
|
e = null;
|
|
1972
2030
|
else
|
|
@@ -1997,17 +2055,17 @@ let m = class extends le {
|
|
|
1997
2055
|
setFontLine(r) {
|
|
1998
2056
|
if (r === "underline")
|
|
1999
2057
|
this._setFontUnderline({
|
|
2000
|
-
s:
|
|
2058
|
+
s: l.TRUE
|
|
2001
2059
|
});
|
|
2002
2060
|
else if (r === "line-through")
|
|
2003
2061
|
this._setFontStrikethrough({
|
|
2004
|
-
s:
|
|
2062
|
+
s: l.TRUE
|
|
2005
2063
|
});
|
|
2006
2064
|
else if (r === "none")
|
|
2007
2065
|
this._setFontUnderline({
|
|
2008
|
-
s:
|
|
2066
|
+
s: l.FALSE
|
|
2009
2067
|
}), this._setFontStrikethrough({
|
|
2010
|
-
s:
|
|
2068
|
+
s: l.FALSE
|
|
2011
2069
|
});
|
|
2012
2070
|
else if (r === null)
|
|
2013
2071
|
this._setFontUnderline(null), this._setFontStrikethrough(null);
|
|
@@ -2806,7 +2864,7 @@ let m = class extends le {
|
|
|
2806
2864
|
};
|
|
2807
2865
|
m = _n([
|
|
2808
2866
|
ne(3, u(x)),
|
|
2809
|
-
ne(4,
|
|
2867
|
+
ne(4, g),
|
|
2810
2868
|
ne(5, u(rn))
|
|
2811
2869
|
], m);
|
|
2812
2870
|
var wn = Object.getOwnPropertyDescriptor, kn = (r, e, t, n) => {
|
|
@@ -2910,7 +2968,7 @@ let Y = class {
|
|
|
2910
2968
|
* ```
|
|
2911
2969
|
*/
|
|
2912
2970
|
updatePrimaryCell(r) {
|
|
2913
|
-
const e = this._injector.get(
|
|
2971
|
+
const e = this._injector.get(g);
|
|
2914
2972
|
let t = [], n = !1;
|
|
2915
2973
|
for (const { range: o, style: i } of this._selections)
|
|
2916
2974
|
N.contains(o, r.getRange()) ? (t.push({
|
|
@@ -2975,7 +3033,7 @@ var Cn = Object.getOwnPropertyDescriptor, fn = (r, e, t, n) => {
|
|
|
2975
3033
|
(i = r[o]) && (s = i(s) || s);
|
|
2976
3034
|
return s;
|
|
2977
3035
|
}, z = (r, e) => (t, n) => e(t, n, r);
|
|
2978
|
-
let k = class extends
|
|
3036
|
+
let k = class extends ge {
|
|
2979
3037
|
/**
|
|
2980
3038
|
* Creates a new worksheet facade instance
|
|
2981
3039
|
* @param {FWorkbook} _fWorkbook - The facade workbook instance
|
|
@@ -3575,7 +3633,7 @@ let k = class extends le {
|
|
|
3575
3633
|
* fWorkSheet.autoFitRow(24);
|
|
3576
3634
|
* ```
|
|
3577
3635
|
*/
|
|
3578
|
-
autoFitRow(e, t =
|
|
3636
|
+
autoFitRow(e, t = l.TRUE) {
|
|
3579
3637
|
const n = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), o = [{
|
|
3580
3638
|
startRow: e,
|
|
3581
3639
|
endRow: e,
|
|
@@ -4402,7 +4460,7 @@ let k = class extends le {
|
|
|
4402
4460
|
* ```
|
|
4403
4461
|
*/
|
|
4404
4462
|
hasHiddenGridLines() {
|
|
4405
|
-
return this._worksheet.getConfig().showGridlines ===
|
|
4463
|
+
return this._worksheet.getConfig().showGridlines === l.FALSE;
|
|
4406
4464
|
}
|
|
4407
4465
|
/**
|
|
4408
4466
|
* Hides or reveals the sheet gridlines.
|
|
@@ -4419,7 +4477,7 @@ let k = class extends le {
|
|
|
4419
4477
|
return this._commandService.syncExecuteCommand(ae.id, {
|
|
4420
4478
|
unitId: this._workbook.getUnitId(),
|
|
4421
4479
|
subUnitId: this._worksheet.getSheetId(),
|
|
4422
|
-
showGridlines: e ?
|
|
4480
|
+
showGridlines: e ? l.FALSE : l.TRUE
|
|
4423
4481
|
}), this;
|
|
4424
4482
|
}
|
|
4425
4483
|
/**
|
|
@@ -4493,7 +4551,7 @@ let k = class extends le {
|
|
|
4493
4551
|
* @deprecated use `univerAPI.addEvent(univerAPI.Event.SheetValueChanged, (params) => {})` instead
|
|
4494
4552
|
*/
|
|
4495
4553
|
onCellDataChange(e) {
|
|
4496
|
-
return this._injector.get(
|
|
4554
|
+
return this._injector.get(g).onCommandExecuted((n) => {
|
|
4497
4555
|
if (n.id === xe.id) {
|
|
4498
4556
|
const s = n.params;
|
|
4499
4557
|
s.unitId === this._workbook.getUnitId() && s.subUnitId === this._worksheet.getSheetId() && s.cellValue && e(new V(s.cellValue));
|
|
@@ -4505,7 +4563,7 @@ let k = class extends le {
|
|
|
4505
4563
|
* @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeSheetEditEnd, (params) => {})` instead
|
|
4506
4564
|
*/
|
|
4507
4565
|
onBeforeCellDataChange(e) {
|
|
4508
|
-
return this._injector.get(
|
|
4566
|
+
return this._injector.get(g).beforeCommandExecuted((n) => {
|
|
4509
4567
|
if (n.id === xe.id) {
|
|
4510
4568
|
const s = n.params;
|
|
4511
4569
|
s.unitId === this._workbook.getUnitId() && s.subUnitId === this._worksheet.getSheetId() && s.cellValue && e(new V(s.cellValue));
|
|
@@ -4524,8 +4582,8 @@ let k = class extends le {
|
|
|
4524
4582
|
* ```
|
|
4525
4583
|
*/
|
|
4526
4584
|
hideSheet() {
|
|
4527
|
-
const e = this._injector.get(
|
|
4528
|
-
if (this._workbook.getSheets().filter((o) => o.isSheetHidden() !==
|
|
4585
|
+
const e = this._injector.get(g);
|
|
4586
|
+
if (this._workbook.getSheets().filter((o) => o.isSheetHidden() !== l.TRUE).length <= 1)
|
|
4529
4587
|
throw new Error("Cannot hide the only visible sheet");
|
|
4530
4588
|
return e.syncExecuteCommand(zt.id, {
|
|
4531
4589
|
unitId: this._workbook.getUnitId(),
|
|
@@ -4544,7 +4602,7 @@ let k = class extends le {
|
|
|
4544
4602
|
* ```
|
|
4545
4603
|
*/
|
|
4546
4604
|
showSheet() {
|
|
4547
|
-
return this._injector.get(
|
|
4605
|
+
return this._injector.get(g).syncExecuteCommand(Gt.id, {
|
|
4548
4606
|
unitId: this._workbook.getUnitId(),
|
|
4549
4607
|
subUnitId: this._worksheet.getSheetId()
|
|
4550
4608
|
}), this;
|
|
@@ -4561,7 +4619,7 @@ let k = class extends le {
|
|
|
4561
4619
|
* ```
|
|
4562
4620
|
*/
|
|
4563
4621
|
isSheetHidden() {
|
|
4564
|
-
return this._worksheet.isSheetHidden() ===
|
|
4622
|
+
return this._worksheet.isSheetHidden() === l.TRUE;
|
|
4565
4623
|
}
|
|
4566
4624
|
/**
|
|
4567
4625
|
* Sets the sheet name.
|
|
@@ -4632,7 +4690,7 @@ let k = class extends le {
|
|
|
4632
4690
|
return this.clearContents();
|
|
4633
4691
|
if (e && e.formatOnly && !e.contentsOnly)
|
|
4634
4692
|
return this.clearFormats();
|
|
4635
|
-
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), s = this._injector.get(
|
|
4693
|
+
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), s = this._injector.get(g), o = {
|
|
4636
4694
|
startRow: 0,
|
|
4637
4695
|
endRow: this._worksheet.getRowCount() - 1,
|
|
4638
4696
|
startColumn: 0,
|
|
@@ -4657,7 +4715,7 @@ let k = class extends le {
|
|
|
4657
4715
|
* ```
|
|
4658
4716
|
*/
|
|
4659
4717
|
clearContents() {
|
|
4660
|
-
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), n = this._injector.get(
|
|
4718
|
+
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), n = this._injector.get(g), s = {
|
|
4661
4719
|
startRow: 0,
|
|
4662
4720
|
endRow: this._worksheet.getRowCount() - 1,
|
|
4663
4721
|
startColumn: 0,
|
|
@@ -4681,7 +4739,7 @@ let k = class extends le {
|
|
|
4681
4739
|
* ```
|
|
4682
4740
|
*/
|
|
4683
4741
|
clearFormats() {
|
|
4684
|
-
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), n = this._injector.get(
|
|
4742
|
+
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), n = this._injector.get(g), s = {
|
|
4685
4743
|
startRow: 0,
|
|
4686
4744
|
endRow: this._worksheet.getRowCount() - 1,
|
|
4687
4745
|
startColumn: 0,
|
|
@@ -4923,14 +4981,14 @@ k = fn([
|
|
|
4923
4981
|
z(3, u(x)),
|
|
4924
4982
|
z(4, u(Qe)),
|
|
4925
4983
|
z(5, u(He)),
|
|
4926
|
-
z(6,
|
|
4984
|
+
z(6, g)
|
|
4927
4985
|
], k);
|
|
4928
4986
|
var vn = Object.getOwnPropertyDescriptor, In = (r, e, t, n) => {
|
|
4929
4987
|
for (var s = n > 1 ? void 0 : n ? vn(e, t) : e, o = r.length - 1, i; o >= 0; o--)
|
|
4930
4988
|
(i = r[o]) && (s = i(s) || s);
|
|
4931
4989
|
return s;
|
|
4932
4990
|
}, R = (r, e) => (t, n) => e(t, n, r);
|
|
4933
|
-
let S = class extends
|
|
4991
|
+
let S = class extends ge {
|
|
4934
4992
|
constructor(e, t, n, s, o, i, a, h, d, c) {
|
|
4935
4993
|
super(t);
|
|
4936
4994
|
E(this, "id");
|
|
@@ -5711,7 +5769,7 @@ S = In([
|
|
|
5711
5769
|
R(2, u(ot)),
|
|
5712
5770
|
R(3, u(Qe)),
|
|
5713
5771
|
R(4, re),
|
|
5714
|
-
R(5,
|
|
5772
|
+
R(5, g),
|
|
5715
5773
|
R(6, ue),
|
|
5716
5774
|
R(7, He),
|
|
5717
5775
|
R(8, u(Ve)),
|
|
@@ -5768,7 +5826,7 @@ class Rn extends je {
|
|
|
5768
5826
|
*/
|
|
5769
5827
|
// eslint-disable-next-line max-lines-per-function
|
|
5770
5828
|
_initialize(e) {
|
|
5771
|
-
const t = e.get(
|
|
5829
|
+
const t = e.get(g);
|
|
5772
5830
|
this.registerEventHandler(
|
|
5773
5831
|
this.Event.BeforeSheetCreate,
|
|
5774
5832
|
() => t.beforeCommandExecuted((n) => {
|
|
@@ -6184,7 +6242,7 @@ var En = Object.getOwnPropertyDescriptor, yn = (r, e, t, n) => {
|
|
|
6184
6242
|
(i = r[o]) && (s = i(s) || s);
|
|
6185
6243
|
return s;
|
|
6186
6244
|
}, Un = (r, e) => (t, n) => e(t, n, r);
|
|
6187
|
-
let We = class extends
|
|
6245
|
+
let We = class extends le {
|
|
6188
6246
|
constructor(r) {
|
|
6189
6247
|
super(), this._injector = r;
|
|
6190
6248
|
}
|