@educarehq/solaris-components 0.6.0 → 0.6.2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, Renderer2, Directive, TemplateRef, Injectable, ViewContainerRef, DestroyRef, Input, ContentChild, ViewEncapsulation, Component, EventEmitter, Output, HostBinding, ChangeDetectionStrategy, ViewChildren, ContentChildren, ApplicationRef, signal, computed, effect, HostListener, Optional, EnvironmentInjector, createComponent, input, booleanAttribute, InjectionToken, makeEnvironmentProviders, PLATFORM_ID,
|
|
2
|
+
import { inject, ElementRef, Renderer2, Directive, TemplateRef, Injectable, ViewContainerRef, DestroyRef, Input, ContentChild, ViewEncapsulation, Component, EventEmitter, Output, HostBinding, ChangeDetectionStrategy, ViewChildren, ContentChildren, ApplicationRef, signal, computed, effect, HostListener, Optional, EnvironmentInjector, createComponent, input, booleanAttribute, InjectionToken, makeEnvironmentProviders, PLATFORM_ID, contentChild, model, numberAttribute, output, afterNextRender, Injector, ViewChild, forwardRef, Host } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { Overlay } from '@angular/cdk/overlay';
|
|
5
5
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
@@ -2823,41 +2823,110 @@ function buildSpokes(count, minOpacity = 0.12) {
|
|
|
2823
2823
|
return res;
|
|
2824
2824
|
}
|
|
2825
2825
|
|
|
2826
|
-
class
|
|
2827
|
-
|
|
2828
|
-
|
|
2826
|
+
class SolarisCarouselOverlayDirective {
|
|
2827
|
+
templateRef = inject(TemplateRef);
|
|
2828
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCarouselOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2829
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCarouselOverlayDirective, isStandalone: true, selector: "ng-template[solaris-carousel-overlay]", ngImport: i0 });
|
|
2830
|
+
}
|
|
2831
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCarouselOverlayDirective, decorators: [{
|
|
2832
|
+
type: Directive,
|
|
2833
|
+
args: [{
|
|
2834
|
+
selector: 'ng-template[solaris-carousel-overlay]',
|
|
2835
|
+
standalone: true,
|
|
2836
|
+
}]
|
|
2837
|
+
}] });
|
|
2838
|
+
|
|
2839
|
+
class SolarisCarouselSlideDirective {
|
|
2840
|
+
templateRef = inject(TemplateRef);
|
|
2841
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCarouselSlideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2842
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCarouselSlideDirective, isStandalone: true, selector: "ng-template[solaris-carousel-slide]", ngImport: i0 });
|
|
2843
|
+
}
|
|
2844
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCarouselSlideDirective, decorators: [{
|
|
2845
|
+
type: Directive,
|
|
2846
|
+
args: [{
|
|
2847
|
+
selector: 'ng-template[solaris-carousel-slide]',
|
|
2848
|
+
standalone: true,
|
|
2849
|
+
}]
|
|
2850
|
+
}] });
|
|
2851
|
+
|
|
2852
|
+
class SolarisCarousel {
|
|
2829
2853
|
destroyRef = inject(DestroyRef);
|
|
2854
|
+
timer = null;
|
|
2855
|
+
projectedSlide = contentChild(SolarisCarouselSlideDirective, ...(ngDevMode ? [{ debugName: "projectedSlide" }] : []));
|
|
2856
|
+
projectedOverlay = contentChild(SolarisCarouselOverlayDirective, ...(ngDevMode ? [{ debugName: "projectedOverlay" }] : []));
|
|
2857
|
+
activeIndex = model(0, ...(ngDevMode ? [{ debugName: "activeIndex" }] : []));
|
|
2830
2858
|
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
2831
2859
|
radius = input('lg', ...(ngDevMode ? [{ debugName: "radius" }] : []));
|
|
2832
|
-
autoplay = input(true, { ...(ngDevMode ? { debugName: "autoplay" } : {}), transform: booleanAttribute });
|
|
2833
|
-
showDots = input(true, { ...(ngDevMode ? { debugName: "showDots" } : {}), transform: booleanAttribute });
|
|
2834
|
-
intervalMs = input(4500, { ...(ngDevMode ? { debugName: "intervalMs" } : {}), transform: numberAttribute });
|
|
2835
|
-
showArrows = input(true, { ...(ngDevMode ? { debugName: "showArrows" } : {}), transform: booleanAttribute });
|
|
2836
2860
|
aspect = input('16/9', ...(ngDevMode ? [{ debugName: "aspect" }] : []));
|
|
2861
|
+
appearance = input('plain', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
2862
|
+
controlsPosition = input('inside', ...(ngDevMode ? [{ debugName: "controlsPosition" }] : []));
|
|
2863
|
+
loop = input(true, { ...(ngDevMode ? { debugName: "loop" } : {}), transform: booleanAttribute });
|
|
2864
|
+
autoplay = input(false, { ...(ngDevMode ? { debugName: "autoplay" } : {}), transform: booleanAttribute });
|
|
2865
|
+
intervalMs = input(4500, { ...(ngDevMode ? { debugName: "intervalMs" } : {}), transform: numberAttribute });
|
|
2866
|
+
transitionMs = input(520, { ...(ngDevMode ? { debugName: "transitionMs" } : {}), transform: numberAttribute });
|
|
2837
2867
|
pauseOnHover = input(true, { ...(ngDevMode ? { debugName: "pauseOnHover" } : {}), transform: booleanAttribute });
|
|
2868
|
+
pauseOnFocus = input(true, { ...(ngDevMode ? { debugName: "pauseOnFocus" } : {}), transform: booleanAttribute });
|
|
2869
|
+
resetAutoplayOnInteraction = input(true, { ...(ngDevMode ? { debugName: "resetAutoplayOnInteraction" } : {}), transform: booleanAttribute });
|
|
2870
|
+
showDots = input(true, { ...(ngDevMode ? { debugName: "showDots" } : {}), transform: booleanAttribute });
|
|
2871
|
+
showArrows = input(true, { ...(ngDevMode ? { debugName: "showArrows" } : {}), transform: booleanAttribute });
|
|
2872
|
+
keyboard = input(true, { ...(ngDevMode ? { debugName: "keyboard" } : {}), transform: booleanAttribute });
|
|
2873
|
+
ariaLabel = input('Carousel', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
2874
|
+
ariaLabelKey = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabelKey" }] : []));
|
|
2875
|
+
previousLabel = input('Previous slide', ...(ngDevMode ? [{ debugName: "previousLabel" }] : []));
|
|
2876
|
+
previousLabelKey = input(undefined, ...(ngDevMode ? [{ debugName: "previousLabelKey" }] : []));
|
|
2877
|
+
nextLabel = input('Next slide', ...(ngDevMode ? [{ debugName: "nextLabel" }] : []));
|
|
2878
|
+
nextLabelKey = input(undefined, ...(ngDevMode ? [{ debugName: "nextLabelKey" }] : []));
|
|
2879
|
+
navigationLabel = input('Slide navigation', ...(ngDevMode ? [{ debugName: "navigationLabel" }] : []));
|
|
2880
|
+
navigationLabelKey = input(undefined, ...(ngDevMode ? [{ debugName: "navigationLabelKey" }] : []));
|
|
2881
|
+
goToSlideLabel = input('Go to slide', ...(ngDevMode ? [{ debugName: "goToSlideLabel" }] : []));
|
|
2882
|
+
goToSlideLabelKey = input(undefined, ...(ngDevMode ? [{ debugName: "goToSlideLabelKey" }] : []));
|
|
2883
|
+
openLabel = input('Open', ...(ngDevMode ? [{ debugName: "openLabel" }] : []));
|
|
2884
|
+
openLabelKey = input(undefined, ...(ngDevMode ? [{ debugName: "openLabelKey" }] : []));
|
|
2885
|
+
textResolver = input(null, ...(ngDevMode ? [{ debugName: "textResolver" }] : []));
|
|
2886
|
+
slideTpl = input(undefined, ...(ngDevMode ? [{ debugName: "slideTpl" }] : []));
|
|
2838
2887
|
overlayTpl = input(undefined, ...(ngDevMode ? [{ debugName: "overlayTpl" }] : []));
|
|
2839
|
-
|
|
2840
|
-
|
|
2888
|
+
slideComponent = input(undefined, ...(ngDevMode ? [{ debugName: "slideComponent" }] : []));
|
|
2889
|
+
overlayComponent = input(undefined, ...(ngDevMode ? [{ debugName: "overlayComponent" }] : []));
|
|
2890
|
+
slideChange = output();
|
|
2841
2891
|
viewReady = signal(false, ...(ngDevMode ? [{ debugName: "viewReady" }] : []));
|
|
2892
|
+
paused = signal(false, ...(ngDevMode ? [{ debugName: "paused" }] : []));
|
|
2842
2893
|
count = computed(() => this.items().length, ...(ngDevMode ? [{ debugName: "count" }] : []));
|
|
2843
|
-
|
|
2894
|
+
hasMultiple = computed(() => this.count() > 1, ...(ngDevMode ? [{ debugName: "hasMultiple" }] : []));
|
|
2895
|
+
isFirst = computed(() => this.activeIndex() === 0, ...(ngDevMode ? [{ debugName: "isFirst" }] : []));
|
|
2896
|
+
isLast = computed(() => this.activeIndex() === this.count() - 1, ...(ngDevMode ? [{ debugName: "isLast" }] : []));
|
|
2897
|
+
canGoPrev = computed(() => this.loop() || !this.isFirst(), ...(ngDevMode ? [{ debugName: "canGoPrev" }] : []));
|
|
2898
|
+
canGoNext = computed(() => this.loop() || !this.isLast(), ...(ngDevMode ? [{ debugName: "canGoNext" }] : []));
|
|
2899
|
+
isPlaying = computed(() => {
|
|
2900
|
+
return this.autoplay() && this.hasMultiple() && !this.paused();
|
|
2901
|
+
}, ...(ngDevMode ? [{ debugName: "isPlaying" }] : []));
|
|
2902
|
+
canRunAutoplay = computed(() => {
|
|
2903
|
+
return this.viewReady() && this.autoplay() && this.hasMultiple() && !this.paused();
|
|
2904
|
+
}, ...(ngDevMode ? [{ debugName: "canRunAutoplay" }] : []));
|
|
2905
|
+
resolvedSlideTpl = computed(() => {
|
|
2906
|
+
return this.slideTpl() ?? this.projectedSlide()?.templateRef;
|
|
2907
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedSlideTpl" }] : []));
|
|
2908
|
+
resolvedOverlayTpl = computed(() => {
|
|
2909
|
+
return this.overlayTpl() ?? this.projectedOverlay()?.templateRef;
|
|
2910
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedOverlayTpl" }] : []));
|
|
2844
2911
|
get dataAspect() {
|
|
2845
2912
|
return this.aspect();
|
|
2846
2913
|
}
|
|
2847
2914
|
get dataRadius() {
|
|
2848
2915
|
return this.radius();
|
|
2849
2916
|
}
|
|
2917
|
+
get dataAppearance() {
|
|
2918
|
+
return this.appearance();
|
|
2919
|
+
}
|
|
2920
|
+
get dataControlsPosition() {
|
|
2921
|
+
return this.controlsPosition();
|
|
2922
|
+
}
|
|
2850
2923
|
constructor() {
|
|
2851
2924
|
afterNextRender(() => this.viewReady.set(true));
|
|
2852
2925
|
effect((onCleanup) => {
|
|
2853
|
-
const ready = this.viewReady();
|
|
2854
|
-
const run = this.canRun();
|
|
2855
|
-
const paused = this.paused();
|
|
2856
|
-
const ms = this.intervalMs();
|
|
2857
|
-
const len = this.count();
|
|
2858
2926
|
this.stopTimer();
|
|
2859
|
-
if (!
|
|
2927
|
+
if (!this.canRunAutoplay())
|
|
2860
2928
|
return;
|
|
2929
|
+
const ms = this.intervalMs();
|
|
2861
2930
|
if (!Number.isFinite(ms) || ms <= 0)
|
|
2862
2931
|
return;
|
|
2863
2932
|
this.startTimer(ms);
|
|
@@ -2867,67 +2936,184 @@ class SolarisImageSliderComponent {
|
|
|
2867
2936
|
const len = this.count();
|
|
2868
2937
|
const idx = this.activeIndex();
|
|
2869
2938
|
if (!len) {
|
|
2870
|
-
|
|
2939
|
+
if (idx !== 0)
|
|
2940
|
+
this.activeIndex.set(0);
|
|
2871
2941
|
return;
|
|
2872
2942
|
}
|
|
2873
|
-
if (idx > len - 1)
|
|
2943
|
+
if (idx > len - 1) {
|
|
2944
|
+
this.activeIndex.set(len - 1);
|
|
2945
|
+
}
|
|
2946
|
+
if (idx < 0) {
|
|
2874
2947
|
this.activeIndex.set(0);
|
|
2948
|
+
}
|
|
2875
2949
|
});
|
|
2876
2950
|
this.destroyRef.onDestroy(() => this.stopTimer());
|
|
2877
2951
|
}
|
|
2878
|
-
goTo = (
|
|
2879
|
-
const
|
|
2880
|
-
if (!
|
|
2952
|
+
goTo = (index, source = 'api') => {
|
|
2953
|
+
const length = this.count();
|
|
2954
|
+
if (!length)
|
|
2955
|
+
return;
|
|
2956
|
+
const previousIndex = this.activeIndex();
|
|
2957
|
+
const nextIndex = this.normalizeIndex(index, length);
|
|
2958
|
+
if (nextIndex === previousIndex)
|
|
2959
|
+
return;
|
|
2960
|
+
this.activeIndex.set(nextIndex);
|
|
2961
|
+
this.slideChange.emit({
|
|
2962
|
+
index: nextIndex,
|
|
2963
|
+
previousIndex,
|
|
2964
|
+
item: this.items()[nextIndex],
|
|
2965
|
+
source,
|
|
2966
|
+
});
|
|
2967
|
+
if (source !== 'autoplay' && this.resetAutoplayOnInteraction()) {
|
|
2968
|
+
this.restartAutoplay();
|
|
2969
|
+
}
|
|
2970
|
+
};
|
|
2971
|
+
normalizeIndex(index, length) {
|
|
2972
|
+
if (this.loop()) {
|
|
2973
|
+
return ((index % length) + length) % length;
|
|
2974
|
+
}
|
|
2975
|
+
return Math.max(0, Math.min(index, length - 1));
|
|
2976
|
+
}
|
|
2977
|
+
next = (source = 'api') => {
|
|
2978
|
+
if (!this.canGoNext())
|
|
2881
2979
|
return;
|
|
2882
|
-
|
|
2883
|
-
this.activeIndex.set(next);
|
|
2884
|
-
this.bumpAutoplay();
|
|
2980
|
+
this.goTo(this.activeIndex() + 1, source);
|
|
2885
2981
|
};
|
|
2886
|
-
|
|
2887
|
-
|
|
2982
|
+
prev = (source = 'api') => {
|
|
2983
|
+
if (!this.canGoPrev())
|
|
2984
|
+
return;
|
|
2985
|
+
this.goTo(this.activeIndex() - 1, source);
|
|
2986
|
+
};
|
|
2987
|
+
pause = () => {
|
|
2988
|
+
this.paused.set(true);
|
|
2888
2989
|
};
|
|
2889
|
-
|
|
2890
|
-
this.
|
|
2990
|
+
resume = () => {
|
|
2991
|
+
this.paused.set(false);
|
|
2891
2992
|
};
|
|
2892
2993
|
onMouseEnter() {
|
|
2893
2994
|
if (!this.pauseOnHover())
|
|
2894
2995
|
return;
|
|
2895
|
-
this.
|
|
2996
|
+
this.pause();
|
|
2896
2997
|
}
|
|
2897
2998
|
onMouseLeave() {
|
|
2898
2999
|
if (!this.pauseOnHover())
|
|
2899
3000
|
return;
|
|
2900
|
-
this.
|
|
3001
|
+
this.resume();
|
|
2901
3002
|
}
|
|
2902
3003
|
onFocusIn() {
|
|
2903
|
-
this.
|
|
3004
|
+
if (!this.pauseOnFocus())
|
|
3005
|
+
return;
|
|
3006
|
+
this.pause();
|
|
2904
3007
|
}
|
|
2905
3008
|
onFocusOut() {
|
|
2906
|
-
if (!this.
|
|
3009
|
+
if (!this.pauseOnFocus())
|
|
2907
3010
|
return;
|
|
2908
|
-
this.
|
|
3011
|
+
this.resume();
|
|
2909
3012
|
}
|
|
2910
|
-
|
|
2911
|
-
const item = this.items()[
|
|
3013
|
+
carouselContext(index) {
|
|
3014
|
+
const item = this.items()[index];
|
|
2912
3015
|
return {
|
|
2913
3016
|
$implicit: item,
|
|
2914
|
-
|
|
2915
|
-
|
|
3017
|
+
item,
|
|
3018
|
+
index,
|
|
3019
|
+
active: index === this.activeIndex(),
|
|
3020
|
+
first: index === 0,
|
|
3021
|
+
last: index === this.count() - 1,
|
|
3022
|
+
count: this.count(),
|
|
3023
|
+
isPlaying: this.isPlaying(),
|
|
2916
3024
|
goTo: this.goTo,
|
|
2917
3025
|
next: this.next,
|
|
2918
3026
|
prev: this.prev,
|
|
3027
|
+
pause: this.pause,
|
|
3028
|
+
resume: this.resume,
|
|
3029
|
+
};
|
|
3030
|
+
}
|
|
3031
|
+
slideComponentInputs(index) {
|
|
3032
|
+
const context = this.carouselContext(index);
|
|
3033
|
+
const itemInputs = context.item.slideInputs ?? {};
|
|
3034
|
+
return {
|
|
3035
|
+
item: context.item,
|
|
3036
|
+
index: context.index,
|
|
3037
|
+
active: context.active,
|
|
3038
|
+
first: context.first,
|
|
3039
|
+
last: context.last,
|
|
3040
|
+
count: context.count,
|
|
3041
|
+
isPlaying: context.isPlaying,
|
|
3042
|
+
goTo: context.goTo,
|
|
3043
|
+
next: context.next,
|
|
3044
|
+
prev: context.prev,
|
|
3045
|
+
pause: context.pause,
|
|
3046
|
+
resume: context.resume,
|
|
3047
|
+
...itemInputs,
|
|
2919
3048
|
};
|
|
2920
3049
|
}
|
|
3050
|
+
overlayComponentInputs(index) {
|
|
3051
|
+
const context = this.carouselContext(index);
|
|
3052
|
+
const itemInputs = context.item.overlayInputs ?? {};
|
|
3053
|
+
return {
|
|
3054
|
+
item: context.item,
|
|
3055
|
+
index: context.index,
|
|
3056
|
+
active: context.active,
|
|
3057
|
+
first: context.first,
|
|
3058
|
+
last: context.last,
|
|
3059
|
+
count: context.count,
|
|
3060
|
+
isPlaying: context.isPlaying,
|
|
3061
|
+
goTo: context.goTo,
|
|
3062
|
+
next: context.next,
|
|
3063
|
+
prev: context.prev,
|
|
3064
|
+
pause: context.pause,
|
|
3065
|
+
resume: context.resume,
|
|
3066
|
+
...itemInputs,
|
|
3067
|
+
};
|
|
3068
|
+
}
|
|
3069
|
+
text(text, key) {
|
|
3070
|
+
const directValue = text?.trim();
|
|
3071
|
+
if (directValue)
|
|
3072
|
+
return directValue;
|
|
3073
|
+
const resolver = this.textResolver();
|
|
3074
|
+
if (key && resolver)
|
|
3075
|
+
return resolver(key);
|
|
3076
|
+
return '';
|
|
3077
|
+
}
|
|
3078
|
+
itemAlt(item) {
|
|
3079
|
+
return this.text(item.alt, item.altKey);
|
|
3080
|
+
}
|
|
3081
|
+
itemAriaLabel(item) {
|
|
3082
|
+
return (this.text(item.ariaLabel, item.ariaLabelKey) ||
|
|
3083
|
+
this.text(item.alt, item.altKey) ||
|
|
3084
|
+
this.text(this.openLabel(), this.openLabelKey()) ||
|
|
3085
|
+
null);
|
|
3086
|
+
}
|
|
3087
|
+
rootAriaLabel() {
|
|
3088
|
+
return this.text(this.ariaLabel(), this.ariaLabelKey()) || 'Carousel';
|
|
3089
|
+
}
|
|
3090
|
+
previousAriaLabel() {
|
|
3091
|
+
return this.text(this.previousLabel(), this.previousLabelKey()) || 'Previous slide';
|
|
3092
|
+
}
|
|
3093
|
+
nextAriaLabel() {
|
|
3094
|
+
return this.text(this.nextLabel(), this.nextLabelKey()) || 'Next slide';
|
|
3095
|
+
}
|
|
3096
|
+
navigationAriaLabel() {
|
|
3097
|
+
return this.text(this.navigationLabel(), this.navigationLabelKey()) || 'Slide navigation';
|
|
3098
|
+
}
|
|
3099
|
+
dotAriaLabel(index) {
|
|
3100
|
+
const label = this.text(this.goToSlideLabel(), this.goToSlideLabelKey()) || 'Go to slide';
|
|
3101
|
+
return `${label} ${index + 1}`;
|
|
3102
|
+
}
|
|
3103
|
+
trackByItem(index, item) {
|
|
3104
|
+
return item.id ?? index;
|
|
3105
|
+
}
|
|
2921
3106
|
startTimer(ms) {
|
|
2922
|
-
this.timer = setInterval(() => this.next(), ms);
|
|
3107
|
+
this.timer = setInterval(() => this.next('autoplay'), ms);
|
|
2923
3108
|
}
|
|
2924
3109
|
stopTimer() {
|
|
2925
|
-
if (this.timer)
|
|
3110
|
+
if (this.timer) {
|
|
2926
3111
|
clearInterval(this.timer);
|
|
3112
|
+
}
|
|
2927
3113
|
this.timer = null;
|
|
2928
3114
|
}
|
|
2929
|
-
|
|
2930
|
-
if (!this.
|
|
3115
|
+
restartAutoplay() {
|
|
3116
|
+
if (!this.autoplay() || this.paused() || !this.hasMultiple())
|
|
2931
3117
|
return;
|
|
2932
3118
|
this.stopTimer();
|
|
2933
3119
|
const ms = this.intervalMs();
|
|
@@ -2936,39 +3122,48 @@ class SolarisImageSliderComponent {
|
|
|
2936
3122
|
this.startTimer(ms);
|
|
2937
3123
|
}
|
|
2938
3124
|
onKeyDown(ev) {
|
|
2939
|
-
if (this.
|
|
3125
|
+
if (!this.keyboard() || !this.hasMultiple())
|
|
2940
3126
|
return;
|
|
2941
3127
|
switch (ev.key) {
|
|
2942
3128
|
case 'ArrowLeft':
|
|
2943
3129
|
ev.preventDefault();
|
|
2944
|
-
this.prev();
|
|
3130
|
+
this.prev('keyboard');
|
|
2945
3131
|
break;
|
|
2946
3132
|
case 'ArrowRight':
|
|
2947
3133
|
ev.preventDefault();
|
|
2948
|
-
this.next();
|
|
3134
|
+
this.next('keyboard');
|
|
2949
3135
|
break;
|
|
2950
3136
|
case 'Home':
|
|
2951
3137
|
ev.preventDefault();
|
|
2952
|
-
this.goTo(0);
|
|
3138
|
+
this.goTo(0, 'keyboard');
|
|
2953
3139
|
break;
|
|
2954
3140
|
case 'End':
|
|
2955
3141
|
ev.preventDefault();
|
|
2956
|
-
this.goTo(this.count() - 1);
|
|
3142
|
+
this.goTo(this.count() - 1, 'keyboard');
|
|
2957
3143
|
break;
|
|
2958
3144
|
}
|
|
2959
3145
|
}
|
|
2960
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
2961
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisImageSliderComponent, isStandalone: true, selector: "solaris-image-slider", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, showDots: { classPropertyName: "showDots", publicName: "showDots", isSignal: true, isRequired: false, transformFunction: null }, intervalMs: { classPropertyName: "intervalMs", publicName: "intervalMs", isSignal: true, isRequired: false, transformFunction: null }, showArrows: { classPropertyName: "showArrows", publicName: "showArrows", isSignal: true, isRequired: false, transformFunction: null }, aspect: { classPropertyName: "aspect", publicName: "aspect", isSignal: true, isRequired: false, transformFunction: null }, pauseOnHover: { classPropertyName: "pauseOnHover", publicName: "pauseOnHover", isSignal: true, isRequired: false, transformFunction: null }, overlayTpl: { classPropertyName: "overlayTpl", publicName: "overlayTpl", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "onKeyDown($event)" }, properties: { "attr.data-aspect": "this.dataAspect", "attr.data-radius": "this.dataRadius" } }, viewQueries: [{ propertyName: "viewport", first: true, predicate: ["viewport"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"solaris-slider\" role=\"region\" aria-roledescription=\"carousel\" [attr.aria-label]=\"'Image slider'\"\r\n (mouseenter)=\"onMouseEnter()\" (mouseleave)=\"onMouseLeave()\" (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut()\">\r\n\r\n <div #viewport class=\"solaris-slider__viewport\">\r\n <div class=\"solaris-slider__track\"\r\n [style.transform]=\"'translate3d(' + (-activeIndex() * 100) + '%, 0, 0)'\">\r\n\r\n @for (it of items(); track $index) {\r\n <div class=\"solaris-slider__slide\"\r\n [attr.aria-hidden]=\"$index !== activeIndex() ? 'true' : null\">\r\n\r\n @if (it.href) {\r\n <a class=\"solaris-slider__media\" [href]=\"it.href\" [attr.target]=\"it.target ?? null\"\r\n [attr.aria-label]=\"it.ariaLabel ?? it.alt ?? 'Open'\">\r\n <img class=\"solaris-slider__img\" [src]=\"it.src\" [attr.alt]=\"it.alt ?? ''\" />\r\n </a>\r\n } @else {\r\n <div class=\"solaris-slider__media\">\r\n <img class=\"solaris-slider__img\" [src]=\"it.src\" [attr.alt]=\"it.alt ?? ''\" />\r\n </div>\r\n }\r\n\r\n @if (overlayTpl(); as tpl) {\r\n <div class=\"solaris-slider__overlay\">\r\n <ng-container *ngTemplateOutlet=\"tpl; context: overlayCtx($index)\"></ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (showArrows() && count() > 1) {\r\n <button type=\"button\" class=\"solaris-slider__arrow is-prev\" (click)=\"prev()\" aria-label=\"Previous slide\">\r\n <i class=\"ph ph-caret-left\"></i>\r\n </button>\r\n\r\n <button type=\"button\" class=\"solaris-slider__arrow is-next\" (click)=\"next()\" aria-label=\"Next slide\">\r\n <i class=\"ph ph-caret-right\"></i>\r\n </button>\r\n }\r\n\r\n @if (showDots() && count() > 1) {\r\n <div class=\"solaris-slider__dots\" role=\"tablist\" aria-label=\"Slide navigation\">\r\n @for (it of items(); track $index) {\r\n <button type=\"button\" class=\"solaris-slider__dot\" [class.is-active]=\"$index === activeIndex()\"\r\n (click)=\"goTo($index)\" [attr.aria-label]=\"'Go to slide ' + ($index + 1)\"\r\n [attr.aria-current]=\"$index === activeIndex() ? 'true' : null\">\r\n </button>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block;width:100%;min-width:0}.solaris-slider{width:100%;min-width:0;outline:none;overflow:hidden;position:relative;color:var(--solaris-color-text);border-radius:var(--solaris-radius-lg);background:var(--solaris-color-surface)}:host([data-radius=sm]) .solaris-slider{border-radius:var(--solaris-radius-sm)}:host([data-radius=md]) .solaris-slider{border-radius:var(--solaris-radius-md)}:host([data-radius=lg]) .solaris-slider{border-radius:var(--solaris-radius-lg)}.solaris-slider__viewport{width:100%;position:relative}:host([data-aspect=\"16/9\"]) .solaris-slider__viewport{aspect-ratio:16/9}:host([data-aspect=\"9/16\"]) .solaris-slider__viewport{aspect-ratio:9/16}:host([data-aspect=\"4/3\"]) .solaris-slider__viewport{aspect-ratio:4/3}:host([data-aspect=\"1/1\"]) .solaris-slider__viewport{aspect-ratio:1/1}:host([data-aspect=auto]) .solaris-slider__viewport{aspect-ratio:auto}.solaris-slider__track{height:100%;display:flex;will-change:transform;transition:transform .52s cubic-bezier(.16,1,.3,1)}@media(prefers-reduced-motion:reduce){.solaris-slider__track{transition:none!important}}.solaris-slider__slide{height:100%;flex:0 0 100%;position:relative}.solaris-slider__media{display:block;width:100%;height:100%;position:relative}.solaris-slider__img{width:100%;height:100%;display:block;object-fit:cover}.solaris-slider__overlay{inset:0;display:grid;align-items:end;position:absolute;pointer-events:none;padding:var(--solaris-space-5)}.solaris-slider__overlay :is(a,button,input,textarea,select){pointer-events:auto}.solaris-slider__arrow{top:50%;color:#fff;display:grid;width:4.2rem;opacity:.85;height:4.2rem;cursor:pointer;position:absolute;place-items:center;transform:translateY(-50%);border-radius:var(--solaris-radius-full);background:color-mix(in srgb,#000 28%,transparent);transition:opacity .16s ease,transform .16s ease,filter .16s ease;border:1px solid color-mix(in srgb,var(--solaris-color-border) 60%,transparent)}.solaris-slider__arrow:hover{opacity:1;filter:brightness(1.08)}.solaris-slider__arrow.is-prev{left:var(--solaris-space-3)}.solaris-slider__arrow.is-next{right:var(--solaris-space-3)}.solaris-slider__arrow i.ph{font-size:2rem;line-height:1}.solaris-slider__dots{left:50%;gap:.6rem;position:absolute;align-items:center;display:inline-flex;padding:.6rem .8rem;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);transform:translate(-50%);bottom:var(--solaris-space-3);border-radius:var(--solaris-radius-full);background:color-mix(in srgb,#000 22%,transparent)}.solaris-slider__dot{border:0;opacity:.35;width:.8rem;height:.8rem;cursor:pointer;background:#fff;border-radius:99rem;transition:width .22s cubic-bezier(.16,1,.3,1),opacity .22s ease,transform .22s ease}.solaris-slider__dot.is-active{width:2.6rem;opacity:1}.solaris-slider:focus-visible{box-shadow:0 0 0 .3rem color-mix(in srgb,var(--solaris-color-primary) 18%,transparent)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3146
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCarousel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3147
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisCarousel, isStandalone: true, selector: "solaris-carousel", inputs: { activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, aspect: { classPropertyName: "aspect", publicName: "aspect", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, controlsPosition: { classPropertyName: "controlsPosition", publicName: "controlsPosition", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, intervalMs: { classPropertyName: "intervalMs", publicName: "intervalMs", isSignal: true, isRequired: false, transformFunction: null }, transitionMs: { classPropertyName: "transitionMs", publicName: "transitionMs", isSignal: true, isRequired: false, transformFunction: null }, pauseOnHover: { classPropertyName: "pauseOnHover", publicName: "pauseOnHover", isSignal: true, isRequired: false, transformFunction: null }, pauseOnFocus: { classPropertyName: "pauseOnFocus", publicName: "pauseOnFocus", isSignal: true, isRequired: false, transformFunction: null }, resetAutoplayOnInteraction: { classPropertyName: "resetAutoplayOnInteraction", publicName: "resetAutoplayOnInteraction", isSignal: true, isRequired: false, transformFunction: null }, showDots: { classPropertyName: "showDots", publicName: "showDots", isSignal: true, isRequired: false, transformFunction: null }, showArrows: { classPropertyName: "showArrows", publicName: "showArrows", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelKey: { classPropertyName: "ariaLabelKey", publicName: "ariaLabelKey", isSignal: true, isRequired: false, transformFunction: null }, previousLabel: { classPropertyName: "previousLabel", publicName: "previousLabel", isSignal: true, isRequired: false, transformFunction: null }, previousLabelKey: { classPropertyName: "previousLabelKey", publicName: "previousLabelKey", isSignal: true, isRequired: false, transformFunction: null }, nextLabel: { classPropertyName: "nextLabel", publicName: "nextLabel", isSignal: true, isRequired: false, transformFunction: null }, nextLabelKey: { classPropertyName: "nextLabelKey", publicName: "nextLabelKey", isSignal: true, isRequired: false, transformFunction: null }, navigationLabel: { classPropertyName: "navigationLabel", publicName: "navigationLabel", isSignal: true, isRequired: false, transformFunction: null }, navigationLabelKey: { classPropertyName: "navigationLabelKey", publicName: "navigationLabelKey", isSignal: true, isRequired: false, transformFunction: null }, goToSlideLabel: { classPropertyName: "goToSlideLabel", publicName: "goToSlideLabel", isSignal: true, isRequired: false, transformFunction: null }, goToSlideLabelKey: { classPropertyName: "goToSlideLabelKey", publicName: "goToSlideLabelKey", isSignal: true, isRequired: false, transformFunction: null }, openLabel: { classPropertyName: "openLabel", publicName: "openLabel", isSignal: true, isRequired: false, transformFunction: null }, openLabelKey: { classPropertyName: "openLabelKey", publicName: "openLabelKey", isSignal: true, isRequired: false, transformFunction: null }, textResolver: { classPropertyName: "textResolver", publicName: "textResolver", isSignal: true, isRequired: false, transformFunction: null }, slideTpl: { classPropertyName: "slideTpl", publicName: "slideTpl", isSignal: true, isRequired: false, transformFunction: null }, overlayTpl: { classPropertyName: "overlayTpl", publicName: "overlayTpl", isSignal: true, isRequired: false, transformFunction: null }, slideComponent: { classPropertyName: "slideComponent", publicName: "slideComponent", isSignal: true, isRequired: false, transformFunction: null }, overlayComponent: { classPropertyName: "overlayComponent", publicName: "overlayComponent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeIndex: "activeIndexChange", slideChange: "slideChange" }, host: { listeners: { "keydown": "onKeyDown($event)" }, properties: { "attr.data-aspect": "this.dataAspect", "attr.data-radius": "this.dataRadius", "attr.data-appearance": "this.dataAppearance", "attr.data-controls-position": "this.dataControlsPosition" } }, queries: [{ propertyName: "projectedSlide", first: true, predicate: SolarisCarouselSlideDirective, descendants: true, isSignal: true }, { propertyName: "projectedOverlay", first: true, predicate: SolarisCarouselOverlayDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"solaris-carousel\" role=\"region\" aria-roledescription=\"carousel\" [attr.aria-label]=\"rootAriaLabel()\"\r\n [attr.tabindex]=\"keyboard() ? '0' : null\" (mouseenter)=\"onMouseEnter()\" (mouseleave)=\"onMouseLeave()\"\r\n (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut()\">\r\n\r\n <div class=\"solaris-carousel__viewport\">\r\n <div class=\"solaris-carousel__track\" [style.transition-duration.ms]=\"transitionMs()\"\r\n [style.transform]=\"'translate3d(' + (-activeIndex() * 100) + '%, 0, 0)'\">\r\n\r\n @for (item of items(); track trackByItem($index, item)) {\r\n <div class=\"solaris-carousel__slide\" role=\"group\" aria-roledescription=\"slide\" [attr.aria-label]=\"($index + 1) + ' / ' + count()\"\r\n [attr.aria-hidden]=\"$index !== activeIndex() ? 'true' : null\">\r\n\r\n @if (resolvedSlideTpl(); as tpl) {\r\n <ng-container\r\n *ngTemplateOutlet=\"tpl; context: carouselContext($index)\">\r\n </ng-container>\r\n } @else if (item.slideComponent; as component) {\r\n <ng-container\r\n *ngComponentOutlet=\"component; inputs: slideComponentInputs($index)\">\r\n </ng-container>\r\n } @else if (slideComponent(); as component) {\r\n <ng-container\r\n *ngComponentOutlet=\"component; inputs: slideComponentInputs($index)\">\r\n </ng-container>\r\n } @else {\r\n <ng-container\r\n *ngTemplateOutlet=\"defaultImageSlide; context: carouselContext($index)\">\r\n </ng-container>\r\n }\r\n\r\n @if (resolvedOverlayTpl(); as tpl) {\r\n <div class=\"solaris-carousel__overlay\">\r\n <ng-container\r\n *ngTemplateOutlet=\"tpl; context: carouselContext($index)\">\r\n </ng-container>\r\n </div>\r\n } @else if (item.overlayComponent; as component) {\r\n <div class=\"solaris-carousel__overlay\">\r\n <ng-container\r\n *ngComponentOutlet=\"component; inputs: overlayComponentInputs($index)\">\r\n </ng-container>\r\n </div>\r\n } @else if (overlayComponent(); as component) {\r\n <div class=\"solaris-carousel__overlay\">\r\n <ng-container\r\n *ngComponentOutlet=\"component; inputs: overlayComponentInputs($index)\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (showArrows() && hasMultiple()) {\r\n <button type=\"button\" class=\"solaris-carousel__arrow is-prev\" [disabled]=\"!canGoPrev()\" [attr.aria-label]=\"previousAriaLabel()\"\r\n (click)=\"prev('arrow')\">\r\n <i class=\"ph ph-caret-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n\r\n <button type=\"button\" class=\"solaris-carousel__arrow is-next\" [disabled]=\"!canGoNext()\" [attr.aria-label]=\"nextAriaLabel()\"\r\n (click)=\"next('arrow')\">\r\n <i class=\"ph ph-caret-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n\r\n @if (showDots() && hasMultiple()) {\r\n <div class=\"solaris-carousel__dots\" role=\"tablist\" [attr.aria-label]=\"navigationAriaLabel()\">\r\n @for (item of items(); track trackByItem($index, item)) {\r\n <button type=\"button\" class=\"solaris-carousel__dot\" role=\"tab\" [class.is-active]=\"$index === activeIndex()\"\r\n [attr.aria-label]=\"dotAriaLabel($index)\" [attr.aria-selected]=\"$index === activeIndex() ? 'true' : 'false'\"\r\n [attr.aria-current]=\"$index === activeIndex() ? 'true' : null\" (click)=\"goTo($index, 'dot')\">\r\n </button>\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n<ng-template #defaultImageSlide let-item>\r\n @if (item.src) {\r\n @if (item.href) {\r\n <a class=\"solaris-carousel__media\" [href]=\"item.href\" [attr.target]=\"item.target ?? null\" [attr.aria-label]=\"itemAriaLabel(item)\">\r\n <img class=\"solaris-carousel__img\" [src]=\"item.src\" [attr.srcset]=\"item.srcSet ?? null\" [attr.sizes]=\"item.sizes ?? null\"\r\n [attr.alt]=\"itemAlt(item)\"/>\r\n </a>\r\n } @else {\r\n <div class=\"solaris-carousel__media\">\r\n <img class=\"solaris-carousel__img\" [src]=\"item.src\" [attr.srcset]=\"item.srcSet ?? null\" [attr.sizes]=\"item.sizes ?? null\"\r\n [attr.alt]=\"itemAlt(item)\"/>\r\n </div>\r\n }\r\n } @else {\r\n <div class=\"solaris-carousel__empty\" aria-hidden=\"true\"></div>\r\n }\r\n</ng-template>\r\n", styles: [":host{display:block;width:100%;min-width:0;--solaris-carousel-radius: var(--solaris-radius-lg);--solaris-carousel-bg: var(--solaris-color-surface);--solaris-carousel-color: var(--solaris-color-text);--solaris-carousel-overlay-padding: var(--solaris-space-5);--solaris-carousel-arrow-size: 4.2rem;--solaris-carousel-arrow-bg: color-mix(in srgb, #000 28%, transparent);--solaris-carousel-arrow-color: #fff;--solaris-carousel-dot-size: .8rem;--solaris-carousel-dot-active-width: 2.6rem;--solaris-carousel-dot-bg: #fff;--solaris-carousel-dot-bg-wrapper: color-mix(in srgb, #000 22%, transparent)}.solaris-carousel{width:100%;min-width:0;outline:none;overflow:hidden;position:relative;color:var(--solaris-carousel-color);border-radius:var(--solaris-carousel-radius);background:var(--solaris-carousel-bg)}:host([data-radius=none]){--solaris-carousel-radius: 0}:host([data-radius=sm]){--solaris-carousel-radius: var(--solaris-radius-sm)}:host([data-radius=md]){--solaris-carousel-radius: var(--solaris-radius-md)}:host([data-radius=lg]){--solaris-carousel-radius: var(--solaris-radius-lg)}:host([data-radius=xl]){--solaris-carousel-radius: var(--solaris-radius-xl, var(--solaris-radius-lg))}:host([data-radius=full]){--solaris-carousel-radius: var(--solaris-radius-full)}:host([data-appearance=surface]) .solaris-carousel{border:1px solid var(--solaris-color-border)}:host([data-appearance=elevated]) .solaris-carousel{box-shadow:var(--solaris-shadow-md, 0 1.2rem 3rem rgba(0, 0, 0, .12))}:host([data-appearance=hero]) .solaris-carousel{background:#000}.solaris-carousel:focus-visible{box-shadow:0 0 0 .3rem color-mix(in srgb,var(--solaris-color-primary) 18%,transparent)}.solaris-carousel__viewport{width:100%;position:relative}:host([data-aspect=\"16/9\"]) .solaris-carousel__viewport{aspect-ratio:16/9}:host([data-aspect=\"9/16\"]) .solaris-carousel__viewport{aspect-ratio:9/16}:host([data-aspect=\"4/3\"]) .solaris-carousel__viewport{aspect-ratio:4/3}:host([data-aspect=\"1/1\"]) .solaris-carousel__viewport{aspect-ratio:1/1}:host([data-aspect=auto]) .solaris-carousel__viewport{aspect-ratio:auto}.solaris-carousel__track{height:100%;display:flex;will-change:transform;transition-property:transform;transition-timing-function:cubic-bezier(.16,1,.3,1)}@media(prefers-reduced-motion:reduce){.solaris-carousel__track{transition:none!important}}.solaris-carousel__slide{height:100%;min-width:0;flex:0 0 100%;position:relative}.solaris-carousel__media{display:block;width:100%;height:100%;position:relative}.solaris-carousel__img{width:100%;height:100%;display:block;object-fit:cover}.solaris-carousel__empty{width:100%;height:100%;background:linear-gradient(135deg,color-mix(in srgb,var(--solaris-color-surface) 88%,#000),var(--solaris-color-surface))}.solaris-carousel__overlay{inset:0;display:grid;align-items:end;position:absolute;pointer-events:none;padding:var(--solaris-carousel-overlay-padding)}.solaris-carousel__overlay :is(a,button,input,textarea,select,[tabindex]){pointer-events:auto}.solaris-carousel__arrow{top:50%;z-index:2;border:1px solid color-mix(in srgb,var(--solaris-color-border) 60%,transparent);color:var(--solaris-carousel-arrow-color);display:grid;width:var(--solaris-carousel-arrow-size);height:var(--solaris-carousel-arrow-size);opacity:.85;cursor:pointer;position:absolute;place-items:center;transform:translateY(-50%);border-radius:var(--solaris-radius-full);background:var(--solaris-carousel-arrow-bg);transition:opacity .16s ease,transform .16s ease,filter .16s ease}.solaris-carousel__arrow:hover:not(:disabled){opacity:1;filter:brightness(1.08)}.solaris-carousel__arrow:disabled{opacity:.35;cursor:not-allowed}.solaris-carousel__arrow.is-prev{left:var(--solaris-space-3)}.solaris-carousel__arrow.is-next{right:var(--solaris-space-3)}.solaris-carousel__arrow i.ph{font-size:2rem;line-height:1}.solaris-carousel__dots{left:50%;z-index:2;gap:.6rem;position:absolute;align-items:center;display:inline-flex;padding:.6rem .8rem;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);transform:translate(-50%);bottom:var(--solaris-space-3);border-radius:var(--solaris-radius-full);background:var(--solaris-carousel-dot-bg-wrapper)}.solaris-carousel__dot{border:0;opacity:.35;width:var(--solaris-carousel-dot-size);height:var(--solaris-carousel-dot-size);cursor:pointer;background:var(--solaris-carousel-dot-bg);border-radius:99rem;transition:width .22s cubic-bezier(.16,1,.3,1),opacity .22s ease,transform .22s ease}.solaris-carousel__dot.is-active{width:var(--solaris-carousel-dot-active-width);opacity:1}:host([data-controls-position=outside]) .solaris-carousel{overflow:visible}:host([data-controls-position=outside]) .solaris-carousel__dots{bottom:auto;top:calc(100% + var(--solaris-space-3))}:host([data-controls-position=outside]) .solaris-carousel__arrow.is-prev{left:calc(var(--solaris-carousel-arrow-size) * -.5)}:host([data-controls-position=outside]) .solaris-carousel__arrow.is-next{right:calc(var(--solaris-carousel-arrow-size) * -.5)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2962
3148
|
}
|
|
2963
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
3149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCarousel, decorators: [{
|
|
2964
3150
|
type: Component,
|
|
2965
|
-
args: [{ selector: 'solaris-
|
|
2966
|
-
|
|
3151
|
+
args: [{ selector: 'solaris-carousel', standalone: true, imports: [
|
|
3152
|
+
NgTemplateOutlet,
|
|
3153
|
+
NgComponentOutlet
|
|
3154
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-carousel\" role=\"region\" aria-roledescription=\"carousel\" [attr.aria-label]=\"rootAriaLabel()\"\r\n [attr.tabindex]=\"keyboard() ? '0' : null\" (mouseenter)=\"onMouseEnter()\" (mouseleave)=\"onMouseLeave()\"\r\n (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut()\">\r\n\r\n <div class=\"solaris-carousel__viewport\">\r\n <div class=\"solaris-carousel__track\" [style.transition-duration.ms]=\"transitionMs()\"\r\n [style.transform]=\"'translate3d(' + (-activeIndex() * 100) + '%, 0, 0)'\">\r\n\r\n @for (item of items(); track trackByItem($index, item)) {\r\n <div class=\"solaris-carousel__slide\" role=\"group\" aria-roledescription=\"slide\" [attr.aria-label]=\"($index + 1) + ' / ' + count()\"\r\n [attr.aria-hidden]=\"$index !== activeIndex() ? 'true' : null\">\r\n\r\n @if (resolvedSlideTpl(); as tpl) {\r\n <ng-container\r\n *ngTemplateOutlet=\"tpl; context: carouselContext($index)\">\r\n </ng-container>\r\n } @else if (item.slideComponent; as component) {\r\n <ng-container\r\n *ngComponentOutlet=\"component; inputs: slideComponentInputs($index)\">\r\n </ng-container>\r\n } @else if (slideComponent(); as component) {\r\n <ng-container\r\n *ngComponentOutlet=\"component; inputs: slideComponentInputs($index)\">\r\n </ng-container>\r\n } @else {\r\n <ng-container\r\n *ngTemplateOutlet=\"defaultImageSlide; context: carouselContext($index)\">\r\n </ng-container>\r\n }\r\n\r\n @if (resolvedOverlayTpl(); as tpl) {\r\n <div class=\"solaris-carousel__overlay\">\r\n <ng-container\r\n *ngTemplateOutlet=\"tpl; context: carouselContext($index)\">\r\n </ng-container>\r\n </div>\r\n } @else if (item.overlayComponent; as component) {\r\n <div class=\"solaris-carousel__overlay\">\r\n <ng-container\r\n *ngComponentOutlet=\"component; inputs: overlayComponentInputs($index)\">\r\n </ng-container>\r\n </div>\r\n } @else if (overlayComponent(); as component) {\r\n <div class=\"solaris-carousel__overlay\">\r\n <ng-container\r\n *ngComponentOutlet=\"component; inputs: overlayComponentInputs($index)\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (showArrows() && hasMultiple()) {\r\n <button type=\"button\" class=\"solaris-carousel__arrow is-prev\" [disabled]=\"!canGoPrev()\" [attr.aria-label]=\"previousAriaLabel()\"\r\n (click)=\"prev('arrow')\">\r\n <i class=\"ph ph-caret-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n\r\n <button type=\"button\" class=\"solaris-carousel__arrow is-next\" [disabled]=\"!canGoNext()\" [attr.aria-label]=\"nextAriaLabel()\"\r\n (click)=\"next('arrow')\">\r\n <i class=\"ph ph-caret-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n\r\n @if (showDots() && hasMultiple()) {\r\n <div class=\"solaris-carousel__dots\" role=\"tablist\" [attr.aria-label]=\"navigationAriaLabel()\">\r\n @for (item of items(); track trackByItem($index, item)) {\r\n <button type=\"button\" class=\"solaris-carousel__dot\" role=\"tab\" [class.is-active]=\"$index === activeIndex()\"\r\n [attr.aria-label]=\"dotAriaLabel($index)\" [attr.aria-selected]=\"$index === activeIndex() ? 'true' : 'false'\"\r\n [attr.aria-current]=\"$index === activeIndex() ? 'true' : null\" (click)=\"goTo($index, 'dot')\">\r\n </button>\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n<ng-template #defaultImageSlide let-item>\r\n @if (item.src) {\r\n @if (item.href) {\r\n <a class=\"solaris-carousel__media\" [href]=\"item.href\" [attr.target]=\"item.target ?? null\" [attr.aria-label]=\"itemAriaLabel(item)\">\r\n <img class=\"solaris-carousel__img\" [src]=\"item.src\" [attr.srcset]=\"item.srcSet ?? null\" [attr.sizes]=\"item.sizes ?? null\"\r\n [attr.alt]=\"itemAlt(item)\"/>\r\n </a>\r\n } @else {\r\n <div class=\"solaris-carousel__media\">\r\n <img class=\"solaris-carousel__img\" [src]=\"item.src\" [attr.srcset]=\"item.srcSet ?? null\" [attr.sizes]=\"item.sizes ?? null\"\r\n [attr.alt]=\"itemAlt(item)\"/>\r\n </div>\r\n }\r\n } @else {\r\n <div class=\"solaris-carousel__empty\" aria-hidden=\"true\"></div>\r\n }\r\n</ng-template>\r\n", styles: [":host{display:block;width:100%;min-width:0;--solaris-carousel-radius: var(--solaris-radius-lg);--solaris-carousel-bg: var(--solaris-color-surface);--solaris-carousel-color: var(--solaris-color-text);--solaris-carousel-overlay-padding: var(--solaris-space-5);--solaris-carousel-arrow-size: 4.2rem;--solaris-carousel-arrow-bg: color-mix(in srgb, #000 28%, transparent);--solaris-carousel-arrow-color: #fff;--solaris-carousel-dot-size: .8rem;--solaris-carousel-dot-active-width: 2.6rem;--solaris-carousel-dot-bg: #fff;--solaris-carousel-dot-bg-wrapper: color-mix(in srgb, #000 22%, transparent)}.solaris-carousel{width:100%;min-width:0;outline:none;overflow:hidden;position:relative;color:var(--solaris-carousel-color);border-radius:var(--solaris-carousel-radius);background:var(--solaris-carousel-bg)}:host([data-radius=none]){--solaris-carousel-radius: 0}:host([data-radius=sm]){--solaris-carousel-radius: var(--solaris-radius-sm)}:host([data-radius=md]){--solaris-carousel-radius: var(--solaris-radius-md)}:host([data-radius=lg]){--solaris-carousel-radius: var(--solaris-radius-lg)}:host([data-radius=xl]){--solaris-carousel-radius: var(--solaris-radius-xl, var(--solaris-radius-lg))}:host([data-radius=full]){--solaris-carousel-radius: var(--solaris-radius-full)}:host([data-appearance=surface]) .solaris-carousel{border:1px solid var(--solaris-color-border)}:host([data-appearance=elevated]) .solaris-carousel{box-shadow:var(--solaris-shadow-md, 0 1.2rem 3rem rgba(0, 0, 0, .12))}:host([data-appearance=hero]) .solaris-carousel{background:#000}.solaris-carousel:focus-visible{box-shadow:0 0 0 .3rem color-mix(in srgb,var(--solaris-color-primary) 18%,transparent)}.solaris-carousel__viewport{width:100%;position:relative}:host([data-aspect=\"16/9\"]) .solaris-carousel__viewport{aspect-ratio:16/9}:host([data-aspect=\"9/16\"]) .solaris-carousel__viewport{aspect-ratio:9/16}:host([data-aspect=\"4/3\"]) .solaris-carousel__viewport{aspect-ratio:4/3}:host([data-aspect=\"1/1\"]) .solaris-carousel__viewport{aspect-ratio:1/1}:host([data-aspect=auto]) .solaris-carousel__viewport{aspect-ratio:auto}.solaris-carousel__track{height:100%;display:flex;will-change:transform;transition-property:transform;transition-timing-function:cubic-bezier(.16,1,.3,1)}@media(prefers-reduced-motion:reduce){.solaris-carousel__track{transition:none!important}}.solaris-carousel__slide{height:100%;min-width:0;flex:0 0 100%;position:relative}.solaris-carousel__media{display:block;width:100%;height:100%;position:relative}.solaris-carousel__img{width:100%;height:100%;display:block;object-fit:cover}.solaris-carousel__empty{width:100%;height:100%;background:linear-gradient(135deg,color-mix(in srgb,var(--solaris-color-surface) 88%,#000),var(--solaris-color-surface))}.solaris-carousel__overlay{inset:0;display:grid;align-items:end;position:absolute;pointer-events:none;padding:var(--solaris-carousel-overlay-padding)}.solaris-carousel__overlay :is(a,button,input,textarea,select,[tabindex]){pointer-events:auto}.solaris-carousel__arrow{top:50%;z-index:2;border:1px solid color-mix(in srgb,var(--solaris-color-border) 60%,transparent);color:var(--solaris-carousel-arrow-color);display:grid;width:var(--solaris-carousel-arrow-size);height:var(--solaris-carousel-arrow-size);opacity:.85;cursor:pointer;position:absolute;place-items:center;transform:translateY(-50%);border-radius:var(--solaris-radius-full);background:var(--solaris-carousel-arrow-bg);transition:opacity .16s ease,transform .16s ease,filter .16s ease}.solaris-carousel__arrow:hover:not(:disabled){opacity:1;filter:brightness(1.08)}.solaris-carousel__arrow:disabled{opacity:.35;cursor:not-allowed}.solaris-carousel__arrow.is-prev{left:var(--solaris-space-3)}.solaris-carousel__arrow.is-next{right:var(--solaris-space-3)}.solaris-carousel__arrow i.ph{font-size:2rem;line-height:1}.solaris-carousel__dots{left:50%;z-index:2;gap:.6rem;position:absolute;align-items:center;display:inline-flex;padding:.6rem .8rem;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);transform:translate(-50%);bottom:var(--solaris-space-3);border-radius:var(--solaris-radius-full);background:var(--solaris-carousel-dot-bg-wrapper)}.solaris-carousel__dot{border:0;opacity:.35;width:var(--solaris-carousel-dot-size);height:var(--solaris-carousel-dot-size);cursor:pointer;background:var(--solaris-carousel-dot-bg);border-radius:99rem;transition:width .22s cubic-bezier(.16,1,.3,1),opacity .22s ease,transform .22s ease}.solaris-carousel__dot.is-active{width:var(--solaris-carousel-dot-active-width);opacity:1}:host([data-controls-position=outside]) .solaris-carousel{overflow:visible}:host([data-controls-position=outside]) .solaris-carousel__dots{bottom:auto;top:calc(100% + var(--solaris-space-3))}:host([data-controls-position=outside]) .solaris-carousel__arrow.is-prev{left:calc(var(--solaris-carousel-arrow-size) * -.5)}:host([data-controls-position=outside]) .solaris-carousel__arrow.is-next{right:calc(var(--solaris-carousel-arrow-size) * -.5)}\n"] }]
|
|
3155
|
+
}], ctorParameters: () => [], propDecorators: { projectedSlide: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SolarisCarouselSlideDirective), { isSignal: true }] }], projectedOverlay: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SolarisCarouselOverlayDirective), { isSignal: true }] }], activeIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIndex", required: false }] }, { type: i0.Output, args: ["activeIndexChange"] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], aspect: [{ type: i0.Input, args: [{ isSignal: true, alias: "aspect", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], controlsPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlsPosition", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], autoplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoplay", required: false }] }], intervalMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "intervalMs", required: false }] }], transitionMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "transitionMs", required: false }] }], pauseOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "pauseOnHover", required: false }] }], pauseOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "pauseOnFocus", required: false }] }], resetAutoplayOnInteraction: [{ type: i0.Input, args: [{ isSignal: true, alias: "resetAutoplayOnInteraction", required: false }] }], showDots: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDots", required: false }] }], showArrows: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArrows", required: false }] }], keyboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboard", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelKey", required: false }] }], previousLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousLabel", required: false }] }], previousLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousLabelKey", required: false }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: false }] }], nextLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabelKey", required: false }] }], navigationLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "navigationLabel", required: false }] }], navigationLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "navigationLabelKey", required: false }] }], goToSlideLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "goToSlideLabel", required: false }] }], goToSlideLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "goToSlideLabelKey", required: false }] }], openLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "openLabel", required: false }] }], openLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "openLabelKey", required: false }] }], textResolver: [{ type: i0.Input, args: [{ isSignal: true, alias: "textResolver", required: false }] }], slideTpl: [{ type: i0.Input, args: [{ isSignal: true, alias: "slideTpl", required: false }] }], overlayTpl: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayTpl", required: false }] }], slideComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "slideComponent", required: false }] }], overlayComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayComponent", required: false }] }], slideChange: [{ type: i0.Output, args: ["slideChange"] }], dataAspect: [{
|
|
2967
3156
|
type: HostBinding,
|
|
2968
3157
|
args: ['attr.data-aspect']
|
|
2969
3158
|
}], dataRadius: [{
|
|
2970
3159
|
type: HostBinding,
|
|
2971
3160
|
args: ['attr.data-radius']
|
|
3161
|
+
}], dataAppearance: [{
|
|
3162
|
+
type: HostBinding,
|
|
3163
|
+
args: ['attr.data-appearance']
|
|
3164
|
+
}], dataControlsPosition: [{
|
|
3165
|
+
type: HostBinding,
|
|
3166
|
+
args: ['attr.data-controls-position']
|
|
2972
3167
|
}], onKeyDown: [{
|
|
2973
3168
|
type: HostListener,
|
|
2974
3169
|
args: ['keydown', ['$event']]
|
|
@@ -8586,5 +8781,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
8586
8781
|
* Generated bundle index. Do not edit.
|
|
8587
8782
|
*/
|
|
8588
8783
|
|
|
8589
|
-
export { ButtonGroupDirective, FieldErrorComponent, FormField, InputTextDirective, PasswordToggle, SOLARIS_CARD_GROUP, SOLARIS_CARD_SLOT_DIRECTIVES, SOLARIS_DIALOG_DATA, SOLARIS_DIALOG_STEP_DATA, SOLARIS_FORM_FIELD_CONTROLLER, SOLARIS_FORM_FIELD_FEATURES, SOLARIS_INPUT, SOLARIS_NOTIFICATION_CONFIG, SOLARIS_NOTIFICATION_DEFAULT_CONFIG, SOLARIS_NOTIFICATION_POSITIONS, SOLARIS_RADIO_GROUP, SolarisAvatar, SolarisAvatarDropdown, SolarisAvatarOverlayDirective, SolarisAvatarStack, SolarisBadge, SolarisBodyDirective, SolarisBreadcrumb, SolarisButtonDirective, SolarisCard, SolarisCardActionsDirective, SolarisCardBadgeDirective, SolarisCardDescriptionDirective, SolarisCardEyebrowDirective, SolarisCardFooterDirective, SolarisCardGroup, SolarisCardMedia, SolarisCardMediaDirective, SolarisCardMediaOverlayDirective, SolarisCardMetaDirective, SolarisCardTitleDirective, SolarisCheckbox, SolarisColumnCellDef, SolarisColumnHeaderDef, SolarisControlBridgeDirective, SolarisDialogContainer, SolarisDialogRef, SolarisDialogService, SolarisDialogStepsContainer, SolarisDivider, SolarisDrawer, SolarisDrawerFooterDirective, SolarisDrawerHeaderDirective, SolarisDropdownContent, SolarisDropdownContentPanelDirective, SolarisDropdownContentRegistry, SolarisDropdownContentTriggerDirective, SolarisEmailDirective, SolarisFilterBar, SolarisFilterChip, SolarisFilterField, SolarisFilterPanel, SolarisFilterPanelFooterDirective, SolarisFloatingOverlayService, SolarisFooterDirective, SolarisFormFieldController, SolarisHeaderDirective, SolarisIdGenerator,
|
|
8784
|
+
export { ButtonGroupDirective, FieldErrorComponent, FormField, InputTextDirective, PasswordToggle, SOLARIS_CARD_GROUP, SOLARIS_CARD_SLOT_DIRECTIVES, SOLARIS_DIALOG_DATA, SOLARIS_DIALOG_STEP_DATA, SOLARIS_FORM_FIELD_CONTROLLER, SOLARIS_FORM_FIELD_FEATURES, SOLARIS_INPUT, SOLARIS_NOTIFICATION_CONFIG, SOLARIS_NOTIFICATION_DEFAULT_CONFIG, SOLARIS_NOTIFICATION_POSITIONS, SOLARIS_RADIO_GROUP, SolarisAvatar, SolarisAvatarDropdown, SolarisAvatarOverlayDirective, SolarisAvatarStack, SolarisBadge, SolarisBodyDirective, SolarisBreadcrumb, SolarisButtonDirective, SolarisCard, SolarisCardActionsDirective, SolarisCardBadgeDirective, SolarisCardDescriptionDirective, SolarisCardEyebrowDirective, SolarisCardFooterDirective, SolarisCardGroup, SolarisCardMedia, SolarisCardMediaDirective, SolarisCardMediaOverlayDirective, SolarisCardMetaDirective, SolarisCardTitleDirective, SolarisCarousel, SolarisCarouselOverlayDirective, SolarisCarouselSlideDirective, SolarisCheckbox, SolarisColumnCellDef, SolarisColumnHeaderDef, SolarisControlBridgeDirective, SolarisDialogContainer, SolarisDialogRef, SolarisDialogService, SolarisDialogStepsContainer, SolarisDivider, SolarisDrawer, SolarisDrawerFooterDirective, SolarisDrawerHeaderDirective, SolarisDropdownContent, SolarisDropdownContentPanelDirective, SolarisDropdownContentRegistry, SolarisDropdownContentTriggerDirective, SolarisEmailDirective, SolarisFilterBar, SolarisFilterChip, SolarisFilterField, SolarisFilterPanel, SolarisFilterPanelFooterDirective, SolarisFloatingOverlayService, SolarisFooterDirective, SolarisFormFieldController, SolarisHeaderDirective, SolarisIdGenerator, SolarisLoading, SolarisLoadingOverlay, SolarisNotificationCenterComponent, SolarisNotificationHostComponent, SolarisNotificationIntlService, SolarisNotificationItemComponent, SolarisNotificationService, SolarisPage, SolarisPageHeader, SolarisPageHeaderBreadcrumbDirective, SolarisPageHeaderDescriptionDirective, SolarisPageHeaderTitle, SolarisPageHeaderTitleDirective, SolarisPasswordDirective, SolarisPhoneInput, SolarisPopover, SolarisPopoverPanelDirective, SolarisPopoverTriggerDirective, SolarisPrefixDirective, SolarisPresenceAvatar, SolarisRadio, SolarisRadioGroup, SolarisRichTooltipDirective, SolarisRichTooltipPanel, SolarisRowComponent, SolarisSectionComponent, SolarisSelect, SolarisSelectionCard, SolarisStepper, SolarisStepperItem, SolarisSuffixDirective, SolarisTab, SolarisTable, SolarisTableColumn, SolarisTableFilters, SolarisTableSkeleton, SolarisTabs, SolarisTooltipDirective, SolarisTooltipPanel, computeFloatingPosition, computePopoverPosition, provideSolarisNotifications, repositionTooltipOverlay, uniqueId };
|
|
8590
8785
|
//# sourceMappingURL=educarehq-solaris-components.mjs.map
|