@draftbit/core 46.5.2-404403.2 → 46.5.2-b02f9e.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/AspectRatio.js +17 -1
- package/lib/commonjs/components/CardBlock.js +13 -4
- package/lib/commonjs/components/Checkbox/Checkbox.js +22 -4
- package/lib/commonjs/components/DatePicker/DatePicker.js +9 -13
- package/lib/commonjs/components/DeprecatedFAB.js +21 -3
- package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
- package/lib/commonjs/components/StepIndicator.js +57 -18
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/typescript/src/styles/overlay.d.ts +1 -1
- package/lib/typescript/src/styles/overlay.d.ts.map +1 -1
- package/lib/typescript/src/styles/shadow.d.ts +2 -2
- package/package.json +3 -3
- package/src/styles/overlay.tsx +2 -2
|
@@ -7,7 +7,6 @@ exports.default = void 0;
|
|
|
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
|
const AspectRatio = props => {
|
|
12
11
|
const [layout, setLayout] = _react.default.useState(null);
|
|
13
12
|
const {
|
|
@@ -34,6 +33,23 @@ const AspectRatio = props => {
|
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
35
|
}
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
37
|
+
...props,
|
|
38
|
+
style: style,
|
|
39
|
+
onLayout: _ref => {
|
|
40
|
+
let {
|
|
41
|
+
nativeEvent: {
|
|
42
|
+
layout: l
|
|
43
|
+
}
|
|
44
|
+
} = _ref;
|
|
45
|
+
return setLayout(l);
|
|
46
|
+
}
|
|
47
|
+
}, props.children);
|
|
48
|
+
};
|
|
49
|
+
var _default = AspectRatio;
|
|
50
|
+
exports.default = _default; });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
37
53
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, props, {
|
|
38
54
|
style: style,
|
|
39
55
|
onLayout: _ref => {
|
|
@@ -12,7 +12,6 @@ var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
|
12
12
|
var _theming = require("../theming");
|
|
13
13
|
var _Config = _interopRequireDefault(require("./Config"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
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); }
|
|
16
15
|
const CardBlock = _ref => {
|
|
17
16
|
let {
|
|
18
17
|
image = _Config.default.cardImageUrl,
|
|
@@ -49,11 +48,12 @@ const CardBlock = _ref => {
|
|
|
49
48
|
const rightDescriptionStyles = [typography.subtitle2, {
|
|
50
49
|
color: colors.light
|
|
51
50
|
}];
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default,
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_DeprecatedCardWrapper.default, {
|
|
53
52
|
style: style,
|
|
54
53
|
onPress: onPress,
|
|
55
|
-
numColumns: numColumns
|
|
56
|
-
|
|
54
|
+
numColumns: numColumns,
|
|
55
|
+
...rest
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
57
57
|
style: {
|
|
58
58
|
backgroundColor: colors.background
|
|
59
59
|
}
|
|
@@ -103,4 +103,13 @@ const CardBlock = _ref => {
|
|
|
103
103
|
}, rightDescription) : null) : null));
|
|
104
104
|
};
|
|
105
105
|
var _default = (0, _theming.withTheme)(CardBlock);
|
|
106
|
+
exports.default = _default;yle: [typography.body2, {
|
|
107
|
+
color: colors.medium
|
|
108
|
+
}]
|
|
109
|
+
}, leftDescription), rightDescription ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
110
|
+
numberOfLines: 1,
|
|
111
|
+
style: rightDescriptionStyles
|
|
112
|
+
}, rightDescription) : null) : null));
|
|
113
|
+
};
|
|
114
|
+
var _default = (0, _theming.withTheme)(CardBlock);
|
|
106
115
|
exports.default = _default;
|
|
@@ -12,7 +12,6 @@ var _hooks = require("../../hooks");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
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); }
|
|
14
14
|
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; }
|
|
15
|
-
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); }
|
|
16
15
|
const Checkbox = _ref => {
|
|
17
16
|
let {
|
|
18
17
|
Icon,
|
|
@@ -36,7 +35,6 @@ const Checkbox = _ref => {
|
|
|
36
35
|
setInternalValue(status);
|
|
37
36
|
}
|
|
38
37
|
}, [status]);
|
|
39
|
-
|
|
40
38
|
// This special logic is to handle weird APIs like Airtable that return
|
|
41
39
|
// true or undefined for a boolean
|
|
42
40
|
const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
|
|
@@ -60,7 +58,8 @@ const Checkbox = _ref => {
|
|
|
60
58
|
onUncheck === null || onUncheck === void 0 ? void 0 : onUncheck();
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
|
-
return /*#__PURE__*/React.createElement(_Touchable.default,
|
|
61
|
+
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
62
|
+
...rest,
|
|
64
63
|
onPress: handlePress,
|
|
65
64
|
disabled: disabled,
|
|
66
65
|
accessibilityState: {
|
|
@@ -72,7 +71,7 @@ const Checkbox = _ref => {
|
|
|
72
71
|
width: size,
|
|
73
72
|
height: size
|
|
74
73
|
}]
|
|
75
|
-
}
|
|
74
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
76
75
|
style: styles.icon,
|
|
77
76
|
name: internalValue ? checkedIcon : uncheckedIcon,
|
|
78
77
|
size: size,
|
|
@@ -106,4 +105,23 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
106
105
|
}
|
|
107
106
|
});
|
|
108
107
|
var _default = Checkbox;
|
|
108
|
+
exports.default = _default; styles = _reactNative.StyleSheet.create({
|
|
109
|
+
container: {
|
|
110
|
+
borderRadius: 18
|
|
111
|
+
},
|
|
112
|
+
fillContainer: {
|
|
113
|
+
alignItems: "center",
|
|
114
|
+
justifyContent: "center"
|
|
115
|
+
},
|
|
116
|
+
icon: {
|
|
117
|
+
alignSelf: "center"
|
|
118
|
+
},
|
|
119
|
+
fill: {
|
|
120
|
+
borderRadius: 5,
|
|
121
|
+
width: 30,
|
|
122
|
+
height: 30,
|
|
123
|
+
alignSelf: "center"
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
var _default = Checkbox;
|
|
109
127
|
exports.default = _default;
|
|
@@ -16,7 +16,6 @@ var _utilities = require("../../utilities");
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
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); }
|
|
18
18
|
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; }
|
|
19
|
-
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); }
|
|
20
19
|
const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
|
|
21
20
|
const FOCUS_ANIMATION_DURATION = 150;
|
|
22
21
|
const BLUR_ANIMATION_DURATION = 180;
|
|
@@ -91,24 +90,20 @@ const DatePicker = _ref => {
|
|
|
91
90
|
focused ? _handleBlur() : _handleFocus();
|
|
92
91
|
};
|
|
93
92
|
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
|
|
94
|
-
|
|
95
93
|
// const _restoreLabel = () =>
|
|
96
94
|
// Animated.timing(labeled, {
|
|
97
95
|
// toValue: 1,
|
|
98
96
|
// duration: FOCUS_ANIMATION_DURATION,
|
|
99
97
|
// useNativeDriver: true,
|
|
100
98
|
// }).start();
|
|
101
|
-
|
|
102
99
|
// const _minmizeLabel = () =>
|
|
103
100
|
// Animated.timing(labeled, {
|
|
104
101
|
// toValue: 0,
|
|
105
102
|
// duration: BLUR_ANIMATION_DURATION,
|
|
106
103
|
// useNativeDriver: true,
|
|
107
104
|
// }).start();
|
|
108
|
-
|
|
109
105
|
// const _showPlaceholder = () =>
|
|
110
106
|
// setTimeout(() => setPlaceholder1(placeholder || ""), 50);
|
|
111
|
-
|
|
112
107
|
const _hidePlaceholder = () => {
|
|
113
108
|
setPlaceholder1("");
|
|
114
109
|
};
|
|
@@ -251,9 +246,7 @@ const DatePicker = _ref => {
|
|
|
251
246
|
const inputStyles = [styles.input, inputStyle, type === "solid" ? {
|
|
252
247
|
marginHorizontal: 12
|
|
253
248
|
} : {}];
|
|
254
|
-
|
|
255
249
|
// const render = (props) => <NativeTextInput {...props} />;
|
|
256
|
-
|
|
257
250
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
258
251
|
style: [styles.container, style]
|
|
259
252
|
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
@@ -263,9 +256,10 @@ const DatePicker = _ref => {
|
|
|
263
256
|
pointerEvents: "none"
|
|
264
257
|
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
265
258
|
style: [styles.container, style]
|
|
266
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon,
|
|
259
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
260
|
+
...leftIconProps,
|
|
267
261
|
style: leftIconStyle
|
|
268
|
-
})
|
|
262
|
+
}) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
269
263
|
style: [containerStyle, style ? {
|
|
270
264
|
height: style.height
|
|
271
265
|
} : {}, viewStyles]
|
|
@@ -314,12 +308,13 @@ const DatePicker = _ref => {
|
|
|
314
308
|
opacity: hasActiveOutline ? labeled : 1
|
|
315
309
|
}],
|
|
316
310
|
numberOfLines: 1
|
|
317
|
-
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon,
|
|
311
|
+
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
312
|
+
...leftIconProps,
|
|
318
313
|
style: {
|
|
319
314
|
...leftIconStyle,
|
|
320
315
|
marginLeft: type === "solid" ? 16 : 0
|
|
321
316
|
}
|
|
322
|
-
})
|
|
317
|
+
}) : null, /*#__PURE__*/React.createElement(_reactNative.TextInput, {
|
|
323
318
|
value: formatDate(),
|
|
324
319
|
placeholder: label ? placeholder1 : placeholder,
|
|
325
320
|
editable: !disabled,
|
|
@@ -328,8 +323,9 @@ const DatePicker = _ref => {
|
|
|
328
323
|
onFocus: _handleFocus,
|
|
329
324
|
onBlur: _handleBlur,
|
|
330
325
|
underlineColorAndroid: "transparent",
|
|
331
|
-
style: [inputStyles, textStyles]
|
|
332
|
-
|
|
326
|
+
style: [inputStyles, textStyles],
|
|
327
|
+
...props
|
|
328
|
+
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
333
329
|
name: rightIconName,
|
|
334
330
|
size: ICON_SIZE,
|
|
335
331
|
color: colors.light,
|
|
@@ -15,7 +15,6 @@ var _theming = require("../theming");
|
|
|
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 FAB = _ref => {
|
|
20
19
|
let {
|
|
21
20
|
Icon,
|
|
@@ -107,7 +106,8 @@ const FAB = _ref => {
|
|
|
107
106
|
style: [{
|
|
108
107
|
elevation
|
|
109
108
|
}, style]
|
|
110
|
-
}, /*#__PURE__*/React.createElement(_Touchable.default,
|
|
109
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
110
|
+
...rest,
|
|
111
111
|
onPress: onPress,
|
|
112
112
|
accessibilityState: {
|
|
113
113
|
disabled
|
|
@@ -115,7 +115,7 @@ const FAB = _ref => {
|
|
|
115
115
|
accessibilityRole: "button",
|
|
116
116
|
disabled: disabled || loading,
|
|
117
117
|
style: buttonStyles
|
|
118
|
-
}
|
|
118
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
119
119
|
style: styles.content
|
|
120
120
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
121
121
|
style: iconStyle
|
|
@@ -155,4 +155,22 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
var _default = (0, _theming.withTheme)(FAB);
|
|
158
|
+
exports.default = _default;ow",
|
|
159
|
+
alignItems: "center",
|
|
160
|
+
justifyContent: "center"
|
|
161
|
+
},
|
|
162
|
+
icon: {
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
justifyContent: "center",
|
|
165
|
+
width: _Config.default.buttonIconSize
|
|
166
|
+
},
|
|
167
|
+
fixed: {
|
|
168
|
+
left: 0,
|
|
169
|
+
right: 0,
|
|
170
|
+
bottom: 0,
|
|
171
|
+
height: 64,
|
|
172
|
+
borderRadius: 0
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
var _default = (0, _theming.withTheme)(FAB);
|
|
158
176
|
exports.default = _default;
|
|
@@ -7,16 +7,31 @@ exports.default = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
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); }
|
|
9
9
|
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; }
|
|
10
|
-
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; }
|
|
11
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
-
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); }
|
|
13
10
|
class PortalConsumer extends React.Component {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
_defineProperty(this, "key", void 0);
|
|
17
|
-
}
|
|
18
11
|
async componentDidMount() {
|
|
19
12
|
this.checkManager();
|
|
13
|
+
// Delay updating to prevent React from going to infinite loop
|
|
14
|
+
await Promise.resolve();
|
|
15
|
+
this.key = this.props.manager.mount(this.props.children);
|
|
16
|
+
}
|
|
17
|
+
componentDidUpdate() {
|
|
18
|
+
this.checkManager();
|
|
19
|
+
this.props.manager.update(this.key, this.props.children);
|
|
20
|
+
}
|
|
21
|
+
componentWillUnmount() {
|
|
22
|
+
this.checkManager();
|
|
23
|
+
this.props.manager.unmount(this.key);
|
|
24
|
+
}
|
|
25
|
+
checkManager() {
|
|
26
|
+
if (!this.props.manager) {
|
|
27
|
+
throw new Error("Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n" + "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + "https://callstack.github.io/react-native-paper/getting-started.html");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = PortalConsumer;s.checkManager();
|
|
20
35
|
|
|
21
36
|
// Delay updating to prevent React from going to infinite loop
|
|
22
37
|
await Promise.resolve();
|
|
@@ -8,9 +8,8 @@ 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
|
-
|
|
12
|
-
|
|
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); }
|
|
11
|
+
// @ts-nocheck
|
|
12
|
+
|
|
14
13
|
const STEP_STATUS = {
|
|
15
14
|
CURRENT: "current",
|
|
16
15
|
FINISHED: "finished",
|
|
@@ -19,7 +18,7 @@ const STEP_STATUS = {
|
|
|
19
18
|
class StepIndicator extends _react.Component {
|
|
20
19
|
constructor(props) {
|
|
21
20
|
super(props);
|
|
22
|
-
|
|
21
|
+
this.renderProgressBarBackground = () => {
|
|
23
22
|
const {
|
|
24
23
|
stepCount,
|
|
25
24
|
direction
|
|
@@ -62,8 +61,8 @@ class StepIndicator extends _react.Component {
|
|
|
62
61
|
},
|
|
63
62
|
style: progressBarBackgroundStyle
|
|
64
63
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
64
|
+
};
|
|
65
|
+
this.renderProgressBar = () => {
|
|
67
66
|
const {
|
|
68
67
|
stepCount,
|
|
69
68
|
direction
|
|
@@ -93,8 +92,8 @@ class StepIndicator extends _react.Component {
|
|
|
93
92
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
94
93
|
style: progressBarStyle
|
|
95
94
|
});
|
|
96
|
-
}
|
|
97
|
-
|
|
95
|
+
};
|
|
96
|
+
this.renderStepIndicator = () => {
|
|
98
97
|
let steps = [];
|
|
99
98
|
const {
|
|
100
99
|
stepCount,
|
|
@@ -125,8 +124,8 @@ class StepIndicator extends _react.Component {
|
|
|
125
124
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
126
125
|
}]
|
|
127
126
|
}, steps);
|
|
128
|
-
}
|
|
129
|
-
|
|
127
|
+
};
|
|
128
|
+
this.renderStepLabels = () => {
|
|
130
129
|
const {
|
|
131
130
|
labels,
|
|
132
131
|
direction,
|
|
@@ -168,8 +167,8 @@ class StepIndicator extends _react.Component {
|
|
|
168
167
|
alignItems: this.state.customStyles.labelAlign
|
|
169
168
|
}]
|
|
170
169
|
}, labelViews);
|
|
171
|
-
}
|
|
172
|
-
|
|
170
|
+
};
|
|
171
|
+
this.renderStep = position => {
|
|
173
172
|
const {
|
|
174
173
|
renderStepIndicator
|
|
175
174
|
} = this.props;
|
|
@@ -236,8 +235,8 @@ class StepIndicator extends _react.Component {
|
|
|
236
235
|
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
237
236
|
style: indicatorLabelStyle
|
|
238
237
|
}, "".concat(position + 1)));
|
|
239
|
-
}
|
|
240
|
-
|
|
238
|
+
};
|
|
239
|
+
this.getStepStatus = stepPosition => {
|
|
241
240
|
const {
|
|
242
241
|
currentPosition
|
|
243
242
|
} = this.props;
|
|
@@ -248,8 +247,8 @@ class StepIndicator extends _react.Component {
|
|
|
248
247
|
} else {
|
|
249
248
|
return STEP_STATUS.UNFINISHED;
|
|
250
249
|
}
|
|
251
|
-
}
|
|
252
|
-
|
|
250
|
+
};
|
|
251
|
+
this.onCurrentPositionChanged = position => {
|
|
253
252
|
let {
|
|
254
253
|
stepCount
|
|
255
254
|
} = this.props;
|
|
@@ -269,7 +268,7 @@ class StepIndicator extends _react.Component {
|
|
|
269
268
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
270
269
|
duration: 100
|
|
271
270
|
})])]).start();
|
|
272
|
-
}
|
|
271
|
+
};
|
|
273
272
|
const defaultStyles = {
|
|
274
273
|
stepIndicatorSize: 30,
|
|
275
274
|
currentStepIndicatorSize: 40,
|
|
@@ -335,7 +334,6 @@ class StepIndicator extends _react.Component {
|
|
|
335
334
|
// ),
|
|
336
335
|
// }));
|
|
337
336
|
// }
|
|
338
|
-
|
|
339
337
|
if (prevProps.currentPosition !== this.props.currentPosition) {
|
|
340
338
|
this.onCurrentPositionChanged(this.props.currentPosition);
|
|
341
339
|
}
|
|
@@ -377,6 +375,47 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
377
375
|
justifyContent: "center"
|
|
378
376
|
}
|
|
379
377
|
});
|
|
378
|
+
StepIndicator.defaultProps = {
|
|
379
|
+
currentPosition: 0,
|
|
380
|
+
stepCount: 5,
|
|
381
|
+
customStyles: {},
|
|
382
|
+
direction: "horizontal"
|
|
383
|
+
};exports.default = StepIndicator;
|
|
384
|
+
const styles = _reactNative.StyleSheet.create({
|
|
385
|
+
container: {
|
|
386
|
+
backgroundColor: "transparent"
|
|
387
|
+
},
|
|
388
|
+
stepIndicatorContainer: {
|
|
389
|
+
flexDirection: "row",
|
|
390
|
+
alignItems: "center",
|
|
391
|
+
justifyContent: "space-around",
|
|
392
|
+
backgroundColor: "transparent"
|
|
393
|
+
},
|
|
394
|
+
stepLabelsContainer: {
|
|
395
|
+
justifyContent: "space-around"
|
|
396
|
+
},
|
|
397
|
+
step: {
|
|
398
|
+
alignItems: "center",
|
|
399
|
+
justifyContent: "center",
|
|
400
|
+
zIndex: 2
|
|
401
|
+
},
|
|
402
|
+
stepContainer: {
|
|
403
|
+
flex: 1,
|
|
404
|
+
flexDirection: "row",
|
|
405
|
+
alignItems: "center",
|
|
406
|
+
justifyContent: "center"
|
|
407
|
+
},
|
|
408
|
+
stepLabel: {
|
|
409
|
+
fontSize: 12,
|
|
410
|
+
textAlign: "center",
|
|
411
|
+
fontWeight: "500"
|
|
412
|
+
},
|
|
413
|
+
stepLabelItem: {
|
|
414
|
+
flex: 1,
|
|
415
|
+
alignItems: "center",
|
|
416
|
+
justifyContent: "center"
|
|
417
|
+
}
|
|
418
|
+
});
|
|
380
419
|
StepIndicator.defaultProps = {
|
|
381
420
|
currentPosition: 0,
|
|
382
421
|
stepCount: 5,
|
|
@@ -15,7 +15,6 @@ function overlay(elevation) {
|
|
|
15
15
|
let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _DarkTheme.default.colors.surface;
|
|
16
16
|
if (isAnimatedValue(elevation)) {
|
|
17
17
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
18
|
-
|
|
19
18
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
20
19
|
return elevation.interpolate({
|
|
21
20
|
inputRange,
|
|
@@ -24,7 +23,6 @@ function overlay(elevation) {
|
|
|
24
23
|
})
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
29
27
|
return calculateColor(surfaceColor, elevation);
|
|
30
28
|
}
|
|
@@ -65,4 +63,4 @@ const elevationOverlayTransparency = {
|
|
|
65
63
|
22: 15.72,
|
|
66
64
|
23: 15.84,
|
|
67
65
|
24: 16
|
|
68
|
-
};
|
|
66
|
+
};};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Animated } from "react-native";
|
|
2
|
-
export default function overlay<T extends Animated.Value | number>(elevation: T, surfaceColor?: string): T extends number ? string : Animated.AnimatedInterpolation
|
|
2
|
+
export default function overlay<T extends Animated.Value | number>(elevation: T, surfaceColor?: string): T extends number ? string : Animated.AnimatedInterpolation<string | number>;
|
|
3
3
|
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/styles/overlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOxC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,SAAS,QAAQ,CAAC,KAAK,GAAG,MAAM,EAC/D,SAAS,EAAE,CAAC,EACZ,YAAY,GAAE,MAAiC,GAC9C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/styles/overlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOxC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,SAAS,QAAQ,CAAC,KAAK,GAAG,MAAM,EAC/D,SAAS,EAAE,CAAC,EACZ,YAAY,GAAE,MAAiC,GAC9C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,qBAAqB,CAAC,MAAM,GAAG,MAAM,CAAC,CAe7E"}
|
|
@@ -3,10 +3,10 @@ export default function shadow(elevation?: number | Animated.Value): {
|
|
|
3
3
|
shadowColor: string;
|
|
4
4
|
shadowOffset: {
|
|
5
5
|
width: Animated.Value;
|
|
6
|
-
height: Animated.AnimatedInterpolation
|
|
6
|
+
height: Animated.AnimatedInterpolation<string | number>;
|
|
7
7
|
};
|
|
8
8
|
shadowOpacity: Animated.Value;
|
|
9
|
-
shadowRadius: Animated.AnimatedInterpolation
|
|
9
|
+
shadowRadius: Animated.AnimatedInterpolation<string | number>;
|
|
10
10
|
} | {
|
|
11
11
|
shadowColor?: undefined;
|
|
12
12
|
shadowOffset?: undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.5.2-
|
|
3
|
+
"version": "46.5.2-b02f9e.2+b02f9ef",
|
|
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.5.2-
|
|
44
|
+
"@draftbit/types": "^46.5.2-b02f9e.2+b02f9ef",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
]
|
|
92
92
|
]
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "b02f9ef43e0e0676b1f335df6df6fd71dff05e20"
|
|
95
95
|
}
|
package/src/styles/overlay.tsx
CHANGED
|
@@ -4,13 +4,13 @@ import { Animated } from "react-native";
|
|
|
4
4
|
import DarkTheme from "./DarkTheme";
|
|
5
5
|
|
|
6
6
|
const isAnimatedValue = (
|
|
7
|
-
it: number | Animated.AnimatedInterpolation
|
|
7
|
+
it: number | Animated.AnimatedInterpolation<string | number>
|
|
8
8
|
): it is Animated.Value => it instanceof Animated.Value;
|
|
9
9
|
|
|
10
10
|
export default function overlay<T extends Animated.Value | number>(
|
|
11
11
|
elevation: T,
|
|
12
12
|
surfaceColor: string = DarkTheme.colors.surface
|
|
13
|
-
): T extends number ? string : Animated.AnimatedInterpolation {
|
|
13
|
+
): T extends number ? string : Animated.AnimatedInterpolation<string | number> {
|
|
14
14
|
if (isAnimatedValue(elevation)) {
|
|
15
15
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
16
16
|
|