@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.
Files changed (90) hide show
  1. package/lib/cjs/facade.js +57 -59
  2. package/lib/cjs/index.js +286 -312
  3. package/lib/cjs/locale/ar-SA.js +1 -2
  4. package/lib/cjs/locale/ca-ES.js +1 -2
  5. package/lib/cjs/locale/de-DE.js +1 -2
  6. package/lib/cjs/locale/en-US.js +1 -2
  7. package/lib/cjs/locale/es-ES.js +1 -2
  8. package/lib/cjs/locale/fa-IR.js +1 -2
  9. package/lib/cjs/locale/fr-FR.js +1 -2
  10. package/lib/cjs/locale/id-ID.js +1 -2
  11. package/lib/cjs/locale/it-IT.js +1 -2
  12. package/lib/cjs/locale/ja-JP.js +1 -2
  13. package/lib/cjs/locale/ko-KR.js +1 -2
  14. package/lib/cjs/locale/pl-PL.js +1 -2
  15. package/lib/cjs/locale/pt-BR.js +1 -2
  16. package/lib/cjs/locale/ru-RU.js +1 -2
  17. package/lib/cjs/locale/sk-SK.js +1 -2
  18. package/lib/cjs/locale/vi-VN.js +1 -2
  19. package/lib/cjs/locale/zh-CN.js +2 -3
  20. package/lib/cjs/locale/zh-HK.js +2 -3
  21. package/lib/cjs/locale/zh-TW.js +2 -3
  22. package/lib/es/facade.js +57 -59
  23. package/lib/es/index.js +287 -314
  24. package/lib/es/locale/ar-SA.js +1 -2
  25. package/lib/es/locale/ca-ES.js +1 -2
  26. package/lib/es/locale/de-DE.js +1 -2
  27. package/lib/es/locale/en-US.js +1 -2
  28. package/lib/es/locale/es-ES.js +1 -2
  29. package/lib/es/locale/fa-IR.js +1 -2
  30. package/lib/es/locale/fr-FR.js +1 -2
  31. package/lib/es/locale/id-ID.js +1 -2
  32. package/lib/es/locale/it-IT.js +1 -2
  33. package/lib/es/locale/ja-JP.js +1 -2
  34. package/lib/es/locale/ko-KR.js +1 -2
  35. package/lib/es/locale/pl-PL.js +1 -2
  36. package/lib/es/locale/pt-BR.js +1 -2
  37. package/lib/es/locale/ru-RU.js +1 -2
  38. package/lib/es/locale/sk-SK.js +1 -2
  39. package/lib/es/locale/vi-VN.js +1 -2
  40. package/lib/es/locale/zh-CN.js +2 -3
  41. package/lib/es/locale/zh-HK.js +2 -3
  42. package/lib/es/locale/zh-TW.js +2 -3
  43. package/lib/facade.js +57 -59
  44. package/lib/index.js +287 -314
  45. package/lib/locale/ar-SA.js +1 -2
  46. package/lib/locale/ca-ES.js +1 -2
  47. package/lib/locale/de-DE.js +1 -2
  48. package/lib/locale/en-US.js +1 -2
  49. package/lib/locale/es-ES.js +1 -2
  50. package/lib/locale/fa-IR.js +1 -2
  51. package/lib/locale/fr-FR.js +1 -2
  52. package/lib/locale/id-ID.js +1 -2
  53. package/lib/locale/it-IT.js +1 -2
  54. package/lib/locale/ja-JP.js +1 -2
  55. package/lib/locale/ko-KR.js +1 -2
  56. package/lib/locale/pl-PL.js +1 -2
  57. package/lib/locale/pt-BR.js +1 -2
  58. package/lib/locale/ru-RU.js +1 -2
  59. package/lib/locale/sk-SK.js +1 -2
  60. package/lib/locale/vi-VN.js +1 -2
  61. package/lib/locale/zh-CN.js +2 -3
  62. package/lib/locale/zh-HK.js +2 -3
  63. package/lib/locale/zh-TW.js +2 -3
  64. package/lib/types/basics/cell-type.d.ts +2 -1
  65. package/lib/types/facade/f-worksheet.d.ts +10 -9
  66. package/lib/types/index.d.ts +1 -1
  67. package/lib/types/locale/en-US.d.ts +0 -1
  68. package/lib/types/services/ref-range/ref-range.service.d.ts +2 -0
  69. package/lib/umd/facade.js +1 -1
  70. package/lib/umd/index.js +2 -2
  71. package/lib/umd/locale/ar-SA.js +1 -1
  72. package/lib/umd/locale/ca-ES.js +1 -1
  73. package/lib/umd/locale/de-DE.js +1 -1
  74. package/lib/umd/locale/en-US.js +1 -1
  75. package/lib/umd/locale/es-ES.js +1 -1
  76. package/lib/umd/locale/fa-IR.js +1 -1
  77. package/lib/umd/locale/fr-FR.js +1 -1
  78. package/lib/umd/locale/id-ID.js +1 -1
  79. package/lib/umd/locale/it-IT.js +1 -1
  80. package/lib/umd/locale/ja-JP.js +1 -1
  81. package/lib/umd/locale/ko-KR.js +1 -1
  82. package/lib/umd/locale/pl-PL.js +1 -1
  83. package/lib/umd/locale/pt-BR.js +1 -1
  84. package/lib/umd/locale/ru-RU.js +1 -1
  85. package/lib/umd/locale/sk-SK.js +1 -1
  86. package/lib/umd/locale/vi-VN.js +1 -1
  87. package/lib/umd/locale/zh-CN.js +1 -1
  88. package/lib/umd/locale/zh-HK.js +1 -1
  89. package/lib/umd/locale/zh-TW.js +1 -1
  90. package/package.json +8 -8
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "سيؤدي الاستمرار في الدمج إلى الاحتفاظ بقيمة الخلية العلوية اليسرى فقط، وسيتم تجاهل القيم الأخرى. هل أنت متأكد من الاستمرار؟",
43
43
  cancel: "إلغاء الدمج",
