Skip to content

Commit 6dc013d

Browse files
authored
Merge branch 'master' into SKrastev/grid-disabled-pin-row
2 parents cc22929 + dcd0932 commit 6dc013d

File tree

11 files changed

+233
-173
lines changed

11 files changed

+233
-173
lines changed

projects/igniteui-angular/src/lib/core/styles/components/splitter/_splitter-theme.scss

-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
align-items: center;
9494
background: $splitter-color;
9595
border: 1px solid $splitter-color;
96-
cursor: row-resize;
9796
z-index: 99;
9897
opacity: .68;
9998
transition: opacity .15s $ease-out-quad !important;
@@ -123,7 +122,6 @@
123122
%igx-splitter-bar--vertical {
124123
flex-direction: column;
125124
height: 100%;
126-
cursor: col-resize;
127125

128126
&::before {
129127
@extend %handle-area--vertical;

projects/igniteui-angular/src/lib/splitter/splitter-bar/splitter-bar.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div class="igx-splitter-bar"
22
[class.igx-splitter-bar--vertical]='type === 0'
3+
[style.cursor]='cursor'
34
igxDrag
45
[ghost]="false"
56
[dragDirection]='dragDir'

projects/igniteui-angular/src/lib/splitter/splitter-bar/splitter-bar.component.ts

+43-25
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ import {DragDirection, IDragMoveEventArgs, IDragStartEventArgs} from '../../dire
77
export const SPLITTER_INTERACTION_KEYS = new Set('right down left up arrowright arrowdown arrowleft arrowup'.split(' '));
88

99
/**
10-
* Provides reference to `SplitBarComponent` component.
11-
* Represents the draggable gripper that visually separates panes and allows for changing their sizes.
12-
* @export
13-
* @class SplitBarComponent
10+
* @hidden @internal
11+
* Represents the draggable bar that visually separates panes and allows for changing their sizes.
1412
*/
1513
@Component({
1614
selector: 'igx-splitter-bar',
@@ -24,15 +22,13 @@ export class IgxSplitBarComponent {
2422
public cssClass = 'igx-splitter-bar-host';
2523

2624
/**
27-
* Sets/gets `IgxSplitBarComponent` orientation.
28-
* @type SplitterType
25+
* Gets/Sets the orientation.
2926
*/
3027
@Input()
31-
public type: SplitterType = SplitterType.Vertical;
28+
public type: SplitterType = SplitterType.Horizontal;
3229

3330
/**
34-
* Sets/gets `IgxSplitBarComponent` element order.
35-
* @type SplitterType
31+
* Sets/gets the element order.
3632
*/
3733
@HostBinding('style.order')
3834
@Input()
@@ -43,7 +39,29 @@ export class IgxSplitBarComponent {
4339
* @internal
4440
*/
4541
@HostBinding('attr.tabindex')
46-
public tabindex = 0;
42+
public get tabindex() {
43+
return this.resizeDisallowed ? null : 0;
44+
}
45+
46+
/**
47+
* @hidden
48+
* @internal
49+
*/
50+
@HostBinding('attr.aria-orientation')
51+
public get orientation() {
52+
return this.type === SplitterType.Horizontal ? 'horizontal' : 'vertical';
53+
}
54+
55+
/**
56+
* @hidden
57+
* @internal
58+
*/
59+
public get cursor() {
60+
if (this.resizeDisallowed) {
61+
return '';
62+
}
63+
return this.type === SplitterType.Horizontal ? 'col-resize' : 'row-resize';
64+
}
4765

4866
/**
4967
* Sets/gets the `SplitPaneComponent` associated with the current `SplitBarComponent`.
@@ -60,35 +78,26 @@ export class IgxSplitBarComponent {
6078

6179
/**
6280
* An event that is emitted whenever we start dragging the current `SplitBarComponent`.
63-
* @memberof SplitBarComponent
6481
*/
6582
@Output()
6683
public moveStart = new EventEmitter<IgxSplitterPaneComponent>();
6784

6885
/**
6986
* An event that is emitted while we are dragging the current `SplitBarComponent`.
70-
* @memberof SplitBarComponent
7187
*/
7288
@Output()
7389
public moving = new EventEmitter<number>();
7490

75-
/**
76-
* An event that is emitted when collapsing the pane
77-
*/
78-
@Output()
79-
public togglePane = new EventEmitter<IgxSplitterPaneComponent>();
8091
/**
8192
* A temporary holder for the pointer coordinates.
82-
* @private
83-
* @memberof SplitBarComponent
8493
*/
8594
private startPoint!: number;
8695

8796
/**
8897
* @hidden @internal
8998
*/
9099
public get prevButtonHidden() {
91-
return this.siblings[0].hidden && !this.siblings[1].hidden;
100+
return this.siblings[0].collapsed && !this.siblings[1].collapsed;
92101
}
93102

94103
/**
@@ -175,9 +184,12 @@ export class IgxSplitBarComponent {
175184
* @hidden @internal
176185
*/
177186
public get nextButtonHidden() {
178-
return this.siblings[1].hidden && !this.siblings[0].hidden;
187+
return this.siblings[1].collapsed && !this.siblings[0].collapsed;
179188
}
180189

190+
/**
191+
* @hidden @internal
192+
*/
181193
public onDragStart(event: IDragStartEventArgs) {
182194
if (this.resizeDisallowed) {
183195
event.cancel = true;
@@ -187,6 +199,9 @@ export class IgxSplitBarComponent {
187199
this.moveStart.emit(this.pane);
188200
}
189201

202+
/**
203+
* @hidden @internal
204+
*/
190205
public onDragMove(event: IDragMoveEventArgs) {
191206
const isHorizontal = this.type === SplitterType.Horizontal;
192207
const curr = isHorizontal ? event.pageX : event.pageY;
@@ -200,20 +215,23 @@ export class IgxSplitBarComponent {
200215

201216
protected get resizeDisallowed() {
202217
const relatedTabs = this.siblings;
203-
return !!relatedTabs.find(x => x.resizable === false || x.hidden === true);
218+
return !!relatedTabs.find(x => x.resizable === false || x.collapsed === true);
204219
}
205220

221+
/**
222+
* @hidden @internal
223+
*/
206224
public onCollapsing(next: boolean) {
207225
const prevSibling = this.siblings[0];
208226
const nextSibling = this.siblings[1];
209227
let target;
210228
if (next) {
211229
// if next is clicked when prev pane is hidden, show prev pane, else hide next pane.
212-
target = prevSibling.hidden ? prevSibling : nextSibling;
230+
target = prevSibling.collapsed ? prevSibling : nextSibling;
213231
} else {
214232
// if prev is clicked when next pane is hidden, show next pane, else hide prev pane.
215-
target = nextSibling.hidden ? nextSibling : prevSibling;
233+
target = nextSibling.collapsed ? nextSibling : prevSibling;
216234
}
217-
this.togglePane.emit(target);
235+
target.toggle();
218236
}
219237
}

0 commit comments

Comments
 (0)