Interface IUpdatableSheetView

View settings for a single sheet. Sheets Views in Excel have sheetViews and CustomSheetViews

TODO/Note - Excel has lots of SheetViews concepts. It seems to be due to evolution SheetView - Supports an unnamed list but only the first view seems to be used. This has embedded panes

customWorkbookViews/customSheetViews - Names for SheetViews is managed as the customWorkbookViews level but creates a point via guid to customSheetViews. These are subclasses of sheetView that add hiddenColumns/hiddenRows and filters And ExcelOnline views (365 SheetViews)

Note - We allow a sheet to contain one ISheetModel. All remaining sheetViews must be managed somewhere else. We allow Workbooks to manage sheetViews

interface IUpdatableSheetView {
    addListener: ((listener) => RemoveListener);
    columnHeaderStyle: HeaderTextStyle;
    drawingSelection: readonly IDrawingModel<DrawingJSON>[];
    freezePanes: FreezePanes;
    gridLineColor: AdjustedColor;
    isISheetView: true;
    rowHeaderStyle: HeaderTextStyle;
    selection: CellSelection;
    showColumnGridlines: boolean;
    showColumnHeaders: boolean;
    showFormulas: boolean;
    showRowGridlines: boolean;
    showRowHeaders: boolean;
    showZeros: boolean;
    topLeft: TopLeft;
    zoomScale: number;
    addEventListener(type, listener, options?): RemoveListener;
    fromJSON(json): void;
    selectDrawing(drawing, addToSelection?): void;
    toJSON(): Partial<{
        columnHeaderStyle: string;
        drawingSelection: string | readonly IDrawingModel<DrawingJSON>[] | readonly (string | IDrawingModel<DrawingJSON> | Partial<{
            addListener: string | ((listener) => RemoveListener) | Partial<{}>;
            isAnchoredItem: string | true;
            isDrawing: string | true;
            moveBackward: string | (() => void) | Partial<{}>;
            moveForward: string | (() => void) | Partial<{}>;
            moveToBack: string | (() => void) | Partial<{}>;
            moveToFront: string | (() => void) | Partial<{}>;
            type: string;
            uuid: string;
            zIndex: string | number;
            close: any;
            copyTo?: any;
            delete: any;
            getAnchor: any;
            getAnchorType?: any;
            getBounds: any;
            getDescription: any;
            getName: any;
            getRotation: any;
            isClosed: any;
            isHidden: any;
            isLockAspectRatio: any;
            isProtected: any;
            setAnchorType?: any;
            setBounds: any;
            setDescription: any;
            setHidden: any;
            setLockAspectRatio: any;
            setName: any;
            setRotation: any;
            toJSON?: any;
        }>)[];
        freezePanes: string | FreezePanes | Partial<{
            coords?: string | Partial<CellCoords> | Partial<{
                colIndex?: string | number;
                rowIndex?: string | number;
            }>;
            topLeft?: string | Partial<TopLeft> | Partial<{
                left?: string | number;
                top?: string | number;
            }>;
        }>;
        gridLineColor: string | AdjustedColor | Partial<{
            val: string;
            adjustments: any;
            asCSS: any;
            isEqual: any;
            isImmutable: any;
            toHSLA: any;
            toHex: any;
            toJSON: any;
            toRGBA: any;
            toString: any;
        }>;
        rowHeaderStyle: string;
        selection: string | CellSelection | Partial<{
            activeCoords?: string | CellCoords | Partial<{
                colIndex: string | number;
                rowIndex: string | number;
            }>;
            activeRangeIndex?: string | number;
            ranges?: string | CellRangeCoords[] | (string | CellRangeCoords | Partial<{
                colEnd: (...) | (...);
                colStart: (...) | (...);
                rowEnd: (...) | (...);
                rowStart: (...) | (...);
            }>)[];
        }>;
        showColumnGridlines: string | Partial<boolean>;
        showColumnHeaders: string | Partial<boolean>;
        showFormulas: string | Partial<boolean>;
        showRowGridlines: string | Partial<boolean>;
        showRowHeaders: string | Partial<boolean>;
        showZeros: string | Partial<boolean>;
        topLeft: string | TopLeft | Partial<{
            left: string | number;
            top: string | number;
        }>;
        zoomScale: string | number;
        addEventListener: any;
        selectDrawing: any;
        unselectDrawing: any;
    }>;
    unselectDrawing(drawing): void;
}

