kts-component-invoice-operate 3.2.94 → 3.2.96

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
@@ -10831,6 +10831,7 @@ function ItemNameInput(props) {
10831
10831
  }, []);
10832
10832
  var onSearch = React.useCallback( /*#__PURE__*/function () {
10833
10833
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
10834
+ var list;
10834
10835
  return _regeneratorRuntime().wrap(function _callee$(_context) {
10835
10836
  while (1) {
10836
10837
  switch (_context.prev = _context.next) {
@@ -10838,34 +10839,36 @@ function ItemNameInput(props) {
10838
10839
  _context.prev = 0;
10839
10840
 
10840
10841
  if (!autoComplete.onItemNameSearch) {
10841
- _context.next = 7;
10842
+ _context.next = 9;
10842
10843
  break;
10843
10844
  }
10844
10845
 
10845
- _context.t0 = setOptions;
10846
+ _context.t0 = _toConsumableArray;
10846
10847
  _context.next = 5;
10847
10848
  return autoComplete.onItemNameSearch(searchText);
10848
10849
 
10849
10850
  case 5:
10850
10851
  _context.t1 = _context.sent;
10851
- (0, _context.t0)(_context.t1);
10852
+ list = (0, _context.t0)(_context.t1);
10853
+ console.log('===> list', list);
10854
+ setOptions(list);
10852
10855
 
10853
- case 7:
10854
- _context.next = 13;
10856
+ case 9:
10857
+ _context.next = 15;
10855
10858
  break;
10856
10859
 
10857
- case 9:
10858
- _context.prev = 9;
10860
+ case 11:
10861
+ _context.prev = 11;
10859
10862
  _context.t2 = _context["catch"](0);
10860
10863
  setOptions([]);
10861
10864
  throw _context.t2;
10862
10865
 
10863
- case 13:
10866
+ case 15:
10864
10867
  case "end":
10865
10868
  return _context.stop();
10866
10869
  }
10867
10870
  }
10868
- }, _callee, null, [[0, 9]]);
10871
+ }, _callee, null, [[0, 11]]);
10869
10872
  }));
10870
10873
 
10871
10874
  return function (_x) {
@@ -10912,6 +10915,7 @@ function ItemNameInput(props) {
10912
10915
  return _ref2.apply(this, arguments);
10913
10916
  };
10914
10917
  }(), [options, controller]);
10918
+ console.log('===> options', options);
10915
10919
  return React.createElement("div", {
10916
10920
  className: 'kts-invoice-operate-goods-list-itemName-input'
10917
10921
  }, props.shorthand && React.createElement("span", {
@@ -17658,6 +17662,7 @@ function ItemNameInput$1(props) {
17658
17662
  }, [options, controller]);
17659
17663
  var onSearch = React.useCallback( /*#__PURE__*/function () {
17660
17664
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
17665
+ var list;
17661
17666
  return _regeneratorRuntime().wrap(function _callee$(_context) {
17662
17667
  while (1) {
17663
17668
  switch (_context.prev = _context.next) {
@@ -17665,40 +17670,43 @@ function ItemNameInput$1(props) {
17665
17670
  _context.prev = 0;
17666
17671
 
17667
17672
  if (!autoComplete.onItemNameSearch) {
17668
- _context.next = 7;
17673
+ _context.next = 9;
17669
17674
  break;
17670
17675
  }
17671
17676
 
17672
- _context.t0 = setOptions;
17677
+ _context.t0 = _toConsumableArray;
17673
17678
  _context.next = 5;
17674
17679
  return autoComplete.onItemNameSearch(searchText);
17675
17680
 
17676
17681
  case 5:
17677
17682
  _context.t1 = _context.sent;
17678
- (0, _context.t0)(_context.t1);
17683
+ list = (0, _context.t0)(_context.t1);
17684
+ console.log('===> list', list);
17685
+ setOptions(list);
17679
17686
 
17680
- case 7:
17681
- _context.next = 13;
17687
+ case 9:
17688
+ _context.next = 15;
17682
17689
  break;
17683
17690
 
17684
- case 9:
17685
- _context.prev = 9;
17691
+ case 11:
17692
+ _context.prev = 11;
17686
17693
  _context.t2 = _context["catch"](0);
17687
17694
  setOptions([]);
17688
17695
  throw _context.t2;
17689
17696
 
17690
- case 13:
17697
+ case 15:
17691
17698
  case "end":
17692
17699
  return _context.stop();
17693
17700
  }
17694
17701
  }
17695
- }, _callee, null, [[0, 9]]);
17702
+ }, _callee, null, [[0, 11]]);
17696
17703
  }));
