@draftbit/core 46.10.3-6f5759.2 → 46.10.3-e89832.2
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/lib/commonjs/components/AnimatedCircularProgress.js +12 -1
- package/lib/commonjs/components/AvatarEdit.js +15 -4
- package/lib/commonjs/components/Banner.js +23 -4
- package/lib/commonjs/components/Button.js +33 -10
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +23 -5
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
- package/lib/commonjs/components/Container.js +15 -4
- package/lib/commonjs/components/DeprecatedButton.js +20 -3
- package/lib/commonjs/components/Divider.js +14 -1
- package/lib/commonjs/components/FieldSearchBarFull.js +1 -2
- package/lib/commonjs/components/Layout.js +40 -19
- package/lib/commonjs/components/NumberInput.js +12 -3
- package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
- package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
- package/lib/commonjs/components/Portal/PortalManager.js +34 -8
- package/lib/commonjs/components/RadioButton/RadioButton.js +13 -2
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +9 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +15 -2
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +23 -5
- package/lib/commonjs/components/Row.js +73 -0
- package/lib/commonjs/components/RowBodyIcon.js +45 -0
- package/lib/commonjs/components/RowHeadlineImageCaption.js +45 -0
- package/lib/commonjs/components/RowHeadlineImageIcon.js +51 -0
- package/lib/commonjs/components/ScreenContainer.js +24 -6
- package/lib/commonjs/components/Shadow.js +15 -2
- package/lib/commonjs/components/Slider.js +21 -4
- package/lib/commonjs/components/StarRating.js +23 -4
- package/lib/commonjs/components/StepIndicator.js +57 -18
- package/lib/commonjs/components/Surface.js +14 -2
- package/lib/commonjs/components/Text.js +50 -4
- package/lib/commonjs/components/TextField.js +76 -28
- package/lib/commonjs/components/ToggleButton.js +15 -2
- package/lib/commonjs/components/Touchable.js +15 -2
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +21 -0
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/commonjs/utilities.js +1 -2
- package/lib/module/components/Row.js +63 -0
- package/lib/module/components/RowBodyIcon.js +35 -0
- package/lib/module/components/RowHeadlineImageCaption.js +35 -0
- package/lib/module/components/RowHeadlineImageIcon.js +41 -0
- package/lib/module/index.js +3 -0
- package/lib/typescript/src/components/Row.d.ts +21 -0
- package/lib/typescript/src/components/Row.d.ts.map +1 -0
- package/lib/typescript/src/components/RowBodyIcon.d.ts +16 -0
- package/lib/typescript/src/components/RowBodyIcon.d.ts.map +1 -0
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts +16 -0
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts.map +1 -0
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts +18 -0
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Row.js +48 -0
- package/src/components/Row.tsx +108 -0
- package/src/components/RowBodyIcon.js +8 -0
- package/src/components/RowBodyIcon.tsx +47 -0
- package/src/components/RowHeadlineImageCaption.js +12 -0
- package/src/components/RowHeadlineImageCaption.tsx +49 -0
- package/src/components/RowHeadlineImageIcon.js +14 -0
- package/src/components/RowHeadlineImageIcon.tsx +61 -0
- package/src/index.js +3 -0
- package/src/index.tsx +3 -0
- package/lib/commonjs/mappings/NativeBase/Layout.js +0 -107
- package/lib/module/mappings/NativeBase/Layout.js +0 -100
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +0 -117
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +0 -1
- package/src/mappings/NativeBase/Layout.js +0 -112
- package/src/mappings/NativeBase/Layout.ts +0 -133
|
@@ -13,7 +13,6 @@ var _theming = require("../theming");
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
16
|
function maybeParseValue(value) {
|
|
18
17
|
if (value === undefined) {
|
|
19
18
|
return undefined;
|
|
@@ -73,9 +72,10 @@ function Slider(_ref) {
|
|
|
73
72
|
setInternalValue(newValue);
|
|
74
73
|
onValueChange(newValue);
|
|
75
74
|
};
|
|
76
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
77
|
-
style: [styles.container, style]
|
|
78
|
-
|
|
75
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
76
|
+
style: [styles.container, style],
|
|
77
|
+
...rest
|
|
78
|
+
}, leftIcon ? /*#__PURE__*/React.createElement(Icon, {
|
|
79
79
|
color: leftIconThemeColor,
|
|
80
80
|
name: leftIcon,
|
|
81
81
|
size: 24
|
|
@@ -108,4 +108,21 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
var _default = (0, _theming.withTheme)(Slider);
|
|
111
|
+
exports.default = _default;or: rightIconThemeColor,
|
|
112
|
+
name: rightIcon,
|
|
113
|
+
size: 24
|
|
114
|
+
}) : null);
|
|
115
|
+
}
|
|
116
|
+
const styles = _reactNative.StyleSheet.create({
|
|
117
|
+
container: {
|
|
118
|
+
height: 40,
|
|
119
|
+
flexDirection: "row",
|
|
120
|
+
alignItems: "center"
|
|
121
|
+
},
|
|
122
|
+
slider: {
|
|
123
|
+
flex: 1,
|
|
124
|
+
marginHorizontal: 12
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
var _default = (0, _theming.withTheme)(Slider);
|
|
111
128
|
exports.default = _default;
|
|
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _theming = require("../theming");
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
12
|
const StarRating = _ref => {
|
|
14
13
|
let {
|
|
15
14
|
Icon,
|
|
@@ -40,9 +39,10 @@ const StarRating = _ref => {
|
|
|
40
39
|
!!onPress && onPress(r);
|
|
41
40
|
}, [onPress]);
|
|
42
41
|
const ratingRounded = Math.round(localRating * 2) / 2;
|
|
43
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
44
|
-
style: [styles.container, style]
|
|
45
|
-
|
|
42
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
43
|
+
style: [styles.container, style],
|
|
44
|
+
...rest
|
|
45
|
+
}, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
46
46
|
key: i,
|
|
47
47
|
style: {
|
|
48
48
|
display: "flex"
|
|
@@ -83,4 +83,23 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
var _default = (0, _theming.withTheme)(StarRating);
|
|
86
|
+
exports.default = _default;lignItems: "center"
|
|
87
|
+
},
|
|
88
|
+
touchContainer: {
|
|
89
|
+
display: "flex",
|
|
90
|
+
flexDirection: "row",
|
|
91
|
+
position: "absolute",
|
|
92
|
+
top: 0,
|
|
93
|
+
right: 0,
|
|
94
|
+
left: 0,
|
|
95
|
+
bottom: 0,
|
|
96
|
+
zIndex: 1
|
|
97
|
+
},
|
|
98
|
+
pressable: {
|
|
99
|
+
flex: 1,
|
|
100
|
+
height: "100%",
|
|
101
|
+
width: "50%"
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
var _default = (0, _theming.withTheme)(StarRating);
|
|
86
105
|
exports.default = _default;
|
|
@@ -8,9 +8,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
// @ts-nocheck
|
|
12
|
+
|
|
14
13
|
const STEP_STATUS = {
|
|
15
14
|
CURRENT: "current",
|
|
16
15
|
FINISHED: "finished",
|
|
@@ -19,7 +18,7 @@ const STEP_STATUS = {
|
|
|
19
18
|
class StepIndicator extends _react.Component {
|
|
20
19
|
constructor(props) {
|
|
21
20
|
super(props);
|
|
22
|
-
|
|
21
|
+
this.renderProgressBarBackground = () => {
|
|
23
22
|
const {
|
|
24
23
|
stepCount,
|
|
25
24
|
direction
|
|
@@ -62,8 +61,8 @@ class StepIndicator extends _react.Component {
|
|
|
62
61
|
},
|
|
63
62
|
style: progressBarBackgroundStyle
|
|
64
63
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
64
|
+
};
|
|
65
|
+
this.renderProgressBar = () => {
|
|
67
66
|
const {
|
|
68
67
|
stepCount,
|
|
69
68
|
direction
|
|
@@ -93,8 +92,8 @@ class StepIndicator extends _react.Component {
|
|
|
93
92
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
94
93
|
style: progressBarStyle
|
|
95
94
|
});
|
|
96
|
-
}
|
|
97
|
-
|
|
95
|
+
};
|
|
96
|
+
this.renderStepIndicator = () => {
|
|
98
97
|
let steps = [];
|
|
99
98
|
const {
|
|
100
99
|
stepCount,
|
|
@@ -125,8 +124,8 @@ class StepIndicator extends _react.Component {
|
|
|
125
124
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
126
125
|
}]
|
|
127
126
|
}, steps);
|
|
128
|
-
}
|
|
129
|
-
|
|
127
|
+
};
|
|
128
|
+
this.renderStepLabels = () => {
|
|
130
129
|
const {
|
|
131
130
|
labels,
|
|
132
131
|
direction,
|
|
@@ -168,8 +167,8 @@ class StepIndicator extends _react.Component {
|
|
|
168
167
|
alignItems: this.state.customStyles.labelAlign
|
|
169
168
|
}]
|
|
170
169
|
}, labelViews);
|
|
171
|
-
}
|
|
172
|
-
|
|
170
|
+
};
|
|
171
|
+
this.renderStep = position => {
|
|
173
172
|
const {
|
|
174
173
|
renderStepIndicator
|
|
175
174
|
} = this.props;
|
|
@@ -236,8 +235,8 @@ class StepIndicator extends _react.Component {
|
|
|
236
235
|
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
237
236
|
style: indicatorLabelStyle
|
|
238
237
|
}, "".concat(position + 1)));
|
|
239
|
-
}
|
|
240
|
-
|
|
238
|
+
};
|
|
239
|
+
this.getStepStatus = stepPosition => {
|
|
241
240
|
const {
|
|
242
241
|
currentPosition
|
|
243
242
|
} = this.props;
|
|
@@ -248,8 +247,8 @@ class StepIndicator extends _react.Component {
|
|
|
248
247
|
} else {
|
|
249
248
|
return STEP_STATUS.UNFINISHED;
|
|
250
249
|
}
|
|
251
|
-
}
|
|
252
|
-
|
|
250
|
+
};
|
|
251
|
+
this.onCurrentPositionChanged = position => {
|
|
253
252
|
let {
|
|
254
253
|
stepCount
|
|
255
254
|
} = this.props;
|
|
@@ -269,7 +268,7 @@ class StepIndicator extends _react.Component {
|
|
|
269
268
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
270
269
|
duration: 100
|
|
271
270
|
})])]).start();
|
|
272
|
-
}
|
|
271
|
+
};
|
|
273
272
|
const defaultStyles = {
|
|
274
273
|
stepIndicatorSize: 30,
|
|
275
274
|
currentStepIndicatorSize: 40,
|
|
@@ -335,7 +334,6 @@ class StepIndicator extends _react.Component {
|
|
|
335
334
|
// ),
|
|
336
335
|
// }));
|
|
337
336
|
// }
|
|
338
|
-
|
|
339
337
|
if (prevProps.currentPosition !== this.props.currentPosition) {
|
|
340
338
|
this.onCurrentPositionChanged(this.props.currentPosition);
|
|
341
339
|
}
|
|
@@ -377,6 +375,47 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
377
375
|
justifyContent: "center"
|
|
378
376
|
}
|
|
379
377
|
});
|
|
378
|
+
StepIndicator.defaultProps = {
|
|
379
|
+
currentPosition: 0,
|
|
380
|
+
stepCount: 5,
|
|
381
|
+
customStyles: {},
|
|
382
|
+
direction: "horizontal"
|
|
383
|
+
};exports.default = StepIndicator;
|
|
384
|
+
const styles = _reactNative.StyleSheet.create({
|
|
385
|
+
container: {
|
|
386
|
+
backgroundColor: "transparent"
|
|
387
|
+
},
|
|
388
|
+
stepIndicatorContainer: {
|
|
389
|
+
flexDirection: "row",
|
|
390
|
+
alignItems: "center",
|
|
391
|
+
justifyContent: "space-around",
|
|
392
|
+
backgroundColor: "transparent"
|
|
393
|
+
},
|
|
394
|
+
stepLabelsContainer: {
|
|
395
|
+
justifyContent: "space-around"
|
|
396
|
+
},
|
|
397
|
+
step: {
|
|
398
|
+
alignItems: "center",
|
|
399
|
+
justifyContent: "center",
|
|
400
|
+
zIndex: 2
|
|
401
|
+
},
|
|
402
|
+
stepContainer: {
|
|
403
|
+
flex: 1,
|
|
404
|
+
flexDirection: "row",
|
|
405
|
+
alignItems: "center",
|
|
406
|
+
justifyContent: "center"
|
|
407
|
+
},
|
|
408
|
+
stepLabel: {
|
|
409
|
+
fontSize: 12,
|
|
410
|
+
textAlign: "center",
|
|
411
|
+
fontWeight: "500"
|
|
412
|
+
},
|
|
413
|
+
stepLabelItem: {
|
|
414
|
+
flex: 1,
|
|
415
|
+
alignItems: "center",
|
|
416
|
+
justifyContent: "center"
|
|
417
|
+
}
|
|
418
|
+
});
|
|
380
419
|
StepIndicator.defaultProps = {
|
|
381
420
|
currentPosition: 0,
|
|
382
421
|
stepCount: 5,
|
|
@@ -12,7 +12,8 @@ var _theming = require("../theming");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
|
|
15
|
+
/* Copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx */
|
|
16
|
+
|
|
16
17
|
const Surface = _ref => {
|
|
17
18
|
let {
|
|
18
19
|
elevation: propElevation,
|
|
@@ -42,7 +43,18 @@ const Surface = _ref => {
|
|
|
42
43
|
return colors.surface;
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
|
-
return /*#__PURE__*/React.createElement(_reactNative.Animated.View,
|
|
46
|
+
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
|
|
47
|
+
...rest,
|
|
48
|
+
style: [{
|
|
49
|
+
backgroundColor: getBackgroundColor(),
|
|
50
|
+
elevation,
|
|
51
|
+
...evalationStyles,
|
|
52
|
+
...restStyle
|
|
53
|
+
}]
|
|
54
|
+
}, children);
|
|
55
|
+
};
|
|
56
|
+
var _default = (0, _theming.withTheme)(Surface);
|
|
57
|
+
exports.default = _default;xtends({}, rest, {
|
|
46
58
|
style: [{
|
|
47
59
|
backgroundColor: getBackgroundColor(),
|
|
48
60
|
elevation,
|
|
@@ -9,10 +9,56 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _theming = require("../theming");
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
class Text extends React.Component {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.state = {
|
|
16
|
+
nativeProps: {}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
setNativeProps(args) {
|
|
20
|
+
this.state.nativeProps = args || {};
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const {
|
|
24
|
+
style,
|
|
25
|
+
...rest
|
|
26
|
+
} = this.props;
|
|
27
|
+
const writingDirection = _reactNative.I18nManager.isRTL ? "rtl" : "ltr";
|
|
28
|
+
return /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
29
|
+
...rest,
|
|
30
|
+
...this.state.nativeProps,
|
|
31
|
+
ref: c => {
|
|
32
|
+
this._root = c;
|
|
33
|
+
},
|
|
34
|
+
style: [{
|
|
35
|
+
textAlign: "left",
|
|
36
|
+
writingDirection
|
|
37
|
+
}, style]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const BaseLink = _ref => {
|
|
42
|
+
let {
|
|
43
|
+
style,
|
|
44
|
+
theme,
|
|
45
|
+
title,
|
|
46
|
+
...props
|
|
47
|
+
} = _ref;
|
|
48
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
49
|
+
hitSlop: 8,
|
|
50
|
+
style: [{
|
|
51
|
+
color: theme.colors.primary
|
|
52
|
+
}, style],
|
|
53
|
+
theme: theme,
|
|
54
|
+
...props
|
|
55
|
+
}, title);
|
|
56
|
+
};
|
|
57
|
+
exports.BaseLink = BaseLink;
|
|
58
|
+
const Link = (0, _theming.withTheme)(BaseLink);
|
|
59
|
+
exports.Link = Link;
|
|
60
|
+
var _default = (0, _theming.withTheme)(Text);
|
|
61
|
+
exports.default = _default;tring : Number)(input); }
|
|
16
62
|
class Text extends React.Component {
|
|
17
63
|
constructor() {
|
|
18
64
|
super(...arguments);
|
|
@@ -10,10 +10,6 @@ var _theming = require("../theming");
|
|
|
10
10
|
var _utilities = require("../utilities");
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
16
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
17
13
|
const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
|
|
18
14
|
const FOCUS_ANIMATION_DURATION = 150;
|
|
19
15
|
const BLUR_ANIMATION_DURATION = 180;
|
|
@@ -21,7 +17,7 @@ const ICON_SIZE = 24;
|
|
|
21
17
|
class TextField extends React.Component {
|
|
22
18
|
constructor() {
|
|
23
19
|
super(...arguments);
|
|
24
|
-
|
|
20
|
+
this.state = {
|
|
25
21
|
nativeProps: {},
|
|
26
22
|
labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
27
23
|
focused: false,
|
|
@@ -30,47 +26,46 @@ class TextField extends React.Component {
|
|
|
30
26
|
measured: false,
|
|
31
27
|
width: 0
|
|
32
28
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
};
|
|
30
|
+
this._timer = setTimeout(() => {}, 0);
|
|
31
|
+
this._showPlaceholder = () => {
|
|
36
32
|
clearTimeout(this._timer);
|
|
37
|
-
|
|
38
33
|
// Set the placeholder in a delay to offset the label animation
|
|
39
34
|
// If we show it immediately, they'll overlap and look ugly
|
|
40
35
|
this._timer = setTimeout(() => this.setState({
|
|
41
36
|
placeholder: this.props.placeholder
|
|
42
37
|
}), 50);
|
|
43
|
-
}
|
|
44
|
-
|
|
38
|
+
};
|
|
39
|
+
this._hidePlaceholder = () => this.setState({
|
|
45
40
|
placeholder: ""
|
|
46
|
-
})
|
|
47
|
-
|
|
41
|
+
});
|
|
42
|
+
this._restoreLabel = () => _reactNative.Animated.timing(this.state.labeled, {
|
|
48
43
|
toValue: 1,
|
|
49
44
|
duration: FOCUS_ANIMATION_DURATION,
|
|
50
45
|
useNativeDriver: true
|
|
51
|
-
}).start()
|
|
52
|
-
|
|
46
|
+
}).start();
|
|
47
|
+
this._minmizeLabel = () => _reactNative.Animated.timing(this.state.labeled, {
|
|
53
48
|
toValue: 0,
|
|
54
49
|
duration: BLUR_ANIMATION_DURATION,
|
|
55
50
|
useNativeDriver: true
|
|
56
|
-
}).start()
|
|
57
|
-
|
|
51
|
+
}).start();
|
|
52
|
+
this._handleFocus = () => {
|
|
58
53
|
if (this.props.disabled) {
|
|
59
54
|
return;
|
|
60
55
|
}
|
|
61
56
|
this.setState({
|
|
62
57
|
focused: true
|
|
63
58
|
});
|
|
64
|
-
}
|
|
65
|
-
|
|
59
|
+
};
|
|
60
|
+
this._handleBlur = () => {
|
|
66
61
|
if (this.props.disabled) {
|
|
67
62
|
return;
|
|
68
63
|
}
|
|
69
64
|
this.setState({
|
|
70
65
|
focused: false
|
|
71
66
|
});
|
|
72
|
-
}
|
|
73
|
-
|
|
67
|
+
};
|
|
68
|
+
this._handleChangeText = value => {
|
|
74
69
|
if (this.props.disabled) {
|
|
75
70
|
return;
|
|
76
71
|
}
|
|
@@ -85,8 +80,8 @@ class TextField extends React.Component {
|
|
|
85
80
|
});
|
|
86
81
|
this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
|
|
87
82
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
83
|
+
};
|
|
84
|
+
this._root = undefined;
|
|
90
85
|
}
|
|
91
86
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
92
87
|
return {
|
|
@@ -173,7 +168,9 @@ class TextField extends React.Component {
|
|
|
173
168
|
roundness,
|
|
174
169
|
disabledOpacity
|
|
175
170
|
},
|
|
176
|
-
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput,
|
|
171
|
+
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, {
|
|
172
|
+
...props
|
|
173
|
+
}),
|
|
177
174
|
...rest
|
|
178
175
|
} = this.props;
|
|
179
176
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
@@ -313,9 +310,10 @@ class TextField extends React.Component {
|
|
|
313
310
|
} = _reactNative.StyleSheet.flatten(style || {});
|
|
314
311
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
315
312
|
style: [styles.container, styleProp]
|
|
316
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon,
|
|
313
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
314
|
+
...leftIconProps,
|
|
317
315
|
style: leftIconStyle
|
|
318
|
-
})
|
|
316
|
+
}) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
319
317
|
style: (0, _utilities.applyStyles)([containerStyle], {
|
|
320
318
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
321
319
|
backgroundColor: bgColor,
|
|
@@ -383,9 +381,10 @@ class TextField extends React.Component {
|
|
|
383
381
|
style: {
|
|
384
382
|
justifyContent: type === "solid" ? "center" : undefined
|
|
385
383
|
}
|
|
386
|
-
}, /*#__PURE__*/React.createElement(Icon,
|
|
384
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
385
|
+
...leftIconProps,
|
|
387
386
|
style: leftIconStyle
|
|
388
|
-
}))
|
|
387
|
+
})) : null, render({
|
|
389
388
|
ref: c => {
|
|
390
389
|
this._root = c;
|
|
391
390
|
},
|
|
@@ -423,6 +422,55 @@ class TextField extends React.Component {
|
|
|
423
422
|
}
|
|
424
423
|
var _default = (0, _theming.withTheme)(TextField);
|
|
425
424
|
exports.default = _default;
|
|
425
|
+
const styles = _reactNative.StyleSheet.create({
|
|
426
|
+
container: {
|
|
427
|
+
alignSelf: "stretch"
|
|
428
|
+
},
|
|
429
|
+
placeholder: {
|
|
430
|
+
position: "absolute",
|
|
431
|
+
left: 0
|
|
432
|
+
},
|
|
433
|
+
underline: {
|
|
434
|
+
position: "absolute",
|
|
435
|
+
left: 0,
|
|
436
|
+
right: 0,
|
|
437
|
+
bottom: 0,
|
|
438
|
+
height: 2
|
|
439
|
+
},
|
|
440
|
+
input: {
|
|
441
|
+
flexGrow: 1,
|
|
442
|
+
justifyContent: "center",
|
|
443
|
+
textAlignVertical: "center",
|
|
444
|
+
margin: 0,
|
|
445
|
+
textAlign: _reactNative.I18nManager.isRTL ? "right" : "left"
|
|
446
|
+
}
|
|
447
|
+
});_handleFocus,
|
|
448
|
+
onBlur: this._handleBlur,
|
|
449
|
+
underlineColorAndroid: "transparent",
|
|
450
|
+
style: inputStyles,
|
|
451
|
+
...rest,
|
|
452
|
+
...this.state.nativeProps,
|
|
453
|
+
value: this.state.value
|
|
454
|
+
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
455
|
+
name: rightIconName,
|
|
456
|
+
size: ICON_SIZE,
|
|
457
|
+
color: colors.light,
|
|
458
|
+
style: {
|
|
459
|
+
position: "absolute",
|
|
460
|
+
right: 16,
|
|
461
|
+
marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
|
|
462
|
+
}
|
|
463
|
+
}) : null, assistiveText ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
464
|
+
style: [{
|
|
465
|
+
color: error ? colors.error : colors.light,
|
|
466
|
+
marginTop: 8,
|
|
467
|
+
marginLeft: assistiveTextLeftMargin
|
|
468
|
+
}]
|
|
469
|
+
}, assistiveText) : null);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
var _default = (0, _theming.withTheme)(TextField);
|
|
473
|
+
exports.default = _default;
|
|
426
474
|
const styles = _reactNative.StyleSheet.create({
|
|
427
475
|
container: {
|
|
428
476
|
alignSelf: "stretch"
|
|
@@ -11,7 +11,6 @@ var _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
14
|
const ToggleButton = _ref => {
|
|
16
15
|
let {
|
|
17
16
|
Icon,
|
|
@@ -47,7 +46,7 @@ const ToggleButton = _ref => {
|
|
|
47
46
|
setInternalValue(!internalValue);
|
|
48
47
|
onPress(!internalValue);
|
|
49
48
|
};
|
|
50
|
-
return /*#__PURE__*/React.createElement(_IconButton.default,
|
|
49
|
+
return /*#__PURE__*/React.createElement(_IconButton.default, {
|
|
51
50
|
Icon: Icon,
|
|
52
51
|
icon: icon,
|
|
53
52
|
size: iconSize,
|
|
@@ -59,6 +58,20 @@ const ToggleButton = _ref => {
|
|
|
59
58
|
height,
|
|
60
59
|
backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
|
|
61
60
|
borderColor: colors[borderColor]
|
|
61
|
+
}, style],
|
|
62
|
+
...rest
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
const styles = _reactNative.StyleSheet.create({
|
|
66
|
+
mainContainer: {
|
|
67
|
+
borderWidth: 1
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
var _default = (0, _theming.withTheme)(ToggleButton);
|
|
71
|
+
exports.default = _default;idth,
|
|
72
|
+
height,
|
|
73
|
+
backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
|
|
74
|
+
borderColor: colors[borderColor]
|
|
62
75
|
}, style]
|
|
63
76
|
}, rest));
|
|
64
77
|
};
|
|
@@ -7,7 +7,6 @@ exports.default = Touchable;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
10
|
function Touchable(_ref) {
|
|
12
11
|
let {
|
|
13
12
|
children,
|
|
@@ -20,8 +19,22 @@ function Touchable(_ref) {
|
|
|
20
19
|
style,
|
|
21
20
|
...props
|
|
22
21
|
} = _ref;
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable,
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
24
23
|
disabled: disabled,
|
|
24
|
+
onPress: onPress,
|
|
25
|
+
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
26
|
+
hitSlop: hitSlop ? hitSlop : 8,
|
|
27
|
+
style: _ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
pressed
|
|
30
|
+
} = _ref2;
|
|
31
|
+
return [{
|
|
32
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
33
|
+
}, style];
|
|
34
|
+
},
|
|
35
|
+
...props
|
|
36
|
+
}, children);
|
|
37
|
+
} disabled: disabled,
|
|
25
38
|
onPress: onPress,
|
|
26
39
|
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
27
40
|
hitSlop: hitSlop ? hitSlop : 8,
|
|
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
12
12
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
13
13
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
14
14
|
});
|
|
15
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
15
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -255,6 +255,24 @@ Object.defineProperty(exports, "Row", {
|
|
|
255
255
|
return _Layout.Row;
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
|
+
Object.defineProperty(exports, "RowBodyIcon", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function () {
|
|
261
|
+
return _RowBodyIcon.default;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
Object.defineProperty(exports, "RowHeadlineImageCaption", {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
get: function () {
|
|
267
|
+
return _RowHeadlineImageCaption.default;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
Object.defineProperty(exports, "RowHeadlineImageIcon", {
|
|
271
|
+
enumerable: true,
|
|
272
|
+
get: function () {
|
|
273
|
+
return _RowHeadlineImageIcon.default;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
258
276
|
Object.defineProperty(exports, "SVG", {
|
|
259
277
|
enumerable: true,
|
|
260
278
|
get: function () {
|
|
@@ -441,6 +459,9 @@ var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePi
|
|
|
441
459
|
var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
|
|
442
460
|
var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
|
|
443
461
|
var _ProgressCircle = _interopRequireDefault(require("./components/ProgressCircle"));
|
|
462
|
+
var _RowBodyIcon = _interopRequireDefault(require("./components/RowBodyIcon"));
|
|
463
|
+
var _RowHeadlineImageCaption = _interopRequireDefault(require("./components/RowHeadlineImageCaption"));
|
|
464
|
+
var _RowHeadlineImageIcon = _interopRequireDefault(require("./components/RowHeadlineImageIcon"));
|
|
444
465
|
var _Slider = _interopRequireDefault(require("./components/Slider"));
|
|
445
466
|
var _Stepper = _interopRequireDefault(require("./components/Stepper"));
|
|
446
467
|
var _useAuthState = require("./components/useAuthState");
|
|
@@ -15,7 +15,6 @@ function overlay(elevation) {
|
|
|
15
15
|
let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _DarkTheme.default.colors.surface;
|
|
16
16
|
if (isAnimatedValue(elevation)) {
|
|
17
17
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
18
|
-
|
|
19
18
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
20
19
|
return elevation.interpolate({
|
|
21
20
|
inputRange,
|
|
@@ -24,7 +23,6 @@ function overlay(elevation) {
|
|
|
24
23
|
})
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
29
27
|
return calculateColor(surfaceColor, elevation);
|
|
30
28
|
}
|
|
@@ -65,4 +63,4 @@ const elevationOverlayTransparency = {
|
|
|
65
63
|
22: 15.72,
|
|
66
64
|
23: 15.84,
|
|
67
65
|
24: 16
|
|
68
|
-
};
|
|
66
|
+
};};
|