@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.
@@ -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,3 @@
1
+ /// <reference types="react" />
2
+ export declare const getComponentFromProps: (Component: any, props: any, children?: never[]) => JSX.Element | null;
3
+ export default getComponentFromProps;
@@ -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,2 @@
1
+ export declare const useCancellableDelayedCallback: (cb: any, delay: any) => ((...args: any[]) => void)[];
2
+ export default useCancellableDelayedCallback;
@@ -0,0 +1,2 @@
1
+ export declare const useDerivedStateFromProps: (prop: any, options?: {}) => any[];
2
+ export default useDerivedStateFromProps;
@@ -0,0 +1,2 @@
1
+ export declare const useExecutionTimer: (startFn: any, cleanFn: any, delayTime: any) => ((...args: any[]) => void)[];
2
+ export default useExecutionTimer;
@@ -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,6 @@
1
+ export declare const useHotkeys: ({ keys, handler, options }: {
2
+ keys: any;
3
+ handler: any;
4
+ options?: {} | undefined;
5
+ }, deps?: never[]) => void;
6
+ export default useHotkeys;
@@ -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,5 @@
1
+ /// <reference types="react" />
2
+ export declare const useIsShowingEllipsis: <T extends HTMLElement = HTMLSpanElement>() => {
3
+ setElement: import("react").Dispatch<import("react").SetStateAction<T | undefined>>;
4
+ isShowingEllipsis: boolean;
5
+ };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const useOnElementResize: (targetRef: React.RefObject<HTMLDivElement>) => Record<'width' | 'height', number>;
@@ -0,0 +1 @@
1
+ export declare const useParentElement: (ref: any) => any;
@@ -0,0 +1,2 @@
1
+ export declare const usePrevious: (value: any) => undefined;
2
+ export default usePrevious;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare const useResizeObserver: (handler: any, el: any) => import("react").Dispatch<any>[];
3
+ export default useResizeObserver;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const useSetRef: (initial: any) => (import("react").MutableRefObject<any> | ((node: any) => void))[];
@@ -0,0 +1,2 @@
1
+ export declare const useShouldRecalculate: (bool: any) => number;
2
+ export default useShouldRecalculate;
@@ -0,0 +1,5 @@
1
+ export declare const useWindowScrollerList: ({ listInstance, outerListRef }: {
2
+ listInstance: any;
3
+ outerListRef: any;
4
+ }) => void;
5
+ export default useWindowScrollerList;
@@ -0,0 +1,2 @@
1
+ export declare const useWindowSize: () => false | number[];
2
+ export default useWindowSize;
@@ -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,2 @@
1
+ export declare const DOCUMENT: Document | null;
2
+ export declare const WINDOW: (Window & typeof globalThis) | null;
@@ -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,3 @@
1
+ export declare const setRef: (ref: any, value: any) => void;
2
+ export declare function mergeRefs(...refs: any[]): (node: any) => void;
3
+ export declare function logger(...args: any[]): void;
@@ -0,0 +1,7 @@
1
+ export declare const getVisibleTimeByFormat: (format: any) => {
2
+ showHours: boolean;
3
+ showMinutes: boolean;
4
+ showSeconds: boolean;
5
+ use12Hours: boolean;
6
+ };
7
+ export declare const addLeadingZeros: (count: any) => (number: any) => string;
@@ -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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-utilities",
3
- "version": "2.3.0-alpha.8",
3
+ "version": "2.3.0-alpha.9",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Utilities",
6
6
  "files": [