secullum-react-native-ui 4.16.2-beta.10 → 4.16.2-beta.12
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/lib/components/DropDown.js +22 -21
- package/package.json +1 -1
|
@@ -93,7 +93,7 @@ class DropDownItem extends React.PureComponent {
|
|
|
93
93
|
} }, this.renderOpenDropDownItem()));
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const DEFAULT_VIRTUALIZED_PROPS = {
|
|
97
97
|
initialNumToRender: 20,
|
|
98
98
|
maxToRenderPerBatch: 30,
|
|
99
99
|
windowSize: 10
|
|
@@ -299,7 +299,7 @@ class DropDown extends React.Component {
|
|
|
299
299
|
return (React.createElement(react_native_1.FlatList, { data: filteredItems, initialNumToRender: filteredItems.length, keyExtractor: item => item.value.toString(), renderItem: renderItem }));
|
|
300
300
|
}
|
|
301
301
|
const virtualizedProps = typeof virtualized === 'object'
|
|
302
|
-
? Object.assign(Object.assign({},
|
|
302
|
+
? Object.assign(Object.assign({}, DEFAULT_VIRTUALIZED_PROPS), virtualized) : DEFAULT_VIRTUALIZED_PROPS;
|
|
303
303
|
return (React.createElement(react_native_1.VirtualizedList, { getItem: (_, index) => filteredItems[index], getItemCount: () => filteredItems.length, keyExtractor: item => item.value.toString(), renderItem: renderItem, initialNumToRender: virtualizedProps.initialNumToRender, maxToRenderPerBatch: virtualizedProps.maxToRenderPerBatch, windowSize: virtualizedProps.windowSize }));
|
|
304
304
|
};
|
|
305
305
|
}
|
|
@@ -327,25 +327,26 @@ class DropDown extends React.Component {
|
|
|
327
327
|
icon ? (React.createElement(FontAwesome_1.default, { name: icon, style: styles.iconOnLine })) : (React.createElement(react_native_1.Text, { style: [styles.label, labelStyle] }, label)),
|
|
328
328
|
this.renderClosedDropDown(selectedItem, inputStyle),
|
|
329
329
|
React.createElement(Modal_1.Modal, { visible: modalOpen, onRequestClose: () => this.setState({ modalOpen: false }), overlayStyle: styles.modalOverlay },
|
|
330
|
-
React.createElement(react_native_1.
|
|
331
|
-
React.createElement(react_native_1.
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
React.createElement(react_native_1.View, { style: styles.
|
|
344
|
-
React.createElement(react_native_1.
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
React.createElement(
|
|
348
|
-
|
|
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))))))))));
|
|
349
350
|
}
|
|
350
351
|
}
|
|
351
352
|
exports.DropDown = DropDown;
|