@lingxiteam/ebe-utils 0.3.19 → 0.3.20
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.
|
@@ -219,7 +219,7 @@ const MyCascader: React.FC<MyCascaderProps> = forwardRef((props, ref) => {
|
|
|
219
219
|
let { isLeaf } = _item;
|
|
220
220
|
if (isLeaf === undefined) {
|
|
221
221
|
// children为非数组时且配置了展开事件时,视为需要异步加载
|
|
222
|
-
|
|
222
|
+
isLeaf = !Array.isArray(_children) && props.onClickOption ? false : _item.isLeaf;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
return {
|
|
@@ -284,7 +284,21 @@ const MyCascader: React.FC<MyCascaderProps> = forwardRef((props, ref) => {
|
|
|
284
284
|
setChildOptions(data);
|
|
285
285
|
},
|
|
286
286
|
});
|
|
287
|
-
|
|
287
|
+
const handChange = (keys: any, selctOptions: any) => {
|
|
288
|
+
// 选中数据时清除搜索词
|
|
289
|
+
setSearchVal('');
|
|
290
|
+
setCompData(selctOptions);
|
|
291
|
+
if (onChange) {
|
|
292
|
+
onChange(keys, selctOptions);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
const onDropdownVisibleChange = (visible: boolean) => {
|
|
296
|
+
setShowDropDown(visible);
|
|
297
|
+
if (!visible) {
|
|
298
|
+
// 关闭浮层重置搜索条件
|
|
299
|
+
setSearchVal('');
|
|
300
|
+
}
|
|
301
|
+
};
|
|
288
302
|
return (
|
|
289
303
|
<FormFields
|
|
290
304
|
{...getFieldsProps(props)}
|
|
@@ -299,28 +313,21 @@ const MyCascader: React.FC<MyCascaderProps> = forwardRef((props, ref) => {
|
|
|
299
313
|
>
|
|
300
314
|
<Cascader
|
|
301
315
|
dropdownClassName={classNames(dropdownClassName, `${prefixCls}-dropdown`)}
|
|
302
|
-
onDropdownVisibleChange={
|
|
303
|
-
|
|
304
|
-
if (!visible) {
|
|
305
|
-
// 关闭浮层重置搜索条件
|
|
306
|
-
setSearchVal('');
|
|
307
|
-
}
|
|
308
|
-
}}
|
|
309
|
-
{...(restProps as any)}
|
|
316
|
+
onDropdownVisibleChange={onDropdownVisibleChange}
|
|
317
|
+
{...restProps as any}
|
|
310
318
|
value={value}
|
|
311
319
|
options={options}
|
|
320
|
+
open={showDropDown}
|
|
312
321
|
style={restCusStyles}
|
|
313
322
|
multiple={multiple}
|
|
314
323
|
displayRender={renderDisplay}
|
|
315
324
|
notFoundContent={<EmptyComp getLocale={getLocale} dataState={dataState} clsName="pcfactory-empty-small" />}
|
|
316
325
|
showSearch={
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
onSearch={words => {
|
|
326
|
+
showSearch ? {
|
|
327
|
+
matchInputWidth: popoverStyle !== 'auto',
|
|
328
|
+
} : false
|
|
329
|
+
}
|
|
330
|
+
onSearch={(words) => {
|
|
324
331
|
setSearchVal(words);
|
|
325
332
|
if (showSearch && props.onSearch) {
|
|
326
333
|
props.onSearch(words, value, compData);
|
|
@@ -340,21 +347,16 @@ const MyCascader: React.FC<MyCascaderProps> = forwardRef((props, ref) => {
|
|
|
340
347
|
currentRow.children = children;
|
|
341
348
|
delete currentRow.zattrNbrValueMap;
|
|
342
349
|
setSourceOptions(options);
|
|
350
|
+
} else {
|
|
351
|
+
currentRow.isLeaf = true; // 标记为叶子节点
|
|
352
|
+
onDropdownVisibleChange(false);
|
|
343
353
|
}
|
|
344
354
|
}
|
|
345
355
|
}}
|
|
346
356
|
className={classNames(className, cascaderClassName)}
|
|
347
|
-
onChange={
|
|
348
|
-
// 选中数据时清除搜索词
|
|
349
|
-
setSearchVal('');
|
|
350
|
-
setCompData(selctOptions);
|
|
351
|
-
if (onChange) {
|
|
352
|
-
onChange(keys, selctOptions);
|
|
353
|
-
}
|
|
354
|
-
}}
|
|
357
|
+
onChange={handChange}
|
|
355
358
|
/>
|
|
356
|
-
</FormFields>
|
|
357
|
-
);
|
|
359
|
+
</FormFields>);
|
|
358
360
|
});
|
|
359
361
|
|
|
360
362
|
export default MyCascader;
|
package/lib/pcpublic/yarn.lock
CHANGED
|
@@ -1458,10 +1458,10 @@
|
|
|
1458
1458
|
"@babel/runtime" "7.23.2"
|
|
1459
1459
|
rc-util "^4.10.0"
|
|
1460
1460
|
|
|
1461
|
-
"@lingxiteam/lcdp-ueditor-react
|
|
1462
|
-
version "1.0.3-alpha.
|
|
1463
|
-
resolved "
|
|
1464
|
-
integrity sha512-
|
|
1461
|
+
"@lingxiteam/lcdp-ueditor-react@^1.0.3-alpha.8":
|
|
1462
|
+
version "1.0.3-alpha.8"
|
|
1463
|
+
resolved "http://npm.iwhalecloud.com:8081/repository/npm-taobao/@lingxiteam/lcdp-ueditor-react/-/lcdp-ueditor-react-1.0.3-alpha.8.tgz#176fb4fbb99d59dc4b3f8cf62510542fd1a3d41c"
|
|
1464
|
+
integrity sha512-DS6hvJc+2jVx5ti24gb2qL3qZLxxRDNE0VnlOLCyJ7lADI/WUxTu6WLUUohMjIPGu+NJrP7gf69z1LYbh5j7bA==
|
|
1465
1465
|
dependencies:
|
|
1466
1466
|
"@babel/runtime" "7.23.2"
|
|
1467
1467
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingxiteam/ebe-utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@babel/types": "^7.12.12",
|
|
20
20
|
"cac": "^6.7.14",
|
|
21
21
|
"fs-extra": "9.x",
|
|
22
|
-
"@lingxiteam/ebe": "0.3.
|
|
22
|
+
"@lingxiteam/ebe": "0.3.20"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|