@tedi-design-system/angular 7.1.0-rc.10 → 7.1.0-rc.12
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.
|
@@ -1559,10 +1559,15 @@ class DropdownComponent {
|
|
|
1559
1559
|
}
|
|
1560
1560
|
setupScrollListener() {
|
|
1561
1561
|
this.cleanupScrollListener();
|
|
1562
|
-
this.scrollListener = this.renderer.listen(this.document, "scroll", () => {
|
|
1563
|
-
if (this.isOpen())
|
|
1564
|
-
|
|
1565
|
-
|
|
1562
|
+
this.scrollListener = this.renderer.listen(this.document, "scroll", (event) => {
|
|
1563
|
+
if (!this.isOpen())
|
|
1564
|
+
return;
|
|
1565
|
+
// Scrolling the dropdown panel itself must not close it
|
|
1566
|
+
const contentEl = this.dropdownContent().host.nativeElement;
|
|
1567
|
+
const target = event.target;
|
|
1568
|
+
if (target && contentEl.contains(target))
|
|
1569
|
+
return;
|
|
1570
|
+
this.hideDropdown();
|
|
1566
1571
|
}, { capture: true, passive: true });
|
|
1567
1572
|
}
|
|
1568
1573
|
cleanupScrollListener() {
|
|
@@ -5233,8 +5238,14 @@ class TextFieldComponent {
|
|
|
5233
5238
|
* Disables the input from a parent template (e.g. a wrapping field component).
|
|
5234
5239
|
* Combined with the reactive-forms disabled state and any input-group state.
|
|
5235
5240
|
*/
|
|
5236
|
-
|
|
5237
|
-
|
|
5241
|
+
disabledInput = input(false, ...(ngDevMode ? [{ debugName: "disabledInput",
|
|
5242
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
5243
|
+
alias: "disabled",
|
|
5244
|
+
transform: booleanAttribute }] : [{
|
|
5245
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
5246
|
+
alias: "disabled",
|
|
5247
|
+
transform: booleanAttribute,
|
|
5248
|
+
}]));
|
|
5238
5249
|
disabled = computed(() => this.disabledInput() ||
|
|
5239
5250
|
this.formDisabled() ||
|
|
5240
5251
|
(this.group?.disabled() ?? false), ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
@@ -9246,10 +9257,14 @@ class PopoverComponent {
|
|
|
9246
9257
|
}
|
|
9247
9258
|
setupScrollListener() {
|
|
9248
9259
|
this.cleanupScrollListener();
|
|
9249
|
-
this.scrollListener = this.renderer.listen(this.document, "scroll", () => {
|
|
9250
|
-
if (this.isOpen())
|
|
9251
|
-
|
|
9252
|
-
|
|
9260
|
+
this.scrollListener = this.renderer.listen(this.document, "scroll", (event) => {
|
|
9261
|
+
if (!this.isOpen())
|
|
9262
|
+
return;
|
|
9263
|
+
// Scrolling content inside the popover — or inside a nested overlay
|
|
9264
|
+
// opened from it — must not close it
|
|
9265
|
+
if (this.isInsideOverlay(event.target))
|
|
9266
|
+
return;
|
|
9267
|
+
this.hidePopover(false);
|
|
9253
9268
|
}, { capture: true, passive: true });
|
|
9254
9269
|
}
|
|
9255
9270
|
cleanupScrollListener() {
|
|
@@ -9297,20 +9312,28 @@ class PopoverComponent {
|
|
|
9297
9312
|
setTimeout(() => previousElement.focus());
|
|
9298
9313
|
}
|
|
9299
9314
|
}
|
|
9315
|
+
/**
|
|
9316
|
+
* Whether the event target belongs to this popover's own overlay, or to a
|
|
9317
|
+
* nested overlay opened from inside it.
|
|
9318
|
+
*
|
|
9319
|
+
* Nested overlays (e.g. a month/year dropdown in the date-picker header)
|
|
9320
|
+
* render in their own pane within the shared CDK overlay container, not
|
|
9321
|
+
* inside this popover's overlayElement. Interacting with, focusing into or
|
|
9322
|
+
* scrolling such a child overlay must not dismiss the popover, so anything
|
|
9323
|
+
* inside the overlay container counts as internal.
|
|
9324
|
+
*/
|
|
9325
|
+
isInsideOverlay(target) {
|
|
9326
|
+
if (!target)
|
|
9327
|
+
return false;
|
|
9328
|
+
const overlayEl = this.connectedOverlay()?.overlayRef?.overlayElement;
|
|
9329
|
+
if (overlayEl?.contains(target))
|
|
9330
|
+
return true;
|
|
9331
|
+
return (target instanceof Element && !!target.closest(".cdk-overlay-container"));
|
|
9332
|
+
}
|
|
9300
9333
|
handleClosePopoverEvent(e) {
|
|
9301
9334
|
const triggerEl = this.popoverTrigger().host.nativeElement;
|
|
9302
|
-
const containerEl = this.connectedOverlay()?.overlayRef?.overlayElement;
|
|
9303
9335
|
const target = e.target;
|
|
9304
|
-
if (!target || triggerEl.contains(target) ||
|
|
9305
|
-
return;
|
|
9306
|
-
}
|
|
9307
|
-
// Nested overlays opened from inside the popover (e.g. a month/year
|
|
9308
|
-
// dropdown in the date-picker header) render in their own pane within the
|
|
9309
|
-
// shared CDK overlay container, not inside this popover's overlayElement.
|
|
9310
|
-
// Interacting with — or focusing into — such a child overlay must not
|
|
9311
|
-
// dismiss the popover, so ignore events originating anywhere inside the
|
|
9312
|
-
// overlay container.
|
|
9313
|
-
if (target.closest(".cdk-overlay-container")) {
|
|
9336
|
+
if (!target || triggerEl.contains(target) || this.isInsideOverlay(target)) {
|
|
9314
9337
|
return;
|
|
9315
9338
|
}
|
|
9316
9339
|
this.hidePopover(true);
|
|
@@ -11115,10 +11138,15 @@ class SelectComponent {
|
|
|
11115
11138
|
}
|
|
11116
11139
|
setupScrollListener() {
|
|
11117
11140
|
this.cleanupScrollListener();
|
|
11118
|
-
this.scrollListener = this.renderer.listen(this.document, "scroll", () => {
|
|
11119
|
-
if (this.isOpen())
|
|
11120
|
-
|
|
11121
|
-
|
|
11141
|
+
this.scrollListener = this.renderer.listen(this.document, "scroll", (event) => {
|
|
11142
|
+
if (!this.isOpen())
|
|
11143
|
+
return;
|
|
11144
|
+
// Scrolling the option list itself must not close the dropdown
|
|
11145
|
+
const overlayEl = this.connectedOverlay()?.overlayRef?.overlayElement;
|
|
11146
|
+
const target = event.target;
|
|
11147
|
+
if (overlayEl && target && overlayEl.contains(target))
|
|
11148
|
+
return;
|
|
11149
|
+
this.closeDropdown();
|
|
11122
11150
|
}, { capture: true, passive: true });
|
|
11123
11151
|
}
|
|
11124
11152
|
cleanupScrollListener() {
|