@univerjs/sheets 1.0.0-rc.0 → 1.0.0

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 (54) hide show
  1. package/lib/cjs/facade.js +211 -110
  2. package/lib/cjs/index.js +350 -246
  3. package/lib/cjs/locale/ar-SA.js +0 -1
  4. package/lib/cjs/locale/ca-ES.js +0 -1
  5. package/lib/cjs/locale/de-DE.js +0 -1
  6. package/lib/cjs/locale/en-US.js +0 -1
  7. package/lib/cjs/locale/es-ES.js +0 -1
  8. package/lib/cjs/locale/fa-IR.js +0 -1
  9. package/lib/cjs/locale/fr-FR.js +0 -1
  10. package/lib/cjs/locale/id-ID.js +0 -1
  11. package/lib/cjs/locale/it-IT.js +0 -1
  12. package/lib/cjs/locale/ja-JP.js +0 -1
  13. package/lib/cjs/locale/ko-KR.js +0 -1
  14. package/lib/cjs/locale/pl-PL.js +0 -1
  15. package/lib/cjs/locale/pt-BR.js +0 -1
  16. package/lib/cjs/locale/ru-RU.js +0 -1
  17. package/lib/cjs/locale/sk-SK.js +0 -1
  18. package/lib/cjs/locale/vi-VN.js +0 -1
  19. package/lib/cjs/locale/zh-CN.js +0 -1
  20. package/lib/cjs/locale/zh-HK.js +0 -1
  21. package/lib/cjs/locale/zh-TW.js +0 -1
  22. package/lib/es/facade.js +212 -111
  23. package/lib/es/index.js +351 -248
  24. package/lib/facade.js +212 -111
  25. package/lib/index.js +351 -248
  26. package/lib/types/commands/commands/set-worksheet-hide.command.d.ts +4 -0
  27. package/lib/types/commands/mutations/set-range-values.mutation.d.ts +12 -1
  28. package/lib/types/commands/mutations/set-worksheet-hide.mutation.d.ts +2 -1
  29. package/lib/types/controllers/calculate-result-apply.controller.d.ts +1 -1
  30. package/lib/types/facade/f-defined-name.d.ts +2 -2
  31. package/lib/types/facade/f-range.d.ts +118 -45
  32. package/lib/types/facade/f-selection.d.ts +1 -1
  33. package/lib/types/facade/f-sheet-hooks.d.ts +24 -0
  34. package/lib/types/facade/f-univer.d.ts +4 -5
  35. package/lib/types/facade/f-workbook.d.ts +8 -13
  36. package/lib/types/facade/f-worksheet.d.ts +43 -28
  37. package/lib/types/facade/permission/f-range-permission.d.ts +1 -1
  38. package/lib/types/facade/permission/f-range-protection-rule.d.ts +2 -2
  39. package/lib/types/facade/permission/f-workbook-permission.d.ts +3 -3
  40. package/lib/types/facade/permission/f-worksheet-permission.d.ts +5 -4
  41. package/lib/types/facade/utils.d.ts +1 -0
  42. package/lib/types/index.d.ts +1 -1
  43. package/lib/types/model/range-protection-render.model.d.ts +33 -0
  44. package/lib/types/model/range-protection-rule.model.d.ts +75 -0
  45. package/lib/types/model/range-protection.cache.d.ts +55 -0
  46. package/lib/types/model/range-theme-model.d.ts +102 -0
  47. package/lib/types/model/range-theme-util.d.ts +113 -0
  48. package/lib/types/model/range-themes/build-in-theme.factory.d.ts +20 -0
  49. package/lib/types/model/range-themes/default.d.ts +18 -0
  50. package/lib/types/model/zebra-crossing-cache.d.ts +57 -0
  51. package/lib/types/services/auto-fill/tools.d.ts +2 -0
  52. package/lib/umd/facade.js +1 -1
  53. package/lib/umd/index.js +2 -2
  54. package/package.json +9 -9
package/lib/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AUTO_HEIGHT_FOR_MERGED_CELLS, BORDER_KEYS, BORDER_STYLE_KEYS, BooleanNumber, BorderStyleTypes, BorderType, BuildTextUtils, COLOR_STYLE_KEYS, CellModeEnum, CellValueType, CommandType, CustomCommandExecutionError, DependentOn, Dimension, Direction, Disposable, DisposableCollection, DocumentDataModel, ErrorService, FontItalic, FontWeight, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, ILogService, IPermissionService, IResourceManagerService, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, InterceptorManager, LRUMap, LocaleService, MAX_COLUMN_COUNT, MAX_ROW_COUNT, ObjectMatrix, Optional, PADDING_KEYS, PermissionStatus, Plugin, RANGE_TYPE, RTree, Range, Rectangle, RxDisposable, STYLE_KEYS, TEXT_DECORATION_KEYS, TEXT_ROTATION_KEYS, TextX, Tools, UniverInstanceType, UserManagerService, cellToRange, cloneWorksheetData, composeInterceptors, concatMatrixArray, createIdentifier, createInterceptorKey, createRowColIter, generateRandomId, getArrayLength, getIntersectRange, getNumfmtLocaleTag, getNumfmtParseValueFilter, isBooleanString, isDefaultFormat, isFormulaId, isFormulaString, isICellData, isRealNum, isSafeNumeric, isTextFormat, mapObjectMatrix, merge, mergeIntervals, mergeOverrideWithDependencies, mergeWorksheetSnapshotWithDefault, moveMatrixArray, normalizeTextRuns, numfmt, regexp, registerDependencies, remove, selectionToArray, sequenceExecute, sliceMatrixArray, spliceArray, throttle, toDisposable, touchDependencies, willLoseNumericPrecision } from "@univerjs/core";
1
+ import { AUTO_HEIGHT_FOR_MERGED_CELLS, BORDER_KEYS, BORDER_STYLE_KEYS, BooleanNumber, BorderStyleTypes, BorderType, BuildTextUtils, COLOR_STYLE_KEYS, CellModeEnum, CellValueType, CommandType, CustomCommandExecutionError, DependentOn, Dimension, Direction, Disposable, DisposableCollection, DocumentDataModel, ErrorService, FontItalic, FontWeight, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, ILogService, IPermissionService, IResourceManagerService, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, InterceptorManager, LRUMap, LocaleService, MAX_COLUMN_COUNT, MAX_ROW_COUNT, ObjectMatrix, Optional, PADDING_KEYS, PermissionStatus, Plugin, RANGE_TYPE, RTree, Range, Rectangle, RxDisposable, STYLE_KEYS, Styles, TEXT_DECORATION_KEYS, TEXT_ROTATION_KEYS, TextX, Tools, UniverInstanceType, UserManagerService, WorksheetHiddenState, cellToRange, cloneWorksheetData, composeInterceptors, concatMatrixArray, createIdentifier, createInterceptorKey, createRowColIter, generateRandomId, getArrayLength, getIntersectRange, getNumfmtLocaleTag, getNumfmtParseValueFilter, isBooleanString, isDefaultFormat, isFormulaId, isFormulaString, isICellData, isRealNum, isSafeNumeric, isTextFormat, mapObjectMatrix, merge, mergeIntervals, mergeOverrideWithDependencies, mergeWorksheetSnapshotWithDefault, moveMatrixArray, normalizeTextRuns, numfmt, regexp, registerDependencies, remove, selectionToArray, sequenceExecute, sliceMatrixArray, spliceArray, throttle, toDisposable, touchDependencies, willLoseNumericPrecision } from "@univerjs/core";
2
2
  import { BehaviorSubject, Subject, distinctUntilChanged, filter, map, merge as merge$1, of, share, shareReplay, skip, switchMap, take, takeUntil } from "rxjs";
3
3
  import { IDefinedNamesService, LexerTreeBuilder, RemoveDefinedNameMutation, SetDefinedNameMutation, SetDefinedNameMutationFactory, SetFormulaCalculationResultMutation, UniverFormulaEnginePlugin, deserializeRangeWithSheet, deserializeRangeWithSheetWithCache, handleNumfmtInCell, isReferenceStringWithEffectiveColumn, operatorToken, sequenceNodeType, stripErrorMargin } from "@univerjs/engine-formula";
4
4
  import { SpreadsheetSkeleton, cjk, precisionTo } from "@univerjs/engine-render";
