@daffodil/storefront 0.94.1 → 0.95.0
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/fesm2022/daffodil-storefront-carousel.mjs +235 -113
- package/fesm2022/daffodil-storefront-carousel.mjs.map +1 -1
- package/fesm2022/daffodil-storefront-quantity-field.mjs +745 -459
- package/fesm2022/daffodil-storefront-quantity-field.mjs.map +1 -1
- package/fesm2022/daffodil-storefront-theme-toggle.mjs +159 -89
- package/fesm2022/daffodil-storefront-theme-toggle.mjs.map +1 -1
- package/fesm2022/daffodil-storefront.mjs +0 -4
- package/package.json +1 -1
- package/types/daffodil-storefront-carousel.d.ts +33 -36
- package/types/daffodil-storefront-quantity-field.d.ts +326 -249
- package/types/daffodil-storefront-theme-toggle.d.ts +36 -40
- package/types/daffodil-storefront.d.ts +1 -2
- package/fesm2022/daffodil-storefront.mjs.map +0 -1
|
@@ -1,116 +1,238 @@
|
|
|
1
|
-
import { NgTemplateOutlet } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import { FaIconComponent } from
|
|
5
|
-
import {
|
|
6
|
-
import { register } from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, Component, Directive, ElementRef, InjectionToken, Input, TemplateRef, ViewEncapsulation, afterNextRender, contentChildren, effect, inject, viewChild } from "@angular/core";
|
|
4
|
+
import { FaIconComponent } from "@fortawesome/angular-fontawesome";
|
|
5
|
+
import { faChevronLeft, faChevronRight } from "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
import { register } from "swiper/element/bundle";
|
|
7
|
+
var DaffSfCarouselItemDirective = class DaffSfCarouselItemDirective {
|
|
8
|
+
static {
|
|
9
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
10
|
+
minVersion: "12.0.0",
|
|
11
|
+
version: "22.2.4",
|
|
12
|
+
ngImport: i0,
|
|
13
|
+
type: DaffSfCarouselItemDirective,
|
|
14
|
+
deps: [],
|
|
15
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
20
|
+
minVersion: "14.0.0",
|
|
21
|
+
version: "22.2.4",
|
|
22
|
+
type: DaffSfCarouselItemDirective,
|
|
23
|
+
isStandalone: true,
|
|
24
|
+
selector: "[daffSfCarouselItem]",
|
|
25
|
+
host: { classAttribute: "daff-sf-carousel-item" },
|
|
26
|
+
ngImport: i0
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
31
|
+
minVersion: "12.0.0",
|
|
32
|
+
version: "22.2.4",
|
|
33
|
+
ngImport: i0,
|
|
34
|
+
type: DaffSfCarouselItemDirective,
|
|
35
|
+
decorators: [{
|
|
36
|
+
type: Directive,
|
|
37
|
+
args: [{
|
|
38
|
+
selector: "[daffSfCarouselItem]",
|
|
39
|
+
host: { class: "daff-sf-carousel-item" }
|
|
40
|
+
}]
|
|
41
|
+
}]
|
|
42
|
+
});
|
|
22
43
|
let registered = false;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
registered = true;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
},
|
|
44
|
+
const DAFF_SF_CAROUSEL_INIT = new InjectionToken("DAFF_SF_CAROUSEL_INIT", {
|
|
45
|
+
providedIn: "root",
|
|
46
|
+
factory: () => {
|
|
47
|
+
if (!registered) {
|
|
48
|
+
register();
|
|
49
|
+
registered = true;
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
36
53
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
54
|
+
var DaffSfCarouselComponent = class DaffSfCarouselComponent {
|
|
55
|
+
constructor(cdr) {
|
|
56
|
+
this.cdr = cdr;
|
|
57
|
+
this.faChevronRight = faChevronRight;
|
|
58
|
+
this.faChevronLeft = faChevronLeft;
|
|
59
|
+
this.items = contentChildren(DaffSfCarouselItemDirective, {
|
|
60
|
+
...ngDevMode ? { debugName: "items" } : /* istanbul ignore next */ {},
|
|
61
|
+
read: TemplateRef
|
|
62
|
+
});
|
|
63
|
+
this.swiperElement = viewChild("swiperElement", {
|
|
64
|
+
...ngDevMode ? { debugName: "swiperElement" } : /* istanbul ignore next */ {},
|
|
65
|
+
read: ElementRef
|
|
66
|
+
});
|
|
67
|
+
this.swiperRef = void 0;
|
|
68
|
+
this.initCarousel = inject(DAFF_SF_CAROUSEL_INIT);
|
|
69
|
+
this.options = {};
|
|
70
|
+
afterNextRender({ write: () => {
|
|
71
|
+
Object.assign(this.swiperElement().nativeElement, this.options);
|
|
72
|
+
this.swiperElement().nativeElement.initialize();
|
|
73
|
+
this.swiperElement().nativeElement.classList.add("swiper-initialized");
|
|
74
|
+
this.swiperRef = this.swiperElement().nativeElement.swiper;
|
|
75
|
+
this.swiperRef.on("slideChange", () => {
|
|
76
|
+
this.cdr.detectChanges();
|
|
77
|
+
});
|
|
78
|
+
this.cdr.detectChanges();
|
|
79
|
+
} });
|
|
80
|
+
effect(() => {
|
|
81
|
+
this.items();
|
|
82
|
+
const swiper = this.swiperRef;
|
|
83
|
+
if (!swiper) return;
|
|
84
|
+
queueMicrotask(() => {
|
|
85
|
+
swiper.update();
|
|
86
|
+
this.cdr.detectChanges();
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
get options() {
|
|
91
|
+
return {
|
|
92
|
+
slidesPerView: "auto",
|
|
93
|
+
spaceBetween: 16,
|
|
94
|
+
keyboard: true,
|
|
95
|
+
...this._options
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
set options(val) {
|
|
99
|
+
this._options = val;
|
|
100
|
+
}
|
|
101
|
+
static {
|
|
102
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
103
|
+
minVersion: "12.0.0",
|
|
104
|
+
version: "22.2.4",
|
|
105
|
+
ngImport: i0,
|
|
106
|
+
type: DaffSfCarouselComponent,
|
|
107
|
+
deps: [{ token: i0.ChangeDetectorRef }],
|
|
108
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
static {
|
|
112
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
113
|
+
minVersion: "17.0.0",
|
|
114
|
+
version: "22.2.4",
|
|
115
|
+
type: DaffSfCarouselComponent,
|
|
116
|
+
isStandalone: true,
|
|
117
|
+
selector: "daff-sf-carousel",
|
|
118
|
+
inputs: { options: "options" },
|
|
119
|
+
host: {
|
|
120
|
+
attributes: {
|
|
121
|
+
"ngSkipHydration": "true",
|
|
122
|
+
"tabindex": "0"
|
|
123
|
+
},
|
|
124
|
+
classAttribute: "daff-sf-carousel"
|
|
125
|
+
},
|
|
126
|
+
queries: [{
|
|
127
|
+
propertyName: "items",
|
|
128
|
+
predicate: DaffSfCarouselItemDirective,
|
|
129
|
+
read: TemplateRef,
|
|
130
|
+
isSignal: true
|
|
131
|
+
}],
|
|
132
|
+
viewQueries: [{
|
|
133
|
+
propertyName: "swiperElement",
|
|
134
|
+
first: true,
|
|
135
|
+
predicate: ["swiperElement"],
|
|
136
|
+
descendants: true,
|
|
137
|
+
read: ElementRef,
|
|
138
|
+
isSignal: true
|
|
139
|
+
}],
|
|
140
|
+
ngImport: i0,
|
|
141
|
+
template: "<div class=\"daff-sf-carousel__heading\">\n <ng-content select=\"[daffSfCarouselTitle]\"></ng-content>\n <div class=\"daff-sf-carousel__nav\">\n <button\n class=\"daff-sf-carousel__button\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n (click)=\"swiperRef.slidePrev()\"\n [disabled]=\"$safeNavigationMigration(swiperRef?.isBeginning)\"\n >\n <fa-icon [icon]=\"faChevronLeft\"></fa-icon>\n </button>\n <button\n class=\"daff-sf-carousel__button\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n (click)=\"swiperRef.slideNext()\"\n [disabled]=\"$safeNavigationMigration(swiperRef?.isEnd)\"\n >\n <fa-icon [icon]=\"faChevronRight\"></fa-icon>\n </button>\n </div>\n</div>\n\n<swiper-container init=\"false\" #swiperElement>\n @for (item of items(); track item) {\n <swiper-slide>\n <ng-container *ngTemplateOutlet=\"item\"> </ng-container>\n </swiper-slide>\n }\n</swiper-container>\n",
|
|
142
|
+
styles: [":root{--swiper-theme-color: #007aff}:host{position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-slides-offset-before);scroll-margin-inline-start:var(--swiper-slides-offset-before)}.swiper-css-mode.swiper-horizontal>.swiper-wrapper>.swiper-slide:last-child{margin-inline-end:var(--swiper-slides-offset-after)}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-slides-offset-before);scroll-margin-block-start:var(--swiper-slides-offset-before)}.swiper-css-mode.swiper-vertical>.swiper-wrapper>.swiper-slide:last-child{margin-block-end:var(--swiper-slides-offset-after)}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:\"\";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,#00000080,#0000)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}:is(.swiper:not(.swiper-watch-progress),.swiper-watch-progress .swiper-slide-visible) .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color: #fff}.swiper-lazy-preloader-black{--swiper-preloader-color: #000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.swiper .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}swiper-container:not(.swiper-initialized){display:flex;overflow:hidden;gap:.5rem}swiper-slide{display:inline-block;width:max-content}.daff-sf-carousel{display:block}.daff-sf-carousel__heading{display:flex;align-items:center;justify-content:space-between;margin:0 0 1.5rem}.daff-sf-carousel__nav{display:flex;align-items:center}.daff-sf-carousel__button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;appearance:none;background:none;border:0;flex-shrink:0;font-size:1rem;font-weight:500;height:2.5rem;width:2.5rem;line-height:2.5rem;padding:0;position:relative;text-align:center;text-decoration:none;vertical-align:baseline;box-sizing:border-box}.daff-sf-carousel__button[disabled]{cursor:not-allowed;pointer-events:none}\n"],
|
|
143
|
+
dependencies: [{
|
|
144
|
+
kind: "component",
|
|
145
|
+
type: FaIconComponent,
|
|
146
|
+
selector: "fa-icon",
|
|
147
|
+
inputs: [
|
|
148
|
+
"icon",
|
|
149
|
+
"title",
|
|
150
|
+
"animation",
|
|
151
|
+
"mask",
|
|
152
|
+
"flip",
|
|
153
|
+
"size",
|
|
154
|
+
"pull",
|
|
155
|
+
"border",
|
|
156
|
+
"inverse",
|
|
157
|
+
"symbol",
|
|
158
|
+
"rotate",
|
|
159
|
+
"fixedWidth",
|
|
160
|
+
"transform",
|
|
161
|
+
"a11yRole"
|
|
162
|
+
],
|
|
163
|
+
outputs: [
|
|
164
|
+
"iconChange",
|
|
165
|
+
"titleChange",
|
|
166
|
+
"animationChange",
|
|
167
|
+
"maskChange",
|
|
168
|
+
"flipChange",
|
|
169
|
+
"sizeChange",
|
|
170
|
+
"pullChange",
|
|
171
|
+
"borderChange",
|
|
172
|
+
"inverseChange",
|
|
173
|
+
"symbolChange",
|
|
174
|
+
"rotateChange",
|
|
175
|
+
"fixedWidthChange",
|
|
176
|
+
"transformChange",
|
|
177
|
+
"a11yRoleChange"
|
|
178
|
+
]
|
|
179
|
+
}, {
|
|
180
|
+
kind: "directive",
|
|
181
|
+
type: NgTemplateOutlet,
|
|
182
|
+
selector: "[ngTemplateOutlet]",
|
|
183
|
+
inputs: [
|
|
184
|
+
"ngTemplateOutletContext",
|
|
185
|
+
"ngTemplateOutlet",
|
|
186
|
+
"ngTemplateOutletInjector"
|
|
187
|
+
]
|
|
188
|
+
}],
|
|
189
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
190
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
195
|
+
minVersion: "12.0.0",
|
|
196
|
+
version: "22.2.4",
|
|
197
|
+
ngImport: i0,
|
|
198
|
+
type: DaffSfCarouselComponent,
|
|
199
|
+
decorators: [{
|
|
200
|
+
type: Component,
|
|
201
|
+
args: [{
|
|
202
|
+
selector: "daff-sf-carousel",
|
|
203
|
+
encapsulation: ViewEncapsulation.None,
|
|
204
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
205
|
+
host: {
|
|
206
|
+
ngSkipHydration: "true",
|
|
207
|
+
class: "daff-sf-carousel",
|
|
208
|
+
tabindex: "0"
|
|
209
|
+
},
|
|
210
|
+
imports: [FaIconComponent, NgTemplateOutlet],
|
|
211
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
212
|
+
template: "<div class=\"daff-sf-carousel__heading\">\n <ng-content select=\"[daffSfCarouselTitle]\"></ng-content>\n <div class=\"daff-sf-carousel__nav\">\n <button\n class=\"daff-sf-carousel__button\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n (click)=\"swiperRef.slidePrev()\"\n [disabled]=\"$safeNavigationMigration(swiperRef?.isBeginning)\"\n >\n <fa-icon [icon]=\"faChevronLeft\"></fa-icon>\n </button>\n <button\n class=\"daff-sf-carousel__button\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n (click)=\"swiperRef.slideNext()\"\n [disabled]=\"$safeNavigationMigration(swiperRef?.isEnd)\"\n >\n <fa-icon [icon]=\"faChevronRight\"></fa-icon>\n </button>\n </div>\n</div>\n\n<swiper-container init=\"false\" #swiperElement>\n @for (item of items(); track item) {\n <swiper-slide>\n <ng-container *ngTemplateOutlet=\"item\"> </ng-container>\n </swiper-slide>\n }\n</swiper-container>\n",
|
|
213
|
+
styles: [":root{--swiper-theme-color: #007aff}:host{position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-slides-offset-before);scroll-margin-inline-start:var(--swiper-slides-offset-before)}.swiper-css-mode.swiper-horizontal>.swiper-wrapper>.swiper-slide:last-child{margin-inline-end:var(--swiper-slides-offset-after)}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-slides-offset-before);scroll-margin-block-start:var(--swiper-slides-offset-before)}.swiper-css-mode.swiper-vertical>.swiper-wrapper>.swiper-slide:last-child{margin-block-end:var(--swiper-slides-offset-after)}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:\"\";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,#00000080,#0000)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}:is(.swiper:not(.swiper-watch-progress),.swiper-watch-progress .swiper-slide-visible) .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color: #fff}.swiper-lazy-preloader-black{--swiper-preloader-color: #000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.swiper .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}swiper-container:not(.swiper-initialized){display:flex;overflow:hidden;gap:.5rem}swiper-slide{display:inline-block;width:max-content}.daff-sf-carousel{display:block}.daff-sf-carousel__heading{display:flex;align-items:center;justify-content:space-between;margin:0 0 1.5rem}.daff-sf-carousel__nav{display:flex;align-items:center}.daff-sf-carousel__button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;appearance:none;background:none;border:0;flex-shrink:0;font-size:1rem;font-weight:500;height:2.5rem;width:2.5rem;line-height:2.5rem;padding:0;position:relative;text-align:center;text-decoration:none;vertical-align:baseline;box-sizing:border-box}.daff-sf-carousel__button[disabled]{cursor:not-allowed;pointer-events:none}\n"]
|
|
214
|
+
}]
|
|
215
|
+
}],
|
|
216
|
+
ctorParameters: () => [{ type: i0.ChangeDetectorRef }],
|
|
217
|
+
propDecorators: {
|
|
218
|
+
items: [{
|
|
219
|
+
type: i0.ContentChildren,
|
|
220
|
+
args: [i0.forwardRef(() => DaffSfCarouselItemDirective), {
|
|
221
|
+
read: TemplateRef,
|
|
222
|
+
isSignal: true
|
|
223
|
+
}]
|
|
224
|
+
}],
|
|
225
|
+
swiperElement: [{
|
|
226
|
+
type: i0.ViewChild,
|
|
227
|
+
args: ["swiperElement", {
|
|
228
|
+
read: ElementRef,
|
|
229
|
+
isSignal: true
|
|
230
|
+
}]
|
|
231
|
+
}],
|
|
232
|
+
options: [{ type: Input }]
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
const DAFF_SF_CAROUSEL_COMPONENTS = [DaffSfCarouselComponent, DaffSfCarouselItemDirective];
|
|
115
236
|
export { DAFF_SF_CAROUSEL_COMPONENTS, DaffSfCarouselComponent, DaffSfCarouselItemDirective };
|
|
116
|
-
|
|
237
|
+
|
|
238
|
+
//# sourceMappingURL=daffodil-storefront-carousel.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-storefront-carousel.mjs","sources":["../../../libs/storefront/carousel/src/carousel-item/carousel-item.directive.ts","../../../libs/storefront/carousel/src/provider.ts","../../../libs/storefront/carousel/src/carousel/carousel.component.ts","../../../libs/storefront/carousel/src/carousel/carousel.component.html","../../../libs/storefront/carousel/src/carousel.ts"
|
|
1
|
+
{"version":3,"file":"daffodil-storefront-carousel.mjs","names":[],"sources":["../../../libs/storefront/carousel/src/carousel-item/carousel-item.directive.ts","../../../libs/storefront/carousel/src/provider.ts","../../../libs/storefront/carousel/src/carousel/carousel.component.ts","../../../libs/storefront/carousel/src/carousel/carousel.component.html","../../../libs/storefront/carousel/src/carousel.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[daffSfCarouselItem]',\n host: {\n class: 'daff-sf-carousel-item',\n },\n})\nexport class DaffSfCarouselItemDirective {}\n","import { InjectionToken } from '@angular/core';\nimport { register } from 'swiper/element/bundle';\n\nlet registered = false;\n\n/**\n * Injection token for DaffSfCarouselComponent initialization\n * Automatically registers Swiper custom elements once globally when first injected\n */\nexport const DAFF_SF_CAROUSEL_INIT = new InjectionToken<true>(\n 'DAFF_SF_CAROUSEL_INIT',\n {\n providedIn: 'root',\n factory: () => {\n if (!registered) {\n register();\n registered = true;\n }\n return true;\n },\n },\n);\n\n","\n\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n contentChildren,\n CUSTOM_ELEMENTS_SCHEMA,\n effect,\n ElementRef,\n inject,\n Input,\n TemplateRef,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faChevronRight,\n faChevronLeft,\n} from '@fortawesome/free-solid-svg-icons';\nimport { Swiper } from 'swiper/types';\n\nimport { SwiperNativeElement } from './swiper-native-element';\nimport { DaffSfCarouselItemDirective } from '../carousel-item/carousel-item.directive';\nimport { DaffSfCarouselOptions } from '../options';\nimport { DAFF_SF_CAROUSEL_INIT } from '../provider';\n\n@Component({\n selector: 'daff-sf-carousel',\n templateUrl: './carousel.component.html',\n styleUrls: ['./carousel.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n ngSkipHydration: 'true',\n class: 'daff-sf-carousel',\n tabindex: '0',\n },\n imports: [\n FaIconComponent,\n NgTemplateOutlet,\n ],\n schemas: [\n CUSTOM_ELEMENTS_SCHEMA,\n ],\n})\nexport class DaffSfCarouselComponent {\n readonly faChevronRight = faChevronRight;\n readonly faChevronLeft = faChevronLeft;\n\n private _options: DaffSfCarouselOptions;\n\n items = contentChildren(DaffSfCarouselItemDirective, { read: TemplateRef<any> });\n\n swiperElement = viewChild<unknown,ElementRef<SwiperNativeElement>>('swiperElement', { read: ElementRef<any> });\n\n swiperRef: Swiper = undefined;\n\n private initCarousel = inject(DAFF_SF_CAROUSEL_INIT);\n\n constructor(private cdr: ChangeDetectorRef) {\n this.options = {};\n\n afterNextRender({\n write: () => {\n Object.assign(this.swiperElement().nativeElement, this.options);\n this.swiperElement().nativeElement.initialize();\n this.swiperElement().nativeElement.classList.add('swiper-initialized');\n this.swiperRef = this.swiperElement().nativeElement.swiper;\n this.swiperRef.on('slideChange', () => {\n this.cdr.detectChanges();\n });\n // Force Angular to update the bindings\n\n this.cdr.detectChanges();\n },\n });\n\n effect(() => {\n const currentSlides = this.items();\n const swiper = this.swiperRef;\n if (!swiper) {\n return;\n };\n\n queueMicrotask(() => {\n swiper.update();\n this.cdr.detectChanges();\n });\n });\n }\n\n @Input()\n get options(): DaffSfCarouselOptions {\n return {\n ...{\n slidesPerView: 'auto',\n spaceBetween: 16,\n keyboard: true,\n },\n ...this._options,\n };\n }\n set options(val: DaffSfCarouselOptions) {\n this._options = val;\n }\n}\n","<div class=\"daff-sf-carousel__heading\">\n\t<ng-content select=\"[daffSfCarouselTitle]\"></ng-content>\n\t<div class=\"daff-sf-carousel__nav\">\n\t\t<button\n\t\t\tclass=\"daff-sf-carousel__button\"\n\t\t\taria-hidden=\"true\"\n\t\t\ttabindex=\"-1\"\n\t\t\t(click)=\"swiperRef.slidePrev()\"\n\t\t\t[disabled]=\"$safeNavigationMigration(swiperRef?.isBeginning)\"\n\t\t>\n\t\t\t<fa-icon [icon]=\"faChevronLeft\"></fa-icon>\n\t\t</button>\n\t\t<button\n\t\t\tclass=\"daff-sf-carousel__button\"\n\t\t\taria-hidden=\"true\"\n\t\t\ttabindex=\"-1\"\n\t\t\t(click)=\"swiperRef.slideNext()\"\n\t\t\t[disabled]=\"$safeNavigationMigration(swiperRef?.isEnd)\"\n\t\t>\n\t\t\t<fa-icon [icon]=\"faChevronRight\"></fa-icon>\n\t\t</button>\n\t</div>\n</div>\n\n<swiper-container init=\"false\" #swiperElement>\n\t@for (item of items(); track item) {\n\t\t<swiper-slide>\n\t\t\t<ng-container *ngTemplateOutlet=\"item\"> </ng-container>\n\t\t</swiper-slide>\n\t}\n</swiper-container>\n","import { DaffSfCarouselComponent } from './carousel/carousel.component';\nimport { DaffSfCarouselItemDirective } from './carousel-item/carousel-item.directive';\n\nexport const DAFF_SF_CAROUSEL_COMPONENTS = <const> [\n DaffSfCarouselComponent,\n DaffSfCarouselItemDirective,\n];\n"],"mappings":";;;;;;AAQA,IAAa,8BAAb,MAAa,4BAA2B;CAA3B;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA2B,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAA3B;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAA2B,cAAA;GAAA,UAAA;GAAA,MAAA,EAAA,gBAAA,wBAAA;GAAA,UAAA;EAAA,CAAA;CAAA;;AAA3B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA2B,YAAA,CAAA;EANvC,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EACJ,OAAO,wBACR;EACF,CAAA;;;ACJD,IAAI,aAAa;AAMjB,MAAa,wBAAwB,IAAI,eACvC,yBACA;CACE,YAAY;CACZ,eAAc;EACZ,IAAI,CAAC,YAAY;GACf,SAAQ;GACR,aAAa;EACf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