kts-component-invoice-operate 3.2.56 → 3.2.57
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
|
@@ -10561,9 +10561,6 @@ function ItemNameInput(props) {
|
|
|
10561
10561
|
var autoComplete = controller.useMemo(function (s) {
|
|
10562
10562
|
return s.autoComplete;
|
|
10563
10563
|
}, []);
|
|
10564
|
-
var editGood = controller.useMemo(function (e) {
|
|
10565
|
-
return e.goodsListState.editGood;
|
|
10566
|
-
}, []);
|
|
10567
10564
|
|
|
10568
10565
|
var _React$useState = React.useState([]),
|
|
10569
10566
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -10710,8 +10707,7 @@ function ItemNameInput(props) {
|
|
|
10710
10707
|
}
|
|
10711
10708
|
}, "*", props.shorthand, "*"), React.createElement(AutoComplete$1, {
|
|
10712
10709
|
onSearch: onSearch,
|
|
10713
|
-
|
|
10714
|
-
value: editGood === null || editGood === void 0 ? void 0 : editGood.itemName,
|
|
10710
|
+
value: props.value,
|
|
10715
10711
|
options: options.map(function (e) {
|
|
10716
10712
|
return {
|
|
10717
10713
|
value: e.itemName
|
|
@@ -10723,7 +10719,6 @@ function ItemNameInput(props) {
|
|
|
10723
10719
|
height: '100%',
|
|
10724
10720
|
border: 'none'
|
|
10725
10721
|
},
|
|
10726
|
-
value: props.value,
|
|
10727
10722
|
onChange: onChange
|
|
10728
10723
|
})));
|
|
10729
10724
|
} // function removeNullUndefined(obj: Record<string, any>): Record<string, any> {
|
|
@@ -10771,38 +10766,37 @@ function ItemCodeInput(props) {
|
|
|
10771
10766
|
while (1) {
|
|
10772
10767
|
switch (_context.prev = _context.next) {
|
|
10773
10768
|
case 0:
|
|
10774
|
-
|
|
10775
|
-
_context.prev = 1;
|
|
10769
|
+
_context.prev = 0;
|
|
10776
10770
|
|
|
10777
10771
|
if (!autoComplete.onItemCodeSearch) {
|
|
10778
|
-
_context.next =
|
|
10772
|
+
_context.next = 7;
|
|
10779
10773
|
break;
|
|
10780
10774
|
}
|
|
10781
10775
|
|
|
10782
10776
|
_context.t0 = setOptions;
|
|
10783
|
-
_context.next =
|
|
10777
|
+
_context.next = 5;
|
|
10784
10778
|
return autoComplete.onItemCodeSearch(searchText, editGood === null || editGood === void 0 ? void 0 : editGood.itemName);
|
|
10785
10779
|
|
|
10786
|
-
case
|
|
10780
|
+
case 5:
|
|
10787
10781
|
_context.t1 = _context.sent;
|
|
10788
10782
|
(0, _context.t0)(_context.t1);
|
|
10789
10783
|
|
|
10790
|
-
case
|
|
10791
|
-
_context.next =
|
|
10784
|
+
case 7:
|
|
10785
|
+
_context.next = 13;
|
|
10792
10786
|
break;
|
|
10793
10787
|
|
|
10794
|
-
case
|
|
10795
|
-
_context.prev =
|
|
10796
|
-
_context.t2 = _context["catch"](
|
|
10788
|
+
case 9:
|
|
10789
|
+
_context.prev = 9;
|
|
10790
|
+
_context.t2 = _context["catch"](0);
|
|
10797
10791
|
setOptions([]);
|
|
10798
10792
|
throw _context.t2;
|
|
10799
10793
|
|
|
10800
|
-
case
|
|
10794
|
+
case 13:
|
|
10801
10795
|
case "end":
|
|
10802
10796
|
return _context.stop();
|
|
10803
10797
|
}
|
|
10804
10798
|
}
|
|
10805
|
-
}, _callee, null, [[
|
|
10799
|
+
}, _callee, null, [[0, 9]]);
|
|
10806
10800
|
}));
|
|
10807
10801
|
|
|
10808
10802
|
return function (_x) {
|
|
@@ -10816,22 +10810,21 @@ function ItemCodeInput(props) {
|
|
|
10816
10810
|
while (1) {
|
|
10817
10811
|
switch (_context2.prev = _context2.next) {
|
|
10818
10812
|
case 0:
|
|
10819
|
-
debugger;
|
|
10820
10813
|
record = options.filter(function (e) {
|
|
10821
10814
|
return e.itemCode === itemName;
|
|
10822
10815
|
})[0];
|
|
10823
10816
|
|
|
10824
10817
|
if (record) {
|
|
10825
|
-
_context2.next =
|
|
10818
|
+
_context2.next = 3;
|
|
10826
10819
|
break;
|
|
10827
10820
|
}
|
|
10828
10821
|
|
|
10829
10822
|
return _context2.abrupt("return");
|
|
10830
10823
|
|
|
10831
|
-
case
|
|
10824
|
+
case 3:
|
|
10832
10825
|
controller.importGoodsDrawer(record);
|
|
10833
10826
|
|
|
10834
|
-
case
|
|
10827
|
+
case 4:
|
|
10835
10828
|
case "end":
|
|
10836
10829
|
return _context2.stop();
|
|
10837
10830
|
}
|
|
@@ -10846,21 +10839,19 @@ function ItemCodeInput(props) {
|
|
|
10846
10839
|
return React.createElement("div", {
|
|
10847
10840
|
className: 'kts-invoice-operate-goods-list-itemCode-input'
|
|
10848
10841
|
}, React.createElement(AutoComplete$1, {
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
value: editGood === null || editGood === void 0 ? void 0 : editGood.itemCode,
|
|
10842
|
+
onSearch: onSearch,
|
|
10843
|
+
value: props.value,
|
|
10852
10844
|
options: options.map(function (e) {
|
|
10853
10845
|
return {
|
|
10854
10846
|
value: e.itemCode
|
|
10855
10847
|
};
|
|
10856
10848
|
}),
|
|
10857
|
-
|
|
10849
|
+
onSelect: onChangeAutoComplete
|
|
10858
10850
|
}, React.createElement(Input, {
|
|
10859
10851
|
style: {
|
|
10860
10852
|
height: '100%',
|
|
10861
10853
|
border: 'none'
|
|
10862
10854
|
},
|
|
10863
|
-
value: props.value,
|
|
10864
10855
|
onChange: onChange
|
|
10865
10856
|
})));
|
|
10866
10857
|
}
|
package/dist/index.js
CHANGED
|
@@ -10571,9 +10571,6 @@ function ItemNameInput(props) {
|
|
|
10571
10571
|
var autoComplete = controller.useMemo(function (s) {
|
|
10572
10572
|
return s.autoComplete;
|
|
10573
10573
|
}, []);
|
|
10574
|
-
var editGood = controller.useMemo(function (e) {
|
|
10575
|
-
return e.goodsListState.editGood;
|
|
10576
|
-
}, []);
|
|
10577
10574
|
|
|
10578
10575
|
var _React$useState = React__default['default'].useState([]),
|
|
10579
10576
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -10720,8 +10717,7 @@ function ItemNameInput(props) {
|
|
|
10720
10717
|
}
|
|
10721
10718
|
}, "*", props.shorthand, "*"), React__default['default'].createElement(ktsXui.AutoComplete, {
|
|
10722
10719
|
onSearch: onSearch,
|
|
10723
|
-
|
|
10724
|
-
value: editGood === null || editGood === void 0 ? void 0 : editGood.itemName,
|
|
10720
|
+
value: props.value,
|
|
10725
10721
|
options: options.map(function (e) {
|
|
10726
10722
|
return {
|
|
10727
10723
|
value: e.itemName
|
|
@@ -10733,7 +10729,6 @@ function ItemNameInput(props) {
|
|
|
10733
10729
|
height: '100%',
|
|
10734
10730
|
border: 'none'
|
|
10735
10731
|
},
|
|
10736
|
-
value: props.value,
|
|
10737
10732
|
onChange: onChange
|
|
10738
10733
|
})));
|
|
10739
10734
|
} // function removeNullUndefined(obj: Record<string, any>): Record<string, any> {
|
|
@@ -10781,38 +10776,37 @@ function ItemCodeInput(props) {
|
|
|
10781
10776
|
while (1) {
|
|
10782
10777
|
switch (_context.prev = _context.next) {
|
|
10783
10778
|
case 0:
|
|
10784
|
-
|
|
10785
|
-
_context.prev = 1;
|
|
10779
|
+
_context.prev = 0;
|
|
10786
10780
|
|
|
10787
10781
|
if (!autoComplete.onItemCodeSearch) {
|
|
10788
|
-
_context.next =
|
|
10782
|
+
_context.next = 7;
|
|
10789
10783
|
break;
|
|
10790
10784
|
}
|
|
10791
10785
|
|
|
10792
10786
|
_context.t0 = setOptions;
|
|
10793
|
-
_context.next =
|
|
10787
|
+
_context.next = 5;
|
|
10794
10788
|
return autoComplete.onItemCodeSearch(searchText, editGood === null || editGood === void 0 ? void 0 : editGood.itemName);
|
|
10795
10789
|
|
|
10796
|
-
case
|
|
10790
|
+
case 5:
|
|
10797
10791
|
_context.t1 = _context.sent;
|
|
10798
10792
|
(0, _context.t0)(_context.t1);
|
|
10799
10793
|
|
|
10800
|
-
case
|
|
10801
|
-
_context.next =
|
|
10794
|
+
case 7:
|
|
10795
|
+
_context.next = 13;
|
|
10802
10796
|
break;
|
|
10803
10797
|
|
|
10804
|
-
case
|
|
10805
|
-
_context.prev =
|
|
10806
|
-
_context.t2 = _context["catch"](
|
|
10798
|
+
case 9:
|
|
10799
|
+
_context.prev = 9;
|
|
10800
|
+
_context.t2 = _context["catch"](0);
|
|
10807
10801
|
setOptions([]);
|
|
10808
10802
|
throw _context.t2;
|
|
10809
10803
|
|
|
10810
|
-
case
|
|
10804
|
+
case 13:
|
|
10811
10805
|
case "end":
|
|
10812
10806
|
return _context.stop();
|
|
10813
10807
|
}
|
|
10814
10808
|
}
|
|
10815
|
-
}, _callee, null, [[
|
|
10809
|
+
}, _callee, null, [[0, 9]]);
|
|
10816
10810
|
}));
|
|
10817
10811
|
|
|
10818
10812
|
return function (_x) {
|
|
@@ -10826,22 +10820,21 @@ function ItemCodeInput(props) {
|
|
|
10826
10820
|
while (1) {
|
|
10827
10821
|
switch (_context2.prev = _context2.next) {
|
|
10828
10822
|
case 0:
|
|
10829
|
-
debugger;
|
|
10830
10823
|
record = options.filter(function (e) {
|
|
10831
10824
|
return e.itemCode === itemName;
|
|
10832
10825
|
})[0];
|
|
10833
10826
|
|
|
10834
10827
|
if (record) {
|
|
10835
|
-
_context2.next =
|
|
10828
|
+
_context2.next = 3;
|
|
10836
10829
|
break;
|
|
10837
10830
|
}
|
|
10838
10831
|
|
|
10839
10832
|
return _context2.abrupt("return");
|
|
10840
10833
|
|
|
10841
|
-
case
|
|
10834
|
+
case 3:
|
|
10842
10835
|
controller.importGoodsDrawer(record);
|
|
10843
10836
|
|
|
10844
|
-
case
|
|
10837
|
+
case 4:
|
|
10845
10838
|
case "end":
|
|
10846
10839
|
return _context2.stop();
|
|
10847
10840
|
}
|
|
@@ -10856,21 +10849,19 @@ function ItemCodeInput(props) {
|
|
|
10856
10849
|
return React__default['default'].createElement("div", {
|
|
10857
10850
|
className: 'kts-invoice-operate-goods-list-itemCode-input'
|
|
10858
10851
|
}, React__default['default'].createElement(ktsXui.AutoComplete, {
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
value: editGood === null || editGood === void 0 ? void 0 : editGood.itemCode,
|
|
10852
|
+
onSearch: onSearch,
|
|
10853
|
+
value: props.value,
|
|
10862
10854
|
options: options.map(function (e) {
|
|
10863
10855
|
return {
|
|
10864
10856
|
value: e.itemCode
|
|
10865
10857
|
};
|
|
10866
10858
|
}),
|
|
10867
|
-
|
|
10859
|
+
onSelect: onChangeAutoComplete
|
|
10868
10860
|
}, React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
10869
10861
|
style: {
|
|
10870
10862
|
height: '100%',
|
|
10871
10863
|
border: 'none'
|
|
10872
10864
|
},
|
|
10873
|
-
value: props.value,
|
|
10874
10865
|
onChange: onChange
|
|
10875
10866
|
})));
|
|
10876
10867
|
}
|
package/package.json
CHANGED
|
@@ -21,7 +21,6 @@ export default function ItemCodeInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
21
21
|
}, [])
|
|
22
22
|
|
|
23
23
|
const onSearch = React.useCallback(async (searchText: string) => {
|
|
24
|
-
debugger
|
|
25
24
|
try {
|
|
26
25
|
if (autoComplete.onItemCodeSearch) {
|
|
27
26
|
setOptions(await autoComplete.onItemCodeSearch(searchText, editGood?.itemName))
|
|
@@ -33,7 +32,6 @@ export default function ItemCodeInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
33
32
|
}, [autoComplete.onItemCodeSearch, editGood])
|
|
34
33
|
|
|
35
34
|
const onChangeAutoComplete = React.useCallback(async itemName => {
|
|
36
|
-
debugger
|
|
37
35
|
const record = options.filter(e => e.itemCode === itemName)[0] as any;
|
|
38
36
|
if (!record) return;
|
|
39
37
|
|
|
@@ -42,8 +40,8 @@ export default function ItemCodeInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
42
40
|
|
|
43
41
|
return (
|
|
44
42
|
<div className='kts-invoice-operate-goods-list-itemCode-input'>
|
|
45
|
-
<AutoComplete
|
|
46
|
-
<Input style={{ height: '100%', border: 'none' }}
|
|
43
|
+
<AutoComplete onSearch={onSearch} value={props.value} options={options.map(e => ({ value: e.itemCode }))} onSelect={onChangeAutoComplete} >
|
|
44
|
+
<Input style={{ height: '100%', border: 'none' }} onChange={onChange} />
|
|
47
45
|
</AutoComplete>
|
|
48
46
|
</div>
|
|
49
47
|
)
|
|
@@ -14,8 +14,6 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
14
14
|
|
|
15
15
|
const autoComplete = controller.useMemo(s => s.autoComplete, [])
|
|
16
16
|
|
|
17
|
-
const editGood = controller.useMemo((e) => e.goodsListState.editGood, []);
|
|
18
|
-
|
|
19
17
|
const [options, setOptions] = React.useState<IGood[]>([])
|
|
20
18
|
|
|
21
19
|
const onChange = React.useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
|
@@ -101,8 +99,8 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
101
99
|
return (
|
|
102
100
|
<div className='kts-invoice-operate-goods-list-itemName-input'>
|
|
103
101
|
{props.shorthand && <span style={{ alignSelf: 'center', fontSize: 12 }} >*{props.shorthand}*</span>}
|
|
104
|
-
<AutoComplete onSearch={onSearch}
|
|
105
|
-
<Input style={{ height: '100%', border: 'none' }}
|
|
102
|
+
<AutoComplete onSearch={onSearch} value={props.value} options={options.map(e => ({ value: e.itemName }))} onSelect={onChangeAutoComplete} >
|
|
103
|
+
<Input style={{ height: '100%', border: 'none' }} onChange={onChange} />
|
|
106
104
|
</AutoComplete>
|
|
107
105
|
</div>
|
|
108
106
|
)
|