@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,103 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { TypeGuards, onMount, useGlobalContext } from '@codeleap/common';
|
|
3
|
+
import { Pressable, StyleSheet, Platform } from 'react-native';
|
|
4
|
+
import { View } from '../View';
|
|
5
|
+
import { usePressableFeedback } from '../../utils';
|
|
6
|
+
import { Keyboard } from 'react-native';
|
|
7
|
+
import { PressableRipple } from '../../modules/PressableRipple';
|
|
8
|
+
import { MobileStyleRegistry } from '../../Registry';
|
|
9
|
+
import { useStylesFor } from '../../hooks';
|
|
10
|
+
export * from './styles';
|
|
11
|
+
export * from './types';
|
|
12
|
+
export const Touchable = forwardRef((touchableProps, ref) => {
|
|
13
|
+
const { children, onPress, style, debugName, debugComponent, debounce, leadingDebounce, noFeedback, setPressed, rippleDisabled, analyticsEnabled, analyticsName, analyticsData = {}, dismissKeyboard, ...props } = {
|
|
14
|
+
...Touchable.defaultProps,
|
|
15
|
+
...touchableProps,
|
|
10
16
|
};
|
|
11
|
-
|
|
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 __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
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
40
|
-
var t = {};
|
|
41
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
42
|
-
t[p] = s[p];
|
|
43
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
44
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
45
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
46
|
-
t[p[i]] = s[p[i]];
|
|
47
|
-
}
|
|
48
|
-
return t;
|
|
49
|
-
};
|
|
50
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.Touchable = 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 utils_1 = require("../../utils");
|
|
57
|
-
var react_native_2 = require("react-native");
|
|
58
|
-
var PressableRipple_1 = require("../../modules/PressableRipple");
|
|
59
|
-
var Registry_1 = require("../../Registry");
|
|
60
|
-
var hooks_1 = require("../../hooks");
|
|
61
|
-
__exportStar(require("./styles"), exports);
|
|
62
|
-
__exportStar(require("./types"), exports);
|
|
63
|
-
exports.Touchable = (0, react_1.forwardRef)(function (touchableProps, ref) {
|
|
64
|
-
var _a = __assign(__assign({}, exports.Touchable.defaultProps), touchableProps), children = _a.children, onPress = _a.onPress, style = _a.style, debugName = _a.debugName, debugComponent = _a.debugComponent, debounce = _a.debounce, leadingDebounce = _a.leadingDebounce, noFeedback = _a.noFeedback, setPressed = _a.setPressed, rippleDisabled = _a.rippleDisabled, analyticsEnabled = _a.analyticsEnabled, analyticsName = _a.analyticsName, _b = _a.analyticsData, analyticsData = _b === void 0 ? {} : _b, dismissKeyboard = _a.dismissKeyboard, props = __rest(_a, ["children", "onPress", "style", "debugName", "debugComponent", "debounce", "leadingDebounce", "noFeedback", "setPressed", "rippleDisabled", "analyticsEnabled", "analyticsName", "analyticsData", "dismissKeyboard"]);
|
|
65
|
-
var pressed = react_1.default.useRef(!!leadingDebounce);
|
|
66
|
-
(0, common_1.onMount)(function () {
|
|
17
|
+
const pressed = React.useRef(!!leadingDebounce);
|
|
18
|
+
onMount(() => {
|
|
67
19
|
if (!!leadingDebounce && !!debounce) {
|
|
68
|
-
setTimeout(
|
|
20
|
+
setTimeout(() => {
|
|
69
21
|
pressed.current = false;
|
|
70
22
|
}, debounce);
|
|
71
23
|
}
|
|
72
24
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
25
|
+
const styles = useStylesFor(Touchable.styleRegistryName, style);
|
|
26
|
+
const { logger } = useGlobalContext();
|
|
27
|
+
const press = () => {
|
|
76
28
|
if (!onPress)
|
|
77
29
|
return;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
logger.log("<".concat(debugComponent || 'Touchable', "/> pressed"), debugName, 'User interaction');
|
|
30
|
+
const _onPress = () => {
|
|
31
|
+
logger.log(`<${debugComponent || 'Touchable'}/> pressed`, debugName, 'User interaction');
|
|
81
32
|
if (dismissKeyboard) {
|
|
82
|
-
|
|
33
|
+
Keyboard.dismiss();
|
|
83
34
|
}
|
|
84
35
|
if (analyticsEnabled) {
|
|
85
|
-
|
|
86
|
-
if (!!
|
|
87
|
-
|
|
36
|
+
const name = analyticsName || debugName;
|
|
37
|
+
if (!!name?.trim?.()) {
|
|
38
|
+
logger.analytics?.interaction(name, analyticsData);
|
|
88
39
|
}
|
|
89
40
|
}
|
|
90
41
|
onPress();
|
|
91
42
|
};
|
|
92
|
-
if (
|
|
43
|
+
if (TypeGuards.isNumber(debounce)) {
|
|
93
44
|
if (pressed.current) {
|
|
94
45
|
return;
|
|
95
46
|
}
|
|
96
|
-
setPressed
|
|
47
|
+
setPressed?.(true);
|
|
97
48
|
pressed.current = true;
|
|
98
49
|
_onPress();
|
|
99
|
-
setTimeout(
|
|
100
|
-
setPressed
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
setPressed?.(false);
|
|
101
52
|
pressed.current = false;
|
|
102
53
|
}, debounce);
|
|
103
54
|
}
|
|
@@ -105,17 +56,17 @@ exports.Touchable = (0, react_1.forwardRef)(function (touchableProps, ref) {
|
|
|
105
56
|
_onPress();
|
|
106
57
|
}
|
|
107
58
|
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
59
|
+
const _styles = StyleSheet.flatten([styles?.wrapper, props?.disabled && styles?.['wrapper:disabled']]);
|
|
60
|
+
const disableFeedback = !onPress || noFeedback;
|
|
61
|
+
const { rippleConfig, getFeedbackStyle } = usePressableFeedback(_styles, {
|
|
111
62
|
hightlightPropertyIn: 'backgroundColor',
|
|
112
63
|
hightlightPropertyOut: 'backgroundColor',
|
|
113
64
|
disabled: disableFeedback,
|
|
114
|
-
feedbackConfig: styles
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
65
|
+
feedbackConfig: styles?.feedback,
|
|
66
|
+
});
|
|
67
|
+
const Wrapper = View;
|
|
68
|
+
const { radiusStyle, wrapperStyle, pressableStyle } = React.useMemo(() => {
|
|
69
|
+
const wrapperkeys = [
|
|
119
70
|
'margin',
|
|
120
71
|
'alignSelf',
|
|
121
72
|
'top!',
|
|
@@ -125,19 +76,19 @@ exports.Touchable = (0, react_1.forwardRef)(function (touchableProps, ref) {
|
|
|
125
76
|
'position!',
|
|
126
77
|
'transform!',
|
|
127
78
|
];
|
|
128
|
-
|
|
79
|
+
const radiusKey = [
|
|
129
80
|
'Radius#',
|
|
130
81
|
];
|
|
131
|
-
|
|
82
|
+
const sharedKeys = [
|
|
132
83
|
'width!',
|
|
133
84
|
'height!',
|
|
134
85
|
'flex!',
|
|
135
86
|
'backgroundColor!',
|
|
136
87
|
];
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
88
|
+
const wrapperStyle = {};
|
|
89
|
+
const pressableStyle = {};
|
|
90
|
+
const radiusStyle = {};
|
|
91
|
+
const match = (k, key) => {
|
|
141
92
|
if (k.endsWith('#')) {
|
|
142
93
|
return key.includes(k.substring(0, k.length - 1));
|
|
143
94
|
}
|
|
@@ -148,18 +99,17 @@ exports.Touchable = (0, react_1.forwardRef)(function (touchableProps, ref) {
|
|
|
148
99
|
return key.startsWith(k);
|
|
149
100
|
}
|
|
150
101
|
};
|
|
151
|
-
Object.entries(_styles).forEach(
|
|
152
|
-
|
|
153
|
-
if (radiusKey.some(function (k) { return match(k, key); })) {
|
|
102
|
+
Object.entries(_styles).forEach(([key, value]) => {
|
|
103
|
+
if (radiusKey.some(k => match(k, key))) {
|
|
154
104
|
wrapperStyle[key] = value;
|
|
155
105
|
pressableStyle[key] = value;
|
|
156
106
|
radiusStyle[key] = value;
|
|
157
107
|
return;
|
|
158
108
|
}
|
|
159
|
-
if (wrapperkeys.some(
|
|
109
|
+
if (wrapperkeys.some(k => match(k, key))) {
|
|
160
110
|
wrapperStyle[key] = value;
|
|
161
111
|
}
|
|
162
|
-
else if (sharedKeys.some(
|
|
112
|
+
else if (sharedKeys.some(k => match(k, key))) {
|
|
163
113
|
wrapperStyle[key] = value;
|
|
164
114
|
pressableStyle[key] = value;
|
|
165
115
|
}
|
|
@@ -173,42 +123,39 @@ exports.Touchable = (0, react_1.forwardRef)(function (touchableProps, ref) {
|
|
|
173
123
|
}
|
|
174
124
|
wrapperStyle.overflow = 'visible';
|
|
175
125
|
return {
|
|
176
|
-
wrapperStyle
|
|
177
|
-
pressableStyle
|
|
178
|
-
radiusStyle
|
|
126
|
+
wrapperStyle,
|
|
127
|
+
pressableStyle,
|
|
128
|
+
radiusStyle,
|
|
179
129
|
};
|
|
180
|
-
}, [JSON.stringify(_styles)])
|
|
181
|
-
|
|
130
|
+
}, [JSON.stringify(_styles)]);
|
|
131
|
+
const hitSlop = TypeGuards.isNumber(props.hitSlop) ? {
|
|
182
132
|
top: props.hitSlop,
|
|
183
133
|
left: props.hitSlop,
|
|
184
134
|
right: props.hitSlop,
|
|
185
135
|
bottom: props.hitSlop,
|
|
186
136
|
} : props.hitSlop;
|
|
187
|
-
|
|
137
|
+
const disableRipple = disableFeedback || rippleDisabled || Platform.OS !== 'android';
|
|
188
138
|
return (<Wrapper style={wrapperStyle} hitSlop={hitSlop}>
|
|
189
|
-
{!disableRipple ? (<
|
|
139
|
+
{!disableRipple ? (<PressableRipple onPress={press} {...props} style={[pressableStyle, styles?.pressable]} rippleFades={false} rippleDuration={350} rippleOpacity={0.1} {...rippleConfig} radiusStyles={radiusStyle}
|
|
190
140
|
// @ts-ignore
|
|
191
141
|
ref={ref}>
|
|
192
142
|
{children}
|
|
193
|
-
</
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
styles === null || styles === void 0 ? void 0 : styles.pressable,
|
|
199
|
-
]);
|
|
200
|
-
}} {...props} ref={ref}>
|
|
143
|
+
</PressableRipple>) : (<Pressable onPress={press} style={({ pressed }) => ([
|
|
144
|
+
pressableStyle,
|
|
145
|
+
getFeedbackStyle(pressed),
|
|
146
|
+
styles?.pressable,
|
|
147
|
+
])} {...props} ref={ref}>
|
|
201
148
|
{children}
|
|
202
|
-
</
|
|
149
|
+
</Pressable>)}
|
|
203
150
|
</Wrapper>);
|
|
204
151
|
});
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return
|
|
152
|
+
Touchable.styleRegistryName = 'Touchable';
|
|
153
|
+
Touchable.elements = ['wrapper', 'feedback', 'pressable'];
|
|
154
|
+
Touchable.rootElement = 'wrapper';
|
|
155
|
+
Touchable.withVariantTypes = (styles) => {
|
|
156
|
+
return Touchable;
|
|
210
157
|
};
|
|
211
|
-
|
|
158
|
+
Touchable.defaultProps = {
|
|
212
159
|
debounce: 500,
|
|
213
160
|
noFeedback: false,
|
|
214
161
|
rippleDisabled: false,
|
|
@@ -216,5 +163,5 @@ exports.Touchable.defaultProps = {
|
|
|
216
163
|
analyticsName: null,
|
|
217
164
|
dismissKeyboard: true,
|
|
218
165
|
};
|
|
219
|
-
|
|
166
|
+
MobileStyleRegistry.registerComponent(Touchable);
|
|
220
167
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Touchable/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src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G,CAAC,CAAC,GAAG,CAAC,CAET;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,SAAS,CAAC,CACb,CACH;IAAA,EAAE,OAAO,CAAC,CACX,CAAA;AACH,CAAC,CAA6C,CAAA;AAE9C,SAAS,CAAC,iBAAiB,GAAG,WAAW,CAAA;AACzC,SAAS,CAAC,QAAQ,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,CAAA;AACzD,SAAS,CAAC,WAAW,GAAG,SAAS,CAAA;AAEjC,SAAS,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IAC9D,OAAO,SAAiF,CAAA;AAC1F,CAAC,CAAA;AAED,SAAS,CAAC,YAAY,GAAG;IACvB,QAAQ,EAAE,GAAG;IACb,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,KAAK;IACrB,gBAAgB,EAAE,KAAK;IACvB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;CACK,CAAA;AAE5B,mBAAmB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAA"}
|
|
@@ -1,56 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.View = void 0;
|
|
32
|
-
var react_1 = __importDefault(require("react"));
|
|
33
|
-
var react_native_1 = require("react-native");
|
|
34
|
-
var Registry_1 = require("../../Registry");
|
|
35
|
-
var react_native_reanimated_1 = __importDefault(require("react-native-reanimated"));
|
|
36
|
-
var hooks_1 = require("../../hooks");
|
|
37
|
-
__exportStar(require("./types"), exports);
|
|
38
|
-
__exportStar(require("./styles"), exports);
|
|
39
|
-
var View = function (props) {
|
|
40
|
-
var style = props.style, _a = props.component, _Component = _a === void 0 ? react_native_1.View : _a, _b = props.animated, animated = _b === void 0 ? false : _b, animatedStyle = props.animatedStyle, viewProps = __rest(props, ["style", "component", "animated", "animatedStyle"]);
|
|
41
|
-
var styles = (0, hooks_1.useStylesFor)(exports.View.styleRegistryName, style);
|
|
42
|
-
var Component = animated ? react_native_reanimated_1.default.View : _Component;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View as RNView } from 'react-native';
|
|
3
|
+
import { MobileStyleRegistry } from '../../Registry';
|
|
4
|
+
import Animated from 'react-native-reanimated';
|
|
5
|
+
import { useStylesFor } from '../../hooks';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export * from './styles';
|
|
8
|
+
export const View = (props) => {
|
|
9
|
+
const { style, component: _Component = RNView, animated = false, animatedStyle, ...viewProps } = props;
|
|
10
|
+
const styles = useStylesFor(View.styleRegistryName, style);
|
|
11
|
+
const Component = animated ? Animated.View : _Component;
|
|
43
12
|
return (<Component {...viewProps} style={[styles.wrapper, animatedStyle]}/>);
|
|
44
13
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return <exports.View {...props} animated/>;
|
|
14
|
+
View.Animated = (props) => {
|
|
15
|
+
return <View {...props} animated/>;
|
|
48
16
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return
|
|
17
|
+
View.styleRegistryName = 'View';
|
|
18
|
+
View.elements = ['wrapper'];
|
|
19
|
+
View.rootElement = 'wrapper';
|
|
20
|
+
View.withVariantTypes = (styles) => {
|
|
21
|
+
return View;
|
|
54
22
|
};
|
|
55
|
-
|
|
23
|
+
MobileStyleRegistry.registerComponent(View);
|
|
56
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/View/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/View/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AAExB,MAAM,CAAC,MAAM,IAAI,GAAG,CAAgD,KAAmB,EAAE,EAAE;IACzF,MAAM,EACJ,KAAK,EACL,SAAS,EAAE,UAAU,GAAG,MAAM,EAC9B,QAAQ,GAAG,KAAK,EAChB,aAAa,EACb,GAAG,SAAS,EACb,GAAG,KAAK,CAAA;IAET,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;IAE1D,MAAM,SAAS,GAAmC,QAAQ,CAAC,CAAC,CAAC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"), exports);
|
|
45
|
-
__exportStar(require("./Grid"), exports);
|
|
46
|
-
__exportStar(require("./LoadingOverlay"), exports);
|
|
47
|
-
__exportStar(require("./ActionIcon"), exports);
|
|
48
|
-
__exportStar(require("./InputBase"), exports);
|
|
49
|
-
__exportStar(require("./DatePickerModal"), exports);
|
|
50
|
-
__exportStar(require("./RefreshControl"), exports);
|
|
51
|
-
__exportStar(require("./Avatar"), exports);
|
|
52
|
-
__exportStar(require("./AvatarGroup"), exports);
|
|
53
|
-
__exportStar(require("./NumberIncrement"), exports);
|
|
54
|
-
__exportStar(require("./Badge"), exports);
|
|
55
|
-
__exportStar(require("./SearchInput"), exports);
|
|
56
|
-
__exportStar(require("./PaginationIndicator"), exports);
|
|
57
|
-
__exportStar(require("./PlacesAutocomplete"), exports);
|
|
58
|
-
__exportStar(require("./SortablePhotos"), exports);
|
|
59
|
-
__exportStar(require("./SectionFilters"), exports);
|
|
1
|
+
export * from './View';
|
|
2
|
+
export * from './Icon';
|
|
3
|
+
export * from './Touchable';
|
|
4
|
+
export * from './Text';
|
|
5
|
+
export * from './Image';
|
|
6
|
+
export * from './Checkbox';
|
|
7
|
+
export * from './TextInput';
|
|
8
|
+
export * from './RadioInput';
|
|
9
|
+
export * from './Switch';
|
|
10
|
+
export * from './Sections';
|
|
11
|
+
export * from './Select';
|
|
12
|
+
export * from './FileInput';
|
|
13
|
+
export * from './Slider';
|
|
14
|
+
export * from './SegmentedControl';
|
|
15
|
+
export * from './Navigation';
|
|
16
|
+
export * from './Scroll';
|
|
17
|
+
export * from './List';
|
|
18
|
+
export * from './ActivityIndicator';
|
|
19
|
+
export * from './Button';
|
|
20
|
+
export * from './Modal';
|
|
21
|
+
export * from './Calendar';
|
|
22
|
+
export * from './ImageView';
|
|
23
|
+
export * from './Navigation';
|
|
24
|
+
export * from './Pager';
|
|
25
|
+
export * from './EmptyPlaceholder';
|
|
26
|
+
export * from './Backdrop';
|
|
27
|
+
export * from './SegmentedControl';
|
|
28
|
+
export * from './Autocomplete';
|
|
29
|
+
export * from './Grid';
|
|
30
|
+
export * from './LoadingOverlay';
|
|
31
|
+
export * from './ActionIcon';
|
|
32
|
+
export * from './InputBase';
|
|
33
|
+
export * from './DatePickerModal';
|
|
34
|
+
export * from './RefreshControl';
|
|
35
|
+
export * from './Avatar';
|
|
36
|
+
export * from './AvatarGroup';
|
|
37
|
+
export * from './NumberIncrement';
|
|
38
|
+
export * from './Badge';
|
|
39
|
+
export * from './SearchInput';
|
|
40
|
+
export * from './PaginationIndicator';
|
|
41
|
+
export * from './PlacesAutocomplete';
|
|
42
|
+
export * from './SortablePhotos';
|
|
43
|
+
export * from './SectionFilters';
|
|
60
44
|
//# sourceMappingURL=components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,QAAQ,CAAA;AACtB,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var styleObserver = (0, styles_1.useStyleObserver)(style);
|
|
9
|
-
var styles = (0, react_1.useMemo)(function () {
|
|
10
|
-
return Registry_1.MobileStyleRegistry.current.styleFor(componentName, style);
|
|
1
|
+
import { useStyleObserver } from '@codeleap/styles';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { MobileStyleRegistry } from '../Registry';
|
|
4
|
+
export const useStylesFor = (componentName, style) => {
|
|
5
|
+
const styleObserver = useStyleObserver(style);
|
|
6
|
+
const styles = useMemo(() => {
|
|
7
|
+
return MobileStyleRegistry.current.styleFor(componentName, style);
|
|
11
8
|
}, [styleObserver]);
|
|
12
9
|
return styles;
|
|
13
10
|
};
|
|
14
|
-
exports.useStylesFor = useStylesFor;
|
|
15
11
|
//# sourceMappingURL=index.js.map
|
package/dist/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAc,aAAqB,EAAE,KAA2B,EAAK,EAAE;IACjG,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAA;IAE7C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QAC1B,OAAO,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;IACnE,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAA;IAEnB,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|