UNPKG

@stimulus-library/controllers

Version:

A library of useful controllers for Stimulus

36 lines (35 loc) 1.21 kB
import { BaseController } from "@stimulus-library/utilities"; export type ToggleClassMode = "on" | "off" | "toggle"; export declare class ToggleClassController extends BaseController { static targets: string[]; static values: { class: StringConstructor; mouseEnter: StringConstructor; mouseLeave: StringConstructor; clickAway: BooleanConstructor; initial: StringConstructor; }; readonly toggleTargets: HTMLElement[]; readonly classValue: string; readonly hasClassValue: boolean; readonly mouseEnterValue: ToggleClassMode; readonly hasMouseEnterValue: boolean; readonly mouseLeaveValue: ToggleClassMode; readonly hasMouseLeaveValue: boolean; readonly clickAwayValue: boolean; readonly hasClickAwayValue: boolean; readonly initialValue: "on" | "off"; readonly hasInitialValue: boolean; connect(): void; clickOutside(): void; mouseEnter(): {}; mouseLeave(): {}; on(_event?: Event): void; off(_event?: Event): void; toggle(_event?: Event): void; private _elementWasToggled; private _elementToggleStatus; private _elementToggle; private _elementOn; private _elementOff; }