@elliemae/ds-utilities 3.4.3-rc.1 → 3.4.3
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/capitalize.js +4 -1
- package/dist/cjs/capitalize.js.map +1 -1
- package/dist/cjs/compose.js +7 -2
- package/dist/cjs/compose.js.map +1 -1
- package/dist/cjs/deprecated/deprecatedMsg.js +4 -1
- package/dist/cjs/deprecated/deprecatedMsg.js.map +1 -1
- package/dist/cjs/deprecated/index.js +4 -1
- package/dist/cjs/deprecated/index.js.map +1 -1
- package/dist/cjs/deprecated/reactTypesUtility.js +4 -1
- package/dist/cjs/deprecated/reactTypesUtility.js.map +2 -2
- package/dist/cjs/deprecated/scrollingTimer.js +4 -1
- package/dist/cjs/deprecated/scrollingTimer.js.map +1 -1
- package/dist/cjs/deprecated/useParentElement.js +4 -1
- package/dist/cjs/deprecated/useParentElement.js.map +1 -1
- package/dist/cjs/deprecated/useSetRef.js +4 -1
- package/dist/cjs/deprecated/useSetRef.js.map +1 -1
- package/dist/cjs/deprecated/useUncontrolled.js +4 -1
- package/dist/cjs/deprecated/useUncontrolled.js.map +2 -2
- package/dist/cjs/deprecated/useWindowSize.js +4 -1
- package/dist/cjs/deprecated/useWindowSize.js.map +1 -1
- package/dist/cjs/getComponentFromProps.js +16 -7
- package/dist/cjs/getComponentFromProps.js.map +2 -2
- package/dist/cjs/hooks/index.js +4 -1
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useCallbackAfterRender.js +4 -1
- package/dist/cjs/hooks/useCallbackAfterRender.js.map +1 -1
- package/dist/cjs/hooks/useCancellableDelayedCallback.js +10 -4
- package/dist/cjs/hooks/useCancellableDelayedCallback.js.map +1 -1
- package/dist/cjs/hooks/useDerivedStateFromProps.js +4 -1
- package/dist/cjs/hooks/useDerivedStateFromProps.js.map +1 -1
- package/dist/cjs/hooks/useExecutionTimer.js +4 -1
- package/dist/cjs/hooks/useExecutionTimer.js.map +1 -1
- package/dist/cjs/hooks/useExpandState.js +4 -1
- package/dist/cjs/hooks/useExpandState.js.map +1 -1
- package/dist/cjs/hooks/useFocusTrap.js +34 -20
- package/dist/cjs/hooks/useFocusTrap.js.map +1 -1
- package/dist/cjs/hooks/useHotkeys.js +4 -1
- package/dist/cjs/hooks/useHotkeys.js.map +2 -2
- package/dist/cjs/hooks/useHoverHandlersDelay.js +4 -1
- package/dist/cjs/hooks/useHoverHandlersDelay.js.map +1 -1
- package/dist/cjs/hooks/useIsMobile.js +4 -1
- package/dist/cjs/hooks/useIsMobile.js.map +1 -1
- package/dist/cjs/hooks/useIsShowingEllipsis.js +14 -8
- package/dist/cjs/hooks/useIsShowingEllipsis.js.map +1 -1
- package/dist/cjs/hooks/useOnBlurOut.js +15 -9
- package/dist/cjs/hooks/useOnBlurOut.js.map +1 -1
- package/dist/cjs/hooks/useOnElementResize.js +11 -5
- package/dist/cjs/hooks/useOnElementResize.js.map +1 -1
- package/dist/cjs/hooks/useOnFirstFocusIn.js +35 -23
- package/dist/cjs/hooks/useOnFirstFocusIn.js.map +1 -1
- package/dist/cjs/hooks/useOnSpecificFocus.js +15 -7
- package/dist/cjs/hooks/useOnSpecificFocus.js.map +1 -1
- package/dist/cjs/hooks/usePrevious.js +4 -1
- package/dist/cjs/hooks/usePrevious.js.map +1 -1
- package/dist/cjs/hooks/useResizeObserver.js +23 -12
- package/dist/cjs/hooks/useResizeObserver.js.map +2 -2
- package/dist/cjs/hooks/useShouldRecalculate.js +4 -1
- package/dist/cjs/hooks/useShouldRecalculate.js.map +1 -1
- package/dist/cjs/hooks/useWindowScrollerList.js +20 -14
- package/dist/cjs/hooks/useWindowScrollerList.js.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/objectUtilities.js +4 -1
- package/dist/cjs/objectUtilities.js.map +1 -1
- package/dist/cjs/onClickHandlerForNonInteractiveElements.js +4 -1
- package/dist/cjs/onClickHandlerForNonInteractiveElements.js.map +1 -1
- package/dist/cjs/operators.js +4 -1
- package/dist/cjs/operators.js.map +1 -1
- package/dist/cjs/platform.js +4 -1
- package/dist/cjs/platform.js.map +1 -1
- package/dist/cjs/props-helpers/defaultProps/index.js +4 -1
- package/dist/cjs/props-helpers/defaultProps/index.js.map +1 -1
- package/dist/cjs/props-helpers/defaultProps/useMemoMergePropsWithDefault.js +4 -1
- package/dist/cjs/props-helpers/defaultProps/useMemoMergePropsWithDefault.js.map +2 -2
- package/dist/cjs/props-helpers/getProps/index.js +4 -1
- package/dist/cjs/props-helpers/getProps/index.js.map +1 -1
- package/dist/cjs/props-helpers/globalProps/constants.js +7 -2
- package/dist/cjs/props-helpers/globalProps/constants.js.map +1 -1
- package/dist/cjs/props-helpers/globalProps/getGlobalAttributes.js +4 -1
- package/dist/cjs/props-helpers/globalProps/getGlobalAttributes.js.map +1 -1
- package/dist/cjs/props-helpers/globalProps/globalAttributesPropTypes.js +4 -1
- package/dist/cjs/props-helpers/globalProps/globalAttributesPropTypes.js.map +1 -1
- package/dist/cjs/props-helpers/globalProps/index.js +4 -1
- package/dist/cjs/props-helpers/globalProps/index.js.map +1 -1
- package/dist/cjs/props-helpers/globalProps/useGetGlobalAttributes.js +8 -2
- package/dist/cjs/props-helpers/globalProps/useGetGlobalAttributes.js.map +1 -1
- package/dist/cjs/props-helpers/index.js +4 -1
- package/dist/cjs/props-helpers/index.js.map +1 -1
- package/dist/cjs/props-helpers/propTypes/PropTypes.js +4 -1
- package/dist/cjs/props-helpers/propTypes/PropTypes.js.map +1 -1
- package/dist/cjs/props-helpers/propTypes/customPropTypes.js +4 -1
- package/dist/cjs/props-helpers/propTypes/customPropTypes.js.map +1 -1
- package/dist/cjs/props-helpers/propTypes/describe.js +4 -1
- package/dist/cjs/props-helpers/propTypes/describe.js.map +2 -2
- package/dist/cjs/props-helpers/propTypes/describeConversions.js +17 -4
- package/dist/cjs/props-helpers/propTypes/describeConversions.js.map +2 -2
- package/dist/cjs/props-helpers/propTypes/describeGuards.js +4 -1
- package/dist/cjs/props-helpers/propTypes/describeGuards.js.map +1 -1
- package/dist/cjs/props-helpers/propTypes/index.js +4 -1
- package/dist/cjs/props-helpers/propTypes/index.js.map +2 -2
- package/dist/cjs/props-helpers/propTypes/toTypescript.js +4 -1
- package/dist/cjs/props-helpers/propTypes/toTypescript.js.map +1 -1
- package/dist/cjs/props-helpers/propTypes/types.js +4 -1
- package/dist/cjs/props-helpers/propTypes/types.js.map +1 -1
- package/dist/cjs/props-helpers/tests/globalProps/TestComponent.js +9 -4
- package/dist/cjs/props-helpers/tests/globalProps/TestComponent.js.map +1 -1
- package/dist/cjs/props-helpers/tests/validation/test.schema.js +4 -1
- package/dist/cjs/props-helpers/tests/validation/test.schema.js.map +1 -1
- package/dist/cjs/props-helpers/tests/xstyledProps/TestComponent.js +9 -4
- package/dist/cjs/props-helpers/tests/xstyledProps/TestComponent.js.map +1 -1
- package/dist/cjs/props-helpers/useDeprecateComponent/index.js +4 -1
- package/dist/cjs/props-helpers/useDeprecateComponent/index.js.map +1 -1
- package/dist/cjs/props-helpers/validation/errorTemplates.js +12 -5
- package/dist/cjs/props-helpers/validation/errorTemplates.js.map +1 -1
- package/dist/cjs/props-helpers/validation/index.js +4 -1
- package/dist/cjs/props-helpers/validation/index.js.map +1 -1
- package/dist/cjs/props-helpers/validation/typescriptGuards.js +4 -1
- package/dist/cjs/props-helpers/validation/typescriptGuards.js.map +1 -1
- package/dist/cjs/props-helpers/validation/typescriptParsers.js +4 -1
- package/dist/cjs/props-helpers/validation/typescriptParsers.js.map +1 -1
- package/dist/cjs/props-helpers/validation/typescriptValidator.js +20 -3
- package/dist/cjs/props-helpers/validation/typescriptValidator.js.map +1 -1
- package/dist/cjs/props-helpers/xstyledProps/constants.js +7 -2
- package/dist/cjs/props-helpers/xstyledProps/constants.js.map +1 -1
- package/dist/cjs/props-helpers/xstyledProps/index.js +4 -1
- package/dist/cjs/props-helpers/xstyledProps/index.js.map +1 -1
- package/dist/cjs/props-helpers/xstyledProps/useGetXstyledProps.js +4 -1
- package/dist/cjs/props-helpers/xstyledProps/useGetXstyledProps.js.map +1 -1
- package/dist/cjs/props-helpers/xstyledProps/xstyledPropTypes.js +4 -1
- package/dist/cjs/props-helpers/xstyledProps/xstyledPropTypes.js.map +1 -1
- package/dist/cjs/reactTypesUtility.js +4 -1
- package/dist/cjs/reactTypesUtility.js.map +2 -2
- package/dist/cjs/system.js +4 -1
- package/dist/cjs/system.js.map +1 -1
- package/dist/cjs/timeUtils.js +4 -1
- package/dist/cjs/timeUtils.js.map +1 -1
- package/dist/cjs/utils.js +4 -1
- package/dist/cjs/utils.js.map +1 -1
- package/dist/cjs/validations.js +4 -1
- package/dist/cjs/validations.js.map +1 -1
- package/dist/esm/capitalize.js.map +1 -1
- package/dist/esm/compose.js +3 -1
- package/dist/esm/compose.js.map +1 -1
- package/dist/esm/deprecated/deprecatedMsg.js.map +1 -1
- package/dist/esm/deprecated/index.js.map +1 -1
- package/dist/esm/deprecated/reactTypesUtility.js.map +2 -2
- package/dist/esm/deprecated/scrollingTimer.js.map +1 -1
- package/dist/esm/deprecated/useParentElement.js.map +1 -1
- package/dist/esm/deprecated/useSetRef.js.map +1 -1
- package/dist/esm/deprecated/useUncontrolled.js.map +1 -1
- package/dist/esm/deprecated/useWindowSize.js.map +1 -1
- package/dist/esm/getComponentFromProps.js +12 -6
- package/dist/esm/getComponentFromProps.js.map +2 -2
- package/dist/esm/hooks/index.js.map +2 -2
- package/dist/esm/hooks/useCallbackAfterRender.js.map +1 -1
- package/dist/esm/hooks/useCancellableDelayedCallback.js +6 -3
- package/dist/esm/hooks/useCancellableDelayedCallback.js.map +1 -1
- package/dist/esm/hooks/useDerivedStateFromProps.js.map +1 -1
- package/dist/esm/hooks/useExecutionTimer.js.map +1 -1
- package/dist/esm/hooks/useExpandState.js.map +1 -1
- package/dist/esm/hooks/useFocusTrap.js +30 -19
- package/dist/esm/hooks/useFocusTrap.js.map +1 -1
- package/dist/esm/hooks/useHotkeys.js.map +1 -1
- package/dist/esm/hooks/useHoverHandlersDelay.js.map +1 -1
- package/dist/esm/hooks/useIsMobile.js.map +1 -1
- package/dist/esm/hooks/useIsShowingEllipsis.js +10 -7
- package/dist/esm/hooks/useIsShowingEllipsis.js.map +1 -1
- package/dist/esm/hooks/useOnBlurOut.js +11 -8
- package/dist/esm/hooks/useOnBlurOut.js.map +1 -1
- package/dist/esm/hooks/useOnElementResize.js +7 -4
- package/dist/esm/hooks/useOnElementResize.js.map +1 -1
- package/dist/esm/hooks/useOnFirstFocusIn.js +31 -22
- package/dist/esm/hooks/useOnFirstFocusIn.js.map +1 -1
- package/dist/esm/hooks/useOnSpecificFocus.js +11 -6
- package/dist/esm/hooks/useOnSpecificFocus.js.map +1 -1
- package/dist/esm/hooks/usePrevious.js.map +1 -1
- package/dist/esm/hooks/useResizeObserver.js +19 -11
- package/dist/esm/hooks/useResizeObserver.js.map +1 -1
- package/dist/esm/hooks/useShouldRecalculate.js.map +1 -1
- package/dist/esm/hooks/useWindowScrollerList.js +16 -13
- package/dist/esm/hooks/useWindowScrollerList.js.map +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/objectUtilities.js.map +1 -1
- package/dist/esm/onClickHandlerForNonInteractiveElements.js.map +1 -1
- package/dist/esm/operators.js.map +1 -1
- package/dist/esm/platform.js.map +1 -1
- package/dist/esm/props-helpers/defaultProps/index.js.map +1 -1
- package/dist/esm/props-helpers/defaultProps/useMemoMergePropsWithDefault.js.map +1 -1
- package/dist/esm/props-helpers/getProps/index.js.map +1 -1
- package/dist/esm/props-helpers/globalProps/constants.js +3 -1
- package/dist/esm/props-helpers/globalProps/constants.js.map +1 -1
- package/dist/esm/props-helpers/globalProps/getGlobalAttributes.js.map +1 -1
- package/dist/esm/props-helpers/globalProps/globalAttributesPropTypes.js.map +1 -1
- package/dist/esm/props-helpers/globalProps/index.js.map +1 -1
- package/dist/esm/props-helpers/globalProps/useGetGlobalAttributes.js +4 -1
- package/dist/esm/props-helpers/globalProps/useGetGlobalAttributes.js.map +1 -1
- package/dist/esm/props-helpers/index.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/PropTypes.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/customPropTypes.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/describe.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/describeConversions.js +13 -3
- package/dist/esm/props-helpers/propTypes/describeConversions.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/describeGuards.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/index.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/toTypescript.js.map +1 -1
- package/dist/esm/props-helpers/propTypes/types.js.map +1 -1
- package/dist/esm/props-helpers/tests/globalProps/TestComponent.js +5 -3
- package/dist/esm/props-helpers/tests/globalProps/TestComponent.js.map +2 -2
- package/dist/esm/props-helpers/tests/validation/test.schema.js.map +1 -1
- package/dist/esm/props-helpers/tests/xstyledProps/TestComponent.js +5 -3
- package/dist/esm/props-helpers/tests/xstyledProps/TestComponent.js.map +2 -2
- package/dist/esm/props-helpers/useDeprecateComponent/index.js.map +1 -1
- package/dist/esm/props-helpers/validation/errorTemplates.js +8 -4
- package/dist/esm/props-helpers/validation/errorTemplates.js.map +1 -1
- package/dist/esm/props-helpers/validation/index.js.map +1 -1
- package/dist/esm/props-helpers/validation/typescriptGuards.js.map +1 -1
- package/dist/esm/props-helpers/validation/typescriptParsers.js.map +1 -1
- package/dist/esm/props-helpers/validation/typescriptValidator.js +16 -2
- package/dist/esm/props-helpers/validation/typescriptValidator.js.map +1 -1
- package/dist/esm/props-helpers/xstyledProps/constants.js +3 -1
- package/dist/esm/props-helpers/xstyledProps/constants.js.map +1 -1
- package/dist/esm/props-helpers/xstyledProps/index.js.map +1 -1
- package/dist/esm/props-helpers/xstyledProps/useGetXstyledProps.js.map +1 -1
- package/dist/esm/props-helpers/xstyledProps/xstyledPropTypes.js.map +1 -1
- package/dist/esm/reactTypesUtility.js.map +2 -2
- package/dist/esm/system.js.map +1 -1
- package/dist/esm/timeUtils.js.map +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/validations.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/xstyledProps/constants.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["const marginKeys = [\n 'margin',\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'm',\n 'mt',\n 'mr',\n 'mb',\n 'ml',\n 'mx',\n 'my',\n];\n\nconst paddingKeys = [\n 'padding',\n 'p',\n 'paddingTop',\n 'pt',\n 'paddingRight',\n 'pr',\n 'paddingBottom',\n 'pb',\n 'paddingLeft',\n 'pl',\n 'px',\n 'py',\n];\n\nconst spaceKeys = ['spaceY', 'spaceX', 'spaceXReverse', 'spaceYReverse'];\n\nconst widthKeys = ['width', 'w', 'maxWidth', 'maxW', 'minWidth', 'minW'];\n\nconst heightKeys = ['height', 'h', 'maxHeight', 'maxH', 'minHeight', 'minH'];\n\nconst maskSizeKeys = ['maskSize'];\n\nconst spacingKeys = [...marginKeys, ...paddingKeys, ...spaceKeys];\nconst sizingKeys = [...widthKeys, ...heightKeys, ...maskSizeKeys];\nexport const layoutKeys = [\n 'display',\n 'float',\n 'boxSizing',\n 'container',\n 'overflow',\n 'overflowX',\n 'overflowY',\n 'zIndex',\n 'position',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'visibility',\n 'overscrollBehavior',\n 'objectFit',\n];\n\nexport const xstyledKeys = Object.fromEntries(\n [...spacingKeys, ...sizingKeys, ...layoutKeys].map((item) => [item, true]),\n) as Record<string, true>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,aAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,YAAY,CAAC,UAAU,UAAU,iBAAiB,eAAe;AAEvE,MAAM,YAAY,CAAC,SAAS,KAAK,YAAY,QAAQ,YAAY,MAAM;AAEvE,MAAM,aAAa,CAAC,UAAU,KAAK,aAAa,QAAQ,aAAa,MAAM;AAE3E,MAAM,eAAe,CAAC,UAAU;AAEhC,MAAM,cAAc,CAAC,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS;AAChE,MAAM,aAAa,CAAC,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY;AACzD,MAAM,aAAa;AAAA,EACxB;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;AACF;AAEO,MAAM,cAAc,OAAO;AAAA,EAChC,CAAC,GAAG,aAAa,GAAG,YAAY,GAAG,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,7 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
19
|
+
mod
|
|
20
|
+
));
|
|
18
21
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
22
|
var xstyledProps_exports = {};
|
|
20
23
|
module.exports = __toCommonJS(xstyledProps_exports);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/xstyledProps/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export * from './useGetXstyledProps';\nexport * from './xstyledPropTypes';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,iCAAc,iCAAd;AACA,iCAAc,+BADd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var useGetXstyledProps_exports = {};
|
|
23
26
|
__export(useGetXstyledProps_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/xstyledProps/useGetXstyledProps.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { useMemo } from 'react';\nimport type { SizingProps, SpaceProps, LayoutProps } from '@elliemae/ds-system';\nimport { xstyledKeys } from './constants';\n\nexport interface XstyledProps extends SpaceProps, SizingProps, LayoutProps {}\n\ntype PropsWithXstyled<T> = T & XstyledProps;\n\nexport const useGetXstyledProps = <T,>(props: PropsWithXstyled<T>): XstyledProps => {\n const componentXstyledProps = useMemo(() => {\n const xstyledPropsObject: Record<string, unknown> = {};\n Object.entries(props).forEach(([key, value]) => {\n if (key in xstyledKeys) {\n xstyledPropsObject[key] = value;\n }\n });\n return xstyledPropsObject;\n }, [props]);\n\n return componentXstyledProps as XstyledProps;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAExB,uBAA4B;AAMrB,MAAM,qBAAqB,CAAK,UAA6C;AAClF,QAAM,4BAAwB,sBAAQ,MAAM;AAC1C,UAAM,qBAA8C,CAAC;AACrD,WAAO,QAAQ,KAAK,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC9C,UAAI,OAAO,8BAAa;AACtB,2BAAmB,OAAO;AAAA,MAC5B;AAAA,IACF,CAAC;AACD,WAAO;AAAA,EACT,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var xstyledPropTypes_exports = {};
|
|
23
26
|
__export(xstyledPropTypes_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/props-helpers/xstyledProps/xstyledPropTypes.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { PropTypes } from '../propTypes';\n\n// Based on https://github.com/gregberge/xstyled/blob/c0c92b459bb3a5de46d7854be3667861f816baa5/packages/prop-types/src/index.ts\nconst xstyledGenericPropType = PropTypes.oneOfType([\n PropTypes.number,\n PropTypes.string,\n PropTypes.object,\n PropTypes.bool,\n]);\n\nconst genericDescription = 'Applies to the root container. For more info read xstyled docs';\n\nexport const xstyledPropTypes = {\n margin: xstyledGenericPropType.description(genericDescription).xstyled(),\n m: xstyledGenericPropType.description(genericDescription).xstyled(),\n marginTop: xstyledGenericPropType.description(genericDescription).xstyled(),\n mt: xstyledGenericPropType.description(genericDescription).xstyled(),\n marginRight: xstyledGenericPropType.description(genericDescription).xstyled(),\n mr: xstyledGenericPropType.description(genericDescription).xstyled(),\n marginBottom: xstyledGenericPropType.description(genericDescription).xstyled(),\n mb: xstyledGenericPropType.description(genericDescription).xstyled(),\n marginLeft: xstyledGenericPropType.description(genericDescription).xstyled(),\n ml: xstyledGenericPropType.description(genericDescription).xstyled(),\n mx: xstyledGenericPropType.description(genericDescription).xstyled(),\n my: xstyledGenericPropType.description(genericDescription).xstyled(),\n padding: xstyledGenericPropType.description(genericDescription).xstyled(),\n p: xstyledGenericPropType.description(genericDescription).xstyled(),\n paddingTop: xstyledGenericPropType.description(genericDescription).xstyled(),\n pt: xstyledGenericPropType.description(genericDescription).xstyled(),\n paddingRight: xstyledGenericPropType.description(genericDescription).xstyled(),\n pr: xstyledGenericPropType.description(genericDescription).xstyled(),\n paddingBottom: xstyledGenericPropType.description(genericDescription).xstyled(),\n pb: xstyledGenericPropType.description(genericDescription).xstyled(),\n paddingLeft: xstyledGenericPropType.description(genericDescription).xstyled(),\n pl: xstyledGenericPropType.description(genericDescription).xstyled(),\n px: xstyledGenericPropType.description(genericDescription).xstyled(),\n py: xstyledGenericPropType.description(genericDescription).xstyled(),\n spaceY: xstyledGenericPropType.description(genericDescription).xstyled(),\n spaceX: xstyledGenericPropType.description(genericDescription).xstyled(),\n spaceXReverse: xstyledGenericPropType.description(genericDescription).xstyled(),\n spaceYReverse: xstyledGenericPropType.description(genericDescription).xstyled(),\n w: xstyledGenericPropType.description(genericDescription).xstyled(),\n width: xstyledGenericPropType.description(genericDescription).xstyled(),\n maxWidth: xstyledGenericPropType.description(genericDescription).xstyled(),\n maxW: xstyledGenericPropType.description(genericDescription).xstyled(),\n minWidth: xstyledGenericPropType.description(genericDescription).xstyled(),\n minW: xstyledGenericPropType.description(genericDescription).xstyled(),\n h: xstyledGenericPropType.description(genericDescription).xstyled(),\n height: xstyledGenericPropType.description(genericDescription).xstyled(),\n maxHeight: xstyledGenericPropType.description(genericDescription).xstyled(),\n maxH: xstyledGenericPropType.description(genericDescription).xstyled(),\n minHeight: xstyledGenericPropType.description(genericDescription).xstyled(),\n minH: xstyledGenericPropType.description(genericDescription).xstyled(),\n maskSize: xstyledGenericPropType.description(genericDescription).xstyled(),\n display: xstyledGenericPropType.description(genericDescription).xstyled(),\n float: xstyledGenericPropType.description(genericDescription).xstyled(),\n boxSizing: xstyledGenericPropType.description(genericDescription).xstyled(),\n container: xstyledGenericPropType.description(genericDescription).xstyled(),\n overflow: xstyledGenericPropType.description(genericDescription).xstyled(),\n overflowX: xstyledGenericPropType.description(genericDescription).xstyled(),\n overflowY: xstyledGenericPropType.description(genericDescription).xstyled(),\n zIndex: xstyledGenericPropType.description(genericDescription).xstyled(),\n position: xstyledGenericPropType.description(genericDescription).xstyled(),\n top: xstyledGenericPropType.description(genericDescription).xstyled(),\n right: xstyledGenericPropType.description(genericDescription).xstyled(),\n bottom: xstyledGenericPropType.description(genericDescription).xstyled(),\n left: xstyledGenericPropType.description(genericDescription).xstyled(),\n visibility: xstyledGenericPropType.description(genericDescription).xstyled(),\n overscrollBehavior: xstyledGenericPropType.description(genericDescription).xstyled(),\n objectFit: xstyledGenericPropType.description(genericDescription).xstyled(),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA0B;AAG1B,MAAM,yBAAyB,2BAAU,UAAU;AAAA,EACjD,2BAAU;AAAA,EACV,2BAAU;AAAA,EACV,2BAAU;AAAA,EACV,2BAAU;AACZ,CAAC;AAED,MAAM,qBAAqB;AAEpB,MAAM,mBAAmB;AAAA,EAC9B,QAAQ,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACvE,GAAG,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAClE,WAAW,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC1E,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,aAAa,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC5E,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,cAAc,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC7E,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,YAAY,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC3E,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,SAAS,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACxE,GAAG,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAClE,YAAY,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC3E,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,cAAc,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC7E,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,eAAe,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC9E,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,aAAa,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC5E,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,IAAI,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnE,QAAQ,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACvE,QAAQ,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACvE,eAAe,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC9E,eAAe,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC9E,GAAG,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAClE,OAAO,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACtE,UAAU,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACzE,MAAM,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACrE,UAAU,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACzE,MAAM,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACrE,GAAG,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAClE,QAAQ,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACvE,WAAW,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC1E,MAAM,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACrE,WAAW,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC1E,MAAM,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACrE,UAAU,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACzE,SAAS,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACxE,OAAO,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACtE,WAAW,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC1E,WAAW,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC1E,UAAU,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACzE,WAAW,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC1E,WAAW,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC1E,QAAQ,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACvE,UAAU,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACzE,KAAK,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACpE,OAAO,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACtE,QAAQ,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACvE,MAAM,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACrE,YAAY,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EAC3E,oBAAoB,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAAA,EACnF,WAAW,uBAAuB,YAAY,kBAAkB,EAAE,QAAQ;AAC5E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var reactTypesUtility_exports = {};
|
|
23
26
|
__export(reactTypesUtility_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/reactTypesUtility.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\n\nconst isElement = (element: Record<string, unknown> | null | undefined) => React.isValidElement(element);\n\nexport const isDOMTypeElement = (element: Record<string, unknown> | null | undefined) =>\n isElement(element) && typeof element?.type === 'string';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAElB,MAAM,YAAY,CAAC,YAAwD,aAAAA,QAAM,eAAe,OAAO;AAEhG,MAAM,mBAAmB,CAAC,YAC/B,UAAU,OAAO,KAAK,OAAO,SAAS,SAAS;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
package/dist/cjs/system.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var system_exports = {};
|
|
23
26
|
__export(system_exports, {
|
package/dist/cjs/system.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/system.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { isFunction } from './utils';\n\ntype AnyRef<T extends HTMLElement> = React.MutableRefObject<T | null> | ((_ref: T | null) => void);\n\nexport const setRef = <T extends HTMLElement>(ref: AnyRef<T>, value: T) => {\n if (isFunction(ref)) {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n};\n\nexport const mergeRefs = <T extends HTMLElement>(...refs: AnyRef<T>[]) => {\n const mergeRefsFunc = (node: T) => {\n if (!node) return;\n refs.forEach((ref) => setRef(ref, node));\n };\n return mergeRefsFunc;\n};\n\nexport function setMultipleRefs<T = unknown>(\n refs: Array<React.RefObject<T> | React.LegacyRef<T>>,\n): React.RefCallback<T> {\n return (value) => {\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n });\n };\n}\n\nexport function logger(...args: unknown[]) {\n // eslint-disable-next-line no-console\n console.log(...args);\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA2B;AAIpB,MAAM,SAAS,CAAwB,KAAgB,UAAa;AACzE,UAAI,yBAAW,GAAG,GAAG;AACnB,QAAI,KAAK;AAAA,EACX,WAAW,KAAK;AACd,QAAI,UAAU;AAAA,EAChB;AACF;AAEO,MAAM,YAAY,IAA2B,SAAsB;AACxE,QAAM,gBAAgB,CAAC,SAAY;AACjC,QAAI,CAAC;AAAM;AACX,SAAK,QAAQ,CAAC,QAAQ,OAAO,KAAK,IAAI,CAAC;AAAA,EACzC;AACA,SAAO;AACT;AAEO,SAAS,gBACd,MACsB;AACtB,SAAO,CAAC,UAAU;AAChB,SAAK,QAAQ,CAAC,QAAQ;AACpB,UAAI,OAAO,QAAQ,YAAY;AAC7B,YAAI,KAAK;AAAA,MACX,WAAW,OAAO,MAAM;AACtB,QAAC,IAAyC,UAAU;AAAA,MACtD;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEO,SAAS,UAAU,MAAiB;AAEzC,UAAQ,IAAI,GAAG,IAAI;AACrB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/timeUtils.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var timeUtils_exports = {};
|
|
23
26
|
__export(timeUtils_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/timeUtils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { padStart } from './utils';\n\nexport const getVisibleTimeByFormat = (format: string) => ({\n showHours: format.indexOf('H') > -1 || format.indexOf('h') > -1 || format.indexOf('k') > -1,\n showMinutes: format.indexOf('m') > -1,\n showSeconds: format.indexOf('s') > -1,\n use12Hours: format.indexOf('A') > -1 || format.indexOf('h') > -1 || format.indexOf('a') > -1,\n});\n\nexport const addLeadingZeros = (count: number) => (number: number) => padStart(String(number), count, '0');\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyB;AAElB,MAAM,yBAAyB,CAAC,YAAoB;AAAA,EACzD,WAAW,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,IAAI;AAAA,EACzF,aAAa,OAAO,QAAQ,GAAG,IAAI;AAAA,EACnC,aAAa,OAAO,QAAQ,GAAG,IAAI;AAAA,EACnC,YAAY,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,IAAI;AAC5F;AAEO,MAAM,kBAAkB,CAAC,UAAkB,CAAC,eAAmB,uBAAS,OAAO,MAAM,GAAG,OAAO,GAAG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/utils.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var utils_exports = {};
|
|
23
26
|
__export(utils_exports, {
|
package/dist/cjs/utils.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\n/* eslint-disable max-lines */\n/**\n * commonly used functions\n * Add a level of indirection to lodash so we can replace\n * it if desired, while keeping function names the same\n */\n// TODO: Import individual packages vs referencing all of lodash\nimport {\n cloneDeep,\n filter,\n debounce,\n findIndex,\n isEmpty,\n isString,\n isEqual,\n noop,\n omit,\n orderBy,\n pull,\n sumBy,\n maxBy,\n meanBy,\n sortBy,\n transform,\n isFunction,\n uniq,\n uniqBy,\n groupBy,\n property,\n get,\n set,\n range,\n parseInt,\n padStart,\n isNaN,\n values,\n throttle,\n pick,\n pickBy,\n differenceBy,\n differenceWith,\n isEqualWith,\n curry,\n isObject,\n isBoolean,\n} from 'lodash';\n\ntype UnknownFunctionT = (...args: unknown[]) => unknown;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ValidKeys = string | number | symbol;\n\n/**\n * Concatenates classNames from arguments\n *\n * @param {...any} classnames classnames you want to join\n * @returns {string} All classnames string concatenated\n */\nexport const cx = (...classnames: string[]): string => classnames.reduce((result, cn) => `${result} ${cn || ''}`, '');\n\n// if entry exists, remove it, if not, add it\nconst toggleInObject = (obj: Record<string, unknown>, key: string, value: unknown) =>\n obj[key] !== undefined ? omit(obj, [key]) : { ...obj, [key]: value };\n\nconst toggleInArray = (array: unknown[], value: unknown) => (array.indexOf(value) === -1 ? [value] : []);\n\nconst arrayMoveMutate = (array: unknown[], from: number, to: number) => {\n array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]);\n};\n\nconst arrayMove = <T,>(array: T[], from: number, to: number): T[] => {\n array = array.slice();\n arrayMoveMutate(array, from, to);\n return array;\n};\n\nconst accessorDefault = <T,>(item: T): T => item;\n\nconst addOrRemove = <T,>(array: T[], item: T, accessor = accessorDefault): T[] => {\n const index = array.findIndex((iItem) => accessor(iItem) === accessor(item));\n\n if (index !== -1) {\n const nextArray = cloneDeep(array);\n nextArray.splice(index, 1);\n return nextArray;\n }\n\n return [...array, item];\n};\n\nexport function runAll(...fns: (UnknownFunctionT | UnknownFunctionT[])[]) {\n return (...args: unknown[]) =>\n fns.forEach((fn) => {\n if (Array.isArray(fn)) runAll(fn);\n if (isFunction(fn)) fn(...args);\n });\n}\n\nexport function hashArray(arr: (ValidKeys | Record<string, ValidKeys>)[], fieldName?: string) {\n return arr.reduce<Record<ValidKeys, boolean>>((result, item) => {\n const newKey: ValidKeys = fieldName && typeof item === 'object' ? item[fieldName] : (item as ValidKeys);\n return {\n ...result,\n [newKey]: true,\n };\n }, {});\n}\n\nexport function safeCall(fun: unknown, ...args: unknown[]) {\n if (isFunction(fun)) {\n fun(...args);\n }\n}\n\nexport const removeUndefinedProperties = (obj: Record<string, unknown>) => {\n const cleanObject = { ...obj };\n Object.keys(obj).forEach((key) => cleanObject[key] === undefined && delete cleanObject[key]);\n return cleanObject;\n};\n\nexport default {};\nexport {\n isObject,\n curry,\n arrayMove,\n uniq,\n filter,\n uniqBy,\n groupBy,\n property,\n get,\n set,\n cloneDeep,\n debounce,\n findIndex,\n isEmpty,\n isString,\n isEqual,\n maxBy,\n meanBy,\n noop,\n omit,\n orderBy,\n pull,\n sortBy,\n sumBy,\n transform,\n isFunction,\n range,\n parseInt,\n padStart,\n isNaN,\n values,\n throttle,\n toggleInObject,\n toggleInArray,\n pick,\n pickBy,\n differenceBy,\n differenceWith,\n addOrRemove,\n isEqualWith,\n isBoolean,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
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;ACAA,YAAuB;ADQvB,oBAsCO;AAYA,MAAM,KAAK,IAAI,eAAiC,WAAW,OAAO,CAAC,QAAQ,OAAO,GAAG,UAAU,MAAM,MAAM,EAAE;AAGpH,MAAM,iBAAiB,CAAC,KAA8B,KAAa,UACjE,IAAI,SAAS,aAAY,oBAAK,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,MAAM;AAErE,MAAM,gBAAgB,CAAC,OAAkB,UAAoB,MAAM,QAAQ,KAAK,MAAM,KAAK,CAAC,KAAK,IAAI,CAAC;AAEtG,MAAM,kBAAkB,CAAC,OAAkB,MAAc,OAAe;AACtE,QAAM,OAAO,KAAK,IAAI,MAAM,SAAS,KAAK,IAAI,GAAG,MAAM,OAAO,MAAM,CAAC,EAAE,EAAE;AAC3E;AAEA,MAAM,YAAY,CAAK,OAAY,MAAc,OAAoB;AACnE,UAAQ,MAAM,MAAM;AACpB,kBAAgB,OAAO,MAAM,EAAE;AAC/B,SAAO;AACT;AAEA,MAAM,kBAAkB,CAAK,SAAe;AAE5C,MAAM,cAAc,CAAK,OAAY,MAAS,WAAW,oBAAyB;AAChF,QAAM,QAAQ,MAAM,UAAU,CAAC,UAAU,SAAS,KAAK,MAAM,SAAS,IAAI,CAAC;AAE3E,MAAI,UAAU,IAAI;AAChB,UAAM,gBAAY,yBAAU,KAAK;AACjC,cAAU,OAAO,OAAO,CAAC;AACzB,WAAO;AAAA,EACT;AAEA,SAAO,CAAC,GAAG,OAAO,IAAI;AACxB;AAEO,SAAS,UAAU,KAAgD;AACxE,SAAO,IAAI,SACT,IAAI,QAAQ,CAAC,OAAO;AAClB,QAAI,MAAM,QAAQ,EAAE;AAAG,aAAO,EAAE;AAChC,YAAI,0BAAW,EAAE;AAAG,SAAG,GAAG,IAAI;AAAA,EAChC,CAAC;AACL;AAEO,SAAS,UAAU,KAAgD,WAAoB;AAC5F,SAAO,IAAI,OAAmC,CAAC,QAAQ,SAAS;AAC9D,UAAM,SAAoB,aAAa,OAAO,SAAS,WAAW,KAAK,aAAc;AACrF,WAAO;AAAA,MACL,GAAG;AAAA,MACH,CAAC,SAAS;AAAA,IACZ;AAAA,EACF,GAAG,CAAC,CAAC;AACP;AAEO,SAAS,SAAS,QAAiB,MAAiB;AACzD,UAAI,0BAAW,GAAG,GAAG;AACnB,QAAI,GAAG,IAAI;AAAA,EACb;AACF;AAEO,MAAM,4BAA4B,CAAC,QAAiC;AACzE,QAAM,cAAc,EAAE,GAAG,IAAI;AAC7B,SAAO,KAAK,GAAG,EAAE,QAAQ,CAAC,QAAQ,YAAY,SAAS,UAAa,OAAO,YAAY,IAAI;AAC3F,SAAO;AACT;AAEA,IAAO,gBAAQ,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/validations.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var validations_exports = {};
|
|
23
26
|
__export(validations_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/validations.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { checkNotEmpty, greaterThan, validDate } from './operators';\n\ninterface IsRequiredArg {\n value: unknown;\n help?: string;\n}\n\ninterface IsGreaterThanArg {\n value: number;\n help?: string;\n comparator?: number;\n}\n\ninterface IsValidDateArg {\n value: string;\n help?: string;\n format?: string;\n}\n\nexport const isRequired = ({ value, help = 'Field is Required' }: IsRequiredArg) => ({\n payload: help,\n error: checkNotEmpty(value),\n});\n\nexport const isGreaterThan = ({ value, help, comparator = 0 }: IsGreaterThanArg) => {\n const helpMessage = help ?? `Max value ${comparator}`;\n return {\n payload: helpMessage,\n error: greaterThan(value, comparator),\n };\n};\n\nexport const isValidDate = ({ value, help, format = 'MM/DD/AAA' }: IsValidDateArg) => {\n const helpMessage = help ?? `Valid Date is required ${format}`;\n return {\n payload: helpMessage,\n error: !validDate(value),\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAsD;AAmB/C,MAAM,aAAa,CAAC,EAAE,OAAO,OAAO,oBAAoB,OAAsB;AAAA,EACnF,SAAS;AAAA,EACT,WAAO,gCAAc,KAAK;AAC5B;AAEO,MAAM,gBAAgB,CAAC,EAAE,OAAO,MAAM,aAAa,EAAE,MAAwB;AAClF,QAAM,cAAc,QAAQ,aAAa;AACzC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,WAAO,8BAAY,OAAO,UAAU;AAAA,EACtC;AACF;AAEO,MAAM,cAAc,CAAC,EAAE,OAAO,MAAM,SAAS,YAAY,MAAsB;AACpF,QAAM,cAAc,QAAQ,0BAA0B;AACtD,SAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO,KAAC,4BAAU,KAAK;AAAA,EACzB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/capitalize.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const capitalize = (string: string): string => string.charAt(0).toUpperCase() + string.slice(1);\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,aAAa,CAAC,WAA2B,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/compose.js
CHANGED
|
@@ -6,7 +6,9 @@ const compose = (...funcs) => {
|
|
|
6
6
|
if (funcs.length === 1) {
|
|
7
7
|
return funcs[0];
|
|
8
8
|
}
|
|
9
|
-
return funcs.reduce(
|
|
9
|
+
return funcs.reduce(
|
|
10
|
+
(a, b) => (...args) => a(b(...args))
|
|
11
|
+
);
|
|
10
12
|
};
|
|
11
13
|
var compose_default = compose;
|
|
12
14
|
export {
|
package/dist/esm/compose.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/compose.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function. [From redux v4.0.5]\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\ntype UnknownFunctionT = (...args: unknown[]) => unknown;\n\nexport const compose = (...funcs: UnknownFunctionT[]): UnknownFunctionT => {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(\n (a, b) =>\n (...args) =>\n a(b(...args)),\n );\n};\n\nexport default compose;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACahB,MAAM,UAAU,IAAI,UAAgD;AACzE,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,CAAC,QAAQ;AAAA,EAClB;AAEA,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,MAAM;AAAA,EACf;AAEA,SAAO,MAAM;AAAA,IACX,CAAC,GAAG,MACF,IAAI,SACF,EAAE,EAAE,GAAG,IAAI,CAAC;AAAA,EAClB;AACF;AAEA,IAAO,kBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/deprecatedMsg.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const deprecatedMsg = 'is going to be deprecated, please consider removing it from your project';\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,gBAAgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/index.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './reactTypesUtility';\nexport * from './scrollingTimer';\nexport * from './useParentElement';\nexport * from './useSetRef';\nexport * from './useUncontrolled';\nexport * from './useWindowSize';\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/reactTypesUtility.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport React from 'react';\nimport { deprecatedMsg } from './deprecatedMsg';\n\nexport function isClassComponent(component: any) {\n console.warn(`isClassComponent ${deprecatedMsg}`);\n return !!(typeof component === 'function' && !!component.prototype.isReactComponent);\n}\n\nexport function isFunctionComponent(component: any) {\n console.warn(`isFunctionComponent ${deprecatedMsg}`);\n return typeof component === 'function' && String(component).includes('return React.createElement');\n}\n\nexport function isReactComponent(component: any) {\n console.warn(`isReactComponent ${deprecatedMsg}`);\n return !!(isClassComponent(component) || isFunctionComponent(component));\n}\n\nexport function isElement(element: Record<string, unknown> | null | undefined) {\n console.warn(`isElement ${deprecatedMsg}`);\n return React.isValidElement(element);\n}\n\nexport function isCompositeTypeElement(element: Record<string, unknown> | null | undefined) {\n console.warn(`isCompositeTypeElement ${deprecatedMsg}`);\n return isElement(element) && typeof element?.type === 'function';\n}\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,OAAOA,YAAW;AAClB,SAAS,qBAAqB;AAEvB,SAAS,iBAAiB,WAAgB;AAC/C,UAAQ,KAAK,oBAAoB,eAAe;AAChD,SAAO,CAAC,EAAE,OAAO,cAAc,cAAc,CAAC,CAAC,UAAU,UAAU;AACrE;AAEO,SAAS,oBAAoB,WAAgB;AAClD,UAAQ,KAAK,uBAAuB,eAAe;AACnD,SAAO,OAAO,cAAc,cAAc,OAAO,SAAS,EAAE,SAAS,4BAA4B;AACnG;AAEO,SAAS,iBAAiB,WAAgB;AAC/C,UAAQ,KAAK,oBAAoB,eAAe;AAChD,SAAO,CAAC,EAAE,iBAAiB,SAAS,KAAK,oBAAoB,SAAS;AACxE;AAEO,SAAS,UAAU,SAAqD;AAC7E,UAAQ,KAAK,aAAa,eAAe;AACzC,SAAOA,OAAM,eAAe,OAAO;AACrC;AAEO,SAAS,uBAAuB,SAAqD;AAC1F,UAAQ,KAAK,0BAA0B,eAAe;AACtD,SAAO,UAAU,OAAO,KAAK,OAAO,SAAS,SAAS;AACxD;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/scrollingTimer.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable func-names */\nimport { deprecatedMsg } from './deprecatedMsg';\n\nexport const resetTimer = (func: (...args: unknown[]) => unknown) => {\n console.warn(`resetTimer ${deprecatedMsg}`);\n let timeout: NodeJS.Timeout | null;\n return function (this: any, ...args: unknown[]) {\n const lastCall = () => {\n timeout = null;\n func.apply(this, args);\n };\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(lastCall, 300);\n };\n};\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,qBAAqB;AAEvB,MAAM,aAAa,CAAC,SAA0C;AACnE,UAAQ,KAAK,cAAc,eAAe;AAC1C,MAAI;AACJ,SAAO,YAAwB,MAAiB;AAC9C,UAAM,WAAW,MAAM;AACrB,gBAAU;AACV,WAAK,MAAM,MAAM,IAAI;AAAA,IACvB;AAEA,QAAI;AAAS,mBAAa,OAAO;AACjC,cAAU,WAAW,UAAU,GAAG;AAAA,EACpC;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/useParentElement.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useEffect, useState } from 'react';\n\nexport const useParentElement = (ref: React.RefObject<HTMLElement>) => {\n const [parent, setParent] = useState<ParentNode | null>(ref.current);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n if (ref.current) setParent(ref.current.parentNode);\n });\n return parent;\n};\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAgB,WAAW,gBAAgB;AAEpC,MAAM,mBAAmB,CAAC,QAAsC;AACrE,QAAM,CAAC,QAAQ,SAAS,IAAI,SAA4B,IAAI,OAAO;AAGnE,YAAU,MAAM;AACd,QAAI,IAAI;AAAS,gBAAU,IAAI,QAAQ,UAAU;AAAA,EACnD,CAAC;AACD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/useSetRef.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console, @typescript-eslint/ban-ts-comment */\n// @ts-nocheck\nimport { useCallback, useRef } from 'react';\nimport { deprecatedMsg } from './deprecatedMsg';\n\nexport const useSetRef = (initial: unknown) => {\n console.warn(`useSetRef ${deprecatedMsg}`);\n const ref = useRef(initial);\n const setRef = useCallback((node) => {\n ref.current = node;\n }, []);\n return [ref, setRef];\n};\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,aAAa,cAAc;AACpC,SAAS,qBAAqB;AAEvB,MAAM,YAAY,CAAC,YAAqB;AAC7C,UAAQ,KAAK,aAAa,eAAe;AACzC,QAAM,MAAM,OAAO,OAAO;AAC1B,QAAM,SAAS,YAAY,CAAC,SAAS;AACnC,QAAI,UAAU;AAAA,EAChB,GAAG,CAAC,CAAC;AACL,SAAO,CAAC,KAAK,MAAM;AACrB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/useUncontrolled.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useUncontrolled as useUncontrolledImplementation } from 'uncontrollable';\nimport { deprecatedMsg } from './deprecatedMsg';\n\nexport const useUncontrolled = (...args: any[]) => {\n console.warn(`useUncontrolled ${deprecatedMsg}`);\n return useUncontrolledImplementation(...args);\n};\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,mBAAmB,qCAAqC;AACjE,SAAS,qBAAqB;AAEvB,MAAM,kBAAkB,IAAI,SAAgB;AACjD,UAAQ,KAAK,mBAAmB,eAAe;AAC/C,SAAO,8BAA8B,GAAG,IAAI;AAC9C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/useWindowSize.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\nimport { useLayoutEffect, useState } from 'react';\nimport { deprecatedMsg } from './deprecatedMsg';\n\nconst noop = () => {};\n\nexport const useWindowSize = () => {\n console.warn(`useWindowSize ${deprecatedMsg}`);\n const [size, setSize] = useState([0, 0]);\n useLayoutEffect(() => {\n if (!window) return noop;\n function updateSize() {\n setSize([window.innerWidth, window.innerHeight]);\n }\n window.addEventListener('resize', updateSize);\n window.addEventListener('orientationchange', updateSize);\n updateSize();\n return () => {\n window.removeEventListener('resize', updateSize);\n window.removeEventListener('orientationchange', updateSize);\n };\n }, []);\n if (!window) return noop;\n return size;\n};\n\nexport default useWindowSize;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB,gBAAgB;AAC1C,SAAS,qBAAqB;AAE9B,MAAM,OAAO,MAAM;AAAC;AAEb,MAAM,gBAAgB,MAAM;AACjC,UAAQ,KAAK,iBAAiB,eAAe;AAC7C,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC;AACvC,kBAAgB,MAAM;AACpB,QAAI,CAAC;AAAQ,aAAO;AACpB,aAAS,aAAa;AACpB,cAAQ,CAAC,OAAO,YAAY,OAAO,WAAW,CAAC;AAAA,IACjD;AACA,WAAO,iBAAiB,UAAU,UAAU;AAC5C,WAAO,iBAAiB,qBAAqB,UAAU;AACvD,eAAW;AACX,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,UAAU;AAC/C,aAAO,oBAAoB,qBAAqB,UAAU;AAAA,IAC5D;AAAA,EACF,GAAG,CAAC,CAAC;AACL,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO;AACT;AAEA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import React2 from "react";
|
|
3
4
|
const getComponentFromProps = (Component, props, children = []) => {
|
|
4
5
|
if (!Component)
|
|
5
6
|
return null;
|
|
6
7
|
const componentChildren = typeof Component !== "function" && Component.props ? Array.isArray(Component.props.children) ? Component.props.children : [Component.props.children] : null;
|
|
7
|
-
return typeof Component === "function" ? /* @__PURE__ */
|
|
8
|
-
...props
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
return typeof Component === "function" ? /* @__PURE__ */ jsx(Component, {
|
|
9
|
+
...props,
|
|
10
|
+
children
|
|
11
|
+
}) : React2.cloneElement(
|
|
12
|
+
Component,
|
|
13
|
+
{
|
|
14
|
+
...Component.props,
|
|
15
|
+
...props
|
|
16
|
+
},
|
|
17
|
+
componentChildren ? [...componentChildren, ...children] : [...children]
|
|
18
|
+
);
|
|
13
19
|
};
|
|
14
20
|
var getComponentFromProps_default = getComponentFromProps;
|
|
15
21
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/getComponentFromProps.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-nested-ternary, @typescript-eslint/ban-ts-comment */\n// @ts-nocheck\nimport React, { PropsWithChildren } from 'react';\n\nexport const getComponentFromProps = (\n Component: React.ReactElement<PropsWithChildren<unknown>> | React.ComponentType<unknown>,\n props: Record<string, unknown>,\n children = [],\n) => {\n if (!Component) return null;\n const componentChildren =\n typeof Component !== 'function' && Component.props\n ? Array.isArray(Component.props.children)\n ? Component.props.children\n : [Component.props.children]\n : null;\n return typeof Component === 'function' ? (\n <Component {...props}>{children}</Component>\n ) : (\n React.cloneElement(\n Component,\n {\n ...Component.props,\n ...props,\n },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n componentChildren ? [...componentChildren, ...children] : [...children],\n )\n );\n};\n\nexport default getComponentFromProps;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,OAAOA,YAAkC;AAElC,MAAM,wBAAwB,CACnC,WACA,OACA,WAAW,CAAC,MACT;AACH,MAAI,CAAC;AAAW,WAAO;AACvB,QAAM,oBACJ,OAAO,cAAc,cAAc,UAAU,QACzC,MAAM,QAAQ,UAAU,MAAM,QAAQ,IACpC,UAAU,MAAM,WAChB,CAAC,UAAU,MAAM,QAAQ,IAC3B;AACN,SAAO,OAAO,cAAc,aAC1B,oBAAC;AAAA,IAAW,GAAG;AAAA,IAAQ;AAAA,GAAS,IAEhCA,OAAM;AAAA,IACJ;AAAA,IACA;AAAA,MACE,GAAG,UAAU;AAAA,MACb,GAAG;AAAA,IACL;AAAA,IAEA,oBAAoB,CAAC,GAAG,mBAAmB,GAAG,QAAQ,IAAI,CAAC,GAAG,QAAQ;AAAA,EACxE;AAEJ;AAEA,IAAO,gCAAQ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/index.tsx"],
|
|
4
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';\nexport { useCancellableDelayedCallback } from './useCancellableDelayedCallback';\nexport { useDerivedStateFromProps } from './useDerivedStateFromProps';\nexport { useExecutionTimer } from './useExecutionTimer';\nexport { useExpandState } from './useExpandState';\nexport { useFocusTrap, UseFocusTrapWithSchema } from './useFocusTrap';\nexport { useHotkeys } from './useHotkeys';\nexport { useHoverHandlersDelay } from './useHoverHandlersDelay';\nexport { useIsMobile } from './useIsMobile';\nexport { useIsShowingEllipsis } from './useIsShowingEllipsis';\nexport { useOnBlurOut, UseOnBlurOutWithSchema } from './useOnBlurOut';\nexport { useOnElementResize } from './useOnElementResize';\nexport { useOnFirstFocusIn, UseOnFirstFocusInWithSchema } from './useOnFirstFocusIn';\nexport { useOnSpecificFocus, UseOnSpecificFocusWithSchema } from './useOnSpecificFocus';\nexport { usePrevious } from './usePrevious';\nexport { useResizeObserver } from './useResizeObserver';\nexport { useShouldRecalculate } from './useShouldRecalculate';\nexport { useWindowScrollerList } from './useWindowScrollerList';\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
6
|
-
"names": []
|
|
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,kBAAkB;AAC3B,SAAS,6BAA6B;AACtC,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;AACrC,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,6BAA6B;",
|
|
6
|
+
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useCallbackAfterRender.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useRef, useLayoutEffect, useMemo, useEffect } from 'react';\n\ntype Callback = (callback: () => void) => void;\n\n// Inspired in https://github.com/ryuuji3/react-hooks/blob/4b183d61c30abf17efeab2240f8ff652a5dbb8e2/packages/use-callback-after-render/src/hooks/useCallbackAfterRender.ts\nexport const useCallbackAfterRender = (isLayout = false): Callback => {\n const lastRun = useRef<(() => void) | null>(null);\n\n const effect = useMemo(() => (isLayout ? useLayoutEffect : useEffect), [isLayout]);\n\n effect(() => {\n lastRun.current?.();\n lastRun.current = null;\n });\n\n return (callback) => {\n lastRun.current = callback; // schedule callback after render\n };\n};\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,iBAAiB,SAAS,iBAAiB;AAKrD,MAAM,yBAAyB,CAAC,WAAW,UAAoB;AACpE,QAAM,UAAU,OAA4B,IAAI;AAEhD,QAAM,SAAS,QAAQ,MAAO,WAAW,kBAAkB,WAAY,CAAC,QAAQ,CAAC;AAEjF,SAAO,MAAM;AACX,YAAQ,UAAU;AAClB,YAAQ,UAAU;AAAA,EACpB,CAAC;AAED,SAAO,CAAC,aAAa;AACnB,YAAQ,UAAU;AAAA,EACpB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -9,9 +9,12 @@ const useCancellableDelayedCallback = (cb, delay) => {
|
|
|
9
9
|
clearTimeout(timeoutId);
|
|
10
10
|
}
|
|
11
11
|
}, [timeoutRef]);
|
|
12
|
-
const delayedCb = useCallback(
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const delayedCb = useCallback(
|
|
13
|
+
(...args) => {
|
|
14
|
+
timeoutRef.current = setTimeout(() => cb(...args), delay);
|
|
15
|
+
},
|
|
16
|
+
[cb, delay]
|
|
17
|
+
);
|
|
15
18
|
return [delayedCb, cancel];
|
|
16
19
|
};
|
|
17
20
|
var useCancellableDelayedCallback_default = useCancellableDelayedCallback;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useCancellableDelayedCallback.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback, useRef } from 'react';\n\ntype Callback = (...args: unknown[]) => unknown;\n\nexport const useCancellableDelayedCallback = (cb: Callback, delay: number) => {\n const timeoutRef = useRef<NodeJS.Timeout>();\n const cancel = useCallback(() => {\n const timeoutId = timeoutRef.current;\n if (timeoutId) {\n timeoutRef.current = undefined;\n clearTimeout(timeoutId);\n }\n }, [timeoutRef]);\n const delayedCb: Callback = useCallback(\n (...args) => {\n timeoutRef.current = setTimeout(() => cb(...args), delay);\n },\n [cb, delay],\n );\n\n return [delayedCb, cancel];\n};\n\nexport default useCancellableDelayedCallback;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,aAAa,cAAc;AAI7B,MAAM,gCAAgC,CAAC,IAAc,UAAkB;AAC5E,QAAM,aAAa,OAAuB;AAC1C,QAAM,SAAS,YAAY,MAAM;AAC/B,UAAM,YAAY,WAAW;AAC7B,QAAI,WAAW;AACb,iBAAW,UAAU;AACrB,mBAAa,SAAS;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,UAAU,CAAC;AACf,QAAM,YAAsB;AAAA,IAC1B,IAAI,SAAS;AACX,iBAAW,UAAU,WAAW,MAAM,GAAG,GAAG,IAAI,GAAG,KAAK;AAAA,IAC1D;AAAA,IACA,CAAC,IAAI,KAAK;AAAA,EACZ;AAEA,SAAO,CAAC,WAAW,MAAM;AAC3B;AAEA,IAAO,wCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useDerivedStateFromProps.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef, useState } from 'react';\nimport { isEqual, isFunction } from '../utils';\n\ninterface ShouldUpdateArg {\n prop: unknown;\n prevProp: unknown;\n stateValue: unknown;\n}\n\ntype OnUpdateT<T> = (prop: T, prevProp?: T | Record<string, never>) => T;\n\ninterface OptionsT<T> {\n onUpdate?: OnUpdateT<T>;\n shouldUpdate?: (arg: ShouldUpdateArg) => boolean;\n updateOnStateChange?: boolean;\n}\n\nconst defaultPropUpdateOnChange = <T,>(prop: T) => prop;\n\nfunction defaultShouldUpdate({ prop, prevProp, stateValue }: ShouldUpdateArg) {\n return !isEqual(prop, prevProp) && !isEqual(prop, stateValue);\n}\n\nfunction setStateWithUpdate<T>(onUpdate: OnUpdateT<T>, setState: React.Dispatch<React.SetStateAction<T>>) {\n return (state: React.SetStateAction<T>) => {\n setState((prevState: T) => onUpdate(isFunction(state) ? state(prevState) : state, prevState));\n };\n}\n\nexport const useDerivedStateFromProps = <T,>(\n prop: T,\n options: OptionsT<T> = {},\n): [T, React.Dispatch<React.SetStateAction<T>>] => {\n const {\n onUpdate = defaultPropUpdateOnChange as OnUpdateT<T>,\n shouldUpdate = defaultShouldUpdate,\n updateOnStateChange = false,\n } = options;\n\n const [stateValue, setState] = useState(onUpdate(prop, {}));\n const handleSetState = updateOnStateChange ? setStateWithUpdate(onUpdate, setState) : setState;\n const prevProp = useRef(prop);\n\n if (\n shouldUpdate({\n prop,\n prevProp: prevProp.current,\n stateValue,\n })\n ) {\n const nextProp = onUpdate(prop, prevProp.current);\n setState(nextProp);\n }\n prevProp.current = prop;\n return [stateValue, handleSetState];\n};\n\nexport default useDerivedStateFromProps;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAgB,QAAQ,gBAAgB;AACxC,SAAS,SAAS,kBAAkB;AAgBpC,MAAM,4BAA4B,CAAK,SAAY;AAEnD,SAAS,oBAAoB,EAAE,MAAM,UAAU,WAAW,GAAoB;AAC5E,SAAO,CAAC,QAAQ,MAAM,QAAQ,KAAK,CAAC,QAAQ,MAAM,UAAU;AAC9D;AAEA,SAAS,mBAAsB,UAAwB,UAAmD;AACxG,SAAO,CAAC,UAAmC;AACzC,aAAS,CAAC,cAAiB,SAAS,WAAW,KAAK,IAAI,MAAM,SAAS,IAAI,OAAO,SAAS,CAAC;AAAA,EAC9F;AACF;AAEO,MAAM,2BAA2B,CACtC,MACA,UAAuB,CAAC,MACyB;AACjD,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,eAAe;AAAA,IACf,sBAAsB;AAAA,EACxB,IAAI;AAEJ,QAAM,CAAC,YAAY,QAAQ,IAAI,SAAS,SAAS,MAAM,CAAC,CAAC,CAAC;AAC1D,QAAM,iBAAiB,sBAAsB,mBAAmB,UAAU,QAAQ,IAAI;AACtF,QAAM,WAAW,OAAO,IAAI;AAE5B,MACE,aAAa;AAAA,IACX;AAAA,IACA,UAAU,SAAS;AAAA,IACnB;AAAA,EACF,CAAC,GACD;AACA,UAAM,WAAW,SAAS,MAAM,SAAS,OAAO;AAChD,aAAS,QAAQ;AAAA,EACnB;AACA,WAAS,UAAU;AACnB,SAAO,CAAC,YAAY,cAAc;AACpC;AAEA,IAAO,mCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useExecutionTimer.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useRef } from 'react';\n\ntype Callback = (...args: unknown[]) => unknown;\n\nexport const useExecutionTimer = (startFn: Callback, cleanFn: Callback, delayTime: number) => {\n const startTimer = useRef<NodeJS.Timeout>();\n const closeTimer = useRef<NodeJS.Timeout>();\n\n const startFunction: Callback = (...args) => {\n if (closeTimer.current) clearTimeout(closeTimer.current);\n startTimer.current = setTimeout(() => startFn(...args), delayTime);\n };\n\n const cleanFunction: Callback = (...args) => {\n if (startTimer.current) clearTimeout(startTimer.current);\n closeTimer.current = setTimeout(() => cleanFn(...args), 30);\n };\n return [startFunction, cleanFunction];\n};\n\nexport default useExecutionTimer;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AAIhB,MAAM,oBAAoB,CAAC,SAAmB,SAAmB,cAAsB;AAC5F,QAAM,aAAa,OAAuB;AAC1C,QAAM,aAAa,OAAuB;AAE1C,QAAM,gBAA0B,IAAI,SAAS;AAC3C,QAAI,WAAW;AAAS,mBAAa,WAAW,OAAO;AACvD,eAAW,UAAU,WAAW,MAAM,QAAQ,GAAG,IAAI,GAAG,SAAS;AAAA,EACnE;AAEA,QAAM,gBAA0B,IAAI,SAAS;AAC3C,QAAI,WAAW;AAAS,mBAAa,WAAW,OAAO;AACvD,eAAW,UAAU,WAAW,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE;AAAA,EAC5D;AACA,SAAO,CAAC,eAAe,aAAa;AACtC;AAEA,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useExpandState.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport { isFunction } from '../utils';\nimport { useDerivedStateFromProps } from './useDerivedStateFromProps';\n\ntype ItemT = Record<string, string>;\ninterface UseExpandStateArg {\n items?: ItemT[];\n itemKey?: keyof ItemT;\n expanded?: Record<string, boolean>;\n onExpand: (item: ItemT) => void;\n onExpandChange: (nextState: Record<string, boolean>, item?: ItemT) => void;\n onExpandAll: (nextState: Record<string, boolean>) => void;\n onToggleExpand: (item: ItemT) => void;\n onCollapse: (item: ItemT) => void;\n}\n\nconst toggleStateInObject = <T,>(obj: Record<string, T>, key: string, value: T) => {\n const nextObj = { ...obj };\n if (nextObj[key]) {\n delete nextObj[key];\n } else {\n nextObj[key] = value;\n }\n return nextObj;\n};\n\nconst noop = () => null;\n\nexport const useExpandState = ({\n items = [],\n itemKey = 'id',\n expanded: expandedProp = {},\n onExpand,\n onExpandChange = noop,\n onExpandAll = noop,\n onToggleExpand,\n onCollapse,\n}: UseExpandStateArg) => {\n const [expanded, setExpanded] = useDerivedStateFromProps(expandedProp);\n\n const isExpandedAll = useMemo(() => Object.keys(expanded).length === items.length, [expanded, items]);\n\n const toggleExpandAll = (stateData = true) => {\n setExpanded(() => {\n const nextState: Record<string, boolean> = {};\n if (!isExpandedAll) {\n items.forEach((item) => {\n nextState[item[itemKey]] = stateData;\n });\n }\n onExpandChange(nextState);\n onExpandAll(nextState);\n return nextState;\n });\n };\n\n const expand = (item: ItemT, stateData = true) => {\n if (!item) return;\n if (isFunction(onExpand)) {\n onExpand(item);\n }\n setExpanded((prevState) => {\n const key = item[itemKey];\n const nextState = { ...prevState, [key]: stateData };\n onExpandChange(nextState, item);\n return nextState;\n });\n };\n\n const toggleExpand = (item: ItemT, stateData = true) => {\n if (isFunction(onToggleExpand)) {\n onToggleExpand(item);\n }\n setExpanded((prevState) => {\n const key = item[itemKey];\n const nextState = toggleStateInObject(prevState, key, stateData);\n onExpandChange(nextState, item);\n return nextState;\n });\n };\n\n const collapse = (item: ItemT) => {\n if (isFunction(onCollapse)) {\n onCollapse(item);\n }\n setExpanded((prevState) => {\n const nextState = { ...prevState };\n delete nextState[item[itemKey]];\n onExpandChange(nextState, item);\n return nextState;\n });\n };\n\n return {\n state: { expanded, isExpandedAll },\n actions: {\n expand,\n toggleExpandAll,\n toggleExpand,\n collapse,\n },\n setExpanded,\n };\n};\n\nexport default useExpandState;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B,SAAS,gCAAgC;AAczC,MAAM,sBAAsB,CAAK,KAAwB,KAAa,UAAa;AACjF,QAAM,UAAU,EAAE,GAAG,IAAI;AACzB,MAAI,QAAQ,MAAM;AAChB,WAAO,QAAQ;AAAA,EACjB,OAAO;AACL,YAAQ,OAAO;AAAA,EACjB;AACA,SAAO;AACT;AAEA,MAAM,OAAO,MAAM;AAEZ,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAQ,CAAC;AAAA,EACT,UAAU;AAAA,EACV,UAAU,eAAe,CAAC;AAAA,EAC1B;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,CAAC,UAAU,WAAW,IAAI,yBAAyB,YAAY;AAErE,QAAM,gBAAgB,QAAQ,MAAM,OAAO,KAAK,QAAQ,EAAE,WAAW,MAAM,QAAQ,CAAC,UAAU,KAAK,CAAC;AAEpG,QAAM,kBAAkB,CAAC,YAAY,SAAS;AAC5C,gBAAY,MAAM;AAChB,YAAM,YAAqC,CAAC;AAC5C,UAAI,CAAC,eAAe;AAClB,cAAM,QAAQ,CAAC,SAAS;AACtB,oBAAU,KAAK,YAAY;AAAA,QAC7B,CAAC;AAAA,MACH;AACA,qBAAe,SAAS;AACxB,kBAAY,SAAS;AACrB,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,QAAM,SAAS,CAAC,MAAa,YAAY,SAAS;AAChD,QAAI,CAAC;AAAM;AACX,QAAI,WAAW,QAAQ,GAAG;AACxB,eAAS,IAAI;AAAA,IACf;AACA,gBAAY,CAAC,cAAc;AACzB,YAAM,MAAM,KAAK;AACjB,YAAM,YAAY,EAAE,GAAG,WAAW,CAAC,MAAM,UAAU;AACnD,qBAAe,WAAW,IAAI;AAC9B,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,QAAM,eAAe,CAAC,MAAa,YAAY,SAAS;AACtD,QAAI,WAAW,cAAc,GAAG;AAC9B,qBAAe,IAAI;AAAA,IACrB;AACA,gBAAY,CAAC,cAAc;AACzB,YAAM,MAAM,KAAK;AACjB,YAAM,YAAY,oBAAoB,WAAW,KAAK,SAAS;AAC/D,qBAAe,WAAW,IAAI;AAC9B,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,QAAM,WAAW,CAAC,SAAgB;AAChC,QAAI,WAAW,UAAU,GAAG;AAC1B,iBAAW,IAAI;AAAA,IACjB;AACA,gBAAY,CAAC,cAAc;AACzB,YAAM,YAAY,EAAE,GAAG,UAAU;AACjC,aAAO,UAAU,KAAK;AACtB,qBAAe,WAAW,IAAI;AAC9B,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,OAAO,EAAE,UAAU,cAAc;AAAA,IACjC,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEA,IAAO,yBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|