UNPKG

@claromentis/design-system

Version:

Claromentis Design System Component Library

76 lines (75 loc) 2.59 kB
/** * Submit the closest form in the given element's ancestry. * * @see https://github.com/ionic-team/ionic/blob/e5c8c10/core/src/components/button/button.tsx#L110-L131 * @param {HTMLElement} element - The element to submit a form for. * @param {string} [type] - The type of form submission. `'reset'` or `'submit'`, defaults to `'submit'`. * @param {string} [name] - The name of the button to use for the submission. * @param {any} [value] - The value of the button to use for the submission. * @return {void} */ export declare function submitClosestForm(element: HTMLElement, type?: 'reset' | 'submit', name?: string, value?: any): void; /** * Determine whether an element has a Shadow DOM. * * @see https://github.com/ionic-team/ionic/blob/f9483a0/core/src/utils/helpers.ts#L13-L15 * @param {HTMLElement} element - The element to detect Shadow DOM for. * @return {boolean} - Whether the element has a Shadow DOM. */ export declare function hasShadowDom(element: HTMLElement): boolean; /** * Propagate a focus event on a given element. * * @param {HTMLElement} element - The element to propagate the focus event on. * @param {FocusEvent} event - The focus event to propagate. */ export declare function propagateFocusEvent(element: HTMLElement, event: FocusEvent): void; /*** * Polyfill for IE11 missing NodeList.forEach */ export declare function NodeListForEachIe11(): void; /** * Finds the cla-label within cla-item * * @param {HTMLElement} componentEl * @return {componentEl.label} */ export declare function findItemLabel(componentEl: any): any; /** * Is the cla-picker-group multiselectable or not * * @param {HTMLElement} componentEl * * */ export declare function pickerGroupMultiselect(componentEl: HTMLElement): boolean; /** * Is the cla-nav inline or block * * @param {HTMLElement} componentEl */ export declare function claNavInline(componentEl: HTMLElement): boolean; /** * Is the cla-card-image aspect ratio fixed * * @param {HTMLElement} componentEl */ export declare function claImgFixed(componentEl: HTMLElement): boolean; /*** * check if element is in the viewport * @param {Element} elem * @return {boolean} is the element within the viewport? */ export declare function isInViewport(elem: Element): boolean; /*** * finds the pixel width of text * @param {String} text * @return {Integer} */ export declare function textWidth(text: string): number; /*** * determines whether a colour value is light or dark * @param HSL, HEX or RGB color * @return {String} */ export declare function lightOrDark(color: any): "light" | "dark";