@elliemae/ds-utilities 3.14.0-next.8 → 3.14.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/algorithms/crossTypeSort.d.ts +5 -0
- package/dist/types/capitalize.d.ts +1 -0
- package/dist/types/compose.d.ts +13 -0
- package/dist/types/deprecated/deprecatedMsg.d.ts +1 -0
- package/dist/types/deprecated/index.d.ts +6 -0
- package/dist/types/deprecated/reactTypesUtility.d.ts +5 -0
- package/dist/types/deprecated/scrollingTimer.d.ts +1 -0
- package/dist/types/deprecated/useParentElement.d.ts +2 -0
- package/dist/types/deprecated/useSetRef.d.ts +2 -0
- package/dist/types/deprecated/useUncontrolled.d.ts +1 -0
- package/dist/types/deprecated/useWindowSize.d.ts +2 -0
- package/dist/types/getComponentFromProps.d.ts +4 -0
- package/dist/types/hooks/index.d.ts +22 -0
- package/dist/types/hooks/useCallbackAfterRender.d.ts +3 -0
- package/dist/types/hooks/useCancellableDelayedCallback.d.ts +3 -0
- package/dist/types/hooks/useDerivedStateFromProps.d.ts +14 -0
- package/dist/types/hooks/useDimensions.d.ts +1 -0
- package/dist/types/hooks/useExecutionTimer.d.ts +3 -0
- package/dist/types/hooks/useExpandState.d.ts +26 -0
- package/dist/types/hooks/useFocusTrap.d.ts +16 -0
- package/dist/types/hooks/useHotkeys.d.ts +15 -0
- package/dist/types/hooks/useHoverHandlersDelay.d.ts +11 -0
- package/dist/types/hooks/useIsMobile.d.ts +1 -0
- package/dist/types/hooks/useIsShowingEllipsis.d.ts +5 -0
- package/dist/types/hooks/useMakeMutable.d.ts +4 -0
- package/dist/types/hooks/useOnBlurOut.d.ts +10 -0
- package/dist/types/hooks/useOnElementResize.d.ts +2 -0
- package/dist/types/hooks/useOnFirstFocusIn.d.ts +16 -0
- package/dist/types/hooks/useOnSpecificFocus.d.ts +10 -0
- package/dist/types/hooks/usePrevious.d.ts +2 -0
- package/dist/types/hooks/useResizeObserver.d.ts +7 -0
- package/dist/types/hooks/useShouldRecalculate.d.ts +2 -0
- package/dist/types/hooks/useWindowScrollerList.d.ts +7 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/objectUtilities.d.ts +2 -0
- package/dist/types/onClickHandlerForNonInteractiveElements.d.ts +8 -0
- package/dist/types/operators.d.ts +14 -0
- package/dist/types/platform.d.ts +2 -0
- package/dist/types/props-helpers/defaultProps/index.d.ts +1 -0
- package/dist/types/props-helpers/defaultProps/useMemoMergePropsWithDefault.d.ts +1 -0
- package/dist/types/props-helpers/getProps/index.d.ts +2 -0
- package/dist/types/props-helpers/globalProps/constants.d.ts +3 -0
- package/dist/types/props-helpers/globalProps/getGlobalAttributes.d.ts +6 -0
- package/dist/types/props-helpers/globalProps/globalAttributesPropTypes.d.ts +363 -0
- package/dist/types/props-helpers/globalProps/index.d.ts +3 -0
- package/dist/types/props-helpers/globalProps/useGetGlobalAttributes.d.ts +3 -0
- package/dist/types/props-helpers/index.d.ts +7 -0
- package/dist/types/props-helpers/propTypes/PropTypes.d.ts +3 -0
- package/dist/types/props-helpers/propTypes/customPropTypes.d.ts +2 -0
- package/dist/types/props-helpers/propTypes/describe.d.ts +3 -0
- package/dist/types/props-helpers/propTypes/describeConversions.d.ts +3 -0
- package/dist/types/props-helpers/propTypes/describeGuards.d.ts +9 -0
- package/dist/types/props-helpers/propTypes/index.d.ts +4 -0
- package/dist/types/props-helpers/propTypes/toTypescript.d.ts +3 -0
- package/dist/types/props-helpers/propTypes/types.d.ts +116 -0
- package/dist/types/props-helpers/tests/globalProps/TestComponent.d.ts +1 -0
- package/dist/types/props-helpers/tests/globalProps/globalAttributes.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/any.validation.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/array.validation.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/boolean.validation.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/function.validation.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/isRequiredIf.validation.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/number.validation.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/object.validation.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/schema.validation.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/string.validation.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/test.schema.d.ts +1 -0
- package/dist/types/props-helpers/tests/validation/union.validation.test.d.ts +1 -0
- package/dist/types/props-helpers/tests/xstyledProps/TestComponent.d.ts +1 -0
- package/dist/types/props-helpers/tests/xstyledProps/xstyledProps.test.d.ts +1 -0
- package/dist/types/props-helpers/useDeprecateComponent/index.d.ts +6 -0
- package/dist/types/props-helpers/validation/errorTemplates.d.ts +2 -0
- package/dist/types/props-helpers/validation/index.d.ts +2 -0
- package/dist/types/props-helpers/validation/typescriptGuards.d.ts +12 -0
- package/dist/types/props-helpers/validation/typescriptParsers.d.ts +1 -0
- package/dist/types/props-helpers/validation/typescriptValidator.d.ts +4 -0
- package/dist/types/props-helpers/xstyledProps/constants.d.ts +7 -0
- package/dist/types/props-helpers/xstyledProps/index.d.ts +2 -0
- package/dist/types/props-helpers/xstyledProps/useGetXstyledProps.d.ts +6 -0
- package/dist/types/props-helpers/xstyledProps/xstyledPropTypes.d.ts +84 -0
- package/dist/types/reactTypesUtility.d.ts +1 -0
- package/dist/types/system.d.ts +7 -0
- package/dist/types/timeUtils.d.ts +7 -0
- package/dist/types/utils.d.ts +28 -0
- package/dist/types/validations.d.ts +27 -0
- package/package.json +2 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type ComparisonTerm = string | number | null | undefined;
|
|
2
|
+
type Direction = 'ASC' | 'DESC';
|
|
3
|
+
type SortCB = Required<Parameters<(typeof Array.prototype)['sort']>>[0];
|
|
4
|
+
export declare const crossTypeSort: (a: ComparisonTerm, b: ComparisonTerm, direction?: Direction) => ReturnType<SortCB>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const capitalize: (string: string) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composes single-argument functions from right to left. The rightmost
|
|
3
|
+
* function can take multiple arguments as it provides the signature for
|
|
4
|
+
* the resulting composite function. [From redux v4.0.5]
|
|
5
|
+
*
|
|
6
|
+
* @param {...Function} funcs The functions to compose.
|
|
7
|
+
* @returns {Function} A function obtained by composing the argument functions
|
|
8
|
+
* from right to left. For example, compose(f, g, h) is identical to doing
|
|
9
|
+
* (...args) => f(g(h(...args))).
|
|
10
|
+
*/
|
|
11
|
+
type UnknownFunctionT = (...args: unknown[]) => unknown;
|
|
12
|
+
export declare const compose: (...funcs: UnknownFunctionT[]) => UnknownFunctionT;
|
|
13
|
+
export default compose;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deprecatedMsg = "is going to be deprecated, please consider removing it from your project";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function isClassComponent(component: any): boolean;
|
|
2
|
+
export declare function isFunctionComponent(component: any): boolean;
|
|
3
|
+
export declare function isReactComponent(component: any): boolean;
|
|
4
|
+
export declare function isElement(element: Record<string, unknown> | null | undefined): boolean;
|
|
5
|
+
export declare function isCompositeTypeElement(element: Record<string, unknown> | null | undefined): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resetTimer: (func: (...args: unknown[]) => unknown) => (this: any, ...args: unknown[]) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useUncontrolled: (...args: any[]) => any;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const getComponentFromProps: (Component: React.ReactElement<PropsWithChildren<unknown>> | React.ComponentType<unknown>, props: Record<string, unknown>, children?: never[]) => JSX.Element | null;
|
|
4
|
+
export default getComponentFromProps;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { default as useMeasure } from 'use-measure';
|
|
2
|
+
export { default as useForceUpdate } from 'use-force-update';
|
|
3
|
+
export { default as useOnClickOutside } from 'use-onclickoutside';
|
|
4
|
+
export { useCallbackAfterRender } from './useCallbackAfterRender';
|
|
5
|
+
export { useCancellableDelayedCallback } from './useCancellableDelayedCallback';
|
|
6
|
+
export { useDerivedStateFromProps } from './useDerivedStateFromProps';
|
|
7
|
+
export { useExecutionTimer } from './useExecutionTimer';
|
|
8
|
+
export { useExpandState } from './useExpandState';
|
|
9
|
+
export { useFocusTrap, UseFocusTrapWithSchema } from './useFocusTrap';
|
|
10
|
+
export { useHotkeys } from './useHotkeys';
|
|
11
|
+
export { useHoverHandlersDelay } from './useHoverHandlersDelay';
|
|
12
|
+
export { useIsMobile } from './useIsMobile';
|
|
13
|
+
export { useIsShowingEllipsis } from './useIsShowingEllipsis';
|
|
14
|
+
export { useMakeMutable } from './useMakeMutable';
|
|
15
|
+
export { useOnBlurOut, UseOnBlurOutWithSchema } from './useOnBlurOut';
|
|
16
|
+
export { useOnElementResize } from './useOnElementResize';
|
|
17
|
+
export { useOnFirstFocusIn, UseOnFirstFocusInWithSchema } from './useOnFirstFocusIn';
|
|
18
|
+
export { useOnSpecificFocus, UseOnSpecificFocusWithSchema } from './useOnSpecificFocus';
|
|
19
|
+
export { usePrevious } from './usePrevious';
|
|
20
|
+
export { useResizeObserver } from './useResizeObserver';
|
|
21
|
+
export { useShouldRecalculate } from './useShouldRecalculate';
|
|
22
|
+
export { useWindowScrollerList } from './useWindowScrollerList';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface ShouldUpdateArg {
|
|
3
|
+
prop: unknown;
|
|
4
|
+
prevProp: unknown;
|
|
5
|
+
stateValue: unknown;
|
|
6
|
+
}
|
|
7
|
+
type OnUpdateT<T> = (prop: T, prevProp?: T | Record<string, never>) => T;
|
|
8
|
+
interface OptionsT<T> {
|
|
9
|
+
onUpdate?: OnUpdateT<T>;
|
|
10
|
+
shouldUpdate?: (arg: ShouldUpdateArg) => boolean;
|
|
11
|
+
updateOnStateChange?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const useDerivedStateFromProps: <T>(prop: T, options?: OptionsT<T>) => [T, React.Dispatch<React.SetStateAction<T>>];
|
|
14
|
+
export default useDerivedStateFromProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDimensions: (domNode: HTMLElement) => DOMRectReadOnly | undefined;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ItemT = Record<string, string>;
|
|
3
|
+
interface UseExpandStateArg {
|
|
4
|
+
items?: ItemT[];
|
|
5
|
+
itemKey?: keyof ItemT;
|
|
6
|
+
expanded?: Record<string, boolean>;
|
|
7
|
+
onExpand: (item: ItemT) => void;
|
|
8
|
+
onExpandChange: (nextState: Record<string, boolean>, item?: ItemT) => void;
|
|
9
|
+
onExpandAll: (nextState: Record<string, boolean>) => void;
|
|
10
|
+
onToggleExpand: (item: ItemT) => void;
|
|
11
|
+
onCollapse: (item: ItemT) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const useExpandState: ({ items, itemKey, expanded: expandedProp, onExpand, onExpandChange, onExpandAll, onToggleExpand, onCollapse, }: UseExpandStateArg) => {
|
|
14
|
+
state: {
|
|
15
|
+
expanded: Record<string, boolean>;
|
|
16
|
+
isExpandedAll: boolean;
|
|
17
|
+
};
|
|
18
|
+
actions: {
|
|
19
|
+
expand: (item: ItemT, stateData?: boolean) => void;
|
|
20
|
+
toggleExpandAll: (stateData?: boolean) => void;
|
|
21
|
+
toggleExpand: (item: ItemT, stateData?: boolean) => void;
|
|
22
|
+
collapse: (item: ItemT) => void;
|
|
23
|
+
};
|
|
24
|
+
setExpanded: import("react").Dispatch<import("react").SetStateAction<Record<string, boolean>>>;
|
|
25
|
+
};
|
|
26
|
+
export default useExpandState;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type UseFocusTrapFunctionT = <T extends HTMLElement = HTMLElement, K extends HTMLElement = HTMLElement>({ firstElementRef, lastElementRef, onKeyDown, }: {
|
|
3
|
+
firstElementRef: React.MutableRefObject<T | null>;
|
|
4
|
+
lastElementRef: React.MutableRefObject<K | null>;
|
|
5
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
6
|
+
}) => (e: KeyboardEvent) => void;
|
|
7
|
+
interface UseFocusTrapT extends UseFocusTrapFunctionT {
|
|
8
|
+
displayName: 'useFocusTrap';
|
|
9
|
+
}
|
|
10
|
+
declare const useFocusTrap: UseFocusTrapT;
|
|
11
|
+
declare const UseFocusTrapWithSchema: import("../props-helpers/propTypes/types").DocumentedReactComponent<{
|
|
12
|
+
firstElementRef: React.MutableRefObject<HTMLElement | null>;
|
|
13
|
+
lastElementRef: React.MutableRefObject<HTMLElement | null>;
|
|
14
|
+
onKeyDown?: ((e: KeyboardEvent) => void) | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
export { useFocusTrap, UseFocusTrapWithSchema };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { KeyHandler } from 'hotkeys-js';
|
|
2
|
+
type Options = {
|
|
3
|
+
scope?: string;
|
|
4
|
+
element?: HTMLElement | null;
|
|
5
|
+
keyup?: boolean | null;
|
|
6
|
+
keydown?: boolean | null;
|
|
7
|
+
splitKey?: string;
|
|
8
|
+
};
|
|
9
|
+
interface UseHotKeysArg {
|
|
10
|
+
keys: string;
|
|
11
|
+
options?: Options;
|
|
12
|
+
handler: KeyHandler;
|
|
13
|
+
}
|
|
14
|
+
export declare const useHotkeys: ({ keys, handler, options }: UseHotKeysArg, deps?: unknown[]) => void;
|
|
15
|
+
export default useHotkeys;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface UseHoverHandlersDelayArg {
|
|
2
|
+
onMouseOver: () => void;
|
|
3
|
+
onMouseLeave: () => void;
|
|
4
|
+
hideDelay?: number;
|
|
5
|
+
showDelay?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const useHoverHandlersDelay: ({ onMouseOver, onMouseLeave, hideDelay, showDelay, }: UseHoverHandlersDelayArg) => {
|
|
8
|
+
onMouseOver: () => void;
|
|
9
|
+
onMouseLeave: () => void;
|
|
10
|
+
};
|
|
11
|
+
export default useHoverHandlersDelay;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsMobile: () => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type OnBlurCb = (e: React.FocusEvent, ...args: unknown[]) => void;
|
|
3
|
+
type UseOnBlurOut = ({ onBlur }: {
|
|
4
|
+
onBlur: OnBlurCb;
|
|
5
|
+
}) => OnBlurCb;
|
|
6
|
+
declare const useOnBlurOut: UseOnBlurOut;
|
|
7
|
+
declare const UseOnBlurOutWithSchema: import("../props-helpers/propTypes/types").DocumentedReactComponent<{
|
|
8
|
+
onBlur: OnBlurCb;
|
|
9
|
+
}>;
|
|
10
|
+
export { useOnBlurOut, UseOnBlurOutWithSchema };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type OnBlurCb = (e: React.FocusEvent, ...args: unknown[]) => void;
|
|
3
|
+
type OnFirstFocusCb = (e: React.FocusEvent, ...args: unknown[]) => void;
|
|
4
|
+
type UseFirstFocusIn = ({ onFirstFocus, onBlur }: {
|
|
5
|
+
onFirstFocus: OnFirstFocusCb;
|
|
6
|
+
onBlur: OnBlurCb;
|
|
7
|
+
}) => {
|
|
8
|
+
onFirstFocus: OnFirstFocusCb;
|
|
9
|
+
onBlur: OnBlurCb;
|
|
10
|
+
};
|
|
11
|
+
declare const useOnFirstFocusIn: UseFirstFocusIn;
|
|
12
|
+
declare const UseOnFirstFocusInWithSchema: import("../props-helpers/propTypes/types").DocumentedReactComponent<{
|
|
13
|
+
onFirstFocus: OnFirstFocusCb;
|
|
14
|
+
onBlur: OnBlurCb;
|
|
15
|
+
}>;
|
|
16
|
+
export { useOnFirstFocusIn, UseOnFirstFocusInWithSchema };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type OnFocusCb = (e: React.FocusEvent, ...args: unknown[]) => void;
|
|
3
|
+
type UseOnBlurOut = ({ onFocus }: {
|
|
4
|
+
onFocus: OnFocusCb;
|
|
5
|
+
}) => OnFocusCb;
|
|
6
|
+
declare const useOnSpecificFocus: UseOnBlurOut;
|
|
7
|
+
declare const UseOnSpecificFocusWithSchema: import("../props-helpers/propTypes/types").DocumentedReactComponent<{
|
|
8
|
+
onFocus: OnFocusCb;
|
|
9
|
+
}>;
|
|
10
|
+
export { useOnSpecificFocus, UseOnSpecificFocusWithSchema };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type HandlerT = (measures: {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}, element: Element) => void;
|
|
6
|
+
export declare const useResizeObserver: (handler: HandlerT, el: HTMLElement) => import("react").Dispatch<import("react").SetStateAction<HTMLElement>>[];
|
|
7
|
+
export default useResizeObserver;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface UseWindowScrollerListArg {
|
|
3
|
+
listInstance: React.RefObject<HTMLElement>;
|
|
4
|
+
outerListRef: React.RefObject<HTMLElement>;
|
|
5
|
+
}
|
|
6
|
+
export declare const useWindowScrollerList: ({ listInstance, outerListRef }: UseWindowScrollerListArg) => void;
|
|
7
|
+
export default useWindowScrollerList;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { default as getComponentFromProps } from './getComponentFromProps';
|
|
2
|
+
export { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements';
|
|
3
|
+
export { capitalize } from './capitalize';
|
|
4
|
+
export { getObjectValuesToArray, getObjectKeysToArray } from './objectUtilities';
|
|
5
|
+
export { checkNotEmpty, checkEmpty, greaterThan, validDate, equal, notEqual, isNull, isNotNull, isIn, isNotIn, greaterThanOrEquals, lessThanOrEquals, startsWith, contains, } from './operators';
|
|
6
|
+
export { cx, runAll, hashArray, safeCall, removeUndefinedProperties, isObject, curry, arrayMove, uniq, filter, uniqBy, groupBy, property, get, set, cloneDeep, debounce, findIndex, isEmpty, isString, isEqual, maxBy, meanBy, noop, omit, orderBy, pull, sortBy, sumBy, transform, isFunction, range, parseInt, padStart, isNaN, values, throttle, toggleInObject, toggleInArray, pick, pickBy, differenceBy, differenceWith, addOrRemove, isEqualWith, isBoolean, } from './utils';
|
|
7
|
+
export { setRef, mergeRefs, setMultipleRefs, logger } from './system';
|
|
8
|
+
export { useMeasure, useForceUpdate, useOnClickOutside, useExecutionTimer, useExpandState, useHotkeys, useHoverHandlersDelay, useResizeObserver, useShouldRecalculate, useWindowScrollerList, usePrevious, useCancellableDelayedCallback, useDerivedStateFromProps, useOnElementResize, useIsShowingEllipsis, useMakeMutable, useCallbackAfterRender, useFocusTrap, UseFocusTrapWithSchema, useIsMobile, useOnBlurOut, UseOnBlurOutWithSchema, useOnFirstFocusIn, UseOnFirstFocusInWithSchema, useOnSpecificFocus, UseOnSpecificFocusWithSchema, } from './hooks';
|
|
9
|
+
export { getVisibleTimeByFormat, addLeadingZeros } from './timeUtils';
|
|
10
|
+
export { compose } from './compose';
|
|
11
|
+
export { DOCUMENT, WINDOW } from './platform';
|
|
12
|
+
export { isDOMTypeElement } from './reactTypesUtility';
|
|
13
|
+
export { isRequired, isGreaterThan, isValidDate } from './validations';
|
|
14
|
+
export { crossTypeSort } from './algorithms/crossTypeSort';
|
|
15
|
+
export * from './deprecated';
|
|
16
|
+
export * from './props-helpers';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare const onClickHandlerForNonInteractiveElements: (onClickHandler: React.MouseEventHandler & React.KeyboardEventHandler) => {
|
|
3
|
+
role: string;
|
|
4
|
+
tabIndex: string;
|
|
5
|
+
onClick: React.MouseEventHandler<Element> & React.KeyboardEventHandler<Element>;
|
|
6
|
+
onKeyPress: (event: React.KeyboardEvent) => void;
|
|
7
|
+
};
|
|
8
|
+
export default onClickHandlerForNonInteractiveElements;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const checkNotEmpty: (value: unknown) => boolean;
|
|
2
|
+
export declare const checkEmpty: (value: unknown) => boolean;
|
|
3
|
+
export declare const greaterThan: (value: number, comparator: number) => boolean;
|
|
4
|
+
export declare const validDate: (value: string) => boolean;
|
|
5
|
+
export declare const equal: (a: unknown, b: unknown) => boolean;
|
|
6
|
+
export declare const notEqual: (a: unknown, b: unknown) => boolean;
|
|
7
|
+
export declare const isNull: (a: unknown) => boolean;
|
|
8
|
+
export declare const isNotNull: (a: unknown) => boolean;
|
|
9
|
+
export declare const isIn: <T>(a: T, b: T[]) => boolean;
|
|
10
|
+
export declare const isNotIn: <T>(a: T, b: T[]) => boolean;
|
|
11
|
+
export declare const greaterThanOrEquals: (value: number, comparator: number) => boolean;
|
|
12
|
+
export declare const lessThanOrEquals: (value: number, comparator: number) => boolean;
|
|
13
|
+
export declare const startsWith: (value: unknown, comparator: string) => boolean;
|
|
14
|
+
export declare const contains: (value: unknown, comparator: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useMemoMergePropsWithDefault';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useMemoMergePropsWithDefault: <T = Record<string, any>>(props: Partial<T>, defaultProps: Partial<T>, compare?: (a: any, b: any) => boolean) => T;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AllHTMLAttributes, AriaAttributes, DOMAttributes, HTMLAttributes } from 'react';
|
|
2
|
+
import type { GlobalAttributes } from './constants';
|
|
3
|
+
export type GlobalAttributesT<T = Element> = AriaAttributes & DOMAttributes<T> & HTMLAttributes<T> & Omit<AllHTMLAttributes<T>, 'as'> & {
|
|
4
|
+
tabIndex?: WCAGTabIndex;
|
|
5
|
+
};
|
|
6
|
+
export declare const getGlobalAttributes: <T, S = Element>(props: T, overrides?: Partial<GlobalAttributes<CallableFunction>>) => GlobalAttributesT<S>;
|