@coreui/angular 4.7.7 → 4.7.10

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,15 +1,15 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Input, NgModule, HostBinding, Injectable, Component, EventEmitter, Output, booleanAttribute, ContentChildren, HostListener, inject, RendererFactory2, Inject, ViewChild, forwardRef, Optional, ElementRef, ContentChild, DestroyRef, signal, effect, PLATFORM_ID, TemplateRef, ViewContainerRef, numberAttribute, Pipe, ChangeDetectionStrategy } from '@angular/core';
2
+ import { Directive, Input, NgModule, HostBinding, Injectable, Component, EventEmitter, Output, booleanAttribute, ContentChildren, HostListener, inject, RendererFactory2, PLATFORM_ID, Inject, DestroyRef, ViewChild, forwardRef, Optional, ElementRef, ContentChild, signal, effect, TemplateRef, ViewContainerRef, numberAttribute, Pipe, ChangeDetectionStrategy } from '@angular/core';
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
4
4
  import * as i3$1 from '@angular/common';
5
- import { NgTemplateOutlet, NgIf, NgClass, DOCUMENT, NgForOf, AsyncPipe, isPlatformBrowser, CommonModule, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault } from '@angular/common';
5
+ import { NgTemplateOutlet, NgIf, NgClass, DOCUMENT, NgForOf, AsyncPipe, isPlatformServer, isPlatformBrowser, CommonModule, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault } from '@angular/common';
6
6
  import * as i1 from '@angular/animations';
7
7
  import { animate, animation, style, useAnimation, state, transition, trigger, query, group } from '@angular/animations';
8
- import { Subject, BehaviorSubject, Observable, fromEvent, withLatestFrom, zipWith } from 'rxjs';
8
+ import { Subject, BehaviorSubject, Observable, fromEvent } from 'rxjs';
9
9
  import * as i1$1 from '@angular/router';
10
10
  import { RouterModule, NavigationEnd, RouterLink } from '@angular/router';
11
11
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
12
- import { filter, debounceTime } from 'rxjs/operators';
12
+ import { filter, finalize, withLatestFrom, zipWith, debounceTime } from 'rxjs/operators';
13
13
  import { createPopper } from '@popperjs/core';
14
14
  import * as i1$2 from '@angular/cdk/layout';
15
15
  import * as i3 from '@angular/cdk/a11y';
@@ -1083,7 +1083,8 @@ class BackdropService {
1083
1083
  get #scrollbarWidth() {
1084
1084
  // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
1085
1085
  const documentWidth = this.#document.documentElement.clientWidth;
1086
- const scrollbarWidth = Math.abs((window?.innerWidth ?? documentWidth) - documentWidth);
1086
+ // const scrollbarWidth = Math.abs((window?.innerWidth ?? documentWidth) - documentWidth);
1087
+ const scrollbarWidth = Math.abs((this.#document.defaultView?.innerWidth ?? documentWidth) - documentWidth);
1087
1088
  return `${scrollbarWidth}px`;
1088
1089
  }
1089
1090
  setBackdrop(type = 'modal') {
@@ -1762,34 +1763,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
1762
1763
 
1763
1764
  class IntersectionService {
1764
1765
  constructor() {
1765
- this.intersecting = new BehaviorSubject(false);
1766
- this.intersecting$ = this.intersecting.asObservable();
1766
+ this.platformId = inject(PLATFORM_ID);
1767
+ this.#intersecting = new BehaviorSubject({ isIntersecting: false });
1768
+ this.intersecting$ = this.#intersecting.asObservable();
1767
1769
  this.defaultObserverOptions = {
1768
1770
  root: null,
1769
1771
  rootMargin: '0px',
1770
1772
  threshold: 0.2
1771
1773
  };
1774
+ this.hostElementRefs = new Map();
1772
1775
  }
1776
+ #intersecting;
1773
1777
  createIntersectionObserver(hostElement, observerOptions = this.defaultObserverOptions) {
1778
+ if (isPlatformServer(this.platformId)) {
1779
+ this.#intersecting.next({ isIntersecting: true, hostElement });
1780
+ return;
1781
+ }
1774
1782
  const options = { ...this.defaultObserverOptions, ...observerOptions };
1775
- this.hostElement = hostElement;
1776
1783
  const handleIntersect = (entries, observer) => {
1777
1784
  entries.forEach((entry) => {
1778
- this.intersecting.next(entry.isIntersecting);
1785
+ this.#intersecting.next({ isIntersecting: entry.isIntersecting, hostElement });
1779
1786
  });
1780
1787
  };
1781
- this.intersectionObserver = new IntersectionObserver(handleIntersect, options);
1782
- this.intersectionObserver.observe(hostElement.nativeElement);
1788
+ this.hostElementRefs.set(hostElement, new IntersectionObserver(handleIntersect, options));
1789
+ this.hostElementRefs.get(hostElement)?.observe(hostElement.nativeElement);
1790
+ }
1791
+ unobserve(elementRef) {
1792
+ this.hostElementRefs.get(elementRef)?.unobserve(elementRef.nativeElement);
1793
+ this.hostElementRefs.set(elementRef, null);
1794
+ this.hostElementRefs.delete(elementRef);
1783
1795
  }
1784
1796
  ngOnDestroy() {
1785
- this.intersectionObserver?.unobserve(this.hostElement?.nativeElement);
1797
+ this.hostElementRefs.forEach((observer, elementRef) => {
1798
+ observer?.unobserve(elementRef.nativeElement);
1799
+ });
1786
1800
  }
1787
1801
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IntersectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1788
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IntersectionService }); }
1802
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IntersectionService, providedIn: 'root' }); }
1789
1803
  }
1790
1804
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IntersectionService, decorators: [{
1791
- type: Injectable
1792
- }], ctorParameters: () => [] });
1805
+ type: Injectable,
1806
+ args: [{
1807
+ providedIn: 'root'
1808
+ }]
1809
+ }] });
1793
1810
 
1794
1811
  class ListenersService {
1795
1812
  constructor(renderer) {
@@ -1830,6 +1847,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
1830
1847
  type: Injectable
1831
1848
  }], ctorParameters: () => [{ type: i0.Renderer2 }] });
1832
1849
 
1850
+ class ClassToggleService {
1851
+ constructor(document, rendererFactory) {
1852
+ this.document = document;
1853
+ this.rendererFactory = rendererFactory;
1854
+ this.renderer = rendererFactory.createRenderer(null, null);
1855
+ }
1856
+ toggle(selector, className) {
1857
+ const element = document.querySelector(selector);
1858
+ if (element) {
1859
+ element.classList.contains(className) ?
1860
+ this.renderer.removeClass(element, className) :
1861
+ this.renderer.addClass(element, className);
1862
+ }
1863
+ }
1864
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ClassToggleService, deps: [{ token: DOCUMENT }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable }); }
1865
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ClassToggleService, providedIn: 'root' }); }
1866
+ }
1867
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ClassToggleService, decorators: [{
1868
+ type: Injectable,
1869
+ args: [{
1870
+ providedIn: 'root'
1871
+ }]
1872
+ }], ctorParameters: () => [{ type: Document, decorators: [{
1873
+ type: Inject,
1874
+ args: [DOCUMENT]
1875
+ }] }, { type: i0.RendererFactory2 }] });
1876
+
1833
1877
  class CarouselService {
1834
1878
  constructor() {
1835
1879
  this.carouselIndex = new BehaviorSubject({});
@@ -1948,6 +1992,7 @@ class CarouselComponent {
1948
1992
  'carousel-fade': this.transition === 'crossfade'
1949
1993
  };
1950
1994
  }
1995
+ #destroyRef;
1951
1996
  constructor(config, hostElement, carouselService, carouselState, intersectionService, listenersService) {
1952
1997
  this.config = config;
1953
1998
  this.hostElement = hostElement;
@@ -2005,6 +2050,7 @@ class CarouselComponent {
2005
2050
  */
2006
2051
  this.itemChange = new EventEmitter();
2007
2052
  this.activeItemInterval = 0;
2053
+ this.#destroyRef = inject(DestroyRef);
2008
2054
  this._visible = true;
2009
2055
  Object.assign(this, config);
2010
2056
  }
@@ -2012,13 +2058,11 @@ class CarouselComponent {
2012
2058
  this.carouselStateSubscribe();
2013
2059
  }
2014
2060
  ngOnDestroy() {
2061
+ this.resetTimer();
2015
2062
  this.clearListeners();
2016
- this.carouselStateSubscribe(false);
2017
- this.intersectionServiceSubscribe(false);
2018
2063
  this.swipeSubscribe(false);
2019
2064
  }
2020
2065
  ngAfterContentInit() {
2021
- this.intersectionService.createIntersectionObserver(this.hostElement);
2022
2066
  this.intersectionServiceSubscribe();
2023
2067
  this.carouselState.state = { activeItemIndex: this.activeIndex, animate: this.animate };
2024
2068
  this.setListeners();
@@ -2058,32 +2102,30 @@ class CarouselComponent {
2058
2102
  }
2059
2103
  resetTimer() {
2060
2104
  clearTimeout(this.timerId);
2105
+ this.timerId = undefined;
2061
2106
  }
2062
- carouselStateSubscribe(subscribe = true) {
2063
- if (subscribe) {
2064
- this.carouselIndexSubscription = this.carouselService.carouselIndex$.subscribe((nextItem) => {
2065
- if ('active' in nextItem) {
2066
- this.itemChange.emit(nextItem.active);
2067
- }
2068
- this.activeItemInterval = typeof nextItem.interval === 'number' && nextItem.interval > -1 ? nextItem.interval : this.interval;
2069
- const isLastItem = ((nextItem.active === nextItem.lastItemIndex) && this.direction === 'next') || ((nextItem.active === 0) && this.direction === 'prev');
2070
- !this.wrap && isLastItem ? this.resetTimer() : this.setTimer();
2071
- });
2072
- }
2073
- else {
2074
- this.carouselIndexSubscription?.unsubscribe();
2075
- }
2107
+ carouselStateSubscribe() {
2108
+ this.carouselService.carouselIndex$
2109
+ .pipe(takeUntilDestroyed(this.#destroyRef))
2110
+ .subscribe((nextItem) => {
2111
+ if ('active' in nextItem) {
2112
+ this.itemChange.emit(nextItem.active);
2113
+ }
2114
+ this.activeItemInterval = typeof nextItem.interval === 'number' && nextItem.interval > -1 ? nextItem.interval : this.interval;
2115
+ const isLastItem = ((nextItem.active === nextItem.lastItemIndex) && this.direction === 'next') || ((nextItem.active === 0) && this.direction === 'prev');
2116
+ !this.wrap && isLastItem ? this.resetTimer() : this.setTimer();
2117
+ });
2076
2118
  }
2077
- intersectionServiceSubscribe(subscribe = true) {
2078
- if (subscribe) {
2079
- this.intersectingSubscription = this.intersectionService.intersecting$.subscribe(isIntersecting => {
2080
- this.visible = isIntersecting;
2081
- isIntersecting ? this.setTimer() : this.resetTimer();
2082
- });
2083
- }
2084
- else {
2085
- this.intersectingSubscription?.unsubscribe();
2086
- }
2119
+ intersectionServiceSubscribe() {
2120
+ this.intersectionService.intersecting$
2121
+ .pipe(filter(next => next.hostElement === this.hostElement), finalize(() => {
2122
+ this.intersectionService.unobserve(this.hostElement);
2123
+ }), takeUntilDestroyed(this.#destroyRef))
2124
+ .subscribe(next => {
2125
+ this.visible = next.isIntersecting;
2126
+ next.isIntersecting ? this.setTimer() : this.resetTimer();
2127
+ });
2128
+ this.intersectionService.createIntersectionObserver(this.hostElement);
2087
2129
  }
2088
2130
  swipeSubscribe(subscribe = true) {
2089
2131
  if (this.touch && subscribe) {
@@ -2091,7 +2133,7 @@ class CarouselComponent {
2091
2133
  const touchStart$ = fromEvent(carouselElement, 'touchstart');
2092
2134
  const touchEnd$ = fromEvent(carouselElement, 'touchend');
2093
2135
  const touchMove$ = fromEvent(carouselElement, 'touchmove');
2094
- this.swipeSubscription = touchStart$.pipe(zipWith(touchEnd$.pipe(withLatestFrom(touchMove$))))
2136
+ this.swipeSubscription = touchStart$.pipe(zipWith(touchEnd$.pipe(withLatestFrom(touchMove$))), takeUntilDestroyed(this.#destroyRef))
2095
2137
  .subscribe(([touchstart, [touchend, touchmove]]) => {
2096
2138
  touchstart.stopPropagation();
2097
2139
  touchmove.stopPropagation();
@@ -2107,11 +2149,11 @@ class CarouselComponent {
2107
2149
  }
2108
2150
  }
2109
2151
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: CarouselComponent, deps: [{ token: CarouselConfig }, { token: i0.ElementRef }, { token: CarouselService }, { token: CarouselState }, { token: IntersectionService }, { token: ListenersService }], target: i0.ɵɵFactoryTarget.Component }); }
2110
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: CarouselComponent, isStandalone: true, selector: "c-carousel", inputs: { activeIndex: "activeIndex", animate: "animate", dark: "dark", direction: "direction", interval: "interval", pause: "pause", touch: "touch", transition: "transition", wrap: "wrap" }, outputs: { itemChange: "itemChange" }, host: { properties: { "class": "this.hostClasses" } }, providers: [CarouselService, CarouselState, CarouselConfig, IntersectionService, ListenersService], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:block}\n"] }); }
2152
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: CarouselComponent, isStandalone: true, selector: "c-carousel", inputs: { activeIndex: "activeIndex", animate: "animate", dark: "dark", direction: "direction", interval: "interval", pause: "pause", touch: "touch", transition: "transition", wrap: "wrap" }, outputs: { itemChange: "itemChange" }, host: { properties: { "class": "this.hostClasses" } }, providers: [CarouselService, CarouselState, CarouselConfig, ListenersService], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:block}\n"] }); }
2111
2153
  }
2112
2154
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: CarouselComponent, decorators: [{
2113
2155
  type: Component,
2114
- args: [{ selector: 'c-carousel', template: '<ng-content></ng-content>', providers: [CarouselService, CarouselState, CarouselConfig, IntersectionService, ListenersService], standalone: true, styles: [":host{display:block}\n"] }]
2156
+ args: [{ selector: 'c-carousel', template: '<ng-content></ng-content>', providers: [CarouselService, CarouselState, CarouselConfig, ListenersService], standalone: true, styles: [":host{display:block}\n"] }]
2115
2157
  }], ctorParameters: () => [{ type: CarouselConfig, decorators: [{
2116
2158
  type: Inject,
2117
2159
  args: [CarouselConfig]
@@ -4720,7 +4762,7 @@ class NavbarComponent {
4720
4762
  }
4721
4763
  get breakpoint() {
4722
4764
  if (typeof this.expand === 'string') {
4723
- return getComputedStyle(this.hostElement.nativeElement).getPropertyValue(`--cui-breakpoint-${this.expand}`);
4765
+ return getComputedStyle(this.hostElement.nativeElement)?.getPropertyValue(`--cui-breakpoint-${this.expand}`) ?? false;
4724
4766
  }
4725
4767
  return false;
4726
4768
  }
@@ -5617,7 +5659,7 @@ class OffcanvasComponent {
5617
5659
  }
5618
5660
  const element = this.document.documentElement;
5619
5661
  const responsiveBreakpoint = this.responsive;
5620
- const breakpointValue = getComputedStyle(element).getPropertyValue(`--cui-breakpoint-${responsiveBreakpoint.trim()}`) || false;
5662
+ const breakpointValue = getComputedStyle(element)?.getPropertyValue(`--cui-breakpoint-${responsiveBreakpoint.trim()}`) ?? false;
5621
5663
  return breakpointValue ? `${parseFloat(breakpointValue.trim()) - 0.02}px` : false;
5622
5664
  }
5623
5665
  animateStart(event) {
@@ -5716,7 +5758,7 @@ class OffcanvasComponent {
5716
5758
  }
5717
5759
  }
5718
5760
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: OffcanvasComponent, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: OffcanvasService }, { token: BackdropService }, { token: i1$2.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component }); }
5719
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.0.8", type: OffcanvasComponent, isStandalone: true, selector: "c-offcanvas", inputs: { backdrop: "backdrop", keyboard: ["keyboard", "keyboard", booleanAttribute], placement: "placement", responsive: "responsive", id: "id", role: "role", ariaModal: ["ariaModal", "ariaModal", booleanAttribute], scroll: ["scroll", "scroll", booleanAttribute], visible: ["visible", "visible", booleanAttribute] }, outputs: { visibleChange: "visibleChange" }, host: { listeners: { "@showHide.start": "animateStart($event)", "@showHide.done": "animateDone($event)", "document:keydown": "onKeyDownHandler($event)" }, properties: { "attr.role": "this.role", "attr.aria-modal": "this.ariaModal", "class": "this.hostClasses", "attr.aria-hidden": "this.ariaHidden", "attr.tabindex": "this.tabIndex", "@showHide": "this.animateTrigger" } }, exportAs: ["cOffcanvas"], ngImport: i0, template: "<div cdkTrapFocus cdkTrapFocusAutoCapture>\n <ng-content></ng-content>\n</div>\n\n", styles: [":host{display:none}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], animations: [
5761
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.0.8", type: OffcanvasComponent, isStandalone: true, selector: "c-offcanvas", inputs: { backdrop: "backdrop", keyboard: ["keyboard", "keyboard", booleanAttribute], placement: "placement", responsive: "responsive", id: "id", role: "role", ariaModal: ["ariaModal", "ariaModal", booleanAttribute], scroll: ["scroll", "scroll", booleanAttribute], visible: ["visible", "visible", booleanAttribute] }, outputs: { visibleChange: "visibleChange" }, host: { attributes: { "ngSkipHydration": "true" }, listeners: { "@showHide.start": "animateStart($event)", "@showHide.done": "animateDone($event)", "document:keydown": "onKeyDownHandler($event)" }, properties: { "attr.role": "this.role", "attr.aria-modal": "this.ariaModal", "class": "this.hostClasses", "attr.aria-hidden": "this.ariaHidden", "attr.tabindex": "this.tabIndex", "@showHide": "this.animateTrigger" } }, exportAs: ["cOffcanvas"], ngImport: i0, template: "<div cdkTrapFocus cdkTrapFocusAutoCapture>\n <ng-content></ng-content>\n</div>\n\n", styles: [":host{display:none}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], animations: [
5720
5762
  trigger('showHide', [
5721
5763
  state('visible', style({
5722
5764
  // visibility: 'visible'
@@ -5740,7 +5782,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
5740
5782
  })),
5741
5783
  transition('visible <=> *', [animate('300ms')])
5742
5784
  ])
5743
- ], exportAs: 'cOffcanvas', standalone: true, imports: [A11yModule], template: "<div cdkTrapFocus cdkTrapFocusAutoCapture>\n <ng-content></ng-content>\n</div>\n\n", styles: [":host{display:none}\n"] }]
5785
+ ], exportAs: 'cOffcanvas', standalone: true, imports: [A11yModule], host: { ngSkipHydration: 'true' }, template: "<div cdkTrapFocus cdkTrapFocusAutoCapture>\n <ng-content></ng-content>\n</div>\n\n", styles: [":host{display:none}\n"] }]
5744
5786
  }], ctorParameters: () => [{ type: Document, decorators: [{
5745
5787
  type: Inject,
5746
5788
  args: [DOCUMENT]
@@ -6268,33 +6310,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
6268
6310
  args: ['class']
6269
6311
  }] } });
