@codeleap/mobile 1.9.26 → 1.9.27
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/components/Button.d.ts +8 -1
- package/dist/components/Button.js +17 -6
- package/dist/components/Button.js.map +1 -1
- package/dist/components/EmptyPlaceholder.d.ts +12 -0
- package/dist/components/EmptyPlaceholder.js +54 -0
- package/dist/components/EmptyPlaceholder.js.map +1 -0
- package/dist/components/Gap.d.ts +8 -0
- package/dist/components/Gap.js +60 -0
- package/dist/components/Gap.js.map +1 -0
- package/dist/components/List.d.ts +3 -3
- package/dist/components/List.js +3 -2
- package/dist/components/List.js.map +1 -1
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/Modal/index.js +3 -2
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/components.d.ts +2 -1
- package/dist/components/components.js +2 -1
- package/dist/components/components.js.map +1 -1
- package/dist/modules/textInputMask.d.ts +4 -7
- package/dist/modules/types/textInputMask.d.ts +5 -10
- package/package.json +1 -1
- package/src/components/Button.tsx +28 -6
- package/src/components/EmptyPlaceholder.tsx +53 -0
- package/src/components/Gap.tsx +40 -0
- package/src/components/List.tsx +7 -2
- package/src/components/Modal/index.tsx +4 -1
- package/src/components/Pager/index.tsx +19 -19
- package/src/components/Pager/styles.ts +6 -7
- package/src/components/components.ts +2 -1
- package/src/modules/types/textInputMask.ts +6 -10
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ButtonStyles, ComponentVariants, ButtonComposition, IconPlaceholder } from '@codeleap/common';
|
|
2
|
+
import { ButtonStyles, ComponentVariants, ButtonComposition, ButtonParts, IconPlaceholder } from '@codeleap/common';
|
|
3
3
|
import { StylesOf } from '../types/utility';
|
|
4
4
|
import { TouchableProps } from './Touchable';
|
|
5
5
|
import { TouchableOpacity } from 'react-native';
|
|
6
|
+
declare type ChildProps = {
|
|
7
|
+
styles: StylesOf<ButtonParts>;
|
|
8
|
+
pressed: boolean;
|
|
9
|
+
props: Omit<ButtonProps, 'children'>;
|
|
10
|
+
};
|
|
6
11
|
export declare type ButtonProps = Omit<TouchableProps, 'variants'> & ComponentVariants<typeof ButtonStyles> & {
|
|
7
12
|
text?: string;
|
|
8
13
|
rightIcon?: IconPlaceholder;
|
|
@@ -11,6 +16,7 @@ export declare type ButtonProps = Omit<TouchableProps, 'variants'> & ComponentVa
|
|
|
11
16
|
loading?: boolean;
|
|
12
17
|
debounce?: number;
|
|
13
18
|
debugName: string;
|
|
19
|
+
children?: React.ReactNode | ((props: ChildProps) => React.ReactNode);
|
|
14
20
|
};
|
|
15
21
|
export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "children" | "hitSlop" | "onLayout" | "style" | "testID" | "hasTVPreferredFocus" | "tvParallaxProperties" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "text" | "component" | keyof import("@codeleap/common").BaseViewProps | "activeOpacity" | "delayLongPress" | "delayPressIn" | "delayPressOut" | "disabled" | "onBlur" | "onFocus" | "onLongPress" | "onPress" | "onPressIn" | "onPressOut" | "pressRetentionOffset" | "touchSoundDisabled" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "debugName" | "debugComponent" | "icon" | "styles" | "rightIcon" | "loading" | keyof ComponentVariants<{
|
|
16
22
|
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<ButtonComposition, any>>;
|
|
@@ -123,3 +129,4 @@ export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "
|
|
|
123
129
|
debBlue: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<ButtonComposition, any>>;
|
|
124
130
|
debYellow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<ButtonComposition, any>>;
|
|
125
131
|
}>> | "debounce"> & React.RefAttributes<TouchableOpacity>>;
|
|
132
|
+
export {};
|
|
@@ -71,13 +71,24 @@ exports.Button = (0, react_1.forwardRef)(function (buttonProps, ref) {
|
|
|
71
71
|
var leftIconStyle = react_native_1.StyleSheet.flatten([iconStyle, getStyles('leftIcon')]);
|
|
72
72
|
var rightIconStyle = react_native_1.StyleSheet.flatten([iconStyle, getStyles('rightIcon')]);
|
|
73
73
|
var hasText = !!(text || children);
|
|
74
|
-
|
|
74
|
+
var _styles = {
|
|
75
|
+
wrapper: getStyles('wrapper'),
|
|
76
|
+
loader: getStyles('loader'),
|
|
77
|
+
leftIcon: leftIconStyle,
|
|
78
|
+
rightIcon: rightIconStyle,
|
|
79
|
+
text: getStyles('text'),
|
|
80
|
+
icon: getStyles('icon'),
|
|
81
|
+
};
|
|
82
|
+
var childrenContent = typeof children === 'function' ?
|
|
83
|
+
children({ styles: _styles, props: buttonProps, pressed: pressed })
|
|
84
|
+
: children;
|
|
85
|
+
return (<Touchable_1.Touchable style={_styles.wrapper} onPress={handlePress} ref={ref} disabled={disabled} debugComponent={'Button'} {...props}>
|
|
75
86
|
|
|
76
|
-
{loading && <ActivityIndicator_1.ActivityIndicator style={
|
|
77
|
-
{!loading && <Icon_1.Icon name={icon} style={
|
|
78
|
-
{text ? <Text_1.Text text={text} style={
|
|
79
|
-
{
|
|
80
|
-
<Icon_1.Icon name={rightIcon} style={
|
|
87
|
+
{loading && <ActivityIndicator_1.ActivityIndicator style={_styles.loader}/>}
|
|
88
|
+
{!loading && <Icon_1.Icon name={icon} style={_styles.leftIcon} renderEmptySpace={hasText}/>}
|
|
89
|
+
{text ? <Text_1.Text text={text} style={_styles.text}/> : null}
|
|
90
|
+
{childrenContent}
|
|
91
|
+
<Icon_1.Icon name={rightIcon} style={_styles.rightIcon} renderEmptySpace={hasText}/>
|
|
81
92
|
</Touchable_1.Touchable>);
|
|
82
93
|
});
|
|
83
94
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,2CAOyB;AACzB,+BAAkC;AAElC,+BAA6B;AAC7B,yCAAuD;AACvD,+BAA6B;AAC7B,yDAAuD;AACvD,6CAA2D;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,2CAOyB;AACzB,+BAAkC;AAElC,+BAA6B;AAC7B,yCAAuD;AACvD,+BAA6B;AAC7B,yDAAuD;AACvD,6CAA2D;AAoB9C,QAAA,MAAM,GAAG,IAAA,kBAAU,EAAgC,UAAC,WAAW,EAAE,GAAG;IAE7E,IAAA,KAYE,WAAW,SAZA,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,QAAQ,GAWN,WAAW,SAXL,EACR,IAAI,GAUF,WAAW,KAVT,EACJ,IAAI,GASF,WAAW,KATT,EACJ,OAAO,GAQL,WAAW,QARN,EACP,KAOE,WAAW,OAPF,EAAX,MAAM,mBAAG,EAAE,KAAA,EACX,OAAO,GAML,WAAW,QANN,EACP,QAAQ,GAKN,WAAW,SALL,EACR,SAAS,GAIP,WAAW,UAJJ,EACT,KAGE,WAAW,SAHC,EAAd,QAAQ,mBAAG,GAAG,KAAA,EACd,KAAK,GAEH,WAAW,MAFR,EACF,KAAK,UACN,WAAW,EAbT,sHAaL,CADS,CACK;IACT,IAAA,KAAwB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAA5C,O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from 'react';
|
|
2
|
+
import { ComponentVariants, EmptyPlaceholderComposition, EmptyPlaceholderStyles, IconPlaceholder } from '@codeleap/common';
|
|
3
|
+
import { StylesOf } from '../types/utility';
|
|
4
|
+
export declare type EmptyPlaceholderProps = {
|
|
5
|
+
itemName?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
styles?: StylesOf<EmptyPlaceholderComposition>;
|
|
9
|
+
variants?: ComponentVariants<typeof EmptyPlaceholderStyles>['variants'];
|
|
10
|
+
emptyIconName?: IconPlaceholder;
|
|
11
|
+
};
|
|
12
|
+
export declare const EmptyPlaceholder: React.FC<EmptyPlaceholderProps>;
|
|
@@ -0,0 +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
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.EmptyPlaceholder = void 0;
|
|
27
|
+
var react_1 = __importStar(require("react"));
|
|
28
|
+
var Icon_1 = require("./Icon");
|
|
29
|
+
var View_1 = require("./View");
|
|
30
|
+
var Text_1 = require("./Text");
|
|
31
|
+
var ActivityIndicator_1 = require("./ActivityIndicator");
|
|
32
|
+
var common_1 = require("@codeleap/common");
|
|
33
|
+
var react_native_1 = require("react-native");
|
|
34
|
+
var EmptyPlaceholder = function (props) {
|
|
35
|
+
var itemName = props.itemName, title = props.title, loading = props.loading, _a = props.styles, styles = _a === void 0 ? {} : _a, _b = props.variants, variants = _b === void 0 ? [] : _b, _c = props.emptyIconName, emptyIconName = _c === void 0 ? 'search' : _c;
|
|
36
|
+
var emptyText = title || (itemName && "No ".concat(itemName, " found.")) || 'No items.';
|
|
37
|
+
var componentStyles = (0, common_1.useDefaultComponentStyle)('EmptyPlaceholder', {
|
|
38
|
+
variants: variants,
|
|
39
|
+
transform: react_native_1.StyleSheet.flatten,
|
|
40
|
+
styles: styles,
|
|
41
|
+
});
|
|
42
|
+
var activityIndicatorStyles = (0, react_1.useMemo)(function () { return (0, common_1.getNestedStylesByKey)('loader', componentStyles); }, [componentStyles]);
|
|
43
|
+
if (loading) {
|
|
44
|
+
return (<View_1.View style={[componentStyles.wrapper, componentStyles['wrapper:loading']]}>
|
|
45
|
+
<ActivityIndicator_1.ActivityIndicator styles={activityIndicatorStyles}/>
|
|
46
|
+
</View_1.View>);
|
|
47
|
+
}
|
|
48
|
+
return (<View_1.View style={componentStyles.wrapper}>
|
|
49
|
+
<Icon_1.Icon name={emptyIconName} style={componentStyles.icon}/>
|
|
50
|
+
<Text_1.Text text={emptyText} style={componentStyles.text}/>
|
|
51
|
+
</View_1.View>);
|
|
52
|
+
};
|
|
53
|
+
exports.EmptyPlaceholder = EmptyPlaceholder;
|
|
54
|
+
//# source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EAAE,WAAI,CAAC,CACR,CAAA;KACF;IAED,OAAO,CACL,CAAC,WAAI,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CACnC;MAAA,CAAC,WAAI,CAAC,IAAI,CAAC,CAAC,aAAgC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,EAC1E;MAAA,CAAC,WAAI,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,EACrD;IAAA,EAAE,WAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AA3BY,QAAA,gBAAgB,oBA2B5B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.Gap = void 0;
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var common_1 = require("@codeleap/common");
|
|
31
|
+
var View_1 = require("./View");
|
|
32
|
+
var Gap = function (_a) {
|
|
33
|
+
var _b;
|
|
34
|
+
var children = _a.children, value = _a.value, _c = _a.defaultProps, defaultProps = _c === void 0 ? {} : _c, props = __rest(_a, ["children", "value", "defaultProps"]);
|
|
35
|
+
var Theme = (0, common_1.useCodeleapContext)().Theme;
|
|
36
|
+
var horizontal = (_b = props.variants) === null || _b === void 0 ? void 0 : _b.includes('row');
|
|
37
|
+
return (<View_1.View {...props}>
|
|
38
|
+
{react_1.default.Children.toArray(children).map(function (Element, idx, childArr) {
|
|
39
|
+
if (react_1.default.isValidElement(Element)) {
|
|
40
|
+
var props_1 = __assign(__assign({}, Element.props), defaultProps);
|
|
41
|
+
var spacingFunction = horizontal ? 'marginHorizontal' : 'marginVertical';
|
|
42
|
+
switch (idx) {
|
|
43
|
+
case 0:
|
|
44
|
+
spacingFunction = horizontal ? 'marginRight' : 'marginBottom';
|
|
45
|
+
break;
|
|
46
|
+
case childArr.length - 1:
|
|
47
|
+
spacingFunction = horizontal ? 'marginLeft' : 'marginTop';
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
props_1.style = [props_1.style, Theme.spacing[spacingFunction](value / 2)];
|
|
53
|
+
return react_1.default.cloneElement(Element, props_1);
|
|
54
|
+
}
|
|
55
|
+
return Element;
|
|
56
|
+
})}
|
|
57
|
+
</View_1.View>);
|
|
58
|
+
};
|
|
59
|
+
exports.Gap = Gap;
|
|
60
|
+
//# sourceMappingURL=Gap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gap.js","sourceRoot":"","sources":["../../src/components/Gap.tsx"],"names":[],"m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AO,eAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAK,CAAC,CAAA;aAC1C;YACD,OAAO,OAAO,CAAA;QAChB,CAAC,CAAC,CAEN;IAAA,EAAE,WAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AA7BY,QAAA,GAAG,OA6Bf"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { FlatListProps as RNFlatListProps } from 'react-native';
|
|
3
3
|
import { ViewProps } from './View';
|
|
4
|
-
|
|
4
|
+
import { EmptyPlaceholderProps } from './EmptyPlaceholder';
|
|
5
5
|
export declare type FlatListProps<T = any> = RNFlatListProps<T> & ViewProps & {
|
|
6
6
|
onRefresh?: () => void;
|
|
7
7
|
refreshTimeout?: number;
|
|
8
8
|
changeData?: any;
|
|
9
9
|
separators?: boolean;
|
|
10
10
|
refreshing?: boolean;
|
|
11
|
+
placeholder?: EmptyPlaceholderProps;
|
|
11
12
|
keyboardAware?: boolean;
|
|
12
13
|
};
|
|
13
14
|
export declare const List: <T = any>(props: FlatListProps<T>) => JSX.Element;
|
|
14
|
-
export {};
|
package/dist/components/List.js
CHANGED
|
@@ -41,9 +41,10 @@ var common_1 = require("@codeleap/common");
|
|
|
41
41
|
var react_native_keyboard_aware_scroll_view_1 = require("react-native-keyboard-aware-scroll-view");
|
|
42
42
|
var react_native_1 = require("react-native");
|
|
43
43
|
var View_1 = require("./View");
|
|
44
|
+
var EmptyPlaceholder_1 = require("./EmptyPlaceholder");
|
|
44
45
|
var KeyboardAwareFlatList = react_native_keyboard_aware_scroll_view_1.KeyboardAwareFlatList;
|
|
45
46
|
var ListCP = (0, react_1.forwardRef)(function (flatListProps, ref) {
|
|
46
|
-
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"]);
|
|
47
|
+
var _a = flatListProps.variants, variants = _a === void 0 ? [] : _a, style = flatListProps.style, _b = flatListProps.refreshTimeout, refreshTimeout = _b === void 0 ? 3000 : _b, changeData = flatListProps.changeData, placeholder = flatListProps.placeholder, _c = flatListProps.keyboardAware, keyboardAware = _c === void 0 ? true : _c, props = __rest(flatListProps, ["variants", "style", "refreshTimeout", "changeData", "placeholder", "keyboardAware"]);
|
|
47
48
|
var hasRefresh = !!props.onRefresh;
|
|
48
49
|
var _d = (0, react_1.useState)(false), refreshingState = _d[0], setRefreshing = _d[1];
|
|
49
50
|
var refreshingDisplay = props.refreshing !== undefined ? props.refreshing : refreshingState;
|
|
@@ -78,7 +79,7 @@ var ListCP = (0, react_1.forwardRef)(function (flatListProps, ref) {
|
|
|
78
79
|
var isEmpty = !props.data || !props.data.length;
|
|
79
80
|
var separator = !isEmpty && separatorProp == true && renderSeparator;
|
|
80
81
|
var Component = keyboardAware ? KeyboardAwareFlatList : react_native_1.FlatList;
|
|
81
|
-
return (<Component style={[Theme.presets.full, style]} contentContainerStyle={[variantStyles.wrapper]} ref={ref} ItemSeparatorComponent={separator} refreshControl={hasRefresh && (<react_native_1.RefreshControl refreshing={refreshingDisplay} onRefresh={onRefresh}/>)} {...props}/>);
|
|
82
|
+
return (<Component style={[Theme.presets.full, style]} contentContainerStyle={[variantStyles.wrapper]} ref={ref} ItemSeparatorComponent={separator} refreshControl={hasRefresh && (<react_native_1.RefreshControl refreshing={refreshingDisplay} onRefresh={onRefresh}/>)} ListEmptyComponent={<EmptyPlaceholder_1.EmptyPlaceholder {...placeholder}/>} {...props}/>);
|
|
82
83
|
});
|
|
83
84
|
exports.List = ListCP;
|
|
84
85
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/components/List.tsx"],"names":[],"mappings":";;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C,OAAO,CAAC,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,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,EAAG,CACxE,CACF,CACD,kBAAkB,CAAC,CAAC,CAAC,mCAAgB,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,CACzD,IAAI,KAAK,CAAC,EACV,CACH,CAAA;AACH,CAAC,CACF,CAAA;AAEY,QAAA,IAAI,GAAG,MAA6D,CAAA"}
|
|
@@ -60,7 +60,7 @@ var Text_1 = require("../Text");
|
|
|
60
60
|
var Animated_1 = require("../Animated");
|
|
61
61
|
__exportStar(require("./styles"), exports);
|
|
62
62
|
var Modal = function (modalProps) {
|
|
63
|
-
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, _h = modalProps.keyboardAware, keyboardAware = _h === void 0 ? true : _h, props = __rest(modalProps, ["variants", "styles", "visible", "showClose", "closable", "title", "footer", "children", "toggle", "dismissOnBackdrop", "closeIconName", "debugName", "scroll", "keyboardAware"]);
|
|
63
|
+
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, _h = modalProps.keyboardAware, keyboardAware = _h === void 0 ? true : _h, _j = modalProps.zIndex, zIndex = _j === void 0 ? null : _j, props = __rest(modalProps, ["variants", "styles", "visible", "showClose", "closable", "title", "footer", "children", "toggle", "dismissOnBackdrop", "closeIconName", "debugName", "scroll", "keyboardAware", "zIndex"]);
|
|
64
64
|
var variantStyles = (0, common_1.useDefaultComponentStyle)('Modal', {
|
|
65
65
|
variants: variants,
|
|
66
66
|
transform: react_native_1.StyleSheet.flatten,
|
|
@@ -89,7 +89,8 @@ var Modal = function (modalProps) {
|
|
|
89
89
|
hidden: __assign(__assign({}, variantStyles['box:pose']), styles['box:pose']),
|
|
90
90
|
visible: __assign(__assign({}, variantStyles['box:pose:visible']), styles['box:pose:visible']),
|
|
91
91
|
};
|
|
92
|
-
|
|
92
|
+
var wrapperStyle = react_native_1.StyleSheet.flatten(getStyles('wrapper'));
|
|
93
|
+
return (<View_1.View style={[wrapperStyle, { zIndex: typeof zIndex === 'number' ? zIndex : wrapperStyle === null || wrapperStyle === void 0 ? void 0 : wrapperStyle.zIndex }]} pointerEvents={visible ? 'auto' : 'none'}>
|
|
93
94
|
<View_1.AnimatedView style={getStyles('overlay')} transition={'opacity'}/>
|
|
94
95
|
<Scroll_1.Scroll style={getStyles('innerWrapper')} contentContainerStyle={getStyles('innerWrapperScroll')} scrollEnabled={scroll} keyboardAware={keyboardAware}>
|
|
95
96
|
{dismissOnBackdrop && (<Touchable_1.Touchable debugName={"".concat(debugName, " modal backdrop")} activeOpacity={1} onPress={function () { return toggle(); }} style={getStyles('touchableBackdrop')}/>)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,gCAAuD;AACvD,oCAA+C;AAC/C,oCAAkC;AAClC,2CAOyB;AAMzB,6CAAyC;AAGzC,0CAAwC;AACxC,gCAA8B;AAC9B,wCAAsC;AAEtC,2CAAwB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,gCAAuD;AACvD,oCAA+C;AAC/C,oCAAkC;AAClC,2CAOyB;AAMzB,6CAAyC;AAGzC,0CAAwC;AACxC,gCAA8B;AAC9B,wCAAsC;AAEtC,2CAAwB;AAqBjB,IAAM,KAAK,GAAyB,UAAC,UAAU;IAElD,IAAA,KAgBE,UAAU,SAhBC,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,KAeE,UAAU,OAfD,EAAX,MAAM,mBAAG,EAAE,KAAA,EACX,OAAO,GAcL,UAAU,QAdL,EACP,SAAS,GAaP,UAAU,UAbH,EACT,KAYE,UAAU,SAZG,EAAf,QAAQ,mBAAG,IAAI,KAAA,EACf,KAAK,GAWH,UAAU,MAXP,EACL,MAAM,GAUJ,UAAU,OAVN,EACN,QAAQ,GASN,UAAU,SATJ,EACR,KAQE,UAAU,OARO,EAAnB,MAAM,mBAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,KAAA,EACnB,KAOE,UAAU,kBAPY,EAAxB,iBAAiB,mBAAG,IAAI,KAAA,EACxB,KAME,UAAU,cANW,EAAvB,aAAa,mBAAG,OAAO,KAAA,EACvB,SAAS,GAKP,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;QAAA,EAAE,mBAAQ,CACZ;MAAA,EAAE,eAAM,CACV;IAAA,EAAE,WAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AApHY,QAAA,KAAK,SAoHjB;AAED,kBAAe,aAAK,CAAA"}
|
|
@@ -39,5 +39,6 @@ __exportStar(require("./Overlay"), exports);
|
|
|
39
39
|
__exportStar(require("./Modal"), exports);
|
|
40
40
|
__exportStar(require("./Navigation"), exports);
|
|
41
41
|
__exportStar(require("./Pager"), exports);
|
|
42
|
-
__exportStar(require("./
|
|
42
|
+
__exportStar(require("./EmptyPlaceholder"), exports);
|
|
43
|
+
__exportStar(require("./Gap"), exports);
|
|
43
44
|
//# sourceMappingURL=components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,6CAA0B;AAC1B,yCAAsB;AACtB,8CAA2B;AAC3B,yCAAsB;AACtB,0CAAuB;AACvB,6CAA0B;AAC1B,8CAA2B;AAC3B,+CAA4B;AAC5B,2CAAwB;AACxB,gDAA6B;AAC7B,6CAA0B;AAC1B,2CAAwB;AACxB,8CAA2B;AAC3B,2CAAwB;AACxB,+CAA4B;AAC5B,2CAAwB;AACxB,yCAAsB;AACtB,sDAAmC;AACnC,2CAAwB;AACxB,gDAA6B;AAC7B,4CAAyB;AACzB,0CAAuB;AAEvB,+CAA4B;AAC5B,0CAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components/components.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,6CAA0B;AAC1B,yCAAsB;AACtB,8CAA2B;AAC3B,yCAAsB;AACtB,0CAAuB;AACvB,6CAA0B;AAC1B,8CAA2B;AAC3B,+CAA4B;AAC5B,2CAAwB;AACxB,gDAA6B;AAC7B,6CAA0B;AAC1B,2CAAwB;AACxB,8CAA2B;AAC3B,2CAAwB;AACxB,+CAA4B;AAC5B,2CAAwB;AACxB,yCAAsB;AACtB,sDAAmC;AACnC,2CAAwB;AACxB,gDAA6B;AAC7B,4CAAyB;AACzB,0CAAuB;AAEvB,+CAA4B;AAC5B,0CAAuB;AACvB,qDAAkC;AAClC,wCAAqB"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const MaskedTextInput: import("react").ForwardRefExoticComponent<{
|
|
3
|
-
masking: {
|
|
4
|
-
type?: any;
|
|
2
|
+
export declare const MaskedTextInput: import("react").ForwardRefExoticComponent<Omit<import("react-native-masked-text").TextInputMaskProps, keyof import("react-native").TextInputProps> & {
|
|
3
|
+
masking: Partial<import("@codeleap/common/dist/types/third-party/react-native-masked-text").TextInputMaskProps> & {
|
|
5
4
|
saveFormatted?: boolean;
|
|
6
|
-
} & {
|
|
7
|
-
type: import("react-native-masked-text").TextInputMaskTypeProp;
|
|
8
5
|
};
|
|
9
|
-
onChangeText
|
|
10
|
-
} &
|
|
6
|
+
onChangeText: (text: string, rawText?: string) => void;
|
|
7
|
+
} & {
|
|
11
8
|
ref?: any;
|
|
12
9
|
}>;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { FormTypes } from '@codeleap/common';
|
|
2
|
-
import {
|
|
3
|
-
import { TextInput as NativeTextInput } from 'react-native';
|
|
4
|
-
declare type NativeProps = ComponentPropsWithoutRef<typeof NativeTextInput>;
|
|
2
|
+
import { TextInputProps } from 'react-native';
|
|
5
3
|
import { TextInputMaskProps as RNTextInputMaskProps } from 'react-native-masked-text';
|
|
6
|
-
export declare type TextInputMaskProps = {
|
|
7
|
-
masking: FormTypes.TextField['masking']
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
onChangeText?: (maskedText: string, unmaskedText: string) => any;
|
|
11
|
-
} & NativeProps & RNTextInputMaskProps;
|
|
12
|
-
export {};
|
|
4
|
+
export declare type TextInputMaskProps = Omit<RNTextInputMaskProps, keyof TextInputProps> & {
|
|
5
|
+
masking: FormTypes.TextField['masking'];
|
|
6
|
+
onChangeText: RNTextInputMaskProps['onChangeText'];
|
|
7
|
+
};
|
package/package.json
CHANGED
|
@@ -15,6 +15,12 @@ import { Icon } from './Icon'
|
|
|
15
15
|
import { ActivityIndicator } from './ActivityIndicator'
|
|
16
16
|
import { StyleSheet, TouchableOpacity } from 'react-native'
|
|
17
17
|
|
|
18
|
+
type ChildProps = {
|
|
19
|
+
styles: StylesOf<ButtonParts>
|
|
20
|
+
pressed: boolean
|
|
21
|
+
props: Omit<ButtonProps, 'children'>
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
export type ButtonProps = Omit<TouchableProps, 'variants'> &
|
|
19
25
|
ComponentVariants<typeof ButtonStyles> & {
|
|
20
26
|
text?: string
|
|
@@ -24,6 +30,7 @@ export type ButtonProps = Omit<TouchableProps, 'variants'> &
|
|
|
24
30
|
loading?: boolean
|
|
25
31
|
debounce?: number
|
|
26
32
|
debugName: string
|
|
33
|
+
children?: React.ReactNode | ((props: ChildProps) => React.ReactNode)
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
export const Button = forwardRef<TouchableOpacity, ButtonProps>((buttonProps, ref) => {
|
|
@@ -75,9 +82,24 @@ export const Button = forwardRef<TouchableOpacity, ButtonProps>((buttonProps, re
|
|
|
75
82
|
const rightIconStyle = StyleSheet.flatten([iconStyle, getStyles('rightIcon')])
|
|
76
83
|
|
|
77
84
|
const hasText = !!(text || children)
|
|
85
|
+
|
|
86
|
+
const _styles = {
|
|
87
|
+
wrapper: getStyles('wrapper'),
|
|
88
|
+
loader: getStyles('loader'),
|
|
89
|
+
leftIcon: leftIconStyle,
|
|
90
|
+
rightIcon: rightIconStyle,
|
|
91
|
+
text: getStyles('text'),
|
|
92
|
+
icon: getStyles('icon'),
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const childrenContent = typeof children === 'function' ?
|
|
97
|
+
children({ styles: _styles, props: buttonProps, pressed })
|
|
98
|
+
: children
|
|
99
|
+
|
|
78
100
|
return (
|
|
79
101
|
<Touchable
|
|
80
|
-
style={
|
|
102
|
+
style={_styles.wrapper}
|
|
81
103
|
onPress={handlePress}
|
|
82
104
|
ref={ref}
|
|
83
105
|
disabled={disabled}
|
|
@@ -85,11 +107,11 @@ export const Button = forwardRef<TouchableOpacity, ButtonProps>((buttonProps, re
|
|
|
85
107
|
{...props}
|
|
86
108
|
>
|
|
87
109
|
|
|
88
|
-
{loading && <ActivityIndicator style={
|
|
89
|
-
{!loading && <Icon name={icon} style={
|
|
90
|
-
{text ? <Text text={text} style={
|
|
91
|
-
{
|
|
92
|
-
<Icon name={rightIcon} style={
|
|
110
|
+
{loading && <ActivityIndicator style={_styles.loader} />}
|
|
111
|
+
{!loading && <Icon name={icon} style={_styles.leftIcon} renderEmptySpace={hasText}/>}
|
|
112
|
+
{text ? <Text text={text} style={_styles.text} /> : null}
|
|
113
|
+
{childrenContent}
|
|
114
|
+
<Icon name={rightIcon} style={_styles.rightIcon} renderEmptySpace={hasText} />
|
|
93
115
|
</Touchable>
|
|
94
116
|
)
|
|
95
117
|
})
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useMemo } from 'react'
|
|
2
|
+
import { Icon } from './Icon'
|
|
3
|
+
import { View } from './View'
|
|
4
|
+
import { Text } from './Text'
|
|
5
|
+
import { ActivityIndicator } from './ActivityIndicator'
|
|
6
|
+
import {
|
|
7
|
+
ComponentVariants,
|
|
8
|
+
EmptyPlaceholderComposition,
|
|
9
|
+
EmptyPlaceholderStyles,
|
|
10
|
+
getNestedStylesByKey,
|
|
11
|
+
IconPlaceholder,
|
|
12
|
+
useDefaultComponentStyle,
|
|
13
|
+
} from '@codeleap/common'
|
|
14
|
+
import { StyleSheet } from 'react-native'
|
|
15
|
+
import { StylesOf } from '../types/utility'
|
|
16
|
+
|
|
17
|
+
export type EmptyPlaceholderProps = {
|
|
18
|
+
itemName?: string
|
|
19
|
+
title?: string
|
|
20
|
+
loading?: boolean
|
|
21
|
+
styles?: StylesOf<EmptyPlaceholderComposition>
|
|
22
|
+
variants?: ComponentVariants<typeof EmptyPlaceholderStyles>['variants']
|
|
23
|
+
emptyIconName?: IconPlaceholder
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const EmptyPlaceholder:React.FC<EmptyPlaceholderProps> = (props: EmptyPlaceholderProps) => {
|
|
27
|
+
const { itemName, title, loading, styles = {}, variants = [], emptyIconName = 'search' } = props
|
|
28
|
+
const emptyText = title || (itemName && `No ${itemName} found.`) || 'No items.'
|
|
29
|
+
|
|
30
|
+
const componentStyles = useDefaultComponentStyle('EmptyPlaceholder', {
|
|
31
|
+
variants,
|
|
32
|
+
transform: StyleSheet.flatten,
|
|
33
|
+
styles,
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const activityIndicatorStyles = useMemo(() => getNestedStylesByKey('loader', componentStyles)
|
|
37
|
+
, [componentStyles])
|
|
38
|
+
|
|
39
|
+
if (loading) {
|
|
40
|
+
return (
|
|
41
|
+
<View style={[componentStyles.wrapper, componentStyles['wrapper:loading']]} >
|
|
42
|
+
<ActivityIndicator styles={activityIndicatorStyles}/>
|
|
43
|
+
</View>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<View style={componentStyles.wrapper}>
|
|
49
|
+
<Icon name={emptyIconName as IconPlaceholder} style={componentStyles.icon}/>
|
|
50
|
+
<Text text={emptyText} style={componentStyles.text}/>
|
|
51
|
+
</View>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useCodeleapContext } from '@codeleap/common'
|
|
3
|
+
import { View, ViewProps } from './View'
|
|
4
|
+
|
|
5
|
+
type GapProps = ViewProps & {
|
|
6
|
+
value: number
|
|
7
|
+
|
|
8
|
+
defaultProps?: any
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Gap:React.FC<GapProps> = ({ children, value, defaultProps = {}, ...props }) => {
|
|
12
|
+
const { Theme } = useCodeleapContext()
|
|
13
|
+
const horizontal = props.variants?.includes('row')
|
|
14
|
+
return (
|
|
15
|
+
<View {...props}>
|
|
16
|
+
{
|
|
17
|
+
React.Children.toArray(children).map((Element, idx, childArr) => {
|
|
18
|
+
if (React.isValidElement(Element)) {
|
|
19
|
+
const props = { ...Element.props, ...defaultProps }
|
|
20
|
+
|
|
21
|
+
let spacingFunction = horizontal ? 'marginHorizontal' : 'marginVertical'
|
|
22
|
+
switch (idx) {
|
|
23
|
+
case 0:
|
|
24
|
+
spacingFunction = horizontal ? 'marginRight' : 'marginBottom'
|
|
25
|
+
break
|
|
26
|
+
case childArr.length - 1:
|
|
27
|
+
spacingFunction = horizontal ? 'marginLeft' : 'marginTop'
|
|
28
|
+
break
|
|
29
|
+
default:
|
|
30
|
+
break
|
|
31
|
+
}
|
|
32
|
+
props.style = [props.style, Theme.spacing[spacingFunction](value / 2)]
|
|
33
|
+
return React.cloneElement(Element, props)
|
|
34
|
+
}
|
|
35
|
+
return Element
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
</View>
|
|
39
|
+
)
|
|
40
|
+
}
|
package/src/components/List.tsx
CHANGED
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
// @ts-ignore
|
|
14
14
|
} from 'react-native-keyboard-aware-scroll-view'
|
|
15
15
|
|
|
16
|
-
import { RefreshControl, FlatList } from 'react-native'
|
|
16
|
+
import { RefreshControl, FlatList, FlatListProps as RNFlatListProps } from 'react-native'
|
|
17
17
|
import { View, ViewProps } from './View'
|
|
18
|
+
import { EmptyPlaceholder, EmptyPlaceholderProps } from './EmptyPlaceholder'
|
|
18
19
|
|
|
19
|
-
type RNFlatListProps<T = any> = FlatList<T>['props']
|
|
20
20
|
export type FlatListProps<T = any> = RNFlatListProps<T> &
|
|
21
21
|
ViewProps & {
|
|
22
22
|
onRefresh?: () => void
|
|
@@ -24,7 +24,9 @@ export type FlatListProps<T = any> = RNFlatListProps<T> &
|
|
|
24
24
|
changeData?: any
|
|
25
25
|
separators?: boolean
|
|
26
26
|
refreshing?: boolean
|
|
27
|
+
placeholder?: EmptyPlaceholderProps
|
|
27
28
|
keyboardAware?: boolean
|
|
29
|
+
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
const KeyboardAwareFlatList =
|
|
@@ -42,6 +44,7 @@ const ListCP = forwardRef<FlatList, FlatListProps>(
|
|
|
42
44
|
style,
|
|
43
45
|
refreshTimeout = 3000,
|
|
44
46
|
changeData,
|
|
47
|
+
placeholder,
|
|
45
48
|
keyboardAware = true,
|
|
46
49
|
...props
|
|
47
50
|
} = flatListProps
|
|
@@ -102,6 +105,7 @@ const ListCP = forwardRef<FlatList, FlatListProps>(
|
|
|
102
105
|
<RefreshControl refreshing={refreshingDisplay} onRefresh={onRefresh} />
|
|
103
106
|
)
|
|
104
107
|
}
|
|
108
|
+
ListEmptyComponent={<EmptyPlaceholder {...placeholder}/>}
|
|
105
109
|
{...props}
|
|
106
110
|
/>
|
|
107
111
|
)
|
|
@@ -109,3 +113,4 @@ const ListCP = forwardRef<FlatList, FlatListProps>(
|
|
|
109
113
|
)
|
|
110
114
|
|
|
111
115
|
export const List = ListCP as (<T = any>(props: FlatListProps<T>) => JSX.Element)
|
|
116
|
+
|
|
@@ -38,6 +38,7 @@ export type ModalProps = Omit<ViewProps, 'variants' | 'styles'> & {
|
|
|
38
38
|
closeIconName?: IconPlaceholder
|
|
39
39
|
visible: boolean
|
|
40
40
|
toggle?: () => void
|
|
41
|
+
zIndex?: number
|
|
41
42
|
scroll?: boolean
|
|
42
43
|
keyboardAware?: boolean
|
|
43
44
|
}
|
|
@@ -58,6 +59,7 @@ export const Modal: React.FC<ModalProps> = (modalProps) => {
|
|
|
58
59
|
debugName,
|
|
59
60
|
scroll = true,
|
|
60
61
|
keyboardAware = true,
|
|
62
|
+
zIndex = null,
|
|
61
63
|
...props
|
|
62
64
|
} = modalProps
|
|
63
65
|
|
|
@@ -100,9 +102,10 @@ export const Modal: React.FC<ModalProps> = (modalProps) => {
|
|
|
100
102
|
},
|
|
101
103
|
}
|
|
102
104
|
|
|
105
|
+
const wrapperStyle = StyleSheet.flatten(getStyles('wrapper'))
|
|
103
106
|
return (
|
|
104
107
|
<View
|
|
105
|
-
style={
|
|
108
|
+
style={[wrapperStyle, { zIndex: typeof zIndex === 'number' ? zIndex : wrapperStyle?.zIndex }]}
|
|
106
109
|
pointerEvents={visible ? 'auto' : 'none'}
|
|
107
110
|
>
|
|
108
111
|
<AnimatedView style={getStyles('overlay')} transition={'opacity'} />
|
|
@@ -24,20 +24,20 @@ import { MobilePagerStyles, PagerComposition } from './styles'
|
|
|
24
24
|
export * from './styles'
|
|
25
25
|
|
|
26
26
|
export type PagerProps = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
variants?: ComponentVariants<typeof MobilePagerStyles>['variants']
|
|
28
|
+
styles?: StylesOf<PagerComposition>
|
|
29
|
+
page?: number
|
|
30
|
+
loop?: boolean
|
|
31
|
+
debug?: boolean
|
|
32
|
+
children?: ReactNode
|
|
33
|
+
onPageChange?: (page: number) => void
|
|
34
|
+
}
|
|
35
35
|
|
|
36
36
|
export type PagerRef = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
forward(by?: number): void
|
|
38
|
+
back(by?: number): void
|
|
39
|
+
to(index?: number): void
|
|
40
|
+
}
|
|
41
41
|
|
|
42
42
|
export const Pager = forwardRef<PagerRef, PagerProps>((pagerProps, ref) => {
|
|
43
43
|
const {
|
|
@@ -148,13 +148,13 @@ export const Pager = forwardRef<PagerRef, PagerProps>((pagerProps, ref) => {
|
|
|
148
148
|
|
|
149
149
|
)
|
|
150
150
|
})
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
151
|
+
type PageProps = PagerProps & {
|
|
152
|
+
idx: number
|
|
153
|
+
lastPage: number
|
|
154
|
+
page: number
|
|
155
|
+
pagePoses: any
|
|
156
|
+
style: any
|
|
157
|
+
}
|
|
158
158
|
const Page: React.FC<PageProps> = (pageProps) => {
|
|
159
159
|
const {
|
|
160
160
|
children: child,
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from '@codeleap/common'
|
|
5
5
|
|
|
6
6
|
export type PagerComposition =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
| 'page'
|
|
8
|
+
| 'page:transition'
|
|
9
|
+
| 'page:pose:previous'
|
|
10
|
+
| 'page:pose:next'
|
|
11
|
+
| 'page:pose:current'
|
|
12
|
+
| 'wrapper'
|
|
13
13
|
|
|
14
14
|
const createPagerStyle = createDefaultVariantFactory<PagerComposition>()
|
|
15
15
|
|
|
@@ -49,4 +49,3 @@ export const MobilePagerStyles = {
|
|
|
49
49
|
}),
|
|
50
50
|
pageless: createPagerStyle(() => ({})),
|
|
51
51
|
}
|
|
52
|
-
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { FormTypes } from '@codeleap/common'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type NativeProps = ComponentPropsWithoutRef<typeof NativeTextInput>
|
|
5
|
-
// @ts-ignore
|
|
2
|
+
import { TextInputProps } from 'react-native'
|
|
3
|
+
|
|
6
4
|
import { TextInputMaskProps as RNTextInputMaskProps } from 'react-native-masked-text'
|
|
7
5
|
|
|
8
|
-
export type TextInputMaskProps = {
|
|
9
|
-
masking: FormTypes.TextField['masking']
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
onChangeText?: (maskedText:string, unmaskedText:string) => any
|
|
13
|
-
} & NativeProps & RNTextInputMaskProps
|
|
6
|
+
export type TextInputMaskProps =Omit<RNTextInputMaskProps, keyof TextInputProps > & {
|
|
7
|
+
masking: FormTypes.TextField['masking']
|
|
8
|
+
onChangeText: RNTextInputMaskProps['onChangeText']
|
|
9
|
+
}
|