@@ -94,6 +94,17 @@ const metadata = {
94
94
type : Boolean ,
95
95
} ,
96
96
97
+ /**
98
+ * If set to true the page indicator is hidden.
99
+ * @type {boolean }
100
+ * @since 1.0.0-rc.15
101
+ * @defaultvalue false
102
+ * @public
103
+ */
104
+ hidePageIndicator : {
105
+ type : Boolean ,
106
+ } ,
107
+
97
108
/**
98
109
* Defines the index of the initially selected item.
99
110
* @type {Integer }
@@ -277,6 +288,10 @@ class Carousel extends UI5Element {
277
288
}
278
289
279
290
onBeforeRendering ( ) {
291
+ if ( this . arrowsPlacement === CarouselArrowsPlacement . Navigation ) {
292
+ this . _visibleNavigationArrows = true ;
293
+ }
294
+
280
295
this . validateSelectedIndex ( ) ;
281
296
}
282
297
@@ -347,17 +362,21 @@ class Carousel extends UI5Element {
347
362
}
348
363
349
364
_onmouseout ( ) {
350
- this . _visibleNavigationArrows = false ;
365
+ if ( this . arrowsPlacement === CarouselArrowsPlacement . Content ) {
366
+ this . _visibleNavigationArrows = false ;
367
+ }
351
368
}
352
369
353
370
_onmouseover ( ) {
354
- this . _visibleNavigationArrows = true ;
371
+ if ( this . arrowsPlacement === CarouselArrowsPlacement . Content ) {
372
+ this . _visibleNavigationArrows = true ;
373
+ }
355
374
}
356
375
357
376
navigateLeft ( ) {
358
377
this . _resizing = false ;
359
378
360
- const peviousSelectedIndex = this . selectedIndex ;
379
+ const previousSelectedIndex = this . selectedIndex ;
361
380
362
381
if ( this . selectedIndex - 1 < 0 ) {
363
382
if ( this . cyclic ) {
@@ -367,15 +386,15 @@ class Carousel extends UI5Element {
367
386
-- this . selectedIndex ;
368
387
}
369
388
370
- if ( peviousSelectedIndex !== this . selectedIndex ) {
389
+ if ( previousSelectedIndex !== this . selectedIndex ) {
371
390
this . fireEvent ( "navigate" , { selectedIndex : this . selectedIndex } ) ;
372
391
}
373
392
}
374
393
375
394
navigateRight ( ) {
376
395
this . _resizing = false ;
377
396
378
- const peviousSelectedIndex = this . selectedIndex ;
397
+ const previousSelectedIndex = this . selectedIndex ;
379
398
380
399
if ( this . selectedIndex + 1 > this . pagesCount - 1 ) {
381
400
if ( this . cyclic ) {
@@ -387,7 +406,7 @@ class Carousel extends UI5Element {
387
406
++ this . selectedIndex ;
388
407
}
389
408
390
- if ( peviousSelectedIndex !== this . selectedIndex ) {
409
+ if ( previousSelectedIndex !== this . selectedIndex ) {
391
410
this . fireEvent ( "navigate" , { selectedIndex : this . selectedIndex } ) ;
392
411
}
393
412
@@ -435,6 +454,25 @@ class Carousel extends UI5Element {
435
454
return index >= 0 && index <= this . pagesCount - 1 ;
436
455
}
437
456
457
+ /**
458
+ * @private
459
+ */
460
+ get renderNavigation ( ) {
461
+ if ( ! this . hasManyPages ) {
462
+ return false ;
463
+ }
464
+
465
+ if ( this . arrowsPlacement === CarouselArrowsPlacement . Navigation && ! this . hideNavigationArrows ) {
466
+ return true ;
467
+ }
468
+
469
+ if ( this . hidePageIndicator ) {
470
+ return false ;
471
+ }
472
+
473
+ return true ;
474
+ }
475
+
438
476
get hasManyPages ( ) {
439
477
return this . pagesCount > 1 ;
440
478
}
@@ -450,17 +488,18 @@ class Carousel extends UI5Element {
450
488
get classes ( ) {
451
489
return {
452
490
viewport : {
491
+ "ui5-carousel-viewport" : true ,
453
492
"ui5-carousel-viewport--single" : this . pagesCount === 1 ,
454
493
} ,
455
494
content : {
456
495
"ui5-carousel-content" : true ,
457
- "ui5-carousel-content-no-animation" : this . supressAimation ,
458
- "ui5-carousel-content-has-navigation" : this . hasManyPages ,
459
- "ui5-carousel-content-has-navigation-and-buttons" : this . hasManyPages && this . arrowsPlacement === CarouselArrowsPlacement . Navigation ,
496
+ "ui5-carousel-content-no-animation" : this . suppressAnimation ,
497
+ "ui5-carousel-content-has-navigation" : this . renderNavigation ,
498
+ "ui5-carousel-content-has-navigation-and-buttons" : this . renderNavigation && this . arrowsPlacement === CarouselArrowsPlacement . Navigation && ! this . hideNavigationArrows ,
460
499
} ,
461
500
navigation : {
462
501
"ui5-carousel-navigation-wrapper" : true ,
463
- "ui5-carousel-navigation-with-buttons" : this . hasManyPages && ( this . arrowsPlacement === CarouselArrowsPlacement . Navigation && ! this . hideNavigationArrows ) ,
502
+ "ui5-carousel-navigation-with-buttons" : this . renderNavigation && this . arrowsPlacement === CarouselArrowsPlacement . Navigation && ! this . hideNavigationArrows ,
464
503
} ,
465
504
navPrevButton : {
466
505
"ui5-carousel-navigation-button--hidden" : ! this . hasPrev ,
@@ -511,7 +550,7 @@ class Carousel extends UI5Element {
511
550
return this . cyclic || this . selectedIndex + 1 <= this . pagesCount - 1 ;
512
551
}
513
552
514
- get supressAimation ( ) {
553
+ get suppressAnimation ( ) {
515
554
return this . _resizing || getAnimationMode ( ) === AnimationMode . None ;
516
555
}
517
556
0 commit comments