UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

51 lines (50 loc) 2.91 kB
/** * Component helpers * */ import React from 'react'; import keycode from './keycode'; import { warn } from './helpers'; import { getClosestParent } from './helpers/getClosest'; export * from './legacy/component-helper-legacy'; export { InteractionInvalidation } from './helpers/InteractionInvalidation'; export { extendPropsWithContext, extendPropsWithContextInClassComponent, } from './helpers/extendPropsWithContext'; export { assignPropsWithContext } from './helpers/assignPropsWithContext'; export { filterProps } from './helpers/filterProps'; export { keycode, getClosestParent, warn }; export declare const validateDOMAttributes: (props: any, params: any) => any; /** @deprecated Can be removed in v11 */ export declare const extendGracefully: (...objects: any[]) => any; export declare function isObject(item: any): boolean; export declare function extendDeep(target?: {}, ...sources: any[]): {}; export declare const isTrue: (value: any) => boolean; export declare const dispatchCustomElementEvent: (src: any, eventName: any, eventObjectOrig?: any) => any; export declare const toCamelCase: (s: any) => any; export declare const toPascalCase: (s: any) => any; export declare const toSnakeCase: (str: any) => any; export declare const toKebabCase: (str: any) => any; export declare function toCapitalized(str: any): any; export declare const makeUniqueId: (prefix?: string, length?: number) => string; export declare const slugify: (s: any) => string; export declare const matchAll: (string: any, regex: any) => any[]; /** * Check if an element exists in its children * If it finds it, the child "element" of target will be returned. * * @param {HTMLElement} element The DOM Element to find * @param {HTMLElement} target The DOM Element that should contain "element" * @param {function} callback (optional) * @returns {HTMLElement | null} Returns the found child of all existing dom elements inside of "target" */ export declare const isChildOfElement: (element: any, target: any, callback?: any) => any; export declare const roundToNearest: (num: any, target: any) => any; export declare const getClosestScrollViewElement: (currentElement: any) => Element; export declare function convertJsxToString(elements: React.ReactNode | React.ReactNode[], separator?: string, transformWord?: (element: React.ReactElement) => React.ReactElement<unknown>): string; export declare function convertStatusToStateOnly(status: any, state: any): any; export declare function getStatusState(status: any): boolean; export declare function combineLabelledBy(...params: any[]): any; export declare function combineDescribedBy(...params: any[]): any; export declare function combineDetails(...params: any[]): any; export declare function findElementInChildren(children: any, find: any): any; export declare function escapeRegexChars(str: any): any; export declare function removeUndefinedProps(object: any): any;