import { OnDestroy, OnInit } from '@angular/core'; import * as i0 from "@angular/core"; /** * @TailwindNG Component's base props. */ export interface BaseProps { /** * A property to customize the component's style. * * Get the final class list value using: * - `.classList.value` or * - `.nativeElement.className`. */ readonly class: string | null; /** * A reference to the component's native element. */ readonly nativeElement: T; /** * Whether the component is disabled. */ readonly disabled: boolean; /** * Whether the component is focused. */ readonly isFocused: boolean; /** * Whether the component or one of its descendant has focus. */ readonly hasFocus: boolean; /** * Whether the component has visual focus. */ readonly hasVisualFocus: boolean; /** * Whether the component is hovered. */ readonly isHovered: boolean; } /** * @TailwindNG Component's base actions. */ export interface BaseActions { /** * Focuses an element and return it. * If it cannot be focused, nothing is done and `undefined` is returned. */ focus(options?: FocusOptions): HTMLElement | undefined; /** * Sets visual focus on an element and return it. * If it cannot be visual focused, nothing is done and `undefined` is returned. * Visual focus is set by adding the `data-visual-focused` attribute on that element. * @NOTE The visual focus appearance should be defined in the component's style/config. */ setVisualfocus(options: FocusOptions): HTMLElement | undefined; /** * Removes visual focus on target element. * * Default target is the component's native element. */ removeVisualfocus(target?: HTMLElement): void; /** * Scrolls element into the view. Making it visible to the user. */ scrollIntoView(options?: ScrollIntoViewOptions, element?: HTMLElement): void; } type FocusBehavior = 'self' | 'nextSibling' | 'previousSibling' | 'firstChild' | 'lastChild'; /** * Focus options. */ export interface FocusOptions { /** * The target element to focus. Default is the component's native element. */ target?: HTMLElement; /** * The focus behavior. * - `self`: Focus the component's itself. (default) * - `nextSibling`: Focus the target's next sibling. * - `previousSibling`: Focus the target's previous sibling. * - `firstChild`: Focus the target's first child. * - `lastChild`: Focus the target's last child. * */ behavior?: FocusBehavior; /** * Whether to prevent scrolling the target element into view. Default it's true. */ preventScroll?: boolean; } /** * @TailwindNG Base component directive. */ export declare abstract class BaseDirective implements BaseProps, BaseActions, OnInit, OnDestroy { readonly nativeElement: T; protected readonly _document: Document; private readonly _injector; private _isInitialized; protected get isInitialized(): boolean; class: string | null; private _isDisabled; set disabled(value: boolean | ''); get disabled(): boolean; get isFocused(): boolean; get hasFocus(): boolean; get isHovered(): boolean; ngOnInit(): void; ngOnDestroy(): void; /** * Build the component's style. * @NOTE This method automatically runs inside an injection context, only during the component's initialization. If you have injected dependencies and want to call this method manually, make sure to run it inside an injection context using `runInInjectionContext` Angular's function for instance. */ protected abstract buildStyle(): void; /** * Adds event listeners to the component. * * This method is called during the component's initialization. * Override this method to add additional event listeners. * Those listeners will be removed when the component is destroyed. */ protected addEventListeners(): void; /** * Removes event listeners from the component. * * This method is called when the component is destroyed. * Override this method to remove additional event listeners. */ protected removeEventListeners(): void; protected preventInteractionIfDisabled(event: Event): void; protected onKeyboardEvent(event: KeyboardEvent): void; focus(options?: FocusOptions): HTMLElement | undefined; private currentVisualFocusedElement?; setVisualfocus(options?: FocusOptions): HTMLElement | undefined; removeVisualfocus(target?: HTMLElement): void; scrollIntoView(options?: ScrollIntoViewOptions, element?: HTMLElement): void; get hasVisualFocus(): boolean; private isDisabledElement; /** * Generates a basic random ID. */ protected randomId(prefix?: string): string; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, { "class": { "alias": "class"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>; } export {};