oasys-lib 2.37.0-theming.1 → 2.37.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/oasys-lib.mjs +2 -480
- package/fesm2022/oasys-lib.mjs.map +1 -1
- package/index.d.ts +332 -485
- package/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/assets/bloomandwild/variables.css +1 -19
- package/src/assets/bloomon/variables.css +1 -19
- package/src/assets/global/scss-breakpoints.scss +1 -1
- package/src/assets/style.scss +12 -14
- package/src/assets/bloomandwild-loyalty-tier-1/variables.css +0 -1364
- package/src/assets/bloomandwild-loyalty-tier-2/variables.css +0 -1358
- package/src/assets/bloomon-loyalty-tier-1/variables.css +0 -1364
- package/src/assets/bloomon-loyalty-tier-2/variables.css +0 -1358
package/fesm2022/oasys-lib.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, Directive, Injectable, DOCUMENT, Inject, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, InjectionToken, HostListener, input, output, viewChild, signal, computed, EventEmitter, ViewChild, ContentChild, Output, NgModule, HostBinding, model, forwardRef, afterRenderEffect,
|
|
2
|
+
import { inject, ElementRef, Directive, Injectable, DOCUMENT, Inject, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, InjectionToken, HostListener, input, output, viewChild, signal, computed, EventEmitter, ViewChild, ContentChild, Output, NgModule, HostBinding, model, forwardRef, afterRenderEffect, viewChildren, ContentChildren, contentChildren, effect } from '@angular/core';
|
|
3
3
|
import { BehaviorSubject, Subject, Observable } from 'rxjs';
|
|
4
4
|
import { takeUntil, take, map } from 'rxjs/operators';
|
|
5
5
|
import * as i1 from '@angular/cdk/layout';
|
|
@@ -2241,98 +2241,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2241
2241
|
}]
|
|
2242
2242
|
}] });
|
|
2243
2243
|
|
|
2244
|
-
/**
|
|
2245
|
-
* @deprecated Use the SeoBlock component from bloomandwild-frontend instead.
|
|
2246
|
-
*/
|
|
2247
|
-
class SeoBlockComponent {
|
|
2248
|
-
heading_paragraph;
|
|
2249
|
-
heading_links;
|
|
2250
|
-
main_content;
|
|
2251
|
-
expanded_content;
|
|
2252
|
-
links;
|
|
2253
|
-
read_more_content_text;
|
|
2254
|
-
read_less_content_text;
|
|
2255
|
-
show_more_links_text;
|
|
2256
|
-
show_less_links_text;
|
|
2257
|
-
linksColumnsNumber;
|
|
2258
|
-
expandedLinksVisible = false;
|
|
2259
|
-
expandedContentVisible = false;
|
|
2260
|
-
linksValues;
|
|
2261
|
-
showMoreLinks(flag) {
|
|
2262
|
-
this.expandedLinksVisible = flag;
|
|
2263
|
-
}
|
|
2264
|
-
showMoreContent(flag) {
|
|
2265
|
-
this.expandedContentVisible = flag;
|
|
2266
|
-
}
|
|
2267
|
-
ngOnInit() {
|
|
2268
|
-
// This is to fix a bug in Oasys that threats arrays as string initially
|
|
2269
|
-
if (typeof this.links === 'string') {
|
|
2270
|
-
this.linksValues = JSON.parse(this.links) ?? [];
|
|
2271
|
-
}
|
|
2272
|
-
else {
|
|
2273
|
-
this.linksValues = this.links;
|
|
2274
|
-
}
|
|
2275
|
-
if (this.linksValues.length <= 10) {
|
|
2276
|
-
this.linksColumnsNumber = 1;
|
|
2277
|
-
}
|
|
2278
|
-
else if (this.linksValues.length <= 20) {
|
|
2279
|
-
this.linksColumnsNumber = 2;
|
|
2280
|
-
}
|
|
2281
|
-
else {
|
|
2282
|
-
this.linksColumnsNumber = 3;
|
|
2283
|
-
}
|
|
2284
|
-
}
|
|
2285
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SeoBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2286
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: SeoBlockComponent, isStandalone: true, selector: "ui-seo-block", inputs: { heading_paragraph: "heading_paragraph", heading_links: "heading_links", main_content: "main_content", expanded_content: "expanded_content", links: "links", read_more_content_text: "read_more_content_text", read_less_content_text: "read_less_content_text", show_more_links_text: "show_more_links_text", show_less_links_text: "show_less_links_text" }, ngImport: i0, template: "<ui-box>\n <ui-grid>\n <ui-column [columns]=\"6\">\n <ui-box\n box_space=\"none\"\n [box_space_right]=\"{\n mobile: 'none',\n tablet: 'expanded',\n laptop: 'expanded',\n desktop: 'expanded',\n }\"\n >\n <ui-stack stack_gap=\"near\">\n <ui-box box_space=\"none\">\n <ui-heading\n heading_type=\"functional-primary\"\n heading_title=\"{{ heading_paragraph }}\"\n heading_level=\"h2\"\n ></ui-heading>\n </ui-box>\n <ui-box box_space=\"none\">\n <p>\n <span class=\"text-body--default\" class=\"ui-prose\" [innerHTML]=\"main_content\"></span>\n <span\n id=\"expanded-content\"\n class=\"text-body--default\"\n class=\"ui-prose\"\n *ngIf=\"expandedContentVisible\"\n [innerHTML]=\"expanded_content\"\n ></span>\n </p>\n </ui-box>\n <ui-box box_space=\"none\" *ngIf=\"expanded_content\">\n <button\n (click)=\"showMoreContent(!expandedContentVisible)\"\n class=\"text-link text-link--standalone\"\n [attr.aria-expanded]=\"expandedContentVisible\"\n [attr.aria-controls]=\"'expanded-content'\"\n >\n {{ expandedContentVisible ? read_less_content_text : read_more_content_text }}\n </button>\n </ui-box>\n </ui-stack>\n </ui-box>\n </ui-column>\n <ui-column [columns]=\"6\">\n <ui-box box_space=\"none\">\n <ui-stack stack_gap=\"near\">\n <ui-box box_space=\"none\">\n <ui-heading\n heading_type=\"functional-secondary\"\n heading_level=\"h3\"\n heading_title=\"{{ heading_links }}\"\n ></ui-heading>\n </ui-box>\n <ui-stack stack_gap=\"tight\">\n <ui-box\n box_space=\"none\"\n box_fill_mode=\"fit\"\n [ngStyle]=\"{ 'column-count': linksColumnsNumber }\"\n class=\"links-container text-body--supporting\"\n box_role=\"list\"\n id=\"expanded-links\"\n >\n <ng-container *ngFor=\"let link of linksValues; index as i\">\n <li>\n <ui-box\n box_space=\"none\"\n box_space_bottom=\"tight\"\n box_fill_mode=\"fit\"\n class=\"link-container\"\n [ngClass]=\"{ 'hidden-mobile': i > 4 && !expandedLinksVisible }\"\n >\n <a href=\"{{ link.href }}\">\n {{ link.name }}\n </a>\n </ui-box>\n </li>\n </ng-container>\n </ui-box>\n <ui-box\n box_space=\"none\"\n class=\"hidden-desktop hidden-tablet\"\n *ngIf=\"linksValues.length > 4\"\n >\n <button\n (click)=\"showMoreLinks(!expandedLinksVisible)\"\n class=\"text-link text-link--standalone\"\n [attr.aria-expanded]=\"expandedLinksVisible\"\n [attr.aria-controls]=\"'expanded-links'\"\n >\n {{ expandedLinksVisible ? show_less_links_text : show_more_links_text }}\n </button>\n </ui-box>\n </ui-stack>\n </ui-stack>\n </ui-box>\n </ui-column>\n </ui-grid>\n</ui-box>\n", styles: [".oasys-focus-style,button:focus,button:focus-visible,[tabindex]:focus-visible,[tabindex]:focus,select:focus-visible,select:focus,textarea:focus-visible,textarea:focus,input:focus-visible,input:focus,a:focus-visible,a:focus{outline:var(--oasys-border-width-focus) solid var(--oasys-color-interaction-border-focus);outline-offset:var(--oasys-border-width-focus-offset)}a:focus:not(:focus-visible){outline:none}button:focus:not(:focus-visible){outline:none}input:focus:not(:focus-visible){outline:none}textarea:focus:not(:focus-visible){outline:none}select:focus:not(:focus-visible){outline:none}[tabindex]:focus:not(:focus-visible){outline:none}button{all:unset;cursor:pointer;font-weight:var(--oasys-typography-body-emphasis-hero-font-weight);text-decoration:underline}.links-container{display:block}@media only screen and (max-width:766px){.links-container{display:flex}}.links-container .link-container{page-break-inside:avoid;break-inside:avoid-column}\n"], dependencies: [{ kind: "component", type: LayoutBoxComponent, selector: "ui-box", inputs: ["box_space", "box_role", "box_space_top", "box_space_right", "box_space_bottom", "box_space_left", "box_align_x", "box_align_y", "box_fill_mode", "box_background", "box_content_fill_width", "box_border_color", "box_border_width", "box_border_style", "box_border_radius"] }, { kind: "component", type: LayoutGridComponent, selector: "ui-grid", inputs: ["grid_auto", "grid_collapse_below", "grid_gap", "grid_base"] }, { kind: "component", type: LayoutGridColumnComponent, selector: "ui-column", inputs: ["columns", "column_inset"] }, { kind: "component", type: LayoutStackComponent, selector: "ui-stack", inputs: ["stack_gap", "stack_align", "stack_direction", "stack_distribute", "stack_wrap", "stack_collapse_below", "stack_as_list"] }, { kind: "component", type: OasysHeadingComponent, selector: "ui-heading", inputs: ["heading_type", "heading_on_dark", "heading_title", "heading_seo_priority", "heading_priority", "heading_alignment_override", "heading_subtitle", "heading_surtitle", "heading_level"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: OasysHrefDirective, selector: "a, uiHref, [uiHref]" }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2287
|
-
}
|
|
2288
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SeoBlockComponent, decorators: [{
|
|
2289
|
-
type: Component,
|
|
2290
|
-
args: [{ selector: 'ui-seo-block', standalone: true, imports: [
|
|
2291
|
-
LayoutBoxComponent,
|
|
2292
|
-
LayoutGridComponent,
|
|
2293
|
-
LayoutGridColumnComponent,
|
|
2294
|
-
LayoutStackComponent,
|
|
2295
|
-
OasysHeadingComponent,
|
|
2296
|
-
NgIf,
|
|
2297
|
-
OasysHrefDirective,
|
|
2298
|
-
NgStyle,
|
|
2299
|
-
NgFor,
|
|
2300
|
-
NgClass,
|
|
2301
|
-
], template: "<ui-box>\n <ui-grid>\n <ui-column [columns]=\"6\">\n <ui-box\n box_space=\"none\"\n [box_space_right]=\"{\n mobile: 'none',\n tablet: 'expanded',\n laptop: 'expanded',\n desktop: 'expanded',\n }\"\n >\n <ui-stack stack_gap=\"near\">\n <ui-box box_space=\"none\">\n <ui-heading\n heading_type=\"functional-primary\"\n heading_title=\"{{ heading_paragraph }}\"\n heading_level=\"h2\"\n ></ui-heading>\n </ui-box>\n <ui-box box_space=\"none\">\n <p>\n <span class=\"text-body--default\" class=\"ui-prose\" [innerHTML]=\"main_content\"></span>\n <span\n id=\"expanded-content\"\n class=\"text-body--default\"\n class=\"ui-prose\"\n *ngIf=\"expandedContentVisible\"\n [innerHTML]=\"expanded_content\"\n ></span>\n </p>\n </ui-box>\n <ui-box box_space=\"none\" *ngIf=\"expanded_content\">\n <button\n (click)=\"showMoreContent(!expandedContentVisible)\"\n class=\"text-link text-link--standalone\"\n [attr.aria-expanded]=\"expandedContentVisible\"\n [attr.aria-controls]=\"'expanded-content'\"\n >\n {{ expandedContentVisible ? read_less_content_text : read_more_content_text }}\n </button>\n </ui-box>\n </ui-stack>\n </ui-box>\n </ui-column>\n <ui-column [columns]=\"6\">\n <ui-box box_space=\"none\">\n <ui-stack stack_gap=\"near\">\n <ui-box box_space=\"none\">\n <ui-heading\n heading_type=\"functional-secondary\"\n heading_level=\"h3\"\n heading_title=\"{{ heading_links }}\"\n ></ui-heading>\n </ui-box>\n <ui-stack stack_gap=\"tight\">\n <ui-box\n box_space=\"none\"\n box_fill_mode=\"fit\"\n [ngStyle]=\"{ 'column-count': linksColumnsNumber }\"\n class=\"links-container text-body--supporting\"\n box_role=\"list\"\n id=\"expanded-links\"\n >\n <ng-container *ngFor=\"let link of linksValues; index as i\">\n <li>\n <ui-box\n box_space=\"none\"\n box_space_bottom=\"tight\"\n box_fill_mode=\"fit\"\n class=\"link-container\"\n [ngClass]=\"{ 'hidden-mobile': i > 4 && !expandedLinksVisible }\"\n >\n <a href=\"{{ link.href }}\">\n {{ link.name }}\n </a>\n </ui-box>\n </li>\n </ng-container>\n </ui-box>\n <ui-box\n box_space=\"none\"\n class=\"hidden-desktop hidden-tablet\"\n *ngIf=\"linksValues.length > 4\"\n >\n <button\n (click)=\"showMoreLinks(!expandedLinksVisible)\"\n class=\"text-link text-link--standalone\"\n [attr.aria-expanded]=\"expandedLinksVisible\"\n [attr.aria-controls]=\"'expanded-links'\"\n >\n {{ expandedLinksVisible ? show_less_links_text : show_more_links_text }}\n </button>\n </ui-box>\n </ui-stack>\n </ui-stack>\n </ui-box>\n </ui-column>\n </ui-grid>\n</ui-box>\n", styles: [".oasys-focus-style,button:focus,button:focus-visible,[tabindex]:focus-visible,[tabindex]:focus,select:focus-visible,select:focus,textarea:focus-visible,textarea:focus,input:focus-visible,input:focus,a:focus-visible,a:focus{outline:var(--oasys-border-width-focus) solid var(--oasys-color-interaction-border-focus);outline-offset:var(--oasys-border-width-focus-offset)}a:focus:not(:focus-visible){outline:none}button:focus:not(:focus-visible){outline:none}input:focus:not(:focus-visible){outline:none}textarea:focus:not(:focus-visible){outline:none}select:focus:not(:focus-visible){outline:none}[tabindex]:focus:not(:focus-visible){outline:none}button{all:unset;cursor:pointer;font-weight:var(--oasys-typography-body-emphasis-hero-font-weight);text-decoration:underline}.links-container{display:block}@media only screen and (max-width:766px){.links-container{display:flex}}.links-container .link-container{page-break-inside:avoid;break-inside:avoid-column}\n"] }]
|
|
2302
|
-
}], propDecorators: { heading_paragraph: [{
|
|
2303
|
-
type: Input
|
|
2304
|
-
}], heading_links: [{
|
|
2305
|
-
type: Input
|
|
2306
|
-
}], main_content: [{
|
|
2307
|
-
type: Input
|
|
2308
|
-
}], expanded_content: [{
|
|
2309
|
-
type: Input
|
|
2310
|
-
}], links: [{
|
|
2311
|
-
type: Input
|
|
2312
|
-
}], read_more_content_text: [{
|
|
2313
|
-
type: Input
|
|
2314
|
-
}], read_less_content_text: [{
|
|
2315
|
-
type: Input
|
|
2316
|
-
}], show_more_links_text: [{
|
|
2317
|
-
type: Input
|
|
2318
|
-
}], show_less_links_text: [{
|
|
2319
|
-
type: Input
|
|
2320
|
-
}] } });
|
|
2321
|
-
|
|
2322
|
-
/** @deprecated Use the SeoBlock component from bloomandwild-frontend instead. */
|
|
2323
|
-
class OasysSeoBlockModule {
|
|
2324
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysSeoBlockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2325
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: OasysSeoBlockModule, imports: [SeoBlockComponent], exports: [SeoBlockComponent] });
|
|
2326
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysSeoBlockModule });
|
|
2327
|
-
}
|
|
2328
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysSeoBlockModule, decorators: [{
|
|
2329
|
-
type: NgModule,
|
|
2330
|
-
args: [{
|
|
2331
|
-
imports: [SeoBlockComponent],
|
|
2332
|
-
exports: [SeoBlockComponent],
|
|
2333
|
-
}]
|
|
2334
|
-
}] });
|
|
2335
|
-
|
|
2336
2244
|
/** @deprecated Import the standalone IconComponent directly instead. */
|
|
2337
2245
|
class OasysIconModule {
|
|
2338
2246
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysIconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -2417,300 +2325,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2417
2325
|
}]
|
|
2418
2326
|
}] });
|
|
2419
2327
|
|
|
2420
|
-
/* This component wraps around the swiper.js library WebComponent */
|
|
2421
|
-
class CarouselComponent {
|
|
2422
|
-
tokenService;
|
|
2423
|
-
document;
|
|
2424
|
-
element;
|
|
2425
|
-
// The swiper instance
|
|
2426
|
-
swiper;
|
|
2427
|
-
carouselscrollbarplaceholder;
|
|
2428
|
-
carouselctastack;
|
|
2429
|
-
// Rewinds the slides back to the start when the user reaches the end when set to true
|
|
2430
|
-
rewind = false;
|
|
2431
|
-
carousel_overflow = false;
|
|
2432
|
-
carousel_gap = 'default';
|
|
2433
|
-
carousel_pagination = 'none';
|
|
2434
|
-
carousel_slides_per_view_desktop = 4;
|
|
2435
|
-
carousel_slides_per_view_laptop = 3;
|
|
2436
|
-
carousel_slides_per_view_tablet = 2.5;
|
|
2437
|
-
carousel_slides_per_view_mobile = 1.25;
|
|
2438
|
-
text_for_left_arrow = 'previous slide';
|
|
2439
|
-
text_for_right_arrow = 'next slide';
|
|
2440
|
-
carousel_rows_per_row_mobile = 1; // Required for CATEGORY_CARD experiment. Remove if experiment fails.
|
|
2441
|
-
carousel_loading = 'lazy'; // If we don't have multiple carousels on page and want to prioritise UI loading on time
|
|
2442
|
-
carousel_free_mode = false; // Enables scrolling with mousewheel / smoother momentum swiping experience
|
|
2443
|
-
center_insufficient_slides = true; // Centers the slides if there are not enough to fill the space
|
|
2444
|
-
center_active_slide = false; // Centers the active slide
|
|
2445
|
-
start_slide = 0; // Start slide index
|
|
2446
|
-
offset_scrollbar_top = false; // Offset the scrollbar to the top of the carousel
|
|
2447
|
-
activeIndexOnSlideChange = new EventEmitter();
|
|
2448
|
-
constructor(tokenService, document, element) {
|
|
2449
|
-
this.tokenService = tokenService;
|
|
2450
|
-
this.document = document;
|
|
2451
|
-
this.element = element;
|
|
2452
|
-
inject(SWIPER_PROVIDER_TOKEN).ensureSwiperRegistered();
|
|
2453
|
-
}
|
|
2454
|
-
ngOnInit() {
|
|
2455
|
-
if (this.carousel_loading === 'lazy') {
|
|
2456
|
-
this.setUpIntersectionObserver();
|
|
2457
|
-
}
|
|
2458
|
-
else {
|
|
2459
|
-
this.initSwiper();
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
/**
|
|
2463
|
-
* Set up the intersection observer with the relevant options
|
|
2464
|
-
*/
|
|
2465
|
-
setUpIntersectionObserver() {
|
|
2466
|
-
// Set IntersectionObserver options
|
|
2467
|
-
const options = {
|
|
2468
|
-
root: null,
|
|
2469
|
-
rootMargin: '0px',
|
|
2470
|
-
threshold: 0.5,
|
|
2471
|
-
once: true,
|
|
2472
|
-
};
|
|
2473
|
-
// Set up the IntersectionObserver
|
|
2474
|
-
const observer = new IntersectionObserver(this.onIntersection.bind(this), options);
|
|
2475
|
-
observer.observe(this.element.nativeElement);
|
|
2476
|
-
}
|
|
2477
|
-
/**
|
|
2478
|
-
* This function gets called just before the user scrolls this component into view
|
|
2479
|
-
* @param entries - An array of interswection observer entries
|
|
2480
|
-
* @param observer - Intersection observer
|
|
2481
|
-
*/
|
|
2482
|
-
onIntersection(entries, observer) {
|
|
2483
|
-
entries.forEach((entry) => {
|
|
2484
|
-
if (entry.isIntersecting) {
|
|
2485
|
-
// Initialise swiper
|
|
2486
|
-
this.initSwiper();
|
|
2487
|
-
observer.unobserve(entry.target);
|
|
2488
|
-
}
|
|
2489
|
-
});
|
|
2490
|
-
}
|
|
2491
|
-
getStyle(element, style) {
|
|
2492
|
-
return this.document.defaultView.getComputedStyle(element, null).getPropertyValue(style);
|
|
2493
|
-
}
|
|
2494
|
-
/**
|
|
2495
|
-
* Set the scrollbar placement and width based on carouselscrollbarplaceholder and carouselctastack
|
|
2496
|
-
*/
|
|
2497
|
-
setupScrollbarLayoutProperties() {
|
|
2498
|
-
if (this.carousel_pagination === 'none') {
|
|
2499
|
-
return;
|
|
2500
|
-
}
|
|
2501
|
-
const carouselStack = this.carouselctastack?.nativeElement;
|
|
2502
|
-
const scrollbarElement = this.carouselscrollbarplaceholder?.nativeElement;
|
|
2503
|
-
const scrollbarHeight = this.document.defaultView
|
|
2504
|
-
.getComputedStyle(document.documentElement)
|
|
2505
|
-
.getPropertyValue('--swiper-scrollbar-size');
|
|
2506
|
-
if (carouselStack && this.carousel_pagination === 'scroll-arrows') {
|
|
2507
|
-
this.element?.nativeElement?.style?.setProperty('--ui-carousel-scrollbar-width', `${scrollbarElement?.offsetWidth - parseInt(this.getStyle(carouselStack, 'gap'), 10)}px`);
|
|
2508
|
-
this.element?.nativeElement?.style?.setProperty('--ui-carousel-scrollbar-offset-top', `${parseInt(this.getStyle(carouselStack, 'gap'), 10) + scrollbarElement?.offsetHeight / 2 + parseInt(scrollbarHeight, 10) / 2}px`);
|
|
2509
|
-
this.element?.nativeElement?.style?.setProperty('--ui-carousel-scrollbar-height', '2px');
|
|
2510
|
-
}
|
|
2511
|
-
if (carouselStack && this.carousel_pagination === 'scroll-bar') {
|
|
2512
|
-
this.element?.nativeElement?.style?.setProperty('--ui-carousel-scrollbar-width', '100%');
|
|
2513
|
-
this.element?.nativeElement?.style?.setProperty('--ui-carousel-scrollbar-offset-top', `${this.offset_scrollbar_top ? parseInt(this.getStyle(carouselStack, 'gap'), 10) + 'px' : '0px'}`);
|
|
2514
|
-
this.element?.nativeElement?.style?.setProperty('--ui-carousel-scrollbar-height', '4px');
|
|
2515
|
-
this.element?.nativeElement?.style?.setProperty('--ui-carousel-scrollbar-left', '0px');
|
|
2516
|
-
}
|
|
2517
|
-
}
|
|
2518
|
-
/**
|
|
2519
|
-
* Set the dynamic swiper params and initialise the swiper instance
|
|
2520
|
-
*/
|
|
2521
|
-
// eslint-disable-next-line complexity
|
|
2522
|
-
initSwiper() {
|
|
2523
|
-
// Colour overides
|
|
2524
|
-
const scrollbarBackgroundColour = this.tokenService.getTokenValue('--oasys-color-linen-grey-200');
|
|
2525
|
-
const scrollbarSliderColour = this.tokenService.getTokenValue('--oasys-color-brand-foreground-primary');
|
|
2526
|
-
// swiper element
|
|
2527
|
-
const swiperEl = this.swiper.nativeElement;
|
|
2528
|
-
const carouselGap = this.tokenService.getTokenValue(`--oasys-spacing-${this.carousel_gap}`);
|
|
2529
|
-
// swiper parameters
|
|
2530
|
-
const swiperParams = {
|
|
2531
|
-
rewind: this.rewind,
|
|
2532
|
-
grabCursor: true,
|
|
2533
|
-
spaceBetween: parseInt(carouselGap.replace('.', ''), 10) || 0,
|
|
2534
|
-
centeredSlides: this.center_active_slide,
|
|
2535
|
-
initialSlide: this.start_slide,
|
|
2536
|
-
scrollbar: {
|
|
2537
|
-
enabled: this.carousel_pagination === 'scroll-arrows' || this.carousel_pagination === 'scroll-bar',
|
|
2538
|
-
draggable: true,
|
|
2539
|
-
},
|
|
2540
|
-
centerInsufficientSlides: this.center_insufficient_slides,
|
|
2541
|
-
freeMode: this.carousel_free_mode
|
|
2542
|
-
? {
|
|
2543
|
-
enabled: true,
|
|
2544
|
-
sticky: true,
|
|
2545
|
-
momentumVelocityRatio: 0.75,
|
|
2546
|
-
momentumRatio: 0.75,
|
|
2547
|
-
}
|
|
2548
|
-
: false,
|
|
2549
|
-
mousewheel: this.carousel_free_mode
|
|
2550
|
-
? {
|
|
2551
|
-
forceToAxis: true,
|
|
2552
|
-
}
|
|
2553
|
-
: false,
|
|
2554
|
-
injectStyles: [
|
|
2555
|
-
`
|
|
2556
|
-
.swiper {
|
|
2557
|
-
overflow: ${this.carousel_overflow ? 'visible' : 'hidden'} !important;
|
|
2558
|
-
}
|
|
2559
|
-
|
|
2560
|
-
.swiper-scrollbar.swiper-scrollbar-horizontal {
|
|
2561
|
-
position: relative;
|
|
2562
|
-
top: var(--ui-carousel-scrollbar-offset-top);
|
|
2563
|
-
width: var(--ui-carousel-scrollbar-width);
|
|
2564
|
-
height: var(--ui-carousel-scrollbar-height);
|
|
2565
|
-
left: ${this.carousel_pagination === 'scroll-bar' ? 'var(--ui-carousel-scrollbar-left)' : '1%'};
|
|
2566
|
-
background: ${scrollbarBackgroundColour}
|
|
2567
|
-
}
|
|
2568
|
-
|
|
2569
|
-
.swiper-scrollbar-drag {
|
|
2570
|
-
background: ${scrollbarSliderColour}
|
|
2571
|
-
}`,
|
|
2572
|
-
],
|
|
2573
|
-
breakpoints: {
|
|
2574
|
-
0: {
|
|
2575
|
-
scrollbar: {
|
|
2576
|
-
enabled: this.carousel_pagination === 'scroll-arrows' ||
|
|
2577
|
-
this.carousel_pagination === 'scroll-bar',
|
|
2578
|
-
draggable: true,
|
|
2579
|
-
},
|
|
2580
|
-
slidesPerView: this.carousel_slides_per_view_mobile,
|
|
2581
|
-
grid: {
|
|
2582
|
-
rows: this.carousel_rows_per_row_mobile,
|
|
2583
|
-
fill: 'row',
|
|
2584
|
-
},
|
|
2585
|
-
},
|
|
2586
|
-
767: {
|
|
2587
|
-
scrollbar: {
|
|
2588
|
-
enabled: this.carousel_pagination === 'scroll-arrows' ||
|
|
2589
|
-
this.carousel_pagination === 'scroll-bar',
|
|
2590
|
-
draggable: true,
|
|
2591
|
-
},
|
|
2592
|
-
slidesPerView: this.carousel_slides_per_view_tablet,
|
|
2593
|
-
},
|
|
2594
|
-
1080: {
|
|
2595
|
-
scrollbar: {
|
|
2596
|
-
enabled: this.carousel_pagination === 'scroll-arrows' ||
|
|
2597
|
-
this.carousel_pagination === 'scroll-bar',
|
|
2598
|
-
draggable: true,
|
|
2599
|
-
},
|
|
2600
|
-
slidesPerView: this.carousel_slides_per_view_laptop,
|
|
2601
|
-
},
|
|
2602
|
-
1440: {
|
|
2603
|
-
scrollbar: {
|
|
2604
|
-
enabled: this.carousel_pagination === 'scroll-arrows' ||
|
|
2605
|
-
this.carousel_pagination === 'scroll-bar',
|
|
2606
|
-
draggable: true,
|
|
2607
|
-
},
|
|
2608
|
-
slidesPerView: this.carousel_slides_per_view_desktop,
|
|
2609
|
-
},
|
|
2610
|
-
},
|
|
2611
|
-
on: {
|
|
2612
|
-
slideChange: this.onSlideChange.bind(this),
|
|
2613
|
-
},
|
|
2614
|
-
};
|
|
2615
|
-
// now we need to assign all parameters to the Swiper element
|
|
2616
|
-
Object.assign(swiperEl, swiperParams);
|
|
2617
|
-
// and now initialize it
|
|
2618
|
-
swiperEl.initialize();
|
|
2619
|
-
// Set up scrollbar and ensure this is recalculated on resize events
|
|
2620
|
-
this.setupScrollbarLayoutProperties();
|
|
2621
|
-
swiperEl.addEventListener('resize', () => {
|
|
2622
|
-
this.setupScrollbarLayoutProperties();
|
|
2623
|
-
});
|
|
2624
|
-
}
|
|
2625
|
-
/**
|
|
2626
|
-
* Move the carousel on to the next slide
|
|
2627
|
-
*/
|
|
2628
|
-
nextSlide() {
|
|
2629
|
-
this.swiper.nativeElement.swiper.slideNext();
|
|
2630
|
-
}
|
|
2631
|
-
/**
|
|
2632
|
-
* Move the carousel back to the previous slide
|
|
2633
|
-
*/
|
|
2634
|
-
previousSlide() {
|
|
2635
|
-
this.swiper.nativeElement.swiper.slidePrev();
|
|
2636
|
-
}
|
|
2637
|
-
/**
|
|
2638
|
-
* Emit event when the slide changes
|
|
2639
|
-
* @param swiper
|
|
2640
|
-
*/
|
|
2641
|
-
onSlideChange(swiper) {
|
|
2642
|
-
this.activeIndexOnSlideChange.emit(swiper.activeIndex);
|
|
2643
|
-
}
|
|
2644
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CarouselComponent, deps: [{ token: TokenService }, { token: DOCUMENT }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2645
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: CarouselComponent, isStandalone: true, selector: "ui-carousel", inputs: { rewind: "rewind", carousel_overflow: "carousel_overflow", carousel_gap: "carousel_gap", carousel_pagination: "carousel_pagination", carousel_slides_per_view_desktop: "carousel_slides_per_view_desktop", carousel_slides_per_view_laptop: "carousel_slides_per_view_laptop", carousel_slides_per_view_tablet: "carousel_slides_per_view_tablet", carousel_slides_per_view_mobile: "carousel_slides_per_view_mobile", text_for_left_arrow: "text_for_left_arrow", text_for_right_arrow: "text_for_right_arrow", carousel_rows_per_row_mobile: "carousel_rows_per_row_mobile", carousel_loading: "carousel_loading", carousel_free_mode: "carousel_free_mode", center_insufficient_slides: "center_insufficient_slides", center_active_slide: "center_active_slide", start_slide: "start_slide", offset_scrollbar_top: "offset_scrollbar_top" }, outputs: { activeIndexOnSlideChange: "activeIndexOnSlideChange" }, providers: [TokenService], viewQueries: [{ propertyName: "swiper", first: true, predicate: ["swiper"], descendants: true, static: true }, { propertyName: "carouselscrollbarplaceholder", first: true, predicate: ["carouselscrollbarplaceholder"], descendants: true, read: ElementRef }, { propertyName: "carouselctastack", first: true, predicate: ["carouselctastack"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ui-box\n class=\"ui-carousel\"\n [ngClass]=\"{ 'ui-carousel-overflow': carousel_overflow }\"\n box_align_y=\"center\"\n box_space=\"none\"\n [box_content_fill_width]=\"true\"\n box_background=\"transparent\"\n>\n <ui-stack #carouselctastack>\n <!-- Custom navigation buttons -->\n <ui-stack\n *ngIf=\"carousel_pagination === 'small-arrows'\"\n stack_direction=\"x\"\n stack_align=\"center\"\n stack_distribute=\"end\"\n >\n <ui-box\n box_space=\"none\"\n box_fill_mode=\"fit\"\n box_space_bottom=\"none\"\n [box_space_right]=\"{ mobile: 'tight', tablet: 'none', laptop: 'none', desktop: 'none' }\"\n box_background=\"transparent\"\n >\n <div\n *ngIf=\"!(swiper?.swiper?.isBeginning && swiper?.swiper?.isEnd)\"\n class=\"ui-carousel__small-arrows\"\n >\n <!-- Previous button-->\n <ui-button\n class=\"ui-carousel__previous\"\n button_size=\"small\"\n button_icon_placement=\"iconOnly\"\n button_icon=\"arrow-left\"\n button_type=\"tertiary\"\n [aria_label]=\"text_for_left_arrow\"\n (clicked)=\"previousSlide()\"\n >\n Prevous slide\n </ui-button>\n <!-- Next button-->\n <ui-button\n class=\"ui-carousel__next\"\n button_size=\"small\"\n button_icon_placement=\"iconOnly\"\n button_icon=\"arrow-right\"\n button_type=\"tertiary\"\n [aria_label]=\"text_for_right_arrow\"\n (clicked)=\"nextSlide()\"\n >\n Next slide\n </ui-button>\n </div>\n </ui-box>\n </ui-stack>\n\n <!-- Swiper WebComponent-->\n <swiper-container\n #swiper\n init=\"false\"\n touch-start-prevent-default=\"false\"\n prevent-clicks-propagation=\"true\"\n >\n <ng-content></ng-content>\n </swiper-container>\n\n <!-- Custom navigation buttons -->\n <ui-stack\n stack_direction=\"x\"\n stack_align=\"center\"\n *ngIf=\"carousel_pagination === 'scroll-arrows' || carousel_pagination === 'scroll-bar'\"\n >\n <div class=\"ui-carousel-scrollbar-placeholder\" #carouselscrollbarplaceholder></div>\n <ui-box\n *ngIf=\"carousel_pagination === 'scroll-arrows'\"\n box_space=\"none\"\n box_fill_mode=\"fit\"\n [box_space_right]=\"{ mobile: 'tight', tablet: 'none', laptop: 'none', desktop: 'none' }\"\n box_background=\"transparent\"\n >\n <ui-stack\n *ngIf=\"!(swiper?.swiper?.isBeginning && swiper?.swiper?.isEnd)\"\n stack_direction=\"x\"\n stack_gap=\"near\"\n >\n <!-- Previous button-->\n <ui-button\n class=\"ui-carousel__previous\"\n button_size=\"large\"\n button_icon_placement=\"iconOnly\"\n button_icon=\"arrow-left\"\n button_type=\"secondary\"\n [aria_label]=\"text_for_left_arrow\"\n (clicked)=\"previousSlide()\"\n >\n Prevous slide\n </ui-button>\n <!-- Next button-->\n <ui-button\n class=\"ui-carousel__next\"\n button_size=\"large\"\n button_icon_placement=\"iconOnly\"\n button_icon=\"arrow-right\"\n button_type=\"secondary\"\n [aria_label]=\"text_for_right_arrow\"\n (clicked)=\"nextSlide()\"\n >\n Next slide\n </ui-button>\n </ui-stack>\n </ui-box>\n </ui-stack>\n </ui-stack>\n</ui-box>\n", styles: [":root{--swiper-scrollbar-size: 4px}.ui-carousel{touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.ui-carousel swiper-container{width:100%}.ui-carousel .ui-carousel-scrollbar-placeholder{width:100%;display:flex;align-self:stretch}.ui-carousel swiper-slide img{-webkit-user-drag:none}.ui-carousel__small-arrows{align-items:center;display:flex;flex-direction:row;gap:var(--oasys-spacing-near);justify-content:center}@media only screen and (max-width:766px){.ui-carousel__small-arrows{gap:var(--oasys-spacing-tight)}}\n"], dependencies: [{ kind: "component", type: LayoutBoxComponent, selector: "ui-box", inputs: ["box_space", "box_role", "box_space_top", "box_space_right", "box_space_bottom", "box_space_left", "box_align_x", "box_align_y", "box_fill_mode", "box_background", "box_content_fill_width", "box_border_color", "box_border_width", "box_border_style", "box_border_radius"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: LayoutStackComponent, selector: "ui-stack", inputs: ["stack_gap", "stack_align", "stack_direction", "stack_distribute", "stack_wrap", "stack_collapse_below", "stack_as_list"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OasysButtonComponent, selector: "ui-button", inputs: ["button_icon", "button_icon_placement", "button_size", "button_type", "button_full_width", "button_event_type", "button_disabled", "button_selected", "button_text_nowrap", "aria_label", "aria_role", "href", "routerLink"], outputs: ["clicked"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
2646
|
-
}
|
|
2647
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CarouselComponent, decorators: [{
|
|
2648
|
-
type: Component,
|
|
2649
|
-
args: [{ selector: 'ui-carousel', encapsulation: ViewEncapsulation.None, standalone: true, imports: [LayoutBoxComponent, NgClass, LayoutStackComponent, NgIf, OasysButtonComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA], providers: [TokenService], template: "<ui-box\n class=\"ui-carousel\"\n [ngClass]=\"{ 'ui-carousel-overflow': carousel_overflow }\"\n box_align_y=\"center\"\n box_space=\"none\"\n [box_content_fill_width]=\"true\"\n box_background=\"transparent\"\n>\n <ui-stack #carouselctastack>\n <!-- Custom navigation buttons -->\n <ui-stack\n *ngIf=\"carousel_pagination === 'small-arrows'\"\n stack_direction=\"x\"\n stack_align=\"center\"\n stack_distribute=\"end\"\n >\n <ui-box\n box_space=\"none\"\n box_fill_mode=\"fit\"\n box_space_bottom=\"none\"\n [box_space_right]=\"{ mobile: 'tight', tablet: 'none', laptop: 'none', desktop: 'none' }\"\n box_background=\"transparent\"\n >\n <div\n *ngIf=\"!(swiper?.swiper?.isBeginning && swiper?.swiper?.isEnd)\"\n class=\"ui-carousel__small-arrows\"\n >\n <!-- Previous button-->\n <ui-button\n class=\"ui-carousel__previous\"\n button_size=\"small\"\n button_icon_placement=\"iconOnly\"\n button_icon=\"arrow-left\"\n button_type=\"tertiary\"\n [aria_label]=\"text_for_left_arrow\"\n (clicked)=\"previousSlide()\"\n >\n Prevous slide\n </ui-button>\n <!-- Next button-->\n <ui-button\n class=\"ui-carousel__next\"\n button_size=\"small\"\n button_icon_placement=\"iconOnly\"\n button_icon=\"arrow-right\"\n button_type=\"tertiary\"\n [aria_label]=\"text_for_right_arrow\"\n (clicked)=\"nextSlide()\"\n >\n Next slide\n </ui-button>\n </div>\n </ui-box>\n </ui-stack>\n\n <!-- Swiper WebComponent-->\n <swiper-container\n #swiper\n init=\"false\"\n touch-start-prevent-default=\"false\"\n prevent-clicks-propagation=\"true\"\n >\n <ng-content></ng-content>\n </swiper-container>\n\n <!-- Custom navigation buttons -->\n <ui-stack\n stack_direction=\"x\"\n stack_align=\"center\"\n *ngIf=\"carousel_pagination === 'scroll-arrows' || carousel_pagination === 'scroll-bar'\"\n >\n <div class=\"ui-carousel-scrollbar-placeholder\" #carouselscrollbarplaceholder></div>\n <ui-box\n *ngIf=\"carousel_pagination === 'scroll-arrows'\"\n box_space=\"none\"\n box_fill_mode=\"fit\"\n [box_space_right]=\"{ mobile: 'tight', tablet: 'none', laptop: 'none', desktop: 'none' }\"\n box_background=\"transparent\"\n >\n <ui-stack\n *ngIf=\"!(swiper?.swiper?.isBeginning && swiper?.swiper?.isEnd)\"\n stack_direction=\"x\"\n stack_gap=\"near\"\n >\n <!-- Previous button-->\n <ui-button\n class=\"ui-carousel__previous\"\n button_size=\"large\"\n button_icon_placement=\"iconOnly\"\n button_icon=\"arrow-left\"\n button_type=\"secondary\"\n [aria_label]=\"text_for_left_arrow\"\n (clicked)=\"previousSlide()\"\n >\n Prevous slide\n </ui-button>\n <!-- Next button-->\n <ui-button\n class=\"ui-carousel__next\"\n button_size=\"large\"\n button_icon_placement=\"iconOnly\"\n button_icon=\"arrow-right\"\n button_type=\"secondary\"\n [aria_label]=\"text_for_right_arrow\"\n (clicked)=\"nextSlide()\"\n >\n Next slide\n </ui-button>\n </ui-stack>\n </ui-box>\n </ui-stack>\n </ui-stack>\n</ui-box>\n", styles: [":root{--swiper-scrollbar-size: 4px}.ui-carousel{touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.ui-carousel swiper-container{width:100%}.ui-carousel .ui-carousel-scrollbar-placeholder{width:100%;display:flex;align-self:stretch}.ui-carousel swiper-slide img{-webkit-user-drag:none}.ui-carousel__small-arrows{align-items:center;display:flex;flex-direction:row;gap:var(--oasys-spacing-near);justify-content:center}@media only screen and (max-width:766px){.ui-carousel__small-arrows{gap:var(--oasys-spacing-tight)}}\n"] }]
|
|
2650
|
-
}], ctorParameters: () => [{ type: TokenService }, { type: Document, decorators: [{
|
|
2651
|
-
type: Inject,
|
|
2652
|
-
args: [DOCUMENT]
|
|
2653
|
-
}] }, { type: i0.ElementRef }], propDecorators: { swiper: [{
|
|
2654
|
-
type: ViewChild,
|
|
2655
|
-
args: ['swiper', { static: true }]
|
|
2656
|
-
}], carouselscrollbarplaceholder: [{
|
|
2657
|
-
type: ViewChild,
|
|
2658
|
-
args: ['carouselscrollbarplaceholder', { static: false, read: ElementRef }]
|
|
2659
|
-
}], carouselctastack: [{
|
|
2660
|
-
type: ViewChild,
|
|
2661
|
-
args: ['carouselctastack', { static: false, read: ElementRef }]
|
|
2662
|
-
}], rewind: [{
|
|
2663
|
-
type: Input
|
|
2664
|
-
}], carousel_overflow: [{
|
|
2665
|
-
type: Input
|
|
2666
|
-
}], carousel_gap: [{
|
|
2667
|
-
type: Input
|
|
2668
|
-
}], carousel_pagination: [{
|
|
2669
|
-
type: Input
|
|
2670
|
-
}], carousel_slides_per_view_desktop: [{
|
|
2671
|
-
type: Input
|
|
2672
|
-
}], carousel_slides_per_view_laptop: [{
|
|
2673
|
-
type: Input
|
|
2674
|
-
}], carousel_slides_per_view_tablet: [{
|
|
2675
|
-
type: Input
|
|
2676
|
-
}], carousel_slides_per_view_mobile: [{
|
|
2677
|
-
type: Input
|
|
2678
|
-
}], text_for_left_arrow: [{
|
|
2679
|
-
type: Input
|
|
2680
|
-
}], text_for_right_arrow: [{
|
|
2681
|
-
type: Input
|
|
2682
|
-
}], carousel_rows_per_row_mobile: [{
|
|
2683
|
-
type: Input
|
|
2684
|
-
}], carousel_loading: [{
|
|
2685
|
-
type: Input
|
|
2686
|
-
}], carousel_free_mode: [{
|
|
2687
|
-
type: Input
|
|
2688
|
-
}], center_insufficient_slides: [{
|
|
2689
|
-
type: Input
|
|
2690
|
-
}], center_active_slide: [{
|
|
2691
|
-
type: Input
|
|
2692
|
-
}], start_slide: [{
|
|
2693
|
-
type: Input
|
|
2694
|
-
}], offset_scrollbar_top: [{
|
|
2695
|
-
type: Input
|
|
2696
|
-
}], activeIndexOnSlideChange: [{
|
|
2697
|
-
type: Output
|
|
2698
|
-
}] } });
|
|
2699
|
-
|
|
2700
|
-
/** @deprecated Import the standalone CarouselComponent directly instead. */
|
|
2701
|
-
class OasysCarouselModule {
|
|
2702
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysCarouselModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2703
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: OasysCarouselModule, imports: [CarouselComponent], exports: [CarouselComponent] });
|
|
2704
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysCarouselModule, imports: [CarouselComponent] });
|
|
2705
|
-
}
|
|
2706
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysCarouselModule, decorators: [{
|
|
2707
|
-
type: NgModule,
|
|
2708
|
-
args: [{
|
|
2709
|
-
imports: [CarouselComponent],
|
|
2710
|
-
exports: [CarouselComponent],
|
|
2711
|
-
}]
|
|
2712
|
-
}] });
|
|
2713
|
-
|
|
2714
2328
|
class TextComponent {
|
|
2715
2329
|
textAlign = 'left';
|
|
2716
2330
|
textWeight = 'normal';
|
|
@@ -4174,98 +3788,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4174
3788
|
}]
|
|
4175
3789
|
}] });
|
|
4176
3790
|
|
|
4177
|
-
const THEME_VALUE = {
|
|
4178
|
-
DEFAULT: 'default',
|
|
4179
|
-
TIER_1: 'loyalty-tier-1',
|
|
4180
|
-
TIER_2: 'loyalty-tier-2',
|
|
4181
|
-
};
|
|
4182
|
-
const SCOPED_THEME_CLASSES = [THEME_VALUE.TIER_1, THEME_VALUE.TIER_2];
|
|
4183
|
-
class OasysThemeDirective {
|
|
4184
|
-
uiThemeDashed = input(THEME_VALUE.DEFAULT, ...(ngDevMode ? [{ debugName: "uiThemeDashed", alias: 'ui-theme' }] : [{ alias: 'ui-theme' }]));
|
|
4185
|
-
uiThemeCamel = input(undefined, ...(ngDevMode ? [{ debugName: "uiThemeCamel", alias: 'uiTheme' }] : [{ alias: 'uiTheme' }]));
|
|
4186
|
-
elementRef = inject(ElementRef);
|
|
4187
|
-
appliedDefaultBrandClass;
|
|
4188
|
-
appliedTheme;
|
|
4189
|
-
constructor() {
|
|
4190
|
-
effect(() => {
|
|
4191
|
-
const nextTheme = this.uiThemeCamel() ?? this.uiThemeDashed();
|
|
4192
|
-
this.applyTheme(nextTheme);
|
|
4193
|
-
});
|
|
4194
|
-
}
|
|
4195
|
-
applyTheme(nextTheme) {
|
|
4196
|
-
if (nextTheme === this.appliedTheme)
|
|
4197
|
-
return;
|
|
4198
|
-
const host = this.elementRef.nativeElement;
|
|
4199
|
-
const classList = host.classList;
|
|
4200
|
-
if (nextTheme !== THEME_VALUE.DEFAULT) {
|
|
4201
|
-
// Remove previously applied default reset class.
|
|
4202
|
-
if (this.appliedDefaultBrandClass) {
|
|
4203
|
-
classList.remove(this.appliedDefaultBrandClass);
|
|
4204
|
-
this.appliedDefaultBrandClass = undefined;
|
|
4205
|
-
}
|
|
4206
|
-
// Remove all scoped theme classes before applying the next one.
|
|
4207
|
-
SCOPED_THEME_CLASSES.forEach((themeClass) => {
|
|
4208
|
-
classList.remove(themeClass);
|
|
4209
|
-
});
|
|
4210
|
-
if (!classList.contains(nextTheme))
|
|
4211
|
-
classList.add(nextTheme);
|
|
4212
|
-
this.appliedTheme = nextTheme;
|
|
4213
|
-
return;
|
|
4214
|
-
}
|
|
4215
|
-
SCOPED_THEME_CLASSES.forEach((themeClass) => {
|
|
4216
|
-
classList.remove(themeClass);
|
|
4217
|
-
});
|
|
4218
|
-
const defaultBrandClass = this.findNearestBrandTokenClass(host);
|
|
4219
|
-
if (defaultBrandClass) {
|
|
4220
|
-
if (this.appliedDefaultBrandClass && this.appliedDefaultBrandClass !== defaultBrandClass) {
|
|
4221
|
-
classList.remove(this.appliedDefaultBrandClass);
|
|
4222
|
-
}
|
|
4223
|
-
classList.add(defaultBrandClass);
|
|
4224
|
-
this.appliedDefaultBrandClass = defaultBrandClass;
|
|
4225
|
-
}
|
|
4226
|
-
else if (this.appliedDefaultBrandClass) {
|
|
4227
|
-
classList.remove(this.appliedDefaultBrandClass);
|
|
4228
|
-
this.appliedDefaultBrandClass = undefined;
|
|
4229
|
-
}
|
|
4230
|
-
this.appliedTheme = nextTheme;
|
|
4231
|
-
}
|
|
4232
|
-
findNearestBrandTokenClass(host) {
|
|
4233
|
-
let node = host.parentElement;
|
|
4234
|
-
while (node) {
|
|
4235
|
-
const classList = node.classList;
|
|
4236
|
-
for (let i = 0; i < classList.length; i += 1) {
|
|
4237
|
-
const className = classList.item(i);
|
|
4238
|
-
if (className?.startsWith('brand-tokens-'))
|
|
4239
|
-
return className;
|
|
4240
|
-
}
|
|
4241
|
-
node = node.parentElement;
|
|
4242
|
-
}
|
|
4243
|
-
return undefined;
|
|
4244
|
-
}
|
|
4245
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysThemeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4246
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.25", type: OasysThemeDirective, isStandalone: true, selector: "[ui-theme], [uiTheme]", inputs: { uiThemeDashed: { classPropertyName: "uiThemeDashed", publicName: "ui-theme", isSignal: true, isRequired: false, transformFunction: null }, uiThemeCamel: { classPropertyName: "uiThemeCamel", publicName: "uiTheme", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
4247
|
-
}
|
|
4248
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysThemeDirective, decorators: [{
|
|
4249
|
-
type: Directive,
|
|
4250
|
-
args: [{
|
|
4251
|
-
selector: '[ui-theme], [uiTheme]',
|
|
4252
|
-
standalone: true,
|
|
4253
|
-
}]
|
|
4254
|
-
}], ctorParameters: () => [], propDecorators: { uiThemeDashed: [{ type: i0.Input, args: [{ isSignal: true, alias: "ui-theme", required: false }] }], uiThemeCamel: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiTheme", required: false }] }] } });
|
|
4255
|
-
|
|
4256
|
-
class OasysDirectivesModule {
|
|
4257
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4258
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: OasysDirectivesModule, imports: [OasysHrefDirective, OasysAutofocusDirective, OasysThemeDirective], exports: [OasysHrefDirective, OasysAutofocusDirective, OasysThemeDirective] });
|
|
4259
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysDirectivesModule });
|
|
4260
|
-
}
|
|
4261
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OasysDirectivesModule, decorators: [{
|
|
4262
|
-
type: NgModule,
|
|
4263
|
-
args: [{
|
|
4264
|
-
imports: [OasysHrefDirective, OasysAutofocusDirective, OasysThemeDirective],
|
|
4265
|
-
exports: [OasysHrefDirective, OasysAutofocusDirective, OasysThemeDirective],
|
|
4266
|
-
}]
|
|
4267
|
-
}] });
|
|
4268
|
-
|
|
4269
3791
|
/*
|
|
4270
3792
|
* Public API Surface of oasys-lib
|
|
4271
3793
|
*/
|
|
@@ -4274,5 +3796,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4274
3796
|
* Generated bundle index. Do not edit.
|
|
4275
3797
|
*/
|
|
4276
3798
|
|
|
4277
|
-
export { BannerComponent, BreadcrumbsComponent, CardComponent,
|
|
3799
|
+
export { BannerComponent, BreadcrumbsComponent, CardComponent, CheckboxComponent, ChipComponent, DividerComponent, FormErrorsComponent, FormGroupComponent, HeroComponent, IMAGE_BREAKPOINTS, IMAGE_URL_PROVIDER, IconComponent, ImageComponent, LayoutBoxComponent, LayoutContainerComponent, LayoutGridColumnComponent, LayoutGridComponent, LayoutStackComponent, OasysAlertCancelDirective, OasysAlertComponent, OasysAlertConfirmDirective, OasysAlertContentDirective, OasysAlertModule, OasysAlertTitleDirective, BannerComponent as OasysBannerComponent, OasysBannerModule, OasysBreadcrumbModule, BreadcrumbsComponent as OasysBreadcrumbsComponent, OasysButtonComponent, OasysButtonGroupComponent, OasysButtonGroupModule, OasysButtonModule, CardComponent as OasysCardComponent, OasysCardModule, CheckboxComponent as OasysCheckboxComponent, OasysCheckboxModule, ChipComponent as OasysChipComponent, OasysChipModule, OasysComboboxComponent, DividerComponent as OasysDividerComponent, OasysDividerModule, FormErrorsComponent as OasysFormErrorsComponent, OasysFormErrorsModule, OasysFormErrorsSummaryComponent, OasysFormErrorsSummaryItemComponent, OasysFormErrorsSummaryTitleComponent, FormGroupComponent as OasysFormGroupComponent, OasysFormGroupModule, OasysHeadingComponent, OasysHeadingModule, HeroComponent as OasysHeroComponent, OasysHeroModule, IconComponent as OasysIconComponent, OasysIconModule, ImageComponent as OasysImageComponent, OasysImageModule, LayoutBoxComponent as OasysLayoutBoxComponent, LayoutContainerComponent as OasysLayoutContainerComponent, LayoutGridColumnComponent as OasysLayoutGridColumnComponent, LayoutGridComponent as OasysLayoutGridComponent, OasysLayoutModule, LayoutStackComponent as OasysLayoutStackComponent, OasysPillComponent, OasysPillGroupComponent, OasysPillGroupModule, OasysPillModule, ProgressBarComponent as OasysProgressBarComponent, PromoCardComponent as OasysPromoCardComponent, OasysPromoCardModule, RadioComponent as OasysRadioComponent, OasysRadioModule, SectionComponent as OasysSectionComponent, SelectCardComponent as OasysSelectCardComponent, OasysSelectCardModule, OasysTabComponent, OasysTabGroupComponent, OasysTabsModule, TextComponent as OasysTextComponent, TextInputComponent as OasysTextInputComponent, OasysTextInputModule, OasysTextModule, TextareaComponent as OasysTextareaComponent, ProgressBarComponent, PromoCardComponent, ROUTING_HANDLER, RadioComponent, SWIPER_PROVIDER_TOKEN, SectionComponent, SectionModule, SelectCardComponent, SwiperProvider, TextComponent, TextareaComponent };
|
|
4278
3800
|
//# sourceMappingURL=oasys-lib.mjs.map
|