@gm-pc/react 1.18.0-beta.1 → 1.19.0-beta.1
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.
|
|
3
|
+
"version": "1.19.0-beta.1",
|
|
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.
|
|
27
|
+
"@gm-pc/locales": "^1.19.0-beta.1",
|
|
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": "842fca66d0e38964cee07bfa0204134d724b07df"
|
|
52
52
|
}
|
|
@@ -135,7 +135,7 @@ class MoreSelectBase<V extends string | number = string> extends Component<
|
|
|
135
135
|
setTimeout(() => {
|
|
136
136
|
// eslint-disable-next-line no-unused-expressions
|
|
137
137
|
isInitSearch && this._inputRef.current?.select()
|
|
138
|
-
if (this.props.
|
|
138
|
+
if (this.props.searchOnActive) {
|
|
139
139
|
localStorage.setItem('_GM-PC_MORESELECT_SEARCHVALUE', this.state.searchValue)
|
|
140
140
|
}
|
|
141
141
|
}, 100)
|
|
@@ -296,7 +296,7 @@ class MoreSelectBase<V extends string | number = string> extends Component<
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
private _handlePopoverVisibleChange = (active: boolean) => {
|
|
299
|
-
if (active && this.props.
|
|
299
|
+
if (active && this.props.searchOnActive) {
|
|
300
300
|
const searchValue = localStorage.getItem('_GM-PC_MORESELECT_SEARCHVALUE')
|
|
301
301
|
if (searchValue) {
|
|
302
302
|
this.setState({ searchValue })
|
|
@@ -343,9 +343,7 @@ class MoreSelectBase<V extends string | number = string> extends Component<
|
|
|
343
343
|
popup={this._renderList}
|
|
344
344
|
disabled={disabled}
|
|
345
345
|
isInPopup={isInPopup}
|
|
346
|
-
onVisibleChange={
|
|
347
|
-
this._handlePopoverVisibleChange(active)
|
|
348
|
-
}}
|
|
346
|
+
onVisibleChange={this._handlePopoverVisibleChange}
|
|
349
347
|
>
|
|
350
348
|
{children ?? (
|
|
351
349
|
<Flex
|
|
@@ -79,7 +79,7 @@ interface MoreSelectBaseProps<V extends string | number = string>
|
|
|
79
79
|
searchValue: string
|
|
80
80
|
): MoreSelectGroupDataItem<V>[]
|
|
81
81
|
/** 是否在active的时候搜索,订单业务相关,searchValue放在localstorage */
|
|
82
|
-
|
|
82
|
+
searchOnActive?: boolean
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
type MoreSelectData<V extends string | number = string> =
|
|
@@ -91,7 +91,7 @@ type MoreSelectSelected<V extends string | number = string> =
|
|
|
91
91
|
|
|
92
92
|
interface MoreSelectProps<V extends string | number = string>
|
|
93
93
|
extends MoreSelectCommonProps<V>,
|
|
94
|
-
Pick<MoreSelectBaseProps, '
|
|
94
|
+
Pick<MoreSelectBaseProps, 'searchOnActive'> {
|
|
95
95
|
data?: MoreSelectData<V>
|
|
96
96
|
selected?: MoreSelectSelected<V>
|
|
97
97
|
value?: V | V[]
|
|
@@ -102,7 +102,7 @@ class Popover extends Component<PopoverProps, PopoverState> {
|
|
|
102
102
|
private _debounceHandleTableScroll = _.debounce(this._handleTableScroll, 200)
|
|
103
103
|
|
|
104
104
|
private _setActive = (active: boolean): void => {
|
|
105
|
-
if (this._isUnmounted) {
|
|
105
|
+
if (this._isUnmounted || this.state.active === active) {
|
|
106
106
|
return
|
|
107
107
|
}
|
|
108
108
|
const { onVisibleChange } = this.props
|