Class CustomScrollKeyboardPlugin<StaticProps, ChangeableProps, CallbacksTypes>

CustomScrollKeyboardPlugin adds keyboard navigation functionality to the CustomScroll component. It allows scrolling the container using keyboard arrow keys, space bar, page up/down, home, end, and tab.

Type Parameters

Hierarchy

  • Plugin<StaticProps, ChangeableProps, CallbacksTypes, CustomScroll>
    • CustomScrollKeyboardPlugin

Constructors

Accessors

  • get component(): Component
  • Retrieves the component to which this plugin is attached.

    Returns Component

  • set component(value): void
  • Sets the component for this plugin. This method is called by the parent component when the plugin is added.

    Parameters

    • value: Component

    Returns void

  • get isDestroyed(): boolean
  • Checks if the module has been destroyed.

    Returns boolean

  • get isInitialized(): boolean
  • Checks if the module has been initialized.

    Returns boolean

  • get name(): string
  • The name of the module, derived from the class name

    Returns string

  • get prefix(): string
  • Optional prefix for class names used by the module

    Returns string

  • get props(): TRequiredModuleProp<StaticProps & ChangeableProps>
  • The current properties of the module, which include both static and changeable properties. These can be retrieved dynamically during the module's lifecycle.

    Returns TRequiredModuleProp<StaticProps & ChangeableProps>

Methods

  • Adds a custom callback to the module.

    Type Parameters

    • T extends string | number | symbol

    Parameters

    • target: T

      The event type to listen for (e.g., 'propsChange', 'destroy').

    • action: TAction<CallbacksTypes[T]>

      The function to execute when the event is triggered.

    • settings: ISettings = {}

      Additional settings for the callback.

    Returns IAddedCallback

  • Adds a DOM event listener that will be automatically removed when the module is destroyed.

    Type Parameters

    • Target extends keyof HTMLElementEventMap

    • Listener extends ((event) => void)

    Parameters

    • element: Document | Element | Window

      The target element for the event listener.

    • target: Target

      The event type to listen for (e.g., 'click', 'resize').

    • callback: Listener

      The callback function to execute when the event is triggered.

    • Optional options: boolean | AddEventListenerOptions

      Additional options for the event listener.

    Returns (() => void)

      • (): void
      • Returns void

  • Adds a viewport callback that will be automatically removed when the module is destroyed.

    Parameters

    • target: keyof IViewportCallbackTypes

      The viewport target (e.g., width or height).

    • action: (() => void)

      The callback function to execute when the viewport target changes.

        • (): void
        • Returns void

    • data: undefined | ISettings = {}

      Additional data for the callback.

    Returns void

  • Updates the changeable properties of the module.

    Parameters

    • props: Partial<ChangeableProps>

      The properties to be updated.

    Returns void

  • Initializes the plugin and ensures it is properly associated with a component. If the component is not set before calling init, it throws an error.

    Returns void

    Throws

    If component is not set.