kts-component-invoice-operate 3.2.127 → 3.2.128
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
|
@@ -19395,7 +19395,7 @@ function ItemNameInput$1(props) {
|
|
|
19395
19395
|
_context3.prev = 0;
|
|
19396
19396
|
|
|
19397
19397
|
if (!(autoComplete.onItemNameSearch && searchText)) {
|
|
19398
|
-
_context3.next =
|
|
19398
|
+
_context3.next = 10;
|
|
19399
19399
|
break;
|
|
19400
19400
|
}
|
|
19401
19401
|
|
|
@@ -19411,23 +19411,28 @@ function ItemNameInput$1(props) {
|
|
|
19411
19411
|
});
|
|
19412
19412
|
});
|
|
19413
19413
|
setOptions(list);
|
|
19414
|
-
|
|
19415
|
-
case 9:
|
|
19416
|
-
_context3.next = 15;
|
|
19414
|
+
_context3.next = 11;
|
|
19417
19415
|
break;
|
|
19418
19416
|
|
|
19417
|
+
case 10:
|
|
19418
|
+
setOptions([]);
|
|
19419
|
+
|
|
19419
19420
|
case 11:
|
|
19420
|
-
_context3.
|
|
19421
|
+
_context3.next = 17;
|
|
19422
|
+
break;
|
|
19423
|
+
|
|
19424
|
+
case 13:
|
|
19425
|
+
_context3.prev = 13;
|
|
19421
19426
|
_context3.t2 = _context3["catch"](0);
|
|
19422
19427
|
setOptions([]);
|
|
19423
19428
|
throw _context3.t2;
|
|
19424
19429
|
|
|
19425
|
-
case
|
|
19430
|
+
case 17:
|
|
19426
19431
|
case "end":
|
|
19427
19432
|
return _context3.stop();
|
|
19428
19433
|
}
|
|
19429
19434
|
}
|
|
19430
|
-
}, _callee3, null, [[0,
|
|
19435
|
+
}, _callee3, null, [[0, 13]]);
|
|
19431
19436
|
}));
|
|
19432
19437
|
|
|
19433
19438
|
return function (_x4) {
|
package/dist/index.js
CHANGED
|
@@ -19405,7 +19405,7 @@ function ItemNameInput$1(props) {
|
|
|
19405
19405
|
_context3.prev = 0;
|
|
19406
19406
|
|
|
19407
19407
|
if (!(autoComplete.onItemNameSearch && searchText)) {
|
|
19408
|
-
_context3.next =
|
|
19408
|
+
_context3.next = 10;
|
|
19409
19409
|
break;
|
|
19410
19410
|
}
|
|
19411
19411
|
|
|
@@ -19421,23 +19421,28 @@ function ItemNameInput$1(props) {
|
|
|
19421
19421
|
});
|
|
19422
19422
|
});
|
|
19423
19423
|
setOptions(list);
|
|
19424
|
-
|
|
19425
|
-
case 9:
|
|
19426
|
-
_context3.next = 15;
|
|
19424
|
+
_context3.next = 11;
|
|
19427
19425
|
break;
|
|
19428
19426
|
|
|
19427
|
+
case 10:
|
|
19428
|
+
setOptions([]);
|
|
19429
|
+
|
|
19429
19430
|
case 11:
|
|
19430
|
-
_context3.
|
|
19431
|
+
_context3.next = 17;
|
|
19432
|
+
break;
|
|
19433
|
+
|
|
19434
|
+
case 13:
|
|
19435
|
+
_context3.prev = 13;
|
|
19431
19436
|
_context3.t2 = _context3["catch"](0);
|
|
19432
19437
|
setOptions([]);
|
|
19433
19438
|
throw _context3.t2;
|
|
19434
19439
|
|
|
19435
|
-
case
|
|
19440
|
+
case 17:
|
|
19436
19441
|
case "end":
|
|
19437
19442
|
return _context3.stop();
|
|
19438
19443
|
}
|
|
19439
19444
|
}
|
|
19440
|
-
}, _callee3, null, [[0,
|
|
19445
|
+
}, _callee3, null, [[0, 13]]);
|
|
19441
19446
|
}));
|
|
19442
19447
|
|
|
19443
19448
|
return function (_x4) {
|
package/package.json
CHANGED
|
@@ -27,23 +27,23 @@ export default function ItemNameInput(props: {
|
|
|
27
27
|
}, [])
|
|
28
28
|
|
|
29
29
|
const onBlur = React.useCallback(async (searchText: any) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
try {
|
|
31
|
+
if (autoComplete.onItemNameBlur) {
|
|
32
|
+
if (!selectLine?.shorthand && !!searchText?.target?.value) {
|
|
33
|
+
const taxCategoryData: any = await autoComplete.onItemNameBlur(searchText);
|
|
34
|
+
if (taxCategoryData && taxCategoryData[0]) {
|
|
35
|
+
const params = {
|
|
36
|
+
taxClassificationCode: taxCategoryData[0].taxCategoryCode,
|
|
37
|
+
shorthand: taxCategoryData[0].shorthand
|
|
38
|
+
}
|
|
39
|
+
controller.itemNameBlur(params);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
setSelectLine(null);
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
} catch (error) {
|
|
45
|
+
throw error;
|
|
43
46
|
}
|
|
44
|
-
} catch (error) {
|
|
45
|
-
throw error;
|
|
46
|
-
}
|
|
47
47
|
}, [autoComplete.onItemNameBlur, selectLine, props.editGood])
|
|
48
48
|
|
|
49
49
|
const onChangeAutoComplete = React.useCallback(async (_, i) => {
|
|
@@ -57,8 +57,10 @@ export default function ItemNameInput(props: {
|
|
|
57
57
|
const onSearch = React.useCallback(async (searchText: string) => {
|
|
58
58
|
try {
|
|
59
59
|
if (autoComplete.onItemNameSearch && searchText) {
|
|
60
|
-
const list = [...await autoComplete.onItemNameSearch(searchText)].map(e => ({ ...e, $index: uuid() }))
|
|
60
|
+
const list = [...await autoComplete.onItemNameSearch(searchText)].map(e => ({ ...e, $index: uuid() }));
|
|
61
61
|
setOptions(list);
|
|
62
|
+
} else {
|
|
63
|
+
setOptions([]);
|
|
62
64
|
}
|
|
63
65
|
} catch (error) {
|
|
64
66
|
setOptions([]);
|
|
@@ -69,11 +71,11 @@ export default function ItemNameInput(props: {
|
|
|
69
71
|
return (
|
|
70
72
|
<div className='kts-invoice-operate-goods-list-itemName-input'>
|
|
71
73
|
{props.shorthand && <span style={{ alignSelf: 'center', fontSize: 12 }} >*{props.shorthand}*</span>}
|
|
72
|
-
<AutoComplete
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
<AutoComplete
|
|
75
|
+
onSearch={onSearch}
|
|
76
|
+
value={props.value}
|
|
77
|
+
options={options.map(e => ({ value: e.$index, label: e.itemName }))}
|
|
78
|
+
onSelect={onChangeAutoComplete}
|
|
77
79
|
>
|
|
78
80
|
<Input style={{ height: '100%' }} onChange={onChange} suffix={props.suffix} onBlur={onBlur} />
|
|
79
81
|
</AutoComplete>
|