44
44
  confirm: "الاستمرار في الدمج",
45
- warning: "تحذير",
46
- dismantleMergeCellWarning: "سيؤدي هذا إلى تقسيم بعض الخلايا المدمجة. هل تريد الاستمرار؟"
45
+ warning: "تحذير"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "Continuar la fusió només conservarà el valor de la cel·la superior esquerra, descartant els altres valors. Estàs segur de continuar?",
43
43
  cancel: "Cancel·lar fusió",
44
44
  confirm: "Continuar fusió",
45
- warning: "Avís",
46
- dismantleMergeCellWarning: "Això dividirà algunes cel·les fusionades. Vols continuar?"
45
+ warning: "Avís"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  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?",
43
43
  cancel: "Zusammenführen abbrechen",
44
44
  confirm: "Zusammenführen fortsetzen",
45
- warning: "Warnung",
46
- dismantleMergeCellWarning: "Dadurch werden einige verbundene Zellen aufgeteilt. Möchten Sie fortfahren?"
45
+ warning: "Warnung"
47
46
  } }
48
47
  } };
49
48
 
@@ -57,8 +57,7 @@ const locale = { sheets: {
57
57
  title: "Continue merging would only keep the upper-left cell value, discard other values. Are you sure to continue?",
58
58
  cancel: "Cancel merging",
59
59
  confirm: "Continue merging",
60
- warning: "Warning",
61
- dismantleMergeCellWarning: "This will cause some merged cells to be split. Do you want to continue?"
60
+ warning: "Warning"
62
61
  } }
63
62
  } };
64
63
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "Continuar la fusión solo conservará el valor de la celda superior izquierda, descartando los otros valores. ¿Estás seguro de continuar?",
43
43
  cancel: "Cancelar fusión",
44
44
  confirm: "Continuar fusión",
45
- warning: "Advertencia",
46
- dismantleMergeCellWarning: "Esto dividirá algunas celdas fusionadas. ¿Quieres continuar?"
45
+ warning: "Advertencia"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "ادغام ادامه‌دار فقط مقدار سلول بالا-چپ را حفظ می‌کند و سایر مقادیر را حذف می‌کند. آیا مطمئن هستید که ادامه می‌دهید؟",
43
43
  cancel: "لغو ادغام",
44
44
  confirm: "ادغام ادامه‌دار",
45
- warning: "هشدار",
46
- dismantleMergeCellWarning: "این باعث تقسیم برخی سلول‌های ادغام‌شده می‌شود. آیا می‌خواهید ادامه دهید؟"
45
+ warning: "هشدار"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  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 ?",
43
43
  cancel: "Annuler la fusion",