6270
6312
 
6271
- class ClassToggleService {
6272
- constructor(document, rendererFactory) {
6273
- this.document = document;
6274
- this.rendererFactory = rendererFactory;
6275
- this.renderer = rendererFactory.createRenderer(null, null);
6276
- }
6277
- toggle(selector, className) {
6278
- const element = document.querySelector(selector);
6279
- if (element) {
6280
- element.classList.contains(className) ?
6281
- this.renderer.removeClass(element, className) :
6282
- this.renderer.addClass(element, className);
6283
- }
6284
- }
6285
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ClassToggleService, deps: [{ token: DOCUMENT }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable }); }
6286
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ClassToggleService, providedIn: 'root' }); }
6287
- }
6288
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ClassToggleService, decorators: [{
6289
- type: Injectable,
6290
- args: [{
6291
- providedIn: 'root'
6292
- }]
6293
- }], ctorParameters: () => [{ type: Document, decorators: [{
6294
- type: Inject,
6295
- args: [DOCUMENT]
6296
- }] }, { type: i0.RendererFactory2 }] });
6297
-
6298
6313
  class PopoverDirective {
6299
6314
  /**
6300
6315
  * Optional popper Options object, takes precedence over cPopoverPlacement prop
@@ -6319,6 +6334,7 @@ class PopoverDirective {
6319
6334
  get ariaDescribedBy() {
6320
6335
  return this.popoverId ? this.popoverId : null;
6321
6336
  }
6337
+ #destroyRef;
6322
6338
  constructor(document, renderer, hostElement, viewContainerRef, listenersService, changeDetectorRef, intersectionService) {
6323
6339
  this.document = document;
6324
6340
  this.renderer = renderer;
@@ -6352,9 +6368,9 @@ class PopoverDirective {
6352
6368
  }
6353
6369
  ]
6354
6370
  };
6371
+ this.#destroyRef = inject(DestroyRef);
6355
6372
  }
6356
6373
  ngAfterViewInit() {
6357
- this.intersectionService.createIntersectionObserver(this.hostElement);
6358
6374
  this.intersectionServiceSubscribe();
6359
6375
  }
6360
6376
  ngOnChanges(changes) {
@@ -6365,7 +6381,6 @@ class PopoverDirective {
6365
6381
  ngOnDestroy() {
6366
6382
  this.clearListeners();
6367
6383
  this.destroyPopoverElement();
6368
- this.intersectionServiceSubscribe(false);
6369
6384
  }
6370
6385
  ngOnInit() {
6371
6386
  this.setListeners();
@@ -6392,18 +6407,16 @@ class PopoverDirective {
6392
6407
  clearListeners() {
6393
6408
  this.listenersService.clearListeners();
6394
6409
  }
6395
- intersectionServiceSubscribe(subscribe = true) {
6396
- if (subscribe) {
6397
- this.intersectingSubscription = this.intersectionService.intersecting$
6398
- .pipe(debounceTime(100))
6399
- .subscribe(isIntersecting => {
6400
- this.visible = isIntersecting ? this.visible : false;
6401
- !this.visible && this.removePopoverElement();
6402
- });
6403
- }
6404
- else {
6405
- this.intersectingSubscription?.unsubscribe();
6406
- }
6410
+ intersectionServiceSubscribe() {
6411
+ this.intersectionService.createIntersectionObserver(this.hostElement);
6412
+ this.intersectionService.intersecting$
6413
+ .pipe(filter(next => next.hostElement === this.hostElement), debounceTime(100), finalize(() => {
6414
+ this.intersectionService.unobserve(this.hostElement);
6415
+ }), takeUntilDestroyed(this.#destroyRef))
6416
+ .subscribe(next => {
6417
+ this.visible = next.isIntersecting ? this.visible : false;
6418
+ !this.visible && this.removePopoverElement();
6419
+ });
6407
6420
  }
6408
6421
  getUID(prefix) {
6409
6422
  let uid = prefix ?? 'random-id';
@@ -6467,18 +6480,18 @@ class PopoverDirective {
6467
6480
  this.popoverRef.instance.id = undefined;
6468
6481
  this.changeDetectorRef.markForCheck();
6469
6482
  setTimeout(() => {
6470
- this.viewContainerRef.detach();
6483
+ this.viewContainerRef?.detach();
6471
6484
  }, 300);
6472
6485
  }
6473
6486
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: PopoverDirective, deps: [{ token: DOCUMENT }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: ListenersService }, { token: i0.ChangeDetectorRef }, { token: IntersectionService }], target: i0.ɵɵFactoryTarget.Directive }); }
6474
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: PopoverDirective, isStandalone: true, selector: "[cPopover]", inputs: { content: ["cPopover", "content"], popperOptions: ["cPopoverOptions", "popperOptions"], placement: ["cPopoverPlacement", "placement"], trigger: ["cPopoverTrigger", "trigger"], visible: ["cPopoverVisible", "visible"] }, host: { properties: { "attr.aria-describedby": "this.ariaDescribedBy" } }, providers: [ListenersService, IntersectionService], exportAs: ["cPopover"], usesOnChanges: true, ngImport: i0 }); }
6487
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: PopoverDirective, isStandalone: true, selector: "[cPopover]", inputs: { content: ["cPopover", "content"], popperOptions: ["cPopoverOptions", "popperOptions"], placement: ["cPopoverPlacement", "placement"], trigger: ["cPopoverTrigger", "trigger"], visible: ["cPopoverVisible", "visible"] }, host: { properties: { "attr.aria-describedby": "this.ariaDescribedBy" } }, providers: [ListenersService], exportAs: ["cPopover"], usesOnChanges: true, ngImport: i0 }); }
6475
6488
  }
6476
6489
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: PopoverDirective, decorators: [{
6477
6490
  type: Directive,
6478
6491
  args: [{
6479
6492
  selector: '[cPopover]',
6480
6493
  exportAs: 'cPopover',
6481
- providers: [ListenersService, IntersectionService],
6494
+ providers: [ListenersService],
6482
6495
  standalone: true
6483
6496
  }]
6484
6497
  }], ctorParameters: () => [{ type: Document, decorators: [{
@@ -6908,7 +6921,7 @@ class SidebarComponent {
6908
6921
  }
6909
6922
  this.state = {
6910
6923
  ...this.state,
6911
- ...newState,
6924
+ ...newState
6912
6925
  };
6913
6926
  this.state.mobile && this.state.visible
6914
6927
  ? this.backdropService.setBackdrop(this)
@@ -6919,9 +6932,8 @@ class SidebarComponent {
6919
6932
  }
6920
6933
  get getMobileBreakpoint() {
6921
6934
  const element = this.document.documentElement;
6922
- const mobileBreakpoint = getComputedStyle(element).getPropertyValue('--cui-mobile-breakpoint') ||
6923
- 'md';
6924
- const breakpointValue = getComputedStyle(element).getPropertyValue(`--cui-breakpoint-${mobileBreakpoint.trim()}`) || '768px';
6935
+ const mobileBreakpoint = this.document.defaultView?.getComputedStyle(element)?.getPropertyValue('--cui-mobile-breakpoint') ?? 'md';
6936
+ const breakpointValue = this.document.defaultView?.getComputedStyle(element)?.getPropertyValue(`--cui-breakpoint-${mobileBreakpoint.trim()}`) ?? '768px';
6925
6937
  return `${parseFloat(breakpointValue.trim()) - 0.02}px` || '767.98px';
6926
6938
  }
6927
6939
  constructor(document, renderer, breakpointObserver, sidebarService, backdropService) {
@@ -6936,12 +6948,12 @@ class SidebarComponent {
6936
6948
  this.#visible = false;
6937
6949
  this.#onMobile = false;
6938
6950
  this.state = {
6939
- sidebar: this,
6951
+ sidebar: this
6940
6952
  };
6941
6953
  this.#stateInitial = {
6942
6954
  narrow: false,
6943
6955
  visible: false,
6944
- unfoldable: false,
6956
+ unfoldable: false
6945
6957
  };
6946
6958
  /**
6947
6959
  * Place sidebar in non-static positions. [docs]
@@ -6965,7 +6977,7 @@ class SidebarComponent {
6965
6977
  'sidebar-overlaid': this.overlaid,
6966
6978
  [`sidebar-${this.size}`]: !!this.size,
6967
6979
  show: visible && this.#onMobile,
6968
- hide: !visible,
6980
+ hide: !visible
6969
6981
  };
6970
6982
  }
6971
6983
  ngOnInit() {
@@ -7001,11 +7013,11 @@ class SidebarComponent {
7001
7013
  this.#stateInitial = {
7002
7014
  narrow: this.narrow,
7003
7015
  visible: this.visible,
7004
- unfoldable: this.unfoldable,
7016
+ unfoldable: this.unfoldable
7005
7017
  };
7006
7018
  this.sidebarService.toggle({
7007
7019
  ...this.#stateInitial,
7008
- sidebar: this,
7020
+ sidebar: this
7009
7021
  });
7010
7022
  }
7011
7023
  stateToggleSubscribe(subscribe = true) {
@@ -7034,7 +7046,7 @@ class SidebarComponent {
7034
7046
  mobile: isOnMobile,
7035
7047
  unfoldable: isUnfoldable,
7036
7048
  visible: isOnMobile ? !isOnMobile : this.#stateInitial.visible,
7037
- sidebar: this,
7049
+ sidebar: this
7038
7050
  });
7039
7051
  }
7040
7052
  });
@@ -8413,7 +8425,7 @@ class ToastComponent {
8413
8425
  this._visible = false;
8414
8426
  /**
8415
8427
  * Event emitted on visibility change. [docs]
8416
- * @type boolean
8428
+ * @type EventEmitter<boolean>
8417
8429
  */
8418
8430
  this.visibleChange = new EventEmitter();
8419
8431
  /**
@@ -8483,14 +8495,14 @@ class ToastComponent {
8483
8495
  setTimer() {
8484
8496
  this.clearTimer();
8485
8497
  if (this.autohide && this.visible) {
8486
- this.timerId = this.delay > 0 ? setTimeout(() => this.onClose(), this.delay) : null;
8498
+ this.timerId = this.delay > 0 ? setTimeout(() => this.onClose(), this.delay) : undefined;
8487
8499
  this.setClock();
8488
8500
  }
8489
8501
  }
8490
8502
  clearTimer() {
8491
8503
  this.clearClock();
8492
8504
  clearTimeout(this.timerId);
8493
- this.timerId = null;
8505
+ this.timerId = undefined;
8494
8506
  }
8495
8507
  onClose() {
8496
8508
  this.clearTimer();
@@ -8514,7 +8526,7 @@ class ToastComponent {
8514
8526
  clearClock() {
8515
8527
  clearTimeout(this.clockTimerId);
8516
8528
  clearInterval(this.clockId);
8517
- this.clockId = null;
8529
+ this.clockId = undefined;
8518
8530
  }
8519
8531
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ToastComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: ToasterService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
8520
8532
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: ToastComponent, isStandalone: true, selector: "c-toast", inputs: { autohide: "autohide", color: "color", delay: "delay", fade: "fade", visible: "visible", index: "index" }, outputs: { visibleChange: "visibleChange", timer: "timer" }, host: { listeners: { "mouseover": "onMouseOver()", "mouseout": "onMouseOut()" }, properties: { "@.disabled": "this.animationDisabled", "@fadeInOut": "this.animateType", "class": "this.hostClasses" } }, exportAs: ["cToast"], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:block;overflow:hidden}\n"], animations: [
@@ -8946,6 +8958,7 @@ class TooltipDirective {
8946
8958
  get ariaDescribedBy() {
8947
8959
  return this.tooltipId ? this.tooltipId : null;
8948
8960
  }
8961
+ #destroyRef;
8949
8962
  constructor(document, renderer, hostElement, viewContainerRef, listenersService, changeDetectorRef, intersectionService) {
8950
8963
  this.document = document;
8951
8964
  this.renderer = renderer;
@@ -8979,9 +8992,9 @@ class TooltipDirective {
8979
8992
  }
8980
8993
  ]
8981
8994
  };
8995
+ this.#destroyRef = inject(DestroyRef);
8982
8996
  }
8983
8997
  ngAfterViewInit() {
8984
- this.intersectionService.createIntersectionObserver(this.hostElement);
8985
8998
  this.intersectionServiceSubscribe();
8986
8999
  }
8987
9000
  ngOnChanges(changes) {
@@ -8992,7 +9005,6 @@ class TooltipDirective {
8992
9005
  ngOnDestroy() {
8993
9006
  this.clearListeners();
8994
9007
  this.destroyTooltipElement();
8995
- this.intersectionServiceSubscribe(false);
8996
9008
  }
8997
9009
  ngOnInit() {
8998
9010
  this.setListeners();
@@ -9019,18 +9031,16 @@ class TooltipDirective {
9019
9031
  clearListeners() {
9020
9032
  this.listenersService.clearListeners();
9021
9033
  }
9022
- intersectionServiceSubscribe(subscribe = true) {
9023
- if (subscribe) {
9024
- this.intersectingSubscription = this.intersectionService.intersecting$
9025
- .pipe(debounceTime(100))
9026
- .subscribe(isIntersecting => {
9027
- this.visible = isIntersecting ? this.visible : false;
9028
- !this.visible && this.removeTooltipElement();
9029
- });
9030
- }
9031
- else {
9032
- this.intersectingSubscription?.unsubscribe();
9033
- }
9034
+ intersectionServiceSubscribe() {
9035
+ this.intersectionService.createIntersectionObserver(this.hostElement);
9036
+ this.intersectionService.intersecting$
9037
+ .pipe(filter(next => next.hostElement === this.hostElement), debounceTime(100), finalize(() => {
9038
+ this.intersectionService.unobserve(this.hostElement);
9039
+ }), takeUntilDestroyed(this.#destroyRef))
9040
+ .subscribe(next => {
9041
+ this.visible = next.isIntersecting ? this.visible : false;
9042
+ !this.visible && this.removeTooltipElement();
9043
+ });
9034
9044
  }
9035
9045
  getUID(prefix) {
9036
9046
  let uid = prefix ?? 'random-id';
@@ -9729,5 +9739,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
9729
9739
  * Generated bundle index. Do not edit.
9730
9740
  */
9731
9741
 
9732
- export { AccordionButtonDirective, AccordionComponent, AccordionItemComponent, AccordionModule, AlertComponent, AlertHeadingDirective, AlertLinkDirective, AlertModule, AlignDirective, AvatarComponent, AvatarModule, BackdropService, BadgeComponent, BadgeModule, BgColorDirective, BorderDirective, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbModule, BreadcrumbRouterComponent, BreadcrumbRouterService, BreakpointInfix, ButtonCloseDirective, ButtonDirective, ButtonGroupComponent, ButtonGroupModule, ButtonModule, ButtonToolbarComponent, CalloutComponent, CalloutModule, CardBodyComponent, CardComponent, CardFooterComponent, CardGroupComponent, CardHeaderActionsComponent, CardHeaderComponent, CardImgDirective, CardImgOverlayComponent, CardLinkDirective, CardModule, CardSubtitleDirective, CardTextDirective, CardTitleDirective, CarouselCaptionComponent, CarouselComponent, CarouselConfig, CarouselControlComponent, CarouselIndicatorsComponent, CarouselInnerComponent, CarouselItemComponent, CarouselModule, ClassToggleService, ColComponent, ColDirective, CollapseDirective, CollapseModule, ContainerComponent, DropdownCloseDirective, DropdownComponent, DropdownDividerDirective, DropdownHeaderDirective, DropdownItemDirective, DropdownItemPlainDirective, DropdownMenuDirective, DropdownModule, DropdownService, DropdownToggleDirective, FooterComponent, FooterModule, FormCheckComponent, FormCheckInputDirective, FormCheckLabelDirective, FormControlDirective, FormDirective, FormFeedbackComponent, FormFloatingDirective, FormLabelDirective, FormModule, FormSelectDirective, FormTextDirective, GridModule, GutterDirective, HeaderBrandComponent, HeaderComponent, HeaderDividerComponent, HeaderModule, HeaderNavComponent, HeaderTextComponent, HeaderTogglerDirective, HtmlAttributesDirective, ImgDirective, ImgModule, InputGroupComponent, InputGroupTextDirective, IntersectionService, ListGroupDirective, ListGroupItemDirective, ListGroupModule, ListenersService, ModalBodyComponent, ModalComponent, ModalContentComponent, ModalDialogComponent, ModalFooterComponent, ModalHeaderComponent, ModalModule, ModalService, ModalTitleDirective, ModalToggleDirective, NavComponent, NavItemComponent, NavLinkDirective, NavModule, NavbarBrandDirective, NavbarComponent, NavbarModule, NavbarNavComponent, NavbarTextComponent, NavbarTogglerDirective, OffcanvasBodyComponent, OffcanvasComponent, OffcanvasHeaderComponent, OffcanvasModule, OffcanvasService, OffcanvasTitleDirective, OffcanvasToggleDirective, PageItemComponent, PageItemDirective, PageLinkDirective, PaginationComponent, PaginationModule, PlaceholderAnimationDirective, PlaceholderDirective, PlaceholderModule, PopoverComponent, PopoverDirective, PopoverModule, ProgressBarComponent, ProgressComponent, ProgressModule, RoundedDirective, RowComponent, RowDirective, SharedModule, SidebarBrandComponent, SidebarComponent, SidebarFooterComponent, SidebarHeaderComponent, SidebarModule, SidebarNavComponent, SidebarService, SidebarToggleDirective, SidebarTogglerComponent, SpinnerComponent, SpinnerModule, TabContentComponent, TabContentRefDirective, TabPaneComponent, TabService, TableActiveDirective, TableColorDirective, TableDirective, TableModule, TabsModule, TemplateIdDirective, TextColorDirective, ToastBodyComponent, ToastCloseDirective, ToastComponent, ToastHeaderComponent, ToastModule, ToasterComponent, ToasterHostDirective, ToasterPlacement, ToasterService, TooltipComponent, TooltipDirective, TooltipModule, UtilitiesModule, WidgetModule, WidgetStatAComponent, WidgetStatBComponent, WidgetStatCComponent, WidgetStatDComponent, WidgetStatEComponent, WidgetStatFComponent };
9742
+ export { AccordionButtonDirective, AccordionComponent, AccordionItemComponent, AccordionModule, AlertComponent, AlertHeadingDirective, AlertLinkDirective, AlertModule, AlignDirective, AvatarComponent, AvatarModule, BackdropService, BadgeComponent, BadgeModule, BgColorDirective, BorderDirective, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbModule, BreadcrumbRouterComponent, BreadcrumbRouterService, BreakpointInfix, ButtonCloseDirective, ButtonDirective, ButtonGroupComponent, ButtonGroupModule, ButtonModule, ButtonToolbarComponent, CalloutComponent, CalloutModule, CardBodyComponent, CardComponent, CardFooterComponent, CardGroupComponent, CardHeaderActionsComponent, CardHeaderComponent, CardImgDirective, CardImgOverlayComponent, CardLinkDirective, CardModule, CardSubtitleDirective, CardTextDirective, CardTitleDirective, CarouselCaptionComponent, CarouselComponent, CarouselConfig, CarouselControlComponent, CarouselIndicatorsComponent, CarouselInnerComponent, CarouselItemComponent, CarouselModule, ClassToggleService, ColComponent, ColDirective, CollapseDirective, CollapseModule, ContainerComponent, DropdownCloseDirective, DropdownComponent, DropdownDividerDirective, DropdownHeaderDirective, DropdownItemDirective, DropdownItemPlainDirective, DropdownMenuDirective, DropdownModule, DropdownService, DropdownToggleDirective, FooterComponent, FooterModule, FormCheckComponent, FormCheckInputDirective, FormCheckLabelDirective, FormControlDirective, FormDirective, FormFeedbackComponent, FormFloatingDirective, FormLabelDirective, FormModule, FormSelectDirective, FormTextDirective, GridModule, GutterDirective, HeaderBrandComponent, HeaderComponent, HeaderDividerComponent, HeaderModule, HeaderNavComponent, HeaderTextComponent, HeaderTogglerDirective, HtmlAttributesDirective, ImgDirective, ImgModule, InputGroupComponent, InputGroupTextDirective, IntersectionService, ListGroupDirective, ListGroupItemDirective, ListGroupModule, ListenersService, ModalBodyComponent, ModalComponent, ModalContentComponent, ModalDialogComponent, ModalFooterComponent, ModalHeaderComponent, ModalModule, ModalService, ModalTitleDirective, ModalToggleDirective, NavComponent, NavItemComponent, NavLinkDirective, NavModule, NavbarBrandDirective, NavbarComponent, NavbarModule, NavbarNavComponent, NavbarTextComponent, NavbarTogglerDirective, OffcanvasBodyComponent, OffcanvasComponent, OffcanvasHeaderComponent, OffcanvasModule, OffcanvasService, OffcanvasTitleDirective, OffcanvasToggleDirective, PageItemComponent, PageItemDirective, PageLinkDirective, PaginationComponent, PaginationModule, PlaceholderAnimationDirective, PlaceholderDirective, PlaceholderModule, PopoverComponent, PopoverDirective, PopoverModule, ProgressBarComponent, ProgressComponent, ProgressModule, RoundedDirective, RowComponent, RowDirective, SharedModule, SidebarBrandComponent, SidebarComponent, SidebarFooterComponent, SidebarHeaderComponent, SidebarModule, SidebarNavComponent, SidebarNavHelper, SidebarService, SidebarToggleDirective, SidebarTogglerComponent, SpinnerComponent, SpinnerModule, TabContentComponent, TabContentRefDirective, TabPaneComponent, TabService, TableActiveDirective, TableColorDirective, TableDirective, TableModule, TabsModule, TemplateIdDirective, TextColorDirective, ToastBodyComponent, ToastCloseDirective, ToastComponent, ToastHeaderComponent, ToastModule, ToasterComponent, ToasterHostDirective, ToasterPlacement, ToasterService, TooltipComponent, TooltipDirective, TooltipModule, UtilitiesModule, WidgetModule, WidgetStatAComponent, WidgetStatBComponent, WidgetStatCComponent, WidgetStatDComponent, WidgetStatEComponent, WidgetStatFComponent };
9733
9743
  //# sourceMappingURL=coreui-angular.mjs.map