@cqa-lib/cqa-ui 1.0.12 → 1.0.13

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.
@@ -3361,16 +3361,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
3361
3361
  }] } });
3362
3362
 
3363
3363
  /**
3364
- * Ensures Angular CDK overlay content (e.g., MatSelect, Datepicker panels)
3364
+ * Ensures Angular CDK overlay content (e.g., MatSelect, Datepicker panels, library dialogs)
3365
3365
  * is nested under an element with id="cqa-ui-root" so Tailwind utilities
3366
3366
  * configured with important: '#cqa-ui-root' are applied inside overlays.
3367
+ *
3368
+ * IMPORTANT: Only sets id="cqa-ui-root" when library overlays are present.
3369
+ * Portal Material dialogs should NOT have this ID to prevent library CSS from affecting them.
3367
3370
  */
3368
3371
  class TailwindOverlayContainer extends OverlayContainer {
3372
+ constructor() {
3373
+ super(...arguments);
3374
+ this.libraryOverlayCount = 0;
3375
+ }
3369
3376
  _createContainer() {
3370
3377
  super._createContainer();
3371
3378
  if (this._containerElement) {
3379
+ // Don't set ID initially - we'll set it dynamically when library overlays are created
3380
+ this._containerElement.id = '';
3381
+ // Use MutationObserver to detect when library overlays are created/destroyed
3382
+ this.observeLibraryOverlays();
3383
+ }
3384
+ }
3385
+ observeLibraryOverlays() {
3386
+ if (!this._containerElement)
3387
+ return;
3388
+ const observer = new MutationObserver(() => {
3389
+ this.updateContainerId();
3390
+ });
3391
+ observer.observe(this._containerElement, {
3392
+ childList: true,
3393
+ subtree: true,
3394
+ });
3395
+ // Also check immediately in case overlays already exist
3396
+ setTimeout(() => this.updateContainerId(), 0);
3397
+ }
3398
+ updateContainerId() {
3399
+ if (!this._containerElement)
3400
+ return;
3401
+ // Count library overlays (dialogs, select panels, datepicker panels)
3402
+ const libraryDialogs = this._containerElement.querySelectorAll('.cqa-dialog-panel').length;
3403
+ const libraryBackdrops = this._containerElement.querySelectorAll('.cqa-dialog-backdrop').length;
3404
+ const librarySelectPanels = this._containerElement.querySelectorAll('.ctc-select-panel').length;
3405
+ const libraryDatePanels = this._containerElement.querySelectorAll('.ctc-date-range-panel').length;
3406
+ const totalLibraryOverlays = libraryDialogs + libraryBackdrops + librarySelectPanels + libraryDatePanels;
3407
+ // Check for portal Material dialogs (those without .cqa-dialog-panel)
3408
+ const portalDialogs = this._containerElement.querySelectorAll('.mat-dialog-container:not(.cqa-dialog-panel)').length;
3409
+ if (totalLibraryOverlays > 0) {
3410
+ // Library overlays exist - set the ID
3372
3411
  this._containerElement.id = 'cqa-ui-root';
3373
3412
  }
3413
+ else if (portalDialogs > 0 && totalLibraryOverlays === 0) {
3414
+ // Only portal dialogs exist - remove the ID to prevent library CSS from affecting them
3415
+ this._containerElement.id = '';
3416
+ }
3417
+ // If both exist, keep the ID (library overlays need it, CSS resets will handle portal dialogs)
3374
3418
  }
3375
3419
  }
3376
3420
  TailwindOverlayContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TailwindOverlayContainer, deps: null, target: i0.ɵɵFactoryTarget.Injectable });