@gm-pc/react 1.28.0-beta.8 → 1.28.0-y.0
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-
|
|
3
|
+
"version": "1.28.0-y.0",
|
|
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-
|
|
27
|
+
"@gm-pc/locales": "^1.28.0-y.0",
|
|
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": "553a50edcf56e3bc001e96d2e6f752344b51021d"
|
|
52
52
|
}
|
|
@@ -401,19 +401,73 @@ class MoreSelectBase<V extends string | number = string> extends Component<
|
|
|
401
401
|
renderListItem,
|
|
402
402
|
listHeight,
|
|
403
403
|
} = this.props
|
|
404
|
+
|
|
405
|
+
const selectedValues = new Set(selected.map((v) => v.value))
|
|
406
|
+
|
|
407
|
+
// 分离已勾选和未勾选的数据
|
|
408
|
+
const availableGroups: MoreSelectGroupDataItem<V>[] = []
|
|
409
|
+
|
|
410
|
+
filterData.forEach((group) => {
|
|
411
|
+
const availableChildren = group.children.filter(
|
|
412
|
+
(item) => !selectedValues.has(item.value)
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
if (availableChildren.length > 0) {
|
|
416
|
+
availableGroups.push({
|
|
417
|
+
...group,
|
|
418
|
+
children: availableChildren,
|
|
419
|
+
})
|
|
420
|
+
}
|
|
421
|
+
})
|
|
422
|
+
|
|
423
|
+
// 已选中区域直接使用 selected 构建,不受筛选影响
|
|
424
|
+
const selectedGroups: MoreSelectGroupDataItem<V>[] = []
|
|
425
|
+
if (selected.length > 0) {
|
|
426
|
+
selectedGroups.push({
|
|
427
|
+
label: '',
|
|
428
|
+
children: selected,
|
|
429
|
+
})
|
|
430
|
+
}
|
|
431
|
+
|
|
404
432
|
return (
|
|
405
|
-
<
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
433
|
+
<div style={{ height: listHeight, overflow: 'auto' }}>
|
|
434
|
+
{selectedGroups.length > 0 && (
|
|
435
|
+
<>
|
|
436
|
+
<div className='gm-more-select-section-title gm-padding-5 gm-text-desc gm-text-12'>
|
|
437
|
+
已选中
|
|
438
|
+
</div>
|
|
439
|
+
<ListBase
|
|
440
|
+
selected={selected.map((v) => v.value)}
|
|
441
|
+
data={selectedGroups}
|
|
442
|
+
multiple={multiple}
|
|
443
|
+
isGroupList={false}
|
|
444
|
+
className='gm-border-0'
|
|
445
|
+
renderItem={renderListItem}
|
|
446
|
+
onSelect={this._handleSelect}
|
|
447
|
+
isScrollTo={false}
|
|
448
|
+
willActiveIndex={willActiveIndex!}
|
|
449
|
+
/>
|
|
450
|
+
</>
|
|
451
|
+
)}
|
|
452
|
+
{availableGroups.length > 0 && (
|
|
453
|
+
<>
|
|
454
|
+
<div className='gm-more-select-section-title gm-padding-5 gm-text-desc gm-text-12'>
|
|
455
|
+
未选中
|
|
456
|
+
</div>
|
|
457
|
+
<ListBase
|
|
458
|
+
selected={selected.map((v) => v.value)}
|
|
459
|
+
data={availableGroups}
|
|
460
|
+
multiple={multiple}
|
|
461
|
+
isGroupList={isGroupList}
|
|
462
|
+
className='gm-border-0'
|
|
463
|
+
renderItem={renderListItem}
|
|
464
|
+
onSelect={this._handleSelect}
|
|
465
|
+
isScrollTo={false}
|
|
466
|
+
willActiveIndex={willActiveIndex!}
|
|
467
|
+
/>
|
|
468
|
+
</>
|
|
469
|
+
)}
|
|
470
|
+
</div>
|
|
417
471
|
)
|
|
418
472
|
}
|
|
419
473
|
}
|
|
@@ -8,7 +8,7 @@ class MoreSelect<V = any> extends Component<MoreSelectProps<V>> {
|
|
|
8
8
|
renderSelected: (item: MoreSelectDataItem<any>) => item.text,
|
|
9
9
|
renderListItem: (item: MoreSelectDataItem<any>) => item.text,
|
|
10
10
|
delay: 500,
|
|
11
|
-
listHeight: '
|
|
11
|
+
listHeight: '280px',
|
|
12
12
|
renderListFilterType: 'default',
|
|
13
13
|
popoverType: 'focus',
|
|
14
14
|
onKeyDown: _.noop,
|