@flusys/ng-ui 8.1.2 → 8.1.3

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,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, Service, makeEnvironmentProviders, provideAppInitializer, inject, PLATFORM_ID, input, booleanAttribute, computed, Component, output, contentChild, viewChild, effect, ElementRef, Directive, numberAttribute, afterNextRender, TemplateRef, contentChildren, DestroyRef, untracked, forwardRef, model, viewChildren, Renderer2, InjectionToken, Injector, SecurityContext } from '@angular/core';
3
- import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT, NgComponentOutlet } from '@angular/common';
2
+ import { signal, Service, makeEnvironmentProviders, provideAppInitializer, inject, PLATFORM_ID, input, booleanAttribute, computed, Component, output, contentChild, viewChild, effect, DestroyRef, ElementRef, Directive, numberAttribute, afterNextRender, TemplateRef, contentChildren, untracked, forwardRef, model, viewChildren, Renderer2, InjectionToken, Injector, SecurityContext } from '@angular/core';
3
+ import { isPlatformBrowser, DOCUMENT, NgTemplateOutlet, NgComponentOutlet } from '@angular/common';
4
4
  import * as lucideNamespace from '@lucide/angular';
5
5
  import { isLucideIconComponent, LucideDynamicIcon, provideLucideIcons } from '@lucide/angular';
6
6
  import * as i1 from '@angular/forms';
@@ -730,6 +730,34 @@ function provideNgUI(options) {
730
730
  ]);
731
731
  }
732
732
 
