@gm-pc/react 1.28.0-beta.12 → 1.28.0-beta.14
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gm-pc/react",
|
|
3
|
-
"version": "1.28.0-beta.
|
|
3
|
+
"version": "1.28.0-beta.14",
|
|
4
4
|
"description": "观麦前端基础组件库",
|
|
5
5
|
"author": "liyatang <liyatang@qq.com>",
|
|
6
6
|
"homepage": "https://github.com/gmfe/gm-pc#readme",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@gm-common/hooks": "^2.10.0",
|
|
26
26
|
"@gm-common/tool": "^2.10.0",
|
|
27
|
-
"@gm-pc/locales": "^1.28.0-beta.
|
|
27
|
+
"@gm-pc/locales": "^1.28.0-beta.14",
|
|
28
28
|
"big.js": "^6.0.1",
|
|
29
29
|
"classnames": "^2.2.5",
|
|
30
30
|
"lodash": "^4.17.19",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react-router-dom": "^5.2.0",
|
|
49
49
|
"react-window": "^1.8.5"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "d25d39a3ea48ff4a5efe1fb55401cb13228bc859"
|
|
52
52
|
}
|
|
@@ -402,36 +402,38 @@ class MoreSelectBase<V extends string | number = string> extends Component<
|
|
|
402
402
|
listHeight,
|
|
403
403
|
} = this.props
|
|
404
404
|
|
|
405
|
-
const selectedValues = new Set(selected
|
|
405
|
+
const selectedValues = new Set(selected?.map((v) => v.value))
|
|
406
406
|
|
|
407
407
|
// 分离已勾选和未勾选的数据
|
|
408
408
|
const availableGroups: MoreSelectGroupDataItem<V>[] = []
|
|
409
|
+
// 已选中区域直接使用 selected 构建,不受筛选影响
|
|
410
|
+
const selectedGroups: MoreSelectGroupDataItem<V>[] = []
|
|
409
411
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
if (multiple) {
|
|
413
|
+
filterData.forEach((group) => {
|
|
414
|
+
const availableChildren = group.children.filter(
|
|
415
|
+
(item) => !selectedValues.has(item.value)
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
if (availableChildren.length > 0) {
|
|
419
|
+
availableGroups.push({
|
|
420
|
+
...group,
|
|
421
|
+
children: availableChildren,
|
|
422
|
+
})
|
|
423
|
+
}
|
|
424
|
+
})
|
|
414
425
|
|
|
415
|
-
if (
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
children:
|
|
426
|
+
if (selected.length > 0) {
|
|
427
|
+
selectedGroups.push({
|
|
428
|
+
label: '',
|
|
429
|
+
children: selected,
|
|
419
430
|
})
|
|
420
431
|
}
|
|
421
|
-
})
|
|
422
|
-
|
|
423
|
-
// 已选中区域直接使用 selected 构建,不受筛选影响
|
|
424
|
-
const selectedGroups: MoreSelectGroupDataItem<V>[] = []
|
|
425
|
-
if (selected.length > 0) {
|
|
426
|
-
selectedGroups.push({
|
|
427
|
-
label: '',
|
|
428
|
-
children: selected,
|
|
429
|
-
})
|
|
430
432
|
}
|
|
431
433
|
|
|
432
434
|
return (
|
|
433
435
|
<div style={{ height: listHeight, overflow: 'auto' }}>
|
|
434
|
-
{
|
|
436
|
+
{selected.length > 0 && multiple && (
|
|
435
437
|
<>
|
|
436
438
|
<div className='gm-more-select-section-title gm-padding-5 gm-text-desc gm-text-12'>
|
|
437
439
|
已选中
|
|
@@ -445,28 +447,28 @@ class MoreSelectBase<V extends string | number = string> extends Component<
|
|
|
445
447
|
renderItem={renderListItem}
|
|
446
448
|
onSelect={this._handleSelect}
|
|
447
449
|
isScrollTo={false}
|
|
448
|
-
willActiveIndex={willActiveIndex!}
|
|
449
450
|
/>
|
|
450
451
|
</>
|
|
451
452
|
)}
|
|
452
|
-
|
|
453
|
-
|
|
453
|
+
<>
|
|
454
|
+
{multiple && (
|
|
454
455
|
<div className='gm-more-select-section-title gm-padding-5 gm-text-desc gm-text-12'>
|
|
455
456
|
未选中
|
|
456
457
|
</div>
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
458
|
+
)}
|
|
459
|
+
|
|
460
|
+
<ListBase
|
|
461
|
+
selected={selected.map((v) => v.value)}
|
|
462
|
+
data={multiple ? availableGroups : filterData}
|
|
463
|
+
multiple={multiple}
|
|
464
|
+
isGroupList={isGroupList}
|
|
465
|
+
className='gm-border-0'
|
|
466
|
+
renderItem={renderListItem}
|
|
467
|
+
onSelect={this._handleSelect}
|
|
468
|
+
isScrollTo
|
|
469
|
+
willActiveIndex={willActiveIndex!}
|
|
470
|
+
/>
|
|
471
|
+
</>
|
|
470
472
|
</div>
|
|
471
473
|
)
|
|
472
474
|
}
|