@hero-design/rn 8.139.1 → 8.139.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @hero-design/rn
|
|
2
2
|
|
|
3
|
+
## 8.139.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#5565](https://github.com/Thinkei/hero-design/pull/5565) [`3985de1`](https://github.com/Thinkei/hero-design/commit/3985de1d7c34161ef52137beda331bf2b0a0e184) Thanks [@ttkien](https://github.com/ttkien)! - [Switch] Fix disabled-checked state using the same color as disabled-unchecked
|
|
8
|
+
|
|
9
|
+
## 8.139.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#5561](https://github.com/Thinkei/hero-design/pull/5561) [`6391a1e`](https://github.com/Thinkei/hero-design/commit/6391a1e82979b5f1089edf4c2360cdd7e442eb0e) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Select] Fix options list collapsing behind keyboard in nested BottomSheet
|
|
14
|
+
|
|
3
15
|
## 8.139.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/es/index.js
CHANGED
|
@@ -7121,7 +7121,7 @@ var getSwitchTheme = function getSwitchTheme(theme) {
|
|
|
7121
7121
|
backgroundColors: {
|
|
7122
7122
|
checked: theme.colors.pressedSurface,
|
|
7123
7123
|
unchecked: theme.colors.inactiveOnDefaultGlobalSurface,
|
|
7124
|
-
'disabled-checked': theme.colors.
|
|
7124
|
+
'disabled-checked': theme.colors.pressedSurface,
|
|
7125
7125
|
'disabled-unchecked': theme.colors.inactiveOnDefaultGlobalSurface
|
|
7126
7126
|
},
|
|
7127
7127
|
thumb: theme.colors.white,
|
|
@@ -27912,6 +27912,9 @@ function MultiSelect(_ref) {
|
|
|
27912
27912
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27913
27913
|
open = _useState2[0],
|
|
27914
27914
|
setOpen = _useState2[1];
|
|
27915
|
+
var _useKeyboard = useKeyboard(),
|
|
27916
|
+
isKeyboardVisible = _useKeyboard.isKeyboardVisible,
|
|
27917
|
+
keyboardHeight = _useKeyboard.keyboardHeight;
|
|
27915
27918
|
var _useState3 = useState(value),
|
|
27916
27919
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
27917
27920
|
selectingValue = _useState4[0],
|
|
@@ -27965,6 +27968,12 @@ function MultiSelect(_ref) {
|
|
|
27965
27968
|
setOpen(false);
|
|
27966
27969
|
},
|
|
27967
27970
|
header: bottomSheetHeader || label,
|
|
27971
|
+
style: {
|
|
27972
|
+
paddingBottom: isKeyboardVisible ? keyboardHeight : 0
|
|
27973
|
+
},
|
|
27974
|
+
keyboardAvoidingViewProps: {
|
|
27975
|
+
enabled: false
|
|
27976
|
+
},
|
|
27968
27977
|
footer: typeof footerLabel === 'string' ? /*#__PURE__*/React__default.createElement(Footer, {
|
|
27969
27978
|
label: footerLabel,
|
|
27970
27979
|
onPress: function onPress() {
|
|
@@ -28119,6 +28128,9 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
28119
28128
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28120
28129
|
open = _useState2[0],
|
|
28121
28130
|
setOpen = _useState2[1];
|
|
28131
|
+
var _useKeyboard = useKeyboard(),
|
|
28132
|
+
isKeyboardVisible = _useKeyboard.isKeyboardVisible,
|
|
28133
|
+
keyboardHeight = _useKeyboard.keyboardHeight;
|
|
28122
28134
|
var sectionListRef = useRef(null);
|
|
28123
28135
|
var sections = toSections(options);
|
|
28124
28136
|
var flatOptions = toFlatOptions(options);
|
|
@@ -28165,6 +28177,12 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
28165
28177
|
setOpen(false);
|
|
28166
28178
|
},
|
|
28167
28179
|
header: bottomSheetHeader || label,
|
|
28180
|
+
style: {
|
|
28181
|
+
paddingBottom: isKeyboardVisible ? keyboardHeight : 0
|
|
28182
|
+
},
|
|
28183
|
+
keyboardAvoidingViewProps: {
|
|
28184
|
+
enabled: false
|
|
28185
|
+
},
|
|
28168
28186
|
onAnimationEnd: function onAnimationEnd() {
|
|
28169
28187
|
if (open === true) {
|
|
28170
28188
|
var _sectionListRef$curre;
|
package/lib/index.js
CHANGED
|
@@ -7150,7 +7150,7 @@ var getSwitchTheme = function getSwitchTheme(theme) {
|
|
|
7150
7150
|
backgroundColors: {
|
|
7151
7151
|
checked: theme.colors.pressedSurface,
|
|
7152
7152
|
unchecked: theme.colors.inactiveOnDefaultGlobalSurface,
|
|
7153
|
-
'disabled-checked': theme.colors.
|
|
7153
|
+
'disabled-checked': theme.colors.pressedSurface,
|
|
7154
7154
|
'disabled-unchecked': theme.colors.inactiveOnDefaultGlobalSurface
|
|
7155
7155
|
},
|
|
7156
7156
|
thumb: theme.colors.white,
|
|
@@ -27941,6 +27941,9 @@ function MultiSelect(_ref) {
|
|
|
27941
27941
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27942
27942
|
open = _useState2[0],
|
|
27943
27943
|
setOpen = _useState2[1];
|
|
27944
|
+
var _useKeyboard = useKeyboard(),
|
|
27945
|
+
isKeyboardVisible = _useKeyboard.isKeyboardVisible,
|
|
27946
|
+
keyboardHeight = _useKeyboard.keyboardHeight;
|
|
27944
27947
|
var _useState3 = React.useState(value),
|
|
27945
27948
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
27946
27949
|
selectingValue = _useState4[0],
|
|
@@ -27994,6 +27997,12 @@ function MultiSelect(_ref) {
|
|
|
27994
27997
|
setOpen(false);
|
|
27995
27998
|
},
|
|
27996
27999
|
header: bottomSheetHeader || label,
|
|
28000
|
+
style: {
|
|
28001
|
+
paddingBottom: isKeyboardVisible ? keyboardHeight : 0
|
|
28002
|
+
},
|
|
28003
|
+
keyboardAvoidingViewProps: {
|
|
28004
|
+
enabled: false
|
|
28005
|
+
},
|
|
27997
28006
|
footer: typeof footerLabel === 'string' ? /*#__PURE__*/React__namespace.default.createElement(Footer, {
|
|
27998
28007
|
label: footerLabel,
|
|
27999
28008
|
onPress: function onPress() {
|
|
@@ -28148,6 +28157,9 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
28148
28157
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28149
28158
|
open = _useState2[0],
|
|
28150
28159
|
setOpen = _useState2[1];
|
|
28160
|
+
var _useKeyboard = useKeyboard(),
|
|
28161
|
+
isKeyboardVisible = _useKeyboard.isKeyboardVisible,
|
|
28162
|
+
keyboardHeight = _useKeyboard.keyboardHeight;
|
|
28151
28163
|
var sectionListRef = React.useRef(null);
|
|
28152
28164
|
var sections = toSections(options);
|
|
28153
28165
|
var flatOptions = toFlatOptions(options);
|
|
@@ -28194,6 +28206,12 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
28194
28206
|
setOpen(false);
|
|
28195
28207
|
},
|
|
28196
28208
|
header: bottomSheetHeader || label,
|
|
28209
|
+
style: {
|
|
28210
|
+
paddingBottom: isKeyboardVisible ? keyboardHeight : 0
|
|
28211
|
+
},
|
|
28212
|
+
keyboardAvoidingViewProps: {
|
|
28213
|
+
enabled: false
|
|
28214
|
+
},
|
|
28197
28215
|
onAnimationEnd: function onAnimationEnd() {
|
|
28198
28216
|
if (open === true) {
|
|
28199
28217
|
var _sectionListRef$curre;
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import Box from '../../Box';
|
|
|
9
9
|
import type { TextInputProps } from '../../TextInput';
|
|
10
10
|
import TextInput from '../../TextInput';
|
|
11
11
|
import Footer from '../Footer';
|
|
12
|
+
import { useKeyboard } from '../../../utils/helpers';
|
|
12
13
|
import { getScrollParams, toFlatOptions, toSections } from '../helpers';
|
|
13
14
|
import { StyledSearchBar } from '../StyledSelect';
|
|
14
15
|
import type { SectionType, SelectOptionType, SelectProps } from '../types';
|
|
@@ -77,6 +78,7 @@ function MultiSelect<V, T extends SelectOptionType<V>>({
|
|
|
77
78
|
assistiveInfoConfig,
|
|
78
79
|
}: MultiSelectProps<V, T>) {
|
|
79
80
|
const [open, setOpen] = useState(false);
|
|
81
|
+
const { isKeyboardVisible, keyboardHeight } = useKeyboard();
|
|
80
82
|
const [selectingValue, setSelectingValue] = useState(value);
|
|
81
83
|
const sectionListRef = useRef<SectionList<T, SectionType>>(null);
|
|
82
84
|
const sections = toSections(options);
|
|
@@ -145,6 +147,8 @@ function MultiSelect<V, T extends SelectOptionType<V>>({
|
|
|
145
147
|
setOpen(false);
|
|
146
148
|
}}
|
|
147
149
|
header={bottomSheetHeader || label}
|
|
150
|
+
style={{ paddingBottom: isKeyboardVisible ? keyboardHeight : 0 }}
|
|
151
|
+
keyboardAvoidingViewProps={{ enabled: false }}
|
|
148
152
|
footer={
|
|
149
153
|
typeof footerLabel === 'string' ? (
|
|
150
154
|
<Footer
|
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
SectionList,
|
|
5
5
|
} from 'react-native';
|
|
6
6
|
import { TouchableOpacity, View } from 'react-native';
|
|
7
|
-
import { deepCompareValue } from '../../../utils/helpers';
|
|
7
|
+
import { deepCompareValue, useKeyboard } from '../../../utils/helpers';
|
|
8
8
|
import BottomSheet from '../../BottomSheet';
|
|
9
9
|
import type { TextInputProps } from '../../TextInput';
|
|
10
10
|
import TextInput from '../../TextInput';
|
|
@@ -62,6 +62,7 @@ const SingleSelect = <V, T extends SelectOptionType<V>>({
|
|
|
62
62
|
assistiveInfoConfig,
|
|
63
63
|
}: SingleSelectProps<V, T>) => {
|
|
64
64
|
const [open, setOpen] = useState(false);
|
|
65
|
+
const { isKeyboardVisible, keyboardHeight } = useKeyboard();
|
|
65
66
|
const sectionListRef = useRef<SectionList<T, SectionType>>(null);
|
|
66
67
|
const sections = toSections(options);
|
|
67
68
|
const flatOptions = toFlatOptions(options);
|
|
@@ -129,6 +130,8 @@ const SingleSelect = <V, T extends SelectOptionType<V>>({
|
|
|
129
130
|
setOpen(false);
|
|
130
131
|
}}
|
|
131
132
|
header={bottomSheetHeader || label}
|
|
133
|
+
style={{ paddingBottom: isKeyboardVisible ? keyboardHeight : 0 }}
|
|
134
|
+
keyboardAvoidingViewProps={{ enabled: false }}
|
|
132
135
|
onAnimationEnd={() => {
|
|
133
136
|
if (open === true) {
|
|
134
137
|
const scrollParams = getScrollParams(value, sections);
|
|
@@ -5,7 +5,7 @@ const getSwitchTheme = (theme: GlobalTheme) => {
|
|
|
5
5
|
backgroundColors: {
|
|
6
6
|
checked: theme.colors.pressedSurface,
|
|
7
7
|
unchecked: theme.colors.inactiveOnDefaultGlobalSurface,
|
|
8
|
-
'disabled-checked': theme.colors.
|
|
8
|
+
'disabled-checked': theme.colors.pressedSurface,
|
|
9
9
|
'disabled-unchecked': theme.colors.inactiveOnDefaultGlobalSurface,
|
|
10
10
|
},
|
|
11
11
|
thumb: theme.colors.white,
|