@widergy/mobile-ui 1.9.0 → 1.10.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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.10.0](https://github.com/widergy/mobile-ui/compare/v1.9.0...v1.10.0) (2024-05-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * autocomplete empty list component ([#287](https://github.com/widergy/mobile-ui/issues/287)) ([a90a0b2](https://github.com/widergy/mobile-ui/commit/a90a0b2fd85e4171d08fc012447b18b522bae6f8))
7
+
1
8
  # [1.9.0](https://github.com/widergy/mobile-ui/compare/v1.8.3...v1.9.0) (2024-05-17)
2
9
 
3
10
 
@@ -18,6 +18,7 @@ const UTAutocomplete = ({
18
18
  variant,
19
19
  autoCompletePlaceholder,
20
20
  MenuOptionComponent,
21
+ ListEmptyComponent,
21
22
  filterOptions,
22
23
  persistSelectedOption = false
23
24
  }) => {
@@ -49,6 +50,7 @@ const UTAutocomplete = ({
49
50
  autoCompletePlaceholder={autoCompletePlaceholder}
50
51
  maxHeight={WINDOW_HEIGHT * 0.25}
51
52
  MenuOptionComponent={MenuOptionComponent}
53
+ ListEmptyComponent={ListEmptyComponent}
52
54
  filterOptions={filterOptions}
53
55
  >
54
56
  <UTTextInput
@@ -87,6 +89,7 @@ UTAutocomplete.propTypes = {
87
89
  variant: string,
88
90
  autoCompletePlaceholder: string,
89
91
  MenuOptionComponent: element,
92
+ ListEmptyComponent: element,
90
93
  filterOptions: bool,
91
94
  persistSelectedOption: bool
92
95
  };
@@ -46,7 +46,7 @@ class ListView extends PureComponent {
46
46
  };
47
47
 
48
48
  render() {
49
- const { filteredOptions, ItemSeparatorComponent } = this.props;
49
+ const { filteredOptions, ItemSeparatorComponent, ListEmptyComponent } = this.props;
50
50
  const { style } = this.state;
51
51
 
52
52
  return (
@@ -57,6 +57,7 @@ class ListView extends PureComponent {
57
57
  keyboardShouldPersistTaps="always"
58
58
  renderItem={this.renderItem}
59
59
  ItemSeparatorComponent={ItemSeparatorComponent}
60
+ ListEmptyComponent={ListEmptyComponent}
60
61
  />
61
62
  );
62
63
  }
@@ -1,4 +1,4 @@
1
- import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
1
+ import React, { Fragment, useLayoutEffect, useMemo, useRef, useState } from 'react';
2
2
  import { Dimensions, Keyboard, KeyboardAvoidingView, Modal, TouchableOpacity, View } from 'react-native';
3
3
 
4
4
  import useKeyboardHeight from '../../hooks/useKeyboardHeight';
@@ -24,6 +24,7 @@ const UTMenu = ({
24
24
  styles: propStyles,
25
25
  MenuOptionComponent = MenuOption,
26
26
  ItemSeparatorComponent,
27
+ ListEmptyComponent,
27
28
  maxHeight,
28
29
  isMultiple,
29
30
  autoCompletePlaceholder,
@@ -102,11 +103,11 @@ const UTMenu = ({
102
103
 
103
104
  const handleQueryChange = value => {
104
105
  setQuery(value);
105
- onQueryChange(value);
106
+ onQueryChange?.(value);
106
107
  };
107
108
 
108
109
  return (
109
- <>
110
+ <Fragment>
110
111
  <TouchableOpacity
111
112
  disabled={disabled}
112
113
  onPress={isOpen ? closeMenu : openMenu}
@@ -153,6 +154,7 @@ const UTMenu = ({
153
154
  usableWindowHeight={usableWindowHeight}
154
155
  filteredOptions={filteredOptions}
155
156
  ItemSeparatorComponent={ItemSeparatorComponent}
157
+ ListEmptyComponent={ListEmptyComponent}
156
158
  MenuOptionComponent={MenuOptionComponent}
157
159
  handleOptionPress={handleOptionPress}
158
160
  onPress={onPress}
@@ -164,7 +166,7 @@ const UTMenu = ({
164
166
  </KeyboardAvoidingView>
165
167
  </View>
166
168
  </Modal>
167
- </>
169
+ </Fragment>
168
170
  );
169
171
  };
170
172
 
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.9.0",
5
+ "version": "1.10.0",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [