@codeleap/mobile 4.2.8 → 4.2.10
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/Registry.js +28 -53
- package/dist/Registry.js.map +1 -1
- package/dist/components/ActionIcon/index.js +27 -67
- package/dist/components/ActionIcon/index.js.map +1 -1
- package/dist/components/ActionIcon/styles.js +1 -2
- package/dist/components/ActionIcon/types.js +1 -2
- package/dist/components/ActivityIndicator/index.js +22 -62
- package/dist/components/ActivityIndicator/index.js.map +1 -1
- package/dist/components/ActivityIndicator/styles.js +1 -2
- package/dist/components/ActivityIndicator/types.js +1 -2
- package/dist/components/Autocomplete/index.js +73 -121
- package/dist/components/Autocomplete/index.js.map +1 -1
- package/dist/components/Autocomplete/styles.js +1 -2
- package/dist/components/Autocomplete/types.js +1 -2
- package/dist/components/Avatar/index.js +49 -90
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Avatar/styles.js +1 -2
- package/dist/components/Avatar/types.js +1 -2
- package/dist/components/AvatarGroup/index.js +30 -75
- package/dist/components/AvatarGroup/index.js.map +1 -1
- package/dist/components/AvatarGroup/styles.js +1 -2
- package/dist/components/AvatarGroup/types.js +1 -2
- package/dist/components/Backdrop/index.js +26 -66
- package/dist/components/Backdrop/index.js.map +1 -1
- package/dist/components/Backdrop/styles.js +1 -2
- package/dist/components/Backdrop/types.js +1 -2
- package/dist/components/Badge/index.js +44 -85
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/styles.js +1 -2
- package/dist/components/Badge/types.js +1 -2
- package/dist/components/Button/index.js +49 -98
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/styles.js +1 -2
- package/dist/components/Button/types.js +1 -2
- package/dist/components/Calendar/index.js +27 -68
- package/dist/components/Calendar/index.js.map +1 -1
- package/dist/components/Calendar/types.d.ts +1 -2
- package/dist/components/Calendar/types.js +1 -2
- package/dist/components/Checkbox/index.js +52 -85
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.js +1 -2
- package/dist/components/Checkbox/types.js +1 -2
- package/dist/components/DatePickerModal/index.js +61 -113
- package/dist/components/DatePickerModal/index.js.map +1 -1
- package/dist/components/DatePickerModal/styles.js +1 -2
- package/dist/components/DatePickerModal/types.js +1 -2
- package/dist/components/EmptyPlaceholder/index.js +40 -69
- package/dist/components/EmptyPlaceholder/index.js.map +1 -1
- package/dist/components/EmptyPlaceholder/styles.js +1 -2
- package/dist/components/EmptyPlaceholder/types.js +1 -2
- package/dist/components/FileInput/index.js +112 -178
- package/dist/components/FileInput/index.js.map +1 -1
- package/dist/components/FileInput/types.js +1 -2
- package/dist/components/Grid/index.js +47 -97
- package/dist/components/Grid/index.js.map +1 -1
- package/dist/components/Grid/styles.js +1 -2
- package/dist/components/Grid/types.js +1 -2
- package/dist/components/Icon/index.js +34 -75
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Icon/styles.js +1 -2
- package/dist/components/Icon/types.js +1 -2
- package/dist/components/Image/index.js +53 -96
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/Image/styles.js +1 -2
- package/dist/components/Image/types.js +1 -2
- package/dist/components/ImageView/Spotlight.js +75 -131
- package/dist/components/ImageView/Spotlight.js.map +1 -1
- package/dist/components/ImageView/component.js +8 -15
- package/dist/components/ImageView/component.js.map +1 -1
- package/dist/components/ImageView/index.js +2 -18
- package/dist/components/ImageView/index.js.map +1 -1
- package/dist/components/InputBase/index.js +35 -75
- package/dist/components/InputBase/index.js.map +1 -1
- package/dist/components/InputBase/styles.d.ts +3 -3
- package/dist/components/InputBase/styles.js +49 -50
- package/dist/components/InputBase/styles.js.map +1 -1
- package/dist/components/InputBase/types.d.ts +1 -0
- package/dist/components/InputBase/types.js +1 -2
- package/dist/components/InputBase/utils.js +4 -19
- package/dist/components/InputBase/utils.js.map +1 -1
- package/dist/components/List/index.js +46 -86
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/List/styles.js +1 -2
- package/dist/components/List/types.js +1 -2
- package/dist/components/LoadingOverlay/index.js +28 -66
- package/dist/components/LoadingOverlay/index.js.map +1 -1
- package/dist/components/LoadingOverlay/styles.js +1 -2
- package/dist/components/LoadingOverlay/types.js +1 -2
- package/dist/components/Modal/index.js +77 -113
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.js +1 -2
- package/dist/components/Modal/types.js +1 -2
- package/dist/components/Navigation/Navigation.js +23 -66
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/Navigation/constants.js +7 -10
- package/dist/components/Navigation/constants.js.map +1 -1
- package/dist/components/Navigation/index.js +3 -19
- package/dist/components/Navigation/index.js.map +1 -1
- package/dist/components/Navigation/types.js +1 -2
- package/dist/components/Navigation/utils.js +24 -59
- package/dist/components/Navigation/utils.js.map +1 -1
- package/dist/components/NumberIncrement/index.js +132 -165
- package/dist/components/NumberIncrement/index.js.map +1 -1
- package/dist/components/NumberIncrement/styles.js +1 -2
- package/dist/components/NumberIncrement/types.d.ts +2 -2
- package/dist/components/NumberIncrement/types.js +1 -2
- package/dist/components/NumberIncrement/utils.js +8 -12
- package/dist/components/NumberIncrement/utils.js.map +1 -1
- package/dist/components/Pager/PagerDots.js +17 -54
- package/dist/components/Pager/PagerDots.js.map +1 -1
- package/dist/components/Pager/index.js +43 -97
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/Pager/styles.js +1 -2
- package/dist/components/Pager/types.js +1 -2
- package/dist/components/PaginationIndicator/index.js +23 -38
- package/dist/components/PaginationIndicator/index.js.map +1 -1
- package/dist/components/PaginationIndicator/styles.js +1 -2
- package/dist/components/PaginationIndicator/types.js +1 -2
- package/dist/components/PlacesAutocomplete/index.js +55 -106
- package/dist/components/PlacesAutocomplete/index.js.map +1 -1
- package/dist/components/PlacesAutocomplete/styles.js +1 -2
- package/dist/components/PlacesAutocomplete/types.js +1 -2
- package/dist/components/RadioInput/index.js +46 -84
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.js +1 -2
- package/dist/components/RadioInput/types.js +1 -2
- package/dist/components/RefreshControl/index.js +22 -63
- package/dist/components/RefreshControl/index.js.map +1 -1
- package/dist/components/RefreshControl/styles.js +1 -2
- package/dist/components/RefreshControl/types.js +1 -2
- package/dist/components/Scroll/index.js +33 -81
- package/dist/components/Scroll/index.js.map +1 -1
- package/dist/components/Scroll/styles.js +1 -2
- package/dist/components/Scroll/types.js +1 -2
- package/dist/components/SearchInput/index.js +22 -69
- package/dist/components/SearchInput/index.js.map +1 -1
- package/dist/components/SectionFilters/context.d.ts +6 -0
- package/dist/components/SectionFilters/context.js +4 -8
- package/dist/components/SectionFilters/context.js.map +1 -1
- package/dist/components/SectionFilters/index.js +33 -76
- package/dist/components/SectionFilters/index.js.map +1 -1
- package/dist/components/SectionFilters/types.js +1 -2
- package/dist/components/SectionFilters/useSectionFilters.d.ts +3 -0
- package/dist/components/SectionFilters/useSectionFilters.js +71 -73
- package/dist/components/SectionFilters/useSectionFilters.js.map +1 -1
- package/dist/components/Sections/index.d.ts +8 -8
- package/dist/components/Sections/index.js +61 -106
- package/dist/components/Sections/index.js.map +1 -1
- package/dist/components/Sections/styles.d.ts +1 -1
- package/dist/components/Sections/styles.js +1 -2
- package/dist/components/Sections/types.js +1 -2
- package/dist/components/SegmentedControl/Option.js +13 -31
- package/dist/components/SegmentedControl/Option.js.map +1 -1
- package/dist/components/SegmentedControl/index.js +71 -114
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SegmentedControl/styles.js +1 -2
- package/dist/components/SegmentedControl/types.js +1 -2
- package/dist/components/Select/index.js +94 -157
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.js +1 -2
- package/dist/components/Select/types.js +1 -2
- package/dist/components/Slider/index.js +89 -129
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/styles.d.ts +0 -6
- package/dist/components/Slider/styles.js +1 -2
- package/dist/components/Slider/types.js +1 -2
- package/dist/components/SortablePhotos/index.js +58 -91
- package/dist/components/SortablePhotos/index.js.map +1 -1
- package/dist/components/SortablePhotos/styles.js +1 -2
- package/dist/components/SortablePhotos/types.js +1 -2
- package/dist/components/SortablePhotos/useSortablePhotos.js +93 -157
- package/dist/components/SortablePhotos/useSortablePhotos.js.map +1 -1
- package/dist/components/Switch/index.js +51 -84
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Switch/styles.js +1 -2
- package/dist/components/Switch/types.js +1 -2
- package/dist/components/Text/index.js +40 -88
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Text/styles.js +1 -2
- package/dist/components/Text/types.js +1 -2
- package/dist/components/TextInput/index.js +83 -131
- package/dist/components/TextInput/index.js.map +1 -1
- package/dist/components/TextInput/styles.js +1 -2
- package/dist/components/TextInput/types.js +1 -2
- package/dist/components/Touchable/index.js +69 -122
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/components/Touchable/styles.js +1 -2
- package/dist/components/Touchable/types.js +1 -2
- package/dist/components/View/index.js +19 -51
- package/dist/components/View/index.js.map +1 -1
- package/dist/components/View/styles.js +1 -2
- package/dist/components/View/types.js +1 -2
- package/dist/components/components.js +43 -59
- package/dist/components/components.js.map +1 -1
- package/dist/hooks/index.js +7 -11
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.js +8 -43
- package/dist/index.js.map +1 -1
- package/dist/modules/PressableRipple/index.js +2 -8
- package/dist/modules/PressableRipple/index.js.map +1 -1
- package/dist/modules/PressableRipple/ripple.js +125 -163
- package/dist/modules/PressableRipple/ripple.js.map +1 -1
- package/dist/modules/PressableRipple/styles.js +9 -20
- package/dist/modules/PressableRipple/styles.js.map +1 -1
- package/dist/modules/PressableRipple/type.js +1 -2
- package/dist/modules/reactNavigation.js +10 -21
- package/dist/modules/reactNavigation.js.map +1 -1
- package/dist/modules/textInputMask.js +3 -20
- package/dist/modules/textInputMask.js.map +1 -1
- package/dist/modules/types/textInputMask.js +1 -2
- package/dist/types/index.js +1 -17
- package/dist/types/index.js.map +1 -1
- package/dist/types/utility.js +1 -2
- package/dist/utils/KeyboardAware/context.js +5 -14
- package/dist/utils/KeyboardAware/context.js.map +1 -1
- package/dist/utils/KeyboardAware/index.js +3 -19
- package/dist/utils/KeyboardAware/index.js.map +1 -1
- package/dist/utils/KeyboardAware/keyboardHooks.js +36 -41
- package/dist/utils/KeyboardAware/keyboardHooks.js.map +1 -1
- package/dist/utils/KeyboardAware/types.js +1 -2
- package/dist/utils/KeyboardAware/types.js.map +1 -1
- package/dist/utils/ModalManager/components.js +24 -54
- package/dist/utils/ModalManager/components.js.map +1 -1
- package/dist/utils/ModalManager/context.js +94 -89
- package/dist/utils/ModalManager/context.js.map +1 -1
- package/dist/utils/ModalManager/index.js +7 -10
- package/dist/utils/ModalManager/index.js.map +1 -1
- package/dist/utils/NotificationManager/index.js +115 -245
- package/dist/utils/NotificationManager/index.js.map +1 -1
- package/dist/utils/NotificationManager/types.js +1 -2
- package/dist/utils/OSAlert.js +32 -48
- package/dist/utils/OSAlert.js.map +1 -1
- package/dist/utils/PermissionManager/context.js +138 -255
- package/dist/utils/PermissionManager/context.js.map +1 -1
- package/dist/utils/PermissionManager/index.js +2 -8
- package/dist/utils/PermissionManager/index.js.map +1 -1
- package/dist/utils/PermissionManager/types.js +1 -2
- package/dist/utils/StorageManager.js +39 -46
- package/dist/utils/StorageManager.js.map +1 -1
- package/dist/utils/Subscription.js +30 -54
- package/dist/utils/Subscription.js.map +1 -1
- package/dist/utils/deprecated/notifications.js +143 -250
- package/dist/utils/deprecated/notifications.js.map +1 -1
- package/dist/utils/hooks.js +101 -120
- package/dist/utils/hooks.js.map +1 -1
- package/dist/utils/index.js +14 -43
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/input.js +15 -19
- package/dist/utils/input.js.map +1 -1
- package/dist/utils/locale.js +5 -9
- package/dist/utils/locale.js.map +1 -1
- package/dist/utils/misc.js +25 -40
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/theme.js +24 -33
- package/dist/utils/theme.js.map +1 -1
- package/dist/utils/useQueryListRefresh.js +16 -26
- package/dist/utils/useQueryListRefresh.js.map +1 -1
- package/package.json +6 -6
- package/package.json.bak +2 -2
- package/src/components/Calendar/types.ts +3 -3
- package/src/components/InputBase/styles.ts +35 -23
- package/src/components/InputBase/types.ts +1 -0
- package/src/components/NumberIncrement/index.tsx +8 -2
- package/src/components/NumberIncrement/types.ts +3 -3
- package/src/components/RadioInput/index.tsx +4 -0
- package/src/components/SectionFilters/useSectionFilters.tsx +31 -1
- package/src/components/Sections/index.tsx +3 -2
- package/src/components/Sections/styles.ts +2 -2
- package/src/components/Slider/index.tsx +9 -1
- package/src/components/Slider/styles.ts +0 -6
- package/src/components/TextInput/index.tsx +5 -0
|
@@ -1,84 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
28
|
-
var t = {};
|
|
29
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
-
t[p] = s[p];
|
|
31
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
-
t[p[i]] = s[p[i]];
|
|
35
|
-
}
|
|
36
|
-
return t;
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.Modal = void 0;
|
|
43
|
-
var react_1 = __importDefault(require("react"));
|
|
44
|
-
var View_1 = require("../View");
|
|
45
|
-
var Scroll_1 = require("../Scroll");
|
|
46
|
-
var common_1 = require("@codeleap/common");
|
|
47
|
-
var Backdrop_1 = require("../Backdrop");
|
|
48
|
-
var hooks_1 = require("../../utils/hooks");
|
|
49
|
-
var Text_1 = require("../Text");
|
|
50
|
-
var Touchable_1 = require("../Touchable");
|
|
51
|
-
var ActionIcon_1 = require("../ActionIcon");
|
|
52
|
-
var react_2 = require("react");
|
|
53
|
-
var styles_1 = require("@codeleap/styles");
|
|
54
|
-
var Registry_1 = require("../../Registry");
|
|
55
|
-
var hooks_2 = require("../../hooks");
|
|
56
|
-
var react_native_reanimated_1 = require("react-native-reanimated");
|
|
57
|
-
__exportStar(require("./styles"), exports);
|
|
58
|
-
__exportStar(require("./types"), exports);
|
|
59
|
-
var DefaultHeader = function (props) {
|
|
60
|
-
var styles = props.styles, buttonStyles = props.buttonStyles, _a = props.title, title = _a === void 0 ? null : _a, _b = props.showClose, showClose = _b === void 0 ? false : _b, _c = props.description, description = _c === void 0 ? null : _c, closable = props.closable, debugName = props.debugName, _d = props.closeIconName, closeIconName = _d === void 0 ? 'x' : _d, toggle = props.toggle;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from '../View';
|
|
3
|
+
import { Scroll } from '../Scroll';
|
|
4
|
+
import { TypeGuards } from '@codeleap/common';
|
|
5
|
+
import { Backdrop } from '../Backdrop';
|
|
6
|
+
import { useAnimatedVariantStyles, useBackButton } from '../../utils/hooks';
|
|
7
|
+
import { Text } from '../Text';
|
|
8
|
+
import { Touchable } from '../Touchable';
|
|
9
|
+
import { ActionIcon } from '../ActionIcon';
|
|
10
|
+
import { useState } from 'react';
|
|
11
|
+
import { useNestedStylesByKey, useTheme } from '@codeleap/styles';
|
|
12
|
+
import { MobileStyleRegistry } from '../../Registry';
|
|
13
|
+
import { useStylesFor } from '../../hooks';
|
|
14
|
+
import { SlideInDown, SlideOutDown } from 'react-native-reanimated';
|
|
15
|
+
export * from './styles';
|
|
16
|
+
export * from './types';
|
|
17
|
+
const DefaultHeader = (props) => {
|
|
18
|
+
const { styles, buttonStyles, title = null, showClose = false, description = null, closable, debugName, closeIconName = 'x', toggle, } = props;
|
|
61
19
|
return <>
|
|
62
|
-
{(title || showClose || description) && (<
|
|
63
|
-
<
|
|
64
|
-
{
|
|
20
|
+
{(title || showClose || description) && (<View style={styles.header}>
|
|
21
|
+
<View style={styles.titleWrapper}>
|
|
22
|
+
{TypeGuards.isString(title) ? (<Text text={title} style={styles.title}/>) : (title)}
|
|
65
23
|
|
|
66
|
-
{(showClose && closable) ? (<
|
|
67
|
-
</
|
|
24
|
+
{(showClose && closable) ? (<ActionIcon debugName={`${debugName} modal close button`} icon={closeIconName} onPress={toggle} style={buttonStyles}/>) : null}
|
|
25
|
+
</View>
|
|
68
26
|
|
|
69
|
-
{
|
|
70
|
-
</
|
|
27
|
+
{TypeGuards.isString(description) ? (<Text text={description} style={styles.description}/>) : (description)}
|
|
28
|
+
</View>)}
|
|
71
29
|
</>;
|
|
72
30
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
31
|
+
export const Modal = (modalProps) => {
|
|
32
|
+
const { visible, closable, footer, children, toggle = () => null, dismissOnBackdrop, header = null, debugName, scroll, renderHeader, zIndex = null, scrollProps = {}, closeOnHardwareBackPress, style, boxExiting, boxEntering, ...props } = {
|
|
33
|
+
...Modal.defaultProps,
|
|
34
|
+
...modalProps,
|
|
35
|
+
};
|
|
36
|
+
const themeValues = useTheme(store => store.current?.values);
|
|
37
|
+
const [modalHeight, setModalHeight] = useState(0);
|
|
38
|
+
const styles = useStylesFor(Modal.styleRegistryName, style);
|
|
39
|
+
const buttonStyles = useNestedStylesByKey('closeButton', styles);
|
|
40
|
+
const boxAnimationStyles = useAnimatedVariantStyles({
|
|
41
|
+
updater: (states) => {
|
|
82
42
|
'worklet';
|
|
83
43
|
return visible ? states['box:visible'] : states['box:hidden'];
|
|
84
44
|
},
|
|
@@ -87,69 +47,73 @@ var Modal = function (modalProps) {
|
|
|
87
47
|
transition: styles['box:transition'],
|
|
88
48
|
dependencies: [visible],
|
|
89
49
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
50
|
+
const ScrollComponent = scroll ? Scroll : View;
|
|
51
|
+
const scrollStyle = scroll ? styles?.scroll : styles?.innerWrapper;
|
|
52
|
+
const heightThreshold = themeValues?.height * 0.75;
|
|
53
|
+
const topSpacing = modalHeight > heightThreshold ? styles?.topSpacing : 0;
|
|
54
|
+
const headerProps = {
|
|
55
|
+
...modalProps,
|
|
56
|
+
closable,
|
|
57
|
+
styles,
|
|
58
|
+
buttonStyles,
|
|
59
|
+
};
|
|
60
|
+
const Header = renderHeader || DefaultHeader;
|
|
61
|
+
useBackButton(() => {
|
|
97
62
|
if (visible && closeOnHardwareBackPress) {
|
|
98
63
|
toggle();
|
|
99
64
|
return true;
|
|
100
65
|
}
|
|
101
66
|
}, [visible, toggle, closeOnHardwareBackPress]);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
var height = event.nativeEvent.layout.height;
|
|
67
|
+
const onModalLayout = (event) => {
|
|
68
|
+
const { height } = event.nativeEvent.layout;
|
|
105
69
|
setModalHeight(height);
|
|
106
|
-
|
|
70
|
+
props?.onLayout?.(event);
|
|
107
71
|
};
|
|
108
|
-
return (<
|
|
109
|
-
styles
|
|
110
|
-
|
|
72
|
+
return (<View style={[
|
|
73
|
+
styles?.wrapper,
|
|
74
|
+
// @ts-expect-error
|
|
75
|
+
{ zIndex: TypeGuards.isNumber(zIndex) ? zIndex : styles?.wrapper?.zIndex, ...topSpacing },
|
|
111
76
|
]} pointerEvents={visible ? 'auto' : 'none'}>
|
|
112
|
-
<
|
|
77
|
+
<Backdrop visible={visible} debugName={`Modal ${debugName} backdrop`} style={{
|
|
113
78
|
'wrapper:hidden': styles['backdrop:hidden'],
|
|
114
79
|
'wrapper:visible': styles['backdrop:visible'],
|
|
115
|
-
'wrapper': styles
|
|
80
|
+
'wrapper': styles?.backdrop,
|
|
116
81
|
}} wrapperProps={{
|
|
117
82
|
// @ts-expect-error
|
|
118
83
|
transition: styles['backdrop:transition'],
|
|
119
84
|
}}/>
|
|
120
85
|
|
|
121
|
-
<ScrollComponent contentContainerStyle={styles
|
|
122
|
-
{dismissOnBackdrop ? (<
|
|
123
|
-
{visible ? (<
|
|
86
|
+
<ScrollComponent contentContainerStyle={styles?.scrollContent} showsVerticalScrollIndicator={false} keyboardAware animated {...scrollProps} style={scrollStyle}>
|
|
87
|
+
{dismissOnBackdrop ? (<Touchable onPress={closable && visible ? toggle : (() => { })} debounce={400} debugName={'Modal backdrop touchable'} style={styles?.backdropTouchable} android_ripple={null} noFeedback/>) : null}
|
|
88
|
+
{visible ? (<View animated
|
|
124
89
|
// @ts-ignore
|
|
125
|
-
entering={boxEntering} exiting={boxExiting} {...props} onLayout={onModalLayout} style={styles
|
|
90
|
+
entering={boxEntering} exiting={boxExiting} {...props} onLayout={onModalLayout} style={styles?.box}>
|
|
126
91
|
{header ? header : <Header {...headerProps}/>}
|
|
127
92
|
|
|
128
|
-
<
|
|
93
|
+
<View style={styles?.body}>{children}</View>
|
|
129
94
|
|
|
130
|
-
{footer ? (<
|
|
131
|
-
{typeof footer === 'string' ? <
|
|
132
|
-
</
|
|
133
|
-
</
|
|
95
|
+
{footer ? (<View style={styles?.footer}>
|
|
96
|
+
{typeof footer === 'string' ? <Text text={footer}/> : footer}
|
|
97
|
+
</View>) : null}
|
|
98
|
+
</View>) : null}
|
|
134
99
|
</ScrollComponent>
|
|
135
|
-
</
|
|
100
|
+
</View>);
|
|
136
101
|
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return exports.Modal;
|
|
102
|
+
Modal.styleRegistryName = 'Modal';
|
|
103
|
+
Modal.elements = ['box', 'backdrop', 'innerWrapper', 'scroll', 'body', 'footer', 'header', 'title', 'description', 'closeButton', 'topSpacing'];
|
|
104
|
+
Modal.rootElement = 'wrapper';
|
|
105
|
+
Modal.withVariantTypes = (styles) => {
|
|
106
|
+
return Modal;
|
|
143
107
|
};
|
|
144
|
-
|
|
108
|
+
Modal.defaultProps = {
|
|
145
109
|
closeIconName: 'close',
|
|
146
110
|
closable: true,
|
|
147
111
|
dismissOnBackdrop: true,
|
|
148
112
|
scroll: true,
|
|
149
113
|
closeOnHardwareBackPress: true,
|
|
150
|
-
boxEntering:
|
|
151
|
-
boxExiting:
|
|
114
|
+
boxEntering: SlideInDown.build(),
|
|
115
|
+
boxExiting: SlideOutDown.build(),
|
|
152
116
|
};
|
|
153
|
-
|
|
154
|
-
|
|
117
|
+
MobileStyleRegistry.registerComponent(Modal);
|
|
118
|
+
export default Modal;
|
|
155
119
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AA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;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CAEZ;MAAA,EAAE,eAAe,CACnB;IAAA,EAAE,IAAI,CAAE,CACT,CAAA;AACH,CAAC,CAAA;AAED,KAAK,CAAC,iBAAiB,GAAG,OAAO,CAAA;AACjC,KAAK,CAAC,QAAQ,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,CAAC,CAAA;AAC/I,KAAK,CAAC,WAAW,GAAG,SAAS,CAAA;AAE7B,KAAK,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IAC1D,OAAO,KAAyE,CAAA;AAClF,CAAC,CAAA;AAED,KAAK,CAAC,YAAY,GAAG;IACnB,aAAa,EAAE,OAAkB;IACjC,QAAQ,EAAE,IAAI;IACd,iBAAiB,EAAE,IAAI;IACvB,MAAM,EAAE,IAAI;IACZ,wBAAwB,EAAE,IAAI;IAC9B,WAAW,EAAE,WAAW,CAAC,KAAK,EAAE;IAChC,UAAU,EAAE,YAAY,CAAC,KAAK,EAAE;CACV,CAAA;AAExB,mBAAmB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;AAE5C,eAAe,KAAK,CAAA"}
|
|
@@ -1,77 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
-
var t = {};
|
|
38
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
-
t[p] = s[p];
|
|
40
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
-
t[p[i]] = s[p[i]];
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
};
|
|
47
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.Navigation = void 0;
|
|
49
1
|
// @ts-nocheck
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var NavigationComponent = constants_1.Navigators[type];
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { TypeGuards, } from '@codeleap/common';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
import { Navigators } from './constants';
|
|
6
|
+
export const Navigation = ({ type, scenes, ...props }) => {
|
|
7
|
+
const NavigationComponent = Navigators[type];
|
|
57
8
|
// console.log('render Navigation', { type, scenes, props, defaultProps })
|
|
58
9
|
return <NavigationComponent.Navigator {...props}>
|
|
59
|
-
{Object.entries(scenes).map(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var screenProps = {
|
|
64
|
-
name: name,
|
|
10
|
+
{Object.entries(scenes).map(([name, content], idx) => {
|
|
11
|
+
const isFunction = TypeGuards.isFunction(content);
|
|
12
|
+
let screenProps = {
|
|
13
|
+
name,
|
|
65
14
|
};
|
|
66
15
|
if (isFunction) {
|
|
67
16
|
screenProps.component = content;
|
|
68
17
|
// console.log('Render NavigationScreen', { scenes, screenProps, content, isFunction }, 'PACKAGES')
|
|
69
18
|
}
|
|
70
19
|
else {
|
|
71
|
-
screenProps.component =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
screenProps =
|
|
20
|
+
screenProps.component = content?.component?.default || content?.component || content?.default;
|
|
21
|
+
const nameParts = name.split('.');
|
|
22
|
+
const title = content?.title || nameParts[nameParts.length - 1] || name.replace('.', '');
|
|
23
|
+
screenProps = {
|
|
24
|
+
...screenProps,
|
|
25
|
+
options: (optionProps) => ({
|
|
26
|
+
title,
|
|
27
|
+
tabBarIcon: (style) => <Icon name={content?.icon} style={style}/>,
|
|
28
|
+
tabIcon: content?.icon,
|
|
29
|
+
tabBarIconFocused: content?.iconFocused ? (style) => <Icon name={content?.iconFocused} style={style}/> : null,
|
|
30
|
+
...(TypeGuards.isFunction(content.options) ? content.options(optionProps) : content.options),
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
75
33
|
// console.log('Render NavigationScreen loop', { scenes, screenProps, content, title, isFunction, props }, 'PACKAGES')
|
|
76
34
|
}
|
|
77
35
|
return (
|
|
@@ -80,5 +38,4 @@ var Navigation = function (_a) {
|
|
|
80
38
|
})}
|
|
81
39
|
</NavigationComponent.Navigator>;
|
|
82
40
|
};
|
|
83
|
-
exports.Navigation = Navigation;
|
|
84
41
|
//# sourceMappingURL=Navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigation.js","sourceRoot":"","sources":["../../../src/components/Navigation/Navigation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Navigation.js","sourceRoot":"","sources":["../../../src/components/Navigation/Navigation.tsx"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,UAAU,GACX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,CAAC,MAAM,UAAU,GAAG,CAA0B,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,EAAsB,EAAE,EAAE;IACpG,MAAM,mBAAmB,GAAG,UAAU,CAAC,IAAI,CAAmB,CAAA;IAE9D,0EAA0E;IAE1E,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,CAC9C;IAAA,CACE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE;YAClD,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;YAEjD,IAAI,WAAW,GAAG;gBAChB,IAAI;aACqB,CAAA;YAE3B,IAAI,UAAU,EAAE;gBACd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,CAAC,EAChB,CACH,CAAA;QACH,CAAC,CAAC,CAEN;EAAA,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAA;AAClC,CAAC,CAAA"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Drawer: (0, drawer_1.createDrawerNavigator)(),
|
|
9
|
-
Stack: (0, stack_1.createStackNavigator)(),
|
|
10
|
-
Tab: (0, bottom_tabs_1.createBottomTabNavigator)(),
|
|
1
|
+
import { createDrawerNavigator } from '@react-navigation/drawer';
|
|
2
|
+
import { createStackNavigator } from '@react-navigation/stack';
|
|
3
|
+
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
|
4
|
+
export const Navigators = {
|
|
5
|
+
Drawer: createDrawerNavigator(),
|
|
6
|
+
Stack: createStackNavigator(),
|
|
7
|
+
Tab: createBottomTabNavigator(),
|
|
11
8
|
};
|
|
12
9
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/Navigation/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/Navigation/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAE9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAgBxE,MAAM,CAAC,MAAM,UAAU,GAAe;IACpC,MAAM,EAAE,qBAAqB,EAAE;IAC/B,KAAK,EAAE,oBAAoB,EAAE;IAC7B,GAAG,EAAE,wBAAwB,EAAE;CAChC,CAAA"}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
__exportStar(require("./Navigation"), exports);
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./utils"), exports);
|
|
1
|
+
export * from './Navigation';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export * from './utils';
|
|
20
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Navigation/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Navigation/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
|
@@ -1,69 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Navigation } from './Navigation';
|
|
3
|
+
export function createAppNavigation(Scenes) {
|
|
4
|
+
const AllScenes = Object.entries(Scenes).reduce((allScenes, [moduleName, content]) => {
|
|
5
|
+
const subScenes = [];
|
|
6
|
+
for (const [name, sceneContent] of Object.entries(content.scenes)) {
|
|
7
|
+
subScenes.push([`${moduleName}.${name}`, sceneContent]);
|
|
8
8
|
}
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
25
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
26
|
-
if (ar || !(i in from)) {
|
|
27
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
28
|
-
ar[i] = from[i];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
32
|
-
};
|
|
33
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
34
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
35
|
-
};
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.createAppNavigation = void 0;
|
|
38
|
-
var react_1 = __importDefault(require("react"));
|
|
39
|
-
var Navigation_1 = require("./Navigation");
|
|
40
|
-
function createAppNavigation(Scenes) {
|
|
41
|
-
var AllScenes = Object.entries(Scenes).reduce(function (allScenes, _a) {
|
|
42
|
-
var moduleName = _a[0], content = _a[1];
|
|
43
|
-
var subScenes = [];
|
|
44
|
-
for (var _i = 0, _b = Object.entries(content.scenes); _i < _b.length; _i++) {
|
|
45
|
-
var _c = _b[_i], name = _c[0], sceneContent = _c[1];
|
|
46
|
-
subScenes.push(["".concat(moduleName, ".").concat(name), sceneContent]);
|
|
47
|
-
}
|
|
48
|
-
return __spreadArray(__spreadArray([], allScenes, true), subScenes, true);
|
|
9
|
+
return [
|
|
10
|
+
...allScenes,
|
|
11
|
+
...subScenes,
|
|
12
|
+
];
|
|
49
13
|
}, []);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
.map(
|
|
53
|
-
|
|
54
|
-
var filterScenes = null;
|
|
14
|
+
const AppScenes = Object.fromEntries(AllScenes);
|
|
15
|
+
const SCENES_RESULT = Object.fromEntries(Object.entries(Scenes)
|
|
16
|
+
.map(([S, { _ig_scenes, exclude, type, navigationProps, ...otherProps }]) => {
|
|
17
|
+
let filterScenes = null;
|
|
55
18
|
if (exclude) {
|
|
56
|
-
filterScenes = Object.fromEntries(AllScenes.filter(
|
|
57
|
-
var path = _a[0];
|
|
58
|
-
return !exclude.some(function (param) { return path.startsWith(param); });
|
|
59
|
-
}));
|
|
19
|
+
filterScenes = Object.fromEntries(AllScenes.filter(([path]) => !exclude.some(param => path.startsWith(param))));
|
|
60
20
|
}
|
|
61
|
-
|
|
21
|
+
const Component = () => <Navigation type={type || 'Stack'} scenes={filterScenes || AppScenes} screenOptions={{
|
|
22
|
+
headerShown: false,
|
|
23
|
+
...navigationProps?.screenOptions,
|
|
24
|
+
}} {...navigationProps}/>;
|
|
62
25
|
// console.log('SCENES_RESULT create', { _ig_scenes, exclude, type, navigationProps, otherProps })
|
|
63
|
-
return [S,
|
|
26
|
+
return [S, {
|
|
27
|
+
...otherProps,
|
|
28
|
+
component: Component,
|
|
29
|
+
}];
|
|
64
30
|
}));
|
|
65
31
|
// console.log('SCENES_RESULT', SCENES_RESULT)
|
|
66
32
|
return SCENES_RESULT;
|
|
67
33
|
}
|
|
68
|
-
exports.createAppNavigation = createAppNavigation;
|
|
69
34
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Navigation/utils.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Navigation/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,UAAU,mBAAmB,CAAC,MAAU;IAE5C,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAM,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE;QAExF,MAAM,SAAS,GAAG,EAAE,CAAA;QAEpB,KAAK,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACjE,SAAS,CAAC,IAAI,CACZ,CAAC,GAAG,UAAU,IAAI,IAAI,EAAE,EAAE,YAAY,CAAC,CACxC,CAAA;SACF;QAED,OAAO;YACL,GAAG,SAAS;YACZ,GAAG,SAAS;SACb,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;IAE/C,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CACtC,MAAM,CAAC,OAAO,CAAM,MAAM,CAAC;SACxB,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;QAC1E,IAAI,YAAY,GAAG,IAAI,CAAA;QAEvB,IAAI,OAAO,EAAE;YACX,YAAY,GAAG,MAAM,CAAC,WAAW,CAC/B,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CA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