@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
|
@@ -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, Text, StyleSheet, Pressable } from "react-native";
|
|
4
3
|
import color from "color";
|
|
@@ -75,7 +74,8 @@ const Button = _ref => {
|
|
|
75
74
|
elevation,
|
|
76
75
|
alignSelf: "stretch"
|
|
77
76
|
}
|
|
78
|
-
}, /*#__PURE__*/React.createElement(Pressable,
|
|
77
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
78
|
+
...rest,
|
|
79
79
|
onPress: onPress,
|
|
80
80
|
accessibilityState: {
|
|
81
81
|
disabled
|
|
@@ -83,7 +83,7 @@ const Button = _ref => {
|
|
|
83
83
|
accessibilityRole: "button",
|
|
84
84
|
disabled: disabled || loading,
|
|
85
85
|
style: [styles.button, buttonStyle]
|
|
86
|
-
}
|
|
86
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
87
87
|
style: styles.content
|
|
88
88
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
89
89
|
style: iconStyle
|
|
@@ -114,4 +114,22 @@ const styles = StyleSheet.create({
|
|
|
114
114
|
width: Config.buttonIconSize
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
|
+
export default withTheme(Button);: 1,
|
|
118
|
+
style: [textStyle, typography.button]
|
|
119
|
+
}, children))));
|
|
120
|
+
};
|
|
121
|
+
const styles = StyleSheet.create({
|
|
122
|
+
button: {
|
|
123
|
+
minWidth: 64,
|
|
124
|
+
borderStyle: "solid"
|
|
125
|
+
},
|
|
126
|
+
content: {
|
|
127
|
+
flexDirection: "row",
|
|
128
|
+
alignItems: "center",
|
|
129
|
+
justifyContent: "center"
|
|
130
|
+
},
|
|
131
|
+
icon: {
|
|
132
|
+
width: Config.buttonIconSize
|
|
133
|
+
}
|
|
134
|
+
});
|
|
117
135
|
export default withTheme(Button);
|
|
@@ -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 React from "react";
|
|
3
2
|
import { withTheme } from "../theming";
|
|
4
3
|
import Touchable from "./Touchable";
|
|
@@ -13,6 +12,24 @@ const getWidth = numColumns => {
|
|
|
13
12
|
}
|
|
14
13
|
};
|
|
15
14
|
const Card = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
numColumns = 3,
|
|
17
|
+
children,
|
|
18
|
+
onPress,
|
|
19
|
+
style,
|
|
20
|
+
...rest
|
|
21
|
+
} = _ref;
|
|
22
|
+
const width = getWidth(numColumns);
|
|
23
|
+
return /*#__PURE__*/React.createElement(Touchable, {
|
|
24
|
+
disabled: !onPress,
|
|
25
|
+
onPress: onPress,
|
|
26
|
+
style: [style, {
|
|
27
|
+
width
|
|
28
|
+
}],
|
|
29
|
+
...rest
|
|
30
|
+
}, children);
|
|
31
|
+
};
|
|
32
|
+
export default withTheme(Card);ef => {
|
|
16
33
|
let {
|
|
17
34
|
numColumns = 3,
|
|
18
35
|
children,
|
|
@@ -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 { View, StyleSheet } from "react-native";
|
|
4
3
|
import omit from "lodash.omit";
|
|
@@ -8,7 +7,6 @@ import { extractStyles } from "../../utilities";
|
|
|
8
7
|
import TextField from "../TextField";
|
|
9
8
|
import Touchable from "../Touchable";
|
|
10
9
|
const Picker = _ref => {
|
|
11
|
-
var _options$find$label, _options$find;
|
|
12
10
|
let {
|
|
13
11
|
style,
|
|
14
12
|
options,
|
|
@@ -18,6 +16,7 @@ const Picker = _ref => {
|
|
|
18
16
|
onValueChange: onValueChangeOverride = () => {},
|
|
19
17
|
...props
|
|
20
18
|
} = _ref;
|
|
19
|
+
var _a, _b;
|
|
21
20
|
const {
|
|
22
21
|
viewStyles: {
|
|
23
22
|
borderRadius,
|
|
@@ -62,7 +61,7 @@ const Picker = _ref => {
|
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
65
|
-
const selectedLabel = selectedValue && ((
|
|
64
|
+
const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
|
|
66
65
|
return /*#__PURE__*/React.createElement(Touchable, {
|
|
67
66
|
disabled: disabled,
|
|
68
67
|
onPress: toggleFocus,
|
|
@@ -84,6 +83,25 @@ const Picker = _ref => {
|
|
|
84
83
|
label: o.label,
|
|
85
84
|
value: o.value,
|
|
86
85
|
key: o.value
|
|
86
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
87
|
+
pointerEvents: "none"
|
|
88
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
89
|
+
...props,
|
|
90
|
+
value: selectedLabel,
|
|
91
|
+
placeholder: placeholder,
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
ref: textField,
|
|
94
|
+
disabled: disabled,
|
|
95
|
+
// @ts-expect-error
|
|
96
|
+
style: stylesWithoutMargin
|
|
97
|
+
}))));
|
|
98
|
+
};
|
|
99
|
+
const styles = StyleSheet.create({
|
|
100
|
+
container: {
|
|
101
|
+
alignSelf: "stretch"
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
export default withTheme(Picker);y: o.value
|
|
87
105
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
88
106
|
pointerEvents: "none"
|
|
89
107
|
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
@@ -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 { View, StyleSheet } from "react-native";
|
|
4
3
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
@@ -11,7 +10,6 @@ import TextField from "../TextField";
|
|
|
11
10
|
import Touchable from "../Touchable";
|
|
12
11
|
import { extractStyles } from "../../utilities";
|
|
13
12
|
const Picker = _ref => {
|
|
14
|
-
var _options$find$label, _options$find;
|
|
15
13
|
let {
|
|
16
14
|
Icon,
|
|
17
15
|
style,
|
|
@@ -25,6 +23,7 @@ const Picker = _ref => {
|
|
|
25
23
|
},
|
|
26
24
|
...props
|
|
27
25
|
} = _ref;
|
|
26
|
+
var _a, _b;
|
|
28
27
|
const {
|
|
29
28
|
viewStyles: {
|
|
30
29
|
borderRadius,
|
|
@@ -65,26 +64,24 @@ const Picker = _ref => {
|
|
|
65
64
|
};
|
|
66
65
|
|
|
67
66
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
68
|
-
const selectedLabel = selectedValue && ((
|
|
67
|
+
const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
|
|
69
68
|
return /*#__PURE__*/React.createElement(View, {
|
|
70
69
|
style: [styles.container, viewStyles]
|
|
71
70
|
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
72
71
|
disabled: disabled,
|
|
73
72
|
onPress: toggleVisibility
|
|
74
|
-
}, /*#__PURE__*/React.createElement(TextField,
|
|
73
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
74
|
+
...props,
|
|
75
75
|
value: String(selectedLabel),
|
|
76
|
-
placeholder: placeholder
|
|
76
|
+
placeholder: placeholder,
|
|
77
77
|
// @ts-ignore
|
|
78
|
-
,
|
|
79
|
-
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
80
|
-
,
|
|
78
|
+
ref: textField,
|
|
81
79
|
disabled: disabled,
|
|
82
|
-
pointerEvents: "none"
|
|
80
|
+
pointerEvents: "none",
|
|
83
81
|
// @ts-expect-error
|
|
84
|
-
,
|
|
85
82
|
style: stylesWithoutMargin,
|
|
86
83
|
Icon: Icon
|
|
87
|
-
}))
|
|
84
|
+
})), pickerVisible && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(View, {
|
|
88
85
|
style: [styles.picker, {
|
|
89
86
|
backgroundColor: colors.divider
|
|
90
87
|
}]
|
|
@@ -128,4 +125,32 @@ const styles = StyleSheet.create({
|
|
|
128
125
|
alignSelf: "flex-end"
|
|
129
126
|
}
|
|
130
127
|
});
|
|
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
|
+
});
|
|
131
156
|
export default withTheme(Picker);
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
1
|
import * as React from "react";
|
|
5
2
|
import { View, StyleSheet } from "react-native";
|
|
6
3
|
import PortalManager from "./PortalManager";
|
|
7
4
|
export const PortalContext = /*#__PURE__*/React.createContext(null);
|
|
8
|
-
|
|
9
5
|
/**
|
|
10
6
|
* Portal host renders all of its children `Portal` elements.
|
|
11
7
|
* For example, you can wrap a screen in `Portal.Host` to render items above the screen.
|
|
@@ -33,10 +29,10 @@ export const PortalContext = /*#__PURE__*/React.createContext(null);
|
|
|
33
29
|
export default class PortalHost extends React.Component {
|
|
34
30
|
constructor() {
|
|
35
31
|
super(...arguments);
|
|
36
|
-
|
|
32
|
+
this.setManager = manager => {
|
|
37
33
|
this.manager = manager;
|
|
38
|
-
}
|
|
39
|
-
|
|
34
|
+
};
|
|
35
|
+
this.mount = children => {
|
|
40
36
|
const key = this.nextKey++;
|
|
41
37
|
if (this.manager) {
|
|
42
38
|
this.manager.mount(key, children);
|
|
@@ -48,8 +44,8 @@ export default class PortalHost extends React.Component {
|
|
|
48
44
|
});
|
|
49
45
|
}
|
|
50
46
|
return key;
|
|
51
|
-
}
|
|
52
|
-
|
|
47
|
+
};
|
|
48
|
+
this.update = (key, children) => {
|
|
53
49
|
if (this.manager) {
|
|
54
50
|
this.manager.update(key, children);
|
|
55
51
|
} else {
|
|
@@ -66,8 +62,8 @@ export default class PortalHost extends React.Component {
|
|
|
66
62
|
this.queue.push(op);
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
|
-
}
|
|
70
|
-
|
|
65
|
+
};
|
|
66
|
+
this.unmount = key => {
|
|
71
67
|
if (this.manager) {
|
|
72
68
|
this.manager.unmount(key);
|
|
73
69
|
} else {
|
|
@@ -76,10 +72,9 @@ export default class PortalHost extends React.Component {
|
|
|
76
72
|
key
|
|
77
73
|
});
|
|
78
74
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
_defineProperty(this, "manager", void 0);
|
|
75
|
+
};
|
|
76
|
+
this.nextKey = 0;
|
|
77
|
+
this.queue = [];
|
|
83
78
|
}
|
|
84
79
|
componentDidMount() {
|
|
85
80
|
const manager = this.manager;
|
|
@@ -117,6 +112,41 @@ export default class PortalHost extends React.Component {
|
|
|
117
112
|
}));
|
|
118
113
|
}
|
|
119
114
|
}
|
|
115
|
+
PortalHost.displayName = "Portal.Host";
|
|
116
|
+
const styles = StyleSheet.create({
|
|
117
|
+
container: {
|
|
118
|
+
flex: 1
|
|
119
|
+
}
|
|
120
|
+
}); switch (action.type) {
|
|
121
|
+
case "mount":
|
|
122
|
+
manager.mount(action.key, action.children);
|
|
123
|
+
break;
|
|
124
|
+
case "update":
|
|
125
|
+
manager.update(action.key, action.children);
|
|
126
|
+
break;
|
|
127
|
+
case "unmount":
|
|
128
|
+
manager.unmount(action.key);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
render() {
|
|
135
|
+
return /*#__PURE__*/React.createElement(PortalContext.Provider, {
|
|
136
|
+
value: {
|
|
137
|
+
mount: this.mount,
|
|
138
|
+
update: this.update,
|
|
139
|
+
unmount: this.unmount
|
|
140
|
+
}
|
|
141
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
142
|
+
style: styles.container,
|
|
143
|
+
collapsable: false,
|
|
144
|
+
pointerEvents: "box-none"
|
|
145
|
+
}, this.props.children), /*#__PURE__*/React.createElement(PortalManager, {
|
|
146
|
+
ref: this.setManager
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
120
150
|
_defineProperty(PortalHost, "displayName", "Portal.Host");
|
|
121
151
|
const styles = StyleSheet.create({
|
|
122
152
|
container: {
|
|
@@ -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 Config from "../Config";
|
|
4
3
|
import IconButton from "../IconButton";
|
|
@@ -30,6 +29,19 @@ const RadioButton = _ref => {
|
|
|
30
29
|
onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
|
|
31
30
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
|
|
32
31
|
};
|
|
32
|
+
return /*#__PURE__*/React.createElement(IconButton, {
|
|
33
|
+
Icon: Icon,
|
|
34
|
+
icon: isSelected ? selectedIcon : unselectedIcon,
|
|
35
|
+
color: isSelected ? color : unselectedColor,
|
|
36
|
+
disabled: disabled,
|
|
37
|
+
onPress: handlePress,
|
|
38
|
+
size: size,
|
|
39
|
+
style: style,
|
|
40
|
+
...rest
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export default RadioButton;: onValueChange(realValue);
|
|
44
|
+
};
|
|
33
45
|
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
34
46
|
Icon: Icon,
|
|
35
47
|
icon: isSelected ? selectedIcon : unselectedIcon,
|
|
@@ -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 { View } from "react-native";
|
|
4
3
|
import { getValueForRadioButton } from "../../utilities";
|
|
@@ -42,7 +41,22 @@ const RadioButtonGroup = _ref => {
|
|
|
42
41
|
alignItems: "center"
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
|
-
return /*#__PURE__*/React.createElement(View,
|
|
44
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
45
|
+
style: [{
|
|
46
|
+
minHeight: 40
|
|
47
|
+
}, style],
|
|
48
|
+
...rest
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Provider, {
|
|
50
|
+
value: {
|
|
51
|
+
value: internalValue,
|
|
52
|
+
onValueChange: handleValueChange,
|
|
53
|
+
direction
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
56
|
+
style: _containerStyle
|
|
57
|
+
}, children)));
|
|
58
|
+
};
|
|
59
|
+
export default RadioButtonGroup;xtends({
|
|
46
60
|
style: [{
|
|
47
61
|
minHeight: 40
|
|
48
62
|
}, style]
|
|
@@ -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 { StyleSheet, View, Platform } from "react-native";
|
|
4
3
|
import RadioButton from "./RadioButton";
|
|
@@ -7,7 +6,7 @@ import { useRadioButtonGroupContext } from "./context";
|
|
|
7
6
|
import { Direction as GroupDirection } from "./context";
|
|
8
7
|
import Touchable from "../Touchable";
|
|
9
8
|
import { extractStyles, getValueForRadioButton } from "../../utilities";
|
|
10
|
-
export
|
|
9
|
+
export var Direction;
|
|
11
10
|
(function (Direction) {
|
|
12
11
|
Direction["Row"] = "row";
|
|
13
12
|
Direction["RowReverse"] = "row-reverse";
|
|
@@ -63,13 +62,14 @@ const RadioButtonRow = _ref => {
|
|
|
63
62
|
textStyles,
|
|
64
63
|
viewStyles
|
|
65
64
|
} = extractStyles(style);
|
|
66
|
-
return /*#__PURE__*/React.createElement(Touchable,
|
|
65
|
+
return /*#__PURE__*/React.createElement(Touchable, {
|
|
67
66
|
onPress: handlePress,
|
|
68
67
|
style: [styles.mainParent, {
|
|
69
68
|
flexDirection: direction
|
|
70
69
|
}, viewStyles],
|
|
71
|
-
disabled: disabled
|
|
72
|
-
|
|
70
|
+
disabled: disabled,
|
|
71
|
+
...rest
|
|
72
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
73
73
|
style: [styles.label, {
|
|
74
74
|
alignItems: direction === Direction.Row ? "flex-start" : "flex-end"
|
|
75
75
|
}, labelContainerStyle]
|
|
@@ -106,4 +106,23 @@ const styles = StyleSheet.create({
|
|
|
106
106
|
flex: 3
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
+
export default RadioButtonRow;.create({
|
|
110
|
+
mainParent: {
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
justifyContent: "space-around",
|
|
113
|
+
paddingStart: 20,
|
|
114
|
+
minHeight: 50,
|
|
115
|
+
paddingEnd: 20,
|
|
116
|
+
display: "flex",
|
|
117
|
+
...Platform.select({
|
|
118
|
+
web: {
|
|
119
|
+
cursor: "pointer",
|
|
120
|
+
userSelect: "none"
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
},
|
|
124
|
+
label: {
|
|
125
|
+
flex: 3
|
|
126
|
+
}
|
|
127
|
+
});
|
|
109
128
|
export default RadioButtonRow;
|
|
@@ -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
|
/* Copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx */
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { Animated, StyleSheet } from "react-native";
|
|
@@ -34,6 +33,21 @@ const Surface = _ref => {
|
|
|
34
33
|
return colors.surface;
|
|
35
34
|
}
|
|
36
35
|
};
|
|
36
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
37
|
+
...rest,
|
|
38
|
+
style: [{
|
|
39
|
+
backgroundColor: getBackgroundColor(),
|
|
40
|
+
elevation,
|
|
41
|
+
...evalationStyles,
|
|
42
|
+
...restStyle
|
|
43
|
+
}]
|
|
44
|
+
}, children);
|
|
45
|
+
};
|
|
46
|
+
export default withTheme(Surface);erlay(elevation, colors.surface);
|
|
47
|
+
} else {
|
|
48
|
+
return colors.surface;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
37
51
|
return /*#__PURE__*/React.createElement(Animated.View, _extends({}, rest, {
|
|
38
52
|
style: [{
|
|
39
53
|
backgroundColor: getBackgroundColor(),
|
|
@@ -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 { TabView, TabBar, SceneMap } from "react-native-tab-view";
|
|
4
3
|
import { withTheme } from "../../theming";
|
|
@@ -28,13 +27,11 @@ const TabViewComponent = _ref => {
|
|
|
28
27
|
textStyles,
|
|
29
28
|
viewStyles
|
|
30
29
|
} = extractStyles(style);
|
|
31
|
-
|
|
32
30
|
//Check type of child using props
|
|
33
31
|
//Regular '.type' cannot work because Draftbit strips the type in Draft view
|
|
34
32
|
const instanceOfTabViewItemProps = object => {
|
|
35
33
|
return "title" in object;
|
|
36
34
|
};
|
|
37
|
-
|
|
38
35
|
//Populate routes and scenes based on children
|
|
39
36
|
React.useEffect(() => {
|
|
40
37
|
const newRoutes = [];
|
|
@@ -60,7 +57,8 @@ const TabViewComponent = _ref => {
|
|
|
60
57
|
}
|
|
61
58
|
};
|
|
62
59
|
const renderTabBar = props => {
|
|
63
|
-
return /*#__PURE__*/React.createElement(TabBar,
|
|
60
|
+
return /*#__PURE__*/React.createElement(TabBar, {
|
|
61
|
+
...props,
|
|
64
62
|
activeColor: activeColor || theme.colors.primary,
|
|
65
63
|
inactiveColor: inactiveColor || theme.colors.divider,
|
|
66
64
|
pressColor: pressColor || theme.colors.primary,
|
|
@@ -74,7 +72,7 @@ const TabViewComponent = _ref => {
|
|
|
74
72
|
route,
|
|
75
73
|
color
|
|
76
74
|
} = _ref2;
|
|
77
|
-
return route
|
|
75
|
+
return (route === null || route === void 0 ? void 0 : route.icon) ? /*#__PURE__*/React.createElement(Icon, {
|
|
78
76
|
name: route.icon,
|
|
79
77
|
color: color,
|
|
80
78
|
size: 16
|
|
@@ -83,9 +81,8 @@ const TabViewComponent = _ref => {
|
|
|
83
81
|
style: {
|
|
84
82
|
backgroundColor: tabsBackgroundColor || theme.colors.background
|
|
85
83
|
}
|
|
86
|
-
})
|
|
84
|
+
});
|
|
87
85
|
};
|
|
88
|
-
|
|
89
86
|
//Cannot render TabView without at least one tab
|
|
90
87
|
if (!routes.length) {
|
|
91
88
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
@@ -104,4 +101,17 @@ const TabViewComponent = _ref => {
|
|
|
104
101
|
swipeEnabled: swipeEnabled
|
|
105
102
|
});
|
|
106
103
|
};
|
|
104
|
+
export default withTheme(TabViewComponent);tyles],
|
|
105
|
+
navigationState: {
|
|
106
|
+
index,
|
|
107
|
+
routes
|
|
108
|
+
},
|
|
109
|
+
renderScene: SceneMap(tabScenes),
|
|
110
|
+
renderTabBar: renderTabBar,
|
|
111
|
+
onIndexChange: indexChangeHandler,
|
|
112
|
+
tabBarPosition: tabBarPosition,
|
|
113
|
+
keyboardDismissMode: keyboardDismissMode,
|
|
114
|
+
swipeEnabled: swipeEnabled
|
|
115
|
+
});
|
|
116
|
+
};
|
|
107
117
|
export default withTheme(TabViewComponent);
|
|
@@ -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 React from "react";
|
|
3
2
|
import { Pressable } from "react-native";
|
|
4
3
|
export default function Touchable(_ref) {
|
|
@@ -13,8 +12,22 @@ export default function Touchable(_ref) {
|
|
|
13
12
|
style,
|
|
14
13
|
...props
|
|
15
14
|
} = _ref;
|
|
16
|
-
return /*#__PURE__*/React.createElement(Pressable,
|
|
15
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
17
16
|
disabled: disabled,
|
|
17
|
+
onPress: onPress,
|
|
18
|
+
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
19
|
+
hitSlop: hitSlop ? hitSlop : 8,
|
|
20
|
+
style: _ref2 => {
|
|
21
|
+
let {
|
|
22
|
+
pressed
|
|
23
|
+
} = _ref2;
|
|
24
|
+
return [{
|
|
25
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
26
|
+
}, style];
|
|
27
|
+
},
|
|
28
|
+
...props
|
|
29
|
+
}, children);
|
|
30
|
+
} disabled: disabled,
|
|
18
31
|
onPress: onPress,
|
|
19
32
|
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
20
33
|
hitSlop: hitSlop ? hitSlop : 8,
|
package/lib/module/constants.js
CHANGED
package/lib/module/hooks.js
CHANGED
|
@@ -3,12 +3,11 @@ export function usePrevious(value) {
|
|
|
3
3
|
// The ref object is a generic container whose current property is mutable
|
|
4
4
|
// and can hold any value, similar to an instance property on a class
|
|
5
5
|
const ref = React.useRef();
|
|
6
|
-
|
|
7
6
|
// Store current value in ref
|
|
8
7
|
React.useEffect(() => {
|
|
9
8
|
ref.current = value;
|
|
10
9
|
}, [value]);
|
|
11
|
-
|
|
12
10
|
// Return previous value (happens before update in useEffect above)
|
|
13
11
|
return ref.current;
|
|
12
|
+
}
|
|
14
13
|
}
|
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-84bbff.2+84bbff0",
|
|
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-84bbff.2+84bbff0",
|
|
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": "84bbff016e35ef8ceae750a71028c78ee588366f"
|
|
104
104
|
}
|