secullum-react-native-ui 4.16.2-beta.12 → 4.16.2-beta.13

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.
@@ -25,6 +25,7 @@ export interface DropDownProperties {
25
25
  arrowColor?: string | undefined;
26
26
  searchable?: SearchableProps;
27
27
  virtualized?: true | VirtualizedProps;
28
+ useKeyboardAvoidingView?: boolean;
28
29
  }
29
30
  export interface SearchableProps {
30
31
  placeHolder: string;
@@ -305,11 +305,30 @@ class DropDown extends React.Component {
305
305
  }
306
306
  render() {
307
307
  const { modalOpen, searchText } = this.state;
308
- const { label, items, value, emptyMessage, style, disabledStyle, disabled, labelStyle, inputStyle, nativeID, onPress, icon, searchable } = this.props;
308
+ const { label, items, value, emptyMessage, style, disabledStyle, disabled, labelStyle, inputStyle, nativeID, onPress, icon, searchable, useKeyboardAvoidingView } = this.props;
309
309
  const selectedItem = items.find(x => x.value === value);
310
310
  const styles = this.getStyles();
311
311
  const theme = (0, theme_1.getTheme)();
312
312
  const filteredItems = searchable ? this.filterItems() : items;
313
+ const conteudoModal = (React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: react_native_1.Keyboard.dismiss },
314
+ React.createElement(react_native_1.View, { style: [
315
+ styles.modalContainer,
316
+ react_native_1.Platform.OS === 'web' && {
317
+ marginVertical: '10px',
318
+ marginHorizontal: 'auto',
319
+ width: '90%',
320
+ maxWidth: 450,
321
+ maxHeight: 300,
322
+ justifyContent: 'center'
323
+ }
324
+ ] },
325
+ this.shouldDisplaySearchField() && (React.createElement(react_native_1.View, { style: styles.searchContainer },
326
+ React.createElement(react_native_1.View, { style: styles.inputWrapper },
327
+ React.createElement(react_native_1.TextInput, { nativeID: nativeID + '-text-search', style: styles.searchInput, value: searchText, placeholder: searchable && searchable.placeHolder, onChangeText: text => this.setState({ searchText: text }) }),
328
+ React.createElement(FontAwesome_1.default, { name: "search", size: 16, color: "gray", style: styles.searchIcon })))),
329
+ filteredItems.length > 0 ? (this.renderItemsList(filteredItems)) : (React.createElement(react_native_1.View, { style: styles.emptyMessageContainer },
330
+ React.createElement(FontAwesome_1.default, { name: "warning", color: theme.warningColor, size: 24 }),
331
+ React.createElement(react_native_1.Text, { style: styles.modalItem }, emptyMessage))))));
313
332
  return (React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: () => __awaiter(this, void 0, void 0, function* () {
314
333
  if (onPress) {
315
334
  const result = yield onPress();
@@ -326,27 +345,7 @@ class DropDown extends React.Component {
326
345
  ] },
327
346
  icon ? (React.createElement(FontAwesome_1.default, { name: icon, style: styles.iconOnLine })) : (React.createElement(react_native_1.Text, { style: [styles.label, labelStyle] }, label)),
328
347
  this.renderClosedDropDown(selectedItem, inputStyle),
329
- React.createElement(Modal_1.Modal, { visible: modalOpen, onRequestClose: () => this.setState({ modalOpen: false }), overlayStyle: styles.modalOverlay },
330
- React.createElement(react_native_1.KeyboardAvoidingView, { behavior: react_native_1.Platform.OS === 'ios' ? 'padding' : 'height' },
331
- React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: react_native_1.Keyboard.dismiss },
332
- React.createElement(react_native_1.View, { style: [
333
- styles.modalContainer,
334
- react_native_1.Platform.OS === 'web' && {
335
- marginVertical: '10px',
336
- marginHorizontal: 'auto',
337
- width: '90%',
338
- maxWidth: 450,
339
- maxHeight: 300,
340
- justifyContent: 'center'
341
- }
342
- ] },
343
- this.shouldDisplaySearchField() && (React.createElement(react_native_1.View, { style: styles.searchContainer },
344
- React.createElement(react_native_1.View, { style: styles.inputWrapper },
345
- React.createElement(react_native_1.TextInput, { nativeID: nativeID + '-text-search', style: styles.searchInput, value: searchText, placeholder: searchable && searchable.placeHolder, onChangeText: text => this.setState({ searchText: text }) }),
346
- React.createElement(FontAwesome_1.default, { name: "search", size: 16, color: "gray", style: styles.searchIcon })))),
347
- filteredItems.length > 0 ? (this.renderItemsList(filteredItems)) : (React.createElement(react_native_1.View, { style: styles.emptyMessageContainer },
348
- React.createElement(FontAwesome_1.default, { name: "warning", color: theme.warningColor, size: 24 }),
349
- React.createElement(react_native_1.Text, { style: styles.modalItem }, emptyMessage))))))))));
348
+ React.createElement(Modal_1.Modal, { visible: modalOpen, onRequestClose: () => this.setState({ modalOpen: false }), overlayStyle: styles.modalOverlay }, useKeyboardAvoidingView ? (React.createElement(react_native_1.KeyboardAvoidingView, { behavior: react_native_1.Platform.OS === 'ios' ? 'padding' : 'height' }, conteudoModal)) : (conteudoModal)))));
350
349
  }
351
350
  }
352
351
  exports.DropDown = DropDown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secullum-react-native-ui",
3
- "version": "4.16.2-beta.12",
3
+ "version": "4.16.2-beta.13",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "files": [