Hierarchy (view full)

Properties

addListener: ((listener) => RemoveListener)

Type declaration

columnHeaderStyle: HeaderTextStyle

Style of displaying default row header column Note - This does not affect how formulas are resolved

Default Value

HeaderTextStyle.One
// TODO - allow a function callback (but this won't be persisted)
drawingSelection: readonly IDrawingModel<DrawingJSON>[]

The drawing selection

freezePanes: FreezePanes

The freeze panes.

gridLineColor: AdjustedColor

The color of the gridline on the sheet.

Default Value

null (adopts the app theme color)

Remarks

gridLine color is a sheet view attribute but in Excel is a workbook attribute. If null then use the app theme

isISheetView: true
rowHeaderStyle: HeaderTextStyle

Style of displaying default row header text Note - This does not affect how formulas are resolved

Default Value

HeaderTextStyle.A1
// TODO - allow a function callback (but this won't be persisted)
selection: CellSelection

The current cell selection for the sheet.

showColumnGridlines: boolean

Show/Hide column gridlines.

Default Value

true;
showColumnHeaders: boolean

Show/Hide columns headers.

Default Value

true;
showFormulas: boolean

Indicate if view is showing formulas or values

Default Value

false
showRowGridlines: boolean

Show/Hide row gridlines.

Default Value

true;
showRowHeaders: boolean

Show/Hide row headers.

Default Value

true;
showZeros: boolean

Indicate whether the sheet should show 0 (zero) or blanks in cells containing zero values.

Default Value

true

Remarks

When false, cells with zero value appear blank instead of showing the number zero.

topLeft: TopLeft

The default top left corner accounting for scrolling.

zoomScale: number

Zoom. This is expressed as a percentage. Values can be between 10 (10%) or 400 (400%)

Default Value

100
// TODO - support zoomScaleNormal, zoomScalePageLayout, zoomScaleSheetLayoutView,

