@@ -86,10 +86,11 @@ const metadata = {
86
86
/**
87
87
* If set to true the navigation is hidden.
88
88
* @type {boolean }
89
+ * @since 1.0.0-rc.15
89
90
* @defaultvalue false
90
91
* @public
91
92
*/
92
- hideNavigation : {
93
+ hideNavigationArrows : {
93
94
type : Boolean ,
94
95
} ,
95
96
@@ -434,6 +435,10 @@ class Carousel extends UI5Element {
434
435
return index >= 0 && index <= this . pagesCount - 1 ;
435
436
}
436
437
438
+ get hasManyPages ( ) {
439
+ return this . pagesCount > 1 ;
440
+ }
441
+
437
442
get styles ( ) {
438
443
return {
439
444
content : {
@@ -450,12 +455,12 @@ class Carousel extends UI5Element {
450
455
content : {
451
456
"ui5-carousel-content" : true ,
452
457
"ui5-carousel-content-no-animation" : this . supressAimation ,
453
- "ui5-carousel-content-has-navigation" : this . showNavigation ,
454
- "ui5-carousel-content-has-navigation-and-buttons" : this . showNavigation && this . arrowsPlacement === CarouselArrowsPlacement . Navigation ,
458
+ "ui5-carousel-content-has-navigation" : this . hasManyPages ,
459
+ "ui5-carousel-content-has-navigation-and-buttons" : this . hasManyPages && this . arrowsPlacement === CarouselArrowsPlacement . Navigation ,
455
460
} ,
456
461
navigation : {
457
462
"ui5-carousel-navigation-wrapper" : true ,
458
- "ui5-carousel-navigation-with-buttons" : this . showNavigation && this . arrowsPlacement === CarouselArrowsPlacement . Navigation ,
463
+ "ui5-carousel-navigation-with-buttons" : this . hasManyPages && ( this . arrowsPlacement === CarouselArrowsPlacement . Navigation && ! this . hideNavigationArrows ) ,
459
464
} ,
460
465
navPrevButton : {
461
466
"ui5-carousel-navigation-button--hidden" : ! this . hasPrev ,
@@ -490,11 +495,11 @@ class Carousel extends UI5Element {
490
495
}
491
496
492
497
get arrows ( ) {
493
- const showArrows = this . _visibleNavigationArrows && this . showNavigation && isDesktop ( ) ;
498
+ const showArrows = this . _visibleNavigationArrows && this . hasManyPages && isDesktop ( ) ;
494
499
495
500
return {
496
- content : showArrows && this . arrowsPlacement === CarouselArrowsPlacement . Content ,
497
- navigation : showArrows && this . arrowsPlacement === CarouselArrowsPlacement . Navigation ,
501
+ content : ! this . hideNavigationArrows && showArrows && this . arrowsPlacement === CarouselArrowsPlacement . Content ,
502
+ navigation : ! this . hideNavigationArrows && showArrows && this . arrowsPlacement === CarouselArrowsPlacement . Navigation ,
498
503
} ;
499
504
}
500
505
@@ -518,10 +523,6 @@ class Carousel extends UI5Element {
518
523
return this . _isRTL ? this . pagesCount - ( this . pagesCount - this . selectedIndex ) + 1 : this . selectedIndex + 1 ;
519
524
}
520
525
521
- get showNavigation ( ) {
522
- return ! this . hideNavigation && this . pagesCount > 1 ;
523
- }
524
-
525
526
get ofText ( ) {
526
527
return this . i18nBundle . getText ( CAROUSEL_OF_TEXT ) ;
527
528
}
0 commit comments