@gm-pc/react 1.28.0-beta.11 → 1.28.0-beta.12
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.12",
|
|
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.12",
|
|
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": "b6c0b797d887b71f3e15bafa84dda40ea1ef78f7"
|
|
52
52
|
}
|
|
@@ -405,23 +405,13 @@ class MoreSelectBase<V extends string | number = string> extends Component<
|
|
|
405
405
|
const selectedValues = new Set(selected.map((v) => v.value))
|
|
406
406
|
|
|
407
407
|
// 分离已勾选和未勾选的数据
|
|
408
|
-
const selectedGroups: MoreSelectGroupDataItem<V>[] = []
|
|
409
408
|
const availableGroups: MoreSelectGroupDataItem<V>[] = []
|
|
410
409
|
|
|
411
410
|
filterData.forEach((group) => {
|
|
412
|
-
const selectedChildren = group.children.filter((item) =>
|
|
413
|
-
selectedValues.has(item.value)
|
|
414
|
-
)
|
|
415
411
|
const availableChildren = group.children.filter(
|
|
416
412
|
(item) => !selectedValues.has(item.value)
|
|
417
413
|
)
|
|
418
414
|
|
|
419
|
-
if (selectedChildren.length > 0) {
|
|
420
|
-
selectedGroups.push({
|
|
421
|
-
...group,
|
|
422
|
-
children: selectedChildren,
|
|
423
|
-
})
|
|
424
|
-
}
|
|
425
415
|
if (availableChildren.length > 0) {
|
|
426
416
|
availableGroups.push({
|
|
427
417
|
...group,
|
|
@@ -430,18 +420,27 @@ class MoreSelectBase<V extends string | number = string> extends Component<
|
|
|
430
420
|
}
|
|
431
421
|
})
|
|
432
422
|
|
|
423
|
+
// 已选中区域直接使用 selected 构建,不受筛选影响
|
|
424
|
+
const selectedGroups: MoreSelectGroupDataItem<V>[] = []
|
|
425
|
+
if (selected.length > 0) {
|
|
426
|
+
selectedGroups.push({
|
|
427
|
+
label: '',
|
|
428
|
+
children: selected,
|
|
429
|
+
})
|
|
430
|
+
}
|
|
431
|
+
|
|
433
432
|
return (
|
|
434
433
|
<div style={{ height: listHeight, overflow: 'auto' }}>
|
|
435
434
|
{selectedGroups.length > 0 && (
|
|
436
435
|
<>
|
|
437
436
|
<div className='gm-more-select-section-title gm-padding-5 gm-text-desc gm-text-12'>
|
|
438
|
-
|
|
437
|
+
已选中
|
|
439
438
|
</div>
|
|
440
439
|
<ListBase
|
|
441
440
|
selected={selected.map((v) => v.value)}
|
|
442
441
|
data={selectedGroups}
|
|
443
442
|
multiple={multiple}
|
|
444
|
-
isGroupList={
|
|
443
|
+
isGroupList={false}
|
|
445
444
|
className='gm-border-0'
|
|
446
445
|
renderItem={renderListItem}
|
|
447
446
|
onSelect={this._handleSelect}
|
|
@@ -453,7 +452,7 @@ class MoreSelectBase<V extends string | number = string> extends Component<
|
|
|
453
452
|
{availableGroups.length > 0 && (
|
|
454
453
|
<>
|
|
455
454
|
<div className='gm-more-select-section-title gm-padding-5 gm-text-desc gm-text-12'>
|
|
456
|
-
|
|
455
|
+
未选中
|
|
457
456
|
</div>
|
|
458
457
|
<ListBase
|
|
459
458
|
selected={selected.map((v) => v.value)}
|