@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
|
@@ -549,7 +549,7 @@ class CarouselComponent {
|
|
|
549
549
|
this._changeDetectorRef = _changeDetectorRef;
|
|
550
550
|
this._carouselService = _carouselService;
|
|
551
551
|
this._rtlService = _rtlService;
|
|
552
|
-
/**
|
|
552
|
+
/** ID for the Carousel. */
|
|
553
553
|
this.id = `fd-carousel-${carouselCounter++}`;
|
|
554
554
|
/** Sets aria-label attribute for carousel */
|
|
555
555
|
this.ariaLabel = null;
|
|
@@ -579,8 +579,6 @@ class CarouselComponent {
|
|
|
579
579
|
this.swipeEnabled = true;
|
|
580
580
|
/** Is carousel is vertical. Default value is false. */
|
|
581
581
|
this.vertical = false;
|
|
582
|
-
/** Number of items to be visible at a time */
|
|
583
|
-
this.visibleSlidesCount = 1;
|
|
584
582
|
/** An event that is emitted after a slide transition has happened */
|
|
585
583
|
this.slideChange = new EventEmitter();
|
|
586
584
|
/**
|
|
@@ -604,6 +602,10 @@ class CarouselComponent {
|
|
|
604
602
|
/** @hidden */
|
|
605
603
|
this._slidesWrapperSize = 0;
|
|
606
604
|
/** @hidden */
|
|
605
|
+
this._visibleSlidesCount = 1;
|
|
606
|
+
/** @hidden */
|
|
607
|
+
this._visibleSlidesNumericCount = 1;
|
|
608
|
+
/** @hidden */
|
|
607
609
|
this._resourceStrings = CarouselResourceStringsEN;
|
|
608
610
|
/** @hidden */
|
|
609
611
|
this._config = {};
|
|
@@ -627,6 +629,14 @@ class CarouselComponent {
|
|
|
627
629
|
get resourceStrings() {
|
|
628
630
|
return this._resourceStrings;
|
|
629
631
|
}
|
|
632
|
+
/** Number of items to be visible at a time */
|
|
633
|
+
set visibleSlidesCount(value) {
|
|
634
|
+
this._visibleSlidesCount = value;
|
|
635
|
+
this._visibleSlidesNumericCount = this._getVisibleSlidesCount();
|
|
636
|
+
}
|
|
637
|
+
get visibleSlidesCount() {
|
|
638
|
+
return this._visibleSlidesCount;
|
|
639
|
+
}
|
|
630
640
|
/**
|
|
631
641
|
* @hidden Returns the `tabIndex` of the carousel component.
|
|
632
642
|
*/
|
|
@@ -671,16 +681,16 @@ class CarouselComponent {
|
|
|
671
681
|
ngAfterViewInit() {
|
|
672
682
|
this._initializeServiceConfig();
|
|
673
683
|
this._carouselService.initialise(this._config, this.slides, this.slideContainer);
|
|
674
|
-
this._previousVisibleSlidesCount = this.
|
|
684
|
+
this._previousVisibleSlidesCount = this._visibleSlidesNumericCount;
|
|
675
685
|
this._resizeContentContainer();
|
|
676
686
|
}
|
|
677
687
|
/** @hidden */
|
|
678
688
|
ngAfterViewChecked() {
|
|
679
|
-
if (this._previousVisibleSlidesCount && this._previousVisibleSlidesCount !== this.
|
|
689
|
+
if (this._previousVisibleSlidesCount && this._previousVisibleSlidesCount !== this._visibleSlidesNumericCount) {
|
|
680
690
|
this._initializeCarousel();
|
|
681
691
|
this._initializeServiceConfig();
|
|
682
692
|
this._carouselService.updateConfig(this._config);
|
|
683
|
-
this._previousVisibleSlidesCount = this.
|
|
693
|
+
this._previousVisibleSlidesCount = this._visibleSlidesNumericCount;
|
|
684
694
|
this._changeDetectorRef.detectChanges();
|
|
685
695
|
}
|
|
686
696
|
}
|
|
@@ -805,8 +815,8 @@ class CarouselComponent {
|
|
|
805
815
|
this.rightButtonDisabled = true;
|
|
806
816
|
this.leftButtonDisabled = false;
|
|
807
817
|
}
|
|
808
|
-
else if (this.
|
|
809
|
-
this.currentActiveSlidesStartIndex + this.
|
|
818
|
+
else if (this._visibleSlidesNumericCount > 1 &&
|
|
819
|
+
this.currentActiveSlidesStartIndex + this._visibleSlidesNumericCount >= this.slides.length) {
|
|
810
820
|
this.rightButtonDisabled = true;
|
|
811
821
|
}
|
|
812
822
|
else {
|
|
@@ -841,19 +851,19 @@ class CarouselComponent {
|
|
|
841
851
|
this._buttonVisibility();
|
|
842
852
|
let arrayLength;
|
|
843
853
|
// set page indicator count with fake array, to use in template
|
|
844
|
-
if (this.loop && this.
|
|
854
|
+
if (this.loop && this._visibleSlidesNumericCount > 1) {
|
|
845
855
|
// If loop with multi item visible.
|
|
846
856
|
arrayLength = this.slides.length;
|
|
847
857
|
}
|
|
848
858
|
else {
|
|
849
|
-
arrayLength = this.slides.length - this.
|
|
859
|
+
arrayLength = this.slides.length - this._visibleSlidesNumericCount + 1;
|
|
850
860
|
}
|
|
851
861
|
const pageIndicatorsIfZeroCount = this.slides.length === 0 ? 0 : 1;
|
|
852
862
|
this.pageIndicatorsCountArray = new Array(arrayLength > 0 ? arrayLength : pageIndicatorsIfZeroCount);
|
|
853
863
|
this._goToFirstItem();
|
|
854
864
|
this.slides.forEach((_slide, index) => {
|
|
855
865
|
if (index >= this.currentActiveSlidesStartIndex &&
|
|
856
|
-
index < this.currentActiveSlidesStartIndex + this.
|
|
866
|
+
index < this.currentActiveSlidesStartIndex + this._visibleSlidesNumericCount) {
|
|
857
867
|
_slide.visibility = 'visible';
|
|
858
868
|
}
|
|
859
869
|
else {
|
|
@@ -873,7 +883,7 @@ class CarouselComponent {
|
|
|
873
883
|
/** @hidden Initialize config for Carousel service */
|
|
874
884
|
_initializeServiceConfig() {
|
|
875
885
|
this._config.vertical = this.vertical;
|
|
876
|
-
this._config.elementsAtOnce = this.
|
|
886
|
+
this._config.elementsAtOnce = this._visibleSlidesNumericCount;
|
|
877
887
|
this._config.gestureSupport = this.swipeEnabled;
|
|
878
888
|
this._config.infinite = this.loop;
|
|
879
889
|
this._config.transition = String(this.slideTransitionDuration) + 'ms';
|
|
@@ -924,7 +934,7 @@ class CarouselComponent {
|
|
|
924
934
|
else {
|
|
925
935
|
firstActiveSlideIndex = this.currentActiveSlidesStartIndex;
|
|
926
936
|
}
|
|
927
|
-
for (let activeSlideIndex = 0; activeSlideIndex < this.
|
|
937
|
+
for (let activeSlideIndex = 0; activeSlideIndex < this._visibleSlidesNumericCount; activeSlideIndex++) {
|
|
928
938
|
const index = firstActiveSlideIndex + activeSlideIndex;
|
|
929
939
|
const slide = this.slides.get(index);
|
|
930
940
|
if (slide) {
|
|
@@ -940,7 +950,7 @@ class CarouselComponent {
|
|
|
940
950
|
_manageSlideVisibility(firstActiveSlideIndex) {
|
|
941
951
|
setTimeout(() => {
|
|
942
952
|
this.slides.forEach((_slides, index) => {
|
|
943
|
-
if (index >= firstActiveSlideIndex && index < firstActiveSlideIndex + this.
|
|
953
|
+
if (index >= firstActiveSlideIndex && index < firstActiveSlideIndex + this._visibleSlidesNumericCount) {
|
|
944
954
|
if (_slides.visibility === 'hidden') {
|
|
945
955
|
_slides.visibility = 'visible';
|
|
946
956
|
}
|
|
@@ -994,7 +1004,7 @@ class CarouselComponent {
|
|
|
994
1004
|
}
|
|
995
1005
|
}
|
|
996
1006
|
/**
|
|
997
|
-
* @hidden Making slides visible when slides are dragged. Otherwise it looses the effect.
|
|
1007
|
+
* @hidden Making slides visible when slides are dragged. Otherwise, it looses the effect.
|
|
998
1008
|
*/
|
|
999
1009
|
_onSlideDrag(isDragging) {
|
|
1000
1010
|
if (isDragging) {
|
|
@@ -1017,11 +1027,52 @@ class CarouselComponent {
|
|
|
1017
1027
|
*/
|
|
1018
1028
|
_resizeContentContainer() {
|
|
1019
1029
|
merge(resizeObservable(this.slideContainer.nativeElement), resizeObservable(this.carouselContainer.nativeElement))
|
|
1020
|
-
.pipe(debounceTime(
|
|
1030
|
+
.pipe(debounceTime(100), takeUntil(this._onDestroy$))
|
|
1021
1031
|
.subscribe(() => {
|
|
1022
|
-
const { width } = this.
|
|
1023
|
-
|
|
1024
|
-
|
|
1032
|
+
const { width, slides } = this._getFittingSlidesAndWidth();
|
|
1033
|
+
if (this.visibleSlidesCount === 'auto') {
|
|
1034
|
+
this._visibleSlidesNumericCount = slides;
|
|
1035
|
+
const totalSlides = this.slides.length;
|
|
1036
|
+
let needleSlideIndex = this.currentActiveSlidesStartIndex;
|
|
1037
|
+
// If amount of slides insufficient to fill whole carousel, slide back a bit.
|
|
1038
|
+
if (this.currentActiveSlidesStartIndex + slides > totalSlides) {
|
|
1039
|
+
needleSlideIndex =
|
|
1040
|
+
this.currentActiveSlidesStartIndex -
|
|
1041
|
+
(this.currentActiveSlidesStartIndex + slides - totalSlides);
|
|
1042
|
+
}
|
|
1043
|
+
const needleSlide = this.slides.get(needleSlideIndex);
|
|
1044
|
+
this.currentActiveSlidesStartIndex = needleSlideIndex;
|
|
1045
|
+
this._carouselService.active = needleSlide;
|
|
1046
|
+
// Refresh carousel config and transition to the current slide.
|
|
1047
|
+
this._initializeCarousel();
|
|
1048
|
+
this._carouselService.goToItem(needleSlide);
|
|
1049
|
+
this._notifySlideChange(SlideDirection.None);
|
|
1050
|
+
}
|
|
1051
|
+
if (this._slidesWrapperSize !== width) {
|
|
1052
|
+
this._slidesWrapperSize = width;
|
|
1053
|
+
}
|
|
1054
|
+
this._changeDetectorRef.detectChanges();
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* @hidden
|
|
1059
|
+
* Calculates how many slides can be shown within current carousel viewport.
|
|
1060
|
+
* @returns Object containing fitting slides count and total width of those slides.
|
|
1061
|
+
*/
|
|
1062
|
+
_getFittingSlidesAndWidth() {
|
|
1063
|
+
if (!this.carouselContainer) {
|
|
1064
|
+
return {
|
|
1065
|
+
width: 0,
|
|
1066
|
+
slides: 1
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1069
|
+
const { width } = this.carouselContainer.nativeElement.getBoundingClientRect();
|
|
1070
|
+
let maxSize = 0;
|
|
1071
|
+
let slidesCount = 0;
|
|
1072
|
+
const carouselSlides = this.slides.toArray();
|
|
1073
|
+
const previousSlides = carouselSlides.splice(0, this.currentActiveSlidesStartIndex);
|
|
1074
|
+
const getSlides = (slides) => {
|
|
1075
|
+
for (const slide of slides) {
|
|
1025
1076
|
const slideWidth = slide.getWidth();
|
|
1026
1077
|
if (!slideWidth) {
|
|
1027
1078
|
break;
|
|
@@ -1031,13 +1082,26 @@ class CarouselComponent {
|
|
|
1031
1082
|
break;
|
|
1032
1083
|
}
|
|
1033
1084
|
maxSize = newSize;
|
|
1085
|
+
slidesCount++;
|
|
1034
1086
|
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
}
|
|
1087
|
+
};
|
|
1088
|
+
getSlides(carouselSlides);
|
|
1089
|
+
// If with of the rest of the slides is lesser than carouse's viewport, add previous slides to it.
|
|
1090
|
+
if (maxSize < width) {
|
|
1091
|
+
getSlides(previousSlides);
|
|
1092
|
+
}
|
|
1093
|
+
return {
|
|
1094
|
+
width: maxSize,
|
|
1095
|
+
slides: slidesCount
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
/** @hidden */
|
|
1099
|
+
_getVisibleSlidesCount() {
|
|
1100
|
+
if (this._visibleSlidesCount !== 'auto') {
|
|
1101
|
+
return this._visibleSlidesCount;
|
|
1102
|
+
}
|
|
1103
|
+
const { slides } = this._getFittingSlidesAndWidth();
|
|
1104
|
+
return slides;
|
|
1041
1105
|
}
|
|
1042
1106
|
}
|
|
1043
1107
|
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 });
|