UNPKG

@eclipse-scout/core

Version:
41 lines 2.44 kB
import { Widget } from '../index'; export declare const widgets: { /** * @param $elem HTML or jQuery element to find the corresponding widget for * @returns the widget for the given element. If the element is not linked with a widget directly, it searches its ancestors for the widget. */ get($elem: HTMLElement | JQuery): Widget; /** * Creates a "unique" id which may be used in the id attribute of an HTML element. * <p> * It actually just increases a sequence number prefixed by 'sc' or the given prefix. * 'sc' (short for Scout) is added to reduce the possibility of a duplication * if scout widgets are embedded into a foreign website which already uses numbers in its id attributes. * So it is not unique but should be good enough when you know what you are doing. */ createUniqueId(prefix: string): string; /** * Iterates through the given widgets and toggles the 'first' and 'last' classes on the corresponding widgets if the widgets are visible and rendered. */ updateFirstLastMarker(widgets: Widget[]): void; /** * @param widgets the widgets to check. * @param container if specified, the function returns null if the container is not visible or not rendered. This allows for an early return without the need to check every given widget. * @param checkTabbable if true, the resulting widget has to be tabbable, not only focusable. Default is true. * @returns the first widget of the given list which is focusable (and tabbable, unless checkTabbable is set to false). */ findFirstFocusableWidget(widgets: Widget[], container?: Widget, checkTabbable?: boolean): Widget; /** * Sets a property using the given setter after reading the value using the getter and preserving it on the preserver using the preserverName. * The preserved property can be reset using {@link resetProperty}. */ preserveAndSetProperty(setter: () => void, getter: () => any, preserver: object, preserverName: string): void; /** * Resets a property that has been preserved on the preserver by {@link preserveAndSetProperty} using the given setter. Sets the preserved property to null afterwards. * @param setter * @param preserver * @param preserverName */ resetProperty(setter: (value) => void, preserver: object, preserverName: string): void; }; //# sourceMappingURL=widgets.d.ts.map