@@ -118,6 +118,8 @@ function extractBooleanValue(value) {
118
118
  function setNull(value) {
119
119
  if (value == null) return null;
120
120
  if (value.f === void 0) value.f = null;
121
+ if (value.ft === void 0) value.ft = null;
122
+ if (value.fd === void 0) value.fd = null;
121
123
  if (value.si === void 0) value.si = null;
122
124
  if (value.p === void 0) value.p = null;
123
125
  if (value.v === void 0) value.v = null;
@@ -216,7 +218,7 @@ const RangeThemeInterceptorId = "sheet.interceptor.range-theme-id";
216
218
  const IgnoreRangeThemeInterceptorKey = "sheet.interceptor.ignore-range-theme";
217
219
 
218
220
  //#endregion
219
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
221
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/typeof.js
220
222
  function _typeof(o) {
221
223
  "@babel/helpers - typeof";
222
224
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -227,7 +229,7 @@ function _typeof(o) {
227
229
  }
228
230
 
229
231
  //#endregion
230
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
232
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPrimitive.js
231
233
  function toPrimitive(t, r) {
232
234
  if ("object" != _typeof(t) || !t) return t;
233
235
  var e = t[Symbol.toPrimitive];
@@ -240,14 +242,14 @@ function toPrimitive(t, r) {
240
242
  }
241
243
 
242
244
  //#endregion
243
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
245
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPropertyKey.js
244
246
  function toPropertyKey(t) {
245
247
  var i = toPrimitive(t, "string");
246
248
  return "symbol" == _typeof(i) ? i : i + "";
247
249
  }
248
250
 
249
251
  //#endregion
250
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
252
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/defineProperty.js
251
253
  function _defineProperty(e, r, t) {
252
254
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
253
255
  value: t,
@@ -258,7 +260,7 @@ function _defineProperty(e, r, t) {
258
260
  }
259
261
 
260
262
  //#endregion
261
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
263
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorateParam.js
262
264
  function __decorateParam(paramIndex, decorator) {
263
265
  return function(target, key) {
264
266
  decorator(target, key, paramIndex);
@@ -266,7 +268,7 @@ function __decorateParam(paramIndex, decorator) {
266
268
  }
267
269
 
268
270
  //#endregion
269
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
271
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorate.js
270
272
  function __decorate(decorators, target, key, desc) {
271
273
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
272
274
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1709,7 +1711,8 @@ const MoveRowsMutation = {
1709
1711
  const fromRow = sourceRange.startRow;
1710
1712
  const count = sourceRange.endRow - sourceRange.startRow + 1;
1711
1713
  const toRow = targetRange.startRow;
1712
- moveMatrixArray(fromRow, count, toRow, worksheet.getRowManager().getRowData());
1714
+ const rowWrapper = worksheet.getRowManager().getRowData();
1715
+ moveMatrixArray(fromRow, count, toRow, rowWrapper);
1713
1716
  worksheet.getCellMatrix().moveRows(fromRow, count, toRow);
1714
1717
  return true;
1715
1718
  }
@@ -1751,7 +1754,8 @@ const MoveColsMutation = {
1751
1754
  const fromCol = sourceRange.startColumn;
1752
1755
  const count = sourceRange.endColumn - sourceRange.startColumn + 1;
1753
1756
  const toCol = targetRange.startColumn;
1754
- moveMatrixArray(fromCol, count, toCol, worksheet.getColumnManager().getColumnData());
1757
+ const columnWrapper = worksheet.getColumnManager().getColumnData();
1758
+ moveMatrixArray(fromCol, count, toCol, columnWrapper);
1755
1759
  worksheet.getCellMatrix().moveColumns(fromCol, count, toCol);
1756
1760
  return true;
1757
1761
  }
@@ -1763,7 +1767,8 @@ const RemoveRowsUndoMutationFactory = (params, worksheet) => {
1763
1767
  const rowWrapper = worksheet.getRowManager().getRowData();
1764
1768
  const rowInfo = {};
1765
1769
  const range = params.range;
1766
- const _rowInfo = concatMatrixArray(rowInfo, sliceMatrixArray(range.startRow, range.endRow, rowWrapper));
1770
+ const slice = sliceMatrixArray(range.startRow, range.endRow, rowWrapper);
1771
+ const _rowInfo = concatMatrixArray(rowInfo, slice);
1767
1772
  return {
1768
1773
  unitId: params.unitId,
1769
1774
  subUnitId: params.subUnitId,
@@ -1798,7 +1803,8 @@ const RemoveColMutationFactory = (accessor, params) => {
1798
1803
  const columnWrapper = worksheet.getColumnManager().getColumnData();
1799
1804
  const colInfo = {};
1800
1805
  const range = params.range;
1801
- const _colInfo = concatMatrixArray(colInfo, sliceMatrixArray(range.startColumn, range.endColumn, columnWrapper));
1806
+ const slice = sliceMatrixArray(range.startColumn, range.endColumn, columnWrapper);
1807
+ const _colInfo = concatMatrixArray(colInfo, slice);
1802
1808
  return {
1803
1809
  unitId: params.unitId,
1804
1810
  subUnitId: params.subUnitId,
@@ -1945,7 +1951,8 @@ const SetColDataMutationFactory = (params, worksheet) => {
1945
1951
  const manager = worksheet.getColumnManager();
1946
1952
  for (const colIndex in columnData) {
1947
1953
  const newCol = columnData[colIndex];
1948
- oldColData[colIndex] = getOldColumnData(manager.getColumn(Number(colIndex)), newCol);
1954
+ const currentCol = manager.getColumn(Number(colIndex));
1955
+ oldColData[colIndex] = getOldColumnData(currentCol, newCol);
1949
1956
  }
1950
1957
  return {
1951
1958
  unitId,
@@ -1958,7 +1965,8 @@ const SetColDataMutation = {
1958
1965
  type: CommandType.MUTATION,
1959
1966
  handler: (accessor, params) => {
1960
1967
  const { columnData } = params;
1961
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
1968
+ const univerInstanceService = accessor.get(IUniverInstanceService);
1969
+ const target = getSheetCommandTarget(univerInstanceService, params);
1962
1970
  if (!target) return false;
1963
1971
  const { worksheet } = target;
1964
1972
  const manager = worksheet.getColumnManager();
@@ -2302,6 +2310,34 @@ function mergeRichTextStyle(p, newStyle) {
2302
2310
  //#endregion
2303
2311
  //#region src/commands/mutations/set-range-values.mutation.ts
2304
2312
  /**
2313
+ * Read-only native value preparation for caller-owned atomic model staging. The resulting style IDs
2314
+ * must travel with the prepared cells; replay installs them and must not allocate replacement IDs.
2315
+ * This does not execute handlers, publish notifications, or own style garbage collection.
2316
+ */
2317
+ function prepareSetRangeValuesMutation(cells, styles, params) {
2318
+ const detachedStyles = new Styles(Tools.deepClone(styles.toJSON()));
2319
+ const before = new ObjectMatrix();
2320
+ const after = new ObjectMatrix();
2321
+ new ObjectMatrix(Tools.deepClone(params.cellValue)).forValue((row, column, value) => {
2322
+ const original = Tools.deepClone(cells.getValue(row, column) ?? null);
2323
+ before.setValue(row, column, original);
2324
+ const next = value ? mergeCellData(value, Tools.deepClone(original ?? {}), detachedStyles, !!params.isOverrideStyle) : null;
2325
+ after.setValue(row, column, next && !Tools.isEmptyObject(next) ? next : null);
2326
+ });
2327
+ const addedStyles = {};
2328
+ for (const [id, style] of Object.entries(detachedStyles.toJSON())) {
2329
+ if (!style) continue;
2330
+ const current = styles.get(id);
2331
+ if (current && !Tools.diffValue(current, style)) throw new TypeError("Prepared style ID collides with an existing style.");
2332
+ if (!current) addedStyles[id] = Tools.deepClone(style);
2333
+ }
2334
+ return {
2335
+ before: before.getMatrix(),
2336
+ after: after.getMatrix(),
2337
+ styles: addedStyles
2338
+ };
2339
+ }
2340
+ /**
2305
2341
  * Generate undo mutation of a `SetRangeValuesMutation`
2306
2342
  *
2307
2343
  * @param {IAccessor} accessor - injector accessor
@@ -2358,7 +2394,9 @@ const overwriteCellPropertiesSet = /* @__PURE__ */ new Set([
2358
2394
  "si",
2359
2395
  "custom",
2360
2396
  "ref",
2361
- "xf"
2397
+ "xf",
2398
+ "ft",
2399
+ "fd"
2362
2400
  ]);
2363
2401
  function mergeCellData(newValue, oldValue, styles, isOverrideStyle = false) {
2364
2402
  const type = getCellType(styles, newValue, oldValue);
@@ -2369,9 +2407,15 @@ function mergeCellData(newValue, oldValue, styles, isOverrideStyle = false) {
2369
2407
  updateCellProperty(oldValue, cellPropertyKey, propertyValue);
2370
2408
  } else if (cellPropertyKey === "v") {
2371
2409
  if (newValue.v !== void 0) oldValue.v = getCellValue(type, newValue);
2372
- } else if (cellPropertyKey === "s") if (isOverrideStyle) overrideStyle(styles, oldValue, newValue);
2373
- else handleStyle(styles, oldValue, newValue);
2410
+ } else if (cellPropertyKey === "s") {
2411
+ if (isOverrideStyle) overrideStyle(styles, oldValue, newValue);
2412
+ else handleStyle(styles, oldValue, newValue);
2413
+ }
2374
2414
  });
2415
+ if ((newValue.f === null || newValue.f === "") && !isFormulaId(newValue.si)) {
2416
+ delete oldValue.ft;
2417
+ delete oldValue.fd;
2418
+ }
2375
2419
  if (oldValue.v !== void 0) {
2376
2420
  oldValue.t = type;
2377
2421
  oldValue.v = getCellValue(type, oldValue);
@@ -2407,7 +2451,8 @@ const SetRowDataMutationFactory = (params, worksheet) => {
2407
2451
  const manager = worksheet.getRowManager();
2408
2452
  for (const rowIndex in rowData) {
2409
2453
  const newRow = rowData[rowIndex];
2410
- oldRowData[rowIndex] = getOldRowData(manager.getRow(Number(rowIndex)), newRow);
2454
+ const currentRow = manager.getRow(Number(rowIndex));
2455
+ oldRowData[rowIndex] = getOldRowData(currentRow, newRow);
2411
2456
  }
2412
2457
  return {
2413
2458
  unitId,
@@ -2420,7 +2465,8 @@ const SetRowDataMutation = {
2420
2465
  type: CommandType.MUTATION,
2421
2466
  handler: (accessor, params) => {
2422
2467
  const { rowData } = params;
2423
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
2468
+ const univerInstanceService = accessor.get(IUniverInstanceService);
2469
+ const target = getSheetCommandTarget(univerInstanceService, params);
2424
2470
  if (!target) return false;
2425
2471
  const { worksheet } = target;
2426
2472
  const manager = worksheet.getRowManager();
@@ -2520,7 +2566,8 @@ const SetWorksheetColWidthMutation = {
2520
2566
  id: "sheet.mutation.set-worksheet-col-width",
2521
2567
  type: CommandType.MUTATION,
2522
2568
  handler: (accessor, params) => {
2523
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
2569
+ const univerInstanceService = accessor.get(IUniverInstanceService);
2570
+ const target = getSheetCommandTarget(univerInstanceService, params);
2524
2571
  if (!target) return false;
2525
2572
  const { worksheet } = target;
2526
2573
  const manager = worksheet.getColumnManager();
@@ -2552,7 +2599,8 @@ const SetWorksheetColumnCountMutation = {
2552
2599
  id: "sheet.mutation.set-worksheet-column-count",
2553
2600
  type: CommandType.MUTATION,
2554
2601
  handler: (accessor, params) => {
2555
- const target = getSheetMutationTarget(accessor.get(IUniverInstanceService), params);
2602
+ const univerInstanceService = accessor.get(IUniverInstanceService);
2603
+ const target = getSheetMutationTarget(univerInstanceService, params);
2556
2604
  if (!target) return false;
2557
2605
  target.worksheet.setColumnCount(params.columnCount);
2558
2606
  return true;
@@ -2599,7 +2647,8 @@ const SetWorksheetRowCountMutation = {
2599
2647
  id: "sheet.mutation.set-worksheet-row-count",
2600
2648
  type: CommandType.MUTATION,
2601
2649
  handler: (accessor, params) => {
2602
- const target = getSheetMutationTarget(accessor.get(IUniverInstanceService), params);
2650
+ const univerInstanceService = accessor.get(IUniverInstanceService);
2651
+ const target = getSheetMutationTarget(univerInstanceService, params);
2603
2652
  if (!target) return false;
2604
2653
  target.worksheet.setRowCount(params.rowCount);
2605
2654
  return true;
@@ -2661,7 +2710,8 @@ const SetWorksheetRowHeightMutation = {
2661
2710
  type: CommandType.MUTATION,
2662
2711
  handler: (accessor, params) => {
2663
2712
  const { ranges, rowHeight } = params;
2664
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
2713
+ const univerInstanceService = accessor.get(IUniverInstanceService);
2714
+ const target = getSheetCommandTarget(univerInstanceService, params);
2665
2715
  if (!target) return false;
2666
2716
  const { worksheet } = target;
2667
2717
  const manager = worksheet.getRowManager();
@@ -2675,7 +2725,8 @@ const SetWorksheetRowIsAutoHeightMutation = {
2675
2725
  type: CommandType.MUTATION,
2676
2726
  handler: (accessor, params) => {
2677
2727
  const { ranges, autoHeightInfo } = params;
2678
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
2728
+ const univerInstanceService = accessor.get(IUniverInstanceService);
2729
+ const target = getSheetCommandTarget(univerInstanceService, params);
2679
2730
  if (!target) return false;
2680
2731
  const manager = target.worksheet.getRowManager();
2681
2732
  for (const { startRow, endRow } of ranges) for (let rowIndex = startRow; rowIndex <= endRow; rowIndex++) {
@@ -2691,7 +2742,8 @@ const SetWorksheetRowAutoHeightMutation = {
2691
2742
  type: CommandType.MUTATION,
2692
2743
  handler: (accessor, params) => {
2693
2744
  const { rowsAutoHeightInfo } = params;
2694
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
2745
+ const univerInstanceService = accessor.get(IUniverInstanceService);
2746
+ const target = getSheetCommandTarget(univerInstanceService, params);
2695
2747
  if (!target) return false;
2696
2748
  const rowManager = target.worksheet.getRowManager();
2697
2749
  for (const { row, autoHeight } of rowsAutoHeightInfo) {
@@ -3125,18 +3177,20 @@ function getExpandedRangeLeft(range, allMatrixWithSpan, leftOffset, isWorksheetH
3125
3177
  const cell = allMatrixWithSpan.getValue(i, startColumn - leftOffset);
3126
3178
  hasValue = hasValue || hasValueFromMatrixWithSpanInfo(cell, allMatrixWithSpan);
3127
3179
  if (!isWorksheetHasSpan && hasValue) break;
3128
- if (cell && cell.spanAnchor) if (!spanAnchor) spanAnchor = {
3129
- startRow: cell.spanAnchor.startRow,
3130
- startColumn: cell.spanAnchor.startColumn,
3131
- endRow: cell.spanAnchor.endRow,
3132
- endColumn: cell.spanAnchor.endColumn
3133
- };
3134
- else spanAnchor = {
3135
- startRow: Math.min(cell.spanAnchor.startRow, spanAnchor.startRow),
3136
- startColumn: Math.min(cell.spanAnchor.startColumn, spanAnchor.startColumn),
3137
- endRow: Math.max(cell.spanAnchor.endRow, spanAnchor.endRow),
3138
- endColumn: Math.max(cell.spanAnchor.endColumn, spanAnchor.endColumn)
3139
- };
3180
+ if (cell && cell.spanAnchor) {
3181
+ if (!spanAnchor) spanAnchor = {
3182
+ startRow: cell.spanAnchor.startRow,
3183
+ startColumn: cell.spanAnchor.startColumn,
3184
+ endRow: cell.spanAnchor.endRow,
3185
+ endColumn: cell.spanAnchor.endColumn
3186
+ };
3187
+ else spanAnchor = {
3188
+ startRow: Math.min(cell.spanAnchor.startRow, spanAnchor.startRow),
3189
+ startColumn: Math.min(cell.spanAnchor.startColumn, spanAnchor.startColumn),
3190
+ endRow: Math.max(cell.spanAnchor.endRow, spanAnchor.endRow),
3191
+ endColumn: Math.max(cell.spanAnchor.endColumn, spanAnchor.endColumn)
3192
+ };
3193
+ }
3140
3194
  }
3141
3195
  if (hasValue) {
3142
3196
  range.startColumn = range.startColumn - leftOffset;
@@ -3165,18 +3219,20 @@ function getExpandedRangeRight(range, allMatrixWithSpan, rightOffset, isWorkshee
3165
3219
  const cell = allMatrixWithSpan.getValue(i, endColumn + rightOffset);
3166
3220
  hasValue = hasValue || hasValueFromMatrixWithSpanInfo(cell, allMatrixWithSpan);
3167
3221
  if (!isWorksheetHasSpan && hasValue) break;
3168
- if (cell && cell.spanAnchor) if (!spanAnchor) spanAnchor = {
3169
- startRow: cell.spanAnchor.startRow,
3170
- startColumn: cell.spanAnchor.startColumn,
3171
- endRow: cell.spanAnchor.endRow,
3172
- endColumn: cell.spanAnchor.endColumn
3173
- };
3174
- else spanAnchor = {
3175
- startRow: Math.min(cell.spanAnchor.startRow, spanAnchor.startRow),
3176
- startColumn: Math.min(cell.spanAnchor.startColumn, spanAnchor.startColumn),
3177
- endRow: Math.max(cell.spanAnchor.endRow, spanAnchor.endRow),
3178
- endColumn: Math.max(cell.spanAnchor.endColumn, spanAnchor.endColumn)
3179
- };
3222
+ if (cell && cell.spanAnchor) {
3223
+ if (!spanAnchor) spanAnchor = {
3224
+ startRow: cell.spanAnchor.startRow,
3225
+ startColumn: cell.spanAnchor.startColumn,
3226
+ endRow: cell.spanAnchor.endRow,
3227
+ endColumn: cell.spanAnchor.endColumn
3228
+ };
3229
+ else spanAnchor = {
3230
+ startRow: Math.min(cell.spanAnchor.startRow, spanAnchor.startRow),
3231
+ startColumn: Math.min(cell.spanAnchor.startColumn, spanAnchor.startColumn),
3232
+ endRow: Math.max(cell.spanAnchor.endRow, spanAnchor.endRow),
3233
+ endColumn: Math.max(cell.spanAnchor.endColumn, spanAnchor.endColumn)
3234
+ };
3235
+ }
3180
3236
  }
3181
3237
  if (hasValue) {
3182
3238
  range.endColumn = range.endColumn + rightOffset;
@@ -3205,18 +3261,20 @@ function getExpandedRangeUp(range, allMatrixWithSpan, upOffset, isWorksheetHasSp
3205
3261
  const cell = allMatrixWithSpan.getValue(startRow - upOffset, i);
3206
3262
  hasValue = hasValue || hasValueFromMatrixWithSpanInfo(cell, allMatrixWithSpan);
3207
3263
  if (!isWorksheetHasSpan && hasValue) break;
3208
- if (cell && cell.spanAnchor) if (!spanAnchor) spanAnchor = {
3209
- startRow: cell.spanAnchor.startRow,
3210
- startColumn: cell.spanAnchor.startColumn,
3211
- endRow: cell.spanAnchor.endRow,
3212
- endColumn: cell.spanAnchor.endColumn
3213
- };
3214
- else spanAnchor = {
3215
- startRow: Math.min(cell.spanAnchor.startRow, spanAnchor.startRow),
3216
- startColumn: Math.min(cell.spanAnchor.startColumn, spanAnchor.startColumn),
3217
- endRow: Math.max(cell.spanAnchor.endRow, spanAnchor.endRow),
3218
- endColumn: Math.max(cell.spanAnchor.endColumn, spanAnchor.endColumn)
3219
- };
3264
+ if (cell && cell.spanAnchor) {
3265
+ if (!spanAnchor) spanAnchor = {
3266
+ startRow: cell.spanAnchor.startRow,
3267
+ startColumn: cell.spanAnchor.startColumn,
3268
+ endRow: cell.spanAnchor.endRow,
3269
+ endColumn: cell.spanAnchor.endColumn
3270
+ };
3271
+ else spanAnchor = {
3272
+ startRow: Math.min(cell.spanAnchor.startRow, spanAnchor.startRow),
3273
+ startColumn: Math.min(cell.spanAnchor.startColumn, spanAnchor.startColumn),
3274
+ endRow: Math.max(cell.spanAnchor.endRow, spanAnchor.endRow),
3275
+ endColumn: Math.max(cell.spanAnchor.endColumn, spanAnchor.endColumn)
3276
+ };
3277
+ }
3220
3278
  }
3221
3279
  if (hasValue) {
3222
3280
  range.startRow = range.startRow - upOffset;
@@ -3245,18 +3303,20 @@ function getExpandedRangeDown(range, allMatrixWithSpan, downOffset, isWorksheetH
3245
3303
  const cell = allMatrixWithSpan.getValue(endRow + downOffset, i);
3246
3304
  hasValue = hasValue || hasValueFromMatrixWithSpanInfo(cell, allMatrixWithSpan);
3247
3305
  if (!isWorksheetHasSpan && hasValue) break;
3248
- if (cell && cell.spanAnchor) if (!spanAnchor) spanAnchor = {
3249
- startRow: cell.spanAnchor.startRow,
3250
- startColumn: cell.spanAnchor.startColumn,
3251
- endRow: cell.spanAnchor.endRow,
3252
- endColumn: cell.spanAnchor.endColumn
3253
- };
3254
- else spanAnchor = {
3255
- startRow: Math.min(cell.spanAnchor.startRow, spanAnchor.startRow),
3256
- startColumn: Math.min(cell.spanAnchor.startColumn, spanAnchor.startColumn),
3257
- endRow: Math.max(cell.spanAnchor.endRow, spanAnchor.endRow),
3258
- endColumn: Math.max(cell.spanAnchor.endColumn, spanAnchor.endColumn)
3259
- };
3306
+ if (cell && cell.spanAnchor) {
3307
+ if (!spanAnchor) spanAnchor = {
3308
+ startRow: cell.spanAnchor.startRow,
3309
+ startColumn: cell.spanAnchor.startColumn,
3310
+ endRow: cell.spanAnchor.endRow,
3311
+ endColumn: cell.spanAnchor.endColumn
3312
+ };
3313
+ else spanAnchor = {
3314
+ startRow: Math.min(cell.spanAnchor.startRow, spanAnchor.startRow),
3315
+ startColumn: Math.min(cell.spanAnchor.startColumn, spanAnchor.startColumn),
3316
+ endRow: Math.max(cell.spanAnchor.endRow, spanAnchor.endRow),
3317
+ endColumn: Math.max(cell.spanAnchor.endColumn, spanAnchor.endColumn)
3318
+ };
3319
+ }
3260
3320
  }
3261
3321
  if (hasValue) {
3262
3322
  range.endRow = range.endRow + downOffset;
@@ -3637,10 +3697,7 @@ var DelimiterCounter = class {
3637
3697
  case ";":
3638
3698
  this._semicolonCount++;
3639
3699
  break;
3640
- case " ":
3641
- this._spaceCount++;
3642
- break;
3643
- default: break;
3700
+ case " ": this._spaceCount++;
3644
3701
  }
3645
3702
  }
3646
3703
  update(cellText) {
@@ -3874,7 +3931,7 @@ function deserializeListOptions(optionsStr) {
3874
3931
  const options = JSON.parse(optionsStr);
3875
3932
  if (Array.isArray(options) && options.every((option) => typeof option === "string")) return options.filter(Boolean);
3876
3933
  } catch {}
3877
- return optionsStr.split(",").filter(Boolean);
3934
+ return optionsStr.split(",").map((option) => option.trim()).filter(Boolean);
3878
3935
  }
3879
3936
 
3880
3937
  //#endregion
@@ -4204,9 +4261,7 @@ var WorkbookSelectionModel = class extends Disposable {
4204
4261
  case 3:
4205
4262
  this._selectionSet$.next(selectionDatas);
4206
4263
  break;
4207
- default:
4208
- this._selectionSet$.next(selectionDatas);
4209
- break;
4264
+ default: this._selectionSet$.next(selectionDatas);
4210
4265
  }
4211
4266
  }
4212
4267
  getCurrentSelections() {
@@ -4677,10 +4732,11 @@ const ClearSelectionAllCommand = {
4677
4732
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
4678
4733
  const redoMutations = [];
4679
4734
  const undoMutations = [];
4735
+ const visibleRanges = getVisibleRanges(ranges, accessor, unitId, subUnitId);
4680
4736
  const clearMutationParams = {
4681
4737
  subUnitId,
4682
4738
  unitId,
4683
- cellValue: generateNullCell(getVisibleRanges(ranges, accessor, unitId, subUnitId))
4739
+ cellValue: generateNullCell(visibleRanges)
4684
4740
  };
4685
4741
  const undoClearMutationParams = SetRangeValuesUndoMutationFactory(accessor, clearMutationParams);
4686
4742
  redoMutations.push({
@@ -4747,10 +4803,11 @@ const ClearSelectionFormatCommand = {
4747
4803
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
4748
4804
  const redoMutations = [];
4749
4805
  const undoMutations = [];
4806
+ const visibleRanges = getVisibleRanges(ranges, accessor, unitId, subUnitId);
4750
4807
  const clearMutationParams = {
4751
4808
  subUnitId,
4752
4809
  unitId,
4753
- cellValue: generateNullCellStyle(getVisibleRanges(ranges, accessor, unitId, subUnitId))
4810
+ cellValue: generateNullCellStyle(visibleRanges)
4754
4811
  };
4755
4812
  const undoClearMutationParams = SetRangeValuesUndoMutationFactory(accessor, clearMutationParams);
4756
4813
  redoMutations.push({
@@ -5298,6 +5355,13 @@ const SetRangeValuesCommand = {
5298
5355
  subUnitId,
5299
5356
  cellValue: Tools.deepClone(realCellValue ?? cellValue.getMatrix())
5300
5357
  };
5358
+ new ObjectMatrix(setRangeValuesMutationRedoParams.cellValue).forValue((row, col, cell) => {
5359
+ var _worksheet$getCell;
5360
+ if ((cell === null || cell === void 0 ? void 0 : cell.f) !== void 0 && cell.f !== ((_worksheet$getCell = worksheet.getCell(row, col)) === null || _worksheet$getCell === void 0 ? void 0 : _worksheet$getCell.f)) {
5361
+ cell.ft ??= null;
5362
+ cell.fd ??= null;
5363
+ }
5364
+ });
5301
5365
  const setRangeValuesMutationUndoParams = SetRangeValuesUndoMutationFactory(accessor, setRangeValuesMutationRedoParams);
5302
5366
  const cellHeights = mapObjectMatrix(setRangeValuesMutationRedoParams.cellValue, (row, col) => worksheet.getCellHeight(row, col) || void 0);
5303
5367
  if (!commandService.syncExecuteCommand(SetRangeValuesMutation.id, setRangeValuesMutationRedoParams)) return false;
@@ -5766,13 +5830,14 @@ const InsertRangeMoveDownCommand = {
5766
5830
  if (!cellValue[row]) cellValue[row] = {};
5767
5831
  cellValue[row][col] = { s: cell.s };
5768
5832
  });
5769
- const { redo: insertRangeRedo, undo: insertRangeUndo } = getInsertRangeMutations(accessor, {
5833
+ const insertRangeMutationParams = {
5770
5834
  range,
5771
5835
  subUnitId,
5772
5836
  unitId,
5773
5837
  shiftDimension: Dimension.ROWS,
5774
5838
  cellValue
5775
- });
5839
+ };
5840
+ const { redo: insertRangeRedo, undo: insertRangeUndo } = getInsertRangeMutations(accessor, insertRangeMutationParams);
5776
5841
  redoMutations.push(...insertRangeRedo);
5777
5842
  undoMutations.push(...insertRangeUndo);
5778
5843
  const sheetInterceptor = sheetInterceptorService.onCommandExecute({
@@ -5873,13 +5938,14 @@ const InsertRangeMoveRightCommand = {
5873
5938
  if (!cellValue[row]) cellValue[row] = {};
5874
5939
  cellValue[row][col] = { s: cell.s };
5875
5940
  });
5876
- const { redo: insertRangeRedo, undo: insertRangeUndo } = getInsertRangeMutations(accessor, {
5941
+ const insertRangeMutationParams = {
5877
5942
  range,
5878
5943
  subUnitId,
5879
5944
  unitId,
5880
5945
  shiftDimension: Dimension.COLUMNS,
5881
5946
  cellValue
5882
- });
5947
+ };
5948
+ const { redo: insertRangeRedo, undo: insertRangeUndo } = getInsertRangeMutations(accessor, insertRangeMutationParams);
5883
5949
  redoMutations.push(...insertRangeRedo);
5884
5950
  undoMutations.push(...insertRangeUndo);
5885
5951
  const sheetInterceptor = sheetInterceptorService.onCommandExecute({
@@ -6016,7 +6082,8 @@ const InsertRowBeforeCommand = {
6016
6082
  let range;
6017
6083
  if ((selections === null || selections === void 0 ? void 0 : selections.length) === 1) range = selections[0];
6018
6084
  else return false;
6019
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
6085
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6086
+ const target = getSheetCommandTarget(univerInstanceService);
6020
6087
  if (!target) return false;
6021
6088
  const { worksheet, subUnitId, unitId } = target;
6022
6089
  const count = params.value || 0;
@@ -6048,7 +6115,8 @@ const InsertRowAfterCommand = {
6048
6115
  let range;
6049
6116
  if ((selections === null || selections === void 0 ? void 0 : selections.length) === 1) range = selections[0];
6050
6117
  else return false;
6051
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
6118
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6119
+ const target = getSheetCommandTarget(univerInstanceService);
6052
6120
  if (!target) return false;
6053
6121
  const { worksheet, unitId, subUnitId } = target;
6054
6122
  const count = range.endRow - range.startRow + 1;
@@ -6081,7 +6149,8 @@ const InsertMultiRowsAboveCommand = {
6081
6149
  let range;
6082
6150
  if ((selections === null || selections === void 0 ? void 0 : selections.length) === 1) range = selections[0];
6083
6151
  else return false;
6084
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
6152
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6153
+ const target = getSheetCommandTarget(univerInstanceService);
6085
6154
  if (!target) return false;
6086
6155
  const { worksheet, unitId, subUnitId } = target;
6087
6156
  const count = params.value || 0;
@@ -6115,7 +6184,8 @@ const InsertMultiRowsAfterCommand = {
6115
6184
  let range;
6116
6185
  if ((selections === null || selections === void 0 ? void 0 : selections.length) === 1) range = selections[0];
6117
6186
  else return false;
6118
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
6187
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6188
+ const target = getSheetCommandTarget(univerInstanceService);
6119
6189
  if (!target) return false;
6120
6190
  const { worksheet, unitId, subUnitId } = target;
6121
6191
  const count = params.value || 0;
@@ -6237,7 +6307,8 @@ const InsertColBeforeCommand = {
6237
6307
  let range;
6238
6308
  if ((selections === null || selections === void 0 ? void 0 : selections.length) === 1) range = selections[0].range;
6239
6309
  else return false;
6240
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
6310
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6311
+ const target = getSheetCommandTarget(univerInstanceService);
6241
6312
  if (!target) return false;
6242
6313
  const { worksheet, unitId, subUnitId } = target;
6243
6314
  const count = params.value || 0;
@@ -6269,7 +6340,8 @@ const InsertColAfterCommand = {
6269
6340
  let range;
6270
6341
  if ((selections === null || selections === void 0 ? void 0 : selections.length) === 1) range = selections[0].range;
6271
6342
  else return false;
6272
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
6343
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6344
+ const target = getSheetCommandTarget(univerInstanceService);
6273
6345
  if (!target) return false;
6274
6346
  const { worksheet, unitId, subUnitId } = target;
6275
6347
  const count = range.endColumn - range.startColumn + 1;
@@ -6300,7 +6372,8 @@ const InsertMultiColsLeftCommand = {
6300
6372
  let range;
6301
6373
  if ((selections === null || selections === void 0 ? void 0 : selections.length) === 1) range = selections[0].range;
6302
6374
  else return false;
6303
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
6375
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6376
+ const target = getSheetCommandTarget(univerInstanceService);
6304
6377
  if (!target) return false;
6305
6378
  const { worksheet, unitId, subUnitId } = target;
6306
6379
  const count = params.value || 0;
@@ -6332,7 +6405,8 @@ const InsertMultiColsRightCommand = {
6332
6405
  let range;
6333
6406
  if ((selections === null || selections === void 0 ? void 0 : selections.length) === 1) range = selections[0].range;
6334
6407
  else return false;
6335
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
6408
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6409
+ const target = getSheetCommandTarget(univerInstanceService);
6336
6410
  if (!target) return false;
6337
6411
  const { worksheet, unitId, subUnitId } = target;
6338
6412
  const count = params.value || 0;
@@ -6373,7 +6447,8 @@ const RemoveRowByRangeCommand = {
6373
6447
  id: "sheet.command.remove-row-by-range",
6374
6448
  handler: (accessor, params) => {
6375
6449
  if (!params) return false;
6376
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
6450
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6451
+ const target = getSheetCommandTarget(univerInstanceService, params);
6377
6452
  if (!target) return false;
6378
6453
  const { workbook, worksheet } = target;
6379
6454
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
@@ -6490,7 +6565,8 @@ const RemoveColByRangeCommand = {
6490
6565
  id: "sheet.command.remove-col-by-range",
6491
6566
  handler: (accessor, params) => {
6492
6567
  if (!params) return false;
6493
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
6568
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6569
+ const target = getSheetCommandTarget(univerInstanceService, params);
6494
6570
  if (!target) return false;
6495
6571
  const { workbook, worksheet } = target;
6496
6572
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
@@ -6570,7 +6646,8 @@ const RemoveColCommand = {
6570
6646
  let range = params === null || params === void 0 ? void 0 : params.range;
6571
6647
  if (!range) range = (_selectionManagerServ2 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ2 === void 0 ? void 0 : _selectionManagerServ2.range;
6572
6648
  if (!range) return false;
6573
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
6649
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6650
+ const target = getSheetCommandTarget(univerInstanceService, params);
6574
6651
  if (!target) return false;
6575
6652
  const { worksheet, subUnitId, unitId } = target;
6576
6653
  range = {
@@ -6650,7 +6727,8 @@ const MoveRowsCommand = {
6650
6727
  const filteredSelections = selections === null || selections === void 0 ? void 0 : selections.filter((selection) => selection.range.rangeType === RANGE_TYPE.ROW && selection.range.startRow <= fromRow && fromRow <= selection.range.endRow);
6651
6728
  if ((filteredSelections === null || filteredSelections === void 0 ? void 0 : filteredSelections.length) !== 1) return false;
6652
6729
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
6653
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
6730
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6731
+ const target = getSheetCommandTarget(univerInstanceService, params);
6654
6732
  if (!target) return false;
6655
6733
  const { workbook, worksheet } = target;
6656
6734
  const unitId = workbook.getUnitId();
@@ -6761,7 +6839,8 @@ const MoveColsCommand = {
6761
6839
  const filteredSelections = selections === null || selections === void 0 ? void 0 : selections.filter((selection) => selection.range.rangeType === RANGE_TYPE.COLUMN && selection.range.startColumn <= fromCol && fromCol <= selection.range.endColumn);
6762
6840
  if ((filteredSelections === null || filteredSelections === void 0 ? void 0 : filteredSelections.length) !== 1) return false;
6763
6841
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
6764
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
6842
+ const univerInstanceService = accessor.get(IUniverInstanceService);
6843
+ const target = getSheetCommandTarget(univerInstanceService, params);
6765
6844
  if (!target) return false;
6766
6845
  const { workbook, worksheet } = target;
6767
6846
  const unitId = workbook.getUnitId();
@@ -7123,11 +7202,12 @@ const handleBaseMoveRowsCols = (fromRange, toRange, effectRange) => {
7123
7202
  const newLine = getAbsolute(getRelative(_effectRange, fromRange), _toRange);
7124
7203
  _effectRange.start = newLine.start;
7125
7204
  _effectRange.end = newLine.end;
7126
- } else if (fromRangeIntersectsEffectRange.start > fromRange.start) if (isToLargeFrom) {
7127
- _effectRange.end -= fromRangeIntersectsEffectRangeStep + fromRangeStep;
7128
- _effectRange.start -= fromRangeStep;
7129
- } else _effectRange.end -= fromRangeIntersectsEffectRangeStep;
7130
- else if (isToLargeFrom) _effectRange.end -= fromRangeIntersectsEffectRangeStep;
7205
+ } else if (fromRangeIntersectsEffectRange.start > fromRange.start) {
7206
+ if (isToLargeFrom) {
7207
+ _effectRange.end -= fromRangeIntersectsEffectRangeStep + fromRangeStep;
7208
+ _effectRange.start -= fromRangeStep;
7209
+ } else _effectRange.end -= fromRangeIntersectsEffectRangeStep;
7210
+ } else if (isToLargeFrom) _effectRange.end -= fromRangeIntersectsEffectRangeStep;
7131
7211
  else if (_effectRange.start > fromRange.start && _effectRange.end > fromRange.end) {
7132
7212
  _effectRange.start -= fromRangeStep;
7133
7213
  _effectRange.end -= fromRangeStep + fromRangeIntersectsEffectRangeStep;
@@ -7585,7 +7665,8 @@ const handleDeleteRangeMoveUpCommon = (param, targetRange) => {
7585
7665
  return mergeAndSortRanges([...noMoveRanges, ...movedRanges]);
7586
7666
  };
7587
7667
  const handleRemoveRowCommon = (param, targetRange) => {
7588
- const mergedRemoved = mergeIntervals((param.ranges ?? [param.range]).map((range) => [range.startRow, range.endRow]));
7668
+ const removed = (param.ranges ?? [param.range]).map((range) => [range.startRow, range.endRow]);
7669
+ const mergedRemoved = mergeIntervals(removed);
7589
7670
  let targetStartRow = targetRange.startRow;
7590
7671
  let targetEndRow = targetRange.endRow;
7591
7672
  for (let i = mergedRemoved.length - 1; i >= 0; i--) {
@@ -7678,9 +7759,7 @@ const runRefRangeMutations = (operators, range) => {
7678
7759
  result.startRow += operator.step;
7679
7760
  result.endRow += operator.step + (operator.length || 0);
7680
7761
  break;
7681
- case 0:
7682
- result = operator.range;
7683
- break;
7762
+ case 0: result = operator.range;
7684
7763
  }
7685
7764
  });
7686
7765
  if (result) {
@@ -7724,9 +7803,7 @@ const handleDefaultRangeChangeWithEffectRefCommands = (range, commandInfo) => {
7724
7803
  case EffectRefRangId.RemoveRowCommandId:
7725
7804
  operator = handleIRemoveRow(commandInfo, range);
7726
7805
  break;
7727
- case EffectRefRangId.ReorderRangeCommandId:
7728
- operator = handleReorderRange(commandInfo, range);
7729
- break;
7806
+ case EffectRefRangId.ReorderRangeCommandId: operator = handleReorderRange(commandInfo, range);
7730
7807
  }
7731
7808
  return runRefRangeMutations(operator, range);
7732
7809
  };
@@ -7837,10 +7914,7 @@ function adjustRangeOnMutation(range, mutation) {
7837
7914
  baseRangeOperator = handleBaseInsertRange(params.range, range);
7838
7915
  baseRangeOperator.type = 2;
7839
7916
  break;
7840
- case MoveRangeMutation.id:
7841
- baseRangeOperator = handleBaseMoveRange(params.fromRange || new ObjectMatrix(params.from).getRange(), params.toRange || new ObjectMatrix(params.to).getRange(), range);
7842
- break;
7843
- default: break;
7917
+ case MoveRangeMutation.id: baseRangeOperator = handleBaseMoveRange(params.fromRange || new ObjectMatrix(params.from).getRange(), params.toRange || new ObjectMatrix(params.to).getRange(), range);
7844
7918
  }
7845
7919
  if (baseRangeOperator) return Array.isArray(baseRangeOperator) ? runRefRangeMutations(baseRangeOperator, range) : runRefRangeMutations([baseRangeOperator], range);
7846
7920
  else return range;
@@ -7953,7 +8027,6 @@ function getEffectedRangesOnMutation(mutation) {
7953
8027
  }
7954
8028
  case RemoveColMutation.id: return [mutation.params.range];
7955
8029
  case RemoveRowMutation.id: return [mutation.params.range];
7956
- default: break;
7957
8030
  }
7958
8031
  }
7959
8032
  function getSeparateEffectedRangesOnCommand(accessor, command) {
@@ -8765,10 +8838,11 @@ let MergeCellController = class MergeCellController extends Disposable {
8765
8838
  mergeData.forEach((range) => {
8766
8839
  if (sourceStart <= range.startRow && sourceEnd >= range.endRow) {
8767
8840
  removeParams.ranges.push(range);
8768
- const result = runRefRangeMutations(handleMoveRows({
8841
+ const operation = handleMoveRows({
8769
8842
  id: EffectRefRangId.MoveRowsCommandId,
8770
8843
  params
8771
- }, range), range);
8844
+ }, range);
8845
+ const result = runRefRangeMutations(operation, range);
8772
8846
  result && addParams.ranges.push(result);
8773
8847
  }
8774
8848
  });
@@ -8815,10 +8889,11 @@ let MergeCellController = class MergeCellController extends Disposable {
8815
8889
  mergeData.forEach((range) => {
8816
8890
  if (sourceStart <= range.startColumn && sourceEnd >= range.endColumn) {
8817
8891
  removeParams.ranges.push(range);
8818
- const result = runRefRangeMutations(handleMoveCols({
8892
+ const operation = handleMoveCols({
8819
8893
  id: EffectRefRangId.MoveColsCommandId,
8820
8894
  params
8821
- }, range), range);
8895
+ }, range);
8896
+ const result = runRefRangeMutations(operation, range);
8822
8897
  result && addParams.ranges.push(result);
8823
8898
  }
8824
8899
  });
@@ -9786,7 +9861,8 @@ const AddWorksheetMergeCommand = {
9786
9861
  type: CommandType.COMMAND,
9787
9862
  id: "sheet.command.add-worksheet-merge",
9788
9863
  handler: async (accessor, params) => {
9789
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
9864
+ const univerInstanceService = accessor.get(IUniverInstanceService);
9865
+ const target = getSheetCommandTarget(univerInstanceService, params);
9790
9866
  if (!target) return false;
9791
9867
  const { worksheet } = target;
9792
9868
  const { unitId, subUnitId, selections } = params;
@@ -9872,7 +9948,8 @@ const AddWorksheetMergeAllCommand = {
9872
9948
  var _selectionManagerServ;
9873
9949
  const mergeableSelections = getMergeableSelectionsByType("mergeAll", (_selectionManagerServ = accessor.get(SheetsSelectionsService).getCurrentSelections()) === null || _selectionManagerServ === void 0 ? void 0 : _selectionManagerServ.map((s) => s.range));
9874
9950
  if (!(mergeableSelections === null || mergeableSelections === void 0 ? void 0 : mergeableSelections.length)) return false;
9875
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
9951
+ const univerInstanceService = accessor.get(IUniverInstanceService);
9952
+ const target = getSheetCommandTarget(univerInstanceService);
9876
9953
  if (!target) return false;
9877
9954
  const { worksheet } = target;
9878
9955
  const unitId = worksheet.getUnitId();
@@ -9891,7 +9968,8 @@ const AddWorksheetMergeVerticalCommand = {
9891
9968
  var _selectionManagerServ2;
9892
9969
  const mergeableSelections = getMergeableSelectionsByType("mergeVertical", (_selectionManagerServ2 = accessor.get(SheetsSelectionsService).getCurrentSelections()) === null || _selectionManagerServ2 === void 0 ? void 0 : _selectionManagerServ2.map((s) => s.range));
9893
9970
  if (!(mergeableSelections === null || mergeableSelections === void 0 ? void 0 : mergeableSelections.length)) return false;
9894
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
9971
+ const univerInstanceService = accessor.get(IUniverInstanceService);
9972
+ const target = getSheetCommandTarget(univerInstanceService);
9895
9973
  if (!target) return false;
9896
9974
  const { worksheet } = target;
9897
9975
  const unitId = worksheet.getUnitId();
@@ -9911,7 +9989,8 @@ const AddWorksheetMergeHorizontalCommand = {
9911
9989
  var _selectionManagerServ3;
9912
9990
  const mergeableSelections = getMergeableSelectionsByType("mergeHorizontal", (_selectionManagerServ3 = accessor.get(SheetsSelectionsService).getCurrentSelections()) === null || _selectionManagerServ3 === void 0 ? void 0 : _selectionManagerServ3.map((s) => s.range));
9913
9991
  if (!(mergeableSelections === null || mergeableSelections === void 0 ? void 0 : mergeableSelections.length)) return false;
9914
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
9992
+ const univerInstanceService = accessor.get(IUniverInstanceService);
9993
+ const target = getSheetCommandTarget(univerInstanceService);
9915
9994
  if (!target) return false;
9916
9995
  const { workbook, worksheet } = target;
9917
9996
  const unitId = workbook.getUnitId();
@@ -10278,7 +10357,8 @@ const SetStyleCommand = {
10278
10357
  id: "sheet.command.set-style",
10279
10358
  handler: (accessor, params) => {
10280
10359
  var _selectionManagerServ;
10281
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
10360
+ const univerInstanceService = accessor.get(IUniverInstanceService);
10361
+ const target = getSheetCommandTarget(univerInstanceService, params);
10282
10362
  if (!target) return false;
10283
10363
  const { unitId, subUnitId, worksheet } = target;
10284
10364
  const { range, style } = params;
@@ -10772,13 +10852,16 @@ function numberToChinese(num) {
10772
10852
  function isChnNumber$1(txt) {
10773
10853
  if (!txt) return false;
10774
10854
  let isChnNumber = true;
10775
- if (txt) if (txt.length === 1) if (txt === "日" || txt in chnNumChar) isChnNumber = true;
10776
- else isChnNumber = false;
10777
- else {
10778
- const str = txt.split("");
10779
- for (let i = 0; i < str.length; i++) if (!(str[i] in chnNumChar || str[i] in chnNameValue)) {
10780
- isChnNumber = false;
10781
- break;
10855
+ if (txt) {
10856
+ if (txt.length === 1) {
10857
+ if (txt === "日" || txt in chnNumChar) isChnNumber = true;
10858
+ else isChnNumber = false;
10859
+ } else {
10860
+ const str = txt.split("");
10861
+ for (let i = 0; i < str.length; i++) if (!(str[i] in chnNumChar || str[i] in chnNameValue)) {
10862
+ isChnNumber = false;
10863
+ break;
10864
+ }
10782
10865
  }
10783
10866
  }
10784
10867
  return isChnNumber;
@@ -10802,23 +10885,26 @@ function matchExtendNumber$1(txt) {
10802
10885
  }
10803
10886
  function isChnWeek1(txt) {
10804
10887
  let isChnWeek1;
10805
- if (txt.length === 1) if (txt === "日" || chineseToNumber$1(txt) < 7) isChnWeek1 = true;
10806
- else isChnWeek1 = false;
10807
- else isChnWeek1 = false;
10888
+ if (txt.length === 1) {
10889
+ if (txt === "日" || chineseToNumber$1(txt) < 7) isChnWeek1 = true;
10890
+ else isChnWeek1 = false;
10891
+ } else isChnWeek1 = false;
10808
10892
  return isChnWeek1;
10809
10893
  }
10810
10894
  function isChnWeek2$1(txt) {
10811
10895
  let isChnWeek2;
10812
- if (txt.length === 2) if (txt === "周一" || txt === "周二" || txt === "周三" || txt === "周四" || txt === "周五" || txt === "周六" || txt === "周日") isChnWeek2 = true;
10813
- else isChnWeek2 = false;
10814
- else isChnWeek2 = false;
10896
+ if (txt.length === 2) {
10897
+ if (txt === "周一" || txt === "周二" || txt === "周三" || txt === "周四" || txt === "周五" || txt === "周六" || txt === "周日") isChnWeek2 = true;
10898
+ else isChnWeek2 = false;
10899
+ } else isChnWeek2 = false;
10815
10900
  return isChnWeek2;
10816
10901
  }
10817
10902
  function isChnWeek3$1(txt) {
10818
10903
  let isChnWeek3;
10819
- if (txt.length === 3) if (txt === "星期一" || txt === "星期二" || txt === "星期三" || txt === "星期四" || txt === "星期五" || txt === "星期六" || txt === "星期日") isChnWeek3 = true;
10820
- else isChnWeek3 = false;
10821
- else isChnWeek3 = false;
10904
+ if (txt.length === 3) {
10905
+ if (txt === "星期一" || txt === "星期二" || txt === "星期三" || txt === "星期四" || txt === "星期五" || txt === "星期六" || txt === "星期日") isChnWeek3 = true;
10906
+ else isChnWeek3 = false;
10907
+ } else isChnWeek3 = false;
10822
10908
  return isChnWeek3;
10823
10909
  }
10824
10910
  function getLenS$1(indexArr, rsd) {
@@ -11583,12 +11669,13 @@ const AutoFillRules = {
11583
11669
  for (let i = 0; i < data.length; i++) {
11584
11670
  var _data$i3;
11585
11671
  const formattedValue = `${(_data$i3 = data[i]) === null || _data$i3 === void 0 ? void 0 : _data$i3.v}`;
11586
- if (formattedValue === "日") if (i === 0) dataNumArr.push(0);
11587
- else {
11588
- weekIndex++;
11589
- dataNumArr.push(weekIndex * 7);
11590
- }
11591
- else if (hasWeek && chineseToNumber(formattedValue) > 0 && chineseToNumber(formattedValue) < 7) dataNumArr.push(chineseToNumber(formattedValue) + weekIndex * 7);
11672
+ if (formattedValue === "日") {
11673
+ if (i === 0) dataNumArr.push(0);
11674
+ else {
11675
+ weekIndex++;
11676
+ dataNumArr.push(weekIndex * 7);
11677
+ }
11678
+ } else if (hasWeek && chineseToNumber(formattedValue) > 0 && chineseToNumber(formattedValue) < 7) dataNumArr.push(chineseToNumber(formattedValue) + weekIndex * 7);
11592
11679
  else dataNumArr.push(chineseToNumber(formattedValue));
11593
11680
  }
11594
11681
  if (isReverse) {
@@ -11630,12 +11717,13 @@ const AutoFillRules = {
11630
11717
  var _data$i4;
11631
11718
  const formattedValue = `${(_data$i4 = data[i]) === null || _data$i4 === void 0 ? void 0 : _data$i4.v}`;
11632
11719
  const lastTxt = formattedValue === null || formattedValue === void 0 ? void 0 : formattedValue.substr(formattedValue.length - 1, 1);
11633
- if (formattedValue === "周日") if (i === 0) dataNumArr.push(0);
11634
- else {
11635
- weekIndex++;
11636
- dataNumArr.push(weekIndex * 7);
11637
- }
11638
- else dataNumArr.push(chineseToNumber(lastTxt) + weekIndex * 7);
11720
+ if (formattedValue === "周日") {
11721
+ if (i === 0) dataNumArr.push(0);
11722
+ else {
11723
+ weekIndex++;
11724
+ dataNumArr.push(weekIndex * 7);
11725
+ }
11726
+ } else dataNumArr.push(chineseToNumber(lastTxt) + weekIndex * 7);
11639
11727
  }
11640
11728
  if (isReverse) {
11641
11729
  data.reverse();
@@ -11670,12 +11758,13 @@ const AutoFillRules = {
11670
11758
  const formattedValue = `${(_data$i5 = data[i]) === null || _data$i5 === void 0 ? void 0 : _data$i5.v}`;
11671
11759
  if (formattedValue) {
11672
11760
  const lastTxt = formattedValue.substr(formattedValue.length - 1, 1);
11673
- if (formattedValue === "星期日") if (i === 0) dataNumArr.push(0);
11674
- else {
11675
- weekIndex++;
11676
- dataNumArr.push(weekIndex * 7);
11677
- }
11678
- else dataNumArr.push(chineseToNumber(lastTxt) + weekIndex * 7);
11761
+ if (formattedValue === "星期日") {
11762
+ if (i === 0) dataNumArr.push(0);
11763
+ else {
11764
+ weekIndex++;
11765
+ dataNumArr.push(weekIndex * 7);
11766
+ }
11767
+ } else dataNumArr.push(chineseToNumber(lastTxt) + weekIndex * 7);
11679
11768
  }
11680
11769
  }
11681
11770
  if (isReverse) {
@@ -11717,12 +11806,15 @@ const AutoFillRules = {
11717
11806
  for (let i = 0; i < data.length; i++) {
11718
11807
  var _data$i6;
11719
11808
  const formattedValue = `${(_data$i6 = data[i]) === null || _data$i6 === void 0 ? void 0 : _data$i6.v}`;
11720
- if (formattedValue) if (formattedValue === series[0]) if (i === 0) dataNumArr.push(0);
11721
- else {
11722
- cycleIndex++;
11723
- dataNumArr.push(cycleIndex * series.length);
11809
+ if (formattedValue) {
11810
+ if (formattedValue === series[0]) {
11811
+ if (i === 0) dataNumArr.push(0);
11812
+ else {
11813
+ cycleIndex++;
11814
+ dataNumArr.push(cycleIndex * series.length);
11815
+ }
11816
+ } else dataNumArr.push(series.indexOf(formattedValue) + cycleIndex * 7);
11724
11817
  }
11725
- else dataNumArr.push(series.indexOf(formattedValue) + cycleIndex * 7);
11726
11818
  }
11727
11819
  if (isReverse) {
11728
11820
  data.reverse();
@@ -12310,10 +12402,11 @@ const ClearSelectionContentCommand = {
12310
12402
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
12311
12403
  const redoMutations = [];
12312
12404
  const undoMutations = [];
12405
+ const visibleRanges = getVisibleRanges(ranges, accessor, unitId, subUnitId);
12313
12406
  const clearMutationParams = {
12314
12407
  subUnitId,
12315
12408
  unitId,
12316
- cellValue: generateNullCellValue(getVisibleRanges(ranges, accessor, unitId, subUnitId))
12409
+ cellValue: generateNullCellValue(visibleRanges)
12317
12410
  };
12318
12411
  const undoClearMutationParams = SetRangeValuesUndoMutationFactory(accessor, clearMutationParams);
12319
12412
  redoMutations.push({
@@ -12436,7 +12529,7 @@ let SheetLazyExecuteScheduleService = class SheetLazyExecuteScheduleService exte
12436
12529
  }
12437
12530
  _scheduleNextIdle() {
12438
12531
  if (this._idleCallbackId !== null) return;
12439
- if (typeof requestIdleCallback !== "undefined") this._idleCallbackId = requestIdleCallback((deadline) => this._processIdleTasks(deadline), { timeout: 1e3 * 60 });
12532
+ if (typeof requestIdleCallback !== "undefined") this._idleCallbackId = requestIdleCallback((deadline) => this._processIdleTasks(deadline), { timeout: 6e4 });
12440
12533
  else this._idleCallbackId = setTimeout(() => {
12441
12534
  this._processIdleTasks({
12442
12535
  didTimeout: false,
@@ -13505,7 +13598,8 @@ const SetColDataCommand = {
13505
13598
  handler: (accessor, params) => {
13506
13599
  const commandService = accessor.get(ICommandService);
13507
13600
  const undoRedoService = accessor.get(IUndoRedoService);
13508
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
13601
+ const univerInstanceService = accessor.get(IUniverInstanceService);
13602
+ const target = getSheetCommandTarget(univerInstanceService, params);
13509
13603
  if (!target) return false;
13510
13604
  const { columnData } = params;
13511
13605
  const { unitId, subUnitId, worksheet } = target;
@@ -13542,7 +13636,8 @@ const SetSpecificColsVisibleCommand = {
13542
13636
  const { unitId, subUnitId, ranges } = params;
13543
13637
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
13544
13638
  const commandService = accessor.get(ICommandService);
13545
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), {
13639
+ const instanceService = accessor.get(IUniverInstanceService);
13640
+ const target = getSheetCommandTarget(instanceService, {
13546
13641
  unitId,
13547
13642
  subUnitId
13548
13643
  });
@@ -13913,7 +14008,8 @@ const SetFrozenCommand = {
13913
14008
  handler: (accessor, params) => {
13914
14009
  const commandService = accessor.get(ICommandService);
13915
14010
  const undoRedoService = accessor.get(IUndoRedoService);
13916
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), {
14011
+ const univerInstanceService = accessor.get(IUniverInstanceService);
14012
+ const target = getSheetCommandTarget(univerInstanceService, {
13917
14013
  unitId: params.unitId,
13918
14014
  subUnitId: params.subUnitId
13919
14015
  });
@@ -13992,7 +14088,8 @@ const SetGridlinesColorCommand = {
13992
14088
  handler: (accessor, params) => {
13993
14089
  const commandService = accessor.get(ICommandService);
13994
14090
  const undoRedoService = accessor.get(IUndoRedoService);
13995
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
14091
+ const univerInstanceService = accessor.get(IUniverInstanceService);
14092
+ const target = getSheetCommandTarget(univerInstanceService, params);
13996
14093
  if (!target) return false;
13997
14094
  const { worksheet } = target;
13998
14095
  const currentlyColor = worksheet.getConfig().gridlinesColor;
@@ -14076,44 +14173,45 @@ const SetProtectionCommand = {
14076
14173
  const { unitId, subUnitId } = rule;
14077
14174
  const redoMutations = [];
14078
14175
  const undoMutations = [];
14079
- if ((oldRule === null || oldRule === void 0 ? void 0 : oldRule.unitType) === rule.unitType) if (rule.unitType === UnitObject.Worksheet) {
14080
- redoMutations.push({
14081
- id: SetWorksheetProtectionMutation.id,
14082
- params: {
14083
- unitId,
14084
- subUnitId,
14085
- rule
14086
- }
14087
- });
14088
- undoMutations.push({
14089
- id: SetWorksheetProtectionMutation.id,
14090
- params: {
14091
- unitId,
14092
- subUnitId,
14093
- rule: oldRule
14094
- }
14095
- });
14176
+ if ((oldRule === null || oldRule === void 0 ? void 0 : oldRule.unitType) === rule.unitType) {
14177
+ if (rule.unitType === UnitObject.Worksheet) {
14178
+ redoMutations.push({
14179
+ id: SetWorksheetProtectionMutation.id,
14180
+ params: {
14181
+ unitId,
14182
+ subUnitId,
14183
+ rule
14184
+ }
14185
+ });
14186
+ undoMutations.push({
14187
+ id: SetWorksheetProtectionMutation.id,
14188
+ params: {
14189
+ unitId,
14190
+ subUnitId,
14191
+ rule: oldRule
14192
+ }
14193
+ });
14194
+ } else {
14195
+ redoMutations.push({
14196
+ id: SetRangeProtectionMutation.id,
14197
+ params: {
14198
+ unitId,
14199
+ subUnitId,
14200
+ rule,
14201
+ ruleId: rule.id
14202
+ }
14203
+ });
14204
+ undoMutations.push({
14205
+ id: SetRangeProtectionMutation.id,
14206
+ params: {
14207
+ unitId,
14208
+ subUnitId,
14209
+ ruleId: oldRule.id,
14210
+ rule: oldRule
14211
+ }
14212
+ });
14213
+ }
14096
14214
  } else {
14097
- redoMutations.push({
14098
- id: SetRangeProtectionMutation.id,
14099
- params: {
14100
- unitId,
14101
- subUnitId,
14102
- rule,
14103
- ruleId: rule.id
14104
- }
14105
- });
14106
- undoMutations.push({
14107
- id: SetRangeProtectionMutation.id,
14108
- params: {
14109
- unitId,
14110
- subUnitId,
14111
- ruleId: oldRule.id,
14112
- rule: oldRule
14113
- }
14114
- });
14115
- }
14116
- else {
14117
14215
  if (oldRule) {
14118
14216
  if (oldRule.unitType === UnitObject.Worksheet) {
14119
14217
  redoMutations.push({
@@ -14232,7 +14330,8 @@ const SetRowDataCommand = {
14232
14330
  handler: (accessor, params) => {
14233
14331
  const commandService = accessor.get(ICommandService);
14234
14332
  const undoRedoService = accessor.get(IUndoRedoService);
14235
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
14333
+ const univerInstanceService = accessor.get(IUniverInstanceService);
14334
+ const target = getSheetCommandTarget(univerInstanceService, params);
14236
14335
  if (!target) return false;
14237
14336
  const { rowData } = params;
14238
14337
  const { unitId, subUnitId, worksheet } = target;
@@ -14634,14 +14733,15 @@ const SetWorkbookNameCommand = {
14634
14733
  name: params.name,
14635
14734
  unitId: params.unitId
14636
14735
  };
14637
- return sequenceExecute([
14736
+ const redos = [
14638
14737
  ...interceptedCommands.preRedos ?? [],
14639
14738
  {
14640
14739
  id: SetWorkbookNameMutation.id,
14641
14740
  params: redoMutationParams
14642
14741
  },
14643
14742
  ...interceptedCommands.redos
14644
- ], commandService).result;
14743
+ ];
14744
+ return sequenceExecute(redos, commandService).result;
14645
14745
  }
14646
14746
  };
14647
14747
 
@@ -14851,7 +14951,8 @@ const SetWorksheetColIsAutoWidthCommand = {
14851
14951
  const commandService = accessor.get(ICommandService);
14852
14952
  const undoRedoService = accessor.get(IUndoRedoService);
14853
14953
  const selectionManagerService = accessor.get(SheetsSelectionsService);
14854
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
14954
+ const univerInstanceService = accessor.get(IUniverInstanceService);
14955
+ const target = getSheetCommandTarget(univerInstanceService, params);
14855
14956
  if (!target) return false;
14856
14957
  const { unitId, subUnitId } = target;
14857
14958
  let ranges = [];
@@ -14891,7 +14992,8 @@ const SetWorksheetColumnCountCommand = {
14891
14992
  const { unitId, subUnitId, columnCount } = params;
14892
14993
  const commandService = accessor.get(ICommandService);
14893
14994
  const undoRedoService = accessor.get(IUndoRedoService);
14894
- if (!getSheetCommandTarget(accessor.get(IUniverInstanceService), params)) return false;
14995
+ const univerInstanceService = accessor.get(IUniverInstanceService);
14996
+ if (!getSheetCommandTarget(univerInstanceService, params)) return false;
14895
14997
  const redoMutationParams = {
14896
14998
  unitId,
14897
14999
  subUnitId,
@@ -14951,7 +15053,7 @@ const SetWorksheetHideMutationFactory = (accessor, params) => {
14951
15053
  if (!target) throw new Error("[SetWorksheetHideMutationFactory]: worksheet is null error!");
14952
15054
  const { worksheet } = target;
14953
15055
  return {
14954
- hidden: worksheet.isSheetHidden(),
15056
+ hidden: worksheet.getHiddenState(),
14955
15057
  unitId: params.unitId,
14956
15058
  subUnitId: worksheet.getSheetId()
14957
15059
  };
@@ -14964,7 +15066,8 @@ const SetWorksheetHideMutation = {
14964
15066
  if (universheet == null) return false;
14965
15067
  const worksheet = universheet.getSheetBySheetId(params.subUnitId);
14966
15068
  if (!worksheet) return false;
14967
- worksheet.getConfig().hidden = params.hidden;
15069
+ if (params.hidden !== WorksheetHiddenState.VISIBLE && params.hidden !== WorksheetHiddenState.HIDDEN && params.hidden !== WorksheetHiddenState.VERY_HIDDEN) return false;
15070
+ worksheet.setHiddenState(params.hidden);
14968
15071
  return true;
14969
15072
  }
14970
15073
  };
@@ -14982,14 +15085,19 @@ const SetWorksheetHideCommand = {
14982
15085
  const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
14983
15086
  if (!target) return false;
14984
15087
  const { workbook, worksheet, unitId, subUnitId } = target;
14985
- if (worksheet.getConfig().hidden === BooleanNumber.TRUE) return false;
15088
+ const hidden = (params === null || params === void 0 ? void 0 : params.hidden) ?? WorksheetHiddenState.HIDDEN;
15089
+ const currentHiddenState = worksheet.getHiddenState();
15090
+ if (hidden !== WorksheetHiddenState.HIDDEN && hidden !== WorksheetHiddenState.VERY_HIDDEN) return false;
15091
+ if (currentHiddenState === hidden) return false;
15092
+ if ((params === null || params === void 0 ? void 0 : params.hidden) === void 0 && currentHiddenState !== WorksheetHiddenState.VISIBLE) return false;
14986
15093
  const redoMutationParams = {
14987
15094
  unitId,
14988
15095
  subUnitId,
14989
- hidden: BooleanNumber.TRUE
15096
+ hidden
14990
15097
  };
14991
15098
  const undoMutationParams = SetWorksheetHideMutationFactory(accessor, redoMutationParams);
14992
- if (workbook.getSheets().filter((sheet) => sheet.getConfig().hidden === BooleanNumber.FALSE).length === 1) {
15099
+ const visibleWorksheets = workbook.getSheets().filter((sheet) => sheet.getConfig().hidden === BooleanNumber.FALSE);
15100
+ if (currentHiddenState === WorksheetHiddenState.VISIBLE && visibleWorksheets.length === 1) {
14993
15101
  errorService.emit(localeService.t("sheets.info.hideSheet"));
14994
15102
  return false;
14995
15103
  }
@@ -16154,12 +16262,10 @@ let WorksheetPermissionService = class WorksheetPermissionService extends RxDisp
16154
16262
  this._permissionService.updatePermissionPoint(instance.id, true);
16155
16263
  });
16156
16264
  break;
16157
- case "set":
16158
- getAllWorksheetPermissionPoint().forEach((F) => {
16159
- const instance = new F(info.unitId, info.subUnitId);
16160
- this._permissionService.updatePermissionPoint(instance.id, info.rule);
16161
- });
16162
- break;
16265
+ case "set": getAllWorksheetPermissionPoint().forEach((F) => {
16266
+ const instance = new F(info.unitId, info.subUnitId);
16267
+ this._permissionService.updatePermissionPoint(instance.id, info.rule);
16268
+ });
16163
16269
  }
16164
16270
  }));
16165
16271
  }
@@ -16407,7 +16513,8 @@ const SetWorksheetRowCountCommand = {
16407
16513
  const { unitId, subUnitId, rowCount } = params;
16408
16514
  const commandService = accessor.get(ICommandService);
16409
16515
  const undoRedoService = accessor.get(IUndoRedoService);
16410
- if (!getSheetCommandTarget(accessor.get(IUniverInstanceService), params)) return false;
16516
+ const univerInstanceService = accessor.get(IUniverInstanceService);
16517
+ if (!getSheetCommandTarget(univerInstanceService, params)) return false;
16411
16518
  const redoMutationParams = {
16412
16519
  unitId,
16413
16520
  subUnitId,
@@ -16634,7 +16741,8 @@ const SetWorksheetRowIsAutoHeightCommand = {
16634
16741
  const commandService = accessor.get(ICommandService);
16635
16742
  const undoRedoService = accessor.get(IUndoRedoService);
16636
16743
  const selectionManagerService = accessor.get(SheetsSelectionsService);
16637
- const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
16744
+ const univerInstanceService = accessor.get(IUniverInstanceService);
16745
+ const target = getSheetCommandTarget(univerInstanceService, params);
16638
16746
  if (!target) return false;
16639
16747
  const { unitId, subUnitId, worksheet } = target;
16640
16748
  const ranges = (params === null || params === void 0 || (_params$ranges2 = params.ranges) === null || _params$ranges2 === void 0 ? void 0 : _params$ranges2.length) ? params.ranges : (_selectionManagerServ2 = selectionManagerService.getCurrentSelections()) === null || _selectionManagerServ2 === void 0 ? void 0 : _selectionManagerServ2.map((s) => s.range);
@@ -17575,6 +17683,8 @@ let AutoFillController = class AutoFillController extends Disposable {
17575
17683
  if (cellData) {
17576
17684
  const old = this._beforeApplyData[rowIndex][colIndex] || {};
17577
17685
  cellData.f = old.f;
17686
+ cellData.ft = old.ft;
17687
+ cellData.fd = old.fd;
17578
17688
  cellData.si = old.si;
17579
17689
  cellData.t = old.t;
17580
17690
  cellData.v = old.v;
@@ -17734,7 +17844,7 @@ let CalculateResultApplyController = class CalculateResultApplyController extend
17734
17844
  * @param unitId
17735
17845
  * @param sheetId
17736
17846
  * @param cellData
17737
- * @returns
17847
+ * @returns Calculated cell data merged with number formats.
17738
17848
  */
17739
17849
  _getMergedCellData(unitId, sheetId, cellData) {
17740
17850
  const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
@@ -17743,7 +17853,8 @@ let CalculateResultApplyController = class CalculateResultApplyController extend
17743
17853
  const oldCellDataMatrix = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getCellMatrix();
17744
17854
  const cellDataMatrix = new ObjectMatrix(cellData);
17745
17855
  cellDataMatrix.forValue((row, col, cell) => {
17746
- const newCell = handleNumfmtInCell(oldCellDataMatrix === null || oldCellDataMatrix === void 0 ? void 0 : oldCellDataMatrix.getValue(row, col), cell, styles);
17856
+ const oldCell = oldCellDataMatrix === null || oldCellDataMatrix === void 0 ? void 0 : oldCellDataMatrix.getValue(row, col);
17857
+ const newCell = handleNumfmtInCell(oldCell, cell, styles);
17747
17858
  cellDataMatrix.setValue(row, col, newCell);
17748
17859
  });
17749
17860
  return cellDataMatrix.getMatrix();
@@ -18243,8 +18354,6 @@ let SheetPermissionCheckController = class SheetPermissionCheckController extend
18243
18354
  rangeTypes: [RangeProtectionPermissionEditPoint]
18244
18355
  }, params === null || params === void 0 ? void 0 : params.ranges, params === null || params === void 0 ? void 0 : params.unitId, params === null || params === void 0 ? void 0 : params.subUnitId);
18245
18356
  errorMsg = this._localeService.t("sheets.permission.dialog.editErr");
18246
- break;
18247
- default: break;
18248
18357
  }
18249
18358
  if (!permission) this.blockExecuteWithoutPermission(errorMsg);
18250
18359
  }
@@ -18994,14 +19103,11 @@ let ZebraCrossingCacheController = class ZebraCrossingCacheController extends Di
18994
19103
  subUnitId = params.subUnitId;
18995
19104
  }
18996
19105
  break;
18997
- case SetWorksheetRowHeightMutation.id:
18998
- {
18999
- const params = commandInfo.params;
19000
- unitId = params.unitId;
19001
- subUnitId = params.subUnitId;
19002
- }
19003
- break;
19004
- default: break;
19106
+ case SetWorksheetRowHeightMutation.id: {
19107
+ const params = commandInfo.params;
19108
+ unitId = params.unitId;
19109
+ subUnitId = params.subUnitId;
19110
+ }
19005
19111
  }
19006
19112
  if (unitId && subUnitId) {
19007
19113
  this._sheetRangeThemeModel.refreshSheetRowVisibleFuncSet(unitId, subUnitId);
@@ -19383,7 +19489,7 @@ RangeProtectionCache = __decorate([
19383
19489
  //#endregion
19384
19490
  //#region package.json
19385
19491
  var name = "@univerjs/sheets";
19386
- var version = "1.0.0-rc.0";
19492
+ var version = "1.0.0";
19387
19493
 
19388
19494
  //#endregion
19389
19495
  //#region src/controllers/active-worksheet.controller.ts
@@ -20025,7 +20131,6 @@ let RangeProtectionRefRangeService = class RangeProtectionRefRangeService extend
20025
20131
  case InsertColCommand.id: return this._getRefRangeMutationsByInsertCols(config.params, unitId, subUnitId);
20026
20132
  case RemoveColCommand.id: return this._getRefRangeMutationsByDeleteCols(config.params, unitId, subUnitId);
20027
20133
  case RemoveRowCommand.id: return this._getRefRangeMutationsByDeleteRows(config.params, unitId, subUnitId);
20028
- default: break;
20029
20134
  }
20030
20135
  return {
20031
20136
  redos: [],
@@ -20592,14 +20697,12 @@ let RangeProtectionService = class RangeProtectionService extends Disposable {
20592
20697
  this._permissionService.deletePermissionPoint(instance.id);
20593
20698
  });
20594
20699
  break;
20595
- case "set":
20596
- if (info.oldRule.permissionId !== info.rule.permissionId) getAllRangePermissionPoint().forEach((F) => {
20597
- const oldPermissionPoint = new F(info.unitId, info.subUnitId, info.oldRule.permissionId);
20598
- this._permissionService.deletePermissionPoint(oldPermissionPoint.id);
20599
- const newPermissionPoint = new F(info.unitId, info.subUnitId, info.rule.permissionId);
20600
- this._permissionService.addPermissionPoint(newPermissionPoint);
20601
- });
20602
- break;
20700
+ case "set": if (info.oldRule.permissionId !== info.rule.permissionId) getAllRangePermissionPoint().forEach((F) => {
20701
+ const oldPermissionPoint = new F(info.unitId, info.subUnitId, info.oldRule.permissionId);
20702
+ this._permissionService.deletePermissionPoint(oldPermissionPoint.id);
20703
+ const newPermissionPoint = new F(info.unitId, info.subUnitId, info.rule.permissionId);
20704
+ this._permissionService.addPermissionPoint(newPermissionPoint);
20705
+ });
20603
20706
  }
20604
20707
  }));
20605
20708
  }
@@ -21334,4 +21437,4 @@ function convertPositionCellToSheetOverGrid(unitId, subUnitId, cellOverGridPosit
21334
21437
  }
21335
21438
 
21336
21439
  //#endregion
21337
- export { AFFECT_LAYOUT_STYLES, AFTER_CELL_EDIT, AUTO_FILL_APPLY_TYPE, AUTO_FILL_DATA_TYPE, AUTO_FILL_HOOK_TYPE, AddMergeRedoSelectionsOperationFactory, AddMergeUndoMutationFactory, AddMergeUndoSelectionsOperationFactory, AddRangeProtectionCommand, AddRangeProtectionMutation, AddRangeThemeMutation, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeMutation, AddWorksheetMergeVerticalCommand, AddWorksheetProtectionCommand, AddWorksheetProtectionMutation, AppendRowCommand, AutoClearContentCommand, AutoFillCommand, AutoFillController, AutoFillRules, AutoFillService, AutoFillTools, BEFORE_CELL_EDIT, BorderStyleManagerService, COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, CalculateResultApplyController, CancelFrozenCommand, CancelMarkDirtyRowAutoHeightOperation, ClearSelectionAllCommand, ClearSelectionContentCommand, ClearSelectionFormatCommand, CopySheetCommand, CopyWorksheetEndMutation, DISABLE_NORMAL_SELECTIONS, DefinedNameDataController, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, DeleteRangeProtectionCommand, DeleteRangeProtectionMutation, DeleteWorksheetProtectionCommand, DeleteWorksheetProtectionMutation, DeleteWorksheetRangeThemeStyleCommand, DeleteWorksheetRangeThemeStyleMutation, DeleteWorksheetRangeThemeStyleMutationFactory, DeltaColumnWidthCommand, DeltaRowHeightCommand, EditStateEnum, EffectRefRangId, EmptyMutation, ExclusiveRangeService, FactoryAddRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, FactorySetRangeProtectionMutation, IAutoFillService, IExclusiveRangeService, INTERCEPTOR_POINT, INumfmtService, IRefSelectionsService, InsertColAfterCommand, InsertColBeforeCommand, InsertColByRangeCommand, InsertColCommand, InsertColMutation, InsertColMutationUndoFactory, InsertDefinedNameCommand, InsertMultiColsLeftCommand, InsertMultiColsRightCommand, InsertMultiRowsAboveCommand, InsertMultiRowsAfterCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowByRangeCommand, InsertRowCommand, InsertRowMutation, InsertRowMutationUndoFactory, InsertSheetCommand, InsertSheetMutation, InsertSheetUndoMutationFactory, InterceptCellContentPriority, MAX_CELL_PER_SHEET_KEY, MERGE_CELL_INTERCEPTOR_CHECK, MarkDirtyFilterChangeMutation, MarkDirtyRowAutoHeightOperation, MergeCellController, MoveColsCommand, MoveColsMutation, MoveColsMutationUndoFactory, MoveRangeCommand, MoveRangeMutation, MoveRowsCommand, MoveRowsMutation, MoveRowsMutationUndoFactory, NumfmtService, OperatorType, PermissionPointsDefinitions, REF_SELECTIONS_ENABLED, RangeMergeUtil, RangeProtectionCache, RangeProtectionPermissionDeleteProtectionPoint, RangeProtectionPermissionEditPoint, RangeProtectionPermissionManageCollaPoint, RangeProtectionPermissionViewPoint, RangeProtectionRefRangeService, RangeProtectionRenderModel, RangeProtectionRuleModel, RangeProtectionService, RangeThemeStyle, RefRangeService, RefSelectionsService, RefillCommand, RegisterWorksheetRangeThemeStyleCommand, RegisterWorksheetRangeThemeStyleMutation, RemoveColByRangeCommand, RemoveColCommand, RemoveColMutation, RemoveDefinedNameCommand, RemoveMergeUndoMutationFactory, RemoveNumfmtMutation, RemoveRangeThemeMutation, RemoveRowByRangeCommand, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, RemoveSheetMutation, RemoveSheetUndoMutationFactory, RemoveWorksheetMergeCommand, RemoveWorksheetMergeMutation, ReorderRangeCommand, ReorderRangeMutation, ReorderRangeUndoMutationFactory, ResetBackgroundColorCommand, ResetTextColorCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SELECTIONS_ENABLED, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, SHEETS_PLUGIN_CONFIG_KEY, ScrollToCellOperation, SelectRangeCommand, SelectionMoveType, SetBackgroundColorCommand, SetBoldCommand, SetBorderBasicCommand, SetBorderColorCommand, SetBorderCommand, SetBorderPositionCommand, SetBorderStyleCommand, SetColDataCommand, SetColDataMutation, SetColDataMutationFactory, SetColHiddenCommand, SetColHiddenMutation, SetColVisibleMutation, SetColWidthCommand, SetDefinedNameCommand, SetFontFamilyCommand, SetFontSizeCommand, SetFrozenCommand, SetFrozenMutation, SetFrozenMutationFactory, SetGridlinesColorCommand, SetGridlinesColorMutation, SetHorizontalTextAlignCommand, SetItalicCommand, SetNumfmtMutation, SetOverlineCommand, SetProtectionCommand, SetRangeCustomMetadataCommand, SetRangeProtectionMutation, SetRangeThemeMutation, SetRangeValuesCommand, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SetRowDataCommand, SetRowDataMutation, SetRowDataMutationFactory, SetRowHeightCommand, SetRowHiddenCommand, SetRowHiddenMutation, SetRowVisibleMutation, SetSelectedColsVisibleCommand, SetSelectedRowsVisibleCommand, SetSelectionsOperation, SetShrinkToFitCommand, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetStrikeThroughCommand, SetStyleCommand, SetTabColorCommand, SetTabColorMutation, SetTextColorCommand, SetTextRotationCommand, SetTextWrapCommand, SetUnderlineCommand, SetVerticalTextAlignCommand, SetWorkbookNameCommand, SetWorkbookNameMutation, SetWorksheetActivateCommand, SetWorksheetActiveOperation, SetWorksheetColWidthMutation, SetWorksheetColWidthMutationFactory, SetWorksheetColumnCountCommand, SetWorksheetColumnCountMutation, SetWorksheetColumnCountUndoMutationFactory, SetWorksheetDefaultStyleCommand, SetWorksheetDefaultStyleMutation, SetWorksheetDefaultStyleMutationFactory, SetWorksheetHideCommand, SetWorksheetHideMutation, SetWorksheetNameCommand, SetWorksheetNameMutation, SetWorksheetOrderCommand, SetWorksheetOrderMutation, SetWorksheetPermissionPointsCommand, SetWorksheetPermissionPointsMutation, SetWorksheetProtectionCommand, SetWorksheetProtectionMutation, SetWorksheetRangeThemeStyleCommand, SetWorksheetRangeThemeStyleMutation, SetWorksheetRangeThemeStyleMutationFactory, SetWorksheetRightToLeftCommand, SetWorksheetRightToLeftMutation, SetWorksheetRowAutoHeightMutation, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowCountCommand, SetWorksheetRowCountMutation, SetWorksheetRowCountUndoMutationFactory, SetWorksheetRowHeightMutation, SetWorksheetRowHeightMutationFactory, SetWorksheetRowIsAutoHeightCommand, SetWorksheetRowIsAutoHeightMutation, SetWorksheetRowIsAutoHeightMutationFactory, SetWorksheetShowCommand, SheetCopyDownCommand, SheetCopyRightCommand, SheetInterceptorService, SheetLazyExecuteScheduleService, SheetPermissionCheckController, SheetPermissionInitController, SheetRangeThemeModel, SheetRangeThemeService, SheetSkeletonChangeType, SheetSkeletonService, SheetValueChangeType, SheetsFreezeSyncController, SheetsSelectionsService, SplitDelimiterEnum, SplitTextToColumnsCommand, TextToNumberCommand, ToggleCellCheckboxCommand, ToggleGridlinesCommand, ToggleGridlinesMutation, UniverSheetsPlugin, UnregisterWorksheetRangeThemeStyleCommand, UnregisterWorksheetRangeThemeStyleMutation, VALIDATE_CELL, ViewStateEnum, WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCopySheetPermission, WorkbookCreateProtectPermission, WorkbookCreateSheetPermission, WorkbookDeleteColumnPermission, WorkbookDeleteRowPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookInsertColumnPermission, WorkbookInsertRowPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPermissionService, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSelectionModel, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteProtectionPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPermissionService, WorksheetPivotTablePermission, WorksheetProtectionPointModel, WorksheetProtectionRuleModel, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, ZebraCrossingCacheController, addMergeCellsUtil, adjustRangeOnMutation, alignToMergedCellsBorders, attachPrimaryWithCoord, attachRangeWithCoord, attachSelectionWithCoord, baseProtectionActions, checkCellValueType, checkRangesEditablePermission, convertPositionCellToSheetOverGrid, convertPositionSheetOverGridToAbsolute, convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, copyRangeStyles, countCells, createTopMatrixFromMatrix, createTopMatrixFromRanges, defaultLargeSheetOperationConfig, defaultWorkbookPermissionPoints, defaultWorksheetPermissionPoint, deserializeListOptions, discreteRangeToRange, expandToContinuousRange, factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, findAllRectangle, findFirstNonEmptyCell, followSelectionOperation, generateNullCell, generateNullCellValue, getAddMergeMutationRangeByType, getAllRangePermissionPoint, getAllWorkbookPermissionPoint, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel, getCellAtRowCol, getCellType, getCellValue, getClearContentMutationParamForRange, getClearContentMutationParamsForRanges, getDefaultRangePermission, getInsertRangeMutations, getMoveRangeCommandMutations, getMoveRangeUndoRedoMutations, getNextPrimaryCell, getPrimaryForRange, getRemoveRangeMutations, getSelectionsService, getSeparateEffectedRangesOnCommand, getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget, getSkeletonChangedEffectedRange, getValueChangedEffectedRange, getVisibleRanges, handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleCommonDefaultRangeChangeWithEffectRefCommands, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests, handleDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleDeleteRangeMutation, handleIRemoveCol, handleIRemoveRow, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRangeMutation, handleInsertRow, handleMoveCols, handleMoveRange, handleMoveRows, isCellImage, isSingleCellSelection, rangeMerge, rangeToDiscreteRange, rotateRange, runRefRangeMutations, serializeListOptions, setEndForRange, splitRangeText, transformCellsToRange, validateDefinedName };
21440
+ export { AFFECT_LAYOUT_STYLES, AFTER_CELL_EDIT, AUTO_FILL_APPLY_TYPE, AUTO_FILL_DATA_TYPE, AUTO_FILL_HOOK_TYPE, AddMergeRedoSelectionsOperationFactory, AddMergeUndoMutationFactory, AddMergeUndoSelectionsOperationFactory, AddRangeProtectionCommand, AddRangeProtectionMutation, AddRangeThemeMutation, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeMutation, AddWorksheetMergeVerticalCommand, AddWorksheetProtectionCommand, AddWorksheetProtectionMutation, AppendRowCommand, AutoClearContentCommand, AutoFillCommand, AutoFillController, AutoFillRules, AutoFillService, AutoFillTools, BEFORE_CELL_EDIT, BorderStyleManagerService, COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, CalculateResultApplyController, CancelFrozenCommand, CancelMarkDirtyRowAutoHeightOperation, ClearSelectionAllCommand, ClearSelectionContentCommand, ClearSelectionFormatCommand, CopySheetCommand, CopyWorksheetEndMutation, DISABLE_NORMAL_SELECTIONS, DefinedNameDataController, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, DeleteRangeProtectionCommand, DeleteRangeProtectionMutation, DeleteWorksheetProtectionCommand, DeleteWorksheetProtectionMutation, DeleteWorksheetRangeThemeStyleCommand, DeleteWorksheetRangeThemeStyleMutation, DeleteWorksheetRangeThemeStyleMutationFactory, DeltaColumnWidthCommand, DeltaRowHeightCommand, EditStateEnum, EffectRefRangId, EmptyMutation, ExclusiveRangeService, FactoryAddRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, FactorySetRangeProtectionMutation, IAutoFillService, IExclusiveRangeService, INTERCEPTOR_POINT, INumfmtService, IRefSelectionsService, InsertColAfterCommand, InsertColBeforeCommand, InsertColByRangeCommand, InsertColCommand, InsertColMutation, InsertColMutationUndoFactory, InsertDefinedNameCommand, InsertMultiColsLeftCommand, InsertMultiColsRightCommand, InsertMultiRowsAboveCommand, InsertMultiRowsAfterCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowByRangeCommand, InsertRowCommand, InsertRowMutation, InsertRowMutationUndoFactory, InsertSheetCommand, InsertSheetMutation, InsertSheetUndoMutationFactory, InterceptCellContentPriority, MAX_CELL_PER_SHEET_KEY, MERGE_CELL_INTERCEPTOR_CHECK, MarkDirtyFilterChangeMutation, MarkDirtyRowAutoHeightOperation, MergeCellController, MoveColsCommand, MoveColsMutation, MoveColsMutationUndoFactory, MoveRangeCommand, MoveRangeMutation, MoveRowsCommand, MoveRowsMutation, MoveRowsMutationUndoFactory, NumfmtService, OperatorType, PermissionPointsDefinitions, REF_SELECTIONS_ENABLED, RangeMergeUtil, RangeProtectionCache, RangeProtectionPermissionDeleteProtectionPoint, RangeProtectionPermissionEditPoint, RangeProtectionPermissionManageCollaPoint, RangeProtectionPermissionViewPoint, RangeProtectionRefRangeService, RangeProtectionRenderModel, RangeProtectionRuleModel, RangeProtectionService, RangeThemeStyle, RefRangeService, RefSelectionsService, RefillCommand, RegisterWorksheetRangeThemeStyleCommand, RegisterWorksheetRangeThemeStyleMutation, RemoveColByRangeCommand, RemoveColCommand, RemoveColMutation, RemoveDefinedNameCommand, RemoveMergeUndoMutationFactory, RemoveNumfmtMutation, RemoveRangeThemeMutation, RemoveRowByRangeCommand, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, RemoveSheetMutation, RemoveSheetUndoMutationFactory, RemoveWorksheetMergeCommand, RemoveWorksheetMergeMutation, ReorderRangeCommand, ReorderRangeMutation, ReorderRangeUndoMutationFactory, ResetBackgroundColorCommand, ResetTextColorCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SELECTIONS_ENABLED, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, SHEETS_PLUGIN_CONFIG_KEY, ScrollToCellOperation, SelectRangeCommand, SelectionMoveType, SetBackgroundColorCommand, SetBoldCommand, SetBorderBasicCommand, SetBorderColorCommand, SetBorderCommand, SetBorderPositionCommand, SetBorderStyleCommand, SetColDataCommand, SetColDataMutation, SetColDataMutationFactory, SetColHiddenCommand, SetColHiddenMutation, SetColVisibleMutation, SetColWidthCommand, SetDefinedNameCommand, SetFontFamilyCommand, SetFontSizeCommand, SetFrozenCommand, SetFrozenMutation, SetFrozenMutationFactory, SetGridlinesColorCommand, SetGridlinesColorMutation, SetHorizontalTextAlignCommand, SetItalicCommand, SetNumfmtMutation, SetOverlineCommand, SetProtectionCommand, SetRangeCustomMetadataCommand, SetRangeProtectionMutation, SetRangeThemeMutation, SetRangeValuesCommand, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SetRowDataCommand, SetRowDataMutation, SetRowDataMutationFactory, SetRowHeightCommand, SetRowHiddenCommand, SetRowHiddenMutation, SetRowVisibleMutation, SetSelectedColsVisibleCommand, SetSelectedRowsVisibleCommand, SetSelectionsOperation, SetShrinkToFitCommand, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetStrikeThroughCommand, SetStyleCommand, SetTabColorCommand, SetTabColorMutation, SetTextColorCommand, SetTextRotationCommand, SetTextWrapCommand, SetUnderlineCommand, SetVerticalTextAlignCommand, SetWorkbookNameCommand, SetWorkbookNameMutation, SetWorksheetActivateCommand, SetWorksheetActiveOperation, SetWorksheetColWidthMutation, SetWorksheetColWidthMutationFactory, SetWorksheetColumnCountCommand, SetWorksheetColumnCountMutation, SetWorksheetColumnCountUndoMutationFactory, SetWorksheetDefaultStyleCommand, SetWorksheetDefaultStyleMutation, SetWorksheetDefaultStyleMutationFactory, SetWorksheetHideCommand, SetWorksheetHideMutation, SetWorksheetNameCommand, SetWorksheetNameMutation, SetWorksheetOrderCommand, SetWorksheetOrderMutation, SetWorksheetPermissionPointsCommand, SetWorksheetPermissionPointsMutation, SetWorksheetProtectionCommand, SetWorksheetProtectionMutation, SetWorksheetRangeThemeStyleCommand, SetWorksheetRangeThemeStyleMutation, SetWorksheetRangeThemeStyleMutationFactory, SetWorksheetRightToLeftCommand, SetWorksheetRightToLeftMutation, SetWorksheetRowAutoHeightMutation, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowCountCommand, SetWorksheetRowCountMutation, SetWorksheetRowCountUndoMutationFactory, SetWorksheetRowHeightMutation, SetWorksheetRowHeightMutationFactory, SetWorksheetRowIsAutoHeightCommand, SetWorksheetRowIsAutoHeightMutation, SetWorksheetRowIsAutoHeightMutationFactory, SetWorksheetShowCommand, SheetCopyDownCommand, SheetCopyRightCommand, SheetInterceptorService, SheetLazyExecuteScheduleService, SheetPermissionCheckController, SheetPermissionInitController, SheetRangeThemeModel, SheetRangeThemeService, SheetSkeletonChangeType, SheetSkeletonService, SheetValueChangeType, SheetsFreezeSyncController, SheetsSelectionsService, SplitDelimiterEnum, SplitTextToColumnsCommand, TextToNumberCommand, ToggleCellCheckboxCommand, ToggleGridlinesCommand, ToggleGridlinesMutation, UniverSheetsPlugin, UnregisterWorksheetRangeThemeStyleCommand, UnregisterWorksheetRangeThemeStyleMutation, VALIDATE_CELL, ViewStateEnum, WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCopySheetPermission, WorkbookCreateProtectPermission, WorkbookCreateSheetPermission, WorkbookDeleteColumnPermission, WorkbookDeleteRowPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookInsertColumnPermission, WorkbookInsertRowPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPermissionService, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSelectionModel, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteProtectionPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPermissionService, WorksheetPivotTablePermission, WorksheetProtectionPointModel, WorksheetProtectionRuleModel, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, ZebraCrossingCacheController, addMergeCellsUtil, adjustRangeOnMutation, alignToMergedCellsBorders, attachPrimaryWithCoord, attachRangeWithCoord, attachSelectionWithCoord, baseProtectionActions, checkCellValueType, checkRangesEditablePermission, convertPositionCellToSheetOverGrid, convertPositionSheetOverGridToAbsolute, convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, copyRangeStyles, countCells, createTopMatrixFromMatrix, createTopMatrixFromRanges, defaultLargeSheetOperationConfig, defaultWorkbookPermissionPoints, defaultWorksheetPermissionPoint, deserializeListOptions, discreteRangeToRange, expandToContinuousRange, factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, findAllRectangle, findFirstNonEmptyCell, followSelectionOperation, generateNullCell, generateNullCellValue, getAddMergeMutationRangeByType, getAllRangePermissionPoint, getAllWorkbookPermissionPoint, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel, getCellAtRowCol, getCellType, getCellValue, getClearContentMutationParamForRange, getClearContentMutationParamsForRanges, getDefaultRangePermission, getInsertRangeMutations, getMoveRangeCommandMutations, getMoveRangeUndoRedoMutations, getNextPrimaryCell, getPrimaryForRange, getRemoveRangeMutations, getSelectionsService, getSeparateEffectedRangesOnCommand, getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget, getSkeletonChangedEffectedRange, getValueChangedEffectedRange, getVisibleRanges, handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleCommonDefaultRangeChangeWithEffectRefCommands, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests, handleDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleDeleteRangeMutation, handleIRemoveCol, handleIRemoveRow, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRangeMutation, handleInsertRow, handleMoveCols, handleMoveRange, handleMoveRows, isCellImage, isSingleCellSelection, prepareSetRangeValuesMutation, rangeMerge, rangeToDiscreteRange, rotateRange, runRefRangeMutations, serializeListOptions, setEndForRange, splitRangeText, transformCellsToRange, validateDefinedName };