@draftbit/core 46.6.5-8b9fed.2 → 46.6.6
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/CardBlock.js +13 -4
- package/lib/commonjs/components/CardContainerRating.js +13 -4
- package/lib/commonjs/components/Checkbox/Checkbox.js +22 -4
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +23 -5
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/commonjs/components/Container.js +15 -4
- package/lib/commonjs/components/DatePicker/DatePicker.js +26 -13
- package/lib/commonjs/components/DeprecatedFAB.js +21 -3
- package/lib/commonjs/components/Divider.js +14 -1
- package/lib/commonjs/components/FAB.js +18 -4
- package/lib/commonjs/components/FormRow.js +16 -2
- package/lib/commonjs/components/IconButton.js +19 -4
- package/lib/commonjs/components/Image.js +17 -2
- package/lib/commonjs/components/Layout.js +40 -19
- package/lib/commonjs/components/Picker/Picker.js +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.web.js +19 -4
- package/lib/commonjs/components/Portal/PortalHost.js +44 -15
- package/lib/commonjs/components/Portal/PortalManager.js +34 -8
- package/lib/commonjs/components/Pressable.js +15 -2
- package/lib/commonjs/components/ProgressBar.js +37 -7
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +9 -1
- package/lib/commonjs/components/ScreenContainer.js +20 -4
- package/lib/commonjs/components/StepIndicator.js +57 -18
- package/lib/commonjs/components/Surface.js +14 -2
- package/lib/commonjs/components/Switch.js +19 -10
- 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/utilities.js +1 -2
- 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/CardContainerRating.js +14 -4
- package/lib/module/components/CardContainerShortImage.js +18 -4
- package/lib/module/components/Checkbox/Checkbox.js +25 -4
- package/lib/module/components/Checkbox/CheckboxGroup.js +16 -2
- package/lib/module/components/CircleImage.js +16 -1
- package/lib/module/components/CircularProgress.js +28 -8
- package/lib/module/components/Container.js +17 -4
- package/lib/module/components/DatePicker/DatePicker.js +27 -13
- package/lib/module/components/DeprecatedCardWrapper.js +18 -1
- package/lib/module/components/DeprecatedFAB.js +23 -3
- package/lib/module/components/Elevation.js +14 -2
- package/lib/module/components/FAB.js +22 -4
- package/lib/module/components/FieldSearchBarFull.js +1 -2
- package/lib/module/components/IconButton.js +21 -4
- package/lib/module/components/Picker/Picker.js +1 -1
- package/lib/module/components/Picker/PickerComponent.web.js +19 -4
- package/lib/module/components/Portal/Portal.js +28 -3
- package/lib/module/components/Portal/PortalHost.js +45 -15
- package/lib/module/components/Portal/PortalManager.js +33 -7
- package/lib/module/components/ProgressBar.js +39 -7
- package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +10 -1
- package/lib/module/components/RadioButton/context.js +1 -1
- package/lib/module/components/StarRating.js +24 -4
- package/lib/module/components/Stepper.js +1 -4
- package/lib/module/components/Surface.js +15 -1
- package/lib/module/components/TextField.js +78 -28
- package/lib/module/components/ToggleButton.js +16 -2
- package/lib/module/components/Touchable.js +15 -2
- package/lib/module/constants.js +1 -0
- package/lib/module/mappings/StarRating.js +7 -2
- package/lib/module/utilities.js +1 -2
- package/package.json +3 -3
|
@@ -13,7 +13,6 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _reactNative = require("react-native");
|
|
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 Center(_ref) {
|
|
18
17
|
let {
|
|
19
18
|
width = 240,
|
|
@@ -23,15 +22,16 @@ function Center(_ref) {
|
|
|
23
22
|
style,
|
|
24
23
|
...rest
|
|
25
24
|
} = _ref;
|
|
26
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
25
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
27
26
|
style: [{
|
|
28
27
|
justifyContent: "center",
|
|
29
28
|
alignItems: "center",
|
|
30
29
|
width,
|
|
31
30
|
height,
|
|
32
31
|
backgroundColor: bgColor
|
|
33
|
-
}, style]
|
|
34
|
-
|
|
32
|
+
}, style],
|
|
33
|
+
...rest
|
|
34
|
+
}, children);
|
|
35
35
|
}
|
|
36
36
|
function Circle(_ref2) {
|
|
37
37
|
let {
|
|
@@ -42,7 +42,7 @@ function Circle(_ref2) {
|
|
|
42
42
|
...rest
|
|
43
43
|
} = _ref2;
|
|
44
44
|
const borderRadius = 1000;
|
|
45
|
-
return /*#__PURE__*/React.createElement(Center,
|
|
45
|
+
return /*#__PURE__*/React.createElement(Center, {
|
|
46
46
|
width: size,
|
|
47
47
|
height: size,
|
|
48
48
|
bgColor: bgColor,
|
|
@@ -50,8 +50,9 @@ function Circle(_ref2) {
|
|
|
50
50
|
backgroundColor: bgColor,
|
|
51
51
|
borderRadius,
|
|
52
52
|
overflow: "hidden"
|
|
53
|
-
}]
|
|
54
|
-
|
|
53
|
+
}],
|
|
54
|
+
...rest
|
|
55
|
+
}, children);
|
|
55
56
|
}
|
|
56
57
|
function Square(_ref3) {
|
|
57
58
|
let {
|
|
@@ -61,12 +62,13 @@ function Square(_ref3) {
|
|
|
61
62
|
style,
|
|
62
63
|
...rest
|
|
63
64
|
} = _ref3;
|
|
64
|
-
return /*#__PURE__*/React.createElement(Center,
|
|
65
|
+
return /*#__PURE__*/React.createElement(Center, {
|
|
65
66
|
style: style,
|
|
66
67
|
width: size,
|
|
67
68
|
height: size,
|
|
68
|
-
bgColor: bgColor
|
|
69
|
-
|
|
69
|
+
bgColor: bgColor,
|
|
70
|
+
...rest
|
|
71
|
+
}, children);
|
|
70
72
|
}
|
|
71
73
|
function Row(_ref4) {
|
|
72
74
|
let {
|
|
@@ -76,15 +78,14 @@ function Row(_ref4) {
|
|
|
76
78
|
style,
|
|
77
79
|
...rest
|
|
78
80
|
} = _ref4;
|
|
79
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
80
|
-
style: [style,
|
|
81
|
-
// style goes first b/c we can't override these
|
|
82
|
-
{
|
|
81
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
82
|
+
style: [style, {
|
|
83
83
|
alignItems,
|
|
84
84
|
flexDirection: "row",
|
|
85
85
|
justifyContent: justifyContent
|
|
86
|
-
}]
|
|
87
|
-
|
|
86
|
+
}],
|
|
87
|
+
...rest
|
|
88
|
+
}, children);
|
|
88
89
|
}
|
|
89
90
|
function Spacer(_ref5) {
|
|
90
91
|
let {
|
|
@@ -96,16 +97,36 @@ function Spacer(_ref5) {
|
|
|
96
97
|
style,
|
|
97
98
|
...rest
|
|
98
99
|
} = _ref5;
|
|
99
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
100
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
100
101
|
style: [style, {
|
|
101
102
|
paddingRight: right,
|
|
102
103
|
paddingTop: top,
|
|
103
104
|
paddingLeft: left,
|
|
104
105
|
paddingBottom: bottom
|
|
105
|
-
}]
|
|
106
|
-
|
|
106
|
+
}],
|
|
107
|
+
...rest
|
|
108
|
+
}, children);
|
|
107
109
|
}
|
|
108
110
|
function Stack(_ref6) {
|
|
111
|
+
let {
|
|
112
|
+
children,
|
|
113
|
+
justifyContent = "flex-start",
|
|
114
|
+
alignItems = "flex-start",
|
|
115
|
+
style,
|
|
116
|
+
...rest
|
|
117
|
+
} = _ref6;
|
|
118
|
+
return (
|
|
119
|
+
/*#__PURE__*/
|
|
120
|
+
// style must go first since we don't want justifyContent, alignItems overridden
|
|
121
|
+
React.createElement(_reactNative.View, {
|
|
122
|
+
style: [style, {
|
|
123
|
+
justifyContent,
|
|
124
|
+
alignItems
|
|
125
|
+
}],
|
|
126
|
+
...rest
|
|
127
|
+
}, children)
|
|
128
|
+
);
|
|
129
|
+
}Stack(_ref6) {
|
|
109
130
|
let {
|
|
110
131
|
children,
|
|
111
132
|
justifyContent = "flex-start",
|
|
@@ -15,9 +15,7 @@ var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
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); }
|
|
17
17
|
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; }
|
|
18
|
-
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); }
|
|
19
18
|
const Picker = _ref => {
|
|
20
|
-
var _options$find;
|
|
21
19
|
let {
|
|
22
20
|
style,
|
|
23
21
|
options,
|
|
@@ -27,6 +25,7 @@ const Picker = _ref => {
|
|
|
27
25
|
onValueChange: onValueChangeOverride = () => {},
|
|
28
26
|
...props
|
|
29
27
|
} = _ref;
|
|
28
|
+
var _a, _b;
|
|
30
29
|
const {
|
|
31
30
|
viewStyles: {
|
|
32
31
|
borderRadius,
|
|
@@ -71,7 +70,7 @@ const Picker = _ref => {
|
|
|
71
70
|
};
|
|
72
71
|
|
|
73
72
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
74
|
-
const selectedLabel = selectedValue && (((
|
|
73
|
+
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);
|
|
75
74
|
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
76
75
|
disabled: disabled,
|
|
77
76
|
onPress: toggleFocus,
|
|
@@ -96,8 +95,24 @@ const Picker = _ref => {
|
|
|
96
95
|
key: o.value
|
|
97
96
|
}))), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
98
97
|
pointerEvents: "none"
|
|
99
|
-
}, /*#__PURE__*/React.createElement(_TextField.default,
|
|
98
|
+
}, /*#__PURE__*/React.createElement(_TextField.default, {
|
|
99
|
+
...props,
|
|
100
100
|
value: selectedLabel,
|
|
101
|
+
placeholder: placeholder,
|
|
102
|
+
// @ts-ignore
|
|
103
|
+
ref: textField,
|
|
104
|
+
disabled: disabled,
|
|
105
|
+
// @ts-expect-error
|
|
106
|
+
style: stylesWithoutMargin
|
|
107
|
+
}))));
|
|
108
|
+
};
|
|
109
|
+
const styles = _reactNative.StyleSheet.create({
|
|
110
|
+
container: {
|
|
111
|
+
alignSelf: "stretch"
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
var _default = (0, _theming.withTheme)(Picker);
|
|
115
|
+
exports.default = _default;alue: selectedLabel,
|
|
101
116
|
placeholder: placeholder
|
|
102
117
|
// @ts-ignore
|
|
103
118
|
,
|
|
@@ -10,11 +10,7 @@ var _PortalManager = _interopRequireDefault(require("./PortalManager"));
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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 _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; }
|
|
14
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
|
-
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); }
|
|
16
13
|
const PortalContext = /*#__PURE__*/React.createContext(null);
|
|
17
|
-
|
|
18
14
|
/**
|
|
19
15
|
* Portal host renders all of its children `Portal` elements.
|
|
20
16
|
* For example, you can wrap a screen in `Portal.Host` to render items above the screen.
|
|
@@ -43,10 +39,10 @@ exports.PortalContext = PortalContext;
|
|
|
43
39
|
class PortalHost extends React.Component {
|
|
44
40
|
constructor() {
|
|
45
41
|
super(...arguments);
|
|
46
|
-
|
|
42
|
+
this.setManager = manager => {
|
|
47
43
|
this.manager = manager;
|
|
48
|
-
}
|
|
49
|
-
|
|
44
|
+
};
|
|
45
|
+
this.mount = children => {
|
|
50
46
|
const key = this.nextKey++;
|
|
51
47
|
if (this.manager) {
|
|
52
48
|
this.manager.mount(key, children);
|
|
@@ -58,8 +54,8 @@ class PortalHost extends React.Component {
|
|
|
58
54
|
});
|
|
59
55
|
}
|
|
60
56
|
return key;
|
|
61
|
-
}
|
|
62
|
-
|
|
57
|
+
};
|
|
58
|
+
this.update = (key, children) => {
|
|
63
59
|
if (this.manager) {
|
|
64
60
|
this.manager.update(key, children);
|
|
65
61
|
} else {
|
|
@@ -76,8 +72,8 @@ class PortalHost extends React.Component {
|
|
|
76
72
|
this.queue.push(op);
|
|
77
73
|
}
|
|
78
74
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
75
|
+
};
|
|
76
|
+
this.unmount = key => {
|
|
81
77
|
if (this.manager) {
|
|
82
78
|
this.manager.unmount(key);
|
|
83
79
|
} else {
|
|
@@ -86,10 +82,9 @@ class PortalHost extends React.Component {
|
|
|
86
82
|
key
|
|
87
83
|
});
|
|
88
84
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
_defineProperty(this, "manager", void 0);
|
|
85
|
+
};
|
|
86
|
+
this.nextKey = 0;
|
|
87
|
+
this.queue = [];
|
|
93
88
|
}
|
|
94
89
|
componentDidMount() {
|
|
95
90
|
const manager = this.manager;
|
|
@@ -128,6 +123,40 @@ class PortalHost extends React.Component {
|
|
|
128
123
|
}
|
|
129
124
|
}
|
|
130
125
|
exports.default = PortalHost;
|
|
126
|
+
PortalHost.displayName = "Portal.Host";
|
|
127
|
+
const styles = _reactNative.StyleSheet.create({
|
|
128
|
+
container: {
|
|
129
|
+
flex: 1
|
|
130
|
+
}
|
|
131
|
+
});nager.mount(action.key, action.children);
|
|
132
|
+
break;
|
|
133
|
+
case "update":
|
|
134
|
+
manager.update(action.key, action.children);
|
|
135
|
+
break;
|
|
136
|
+
case "unmount":
|
|
137
|
+
manager.unmount(action.key);
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
render() {
|
|
144
|
+
return /*#__PURE__*/React.createElement(PortalContext.Provider, {
|
|
145
|
+
value: {
|
|
146
|
+
mount: this.mount,
|
|
147
|
+
update: this.update,
|
|
148
|
+
unmount: this.unmount
|
|
149
|
+
}
|
|
150
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
151
|
+
style: styles.container,
|
|
152
|
+
collapsable: false,
|
|
153
|
+
pointerEvents: "box-none"
|
|
154
|
+
}, this.props.children), /*#__PURE__*/React.createElement(_PortalManager.default, {
|
|
155
|
+
ref: this.setManager
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.default = PortalHost;
|
|
131
160
|
_defineProperty(PortalHost, "displayName", "Portal.Host");
|
|
132
161
|
const styles = _reactNative.StyleSheet.create({
|
|
133
162
|
container: {
|
|
@@ -8,27 +8,24 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
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); }
|
|
10
10
|
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; }
|
|
11
|
-
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; }
|
|
12
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
-
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); }
|
|
14
11
|
/**
|
|
15
12
|
* Portal host is the component which actually renders all Portals.
|
|
16
13
|
*/
|
|
17
14
|
class PortalManager extends React.PureComponent {
|
|
18
15
|
constructor() {
|
|
19
16
|
super(...arguments);
|
|
20
|
-
|
|
17
|
+
this.state = {
|
|
21
18
|
portals: []
|
|
22
|
-
}
|
|
23
|
-
|
|
19
|
+
};
|
|
20
|
+
this.mount = (key, children) => {
|
|
24
21
|
this.setState(state => ({
|
|
25
22
|
portals: [...state.portals, {
|
|
26
23
|
key,
|
|
27
24
|
children
|
|
28
25
|
}]
|
|
29
26
|
}));
|
|
30
|
-
}
|
|
31
|
-
|
|
27
|
+
};
|
|
28
|
+
this.update = (key, children) => this.setState(state => ({
|
|
32
29
|
portals: state.portals.map(item => {
|
|
33
30
|
if (item.key === key) {
|
|
34
31
|
return {
|
|
@@ -38,6 +35,35 @@ class PortalManager extends React.PureComponent {
|
|
|
38
35
|
}
|
|
39
36
|
return item;
|
|
40
37
|
})
|
|
38
|
+
}));
|
|
39
|
+
this.unmount = key => this.setState(state => ({
|
|
40
|
+
portals: state.portals.filter(item => item.key !== key)
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return this.state.portals.map(_ref => {
|
|
45
|
+
let {
|
|
46
|
+
key,
|
|
47
|
+
children
|
|
48
|
+
} = _ref;
|
|
49
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
50
|
+
key: key,
|
|
51
|
+
collapsable: false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */,
|
|
52
|
+
pointerEvents: "box-none",
|
|
53
|
+
style: _reactNative.StyleSheet.absoluteFill
|
|
54
|
+
}, children);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.default = PortalManager;tate.portals.map(item => {
|
|
59
|
+
if (item.key === key) {
|
|
60
|
+
return {
|
|
61
|
+
...item,
|
|
62
|
+
children
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return item;
|
|
66
|
+
})
|
|
41
67
|
})));
|
|
42
68
|
_defineProperty(this, "unmount", key => this.setState(state => ({
|
|
43
69
|
portals: state.portals.filter(item => item.key !== key)
|
|
@@ -7,7 +7,6 @@ exports.default = Pressable;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
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
|
function Pressable(_ref) {
|
|
12
11
|
let {
|
|
13
12
|
children,
|
|
@@ -20,8 +19,22 @@ function Pressable(_ref) {
|
|
|
20
19
|
style,
|
|
21
20
|
...props
|
|
22
21
|
} = _ref;
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable,
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
24
23
|
onPress: onPress,
|
|
24
|
+
disabled: disabled,
|
|
25
|
+
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
26
|
+
hitSlop: hitSlop ? hitSlop : 8,
|
|
27
|
+
style: _ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
pressed
|
|
30
|
+
} = _ref2;
|
|
31
|
+
return [{
|
|
32
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
33
|
+
}, style];
|
|
34
|
+
},
|
|
35
|
+
...props
|
|
36
|
+
}, children);
|
|
37
|
+
} onPress: onPress,
|
|
25
38
|
disabled: disabled,
|
|
26
39
|
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
27
40
|
hitSlop: hitSlop ? hitSlop : 8,
|
|
@@ -8,16 +8,12 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
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); }
|
|
10
10
|
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; }
|
|
11
|
-
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); }
|
|
12
|
-
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; }
|
|
13
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
14
|
-
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); }
|
|
15
11
|
const INDETERMINATE_WIDTH_FACTOR = 0.3;
|
|
16
12
|
const BAR_WIDTH_ZERO_POSITION = INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_WIDTH_FACTOR);
|
|
17
13
|
class ProgressBar extends _react.Component {
|
|
18
14
|
constructor(props) {
|
|
19
15
|
super(props);
|
|
20
|
-
|
|
16
|
+
this.handleLayout = event => {
|
|
21
17
|
const {
|
|
22
18
|
width = 150,
|
|
23
19
|
onLayout
|
|
@@ -30,7 +26,7 @@ class ProgressBar extends _react.Component {
|
|
|
30
26
|
if (onLayout) {
|
|
31
27
|
onLayout(event);
|
|
32
28
|
}
|
|
33
|
-
}
|
|
29
|
+
};
|
|
34
30
|
const {
|
|
35
31
|
progress: progressP = 0,
|
|
36
32
|
indeterminate = false
|
|
@@ -78,7 +74,6 @@ class ProgressBar extends _react.Component {
|
|
|
78
74
|
...animationConfig,
|
|
79
75
|
toValue: progress,
|
|
80
76
|
velocity: 0,
|
|
81
|
-
//adjust this value if animation fails - velocity is required
|
|
82
77
|
useNativeDriver
|
|
83
78
|
}).start();
|
|
84
79
|
} else {
|
|
@@ -147,6 +142,41 @@ class ProgressBar extends _react.Component {
|
|
|
147
142
|
})
|
|
148
143
|
}]
|
|
149
144
|
};
|
|
145
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
146
|
+
style: [containerStyle, style],
|
|
147
|
+
onLayout: this.handleLayout,
|
|
148
|
+
...restProps
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
150
|
+
style: progressStyle
|
|
151
|
+
}), children);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.default = ProgressBar;,
|
|
155
|
+
overflow: "hidden",
|
|
156
|
+
backgroundColor: unfilledColor
|
|
157
|
+
};
|
|
158
|
+
const progressStyle = {
|
|
159
|
+
backgroundColor: color,
|
|
160
|
+
// Always take up full height of container.
|
|
161
|
+
height: "100%",
|
|
162
|
+
transform: [{
|
|
163
|
+
translateX: this.state.animationValue.interpolate({
|
|
164
|
+
inputRange: [0, 1],
|
|
165
|
+
outputRange: [innerWidth * -INDETERMINATE_WIDTH_FACTOR, innerWidth]
|
|
166
|
+
})
|
|
167
|
+
}, {
|
|
168
|
+
translateX: this.state.progress.interpolate({
|
|
169
|
+
inputRange: [0, 1],
|
|
170
|
+
outputRange: [innerWidth / (_reactNative.I18nManager.isRTL ? 2 : -2), 0]
|
|
171
|
+
})
|
|
172
|
+
}, {
|
|
173
|
+
// Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
|
|
174
|
+
scaleX: this.state.progress.interpolate({
|
|
175
|
+
inputRange: [0, 1],
|
|
176
|
+
outputRange: [0.0001, 1]
|
|
177
|
+
})
|
|
178
|
+
}]
|
|
179
|
+
};
|
|
150
180
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
151
181
|
style: [containerStyle, style],
|
|
152
182
|
onLayout: this.handleLayout
|
|
@@ -10,7 +10,6 @@ var _Text = _interopRequireDefault(require("../Text"));
|
|
|
10
10
|
var _theming = require("../../theming");
|
|
11
11
|
var _RadioButtonGroup = _interopRequireDefault(require("./RadioButtonGroup"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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 RadioButtonFieldGroup = _ref => {
|
|
15
14
|
let {
|
|
16
15
|
label,
|
|
@@ -27,6 +26,15 @@ const RadioButtonFieldGroup = _ref => {
|
|
|
27
26
|
fontSize: theme.typography.headline4.fontSize,
|
|
28
27
|
color: theme.typography.headline4.color
|
|
29
28
|
}, labelStyle]
|
|
29
|
+
}, label), /*#__PURE__*/_react.default.createElement(_RadioButtonGroup.default, {
|
|
30
|
+
theme: theme,
|
|
31
|
+
...rest
|
|
32
|
+
}, children));
|
|
33
|
+
};
|
|
34
|
+
var _default = (0, _theming.withTheme)(RadioButtonFieldGroup);
|
|
35
|
+
exports.default = _default; fontSize: theme.typography.headline4.fontSize,
|
|
36
|
+
color: theme.typography.headline4.color
|
|
37
|
+
}, labelStyle]
|
|
30
38
|
}, label), /*#__PURE__*/_react.default.createElement(_RadioButtonGroup.default, _extends({
|
|
31
39
|
theme: theme
|
|
32
40
|
}, rest), children));
|
|
@@ -10,7 +10,6 @@ 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
14
|
let {
|
|
16
15
|
scrollable = false,
|
|
@@ -30,12 +29,13 @@ function ScreenContainer(_ref) {
|
|
|
30
29
|
if (hasSafeArea || hasBottomSafeArea) {
|
|
31
30
|
edges.push("bottom");
|
|
32
31
|
}
|
|
33
|
-
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView,
|
|
32
|
+
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
|
|
34
33
|
edges: edges,
|
|
35
34
|
style: [styles.container, {
|
|
36
35
|
backgroundColor
|
|
37
|
-
}]
|
|
38
|
-
|
|
36
|
+
}],
|
|
37
|
+
...rest
|
|
38
|
+
}, scrollable ? /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
|
|
39
39
|
contentContainerStyle: [styles.scrollViewContainer, {
|
|
40
40
|
backgroundColor
|
|
41
41
|
}, style]
|
|
@@ -55,4 +55,20 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
var _default = (0, _theming.withTheme)(ScreenContainer);
|
|
58
|
+
exports.default = _default;(_reactNative.View, {
|
|
59
|
+
style: [styles.container, {
|
|
60
|
+
backgroundColor
|
|
61
|
+
}, style]
|
|
62
|
+
}, children));
|
|
63
|
+
}
|
|
64
|
+
const styles = _reactNative.StyleSheet.create({
|
|
65
|
+
container: {
|
|
66
|
+
flex: 1
|
|
67
|
+
},
|
|
68
|
+
scrollViewContainer: {
|
|
69
|
+
flexGrow: 1,
|
|
70
|
+
flex: undefined
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
var _default = (0, _theming.withTheme)(ScreenContainer);
|
|
58
74
|
exports.default = _default;
|