@draftbit/core 46.7.3 → 46.7.5
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/Accordion/AccordionItem.js +4 -23
- package/lib/commonjs/components/AnimatedCircularProgress.js +1 -12
- package/lib/commonjs/components/AvatarEdit.js +4 -15
- package/lib/commonjs/components/Button.js +12 -35
- package/lib/commonjs/components/Checkbox/Checkbox.js +4 -22
- package/lib/commonjs/components/Container.js +4 -15
- package/lib/commonjs/components/DeprecatedButton.js +3 -20
- package/lib/commonjs/components/DeprecatedCardWrapper.js +1 -15
- package/lib/commonjs/components/Elevation.js +14 -2
- package/lib/commonjs/components/IconButton.js +4 -2
- package/lib/commonjs/components/Image.js +2 -17
- package/lib/commonjs/components/NumberInput.js +1 -1
- package/lib/commonjs/components/Picker/Picker.js +4 -9
- package/lib/commonjs/components/Portal/PortalHost.js +15 -44
- package/lib/commonjs/components/Portal/PortalManager.js +8 -34
- package/lib/commonjs/components/Pressable.js +2 -2
- package/lib/commonjs/components/ProgressBar.js +7 -37
- package/lib/commonjs/components/Slider.js +4 -21
- package/lib/commonjs/components/Surface.js +2 -14
- package/lib/commonjs/components/TextField.js +28 -76
- package/lib/commonjs/components/Touchable.js +4 -17
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/hooks.js +2 -1
- package/lib/commonjs/index.js +0 -56
- package/lib/commonjs/mappings/Button.js +2 -2
- package/lib/commonjs/mappings/FlashList.js +28 -0
- package/lib/commonjs/mappings/FlatList.js +14 -0
- package/lib/commonjs/mappings/IconButton.js +4 -6
- package/lib/commonjs/mappings/MapView.js +3 -1
- package/lib/commonjs/mappings/ScrollView.js +7 -1
- package/lib/commonjs/mappings/Touchable.js +9 -2
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/commonjs/utilities.js +2 -1
- package/lib/module/components/Button.js +12 -35
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +5 -24
- package/lib/module/components/Checkbox/context.js +1 -1
- package/lib/module/components/CircleImage.js +1 -16
- package/lib/module/components/DeprecatedCardWrapper.js +1 -18
- package/lib/module/components/Divider.js +1 -18
- package/lib/module/components/Elevation.js +2 -14
- package/lib/module/components/FieldSearchBarFull.js +2 -1
- package/lib/module/components/FormRow.js +2 -17
- package/lib/module/components/IconButton.js +4 -2
- package/lib/module/components/Image.js +2 -18
- package/lib/module/components/Layout.js +21 -42
- package/lib/module/components/NumberInput.js +4 -13
- package/lib/module/components/Picker/PickerComponent.ios.js +11 -36
- package/lib/module/components/Portal/PortalConsumer.js +7 -22
- package/lib/module/components/Pressable.js +2 -2
- package/lib/module/components/RadioButton/RadioButton.js +1 -13
- package/lib/module/components/RadioButton/RadioButtonGroup.js +2 -16
- package/lib/module/components/RadioButton/RadioButtonRow.js +5 -24
- package/lib/module/components/Slider.js +4 -21
- package/lib/module/components/StepIndicator.js +18 -58
- package/lib/module/components/TextField.js +28 -78
- package/lib/module/components/ToggleButton.js +2 -16
- package/lib/module/components/Touchable.js +4 -17
- package/lib/module/constants.js +2 -1
- package/lib/module/index.js +0 -8
- package/lib/module/mappings/Button.js +2 -2
- package/lib/module/mappings/FieldSearchBarFull.js +1 -4
- package/lib/module/mappings/FlashList.js +29 -1
- package/lib/module/mappings/FlatList.js +15 -1
- package/lib/module/mappings/IconButton.js +5 -7
- package/lib/module/mappings/MapView.js +3 -1
- package/lib/module/mappings/ScrollView.js +8 -2
- package/lib/module/mappings/Touchable.js +10 -3
- package/lib/module/styles/overlay.js +3 -1
- package/lib/module/utilities.js +2 -1
- package/lib/typescript/src/components/IconButton.d.ts +2 -0
- package/lib/typescript/src/components/IconButton.d.ts.map +1 -1
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -8
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +60 -0
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +30 -0
- package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/IconButton.d.ts +20 -10
- package/lib/typescript/src/mappings/IconButton.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +2 -0
- package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ScrollView.d.ts +21 -0
- package/lib/typescript/src/mappings/ScrollView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +20 -0
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Button.js +1 -1
- package/src/components/Button.tsx +2 -2
- package/src/components/IconButton.js +2 -2
- package/src/components/IconButton.tsx +6 -2
- package/src/components/NumberInput.js +1 -1
- package/src/components/NumberInput.tsx +1 -1
- package/src/components/Pressable.js +1 -1
- package/src/components/Pressable.tsx +2 -2
- package/src/components/Touchable.js +1 -1
- package/src/components/Touchable.tsx +2 -2
- package/src/index.js +0 -8
- package/src/index.tsx +0 -8
- package/src/mappings/Button.js +2 -2
- package/src/mappings/Button.ts +2 -2
- package/src/mappings/FlashList.js +29 -1
- package/src/mappings/FlashList.ts +33 -0
- package/src/mappings/FlatList.js +15 -1
- package/src/mappings/FlatList.ts +17 -0
- package/src/mappings/IconButton.js +5 -7
- package/src/mappings/IconButton.ts +5 -7
- package/src/mappings/MapView.js +2 -0
- package/src/mappings/MapView.ts +2 -0
- package/src/mappings/ScrollView.js +8 -2
- package/src/mappings/ScrollView.ts +10 -1
- package/src/mappings/Touchable.js +10 -3
- package/src/mappings/Touchable.ts +12 -2
- package/lib/commonjs/components/CardBlock.js +0 -115
- package/lib/commonjs/components/CardContainer.js +0 -138
- package/lib/commonjs/components/CardContainerRating.js +0 -133
- package/lib/commonjs/components/CardContainerShortImage.js +0 -84
- package/lib/commonjs/components/CardInline.js +0 -91
- package/lib/commonjs/components/Carousel.js +0 -130
- package/lib/commonjs/components/Header.js +0 -82
- package/lib/commonjs/components/HeaderLarge.js +0 -38
- package/lib/commonjs/components/HeaderMedium.js +0 -38
- package/lib/commonjs/components/HeaderOverline.js +0 -39
- package/lib/module/components/CardBlock.js +0 -108
- package/lib/module/components/CardContainer.js +0 -121
- package/lib/module/components/CardContainerRating.js +0 -135
- package/lib/module/components/CardContainerShortImage.js +0 -90
- package/lib/module/components/CardInline.js +0 -82
- package/lib/module/components/Carousel.js +0 -120
- package/lib/module/components/Header.js +0 -72
- package/lib/module/components/HeaderLarge.js +0 -28
- package/lib/module/components/HeaderMedium.js +0 -28
- package/lib/module/components/HeaderOverline.js +0 -29
- package/lib/typescript/src/components/CardBlock.d.ts +0 -21
- package/lib/typescript/src/components/CardBlock.d.ts.map +0 -1
- package/lib/typescript/src/components/CardContainer.d.ts +0 -23
- package/lib/typescript/src/components/CardContainer.d.ts.map +0 -1
- package/lib/typescript/src/components/CardContainerRating.d.ts +0 -24
- package/lib/typescript/src/components/CardContainerRating.d.ts.map +0 -1
- package/lib/typescript/src/components/CardContainerShortImage.d.ts +0 -19
- package/lib/typescript/src/components/CardContainerShortImage.d.ts.map +0 -1
- package/lib/typescript/src/components/CardInline.d.ts +0 -20
- package/lib/typescript/src/components/CardInline.d.ts.map +0 -1
- package/lib/typescript/src/components/Carousel.d.ts +0 -15
- package/lib/typescript/src/components/Carousel.d.ts.map +0 -1
- package/lib/typescript/src/components/Header.d.ts +0 -20
- package/lib/typescript/src/components/Header.d.ts.map +0 -1
- package/lib/typescript/src/components/HeaderLarge.d.ts +0 -17
- package/lib/typescript/src/components/HeaderLarge.d.ts.map +0 -1
- package/lib/typescript/src/components/HeaderMedium.d.ts +0 -17
- package/lib/typescript/src/components/HeaderMedium.d.ts.map +0 -1
- package/lib/typescript/src/components/HeaderOverline.d.ts +0 -17
- package/lib/typescript/src/components/HeaderOverline.d.ts.map +0 -1
- package/src/components/CardBlock.js +0 -54
- package/src/components/CardBlock.tsx +0 -127
- package/src/components/CardContainer.js +0 -69
- package/src/components/CardContainer.tsx +0 -165
- package/src/components/CardContainerRating.js +0 -79
- package/src/components/CardContainerRating.tsx +0 -175
- package/src/components/CardContainerShortImage.js +0 -33
- package/src/components/CardContainerShortImage.tsx +0 -101
- package/src/components/CardInline.js +0 -36
- package/src/components/CardInline.tsx +0 -93
- package/src/components/Carousel.js +0 -68
- package/src/components/Carousel.tsx +0 -134
- package/src/components/Header.js +0 -44
- package/src/components/Header.tsx +0 -105
- package/src/components/HeaderLarge.js +0 -7
- package/src/components/HeaderLarge.tsx +0 -40
- package/src/components/HeaderMedium.js +0 -7
- package/src/components/HeaderMedium.tsx +0 -41
- package/src/components/HeaderOverline.js +0 -7
- package/src/components/HeaderOverline.tsx +0 -42
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
import React, { useEffect, useState } from "react";
|
|
2
3
|
import { TextInput } from "react-native";
|
|
3
4
|
import { isString, isNumber, isNaN } from "lodash";
|
|
@@ -8,7 +9,7 @@ const NumberInput = _ref => {
|
|
|
8
9
|
defaultValue,
|
|
9
10
|
...props
|
|
10
11
|
} = _ref;
|
|
11
|
-
const [currentStringNumberValue, setCurrentStringNumberValue] = useState("
|
|
12
|
+
const [currentStringNumberValue, setCurrentStringNumberValue] = useState("");
|
|
12
13
|
const formatValueToStringNumber = valueToFormat => {
|
|
13
14
|
if (valueToFormat != null) {
|
|
14
15
|
if (isString(valueToFormat) && valueToFormat !== "") {
|
|
@@ -25,6 +26,7 @@ const NumberInput = _ref => {
|
|
|
25
26
|
}
|
|
26
27
|
return "0";
|
|
27
28
|
};
|
|
29
|
+
|
|
28
30
|
// set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
|
|
29
31
|
useEffect(() => {
|
|
30
32
|
const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
|
|
@@ -39,6 +41,7 @@ const NumberInput = _ref => {
|
|
|
39
41
|
setCurrentStringNumberValue(newStringNumberValue);
|
|
40
42
|
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(number);
|
|
41
43
|
};
|
|
44
|
+
|
|
42
45
|
// run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
|
|
43
46
|
useEffect(() => {
|
|
44
47
|
const nextStringNumberValue = formatValueToStringNumber(value);
|
|
@@ -47,18 +50,6 @@ const NumberInput = _ref => {
|
|
|
47
50
|
}
|
|
48
51
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
52
|
}, [value]);
|
|
50
|
-
return /*#__PURE__*/React.createElement(TextInput, {
|
|
51
|
-
keyboardType: "numeric",
|
|
52
|
-
value: currentStringNumberValue,
|
|
53
|
-
onChangeText: handleChangeText,
|
|
54
|
-
...props
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
export default NumberInput;alue) {
|
|
58
|
-
handleChangeText(nextStringNumberValue);
|
|
59
|
-
}
|
|
60
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
-
}, [value]);
|
|
62
53
|
return /*#__PURE__*/React.createElement(TextInput, _extends({
|
|
63
54
|
keyboardType: "numeric",
|
|
64
55
|
value: currentStringNumberValue,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { View, StyleSheet } from "react-native";
|
|
3
4
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
@@ -10,6 +11,7 @@ import TextField from "../TextField";
|
|
|
10
11
|
import Touchable from "../Touchable";
|
|
11
12
|
import { extractStyles } from "../../utilities";
|
|
12
13
|
const Picker = _ref => {
|
|
14
|
+
var _options$find$label, _options$find;
|
|
13
15
|
let {
|
|
14
16
|
Icon,
|
|
15
17
|
style,
|
|
@@ -23,7 +25,6 @@ const Picker = _ref => {
|
|
|
23
25
|
},
|
|
24
26
|
...props
|
|
25
27
|
} = _ref;
|
|
26
|
-
var _a, _b;
|
|
27
28
|
const {
|
|
28
29
|
viewStyles: {
|
|
29
30
|
borderRadius,
|
|
@@ -64,24 +65,26 @@ const Picker = _ref => {
|
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
67
|
-
const selectedLabel = selectedValue && ((
|
|
68
|
+
const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
|
|
68
69
|
return /*#__PURE__*/React.createElement(View, {
|
|
69
70
|
style: [styles.container, viewStyles]
|
|
70
71
|
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
71
72
|
disabled: disabled,
|
|
72
73
|
onPress: toggleVisibility
|
|
73
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
74
|
-
...props,
|
|
74
|
+
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
75
75
|
value: String(selectedLabel),
|
|
76
|
-
placeholder: placeholder
|
|
76
|
+
placeholder: placeholder
|
|
77
77
|
// @ts-ignore
|
|
78
|
-
|
|
78
|
+
,
|
|
79
|
+
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
80
|
+
,
|
|
79
81
|
disabled: disabled,
|
|
80
|
-
pointerEvents: "none"
|
|
82
|
+
pointerEvents: "none"
|
|
81
83
|
// @ts-expect-error
|
|
84
|
+
,
|
|
82
85
|
style: stylesWithoutMargin,
|
|
83
86
|
Icon: Icon
|
|
84
|
-
})), pickerVisible && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(View, {
|
|
87
|
+
}))), pickerVisible && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(View, {
|
|
85
88
|
style: [styles.picker, {
|
|
86
89
|
backgroundColor: colors.divider
|
|
87
90
|
}]
|
|
@@ -125,32 +128,4 @@ const styles = StyleSheet.create({
|
|
|
125
128
|
alignSelf: "flex-end"
|
|
126
129
|
}
|
|
127
130
|
});
|
|
128
|
-
export default withTheme(Picker);nValueChange
|
|
129
|
-
}, options.map(o => /*#__PURE__*/React.createElement(NativePicker.Item, {
|
|
130
|
-
label: o.label,
|
|
131
|
-
value: o.value,
|
|
132
|
-
key: o.value
|
|
133
|
-
})))))));
|
|
134
|
-
};
|
|
135
|
-
const styles = StyleSheet.create({
|
|
136
|
-
container: {
|
|
137
|
-
alignSelf: "stretch"
|
|
138
|
-
},
|
|
139
|
-
picker: {
|
|
140
|
-
position: "absolute",
|
|
141
|
-
bottom: 0,
|
|
142
|
-
left: 0,
|
|
143
|
-
right: 0,
|
|
144
|
-
flexDirection: "row",
|
|
145
|
-
justifyContent: "center"
|
|
146
|
-
},
|
|
147
|
-
pickerContainer: {
|
|
148
|
-
backgroundColor: "white",
|
|
149
|
-
flexDirection: "column",
|
|
150
|
-
width: "100%"
|
|
151
|
-
},
|
|
152
|
-
closeButton: {
|
|
153
|
-
alignSelf: "flex-end"
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
131
|
export default withTheme(Picker);
|
|
@@ -1,28 +1,13 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
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); }
|
|
1
4
|
import * as React from "react";
|
|
2
5
|
export default class PortalConsumer extends React.Component {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
await Promise.resolve();
|
|
7
|
-
this.key = this.props.manager.mount(this.props.children);
|
|
8
|
-
}
|
|
9
|
-
componentDidUpdate() {
|
|
10
|
-
this.checkManager();
|
|
11
|
-
this.props.manager.update(this.key, this.props.children);
|
|
12
|
-
}
|
|
13
|
-
componentWillUnmount() {
|
|
14
|
-
this.checkManager();
|
|
15
|
-
this.props.manager.unmount(this.key);
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
_defineProperty(this, "key", void 0);
|
|
16
9
|
}
|
|
17
|
-
|
|
18
|
-
if (!this.props.manager) {
|
|
19
|
-
throw new Error("Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n" + "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + "https://callstack.github.io/react-native-paper/getting-started.html");
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
render() {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
}sync componentDidMount() {
|
|
10
|
+
async componentDidMount() {
|
|
26
11
|
this.checkManager();
|
|
27
12
|
|
|
28
13
|
// Delay updating to prevent React from going to infinite loop
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import Config from "../Config";
|
|
3
4
|
import IconButton from "../IconButton";
|
|
@@ -29,19 +30,6 @@ const RadioButton = _ref => {
|
|
|
29
30
|
onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
|
|
30
31
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
|
|
31
32
|
};
|
|
32
|
-
return /*#__PURE__*/React.createElement(IconButton, {
|
|
33
|
-
Icon: Icon,
|
|
34
|
-
icon: isSelected ? selectedIcon : unselectedIcon,
|
|
35
|
-
color: isSelected ? color : unselectedColor,
|
|
36
|
-
disabled: disabled,
|
|
37
|
-
onPress: handlePress,
|
|
38
|
-
size: size,
|
|
39
|
-
style: style,
|
|
40
|
-
...rest
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
export default RadioButton;: onValueChange(realValue);
|
|
44
|
-
};
|
|
45
33
|
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
46
34
|
Icon: Icon,
|
|
47
35
|
icon: isSelected ? selectedIcon : unselectedIcon,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { View } from "react-native";
|
|
3
4
|
import { getValueForRadioButton } from "../../utilities";
|
|
@@ -41,22 +42,7 @@ const RadioButtonGroup = _ref => {
|
|
|
41
42
|
alignItems: "center"
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
45
|
-
style: [{
|
|
46
|
-
minHeight: 40
|
|
47
|
-
}, style],
|
|
48
|
-
...rest
|
|
49
|
-
}, /*#__PURE__*/React.createElement(Provider, {
|
|
50
|
-
value: {
|
|
51
|
-
value: internalValue,
|
|
52
|
-
onValueChange: handleValueChange,
|
|
53
|
-
direction
|
|
54
|
-
}
|
|
55
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
56
|
-
style: _containerStyle
|
|
57
|
-
}, children)));
|
|
58
|
-
};
|
|
59
|
-
export default RadioButtonGroup;xtends({
|
|
45
|
+
return /*#__PURE__*/React.createElement(View, _extends({
|
|
60
46
|
style: [{
|
|
61
47
|
minHeight: 40
|
|
62
48
|
}, style]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { StyleSheet, View, Platform } from "react-native";
|
|
3
4
|
import RadioButton from "./RadioButton";
|
|
@@ -6,7 +7,7 @@ import { useRadioButtonGroupContext } from "./context";
|
|
|
6
7
|
import { Direction as GroupDirection } from "./context";
|
|
7
8
|
import Touchable from "../Touchable";
|
|
8
9
|
import { extractStyles, getValueForRadioButton } from "../../utilities";
|
|
9
|
-
export
|
|
10
|
+
export let Direction;
|
|
10
11
|
(function (Direction) {
|
|
11
12
|
Direction["Row"] = "row";
|
|
12
13
|
Direction["RowReverse"] = "row-reverse";
|
|
@@ -62,14 +63,13 @@ const RadioButtonRow = _ref => {
|
|
|
62
63
|
textStyles,
|
|
63
64
|
viewStyles
|
|
64
65
|
} = extractStyles(style);
|
|
65
|
-
return /*#__PURE__*/React.createElement(Touchable, {
|
|
66
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
66
67
|
onPress: handlePress,
|
|
67
68
|
style: [styles.mainParent, {
|
|
68
69
|
flexDirection: direction
|
|
69
70
|
}, viewStyles],
|
|
70
|
-
disabled: disabled
|
|
71
|
-
|
|
72
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
71
|
+
disabled: disabled
|
|
72
|
+
}, rest), /*#__PURE__*/React.createElement(View, {
|
|
73
73
|
style: [styles.label, {
|
|
74
74
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
75
75
|
}, labelContainerStyle]
|
|
@@ -106,23 +106,4 @@ const styles = StyleSheet.create({
|
|
|
106
106
|
flex: 3
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
-
export default RadioButtonRow;.create({
|
|
110
|
-
mainParent: {
|
|
111
|
-
alignItems: "center",
|
|
112
|
-
justifyContent: "space-around",
|
|
113
|
-
paddingStart: 20,
|
|
114
|
-
minHeight: 50,
|
|
115
|
-
paddingEnd: 20,
|
|
116
|
-
display: "flex",
|
|
117
|
-
...Platform.select({
|
|
118
|
-
web: {
|
|
119
|
-
cursor: "pointer",
|
|
120
|
-
userSelect: "none"
|
|
121
|
-
}
|
|
122
|
-
})
|
|
123
|
-
},
|
|
124
|
-
label: {
|
|
125
|
-
flex: 3
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
109
|
export default RadioButtonRow;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { View, StyleSheet } from "react-native";
|
|
3
4
|
import NativeSlider from "@react-native-community/slider";
|
|
@@ -63,10 +64,9 @@ function Slider(_ref) {
|
|
|
63
64
|
setInternalValue(newValue);
|
|
64
65
|
onValueChange(newValue);
|
|
65
66
|
};
|
|
66
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
67
|
-
style: [styles.container, style]
|
|
68
|
-
|
|
69
|
-
}, leftIcon ? /*#__PURE__*/React.createElement(Icon, {
|
|
67
|
+
return /*#__PURE__*/React.createElement(View, _extends({
|
|
68
|
+
style: [styles.container, style]
|
|
69
|
+
}, rest), leftIcon ? /*#__PURE__*/React.createElement(Icon, {
|
|
70
70
|
color: leftIconThemeColor,
|
|
71
71
|
name: leftIcon,
|
|
72
72
|
size: 24
|
|
@@ -98,21 +98,4 @@ const styles = StyleSheet.create({
|
|
|
98
98
|
marginHorizontal: 12
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
|
-
export default withTheme(Slider);Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
102
|
-
color: rightIconThemeColor,
|
|
103
|
-
name: rightIcon,
|
|
104
|
-
size: 24
|
|
105
|
-
}) : null);
|
|
106
|
-
}
|
|
107
|
-
const styles = StyleSheet.create({
|
|
108
|
-
container: {
|
|
109
|
-
height: 40,
|
|
110
|
-
flexDirection: "row",
|
|
111
|
-
alignItems: "center"
|
|
112
|
-
},
|
|
113
|
-
slider: {
|
|
114
|
-
flex: 1,
|
|
115
|
-
marginHorizontal: 12
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
101
|
export default withTheme(Slider);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
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); }
|
|
1
4
|
// @ts-nocheck
|
|
2
5
|
import React, { Component } from "react";
|
|
3
6
|
import { View, Text, StyleSheet, Animated, TouchableWithoutFeedback } from "react-native";
|
|
@@ -9,7 +12,7 @@ const STEP_STATUS = {
|
|
|
9
12
|
export default class StepIndicator extends Component {
|
|
10
13
|
constructor(props) {
|
|
11
14
|
super(props);
|
|
12
|
-
this
|
|
15
|
+
_defineProperty(this, "renderProgressBarBackground", () => {
|
|
13
16
|
const {
|
|
14
17
|
stepCount,
|
|
15
18
|
direction
|
|
@@ -52,8 +55,8 @@ export default class StepIndicator extends Component {
|
|
|
52
55
|
},
|
|
53
56
|
style: progressBarBackgroundStyle
|
|
54
57
|
});
|
|
55
|
-
};
|
|
56
|
-
this
|
|
58
|
+
});
|
|
59
|
+
_defineProperty(this, "renderProgressBar", () => {
|
|
57
60
|
const {
|
|
58
61
|
stepCount,
|
|
59
62
|
direction
|
|
@@ -83,8 +86,8 @@ export default class StepIndicator extends Component {
|
|
|
83
86
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
84
87
|
style: progressBarStyle
|
|
85
88
|
});
|
|
86
|
-
};
|
|
87
|
-
this
|
|
89
|
+
});
|
|
90
|
+
_defineProperty(this, "renderStepIndicator", () => {
|
|
88
91
|
let steps = [];
|
|
89
92
|
const {
|
|
90
93
|
stepCount,
|
|
@@ -115,8 +118,8 @@ export default class StepIndicator extends Component {
|
|
|
115
118
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
116
119
|
}]
|
|
117
120
|
}, steps);
|
|
118
|
-
};
|
|
119
|
-
this
|
|
121
|
+
});
|
|
122
|
+
_defineProperty(this, "renderStepLabels", () => {
|
|
120
123
|
const {
|
|
121
124
|
labels,
|
|
122
125
|
direction,
|
|
@@ -158,8 +161,8 @@ export default class StepIndicator extends Component {
|
|
|
158
161
|
alignItems: this.state.customStyles.labelAlign
|
|
159
162
|
}]
|
|
160
163
|
}, labelViews);
|
|
161
|
-
};
|
|
162
|
-
this
|
|
164
|
+
});
|
|
165
|
+
_defineProperty(this, "renderStep", position => {
|
|
163
166
|
const {
|
|
164
167
|
renderStepIndicator
|
|
165
168
|
} = this.props;
|
|
@@ -226,8 +229,8 @@ export default class StepIndicator extends Component {
|
|
|
226
229
|
}) : /*#__PURE__*/React.createElement(Text, {
|
|
227
230
|
style: indicatorLabelStyle
|
|
228
231
|
}, "".concat(position + 1)));
|
|
229
|
-
};
|
|
230
|
-
this
|
|
232
|
+
});
|
|
233
|
+
_defineProperty(this, "getStepStatus", stepPosition => {
|
|
231
234
|
const {
|
|
232
235
|
currentPosition
|
|
233
236
|
} = this.props;
|
|
@@ -238,8 +241,8 @@ export default class StepIndicator extends Component {
|
|
|
238
241
|
} else {
|
|
239
242
|
return STEP_STATUS.UNFINISHED;
|
|
240
243
|
}
|
|
241
|
-
};
|
|
242
|
-
this
|
|
244
|
+
});
|
|
245
|
+
_defineProperty(this, "onCurrentPositionChanged", position => {
|
|
243
246
|
let {
|
|
244
247
|
stepCount
|
|
245
248
|
} = this.props;
|
|
@@ -259,7 +262,7 @@ export default class StepIndicator extends Component {
|
|
|
259
262
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
260
263
|
duration: 100
|
|
261
264
|
})])]).start();
|
|
262
|
-
};
|
|
265
|
+
});
|
|
263
266
|
const defaultStyles = {
|
|
264
267
|
stepIndicatorSize: 30,
|
|
265
268
|
currentStepIndicatorSize: 40,
|
|
@@ -325,6 +328,7 @@ export default class StepIndicator extends Component {
|
|
|
325
328
|
// ),
|
|
326
329
|
// }));
|
|
327
330
|
// }
|
|
331
|
+
|
|
328
332
|
if (prevProps.currentPosition !== this.props.currentPosition) {
|
|
329
333
|
this.onCurrentPositionChanged(this.props.currentPosition);
|
|
330
334
|
}
|
|
@@ -365,50 +369,6 @@ const styles = StyleSheet.create({
|
|
|
365
369
|
justifyContent: "center"
|
|
366
370
|
}
|
|
367
371
|
});
|
|
368
|
-
StepIndicator.defaultProps = {
|
|
369
|
-
currentPosition: 0,
|
|
370
|
-
stepCount: 5,
|
|
371
|
-
customStyles: {},
|
|
372
|
-
direction: "horizontal"
|
|
373
|
-
};rrentPositionChanged(this.props.currentPosition);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
const styles = StyleSheet.create({
|
|
378
|
-
container: {
|
|
379
|
-
backgroundColor: "transparent"
|
|
380
|
-
},
|
|
381
|
-
stepIndicatorContainer: {
|
|
382
|
-
flexDirection: "row",
|
|
383
|
-
alignItems: "center",
|
|
384
|
-
justifyContent: "space-around",
|
|
385
|
-
backgroundColor: "transparent"
|
|
386
|
-
},
|
|
387
|
-
stepLabelsContainer: {
|
|
388
|
-
justifyContent: "space-around"
|
|
389
|
-
},
|
|
390
|
-
step: {
|
|
391
|
-
alignItems: "center",
|
|
392
|
-
justifyContent: "center",
|
|
393
|
-
zIndex: 2
|
|
394
|
-
},
|
|
395
|
-
stepContainer: {
|
|
396
|
-
flex: 1,
|
|
397
|
-
flexDirection: "row",
|
|
398
|
-
alignItems: "center",
|
|
399
|
-
justifyContent: "center"
|
|
400
|
-
},
|
|
401
|
-
stepLabel: {
|
|
402
|
-
fontSize: 12,
|
|
403
|
-
textAlign: "center",
|
|
404
|
-
fontWeight: "500"
|
|
405
|
-
},
|
|
406
|
-
stepLabelItem: {
|
|
407
|
-
flex: 1,
|
|
408
|
-
alignItems: "center",
|
|
409
|
-
justifyContent: "center"
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
372
|
StepIndicator.defaultProps = {
|
|
413
373
|
currentPosition: 0,
|
|
414
374
|
stepCount: 5,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
|
+
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); }
|
|
1
5
|
import * as React from "react";
|
|
2
6
|
import { View, Animated, TextInput as NativeTextInput, StyleSheet, Text, I18nManager } from "react-native";
|
|
3
7
|
import { withTheme } from "../theming";
|
|
@@ -9,7 +13,7 @@ const ICON_SIZE = 24;
|
|
|
9
13
|
class TextField extends React.Component {
|
|
10
14
|
constructor() {
|
|
11
15
|
super(...arguments);
|
|
12
|
-
this
|
|
16
|
+
_defineProperty(this, "state", {
|
|
13
17
|
nativeProps: {},
|
|
14
18
|
labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
15
19
|
focused: false,
|
|
@@ -18,46 +22,47 @@ class TextField extends React.Component {
|
|
|
18
22
|
measured: false,
|
|
19
23
|
width: 0
|
|
20
24
|
}
|
|
21
|
-
};
|
|
22
|
-
this
|
|
23
|
-
this
|
|
25
|
+
});
|
|
26
|
+
_defineProperty(this, "_timer", setTimeout(() => {}, 0));
|
|
27
|
+
_defineProperty(this, "_showPlaceholder", () => {
|
|
24
28
|
clearTimeout(this._timer);
|
|
29
|
+
|
|
25
30
|
// Set the placeholder in a delay to offset the label animation
|
|
26
31
|
// If we show it immediately, they'll overlap and look ugly
|
|
27
32
|
this._timer = setTimeout(() => this.setState({
|
|
28
33
|
placeholder: this.props.placeholder
|
|
29
34
|
}), 50);
|
|
30
|
-
};
|
|
31
|
-
this._hidePlaceholder = () => this.setState({
|
|
32
|
-
placeholder: ""
|
|
33
35
|
});
|
|
34
|
-
this
|
|
36
|
+
_defineProperty(this, "_hidePlaceholder", () => this.setState({
|
|
37
|
+
placeholder: ""
|
|
38
|
+
}));
|
|
39
|
+
_defineProperty(this, "_restoreLabel", () => Animated.timing(this.state.labeled, {
|
|
35
40
|
toValue: 1,
|
|
36
41
|
duration: FOCUS_ANIMATION_DURATION,
|
|
37
42
|
useNativeDriver: true
|
|
38
|
-
}).start();
|
|
39
|
-
this
|
|
43
|
+
}).start());
|
|
44
|
+
_defineProperty(this, "_minmizeLabel", () => Animated.timing(this.state.labeled, {
|
|
40
45
|
toValue: 0,
|
|
41
46
|
duration: BLUR_ANIMATION_DURATION,
|
|
42
47
|
useNativeDriver: true
|
|
43
|
-
}).start();
|
|
44
|
-
this
|
|
48
|
+
}).start());
|
|
49
|
+
_defineProperty(this, "_handleFocus", () => {
|
|
45
50
|
if (this.props.disabled) {
|
|
46
51
|
return;
|
|
47
52
|
}
|
|
48
53
|
this.setState({
|
|
49
54
|
focused: true
|
|
50
55
|
});
|
|
51
|
-
};
|
|
52
|
-
this
|
|
56
|
+
});
|
|
57
|
+
_defineProperty(this, "_handleBlur", () => {
|
|
53
58
|
if (this.props.disabled) {
|
|
54
59
|
return;
|
|
55
60
|
}
|
|
56
61
|
this.setState({
|
|
57
62
|
focused: false
|
|
58
63
|
});
|
|
59
|
-
};
|
|
60
|
-
this
|
|
64
|
+
});
|
|
65
|
+
_defineProperty(this, "_handleChangeText", value => {
|
|
61
66
|
if (this.props.disabled) {
|
|
62
67
|
return;
|
|
63
68
|
}
|
|
@@ -72,8 +77,8 @@ class TextField extends React.Component {
|
|
|
72
77
|
});
|
|
73
78
|
this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
|
|
74
79
|
}
|
|
75
|
-
};
|
|
76
|
-
this
|
|
80
|
+
});
|
|
81
|
+
_defineProperty(this, "_root", undefined);
|
|
77
82
|
}
|
|
78
83
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
79
84
|
return {
|
|
@@ -160,9 +165,7 @@ class TextField extends React.Component {
|
|
|
160
165
|
roundness,
|
|
161
166
|
disabledOpacity
|
|
162
167
|
},
|
|
163
|
-
render = props => /*#__PURE__*/React.createElement(NativeTextInput,
|
|
164
|
-
...props
|
|
165
|
-
}),
|
|
168
|
+
render = props => /*#__PURE__*/React.createElement(NativeTextInput, props),
|
|
166
169
|
...rest
|
|
167
170
|
} = this.props;
|
|
168
171
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
@@ -302,10 +305,9 @@ class TextField extends React.Component {
|
|
|
302
305
|
} = StyleSheet.flatten(style || {});
|
|
303
306
|
return /*#__PURE__*/React.createElement(View, {
|
|
304
307
|
style: [styles.container, styleProp]
|
|
305
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
306
|
-
...leftIconProps,
|
|
308
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
307
309
|
style: leftIconStyle
|
|
308
|
-
}) : null, /*#__PURE__*/React.createElement(View, {
|
|
310
|
+
})) : null, /*#__PURE__*/React.createElement(View, {
|
|
309
311
|
style: applyStyles([containerStyle], {
|
|
310
312
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
311
313
|
backgroundColor: bgColor,
|
|
@@ -373,10 +375,9 @@ class TextField extends React.Component {
|
|
|
373
375
|
style: {
|
|
374
376
|
justifyContent: type === "solid" ? "center" : undefined
|
|
375
377
|
}
|
|
376
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
377
|
-
...leftIconProps,
|
|
378
|
+
}, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
378
379
|
style: leftIconStyle
|
|
379
|
-
})) : null, render({
|
|
380
|
+
}))) : null, render({
|
|
380
381
|
ref: c => {
|
|
381
382
|
this._root = c;
|
|
382
383
|
},
|
|
@@ -413,57 +414,6 @@ class TextField extends React.Component {
|
|
|
413
414
|
}
|
|
414
415
|
}
|
|
415
416
|
export default withTheme(TextField);
|
|
416
|
-
const styles = StyleSheet.create({
|
|
417
|
-
container: {
|
|
418
|
-
alignSelf: "stretch"
|
|
419
|
-
},
|
|
420
|
-
placeholder: {
|
|
421
|
-
position: "absolute",
|
|
422
|
-
left: 0
|
|
423
|
-
},
|
|
424
|
-
underline: {
|
|
425
|
-
position: "absolute",
|
|
426
|
-
left: 0,
|
|
427
|
-
right: 0,
|
|
428
|
-
bottom: 0,
|
|
429
|
-
height: 2
|
|
430
|
-
},
|
|
431
|
-
input: {
|
|
432
|
-
flexGrow: 1,
|
|
433
|
-
justifyContent: "center",
|
|
434
|
-
textAlignVertical: "center",
|
|
435
|
-
margin: 0,
|
|
436
|
-
textAlign: I18nManager.isRTL ? "right" : "left"
|
|
437
|
-
}
|
|
438
|
-
});ionColor: activeColor,
|
|
439
|
-
multiline,
|
|
440
|
-
numberOfLines,
|
|
441
|
-
onFocus: this._handleFocus,
|
|
442
|
-
onBlur: this._handleBlur,
|
|
443
|
-
underlineColorAndroid: "transparent",
|
|
444
|
-
style: inputStyles,
|
|
445
|
-
...rest,
|
|
446
|
-
...this.state.nativeProps,
|
|
447
|
-
value: this.state.value
|
|
448
|
-
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
449
|
-
name: rightIconName,
|
|
450
|
-
size: ICON_SIZE,
|
|
451
|
-
color: colors.light,
|
|
452
|
-
style: {
|
|
453
|
-
position: "absolute",
|
|
454
|
-
right: 16,
|
|
455
|
-
marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
|
|
456
|
-
}
|
|
457
|
-
}) : null, assistiveText ? /*#__PURE__*/React.createElement(Text, {
|
|
458
|
-
style: [{
|
|
459
|
-
color: error ? colors.error : colors.light,
|
|
460
|
-
marginTop: 8,
|
|
461
|
-
marginLeft: assistiveTextLeftMargin
|
|
462
|
-
}]
|
|
463
|
-
}, assistiveText) : null);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
export default withTheme(TextField);
|
|
467
417
|
const styles = StyleSheet.create({
|
|
468
418
|
container: {
|
|
469
419
|
alignSelf: "stretch"
|