@widergy/mobile-ui 0.36.0 → 0.36.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [0.36.2](https://github.com/widergy/mobile-ui/compare/v0.36.1...v0.36.2) (2023-01-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * read only radio group ([#234](https://github.com/widergy/mobile-ui/issues/234)) ([ffcd1d5](https://github.com/widergy/mobile-ui/commit/ffcd1d5bb914a95336e85f0b81775b3b71ebf091))
7
+
8
+ ## [0.36.1](https://github.com/widergy/mobile-ui/compare/v0.36.0...v0.36.1) (2023-01-09)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * avoid automatic selection of first option ([#233](https://github.com/widergy/mobile-ui/issues/233)) ([fecb7e0](https://github.com/widergy/mobile-ui/commit/fecb7e0002786de872d54c0e3957d5164dc0b37d))
14
+
1
15
  # [0.36.0](https://github.com/widergy/mobile-ui/compare/v0.35.8...v0.36.0) (2022-12-02)
2
16
 
3
17
 
@@ -29,11 +29,12 @@ class RadioButton extends Component {
29
29
  theme,
30
30
  labelComponent,
31
31
  descriptionComponent,
32
- showSeparatorBar
32
+ showSeparatorBar,
33
+ editable
33
34
  } = this.props;
34
35
  return (
35
36
  <Fragment>
36
- <Touchable onPress={this.handlePress}>
37
+ <Touchable onPress={this.handlePress} disabled={!editable}>
37
38
  <View style={[styles.container, style]}>
38
39
  {descriptionComponent ? (
39
40
  <View style={styles.descriptionComponentContainer}>
@@ -96,7 +97,8 @@ RadioButton.propTypes = {
96
97
  theme: themeType,
97
98
  labelComponent: PropTypes.node,
98
99
  descriptionComponent: PropTypes.node,
99
- showSeparatorBar: PropTypes.bool
100
+ showSeparatorBar: PropTypes.bool,
101
+ editable: PropTypes.bool
100
102
  };
101
103
 
102
104
  export default withTheme(RadioButton);
@@ -16,7 +16,7 @@ class RadioGroup extends Component {
16
16
  };
17
17
 
18
18
  renderOptions = option => {
19
- const { selectedOption, radioProps, keyField } = this.props;
19
+ const { selectedOption, radioProps, keyField, editable } = this.props;
20
20
  return (
21
21
  <RadioButton
22
22
  style={styles.radio}
@@ -29,6 +29,7 @@ class RadioGroup extends Component {
29
29
  status={selectedOption === option[keyField]}
30
30
  descriptionComponent={option?.Component}
31
31
  showSeparatorBar={option?.showSeparatorBar}
32
+ editable={editable}
32
33
  {...radioProps}
33
34
  />
34
35
  );
@@ -74,7 +75,8 @@ RadioGroup.propTypes = {
74
75
  leftButton: PropTypes.bool
75
76
  }),
76
77
  titleProps: PropTypes.instanceOf(Object),
77
- keyField: PropTypes.string
78
+ keyField: PropTypes.string,
79
+ editable: PropTypes.bool
78
80
  };
79
81
 
80
82
  RadioGroup.defaultProps = {
@@ -132,8 +132,8 @@ const UTMenu = ({
132
132
  onChange={setQuery}
133
133
  placeholder={autoCompletePlaceholder}
134
134
  onSubmitEditing={
135
- query
136
- ? filteredOptions[0] && handleOptionPress(() => onPress(filteredOptions[0]))
135
+ query && filteredOptions[0]
136
+ ? () => handleOptionPress(() => onPress(filteredOptions[0]))
137
137
  : closeMenu
138
138
  }
139
139
  />
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@widergy/mobile-ui",
3
3
  "description": "Widergy Mobile Components",
4
4
  "author": "widergy",
5
- "version": "0.36.0",
5
+ "version": "0.36.2",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [