@elliemae/ds-utilities 2.2.1 → 2.3.0-alpha.4
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/cjs/capitalize.js +35 -7
- package/cjs/capitalize.js.map +7 -0
- package/cjs/compose.js +39 -32
- package/cjs/compose.js.map +7 -0
- package/cjs/getComponentFromProps.js +47 -29
- package/cjs/getComponentFromProps.js.map +7 -0
- package/cjs/hooks/index.js +70 -60
- package/cjs/hooks/index.js.map +7 -0
- package/cjs/hooks/useCancellableDelayedCallback.js +43 -18
- package/cjs/hooks/useCancellableDelayedCallback.js.map +7 -0
- package/cjs/hooks/useDerivedStateFromProps.js +47 -36
- package/cjs/hooks/useDerivedStateFromProps.js.map +7 -0
- package/cjs/hooks/useExecutionTimer.js +43 -24
- package/cjs/hooks/useExecutionTimer.js.map +7 -0
- package/cjs/hooks/useExpandState.js +69 -82
- package/cjs/hooks/useExpandState.js.map +7 -0
- package/cjs/hooks/useHotkeys.js +44 -24
- package/cjs/hooks/useHotkeys.js.map +7 -0
- package/cjs/hooks/useHoverHandlersDelay.js +48 -18
- package/cjs/hooks/useHoverHandlersDelay.js.map +7 -0
- package/cjs/hooks/useIsShowingEllipsis.js +58 -0
- package/cjs/hooks/useIsShowingEllipsis.js.map +7 -0
- package/cjs/hooks/useOnElementResize.js +44 -27
- package/cjs/hooks/useOnElementResize.js.map +7 -0
- package/cjs/hooks/useParentElement.js +40 -13
- package/cjs/hooks/useParentElement.js.map +7 -0
- package/cjs/hooks/usePrevious.js +41 -10
- package/cjs/hooks/usePrevious.js.map +7 -0
- package/cjs/hooks/useResizeObserver.js +52 -25
- package/cjs/hooks/useResizeObserver.js.map +7 -0
- package/cjs/hooks/useSetRef.js +38 -11
- package/cjs/hooks/useSetRef.js.map +7 -0
- package/cjs/hooks/useShouldRecalculate.js +41 -14
- package/cjs/hooks/useShouldRecalculate.js.map +7 -0
- package/cjs/hooks/useWindowScrollerList.js +51 -33
- package/cjs/hooks/useWindowScrollerList.js.map +7 -0
- package/cjs/hooks/useWindowSize.js +49 -19
- package/cjs/hooks/useWindowSize.js.map +7 -0
- package/cjs/index.js +146 -266
- package/cjs/index.js.map +7 -0
- package/cjs/onClickHandlerForNonInteractiveElements.js +46 -19
- package/cjs/onClickHandlerForNonInteractiveElements.js.map +7 -0
- package/cjs/operators.js +56 -51
- package/cjs/operators.js.map +7 -0
- package/cjs/platform.js +37 -9
- package/cjs/platform.js.map +7 -0
- package/cjs/reactTypesUtility.js +45 -22
- package/cjs/reactTypesUtility.js.map +7 -0
- package/cjs/scrollingTimer.js +37 -15
- package/cjs/scrollingTimer.js.map +7 -0
- package/cjs/system.js +47 -30
- package/cjs/system.js.map +7 -0
- package/cjs/timeUtils.js +42 -24
- package/cjs/timeUtils.js.map +7 -0
- package/cjs/utils.js +101 -237
- package/cjs/utils.js.map +7 -0
- package/cjs/validations.js +48 -35
- package/cjs/validations.js.map +7 -0
- package/esm/capitalize.js +6 -3
- package/esm/capitalize.js.map +7 -0
- package/esm/compose.js +11 -29
- package/esm/compose.js.map +7 -0
- package/esm/getComponentFromProps.js +18 -22
- package/esm/getComponentFromProps.js.map +7 -0
- package/esm/hooks/index.js +42 -18
- package/esm/hooks/index.js.map +7 -0
- package/esm/hooks/useCancellableDelayedCallback.js +12 -14
- package/esm/hooks/useCancellableDelayedCallback.js.map +7 -0
- package/esm/hooks/useDerivedStateFromProps.js +15 -31
- package/esm/hooks/useDerivedStateFromProps.js.map +7 -0
- package/esm/hooks/useExecutionTimer.js +12 -20
- package/esm/hooks/useExecutionTimer.js.map +7 -0
- package/esm/hooks/useExpandState.js +36 -72
- package/esm/hooks/useExpandState.js.map +7 -0
- package/esm/hooks/useHotkeys.js +11 -14
- package/esm/hooks/useHotkeys.js.map +7 -0
- package/esm/hooks/useHoverHandlersDelay.js +15 -12
- package/esm/hooks/useHoverHandlersDelay.js.map +7 -0
- package/esm/hooks/useIsShowingEllipsis.js +29 -0
- package/esm/hooks/useIsShowingEllipsis.js.map +7 -0
- package/esm/hooks/useOnElementResize.js +12 -20
- package/esm/hooks/useOnElementResize.js.map +7 -0
- package/esm/hooks/useParentElement.js +9 -7
- package/esm/hooks/useParentElement.js.map +7 -0
- package/esm/hooks/usePrevious.js +10 -6
- package/esm/hooks/usePrevious.js.map +7 -0
- package/esm/hooks/useResizeObserver.js +20 -15
- package/esm/hooks/useResizeObserver.js.map +7 -0
- package/esm/hooks/useSetRef.js +8 -6
- package/esm/hooks/useSetRef.js.map +7 -0
- package/esm/hooks/useShouldRecalculate.js +11 -11
- package/esm/hooks/useShouldRecalculate.js.map +7 -0
- package/esm/hooks/useWindowScrollerList.js +20 -29
- package/esm/hooks/useWindowScrollerList.js.map +7 -0
- package/esm/hooks/useWindowSize.js +18 -15
- package/esm/hooks/useWindowSize.js.map +7 -0
- package/esm/index.js +206 -31
- package/esm/index.js.map +7 -0
- package/esm/onClickHandlerForNonInteractiveElements.js +17 -17
- package/esm/onClickHandlerForNonInteractiveElements.js.map +7 -0
- package/esm/operators.js +27 -34
- package/esm/operators.js.map +7 -0
- package/esm/platform.js +8 -4
- package/esm/platform.js.map +7 -0
- package/esm/reactTypesUtility.js +16 -9
- package/esm/reactTypesUtility.js.map +7 -0
- package/esm/scrollingTimer.js +8 -11
- package/esm/scrollingTimer.js.map +7 -0
- package/esm/system.js +16 -22
- package/esm/system.js.map +7 -0
- package/esm/timeUtils.js +13 -19
- package/esm/timeUtils.js.map +7 -0
- package/esm/utils.js +109 -72
- package/esm/utils.js.map +7 -0
- package/esm/validations.js +18 -28
- package/esm/validations.js.map +7 -0
- package/package.json +5 -1
- package/types/compose.d.ts +2 -1
- package/types/getComponentFromProps.d.ts +2 -1
- package/types/hooks/index.d.ts +15 -14
- package/types/hooks/useCancellableDelayedCallback.d.ts +2 -1
- package/types/hooks/useDerivedStateFromProps.d.ts +2 -1
- package/types/hooks/useExecutionTimer.d.ts +2 -1
- package/types/hooks/useExpandState.d.ts +3 -2
- package/types/hooks/useHotkeys.d.ts +3 -2
- package/types/hooks/useHoverHandlersDelay.d.ts +3 -2
- package/types/hooks/useIsShowingEllipsis.d.ts +5 -0
- package/types/hooks/usePrevious.d.ts +1 -1
- package/types/hooks/useResizeObserver.d.ts +2 -1
- package/types/hooks/useShouldRecalculate.d.ts +2 -1
- package/types/hooks/useWindowScrollerList.d.ts +3 -2
- package/types/hooks/useWindowSize.d.ts +2 -1
- package/types/index.d.ts +11 -11
- package/types/onClickHandlerForNonInteractiveElements.d.ts +7 -7
- package/types/scrollingTimer.d.ts +1 -1
package/types/hooks/index.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
export { default as useMeasure } from 'use-measure';
|
|
2
|
-
export { default as useExecutionTimer } from './useExecutionTimer';
|
|
3
|
-
export { default as useExpandState } from './useExpandState';
|
|
4
|
-
export { default as useHotkeys } from './useHotkeys';
|
|
5
|
-
export { default as useHoverHandlersDelay } from './useHoverHandlersDelay';
|
|
6
|
-
export { default as useResizeObserver } from './useResizeObserver';
|
|
7
|
-
export { default as useShouldRecalculate } from './useShouldRecalculate';
|
|
8
|
-
export { default as useWindowScrollerList } from './useWindowScrollerList';
|
|
9
|
-
export { default as useWindowSize } from './useWindowSize';
|
|
10
2
|
export { default as useForceUpdate } from 'use-force-update';
|
|
11
3
|
export { default as useOnClickOutside } from 'use-onclickoutside';
|
|
12
4
|
export { useUncontrolled } from 'uncontrollable';
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
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';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const useCancellableDelayedCallback: (cb: any, delay: any) => ((...args: any[]) => void)[];
|
|
2
|
+
export default useCancellableDelayedCallback;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const useDerivedStateFromProps: (prop: any, options?: {}) => any[];
|
|
2
|
+
export default useDerivedStateFromProps;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const useExecutionTimer: (startFn: any, cleanFn: any, delayTime: any) => ((...args: any[]) => void)[];
|
|
2
|
+
export default useExecutionTimer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const useExpandState: ({ items, itemKey, expanded: expandedProp, onExpand, onExpandChange, onExpandAll, onToggleExpand, onCollapse, }: {
|
|
2
2
|
items?: never[] | undefined;
|
|
3
3
|
itemKey?: string | undefined;
|
|
4
4
|
expanded?: {} | undefined;
|
|
@@ -7,7 +7,7 @@ export default function useExpandState({ items, itemKey, expanded: expandedProp,
|
|
|
7
7
|
onExpandAll?: (() => null) | undefined;
|
|
8
8
|
onToggleExpand: any;
|
|
9
9
|
onCollapse: any;
|
|
10
|
-
})
|
|
10
|
+
}) => {
|
|
11
11
|
state: {
|
|
12
12
|
expanded: any;
|
|
13
13
|
isExpandedAll: boolean;
|
|
@@ -20,3 +20,4 @@ export default function useExpandState({ items, itemKey, expanded: expandedProp,
|
|
|
20
20
|
};
|
|
21
21
|
setExpanded: any;
|
|
22
22
|
};
|
|
23
|
+
export default useExpandState;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const useHotkeys: ({ keys, handler, options }: {
|
|
2
2
|
keys: any;
|
|
3
3
|
handler: any;
|
|
4
4
|
options?: {} | undefined;
|
|
5
|
-
}, deps?: never[])
|
|
5
|
+
}, deps?: never[]) => void;
|
|
6
|
+
export default useHotkeys;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const useHoverHandlersDelay: ({ onMouseOver, onMouseLeave, hideDelay, showDelay, }: {
|
|
2
2
|
onMouseOver: any;
|
|
3
3
|
onMouseLeave: any;
|
|
4
4
|
hideDelay?: number | undefined;
|
|
5
5
|
showDelay?: number | undefined;
|
|
6
|
-
})
|
|
6
|
+
}) => {
|
|
7
7
|
onMouseOver: () => void;
|
|
8
8
|
onMouseLeave: () => void;
|
|
9
9
|
};
|
|
10
|
+
export default useHoverHandlersDelay;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
export declare const usePrevious: (value: any) => undefined;
|
|
2
2
|
export default usePrevious;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const useShouldRecalculate: (bool: any) => number;
|
|
2
|
+
export default useShouldRecalculate;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const useWindowScrollerList: ({ listInstance, outerListRef }: {
|
|
2
2
|
listInstance: any;
|
|
3
3
|
outerListRef: any;
|
|
4
|
-
})
|
|
4
|
+
}) => void;
|
|
5
|
+
export default useWindowScrollerList;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const useWindowSize: () => false | number[];
|
|
2
|
+
export default useWindowSize;
|
package/types/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { default as getComponentFromProps } from './getComponentFromProps';
|
|
2
2
|
export { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
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';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
declare const _default: (onClickHandler: any) => {
|
|
2
|
-
role: string;
|
|
3
|
-
tabIndex: string;
|
|
4
|
-
onClick: any;
|
|
5
|
-
onKeyPress: (event: any) => void;
|
|
6
|
-
};
|
|
7
1
|
/**
|
|
8
2
|
* onClickHandler: callback
|
|
9
3
|
*
|
|
10
4
|
* @param onClickHandler
|
|
11
5
|
*/
|
|
12
|
-
export
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare const resetTimer: (func: any) => (...args: any[]) => void;
|