@univerjs/sheets 1.0.0-alpha.8 → 1.0.0-beta.1
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 +57 -59
- package/lib/cjs/index.js +286 -312
- package/lib/cjs/locale/ar-SA.js +1 -2
- package/lib/cjs/locale/ca-ES.js +1 -2
- package/lib/cjs/locale/de-DE.js +1 -2
- package/lib/cjs/locale/en-US.js +1 -2
- package/lib/cjs/locale/es-ES.js +1 -2
- package/lib/cjs/locale/fa-IR.js +1 -2
- package/lib/cjs/locale/fr-FR.js +1 -2
- package/lib/cjs/locale/id-ID.js +1 -2
- package/lib/cjs/locale/it-IT.js +1 -2
- package/lib/cjs/locale/ja-JP.js +1 -2
- package/lib/cjs/locale/ko-KR.js +1 -2
- package/lib/cjs/locale/pl-PL.js +1 -2
- package/lib/cjs/locale/pt-BR.js +1 -2
- package/lib/cjs/locale/ru-RU.js +1 -2
- package/lib/cjs/locale/sk-SK.js +1 -2
- package/lib/cjs/locale/vi-VN.js +1 -2
- package/lib/cjs/locale/zh-CN.js +2 -3
- package/lib/cjs/locale/zh-HK.js +2 -3
- package/lib/cjs/locale/zh-TW.js +2 -3
- package/lib/es/facade.js +57 -59
- package/lib/es/index.js +287 -314
- package/lib/es/locale/ar-SA.js +1 -2
- package/lib/es/locale/ca-ES.js +1 -2
- package/lib/es/locale/de-DE.js +1 -2
- package/lib/es/locale/en-US.js +1 -2
- package/lib/es/locale/es-ES.js +1 -2
- package/lib/es/locale/fa-IR.js +1 -2
- package/lib/es/locale/fr-FR.js +1 -2
- package/lib/es/locale/id-ID.js +1 -2
- package/lib/es/locale/it-IT.js +1 -2
- package/lib/es/locale/ja-JP.js +1 -2
- package/lib/es/locale/ko-KR.js +1 -2
- package/lib/es/locale/pl-PL.js +1 -2
- package/lib/es/locale/pt-BR.js +1 -2
- package/lib/es/locale/ru-RU.js +1 -2
- package/lib/es/locale/sk-SK.js +1 -2
- package/lib/es/locale/vi-VN.js +1 -2
- package/lib/es/locale/zh-CN.js +2 -3
- package/lib/es/locale/zh-HK.js +2 -3
- package/lib/es/locale/zh-TW.js +2 -3
- package/lib/facade.js +57 -59
- package/lib/index.js +287 -314
- package/lib/locale/ar-SA.js +1 -2
- package/lib/locale/ca-ES.js +1 -2
- package/lib/locale/de-DE.js +1 -2
- package/lib/locale/en-US.js +1 -2
- package/lib/locale/es-ES.js +1 -2
- package/lib/locale/fa-IR.js +1 -2
- package/lib/locale/fr-FR.js +1 -2
- package/lib/locale/id-ID.js +1 -2
- package/lib/locale/it-IT.js +1 -2
- package/lib/locale/ja-JP.js +1 -2
- package/lib/locale/ko-KR.js +1 -2
- package/lib/locale/pl-PL.js +1 -2
- package/lib/locale/pt-BR.js +1 -2
- package/lib/locale/ru-RU.js +1 -2
- package/lib/locale/sk-SK.js +1 -2
- package/lib/locale/vi-VN.js +1 -2
- package/lib/locale/zh-CN.js +2 -3
- package/lib/locale/zh-HK.js +2 -3
- package/lib/locale/zh-TW.js +2 -3
- package/lib/types/basics/cell-type.d.ts +2 -1
- package/lib/types/facade/f-worksheet.d.ts +10 -9
- package/lib/types/index.d.ts +1 -1
- package/lib/types/locale/en-US.d.ts +0 -1
- package/lib/types/services/ref-range/ref-range.service.d.ts +2 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +8 -8
package/lib/cjs/locale/ar-SA.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "سيؤدي الاستمرار في الدمج إلى الاحتفاظ بقيمة الخلية العلوية اليسرى فقط، وسيتم تجاهل القيم الأخرى. هل أنت متأكد من الاستمرار؟",
|
|
44
44
|
cancel: "إلغاء الدمج",
|
|
45
45
|
confirm: "الاستمرار في الدمج",
|
|
46
|
-
warning: "تحذير"
|
|
47
|
-
dismantleMergeCellWarning: "سيؤدي هذا إلى تقسيم بعض الخلايا المدمجة. هل تريد الاستمرار؟"
|
|
46
|
+
warning: "تحذير"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/ca-ES.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Continuar la fusió només conservarà el valor de la cel·la superior esquerra, descartant els altres valors. Estàs segur de continuar?",
|
|
44
44
|
cancel: "Cancel·lar fusió",
|
|
45
45
|
confirm: "Continuar fusió",
|
|
46
|
-
warning: "Avís"
|
|
47
|
-
dismantleMergeCellWarning: "Això dividirà algunes cel·les fusionades. Vols continuar?"
|
|
46
|
+
warning: "Avís"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/de-DE.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Beim Fortfahren mit dem Zusammenführen bleibt nur der Wert der oberen linken Zelle erhalten, andere Werte werden verworfen. Möchten Sie wirklich fortfahren?",
|
|
44
44
|
cancel: "Zusammenführen abbrechen",
|
|
45
45
|
confirm: "Zusammenführen fortsetzen",
|
|
46
|
-
warning: "Warnung"
|
|
47
|
-
dismantleMergeCellWarning: "Dadurch werden einige verbundene Zellen aufgeteilt. Möchten Sie fortfahren?"
|
|
46
|
+
warning: "Warnung"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/en-US.js
CHANGED
|
@@ -58,8 +58,7 @@ const locale = { sheets: {
|
|
|
58
58
|
title: "Continue merging would only keep the upper-left cell value, discard other values. Are you sure to continue?",
|
|
59
59
|
cancel: "Cancel merging",
|
|
60
60
|
confirm: "Continue merging",
|
|
61
|
-
warning: "Warning"
|
|
62
|
-
dismantleMergeCellWarning: "This will cause some merged cells to be split. Do you want to continue?"
|
|
61
|
+
warning: "Warning"
|
|
63
62
|
} }
|
|
64
63
|
} };
|
|
65
64
|
|
package/lib/cjs/locale/es-ES.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Continuar la fusión solo conservará el valor de la celda superior izquierda, descartando los otros valores. ¿Estás seguro de continuar?",
|
|
44
44
|
cancel: "Cancelar fusión",
|
|
45
45
|
confirm: "Continuar fusión",
|
|
46
|
-
warning: "Advertencia"
|
|
47
|
-
dismantleMergeCellWarning: "Esto dividirá algunas celdas fusionadas. ¿Quieres continuar?"
|
|
46
|
+
warning: "Advertencia"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/fa-IR.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "ادغام ادامهدار فقط مقدار سلول بالا-چپ را حفظ میکند و سایر مقادیر را حذف میکند. آیا مطمئن هستید که ادامه میدهید؟",
|
|
44
44
|
cancel: "لغو ادغام",
|
|
45
45
|
confirm: "ادغام ادامهدار",
|
|
46
|
-
warning: "هشدار"
|
|
47
|
-
dismantleMergeCellWarning: "این باعث تقسیم برخی سلولهای ادغامشده میشود. آیا میخواهید ادامه دهید؟"
|
|
46
|
+
warning: "هشدار"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/fr-FR.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Continuer la fusion ne conservera que la valeur de la cellule en haut à gauche, en supprimant les autres valeurs. Êtes-vous sûr de vouloir continuer ?",
|
|
44
44
|
cancel: "Annuler la fusion",
|
|
45
45
|
confirm: "Continuer la fusion",
|
|
46
|
-
warning: "Avertissement"
|
|
47
|
-
dismantleMergeCellWarning: "Cela divisera certaines cellules fusionnées. Voulez-vous continuer ?"
|
|
46
|
+
warning: "Avertissement"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/id-ID.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Melanjutkan penggabungan hanya akan menyimpan nilai sel kiri atas, membuang nilai lainnya. Apakah Anda yakin ingin melanjutkan?",
|
|
44
44
|
cancel: "Batalkan penggabungan",
|
|
45
45
|
confirm: "Lanjutkan penggabungan",
|
|
46
|
-
warning: "Peringatan"
|
|
47
|
-
dismantleMergeCellWarning: "Ini akan menyebabkan beberapa sel gabungan terpisah. Apakah Anda ingin melanjutkan?"
|
|
46
|
+
warning: "Peringatan"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/it-IT.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Continuando l'unione verrà mantenuto solo il valore della cella in alto a sinistra, scartando gli altri valori. Continuare?",
|
|
44
44
|
cancel: "Annulla unione",
|
|
45
45
|
confirm: "Continua unione",
|
|
46
|
-
warning: "Avviso"
|
|
47
|
-
dismantleMergeCellWarning: "Questo comporterà la divisione di alcune celle unite. Continuare?"
|
|
46
|
+
warning: "Avviso"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/ja-JP.js
CHANGED
package/lib/cjs/locale/ko-KR.js
CHANGED
package/lib/cjs/locale/pl-PL.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Kontynuowanie scalania spowoduje zachowanie tylko wartości komórki w lewym górnym rogu, pozostałe wartości zostaną odrzucone. Czy na pewno chcesz kontynuować?",
|
|
44
44
|
cancel: "Anuluj scalanie",
|
|
45
45
|
confirm: "Kontynuuj scalanie",
|
|
46
|
-
warning: "Ostrzeżenie"
|
|
47
|
-
dismantleMergeCellWarning: "Spowoduje to rozdzielenie niektórych scalonych komórek. Czy chcesz kontynuować?"
|
|
46
|
+
warning: "Ostrzeżenie"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/pt-BR.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Continuar a mesclagem manterá apenas o valor da célula superior esquerda, descartando os outros valores. Tem certeza de que deseja continuar?",
|
|
44
44
|
cancel: "Cancelar mesclagem",
|
|
45
45
|
confirm: "Continuar mesclagem",
|
|
46
|
-
warning: "Aviso"
|
|
47
|
-
dismantleMergeCellWarning: "Isso fará com que algumas células mescladas sejam divididas. Deseja continuar?"
|
|
46
|
+
warning: "Aviso"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/ru-RU.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Продолжение объединения сохранит только значение верхней левой ячейки, остальные значения будут удалены. Вы уверены, что хотите продолжить?",
|
|
44
44
|
cancel: "Отменить объединение",
|
|
45
45
|
confirm: "Продолжить объединение",
|
|
46
|
-
warning: "Предупреждение"
|
|
47
|
-
dismantleMergeCellWarning: "Это приведет к разделению некоторых объединенных ячеек. Вы хотите продолжить?"
|
|
46
|
+
warning: "Предупреждение"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/sk-SK.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Pokračovanie v zlúčení zachová iba hodnotu hornej ľavej bunky, ostatné hodnoty sa zahodia. Ste si istí, že chcete pokračovať?",
|
|
44
44
|
cancel: "Zrušiť zlúčenie",
|
|
45
45
|
confirm: "Pokračovať v zlúčení",
|
|
46
|
-
warning: "Varovanie"
|
|
47
|
-
dismantleMergeCellWarning: "To spôsobí rozdelenie niektorých zlúčených buniek. Chcete pokračovať?"
|
|
46
|
+
warning: "Varovanie"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/vi-VN.js
CHANGED
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "Tiếp tục hợp nhất chỉ giữ lại giá trị của ô trên cùng bên trái, loại bỏ các giá trị khác. Bạn có chắc chắn muốn tiếp tục không?",
|
|
44
44
|
cancel: "Hủy hợp nhất",
|
|
45
45
|
confirm: "Tiếp tục hợp nhất",
|
|
46
|
-
warning: "Cảnh báo"
|
|
47
|
-
dismantleMergeCellWarning: "Điều này sẽ khiến một số ô đã hợp nhất bị tách ra. Bạn có muốn tiếp tục không?"
|
|
46
|
+
warning: "Cảnh báo"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/zh-CN.js
CHANGED
|
@@ -18,7 +18,7 @@ const locale = { sheets: {
|
|
|
18
18
|
nameSheetConflict: "名称与工作表名称冲突",
|
|
19
19
|
formulaOrRefStringEmpty: "公式或引用字符串不能为空",
|
|
20
20
|
nameConflict: "名称与函数名称冲突",
|
|
21
|
-
defaultName: "
|
|
21
|
+
defaultName: "定义名称"
|
|
22
22
|
},
|
|
23
23
|
permission: { dialog: {
|
|
24
24
|
autoFillErr: "该范围已被保护,目前无自动填充权限。如需自动填充,请联系创建者。",
|
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "继续合并将只保留左上角单元格的值,丢弃其他值。您确定要继续吗?",
|
|
44
44
|
cancel: "取消合并",
|
|
45
45
|
confirm: "继续合并",
|
|
46
|
-
warning: "警告"
|
|
47
|
-
dismantleMergeCellWarning: "这将导致一些合并单元格被拆分。您要继续吗?"
|
|
46
|
+
warning: "警告"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/zh-HK.js
CHANGED
|
@@ -18,7 +18,7 @@ const locale = { sheets: {
|
|
|
18
18
|
nameSheetConflict: "名稱與工作表名稱衝突",
|
|
19
19
|
formulaOrRefStringEmpty: "公式或引用字串不能為空",
|
|
20
20
|
nameConflict: "名稱與函數名稱衝突",
|
|
21
|
-
defaultName: "
|
|
21
|
+
defaultName: "定義名稱"
|
|
22
22
|
},
|
|
23
23
|
permission: { dialog: {
|
|
24
24
|
autoFillErr: "範圍已被保護,目前無自動填入權限。如需自動填充,請聯絡建立者。 ",
|
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "繼續合併將只保留左上角儲存格的值,捨棄其他值。您確定要繼續嗎?",
|
|
44
44
|
cancel: "取消合併",
|
|
45
45
|
confirm: "繼續合併",
|
|
46
|
-
warning: "警告"
|
|
47
|
-
dismantleMergeCellWarning: "這將導致一些合併儲存格被拆分。您要繼續嗎?"
|
|
46
|
+
warning: "警告"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/cjs/locale/zh-TW.js
CHANGED
|
@@ -18,7 +18,7 @@ const locale = { sheets: {
|
|
|
18
18
|
nameSheetConflict: "名稱與工作表名稱衝突",
|
|
19
19
|
formulaOrRefStringEmpty: "公式或引用字串不能為空",
|
|
20
20
|
nameConflict: "名稱與函數名稱衝突",
|
|
21
|
-
defaultName: "
|
|
21
|
+
defaultName: "定義名稱"
|
|
22
22
|
},
|
|
23
23
|
permission: { dialog: {
|
|
24
24
|
autoFillErr: "範圍已被保護,目前無自動填入權限。如需自動填充,請聯絡建立者。 ",
|
|
@@ -43,8 +43,7 @@ const locale = { sheets: {
|
|
|
43
43
|
title: "繼續合併將只保留左上角儲存格的值,捨棄其他值。您確定要繼續嗎?",
|
|
44
44
|
cancel: "取消合併",
|
|
45
45
|
confirm: "繼續合併",
|
|
46
|
-
warning: "警告"
|
|
47
|
-
dismantleMergeCellWarning: "這將導致一些合併儲存格被拆分。您要繼續嗎?"
|
|
46
|
+
warning: "警告"
|
|
48
47
|
} }
|
|
49
48
|
} };
|
|
50
49
|
|
package/lib/es/facade.js
CHANGED
|
@@ -190,9 +190,9 @@ let FDefinedNameBuilder = class FDefinedNameBuilder {
|
|
|
190
190
|
setRefByRange(row, column, numRows, numColumns) {
|
|
191
191
|
this._definedNameParam.formulaOrRefString = serializeRange({
|
|
192
192
|
startRow: row,
|
|
193
|
-
endRow: row + (numRows
|
|
193
|
+
endRow: row + (numRows ?? 1) - 1,
|
|
194
194
|
startColumn: column,
|
|
195
|
-
endColumn: column + (numColumns
|
|
195
|
+
endColumn: column + (numColumns ?? 1) - 1
|
|
196
196
|
});
|
|
197
197
|
return this;
|
|
198
198
|
}
|
|
@@ -432,9 +432,9 @@ let FDefinedName = class FDefinedName extends FBase {
|
|
|
432
432
|
setRefByRange(row, column, numRows, numColumns) {
|
|
433
433
|
this._definedNameParam.formulaOrRefString = serializeRange({
|
|
434
434
|
startRow: row,
|
|
435
|
-
endRow: row + (numRows
|
|
435
|
+
endRow: row + (numRows ?? 1) - 1,
|
|
436
436
|
startColumn: column,
|
|
437
|
-
endColumn: column + (numColumns
|
|
437
|
+
endColumn: column + (numColumns ?? 1) - 1
|
|
438
438
|
});
|
|
439
439
|
this._apply();
|
|
440
440
|
}
|
|
@@ -1618,10 +1618,9 @@ let FWorksheetPermission = class FWorksheetPermission extends FBase {
|
|
|
1618
1618
|
if (!this.canEdit()) return false;
|
|
1619
1619
|
const rules = this._rangeProtectionRuleModel.getSubunitRuleList(this._unitId, this._subUnitId);
|
|
1620
1620
|
for (const rule of rules) for (const range of rule.ranges) if (row >= range.startRow && row <= range.endRow && col >= range.startColumn && col <= range.endColumn) {
|
|
1621
|
-
var _permission$value;
|
|
1622
1621
|
const permissionPoint = new RangeProtectionPermissionEditPoint(this._unitId, this._subUnitId, rule.permissionId);
|
|
1623
1622
|
const permission = this._permissionService.getPermissionPoint(permissionPoint.id);
|
|
1624
|
-
return (
|
|
1623
|
+
return (permission === null || permission === void 0 ? void 0 : permission.value) ?? false;
|
|
1625
1624
|
}
|
|
1626
1625
|
return true;
|
|
1627
1626
|
}
|
|
@@ -1660,10 +1659,9 @@ let FWorksheetPermission = class FWorksheetPermission extends FBase {
|
|
|
1660
1659
|
if (!this.canView()) return false;
|
|
1661
1660
|
const rules = this._rangeProtectionRuleModel.getSubunitRuleList(this._unitId, this._subUnitId);
|
|
1662
1661
|
for (const rule of rules) for (const range of rule.ranges) if (row >= range.startRow && row <= range.endRow && col >= range.startColumn && col <= range.endColumn) {
|
|
1663
|
-
var _permission$value2;
|
|
1664
1662
|
const permissionPoint = new RangeProtectionPermissionViewPoint(this._unitId, this._subUnitId, rule.permissionId);
|
|
1665
1663
|
const permission = this._permissionService.getPermissionPoint(permissionPoint.id);
|
|
1666
|
-
return (
|
|
1664
|
+
return (permission === null || permission === void 0 ? void 0 : permission.value) ?? false;
|
|
1667
1665
|
}
|
|
1668
1666
|
return true;
|
|
1669
1667
|
}
|
|
@@ -1682,12 +1680,11 @@ let FWorksheetPermission = class FWorksheetPermission extends FBase {
|
|
|
1682
1680
|
* ```
|
|
1683
1681
|
*/
|
|
1684
1682
|
getPoint(point) {
|
|
1685
|
-
var _permissionPoint$valu;
|
|
1686
1683
|
const PointClass = WORKSHEET_PERMISSION_POINT_MAP[point];
|
|
1687
1684
|
if (!PointClass) throw new Error(`Unknown worksheet permission point: ${point}`);
|
|
1688
1685
|
const instance = new PointClass(this._unitId, this._subUnitId);
|
|
1689
1686
|
const permissionPoint = this._permissionService.getPermissionPoint(instance.id);
|
|
1690
|
-
return (
|
|
1687
|
+
return (permissionPoint === null || permissionPoint === void 0 ? void 0 : permissionPoint.value) ?? true;
|
|
1691
1688
|
}
|
|
1692
1689
|
/**
|
|
1693
1690
|
* Get a snapshot of all permission points.
|
|
@@ -2019,6 +2016,11 @@ function covertToColRange(range, worksheet) {
|
|
|
2019
2016
|
//#endregion
|
|
2020
2017
|
//#region src/facade/f-worksheet.ts
|
|
2021
2018
|
var _FWorksheet;
|
|
2019
|
+
function assertValidRowInsertion(methodName, rowIndex, rowCount, howMany) {
|
|
2020
|
+
if (!Number.isInteger(howMany) || howMany <= 0) throw new RangeError(`${methodName}(): row count ${howMany} must be a positive integer.`);
|
|
2021
|
+
const lastRowIndex = rowCount - 1;
|
|
2022
|
+
if (!Number.isInteger(rowIndex) || rowIndex < 0 || rowIndex > lastRowIndex) throw new RangeError(`${methodName}(): row index ${rowIndex} is out of bounds. The worksheet has ${rowCount} rows; expected an integer from 0 to ${lastRowIndex}. To insert ${howMany} row(s) at the bottom, use insertRowsAfter(${lastRowIndex}, ${howMany}). To resize the worksheet directly, use setRowCount(${rowCount + howMany}).`);
|
|
2023
|
+
}
|
|
2022
2024
|
let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
2023
2025
|
/**
|
|
2024
2026
|
* Creates a new worksheet facade instance
|
|
@@ -2299,9 +2301,9 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
2299
2301
|
sheet = this._worksheet;
|
|
2300
2302
|
range = {
|
|
2301
2303
|
startRow: rowOrA1Notation,
|
|
2302
|
-
endRow: rowOrA1Notation + (numRows
|
|
2304
|
+
endRow: rowOrA1Notation + (numRows ?? 1) - 1,
|
|
2303
2305
|
startColumn: column,
|
|
2304
|
-
endColumn: column + (numColumns
|
|
2306
|
+
endColumn: column + (numColumns ?? 1) - 1,
|
|
2305
2307
|
unitId: this._workbook.getUnitId(),
|
|
2306
2308
|
sheetId: this._worksheet.getSheetId()
|
|
2307
2309
|
};
|
|
@@ -2338,7 +2340,7 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
2338
2340
|
}
|
|
2339
2341
|
/**
|
|
2340
2342
|
* Inserts a row after the given row position.
|
|
2341
|
-
* @param {number} afterPosition - The row after which the new row should be added
|
|
2343
|
+
* @param {number} afterPosition - The existing row after which the new row should be added. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
|
|
2342
2344
|
* @returns {FWorksheet} This sheet, for chaining.
|
|
2343
2345
|
* @example
|
|
2344
2346
|
* ```typescript
|
|
@@ -2355,7 +2357,7 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
2355
2357
|
}
|
|
2356
2358
|
/**
|
|
2357
2359
|
* Inserts a row before the given row position.
|
|
2358
|
-
* @param {number} beforePosition - The row before which the new row should be added
|
|
2360
|
+
* @param {number} beforePosition - The existing row before which the new row should be added. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
|
|
2359
2361
|
* @returns {FWorksheet} This sheet, for chaining.
|
|
2360
2362
|
* @example
|
|
2361
2363
|
* ```typescript
|
|
@@ -2372,8 +2374,8 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
2372
2374
|
}
|
|
2373
2375
|
/**
|
|
2374
2376
|
* Inserts one or more consecutive blank rows in a sheet starting at the specified location.
|
|
2375
|
-
* @param {number} rowIndex - The
|
|
2376
|
-
* @param {number} numRows - The number of rows to insert.
|
|
2377
|
+
* @param {number} rowIndex - The existing row before which rows are inserted. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
|
|
2378
|
+
* @param {number} numRows - The positive number of rows to insert.
|
|
2377
2379
|
* @returns {FWorksheet} This sheet, for chaining.
|
|
2378
2380
|
* @example
|
|
2379
2381
|
* ```typescript
|
|
@@ -2386,12 +2388,13 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
2386
2388
|
* ```
|
|
2387
2389
|
*/
|
|
2388
2390
|
insertRows(rowIndex, numRows = 1) {
|
|
2391
|
+
assertValidRowInsertion("insertRows", rowIndex, this.getMaxRows(), numRows);
|
|
2389
2392
|
return this.insertRowsBefore(rowIndex, numRows);
|
|
2390
2393
|
}
|
|
2391
2394
|
/**
|
|
2392
2395
|
* Inserts a number of rows after the given row position.
|
|
2393
|
-
* @param {number} afterPosition - The row after which the new rows should be added
|
|
2394
|
-
* @param {number} howMany - The number of rows to insert.
|
|
2396
|
+
* @param {number} afterPosition - The existing row after which the new rows should be added. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
|
|
2397
|
+
* @param {number} howMany - The positive number of rows to insert.
|
|
2395
2398
|
* @returns {FWorksheet} This sheet, for chaining.
|
|
2396
2399
|
* @example
|
|
2397
2400
|
* ```typescript
|
|
@@ -2404,6 +2407,7 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
2404
2407
|
* ```
|
|
2405
2408
|
*/
|
|
2406
2409
|
insertRowsAfter(afterPosition, howMany) {
|
|
2410
|
+
assertValidRowInsertion("insertRowsAfter", afterPosition, this.getMaxRows(), howMany);
|
|
2407
2411
|
const unitId = this._workbook.getUnitId();
|
|
2408
2412
|
const subUnitId = this._worksheet.getSheetId();
|
|
2409
2413
|
const direction = Direction.DOWN;
|
|
@@ -2428,8 +2432,8 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
2428
2432
|
}
|
|
2429
2433
|
/**
|
|
2430
2434
|
* Inserts a number of rows before the given row position.
|
|
2431
|
-
* @param {number} beforePosition - The row before which the new rows should be added
|
|
2432
|
-
* @param {number} howMany - The number of rows to insert.
|
|
2435
|
+
* @param {number} beforePosition - The existing row before which the new rows should be added. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
|
|
2436
|
+
* @param {number} howMany - The positive number of rows to insert.
|
|
2433
2437
|
* @returns {FWorksheet} This sheet, for chaining.
|
|
2434
2438
|
* @example
|
|
2435
2439
|
* ```typescript
|
|
@@ -2442,6 +2446,7 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
2442
2446
|
* ```
|
|
2443
2447
|
*/
|
|
2444
2448
|
insertRowsBefore(beforePosition, howMany) {
|
|
2449
|
+
assertValidRowInsertion("insertRowsBefore", beforePosition, this.getMaxRows(), howMany);
|
|
2445
2450
|
const unitId = this._workbook.getUnitId();
|
|
2446
2451
|
const subUnitId = this._worksheet.getSheetId();
|
|
2447
2452
|
const direction = Direction.UP;
|
|
@@ -4145,7 +4150,8 @@ let FWorksheet = _FWorksheet = class FWorksheet extends FBaseInitialable {
|
|
|
4145
4150
|
return this._worksheet.getColumnManager().getCustomMetadata(index);
|
|
4146
4151
|
}
|
|
4147
4152
|
/**
|
|
4148
|
-
* Appends a row to the bottom of the current data region in the sheet. If
|
|
4153
|
+
* Appends a row to the bottom of the current data region in the sheet. If the destination row is already within the worksheet capacity,
|
|
4154
|
+
* this method writes into that row without increasing `getMaxRows()`. If a cell's content begins with =, it's interpreted as a formula.
|
|
4149
4155
|
* @param {CellValue[]} rowContents - An array of values for the new row.
|
|
4150
4156
|
* @returns {FWorksheet} Returns the current worksheet instance for method chaining.
|
|
4151
4157
|
* @example
|
|
@@ -4650,8 +4656,8 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
4650
4656
|
* ```
|
|
4651
4657
|
*/
|
|
4652
4658
|
getFontFamily(type = "row") {
|
|
4653
|
-
var _this$getCellStyleDat
|
|
4654
|
-
return (_this$getCellStyleDat =
|
|
4659
|
+
var _this$getCellStyleDat;
|
|
4660
|
+
return ((_this$getCellStyleDat = this.getCellStyleData(type)) === null || _this$getCellStyleDat === void 0 ? void 0 : _this$getCellStyleDat.ff) ?? null;
|
|
4655
4661
|
}
|
|
4656
4662
|
/**
|
|
4657
4663
|
* Get the font size of the cell.
|
|
@@ -4672,8 +4678,8 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
4672
4678
|
* ```
|
|
4673
4679
|
*/
|
|
4674
4680
|
getFontSize(type = "row") {
|
|
4675
|
-
var _this$
|
|
4676
|
-
return (
|
|
4681
|
+
var _this$getCellStyleDat2;
|
|
4682
|
+
return ((_this$getCellStyleDat2 = this.getCellStyleData(type)) === null || _this$getCellStyleDat2 === void 0 ? void 0 : _this$getCellStyleDat2.fs) ?? null;
|
|
4677
4683
|
}
|
|
4678
4684
|
/**
|
|
4679
4685
|
* Return first cell style in this range.
|
|
@@ -4723,9 +4729,9 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
4723
4729
|
}));
|
|
4724
4730
|
}
|
|
4725
4731
|
getValue(includeRichText) {
|
|
4726
|
-
var _this$_worksheet$getC
|
|
4732
|
+
var _this$_worksheet$getC;
|
|
4727
4733
|
if (includeRichText) return this.getValueAndRichTextValue();
|
|
4728
|
-
return (_this$_worksheet$getC =
|
|
4734
|
+
return ((_this$_worksheet$getC = this._worksheet.getCell(this._range.startRow, this._range.startColumn)) === null || _this$_worksheet$getC === void 0 ? void 0 : _this$_worksheet$getC.v) ?? null;
|
|
4729
4735
|
}
|
|
4730
4736
|
/**
|
|
4731
4737
|
* Returns the raw value of the top-left cell in the range. Empty cells return `null`.
|
|
@@ -4780,8 +4786,8 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
4780
4786
|
for (let r = startRow; r <= endRow; r++) {
|
|
4781
4787
|
const row = [];
|
|
4782
4788
|
for (let c = startColumn; c <= endColumn; c++) {
|
|
4783
|
-
var _this$_worksheet$
|
|
4784
|
-
row.push((
|
|
4789
|
+
var _this$_worksheet$getC2;
|
|
4790
|
+
row.push(((_this$_worksheet$getC2 = this._worksheet.getCell(r, c)) === null || _this$_worksheet$getC2 === void 0 ? void 0 : _this$_worksheet$getC2.v) ?? null);
|
|
4785
4791
|
}
|
|
4786
4792
|
range.push(row);
|
|
4787
4793
|
}
|
|
@@ -4913,8 +4919,7 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
4913
4919
|
* ```
|
|
4914
4920
|
*/
|
|
4915
4921
|
getCellData() {
|
|
4916
|
-
|
|
4917
|
-
return (_this$_worksheet$getC5 = this._worksheet.getCell(this._range.startRow, this._range.startColumn)) !== null && _this$_worksheet$getC5 !== void 0 ? _this$_worksheet$getC5 : null;
|
|
4922
|
+
return this._worksheet.getCell(this._range.startRow, this._range.startColumn) ?? null;
|
|
4918
4923
|
}
|
|
4919
4924
|
/**
|
|
4920
4925
|
* Alias for getCellDataGrid.
|
|
@@ -5035,8 +5040,7 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
5035
5040
|
* ```
|
|
5036
5041
|
*/
|
|
5037
5042
|
getFormula() {
|
|
5038
|
-
|
|
5039
|
-
return (_this$_formulaDataMod = this._formulaDataModel.getFormulaStringByCell(this._range.startRow, this._range.startColumn, this._worksheet.getSheetId(), this._workbook.getUnitId())) !== null && _this$_formulaDataMod !== void 0 ? _this$_formulaDataMod : "";
|
|
5043
|
+
return this._formulaDataModel.getFormulaStringByCell(this._range.startRow, this._range.startColumn, this._worksheet.getSheetId(), this._workbook.getUnitId()) ?? "";
|
|
5040
5044
|
}
|
|
5041
5045
|
/**
|
|
5042
5046
|
* Returns the formulas (A1 notation) for the cells in the range. Entries in the 2D array are empty strings for cells with no formula.
|
|
@@ -5082,9 +5086,9 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
5082
5086
|
}
|
|
5083
5087
|
/** Gets whether the top-left cell shrinks its font size to fit the cell width. */
|
|
5084
5088
|
getShrinkToFit() {
|
|
5085
|
-
var _this$_worksheet$
|
|
5089
|
+
var _this$_worksheet$getC3;
|
|
5086
5090
|
const { startRow, startColumn } = this._range;
|
|
5087
|
-
return ((_this$_worksheet$
|
|
5091
|
+
return ((_this$_worksheet$getC3 = this._worksheet.getComposedCellStyle(startRow, startColumn)) === null || _this$_worksheet$getC3 === void 0 ? void 0 : _this$_worksheet$getC3.stf) === BooleanNumber.TRUE;
|
|
5088
5092
|
}
|
|
5089
5093
|
/**
|
|
5090
5094
|
* Gets whether text wrapping is enabled for cells in the range.
|
|
@@ -5244,10 +5248,9 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
5244
5248
|
* ```
|
|
5245
5249
|
*/
|
|
5246
5250
|
getCustomMetaData() {
|
|
5247
|
-
var _cell$custom;
|
|
5248
5251
|
this._logService.warn(SHEETS_CUSTOM_FIELD_WARNING_MESSAGE);
|
|
5249
5252
|
const cell = this.getCellData();
|
|
5250
|
-
return (
|
|
5253
|
+
return (cell === null || cell === void 0 ? void 0 : cell.custom) ?? null;
|
|
5251
5254
|
}
|
|
5252
5255
|
/**
|
|
5253
5256
|
* Returns the custom meta data for the cells in the range.
|
|
@@ -5263,10 +5266,7 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
5263
5266
|
*/
|
|
5264
5267
|
getCustomMetaDatas() {
|
|
5265
5268
|
this._logService.warn(SHEETS_CUSTOM_FIELD_WARNING_MESSAGE);
|
|
5266
|
-
return this.getCellDataGrid().map((row) => row.map((data) =>
|
|
5267
|
-
var _data$custom;
|
|
5268
|
-
return (_data$custom = data === null || data === void 0 ? void 0 : data.custom) !== null && _data$custom !== void 0 ? _data$custom : null;
|
|
5269
|
-
}));
|
|
5269
|
+
return this.getCellDataGrid().map((row) => row.map((data) => (data === null || data === void 0 ? void 0 : data.custom) ?? null));
|
|
5270
5270
|
}
|
|
5271
5271
|
/**
|
|
5272
5272
|
* Sets basic border properties for the current range.
|
|
@@ -5309,9 +5309,9 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
5309
5309
|
* ```
|
|
5310
5310
|
*/
|
|
5311
5311
|
getBackground() {
|
|
5312
|
-
var _style$background
|
|
5312
|
+
var _style$background;
|
|
5313
5313
|
const style = this.getCellStyle();
|
|
5314
|
-
return (
|
|
5314
|
+
return (style === null || style === void 0 || (_style$background = style.background) === null || _style$background === void 0 ? void 0 : _style$background.rgb) ?? DEFAULT_STYLES.bg.rgb;
|
|
5315
5315
|
}
|
|
5316
5316
|
/**
|
|
5317
5317
|
* Returns the background colors of the cells in the range.
|
|
@@ -5327,8 +5327,8 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
5327
5327
|
*/
|
|
5328
5328
|
getBackgrounds() {
|
|
5329
5329
|
return this.getCellStyles().map((row) => row.map((style) => {
|
|
5330
|
-
var _style$
|
|
5331
|
-
return (
|
|
5330
|
+
var _style$background2;
|
|
5331
|
+
return (style === null || style === void 0 || (_style$background2 = style.background) === null || _style$background2 === void 0 ? void 0 : _style$background2.rgb) ?? DEFAULT_STYLES.bg.rgb;
|
|
5332
5332
|
}));
|
|
5333
5333
|
}
|
|
5334
5334
|
/**
|
|
@@ -6870,12 +6870,11 @@ let FWorkbookPermission = class FWorkbookPermission extends FBase {
|
|
|
6870
6870
|
* ```
|
|
6871
6871
|
*/
|
|
6872
6872
|
getPoint(point) {
|
|
6873
|
-
var _permissionPoint$valu;
|
|
6874
6873
|
const PointClass = WORKBOOK_PERMISSION_POINT_MAP[point];
|
|
6875
6874
|
if (!PointClass) throw new Error(`Unknown workbook permission point: ${point}`);
|
|
6876
6875
|
const instance = new PointClass(this._unitId);
|
|
6877
6876
|
const permissionPoint = this._permissionService.getPermissionPoint(instance.id);
|
|
6878
|
-
return (
|
|
6877
|
+
return (permissionPoint === null || permissionPoint === void 0 ? void 0 : permissionPoint.value) ?? true;
|
|
6879
6878
|
}
|
|
6880
6879
|
/**
|
|
6881
6880
|
* Get a snapshot of all permission points.
|
|
@@ -7209,13 +7208,13 @@ let FWorkbook = class FWorkbook extends FBaseInitialable {
|
|
|
7209
7208
|
* ```
|
|
7210
7209
|
*/
|
|
7211
7210
|
create(name, rows, columns, options) {
|
|
7212
|
-
var _options$sheet
|
|
7213
|
-
const newSheet = mergeWorksheetSnapshotWithDefault(Tools.deepClone((
|
|
7211
|
+
var _options$sheet;
|
|
7212
|
+
const newSheet = mergeWorksheetSnapshotWithDefault(Tools.deepClone((options === null || options === void 0 ? void 0 : options.sheet) ?? {}));
|
|
7214
7213
|
newSheet.name = name;
|
|
7215
7214
|
newSheet.rowCount = rows;
|
|
7216
7215
|
newSheet.columnCount = columns;
|
|
7217
|
-
newSheet.id = options === null || options === void 0 || (_options$
|
|
7218
|
-
const newSheetIndex = (
|
|
7216
|
+
newSheet.id = options === null || options === void 0 || (_options$sheet = options.sheet) === null || _options$sheet === void 0 ? void 0 : _options$sheet.id;
|
|
7217
|
+
const newSheetIndex = (options === null || options === void 0 ? void 0 : options.index) ?? this._workbook.getSheets().length;
|
|
7219
7218
|
this._commandService.syncExecuteCommand(InsertSheetCommand.id, {
|
|
7220
7219
|
unitId: this.id,
|
|
7221
7220
|
index: newSheetIndex,
|
|
@@ -7322,12 +7321,12 @@ let FWorkbook = class FWorkbook extends FBaseInitialable {
|
|
|
7322
7321
|
* ```
|
|
7323
7322
|
*/
|
|
7324
7323
|
insertSheet(sheetName, options) {
|
|
7325
|
-
var _options$
|
|
7326
|
-
const newSheet = mergeWorksheetSnapshotWithDefault(Tools.deepClone((
|
|
7324
|
+
var _options$sheet2;
|
|
7325
|
+
const newSheet = mergeWorksheetSnapshotWithDefault(Tools.deepClone((options === null || options === void 0 ? void 0 : options.sheet) ?? {}));
|
|
7327
7326
|
if (sheetName !== void 0) newSheet.name = sheetName;
|
|
7328
7327
|
else delete newSheet.name;
|
|
7329
|
-
newSheet.id = options === null || options === void 0 || (_options$
|
|
7330
|
-
const newSheetIndex = (
|
|
7328
|
+
newSheet.id = options === null || options === void 0 || (_options$sheet2 = options.sheet) === null || _options$sheet2 === void 0 ? void 0 : _options$sheet2.id;
|
|
7329
|
+
const newSheetIndex = (options === null || options === void 0 ? void 0 : options.index) ?? this._workbook.getSheets().length;
|
|
7331
7330
|
this._commandService.syncExecuteCommand(InsertSheetCommand.id, {
|
|
7332
7331
|
unitId: this.id,
|
|
7333
7332
|
index: newSheetIndex,
|
|
@@ -8204,12 +8203,11 @@ var FUniverSheetsMixin = class extends FUniver {
|
|
|
8204
8203
|
})));
|
|
8205
8204
|
this.disposeWithMe(this.registerEventHandler(this.Event.BeforeGridlineEnableChange, () => commandService.beforeCommandExecuted((commandInfo) => {
|
|
8206
8205
|
if (commandInfo.id === ToggleGridlinesCommand.id) {
|
|
8207
|
-
var _params$showGridlines;
|
|
8208
8206
|
const params = commandInfo.params;
|
|
8209
8207
|
const target = this.getSheetCommandTarget(params);
|
|
8210
8208
|
if (!target) return;
|
|
8211
8209
|
const { workbook, worksheet } = target;
|
|
8212
|
-
const showGridlines =
|
|
8210
|
+
const showGridlines = params.showGridlines ?? !worksheet.hasHiddenGridLines();
|
|
8213
8211
|
const eventParams = {
|
|
8214
8212
|
workbook,
|
|
8215
8213
|
worksheet,
|
|
@@ -8236,12 +8234,12 @@ var FUniverSheetsMixin = class extends FUniver {
|
|
|
8236
8234
|
})));
|
|
8237
8235
|
this.disposeWithMe(this.registerEventHandler(this.Event.SheetCreated, () => commandService.onCommandExecuted((commandInfo) => {
|
|
8238
8236
|
if (commandInfo.id === InsertSheetCommand.id) {
|
|
8239
|
-
var _params$sheet
|
|
8237
|
+
var _params$sheet;
|
|
8240
8238
|
const params = commandInfo.params;
|
|
8241
8239
|
const workbook = (params === null || params === void 0 ? void 0 : params.unitId) ? this.getWorkbook(params.unitId) : this.getActiveWorkbook();
|
|
8242
8240
|
if (!workbook) return;
|
|
8243
8241
|
const sheets = workbook.getSheets();
|
|
8244
|
-
const worksheet = (params === null || params === void 0 || (_params$sheet = params.sheet) === null || _params$sheet === void 0 ? void 0 : _params$sheet.id) ? workbook.getSheetBySheetId(params.sheet.id) : sheets[(
|
|
8242
|
+
const worksheet = (params === null || params === void 0 || (_params$sheet = params.sheet) === null || _params$sheet === void 0 ? void 0 : _params$sheet.id) ? workbook.getSheetBySheetId(params.sheet.id) : sheets[(params === null || params === void 0 ? void 0 : params.index) ?? sheets.length - 1];
|
|
8245
8243
|
if (!worksheet) return;
|
|
8246
8244
|
const eventParams = {
|
|
8247
8245
|
workbook,
|