@codeleap/mobile 1.4.2 → 1.5.0
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/.eslintignore +1 -1
- package/.eslintrc.js +3 -3
- package/.vscode/settings.json +10 -10
- package/CodeLeap-Mobile-Packages.code-workspace +7 -7
- package/dist/components/ActivityIndicator.d.ts +13 -13
- package/dist/components/ActivityIndicator.js +50 -50
- package/dist/components/ActivityIndicator.js.map +0 -0
- package/dist/components/Animated.d.ts +15 -15
- package/dist/components/Animated.js +54 -54
- package/dist/components/Animated.js.map +0 -0
- package/dist/components/Button.d.ts +119 -119
- package/dist/components/Button.js +77 -77
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts +14 -14
- package/dist/components/Checkbox/index.js +73 -73
- package/dist/components/Checkbox/index.js.map +0 -0
- package/dist/components/Checkbox/styles.d.ts +52 -52
- package/dist/components/Checkbox/styles.js +48 -48
- package/dist/components/Checkbox/styles.js.map +0 -0
- package/dist/components/ContentView.d.ts +10 -10
- package/dist/components/ContentView.js +50 -50
- package/dist/components/ContentView.js.map +0 -0
- package/dist/components/FileInput.d.ts +26 -26
- package/dist/components/FileInput.js +174 -174
- package/dist/components/FileInput.js.map +0 -0
- package/dist/components/Icon.d.ts +12 -12
- package/dist/components/Icon.js +66 -66
- package/dist/components/Icon.js.map +0 -0
- package/dist/components/Image.d.ts +18 -18
- package/dist/components/Image.js +53 -53
- package/dist/components/Image.js.map +0 -0
- package/dist/components/List.d.ts +11 -11
- package/dist/components/List.js +76 -76
- package/dist/components/List.js.map +0 -0
- package/dist/components/Modal/index.d.ts +25 -25
- package/dist/components/Modal/index.js +108 -108
- package/dist/components/Modal/index.js.map +0 -0
- package/dist/components/Modal/styles.d.ts +66 -66
- package/dist/components/Modal/styles.js +64 -64
- package/dist/components/Modal/styles.js.map +0 -0
- package/dist/components/Navigation/Navigation.d.ts +3 -3
- package/dist/components/Navigation/Navigation.js +83 -83
- package/dist/components/Navigation/Navigation.js.map +0 -0
- package/dist/components/Navigation/constants.d.ts +5 -5
- package/dist/components/Navigation/constants.js +10 -10
- package/dist/components/Navigation/constants.js.map +0 -0
- package/dist/components/Navigation/index.d.ts +3 -3
- package/dist/components/Navigation/index.js +15 -15
- package/dist/components/Navigation/index.js.map +0 -0
- package/dist/components/Navigation/types.d.ts +26 -26
- package/dist/components/Navigation/types.js +7 -7
- package/dist/components/Navigation/types.js.map +0 -0
- package/dist/components/Navigation/utils.d.ts +3 -3
- package/dist/components/Navigation/utils.js +69 -69
- package/dist/components/Navigation/utils.js.map +0 -0
- package/dist/components/Overlay.d.ts +16 -16
- package/dist/components/Overlay.js +65 -65
- package/dist/components/Overlay.js.map +0 -0
- package/dist/components/Pager/index.d.ts +19 -19
- package/dist/components/Pager/index.js +163 -163
- package/dist/components/Pager/index.js.map +0 -0
- package/dist/components/Pager/styles.d.ts +51 -51
- package/dist/components/Pager/styles.js +43 -43
- package/dist/components/Pager/styles.js.map +0 -0
- package/dist/components/RadioInput/index.d.ts +26 -26
- package/dist/components/RadioInput/index.js +68 -68
- package/dist/components/RadioInput/index.js.map +0 -0
- package/dist/components/RadioInput/styles.d.ts +54 -54
- package/dist/components/RadioInput/styles.js +44 -44
- package/dist/components/RadioInput/styles.js.map +0 -0
- package/dist/components/Scroll.d.ts +11 -11
- package/dist/components/Scroll.js +75 -75
- package/dist/components/Scroll.js.map +0 -0
- package/dist/components/Sections.d.ts +11 -11
- package/dist/components/Sections.js +76 -76
- package/dist/components/Sections.js.map +0 -0
- package/dist/components/Select/index.d.ts +5 -5
- package/dist/components/Select/index.js +144 -144
- package/dist/components/Select/index.js.map +0 -0
- package/dist/components/Select/styles.d.ts +9 -9
- package/dist/components/Select/styles.js +56 -56
- package/dist/components/Select/styles.js.map +0 -0
- package/dist/components/Select/types.d.ts +33 -33
- package/dist/components/Select/types.js +2 -2
- package/dist/components/Select/types.js.map +0 -0
- package/dist/components/Slider/Mark.d.ts +3 -3
- package/dist/components/Slider/Mark.js +31 -31
- package/dist/components/Slider/Mark.js.map +0 -0
- package/dist/components/Slider/Thumb.d.ts +7 -7
- package/dist/components/Slider/Thumb.js +29 -29
- package/dist/components/Slider/Thumb.js.map +0 -0
- package/dist/components/Slider/index.d.ts +3 -3
- package/dist/components/Slider/index.js +93 -93
- package/dist/components/Slider/index.js.map +0 -0
- package/dist/components/Slider/types.d.ts +25 -25
- package/dist/components/Slider/types.js +2 -2
- package/dist/components/Slider/types.js.map +0 -0
- package/dist/components/Switch.d.ts +13 -13
- package/dist/components/Switch.js +71 -71
- package/dist/components/Switch.js.map +0 -0
- package/dist/components/Text.d.ts +12 -12
- package/dist/components/Text.js +48 -48
- package/dist/components/Text.js.map +0 -0
- package/dist/components/TextInput.d.ts +162 -162
- package/dist/components/TextInput.js +149 -149
- package/dist/components/TextInput.js.map +0 -0
- package/dist/components/Touchable.d.ts +14 -14
- package/dist/components/Touchable.js +57 -57
- package/dist/components/Touchable.js.map +1 -1
- package/dist/components/View.d.ts +114 -114
- package/dist/components/View.js +50 -50
- package/dist/components/View.js.map +0 -0
- package/dist/components/components.d.ts +24 -24
- package/dist/components/components.js +36 -36
- package/dist/components/components.js.map +0 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +24 -24
- package/dist/index.js.map +0 -0
- package/dist/modules/documentPicker.d.ts +3 -3
- package/dist/modules/documentPicker.js +11 -11
- package/dist/modules/documentPicker.js.map +0 -0
- package/dist/modules/fastImage.d.ts +1 -1
- package/dist/modules/fastImage.js +9 -9
- package/dist/modules/fastImage.js.map +0 -0
- package/dist/modules/reactNavigation.d.ts +3 -3
- package/dist/modules/reactNavigation.js +10 -10
- package/dist/modules/reactNavigation.js.map +0 -0
- package/dist/modules/types/fileTypes.d.ts +138 -138
- package/dist/modules/types/fileTypes.js +2 -2
- package/dist/modules/types/fileTypes.js.map +0 -0
- package/dist/types/utility.d.ts +2 -2
- package/dist/types/utility.js +2 -2
- package/dist/types/utility.js.map +0 -0
- package/dist/utils/OSAlert.d.ts +31 -31
- package/dist/utils/OSAlert.js +141 -141
- package/dist/utils/OSAlert.js.map +0 -0
- package/dist/utils/misc.d.ts +2 -2
- package/dist/utils/misc.js +25 -25
- package/dist/utils/misc.js.map +0 -0
- package/dist/utils/styles.d.ts +1 -1
- package/dist/utils/styles.js +12 -12
- package/dist/utils/styles.js.map +0 -0
- package/package.json +40 -40
- package/src/components/ActivityIndicator.tsx +46 -46
- package/src/components/Animated.tsx +34 -34
- package/src/components/Button.tsx +93 -95
- package/src/components/Checkbox/index.tsx +81 -81
- package/src/components/Checkbox/styles.ts +72 -72
- package/src/components/ContentView.tsx +58 -58
- package/src/components/FileInput.tsx +179 -179
- package/src/components/Icon.tsx +58 -58
- package/src/components/Image.tsx +59 -59
- package/src/components/List.tsx +100 -100
- package/src/components/Modal/index.tsx +158 -158
- package/src/components/Modal/styles.ts +133 -133
- package/src/components/Navigation/Navigation.tsx +58 -58
- package/src/components/Navigation/constants.ts +8 -8
- package/src/components/Navigation/index.tsx +3 -3
- package/src/components/Navigation/types.ts +35 -35
- package/src/components/Navigation/utils.tsx +59 -59
- package/src/components/Overlay.tsx +77 -77
- package/src/components/Pager/index.tsx +240 -240
- package/src/components/Pager/styles.ts +51 -51
- package/src/components/RadioInput/index.tsx +101 -101
- package/src/components/RadioInput/styles.ts +67 -67
- package/src/components/Scroll.tsx +98 -98
- package/src/components/Sections.tsx +100 -100
- package/src/components/Select/index.tsx +184 -184
- package/src/components/Select/styles.ts +81 -81
- package/src/components/Select/types.ts +41 -41
- package/src/components/Slider/Mark.tsx +46 -46
- package/src/components/Slider/Thumb.tsx +29 -29
- package/src/components/Slider/index.tsx +123 -123
- package/src/components/Slider/types.ts +25 -25
- package/src/components/Switch.tsx +81 -81
- package/src/components/Text.tsx +30 -30
- package/src/components/TextInput.tsx +204 -204
- package/src/components/Touchable.tsx +64 -65
- package/src/components/View.tsx +46 -46
- package/src/components/components.ts +26 -26
- package/src/index.ts +6 -6
- package/src/modules/documentPicker.ts +7 -7
- package/src/modules/fastImage.ts +2 -2
- package/src/modules/index.d.ts +496 -496
- package/src/modules/reactNavigation.ts +4 -4
- package/src/modules/types/documentPicker.d.ts +215 -215
- package/src/modules/types/fileTypes.ts +138 -138
- package/src/types/utility.ts +3 -3
- package/src/utils/OSAlert.ts +180 -180
- package/src/utils/misc.ts +24 -24
- package/src/utils/styles.ts +14 -14
package/dist/components/Image.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
-
var t = {};
|
|
23
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
-
t[p] = s[p];
|
|
25
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
-
t[p[i]] = s[p[i]];
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.Image = exports.ImageComponent = void 0;
|
|
34
|
-
var React = __importStar(require("react"));
|
|
35
|
-
var common_1 = require("@codeleap/common");
|
|
36
|
-
var react_native_1 = require("react-native");
|
|
37
|
-
var fastImage_1 = require("../modules/fastImage");
|
|
38
|
-
var ImageComponent = function (props) {
|
|
39
|
-
var variants = props.variants, style = props.style, _a = props.fast, fast = _a === void 0 ? true : _a, _b = props.resizeMode, resizeMode = _b === void 0 ? 'contain' : _b, imageProps = __rest(props, ["variants", "style", "fast", "resizeMode"]);
|
|
40
|
-
var variantStyles = (0, common_1.useDefaultComponentStyle)('Image', { variants: variants });
|
|
41
|
-
var styles = [variantStyles.wrapper, style];
|
|
42
|
-
if (fast) {
|
|
43
|
-
return (<fastImage_1.FastImage style={styles} resizeMode={fastImage_1.FastImage.resizeMode[resizeMode || 'contain']} {...imageProps}/>);
|
|
44
|
-
}
|
|
45
|
-
return <react_native_1.Image style={styles} resizeMode={resizeMode} {...imageProps}/>;
|
|
46
|
-
};
|
|
47
|
-
exports.ImageComponent = ImageComponent;
|
|
48
|
-
function areEqual(prevProps, nextProps) {
|
|
49
|
-
var check = ['source', 'style', 'variants', 'resizeMode', 'fast'];
|
|
50
|
-
var res = (0, common_1.arePropsEqual)(prevProps, nextProps, { check: check });
|
|
51
|
-
return res;
|
|
52
|
-
}
|
|
53
|
-
exports.Image = React.memo(exports.ImageComponent, areEqual);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
+
var t = {};
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
+
t[p] = s[p];
|
|
25
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
+
t[p[i]] = s[p[i]];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.Image = exports.ImageComponent = void 0;
|
|
34
|
+
var React = __importStar(require("react"));
|
|
35
|
+
var common_1 = require("@codeleap/common");
|
|
36
|
+
var react_native_1 = require("react-native");
|
|
37
|
+
var fastImage_1 = require("../modules/fastImage");
|
|
38
|
+
var ImageComponent = function (props) {
|
|
39
|
+
var variants = props.variants, style = props.style, _a = props.fast, fast = _a === void 0 ? true : _a, _b = props.resizeMode, resizeMode = _b === void 0 ? 'contain' : _b, imageProps = __rest(props, ["variants", "style", "fast", "resizeMode"]);
|
|
40
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Image', { variants: variants });
|
|
41
|
+
var styles = [variantStyles.wrapper, style];
|
|
42
|
+
if (fast) {
|
|
43
|
+
return (<fastImage_1.FastImage style={styles} resizeMode={fastImage_1.FastImage.resizeMode[resizeMode || 'contain']} {...imageProps}/>);
|
|
44
|
+
}
|
|
45
|
+
return <react_native_1.Image style={styles} resizeMode={resizeMode} {...imageProps}/>;
|
|
46
|
+
};
|
|
47
|
+
exports.ImageComponent = ImageComponent;
|
|
48
|
+
function areEqual(prevProps, nextProps) {
|
|
49
|
+
var check = ['source', 'style', 'variants', 'resizeMode', 'fast'];
|
|
50
|
+
var res = (0, common_1.arePropsEqual)(prevProps, nextProps, { check: check });
|
|
51
|
+
return res;
|
|
52
|
+
}
|
|
53
|
+
exports.Image = React.memo(exports.ImageComponent, areEqual);
|
|
54
54
|
//# sourceMappingURL=Image.js.map
|
|
File without changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { KeyboardAwareFlatListProps } from 'react-native-keyboard-aware-scroll-view';
|
|
3
|
-
import { FlatList } from 'react-native';
|
|
4
|
-
import { ViewProps } from './View';
|
|
5
|
-
export declare type FlatListProps = KeyboardAwareFlatListProps<any> & ViewProps & {
|
|
6
|
-
onRefresh?: () => void;
|
|
7
|
-
refreshTimeout?: number;
|
|
8
|
-
changeData?: any;
|
|
9
|
-
separators?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare const List: React.ForwardRefExoticComponent<Pick<FlatListProps, "children" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "data" | "variants" | "responsiveVariants" | "component" | "css" | "is" | "not" | "up" | "down" | "onHover" | "onContentSizeChange" | "onScroll" | "scrollEnabled" | "innerRef" | "viewIsInsideTabBar" | "resetScrollToCoords" | "enableResetScrollToCoords" | "enableAutomaticScroll" | "enableOnAndroid" | "extraHeight" | "extraScrollHeight" | "keyboardOpeningTime" | "onKeyboardWillShow" | "onKeyboardDidShow" | "onKeyboardWillHide" | "onKeyboardDidHide" | "onKeyboardWillChangeFrame" | "onKeyboardDidChangeFrame" | "contentContainerStyle" | "decelerationRate" | "horizontal" | "invertStickyHeaders" | "keyboardDismissMode" | "keyboardShouldPersistTaps" | "onScrollBeginDrag" | "onScrollEndDrag" | "onMomentumScrollEnd" | "onMomentumScrollBegin" | "pagingEnabled" | "showsHorizontalScrollIndicator" | "showsVerticalScrollIndicator" | "stickyHeaderHiddenOnScroll" | "refreshControl" | "snapToInterval" | "snapToOffsets" | "snapToStart" | "snapToEnd" | "stickyHeaderIndices" | "disableIntervalMomentum" | "disableScrollViewPanResponder" | "StickyHeaderComponent" | "alwaysBounceHorizontal" | "alwaysBounceVertical" | "automaticallyAdjustContentInsets" | "automaticallyAdjustsScrollIndicatorInsets" | "bounces" | "bouncesZoom" | "canCancelContentTouches" | "centerContent" | "contentInset" | "contentOffset" | "contentInsetAdjustmentBehavior" | "directionalLockEnabled" | "indicatorStyle" | "maintainVisibleContentPosition" | "maximumZoomScale" | "minimumZoomScale" | "onScrollAnimationEnd" | "pinchGestureEnabled" | "scrollEventThrottle" | "scrollIndicatorInsets" | "scrollToOverflowEnabled" | "scrollsToTop" | "snapToAlignment" | "onScrollToTop" | "zoomScale" | "endFillColor" | "scrollPerfTag" | "overScrollMode" | "nestedScrollEnabled" | "fadingEdgeLength" | "persistentScrollbar" | "onRefresh" | "refreshTimeout" | "changeData" | "refreshing" | "progressViewOffset" | "renderItem" | "ItemSeparatorComponent" | "ListEmptyComponent" | "ListFooterComponent" | "ListFooterComponentStyle" | "ListHeaderComponent" | "ListHeaderComponentStyle" | "columnWrapperStyle" | "extraData" | "getItemLayout" | "initialNumToRender" | "initialScrollIndex" | "keyExtractor" | "legacyImplementation" | "numColumns" | "onEndReached" | "onEndReachedThreshold" | "onViewableItemsChanged" | "viewabilityConfig" | "debug" | "disableVirtualization" | "getItem" | "getItemCount" | "inverted" | "listKey" | "maxToRenderPerBatch" | "onScrollToIndexFailed" | "renderScrollComponent" | "updateCellsBatchingPeriod" | "viewabilityConfigCallbackPairs" | "windowSize" | "CellRendererComponent" | "separators"> & React.RefAttributes<FlatList<any>>>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { KeyboardAwareFlatListProps } from 'react-native-keyboard-aware-scroll-view';
|
|
3
|
+
import { FlatList } from 'react-native';
|
|
4
|
+
import { ViewProps } from './View';
|
|
5
|
+
export declare type FlatListProps = KeyboardAwareFlatListProps<any> & ViewProps & {
|
|
6
|
+
onRefresh?: () => void;
|
|
7
|
+
refreshTimeout?: number;
|
|
8
|
+
changeData?: any;
|
|
9
|
+
separators?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const List: React.ForwardRefExoticComponent<Pick<FlatListProps, "children" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "data" | "variants" | "responsiveVariants" | "component" | "css" | "is" | "not" | "up" | "down" | "onHover" | "onContentSizeChange" | "onScroll" | "scrollEnabled" | "innerRef" | "viewIsInsideTabBar" | "resetScrollToCoords" | "enableResetScrollToCoords" | "enableAutomaticScroll" | "enableOnAndroid" | "extraHeight" | "extraScrollHeight" | "keyboardOpeningTime" | "onKeyboardWillShow" | "onKeyboardDidShow" | "onKeyboardWillHide" | "onKeyboardDidHide" | "onKeyboardWillChangeFrame" | "onKeyboardDidChangeFrame" | "contentContainerStyle" | "decelerationRate" | "horizontal" | "invertStickyHeaders" | "keyboardDismissMode" | "keyboardShouldPersistTaps" | "onScrollBeginDrag" | "onScrollEndDrag" | "onMomentumScrollEnd" | "onMomentumScrollBegin" | "pagingEnabled" | "showsHorizontalScrollIndicator" | "showsVerticalScrollIndicator" | "stickyHeaderHiddenOnScroll" | "refreshControl" | "snapToInterval" | "snapToOffsets" | "snapToStart" | "snapToEnd" | "stickyHeaderIndices" | "disableIntervalMomentum" | "disableScrollViewPanResponder" | "StickyHeaderComponent" | "alwaysBounceHorizontal" | "alwaysBounceVertical" | "automaticallyAdjustContentInsets" | "automaticallyAdjustsScrollIndicatorInsets" | "bounces" | "bouncesZoom" | "canCancelContentTouches" | "centerContent" | "contentInset" | "contentOffset" | "contentInsetAdjustmentBehavior" | "directionalLockEnabled" | "indicatorStyle" | "maintainVisibleContentPosition" | "maximumZoomScale" | "minimumZoomScale" | "onScrollAnimationEnd" | "pinchGestureEnabled" | "scrollEventThrottle" | "scrollIndicatorInsets" | "scrollToOverflowEnabled" | "scrollsToTop" | "snapToAlignment" | "onScrollToTop" | "zoomScale" | "endFillColor" | "scrollPerfTag" | "overScrollMode" | "nestedScrollEnabled" | "fadingEdgeLength" | "persistentScrollbar" | "onRefresh" | "refreshTimeout" | "changeData" | "refreshing" | "progressViewOffset" | "renderItem" | "ItemSeparatorComponent" | "ListEmptyComponent" | "ListFooterComponent" | "ListFooterComponentStyle" | "ListHeaderComponent" | "ListHeaderComponentStyle" | "columnWrapperStyle" | "extraData" | "getItemLayout" | "initialNumToRender" | "initialScrollIndex" | "keyExtractor" | "legacyImplementation" | "numColumns" | "onEndReached" | "onEndReachedThreshold" | "onViewableItemsChanged" | "viewabilityConfig" | "debug" | "disableVirtualization" | "getItem" | "getItemCount" | "inverted" | "listKey" | "maxToRenderPerBatch" | "onScrollToIndexFailed" | "renderScrollComponent" | "updateCellsBatchingPeriod" | "viewabilityConfigCallbackPairs" | "windowSize" | "CellRendererComponent" | "separators"> & React.RefAttributes<FlatList<any>>>;
|
package/dist/components/List.js
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
-
var t = {};
|
|
23
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
-
t[p] = s[p];
|
|
25
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
-
t[p[i]] = s[p[i]];
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.List = void 0;
|
|
34
|
-
var React = __importStar(require("react"));
|
|
35
|
-
var react_1 = require("react");
|
|
36
|
-
var common_1 = require("@codeleap/common");
|
|
37
|
-
var react_native_keyboard_aware_scroll_view_1 = require("react-native-keyboard-aware-scroll-view");
|
|
38
|
-
var react_native_1 = require("react-native");
|
|
39
|
-
var View_1 = require("./View");
|
|
40
|
-
var KeyboardAwareFlatList = react_native_keyboard_aware_scroll_view_1.KeyboardAwareFlatList;
|
|
41
|
-
exports.List = (0, react_1.forwardRef)(function (flatListProps, ref) {
|
|
42
|
-
var _a = flatListProps.variants, variants = _a === void 0 ? [] : _a, style = flatListProps.style, _b = flatListProps.refreshTimeout, refreshTimeout = _b === void 0 ? 3000 : _b, changeData = flatListProps.changeData, props = __rest(flatListProps, ["variants", "style", "refreshTimeout", "changeData"]);
|
|
43
|
-
var hasRefresh = !!props.onRefresh;
|
|
44
|
-
var _c = (0, react_1.useState)(false), refreshing = _c[0], setRefreshing = _c[1];
|
|
45
|
-
var timer = React.useRef(null);
|
|
46
|
-
var previousData = (0, common_1.usePrevious)(changeData);
|
|
47
|
-
var onRefresh = function () {
|
|
48
|
-
if (timer.current) {
|
|
49
|
-
clearTimeout(timer.current);
|
|
50
|
-
}
|
|
51
|
-
setRefreshing(true);
|
|
52
|
-
props.onRefresh();
|
|
53
|
-
timer.current = setTimeout(function () {
|
|
54
|
-
setRefreshing(false);
|
|
55
|
-
}, refreshTimeout);
|
|
56
|
-
};
|
|
57
|
-
(0, common_1.onUpdate)(function () {
|
|
58
|
-
if (refreshing && !(0, common_1.deepEqual)(previousData, changeData)) {
|
|
59
|
-
setRefreshing(false);
|
|
60
|
-
if (timer.current) {
|
|
61
|
-
clearTimeout(timer.current);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}, [refreshing, changeData]);
|
|
65
|
-
var Theme = (0, common_1.useCodeleapContext)().Theme;
|
|
66
|
-
var variantStyles = (0, common_1.useDefaultComponentStyle)('View', {
|
|
67
|
-
variants: variants,
|
|
68
|
-
});
|
|
69
|
-
var renderSeparator = function () {
|
|
70
|
-
return (<View_1.View variants={['separator']}></View_1.View>);
|
|
71
|
-
};
|
|
72
|
-
var separatorProp = props.separators;
|
|
73
|
-
var isEmpty = !props.data || !props.data.length;
|
|
74
|
-
var separator = !isEmpty && separatorProp == true && renderSeparator;
|
|
75
|
-
return (<KeyboardAwareFlatList style={[Theme.presets.full, style]} contentContainerStyle={[variantStyles.wrapper]} ref={ref} ItemSeparatorComponent={separator} {...props} refreshControl={hasRefresh && (<react_native_1.RefreshControl refreshing={refreshing} onRefresh={onRefresh}/>)}/>);
|
|
76
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
+
var t = {};
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
+
t[p] = s[p];
|
|
25
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
+
t[p[i]] = s[p[i]];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.List = void 0;
|
|
34
|
+
var React = __importStar(require("react"));
|
|
35
|
+
var react_1 = require("react");
|
|
36
|
+
var common_1 = require("@codeleap/common");
|
|
37
|
+
var react_native_keyboard_aware_scroll_view_1 = require("react-native-keyboard-aware-scroll-view");
|
|
38
|
+
var react_native_1 = require("react-native");
|
|
39
|
+
var View_1 = require("./View");
|
|
40
|
+
var KeyboardAwareFlatList = react_native_keyboard_aware_scroll_view_1.KeyboardAwareFlatList;
|
|
41
|
+
exports.List = (0, react_1.forwardRef)(function (flatListProps, ref) {
|
|
42
|
+
var _a = flatListProps.variants, variants = _a === void 0 ? [] : _a, style = flatListProps.style, _b = flatListProps.refreshTimeout, refreshTimeout = _b === void 0 ? 3000 : _b, changeData = flatListProps.changeData, props = __rest(flatListProps, ["variants", "style", "refreshTimeout", "changeData"]);
|
|
43
|
+
var hasRefresh = !!props.onRefresh;
|
|
44
|
+
var _c = (0, react_1.useState)(false), refreshing = _c[0], setRefreshing = _c[1];
|
|
45
|
+
var timer = React.useRef(null);
|
|
46
|
+
var previousData = (0, common_1.usePrevious)(changeData);
|
|
47
|
+
var onRefresh = function () {
|
|
48
|
+
if (timer.current) {
|
|
49
|
+
clearTimeout(timer.current);
|
|
50
|
+
}
|
|
51
|
+
setRefreshing(true);
|
|
52
|
+
props.onRefresh();
|
|
53
|
+
timer.current = setTimeout(function () {
|
|
54
|
+
setRefreshing(false);
|
|
55
|
+
}, refreshTimeout);
|
|
56
|
+
};
|
|
57
|
+
(0, common_1.onUpdate)(function () {
|
|
58
|
+
if (refreshing && !(0, common_1.deepEqual)(previousData, changeData)) {
|
|
59
|
+
setRefreshing(false);
|
|
60
|
+
if (timer.current) {
|
|
61
|
+
clearTimeout(timer.current);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, [refreshing, changeData]);
|
|
65
|
+
var Theme = (0, common_1.useCodeleapContext)().Theme;
|
|
66
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('View', {
|
|
67
|
+
variants: variants,
|
|
68
|
+
});
|
|
69
|
+
var renderSeparator = function () {
|
|
70
|
+
return (<View_1.View variants={['separator']}></View_1.View>);
|
|
71
|
+
};
|
|
72
|
+
var separatorProp = props.separators;
|
|
73
|
+
var isEmpty = !props.data || !props.data.length;
|
|
74
|
+
var separator = !isEmpty && separatorProp == true && renderSeparator;
|
|
75
|
+
return (<KeyboardAwareFlatList style={[Theme.presets.full, style]} contentContainerStyle={[variantStyles.wrapper]} ref={ref} ItemSeparatorComponent={separator} {...props} refreshControl={hasRefresh && (<react_native_1.RefreshControl refreshing={refreshing} onRefresh={onRefresh}/>)}/>);
|
|
76
|
+
});
|
|
77
77
|
//# sourceMappingURL=List.js.map
|
|
File without changes
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ViewProps } from '../View';
|
|
3
|
-
import { ButtonProps } from '../Button';
|
|
4
|
-
import { ComponentVariants, IconPlaceholder } from '@codeleap/common';
|
|
5
|
-
import { MobileModalComposition, MobileModalStyles } from './styles';
|
|
6
|
-
import { StylesOf } from '../../types/utility';
|
|
7
|
-
export * from './styles';
|
|
8
|
-
export declare type ModalProps = Omit<ViewProps, 'variants' | 'styles'> & {
|
|
9
|
-
variants?: ComponentVariants<typeof MobileModalStyles>['variants'];
|
|
10
|
-
styles?: StylesOf<MobileModalComposition>;
|
|
11
|
-
dismissOnBackdrop?: boolean;
|
|
12
|
-
buttonProps?: ButtonProps;
|
|
13
|
-
accessible?: boolean;
|
|
14
|
-
showClose?: boolean;
|
|
15
|
-
closable?: boolean;
|
|
16
|
-
footer?: React.ReactNode;
|
|
17
|
-
title?: React.ReactNode;
|
|
18
|
-
debugName?: string;
|
|
19
|
-
closeIconName?: IconPlaceholder;
|
|
20
|
-
visible: boolean;
|
|
21
|
-
toggle?: () => void;
|
|
22
|
-
scroll?: boolean;
|
|
23
|
-
};
|
|
24
|
-
export declare const Modal: React.FC<ModalProps>;
|
|
25
|
-
export default Modal;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ViewProps } from '../View';
|
|
3
|
+
import { ButtonProps } from '../Button';
|
|
4
|
+
import { ComponentVariants, IconPlaceholder } from '@codeleap/common';
|
|
5
|
+
import { MobileModalComposition, MobileModalStyles } from './styles';
|
|
6
|
+
import { StylesOf } from '../../types/utility';
|
|
7
|
+
export * from './styles';
|
|
8
|
+
export declare type ModalProps = Omit<ViewProps, 'variants' | 'styles'> & {
|
|
9
|
+
variants?: ComponentVariants<typeof MobileModalStyles>['variants'];
|
|
10
|
+
styles?: StylesOf<MobileModalComposition>;
|
|
11
|
+
dismissOnBackdrop?: boolean;
|
|
12
|
+
buttonProps?: ButtonProps;
|
|
13
|
+
accessible?: boolean;
|
|
14
|
+
showClose?: boolean;
|
|
15
|
+
closable?: boolean;
|
|
16
|
+
footer?: React.ReactNode;
|
|
17
|
+
title?: React.ReactNode;
|
|
18
|
+
debugName?: string;
|
|
19
|
+
closeIconName?: IconPlaceholder;
|
|
20
|
+
visible: boolean;
|
|
21
|
+
toggle?: () => void;
|
|
22
|
+
scroll?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
25
|
+
export default Modal;
|
|
@@ -1,109 +1,109 @@
|
|
|
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
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
33
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
34
|
-
};
|
|
35
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
-
var t = {};
|
|
37
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
-
t[p] = s[p];
|
|
39
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
-
t[p[i]] = s[p[i]];
|
|
43
|
-
}
|
|
44
|
-
return t;
|
|
45
|
-
};
|
|
46
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
-
exports.Modal = void 0;
|
|
48
|
-
var React = __importStar(require("react"));
|
|
49
|
-
var View_1 = require("../View");
|
|
50
|
-
var Button_1 = require("../Button");
|
|
51
|
-
var Scroll_1 = require("../Scroll");
|
|
52
|
-
var common_1 = require("@codeleap/common");
|
|
53
|
-
var react_native_1 = require("react-native");
|
|
54
|
-
var Touchable_1 = require("../Touchable");
|
|
55
|
-
var Text_1 = require("../Text");
|
|
56
|
-
var Animated_1 = require("../Animated");
|
|
57
|
-
__exportStar(require("./styles"), exports);
|
|
58
|
-
var Modal = function (modalProps) {
|
|
59
|
-
var _a = modalProps.variants, variants = _a === void 0 ? [] : _a, _b = modalProps.styles, styles = _b === void 0 ? {} : _b, visible = modalProps.visible, showClose = modalProps.showClose, _c = modalProps.closable, closable = _c === void 0 ? true : _c, title = modalProps.title, footer = modalProps.footer, children = modalProps.children, _d = modalProps.toggle, toggle = _d === void 0 ? function () { return null; } : _d, _e = modalProps.dismissOnBackdrop, dismissOnBackdrop = _e === void 0 ? true : _e, _f = modalProps.closeIconName, closeIconName = _f === void 0 ? 'close' : _f, debugName = modalProps.debugName, _g = modalProps.scroll, scroll = _g === void 0 ? true : _g, props = __rest(modalProps, ["variants", "styles", "visible", "showClose", "closable", "title", "footer", "children", "toggle", "dismissOnBackdrop", "closeIconName", "debugName", "scroll"]);
|
|
60
|
-
var variantStyles = (0, common_1.useDefaultComponentStyle)('Modal', {
|
|
61
|
-
variants: variants,
|
|
62
|
-
transform: react_native_1.StyleSheet.flatten,
|
|
63
|
-
styles: styles,
|
|
64
|
-
});
|
|
65
|
-
function getStyles(key) {
|
|
66
|
-
var s = [
|
|
67
|
-
variantStyles[key],
|
|
68
|
-
styles[key],
|
|
69
|
-
visible ? variantStyles[key + ':visible'] : {},
|
|
70
|
-
visible ? styles[key + ':visible'] : {},
|
|
71
|
-
];
|
|
72
|
-
return s;
|
|
73
|
-
}
|
|
74
|
-
var buttonStyles = React.useMemo(function () {
|
|
75
|
-
var buttonEntries = {};
|
|
76
|
-
for (var _i = 0, _a = Object.entries(variantStyles); _i < _a.length; _i++) {
|
|
77
|
-
var _b = _a[_i], key = _b[0], style = _b[1];
|
|
78
|
-
if (key.startsWith('closeButton')) {
|
|
79
|
-
buttonEntries[(0, common_1.capitalize)(key.replace('closeButton', ''), true)] = style;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return buttonEntries;
|
|
83
|
-
}, [variantStyles]);
|
|
84
|
-
var boxAnimation = {
|
|
85
|
-
hidden: __assign(__assign({}, variantStyles['box:pose']), styles['box:pose']),
|
|
86
|
-
visible: __assign(__assign({}, variantStyles['box:pose:visible']), styles['box:pose:visible']),
|
|
87
|
-
};
|
|
88
|
-
return (<View_1.View style={getStyles('wrapper')} pointerEvents={visible ? 'auto' : 'none'}>
|
|
89
|
-
<View_1.AnimatedView style={getStyles('overlay')} transition={'opacity'}/>
|
|
90
|
-
<Scroll_1.Scroll style={getStyles('innerWrapper')} contentContainerStyle={getStyles('innerWrapperScroll')} scrollEnabled={scroll}>
|
|
91
|
-
{dismissOnBackdrop && (<Touchable_1.Touchable debugName={"".concat(debugName, " modal backdrop")} activeOpacity={1} onPress={function () { return toggle(); }} style={getStyles('touchableBackdrop')}/>)}
|
|
92
|
-
<Animated_1.Animated component='View' config={boxAnimation} pose={visible ? 'visible' : 'hidden'} style={getStyles('box')}>
|
|
93
|
-
{(title || showClose) && (<View_1.View style={getStyles('header')}>
|
|
94
|
-
{typeof title === 'string' ? (<Text_1.Text text={title} style={getStyles('title')}/>) : (title)}
|
|
95
|
-
|
|
96
|
-
{showClose && closable && (<Button_1.Button debugName={"".concat(debugName, " modal close button")} icon={closeIconName} variants={['icon']} onPress={toggle} styles={buttonStyles}/>)}
|
|
97
|
-
</View_1.View>)}
|
|
98
|
-
|
|
99
|
-
<View_1.View style={getStyles('body')}>{children}</View_1.View>
|
|
100
|
-
{footer && (<View_1.View style={getStyles('footer')}>
|
|
101
|
-
{typeof footer === 'string' ? <Text_1.Text text={footer}/> : footer}
|
|
102
|
-
</View_1.View>)}
|
|
103
|
-
</Animated_1.Animated>
|
|
104
|
-
</Scroll_1.Scroll>
|
|
105
|
-
</View_1.View>);
|
|
106
|
-
};
|
|
107
|
-
exports.Modal = Modal;
|
|
108
|
-
exports.default = exports.Modal;
|
|
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
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
33
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
34
|
+
};
|
|
35
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.Modal = void 0;
|
|
48
|
+
var React = __importStar(require("react"));
|
|
49
|
+
var View_1 = require("../View");
|
|
50
|
+
var Button_1 = require("../Button");
|
|
51
|
+
var Scroll_1 = require("../Scroll");
|
|
52
|
+
var common_1 = require("@codeleap/common");
|
|
53
|
+
var react_native_1 = require("react-native");
|
|
54
|
+
var Touchable_1 = require("../Touchable");
|
|
55
|
+
var Text_1 = require("../Text");
|
|
56
|
+
var Animated_1 = require("../Animated");
|
|
57
|
+
__exportStar(require("./styles"), exports);
|
|
58
|
+
var Modal = function (modalProps) {
|
|
59
|
+
var _a = modalProps.variants, variants = _a === void 0 ? [] : _a, _b = modalProps.styles, styles = _b === void 0 ? {} : _b, visible = modalProps.visible, showClose = modalProps.showClose, _c = modalProps.closable, closable = _c === void 0 ? true : _c, title = modalProps.title, footer = modalProps.footer, children = modalProps.children, _d = modalProps.toggle, toggle = _d === void 0 ? function () { return null; } : _d, _e = modalProps.dismissOnBackdrop, dismissOnBackdrop = _e === void 0 ? true : _e, _f = modalProps.closeIconName, closeIconName = _f === void 0 ? 'close' : _f, debugName = modalProps.debugName, _g = modalProps.scroll, scroll = _g === void 0 ? true : _g, props = __rest(modalProps, ["variants", "styles", "visible", "showClose", "closable", "title", "footer", "children", "toggle", "dismissOnBackdrop", "closeIconName", "debugName", "scroll"]);
|
|
60
|
+
var variantStyles = (0, common_1.useDefaultComponentStyle)('Modal', {
|
|
61
|
+
variants: variants,
|
|
62
|
+
transform: react_native_1.StyleSheet.flatten,
|
|
63
|
+
styles: styles,
|
|
64
|
+
});
|
|
65
|
+
function getStyles(key) {
|
|
66
|
+
var s = [
|
|
67
|
+
variantStyles[key],
|
|
68
|
+
styles[key],
|
|
69
|
+
visible ? variantStyles[key + ':visible'] : {},
|
|
70
|
+
visible ? styles[key + ':visible'] : {},
|
|
71
|
+
];
|
|
72
|
+
return s;
|
|
73
|
+
}
|
|
74
|
+
var buttonStyles = React.useMemo(function () {
|
|
75
|
+
var buttonEntries = {};
|
|
76
|
+
for (var _i = 0, _a = Object.entries(variantStyles); _i < _a.length; _i++) {
|
|
77
|
+
var _b = _a[_i], key = _b[0], style = _b[1];
|
|
78
|
+
if (key.startsWith('closeButton')) {
|
|
79
|
+
buttonEntries[(0, common_1.capitalize)(key.replace('closeButton', ''), true)] = style;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return buttonEntries;
|
|
83
|
+
}, [variantStyles]);
|
|
84
|
+
var boxAnimation = {
|
|
85
|
+
hidden: __assign(__assign({}, variantStyles['box:pose']), styles['box:pose']),
|
|
86
|
+
visible: __assign(__assign({}, variantStyles['box:pose:visible']), styles['box:pose:visible']),
|
|
87
|
+
};
|
|
88
|
+
return (<View_1.View style={getStyles('wrapper')} pointerEvents={visible ? 'auto' : 'none'}>
|
|
89
|
+
<View_1.AnimatedView style={getStyles('overlay')} transition={'opacity'}/>
|
|
90
|
+
<Scroll_1.Scroll style={getStyles('innerWrapper')} contentContainerStyle={getStyles('innerWrapperScroll')} scrollEnabled={scroll}>
|
|
91
|
+
{dismissOnBackdrop && (<Touchable_1.Touchable debugName={"".concat(debugName, " modal backdrop")} activeOpacity={1} onPress={function () { return toggle(); }} style={getStyles('touchableBackdrop')}/>)}
|
|
92
|
+
<Animated_1.Animated component='View' config={boxAnimation} pose={visible ? 'visible' : 'hidden'} style={getStyles('box')}>
|
|
93
|
+
{(title || showClose) && (<View_1.View style={getStyles('header')}>
|
|
94
|
+
{typeof title === 'string' ? (<Text_1.Text text={title} style={getStyles('title')}/>) : (title)}
|
|
95
|
+
|
|
96
|
+
{showClose && closable && (<Button_1.Button debugName={"".concat(debugName, " modal close button")} icon={closeIconName} variants={['icon']} onPress={toggle} styles={buttonStyles}/>)}
|
|
97
|
+
</View_1.View>)}
|
|
98
|
+
|
|
99
|
+
<View_1.View style={getStyles('body')}>{children}</View_1.View>
|
|
100
|
+
{footer && (<View_1.View style={getStyles('footer')}>
|
|
101
|
+
{typeof footer === 'string' ? <Text_1.Text text={footer}/> : footer}
|
|
102
|
+
</View_1.View>)}
|
|
103
|
+
</Animated_1.Animated>
|
|
104
|
+
</Scroll_1.Scroll>
|
|
105
|
+
</View_1.View>);
|
|
106
|
+
};
|
|
107
|
+
exports.Modal = Modal;
|
|
108
|
+
exports.default = exports.Modal;
|
|
109
109
|
//# sourceMappingURL=index.js.map
|
|
File without changes
|