@coreui/angular-pro 4.7.7 → 4.7.8

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, Pipe, ViewChildren, Inject, ViewChild, forwardRef, Optional, ElementRef, ContentChild, DestroyRef, ChangeDetectionStrategy, signal, computed, NgZone, numberAttribute, effect, PLATFORM_ID, TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import { Directive, Input, NgModule, HostBinding, Injectable, Component, EventEmitter, Output, booleanAttribute, ContentChildren, HostListener, inject, RendererFactory2, Pipe, ViewChildren, PLATFORM_ID, DestroyRef, Inject, ViewChild, forwardRef, Optional, ElementRef, ContentChild, ChangeDetectionStrategy, signal, computed, NgZone, numberAttribute, effect, TemplateRef, ViewContainerRef } from '@angular/core';
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
4
4
  import * as i1$2 from '@angular/common';
5
- import { NgTemplateOutlet, NgIf, NgClass, DOCUMENT, NgForOf, AsyncPipe, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, CommonModule, formatDate, I18nPluralPipe, isPlatformBrowser } from '@angular/common';
5
+ import { NgTemplateOutlet, NgIf, NgClass, DOCUMENT, NgForOf, AsyncPipe, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, isPlatformServer, CommonModule, formatDate, I18nPluralPipe, isPlatformBrowser } 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, skip, distinctUntilChanged as distinctUntilChanged$1, map as map$1, debounceTime as debounceTime$1 } from 'rxjs';
8
+ import { Subject, BehaviorSubject, Observable, fromEvent, skip, distinctUntilChanged as distinctUntilChanged$1, map as map$1, debounceTime as debounceTime$1 } from 'rxjs';
9
9
  import * as i1$1 from '@angular/router';
10
10
  import { RouterModule, NavigationEnd, RouterLink } from '@angular/router';
11
11
  import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
12
- import { filter, tap, distinctUntilChanged, debounceTime, map, delay, combineLatestWith, take } from 'rxjs/operators';
12
+ import { filter, finalize, withLatestFrom, zipWith, tap, distinctUntilChanged, debounceTime, map, delay, combineLatestWith, take } from 'rxjs/operators';
13
13
  import * as i1$3 from '@angular/forms';
14
14
  import { Validators, FormControl, FormGroup, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms';
15
15
  import { createPopper } from '@popperjs/core';
@@ -1087,7 +1087,8 @@ class BackdropService {
1087
1087
  get #scrollbarWidth() {
1088
1088
  // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
1089
1089
  const documentWidth = this.#document.documentElement.clientWidth;
1090
- const scrollbarWidth = Math.abs((window?.innerWidth ?? documentWidth) - documentWidth);
1090
+ // const scrollbarWidth = Math.abs((window?.innerWidth ?? documentWidth) - documentWidth);
1091
+ const scrollbarWidth = Math.abs((this.#document.defaultView?.innerWidth ?? documentWidth) - documentWidth);
1091
1092
  return `${scrollbarWidth}px`;
1092
1093
  }
1093
1094
  setBackdrop(type = 'modal') {
@@ -3162,37 +3163,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
3162
3163
  }]
3163
3164
  }] });
3164
3165
 
3165
- class IntersectionService {
3166
- constructor() {
3167
- this.intersecting = new BehaviorSubject(false);
3168
- this.intersecting$ = this.intersecting.asObservable();
3169
- this.defaultObserverOptions = {
3170
- root: null,
3171
- rootMargin: '0px',
3172
- threshold: 0.2
3173
- };
3174
- }
3175
- createIntersectionObserver(hostElement, observerOptions = this.defaultObserverOptions) {
3176
- const options = { ...this.defaultObserverOptions, ...observerOptions };
3177
- this.hostElement = hostElement;
3178
- const handleIntersect = (entries, observer) => {
3179
- entries.forEach((entry) => {
3180
- this.intersecting.next(entry.isIntersecting);
3181
- });
3182
- };
3183
- this.intersectionObserver = new IntersectionObserver(handleIntersect, options);
3184
- this.intersectionObserver.observe(hostElement.nativeElement);
3185
- }
3186
- ngOnDestroy() {
3187
- this.intersectionObserver?.unobserve(this.hostElement?.nativeElement);
3188
- }
3189
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IntersectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3190
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IntersectionService }); }
3191
- }
3192
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IntersectionService, decorators: [{
3193
- type: Injectable
3194
- }], ctorParameters: () => [] });
3195
-
3196
3166
  class ListenersService {
3197
3167
  constructor(renderer) {
3198
3168
  this.renderer = renderer;
@@ -3341,6 +3311,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
3341
3311
  type: Injectable
3342
3312
  }] });
