SheetXL - v1.0.2
    Preparing search index...

    Interface IItemSelection<T>

    A selection of items that stand in a tree: drawings on a sheet and the members of groups, or the elements of a chart. What a selection of either kind does is here; what each kind adds is on its own interface (IMovableSelection, IChartElementSelection).

    Every selected item has the same parent, its container. Selecting an item from another container replaces the selection, as Excel's does: a shape and a member of a group cannot be selected together, nor a chart's title and a point of one of its series.

    The latest item picked is the active one, the one a Format pane shows.

    interface IItemSelection<T extends IItemSelection.Item> {
        addListeners(
            listeners: IItemSelection.IListeners<T>,
            options?: IListener.Options,
        ): Remove;
        clear(): this;
        getActive(): T | null;
        getContainer(): T | null;
        getItems(): readonly T[];
        isEmpty(): boolean;
        isEquals(other: IItemSelection<T>): boolean;
        isSelected(item: T): boolean;
        select(items: readonly T[], options?: IItemSelection.SelectOptions): this;
        traverse(reverse?: boolean): this;
        unselect(items: readonly T[]): this;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index
    • Empties the selection.

      Returns this

    • Returns the item selected most recently, or null when the selection is empty.

      Returns T | null

    • Returns what every selected item shares as its parent: null for the root (the sheet, the chart), else the group or element they are in.

      Returns T | null

      null when the selection is empty.

    • Returns the selected items, in the order the selection keeps them.

      Returns readonly T[]

    • Returns true if nothing is selected.

      Returns boolean

    • Returns true if other selects the same items, with the same one active.

      Parameters

      Returns boolean

    • Returns true if item is selected.

      Parameters

      • item: T

      Returns boolean

    • Selects items, replacing the selection.

      Parameters

      • items: readonly T[]

        The items to select, the last one the active one.

      • Optionaloptions: IItemSelection.SelectOptions

        With add, extends the selection instead.

      Returns this

      Items are taken in order, as picks: one in another container than those selected before it replaces them.

      If an item cannot be selected here: it is not where this selection looks, or has been removed.

    • Selects the next item, alone: what pressing Tab does.

      Parameters

      • Optionalreverse: boolean

        Selects the previous one instead.

      Returns this

      Wraps at the ends. With nothing selected, starts from the first (or, in reverse, the last).

    • Removes items from the selection. Items not selected are ignored.

      Parameters

      • items: readonly T[]

      Returns this