@@ -10,6 +10,7 @@ import {
10
10
} from '@angular/core' ;
11
11
import { first } from 'rxjs/operators' ;
12
12
import { IBaseChipEventArgs , IgxChipComponent } from '../../chips/chip.component' ;
13
+ import { IgxChipsAreaComponent } from '../../chips/chips-area.component' ;
13
14
import { GridColumnDataType } from '../../data-operations/data-util' ;
14
15
import { SortingDirection } from '../../data-operations/sorting-strategy' ;
15
16
import { ISelectionEventArgs } from '../../drop-down/drop-down.common' ;
@@ -39,8 +40,6 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent {
39
40
40
41
public value : IPivotValue ;
41
42
private _dropPos = DropPosition . AfterDropTarget ;
42
- private _dropLeftIndicatorClass = 'igx-pivot-grid__drop-indicator--left' ;
43
- private _dropRightIndicatorClass = 'igx-pivot-grid__drop-indicator--right' ;
44
43
private valueData : Map < string , IPivotAggregator [ ] > ;
45
44
private _subMenuPositionSettings : PositionSettings = {
46
45
verticalStartPoint : VerticalAlignment . Bottom ,
@@ -86,6 +85,11 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent {
86
85
}
87
86
}
88
87
88
+ public getAreaHeight ( area : IgxChipsAreaComponent ) {
89
+ const chips = area . chipsList ;
90
+ return chips && chips . length > 0 ? chips . first . nativeElement . clientHeight : 0 ;
91
+ }
92
+
89
93
public getAggregateList ( val : IPivotValue ) : IPivotAggregator [ ] {
90
94
if ( ! val . aggregateList ) {
91
95
let defaultAggr = this . getAggregatorsForValue ( val ) ;
@@ -216,23 +220,17 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent {
216
220
217
221
this . _dropPos = event . originalEvent . offsetX > pos ? DropPosition . AfterDropTarget : DropPosition . BeforeDropTarget ;
218
222
if ( this . _dropPos === DropPosition . AfterDropTarget ) {
219
- event . owner . nativeElement . style . borderRight = '1px solid red' ;
220
- event . owner . nativeElement . style . borderLeft = '' ;
221
- this . renderer . removeClass ( event . owner . nativeElement , this . _dropLeftIndicatorClass ) ;
222
- this . renderer . addClass ( event . owner . nativeElement , this . _dropRightIndicatorClass ) ;
223
+ event . owner . nativeElement . previousElementSibling . style . visibility = 'hidden' ;
224
+ event . owner . nativeElement . nextElementSibling . style . visibility = '' ;
223
225
} else {
224
- event . owner . nativeElement . style . borderRight = '' ;
225
- event . owner . nativeElement . style . borderLeft = '1px solid red' ;
226
- this . renderer . addClass ( event . owner . nativeElement , this . _dropLeftIndicatorClass ) ;
227
- this . renderer . removeClass ( event . owner . nativeElement , this . _dropRightIndicatorClass ) ;
226
+ event . owner . nativeElement . nextElementSibling . style . visibility = 'hidden' ;
227
+ event . owner . nativeElement . previousElementSibling . style . visibility = '' ;
228
228
}
229
229
}
230
230
231
231
public onDimDragLeave ( event ) {
232
- this . renderer . removeClass ( event . owner . nativeElement , this . _dropLeftIndicatorClass ) ;
233
- this . renderer . removeClass ( event . owner . nativeElement , this . _dropRightIndicatorClass ) ;
234
- event . owner . nativeElement . style . borderLeft = '' ;
235
- event . owner . nativeElement . style . borderRight = '' ;
232
+ event . owner . nativeElement . previousElementSibling . style . visibility = 'hidden' ;
233
+ event . owner . nativeElement . nextElementSibling . style . visibility = 'hidden' ;
236
234
this . _dropPos = DropPosition . AfterDropTarget ;
237
235
}
238
236
@@ -250,16 +248,14 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent {
250
248
const targetElem = event . detail . originalEvent . target ;
251
249
const targetOwner = event . detail . owner . element . nativeElement . parentElement ;
252
250
if ( targetOwner !== lastElem && targetElem . getBoundingClientRect ( ) . x >= lastElem . getBoundingClientRect ( ) . x ) {
253
- this . renderer . addClass ( area . chipsList . last . nativeElement , this . _dropRightIndicatorClass ) ;
254
- // TODO- remove once classes are added.
255
- area . chipsList . last . nativeElement . style . borderRight = '1px solid red' ;
251
+ area . chipsList . last . nativeElement . nextElementSibling . style . visibility = '' ;
256
252
}
257
253
}
258
254
}
259
255
public onAreaDragLeave ( event , area ) {
260
256
area . chipsList . toArray ( ) . forEach ( element => {
261
- this . renderer . removeClass ( element . nativeElement , this . _dropRightIndicatorClass ) ;
262
- element . nativeElement . style . borderRight = '' ;
257
+ event . owner . nativeElement . previousElementSibling . style . visibility = 'hidden' ;
258
+ event . owner . nativeElement . nextElementSibling . style . visibility = 'hidden ' ;
263
259
} ) ;
264
260
}
265
261
0 commit comments