kts-component-invoice-operate 3.2.96 → 3.2.97

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/dist/index.esm.js CHANGED
@@ -10838,8 +10838,8 @@ function ItemNameInput(props) {
10838
10838
  case 0:
10839
10839
  _context.prev = 0;
10840
10840
 
10841
- if (!autoComplete.onItemNameSearch) {
10842
- _context.next = 9;
10841
+ if (!(autoComplete.onItemNameSearch && searchText)) {
10842
+ _context.next = 11;
10843
10843
  break;
10844
10844
  }
10845
10845
 
@@ -10852,23 +10852,28 @@ function ItemNameInput(props) {
10852
10852
  list = (0, _context.t0)(_context.t1);
10853
10853
  console.log('===> list', list);
10854
10854
  setOptions(list);
10855
-
10856
- case 9:
10857
- _context.next = 15;
10855
+ _context.next = 12;
10858
10856
  break;
10859
10857
 
10860
10858
  case 11:
10861
- _context.prev = 11;
10859
+ setOptions([]);
10860
+
10861
+ case 12:
10862
+ _context.next = 18;
10863
+ break;
10864
+
10865
+ case 14:
10866
+ _context.prev = 14;
10862
10867
  _context.t2 = _context["catch"](0);
10863
10868
  setOptions([]);
10864
10869
  throw _context.t2;
10865
10870
 
10866
- case 15:
10871
+ case 18:
10867
10872
  case "end":
10868
10873
  return _context.stop();
10869
10874
  }
10870
10875
  }
10871
- }, _callee, null, [[0, 11]]);
10876
+ }, _callee, null, [[0, 14]]);
10872
10877
  }));
10873
10878
 
10874
10879
  return function (_x) {
package/dist/index.js CHANGED
@@ -10848,8 +10848,8 @@ function ItemNameInput(props) {
10848
10848
  case 0:
10849
10849
  _context.prev = 0;
10850
10850
 
10851
- if (!autoComplete.onItemNameSearch) {
10852
- _context.next = 9;
10851
+ if (!(autoComplete.onItemNameSearch && searchText)) {
10852
+ _context.next = 11;
10853
10853
  break;
10854
10854
  }
10855
10855
 
@@ -10862,23 +10862,28 @@ function ItemNameInput(props) {
10862
10862
  list = (0, _context.t0)(_context.t1);
10863
10863
  console.log('===> list', list);
10864
10864
  setOptions(list);
10865
-
10866
- case 9:
10867
- _context.next = 15;
10865
+ _context.next = 12;
10868
10866
  break;
10869
10867
 
10870
10868
  case 11:
10871
- _context.prev = 11;
10869
+ setOptions([]);
10870
+
10871
+ case 12:
10872
+ _context.next = 18;
10873
+ break;
10874
+
10875
+ case 14:
10876
+ _context.prev = 14;
10872
10877
  _context.t2 = _context["catch"](0);
10873
10878
  setOptions([]);
10874
10879
  throw _context.t2;
10875
10880
 
10876
- case 15:
10881
+ case 18:
10877
10882
  case "end":
10878
10883
  return _context.stop();
10879
10884
  }
10880
10885
  }
10881
- }, _callee, null, [[0, 11]]);
10886
+ }, _callee, null, [[0, 14]]);
10882
10887
  }));
10883
10888
 
10884
10889
  return function (_x) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.96",
3
+ "version": "3.2.97",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -23,10 +23,12 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
23
23
 
24
24
  const onSearch = React.useCallback(async (searchText: string) => {
25
25
  try {
26
- if (autoComplete.onItemNameSearch) {
26
+ if (autoComplete.onItemNameSearch && searchText) {
27
27
  const list = [...await autoComplete.onItemNameSearch(searchText)];
28
28
  console.log('===> list', list);
29
29
  setOptions(list);
30
+ }else{
31
+ setOptions([]);
30
32
  }
31
33
  } catch (error) {
32
34
  setOptions([])