44
44
  confirm: "Continuer la fusion",
45
- warning: "Avertissement",
46
- dismantleMergeCellWarning: "Cela divisera certaines cellules fusionnées. Voulez-vous continuer ?"
45
+ warning: "Avertissement"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "Melanjutkan penggabungan hanya akan menyimpan nilai sel kiri atas, membuang nilai lainnya. Apakah Anda yakin ingin melanjutkan?",
43
43
  cancel: "Batalkan penggabungan",
44
44
  confirm: "Lanjutkan penggabungan",
45
- warning: "Peringatan",
46
- dismantleMergeCellWarning: "Ini akan menyebabkan beberapa sel gabungan terpisah. Apakah Anda ingin melanjutkan?"
45
+ warning: "Peringatan"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "Continuando l'unione verrà mantenuto solo il valore della cella in alto a sinistra, scartando gli altri valori. Continuare?",
43
43
  cancel: "Annulla unione",
44
44
  confirm: "Continua unione",
45
- warning: "Avviso",
46
- dismantleMergeCellWarning: "Questo comporterà la divisione di alcune celle unite. Continuare?"
45
+ warning: "Avviso"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "結合を続行すると、左上のセルの値のみが保持され、他の値は破棄されます。続行しますか?",
43
43
  cancel: "結合をキャンセル",
44
44
  confirm: "結合を続行",
45
- warning: "警告",
46
- dismantleMergeCellWarning: "これにより、一部の結合セルが分割されます。続行しますか?"
45
+ warning: "警告"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "병합을 계속하면 왼쪽 상단 셀의 값만 유지되고 다른 값은 삭제됩니다. 계속하시겠습니까?",
43
43
  cancel: "병합 취소",
44
44
  confirm: "병합 계속",
45
- warning: "경고",
46
- dismantleMergeCellWarning: "일부 병합된 셀이 분할됩니다. 계속하시겠습니까?"
45
+ warning: "경고"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  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ć?",
43
43
  cancel: "Anuluj scalanie",
44
44
  confirm: "Kontynuuj scalanie",
45
- warning: "Ostrzeżenie",
46
- dismantleMergeCellWarning: "Spowoduje to rozdzielenie niektórych scalonych komórek. Czy chcesz kontynuować?"
45
+ warning: "Ostrzeżenie"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "Continuar a mesclagem manterá apenas o valor da célula superior esquerda, descartando os outros valores. Tem certeza de que deseja continuar?",
43
43
  cancel: "Cancelar mesclagem",
44
44
  confirm: "Continuar mesclagem",
45
- warning: "Aviso",
46
- dismantleMergeCellWarning: "Isso fará com que algumas células mescladas sejam divididas. Deseja continuar?"
45
+ warning: "Aviso"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "Продолжение объединения сохранит только значение верхней левой ячейки, остальные значения будут удалены. Вы уверены, что хотите продолжить?",
43
43
  cancel: "Отменить объединение",
44
44
  confirm: "Продолжить объединение",
45
- warning: "Предупреждение",
46
- dismantleMergeCellWarning: "Это приведет к разделению некоторых объединенных ячеек. Вы хотите продолжить?"
45
+ warning: "Предупреждение"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "Pokračovanie v zlúčení zachová iba hodnotu hornej ľavej bunky, ostatné hodnoty sa zahodia. Ste si istí, že chcete pokračovať?",
43
43
  cancel: "Zrušiť zlúčenie",
44
44
  confirm: "Pokračovať v zlúčení",
45
- warning: "Varovanie",
46
- dismantleMergeCellWarning: "To spôsobí rozdelenie niektorých zlúčených buniek. Chcete pokračovať?"
45
+ warning: "Varovanie"
47
46
  } }
48
47
  } };
49
48
 
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  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?",
43
43
  cancel: "Hủy hợp nhất",
44
44
  confirm: "Tiếp tục hợp nhất",
45
- warning: "Cảnh báo",
46
- 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?"
45
+ warning: "Cảnh báo"
47
46
  } }
48
47
  } };
49
48
 
