@draftbit/core 47.0.1-df014a.2 → 47.0.1-e04fa3.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/index.js +25 -82
- package/lib/commonjs/mappings/NativeBase/AlertDialog.js +102 -0
- package/lib/commonjs/mappings/NativeBase/Button.js +84 -0
- package/lib/commonjs/mappings/NativeBase/DataDisplay.js +61 -0
- package/lib/commonjs/mappings/NativeBase/Feedback.js +74 -0
- package/lib/commonjs/mappings/NativeBase/Layout.js +114 -0
- package/lib/commonjs/mappings/NativeBase/Media.js +49 -0
- package/lib/commonjs/mappings/NativeBase/Menu.js +111 -0
- package/lib/commonjs/mappings/NativeBase/Modal.js +93 -0
- package/lib/commonjs/mappings/NativeBase/Other.js +94 -0
- package/lib/commonjs/mappings/NativeBase/Popover.js +99 -0
- package/lib/commonjs/mappings/NativeBase/Select.js +65 -0
- package/lib/commonjs/mappings/NativeBase/Slider.js +81 -0
- package/lib/module/components/AvatarEdit.js +4 -15
- package/lib/module/components/CardBlock.js +4 -14
- package/lib/module/components/CircleImage.js +1 -16
- package/lib/module/components/DeprecatedCardWrapper.js +1 -18
- package/lib/module/components/FAB.js +4 -22
- package/lib/module/components/Picker/PickerComponent.ios.js +11 -36
- package/lib/module/components/Picker/PickerComponent.web.js +3 -21
- package/lib/module/components/Switch.js +10 -21
- package/lib/module/components/TextField.js +28 -78
- package/lib/module/components/Touchable.js +1 -18
- package/lib/module/index.js +121 -31
- package/lib/module/mappings/NativeBase/AlertDialog.js +95 -0
- package/lib/module/mappings/NativeBase/Button.js +86 -0
- package/lib/module/mappings/NativeBase/DataDisplay.js +54 -0
- package/lib/module/mappings/NativeBase/Feedback.js +67 -0
- package/lib/module/mappings/NativeBase/Layout.js +107 -0
- package/lib/module/mappings/NativeBase/Media.js +42 -0
- package/lib/module/mappings/NativeBase/Menu.js +104 -0
- package/lib/module/mappings/NativeBase/Modal.js +86 -0
- package/lib/module/mappings/NativeBase/Other.js +87 -0
- package/lib/module/mappings/NativeBase/Popover.js +92 -0
- package/lib/module/mappings/NativeBase/Select.js +58 -0
- package/lib/module/mappings/NativeBase/Slider.js +74 -0
- package/lib/typescript/src/index.d.ts +102 -29
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/NativeBase/AlertDialog.d.ts +146 -0
- package/lib/typescript/src/mappings/NativeBase/AlertDialog.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Button.d.ts +1 -0
- package/lib/typescript/src/mappings/NativeBase/Button.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/DataDisplay.d.ts +96 -0
- package/lib/typescript/src/mappings/NativeBase/DataDisplay.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Feedback.d.ts +2 -0
- package/lib/typescript/src/mappings/NativeBase/Feedback.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +146 -0
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Media.d.ts +48 -0
- package/lib/typescript/src/mappings/NativeBase/Media.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Menu.d.ts +227 -0
- package/lib/typescript/src/mappings/NativeBase/Menu.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Modal.d.ts +133 -0
- package/lib/typescript/src/mappings/NativeBase/Modal.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Other.d.ts +179 -0
- package/lib/typescript/src/mappings/NativeBase/Other.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Popover.d.ts +136 -0
- package/lib/typescript/src/mappings/NativeBase/Popover.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Select.d.ts +156 -0
- package/lib/typescript/src/mappings/NativeBase/Select.d.ts.map +1 -0
- package/lib/typescript/src/mappings/NativeBase/Slider.d.ts +200 -0
- package/lib/typescript/src/mappings/NativeBase/Slider.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/index.js +112 -31
- package/src/index.tsx +123 -43
- package/src/mappings/NativeBase/AlertDialog.js +112 -0
- package/src/mappings/NativeBase/AlertDialog.ts +128 -0
- package/src/mappings/NativeBase/Button.js +84 -0
- package/src/mappings/NativeBase/Button.ts +83 -0
- package/src/mappings/NativeBase/DataDisplay.js +67 -0
- package/src/mappings/NativeBase/DataDisplay.ts +79 -0
- package/src/mappings/NativeBase/Feedback.js +89 -0
- package/src/mappings/NativeBase/Feedback.ts +100 -0
- package/src/mappings/NativeBase/Layout.js +140 -0
- package/src/mappings/NativeBase/Layout.ts +152 -0
- package/src/mappings/NativeBase/Media.js +56 -0
- package/src/mappings/NativeBase/Media.ts +65 -0
- package/src/mappings/NativeBase/Menu.js +134 -0
- package/src/mappings/NativeBase/Menu.ts +150 -0
- package/src/mappings/NativeBase/Modal.js +103 -0
- package/src/mappings/NativeBase/Modal.ts +118 -0
- package/src/mappings/NativeBase/Other.js +123 -0
- package/src/mappings/NativeBase/Other.ts +139 -0
- package/src/mappings/NativeBase/Popover.js +123 -0
- package/src/mappings/NativeBase/Popover.ts +136 -0
- package/src/mappings/NativeBase/Select.js +71 -0
- package/src/mappings/NativeBase/Select.ts +85 -0
- package/src/mappings/NativeBase/Slider.js +89 -0
- package/src/mappings/NativeBase/Slider.ts +105 -0
- package/lib/commonjs/mappings/DatePickerModal.js +0 -74
- package/lib/module/mappings/DatePickerModal.js +0 -65
- package/lib/typescript/src/mappings/DatePickerModal.d.ts +0 -153
- package/lib/typescript/src/mappings/DatePickerModal.d.ts.map +0 -1
- package/src/mappings/DatePickerModal.js +0 -73
- package/src/mappings/DatePickerModal.ts +0 -91
|
@@ -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, Pressable, ActivityIndicator, Platform } from "react-native";
|
|
3
4
|
import { withTheme } from "../theming";
|
|
@@ -24,7 +25,7 @@ const FAB = _ref => {
|
|
|
24
25
|
borderRadius: size / 2,
|
|
25
26
|
overflow: "hidden"
|
|
26
27
|
}, style]
|
|
27
|
-
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
28
29
|
onPress: onPress,
|
|
29
30
|
disabled: loading || disabled,
|
|
30
31
|
android_ripple: {
|
|
@@ -42,9 +43,8 @@ const FAB = _ref => {
|
|
|
42
43
|
borderRadius: size / 2,
|
|
43
44
|
backgroundColor
|
|
44
45
|
}];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
}, /*#__PURE__*/React.createElement(View, null, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
46
|
+
}
|
|
47
|
+
}, props), /*#__PURE__*/React.createElement(View, null, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
48
48
|
style: size > 50 ? {
|
|
49
49
|
marginTop: 2,
|
|
50
50
|
marginLeft: 2
|
|
@@ -70,22 +70,4 @@ const styles = StyleSheet.create({
|
|
|
70
70
|
})
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
export default withTheme(FAB); name: iconName,
|
|
74
|
-
size: size,
|
|
75
|
-
color: color
|
|
76
|
-
}))));
|
|
77
|
-
};
|
|
78
|
-
const styles = StyleSheet.create({
|
|
79
|
-
button: {
|
|
80
|
-
backgroundColor: "#5a45ff",
|
|
81
|
-
justifyContent: "center",
|
|
82
|
-
alignItems: "center",
|
|
83
|
-
...Platform.select({
|
|
84
|
-
web: {
|
|
85
|
-
cursor: "pointer",
|
|
86
|
-
userSelect: "none"
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
73
|
export default withTheme(FAB);
|
|
@@ -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,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 { Picker as NativePicker } from "@react-native-picker/picker";
|
|
@@ -7,6 +8,7 @@ import { extractStyles } from "../../utilities";
|
|
|
7
8
|
import TextField from "../TextField";
|
|
8
9
|
import Touchable from "../Touchable";
|
|
9
10
|
const Picker = _ref => {
|
|
11
|
+
var _options$find$label, _options$find;
|
|
10
12
|
let {
|
|
11
13
|
style,
|
|
12
14
|
options,
|
|
@@ -16,7 +18,6 @@ const Picker = _ref => {
|
|
|
16
18
|
onValueChange: onValueChangeOverride = () => {},
|
|
17
19
|
...props
|
|
18
20
|
} = _ref;
|
|
19
|
-
var _a, _b;
|
|
20
21
|
const {
|
|
21
22
|
viewStyles: {
|
|
22
23
|
borderRadius,
|
|
@@ -61,7 +62,7 @@ const Picker = _ref => {
|
|
|
61
62
|
};
|
|
62
63
|
|
|
63
64
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
64
|
-
const selectedLabel = selectedValue && ((
|
|
65
|
+
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);
|
|
65
66
|
return /*#__PURE__*/React.createElement(Touchable, {
|
|
66
67
|
disabled: disabled,
|
|
67
68
|
onPress: toggleFocus,
|
|
@@ -84,25 +85,6 @@ const Picker = _ref => {
|
|
|
84
85
|
label: o.label,
|
|
85
86
|
value: o.value,
|
|
86
87
|
key: o.value
|
|
87
|
-
}))), /*#__PURE__*/React.createElement(View, {
|
|
88
|
-
pointerEvents: "none"
|
|
89
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
90
|
-
...props,
|
|
91
|
-
value: selectedLabel,
|
|
92
|
-
placeholder: placeholder,
|
|
93
|
-
// @ts-ignore
|
|
94
|
-
ref: textField,
|
|
95
|
-
disabled: disabled,
|
|
96
|
-
// @ts-expect-error
|
|
97
|
-
style: stylesWithoutMargin
|
|
98
|
-
}))));
|
|
99
|
-
};
|
|
100
|
-
const styles = StyleSheet.create({
|
|
101
|
-
container: {
|
|
102
|
-
alignSelf: "stretch"
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
export default withTheme(Picker);y: o.value
|
|
106
88
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
107
89
|
pointerEvents: "none"
|
|
108
90
|
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
@@ -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 { Switch as NativeSwitch } from "react-native";
|
|
3
4
|
import { withTheme } from "../theming";
|
|
@@ -28,6 +29,7 @@ function Switch(_ref) {
|
|
|
28
29
|
setChecked(value);
|
|
29
30
|
}
|
|
30
31
|
}, [value, checked]);
|
|
32
|
+
|
|
31
33
|
// This special logic is to handle weird APIs like Airtable that return
|
|
32
34
|
// true or undefined for a boolean
|
|
33
35
|
const previousDefaultValue = usePrevious(defaultValue);
|
|
@@ -36,24 +38,24 @@ function Switch(_ref) {
|
|
|
36
38
|
setChecked(Boolean(defaultValue));
|
|
37
39
|
}
|
|
38
40
|
}, [defaultValue, previousDefaultValue]);
|
|
39
|
-
return /*#__PURE__*/React.createElement(NativeSwitch, {
|
|
41
|
+
return /*#__PURE__*/React.createElement(NativeSwitch, _extends({
|
|
40
42
|
value: checked,
|
|
41
43
|
disabled: disabled,
|
|
42
44
|
trackColor: {
|
|
43
45
|
false: inactiveTrackThemeColor,
|
|
44
46
|
true: activeTrackThemeColor
|
|
45
47
|
},
|
|
46
|
-
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
|
|
48
|
+
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
|
|
47
49
|
// @ts-ignore react-native-web only
|
|
50
|
+
,
|
|
48
51
|
activeThumbColor: activeThumbThemeColor,
|
|
49
52
|
ios_backgroundColor: inactiveTrackThemeColor,
|
|
50
53
|
style: style,
|
|
51
54
|
onValueChange: bool => {
|
|
52
55
|
setChecked(bool);
|
|
53
56
|
onValueChange && onValueChange(bool);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
+
}
|
|
58
|
+
}, rest));
|
|
57
59
|
}
|
|
58
60
|
function Row(_ref2) {
|
|
59
61
|
let {
|
|
@@ -82,7 +84,7 @@ function Row(_ref2) {
|
|
|
82
84
|
setChecked(defaultValue);
|
|
83
85
|
}
|
|
84
86
|
}, [defaultValue]);
|
|
85
|
-
return /*#__PURE__*/React.createElement(FormRow, {
|
|
87
|
+
return /*#__PURE__*/React.createElement(FormRow, _extends({
|
|
86
88
|
disabled: disabled,
|
|
87
89
|
onPress: () => {
|
|
88
90
|
setChecked(!checked);
|
|
@@ -90,9 +92,8 @@ function Row(_ref2) {
|
|
|
90
92
|
},
|
|
91
93
|
label: label,
|
|
92
94
|
direction: direction,
|
|
93
|
-
style: style
|
|
94
|
-
|
|
95
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
95
|
+
style: style
|
|
96
|
+
}, rest), /*#__PURE__*/React.createElement(Switch, {
|
|
96
97
|
theme: theme,
|
|
97
98
|
value: checked,
|
|
98
99
|
disabled: disabled,
|
|
@@ -105,16 +106,4 @@ function Row(_ref2) {
|
|
|
105
106
|
}
|
|
106
107
|
const SwitchRow = withTheme(Row);
|
|
107
108
|
export { SwitchRow };
|
|
108
|
-
export default withTheme(Switch);: theme,
|
|
109
|
-
value: checked,
|
|
110
|
-
disabled: disabled,
|
|
111
|
-
onValueChange: onValueChange,
|
|
112
|
-
activeTrackColor: activeTrackColor,
|
|
113
|
-
inactiveTrackColor: inactiveTrackColor,
|
|
114
|
-
activeThumbColor: activeThumbColor,
|
|
115
|
-
inactiveThumbColor: inactiveThumbColor
|
|
116
|
-
}));
|
|
117
|
-
}
|
|
118
|
-
const SwitchRow = withTheme(Row);
|
|
119
|
-
export { SwitchRow };
|
|
120
109
|
export default withTheme(Switch);
|
|
@@ -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"
|
|
@@ -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 from "react";
|
|
2
3
|
import { Pressable } from "react-native";
|
|
3
4
|
export default function Touchable(_ref) {
|
|
@@ -8,24 +9,6 @@ export default function Touchable(_ref) {
|
|
|
8
9
|
style,
|
|
9
10
|
...props
|
|
10
11
|
} = _ref;
|
|
11
|
-
return /*#__PURE__*/React.createElement(Pressable, {
|
|
12
|
-
onPress: onPress,
|
|
13
|
-
disabled: disabled,
|
|
14
|
-
hitSlop: 8,
|
|
15
|
-
style: _ref2 => {
|
|
16
|
-
let {
|
|
17
|
-
pressed
|
|
18
|
-
} = _ref2;
|
|
19
|
-
return [{
|
|
20
|
-
opacity: pressed || disabled ? 0.75 : 1
|
|
21
|
-
}, style];
|
|
22
|
-
},
|
|
23
|
-
...props
|
|
24
|
-
}, children);
|
|
25
|
-
},
|
|
26
|
-
style,
|
|
27
|
-
...props
|
|
28
|
-
} = _ref;
|
|
29
12
|
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
30
13
|
onPress: onPress,
|
|
31
14
|
disabled: disabled,
|
package/lib/module/index.js
CHANGED
|
@@ -2,53 +2,143 @@ export { injectIcon } from "./interfaces/Icon";
|
|
|
2
2
|
export { withTheme, ThemeProvider } from "./theming";
|
|
3
3
|
export { default as Provider } from "./Provider";
|
|
4
4
|
export { default as DefaultTheme } from "./styles/DefaultTheme";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
/** Replaced By NativeBase
|
|
7
|
+
* export { default as Avatar } from "./components/CircleImage";
|
|
8
|
+
* export { default as Container } from "./components/Container";
|
|
9
|
+
* export { default as FAB } from "./components/FAB";
|
|
10
|
+
* export {
|
|
11
|
+
Center,
|
|
12
|
+
Circle,
|
|
13
|
+
Square,
|
|
14
|
+
Row,
|
|
15
|
+
Stack,
|
|
16
|
+
Spacer,
|
|
17
|
+
} from "./components/Layout";
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// BASIC
|
|
21
|
+
export { default as ScreenContainer } from "./components/ScreenContainer";
|
|
6
22
|
export { default as Banner } from "./components/Banner";
|
|
23
|
+
|
|
24
|
+
// BUTTONS
|
|
7
25
|
export { Button, ButtonSolid, ButtonOutline } from "./components/Button";
|
|
8
|
-
export {
|
|
9
|
-
export { default as AvatarEdit } from "./components/AvatarEdit";
|
|
10
|
-
export { default as Card } from "./components/Card";
|
|
11
|
-
export { default as Carousel } from "./components/Carousel";
|
|
12
|
-
export { Checkbox, CheckboxGroup, CheckboxRow } from "./components/Checkbox";
|
|
13
|
-
export { default as CircleImage } from "./components/CircleImage";
|
|
14
|
-
export { default as Container } from "./components/Container";
|
|
15
|
-
export { default as Divider } from "./components/Divider";
|
|
16
|
-
export { default as FAB } from "./components/FAB";
|
|
17
|
-
export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
|
|
26
|
+
export { Link } from "./components/Text";
|
|
18
27
|
export { default as IconButton } from "./components/IconButton";
|
|
19
|
-
export { default as
|
|
20
|
-
export { default as
|
|
28
|
+
export { default as Touchable } from "./components/Touchable";
|
|
29
|
+
export { default as ToggleButton } from "./components/ToggleButton";
|
|
30
|
+
|
|
31
|
+
// INPUTS
|
|
32
|
+
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
21
33
|
export { default as NumberInput } from "./components/NumberInput";
|
|
22
|
-
export { default as
|
|
34
|
+
export { default as TextField } from "./components/TextField";
|
|
35
|
+
export { default as FieldSearchBarFull } from "./components/FieldSearchBarFull";
|
|
36
|
+
export { default as Picker } from "./components/Picker/Picker";
|
|
37
|
+
|
|
38
|
+
// CONTROLS
|
|
39
|
+
export { Checkbox, CheckboxGroup, CheckboxRow } from "./components/Checkbox";
|
|
40
|
+
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
41
|
+
export { default as Slider } from "./components/Slider";
|
|
42
|
+
export { default as Stepper } from "./components/Stepper";
|
|
23
43
|
export { default as StarRating } from "./components/StarRating";
|
|
24
|
-
export { default as Surface } from "./components/Surface";
|
|
25
44
|
export { default as Switch, SwitchRow } from "./components/Switch";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export { default as
|
|
45
|
+
|
|
46
|
+
// MEDIA
|
|
47
|
+
export { default as SVG } from "./components/SVG";
|
|
48
|
+
export { default as Image } from "./components/Image";
|
|
49
|
+
// export { default as Avatar } from "./components/CircleImage"; Replaced by NativeBase
|
|
50
|
+
export { default as AvatarEdit } from "./components/AvatarEdit";
|
|
51
|
+
export { default as CircleImage } from "./components/CircleImage";
|
|
52
|
+
|
|
53
|
+
// SWIPER
|
|
54
|
+
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
55
|
+
|
|
56
|
+
// CONTAINERS
|
|
29
57
|
export { AccordionGroup, AccordionItem } from "./components/Accordion";
|
|
58
|
+
export { default as Surface } from "./components/Surface";
|
|
59
|
+
|
|
60
|
+
// ACTIONSHEET
|
|
30
61
|
export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/ActionSheet";
|
|
31
|
-
export { Swiper, SwiperItem } from "./components/Swiper";
|
|
32
|
-
export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
|
|
33
|
-
export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
|
|
34
62
|
|
|
35
|
-
|
|
36
|
-
export { default as
|
|
37
|
-
export { default as
|
|
38
|
-
export { default as CardContainerRating } from "./components/CardContainerRating";
|
|
39
|
-
export { default as CardInline } from "./components/CardInline";
|
|
40
|
-
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
63
|
+
// OTHER
|
|
64
|
+
export { default as Carousel } from "./components/Carousel";
|
|
65
|
+
export { default as Divider } from "./components/Divider";
|
|
41
66
|
export { default as HeaderLarge } from "./components/HeaderLarge";
|
|
42
67
|
export { default as HeaderMedium } from "./components/HeaderMedium";
|
|
43
68
|
export { default as HeaderOverline } from "./components/HeaderOverline";
|
|
44
|
-
export { default as Picker } from "./components/Picker/Picker";
|
|
45
69
|
export { default as ProgressBar } from "./components/ProgressBar";
|
|
46
70
|
export { default as ProgressCircle } from "./components/ProgressCircle";
|
|
47
71
|
export { default as RowBodyIcon } from "./components/RowBodyIcon";
|
|
48
72
|
export { default as RowHeadlineImageCaption } from "./components/RowHeadlineImageCaption";
|
|
49
73
|
export { default as RowHeadlineImageIcon } from "./components/RowHeadlineImageIcon";
|
|
50
|
-
export { default as
|
|
51
|
-
export { default as
|
|
74
|
+
export { default as Card } from "./components/Card";
|
|
75
|
+
export { default as CardBlock } from "./components/CardBlock";
|
|
76
|
+
export { default as CardContainer } from "./components/CardContainer";
|
|
77
|
+
export { default as CardContainerRating } from "./components/CardContainerRating";
|
|
78
|
+
export { default as CardInline } from "./components/CardInline";
|
|
52
79
|
export { useAuthState } from "./components/useAuthState";
|
|
53
80
|
|
|
54
|
-
|
|
81
|
+
/**
|
|
82
|
+
* NativeBase Components Jan 2023
|
|
83
|
+
*
|
|
84
|
+
* ALERT
|
|
85
|
+
* - AlertDialog
|
|
86
|
+
* - AlertDialog.Header
|
|
87
|
+
* - AlertDialog.Body
|
|
88
|
+
* - AlertDialog.Footer
|
|
89
|
+
* - AlertDialog.Content
|
|
90
|
+
* - AlertDialog.CloseButton
|
|
91
|
+
*
|
|
92
|
+
* FORMS
|
|
93
|
+
* - Button -- COMMENTED OUT
|
|
94
|
+
* - Button.Group -- COMMENTED OUT
|
|
95
|
+
* - Fab
|
|
96
|
+
*
|
|
97
|
+
* DATA DISPLAY
|
|
98
|
+
* - Badge
|
|
99
|
+
* - Divider
|
|
100
|
+
*
|
|
101
|
+
* FEEDBACK
|
|
102
|
+
* - Alert
|
|
103
|
+
* - Alert.Icon
|
|
104
|
+
* - Progress
|
|
105
|
+
*
|
|
106
|
+
* LAYOUT
|
|
107
|
+
* - AspectRatio
|
|
108
|
+
* - Box
|
|
109
|
+
* - Center
|
|
110
|
+
* - Square
|
|
111
|
+
* - Circle
|
|
112
|
+
* - Column
|
|
113
|
+
* - Container
|
|
114
|
+
* - Flex
|
|
115
|
+
* - Spacer
|
|
116
|
+
* - Row
|
|
117
|
+
* - Stack
|
|
118
|
+
* - ZStack
|
|
119
|
+
*
|
|
120
|
+
* MEDIA
|
|
121
|
+
* - Avatar
|
|
122
|
+
* - Avatar.Badge
|
|
123
|
+
* - Avatar.Group
|
|
124
|
+
*
|
|
125
|
+
* MENU
|
|
126
|
+
* - Menu
|
|
127
|
+
* - Menu.Item
|
|
128
|
+
* - Menu.Group
|
|
129
|
+
* - Menu.OptionGroup
|
|
130
|
+
* - Menu.ItemOption
|
|
131
|
+
* - Menu.Trigger
|
|
132
|
+
*
|
|
133
|
+
* MODAL
|
|
134
|
+
* - Modal
|
|
135
|
+
* - Modal.Content
|
|
136
|
+
* - Modal.Header
|
|
137
|
+
* - Modal.Footer
|
|
138
|
+
* - Modal.Body
|
|
139
|
+
* - Modal.CloseButton
|
|
140
|
+
*
|
|
141
|
+
* OTHER
|
|
142
|
+
* - Tooltip
|
|
143
|
+
*
|
|
144
|
+
* */
|