Skip to content

Commit 45ffd9d

Browse files
authored
Merge branch 'master' into mkirova/fix-6191
2 parents 84c6c68 + d6c950b commit 45ffd9d

File tree

55 files changed

+3300
-785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3300
-785
lines changed

CHANGELOG.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,29 @@ All notable changes for each version of this project will be documented in this
5757
</ng-template>
5858
</igx-grid>
5959
```
60-
- `IgxCarousel`:
61-
- `keyboardSupport` input is added, which can be used to enable and disable keyboard navigation
62-
- `maximumIndicatorsCount` input is added, which can be used to set the number of visible indicators
63-
- `indicatorsOrientation` input is added, which can be used to set the position of indicators it can be top or bottom
64-
- `animationType` input is added, which can be used to set animation when changing slides
65-
- `indicatorTemplate` directive is added, which can be used to provide a custom indicator for carousel. If this property is not provided, a default indicator template will be used instead.
66-
- `nextButtonTemplate` directive is added, which is used to provide a custom next button template. If not provided, a default next button is used.
67-
- `prevButtonTemplate` directive is added, which is used to provide a custom previous button template. If not provided, a default previous button is used.
60+
- `IgxSlider`:
61+
- `primaryTicks` input was added. Which sets the number of primary ticks
62+
- `secondaryTicks` input was added. Which sets the number of secondary ticks.
63+
- `showTicks` input was added. Which show/hide all slider ticks and tick labels.
64+
- `primaryTickLabels` input was added. Which shows/hides all primary tick labels.
65+
- `secondaryTickLabels` input was added. Shows/hides all secondary tick labels.
66+
- `ticksOrientation` input was added. Allows to change ticks orientation to top|bottom|mirror.
67+
- `tickLabelsOrientation` input was added. Allows you to change the rotation of all tick labels from horizontal to vertical(toptobottom, bottomtotop).
68+
- `igxSliderTickLabel` directive has been introduced. Allows you to set a custom template for all tick labels.
69+
70+
- `IgxCarousel`:
71+
- `keyboardSupport` input is added, which can be used to enable and disable keyboard navigation
72+
- `gesturesSupport` input is added, which can be used to enable and disable gestures
73+
- `maximumIndicatorsCount` input is added, which can be used to set the number of visible indicators
74+
- `indicatorsOrientation` input is added, which can be used to set the position of indicators it can be top or bottom
75+
- `animationType` input is added, which can be used to set animation when changing slides
76+
- `indicatorTemplate` directive is added, which can be used to provide a custom indicator for carousel. If this property is not provided, a default indicator template will be used instead.
77+
- `nextButtonTemplate` directive is added, which is used to provide a custom next button template. If not provided, a default next button is used.
78+
- `prevButtonTemplate` directive is added, which is used to provide a custom previous button template. If not provided, a default previous button is used.
79+
80+
- `IgxSelect`:
81+
- adding `IgxSelectHeaderDirective` and `IgxSelectFooterDirective`. These can be used to provide a custom header, respectively footer templates for the `igxSelect` drop-down list. If there are no templates marked with these directives - no default templates will be used so the drop-down list will not have header nor footer.
82+
6883

6984
## 8.2.6
7085

package-lock.json

Lines changed: 134 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@
4545
},
4646
"private": true,
4747
"dependencies": {
48-
"@angular/animations": "^9.0.0-rc.2",
49-
"@angular/common": "^9.0.0-rc.2",
50-
"@angular/compiler": "^9.0.0-rc.2",
51-
"@angular/core": "^9.0.0-rc.2",
52-
"@angular/forms": "^9.0.0-rc.2",
53-
"@angular/platform-browser": "^9.0.0-rc.2",
54-
"@angular/platform-browser-dynamic": "^9.0.0-rc.2",
55-
"@angular/router": "^9.0.0-rc.2",
48+
"@angular/animations": "^9.0.0-rc.3",
49+
"@angular/common": "^9.0.0-rc.3",
50+
"@angular/compiler": "^9.0.0-rc.3",
51+
"@angular/core": "^9.0.0-rc.3",
52+
"@angular/forms": "^9.0.0-rc.3",
53+
"@angular/platform-browser": "^9.0.0-rc.3",
54+
"@angular/platform-browser-dynamic": "^9.0.0-rc.3",
55+
"@angular/router": "^9.0.0-rc.3",
5656
"@types/hammerjs": "^2.0.36",
5757
"@types/source-map": "0.5.2",
5858
"classlist.js": "^1.1.20150312",
@@ -66,12 +66,12 @@
6666
"zone.js": "~0.10.2"
6767
},
6868
"devDependencies": {
69-
"@angular-devkit/build-angular": "~0.900.0-rc.2",
70-
"@angular-devkit/build-ng-packagr": "~0.900.0-rc.2",
69+
"@angular-devkit/build-angular": "~0.900.0-rc.3",
70+
"@angular-devkit/build-ng-packagr": "~0.900.0-rc.3",
7171
"@angular-devkit/schematics": "^7.2.1",
72-
"@angular/cli": "~9.0.0-rc.2",
73-
"@angular/compiler-cli": "^9.0.0-rc.2",
74-
"@angular/language-service": "^9.0.0-rc.2",
72+
"@angular/cli": "~9.0.0-rc.3",
73+
"@angular/compiler-cli": "^9.0.0-rc.3",
74+
"@angular/language-service": "^9.0.0-rc.3",
7575
"@angularclass/hmr": "^2.1.3",
7676
"@types/jasmine": "~3.3.5",
7777
"@types/jasminewd2": "~2.0.6",

projects/igniteui-angular/src/lib/carousel/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ A walkthrough of how to get started can be found [here](https://www.infragistics
1414
| `interval` | number | The amount of time in milliseconds between slides transition. |
1515
| `navigation` | boolean | Controls should the carousel render the left/right navigation buttons. Defaults to `true`. |
1616
| `keyboardSupport` | boolean | Controls should the keyboard navigation should be supported. Defaults to `true`. |
17+
| `gesturesSupport` | boolean | Controls should the gestures should be supported. Defaults to `true`. |
1718
| `maximumIndicatorsCount` | number | The number of visible indicators. Defaults to `5`. |
1819
| `indicatorsOrientation` | CarouselIndicatorsOrientation | Controls whether the indicators should be previewed on top or on bottom of carousel. Defaults to `bottom`. |
1920
| `animationType` | CarouselAnimationType | Controls what animation should be played when slides are changing. Defaults to `slide`. |

projects/igniteui-angular/src/lib/carousel/carousel.component.spec.ts

Lines changed: 142 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ import { Component, ViewChild, TemplateRef } from '@angular/core';
22
import {
33
async,
44
TestBed,
5-
ComponentFixture,
65
fakeAsync,
7-
tick,
8-
flush
6+
tick
97
} from '@angular/core/testing';
108
import { By } from '@angular/platform-browser';
119
import {
@@ -472,46 +470,7 @@ describe('Carousel', () => {
472470
expect(carousel.onCarouselPlaying.emit).toHaveBeenCalledTimes(1);
473471
});
474472

475-
it('should stop/play on tap ', async () => {
476-
carousel.interval = 1000;
477-
carousel.play();
478-
fixture.detectChanges();
479-
480-
spyOn(carousel.onCarouselPaused, 'emit');
481-
spyOn(carousel.onCarouselPlaying, 'emit');
482-
483-
expect(carousel.isPlaying).toBeTruthy();
484-
485-
Simulator.gestures.press(carousel.nativeElement, { duration: 180 });
486-
fixture.detectChanges();
487-
await wait(200);
488-
489-
expect(carousel.isPlaying).toBeFalsy();
490-
491-
Simulator.gestures.press(carousel.nativeElement, { duration: 180 });
492-
fixture.detectChanges();
493-
await wait(200);
494-
495-
expect(carousel.isPlaying).toBeTruthy();
496-
497-
// When the carousel is stopped tap does not start playing
498-
carousel.stop();
499-
fixture.detectChanges();
500-
501-
expect(carousel.isPlaying).toBeFalsy();
502-
503-
Simulator.gestures.press(carousel.nativeElement, { duration: 180 });
504-
fixture.detectChanges();
505-
await wait(200);
506-
507-
expect(carousel.isPlaying).toBeFalsy();
508473

509-
Simulator.gestures.press(carousel.nativeElement, { duration: 180 });
510-
fixture.detectChanges();
511-
await wait(200);
512-
513-
expect(carousel.isPlaying).toBeFalsy();
514-
});
515474
});
516475

517476
describe('Templates Tests: ', () => {
@@ -738,6 +697,125 @@ describe('Carousel', () => {
738697
expect(HelperTestFunctions.getPreviousButton(fixture).hidden).toBeFalsy();
739698
}));
740699
});
700+
701+
describe('Gestures Tests: ', () => {
702+
beforeEach(() => {
703+
fixture = TestBed.createComponent(CarouselDynamicSlidesComponent);
704+
fixture.detectChanges();
705+
carousel = fixture.componentInstance.carousel;
706+
});
707+
708+
it('should stop/play on tap ', async () => {
709+
carousel.interval = 1000;
710+
carousel.play();
711+
fixture.detectChanges();
712+
713+
spyOn(carousel.onCarouselPaused, 'emit');
714+
spyOn(carousel.onCarouselPlaying, 'emit');
715+
716+
expect(carousel.isPlaying).toBeTruthy();
717+
718+
HelperTestFunctions.simulateTap(carousel);
719+
fixture.detectChanges();
720+
await wait(200);
721+
722+
expect(carousel.isPlaying).toBeFalsy();
723+
724+
HelperTestFunctions.simulateTap(carousel);
725+
fixture.detectChanges();
726+
await wait(200);
727+
728+
expect(carousel.isPlaying).toBeTruthy();
729+
730+
// When the carousel is stopped tap does not start playing
731+
carousel.stop();
732+
fixture.detectChanges();
733+
734+
expect(carousel.isPlaying).toBeFalsy();
735+
736+
HelperTestFunctions.simulateTap(carousel);
737+
fixture.detectChanges();
738+
await wait(200);
739+
740+
expect(carousel.isPlaying).toBeFalsy();
741+
742+
HelperTestFunctions.simulateTap(carousel);
743+
fixture.detectChanges();
744+
await wait(200);
745+
746+
expect(carousel.isPlaying).toBeFalsy();
747+
});
748+
749+
it('verify changing slides with pan left ', () => {
750+
expect(carousel.current).toEqual(2);
751+
752+
HelperTestFunctions.simulatePan(fixture, carousel, -0.05, 0.1);
753+
754+
expect(carousel.current).toEqual(2);
755+
756+
HelperTestFunctions.simulatePan(fixture, carousel, -0.7, 0.1);
757+
758+
expect(carousel.current).toEqual(3);
759+
760+
HelperTestFunctions.simulatePan(fixture, carousel, -0.2, 2);
761+
762+
expect(carousel.current).toEqual(0);
763+
});
764+
765+
it('verify changing slides with pan right ', () => {
766+
expect(carousel.current).toEqual(2);
767+
768+
HelperTestFunctions.simulatePan(fixture, carousel, 0.1, 0.1);
769+
770+
expect(carousel.current).toEqual(2);
771+
772+
HelperTestFunctions.simulatePan(fixture, carousel, 0.6, 0.1);
773+
774+
expect(carousel.current).toEqual(1);
775+
776+
HelperTestFunctions.simulatePan(fixture, carousel, 0.05, 2);
777+
778+
expect(carousel.current).toEqual(0);
779+
});
780+
781+
it('verify pan when loop is false', () => {
782+
carousel.loop = false;
783+
fixture.detectChanges();
784+
785+
carousel.select(carousel.get(0));
786+
fixture.detectChanges();
787+
788+
expect(carousel.current).toEqual(0);
789+
790+
HelperTestFunctions.simulatePan(fixture, carousel, 0.9, 2);
791+
792+
expect(carousel.current).toEqual(0);
793+
794+
carousel.select(carousel.get(3));
795+
fixture.detectChanges();
796+
797+
expect(carousel.current).toEqual(3);
798+
799+
HelperTestFunctions.simulatePan(fixture, carousel, -0.9, 2);
800+
801+
expect(carousel.current).toEqual(3);
802+
});
803+
804+
it('verify pan when gesturesSupport is false', () => {
805+
carousel.gesturesSupport = false;
806+
fixture.detectChanges();
807+
808+
expect(carousel.current).toEqual(2);
809+
810+
HelperTestFunctions.simulatePan(fixture, carousel, 0.9, 2);
811+
812+
expect(carousel.current).toEqual(2);
813+
814+
HelperTestFunctions.simulatePan(fixture, carousel, -0.6, 2);
815+
816+
expect(carousel.current).toEqual(2);
817+
});
818+
});
741819
});
742820

743821
class HelperTestFunctions {
@@ -803,7 +881,29 @@ class HelperTestFunctions {
803881
expect(carousel.slides.find((slide) => slide.active && slide.index !== index)).toBeUndefined();
804882
}
805883

884+
public static simulateTap(carousel) {
885+
const activeSlide = carousel.get(carousel.current).nativeElement;
886+
Simulator.gestures.press(activeSlide, { duration: 180 });
887+
}
806888

889+
public static simulatePan(fixture, carousel, deltaXOffset, velocity) {
890+
const activeSlide = carousel.get(carousel.current).nativeElement;
891+
const carouselElement = fixture.debugElement.query(By.css('igx-carousel'));
892+
const deltaX = activeSlide.offsetWidth * deltaXOffset;
893+
const event = deltaXOffset < 0 ? 'panleft' : 'panright';
894+
const panOptions = {
895+
deltaX: deltaX,
896+
deltaY: 0,
897+
duration: 100,
898+
velocity: velocity,
899+
preventDefault: <any>( ( e: any ) => { })
900+
};
901+
902+
carouselElement.triggerEventHandler(event, panOptions);
903+
fixture.detectChanges();
904+
carouselElement.triggerEventHandler('panend', panOptions);
905+
fixture.detectChanges();
906+
}
807907
}
808908
@Component({
809909
template: `

0 commit comments

Comments
 (0)