-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: (Core) introduce new Carousel component #3551
Conversation
Deploy preview for fundamental-ngx ready! Built with commit 40dad4c |
}) | ||
export class CarouselComponent implements OnInit, AfterContentInit, OnDestroy { | ||
/** @hidden */ | ||
@ContentChildren(CarouselItemComponent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to follow angular coding guidelines for properties alignment. reference angular.io, we can update where ever it is applicable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. followed angular guidelines.
|
||
/** Id for the Carousel. */ | ||
@Input() | ||
@HostBinding('attr.id') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is recommended not to use @HostBinding() along with @input()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see its getting used in core components. Do you have any other approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO IT's correct
changeDetection: ChangeDetectionStrategy.OnPush, | ||
encapsulation: ViewEncapsulation.None | ||
}) | ||
export class CarouselItemComponent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base component extension won't help here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base component is in platform. carousel is in core. so will not be able to use base component.
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having few test scenarios will help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have included tests in carousel component for carousel items as well. removed this file.
imports: [CommonModule], | ||
exports: [CarouselComponent, CarouselItemComponent] | ||
}) | ||
export class CarouselNewModule {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only core we have a carousel why should we have "New"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using CarouselModule now.
The images in the preview take a very long time to load if they're not cached, perhaps each example can share a service that will load the images so they'll only need to be downloaded once. Also I think that service itself is just very slow so maybe use a different service, placeimg seems to be faster |
Thumb swiping for the mobile example (hidden navigation buttons) does not work. This does work for cozy sized multiinputs, check the css |
Playing with the width/height inputs, the carousel items overflow beyond the boundaries, is that intentional? |
I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you implemented the sliding effect:
When the user navigates from the current item to another item, the current item is moved out of the content area, and the next or previous item slides in (depending on the direction of navigation).
On touch devices, users navigate with swipe gestures (swipe right or swipe left).
also the animation is missing when you change the component in
I agree with @mikerodonnell89 and also it doesn't follow the markup from styles |
the sliding should work on any device including the browser |
@@ -0,0 +1,39 @@ | |||
<fd-carousel [navigatorInPageIndicator]="false" [pageIndicatorContainerPlacement]="'top'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove "'top'"
[] binding here and at other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
}) | ||
export class CarouselComponent implements OnInit, AfterContentInit, OnDestroy { | ||
/** @hidden */ | ||
@ContentChildren(CarouselItemComponent, { descendants: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @ContentChildren
is supposed to come after Input()
and Output()
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
const ICON_PAGE_INDICATOR_LIMIT = 8; | ||
let carouselUniqueId = 0; | ||
|
||
class CarouselActiveItem { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this need to be exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. export added
@@ -0,0 +1,35 @@ | |||
<fd-carousel [showPageIndicator]="false" [pageIndicatorContainerPlacement]="'top'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary binding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
I agree with @droshev, this should be used with some functionality of |
Hey @DeepakSap14 ,
|
carousel service
fix: duplicate code removed
unnecessary changes removed error removed
f75df51
to
d4dcb2a
Compare
|
@InnaAtanasova @droshev This can be reviewed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DeepakSap14 I verified that my comments have been addressed. Thanks for doing this. Also, great job with the component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@droshev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DeepakSap14 Great work! LGTM 🚀
Please provide a link to the associated issue.
#3279
Please provide a brief summary of this pull request.
Introducing carousel component in core.
Please check whether the PR fulfills the following requirements
https://github.com/SAP/fundamental-ngx/blob/master/CONTRIBUTING.md
https://github.com/SAP/fundamental-ngx/wiki/PR-Review-Checklist
Documentation checklist:
README.md
Known issues: