@draftbit/core 46.10.3-7afc5f.2 → 46.10.3-84bbff.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/Banner.js +23 -4
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +22 -4
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +127 -111
- package/lib/commonjs/components/Button.js +33 -10
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -4
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +5 -23
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +6 -23
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +1 -4
- package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
- package/lib/commonjs/components/Divider.js +14 -1
- package/lib/commonjs/components/FAB.js +18 -4
- package/lib/commonjs/components/Layout.js +40 -19
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +36 -11
- package/lib/commonjs/components/Portal/Portal.js +27 -3
- package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
- package/lib/commonjs/components/Pressable.js +15 -2
- 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/Switch.js +19 -10
- package/lib/commonjs/components/TabView/TabView.js +13 -7
- package/lib/commonjs/components/Table/Table.js +5 -5
- package/lib/commonjs/components/Table/TableRow.js +1 -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/mappings/FieldSearchBarFull.js +3 -1
- package/lib/commonjs/mappings/StarRating.js +6 -2
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/module/components/Accordion/AccordionItem.js +25 -4
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/AspectRatio.js +18 -1
- package/lib/module/components/AvatarEdit.js +15 -4
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +124 -111
- package/lib/module/components/Checkbox/CheckboxGroup.js +16 -2
- package/lib/module/components/DeprecatedButton.js +21 -3
- package/lib/module/components/DeprecatedCardWrapper.js +18 -1
- package/lib/module/components/Picker/PickerComponent.android.js +21 -3
- package/lib/module/components/Picker/PickerComponent.ios.js +36 -11
- package/lib/module/components/Portal/PortalHost.js +45 -15
- package/lib/module/components/RadioButton/RadioButton.js +13 -1
- package/lib/module/components/RadioButton/RadioButtonGroup.js +16 -2
- package/lib/module/components/RadioButton/RadioButtonRow.js +24 -5
- package/lib/module/components/Surface.js +15 -1
- package/lib/module/components/TabView/TabView.js +17 -7
- package/lib/module/components/Touchable.js +15 -2
- package/lib/module/constants.js +1 -0
- package/lib/module/hooks.js +1 -2
- package/package.json +3 -3
|
@@ -10,9 +10,7 @@ var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
|
10
10
|
var _theming = require("../theming");
|
|
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
13
|
function ScreenContainer(_ref) {
|
|
15
|
-
var _StyleSheet$flatten;
|
|
16
14
|
let {
|
|
17
15
|
scrollable = false,
|
|
18
16
|
hasSafeArea = false,
|
|
@@ -23,7 +21,8 @@ function ScreenContainer(_ref) {
|
|
|
23
21
|
children,
|
|
24
22
|
...rest
|
|
25
23
|
} = _ref;
|
|
26
|
-
|
|
24
|
+
var _a;
|
|
25
|
+
const backgroundColor = ((_a = _reactNative.StyleSheet.flatten(style)) === null || _a === void 0 ? void 0 : _a.backgroundColor) || theme.colors.background;
|
|
27
26
|
const edges = ["left", "right"];
|
|
28
27
|
if (hasSafeArea || hasTopSafeArea) {
|
|
29
28
|
edges.push("top");
|
|
@@ -31,12 +30,13 @@ function ScreenContainer(_ref) {
|
|
|
31
30
|
if (hasSafeArea || hasBottomSafeArea) {
|
|
32
31
|
edges.push("bottom");
|
|
33
32
|
}
|
|
34
|
-
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView,
|
|
33
|
+
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
|
|
35
34
|
edges: edges,
|
|
36
35
|
style: [styles.container, {
|
|
37
36
|
backgroundColor
|
|
38
|
-
}]
|
|
39
|
-
|
|
37
|
+
}],
|
|
38
|
+
...rest
|
|
39
|
+
}, scrollable ? /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
|
|
40
40
|
contentContainerStyle: [styles.scrollViewContainer, {
|
|
41
41
|
backgroundColor
|
|
42
42
|
}, style]
|
|
@@ -56,4 +56,22 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
var _default = (0, _theming.withTheme)(ScreenContainer);
|
|
59
|
+
exports.default = _default;olor
|
|
60
|
+
}, style]
|
|
61
|
+
}, children) : /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
62
|
+
style: [styles.container, {
|
|
63
|
+
backgroundColor
|
|
64
|
+
}, style]
|
|
65
|
+
}, children));
|
|
66
|
+
}
|
|
67
|
+
const styles = _reactNative.StyleSheet.create({
|
|
68
|
+
container: {
|
|
69
|
+
flex: 1
|
|
70
|
+
},
|
|
71
|
+
scrollViewContainer: {
|
|
72
|
+
flexGrow: 1,
|
|
73
|
+
flex: undefined
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
var _default = (0, _theming.withTheme)(ScreenContainer);
|
|
59
77
|
exports.default = _default;
|
|
@@ -7,7 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNativeShadow = require("react-native-shadow-2");
|
|
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
|
const Shadow = _ref => {
|
|
12
11
|
let {
|
|
13
12
|
offsetX = 0,
|
|
@@ -24,7 +23,7 @@ const Shadow = _ref => {
|
|
|
24
23
|
style,
|
|
25
24
|
...rest
|
|
26
25
|
} = _ref;
|
|
27
|
-
return /*#__PURE__*/_react.default.createElement(_reactNativeShadow.Shadow,
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativeShadow.Shadow, {
|
|
28
27
|
offset: [offsetX, offsetY],
|
|
29
28
|
sides: {
|
|
30
29
|
start: showShadowSideStart,
|
|
@@ -39,6 +38,20 @@ const Shadow = _ref => {
|
|
|
39
38
|
bottomEnd: showShadowCornerBottomEnd
|
|
40
39
|
},
|
|
41
40
|
containerStyle: style,
|
|
41
|
+
paintInside: paintInside,
|
|
42
|
+
...rest
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var _default = Shadow;
|
|
46
|
+
exports.default = _default;showShadowSideBottom
|
|
47
|
+
},
|
|
48
|
+
corners: {
|
|
49
|
+
topStart: showShadowCornerTopStart,
|
|
50
|
+
topEnd: showShadowCornerTopEnd,
|
|
51
|
+
bottomStart: showShadowCornerBottomStart,
|
|
52
|
+
bottomEnd: showShadowCornerBottomEnd
|
|
53
|
+
},
|
|
54
|
+
containerStyle: style,
|
|
42
55
|
paintInside: paintInside
|
|
43
56
|
}, rest));
|
|
44
57
|
};
|
|
@@ -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;
|
|
@@ -13,7 +13,6 @@ var _hooks = require("../hooks");
|
|
|
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 Switch(_ref) {
|
|
18
17
|
let {
|
|
19
18
|
value,
|
|
@@ -38,7 +37,6 @@ function Switch(_ref) {
|
|
|
38
37
|
setChecked(value);
|
|
39
38
|
}
|
|
40
39
|
}, [value, checked]);
|
|
41
|
-
|
|
42
40
|
// This special logic is to handle weird APIs like Airtable that return
|
|
43
41
|
// true or undefined for a boolean
|
|
44
42
|
const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
|
|
@@ -47,24 +45,24 @@ function Switch(_ref) {
|
|
|
47
45
|
setChecked(Boolean(defaultValue));
|
|
48
46
|
}
|
|
49
47
|
}, [defaultValue, previousDefaultValue]);
|
|
50
|
-
return /*#__PURE__*/React.createElement(_reactNative.Switch,
|
|
48
|
+
return /*#__PURE__*/React.createElement(_reactNative.Switch, {
|
|
51
49
|
value: checked,
|
|
52
50
|
disabled: disabled,
|
|
53
51
|
trackColor: {
|
|
54
52
|
false: inactiveTrackThemeColor,
|
|
55
53
|
true: activeTrackThemeColor
|
|
56
54
|
},
|
|
57
|
-
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
|
|
55
|
+
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
|
|
58
56
|
// @ts-ignore react-native-web only
|
|
59
|
-
,
|
|
60
57
|
activeThumbColor: activeThumbThemeColor,
|
|
61
58
|
ios_backgroundColor: inactiveTrackThemeColor,
|
|
62
59
|
style: style,
|
|
63
60
|
onValueChange: bool => {
|
|
64
61
|
setChecked(bool);
|
|
65
62
|
onValueChange && onValueChange(bool);
|
|
66
|
-
}
|
|
67
|
-
|
|
63
|
+
},
|
|
64
|
+
...rest
|
|
65
|
+
});
|
|
68
66
|
}
|
|
69
67
|
function Row(_ref2) {
|
|
70
68
|
let {
|
|
@@ -93,7 +91,7 @@ function Row(_ref2) {
|
|
|
93
91
|
setChecked(defaultValue);
|
|
94
92
|
}
|
|
95
93
|
}, [defaultValue]);
|
|
96
|
-
return /*#__PURE__*/React.createElement(_FormRow.default,
|
|
94
|
+
return /*#__PURE__*/React.createElement(_FormRow.default, {
|
|
97
95
|
disabled: disabled,
|
|
98
96
|
onPress: () => {
|
|
99
97
|
setChecked(!checked);
|
|
@@ -101,8 +99,9 @@ function Row(_ref2) {
|
|
|
101
99
|
},
|
|
102
100
|
label: label,
|
|
103
101
|
direction: direction,
|
|
104
|
-
style: style
|
|
105
|
-
|
|
102
|
+
style: style,
|
|
103
|
+
...rest
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
106
105
|
theme: theme,
|
|
107
106
|
value: checked,
|
|
108
107
|
disabled: disabled,
|
|
@@ -116,4 +115,14 @@ function Row(_ref2) {
|
|
|
116
115
|
const SwitchRow = (0, _theming.withTheme)(Row);
|
|
117
116
|
exports.SwitchRow = SwitchRow;
|
|
118
117
|
var _default = (0, _theming.withTheme)(Switch);
|
|
118
|
+
exports.default = _default;hange: onValueChange,
|
|
119
|
+
activeTrackColor: activeTrackColor,
|
|
120
|
+
inactiveTrackColor: inactiveTrackColor,
|
|
121
|
+
activeThumbColor: activeThumbColor,
|
|
122
|
+
inactiveThumbColor: inactiveThumbColor
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
const SwitchRow = (0, _theming.withTheme)(Row);
|
|
126
|
+
exports.SwitchRow = SwitchRow;
|
|
127
|
+
var _default = (0, _theming.withTheme)(Switch);
|
|
119
128
|
exports.default = _default;
|
|
@@ -10,7 +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
13
|
const TabViewComponent = _ref => {
|
|
15
14
|
let {
|
|
16
15
|
Icon,
|
|
@@ -36,13 +35,11 @@ const TabViewComponent = _ref => {
|
|
|
36
35
|
textStyles,
|
|
37
36
|
viewStyles
|
|
38
37
|
} = (0, _utilities.extractStyles)(style);
|
|
39
|
-
|
|
40
38
|
//Check type of child using props
|
|
41
39
|
//Regular '.type' cannot work because Draftbit strips the type in Draft view
|
|
42
40
|
const instanceOfTabViewItemProps = object => {
|
|
43
41
|
return "title" in object;
|
|
44
42
|
};
|
|
45
|
-
|
|
46
43
|
//Populate routes and scenes based on children
|
|
47
44
|
React.useEffect(() => {
|
|
48
45
|
const newRoutes = [];
|
|
@@ -68,7 +65,8 @@ const TabViewComponent = _ref => {
|
|
|
68
65
|
}
|
|
69
66
|
};
|
|
70
67
|
const renderTabBar = props => {
|
|
71
|
-
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar,
|
|
68
|
+
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, {
|
|
69
|
+
...props,
|
|
72
70
|
activeColor: activeColor || theme.colors.primary,
|
|
73
71
|
inactiveColor: inactiveColor || theme.colors.divider,
|
|
74
72
|
pressColor: pressColor || theme.colors.primary,
|
|
@@ -82,7 +80,7 @@ const TabViewComponent = _ref => {
|
|
|
82
80
|
route,
|
|
83
81
|
color
|
|
84
82
|
} = _ref2;
|
|
85
|
-
return route
|
|
83
|
+
return (route === null || route === void 0 ? void 0 : route.icon) ? /*#__PURE__*/React.createElement(Icon, {
|
|
86
84
|
name: route.icon,
|
|
87
85
|
color: color,
|
|
88
86
|
size: 16
|
|
@@ -91,9 +89,8 @@ const TabViewComponent = _ref => {
|
|
|
91
89
|
style: {
|
|
92
90
|
backgroundColor: tabsBackgroundColor || theme.colors.background
|
|
93
91
|
}
|
|
94
|
-
})
|
|
92
|
+
});
|
|
95
93
|
};
|
|
96
|
-
|
|
97
94
|
//Cannot render TabView without at least one tab
|
|
98
95
|
if (!routes.length) {
|
|
99
96
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
@@ -113,4 +110,13 @@ const TabViewComponent = _ref => {
|
|
|
113
110
|
});
|
|
114
111
|
};
|
|
115
112
|
var _default = (0, _theming.withTheme)(TabViewComponent);
|
|
113
|
+
exports.default = _default; renderScene: (0, _reactNativeTabView.SceneMap)(tabScenes),
|
|
114
|
+
renderTabBar: renderTabBar,
|
|
115
|
+
onIndexChange: indexChangeHandler,
|
|
116
|
+
tabBarPosition: tabBarPosition,
|
|
117
|
+
keyboardDismissMode: keyboardDismissMode,
|
|
118
|
+
swipeEnabled: swipeEnabled
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
var _default = (0, _theming.withTheme)(TabViewComponent);
|
|
116
122
|
exports.default = _default;
|
|
@@ -39,7 +39,6 @@ const Table = _ref => {
|
|
|
39
39
|
return object.isTableHeader;
|
|
40
40
|
}, []);
|
|
41
41
|
const isRenderItem = data && renderItem;
|
|
42
|
-
|
|
43
42
|
//Uses 'renderItem' and 'data' to create an array of children
|
|
44
43
|
const dataAsChildren = _react.default.useMemo(() => {
|
|
45
44
|
if (!isRenderItem) return [];
|
|
@@ -64,7 +63,7 @@ const Table = _ref => {
|
|
|
64
63
|
const nestedChildren = _react.default.Children.toArray(item.props.children);
|
|
65
64
|
//Header can be nested in React.Fragment when in renderItem
|
|
66
65
|
const nestedHeaders = nestedChildren.filter(child => isTableHeader(child.props));
|
|
67
|
-
if (nestedHeaders
|
|
66
|
+
if (nestedHeaders === null || nestedHeaders === void 0 ? void 0 : nestedHeaders.length) {
|
|
68
67
|
//New element excluding header children
|
|
69
68
|
return /*#__PURE__*/_react.default.cloneElement(item, {
|
|
70
69
|
children: nestedChildren.filter(child => !isTableHeader(child.props))
|
|
@@ -79,7 +78,7 @@ const Table = _ref => {
|
|
|
79
78
|
const nestedChildren = _react.default.Children.toArray(item.props.children);
|
|
80
79
|
//Header can be nested in React.Fragment when in renderItem
|
|
81
80
|
const nestedHeaders = nestedChildren.filter(child => isTableHeader(child.props));
|
|
82
|
-
if (nestedHeaders
|
|
81
|
+
if (nestedHeaders === null || nestedHeaders === void 0 ? void 0 : nestedHeaders.length) {
|
|
83
82
|
return nestedHeaders[0];
|
|
84
83
|
}
|
|
85
84
|
return item;
|
|
@@ -111,7 +110,9 @@ const Table = _ref => {
|
|
|
111
110
|
value: contextValue
|
|
112
111
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
113
112
|
style: [styles.container, borderViewStyle, style]
|
|
114
|
-
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, header), /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView,
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, header), /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
|
|
114
|
+
...rest
|
|
115
|
+
}, childrenWithoutHeader)));
|
|
115
116
|
};
|
|
116
117
|
const styles = _reactNative.StyleSheet.create({
|
|
117
118
|
container: {
|
|
@@ -119,5 +120,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
119
120
|
}
|
|
120
121
|
});
|
|
121
122
|
var _default = (0, _theming.withTheme)(Table);
|
|
122
|
-
exports.default = _default;
|
|
123
123
|
exports.default = _default;
|
|
@@ -26,7 +26,6 @@ const TableRow = _ref => {
|
|
|
26
26
|
theme
|
|
27
27
|
} = _ref;
|
|
28
28
|
const parentContextValue = _react.default.useContext(_TableCommon.TableStyleContext);
|
|
29
|
-
|
|
30
29
|
//Create context to use and pass to children based on own props or fall back to parent provided context
|
|
31
30
|
const contextValue = {
|
|
32
31
|
borderColor: borderColor || parentContextValue.borderColor,
|
|
@@ -58,4 +57,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
59
|
var _default = (0, _theming.withTheme)(TableRow);
|
|
61
|
-
exports.default = _default
|
|
60
|
+
exports.default = _default;;
|
|
@@ -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
|
};
|