@forgeroute/ui 0.5.23 → 0.5.25

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.
@@ -357,7 +357,7 @@ var DropdownComponent = class DropdownComponent {
357
357
  </div>
358
358
  } @else {
359
359
  @for (item of displayItems(); track item.value; let i = $index) {
360
- <button type="button" class="dd-item" role="menuitem" tabindex="-1" [disabled]="item.disabled === true" [class.dd-item-active]="activeValue() === item.value" [attr.aria-current]="activeValue() === item.value ? 'true' : null" [attr.aria-describedby]="item.description ? menuId + '-desc-' + i : null" (click)="select(item)">
360
+ <button type="button" class="dd-item" role="menuitem" tabindex="-1" [disabled]="item.disabled === true" [class.dd-item-active]="activeValue() === item.value" [class.dd-item-danger]="item.danger === true" [attr.aria-current]="activeValue() === item.value ? 'true' : null" [attr.aria-describedby]="item.description ? menuId + '-desc-' + i : null" (click)="select(item)">
361
361
  @if (item.icon) {
362
362
  <svg class="dd-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path [attr.d]="item.icon" /></svg>
363
363
  }
@@ -380,7 +380,7 @@ var DropdownComponent = class DropdownComponent {
380
380
  </div>
381
381
  `,
382
382
  isInline: true,
383
- styles: [":host{display:inline-flex}.dd-wrapper{position:relative;display:inline-flex}:host(.dd-fixed){display:flex;max-width:100%}:host(.dd-fixed) .dd-wrapper{display:flex;flex:1 1 auto;min-width:0}:host(.dd-fixed) .dd-trigger{width:100%;min-width:0;justify-content:space-between}:host(.dd-fixed) .dd-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dd-trigger svg{flex-shrink:0}.dd-trigger{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-family:inherit;transition:all .15s ease}.dd-trigger:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}.dd-trigger-badge{padding:6px 14px;border-radius:999px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#64748b}.dd-trigger-badge:hover{background:#f8fafc;border-color:#94a3b8}.dd-trigger-badge.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn{padding:6px 10px;border-radius:6px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#334155;transition:background .1s,border-color .1s}.dd-trigger-btn:hover{background:#f8fafc}.dd-trigger-btn.dd-open{border-color:#1e293b;background:#f8fafc}.dd-trigger-btn.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn.dd-trigger-md{padding:10px 16px;font-size:.875rem;border-radius:8px}.dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;max-height:70vh;overflow-y:auto;overflow-x:hidden;padding:0;max-width:calc(100vw - 32px);box-sizing:border-box}.dd-menu.dd-menu-end{left:auto;right:0}.dd-menu.dd-menu-up{top:auto;bottom:calc(100% + 6px)}.dd-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 14px;border:none;background:none;font-size:.875rem;font-weight:400;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s;border-bottom:1px solid #f1f5f9;box-sizing:border-box}.dd-item:last-child{border-bottom:none}.dd-item:hover{background:#f8fafc}.dd-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.dd-item.dd-item-active{background:#eff6ff;color:#2563eb}.dd-item:disabled{opacity:.5;cursor:not-allowed;background:none}.dd-icon{flex-shrink:0;color:#64748b}.dd-label{min-width:0}.dd-text-block{display:flex;flex-direction:column;gap:2px;min-width:0}.dd-desc{font-size:.75rem;line-height:1.35;font-weight:400;color:#64748b;white-space:normal;overflow-wrap:anywhere}.dd-item.dd-item-active .dd-desc{color:#475569}@media(forced-colors:active){.dd-desc{color:GrayText}}.dd-count{font-size:.6875rem;font-weight:700;margin-left:auto;background:#f1f5f9;color:#64748b;padding:1px 7px;border-radius:999px;flex-shrink:0}.dd-loading{display:flex;align-items:center;gap:8px;padding:12px;color:#64748b;font-size:.8125rem}.dd-spinner{width:14px;height:14px;border-radius:50%;flex-shrink:0;border:2px solid #e2e8f0;border-top-color:#64748b;animation:dd-spin .6s linear infinite}@keyframes dd-spin{to{transform:rotate(360deg)}}@media(pointer:coarse),(max-width:768px){.dd-trigger-badge,.dd-trigger-btn,.dd-item{min-height:44px}}@media(prefers-reduced-motion:reduce){.dd-spinner{animation-duration:2s}}\n"],
383
+ styles: [":host{display:inline-flex}.dd-wrapper{position:relative;display:inline-flex}:host(.dd-fixed){display:flex;max-width:100%}:host(.dd-fixed) .dd-wrapper{display:flex;flex:1 1 auto;min-width:0}:host(.dd-fixed) .dd-trigger{width:100%;min-width:0;justify-content:space-between}:host(.dd-fixed) .dd-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dd-trigger svg{flex-shrink:0}.dd-trigger{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-family:inherit;transition:all .15s ease}.dd-trigger:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}.dd-trigger-badge{padding:6px 14px;border-radius:999px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#64748b}.dd-trigger-badge:hover{background:#f8fafc;border-color:#94a3b8}.dd-trigger-badge.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn{padding:6px 10px;border-radius:6px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#334155;transition:background .1s,border-color .1s}.dd-trigger-btn:hover{background:#f8fafc}.dd-trigger-btn.dd-open{border-color:#1e293b;background:#f8fafc}.dd-trigger-btn.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn.dd-trigger-md{padding:10px 16px;font-size:.875rem;border-radius:8px}.dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;max-height:70vh;overflow-y:auto;overflow-x:hidden;padding:0;max-width:calc(100vw - 32px);box-sizing:border-box}.dd-menu.dd-menu-end{left:auto;right:0}.dd-menu.dd-menu-up{top:auto;bottom:calc(100% + 6px)}.dd-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 14px;border:none;background:none;font-size:.875rem;font-weight:400;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s;border-bottom:1px solid #f1f5f9;box-sizing:border-box}.dd-item:last-child{border-bottom:none}.dd-item:hover{background:#f8fafc}.dd-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.dd-item.dd-item-active{background:#eff6ff;color:#2563eb}.dd-item.dd-item-danger,.dd-item.dd-item-danger .dd-icon{color:#dc2626}.dd-item.dd-item-danger:hover{background:#fef2f2}.dd-item:disabled{opacity:.5;cursor:not-allowed;background:none}.dd-icon{flex-shrink:0;color:#64748b}.dd-label{min-width:0}.dd-text-block{display:flex;flex-direction:column;gap:2px;min-width:0}.dd-desc{font-size:.75rem;line-height:1.35;font-weight:400;color:#64748b;white-space:normal;overflow-wrap:anywhere}.dd-item.dd-item-active .dd-desc{color:#475569}@media(forced-colors:active){.dd-desc{color:GrayText}}.dd-count{font-size:.6875rem;font-weight:700;margin-left:auto;background:#f1f5f9;color:#64748b;padding:1px 7px;border-radius:999px;flex-shrink:0}.dd-loading{display:flex;align-items:center;gap:8px;padding:12px;color:#64748b;font-size:.8125rem}.dd-spinner{width:14px;height:14px;border-radius:50%;flex-shrink:0;border:2px solid #e2e8f0;border-top-color:#64748b;animation:dd-spin .6s linear infinite}@keyframes dd-spin{to{transform:rotate(360deg)}}@media(pointer:coarse),(max-width:768px){.dd-trigger-badge,.dd-trigger-btn,.dd-item{min-height:44px}}@media(prefers-reduced-motion:reduce){.dd-spinner{animation-duration:2s}}\n"],
384
384
  changeDetection: i0.ChangeDetectionStrategy.OnPush
385
385
  });
386
386
  }
@@ -424,7 +424,7 @@ i0.ɵɵngDeclareClassMetadata({
424
424
  </div>
425
425
  } @else {
426
426
  @for (item of displayItems(); track item.value; let i = $index) {
427
- <button type="button" class="dd-item" role="menuitem" tabindex="-1" [disabled]="item.disabled === true" [class.dd-item-active]="activeValue() === item.value" [attr.aria-current]="activeValue() === item.value ? 'true' : null" [attr.aria-describedby]="item.description ? menuId + '-desc-' + i : null" (click)="select(item)">
427
+ <button type="button" class="dd-item" role="menuitem" tabindex="-1" [disabled]="item.disabled === true" [class.dd-item-active]="activeValue() === item.value" [class.dd-item-danger]="item.danger === true" [attr.aria-current]="activeValue() === item.value ? 'true' : null" [attr.aria-describedby]="item.description ? menuId + '-desc-' + i : null" (click)="select(item)">
428
428
  @if (item.icon) {
429
429
  <svg class="dd-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path [attr.d]="item.icon" /></svg>
430
430
  }
@@ -446,7 +446,7 @@ i0.ɵɵngDeclareClassMetadata({
446
446
  }
447
447
  </div>
448
448
  `,
449
- styles: [":host{display:inline-flex}.dd-wrapper{position:relative;display:inline-flex}:host(.dd-fixed){display:flex;max-width:100%}:host(.dd-fixed) .dd-wrapper{display:flex;flex:1 1 auto;min-width:0}:host(.dd-fixed) .dd-trigger{width:100%;min-width:0;justify-content:space-between}:host(.dd-fixed) .dd-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dd-trigger svg{flex-shrink:0}.dd-trigger{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-family:inherit;transition:all .15s ease}.dd-trigger:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}.dd-trigger-badge{padding:6px 14px;border-radius:999px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#64748b}.dd-trigger-badge:hover{background:#f8fafc;border-color:#94a3b8}.dd-trigger-badge.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn{padding:6px 10px;border-radius:6px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#334155;transition:background .1s,border-color .1s}.dd-trigger-btn:hover{background:#f8fafc}.dd-trigger-btn.dd-open{border-color:#1e293b;background:#f8fafc}.dd-trigger-btn.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn.dd-trigger-md{padding:10px 16px;font-size:.875rem;border-radius:8px}.dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;max-height:70vh;overflow-y:auto;overflow-x:hidden;padding:0;max-width:calc(100vw - 32px);box-sizing:border-box}.dd-menu.dd-menu-end{left:auto;right:0}.dd-menu.dd-menu-up{top:auto;bottom:calc(100% + 6px)}.dd-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 14px;border:none;background:none;font-size:.875rem;font-weight:400;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s;border-bottom:1px solid #f1f5f9;box-sizing:border-box}.dd-item:last-child{border-bottom:none}.dd-item:hover{background:#f8fafc}.dd-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.dd-item.dd-item-active{background:#eff6ff;color:#2563eb}.dd-item:disabled{opacity:.5;cursor:not-allowed;background:none}.dd-icon{flex-shrink:0;color:#64748b}.dd-label{min-width:0}.dd-text-block{display:flex;flex-direction:column;gap:2px;min-width:0}.dd-desc{font-size:.75rem;line-height:1.35;font-weight:400;color:#64748b;white-space:normal;overflow-wrap:anywhere}.dd-item.dd-item-active .dd-desc{color:#475569}@media(forced-colors:active){.dd-desc{color:GrayText}}.dd-count{font-size:.6875rem;font-weight:700;margin-left:auto;background:#f1f5f9;color:#64748b;padding:1px 7px;border-radius:999px;flex-shrink:0}.dd-loading{display:flex;align-items:center;gap:8px;padding:12px;color:#64748b;font-size:.8125rem}.dd-spinner{width:14px;height:14px;border-radius:50%;flex-shrink:0;border:2px solid #e2e8f0;border-top-color:#64748b;animation:dd-spin .6s linear infinite}@keyframes dd-spin{to{transform:rotate(360deg)}}@media(pointer:coarse),(max-width:768px){.dd-trigger-badge,.dd-trigger-btn,.dd-item{min-height:44px}}@media(prefers-reduced-motion:reduce){.dd-spinner{animation-duration:2s}}\n"]
449
+ styles: [":host{display:inline-flex}.dd-wrapper{position:relative;display:inline-flex}:host(.dd-fixed){display:flex;max-width:100%}:host(.dd-fixed) .dd-wrapper{display:flex;flex:1 1 auto;min-width:0}:host(.dd-fixed) .dd-trigger{width:100%;min-width:0;justify-content:space-between}:host(.dd-fixed) .dd-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dd-trigger svg{flex-shrink:0}.dd-trigger{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-family:inherit;transition:all .15s ease}.dd-trigger:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}.dd-trigger-badge{padding:6px 14px;border-radius:999px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#64748b}.dd-trigger-badge:hover{background:#f8fafc;border-color:#94a3b8}.dd-trigger-badge.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn{padding:6px 10px;border-radius:6px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;font-weight:500;color:#334155;transition:background .1s,border-color .1s}.dd-trigger-btn:hover{background:#f8fafc}.dd-trigger-btn.dd-open{border-color:#1e293b;background:#f8fafc}.dd-trigger-btn.dd-active{background:#1e293b;color:#fff;border-color:#1e293b}.dd-trigger-btn.dd-trigger-md{padding:10px 16px;font-size:.875rem;border-radius:8px}.dd-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;max-height:70vh;overflow-y:auto;overflow-x:hidden;padding:0;max-width:calc(100vw - 32px);box-sizing:border-box}.dd-menu.dd-menu-end{left:auto;right:0}.dd-menu.dd-menu-up{top:auto;bottom:calc(100% + 6px)}.dd-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 14px;border:none;background:none;font-size:.875rem;font-weight:400;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s;border-bottom:1px solid #f1f5f9;box-sizing:border-box}.dd-item:last-child{border-bottom:none}.dd-item:hover{background:#f8fafc}.dd-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.dd-item.dd-item-active{background:#eff6ff;color:#2563eb}.dd-item.dd-item-danger,.dd-item.dd-item-danger .dd-icon{color:#dc2626}.dd-item.dd-item-danger:hover{background:#fef2f2}.dd-item:disabled{opacity:.5;cursor:not-allowed;background:none}.dd-icon{flex-shrink:0;color:#64748b}.dd-label{min-width:0}.dd-text-block{display:flex;flex-direction:column;gap:2px;min-width:0}.dd-desc{font-size:.75rem;line-height:1.35;font-weight:400;color:#64748b;white-space:normal;overflow-wrap:anywhere}.dd-item.dd-item-active .dd-desc{color:#475569}@media(forced-colors:active){.dd-desc{color:GrayText}}.dd-count{font-size:.6875rem;font-weight:700;margin-left:auto;background:#f1f5f9;color:#64748b;padding:1px 7px;border-radius:999px;flex-shrink:0}.dd-loading{display:flex;align-items:center;gap:8px;padding:12px;color:#64748b;font-size:.8125rem}.dd-spinner{width:14px;height:14px;border-radius:50%;flex-shrink:0;border:2px solid #e2e8f0;border-top-color:#64748b;animation:dd-spin .6s linear infinite}@keyframes dd-spin{to{transform:rotate(360deg)}}@media(pointer:coarse),(max-width:768px){.dd-trigger-badge,.dd-trigger-btn,.dd-item{min-height:44px}}@media(prefers-reduced-motion:reduce){.dd-spinner{animation-duration:2s}}\n"]
450
450
  }]
451
451
  }],
