@codeleap/mobile 1.9.0 → 1.9.3
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/CodeLeap-Mobile-Packages.code-workspace +7 -7
- package/dist/components/ActivityIndicator.d.ts +13 -13
- package/dist/components/ActivityIndicator.js +50 -54
- package/dist/components/ActivityIndicator.js.map +1 -1
- package/dist/components/Animated.d.ts +15 -15
- package/dist/components/Animated.js +54 -58
- package/dist/components/Animated.js.map +1 -1
- package/dist/components/Button.d.ts +125 -125
- package/dist/components/Button.js +78 -82
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts +15 -15
- package/dist/components/Checkbox/index.js +73 -77
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.d.ts +55 -55
- 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 +27 -27
- package/dist/components/FileInput.js +174 -178
- package/dist/components/FileInput.js.map +1 -1
- package/dist/components/Icon.d.ts +12 -12
- package/dist/components/Icon.js +66 -70
- package/dist/components/Icon.js.map +1 -1
- package/dist/components/Image.d.ts +18 -18
- package/dist/components/Image.js +55 -59
- package/dist/components/Image.js.map +1 -1
- package/dist/components/List.d.ts +13 -13
- package/dist/components/List.js +78 -82
- package/dist/components/List.js.map +1 -1
- package/dist/components/Modal/index.d.ts +26 -26
- package/dist/components/Modal/index.js +108 -112
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/styles.d.ts +69 -69
- 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 -87
- package/dist/components/Navigation/Navigation.js.map +1 -1
- 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 -19
- package/dist/components/Navigation/index.js.map +1 -1
- 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 -69
- package/dist/components/Overlay.js.map +1 -1
- package/dist/components/Pager/index.d.ts +20 -20
- package/dist/components/Pager/index.js +163 -167
- package/dist/components/Pager/index.js.map +1 -1
- package/dist/components/Pager/styles.d.ts +54 -54
- 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 -72
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.d.ts +57 -57
- package/dist/components/RadioInput/styles.js +44 -44
- package/dist/components/RadioInput/styles.js.map +0 -0
- package/dist/components/Scroll.d.ts +12 -12
- package/dist/components/Scroll.js +76 -80
- package/dist/components/Scroll.js.map +1 -1
- package/dist/components/Sections.d.ts +11 -11
- package/dist/components/Sections.js +76 -80
- package/dist/components/Sections.js.map +1 -1
- package/dist/components/Select/index.d.ts +5 -5
- package/dist/components/Select/index.js +146 -150
- package/dist/components/Select/index.js.map +1 -1
- 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 +40 -39
- 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 -97
- package/dist/components/Slider/index.js.map +1 -1
- 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 -75
- package/dist/components/Switch.js.map +1 -1
- package/dist/components/Text.d.ts +12 -12
- package/dist/components/Text.js +48 -52
- package/dist/components/Text.js.map +1 -1
- package/dist/components/TextInput.d.ts +183 -183
- package/dist/components/TextInput.js +174 -177
- package/dist/components/TextInput.js.map +1 -1
- package/dist/components/Touchable.d.ts +14 -14
- package/dist/components/Touchable.js +57 -61
- package/dist/components/Touchable.js.map +1 -1
- package/dist/components/View.d.ts +120 -120
- package/dist/components/View.js +50 -54
- package/dist/components/View.js.map +1 -1
- package/dist/components/components.d.ts +25 -25
- package/dist/components/components.js +37 -41
- package/dist/components/components.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +24 -28
- package/dist/index.js.map +1 -1
- 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/textInputMask.d.ts +7 -7
- package/dist/modules/textInputMask.js +9 -9
- 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/modules/types/textInputMask.d.ts +9 -9
- package/dist/modules/types/textInputMask.js +2 -2
- 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 +1 -1
- 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 +39 -39
- package/src/components/ActivityIndicator.tsx +46 -46
- package/src/components/Animated.tsx +34 -34
- package/src/components/Button.tsx +95 -95
- package/src/components/Checkbox/index.tsx +83 -83
- package/src/components/Checkbox/styles.ts +72 -72
- package/src/components/ContentView.tsx +58 -58
- package/src/components/FileInput.tsx +181 -181
- package/src/components/Icon.tsx +58 -58
- package/src/components/Image.tsx +61 -61
- package/src/components/List.tsx +109 -109
- package/src/components/Modal/index.tsx +161 -161
- 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 +242 -242
- 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 +104 -104
- package/src/components/Sections.tsx +101 -101
- package/src/components/Select/index.tsx +195 -195
- package/src/components/Select/styles.ts +81 -81
- package/src/components/Select/types.ts +46 -45
- 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 +246 -245
- package/src/components/Touchable.tsx +64 -64
- 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/textInputMask.ts +7 -7
- package/src/modules/types/documentPicker.d.ts +215 -215
- package/src/modules/types/fileTypes.ts +138 -138
- package/src/modules/types/textInputMask.ts +9 -9
- 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,60 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var res = (0, common_1.arePropsEqual)(prevProps, nextProps, { check: check });
|
|
57
|
-
return res;
|
|
58
|
-
}
|
|
59
|
-
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}
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
tintColor={style === null || style === void 0 ? void 0 : style.tintColor} resizeMode={fastImage_1.FastImage.resizeMode[resizeMode || 'contain']} {...imageProps}/>);
|
|
46
|
+
}
|
|
47
|
+
return <react_native_1.Image style={styles} resizeMode={resizeMode} {...imageProps}/>;
|
|
48
|
+
};
|
|
49
|
+
exports.ImageComponent = ImageComponent;
|
|
50
|
+
function areEqual(prevProps, nextProps) {
|
|
51
|
+
var check = ['source', 'style', 'variants', 'resizeMode', 'fast'];
|
|
52
|
+
var res = (0, common_1.arePropsEqual)(prevProps, nextProps, { check: check });
|
|
53
|
+
return res;
|
|
54
|
+
}
|
|
55
|
+
exports.Image = React.memo(exports.ImageComponent, areEqual);
|
|
60
56
|
//# sourceMappingURL=Image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,2CAMyB;AAEzB,6CAMqB;AACrB,kDAAgD;AAgBzC,IAAM,cAAc,GAAyB,UAAC,KA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AQ,CAAC,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FlatList } from 'react-native';
|
|
3
|
-
import { ViewProps } from './View';
|
|
4
|
-
declare type RNFlatListProps<T = any> = FlatList<T>['props'];
|
|
5
|
-
export declare type FlatListProps<T = any> = RNFlatListProps<T> & ViewProps & {
|
|
6
|
-
onRefresh?: () => void;
|
|
7
|
-
refreshTimeout?: number;
|
|
8
|
-
changeData?: any;
|
|
9
|
-
separators?: boolean;
|
|
10
|
-
keyboardAware?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const List: <T = any>(props: FlatListProps<T>) => JSX.Element;
|
|
13
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FlatList } from 'react-native';
|
|
3
|
+
import { ViewProps } from './View';
|
|
4
|
+
declare type RNFlatListProps<T = any> = FlatList<T>['props'];
|
|
5
|
+
export declare type FlatListProps<T = any> = RNFlatListProps<T> & ViewProps & {
|
|
6
|
+
onRefresh?: () => void;
|
|
7
|
+
refreshTimeout?: number;
|
|
8
|
+
changeData?: any;
|
|
9
|
+
separators?: boolean;
|
|
10
|
+
keyboardAware?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const List: <T = any>(props: FlatListProps<T>) => JSX.Element;
|
|
13
|
+
export {};
|
package/dist/components/List.js
CHANGED
|
@@ -1,83 +1,79 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var Component = keyboardAware ? KeyboardAwareFlatList : react_native_1.FlatList;
|
|
80
|
-
return (<Component style={[Theme.presets.full, style]} contentContainerStyle={[variantStyles.wrapper]} ref={ref} ItemSeparatorComponent={separator} {...props} refreshControl={hasRefresh && (<react_native_1.RefreshControl refreshing={refreshing} onRefresh={onRefresh}/>)}/>);
|
|
81
|
-
});
|
|
82
|
-
exports.List = ListCP;
|
|
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
|
+
var ListCP = (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, _c = flatListProps.keyboardAware, keyboardAware = _c === void 0 ? true : _c, props = __rest(flatListProps, ["variants", "style", "refreshTimeout", "changeData", "keyboardAware"]);
|
|
43
|
+
var hasRefresh = !!props.onRefresh;
|
|
44
|
+
var _d = (0, react_1.useState)(false), refreshing = _d[0], setRefreshing = _d[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
|
+
var Component = keyboardAware ? KeyboardAwareFlatList : react_native_1.FlatList;
|
|
76
|
+
return (<Component style={[Theme.presets.full, style]} contentContainerStyle={[variantStyles.wrapper]} ref={ref} ItemSeparatorComponent={separator} refreshControl={hasRefresh && (<react_native_1.RefreshControl refreshing={refreshing} onRefresh={onRefresh}/>)} {...props}/>);
|
|
77
|
+
});
|
|
78
|
+
exports.List = ListCP;
|
|
83
79
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/components/List.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/components/List.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,+BAA4C;AAC5C,2CAMyB;AACzB,mGAIgD;AAEhD,6CAAuD;AACvD,+BAAwC;AAYxC,IAAM,qBAAqB,GACzB,+DAKC,CAAA;AAEH,IAAM,MAAM,GAAG,IAAA,kBAAU,EACvB,UAAC,aAAa,EAAE,GAAG;IAEf,IAAA,KAME,aAAa,SANF,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,KAAK,GAKH,aAAa,MALV,EACL,KAIE,aAAa,eAJM,EAArB,cAAc,mBAAG,IAAI,KAAA,EACrB,UAAU,GAGR,aAAa,WAHL,EACV,KAEE,aAAa,cAFK,EAApB,aAAa,mBAAG,IAAI,KAAA,EACjB,KAAK,UACN,aAAa,EAPX,sEAOL,CADS,CACO;IACjB,IAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,SAAS,CAAA;IAC9B,IAAA,KAA8B,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAA5C,UAAU,QAAA,EAAE,aAAa,QAAmB,CAAA;IAEnD,IAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAChC,IAAM,YAAY,GAAG,IAAA,oBAAW,EAAC,UAAU,CAAC,CAAA;IAE5C,IAAM,SAAS,GAAG;QAChB,IAAI,KAAK,CAAC,OAAO,EAAE;YACjB,YAAY,CAAC,KAAK,C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,IAAI,EAAE,KAAK,CAAC,CAAC,CACnC,qBAAqB,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAC/C,GAAG,CAAC,CAAC,GAA0B,CAAC,CAChC,sBAAsB,CAAC,CAAC,SAAS,CAAC,CAClC,cAAc,CAAC,CACb,UAAU,IAAI,CACZ,CAAC,6BAAc,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,EAAG,CACjE,CACF,CACD,IAAI,KAAK,CAAC,EACV,CACH,CAAA;AACH,CAAC,CACF,CAAA;AAEY,QAAA,IAAI,GAAG,MAA6D,CAAA"}
|
|
@@ -1,26 +1,26 @@
|
|
|
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
|
-
keyboardAware?: boolean;
|
|
24
|
-
};
|
|
25
|
-
export declare const Modal: React.FC<ModalProps>;
|
|
26
|
-
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
|
+
keyboardAware?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
26
|
+
export default Modal;
|