@fundamental-ngx/core 0.34.3-rc.10 → 0.34.3-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-bar/package.json +1 -1
- package/action-sheet/package.json +1 -1
- package/alert/package.json +1 -1
- package/avatar/package.json +1 -1
- package/avatar-group/package.json +1 -1
- package/bar/package.json +1 -1
- package/breadcrumb/package.json +1 -1
- package/busy-indicator/package.json +1 -1
- package/button/package.json +1 -1
- package/calendar/package.json +1 -1
- package/card/package.json +1 -1
- package/carousel/carousel.component.d.ts +20 -3
- package/carousel/esm2020/carousel.component.mjs +90 -26
- package/carousel/fesm2015/fundamental-ngx-core-carousel.mjs +89 -25
- package/carousel/fesm2015/fundamental-ngx-core-carousel.mjs.map +1 -1
- package/carousel/fesm2020/fundamental-ngx-core-carousel.mjs +89 -25
- package/carousel/fesm2020/fundamental-ngx-core-carousel.mjs.map +1 -1
- package/carousel/package.json +1 -1
- package/checkbox/package.json +1 -1
- package/combobox/package.json +1 -1
- package/date-picker/package.json +1 -1
- package/datetime/package.json +1 -1
- package/datetime-picker/package.json +1 -1
- package/dialog/package.json +1 -1
- package/dynamic-page/dynamic-page-content/dynamic-page-content.component.d.ts +8 -5
- package/dynamic-page/dynamic-page.component.d.ts +6 -9
- package/dynamic-page/esm2020/dynamic-page-content/dynamic-page-content.component.mjs +15 -14
- package/dynamic-page/esm2020/dynamic-page.component.mjs +26 -22
- package/dynamic-page/fesm2015/fundamental-ngx-core-dynamic-page.mjs +40 -35
- package/dynamic-page/fesm2015/fundamental-ngx-core-dynamic-page.mjs.map +1 -1
- package/dynamic-page/fesm2020/fundamental-ngx-core-dynamic-page.mjs +39 -33
- package/dynamic-page/fesm2020/fundamental-ngx-core-dynamic-page.mjs.map +1 -1
- package/dynamic-page/package.json +1 -1
- package/dynamic-side-content/package.json +1 -1
- package/esm2020/carousel/carousel.component.mjs +90 -26
- package/esm2020/dynamic-page/dynamic-page-content/dynamic-page-content.component.mjs +15 -14
- package/esm2020/dynamic-page/dynamic-page.component.mjs +26 -22
- package/esm2020/grid-list/helpers/parse-layout-pattern.mjs +2 -2
- package/esm2020/menu/services/menu.service.mjs +8 -6
- package/facets/package.json +1 -1
- package/feed-input/package.json +1 -1
- package/feed-list-item/package.json +1 -1
- package/fesm2015/fundamental-ngx-core-carousel.mjs +89 -25
- package/fesm2015/fundamental-ngx-core-carousel.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-dynamic-page.mjs +40 -35
- package/fesm2015/fundamental-ngx-core-dynamic-page.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-grid-list.mjs +1 -1
- package/fesm2015/fundamental-ngx-core-grid-list.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-menu.mjs +7 -5
- package/fesm2015/fundamental-ngx-core-menu.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-carousel.mjs +89 -25
- package/fesm2020/fundamental-ngx-core-carousel.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-dynamic-page.mjs +39 -33
- package/fesm2020/fundamental-ngx-core-dynamic-page.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-grid-list.mjs +1 -1
- package/fesm2020/fundamental-ngx-core-grid-list.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-menu.mjs +7 -5
- package/fesm2020/fundamental-ngx-core-menu.mjs.map +1 -1
- package/file-uploader/package.json +1 -1
- package/fixed-card-layout/package.json +1 -1
- package/flexible-column-layout/package.json +1 -1
- package/form/package.json +1 -1
- package/formatted-text/package.json +1 -1
- package/grid-list/esm2020/helpers/parse-layout-pattern.mjs +2 -2
- package/grid-list/fesm2015/fundamental-ngx-core-grid-list.mjs +1 -1
- package/grid-list/fesm2015/fundamental-ngx-core-grid-list.mjs.map +1 -1
- package/grid-list/fesm2020/fundamental-ngx-core-grid-list.mjs +1 -1
- package/grid-list/fesm2020/fundamental-ngx-core-grid-list.mjs.map +1 -1
- package/grid-list/package.json +1 -1
- package/icon/package.json +1 -1
- package/illustrated-message/package.json +1 -1
- package/infinite-scroll/package.json +1 -1
- package/info-label/package.json +1 -1
- package/inline-help/package.json +1 -1
- package/input-group/package.json +1 -1
- package/layout-grid/package.json +1 -1
- package/layout-panel/package.json +1 -1
- package/link/package.json +1 -1
- package/list/package.json +1 -1
- package/menu/esm2020/services/menu.service.mjs +8 -6
- package/menu/fesm2015/fundamental-ngx-core-menu.mjs +7 -5
- package/menu/fesm2015/fundamental-ngx-core-menu.mjs.map +1 -1
- package/menu/fesm2020/fundamental-ngx-core-menu.mjs +7 -5
- package/menu/fesm2020/fundamental-ngx-core-menu.mjs.map +1 -1
- package/menu/package.json +1 -1
- package/message-box/package.json +1 -1
- package/message-strip/package.json +1 -1
- package/message-toast/package.json +1 -1
- package/micro-process-flow/package.json +1 -1
- package/mobile-mode/package.json +1 -1
- package/multi-input/package.json +1 -1
- package/nested-list/package.json +1 -1
- package/notification/package.json +1 -1
- package/object-identifier/package.json +1 -1
- package/object-marker/package.json +1 -1
- package/object-number/package.json +1 -1
- package/object-status/package.json +1 -1
- package/package.json +1 -1
- package/pagination/package.json +1 -1
- package/panel/package.json +1 -1
- package/popover/package.json +1 -1
- package/product-switch/package.json +1 -1
- package/progress-indicator/package.json +1 -1
- package/quick-view/package.json +1 -1
- package/radio/package.json +1 -1
- package/rating-indicator/package.json +1 -1
- package/resizable-card-layout/package.json +1 -1
- package/scroll-spy/package.json +1 -1
- package/scrollbar/package.json +1 -1
- package/segmented-button/package.json +1 -1
- package/select/package.json +1 -1
- package/shared/package.json +1 -1
- package/shellbar/package.json +1 -1
- package/side-navigation/package.json +1 -1
- package/slider/package.json +1 -1
- package/split-button/package.json +1 -1
- package/splitter/package.json +1 -1
- package/status-indicator/package.json +1 -1
- package/step-input/package.json +1 -1
- package/switch/package.json +1 -1
- package/table/package.json +1 -1
- package/tabs/package.json +1 -1
- package/text/package.json +1 -1
- package/tile/package.json +1 -1
- package/time/package.json +1 -1
- package/time-picker/package.json +1 -1
- package/timeline/package.json +1 -1
- package/title/package.json +1 -1
- package/token/package.json +1 -1
- package/toolbar/package.json +1 -1
- package/tree/package.json +1 -1
- package/upload-collection/package.json +1 -1
- package/utils/package.json +1 -1
- package/vertical-navigation/package.json +1 -1
- package/wizard/package.json +1 -1
|
@@ -547,7 +547,7 @@ class CarouselComponent {
|
|
|
547
547
|
this._changeDetectorRef = _changeDetectorRef;
|
|
548
548
|
this._carouselService = _carouselService;
|
|
549
549
|
this._rtlService = _rtlService;
|
|
550
|
-
/**
|
|
550
|
+
/** ID for the Carousel. */
|
|
551
551
|
this.id = `fd-carousel-${carouselCounter++}`;
|
|
552
552
|
/** Sets aria-label attribute for carousel */
|
|
553
553
|
this.ariaLabel = null;
|
|
@@ -577,8 +577,6 @@ class CarouselComponent {
|
|
|
577
577
|
this.swipeEnabled = true;
|
|
578
578
|
/** Is carousel is vertical. Default value is false. */
|
|
579
579
|
this.vertical = false;
|
|
580
|
-
/** Number of items to be visible at a time */
|
|
581
|
-
this.visibleSlidesCount = 1;
|
|
582
580
|
/** An event that is emitted after a slide transition has happened */
|
|
583
581
|
this.slideChange = new EventEmitter();
|
|
584
582
|
/**
|
|
@@ -602,6 +600,10 @@ class CarouselComponent {
|
|
|
602
600
|
/** @hidden */
|
|
603
601
|
this._slidesWrapperSize = 0;
|
|
604
602
|
/** @hidden */
|
|
603
|
+
this._visibleSlidesCount = 1;
|
|
604
|
+
/** @hidden */
|
|
605
|
+
this._visibleSlidesNumericCount = 1;
|
|
606
|
+
/** @hidden */
|
|
605
607
|
this._resourceStrings = CarouselResourceStringsEN;
|
|
606
608
|
/** @hidden */
|
|
607
609
|
this._config = {};
|
|
@@ -625,6 +627,14 @@ class CarouselComponent {
|
|
|
625
627
|
get resourceStrings() {
|
|
626
628
|
return this._resourceStrings;
|
|
627
629
|
}
|
|
630
|
+
/** Number of items to be visible at a time */
|
|
631
|
+
set visibleSlidesCount(value) {
|
|
632
|
+
this._visibleSlidesCount = value;
|
|
633
|
+
this._visibleSlidesNumericCount = this._getVisibleSlidesCount();
|
|
634
|
+
}
|
|
635
|
+
get visibleSlidesCount() {
|
|
636
|
+
return this._visibleSlidesCount;
|
|
637
|
+
}
|
|
628
638
|
/**
|
|
629
639
|
* @hidden Returns the `tabIndex` of the carousel component.
|
|
630
640
|
*/
|
|
@@ -669,16 +679,16 @@ class CarouselComponent {
|
|
|
669
679
|
ngAfterViewInit() {
|
|
670
680
|
this._initializeServiceConfig();
|
|
671
681
|
this._carouselService.initialise(this._config, this.slides, this.slideContainer);
|
|
672
|
-
this._previousVisibleSlidesCount = this.
|
|
682
|
+
this._previousVisibleSlidesCount = this._visibleSlidesNumericCount;
|
|
673
683
|
this._resizeContentContainer();
|
|
674
684
|
}
|
|
675
685
|
/** @hidden */
|
|
676
686
|
ngAfterViewChecked() {
|
|
677
|
-
if (this._previousVisibleSlidesCount && this._previousVisibleSlidesCount !== this.
|
|
687
|
+
if (this._previousVisibleSlidesCount && this._previousVisibleSlidesCount !== this._visibleSlidesNumericCount) {
|
|
678
688
|
this._initializeCarousel();
|
|
679
689
|
this._initializeServiceConfig();
|
|
680
690
|
this._carouselService.updateConfig(this._config);
|
|
681
|
-
this._previousVisibleSlidesCount = this.
|
|
691
|
+
this._previousVisibleSlidesCount = this._visibleSlidesNumericCount;
|
|
682
692
|
this._changeDetectorRef.detectChanges();
|
|
683
693
|
}
|
|
684
694
|
}
|
|
@@ -802,8 +812,8 @@ class CarouselComponent {
|
|
|
802
812
|
this.rightButtonDisabled = true;
|
|
803
813
|
this.leftButtonDisabled = false;
|
|
804
814
|
}
|
|
805
|
-
else if (this.
|
|
806
|
-
this.currentActiveSlidesStartIndex + this.
|
|
815
|
+
else if (this._visibleSlidesNumericCount > 1 &&
|
|
816
|
+
this.currentActiveSlidesStartIndex + this._visibleSlidesNumericCount >= this.slides.length) {
|
|
807
817
|
this.rightButtonDisabled = true;
|
|
808
818
|
}
|
|
809
819
|
else {
|
|
@@ -837,19 +847,19 @@ class CarouselComponent {
|
|
|
837
847
|
this._buttonVisibility();
|
|
838
848
|
let arrayLength;
|
|
839
849
|
// set page indicator count with fake array, to use in template
|
|
840
|
-
if (this.loop && this.
|
|
850
|
+
if (this.loop && this._visibleSlidesNumericCount > 1) {
|
|
841
851
|
// If loop with multi item visible.
|
|
842
852
|
arrayLength = this.slides.length;
|
|
843
853
|
}
|
|
844
854
|
else {
|
|
845
|
-
arrayLength = this.slides.length - this.
|
|
855
|
+
arrayLength = this.slides.length - this._visibleSlidesNumericCount + 1;
|
|
846
856
|
}
|
|
847
857
|
const pageIndicatorsIfZeroCount = this.slides.length === 0 ? 0 : 1;
|
|
848
858
|
this.pageIndicatorsCountArray = new Array(arrayLength > 0 ? arrayLength : pageIndicatorsIfZeroCount);
|
|
849
859
|
this._goToFirstItem();
|
|
850
860
|
this.slides.forEach((_slide, index) => {
|
|
851
861
|
if (index >= this.currentActiveSlidesStartIndex &&
|
|
852
|
-
index < this.currentActiveSlidesStartIndex + this.
|
|
862
|
+
index < this.currentActiveSlidesStartIndex + this._visibleSlidesNumericCount) {
|
|
853
863
|
_slide.visibility = 'visible';
|
|
854
864
|
}
|
|
855
865
|
else {
|
|
@@ -869,7 +879,7 @@ class CarouselComponent {
|
|
|
869
879
|
/** @hidden Initialize config for Carousel service */
|
|
870
880
|
_initializeServiceConfig() {
|
|
871
881
|
this._config.vertical = this.vertical;
|
|
872
|
-
this._config.elementsAtOnce = this.
|
|
882
|
+
this._config.elementsAtOnce = this._visibleSlidesNumericCount;
|
|
873
883
|
this._config.gestureSupport = this.swipeEnabled;
|
|
874
884
|
this._config.infinite = this.loop;
|
|
875
885
|
this._config.transition = String(this.slideTransitionDuration) + 'ms';
|
|
@@ -920,7 +930,7 @@ class CarouselComponent {
|
|
|
920
930
|
else {
|
|
921
931
|
firstActiveSlideIndex = this.currentActiveSlidesStartIndex;
|
|
922
932
|
}
|
|
923
|
-
for (let activeSlideIndex = 0; activeSlideIndex < this.
|
|
933
|
+
for (let activeSlideIndex = 0; activeSlideIndex < this._visibleSlidesNumericCount; activeSlideIndex++) {
|
|
924
934
|
const index = firstActiveSlideIndex + activeSlideIndex;
|
|
925
935
|
const slide = this.slides.get(index);
|
|
926
936
|
if (slide) {
|
|
@@ -936,7 +946,7 @@ class CarouselComponent {
|
|
|
936
946
|
_manageSlideVisibility(firstActiveSlideIndex) {
|
|
937
947
|
setTimeout(() => {
|
|
938
948
|
this.slides.forEach((_slides, index) => {
|
|
939
|
-
if (index >= firstActiveSlideIndex && index < firstActiveSlideIndex + this.
|
|
949
|
+
if (index >= firstActiveSlideIndex && index < firstActiveSlideIndex + this._visibleSlidesNumericCount) {
|
|
940
950
|
if (_slides.visibility === 'hidden') {
|
|
941
951
|
_slides.visibility = 'visible';
|
|
942
952
|
}
|
|
@@ -989,7 +999,7 @@ class CarouselComponent {
|
|
|
989
999
|
}
|
|
990
1000
|
}
|
|
991
1001
|
/**
|
|
992
|
-
* @hidden Making slides visible when slides are dragged. Otherwise it looses the effect.
|
|
1002
|
+
* @hidden Making slides visible when slides are dragged. Otherwise, it looses the effect.
|
|
993
1003
|
*/
|
|
994
1004
|
_onSlideDrag(isDragging) {
|
|
995
1005
|
if (isDragging) {
|
|
@@ -1012,11 +1022,52 @@ class CarouselComponent {
|
|
|
1012
1022
|
*/
|
|
1013
1023
|
_resizeContentContainer() {
|
|
1014
1024
|
merge(resizeObservable(this.slideContainer.nativeElement), resizeObservable(this.carouselContainer.nativeElement))
|
|
1015
|
-
.pipe(debounceTime(
|
|
1025
|
+
.pipe(debounceTime(100), takeUntil(this._onDestroy$))
|
|
1016
1026
|
.subscribe(() => {
|
|
1017
|
-
const { width } = this.
|
|
1018
|
-
|
|
1019
|
-
|
|
1027
|
+
const { width, slides } = this._getFittingSlidesAndWidth();
|
|
1028
|
+
if (this.visibleSlidesCount === 'auto') {
|
|
1029
|
+
this._visibleSlidesNumericCount = slides;
|
|
1030
|
+
const totalSlides = this.slides.length;
|
|
1031
|
+
let needleSlideIndex = this.currentActiveSlidesStartIndex;
|
|
1032
|
+
// If amount of slides insufficient to fill whole carousel, slide back a bit.
|
|
1033
|
+
if (this.currentActiveSlidesStartIndex + slides > totalSlides) {
|
|
1034
|
+
needleSlideIndex =
|
|
1035
|
+
this.currentActiveSlidesStartIndex -
|
|
1036
|
+
(this.currentActiveSlidesStartIndex + slides - totalSlides);
|
|
1037
|
+
}
|
|
1038
|
+
const needleSlide = this.slides.get(needleSlideIndex);
|
|
1039
|
+
this.currentActiveSlidesStartIndex = needleSlideIndex;
|
|
1040
|
+
this._carouselService.active = needleSlide;
|
|
1041
|
+
// Refresh carousel config and transition to the current slide.
|
|
1042
|
+
this._initializeCarousel();
|
|
1043
|
+
this._carouselService.goToItem(needleSlide);
|
|
1044
|
+
this._notifySlideChange(SlideDirection.None);
|
|
1045
|
+
}
|
|
1046
|
+
if (this._slidesWrapperSize !== width) {
|
|
1047
|
+
this._slidesWrapperSize = width;
|
|
1048
|
+
}
|
|
1049
|
+
this._changeDetectorRef.detectChanges();
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* @hidden
|
|
1054
|
+
* Calculates how many slides can be shown within current carousel viewport.
|
|
1055
|
+
* @returns Object containing fitting slides count and total width of those slides.
|
|
1056
|
+
*/
|
|
1057
|
+
_getFittingSlidesAndWidth() {
|
|
1058
|
+
if (!this.carouselContainer) {
|
|
1059
|
+
return {
|
|
1060
|
+
width: 0,
|
|
1061
|
+
slides: 1
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
const { width } = this.carouselContainer.nativeElement.getBoundingClientRect();
|
|
1065
|
+
let maxSize = 0;
|
|
1066
|
+
let slidesCount = 0;
|
|
1067
|
+
const carouselSlides = this.slides.toArray();
|
|
1068
|
+
const previousSlides = carouselSlides.splice(0, this.currentActiveSlidesStartIndex);
|
|
1069
|
+
const getSlides = (slides) => {
|
|
1070
|
+
for (const slide of slides) {
|
|
1020
1071
|
const slideWidth = slide.getWidth();
|
|
1021
1072
|
if (!slideWidth) {
|
|
1022
1073
|
break;
|
|
@@ -1026,13 +1077,26 @@ class CarouselComponent {
|
|
|
1026
1077
|
break;
|
|
1027
1078
|
}
|
|
1028
1079
|
maxSize = newSize;
|
|
1080
|
+
slidesCount++;
|
|
1029
1081
|
}
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
}
|
|
1082
|
+
};
|
|
1083
|
+
getSlides(carouselSlides);
|
|
1084
|
+
// If with of the rest of the slides is lesser than carouse's viewport, add previous slides to it.
|
|
1085
|
+
if (maxSize < width) {
|
|
1086
|
+
getSlides(previousSlides);
|
|
1087
|
+
}
|
|
1088
|
+
return {
|
|
1089
|
+
width: maxSize,
|
|
1090
|
+
slides: slidesCount
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
/** @hidden */
|
|
1094
|
+
_getVisibleSlidesCount() {
|
|
1095
|
+
if (this._visibleSlidesCount !== 'auto') {
|
|
1096
|
+
return this._visibleSlidesCount;
|
|
1097
|
+
}
|
|
1098
|
+
const { slides } = this._getFittingSlidesAndWidth();
|
|
1099
|
+
return slides;
|
|
1036
1100
|
}
|
|
1037
1101
|
}
|
|
1038
1102
|
CarouselComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: CarouselComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: CarouselService }, { token: i2.RtlService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|