@codeleap/web 7.0.1 → 7.0.2
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/components/ActivityIndicator/index.js +34 -16
- package/dist/components/ActivityIndicator/index.js.map +1 -1
- package/dist/components/ActivityIndicator/styles.js +2 -1
- package/dist/components/ActivityIndicator/types.js +2 -1
- package/dist/components/Badge/index.js +42 -24
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/styles.js +2 -1
- package/dist/components/Badge/types.js +2 -1
- package/dist/components/Button/index.js +36 -19
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/styles.js +2 -1
- package/dist/components/Button/types.js +2 -1
- package/dist/components/Calendar/index.js +29 -12
- package/dist/components/Calendar/index.js.map +1 -1
- package/dist/components/Calendar/styles.js +2 -1
- package/dist/components/Calendar/types.js +2 -1
- package/dist/components/Carousel/index.js +82 -40
- package/dist/components/Carousel/index.js.map +1 -1
- package/dist/components/Carousel/styles.js +2 -1
- package/dist/components/Carousel/types.js +2 -1
- package/dist/components/Checkbox/index.js +42 -24
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.js +2 -1
- package/dist/components/Checkbox/types.js +2 -1
- package/dist/components/Collapse/index.js +35 -17
- package/dist/components/Collapse/index.js.map +1 -1
- package/dist/components/Collapse/styles.js +2 -1
- package/dist/components/Collapse/types.js +2 -1
- package/dist/components/ColorPicker/index.js +51 -33
- package/dist/components/ColorPicker/index.js.map +1 -1
- package/dist/components/ColorPicker/styles.js +2 -1
- package/dist/components/ColorPicker/types.js +2 -1
- package/dist/components/CropPicker/hooks.d.ts +2 -2
- package/dist/components/CropPicker/hooks.js +20 -17
- package/dist/components/CropPicker/hooks.js.map +1 -1
- package/dist/components/CropPicker/index.js +40 -22
- package/dist/components/CropPicker/index.js.map +1 -1
- package/dist/components/CropPicker/styles.js +2 -1
- package/dist/components/CropPicker/types.js +2 -1
- package/dist/components/CropPicker/utils.js +9 -3
- package/dist/components/CropPicker/utils.js.map +1 -1
- package/dist/components/DatePicker/index.js +40 -23
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DatePicker/styles.js +2 -1
- package/dist/components/DatePicker/types.js +2 -1
- package/dist/components/Drawer/index.js +40 -22
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Drawer/styles.js +2 -1
- package/dist/components/Drawer/types.js +2 -1
- package/dist/components/Dropzone/context.js +16 -11
- package/dist/components/Dropzone/context.js.map +1 -1
- package/dist/components/Dropzone/elements.js +19 -13
- package/dist/components/Dropzone/elements.js.map +1 -1
- package/dist/components/Dropzone/index.js +53 -35
- package/dist/components/Dropzone/index.js.map +1 -1
- package/dist/components/Dropzone/styles.js +2 -1
- package/dist/components/Dropzone/types.js +2 -1
- package/dist/components/Dropzone/useDropzone.js +6 -3
- package/dist/components/Dropzone/useDropzone.js.map +1 -1
- package/dist/components/EmptyPlaceholder/index.js +61 -40
- package/dist/components/EmptyPlaceholder/index.js.map +1 -1
- package/dist/components/EmptyPlaceholder/styles.js +2 -1
- package/dist/components/EmptyPlaceholder/types.js +2 -1
- package/dist/components/Field/context.js +17 -11
- package/dist/components/Field/context.js.map +1 -1
- package/dist/components/Field/elements.js +39 -31
- package/dist/components/Field/elements.js.map +1 -1
- package/dist/components/Field/index.js +41 -23
- package/dist/components/Field/index.js.map +1 -1
- package/dist/components/Field/styles.js +2 -1
- package/dist/components/Field/types.js +2 -1
- package/dist/components/Field/useFieldInput.d.ts +1 -1
- package/dist/components/Field/useFieldInput.js +11 -8
- package/dist/components/Field/useFieldInput.js.map +1 -1
- package/dist/components/FileInput/index.js +32 -14
- package/dist/components/FileInput/index.js.map +1 -1
- package/dist/components/FileInput/types.js +2 -1
- package/dist/components/Icon/index.js +44 -26
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Icon/styles.js +2 -1
- package/dist/components/Icon/types.js +2 -1
- package/dist/components/List/context.js +25 -20
- package/dist/components/List/context.js.map +1 -1
- package/dist/components/List/elements.js +74 -33
- package/dist/components/List/elements.js.map +1 -1
- package/dist/components/List/index.js +35 -18
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/List/scroll.js +18 -13
- package/dist/components/List/scroll.js.map +1 -1
- package/dist/components/List/styles.js +2 -1
- package/dist/components/List/types.js +2 -1
- package/dist/components/LoadingOverlay/index.js +38 -20
- package/dist/components/LoadingOverlay/index.js.map +1 -1
- package/dist/components/LoadingOverlay/styles.js +2 -1
- package/dist/components/LoadingOverlay/types.js +2 -1
- package/dist/components/MaskedTextInput/index.js +32 -14
- package/dist/components/MaskedTextInput/index.js.map +1 -1
- package/dist/components/MaskedTextInput/mask.js +4 -1
- package/dist/components/MaskedTextInput/mask.js.map +1 -1
- package/dist/components/MaskedTextInput/types.js +2 -1
- package/dist/components/Modal/context.js +14 -9
- package/dist/components/Modal/context.js.map +1 -1
- package/dist/components/Modal/elements.js +31 -23
- package/dist/components/Modal/elements.js.map +1 -1
- package/dist/components/Modal/index.js +40 -22
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.js +2 -1
- package/dist/components/Modal/types.js +2 -1
- package/dist/components/NumberIncrement/index.js +47 -29
- package/dist/components/NumberIncrement/index.js.map +1 -1
- package/dist/components/NumberIncrement/styles.js +2 -1
- package/dist/components/NumberIncrement/types.js +2 -1
- package/dist/components/NumberIncrement/useNumberIncrement.js +24 -21
- package/dist/components/NumberIncrement/useNumberIncrement.js.map +1 -1
- package/dist/components/Overlay/index.js +39 -21
- package/dist/components/Overlay/index.js.map +1 -1
- package/dist/components/Overlay/styles.js +2 -1
- package/dist/components/Overlay/types.js +2 -1
- package/dist/components/PaginationButtons/index.js +44 -26
- package/dist/components/PaginationButtons/index.js.map +1 -1
- package/dist/components/PaginationButtons/styles.js +2 -1
- package/dist/components/PaginationButtons/types.js +2 -1
- package/dist/components/PaginationIndicator/index.js +42 -24
- package/dist/components/PaginationIndicator/index.js.map +1 -1
- package/dist/components/PaginationIndicator/styles.js +2 -1
- package/dist/components/PaginationIndicator/types.js +2 -1
- package/dist/components/Progress/Bar/Segmented.js +23 -19
- package/dist/components/Progress/Bar/Segmented.js.map +1 -1
- package/dist/components/Progress/Bar/index.js +47 -29
- package/dist/components/Progress/Bar/index.js.map +1 -1
- package/dist/components/Progress/Bar/styles.js +2 -1
- package/dist/components/Progress/Bar/types.js +2 -1
- package/dist/components/Progress/Circle/Segmented.js +26 -22
- package/dist/components/Progress/Circle/Segmented.js.map +1 -1
- package/dist/components/Progress/Circle/index.js +48 -30
- package/dist/components/Progress/Circle/index.js.map +1 -1
- package/dist/components/Progress/Circle/styles.js +2 -1
- package/dist/components/Progress/Circle/types.js +2 -1
- package/dist/components/Progress/index.js +18 -2
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/components/Progress/utils.js +4 -1
- package/dist/components/Progress/utils.js.map +1 -1
- package/dist/components/RadioInput/index.js +47 -26
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.js +2 -1
- package/dist/components/RadioInput/types.js +2 -1
- package/dist/components/SearchInput/index.js +51 -14
- package/dist/components/SearchInput/index.js.map +1 -1
- package/dist/components/SectionFilters/index.js +56 -38
- package/dist/components/SectionFilters/index.js.map +1 -1
- package/dist/components/SectionFilters/styles.js +2 -1
- package/dist/components/SectionFilters/types.js +2 -1
- package/dist/components/Select/context.js +50 -44
- package/dist/components/Select/context.js.map +1 -1
- package/dist/components/Select/elements.js +29 -23
- package/dist/components/Select/elements.js.map +1 -1
- package/dist/components/Select/index.js +41 -24
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.js +2 -1
- package/dist/components/Select/types.js +2 -1
- package/dist/components/Select/useTriggerWidth.js +9 -6
- package/dist/components/Select/useTriggerWidth.js.map +1 -1
- package/dist/components/Slider/index.js +68 -47
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/styles.js +2 -1
- package/dist/components/Slider/types.js +2 -1
- package/dist/components/Switch/index.js +40 -22
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Switch/styles.js +2 -1
- package/dist/components/Switch/types.js +2 -1
- package/dist/components/Tag/index.js +55 -34
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Tag/styles.js +2 -1
- package/dist/components/Tag/types.js +2 -1
- package/dist/components/Text/index.js +48 -27
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Text/styles.js +2 -1
- package/dist/components/Text/types.js +2 -1
- package/dist/components/TextEditor/index.js +50 -29
- package/dist/components/TextEditor/index.js.map +1 -1
- package/dist/components/TextEditor/styles.js +2 -1
- package/dist/components/TextEditor/types.js +2 -1
- package/dist/components/TextInput/index.js +49 -28
- package/dist/components/TextInput/index.js.map +1 -1
- package/dist/components/TextInput/styles.js +2 -1
- package/dist/components/TextInput/types.js +2 -1
- package/dist/components/TextInput/useTextInput.d.ts +2 -2
- package/dist/components/TextInput/useTextInput.js +15 -12
- package/dist/components/TextInput/useTextInput.js.map +1 -1
- package/dist/components/Tooltip/index.js +54 -33
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/components/Tooltip/styles.js +2 -1
- package/dist/components/Tooltip/types.js +2 -1
- package/dist/components/Touchable/index.js +41 -21
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/components/Touchable/styles.js +2 -1
- package/dist/components/Touchable/types.js +2 -1
- package/dist/components/View/index.js +32 -15
- package/dist/components/View/index.js.map +1 -1
- package/dist/components/View/styles.js +2 -1
- package/dist/components/View/types.js +2 -1
- package/dist/components/components.js +57 -41
- package/dist/components/components.js.map +1 -1
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/ListMasonry.js +31 -22
- package/dist/lib/ListMasonry.js.map +1 -1
- package/dist/lib/ThemeVariables.js +11 -6
- package/dist/lib/ThemeVariables.js.map +1 -1
- package/dist/lib/WebStyleRegistry.js +7 -3
- package/dist/lib/WebStyleRegistry.js.map +1 -1
- package/dist/lib/hooks/index.js +38 -22
- package/dist/lib/hooks/index.js.map +1 -1
- package/dist/lib/hooks/useAnimatedStyle.js +9 -5
- package/dist/lib/hooks/useAnimatedStyle.js.map +1 -1
- package/dist/lib/hooks/useAnimatedVariantStyles.js +9 -6
- package/dist/lib/hooks/useAnimatedVariantStyles.js.map +1 -1
- package/dist/lib/hooks/useAsyncSelect.js +11 -8
- package/dist/lib/hooks/useAsyncSelect.js.map +1 -1
- package/dist/lib/hooks/useBreakpointMatch.js +22 -19
- package/dist/lib/hooks/useBreakpointMatch.js.map +1 -1
- package/dist/lib/hooks/useClick.js +10 -7
- package/dist/lib/hooks/useClick.js.map +1 -1
- package/dist/lib/hooks/useClickOutside.js +7 -4
- package/dist/lib/hooks/useClickOutside.js.map +1 -1
- package/dist/lib/hooks/useFileInput.js +7 -3
- package/dist/lib/hooks/useFileInput.js.map +1 -1
- package/dist/lib/hooks/useIsomorphicEffect.js +5 -2
- package/dist/lib/hooks/useIsomorphicEffect.js.map +1 -1
- package/dist/lib/hooks/useKeydown.js +13 -9
- package/dist/lib/hooks/useKeydown.js.map +1 -1
- package/dist/lib/hooks/useListFocus.js +7 -4
- package/dist/lib/hooks/useListFocus.js.map +1 -1
- package/dist/lib/hooks/useMediaQuery.js +11 -8
- package/dist/lib/hooks/useMediaQuery.js.map +1 -1
- package/dist/lib/hooks/usePageExitBlocker.js +10 -6
- package/dist/lib/hooks/usePageExitBlocker.js.map +1 -1
- package/dist/lib/hooks/usePagination.js +13 -10
- package/dist/lib/hooks/usePagination.js.map +1 -1
- package/dist/lib/hooks/usePopState.js +9 -5
- package/dist/lib/hooks/usePopState.js.map +1 -1
- package/dist/lib/hooks/usePopoverDismiss.js +8 -5
- package/dist/lib/hooks/usePopoverDismiss.js.map +1 -1
- package/dist/lib/hooks/useRefresh.js +16 -9
- package/dist/lib/hooks/useRefresh.js.map +1 -1
- package/dist/lib/hooks/useScrollEffect.js +6 -3
- package/dist/lib/hooks/useScrollEffect.js.map +1 -1
- package/dist/lib/hooks/useSearchParams.js +10 -7
- package/dist/lib/hooks/useSearchParams.js.map +1 -1
- package/dist/lib/hooks/useStaticAnimationStyles.js +6 -3
- package/dist/lib/hooks/useStaticAnimationStyles.js.map +1 -1
- package/dist/lib/hooks/useStylesFor.js +13 -9
- package/dist/lib/hooks/useStylesFor.js.map +1 -1
- package/dist/lib/hooks/useTouchableEvents.js +7 -4
- package/dist/lib/hooks/useTouchableEvents.js.map +1 -1
- package/dist/lib/hooks/useWindowFocus.js +11 -7
- package/dist/lib/hooks/useWindowFocus.js.map +1 -1
- package/dist/lib/hooks/useWindowSize.js +10 -7
- package/dist/lib/hooks/useWindowSize.js.map +1 -1
- package/dist/lib/index.js +22 -6
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/tools/index.js +19 -3
- package/dist/lib/tools/index.js.map +1 -1
- package/dist/lib/tools/localStorage.js +12 -8
- package/dist/lib/tools/localStorage.js.map +1 -1
- package/dist/lib/tools/mediaQuery.js +8 -3
- package/dist/lib/tools/mediaQuery.js.map +1 -1
- package/dist/lib/tools/modal.js +18 -13
- package/dist/lib/tools/modal.js.map +1 -1
- package/dist/lib/utils/attributes.js +6 -3
- package/dist/lib/utils/attributes.js.map +1 -1
- package/dist/lib/utils/cache.d.ts +2 -2
- package/dist/lib/utils/cache.js +11 -4
- package/dist/lib/utils/cache.js.map +1 -1
- package/dist/lib/utils/index.js +21 -5
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/lib/utils/pollyfils/scroll.js +5 -1
- package/dist/lib/utils/pollyfils/scroll.js.map +1 -1
- package/dist/lib/utils/stopPropagation.js +4 -1
- package/dist/lib/utils/stopPropagation.js.map +1 -1
- package/dist/lib/utils/test.js +7 -3
- package/dist/lib/utils/test.js.map +1 -1
- package/dist/types/index.js +17 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/utility.js +2 -1
- package/package.json +1 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModalProvider = exports.useModalContext = exports.ModalContext = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const useStylesFor_1 = require("../../lib/hooks/useStylesFor");
|
|
4
7
|
function useModalProvider({ children: _children, ...props }) {
|
|
5
|
-
const styles = useStylesFor('Modal', props.style);
|
|
8
|
+
const styles = (0, useStylesFor_1.useStylesFor)('Modal', props.style);
|
|
6
9
|
const close = () => {
|
|
7
10
|
props.toggle?.();
|
|
8
11
|
props.onClose?.();
|
|
@@ -13,24 +16,26 @@ function useModalProvider({ children: _children, ...props }) {
|
|
|
13
16
|
close,
|
|
14
17
|
};
|
|
15
18
|
}
|
|
16
|
-
|
|
19
|
+
exports.ModalContext = (0, react_1.createContext)(null);
|
|
17
20
|
/**
|
|
18
21
|
* Reads the nearest `Modal.Provider` context value.
|
|
19
22
|
* Throws if called outside a `Modal.Provider` tree.
|
|
20
23
|
*/
|
|
21
|
-
|
|
22
|
-
const ctx = useContext(ModalContext);
|
|
24
|
+
const useModalContext = () => {
|
|
25
|
+
const ctx = (0, react_1.useContext)(exports.ModalContext);
|
|
23
26
|
if (!ctx)
|
|
24
27
|
throw new Error('useModalContext must be used inside Modal.Provider');
|
|
25
28
|
return ctx;
|
|
26
29
|
};
|
|
30
|
+
exports.useModalContext = useModalContext;
|
|
27
31
|
/**
|
|
28
32
|
* Shares resolved styles and the `close` callback with all sub-components in a custom `Modal` layout.
|
|
29
33
|
* Required by `Modal.Backdrop`, `Modal.Box`, `Modal.Header`, `Modal.Body`, and `Modal.Footer` when composed manually.
|
|
30
34
|
* Uses: `useStylesFor`
|
|
31
35
|
*/
|
|
32
|
-
|
|
36
|
+
const ModalProvider = (props) => {
|
|
33
37
|
const value = useModalProvider(props);
|
|
34
|
-
return (
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(exports.ModalContext.Provider, { value: value, children: props.children }));
|
|
35
39
|
};
|
|
40
|
+
exports.ModalProvider = ModalProvider;
|
|
36
41
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/Modal/context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/Modal/context.tsx"],"names":[],"mappings":";;;;AAAA,iCAAiD;AAIjD,+DAA2D;AAE3D,SAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAc;IACrE,MAAM,MAAM,GAAG,IAAA,2BAAY,EAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IAEjD,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,KAAK,CAAC,MAAM,EAAE,EAAE,CAAA;QAChB,KAAK,CAAC,OAAO,EAAE,EAAE,CAAA;IACnB,CAAC,CAAA;IAED,OAAO;QACL,KAAK;QACL,MAAM,EAAE,MAAuC;QAC/C,KAAK;KACN,CAAA;AACH,CAAC;AAIY,QAAA,YAAY,GAAG,IAAA,qBAAa,EAA2B,IAAI,CAAC,CAAA;AAEzE;;;GAGG;AACI,MAAM,eAAe,GAAG,GAAsB,EAAE;IACrD,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,oBAAY,CAAC,CAAA;IACpC,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAA;IAC/E,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAJY,QAAA,eAAe,mBAI3B;AAED;;;;GAIG;AACI,MAAM,aAAa,GAAG,CAAC,KAAiB,EAAE,EAAE;IACjD,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACrC,OAAO,CACL,uBAAC,oBAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAChC,KAAK,CAAC,QAAQ,GACO,CACzB,CAAA;AACH,CAAC,CAAA;AAPY,QAAA,aAAa,iBAOzB"}
|
|
@@ -1,66 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModalFooter = exports.ModalBody = exports.ModalHeader = exports.ModalBox = exports.ModalBackdrop = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
const react_aria_components_1 = require("react-aria-components");
|
|
6
|
+
const types_1 = require("@codeleap/types");
|
|
7
|
+
const View_1 = require("../View");
|
|
8
|
+
const Text_1 = require("../Text");
|
|
9
|
+
const context_1 = require("./context");
|
|
7
10
|
/**
|
|
8
11
|
* Full-screen overlay that controls open/close state and dismiss gestures for the modal.
|
|
9
12
|
* Backdrop click dismissal and Escape-key dismissal are each gated by `closable` + their respective props.
|
|
10
13
|
* Must be rendered inside `Modal.Provider`.
|
|
11
14
|
*/
|
|
12
|
-
|
|
13
|
-
const { styles, close, props } = useModalContext();
|
|
14
|
-
return (
|
|
15
|
+
const ModalBackdrop = ({ children }) => {
|
|
16
|
+
const { styles, close, props } = (0, context_1.useModalContext)();
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ModalOverlay, { isOpen: !!props.visible, onOpenChange: (open) => { if (!open)
|
|
15
18
|
close(); }, isDismissable: !!(props.closable && props.dismissOnBackdrop), isKeyboardDismissDisabled: !props.closeOnEscape, css: styles.backdrop, children: children }));
|
|
16
19
|
};
|
|
20
|
+
exports.ModalBackdrop = ModalBackdrop;
|
|
17
21
|
/**
|
|
18
22
|
* Scoped dialog container that wraps children in a react-aria `Modal` + `Dialog` pair.
|
|
19
23
|
* Falls back to `debugName` or `"Dialog"` as the accessible label when no `title` is provided.
|
|
20
24
|
* Must be rendered inside `Modal.Backdrop`.
|
|
21
25
|
*/
|
|
22
|
-
|
|
23
|
-
const { styles, props } = useModalContext();
|
|
26
|
+
const ModalBox = ({ children, 'aria-label': ariaLabel }) => {
|
|
27
|
+
const { styles, props } = (0, context_1.useModalContext)();
|
|
24
28
|
const resolvedAriaLabel = ariaLabel ?? (!props.title ? (props.debugName ?? 'Dialog') : undefined);
|
|
25
|
-
return (
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.Modal, { css: styles.box, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Dialog, { "aria-label": resolvedAriaLabel, children: children }) }));
|
|
26
30
|
};
|
|
31
|
+
exports.ModalBox = ModalBox;
|
|
27
32
|
/**
|
|
28
33
|
* Renders the modal title, description, and optional close button; returns `null` when none of those are present.
|
|
29
34
|
* Props passed directly override values inherited from `Modal.Provider` context.
|
|
30
35
|
* Uses: `Text`, `View`
|
|
31
36
|
*/
|
|
32
|
-
|
|
33
|
-
const { styles, close, props: ctxProps } = useModalContext();
|
|
37
|
+
const ModalHeader = ({ title, description, showClose, renderClose } = {}) => {
|
|
38
|
+
const { styles, close, props: ctxProps } = (0, context_1.useModalContext)();
|
|
34
39
|
const resolvedTitle = title ?? ctxProps.title;
|
|
35
40
|
const resolvedDescription = description ?? ctxProps.description;
|
|
36
41
|
const resolvedShowClose = showClose ?? ctxProps.showClose;
|
|
37
42
|
const resolvedRenderClose = renderClose ?? ctxProps.renderClose;
|
|
38
|
-
const showCloseButton = resolvedShowClose !== false && TypeGuards.isFunction(resolvedRenderClose);
|
|
43
|
+
const showCloseButton = resolvedShowClose !== false && types_1.TypeGuards.isFunction(resolvedRenderClose);
|
|
39
44
|
const hasHeader = !!resolvedTitle || !!resolvedDescription || showCloseButton;
|
|
40
45
|
if (!hasHeader)
|
|
41
46
|
return null;
|
|
42
|
-
const titleElement = TypeGuards.isString(resolvedTitle) ? (
|
|
43
|
-
return (
|
|
47
|
+
const titleElement = types_1.TypeGuards.isString(resolvedTitle) ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { component: react_aria_components_1.Heading, text: resolvedTitle, slot: 'title', css: styles.title })) : (resolvedTitle ?? null);
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(View_1.View, { component: 'header', style: styles.header, children: [titleElement, resolvedRenderClose?.({ close }) ?? null] }), resolvedDescription && (types_1.TypeGuards.isString(resolvedDescription) ? ((0, jsx_runtime_1.jsx)(Text_1.Text, { text: resolvedDescription, style: styles.description })) : resolvedDescription)] }));
|
|
44
49
|
};
|
|
50
|
+
exports.ModalHeader = ModalHeader;
|
|
45
51
|
/**
|
|
46
52
|
* Scrollable content area of the modal.
|
|
47
53
|
* Must be rendered inside `Modal.Provider`.
|
|
48
54
|
* Uses: `View`
|
|
49
55
|
*/
|
|
50
|
-
|
|
51
|
-
const { styles } = useModalContext();
|
|
52
|
-
return
|
|
56
|
+
const ModalBody = ({ children }) => {
|
|
57
|
+
const { styles } = (0, context_1.useModalContext)();
|
|
58
|
+
return (0, jsx_runtime_1.jsx)(View_1.View, { style: styles.body, children: children });
|
|
53
59
|
};
|
|
60
|
+
exports.ModalBody = ModalBody;
|
|
54
61
|
/**
|
|
55
62
|
* Sticky action area rendered below `Modal.Body`; falls back to the `footer` prop from context when no `children` are supplied.
|
|
56
63
|
* Returns `null` when no content is available.
|
|
57
64
|
* Uses: `View`
|
|
58
65
|
*/
|
|
59
|
-
|
|
60
|
-
const { styles, props } = useModalContext();
|
|
66
|
+
const ModalFooter = ({ children }) => {
|
|
67
|
+
const { styles, props } = (0, context_1.useModalContext)();
|
|
61
68
|
const content = children ?? props.footer;
|
|
62
69
|
if (!content)
|
|
63
70
|
return null;
|
|
64
|
-
return
|
|
71
|
+
return (0, jsx_runtime_1.jsx)(View_1.View, { component: 'footer', style: styles.footer, children: content });
|
|
65
72
|
};
|
|
73
|
+
exports.ModalFooter = ModalFooter;
|
|
66
74
|
//# sourceMappingURL=elements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/components/Modal/elements.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/components/Modal/elements.tsx"],"names":[],"mappings":";;;;AACA,iEAK8B;AAC9B,2CAA4C;AAC5C,kCAA8B;AAC9B,kCAA8B;AAC9B,uCAA2C;AAG3C;;;;GAIG;AACI,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAA2B,EAAE,EAAE;IACrE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAA,yBAAe,GAAE,CAAA;IAElD,OAAO,CACL,uBAAC,oCAAY,IACX,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,EACvB,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI;YAAE,KAAK,EAAE,CAAA,CAAC,CAAC,EAC9C,aAAa,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,iBAAiB,CAAC,EAC5D,yBAAyB,EAAE,CAAC,KAAK,CAAC,aAAa,EAC/C,GAAG,EAAG,MAAc,CAAC,QAAQ,YAE5B,QAAQ,GACI,CAChB,CAAA;AACH,CAAC,CAAA;AAdY,QAAA,aAAa,iBAczB;AAMD;;;;GAIG;AACI,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAY,EAAE,EAAE;IAC1E,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,yBAAe,GAAE,CAAA;IAC3C,MAAM,iBAAiB,GAAG,SAAS,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAEjG,OAAO,CACL,uBAAC,6BAAQ,IAAC,GAAG,EAAG,MAAc,CAAC,GAAG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k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Modal = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
19
|
+
const context_1 = require("./context");
|
|
20
|
+
const elements_1 = require("./elements");
|
|
21
|
+
const WebStyleRegistry_1 = require("../../lib/WebStyleRegistry");
|
|
22
|
+
__exportStar(require("./styles"), exports);
|
|
23
|
+
__exportStar(require("./types"), exports);
|
|
24
|
+
__exportStar(require("./context"), exports);
|
|
25
|
+
__exportStar(require("./elements"), exports);
|
|
9
26
|
/**
|
|
10
27
|
* Accessible dialog that blocks page interaction while open, with backdrop-click and Escape-key dismissal.
|
|
11
28
|
* Controlled via `visible` / `toggle`; defaults to `closable`, `dismissOnBackdrop`, and `closeOnEscape` all `true`.
|
|
12
29
|
* Uses: `Modal.Provider`, `Modal.Backdrop`, `Modal.Box`, `Modal.Header`, `Modal.Body`, `Modal.Footer`
|
|
13
30
|
*/
|
|
14
|
-
|
|
15
|
-
const { children, ...providerProps } = { ...Modal.defaultProps, ...props };
|
|
16
|
-
return (
|
|
31
|
+
const Modal = (props) => {
|
|
32
|
+
const { children, ...providerProps } = { ...exports.Modal.defaultProps, ...props };
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(context_1.ModalProvider, { ...providerProps, children: (0, jsx_runtime_1.jsx)(elements_1.ModalBackdrop, { children: (0, jsx_runtime_1.jsxs)(elements_1.ModalBox, { children: [(0, jsx_runtime_1.jsx)(elements_1.ModalHeader, {}), (0, jsx_runtime_1.jsx)(elements_1.ModalBody, { children: children }), (0, jsx_runtime_1.jsx)(elements_1.ModalFooter, {})] }) }) }));
|
|
17
34
|
};
|
|
18
|
-
Modal
|
|
19
|
-
Modal.
|
|
20
|
-
Modal.
|
|
21
|
-
Modal.
|
|
22
|
-
Modal.
|
|
23
|
-
Modal.
|
|
24
|
-
Modal.
|
|
25
|
-
Modal.
|
|
26
|
-
Modal.
|
|
27
|
-
Modal.
|
|
35
|
+
exports.Modal = Modal;
|
|
36
|
+
exports.Modal.Provider = context_1.ModalProvider;
|
|
37
|
+
exports.Modal.Backdrop = elements_1.ModalBackdrop;
|
|
38
|
+
exports.Modal.Box = elements_1.ModalBox;
|
|
39
|
+
exports.Modal.Header = elements_1.ModalHeader;
|
|
40
|
+
exports.Modal.Body = elements_1.ModalBody;
|
|
41
|
+
exports.Modal.Footer = elements_1.ModalFooter;
|
|
42
|
+
exports.Modal.styleRegistryName = 'Modal';
|
|
43
|
+
exports.Modal.elements = ['backdrop', 'box', 'header', 'body', 'footer', 'title', 'description'];
|
|
44
|
+
exports.Modal.rootElement = 'backdrop';
|
|
45
|
+
exports.Modal.defaultProps = {
|
|
28
46
|
closable: true,
|
|
29
47
|
showClose: true,
|
|
30
48
|
dismissOnBackdrop: true,
|
|
31
49
|
closeOnEscape: true,
|
|
32
50
|
};
|
|
33
|
-
WebStyleRegistry.registerComponent(Modal);
|
|
51
|
+
WebStyleRegistry_1.WebStyleRegistry.registerComponent(exports.Modal);
|
|
34
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3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A;AAExB,mCAAgB,CAAC,iBAAiB,CAAC,aAAK,CAAC,CAAA"}
|
|
@@ -1,56 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.NumberIncrement = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
19
|
+
const types_1 = require("@codeleap/types");
|
|
20
|
+
const react_number_format_1 = require("react-number-format");
|
|
21
|
+
const WebStyleRegistry_1 = require("../../lib/WebStyleRegistry");
|
|
22
|
+
const useStylesFor_1 = require("../../lib/hooks/useStylesFor");
|
|
23
|
+
const useNumberIncrement_1 = require("./useNumberIncrement");
|
|
24
|
+
const Field_1 = require("../Field");
|
|
25
|
+
const lib_1 = require("../../lib");
|
|
26
|
+
const Icon_1 = require("../Icon");
|
|
27
|
+
__exportStar(require("./types"), exports);
|
|
28
|
+
__exportStar(require("./styles"), exports);
|
|
12
29
|
/**
|
|
13
30
|
* Numeric stepper field with `Icon`-driven increment/decrement buttons, optional direct keyboard entry, and `Field` layout (label, helper, left/right sections).
|
|
14
31
|
* Arrow-left/right keyboard events increment or decrement the value while the field is focused; clicking outside closes focus.
|
|
15
32
|
* Uses: `Field.Provider`, `Field.Wrapper`, `Field.Box`, `Field.Heading`, `Field.Helper`, `Field.SectionSlot`, `Icon`, `useNumberIncrement`
|
|
16
33
|
*/
|
|
17
|
-
|
|
34
|
+
const NumberIncrement = (props) => {
|
|
18
35
|
const allProps = {
|
|
19
|
-
...NumberIncrement.defaultProps,
|
|
36
|
+
...exports.NumberIncrement.defaultProps,
|
|
20
37
|
...props,
|
|
21
38
|
};
|
|
22
39
|
const { style, disabled, editable, hasSeparator, format, mask, suffix, separator, prefix, formatter, placeholder, label, helper, } = allProps;
|
|
23
|
-
const { isFocused, hasError, hasValue, errorMessage, incrementDisabled, decrementDisabled, innerInputRef, innerWrapperRef, wrapperRef, handleBlur, handleFocus, handleChange, handleChangeInput, onPressInnerWrapper, inputValue, } = useNumberIncrement(allProps);
|
|
40
|
+
const { isFocused, hasError, hasValue, errorMessage, incrementDisabled, decrementDisabled, innerInputRef, innerWrapperRef, wrapperRef, handleBlur, handleFocus, handleChange, handleChangeInput, onPressInnerWrapper, inputValue, } = (0, useNumberIncrement_1.useNumberIncrement)(allProps);
|
|
24
41
|
const fieldContext = {
|
|
25
42
|
disabled: !!disabled,
|
|
26
43
|
hasValue: !!hasValue,
|
|
27
44
|
error: !!hasError,
|
|
28
45
|
focused: !!isFocused,
|
|
29
46
|
};
|
|
30
|
-
const styles = useStylesFor(NumberIncrement.styleRegistryName, style, fieldContext);
|
|
31
|
-
const stateAttrs = toDataAttrs({ disabled: !!disabled, error: !!hasError, focused: !!isFocused });
|
|
32
|
-
const InputFormat = TypeGuards.isString(format) || TypeGuards.isString(mask)
|
|
33
|
-
? PatternFormat
|
|
34
|
-
: NumericFormat;
|
|
35
|
-
const shouldUseBaseInput = TypeGuards.isFunction(formatter);
|
|
47
|
+
const styles = (0, useStylesFor_1.useStylesFor)(exports.NumberIncrement.styleRegistryName, style, fieldContext);
|
|
48
|
+
const stateAttrs = (0, lib_1.toDataAttrs)({ disabled: !!disabled, error: !!hasError, focused: !!isFocused });
|
|
49
|
+
const InputFormat = types_1.TypeGuards.isString(format) || types_1.TypeGuards.isString(mask)
|
|
50
|
+
? react_number_format_1.PatternFormat
|
|
51
|
+
: react_number_format_1.NumericFormat;
|
|
52
|
+
const shouldUseBaseInput = types_1.TypeGuards.isFunction(formatter);
|
|
36
53
|
const Input = shouldUseBaseInput
|
|
37
|
-
? NumberFormatBase
|
|
54
|
+
? react_number_format_1.NumberFormatBase
|
|
38
55
|
: InputFormat;
|
|
39
56
|
const thousandProps = !shouldUseBaseInput ? {
|
|
40
57
|
thousandSeparator: separator,
|
|
41
|
-
thousandsGroupStyle: hasSeparator || TypeGuards.isString(separator) ? 'thousand' : 'none',
|
|
58
|
+
thousandsGroupStyle: hasSeparator || types_1.TypeGuards.isString(separator) ? 'thousand' : 'none',
|
|
42
59
|
} : {};
|
|
43
|
-
return (
|
|
60
|
+
return ((0, jsx_runtime_1.jsx)(Field_1.Field.Provider, { context: fieldContext, label: label, helper: hasError ? errorMessage : helper, componentName: 'number_increment', leftSection: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: 'minus', onPress: () => handleChange('decrement'), disabled: disabled || decrementDisabled, style: styles.leftSection }), rightSection: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: 'plus', onPress: () => handleChange('increment'), disabled: disabled || incrementDisabled, style: styles.rightSection }), children: (0, jsx_runtime_1.jsxs)(Field_1.Field.Wrapper, { ref: wrapperRef, style: styles.wrapper, children: [(0, jsx_runtime_1.jsx)(Field_1.Field.Heading, { style: styles.heading }), (0, jsx_runtime_1.jsxs)(Field_1.Field.Box, { ref: innerWrapperRef, style: [styles.box, editable ? styles['box:cursor'] : undefined], onClick: onPressInnerWrapper, ...stateAttrs, children: [(0, jsx_runtime_1.jsx)(Field_1.Field.SectionSlot, { position: 'left' }), (0, jsx_runtime_1.jsx)(Input, { displayType: 'input', css: [
|
|
44
61
|
styles.input,
|
|
45
62
|
{
|
|
46
63
|
'&:focus': { outline: 'none', borderWidth: 0, borderColor: 'transparent' },
|
|
47
64
|
},
|
|
48
|
-
], inputMode: 'numeric', onValueChange: handleChangeInput, onBlur: handleBlur, onFocus: handleFocus, value: inputValue, ...thousandProps, suffix: suffix, prefix: prefix, format: TypeGuards.isFunction(formatter) ? formatter : format, mask: mask, placeholder: placeholder, getInputRef: innerInputRef, disabled: disabled }),
|
|
65
|
+
], inputMode: 'numeric', onValueChange: handleChangeInput, onBlur: handleBlur, onFocus: handleFocus, value: inputValue, ...thousandProps, suffix: suffix, prefix: prefix, format: types_1.TypeGuards.isFunction(formatter) ? formatter : format, mask: mask, placeholder: placeholder, getInputRef: innerInputRef, disabled: disabled }), (0, jsx_runtime_1.jsx)(Field_1.Field.SectionSlot, { position: 'right' })] }), (0, jsx_runtime_1.jsx)(Field_1.Field.Helper, { style: styles.helper })] }) }));
|
|
49
66
|
};
|
|
50
|
-
NumberIncrement
|
|
51
|
-
NumberIncrement.
|
|
52
|
-
NumberIncrement.
|
|
53
|
-
NumberIncrement.
|
|
67
|
+
exports.NumberIncrement = NumberIncrement;
|
|
68
|
+
exports.NumberIncrement.styleRegistryName = 'NumberIncrement';
|
|
69
|
+
exports.NumberIncrement.elements = [...Field_1.Field.elements, 'input', 'placeholder'];
|
|
70
|
+
exports.NumberIncrement.rootElement = 'wrapper';
|
|
71
|
+
exports.NumberIncrement.defaultProps = {
|
|
54
72
|
max: 1000000000,
|
|
55
73
|
min: 0,
|
|
56
74
|
step: 1,
|
|
@@ -61,5 +79,5 @@ NumberIncrement.defaultProps = {
|
|
|
61
79
|
format: null,
|
|
62
80
|
formatter: null,
|
|
63
81
|
};
|
|
64
|
-
WebStyleRegistry.registerComponent(NumberIncrement);
|
|
82
|
+
WebStyleRegistry_1.WebStyleRegistry.registerComponent(exports.NumberIncrement);
|
|
65
83
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NumberIncrement/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NumberIncrement/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,2CAA4C;AAE5C,6DAAoF;AACpF,iEAA6D;AAG7D,+DAA2D;AAC3D,6DAAyD;AACzD,oCAAgC;AAEhC,mCAAuC;AAGvC,kCAA8B;AAE9B,0CAAuB;AACvB,2CAAwB;AAExB;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAE,EAAE;IAC7D,MAAM,QAAQ,GAAG;QACf,GAAG,uBAAe,CAAC,YAAY;QAC/B,GAAG,KAAK;KACT,CAAA;IAED,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,SAAS,EACT,MAAM,EACN,SAAS,EACT,WAAW,EACX,KAAK,EACL,MAAM,GACP,GAAG,QAAQ,CAAA;IAEZ,MAAM,EACJ,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,GACX,GAAG,IAAA,uCAAkB,EAAC,QAAQ,CAAC,CAAA;IAEhC,MAAM,YAAY,GAAsB;QACtC,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,KAAK,EAAE,CAAC,CAAC,QAAQ;QACjB,OAAO,EAAE,CAAC,CAAC,SAAS;KACrB,CAAA;IAED,MAAM,MAAM,G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AC,aAAK,CAAC,WAAW,IAAC,QAAQ,EAAC,OAAO,GAAG,IAE5B,EACZ,uBAAC,aAAK,CAAC,MAAM,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,GAAI,IACxB,GACD,CAClB,CAAA;AACH,CAAC,CAAA;AA3HY,QAAA,eAAe,mBA2H3B;AAED,uBAAe,CAAC,iBAAiB,GAAG,iBAAiB,CAAA;AACrD,uBAAe,CAAC,QAAQ,GAAG,CAAC,GAAG,aAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,CAAA;AACtE,uBAAe,CAAC,WAAW,GAAG,SAAS,CAAA;AAEvC,uBAAe,CAAC,YAAY,GAAG;IAC7B,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,KAAK;IACnB,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;CACiB,CAAA;AAElC,mCAAgB,CAAC,iBAAiB,CAAC,uBAAe,CAAC,CAAA"}
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useNumberIncrement = useNumberIncrement;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const Field_1 = require("../Field");
|
|
6
|
+
const form_1 = require("@codeleap/form");
|
|
7
|
+
const types_1 = require("@codeleap/types");
|
|
5
8
|
/**
|
|
6
9
|
* Manages value, focus, increment/decrement button disabled state, and keyboard arrow-key handling for `NumberIncrement`.
|
|
7
10
|
* Clamps the value to `[min, max]` on blur; registers global `keydown` and `mousedown` listeners to track focus outside of React's event system.
|
|
8
11
|
* No provider required; designed to be called only inside `NumberIncrement`.
|
|
9
12
|
*/
|
|
10
|
-
|
|
13
|
+
function useNumberIncrement(props) {
|
|
11
14
|
const { value, onValueChange, field, min, max, forceError, step, } = props;
|
|
12
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
13
|
-
const { fieldHandle, validation, innerInputRef, wrapperRef, inputValue, onInputValueChange, } = useFieldInput(field, fields.number, { value, onValueChange });
|
|
14
|
-
const innerWrapperRef = useRef(null);
|
|
15
|
-
const hasValue = TypeGuards.isString(inputValue)
|
|
15
|
+
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
16
|
+
const { fieldHandle, validation, innerInputRef, wrapperRef, inputValue, onInputValueChange, } = (0, Field_1.useFieldInput)(field, form_1.fields.number, { value, onValueChange });
|
|
17
|
+
const innerWrapperRef = (0, react_1.useRef)(null);
|
|
18
|
+
const hasValue = types_1.TypeGuards.isString(inputValue)
|
|
16
19
|
? inputValue?.length > 0
|
|
17
|
-
: !TypeGuards.isNil(inputValue);
|
|
20
|
+
: !types_1.TypeGuards.isNil(inputValue);
|
|
18
21
|
const hasError = validation?.showError || !!forceError;
|
|
19
22
|
const errorMessage = validation?.message || forceError;
|
|
20
|
-
const incrementDisabled = useMemo(() => {
|
|
21
|
-
if (TypeGuards.isNumber(max) && (Number(inputValue) >= max)) {
|
|
23
|
+
const incrementDisabled = (0, react_1.useMemo)(() => {
|
|
24
|
+
if (types_1.TypeGuards.isNumber(max) && (Number(inputValue) >= max)) {
|
|
22
25
|
return true;
|
|
23
26
|
}
|
|
24
27
|
return false;
|
|
25
28
|
}, [inputValue]);
|
|
26
|
-
const decrementDisabled = useMemo(() => {
|
|
27
|
-
if (TypeGuards.isNumber(min) && (Number(inputValue) <= min)) {
|
|
29
|
+
const decrementDisabled = (0, react_1.useMemo)(() => {
|
|
30
|
+
if (types_1.TypeGuards.isNumber(min) && (Number(inputValue) <= min)) {
|
|
28
31
|
return true;
|
|
29
32
|
}
|
|
30
33
|
return false;
|
|
31
34
|
}, [inputValue]);
|
|
32
|
-
const handleChange = useCallback((action) => {
|
|
35
|
+
const handleChange = (0, react_1.useCallback)((action) => {
|
|
33
36
|
if (action === 'increment' && !incrementDisabled) {
|
|
34
37
|
const newValue = Number(inputValue || min) + step;
|
|
35
38
|
onInputValueChange(newValue);
|
|
@@ -42,21 +45,21 @@ export function useNumberIncrement(props) {
|
|
|
42
45
|
}
|
|
43
46
|
validation?.onInputBlurred?.();
|
|
44
47
|
}, [validation?.onInputBlurred, inputValue]);
|
|
45
|
-
const handleBlur = useCallback(() => {
|
|
46
|
-
if (TypeGuards.isNumber(max) && (inputValue >= max)) {
|
|
48
|
+
const handleBlur = (0, react_1.useCallback)(() => {
|
|
49
|
+
if (types_1.TypeGuards.isNumber(max) && (inputValue >= max)) {
|
|
47
50
|
onInputValueChange(max);
|
|
48
51
|
return;
|
|
49
52
|
}
|
|
50
|
-
else if (TypeGuards.isNumber(min) && (inputValue <= min) || !inputValue) {
|
|
53
|
+
else if (types_1.TypeGuards.isNumber(min) && (inputValue <= min) || !inputValue) {
|
|
51
54
|
onInputValueChange(min);
|
|
52
55
|
return;
|
|
53
56
|
}
|
|
54
57
|
validation?.onInputBlurred?.();
|
|
55
58
|
}, [validation?.onInputBlurred, inputValue]);
|
|
56
|
-
const handleFocus = useCallback(() => {
|
|
59
|
+
const handleFocus = (0, react_1.useCallback)(() => {
|
|
57
60
|
setIsFocused(true);
|
|
58
61
|
}, []);
|
|
59
|
-
useEffect(() => {
|
|
62
|
+
(0, react_1.useEffect)(() => {
|
|
60
63
|
function handleKeyboardEvent(event) {
|
|
61
64
|
if (!isFocused)
|
|
62
65
|
return;
|
|
@@ -72,7 +75,7 @@ export function useNumberIncrement(props) {
|
|
|
72
75
|
document.removeEventListener('keydown', handleKeyboardEvent);
|
|
73
76
|
};
|
|
74
77
|
}, [handleChange, isFocused]);
|
|
75
|
-
useEffect(() => {
|
|
78
|
+
(0, react_1.useEffect)(() => {
|
|
76
79
|
function handleClickOutside(event) {
|
|
77
80
|
if (innerWrapperRef.current && !innerWrapperRef.current.contains(event.target)) {
|
|
78
81
|
setIsFocused(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNumberIncrement.js","sourceRoot":"","sources":["../../../src/components/NumberIncrement/useNumberIncrement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNumberIncrement.js","sourceRoot":"","sources":["../../../src/components/NumberIncrement/useNumberIncrement.ts"],"names":[],"mappings":";;AAYA,gDA6IC;AAzJD,iCAAgF;AAEhF,oCAAwC;AACxC,yCAA8C;AAC9C,2CAA4C;AAG5C;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,KAAoC;IACrE,MAAM,EACJ,KAAK,EACL,aAAa,EACb,KAAK,EACL,GAAG,EACH,GAAG,EACH,UAAU,EACV,IAAI,GACL,GAAG,KAAK,CAAA;IAET,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAA;IAEjD,MAAM,EACJ,WAAW,EACX,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,kBAAkB,GACnB,GAAG,IAAA,qBAAa,EACf,KAAgC,EAChC,aAAM,CAAC,MAAuC,EAC9C,EAAE,KAAK,EAAE,aAAa,EAAE,CACzB,CAAA;IAED,MAAM,eAAe,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAA;IAEpC,MAAM,QAAQ,GAAG,kBAAU,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC9C,CAAC,CAAE,UAAqB,EAAE,MAAM,GAAG,CAAC;QACpC,CAAC,CAAC,CAAC,kBAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IAEjC,MAAM,QAAQ,GAAG,UAAU,EAAE,SAAS,IAAI,CAAC,CAAC,UAAU,CAAA;IAEtD,MAAM,YAAY,GAAG,UAAU,EAAE,OAAO,IAAI,UAAU,CAAA;IAEtD,MAAM,iBAAiB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACrC,IAAI,kBAAU,CAAC,QAAQ,CAAC,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