452
452
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-dropdown.mjs","names":[],"sources":["../../../projects/forgeroute-ui/dropdown/src/lib/dropdown/dropdown.component.ts"],"sourcesContent":["import { Component, input, output, signal, computed, effect, untracked, inject, ElementRef, ChangeDetectorRef, DestroyRef, Injector, afterNextRender, ChangeDetectionStrategy } from '@angular/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n// Shared across all instances — tracks which dropdown is currently open so\n// opening one automatically closes any other that is open.\nconst _activeDropdownId = signal('');\n\nexport interface DropdownItem {\n label: string;\n value: string;\n count?: number;\n /** Greyed-out, not selectable and skipped by keyboard navigation. */\n disabled?: boolean;\n /** Optional 14px icon before the label: an SVG path (the `d` value, like a toolbar action's `icon`). Decorative (hidden from assistive tech). */\n icon?: string;\n /** Optional smaller, muted second line under the label (e.g. what the choice does). Read by assistive technology as the item's description, not as part of its name. Plain text. */\n description?: string;\n}\n\n/** Which edge of the trigger the menu lines up with: `auto` (default) opens from the trigger's left edge and switches to its right edge when the menu would run off the right of the screen. */\nexport type DropdownAlign = 'auto' | 'start' | 'end';\n\n@Component({\n selector: 'ui-dropdown',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:click)': 'close()',\n // Escape closes the open menu (focus goes back to the trigger). The event is only stopped when the\n // menu was open, so an Escape with the menu closed still reaches a surrounding side panel / modal.\n '(keydown.escape)': 'onEscape($event)',\n // `width` set: the host takes that width (never wider than its container) and the trigger fills it.\n '[class.dd-fixed]': \"width() !== ''\",\n '[style.width]': \"width() || null\",\n },\n template: `\n <div class=\"dd-wrapper\">\n @if (variant() === 'badge') {\n <button type=\"button\" class=\"dd-trigger dd-trigger-badge\" [class.dd-active]=\"active()\" [class.dd-open]=\"open()\" [attr.id]=\"triggerId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-expanded]=\"open()\" aria-haspopup=\"menu\" [attr.aria-controls]=\"open() ? menuId : null\" (click)=\"toggle($event)\" (keydown)=\"onTriggerKeydown($event)\" (keyup)=\"onTriggerKeyup($event)\">\n <span class=\"dd-text\">{{ label() }}</span>\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n } @else {\n <button type=\"button\" class=\"dd-trigger dd-trigger-btn\" [class.dd-trigger-md]=\"size() === 'md'\" [class.dd-active]=\"active()\" [class.dd-open]=\"open()\" [attr.id]=\"triggerId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-expanded]=\"open()\" aria-haspopup=\"menu\" [attr.aria-controls]=\"open() ? menuId : null\" (click)=\"toggle($event)\" (keydown)=\"onTriggerKeydown($event)\" (keyup)=\"onTriggerKeyup($event)\">\n <span class=\"dd-text\">{{ label() }}</span>\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n }\n @if (open()) {\n <div class=\"dd-menu\" role=\"menu\" [attr.id]=\"menuId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-labelledby]=\"_ariaLabel() ? null : triggerId\" [style.min-width]=\"menuWidth()\" [class.dd-menu-end]=\"alignEnd()\" [class.dd-menu-up]=\"openUp()\" [style.max-height.px]=\"menuMaxHeight()\" [attr.aria-busy]=\"loading() ? 'true' : null\" (click)=\"$event.stopPropagation()\" (keydown)=\"onMenuKeydown($event)\">\n @if (loading()) {\n <div class=\"dd-loading\">\n <span class=\"dd-spinner\"></span>\n <span>{{ labels.t('common.loadingellipsis') }}</span>\n </div>\n } @else {\n @for (item of displayItems(); track item.value; let i = $index) {\n <button type=\"button\" class=\"dd-item\" role=\"menuitem\" tabindex=\"-1\" [disabled]=\"item.disabled === true\" [class.dd-item-active]=\"activeValue() === item.value\" [attr.aria-current]=\"activeValue() === item.value ? 'true' : null\" [attr.aria-describedby]=\"item.description ? menuId + '-desc-' + i : null\" (click)=\"select(item)\">\n @if (item.icon) {\n <svg class=\"dd-icon\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path [attr.d]=\"item.icon\" /></svg>\n }\n @if (item.description) {\n <span class=\"dd-text-block\">\n <span class=\"dd-label\">{{ item.label }}</span>\n <span class=\"dd-desc\" [attr.id]=\"menuId + '-desc-' + i\">{{ item.description }}</span>\n </span>\n } @else {\n <span class=\"dd-label\">{{ item.label }}</span>\n }\n @if (item.count !== undefined) {\n <span class=\"dd-count\">{{ item.count }}</span>\n }\n </button>\n }\n }\n </div>\n }\n </div>\n `,\n styles: [`\n :host { display: inline-flex; }\n\n .dd-wrapper { position: relative; display: inline-flex; }\n\n /* Fixed width (the \\`width\\` input): one width whatever the selected label, the trigger fills it. */\n :host(.dd-fixed) { display: flex; max-width: 100%; }\n :host(.dd-fixed) .dd-wrapper { display: flex; flex: 1 1 auto; min-width: 0; }\n :host(.dd-fixed) .dd-trigger { width: 100%; min-width: 0; justify-content: space-between; }\n /* A label longer than the fixed width is cut with an ellipsis on one line; the chevron is never squeezed. */\n :host(.dd-fixed) .dd-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .dd-trigger svg { flex-shrink: 0; }\n\n .dd-trigger {\n display: inline-flex; align-items: center; gap: 6px;\n cursor: pointer; font-family: inherit; transition: all 150ms ease;\n &:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }\n }\n\n .dd-trigger-badge {\n padding: 6px 14px; border-radius: 999px; border: 1px solid #e2e8f0;\n background: #fff; font-size: 0.8125rem; font-weight: 500; color: #64748b;\n &:hover { background: #f8fafc; border-color: #94a3b8; }\n &.dd-active { background: #1e293b; color: #fff; border-color: #1e293b; }\n }\n\n /* Same look as the data-table's More Actions button and menu. */\n .dd-trigger-btn {\n padding: 6px 10px; border-radius: 6px; border: 1px solid #e2e8f0;\n background: #fff; font-size: 0.8125rem; font-weight: 500; color: #334155;\n transition: background 0.1s, border-color 0.1s;\n &:hover { background: #f8fafc; }\n &.dd-open { border-color: #1e293b; background: #f8fafc; }\n &.dd-active { background: #1e293b; color: #fff; border-color: #1e293b; }\n }\n\n /* size=\"md\": the same height and type as a medium ui-button, so the two sit side by side in a toolbar or page header. */\n .dd-trigger-btn.dd-trigger-md { padding: 10px 16px; font-size: 0.875rem; border-radius: 8px; }\n\n .dd-menu {\n position: absolute; top: calc(100% + 6px); left: 0; z-index: 9999;\n background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;\n box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 12px 28px rgba(0,0,0,0.10);\n max-height: 70vh; overflow-y: auto; overflow-x: hidden; padding: 0;\n max-width: calc(100vw - 32px); box-sizing: border-box;\n }\n /* Opens toward the trigger's right edge / above the trigger when there is no room the default way (set from the measured position). */\n .dd-menu.dd-menu-end { left: auto; right: 0; }\n .dd-menu.dd-menu-up { top: auto; bottom: calc(100% + 6px); }\n\n .dd-item {\n display: flex; align-items: center; gap: 10px;\n width: 100%; padding: 10px 14px; border: none; background: none;\n font-size: 0.875rem; font-weight: 400; color: #1e293b; cursor: pointer;\n font-family: inherit; text-align: left; transition: background 0.1s;\n border-bottom: 1px solid #f1f5f9; box-sizing: border-box;\n &:last-child { border-bottom: none; }\n &:hover { background: #f8fafc; }\n &:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }\n &.dd-item-active { background: #eff6ff; color: #2563eb; }\n &:disabled { opacity: 0.5; cursor: not-allowed; background: none; }\n }\n .dd-icon { flex-shrink: 0; color: #64748b; }\n .dd-label { min-width: 0; }\n /* An item with a description: the name on top, the description under it in smaller, muted type (wraps instead of widening the menu). */\n .dd-text-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n .dd-desc { font-size: 0.75rem; line-height: 1.35; font-weight: 400; color: #64748b; white-space: normal; overflow-wrap: anywhere; }\n .dd-item.dd-item-active .dd-desc { color: #475569; }\n @media (forced-colors: active) { .dd-desc { color: GrayText; } }\n\n .dd-count {\n font-size: 0.6875rem; font-weight: 700; margin-left: auto;\n background: #f1f5f9; color: #64748b;\n padding: 1px 7px; border-radius: 999px; flex-shrink: 0;\n }\n\n .dd-loading {\n display: flex; align-items: center; gap: 8px;\n padding: 12px; color: #64748b; font-size: 0.8125rem;\n }\n .dd-spinner {\n width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;\n border: 2px solid #e2e8f0; border-top-color: #64748b;\n animation: dd-spin 0.6s linear infinite;\n }\n @keyframes dd-spin { to { transform: rotate(360deg); } }\n\n /* Touch targets: 44px on touch screens and phones. */\n @media (pointer: coarse), (max-width: 768px) {\n .dd-trigger-badge, .dd-trigger-btn { min-height: 44px; }\n .dd-item { min-height: 44px; }\n }\n\n /* Reduced motion: no entrance / shimmer animation (a loading spinner stays, slower). */\n @media (prefers-reduced-motion: reduce) {\n .dd-spinner { animation-duration: 2s; } /* a loading indicator stays, but turns slowly */\n }\n `],\n})\nexport class DropdownComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n readonly items = input<DropdownItem[]>([]);\n /** Optional async loader — called once on open, result cached until closed. */\n readonly loader = input<(() => Promise<DropdownItem[]>) | null>(null);\n readonly active = input(false);\n readonly activeValue = input('');\n readonly variant = input<'button' | 'badge'>('button');\n /** Trigger size for `variant=\"button\"`: `sm` (default, the compact toolbar look) or `md` (same padding and type as a medium `ui-button`). */\n readonly size = input<'sm' | 'md'>('sm');\n readonly menuWidth = input('200px');\n /**\n * Fixed width of the trigger as a CSS length (e.g. `'280px'`). Empty (default) = the trigger is as wide as its label. When set, the trigger keeps that\n * width whatever label is selected (never wider than its container) and its label and chevron sit at the two ends.\n */\n readonly width = input('');\n /**\n * Accessible name. Set it when the trigger has no meaningful visible text. Applied as `aria-label` on the\n * trigger and on the menu; when empty (default) no `aria-label` is rendered, the trigger is named by its\n * visible label and the menu by `aria-labelledby` pointing at the trigger. Surrounding whitespace is trimmed.\n */\n readonly ariaLabel = input('');\n\n readonly itemClick = output<DropdownItem>();\n /** Which edge of the trigger the menu lines up with (default `auto`: from the left edge, switching to the right edge when it would run off the screen). */\n readonly align = input<DropdownAlign>('auto');\n\n protected readonly open = signal(false);\n protected readonly loading = signal(false);\n /** Placement measured when the menu opens: right-aligned, above the trigger, and the height left on that side (the menu scrolls inside it). */\n protected readonly alignEnd = signal(false);\n protected readonly openUp = signal(false);\n protected readonly menuMaxHeight = signal<number | null>(null);\n private readonly _loaded = signal<DropdownItem[] | null>(null);\n private readonly _id = Math.random().toString(36).slice(2);\n private readonly _host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly _cdr = inject(ChangeDetectorRef);\n private readonly _injector = inject(Injector);\n private _pendingFocus: 'first' | 'last' | null = null;\n private _typeahead = '';\n private _typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n private _destroyed = false;\n /** Identifies the current loader request, so a late or stale answer (menu closed / reopened meanwhile) is ignored. */\n private _loadToken = 0;\n\n protected readonly triggerId = `ui-dd-trigger-${this._id}`;\n protected readonly menuId = `ui-dd-menu-${this._id}`;\n protected readonly _ariaLabel = computed(() => this.ariaLabel().trim() || null);\n\n protected readonly displayItems = computed<DropdownItem[]>(() =>\n this.open() ? (this._loaded() ?? this.items()) : []\n );\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this._destroyed = true;\n if (this._typeaheadTimer) clearTimeout(this._typeaheadTimer);\n if (_activeDropdownId() === this._id) _activeDropdownId.set('');\n });\n effect(() => {\n if (_activeDropdownId() !== this._id) {\n untracked(() => this.close()); // full close: also resets pending focus, typeahead and placement\n }\n });\n\n effect(() => {\n const isOpen = this.open();\n const loader = this.loader();\n if (!loader) return;\n if (isOpen && untracked(() => this._loaded()) === null) {\n const token = ++this._loadToken;\n this.loading.set(true);\n // A loader that throws or rejects shows an empty menu (never an endless \"Loading...\").\n const done = (items: DropdownItem[]) => {\n if (this._destroyed || token !== this._loadToken) return; // closed / reopened meanwhile: stale answer\n this._loaded.set(items);\n this.loading.set(false);\n if (this.open()) {\n afterNextRender(() => this._place(), { injector: this._injector }); // the real item list is taller than the \"Loading...\" row\n if (this._pendingFocus) this._focusPending();\n }\n };\n new Promise<DropdownItem[]>(resolve => resolve(loader())).then(done, () => done([]));\n } else if (!isOpen) {\n this._loadToken++;\n this.loading.set(false);\n this._loaded.set(null);\n }\n });\n }\n\n toggle(event: Event) {\n event.stopPropagation();\n this._setOpen(!this.open());\n // Safari / Firefox on macOS do not focus a button on click: focus the trigger so Escape and the arrow keys reach the dropdown.\n this._focusTrigger();\n }\n\n select(item: DropdownItem) {\n if (item.disabled) return;\n this._setOpen(false);\n this.itemClick.emit(item);\n this._focusTrigger();\n }\n\n close() {\n if (this.open()) this._setOpen(false);\n }\n\n /**\n * Keyboard contract (WAI-ARIA menu button).\n * Trigger: Enter / Space toggle (opening focuses the first item), ArrowDown opens + first item,\n * ArrowUp opens + last item, ArrowDown/ArrowUp while open move into the menu, Tab closes (focus moves on naturally).\n */\n protected onTriggerKeydown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey || event.altKey) return;\n switch (event.key) {\n case 'Enter':\n case ' ':\n event.preventDefault(); // no native click: we open + focus ourselves\n if (this.open()) this._setOpen(false);\n else this._openAndFocus('first');\n break;\n case 'ArrowDown':\n event.preventDefault();\n if (this.open()) { this._pendingFocus = 'first'; this._focusPending(); }\n else this._openAndFocus('first');\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.open()) { this._pendingFocus = 'last'; this._focusPending(); }\n else this._openAndFocus('last');\n break;\n case 'Tab':\n this.close();\n break;\n }\n }\n\n /** Firefox fires the button click on Space keyup even when keydown was prevented. */\n protected onTriggerKeyup(event: KeyboardEvent) {\n if (event.key === ' ') event.preventDefault();\n }\n\n /**\n * Menu keys (focus on an item): ArrowDown / ArrowUp move with wrap, Home / End jump to first / last,\n * Enter / Space activate the focused item (native button click), Tab / Shift+Tab close and let focus move on from the trigger,\n * printable characters jump to the next item whose label starts with the typed text (typeahead, reset after 500 ms).\n * Disabled items are skipped. Other keys are ignored. Escape is handled on the host.\n */\n protected onMenuKeydown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey || event.altKey) return;\n const items = this._enabledItems();\n const current = items.indexOf(document.activeElement as HTMLElement);\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (items.length) items[current < 0 ? 0 : (current + 1) % items.length].focus();\n return;\n case 'ArrowUp':\n event.preventDefault();\n if (items.length) items[current <= 0 ? items.length - 1 : current - 1].focus();\n return;\n case 'Home':\n event.preventDefault();\n items[0]?.focus();\n return;\n case 'End':\n event.preventDefault();\n items[items.length - 1]?.focus();\n return;\n case 'Tab':\n // Park focus on the trigger first: the menu is removed from the DOM, so the browser's Tab\n // then continues from the trigger (next / previous control) instead of from <body>.\n this._focusTrigger();\n this.close();\n return;\n }\n if (event.key.length === 1 && (event.key !== ' ' || this._typeahead)) {\n event.preventDefault();\n this._typeaheadFocus(event.key.toLowerCase(), items, current);\n }\n }\n\n protected onEscape(event: Event) {\n if (!this.open()) return; // closed: let a surrounding panel / modal handle Escape\n event.stopPropagation();\n this._setOpen(false);\n this._focusTrigger();\n }\n\n private _setOpen(next: boolean) {\n if (this.open() === next) return;\n this.open.set(next);\n if (next) {\n _activeDropdownId.set(this._id);\n afterNextRender(() => this._place(), { injector: this._injector });\n }\n else {\n this._pendingFocus = null;\n this._typeahead = '';\n if (_activeDropdownId() === this._id) _activeDropdownId.set('');\n this.alignEnd.set(false); this.openUp.set(false); this.menuMaxHeight.set(null);\n }\n }\n\n /**\n * Places the open menu from its measured size and the trigger's screen position: it keeps 16px clear of the screen edges, lines up with the trigger's\n * right edge instead of the left when that is the side with room (`align` = auto), opens above the trigger when there is more room there, and is capped to\n * the room left on that side (so it scrolls inside only when it truly does not fit). No layout APIs (server rendering) = the default placement.\n */\n private _place() {\n const host = this._host.nativeElement;\n const trigger = host.querySelector('.dd-trigger') as HTMLElement | null;\n const menu = host.querySelector('.dd-menu') as HTMLElement | null;\n if (!trigger || !menu || typeof window === 'undefined') return;\n const MARGIN = 16, GAP = 6;\n // Measure in the default placement\n this.alignEnd.set(false); this.openUp.set(false); this.menuMaxHeight.set(null);\n this._cdr.detectChanges();\n const t = trigger.getBoundingClientRect();\n const vw = document.documentElement.clientWidth || window.innerWidth;\n const vh = window.innerHeight;\n const width = menu.offsetWidth;\n const naturalHeight = menu.scrollHeight + 2;\n const mode = this.align();\n const fitsStart = t.left + width <= vw - MARGIN;\n const fitsEnd = t.right - width >= MARGIN;\n const end = mode === 'end' || (mode === 'auto' && !fitsStart && (fitsEnd || t.right > vw / 2));\n const below = vh - t.bottom - GAP - MARGIN;\n const above = t.top - GAP - MARGIN;\n const up = naturalHeight > below && above > below;\n this.alignEnd.set(end);\n this.openUp.set(up);\n this.menuMaxHeight.set(Math.max(160, Math.floor(up ? above : below)));\n this._cdr.markForCheck();\n }\n\n private _openAndFocus(which: 'first' | 'last') {\n this._pendingFocus = which;\n this._setOpen(true);\n this._focusPending();\n }\n\n /** Renders the menu synchronously, then focuses the pending first / last enabled item. */\n private _focusPending() {\n this._cdr.detectChanges();\n // a loader is pending (or about to start: its effect has not run yet): the focus is applied when it resolves\n if (this.loading() || (this.loader() !== null && this._loaded() === null)) return;\n const items = this._enabledItems();\n const target = this._pendingFocus === 'last' ? items[items.length - 1] : items[0];\n this._pendingFocus = null;\n target?.focus();\n }\n\n private _typeaheadFocus(char: string, items: HTMLElement[], current: number) {\n this._typeahead += char;\n if (this._typeaheadTimer) clearTimeout(this._typeaheadTimer);\n this._typeaheadTimer = setTimeout(() => { this._typeahead = ''; this._typeaheadTimer = null; }, 500);\n const single = this._typeahead.length === 1 || [...this._typeahead].every(c => c === this._typeahead[0]);\n const needle = single ? this._typeahead[0] : this._typeahead;\n const start = single ? current + 1 : Math.max(current, 0);\n for (let i = 0; i < items.length; i++) {\n const el = items[(start + i) % items.length];\n const text = (el.querySelector('span')?.textContent ?? '').trim().toLowerCase();\n if (text.startsWith(needle)) { el.focus(); return; }\n }\n }\n\n private _enabledItems(): HTMLElement[] {\n return Array.from(this._host.nativeElement.querySelectorAll<HTMLElement>('.dd-menu .dd-item:not(:disabled)'));\n }\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AAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,OAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,WAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,OAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA,EAAA,WAAA,YAAA;GAAA,MAAA;IAAA,WAAA;KAAA,kBAAA;KAAA,kBAAA;IAAA;IAAA,YAAA;KAAA,kBAAA;KAAA,eAAA;IAAA;GAAA;GAAA,UAAA;GAAA,UA/IlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CT,UAAA;GAAA,QAAA,CAAA,2pGAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAoGU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EA5J7B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,YACX;GAAI,iBACC,wBAAwB;GAAM,MACzC;IACJ,oBAAoB;IAGpB,oBAAoB;IAEpB,oBAAoB;IACpB,iBAAiB;GAClB;GAAA,UACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CT,QAAA,CAAA,2pGAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-dropdown.mjs","names":[],"sources":["../../../projects/forgeroute-ui/dropdown/src/lib/dropdown/dropdown.component.ts"],"sourcesContent":["import { Component, input, output, signal, computed, effect, untracked, inject, ElementRef, ChangeDetectorRef, DestroyRef, Injector, afterNextRender, ChangeDetectionStrategy } from '@angular/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n// Shared across all instances — tracks which dropdown is currently open so\n// opening one automatically closes any other that is open.\nconst _activeDropdownId = signal('');\n\nexport interface DropdownItem {\n label: string;\n value: string;\n count?: number;\n /** Greyed-out, not selectable and skipped by keyboard navigation. */\n disabled?: boolean;\n /** Destructive choice (e.g. Delete): the label and icon are drawn in red. */\n danger?: boolean;\n /** Optional 14px icon before the label: an SVG path (the `d` value, like a toolbar action's `icon`). Decorative (hidden from assistive tech). */\n icon?: string;\n /** Optional smaller, muted second line under the label (e.g. what the choice does). Read by assistive technology as the item's description, not as part of its name. Plain text. */\n description?: string;\n}\n\n/** Which edge of the trigger the menu lines up with: `auto` (default) opens from the trigger's left edge and switches to its right edge when the menu would run off the right of the screen. */\nexport type DropdownAlign = 'auto' | 'start' | 'end';\n\n@Component({\n selector: 'ui-dropdown',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:click)': 'close()',\n // Escape closes the open menu (focus goes back to the trigger). The event is only stopped when the\n // menu was open, so an Escape with the menu closed still reaches a surrounding side panel / modal.\n '(keydown.escape)': 'onEscape($event)',\n // `width` set: the host takes that width (never wider than its container) and the trigger fills it.\n '[class.dd-fixed]': \"width() !== ''\",\n '[style.width]': \"width() || null\",\n },\n template: `\n <div class=\"dd-wrapper\">\n @if (variant() === 'badge') {\n <button type=\"button\" class=\"dd-trigger dd-trigger-badge\" [class.dd-active]=\"active()\" [class.dd-open]=\"open()\" [attr.id]=\"triggerId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-expanded]=\"open()\" aria-haspopup=\"menu\" [attr.aria-controls]=\"open() ? menuId : null\" (click)=\"toggle($event)\" (keydown)=\"onTriggerKeydown($event)\" (keyup)=\"onTriggerKeyup($event)\">\n <span class=\"dd-text\">{{ label() }}</span>\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n } @else {\n <button type=\"button\" class=\"dd-trigger dd-trigger-btn\" [class.dd-trigger-md]=\"size() === 'md'\" [class.dd-active]=\"active()\" [class.dd-open]=\"open()\" [attr.id]=\"triggerId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-expanded]=\"open()\" aria-haspopup=\"menu\" [attr.aria-controls]=\"open() ? menuId : null\" (click)=\"toggle($event)\" (keydown)=\"onTriggerKeydown($event)\" (keyup)=\"onTriggerKeyup($event)\">\n <span class=\"dd-text\">{{ label() }}</span>\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n }\n @if (open()) {\n <div class=\"dd-menu\" role=\"menu\" [attr.id]=\"menuId\" [attr.aria-label]=\"_ariaLabel()\" [attr.aria-labelledby]=\"_ariaLabel() ? null : triggerId\" [style.min-width]=\"menuWidth()\" [class.dd-menu-end]=\"alignEnd()\" [class.dd-menu-up]=\"openUp()\" [style.max-height.px]=\"menuMaxHeight()\" [attr.aria-busy]=\"loading() ? 'true' : null\" (click)=\"$event.stopPropagation()\" (keydown)=\"onMenuKeydown($event)\">\n @if (loading()) {\n <div class=\"dd-loading\">\n <span class=\"dd-spinner\"></span>\n <span>{{ labels.t('common.loadingellipsis') }}</span>\n </div>\n } @else {\n @for (item of displayItems(); track item.value; let i = $index) {\n <button type=\"button\" class=\"dd-item\" role=\"menuitem\" tabindex=\"-1\" [disabled]=\"item.disabled === true\" [class.dd-item-active]=\"activeValue() === item.value\" [class.dd-item-danger]=\"item.danger === true\" [attr.aria-current]=\"activeValue() === item.value ? 'true' : null\" [attr.aria-describedby]=\"item.description ? menuId + '-desc-' + i : null\" (click)=\"select(item)\">\n @if (item.icon) {\n <svg class=\"dd-icon\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path [attr.d]=\"item.icon\" /></svg>\n }\n @if (item.description) {\n <span class=\"dd-text-block\">\n <span class=\"dd-label\">{{ item.label }}</span>\n <span class=\"dd-desc\" [attr.id]=\"menuId + '-desc-' + i\">{{ item.description }}</span>\n </span>\n } @else {\n <span class=\"dd-label\">{{ item.label }}</span>\n }\n @if (item.count !== undefined) {\n <span class=\"dd-count\">{{ item.count }}</span>\n }\n </button>\n }\n }\n </div>\n }\n </div>\n `,\n styles: [`\n :host { display: inline-flex; }\n\n .dd-wrapper { position: relative; display: inline-flex; }\n\n /* Fixed width (the \\`width\\` input): one width whatever the selected label, the trigger fills it. */\n :host(.dd-fixed) { display: flex; max-width: 100%; }\n :host(.dd-fixed) .dd-wrapper { display: flex; flex: 1 1 auto; min-width: 0; }\n :host(.dd-fixed) .dd-trigger { width: 100%; min-width: 0; justify-content: space-between; }\n /* A label longer than the fixed width is cut with an ellipsis on one line; the chevron is never squeezed. */\n :host(.dd-fixed) .dd-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .dd-trigger svg { flex-shrink: 0; }\n\n .dd-trigger {\n display: inline-flex; align-items: center; gap: 6px;\n cursor: pointer; font-family: inherit; transition: all 150ms ease;\n &:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }\n }\n\n .dd-trigger-badge {\n padding: 6px 14px; border-radius: 999px; border: 1px solid #e2e8f0;\n background: #fff; font-size: 0.8125rem; font-weight: 500; color: #64748b;\n &:hover { background: #f8fafc; border-color: #94a3b8; }\n &.dd-active { background: #1e293b; color: #fff; border-color: #1e293b; }\n }\n\n /* Same look as the data-table's More Actions button and menu. */\n .dd-trigger-btn {\n padding: 6px 10px; border-radius: 6px; border: 1px solid #e2e8f0;\n background: #fff; font-size: 0.8125rem; font-weight: 500; color: #334155;\n transition: background 0.1s, border-color 0.1s;\n &:hover { background: #f8fafc; }\n &.dd-open { border-color: #1e293b; background: #f8fafc; }\n &.dd-active { background: #1e293b; color: #fff; border-color: #1e293b; }\n }\n\n /* size=\"md\": the same height and type as a medium ui-button, so the two sit side by side in a toolbar or page header. */\n .dd-trigger-btn.dd-trigger-md { padding: 10px 16px; font-size: 0.875rem; border-radius: 8px; }\n\n .dd-menu {\n position: absolute; top: calc(100% + 6px); left: 0; z-index: 9999;\n background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;\n box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 12px 28px rgba(0,0,0,0.10);\n max-height: 70vh; overflow-y: auto; overflow-x: hidden; padding: 0;\n max-width: calc(100vw - 32px); box-sizing: border-box;\n }\n /* Opens toward the trigger's right edge / above the trigger when there is no room the default way (set from the measured position). */\n .dd-menu.dd-menu-end { left: auto; right: 0; }\n .dd-menu.dd-menu-up { top: auto; bottom: calc(100% + 6px); }\n\n .dd-item {\n display: flex; align-items: center; gap: 10px;\n width: 100%; padding: 10px 14px; border: none; background: none;\n font-size: 0.875rem; font-weight: 400; color: #1e293b; cursor: pointer;\n font-family: inherit; text-align: left; transition: background 0.1s;\n border-bottom: 1px solid #f1f5f9; box-sizing: border-box;\n &:last-child { border-bottom: none; }\n &:hover { background: #f8fafc; }\n &:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }\n &.dd-item-active { background: #eff6ff; color: #2563eb; }\n &.dd-item-danger { color: #dc2626; .dd-icon { color: #dc2626; } &:hover { background: #fef2f2; } }\n &:disabled { opacity: 0.5; cursor: not-allowed; background: none; }\n }\n .dd-icon { flex-shrink: 0; color: #64748b; }\n .dd-label { min-width: 0; }\n /* An item with a description: the name on top, the description under it in smaller, muted type (wraps instead of widening the menu). */\n .dd-text-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n .dd-desc { font-size: 0.75rem; line-height: 1.35; font-weight: 400; color: #64748b; white-space: normal; overflow-wrap: anywhere; }\n .dd-item.dd-item-active .dd-desc { color: #475569; }\n @media (forced-colors: active) { .dd-desc { color: GrayText; } }\n\n .dd-count {\n font-size: 0.6875rem; font-weight: 700; margin-left: auto;\n background: #f1f5f9; color: #64748b;\n padding: 1px 7px; border-radius: 999px; flex-shrink: 0;\n }\n\n .dd-loading {\n display: flex; align-items: center; gap: 8px;\n padding: 12px; color: #64748b; font-size: 0.8125rem;\n }\n .dd-spinner {\n width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;\n border: 2px solid #e2e8f0; border-top-color: #64748b;\n animation: dd-spin 0.6s linear infinite;\n }\n @keyframes dd-spin { to { transform: rotate(360deg); } }\n\n /* Touch targets: 44px on touch screens and phones. */\n @media (pointer: coarse), (max-width: 768px) {\n .dd-trigger-badge, .dd-trigger-btn { min-height: 44px; }\n .dd-item { min-height: 44px; }\n }\n\n /* Reduced motion: no entrance / shimmer animation (a loading spinner stays, slower). */\n @media (prefers-reduced-motion: reduce) {\n .dd-spinner { animation-duration: 2s; } /* a loading indicator stays, but turns slowly */\n }\n `],\n})\nexport class DropdownComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n readonly items = input<DropdownItem[]>([]);\n /** Optional async loader — called once on open, result cached until closed. */\n readonly loader = input<(() => Promise<DropdownItem[]>) | null>(null);\n readonly active = input(false);\n readonly activeValue = input('');\n readonly variant = input<'button' | 'badge'>('button');\n /** Trigger size for `variant=\"button\"`: `sm` (default, the compact toolbar look) or `md` (same padding and type as a medium `ui-button`). */\n readonly size = input<'sm' | 'md'>('sm');\n readonly menuWidth = input('200px');\n /**\n * Fixed width of the trigger as a CSS length (e.g. `'280px'`). Empty (default) = the trigger is as wide as its label. When set, the trigger keeps that\n * width whatever label is selected (never wider than its container) and its label and chevron sit at the two ends.\n */\n readonly width = input('');\n /**\n * Accessible name. Set it when the trigger has no meaningful visible text. Applied as `aria-label` on the\n * trigger and on the menu; when empty (default) no `aria-label` is rendered, the trigger is named by its\n * visible label and the menu by `aria-labelledby` pointing at the trigger. Surrounding whitespace is trimmed.\n */\n readonly ariaLabel = input('');\n\n readonly itemClick = output<DropdownItem>();\n /** Which edge of the trigger the menu lines up with (default `auto`: from the left edge, switching to the right edge when it would run off the screen). */\n readonly align = input<DropdownAlign>('auto');\n\n protected readonly open = signal(false);\n protected readonly loading = signal(false);\n /** Placement measured when the menu opens: right-aligned, above the trigger, and the height left on that side (the menu scrolls inside it). */\n protected readonly alignEnd = signal(false);\n protected readonly openUp = signal(false);\n protected readonly menuMaxHeight = signal<number | null>(null);\n private readonly _loaded = signal<DropdownItem[] | null>(null);\n private readonly _id = Math.random().toString(36).slice(2);\n private readonly _host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly _cdr = inject(ChangeDetectorRef);\n private readonly _injector = inject(Injector);\n private _pendingFocus: 'first' | 'last' | null = null;\n private _typeahead = '';\n private _typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n private _destroyed = false;\n /** Identifies the current loader request, so a late or stale answer (menu closed / reopened meanwhile) is ignored. */\n private _loadToken = 0;\n\n protected readonly triggerId = `ui-dd-trigger-${this._id}`;\n protected readonly menuId = `ui-dd-menu-${this._id}`;\n protected readonly _ariaLabel = computed(() => this.ariaLabel().trim() || null);\n\n protected readonly displayItems = computed<DropdownItem[]>(() =>\n this.open() ? (this._loaded() ?? this.items()) : []\n );\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this._destroyed = true;\n if (this._typeaheadTimer) clearTimeout(this._typeaheadTimer);\n if (_activeDropdownId() === this._id) _activeDropdownId.set('');\n });\n effect(() => {\n if (_activeDropdownId() !== this._id) {\n untracked(() => this.close()); // full close: also resets pending focus, typeahead and placement\n }\n });\n\n effect(() => {\n const isOpen = this.open();\n const loader = this.loader();\n if (!loader) return;\n if (isOpen && untracked(() => this._loaded()) === null) {\n const token = ++this._loadToken;\n this.loading.set(true);\n // A loader that throws or rejects shows an empty menu (never an endless \"Loading...\").\n const done = (items: DropdownItem[]) => {\n if (this._destroyed || token !== this._loadToken) return; // closed / reopened meanwhile: stale answer\n this._loaded.set(items);\n this.loading.set(false);\n if (this.open()) {\n afterNextRender(() => this._place(), { injector: this._injector }); // the real item list is taller than the \"Loading...\" row\n if (this._pendingFocus) this._focusPending();\n }\n };\n new Promise<DropdownItem[]>(resolve => resolve(loader())).then(done, () => done([]));\n } else if (!isOpen) {\n this._loadToken++;\n this.loading.set(false);\n this._loaded.set(null);\n }\n });\n }\n\n toggle(event: Event) {\n event.stopPropagation();\n this._setOpen(!this.open());\n // Safari / Firefox on macOS do not focus a button on click: focus the trigger so Escape and the arrow keys reach the dropdown.\n this._focusTrigger();\n }\n\n select(item: DropdownItem) {\n if (item.disabled) return;\n this._setOpen(false);\n this.itemClick.emit(item);\n this._focusTrigger();\n }\n\n close() {\n if (this.open()) this._setOpen(false);\n }\n\n /**\n * Keyboard contract (WAI-ARIA menu button).\n * Trigger: Enter / Space toggle (opening focuses the first item), ArrowDown opens + first item,\n * ArrowUp opens + last item, ArrowDown/ArrowUp while open move into the menu, Tab closes (focus moves on naturally).\n */\n protected onTriggerKeydown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey || event.altKey) return;\n switch (event.key) {\n case 'Enter':\n case ' ':\n event.preventDefault(); // no native click: we open + focus ourselves\n if (this.open()) this._setOpen(false);\n else this._openAndFocus('first');\n break;\n case 'ArrowDown':\n event.preventDefault();\n if (this.open()) { this._pendingFocus = 'first'; this._focusPending(); }\n else this._openAndFocus('first');\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.open()) { this._pendingFocus = 'last'; this._focusPending(); }\n else this._openAndFocus('last');\n break;\n case 'Tab':\n this.close();\n break;\n }\n }\n\n /** Firefox fires the button click on Space keyup even when keydown was prevented. */\n protected onTriggerKeyup(event: KeyboardEvent) {\n if (event.key === ' ') event.preventDefault();\n }\n\n /**\n * Menu keys (focus on an item): ArrowDown / ArrowUp move with wrap, Home / End jump to first / last,\n * Enter / Space activate the focused item (native button click), Tab / Shift+Tab close and let focus move on from the trigger,\n * printable characters jump to the next item whose label starts with the typed text (typeahead, reset after 500 ms).\n * Disabled items are skipped. Other keys are ignored. Escape is handled on the host.\n */\n protected onMenuKeydown(event: KeyboardEvent) {\n if (event.ctrlKey || event.metaKey || event.altKey) return;\n const items = this._enabledItems();\n const current = items.indexOf(document.activeElement as HTMLElement);\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (items.length) items[current < 0 ? 0 : (current + 1) % items.length].focus();\n return;\n case 'ArrowUp':\n event.preventDefault();\n if (items.length) items[current <= 0 ? items.length - 1 : current - 1].focus();\n return;\n case 'Home':\n event.preventDefault();\n items[0]?.focus();\n return;\n case 'End':\n event.preventDefault();\n items[items.length - 1]?.focus();\n return;\n case 'Tab':\n // Park focus on the trigger first: the menu is removed from the DOM, so the browser's Tab\n // then continues from the trigger (next / previous control) instead of from <body>.\n this._focusTrigger();\n this.close();\n return;\n }\n if (event.key.length === 1 && (event.key !== ' ' || this._typeahead)) {\n event.preventDefault();\n this._typeaheadFocus(event.key.toLowerCase(), items, current);\n }\n }\n\n protected onEscape(event: Event) {\n if (!this.open()) return; // closed: let a surrounding panel / modal handle Escape\n event.stopPropagation();\n this._setOpen(false);\n this._focusTrigger();\n }\n\n private _setOpen(next: boolean) {\n if (this.open() === next) return;\n this.open.set(next);\n if (next) {\n _activeDropdownId.set(this._id);\n afterNextRender(() => this._place(), { injector: this._injector });\n }\n else {\n this._pendingFocus = null;\n this._typeahead = '';\n if (_activeDropdownId() === this._id) _activeDropdownId.set('');\n this.alignEnd.set(false); this.openUp.set(false); this.menuMaxHeight.set(null);\n }\n }\n\n /**\n * Places the open menu from its measured size and the trigger's screen position: it keeps 16px clear of the screen edges, lines up with the trigger's\n * right edge instead of the left when that is the side with room (`align` = auto), opens above the trigger when there is more room there, and is capped to\n * the room left on that side (so it scrolls inside only when it truly does not fit). No layout APIs (server rendering) = the default placement.\n */\n private _place() {\n const host = this._host.nativeElement;\n const trigger = host.querySelector('.dd-trigger') as HTMLElement | null;\n const menu = host.querySelector('.dd-menu') as HTMLElement | null;\n if (!trigger || !menu || typeof window === 'undefined') return;\n const MARGIN = 16, GAP = 6;\n // Measure in the default placement\n this.alignEnd.set(false); this.openUp.set(false); this.menuMaxHeight.set(null);\n this._cdr.detectChanges();\n const t = trigger.getBoundingClientRect();\n const vw = document.documentElement.clientWidth || window.innerWidth;\n const vh = window.innerHeight;\n const width = menu.offsetWidth;\n const naturalHeight = menu.scrollHeight + 2;\n const mode = this.align();\n const fitsStart = t.left + width <= vw - MARGIN;\n const fitsEnd = t.right - width >= MARGIN;\n const end = mode === 'end' || (mode === 'auto' && !fitsStart && (fitsEnd || t.right > vw / 2));\n const below = vh - t.bottom - GAP - MARGIN;\n const above = t.top - GAP - MARGIN;\n const up = naturalHeight > below && above > below;\n this.alignEnd.set(end);\n this.openUp.set(up);\n this.menuMaxHeight.set(Math.max(160, Math.floor(up ? above : below)));\n this._cdr.markForCheck();\n }\n\n private _openAndFocus(which: 'first' | 'last') {\n this._pendingFocus = which;\n this._setOpen(true);\n this._focusPending();\n }\n\n /** Renders the menu synchronously, then focuses the pending first / last enabled item. */\n private _focusPending() {\n this._cdr.detectChanges();\n // a loader is pending (or about to start: its effect has not run yet): the focus is applied when it resolves\n if (this.loading() || (this.loader() !== null && this._loaded() === null)) return;\n const items = this._enabledItems();\n const target = this._pendingFocus === 'last' ? items[items.length - 1] : items[0];\n this._pendingFocus = null;\n target?.focus();\n }\n\n private _typeaheadFocus(char: string, items: HTMLElement[], current: number) {\n this._typeahead += char;\n if (this._typeaheadTimer) clearTimeout(this._typeaheadTimer);\n this._typeaheadTimer = setTimeout(() => { this._typeahead = ''; this._typeaheadTimer = null; }, 500);\n const single = this._typeahead.length === 1 || [...this._typeahead].every(c => c === this._typeahead[0]);\n const needle = single ? this._typeahead[0] : this._typeahead;\n const start = single ? current + 1 : Math.max(current, 0);\n for (let i = 0; i < items.length; i++) {\n const el = items[(start + i) % items.length];\n const text = (el.querySelector('span')?.textContent ?? '').trim().toLowerCase();\n if (text.startsWith(needle)) { el.focus(); return; }\n }\n }\n\n private _enabledItems(): HTMLElement[] {\n return Array.from(this._host.nativeElement.querySelectorAll<HTMLElement>('.dd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mBAAA;IAAA;IAAA,WAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,OAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,WAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,OAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA,EAAA,WAAA,YAAA;GAAA,MAAA;IAAA,WAAA;KAAA,kBAAA;KAAA,kBAAA;IAAA;IAAA,YAAA;KAAA,kBAAA;KAAA,eAAA;IAAA;GAAA;GAAA,UAAA;GAAA,UAhJlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CT,UAAA;GAAA,QAAA,CAAA,mxGAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAqGU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EA7J7B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,YACX;GAAI,iBACC,wBAAwB;GAAM,MACzC;IACJ,oBAAoB;IAGpB,oBAAoB;IAEpB,oBAAoB;IACpB,iBAAiB;GAClB;GAAA,UACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CT,QAAA,CAAA,mxGAAA;EAAA,CAAA"}
@@ -1992,6 +1992,7 @@ var DocumentSendOptionsComponent = class DocumentSendOptionsComponent {
1992
1992
  "loading",
1993
1993
  "noResultsText",
1994
1994
  "minChars",
1995
+ "hideMinCharsHint",
1995
1996
  "debounce",
1996
1997
  "value",
1997
1998
  "displayText",
@@ -9272,6 +9273,7 @@ var SendMessagePanelComponent = class SendMessagePanelComponent {
9272
9273
  "loading",
9273
9274
  "noResultsText",
9274
9275
  "minChars",
9276
+ "hideMinCharsHint",
9275
9277
  "debounce",
9276
9278
  "value",
9277
9279
  "displayText",