@codeleap/mobile 2.3.26 → 2.3.27-1
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/Autocomplete/types.d.ts +59 -0
- package/dist/components/Autocomplete/types.js +3 -0
- package/dist/components/Autocomplete/types.js.map +1 -0
- package/dist/components/Avatar/index.d.ts +23 -0
- package/dist/components/Avatar/index.js +95 -0
- package/dist/components/Avatar/index.js.map +1 -0
- package/dist/components/Avatar/styles.d.ts +4 -0
- package/dist/components/Avatar/styles.js +7 -0
- package/dist/components/Avatar/styles.js.map +1 -0
- package/dist/components/AvatarGroup/index.d.ts +18 -0
- package/dist/components/AvatarGroup/index.js +70 -0
- package/dist/components/AvatarGroup/index.js.map +1 -0
- package/dist/components/AvatarGroup/styles.d.ts +4 -0
- package/dist/components/AvatarGroup/styles.js +7 -0
- package/dist/components/AvatarGroup/styles.js.map +1 -0
- package/dist/components/Badge/index.d.ts +31 -0
- package/dist/components/Badge/index.js +110 -0
- package/dist/components/Badge/index.js.map +1 -0
- package/dist/components/Badge/styles.d.ts +5 -0
- package/dist/components/Badge/styles.js +7 -0
- package/dist/components/Badge/styles.js.map +1 -0
- package/dist/components/DatePickerModal/index.d.ts +8 -0
- package/dist/components/DatePickerModal/index.js +153 -0
- package/dist/components/DatePickerModal/index.js.map +1 -0
- package/dist/components/DatePickerModal/styles.d.ts +5 -0
- package/dist/components/DatePickerModal/styles.js +7 -0
- package/dist/components/DatePickerModal/styles.js.map +1 -0
- package/dist/components/DatePickerModal/types.d.ts +40 -0
- package/dist/components/DatePickerModal/types.js +3 -0
- package/dist/components/DatePickerModal/types.js.map +1 -0
- package/dist/components/InputBase/index.d.ts +37 -0
- package/dist/components/InputBase/index.js +90 -0
- package/dist/components/InputBase/index.js.map +1 -0
- package/dist/components/InputBase/styles.d.ts +27 -0
- package/dist/components/InputBase/styles.js +92 -0
- package/dist/components/InputBase/styles.js.map +1 -0
- package/dist/components/InputBase/types.d.ts +28 -0
- package/dist/components/InputBase/types.js +3 -0
- package/dist/components/InputBase/types.js.map +1 -0
- package/dist/components/InputBase/utils.d.ts +11 -0
- package/dist/components/InputBase/utils.js +41 -0
- package/dist/components/InputBase/utils.js.map +1 -0
- package/dist/components/LoadingOverlay/index.d.ts +11 -0
- package/dist/components/LoadingOverlay/index.js +66 -0
- package/dist/components/LoadingOverlay/index.js.map +1 -0
- package/dist/components/LoadingOverlay/styles.d.ts +5 -0
- package/dist/components/LoadingOverlay/styles.js +7 -0
- package/dist/components/LoadingOverlay/styles.js.map +1 -0
- package/dist/components/NumberIncrement/index.d.ts +31 -0
- package/dist/components/NumberIncrement/index.js +232 -0
- package/dist/components/NumberIncrement/index.js.map +1 -0
- package/dist/components/NumberIncrement/styles.d.ts +5 -0
- package/dist/components/NumberIncrement/styles.js +7 -0
- package/dist/components/NumberIncrement/styles.js.map +1 -0
- package/dist/components/NumberIncrement/types.d.ts +35 -0
- package/dist/components/NumberIncrement/types.js +3 -0
- package/dist/components/NumberIncrement/types.js.map +1 -0
- package/dist/components/NumberIncrement/utils.d.ts +5 -0
- package/dist/components/NumberIncrement/utils.js +27 -0
- package/dist/components/NumberIncrement/utils.js.map +1 -0
- package/dist/components/RefreshControl/index.d.ts +9 -0
- package/dist/components/RefreshControl/index.js +31 -0
- package/dist/components/RefreshControl/index.js.map +1 -0
- package/dist/components/RefreshControl/styles.d.ts +2 -0
- package/dist/components/RefreshControl/styles.js +7 -0
- package/dist/components/RefreshControl/styles.js.map +1 -0
- package/dist/components/Sections/styles.d.ts +2 -0
- package/dist/components/Sections/styles.js +7 -0
- package/dist/components/Sections/styles.js.map +1 -0
- package/dist/components/SegmentedControl/Option.d.ts +16 -0
- package/dist/components/SegmentedControl/Option.js +38 -0
- package/dist/components/SegmentedControl/Option.js.map +1 -0
- package/dist/modules/PressableRipple/index.d.ts +2 -0
- package/dist/modules/PressableRipple/index.js +9 -0
- package/dist/modules/PressableRipple/index.js.map +1 -0
- package/dist/modules/PressableRipple/ripple.d.ts +30 -0
- package/dist/modules/PressableRipple/ripple.js +213 -0
- package/dist/modules/PressableRipple/ripple.js.map +1 -0
- package/dist/modules/PressableRipple/styles.d.ts +19 -0
- package/dist/modules/PressableRipple/styles.js +29 -0
- package/dist/modules/PressableRipple/styles.js.map +1 -0
- package/dist/modules/PressableRipple/type.d.ts +11 -0
- package/dist/modules/PressableRipple/type.js +3 -0
- package/dist/modules/PressableRipple/type.js.map +1 -0
- package/dist/utils/locale.d.ts +1 -0
- package/dist/utils/locale.js +10 -0
- package/dist/utils/locale.js.map +1 -0
- package/package.json +3 -2
- package/src/components/List/index.tsx +9 -2
- package/src/components/Scroll/index.tsx +7 -3
- package/src/utils/hooks.ts +17 -2
- /package/dist/components/{AutoComplete → Autocomplete}/index.d.ts +0 -0
- /package/dist/components/{AutoComplete → Autocomplete}/index.js +0 -0
- /package/dist/components/{AutoComplete → Autocomplete}/index.js.map +0 -0
- /package/dist/components/{AutoComplete → Autocomplete}/styles.d.ts +0 -0
- /package/dist/components/{AutoComplete → Autocomplete}/styles.js +0 -0
- /package/dist/components/{AutoComplete → Autocomplete}/styles.js.map +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PressableRipple = void 0;
|
|
7
|
+
var ripple_1 = __importDefault(require("./ripple"));
|
|
8
|
+
exports.PressableRipple = ripple_1.default;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/PressableRipple/index.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAsC;AAGpC,0BAHK,gBAAe,CAGL"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default class Ripple extends React.PureComponent<any, any, any> {
|
|
2
|
+
static defaultProps: any;
|
|
3
|
+
static propTypes: any;
|
|
4
|
+
constructor(props: any);
|
|
5
|
+
onLayout(event: any): void;
|
|
6
|
+
onPress(event: any): void;
|
|
7
|
+
onPressIn(event: any): void;
|
|
8
|
+
onPressOut(event: any): void;
|
|
9
|
+
onLongPress(event: any): void;
|
|
10
|
+
onAnimationEnd(): void;
|
|
11
|
+
renderRipple({ unique, progress, locationX, locationY, R }: {
|
|
12
|
+
unique: any;
|
|
13
|
+
progress: any;
|
|
14
|
+
locationX: any;
|
|
15
|
+
locationY: any;
|
|
16
|
+
R: any;
|
|
17
|
+
}): JSX.Element;
|
|
18
|
+
unique: number;
|
|
19
|
+
mounted: boolean;
|
|
20
|
+
state: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
ripples: any[];
|
|
24
|
+
};
|
|
25
|
+
componentDidMount(): void;
|
|
26
|
+
componentWillUnmount(): void;
|
|
27
|
+
startRipple(event: any): void;
|
|
28
|
+
render(): JSX.Element;
|
|
29
|
+
}
|
|
30
|
+
import React from 'react';
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(o, k2, desc);
|
|
35
|
+
}) : (function(o, m, k, k2) {
|
|
36
|
+
if (k2 === undefined) k2 = k;
|
|
37
|
+
o[k2] = m[k];
|
|
38
|
+
}));
|
|
39
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
+
}) : function(o, v) {
|
|
42
|
+
o["default"] = v;
|
|
43
|
+
});
|
|
44
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
52
|
+
var t = {};
|
|
53
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
54
|
+
t[p] = s[p];
|
|
55
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
56
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
57
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
58
|
+
t[p[i]] = s[p[i]];
|
|
59
|
+
}
|
|
60
|
+
return t;
|
|
61
|
+
};
|
|
62
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
63
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
64
|
+
};
|
|
65
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
+
var prop_types_1 = __importDefault(require("prop-types"));
|
|
67
|
+
var react_1 = __importStar(require("react"));
|
|
68
|
+
var react_native_1 = require("react-native");
|
|
69
|
+
var styles_js_1 = require("./styles.js");
|
|
70
|
+
var Ripple = /** @class */ (function (_super) {
|
|
71
|
+
__extends(Ripple, _super);
|
|
72
|
+
function Ripple(props) {
|
|
73
|
+
var _this = _super.call(this, props) || this;
|
|
74
|
+
_this.onLayout = _this.onLayout.bind(_this);
|
|
75
|
+
_this.onPress = _this.onPress.bind(_this);
|
|
76
|
+
_this.onPressIn = _this.onPressIn.bind(_this);
|
|
77
|
+
_this.onPressOut = _this.onPressOut.bind(_this);
|
|
78
|
+
_this.onLongPress = _this.onLongPress.bind(_this);
|
|
79
|
+
_this.onAnimationEnd = _this.onAnimationEnd.bind(_this);
|
|
80
|
+
_this.renderRipple = _this.renderRipple.bind(_this);
|
|
81
|
+
_this.unique = 0;
|
|
82
|
+
_this.mounted = false;
|
|
83
|
+
_this.state = {
|
|
84
|
+
width: 0,
|
|
85
|
+
height: 0,
|
|
86
|
+
ripples: [],
|
|
87
|
+
};
|
|
88
|
+
return _this;
|
|
89
|
+
}
|
|
90
|
+
Ripple.prototype.componentDidMount = function () {
|
|
91
|
+
this.mounted = true;
|
|
92
|
+
};
|
|
93
|
+
Ripple.prototype.componentWillUnmount = function () {
|
|
94
|
+
this.mounted = false;
|
|
95
|
+
};
|
|
96
|
+
Ripple.prototype.onLayout = function (event) {
|
|
97
|
+
var _a = event.nativeEvent.layout, width = _a.width, height = _a.height;
|
|
98
|
+
var onLayout = this.props.onLayout;
|
|
99
|
+
if ('function' === typeof onLayout) {
|
|
100
|
+
onLayout(event);
|
|
101
|
+
}
|
|
102
|
+
this.setState({ width: width, height: height });
|
|
103
|
+
};
|
|
104
|
+
Ripple.prototype.onPress = function (event) {
|
|
105
|
+
var onPress = this.props.onPress;
|
|
106
|
+
if ('function' === typeof onPress) {
|
|
107
|
+
onPress(event);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
Ripple.prototype.onLongPress = function (event) {
|
|
111
|
+
var onLongPress = this.props.onLongPress;
|
|
112
|
+
if ('function' === typeof onLongPress) {
|
|
113
|
+
requestAnimationFrame(function () { return onLongPress(event); });
|
|
114
|
+
}
|
|
115
|
+
this.startRipple(event);
|
|
116
|
+
};
|
|
117
|
+
Ripple.prototype.onPressIn = function (event) {
|
|
118
|
+
var onPressIn = this.props.onPressIn;
|
|
119
|
+
if ('function' === typeof onPressIn) {
|
|
120
|
+
onPressIn(event);
|
|
121
|
+
}
|
|
122
|
+
this.startRipple(event);
|
|
123
|
+
};
|
|
124
|
+
Ripple.prototype.onPressOut = function (event) {
|
|
125
|
+
var onPressOut = this.props.onPressOut;
|
|
126
|
+
if ('function' === typeof onPressOut) {
|
|
127
|
+
onPressOut(event);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
Ripple.prototype.onAnimationEnd = function () {
|
|
131
|
+
if (this.mounted) {
|
|
132
|
+
this.setState(function (_a) {
|
|
133
|
+
var ripples = _a.ripples;
|
|
134
|
+
return ({ ripples: ripples.slice(1) });
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
Ripple.prototype.startRipple = function (event) {
|
|
139
|
+
var _a = this.state, width = _a.width, height = _a.height;
|
|
140
|
+
var _b = this.props, rippleDuration = _b.rippleDuration, rippleCentered = _b.rippleCentered, rippleSize = _b.rippleSize, onRippleAnimation = _b.onRippleAnimation;
|
|
141
|
+
var w2 = 0.5 * width;
|
|
142
|
+
var h2 = 0.5 * height;
|
|
143
|
+
var _c = rippleCentered ?
|
|
144
|
+
{ locationX: w2, locationY: h2 } :
|
|
145
|
+
event.nativeEvent, locationX = _c.locationX, locationY = _c.locationY;
|
|
146
|
+
var offsetX = Math.abs(w2 - locationX);
|
|
147
|
+
var offsetY = Math.abs(h2 - locationY);
|
|
148
|
+
var R = rippleSize > 0 ?
|
|
149
|
+
0.5 * rippleSize :
|
|
150
|
+
Math.sqrt(Math.pow(w2 + offsetX, 2) + Math.pow(h2 + offsetY, 2));
|
|
151
|
+
var ripple = {
|
|
152
|
+
unique: this.unique++,
|
|
153
|
+
progress: new react_native_1.Animated.Value(0),
|
|
154
|
+
locationX: locationX,
|
|
155
|
+
locationY: locationY,
|
|
156
|
+
R: R,
|
|
157
|
+
};
|
|
158
|
+
var animation = react_native_1.Animated
|
|
159
|
+
.timing(ripple.progress, {
|
|
160
|
+
toValue: 1,
|
|
161
|
+
easing: react_native_1.Easing.out(react_native_1.Easing.ease),
|
|
162
|
+
duration: rippleDuration,
|
|
163
|
+
useNativeDriver: true,
|
|
164
|
+
});
|
|
165
|
+
onRippleAnimation(animation, this.onAnimationEnd);
|
|
166
|
+
this.setState(function (_a) {
|
|
167
|
+
var ripples = _a.ripples;
|
|
168
|
+
return ({ ripples: ripples.concat(ripple) });
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
Ripple.prototype.renderRipple = function (_a) {
|
|
172
|
+
var _b;
|
|
173
|
+
var unique = _a.unique, progress = _a.progress, locationX = _a.locationX, locationY = _a.locationY, R = _a.R;
|
|
174
|
+
var _c = this.props, rippleColor = _c.rippleColor, rippleOpacity = _c.rippleOpacity, rippleFades = _c.rippleFades;
|
|
175
|
+
var rippleStyle = (_b = {
|
|
176
|
+
top: locationY - styles_js_1.radius
|
|
177
|
+
},
|
|
178
|
+
_b[react_native_1.I18nManager.isRTL ? 'right' : 'left'] = locationX - styles_js_1.radius,
|
|
179
|
+
_b.backgroundColor = rippleColor,
|
|
180
|
+
_b.transform = [{
|
|
181
|
+
scale: progress.interpolate({
|
|
182
|
+
inputRange: [0, 1],
|
|
183
|
+
outputRange: [0.5 / styles_js_1.radius, R / styles_js_1.radius],
|
|
184
|
+
}),
|
|
185
|
+
}],
|
|
186
|
+
_b.opacity = rippleFades ?
|
|
187
|
+
progress.interpolate({
|
|
188
|
+
inputRange: [0, 1],
|
|
189
|
+
outputRange: [rippleOpacity, 0],
|
|
190
|
+
}) :
|
|
191
|
+
rippleOpacity,
|
|
192
|
+
_b);
|
|
193
|
+
return (<react_native_1.Animated.View style={[styles_js_1.styles.ripple, rippleStyle]} key={unique}/>);
|
|
194
|
+
};
|
|
195
|
+
Ripple.prototype.render = function () {
|
|
196
|
+
var ripples = this.state.ripples;
|
|
197
|
+
var _a = this.props, delayLongPress = _a.delayLongPress, delayPressIn = _a.delayPressIn, delayPressOut = _a.delayPressOut, disabled = _a.disabled, hitSlop = _a.hitSlop, pressRetentionOffset = _a.pressRetentionOffset, children = _a.children, rippleContainerBorderRadius = _a.rippleContainerBorderRadius, testID = _a.testID, nativeID = _a.nativeID, accessible = _a.accessible, accessibilityHint = _a.accessibilityHint, accessibilityLabel = _a.accessibilityLabel, onPress = _a.onPress, onLongPress = _a.onLongPress, onLayout = _a.onLayout, onRippleAnimation = _a.onRippleAnimation, rippleColor = _a.rippleColor, rippleOpacity = _a.rippleOpacity, rippleDuration = _a.rippleDuration, rippleSize = _a.rippleSize, rippleCentered = _a.rippleCentered, rippleSequential = _a.rippleSequential, rippleFades = _a.rippleFades, ref = _a.ref, radiusStyles = _a.radiusStyles, props = __rest(_a, ["delayLongPress", "delayPressIn", "delayPressOut", "disabled", "hitSlop", "pressRetentionOffset", "children", "rippleContainerBorderRadius", "testID", "nativeID", "accessible", "accessibilityHint", "accessibilityLabel", "onPress", "onLongPress", "onLayout", "onRippleAnimation", "rippleColor", "rippleOpacity", "rippleDuration", "rippleSize", "rippleCentered", "rippleSequential", "rippleFades", "ref", "radiusStyles"]);
|
|
198
|
+
var touchableProps = __assign({ disabled: disabled, hitSlop: hitSlop, pressRetentionOffset: pressRetentionOffset, testID: testID, accessible: accessible, accessibilityHint: accessibilityHint, accessibilityLabel: accessibilityLabel, onLayout: this.onLayout, onPress: this.onPress, onPressIn: this.onPressIn, onPressOut: this.onPressOut, onLongPress: onLongPress ? this.onLongPress : undefined }, ('web' !== react_native_1.Platform.OS ? { nativeID: nativeID } : null));
|
|
199
|
+
return (<react_native_1.TouchableWithoutFeedback {...touchableProps} ref={ref}>
|
|
200
|
+
<react_native_1.Animated.View {...props} pointerEvents='box-only'>
|
|
201
|
+
{children}
|
|
202
|
+
<react_native_1.View style={[styles_js_1.styles.container, radiusStyles]}>
|
|
203
|
+
{ripples.map(this.renderRipple)}
|
|
204
|
+
</react_native_1.View>
|
|
205
|
+
</react_native_1.Animated.View>
|
|
206
|
+
</react_native_1.TouchableWithoutFeedback>);
|
|
207
|
+
};
|
|
208
|
+
Ripple.defaultProps = __assign(__assign({}, react_native_1.TouchableWithoutFeedback.defaultProps), { rippleColor: 'rgb(0, 0, 0)', rippleOpacity: 0.30, rippleDuration: 400, rippleSize: 0, rippleContainerBorderRadius: 0, rippleCentered: false, rippleSequential: false, rippleFades: true, disabled: false, onRippleAnimation: function (animation, callback) { return animation.start(callback); } });
|
|
209
|
+
Ripple.propTypes = __assign(__assign(__assign({}, react_native_1.Animated.View.propTypes), react_native_1.TouchableWithoutFeedback.propTypes), { rippleColor: prop_types_1.default.string, rippleOpacity: prop_types_1.default.number, rippleDuration: prop_types_1.default.number, rippleSize: prop_types_1.default.number, rippleContainerBorderRadius: prop_types_1.default.number, rippleCentered: prop_types_1.default.bool, rippleSequential: prop_types_1.default.bool, rippleFades: prop_types_1.default.bool, disabled: prop_types_1.default.bool, onRippleAnimation: prop_types_1.default.func });
|
|
210
|
+
return Ripple;
|
|
211
|
+
}(react_1.PureComponent));
|
|
212
|
+
exports.default = Ripple;
|
|
213
|
+
//# sourceMappingURL=ripple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ripple.js","sourceRoot":"","sources":["../../../src/modules/PressableRipple/ripple.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAmC;AACnC,6CAA6C;AAC7C,6CAAuG;AACvG,yCAA6C;AAE7C;IAAoC,0BAAa;IAkC/C,gBAAY,KAAK;QAAjB,YACE,kBAAM,KAAK,CAAC,SAmBb;QAjBC,KAAI,CAAC,QAAQ,GAAG,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QACzC,KAAI,CAAC,OAAO,GAAG,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QACvC,KAAI,CAAC,SAAS,GAAG,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QAC3C,KAAI,CAAC,UAAU,GAAG,KAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QAC7C,KAAI,CAAC,WAAW,GAAG,KAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QAC/C,KAAI,CAAC,cAAc,GAAG,KAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QAErD,KAAI,CAAC,YAAY,GAAG,KAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QAEjD,KAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,KAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QAErB,KAAI,CAAC,KAAK,GAAG;YACX,KAAK,EAAE,CAAC;Y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ACrB,gBAAgB,EAAE,KAAK,EACvB,WAAW,EAAE,IAAI,EACjB,QAAQ,EAAE,KAAK,EAEf,iBAAiB,EAAE,UAAC,SAAS,EAAE,QAAQ,IAAK,OAAA,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAzB,CAAyB,IACrE;IAEK,gBAAS,kCACX,uBAAQ,CAAC,IAAI,CAAC,SAAS,GACvB,uCAAwB,CAAC,SAAS,KAErC,WAAW,EAAE,oBAAS,CAAC,MAAM,EAC7B,aAAa,EAAE,oBAAS,CAAC,MAAM,EAC/B,cAAc,EAAE,oBAAS,CAAC,MAAM,EAChC,UAAU,EAAE,oBAAS,CAAC,MAAM,EAC5B,2BAA2B,EAAE,oBAAS,CAAC,MAAM,EAC7C,cAAc,EAAE,oBAAS,CAAC,IAAI,EAC9B,gBAAgB,EAAE,oBAAS,CAAC,IAAI,EAChC,WAAW,EAAE,oBAAS,CAAC,IAAI,EAC3B,QAAQ,EAAE,oBAAS,CAAC,IAAI,EAExB,iBAAiB,EAAE,oBAAS,CAAC,IAAI,IACjC;IA4NJ,aAAC;CAAA,AA5PD,CAAoC,qBAAa,GA4PhD;kBA5PoB,MAAM"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export namespace styles {
|
|
2
|
+
const container: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
overflow: "hidden";
|
|
5
|
+
position: "absolute";
|
|
6
|
+
left: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
top: 0;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
};
|
|
11
|
+
namespace ripple {
|
|
12
|
+
export const width: number;
|
|
13
|
+
export const height: number;
|
|
14
|
+
export { radius as borderRadius };
|
|
15
|
+
export const overflow: "hidden";
|
|
16
|
+
export const position: "absolute";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export const radius: 10;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.radius = exports.styles = void 0;
|
|
15
|
+
var react_native_1 = require("react-native");
|
|
16
|
+
var radius = 10;
|
|
17
|
+
exports.radius = radius;
|
|
18
|
+
var styles = react_native_1.StyleSheet.create({
|
|
19
|
+
container: __assign(__assign({}, react_native_1.StyleSheet.absoluteFillObject), { backgroundColor: 'transparent', overflow: 'hidden' }),
|
|
20
|
+
ripple: {
|
|
21
|
+
width: radius * 2,
|
|
22
|
+
height: radius * 2,
|
|
23
|
+
borderRadius: radius,
|
|
24
|
+
overflow: 'hidden',
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
exports.styles = styles;
|
|
29
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/modules/PressableRipple/styles.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAAyC;AAEzC,IAAM,MAAM,GAAG,EAAE,CAAA;AAmBA,wBAAM;AAjBvB,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,wBACJ,yBAAU,CAAC,kBAAkB,KAEhC,eAAe,EAAE,aAAa,EAC9B,QAAQ,EAAE,QAAQ,GACnB;IAED,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,GAAG,CAAC;QACjB,MAAM,EAAE,MAAM,GAAG,CAAC;QAClB,YAAY,EAAE,MAAM;QACpB,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC,CAAA;AAEO,wBAAM"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
export type PressableRippleProps = {
|
|
3
|
+
rippleColor?: string;
|
|
4
|
+
rippleOpacity?: number;
|
|
5
|
+
rippleDuration?: number;
|
|
6
|
+
rippleSize?: number;
|
|
7
|
+
rippleCentered?: boolean;
|
|
8
|
+
rippleSequential?: boolean;
|
|
9
|
+
rippleFades?: boolean;
|
|
10
|
+
onRippleAnimation?: (animation: Animated.CompositeAnimation, callback: () => void) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/modules/PressableRipple/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getDeviceLocale: () => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDeviceLocale = void 0;
|
|
4
|
+
var react_native_1 = require("react-native");
|
|
5
|
+
var getDeviceLocale = function () { return react_native_1.Platform.OS === 'ios'
|
|
6
|
+
? react_native_1.NativeModules.SettingsManager.settings.AppleLocale ||
|
|
7
|
+
react_native_1.NativeModules.SettingsManager.settings.AppleLanguages[0]
|
|
8
|
+
: react_native_1.NativeModules.I18nManager.localeIdentifier; };
|
|
9
|
+
exports.getDeviceLocale = getDeviceLocale;
|
|
10
|
+
//# sourceMappingURL=locale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/utils/locale.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAE/C,IAAM,eAAe,GAAG,cAAc,OAAA,uBAAQ,CAAC,EAAE,KAAK,KAAK;IAChE,CAAC,CAAC,4BAAa,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW;QAChD,4BAAa,CAAC,eAAe,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,4BAAa,CAAC,WAAW,CAAC,gBAAgB,EAHD,CAGC,CAAA;AAHjC,QAAA,eAAe,mBAGkB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeleap/mobile",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.27-1",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
40
40
|
"react-native-text-input-mask": "3.1.4",
|
|
41
41
|
"@react-native-community/async-storage": "*",
|
|
42
|
-
"react-native-device-info": "^10.3.0"
|
|
42
|
+
"react-native-device-info": "^10.3.0",
|
|
43
|
+
"react-native-avoid-softinput": "^3.1.5"
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
46
|
"@gorhom/portal": "^1.0.13",
|
|
@@ -13,7 +13,7 @@ import { View, ViewProps } from '../View'
|
|
|
13
13
|
import { EmptyPlaceholder, EmptyPlaceholderProps } from '../EmptyPlaceholder'
|
|
14
14
|
import { ListComposition, ListStyles } from './styles'
|
|
15
15
|
import { StylesOf } from '../../types'
|
|
16
|
-
import { GetKeyboardAwarePropsOptions, useKeyboardAwareView } from '../../utils'
|
|
16
|
+
import { GetKeyboardAwarePropsOptions, useKeyboardAwareView, useKeyboardPaddingStyle } from '../../utils'
|
|
17
17
|
|
|
18
18
|
export type DataboundFlatListPropsTypes = 'data' | 'renderItem' | 'keyExtractor' | 'getItemLayout'
|
|
19
19
|
|
|
@@ -55,6 +55,7 @@ const ListCP = forwardRef<FlatList, FlatListProps>(
|
|
|
55
55
|
placeholder,
|
|
56
56
|
keyboardAware,
|
|
57
57
|
refreshControlProps = {},
|
|
58
|
+
contentContainerStyle,
|
|
58
59
|
...props
|
|
59
60
|
} = flatListProps
|
|
60
61
|
|
|
@@ -77,9 +78,15 @@ const ListCP = forwardRef<FlatList, FlatListProps>(
|
|
|
77
78
|
const Component:any = component || FlatList
|
|
78
79
|
const refreshStyles = StyleSheet.flatten([variantStyles.refreshControl, styles.refreshControl])
|
|
79
80
|
|
|
81
|
+
const keyboardStyle = useKeyboardPaddingStyle([
|
|
82
|
+
variantStyles.content,
|
|
83
|
+
contentContainerStyle,
|
|
84
|
+
isEmpty && variantStyles['content:empty'],
|
|
85
|
+
], keyboardAware && !props.horizontal)
|
|
86
|
+
|
|
80
87
|
const _listProps = {
|
|
81
88
|
style: [variantStyles.wrapper, style],
|
|
82
|
-
contentContainerStyle:
|
|
89
|
+
contentContainerStyle: keyboardStyle,
|
|
83
90
|
ref: ref as unknown as FlatList,
|
|
84
91
|
ItemSeparatorComponent: separator,
|
|
85
92
|
refreshControl: !!onRefresh && (
|
|
@@ -12,7 +12,7 @@ import { ViewProps } from '../View'
|
|
|
12
12
|
import { KeyboardAwareScrollViewTypes } from '../../modules'
|
|
13
13
|
import { StylesOf } from '../../types'
|
|
14
14
|
import { ScrollComposition, ScrollStyles } from './styles'
|
|
15
|
-
import { GetKeyboardAwarePropsOptions, useKeyboardAwareView } from '../../utils'
|
|
15
|
+
import { GetKeyboardAwarePropsOptions, useKeyboardAwareView, useKeyboardPaddingStyle } from '../../utils'
|
|
16
16
|
import { ScrollView as MotiScrollView } from 'moti'
|
|
17
17
|
// import { KeyboardAwareScrollView } from '../../utils'
|
|
18
18
|
|
|
@@ -85,7 +85,6 @@ export const Scroll = forwardRef<ScrollView, ScrollProps>(
|
|
|
85
85
|
const refreshStyles = StyleSheet.flatten([variantStyles.refreshControl, styles.refreshControl])
|
|
86
86
|
const _scrollProps = {
|
|
87
87
|
style: [variantStyles.wrapper, style],
|
|
88
|
-
contentContainerStyle: [variantStyles.content, contentContainerStyle],
|
|
89
88
|
ref: ref as unknown as ScrollView,
|
|
90
89
|
refreshControl: hasRefresh && (
|
|
91
90
|
<RefreshControl
|
|
@@ -109,12 +108,17 @@ export const Scroll = forwardRef<ScrollView, ScrollProps>(
|
|
|
109
108
|
...keyboardAware,
|
|
110
109
|
|
|
111
110
|
})
|
|
111
|
+
|
|
112
112
|
const Component = animated ? MotiScrollView : ScrollView
|
|
113
|
+
const keyboardStyle = useKeyboardPaddingStyle(
|
|
114
|
+
[variantStyles.content, contentContainerStyle],
|
|
115
|
+
keyboardAware?.enabled,
|
|
116
|
+
)
|
|
113
117
|
|
|
114
118
|
return (
|
|
115
119
|
<Component
|
|
116
120
|
{...rootProps}
|
|
117
|
-
|
|
121
|
+
contentContainerStyle={keyboardStyle}
|
|
118
122
|
>
|
|
119
123
|
{children}
|
|
120
124
|
</Component>
|
package/src/utils/hooks.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { onMount, onUpdate, shadeColor, TypeGuards, usePrevious, useRef, useState } from '@codeleap/common'
|
|
2
|
-
import { Animated, AppState, AppStateStatus, Platform, PressableAndroidRippleConfig, BackHandler } from 'react-native'
|
|
1
|
+
import { onMount, onUpdate, shadeColor, TypeGuards, useMemo, usePrevious, useRef, useState } from '@codeleap/common'
|
|
2
|
+
import { Animated, AppState, AppStateStatus, Platform, PressableAndroidRippleConfig, BackHandler, StyleSheet } from 'react-native'
|
|
3
3
|
// @ts-ignore
|
|
4
4
|
import AsyncStorage from '@react-native-community/async-storage'
|
|
5
|
+
import { useSoftInputState } from 'react-native-avoid-softinput'
|
|
6
|
+
import { ViewStyle } from 'react-native'
|
|
5
7
|
|
|
6
8
|
export function useAnimateColor(value: string, opts?: Partial<Animated.TimingAnimationConfig>) {
|
|
7
9
|
const iters = useRef(0)
|
|
@@ -211,3 +213,16 @@ export function useAsyncStorageState<T>(key:string, defaultValue?: T) {
|
|
|
211
213
|
return [value, setValue] as [T, typeof setValue]
|
|
212
214
|
}
|
|
213
215
|
|
|
216
|
+
export function useKeyboardPaddingStyle(styles: ViewStyle[], enabled = true) {
|
|
217
|
+
const { isSoftInputShown, softInputHeight } = useSoftInputState()
|
|
218
|
+
|
|
219
|
+
const propStyle = useMemo(() => {
|
|
220
|
+
return StyleSheet.flatten(styles)
|
|
221
|
+
}, styles)
|
|
222
|
+
|
|
223
|
+
const bottomPadding = propStyle && TypeGuards.isNumber(propStyle.paddingBottom) ? propStyle.paddingBottom : 0
|
|
224
|
+
|
|
225
|
+
const totalPadding = softInputHeight + bottomPadding
|
|
226
|
+
|
|
227
|
+
return isSoftInputShown && enabled ? [propStyle, { paddingBottom: totalPadding }] : [propStyle]
|
|
228
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|