@agorapulse/ui-components 22.1.5 → 22.1.7

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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, HostListener, Directive, viewChild, contentChild, output, signal, effect, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { inject, ElementRef, input, HostListener, Directive, viewChild, contentChild, output, signal, computed, 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
+ import { DropdownPanelComponent, DropdownContentDirective } from '@agorapulse/ui-components/dropdown-panel';
5
5
  import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
6
6
  import { TooltipDirective } from '@agorapulse/ui-components/tooltip';
7
7
  import { SymbolRegistry, SymbolComponent, withSymbols, apInfo, apFeatureLock } from '@agorapulse/ui-symbol';
@@ -61,9 +61,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
61
61
  */
62
62
  class ActionDropdownComponent {
63
63
  symbolRegistry = inject(SymbolRegistry);
64
- overlay = createDropdownOverlay();
65
- actionDropdownTemplate = viewChild('actionDropdownTemplate', /* @ts-ignore */
66
- ...(ngDevMode ? [{ debugName: "actionDropdownTemplate" }] : /* istanbul ignore next */ []));
64
+ panel = viewChild(DropdownPanelComponent, /* @ts-ignore */
65
+ ...(ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []));
67
66
  trigger = contentChild('trigger', /* @ts-ignore */
68
67
  ...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
69
68
  /** Array of items to display in the dropdown menu */
@@ -81,7 +80,6 @@ class ActionDropdownComponent {
81
80
  /** Whether the dropdown is disabled and cannot be opened */
82
81
  disabled = input(false, /* @ts-ignore */
83
82
  ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
84
- /** Default position for the dropdown relative to the trigger element */
85
83
  /** Panel placement. Unset means derived from the anchor mode, i.e. `bottom-start`. */
86
84
  placement = input(/* @ts-ignore */
87
85
  ...(ngDevMode ? [undefined, { debugName: "placement" }] : /* istanbul ignore next */ []));
@@ -93,7 +91,8 @@ class ActionDropdownComponent {
93
91
  itemClick = output();
94
92
  focusedIndex = signal(-1, /* @ts-ignore */
95
93
  ...(ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []));
96
- isOpen = this.overlay.isOpen;
94
+ isOpen = computed(() => this.panel()?.isOpen() ?? false, /* @ts-ignore */
95
+ ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
97
96
  constructor() {
98
97
  this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
99
98
  // Set up keyboard navigation when dropdown opens
@@ -105,22 +104,17 @@ class ActionDropdownComponent {
105
104
  }
106
105
  /** Opens the dropdown menu at the specified trigger element */
107
106
  open(triggerElement) {
108
- const template = this.actionDropdownTemplate();
109
- if (this.disabled() || this.isOpen() || !template)
107
+ const panel = this.panel();
108
+ if (this.disabled() || this.isOpen() || !panel)
110
109
  return;
111
- this.overlay.open(template, triggerElement, {
112
- showBackdrop: this.showBackdrop(),
113
- placement: this.placement(),
114
- onClose: () => this.close(),
115
- });
110
+ panel.open(triggerElement);
116
111
  this.opened.emit();
117
112
  }
118
- /** Closes the dropdown menu and cleans up overlay resources */
119
113
  close() {
120
- if (!this.isOpen())
121
- return;
114
+ this.panel()?.close();
115
+ }
116
+ onPanelClosed() {
122
117
  this.focusedIndex.set(-1);
123
- this.overlay.close();
124
118
  this.closed.emit();
125
119
  }
126
120
  /** Toggles the dropdown menu open or closed state */
@@ -185,7 +179,7 @@ class ActionDropdownComponent {
185
179
  }
186
180
  /** Sets up keyboard event handling for the opened dropdown */
187
181
  setupKeyboardNavigation() {
188
- const ref = this.overlay.overlayRef;
182
+ const ref = this.panel()?.overlayRef;
189
183
  if (!ref)
190
184
  return;
191
185
  ref.keydownEvents().subscribe((event) => {
@@ -193,12 +187,12 @@ class ActionDropdownComponent {
193
187
  });
194
188
  }
195
189
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ActionDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
196
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", 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 }, placement: { classPropertyName: "placement", publicName: "placement", 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: "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 });
190
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", 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 }, placement: { classPropertyName: "placement", publicName: "placement", 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: "panel", first: true, predicate: DropdownPanelComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ap-dropdown-panel\n [placement]=\"placement()\"\n [showBackdrop]=\"showBackdrop()\"\n (closed)=\"onPanelClosed()\">\n <!-- Action dropdown -->\n <div\n *apDropdownContent\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</ap-dropdown-panel>\n", styles: [":host{display:none}.ap-action-dropdown__content{padding:var(--comp-action-dropdown-padding);outline:none;z-index:1000;max-height:var(--ap-floating-available-height, none);overflow-y:auto}.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: "directive", type: DropdownContentDirective, selector: "ng-template[apDropdownContent]" }, { kind: "component", type: DropdownPanelComponent, selector: "ap-dropdown-panel", inputs: ["placement", "showBackdrop", "panelClass", "canDismiss"], outputs: ["opened", "closed"] }, { 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 });
197
191
  }
198
192
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ActionDropdownComponent, decorators: [{
199
193
  type: Component,
200
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-action-dropdown', imports: [BadgeComponent, 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"] }]
201
- }], 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 }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }] } });
194
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-action-dropdown', imports: [BadgeComponent, DropdownContentDirective, DropdownPanelComponent, SymbolComponent, TooltipDirective], providers: [withSymbols(apInfo, apFeatureLock)], template: "<ap-dropdown-panel\n [placement]=\"placement()\"\n [showBackdrop]=\"showBackdrop()\"\n (closed)=\"onPanelClosed()\">\n <!-- Action dropdown -->\n <div\n *apDropdownContent\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</ap-dropdown-panel>\n", styles: [":host{display:none}.ap-action-dropdown__content{padding:var(--comp-action-dropdown-padding);outline:none;z-index:1000;max-height:var(--ap-floating-available-height, none);overflow-y:auto}.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"] }]
195
+ }], ctorParameters: () => [], propDecorators: { panel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DropdownPanelComponent), { 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 }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }] } });
202
196
 
