@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,99 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var react_1 = require("react");
|
|
7
|
-
var getIconStyles = function (obj, state) { return ({
|
|
8
|
-
icon: (0, styles_1.mergeStyles)([
|
|
1
|
+
import { TypeGuards } from '@codeleap/common';
|
|
2
|
+
import { mergeStyles, useCompositionStyles } from '@codeleap/styles';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
const getIconStyles = (obj, state) => ({
|
|
5
|
+
icon: mergeStyles([
|
|
9
6
|
obj.icon,
|
|
10
7
|
state.focused && obj['icon:focus'],
|
|
11
8
|
state.hasError && obj['icon:error'],
|
|
12
|
-
state.disabled && obj['icon:disabled']
|
|
9
|
+
state.disabled && obj['icon:disabled'],
|
|
10
|
+
state.hasValue && obj['icon:typed'],
|
|
13
11
|
]),
|
|
14
|
-
'icon:disabled':
|
|
15
|
-
state.disabled && obj['icon:disabled']
|
|
12
|
+
'icon:disabled': mergeStyles([
|
|
13
|
+
state.disabled && obj['icon:disabled'],
|
|
16
14
|
]),
|
|
17
|
-
touchableWrapper:
|
|
15
|
+
touchableWrapper: mergeStyles([
|
|
18
16
|
obj.touchableWrapper,
|
|
19
17
|
state.focused && obj['touchableWrapper:focus'],
|
|
20
18
|
state.hasError && obj['touchableWrapper:error'],
|
|
21
|
-
state.disabled && obj['touchableWrapper:disabled']
|
|
19
|
+
state.disabled && obj['touchableWrapper:disabled'],
|
|
20
|
+
state.hasValue && obj['touchableWrapper:typed'],
|
|
22
21
|
]),
|
|
23
|
-
'touchableWrapper:disabled':
|
|
24
|
-
state.disabled && obj['touchableWrapper:disabled']
|
|
25
|
-
])
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
return
|
|
22
|
+
'touchableWrapper:disabled': mergeStyles([
|
|
23
|
+
state.disabled && obj['touchableWrapper:disabled'],
|
|
24
|
+
]),
|
|
25
|
+
});
|
|
26
|
+
const useIconStyles = (styles, iconStyles, states) => {
|
|
27
|
+
return useMemo(() => {
|
|
28
|
+
const _iconStyles = getIconStyles(iconStyles, states);
|
|
29
|
+
return mergeStyles([styles, _iconStyles]);
|
|
31
30
|
}, [states, styles, iconStyles]);
|
|
32
31
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var leftIconStyles = useIconStyles(generalIconStyles, compositionStyles === null || compositionStyles === void 0 ? void 0 : compositionStyles.leftIcon, {
|
|
32
|
+
export const useInputBaseStyles = (props) => {
|
|
33
|
+
const { focused, disabled, error, style: styles, hasValue, } = props;
|
|
34
|
+
const hasError = !TypeGuards.isNil(error);
|
|
35
|
+
const compositionStyles = useCompositionStyles(['leftIcon', 'rightIcon', 'icon'], styles);
|
|
36
|
+
const generalIconStyles = getIconStyles(compositionStyles?.icon, { hasError, disabled });
|
|
37
|
+
const leftIconStyles = useIconStyles(generalIconStyles, compositionStyles?.leftIcon, {
|
|
40
38
|
// @ts-expect-error
|
|
41
|
-
hasError:
|
|
42
|
-
disabled: (disabled || ((_a = props === null || props === void 0 ? void 0 : props.leftIcon) === null || _a === void 0 ? void 0 : _a.disabled)),
|
|
43
|
-
focused: focused
|
|
39
|
+
hasError, disabled: (disabled || props?.leftIcon?.disabled), focused,
|
|
44
40
|
});
|
|
45
|
-
|
|
41
|
+
const rightIconStyles = useIconStyles(generalIconStyles, compositionStyles?.rightIcon, {
|
|
46
42
|
// @ts-expect-error
|
|
47
|
-
hasError:
|
|
48
|
-
disabled: (disabled || ((_b = props === null || props === void 0 ? void 0 : props.rightIcon) === null || _b === void 0 ? void 0 : _b.disabled)),
|
|
49
|
-
focused: focused
|
|
43
|
+
hasError, disabled: (disabled || props?.rightIcon?.disabled), focused, hasValue,
|
|
50
44
|
});
|
|
51
|
-
|
|
45
|
+
const labelStyle = [
|
|
52
46
|
styles.label,
|
|
53
47
|
focused && styles['label:focus'],
|
|
54
48
|
hasError && styles['label:error'],
|
|
55
49
|
disabled && styles['label:disabled'],
|
|
50
|
+
hasValue && styles['label:typed'],
|
|
56
51
|
];
|
|
57
|
-
|
|
52
|
+
const errorStyle = [
|
|
58
53
|
styles.errorMessage,
|
|
59
54
|
focused && styles['errorMessage:focus'],
|
|
60
55
|
hasError && styles['errorMessage:error'],
|
|
61
56
|
disabled && styles['errorMessage:disabled'],
|
|
57
|
+
hasValue && styles['errorMessage:typed'],
|
|
62
58
|
];
|
|
63
|
-
|
|
59
|
+
const descriptionStyle = [
|
|
64
60
|
styles.description,
|
|
65
61
|
focused && styles['description:focus'],
|
|
66
62
|
hasError && styles['description:error'],
|
|
67
63
|
disabled && styles['description:disabled'],
|
|
64
|
+
hasValue && styles['description:typed'],
|
|
68
65
|
];
|
|
69
|
-
|
|
66
|
+
const wrapperStyle = [
|
|
70
67
|
styles.wrapper,
|
|
71
68
|
focused && styles['wrapper:focus'],
|
|
72
69
|
error && styles['wrapper:error'],
|
|
73
70
|
disabled && styles['wrapper:disabled'],
|
|
71
|
+
hasValue && styles['wrapper:typed'],
|
|
74
72
|
];
|
|
75
|
-
|
|
73
|
+
const innerWrapperStyle = [
|
|
76
74
|
styles.innerWrapper,
|
|
77
75
|
focused && styles['innerWrapper:focus'],
|
|
78
76
|
hasError && styles['innerWrapper:error'],
|
|
79
77
|
disabled && styles['innerWrapper:disabled'],
|
|
78
|
+
hasValue && styles['innerWrapper:typed'],
|
|
80
79
|
];
|
|
81
|
-
|
|
80
|
+
const labelRowStyle = [
|
|
82
81
|
styles.labelRow,
|
|
83
82
|
focused && styles['labelRow:focus'],
|
|
84
83
|
hasError && styles['labelRow:error'],
|
|
85
84
|
disabled && styles['labelRow:disabled'],
|
|
85
|
+
hasValue && styles['labelRow:typed'],
|
|
86
86
|
];
|
|
87
87
|
return {
|
|
88
|
-
wrapperStyle
|
|
89
|
-
innerWrapperStyle
|
|
90
|
-
leftIconStyles
|
|
91
|
-
rightIconStyles
|
|
92
|
-
labelStyle
|
|
93
|
-
errorStyle
|
|
94
|
-
descriptionStyle
|
|
95
|
-
labelRowStyle
|
|
88
|
+
wrapperStyle,
|
|
89
|
+
innerWrapperStyle,
|
|
90
|
+
leftIconStyles,
|
|
91
|
+
rightIconStyles,
|
|
92
|
+
labelStyle,
|
|
93
|
+
errorStyle,
|
|
94
|
+
descriptionStyle,
|
|
95
|
+
labelRowStyle,
|
|
96
96
|
};
|
|
97
97
|
};
|
|
98
|
-
exports.useInputBaseStyles = useInputBaseStyles;
|
|
99
98
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/InputBase/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/InputBase/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAwB/B,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE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.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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.selectInputBaseProps = void 0;
|
|
15
|
-
function selectInputBaseProps(props) {
|
|
16
|
-
var varList = [
|
|
1
|
+
export function selectInputBaseProps(props) {
|
|
2
|
+
const varList = [
|
|
17
3
|
'label',
|
|
18
4
|
'style',
|
|
19
5
|
'error',
|
|
@@ -29,13 +15,12 @@ function selectInputBaseProps(props) {
|
|
|
29
15
|
'hideErrorMessage',
|
|
30
16
|
'style',
|
|
31
17
|
];
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
const copy = { ...props };
|
|
19
|
+
const result = varList.reduce((acc, key) => {
|
|
34
20
|
// @ts-ignore
|
|
35
21
|
acc[key] = copy[key];
|
|
36
22
|
return acc;
|
|
37
23
|
}, {});
|
|
38
24
|
return { inputBaseProps: result, others: copy };
|
|
39
25
|
}
|
|
40
|
-
exports.selectInputBaseProps = selectInputBaseProps;
|
|
41
26
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/InputBase/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/InputBase/utils.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,oBAAoB,CAAsB,KAAQ;IAIhE,MAAM,OAAO,GAAkB;QAC7B,OAAO;QACP,OAAO;QACP,OAAO;QACP,cAAc;QACd,UAAU;QACV,WAAW;QACX,aAAa;QACb,SAAS;QACT,UAAU;QACV,mBAAmB;QACnB,cAAc;QACd,UAAU;QACV,kBAAkB;QAClB,OAAO;KACR,CAAA;IAED,MAAM,IAAI,GAAG,EAAE,GAAG,KAAK,EAAE,CAAA;IAEzB,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACzC,aAAa;QACb,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QAEpB,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAAe,CAAC,CAAA;IAEnB,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,IAAsB,EAAE,CAAA;AACnE,CAAC"}
|
|
@@ -1,104 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
37
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { useCallback, TypeGuards } from '@codeleap/common';
|
|
3
|
+
import { FlatList } from 'react-native';
|
|
4
|
+
import { View } from '../View';
|
|
5
|
+
import { EmptyPlaceholder } from '../EmptyPlaceholder';
|
|
6
|
+
import { RefreshControl } from '../RefreshControl';
|
|
7
|
+
import { useKeyboardPaddingStyle } from '../../utils';
|
|
8
|
+
import { MobileStyleRegistry } from '../../Registry';
|
|
9
|
+
import { useStylesFor } from '../../hooks';
|
|
10
|
+
export * from './styles';
|
|
11
|
+
export * from './types';
|
|
12
|
+
const RenderSeparator = (props) => {
|
|
13
|
+
return <View style={props.separatorStyles}/>;
|
|
38
14
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return t;
|
|
49
|
-
};
|
|
50
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.List = void 0;
|
|
52
|
-
var react_1 = __importStar(require("react"));
|
|
53
|
-
var common_1 = require("@codeleap/common");
|
|
54
|
-
var react_native_1 = require("react-native");
|
|
55
|
-
var View_1 = require("../View");
|
|
56
|
-
var EmptyPlaceholder_1 = require("../EmptyPlaceholder");
|
|
57
|
-
var RefreshControl_1 = require("../RefreshControl");
|
|
58
|
-
var utils_1 = require("../../utils");
|
|
59
|
-
var Registry_1 = require("../../Registry");
|
|
60
|
-
var hooks_1 = require("../../hooks");
|
|
61
|
-
__exportStar(require("./styles"), exports);
|
|
62
|
-
__exportStar(require("./types"), exports);
|
|
63
|
-
var RenderSeparator = function (props) {
|
|
64
|
-
return <View_1.View style={props.separatorStyles}/>;
|
|
65
|
-
};
|
|
66
|
-
exports.List = (0, react_1.forwardRef)(function (flatListProps, ref) {
|
|
67
|
-
var _a = __assign(__assign({}, exports.List.defaultProps), flatListProps), style = _a.style, onRefresh = _a.onRefresh, component = _a.component, refreshing = _a.refreshing, placeholder = _a.placeholder, refreshControlProps = _a.refreshControlProps, loading = _a.loading, keyboardAware = _a.keyboardAware, _b = _a.fakeEmpty, fakeEmpty = _b === void 0 ? loading : _b, contentContainerStyle = _a.contentContainerStyle, RenderItem = _a.renderItem, data = _a.data, props = __rest(_a, ["style", "onRefresh", "component", "refreshing", "placeholder", "refreshControlProps", "loading", "keyboardAware", "fakeEmpty", "contentContainerStyle", "renderItem", "data"]);
|
|
68
|
-
var styles = (0, hooks_1.useStylesFor)(exports.List.styleRegistryName, style);
|
|
69
|
-
var separator = (props === null || props === void 0 ? void 0 : props.separators) && <RenderSeparator separatorStyles={styles.separator}/>;
|
|
70
|
-
var dataLength = (data === null || data === void 0 ? void 0 : data.length) || 0;
|
|
71
|
-
var renderItem = (0, common_1.useCallback)(function (data) {
|
|
15
|
+
export const List = forwardRef((flatListProps, ref) => {
|
|
16
|
+
const { style, onRefresh, component, refreshing, placeholder, refreshControlProps, loading, keyboardAware, fakeEmpty = loading, contentContainerStyle, renderItem: RenderItem, data, ...props } = {
|
|
17
|
+
...List.defaultProps,
|
|
18
|
+
...flatListProps,
|
|
19
|
+
};
|
|
20
|
+
const styles = useStylesFor(List.styleRegistryName, style);
|
|
21
|
+
const separator = props?.separators && <RenderSeparator separatorStyles={styles.separator}/>;
|
|
22
|
+
const dataLength = data?.length || 0;
|
|
23
|
+
const renderItem = useCallback((data) => {
|
|
72
24
|
if (!RenderItem)
|
|
73
25
|
return null;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
26
|
+
const isFirst = data.index === 0;
|
|
27
|
+
const isLast = data.index === dataLength - 1;
|
|
28
|
+
const isOnly = isFirst && isLast;
|
|
29
|
+
const itemProps = {
|
|
30
|
+
...data,
|
|
31
|
+
isFirst,
|
|
32
|
+
isLast,
|
|
33
|
+
isOnly,
|
|
34
|
+
};
|
|
78
35
|
return <RenderItem {...itemProps}/>;
|
|
79
36
|
}, [dataLength, RenderItem]);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
37
|
+
const isEmpty = !data || !data?.length;
|
|
38
|
+
const _placeholder = {
|
|
39
|
+
...placeholder,
|
|
40
|
+
loading: TypeGuards.isBoolean(placeholder?.loading) ? placeholder.loading : loading,
|
|
41
|
+
};
|
|
42
|
+
const keyboardStyle = useKeyboardPaddingStyle([
|
|
83
43
|
styles.content,
|
|
84
44
|
contentContainerStyle,
|
|
85
45
|
isEmpty && styles['content:empty'],
|
|
86
46
|
loading && styles['content:loading'],
|
|
87
47
|
], keyboardAware && !props.horizontal);
|
|
88
|
-
|
|
89
|
-
return (<
|
|
48
|
+
const wrapperStyle = [styles.wrapper, isEmpty && styles['wrapper:empty'], loading && styles['wrapper:loading']];
|
|
49
|
+
return (<FlatList ItemSeparatorComponent={separator} refreshControl={!!onRefresh && (<RefreshControl refreshing={refreshing} onRefresh={onRefresh} {...refreshControlProps}/>)} ListEmptyComponent={<EmptyPlaceholder {..._placeholder}/>} showsVerticalScrollIndicator={false} showsHorizontalScrollIndicator={false} {...props} ListHeaderComponentStyle={styles.header} style={wrapperStyle} contentContainerStyle={keyboardStyle} data={fakeEmpty ? [] : data} ref={ref} renderItem={renderItem}/>);
|
|
90
50
|
});
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return
|
|
51
|
+
List.styleRegistryName = 'List';
|
|
52
|
+
List.elements = ['wrapper', 'content', 'separator', 'header', 'refreshControl'];
|
|
53
|
+
List.rootElement = 'wrapper';
|
|
54
|
+
List.withVariantTypes = (styles) => {
|
|
55
|
+
return List;
|
|
96
56
|
};
|
|
97
|
-
|
|
57
|
+
List.defaultProps = {
|
|
98
58
|
keyboardShouldPersistTaps: 'handled',
|
|
99
59
|
fakeEmpty: false,
|
|
100
60
|
loading: false,
|
|
101
61
|
keyboardAware: true,
|
|
102
62
|
};
|
|
103
|
-
|
|
63
|
+
MobileStyleRegistry.registerComponent(List);
|
|
104
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/List/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/List/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAsB,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAa,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAGrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB,MAAM,eAAe,GAAG,CAAC,KAA8C,EAAE,EAAE;IACzE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,EAAG,CAAA;AAC/C,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAA0B,CAAC,aAAa,EAAE,GAAG,EAAE,EAAE;IAC7E,MAAM,EACJ,KAAK,EACL,SAAS,EACT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S,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAA;AAC/E,IAAI,CAAC,WAAW,GAAG,SAAS,CAAA;AAE5B,IAAI,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IACzD,OAAO,IAAkG,CAAA;AAC3G,CAAC,CAAA;AAED,IAAI,CAAC,YAAY,GAAG;IAClB,yBAAyB,EAAE,SAAS;IACpC,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,KAAK;IACd,aAAa,EAAE,IAAI;CACM,CAAA;AAE3B,mBAAmB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -1,61 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { ActivityIndicator } from '../ActivityIndicator';
|
|
3
|
+
import { View } from '../View';
|
|
4
|
+
import { useAnimatedVariantStyles } from '../../utils';
|
|
5
|
+
import { MobileStyleRegistry } from '../../Registry';
|
|
6
|
+
import { useNestedStylesByKey } from '@codeleap/styles';
|
|
7
|
+
import { useStylesFor } from '../../hooks';
|
|
8
|
+
export * from './styles';
|
|
9
|
+
export * from './types';
|
|
10
|
+
export const LoadingOverlay = (props) => {
|
|
11
|
+
const { children, visible, style, } = {
|
|
12
|
+
...LoadingOverlay.defaultProps,
|
|
13
|
+
...props
|
|
10
14
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
37
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.LoadingOverlay = void 0;
|
|
41
|
-
var react_1 = __importStar(require("react"));
|
|
42
|
-
var ActivityIndicator_1 = require("../ActivityIndicator");
|
|
43
|
-
var View_1 = require("../View");
|
|
44
|
-
var utils_1 = require("../../utils");
|
|
45
|
-
var Registry_1 = require("../../Registry");
|
|
46
|
-
var styles_1 = require("@codeleap/styles");
|
|
47
|
-
var hooks_1 = require("../../hooks");
|
|
48
|
-
__exportStar(require("./styles"), exports);
|
|
49
|
-
__exportStar(require("./types"), exports);
|
|
50
|
-
var LoadingOverlay = function (props) {
|
|
51
|
-
var _a = __assign(__assign({}, exports.LoadingOverlay.defaultProps), props), children = _a.children, visible = _a.visible, style = _a.style;
|
|
52
|
-
var transition = (0, react_1.useRef)(null);
|
|
53
|
-
var styles = (0, hooks_1.useStylesFor)(exports.LoadingOverlay.styleRegistryName, style);
|
|
54
|
-
var loaderStyles = (0, styles_1.useNestedStylesByKey)('loader', styles);
|
|
55
|
-
var wrapperAnimation = (0, utils_1.useAnimatedVariantStyles)({
|
|
15
|
+
const transition = useRef(null);
|
|
16
|
+
const styles = useStylesFor(LoadingOverlay.styleRegistryName, style);
|
|
17
|
+
const loaderStyles = useNestedStylesByKey('loader', styles);
|
|
18
|
+
const wrapperAnimation = useAnimatedVariantStyles({
|
|
56
19
|
variantStyles: styles,
|
|
57
20
|
animatedProperties: ['wrapper:visible', 'wrapper:hidden'],
|
|
58
|
-
updater:
|
|
21
|
+
updater: (s) => {
|
|
59
22
|
'worklet';
|
|
60
23
|
return visible ? s['wrapper:visible'] : s['wrapper:hidden'];
|
|
61
24
|
},
|
|
@@ -65,20 +28,19 @@ var LoadingOverlay = function (props) {
|
|
|
65
28
|
if (!transition.current) {
|
|
66
29
|
transition.current = JSON.parse(JSON.stringify(styles['wrapper:transition']));
|
|
67
30
|
}
|
|
68
|
-
return (<
|
|
31
|
+
return (<View animated animatedStyle={wrapperAnimation} style={styles.wrapper}
|
|
69
32
|
// @ts-expect-error
|
|
70
33
|
transition={transition.current}>
|
|
71
|
-
<
|
|
34
|
+
<ActivityIndicator style={loaderStyles}/>
|
|
72
35
|
{children}
|
|
73
|
-
</
|
|
36
|
+
</View>);
|
|
74
37
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return exports.LoadingOverlay;
|
|
38
|
+
LoadingOverlay.styleRegistryName = 'LoadingOverlay';
|
|
39
|
+
LoadingOverlay.elements = ['wrapper', 'loader', 'transition'];
|
|
40
|
+
LoadingOverlay.rootElement = 'wrapper';
|
|
41
|
+
LoadingOverlay.defaultProps = {};
|
|
42
|
+
LoadingOverlay.withVariantTypes = (styles) => {
|
|
43
|
+
return LoadingOverlay;
|
|
82
44
|
};
|
|
83
|
-
|
|
45
|
+
MobileStyleRegistry.registerComponent(LoadingOverlay);
|
|
84
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LoadingOverlay/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LoadingOverlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAa,oBAAoB,EAA8B,MAAM,kBAAkB,CAAA;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAE,EAAE;IAC3D,MAAM,EACJ,QAAQ,EACR,OAAO,EACP,KAAK,GACN,GAAG;QACF,GAAG,cAAc,CAAC,YAAY;QAC9B,GAAG,KAAK;KACT,CAAA;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;IAE/B,MAAM,MAAM,GAAG,YAAY,CAAC,cAAc,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;IAEpE,MAAM,YAAY,GAAG,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAE3D,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;QAChD,aAAa,EAAE,MAAM;QACrB,kBAAkB,EAAE,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;QACzD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,SAAS,CAAA;YACT,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,C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