All Downloads are FREE. Search and download functionalities are using the official Maven repository.

a11y-basepackage.src.active-mixin.d.ts Maven / Gradle / Ivy

The newest version!
/**
 * @license
 * Copyright (c) 2021 - 2024 Vaadin Ltd.
 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
 */
import type { Constructor } from '@open-wc/dedupe-mixin';
import type { DisabledMixinClass } from './disabled-mixin.js';
import type { KeyboardMixinClass } from './keyboard-mixin.js';

/**
 * A mixin to toggle the `active` attribute.
 *
 * The attribute is set whenever the user activates the element by a pointer
 * or presses an activation key on the element from the keyboard.
 *
 * The attribute is removed as soon as the element is deactivated
 * by the pointer or by releasing the activation key.
 */
export declare function ActiveMixin>(
  base: T,
): Constructor & Constructor & Constructor & T;

export declare class ActiveMixinClass {
  /**
   * An array of activation keys.
   *
   * See possible values here:
   * https://developer.mozilla.org/ru/docs/Web/API/KeyboardEvent/key/Key_Values
   */
  protected readonly _activeKeys: string[];

  /**
   * Override to define if the component needs to be activated.
   */
  protected _shouldSetFocus(event: KeyboardEvent | MouseEvent): boolean;

  /**
   * Toggles the `active` attribute on the element.
   */
  protected _setActive(active: boolean): void;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy