kts-component-invoice-operate 3.2.56 → 3.2.58
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> {
|
|
@@ -10816,19 +10811,19 @@ function ItemCodeInput(props) {
|
|
|
10816
10811
|
while (1) {
|
|
10817
10812
|
switch (_context2.prev = _context2.next) {
|
|
10818
10813
|
case 0:
|
|
10819
|
-
debugger;
|
|
10820
10814
|
record = options.filter(function (e) {
|
|
10821
10815
|
return e.itemCode === itemName;
|
|
10822
10816
|
})[0];
|
|
10823
10817
|
|
|
10824
10818
|
if (record) {
|
|
10825
|
-
_context2.next =
|
|
10819
|
+
_context2.next = 3;
|
|
10826
10820
|
break;
|
|
10827
10821
|
}
|
|
10828
10822
|
|
|
10829
10823
|
return _context2.abrupt("return");
|
|
10830
10824
|
|
|
10831
|
-
case
|
|
10825
|
+
case 3:
|
|
10826
|
+
debugger;
|
|
10832
10827
|
controller.importGoodsDrawer(record);
|
|
10833
10828
|
|
|
10834
10829
|
case 5:
|
|
@@ -10846,21 +10841,19 @@ function ItemCodeInput(props) {
|
|
|
10846
10841
|
return React.createElement("div", {
|
|
10847
10842
|
className: 'kts-invoice-operate-goods-list-itemCode-input'
|
|
10848
10843
|
}, React.createElement(AutoComplete$1, {
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
value: editGood === null || editGood === void 0 ? void 0 : editGood.itemCode,
|
|
10844
|
+
onSearch: onSearch,
|
|
10845
|
+
value: props.value,
|
|
10852
10846
|
options: options.map(function (e) {
|
|
10853
10847
|
return {
|
|
10854
10848
|
value: e.itemCode
|
|
10855
10849
|
};
|
|
10856
10850
|
}),
|
|
10857
|
-
|
|
10851
|
+
onSelect: onChangeAutoComplete
|
|
10858
10852
|
}, React.createElement(Input, {
|
|
10859
10853
|
style: {
|
|
10860
10854
|
height: '100%',
|
|
10861
10855
|
border: 'none'
|
|
10862
10856
|
},
|
|
10863
|
-
value: props.value,
|
|
10864
10857
|
onChange: onChange
|
|
10865
10858
|
})));
|
|
10866
10859
|
}
|
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> {
|
|
@@ -10826,19 +10821,19 @@ function ItemCodeInput(props) {
|
|
|
10826
10821
|
while (1) {
|
|
10827
10822
|
switch (_context2.prev = _context2.next) {
|
|
10828
10823
|
case 0:
|
|
10829
|
-
debugger;
|
|
10830
10824
|
record = options.filter(function (e) {
|
|
10831
10825
|
return e.itemCode === itemName;
|
|
10832
10826
|
})[0];
|
|
10833
10827
|
|
|
10834
10828
|
if (record) {
|
|
10835
|
-
_context2.next =
|
|
10829
|
+
_context2.next = 3;
|
|
10836
10830
|
break;
|
|
10837
10831
|
}
|
|
10838
10832
|
|
|
10839
10833
|
return _context2.abrupt("return");
|
|
10840
10834
|
|
|
10841
|
-
case
|
|
10835
|
+
case 3:
|
|
10836
|
+
debugger;
|
|
10842
10837
|
controller.importGoodsDrawer(record);
|
|
10843
10838
|
|
|
10844
10839
|
case 5:
|
|
@@ -10856,21 +10851,19 @@ function ItemCodeInput(props) {
|
|
|
10856
10851
|
return React__default['default'].createElement("div", {
|
|
10857
10852
|
className: 'kts-invoice-operate-goods-list-itemCode-input'
|
|
10858
10853
|
}, React__default['default'].createElement(ktsXui.AutoComplete, {
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
value: editGood === null || editGood === void 0 ? void 0 : editGood.itemCode,
|
|
10854
|
+
onSearch: onSearch,
|
|
10855
|
+
value: props.value,
|
|
10862
10856
|
options: options.map(function (e) {
|
|
10863
10857
|
return {
|
|
10864
10858
|
value: e.itemCode
|
|
10865
10859
|
};
|
|
10866
10860
|
}),
|
|
10867
|
-
|
|
10861
|
+
onSelect: onChangeAutoComplete
|
|
10868
10862
|
}, React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
10869
10863
|
style: {
|
|
10870
10864
|
height: '100%',
|
|
10871
10865
|
border: 'none'
|
|
10872
10866
|
},
|
|
10873
|
-
value: props.value,
|
|
10874
10867
|
onChange: onChange
|
|
10875
10868
|
})));
|
|
10876
10869
|
}
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ export default function ItemCodeInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
21
21
|
}, [])
|
|
22
22
|
|
|
23
23
|
const onSearch = React.useCallback(async (searchText: string) => {
|
|
24
|
-
debugger
|
|
24
|
+
debugger;
|
|
25
25
|
try {
|
|
26
26
|
if (autoComplete.onItemCodeSearch) {
|
|
27
27
|
setOptions(await autoComplete.onItemCodeSearch(searchText, editGood?.itemName))
|
|
@@ -33,17 +33,16 @@ export default function ItemCodeInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
33
33
|
}, [autoComplete.onItemCodeSearch, editGood])
|
|
34
34
|
|
|
35
35
|
const onChangeAutoComplete = React.useCallback(async itemName => {
|
|
36
|
-
debugger
|
|
37
36
|
const record = options.filter(e => e.itemCode === itemName)[0] as any;
|
|
38
37
|
if (!record) return;
|
|
39
|
-
|
|
38
|
+
debugger;
|
|
40
39
|
controller.importGoodsDrawer(record);
|
|
41
40
|
}, [options, controller])
|
|
42
41
|
|
|
43
42
|
return (
|
|
44
43
|
<div className='kts-invoice-operate-goods-list-itemCode-input'>
|
|
45
|
-
<AutoComplete
|
|
46
|
-
<Input style={{ height: '100%', border: 'none' }}
|
|
44
|
+
<AutoComplete onSearch={onSearch} value={props.value} options={options.map(e => ({ value: e.itemCode }))} onSelect={onChangeAutoComplete} >
|
|
45
|
+
<Input style={{ height: '100%', border: 'none' }} onChange={onChange} />
|
|
47
46
|
</AutoComplete>
|
|
48
47
|
</div>
|
|
49
48
|
)
|
|
@@ -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
|
)
|