@elliemae/ds-utilities 2.3.0-alpha.8 → 2.3.0-alpha.9
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/capitalize.d.ts +1 -0
- package/dist/types/compose.d.ts +12 -0
- package/dist/types/getComponentFromProps.d.ts +3 -0
- package/dist/types/hooks/index.d.ts +19 -0
- package/dist/types/hooks/useCancellableDelayedCallback.d.ts +2 -0
- package/dist/types/hooks/useDerivedStateFromProps.d.ts +2 -0
- package/dist/types/hooks/useExecutionTimer.d.ts +2 -0
- package/dist/types/hooks/useExpandState.d.ts +23 -0
- package/dist/types/hooks/useHotkeys.d.ts +6 -0
- package/dist/types/hooks/useHoverHandlersDelay.d.ts +10 -0
- package/dist/types/hooks/useIsShowingEllipsis.d.ts +5 -0
- package/dist/types/hooks/useOnElementResize.d.ts +2 -0
- package/dist/types/hooks/useParentElement.d.ts +1 -0
- package/dist/types/hooks/usePrevious.d.ts +2 -0
- package/dist/types/hooks/useResizeObserver.d.ts +3 -0
- package/dist/types/hooks/useSetRef.d.ts +2 -0
- package/dist/types/hooks/useShouldRecalculate.d.ts +2 -0
- package/dist/types/hooks/useWindowScrollerList.d.ts +5 -0
- package/dist/types/hooks/useWindowSize.d.ts +2 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/onClickHandlerForNonInteractiveElements.d.ts +12 -0
- package/dist/types/operators.d.ts +31 -0
- package/dist/types/platform.d.ts +2 -0
- package/dist/types/reactTypesUtility.d.ts +6 -0
- package/dist/types/scrollingTimer.d.ts +1 -0
- package/dist/types/system.d.ts +3 -0
- package/dist/types/timeUtils.d.ts +7 -0
- package/dist/types/utils.d.ts +23 -0
- package/dist/types/validations.d.ts +23 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const capitalize: (string: string) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
export declare const compose: (...funcs: any[]) => any;
|
|
12
|
+
export default compose;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { useUncontrolled } from 'uncontrollable';
|
|
5
|
+
export { useExecutionTimer } from './useExecutionTimer';
|
|
6
|
+
export { useExpandState } from './useExpandState';
|
|
7
|
+
export { useHotkeys } from './useHotkeys';
|
|
8
|
+
export { useHoverHandlersDelay } from './useHoverHandlersDelay';
|
|
9
|
+
export { useResizeObserver } from './useResizeObserver';
|
|
10
|
+
export { useShouldRecalculate } from './useShouldRecalculate';
|
|
11
|
+
export { useWindowScrollerList } from './useWindowScrollerList';
|
|
12
|
+
export { useWindowSize } from './useWindowSize';
|
|
13
|
+
export { usePrevious } from './usePrevious';
|
|
14
|
+
export { useCancellableDelayedCallback } from './useCancellableDelayedCallback';
|
|
15
|
+
export { useDerivedStateFromProps } from './useDerivedStateFromProps';
|
|
16
|
+
export { useSetRef } from './useSetRef';
|
|
17
|
+
export { useParentElement } from './useParentElement';
|
|
18
|
+
export { useOnElementResize } from './useOnElementResize';
|
|
19
|
+
export { useIsShowingEllipsis } from './useIsShowingEllipsis';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const useExpandState: ({ items, itemKey, expanded: expandedProp, onExpand, onExpandChange, onExpandAll, onToggleExpand, onCollapse, }: {
|
|
2
|
+
items?: never[] | undefined;
|
|
3
|
+
itemKey?: string | undefined;
|
|
4
|
+
expanded?: {} | undefined;
|
|
5
|
+
onExpand: any;
|
|
6
|
+
onExpandChange?: (() => null) | undefined;
|
|
7
|
+
onExpandAll?: (() => null) | undefined;
|
|
8
|
+
onToggleExpand: any;
|
|
9
|
+
onCollapse: any;
|
|
10
|
+
}) => {
|
|
11
|
+
state: {
|
|
12
|
+
expanded: any;
|
|
13
|
+
isExpandedAll: boolean;
|
|
14
|
+
};
|
|
15
|
+
actions: {
|
|
16
|
+
expand: (item: any, stateData?: boolean) => void;
|
|
17
|
+
toggleExpandAll: (stateData?: boolean) => void;
|
|
18
|
+
toggleExpand: (item: any, stateData?: boolean) => void;
|
|
19
|
+
collapse: (item: any) => void;
|
|
20
|
+
};
|
|
21
|
+
setExpanded: any;
|
|
22
|
+
};
|
|
23
|
+
export default useExpandState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const useHoverHandlersDelay: ({ onMouseOver, onMouseLeave, hideDelay, showDelay, }: {
|
|
2
|
+
onMouseOver: any;
|
|
3
|
+
onMouseLeave: any;
|
|
4
|
+
hideDelay?: number | undefined;
|
|
5
|
+
showDelay?: number | undefined;
|
|
6
|
+
}) => {
|
|
7
|
+
onMouseOver: () => void;
|
|
8
|
+
onMouseLeave: () => void;
|
|
9
|
+
};
|
|
10
|
+
export default useHoverHandlersDelay;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useParentElement: (ref: any) => any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { default as getComponentFromProps } from './getComponentFromProps';
|
|
2
|
+
export { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements';
|
|
3
|
+
export { capitalize } from './capitalize';
|
|
4
|
+
export { checkNotEmpty, checkEmpty, greaterThan, validDate, equal, notEqual, isNull, isNotNull, isIn, isNotIn, greaterThanOrEquals, lessThanOrEquals, startsWith, contains, } from './operators';
|
|
5
|
+
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';
|
|
6
|
+
export { setRef, mergeRefs, logger } from './system';
|
|
7
|
+
export { useMeasure, useForceUpdate, useOnClickOutside, useUncontrolled, useExecutionTimer, useExpandState, useHotkeys, useHoverHandlersDelay, useResizeObserver, useShouldRecalculate, useWindowScrollerList, useWindowSize, usePrevious, useCancellableDelayedCallback, useDerivedStateFromProps, useSetRef, useParentElement, useOnElementResize, useIsShowingEllipsis, } from './hooks';
|
|
8
|
+
export { getVisibleTimeByFormat, addLeadingZeros } from './timeUtils';
|
|
9
|
+
export { compose } from './compose';
|
|
10
|
+
export { DOCUMENT, WINDOW } from './platform';
|
|
11
|
+
export { isClassComponent, isFunctionComponent, isReactComponent, isElement, isDOMTypeElement, isCompositeTypeElement, } from './reactTypesUtility';
|
|
12
|
+
export { resetTimer } from './scrollingTimer';
|
|
13
|
+
export { isRequired, isGreaterThan, isValidDate } from './validations';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* onClickHandler: callback
|
|
3
|
+
*
|
|
4
|
+
* @param onClickHandler
|
|
5
|
+
*/
|
|
6
|
+
export declare const onClickHandlerForNonInteractiveElements: (onClickHandler: any) => {
|
|
7
|
+
role: string;
|
|
8
|
+
tabIndex: string;
|
|
9
|
+
onClick: any;
|
|
10
|
+
onKeyPress: (event: any) => void;
|
|
11
|
+
};
|
|
12
|
+
export default onClickHandlerForNonInteractiveElements;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if the value is null undefined ''
|
|
3
|
+
*
|
|
4
|
+
* @param value
|
|
5
|
+
*/
|
|
6
|
+
export declare const checkNotEmpty: (value: any) => boolean;
|
|
7
|
+
export declare const checkEmpty: (value: any) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @param value: number
|
|
10
|
+
* @param comparator: number
|
|
11
|
+
* @param value
|
|
12
|
+
* @param comparator
|
|
13
|
+
*/
|
|
14
|
+
export declare const greaterThan: (value: any, comparator: any) => boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Check if a valid date with format MM/DD/YYYY
|
|
17
|
+
*
|
|
18
|
+
* @param {*} value: string
|
|
19
|
+
* @param value
|
|
20
|
+
*/
|
|
21
|
+
export declare const validDate: (value: any) => boolean;
|
|
22
|
+
export declare const equal: (a: any, b: any) => boolean;
|
|
23
|
+
export declare const notEqual: (a: any, b: any) => boolean;
|
|
24
|
+
export declare const isNull: (a: any) => boolean;
|
|
25
|
+
export declare const isNotNull: (a: any) => boolean;
|
|
26
|
+
export declare const isIn: (a: any, b: any) => boolean;
|
|
27
|
+
export declare const isNotIn: (a: any, b: any) => boolean;
|
|
28
|
+
export declare const greaterThanOrEquals: (value: any, comparator: any) => boolean;
|
|
29
|
+
export declare const lessThanOrEquals: (value: any, comparator: any) => boolean;
|
|
30
|
+
export declare const startsWith: (value: any, comparator: any) => boolean;
|
|
31
|
+
export declare const contains: (value: any, comparator: any) => boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
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: any): boolean;
|
|
5
|
+
export declare function isDOMTypeElement(element: any): boolean;
|
|
6
|
+
export declare function isCompositeTypeElement(element: any): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resetTimer: (func: any) => (...args: any[]) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* commonly used functions
|
|
3
|
+
* Add a level of indirection to lodash so we can replace
|
|
4
|
+
* it if desired, while keeping function names the same
|
|
5
|
+
*/
|
|
6
|
+
import { cloneDeep, filter, debounce, findIndex, isEmpty, isString, isEqual, noop, omit, orderBy, pull, sumBy, maxBy, meanBy, sortBy, transform, isFunction, uniq, uniqBy, groupBy, property, get, set, range, parseInt, padStart, isNaN, values, throttle, pick, pickBy, differenceBy, differenceWith, isEqualWith, curry, isObject, isBoolean } from 'lodash';
|
|
7
|
+
/**
|
|
8
|
+
* Concatenates classNames from arguments
|
|
9
|
+
*
|
|
10
|
+
* @param {...any} classnames
|
|
11
|
+
*/
|
|
12
|
+
export declare const cx: (...classnames: any[]) => any;
|
|
13
|
+
declare const toggleInObject: (obj: any, key: any, value: any) => any;
|
|
14
|
+
declare const toggleInArray: (array: any, value: any) => any[];
|
|
15
|
+
declare const arrayMove: (array: any, from: any, to: any) => any;
|
|
16
|
+
declare const addOrRemove: (array: any, item: any, accessor?: (item: any) => any) => any;
|
|
17
|
+
export declare function runAll(...fns: any[]): (...args: any[]) => void;
|
|
18
|
+
export declare function hashArray(arr: any, fieldName: any): any;
|
|
19
|
+
export declare function safeCall(fun: any, ...args: any[]): void;
|
|
20
|
+
export declare const removeUndefinedProperties: (obj: any) => any;
|
|
21
|
+
declare const _default: {};
|
|
22
|
+
export default _default;
|
|
23
|
+
export { 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, };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const isRequired: ({ value, help }: {
|
|
2
|
+
value: any;
|
|
3
|
+
help?: string | undefined;
|
|
4
|
+
}) => {
|
|
5
|
+
payload: string;
|
|
6
|
+
error: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const isGreaterThan: ({ value, help, comparator }: {
|
|
9
|
+
value: any;
|
|
10
|
+
help: any;
|
|
11
|
+
comparator?: number | undefined;
|
|
12
|
+
}) => {
|
|
13
|
+
payload: any;
|
|
14
|
+
error: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare const isValidDate: ({ value, help, format }: {
|
|
17
|
+
value: any;
|
|
18
|
+
help: any;
|
|
19
|
+
format?: string | undefined;
|
|
20
|
+
}) => {
|
|
21
|
+
payload: any;
|
|
22
|
+
error: boolean;
|
|
23
|
+
};
|