kts-component-invoice-operate 3.2.94 → 3.2.95

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
@@ -17658,6 +17658,7 @@ function ItemNameInput$1(props) {
17658
17658
  }, [options, controller]);
17659
17659
  var onSearch = React.useCallback( /*#__PURE__*/function () {
17660
17660
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
17661
+ var list;
17661
17662
  return _regeneratorRuntime().wrap(function _callee$(_context) {
17662
17663
  while (1) {
17663
17664
  switch (_context.prev = _context.next) {
@@ -17665,40 +17666,43 @@ function ItemNameInput$1(props) {
17665
17666
  _context.prev = 0;
17666
17667
 
17667
17668
  if (!autoComplete.onItemNameSearch) {
17668
- _context.next = 7;
17669
+ _context.next = 9;
17669
17670
  break;
17670
17671
  }
17671
17672
 
17672
- _context.t0 = setOptions;
17673
+ _context.t0 = _toConsumableArray;
17673
17674
  _context.next = 5;
17674
17675
  return autoComplete.onItemNameSearch(searchText);
17675
17676
 
17676
17677
  case 5:
17677
17678
  _context.t1 = _context.sent;
17678
- (0, _context.t0)(_context.t1);
17679
+ list = (0, _context.t0)(_context.t1);
17680
+ console.log('===> list', list);
17681
+ setOptions(list);
17679
17682
 
17680
- case 7:
17681
- _context.next = 13;
17683
+ case 9:
17684
+ _context.next = 15;
17682
17685
  break;
17683
17686
 
17684
- case 9:
17685
- _context.prev = 9;
17687
+ case 11:
17688
+ _context.prev = 11;
17686
17689
  _context.t2 = _context["catch"](0);
17687
17690
  setOptions([]);
17688
17691
  throw _context.t2;
17689
17692
 
17690
- case 13:
17693
+ case 15:
17691
17694
  case "end":
17692
17695
  return _context.stop();
17693
17696
  }
17694
17697
  }
17695
- }, _callee, null, [[0, 9]]);
17698
+ }, _callee, null, [[0, 11]]);
17696
17699
  }));
17697
17700
 
17698
17701
  return function (_x) {
17699
17702
  return _ref.apply(this, arguments);
17700
17703
  };
17701
17704
  }(), [autoComplete.onItemNameSearch]);
17705
+ console.log('===> options', options);
17702
17706
  return React.createElement("div", {
17703
17707
  className: 'kts-invoice-operate-goods-list-itemName-input'
17704
17708
  }, props.shorthand && React.createElement("span", {
package/dist/index.js CHANGED
@@ -17668,6 +17668,7 @@ function ItemNameInput$1(props) {
17668
17668
  }, [options, controller]);
17669
17669
  var onSearch = React__default['default'].useCallback( /*#__PURE__*/function () {
17670
17670
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
17671
+ var list;
17671
17672
  return _regeneratorRuntime().wrap(function _callee$(_context) {
17672
17673
  while (1) {
17673
17674
  switch (_context.prev = _context.next) {
@@ -17675,40 +17676,43 @@ function ItemNameInput$1(props) {
17675
17676
  _context.prev = 0;
17676
17677
 
17677
17678
  if (!autoComplete.onItemNameSearch) {
17678
- _context.next = 7;
17679
+ _context.next = 9;
17679
17680
  break;
17680
17681
  }
17681
17682
 
17682
- _context.t0 = setOptions;
17683
+ _context.t0 = _toConsumableArray;
17683
17684
  _context.next = 5;
17684
17685
  return autoComplete.onItemNameSearch(searchText);
17685
17686
 
17686
17687
  case 5:
17687
17688
  _context.t1 = _context.sent;
17688
- (0, _context.t0)(_context.t1);
17689
+ list = (0, _context.t0)(_context.t1);
17690
+ console.log('===> list', list);
17691
+ setOptions(list);
17689
17692
 
17690
- case 7:
17691
- _context.next = 13;
17693
+ case 9:
17694
+ _context.next = 15;
17692
17695
  break;
17693
17696
 
17694
- case 9:
17695
- _context.prev = 9;
17697
+ case 11:
17698
+ _context.prev = 11;
17696
17699
  _context.t2 = _context["catch"](0);
17697
17700
  setOptions([]);
17698
17701
  throw _context.t2;
17699
17702
 
17700
- case 13:
17703
+ case 15:
17701
17704
  case "end":
17702
17705
  return _context.stop();
17703
17706
  }
17704
17707
  }
17705
- }, _callee, null, [[0, 9]]);
17708
+ }, _callee, null, [[0, 11]]);
17706
17709
  }));
17707
17710
 
17708
17711
  return function (_x) {
17709
17712
  return _ref.apply(this, arguments);
17710
17713
  };
17711
17714
  }(), [autoComplete.onItemNameSearch]);
17715
+ console.log('===> options', options);
17712
17716
  return React__default['default'].createElement("div", {
17713
17717
  className: 'kts-invoice-operate-goods-list-itemName-input'
17714
17718
  }, 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.95",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -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
  )