@univerjs/sheets

GitHubEdit on GitHub

Core spreadsheet model and business logic for Univer Sheets.

import { UniverSheetsPlugin } from '@univerjs/sheets'

univer.registerPlugin(UniverSheetsPlugin, IUniverSheetsConfig)

IUniverSheetsConfig

import type { DependencyOverride } from '@univerjs/core'

export interface IUniverSheetsConfig {
  notExecuteFormula?: boolean
  override?: DependencyOverride
  /**
   * Only register the mutations related to the formula calculation. Especially useful for the
   * web worker environment or server-side-calculation.
   */
  onlyRegisterFormulaRelatedMutations?: true
  /**
   * If the row style and column style be set both, and the row style should precede the column style or not.
   */
  isRowStylePrecedeColumnStyle?: boolean

  /**
   * default false, auto height works for merged cells
   */
  autoHeightForMergedCells?: boolean

  /**
   * Whether synchronize the frozen state to other users in real-time collaboration.
   * @default true
   */
  freezeSync?: boolean

  /**
   * Configuration for large sheet operations.
   * When a sheet has more cells than the threshold:
   * - Copy sheet: the mutation will be split into multiple batches
   * - Remove sheet: undo/redo will not be supported
   */
  largeSheetOperation?: ILargeSheetOperationConfig
}

ILargeSheetOperationConfig

import type { DependencyOverride } from '@univerjs/core'

export interface ILargeSheetOperationConfig {
  /**
   * The minimum number of cells that defines a "large sheet".
   * When a sheet has more cells than this threshold:
   * - Copy sheet: the mutation will be split into multiple batches
   * - Remove sheet: undo/redo will not be supported
   * @default 6000
   */
  largeSheetCellCountThreshold?: number

  /**
   * The maximum number of cells per batch when splitting mutations for large sheets.
   * @default 3000
   */
  batchSize?: number
}