@draftbit/core 46.2.2-d68360.1 → 46.2.3
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 +25 -5
- package/lib/commonjs/constants.js +1 -1
- package/lib/module/components/Checkbox/Checkbox.js +4 -2
- package/lib/module/components/Checkbox/CheckboxGroup.js +3 -17
- package/lib/module/components/CircularProgress.js +7 -15
- package/lib/module/components/DeprecatedButton.js +4 -21
- package/lib/module/components/Elevation.js +4 -15
- package/lib/module/components/FormRow.js +3 -17
- package/lib/module/components/Portal/PortalManager.js +12 -20
- package/lib/module/constants.js +0 -1
- package/package.json +3 -3
|
@@ -21,8 +21,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
-
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); }
|
|
25
|
-
|
|
26
24
|
const AccordionItem = _ref => {
|
|
27
25
|
let {
|
|
28
26
|
Icon,
|
|
@@ -37,9 +35,10 @@ const AccordionItem = _ref => {
|
|
|
37
35
|
textStyles,
|
|
38
36
|
viewStyles
|
|
39
37
|
} = (0, _utilities.extractStyles)(style);
|
|
40
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
41
|
-
style: [styles.container, viewStyles]
|
|
42
|
-
|
|
38
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
39
|
+
style: [styles.container, viewStyles],
|
|
40
|
+
...rest
|
|
41
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
43
42
|
style: styles.row
|
|
44
43
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
45
44
|
name: icon,
|
|
@@ -74,4 +73,25 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
74
73
|
|
|
75
74
|
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
76
75
|
|
|
76
|
+
exports.default = _default;StyleSheet.create({
|
|
77
|
+
container: {
|
|
78
|
+
padding: 8
|
|
79
|
+
},
|
|
80
|
+
row: {
|
|
81
|
+
flexDirection: "row",
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
paddingLeft: 8
|
|
84
|
+
},
|
|
85
|
+
item: {
|
|
86
|
+
marginVertical: 6,
|
|
87
|
+
paddingLeft: 8
|
|
88
|
+
},
|
|
89
|
+
content: {
|
|
90
|
+
flex: 1,
|
|
91
|
+
justifyContent: "center"
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
96
|
+
|
|
77
97
|
exports.default = _default;
|
|
@@ -16,4 +16,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
16
16
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
19
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
@@ -1,3 +1,5 @@
|
|
|
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
3
|
import * as React from "react";
|
|
2
4
|
import { View, StyleSheet } from "react-native";
|
|
3
5
|
import { useTheme } from "../../theming";
|
|
@@ -54,7 +56,7 @@ const Checkbox = _ref => {
|
|
|
54
56
|
}
|
|
55
57
|
};
|
|
56
58
|
|
|
57
|
-
return /*#__PURE__*/React.createElement(Touchable, {
|
|
59
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
|
|
58
60
|
onPress: handlePress,
|
|
59
61
|
disabled: disabled,
|
|
60
62
|
accessibilityState: {
|
|
@@ -66,7 +68,7 @@ const Checkbox = _ref => {
|
|
|
66
68
|
width: size,
|
|
67
69
|
height: size
|
|
68
70
|
}]
|
|
69
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
71
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
70
72
|
style: styles.icon,
|
|
71
73
|
name: internalValue ? checkedIcon : uncheckedIcon,
|
|
72
74
|
size: size,
|
|
@@ -1,3 +1,5 @@
|
|
|
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
3
|
import * as React from "react";
|
|
2
4
|
import { View } from "react-native";
|
|
3
5
|
import { checkboxGroupContext, Direction } from "./context";
|
|
@@ -25,23 +27,7 @@ const CheckboxGroup = _ref => {
|
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
29
|
-
style: [{
|
|
30
|
-
minHeight: 40
|
|
31
|
-
}, style],
|
|
32
|
-
...rest
|
|
33
|
-
}, /*#__PURE__*/React.createElement(Provider, {
|
|
34
|
-
value: {
|
|
35
|
-
values,
|
|
36
|
-
onValueChange,
|
|
37
|
-
direction
|
|
38
|
-
}
|
|
39
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
40
|
-
style: _containerStyle
|
|
41
|
-
}, children)));
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default CheckboxGroup;PURE__*/React.createElement(View, _extends({
|
|
30
|
+
return /*#__PURE__*/React.createElement(View, _extends({
|
|
45
31
|
style: [{
|
|
46
32
|
minHeight: 40
|
|
47
33
|
}, style]
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
1
3
|
import React from "react";
|
|
2
4
|
import { View } from "react-native";
|
|
3
5
|
import { Svg, Path, G } from "react-native-svg";
|
|
@@ -6,23 +8,23 @@ class CircularProgress extends React.Component {
|
|
|
6
8
|
constructor() {
|
|
7
9
|
super(...arguments);
|
|
8
10
|
|
|
9
|
-
this
|
|
11
|
+
_defineProperty(this, "polarToCartesian", (centerX, centerY, radius, angleInDegrees) => {
|
|
10
12
|
var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
|
|
11
13
|
return {
|
|
12
14
|
x: centerX + radius * Math.cos(angleInRadians),
|
|
13
15
|
y: centerY + radius * Math.sin(angleInRadians)
|
|
14
16
|
};
|
|
15
|
-
};
|
|
17
|
+
});
|
|
16
18
|
|
|
17
|
-
this
|
|
19
|
+
_defineProperty(this, "circlePath", (x, y, radius, startAngle, endAngle) => {
|
|
18
20
|
var start = this.polarToCartesian(x, y, radius, endAngle * 0.9999);
|
|
19
21
|
var end = this.polarToCartesian(x, y, radius, startAngle);
|
|
20
22
|
var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
|
|
21
23
|
var d = ["M", start.x, start.y, "A", radius, radius, 0, largeArcFlag, 0, end.x, end.y];
|
|
22
24
|
return d.join(" ");
|
|
23
|
-
};
|
|
25
|
+
});
|
|
24
26
|
|
|
25
|
-
this
|
|
27
|
+
_defineProperty(this, "clampFill", fill => Math.min(100, Math.max(0, fill)));
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
render() {
|
|
@@ -105,14 +107,4 @@ class CircularProgress extends React.Component {
|
|
|
105
107
|
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
export default CircularProgress;strokeLinecap: lineCap,
|
|
109
|
-
strokeDasharray: strokeDasharrayTint,
|
|
110
|
-
fill: "transparent"
|
|
111
|
-
}), cap)), children && /*#__PURE__*/React.createElement(View, {
|
|
112
|
-
style: localChildrenContainerStyle
|
|
113
|
-
}, children(fill)));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
110
|
export default CircularProgress;
|
|
@@ -1,3 +1,5 @@
|
|
|
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
3
|
import * as React from "react";
|
|
2
4
|
import { ActivityIndicator, View, Text, StyleSheet } from "react-native";
|
|
3
5
|
import color from "color";
|
|
@@ -105,7 +107,7 @@ const Button = _ref => {
|
|
|
105
107
|
alignSelf: "stretch",
|
|
106
108
|
...margins
|
|
107
109
|
}
|
|
108
|
-
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
110
|
+
}, /*#__PURE__*/React.createElement(Touchable, _extends({}, rest, {
|
|
109
111
|
onPress: onPress,
|
|
110
112
|
accessibilityState: {
|
|
111
113
|
disabled
|
|
@@ -113,7 +115,7 @@ const Button = _ref => {
|
|
|
113
115
|
accessibilityRole: "button",
|
|
114
116
|
disabled: disabled || loading,
|
|
115
117
|
style: [styles.button, buttonStyle, innerStyles]
|
|
116
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
118
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
117
119
|
style: styles.content
|
|
118
120
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
119
121
|
style: iconStyle
|
|
@@ -131,25 +133,6 @@ const Button = _ref => {
|
|
|
131
133
|
}, children))));
|
|
132
134
|
};
|
|
133
135
|
|
|
134
|
-
const styles = StyleSheet.create({
|
|
135
|
-
button: {
|
|
136
|
-
minWidth: 64,
|
|
137
|
-
borderStyle: "solid"
|
|
138
|
-
},
|
|
139
|
-
content: {
|
|
140
|
-
flexDirection: "row",
|
|
141
|
-
alignItems: "center",
|
|
142
|
-
justifyContent: "center"
|
|
143
|
-
},
|
|
144
|
-
icon: {
|
|
145
|
-
width: Config.buttonIconSize
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
export default withTheme(Button);ines: 1,
|
|
149
|
-
style: [textStyle, typography.button]
|
|
150
|
-
}, children))));
|
|
151
|
-
};
|
|
152
|
-
|
|
153
136
|
const styles = StyleSheet.create({
|
|
154
137
|
button: {
|
|
155
138
|
minWidth: 64,
|
|
@@ -1,9 +1,11 @@
|
|
|
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
3
|
import * as React from "react";
|
|
2
4
|
import { Animated, StyleSheet, View } from "react-native";
|
|
3
5
|
import shadow from "../styles/shadow";
|
|
4
6
|
import { withTheme } from "../theming";
|
|
5
|
-
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
6
7
|
|
|
8
|
+
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
7
9
|
const Elevation = _ref => {
|
|
8
10
|
let {
|
|
9
11
|
style,
|
|
@@ -19,20 +21,7 @@ const Elevation = _ref => {
|
|
|
19
21
|
colors
|
|
20
22
|
} = theme;
|
|
21
23
|
const borderRadius = radius;
|
|
22
|
-
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
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
|
-
|
|
35
|
-
export default withTheme(Elevation);__*/React.createElement(Animated.View, _extends({}, rest, {
|
|
24
|
+
return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
|
|
36
25
|
style: [{
|
|
37
26
|
borderRadius,
|
|
38
27
|
backgroundColor: colors.surface
|
|
@@ -1,3 +1,5 @@
|
|
|
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
3
|
import * as React from "react";
|
|
2
4
|
import { Text, StyleSheet } from "react-native";
|
|
3
5
|
import { extractStyles } from "../utilities";
|
|
@@ -16,27 +18,11 @@ export default function FormRow(_ref) {
|
|
|
16
18
|
textStyles,
|
|
17
19
|
viewStyles
|
|
18
20
|
} = extractStyles(style);
|
|
19
|
-
return /*#__PURE__*/React.createElement(Touchable, {
|
|
21
|
+
return /*#__PURE__*/React.createElement(Touchable, _extends({
|
|
20
22
|
disabled: disabled,
|
|
21
23
|
onPress: onPress,
|
|
22
24
|
style: [styles.row, {
|
|
23
25
|
flexDirection: direction
|
|
24
|
-
}, viewStyles],
|
|
25
|
-
...rest
|
|
26
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
27
|
-
style: textStyles
|
|
28
|
-
}, label), children);
|
|
29
|
-
}
|
|
30
|
-
const styles = StyleSheet.create({
|
|
31
|
-
row: {
|
|
32
|
-
marginLeft: 8,
|
|
33
|
-
marginRight: 8,
|
|
34
|
-
flexDirection: "row",
|
|
35
|
-
justifyContent: "space-between",
|
|
36
|
-
alignItems: "center"
|
|
37
|
-
}
|
|
38
|
-
});[styles.row, {
|
|
39
|
-
flexDirection: direction
|
|
40
26
|
}, viewStyles]
|
|
41
27
|
}, rest), /*#__PURE__*/React.createElement(Text, {
|
|
42
28
|
style: textStyles
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { View, StyleSheet } from "react-native";
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
7
|
* Portal host is the component which actually renders all Portals.
|
|
5
8
|
*/
|
|
6
|
-
|
|
7
9
|
export default class PortalManager extends React.PureComponent {
|
|
8
10
|
constructor() {
|
|
9
11
|
super(...arguments);
|
|
10
|
-
|
|
12
|
+
|
|
13
|
+
_defineProperty(this, "state", {
|
|
11
14
|
portals: []
|
|
12
|
-
};
|
|
15
|
+
});
|
|
13
16
|
|
|
14
|
-
this
|
|
17
|
+
_defineProperty(this, "mount", (key, children) => {
|
|
15
18
|
this.setState(state => ({
|
|
16
19
|
portals: [...state.portals, {
|
|
17
20
|
key,
|
|
18
21
|
children
|
|
19
22
|
}]
|
|
20
23
|
}));
|
|
21
|
-
};
|
|
24
|
+
});
|
|
22
25
|
|
|
23
|
-
this
|
|
26
|
+
_defineProperty(this, "update", (key, children) => this.setState(state => ({
|
|
24
27
|
portals: state.portals.map(item => {
|
|
25
28
|
if (item.key === key) {
|
|
26
29
|
return { ...item,
|
|
@@ -30,11 +33,11 @@ export default class PortalManager extends React.PureComponent {
|
|
|
30
33
|
|
|
31
34
|
return item;
|
|
32
35
|
})
|
|
33
|
-
}));
|
|
36
|
+
})));
|
|
34
37
|
|
|
35
|
-
this
|
|
38
|
+
_defineProperty(this, "unmount", key => this.setState(state => ({
|
|
36
39
|
portals: state.portals.filter(item => item.key !== key)
|
|
37
|
-
}));
|
|
40
|
+
})));
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
render() {
|
|
@@ -54,15 +57,4 @@ export default class PortalManager extends React.PureComponent {
|
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
}ent(View, {
|
|
58
|
-
key: key,
|
|
59
|
-
collapsable: false
|
|
60
|
-
/* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */
|
|
61
|
-
,
|
|
62
|
-
pointerEvents: "box-none",
|
|
63
|
-
style: StyleSheet.absoluteFill
|
|
64
|
-
}, children);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
60
|
}
|
package/lib/module/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.
|
|
3
|
+
"version": "46.2.3",
|
|
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.2.
|
|
44
|
+
"@draftbit/types": "^46.2.3",
|
|
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",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
]
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "9a0a65dfc2aff945da5cbe7db48d07114c8cea7c"
|
|
83
83
|
}
|