@widergy/mobile-ui 1.42.0 → 1.44.0
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 +14 -0
- package/lib/components/CheckList/index.js +4 -2
- package/lib/components/RateChart/components/CategoryButton/index.js +2 -1
- package/lib/components/RateChart/components/RateStagesGraph/components/Indicator/index.js +12 -10
- package/lib/components/RateChart/components/RateStagesGraph/index.js +11 -8
- package/lib/components/RateChart/index.js +17 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.44.0](https://github.com/widergy/mobile-ui/compare/v1.43.0...v1.44.0) (2025-05-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add simple selection ([#428](https://github.com/widergy/mobile-ui/issues/428)) ([10989ce](https://github.com/widergy/mobile-ui/commit/10989ce4886192674688bae7877ae15dab77b4ec))
|
|
7
|
+
|
|
8
|
+
# [1.43.0](https://github.com/widergy/mobile-ui/compare/v1.42.0...v1.43.0) (2025-05-05)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* [UGENSA-1749] hide amount in rate chart ([#426](https://github.com/widergy/mobile-ui/issues/426)) ([53bf273](https://github.com/widergy/mobile-ui/commit/53bf273e688d4c06849381e854a93908d2f9fcdf))
|
|
14
|
+
|
|
1
15
|
# [1.42.0](https://github.com/widergy/mobile-ui/compare/v1.41.0...v1.42.0) (2025-04-30)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -25,11 +25,13 @@ class CheckList extends PureComponent {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
handleChange = receivedValue => () => {
|
|
28
|
-
const { input } = this.props;
|
|
28
|
+
const { input, isSimpleSelection } = this.props;
|
|
29
29
|
const { onChange, value } = input;
|
|
30
30
|
|
|
31
31
|
const newValues = !value?.find?.(elem => elem === receivedValue)
|
|
32
|
-
?
|
|
32
|
+
? isSimpleSelection
|
|
33
|
+
? [receivedValue]
|
|
34
|
+
: [...(value || []), receivedValue]
|
|
33
35
|
: value?.filter(elem => elem !== receivedValue);
|
|
34
36
|
if (onChange) onChange(isEmpty(newValues) ? [] : newValues);
|
|
35
37
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { arrayOf, bool, object, string } from 'prop-types';
|
|
3
3
|
import { Linking, View } from 'react-native';
|
|
4
|
+
import { isEmpty } from 'lodash';
|
|
4
5
|
|
|
5
6
|
import UTButton from '../../../UTButton';
|
|
6
7
|
|
|
7
8
|
const CategoryButton = ({ category, texts, showCategory, categoryButtonUrl = '' }) => {
|
|
8
|
-
const handleOpenUrl = () => Linking.openURL(categoryButtonUrl);
|
|
9
|
+
const handleOpenUrl = () => (!isEmpty(categoryButtonUrl) ? Linking.openURL(categoryButtonUrl) : {});
|
|
9
10
|
|
|
10
11
|
return (
|
|
11
12
|
<View>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Fragment, useState } from 'react';
|
|
2
|
-
import { number, string, arrayOf, shape, any } from 'prop-types';
|
|
2
|
+
import { number, string, arrayOf, shape, any, bool } from 'prop-types';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import Magnitude from '../../../Magnitude';
|
|
@@ -10,13 +10,14 @@ import styles, { ICON_SIZE } from './styles';
|
|
|
10
10
|
import { getIndicatorPosition, getTextPosition, getTotalRange } from './utils';
|
|
11
11
|
|
|
12
12
|
const Indicator = ({
|
|
13
|
-
consumptionValue,
|
|
14
|
-
consumptionUnit,
|
|
15
|
-
amountValue,
|
|
16
13
|
amountUnit,
|
|
14
|
+
amountValue,
|
|
15
|
+
consumptionLimit,
|
|
16
|
+
consumptionUnit,
|
|
17
|
+
consumptionValue,
|
|
17
18
|
rateStages,
|
|
18
19
|
texts,
|
|
19
|
-
|
|
20
|
+
withoutAmountValue
|
|
20
21
|
}) => {
|
|
21
22
|
const { indicatorLabel } = texts || {};
|
|
22
23
|
const [surfaceWidth, setSurfaceWidth] = useState(0);
|
|
@@ -63,7 +64,7 @@ const Indicator = ({
|
|
|
63
64
|
unity={consumptionUnit}
|
|
64
65
|
iconProps={{ height: ICON_SIZE, width: ICON_SIZE }}
|
|
65
66
|
/>
|
|
66
|
-
{consumptionValue > 0 && (
|
|
67
|
+
{!withoutAmountValue && consumptionValue > 0 && (
|
|
67
68
|
<Magnitude
|
|
68
69
|
semibold
|
|
69
70
|
value={amountValue}
|
|
@@ -102,13 +103,14 @@ const Indicator = ({
|
|
|
102
103
|
};
|
|
103
104
|
|
|
104
105
|
Indicator.propTypes = {
|
|
105
|
-
consumptionValue: number,
|
|
106
|
-
consumptionUnit: string,
|
|
107
|
-
amountValue: string,
|
|
108
106
|
amountUnit: number,
|
|
107
|
+
amountValue: string,
|
|
108
|
+
consumptionLimit: number,
|
|
109
|
+
consumptionUnit: string,
|
|
110
|
+
consumptionValue: number,
|
|
109
111
|
rateStages: arrayOf(shape(any)),
|
|
110
112
|
texts: arrayOf(shape(any)),
|
|
111
|
-
|
|
113
|
+
withoutAmountValue: bool
|
|
112
114
|
};
|
|
113
115
|
|
|
114
116
|
export default Indicator;
|
|
@@ -9,14 +9,15 @@ import styles from './styles';
|
|
|
9
9
|
import Indicator from './components/Indicator';
|
|
10
10
|
|
|
11
11
|
const RateStagesGraph = ({
|
|
12
|
-
consumptionValue,
|
|
13
|
-
consumptionUnit,
|
|
14
|
-
amountValue,
|
|
15
12
|
amountUnit,
|
|
13
|
+
amountValue,
|
|
14
|
+
consumptionLimit,
|
|
15
|
+
consumptionUnit,
|
|
16
|
+
consumptionValue,
|
|
16
17
|
rateStages,
|
|
17
18
|
texts,
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
withoutAmountValue,
|
|
20
|
+
withoutStages
|
|
20
21
|
}) => (
|
|
21
22
|
<View style={styles.container}>
|
|
22
23
|
<Bars rateStages={rateStages} withoutStages={withoutStages} />
|
|
@@ -28,18 +29,20 @@ const RateStagesGraph = ({
|
|
|
28
29
|
amountUnit={amountUnit}
|
|
29
30
|
rateStages={rateStages}
|
|
30
31
|
texts={texts}
|
|
32
|
+
withoutAmountValue={withoutAmountValue}
|
|
31
33
|
/>
|
|
32
34
|
</View>
|
|
33
35
|
);
|
|
34
36
|
|
|
35
37
|
RateStagesGraph.propTypes = {
|
|
36
|
-
|
|
38
|
+
amountUnit: string,
|
|
39
|
+
amountValue: number,
|
|
37
40
|
consumptionLimit: number,
|
|
38
41
|
consumptionUnit: string,
|
|
39
|
-
|
|
40
|
-
amountUnit: string,
|
|
42
|
+
consumptionValue: number,
|
|
41
43
|
rateStages: rateStagesTypes,
|
|
42
44
|
texts: arrayOf(shape(any)),
|
|
45
|
+
withoutAmountValue: bool,
|
|
43
46
|
withoutStages: bool
|
|
44
47
|
};
|
|
45
48
|
|
|
@@ -7,19 +7,20 @@ import RateStagesGraph from './components/RateStagesGraph';
|
|
|
7
7
|
import styles from './styles';
|
|
8
8
|
|
|
9
9
|
const RateChart = ({
|
|
10
|
-
consumptionValue,
|
|
11
|
-
consumptionUnit,
|
|
12
|
-
amountValue,
|
|
13
10
|
amountUnit,
|
|
11
|
+
amountValue,
|
|
14
12
|
category,
|
|
13
|
+
categoryButtonUrl,
|
|
14
|
+
consumptionLimit,
|
|
15
|
+
consumptionUnit,
|
|
16
|
+
consumptionValue,
|
|
15
17
|
rate,
|
|
16
18
|
rateStages,
|
|
17
|
-
texts,
|
|
18
|
-
withoutStages,
|
|
19
19
|
showCategory,
|
|
20
20
|
showCategoryButton,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
texts,
|
|
22
|
+
withoutAmountValue = false,
|
|
23
|
+
withoutStages
|
|
23
24
|
}) => {
|
|
24
25
|
const consumptionValueCorrected = consumptionValue && Math.round(consumptionValue);
|
|
25
26
|
|
|
@@ -45,6 +46,7 @@ const RateChart = ({
|
|
|
45
46
|
rateStages={rateStages}
|
|
46
47
|
texts={texts}
|
|
47
48
|
withoutStages={withoutStages}
|
|
49
|
+
withoutAmountValue={withoutAmountValue}
|
|
48
50
|
/>
|
|
49
51
|
)}
|
|
50
52
|
</View>
|
|
@@ -53,19 +55,20 @@ const RateChart = ({
|
|
|
53
55
|
};
|
|
54
56
|
|
|
55
57
|
RateChart.propTypes = {
|
|
56
|
-
consumptionValue: number,
|
|
57
|
-
consumptionUnit: string,
|
|
58
|
-
amountValue: number,
|
|
59
58
|
amountUnit: string,
|
|
59
|
+
amountValue: number,
|
|
60
60
|
category: string,
|
|
61
|
-
|
|
61
|
+
categoryButtonUrl: string,
|
|
62
62
|
consumptionLimit: number,
|
|
63
|
+
consumptionUnit: string,
|
|
64
|
+
consumptionValue: number,
|
|
65
|
+
rate: string,
|
|
63
66
|
rateStages: arrayOf(shape(any)),
|
|
64
|
-
texts: arrayOf(shape(any)),
|
|
65
|
-
withoutStages: bool,
|
|
66
67
|
showCategory: bool,
|
|
67
68
|
showCategoryButton: bool,
|
|
68
|
-
|
|
69
|
+
texts: arrayOf(shape(any)),
|
|
70
|
+
withoutAmountValue: bool,
|
|
71
|
+
withoutStages: bool
|
|
69
72
|
};
|
|
70
73
|
|
|
71
74
|
export default RateChart;
|
package/package.json
CHANGED