codexly-ui 0.0.74 → 0.0.76

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,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, effect, signal, inject, ElementRef, InjectionToken, PLATFORM_ID, Injectable, Renderer2, ApplicationRef, EnvironmentInjector, DestroyRef, createComponent, Directive, output, contentChildren, NgZone, model, untracked, forwardRef, viewChild, HostListener, ViewChildren, contentChild, Injector, ViewChild, ChangeDetectorRef, ContentChildren, Input, numberAttribute, booleanAttribute } from '@angular/core';
2
+ import { input, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, effect, signal, inject, ElementRef, InjectionToken, PLATFORM_ID, Injectable, Renderer2, ApplicationRef, EnvironmentInjector, DestroyRef, createComponent, Directive, output, contentChildren, NgZone, model, untracked, forwardRef, viewChild, HostListener, ViewChildren, contentChild, Injector, ViewChild, ChangeDetectorRef, ContentChildren, Input, numberAttribute, booleanAttribute, runInInjectionContext } from '@angular/core';
3
3
  import { isPlatformBrowser, CurrencyPipe, NgTemplateOutlet, DecimalPipe, NgStyle, DOCUMENT } from '@angular/common';
4
4
  import * as i1 from '@angular/forms';
5
5
  import { NG_VALUE_ACCESSOR, FormsModule, NgControl, FormControl, ReactiveFormsModule, FormGroup, Validators } from '@angular/forms';
6
6
  import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
7
  import { startWith, map, debounceTime, distinctUntilChanged, switchMap, of, catchError } from 'rxjs';
8
8
  import * as i1$1 from '@angular/cdk/overlay';
9
- import { ScrollStrategyOptions, OverlayModule, Overlay, OverlayConfig } from '@angular/cdk/overlay';
9
+ import { ScrollStrategyOptions, OverlayModule, Overlay, OverlayConfig, OverlayContainer } from '@angular/cdk/overlay';
10
10
  import { Chart, LineController, BarController, PieController, DoughnutController, RadarController, PolarAreaController, CategoryScale, LinearScale, RadialLinearScale, BarElement, LineElement, PointElement, ArcElement, Filler, Tooltip, Legend } from 'chart.js';
11
11
  import * as i1$2 from '@angular/cdk/portal';
12
12
  import { PortalModule, ComponentPortal } from '@angular/cdk/portal';
@@ -13955,17 +13955,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
13955
13955
  args: [{ providedIn: 'root' }]
13956
13956
  }], ctorParameters: () => [] });
13957
13957
 
13958
+ /** Dedicated OverlayContainer for toasts — lives in its own div above all modals */
13959
+ class ToastOverlayContainer extends OverlayContainer {
13960
+ _createContainer() {
13961
+ const el = document.createElement('div');
13962
+ el.classList.add('clx-toast-overlay-container');
13963
+ el.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:0;z-index:99999;pointer-events:none;';
13964
+ document.body.appendChild(el);
13965
+ this._containerElement = el;
13966
+ }
13967
+ }
13958
13968
  class ClxToastService {
13959
- _overlay = inject(Overlay);
13960
13969
  _injector = inject(Injector);
13970
+ _toastOverlay = null;
13961
13971
  _containers = new Map();
13972
+ _getOverlay() {
13973
+ if (this._toastOverlay)
13974
+ return this._toastOverlay;
13975
+ const childInjector = Injector.create({
13976
+ parent: this._injector,
13977
+ providers: [
13978
+ {
13979
+ provide: OverlayContainer,
13980
+ useFactory: () => runInInjectionContext(this._injector, () => new ToastOverlayContainer()),
13981
+ },
13982
+ { provide: Overlay },
13983
+ ],
13984
+ });
13985
+ this._toastOverlay = childInjector.get(Overlay);
13986
+ return this._toastOverlay;
13987
+ }
13962
13988
  // ─── Core show ─────────────────────────────────────────────────────────────
13963
13989
  show(options) {
13964
13990
  const position = options.position ?? TOAST_DEFAULTS.position;
13965
13991
  const container = this._getOrCreateContainer(position);
13966
- // Move toast pane to end of CDK container so it's always above modals
13967
- const hostEl = container.overlayRef.hostElement;
13968
- hostEl.parentElement?.appendChild(hostEl);
13969
13992
  const entry = {
13970
13993
  id: this._uid(),
13971
13994
  type: options.type ?? TOAST_DEFAULTS.type,
@@ -14007,14 +14030,12 @@ class ClxToastService {
14007
14030
  const existing = this._containers.get(position);
14008
14031
  if (existing)
14009
14032
  return existing;
14010
- const overlayRef = this._overlay.create(new OverlayConfig({
14033
+ const overlay = this._getOverlay();
14034
+ const overlayRef = overlay.create(new OverlayConfig({
14011
14035
  hasBackdrop: false,
14012
- scrollStrategy: this._overlay.scrollStrategies.noop(),
14013
- positionStrategy: this._overlay.position().global(),
14036
+ scrollStrategy: overlay.scrollStrategies.noop(),
14037
+ positionStrategy: overlay.position().global(),
14014
14038
  }));
14015
- // Force pane above any modal overlay
14016
- overlayRef.overlayElement.style.zIndex = '99999';
14017
- overlayRef.hostElement.style.zIndex = '99999';
14018
14039
  const portal = new ComponentPortal(ClxToastContainerComponent, null, Injector.create({ parent: this._injector, providers: [] }));
14019
14040
  const compRef = overlayRef.attach(portal);
14020
14041
  compRef.setInput('position', position);