@clr/angular 18.0.0-beta.1 → 18.0.0-beta.2
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/fesm2022/clr-angular-button.mjs +2 -2
- package/fesm2022/clr-angular-button.mjs.map +1 -1
- package/fesm2022/clr-angular-data-datagrid.mjs +12 -26
- package/fesm2022/clr-angular-data-datagrid.mjs.map +1 -1
- package/fesm2022/clr-angular-data-tree-view.mjs +2 -2
- package/fesm2022/clr-angular-data-tree-view.mjs.map +1 -1
- package/fesm2022/clr-angular-data.mjs +13 -27
- package/fesm2022/clr-angular-data.mjs.map +1 -1
- package/fesm2022/clr-angular-emphasis-alert.mjs +2 -2
- package/fesm2022/clr-angular-emphasis-alert.mjs.map +1 -1
- package/fesm2022/clr-angular-emphasis.mjs +2 -2
- package/fesm2022/clr-angular-emphasis.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-checkbox.mjs +13 -44
- package/fesm2022/clr-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-combobox.mjs +94 -61
- package/fesm2022/clr-angular-forms-combobox.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-common.mjs +61 -58
- package/fesm2022/clr-angular-forms-common.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-datalist.mjs +2 -14
- package/fesm2022/clr-angular-forms-datalist.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-datepicker.mjs +16 -24
- package/fesm2022/clr-angular-forms-datepicker.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-file-input.mjs +72 -55
- package/fesm2022/clr-angular-forms-file-input.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-input.mjs +4 -18
- package/fesm2022/clr-angular-forms-input.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-number-input.mjs +2 -14
- package/fesm2022/clr-angular-forms-number-input.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-password.mjs +2 -14
- package/fesm2022/clr-angular-forms-password.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-radio.mjs +13 -44
- package/fesm2022/clr-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-range.mjs +3 -16
- package/fesm2022/clr-angular-forms-range.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-select.mjs +3 -16
- package/fesm2022/clr-angular-forms-select.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-textarea.mjs +4 -17
- package/fesm2022/clr-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/clr-angular-forms.mjs +258 -358
- package/fesm2022/clr-angular-forms.mjs.map +1 -1
- package/fesm2022/clr-angular-modal.mjs +2 -2
- package/fesm2022/clr-angular-modal.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-common.mjs +151 -85
- package/fesm2022/clr-angular-popover-common.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-dropdown.mjs +7 -4
- package/fesm2022/clr-angular-popover-dropdown.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-signpost.mjs +27 -12
- package/fesm2022/clr-angular-popover-signpost.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-tooltip.mjs +4 -4
- package/fesm2022/clr-angular-popover-tooltip.mjs.map +1 -1
- package/fesm2022/clr-angular-popover.mjs +186 -102
- package/fesm2022/clr-angular-popover.mjs.map +1 -1
- package/fesm2022/clr-angular-stepper.mjs +4 -4
- package/fesm2022/clr-angular-stepper.mjs.map +1 -1
- package/fesm2022/clr-angular-utils.mjs +12 -47
- package/fesm2022/clr-angular-utils.mjs.map +1 -1
- package/fesm2022/clr-angular-wizard.mjs +19 -11
- package/fesm2022/clr-angular-wizard.mjs.map +1 -1
- package/fesm2022/clr-angular.mjs +491 -548
- package/fesm2022/clr-angular.mjs.map +1 -1
- package/package.json +2 -2
- package/popover/common/README.md +14 -12
- package/types/clr-angular-data-datagrid.d.ts +0 -10
- package/types/clr-angular-data.d.ts +0 -10
- package/types/clr-angular-forms-combobox.d.ts +11 -4
- package/types/clr-angular-forms-common.d.ts +9 -9
- package/types/clr-angular-forms-datepicker.d.ts +7 -0
- package/types/clr-angular-forms-file-input.d.ts +5 -2
- package/types/clr-angular-forms.d.ts +31 -15
- package/types/clr-angular-popover-common.d.ts +38 -13
- package/types/clr-angular-popover-dropdown.d.ts +2 -1
- package/types/clr-angular-popover-signpost.d.ts +14 -6
- package/types/clr-angular-popover.d.ts +52 -18
- package/types/clr-angular-utils.d.ts +4 -14
- package/types/clr-angular-wizard.d.ts +7 -4
- package/types/clr-angular.d.ts +91 -59
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { PLATFORM_ID, SkipSelf, Optional, Inject, Injectable, Input, Component, HostBinding, ContentChildren, HostListener, Directive, NgModule, ElementRef, InjectionToken, EventEmitter, Output, DOCUMENT, ContentChild, ViewChild } from '@angular/core';
|
|
3
3
|
import * as i2 from '@clr/angular/popover/common';
|
|
4
|
-
import { ClrPopoverHostDirective as ClrPopoverHostDirective$1, ClrPopoverType as ClrPopoverType$1, ClrPopoverPosition as ClrPopoverPosition$1, DROPDOWN_POSITIONS as DROPDOWN_POSITIONS$1,
|
|
4
|
+
import { ClrPopoverHostDirective as ClrPopoverHostDirective$1, ClrPopoverType as ClrPopoverType$1, ClrPopoverPosition as ClrPopoverPosition$1, DROPDOWN_POSITIONS as DROPDOWN_POSITIONS$1, POPOVER_HOST_ORIGIN as POPOVER_HOST_ORIGIN$1, ClrPopoverContent as ClrPopoverContent$1, ClrIfOpen as ClrIfOpen$1, SIGNPOST_POSITIONS as SIGNPOST_POSITIONS$1, ÇlrClrPopoverModuleNext as _lrClrPopoverModuleNext, TOOLTIP_POSITIONS as TOOLTIP_POSITIONS$1 } from '@clr/angular/popover/common';
|
|
5
5
|
import * as i1 from '@clr/angular/utils';
|
|
6
|
-
import { uniqueIdFactory, ArrowKeyDirection, Linkers, wrapObservable, customFocusableItemProvider, FOCUS_SERVICE_PROVIDER, FocusableItem, BASIC_FOCUSABLE_ITEM_PROVIDER, preventArrowKeyScroll, ClrPosition,
|
|
6
|
+
import { uniqueIdFactory, ArrowKeyDirection, Linkers, wrapObservable, customFocusableItemProvider, FOCUS_SERVICE_PROVIDER, FocusableItem, BASIC_FOCUSABLE_ITEM_PROVIDER, preventArrowKeyScroll, ClrPosition, Keys, ClrFocusOnViewInitModule } from '@clr/angular/utils';
|
|
7
7
|
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
8
|
-
import { ReplaySubject, of, Subject, merge, fromEvent } from 'rxjs';
|
|
8
|
+
import { ReplaySubject, of, Subject, merge, timer, switchMap, fromEvent } from 'rxjs';
|
|
9
9
|
import { map, filter } from 'rxjs/operators';
|
|
10
10
|
import * as i3 from '@clr/angular/icon';
|
|
11
11
|
import { ClrIcon, ClarityIcons, windowCloseIcon, infoCircleIcon } from '@clr/angular/icon';
|
|
@@ -192,6 +192,9 @@ class ClrDropdown {
|
|
|
192
192
|
this.subscriptions.push(dropdownService.changes.subscribe(value => (popoverService.open = value)));
|
|
193
193
|
this.subscriptions.push(popoverService.openChange.subscribe(() => cdr.markForCheck()));
|
|
194
194
|
}
|
|
195
|
+
openAtPoint(point) {
|
|
196
|
+
this.popoverService.openAtPoint(point);
|
|
197
|
+
}
|
|
195
198
|
ngOnDestroy() {
|
|
196
199
|
this.subscriptions.forEach(sub => sub.unsubscribe());
|
|
197
200
|
}
|
|
@@ -266,7 +269,7 @@ class ClrDropdownMenu {
|
|
|
266
269
|
ngOnDestroy() {
|
|
267
270
|
this.focusHandler.resetChildren();
|
|
268
271
|
}
|
|
269
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrDropdownMenu, deps: [{ token:
|
|
272
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrDropdownMenu, deps: [{ token: POPOVER_HOST_ORIGIN$1, optional: true }, { token: ClrDropdownMenu, optional: true, skipSelf: true }, { token: DropdownFocusHandler }, { token: i0.ElementRef }, { token: i2.ClrPopoverService }, { token: i2.ClrPopoverContent }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
270
273
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrDropdownMenu, isStandalone: false, selector: "clr-dropdown-menu", inputs: { position: ["clrPosition", "position"] }, host: { properties: { "class.dropdown-menu": "true", "attr.role": "\"menu\"", "class.is-off-screen": "this.isOffScreen" } }, queries: [{ propertyName: "items", predicate: FocusableItem }], hostDirectives: [{ directive: i2.ClrPopoverContent }], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
|
|
271
274
|
}
|
|
272
275
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrDropdownMenu, decorators: [{
|
|
@@ -285,7 +288,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
285
288
|
type: Optional
|
|
286
289
|
}, {
|
|
287
290
|
type: Inject,
|
|
288
|
-
args: [
|
|
291
|
+
args: [POPOVER_HOST_ORIGIN$1]
|
|
289
292
|
}] }, { type: ClrDropdownMenu, decorators: [{
|
|
290
293
|
type: Optional
|
|
291
294
|
}, {
|
|
@@ -316,7 +319,7 @@ class ClrDropdownTrigger {
|
|
|
316
319
|
this.isRootLevelToggle = false;
|
|
317
320
|
}
|
|
318
321
|
focusHandler.trigger = el.nativeElement;
|
|
319
|
-
popoverService.
|
|
322
|
+
popoverService.origin = el;
|
|
320
323
|
}
|
|
321
324
|
get active() {
|
|
322
325
|
return this.popoverService.open;
|
|
@@ -489,14 +492,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
489
492
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
490
493
|
*/
|
|
491
494
|
|
|
492
|
-
/*
|
|
493
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
494
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
495
|
-
* This software is released under MIT license.
|
|
496
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
497
|
-
*/
|
|
498
|
-
// Popovers might need to ignore click events on an element
|
|
499
|
-
// (eg: popover opens on focus on an input field. Clicks should be ignored in this case)
|
|
500
495
|
class ClrPopoverService {
|
|
501
496
|
constructor() {
|
|
502
497
|
this.panelClass = [];
|
|
@@ -508,6 +503,12 @@ class ClrPopoverService {
|
|
|
508
503
|
this._updatePosition = new Subject();
|
|
509
504
|
this._popoverVisible = new Subject();
|
|
510
505
|
}
|
|
506
|
+
get originElement() {
|
|
507
|
+
return this.origin instanceof ElementRef ? this.origin : null;
|
|
508
|
+
}
|
|
509
|
+
get originPoint() {
|
|
510
|
+
return this.origin && 'x' in this.origin && 'y' in this.origin ? this.origin : null;
|
|
511
|
+
}
|
|
511
512
|
get openChange() {
|
|
512
513
|
return this._openChange.asObservable();
|
|
513
514
|
}
|
|
@@ -555,6 +556,18 @@ class ClrPopoverService {
|
|
|
555
556
|
this.openEvent = event;
|
|
556
557
|
this.open = !this.open;
|
|
557
558
|
}
|
|
559
|
+
/**
|
|
560
|
+
* Opens the popover at a specific screen coordinate.
|
|
561
|
+
* Useful for context menus where the popover should appear at the cursor position.
|
|
562
|
+
*/
|
|
563
|
+
openAtPoint(point) {
|
|
564
|
+
if (this._open) {
|
|
565
|
+
this._open = false;
|
|
566
|
+
this._openChange.next(false);
|
|
567
|
+
}
|
|
568
|
+
this.origin = point;
|
|
569
|
+
this.open = true;
|
|
570
|
+
}
|
|
558
571
|
popoverVisibleEmit(visible) {
|
|
559
572
|
this._popoverVisible.next(visible);
|
|
560
573
|
}
|
|
@@ -567,8 +580,8 @@ class ClrPopoverService {
|
|
|
567
580
|
focusCloseButton() {
|
|
568
581
|
this.closeButtonRef.nativeElement?.focus();
|
|
569
582
|
}
|
|
570
|
-
|
|
571
|
-
this.
|
|
583
|
+
focusOrigin() {
|
|
584
|
+
this.originElement?.nativeElement?.focus({ preventScroll: true });
|
|
572
585
|
}
|
|
573
586
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
574
587
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverService }); }
|
|
@@ -704,52 +717,52 @@ function getOffset(key, type) {
|
|
|
704
717
|
};
|
|
705
718
|
}
|
|
706
719
|
}
|
|
707
|
-
const
|
|
720
|
+
const STANDARD_ORIGINS = {
|
|
708
721
|
// TOP
|
|
709
|
-
[ClrPopoverPosition.TOP_RIGHT]: {
|
|
710
|
-
[ClrPopoverPosition.TOP_MIDDLE]: {
|
|
711
|
-
[ClrPopoverPosition.TOP_LEFT]: {
|
|
722
|
+
[ClrPopoverPosition.TOP_RIGHT]: { origin: ClrPosition.TOP_CENTER, content: ClrPosition.BOTTOM_LEFT },
|
|
723
|
+
[ClrPopoverPosition.TOP_MIDDLE]: { origin: ClrPosition.TOP_CENTER, content: ClrPosition.BOTTOM_CENTER },
|
|
724
|
+
[ClrPopoverPosition.TOP_LEFT]: { origin: ClrPosition.TOP_CENTER, content: ClrPosition.BOTTOM_RIGHT },
|
|
712
725
|
// LEFT
|
|
713
|
-
[ClrPopoverPosition.LEFT]: {
|
|
714
|
-
[ClrPopoverPosition.LEFT_TOP]: {
|
|
715
|
-
[ClrPopoverPosition.LEFT_MIDDLE]: {
|
|
716
|
-
[ClrPopoverPosition.LEFT_BOTTOM]: {
|
|
726
|
+
[ClrPopoverPosition.LEFT]: { origin: ClrPosition.LEFT_CENTER, content: ClrPosition.RIGHT_TOP },
|
|
727
|
+
[ClrPopoverPosition.LEFT_TOP]: { origin: ClrPosition.LEFT_CENTER, content: ClrPosition.RIGHT_BOTTOM },
|
|
728
|
+
[ClrPopoverPosition.LEFT_MIDDLE]: { origin: ClrPosition.LEFT_CENTER, content: ClrPosition.RIGHT_CENTER },
|
|
729
|
+
[ClrPopoverPosition.LEFT_BOTTOM]: { origin: ClrPosition.LEFT_CENTER, content: ClrPosition.RIGHT_TOP },
|
|
717
730
|
// RIGHT
|
|
718
|
-
[ClrPopoverPosition.RIGHT]: {
|
|
719
|
-
[ClrPopoverPosition.RIGHT_TOP]: {
|
|
720
|
-
[ClrPopoverPosition.RIGHT_MIDDLE]: {
|
|
721
|
-
[ClrPopoverPosition.RIGHT_BOTTOM]: {
|
|
731
|
+
[ClrPopoverPosition.RIGHT]: { origin: ClrPosition.RIGHT_CENTER, content: ClrPosition.LEFT_TOP },
|
|
732
|
+
[ClrPopoverPosition.RIGHT_TOP]: { origin: ClrPosition.RIGHT_CENTER, content: ClrPosition.LEFT_BOTTOM },
|
|
733
|
+
[ClrPopoverPosition.RIGHT_MIDDLE]: { origin: ClrPosition.RIGHT_CENTER, content: ClrPosition.LEFT_CENTER },
|
|
734
|
+
[ClrPopoverPosition.RIGHT_BOTTOM]: { origin: ClrPosition.RIGHT_CENTER, content: ClrPosition.LEFT_TOP },
|
|
722
735
|
// BOTTOM
|
|
723
|
-
[ClrPopoverPosition.BOTTOM_RIGHT]: {
|
|
724
|
-
[ClrPopoverPosition.BOTTOM_MIDDLE]: {
|
|
725
|
-
[ClrPopoverPosition.BOTTOM_LEFT]: {
|
|
736
|
+
[ClrPopoverPosition.BOTTOM_RIGHT]: { origin: ClrPosition.BOTTOM_CENTER, content: ClrPosition.TOP_LEFT },
|
|
737
|
+
[ClrPopoverPosition.BOTTOM_MIDDLE]: { origin: ClrPosition.BOTTOM_CENTER, content: ClrPosition.TOP_CENTER },
|
|
738
|
+
[ClrPopoverPosition.BOTTOM_LEFT]: { origin: ClrPosition.BOTTOM_CENTER, content: ClrPosition.TOP_RIGHT },
|
|
726
739
|
};
|
|
727
|
-
const
|
|
740
|
+
const DROPDOWN_ORIGINS = {
|
|
728
741
|
// TOP
|
|
729
|
-
[ClrPopoverPosition.TOP_RIGHT]: {
|
|
730
|
-
[ClrPopoverPosition.TOP_LEFT]: {
|
|
742
|
+
[ClrPopoverPosition.TOP_RIGHT]: { origin: ClrPosition.TOP_RIGHT, content: ClrPosition.BOTTOM_RIGHT },
|
|
743
|
+
[ClrPopoverPosition.TOP_LEFT]: { origin: ClrPosition.TOP_LEFT, content: ClrPosition.BOTTOM_LEFT },
|
|
731
744
|
// LEFT
|
|
732
|
-
[ClrPopoverPosition.LEFT_TOP]: {
|
|
733
|
-
[ClrPopoverPosition.LEFT_BOTTOM]: {
|
|
745
|
+
[ClrPopoverPosition.LEFT_TOP]: { origin: ClrPosition.LEFT_TOP, content: ClrPosition.TOP_RIGHT },
|
|
746
|
+
[ClrPopoverPosition.LEFT_BOTTOM]: { origin: ClrPosition.LEFT_BOTTOM, content: ClrPosition.BOTTOM_RIGHT },
|
|
734
747
|
// RIGHT
|
|
735
|
-
[ClrPopoverPosition.RIGHT_TOP]: {
|
|
736
|
-
[ClrPopoverPosition.RIGHT_BOTTOM]: {
|
|
748
|
+
[ClrPopoverPosition.RIGHT_TOP]: { origin: ClrPosition.RIGHT_TOP, content: ClrPosition.LEFT_TOP },
|
|
749
|
+
[ClrPopoverPosition.RIGHT_BOTTOM]: { origin: ClrPosition.RIGHT_BOTTOM, content: ClrPosition.LEFT_BOTTOM },
|
|
737
750
|
// BOTTOM
|
|
738
|
-
[ClrPopoverPosition.BOTTOM_RIGHT]: {
|
|
739
|
-
[ClrPopoverPosition.BOTTOM_LEFT]: {
|
|
751
|
+
[ClrPopoverPosition.BOTTOM_RIGHT]: { origin: ClrPosition.BOTTOM_LEFT, content: ClrPosition.TOP_RIGHT },
|
|
752
|
+
[ClrPopoverPosition.BOTTOM_LEFT]: { origin: ClrPosition.BOTTOM_RIGHT, content: ClrPosition.TOP_LEFT },
|
|
740
753
|
};
|
|
741
754
|
function mapPopoverKeyToPosition(key, type) {
|
|
742
755
|
let offset = getOffset(key, type);
|
|
743
|
-
const defaultPosition = {
|
|
744
|
-
const {
|
|
756
|
+
const defaultPosition = { origin: ClrPosition.BOTTOM_LEFT, content: ClrPosition.TOP_LEFT };
|
|
757
|
+
const { origin, content } = (type === ClrPopoverType.DROPDOWN ? DROPDOWN_ORIGINS[key] : STANDARD_ORIGINS[key]) ?? defaultPosition;
|
|
745
758
|
return {
|
|
746
|
-
...
|
|
759
|
+
...getOriginPosition(origin),
|
|
747
760
|
...getContentPosition(content),
|
|
748
761
|
...offset,
|
|
749
762
|
panelClass: key,
|
|
750
763
|
};
|
|
751
764
|
}
|
|
752
|
-
function
|
|
765
|
+
function getOriginPosition(key) {
|
|
753
766
|
switch (key) {
|
|
754
767
|
// TOP Positions
|
|
755
768
|
case ClrPosition.TOP_LEFT:
|
|
@@ -968,11 +981,19 @@ class ClrPopoverContent {
|
|
|
968
981
|
set scrollToClose(scrollToClose) {
|
|
969
982
|
this._scrollToClose = !!scrollToClose;
|
|
970
983
|
}
|
|
984
|
+
set contentOrigin(origin) {
|
|
985
|
+
if (origin instanceof Element) {
|
|
986
|
+
this.popoverService.origin = new ElementRef(origin);
|
|
987
|
+
}
|
|
988
|
+
else {
|
|
989
|
+
this.popoverService.origin = origin;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
971
992
|
get positionStrategy() {
|
|
972
993
|
return this.overlay
|
|
973
994
|
.position()
|
|
974
|
-
.flexibleConnectedTo(this.popoverService.
|
|
975
|
-
.setOrigin(this.popoverService.
|
|
995
|
+
.flexibleConnectedTo(this.popoverService.origin)
|
|
996
|
+
.setOrigin(this.popoverService.origin)
|
|
976
997
|
.withPush(true)
|
|
977
998
|
.withPositions([this.preferredPosition, ...this._availablePositions])
|
|
978
999
|
.withFlexibleDimensions(true);
|
|
@@ -1015,13 +1036,38 @@ class ClrPopoverContent {
|
|
|
1015
1036
|
}), this.popoverService.updatePositionChange().subscribe(() => {
|
|
1016
1037
|
this.overlayRef?.updatePosition();
|
|
1017
1038
|
}), this.overlayRef.keydownEvents().subscribe(event => {
|
|
1018
|
-
if (event && event.key &&
|
|
1039
|
+
if (event && event.key && event.key === Keys.Escape && !hasModifierKey(event)) {
|
|
1019
1040
|
event.preventDefault();
|
|
1020
1041
|
this.closePopover();
|
|
1021
1042
|
}
|
|
1022
|
-
}), this.
|
|
1043
|
+
}), this.popoverService.originPoint
|
|
1044
|
+
? this.createPointBasedOutsideClickSubscription()
|
|
1045
|
+
: this.createElementBasedOutsideClickSubscription());
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Point-based origins (context menus) delay the subscription to avoid the
|
|
1049
|
+
* mouseup from the same right-click that opened the popover.
|
|
1050
|
+
*/
|
|
1051
|
+
createPointBasedOutsideClickSubscription() {
|
|
1052
|
+
return timer(500)
|
|
1053
|
+
.pipe(switchMap(() => this.overlayRef.outsidePointerEvents()))
|
|
1054
|
+
.subscribe(event => {
|
|
1055
|
+
if (this.elementRef?.nativeElement?.contains(event.target)) {
|
|
1056
|
+
return;
|
|
1057
|
+
}
|
|
1058
|
+
if (this._outsideClickClose) {
|
|
1059
|
+
this.closePopover();
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Element-based origins close on outside clicks and suppress toggle-button
|
|
1065
|
+
* re-clicks so the popover doesn't immediately reopen.
|
|
1066
|
+
*/
|
|
1067
|
+
createElementBasedOutsideClickSubscription() {
|
|
1068
|
+
return this.overlayRef.outsidePointerEvents().subscribe(event => {
|
|
1023
1069
|
// web components (cds-icon) register as outside pointer events, so if the event target is inside the content panel return early
|
|
1024
|
-
if (this.elementRef
|
|
1070
|
+
if (this.elementRef?.nativeElement?.contains(event.target)) {
|
|
1025
1071
|
return;
|
|
1026
1072
|
}
|
|
1027
1073
|
// Check if the same element that opened the popover is the same element triggering the outside pointer events (toggle button)
|
|
@@ -1035,7 +1081,7 @@ class ClrPopoverContent {
|
|
|
1035
1081
|
if (this._outsideClickClose || isToggleButton) {
|
|
1036
1082
|
this.closePopover();
|
|
1037
1083
|
}
|
|
1038
|
-
})
|
|
1084
|
+
});
|
|
1039
1085
|
}
|
|
1040
1086
|
resetPosition() {
|
|
1041
1087
|
if (this.overlayRef) {
|
|
@@ -1049,11 +1095,13 @@ class ClrPopoverContent {
|
|
|
1049
1095
|
}
|
|
1050
1096
|
this.removeOverlay();
|
|
1051
1097
|
this.popoverService.open = false;
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
document.activeElement ===
|
|
1055
|
-
|
|
1056
|
-
|
|
1098
|
+
if (this.popoverService.originElement) {
|
|
1099
|
+
const shouldFocusTrigger = this.popoverType !== ClrPopoverType.TOOLTIP &&
|
|
1100
|
+
(document.activeElement === document.body ||
|
|
1101
|
+
document.activeElement === this.popoverService.originElement.nativeElement);
|
|
1102
|
+
if (shouldFocusTrigger) {
|
|
1103
|
+
this.popoverService.focusOrigin();
|
|
1104
|
+
}
|
|
1057
1105
|
}
|
|
1058
1106
|
}
|
|
1059
1107
|
showOverlay() {
|
|
@@ -1071,15 +1119,17 @@ class ClrPopoverContent {
|
|
|
1071
1119
|
this.domPortal = new DomPortal(this.elementRef);
|
|
1072
1120
|
this.overlayRef.attach(this.domPortal);
|
|
1073
1121
|
}
|
|
1074
|
-
this.popoverService
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1122
|
+
if (this.popoverService.originElement) {
|
|
1123
|
+
this.popoverService.originElement.nativeElement.scrollIntoView({
|
|
1124
|
+
behavior: 'instant',
|
|
1125
|
+
block: 'nearest',
|
|
1126
|
+
inline: 'nearest',
|
|
1127
|
+
});
|
|
1128
|
+
this.setupIntersectionObserver();
|
|
1129
|
+
}
|
|
1080
1130
|
setTimeout(() => {
|
|
1081
1131
|
// Get Scrollable Parents
|
|
1082
|
-
this.
|
|
1132
|
+
this.listenToScrollEvents();
|
|
1083
1133
|
this.popoverService.popoverVisibleEmit(true);
|
|
1084
1134
|
if (this.elementRef?.nativeElement?.focus) {
|
|
1085
1135
|
this.elementRef.nativeElement.focus();
|
|
@@ -1126,30 +1176,46 @@ class ClrPopoverContent {
|
|
|
1126
1176
|
return scrollableParents;
|
|
1127
1177
|
}
|
|
1128
1178
|
/**
|
|
1129
|
-
* Uses IntersectionObserver to detect when the
|
|
1179
|
+
* Uses IntersectionObserver to detect when the origin element leaves the screen.
|
|
1130
1180
|
* This handles the "Close on Scroll" logic much cheaper than getBoundingClientRect.
|
|
1131
1181
|
*/
|
|
1132
1182
|
setupIntersectionObserver() {
|
|
1133
|
-
if (!this.popoverService.
|
|
1183
|
+
if (!this.popoverService.originElement || this.intersectionObserver) {
|
|
1134
1184
|
return;
|
|
1135
1185
|
}
|
|
1136
1186
|
this.intersectionObserver = new IntersectionObserver(entries => {
|
|
1137
1187
|
entries.forEach(entry => {
|
|
1138
|
-
// If the
|
|
1188
|
+
// If the origin is no longer visible (scrolled out of view)
|
|
1139
1189
|
if (!entry.isIntersecting && this.popoverService.open) {
|
|
1140
1190
|
this.zone.run(() => this.closePopover());
|
|
1141
1191
|
}
|
|
1142
1192
|
});
|
|
1143
1193
|
}, { root: null, threshold: 0.8 });
|
|
1144
|
-
this.intersectionObserver.observe(this.popoverService.
|
|
1194
|
+
this.intersectionObserver.observe(this.popoverService.originElement.nativeElement);
|
|
1145
1195
|
}
|
|
1146
|
-
|
|
1147
|
-
listenToMouseEvents() {
|
|
1196
|
+
listenToScrollEvents() {
|
|
1148
1197
|
if (!isPlatformBrowser(this.platformId)) {
|
|
1149
1198
|
return;
|
|
1150
1199
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1200
|
+
if (this.popoverService.originPoint) {
|
|
1201
|
+
this.listenToScrollForPointOrigin();
|
|
1202
|
+
}
|
|
1203
|
+
else {
|
|
1204
|
+
this.listenToScrollForElementOrigin();
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
// Point origins have no scrollable parent chain — close on any scroll.
|
|
1208
|
+
listenToScrollForPointOrigin() {
|
|
1209
|
+
this.zone.runOutsideAngular(() => {
|
|
1210
|
+
this.subscriptions.push(fromEvent(window, 'scroll', { passive: true, capture: true }).subscribe(() => {
|
|
1211
|
+
this.zone.run(() => this.closePopover());
|
|
1212
|
+
}));
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
// Element origins track ancestor scroll containers to reposition or close.
|
|
1216
|
+
listenToScrollForElementOrigin() {
|
|
1217
|
+
const originEl = this.getRootPopover(this)?.popoverService?.originElement?.nativeElement;
|
|
1218
|
+
const scrollableParents = this.getScrollableParents(originEl);
|
|
1153
1219
|
this.zone.runOutsideAngular(() => {
|
|
1154
1220
|
this.subscriptions.push(merge(...scrollableParents.map(parent => fromEvent(parent, 'scroll', { passive: true }))).subscribe(() => {
|
|
1155
1221
|
if (this._scrollToClose) {
|
|
@@ -1167,7 +1233,7 @@ class ClrPopoverContent {
|
|
|
1167
1233
|
return popover;
|
|
1168
1234
|
}
|
|
1169
1235
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverContent, deps: [{ token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i0.TemplateRef, optional: true }, { token: i1$1.OverlayContainer }, { token: ClrPopoverContent, optional: true, skipSelf: true }, { token: i1$1.Overlay }, { token: ClrPopoverService }, { token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1170
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrPopoverContent, isStandalone: true, selector: "[clrPopoverContent]", inputs: { open: ["clrPopoverContent", "open"], contentAt: ["clrPopoverContentAt", "contentAt"], availablePositions: ["clrPopoverContentAvailablePositions", "availablePositions"], contentType: ["clrPopoverContentType", "contentType"], outsideClickClose: ["clrPopoverContentOutsideClickToClose", "outsideClickClose"], scrollToClose: ["clrPopoverContentScrollToClose", "scrollToClose"] }, ngImport: i0 }); }
|
|
1236
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrPopoverContent, isStandalone: true, selector: "[clrPopoverContent]", inputs: { open: ["clrPopoverContent", "open"], contentAt: ["clrPopoverContentAt", "contentAt"], availablePositions: ["clrPopoverContentAvailablePositions", "availablePositions"], contentType: ["clrPopoverContentType", "contentType"], outsideClickClose: ["clrPopoverContentOutsideClickToClose", "outsideClickClose"], scrollToClose: ["clrPopoverContentScrollToClose", "scrollToClose"], contentOrigin: ["clrPopoverContentOrigin", "contentOrigin"] }, ngImport: i0 }); }
|
|
1171
1237
|
}
|
|
1172
1238
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverContent, decorators: [{
|
|
1173
1239
|
type: Directive,
|
|
@@ -1204,6 +1270,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1204
1270
|
}], scrollToClose: [{
|
|
1205
1271
|
type: Input,
|
|
1206
1272
|
args: ['clrPopoverContentScrollToClose']
|
|
1273
|
+
}], contentOrigin: [{
|
|
1274
|
+
type: Input,
|
|
1275
|
+
args: ['clrPopoverContentOrigin']
|
|
1207
1276
|
}] } });
|
|
1208
1277
|
|
|
1209
1278
|
/*
|
|
@@ -1212,19 +1281,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1212
1281
|
* This software is released under MIT license.
|
|
1213
1282
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
1214
1283
|
*/
|
|
1215
|
-
class
|
|
1284
|
+
class ClrPopoverOrigin {
|
|
1216
1285
|
constructor(popoverService, element) {
|
|
1217
|
-
popoverService.
|
|
1286
|
+
popoverService.origin = element;
|
|
1218
1287
|
}
|
|
1219
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type:
|
|
1220
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type:
|
|
1288
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverOrigin, deps: [{ token: ClrPopoverService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1289
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrPopoverOrigin, isStandalone: false, selector: "[clrPopoverOrigin]", host: { properties: { "class.clr-popover-origin": "true" } }, ngImport: i0 }); }
|
|
1221
1290
|
}
|
|
1222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type:
|
|
1291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverOrigin, decorators: [{
|
|
1223
1292
|
type: Directive,
|
|
1224
1293
|
args: [{
|
|
1225
|
-
selector: '[
|
|
1294
|
+
selector: '[clrPopoverOrigin]',
|
|
1226
1295
|
host: {
|
|
1227
|
-
'[class.clr-
|
|
1296
|
+
'[class.clr-popover-origin]': 'true',
|
|
1228
1297
|
},
|
|
1229
1298
|
standalone: false,
|
|
1230
1299
|
}]
|
|
@@ -1236,7 +1305,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1236
1305
|
* This software is released under MIT license.
|
|
1237
1306
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
1238
1307
|
*/
|
|
1239
|
-
const
|
|
1308
|
+
const POPOVER_HOST_ORIGIN = new InjectionToken('POPOVER_HOST_ORIGIN');
|
|
1240
1309
|
|
|
1241
1310
|
/*
|
|
1242
1311
|
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
@@ -1286,13 +1355,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1286
1355
|
*/
|
|
1287
1356
|
class ClrPopoverHostDirective {
|
|
1288
1357
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverHostDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1289
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrPopoverHostDirective, isStandalone: true, providers: [ClrPopoverService, { provide:
|
|
1358
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrPopoverHostDirective, isStandalone: true, providers: [ClrPopoverService, { provide: POPOVER_HOST_ORIGIN, useExisting: ElementRef }], hostDirectives: [{ directive: ClrStopEscapePropagationDirective }], ngImport: i0 }); }
|
|
1290
1359
|
}
|
|
1291
1360
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverHostDirective, decorators: [{
|
|
1292
1361
|
type: Directive,
|
|
1293
1362
|
args: [{
|
|
1294
1363
|
standalone: true,
|
|
1295
|
-
providers: [ClrPopoverService, { provide:
|
|
1364
|
+
providers: [ClrPopoverService, { provide: POPOVER_HOST_ORIGIN, useExisting: ElementRef }],
|
|
1296
1365
|
hostDirectives: [ClrStopEscapePropagationDirective],
|
|
1297
1366
|
}]
|
|
1298
1367
|
}] });
|
|
@@ -1398,12 +1467,12 @@ class ClrPopoverCloseButton {
|
|
|
1398
1467
|
this.closeChange = new EventEmitter();
|
|
1399
1468
|
this.subscriptions = [];
|
|
1400
1469
|
this.subscriptions.push(popoverService.openChange.pipe(filter(value => !value)).subscribe(() => {
|
|
1401
|
-
this.closeChange.
|
|
1470
|
+
this.closeChange.emit();
|
|
1402
1471
|
}));
|
|
1403
1472
|
}
|
|
1404
1473
|
handleClick(event) {
|
|
1405
1474
|
this.popoverService.toggleWithEvent(event);
|
|
1406
|
-
this.popoverService.
|
|
1475
|
+
this.popoverService.focusOrigin();
|
|
1407
1476
|
}
|
|
1408
1477
|
ngAfterViewInit() {
|
|
1409
1478
|
this.popoverService.closeButtonRef = this.elementRef;
|
|
@@ -1443,7 +1512,7 @@ class ClrPopoverOpenCloseButton {
|
|
|
1443
1512
|
this.openCloseChange = new EventEmitter();
|
|
1444
1513
|
this.subscriptions = [];
|
|
1445
1514
|
this.subscriptions.push(popoverService.openChange.subscribe(change => {
|
|
1446
|
-
this.openCloseChange.
|
|
1515
|
+
this.openCloseChange.emit(change);
|
|
1447
1516
|
}));
|
|
1448
1517
|
}
|
|
1449
1518
|
handleClick(event) {
|
|
@@ -1480,15 +1549,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1480
1549
|
*/
|
|
1481
1550
|
class ClrPopoverModuleNext {
|
|
1482
1551
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverModuleNext, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1483
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverModuleNext, declarations: [
|
|
1552
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverModuleNext, declarations: [ClrPopoverOrigin, ClrPopoverCloseButton, ClrPopoverOpenCloseButton], imports: [ClrPopoverContent, ClrIfOpen], exports: [ClrPopoverOrigin, ClrPopoverCloseButton, ClrPopoverOpenCloseButton, ClrPopoverContent, ClrIfOpen] }); }
|
|
1484
1553
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverModuleNext }); }
|
|
1485
1554
|
}
|
|
1486
1555
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrPopoverModuleNext, decorators: [{
|
|
1487
1556
|
type: NgModule,
|
|
1488
1557
|
args: [{
|
|
1489
1558
|
imports: [ClrPopoverContent, ClrIfOpen],
|
|
1490
|
-
declarations: [
|
|
1491
|
-
exports: [
|
|
1559
|
+
declarations: [ClrPopoverOrigin, ClrPopoverCloseButton, ClrPopoverOpenCloseButton],
|
|
1560
|
+
exports: [ClrPopoverOrigin, ClrPopoverCloseButton, ClrPopoverOpenCloseButton, ClrPopoverContent, ClrIfOpen],
|
|
1492
1561
|
}]
|
|
1493
1562
|
}] });
|
|
1494
1563
|
|
|
@@ -1587,7 +1656,7 @@ class ClrSignpostTrigger {
|
|
|
1587
1656
|
this.document = document;
|
|
1588
1657
|
}
|
|
1589
1658
|
ngOnInit() {
|
|
1590
|
-
this.popoverService.
|
|
1659
|
+
this.popoverService.origin = this.el;
|
|
1591
1660
|
this.signpostFocusManager.triggerEl = this.el.nativeElement;
|
|
1592
1661
|
this.subscriptions.push(this.popoverService.openChange.subscribe((isOpen) => {
|
|
1593
1662
|
this.ariaExpanded = isOpen;
|
|
@@ -1664,8 +1733,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1664
1733
|
*
|
|
1665
1734
|
*/
|
|
1666
1735
|
class ClrSignpost {
|
|
1667
|
-
constructor(commonStrings) {
|
|
1736
|
+
constructor(commonStrings, popoverService) {
|
|
1668
1737
|
this.commonStrings = commonStrings;
|
|
1738
|
+
this.popoverService = popoverService;
|
|
1669
1739
|
/**********
|
|
1670
1740
|
* @property useCustomTrigger
|
|
1671
1741
|
*
|
|
@@ -1674,6 +1744,11 @@ class ClrSignpost {
|
|
|
1674
1744
|
*
|
|
1675
1745
|
*/
|
|
1676
1746
|
this.useCustomTrigger = false;
|
|
1747
|
+
/**
|
|
1748
|
+
* Hides the default trigger button. Use when the signpost is opened
|
|
1749
|
+
* programmatically via `openAtPoint()` and no trigger icon is needed.
|
|
1750
|
+
*/
|
|
1751
|
+
this.hideTrigger = false;
|
|
1677
1752
|
}
|
|
1678
1753
|
/**********
|
|
1679
1754
|
* @property signPostTrigger
|
|
@@ -1685,9 +1760,15 @@ class ClrSignpost {
|
|
|
1685
1760
|
set customTrigger(trigger) {
|
|
1686
1761
|
this.useCustomTrigger = !!trigger;
|
|
1687
1762
|
}
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1763
|
+
get showDefaultTrigger() {
|
|
1764
|
+
return !this.useCustomTrigger && !this.hideTrigger;
|
|
1765
|
+
}
|
|
1766
|
+
openAtPoint(point) {
|
|
1767
|
+
this.popoverService.openAtPoint(point);
|
|
1768
|
+
}
|
|
1769
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrSignpost, deps: [{ token: i1.ClrCommonStringsService }, { token: i2.ClrPopoverService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1770
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrSignpost, isStandalone: false, selector: "clr-signpost", inputs: { signpostTriggerAriaLabel: ["clrSignpostTriggerAriaLabel", "signpostTriggerAriaLabel"], hideTrigger: ["clrSignpostHideTrigger", "hideTrigger"] }, host: { properties: { "class.signpost": "true" } }, providers: [SignpostFocusManager, SignpostIdService], queries: [{ propertyName: "customTrigger", first: true, predicate: ClrSignpostTrigger, descendants: true }], hostDirectives: [{ directive: i2.ClrPopoverHostDirective }], ngImport: i0, template: `
|
|
1771
|
+
@if (showDefaultTrigger) {
|
|
1691
1772
|
<button
|
|
1692
1773
|
type="button"
|
|
1693
1774
|
class="signpost-action btn btn-sm btn-icon btn-link"
|
|
@@ -1706,7 +1787,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1706
1787
|
args: [{
|
|
1707
1788
|
selector: 'clr-signpost',
|
|
1708
1789
|
template: `
|
|
1709
|
-
@if (
|
|
1790
|
+
@if (showDefaultTrigger) {
|
|
1710
1791
|
<button
|
|
1711
1792
|
type="button"
|
|
1712
1793
|
class="signpost-action btn btn-sm btn-icon btn-link"
|
|
@@ -1724,9 +1805,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1724
1805
|
hostDirectives: [ClrPopoverHostDirective$1],
|
|
1725
1806
|
standalone: false,
|
|
1726
1807
|
}]
|
|
1727
|
-
}], ctorParameters: () => [{ type: i1.ClrCommonStringsService }], propDecorators: { signpostTriggerAriaLabel: [{
|
|
1808
|
+
}], ctorParameters: () => [{ type: i1.ClrCommonStringsService }, { type: i2.ClrPopoverService }], propDecorators: { signpostTriggerAriaLabel: [{
|
|
1728
1809
|
type: Input,
|
|
1729
1810
|
args: ['clrSignpostTriggerAriaLabel']
|
|
1811
|
+
}], hideTrigger: [{
|
|
1812
|
+
type: Input,
|
|
1813
|
+
args: ['clrSignpostHideTrigger']
|
|
1730
1814
|
}], customTrigger: [{
|
|
1731
1815
|
type: ContentChild,
|
|
1732
1816
|
args: [ClrSignpostTrigger]
|
|
@@ -1761,8 +1845,8 @@ class ClrSignpostContent {
|
|
|
1761
1845
|
*
|
|
1762
1846
|
* @description
|
|
1763
1847
|
* A setter for the position of the ClrSignpostContent popover. This is a combination of the following:
|
|
1764
|
-
* -
|
|
1765
|
-
* - popoverPoint - where on the
|
|
1848
|
+
* - originPoint - where on the trigger to position the content
|
|
1849
|
+
* - popoverPoint - where on the content container to align with the origin
|
|
1766
1850
|
* - offsetY - where on the Y axis to align the ClrSignpostContent so it meets specs
|
|
1767
1851
|
* - offsetX - where on the X axis to align the ClrSignpostContent so it meets specs
|
|
1768
1852
|
* There are 12 possible positions to place a ClrSignpostContent container:
|
|
@@ -1832,7 +1916,7 @@ class ClrSignpostContent {
|
|
|
1832
1916
|
getFocusableElements(element) {
|
|
1833
1917
|
return Array.from(element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));
|
|
1834
1918
|
}
|
|
1835
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrSignpostContent, deps: [{ token:
|
|
1919
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrSignpostContent, deps: [{ token: POPOVER_HOST_ORIGIN$1, optional: true }, { token: i0.ElementRef }, { token: i1.ClrCommonStringsService }, { token: SignpostIdService }, { token: SignpostFocusManager }, { token: PLATFORM_ID }, { token: DOCUMENT }, { token: i2.ClrPopoverService }, { token: i2.ClrPopoverContent }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1836
1920
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrSignpostContent, isStandalone: false, selector: "clr-signpost-content", inputs: { signpostCloseAriaLabel: ["clrSignpostCloseAriaLabel", "signpostCloseAriaLabel"], position: ["clrPosition", "position"] }, host: { attributes: { "role": "dialog" }, listeners: { "keydown": "onKeyDown($event)" }, properties: { "class.signpost-content": "true", "id": "signpostContentId", "class.is-off-screen": "this.isOffScreen" } }, viewQueries: [{ propertyName: "closeButton", first: true, predicate: ["closeButton"], descendants: true, read: ElementRef }], hostDirectives: [{ directive: i2.ClrPopoverContent }], ngImport: i0, template: `
|
|
1837
1921
|
<div class="signpost-wrap">
|
|
1838
1922
|
<div class="popover-pointer"></div>
|
|
@@ -1892,7 +1976,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1892
1976
|
type: Optional
|
|
1893
1977
|
}, {
|
|
1894
1978
|
type: Inject,
|
|
1895
|
-
args: [
|
|
1979
|
+
args: [POPOVER_HOST_ORIGIN$1]
|
|
1896
1980
|
}] }, { type: i0.ElementRef }, { type: i1.ClrCommonStringsService }, { type: SignpostIdService }, { type: SignpostFocusManager }, { type: undefined, decorators: [{
|
|
1897
1981
|
type: Inject,
|
|
1898
1982
|
args: [PLATFORM_ID]
|
|
@@ -2080,7 +2164,7 @@ class ClrTooltipTrigger {
|
|
|
2080
2164
|
this.subs = [];
|
|
2081
2165
|
// The aria-described by comes from the id of content. It
|
|
2082
2166
|
this.subs.push(tooltipIdService.id.subscribe(tooltipId => (this.ariaDescribedBy = tooltipId)));
|
|
2083
|
-
popoverService.
|
|
2167
|
+
popoverService.origin = element;
|
|
2084
2168
|
}
|
|
2085
2169
|
ngOnDestroy() {
|
|
2086
2170
|
this.subs.forEach(sub => sub.unsubscribe());
|
|
@@ -2190,7 +2274,7 @@ class ClrTooltipContent {
|
|
|
2190
2274
|
this.renderer.removeClass(this.el.nativeElement, oldClass);
|
|
2191
2275
|
this.renderer.addClass(this.el.nativeElement, newClass);
|
|
2192
2276
|
}
|
|
2193
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTooltipContent, deps: [{ token:
|
|
2277
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTooltipContent, deps: [{ token: POPOVER_HOST_ORIGIN$1, optional: true }, { token: TooltipIdService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.ClrPopoverService }, { token: TooltipMouseService }, { token: i2.ClrPopoverContent }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2194
2278
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrTooltipContent, isStandalone: false, selector: "clr-tooltip-content", inputs: { id: "id", position: ["clrPosition", "position"], size: ["clrSize", "size"] }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" }, properties: { "class.tooltip-content": "true", "style.opacity": "1", "attr.role": "\"tooltip\"", "id": "id" } }, hostDirectives: [{ directive: i2.ClrPopoverContent }], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
|
|
2195
2279
|
}
|
|
2196
2280
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTooltipContent, decorators: [{
|
|
@@ -2211,7 +2295,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2211
2295
|
type: Optional
|
|
2212
2296
|
}, {
|
|
2213
2297
|
type: Inject,
|
|
2214
|
-
args: [
|
|
2298
|
+
args: [POPOVER_HOST_ORIGIN$1]
|
|
2215
2299
|
}] }, { type: TooltipIdService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i2.ClrPopoverService }, { type: TooltipMouseService }, { type: i2.ClrPopoverContent }], propDecorators: { id: [{
|
|
2216
2300
|
type: Input
|
|
2217
2301
|
}], position: [{
|
|
@@ -2267,5 +2351,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2267
2351
|
* Generated bundle index. Do not edit.
|
|
2268
2352
|
*/
|
|
2269
2353
|
|
|
2270
|
-
export { CLR_DROPDOWN_DIRECTIVES, CLR_MENU_POSITIONS, CLR_SIGNPOST_DIRECTIVES, CLR_TOOLTIP_DIRECTIVES, ClrDropdown, ClrDropdownItem, ClrDropdownMenu, ClrDropdownModule, ClrDropdownTrigger, ClrIfOpen,
|
|
2354
|
+
export { CLR_DROPDOWN_DIRECTIVES, CLR_MENU_POSITIONS, CLR_SIGNPOST_DIRECTIVES, CLR_TOOLTIP_DIRECTIVES, ClrDropdown, ClrDropdownItem, ClrDropdownMenu, ClrDropdownModule, ClrDropdownTrigger, ClrIfOpen, ClrPopoverContent, ClrPopoverHostDirective, ClrPopoverModule, ClrPopoverOrigin, ClrPopoverPosition, ClrPopoverService, ClrPopoverType, ClrSignpost, ClrSignpostContent, ClrSignpostModule, ClrSignpostTitle, ClrSignpostTrigger, ClrStopEscapePropagationDirective, ClrTooltip, ClrTooltipContent, ClrTooltipModule, ClrTooltipTrigger, DROPDOWN_POSITIONS, POPOVER_HOST_ORIGIN, SIGNPOST_POSITIONS, TOOLTIP_POSITIONS, getConnectedPositions, getContentPosition, getOriginPosition, getPositionsArray, mapPopoverKeyToPosition, ClrPopoverCloseButton as ÇlrClrPopoverCloseButton, ClrPopoverModuleNext as ÇlrClrPopoverModuleNext, ClrPopoverOpenCloseButton as ÇlrClrPopoverOpenCloseButton };
|
|
2271
2355
|
//# sourceMappingURL=clr-angular-popover.mjs.map
|