@skyux/core
Version:
This library was generated with [Nx](https://nx.dev).
77 lines (76 loc) • 3.87 kB
TypeScript
import { ElementRef, RendererFactory2 } from '@angular/core';
import { SkyBreakpoint } from '../breakpoint-observer/breakpoint';
import { SkyMediaBreakpoints } from '../media-query/media-breakpoints';
import { SkyFocusableChildrenOptions } from './focusable-children-options';
import * as i0 from "@angular/core";
export declare class SkyCoreAdapterService {
#private;
constructor(rendererFactory: RendererFactory2);
/**
* Set the responsive container CSS class for a given element.
*
* @param elementRef - The element that will receive the new CSS class.
* @param breakpoint - The breakpoint to determine which class gets set.
* For example a breakpoint of "xs" will set a CSS class of "sky-responsive-container-xs".
* @deprecated Use the `SkyResponsiveHostDirective` instead.
*/
setResponsiveContainerClass(elementRef: ElementRef, breakpoint: SkyBreakpoint | SkyMediaBreakpoints): void;
/**
* This method temporarily enables/disables pointer events.
* This is helpful to prevent iFrames from interfering with drag events.
*
* @param enable - Set to `true` to enable pointer events. Set to `false` to disable.
*/
toggleIframePointerEvents(enable: boolean): void;
/**
* Focuses on the first element found with an `autofocus` attribute inside the supplied `elementRef`.
*
* @param elementRef - The element to search within.
* @return Returns `true` if a child element with autofocus is found.
*/
applyAutoFocus(elementRef?: ElementRef): boolean;
/**
* Sets focus on the first focusable child of the `elementRef` parameter.
* If no focusable children are found, and `focusOnContainerIfNoChildrenFound` is `true`,
* focus will be set on the container element.
*
* @param elementRef - The element to search within.
* @param containerSelector - A CSS selector indicating the container that should
* receive focus if no focusable children are found.
* @param focusOnContainerIfNoChildrenFound - It set to `true`, the container will
* receive focus if no focusable children are found.
*/
getFocusableChildrenAndApplyFocus(elementRef: ElementRef, containerSelector?: string, focusOnContainerIfNoChildrenFound?: boolean): void;
/**
* Returns an array of all focusable children of provided `element`.
*
* @param element - The HTMLElement to search within.
* @param options - Options for getting focusable children.
*/
getFocusableChildren(element?: HTMLElement, options?: SkyFocusableChildrenOptions): HTMLElement[];
/**
* Returns the clientWidth of the provided elementRef.
* @param elementRef - The element to calculate width from.
*/
getWidth(elementRef: ElementRef): number;
/**
* Checks if an event target has a higher z-index than a given element.
* @param target The event target element.
* @param element The element to test against. A z-index must be explicitly set for this element.
*/
isTargetAboveElement(target: EventTarget, element: HTMLElement): boolean;
/**
* Remove inline height styles from the provided elements.
* @param elementRef - The element to search within.
* @param selector - The CSS selector to use when finding elements for removing height.
*/
resetHeight(elementRef: ElementRef, selector: string): void;
/**
* Sets all element heights to match the height of the tallest element.
* @param elementRef - The element to search within.
* @param selector - The CSS selector to use when finding elements for syncing height.
*/
syncMaxHeight(elementRef: ElementRef, selector: string): void;
static ɵfac: i0.ɵɵFactoryDeclaration<SkyCoreAdapterService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<SkyCoreAdapterService>;
}