@draftbit/core 46.7.2-9358f4.2 → 46.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Accordion/AccordionItem.js +23 -4
- package/lib/commonjs/components/AnimatedCircularProgress.js +12 -1
- package/lib/commonjs/components/AvatarEdit.js +15 -4
- package/lib/commonjs/components/Button.js +33 -10
- package/lib/commonjs/components/CardBlock.js +13 -4
- package/lib/commonjs/components/Checkbox/Checkbox.js +22 -4
- package/lib/commonjs/components/Container.js +15 -4
- package/lib/commonjs/components/DeprecatedButton.js +20 -3
- package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
- package/lib/commonjs/components/Divider.js +14 -1
- package/lib/commonjs/components/Image.js +17 -2
- package/lib/commonjs/components/Picker/Picker.js +9 -4
- package/lib/commonjs/components/Portal/PortalHost.js +44 -15
- package/lib/commonjs/components/Portal/PortalManager.js +34 -8
- package/lib/commonjs/components/ProgressBar.js +37 -7
- package/lib/commonjs/components/Slider.js +21 -4
- package/lib/commonjs/components/Surface.js +14 -2
- package/lib/commonjs/components/TextField.js +76 -28
- package/lib/commonjs/components/Touchable.js +15 -2
- package/lib/commonjs/hooks.js +1 -2
- package/lib/commonjs/mappings/StarRating.js +6 -2
- package/lib/module/components/Button.js +33 -10
- package/lib/module/components/CardBlock.js +14 -4
- package/lib/module/components/CardContainerRating.js +14 -4
- package/lib/module/components/CardContainerShortImage.js +18 -4
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +24 -5
- package/lib/module/components/Checkbox/context.js +1 -1
- package/lib/module/components/CircleImage.js +16 -1
- package/lib/module/components/DeprecatedCardWrapper.js +18 -1
- package/lib/module/components/Divider.js +18 -1
- package/lib/module/components/Elevation.js +14 -2
- package/lib/module/components/FieldSearchBarFull.js +1 -2
- package/lib/module/components/FormRow.js +17 -2
- package/lib/module/components/Image.js +18 -2
- package/lib/module/components/Layout.js +42 -21
- package/lib/module/components/NumberInput.js +12 -3
- package/lib/module/components/Picker/PickerComponent.ios.js +36 -11
- package/lib/module/components/Portal/PortalConsumer.js +22 -7
- 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/Slider.js +21 -4
- package/lib/module/components/StepIndicator.js +58 -18
- 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 -2
- package/lib/module/mappings/FieldSearchBarFull.js +4 -1
- package/lib/module/styles/overlay.js +1 -3
- package/lib/module/utilities.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 { 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
|
import * as React from "react";
|
|
3
2
|
import { View, StyleSheet } from "react-native";
|
|
4
3
|
import NativeSlider from "@react-native-community/slider";
|
|
@@ -64,9 +63,10 @@ function Slider(_ref) {
|
|
|
64
63
|
setInternalValue(newValue);
|
|
65
64
|
onValueChange(newValue);
|
|
66
65
|
};
|
|
67
|
-
return /*#__PURE__*/React.createElement(View,
|
|
68
|
-
style: [styles.container, style]
|
|
69
|
-
|
|
66
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
67
|
+
style: [styles.container, style],
|
|
68
|
+
...rest
|
|
69
|
+
}, leftIcon ? /*#__PURE__*/React.createElement(Icon, {
|
|
70
70
|
color: leftIconThemeColor,
|
|
71
71
|
name: leftIcon,
|
|
72
72
|
size: 24
|
|
@@ -98,4 +98,21 @@ const styles = StyleSheet.create({
|
|
|
98
98
|
marginHorizontal: 12
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
|
+
export default withTheme(Slider);Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
102
|
+
color: rightIconThemeColor,
|
|
103
|
+
name: rightIcon,
|
|
104
|
+
size: 24
|
|
105
|
+
}) : null);
|
|
106
|
+
}
|
|
107
|
+
const styles = StyleSheet.create({
|
|
108
|
+
container: {
|
|
109
|
+
height: 40,
|
|
110
|
+
flexDirection: "row",
|
|
111
|
+
alignItems: "center"
|
|
112
|
+
},
|
|
113
|
+
slider: {
|
|
114
|
+
flex: 1,
|
|
115
|
+
marginHorizontal: 12
|
|
116
|
+
}
|
|
117
|
+
});
|
|
101
118
|
export default withTheme(Slider);
|
|
@@ -1,6 +1,3 @@
|
|
|
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
|
// @ts-nocheck
|
|
5
2
|
import React, { Component } from "react";
|
|
6
3
|
import { View, Text, StyleSheet, Animated, TouchableWithoutFeedback } from "react-native";
|
|
@@ -12,7 +9,7 @@ const STEP_STATUS = {
|
|
|
12
9
|
export default class StepIndicator extends Component {
|
|
13
10
|
constructor(props) {
|
|
14
11
|
super(props);
|
|
15
|
-
|
|
12
|
+
this.renderProgressBarBackground = () => {
|
|
16
13
|
const {
|
|
17
14
|
stepCount,
|
|
18
15
|
direction
|
|
@@ -55,8 +52,8 @@ export default class StepIndicator extends Component {
|
|
|
55
52
|
},
|
|
56
53
|
style: progressBarBackgroundStyle
|
|
57
54
|
});
|
|
58
|
-
}
|
|
59
|
-
|
|
55
|
+
};
|
|
56
|
+
this.renderProgressBar = () => {
|
|
60
57
|
const {
|
|
61
58
|
stepCount,
|
|
62
59
|
direction
|
|
@@ -86,8 +83,8 @@ export default class StepIndicator extends Component {
|
|
|
86
83
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
87
84
|
style: progressBarStyle
|
|
88
85
|
});
|
|
89
|
-
}
|
|
90
|
-
|
|
86
|
+
};
|
|
87
|
+
this.renderStepIndicator = () => {
|
|
91
88
|
let steps = [];
|
|
92
89
|
const {
|
|
93
90
|
stepCount,
|
|
@@ -118,8 +115,8 @@ export default class StepIndicator extends Component {
|
|
|
118
115
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
119
116
|
}]
|
|
120
117
|
}, steps);
|
|
121
|
-
}
|
|
122
|
-
|
|
118
|
+
};
|
|
119
|
+
this.renderStepLabels = () => {
|
|
123
120
|
const {
|
|
124
121
|
labels,
|
|
125
122
|
direction,
|
|
@@ -161,8 +158,8 @@ export default class StepIndicator extends Component {
|
|
|
161
158
|
alignItems: this.state.customStyles.labelAlign
|
|
162
159
|
}]
|
|
163
160
|
}, labelViews);
|
|
164
|
-
}
|
|
165
|
-
|
|
161
|
+
};
|
|
162
|
+
this.renderStep = position => {
|
|
166
163
|
const {
|
|
167
164
|
renderStepIndicator
|
|
168
165
|
} = this.props;
|
|
@@ -229,8 +226,8 @@ export default class StepIndicator extends Component {
|
|
|
229
226
|
}) : /*#__PURE__*/React.createElement(Text, {
|
|
230
227
|
style: indicatorLabelStyle
|
|
231
228
|
}, "".concat(position + 1)));
|
|
232
|
-
}
|
|
233
|
-
|
|
229
|
+
};
|
|
230
|
+
this.getStepStatus = stepPosition => {
|
|
234
231
|
const {
|
|
235
232
|
currentPosition
|
|
236
233
|
} = this.props;
|
|
@@ -241,8 +238,8 @@ export default class StepIndicator extends Component {
|
|
|
241
238
|
} else {
|
|
242
239
|
return STEP_STATUS.UNFINISHED;
|
|
243
240
|
}
|
|
244
|
-
}
|
|
245
|
-
|
|
241
|
+
};
|
|
242
|
+
this.onCurrentPositionChanged = position => {
|
|
246
243
|
let {
|
|
247
244
|
stepCount
|
|
248
245
|
} = this.props;
|
|
@@ -262,7 +259,7 @@ export default class StepIndicator extends Component {
|
|
|
262
259
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
263
260
|
duration: 100
|
|
264
261
|
})])]).start();
|
|
265
|
-
}
|
|
262
|
+
};
|
|
266
263
|
const defaultStyles = {
|
|
267
264
|
stepIndicatorSize: 30,
|
|
268
265
|
currentStepIndicatorSize: 40,
|
|
@@ -328,7 +325,6 @@ export default class StepIndicator extends Component {
|
|
|
328
325
|
// ),
|
|
329
326
|
// }));
|
|
330
327
|
// }
|
|
331
|
-
|
|
332
328
|
if (prevProps.currentPosition !== this.props.currentPosition) {
|
|
333
329
|
this.onCurrentPositionChanged(this.props.currentPosition);
|
|
334
330
|
}
|
|
@@ -369,6 +365,50 @@ const styles = StyleSheet.create({
|
|
|
369
365
|
justifyContent: "center"
|
|
370
366
|
}
|
|
371
367
|
});
|
|
368
|
+
StepIndicator.defaultProps = {
|
|
369
|
+
currentPosition: 0,
|
|
370
|
+
stepCount: 5,
|
|
371
|
+
customStyles: {},
|
|
372
|
+
direction: "horizontal"
|
|
373
|
+
};rrentPositionChanged(this.props.currentPosition);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
const styles = StyleSheet.create({
|
|
378
|
+
container: {
|
|
379
|
+
backgroundColor: "transparent"
|
|
380
|
+
},
|
|
381
|
+
stepIndicatorContainer: {
|
|
382
|
+
flexDirection: "row",
|
|
383
|
+
alignItems: "center",
|
|
384
|
+
justifyContent: "space-around",
|
|
385
|
+
backgroundColor: "transparent"
|
|
386
|
+
},
|
|
387
|
+
stepLabelsContainer: {
|
|
388
|
+
justifyContent: "space-around"
|
|
389
|
+
},
|
|
390
|
+
step: {
|
|
391
|
+
alignItems: "center",
|
|
392
|
+
justifyContent: "center",
|
|
393
|
+
zIndex: 2
|
|
394
|
+
},
|
|
395
|
+
stepContainer: {
|
|
396
|
+
flex: 1,
|
|
397
|
+
flexDirection: "row",
|
|
398
|
+
alignItems: "center",
|
|
399
|
+
justifyContent: "center"
|
|
400
|
+
},
|
|
401
|
+
stepLabel: {
|
|
402
|
+
fontSize: 12,
|
|
403
|
+
textAlign: "center",
|
|
404
|
+
fontWeight: "500"
|
|
405
|
+
},
|
|
406
|
+
stepLabelItem: {
|
|
407
|
+
flex: 1,
|
|
408
|
+
alignItems: "center",
|
|
409
|
+
justifyContent: "center"
|
|
410
|
+
}
|
|
411
|
+
});
|
|
372
412
|
StepIndicator.defaultProps = {
|
|
373
413
|
currentPosition: 0,
|
|
374
414
|
stepCount: 5,
|
|
@@ -1,7 +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
|
-
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; }
|
|
3
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
|
-
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); }
|
|
5
1
|
import * as React from "react";
|
|
6
2
|
import { View, Animated, TextInput as NativeTextInput, StyleSheet, Text, I18nManager } from "react-native";
|
|
7
3
|
import { withTheme } from "../theming";
|
|
@@ -13,7 +9,7 @@ const ICON_SIZE = 24;
|
|
|
13
9
|
class TextField extends React.Component {
|
|
14
10
|
constructor() {
|
|
15
11
|
super(...arguments);
|
|
16
|
-
|
|
12
|
+
this.state = {
|
|
17
13
|
nativeProps: {},
|
|
18
14
|
labeled: new Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
19
15
|
focused: false,
|
|
@@ -22,47 +18,46 @@ class TextField extends React.Component {
|
|
|
22
18
|
measured: false,
|
|
23
19
|
width: 0
|
|
24
20
|
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
};
|
|
22
|
+
this._timer = setTimeout(() => {}, 0);
|
|
23
|
+
this._showPlaceholder = () => {
|
|
28
24
|
clearTimeout(this._timer);
|
|
29
|
-
|
|
30
25
|
// Set the placeholder in a delay to offset the label animation
|
|
31
26
|
// If we show it immediately, they'll overlap and look ugly
|
|
32
27
|
this._timer = setTimeout(() => this.setState({
|
|
33
28
|
placeholder: this.props.placeholder
|
|
34
29
|
}), 50);
|
|
35
|
-
}
|
|
36
|
-
|
|
30
|
+
};
|
|
31
|
+
this._hidePlaceholder = () => this.setState({
|
|
37
32
|
placeholder: ""
|
|
38
|
-
})
|
|
39
|
-
|
|
33
|
+
});
|
|
34
|
+
this._restoreLabel = () => Animated.timing(this.state.labeled, {
|
|
40
35
|
toValue: 1,
|
|
41
36
|
duration: FOCUS_ANIMATION_DURATION,
|
|
42
37
|
useNativeDriver: true
|
|
43
|
-
}).start()
|
|
44
|
-
|
|
38
|
+
}).start();
|
|
39
|
+
this._minmizeLabel = () => Animated.timing(this.state.labeled, {
|
|
45
40
|
toValue: 0,
|
|
46
41
|
duration: BLUR_ANIMATION_DURATION,
|
|
47
42
|
useNativeDriver: true
|
|
48
|
-
}).start()
|
|
49
|
-
|
|
43
|
+
}).start();
|
|
44
|
+
this._handleFocus = () => {
|
|
50
45
|
if (this.props.disabled) {
|
|
51
46
|
return;
|
|
52
47
|
}
|
|
53
48
|
this.setState({
|
|
54
49
|
focused: true
|
|
55
50
|
});
|
|
56
|
-
}
|
|
57
|
-
|
|
51
|
+
};
|
|
52
|
+
this._handleBlur = () => {
|
|
58
53
|
if (this.props.disabled) {
|
|
59
54
|
return;
|
|
60
55
|
}
|
|
61
56
|
this.setState({
|
|
62
57
|
focused: false
|
|
63
58
|
});
|
|
64
|
-
}
|
|
65
|
-
|
|
59
|
+
};
|
|
60
|
+
this._handleChangeText = value => {
|
|
66
61
|
if (this.props.disabled) {
|
|
67
62
|
return;
|
|
68
63
|
}
|
|
@@ -77,8 +72,8 @@ class TextField extends React.Component {
|
|
|
77
72
|
});
|
|
78
73
|
this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
|
|
79
74
|
}
|
|
80
|
-
}
|
|
81
|
-
|
|
75
|
+
};
|
|
76
|
+
this._root = undefined;
|
|
82
77
|
}
|
|
83
78
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
84
79
|
return {
|
|
@@ -165,7 +160,9 @@ class TextField extends React.Component {
|
|
|
165
160
|
roundness,
|
|
166
161
|
disabledOpacity
|
|
167
162
|
},
|
|
168
|
-
render = props => /*#__PURE__*/React.createElement(NativeTextInput,
|
|
163
|
+
render = props => /*#__PURE__*/React.createElement(NativeTextInput, {
|
|
164
|
+
...props
|
|
165
|
+
}),
|
|
169
166
|
...rest
|
|
170
167
|
} = this.props;
|
|
171
168
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
@@ -305,9 +302,10 @@ class TextField extends React.Component {
|
|
|
305
302
|
} = StyleSheet.flatten(style || {});
|
|
306
303
|
return /*#__PURE__*/React.createElement(View, {
|
|
307
304
|
style: [styles.container, styleProp]
|
|
308
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon,
|
|
305
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
306
|
+
...leftIconProps,
|
|
309
307
|
style: leftIconStyle
|
|
310
|
-
})
|
|
308
|
+
}) : null, /*#__PURE__*/React.createElement(View, {
|
|
311
309
|
style: applyStyles([containerStyle], {
|
|
312
310
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
313
311
|
backgroundColor: bgColor,
|
|
@@ -375,9 +373,10 @@ class TextField extends React.Component {
|
|
|
375
373
|
style: {
|
|
376
374
|
justifyContent: type === "solid" ? "center" : undefined
|
|
377
375
|
}
|
|
378
|
-
}, /*#__PURE__*/React.createElement(Icon,
|
|
376
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
377
|
+
...leftIconProps,
|
|
379
378
|
style: leftIconStyle
|
|
380
|
-
}))
|
|
379
|
+
})) : null, render({
|
|
381
380
|
ref: c => {
|
|
382
381
|
this._root = c;
|
|
383
382
|
},
|
|
@@ -414,6 +413,57 @@ class TextField extends React.Component {
|
|
|
414
413
|
}
|
|
415
414
|
}
|
|
416
415
|
export default withTheme(TextField);
|
|
416
|
+
const styles = StyleSheet.create({
|
|
417
|
+
container: {
|
|
418
|
+
alignSelf: "stretch"
|
|
419
|
+
},
|
|
420
|
+
placeholder: {
|
|
421
|
+
position: "absolute",
|
|
422
|
+
left: 0
|
|
423
|
+
},
|
|
424
|
+
underline: {
|
|
425
|
+
position: "absolute",
|
|
426
|
+
left: 0,
|
|
427
|
+
right: 0,
|
|
428
|
+
bottom: 0,
|
|
429
|
+
height: 2
|
|
430
|
+
},
|
|
431
|
+
input: {
|
|
432
|
+
flexGrow: 1,
|
|
433
|
+
justifyContent: "center",
|
|
434
|
+
textAlignVertical: "center",
|
|
435
|
+
margin: 0,
|
|
436
|
+
textAlign: I18nManager.isRTL ? "right" : "left"
|
|
437
|
+
}
|
|
438
|
+
});ionColor: activeColor,
|
|
439
|
+
multiline,
|
|
440
|
+
numberOfLines,
|
|
441
|
+
onFocus: this._handleFocus,
|
|
442
|
+
onBlur: this._handleBlur,
|
|
443
|
+
underlineColorAndroid: "transparent",
|
|
444
|
+
style: inputStyles,
|
|
445
|
+
...rest,
|
|
446
|
+
...this.state.nativeProps,
|
|
447
|
+
value: this.state.value
|
|
448
|
+
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
449
|
+
name: rightIconName,
|
|
450
|
+
size: ICON_SIZE,
|
|
451
|
+
color: colors.light,
|
|
452
|
+
style: {
|
|
453
|
+
position: "absolute",
|
|
454
|
+
right: 16,
|
|
455
|
+
marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
|
|
456
|
+
}
|
|
457
|
+
}) : null, assistiveText ? /*#__PURE__*/React.createElement(Text, {
|
|
458
|
+
style: [{
|
|
459
|
+
color: error ? colors.error : colors.light,
|
|
460
|
+
marginTop: 8,
|
|
461
|
+
marginLeft: assistiveTextLeftMargin
|
|
462
|
+
}]
|
|
463
|
+
}, assistiveText) : null);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
export default withTheme(TextField);
|
|
417
467
|
const styles = StyleSheet.create({
|
|
418
468
|
container: {
|
|
419
469
|
alignSelf: "stretch"
|
|
@@ -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 { withTheme } from "../theming";
|
|
4
3
|
import { StyleSheet } from "react-native";
|
|
@@ -38,13 +37,28 @@ const ToggleButton = _ref => {
|
|
|
38
37
|
setInternalValue(!internalValue);
|
|
39
38
|
onPress(!internalValue);
|
|
40
39
|
};
|
|
41
|
-
return /*#__PURE__*/React.createElement(IconButton,
|
|
40
|
+
return /*#__PURE__*/React.createElement(IconButton, {
|
|
42
41
|
Icon: Icon,
|
|
43
42
|
icon: icon,
|
|
44
43
|
size: iconSize,
|
|
45
44
|
color: internalValue ? colors[color] : colors[colorSecondary],
|
|
46
45
|
onPress: handlePress,
|
|
47
46
|
disabled: disabled,
|
|
47
|
+
style: [styles.mainContainer, {
|
|
48
|
+
width,
|
|
49
|
+
height,
|
|
50
|
+
backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
|
|
51
|
+
borderColor: colors[borderColor]
|
|
52
|
+
}, style],
|
|
53
|
+
...rest
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
const styles = StyleSheet.create({
|
|
57
|
+
mainContainer: {
|
|
58
|
+
borderWidth: 1
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export default withTheme(ToggleButton);: disabled,
|
|
48
62
|
style: [styles.mainContainer, {
|
|
49
63
|
width,
|
|
50
64
|
height,
|
|
@@ -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
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Platform } from "react-native";
|
|
2
|
-
|
|
3
2
|
// @ts-ignore
|
|
4
3
|
const expo = global.__expo;
|
|
5
|
-
const DEFAULT_STATUSBAR_HEIGHT_EXPO = expo
|
|
4
|
+
const DEFAULT_STATUSBAR_HEIGHT_EXPO = (expo === null || expo === void 0 ? void 0 : expo.Constants) ? expo.Constants.statusBarHeight : 0;
|
|
6
5
|
export const APPROX_STATUSBAR_HEIGHT = Platform.select({
|
|
7
6
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
8
7
|
ios: Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
@@ -8,7 +8,6 @@ export const SEED_DATA = [{
|
|
|
8
8
|
preview_image_url: "{CLOUDINARY_URL}/Field_SearchBar_Full.png",
|
|
9
9
|
supports_list_render: false,
|
|
10
10
|
triggers: [Triggers.OnChange],
|
|
11
|
-
// TODO Triggers.OnSubmit for multiple triggers
|
|
12
11
|
props: {
|
|
13
12
|
icon: {
|
|
14
13
|
group: GROUPS.basic,
|
|
@@ -46,4 +45,8 @@ export const SEED_DATA = [{
|
|
|
46
45
|
}
|
|
47
46
|
},
|
|
48
47
|
layout: {}
|
|
48
|
+
}];alue: "searchBarValue"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
layout: {}
|
|
49
52
|
}];
|
|
@@ -7,7 +7,6 @@ export default function overlay(elevation) {
|
|
|
7
7
|
let surfaceColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DarkTheme.colors.surface;
|
|
8
8
|
if (isAnimatedValue(elevation)) {
|
|
9
9
|
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
10
|
-
|
|
11
10
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
12
11
|
return elevation.interpolate({
|
|
13
12
|
inputRange,
|
|
@@ -16,7 +15,6 @@ export default function overlay(elevation) {
|
|
|
16
15
|
})
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
// @ts-expect-error: TS doesn't seem to refine the type correctly
|
|
21
19
|
return calculateColor(surfaceColor, elevation);
|
|
22
20
|
}
|
|
@@ -57,4 +55,4 @@ const elevationOverlayTransparency = {
|
|
|
57
55
|
22: 15.72,
|
|
58
56
|
23: 15.84,
|
|
59
57
|
24: 16
|
|
60
|
-
};
|
|
58
|
+
};};
|
package/lib/module/utilities.js
CHANGED
|
@@ -44,7 +44,6 @@ export function extractBorderAndMarginStyles(style, additionalBorderStyles, addi
|
|
|
44
44
|
marginStyles
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
|
|
48
47
|
/**
|
|
49
48
|
* Merges a style object on top of another style object. In React Native,
|
|
50
49
|
* keys with undefined values in a style object will still override styles
|
|
@@ -77,4 +76,4 @@ export function getValueForRadioButton(value) {
|
|
|
77
76
|
} else {
|
|
78
77
|
throw new Error("Invalid value: ".concat(value));
|
|
79
78
|
}
|
|
80
|
-
}
|
|
79
|
+
}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.7.
|
|
3
|
+
"version": "46.7.3",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.7.
|
|
44
|
+
"@draftbit/types": "^46.7.3",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
]
|
|
92
92
|
]
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "6ca9942ecce0f011576b079016ca021548649133"
|
|
95
95
|
}
|