203
197
  /**
204
198
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-action-dropdown.mjs","sources":["../../../libs/ui-components/action-dropdown/src/action-dropdown-trigger.directive.ts","../../../libs/ui-components/action-dropdown/src/action-dropdown.component.ts","../../../libs/ui-components/action-dropdown/src/action-dropdown.component.html","../../../libs/ui-components/action-dropdown/src/agorapulse-ui-components-action-dropdown.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, inject, input } from '@angular/core';\nimport { ActionDropdownComponent } from './action-dropdown.component';\n\n/**\n * Directive that turns any element into a trigger for an ActionDropdown component.\n * Handles click and keyboard interactions to open/close the dropdown.\n */\n@Directive({\n selector: '[apActionDropdownTrigger]',\n})\nexport class ActionDropdownTriggerDirective {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Reference to the ActionDropdown component that this trigger controls */\n apActionDropdownTrigger = input<ActionDropdownComponent>();\n\n /** Handles click events to toggle the dropdown */\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n this.apActionDropdownTrigger()?.toggle(this.elementRef.nativeElement);\n }\n\n /** Handles keyboard events for accessibility (Enter, Space, Arrow Down, Escape) */\n @HostListener('keydown', ['$event'])\n onKeyDown(event: KeyboardEvent): void {\n const dropdown = this.apActionDropdownTrigger();\n if (!dropdown) return;\n\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n event.preventDefault();\n dropdown.open(this.elementRef.nativeElement);\n break;\n\n case 'Escape':\n event.preventDefault();\n dropdown.close();\n break;\n }\n }\n}\n","import { BadgeColor, BadgeComponent } from '@agorapulse/ui-components/badge';\nimport { createDropdownOverlay, DropdownOverlay } from '@agorapulse/ui-components/dropdown-base';\nimport { FloatingPlacement } from '@agorapulse/ui-components/floating';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { agorapulseSymbol, apFeatureLock, apInfo, SymbolColor, SymbolComponent, SymbolRegistry, withSymbols } from '@agorapulse/ui-symbol';\n\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChild,\n effect,\n inject,\n input,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core';\n\nexport interface ActionDropdownItem {\n /** Unique identifier for the item */\n name?: string;\n /** Display text for the item */\n label?: string;\n /** Secondary text displayed below the label */\n description?: string;\n /** Text displayed in a badge next to the item */\n badgeLabel?: string;\n /** Color of the badge displayed next to the item */\n badgeColor?: BadgeColor;\n /** Whether to show a feature lock icon */\n featureLockEnabled?: boolean;\n /** Whether to apply red styling for destructive actions */\n redModeEnabled?: boolean;\n /** Tooltip text displayed when hovering over the item */\n itemTooltipText?: string;\n /** Icon symbol identifier displayed at the start of the item */\n startSymbolId?: agorapulseSymbol;\n /** Color theme for the start symbol */\n startSymbolColor?: SymbolColor;\n /** Tooltip text for the start symbol */\n startSymbolTooltipText?: string;\n /** Icon symbol identifier displayed at the end of the item */\n endSymbolId?: agorapulseSymbol;\n /** Tooltip text for the end symbol */\n endSymbolTooltipText?: string;\n /** Whether the item is disabled and non-interactive */\n disabled?: boolean;\n /** Whether to add a divider before this item */\n dividerEnabled?: boolean;\n /** Optional ID for the action button item */\n id?: string;\n /** Optional data-track attribute for analytics tracking */\n dataTrack?: string;\n}\n\n/**\n * A dropdown component that displays a list of actionable items with support for icons,\n * badges, tooltips, and keyboard navigation.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-action-dropdown',\n templateUrl: './action-dropdown.component.html',\n styleUrls: ['./action-dropdown.component.scss'],\n imports: [BadgeComponent, SymbolComponent, TooltipDirective],\n providers: [withSymbols(apInfo, apFeatureLock)],\n})\nexport class ActionDropdownComponent implements DropdownOverlay {\n private readonly symbolRegistry = inject(SymbolRegistry);\n private readonly overlay = createDropdownOverlay();\n\n actionDropdownTemplate = viewChild<TemplateRef<unknown>>('actionDropdownTemplate');\n trigger = contentChild<TemplateRef<unknown>>('trigger');\n\n /** Array of items to display in the dropdown menu */\n items = input<ActionDropdownItem[]>([]);\n /** Whether to enable large mode styling for the dropdown */\n largeModeEnabled = input(false);\n /** Custom width for the dropdown menu in pixels */\n customWidth = input<number | null>(null);\n\n /** Whether to show a backdrop that closes the dropdown when clicked */\n showBackdrop = input(true);\n /** Whether the dropdown is disabled and cannot be opened */\n disabled = input(false);\n /** Default position for the dropdown relative to the trigger element */\n /** Panel placement. Unset means derived from the anchor mode, i.e. `bottom-start`. */\n readonly placement = input<FloatingPlacement>();\n\n /** Emits when the dropdown menu is opened */\n opened = output<void>();\n /** Emits when the dropdown menu is closed */\n closed = output<void>();\n /** Emits when a dropdown item is clicked */\n itemClick = output<ActionDropdownItem>();\n\n protected readonly focusedIndex = signal(-1);\n\n readonly isOpen = this.overlay.isOpen;\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n\n // Set up keyboard navigation when dropdown opens\n effect(() => {\n if (this.isOpen()) {\n this.setupKeyboardNavigation();\n }\n });\n }\n\n /** Opens the dropdown menu at the specified trigger element */\n open(triggerElement?: HTMLElement): void {\n const template = this.actionDropdownTemplate();\n if (this.disabled() || this.isOpen() || !template) return;\n\n this.overlay.open(template, triggerElement, {\n showBackdrop: this.showBackdrop(),\n placement: this.placement(),\n onClose: () => this.close(),\n });\n this.opened.emit();\n }\n\n /** Closes the dropdown menu and cleans up overlay resources */\n close(): void {\n if (!this.isOpen()) return;\n this.focusedIndex.set(-1);\n this.overlay.close();\n this.closed.emit();\n }\n\n /** Toggles the dropdown menu open or closed state */\n toggle(triggerElement?: HTMLElement): void {\n if (this.isOpen()) {\n this.close();\n } else {\n this.open(triggerElement);\n }\n }\n\n /** Handles item click events, emitting the selected item and closing the dropdown */\n onItemClick(item: ActionDropdownItem): void {\n if (item.disabled) {\n return;\n }\n\n this.itemClick.emit(item);\n\n this.close();\n }\n\n /** Handles keyboard navigation within the dropdown menu */\n onKeyDown(event: KeyboardEvent): void {\n const items = this.items();\n const currentIndex = this.focusedIndex();\n let nextIndex: number;\n let prevIndex: number;\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n nextIndex = currentIndex < items.length - 1 ? currentIndex + 1 : 0;\n this.focusedIndex.set(nextIndex);\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n prevIndex = currentIndex > 0 ? currentIndex - 1 : items.length - 1;\n this.focusedIndex.set(prevIndex);\n break;\n\n case 'Enter':\n case ' ':\n event.preventDefault();\n if (currentIndex >= 0 && currentIndex < items.length) {\n this.onItemClick(items[currentIndex]);\n }\n break;\n\n case 'Escape':\n event.preventDefault();\n this.close();\n break;\n\n case 'Tab':\n event.preventDefault();\n if (event.shiftKey) {\n // Shift+Tab - move to previous item\n prevIndex = currentIndex > 0 ? currentIndex - 1 : items.length - 1;\n this.focusedIndex.set(prevIndex);\n } else {\n // Tab - move to next item\n nextIndex = currentIndex < items.length - 1 ? currentIndex + 1 : 0;\n this.focusedIndex.set(nextIndex);\n }\n break;\n }\n }\n\n /** Sets up keyboard event handling for the opened dropdown */\n private setupKeyboardNavigation(): void {\n const ref = this.overlay.overlayRef;\n if (!ref) return;\n\n ref.keydownEvents().subscribe((event: KeyboardEvent) => {\n this.onKeyDown(event);\n });\n }\n}\n","<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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;AAGG;MAIU,8BAA8B,CAAA;AACtB,IAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;;AAG7D,IAAA,uBAAuB,GAAG,KAAK;2GAA2B;;AAI1D,IAAA,OAAO,CAAC,KAAiB,EAAA;QACrB,KAAK,CAAC,cAAc,EAAE;QACtB,KAAK,CAAC,eAAe,EAAE;AAEvB,QAAA,IAAI,CAAC,uBAAuB,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;IACzE;;AAIA,IAAA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IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE1E1D;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-action-dropdown.mjs","sources":["../../../libs/ui-components/action-dropdown/src/action-dropdown-trigger.directive.ts","../../../libs/ui-components/action-dropdown/src/action-dropdown.component.ts","../../../libs/ui-components/action-dropdown/src/action-dropdown.component.html","../../../libs/ui-components/action-dropdown/src/agorapulse-ui-components-action-dropdown.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, inject, input } from '@angular/core';\nimport { ActionDropdownComponent } from './action-dropdown.component';\n\n/**\n * Directive that turns any element into a trigger for an ActionDropdown component.\n * Handles click and keyboard interactions to open/close the dropdown.\n */\n@Directive({\n selector: '[apActionDropdownTrigger]',\n})\nexport class ActionDropdownTriggerDirective {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Reference to the ActionDropdown component that this trigger controls */\n apActionDropdownTrigger = input<ActionDropdownComponent>();\n\n /** Handles click events to toggle the dropdown */\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n this.apActionDropdownTrigger()?.toggle(this.elementRef.nativeElement);\n }\n\n /** Handles keyboard events for accessibility (Enter, Space, Arrow Down, Escape) */\n @HostListener('keydown', ['$event'])\n onKeyDown(event: KeyboardEvent): void {\n const dropdown = this.apActionDropdownTrigger();\n if (!dropdown) return;\n\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n event.preventDefault();\n dropdown.open(this.elementRef.nativeElement);\n break;\n\n case 'Escape':\n event.preventDefault();\n dropdown.close();\n break;\n }\n }\n}\n","import { BadgeColor, BadgeComponent } from '@agorapulse/ui-components/badge';\nimport { DropdownOverlay } from '@agorapulse/ui-components/dropdown-base';\nimport { DropdownContentDirective, DropdownPanelComponent } from '@agorapulse/ui-components/dropdown-panel';\nimport { FloatingPlacement } from '@agorapulse/ui-components/floating';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { agorapulseSymbol, apFeatureLock, apInfo, SymbolColor, SymbolComponent, SymbolRegistry, withSymbols } from '@agorapulse/ui-symbol';\n\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n input,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core';\n\nexport interface ActionDropdownItem {\n /** Unique identifier for the item */\n name?: string;\n /** Display text for the item */\n label?: string;\n /** Secondary text displayed below the label */\n description?: string;\n /** Text displayed in a badge next to the item */\n badgeLabel?: string;\n /** Color of the badge displayed next to the item */\n badgeColor?: BadgeColor;\n /** Whether to show a feature lock icon */\n featureLockEnabled?: boolean;\n /** Whether to apply red styling for destructive actions */\n redModeEnabled?: boolean;\n /** Tooltip text displayed when hovering over the item */\n itemTooltipText?: string;\n /** Icon symbol identifier displayed at the start of the item */\n startSymbolId?: agorapulseSymbol;\n /** Color theme for the start symbol */\n startSymbolColor?: SymbolColor;\n /** Tooltip text for the start symbol */\n startSymbolTooltipText?: string;\n /** Icon symbol identifier displayed at the end of the item */\n endSymbolId?: agorapulseSymbol;\n /** Tooltip text for the end symbol */\n endSymbolTooltipText?: string;\n /** Whether the item is disabled and non-interactive */\n disabled?: boolean;\n /** Whether to add a divider before this item */\n dividerEnabled?: boolean;\n /** Optional ID for the action button item */\n id?: string;\n /** Optional data-track attribute for analytics tracking */\n dataTrack?: string;\n}\n\n/**\n * A dropdown component that displays a list of actionable items with support for icons,\n * badges, tooltips, and keyboard navigation.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-action-dropdown',\n templateUrl: './action-dropdown.component.html',\n styleUrls: ['./action-dropdown.component.scss'],\n imports: [BadgeComponent, DropdownContentDirective, DropdownPanelComponent, SymbolComponent, TooltipDirective],\n providers: [withSymbols(apInfo, apFeatureLock)],\n})\nexport class ActionDropdownComponent implements DropdownOverlay {\n private readonly symbolRegistry = inject(SymbolRegistry);\n private readonly panel = viewChild(DropdownPanelComponent);\n\n trigger = contentChild<TemplateRef<unknown>>('trigger');\n\n /** Array of items to display in the dropdown menu */\n items = input<ActionDropdownItem[]>([]);\n /** Whether to enable large mode styling for the dropdown */\n largeModeEnabled = input(false);\n /** Custom width for the dropdown menu in pixels */\n customWidth = input<number | null>(null);\n\n /** Whether to show a backdrop that closes the dropdown when clicked */\n showBackdrop = input(true);\n /** Whether the dropdown is disabled and cannot be opened */\n disabled = input(false);\n /** Panel placement. Unset means derived from the anchor mode, i.e. `bottom-start`. */\n readonly placement = input<FloatingPlacement>();\n\n /** Emits when the dropdown menu is opened */\n opened = output<void>();\n /** Emits when the dropdown menu is closed */\n closed = output<void>();\n /** Emits when a dropdown item is clicked */\n itemClick = output<ActionDropdownItem>();\n\n protected readonly focusedIndex = signal(-1);\n\n readonly isOpen = computed(() => this.panel()?.isOpen() ?? false);\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n\n // Set up keyboard navigation when dropdown opens\n effect(() => {\n if (this.isOpen()) {\n this.setupKeyboardNavigation();\n }\n });\n }\n\n /** Opens the dropdown menu at the specified trigger element */\n open(triggerElement?: HTMLElement): void {\n const panel = this.panel();\n if (this.disabled() || this.isOpen() || !panel) return;\n\n panel.open(triggerElement);\n this.opened.emit();\n }\n\n close(): void {\n this.panel()?.close();\n }\n\n protected onPanelClosed(): void {\n this.focusedIndex.set(-1);\n this.closed.emit();\n }\n\n /** Toggles the dropdown menu open or closed state */\n toggle(triggerElement?: HTMLElement): void {\n if (this.isOpen()) {\n this.close();\n } else {\n this.open(triggerElement);\n }\n }\n\n /** Handles item click events, emitting the selected item and closing the dropdown */\n onItemClick(item: ActionDropdownItem): void {\n if (item.disabled) {\n return;\n }\n\n this.itemClick.emit(item);\n\n this.close();\n }\n\n /** Handles keyboard navigation within the dropdown menu */\n onKeyDown(event: KeyboardEvent): void {\n const items = this.items();\n const currentIndex = this.focusedIndex();\n let nextIndex: number;\n let prevIndex: number;\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n nextIndex = currentIndex < items.length - 1 ? currentIndex + 1 : 0;\n this.focusedIndex.set(nextIndex);\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n prevIndex = currentIndex > 0 ? currentIndex - 1 : items.length - 1;\n this.focusedIndex.set(prevIndex);\n break;\n\n case 'Enter':\n case ' ':\n event.preventDefault();\n if (currentIndex >= 0 && currentIndex < items.length) {\n this.onItemClick(items[currentIndex]);\n }\n break;\n\n case 'Escape':\n event.preventDefault();\n this.close();\n break;\n\n case 'Tab':\n event.preventDefault();\n if (event.shiftKey) {\n // Shift+Tab - move to previous item\n prevIndex = currentIndex > 0 ? currentIndex - 1 : items.length - 1;\n this.focusedIndex.set(prevIndex);\n } else {\n // Tab - move to next item\n nextIndex = currentIndex < items.length - 1 ? currentIndex + 1 : 0;\n this.focusedIndex.set(nextIndex);\n }\n break;\n }\n }\n\n /** Sets up keyboard event handling for the opened dropdown */\n private setupKeyboardNavigation(): void {\n const ref = this.panel()?.overlayRef;\n if (!ref) return;\n\n ref.keydownEvents().subscribe((event: KeyboardEvent) => {\n this.onKeyDown(event);\n });\n }\n}\n","<ap-dropdown-panel\n [placement]=\"placement()\"\n [showBackdrop]=\"showBackdrop()\"\n (closed)=\"onPanelClosed()\">\n <!-- Action dropdown -->\n <div\n *apDropdownContent\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</ap-dropdown-panel>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;AAGG;MAIU,8BAA8B,CAAA;AACtB,IAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;;AAG7D,IAAA,uBAAuB,GAAG,KAAK;2GAA2B;;AAI1D,IAAA,OAAO,CAAC,KAAiB,EAAA;QACrB,KAAK,CAAC,cAAc,EAAE;QACtB,KAAK,CAAC,eAAe,EAAE;AAEvB,QAAA,IAAI,CAAC,uBAAuB,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;IACzE;;A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AAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3E1D;;AAEG;;;;"}
@@ -77,7 +77,6 @@ class DateRangePickerComponent {
77
77
  /** Text shown on the trigger while no period is selected. */
78
78
  placeholder = input('Select period', /* @ts-ignore */
79
79
  ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
80
- /** Side the dropdown opens to when space allows. */
81
80
  /** Panel placement. Unset means derived from the anchor mode, i.e. `bottom-start`. */
82
81
  placement = input(/* @ts-ignore */
83
82
  ...(ngDevMode ? [undefined, { debugName: "placement" }] : /* istanbul ignore next */ []));
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-date-range-picker.mjs","sources":["../../../libs/ui-components/date-range-picker/src/date-range-picker.component.ts","../../../libs/ui-components/date-range-picker/src/date-range-picker.component.html","../../../libs/ui-components/date-range-picker/src/agorapulse-ui-components-date-range-picker.ts"],"sourcesContent":["import { LOCALE_CONFIG, LocaleService } from '@agorapulse/ngx-daterangepicker-material';\nimport {\n DatepickerDropdownComponent,\n DatepickerMode,\n FirstDayOfWeek,\n I18nDatePicker,\n Period,\n RangesConfigPresetType,\n} from '@agorapulse/ui-components/datepicker';\nimport { DropdownTriggerDirective } from '@agorapulse/ui-components/dropdown-base';\nimport { FloatingPlacement } from '@agorapulse/ui-components/floating';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { apCalendar, apChevronDown, apChevronUp, apClock, apInfo, SymbolComponent, withSymbols } from '@agorapulse/ui-symbol';\nimport { ChangeDetectionStrategy, Component, computed, input, model, output, ViewEncapsulation } from '@angular/core';\nimport dayjs from 'dayjs';\n\nexport interface DateRangePickerPreset {\n /** Stable identifier emitted by `presetSelected`, independent of the displayed label. */\n key: string;\n /** The text shown in the preset list. */\n label: string;\n /** The date range this preset selects. */\n range: [dayjs.Dayjs, dayjs.Dayjs];\n}\n\n/** The default preset list (English labels), computed relative to `today` so ranges stay fresh. */\nexport function defaultDateRangePickerPresets(today: dayjs.Dayjs = dayjs()): DateRangePickerPreset[] {\n const yesterday = today.subtract(1, 'day');\n return [\n { key: 'yesterday', label: 'Yesterday', range: [yesterday, yesterday] },\n { key: 'lastWeek', label: 'Last week', range: [today.subtract(7, 'day'), yesterday] },\n { key: 'last30Days', label: 'Last 30 days', range: [today.subtract(30, 'day'), yesterday] },\n {\n key: 'lastMonth',\n label: 'Previous month',\n range: [today.subtract(1, 'month').startOf('month'), today.subtract(1, 'month').endOf('month')],\n },\n { key: 'last90Days', label: 'Last 90 days', range: [today.subtract(90, 'day'), yesterday] },\n { key: 'last12Months', label: 'Last 12 months', range: [today.subtract(1, 'year'), yesterday] },\n { key: 'thisMonth', label: 'This month', range: [yesterday.startOf('month'), yesterday] },\n {\n key: 'lastYear',\n label: 'Previous year',\n range: [today.subtract(1, 'year').startOf('year'), today.subtract(1, 'year').endOf('year')],\n },\n ];\n}\n\nfunction timeZoneAbbreviation(timeZone: string): string {\n return (\n new Intl.DateTimeFormat('en-US', { timeZone, timeZoneName: 'short' })\n .formatToParts(new Date())\n .find(({ type }) => type === 'timeZoneName')?.value ?? ''\n );\n}\n\n/**\n * A compact date-range selector for toolbars: a trigger chip showing the selected\n * period that opens a dropdown with preset ranges and a dual-month calendar.\n *\n * @example\n * ```html\n * <ap-date-range-picker\n * [(value)]=\"period\"\n * [maxDate]=\"yesterday\"\n * timeZone=\"Europe/Paris\"\n * (presetSelected)=\"onPreset($event)\" />\n * ```\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-date-range-picker',\n templateUrl: './date-range-picker.component.html',\n styleUrls: ['./date-range-picker.component.scss'],\n imports: [DatepickerDropdownComponent, DropdownTriggerDirective, SymbolComponent, TooltipDirective],\n providers: [\n withSymbols(apCalendar, apChevronDown, apChevronUp, apClock, apInfo),\n { provide: LOCALE_CONFIG, useValue: {} },\n LocaleService,\n ],\n host: {\n class: 'ap-date-range-picker',\n },\n // Emit plain, global `.ap-date-range-picker*` classes (no Angular scoping) so the\n // styling stays framework-agnostic and readable/reusable outside Angular.\n encapsulation: ViewEncapsulation.None,\n})\nexport class DateRangePickerComponent {\n /** The selected period. Supports two-way binding via `[(value)]`. */\n readonly value = model<Period>({ startDate: undefined, endDate: undefined });\n /** The preset ranges listed in the dropdown. Defaults to `defaultDateRangePickerPresets()`. */\n readonly presets = input<DateRangePickerPreset[]>(defaultDateRangePickerPresets());\n /** Earliest selectable date. */\n readonly minDate = input<dayjs.Dayjs | undefined>(undefined);\n /** Latest selectable date. */\n readonly maxDate = input<dayjs.Dayjs | undefined>(undefined);\n /** Maximum number of days between the start and the end date. Undefined means no limit. */\n readonly maxRangeDays = input<number | undefined>(undefined);\n /** Caption shown in the panel when `maxRangeDays` is set. Defaults to an English sentence — pass a translated one. */\n readonly maxRangeDaysHint = input<string | undefined>(undefined);\n /** Locale used for the calendar and the trigger label. */\n readonly locale = input('en');\n readonly firstDayOfWeek = input<FirstDayOfWeek>('monday');\n /** dayjs format of the trigger label. */\n readonly dateFormat = input('ll');\n /** Text shown on the trigger while no period is selected. */\n readonly placeholder = input('Select period');\n /** Side the dropdown opens to when space allows. */\n /** Panel placement. Unset means derived from the anchor mode, i.e. `bottom-start`. */\n readonly placement = input<FloatingPlacement>();\n /** Label of the \"Custom\" entry in the preset list. */\n readonly customRangeLabel = input('Custom');\n /** IANA time zone name. When set, a chip with the zone's offset is shown next to the trigger. */\n readonly timeZone = input<string | undefined>(undefined);\n /** Tooltip text of the info icon shown next to the time-zone chip. */\n readonly timeZoneTooltip = input<string | undefined>(undefined);\n readonly disabled = input(false);\n /** Close the dropdown once a full period is selected. When false it stays open until backdrop click or Escape. */\n readonly closeOnSelect = input(true);\n /** Emits the `key` of the preset matching the picked period, or 'custom'. */\n readonly presetSelected = output<string>();\n\n protected readonly DatepickerMode = DatepickerMode;\n\n protected readonly rangesConfig = computed<RangesConfigPresetType>(() =>\n Object.fromEntries(this.presets().map(({ label, range }) => [label, range]))\n );\n\n protected readonly i18n = computed<I18nDatePicker>(() => ({\n ranges: {\n yesterday: 'Yesterday',\n lastWeek: 'Last Week',\n last30Days: 'Last 30 days',\n lastMonth: 'Previous month',\n thisMonth: 'This month',\n },\n customRangeLabel: this.customRangeLabel(),\n }));\n\n protected readonly formattedValue = computed(() => {\n const { startDate, endDate } = this.value();\n if (!startDate || !endDate) {\n return '';\n }\n const format = (date: dayjs.Dayjs) => date.locale(this.locale()).format(this.dateFormat());\n return `${format(startDate)} - ${format(endDate)}`;\n });\n\n protected readonly rangeHint = computed(() => {\n const days = this.maxRangeDays();\n return days ? (this.maxRangeDaysHint() ?? `Maximum period: ${days} days`) : undefined;\n });\n\n protected readonly timeZoneOffset = computed(() => {\n const timeZone = this.timeZone();\n return timeZone ? timeZoneAbbreviation(timeZone) : '';\n });\n\n protected onPeriodSelected(period: Period): void {\n this.value.set(period);\n this.presetSelected.emit(this.matchPresetKey(period));\n }\n\n private matchPresetKey({ startDate, endDate }: Period): string {\n const match = this.presets().find(({ range: [start, end] }) => startDate?.isSame(start, 'day') && endDate?.isSame(end, 'day'));\n return match?.key ?? 'custom';\n }\n}\n","<button\n type=\"button\"\n class=\"ap-date-range-picker__trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"dropdown.isOpen()\"\n [class.ap-date-range-picker__trigger--open]=\"dropdown.isOpen()\"\n [disabled]=\"disabled()\"\n [apDropdownTrigger]=\"dropdown\">\n <ap-symbol\n size=\"sm\"\n symbolId=\"calendar\" />\n @if (formattedValue()) {\n <span class=\"ap-date-range-picker__value\">{{ formattedValue() }}</span>\n } @else {\n <span class=\"ap-date-range-picker__placeholder\">{{ placeholder() }}</span>\n }\n <ap-symbol\n class=\"ap-date-range-picker__chevron\"\n size=\"sm\"\n [symbolId]=\"dropdown.isOpen() ? 'chevron-up' : 'chevron-down'\" />\n</button>\n\n@if (timeZone()) {\n <div\n class=\"ap-date-range-picker__timezone\"\n apTooltipPosition=\"bottom\"\n [apTooltip]=\"timeZone()\">\n <ap-symbol\n size=\"sm\"\n symbolId=\"clock\"\n color=\"grey\" />\n <span class=\"ap-date-range-picker__timezone-offset\">{{ timeZoneOffset() }}</span>\n </div>\n @if (timeZoneTooltip()) {\n <ap-symbol\n class=\"ap-date-range-picker__timezone-info\"\n size=\"sm\"\n symbolId=\"info\"\n color=\"grey-blue\"\n apTooltipPosition=\"bottom\"\n [apTooltip]=\"timeZoneTooltip()\" />\n }\n}\n\n<ap-datepicker-dropdown\n #dropdown\n [mode]=\"DatepickerMode.Range\"\n [closeOnSelect]=\"closeOnSelect()\"\n [dateLimit]=\"maxRangeDays()\"\n [placement]=\"placement()\"\n [hint]=\"rangeHint()\"\n [disabled]=\"disabled()\"\n [firstDayOfWeek]=\"firstDayOfWeek()\"\n [i18n]=\"i18n()\"\n [locale]=\"locale()\"\n [maxDate]=\"maxDate()\"\n [minDate]=\"minDate()\"\n [rangesConfig]=\"rangesConfig()\"\n [selectedPeriod]=\"value()\"\n [showCustomRangeLabel]=\"true\"\n [showRanges]=\"true\"\n (periodSelected)=\"onPeriodSelected($event)\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAyBA;AACM,SAAU,6BAA6B,CAAC,KAAA,GAAqB,KAAK,EAAE,EAAA;IACtE,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC;IAC1C,OAAO;AACH,QAAA,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE;QACvE,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,EAAE;QACrF,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,EAAE;AAC3F,QAAA;AACI,YAAA,GAAG,EAAE,WAAW;AAChB,YAAA,KAAK,EAAE,gBAAgB;AACvB,YAAA,KAAK,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAClG,SAAA;QACD,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,EAAE;QAC3F,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EA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BAAA,EAAA,mBAAA,EAAA,mBAAA,EAAA,4BAAA,EAAA,0BAAA,EAAA,+BAAA,EAAA,kBAAA,EAAA,eAAA,EAAA,8BAAA,EAAA,oBAAA,EAAA,4BAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAazF,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAlBpC,SAAS;AACW,YAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,sBAAsB,WAGvB,CAAC,2BAA2B,EAAE,wBAAwB,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAA,SAAA,EACxF;wBACP,WAAW,CAAC,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC;AACpE,wBAAA,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAE;wBACxC,aAAa;qBAChB,EAAA,IAAA,EACK;AACF,wBAAA,KAAK,EAAE,sBAAsB;qBAChC,EAAA,aAAA,EAGc,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,u+DAAA,EAAA,MAAA,EAAA,CAAA,myCAAA,CAAA,EAAA;;;AErFzC;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-date-range-picker.mjs","sources":["../../../libs/ui-components/date-range-picker/src/date-range-picker.component.ts","../../../libs/ui-components/date-range-picker/src/date-range-picker.component.html","../../../libs/ui-components/date-range-picker/src/agorapulse-ui-components-date-range-picker.ts"],"sourcesContent":["import { LOCALE_CONFIG, LocaleService } from '@agorapulse/ngx-daterangepicker-material';\nimport {\n DatepickerDropdownComponent,\n DatepickerMode,\n FirstDayOfWeek,\n I18nDatePicker,\n Period,\n RangesConfigPresetType,\n} from '@agorapulse/ui-components/datepicker';\nimport { DropdownTriggerDirective } from '@agorapulse/ui-components/dropdown-base';\nimport { FloatingPlacement } from '@agorapulse/ui-components/floating';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { apCalendar, apChevronDown, apChevronUp, apClock, apInfo, SymbolComponent, withSymbols } from '@agorapulse/ui-symbol';\nimport { ChangeDetectionStrategy, Component, computed, input, model, output, ViewEncapsulation } from '@angular/core';\nimport dayjs from 'dayjs';\n\nexport interface DateRangePickerPreset {\n /** Stable identifier emitted by `presetSelected`, independent of the displayed label. */\n key: string;\n /** The text shown in the preset list. */\n label: string;\n /** The date range this preset selects. */\n range: [dayjs.Dayjs, dayjs.Dayjs];\n}\n\n/** The default preset list (English labels), computed relative to `today` so ranges stay fresh. */\nexport function defaultDateRangePickerPresets(today: dayjs.Dayjs = dayjs()): DateRangePickerPreset[] {\n const yesterday = today.subtract(1, 'day');\n return [\n { key: 'yesterday', label: 'Yesterday', range: [yesterday, yesterday] },\n { key: 'lastWeek', label: 'Last week', range: [today.subtract(7, 'day'), yesterday] },\n { key: 'last30Days', label: 'Last 30 days', range: [today.subtract(30, 'day'), yesterday] },\n {\n key: 'lastMonth',\n label: 'Previous month',\n range: [today.subtract(1, 'month').startOf('month'), today.subtract(1, 'month').endOf('month')],\n },\n { key: 'last90Days', label: 'Last 90 days', range: [today.subtract(90, 'day'), yesterday] },\n { key: 'last12Months', label: 'Last 12 months', range: [today.subtract(1, 'year'), yesterday] },\n { key: 'thisMonth', label: 'This month', range: [yesterday.startOf('month'), yesterday] },\n {\n key: 'lastYear',\n label: 'Previous year',\n range: [today.subtract(1, 'year').startOf('year'), today.subtract(1, 'year').endOf('year')],\n },\n ];\n}\n\nfunction timeZoneAbbreviation(timeZone: string): string {\n return (\n new Intl.DateTimeFormat('en-US', { timeZone, timeZoneName: 'short' })\n .formatToParts(new Date())\n .find(({ type }) => type === 'timeZoneName')?.value ?? ''\n );\n}\n\n/**\n * A compact date-range selector for toolbars: a trigger chip showing the selected\n * period that opens a dropdown with preset ranges and a dual-month calendar.\n *\n * @example\n * ```html\n * <ap-date-range-picker\n * [(value)]=\"period\"\n * [maxDate]=\"yesterday\"\n * timeZone=\"Europe/Paris\"\n * (presetSelected)=\"onPreset($event)\" />\n * ```\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-date-range-picker',\n templateUrl: './date-range-picker.component.html',\n styleUrls: ['./date-range-picker.component.scss'],\n imports: [DatepickerDropdownComponent, DropdownTriggerDirective, SymbolComponent, TooltipDirective],\n providers: [\n withSymbols(apCalendar, apChevronDown, apChevronUp, apClock, apInfo),\n { provide: LOCALE_CONFIG, useValue: {} },\n LocaleService,\n ],\n host: {\n class: 'ap-date-range-picker',\n },\n // Emit plain, global `.ap-date-range-picker*` classes (no Angular scoping) so the\n // styling stays framework-agnostic and readable/reusable outside Angular.\n encapsulation: ViewEncapsulation.None,\n})\nexport class DateRangePickerComponent {\n /** The selected period. Supports two-way binding via `[(value)]`. */\n readonly value = model<Period>({ startDate: undefined, endDate: undefined });\n /** The preset ranges listed in the dropdown. Defaults to `defaultDateRangePickerPresets()`. */\n readonly presets = input<DateRangePickerPreset[]>(defaultDateRangePickerPresets());\n /** Earliest selectable date. */\n readonly minDate = input<dayjs.Dayjs | undefined>(undefined);\n /** Latest selectable date. */\n readonly maxDate = input<dayjs.Dayjs | undefined>(undefined);\n /** Maximum number of days between the start and the end date. Undefined means no limit. */\n readonly maxRangeDays = input<number | undefined>(undefined);\n /** Caption shown in the panel when `maxRangeDays` is set. Defaults to an English sentence — pass a translated one. */\n readonly maxRangeDaysHint = input<string | undefined>(undefined);\n /** Locale used for the calendar and the trigger label. */\n readonly locale = input('en');\n readonly firstDayOfWeek = input<FirstDayOfWeek>('monday');\n /** dayjs format of the trigger label. */\n readonly dateFormat = input('ll');\n /** Text shown on the trigger while no period is selected. */\n readonly placeholder = input('Select period');\n /** Panel placement. Unset means derived from the anchor mode, i.e. `bottom-start`. */\n readonly placement = input<FloatingPlacement>();\n /** Label of the \"Custom\" entry in the preset list. */\n readonly customRangeLabel = input('Custom');\n /** IANA time zone name. When set, a chip with the zone's offset is shown next to the trigger. */\n readonly timeZone = input<string | undefined>(undefined);\n /** Tooltip text of the info icon shown next to the time-zone chip. */\n readonly timeZoneTooltip = input<string | undefined>(undefined);\n readonly disabled = input(false);\n /** Close the dropdown once a full period is selected. When false it stays open until backdrop click or Escape. */\n readonly closeOnSelect = input(true);\n /** Emits the `key` of the preset matching the picked period, or 'custom'. */\n readonly presetSelected = output<string>();\n\n protected readonly DatepickerMode = DatepickerMode;\n\n protected readonly rangesConfig = computed<RangesConfigPresetType>(() =>\n Object.fromEntries(this.presets().map(({ label, range }) => [label, range]))\n );\n\n protected readonly i18n = computed<I18nDatePicker>(() => ({\n ranges: {\n yesterday: 'Yesterday',\n lastWeek: 'Last Week',\n last30Days: 'Last 30 days',\n lastMonth: 'Previous month',\n thisMonth: 'This month',\n },\n customRangeLabel: this.customRangeLabel(),\n }));\n\n protected readonly formattedValue = computed(() => {\n const { startDate, endDate } = this.value();\n if (!startDate || !endDate) {\n return '';\n }\n const format = (date: dayjs.Dayjs) => date.locale(this.locale()).format(this.dateFormat());\n return `${format(startDate)} - ${format(endDate)}`;\n });\n\n protected readonly rangeHint = computed(() => {\n const days = this.maxRangeDays();\n return days ? (this.maxRangeDaysHint() ?? `Maximum period: ${days} days`) : undefined;\n });\n\n protected readonly timeZoneOffset = computed(() => {\n const timeZone = this.timeZone();\n return timeZone ? timeZoneAbbreviation(timeZone) : '';\n });\n\n protected onPeriodSelected(period: Period): void {\n this.value.set(period);\n this.presetSelected.emit(this.matchPresetKey(period));\n }\n\n private matchPresetKey({ startDate, endDate }: Period): string {\n const match = this.presets().find(({ range: [start, end] }) => startDate?.isSame(start, 'day') && endDate?.isSame(end, 'day'));\n return match?.key ?? 'custom';\n }\n}\n","<button\n type=\"button\"\n class=\"ap-date-range-picker__trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"dropdown.isOpen()\"\n [class.ap-date-range-picker__trigger--open]=\"dropdown.isOpen()\"\n [disabled]=\"disabled()\"\n [apDropdownTrigger]=\"dropdown\">\n <ap-symbol\n size=\"sm\"\n symbolId=\"calendar\" />\n @if (formattedValue()) {\n <span class=\"ap-date-range-picker__value\">{{ formattedValue() }}</span>\n } @else {\n <span class=\"ap-date-range-picker__placeholder\">{{ placeholder() }}</span>\n }\n <ap-symbol\n class=\"ap-date-range-picker__chevron\"\n size=\"sm\"\n [symbolId]=\"dropdown.isOpen() ? 'chevron-up' : 'chevron-down'\" />\n</button>\n\n@if (timeZone()) {\n <div\n class=\"ap-date-range-picker__timezone\"\n apTooltipPosition=\"bottom\"\n [apTooltip]=\"timeZone()\">\n <ap-symbol\n size=\"sm\"\n symbolId=\"clock\"\n color=\"grey\" />\n <span class=\"ap-date-range-picker__timezone-offset\">{{ timeZoneOffset() }}</span>\n </div>\n @if (timeZoneTooltip()) {\n <ap-symbol\n class=\"ap-date-range-picker__timezone-info\"\n size=\"sm\"\n symbolId=\"info\"\n color=\"grey-blue\"\n apTooltipPosition=\"bottom\"\n [apTooltip]=\"timeZoneTooltip()\" />\n }\n}\n\n<ap-datepicker-dropdown\n #dropdown\n [mode]=\"DatepickerMode.Range\"\n [closeOnSelect]=\"closeOnSelect()\"\n [dateLimit]=\"maxRangeDays()\"\n [placement]=\"placement()\"\n [hint]=\"rangeHint()\"\n [disabled]=\"disabled()\"\n [firstDayOfWeek]=\"firstDayOfWeek()\"\n [i18n]=\"i18n()\"\n [locale]=\"locale()\"\n [maxDate]=\"maxDate()\"\n [minDate]=\"minDate()\"\n [rangesConfig]=\"rangesConfig()\"\n [selectedPeriod]=\"value()\"\n [showCustomRangeLabel]=\"true\"\n [showRanges]=\"true\"\n (periodSelected)=\"onPeriodSelected($event)\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAyBA;AACM,SAAU,6BAA6B,CAA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A,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAazF,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAlBpC,SAAS;AACW,YAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,sBAAsB,WAGvB,CAAC,2BAA2B,EAAE,wBAAwB,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAA,SAAA,EACxF;wBACP,WAAW,CAAC,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC;AACpE,wBAAA,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAE;wBACxC,aAAa;qBAChB,EAAA,IAAA,EACK;AACF,wBAAA,KAAK,EAAE,sBAAsB;qBAChC,EAAA,aAAA,EAGc,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,u+DAAA,EAAA,MAAA,EAAA,CAAA,myCAAA,CAAA,EAAA;;;AErFzC;;AAEG;;;;"}
@@ -0,0 +1,93 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, TemplateRef, Directive, contentChild, viewChild, input, output, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { createFloatingOverlay } from '@agorapulse/ui-components/floating';
4
+ import { NgTemplateOutlet } from '@angular/common';
5
+
6
+ /** Marks the panel's content. A template, not `<ng-content>`, so nothing is created until the panel opens. */
7
+ class DropdownContentDirective {
8
+ template = inject(TemplateRef);
9
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DropdownContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
10
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: DropdownContentDirective, isStandalone: true, selector: "ng-template[apDropdownContent]", ngImport: i0 });
11
+ }
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DropdownContentDirective, decorators: [{
13
+ type: Directive,
14
+ args: [{ selector: 'ng-template[apDropdownContent]' }]
15
+ }] });
16
+
17
+ /**
18
+ * The surface a dropdown opens: white, rounded, elevated — and nothing more. No role and no focus
19
+ * trap: the content brings its own semantics (`menu`, `listbox`…). A dialog wants the popover.
20
+ *
21
+ * @example
22
+ * <button [apDropdownTrigger]="panel">Columns</button>
23
+ * <ap-dropdown-panel #panel>
24
+ * <ng-template apDropdownContent>…</ng-template>
25
+ * </ap-dropdown-panel>
26
+ */
27
+ class DropdownPanelComponent {
28
+ floating = createFloatingOverlay();
29
+ content = contentChild.required(DropdownContentDirective);
30
+ surface = viewChild.required('surface');
31
+ /** Unset means derived from the anchor mode, i.e. `bottom-start`. */
32
+ placement = input(/* @ts-ignore */
33
+ ...(ngDevMode ? [undefined, { debugName: "placement" }] : /* istanbul ignore next */ []));
34
+ /** On by default: a dropdown keeps its click catcher. */
35
+ showBackdrop = input(true, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "showBackdrop" }] : /* istanbul ignore next */ []));
37
+ panelClass = input('', /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
39
+ /** Consulted before an outside click or Escape closes the panel. Return `false` to keep it open. */
40
+ canDismiss = input(() => true, /* @ts-ignore */
41
+ ...(ngDevMode ? [{ debugName: "canDismiss" }] : /* istanbul ignore next */ []));
42
+ opened = output();
43
+ /** Fires for every close, asked for or gestured: a host's teardown belongs here, not in its own `close()`. */
44
+ closed = output();
45
+ isOpen = this.floating.isOpen;
46
+ /** For a host that must hear the gesture before it becomes a dismissal — see the filter dropdown. */
47
+ get overlayRef() {
48
+ return this.floating.overlayRef;
49
+ }
50
+ open(triggerElement) {
51
+ if (this.isOpen())
52
+ return;
53
+ this.floating.open(this.surface(), triggerElement, {
54
+ placement: this.placement(),
55
+ showBackdrop: this.showBackdrop(),
56
+ panelClass: this.panelClass(),
57
+ onClose: () => this.dismiss(),
58
+ });
59
+ this.opened.emit();
60
+ }
61
+ close() {
62
+ if (!this.isOpen())
63
+ return;
64
+ this.floating.close();
65
+ this.closed.emit();
66
+ }
67
+ toggle(triggerElement) {
68
+ if (this.isOpen()) {
69
+ this.close();
70
+ }
71
+ else {
72
+ this.open(triggerElement);
73
+ }
74
+ }
75
+ dismiss() {
76
+ if (this.canDismiss()()) {
77
+ this.close();
78
+ }
79
+ }
80
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DropdownPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
81
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.5", type: DropdownPanelComponent, isStandalone: true, selector: "ap-dropdown-panel", inputs: { placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, showBackdrop: { classPropertyName: "showBackdrop", publicName: "showBackdrop", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, canDismiss: { classPropertyName: "canDismiss", publicName: "canDismiss", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, queries: [{ propertyName: "content", first: true, predicate: DropdownContentDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "surface", first: true, predicate: ["surface"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #surface>\n <div class=\"ap-dropdown-panel\">\n <ng-container [ngTemplateOutlet]=\"content().template\" />\n </div>\n</ng-template>\n", styles: [":host{display:none}.ap-dropdown-panel{background-color:var(--comp-dropdown-panel-background-color);border-radius:var(--comp-dropdown-panel-border-radius);box-shadow:var(--comp-dropdown-panel-box-shadow);overflow:clip;overflow-clip-margin:3px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
82
+ }
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DropdownPanelComponent, decorators: [{
84
+ type: Component,
85
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-dropdown-panel', imports: [NgTemplateOutlet], template: "<ng-template #surface>\n <div class=\"ap-dropdown-panel\">\n <ng-container [ngTemplateOutlet]=\"content().template\" />\n </div>\n</ng-template>\n", styles: [":host{display:none}.ap-dropdown-panel{background-color:var(--comp-dropdown-panel-background-color);border-radius:var(--comp-dropdown-panel-border-radius);box-shadow:var(--comp-dropdown-panel-box-shadow);overflow:clip;overflow-clip-margin:3px}\n"] }]
86
+ }], propDecorators: { content: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownContentDirective), { isSignal: true }] }], surface: [{ type: i0.ViewChild, args: ['surface', { isSignal: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], showBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBackdrop", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], canDismiss: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDismiss", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
87
+
88
+ /**
89
+ * Generated bundle index. Do not edit.
90
+ */
91
+
92
+ export { DropdownContentDirective, DropdownPanelComponent };
93
+ //# sourceMappingURL=agorapulse-ui-components-dropdown-panel.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agorapulse-ui-components-dropdown-panel.mjs","sources":["../../../libs/ui-components/dropdown-panel/src/dropdown-content.directive.ts","../../../libs/ui-components/dropdown-panel/src/dropdown-panel.component.ts","../../../libs/ui-components/dropdown-panel/src/dropdown-panel.component.html","../../../libs/ui-components/dropdown-panel/src/agorapulse-ui-components-dropdown-panel.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n/** Marks the panel's content. A template, not `<ng-content>`, so nothing is created until the panel opens. */\n@Directive({ selector: 'ng-template[apDropdownContent]' })\nexport class DropdownContentDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { createFloatingOverlay, FloatingPlacement } from '@agorapulse/ui-components/floating';\nimport { OverlayRef } from '@angular/cdk/overlay';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, contentChild, input, output, TemplateRef, viewChild } from '@angular/core';\nimport { DropdownOverlay } from '@agorapulse/ui-components/dropdown-base';\nimport { DropdownContentDirective } from './dropdown-content.directive';\n\n/**\n * The surface a dropdown opens: white, rounded, elevated — and nothing more. No role and no focus\n * trap: the content brings its own semantics (`menu`, `listbox`…). A dialog wants the popover.\n *\n * @example\n * <button [apDropdownTrigger]=\"panel\">Columns</button>\n * <ap-dropdown-panel #panel>\n * <ng-template apDropdownContent>…</ng-template>\n * </ap-dropdown-panel>\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-dropdown-panel',\n imports: [NgTemplateOutlet],\n templateUrl: 'dropdown-panel.component.html',\n styleUrls: ['dropdown-panel.component.scss'],\n})\nexport class DropdownPanelComponent implements DropdownOverlay {\n private readonly floating = createFloatingOverlay();\n protected readonly content = contentChild.required(DropdownContentDirective);\n private readonly surface = viewChild.required<TemplateRef<unknown>>('surface');\n\n /** Unset means derived from the anchor mode, i.e. `bottom-start`. */\n readonly placement = input<FloatingPlacement>();\n\n /** On by default: a dropdown keeps its click catcher. */\n readonly showBackdrop = input(true);\n\n readonly panelClass = input<string | string[]>('');\n\n /** Consulted before an outside click or Escape closes the panel. Return `false` to keep it open. */\n readonly canDismiss = input<() => boolean>(() => true);\n\n readonly opened = output<void>();\n\n /** Fires for every close, asked for or gestured: a host's teardown belongs here, not in its own `close()`. */\n readonly closed = output<void>();\n\n readonly isOpen = this.floating.isOpen;\n\n /** For a host that must hear the gesture before it becomes a dismissal — see the filter dropdown. */\n get overlayRef(): OverlayRef | null {\n return this.floating.overlayRef;\n }\n\n open(triggerElement?: HTMLElement): void {\n if (this.isOpen()) return;\n\n this.floating.open(this.surface(), triggerElement, {\n placement: this.placement(),\n showBackdrop: this.showBackdrop(),\n panelClass: this.panelClass(),\n onClose: () => this.dismiss(),\n });\n this.opened.emit();\n }\n\n close(): void {\n if (!this.isOpen()) return;\n\n this.floating.close();\n this.closed.emit();\n }\n\n toggle(triggerElement?: HTMLElement): void {\n if (this.isOpen()) {\n this.close();\n } else {\n this.open(triggerElement);\n }\n }\n\n private dismiss(): void {\n if (this.canDismiss()()) {\n this.close();\n }\n }\n}\n","<ng-template #surface>\n <div class=\"ap-dropdown-panel\">\n <ng-container [ngTemplateOutlet]=\"content().template\" />\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAEA;MAEa,wBAAwB,CAAA;AACxB,IAAA,QAAQ,GAAG,MAAM,CAAuB,WAAW,CAAC;uGADpD,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gCAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC,SAAS;mBAAC,EAAE,QAAQ,EAAE,gCAAgC,EAAE;;;ACIzD;;;;;;;;;AASG;MAQU,sBAAsB,CAAA;IACd,QAAQ,GAAG,qBAAqB,EAAE;AAChC,IAAA,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAC,wBAAwB,CAAC;AAC3D,IAAA,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAuB,SAAS,CAAC;;AAGrE,IAAA,SAAS,GAAG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