@elliemae/ds-utilities 3.22.0-next.25 → 3.22.0-next.26
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/cjs/hooks/index.js +2 -0
- package/dist/cjs/hooks/index.js.map +2 -2
- package/dist/cjs/hooks/useControlledUncontrolledState.js +55 -0
- package/dist/cjs/hooks/useControlledUncontrolledState.js.map +7 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/index.js.map +2 -2
- package/dist/esm/hooks/useControlledUncontrolledState.js +25 -0
- package/dist/esm/hooks/useControlledUncontrolledState.js.map +7 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useControlledUncontrolledState.d.ts +5 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +3 -3
package/dist/cjs/hooks/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __export(hooks_exports, {
|
|
|
34
34
|
UseOnSpecificFocusWithSchema: () => import_useOnSpecificFocus.UseOnSpecificFocusWithSchema,
|
|
35
35
|
useCallbackAfterRender: () => import_useCallbackAfterRender.useCallbackAfterRender,
|
|
36
36
|
useCancellableDelayedCallback: () => import_useCancellableDelayedCallback.useCancellableDelayedCallback,
|
|
37
|
+
useControlledUncontrolledState: () => import_useControlledUncontrolledState.useControlledUncontrolledState,
|
|
37
38
|
useDerivedStateFromProps: () => import_useDerivedStateFromProps.useDerivedStateFromProps,
|
|
38
39
|
useExecutionTimer: () => import_useExecutionTimer.useExecutionTimer,
|
|
39
40
|
useExpandState: () => import_useExpandState.useExpandState,
|
|
@@ -68,6 +69,7 @@ var import_use_force_update = __toESM(require("use-force-update"));
|
|
|
68
69
|
var import_use_onclickoutside = __toESM(require("use-onclickoutside"));
|
|
69
70
|
var import_useCallbackAfterRender = require("./useCallbackAfterRender.js");
|
|
70
71
|
var import_useCancellableDelayedCallback = require("./useCancellableDelayedCallback.js");
|
|
72
|
+
var import_useControlledUncontrolledState = require("./useControlledUncontrolledState.js");
|
|
71
73
|
var import_useDerivedStateFromProps = require("./useDerivedStateFromProps.js");
|
|
72
74
|
var import_useExecutionTimer = require("./useExecutionTimer.js");
|
|
73
75
|
var import_useExpandState = require("./useExpandState.js");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { default as useMeasure } from 'use-measure';\nexport { default as useForceUpdate } from 'use-force-update';\nexport { default as useOnClickOutside } from 'use-onclickoutside';\n\nexport { useCallbackAfterRender } from './useCallbackAfterRender.js';\nexport { useCancellableDelayedCallback } from './useCancellableDelayedCallback.js';\nexport { useDerivedStateFromProps } from './useDerivedStateFromProps.js';\nexport { useExecutionTimer } from './useExecutionTimer.js';\nexport { useExpandState } from './useExpandState.js';\nexport { useFocusTrap, UseFocusTrapWithSchema } from './useFocusTrap.js';\nexport { useHeadlessTooltip } from './useHeadlessTooltip.js';\nexport { useHotkeys } from './useHotkeys.js';\nexport { useHoverHandlersDelay } from './useHoverHandlersDelay.js';\nexport { useIsMobile } from './useIsMobile.js';\nexport { useIsShowingEllipsis } from './useIsShowingEllipsis.js';\nexport { useMakeMutable, useLatestValueReferenciallyStable } from './useMakeMutable.js';\nexport { useNativeIntersectionObserver } from './useNativeIntersectionObserver.js';\nexport { useNativeResizeObserver } from './useNativeResizeObserver.js';\nexport { useOnBlurOut, UseOnBlurOutWithSchema } from './useOnBlurOut.js';\nexport { useOnElementResize } from './useOnElementResize.js';\nexport { useOnFirstFocusIn, UseOnFirstFocusInWithSchema } from './useOnFirstFocusIn.js';\nexport { useOnSpecificFocus, UseOnSpecificFocusWithSchema } from './useOnSpecificFocus.js';\nexport { usePrevious } from './usePrevious.js';\nexport { useResizeObserver } from './useResizeObserver.js';\nexport { useShouldRecalculate } from './useShouldRecalculate.js';\nexport { useSideEffectSyntheticEvent } from './useSideEffectSyntheticEvent.js';\nexport { useTrackElement } from './useTrackElement.js';\nexport { useWindowScrollerList } from './useWindowScrollerList.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAsC;AACtC,8BAA0C;AAC1C,gCAA6C;AAE7C,oCAAuC;AACvC,2CAA8C;AAC9C,sCAAyC;AACzC,+BAAkC;AAClC,4BAA+B;AAC/B,0BAAqD;AACrD,gCAAmC;AACnC,wBAA2B;AAC3B,mCAAsC;AACtC,yBAA4B;AAC5B,kCAAqC;AACrC,4BAAkE;AAClE,2CAA8C;AAC9C,qCAAwC;AACxC,0BAAqD;AACrD,gCAAmC;AACnC,+BAA+D;AAC/D,gCAAiE;AACjE,yBAA4B;AAC5B,+BAAkC;AAClC,kCAAqC;AACrC,yCAA4C;AAC5C,6BAAgC;AAChC,mCAAsC;",
|
|
4
|
+
"sourcesContent": ["export { default as useMeasure } from 'use-measure';\nexport { default as useForceUpdate } from 'use-force-update';\nexport { default as useOnClickOutside } from 'use-onclickoutside';\n\nexport { useCallbackAfterRender } from './useCallbackAfterRender.js';\nexport { useCancellableDelayedCallback } from './useCancellableDelayedCallback.js';\nexport { useControlledUncontrolledState } from './useControlledUncontrolledState.js';\nexport { useDerivedStateFromProps } from './useDerivedStateFromProps.js';\nexport { useExecutionTimer } from './useExecutionTimer.js';\nexport { useExpandState } from './useExpandState.js';\nexport { useFocusTrap, UseFocusTrapWithSchema } from './useFocusTrap.js';\nexport { useHeadlessTooltip } from './useHeadlessTooltip.js';\nexport { useHotkeys } from './useHotkeys.js';\nexport { useHoverHandlersDelay } from './useHoverHandlersDelay.js';\nexport { useIsMobile } from './useIsMobile.js';\nexport { useIsShowingEllipsis } from './useIsShowingEllipsis.js';\nexport { useMakeMutable, useLatestValueReferenciallyStable } from './useMakeMutable.js';\nexport { useNativeIntersectionObserver } from './useNativeIntersectionObserver.js';\nexport { useNativeResizeObserver } from './useNativeResizeObserver.js';\nexport { useOnBlurOut, UseOnBlurOutWithSchema } from './useOnBlurOut.js';\nexport { useOnElementResize } from './useOnElementResize.js';\nexport { useOnFirstFocusIn, UseOnFirstFocusInWithSchema } from './useOnFirstFocusIn.js';\nexport { useOnSpecificFocus, UseOnSpecificFocusWithSchema } from './useOnSpecificFocus.js';\nexport { usePrevious } from './usePrevious.js';\nexport { useResizeObserver } from './useResizeObserver.js';\nexport { useShouldRecalculate } from './useShouldRecalculate.js';\nexport { useSideEffectSyntheticEvent } from './useSideEffectSyntheticEvent.js';\nexport { useTrackElement } from './useTrackElement.js';\nexport { useWindowScrollerList } from './useWindowScrollerList.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAsC;AACtC,8BAA0C;AAC1C,gCAA6C;AAE7C,oCAAuC;AACvC,2CAA8C;AAC9C,4CAA+C;AAC/C,sCAAyC;AACzC,+BAAkC;AAClC,4BAA+B;AAC/B,0BAAqD;AACrD,gCAAmC;AACnC,wBAA2B;AAC3B,mCAAsC;AACtC,yBAA4B;AAC5B,kCAAqC;AACrC,4BAAkE;AAClE,2CAA8C;AAC9C,qCAAwC;AACxC,0BAAqD;AACrD,gCAAmC;AACnC,+BAA+D;AAC/D,gCAAiE;AACjE,yBAA4B;AAC5B,+BAAkC;AAClC,kCAAqC;AACrC,yCAA4C;AAC5C,6BAAgC;AAChC,mCAAsC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useControlledUncontrolledState_exports = {};
|
|
30
|
+
__export(useControlledUncontrolledState_exports, {
|
|
31
|
+
useControlledUncontrolledState: () => useControlledUncontrolledState
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useControlledUncontrolledState_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
function useControlledUncontrolledState(config) {
|
|
37
|
+
const { defaultState, controlledState, onChange } = config;
|
|
38
|
+
const [state, setState] = import_react.default.useState(defaultState);
|
|
39
|
+
const shouldUseControlledState = Object.hasOwnProperty.call(config, "controlledState");
|
|
40
|
+
const finalState = import_react.default.useMemo(() => {
|
|
41
|
+
if (shouldUseControlledState)
|
|
42
|
+
return controlledState;
|
|
43
|
+
return state;
|
|
44
|
+
}, [shouldUseControlledState, controlledState, state]);
|
|
45
|
+
const finalSetState = import_react.default.useCallback(
|
|
46
|
+
(newVal) => {
|
|
47
|
+
setState(newVal);
|
|
48
|
+
if (onChange)
|
|
49
|
+
onChange(newVal);
|
|
50
|
+
},
|
|
51
|
+
[onChange]
|
|
52
|
+
);
|
|
53
|
+
return [finalState, finalSetState];
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=useControlledUncontrolledState.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/hooks/useControlledUncontrolledState.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\n\nexport function useControlledUncontrolledState<T = unknown>(config: {\n defaultState: T;\n controlledState?: T;\n onChange?: (newState: T) => void;\n}): [T, (newVal: T) => void] {\n const { defaultState, controlledState, onChange } = config;\n const [state, setState] = React.useState<T>(defaultState);\n // due to javascript \"falsy\" crazy bonanza,\n // we are gonna use Object.hasOwnProperty to check if controlledState should be used\n // this covers scenarios such as `controlledState=undefined`/`controlledState=null`/`controlledState=false`/`controlledState=0`/`controlledState=''`\n // where we want to use the controlledState but we want the value to be the falsy value itself...\n const shouldUseControlledState = Object.hasOwnProperty.call(config, 'controlledState');\n const finalState = React.useMemo(() => {\n if (shouldUseControlledState) return controlledState as T;\n return state;\n }, [shouldUseControlledState, controlledState, state]);\n const finalSetState = React.useCallback(\n (newVal: T) => {\n setState(newVal);\n if (onChange) onChange(newVal);\n },\n [onChange],\n );\n return [finalState, finalSetState];\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAEX,SAAS,+BAA4C,QAI/B;AAC3B,QAAM,EAAE,cAAc,iBAAiB,SAAS,IAAI;AACpD,QAAM,CAAC,OAAO,QAAQ,IAAI,aAAAA,QAAM,SAAY,YAAY;AAKxD,QAAM,2BAA2B,OAAO,eAAe,KAAK,QAAQ,iBAAiB;AACrF,QAAM,aAAa,aAAAA,QAAM,QAAQ,MAAM;AACrC,QAAI;AAA0B,aAAO;AACrC,WAAO;AAAA,EACT,GAAG,CAAC,0BAA0B,iBAAiB,KAAK,CAAC;AACrD,QAAM,gBAAgB,aAAAA,QAAM;AAAA,IAC1B,CAAC,WAAc;AACb,eAAS,MAAM;AACf,UAAI;AAAU,iBAAS,MAAM;AAAA,IAC/B;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AACA,SAAO,CAAC,YAAY,aAAa;AACnC;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -114,6 +114,7 @@ __export(src_exports, {
|
|
|
114
114
|
uniqBy: () => import_utils.uniqBy,
|
|
115
115
|
useCallbackAfterRender: () => import_hooks.useCallbackAfterRender,
|
|
116
116
|
useCancellableDelayedCallback: () => import_hooks.useCancellableDelayedCallback,
|
|
117
|
+
useControlledUncontrolledState: () => import_hooks.useControlledUncontrolledState,
|
|
117
118
|
useDerivedStateFromProps: () => import_hooks.useDerivedStateFromProps,
|
|
118
119
|
useExecutionTimer: () => import_hooks.useExecutionTimer,
|
|
119
120
|
useExpandState: () => import_hooks.useExpandState,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { default as getComponentFromProps } from './getComponentFromProps.js';\nexport { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements.js';\nexport { capitalize } from './capitalize.js';\nexport { getObjectValuesToArray, getObjectKeysToArray } from './objectUtilities.js';\nexport {\n checkEmpty,\n checkNotEmpty,\n contains,\n equal,\n greaterThan,\n greaterThanOrEquals,\n isIn,\n isNotIn,\n isNotNull,\n isNull,\n lessThanOrEquals,\n notEqual,\n startsWith,\n validDate,\n} from './operators.js';\nexport {\n addOrRemove,\n arrayMove,\n cloneDeep,\n curry,\n cx,\n debounce,\n differenceBy,\n differenceWith,\n filter,\n findIndex,\n get,\n groupBy,\n hashArray,\n isBoolean,\n isEmpty,\n isEqual,\n isEqualWith,\n isFunction,\n isNaN,\n isObject,\n isString,\n maxBy,\n meanBy,\n noop,\n omit,\n orderBy,\n padStart,\n parseInt,\n pick,\n pickBy,\n property,\n pull,\n range,\n removeUndefinedProperties,\n runAll,\n safeCall,\n set,\n sortBy,\n sumBy,\n throttle,\n toggleInArray,\n toggleInObject,\n transform,\n uniq,\n uniqBy,\n values,\n} from './utils.js';\nexport { setRef, mergeRefs, setMultipleRefs, logger } from './system.js';\nexport {\n useCallbackAfterRender,\n useCancellableDelayedCallback,\n useDerivedStateFromProps,\n useExecutionTimer,\n useExpandState,\n useFocusTrap,\n UseFocusTrapWithSchema,\n useForceUpdate,\n useHeadlessTooltip,\n useHotkeys,\n useHoverHandlersDelay,\n useIsMobile,\n useIsShowingEllipsis,\n useMakeMutable,\n useLatestValueReferenciallyStable,\n useMeasure,\n useNativeIntersectionObserver,\n useNativeResizeObserver,\n useOnBlurOut,\n UseOnBlurOutWithSchema,\n useOnClickOutside,\n useOnElementResize,\n useOnFirstFocusIn,\n UseOnFirstFocusInWithSchema,\n useOnSpecificFocus,\n UseOnSpecificFocusWithSchema,\n usePrevious,\n useResizeObserver,\n useShouldRecalculate,\n useSideEffectSyntheticEvent,\n useTrackElement,\n useWindowScrollerList,\n} from './hooks/index.js';\nexport { getVisibleTimeByFormat, addLeadingZeros } from './timeUtils.js';\nexport { compose } from './compose.js';\nexport { DOCUMENT, WINDOW } from './platform.js';\nexport { isDOMTypeElement } from './reactTypesUtility.js';\nexport { isRequired, isGreaterThan, isValidDate } from './validations.js';\nexport { getHighlightedRerendersStyle } from './getHighlightedRerendersStyle.js';\n\nexport { crossTypeSort } from './algorithms/crossTypeSort.js';\nexport { appendComponentIfNotExist } from './addComponentIfNotExists.js';\n// TODO -- REMOVE WHEN READY\nexport * from './deprecated/index.js';\nexport * from './props-helpers/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mCAAiD;AACjD,qDAAmE;AACnE,wBAA2B;AAC3B,6BAA6D;AAC7D,uBAeO;AACP,mBA+CO;AACP,oBAA2D;AAC3D,
|
|
4
|
+
"sourcesContent": ["export { default as getComponentFromProps } from './getComponentFromProps.js';\nexport { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements.js';\nexport { capitalize } from './capitalize.js';\nexport { getObjectValuesToArray, getObjectKeysToArray } from './objectUtilities.js';\nexport {\n checkEmpty,\n checkNotEmpty,\n contains,\n equal,\n greaterThan,\n greaterThanOrEquals,\n isIn,\n isNotIn,\n isNotNull,\n isNull,\n lessThanOrEquals,\n notEqual,\n startsWith,\n validDate,\n} from './operators.js';\nexport {\n addOrRemove,\n arrayMove,\n cloneDeep,\n curry,\n cx,\n debounce,\n differenceBy,\n differenceWith,\n filter,\n findIndex,\n get,\n groupBy,\n hashArray,\n isBoolean,\n isEmpty,\n isEqual,\n isEqualWith,\n isFunction,\n isNaN,\n isObject,\n isString,\n maxBy,\n meanBy,\n noop,\n omit,\n orderBy,\n padStart,\n parseInt,\n pick,\n pickBy,\n property,\n pull,\n range,\n removeUndefinedProperties,\n runAll,\n safeCall,\n set,\n sortBy,\n sumBy,\n throttle,\n toggleInArray,\n toggleInObject,\n transform,\n uniq,\n uniqBy,\n values,\n} from './utils.js';\nexport { setRef, mergeRefs, setMultipleRefs, logger } from './system.js';\nexport {\n useCallbackAfterRender,\n useCancellableDelayedCallback,\n useControlledUncontrolledState,\n useDerivedStateFromProps,\n useExecutionTimer,\n useExpandState,\n useFocusTrap,\n UseFocusTrapWithSchema,\n useForceUpdate,\n useHeadlessTooltip,\n useHotkeys,\n useHoverHandlersDelay,\n useIsMobile,\n useIsShowingEllipsis,\n useMakeMutable,\n useLatestValueReferenciallyStable,\n useMeasure,\n useNativeIntersectionObserver,\n useNativeResizeObserver,\n useOnBlurOut,\n UseOnBlurOutWithSchema,\n useOnClickOutside,\n useOnElementResize,\n useOnFirstFocusIn,\n UseOnFirstFocusInWithSchema,\n useOnSpecificFocus,\n UseOnSpecificFocusWithSchema,\n usePrevious,\n useResizeObserver,\n useShouldRecalculate,\n useSideEffectSyntheticEvent,\n useTrackElement,\n useWindowScrollerList,\n} from './hooks/index.js';\n\nexport { getVisibleTimeByFormat, addLeadingZeros } from './timeUtils.js';\nexport { compose } from './compose.js';\nexport { DOCUMENT, WINDOW } from './platform.js';\nexport { isDOMTypeElement } from './reactTypesUtility.js';\nexport { isRequired, isGreaterThan, isValidDate } from './validations.js';\nexport { getHighlightedRerendersStyle } from './getHighlightedRerendersStyle.js';\n\nexport { crossTypeSort } from './algorithms/crossTypeSort.js';\nexport { appendComponentIfNotExist } from './addComponentIfNotExists.js';\n// TODO -- REMOVE WHEN READY\nexport * from './deprecated/index.js';\nexport * from './props-helpers/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mCAAiD;AACjD,qDAAmE;AACnE,wBAA2B;AAC3B,6BAA6D;AAC7D,uBAeO;AACP,mBA+CO;AACP,oBAA2D;AAC3D,mBAkCO;AAEP,uBAAwD;AACxD,qBAAwB;AACxB,sBAAiC;AACjC,+BAAiC;AACjC,yBAAuD;AACvD,0CAA6C;AAE7C,2BAA8B;AAC9B,qCAA0C;AAE1C,wBAAc,kCAnHd;AAoHA,wBAAc,qCApHd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/hooks/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { default as default3 } from "use-force-update";
|
|
|
4
4
|
import { default as default4 } from "use-onclickoutside";
|
|
5
5
|
import { useCallbackAfterRender } from "./useCallbackAfterRender.js";
|
|
6
6
|
import { useCancellableDelayedCallback } from "./useCancellableDelayedCallback.js";
|
|
7
|
+
import { useControlledUncontrolledState } from "./useControlledUncontrolledState.js";
|
|
7
8
|
import { useDerivedStateFromProps } from "./useDerivedStateFromProps.js";
|
|
8
9
|
import { useExecutionTimer } from "./useExecutionTimer.js";
|
|
9
10
|
import { useExpandState } from "./useExpandState.js";
|
|
@@ -33,6 +34,7 @@ export {
|
|
|
33
34
|
UseOnSpecificFocusWithSchema,
|
|
34
35
|
useCallbackAfterRender,
|
|
35
36
|
useCancellableDelayedCallback,
|
|
37
|
+
useControlledUncontrolledState,
|
|
36
38
|
useDerivedStateFromProps,
|
|
37
39
|
useExecutionTimer,
|
|
38
40
|
useExpandState,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default as useMeasure } from 'use-measure';\nexport { default as useForceUpdate } from 'use-force-update';\nexport { default as useOnClickOutside } from 'use-onclickoutside';\n\nexport { useCallbackAfterRender } from './useCallbackAfterRender.js';\nexport { useCancellableDelayedCallback } from './useCancellableDelayedCallback.js';\nexport { useDerivedStateFromProps } from './useDerivedStateFromProps.js';\nexport { useExecutionTimer } from './useExecutionTimer.js';\nexport { useExpandState } from './useExpandState.js';\nexport { useFocusTrap, UseFocusTrapWithSchema } from './useFocusTrap.js';\nexport { useHeadlessTooltip } from './useHeadlessTooltip.js';\nexport { useHotkeys } from './useHotkeys.js';\nexport { useHoverHandlersDelay } from './useHoverHandlersDelay.js';\nexport { useIsMobile } from './useIsMobile.js';\nexport { useIsShowingEllipsis } from './useIsShowingEllipsis.js';\nexport { useMakeMutable, useLatestValueReferenciallyStable } from './useMakeMutable.js';\nexport { useNativeIntersectionObserver } from './useNativeIntersectionObserver.js';\nexport { useNativeResizeObserver } from './useNativeResizeObserver.js';\nexport { useOnBlurOut, UseOnBlurOutWithSchema } from './useOnBlurOut.js';\nexport { useOnElementResize } from './useOnElementResize.js';\nexport { useOnFirstFocusIn, UseOnFirstFocusInWithSchema } from './useOnFirstFocusIn.js';\nexport { useOnSpecificFocus, UseOnSpecificFocusWithSchema } from './useOnSpecificFocus.js';\nexport { usePrevious } from './usePrevious.js';\nexport { useResizeObserver } from './useResizeObserver.js';\nexport { useShouldRecalculate } from './useShouldRecalculate.js';\nexport { useSideEffectSyntheticEvent } from './useSideEffectSyntheticEvent.js';\nexport { useTrackElement } from './useTrackElement.js';\nexport { useWindowScrollerList } from './useWindowScrollerList.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAoB,WAAXA,gBAA6B;AACtC,SAAoB,WAAXA,gBAAiC;AAC1C,SAAoB,WAAXA,gBAAoC;AAE7C,SAAS,8BAA8B;AACvC,SAAS,qCAAqC;AAC9C,SAAS,gCAAgC;AACzC,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,cAAc,8BAA8B;AACrD,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAC3B,SAAS,6BAA6B;AACtC,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;AACrC,SAAS,gBAAgB,yCAAyC;AAClE,SAAS,qCAAqC;AAC9C,SAAS,+BAA+B;AACxC,SAAS,cAAc,8BAA8B;AACrD,SAAS,0BAA0B;AACnC,SAAS,mBAAmB,mCAAmC;AAC/D,SAAS,oBAAoB,oCAAoC;AACjE,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,mCAAmC;AAC5C,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default as useMeasure } from 'use-measure';\nexport { default as useForceUpdate } from 'use-force-update';\nexport { default as useOnClickOutside } from 'use-onclickoutside';\n\nexport { useCallbackAfterRender } from './useCallbackAfterRender.js';\nexport { useCancellableDelayedCallback } from './useCancellableDelayedCallback.js';\nexport { useControlledUncontrolledState } from './useControlledUncontrolledState.js';\nexport { useDerivedStateFromProps } from './useDerivedStateFromProps.js';\nexport { useExecutionTimer } from './useExecutionTimer.js';\nexport { useExpandState } from './useExpandState.js';\nexport { useFocusTrap, UseFocusTrapWithSchema } from './useFocusTrap.js';\nexport { useHeadlessTooltip } from './useHeadlessTooltip.js';\nexport { useHotkeys } from './useHotkeys.js';\nexport { useHoverHandlersDelay } from './useHoverHandlersDelay.js';\nexport { useIsMobile } from './useIsMobile.js';\nexport { useIsShowingEllipsis } from './useIsShowingEllipsis.js';\nexport { useMakeMutable, useLatestValueReferenciallyStable } from './useMakeMutable.js';\nexport { useNativeIntersectionObserver } from './useNativeIntersectionObserver.js';\nexport { useNativeResizeObserver } from './useNativeResizeObserver.js';\nexport { useOnBlurOut, UseOnBlurOutWithSchema } from './useOnBlurOut.js';\nexport { useOnElementResize } from './useOnElementResize.js';\nexport { useOnFirstFocusIn, UseOnFirstFocusInWithSchema } from './useOnFirstFocusIn.js';\nexport { useOnSpecificFocus, UseOnSpecificFocusWithSchema } from './useOnSpecificFocus.js';\nexport { usePrevious } from './usePrevious.js';\nexport { useResizeObserver } from './useResizeObserver.js';\nexport { useShouldRecalculate } from './useShouldRecalculate.js';\nexport { useSideEffectSyntheticEvent } from './useSideEffectSyntheticEvent.js';\nexport { useTrackElement } from './useTrackElement.js';\nexport { useWindowScrollerList } from './useWindowScrollerList.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAoB,WAAXA,gBAA6B;AACtC,SAAoB,WAAXA,gBAAiC;AAC1C,SAAoB,WAAXA,gBAAoC;AAE7C,SAAS,8BAA8B;AACvC,SAAS,qCAAqC;AAC9C,SAAS,sCAAsC;AAC/C,SAAS,gCAAgC;AACzC,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,cAAc,8BAA8B;AACrD,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAC3B,SAAS,6BAA6B;AACtC,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;AACrC,SAAS,gBAAgB,yCAAyC;AAClE,SAAS,qCAAqC;AAC9C,SAAS,+BAA+B;AACxC,SAAS,cAAc,8BAA8B;AACrD,SAAS,0BAA0B;AACnC,SAAS,mBAAmB,mCAAmC;AAC/D,SAAS,oBAAoB,oCAAoC;AACjE,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,mCAAmC;AAC5C,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
function useControlledUncontrolledState(config) {
|
|
4
|
+
const { defaultState, controlledState, onChange } = config;
|
|
5
|
+
const [state, setState] = React2.useState(defaultState);
|
|
6
|
+
const shouldUseControlledState = Object.hasOwnProperty.call(config, "controlledState");
|
|
7
|
+
const finalState = React2.useMemo(() => {
|
|
8
|
+
if (shouldUseControlledState)
|
|
9
|
+
return controlledState;
|
|
10
|
+
return state;
|
|
11
|
+
}, [shouldUseControlledState, controlledState, state]);
|
|
12
|
+
const finalSetState = React2.useCallback(
|
|
13
|
+
(newVal) => {
|
|
14
|
+
setState(newVal);
|
|
15
|
+
if (onChange)
|
|
16
|
+
onChange(newVal);
|
|
17
|
+
},
|
|
18
|
+
[onChange]
|
|
19
|
+
);
|
|
20
|
+
return [finalState, finalSetState];
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
useControlledUncontrolledState
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=useControlledUncontrolledState.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useControlledUncontrolledState.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\n\nexport function useControlledUncontrolledState<T = unknown>(config: {\n defaultState: T;\n controlledState?: T;\n onChange?: (newState: T) => void;\n}): [T, (newVal: T) => void] {\n const { defaultState, controlledState, onChange } = config;\n const [state, setState] = React.useState<T>(defaultState);\n // due to javascript \"falsy\" crazy bonanza,\n // we are gonna use Object.hasOwnProperty to check if controlledState should be used\n // this covers scenarios such as `controlledState=undefined`/`controlledState=null`/`controlledState=false`/`controlledState=0`/`controlledState=''`\n // where we want to use the controlledState but we want the value to be the falsy value itself...\n const shouldUseControlledState = Object.hasOwnProperty.call(config, 'controlledState');\n const finalState = React.useMemo(() => {\n if (shouldUseControlledState) return controlledState as T;\n return state;\n }, [shouldUseControlledState, controlledState, state]);\n const finalSetState = React.useCallback(\n (newVal: T) => {\n setState(newVal);\n if (onChange) onChange(newVal);\n },\n [onChange],\n );\n return [finalState, finalSetState];\n}\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAEX,SAAS,+BAA4C,QAI/B;AAC3B,QAAM,EAAE,cAAc,iBAAiB,SAAS,IAAI;AACpD,QAAM,CAAC,OAAO,QAAQ,IAAIA,OAAM,SAAY,YAAY;AAKxD,QAAM,2BAA2B,OAAO,eAAe,KAAK,QAAQ,iBAAiB;AACrF,QAAM,aAAaA,OAAM,QAAQ,MAAM;AACrC,QAAI;AAA0B,aAAO;AACrC,WAAO;AAAA,EACT,GAAG,CAAC,0BAA0B,iBAAiB,KAAK,CAAC;AACrD,QAAM,gBAAgBA,OAAM;AAAA,IAC1B,CAAC,WAAc;AACb,eAAS,MAAM;AACf,UAAI;AAAU,iBAAS,MAAM;AAAA,IAC/B;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AACA,SAAO,CAAC,YAAY,aAAa;AACnC;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -71,6 +71,7 @@ import { setRef, mergeRefs, setMultipleRefs, logger } from "./system.js";
|
|
|
71
71
|
import {
|
|
72
72
|
useCallbackAfterRender,
|
|
73
73
|
useCancellableDelayedCallback,
|
|
74
|
+
useControlledUncontrolledState,
|
|
74
75
|
useDerivedStateFromProps,
|
|
75
76
|
useExecutionTimer,
|
|
76
77
|
useExpandState,
|
|
@@ -198,6 +199,7 @@ export {
|
|
|
198
199
|
uniqBy,
|
|
199
200
|
useCallbackAfterRender,
|
|
200
201
|
useCancellableDelayedCallback,
|
|
202
|
+
useControlledUncontrolledState,
|
|
201
203
|
useDerivedStateFromProps,
|
|
202
204
|
useExecutionTimer,
|
|
203
205
|
useExpandState,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default as getComponentFromProps } from './getComponentFromProps.js';\nexport { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements.js';\nexport { capitalize } from './capitalize.js';\nexport { getObjectValuesToArray, getObjectKeysToArray } from './objectUtilities.js';\nexport {\n checkEmpty,\n checkNotEmpty,\n contains,\n equal,\n greaterThan,\n greaterThanOrEquals,\n isIn,\n isNotIn,\n isNotNull,\n isNull,\n lessThanOrEquals,\n notEqual,\n startsWith,\n validDate,\n} from './operators.js';\nexport {\n addOrRemove,\n arrayMove,\n cloneDeep,\n curry,\n cx,\n debounce,\n differenceBy,\n differenceWith,\n filter,\n findIndex,\n get,\n groupBy,\n hashArray,\n isBoolean,\n isEmpty,\n isEqual,\n isEqualWith,\n isFunction,\n isNaN,\n isObject,\n isString,\n maxBy,\n meanBy,\n noop,\n omit,\n orderBy,\n padStart,\n parseInt,\n pick,\n pickBy,\n property,\n pull,\n range,\n removeUndefinedProperties,\n runAll,\n safeCall,\n set,\n sortBy,\n sumBy,\n throttle,\n toggleInArray,\n toggleInObject,\n transform,\n uniq,\n uniqBy,\n values,\n} from './utils.js';\nexport { setRef, mergeRefs, setMultipleRefs, logger } from './system.js';\nexport {\n useCallbackAfterRender,\n useCancellableDelayedCallback,\n useDerivedStateFromProps,\n useExecutionTimer,\n useExpandState,\n useFocusTrap,\n UseFocusTrapWithSchema,\n useForceUpdate,\n useHeadlessTooltip,\n useHotkeys,\n useHoverHandlersDelay,\n useIsMobile,\n useIsShowingEllipsis,\n useMakeMutable,\n useLatestValueReferenciallyStable,\n useMeasure,\n useNativeIntersectionObserver,\n useNativeResizeObserver,\n useOnBlurOut,\n UseOnBlurOutWithSchema,\n useOnClickOutside,\n useOnElementResize,\n useOnFirstFocusIn,\n UseOnFirstFocusInWithSchema,\n useOnSpecificFocus,\n UseOnSpecificFocusWithSchema,\n usePrevious,\n useResizeObserver,\n useShouldRecalculate,\n useSideEffectSyntheticEvent,\n useTrackElement,\n useWindowScrollerList,\n} from './hooks/index.js';\nexport { getVisibleTimeByFormat, addLeadingZeros } from './timeUtils.js';\nexport { compose } from './compose.js';\nexport { DOCUMENT, WINDOW } from './platform.js';\nexport { isDOMTypeElement } from './reactTypesUtility.js';\nexport { isRequired, isGreaterThan, isValidDate } from './validations.js';\nexport { getHighlightedRerendersStyle } from './getHighlightedRerendersStyle.js';\n\nexport { crossTypeSort } from './algorithms/crossTypeSort.js';\nexport { appendComponentIfNotExist } from './addComponentIfNotExists.js';\n// TODO -- REMOVE WHEN READY\nexport * from './deprecated/index.js';\nexport * from './props-helpers/index.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAoB,WAAXA,gBAAwC;AACjD,SAAoB,WAAXA,gBAA0D;AACnE,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB,4BAA4B;AAC7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,QAAQ,WAAW,iBAAiB,cAAc;AAC3D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default as getComponentFromProps } from './getComponentFromProps.js';\nexport { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements.js';\nexport { capitalize } from './capitalize.js';\nexport { getObjectValuesToArray, getObjectKeysToArray } from './objectUtilities.js';\nexport {\n checkEmpty,\n checkNotEmpty,\n contains,\n equal,\n greaterThan,\n greaterThanOrEquals,\n isIn,\n isNotIn,\n isNotNull,\n isNull,\n lessThanOrEquals,\n notEqual,\n startsWith,\n validDate,\n} from './operators.js';\nexport {\n addOrRemove,\n arrayMove,\n cloneDeep,\n curry,\n cx,\n debounce,\n differenceBy,\n differenceWith,\n filter,\n findIndex,\n get,\n groupBy,\n hashArray,\n isBoolean,\n isEmpty,\n isEqual,\n isEqualWith,\n isFunction,\n isNaN,\n isObject,\n isString,\n maxBy,\n meanBy,\n noop,\n omit,\n orderBy,\n padStart,\n parseInt,\n pick,\n pickBy,\n property,\n pull,\n range,\n removeUndefinedProperties,\n runAll,\n safeCall,\n set,\n sortBy,\n sumBy,\n throttle,\n toggleInArray,\n toggleInObject,\n transform,\n uniq,\n uniqBy,\n values,\n} from './utils.js';\nexport { setRef, mergeRefs, setMultipleRefs, logger } from './system.js';\nexport {\n useCallbackAfterRender,\n useCancellableDelayedCallback,\n useControlledUncontrolledState,\n useDerivedStateFromProps,\n useExecutionTimer,\n useExpandState,\n useFocusTrap,\n UseFocusTrapWithSchema,\n useForceUpdate,\n useHeadlessTooltip,\n useHotkeys,\n useHoverHandlersDelay,\n useIsMobile,\n useIsShowingEllipsis,\n useMakeMutable,\n useLatestValueReferenciallyStable,\n useMeasure,\n useNativeIntersectionObserver,\n useNativeResizeObserver,\n useOnBlurOut,\n UseOnBlurOutWithSchema,\n useOnClickOutside,\n useOnElementResize,\n useOnFirstFocusIn,\n UseOnFirstFocusInWithSchema,\n useOnSpecificFocus,\n UseOnSpecificFocusWithSchema,\n usePrevious,\n useResizeObserver,\n useShouldRecalculate,\n useSideEffectSyntheticEvent,\n useTrackElement,\n useWindowScrollerList,\n} from './hooks/index.js';\n\nexport { getVisibleTimeByFormat, addLeadingZeros } from './timeUtils.js';\nexport { compose } from './compose.js';\nexport { DOCUMENT, WINDOW } from './platform.js';\nexport { isDOMTypeElement } from './reactTypesUtility.js';\nexport { isRequired, isGreaterThan, isValidDate } from './validations.js';\nexport { getHighlightedRerendersStyle } from './getHighlightedRerendersStyle.js';\n\nexport { crossTypeSort } from './algorithms/crossTypeSort.js';\nexport { appendComponentIfNotExist } from './addComponentIfNotExists.js';\n// TODO -- REMOVE WHEN READY\nexport * from './deprecated/index.js';\nexport * from './props-helpers/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAoB,WAAXA,gBAAwC;AACjD,SAAoB,WAAXA,gBAA0D;AACnE,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB,4BAA4B;AAC7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,QAAQ,WAAW,iBAAiB,cAAc;AAC3D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,wBAAwB,uBAAuB;AACxD,SAAS,eAAe;AACxB,SAAS,UAAU,cAAc;AACjC,SAAS,wBAAwB;AACjC,SAAS,YAAY,eAAe,mBAAmB;AACvD,SAAS,oCAAoC;AAE7C,SAAS,qBAAqB;AAC9B,SAAS,iCAAiC;AAE1C,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -3,6 +3,7 @@ export { default as useForceUpdate } from 'use-force-update';
|
|
|
3
3
|
export { default as useOnClickOutside } from 'use-onclickoutside';
|
|
4
4
|
export { useCallbackAfterRender } from './useCallbackAfterRender.js';
|
|
5
5
|
export { useCancellableDelayedCallback } from './useCancellableDelayedCallback.js';
|
|
6
|
+
export { useControlledUncontrolledState } from './useControlledUncontrolledState.js';
|
|
6
7
|
export { useDerivedStateFromProps } from './useDerivedStateFromProps.js';
|
|
7
8
|
export { useExecutionTimer } from './useExecutionTimer.js';
|
|
8
9
|
export { useExpandState } from './useExpandState.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { getObjectValuesToArray, getObjectKeysToArray } from './objectUtilities.
|
|
|
5
5
|
export { checkEmpty, checkNotEmpty, contains, equal, greaterThan, greaterThanOrEquals, isIn, isNotIn, isNotNull, isNull, lessThanOrEquals, notEqual, startsWith, validDate, } from './operators.js';
|
|
6
6
|
export { addOrRemove, arrayMove, cloneDeep, curry, cx, debounce, differenceBy, differenceWith, filter, findIndex, get, groupBy, hashArray, isBoolean, isEmpty, isEqual, isEqualWith, isFunction, isNaN, isObject, isString, maxBy, meanBy, noop, omit, orderBy, padStart, parseInt, pick, pickBy, property, pull, range, removeUndefinedProperties, runAll, safeCall, set, sortBy, sumBy, throttle, toggleInArray, toggleInObject, transform, uniq, uniqBy, values, } from './utils.js';
|
|
7
7
|
export { setRef, mergeRefs, setMultipleRefs, logger } from './system.js';
|
|
8
|
-
export { useCallbackAfterRender, useCancellableDelayedCallback, useDerivedStateFromProps, useExecutionTimer, useExpandState, useFocusTrap, UseFocusTrapWithSchema, useForceUpdate, useHeadlessTooltip, useHotkeys, useHoverHandlersDelay, useIsMobile, useIsShowingEllipsis, useMakeMutable, useLatestValueReferenciallyStable, useMeasure, useNativeIntersectionObserver, useNativeResizeObserver, useOnBlurOut, UseOnBlurOutWithSchema, useOnClickOutside, useOnElementResize, useOnFirstFocusIn, UseOnFirstFocusInWithSchema, useOnSpecificFocus, UseOnSpecificFocusWithSchema, usePrevious, useResizeObserver, useShouldRecalculate, useSideEffectSyntheticEvent, useTrackElement, useWindowScrollerList, } from './hooks/index.js';
|
|
8
|
+
export { useCallbackAfterRender, useCancellableDelayedCallback, useControlledUncontrolledState, useDerivedStateFromProps, useExecutionTimer, useExpandState, useFocusTrap, UseFocusTrapWithSchema, useForceUpdate, useHeadlessTooltip, useHotkeys, useHoverHandlersDelay, useIsMobile, useIsShowingEllipsis, useMakeMutable, useLatestValueReferenciallyStable, useMeasure, useNativeIntersectionObserver, useNativeResizeObserver, useOnBlurOut, UseOnBlurOutWithSchema, useOnClickOutside, useOnElementResize, useOnFirstFocusIn, UseOnFirstFocusInWithSchema, useOnSpecificFocus, UseOnSpecificFocusWithSchema, usePrevious, useResizeObserver, useShouldRecalculate, useSideEffectSyntheticEvent, useTrackElement, useWindowScrollerList, } from './hooks/index.js';
|
|
9
9
|
export { getVisibleTimeByFormat, addLeadingZeros } from './timeUtils.js';
|
|
10
10
|
export { compose } from './compose.js';
|
|
11
11
|
export { DOCUMENT, WINDOW } from './platform.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-utilities",
|
|
3
|
-
"version": "3.22.0-next.
|
|
3
|
+
"version": "3.22.0-next.26",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Utilities",
|
|
6
6
|
"files": [
|
|
@@ -160,14 +160,14 @@
|
|
|
160
160
|
"use-force-update": "~1.0.11",
|
|
161
161
|
"use-measure": "~0.3.0",
|
|
162
162
|
"use-onclickoutside": "~0.4.1",
|
|
163
|
-
"@elliemae/ds-props-helpers": "3.22.0-next.
|
|
163
|
+
"@elliemae/ds-props-helpers": "3.22.0-next.26"
|
|
164
164
|
},
|
|
165
165
|
"devDependencies": {
|
|
166
166
|
"@elliemae/pui-cli": "~9.0.0-next.22",
|
|
167
167
|
"@testing-library/react": "~12.1.3",
|
|
168
168
|
"@testing-library/react-hooks": "~8.0.1",
|
|
169
169
|
"react-dom": "^17.0.2",
|
|
170
|
-
"@elliemae/ds-monorepo-devops": "3.22.0-next.
|
|
170
|
+
"@elliemae/ds-monorepo-devops": "3.22.0-next.26"
|
|
171
171
|
},
|
|
172
172
|
"peerDependencies": {
|
|
173
173
|
"lodash": "^4.17.21",
|