733
+ const BASE_Z_INDEX = 1000;
734
+ const Z_INDEX_STEP = 2;
735
+ class OverlayStackService {
736
+ _doc = inject(DOCUMENT);
737
+ nextZIndex = BASE_Z_INDEX;
738
+ lockCount = 0;
739
+ open() {
740
+ const zIndex = this.nextZIndex;
741
+ this.nextZIndex += Z_INDEX_STEP;
742
+ return zIndex;
743
+ }
744
+ lockScroll() {
745
+ if (this.lockCount === 0)
746
+ this._doc.body.style.overflow = 'hidden';
747
+ this.lockCount++;
748
+ }
749
+ unlockScroll() {
750
+ this.lockCount = Math.max(0, this.lockCount - 1);
751
+ if (this.lockCount === 0)
752
+ this._doc.body.style.overflow = '';
753
+ }
754
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: OverlayStackService, deps: [], target: i0.ɵɵFactoryTarget.Service });
755
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.5", ngImport: i0, type: OverlayStackService });
756
+ }
757
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: OverlayStackService, decorators: [{
758
+ type: Service
759
+ }] });
760
+
733
761
  class BadgeComponent {
734
762
  value = input('', /* @ts-ignore */
735
763
  ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
@@ -1312,10 +1340,10 @@ function plainVariant(kind) {
1312
1340
  const FOCUSABLE_SELECTOR$3 = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
1313
1341
  class ConfirmDialog {
1314
1342
  static idCounter = 0;
1315
- _doc = inject(DOCUMENT);
1316
1343
  headerId = `f-confirmdialog-header-${++ConfirmDialog.idCounter}`;
1317
1344
  descId = `f-confirmdialog-desc-${ConfirmDialog.idCounter}`;
1318
1345
  confirmationService = inject(ConfirmationService);
1346
+ _overlayStack = inject(OverlayStackService);
1319
1347
  key = input(undefined, /* @ts-ignore */
1320
1348
  ...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
1321
1349
  icon = input('', /* @ts-ignore */
@@ -1350,24 +1378,40 @@ class ConfirmDialog {
1350
1378
  panelRef = viewChild('panel', /* @ts-ignore */
1351
1379
  ...(ngDevMode ? [{ debugName: "panelRef" }] : /* istanbul ignore next */ []));
1352
1380
  _previouslyFocused = null;
1381
+ _scrollLocked = false;
1382
+ _zIndex = signal(null, /* @ts-ignore */
1383
+ ...(ngDevMode ? [{ debugName: "_zIndex" }] : /* istanbul ignore next */ []));
1384
+ zIndex = this._zIndex.asReadonly();
1353
1385
  constructor() {
1354
1386
  effect(() => {
1355
1387
  const visible = !!this.activeConfirmation();
1356
1388
  if (visible) {
1389
+ this._zIndex.set(this._overlayStack.open());
1357
1390
  this._previouslyFocused =
1358
1391
  typeof document !== 'undefined'
1359
1392
  ? document.activeElement
1360
1393
  : null;
1361
- if (this.blockScroll())
1362
- this._doc.body.style.overflow = 'hidden';
1394
+ if (this.blockScroll()) {
1395
+ this._overlayStack.lockScroll();
1396
+ this._scrollLocked = true;
1397
+ }
1363
1398
  }
1364
1399
  else {
1365
- if (this.blockScroll())
1366
- this._doc.body.style.overflow = '';
1400
+ this._zIndex.set(null);
1401
+ if (this._scrollLocked) {
1402
+ this._overlayStack.unlockScroll();
1403
+ this._scrollLocked = false;
1404
+ }
1367
1405
  this._previouslyFocused?.focus();
1368
1406
  this._previouslyFocused = null;
1369
1407
  }
1370
1408
  });
1409
+ inject(DestroyRef).onDestroy(() => {
1410
+ if (this._scrollLocked) {
1411
+ this._overlayStack.unlockScroll();
1412
+ this._scrollLocked = false;
1413
+ }
1414
+ });
1371
1415
  }
1372
1416
  resolvedIcon(c) {
1373
1417
  return c.icon || this.icon();
@@ -1426,7 +1470,10 @@ class ConfirmDialog {
1426
1470
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: ConfirmDialog, isStandalone: true, selector: "f-confirmdialog", inputs: { key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, acceptLabel: { classPropertyName: "acceptLabel", publicName: "acceptLabel", isSignal: true, isRequired: false, transformFunction: null }, rejectLabel: { classPropertyName: "rejectLabel", publicName: "rejectLabel", isSignal: true, isRequired: false, transformFunction: null }, acceptIcon: { classPropertyName: "acceptIcon", publicName: "acceptIcon", isSignal: true, isRequired: false, transformFunction: null }, rejectIcon: { classPropertyName: "rejectIcon", publicName: "rejectIcon", isSignal: true, isRequired: false, transformFunction: null }, acceptButtonStyleClass: { classPropertyName: "acceptButtonStyleClass", publicName: "acceptButtonStyleClass", isSignal: true, isRequired: false, transformFunction: null }, rejectButtonStyleClass: { classPropertyName: "rejectButtonStyleClass", publicName: "rejectButtonStyleClass", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, blockScroll: { classPropertyName: "blockScroll", publicName: "blockScroll", isSignal: true, isRequired: false, transformFunction: null }, defaultFocus: { classPropertyName: "defaultFocus", publicName: "defaultFocus", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:keydown.escape": "onEscape()" }, classAttribute: "block" }, viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
1427
1471
  @if (activeConfirmation(); as c) {
1428
1472
  @if (c.acceptVisible !== false || c.rejectVisible !== false) {
1429
- <div class="fixed inset-0 z-50 flex items-center justify-center p-4">
1473
+ <div
1474
+ class="fixed inset-0 flex items-center justify-center p-4"
1475
+ [style.z-index]="zIndex()"
1476
+ >
1430
1477
  <div
1431
1478
  class="confirm-backdrop absolute inset-0 bg-black/50 backdrop-blur-[2px]"
1432
1479
  (click)="c.closable !== false && reject(c.reject)"
@@ -1517,7 +1564,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
1517
1564
  args: [{ selector: 'f-confirmdialog', imports: [UiIconComponent, ButtonComponent], host: { class: 'block', '(document:keydown.escape)': 'onEscape()' }, template: `
1518
1565
  @if (activeConfirmation(); as c) {
1519
1566
  @if (c.acceptVisible !== false || c.rejectVisible !== false) {
1520
- <div class="fixed inset-0 z-50 flex items-center justify-center p-4">
1567
+ <div
1568
+ class="fixed inset-0 flex items-center justify-center p-4"
1569
+ [style.z-index]="zIndex()"
1570
+ >
1521
1571
  <div
1522
1572
  class="confirm-backdrop absolute inset-0 bg-black/50 backdrop-blur-[2px]"
1523
1573
  (click)="c.closable !== false && reject(c.reject)"
@@ -2650,9 +2700,13 @@ class ImageComponent {
2650
2700
  ...(ngDevMode ? [{ debugName: "fTemplates" }] : /* istanbul ignore next */ []));
2651
2701
  indicatorTpl = computed(() => this.fTemplates().find(t => t.fTemplate() === 'indicator')?.templateRef ?? null, /* @ts-ignore */
2652
2702
  ...(ngDevMode ? [{ debugName: "indicatorTpl" }] : /* istanbul ignore next */ []));
2703
+ _overlayStack = inject(OverlayStackService);
2653
2704
  _previewVisible = signal(false, /* @ts-ignore */
2654
2705
  ...(ngDevMode ? [{ debugName: "_previewVisible" }] : /* istanbul ignore next */ []));
2655
2706
  previewVisible = this._previewVisible.asReadonly();
2707
+ _zIndex = signal(null, /* @ts-ignore */
2708
+ ...(ngDevMode ? [{ debugName: "_zIndex" }] : /* istanbul ignore next */ []));
2709
+ zIndex = this._zIndex.asReadonly();
2656
2710
  _loaded = signal(false, /* @ts-ignore */
2657
2711
  ...(ngDevMode ? [{ debugName: "_loaded" }] : /* istanbul ignore next */ []));
2658
2712
  loaded = this._loaded.asReadonly();
@@ -2675,12 +2729,14 @@ class ImageComponent {
2675
2729
  if (this.hasError())
2676
2730
  return;
2677
2731
  this._previewVisible.set(true);
2732
+ this._zIndex.set(this._overlayStack.open());
2678
2733
  this.onShow.emit();
2679
2734
  }
2680
2735
  close() {
2681
2736
  this._previewVisible.set(false);
2682
2737
  this._rotate.set(0);
2683
2738
  this._scale.set(1);
2739
+ this._zIndex.set(null);
2684
2740
  this.onHide.emit();
2685
2741
  }
2686
2742
  onEscape() {
@@ -2751,7 +2807,8 @@ class ImageComponent {
2751
2807
 
2752
2808
  @if (previewVisible()) {
2753
2809
  <div
2754
- class="image-preview-overlay fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-6"
2810
+ class="image-preview-overlay fixed inset-0 flex items-center justify-center bg-black/80 p-6"
2811
+ [style.z-index]="zIndex()"
2755
2812
  (click)="close()"
2756
2813
  >
2757
2814
  <div class="absolute top-4 left-4 flex items-center gap-1" (click)="$event.stopPropagation()">
@@ -2837,7 +2894,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
2837
2894
 
2838
2895
  @if (previewVisible()) {
2839
2896
  <div
2840
- class="image-preview-overlay fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-6"
2897
+ class="image-preview-overlay fixed inset-0 flex items-center justify-center bg-black/80 p-6"
2898
+ [style.z-index]="zIndex()"
2841
2899
  (click)="close()"
2842
2900
  >
2843
2901
  <div class="absolute top-4 left-4 flex items-center gap-1" (click)="$event.stopPropagation()">
@@ -9213,7 +9271,7 @@ const CLOSE_ANIMATION_MS$1 = 180;
9213
9271
  const FOCUSABLE_SELECTOR$2 = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
9214
9272
  class DialogComponent {
9215
9273
  static idCounter = 0;
9216
- _doc = inject(DOCUMENT);
9274
+ _overlayStack = inject(OverlayStackService);
9217
9275
  headerId = `f-dialog-header-${++DialogComponent.idCounter}`;
9218
9276
  header = input('', /* @ts-ignore */
9219
9277
  ...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
@@ -9332,9 +9390,13 @@ class DialogComponent {
9332
9390
  _closing = signal(false, /* @ts-ignore */
9333
9391
  ...(ngDevMode ? [{ debugName: "_closing" }] : /* istanbul ignore next */ []));
9334
9392
  closing = this._closing.asReadonly();
9393
+ _zIndex = signal(null, /* @ts-ignore */
9394
+ ...(ngDevMode ? [{ debugName: "_zIndex" }] : /* istanbul ignore next */ []));
9395
+ zIndex = this._zIndex.asReadonly();
9335
9396
  panelRef = viewChild('panel', /* @ts-ignore */
9336
9397
  ...(ngDevMode ? [{ debugName: "panelRef" }] : /* istanbul ignore next */ []));
9337
9398
  _previouslyFocused = null;
9399
+ _scrollLocked = false;
9338
9400
  constructor() {
9339
9401
  if (typeof window !== 'undefined') {
9340
9402
  fromEvent(window, 'resize')
@@ -9346,19 +9408,24 @@ class DialogComponent {
9346
9408
  if (visible) {
9347
9409
  this._closing.set(false);
9348
9410
  this._rendered.set(true);
9411
+ this._zIndex.set(this._overlayStack.open());
9349
9412
  this._previouslyFocused =
9350
9413
  typeof document !== 'undefined'
9351
9414
  ? document.activeElement
9352
9415
  : null;
9353
- if (this.modal() || this.blockScroll())
9354
- this._doc.body.style.overflow = 'hidden';
9416
+ if (this.modal() || this.blockScroll()) {
9417
+ this._overlayStack.lockScroll();
9418
+ this._scrollLocked = true;
9419
+ }
9355
9420
  this.onShow.emit();
9356
9421
  setTimeout(() => this.focusPanel(), 0);
9357
9422
  }
9358
9423
  else if (this._rendered()) {
9359
9424
  this._closing.set(true);
9360
- if (this.modal() || this.blockScroll())
9361
- this._doc.body.style.overflow = '';
9425
+ if (this._scrollLocked) {
9426
+ this._overlayStack.unlockScroll();
9427
+ this._scrollLocked = false;
9428
+ }
9362
9429
  if (this.returnFocusOnClose())
9363
9430
  this._previouslyFocused?.focus();
9364
9431
  this._previouslyFocused = null;
@@ -9368,9 +9435,16 @@ class DialogComponent {
9368
9435
  setTimeout(() => {
9369
9436
  this._rendered.set(false);
9370
9437
  this._closing.set(false);
9438
+ this._zIndex.set(null);
9371
9439
  }, CLOSE_ANIMATION_MS$1);
9372
9440
  }
9373
9441
  });
9442
+ inject(DestroyRef).onDestroy(() => {
9443
+ if (this._scrollLocked) {
9444
+ this._overlayStack.unlockScroll();
9445
+ this._scrollLocked = false;
9446
+ }
9447
+ });
9374
9448
  }
9375
9449
  onEscape() {
9376
9450
  if (this.visible() && this.closable() && this.closeOnEscape())
@@ -9488,7 +9562,8 @@ class DialogComponent {
9488
9562
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: DialogComponent, isStandalone: true, selector: "f-dialog", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, dismissableMask: { classPropertyName: "dismissableMask", publicName: "dismissableMask", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, maximizable: { classPropertyName: "maximizable", publicName: "maximizable", isSignal: true, isRequired: false, transformFunction: null }, blockScroll: { classPropertyName: "blockScroll", publicName: "blockScroll", isSignal: true, isRequired: false, transformFunction: null }, returnFocusOnClose: { classPropertyName: "returnFocusOnClose", publicName: "returnFocusOnClose", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, breakpoints: { classPropertyName: "breakpoints", publicName: "breakpoints", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", onShow: "onShow", onHide: "onHide", onMaximize: "onMaximize" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, queries: [{ propertyName: "headerRef", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "footerRef", first: true, predicate: ["footer"], descendants: true, isSignal: true }, { propertyName: "fTemplates", predicate: FTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
9489
9563
  @if (rendered()) {
9490
9564
  <div
9491
- class="fixed inset-0 z-999 flex p-4"
9565
+ class="fixed inset-0 flex p-4"
9566
+ [style.z-index]="zIndex()"
9492
9567
  [class]="containerPositionClass()"
9493
9568
  [class.pointer-events-none]="!modal()"
9494
9569
  >
@@ -9579,7 +9654,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
9579
9654
  args: [{ selector: 'f-dialog', imports: [NgTemplateOutlet, UiIconComponent], host: { '(document:keydown.escape)': 'onEscape()' }, template: `
9580
9655
  @if (rendered()) {
9581
9656
  <div
9582
- class="fixed inset-0 z-999 flex p-4"
9657
+ class="fixed inset-0 flex p-4"
9658
+ [style.z-index]="zIndex()"
9583
9659
  [class]="containerPositionClass()"
9584
9660
  [class.pointer-events-none]="!modal()"
9585
9661
  >
@@ -9670,7 +9746,7 @@ const CLOSE_ANIMATION_MS = 200;
9670
9746
  const FOCUSABLE_SELECTOR$1 = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
9671
9747
  class DrawerComponent {
9672
9748
  static idCounter = 0;
9673
- _doc = inject(DOCUMENT);
9749
+ _overlayStack = inject(OverlayStackService);
9674
9750
  headerId = `f-drawer-header-${++DrawerComponent.idCounter}`;
9675
9751
  header = input('', /* @ts-ignore */
9676
9752
  ...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
@@ -9743,36 +9819,52 @@ class DrawerComponent {
9743
9819
  _closing = signal(false, /* @ts-ignore */
9744
9820
  ...(ngDevMode ? [{ debugName: "_closing" }] : /* istanbul ignore next */ []));
9745
9821
  closing = this._closing.asReadonly();
9822
+ _zIndex = signal(null, /* @ts-ignore */
9823
+ ...(ngDevMode ? [{ debugName: "_zIndex" }] : /* istanbul ignore next */ []));
9824
+ zIndex = this._zIndex.asReadonly();
9746
9825
  panelRef = viewChild('panel', /* @ts-ignore */
9747
9826
  ...(ngDevMode ? [{ debugName: "panelRef" }] : /* istanbul ignore next */ []));
9748
9827
  _previouslyFocused = null;
9828
+ _scrollLocked = false;
9749
9829
  constructor() {
9750
9830
  effect(() => {
9751
9831
  if (this.visible()) {
9752
9832
  this._closing.set(false);
9753
9833
  this._rendered.set(true);
9834
+ this._zIndex.set(this._overlayStack.open());
9754
9835
  this._previouslyFocused =
9755
9836
  typeof document !== 'undefined'
9756
9837
  ? document.activeElement
9757
9838
  : null;
9758
- if (this.modal() && this.blockScroll())
9759
- this._doc.body.style.overflow = 'hidden';
9839
+ if (this.modal() && this.blockScroll()) {
9840
+ this._overlayStack.lockScroll();
9841
+ this._scrollLocked = true;
9842
+ }
9760
9843
  this.onShow.emit();
9761
9844
  setTimeout(() => this.focusPanel(), 0);
9762
9845
  }
9763
9846
  else if (this._rendered()) {
9764
9847
  this._closing.set(true);
9765
- if (this.modal() && this.blockScroll())
9766
- this._doc.body.style.overflow = '';
9848
+ if (this._scrollLocked) {
9849
+ this._overlayStack.unlockScroll();
9850
+ this._scrollLocked = false;
9851
+ }
9767
9852
  if (this.returnFocusOnClose())
9768
9853
  this._previouslyFocused?.focus();
9769
9854
  this._previouslyFocused = null;
9770
9855
  setTimeout(() => {
9771
9856
  this._rendered.set(false);
9772
9857
  this._closing.set(false);
9858
+ this._zIndex.set(null);
9773
9859
  }, CLOSE_ANIMATION_MS);
9774
9860
  }
9775
9861
  });
9862
+ inject(DestroyRef).onDestroy(() => {
9863
+ if (this._scrollLocked) {
9864
+ this._overlayStack.unlockScroll();
9865
+ this._scrollLocked = false;
9866
+ }
9867
+ });
9776
9868
  }
9777
9869
  onEscape() {
9778
9870
  if (this.visible() && this.closeOnEscape())
@@ -9821,7 +9913,8 @@ class DrawerComponent {
9821
9913
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: DrawerComponent, isStandalone: true, selector: "f-drawer", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, fullScreen: { classPropertyName: "fullScreen", publicName: "fullScreen", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, dismissable: { classPropertyName: "dismissable", publicName: "dismissable", isSignal: true, isRequired: false, transformFunction: null }, blockScroll: { classPropertyName: "blockScroll", publicName: "blockScroll", isSignal: true, isRequired: false, transformFunction: null }, returnFocusOnClose: { classPropertyName: "returnFocusOnClose", publicName: "returnFocusOnClose", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", onShow: "onShow", onHide: "onHide" }, host: { listeners: { "document:keydown.escape": "onEscape()" }, classAttribute: "block" }, queries: [{ propertyName: "headerRef", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "footerRef", first: true, predicate: ["footer"], descendants: true, isSignal: true }, { propertyName: "contentRef", first: true, predicate: ["content"], descendants: true, isSignal: true }, { propertyName: "fTemplates", predicate: FTemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
9822
9914
  @if (rendered()) {
9823
9915
  <div
9824
- class="fixed inset-0 z-999 flex"
9916
+ class="fixed inset-0 flex"
9917
+ [style.z-index]="zIndex()"
9825
9918
  [class.pointer-events-none]="!modal()"
9826
9919
  >
9827
9920
  @if (modal()) {
@@ -9889,7 +9982,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
9889
9982
  args: [{ selector: 'f-drawer', imports: [UiIconComponent, NgTemplateOutlet], host: { class: 'block', '(document:keydown.escape)': 'onEscape()' }, template: `
9890
9983
  @if (rendered()) {
9891
9984
  <div
9892
- class="fixed inset-0 z-999 flex"
9985
+ class="fixed inset-0 flex"
9986
+ [style.z-index]="zIndex()"
9893
9987
  [class.pointer-events-none]="!modal()"
9894
9988
  >
9895
9989
  @if (modal()) {
@@ -20678,8 +20772,12 @@ class SpeedDialComponent {
20678
20772
  onHide = output();
20679
20773
  onVisibleChange = output();
20680
20774
  _el = inject(ElementRef);
20775
+ _overlayStack = inject(OverlayStackService);
20681
20776
  _toggleBtn = viewChild('toggleButton', /* @ts-ignore */
20682
20777
  ...(ngDevMode ? [{ debugName: "_toggleBtn" }] : /* istanbul ignore next */ []));
20778
+ _maskZIndex = signal(null, /* @ts-ignore */
20779
+ ...(ngDevMode ? [{ debugName: "_maskZIndex" }] : /* istanbul ignore next */ []));
20780
+ maskZIndex = this._maskZIndex.asReadonly();
20683
20781
  hostClass = computed(() => `relative inline-flex ${this.styleClass()}`, /* @ts-ignore */
20684
20782
  ...(ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []));
20685
20783
  effectiveRadius = computed(() => this.radius() || this.model().length * 20, /* @ts-ignore */
@@ -20749,6 +20847,8 @@ class SpeedDialComponent {
20749
20847
  if (this.visible() || this.disabled())
20750
20848
  return;
20751
20849
  this.visible.set(true);
20850
+ if (this.mask())
20851
+ this._maskZIndex.set(this._overlayStack.open());
20752
20852
  this.onVisibleChange.emit(true);
20753
20853
  this.onShow.emit();
20754
20854
  }
@@ -20756,6 +20856,7 @@ class SpeedDialComponent {
20756
20856
  if (!this.visible())
20757
20857
  return;
20758
20858
  this.visible.set(false);
20859
+ this._maskZIndex.set(null);
20759
20860
  this.onVisibleChange.emit(false);
20760
20861
  this.onHide.emit();
20761
20862
  }
@@ -20818,7 +20919,8 @@ class SpeedDialComponent {
20818
20919
  </div>
20819
20920
  @if (mask() && visible()) {
20820
20921
  <div
20821
- class="fixed inset-0 z-999 bg-(--f-mask-background)"
20922
+ class="fixed inset-0 bg-(--f-mask-background)"
20923
+ [style.z-index]="maskZIndex()"
20822
20924
  (click)="hide()"
20823
20925
  ></div>
20824
20926
  }
@@ -20878,7 +20980,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
20878
20980
  </div>
20879
20981
  @if (mask() && visible()) {
20880
20982
  <div
20881
- class="fixed inset-0 z-999 bg-(--f-mask-background)"
20983
+ class="fixed inset-0 bg-(--f-mask-background)"
20984
+ [style.z-index]="maskZIndex()"
20882
20985
  (click)="hide()"
20883
20986
  ></div>
20884
20987
  }
@@ -22570,6 +22673,7 @@ class ConfirmPopupComponent {
22570
22673
  headerId = `f-confirmpopup-header-${++ConfirmPopupComponent.idCounter}`;
22571
22674
  descId = `f-confirmpopup-desc-${ConfirmPopupComponent.idCounter}`;
22572
22675
  confirmationService = inject(ConfirmationService);
22676
+ _overlayStack = inject(OverlayStackService);
22573
22677
  key = input(undefined, /* @ts-ignore */
22574
22678
  ...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
22575
22679
  acceptLabel = input('', /* @ts-ignore */
@@ -22598,6 +22702,9 @@ class ConfirmPopupComponent {
22598
22702
  _left = signal(0, /* @ts-ignore */
22599
22703
  ...(ngDevMode ? [{ debugName: "_left" }] : /* istanbul ignore next */ []));
22600
22704
  left = this._left.asReadonly();
22705
+ _zIndex = signal(null, /* @ts-ignore */
22706
+ ...(ngDevMode ? [{ debugName: "_zIndex" }] : /* istanbul ignore next */ []));
22707
+ zIndex = this._zIndex.asReadonly();
22601
22708
  panelRef = viewChild('panel', /* @ts-ignore */
22602
22709
  ...(ngDevMode ? [{ debugName: "panelRef" }] : /* istanbul ignore next */ []));
22603
22710
  activeConfirmation = computed(() => {
@@ -22611,11 +22718,15 @@ class ConfirmPopupComponent {
22611
22718
  effect(() => {
22612
22719
  const c = this.activeConfirmation();
22613
22720
  if (c?.target) {
22721
+ this._zIndex.set(this._overlayStack.open());
22614
22722
  this.position(c.target);
22615
22723
  setTimeout(() => {
22616
22724
  this.adjustForViewport(c.target);
22617
22725
  }, 0);
22618
22726
  }
22727
+ else {
22728
+ this._zIndex.set(null);
22729
+ }
22619
22730
  });
22620
22731
  if (typeof window !== 'undefined') {
22621
22732
  fromEvent(window, 'resize')
@@ -22717,11 +22828,12 @@ class ConfirmPopupComponent {
22717
22828
  @if (c.target) {
22718
22829
  <div
22719
22830
  #panel
22720
- class="confirmpopup-panel fixed z-50 w-72 bg-(--f-overlay-popover-background) border border-(--f-content-border-color) f-overlay p-4"
22831
+ class="confirmpopup-panel fixed w-72 bg-(--f-overlay-popover-background) border border-(--f-content-border-color) f-overlay p-4"
22721
22832
  [class]="styleClass()"
22722
22833
  [style]="style()"
22723
22834
  [style.top.px]="top()"
22724
22835
  [style.left.px]="left()"
22836
+ [style.z-index]="zIndex()"
22725
22837
  role="alertdialog"
22726
22838
  [attr.aria-labelledby]="c.header ? headerId : null"
22727
22839
  [attr.aria-describedby]="c.message ? descId : null"
@@ -22778,11 +22890,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
22778
22890
  @if (c.target) {
22779
22891
  <div
22780
22892
  #panel
22781
- class="confirmpopup-panel fixed z-50 w-72 bg-(--f-overlay-popover-background) border border-(--f-content-border-color) f-overlay p-4"
22893
+ class="confirmpopup-panel fixed w-72 bg-(--f-overlay-popover-background) border border-(--f-content-border-color) f-overlay p-4"
22782
22894
  [class]="styleClass()"
22783
22895
  [style]="style()"
22784
22896
  [style.top.px]="top()"
22785
22897
  [style.left.px]="left()"
22898
+ [style.z-index]="zIndex()"
22786
22899
  role="alertdialog"
22787
22900
  [attr.aria-labelledby]="c.header ? headerId : null"
22788
22901
  [attr.aria-describedby]="c.message ? descId : null"
@@ -22833,10 +22946,14 @@ class DynamicDialogRef {
22833
22946
  _closeFn;
22834
22947
  _onClose = new Subject();
22835
22948
  onClose = this._onClose.asObservable();
22949
+ _closed = false;
22836
22950
  constructor(_closeFn) {
22837
22951
  this._closeFn = _closeFn;
22838
22952
  }
22839
22953
  close(result) {
22954
+ if (this._closed)
22955
+ return;
22956
+ this._closed = true;
22840
22957
  this._onClose.next(result);
22841
22958
  this._onClose.complete();
22842
22959
  this._closeFn(result);
@@ -22846,17 +22963,24 @@ const DYNAMIC_DIALOG_DATA = new InjectionToken('DYNAMIC_DIALOG_DATA');
22846
22963
  const DYNAMIC_DIALOG_REF = new InjectionToken('DYNAMIC_DIALOG_REF');
22847
22964
  class DynamicDialogService {
22848
22965
  static idCounter = 0;
22966
+ _overlayStack = inject(OverlayStackService);
22849
22967
  _states = signal([], /* @ts-ignore */
22850
22968
  ...(ngDevMode ? [{ debugName: "_states" }] : /* istanbul ignore next */ []));
22851
22969
  states = this._states.asReadonly();
22852
22970
  open(component, config = {}) {
22853
22971
  const id = ++DynamicDialogService.idCounter;
22972
+ const zIndex = this._overlayStack.open();
22973
+ const isModal = config.modal !== false;
22974
+ if (isModal)
22975
+ this._overlayStack.lockScroll();
22854
22976
  const ref = new DynamicDialogRef(() => {
22977
+ if (isModal)
22978
+ this._overlayStack.unlockScroll();
22855
22979
  this._states.update((list) => list.filter((s) => s.id !== id));
22856
22980
  });
22857
22981
  this._states.update((list) => [
22858
22982
  ...list,
22859
- { id, component, config, ref: ref },
22983
+ { id, component, config, ref: ref, zIndex },
22860
22984
  ]);
22861
22985
  return ref;
22862
22986
  }
@@ -22874,7 +22998,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
22874
22998
  class DynamicDialogComponent {
22875
22999
  dialogService = inject(DynamicDialogService);
22876
23000
  _parentInjector = inject(Injector);
22877
- _doc = inject(DOCUMENT);
22878
23001
  injectorCache = new Map();
22879
23002
  constructor() {
22880
23003
  effect(() => {
@@ -22884,13 +23007,6 @@ class DynamicDialogComponent {
22884
23007
  this.injectorCache.delete(id);
22885
23008
  }
22886
23009
  });
22887
- effect(() => {
22888
- const anyModal = this.dialogService.states().some((s) => s.config.modal !== false);
22889
- this._doc.body.style.overflow = anyModal ? 'hidden' : '';
22890
- });
22891
- inject(DestroyRef).onDestroy(() => {
22892
- this._doc.body.style.overflow = '';
22893
- });
22894
23010
  }
22895
23011
  childInjector(state) {
22896
23012
  let injector = this.injectorCache.get(state.id);
@@ -22929,8 +23045,8 @@ class DynamicDialogComponent {
22929
23045
  }
22930
23046
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: DynamicDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
22931
23047
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: DynamicDialogComponent, isStandalone: true, selector: "f-dynamicdialog", host: { listeners: { "document:keydown.escape": "onEscape()" }, classAttribute: "block" }, ngImport: i0, template: `
22932
- @for (s of dialogService.states(); track s.id; let i = $index) {
22933
- <div class="fixed inset-0 flex items-center justify-center p-4" [class.pointer-events-none]="s.config.modal === false" [style.z-index]="40 + i * 2">
23048
+ @for (s of dialogService.states(); track s.id) {
23049
+ <div class="fixed inset-0 flex items-center justify-center p-4" [class.pointer-events-none]="s.config.modal === false" [style.z-index]="s.zIndex">
22934
23050
  @if (s.config.modal !== false) {
22935
23051
  <div
22936
23052
  class="dynamicdialog-backdrop absolute inset-0 bg-black/50 backdrop-blur-[2px]"
@@ -22975,8 +23091,8 @@ class DynamicDialogComponent {
22975
23091
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: DynamicDialogComponent, decorators: [{
22976
23092
  type: Component,
22977
23093
  args: [{ selector: 'f-dynamicdialog', imports: [NgComponentOutlet, UiIconComponent], host: { class: 'block', '(document:keydown.escape)': 'onEscape()' }, template: `
22978
- @for (s of dialogService.states(); track s.id; let i = $index) {
22979
- <div class="fixed inset-0 flex items-center justify-center p-4" [class.pointer-events-none]="s.config.modal === false" [style.z-index]="40 + i * 2">
23094
+ @for (s of dialogService.states(); track s.id) {
23095
+ <div class="fixed inset-0 flex items-center justify-center p-4" [class.pointer-events-none]="s.config.modal === false" [style.z-index]="s.zIndex">
22980
23096
  @if (s.config.modal !== false) {
22981
23097
  <div
22982
23098
  class="dynamicdialog-backdrop absolute inset-0 bg-black/50 backdrop-blur-[2px]"