@draftbit/core 46.10.3-6f5759.2 → 46.10.3-877a3f.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/TabView/TabView.js +7 -13
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/mappings/NativeBase/Layout.js +6 -0
- package/lib/module/components/DeprecatedFAB.js +23 -3
- package/lib/module/components/Elevation.js +14 -2
- package/lib/module/mappings/NativeBase/Layout.js +6 -0
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +27 -0
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/mappings/NativeBase/Layout.js +6 -0
- package/src/mappings/NativeBase/Layout.ts +6 -0
|
@@ -10,6 +10,7 @@ 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); }
|
|
13
14
|
const TabViewComponent = _ref => {
|
|
14
15
|
let {
|
|
15
16
|
Icon,
|
|
@@ -35,11 +36,13 @@ const TabViewComponent = _ref => {
|
|
|
35
36
|
textStyles,
|
|
36
37
|
viewStyles
|
|
37
38
|
} = (0, _utilities.extractStyles)(style);
|
|
39
|
+
|
|
38
40
|
//Check type of child using props
|
|
39
41
|
//Regular '.type' cannot work because Draftbit strips the type in Draft view
|
|
40
42
|
const instanceOfTabViewItemProps = object => {
|
|
41
43
|
return "title" in object;
|
|
42
44
|
};
|
|
45
|
+
|
|
43
46
|
//Populate routes and scenes based on children
|
|
44
47
|
React.useEffect(() => {
|
|
45
48
|
const newRoutes = [];
|
|
@@ -65,8 +68,7 @@ const TabViewComponent = _ref => {
|
|
|
65
68
|
}
|
|
66
69
|
};
|
|
67
70
|
const renderTabBar = props => {
|
|
68
|
-
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, {
|
|
69
|
-
...props,
|
|
71
|
+
return /*#__PURE__*/React.createElement(_reactNativeTabView.TabBar, _extends({}, props, {
|
|
70
72
|
activeColor: activeColor || theme.colors.primary,
|
|
71
73
|
inactiveColor: inactiveColor || theme.colors.divider,
|
|
72
74
|
pressColor: pressColor || theme.colors.primary,
|
|
@@ -80,7 +82,7 @@ const TabViewComponent = _ref => {
|
|
|
80
82
|
route,
|
|
81
83
|
color
|
|
82
84
|
} = _ref2;
|
|
83
|
-
return
|
|
85
|
+
return route !== null && route !== void 0 && route.icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
84
86
|
name: route.icon,
|
|
85
87
|
color: color,
|
|
86
88
|
size: 16
|
|
@@ -89,8 +91,9 @@ const TabViewComponent = _ref => {
|
|
|
89
91
|
style: {
|
|
90
92
|
backgroundColor: tabsBackgroundColor || theme.colors.background
|
|
91
93
|
}
|
|
92
|
-
});
|
|
94
|
+
}));
|
|
93
95
|
};
|
|
96
|
+
|
|
94
97
|
//Cannot render TabView without at least one tab
|
|
95
98
|
if (!routes.length) {
|
|
96
99
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
@@ -110,13 +113,4 @@ const TabViewComponent = _ref => {
|
|
|
110
113
|
});
|
|
111
114
|
};
|
|
112
115
|
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);
|
|
122
116
|
exports.default = _default;
|
|
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
12
12
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
13
13
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
14
14
|
});
|
|
15
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
15
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;AR_HEIGHT;
|
|
@@ -44,6 +44,12 @@ const SEED_DATA = [{
|
|
|
44
44
|
name: "Container",
|
|
45
45
|
tag: "Container",
|
|
46
46
|
description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
|
|
47
|
+
props: {
|
|
48
|
+
centerContent: (0, _types.createBoolProp)({
|
|
49
|
+
label: "Center content",
|
|
50
|
+
description: "Center child elements based on their content width"
|
|
51
|
+
})
|
|
52
|
+
},
|
|
47
53
|
...SHARED_SEED_DATA
|
|
48
54
|
}, {
|
|
49
55
|
name: "Column",
|
|
@@ -1,4 +1,3 @@
|
|
|
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
1
|
import * as React from "react";
|
|
3
2
|
import { ActivityIndicator, View, StyleSheet, Pressable } from "react-native";
|
|
4
3
|
import color from "color";
|
|
@@ -97,7 +96,8 @@ const FAB = _ref => {
|
|
|
97
96
|
style: [{
|
|
98
97
|
elevation
|
|
99
98
|
}, style]
|
|
100
|
-
}, /*#__PURE__*/React.createElement(Pressable,
|
|
99
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
100
|
+
...rest,
|
|
101
101
|
onPress: onPress,
|
|
102
102
|
accessibilityState: {
|
|
103
103
|
disabled
|
|
@@ -105,7 +105,7 @@ const FAB = _ref => {
|
|
|
105
105
|
accessibilityRole: "button",
|
|
106
106
|
disabled: disabled || loading,
|
|
107
107
|
style: buttonStyles
|
|
108
|
-
}
|
|
108
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
109
109
|
style: styles.content
|
|
110
110
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
111
111
|
style: iconStyle
|
|
@@ -144,4 +144,24 @@ const styles = StyleSheet.create({
|
|
|
144
144
|
borderRadius: 0
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
|
+
export default withTheme(FAB);le: "solid"
|
|
148
|
+
},
|
|
149
|
+
content: {
|
|
150
|
+
flexDirection: "row",
|
|
151
|
+
alignItems: "center",
|
|
152
|
+
justifyContent: "center"
|
|
153
|
+
},
|
|
154
|
+
icon: {
|
|
155
|
+
alignItems: "center",
|
|
156
|
+
justifyContent: "center",
|
|
157
|
+
width: Config.buttonIconSize
|
|
158
|
+
},
|
|
159
|
+
fixed: {
|
|
160
|
+
left: 0,
|
|
161
|
+
right: 0,
|
|
162
|
+
bottom: 0,
|
|
163
|
+
height: 64,
|
|
164
|
+
borderRadius: 0
|
|
165
|
+
}
|
|
166
|
+
});
|
|
147
167
|
export default withTheme(FAB);
|
|
@@ -1,4 +1,3 @@
|
|
|
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
1
|
import * as React from "react";
|
|
3
2
|
import { Animated, StyleSheet, View } from "react-native";
|
|
4
3
|
import shadow from "../styles/shadow";
|
|
@@ -19,7 +18,20 @@ const Elevation = _ref => {
|
|
|
19
18
|
colors
|
|
20
19
|
} = theme;
|
|
21
20
|
const borderRadius = radius;
|
|
22
|
-
return /*#__PURE__*/React.createElement(Animated.View,
|
|
21
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
22
|
+
...rest,
|
|
23
|
+
style: [{
|
|
24
|
+
borderRadius,
|
|
25
|
+
backgroundColor: colors.surface
|
|
26
|
+
}, elevation ? shadow(elevation) : null, style]
|
|
27
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
style: {
|
|
29
|
+
overflow: "hidden",
|
|
30
|
+
borderRadius
|
|
31
|
+
}
|
|
32
|
+
}, children));
|
|
33
|
+
};
|
|
34
|
+
export default withTheme(Elevation);React.createElement(Animated.View, _extends({}, rest, {
|
|
23
35
|
style: [{
|
|
24
36
|
borderRadius,
|
|
25
37
|
backgroundColor: colors.surface
|
|
@@ -38,6 +38,12 @@ export const SEED_DATA = [{
|
|
|
38
38
|
name: "Container",
|
|
39
39
|
tag: "Container",
|
|
40
40
|
description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
|
|
41
|
+
props: {
|
|
42
|
+
centerContent: createBoolProp({
|
|
43
|
+
label: "Center content",
|
|
44
|
+
description: "Center child elements based on their content width"
|
|
45
|
+
})
|
|
46
|
+
},
|
|
41
47
|
...SHARED_SEED_DATA
|
|
42
48
|
}, {
|
|
43
49
|
name: "Column",
|
|
@@ -11,6 +11,7 @@ export declare const SEED_DATA: ({
|
|
|
11
11
|
required: boolean;
|
|
12
12
|
step: number;
|
|
13
13
|
};
|
|
14
|
+
centerContent?: undefined;
|
|
14
15
|
direction?: undefined;
|
|
15
16
|
reversed?: undefined;
|
|
16
17
|
isDisabled?: undefined;
|
|
@@ -29,6 +30,30 @@ export declare const SEED_DATA: ({
|
|
|
29
30
|
name: string;
|
|
30
31
|
tag: string;
|
|
31
32
|
description: string;
|
|
33
|
+
} | {
|
|
34
|
+
category: string;
|
|
35
|
+
packageName: string;
|
|
36
|
+
stylesPanelSections: string[];
|
|
37
|
+
name: string;
|
|
38
|
+
tag: string;
|
|
39
|
+
description: string;
|
|
40
|
+
props: {
|
|
41
|
+
centerContent: {
|
|
42
|
+
label: string;
|
|
43
|
+
description: string;
|
|
44
|
+
formType: string;
|
|
45
|
+
propType: string;
|
|
46
|
+
defaultValue: boolean;
|
|
47
|
+
editable: boolean;
|
|
48
|
+
required: boolean;
|
|
49
|
+
group: string;
|
|
50
|
+
};
|
|
51
|
+
ratio?: undefined;
|
|
52
|
+
direction?: undefined;
|
|
53
|
+
reversed?: undefined;
|
|
54
|
+
isDisabled?: undefined;
|
|
55
|
+
isInvalid?: undefined;
|
|
56
|
+
};
|
|
32
57
|
} | {
|
|
33
58
|
category: string;
|
|
34
59
|
packageName: string;
|
|
@@ -83,6 +108,7 @@ export declare const SEED_DATA: ({
|
|
|
83
108
|
group: string;
|
|
84
109
|
};
|
|
85
110
|
ratio?: undefined;
|
|
111
|
+
centerContent?: undefined;
|
|
86
112
|
};
|
|
87
113
|
category: string;
|
|
88
114
|
packageName: string;
|
|
@@ -103,6 +129,7 @@ export declare const SEED_DATA: ({
|
|
|
103
129
|
group: string;
|
|
104
130
|
};
|
|
105
131
|
ratio?: undefined;
|
|
132
|
+
centerContent?: undefined;
|
|
106
133
|
direction?: undefined;
|
|
107
134
|
isDisabled?: undefined;
|
|
108
135
|
isInvalid?: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/mappings/NativeBase/Layout.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../../src/mappings/NativeBase/Layout.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoHrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.10.3-
|
|
3
|
+
"version": "46.10.3-877a3f.2+877a3fa",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.10.3-
|
|
44
|
+
"@draftbit/types": "^46.10.3-877a3f.2+877a3fa",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
]
|
|
101
101
|
]
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "877a3fa2568c2a8c87bcac685df23e35a69f883e"
|
|
104
104
|
}
|
|
@@ -44,6 +44,12 @@ export const SEED_DATA = [
|
|
|
44
44
|
name: "Container",
|
|
45
45
|
tag: "Container",
|
|
46
46
|
description: "The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
|
|
47
|
+
props: {
|
|
48
|
+
centerContent: createBoolProp({
|
|
49
|
+
label: "Center content",
|
|
50
|
+
description: "Center child elements based on their content width",
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
47
53
|
...SHARED_SEED_DATA,
|
|
48
54
|
},
|
|
49
55
|
{
|
|
@@ -63,6 +63,12 @@ export const SEED_DATA = [
|
|
|
63
63
|
tag: "Container",
|
|
64
64
|
description:
|
|
65
65
|
"The Container restricts a content's width according to current breakpoint, while keeping the size fluid",
|
|
66
|
+
props: {
|
|
67
|
+
centerContent: createBoolProp({
|
|
68
|
+
label: "Center content",
|
|
69
|
+
description: "Center child elements based on their content width",
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
66
72
|
...SHARED_SEED_DATA,
|
|
67
73
|
},
|
|
68
74
|
{
|