Methods

  • Load internal state from json

    Parameters

    • json: Partial<{
          columnHeaderStyle: string;
          drawingSelection: string | readonly IDrawingModel<DrawingJSON>[] | readonly (string | IDrawingModel<DrawingJSON> | Partial<{
              addListener: string | ((listener) => RemoveListener) | Partial<{}>;
              isAnchoredItem: string | true;
              isDrawing: string | true;
              moveBackward: string | (() => void) | Partial<{}>;
              moveForward: string | (() => void) | Partial<{}>;
              moveToBack: string | (() => void) | Partial<{}>;
              moveToFront: string | (() => void) | Partial<{}>;
              type: string;
              uuid: string;
              zIndex: string | number;
              close: any;
              copyTo?: any;
              delete: any;
              getAnchor: any;
              getAnchorType?: any;
              getBounds: any;
              getDescription: any;
              getName: any;
              getRotation: any;
              isClosed: any;
              isHidden: any;
              isLockAspectRatio: any;
              isProtected: any;
              setAnchorType?: any;
              setBounds: any;
              setDescription: any;
              setHidden: any;
              setLockAspectRatio: any;
              setName: any;
              setRotation: any;
              toJSON?: any;
          }>)[];
          freezePanes: string | FreezePanes | Partial<{
              coords?: string | Partial<CellCoords> | Partial<{
                  colIndex?: string | number;
                  rowIndex?: string | number;
              }>;
              topLeft?: string | Partial<TopLeft> | Partial<{
                  left?: string | number;
                  top?: string | number;
              }>;
          }>;
          gridLineColor: string | AdjustedColor | Partial<{
              val: string;
              adjustments: any;
              asCSS: any;
              isEqual: any;
              isImmutable: any;
              toHSLA: any;
              toHex: any;
              toJSON: any;
              toRGBA: any;
              toString: any;
          }>;
          rowHeaderStyle: string;
          selection: string | CellSelection | Partial<{
              activeCoords?: string | CellCoords | Partial<{
                  colIndex: string | number;
                  rowIndex: string | number;
              }>;
              activeRangeIndex?: string | number;
              ranges?: string | CellRangeCoords[] | (string | CellRangeCoords | Partial<{
                  colEnd: (...) | (...);
                  colStart: (...) | (...);
                  rowEnd: (...) | (...);
                  rowStart: (...) | (...);
              }>)[];
          }>;
          showColumnGridlines: string | Partial<boolean>;
          showColumnHeaders: string | Partial<boolean>;
          showFormulas: string | Partial<boolean>;
          showRowGridlines: string | Partial<boolean>;
          showRowHeaders: string | Partial<boolean>;
          showZeros: string | Partial<boolean>;
          topLeft: string | TopLeft | Partial<{
              left: string | number;
              top: string | number;
          }>;
          zoomScale: string | number;
          addEventListener: any;
          selectDrawing: any;
          unselectDrawing: any;
      }>

    Returns void

  • Save internal state to JSON

    Returns Partial<{
        columnHeaderStyle: string;
        drawingSelection: string | readonly IDrawingModel<DrawingJSON>[] | readonly (string | IDrawingModel<DrawingJSON> | Partial<{
            addListener: string | ((listener) => RemoveListener) | Partial<{}>;
            isAnchoredItem: string | true;
            isDrawing: string | true;
            moveBackward: string | (() => void) | Partial<{}>;
            moveForward: string | (() => void) | Partial<{}>;
            moveToBack: string | (() => void) | Partial<{}>;
            moveToFront: string | (() => void) | Partial<{}>;
            type: string;
            uuid: string;
            zIndex: string | number;
            close: any;
            copyTo?: any;
            delete: any;
            getAnchor: any;
            getAnchorType?: any;
            getBounds: any;
            getDescription: any;
            getName: any;
            getRotation: any;
            isClosed: any;
            isHidden: any;
            isLockAspectRatio: any;
            isProtected: any;
            setAnchorType?: any;
            setBounds: any;
            setDescription: any;
            setHidden: any;
            setLockAspectRatio: any;
            setName: any;
            setRotation: any;
            toJSON?: any;
        }>)[];
        freezePanes: string | FreezePanes | Partial<{
            coords?: string | Partial<CellCoords> | Partial<{
                colIndex?: string | number;
                rowIndex?: string | number;
            }>;
            topLeft?: string | Partial<TopLeft> | Partial<{
                left?: string | number;
                top?: string | number;
            }>;
        }>;
        gridLineColor: string | AdjustedColor | Partial<{
            val: string;
            adjustments: any;
            asCSS: any;
            isEqual: any;
            isImmutable: any;
            toHSLA: any;
            toHex: any;
            toJSON: any;
            toRGBA: any;
            toString: any;
        }>;
        rowHeaderStyle: string;
        selection: string | CellSelection | Partial<{
            activeCoords?: string | CellCoords | Partial<{
                colIndex: string | number;
                rowIndex: string | number;
            }>;
            activeRangeIndex?: string | number;
            ranges?: string | CellRangeCoords[] | (string | CellRangeCoords | Partial<{
                colEnd: (...) | (...);
                colStart: (...) | (...);
                rowEnd: (...) | (...);
                rowStart: (...) | (...);
            }>)[];
        }>;
        showColumnGridlines: string | Partial<boolean>;
        showColumnHeaders: string | Partial<boolean>;
        showFormulas: string | Partial<boolean>;
        showRowGridlines: string | Partial<boolean>;
        showRowHeaders: string | Partial<boolean>;
        showZeros: string | Partial<boolean>;
        topLeft: string | TopLeft | Partial<{
            left: string | number;
            top: string | number;
        }>;
        zoomScale: string | number;
        addEventListener: any;
        selectDrawing: any;
        unselectDrawing: any;
    }>