Base implementation of

Implements

Constructors

Accessors

Methods

  • Free all resources associated with the sheet and mark as read-only.

    Returns void

    Remarks

    This is called by workbooks when the workbook is is closed. This is different than delete which removes the sheet from the workbook.

    See

    ISheetModel.addListener for closeEvent

  • Returns a list of items for the given types. If no options is provided then it will return counts for the select range. If there given address is empty then this will return null.

    Parameters

    • Optional address: string | CellCoords | Partial<CellRangeCoords>
    • Optional types: Record<CountCellItemType, number | boolean>

      The types will be used to filter the results. If a number is provided this will be a max number If a boolean is provided this will be a statement to include/exclude

    Returns Record<CountCellItemType, number>

    Remarks

    Some uses cases for this are checking for data to delete a sheet, checking for multiple values for merges, or displaying stats.

  • Creates a cell that is not including at a coordinate but adopts all rendering. Useful for previewing values such as tooltip. If the coords are passed it will return a disconnect cell update for that value.

    Parameters

    Returns ICellModel

    a detached ICellModel

    Remarks

    This does not add to the sheet but provides a standalone ICellModel.

  • This removes from a container if one is in use.

    Returns void

  • Returns the next coord in a given direction that has a value within the sheet.

    Parameters

    Returns number

    Remarks

    This will skip cells with styling but no value.

  • Returns an immutable cell from the specified address. This can be either a CellCoord or a case insensitive 'a1' style string reference. If no address is specified then the current selection is used.

    Parameters

    Returns ICellModel

    Remarks

    Will never return null.

  • Returns the minimum bounds that includes all cell data.

    Parameters

    • includeHeaders: boolean = false

      include custom headers in sizing.

    • includeHidden: boolean = false

      include cells in hidden headers.

    Returns CellRangeCoords

    Remarks

    This is guaranteed to always return at least a single cell. This will returns cells that have either styling or a value.

    Default Value

    false
    

    Default Value

    false
    
  • Return the total drawings available. This is useful for quick escape of searching drawings.

    Returns number

  • A display name for the sheet.

    Returns string

    Remarks

    This is readonly from the sheet and is set via the container, usually an IWorkbook.

  • Returns all overflowed cells with the given range. If a null range is provided then all overflowed calls will be returned.

    Parameters

    • Optional address: CellRangeCoordsAddress

      A string or CellRangeCoords.

    • includeHidden: boolean = false

      defaults to false. If overflowed should also return hidden. TODO - This needs to be moved to view since it's dependant on scale

    Returns OverflowedCell[]

  • insert cells at the range. By default the values will direction in whichever direction the selection shape is smaller. For example a selection with a 5 column by 1 row will direction Down (rows). Note - This will error if direction data will fall outsize of the max sheet size

    Parameters

    Returns void

    Default Value

    'based on the selection shape'
    
  • Determine if dates should be 1904 instead of 1900 based

    Returns boolean

  • Returns true if the sheet has been closed.

    Returns boolean

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Returns void

  • Parameters

    Returns void

  • Begins a transaction but puts it onto a global stack. This will batch all 'transactional' changes until they have all be committed or rolled back.

    Parameters

    • Optional description: string

    Returns ITransaction

    Remarks

    Any changes that are made to this object will be reflected in the local sheet but not committed to the transactional store until the batch is popped.

  • Remove cells at a range. This is different than clearing cells in that it direction value up or left.

    Parameters

    Returns void

    Default Value

    'based on the selection shape'
    
  • Sets a collection of Cells in a single batch/transaction.

    This allows for an array of different values to be set as a single update. This is useful for non-contiguous updates and greatly improves performance over setting individually.

    Parameters

    Returns void

  • Set the protection. This will merge with existing protection.

    Parameters

    Returns void

    Remarks

    Pass null to clear all protections.

  • See the tab color for the sheet.

    Parameters

    Returns void

    Remarks

    The tab color is not used by the sheet but rather by the workbook.

  • Set the view specific properties. This will merge with existing view.

    Parameters

    Returns void

  • Create a table at the given range. If the range is already a table then it will be updated.

    Parameters

    • address: CellRangeCoordsAddress
    • Optional update: Partial<{
          autoFilter?: string | AutoFilter | Partial<{
              filterColumns?: any;
              ref?: string;
              sortState?: any;
          }>;
          columns?: string | TableColumn[] | (string | TableColumn | Partial<{
              name: string;
          }>)[];
          displayName?: string;
          headerRowCount?: string | number;
          name: string;
          ref: string | CellRangeCoords | Partial<{
              colEnd: string | number;
              colStart: string | number;
              rowEnd: string | number;
              rowStart: string | number;
          }>;
          sortState?: any;
          styleInfo?: string | TableStyleInfo | Partial<{
              name: string;
              showColumnStripes?: string | Partial<boolean>;
              showFirstColumn?: string | Partial<boolean>;
              showLastColumn?: string | Partial<boolean>;
              showRowStripes?: string | Partial<boolean>;
          }>;
          totalsRowCount?: string | number;
      }>
    • Optional options: ModifyTableSetOptions

    Returns ITableModel

    Remarks

    If no update is passed in then a default table will be create. If a ref is not specified then the range will be used as the ref. If a ref is specified then the rowStart of ref must match the range or an error will occur.