UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

84 lines (83 loc) 2.21 kB
/** * Web InputMasked Component * */ import React from 'react'; /** * Takes all component properties and filters out all internal used properties * * @returns object {props, htmlAttributes} */ export declare const useFilteredProps: () => { props: any; htmlAttributes: Readonly<Record<string, unknown>>; }; /** * Returns locale from either component or context * * @returns String */ export declare const useTranslation: () => string; /** * Handle internal value state * * It handles both the value state given as a prop form outside, * along with the current written and internal value. * * @returns object with internal value state and state setter */ export declare const useLocalValue: () => { localValue: string; setLocalValue: React.Dispatch<React.SetStateAction<string>>; }; /** * Create createNumberMask if number mask parameters exists * * @returns mask function */ export declare const useNumberMask: () => import("./addons/createNumberMask").NumberMaskFunction; /** * Returns either internal mask or given property mask * * @returns mask function */ export declare const useMask: () => any; /** * Returns the final mask params * * @returns mask params */ export declare const useMaskParams: () => any; /** * Handle the TextMask dependency * * @returns React Element */ export declare const useInputElement: () => (params: Record<string, unknown>, innerRef: { current: HTMLInputElement | null; }) => import("react/jsx-runtime").JSX.Element; /** * Will map some events we need to map during typing * * @param {object} param0 * @property {function} setLocalValue setState handler * @returns object of events to handle */ export declare const useEventMapping: ({ setLocalValue }: { setLocalValue: any; }) => { onBeforeInput: (event: any) => any; onInput: (event: any) => any; onFocus: (params: any) => any; onBlur: (params: any) => any; onMouseUp: (event: any) => any; onMouseDown: (event: any) => any; onKeyDown: (params: any) => any; onSubmit: (params: any) => any; onChange: (params: any) => any; on_focus: any; on_blur: any; on_key_down: any; on_submit: any; on_change: any; };