@cqa-lib/cqa-ui 1.0.69 → 1.0.70
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.
- package/esm2020/lib/utils/tw-overlay-container.mjs +36 -42
- package/fesm2015/cqa-lib-cqa-ui.mjs +35 -41
- package/fesm2015/cqa-lib-cqa-ui.mjs.map +1 -1
- package/fesm2020/cqa-lib-cqa-ui.mjs +35 -41
- package/fesm2020/cqa-lib-cqa-ui.mjs.map +1 -1
- package/lib/utils/tw-overlay-container.d.ts +6 -7
- package/package.json +1 -1
|
@@ -4274,12 +4274,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
4274
4274
|
}] } });
|
|
4275
4275
|
|
|
4276
4276
|
/**
|
|
4277
|
-
*
|
|
4278
|
-
*
|
|
4279
|
-
* configured with important: '.cqa-ui-root' are applied inside overlays.
|
|
4277
|
+
* Custom overlay container that adds 'cqa-ui-root' class to individual overlay panes
|
|
4278
|
+
* containing library components, rather than to the entire container.
|
|
4280
4279
|
*
|
|
4281
|
-
*
|
|
4282
|
-
*
|
|
4280
|
+
* This ensures library CSS (scoped with .cqa-ui-root) only affects library overlays,
|
|
4281
|
+
* not portal overlays that may be open simultaneously.
|
|
4283
4282
|
*/
|
|
4284
4283
|
class TailwindOverlayContainer extends OverlayContainer {
|
|
4285
4284
|
constructor() {
|
|
@@ -4289,13 +4288,13 @@ class TailwindOverlayContainer extends OverlayContainer {
|
|
|
4289
4288
|
_createContainer() {
|
|
4290
4289
|
super._createContainer();
|
|
4291
4290
|
if (this._containerElement) {
|
|
4292
|
-
//
|
|
4291
|
+
// Never add cqa-ui-root to the container itself
|
|
4293
4292
|
this._containerElement.classList.remove('cqa-ui-root');
|
|
4294
|
-
// Use MutationObserver to detect when
|
|
4295
|
-
this.
|
|
4293
|
+
// Use MutationObserver to detect when overlay panes are created/destroyed
|
|
4294
|
+
this.observeOverlayPanes();
|
|
4296
4295
|
}
|
|
4297
4296
|
}
|
|
4298
|
-
|
|
4297
|
+
observeOverlayPanes() {
|
|
4299
4298
|
if (!this._containerElement)
|
|
4300
4299
|
return;
|
|
4301
4300
|
const observer = new MutationObserver(() => {
|
|
@@ -4304,49 +4303,44 @@ class TailwindOverlayContainer extends OverlayContainer {
|
|
|
4304
4303
|
cancelAnimationFrame(this.updateTimeout);
|
|
4305
4304
|
}
|
|
4306
4305
|
this.updateTimeout = requestAnimationFrame(() => {
|
|
4307
|
-
this.
|
|
4306
|
+
this.updateOverlayPaneClasses();
|
|
4308
4307
|
this.updateTimeout = null;
|
|
4309
4308
|
});
|
|
4310
4309
|
});
|
|
4311
4310
|
observer.observe(this._containerElement, {
|
|
4312
4311
|
childList: true,
|
|
4313
4312
|
subtree: true,
|
|
4313
|
+
attributes: true,
|
|
4314
|
+
attributeFilter: ['class']
|
|
4314
4315
|
});
|
|
4315
4316
|
// Also check immediately in case overlays already exist
|
|
4316
|
-
requestAnimationFrame(() => this.
|
|
4317
|
+
requestAnimationFrame(() => this.updateOverlayPaneClasses());
|
|
4317
4318
|
}
|
|
4318
|
-
|
|
4319
|
+
updateOverlayPaneClasses() {
|
|
4319
4320
|
if (!this._containerElement)
|
|
4320
4321
|
return;
|
|
4321
|
-
//
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
this._containerElement.classList.remove('cqa-ui-root');
|
|
4344
|
-
}
|
|
4345
|
-
// Note: If both library overlays and portal dialogs exist simultaneously,
|
|
4346
|
-
// the class will be present because library overlays need it. In this case,
|
|
4347
|
-
// portal dialogs may be affected by library CSS. To avoid this, ensure library
|
|
4348
|
-
// overlays are closed before opening portal dialogs, or use CSS specificity
|
|
4349
|
-
// to override library styles within portal dialogs.
|
|
4322
|
+
// Find all overlay panes in the container
|
|
4323
|
+
const allPanes = this._containerElement.querySelectorAll('.cdk-overlay-pane');
|
|
4324
|
+
allPanes.forEach((pane) => {
|
|
4325
|
+
// Check if this pane itself has library component classes
|
|
4326
|
+
// These classes are added via panelClass property in library components
|
|
4327
|
+
const hasLibraryDialog = pane.classList.contains('cqa-dialog-panel');
|
|
4328
|
+
const hasLibraryBackdrop = pane.classList.contains('cqa-dialog-backdrop');
|
|
4329
|
+
const hasLibrarySelect = pane.classList.contains('ctc-select-panel');
|
|
4330
|
+
const hasLibraryDatePicker = pane.classList.contains('ctc-date-range-panel');
|
|
4331
|
+
// Also check for library components inside the pane (for dialogs that use mat-dialog-container)
|
|
4332
|
+
const hasLibraryDialogInside = pane.querySelector('.cqa-dialog-panel') !== null;
|
|
4333
|
+
const isLibraryOverlay = hasLibraryDialog || hasLibraryBackdrop || hasLibrarySelect ||
|
|
4334
|
+
hasLibraryDatePicker || hasLibraryDialogInside;
|
|
4335
|
+
if (isLibraryOverlay) {
|
|
4336
|
+
// This is a library overlay - add the class
|
|
4337
|
+
pane.classList.add('cqa-ui-root');
|
|
4338
|
+
}
|
|
4339
|
+
else {
|
|
4340
|
+
// This is NOT a library overlay (e.g., portal dialog) - ensure class is removed
|
|
4341
|
+
pane.classList.remove('cqa-ui-root');
|
|
4342
|
+
}
|
|
4343
|
+
});
|
|
4350
4344
|
}
|
|
4351
4345
|
}
|
|
4352
4346
|
TailwindOverlayContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TailwindOverlayContainer, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|