17697
17704
 
17698
17705
  return function (_x) {
17699
17706
  return _ref.apply(this, arguments);
17700
17707
  };
17701
17708
  }(), [autoComplete.onItemNameSearch]);
17709
+ console.log('===> options', options);
17702
17710
  return React.createElement("div", {
17703
17711
  className: 'kts-invoice-operate-goods-list-itemName-input'
17704
17712
  }, props.shorthand && React.createElement("span", {
package/dist/index.js CHANGED
@@ -10841,6 +10841,7 @@ function ItemNameInput(props) {
10841
10841
  }, []);
10842
10842
  var onSearch = React__default['default'].useCallback( /*#__PURE__*/function () {
10843
10843
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
10844
+ var list;
10844
10845
  return _regeneratorRuntime().wrap(function _callee$(_context) {
10845
10846
  while (1) {
10846
10847
  switch (_context.prev = _context.next) {
@@ -10848,34 +10849,36 @@ function ItemNameInput(props) {
10848
10849
  _context.prev = 0;
10849
10850
 
10850
10851
  if (!autoComplete.onItemNameSearch) {
10851
- _context.next = 7;
10852
+ _context.next = 9;
10852
10853
  break;
10853
10854
  }
10854
10855
 
10855
- _context.t0 = setOptions;
10856
+ _context.t0 = _toConsumableArray;
10856
10857
  _context.next = 5;
10857
10858
  return autoComplete.onItemNameSearch(searchText);
10858
10859
 
10859
10860
  case 5:
10860
10861
  _context.t1 = _context.sent;
10861
- (0, _context.t0)(_context.t1);
10862
+ list = (0, _context.t0)(_context.t1);
10863
+ console.log('===> list', list);
10864
+ setOptions(list);
10862
10865
 
10863
- case 7:
10864
- _context.next = 13;
10866
+ case 9:
10867
+ _context.next = 15;
10865
10868
  break;
10866
10869
 
10867
- case 9:
10868
- _context.prev = 9;
10870
+ case 11:
10871
+ _context.prev = 11;
10869
10872
  _context.t2 = _context["catch"](0);
10870
10873
  setOptions([]);
10871
10874
  throw _context.t2;
10872
10875
 
10873
- case 13:
10876
+ case 15:
10874
10877
  case "end":
10875
10878
  return _context.stop();
10876
10879
  }
10877
10880
  }
10878
- }, _callee, null, [[0, 9]]);
10881
+ }, _callee, null, [[0, 11]]);
10879
10882
  }));
10880
10883
 
10881
10884
  return function (_x) {
@@ -10922,6 +10925,7 @@ function ItemNameInput(props) {
10922
10925
  return _ref2.apply(this, arguments);
10923
10926
  };
10924
10927
  }(), [options, controller]);
