@widergy/mobile-ui 1.4.1 → 1.4.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 +7 -0
- package/lib/components/Checkbox/index.js +2 -2
- package/lib/components/UTMenu/components/ListView/index.js +2 -2
- package/lib/components/UTSwitch/index.js +2 -2
- package/lib/components/UTTextInput/components/BaseInput/index.js +1 -1
- package/lib/components/UTTextInput/flavors/OutlinedInput/index.js +4 -4
- package/lib/components/UTTopbar/index.js +17 -2
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.4.2](https://github.com/widergy/mobile-ui/compare/v1.4.1...v1.4.2) (2024-04-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* native back button handler for UTTopbar ([#272](https://github.com/widergy/mobile-ui/issues/272)) ([36f8fd7](https://github.com/widergy/mobile-ui/commit/36f8fd7f467a7c0f342fc9d844452eec385e99a8))
|
|
7
|
+
|
|
1
8
|
## [1.4.1](https://github.com/widergy/mobile-ui/compare/v1.4.0...v1.4.1) (2024-04-04)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -70,8 +70,8 @@ const Checkbox = ({
|
|
|
70
70
|
disabled
|
|
71
71
|
? disabledCheckedColor || theme.colors.disabled
|
|
72
72
|
: checked
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
? checkedColor || theme.colors.primary
|
|
74
|
+
: uncheckedColor || theme.colors.checkbox.unchecked
|
|
75
75
|
}
|
|
76
76
|
name={checked ? CHECKED_ICON : UNCHECKED_ICON}
|
|
77
77
|
size={iconSize}
|
|
@@ -22,8 +22,8 @@ class ListView extends PureComponent {
|
|
|
22
22
|
return isMultiple
|
|
23
23
|
? !!selectedOption?.find?.(elem => elem === item.value)
|
|
24
24
|
: !query
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
? item.id === selectedOption
|
|
26
|
+
: item.id === filteredOptions[0].id;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
handleOnPress = item => {
|
|
@@ -91,8 +91,8 @@ const UTSwitch = ({
|
|
|
91
91
|
thumbTrackDiference <= 0
|
|
92
92
|
? trackLength - thumbSize
|
|
93
93
|
: thumbTrackDiference > thumbSize / 2
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
? trackLength - thumbSize * 1.5
|
|
95
|
+
: trackLength - thumbSize * 1.2;
|
|
96
96
|
|
|
97
97
|
return (
|
|
98
98
|
<TouchableWithoutFeedback
|
|
@@ -9,7 +9,7 @@ import Icon from '../../../Icon';
|
|
|
9
9
|
import Touchable from '../../../Touchable';
|
|
10
10
|
|
|
11
11
|
import { DEBOUNCE_DELAY, DEBOUNCE_CONFIG, VISIBILITY, VISIBILITY_OFF } from './constants';
|
|
12
|
-
import styles
|
|
12
|
+
import styles from './styles';
|
|
13
13
|
|
|
14
14
|
const BaseInput = forwardRef(
|
|
15
15
|
(
|
|
@@ -79,10 +79,10 @@ const OutlinedInput = ({
|
|
|
79
79
|
borderWidth: borderless
|
|
80
80
|
? 0
|
|
81
81
|
: focused
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
? 2
|
|
83
|
+
: disabled
|
|
84
|
+
? themeStyles?.inactive?.disabledBorderWidth ?? 1
|
|
85
|
+
: 1,
|
|
86
86
|
borderColor: active ? activeColor : inactiveColor
|
|
87
87
|
},
|
|
88
88
|
styles?.inputContainer
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { BackHandler, View } from 'react-native';
|
|
3
3
|
import { number } from 'prop-types';
|
|
4
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5
|
+
import { useFocusEffect } from '@react-navigation/native';
|
|
4
6
|
|
|
5
7
|
import IconButton from '../IconButton';
|
|
6
8
|
import Label from '../Label';
|
|
@@ -23,6 +25,19 @@ const UTTopbar = ({
|
|
|
23
25
|
|
|
24
26
|
const ownTheme = theme.UTWorkflowContainer?.topbar?.[colorTheme];
|
|
25
27
|
|
|
28
|
+
useFocusEffect(
|
|
29
|
+
useCallback(() => {
|
|
30
|
+
const onBackPress = () => {
|
|
31
|
+
goBack();
|
|
32
|
+
return true;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const subscription = BackHandler.addEventListener('hardwareBackPress', onBackPress);
|
|
36
|
+
|
|
37
|
+
return () => subscription.remove();
|
|
38
|
+
}, [goBack])
|
|
39
|
+
);
|
|
40
|
+
|
|
26
41
|
return (
|
|
27
42
|
<View>
|
|
28
43
|
<View style={[ownStyles.container, ownTheme?.container]}>
|
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": "1.4.
|
|
5
|
+
"version": "1.4.2",
|
|
6
6
|
"repository": "https://github.com/widergy/mobile-ui.git",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
8
|
"files": [
|
|
@@ -23,17 +23,18 @@
|
|
|
23
23
|
"prepare": "husky install"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
+
"@bam.tech/react-native-image-resizer": "^3.0.7",
|
|
26
27
|
"prop-types": "*",
|
|
27
28
|
"react": "*",
|
|
28
29
|
"react-native": "*",
|
|
29
30
|
"react-native-document-picker": "^9.0.1",
|
|
30
31
|
"react-native-image-picker": "^5.0.0",
|
|
31
32
|
"react-native-pager-view": "^6.2.0",
|
|
32
|
-
"@bam.tech/react-native-image-resizer": "^3.0.7",
|
|
33
33
|
"react-native-svg": "^13.0.0",
|
|
34
34
|
"react-native-vector-icons": "^10.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
+
"@react-navigation/native": "^6.1.9",
|
|
37
38
|
"@widergy/web-utils": "^2.0.0",
|
|
38
39
|
"core-js": "3",
|
|
39
40
|
"deprecated-react-native-prop-types": "^4.2.1",
|