1
1
import * as React from 'react' ;
2
- import { Subject , merge , animationFrameScheduler } from 'rxjs' ;
3
- import { filter , share , observeOn , map } from 'rxjs/operators' ;
2
+ import { animationFrameScheduler , merge , Subject } from 'rxjs' ;
3
+ import { filter , map , observeOn , share , tap } from 'rxjs/operators' ;
4
4
5
5
import {
6
6
BarAction ,
7
+ BarActionType ,
7
8
ChildProps ,
8
9
ResizerContext ,
9
10
SizeRelatedInfo ,
@@ -23,6 +24,7 @@ import {
23
24
interface Props extends React . HTMLAttributes < HTMLDivElement > {
24
25
vertical ?: boolean ;
25
26
beforeApplyResizer ?: ( resizer : Resizer ) => void ;
27
+ afterResizing ?: ( ) => void ;
26
28
}
27
29
28
30
class Container extends React . PureComponent < Props > {
@@ -45,6 +47,7 @@ class Container extends React.PureComponent<Props> {
45
47
calculateCoordinateOffset ( current , original ) [ this . axis ] ,
46
48
getSizeRelatedInfo : ( ) => this . makeSizeInfos ( ) ,
47
49
} ) ,
50
+ tap ( ( scanResult ) => this . monitorBarStatusChanges ( scanResult ) ) ,
48
51
) ,
49
52
) . pipe (
50
53
filter ( ( { discard } ) => ! discard ) ,
@@ -118,6 +121,15 @@ class Container extends React.PureComponent<Props> {
118
121
this . sizeRelatedInfoAction$ . next ( resizer . getResult ( ) ) ;
119
122
}
120
123
124
+ private monitorBarStatusChanges ( { type } : BarActionScanResult ) {
125
+ if (
126
+ type === BarActionType . DEACTIVATE &&
127
+ typeof this . props . afterResizing === 'function'
128
+ ) {
129
+ this . props . afterResizing ( ) ;
130
+ }
131
+ }
132
+
121
133
private triggerBarAction = ( action : BarAction ) => {
122
134
this . barActions$ . next ( action ) ;
123
135
} ;
0 commit comments