@agorapulse/ui-components 20.4.4 → 20.4.6
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/action-dropdown/index.d.ts +14 -18
- package/agorapulse-ui-components-20.4.6.tgz +0 -0
- package/dropdown-base/index.d.ts +49 -0
- package/fesm2022/agorapulse-ui-components-action-dropdown.mjs +40 -172
- package/fesm2022/agorapulse-ui-components-action-dropdown.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-dropdown-base.mjs +199 -0
- package/fesm2022/agorapulse-ui-components-dropdown-base.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs +83 -0
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs.map +1 -0
- package/fesm2022/agorapulse-ui-components-nav-selector.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-nav-selector.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-select.mjs +9 -22
- package/fesm2022/agorapulse-ui-components-select.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-selection-dropdown.mjs +39 -161
- package/fesm2022/agorapulse-ui-components-selection-dropdown.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components.mjs +2 -0
- package/fesm2022/agorapulse-ui-components.mjs.map +1 -1
- package/filter-dropdown/index.d.ts +133 -0
- package/index.d.ts +2 -0
- package/package.json +9 -1
- package/select/index.d.ts +9 -6
- package/selection-dropdown/index.d.ts +14 -20
- package/agorapulse-ui-components-20.4.4.tgz +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { TemplateRef } from '@angular/core';
|
|
3
3
|
import { BadgeColor } from '@agorapulse/ui-components/badge';
|
|
4
|
+
import { DropdownOverlay } from '@agorapulse/ui-components/dropdown-base';
|
|
4
5
|
import { agorapulseSymbol, SymbolColor } from '@agorapulse/ui-symbol';
|
|
5
6
|
|
|
6
7
|
interface ActionDropdownItem {
|
|
@@ -36,43 +37,40 @@ interface ActionDropdownItem {
|
|
|
36
37
|
dividerEnabled?: boolean;
|
|
37
38
|
/** Optional ID for the action button item */
|
|
38
39
|
id?: string;
|
|
40
|
+
/** Optional data-track attribute for analytics tracking */
|
|
41
|
+
dataTrack?: string;
|
|
39
42
|
}
|
|
40
43
|
/**
|
|
41
44
|
* A dropdown component that displays a list of actionable items with support for icons,
|
|
42
45
|
* badges, tooltips, and keyboard navigation.
|
|
43
46
|
*/
|
|
44
|
-
declare class ActionDropdownComponent {
|
|
45
|
-
private readonly elementRef;
|
|
46
|
-
private readonly overlay;
|
|
47
|
-
private readonly positionBuilder;
|
|
47
|
+
declare class ActionDropdownComponent implements DropdownOverlay {
|
|
48
48
|
private readonly symbolRegistry;
|
|
49
|
-
private readonly
|
|
49
|
+
private readonly overlay;
|
|
50
50
|
actionDropdownTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
51
51
|
trigger: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
52
52
|
/** Array of items to display in the dropdown menu */
|
|
53
53
|
items: _angular_core.InputSignal<ActionDropdownItem[]>;
|
|
54
|
-
/** Whether the dropdown is disabled and cannot be opened */
|
|
55
|
-
disabled: _angular_core.InputSignal<boolean>;
|
|
56
54
|
/** Whether to enable large mode styling for the dropdown */
|
|
57
55
|
largeModeEnabled: _angular_core.InputSignal<boolean>;
|
|
58
|
-
/** Whether to show a backdrop that closes the dropdown when clicked */
|
|
59
|
-
showBackdrop: _angular_core.InputSignal<boolean>;
|
|
60
56
|
/** Custom width for the dropdown menu in pixels */
|
|
61
57
|
customWidth: _angular_core.InputSignal<number | null>;
|
|
58
|
+
/** Whether to show a backdrop that closes the dropdown when clicked */
|
|
59
|
+
showBackdrop: _angular_core.InputSignal<boolean>;
|
|
60
|
+
/** Whether the dropdown is disabled and cannot be opened */
|
|
61
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
62
62
|
/** Default position for the dropdown relative to the trigger element */
|
|
63
63
|
defaultPosition: _angular_core.InputSignal<"left" | "right">;
|
|
64
|
-
/** Emits when a dropdown item is clicked */
|
|
65
|
-
itemClick: _angular_core.OutputEmitterRef<ActionDropdownItem>;
|
|
66
64
|
/** Emits when the dropdown menu is opened */
|
|
67
65
|
opened: _angular_core.OutputEmitterRef<void>;
|
|
68
66
|
/** Emits when the dropdown menu is closed */
|
|
69
67
|
closed: _angular_core.OutputEmitterRef<void>;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
protected readonly isOpen: _angular_core.WritableSignal<boolean>;
|
|
68
|
+
/** Emits when a dropdown item is clicked */
|
|
69
|
+
itemClick: _angular_core.OutputEmitterRef<ActionDropdownItem>;
|
|
73
70
|
protected readonly focusedIndex: _angular_core.WritableSignal<number>;
|
|
71
|
+
readonly isOpen: _angular_core.Signal<boolean>;
|
|
74
72
|
constructor();
|
|
75
|
-
/** Opens the dropdown menu at the specified trigger element
|
|
73
|
+
/** Opens the dropdown menu at the specified trigger element */
|
|
76
74
|
open(triggerElement?: HTMLElement): void;
|
|
77
75
|
/** Closes the dropdown menu and cleans up overlay resources */
|
|
78
76
|
close(): void;
|
|
@@ -82,12 +80,10 @@ declare class ActionDropdownComponent {
|
|
|
82
80
|
onItemClick(item: ActionDropdownItem): void;
|
|
83
81
|
/** Handles keyboard navigation within the dropdown menu */
|
|
84
82
|
onKeyDown(event: KeyboardEvent): void;
|
|
85
|
-
/** Creates positioning strategy for the overlay based on trigger element and default position */
|
|
86
|
-
private createPositionStrategy;
|
|
87
83
|
/** Sets up keyboard event handling for the opened dropdown */
|
|
88
84
|
private setupKeyboardNavigation;
|
|
89
85
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ActionDropdownComponent, never>;
|
|
90
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ActionDropdownComponent, "ap-action-dropdown", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "
|
|
86
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ActionDropdownComponent, "ap-action-dropdown", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "largeModeEnabled": { "alias": "largeModeEnabled"; "required": false; "isSignal": true; }; "customWidth": { "alias": "customWidth"; "required": false; "isSignal": true; }; "showBackdrop": { "alias": "showBackdrop"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "defaultPosition": { "alias": "defaultPosition"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; "itemClick": "itemClick"; }, ["trigger"], never, true, never>;
|
|
91
87
|
}
|
|
92
88
|
|
|
93
89
|
/**
|
|
Binary file
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { OverlayRef } from '@angular/cdk/overlay';
|
|
4
|
+
|
|
5
|
+
interface DropdownOverlay {
|
|
6
|
+
open(triggerElement?: HTMLElement): void;
|
|
7
|
+
close(): void;
|
|
8
|
+
toggle(triggerElement?: HTMLElement): void;
|
|
9
|
+
isOpen(): boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Generic directive that turns any element into a trigger for a dropdown component
|
|
14
|
+
* implementing the DropdownOverlay interface.
|
|
15
|
+
* Handles click and keyboard interactions to open/close the dropdown.
|
|
16
|
+
*/
|
|
17
|
+
declare class DropdownTriggerDirective {
|
|
18
|
+
private readonly elementRef;
|
|
19
|
+
/** Reference to the dropdown component that this trigger controls */
|
|
20
|
+
apDropdownTrigger: i0.InputSignal<DropdownOverlay>;
|
|
21
|
+
/** Handles click events to toggle the dropdown */
|
|
22
|
+
onClick(event: MouseEvent): void;
|
|
23
|
+
/** Handles keyboard events for accessibility (Enter, Space, Arrow Down, Escape) */
|
|
24
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownTriggerDirective, never>;
|
|
26
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownTriggerDirective, "[apDropdownTrigger]", never, { "apDropdownTrigger": { "alias": "apDropdownTrigger"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface DropdownOverlayConfig {
|
|
30
|
+
showBackdrop?: boolean;
|
|
31
|
+
defaultPosition?: 'right' | 'left';
|
|
32
|
+
/** Called when the overlay is closed via backdrop click or Escape key. Typically routes to the component's own close() method. */
|
|
33
|
+
onClose?: () => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Creates a composable dropdown overlay helper that manages CDK overlay creation,
|
|
37
|
+
* positioning, and disposal. Must be called within an Angular injection context
|
|
38
|
+
* (e.g., in a component constructor or field initializer).
|
|
39
|
+
*/
|
|
40
|
+
declare function createDropdownOverlay(): {
|
|
41
|
+
readonly overlayRef: OverlayRef | null;
|
|
42
|
+
isOpen: i0.Signal<boolean>;
|
|
43
|
+
open: (template: TemplateRef<unknown>, triggerElement?: HTMLElement, config?: DropdownOverlayConfig) => void;
|
|
44
|
+
close: () => void;
|
|
45
|
+
};
|
|
46
|
+
type DropdownOverlayInstance = ReturnType<typeof createDropdownOverlay>;
|
|
47
|
+
|
|
48
|
+
export { DropdownTriggerDirective, createDropdownOverlay };
|
|
49
|
+
export type { DropdownOverlay, DropdownOverlayConfig, DropdownOverlayInstance };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, input, HostListener, Directive,
|
|
2
|
+
import { inject, ElementRef, input, HostListener, Directive, viewChild, contentChild, output, signal, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { BadgeComponent } from '@agorapulse/ui-components/badge';
|
|
4
|
+
import { createDropdownOverlay } from '@agorapulse/ui-components/dropdown-base';
|
|
4
5
|
import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
|
|
5
6
|
import { TooltipDirective } from '@agorapulse/ui-components/tooltip';
|
|
6
7
|
import { SymbolRegistry, SymbolComponent, withSymbols, apInfo, apFeatureLock } from '@agorapulse/ui-symbol';
|
|
7
|
-
import { Overlay, OverlayPositionBuilder } from '@angular/cdk/overlay';
|
|
8
|
-
import { TemplatePortal } from '@angular/cdk/portal';
|
|
9
8
|
import { CommonModule } from '@angular/common';
|
|
10
|
-
import { take } from 'rxjs/operators';
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* Directive that turns any element into a trigger for an ActionDropdown component.
|
|
@@ -21,27 +19,24 @@ class ActionDropdownTriggerDirective {
|
|
|
21
19
|
onClick(event) {
|
|
22
20
|
event.preventDefault();
|
|
23
21
|
event.stopPropagation();
|
|
24
|
-
|
|
25
|
-
if (actionDropdown) {
|
|
26
|
-
actionDropdown.toggle(this.elementRef.nativeElement);
|
|
27
|
-
}
|
|
22
|
+
this.apActionDropdownTrigger()?.toggle(this.elementRef.nativeElement);
|
|
28
23
|
}
|
|
29
24
|
/** Handles keyboard events for accessibility (Enter, Space, Arrow Down, Escape) */
|
|
30
25
|
onKeyDown(event) {
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
const dropdown = this.apActionDropdownTrigger();
|
|
27
|
+
if (!dropdown)
|
|
28
|
+
return;
|
|
29
|
+
switch (event.key) {
|
|
30
|
+
case 'Enter':
|
|
31
|
+
case ' ':
|
|
32
|
+
case 'ArrowDown':
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
dropdown.open(this.elementRef.nativeElement);
|
|
35
|
+
break;
|
|
36
|
+
case 'Escape':
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
dropdown.close();
|
|
39
|
+
break;
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
42
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ActionDropdownTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -65,35 +60,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
65
60
|
* badges, tooltips, and keyboard navigation.
|
|
66
61
|
*/
|
|
67
62
|
class ActionDropdownComponent {
|
|
68
|
-
elementRef = inject(ElementRef);
|
|
69
|
-
overlay = inject(Overlay);
|
|
70
|
-
positionBuilder = inject(OverlayPositionBuilder);
|
|
71
63
|
symbolRegistry = inject(SymbolRegistry);
|
|
72
|
-
|
|
64
|
+
overlay = createDropdownOverlay();
|
|
73
65
|
actionDropdownTemplate = viewChild('actionDropdownTemplate', ...(ngDevMode ? [{ debugName: "actionDropdownTemplate" }] : []));
|
|
74
66
|
trigger = contentChild('trigger', ...(ngDevMode ? [{ debugName: "trigger" }] : []));
|
|
75
67
|
/** Array of items to display in the dropdown menu */
|
|
76
68
|
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
77
|
-
/** Whether the dropdown is disabled and cannot be opened */
|
|
78
|
-
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
79
69
|
/** Whether to enable large mode styling for the dropdown */
|
|
80
70
|
largeModeEnabled = input(false, ...(ngDevMode ? [{ debugName: "largeModeEnabled" }] : []));
|
|
81
|
-
/** Whether to show a backdrop that closes the dropdown when clicked */
|
|
82
|
-
showBackdrop = input(true, ...(ngDevMode ? [{ debugName: "showBackdrop" }] : []));
|
|
83
71
|
/** Custom width for the dropdown menu in pixels */
|
|
84
72
|
customWidth = input(null, ...(ngDevMode ? [{ debugName: "customWidth" }] : []));
|
|
73
|
+
/** Whether to show a backdrop that closes the dropdown when clicked */
|
|
74
|
+
showBackdrop = input(true, ...(ngDevMode ? [{ debugName: "showBackdrop" }] : []));
|
|
75
|
+
/** Whether the dropdown is disabled and cannot be opened */
|
|
76
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
85
77
|
/** Default position for the dropdown relative to the trigger element */
|
|
86
78
|
defaultPosition = input('right', ...(ngDevMode ? [{ debugName: "defaultPosition" }] : []));
|
|
87
|
-
/** Emits when a dropdown item is clicked */
|
|
88
|
-
itemClick = output();
|
|
89
79
|
/** Emits when the dropdown menu is opened */
|
|
90
80
|
opened = output();
|
|
91
81
|
/** Emits when the dropdown menu is closed */
|
|
92
82
|
closed = output();
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
83
|
+
/** Emits when a dropdown item is clicked */
|
|
84
|
+
itemClick = output();
|
|
96
85
|
focusedIndex = signal(-1, ...(ngDevMode ? [{ debugName: "focusedIndex" }] : []));
|
|
86
|
+
isOpen = this.overlay.isOpen;
|
|
97
87
|
constructor() {
|
|
98
88
|
this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
|
|
99
89
|
// Set up keyboard navigation when dropdown opens
|
|
@@ -103,56 +93,24 @@ class ActionDropdownComponent {
|
|
|
103
93
|
}
|
|
104
94
|
});
|
|
105
95
|
}
|
|
106
|
-
/** Opens the dropdown menu at the specified trigger element
|
|
96
|
+
/** Opens the dropdown menu at the specified trigger element */
|
|
107
97
|
open(triggerElement) {
|
|
108
|
-
const
|
|
109
|
-
if (this.disabled() || this.isOpen() || !
|
|
98
|
+
const template = this.actionDropdownTemplate();
|
|
99
|
+
if (this.disabled() || this.isOpen() || !template)
|
|
110
100
|
return;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.
|
|
115
|
-
}
|
|
116
|
-
const positionStrategy = this.createPositionStrategy(target);
|
|
117
|
-
this.overlayRef = this.overlay.create({
|
|
118
|
-
positionStrategy,
|
|
119
|
-
hasBackdrop: this.showBackdrop(),
|
|
120
|
-
backdropClass: '',
|
|
121
|
-
panelClass: '',
|
|
122
|
-
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
101
|
+
this.overlay.open(template, triggerElement, {
|
|
102
|
+
showBackdrop: this.showBackdrop(),
|
|
103
|
+
defaultPosition: this.defaultPosition(),
|
|
104
|
+
onClose: () => this.close(),
|
|
123
105
|
});
|
|
124
|
-
this.portal = new TemplatePortal(actionDropdownTemplate, this.viewContainerRef);
|
|
125
|
-
this.overlayRef.attach(this.portal);
|
|
126
|
-
this.isOpen.set(true);
|
|
127
|
-
this.focusedIndex.set(-1);
|
|
128
106
|
this.opened.emit();
|
|
129
|
-
this.overlayRef
|
|
130
|
-
.backdropClick()
|
|
131
|
-
.pipe(take(1))
|
|
132
|
-
.subscribe(() => {
|
|
133
|
-
this.close();
|
|
134
|
-
});
|
|
135
|
-
this.overlayRef
|
|
136
|
-
.keydownEvents()
|
|
137
|
-
.pipe(take(1))
|
|
138
|
-
.subscribe((event) => {
|
|
139
|
-
if (event.key === 'Escape') {
|
|
140
|
-
this.close();
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
107
|
}
|
|
144
108
|
/** Closes the dropdown menu and cleans up overlay resources */
|
|
145
109
|
close() {
|
|
146
|
-
if (!this.isOpen())
|
|
110
|
+
if (!this.isOpen())
|
|
147
111
|
return;
|
|
148
|
-
}
|
|
149
|
-
if (this.overlayRef) {
|
|
150
|
-
this.overlayRef.dispose();
|
|
151
|
-
this.overlayRef = null;
|
|
152
|
-
}
|
|
153
|
-
this.portal = null;
|
|
154
|
-
this.isOpen.set(false);
|
|
155
112
|
this.focusedIndex.set(-1);
|
|
113
|
+
this.overlay.close();
|
|
156
114
|
this.closed.emit();
|
|
157
115
|
}
|
|
158
116
|
/** Toggles the dropdown menu open or closed state */
|
|
@@ -215,112 +173,22 @@ class ActionDropdownComponent {
|
|
|
215
173
|
break;
|
|
216
174
|
}
|
|
217
175
|
}
|
|
218
|
-
/** Creates positioning strategy for the overlay based on trigger element and default position */
|
|
219
|
-
createPositionStrategy(target) {
|
|
220
|
-
const defaultPosition = this.defaultPosition();
|
|
221
|
-
const gap = 4;
|
|
222
|
-
const positions = defaultPosition === 'right'
|
|
223
|
-
? [
|
|
224
|
-
// Bottom-right (default) - left border aligns with left side of trigger
|
|
225
|
-
{
|
|
226
|
-
originX: 'start',
|
|
227
|
-
originY: 'bottom',
|
|
228
|
-
overlayX: 'start',
|
|
229
|
-
overlayY: 'top',
|
|
230
|
-
offsetX: 0,
|
|
231
|
-
offsetY: gap,
|
|
232
|
-
},
|
|
233
|
-
// Bottom-left (if not enough space on right) - right border aligns with right side of trigger
|
|
234
|
-
{
|
|
235
|
-
originX: 'end',
|
|
236
|
-
originY: 'bottom',
|
|
237
|
-
overlayX: 'end',
|
|
238
|
-
overlayY: 'top',
|
|
239
|
-
offsetX: 0,
|
|
240
|
-
offsetY: gap,
|
|
241
|
-
},
|
|
242
|
-
// Top-right (if not enough space below) - left border aligns with left side of trigger
|
|
243
|
-
{
|
|
244
|
-
originX: 'start',
|
|
245
|
-
originY: 'top',
|
|
246
|
-
overlayX: 'start',
|
|
247
|
-
overlayY: 'bottom',
|
|
248
|
-
offsetX: 0,
|
|
249
|
-
offsetY: -gap,
|
|
250
|
-
},
|
|
251
|
-
// Top-left (if not enough space below and on right) - right border aligns with right side of trigger
|
|
252
|
-
{
|
|
253
|
-
originX: 'end',
|
|
254
|
-
originY: 'top',
|
|
255
|
-
overlayX: 'end',
|
|
256
|
-
overlayY: 'bottom',
|
|
257
|
-
offsetX: 0,
|
|
258
|
-
offsetY: -gap,
|
|
259
|
-
},
|
|
260
|
-
]
|
|
261
|
-
: [
|
|
262
|
-
// Bottom-left (default) - right border aligns with right side of trigger
|
|
263
|
-
{
|
|
264
|
-
originX: 'end',
|
|
265
|
-
originY: 'bottom',
|
|
266
|
-
overlayX: 'end',
|
|
267
|
-
overlayY: 'top',
|
|
268
|
-
offsetX: 0,
|
|
269
|
-
offsetY: gap,
|
|
270
|
-
},
|
|
271
|
-
// Bottom-right (if not enough space on left) - left border aligns with left side of trigger
|
|
272
|
-
{
|
|
273
|
-
originX: 'start',
|
|
274
|
-
originY: 'bottom',
|
|
275
|
-
overlayX: 'start',
|
|
276
|
-
overlayY: 'top',
|
|
277
|
-
offsetX: 0,
|
|
278
|
-
offsetY: gap,
|
|
279
|
-
},
|
|
280
|
-
// Top-left (if not enough space below) - right border aligns with right side of trigger
|
|
281
|
-
{
|
|
282
|
-
originX: 'end',
|
|
283
|
-
originY: 'top',
|
|
284
|
-
overlayX: 'end',
|
|
285
|
-
overlayY: 'bottom',
|
|
286
|
-
offsetX: 0,
|
|
287
|
-
offsetY: -gap,
|
|
288
|
-
},
|
|
289
|
-
// Top-right (if not enough space below and on left) - left border aligns with left side of trigger
|
|
290
|
-
{
|
|
291
|
-
originX: 'start',
|
|
292
|
-
originY: 'top',
|
|
293
|
-
overlayX: 'start',
|
|
294
|
-
overlayY: 'bottom',
|
|
295
|
-
offsetX: 0,
|
|
296
|
-
offsetY: -gap,
|
|
297
|
-
},
|
|
298
|
-
];
|
|
299
|
-
return this.positionBuilder
|
|
300
|
-
.flexibleConnectedTo(target)
|
|
301
|
-
.withPositions(positions)
|
|
302
|
-
.withFlexibleDimensions(true)
|
|
303
|
-
.withPush(true)
|
|
304
|
-
.withGrowAfterOpen(true)
|
|
305
|
-
.withViewportMargin(8);
|
|
306
|
-
}
|
|
307
176
|
/** Sets up keyboard event handling for the opened dropdown */
|
|
308
177
|
setupKeyboardNavigation() {
|
|
309
|
-
|
|
178
|
+
const ref = this.overlay.overlayRef;
|
|
179
|
+
if (!ref)
|
|
310
180
|
return;
|
|
311
|
-
|
|
312
|
-
const keydownEvents = this.overlayRef.keydownEvents();
|
|
313
|
-
keydownEvents.subscribe((event) => {
|
|
181
|
+
ref.keydownEvents().subscribe((event) => {
|
|
314
182
|
this.onKeyDown(event);
|
|
315
183
|
});
|
|
316
184
|
}
|
|
317
185
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ActionDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
318
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: ActionDropdownComponent, isStandalone: true, selector: "ap-action-dropdown", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, largeModeEnabled: { classPropertyName: "largeModeEnabled", publicName: "largeModeEnabled", isSignal: true, isRequired: false, transformFunction: null }, showBackdrop: { classPropertyName: "showBackdrop", publicName: "showBackdrop", isSignal: true, isRequired: false, transformFunction: null }, customWidth: { classPropertyName: "customWidth", publicName: "customWidth", isSignal: true, isRequired: false, transformFunction: null }, defaultPosition: { classPropertyName: "defaultPosition", publicName: "defaultPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick", opened: "opened", closed: "closed" }, providers: [withSymbols(apInfo, apFeatureLock)], queries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "actionDropdownTemplate", first: true, predicate: ["actionDropdownTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #actionDropdownTemplate>\n <!-- Action dropdown -->\n <div\n class=\"ap-action-dropdown__content\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"'Action dropdown'\"\n [class.ap-action-dropdown__content--default]=\"!largeModeEnabled() && !customWidth()\"\n [class.ap-action-dropdown__content--large]=\"largeModeEnabled()\"\n [style.width]=\"customWidth() ? customWidth() + 'px' : undefined\"\n (keydown)=\"onKeyDown($event)\">\n <!-- Action dropdown items -->\n @for (item of items(); track item.label) {\n <!-- Divider -->\n @if (item.dividerEnabled) {\n <div\n class=\"ap-action-dropdown__divider\"\n role=\"separator\"></div>\n }\n <!-- Action dropdown item -->\n <div [apTooltip]=\"item.itemTooltipText\">\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"ap-action-dropdown__item\"\n [class.ap-action-dropdown__item--has-description]=\"item.description\"\n [class.ap-action-dropdown__item--focused]=\"focusedIndex() === $index\"\n [class.ap-action-dropdown__item--red-mode]=\"item.redModeEnabled\"\n [class.ap-action-dropdown__item--feature-lock]=\"item.featureLockEnabled\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.id]=\"item.id\"\n [disabled]=\"item.disabled\"\n (click)=\"onItemClick(item)\">\n <!-- Start icon -->\n @if (item.startSymbolId) {\n <ap-symbol\n class=\"ap-action-dropdown__item-start-icon\"\n size=\"sm\"\n [color]=\"item.startSymbolColor ? item.startSymbolColor : item.redModeEnabled ? 'red' : 'basic-grey'\"\n [symbolId]=\"item.startSymbolId\"\n [apTooltip]=\"item.startSymbolTooltipText\" />\n }\n <!-- Label -->\n <div class=\"ap-action-dropdown__item-text-container\">\n <div class=\"ap-action-dropdown__item-label-container\">\n <div\n class=\"ap-action-dropdown__item-label\"\n [class.ap-action-dropdown__item-label--bold]=\"item.description\">\n {{ item.label }}\n </div>\n <!-- Badge -->\n @if (item.badgeLabel) {\n <ap-badge [color]=\"item.badgeColor ?? 'blue'\">\n {{ item.badgeLabel }}\n </ap-badge>\n }\n </div>\n <!-- Description -->\n <div class=\"ap-action-dropdown__item-description\">{{ item.description }}</div>\n </div>\n <!-- End icon -->\n @if (item.endSymbolId) {\n <ap-symbol\n class=\"ap-action-dropdown__item-end-icon\"\n size=\"sm\"\n color=\"#858FA1\"\n [symbolId]=\"item.endSymbolId\"\n [apTooltip]=\"item.endSymbolTooltipText\" />\n }\n <!-- Feature lock icon -->\n @if (item.featureLockEnabled) {\n <ap-symbol\n class=\"ap-action-dropdown__item-end-icon\"\n size=\"sm\"\n color=\"purple\"\n symbolId=\"feature-lock\" />\n }\n </button>\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{display:none}.ap-action-dropdown__content{background-color:var(--comp-action-dropdown-background-color);border-radius:var(--comp-action-dropdown-border-radius);box-shadow:var(--comp-action-dropdown-box-shadow);padding:var(--comp-action-dropdown-padding);outline:none;overflow:hidden;z-index:1000}.ap-action-dropdown__content.ap-action-dropdown__content--default{width:250px}.ap-action-dropdown__content.ap-action-dropdown__content--large{width:340px}.ap-action-dropdown__content:focus{outline:2px solid var(--comp-action-dropdown-item-background-color-focused);outline-offset:2px}.ap-action-dropdown__item{display:flex;align-items:center;width:100%;height:40px;padding:var(--comp-action-dropdown-item-padding);border:none;background:transparent;color:var(--comp-action-dropdown-item-text-color);cursor:pointer;font-family:Averta;font-size:var(--comp-action-dropdown-item-text-size);line-height:var(--comp-action-dropdown-item-text-line-height);text-align:left}.ap-action-dropdown__item:hover{background-color:var(--comp-action-dropdown-item-background-color-hover)}.ap-action-dropdown__item:focus{outline:none;background-color:var(--comp-action-dropdown-item-background-color-focused)}.ap-action-dropdown__item:disabled{cursor:not-allowed;opacity:.4}.ap-action-dropdown__item.ap-action-dropdown__item--has-description{height:auto;min-height:50px}.ap-action-dropdown__item.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode{color:var(--comp-action-dropdown-item-text-color-red-mode)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode:hover{background-color:var(--comp-action-dropdown-item-background-color-red-mode-hover)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode:focus{background-color:var(--comp-action-dropdown-item-background-color-red-mode-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-red-mode-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock:hover{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-hover)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock:focus{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--disabled:hover{background-color:transparent}.ap-action-dropdown__item .ap-action-dropdown__item-start-icon{margin-right:var(--comp-action-dropdown-item-icon-spacing)}.ap-action-dropdown__item .ap-action-dropdown__item-end-icon{margin-left:var(--comp-action-dropdown-item-icon-spacing)}.ap-action-dropdown__item .ap-action-dropdown__item-text-container{display:flex;flex-direction:column;flex:1;min-width:0}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container{display:flex;align-items:center;gap:var(--comp-action-dropdown-item-label-spacing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container .ap-action-dropdown__item-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container .ap-action-dropdown__item-label.ap-action-dropdown__item-label--bold{font-weight:var(--ref-font-weight-bold)}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-description{color:var(--comp-action-dropdown-item-description-color);font-size:var(--comp-action-dropdown-item-description-size);line-height:var(--comp-action-dropdown-item-description-line-height)}.ap-action-dropdown__divider{height:1px;background-color:var(--comp-action-dropdown-divider-color);margin:var(--comp-action-dropdown-divider-margin)}\n"], dependencies: [{ kind: "component", type: BadgeComponent, selector: "ap-badge", inputs: ["color"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
186
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: ActionDropdownComponent, isStandalone: true, selector: "ap-action-dropdown", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, largeModeEnabled: { classPropertyName: "largeModeEnabled", publicName: "largeModeEnabled", isSignal: true, isRequired: false, transformFunction: null }, customWidth: { classPropertyName: "customWidth", publicName: "customWidth", isSignal: true, isRequired: false, transformFunction: null }, showBackdrop: { classPropertyName: "showBackdrop", publicName: "showBackdrop", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, defaultPosition: { classPropertyName: "defaultPosition", publicName: "defaultPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed", itemClick: "itemClick" }, providers: [withSymbols(apInfo, apFeatureLock)], queries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "actionDropdownTemplate", first: true, predicate: ["actionDropdownTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #actionDropdownTemplate>\n <!-- Action dropdown -->\n <div\n class=\"ap-action-dropdown__content\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"'Action dropdown'\"\n [class.ap-action-dropdown__content--default]=\"!largeModeEnabled() && !customWidth()\"\n [class.ap-action-dropdown__content--large]=\"largeModeEnabled()\"\n [style.width]=\"customWidth() ? customWidth() + 'px' : undefined\"\n (keydown)=\"onKeyDown($event)\">\n <!-- Action dropdown items -->\n @for (item of items(); track item.label) {\n <!-- Divider -->\n @if (item.dividerEnabled) {\n <div\n class=\"ap-action-dropdown__divider\"\n role=\"separator\"></div>\n }\n <!-- Action dropdown item -->\n <div [apTooltip]=\"item.itemTooltipText\">\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"ap-action-dropdown__item\"\n [class.ap-action-dropdown__item--has-description]=\"item.description\"\n [class.ap-action-dropdown__item--focused]=\"focusedIndex() === $index\"\n [class.ap-action-dropdown__item--red-mode]=\"item.redModeEnabled\"\n [class.ap-action-dropdown__item--feature-lock]=\"item.featureLockEnabled\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.data-track]=\"item.dataTrack\"\n [attr.id]=\"item.id\"\n [disabled]=\"item.disabled\"\n (click)=\"onItemClick(item)\">\n <!-- Start icon -->\n @if (item.startSymbolId) {\n <ap-symbol\n class=\"ap-action-dropdown__item-start-icon\"\n size=\"sm\"\n [color]=\"item.startSymbolColor ? item.startSymbolColor : item.redModeEnabled ? 'red' : 'basic-grey'\"\n [symbolId]=\"item.startSymbolId\"\n [apTooltip]=\"item.startSymbolTooltipText\" />\n }\n <!-- Label -->\n <div class=\"ap-action-dropdown__item-text-container\">\n <div class=\"ap-action-dropdown__item-label-container\">\n <div\n class=\"ap-action-dropdown__item-label\"\n [class.ap-action-dropdown__item-label--bold]=\"item.description\">\n {{ item.label }}\n </div>\n <!-- Badge -->\n @if (item.badgeLabel) {\n <ap-badge [color]=\"item.badgeColor ?? 'blue'\">\n {{ item.badgeLabel }}\n </ap-badge>\n }\n </div>\n <!-- Description -->\n <div class=\"ap-action-dropdown__item-description\">{{ item.description }}</div>\n </div>\n <!-- End icon -->\n @if (item.endSymbolId) {\n <ap-symbol\n class=\"ap-action-dropdown__item-end-icon\"\n size=\"sm\"\n color=\"#858FA1\"\n [symbolId]=\"item.endSymbolId\"\n [apTooltip]=\"item.endSymbolTooltipText\" />\n }\n <!-- Feature lock icon -->\n @if (item.featureLockEnabled) {\n <ap-symbol\n class=\"ap-action-dropdown__item-end-icon\"\n size=\"sm\"\n color=\"purple\"\n symbolId=\"feature-lock\" />\n }\n </button>\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{display:none}.ap-action-dropdown__content{background-color:var(--comp-action-dropdown-background-color);border-radius:var(--comp-action-dropdown-border-radius);box-shadow:var(--comp-action-dropdown-box-shadow);padding:var(--comp-action-dropdown-padding);outline:none;overflow:hidden;z-index:1000}.ap-action-dropdown__content.ap-action-dropdown__content--default{width:250px}.ap-action-dropdown__content.ap-action-dropdown__content--large{width:340px}.ap-action-dropdown__content:focus{outline:2px solid var(--comp-action-dropdown-item-background-color-focused);outline-offset:2px}.ap-action-dropdown__item{display:flex;align-items:center;width:100%;height:40px;padding:var(--comp-action-dropdown-item-padding);border:none;background:transparent;color:var(--comp-action-dropdown-item-text-color);cursor:pointer;font-family:Averta;font-size:var(--comp-action-dropdown-item-text-size);line-height:var(--comp-action-dropdown-item-text-line-height);text-align:left}.ap-action-dropdown__item:hover{background-color:var(--comp-action-dropdown-item-background-color-hover)}.ap-action-dropdown__item:focus{outline:none;background-color:var(--comp-action-dropdown-item-background-color-focused)}.ap-action-dropdown__item:disabled{cursor:not-allowed;opacity:.4}.ap-action-dropdown__item.ap-action-dropdown__item--has-description{height:auto;min-height:50px}.ap-action-dropdown__item.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode{color:var(--comp-action-dropdown-item-text-color-red-mode)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode:hover{background-color:var(--comp-action-dropdown-item-background-color-red-mode-hover)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode:focus{background-color:var(--comp-action-dropdown-item-background-color-red-mode-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-red-mode-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock:hover{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-hover)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock:focus{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--disabled:hover{background-color:transparent}.ap-action-dropdown__item .ap-action-dropdown__item-start-icon{margin-right:var(--comp-action-dropdown-item-icon-spacing)}.ap-action-dropdown__item .ap-action-dropdown__item-end-icon{margin-left:var(--comp-action-dropdown-item-icon-spacing)}.ap-action-dropdown__item .ap-action-dropdown__item-text-container{display:flex;flex-direction:column;flex:1;min-width:0}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container{display:flex;align-items:center;gap:var(--comp-action-dropdown-item-label-spacing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container .ap-action-dropdown__item-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container .ap-action-dropdown__item-label.ap-action-dropdown__item-label--bold{font-weight:var(--ref-font-weight-bold)}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-description{color:var(--comp-action-dropdown-item-description-color);font-size:var(--comp-action-dropdown-item-description-size);line-height:var(--comp-action-dropdown-item-description-line-height)}.ap-action-dropdown__divider{height:1px;background-color:var(--comp-action-dropdown-divider-color);margin:var(--comp-action-dropdown-divider-margin)}\n"], dependencies: [{ kind: "component", type: BadgeComponent, selector: "ap-badge", inputs: ["color"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
319
187
|
}
|
|
320
188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ActionDropdownComponent, decorators: [{
|
|
321
189
|
type: Component,
|
|
322
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-action-dropdown', imports: [BadgeComponent, CommonModule, SymbolComponent, TooltipDirective], providers: [withSymbols(apInfo, apFeatureLock)], template: "<ng-template #actionDropdownTemplate>\n <!-- Action dropdown -->\n <div\n class=\"ap-action-dropdown__content\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"'Action dropdown'\"\n [class.ap-action-dropdown__content--default]=\"!largeModeEnabled() && !customWidth()\"\n [class.ap-action-dropdown__content--large]=\"largeModeEnabled()\"\n [style.width]=\"customWidth() ? customWidth() + 'px' : undefined\"\n (keydown)=\"onKeyDown($event)\">\n <!-- Action dropdown items -->\n @for (item of items(); track item.label) {\n <!-- Divider -->\n @if (item.dividerEnabled) {\n <div\n class=\"ap-action-dropdown__divider\"\n role=\"separator\"></div>\n }\n <!-- Action dropdown item -->\n <div [apTooltip]=\"item.itemTooltipText\">\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"ap-action-dropdown__item\"\n [class.ap-action-dropdown__item--has-description]=\"item.description\"\n [class.ap-action-dropdown__item--focused]=\"focusedIndex() === $index\"\n [class.ap-action-dropdown__item--red-mode]=\"item.redModeEnabled\"\n [class.ap-action-dropdown__item--feature-lock]=\"item.featureLockEnabled\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.id]=\"item.id\"\n [disabled]=\"item.disabled\"\n (click)=\"onItemClick(item)\">\n <!-- Start icon -->\n @if (item.startSymbolId) {\n <ap-symbol\n class=\"ap-action-dropdown__item-start-icon\"\n size=\"sm\"\n [color]=\"item.startSymbolColor ? item.startSymbolColor : item.redModeEnabled ? 'red' : 'basic-grey'\"\n [symbolId]=\"item.startSymbolId\"\n [apTooltip]=\"item.startSymbolTooltipText\" />\n }\n <!-- Label -->\n <div class=\"ap-action-dropdown__item-text-container\">\n <div class=\"ap-action-dropdown__item-label-container\">\n <div\n class=\"ap-action-dropdown__item-label\"\n [class.ap-action-dropdown__item-label--bold]=\"item.description\">\n {{ item.label }}\n </div>\n <!-- Badge -->\n @if (item.badgeLabel) {\n <ap-badge [color]=\"item.badgeColor ?? 'blue'\">\n {{ item.badgeLabel }}\n </ap-badge>\n }\n </div>\n <!-- Description -->\n <div class=\"ap-action-dropdown__item-description\">{{ item.description }}</div>\n </div>\n <!-- End icon -->\n @if (item.endSymbolId) {\n <ap-symbol\n class=\"ap-action-dropdown__item-end-icon\"\n size=\"sm\"\n color=\"#858FA1\"\n [symbolId]=\"item.endSymbolId\"\n [apTooltip]=\"item.endSymbolTooltipText\" />\n }\n <!-- Feature lock icon -->\n @if (item.featureLockEnabled) {\n <ap-symbol\n class=\"ap-action-dropdown__item-end-icon\"\n size=\"sm\"\n color=\"purple\"\n symbolId=\"feature-lock\" />\n }\n </button>\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{display:none}.ap-action-dropdown__content{background-color:var(--comp-action-dropdown-background-color);border-radius:var(--comp-action-dropdown-border-radius);box-shadow:var(--comp-action-dropdown-box-shadow);padding:var(--comp-action-dropdown-padding);outline:none;overflow:hidden;z-index:1000}.ap-action-dropdown__content.ap-action-dropdown__content--default{width:250px}.ap-action-dropdown__content.ap-action-dropdown__content--large{width:340px}.ap-action-dropdown__content:focus{outline:2px solid var(--comp-action-dropdown-item-background-color-focused);outline-offset:2px}.ap-action-dropdown__item{display:flex;align-items:center;width:100%;height:40px;padding:var(--comp-action-dropdown-item-padding);border:none;background:transparent;color:var(--comp-action-dropdown-item-text-color);cursor:pointer;font-family:Averta;font-size:var(--comp-action-dropdown-item-text-size);line-height:var(--comp-action-dropdown-item-text-line-height);text-align:left}.ap-action-dropdown__item:hover{background-color:var(--comp-action-dropdown-item-background-color-hover)}.ap-action-dropdown__item:focus{outline:none;background-color:var(--comp-action-dropdown-item-background-color-focused)}.ap-action-dropdown__item:disabled{cursor:not-allowed;opacity:.4}.ap-action-dropdown__item.ap-action-dropdown__item--has-description{height:auto;min-height:50px}.ap-action-dropdown__item.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode{color:var(--comp-action-dropdown-item-text-color-red-mode)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode:hover{background-color:var(--comp-action-dropdown-item-background-color-red-mode-hover)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode:focus{background-color:var(--comp-action-dropdown-item-background-color-red-mode-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-red-mode-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock:hover{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-hover)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock:focus{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--disabled:hover{background-color:transparent}.ap-action-dropdown__item .ap-action-dropdown__item-start-icon{margin-right:var(--comp-action-dropdown-item-icon-spacing)}.ap-action-dropdown__item .ap-action-dropdown__item-end-icon{margin-left:var(--comp-action-dropdown-item-icon-spacing)}.ap-action-dropdown__item .ap-action-dropdown__item-text-container{display:flex;flex-direction:column;flex:1;min-width:0}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container{display:flex;align-items:center;gap:var(--comp-action-dropdown-item-label-spacing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container .ap-action-dropdown__item-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container .ap-action-dropdown__item-label.ap-action-dropdown__item-label--bold{font-weight:var(--ref-font-weight-bold)}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-description{color:var(--comp-action-dropdown-item-description-color);font-size:var(--comp-action-dropdown-item-description-size);line-height:var(--comp-action-dropdown-item-description-line-height)}.ap-action-dropdown__divider{height:1px;background-color:var(--comp-action-dropdown-divider-color);margin:var(--comp-action-dropdown-divider-margin)}\n"] }]
|
|
323
|
-
}], ctorParameters: () => [], propDecorators: { actionDropdownTemplate: [{ type: i0.ViewChild, args: ['actionDropdownTemplate', { isSignal: true }] }], trigger: [{ type: i0.ContentChild, args: ['trigger', { isSignal: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }],
|
|
190
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-action-dropdown', imports: [BadgeComponent, CommonModule, SymbolComponent, TooltipDirective], providers: [withSymbols(apInfo, apFeatureLock)], template: "<ng-template #actionDropdownTemplate>\n <!-- Action dropdown -->\n <div\n class=\"ap-action-dropdown__content\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"'Action dropdown'\"\n [class.ap-action-dropdown__content--default]=\"!largeModeEnabled() && !customWidth()\"\n [class.ap-action-dropdown__content--large]=\"largeModeEnabled()\"\n [style.width]=\"customWidth() ? customWidth() + 'px' : undefined\"\n (keydown)=\"onKeyDown($event)\">\n <!-- Action dropdown items -->\n @for (item of items(); track item.label) {\n <!-- Divider -->\n @if (item.dividerEnabled) {\n <div\n class=\"ap-action-dropdown__divider\"\n role=\"separator\"></div>\n }\n <!-- Action dropdown item -->\n <div [apTooltip]=\"item.itemTooltipText\">\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"ap-action-dropdown__item\"\n [class.ap-action-dropdown__item--has-description]=\"item.description\"\n [class.ap-action-dropdown__item--focused]=\"focusedIndex() === $index\"\n [class.ap-action-dropdown__item--red-mode]=\"item.redModeEnabled\"\n [class.ap-action-dropdown__item--feature-lock]=\"item.featureLockEnabled\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.data-track]=\"item.dataTrack\"\n [attr.id]=\"item.id\"\n [disabled]=\"item.disabled\"\n (click)=\"onItemClick(item)\">\n <!-- Start icon -->\n @if (item.startSymbolId) {\n <ap-symbol\n class=\"ap-action-dropdown__item-start-icon\"\n size=\"sm\"\n [color]=\"item.startSymbolColor ? item.startSymbolColor : item.redModeEnabled ? 'red' : 'basic-grey'\"\n [symbolId]=\"item.startSymbolId\"\n [apTooltip]=\"item.startSymbolTooltipText\" />\n }\n <!-- Label -->\n <div class=\"ap-action-dropdown__item-text-container\">\n <div class=\"ap-action-dropdown__item-label-container\">\n <div\n class=\"ap-action-dropdown__item-label\"\n [class.ap-action-dropdown__item-label--bold]=\"item.description\">\n {{ item.label }}\n </div>\n <!-- Badge -->\n @if (item.badgeLabel) {\n <ap-badge [color]=\"item.badgeColor ?? 'blue'\">\n {{ item.badgeLabel }}\n </ap-badge>\n }\n </div>\n <!-- Description -->\n <div class=\"ap-action-dropdown__item-description\">{{ item.description }}</div>\n </div>\n <!-- End icon -->\n @if (item.endSymbolId) {\n <ap-symbol\n class=\"ap-action-dropdown__item-end-icon\"\n size=\"sm\"\n color=\"#858FA1\"\n [symbolId]=\"item.endSymbolId\"\n [apTooltip]=\"item.endSymbolTooltipText\" />\n }\n <!-- Feature lock icon -->\n @if (item.featureLockEnabled) {\n <ap-symbol\n class=\"ap-action-dropdown__item-end-icon\"\n size=\"sm\"\n color=\"purple\"\n symbolId=\"feature-lock\" />\n }\n </button>\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{display:none}.ap-action-dropdown__content{background-color:var(--comp-action-dropdown-background-color);border-radius:var(--comp-action-dropdown-border-radius);box-shadow:var(--comp-action-dropdown-box-shadow);padding:var(--comp-action-dropdown-padding);outline:none;overflow:hidden;z-index:1000}.ap-action-dropdown__content.ap-action-dropdown__content--default{width:250px}.ap-action-dropdown__content.ap-action-dropdown__content--large{width:340px}.ap-action-dropdown__content:focus{outline:2px solid var(--comp-action-dropdown-item-background-color-focused);outline-offset:2px}.ap-action-dropdown__item{display:flex;align-items:center;width:100%;height:40px;padding:var(--comp-action-dropdown-item-padding);border:none;background:transparent;color:var(--comp-action-dropdown-item-text-color);cursor:pointer;font-family:Averta;font-size:var(--comp-action-dropdown-item-text-size);line-height:var(--comp-action-dropdown-item-text-line-height);text-align:left}.ap-action-dropdown__item:hover{background-color:var(--comp-action-dropdown-item-background-color-hover)}.ap-action-dropdown__item:focus{outline:none;background-color:var(--comp-action-dropdown-item-background-color-focused)}.ap-action-dropdown__item:disabled{cursor:not-allowed;opacity:.4}.ap-action-dropdown__item.ap-action-dropdown__item--has-description{height:auto;min-height:50px}.ap-action-dropdown__item.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode{color:var(--comp-action-dropdown-item-text-color-red-mode)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode:hover{background-color:var(--comp-action-dropdown-item-background-color-red-mode-hover)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode:focus{background-color:var(--comp-action-dropdown-item-background-color-red-mode-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--red-mode.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-red-mode-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock:hover{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-hover)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock:focus{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--feature-lock.ap-action-dropdown__item--focused{background-color:var(--comp-action-dropdown-item-background-color-feature-lock-focused)}.ap-action-dropdown__item.ap-action-dropdown__item--disabled:hover{background-color:transparent}.ap-action-dropdown__item .ap-action-dropdown__item-start-icon{margin-right:var(--comp-action-dropdown-item-icon-spacing)}.ap-action-dropdown__item .ap-action-dropdown__item-end-icon{margin-left:var(--comp-action-dropdown-item-icon-spacing)}.ap-action-dropdown__item .ap-action-dropdown__item-text-container{display:flex;flex-direction:column;flex:1;min-width:0}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container{display:flex;align-items:center;gap:var(--comp-action-dropdown-item-label-spacing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container .ap-action-dropdown__item-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-label-container .ap-action-dropdown__item-label.ap-action-dropdown__item-label--bold{font-weight:var(--ref-font-weight-bold)}.ap-action-dropdown__item .ap-action-dropdown__item-text-container .ap-action-dropdown__item-description{color:var(--comp-action-dropdown-item-description-color);font-size:var(--comp-action-dropdown-item-description-size);line-height:var(--comp-action-dropdown-item-description-line-height)}.ap-action-dropdown__divider{height:1px;background-color:var(--comp-action-dropdown-divider-color);margin:var(--comp-action-dropdown-divider-margin)}\n"] }]
|
|
191
|
+
}], ctorParameters: () => [], propDecorators: { actionDropdownTemplate: [{ type: i0.ViewChild, args: ['actionDropdownTemplate', { isSignal: true }] }], trigger: [{ type: i0.ContentChild, args: ['trigger', { isSignal: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], largeModeEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "largeModeEnabled", required: false }] }], customWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "customWidth", required: false }] }], showBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBackdrop", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], defaultPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultPosition", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }] } });
|
|
324
192
|
|
|
325
193
|
/**
|
|
326
194
|
* Generated bundle index. Do not edit.
|