10928
+ console.log('===> options', options);
10925
10929
  return React__default['default'].createElement("div", {
10926
10930
  className: 'kts-invoice-operate-goods-list-itemName-input'
10927
10931
  }, props.shorthand && React__default['default'].createElement("span", {
@@ -17668,6 +17672,7 @@ function ItemNameInput$1(props) {
17668
17672
  }, [options, controller]);
17669
17673
  var onSearch = React__default['default'].useCallback( /*#__PURE__*/function () {
17670
17674
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
17675
+ var list;
17671
17676
  return _regeneratorRuntime().wrap(function _callee$(_context) {
17672
17677
  while (1) {
17673
17678
  switch (_context.prev = _context.next) {
@@ -17675,40 +17680,43 @@ function ItemNameInput$1(props) {
17675
17680
  _context.prev = 0;
17676
17681
 
17677
17682
  if (!autoComplete.onItemNameSearch) {
17678
- _context.next = 7;
17683
+ _context.next = 9;
17679
17684
  break;
17680
17685
  }
17681
17686
 
17682
- _context.t0 = setOptions;
17687
+ _context.t0 = _toConsumableArray;
17683
17688
  _context.next = 5;
17684
17689
  return autoComplete.onItemNameSearch(searchText);
17685
17690
 
17686
17691
  case 5:
17687
17692
  _context.t1 = _context.sent;
17688
- (0, _context.t0)(_context.t1);
17693
+ list = (0, _context.t0)(_context.t1);
17694
+ console.log('===> list', list);
17695
+ setOptions(list);
17689
17696
 
17690
- case 7:
17691
- _context.next = 13;
17697
+ case 9:
17698
+ _context.next = 15;
17692
17699
  break;
17693
17700
 
17694
- case 9:
17695
- _context.prev = 9;
17701
+ case 11:
17702
+ _context.prev = 11;
17696
17703
  _context.t2 = _context["catch"](0);
17697
17704
  setOptions([]);
17698
17705
  throw _context.t2;
17699
17706
 
17700
- case 13:
17707
+ case 15:
17701
17708
  case "end":
17702
17709
  return _context.stop();
17703
17710
  }
17704
17711
  }
17705
- }, _callee, null, [[0, 9]]);
17712
+ }, _callee, null, [[0, 11]]);
17706
17713
  }));
17707
17714
 
17708
17715
  return function (_x) {
17709
17716
  return _ref.apply(this, arguments);
17710
17717
  };
17711
17718
  }(), [autoComplete.onItemNameSearch]);
17719
+ console.log('===> options', options);
17712
17720
  return React__default['default'].createElement("div", {
17713
17721
  className: 'kts-invoice-operate-goods-list-itemName-input'
17714
17722
  }, props.shorthand && React__default['default'].createElement("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.94",
3
+ "version": "3.2.96",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -24,7 +24,9 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
24
24
  const onSearch = React.useCallback(async (searchText: string) => {
25
25
  try {
26
26
  if (autoComplete.onItemNameSearch) {
27
- setOptions(await autoComplete.onItemNameSearch(searchText));
27
+ const list = [...await autoComplete.onItemNameSearch(searchText)];
28
+ console.log('===> list', list);
29
+ setOptions(list);
28
30
  }
29
31
  } catch (error) {
30
32
  setOptions([])
@@ -39,10 +41,12 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
39
41
  await controller.setEditGood({ itemName: record.itemName });
40
42
 
41
43
  controller.importGoodsDrawer(record);
42
-
44
+
43
45
  setOptions([]);
44
46
  }, [options, controller])
45
47
 
48
+ console.log('===> options', options)
49
+
46
50
  return (
47
51
  <div className='kts-invoice-operate-goods-list-itemName-input'>
48
52
  {props.shorthand && <span style={{ alignSelf: 'center', fontSize: 12 }} >*{props.shorthand}*</span>}
@@ -31,7 +31,9 @@ export default function ItemNameInput(props: {
31
31
  const onSearch = React.useCallback(async (searchText: string) => {
32
32
  try {
33
33
  if (autoComplete.onItemNameSearch) {
34
- setOptions(await autoComplete.onItemNameSearch(searchText));
34
+ const list = [...await autoComplete.onItemNameSearch(searchText)];
35
+ console.log('===> list', list);
36
+ setOptions(list);
35
37
  }
36
38
  } catch (error) {
37
39
  setOptions([]);
@@ -39,11 +41,13 @@ export default function ItemNameInput(props: {
39
41
  }
40
42
  }, [autoComplete.onItemNameSearch])
41
43
 
44
+ console.log('===> options', options);
45
+
42
46
  return (
43
47
  <div className='kts-invoice-operate-goods-list-itemName-input'>
44
48
  {props.shorthand && <span style={{ alignSelf: 'center', fontSize: 12 }} >*{props.shorthand}*</span>}
45
49
  <AutoComplete onSearch={onSearch} value={props.value} options={options.map(e => ({ value: e.itemName }))} onSelect={onChangeAutoComplete} >
46
- <Input style={{ height: '100%' }} onChange={onChange} suffix={props.suffix} />
50
+ <Input style={{ height: '100%' }} onChange={onChange} suffix={props.suffix} />
47
51
  </AutoComplete>
48
52
  </div>
49
53
  )