@@ -17,7 +17,7 @@ const locale = { sheets: {
17
17
  nameSheetConflict: "名称与工作表名称冲突",
18
18
  formulaOrRefStringEmpty: "公式或引用字符串不能为空",
19
19
  nameConflict: "名称与函数名称冲突",
20
- defaultName: "DefinedName"
20
+ defaultName: "定义名称"
21
21
  },
22
22
  permission: { dialog: {
23
23
  autoFillErr: "该范围已被保护,目前无自动填充权限。如需自动填充,请联系创建者。",
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "继续合并将只保留左上角单元格的值,丢弃其他值。您确定要继续吗?",
43
43
  cancel: "取消合并",
44
44
  confirm: "继续合并",
45
- warning: "警告",
46
- dismantleMergeCellWarning: "这将导致一些合并单元格被拆分。您要继续吗?"
45
+ warning: "警告"
47
46
  } }
48
47
  } };
49
48
 
@@ -17,7 +17,7 @@ const locale = { sheets: {
17
17
  nameSheetConflict: "名稱與工作表名稱衝突",
18
18
  formulaOrRefStringEmpty: "公式或引用字串不能為空",
19
19
  nameConflict: "名稱與函數名稱衝突",
20
- defaultName: "DefinedName"
20
+ defaultName: "定義名稱"
21
21
  },
22
22
  permission: { dialog: {
23
23
  autoFillErr: "範圍已被保護,目前無自動填入權限。如需自動填充,請聯絡建立者。 ",
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "繼續合併將只保留左上角儲存格的值,捨棄其他值。您確定要繼續嗎?",
43
43
  cancel: "取消合併",
44
44
  confirm: "繼續合併",
45
- warning: "警告",
46
- dismantleMergeCellWarning: "這將導致一些合併儲存格被拆分。您要繼續嗎?"
45
+ warning: "警告"
47
46
  } }
48
47
  } };
49
48
 
