@@ -7,10 +7,8 @@ import {DragDirection, IDragMoveEventArgs, IDragStartEventArgs} from '../../dire
77export 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