3343
3313
 
3314
+ class IntersectionService {
3315
+ constructor() {
3316
+ this.platformId = inject(PLATFORM_ID);
3317
+ this.#intersecting = new BehaviorSubject({ isIntersecting: false });
3318
+ this.intersecting$ = this.#intersecting.asObservable();
3319
+ this.defaultObserverOptions = {
3320
+ root: null,
3321
+ rootMargin: '0px',
3322
+ threshold: 0.2
3323
+ };
3324
+ this.hostElementRefs = new Map();
3325
+ }
3326
+ #intersecting;
3327
+ createIntersectionObserver(hostElement, observerOptions = this.defaultObserverOptions) {
3328
+ if (isPlatformServer(this.platformId)) {
3329
+ this.#intersecting.next({ isIntersecting: true, hostElement });
3330
+ return;
3331
+ }
3332
+ const options = { ...this.defaultObserverOptions, ...observerOptions };
3333
+ const handleIntersect = (entries, observer) => {
3334
+ entries.forEach((entry) => {
3335
+ this.#intersecting.next({ isIntersecting: entry.isIntersecting, hostElement });
3336
+ });
3337
+ };
3338
+ this.hostElementRefs.set(hostElement, new IntersectionObserver(handleIntersect, options));
3339
+ this.hostElementRefs.get(hostElement)?.observe(hostElement.nativeElement);
3340
+ }
3341
+ unobserve(elementRef) {
3342
+ this.hostElementRefs.get(elementRef)?.unobserve(elementRef.nativeElement);
3343
+ this.hostElementRefs.set(elementRef, null);
3344
+ this.hostElementRefs.delete(elementRef);
3345
+ }
3346
+ ngOnDestroy() {
3347
+ this.hostElementRefs.forEach((observer, elementRef) => {
3348
+ observer?.unobserve(elementRef.nativeElement);
3349
+ });
3350
+ }
3351
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IntersectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3352
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IntersectionService, providedIn: 'root' }); }
3353
+ }
3354
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: IntersectionService, decorators: [{
3355
+ type: Injectable,
3356
+ args: [{
3357
+ providedIn: 'root'
3358
+ }]
3359
+ }] });
3360
+
3344
3361
  class CarouselComponent {
3345
3362
  get hostClasses() {
3346
3363
  return {
@@ -3350,6 +3367,7 @@ class CarouselComponent {
3350
3367
  'carousel-fade': this.transition === 'crossfade'
3351
3368
  };
3352
3369
  }
3370
+ #destroyRef;
3353
3371
  constructor(config, hostElement, carouselService, carouselState, intersectionService, listenersService) {
3354
3372
  this.config = config;
3355
3373
  this.hostElement = hostElement;
@@ -3406,7 +3424,9 @@ class CarouselComponent {
3406
3424
  * @type number
3407
3425
  */
3408
3426
  this.itemChange = new EventEmitter();
3427
+ this.timerId = undefined;
3409
3428
  this.activeItemInterval = 0;
3429
+ this.#destroyRef = inject(DestroyRef);
3410
3430
  this._visible = true;
3411
3431
  Object.assign(this, config);
3412
3432
  }
@@ -3414,13 +3434,11 @@ class CarouselComponent {
3414
3434
  this.carouselStateSubscribe();
3415
3435
  }
3416
3436
  ngOnDestroy() {
3437
+ this.resetTimer();
3417
3438
  this.clearListeners();
3418
- this.carouselStateSubscribe(false);
3419
- this.intersectionServiceSubscribe(false);
3420
3439
  this.swipeSubscribe(false);
3421
3440
  }
3422
3441
  ngAfterContentInit() {
3423
- this.intersectionService.createIntersectionObserver(this.hostElement);
3424
3442
  this.intersectionServiceSubscribe();
3425
3443
  this.carouselState.state = { activeItemIndex: this.activeIndex, animate: this.animate };
3426
3444
  this.setListeners();
@@ -3460,32 +3478,30 @@ class CarouselComponent {
3460
3478
  }
3461
3479
  resetTimer() {
3462
3480
  clearTimeout(this.timerId);
3481
+ this.timerId = undefined;
3463
3482
  }
3464
- carouselStateSubscribe(subscribe = true) {
3465
- if (subscribe) {
3466
- this.carouselIndexSubscription = this.carouselService.carouselIndex$.subscribe((nextItem) => {
3467
- if ('active' in nextItem) {
3468
- this.itemChange.emit(nextItem.active);
3469
- }
3470
- this.activeItemInterval = typeof nextItem.interval === 'number' && nextItem.interval > -1 ? nextItem.interval : this.interval;
3471
- const isLastItem = ((nextItem.active === nextItem.lastItemIndex) && this.direction === 'next') || ((nextItem.active === 0) && this.direction === 'prev');
3472
- !this.wrap && isLastItem ? this.resetTimer() : this.setTimer();
3473
- });
3474
- }
3475
- else {
3476
- this.carouselIndexSubscription?.unsubscribe();
3477
- }
3483
+ carouselStateSubscribe() {
3484
+ this.carouselService.carouselIndex$
3485
+ .pipe(takeUntilDestroyed(this.#destroyRef))
3486
+ .subscribe((nextItem) => {
3487
+ if ('active' in nextItem) {
3488
+ this.itemChange.emit(nextItem.active);
3489
+ }
3490
+ this.activeItemInterval = typeof nextItem.interval === 'number' && nextItem.interval > -1 ? nextItem.interval : this.interval;
3491
+ const isLastItem = ((nextItem.active === nextItem.lastItemIndex) && this.direction === 'next') || ((nextItem.active === 0) && this.direction === 'prev');
3492
+ !this.wrap && isLastItem ? this.resetTimer() : this.setTimer();
3493
+ });
3478
3494
  }
3479
- intersectionServiceSubscribe(subscribe = true) {
3480
- if (subscribe) {
3481
- this.intersectingSubscription = this.intersectionService.intersecting$.subscribe(isIntersecting => {
3482
- this.visible = isIntersecting;
3483
- isIntersecting ? this.setTimer() : this.resetTimer();
3484
- });
3485
- }
3486
- else {
3487
- this.intersectingSubscription?.unsubscribe();
3488
- }
3495
+ intersectionServiceSubscribe() {
3496
+ this.intersectionService.createIntersectionObserver(this.hostElement);
3497
+ this.intersectionService.intersecting$
3498
+ .pipe(filter(next => next.hostElement === this.hostElement), finalize(() => {
3499
+ this.intersectionService.unobserve(this.hostElement);
3500
+ }), takeUntilDestroyed(this.#destroyRef))
3501
+ .subscribe(next => {
3502
+ this.visible = next.isIntersecting;
3503
+ next.isIntersecting ? this.setTimer() : this.resetTimer();
3504
+ });
3489
3505
  }
3490
3506
  swipeSubscribe(subscribe = true) {
3491
3507
  if (this.touch && subscribe) {
@@ -3493,7 +3509,7 @@ class CarouselComponent {
3493
3509
  const touchStart$ = fromEvent(carouselElement, 'touchstart');
3494
3510
  const touchEnd$ = fromEvent(carouselElement, 'touchend');
3495
3511
  const touchMove$ = fromEvent(carouselElement, 'touchmove');
3496
- this.swipeSubscription = touchStart$.pipe(zipWith(touchEnd$.pipe(withLatestFrom(touchMove$))))
3512
+ this.swipeSubscription = touchStart$.pipe(zipWith(touchEnd$.pipe(withLatestFrom(touchMove$))), takeUntilDestroyed(this.#destroyRef))
3497
3513
  .subscribe(([touchstart, [touchend, touchmove]]) => {
3498
3514
  touchstart.stopPropagation();
3499
3515
  touchmove.stopPropagation();
@@ -3509,11 +3525,11 @@ class CarouselComponent {
3509
3525
  }
3510
3526
  }
3511
3527
  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 }); }
3512
- 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"] }); }
3528
+ 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"] }); }
3513
3529
  }
3514
3530
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: CarouselComponent, decorators: [{
3515
3531
  type: Component,
3516
- args: [{ selector: 'c-carousel', template: '<ng-content></ng-content>', providers: [CarouselService, CarouselState, CarouselConfig, IntersectionService, ListenersService], standalone: true, styles: [":host{display:block}\n"] }]
3532
+ args: [{ selector: 'c-carousel', template: '<ng-content></ng-content>', providers: [CarouselService, CarouselState, CarouselConfig, ListenersService], standalone: true, styles: [":host{display:block}\n"] }]
3517
3533
  }], ctorParameters: () => [{ type: CarouselConfig, decorators: [{
3518
3534
  type: Inject,
3519
3535
  args: [CarouselConfig]
@@ -8982,10 +8998,10 @@ const observeReferenceModifier = {
8982
8998
  instance.update();
8983
8999
  });
8984
9000
  // @ts-ignore
8985
- reference[RO_PROP].observe(reference);
9001
+ reference[RO_PROP]?.observe(reference);
8986
9002
  return () => {
8987
9003
  // @ts-ignore
8988
- reference[RO_PROP].disconnect();
9004
+ reference[RO_PROP]?.disconnect();
8989
9005
  // @ts-ignore
8990
9006
  delete reference[RO_PROP];
8991
9007
  };
@@ -9913,8 +9929,8 @@ class MultiSelectComponent {
9913
9929
  this.scrollViewport = scrollViewport;
9914
9930
  const cdkVirtualScrollContentWrapper = this.scrollViewport.getElementRef().nativeElement?.firstElementChild;
9915
9931
  if (cdkVirtualScrollContentWrapper) {
9916
- const style = getComputedStyle(cdkVirtualScrollContentWrapper, null);
9917
- const padding = parseInt(style.getPropertyValue('padding-left') ?? '12px') * 3;
9932
+ const style = getComputedStyle(cdkVirtualScrollContentWrapper, null) ?? undefined;
9933
+ const padding = parseInt(style?.getPropertyValue('padding-left') ?? '12px') * 3;
9918
9934
  const observer = new MutationObserver((mutationRecords) => {
9919
9935
  mutationRecords.forEach(child => {
9920
9936
  child.addedNodes.forEach(node => {
@@ -9927,9 +9943,9 @@ class MultiSelectComponent {
9927
9943
  });
9928
9944
  });
9929
9945
  });
9930
- observer.observe(cdkVirtualScrollContentWrapper, { childList: true });
9946
+ observer?.observe(cdkVirtualScrollContentWrapper, { childList: true });
9931
9947
  this.#destroy$.subscribe(() => {
9932
- observer.disconnect();
9948
+ observer?.disconnect();
9933
9949
  });
9934
9950
  }
9935
9951
  }
@@ -10355,7 +10371,7 @@ class NavbarComponent {
10355
10371
  }
10356
10372
  get breakpoint() {
10357
10373
  if (typeof this.expand === 'string') {
10358
- return getComputedStyle(this.hostElement.nativeElement).getPropertyValue(`--cui-breakpoint-${this.expand}`);
10374
+ return getComputedStyle(this.hostElement.nativeElement)?.getPropertyValue(`--cui-breakpoint-${this.expand}`) ?? false;
10359
10375
  }
10360
10376
  return false;
10361
10377
  }
@@ -11252,7 +11268,7 @@ class OffcanvasComponent {
11252
11268
  }
11253
11269
  const element = this.document.documentElement;
11254
11270
  const responsiveBreakpoint = this.responsive;
11255
- const breakpointValue = getComputedStyle(element).getPropertyValue(`--cui-breakpoint-${responsiveBreakpoint.trim()}`) || false;
11271
+ const breakpointValue = getComputedStyle(element)?.getPropertyValue(`--cui-breakpoint-${responsiveBreakpoint.trim()}`) ?? false;
11256
11272
  return breakpointValue ? `${parseFloat(breakpointValue.trim()) - 0.02}px` : false;
11257
11273
  }
11258
11274
  animateStart(event) {
@@ -11351,7 +11367,7 @@ class OffcanvasComponent {
11351
11367
  }
11352
11368
  }
11353
11369
  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$4.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component }); }
11354
- 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: i1$5.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], animations: [
11370
+ 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: i1$5.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], animations: [
11355
11371
  trigger('showHide', [
11356
11372
  state('visible', style({
11357
11373
  // visibility: 'visible'
@@ -11375,7 +11391,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
11375
11391
  })),
11376
11392
  transition('visible <=> *', [animate('300ms')])
11377
11393
  ])
11378
- ], exportAs: 'cOffcanvas', standalone: true, imports: [A11yModule], template: "<div cdkTrapFocus cdkTrapFocusAutoCapture>\n <ng-content></ng-content>\n</div>\n\n", styles: [":host{display:none}\n"] }]
11394
+ ], 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"] }]
11379
11395
  }], ctorParameters: () => [{ type: Document, decorators: [{
11380
11396
  type: Inject,
11381
11397
  args: [DOCUMENT]
@@ -11954,6 +11970,7 @@ class PopoverDirective {
11954
11970
  get ariaDescribedBy() {
11955
11971
  return this.popoverId ? this.popoverId : null;
11956
11972
  }
11973
+ #destroyRef;
11957
11974
  constructor(document, renderer, hostElement, viewContainerRef, listenersService, changeDetectorRef, intersectionService) {
11958
11975
  this.document = document;
11959
11976
  this.renderer = renderer;
@@ -11987,9 +12004,9 @@ class PopoverDirective {
11987
12004
  }
11988
12005
  ]
11989
12006
  };
12007
+ this.#destroyRef = inject(DestroyRef);
11990
12008
  }
11991
12009
  ngAfterViewInit() {
11992
- this.intersectionService.createIntersectionObserver(this.hostElement);
11993
12010
  this.intersectionServiceSubscribe();
11994
12011
  }
11995
12012
  ngOnChanges(changes) {
@@ -12000,7 +12017,6 @@ class PopoverDirective {
12000
12017
  ngOnDestroy() {
12001
12018
  this.clearListeners();
12002
12019
  this.destroyPopoverElement();
12003
- this.intersectionServiceSubscribe(false);
12004
12020
  }
12005
12021
  ngOnInit() {
12006
12022
  this.setListeners();
@@ -12027,18 +12043,16 @@ class PopoverDirective {
12027
12043
  clearListeners() {
12028
12044
  this.listenersService.clearListeners();
12029
12045
  }
12030
- intersectionServiceSubscribe(subscribe = true) {
12031
- if (subscribe) {
12032
- this.intersectingSubscription = this.intersectionService.intersecting$
12033
- .pipe(debounceTime(100))
12034
- .subscribe(isIntersecting => {
12035
- this.visible = isIntersecting ? this.visible : false;
12036
- !this.visible && this.removePopoverElement();
12037
- });
12038
- }
12039
- else {
12040
- this.intersectingSubscription?.unsubscribe();
12041
- }
12046
+ intersectionServiceSubscribe() {
12047
+ this.intersectionService.createIntersectionObserver(this.hostElement);
12048
+ this.intersectionService.intersecting$
12049
+ .pipe(filter(next => next.hostElement === this.hostElement), debounceTime(100), finalize(() => {
12050
+ this.intersectionService.unobserve(this.hostElement);
12051
+ }), takeUntilDestroyed(this.#destroyRef))
12052
+ .subscribe(next => {
12053
+ this.visible = next.isIntersecting ? this.visible : false;
12054
+ !this.visible && this.removePopoverElement();
12055
+ });
12042
12056
  }
12043
12057
  getUID(prefix) {
12044
12058
  let uid = prefix ?? 'random-id';
@@ -12102,18 +12116,18 @@ class PopoverDirective {
12102
12116
  this.popoverRef.instance.id = undefined;
12103
12117
  this.changeDetectorRef.markForCheck();
12104
12118
  setTimeout(() => {
12105
- this.viewContainerRef.detach();
12119
+ this.viewContainerRef?.detach();
12106
12120
  }, 300);
12107
12121
  }
12108
12122
  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 }); }
12109
- 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 }); }
12123
+ 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 }); }
12110
12124
  }
12111
12125
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: PopoverDirective, decorators: [{
12112
12126
  type: Directive,
12113
12127
  args: [{
12114
12128
  selector: '[cPopover]',
12115
12129
  exportAs: 'cPopover',
12116
- providers: [ListenersService, IntersectionService],
12130
+ providers: [ListenersService],
12117
12131
  standalone: true
12118
12132
  }]
12119
12133
  }], ctorParameters: () => [{ type: Document, decorators: [{
@@ -12479,7 +12493,7 @@ class SidebarComponent {
12479
12493
  }
12480
12494
  this.state = {
12481
12495
  ...this.state,
12482
- ...newState,
12496
+ ...newState
12483
12497
  };
12484
12498
  this.state.mobile && this.state.visible
12485
12499
  ? this.backdropService.setBackdrop(this)
@@ -12490,9 +12504,8 @@ class SidebarComponent {
12490
12504
  }
12491
12505
  get getMobileBreakpoint() {
12492
12506
  const element = this.document.documentElement;
12493
- const mobileBreakpoint = getComputedStyle(element).getPropertyValue('--cui-mobile-breakpoint') ||
12494
- 'md';
12495
- const breakpointValue = getComputedStyle(element).getPropertyValue(`--cui-breakpoint-${mobileBreakpoint.trim()}`) || '768px';
12507
+ const mobileBreakpoint = this.document.defaultView?.getComputedStyle(element)?.getPropertyValue('--cui-mobile-breakpoint') ?? 'md';
12508
+ const breakpointValue = this.document.defaultView?.getComputedStyle(element)?.getPropertyValue(`--cui-breakpoint-${mobileBreakpoint.trim()}`) ?? '768px';
12496
12509
  return `${parseFloat(breakpointValue.trim()) - 0.02}px` || '767.98px';
12497
12510
  }
12498
12511
  constructor(document, renderer, breakpointObserver, sidebarService, backdropService) {
@@ -12507,12 +12520,12 @@ class SidebarComponent {
12507
12520
  this.#visible = false;
12508
12521
  this.#onMobile = false;
12509
12522
  this.state = {
12510
- sidebar: this,
12523
+ sidebar: this
12511
12524
  };
12512
12525
  this.#stateInitial = {
12513
12526
  narrow: false,
12514
12527
  visible: false,
12515
- unfoldable: false,
12528
+ unfoldable: false
12516
12529
  };
12517
12530
  /**
12518
12531
  * Place sidebar in non-static positions. [docs]
@@ -12538,7 +12551,7 @@ class SidebarComponent {
12538
12551
  [`sidebar-${this.colorScheme}`]: !!this.colorScheme,
12539
12552
  [`sidebar-${this.size}`]: !!this.size,
12540
12553
  show: visible && this.#onMobile,
12541
- hide: !visible,
12554
+ hide: !visible
12542
12555
  };
12543
12556
  }
12544
12557
  ngOnInit() {
@@ -12574,11 +12587,11 @@ class SidebarComponent {
12574
12587
  this.#stateInitial = {
12575
12588
  narrow: this.narrow,
12576
12589
  visible: this.visible,
12577
- unfoldable: this.unfoldable,
12590
+ unfoldable: this.unfoldable
12578
12591
  };
12579
12592
  this.sidebarService.toggle({
12580
12593
  ...this.#stateInitial,
12581
- sidebar: this,
12594
+ sidebar: this
12582
12595
  });
12583
12596
  }
12584
12597
  stateToggleSubscribe(subscribe = true) {
@@ -12607,7 +12620,7 @@ class SidebarComponent {
12607
12620
  mobile: isOnMobile,
12608
12621
  unfoldable: isUnfoldable,
12609
12622
  visible: isOnMobile ? !isOnMobile : this.#stateInitial.visible,
12610
- sidebar: this,
12623
+ sidebar: this
12611
12624
  });
12612
12625
  }
12613
12626
  });
@@ -15948,6 +15961,7 @@ class TooltipDirective {
15948
15961
  get ariaDescribedBy() {
15949
15962
  return this.tooltipId ? this.tooltipId : null;
15950
15963
  }
15964
+ #destroyRef;
15951
15965
  constructor(document, renderer, hostElement, viewContainerRef, listenersService, changeDetectorRef, intersectionService) {
15952
15966
  this.document = document;
15953
15967
  this.renderer = renderer;
@@ -15981,9 +15995,9 @@ class TooltipDirective {
15981
15995
  }
15982
15996
  ]
15983
15997
  };
15998
+ this.#destroyRef = inject(DestroyRef);
15984
15999
  }
15985
16000
  ngAfterViewInit() {
15986
- this.intersectionService.createIntersectionObserver(this.hostElement);
15987
16001
  this.intersectionServiceSubscribe();
15988
16002
  }
15989
16003
  ngOnChanges(changes) {
@@ -15994,7 +16008,6 @@ class TooltipDirective {
15994
16008
  ngOnDestroy() {
15995
16009
  this.clearListeners();
15996
16010
  this.destroyTooltipElement();
15997
- this.intersectionServiceSubscribe(false);
15998
16011
  }
15999
16012
  ngOnInit() {
16000
16013
  this.setListeners();
@@ -16021,18 +16034,16 @@ class TooltipDirective {
16021
16034
  clearListeners() {
16022
16035
  this.listenersService.clearListeners();
16023
16036
  }
16024
- intersectionServiceSubscribe(subscribe = true) {
16025
- if (subscribe) {
16026
- this.intersectingSubscription = this.intersectionService.intersecting$
16027
- .pipe(debounceTime(100))
16028
- .subscribe(isIntersecting => {
16029
- this.visible = isIntersecting ? this.visible : false;
16030
- !this.visible && this.removeTooltipElement();
16031
- });
16032
- }
16033
- else {
16034
- this.intersectingSubscription?.unsubscribe();
16035
- }
16037
+ intersectionServiceSubscribe() {
16038
+ this.intersectionService.createIntersectionObserver(this.hostElement);
16039
+ this.intersectionService.intersecting$
16040
+ .pipe(filter(next => next.hostElement === this.hostElement), debounceTime(100), finalize(() => {
16041
+ this.intersectionService.unobserve(this.hostElement);
16042
+ }), takeUntilDestroyed(this.#destroyRef))
16043
+ .subscribe(next => {
16044
+ this.visible = next.isIntersecting ? this.visible : false;
16045
+ !this.visible && this.removeTooltipElement();
16046
+ });
16036
16047
  }
16037
16048
  getUID(prefix) {
16038
16049
  let uid = prefix ?? 'random-id';