@@ -17,7 +17,7 @@ const locale = { sheets: {
17
17
  nameSheetConflict: "名稱與工作表名稱衝突",
18
18
  formulaOrRefStringEmpty: "公式或引用字串不能為空",
19
19
  nameConflict: "名稱與函數名稱衝突",
20
- defaultName: "DefinedName"
20
+ defaultName: "定義名稱"
21
21
  },
22
22
  permission: { dialog: {
23
23
  autoFillErr: "範圍已被保護,目前無自動填入權限。如需自動填充,請聯絡建立者。 ",
@@ -42,8 +42,7 @@ const locale = { sheets: {
42
42
  title: "繼續合併將只保留左上角儲存格的值,捨棄其他值。您確定要繼續嗎?",
43
43
  cancel: "取消合併",
44
44
  confirm: "繼續合併",
45
- warning: "警告",
46
- dismantleMergeCellWarning: "這將導致一些合併儲存格被拆分。您要繼續嗎?"
45
+ warning: "警告"
47
46
  } }
48
47
  } };
49
48
 
@@ -13,8 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { CellValue, ICellData, Nullable, Styles } from '@univerjs/core';
16
+ import type { CellValue, ICellData, IDocumentData, Nullable, Styles } from '@univerjs/core';
17
17
  import { CellValueType } from '@univerjs/core';
18
+ export declare function isCellImage(documentData: Nullable<IDocumentData>): boolean;
18
19
  /**
19
20
  * Get cell value type by style, new value and old value.
20
21
  * If the new value contains t, then take t directly. In other cases, we need to dynamically determine based on actual data and styles
@@ -309,7 +309,7 @@ export declare class FWorksheet extends FBaseInitialable {
309
309
  getMaxRows(): number;
310
310
  /**
311
311
  * Inserts a row after the given row position.
312
- * @param {number} afterPosition - The row after which the new row should be added, starting at 0 for the first row.
312
+ * @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`.
313
313
  * @returns {FWorksheet} This sheet, for chaining.
314
314
  * @example
315
315
  * ```typescript
@@ -324,7 +324,7 @@ export declare class FWorksheet extends FBaseInitialable {
324
324
  insertRowAfter(afterPosition: number): FWorksheet;
325
325
  /**
326
326
  * Inserts a row before the given row position.
327
- * @param {number} beforePosition - The row before which the new row should be added, starting at 0 for the first row.
327
+ * @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`.
328
328
  * @returns {FWorksheet} This sheet, for chaining.
329
329
  * @example
330
330
  * ```typescript
@@ -339,8 +339,8 @@ export declare class FWorksheet extends FBaseInitialable {
339
339
  insertRowBefore(beforePosition: number): FWorksheet;
340
340
  /**
341
341
  * Inserts one or more consecutive blank rows in a sheet starting at the specified location.
342
- * @param {number} rowIndex - The index indicating where to insert a row, starting at 0 for the first row.
343
- * @param {number} numRows - The number of rows to insert.
342
+ * @param {number} rowIndex - The existing row before which rows are inserted. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
343
+ * @param {number} numRows - The positive number of rows to insert.
344
344
  * @returns {FWorksheet} This sheet, for chaining.
345
345
  * @example
346
346
  * ```typescript
@@ -355,8 +355,8 @@ export declare class FWorksheet extends FBaseInitialable {
355
355
  insertRows(rowIndex: number, numRows?: number): FWorksheet;
356
356
  /**
357
357
  * Inserts a number of rows after the given row position.
358
- * @param {number} afterPosition - The row after which the new rows should be added, starting at 0 for the first row.
359
- * @param {number} howMany - The number of rows to insert.
358
+ * @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`.
359
+ * @param {number} howMany - The positive number of rows to insert.
360
360
  * @returns {FWorksheet} This sheet, for chaining.
361
361
  * @example
362
362
  * ```typescript
@@ -371,8 +371,8 @@ export declare class FWorksheet extends FBaseInitialable {
371
371
  insertRowsAfter(afterPosition: number, howMany: number): FWorksheet;
372
372
  /**
373
373
  * Inserts a number of rows before the given row position.
374
- * @param {number} beforePosition - The row before which the new rows should be added, starting at 0 for the first row.
375
- * @param {number} howMany - The number of rows to insert.
374
+ * @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`.
375
+ * @param {number} howMany - The positive number of rows to insert.
376
376
  * @returns {FWorksheet} This sheet, for chaining.
377
377
  * @example
378
378
  * ```typescript
@@ -1525,7 +1525,8 @@ export declare class FWorksheet extends FBaseInitialable {
1525
1525
  */
1526
1526
  getColumnCustomMetadata(index: number): CustomData | undefined;
1527
1527
  /**
1528
- * Appends a row to the bottom of the current data region in the sheet. If a cell's content begins with =, it's interpreted as a formula.
1528
+ * Appends a row to the bottom of the current data region in the sheet. If the destination row is already within the worksheet capacity,
1529
+ * this method writes into that row without increasing `getMaxRows()`. If a cell's content begins with =, it's interpreted as a formula.
1529
1530
  * @param {CellValue[]} rowContents - An array of values for the new row.
1530
1531
  * @returns {FWorksheet} Returns the current worksheet instance for method chaining.
1531
1532
  * @example
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export type { ICellOverGridPosition, ISheetOverGridPosition } from './basics/cell-position';
17
- export { checkCellValueType } from './basics/cell-type';
17
+ export { checkCellValueType, isCellImage } from './basics/cell-type';
18
18
  export { COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, getSkeletonChangedEffectedRange, getValueChangedEffectedRange, SheetSkeletonChangeType, SheetValueChangeType, } from './basics/const/command-listener-const';
19
19
  export type { CommandListenerSkeletonChange, CommandListenerValueChange } from './basics/const/command-listener-const';
20
20
  export { validateDefinedName } from './basics/defined-name-utils';
@@ -61,7 +61,6 @@ declare const locale: {
61
61
  cancel: string;
62
62
  confirm: string;
63
63
  warning: string;
64
- dismantleMergeCellWarning: string;
65
64
  };
66
65
  };
67
66
  };
@@ -38,6 +38,8 @@ export declare class RefRangeService extends Disposable {
38
38
  MERGE_UNDO: import("@univerjs/core").IInterceptor<IMutationInfo<object>[], null>;
39
39
  }>;
40
40
  private _watchRanges;
41
+ private _watchRangesListener;
42
+ private _watchRangeRevision;
41
43
  constructor(_commandService: ICommandService, _sheetInterceptorService: SheetInterceptorService, _univerInstanceService: IUniverInstanceService, _selectionManagerService: SheetsSelectionsService);
42
44
  watchRange(unitId: string, subUnitId: string, range: IRange, callback: WatchRangeCallback, skipIntersects?: boolean): IDisposable;
43
45
  private _refRangeManagerMap;